summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@lamia.panaceas.james.local>2015-12-19 13:13:57 +0000
committerroot <root@lamia.panaceas.james.local>2015-12-19 14:18:03 +0000
commit1a2238d1bddc823df06f67312d96ccf9de2893cc (patch)
treec58a3944d674a667f133ea5a730f5037e57d3d2e
downloadbootloader-1a2238d1bddc823df06f67312d96ccf9de2893cc.tar.gz
bootloader-1a2238d1bddc823df06f67312d96ccf9de2893cc.tar.bz2
bootloader-1a2238d1bddc823df06f67312d96ccf9de2893cc.zip
CFE from danitool [without hostTools dir]: https://mega.nz/#!mwZyFK7a!CPT3BKC8dEw29kubtdYxhB91G9vIIismTkgzQ3iUy3k
-rwxr-xr-xbuildcfe.sh21
-rwxr-xr-xcfe/build/broadcom/bcm63xx_ram/Makefile76
-rwxr-xr-xcfe/build/broadcom/bcm63xx_rom/Makefile160
-rw-r--r--cfe/cfe/api/Makefile47
-rw-r--r--cfe/cfe/api/cfe_api.c534
-rw-r--r--cfe/cfe/api/cfe_api.h192
-rw-r--r--cfe/cfe/api/cfe_api_int.h168
-rw-r--r--cfe/cfe/api/cfe_error.h101
-rw-r--r--cfe/cfe/applets/Makefile64
-rw-r--r--cfe/cfe/applets/README21
-rw-r--r--cfe/cfe/applets/cfe_applet.lds37
-rw-r--r--cfe/cfe/applets/download.c163
-rw-r--r--cfe/cfe/applets/download.lds12
-rw-r--r--cfe/cfe/applets/minicrt0.S95
-rw-r--r--cfe/cfe/applets/test.c211
-rw-r--r--cfe/cfe/applets/vapitest.S96
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/include/bcm63xx_util.h167
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/include/bcm_common.h32
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/include/bcm_cpu.h32
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/include/bcm_map.h32
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/include/bcmmii.h164
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/include/bcmtypes.h144
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/include/bsp_config.h94
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/include/dev_bcm63xx_eth.h127
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/include/dev_bcm63xx_flash.h38
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/include/jffs2.h251
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/src/Makefile55
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_board.c830
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_cmd.c1878
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_devs.c734
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_env_subr.c277
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_httpd.c1031
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_ldr_elf.c388
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_ldr_raw.c368
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_main.c611
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_net_icmp.c199
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_ram_boot.S88
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_util.c1375
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/src/dev_bcm63xx_eth.c547
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/src/dev_bcm63xx_flash.c629
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/src/dev_bcm63xx_uart.c211
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/src/html/ul.html48
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/src/html/ulinfo.html60
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/src/ram_cfe.mk378
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_ram/src/robosw_reg.c615
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_rom/src/Makefile23
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_rom/src/bcm6368_rom_boot.S548
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_rom/src/bcm6368_sdramDqs.c439
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_rom/src/bcm63xx_impl1_rom_boot.S1818
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_rom/src/bcm63xx_main.c649
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_rom/src/memtest.c1031
-rwxr-xr-xcfe/cfe/arch/mips/board/bcm63xx_rom/src/rom_cfe.mk370
-rw-r--r--cfe/cfe/arch/mips/common/include/addrspace.h63
-rw-r--r--cfe/cfe/arch/mips/common/include/disasm.h61
-rw-r--r--cfe/cfe/arch/mips/common/include/exception.h223
-rw-r--r--cfe/cfe/arch/mips/common/include/exchandler.h85
-rw-r--r--cfe/cfe/arch/mips/common/include/initdata.h68
-rw-r--r--cfe/cfe/arch/mips/common/include/lib_hssubr.h84
-rw-r--r--cfe/cfe/arch/mips/common/include/lib_physio.h100
-rw-r--r--cfe/cfe/arch/mips/common/include/lib_setjmp.h81
-rwxr-xr-xcfe/cfe/arch/mips/common/include/mipsmacros.h376
-rwxr-xr-xcfe/cfe/arch/mips/common/include/segtable.h97
-rwxr-xr-xcfe/cfe/arch/mips/common/src/Makefile38
-rw-r--r--cfe/cfe/arch/mips/common/src/cfe_ram_cached.lds40
-rw-r--r--cfe/cfe/arch/mips/common/src/cfe_ram_uncached.lds40
-rwxr-xr-xcfe/cfe/arch/mips/common/src/cfe_ramapp.lds41
-rwxr-xr-xcfe/cfe/arch/mips/common/src/cfe_rom_cached.lds40
-rw-r--r--cfe/cfe/arch/mips/common/src/cfe_rom_reloc_cached.lds43
-rw-r--r--cfe/cfe/arch/mips/common/src/cfe_rom_reloc_cached_biendian.lds49
-rw-r--r--cfe/cfe/arch/mips/common/src/cfe_rom_reloc_uncached.lds41
-rw-r--r--cfe/cfe/arch/mips/common/src/cfe_rom_uncached.lds39
-rw-r--r--cfe/cfe/arch/mips/common/src/dev_flash_all.S220
-rw-r--r--cfe/cfe/arch/mips/common/src/dev_flashop_engine.S695
-rw-r--r--cfe/cfe/arch/mips/common/src/disasm.c2111
-rw-r--r--cfe/cfe/arch/mips/common/src/exception.S546
-rw-r--r--cfe/cfe/arch/mips/common/src/exchandler.c580
-rwxr-xr-xcfe/cfe/arch/mips/common/src/init_mips.S683
-rwxr-xr-xcfe/cfe/arch/mips/common/src/init_ram.S889
-rw-r--r--cfe/cfe/arch/mips/common/src/lib_hssubr.S194
-rw-r--r--cfe/cfe/arch/mips/common/src/lib_physio.S173
-rw-r--r--cfe/cfe/arch/mips/common/src/lib_setjmp.S94
-rw-r--r--cfe/cfe/arch/mips/common/src/mips_arena.c186
-rwxr-xr-xcfe/cfe/arch/mips/common/src/tools.mk83
-rw-r--r--cfe/cfe/arch/mips/common/src/ui_memtest.c282
-rw-r--r--cfe/cfe/arch/mips/cpu/SIBYTE_PRIVATE_FILES2
-rw-r--r--cfe/cfe/arch/mips/cpu/bcmcore/include/bcm4710.h58
-rw-r--r--cfe/cfe/arch/mips/cpu/bcmcore/include/bcm47xx.h8
-rw-r--r--cfe/cfe/arch/mips/cpu/bcmcore/include/bcmnvram.h123
-rwxr-xr-xcfe/cfe/arch/mips/cpu/bcmcore/include/cpu_config.h62
-rw-r--r--cfe/cfe/arch/mips/cpu/bcmcore/include/sbmips.h670
-rw-r--r--cfe/cfe/arch/mips/cpu/bcmcore/include/sbsdram.h92
-rwxr-xr-xcfe/cfe/arch/mips/cpu/bcmcore/src/Makefile8
-rwxr-xr-xcfe/cfe/arch/mips/cpu/bcmcore/src/bcmcore_arena.c170
-rwxr-xr-xcfe/cfe/arch/mips/cpu/bcmcore/src/bcmcore_cpuinit.S490
-rwxr-xr-xcfe/cfe/arch/mips/cpu/bcmcore/src/bcmcore_l1cache.S219
-rw-r--r--cfe/cfe/dev/SIBYTE_PRIVATE_FILES6
-rw-r--r--cfe/cfe/dev/bcm5700.h1007
-rw-r--r--cfe/cfe/dev/bcm5821.h278
-rw-r--r--cfe/cfe/dev/dc21143.h588
-rw-r--r--cfe/cfe/dev/dev_atapi.c222
-rw-r--r--cfe/cfe/dev/dev_bcm1250.c275
-rw-r--r--cfe/cfe/dev/dev_bcm5700.c2557
-rw-r--r--cfe/cfe/dev/dev_bcm5821.c1592
-rw-r--r--cfe/cfe/dev/dev_dc21143.c2388
-rw-r--r--cfe/cfe/dev/dev_dp83815.c2290
-rw-r--r--cfe/cfe/dev/dev_ds17887clock.c422
-rw-r--r--cfe/cfe/dev/dev_flash.c1367
-rw-r--r--cfe/cfe/dev/dev_ht7520.c167
-rw-r--r--cfe/cfe/dev/dev_ide_common.c1249
-rw-r--r--cfe/cfe/dev/dev_ide_pci.c358
-rw-r--r--cfe/cfe/dev/dev_newflash.c1428
-rw-r--r--cfe/cfe/dev/dev_ns16550.c255
-rw-r--r--cfe/cfe/dev/dev_ns16550_pci.c114
-rw-r--r--cfe/cfe/dev/dev_null.c142
-rw-r--r--cfe/cfe/dev/dev_promice.c402
-rw-r--r--cfe/cfe/dev/dev_sp1011.c151
-rw-r--r--cfe/cfe/dev/dev_tulip.c2985
-rw-r--r--cfe/cfe/dev/dp83815.h559
-rw-r--r--cfe/cfe/dev/ns16550.h143
-rw-r--r--cfe/cfe/dev/pci_devs.c79
-rw-r--r--cfe/cfe/hosttools/Makefile12
-rw-r--r--cfe/cfe/hosttools/README49
-rw-r--r--cfe/cfe/hosttools/installboot.c352
-rw-r--r--cfe/cfe/hosttools/makereg.c481
-rw-r--r--cfe/cfe/hosttools/memconfig.c654
-rw-r--r--cfe/cfe/hosttools/mkbootimage.c314
-rw-r--r--cfe/cfe/hosttools/mkflashimage.c347
-rw-r--r--cfe/cfe/hosttools/mkpcidb.c157
-rwxr-xr-xcfe/cfe/include/cfe.h101
-rw-r--r--cfe/cfe/include/cfe_autoboot.h71
-rw-r--r--cfe/cfe/include/cfe_boot.h58
-rw-r--r--cfe/cfe/include/cfe_bootblock.h129
-rwxr-xr-xcfe/cfe/include/cfe_console.h92
-rw-r--r--cfe/cfe/include/cfe_devfuncs.h76
-rw-r--r--cfe/cfe/include/cfe_device.h118
-rw-r--r--cfe/cfe/include/cfe_error.h110
-rw-r--r--cfe/cfe/include/cfe_fileops.h109
-rw-r--r--cfe/cfe/include/cfe_flashimage.h64
-rw-r--r--cfe/cfe/include/cfe_iocb.h211
-rw-r--r--cfe/cfe/include/cfe_ioctl.h167
-rw-r--r--cfe/cfe/include/cfe_irq.h103
-rw-r--r--cfe/cfe/include/cfe_loader.h86
-rw-r--r--cfe/cfe/include/cfe_mem.h79
-rw-r--r--cfe/cfe/include/cfe_timer.h74
-rw-r--r--cfe/cfe/include/cfe_xiocb.h202
-rw-r--r--cfe/cfe/include/dev_flash.h168
-rw-r--r--cfe/cfe/include/dev_ide.h90
-rw-r--r--cfe/cfe/include/dev_ide_common.h204
-rw-r--r--cfe/cfe/include/dev_newflash.h344
-rw-r--r--cfe/cfe/include/elf.h194
-rw-r--r--cfe/cfe/include/env_subr.h117
-rwxr-xr-xcfe/cfe/include/foxconnCfg.h9
-rw-r--r--cfe/cfe/include/lib_arena.h76
-rw-r--r--cfe/cfe/include/lib_malloc.h78
-rwxr-xr-xcfe/cfe/include/lib_printf.h69
-rw-r--r--cfe/cfe/include/lib_queue.h85
-rw-r--r--cfe/cfe/include/lib_string.h117
-rw-r--r--cfe/cfe/include/lib_types.h120
-rw-r--r--cfe/cfe/include/socregs.h63
-rwxr-xr-xcfe/cfe/include/tftpd.h26
-rw-r--r--cfe/cfe/include/ui_command.h140
-rw-r--r--cfe/cfe/lib/lib_arena.c389
-rw-r--r--cfe/cfe/lib/lib_malloc.c620
-rw-r--r--cfe/cfe/lib/lib_misc.c229
-rw-r--r--cfe/cfe/lib/lib_printf.c442
-rw-r--r--cfe/cfe/lib/lib_qsort.c88
-rw-r--r--cfe/cfe/lib/lib_queue.c219
-rw-r--r--cfe/cfe/lib/lib_string.c386
-rw-r--r--cfe/cfe/lib/lib_string2.c96
-rwxr-xr-xcfe/cfe/lzma/LzmaDecode.c584
-rwxr-xr-xcfe/cfe/lzma/LzmaDecode.h113
-rwxr-xr-xcfe/cfe/lzma/LzmaDecodeSize.c712
-rwxr-xr-xcfe/cfe/lzma/LzmaStateDecode.c521
-rwxr-xr-xcfe/cfe/lzma/LzmaStateDecode.h96
-rwxr-xr-xcfe/cfe/lzma/LzmaStateTest.c195
-rwxr-xr-xcfe/cfe/lzma/LzmaTest.c342
-rwxr-xr-xcfe/cfe/lzma/LzmaTypes.h45
-rwxr-xr-xcfe/cfe/lzma/Makefile5
-rwxr-xr-xcfe/cfe/lzma/dcapi.c50
-rw-r--r--cfe/cfe/main/cfe.mk301
-rw-r--r--cfe/cfe/main/cfe_attach.c265
-rw-r--r--cfe/cfe/main/cfe_autoboot.c456
-rw-r--r--cfe/cfe/main/cfe_background.c174
-rw-r--r--cfe/cfe/main/cfe_boot.c248
-rwxr-xr-xcfe/cfe/main/cfe_console.c1190
-rwxr-xr-xcfe/cfe/main/cfe_devfuncs.c279
-rw-r--r--cfe/cfe/main/cfe_error.c134
-rw-r--r--cfe/cfe/main/cfe_fatfs.c1983
-rwxr-xr-xcfe/cfe/main/cfe_filesys.c343
-rw-r--r--cfe/cfe/main/cfe_httpfs.c396
-rwxr-xr-xcfe/cfe/main/cfe_iocb_dispatch.c647
-rw-r--r--cfe/cfe/main/cfe_ldr_elf.c396
-rw-r--r--cfe/cfe/main/cfe_ldr_raw.c360
-rw-r--r--cfe/cfe/main/cfe_ldr_srec.c557
-rw-r--r--cfe/cfe/main/cfe_link.mk26
-rw-r--r--cfe/cfe/main/cfe_loader.c135
-rw-r--r--cfe/cfe/main/cfe_main.c636
-rw-r--r--cfe/cfe/main/cfe_mem.c256
-rw-r--r--cfe/cfe/main/cfe_rawfs.c293
-rw-r--r--cfe/cfe/main/cfe_savedata.c123
-rw-r--r--cfe/cfe/main/cfe_timer.c286
-rwxr-xr-xcfe/cfe/main/cfe_version.mk12
-rw-r--r--cfe/cfe/main/cfe_xreq.c346
-rw-r--r--cfe/cfe/main/cfe_zlibfs.c453
-rw-r--r--cfe/cfe/main/env_subr.c474
-rw-r--r--cfe/cfe/main/nvram_subr.c300
-rw-r--r--cfe/cfe/main/nvram_subr.h54
-rw-r--r--cfe/cfe/net/README17
-rw-r--r--cfe/cfe/net/dev_tcpconsole.c341
-rw-r--r--cfe/cfe/net/mii.h187
-rwxr-xr-xcfe/cfe/net/net_api.c1095
-rwxr-xr-xcfe/cfe/net/net_api.h179
-rwxr-xr-xcfe/cfe/net/net_arp.c865
-rw-r--r--cfe/cfe/net/net_dhcp.c869
-rwxr-xr-xcfe/cfe/net/net_dns.c354
-rw-r--r--cfe/cfe/net/net_ebuf.h165
-rw-r--r--cfe/cfe/net/net_ether.c705
-rw-r--r--cfe/cfe/net/net_ether.h89
-rw-r--r--cfe/cfe/net/net_icmp.c312
-rwxr-xr-xcfe/cfe/net/net_ip.c722
-rwxr-xr-xcfe/cfe/net/net_ip.h159
-rw-r--r--cfe/cfe/net/net_ip_internal.h128
-rwxr-xr-xcfe/cfe/net/net_nmrp.c656
-rwxr-xr-xcfe/cfe/net/net_nmrp.h1
-rwxr-xr-xcfe/cfe/net/net_tcp.c2215
-rwxr-xr-xcfe/cfe/net/net_tcp.h83
-rwxr-xr-xcfe/cfe/net/net_tcp_internal.h244
-rw-r--r--cfe/cfe/net/net_tcpbuf.c298
-rw-r--r--cfe/cfe/net/net_tcpbuf.h83
-rw-r--r--cfe/cfe/net/net_tftp.c921
-rw-r--r--cfe/cfe/net/net_udp.c637
-rw-r--r--cfe/cfe/pccons/Makefile3
-rw-r--r--cfe/cfe/pccons/README19
-rw-r--r--cfe/cfe/pccons/dev_pcconsole.c339
-rw-r--r--cfe/cfe/pccons/dev_pcconsole2.c298
-rw-r--r--cfe/cfe/pccons/kbd_subr.c371
-rw-r--r--cfe/cfe/pccons/kbd_subr.h82
-rw-r--r--cfe/cfe/pccons/pcibios.h72
-rw-r--r--cfe/cfe/pccons/vga.h76
-rw-r--r--cfe/cfe/pccons/vga_subr.c285
-rw-r--r--cfe/cfe/pccons/vga_subr.h82
-rw-r--r--cfe/cfe/pccons/vgainit.c1164
-rw-r--r--cfe/cfe/pccons/x86mem.c423
-rw-r--r--cfe/cfe/pccons/x86mem.h109
-rw-r--r--cfe/cfe/pci/cfe_pci.h52
-rw-r--r--cfe/cfe/pci/devlist2h.awk220
-rw-r--r--cfe/cfe/pci/ldtinit.c641
-rw-r--r--cfe/cfe/pci/ldtreg.h184
-rw-r--r--cfe/cfe/pci/pci_machdep.h35
-rw-r--r--cfe/cfe/pci/pci_subr.c710
-rw-r--r--cfe/cfe/pci/pciconf.c1296
-rw-r--r--cfe/cfe/pci/pcidevs1355
-rw-r--r--cfe/cfe/pci/pcidevs.h1360
-rw-r--r--cfe/cfe/pci/pcidevs_data.h5873
-rw-r--r--cfe/cfe/pci/pcireg.h615
-rw-r--r--cfe/cfe/pci/pcivar.h216
-rw-r--r--cfe/cfe/ui/ui_cmddisp.c252
-rw-r--r--cfe/cfe/ui/ui_command.c990
-rw-r--r--cfe/cfe/ui/ui_devcmds.c101
-rw-r--r--cfe/cfe/ui/ui_envcmds.c190
-rw-r--r--cfe/cfe/ui/ui_examcmds.c713
-rw-r--r--cfe/cfe/ui/ui_flash.c554
-rw-r--r--cfe/cfe/ui/ui_loadcmds.c366
-rw-r--r--cfe/cfe/ui/ui_memcmds.c171
-rw-r--r--cfe/cfe/ui/ui_misccmds.c178
-rw-r--r--cfe/cfe/ui/ui_netcmds.c710
-rw-r--r--cfe/cfe/ui/ui_pcicmds.c282
-rw-r--r--cfe/cfe/ui/ui_tcpcmds.c828
-rw-r--r--cfe/cfe/ui/ui_test_disk.c439
-rw-r--r--cfe/cfe/ui/ui_test_ether.c202
-rw-r--r--cfe/cfe/ui/ui_test_flash.c260
-rw-r--r--cfe/cfe/ui/ui_test_uart.c117
-rwxr-xr-xcfe/cfe/ui/ui_tftpd.c119
-rw-r--r--cfe/cfe/ui/ui_toyclock.c275
-rw-r--r--cfe/cfe/ui/url.c357
-rw-r--r--cfe/cfe/ui/url.h52
-rw-r--r--cfe/cfe/usb/Makefile8
-rw-r--r--cfe/cfe/usb/README183
-rw-r--r--cfe/cfe/usb/ohci.c2126
-rw-r--r--cfe/cfe/usb/ohci.h490
-rw-r--r--cfe/cfe/usb/usbchap9.h389
-rw-r--r--cfe/cfe/usb/usbd.c1215
-rw-r--r--cfe/cfe/usb/usbd.h308
-rw-r--r--cfe/cfe/usb/usbdebug.c307
-rw-r--r--cfe/cfe/usb/usbdevs.c168
-rw-r--r--cfe/cfe/usb/usbeth.c850
-rw-r--r--cfe/cfe/usb/usbeth.h112
-rw-r--r--cfe/cfe/usb/usbhack.c528
-rw-r--r--cfe/cfe/usb/usbhack.h66
-rw-r--r--cfe/cfe/usb/usbhack.mk23
-rw-r--r--cfe/cfe/usb/usbhid.c664
-rw-r--r--cfe/cfe/usb/usbhub.c912
-rw-r--r--cfe/cfe/usb/usbmain.c367
-rw-r--r--cfe/cfe/usb/usbmass.c1199
-rw-r--r--cfe/cfe/usb/usbserial.c713
-rw-r--r--cfe/cfe/vendor/Makefile2
-rw-r--r--cfe/cfe/vendor/cfe_vendor_cmds.c27
-rw-r--r--cfe/cfe/vendor/cfe_vendor_iocb.h87
-rw-r--r--cfe/cfe/vendor/cfe_vendor_iocb_dispatch.c179
-rw-r--r--cfe/cfe/vendor/cfe_vendor_xiocb.h91
-rw-r--r--cfe/cfe/vendor/cfe_vendor_xreq.c222
-rw-r--r--cfe/cfe/verif/Makefile7
-rw-r--r--cfe/cfe/verif/readme.txt342
-rw-r--r--cfe/cfe/verif/ui_vapi.c300
-rw-r--r--cfe/cfe/verif/vapi.S1150
-rw-r--r--cfe/cfe/verif/vapi.h242
-rw-r--r--cfe/cfe/verif/vapisubr.c122
-rw-r--r--cfe/cfe/verif/vapitest.S108
-rw-r--r--cfe/cfe/x86emu/LICENSE17
-rw-r--r--cfe/cfe/x86emu/Makefile2
-rw-r--r--cfe/cfe/x86emu/README12
-rw-r--r--cfe/cfe/x86emu/debug.c462
-rw-r--r--cfe/cfe/x86emu/decode.c1000
-rw-r--r--cfe/cfe/x86emu/fpu.c945
-rw-r--r--cfe/cfe/x86emu/ops.c11686
-rw-r--r--cfe/cfe/x86emu/ops2.c2802
-rw-r--r--cfe/cfe/x86emu/prim_ops.c2915
-rw-r--r--cfe/cfe/x86emu/sys.c603
-rw-r--r--cfe/cfe/x86emu/validate.c765
-rw-r--r--cfe/cfe/x86emu/x86emu.h198
-rw-r--r--cfe/cfe/x86emu/x86emu/debug.h212
-rw-r--r--cfe/cfe/x86emu/x86emu/decode.h87
-rw-r--r--cfe/cfe/x86emu/x86emu/fpu.h61
-rw-r--r--cfe/cfe/x86emu/x86emu/fpu_regs.h115
-rw-r--r--cfe/cfe/x86emu/x86emu/ops.h45
-rw-r--r--cfe/cfe/x86emu/x86emu/ops_protos.h277
-rw-r--r--cfe/cfe/x86emu/x86emu/prim_asm.h971
-rw-r--r--cfe/cfe/x86emu/x86emu/prim_ops.h231
-rw-r--r--cfe/cfe/x86emu/x86emu/regs.h351
-rw-r--r--cfe/cfe/x86emu/x86emu/types.h89
-rw-r--r--cfe/cfe/x86emu/x86emu/x86emui.h109
-rw-r--r--cfe/cfe/zlib/ChangeLog471
-rw-r--r--cfe/cfe/zlib/FAQ72
-rw-r--r--cfe/cfe/zlib/INDEX86
-rw-r--r--cfe/cfe/zlib/Make_vms.com115
-rw-r--r--cfe/cfe/zlib/Makefile28
-rw-r--r--cfe/cfe/zlib/Makefile.in174
-rw-r--r--cfe/cfe/zlib/Makefile.orig174
-rw-r--r--cfe/cfe/zlib/Makefile.riscos151
-rw-r--r--cfe/cfe/zlib/README148
-rw-r--r--cfe/cfe/zlib/adler32.c48
-rw-r--r--cfe/cfe/zlib/algorithm.txt213
-rw-r--r--cfe/cfe/zlib/compress.c68
-rwxr-xr-xcfe/cfe/zlib/configure212
-rw-r--r--cfe/cfe/zlib/crc32.c162
-rw-r--r--cfe/cfe/zlib/deflate.c1350
-rw-r--r--cfe/cfe/zlib/deflate.h318
-rw-r--r--cfe/cfe/zlib/descrip.mms48
-rw-r--r--cfe/cfe/zlib/example.c556
-rw-r--r--cfe/cfe/zlib/gzio.c875
-rw-r--r--cfe/cfe/zlib/infblock.c398
-rw-r--r--cfe/cfe/zlib/infblock.h39
-rw-r--r--cfe/cfe/zlib/infcodes.c257
-rw-r--r--cfe/cfe/zlib/infcodes.h27
-rw-r--r--cfe/cfe/zlib/inffast.c170
-rw-r--r--cfe/cfe/zlib/inffast.h17
-rw-r--r--cfe/cfe/zlib/inffixed.h151
-rw-r--r--cfe/cfe/zlib/inflate.c366
-rw-r--r--cfe/cfe/zlib/inftrees.c455
-rw-r--r--cfe/cfe/zlib/inftrees.h58
-rw-r--r--cfe/cfe/zlib/infutil.c87
-rw-r--r--cfe/cfe/zlib/infutil.h98
-rw-r--r--cfe/cfe/zlib/maketree.c85
-rw-r--r--cfe/cfe/zlib/minigzip.c320
-rw-r--r--cfe/cfe/zlib/trees.c1214
-rw-r--r--cfe/cfe/zlib/trees.h128
-rw-r--r--cfe/cfe/zlib/uncompr.c58
-rw-r--r--cfe/cfe/zlib/zconf.h279
-rw-r--r--cfe/cfe/zlib/zlib.3107
-rw-r--r--cfe/cfe/zlib/zlib.h893
-rw-r--r--cfe/cfe/zlib/zutil.c225
-rw-r--r--cfe/cfe/zlib/zutil.h220
-rwxr-xr-xcfe/docs/cfe.pdfbin0 -> 395677 bytes
-rwxr-xr-xshared/broadcom/include/bcm963xx/6328_common.h299
-rwxr-xr-xshared/broadcom/include/bcm963xx/6328_map.h1886
-rwxr-xr-xshared/broadcom/include/bcm963xx/6362_common.h326
-rwxr-xr-xshared/broadcom/include/bcm963xx/6362_map.h2251
-rwxr-xr-xshared/broadcom/include/bcm963xx/6368_common.h270
-rwxr-xr-xshared/broadcom/include/bcm963xx/6368_map.h1592
-rwxr-xr-xshared/broadcom/include/bcm963xx/6816_common.h351
-rwxr-xr-xshared/broadcom/include/bcm963xx/6816_map.h2322
-rwxr-xr-xshared/broadcom/include/bcm963xx/mocablock.h144
-rwxr-xr-xshared/broadcom/include/bcm963xx/robosw_reg.h169
-rwxr-xr-xshared/broadcom/include/bcm963xx/xtmprocregs.h602
-rwxr-xr-xshared/opensource/boardparms/bcm963xx/Makefile16
-rwxr-xr-xshared/opensource/boardparms/bcm963xx/boardparms.c3712
-rwxr-xr-xshared/opensource/boardparms/bcm963xx/boardparms_voice.c8804
-rwxr-xr-xshared/opensource/flash/Makefile41
-rwxr-xr-xshared/opensource/flash/cfiflash.c1112
-rwxr-xr-xshared/opensource/flash/flash_api.c350
-rwxr-xr-xshared/opensource/flash/flash_common.c280
-rwxr-xr-xshared/opensource/flash/nandflash.c1260
-rwxr-xr-xshared/opensource/flash/spiflash.c969
-rwxr-xr-xshared/opensource/include/bcm963xx/6328_cpu.h150
-rwxr-xr-xshared/opensource/include/bcm963xx/6328_intr.h120
-rwxr-xr-xshared/opensource/include/bcm963xx/6328_map_part.h1325
-rwxr-xr-xshared/opensource/include/bcm963xx/6362_cpu.h150
-rwxr-xr-xshared/opensource/include/bcm963xx/6362_intr.h123
-rwxr-xr-xshared/opensource/include/bcm963xx/6362_map_part.h1478
-rwxr-xr-xshared/opensource/include/bcm963xx/6368_cpu.h150
-rwxr-xr-xshared/opensource/include/bcm963xx/6368_intr.h123
-rwxr-xr-xshared/opensource/include/bcm963xx/6368_map_part.h1035
-rwxr-xr-xshared/opensource/include/bcm963xx/6816_cpu.h150
-rwxr-xr-xshared/opensource/include/bcm963xx/6816_intr.h116
-rwxr-xr-xshared/opensource/include/bcm963xx/6816_map_part.h1487
-rwxr-xr-xshared/opensource/include/bcm963xx/bcmSpi.h55
-rwxr-xr-xshared/opensource/include/bcm963xx/bcmSpiRes.h101
-rwxr-xr-xshared/opensource/include/bcm963xx/bcmTag.h175
-rwxr-xr-xshared/opensource/include/bcm963xx/bcm_hwdefs.h193
-rwxr-xr-xshared/opensource/include/bcm963xx/bcmnetlink.h47
-rwxr-xr-xshared/opensource/include/bcm963xx/boardparms.h453
-rwxr-xr-xshared/opensource/include/bcm963xx/boardparms_voice.h392
-rw-r--r--shared/opensource/include/bcm963xx/fap_mod_size.h2
-rwxr-xr-xshared/opensource/include/bcm963xx/flash_api.h90
-rwxr-xr-xshared/opensource/include/bcm963xx/flash_common.h103
-rwxr-xr-xshared/opensource/include/bcm963xx/gpio_drv.h40
-rwxr-xr-xshared/opensource/include/bcm963xx/wan_det.h245
-rwxr-xr-xshared/opensource/include/bcm963xx/wps_led.h28
-rwxr-xr-xshared/opensource/spi/Makefile30
-rwxr-xr-xshared/opensource/spi/bcmHsSpi.c898
-rwxr-xr-xshared/opensource/spi/bcmLegSpi.c774
-rwxr-xr-xshared/opensource/spi/bcmSpiRes.c660
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/.fakeroot.000000
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/lib/ld-uClibc-0.9.29.sobin0 -> 22600 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/lib/ld-uClibc.so.01
l---------uclibc-crosstools-gcc-4.4.2-1/lib/libc.so.01
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/lib/libcrypt-0.9.29.sobin0 -> 11560 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/lib/libcrypt.so.01
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/lib/libdl-0.9.29.sobin0 -> 9452 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/lib/libdl.so.01
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/lib/libm-0.9.29.sobin0 -> 104028 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/lib/libm.so.01
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/lib/libnsl-0.9.29.sobin0 -> 1712 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/lib/libnsl.so.01
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/lib/libpthread-0.9.29.sobin0 -> 94007 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/lib/libpthread.so.01
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/lib/libresolv-0.9.29.sobin0 -> 1716 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/lib/libresolv.so.01
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/lib/librt-0.9.29.sobin0 -> 4588 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/lib/librt.so.01
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/lib/libthread_db-0.9.29.sobin0 -> 13400 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/lib/libthread_db.so.11
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/lib/libuClibc-0.9.29.sobin0 -> 410084 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/lib/libutil-0.9.29.sobin0 -> 4884 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/lib/libutil.so.01
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/ldconfigbin0 -> 22788 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/lddbin0 -> 14280 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-addr2line1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-ar1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-as1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-c++1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-c++filt1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-cc1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-cpp1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-g++1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gcc1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gcc-4.4.21
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gccbug1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gcov1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gdb1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gprof1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-ld1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-ldconfig1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-ldd1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-nm1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-objcopy1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-objdump1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-ranlib1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-readelf1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-size1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-sstrip1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-strings1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-strip1
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-addr2linebin0 -> 3171381 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-arbin0 -> 3303875 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-asbin0 -> 4688774 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-c++bin0 -> 461847 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-c++filtbin0 -> 3149852 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-cc1
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-cppbin0 -> 461124 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-g++bin0 -> 461847 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gccbin0 -> 460197 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gcc-4.4.2bin0 -> 460197 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gccbug558
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gcovbin0 -> 90782 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gdbbin0 -> 2970040 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gprofbin0 -> 3563218 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-ldbin0 -> 5051954 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-ldconfig1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-ldd1
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-nmbin0 -> 3204106 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-objcopybin0 -> 3749936 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-objdumpbin0 -> 4047818 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-ranlibbin0 -> 3303906 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-readelfbin0 -> 589865 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-sizebin0 -> 3196486 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-sstripbin0 -> 33954 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-stringsbin0 -> 3173046 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-stripbin0 -> 3749927 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/a.out.h5
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/alloca.h43
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/ar.h48
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/ftp.h105
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/inet.h106
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/nameser.h557
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/nameser_compat.h183
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/telnet.h316
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/tftp.h76
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/errno-base.h39
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/errno.h109
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/fcntl.h151
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/int-l64.h32
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/int-ll64.h37
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/ioctl.h96
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/mman.h41
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/poll.h37
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/resource.h68
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/siginfo.h261
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/signal.h28
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/statfs.h80
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/auxvec.h4
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/byteorder.h19
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/cachectl.h26
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/errno.h125
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/fcntl.h61
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/ioctl.h89
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/ioctls.h109
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/ipcbuf.h28
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/mman.h77
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/msgbuf.h47
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/param.h25
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/poll.h9
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/posix_types.h73
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/ptrace.h116
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/resource.h35
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/sembuf.h22
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/setup.h7
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/sgidefs.h44
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/shmbuf.h38
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/sigcontext.h78
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/siginfo.h113
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/signal.h123
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/socket.h82
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/sockios.h26
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/stat.h132
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/statfs.h96
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/swab.h55
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/sysmips.h25
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/termbits.h226
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/termios.h80
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/types.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/unistd.h986
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/assert.h82
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/atomic.h261
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/atomic.h303
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/byteswap.h87
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/cmathcalls.h158
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/confname.h606
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/dirent.h61
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/dlfcn.h66
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/elfclass.h14
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/endian.h16
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/environments.h78
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/errno.h59
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/errno_values.h135
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/fcntl.h261
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/fenv.h77
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/fenvinline.h8
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/getopt.h181
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/huge_val.h55
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/huge_valf.h53
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/huge_vall.h29
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/in.h170
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/inf.h30
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/initspin.h28
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/ioctl-types.h76
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/ioctls.h109
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/ipc.h55
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/kernel_types.h79
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/local_lim.h87
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/locale.h46
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/mathcalls.h365
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/mathdef.h48
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/mathinline.h12
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/mman.h106
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/mqueue.h32
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/msq.h93
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/nan.h53
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/netdb.h33
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/poll.h50
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/posix1_lim.h169
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/posix2_lim.h91
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/posix_opt.h180
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/pthreadtypes.h142
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/resource.h233
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sched.h132
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/select.h35
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sem.h85
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/setjmp.h72
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/shm.h94
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigaction.h89
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigcontext.h84
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigcontextinfo.h43
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/siginfo.h311
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/signum.h79
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigset.h125
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigstack.h55
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigthread.h38
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sockaddr.h40
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/socket.h328
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/stackinfo.h28
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/stat.h203
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/statfs.h72
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/statvfs.h107
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/stdio.h23
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/stdio_lim.h41
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/syscalls.h1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sysnum.h1028
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/termios.h217
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/time.h79
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/types.h209
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/typesizes.h66
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_arch_features.h41
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_clk_tck.h8
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_config.h189
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_ctype.h279
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_errno.h43
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_fpmax.h122
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_local_lim.h33
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_locale.h380
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_mutex.h88
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_page.h35
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_pthread.h50
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_stdio.h517
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_touplow.h55
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_uwchar.h57
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_va_copy.h40
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uio.h50
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/ustat.h31
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/utmp.h125
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/utmpx.h103
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/utsname.h29
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/waitflags.h38
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/waitstatus.h106
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/wchar.h26
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/wordsize.h19
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/xopen_lim.h150
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/byteswap.h40
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/complex.h107
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/cpio.h74
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/crypt.h41
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/ctype.h383
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/dirent.h293
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/dlfcn.h201
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/drm.h744
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/drm_mode.h268
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/drm_sarea.h82
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/i810_drm.h281
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/i830_drm.h342
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/i915_drm.h670
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/mga_drm.h419
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/r128_drm.h326
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/radeon_drm.h754
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/savage_drm.h210
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/sis_drm.h67
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/via_drm.h275
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/elf.h2928
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/endian.h58
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/err.h58
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/errno.h77
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/error.h52
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/fcntl.h228
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/features.h424
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/fnmatch.h72
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/fpu_control.h100
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/getopt.h4
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/glob.h208
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/gnu-versions.h53
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/grp.h207
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/hp-timing.h83
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/ieee754.h199
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/inttypes.h328
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/langinfo.h623
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/lastlog.h4
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/libc-internal.h3
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/libc-symbols.h726
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/libgen.h40
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/limits.h153
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/link.h238
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/acct.h116
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/adb.h44
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/adfs_fs.h44
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/affs_hardblocks.h68
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/agpgart.h111
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/aio_abi.h111
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/apm_bios.h135
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/arcfb.h8
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atalk.h43
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm.h241
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_eni.h23
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_he.h20
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_idt77105.h28
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_nicstar.h53
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_tcp.h61
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_zatm.h52
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmapi.h29
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmarp.h41
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmbr2684.h117
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmclip.h21
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmdev.h215
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmioc.h41
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmlec.h98
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmmpc.h126
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmppp.h24
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmsap.h162
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmsvc.h55
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/audit.h361
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/auto_fs.h79
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/auto_fs4.h164
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/auxvec.h35
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ax25.h116
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/b1lli.h73
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/baycom.h39
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/bfs_fs.h81
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/binfmts.h20
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/blkpg.h58
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/blktrace_api.h141
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/bpqether.h41
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/bsg.h65
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/byteorder/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/byteorder/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/byteorder/big_endian.h105
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/byteorder/little_endian.h105
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can.h111
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can/bcm.h67
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can/error.h93
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can/raw.h31
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/capability.h347
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/capi.h131
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cciss_ioctl.h214
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cdk.h486
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cdrom.h912
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cgroupstats.h71
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/chio.h168
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cm4000_cs.h62
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cn_proc.h100
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/coda.h737
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/coda_psdev.h27
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/coff.h351
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/comstats.h119
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/connector.h98
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/const.h24
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cramfs_fs.h93
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cuda.h28
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cyclades.h506
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cycx_cfm.h101
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dcbnl.h342
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dccp.h218
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dlm.h77
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dlm_device.h108
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dlm_netlink.h58
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dlm_plock.h44
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dlmconstants.h163
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dm-ioctl.h302
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dn.h149
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dqblk_xfs.h157
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/audio.h135
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/ca.h90
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/dmx.h151
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/frontend.h385
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/net.h52
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/osd.h144
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/version.h29
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/video.h272
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/edd.h191
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/efs_fs_sb.h62
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/elf-em.h55
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/elf-fdpic.h62
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/elf.h377
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/elfcore.h95
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/errno.h7
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/errqueue.h26
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ethtool.h530
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/eventpoll.h54
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ext2_fs.h556
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fadvise.h21
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/falloc.h6
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fb.h393
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fcntl.h44
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fd.h380
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fdreg.h137
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fib_rules.h71
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fiemap.h66
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/filter.h128
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/firewire-cdev.h634
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/firewire-constants.h67
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/flat.h58
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fs.h356
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fuse.h480
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/futex.h151
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/gameport.h28
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/gen_stats.h67
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/generic_serial.h36
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/genetlink.h83
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/gfs2_ondisk.h451
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/gigaset_dev.h30
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hayesesp.h17
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdlc.h23
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdlc/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdlc/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdlc/ioctl.h81
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdlcdrv.h110
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdreg.h642
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hid.h67
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hiddev.h212
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hidraw.h47
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hpet.h23
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hysdn_if.h33
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/i2c-dev.h71
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/i2c.h149
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/i2o-dev.h421
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/i8k.h46
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/icmp.h97
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/icmpv6.h164
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if.h223
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_addr.h61
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_addrlabel.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_arcnet.h138
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_arp.h156
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_bonding.h125
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_bridge.h104
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_cablemodem.h22
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_ec.h36
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_eql.h54
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_ether.h121
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_fc.h51
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_fddi.h108
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_frad.h127
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_hippi.h158
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_infiniband.h29
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_link.h191
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_ltalk.h9
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_packet.h139
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_phonet.h16
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_plip.h28
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_ppp.h173
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_pppol2tp.h66
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_pppox.h123
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_slip.h30
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_strip.h27
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_tr.h95
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_tun.h87
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_tunnel.h69
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_vlan.h62
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/igmp.h129
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/in.h254
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/in6.h274
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/in_route.h32
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/inet_diag.h124
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/inotify.h73
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/input.h982
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ioctl.h7
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ip.h136
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ip6_tunnel.h32
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ip_vs.h405
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipc.h81
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipmi.h456
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipmi_msgdefs.h121
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipsec.h47
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipv6.h159
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipv6_route.h58
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipx.h75
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/irda.h254
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/irqnr.h8
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn.h142
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn/capicmd.h115
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn_divertif.h26
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn_ppp.h67
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdnif.h56
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/iso_fs.h165
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ivtv.h69
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ivtvfb.h38
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ixjuser.h720
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/jffs2.h222
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/joystick.h136
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/kd.h182
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/kdev_t.h11
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/kernel.h51
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/kernelcapi.h47
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/keyboard.h442
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/keyctl.h56
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/limits.h20
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/llc.h73
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/loop.h90
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/lp.h100
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/magic.h53
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/major.h176
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/map_to_7segment.h187
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/matroxfb.h43
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mempolicy.h56
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/meye.h66
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mii.h150
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/minix_fs.h106
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mman.h13
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mmtimer.h56
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mqueue.h53
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mroute.h141
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mroute6.h137
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/msdos_fs.h165
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/msg.h75
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mtio.h206
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/n_r3964.h99
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nbd.h68
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ncp.h198
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ncp_fs.h147
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ncp_mount.h72
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ncp_no.h19
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/neighbour.h161
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/net.h55
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/net_dropmon.h57
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netdevice.h92
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter.h59
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nf_conntrack_common.h148
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nf_conntrack_ftp.h19
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nf_conntrack_sctp.h26
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nf_conntrack_tcp.h47
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nf_conntrack_tuple_common.h13
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nfnetlink.h51
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nfnetlink_compat.h62
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nfnetlink_conntrack.h172
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nfnetlink_log.h96
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nfnetlink_queue.h90
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/x_tables.h175
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_CLASSIFY.h10
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_CONNMARK.h32
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_CONNSECMARK.h15
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_DSCP.h26
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_LED.h15
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_MARK.h27
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_NFLOG.h20
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_NFQUEUE.h18
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_RATEEST.h15
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_SECMARK.h28
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_TCPMSS.h12
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_TCPOPTSTRIP.h13
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_TPROXY.h14
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_cluster.h17
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_comment.h10
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_connbytes.h27
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_connlimit.h20
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_connmark.h25
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_conntrack.h84
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_dccp.h25
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_dscp.h31
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_esp.h16
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_hashlimit.h68
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_helper.h8
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_iprange.h19
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_length.h11
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_limit.h24
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_mac.h8
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_mark.h16
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_multiport.h32
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_owner.h18
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_physdev.h23
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_pkttype.h8
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_policy.h64
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_quota.h20
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_rateest.h37
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_realm.h12
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_recent.h28
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_sctp.h92
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_state.h13
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_statistic.h36
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_string.h35
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_tcpmss.h11
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_tcpudp.h38
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_time.h25
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_u32.h40
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_arp.h19
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_arp/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_arp/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_arp/arp_tables.h218
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_arp/arpt_mangle.h26
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge.h27
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_802_3.h61
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_among.h65
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_arp.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_arpreply.h11
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_ip.h43
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_limit.h23
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_log.h19
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_mark_m.h15
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_mark_t.h24
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_nat.h14
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_pkttype.h11
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_redirect.h11
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_stp.h46
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_ulog.h36
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_vlan.h20
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebtables.h275
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_decnet.h72
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4.h75
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ip_queue.h64
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ip_tables.h236
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_CLASSIFY.h7
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_CONNMARK.h19
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_DSCP.h18
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_ECN.h31
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_LOG.h18
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_MARK.h18
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_NFQUEUE.h16
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_REJECT.h20
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_SAME.h19
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_TCPMSS.h9
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_TOS.h12
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_TTL.h21
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_ULOG.h49
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_addrtype.h25
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_ah.h16
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_comment.h10
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_connbytes.h18
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_connmark.h7
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_conntrack.h28
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_dccp.h15
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_dscp.h21
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_ecn.h33
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_esp.h10
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_hashlimit.h14
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_helper.h7
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_iprange.h21
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_length.h7
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_limit.h8
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_mac.h7
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_mark.h9
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_multiport.h15
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_owner.h20
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_physdev.h17
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_pkttype.h7
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_policy.h23
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_realm.h7
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_recent.h21
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_sctp.h105
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_state.h15
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_string.h10
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_tcpmss.h7
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_tos.h13
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_ttl.h21
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6.h72
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6_tables.h297
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_HL.h22
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_LOG.h18
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_MARK.h9
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_REJECT.h18
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_ah.h21
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_esp.h10
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_frag.h24
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_hl.h22
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_ipv6header.h27
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_length.h8
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_limit.h8
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_mac.h7
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_mark.h9
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_mh.h15
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_multiport.h14
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_opts.h23
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_owner.h18
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_physdev.h17
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_policy.h23
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_rt.h33
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netlink.h155
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netrom.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs.h128
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs2.h74
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs3.h99
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs4.h146
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs4_mount.h71
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs_fs.h59
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs_idmap.h65
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs_mount.h73
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsacl.h29
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/const.h30
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/debug.h40
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/export.h47
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/nfsfh.h120
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/stats.h17
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/syscall.h109
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nl80211.h1065
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nubus.h244
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nvram.h16
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/oom.h10
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/param.h6
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/parport.h95
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/patchkey.h33
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pci.h41
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pci_regs.h654
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/personality.h65
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pfkeyv2.h369
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pg.h63
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/phantom.h49
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/phonet.h173
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pkt_cls.h494
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pkt_sched.h521
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pktcdvd.h111
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pmu.h135
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/poll.h7
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/posix_types.h49
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ppdev.h99
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ppp-comp.h210
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ppp_defs.h180
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/prctl.h88
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ptrace.h52
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/qnx4_fs.h89
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/qnxtypes.h28
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/quota.h176
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/radeonfb.h15
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/raid/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/raid/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/raid/md_p.h277
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/raid/md_u.h156
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/random.h46
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/raw.h18
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/reboot.h39
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/reiserfs_fs.h35
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/reiserfs_xattr.h25
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/resource.h75
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/romfs_fs.h56
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/rose.h87
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/route.h68
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/rtc.h101
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/rtnetlink.h614
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/scc.h172
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sched.h43
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/screen_info.h69
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sdla.h119
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/selinux_netlink.h48
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sem.h80
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/serial.h175
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/serial_core.h171
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/serial_reg.h328
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/serio.h76
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/shm.h75
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/signal.h8
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/signalfd.h52
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/smb.h64
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/smb_fs.h25
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/smb_mount.h27
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/smbno.h363
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/snmp.h257
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/socket.h303
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sockios.h146
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/som.h154
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sonet.h60
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sonypi.h143
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sound.h27
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/soundcard.h1278
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/spi/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/spi/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/spi/spidev.h129
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/stat.h45
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/stddef.h14
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/string.h7
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sunrpc/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sunrpc/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sunrpc/debug.h48
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/suspend_ioctls.h33
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/swab.h282
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/synclink.h295
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sysctl.h940
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/taskstats.h212
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_gact.h35
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_ipt.h21
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_mirred.h29
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_nat.h29
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_pedit.h37
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_skbedit.h44
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/tc_em_cmp.h27
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/tc_em_meta.h96
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/tc_em_nbyte.h14
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/tc_em_text.h20
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tcp.h174
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/telephony.h262
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/termios.h22
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/time.h74
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/times.h13
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/timex.h160
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tiocl.h39
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tipc.h213
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tipc_config.h418
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/toshiba.h38
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tty.h8
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/types.h38
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/udf_fs_i.h21
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/udp.h39
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/uinput.h136
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/uio.h49
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ultrasound.h103
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/un.h11
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/unistd.h9
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/audio.h53
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/cdc.h250
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/ch9.h782
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/g_printer.h35
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/gadgetfs.h88
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/midi.h112
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/tmc.h43
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/vstusb.h71
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usbdevice_fs.h152
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/utime.h11
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/utsname.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/version.h2
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/veth.h12
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/videodev.h340
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/videodev2.h1557
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/videotext.h125
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_9p.h12
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_balloon.h23
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_blk.h62
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_config.h31
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_console.h23
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_net.h129
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_pci.h64
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_ring.h112
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_rng.h10
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/vt.h66
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wait.h21
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wanrouter.h452
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/watchdog.h55
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wimax.h234
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wimax/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wimax/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wimax/i2400m.h581
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wireless.h1126
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/x25.h150
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/xattr.h17
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/xfrm.h483
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/locale.h225
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/malloc.h191
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/math.h468
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/memory.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/mntent.h98
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/mqueue.h90
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/inftl-user.h91
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/jffs2-user.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/mtd-abi.h152
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/mtd-user.h19
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/nftl-user.h76
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/ubi-user.h412
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/net/ethernet.h76
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if.h205
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if_arp.h176
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if_packet.h37
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if_ppp.h169
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if_shaper.h59
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if_slip.h25
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/net/ppp-comp.h1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/net/ppp_defs.h10
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/net/route.h145
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/netax25/ax25.h171
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/netdb.h658
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/neteconet/ec.h52
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ether.h54
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/icmp6.h346
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/if_ether.h105
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/if_fddi.h37
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/if_tr.h41
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/igmp.h126
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/in.h512
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/in_systm.h41
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip.h249
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip6.h188
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip_fw.h1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip_icmp.h283
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip_tcp.h72
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip_udp.h1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/protocols.h62
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/tcp.h225
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/udp.h55
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/netipx/ipx.h113
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/netpacket/packet.h64
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/nl_types.h59
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/obstack.h605
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/paths.h80
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/poll.h1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/protocols/routed.h101
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/protocols/rwhod.h67
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/protocols/talkd.h113
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/protocols/timed.h97
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/pthread.h691
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/pty.h44
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/pwd.h186
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/rdma/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/rdma/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/rdma/ib_user_mad.h203
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/regex.h580
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/regexp.h222
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/resolv.h395
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/auth.h224
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/auth_des.h112
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/auth_unix.h90
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/clnt.h421
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/des_crypt.h97
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/key_prot.h346
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/netdb.h74
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/pmap_clnt.h98
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/pmap_prot.h108
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/pmap_rmt.h68
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/rpc.h110
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/rpc_des.h72
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/rpc_msg.h202
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/svc.h316
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/svc_auth.h54
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/types.h108
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/xdr.h385
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sched.h86
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/scsi/scsi.h226
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/scsi/scsi_ioctl.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/scsi/sg.h275
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/search.h175
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/semaphore.h87
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/setjmp.h104
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sgidefs.h73
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sgtty.h41
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/shadow.h149
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/signal.h401
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/asequencer.h614
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/asound.h894
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/asound_fm.h134
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/emu10k1.h371
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/hdsp.h109
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/hdspm.h134
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/sb16_csp.h115
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/sfnt_info.h212
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/sscape_ioctl.h21
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/stdint.h332
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/stdio.h873
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/stdio_ext.h87
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/stdlib.h865
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/string.h437
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/strings.h95
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/acct.h77
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/asm.h473
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/bitypes.h3
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/cachectl.h42
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/cdefs.h320
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/dir.h28
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/epoll.h110
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/errno.h1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/fcntl.h1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/file.h56
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/fpregdef.h61
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/fsuid.h36
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/inotify.h92
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ioctl.h46
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ipc.h58
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/kd.h35
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/kdaemon.h33
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/klog.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/mman.h174
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/mount.h119
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/msg.h81
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/mtio.h277
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/param.h72
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/personality.h73
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/poll.h76
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/prctl.h32
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/procfs.h112
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ptrace.h129
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/queue.h557
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/quota.h158
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/reboot.h49
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/regdef.h80
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/resource.h103
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/select.h130
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sem.h58
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sendfile.h52
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/shm.h64
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/signal.h1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/socket.h236
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/socketvar.h3
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/soundcard.h1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/stat.h366
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/statfs.h68
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/statvfs.h91
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/swap.h43
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/syscall.h37
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sysctl.h72
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sysinfo.h67
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/syslog.h206
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sysmacros.h69
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sysmips.h44
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/tas.h67
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/termios.h4
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/time.h192
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/timeb.h46
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/times.h53
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/timex.h127
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ttydefaults.h100
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/types.h275
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ucontext.h117
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/uio.h54
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/un.h47
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/unistd.h1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/user.h217
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ustat.h38
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/utsname.h74
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/vfs.h4
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/vt.h1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/wait.h186
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/xattr.h104
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/syscall.h1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/sysexits.h114
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/syslog.h1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/tar.h108
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/termio.h6
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/termios.h110
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/tgmath.h430
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/thread_db.h459
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/time.h435
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/ttyent.h65
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/ucontext.h32
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/ulimit.h48
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/unistd.h1110
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/ustat.h1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/utime.h52
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/utmp.h97
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/values.h71
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/video/..install.cmd1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/video/.install0
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/video/edid.h13
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/video/sisfb.h209
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/video/uvesafb.h60
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/wait.h1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/wchar.h752
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/include/wctype.h330
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/info/cpp.info5351
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/info/cppinternals.info1036
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/info/dir26
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/info/gcc.info44027
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/info/gccinstall.info4234
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/info/gccint.info43962
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/info/libgomp.info2455
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/Scrt1.obin0 -> 1024 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/crt1.obin0 -> 1024 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/crti.obin0 -> 1280 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/crtn.obin0 -> 1100 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/crtbegin.obin0 -> 2632 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/crtbeginS.obin0 -> 2764 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/crtbeginT.obin0 -> 2632 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/crtend.obin0 -> 1664 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/crtendS.obin0 -> 1696 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include-fixed/README14
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include-fixed/features.h433
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include-fixed/limits.h125
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include-fixed/obstack.h614
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include-fixed/syslimits.h8
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/float.h238
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/iso646.h45
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/loongson.h690
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/mf-runtime.h244
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/omp.h105
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/stdarg.h130
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/stdbool.h50
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/stddef.h416
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/stdfix.h204
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/unwind.h276
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/varargs.h7
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/fixinc_list1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/gsyslimits.h8
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/include/README14
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/include/limits.h125
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/macro_list7
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/mkheaders.conf5
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/libgcc.abin0 -> 6214602 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/libgcc_eh.abin0 -> 142504 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/libgcov.abin0 -> 135484 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.x261
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xbn259
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xc264
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xd261
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xdc264
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xdw264
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xn261
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xr201
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xs247
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xsc246
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xsw246
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xu202
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xw264
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.x254
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xbn252
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xc257
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xd254
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xdc257
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xdw257
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xn254
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xr194
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xs240
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xsc239
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xsw239
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xu195
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xw257
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.x261
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xbn259
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xc264
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xd261
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xdc264
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xdw264
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xn261
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xr201
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xs247
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xsc246
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xsw246
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xu202
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xw264
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.x254
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xbn252
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xc257
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xd254
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xdc257
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xdw257
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xn254
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xr194
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xs240
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xsc239
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xsw239
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xu195
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xw257
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.x253
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xbn251
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xc256
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xd253
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xdc256
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xdw256
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xn253
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xr193
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xs240
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xsc239
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xsw239
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xu194
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xw256
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.x253
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xbn251
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xc256
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xd253
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xdc256
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xdw256
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xn253
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xr193
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xs240
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xsc239
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xsw239
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xu194
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xw256
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/libc.abin0 -> 1478600 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/libc.so4
l---------uclibc-crosstools-gcc-4.4.2-1/usr/lib/libc_pic.a1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/libcrypt.abin0 -> 15398 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/usr/lib/libcrypt.so1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/lib/libcrypt_pic.a1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/libdl.abin0 -> 23158 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/usr/lib/libdl.so1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/lib/libdl_pic.a1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/libiberty.abin0 -> 669282 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/libm.abin0 -> 306818 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/usr/lib/libm.so1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/lib/libm_pic.a1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/libnsl.abin0 -> 1188 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/usr/lib/libnsl.so1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/lib/libnsl_pic.a1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/libpthread.abin0 -> 120840 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/usr/lib/libpthread.so1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/lib/libpthread_pic.a1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/libresolv.abin0 -> 1196 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/usr/lib/libresolv.so1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/lib/libresolv_pic.a1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/librt.abin0 -> 15940 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/usr/lib/librt.so1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/lib/librt_pic.a1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/libthread_db.abin0 -> 53244 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/usr/lib/libthread_db.so1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/lib/libthread_db_pic.a1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/libutil.abin0 -> 9644 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/usr/lib/libutil.so1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/lib/libutil_pic.a1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/lib/uclibc_nonshared.abin0 -> 1244 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/cc1bin0 -> 27871003 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/cc1plusbin0 -> 30396241 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/collect2bin0 -> 312327 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/install-tools/fixinc.sh498
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/install-tools/fixinclbin0 -> 298351 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/install-tools/mkheaders109
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/install-tools/mkinstalldirs158
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/man/man1/mips-linux-uclibc-cpp.1979
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/man/man1/mips-linux-uclibc-g++.115367
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/man/man1/mips-linux-uclibc-gcc.115367
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/man/man1/mips-linux-uclibc-gcov.1635
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/man/man7/fsf-funding.7192
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/man/man7/gfdl.7591
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/man/man7/gpl.7849
l---------uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux1
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/arbin0 -> 3303875 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/asbin0 -> 4688774 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/c++bin0 -> 461847 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/cc1
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/g++bin0 -> 461847 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/gccbin0 -> 460197 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/gdb1
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/ldbin0 -> 5051954 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/nmbin0 -> 3204106 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/objcopybin0 -> 3749936 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/objdumpbin0 -> 4047818 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/ranlibbin0 -> 3303906 bytes
l---------uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/sstrip1
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/stripbin0 -> 3749927 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/algorithm68
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/array60
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/auto_ptr.h292
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/backward_warning.h56
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/binders.h168
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/hash_fun.h167
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/hash_map590
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/hash_set558
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/hashtable.h1125
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/strstream176
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/algorithmfwd.h805
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/allocator.h181
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/atomic_0.h463
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/atomic_2.h453
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/atomicfwd_c.h174
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/atomicfwd_cxx.h109
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/basic_ios.h474
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/basic_ios.tcc187
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/basic_string.h2692
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/basic_string.tcc1144
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/boost_concept_check.h787
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/char_traits.h575
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/cmath.tcc55
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/codecvt.h497
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/concept_check.h80
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/cpp_type_traits.h419
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/deque.tcc863
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/forward_list.h1306
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/forward_list.tcc478
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/fstream.tcc926
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/functexcept.h93
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/functional_hash.h68
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/gslice.h182
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/gslice_array.h216
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/hashtable.h58
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/indirect_array.h210
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/ios_base.h982
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/istream.tcc1022
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/list.tcc416
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_classes.h812
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_classes.tcc271
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_facets.h2602
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_facets.tcc1345
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_facets_nonio.h1914
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_facets_nonio.tcc1330
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/localefwd.h183
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/mask_array.h206
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/move.h98
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/ostream.tcc407
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/ostream_insert.h127
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/postypes.h241
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/shared_ptr.h1591
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/slice_array.h272
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/sstream.tcc273
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_algo.h6090
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_algobase.h1153
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_bvector.h1024
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_construct.h148
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_deque.h1819
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_function.h715
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_heap.h578
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_iterator.h1041
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_iterator_base_funcs.h197
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_iterator_base_types.h168
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_list.h1533
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_map.h871
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_multimap.h800
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_multiset.h697
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_numeric.h373
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_pair.h261
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_queue.h586
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_raw_storage_iter.h106
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_relops.h131
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_set.h708
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_stack.h299
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_tempbuf.h206
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_tree.h1495
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_uninitialized.h478
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_vector.h1233
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stream_iterator.h211
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/streambuf.tcc174
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/streambuf_iterator.h392
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stringfwd.h77
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/unique_ptr.h450
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/valarray_after.h549
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/valarray_array.h699
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/valarray_array.tcc241
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/valarray_before.h730
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/vector.tcc681
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bitset1396
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/c++0x_warning.h36
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cassert45
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ccomplex44
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cctype101
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cerrno53
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cfenv61
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cfloat60
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/chrono672
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cinttypes71
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ciso64633
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/climits60
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/clocale61
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cmath631
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/complex1587
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/complex.h42
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/condition_variable225
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/csetjmp64
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/csignal60
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdarg60
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdatomic848
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdbool44
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstddef56
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdint79
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdio205
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdlib242
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstring123
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ctgmath41
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ctime78
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cwchar291
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cwctype126
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cxxabi-forced.h51
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cxxabi.h608
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/bitset369
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/debug.h130
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/deque515
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/formatter.h392
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/functions.h383
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/list653
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/macros.h246
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/map37
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/map.h412
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/multimap.h400
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/multiset.h396
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/safe_base.h220
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/safe_iterator.h643
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/safe_iterator.tcc143
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/safe_sequence.h183
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/set37
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/set.h401
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/string1074
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/unordered_map608
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/unordered_set601
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/vector551
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/deque75
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/exception151
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/exception_defines.h49
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/exception_ptr.h171
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/algorithm524
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/array_allocator.h154
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/atomicity.h113
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/bitmap_allocator.h1145
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/cast.h113
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/codecvt_specializations.h507
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/concurrence.h322
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/debug_allocator.h124
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/enc_filebuf.h62
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/extptr_allocator.h176
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/functional425
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/hash_map590
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/hash_set558
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/iterator113
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/malloc_allocator.h134
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/memory195
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/mt_allocator.h751
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/new_allocator.h130
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/numeric146
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/numeric_traits.h135
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/assoc_container.hpp683
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp173
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp67
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/basic_tree_policy/traits.hpp85
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/basic_types.hpp211
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp497
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/cond_dtor_entry_dealtor.hpp70
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/cond_key_dtor_entry_dealtor.hpp81
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp218
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp272
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp120
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp182
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp64
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp211
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp136
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp237
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp381
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp56
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp120
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp156
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp146
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/traits.hpp250
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp357
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/const_iterator.hpp152
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp144
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/constructors_destructor_fn_imps.hpp159
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp72
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/entry_cmp.hpp93
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/entry_pred.hpp93
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp246
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp91
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp64
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp183
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp72
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp56
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/resize_policy.hpp253
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp172
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/trace_fn_imps.hpp78
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp116
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_/constructors_destructor_fn_imps.hpp61
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp49
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp234
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp97
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp98
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp192
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp73
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp216
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp232
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp636
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp83
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/cond_key_dtor_entry_dealtor.hpp117
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp191
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp55
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp56
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp74
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/debug_no_store_hash_fn_imps.hpp49
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/debug_store_hash_fn_imps.hpp53
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp91
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp103
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp101
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp95
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp71
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/find_store_hash_fn_imps.hpp41
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp100
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/insert_fn_imps.hpp43
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp70
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp71
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/iterators_fn_imps.hpp83
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/policy_access_fn_imps.hpp88
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp133
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/resize_no_store_hash_fn_imps.hpp54
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/resize_store_hash_fn_imps.hpp54
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp59
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/standard_policies.hpp46
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp72
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cond_dealtor.hpp125
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/constructors_destructor_fn_imps.hpp103
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/container_base_dispatch.hpp332
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/debug_map_base.hpp360
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/eq_fn/eq_by_less.hpp68
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp179
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp223
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp53
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp54
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp55
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/debug_no_store_hash_fn_imps.hpp71
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/debug_store_hash_fn_imps.hpp77
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp100
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/erase_no_store_hash_fn_imps.hpp85
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/erase_store_hash_fn_imps.hpp86
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp70
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/find_no_store_hash_fn_imps.hpp46
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/find_store_hash_fn_imps.hpp40
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp677
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp58
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp43
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/insert_no_store_hash_fn_imps.hpp111
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/insert_store_hash_fn_imps.hpp118
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/iterator_fn_imps.hpp83
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/policy_access_fn_imps.hpp100
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp137
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/resize_no_store_hash_fn_imps.hpp72
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/resize_store_hash_fn_imps.hpp74
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/standard_policies.hpp74
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp74
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/direct_mask_range_hashing_imp.hpp58
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/direct_mod_range_hashing_imp.hpp58
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/linear_probe_fn_imp.hpp53
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/mask_based_range_hashing.hpp107
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/mod_based_range_hashing.hpp108
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/probe_fn_base.hpp59
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/quadratic_probe_fn_imp.hpp53
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp359
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp327
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp73
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp77
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp77
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp77
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp162
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/const_point_iterator.hpp154
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp152
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp141
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp150
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp64
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp175
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp88
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp349
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/node.hpp123
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp55
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/policy_access_fn_imps.hpp52
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp95
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp141
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp57
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/entry_metadata_base.hpp60
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp135
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp90
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp57
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp106
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp80
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/lu_map_.hpp359
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp59
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp86
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_policy/counter_lu_policy_imp.hpp51
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_policy/mtf_lu_policy_imp.hpp55
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_policy/sample_update_policy.hpp74
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/cond_dtor.hpp74
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp273
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp84
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp193
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp60
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp63
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp103
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp292
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp522
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/policy_access_fn_imps.hpp51
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp137
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/traits.hpp183
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/constructors_destructor_fn_imps.hpp91
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp53
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp236
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp50
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp101
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp216
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp140
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/child_iterator.hpp93
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/cond_dtor_entry_dealtor.hpp79
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp111
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp214
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp117
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp319
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp269
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/head.hpp124
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp58
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp465
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/internal_node.hpp599
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp120
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/leaf.hpp171
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/node_base.hpp128
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/node_iterators.hpp338
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/node_metadata_base.hpp86
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp515
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/point_iterators.hpp484
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/policy_access_fn_imps.hpp63
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp103
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp150
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp254
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/split_join_branch_bag.hpp93
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/synth_e_access_traits.hpp229
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp113
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/traits.hpp350
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp55
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/priority_queue_base_dispatch.hpp91
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/constructors_destructor_fn_imps.hpp100
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp78
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp289
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/find_fn_imps.hpp39
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp46
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp115
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/node.hpp138
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp280
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp313
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/traits.hpp124
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/constructors_destructor_fn_imps.hpp88
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp121
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp107
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp154
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp262
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp198
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/split_join_fn_imps.hpp81
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/trace_fn_imps.hpp53
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp211
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/hash_exponential_size_policy_imp.hpp90
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp289
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_size_base.hpp94
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp161
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/hash_standard_resize_policy_imp.hpp249
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp125
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/sample_resize_trigger.hpp137
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp73
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/constructors_destructor_fn_imps.hpp102
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp74
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp157
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp99
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/info_fn_imps.hpp39
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp93
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/node.hpp125
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp283
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp298
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp112
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/traits.hpp113
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/standard_policies.hpp136
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp106
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp112
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp296
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp51
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp326
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp126
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp351
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/trace_fn_imps.hpp55
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp116
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/tree_policy/null_node_update_imp.hpp50
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp141
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/tree_policy/sample_tree_node_update.hpp72
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/tree_trace_base.hpp209
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp116
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/null_node_update_imp.hpp50
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp183
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/prefix_search_node_update_imp.hpp151
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/sample_trie_e_access_traits.hpp89
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/sample_trie_node_update.hpp72
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/string_trie_e_access_traits_imp.hpp99
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/trie_policy_base.hpp249
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/type_utils.hpp167
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/types_traits.hpp82
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp129
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp151
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/unordered_iterator/iterator.hpp150
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp143
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/exception.hpp103
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/hash_policy.hpp604
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/list_update_policy.hpp136
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/priority_queue.hpp125
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/tag_and_trait.hpp363
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/tree_policy.hpp162
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/trie_policy.hpp355
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pod_char_traits.h182
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pointer.h551
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pool_allocator.h263
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/rb_tree93
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/rc_string_base.h718
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/rope2958
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/ropeimpl.h1701
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/slist1077
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/sso_string_base.h568
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/stdio_filebuf.h157
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/stdio_sync_filebuf.h279
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/string_conversions.h94
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/throw_allocator.h448
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/type_traits.h204
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/typelist.h544
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/vstring.h2575
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/vstring.tcc696
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/vstring_fwd.h87
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/vstring_util.h180
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/fenv.h58
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/forward_list46
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/fstream918
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/functional78
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/initializer_list72
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/iomanip296
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ios47
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/iosfwd160
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/iostream76
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/istream833
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/iterator70
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/limits1256
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/list74
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/locale45
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/map68
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/memory100
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/atomic_word.h47
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/basic_file.h108
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/c++allocator.h37
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/c++config.h1431
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/c++io.h49
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/c++locale.h91
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/cpu_defines.h33
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/ctype_base.h63
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/ctype_inline.h73
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/ctype_noninline.h92
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/cxxabi_tweaks.h58
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/error_constants.h175
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/extc++.h69
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/gthr-default.h895
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/gthr-posix.h895
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/gthr-single.h292
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/gthr-tpf.h229
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/gthr.h173
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/messages_members.h90
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/os_defines.h44
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/stdc++.h111
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/stdtr1c++.h53
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/time_members.h90
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mutex774
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/new112
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/numeric78
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ostream568
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/algo.h2364
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/algobase.h281
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/algorithm40
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/algorithmfwd.h898
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/balanced_quicksort.h477
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/base.h471
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/basic_iterator.h42
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/checkers.h154
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/compatibility.h350
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/compiletime_settings.h75
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/equally_split.h87
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/features.h104
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/find.h401
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/find_selectors.h192
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/for_each.h97
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/for_each_selectors.h360
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/iterator.h200
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/list_partition.h176
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/losertree.h1021
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/merge.h261
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/multiseq_selection.h633
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/multiway_merge.h2140
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/multiway_mergesort.h475
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/numeric500
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/numericfwd.h203
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/omp_loop.h118
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/omp_loop_static.h117
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/par_loop.h135
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/parallel.h42
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/partial_sum.h220
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/partition.h429
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/queue.h149
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/quicksort.h179
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/random_number.h124
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/random_shuffle.h519
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/search.h172
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/set_operations.h524
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/settings.h281
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/sort.h229
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/tags.h191
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/types.h155
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/unique_copy.h192
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/workstealing.h306
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/queue67
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/random70
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ratio303
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/regex68
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/set68
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/sstream576
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/stack64
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/stdatomic.h218
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/stdexcept150
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/streambuf799
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/string59
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/system_error353
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tgmath.h42
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/thread284
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/array54
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/bessel_function.tcc627
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/beta_function.tcc197
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/ccomplex34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cctype49
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cfenv53
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cfloat42
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cinttypes63
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/climits46
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cmath507
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/complex91
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/complex.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cstdarg34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cstdbool40
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cstdint76
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cstdio54
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cstdlib54
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/ctgmath34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/ctime34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/ctype.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cwchar54
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cwctype54
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/ell_integral.tcc750
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/exp_integral.tcc524
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/fenv.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/float.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/functional63
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/functional_hash.h53
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/gamma.tcc471
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/hashtable.h53
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/hypergeometric.tcc774
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/inttypes.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/legendre_function.tcc305
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/limits.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/math.h186
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/memory67
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/modified_bessel_func.tcc436
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/poly_hermite.tcc124
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/poly_laguerre.tcc329
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/random66
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/regex64
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/riemann_zeta.tcc435
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/shared_ptr.h1020
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/special_function_util.h144
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/stdarg.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/stdbool.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/stdint.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/stdio.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/stdlib.h52
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/tgmath.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/tuple422
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/type_traits249
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/unordered_map61
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/unordered_set61
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/utility56
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/wchar.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/wctype.h34
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/array287
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/boost_sp_counted_base.h239
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cctype43
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cfenv70
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cinttypes64
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cmath902
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/complex370
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cstdint75
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cstdio44
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cstdlib65
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cwchar58
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cwctype43
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/functional2130
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/functional_hash.h183
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/hashtable1266
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/hashtable_policy.h865
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/random2407
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/random.tcc1577
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/regex2708
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/type_traits501
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/unordered_map370
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/unordered_set360
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/utility120
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tuple697
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/type_traits605
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/typeinfo196
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/unordered_map78
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/unordered_set78
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/utility94
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/valarray1087
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/vector77
l---------uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgcc_s.so1
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgcc_s.so.1bin0 -> 1577014 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.abin0 -> 326204 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.la41
l---------uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.so1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.so.11
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.so.1.0.0bin0 -> 236610 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.spec3
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libiberty.abin0 -> 663434 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflap.abin0 -> 385022 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflap.la41
l---------uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflap.so1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflap.so.01
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflap.so.0.0.0bin0 -> 289118 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflapth.abin0 -> 321180 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflapth.la41
l---------uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflapth.so1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflapth.so.01
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflapth.so.0.0.0bin0 -> 298103 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libstdc++.abin0 -> 7147930 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libstdc++.la41
l---------uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libstdc++.so1
l---------uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libstdc++.so.61
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libstdc++.so.6.0.13bin0 -> 3894991 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libsupc++.abin0 -> 551266 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libsupc++.la41
l---------uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/sys-include1
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/target_utils/gdbserverbin0 -> 82124 bytes
-rwxr-xr-xuclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/target_utils/lddbin0 -> 14395 bytes
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/info/as.info22073
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/info/bfd.info11288
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/info/binutils.info4493
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/info/configure.info2773
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/info/dir43
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/info/gprof.info2469
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/info/ld.info7611
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/info/standards.info5576
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-addr2line.1273
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-ar.1429
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-as.11208
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-c++filt.1345
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-dlltool.1529
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-gprof.1772
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-ld.12355
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-nlmconv.1251
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-nm.1523
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-objcopy.1935
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-objdump.1803
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-ranlib.1199
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-readelf.1420
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-size.1275
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-strings.1264
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-strip.1399
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-windmc.1359
-rw-r--r--uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-windres.1362
2344 files changed, 729603 insertions, 0 deletions
diff --git a/buildcfe.sh b/buildcfe.sh
new file mode 100755
index 0000000..654718b
--- /dev/null
+++ b/buildcfe.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+currdir=`pwd`
+
+#CLEAN
+rm cfe*
+cd cfe/build/broadcom/bcm63xx_rom
+make clean
+
+
+#BUILD
+#USAGE: make BRCM_CHIP=[6328|6362|6368|6816] BLD_NAND=1
+#BLD_NAND=1 <--- build with NAND flash support
+
+make BRCM_CHIP=6328
+#make BRCM_CHIP=6328 BLD_NAND=1
+
+cp cfe6328.bin $currdir
+cp ../bcm63xx_ram/cfe6328 $currdir/cfe6328_ram
+
+
+echo DONE
diff --git a/cfe/build/broadcom/bcm63xx_ram/Makefile b/cfe/build/broadcom/bcm63xx_ram/Makefile
new file mode 100755
index 0000000..970da8f
--- /dev/null
+++ b/cfe/build/broadcom/bcm63xx_ram/Makefile
@@ -0,0 +1,76 @@
+
+CFG_MLONG64 ?= 0
+CFG_LITTLE ?= 0 # Mindbender
+CFG_RELOC ?= 0
+CFG_UNCACHED ?= 0 # Mindbender
+CFG_NEWRELOC ?= 0
+CFG_VAPI ?= 0
+CFG_BOOTRAM ?= 0
+CFG_RAMAPP ?= 1
+CFG_BOARDNAME = "BCM9$(BRCM_CHIP)"
+CFG_PCI = 0
+CFG_ZLIB = 0 # enable zlib
+
+COMPRESS ?= cmplzma
+
+TOP = ../../../cfe
+ARCH = mips
+CPU = bcmcore
+BOARD = bcm63xx_ram
+
+HOSTTOOLS = ../../../../hostTools
+SHARED_DIR = ../../../../shared
+BOARDPARMS_DIR = $(SHARED_DIR)/opensource/boardparms/bcm963xx
+FLASH_DIR = $(SHARED_DIR)/opensource/flash
+BCMSPI_DIR = $(SHARED_DIR)/opensource/spi
+INC_SHARED_PUB_PATH = $(SHARED_DIR)/opensource/include/bcm963xx
+INC_SHARED_PRIV_PATH = $(SHARED_DIR)/broadcom/include/bcm963xx
+ROM_BUILD = ../bcm63xx_rom
+ASM_FILE =$(ROM_BUILD)/flashimg.S
+
+ifeq ($(strip $(CFG_SBP)),1)
+ CFLAGS += -DUSE_SINGLE_BOARD_PARAM
+endif
+
+include $(TOP)/arch/mips/board/$(BOARD)/src/ram_cfe.mk
+
+VPATH += ${ARCH_TOP}/board/$(BOARD)/src/html ${BOARDPARMS_DIR} $(BCMSPI_DIR) ${FLASH_DIR}
+INCDIRS += -I${INC_SHARED_PUB_PATH} -I${INC_SHARED_PRIV_PATH}
+
+$(HOSTTOOLS)/$(COMPRESS):
+ $(MAKE) -C $(HOSTTOOLS) build_cmplzma
+
+ALL: sanity_check $(HOSTTOOLS)/$(COMPRESS)
+ find $(SHARED_DIR) -name "*.o" -exec rm -f "{}" ";"
+ find $(BOARDPARMS_DIR) -name "*.o" -exec rm -f "{}" ";"
+ ${MAKE} cfe$(BRCM_CHIP)
+ $(HOSTTOOLS)/$(COMPRESS) -s -c -2 cfe$(BRCM_CHIP) cfe$(BRCM_CHIP).bin $(ASM_FILE)
+
+sanity_check:
+ @if [ "$(BRCM_CHIP)" = "" ]; then \
+ echo You must specify chip ID using 'gmake BRCM_CHIP=[6328|6362|6368|6816]'; exit 1; \
+ fi
+
+$(ASM_FILE): cfe$(BRCM_CHIP) cfe$(BRCM_CHIP).bin
+
+cfe$(BRCM_CHIP) cfe$(BRCM_CHIP).bin: $(CRT0OBJS) $(BSPOBJS) $(LIBCFE)
+ $(GLD) -o cfe$(BRCM_CHIP) -Map cfe$(BRCM_CHIP).map $(LDFLAGS) $(CRT0OBJS) $(BSPOBJS) -L. -lcfe $(LDLIBS)
+ $(OBJDUMP) -d cfe$(BRCM_CHIP) > cfe$(BRCM_CHIP).dis
+ $(OBJCOPY) --output-target=binary cfe$(BRCM_CHIP) cfe$(BRCM_CHIP).bin
+ifeq ($(strip $(INC_NAND_FLASH_DRIVER)),1)
+ printf "0: %08x%08x%08x" `$(OBJDUMP) -x cfe$(BRCM_CHIP) | sed -n -e "/start address/{s?start address ??p}" -e "/LOAD off/{s?^ *LOAD off.*vaddr ??; s? paddr .*??p}" -e "/ _end/{s? g.* _end??; s?^...?0x000?p}"` | xxd -r > cferamhdr.bin; \
+ cat cferamhdr.bin cfe$(BRCM_CHIP).bin > cfe$(BRCM_CHIP)ram.bin; \
+ rm cferamhdr.bin
+endif
+
+clean :
+ rm -f *.o *~ cfe*
+ rm -f build_date.c
+ rm -f libcfe.a
+ rm -f $(ASM_FILE)
+
+distclean : clean
+
+
+
+
diff --git a/cfe/build/broadcom/bcm63xx_rom/Makefile b/cfe/build/broadcom/bcm63xx_rom/Makefile
new file mode 100755
index 0000000..819cb21
--- /dev/null
+++ b/cfe/build/broadcom/bcm63xx_rom/Makefile
@@ -0,0 +1,160 @@
+
+CFG_MLONG64 ?= 0
+CFG_LITTLE ?= 0 # Mindbender
+CFG_RELOC ?= 0
+CFG_UNCACHED ?= 0 # Mindbender
+CFG_NEWRELOC ?= 0
+CFG_VAPI ?= 0
+CFG_BOOTRAM ?= 0
+CFG_RAMAPP ?= 0 # EPI
+CFG_BOARDNAME = "BCM9$(BRCM_CHIP)"
+CFG_PCI ?= 0
+CFG_ZLIB ?= 0 # enable zlib
+CFG_SBP ?= 0 # use Single Board Parameter if defined to 1
+
+TOP = ../../../cfe
+ARCH = mips
+CPU = bcmcore
+BOARD = bcm63xx_rom
+
+LINUX_KERNEL_DIR=../../../../kernel/linux
+HOSTTOOLS = ../../../../hostTools
+TARGETS_DIR = ../../../../targets
+SHARED_DIR = ../../../../shared
+INC_SHARED_PUB_PATH = $(SHARED_DIR)/opensource/include/bcm963xx
+INC_SHARED_PRIV_PATH = $(SHARED_DIR)/broadcom/include/bcm963xx
+FLASH_DIR = $(SHARED_DIR)/opensource/flash
+BCMSPI_DIR = $(SHARED_DIR)/opensource/spi
+
+BOOT_DIR = ${ARCH_TOP}/board/$(BOARD)/src
+ASM_FILE = flashimg.S
+RAM_BUILD = ../bcm63xx_ram
+
+TOOLS=../../../../uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-
+
+include $(TOP)/arch/mips/board/$(BOARD)/src/rom_cfe.mk
+
+VPATH += ${FLASH_DIR} $(BCMSPI_DIR)
+INCDIRS += -I${ARCH_TOP}/board/bcm63xx_ram/include -I${INC_SHARED_PUB_PATH} -I${INC_SHARED_PRIV_PATH}
+
+BSPOBJS_ROM := $(BSPOBJS)
+ifneq ($(strip $(BRCM_IKOS)),y)
+BSPOBJS += flashimg.o $(LZMAOBJS)
+endif
+
+export INC_CFI_FLASH_DRIVER INC_SPI_FLASH_DRIVER INC_NAND_FLASH_DRIVER INC_SPI_PROG_NAND
+
+ALL : sanity_check cfe$(BRCM_CHIP)
+ifneq ($(strip $(INC_NAND_FLASH_DRIVER)),1)
+ gcc -o ${HOSTTOOLS}/addvtoken -I ${INC_SHARED_PUB_PATH} ${HOSTTOOLS}/addvtoken.c
+ @if [ $(shell find . -name cfe$(BRCM_CHIP).bin -printf '%s\n') -le 65536 ] ; then \
+ ${HOSTTOOLS}/addvtoken cfe$(BRCM_CHIP).bin bcm9$(BRCM_CHIP)_cfe.w; \
+ else \
+ find . -name cfe$(BRCM_CHIP).bin -printf '\nERROR: cfe.bin size, %s, is greater than 65536 maximum size.\n'; \
+ rm cfe$(BRCM_CHIP) cfe$(BRCM_CHIP).bin; \
+ fi
+endif
+ @echo done
+
+untar_check:
+ @if [ ! -e $(TOP)/api ]; then \
+ echo Untarring original CFE source...; \
+ (cd ../../.. && tar xfzk cfe*.tar.gz 2> /dev/null || true); \
+ fi
+
+sanity_check:
+ @if [ "$(BRCM_CHIP)" = "" ]; then \
+ echo You must specify chip ID using 'make BRCM_CHIP=[6328|6362|6368|6816]'; exit 1; \
+ fi
+ @if [ ! -e $(TOP)/api ]; then \
+ echo Untarring original CFE source...; \
+ (cd ../../.. && tar xfzk cfe*.tar.gz 2> /dev/null || true); \
+ $(MAKE) BRCM_CHIP=$(BRCM_CHIP) BLD_NAND=$(BLD_NAND); \
+ fi
+
+mksbp: ALL
+ @echo done
+
+sbp:
+ ${MAKE} clean
+ ${MAKE} CFG_SBP?=1 mksbp
+
+ifeq ($(strip $(INC_NAND_FLASH_DRIVER)),1)
+# Build NAND flash boot loader
+cfe$(BRCM_CHIP) cfe$(BRCM_CHIP).bin : $(CRT0OBJS) $(BSPOBJS_ROM) $(LIBCFE) noflashimg
+ $(MAKE) -C $(RAM_BUILD)
+ $(GLD) -o cfe$(BRCM_CHIP)rom -Map cfe$(BRCM_CHIP)rom.map $(LDFLAGS) $(CRT0OBJS) $(BSPOBJS_ROM) noflashimg.o -L. -lcfe $(LDLIBS)
+ $(OBJCOPY) --output-target=binary cfe$(BRCM_CHIP)rom cfe$(BRCM_CHIP)rom.bin
+ rm noflashimg.*
+
+noflashimg:
+ echo "char *_binArrayStart = (char *) 0, *_binArrayEnd = (char *) 0;" > $@.c; \
+ echo "int decompressLZMA(unsigned char *s, unsigned int sl, unsigned char *d, unsigned int dl);" >> $@.c; \
+ echo "int decompressLZMA(unsigned char *s, unsigned int sl, unsigned char *d, unsigned int dl){return 0;}" >> $@.c
+ $(GCC) $(CFLAGS) -o $@.o $@.c
+
+else
+# Build NOR flash boot loader
+cfe$(BRCM_CHIP) cfe$(BRCM_CHIP).bin : $(CRT0OBJS) $(BSPOBJS) $(LIBCFE) $(ASM_FILE)
+ $(GLD) -o cfe$(BRCM_CHIP) -Map cfe$(BRCM_CHIP).map $(LDFLAGS) $(CRT0OBJS) $(BSPOBJS) -L. -lcfe $(LDLIBS)
+ $(OBJDUMP) -d cfe$(BRCM_CHIP) > cfe$(BRCM_CHIP).dis
+ $(OBJCOPY) --output-target=binary cfe$(BRCM_CHIP) cfe$(BRCM_CHIP).bin
+
+$(ASM_FILE) : $(TOP)/arch/mips/board/bcm63xx_ram/src
+ rm -f $(ASM_FILE)
+ $(MAKE) -C $(RAM_BUILD)
+endif
+
+
+clean : untar_check
+ rm -f *.o *~ cfe* *.w *.srec
+ rm -f build_date.c
+ rm -f noflashimg.c >& /dev/null
+ rm -f libcfe.a
+ $(MAKE) -C $(RAM_BUILD) clean
+
+distclean : clean
+
+release : untar_check
+ $(MAKE) clean
+ $(MAKE) BRCM_CHIP=6328
+ cp -f cfe*.bin $(TARGETS_DIR)/cfe
+ $(MAKE) clean
+ $(MAKE) BRCM_CHIP=6328 BLD_NAND=1
+ cp -f cfe*.bin $(TARGETS_DIR)/cfe
+ cp -f $(RAM_BUILD)/cfe*ram.bin $(TARGETS_DIR)/cfe
+ $(MAKE) clean
+ $(MAKE) BRCM_CHIP=6362
+ cp -f cfe*.bin $(TARGETS_DIR)/cfe
+ $(MAKE) clean
+ $(MAKE) BRCM_CHIP=6362 BLD_NAND=1
+ cp -f cfe*.bin $(TARGETS_DIR)/cfe
+ cp -f $(RAM_BUILD)/cfe*ram.bin $(TARGETS_DIR)/cfe
+ $(MAKE) clean
+ $(MAKE) BRCM_CHIP=6368
+ cp -f cfe*.bin $(TARGETS_DIR)/cfe
+ $(MAKE) clean
+ $(MAKE) BRCM_CHIP=6368 BLD_NAND=1
+ cp -f cfe*.bin $(TARGETS_DIR)/cfe
+ cp -f $(RAM_BUILD)/cfe*ram.bin $(TARGETS_DIR)/cfe
+ $(MAKE) clean
+ $(MAKE) BRCM_CHIP=6816
+ cp -f cfe*.bin $(TARGETS_DIR)/cfe
+ $(MAKE) clean
+ $(MAKE) BRCM_CHIP=6816 BLD_NAND=1
+ cp -f cfe*.bin $(TARGETS_DIR)/cfe
+ cp -f $(RAM_BUILD)/cfe*ram.bin $(TARGETS_DIR)/cfe
+ $(MAKE) clean
+
+CFE_RAM_START_ADDR := $(OBJDUMP) -f $(RAM_BUILD)/cfe$(BRCM_CHIP) | grep start | cut -d'x' -f2
+VMLINUX_START_ADDR := $(OBJDUMP) -f $(LINUX_KERNEL_DIR)/vmlinux | grep start | cut -d'x' -f2
+
+# Must be called from base Linux build directory.
+ikos_finish:
+ @xxd -g4 cfe$(BRCM_CHIP) | sed -e "s/694b6f31/$(shell $(CFE_RAM_START_ADDR))/" | xxd -r > cfe$(BRCM_CHIP).tmp
+ @mv cfe$(BRCM_CHIP).tmp cfe$(BRCM_CHIP)
+ @xxd -g4 $(RAM_BUILD)/cfe$(BRCM_CHIP) | sed -e "s/694b6f32/$(shell $(VMLINUX_START_ADDR))/" | xxd -r > $(RAM_BUILD)/cfe$(BRCM_CHIP).tmp
+ @mv $(RAM_BUILD)/cfe$(BRCM_CHIP).tmp $(RAM_BUILD)/cfe$(BRCM_CHIP)
+ $(OBJCOPY) --output-target=binary cfe$(BRCM_CHIP) cfe$(BRCM_CHIP).bin
+ $(OBJCOPY) --output-target=srec $(RAM_BUILD)/cfe$(BRCM_CHIP) cferam$(BRCM_CHIP).srec
+
diff --git a/cfe/cfe/api/Makefile b/cfe/cfe/api/Makefile
new file mode 100644
index 0000000..9f2eb7c
--- /dev/null
+++ b/cfe/cfe/api/Makefile
@@ -0,0 +1,47 @@
+TOOLS_PREFIX = sb1-elf-
+CPPFLAGS = -I../include
+CFLAGS = -O2 -fomit-frame-pointer \
+ -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror
+
+CC = $(TOOLS_PREFIX)gcc
+AR = $(TOOLS_PREFIX)ar
+
+all: cfe_api.a cfe_api.o
+
+API_OBJS = \
+ api_close.o \
+ api_common.o \
+ api_cpu_start.o \
+ api_cpu_stop.o \
+ api_enumenv.o \
+ api_enummem.o \
+ api_exit.o \
+ api_flushcache.o \
+ api_getdevinfo.o \
+ api_getenv.o \
+ api_getfwinfo.o \
+ api_getstdhandle.o \
+ api_getticks.o \
+ api_inpstat.o \
+ api_ioctl.o \
+ api_open.o \
+ api_read.o \
+ api_readblk.o \
+ api_setenv.o \
+ api_strlen.o \
+ api_write.o \
+ api_writeblk.o
+
+cfe_api.a: $(API_OBJS)
+ $(AR) cru cfe_api.a $?
+
+$(API_OBJS): api_%.o: cfe_api.c Makefile cfe_api.h cfe_api_int.h
+ $(CC) -c -o $@ -DCFE_API_$* $(CPPFLAGS) $(CFLAGS) $<
+
+cfe_api.o: cfe_api.c Makefile cfe_api.h cfe_api_int.h
+ $(CC) -c -o $@ -DCFE_API_ALL $(CPPFLAGS) $(CFLAGS) $<
+
+.PHONY: clean
+
+clean:
+ rm -f *.o *.a *~
diff --git a/cfe/cfe/api/cfe_api.c b/cfe/cfe/api/cfe_api.c
new file mode 100644
index 0000000..70cb3d2
--- /dev/null
+++ b/cfe/cfe/api/cfe_api.c
@@ -0,0 +1,534 @@
+/* $Id: cfe_api.c,v 1.17 2003/02/07 17:27:56 cgd Exp $ */
+
+/*
+ * Copyright 2000, 2001, 2002
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and copied only
+ * in accordance with the following terms and conditions. Subject to these
+ * conditions, you may download, copy, install, use, modify and distribute
+ * modified or unmodified copies of this software in source and/or binary
+ * form. No title or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce and
+ * retain this copyright notice and list of conditions as they appear in
+ * the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or logo of
+ * Broadcom Corporation. The "Broadcom Corporation" name may not be
+ * used to endorse or promote products derived from this software
+ * without the prior written permission of Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+ * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM BE LIABLE
+ * FOR ANY DAMAGES WHATSOEVER, AND IN PARTICULAR, BROADCOM SHALL NOT BE
+ * LIABLE FOR DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE), EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* *********************************************************************
+ *
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Device Function stubs File: cfe_api.c
+ *
+ * This module contains device function stubs (small routines to
+ * call the standard "iocb" interface entry point to CFE).
+ * There should be one routine here per iocb function call.
+ *
+ * Authors: Mitch Lichtenberg, Chris Demetriou
+ *
+ ********************************************************************* */
+
+#include "cfe_api.h"
+#include "cfe_api_int.h"
+
+/* Cast from a native pointer to a cfe_xptr_t and back. */
+#define XPTR_FROM_NATIVE(n) ((cfe_xptr_t) (intptr_t) (n))
+#define NATIVE_FROM_XPTR(x) ((void *) (intptr_t) (x))
+
+#ifdef CFE_API_IMPL_NAMESPACE
+#define cfe_iocb_dispatch(a) __cfe_iocb_dispatch(a)
+#endif
+int cfe_iocb_dispatch(cfe_xiocb_t *xiocb);
+
+#if defined(CFE_API_common) || defined(CFE_API_ALL)
+/*
+ * Declare the dispatch function with args of "intptr_t".
+ * This makes sure whatever model we're compiling in
+ * puts the pointers in a single register. For example,
+ * combining -mlong64 and -mips1 or -mips2 would lead to
+ * trouble, since the handle and IOCB pointer will be
+ * passed in two registers each, and CFE expects one.
+ */
+
+static int (*cfe_dispfunc)(intptr_t handle, intptr_t xiocb) = 0;
+static cfe_xuint_t cfe_handle = 0;
+
+int
+cfe_init(cfe_xuint_t handle, cfe_xuint_t ept)
+{
+ cfe_dispfunc = NATIVE_FROM_XPTR(ept);
+ cfe_handle = handle;
+ return 0;
+}
+
+int
+cfe_iocb_dispatch(cfe_xiocb_t *xiocb)
+{
+ if (!cfe_dispfunc) return -1;
+ return (*cfe_dispfunc)((intptr_t)cfe_handle, (intptr_t)xiocb);
+}
+#endif /* CFE_API_common || CFE_API_ALL */
+
+#if defined(CFE_API_close) || defined(CFE_API_ALL)
+int
+cfe_close(int handle)
+{
+ cfe_xiocb_t xiocb;
+
+ xiocb.xiocb_fcode = CFE_CMD_DEV_CLOSE;
+ xiocb.xiocb_status = 0;
+ xiocb.xiocb_handle = handle;
+ xiocb.xiocb_flags = 0;
+ xiocb.xiocb_psize = 0;
+
+ cfe_iocb_dispatch(&xiocb);
+
+ return xiocb.xiocb_status;
+
+}
+#endif /* CFE_API_close || CFE_API_ALL */
+
+#if defined(CFE_API_cpu_start) || defined(CFE_API_ALL)
+int
+cfe_cpu_start(int cpu, void (*fn)(void), long sp, long gp, long a1)
+{
+ cfe_xiocb_t xiocb;
+
+ xiocb.xiocb_fcode = CFE_CMD_FW_CPUCTL;
+ xiocb.xiocb_status = 0;
+ xiocb.xiocb_handle = 0;
+ xiocb.xiocb_flags = 0;
+ xiocb.xiocb_psize = sizeof(xiocb_cpuctl_t);
+ xiocb.plist.xiocb_cpuctl.cpu_number = cpu;
+ xiocb.plist.xiocb_cpuctl.cpu_command = CFE_CPU_CMD_START;
+ xiocb.plist.xiocb_cpuctl.gp_val = gp;
+ xiocb.plist.xiocb_cpuctl.sp_val = sp;
+ xiocb.plist.xiocb_cpuctl.a1_val = a1;
+ xiocb.plist.xiocb_cpuctl.start_addr = (long)fn;
+
+ cfe_iocb_dispatch(&xiocb);
+
+ return xiocb.xiocb_status;
+}
+#endif /* CFE_API_cpu_start || CFE_API_ALL */
+
+#if defined(CFE_API_cpu_stop) || defined(CFE_API_ALL)
+int
+cfe_cpu_stop(int cpu)
+{
+ cfe_xiocb_t xiocb;
+
+ xiocb.xiocb_fcode = CFE_CMD_FW_CPUCTL;
+ xiocb.xiocb_status = 0;
+ xiocb.xiocb_handle = 0;
+ xiocb.xiocb_flags = 0;
+ xiocb.xiocb_psize = sizeof(xiocb_cpuctl_t);
+ xiocb.plist.xiocb_cpuctl.cpu_number = cpu;
+ xiocb.plist.xiocb_cpuctl.cpu_command = CFE_CPU_CMD_STOP;
+
+ cfe_iocb_dispatch(&xiocb);
+
+ return xiocb.xiocb_status;
+}
+#endif /* CFE_API_cpu_stop || CFE_API_ALL */
+
+#if defined(CFE_API_enumenv) || defined(CFE_API_ALL)
+int
+cfe_enumenv(int idx, char *name, int namelen, char *val, int vallen)
+{
+ cfe_xiocb_t xiocb;
+
+ xiocb.xiocb_fcode = CFE_CMD_ENV_SET;
+ xiocb.xiocb_status = 0;
+ xiocb.xiocb_handle = 0;
+ xiocb.xiocb_flags = 0;
+ xiocb.xiocb_psize = sizeof(xiocb_envbuf_t);
+ xiocb.plist.xiocb_envbuf.enum_idx = idx;
+ xiocb.plist.xiocb_envbuf.name_ptr = XPTR_FROM_NATIVE(name);
+ xiocb.plist.xiocb_envbuf.name_length = namelen;
+ xiocb.plist.xiocb_envbuf.val_ptr = XPTR_FROM_NATIVE(val);
+ xiocb.plist.xiocb_envbuf.val_length = vallen;
+
+ cfe_iocb_dispatch(&xiocb);
+
+ return xiocb.xiocb_status;
+}
+#endif /* CFE_API_enumenv || CFE_API_ALL */
+
+#if defined(CFE_API_enummem) || defined(CFE_API_ALL)
+int
+cfe_enummem(int idx, int flags, cfe_xuint_t *start, cfe_xuint_t *length,
+ cfe_xuint_t *type)
+{
+ cfe_xiocb_t xiocb;
+
+ xiocb.xiocb_fcode = CFE_CMD_FW_MEMENUM;
+ xiocb.xiocb_status = 0;
+ xiocb.xiocb_handle = 0;
+ xiocb.xiocb_flags = flags;
+ xiocb.xiocb_psize = sizeof(xiocb_meminfo_t);
+ xiocb.plist.xiocb_meminfo.mi_idx = idx;
+
+ cfe_iocb_dispatch(&xiocb);
+
+ if (xiocb.xiocb_status < 0)
+ return xiocb.xiocb_status;
+
+ *start = xiocb.plist.xiocb_meminfo.mi_addr;
+ *length = xiocb.plist.xiocb_meminfo.mi_size;
+ *type = xiocb.plist.xiocb_meminfo.mi_type;
+
+ return 0;
+}
+#endif /* CFE_API_enummem || CFE_API_ALL */
+
+#if defined(CFE_API_exit) || defined(CFE_API_ALL)
+int
+cfe_exit(int warm, int status)
+{
+ cfe_xiocb_t xiocb;
+
+ xiocb.xiocb_fcode = CFE_CMD_FW_RESTART;
+ xiocb.xiocb_status = 0;
+ xiocb.xiocb_handle = 0;
+ xiocb.xiocb_flags = warm ? CFE_FLG_WARMSTART : 0;
+ xiocb.xiocb_psize = sizeof(xiocb_exitstat_t);
+ xiocb.plist.xiocb_exitstat.status = status;
+
+ cfe_iocb_dispatch(&xiocb);
+
+ return xiocb.xiocb_status;
+}
+#endif /* CFE_API_exit || CFE_API_ALL */
+
+#if defined(CFE_API_flushcache) || defined(CFE_API_ALL)
+int
+cfe_flushcache(int flg)
+{
+ cfe_xiocb_t xiocb;
+
+ xiocb.xiocb_fcode = CFE_CMD_FW_FLUSHCACHE;
+ xiocb.xiocb_status = 0;
+ xiocb.xiocb_handle = 0;
+ xiocb.xiocb_flags = flg;
+ xiocb.xiocb_psize = 0;
+
+ cfe_iocb_dispatch(&xiocb);
+
+ return xiocb.xiocb_status;
+}
+#endif /* CFE_API_flushcache || CFE_API_ALL */
+
+#if defined(CFE_API_getdevinfo) || defined(CFE_API_ALL)
+int
+cfe_getdevinfo(char *name)
+{
+ cfe_xiocb_t xiocb;
+
+ xiocb.xiocb_fcode = CFE_CMD_DEV_GETINFO;
+ xiocb.xiocb_status = 0;
+ xiocb.xiocb_handle = 0;
+ xiocb.xiocb_flags = 0;
+ xiocb.xiocb_psize = sizeof(xiocb_buffer_t);
+ xiocb.plist.xiocb_buffer.buf_offset = 0;
+ xiocb.plist.xiocb_buffer.buf_ptr = XPTR_FROM_NATIVE(name);
+ xiocb.plist.xiocb_buffer.buf_length = cfe_strlen(name);
+
+ cfe_iocb_dispatch(&xiocb);
+
+ if (xiocb.xiocb_status < 0)
+ return xiocb.xiocb_status;
+ return xiocb.plist.xiocb_buffer.buf_devflags;
+}
+#endif /* CFE_API_getdevinfo || CFE_API_ALL */
+
+#if defined(CFE_API_getenv) || defined(CFE_API_ALL)
+int
+cfe_getenv(char *name, char *dest, int destlen)
+{
+ cfe_xiocb_t xiocb;
+
+ *dest = 0;
+
+ xiocb.xiocb_fcode = CFE_CMD_ENV_GET;
+ xiocb.xiocb_status = 0;
+ xiocb.xiocb_handle = 0;
+ xiocb.xiocb_flags = 0;
+ xiocb.xiocb_psize = sizeof(xiocb_envbuf_t);
+ xiocb.plist.xiocb_envbuf.enum_idx = 0;
+ xiocb.plist.xiocb_envbuf.name_ptr = XPTR_FROM_NATIVE(name);
+ xiocb.plist.xiocb_envbuf.name_length = cfe_strlen(name);
+ xiocb.plist.xiocb_envbuf.val_ptr = XPTR_FROM_NATIVE(dest);
+ xiocb.plist.xiocb_envbuf.val_length = destlen;
+
+ cfe_iocb_dispatch(&xiocb);
+
+ return xiocb.xiocb_status;
+}
+#endif /* CFE_API_getenv || CFE_API_ALL */
+
+#if defined(CFE_API_getfwinfo) || defined(CFE_API_ALL)
+int
+cfe_getfwinfo(cfe_fwinfo_t *info)
+{
+ cfe_xiocb_t xiocb;
+
+ xiocb.xiocb_fcode = CFE_CMD_FW_GETINFO;
+ xiocb.xiocb_status = 0;
+ xiocb.xiocb_handle = 0;
+ xiocb.xiocb_flags = 0;
+ xiocb.xiocb_psize = sizeof(xiocb_fwinfo_t);
+
+ cfe_iocb_dispatch(&xiocb);
+
+ if (xiocb.xiocb_status < 0)
+ return xiocb.xiocb_status;
+
+ info->fwi_version = xiocb.plist.xiocb_fwinfo.fwi_version;
+ info->fwi_totalmem = xiocb.plist.xiocb_fwinfo.fwi_totalmem;
+ info->fwi_flags = xiocb.plist.xiocb_fwinfo.fwi_flags;
+ info->fwi_boardid = xiocb.plist.xiocb_fwinfo.fwi_boardid;
+ info->fwi_bootarea_va = xiocb.plist.xiocb_fwinfo.fwi_bootarea_va;
+ info->fwi_bootarea_pa = xiocb.plist.xiocb_fwinfo.fwi_bootarea_pa;
+ info->fwi_bootarea_size = xiocb.plist.xiocb_fwinfo.fwi_bootarea_size;
+#if 0
+ info->fwi_reserved1 = xiocb.plist.xiocb_fwinfo.fwi_reserved1;
+ info->fwi_reserved2 = xiocb.plist.xiocb_fwinfo.fwi_reserved2;
+ info->fwi_reserved3 = xiocb.plist.xiocb_fwinfo.fwi_reserved3;
+#endif
+
+ return 0;
+}
+#endif /* CFE_API_getfwinfo || CFE_API_ALL */
+
+#if defined(CFE_API_getstdhandle) || defined(CFE_API_ALL)
+int
+cfe_getstdhandle(int flg)
+{
+ cfe_xiocb_t xiocb;
+
+ xiocb.xiocb_fcode = CFE_CMD_DEV_GETHANDLE;
+ xiocb.xiocb_status = 0;
+ xiocb.xiocb_handle = 0;
+ xiocb.xiocb_flags = flg;
+ xiocb.xiocb_psize = 0;
+
+ cfe_iocb_dispatch(&xiocb);
+
+ if (xiocb.xiocb_status < 0)
+ return xiocb.xiocb_status;
+ return xiocb.xiocb_handle;
+
+}
+#endif /* CFE_API_getstdhandle || CFE_API_ALL */
+
+#if defined(CFE_API_getticks) || defined(CFE_API_ALL)
+int64_t
+#ifdef CFE_API_IMPL_NAMESPACE
+__cfe_getticks(void)
+#else
+cfe_getticks(void)
+#endif
+{
+ cfe_xiocb_t xiocb;
+
+ xiocb.xiocb_fcode = CFE_CMD_FW_GETTIME;
+ xiocb.xiocb_status = 0;
+ xiocb.xiocb_handle = 0;
+ xiocb.xiocb_flags = 0;
+ xiocb.xiocb_psize = sizeof(xiocb_time_t);
+ xiocb.plist.xiocb_time.ticks = 0;
+
+ cfe_iocb_dispatch(&xiocb);
+
+ return xiocb.plist.xiocb_time.ticks;
+
+}
+#endif /* CFE_API_getticks || CFE_API_ALL */
+
+#if defined(CFE_API_inpstat) || defined(CFE_API_ALL)
+int
+cfe_inpstat(int handle)
+{
+ cfe_xiocb_t xiocb;
+
+ xiocb.xiocb_fcode = CFE_CMD_DEV_INPSTAT;
+ xiocb.xiocb_status = 0;
+ xiocb.xiocb_handle = handle;
+ xiocb.xiocb_flags = 0;
+ xiocb.xiocb_psize = sizeof(xiocb_inpstat_t);
+ xiocb.plist.xiocb_inpstat.inp_status = 0;
+
+ cfe_iocb_dispatch(&xiocb);
+
+ if (xiocb.xiocb_status < 0)
+ return xiocb.xiocb_status;
+ return xiocb.plist.xiocb_inpstat.inp_status;
+
+}
+#endif /* CFE_API_inpstat || CFE_API_ALL */
+
+#if defined(CFE_API_ioctl) || defined(CFE_API_ALL)
+int
+cfe_ioctl(int handle, unsigned int ioctlnum, unsigned char *buffer, int length,
+ int *retlen, cfe_xuint_t offset)
+{
+ cfe_xiocb_t xiocb;
+
+ xiocb.xiocb_fcode = CFE_CMD_DEV_IOCTL;
+ xiocb.xiocb_status = 0;
+ xiocb.xiocb_handle = handle;
+ xiocb.xiocb_flags = 0;
+ xiocb.xiocb_psize = sizeof(xiocb_buffer_t);
+ xiocb.plist.xiocb_buffer.buf_offset = offset;
+ xiocb.plist.xiocb_buffer.buf_ioctlcmd = ioctlnum;
+ xiocb.plist.xiocb_buffer.buf_ptr = XPTR_FROM_NATIVE(buffer);
+ xiocb.plist.xiocb_buffer.buf_length = length;
+
+ cfe_iocb_dispatch(&xiocb);
+
+ if (retlen)
+ *retlen = xiocb.plist.xiocb_buffer.buf_retlen;
+ return xiocb.xiocb_status;
+}
+#endif /* CFE_API_ioctl || CFE_API_ALL */
+
+#if defined(CFE_API_open) || defined(CFE_API_ALL)
+int
+cfe_open(char *name)
+{
+ cfe_xiocb_t xiocb;
+
+ xiocb.xiocb_fcode = CFE_CMD_DEV_OPEN;
+ xiocb.xiocb_status = 0;
+ xiocb.xiocb_handle = 0;
+ xiocb.xiocb_flags = 0;
+ xiocb.xiocb_psize = sizeof(xiocb_buffer_t);
+ xiocb.plist.xiocb_buffer.buf_offset = 0;
+ xiocb.plist.xiocb_buffer.buf_ptr = XPTR_FROM_NATIVE(name);
+ xiocb.plist.xiocb_buffer.buf_length = cfe_strlen(name);
+
+ cfe_iocb_dispatch(&xiocb);
+
+ if (xiocb.xiocb_status < 0)
+ return xiocb.xiocb_status;
+ return xiocb.xiocb_handle;
+}
+#endif /* CFE_API_open || CFE_API_ALL */
+
+#if defined(CFE_API_read) || defined(CFE_API_ALL)
+int
+cfe_read(int handle, unsigned char *buffer, int length)
+{
+ return cfe_readblk(handle, 0, buffer, length);
+}
+#endif /* CFE_API_read || CFE_API_ALL */
+
+#if defined(CFE_API_readblk) || defined(CFE_API_ALL)
+int
+cfe_readblk(int handle, cfe_xint_t offset, unsigned char *buffer, int length)
+{
+ cfe_xiocb_t xiocb;
+
+ xiocb.xiocb_fcode = CFE_CMD_DEV_READ;
+ xiocb.xiocb_status = 0;
+ xiocb.xiocb_handle = handle;
+ xiocb.xiocb_flags = 0;
+ xiocb.xiocb_psize = sizeof(xiocb_buffer_t);
+ xiocb.plist.xiocb_buffer.buf_offset = offset;
+ xiocb.plist.xiocb_buffer.buf_ptr = XPTR_FROM_NATIVE(buffer);
+ xiocb.plist.xiocb_buffer.buf_length = length;
+
+ cfe_iocb_dispatch(&xiocb);
+
+ if (xiocb.xiocb_status < 0)
+ return xiocb.xiocb_status;
+ return xiocb.plist.xiocb_buffer.buf_retlen;
+}
+#endif /* CFE_API_readblk || CFE_API_ALL */
+
+#if defined(CFE_API_setenv) || defined(CFE_API_ALL)
+int
+cfe_setenv(char *name, char *val)
+{
+ cfe_xiocb_t xiocb;
+
+ xiocb.xiocb_fcode = CFE_CMD_ENV_SET;
+ xiocb.xiocb_status = 0;
+ xiocb.xiocb_handle = 0;
+ xiocb.xiocb_flags = 0;
+ xiocb.xiocb_psize = sizeof(xiocb_envbuf_t);
+ xiocb.plist.xiocb_envbuf.enum_idx = 0;
+ xiocb.plist.xiocb_envbuf.name_ptr = XPTR_FROM_NATIVE(name);
+ xiocb.plist.xiocb_envbuf.name_length = cfe_strlen(name);
+ xiocb.plist.xiocb_envbuf.val_ptr = XPTR_FROM_NATIVE(val);
+ xiocb.plist.xiocb_envbuf.val_length = cfe_strlen(val);
+
+ cfe_iocb_dispatch(&xiocb);
+
+ return xiocb.xiocb_status;
+}
+#endif /* CFE_API_setenv || CFE_API_ALL */
+
+#if (defined(CFE_API_strlen) || defined(CFE_API_ALL)) \
+ && !defined(CFE_API_STRLEN_CUSTOM)
+int
+cfe_strlen(char *name)
+{
+ int count = 0;
+
+ while (*name++)
+ count++;
+
+ return count;
+}
+#endif /* CFE_API_strlen || CFE_API_ALL */
+
+#if defined(CFE_API_write) || defined(CFE_API_ALL)
+int
+cfe_write(int handle, unsigned char *buffer, int length)
+{
+ return cfe_writeblk(handle, 0, buffer, length);
+}
+#endif /* CFE_API_write || CFE_API_ALL */
+
+#if defined(CFE_API_writeblk) || defined(CFE_API_ALL)
+int
+cfe_writeblk(int handle, cfe_xint_t offset, unsigned char *buffer, int length)
+{
+ cfe_xiocb_t xiocb;
+
+ xiocb.xiocb_fcode = CFE_CMD_DEV_WRITE;
+ xiocb.xiocb_status = 0;
+ xiocb.xiocb_handle = handle;
+ xiocb.xiocb_flags = 0;
+ xiocb.xiocb_psize = sizeof(xiocb_buffer_t);
+ xiocb.plist.xiocb_buffer.buf_offset = offset;
+ xiocb.plist.xiocb_buffer.buf_ptr = XPTR_FROM_NATIVE(buffer);
+ xiocb.plist.xiocb_buffer.buf_length = length;
+
+ cfe_iocb_dispatch(&xiocb);
+
+ if (xiocb.xiocb_status < 0)
+ return xiocb.xiocb_status;
+ return xiocb.plist.xiocb_buffer.buf_retlen;
+}
+#endif /* CFE_API_writeblk || CFE_API_ALL */
diff --git a/cfe/cfe/api/cfe_api.h b/cfe/cfe/api/cfe_api.h
new file mode 100644
index 0000000..ea598f0
--- /dev/null
+++ b/cfe/cfe/api/cfe_api.h
@@ -0,0 +1,192 @@
+/* $Id: cfe_api.h,v 1.30 2003/02/07 17:27:56 cgd Exp $ */
+
+/*
+ * Copyright 2000, 2001, 2002
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and copied only
+ * in accordance with the following terms and conditions. Subject to these
+ * conditions, you may download, copy, install, use, modify and distribute
+ * modified or unmodified copies of this software in source and/or binary
+ * form. No title or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce and
+ * retain this copyright notice and list of conditions as they appear in
+ * the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or logo of
+ * Broadcom Corporation. The "Broadcom Corporation" name may not be
+ * used to endorse or promote products derived from this software
+ * without the prior written permission of Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+ * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM BE LIABLE
+ * FOR ANY DAMAGES WHATSOEVER, AND IN PARTICULAR, BROADCOM SHALL NOT BE
+ * LIABLE FOR DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE), EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* *********************************************************************
+ *
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Device function prototypes File: cfe_api.h
+ *
+ * This file contains declarations for doing callbacks to
+ * cfe from an application. It should be the only header
+ * needed by the application to use this library
+ *
+ * Authors: Mitch Lichtenberg, Chris Demetriou
+ *
+ ********************************************************************* */
+
+#ifndef CFE_API_H
+#define CFE_API_H
+
+/*
+ * Apply customizations here for different OSes. These need to:
+ * * typedef uint64_t, int64_t, intptr_t, uintptr_t.
+ * * define cfe_strlen() if use of an existing function is desired.
+ * * define CFE_API_IMPL_NAMESPACE if API functions are to use
+ * names in the implementation namespace.
+ * Also, optionally, if the build environment does not do so automatically,
+ * CFE_API_* can be defined here as desired.
+ */
+/* Begin customization. */
+#include "lib_types.h"
+/* End customization. */
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+/* Seal indicating CFE's presence, passed to user program. */
+#define CFE_EPTSEAL 0x43464531
+
+#define CFE_MI_RESERVED 0 /* memory is reserved, do not use */
+#define CFE_MI_AVAILABLE 1 /* memory is available */
+
+#define CFE_FLG_WARMSTART 0x00000001
+#define CFE_FLG_FULL_ARENA 0x00000001
+#define CFE_FLG_ENV_PERMANENT 0x00000001
+
+#define CFE_CPU_CMD_START 1
+#define CFE_CPU_CMD_STOP 0
+
+#define CFE_STDHANDLE_CONSOLE 0
+
+#define CFE_DEV_NETWORK 1
+#define CFE_DEV_DISK 2
+#define CFE_DEV_FLASH 3
+#define CFE_DEV_SERIAL 4
+#define CFE_DEV_CPU 5
+#define CFE_DEV_NVRAM 6
+#define CFE_DEV_CLOCK 7
+#define CFE_DEV_OTHER 8
+#define CFE_DEV_MASK 0x0F
+
+#define CFE_CACHE_FLUSH_D 1
+#define CFE_CACHE_INVAL_I 2
+#define CFE_CACHE_INVAL_D 4
+#define CFE_CACHE_INVAL_L2 8
+
+#define CFE_FWI_64BIT 0x00000001
+#define CFE_FWI_32BIT 0x00000002
+#define CFE_FWI_RELOC 0x00000004
+#define CFE_FWI_UNCACHED 0x00000008
+#define CFE_FWI_MULTICPU 0x00000010
+#define CFE_FWI_FUNCSIM 0x00000020
+#define CFE_FWI_RTLSIM 0x00000040
+
+typedef struct {
+ int64_t fwi_version; /* major, minor, eco version */
+ int64_t fwi_totalmem; /* total installed mem */
+ int64_t fwi_flags; /* various flags */
+ int64_t fwi_boardid; /* board ID */
+ int64_t fwi_bootarea_va; /* VA of boot area */
+ int64_t fwi_bootarea_pa; /* PA of boot area */
+ int64_t fwi_bootarea_size; /* size of boot area */
+} cfe_fwinfo_t;
+
+
+/*
+ * cfe_strlen is handled specially: If already defined, it has been
+ * overridden in this environment with a standard strlen-like function.
+ */
+#ifdef cfe_strlen
+# define CFE_API_STRLEN_CUSTOM
+#else
+# ifdef CFE_API_IMPL_NAMESPACE
+# define cfe_strlen(a) __cfe_strlen(a)
+# endif
+int cfe_strlen(char *name);
+#endif
+
+/*
+ * Defines and prototypes for functions which take no arguments.
+ */
+#ifdef CFE_API_IMPL_NAMESPACE
+int64_t __cfe_getticks(void);
+#define cfe_getticks() __cfe_getticks()
+#else
+int64_t cfe_getticks(void);
+#endif
+
+/*
+ * Defines and prototypes for the rest of the functions.
+ */
+#ifdef CFE_API_IMPL_NAMESPACE
+#define cfe_close(a) __cfe_close(a)
+#define cfe_cpu_start(a,b,c,d,e) __cfe_cpu_start(a,b,c,d,e)
+#define cfe_cpu_stop(a) __cfe_cpu_stop(a)
+#define cfe_enumenv(a,b,d,e,f) __cfe_enumenv(a,b,d,e,f)
+#define cfe_enummem(a,b,c,d,e) __cfe_enummem(a,b,c,d,e)
+#define cfe_exit(a,b) __cfe_exit(a,b)
+#define cfe_flushcache(a) __cfe_cacheflush(a)
+#define cfe_getdevinfo(a) __cfe_getdevinfo(a)
+#define cfe_getenv(a,b,c) __cfe_getenv(a,b,c)
+#define cfe_getfwinfo(a) __cfe_getfwinfo(a)
+#define cfe_getstdhandle(a) __cfe_getstdhandle(a)
+#define cfe_init(a,b) __cfe_init(a,b)
+#define cfe_inpstat(a) __cfe_inpstat(a)
+#define cfe_ioctl(a,b,c,d,e,f) __cfe_ioctl(a,b,c,d,e,f)
+#define cfe_open(a) __cfe_open(a)
+#define cfe_read(a,b,c) __cfe_read(a,b,c)
+#define cfe_readblk(a,b,c,d) __cfe_readblk(a,b,c,d)
+#define cfe_setenv(a,b) __cfe_setenv(a,b)
+#define cfe_write(a,b,c) __cfe_write(a,b,c)
+#define cfe_writeblk(a,b,c,d) __cfe_writeblk(a,b,c,d)
+#endif /* CFE_API_IMPL_NAMESPACE */
+
+int cfe_close(int handle);
+int cfe_cpu_start(int cpu, void (*fn)(void), long sp, long gp, long a1);
+int cfe_cpu_stop(int cpu);
+int cfe_enumenv(int idx, char *name, int namelen, char *val, int vallen);
+int cfe_enummem(int idx, int flags, uint64_t *start, uint64_t *length,
+ uint64_t *type);
+int cfe_exit(int warm,int status);
+int cfe_flushcache(int flg);
+int cfe_getdevinfo(char *name);
+int cfe_getenv(char *name, char *dest, int destlen);
+int cfe_getfwinfo(cfe_fwinfo_t *info);
+int cfe_getstdhandle(int flg);
+int cfe_init(uint64_t handle,uint64_t ept);
+int cfe_inpstat(int handle);
+int cfe_ioctl(int handle, unsigned int ioctlnum, unsigned char *buffer,
+ int length, int *retlen, uint64_t offset);
+int cfe_open(char *name);
+int cfe_read(int handle, unsigned char *buffer, int length);
+int cfe_readblk(int handle, int64_t offset, unsigned char *buffer, int length);
+int cfe_setenv(char *name, char *val);
+int cfe_write(int handle, unsigned char *buffer, int length);
+int cfe_writeblk(int handle, int64_t offset, unsigned char *buffer,
+ int length);
+
+#endif /* CFE_API_H */
diff --git a/cfe/cfe/api/cfe_api_int.h b/cfe/cfe/api/cfe_api_int.h
new file mode 100644
index 0000000..4bac86d
--- /dev/null
+++ b/cfe/cfe/api/cfe_api_int.h
@@ -0,0 +1,168 @@
+/* $Id: cfe_api_int.h,v 1.22 2003/02/07 17:27:56 cgd Exp $ */
+
+/*
+ * Copyright 2000, 2001, 2002
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and copied only
+ * in accordance with the following terms and conditions. Subject to these
+ * conditions, you may download, copy, install, use, modify and distribute
+ * modified or unmodified copies of this software in source and/or binary
+ * form. No title or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce and
+ * retain this copyright notice and list of conditions as they appear in
+ * the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or logo of
+ * Broadcom Corporation. The "Broadcom Corporation" name may not be
+ * used to endorse or promote products derived from this software
+ * without the prior written permission of Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+ * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM BE LIABLE
+ * FOR ANY DAMAGES WHATSOEVER, AND IN PARTICULAR, BROADCOM SHALL NOT BE
+ * LIABLE FOR DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE), EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* *********************************************************************
+ *
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Device function prototypes File: cfe_api_int.h
+ *
+ * This header defines all internal types and macros for the
+ * library. This is stuff that's not exported to an app
+ * using the library.
+ *
+ * Authors: Mitch Lichtenberg, Chris Demetriou
+ *
+ ********************************************************************* */
+
+#ifndef CFE_API_INT_H
+#define CFE_API_INT_H
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define CFE_CMD_FW_GETINFO 0
+#define CFE_CMD_FW_RESTART 1
+#define CFE_CMD_FW_BOOT 2
+#define CFE_CMD_FW_CPUCTL 3
+#define CFE_CMD_FW_GETTIME 4
+#define CFE_CMD_FW_MEMENUM 5
+#define CFE_CMD_FW_FLUSHCACHE 6
+
+#define CFE_CMD_DEV_GETHANDLE 9
+#define CFE_CMD_DEV_ENUM 10
+#define CFE_CMD_DEV_OPEN 11
+#define CFE_CMD_DEV_INPSTAT 12
+#define CFE_CMD_DEV_READ 13
+#define CFE_CMD_DEV_WRITE 14
+#define CFE_CMD_DEV_IOCTL 15
+#define CFE_CMD_DEV_CLOSE 16
+#define CFE_CMD_DEV_GETINFO 17
+
+#define CFE_CMD_ENV_ENUM 20
+#define CFE_CMD_ENV_GET 22
+#define CFE_CMD_ENV_SET 23
+#define CFE_CMD_ENV_DEL 24
+
+#define CFE_CMD_MAX 32
+
+#define CFE_CMD_VENDOR_USE 0x8000 /* codes above this are for customer use */
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+typedef uint64_t cfe_xuint_t;
+typedef int64_t cfe_xint_t;
+typedef int64_t cfe_xptr_t;
+
+typedef struct xiocb_buffer_s {
+ cfe_xuint_t buf_offset; /* offset on device (bytes) */
+ cfe_xptr_t buf_ptr; /* pointer to a buffer */
+ cfe_xuint_t buf_length; /* length of this buffer */
+ cfe_xuint_t buf_retlen; /* returned length (for read ops) */
+ cfe_xuint_t buf_ioctlcmd; /* IOCTL command (used only for IOCTLs) */
+} xiocb_buffer_t;
+
+#define buf_devflags buf_ioctlcmd /* returned device info flags */
+
+typedef struct xiocb_inpstat_s {
+ cfe_xuint_t inp_status; /* 1 means input available */
+} xiocb_inpstat_t;
+
+typedef struct xiocb_envbuf_s {
+ cfe_xint_t enum_idx; /* 0-based enumeration index */
+ cfe_xptr_t name_ptr; /* name string buffer */
+ cfe_xint_t name_length; /* size of name buffer */
+ cfe_xptr_t val_ptr; /* value string buffer */
+ cfe_xint_t val_length; /* size of value string buffer */
+} xiocb_envbuf_t;
+
+typedef struct xiocb_cpuctl_s {
+ cfe_xuint_t cpu_number; /* cpu number to control */
+ cfe_xuint_t cpu_command; /* command to issue to CPU */
+ cfe_xuint_t start_addr; /* CPU start address */
+ cfe_xuint_t gp_val; /* starting GP value */
+ cfe_xuint_t sp_val; /* starting SP value */
+ cfe_xuint_t a1_val; /* starting A1 value */
+} xiocb_cpuctl_t;
+
+typedef struct xiocb_time_s {
+ cfe_xint_t ticks; /* current time in ticks */
+} xiocb_time_t;
+
+typedef struct xiocb_exitstat_s {
+ cfe_xint_t status;
+} xiocb_exitstat_t;
+
+typedef struct xiocb_meminfo_s {
+ cfe_xint_t mi_idx; /* 0-based enumeration index */
+ cfe_xint_t mi_type; /* type of memory block */
+ cfe_xuint_t mi_addr; /* physical start address */
+ cfe_xuint_t mi_size; /* block size */
+} xiocb_meminfo_t;
+
+typedef struct xiocb_fwinfo_s {
+ cfe_xint_t fwi_version; /* major, minor, eco version */
+ cfe_xint_t fwi_totalmem; /* total installed mem */
+ cfe_xint_t fwi_flags; /* various flags */
+ cfe_xint_t fwi_boardid; /* board ID */
+ cfe_xint_t fwi_bootarea_va; /* VA of boot area */
+ cfe_xint_t fwi_bootarea_pa; /* PA of boot area */
+ cfe_xint_t fwi_bootarea_size; /* size of boot area */
+ cfe_xint_t fwi_reserved1;
+ cfe_xint_t fwi_reserved2;
+ cfe_xint_t fwi_reserved3;
+} xiocb_fwinfo_t;
+
+typedef struct cfe_xiocb_s {
+ cfe_xuint_t xiocb_fcode; /* IOCB function code */
+ cfe_xint_t xiocb_status; /* return status */
+ cfe_xint_t xiocb_handle; /* file/device handle */
+ cfe_xuint_t xiocb_flags; /* flags for this IOCB */
+ cfe_xuint_t xiocb_psize; /* size of parameter list */
+ union {
+ xiocb_buffer_t xiocb_buffer; /* buffer parameters */
+ xiocb_inpstat_t xiocb_inpstat; /* input status parameters */
+ xiocb_envbuf_t xiocb_envbuf; /* environment function parameters */
+ xiocb_cpuctl_t xiocb_cpuctl; /* CPU control parameters */
+ xiocb_time_t xiocb_time; /* timer parameters */
+ xiocb_meminfo_t xiocb_meminfo; /* memory arena info parameters */
+ xiocb_fwinfo_t xiocb_fwinfo; /* firmware information */
+ xiocb_exitstat_t xiocb_exitstat; /* Exit Status */
+ } plist;
+} cfe_xiocb_t;
+
+#endif /* CFE_API_INT_H */
diff --git a/cfe/cfe/api/cfe_error.h b/cfe/cfe/api/cfe_error.h
new file mode 100644
index 0000000..6301c56
--- /dev/null
+++ b/cfe/cfe/api/cfe_error.h
@@ -0,0 +1,101 @@
+/* $Id: cfe_error.h,v 1.3 2003/02/07 17:27:56 cgd Exp $ */
+
+/*
+ * Copyright 2000, 2001, 2002
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and copied only
+ * in accordance with the following terms and conditions. Subject to these
+ * conditions, you may download, copy, install, use, modify and distribute
+ * modified or unmodified copies of this software in source and/or binary
+ * form. No title or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce and
+ * retain this copyright notice and list of conditions as they appear in
+ * the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or logo of
+ * Broadcom Corporation. The "Broadcom Corporation" name may not be
+ * used to endorse or promote products derived from this software
+ * without the prior written permission of Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+ * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM BE LIABLE
+ * FOR ANY DAMAGES WHATSOEVER, AND IN PARTICULAR, BROADCOM SHALL NOT BE
+ * LIABLE FOR DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE), EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* *********************************************************************
+ *
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Error codes File: cfe_error.h
+ *
+ * CFE's global error code list is here.
+ *
+ * Author: Mitch Lichtenberg
+ *
+ ********************************************************************* */
+
+
+#define CFE_OK 0
+#define CFE_ERR -1 /* generic error */
+#define CFE_ERR_INV_COMMAND -2
+#define CFE_ERR_EOF -3
+#define CFE_ERR_IOERR -4
+#define CFE_ERR_NOMEM -5
+#define CFE_ERR_DEVNOTFOUND -6
+#define CFE_ERR_DEVOPEN -7
+#define CFE_ERR_INV_PARAM -8
+#define CFE_ERR_ENVNOTFOUND -9
+#define CFE_ERR_ENVREADONLY -10
+
+#define CFE_ERR_NOTELF -11
+#define CFE_ERR_NOT32BIT -12
+#define CFE_ERR_WRONGENDIAN -13
+#define CFE_ERR_BADELFVERS -14
+#define CFE_ERR_NOTMIPS -15
+#define CFE_ERR_BADELFFMT -16
+#define CFE_ERR_BADADDR -17
+
+#define CFE_ERR_FILENOTFOUND -18
+#define CFE_ERR_UNSUPPORTED -19
+
+#define CFE_ERR_HOSTUNKNOWN -20
+
+#define CFE_ERR_TIMEOUT -21
+
+#define CFE_ERR_PROTOCOLERR -22
+
+#define CFE_ERR_NETDOWN -23
+#define CFE_ERR_NONAMESERVER -24
+
+#define CFE_ERR_NOHANDLES -25
+#define CFE_ERR_ALREADYBOUND -26
+
+#define CFE_ERR_CANNOTSET -27
+#define CFE_ERR_NOMORE -28
+#define CFE_ERR_BADFILESYS -29
+#define CFE_ERR_FSNOTAVAIL -30
+
+#define CFE_ERR_INVBOOTBLOCK -31
+#define CFE_ERR_WRONGDEVTYPE -32
+#define CFE_ERR_BBCHECKSUM -33
+#define CFE_ERR_BOOTPROGCHKSUM -34
+
+#define CFE_ERR_LDRNOTAVAIL -35
+
+#define CFE_ERR_NOTREADY -36
+
+#define CFE_ERR_GETMEM -37
+#define CFE_ERR_SETMEM -38
+
+#define CFE_ERR_NOTCONN -39
+#define CFE_ERR_ADDRINUSE -40
diff --git a/cfe/cfe/applets/Makefile b/cfe/cfe/applets/Makefile
new file mode 100644
index 0000000..42e1e4f
--- /dev/null
+++ b/cfe/cfe/applets/Makefile
@@ -0,0 +1,64 @@
+
+CFG_MLONG64=0
+
+CFE_DIRS = ../include ../arch/mips/cpu/sb1250/include ../lib ../verif ../api
+CFE_INCLUDES = $(patsubst %,-I%,$(subst :, ,$(CFE_DIRS)))
+
+VPATH = $(CFE_DIRS)
+
+INCLUDES = -I. $(CFE_INCLUDES)
+COMFLAGS = -g -c -mcpu=sb1 -ffreestanding
+CFLAGS = $(INCLUDES) $(COMFLAGS) -O -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -G 0 -DCFE_API_ALL
+
+GCC = $(TOOLS)sb1-elf-gcc
+GLD = $(TOOLS)sb1-elf-ld
+OBJCOPY = $(TOOLS)sb1-elf-objcopy
+
+ifeq (${CFG_MLONG64},1)
+CFLAGS += -mlong64 -D__long64
+endif
+
+LDFLAGS = --script cfe_applet.lds -g
+
+ifeq (CFG_LITTLE,1)
+CFLAGS += -EL
+LDFLAGS += -EL
+else
+CFLAGS += -EB
+LDFLAGS += -EB
+endif
+
+
+%.o : %.c
+ $(GCC) $(CFLAGS) -o $@ $<
+
+%.o : %.S
+ $(GCC) $(CFLAGS) -o $@ $<
+
+
+LIBOBJS = lib_printf.o lib_string.o cfe_api.o
+
+all : test vapitest
+ echo done
+
+test : test.o minicrt0.o $(LIBOBJS)
+ $(GLD) -o test.elfraw -Map test.mapraw $(LDFLAGS) minicrt0.o test.o $(LIBOBJS)
+ $(GLD) -o test.elf -Ttext 0x20000000 -Map test.map $(LDFLAGS) minicrt0.o test.o $(LIBOBJS)
+ $(OBJCOPY) -O binary test.elfraw test
+ $(OBJCOPY) -O srec test.elfraw test.srec
+
+download : download.o minicrt0.o $(LIBOBJS)
+ $(GLD) -o download.elf -Ttext 0x80001000 -Map download.map $(LDFLAGS) minicrt0.o download.o $(LIBOBJS)
+ $(OBJCOPY) --strip-unneeded download.elf s.download.elf
+ gzip --best -c s.download.elf > download.elf.gz
+ $(GLD) -Tdownload.lds -bbinary -o download.data download.elf.gz
+
+vapitest : vapitest.o
+ $(GLD) -o vapitest -Ttext 0x80020000 -Map vapitest.map vapitest.o
+ $(OBJCOPY) -O srec vapitest vapitest.srec
+
+clean :
+ rm -f *.o *~ *.map *.mapraw
+ rm -f test test.elf test.srec test.elfraw
+ rm -f *download.elf *.gz
+ rm -f vapitest vapitest.srec
diff --git a/cfe/cfe/applets/README b/cfe/cfe/applets/README
new file mode 100644
index 0000000..b622997
--- /dev/null
+++ b/cfe/cfe/applets/README
@@ -0,0 +1,21 @@
+
+This directory contains "applets" - simple programs to let
+us test the callbacks into CFE.
+
+You should be able to compile these programs and load them
+via the TFTP loader in CFE, and when run, they will call
+the APIs in CFE to display messages and such.
+
+The files cfe_api.c, cfe_api.h, and cfe_api_int.h are versions
+of the same files from ../applets, customized to build with this
+stand-alone build environment. Typically you won't want to copy
+these. Instead, you'll want to copy the versions in ../applets and
+customize them as needed.
+
+Pay particular attention to the MIPS calling conventions
+you are using. In particular, CFE uses 64-bit register
+values. If you compile your program with -mips1 or -mips2,
+the 64-bit arguments will be passed as 2 32-bt registers.
+
+In most cases, CFE only uses the lower 32 bits, since
+it can be called from either 32 or 64-bit applications.
diff --git a/cfe/cfe/applets/cfe_applet.lds b/cfe/cfe/applets/cfe_applet.lds
new file mode 100644
index 0000000..e1b33e9
--- /dev/null
+++ b/cfe/cfe/applets/cfe_applet.lds
@@ -0,0 +1,37 @@
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SECTIONS
+{
+ . = 0x20000000;
+/* . = 0x81000000; */
+ .text :
+ {
+ _ftext = . ;
+ *(.init)
+ eprol = .;
+ *(.text)
+ *(.fini)
+ *(.rodata)
+ _etext = .;
+ }
+
+ .data :
+ {
+ _gp = ALIGN(16) + 0x8000;
+ _fdata = . ;
+ *(.data)
+ CONSTRUCTORS
+ *(.sdata)
+ }
+ _edata = .;
+ _fbss = .;
+ .sbss : {
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss : {
+ *(.bss)
+ *(COMMON)
+ }
+ _end = .;
+}
diff --git a/cfe/cfe/applets/download.c b/cfe/cfe/applets/download.c
new file mode 100644
index 0000000..911c649
--- /dev/null
+++ b/cfe/cfe/applets/download.c
@@ -0,0 +1,163 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Null device mode driver File: download.c
+ *
+ * Small program (placeholder) to download to a 1250 in PCI Device Mode
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "cfe_api.h"
+
+int conhandle;
+
+
+void appletmain(long handle,long vector,
+ long reserved,long seal);
+
+
+
+
+/* *********************************************************************
+ * console_write(buffer,length)
+ *
+ * Write text to the console. If the console is not open and
+ * we're "saving" text, put the text on the in-memory queue
+ *
+ * Input parameters:
+ * buffer - pointer to data
+ * length - number of characters to write
+ *
+ * Return value:
+ * number of characters written or <0 if error
+ ********************************************************************* */
+
+static int console_write(unsigned char *buffer,int length)
+{
+ int res;
+
+ /*
+ * Do nothing if no console
+ */
+
+ if (conhandle == -1) return -1;
+
+ /*
+ * Write text to device
+ */
+
+ for (;;) {
+ res = cfe_write(conhandle,buffer,length);
+ if (res < 0) break;
+ buffer += res;
+ length -= res;
+ if (length == 0) break;
+ }
+
+ if (res < 0) return -1;
+ return 0;
+}
+
+
+/* *********************************************************************
+ * console_xprint(str)
+ *
+ * printf callback for the console device. the "xprintf"
+ * routine ends up calling this. This routine also cooks the
+ * output, turning "\n" into "\r\n"
+ *
+ * Input parameters:
+ * str - string to write
+ *
+ * Return value:
+ * number of characters written
+ ********************************************************************* */
+
+static int console_xprint(const char *str)
+{
+ int count = 0;
+ int len;
+ const char *p;
+
+ /* Convert CR to CRLF as we write things out */
+
+ while ((p = strchr(str,'\n'))) {
+ console_write((char *) str,p-str);
+ console_write("\r\n",2);
+ count += (p-str);
+ str = p + 1;
+ }
+
+ len = strlen(str);
+ console_write((char *) str, len);
+ count += len;
+
+ return count;
+}
+
+
+void appletmain(long handle,long vector,
+ long ept,long seal)
+{
+ void (*reboot)(void) = (void *) (uintptr_t) (int) 0xBFC00000;
+ char str[100];
+
+ xprinthook = console_xprint;
+
+ cfe_init(handle,ept);
+
+ conhandle = cfe_getstdhandle(CFE_STDHANDLE_CONSOLE);
+
+ str[0] = 0;
+ cfe_getenv("BOOT_CONSOLE",str,sizeof(str));
+
+ xprintf("\nHello, world. Console = %s\n",str);
+
+ xprintf("\nThis is a null device driver that just restarts CFE\n");
+ xprintf("Rebuild the host's CFE to replace it with your driver.\n\n");
+
+ xprintf("Exiting to CFE\n\n");
+
+ cfe_exit(CFE_FLG_WARMSTART,0);
+
+ (*reboot)();
+}
diff --git a/cfe/cfe/applets/download.lds b/cfe/cfe/applets/download.lds
new file mode 100644
index 0000000..7f6e6be
--- /dev/null
+++ b/cfe/cfe/applets/download.lds
@@ -0,0 +1,12 @@
+OUTPUT_FORMAT("elf32-bigmips")
+OUTPUT_ARCH("mipssb1")
+
+SECTIONS
+{
+ .rodata :
+ {
+ download_start = .;
+ *(.data);
+ download_end = .;
+ }
+}
diff --git a/cfe/cfe/applets/minicrt0.S b/cfe/cfe/applets/minicrt0.S
new file mode 100644
index 0000000..937f240
--- /dev/null
+++ b/cfe/cfe/applets/minicrt0.S
@@ -0,0 +1,95 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Mini startup module for CFE apps File: minicrt0.S
+ *
+ * About the most minimal startup routine you can get.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "sbmips.h"
+
+/*
+ * This module should be linked first!
+ */
+
+#define STACK_SIZE 8192
+
+ .bss
+ .comm stack_bottom,STACK_SIZE
+ .comm __junk,4
+
+ .text
+
+ .extern appletmain
+ .globl __start
+
+__start:
+
+ /*
+ * Set up our GP (in case we're using it)
+ * Set up the stack pointer (don't use CFE's stack)
+ */
+
+ la gp,_gp
+ la sp,stack_bottom+STACK_SIZE-32
+
+ /*
+ * Zero BSS. No need to do this very efficiently, do it
+ * 32 bits at a time to ensure we can compile this
+ * with -mips1.
+ */
+
+ la t0,_fbss
+ la t1,_end
+
+1: sw zero,0(t0)
+ add t0,4
+ blt t0,t1,1b
+
+ /*
+ * Jump to main program. Note that we didn't trash A0..A3,
+ * our application will need them. So, if you add stuff here,
+ * be sure to preserve the A0..A3 registers for the C code.
+ */
+
+ j appletmain
+
diff --git a/cfe/cfe/applets/test.c b/cfe/cfe/applets/test.c
new file mode 100644
index 0000000..9122456
--- /dev/null
+++ b/cfe/cfe/applets/test.c
@@ -0,0 +1,211 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * API test program File: test.c
+ *
+ * Small program to test CFE's external API
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "cfe_api.h"
+
+int conhandle;
+
+
+void appletmain(unsigned long handle,unsigned long vector,
+ unsigned long reserved,unsigned long seal);
+
+
+
+
+/* *********************************************************************
+ * console_write(buffer,length)
+ *
+ * Write text to the console. If the console is not open and
+ * we're "saving" text, put the text on the in-memory queue
+ *
+ * Input parameters:
+ * buffer - pointer to data
+ * length - number of characters to write
+ *
+ * Return value:
+ * number of characters written or <0 if error
+ ********************************************************************* */
+
+static int console_write(unsigned char *buffer,int length)
+{
+ int res;
+
+ /*
+ * Do nothing if no console
+ */
+
+ if (conhandle == -1) return -1;
+
+ /*
+ * Write text to device
+ */
+
+ for (;;) {
+ res = cfe_write(conhandle,buffer,length);
+ if (res < 0) break;
+ buffer += res;
+ length -= res;
+ if (length == 0) break;
+ }
+
+ if (res < 0) return -1;
+ return 0;
+}
+
+
+/* *********************************************************************
+ * console_xprint(str)
+ *
+ * printf callback for the console device. the "xprintf"
+ * routine ends up calling this. This routine also cooks the
+ * output, turning "\n" into "\r\n"
+ *
+ * Input parameters:
+ * str - string to write
+ *
+ * Return value:
+ * number of characters written
+ ********************************************************************* */
+
+static int console_xprint(const char *str)
+{
+ int count = 0;
+ int len;
+ const char *p;
+
+ /* Convert CR to CRLF as we write things out */
+
+ while ((p = strchr(str,'\n'))) {
+ console_write((char *) str,p-str);
+ console_write("\r\n",2);
+ count += (p-str);
+ str = p + 1;
+ }
+
+ len = strlen(str);
+ console_write((char *) str, len);
+ count += len;
+
+ return count;
+}
+
+
+#if 0
+static int myxprinthook(const char *str)
+{
+ int count = 0;
+ int len;
+ const char *p;
+
+ /* Convert CR to CRLF as we write things out */
+
+ while ((p = strchr(str,'\r'))) {
+ cfe_write(conhandle,(char *) str,p-str+1);
+ cfe_write(conhandle,"\n",1);
+ count += (p-str);
+ str = p + 1;
+ }
+
+ len = strlen(str);
+ cfe_write(conhandle,(char *) str, len);
+ count += len;
+
+ return count;
+}
+#endif
+
+void appletmain(unsigned long handle,unsigned long vector,
+ unsigned long ept,unsigned long seal)
+{
+ void (*reboot)(void) = (void *) (uintptr_t) (int) 0xBFC00000;
+ char str[100];
+ cfe_fwinfo_t info;
+ int idx;
+ int res;
+ uint64_t start,length,type;
+
+ xprinthook = console_xprint;
+
+ cfe_init(handle,ept);
+
+ conhandle = cfe_getstdhandle(CFE_STDHANDLE_CONSOLE);
+
+ str[0] = 0;
+ cfe_getenv("BOOT_CONSOLE",str,sizeof(str));
+
+ xprintf("Hello, world. Console = %s\n",str);
+ xprintf("API Seal = %08X\n",(int)seal);
+ xprintf("Entrypoint=%08X Handle=%08X\n",(int)ept,(int)handle);
+ idx = 0;
+
+ cfe_getfwinfo(&info);
+ xprintf("CFE version: %08llX\n",info.fwi_version);
+ xprintf("Flags: %08llX\n",info.fwi_flags);
+ xprintf("Total memory: %08llX\n",info.fwi_totalmem);
+ xprintf("Board ID: %08llX\n",info.fwi_boardid);
+ xprintf("Bootarea VA: %08llX\n",info.fwi_bootarea_va);
+ xprintf("Bootarea PA: %08llX\n",info.fwi_bootarea_pa);
+ xprintf("Bootarea Size: %08llX\n",info.fwi_bootarea_size);
+
+ xprintf("Memory map:\n");
+ for (;;) {
+ if ((res = cfe_enummem(idx,1,&start,&length,&type) != 0)) break;
+ xprintf("Memory at %016llX length %016llX type %ld\n",
+ start,length,type);
+ idx++;
+ }
+
+ xprintf("Exiting to CFE\n\n");
+
+ cfe_exit(CFE_FLG_WARMSTART,0);
+
+ (*reboot)();
+
+}
diff --git a/cfe/cfe/applets/vapitest.S b/cfe/cfe/applets/vapitest.S
new file mode 100644
index 0000000..a57a563
--- /dev/null
+++ b/cfe/cfe/applets/vapitest.S
@@ -0,0 +1,96 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Verification Test APIs File: vapitest.S
+ *
+ * This module contains special low-level routines for use
+ * by verification programs.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "sbmips.h"
+
+
+#include "vapi.h"
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+ .text
+
+LEAF(_start)
+
+ VAPI_LOG_SETBUF(0x80030000,0x80040000)
+
+
+ VAPI_LOG_CONST(0x100,0xABCDEF)
+ VAPI_LOG_REG(0x101,sp)
+ VAPI_LOG_BUFFER(0x102,testbuf,10)
+ VAPI_PUTS("Hello world.\n")
+ VAPI_LOG_SOCSTATE(0x103,SOC_AGENT_DUART)
+ VAPI_PRINTGPRS();
+ VAPI_LOG_CONST(0x1EE,0xEEEEEEEE)
+ VAPI_LOG_GPRS(0x199)
+ VAPI_SETLEDS('V','A','P','I')
+
+ VAPI_EXIT_CONST(0)
+
+
+END(_start)
+
+testbuf: .dword 0x123456789ABCDEF0
+ .dword 0xAABBCCDD
+ .dword 0xAABBCCDD
+ .dword 0xAABBCCDD
+ .dword 0xAABBCCDD
+ .dword 0xAABBCCDD
+ .dword 0xAABBCCDD
+ .dword 0xAABBCCDD
+ .dword 0xAABBCCDD
+ .dword 0xFEDCBA9876543210
+
+
+
+/* *********************************************************************
+ * End
+ ********************************************************************* */
+
+
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/include/bcm63xx_util.h b/cfe/cfe/arch/mips/board/bcm63xx_ram/include/bcm63xx_util.h
new file mode 100755
index 0000000..273b9c7
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/include/bcm63xx_util.h
@@ -0,0 +1,167 @@
+/***************************************************************************
+ * Broadcom Corp. Confidential
+ * Copyright 2001, 2002 Broadcom Corp. All Rights Reserved.
+ *
+ * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED
+ * SOFTWARE LICENSE AGREEMENT BETWEEN THE USER AND BROADCOM.
+ * YOU HAVE NO RIGHT TO USE OR EXPLOIT THIS MATERIAL EXCEPT
+ * SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
+ *
+ ***************************************************************************
+ * File Name : bcm63xx_util.h
+ *
+ * Created on : 04/18/2002 seanl
+ ***************************************************************************/
+
+#if !defined(_BCM63XX_UTIL_H_)
+#define _BCM63XX_UTIL_H_
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "cfe_devfuncs.h"
+#include "cfe_timer.h"
+#include "cfe_ioctl.h"
+#include "cfe_error.h"
+#include "env_subr.h"
+#include "ui_command.h"
+#include "cfe.h"
+#include "net_ebuf.h"
+#include "net_ether.h"
+#include "net_api.h"
+#include "cfe_fileops.h"
+#include "bsp_config.h"
+#include "cfe_mem.h"
+#include "cfe_loader.h"
+#include "addrspace.h"
+
+#include "dev_bcm63xx_flash.h"
+#include "bcm_hwdefs.h"
+#include "bcmTag.h"
+#include "boardparms.h"
+#include "boardparms_voice.h"
+#include "bcm_map.h"
+
+extern unsigned long cfe_sdramsize;
+
+#define NAND_FLASH_BOOT_IMAGE_NAME "vmlinux.lz"
+
+#define BOARD_IMAGE_DOWNLOAD_ADDRESS \
+ ((cfe_sdramsize > 0x00800000) ? 0x80800000 : 0x80000000)
+#define BOARD_IMAGE_DOWNLOAD_SIZE \
+ ((cfe_sdramsize > 0x00800000) ? cfe_sdramsize - 0x00800000 : 0x00400000)
+
+#define MAX_PROMPT_LEN 50 // assume no one wants to type more than 50 chars
+#define MAX_MAC_STR_LEN 19 // mac address string 18+1 in regular format
+#define PROMPT_DEFINE_LEN 2
+#define MASK_LEN 8 // vxworks like ffffff00
+
+typedef struct
+{
+ char* promptName;
+ char* errorPrompt;
+ char promptDefine[PROMPT_DEFINE_LEN];
+ char parameter[MAX_PROMPT_LEN];
+ int maxValueLength;
+ int (*func)(char *);
+ int enabled;
+} PARAMETER_SETTING, *PPARAMETER_SETTING;
+
+#define IP_PROMPT "Invalid ip address. eg. 192.168.1.200[:ffffff00]"
+#define RUN_FROM_PROMPT "f = jump to flash; h = tftpd from host"
+#define HOST_FN_PROMPT "eg. vmlinux"
+#define FLASH_FN_PROMPT "eg. bcm963xx_fs_kernel"
+#define BOOT_DELAY_PROMPT "range 0-9, 0=forever prompt"
+#define BOOT_PARTITION_PROMPT "1 = latest image, 2 = previous image"
+#define AFE_PROMPT "Invalid AFE ID eg. 0x10608100"
+
+// error input prompts
+#define BOARDID_STR_PROMPT "Invalid board ID"
+#define MAC_CT_PROMPT "Invalid MAC addresses number: 1 - 32"
+#define MAC_ADDR_PROMPT "Invalid MAC address format: eg. 12:34:56:ab:cd:ef or 123456abcdef"
+#define PSI_SIZE_PROMPT "Invalid PSI size: (1-64) Kbytes"
+#define BACKUP_PSI_PROMPT "Enable Backup PSI (0 or 1)"
+#define SYSLOG_SIZE_PROMPT "Invalid System Log size: (0-256) Kbytes"
+#define CPU_TP_PROMPT "Invalid thread number: [0|1]"
+#define GPON_SN_PROMPT "Invalid GPON Serial Number"
+#define GPON_PW_PROMPT "Invalid GPON Password"
+#define WPS_DEVICE_PIN_PROMPT "Invalid WPS Device Pin"
+
+// bootline definition:
+// Space is the deliminator of the parameters. Currently supports following parameters:
+// t=xxx.xxx.xxx.xxx h=xxx.xxx.xxx.xxx g=xxx.xxx.xxx.xxx r=f/h (run from flash or host)
+// f=vmlinux (if r=h) i=bcm963xx_fs_kernel d=3 (default delay, range 0-9, 0=forever prompt)
+
+#define BOOT_IP_LEN 18 // "t=xxx.xxx.xxx.xxx"
+#define BOOT_FILENAME_LEN 50 // "f=vmlinux"
+
+typedef struct
+{
+ char boardIp[BOOT_IP_LEN];
+ char boardMask[BOOT_IP_LEN]; // set for the board only and ignore for the host/gw. fmt :ffffff00
+ char hostIp[BOOT_IP_LEN];
+ char gatewayIp[BOOT_IP_LEN];
+ char runFrom;
+ char hostFileName[BOOT_FILENAME_LEN];
+ char flashFileName[BOOT_FILENAME_LEN];
+ int bootDelay;
+ char bootPartition;
+} BOOT_INFO, *PBOOT_INFO;
+
+#define LED_OFF 0
+#define LED_ON 1
+
+extern void getBootLine(void);
+extern void setDefaultBootline(void);
+extern int printSysInfo(void);
+extern int changeBootLine(void);
+extern int changeAfeId(void);
+extern void dumpHex(unsigned char *start, int len);
+extern BOOT_INFO bootInfo;
+extern void enet_init(void);
+extern int verifyTag(PFILE_TAG pTag, int verbose);
+extern int flashImage(unsigned char *ptr);
+extern int writeWholeImage(unsigned char *ptr, int size);
+
+/* Foxconn add start by Cliff Wang, 03/23/2010 */
+extern int bcm63xx_run(int breakIntoCfe);
+/* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+extern int getPartitionFromTag( PFILE_TAG pTag );
+extern PFILE_TAG getTagFromPartition(int imageNumber);
+extern PFILE_TAG getBootImageTag(void);
+extern int parsexdigit(char str);
+extern int setDefaultBoardParam(void); /* Bob added to set default board parameters, 11/01/2010 */
+extern int setBoardParam(void);
+extern int setGponBoardParam(void);
+extern int setWpsDevicePinBoardParam(void);
+extern int setVoiceBoardParam(void);
+extern int getBoardParam(void);
+extern void displayBoardParam(void);
+extern int processPrompt(PPARAMETER_SETTING promptPtr, int promptCt);
+extern UINT32 getCrc32(unsigned char *pdata, UINT32 size, UINT32 crc);
+extern int yesno(void);
+extern int bcm63xx_cfe_rawload(cfe_loadargs_t *la);
+extern int bcm63xx_cfe_elfload(cfe_loadargs_t *la);
+extern void setGpio (unsigned short led_gpio, unsigned short led_state);
+extern void setLed ( unsigned short led, unsigned short led_state );
+extern void setAllLedsOff(void);
+extern void setPowerOnLedOn(void);
+extern void setBreakIntoCfeLed(void);
+extern void softReset(void);
+extern void validateNandPartTbl(PNVRAM_DATA pNvramData);
+extern void writeNvramData(PNVRAM_DATA pNvramData);
+extern int readNvramData(PNVRAM_DATA pNvramData);
+
+/* Foxconn add start by Jenny Zhao, 07/02/2008*/
+extern int nmrp_led_toggle(void);
+extern int power_led_toggle(int state);
+extern int verify_board_id(char *buf);
+/* Foxconn add end by Jenny Zhao, 07/02/2008*/
+#endif // _BCM63XX_UTIL_H_
+
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/include/bcm_common.h b/cfe/cfe/arch/mips/board/bcm63xx_ram/include/bcm_common.h
new file mode 100755
index 0000000..136267a
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/include/bcm_common.h
@@ -0,0 +1,32 @@
+/*
+<:copyright-broadcom
+
+ Copyright (c) 2004 Broadcom Corporation
+ All Rights Reserved
+ No portions of this material may be reproduced in any form without the
+ written permission of:
+ Broadcom Corporation
+ 16215 Alton Parkway
+ Irvine, California 92619
+ All information contained in this document is Broadcom Corporation
+ company private, proprietary, and trade secret.
+
+:>
+*/
+#ifndef __BCM_COMMON_H
+#define __BCM_COMMON_H
+
+#if defined (_BCM96328_)
+#include "6328_common.h"
+#endif
+#if defined (_BCM96362_)
+#include "6362_common.h"
+#endif
+#if defined (_BCM96368_)
+#include "6368_common.h"
+#endif
+#if defined (_BCM96816_)
+#include "6816_common.h"
+#endif
+
+#endif
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/include/bcm_cpu.h b/cfe/cfe/arch/mips/board/bcm63xx_ram/include/bcm_cpu.h
new file mode 100755
index 0000000..e033936
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/include/bcm_cpu.h
@@ -0,0 +1,32 @@
+/*
+<:copyright-broadcom
+
+ Copyright (c) 2004 Broadcom Corporation
+ All Rights Reserved
+ No portions of this material may be reproduced in any form without the
+ written permission of:
+ Broadcom Corporation
+ 16215 Alton Parkway
+ Irvine, California 92619
+ All information contained in this document is Broadcom Corporation
+ company private, proprietary, and trade secret.
+
+:>
+*/
+#ifndef __BCM_CPU_H
+#define __BCM_CPU_H
+
+#if defined (_BCM96328_)
+#include "6328_cpu.h"
+#endif
+#if defined (_BCM96362_)
+#include "6362_cpu.h"
+#endif
+#if defined (_BCM96368_)
+#include "6368_cpu.h"
+#endif
+#if defined (_BCM96816_)
+#include "6816_cpu.h"
+#endif
+
+#endif
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/include/bcm_map.h b/cfe/cfe/arch/mips/board/bcm63xx_ram/include/bcm_map.h
new file mode 100755
index 0000000..0383431
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/include/bcm_map.h
@@ -0,0 +1,32 @@
+/*
+<:copyright-broadcom
+
+ Copyright (c) 2004 Broadcom Corporation
+ All Rights Reserved
+ No portions of this material may be reproduced in any form without the
+ written permission of:
+ Broadcom Corporation
+ 16215 Alton Parkway
+ Irvine, California 92619
+ All information contained in this document is Broadcom Corporation
+ company private, proprietary, and trade secret.
+
+:>
+*/
+#ifndef __BCM_MAP_H
+#define __BCM_MAP_H
+
+#if defined (_BCM96328_)
+#include "6328_map.h"
+#endif
+#if defined (_BCM96362_)
+#include "6362_map.h"
+#endif
+#if defined (_BCM96368_)
+#include "6368_map.h"
+#endif
+#if defined (_BCM96816_)
+#include "6816_map.h"
+#endif
+
+#endif
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/include/bcmmii.h b/cfe/cfe/arch/mips/board/bcm63xx_ram/include/bcmmii.h
new file mode 100755
index 0000000..a33de5c
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/include/bcmmii.h
@@ -0,0 +1,164 @@
+/*
+<:copyright-broadcom
+
+ Copyright (c) 2004 Broadcom Corporation
+ All Rights Reserved
+ No portions of this material may be reproduced in any form without the
+ written permission of:
+ Broadcom Corporation
+ 16215 Alton Parkway
+ Irvine, California 92619
+ All information contained in this document is Broadcom Corporation
+ company private, proprietary, and trade secret.
+
+:>
+*/
+#ifndef _BCMMII_H_
+#define _BCMMII_H_
+
+#include "dev_bcm63xx_eth.h"
+
+/*---------------------------------------------------------------------*/
+/* Broadcom PHY MII register address */
+/* use when PhyType is BP_ENET_INTERNAL_PHY */
+/*---------------------------------------------------------------------*/
+#define BCM_PHY_ID_M 0x1F
+#define IsExtPhyId(id) ((id & BCM_PHY_ID_M) >= 0x10)
+//#define BCM_WAN_PORT 0x40
+//#define IsWanPort(id) (((id) & BCM_WAN_PORT) && ((id) != 0xFF))
+
+#define MII_ASR 0x19
+#define MII_INTERRUPT 0x1A
+#define MII_RESERVED_1B 0x1B
+#define MII_BRCM_TEST 0x1F
+
+/* MII ASR register. */
+#define MII_ASR_DONE(r) ((r & 0x8000) != 0)
+#define MII_ASR_LINK(r) ((r & 0x0004) != 0)
+#define MII_ASR_FDX(r) (((r & 0x0700) == 0x0700) || ((r & 0x0700) == 0x0500) || ((r & 0x0700) == 0x0200))
+#define MII_ASR_1000(r) (((r & 0x0700) == 0x0700) || ((r & 0x0700) == 0x0600))
+#define MII_ASR_100(r) (((r & 0x0700) == 0x0500) || ((r & 0x0700) == 0x0300))
+#define MII_ASR_10(r) (((r & 0x0700) == 0x0200) || ((r & 0x0700) == 0x0100))
+
+/* Reserved 0x1B register */
+#define MII_RESERVED_1B_ACT_LED 0x0004
+
+/* Broadcom Test register. */
+#define MII_BRCM_TEST_SHADOW2_ENABLE 0x0004
+
+/* MII Interrupt register. */
+#define MII_INTR_ENABLE 0x4000
+
+#define BCM54610_PHYID2 0xBD63
+#define BCM_PHYID_M 0xFFF0
+
+#define MII_REGISTER_1C 0x1c
+ #define MII_1C_WRITE_ENABLE (1 << 15)
+ #define MII_1C_SHADOW_REG_SEL_S 10
+ #define MII_1C_SHADOW_REG_SEL_M 0x1F
+#define MII_1C_SHADOW_CLK_ALIGN_CTRL 0x3
+ #define GTXCLK_DELAY_BYPASS_DISABLE (1 << 9)
+#define MII_1C_SHADOW_LED_CONTROL 0x9
+ #define ACT_LINK_LED_ENABLE (1 << 4)
+#define MII_1C_EXTERNAL_CONTROL_1 0xB
+ #define LOM_LED_MODE (1 << 2)
+
+#define PAGE_CONTROL 0x00
+#define PAGE_SELECT 0xff
+#define PAGE_MANAGEMENT 0x02
+
+/* Control page registers */
+#define REG_MII_PORT_CONTROL 0x08
+#define REG_SWITCH_MODE 0x0b
+#define REG_CONTROL_MII1_PORT_STATE_OVERRIDE 0x0e
+#define REG_POWER_DOWN_MODE 0x0f
+
+/* MII Port Control Register, Page 0x00 Address 0x08 */
+#define REG_MII_PORT_CONTROL_RX_UCST_EN 0x10
+#define REG_MII_PORT_CONTROL_RX_MCST_EN 0x08
+#define REG_MII_PORT_CONTROL_RX_BCST_EN 0x04
+
+/* Switch mode register, Page 0x00 Address 0x0b */
+#define REG_SWITCH_MODE_FRAME_MANAGE_MODE 0x01
+#define REG_SWITCH_MODE_SW_FWDG_EN 0x02
+
+/* MII1 Port State Override Register Page 0x00 Address 0x0e */
+#define REG_CONTROL_MPSO_MII_SW_OVERRIDE 0x80
+#define REG_CONTROL_MPSO_REVERSE_MII 0x10
+#define REG_CONTROL_MPSO_LP_FLOW_CONTROL 0x08
+#define REG_CONTROL_MPSO_SPEED100 0x04
+#define REG_CONTROL_MPSO_SPEED1000 0x08
+#define REG_CONTROL_MPSO_FDX 0x02
+#define REG_CONTROL_MPSO_LINKPASS 0x01
+
+/* Power down mode register Page 0x00 Address 0x0f */
+#define REG_POWER_DOWN_MODE_PORT1_PHY_DISABLE 0x01
+#define REG_POWER_DOWN_MODE_PORT2_PHY_DISABLE 0x02
+#define REG_POWER_DOWN_MODE_PORT3_PHY_DISABLE 0x04
+#define REG_POWER_DOWN_MODE_PORT4_PHY_DISABLE 0x08
+#define REG_POWER_DOWN_MODE_PORT5_PHY_DISABLE 0x10
+
+/* Switch control register page 0x0 */
+#define REG_SWITCH_CONTROL 0x20
+#define REG_SWITCH_CONTROL_MII_DUMP_FWD_EN 0x1
+
+/* Device ID register page 0x02 */
+#define REG_DEVICE_ID 0x30
+#define REG_GLOBAL_CONFIG 0x00
+#define REG_BRCM_HDR_CTRL 0x03
+
+/* Global Configuration Regiater Page 0x02 Address 0x00 */
+#define ENABLE_MII_PORT 0x80
+
+/* Broadcom Header Control Register Page 0x02 Address 0x03*/
+#define REG_BRCM_HDR_ENABLE 0x01
+
+
+
+/*---------------------------------------------------------------------*/
+/* 5325 Switch SPI Interface */
+/* use when configuration type is BP_ENET_CONFIG_SPI_SSB_x */
+/*---------------------------------------------------------------------*/
+#define BCM5325_SPI_CMD_LEN 1
+#define BCM5325_SPI_ADDR_LEN 1
+#define BCM5325_SPI_PREPENDCNT (BCM5325_SPI_CMD_LEN+BCM5325_SPI_ADDR_LEN)
+
+/* 5325 SPI Status Register */
+#define BCM5325_SPI_STS 0xfe
+
+/* 5325 SPI Status Register definition */
+#define BCM5325_SPI_CMD_RACK 0x20
+
+/* 5325 Command Byte definition */
+#define BCM5325_SPI_CMD_READ 0x00 /* bit 0 - Read/Write */
+#define BCM5325_SPI_CMD_WRITE 0x01 /* bit 0 - Read/Write */
+#define BCM5325_SPI_CHIPID_MASK 0x7 /* bit 3:1 - Chip ID */
+#define BCM5325_SPI_CHIPID_SHIFT 1
+#define BCM5325_SPI_CMD_NORMAL 0x60 /* bit 7:4 - Mode */
+#define BCM5325_SPI_CMD_FAST 0x10 /* bit 4 - Mode */
+
+/*---------------------------------------------------------------------*/
+/* 5325 Switch Pseudo PHY MII Register */
+/* use when configuration type is BP_ENET_CONFIG_MDIO_PSEUDO_PHY */
+/*---------------------------------------------------------------------*/
+#define PSEUDO_PHY_ADDR 0x1e /* Pseduo PHY address */
+
+/* Pseudo PHY MII registers */
+#define REG_PSEUDO_PHY_MII_REG16 0x10 /* register 16 - Switch Register Set Access Control Register */
+#define REG_PSEUDO_PHY_MII_REG17 0x11 /* register 17 - Switch Register Set Read/Write Control Register */
+#define REG_PSEUDO_PHY_MII_REG24 0x18 /* register 24 - Switch Accesss Register bit 15:0 */
+#define REG_PSEUDO_PHY_MII_REG25 0x19 /* register 25 - Switch Accesss Register bit 31:16 */
+#define REG_PSEUDO_PHY_MII_REG26 0x20 /* register 26 - Switch Accesss Register bit 47:32 */
+#define REG_PSEUDO_PHY_MII_REG27 0x21 /* register 27 - Switch Accesss Register bit 63:48 */
+
+/*Pseudo PHY MII register 16 Switch Register Set Access Control Register */
+#define REG_PPM_REG16_SWITCH_PAGE_NUMBER_SHIFT 8 /* bit 8..15 - switch page number */
+#define REG_PPM_REG16_MDIO_ENABLE 0x01 /* bit 0 - set MDC/MDIO access enable */
+
+/*Pseudo PHY MII register 17 Switch Register Set Read/Write Control Register */
+#define REG_PPM_REG17_REG_NUMBER_SHIFT 8 /* bit 8..15 - switch register number */
+#define REG_PPM_REG17_OP_DONE 0x00 /* bit 0..1 - no operation */
+#define REG_PPM_REG17_OP_WRITE 0x01 /* bit 0..1 - write operation */
+#define REG_PPM_REG17_OP_READ 0x02 /* bit 0..1 - read operation */
+
+#endif /* _BCMMII_H_ */
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/include/bcmtypes.h b/cfe/cfe/arch/mips/board/bcm63xx_ram/include/bcmtypes.h
new file mode 100755
index 0000000..9359663
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/include/bcmtypes.h
@@ -0,0 +1,144 @@
+//
+// bcmtypes.h - misc useful typedefs
+//
+#ifndef BCMTYPES_H
+#define BCMTYPES_H
+
+// These are also defined in typedefs.h in the application area, so I need to
+// protect against re-definition.
+
+#ifndef _TYPEDEFS_H_
+typedef unsigned char uint8;
+typedef unsigned short uint16;
+typedef unsigned long uint32;
+typedef unsigned long long uint64;
+typedef signed char int8;
+typedef signed short int16;
+typedef signed long int32;
+typedef signed long long int64;
+#if !defined(__cplusplus)
+typedef int bool;
+#endif
+#endif
+
+typedef unsigned char byte;
+typedef unsigned long sem_t;
+
+typedef unsigned long HANDLE,*PULONG,DWORD,*PDWORD;
+typedef signed long LONG,*PLONG;
+
+typedef unsigned int *PUINT;
+typedef signed int INT;
+
+typedef unsigned short *PUSHORT;
+typedef signed short SHORT,*PSHORT,WORD,*PWORD;
+
+typedef unsigned char *PUCHAR;
+typedef signed char *PCHAR;
+
+typedef void *PVOID;
+
+typedef unsigned char BOOLEAN, *PBOOL, *PBOOLEAN;
+
+typedef unsigned char BYTE,*PBYTE;
+
+//#ifndef __GNUC__
+//The following has been defined in Vxworks internally: vxTypesOld.h
+//redefine under vxworks will cause error
+typedef signed int *PINT;
+
+typedef signed char INT8;
+typedef signed short INT16;
+typedef signed long INT32;
+
+typedef unsigned char UINT8;
+typedef unsigned short UINT16;
+typedef unsigned long UINT32;
+
+typedef unsigned char UCHAR;
+typedef unsigned short USHORT;
+typedef unsigned int UINT;
+typedef unsigned long ULONG;
+
+typedef void VOID;
+typedef unsigned char BOOL;
+
+//#endif /* __GNUC__ */
+
+
+// These are also defined in typedefs.h in the application area, so I need to
+// protect against re-definition.
+#ifndef TYPEDEFS_H
+
+#define MAX_INT16 32767
+#define MIN_INT16 -32768
+
+// Useful for true/false return values. This uses the
+// Taligent notation (k for constant).
+typedef enum
+{
+ kFalse = 0,
+ kTrue = 1
+} Bool;
+
+#endif
+
+/* macros to protect against unaligned accesses */
+
+#if 0
+/* first arg is an address, second is a value */
+#define PUT16( a, d ) { \
+ *((byte *)a) = (byte)((d)>>8); \
+ *(((byte *)a)+1) = (byte)(d); \
+}
+
+#define PUT32( a, d ) { \
+ *((byte *)a) = (byte)((d)>>24); \
+ *(((byte *)a)+1) = (byte)((d)>>16); \
+ *(((byte *)a)+2) = (byte)((d)>>8); \
+ *(((byte *)a)+3) = (byte)(d); \
+}
+
+/* first arg is an address, returns a value */
+#define GET16( a ) ( \
+ (*((byte *)a) << 8) | \
+ (*(((byte *)a)+1)) \
+)
+
+#define GET32( a ) ( \
+ (*((byte *)a) << 24) | \
+ (*(((byte *)a)+1) << 16) | \
+ (*(((byte *)a)+2) << 8) | \
+ (*(((byte *)a)+3)) \
+)
+#endif
+
+#ifndef YES
+#define YES 1
+#endif
+
+#ifndef NO
+#define NO 0
+#endif
+
+#ifndef IN
+#define IN
+#endif
+
+#ifndef OUT
+#define OUT
+#endif
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#define READ32(addr) (*(volatile UINT32 *)((ULONG)&addr))
+#define READ16(addr) (*(volatile UINT16 *)((ULONG)&addr))
+#define READ8(addr) (*(volatile UINT8 *)((ULONG)&addr))
+
+#endif
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/include/bsp_config.h b/cfe/cfe/arch/mips/board/bcm63xx_ram/include/bsp_config.h
new file mode 100755
index 0000000..57e51bb
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/include/bsp_config.h
@@ -0,0 +1,94 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * BSP Configuration file File: bsp_config.h
+ *
+ * This module contains global parameters and conditional
+ * compilation settings for building CFE.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#define CFG_CMT 1
+
+#define CFG_INIT_L1 1 /* initialize the L1 cache */
+#define CFG_INIT_L2 0 /* there is no L2 cache */
+
+#define CFG_INIT_DRAM 1 /* initialize DRAM controller */
+#define CFG_DRAM_SIZE xxx /* size of DRAM if you don't initialize */
+ /* NOTE : Size is in kilobytes. */
+
+#define CFG_NETWORK 1 /* define to include network support */
+
+#define CFG_FATFS 0
+#define CFG_UI 1 /* Define to enable user interface */
+
+#define CFG_MULTI_CPUS 0 /* no multi-cpu support */
+
+#define CFG_HEAP_SIZE 1024 /* heap size in kilobytes */
+
+#define CFG_STACK_SIZE 8192 /* stack size (bytes, rounded up to K) */
+
+#define CFG_SERIAL_BAUD_RATE 115200 /* normal console speed */
+
+#define CFG_VENDOR_EXTENSIONS 0
+#define CFG_MINIMAL_SIZE 1
+
+/*
+ * These parameters control the flash driver's sector buffer.
+ * If you write environment variables or make small changes to
+ * flash sectors from user applications, you
+ * need to have the heap big enough to store a temporary sector
+ * for merging in small changes to flash sectors, so you
+ * should set CFG_FLASH_ALLOC_SECTOR_BUFFER in that case.
+ * Otherwise, you can provide an address in unallocated memory
+ * of where to place the sector buffer.
+ */
+
+#define CFG_FLASH_ALLOC_SECTOR_BUFFER 0 /* '1' to allocate sector buffer from the heap */
+#define CFG_FLASH_SECTOR_BUFFER_ADDR (1*1024*1024-128*1024) /* 1MB - 128K */
+#define CFG_FLASH_SECTOR_BUFFER_SIZE (128*1024)
+
+/*
+ * The flash staging buffer is where we store a flash image before we write
+ * it to the flash. It's too big for the heap.
+ */
+
+#define CFG_FLASH_STAGING_BUFFER_ADDR (1*1024*1024)
+#define CFG_FLASH_STAGING_BUFFER_SIZE (1*1024*1024)
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/include/dev_bcm63xx_eth.h b/cfe/cfe/arch/mips/board/bcm63xx_ram/include/dev_bcm63xx_eth.h
new file mode 100755
index 0000000..7432231
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/include/dev_bcm63xx_eth.h
@@ -0,0 +1,127 @@
+/*
+<:copyright-broadcom
+
+ Copyright (c) 2002 Broadcom Corporation
+ All Rights Reserved
+ No portions of this material may be reproduced in any form without the
+ written permission of:
+ Broadcom Corporation
+ 16215 Alton Parkway
+ Irvine, California 92619
+ All information contained in this document is Broadcom Corporation
+ company private, proprietary, and trade secret.
+
+:>
+*/
+#ifndef __BCM63XX_ETH_H
+#define __BCM63XX_ETH_H
+
+#include "bcm_hwdefs.h"
+#include "bcm_map.h"
+#include "boardparms.h"
+
+// from linux if_ether.h
+#define ETH_ALEN 6 /* Octets in one ethernet addr */
+#define ETH_HLEN 14 /* Total octets in header. */
+#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
+#define ETH_DATA_LEN 1500 /* Max. octets in payload */
+#define ETH_CRC_LEN 4 /* CRC length */
+// end if_ether.h
+
+/*---------------------------------------------------------------------*/
+/* specify number of BDs and buffers to use */
+/*---------------------------------------------------------------------*/
+#define NR_TX_BDS 20
+#define NR_RX_BDS 20
+#define ENET_MAX_MTU_SIZE 1522 /* Body(1500) + EH_SIZE(14) + FCS(4) + VLAN(4) */
+#define DMA_MAX_BURST_LENGTH 8 /* in 64 bit words */
+#define ENET_BUF_SIZE ((ENET_MAX_MTU_SIZE + 63) & ~63)
+#define DMA_FC_THRESH_LO 5
+#define DMA_FC_THRESH_HI 10
+#define EMAC_TX_WATERMARK 32
+
+#define MAKE4(x) ((x[3] & 0xFF) | ((x[2] & 0xFF) << 8) | ((x[1] & 0xFF) << 16) | ((x[0] & 0xFF) << 24))
+#define MAKE2(x) ((x[1] & 0xFF) | ((x[0] & 0xFF) << 8))
+
+
+#define ERROR(x) xsprintf x
+#ifndef ASSERT
+#define ASSERT(x) if (x); else ERROR(("assert: "__FILE__" line %d\n", __LINE__));
+#endif
+
+//#define DUMP_TRACE
+
+#if defined(DUMP_TRACE)
+#define TRACE (x) xprintf x
+#else
+#define TRACE(x)
+#endif
+
+typedef struct PM_Addr {
+ uint16 valid; /* 1 indicates the corresponding address is valid */
+ unsigned char dAddr[ETH_ALEN];/* perfect match register's destination address */
+ unsigned int ref; /* reference count */
+} PM_Addr;
+#define MAX_PMADDR 4 /* # of perfect match address */
+
+#define NUM_PORTS 1
+
+typedef struct gpio_reg_addrs_t {
+ volatile uint16 *gpio_direction_reg;/* GPIO direction register */
+ volatile uint16 *gpio_value_reg; /* GPIO value register */
+} gpio_reg_addrs_t;
+
+typedef struct ethsw_info_t {
+ gpio_reg_addrs_t sbh;
+ uint32 ssl, clk, mosi, miso; /* GPIO mapping */
+ int cid, page; /* Current chip ID and page */
+} ethsw_info_t;
+
+typedef struct bcmenet_softc {
+
+ volatile DmaRegs *dmaCtrl;
+
+ /* transmit variables */
+ volatile DmaChannelCfg *txDma; /* location of transmit DMA register set */
+ volatile DmaDesc *txBds; /* Memory location of tx Dma BD ring */
+ volatile DmaDesc *txFirstBdPtr; /* ptr to first allocated Tx BD */
+ volatile DmaDesc *txNextBdPtr; /* ptr to next Tx BD to transmit with */
+ volatile DmaDesc *txLastBdPtr; /* ptr to last allocated Tx BD */
+
+ /* receive variables */
+ volatile DmaChannelCfg *rxDma; /* location of receive DMA register set */
+ volatile DmaDesc *rxBds; /* Memory location of rx bd ring */
+ volatile DmaDesc *rxFirstBdPtr; /* ptr to first allocated rx bd */
+ volatile DmaDesc *rxBdReadPtr; /* ptr to next rx bd to be processed */
+ volatile DmaDesc *rxLastBdPtr; /* ptr to last allocated rx bd */
+
+ uint32_t rxBuffers;
+ uint32_t txBuffers;
+
+ uint16 chipId; /* chip's id */
+ uint16 chipRev; /* step */
+ uint8_t hwaddr[ETH_ALEN];
+ ethsw_info_t ethSwitch; /* external switch */
+ ETHERNET_MAC_INFO EnetInfo;
+ uint32_t dmaPort;
+ uint32_t linkCheck;
+} bcmenet_softc;
+
+
+
+#define IncRxBdPtr(x, s) if (x == ((bcmenet_softc *)s)->rxLastBdPtr) \
+ x = ((bcmenet_softc *)s)->rxBds; \
+ else x++
+#define InctxBdPtr(x, s) if (x == ((bcmenet_softc *)s)->txLastBdPtr) \
+ x = ((bcmenet_softc *)s)->txBds; \
+ else x++
+
+// extern and function prototype
+
+extern int32_t _getticks(void);
+
+#ifdef DUMP_DATA
+static void hexdump( unsigned char * src, int srclen, int rowlen, int rows );
+#endif
+
+#endif // __BCM63XX_ETH_H
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/include/dev_bcm63xx_flash.h b/cfe/cfe/arch/mips/board/bcm63xx_ram/include/dev_bcm63xx_flash.h
new file mode 100755
index 0000000..d8e7f1d
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/include/dev_bcm63xx_flash.h
@@ -0,0 +1,38 @@
+/***************************************************************************
+ * Broadcom Corp. Confidential
+ * Copyright 2001 Broadcom Corp. All Rights Reserved.
+ *
+ * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED
+ * SOFTWARE LICENSE AGREEMENT BETWEEN THE USER AND BROADCOM.
+ * YOU HAVE NO RIGHT TO USE OR EXPLOIT THIS MATERIAL EXCEPT
+ * SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
+ *
+ ***************************************************************************
+ * File Name : dev_bcm63xx_flash.h
+ *
+ * Created on : 04/18/2002 seanl
+ ***************************************************************************/
+
+#if !defined(_DEV_BCM63XX_FLASH_)
+#define _DEV_BCM63XX_FLASH_
+
+#include "bcmtypes.h"
+#include "bcm_hwdefs.h"
+
+// Used for images that do not contain a FILE_TAG record.
+#define FLASH_IMAGE_START_ADDR (FLASH_BASE + FLASH_LENGTH_BOOT_ROM)
+
+// FLASH_ADDR_INFO is now defined in flash_common.h
+#include "flash_common.h"
+
+extern void kerSysFlashInit(void);
+extern void kerSysFlashAddrInfoGet(PFLASH_ADDR_INFO pflash_addr_info);
+extern int kerSysNvRamSet(unsigned char *string,int strLen,int offset);
+extern int kerSysNvRamGet(unsigned char *string,int strLen,int offset);
+extern int kerSysBcmImageSet( int flash_start_addr, unsigned char *string, int size, int fWholeImage);
+extern int kerSysErasePsi(void);
+extern int kerSysEraseNvRam(void);
+extern unsigned long kerSysReadFromFlash(void *toaddr, unsigned long fromaddr, unsigned long len);
+
+#endif /* _DEV_BCM63XX_FLASH_ */
+
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/include/jffs2.h b/cfe/cfe/arch/mips/board/bcm63xx_ram/include/jffs2.h
new file mode 100755
index 0000000..586fb55
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/include/jffs2.h
@@ -0,0 +1,251 @@
+/*
+ * JFFS2 -- Journalling Flash File System, Version 2.
+ *
+ * Copyright (C) 2001-2003 Red Hat, Inc.
+ *
+ * Created by David Woodhouse <dwmw2@infradead.org>
+ *
+ * For licensing information, see the file 'LICENCE' in the
+ * jffs2 directory.
+ *
+ * $Id: jffs2.h,v 1.38 2005/09/26 11:37:23 havasi Exp $
+ *
+ */
+
+#ifndef __LINUX_JFFS2_H__
+#define __LINUX_JFFS2_H__
+
+//include <linux/magic.h>
+
+/* You must include something which defines the C99 uintXX_t types.
+ We don't do it from here because this file is used in too many
+ different environments. */
+
+/* Values we may expect to find in the 'magic' field */
+#define JFFS2_OLD_MAGIC_BITMASK 0x1984
+#define JFFS2_MAGIC_BITMASK 0x1985
+#define KSAMTIB_CIGAM_2SFFJ 0x8519 /* For detecting wrong-endian fs */
+#define JFFS2_EMPTY_BITMASK 0xffff
+#define JFFS2_DIRTY_BITMASK 0x0000
+
+#if defined(CONFIG_MTD_BRCMNAND)
+/* JFFS2 eraseblock header compat/incompat/rocompat features set */
+#define JFFS2_EBH_COMPAT_FSET 0x00
+#define JFFS2_EBH_INCOMPAT_FSET 0x00
+#define JFFS2_EBH_ROCOMPAT_FSET 0x00
+#endif
+
+/* Summary node MAGIC marker */
+#define JFFS2_SUM_MAGIC 0x02851885
+
+/* We only allow a single char for length, and 0xFF is empty flash so
+ we don't want it confused with a real length. Hence max 254.
+*/
+#define JFFS2_MAX_NAME_LEN 254
+
+/* How small can we sensibly write nodes? */
+#define JFFS2_MIN_DATA_LEN 128
+
+#define JFFS2_COMPR_NONE 0x00
+#define JFFS2_COMPR_ZERO 0x01
+#define JFFS2_COMPR_RTIME 0x02
+#define JFFS2_COMPR_RUBINMIPS 0x03
+#define JFFS2_COMPR_COPY 0x04
+#define JFFS2_COMPR_DYNRUBIN 0x05
+#define JFFS2_COMPR_ZLIB 0x06
+/* Compatibility flags. */
+#define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */
+#define JFFS2_NODE_ACCURATE 0x2000
+/* INCOMPAT: Fail to mount the filesystem */
+#define JFFS2_FEATURE_INCOMPAT 0xc000
+/* ROCOMPAT: Mount read-only */
+#define JFFS2_FEATURE_ROCOMPAT 0x8000
+/* RWCOMPAT_COPY: Mount read/write, and copy the node when it's GC'd */
+#define JFFS2_FEATURE_RWCOMPAT_COPY 0x4000
+/* RWCOMPAT_DELETE: Mount read/write, and delete the node when it's GC'd */
+#define JFFS2_FEATURE_RWCOMPAT_DELETE 0x0000
+
+#define JFFS2_NODETYPE_DIRENT (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 1)
+#define JFFS2_NODETYPE_INODE (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 2)
+#define JFFS2_NODETYPE_CLEANMARKER (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
+#define JFFS2_NODETYPE_PADDING (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 4)
+
+#define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6)
+
+#define JFFS2_NODETYPE_XATTR (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 8)
+#define JFFS2_NODETYPE_XREF (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 9)
+
+#if defined(CONFIG_MTD_BRCMNAND)
+#define JFFS2_NODETYPE_ERASEBLOCK_HEADER (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 5)
+#endif
+
+/* XATTR Related */
+#define JFFS2_XPREFIX_USER 1 /* for "user." */
+#define JFFS2_XPREFIX_SECURITY 2 /* for "security." */
+#define JFFS2_XPREFIX_ACL_ACCESS 3 /* for "system.posix_acl_access" */
+#define JFFS2_XPREFIX_ACL_DEFAULT 4 /* for "system.posix_acl_default" */
+#define JFFS2_XPREFIX_TRUSTED 5 /* for "trusted.*" */
+
+#define JFFS2_ACL_VERSION 0x0001
+
+// Maybe later...
+//#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
+//#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4)
+
+
+#define JFFS2_INO_FLAG_PREREAD 1 /* Do read_inode() for this one at
+ mount time, don't wait for it to
+ happen later */
+#define JFFS2_INO_FLAG_USERCOMPR 2 /* User has requested a specific
+ compression type */
+
+
+/* These can go once we've made sure we've caught all uses without
+ byteswapping */
+
+typedef struct {
+ uint32_t v32;
+} __attribute__((packed)) jint32_t;
+
+typedef struct {
+ uint32_t m;
+} __attribute__((packed)) jmode_t;
+
+typedef struct {
+ uint16_t v16;
+} __attribute__((packed)) jint16_t;
+
+struct jffs2_unknown_node
+{
+ /* All start like this */
+ jint16_t magic;
+ jint16_t nodetype;
+ jint32_t totlen; /* So we can skip over nodes we don't grok */
+ jint32_t hdr_crc;
+};
+
+struct jffs2_raw_dirent
+{
+ jint16_t magic;
+ jint16_t nodetype; /* == JFFS2_NODETYPE_DIRENT */
+ jint32_t totlen;
+ jint32_t hdr_crc;
+ jint32_t pino;
+ jint32_t version;
+ jint32_t ino; /* == zero for unlink */
+ jint32_t mctime;
+ uint8_t nsize;
+ uint8_t type;
+ uint8_t unused[2];
+ jint32_t node_crc;
+ jint32_t name_crc;
+ uint8_t name[0];
+};
+
+/* The JFFS2 raw inode structure: Used for storage on physical media. */
+/* The uid, gid, atime, mtime and ctime members could be longer, but
+ are left like this for space efficiency. If and when people decide
+ they really need them extended, it's simple enough to add support for
+ a new type of raw node.
+*/
+struct jffs2_raw_inode
+{
+ jint16_t magic; /* A constant magic number. */
+ jint16_t nodetype; /* == JFFS2_NODETYPE_INODE */
+ jint32_t totlen; /* Total length of this node (inc data, etc.) */
+ jint32_t hdr_crc;
+ jint32_t ino; /* Inode number. */
+ jint32_t version; /* Version number. */
+ jmode_t mode; /* The file's type or mode. */
+ jint16_t uid; /* The file's owner. */
+ jint16_t gid; /* The file's group. */
+ jint32_t isize; /* Total resultant size of this inode (used for truncations) */
+ jint32_t atime; /* Last access time. */
+ jint32_t mtime; /* Last modification time. */
+ jint32_t ctime; /* Change time. */
+ jint32_t offset; /* Where to begin to write. */
+ jint32_t csize; /* (Compressed) data size */
+ jint32_t dsize; /* Size of the node's data. (after decompression) */
+ uint8_t compr; /* Compression algorithm used */
+ uint8_t usercompr; /* Compression algorithm requested by the user */
+ jint16_t flags; /* See JFFS2_INO_FLAG_* */
+ jint32_t data_crc; /* CRC for the (compressed) data. */
+ jint32_t node_crc; /* CRC for the raw inode (excluding data) */
+ uint8_t data[0];
+};
+
+struct jffs2_raw_xattr {
+ jint16_t magic;
+ jint16_t nodetype; /* = JFFS2_NODETYPE_XATTR */
+ jint32_t totlen;
+ jint32_t hdr_crc;
+ jint32_t xid; /* XATTR identifier number */
+ jint32_t version;
+ uint8_t xprefix;
+ uint8_t name_len;
+ jint16_t value_len;
+ jint32_t data_crc;
+ jint32_t node_crc;
+ uint8_t data[0];
+} __attribute__((packed));
+
+struct jffs2_raw_xref
+{
+ jint16_t magic;
+ jint16_t nodetype; /* = JFFS2_NODETYPE_XREF */
+ jint32_t totlen;
+ jint32_t hdr_crc;
+ jint32_t ino; /* inode number */
+ jint32_t xid; /* XATTR identifier number */
+ jint32_t xseqno; /* xref sequencial number */
+ jint32_t node_crc;
+} __attribute__((packed));
+
+struct jffs2_raw_summary
+{
+ jint16_t magic;
+ jint16_t nodetype; /* = JFFS2_NODETYPE_SUMMARY */
+ jint32_t totlen;
+ jint32_t hdr_crc;
+ jint32_t sum_num; /* number of sum entries*/
+ jint32_t cln_mkr; /* clean marker size, 0 = no cleanmarker */
+ jint32_t padded; /* sum of the size of padding nodes */
+ jint32_t sum_crc; /* summary information crc */
+ jint32_t node_crc; /* node crc */
+ jint32_t sum[0]; /* inode summary info */
+};
+
+#if defined(CONFIG_MTD_BRCMNAND)
+struct jffs2_raw_ebh
+{
+ jint16_t magic;
+ jint16_t nodetype; /* == JFFS2_NODETYPE_ERASEBLOCK_HEADER */
+ jint32_t totlen;
+ jint32_t hdr_crc;
+ jint32_t node_crc;
+ uint8_t reserved; /* reserved for future use and alignment */
+ uint8_t compat_fset;
+ uint8_t incompat_fset;
+ uint8_t rocompat_fset;
+ jint32_t erase_count; /* the erase count of this erase block */
+ jint32_t data[0];
+} __attribute__((packed));
+#endif
+
+union jffs2_node_union
+{
+ struct jffs2_raw_inode i;
+ struct jffs2_raw_dirent d;
+ struct jffs2_raw_xattr x;
+ struct jffs2_raw_xref r;
+ struct jffs2_raw_summary s;
+ struct jffs2_unknown_node u;
+};
+
+/* Data payload for device nodes. */
+union jffs2_device_node {
+ jint16_t old;
+ jint32_t new;
+};
+
+#endif /* __LINUX_JFFS2_H__ */
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/src/Makefile b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/Makefile
new file mode 100755
index 0000000..7320c9d
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/Makefile
@@ -0,0 +1,55 @@
+BSPOBJS += \
+ dev_bcm63xx_eth.o \
+ dev_bcm63xx_uart.o \
+ dev_bcm63xx_flash.o \
+ flash_api.o \
+ flash_common.o \
+ bcm63xx_ram_boot.o \
+ bcm63xx_devs.o \
+ bcm63xx_board.o \
+ bcm63xx_cmd.o \
+ bcm63xx_util.o \
+ bcm63xx_ldr_raw.o \
+ bcm63xx_ldr_elf.o \
+ bcm63xx_main.o \
+ bcm63xx_env_subr.o \
+ bcm63xx_net_icmp.o \
+ bcm63xx_httpd.o \
+ bcmSpiRes.o \
+ bcmLegSpi.o \
+ boardparms.o \
+ boardparms_voice.o
+
+ifneq ($(strip $(BRCM_CHIP)),6368)
+BSPOBJS += \
+ bcmHsSpi.o
+endif
+
+BSPOBJS += \
+ robosw_reg.o
+
+ifeq ($(strip ${INC_CFI_FLASH_DRIVER}),1)
+BSPOBJS += \
+ cfiflash.o
+endif
+
+ifeq ($(strip ${INC_SPI_FLASH_DRIVER}),1)
+BSPOBJS += \
+ spiflash.o
+endif
+
+ifeq ($(strip ${INC_SPI_PROG_NAND}),1)
+BSPOBJS += \
+ nandflash.o
+endif
+
+ifeq ($(strip ${INC_NAND_FLASH_DRIVER}),1)
+BSPOBJS += \
+ nandflash.o
+endif
+
+ifeq ($(strip ${CFG_WEB_SERVER}),1)
+BSPOBJS += \
+ ul.o \
+ ulinfo.o
+endif
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_board.c b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_board.c
new file mode 100755
index 0000000..5baa66c
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_board.c
@@ -0,0 +1,830 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * bcm63xx_board.c utility functions for bcm63xx board
+ *
+ * Created on : 09/25/2002 seanl
+ *
+ *********************************************************************
+
+<:copyright-broadcom
+
+ Copyright (c) 2002 Broadcom Corporation
+ All Rights Reserved
+ No portions of this material may be reproduced in any form without the
+ written permission of:
+ Broadcom Corporation
+ 16215 Alton Parkway
+ Irvine, California 92619
+ All information contained in this document is Broadcom Corporation
+ company private, proprietary, and trade secret.
+
+:>
+*/
+
+#include "bcm63xx_util.h"
+#include "foxconnCfg.h"
+
+#define MAX_BOARD_ID_NAMES 16
+#define MAX_VOICE_BOARD_ID_NAMES 20
+
+static char g_boardIdNames[BP_BOARD_ID_LEN * MAX_BOARD_ID_NAMES];
+static int g_numBoardIdNames = 0;
+
+static char g_voiceBoardIdNames[BP_BOARD_ID_LEN * MAX_VOICE_BOARD_ID_NAMES];
+static int g_numVoiceBoardIdNames = 0;
+
+static int parsehwaddr(char *, uint8_t *);
+static int parseBoardIdStr(char *);
+static int parseVoiceBoardIdStr(char *);
+static int parsePsiSize(char *);
+static int parseBackupPsi(char *tpStr);
+static int parseSyslogSize(char *tpStr);
+static int parseMainTp(char *);
+static int parseMacAddrCount(char *);
+static int parseMacAddr(char *);
+static int charIsHex(char ch);
+static int parseGponSN(char *snStr);
+static int parseGponPW(char *pwStr);
+static int macNumToStr(unsigned char *, char *);
+static void getGponBoardParam(void);
+static int gponParamsInitialized(NVRAM_DATA *pNvramData);
+
+static int parseWpsDevicePin(char *pinStr);
+static void getWpsDevicePinBoardParam(void);
+#define PARAM_IDX_BOARD_NAME 0
+#define PARAM_IDX_NUM_MAC_ADDR 1
+#define PARAM_IDX_BASE_MAC_ADDR 2
+#define PARAM_IDX_PSI_SIZE 3
+#define PARAM_IDX_ENABLE_BACKUP_PSI 4
+#define PARAM_IDX_SYSLOG_SIZE 5
+#define PARAM_IDX_MAIN_THREAD_NUM 6
+
+#define PARAM_IDX_GPON_SN 0
+#define PARAM_IDX_GPON_PW 1
+
+#define PARAM_IDX_WPS_DEVICE_PIN 0
+
+#define PARAM_IDX_VOICE_BOARD_NAME 0
+
+static PARAMETER_SETTING gBoardParam[] =
+{
+ // prompt name Error Prompt Define Param Validation function
+ {"Board Id (0-# :", BOARDID_STR_PROMPT, "", "", 2,
+ parseBoardIdStr, TRUE},
+ {"Number of MAC Addresses (1-32) :", MAC_CT_PROMPT, "", "", 2,
+ parseMacAddrCount, TRUE},
+ {"Base MAC Address :", MAC_ADDR_PROMPT, "", "", 17,
+ parseMacAddr, TRUE},
+ {"PSI Size (1-64) KBytes :", PSI_SIZE_PROMPT, "", "", 2,
+ parsePsiSize, TRUE},
+ {"Enable Backup PSI [0|1] :", BACKUP_PSI_PROMPT, "", "", 1,
+ parseBackupPsi, TRUE},
+ {"System Log Size (0-256) KBytes :", SYSLOG_SIZE_PROMPT, "", "", 3,
+ parseSyslogSize, TRUE},
+ {"Main Thread Number [0|1] :", CPU_TP_PROMPT, "", "", 1,
+ parseMainTp, TRUE},
+ {NULL}
+};
+
+static int gNumBoardParams = (sizeof(gBoardParam) / sizeof(PARAMETER_SETTING))-1;
+
+static PARAMETER_SETTING gGponBoardParam[] =
+{
+ // prompt name Error Prompt Define Param Validation function
+ {"GPON Serial Number :", GPON_SN_PROMPT, "", "", 12,
+ parseGponSN, TRUE},
+ {"GPON Password :", GPON_PW_PROMPT, "", "", 10,
+ parseGponPW, TRUE},
+ {NULL}
+};
+
+static int gNumGponBoardParams = (sizeof(gGponBoardParam) / sizeof(PARAMETER_SETTING))-1;
+static int gGponParamsInitialized = 0;
+
+
+static PARAMETER_SETTING gWpsDevicePinBoardParam[] =
+{
+ // prompt name Error Prompt Define Param Validation function
+ {"Device Pin :", WPS_DEVICE_PIN_PROMPT, "", "", 8,
+ parseWpsDevicePin, TRUE},
+ {NULL}
+};
+
+static int gNumWpsDevicePinBoardParams = (sizeof(gWpsDevicePinBoardParam) / sizeof(PARAMETER_SETTING))-1;
+static int gWpsDevicePinInitialized = 0;
+
+static PARAMETER_SETTING gVoiceBoardParam[] =
+{
+ // prompt name Error Prompt Define Param Validation function
+ {"Voice Board Configuration (0-# :", BOARDID_STR_PROMPT, "", "", 2,
+ parseVoiceBoardIdStr, FALSE},
+ {NULL}
+};
+
+static int gNumVoiceBoardParams = (sizeof(gVoiceBoardParam) / sizeof(PARAMETER_SETTING))-1;
+static int gVoiceParamsInitialized = 0;
+
+
+static int parsehwaddr(char *str,uint8_t *hwaddr)
+{
+ int digit1,digit2;
+ int idx = 6;
+
+ if (strlen(str) == (MAX_MAC_STR_LEN - 7)) { // no ':' mac input format ie. 021800100801
+ while (*str && (idx > 0)) {
+ digit1 = parsexdigit(*str);
+ if (digit1 < 0)
+ return -1;
+ str++;
+ if (!*str)
+ return -1;
+ digit2 = parsexdigit(*str);
+ if (digit2 < 0)
+ return -1;
+ *hwaddr++ = (digit1 << 4) | digit2;
+ idx--;
+ str++;
+ }
+ return 0;
+ }
+
+ if (strlen(str) != MAX_MAC_STR_LEN-2)
+ return -1;
+ if (*(str+2) != ':' || *(str+5) != ':' || *(str+8) != ':' || *(str+11) != ':' || *(str+14) != ':')
+ return -1;
+
+ while (*str && (idx > 0)) {
+ digit1 = parsexdigit(*str);
+ if (digit1 < 0)
+ return -1;
+ str++;
+ if (!*str)
+ return -1;
+
+ if (*str == ':') {
+ digit2 = digit1;
+ digit1 = 0;
+ }
+ else {
+ digit2 = parsexdigit(*str);
+ if (digit2 < 0)
+ return -1;
+ str++;
+ }
+
+ *hwaddr++ = (digit1 << 4) | digit2;
+ idx--;
+
+ if (*str == ':')
+ str++;
+ }
+ return 0;
+}
+
+
+static int parseMacAddr(char * macStr)
+{
+ unsigned char tmpBuf[MAX_PROMPT_LEN];
+
+ return (parsehwaddr(macStr, tmpBuf));
+}
+
+
+static int parseBoardIdStr(char *boardIdStr)
+{
+ int ret = 1;
+ int boardId;
+
+ if (strlen (boardIdStr) != 0) {
+ boardId = atoi(boardIdStr);
+ if (boardId >= 0 && boardId < g_numBoardIdNames)
+ ret = 0;
+ }
+
+ return ret;
+}
+
+
+static int parseVoiceBoardIdStr(char *boardIdStr)
+{
+ int ret = 1;
+ int boardId;
+
+ if (strlen (boardIdStr) != 0) {
+ boardId = atoi(boardIdStr);
+ if (boardId >= 0 && boardId < g_numVoiceBoardIdNames)
+ ret = 0;
+ }
+
+ return ret;
+}
+
+
+static int parseMacAddrCount(char *ctStr)
+{
+ int count = atoi(ctStr);
+
+ if (count >= 1 && count <= NVRAM_MAC_COUNT_MAX)
+ return 0;
+ else
+ return 1;
+}
+
+static int parsePsiSize(char *tpStr)
+{
+ int psiSize = atoi(tpStr);
+
+ if (psiSize >= 1 && psiSize <= NVRAM_MAX_PSI_SIZE)
+ return 0;
+ else
+ return 1;
+}
+
+static int parseBackupPsi(char *tpStr)
+{
+ int enable = atoi(tpStr);
+
+ if (enable == 0 || enable == 1)
+ return 0;
+ else
+ return 1;
+}
+
+static int parseSyslogSize(char *tpStr)
+{
+ int syslogSize = atoi(tpStr);
+
+ if (syslogSize >= 0 && syslogSize <= NVRAM_MAX_SYSLOG_SIZE)
+ return 0;
+ else
+ return 1;
+}
+
+
+static int parseMainTp(char *tpStr)
+{
+ int tpNum = atoi(tpStr);
+
+ if (tpNum == 0 || tpNum == 1)
+ return 0;
+ else
+ return 1;
+}
+
+static int charIsHex(char ch)
+{
+ if (((ch >= '0') && (ch <= '9')) ||
+ ((ch >= 'a') && (ch <= 'f')) ||
+ ((ch >= 'A') && (ch <= 'F')))
+ return 1;
+ else
+ return 0;
+}
+
+static int parseGponSN(char *snStr)
+{
+ int i;
+ int ret = 0;
+
+ if(strlen(snStr) == NVRAM_GPON_SERIAL_NUMBER_LEN-1) {
+ for(i=4; i<NVRAM_GPON_SERIAL_NUMBER_LEN-1; ++i) {
+ if(!charIsHex(snStr[i])) {
+ ret = 1;
+ break;
+ }
+ }
+ }
+ else {
+ ret = 1;
+ }
+
+ return ret;
+}
+
+static int parseGponPW(char *pwStr)
+{
+ if(strlen(pwStr) == NVRAM_GPON_PASSWORD_LEN-1)
+ return 0;
+ else
+ return 1;
+}
+
+static int parseWpsDevicePin(char *pinStr)
+{
+ unsigned char accum=0;
+ unsigned char factor[NVRAM_WPS_DEVICE_PIN_LEN]={3,1,3,1,3,1,3,1};
+ int i =0;
+
+ /*Check Length*/
+ if(strlen(pinStr) != NVRAM_WPS_DEVICE_PIN_LEN)
+ return 1;
+
+ /*valid checksum*/
+ for ( i=0; i< NVRAM_WPS_DEVICE_PIN_LEN; i++ )
+ accum += (pinStr[i]-'0')*factor[i];
+
+ if ( (accum%10) ==0 )
+ return 0;
+
+ return 1;
+}
+
+int macNumToStr(unsigned char *macAddr, char *str)
+{
+ if (macAddr == NULL || str == NULL)
+ return 0;
+
+ sprintf(str, "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x",
+ macAddr[0], macAddr[1], macAddr[2],
+ macAddr[3], macAddr[4], macAddr[5]);
+ return 1;
+}
+
+static int gponParamsInitialized(NVRAM_DATA *pNvramData)
+{
+ int i;
+ int erased = 1;
+
+ for(i=0; i<NVRAM_GPON_SERIAL_NUMBER_LEN-1; ++i) {
+ if((pNvramData->gponSerialNumber[i] != (char)0xFF) &&
+ (pNvramData->gponSerialNumber[i] != '\0')) {
+ erased = 0;
+ break;
+ }
+ }
+
+ if(erased) {
+ for(i=0; i<NVRAM_GPON_PASSWORD_LEN-1; ++i) {
+ if((pNvramData->gponPassword[i] != (char)0xFF) &&
+ (pNvramData->gponPassword[i] != '\0')) {
+ erased = 0;
+ break;
+ }
+ }
+ }
+
+ return (erased) ? 0 : 1;
+}
+
+static void getGponBoardParam(void)
+{
+ NVRAM_DATA nvramData;
+ int erased;
+ int i;
+ int writeNvram = 0;
+
+ readNvramData(&nvramData);
+
+ erased = 1;
+ for(i=0; i<NVRAM_GPON_SERIAL_NUMBER_LEN-1; ++i) {
+ if((nvramData.gponSerialNumber[i] != (char)0xFF) &&
+ (nvramData.gponSerialNumber[i] != '\0')) {
+ erased = 0;
+ break;
+ }
+ }
+
+ if(erased) {
+ strcpy(nvramData.gponSerialNumber, DEFAULT_GPON_SN);
+ writeNvram = 1;
+ }
+
+ erased = 1;
+ for(i=0; i<NVRAM_GPON_PASSWORD_LEN-1; ++i) {
+ if((nvramData.gponPassword[i] != (char)0xFF) &&
+ (nvramData.gponPassword[i] != '\0')) {
+ erased = 0;
+ break;
+ }
+ }
+
+ if(erased) {
+ strcpy(nvramData.gponPassword, DEFAULT_GPON_PW);
+ writeNvram = 1;
+ }
+
+ if(writeNvram) {
+ writeNvramData(&nvramData);
+ }
+
+ strcpy(gGponBoardParam[PARAM_IDX_GPON_SN].parameter, nvramData.gponSerialNumber);
+ strcpy(gGponBoardParam[PARAM_IDX_GPON_PW].parameter, nvramData.gponPassword);
+}
+
+int setGponBoardParam(void)
+{
+ NVRAM_DATA nvramData;
+ int ret = 0;
+
+ getGponBoardParam();
+
+ readNvramData(&nvramData);
+
+ if (processPrompt(gGponBoardParam, gNumGponBoardParams)) {
+
+ // At least one field was changed
+ strcpy(nvramData.gponSerialNumber, gGponBoardParam[PARAM_IDX_GPON_SN].parameter);
+ strcpy(nvramData.gponPassword, gGponBoardParam[PARAM_IDX_GPON_PW].parameter);
+
+ // save the buf to nvram
+ writeNvramData(&nvramData);
+ ret = 1;
+ }
+
+ return ret;
+}
+
+
+
+static int gWpsDevicePinParamsInitialized(NVRAM_DATA *pNvramData)
+{
+ int i;
+
+ for(i=0; i<NVRAM_WPS_DEVICE_PIN_LEN; ++i) {
+ if(( (unsigned char)(pNvramData->wpsDevicePin[i]) > 0x39) ||
+ ( (unsigned char)(pNvramData->wpsDevicePin[i]) < 0x30) ) {
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+static void getWpsDevicePinBoardParam(void)
+{
+ NVRAM_DATA nvramData;
+
+ readNvramData(&nvramData);
+
+ if ( gWpsDevicePinParamsInitialized( &nvramData) ) {
+ memcpy(gWpsDevicePinBoardParam[PARAM_IDX_WPS_DEVICE_PIN].parameter,
+ nvramData.wpsDevicePin, NVRAM_WPS_DEVICE_PIN_LEN);
+ (gWpsDevicePinBoardParam[PARAM_IDX_WPS_DEVICE_PIN].parameter)[NVRAM_WPS_DEVICE_PIN_LEN] =
+ '\0';
+ }
+ else {
+ /*Set Default Device Pin*/
+ memcpy(nvramData.wpsDevicePin, DEFAULT_WPS_DEVICE_PIN, NVRAM_WPS_DEVICE_PIN_LEN);
+ writeNvramData(&nvramData);
+
+ memcpy(gWpsDevicePinBoardParam[PARAM_IDX_WPS_DEVICE_PIN].parameter,
+ nvramData.wpsDevicePin,
+ NVRAM_WPS_DEVICE_PIN_LEN);
+ (gWpsDevicePinBoardParam[PARAM_IDX_WPS_DEVICE_PIN].parameter)[NVRAM_WPS_DEVICE_PIN_LEN] =
+ '\0';
+ }
+
+}
+
+int setWpsDevicePinBoardParam(void)
+{
+ NVRAM_DATA nvramData;
+ int ret = 0;
+
+ getWpsDevicePinBoardParam();
+
+ readNvramData(&nvramData);
+
+ if (processPrompt(gWpsDevicePinBoardParam, gNumWpsDevicePinBoardParams)) {
+ memcpy(nvramData.wpsDevicePin,
+ gWpsDevicePinBoardParam[PARAM_IDX_WPS_DEVICE_PIN].parameter,
+ NVRAM_WPS_DEVICE_PIN_LEN);
+ // save the buf to nvram
+ writeNvramData(&nvramData);
+ ret = 1;
+ }
+
+ return ret;
+}
+
+
+static int voiceParamsInitialized(NVRAM_DATA *pNvramData)
+{
+ int rc = 0;
+ NVRAM_DATA nvramData;
+ readNvramData(&nvramData);
+
+ if ( BpSetBoardId(nvramData.szBoardId) == BP_SUCCESS ) {
+ if ( BpGetVoipDspConfig( 0 ) == NULL ) {
+ gVoiceBoardParam[PARAM_IDX_VOICE_BOARD_NAME].enabled = FALSE;
+ }
+ else {
+ gVoiceBoardParam[PARAM_IDX_VOICE_BOARD_NAME].enabled = TRUE;
+ rc = 1;
+ }
+ }
+
+ return rc;
+}
+
+static void getVoiceBoardParam(void)
+{
+ NVRAM_DATA nvramData;
+ char *ptr;
+ char tmp[10];
+
+ if (g_numVoiceBoardIdNames == 0)
+ g_numVoiceBoardIdNames = BpGetVoiceBoardIds(g_voiceBoardIdNames, MAX_VOICE_BOARD_ID_NAMES);
+
+ ptr = strchr(gVoiceBoardParam[PARAM_IDX_VOICE_BOARD_NAME].promptName, '#');
+ if (ptr != NULL) {
+ sprintf(tmp, "%d)", g_numVoiceBoardIdNames - 1);
+ memcpy(ptr, tmp, strlen(tmp));
+ }
+
+ readNvramData(&nvramData);
+
+ memcpy(gVoiceBoardParam[PARAM_IDX_VOICE_BOARD_NAME].parameter, nvramData.szVoiceBoardId, NVRAM_BOARD_ID_STRING_LEN);
+ gVoiceBoardParam[PARAM_IDX_VOICE_BOARD_NAME].parameter[NVRAM_BOARD_ID_STRING_LEN] = '\0';
+}
+
+int setVoiceBoardParam(void)
+{
+ NVRAM_DATA nvramData;
+ char voiceBoardIdPrompt[1000];
+ int i;
+ char tmp[3];
+ char *voiceBoardIdPromptPtr, *savedVoiceBoardIdPromptPtr;
+ int ret = 0;
+
+ getVoiceBoardParam();
+
+ readNvramData(&nvramData);
+
+ // Create prompt string with voice board ID name selection
+ voiceBoardIdPromptPtr = voiceBoardIdPrompt;
+ for (i = 0; i < g_numVoiceBoardIdNames; i++) {
+ sprintf (tmp, "%d", i);
+ sprintf (voiceBoardIdPromptPtr, "%-17s-- %2s\n", &g_voiceBoardIdNames[i * BP_BOARD_ID_LEN], tmp);
+ voiceBoardIdPromptPtr += strlen(voiceBoardIdPromptPtr);
+ }
+ strcpy (voiceBoardIdPromptPtr, gVoiceBoardParam[PARAM_IDX_VOICE_BOARD_NAME].promptName);
+
+ // Save existing prompt string
+ savedVoiceBoardIdPromptPtr = gVoiceBoardParam[PARAM_IDX_VOICE_BOARD_NAME].promptName;
+ // Set newly created prompt string
+ gVoiceBoardParam[PARAM_IDX_VOICE_BOARD_NAME].promptName = voiceBoardIdPrompt;
+
+ // Convert board ID string to numeric value
+ for (i = 0; i < g_numVoiceBoardIdNames; i++) {
+ if (!strcmp(gVoiceBoardParam[PARAM_IDX_VOICE_BOARD_NAME].parameter, &g_voiceBoardIdNames[i * BP_BOARD_ID_LEN])) {
+ sprintf(gVoiceBoardParam[PARAM_IDX_VOICE_BOARD_NAME].parameter, "%d", i);
+ }
+ }
+
+ if (processPrompt(gVoiceBoardParam, gNumVoiceBoardParams)) {
+ // At least one field was changed
+ i = atoi(gVoiceBoardParam[PARAM_IDX_VOICE_BOARD_NAME].parameter);
+ strcpy(nvramData.szVoiceBoardId, &g_voiceBoardIdNames[i * BP_BOARD_ID_LEN]);
+
+ // save the buf to nvram
+ writeNvramData(&nvramData);
+ ret = 1;
+ }
+
+ // Convert numeric value of voice board ID to string
+ gVoiceBoardParam[PARAM_IDX_VOICE_BOARD_NAME].promptName = savedVoiceBoardIdPromptPtr;
+ i = atoi(gVoiceBoardParam[PARAM_IDX_VOICE_BOARD_NAME].parameter);
+ strcpy(gVoiceBoardParam[PARAM_IDX_VOICE_BOARD_NAME].parameter, &g_voiceBoardIdNames[i * BP_BOARD_ID_LEN]);
+
+ return ret;
+}
+
+
+//
+// getBoardParam: convert the board param data and put them in the gBoardParam struct
+//
+int getBoardParam(void)
+{
+ NVRAM_DATA nvramData;
+ char *ptr;
+ char tmp[10];
+ int ret = 0;
+
+ if (g_numBoardIdNames == 0)
+ g_numBoardIdNames = BpGetBoardIds(g_boardIdNames, MAX_BOARD_ID_NAMES);
+
+ ptr = strchr(gBoardParam[PARAM_IDX_BOARD_NAME].promptName, '#');
+ if (ptr != NULL) {
+ sprintf(tmp, "%d)", g_numBoardIdNames - 1);
+ memcpy(ptr, tmp, strlen(tmp));
+ }
+
+ readNvramData(&nvramData);
+
+ if(!gGponParamsInitialized) {
+ gGponParamsInitialized = gponParamsInitialized(&nvramData);
+ }
+
+ /*WPS Device Pin Initialized?*/
+ if(!gWpsDevicePinInitialized) {
+ gWpsDevicePinInitialized = gWpsDevicePinParamsInitialized(&nvramData);
+ }
+
+ if (nvramData.ulVersion == -1) {
+ // Set default values
+ nvramData.ulVersion = NVRAM_VERSION_NUMBER;
+ nvramData.szBoardId[0] = '\0';
+ nvramData.ulNumMacAddrs = DEFAULT_MAC_NUM;
+ parsehwaddr(DEFAULT_BOARD_MAC, nvramData.ucaBaseMacAddr);
+ nvramData.ulMainTpNum = DEFAULT_TP_NUM;
+ nvramData.szVoiceBoardId[0] = '\0';
+ nvramData.ulPsiSize = DEFAULT_PSI_SIZE;
+ nvramData.backupPsi = 0;
+ nvramData.ulSyslogSize = 0;
+ writeNvramData(&nvramData);
+ }
+ else if (nvramData.ulVersion != NVRAM_VERSION_NUMBER) {
+ // When upgrading from older bootloader initialize new fields
+ printf("*** Upgrading NVRAM (version %d to version %d) ***\n\n",
+ nvramData.ulVersion, NVRAM_VERSION_NUMBER);
+ nvramData.ulVersion = NVRAM_VERSION_NUMBER;
+ if (nvramData.ulMainTpNum == -1)
+ nvramData.ulMainTpNum = DEFAULT_TP_NUM;
+ if ((nvramData.ulPsiSize == -1) || (nvramData.ulPsiSize == 0))
+ nvramData.ulPsiSize = DEFAULT_PSI_SIZE;
+ nvramData.szVoiceBoardId[0] = '\0';
+ if (nvramData.backupPsi == -1)
+ nvramData.backupPsi = 0;
+ if (nvramData.ulSyslogSize == -1)
+ nvramData.ulSyslogSize = 0;
+ writeNvramData(&nvramData);
+ ret = 1;
+ }
+
+ gVoiceParamsInitialized = voiceParamsInitialized(&nvramData);
+
+ // When backupPsi and syslog were introduced, the NVRAM version number
+ // was not bumped up. So convert -1 (unitialized) to 0 so it looks better.
+ if (nvramData.backupPsi == -1)
+ nvramData.backupPsi = 0;
+ if (nvramData.ulSyslogSize == -1)
+ nvramData.ulSyslogSize = 0;
+
+ strcpy(gBoardParam[PARAM_IDX_BOARD_NAME].parameter, nvramData.szBoardId);
+ sprintf(gBoardParam[PARAM_IDX_NUM_MAC_ADDR].parameter, "%d", nvramData.ulNumMacAddrs);
+ macNumToStr(nvramData.ucaBaseMacAddr, gBoardParam[PARAM_IDX_BASE_MAC_ADDR].parameter);
+ sprintf(gBoardParam[PARAM_IDX_PSI_SIZE].parameter, "%d", nvramData.ulPsiSize);
+ sprintf(gBoardParam[PARAM_IDX_ENABLE_BACKUP_PSI].parameter, "%d", nvramData.backupPsi);
+ sprintf(gBoardParam[PARAM_IDX_SYSLOG_SIZE].parameter, "%d", nvramData.ulSyslogSize);
+ sprintf(gBoardParam[PARAM_IDX_MAIN_THREAD_NUM].parameter, "%d", nvramData.ulMainTpNum);
+
+ return ret;
+}
+
+/* Bob added start to set default board parameters, 11/01/2010 */
+int setDefaultBoardParam(void)
+{
+ NVRAM_DATA nvramData;
+ int ret = 0;
+
+ if (getBoardParam()) {
+ /* New NVRAM version */
+ return ret;
+ }
+
+ readNvramData(&nvramData);
+
+ {
+ // At least one field was changed
+ nvramData.ulVersion = NVRAM_VERSION_NUMBER;
+ strcpy(nvramData.szBoardId, "963281TAN");
+ strcpy(nvramData.szFirmwareUpgradeBoardId, FOXCONN_BOARD_ID);
+ nvramData.ulNumMacAddrs = 10;
+ parsehwaddr("00:00:00:00:00:01", nvramData.ucaBaseMacAddr);
+ nvramData.ulPsiSize = 24;
+ nvramData.backupPsi = 0;
+ nvramData.ulSyslogSize = 0;
+ nvramData.ulMainTpNum = 0;
+
+ // save the buf to nvram
+ writeNvramData(&nvramData);
+ ret = 1;
+ }
+
+ return ret;
+}
+/* Bob added end to set default board parameters, 11/01/2010 */
+
+//
+// setBoardParam: Set the board Id string, mac addresses, psi size, etc...
+//
+int setBoardParam(void)
+{
+ char boardIdPrompt[1000];
+ NVRAM_DATA nvramData;
+ int i;
+ char tmp[3];
+ char *boardIdPromptPtr, *savedBoardIdPromptPtr;
+ int ret = 0;
+
+ if (getBoardParam()) {
+ /* New NVRAM version */
+ return ret;
+ }
+
+ readNvramData(&nvramData);
+
+ // Create prompt string with board ID name selection
+ boardIdPromptPtr = boardIdPrompt;
+ for (i = 0; i < g_numBoardIdNames; i++) {
+ sprintf (tmp, "%d", i);
+ sprintf (boardIdPromptPtr, "%-17s------- %2s\n", &g_boardIdNames[i * BP_BOARD_ID_LEN], tmp);
+ boardIdPromptPtr += strlen(boardIdPromptPtr);
+ }
+ strcpy (boardIdPromptPtr, gBoardParam[PARAM_IDX_BOARD_NAME].promptName);
+
+ // Save existing prompt string
+ savedBoardIdPromptPtr = gBoardParam[PARAM_IDX_BOARD_NAME].promptName;
+ // Set newly created prompt string
+ gBoardParam[PARAM_IDX_BOARD_NAME].promptName = boardIdPrompt;
+
+ // Convert board ID string to numeric value
+ for (i = 0; i < g_numBoardIdNames; i++) {
+ if (!strcmp(gBoardParam[PARAM_IDX_BOARD_NAME].parameter, &g_boardIdNames[i * BP_BOARD_ID_LEN])) {
+ sprintf(gBoardParam[PARAM_IDX_BOARD_NAME].parameter, "%d", i);
+ }
+ }
+
+ if (processPrompt(gBoardParam, gNumBoardParams)) {
+ // At least one field was changed
+ nvramData.ulVersion = NVRAM_VERSION_NUMBER;
+
+ // Convert numeric value of board ID to string
+ i = atoi(gBoardParam[PARAM_IDX_BOARD_NAME].parameter);
+ strcpy(nvramData.szBoardId, &g_boardIdNames[i * BP_BOARD_ID_LEN]);
+
+ nvramData.ulNumMacAddrs = atoi(gBoardParam[PARAM_IDX_NUM_MAC_ADDR].parameter);
+ parsehwaddr(gBoardParam[PARAM_IDX_BASE_MAC_ADDR].parameter, nvramData.ucaBaseMacAddr);
+ nvramData.ulPsiSize = atoi(gBoardParam[PARAM_IDX_PSI_SIZE].parameter);
+ nvramData.backupPsi = atoi(gBoardParam[PARAM_IDX_ENABLE_BACKUP_PSI].parameter);
+ nvramData.ulSyslogSize = atoi(gBoardParam[PARAM_IDX_SYSLOG_SIZE].parameter);
+ nvramData.ulMainTpNum = atoi(gBoardParam[PARAM_IDX_MAIN_THREAD_NUM].parameter);
+
+ // save the buf to nvram
+ writeNvramData(&nvramData);
+ ret = 1;
+ }
+
+ // restore gBoardParam
+ // Convert numeric value of board ID to string
+ gBoardParam[PARAM_IDX_BOARD_NAME].promptName = savedBoardIdPromptPtr;
+ i = atoi(gBoardParam[PARAM_IDX_BOARD_NAME].parameter);
+ strcpy(gBoardParam[PARAM_IDX_BOARD_NAME].parameter, &g_boardIdNames[i * BP_BOARD_ID_LEN]);
+
+ if(gGponParamsInitialized) {
+ printf("\n");
+ ret += setGponBoardParam();
+ }
+
+ if(gWpsDevicePinInitialized) {
+ printf("\n");
+ ret += setWpsDevicePinBoardParam();
+ }
+
+ gVoiceParamsInitialized = voiceParamsInitialized(&nvramData);
+
+ if(gVoiceParamsInitialized) {
+ printf("\n");
+ ret += setVoiceBoardParam();
+ }
+
+ return ret;
+}
+
+void displayBoardParam(void)
+{
+ int i;
+
+ getBoardParam();
+
+ for (i = 0; i < gNumBoardParams; i++) {
+ if( gBoardParam[i].enabled )
+ printf("%s %s \n", gBoardParam[i].promptName, gBoardParam[i].parameter);
+ }
+
+ if(gGponParamsInitialized) {
+ getGponBoardParam();
+
+ for (i = 0; i < gNumGponBoardParams; i++)
+ if( gGponBoardParam[i].enabled )
+ printf("%s \"%s\" \n", gGponBoardParam[i].promptName, gGponBoardParam[i].parameter);
+ }
+
+ /*Show WPS Device PIN */
+ if(gWpsDevicePinInitialized) {
+ getWpsDevicePinBoardParam();
+ if ( gWpsDevicePinBoardParam[PARAM_IDX_WPS_DEVICE_PIN].enabled)
+ printf("%s \"%s\" \n", gWpsDevicePinBoardParam[PARAM_IDX_WPS_DEVICE_PIN].promptName, \
+ gWpsDevicePinBoardParam[PARAM_IDX_WPS_DEVICE_PIN].parameter);
+ }
+
+ if(gVoiceParamsInitialized) {
+ getVoiceBoardParam();
+
+ for (i = 0; i < gNumVoiceBoardParams; i++)
+ if( gVoiceBoardParam[i].enabled )
+ printf("%s %s \n", gVoiceBoardParam[i].promptName, gVoiceBoardParam[i].parameter);
+ }
+}
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_cmd.c b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_cmd.c
new file mode 100755
index 0000000..111e73f
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_cmd.c
@@ -0,0 +1,1878 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ *
+ * bcm63xx board specific routines and commands.
+ *
+ * by: seanl
+ *
+ * April 1, 2002
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "bcm63xx_util.h"
+#include "flash_api.h"
+#include "jffs2.h"
+
+/* Foxconn add start by Cliff Wang, 03/23/2010 */
+#include "tftpd.h"
+
+#include "net_nmrp.h"
+
+
+extern int nmrp_server_detected;
+extern unsigned long cfe_sdramsize;
+extern int ui_init_tftpdcmds(void);
+int verify_checksum(char *buf, unsigned long buf_len, unsigned long chksum);
+/* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+#define je16_to_cpu(x) ((x).v16)
+#define je32_to_cpu(x) ((x).v32)
+#define FLASH_STAGING_BUFFER BOARD_IMAGE_DOWNLOAD_ADDRESS
+#define FLASH_STAGING_BUFFER_SIZE BOARD_IMAGE_DOWNLOAD_SIZE
+
+extern int decompressLZMA(unsigned char *in, unsigned insize, unsigned char *out, unsigned outsize);
+
+// global
+int g_processing_cmd = 0;
+
+char fakeConsole[2] = " ";
+
+/* Foxconn add start by Jenny Zhao, 07/02/2008*/
+struct image_header
+{
+ unsigned long magic; /* magic */
+ unsigned long header_len; /* Length of header */
+ unsigned char reserved[8];
+ unsigned long kernel_chksum; /* Kernel image chksum */
+ unsigned long rootfs_chksum; /* rootfs image chksum */
+ unsigned long kernel_len; /* Length of kernel */
+ unsigned long rootfs_len; /* Length of rootfs */
+ unsigned long image_chksum; /* checksum across length of image */
+ unsigned long header_chksum; /* checksum across length of header */
+};
+
+#define swap32(val) \
+ ((unsigned int)( \
+ (((unsigned int)(val) & (unsigned int)0x000000ffUL)) | \
+ (((unsigned int)(val) & (unsigned int)0x0000ff00UL)) | \
+ (((unsigned int)(val) & (unsigned int)0x00ff0000UL)) | \
+ (((unsigned int)(val) & (unsigned int)0xff000000UL)) ))
+
+/* pling added 12/04/2008, define the Foxconn board ID length */
+#define FOXCONN_BOARD_ID_LEN 64
+/* Foxconn add end by Jenny Zhao, 07/02/2008*/
+
+static int ui_cmd_set_board_param(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int ret = 0;
+ int i = 0;
+ int reset = 0;
+
+ if(!argc)
+ {
+ reset += setBoardParam();
+ }
+
+ while(argc && !ret)
+ {
+ if(!strcmp(argv[i], "g"))
+ {
+ reset += setGponBoardParam();
+ }
+ else {
+ /*Setup WPS Device Pin*/
+ if(!strcmp(argv[i], "w"))
+ {
+ reset += setWpsDevicePinBoardParam();
+ }
+ else
+ {
+ ret = -1;
+ }
+ }
+
+ argc--;
+ i++;
+ }
+
+ if(reset)
+ softReset();
+
+ return ret;
+}
+
+static int ui_cmd_reset(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ softReset();
+ return 0;
+}
+
+// return 0 if 'y'
+int yesno(void)
+{
+ char ans[5];
+
+ printf(" (y/n):");
+ console_readline ("", ans, sizeof (ans));
+ if (ans[0] != 'y')
+ return -1;
+
+ return 0;
+}
+
+// erase Persistent sector
+static int ui_cmd_erase_psi(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ printf("Erase persisten storage data?");
+ if (yesno())
+ return -1;
+
+ kerSysErasePsi();
+
+ return 0;
+}
+
+static int ui_cmd_erase_nand(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+
+#if (INC_NAND_FLASH_DRIVER==1)
+ char *flag;
+ int i, blk_end;
+
+ flag = cmd_getarg(cmd,0);
+
+ if (!flag)
+ {
+ printf("'e b' to reinitialize NAND flash or 'e a' to erase kernel\n");
+ return 0;
+ }
+
+ switch (*flag)
+ {
+ case 'b':
+ printf("Reinitialize NAND flash?");
+ if (yesno())
+ return 0;
+ printf("\nNow think carefully. Do you really,\n"
+ "really want to reinitialize the NAND flag?");
+ if (yesno())
+ return 0;
+ flash_sector_erase_int(NAND_REINIT_FLASH);
+ break;
+ case 'a':
+ printf("Erase NAND flash? The modem will not be able to boot from "
+ "flash");
+ if (yesno())
+ return 0;
+
+ blk_end = flash_get_numsectors();
+ for (i = 1; i < blk_end; i++)
+ {
+ printf(".");
+ flash_sector_erase_int(i);
+ }
+ printf("\n");
+ break;
+ case 's':
+ {
+ extern void dump_spare(void);
+ dump_spare();
+ }
+ break;
+
+ case 'r':
+ {
+ extern unsigned char *mem_topofmem;
+ unsigned char *buf = (unsigned char *) mem_topofmem + 1024;
+ char *pszLen = cmd_getarg(cmd, 2);
+ int len = (pszLen) ? atoi(pszLen) : 64;
+ char *pszBlk = cmd_getarg(cmd, 1);
+ if( flash_read_buf(atoi(pszBlk), 0, buf, 16 * 1024) > 0 )
+ {
+ void ui_dumpaddr( unsigned char *pAddr, int nLen );
+ printf("block read into buffer at 0x%8.8lx\n", (unsigned long)buf);
+ ui_dumpaddr(buf, len); /* dump first few bytes */
+ }
+ else
+ printf("block NOT read into buffer at 0x%8.8lx\n",(unsigned long)buf);
+ /* Can break into JTAG now to view entire block contents. */
+ }
+ break;
+ default:
+ printf("Erase [n]vram, [p]ersistent storage or [a]ll flash except bootrom\nusage: e [n/p/a]\n");
+ return 0;
+ }
+#elif (INC_SPI_PROG_NAND==1)
+ char *flag;
+ int i, blk_end;
+
+ flash_change_flash_type(FLASH_IFC_NAND);
+
+ flag = cmd_getarg(cmd,0);
+
+ if (!flag)
+ {
+ printf("'n b' to reinitialize NAND flash or 'n a' to erase kernel on NAND\n");
+ goto finish;
+ }
+
+ switch (*flag)
+ {
+ case 'b':
+ printf("Reinitialize NAND flash?");
+ if (yesno())
+ goto finish;
+ printf("\nNow think carefully. Do you really,\n"
+ "really want to reinitialize the NAND flag?");
+ if (yesno())
+ goto finish;
+ flash_sector_erase_int(NAND_REINIT_FLASH);
+ break;
+ case 'a':
+ printf("Erase NAND flash? The modem will not be able to boot from "
+ "flash");
+ if (yesno())
+ goto finish;
+
+ blk_end = flash_get_numsectors();
+ for (i = 1; i < blk_end; i++)
+ {
+ printf(".");
+ flash_sector_erase_int(i);
+ }
+ printf("\n");
+ break;
+ case 's':
+ {
+ extern void dump_spare(void);
+ dump_spare();
+ }
+ break;
+
+ case 'r':
+ {
+ extern unsigned char *mem_topofmem;
+ unsigned char *buf = (unsigned char *) mem_topofmem + 1024;
+ char *pszBlk = cmd_getarg(cmd, 1);
+ if( flash_read_buf(atoi(pszBlk), 0, buf, 16 * 1024) > 0 )
+ {
+ void ui_dumpaddr( unsigned char *pAddr, int nLen );
+ printf("block read into buffer at 0x%8.8lx\n", (unsigned long)buf);
+ ui_dumpaddr(buf, 64); /* dump first few bytes */
+ }
+ else
+ printf("block NOT read into buffer at 0x%8.8lx\n",(unsigned long)buf);
+ /* Can break into JTAG now to view entire block contents. */
+ }
+ break;
+ default:
+ printf("Erase [n]vram, [p]ersistent storage or [a]ll flash except bootrom on NAND\nusage: n [n/p/a]\n");
+ }
+finish:
+ flash_change_flash_type(FLASH_IFC_SPI);
+
+#endif
+
+ return 0;
+}
+
+// erase some sectors
+static int ui_cmd_erase(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+
+ //FILE_TAG cfeTag;
+ PFILE_TAG pTag;
+ char *flag;
+ int i, blk_start, blk_end;
+
+ flag = cmd_getarg(cmd,0);
+
+ if (!flag)
+ {
+ printf("Erase [n]vram, [p]ersistent storage or [a]ll flash except bootrom\nusage: e [n/p/a]\n");
+ return 0;
+ }
+
+ switch (*flag)
+ {
+ case 'b':
+ printf("Erase boot loader?");
+ if (yesno())
+ return 0;
+ printf("\nNow think carefully. Do you really,\n"
+ "really want to erase the boot loader?");
+ if (yesno())
+ return 0;
+ flash_sector_erase_int(0);
+ break;
+ case 'n':
+ printf("Erase nvram?");
+ if (yesno())
+ return 0;
+ kerSysEraseNvRam();
+ softReset();
+ break;
+ case 'a':
+
+ printf("Erase all flash (except bootrom)?");
+ if (yesno())
+ return 0;
+
+ blk_end = flash_get_numsectors();
+ if ((pTag = getTagFromPartition(1)) != NULL)
+ blk_start = flash_get_blk(atoi(pTag->rootfsAddress) + BOOT_OFFSET);
+ else // just erase all after cfe
+ {
+ FLASH_ADDR_INFO flash_info;
+
+ kerSysFlashAddrInfoGet(&flash_info);
+ for( blk_start = 0, i = 0; i<flash_info.flash_rootfs_start_offset &&
+ blk_start < blk_end; blk_start++ )
+ {
+ i += flash_get_sector_size(blk_start);
+ }
+ printf("No image tag found. Erase the blocks start at [%d]\n",
+ blk_start);
+ }
+ if( blk_start > 0 )
+ {
+ for (i = blk_start; i < blk_end; i++)
+ {
+ printf(".");
+ flash_sector_erase_int(i);
+ }
+ printf("\n");
+ }
+
+ /* Preserve the NVRAM fields that are used in the 'b' command. */
+ softReset();
+ break;
+ case 'p':
+ ui_cmd_erase_psi(cmd,argc,argv);
+ break;
+ default:
+ printf("Erase [n]vram, [p]ersistent storage or [a]ll flash except bootrom\nusage: e [n/p/a]\n");
+ return 0;
+ }
+
+ return 0;
+}
+
+
+static int loadRaw(char *hostImageName, uint8_t *ptr)
+{
+ cfe_loadargs_t la;
+ int res;
+
+ printf("Loading %s ...\n", hostImageName);
+
+ // tftp only
+ la.la_filesys = "tftp";
+ la.la_filename = hostImageName;
+ la.la_device = NULL;
+ la.la_address = (long)ptr;
+ la.la_options = NULL;
+ la.la_maxsize = FLASH_STAGING_BUFFER_SIZE;
+ la.la_flags = LOADFLG_SPECADDR;
+
+ res = bcm63xx_cfe_rawload(&la);
+ if (res < 0)
+ {
+ ui_showerror(res, "Loading failed.");
+ return res;
+ }
+ printf("Finished loading %d bytes\n", res);
+
+ return res;
+}
+
+// flash the image
+static int ui_cmd_flash_image(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char hostImageName[BOOT_FILENAME_LEN + BOOT_IP_LEN];
+ char *imageName;
+ int res;
+ uint8_t *ptr = (uint8_t *) KERNADDR(FLASH_STAGING_BUFFER);
+
+ g_processing_cmd = 1;
+
+ imageName = cmd_getarg(cmd, 0);
+
+ if (imageName)
+ {
+ if (strchr(imageName, ':'))
+ strcpy(hostImageName, imageName);
+ else
+ {
+ strcpy(hostImageName, bootInfo.hostIp);
+ strcat(hostImageName, ":");
+ strcat(hostImageName, imageName);
+ }
+ }
+ else // use default flash file name
+ {
+ strcpy(hostImageName, bootInfo.hostIp);
+ strcat(hostImageName, ":");
+ strcat(hostImageName, bootInfo.flashFileName);
+ }
+
+ if ((res = loadRaw(hostImageName, ptr)) < 0)
+ {
+ g_processing_cmd = 0;
+ return res;
+ }
+
+ // check and flash image
+ res = flashImage(ptr);
+
+ if( res == 0 )
+ {
+ char *p;
+ NVRAM_DATA nvramData;
+
+ readNvramData(&nvramData);
+
+ for( p = nvramData.szBootline; p[2] != '\0'; p++ ) {
+ if( p[0] == 'r' && p[1] == '=' && p[2] == 'h' )
+ {
+ /* Change boot source to "boot from flash". */
+ p[2] = 'f';
+ writeNvramData(&nvramData);
+ break;
+ }
+ }
+ softReset();
+ }
+
+ g_processing_cmd = 0;
+ return( res );
+}
+
+static int ui_cmd_write_chk_image(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char hostImageName[BOOT_FILENAME_LEN + BOOT_IP_LEN];
+ char *imageName;
+ uint8_t *ptr = (uint8_t *) KERNADDR(FLASH_STAGING_BUFFER);
+ int res;
+ struct image_header *header;
+ unsigned long image_len, image_chksum;
+
+ unsigned long header_len = 0;
+ unsigned long board_id_len = 0;
+ char board_id[FOX_BOARD_ID_MAX_LEN];
+ uint8_t *tmp;
+
+ g_processing_cmd = 1;
+
+ imageName = cmd_getarg(cmd, 0);
+ if (!imageName)
+ return ui_showusage(cmd);
+
+ if (strchr(imageName, ':'))
+ strcpy(hostImageName, imageName);
+ else
+ {
+ strcpy(hostImageName, bootInfo.hostIp);
+ strcat(hostImageName, ":");
+ strcat(hostImageName, imageName);
+ }
+
+ if ((res = loadRaw(hostImageName, ptr)) < 0)
+ {
+ g_processing_cmd = 0;
+ return res;
+ }
+
+ /* check chk file */
+ header = (struct image_header *)ptr;
+ header_len = swap32(header->header_len);
+ image_len = swap32(header->kernel_len);
+ image_chksum = swap32(header->kernel_chksum);
+ board_id_len = header_len - sizeof(struct image_header);
+
+ memset(board_id, 0, sizeof(board_id));
+ memcpy(board_id, header+1, board_id_len);
+
+ printf("total:%d header:%d kernel:%d \n", res, header_len, image_len);
+
+ tmp = ptr;
+ ptr += header_len;
+ res -= header_len;
+
+ if (verify_checksum((char*)ptr, image_len, image_chksum)) {
+ printf("fail to comapre checksum ... \n ");
+ return CFE_ERR_BADIMAGE;
+ }
+
+ memcpy(tmp, ptr, res);
+
+ // check and flash image
+ res = writeWholeImage(tmp, res);
+
+ printf("Finished flashing image.\n");
+/*
+ if (res == 0)
+ {
+ softReset();
+ }
+*/
+ g_processing_cmd = 0;
+ return( res );
+}
+
+// write the whole image
+static int ui_cmd_write_whole_image(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char hostImageName[BOOT_FILENAME_LEN + BOOT_IP_LEN];
+ char *imageName;
+ uint8_t *ptr = (uint8_t *) KERNADDR(FLASH_STAGING_BUFFER);
+ int res;
+
+ g_processing_cmd = 1;
+
+ imageName = cmd_getarg(cmd, 0);
+ if (!imageName)
+ return ui_showusage(cmd);
+
+ if (strchr(imageName, ':'))
+ strcpy(hostImageName, imageName);
+ else
+ {
+ strcpy(hostImageName, bootInfo.hostIp);
+ strcat(hostImageName, ":");
+ strcat(hostImageName, imageName);
+ }
+
+ if ((res = loadRaw(hostImageName, ptr)) < 0)
+ {
+ g_processing_cmd = 0;
+ return res;
+ }
+
+ // check and flash image
+ res = writeWholeImage(ptr, res);
+
+ printf("Finished flashing image.\n");
+
+ if (res == 0)
+ {
+ softReset();
+ }
+
+ g_processing_cmd = 0;
+ return( res );
+}
+
+
+static int ui_cmd_flash_router_image(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char hostImageName[BOOT_FILENAME_LEN + BOOT_IP_LEN];
+ char *imageName;
+ uint8_t *ptr = (uint8_t *) KERNADDR(FLASH_STAGING_BUFFER);
+
+#if (INC_NAND_FLASH_DRIVER==1)
+ uint8_t *tmp;
+#endif
+
+ int res;
+
+ char board_id[FOX_BOARD_ID_MAX_LEN]; //Silver
+ int update=0;
+ char board_id_test[PROJECT_ID_LEN];
+
+#if (INC_NAND_FLASH_DRIVER==1)
+ NVRAM_DATA nvramData;
+#endif
+
+ imageName = cmd_getarg(cmd, 0);
+ if (!imageName)
+ return ui_showusage(cmd);
+
+ if (strchr(imageName, ':'))
+ strcpy(hostImageName, imageName);
+ else
+ {
+ strcpy(hostImageName, "");
+ strcat(hostImageName, ":");
+ strcat(hostImageName, "");
+ }
+
+ set_tftpd_state(TFTPD_STATE_WAIT_IMAGE);
+ if ((res = loadRaw(hostImageName, ptr)) < 0) {
+ printf("fail to load raw file ... \n");
+ return res;
+ }
+
+ if ( nmrp_server_detected == 0)
+ {
+ set_tftpd_state(TFTPD_STATE_OFF); // Foxconn added to turn on RED.
+ setPowerOnLedOn(); // Foxconn added to turn on RED.
+ }
+
+ /* Foxconn add start by Jenny Zhao, 07/02/2008*/
+ if (1) {
+ struct image_header *header;
+ unsigned long image_len, image_chksum;
+
+ unsigned long header_len = 0;
+ unsigned long board_id_len = 0;
+
+ header = (struct image_header *)ptr;
+ header_len = swap32(header->header_len);
+ image_len = swap32(header->kernel_len);
+ image_chksum = swap32(header->kernel_chksum);
+ /* Check Board ID first */
+ board_id_len = header_len - sizeof(struct image_header);
+ memset(board_id, 0, sizeof(board_id));
+ //for(i=0;i<board_id_len;i++)
+ /* printf("copy board id ... \n"); */
+
+ //memcpy(board_id, board_id_test, board_id_len);
+#if (INC_NAND_FLASH_DRIVER==1)
+ readNvramData(&nvramData);
+ if ( nvramData.szFirmwareUpgradeBoardId != NULL )
+ memcpy(board_id_test, nvramData.szFirmwareUpgradeBoardId, PROJECT_ID_LEN);
+#else
+ kerSysReadFromFlash(board_id_test, BOARD_DATA_ADDR, PROJECT_ID_LEN);
+#endif
+ /* printf("bboard id is (%s)\n", board_id_test); */
+
+ memcpy(board_id, header+1, board_id_len);
+
+ /* printf("iboard id is (%s)\n", board_id); */
+
+/* disable board_id checking
+ if (verify_board_id(board_id)) {
+ printf("Check board id fail: (%s)\n", board_id);
+ return CFE_ERR_BADIMAGE;
+ }
+*/
+ /* Check image checksum */
+#ifdef _DEBUG
+ xprintf("len = 0x%08X\n", image_len);
+ xprintf("chksum = 0x%08X\n", image_chksum);
+ xprintf("header_len = 0x%08X\n", header_len);
+#endif
+
+#if (INC_NAND_FLASH_DRIVER==1)
+ tmp = ptr;
+ res -= header_len;
+#endif
+
+ ptr += header_len;
+
+ if (verify_checksum((char*)ptr, image_len, image_chksum)) {
+ printf("fail to comapre checksum ... \n ");
+ return CFE_ERR_BADIMAGE;
+ }
+ }
+
+ /* Foxconn add end by Jenny Zhao, 07/02/2008*/
+ if(nmrp_server_detected==1) // in NMRP mode
+ {
+ printf(">>> kerSysBcmImageSet= 0x%x\n", FLASH_IMAGE_START_ADDR);
+#if (INC_NAND_FLASH_DRIVER==1)
+ memcpy(tmp, ptr, res);
+ if ((res = writeWholeImage(tmp, res) )!= 0)
+#else
+ if ((res = kerSysBcmImageSet(FLASH_IMAGE_START_ADDR, ptr, res, 0)) != 0)
+#endif
+ printf("Failed to flash image. Error: %d\n", res);
+ else
+ {
+ /* Foxconn added start, Silver Shih for burn board Id */
+ if( strlen(board_id) < FOX_BOARD_ID_MAX_LEN)
+ {
+ if(strcmp(board_id_test, board_id) != 0)
+ //if (strcmp((char *)BOARD_DATA_ADDR, board_id) != 0)
+ {
+ //printf("board id not match, addr:0x%x\n", BOARD_DATA_ADDR);
+ //5 is indicated to burn board id
+#if (INC_NAND_FLASH_DRIVER==0)
+ kerSysBcmImageSet(BOARD_DATA_ADDR, (unsigned char *)board_id, strlen(board_id)+1 , 5);
+#endif
+ }
+ }
+ /* Foxconn added end, Silver Shih for burn board Id */
+
+ update=1;
+ printf("Finished flashing image in NMRP mode.\n");
+ }
+ }
+ /* Foxconn added start pling 12/04/2008, for 'tftpd' */
+#if (INC_NAND_FLASH_DRIVER==0)
+ else if ((res = kerSysBcmImageSet(FLASH_IMAGE_START_ADDR, ptr, res, 0)) != 0)
+ printf("Failed to flash image. Error: %d\n", res);
+#endif
+ else
+ printf("finishing flash image for flashimage command ... \n");
+
+ /* Foxconn added end pling 12/04/2008 */
+ if (res == 0)
+ {
+ char *p;
+ NVRAM_DATA nvramData;
+
+ readNvramData(&nvramData);
+
+ memcpy(nvramData.szFirmwareUpgradeBoardId, board_id, strlen(board_id));
+
+ for( p = nvramData.szBootline; p[2] != '\0'; p++ ) {
+ if( p[0] == 'r' && p[1] == '=' && p[2] == 'h' )
+ {
+ /* Change boot source to "boot from flash". */
+ p[2] = 'f';
+ //writeNvramData(&nvramData);
+ break;
+ }
+ }
+ writeNvramData(&nvramData);
+ // softReset(); //remove by EricHuang
+ }
+
+ if (nmrp_server_detected==1 && update==1) //NMRP mode
+ {
+ // Restore to factory default.
+ printf("try to restore to default, addr=0x%x\n", BOARD_FOXNVRAM_ADDR);
+#if (INC_NAND_FLASH_DRIVER==0)
+ kerSysBcmImageSet(BOARD_FOXNVRAM_ADDR, (unsigned char *)"", 0x10000 , 5);
+#endif
+ }
+
+ return( res );
+}
+
+/************************************************************************
+ * cfe_go(la)
+ *
+ * Starts a previously loaded program. cfe_loadargs.la_entrypt
+ * must be set to the entry point of the program to be started
+ *
+ * Input parameters:
+ * la - loader args
+ *
+ * Return value:
+ * does not return
+ ********************************************************************* */
+
+void cfe_go(cfe_loadargs_t *la)
+{
+ if (la->la_entrypt == 0) {
+ xprintf("No program has been loaded.\n");
+ return;
+ }
+
+ if (net_getparam(NET_DEVNAME)) {
+ xprintf("Closing network.\n");
+ net_uninit();
+ }
+
+ xprintf("Starting program at 0x%p\n",la->la_entrypt);
+
+ setPowerOnLedOn();
+
+ cfe_start(la->la_entrypt);
+}
+
+static int bootImage(char *fileSys, char *device, int zflag, char *imageName)
+{
+ cfe_loadargs_t la;
+ int res;
+
+ // elf only
+ la.la_filesys = fileSys;
+ la.la_filename = imageName;
+ la.la_device = device;
+ la.la_options = 0;
+ la.la_maxsize = 0;
+ la.la_address = 0;
+ la.la_flags = zflag;
+
+ res = bcm63xx_cfe_elfload(&la);
+ if (res != 0)
+ return res;
+
+ if (la.la_flags & LOADFLG_NOISY)
+ xprintf("Entry at 0x%p\n",la.la_entrypt);
+ if ((la.la_flags & LOADFLG_EXECUTE) && (la.la_entrypt != 0)) {
+ cfe_go(&la);
+ }
+
+ return res;
+}
+
+// Compressed image head format in Big Endia:
+// 1) Text Start address: 4 bytes
+// 2) Program Entry point: 4 bytes
+// 3) Compress image Length: 4 bytes
+// 4) Compress data starts: compressed data
+static int bootCompressedImage(unsigned int *puiCmpImage, int retry)
+{
+ unsigned char *pucSrc;
+ unsigned char *pucDst;
+ unsigned char *pucEntry;
+ unsigned int dataLen;
+ int ret = 0;
+ cfe_loadargs_t la;
+
+ if( (unsigned long) puiCmpImage > FLASH_BASE )
+ {
+ /* Boot compressed image from flash. */
+ unsigned int *puiOrigCmpImage = puiCmpImage;
+ unsigned int *puiNewCmpImage = NULL;
+ unsigned int *puiOldCmpImage = NULL;
+ unsigned int *puiFs = NULL;
+ PFILE_TAG pTag1 = getTagFromPartition(1);
+ PFILE_TAG pTag2 = getTagFromPartition(2);
+ PFILE_TAG pCurTag = NULL;
+ unsigned int *puiImg= NULL;
+ int nImgLen = 0;
+ unsigned long ulCrc, ulImgCrc;
+
+ if( pTag1 && pTag2 )
+ {
+ /* Two images are on flash. Determine which one is being booted. */
+ PFILE_TAG pNewTag = NULL;
+ PFILE_TAG pOldTag = NULL;
+ int seq1 = atoi(pTag1->imageSequence);
+ int seq2 = atoi(pTag2->imageSequence);
+
+ if( seq1 > seq2 )
+ {
+ pNewTag = pTag1;
+ pOldTag = pTag2;
+ }
+ else
+ {
+ pNewTag = pTag2;
+ pOldTag = pTag1;
+ }
+
+ puiNewCmpImage = (unsigned int *)
+ (atoi(pNewTag->kernelAddress) + BOOT_OFFSET);
+ puiOldCmpImage = (unsigned int *)
+ (atoi(pOldTag->kernelAddress) + BOOT_OFFSET);
+
+ if( puiOrigCmpImage == puiOldCmpImage )
+ {
+ printf("Booting from previous image (0x%8.8lx) ...\n",
+ (unsigned long) atoi(pOldTag->rootfsAddress) +
+ BOOT_OFFSET - TAG_LEN);
+ pCurTag = pOldTag;
+ }
+ else
+ {
+ printf("Booting from latest image (0x%8.8lx) ...\n",
+ (unsigned long) atoi(pNewTag->rootfsAddress) +
+ BOOT_OFFSET - TAG_LEN);
+ pCurTag = pNewTag;
+ }
+ }
+ else
+ if( pTag1 || pTag2 )
+ {
+ /* Only one image on flash. */
+ pCurTag = (pTag1) ? pTag1 : pTag2;
+ printf("Booting from only image (0x%8.8lx) ...\n",
+ (unsigned long) atoi(pCurTag->rootfsAddress) +
+ BOOT_OFFSET - TAG_LEN);
+ }
+ else
+ {
+ /* No image on flash. */
+ printf("No valid boot image\n");
+ ret = -1;
+ }
+
+ if( ret == 0 )
+ {
+ /* Copy compressed image to SDRAM. */
+ extern unsigned char *mem_topofmem;
+ FLASH_ADDR_INFO info;
+ unsigned char *pDest = (unsigned char *) mem_topofmem + 1024;
+ unsigned char *pImgEnd;
+
+ kerSysFlashAddrInfoGet( &info );
+ pImgEnd = flash_get_memptr( info.flash_meta_start_blk );
+ kerSysReadFromFlash( pDest, (unsigned long) puiCmpImage,
+ (unsigned long) pImgEnd - (unsigned long) puiCmpImage );
+
+ puiCmpImage = (unsigned int *) pDest;
+
+ /* Copy file system to SDRAM. */
+ pDest += (unsigned long) pImgEnd - (unsigned long)
+ puiOrigCmpImage + 1024;
+ kerSysReadFromFlash( pDest, (unsigned long)
+ atoi(pCurTag->rootfsAddress) + BOOT_OFFSET,
+ atoi(pCurTag->rootfsLen));
+
+ puiFs = (unsigned int *) pDest;
+
+ pucDst = (unsigned char *) *puiCmpImage;
+ pucEntry = (unsigned char *) *(puiCmpImage + 1);
+ dataLen = (unsigned int) *(puiCmpImage + 2);
+ pucSrc = (unsigned char*) (puiCmpImage + 3);
+
+ printf("Code Address: 0x%08X, Entry Address: 0x%08x\n",
+ (unsigned int) pucDst, (unsigned int) pucEntry);
+
+
+ /* Check Linux file system CRC */
+ ulImgCrc = *(unsigned long *) (pCurTag->imageValidationToken +
+ CRC_LEN);
+ if( ulImgCrc )
+ {
+ if( puiFs )
+ puiImg = puiFs;
+ else
+ {
+ puiImg = (unsigned int *) (atoi(pCurTag->rootfsAddress) +
+ BOOT_OFFSET);
+ }
+ nImgLen = atoi(pCurTag->rootfsLen);
+
+ ulCrc = CRC32_INIT_VALUE;
+ ulCrc = getCrc32((unsigned char *) puiImg, (UINT32) nImgLen, ulCrc);
+ if( ulCrc != ulImgCrc)
+ {
+ printf("Linux file system CRC error. Corrupted image?\n");
+ ret = -1;
+ }
+ }
+
+ /* Check Linux kernel CRC */
+ ulImgCrc = *(unsigned long *) (pCurTag->imageValidationToken +
+ (CRC_LEN * 2));
+ if( ulImgCrc )
+ {
+ puiImg = (unsigned int *) puiCmpImage;
+ nImgLen = atoi(pCurTag->kernelLen);
+
+ ulCrc = CRC32_INIT_VALUE;
+ ulCrc = getCrc32((unsigned char *) puiImg, (UINT32) nImgLen, ulCrc);
+ if( ulCrc != ulImgCrc)
+ {
+ printf("Linux kernel CRC error. Corrupted image?\n");
+ ret = -1;
+ }
+ }
+
+ if( ret == 0 )
+ {
+ ret = decompressLZMA(pucSrc, dataLen, pucDst, 23*1024*1024);
+ if (ret != 0)
+ printf("Failed to decompress image. Corrupted image?\n");
+ }
+
+ if (ret != 0)
+ {
+ /* Try to boot from the other flash image, if one exists. */
+ if( retry == TRUE && pTag1 && pTag2 )
+ {
+ int blk = 0;
+ unsigned char *pBase = flash_get_memptr(0);
+ unsigned int *flash_addr_kernel;
+ FLASH_ADDR_INFO flash_info;
+
+ /* The boot image is bad. Erase the sector with the tag so
+ * the image is not tried in subsequent boots.
+ */
+ kerSysFlashAddrInfoGet(&flash_info);
+ if( pCurTag == pTag1 )
+ {
+ blk = flash_get_blk((int)(pBase +
+ flash_info.flash_rootfs_start_offset));
+ }
+ else
+ if( pCurTag == pTag2 )
+ {
+ blk = flash_get_blk((int) (pBase +
+ (flash_get_total_size()/2)));
+ }
+
+ if( blk )
+ flash_sector_erase_int(blk);
+
+ /* Boot from the other flash image. */
+ if( puiOrigCmpImage == puiOldCmpImage )
+ flash_addr_kernel = puiNewCmpImage;
+ else
+ flash_addr_kernel = puiOldCmpImage;
+
+ ret = bootCompressedImage( flash_addr_kernel, FALSE );
+ }
+ }
+ else
+ {
+ printf("Decompression OK!\n");
+ la.la_entrypt = (long) pucEntry;
+ printf("Entry at 0x%p\n",la.la_entrypt);
+ cfe_go(&la); // never return...
+ }
+
+ }
+ }
+ else
+ {
+ /* Boot compressed image that was downloaded to RAM. */
+ pucDst = (unsigned char *) *puiCmpImage;
+ pucEntry = (unsigned char *) *(puiCmpImage + 1);
+ dataLen = (unsigned int) *(puiCmpImage + 2);
+ pucSrc = (unsigned char*) (puiCmpImage + 3);
+
+ printf("Code Address: 0x%08X, Entry Address: 0x%08x\n",
+ (unsigned int) pucDst, (unsigned int) pucEntry);
+
+ ret = decompressLZMA(pucSrc, dataLen, pucDst, 23*1024*1024);
+ if (ret == 0)
+ {
+ printf("Decompression OK!\n");
+ la.la_entrypt = (long) pucEntry;
+ printf("Entry at 0x%p\n",la.la_entrypt);
+ cfe_go(&la); // never return...
+ }
+ else
+ printf("Failed on decompression. Corrupted image?\n");
+ }
+
+ return ret;
+}
+
+static int bootNandImageFromRootfs(int start_blk, int end_blk)
+{
+ extern unsigned char *mem_topofmem;
+ char fname[] = NAND_FLASH_BOOT_IMAGE_NAME;
+ int fname_len = strlen(fname);
+ int len = flash_get_sector_size(0);
+ unsigned char *buf = (unsigned char *) mem_topofmem + 1024;
+ unsigned char *pDest = (unsigned char *) buf + len;
+ unsigned long *pulDest = (unsigned long *) pDest;
+ unsigned char *p;
+ unsigned long version = 0;
+ unsigned long ino = 0;
+ int i, done;
+ struct jffs2_raw_dirent *pdir;
+ struct jffs2_raw_inode *pino;
+ int ret = 0;
+
+ /* Find the directory entry. */
+ for( i = start_blk, done = 0; i < end_blk && done == 0; i++ )
+ {
+ if( flash_read_buf(i, 0, buf, len) > 0 )
+ {
+ p = buf;
+ while( p < buf + len )
+ {
+ pdir = (struct jffs2_raw_dirent *) p;
+ if( je16_to_cpu(pdir->magic) == JFFS2_MAGIC_BITMASK )
+ {
+ if( je16_to_cpu(pdir->nodetype) == JFFS2_NODETYPE_DIRENT &&
+ fname_len == pdir->nsize &&
+ !memcmp(fname, pdir->name, fname_len) )
+ {
+ if( je32_to_cpu(pdir->version) > version )
+ {
+ if( (ino = je32_to_cpu(pdir->ino)) != 0 )
+ {
+ version = je32_to_cpu(pdir->version);
+
+ /* Setting 'done = 1' assumes there is only one
+ * version of the directory entry. This may not
+ * be correct if the file is updated after it
+ * was initially flashed.
+ *
+ * TBD. Look for a higher version of the
+ * directory entry without searching the entire
+ * flash part.
+ */
+ done = 1;
+ break;
+ }
+ }
+ }
+
+ p += (je32_to_cpu(pdir->totlen) + 0x03) & ~0x03;
+ }
+ else
+ break;
+ }
+ }
+ }
+
+ if( version )
+ {
+ unsigned char *pucSrc;
+ unsigned char *pucDst;
+ unsigned char *pucEntry;
+ unsigned int dataLen;
+ unsigned long cur_isize = 0;
+
+ /* Get the file contents. */
+ for( i = start_blk, done = 0; i < end_blk && done == 0; i++ )
+ {
+ if( flash_read_buf(i, 0, buf, len) > 0 )
+ {
+ p = buf;
+ while( p < buf + len )
+ {
+ pino = (struct jffs2_raw_inode *) p;
+ if( je16_to_cpu(pino->magic) == JFFS2_MAGIC_BITMASK )
+ {
+ if(je16_to_cpu(pino->nodetype)==JFFS2_NODETYPE_INODE &&
+ je32_to_cpu(pino->ino) == ino)
+ {
+ unsigned long size = je32_to_cpu(pino->dsize);
+ unsigned long ofs = je32_to_cpu(pino->offset);
+ unsigned long isize = je32_to_cpu(pino->isize);
+
+ if( size )
+ {
+ memcpy(pDest + ofs, pino->data, size);
+ if( (cur_isize += size) >= isize )
+ {
+ done = 1;
+ break;
+ }
+ }
+ }
+
+ p += (je32_to_cpu(pino->totlen) + 0x03) & ~0x03;
+ }
+ else
+ break;
+ }
+ }
+ }
+
+ pucDst = (unsigned char *) *pulDest;
+ pucEntry = (unsigned char *) *(pulDest + 1);
+ dataLen = (unsigned int) *(pulDest + 2);
+ pucSrc = (unsigned char *) (pulDest + 3);
+
+ ret = decompressLZMA(pucSrc, dataLen, pucDst, 23*1024*1024);
+ if (ret != 0)
+ printf("Failed to decompress image. Corrupted image?\n");
+ else
+ {
+ cfe_loadargs_t la;
+
+ /* Save the rootfs offset of the rootfs that the Linux image
+ * is loaded from at the memory location before the Linux load
+ * address. The Linux image uses this value to determine the
+ * the rootfs to use.
+ */
+ *(unsigned long *) (pucDst - 4) = (start_blk * len) / 1024;
+
+ printf("Decompression OK!\n");
+ la.la_entrypt = (long) pucEntry;
+ printf("Entry at 0x%p\n",la.la_entrypt);
+ cfe_go(&la); // never return...
+ }
+ }
+ else
+ printf("ERROR: A JFFS2 directory entry for %s was not found.\n",fname);
+
+ return( ret );
+}
+
+static int bootNandImage(void)
+{
+ int ret = -1;
+ char *msgA, *msgB;
+ PFILE_TAG pTag1 = getTagFromPartition(1);
+ PFILE_TAG pTag2 = getTagFromPartition(2);
+ int seq1 = (pTag1) ? atoi(pTag1->imageSequence) : -1;
+ int seq2 = (pTag2) ? atoi(pTag2->imageSequence) : -1;
+ int start_blk, end_blk, rootfsA, rootfsB;
+ int len = flash_get_sector_size(0) / 1024;
+ NVRAM_DATA nvramData;
+
+ readNvramData(&nvramData);
+ validateNandPartTbl(&nvramData);
+
+ if( pTag1 && pTag2 )
+ {
+ if( bootInfo.bootPartition == BOOT_LATEST_IMAGE )
+ {
+ msgA = "Booting from latest image (0x%8.8lx) ...\n";
+ msgB = "Booting from previous image (0x%8.8lx) ...\n";
+ rootfsA = (seq2 > seq1) ? NP_ROOTFS_2 : NP_ROOTFS_1;
+ }
+ else /* Boot from the previous image. */
+ {
+ msgA = "Booting from previous image (0x%8.8lx) ...\n";
+ msgB = "Booting from latest image (0x%8.8lx) ...\n";
+ rootfsA = (seq2 <= seq1) ? NP_ROOTFS_2 : NP_ROOTFS_1;
+ }
+
+ rootfsB = (rootfsA == NP_ROOTFS_2) ? NP_ROOTFS_1 : NP_ROOTFS_2;
+ start_blk = nvramData.ulNandPartOfsKb[rootfsA] / len;
+ end_blk = start_blk +
+ (nvramData.ulNandPartSizeKb[rootfsA] / len);
+ printf(msgA, FLASH_BASE + (nvramData.ulNandPartOfsKb[rootfsA] * 1024));
+ if( (ret = bootNandImageFromRootfs(start_blk, end_blk)) != 0 )
+ {
+ start_blk = nvramData.ulNandPartOfsKb[rootfsB] / len;
+ end_blk = start_blk +
+ (nvramData.ulNandPartSizeKb[rootfsB] / len);
+ printf(msgB, FLASH_BASE+(nvramData.ulNandPartOfsKb[rootfsB]*1024));
+ if( (ret = bootNandImageFromRootfs(start_blk, end_blk)) != 0 )
+ printf("Unable to boot image.\n");
+ }
+ }
+ else
+ {
+ if( pTag1 )
+ rootfsA = NP_ROOTFS_1;
+ else
+ if( pTag2 )
+ rootfsA = NP_ROOTFS_2;
+
+ if( pTag1 || pTag2 )
+ {
+ start_blk = nvramData.ulNandPartOfsKb[rootfsA] / len;
+ end_blk = start_blk +
+ (nvramData.ulNandPartSizeKb[rootfsA] / len);
+ printf("Booting from only image (0x%8.8lx) ...\n",
+ FLASH_BASE + (nvramData.ulNandPartOfsKb[rootfsA] * 1024));
+ if( (ret = bootNandImageFromRootfs(start_blk, end_blk)) != 0 )
+ printf("Unable to boot image.\n");
+ }
+ else
+ printf("No image found.\n");
+ }
+
+ return( ret );
+}
+
+static int autoRun(char *imageName)
+{
+ char ipImageName[BOOT_FILENAME_LEN + BOOT_IP_LEN];
+ int ret;
+
+ if (bootInfo.runFrom == 'f' && !imageName)
+ {
+ if (!imageName)
+ {
+ if( flash_get_flash_type() != FLASH_IFC_NAND )
+ {
+ PFILE_TAG pTag = getBootImageTag();
+ int flash_addr_kernel = atoi(pTag->kernelAddress) + BOOT_OFFSET;
+
+ ret = bootCompressedImage((unsigned int *)flash_addr_kernel, TRUE);
+ }
+ else
+ ret = bootNandImage();
+ }
+ else
+ printf("Image name not allowed for boot from flash.\n");
+ }
+ else // loading from host
+ {
+ if (imageName)
+ {
+ if (strchr(imageName, ':'))
+ strcpy(ipImageName, imageName);
+ else
+ {
+ strcpy(ipImageName, bootInfo.hostIp);
+ strcat(ipImageName, ":");
+ strcat(ipImageName, imageName);
+ }
+ }
+ else // use default host file name
+ {
+ strcpy(ipImageName, bootInfo.hostIp);
+ strcat(ipImageName, ":");
+ strcat(ipImageName, bootInfo.hostFileName);
+ }
+
+ // try uncompressed image first
+ ret = bootImage("tftp", "eth0", LOADFLG_EXECUTE | LOADFLG_NOISY, ipImageName);
+
+ if( ret == CFE_ERR_NOTELF )
+ {
+ uint8_t *ptr = (uint8_t *) KERNADDR(FLASH_STAGING_BUFFER);
+ // next try as a compressed image
+ printf("Retry loading it as a compressed image.\n");
+ if ((ret = loadRaw(ipImageName, ptr)) > 0)
+ bootCompressedImage((unsigned int *) ptr, TRUE);
+ }
+ }
+
+ return ret;
+}
+
+
+// run program from compressed image in flash or from tftped program from host
+static int ui_cmd_run_program(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int ret;
+
+ if( getBootImageTag() || bootInfo.runFrom == 'r' )
+ {
+ char *imageName;
+
+ imageName = cmd_getarg(cmd, 0);
+ g_processing_cmd = 1;
+ ret = autoRun(imageName);
+ }
+ else
+ {
+ printf("ERROR: There is not a valid image to boot from.\n");
+ ret = CFE_ERR_FILENOTFOUND;
+ }
+
+ return( ret );
+}
+
+
+static int ui_cmd_print_system_info(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ return printSysInfo();
+}
+
+static int ui_cmd_change_bootline(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ return changeBootLine();
+}
+
+static int ui_cmd_set_afe_id(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ return changeAfeId();
+}
+
+void ui_dumpaddr( unsigned char *pAddr, int nLen );
+void ui_dumpaddr( unsigned char *pAddr, int nLen )
+{
+ static char szHexChars[] = "0123456789abcdef";
+ char szLine[80];
+ char *p = szLine;
+ unsigned char ch, *q;
+ int i = 0, j, size = 0;
+ unsigned long ul;
+ unsigned short us;
+
+ if( ((unsigned long) pAddr & 0xff000000) == 0xff000000 ||
+ ((unsigned long) pAddr & 0xff000000) == 0xb0000000 )
+ {
+ if (nLen == 2) {
+ pAddr = (unsigned char *) ((unsigned long) pAddr & ~0x01);
+ } else if (nLen != 1) {
+ /* keeping the old logic as is. */
+ if( ((unsigned long) pAddr & 0x03) != 0 )
+ nLen += 4;
+ pAddr = (unsigned char *) ((unsigned long) pAddr & ~0x03);
+ }
+ }
+ while( nLen > 0 )
+ {
+ sprintf( szLine, "%8.8lx: ", (unsigned long) pAddr );
+ p = szLine + strlen(szLine);
+
+ if( ((unsigned long) pAddr & 0xff000000) == 0xff000000 ||
+ ((unsigned long) pAddr & 0xff000000) == 0xb0000000 )
+ {
+ for(i = 0; i < 6 && nLen > 0; i += sizeof(long), nLen -= sizeof(long))
+ {
+ if (nLen == 1) {
+ q = pAddr;
+ size = 1;
+ } else if (nLen == 2) {
+ us = *(unsigned short *)pAddr;
+ q = (unsigned char *) &us;
+ size = 2;
+ } else {
+ ul = *(unsigned long *) &pAddr[i];
+ q = (unsigned char *) &ul;
+ size = sizeof(long);
+ }
+ for( j = 0; j < size; j++ )
+ {
+ *p++ = szHexChars[q[j] >> 4];
+ *p++ = szHexChars[q[j] & 0x0f];
+ }
+ *p++ = ' ';
+ }
+ }
+ else
+ {
+ for(i = 0; i < 16 && nLen > 0; i++, nLen-- )
+ {
+ ch = pAddr[i];
+
+ *p++ = szHexChars[ch >> 4];
+ *p++ = szHexChars[ch & 0x0f];
+ *p++ = ' ';
+ }
+ }
+
+ for( j = 0; j < 16 - i; j++ )
+ *p++ = ' ', *p++ = ' ', *p++ = ' ';
+
+ *p++ = ' ', *p++ = ' ', *p++ = ' ';
+
+ for( j = 0; j < i; j++ )
+ {
+ ch = pAddr[j];
+ *p++ = (ch >= ' ' && ch <= '~') ? ch : '.';
+ }
+
+ *p++ = '\0';
+ printf( "%s\r\n", szLine );
+
+ pAddr += i;
+ }
+ printf( "\r\n" );
+} /* ui_dumpaddr */
+
+static int ui_cmd_dump_mem(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char *pszAddr = cmd_getarg(cmd, 0);
+ char *pszLen = cmd_getarg(cmd, 1);
+ if( pszAddr && pszLen )
+ ui_dumpaddr((unsigned char *) xtoi(pszAddr), atoi(pszLen));
+ else
+ printf("dm address_in_hex length_in_decimal\n");
+
+ return( 0 );
+}
+
+static int ui_cmd_set_mem(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char *pszAddr = cmd_getarg(cmd, 0);
+ char *pszValue = cmd_getarg(cmd, 1);
+ char *pszSize = cmd_getarg(cmd, 2);
+ if( pszAddr && pszValue && pszSize )
+ {
+ unsigned long ulAddr = (unsigned long) xtoi(pszAddr);
+ unsigned long ulValue = (unsigned long) atoi(pszValue);
+ int nSize = atoi(pszSize);
+ unsigned long *pul = (unsigned long *) ulAddr;
+ unsigned short *pus = (unsigned short *) ulAddr;
+ unsigned char *puc = (unsigned char *) ulAddr;
+ switch( nSize )
+ {
+ case 4:
+ *pul = (unsigned long) ulValue;
+ break;
+
+ case 2:
+ *pus = (unsigned short) ulValue;
+ break;
+
+ case 1:
+ *puc = (unsigned char) ulValue;
+ break;
+
+ default:
+ printf("sm address_in_hex value_in_hex size_4_2_or_1");
+ break;
+ }
+
+ ui_dumpaddr((unsigned char *) ulAddr, 4);
+ }
+ else
+ printf("sm address_in_hex value_in_hex size_4_2_or_1");
+
+ return( 0 );
+}
+
+static int ui_cmd_check_mem(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ #define RAM_BASE_ADDRESS 0xa0000000
+ #define BOOT_CODE_SIZE 256 * 1024 // 256KB
+ #define CFE_MEM_SPACE 0xa0400000
+ #define CFE_MEM_SIZE 4*1024*1024 // 4MB
+ #define MEMORY_SIZE 32*1024*1024 // 32MB
+ #define MAGIC_NUMBER 0xacacacac
+
+ #define NAND_SECTOR_SIZE (16*1024) // 16KB
+ #define NAND_TEST_SIZE (30*1024*1024) // 30MB
+
+ unsigned char *addr = NULL;
+ int pass=1;
+
+#if 0
+ unsigned int buf1[NAND_SECTOR_SIZE/4];
+ unsigned int buf2[NAND_SECTOR_SIZE/4];
+ int i, j;
+#endif
+
+ printf("Verifying DRAM access...\n");
+ for(addr=(unsigned char *)(RAM_BASE_ADDRESS+BOOT_CODE_SIZE); addr< (unsigned char *)(RAM_BASE_ADDRESS+MEMORY_SIZE); addr+=4)
+ {
+ if( addr< (unsigned char *)CFE_MEM_SPACE || addr > (unsigned char *)CFE_MEM_SPACE+CFE_MEM_SIZE )
+ {
+ *(unsigned long *)addr = MAGIC_NUMBER;
+ }
+ }
+
+ for(addr=(unsigned char *)(RAM_BASE_ADDRESS+BOOT_CODE_SIZE); addr< (unsigned char *)(RAM_BASE_ADDRESS+MEMORY_SIZE); addr+=4)
+ {
+ if( addr< (unsigned char *)CFE_MEM_SPACE || addr > (unsigned char *)CFE_MEM_SPACE+CFE_MEM_SIZE )
+ {
+ if( *(unsigned long *)addr != MAGIC_NUMBER )
+ pass=0;
+ }
+ }
+ if(pass)
+ printf("DRAM check OK!!!!\n");
+ else
+ printf("DRAM check NG!!!!\n");
+
+#if 0
+ //printf("Verifying NAND flash access...\n");
+ pass=1;
+
+ for(i=0; i<NAND_SECTOR_SIZE/4; i++)
+ {
+ buf1[i]=MAGIC_NUMBER;
+ }
+
+ /* The CFE ROM boot loader saved the rootfs partition index at the
+ * memory location before CFE RAM load address.
+ */
+ extern unsigned char _ftext;
+ int rootfs = (int) *(&_ftext - 1);
+ NVRAM_DATA nvramData;
+ int offset = 0;
+ int blk_start;
+
+ readNvramData(&nvramData);
+
+ if(rootfs == NP_ROOTFS_1 && nvramData.ulNandPartSizeKb[NP_ROOTFS_2]>0)
+ offset = nvramData.ulNandPartOfsKb[NP_ROOTFS_2] * 1024;
+ else
+ offset = nvramData.ulNandPartOfsKb[NP_ROOTFS_1] * 1024;
+
+ printf("Verifying NAND flash access from 0x%08x...\n", FLASH_BASE+offset);
+
+ for(i=0; i<NAND_TEST_SIZE/NAND_SECTOR_SIZE; i++, offset+=NAND_SECTOR_SIZE)
+ {
+ kerSysBcmImageSet(FLASH_BASE+offset, (unsigned char *)buf1, NAND_SECTOR_SIZE, 1);
+ kerSysReadFromFlash( buf2, FLASH_BASE+offset, NAND_SECTOR_SIZE );
+ blk_start = flash_get_blk(FLASH_BASE+offset);
+ flash_sector_erase_int(blk_start); // erase blk before flash
+ if( memcmp(buf1, buf2, NAND_SECTOR_SIZE))
+ {
+ printf("Failed address is 0x%08x\n", FLASH_BASE+offset);
+ for(j=0; j<NAND_SECTOR_SIZE/4; j++)
+ {
+ printf("buf2[%d]=%x\n", j, buf2[j]);
+ }
+ pass=0;
+ break;
+ }
+ }
+
+ if(pass)
+ printf("NAND flash check OK!!!!\n");
+ else
+ printf("NAND flash check NG!!!!\n");
+#endif
+
+ return( 0 );
+}
+
+extern int ui_init_netcmds(void);
+
+int ui_cmd_nmrp(ui_cmdline_t *cmd,int argc,char *argv[]);
+
+int ui_cmd_nmrp(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ _start_nmrp();
+ return 0;
+}
+
+
+int ui_cmd_flash_read(ui_cmdline_t *cmd,int argc,char *argv[]);
+
+int ui_cmd_flash_read(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char str[10];
+
+ kerSysReadFromFlash(str, BOARD_DATA_ADDR, 7);
+
+ printf("%s\n", str);
+
+ return 0;
+}
+
+int ui_cmd_write_boardid(ui_cmdline_t *cmd,int argc,char *argv[]);
+
+int ui_cmd_write_boardid(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+#if (INC_NAND_FLASH_DRIVER==1)
+ NVRAM_DATA nvramData;
+ int len;
+#endif
+
+ if ( argv[0] != NULL ) {
+#if (INC_NAND_FLASH_DRIVER==1)
+ len = strlen(argv[0]);
+ readNvramData(&nvramData);
+ memcpy(nvramData.szFirmwareUpgradeBoardId, argv[0], len);
+ writeNvramData(&nvramData);
+#else
+ kerSysBcmImageSet(BOARD_DATA_ADDR, (unsigned char *)argv[0], strlen(argv[0])+1 , 5);
+#endif
+ }
+#if (INC_NAND_FLASH_DRIVER==1)
+ else {
+ readNvramData(&nvramData);
+ }
+ printf("read board id: %s \n", nvramData.szFirmwareUpgradeBoardId);
+#endif
+ return 0;
+}
+
+/* Foxconn add start by Cliff Wang, 03/23/2010 */
+extern int ui_init_netcmds(void);
+/* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+static int ui_init_bcm63xx_cmds(void)
+{
+ console_name = fakeConsole; // for cfe_rawfs strcmp
+ // Used to flash an image that does not contain a FILE_TAG record.
+
+ /* Foxconn add start by Cliff Wang, 03/23/2010 */
+ cmd_addcmd("flashimage",
+ ui_cmd_flash_router_image,
+ NULL,
+ "Flashes a compressed image after the bootloader.",
+ "eg. flashimage [hostip:]compressed_image_file_name",
+ "");
+ /* Foxconn add end by Cliff Wang, 03/23/2010 */
+ cmd_addcmd("bid",
+ ui_cmd_write_boardid,
+ NULL,
+ "write board id to nand flash.",
+ "eg. bi str ",
+ "");
+
+ cmd_addcmd("reset",
+ ui_cmd_reset,
+ NULL,
+ "Reset the board",
+ "",
+ "");
+
+ cmd_addcmd("b",
+ ui_cmd_set_board_param,
+ NULL,
+ "Change board parameters",
+ "",
+ "");
+
+ cmd_addcmd("a",
+ ui_cmd_set_afe_id,
+ NULL,
+ "Change board AFE ID",
+ "",
+ "");
+
+ cmd_addcmd("i",
+ ui_cmd_erase_psi,
+ NULL,
+ "Erase persistent storage data",
+ "",
+ "");
+
+ if( flash_get_flash_type() != FLASH_IFC_NAND )
+ cmd_addcmd("f",
+ ui_cmd_flash_image,
+ NULL,
+ "Write image to the flash ",
+ "eg. f [[hostip:]filename]<cr> -- if no filename, tftped from host with file name in 'Default host flash file name'",
+ "");
+
+ cmd_addcmd("c",
+ ui_cmd_change_bootline,
+ NULL,
+ "Change booline parameters",
+ "",
+ "");
+
+ cmd_addcmd("p",
+ ui_cmd_print_system_info,
+ NULL,
+ "Print boot line and board parameter info",
+ "",
+ "");
+
+ cmd_addcmd("r",
+ ui_cmd_run_program,
+ NULL,
+ "Run program from flash image or from host depend on [f/h] flag",
+ "eg. r [[hostip:]filenaem]<cr> if no filename, use the file name in 'Default host run file name'",
+ "");
+
+#if (INC_SPI_PROG_NAND==1)
+ cmd_addcmd("n",
+ ui_cmd_erase_nand,
+ NULL,
+ "Erase NAND flash",
+ "e [a]",
+ "");
+#else
+ if( flash_get_flash_type() == FLASH_IFC_NAND )
+ cmd_addcmd("e",
+ ui_cmd_erase_nand,
+ NULL,
+ "Erase NAND flash",
+ "e [a]",
+ "");
+ else
+#endif
+ cmd_addcmd("e",
+ ui_cmd_erase,
+ NULL,
+ "Erase [n]vram or [a]ll flash except bootrom",
+ "e [n/a]",
+ "");
+
+ cmd_addcmd("w",
+ ui_cmd_write_whole_image,
+ NULL,
+ "Write the whole image start from beginning of the flash",
+ "eg. w [hostip:]whole_image_file_name",
+ "");
+
+ cmd_addcmd("chw",
+ ui_cmd_write_chk_image,
+ NULL,
+ "Write chkw image start from beginning of the flash",
+ "eg. chkw [hostip:]whole_image_file_name",
+ "");
+
+ cmd_addcmd("dm",
+ ui_cmd_dump_mem,
+ NULL,
+ "Dump memory or registers.",
+ "eg. dm address_in_hex length_in_decimal",
+ "");
+
+ cmd_addcmd("sm",
+ ui_cmd_set_mem,
+ NULL,
+ "Set memory or registers.",
+ "eg. sm address_in_hex value_in_hex size_4_2_or_1",
+ "");
+
+ cmd_addcmd("nmrp",
+ ui_cmd_nmrp,
+ NULL,
+ "start memory or registers.",
+ "eg. nmrp ",
+ "");
+
+ cmd_addcmd("fr",
+ ui_cmd_flash_read,
+ NULL,
+ "read data from flash.",
+ "eg. fr addr ",
+ "");
+
+ /* Foxconn add start by Cliff Wang, 03/23/2010 */
+ cmd_addcmd("checkmem",
+ ui_cmd_check_mem,
+ NULL,
+ "Check memory.",
+ "Check memory.",
+ "");
+
+ ui_init_tftpdcmds();
+ /* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+ return 0;
+}
+
+
+static int runDelay(int delayCount)
+{
+ int goAuto = 0;
+
+ if (delayCount == 0)
+ return goAuto;
+
+ printf("*** Press any key to stop auto run (%d seconds) ***\n", delayCount);
+ printf("Auto run second count down: %d", delayCount);
+
+ cfe_sleep(CFE_HZ/8); // about 1/4 second
+
+ while (1)
+ {
+ printf("\b%d", delayCount);
+ cfe_sleep(CFE_HZ); // about 1 second
+ if (console_status())
+ break;
+ if (--delayCount == 0)
+ {
+ goAuto = 1;
+ break;
+ }
+ }
+ printf("\b%d\n", delayCount);
+
+ return goAuto;
+}
+
+
+int bcm63xx_run(int breakIntoCfe)
+{
+ int goAuto;
+
+ ui_init_bcm63xx_cmds();
+ printSysInfo();
+ enet_init();
+
+ goAuto = runDelay(bootInfo.bootDelay);
+ if (!breakIntoCfe && runDelay(bootInfo.bootDelay))
+ {
+ /* Foxconn add start by Cliff Wang, 03/23/2010 */
+ if(_start_nmrp() != 0)
+ autoRun(NULL); // never returns
+ /* Foxconn add end by Cliff Wang, 03/23/2010 */
+ }
+ return goAuto;
+}
+
+
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_devs.c b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_devs.c
new file mode 100755
index 0000000..ac75083
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_devs.c
@@ -0,0 +1,734 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Board device initialization File: bcm94710_devs.c
+ *
+ * This is the "C" part of the board support package. The
+ * routines to create and initialize the console, wire up
+ * device drivers, and do other customization live here.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * XX Copyright 2000,2001
+ * Broadcom Corporation. All rights reserved.
+ *
+ * BROADCOM PROPRIETARY AND CONFIDENTIAL
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the license.
+ ********************************************************************* */
+
+#include "lib_types.h"
+#include "lib_printf.h"
+
+/* Foxconn add start by Cliff Wang, 03/23/2010 */
+#include "lib_string.h"
+/* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+#include "cfe_timer.h"
+#include "cfe.h"
+#include "bcm_map.h"
+#include "bcm_hwdefs.h"
+#include "bcmTag.h"
+#include "dev_bcm63xx_flash.h"
+#include "bcm63xx_util.h"
+#include "flash_api.h"
+
+/* Foxconn add start by Cliff Wang, 03/23/2010 */
+#include "tftpd.h"
+/* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+static int checkForResetToDefaultHold( unsigned short rstToDfltIrq );
+
+/* Foxconn added start , 1/29/2010 */
+#include "gpio_drv.h"
+#include "foxconnCfg.h"
+
+typedef enum
+{
+ kGpioInactive,
+ kGpioActive
+} GPIO_STATE_t;
+static int test_led_control(int on_off);
+int power_led_toggle(int state);
+int nmrp_led_toggle(void);
+int verify_board_id(char *buf);
+int verify_checksum(char *buf, unsigned long buf_len, unsigned long chksum);
+#define NR_LED 24
+/* Foxconn added end , 1/29/2010 */
+
+/* *********************************************************************
+ * Devices we're importing
+ ********************************************************************* */
+
+extern cfe_driver_t bcm63xx_uart;
+extern cfe_driver_t bcm63xx_enet;
+
+/* *********************************************************************
+ * board_console_init()
+ *
+ * Add the console device and set it to be the primary
+ * console.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void board_console_init(void)
+{
+ /* Add the serial port driver. */
+ cfe_add_device(&bcm63xx_uart,0,0,0);
+
+ cfe_set_console( "uart0" );
+}
+
+
+/* *********************************************************************
+ * board_device_init()
+ *
+ * Initialize and add other devices. Add everything you need
+ * for bootstrap here, like disk drives, flash memory, UARTs,
+ * network controllers, etc.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void board_device_init(void)
+{
+ unsigned short GPIOOverlays;
+
+ kerSysFlashInit();
+
+#if defined (_BCM96328_)
+ if( BpGetGPIOverlays(&GPIOOverlays) == BP_SUCCESS ) {
+ /* Start with all HW LEDs disabled */
+ LED->ledHWDis |= 0xFFFFFF;
+ if (GPIOOverlays & BP_OVERLAY_SERIAL_LEDS) {
+ GPIO->PinMuxSel |= PINMUX_SERIAL_LED_DATA;
+ GPIO->PinMuxSel |= PINMUX_SERIAL_LED_CLK;
+ LED->ledInit |= LED_SERIAL_LED_EN;
+ }
+ /* Enable LED controller to drive GPIO */
+ /* foxconn modified start to let hardware control only act LEDs, Bob, 08/04/2010 */
+ if (GPIOOverlays & BP_OVERLAY_EPHY_LED_0) {
+ GPIO->PinMuxSel |= PINMUX_EPHY0_ACT_LED;
+ //GPIO->GPIOMode |= (1 << EPHY0_SPD_LED);
+ //LED->ledHWDis &= ~(1 << EPHY0_SPD_LED);
+ }
+ if (GPIOOverlays & BP_OVERLAY_EPHY_LED_1) {
+ GPIO->PinMuxSel |= PINMUX_EPHY1_ACT_LED;
+ //GPIO->GPIOMode |= (1 << EPHY1_SPD_LED);
+ //LED->ledHWDis &= ~(1 << EPHY1_SPD_LED);
+ }
+ if (GPIOOverlays & BP_OVERLAY_EPHY_LED_2) {
+ GPIO->PinMuxSel |= PINMUX_EPHY2_ACT_LED;
+ //GPIO->GPIOMode |= (1 << EPHY2_SPD_LED);
+ //LED->ledHWDis &= ~(1 << EPHY2_SPD_LED);
+ }
+ if (GPIOOverlays & BP_OVERLAY_EPHY_LED_3) {
+ GPIO->PinMuxSel |= PINMUX_EPHY3_ACT_LED;
+ //GPIO->GPIOMode |= (1 << EPHY3_SPD_LED);
+ //LED->ledHWDis &= ~(1 << EPHY3_SPD_LED);
+ }
+ /* foxconn modified end, Bob, 08/04/2010 */
+ }
+#endif
+
+#if defined (_BCM96362_)
+ if( BpGetGPIOverlays(&GPIOOverlays) == BP_SUCCESS ) {
+ /* Start with all HW LEDs disabled */
+ LED->ledHWDis |= 0xFFFFFF;
+ if (GPIOOverlays & BP_OVERLAY_SERIAL_LEDS) {
+ GPIO->GPIOMode |= (GPIO_MODE_SERIAL_LED_CLK | GPIO_MODE_SERIAL_LED_DATA);
+ LED->ledInit |= LED_SERIAL_LED_EN;
+ }
+ /* Map HW LEDs to LED controller inputs and enable LED controller to drive GPIO */
+ if (GPIOOverlays & BP_OVERLAY_EPHY_LED_0) {
+ LED->ledLinkActSelHigh |= ((1 << (LED_ENET0 - 4)) << LED_4_LINK_SHIFT);
+ GPIO->LEDCtrl |= (1 << LED_ENET0);
+ LED->ledHWDis &= ~(1 << LED_ENET0);
+ }
+ if (GPIOOverlays & BP_OVERLAY_EPHY_LED_1) {
+ LED->ledLinkActSelHigh |= ((1 << (LED_ENET1 - 4)) << LED_5_LINK_SHIFT);
+ GPIO->LEDCtrl |= (1 << LED_ENET1);
+ LED->ledHWDis &= ~(1 << LED_ENET1);
+ }
+ if (GPIOOverlays & BP_OVERLAY_EPHY_LED_2) {
+ LED->ledLinkActSelHigh |= ((1 << (LED_ENET2 - 4)) << LED_6_LINK_SHIFT);
+ GPIO->LEDCtrl |= (1 << LED_ENET2);
+ LED->ledHWDis &= ~(1 << LED_ENET2);
+ }
+ if (GPIOOverlays & BP_OVERLAY_EPHY_LED_3) {
+ LED->ledLinkActSelHigh |= ((1 << (LED_ENET3 - 4)) << LED_7_LINK_SHIFT);
+ GPIO->LEDCtrl |= (1 << LED_ENET3);
+ LED->ledHWDis &= ~(1 << LED_ENET3);
+ }
+ }
+#endif
+
+#if defined (_BCM96368_)
+ TIMER->WDResetCount = 50000; // Assert reset for 1ms only. If reset asserted for too
+ // long chip reboots twice
+ if( BpGetGPIOverlays(&GPIOOverlays) == BP_SUCCESS ) {
+ if (GPIOOverlays & BP_OVERLAY_EPHY_LED_0) {
+ GPIO->GPIOMode |= GPIO_MODE_EPHY0_LED;
+ GPIO->GPIODir |= GPIO_MODE_EPHY0_LED;
+ }
+
+ if (GPIOOverlays & BP_OVERLAY_EPHY_LED_1) {
+ GPIO->GPIOMode |= GPIO_MODE_EPHY1_LED;
+ GPIO->GPIODir |= GPIO_MODE_EPHY1_LED;
+ }
+
+ if (GPIOOverlays & BP_OVERLAY_EPHY_LED_2) {
+ GPIO->GPIOMode |= GPIO_MODE_EPHY2_LED;
+ GPIO->GPIODir |= GPIO_MODE_EPHY2_LED;
+ }
+
+ if (GPIOOverlays & BP_OVERLAY_EPHY_LED_3) {
+ GPIO->GPIOMode |= GPIO_MODE_EPHY3_LED;
+ GPIO->GPIODir |= GPIO_MODE_EPHY3_LED;
+ }
+
+ if (GPIOOverlays & BP_OVERLAY_SERIAL_LEDS) {
+ GPIO->GPIOMode |= (GPIO_MODE_SERIAL_LED_CLK | GPIO_MODE_SERIAL_LED_DATA);
+ GPIO->GPIODir |= (GPIO_MODE_SERIAL_LED_CLK | GPIO_MODE_SERIAL_LED_DATA);
+ GPIO->SerialLed = 0xffffffff;
+ }
+ }
+
+ /* These blocks will be enabled by the appropriate driver if they are
+ * compiled into a router image.
+ */
+ PERF->blkEnables &= ~(USBH_CLK_EN | PCM_CLK_EN | SAR_CLK_EN | USBD_CLK_EN);
+#endif
+
+#if defined (_BCM96816_)
+ TIMER->WDResetCount = 50000; // Assert reset for 1ms only. If reset asserted for too
+ // long chip reboots twice
+
+ if( BpGetGPIOverlays(&GPIOOverlays) == BP_SUCCESS ) {
+ if (GPIOOverlays & BP_OVERLAY_GPHY_LED_0) {
+ GPIO->GPIOMode |= GPIO_MODE_GPHY0_LED;
+ GPIO->GPIODir |= GPIO_MODE_GPHY0_LED;
+ }
+
+ if (GPIOOverlays & BP_OVERLAY_GPHY_LED_1) {
+ GPIO->GPIOMode |= GPIO_MODE_GPHY1_LED;
+ GPIO->GPIODir |= GPIO_MODE_GPHY1_LED;
+ }
+
+ if (GPIOOverlays & BP_OVERLAY_SERIAL_LEDS) {
+ GPIO->GPIOMode |= (GPIO_MODE_SERIAL_LED_CLK | GPIO_MODE_SERIAL_LED_DATA);
+ GPIO->GPIODir |= (GPIO_MODE_SERIAL_LED_CLK | GPIO_MODE_SERIAL_LED_DATA);
+ GPIO->SerialLed = 0xffffffff;
+ }
+
+ if (GPIOOverlays & BP_OVERLAY_MOCA_LED) {
+ GPIO->GPIOMode |= GPIO_MODE_MOCA_LED;
+ GPIO->GPIODir |= GPIO_MODE_MOCA_LED;
+ }
+ }
+
+ MISC->miscMoCARst &= ~(MISC_MOCA_RST_REF_DIV2RST | MISC_MOCA_RST_REF_FBDIVRST);
+ MISC->miscMoCARst &= ~MISC_MOCA_RST_REF_VCRST;
+ MISC->miscMoCARst &= ~(MISC_MOCA_RST_REF_OUTDIV_RESET_M_MASK | MISC_MOCA_RST_REF_MDIV2RST);
+ MISC->miscMoCACtl |= (7 << MISC_MOCA_CTL_REF_QP_ICTRL_SHIFT);
+ MISC->miscMoCARst &= ~MISC_MOCA_RST_REF_LD_RESET_STRT;
+ PERF->softResetB &= ~(SOFT_RST_MOCA_CPU | SOFT_RST_MOCA_SYS | SOFT_RST_MOCA);
+#endif
+
+#if defined (_BCM96328_) || defined (_BCM96362_)
+ LED->ledInit &= ~LED_FAST_INTV_MASK;
+ LED->ledInit |= (LED_INTERVAL_20MS * 4) << LED_FAST_INTV_SHIFT;
+#else
+ /* Set blink rate for hardware LEDs. */
+ GPIO->LEDCtrl &= ~LED_INTERVAL_SET_MASK;
+ GPIO->LEDCtrl |= LED_INTERVAL_SET_80MS;
+#endif
+
+ /* Add the ethernet driver. */
+ cfe_add_device( &bcm63xx_enet, 0, 0, 0);
+}
+
+
+void setGpio (unsigned short led_gpio, unsigned short led_state)
+{
+#if 0
+ unsigned short gpio_state;
+
+ if (((led_gpio & BP_ACTIVE_LOW) && (led_state == LED_ON)) ||
+ (!(led_gpio & BP_ACTIVE_LOW) && (led_state == LED_OFF)))
+ gpio_state = 0;
+ else
+ gpio_state = 1;
+#endif
+
+ GPIO->GPIODir |= GPIO_NUM_TO_MASK(led_gpio);
+ if( led_state )
+ GPIO->GPIOio |= GPIO_NUM_TO_MASK(led_gpio);
+ else
+ GPIO->GPIOio &= ~GPIO_NUM_TO_MASK(led_gpio);
+}
+
+
+/* *********************************************************************
+ * board_final_init()
+ *
+ * Do any final initialization, such as adding commands to the
+ * user interface.
+ *
+ * If you don't want a user interface, put the startup code here.
+ * This routine is called just before CFE starts its user interface.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void board_final_init(void)
+{
+ unsigned short rstToDfltIrq;
+ int breakIntoCfe = 0;
+
+ /* Foxconn add start by Cliff Wang, 03/23/2010 */
+ int goAuto;
+ /* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+ setAllLedsOff();
+ setPowerOnLedOn();
+ setGpio(GPIO_POWER_RED_LED, GPIO_POWER_RED_LED_ON);
+#if (INC_SPI_PROG_NAND==1)
+ rstToDfltIrq = 1 ;
+ breakIntoCfe = rstToDfltIrq;
+#else
+ if( (bootInfo.runFrom == 'f') && getBootImageTag() == NULL ) {
+ setBreakIntoCfeLed();
+ printf("** Flash image not found. **\n\n");
+ kerSysErasePsi();
+ breakIntoCfe = 1;
+ }
+
+ if( BpGetResetToDefaultExtIntr( &rstToDfltIrq ) == BP_SUCCESS ) {
+ if (checkForResetToDefaultHold( rstToDfltIrq )) {
+ kerSysErasePsi();
+ /* Reset the default bootline if the board IP address has changed. */
+ if (strcmp(bootInfo.boardIp, DEFAULT_BOARD_IP) != 0) {
+ setDefaultBootline();
+ }
+ /* Foxconn modified start pling 09/09/2008 */
+ /* just load default, don't break into console */
+ //breakIntoCfe = 1;
+ printf("\n** Load default! **\n\n");
+ /* Foxconn modified end pling 09/09/2008 */
+ }
+ }
+#endif
+ /* Foxconn add start by Cliff Wang, 03/23/2010 */
+ goAuto = bcm63xx_run(breakIntoCfe);
+ setBreakIntoCfeLed();
+ if(goAuto)
+ {
+ ui_docommand("tftpd");
+ }
+ /* Foxconn add end by Cliff Wang, 03/23/2010 */
+}
+
+/* *********************************************************************
+ * Miscellaneous Board Functions
+ ********************************************************************* */
+
+/* *********************************************************************
+ * checkForResetToDefaultHold()
+ *
+ * Determines if the user is holding the reset to default button.
+ *
+ * Input parameters:
+ * Reset to default irq#
+ *
+ * Return value:
+ * 1 - break into the CFE, 0 - continue boot sequence
+ ********************************************************************* */
+#if (INC_SPI_PROG_NAND==0)
+static int checkForResetToDefaultHold( unsigned short rstToDfltIrq )
+{
+ const int nBreakIntoCfeDelay = 5;
+ int ret = 0;
+ int i;
+ uint32 irqBit;
+ volatile uint32 *extIrqReg;
+
+ extIrqReg = &PERF->ExtIrqCfg;
+ irqBit = 1 << (rstToDfltIrq + EI_STATUS_SHFT);
+
+#if defined(_BCM96368_)
+ if (rstToDfltIrq >= BP_EXT_INTR_4 && rstToDfltIrq <= BP_EXT_INTR_5) {
+ extIrqReg = &PERF->ExtIrqCfg1;
+ irqBit = 1 << (rstToDfltIrq - BP_EXT_INTR_4 + EI_STATUS_SHFT);
+ }
+#endif
+
+ /* Loop while the reset to default button is depressed. */
+ for(i = 0; !(*extIrqReg & irqBit); i++) {
+ if (i == nBreakIntoCfeDelay) {
+ setBreakIntoCfeLed();
+ printf("\n*** Break into CFE console ***\n\n");
+ ret = 1;
+ break;
+ }
+ cfe_sleep(CFE_HZ);
+ }
+
+ return( ret );
+}
+#endif
+/* *********************************************************************
+ * setLed(led_gpio, led_state)
+ *
+ * Turns on an LED.
+ *
+ * Input parameters:
+ * LED purpose
+ * LED State
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void setLed (unsigned short led_gpio, unsigned short led_state)
+{
+ unsigned short gpio_state;
+
+ if (((led_gpio & BP_ACTIVE_LOW) && (led_state == LED_ON)) ||
+ (!(led_gpio & BP_ACTIVE_LOW) && (led_state == LED_OFF)))
+ gpio_state = 0;
+ else
+ gpio_state = 1;
+
+#if defined(_BCM96328_)
+ /* Enable LED controller to drive this GPIO */
+ if (!(led_gpio & BP_GPIO_SERIAL))
+ GPIO->GPIOMode |= GPIO_NUM_TO_MASK(led_gpio);
+#endif
+
+#if defined(_BCM96362_)
+ /* Enable LED controller to drive this GPIO */
+ if (!(led_gpio & BP_GPIO_SERIAL))
+ GPIO->LEDCtrl |= GPIO_NUM_TO_MASK(led_gpio);
+#endif
+
+#if defined(_BCM96328_) || defined(_BCM96362_)
+ LED->ledMode &= ~(LED_MODE_MASK << GPIO_NUM_TO_LED_MODE_SHIFT(led_gpio));
+ if( gpio_state )
+ LED->ledMode |= (LED_MODE_OFF << GPIO_NUM_TO_LED_MODE_SHIFT(led_gpio));
+ else
+ LED->ledMode |= (LED_MODE_ON << GPIO_NUM_TO_LED_MODE_SHIFT(led_gpio));
+
+#else
+ if (led_gpio & BP_GPIO_SERIAL) {
+ while (GPIO->SerialLedCtrl & SER_LED_BUSY);
+ if( gpio_state )
+ GPIO->SerialLed |= GPIO_NUM_TO_MASK(led_gpio);
+ else
+ GPIO->SerialLed &= ~GPIO_NUM_TO_MASK(led_gpio);
+ }
+ else {
+ GPIO->GPIODir |= GPIO_NUM_TO_MASK(led_gpio);
+ if( gpio_state )
+ GPIO->GPIOio |= GPIO_NUM_TO_MASK(led_gpio);
+ else
+ GPIO->GPIOio &= ~GPIO_NUM_TO_MASK(led_gpio);
+ }
+#endif
+}
+
+/* *********************************************************************
+ * setAllLedsOff()
+ *
+ * Turns off all board LEDs on init
+ *
+ * Input parameters:
+ * LED purpose
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void setAllLedsOff(void)
+{
+ unsigned short gpio;
+
+ if( BpGetAdslLedGpio( &gpio ) == BP_SUCCESS )
+ setLed( gpio, LED_OFF );
+ if( BpGetAdslFailLedGpio( &gpio ) == BP_SUCCESS )
+ setLed( gpio, LED_OFF );
+ if( BpGetSecAdslLedGpio( &gpio ) == BP_SUCCESS )
+ setLed( gpio, LED_OFF );
+ if( BpGetSecAdslFailLedGpio( &gpio ) == BP_SUCCESS )
+ setLed( gpio, LED_OFF );
+ if( BpGetWirelessSesLedGpio( &gpio ) == BP_SUCCESS )
+ setLed( gpio, LED_OFF );
+ if( BpGetHpnaLedGpio( &gpio ) == BP_SUCCESS )
+ setLed( gpio, LED_OFF );
+ if( BpGetWanDataLedGpio( &gpio ) == BP_SUCCESS )
+ setLed( gpio, LED_OFF );
+ if( BpGetWanErrorLedGpio( &gpio ) == BP_SUCCESS )
+ setLed( gpio, LED_OFF );
+ if( BpGetBootloaderPowerOnLedGpio( &gpio ) == BP_SUCCESS )
+ setLed( gpio, LED_OFF );
+ if( BpGetBootloaderStopLedGpio( &gpio ) == BP_SUCCESS )
+ setLed( gpio, LED_OFF );
+ if( BpGetVoipLedGpio( &gpio ) == BP_SUCCESS )
+ setLed( gpio, LED_OFF );
+ if( BpGetVoip1LedGpio( &gpio ) == BP_SUCCESS )
+ setLed( gpio, LED_OFF );
+ if( BpGetVoip2LedGpio( &gpio ) == BP_SUCCESS )
+ setLed( gpio, LED_OFF );
+ if( BpGetPotsLedGpio( &gpio ) == BP_SUCCESS )
+ setLed( gpio, LED_OFF );
+ if( BpGetGponLedGpio( &gpio ) == BP_SUCCESS )
+ setLed( gpio, LED_OFF );
+ if( BpGetMoCALedGpio( &gpio ) == BP_SUCCESS )
+ setLed( gpio, LED_OFF );
+ if( BpGetGponFailLedGpio( &gpio ) == BP_SUCCESS )
+ setLed( gpio, LED_OFF );
+ if( BpGetMoCAFailLedGpio( &gpio ) == BP_SUCCESS )
+ setLed( gpio, LED_OFF );
+}
+
+/* *********************************************************************
+ * setPowerOnLedOn()
+ *
+ * Turns on the Power LED.
+ *
+ * Input parameters:
+ * LED purpose
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void setPowerOnLedOn(void)
+{
+ unsigned short gpio;
+ if( BpGetBootloaderStopLedGpio( &gpio ) == BP_SUCCESS )
+ setLed( gpio, LED_OFF );
+ if( BpGetBootloaderPowerOnLedGpio( &gpio ) == BP_SUCCESS )
+ setLed( gpio, LED_ON );
+}
+
+
+/* *********************************************************************
+ * setBreakIntoCfeLed()
+ *
+ * Turns on the alarm LED.
+ *
+ * Input parameters:
+ * LED purpose
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void setBreakIntoCfeLed(void)
+{
+ unsigned short gpio;
+ if( BpGetBootloaderStopLedGpio( &gpio ) == BP_SUCCESS ) {
+ setLed( gpio, LED_ON );
+ if( BpGetBootloaderPowerOnLedGpio( &gpio ) == BP_SUCCESS )
+ setLed( gpio, LED_OFF );
+ }
+}
+
+/* *********************************************************************
+ * softReset()
+ *
+ * Resets the board.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void softReset(void)
+{
+ printf( "\nResetting board...\n" );
+#if defined (_BCM96816_)
+ /* Work around reset issues */
+ HVG->reg_hvg_cha_misc |= HVG_SOFT_INIT_0;
+ HVG->reg_hvg_chb_misc |= HVG_SOFT_INIT_0;
+#endif
+
+#if defined(_BCM96328_)
+ TIMER->SoftRst |= SOFT_RESET;
+#else
+ PERF->pll_control |= SOFT_RESET; // soft reset mips
+#if defined(_BCM96368_) || defined(_BCM96816_)
+ PERF->pll_control = 0;
+#endif
+#endif
+ while (1);
+}
+
+/* Foxconn added start , 1/29/2010 */
+extern int nmrp_server_detected;
+
+int test_led_control(int on_off)
+{
+ // unsigned short gpio;
+ int tftpd_state = get_tftpd_state();
+
+ if (tftpd_state == TFTPD_STATE_OFF)
+ {
+ setGpio(GPIO_POWER_RED_LED, GPIO_POWER_RED_LED_ON); //turn red power led
+ }
+ else if ( (tftpd_state == TFTPD_STATE_WAIT_IMAGE) || (tftpd_state == TFTPD_STATE_WRITE_IMAGE) )
+ {
+ if (on_off==1)
+ {
+ setGpio(GPIO_POWER_RED_LED, GPIO_POWER_RED_LED_ON);
+ }
+ else
+ {
+ setGpio(GPIO_POWER_RED_LED, GPIO_POWER_RED_LED_OFF);
+ }
+ }
+
+ return 0;
+}
+
+int power_led_toggle(int state)
+{
+ test_led_control(state);
+ return 0;
+}
+
+int nmrp_led_toggle(void)
+{
+ static int led_state = 0;
+
+ /* Foxconn added end for U12H154 */
+
+ if (led_state == 0)
+ {
+ led_state = 1;
+ setGpio(18, 1);
+ }
+ else
+ {
+ led_state = 0;
+ setGpio(18, 0);
+ }
+
+ return 0;
+}
+
+
+static unsigned long calculate_checksum (int action, char *s, int size)
+{
+ static unsigned long c0, c1;
+ unsigned long checksum, b;
+ int i;
+ switch (action)
+ {
+ case 0:
+ c0 = c1 = 0;
+ break;
+
+ case 1:
+ for (i = 0; i < size; i++)
+ {
+ c0 += s[i] & 0xff;
+ c1 += c0;
+ /* check the lan/wan ports status, Foxconn added by EricHuang, 10/24/2006 */
+ if ((i % 90000) == 0)
+ {
+ printf(".");
+// bcm_robo_check_link_status();
+ }
+ }
+ break;
+
+ case 2:
+ b = (c0 & 65535) + ((c0 >> 16) & 65535);
+ c0 = ((b >> 16) + b) & 65535;
+
+ b = (c1 & 65535) + ((c1 >> 16) & 65535);
+ c1 = ((b >> 16) + b) & 65535;
+
+ checksum = ((c1 << 16) | c0);
+
+ return checksum;
+ }
+ return 0;
+}
+
+int verify_checksum(char *buf, unsigned long buf_len, unsigned long chksum)
+{
+ unsigned long cal_chksum = 0;
+
+ xprintf("Loading .");
+ calculate_checksum (0, NULL, 0);
+ calculate_checksum (1, buf, buf_len);
+ cal_chksum = calculate_checksum (2, NULL, 0);
+ printf("\n");
+
+
+ if (cal_chksum != chksum) {
+ xprintf("Image chksum: 0x%08X\n", chksum);
+ xprintf("Calc chksum: 0x%08X\n", cal_chksum);
+ return -1;
+ }
+
+#ifdef _DEBUG
+ //printf("verify_checksum calculate_checksum = 0x%08X\n", cal_chksum);
+ //printf("verify_checksum image_chksum = 0x%08X\n", chksum);
+#endif
+
+ return 0;
+}
+
+int verify_board_id(char *buf)
+{
+ /* char *board_id = ( char *)BOARD_DATA_ADDR; */
+ char board_id[PROJECT_ID_LEN];
+
+ kerSysReadFromFlash(board_id, BOARD_DATA_ADDR, PROJECT_ID_LEN);
+
+ if(nmrp_server_detected==1) // in NMRP mode
+ {
+ if (strncmp(buf, board_id, PROJECT_ID_LEN) != 0)
+ {
+ printf("verify_board_id failed: (%s)\n", buf);
+ return -1;
+ }
+ }
+ else
+ {
+ if (strcmp(buf, board_id) != 0)
+ {
+ /* Foxconn removed start pling 12/10/2008 */
+ /* Don't check board ID in 'tftpd' mode */
+ printf("verify_board_id failed: (%s)\n", buf);
+ //return -1;
+ /* Foxconn removed end pling 12/10/2008 */
+ }
+ }
+ return 0;
+}
+
+/* Foxconn added end , 1/29/2010 */
+
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_env_subr.c b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_env_subr.c
new file mode 100755
index 0000000..3ce3a28
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_env_subr.c
@@ -0,0 +1,277 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Environment variable subroutines File: env_subr.c
+ *
+ * This module contains routines to muck with environment variables
+ * (manage the list, read/write to nvram, etc.)
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "env_subr.h"
+///#include "nvram_subr.h"
+
+#include "cfe_error.h"
+#include "cfe.h"
+
+/* *********************************************************************
+ * Types
+ ********************************************************************* */
+
+typedef struct cfe_envvar_s {
+ queue_t qb;
+ int flags;
+ char *name;
+ char *value;
+ /* name and value go here */
+} cfe_envvar_t;
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+queue_t env_envvars = {&env_envvars,&env_envvars};
+extern unsigned int cfe_startflags;
+
+/* *********************************************************************
+ * env_findenv(name)
+ *
+ * Locate an environment variable in the in-memory list
+ *
+ * Input parameters:
+ * name - name of env var to find
+ *
+ * Return value:
+ * cfe_envvar_t pointer, or NULL if not found
+ ********************************************************************* */
+
+static cfe_envvar_t *env_findenv(const char *name)
+{
+ queue_t *qb;
+ cfe_envvar_t *env;
+
+ for (qb = env_envvars.q_next; qb != &env_envvars; qb = qb->q_next) {
+ env = (cfe_envvar_t *) qb;
+ if (strcmp(env->name,name) == 0) break;
+ }
+
+ if (qb == &env_envvars) return NULL;
+
+ return (cfe_envvar_t *) qb;
+
+}
+
+/* *********************************************************************
+ * env_enum(idx,name,namelen,val,vallen)
+ *
+ * Enumerate environment variables. This routine locates
+ * the nth environment variable and copies its name and value
+ * to user buffers.
+ *
+ * The namelen and vallen variables must be preinitialized to
+ * the maximum size of the output buffer.
+ *
+ * Input parameters:
+ * idx - variable index to find (starting with zero)
+ * name,namelen - name buffer and length
+ * val,vallen - value buffer and length
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int env_enum(int idx,char *name,int *namelen,char *val,int *vallen)
+{
+ queue_t *qb;
+ cfe_envvar_t *env;
+
+ for (qb = env_envvars.q_next; qb != &env_envvars; qb = qb->q_next) {
+ if (idx == 0) break;
+ idx--;
+ }
+
+ if (qb == &env_envvars) return CFE_ERR_ENVNOTFOUND;
+ env = (cfe_envvar_t *) qb;
+
+ *namelen = xstrncpy(name,env->name,*namelen);
+ *vallen = xstrncpy(val,env->value,*vallen);
+
+ return 0;
+
+}
+
+/* *********************************************************************
+ * env_envtype(name)
+ *
+ * Return the type of the environment variable
+ *
+ * Input parameters:
+ * name - name of environment variable
+ *
+ * Return value:
+ * flags, or <0 if error occured
+ ********************************************************************* */
+int env_envtype(const char *name)
+{
+ cfe_envvar_t *env;
+
+ env = env_findenv(name);
+
+ if (env) {
+ return env->flags;
+ }
+
+ return CFE_ERR_ENVNOTFOUND;
+}
+
+
+
+/* *********************************************************************
+ * env_delenv(name)
+ *
+ * Delete an environment variable
+ *
+ * Input parameters:
+ * name - environment variable to delete
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int env_delenv(const char *name)
+{
+ cfe_envvar_t *env;
+
+ env = env_findenv(name);
+
+ if (!env) return 0;
+
+ if (!(env->flags & ENV_FLG_READONLY)) {
+ q_dequeue((queue_t *) env);
+ KFREE(env);
+ return 0;
+ }
+
+ return CFE_ERR_ENVNOTFOUND;
+}
+
+/* *********************************************************************
+ * env_getenv(name)
+ *
+ * Retrieve the value of an environment variable
+ *
+ * Input parameters:
+ * name - name of environment variable to find
+ *
+ * Return value:
+ * value, or NULL if variable is not found
+ ********************************************************************* */
+
+char *env_getenv(const char *name)
+{
+ cfe_envvar_t *env;
+
+ env = env_findenv(name);
+
+ if (env) {
+ return env->value;
+ }
+
+ return NULL;
+}
+
+
+/* *********************************************************************
+ * env_setenv(name,value,flags)
+ *
+ * Set the value of an environment variable
+ *
+ * Input parameters:
+ * name - name of variable
+ * value - value of variable
+ * flags - flags for variable (ENV_FLG_xxx)
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int env_setenv(const char *name,char *value,int flags)
+{
+ cfe_envvar_t *env;
+ int namelen;
+
+ env = env_findenv(name);
+ if (env) {
+ if (!(flags & ENV_FLG_ADMIN)) {
+ if (env->flags & ENV_FLG_READONLY) return CFE_ERR_ENVREADONLY;
+ }
+ q_dequeue((queue_t *) env);
+ KFREE(env);
+ }
+
+ namelen = strlen(name);
+
+ env = KMALLOC(sizeof(cfe_envvar_t) + namelen + 1 + strlen(value) + 1,0);
+ if (!env) return CFE_ERR_NOMEM;
+
+ env->name = (char *) (env+1);
+ env->value = env->name + namelen + 1;
+ env->flags = (flags & ENV_FLG_MASK);
+
+ strcpy(env->name,name);
+ strcpy(env->value,value);
+
+ q_enqueue(&env_envvars,(queue_t *) env);
+
+ return 0;
+}
+int env_save(void)
+{
+ return 0;
+}
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_httpd.c b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_httpd.c
new file mode 100755
index 0000000..dcd5b0a
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_httpd.c
@@ -0,0 +1,1031 @@
+/* milli_httpd - pretty small HTTP server
+** A combination of
+** micro_httpd - really small HTTP server
+** and
+** mini_httpd - small HTTP server
+**
+** Copyright 1999,2000 by Jef Poskanzer <jef@acme.com>.
+** All rights reserved.
+**
+** Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions
+** are met:
+** 1. Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** 2. Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in the
+** documentation and/or other materials provided with the distribution.
+**
+** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+** ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+** SUCH DAMAGE.
+*/
+
+#if (CFG_WEB_SERVER==1)
+
+/** Includes. **/
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_timer.h"
+#include "cfe_error.h"
+#include "cfe.h"
+#include "cfe_iocb.h"
+#include "cfe_devfuncs.h"
+
+#include "bsp_config.h"
+
+#include "bcmTag.h"
+#include "bcm63xx_util.h"
+
+
+/** Externs. **/
+
+extern char ul_html[];
+extern char ulinfo_html[];
+extern int ul_html_size;
+extern int ulinfo_html_size;
+
+extern int g_console_abort;
+extern int g_processing_cmd;
+
+/** Defines. **/
+
+#define SERVER_NAME "micro_httpd"
+#define SERVER_URL "http://www.acme.com/software/micro_httpd/"
+#define SERVER_PORT 80
+#define PROTOCOL "HTTP/1.0"
+#define POST_DATA_START (unsigned char *) \
+ BOARD_IMAGE_DOWNLOAD_ADDRESS
+#define SOCKET_CLOSED -100
+#define NUM_SOCKETS 4
+
+/* Return codes from cfe_web_gets. */
+#define WEB_GETS_DONE 1
+#define WEB_GETS_PENDING 2
+#define WEB_GETS_ERROR 3
+
+/* HTTP states. */
+#define HTTP_INITIAL 0
+#define HTTP_READ_FIRST_HDR 1
+#define HTTP_READ_REMAINING_HDRS 2
+#define HTTP_READ_POST_DATA 3
+
+/* HTTP POST status */
+#define UPLOAD_OK '0'
+#define UPLOAD_FAIL_NO_MEM '1'
+#define UPLOAD_FAIL_NO_FILENAME '2'
+#define UPLOAD_FAIL_ILLEGAL_IMAGE '3'
+#define UPLOAD_FAIL_IMAGE_TOOBIG '4'
+#define UPLOAD_FAIL_CORRUPT_IMAGE '5'
+#define UPLOAD_FAIL_FLASH '6'
+#define UPLOAD_FATAL '7'
+#define UPLOAD_PENDING '8'
+#define UPLOAD_TCP_ERROR '9'
+
+/* HTTP upload image formats. */
+#define NO_IMAGE_FORMAT 0
+#define BROADCOM_IMAGE_FORMAT 1
+#define FLASH_IMAGE_FORMAT 2
+
+
+/** Structs. **/
+
+typedef struct
+{
+ int s;
+ int state;
+ int web_buf_idx;
+ int post_content_length;
+ char web_first_buf[128];
+ char web_buf[256];
+} SOCKET_INFO, *PSOCKET_INFO;
+
+typedef struct
+{
+ char *wp_name;
+ char *wp_content_buf;
+ int *wp_content_size;
+ char *wp_mime_type;
+} WEB_PAGE_MAP, *PWEB_PAGE_MAP;
+
+
+/** Globals. **/
+
+static int g_listen_idx = 0;
+static unsigned char *g_image_start = NULL;
+static int g_image_len = 0;
+static int g_image_format = NO_IMAGE_FORMAT;
+static int g_post_data_in_progress = 0;
+static int g_post_data_idx = 0;
+
+static SOCKET_INFO g_socket_info[NUM_SOCKETS];
+
+static WEB_PAGE_MAP g_web_page_map[] =
+ {
+ {"/", ul_html, &ul_html_size, "text/html"},
+ {"/upload.html", ul_html, &ul_html_size, "text/html"},
+ {"/uploadinfo.html", ulinfo_html, &ulinfo_html_size, "text/html"},
+ {NULL, NULL, 0, NULL}
+ };
+
+
+/** Prototypes. **/
+
+int cfe_web_check(void);
+void cfe_web_fg_process(void);
+void cfe_web_poll(void *x);
+static void cfe_web_listen( int *listen_idx_ptr );
+static void cfe_web_bg_process(PSOCKET_INFO si);
+static int cfe_web_gets( char *web_buf, int web_buf_size,
+ int *web_buf_idx_ptr, int s );
+static int read_first_hdr(int s, char *web_buf, int web_buf_size,
+ int *web_buf_idx_ptr, int *close_tcp_ptr);
+static int read_remaining_hdrs(int s, char *web_buf, int web_buf_size,
+ int *web_buf_idx_ptr, int *close_tcp_ptr, int *content_length_ptr);
+static char read_post_data( int s, unsigned char *post_data_start,
+ int content_length, int *post_data_idx_ptr );
+static char parse_post_data( int s, unsigned char *post_data_start,
+ int post_data_length, unsigned char **image_start_ptr, int *image_len_ptr,
+ int *image_format_ptr );
+static void send_error( int s, int status, char* title, char* extra_header,
+ char* text );
+static void send_error( int s, int status, char* title, char* extra_header,
+ char* text );
+static void send_headers( int s, int status, char* title, char* extra_header,
+ char* mime_type );
+static void send_page( int s, char *path, int send_headers_flag,
+ char **substs, int num_substs );
+static int cfe_web_tcp_send( int s, char *buf, int size );
+void * memmove(void * dest,const void *src,size_t count);
+
+
+/***************************************************************************
+ * Function Name: cfe_web_check
+ * Description : Checks if an image has been downloaded through an HTTP POST
+ * request and is ready to be written to flash memory.
+ * Returns : 1 - image is ready to be flashed, 0 - nothing to do
+ ***************************************************************************/
+int cfe_web_check(void)
+{
+ return( (g_image_format != NO_IMAGE_FORMAT) ? 1 : 0 );
+} /* cfe_web_check */
+
+
+/***************************************************************************
+ * Function Name: cfe_web_process
+ * Description : Calls the appropriate functions to write an image to
+ * flash memory.
+ * Returns : None.
+ ***************************************************************************/
+void cfe_web_fg_process(void)
+{
+ /* Wait so the uploadinfo web page can be displayed on the browser. */
+ cfe_sleep(CFE_HZ * 2);
+ if( g_image_format == BROADCOM_IMAGE_FORMAT )
+ flashImage( g_image_start );
+ else
+ if( g_image_format == FLASH_IMAGE_FORMAT )
+ writeWholeImage( g_image_start, g_image_len );
+
+ if( g_image_format != NO_IMAGE_FORMAT )
+ softReset();
+
+} /* cfe_web_process */
+
+
+/***************************************************************************
+ * Function Name: cfe_web_poll
+ * Description : The entry point function that is called in the background
+ * at polled intervals. It listens for and processes HTTP
+ * requests.
+ * Returns : None.
+ ***************************************************************************/
+void cfe_web_poll(void *x)
+{
+ static int first_time = 1;
+ static int in_cfe_web_poll = 0;
+
+ PSOCKET_INFO si;
+ int i;
+
+ if( in_cfe_web_poll == 0 )
+ {
+ in_cfe_web_poll = 1;
+
+ /* If this is the first time that this function was called, initialize
+ * the socket info data array.
+ */
+ if( first_time == 1 )
+ {
+ first_time = 0;
+ for( i = 0, si = g_socket_info; i < NUM_SOCKETS; i++, si++ )
+ {
+ si->s = SOCKET_CLOSED;
+ si->state = HTTP_READ_FIRST_HDR;
+ si->web_buf_idx = 0;
+ si->post_content_length = 0;
+ }
+ }
+
+ /* Check the connection state of each socket. */
+ for( i = 0, si = g_socket_info; i < NUM_SOCKETS; i++, si++ )
+ {
+ cfe_web_listen( &g_listen_idx );
+ if( si->s >= 0 )
+ {
+ unsigned int connflag;
+ tcp_status( si->s, &connflag, NULL, NULL );
+ if( connflag == TCPSTATUS_CONNECTED )
+ {
+ cfe_web_bg_process( si );
+ POLL();
+ }
+ else
+ if( connflag == TCPSTATUS_NOTCONN )
+ {
+ console_log("web warning: Unexpected TCP disconnect.");
+ tcp_close(si->s);
+ si->s = SOCKET_CLOSED;
+ si->state = HTTP_READ_FIRST_HDR;
+ si->web_buf_idx = 0;
+ }
+ }
+ }
+
+ in_cfe_web_poll = 0;
+ }
+} /* cfe_web_poll */
+
+
+/***************************************************************************
+ * Function Name: cfe_web_listen
+ * Description : This function checks to see if TCP listen can be issued
+ * on the HTTP port and issues the listen if it can.
+ * Returns : None.
+ ***************************************************************************/
+static void cfe_web_listen( int *listen_idx_ptr )
+{
+ static int port = SERVER_PORT;
+
+ int listen_idx = *listen_idx_ptr;
+ PSOCKET_INFO si = &g_socket_info[listen_idx];
+
+ /* If a TCP socket has been opened, check its connection status. */
+ if( si->s >= 0 )
+ {
+ unsigned int connflag;
+ tcp_status( si->s, &connflag, NULL, NULL );
+
+ /* If the socket is connection, set the next socket index to listen for
+ * a TCP connection.
+ */
+ if( connflag == TCPSTATUS_CONNECTED )
+ {
+ listen_idx = (listen_idx + 1) % NUM_SOCKETS;
+ si = &g_socket_info[listen_idx];
+ }
+ }
+
+ /* If the TCP socket has not been opened, open it and listen for a TCP
+ * connection.
+ */
+ if( si->s == SOCKET_CLOSED )
+ {
+ /* Open the socket in non-blocking mode. */
+ POLL();
+ if( (si->s = tcp_socket()) >= 0 )
+ {
+ console_log("web info: Waiting for connection on socket %d.", si->s);
+ if( tcp_listen(si->s, port) != 0 )
+ console_log("web error: listen error on %d.", si->s);
+ }
+ else
+ {
+ console_log("web error %d: Could not create TCP socket.", si->s);
+ si->s = SOCKET_CLOSED;
+ }
+ }
+
+ *listen_idx_ptr = listen_idx;
+} /* cfe_web_listen */
+
+
+/***************************************************************************
+ * Function Name: cfe_web_bg_process
+ * Description : This function processes an HTTP request on a socket.
+ * Returns : None.
+ ***************************************************************************/
+static void cfe_web_bg_process(PSOCKET_INFO si)
+{
+ char post_subst[] = {UPLOAD_FATAL, '\0'};
+ char *post_substs[] = {post_subst};
+ int close_tcp = 0;
+
+ switch( si->state )
+ {
+ case HTTP_READ_FIRST_HDR:
+ if( read_first_hdr( si->s, si->web_first_buf,
+ sizeof(si->web_first_buf), &si->web_buf_idx, &close_tcp ) == 0 )
+ {
+ /* Not all of the first header has been read yet. Try again later.*/
+ break;
+ }
+
+ /* The first header has been read. */
+ si->state = HTTP_READ_REMAINING_HDRS;
+
+ /* fall thru */
+
+ case HTTP_READ_REMAINING_HDRS:
+ if( read_remaining_hdrs( si->s, si->web_buf, sizeof(si->web_buf),
+ &si->web_buf_idx, &close_tcp, &si->post_content_length ) )
+ {
+ if( g_processing_cmd == 0 )
+ {
+ char *method = NULL;
+ char *path = NULL;
+ char *ptr = (char *) si->web_first_buf;
+
+ method = gettoken(&ptr);
+ if( method )
+ path = gettoken(&ptr);
+
+ /* Process the HTTP request. Only GET and POST are supported. */
+ if( method && path )
+ {
+ if( !strcmpi( method, "get" ) )
+ {
+ send_page( si->s, path, 1, NULL, 0 );
+ close_tcp = 1;
+ }
+ else
+ {
+ if( !strcmpi( method, "post" ) )
+ {
+ if( g_post_data_in_progress == 0 )
+ {
+ g_post_data_in_progress = 1;
+ si->state = HTTP_READ_POST_DATA;
+ }
+ else
+ {
+ send_error( si->s, 501, "Upload Busy",
+ (char*) 0,
+ "An image is already being uploaded." );
+ close_tcp = 1;
+ }
+ }
+ else
+ {
+ send_error( si->s, 501, "Not Implemented",
+ (char*) 0,
+ "That method is not implemented." );
+ close_tcp = 1;
+ }
+ }
+ }
+ else
+ {
+ send_error( si->s, 400, "Bad Request", (char *) 0,
+ "Can't parse request." );
+ close_tcp = 1;
+ }
+ }
+ else
+ {
+ /* A download and flash image command is being executed from
+ * the serial port console.
+ */
+ send_error( si->s, 400, "Bad Request", (char *) 0,
+ "Console command is in progress." );
+ close_tcp = 1;
+ }
+ }
+
+ if( si->state != HTTP_READ_POST_DATA )
+ break;
+
+ case HTTP_READ_POST_DATA:
+ /* Read the post data, which contains an image to flash, into low
+ * memory.
+ */
+ if( (post_subst[0] = read_post_data( si->s, POST_DATA_START,
+ si->post_content_length, &g_post_data_idx )) == UPLOAD_OK )
+ {
+ /* Verify that the post data is a valid image to flash. */
+ post_subst[0] = parse_post_data( si->s, POST_DATA_START,
+ g_post_data_idx, (unsigned char **) &g_image_start, &g_image_len,
+ &g_image_format );
+ }
+
+ switch( post_subst[0] )
+ {
+ case UPLOAD_PENDING:
+ break;
+
+ case UPLOAD_TCP_ERROR:
+ close_tcp = 1;
+ g_post_data_in_progress = 0;
+ g_post_data_idx = 0;
+ break;
+
+ case UPLOAD_OK:
+ /* Notify foreground to abort the console input so it can
+ * write the image to flash memory.
+ */
+ g_console_abort = 1;
+
+ send_page(si->s, "/uploadinfo.html", 0, post_substs, 1);
+ close_tcp = 1;
+ g_post_data_idx = 0;
+ break;
+
+ default:
+ /* The image was downloaded OK but there was a problem with it
+ * so it could not be written to flash memory.
+ */
+ send_page(si->s, "/uploadinfo.html", 0, post_substs, 1);
+ close_tcp = 1;
+ g_post_data_in_progress = 0;
+ g_post_data_idx = 0;
+ break;
+ }
+ break;
+ }
+
+ /* Close the socket if the HTTP transaction is done. */
+ if( close_tcp )
+ {
+ POLL();
+ tcp_close(si->s);
+ si->s = SOCKET_CLOSED;
+ si->state = HTTP_READ_FIRST_HDR;
+ si->web_buf_idx = 0;
+ si->post_content_length = 0;
+ }
+} /* cfe_web_poll */
+
+
+/***************************************************************************
+ * Function Name: cfe_web_gets
+ * Description : Reads from a socket up to a <CR><LF> or <LF>. The socket
+ * is non-blocking.
+ * Returns : WEB_GETS_DONE - Complete line was read.
+ * WEB_GETS_PENDING - Line partially read.
+ * WEB_GETS_ERROR - Socket error.
+ ***************************************************************************/
+static int cfe_web_gets( char *web_buf, int web_buf_size,
+ int *web_buf_idx_ptr, int s )
+{
+ int ret = WEB_GETS_PENDING;
+ unsigned char ch;
+ int web_buf_idx = *web_buf_idx_ptr;
+ char *p = web_buf + web_buf_idx;
+ int continue_reading = 1;
+
+ while( web_buf_idx < web_buf_size && continue_reading )
+ {
+ switch( tcp_recv( s, &ch, 1 ) )
+ {
+ case 0: /* no characters are available to receive */
+ continue_reading = 0;
+ break;
+
+ case 1: /* character was read */
+ if( ch == '\n' )
+ {
+ *p = '\0';
+ continue_reading = 0;
+ ret = WEB_GETS_DONE;
+ }
+ else
+ if( ch != '\r' )
+ {
+ *p++ = ch;
+ web_buf_idx++;
+ }
+ break;
+
+ default:
+ continue_reading = 0;
+ ret = WEB_GETS_ERROR;
+ break;
+ }
+ }
+
+ if( web_buf_idx == web_buf_size )
+ {
+ web_buf[web_buf_idx - 1] = '\0';
+ ret = WEB_GETS_DONE;
+ }
+
+ *web_buf_idx_ptr = web_buf_idx;
+
+ return( ret );
+} /* cfe_web_gets */
+
+
+/***************************************************************************
+ * Function Name: read_first_hdr
+ * Description : This function reads the first HTTP header which contains
+ * the method (GET, POST), path and protocol. For example,
+ * GET /upload.html HTTP/1.1
+ * Returns : 1 - First header was read, 0 - was not read.
+ ***************************************************************************/
+static int read_first_hdr(int s, char *web_buf, int web_buf_size,
+ int *web_buf_idx_ptr, int *close_tcp_ptr)
+{
+ int ret = 0;
+ int sts = cfe_web_gets( web_buf, web_buf_size, web_buf_idx_ptr, s );
+
+ switch( sts )
+ {
+ case WEB_GETS_DONE:
+ /* The first HTTP header has been read into web_buf. */
+ *web_buf_idx_ptr = 0;
+ ret = 1;
+ break;
+
+ case WEB_GETS_ERROR:
+ console_log("web error: TCP read error.");
+ *close_tcp_ptr = 1;
+ break;
+ }
+
+ return( ret );
+} /* read_first_hdr */
+
+
+/***************************************************************************
+ * Function Name: read_remaining_hdrs
+ * Description : This function reads the remaining HTTP headers.
+ * Returns : 1 - Remaining headers were read, 0 - were not read.
+ ***************************************************************************/
+static int read_remaining_hdrs(int s, char *web_buf, int web_buf_size,
+ int *web_buf_idx_ptr, int *close_tcp_ptr, int *content_length_ptr)
+{
+ int ret = 0;
+ int sts = WEB_GETS_DONE;
+
+ while( sts == WEB_GETS_DONE )
+ {
+ sts = cfe_web_gets( web_buf, web_buf_size, web_buf_idx_ptr, s );
+ switch( sts )
+ {
+ case WEB_GETS_DONE:
+ if( *web_buf_idx_ptr == 0 )
+ {
+ /* The remaining HTTP headers have been read. */
+ ret = 1;
+ sts = WEB_GETS_PENDING;
+ }
+ else
+ {
+ char *p2 = web_buf;
+ char *p1 = gettoken(&p2);
+ if( !strcmpi( p1, "Content-Length:" ) )
+ *content_length_ptr=atoi(p2);
+ *web_buf_idx_ptr = 0;
+ }
+ break;
+
+ case WEB_GETS_ERROR:
+ console_log("web error: TCP read error.");
+ *close_tcp_ptr = 1;
+ break;
+ }
+ }
+
+ return( ret );
+} /* read_remaining_hdrs */
+
+
+/***************************************************************************
+ * Function Name: read_post_data
+ * Description : This function reads HTTP POST data which is the contents of
+ * a new image to write to flash memory.
+ * Returns : UPLOAD_OK - all data read
+ * UPLOAD_PENDING - not all data read
+ * UPLOAD_TCP_ERROR - TCP error
+ ***************************************************************************/
+static char read_post_data( int s, unsigned char *post_data_start,
+ int content_length, int *post_data_idx_ptr )
+{
+ char ret = UPLOAD_PENDING;
+ int post_data_idx = *post_data_idx_ptr;
+ int len;
+
+ do
+ {
+ len = tcp_recv( s, (unsigned char*)(post_data_start + post_data_idx),
+ content_length - post_data_idx );
+ post_data_idx += len;
+ POLL();
+ cfe_web_listen( &g_listen_idx );
+ } while( len > 0 && post_data_idx < content_length );
+
+ *post_data_idx_ptr = post_data_idx;
+
+ if( len < 0 )
+ {
+ console_log("web error: TCP read error receiving post data.");
+ ret = UPLOAD_TCP_ERROR;
+ }
+ else
+ if( post_data_idx == content_length )
+ ret = UPLOAD_OK;
+
+ return( ret );
+} /* read_post_data */
+
+
+/***************************************************************************
+ * Function Name: parse_post_data
+ * Description : This function parses HTTP POST data which is the contents of
+ * a new image to write to flash memory.
+ * Returns : UPLOAD_OK or UPLOAD_xxx error
+ ***************************************************************************/
+static char parse_post_data( int s, unsigned char *post_data_start,
+ int post_data_length, unsigned char **image_start_ptr, int *image_len_ptr,
+ int *image_format_ptr )
+{
+ char ret = UPLOAD_OK;
+ unsigned char *p = post_data_start;
+ int boundary_size = 0;
+
+ /* Convert the start boundary field into a string. It will be compared
+ * against the end boundary field below.
+ */
+ while( *p != '\r' && *p != '\n' &&
+ ((int) p - (int) post_data_start) < post_data_length )
+ {
+ p++;
+ }
+
+ if( *p == '\r' || *p == '\n' )
+ {
+ *p++ = '\0';
+ boundary_size = strlen((char*)post_data_start);
+ }
+ else
+ {
+ console_log("web error: HTTP POST start bound field not found.");
+ ret = UPLOAD_FATAL;
+ }
+
+ /* Verify that a filename has been entered. */
+ if( ret == UPLOAD_OK )
+ {
+ unsigned char *fname = NULL;
+ while( memcmp( p, "\r\n\r\n", strlen("\r\n\r\n") ) )
+ {
+ if( *p == 'f' && !memcmp( p, "filename=", strlen("filename=" ) ) )
+ {
+ p += strlen("filename=");
+ fname = p + 1;
+ if( p[0] == '"' && p[1] != '"' )
+ {
+ p++;
+ while( *p != '"' && *p != '\r' && *p != '\n' )
+ p++;
+ *p = '\0';
+ }
+ else
+ {
+ console_log("web error: HTTP POST filename not specified.");
+ ret = UPLOAD_FAIL_NO_FILENAME;
+ }
+ break;
+ }
+
+ p++;
+ }
+
+ if( fname == NULL )
+ {
+ console_log("web error: HTTP POST filename field not found.");
+ ret = UPLOAD_FATAL;
+ }
+ }
+
+ /* Find the start of the image which starts after two consecutive
+ * carriage return, linefeed pairs.
+ */
+ if( ret == UPLOAD_OK )
+ {
+ while( memcmp( p, "\r\n\r\n", strlen("\r\n\r\n") ) )
+ p++;
+
+ p += strlen("\r\n\r\n");
+ if( p[0] != '\r' || p[1] != '\n' ||
+ memcmp(p + 2, post_data_start, boundary_size ) )
+ {
+ *image_start_ptr = p;
+ }
+ else
+ {
+ console_log("web error: HTTP POST no image data.");
+ ret = UPLOAD_FAIL_ILLEGAL_IMAGE;
+ }
+ }
+
+ /* Find the end of the image which contains the same boundary field as
+ * at the start of the buffer.
+ */
+ if( ret == UPLOAD_OK )
+ {
+ p = post_data_start + post_data_length - 1;
+ while( *p == '\r' || *p == '\n' || *p == '-' )
+ p--;
+ p[1] = '\0';
+ p -= boundary_size + 1;
+ if( !memcmp( p + strlen("\r\n"), post_data_start, boundary_size ) )
+ *image_len_ptr = (int) p - (int) *image_start_ptr;
+ else
+ {
+ console_log("web error: HTTP POST end bound field not found.");
+ ret = UPLOAD_FATAL;
+ }
+ }
+
+ /* Verify that the image is (or should be) a Broadcom flash format file or
+ * a flash image format.
+ */
+ if( ret == UPLOAD_OK )
+ {
+ /* Align the image on a 16 byte boundary */
+ if( ((unsigned long) *image_start_ptr & 0x0f) != 0 )
+ {
+ unsigned char *dest = (unsigned char *)
+ ((unsigned long) *image_start_ptr & ~0x0f);
+ unsigned char *src = *image_start_ptr;
+ memmove( dest, src, *image_len_ptr );
+ *image_start_ptr = dest;
+ }
+
+ /* Check if the first part of the image is the Broadcom defined TAG
+ * record.
+ */
+ if( verifyTag( (FILE_TAG *) *image_start_ptr, 0 ) == -1 )
+ {
+ /* It is not a Broadcom flash format file. Now check if it is a
+ * flash image format file. A flash image format file must have a
+ * CRC at the end of the image.
+ */
+ unsigned char *image_ptr = *image_start_ptr;
+ unsigned long image_len = (unsigned long) *image_len_ptr - TOKEN_LEN;
+ unsigned long crc = CRC32_INIT_VALUE;
+
+ crc = getCrc32(image_ptr, image_len, crc);
+ if (memcmp(&crc, image_ptr + image_len, CRC_LEN) == 0)
+ {
+ console_log("web info: Upload %lu bytes, flash image format.",
+ *image_len_ptr);
+ *image_format_ptr = FLASH_IMAGE_FORMAT;
+ }
+ else
+ {
+ console_log("web info: Upload %lu bytes, invalid image format.",
+ *image_len_ptr);
+ ret = UPLOAD_FAIL_ILLEGAL_IMAGE;
+ }
+ }
+ else
+ {
+ console_log("web info: Upload %lu bytes, Broadcom image format.",
+ *image_len_ptr);
+ *image_format_ptr = BROADCOM_IMAGE_FORMAT;
+ }
+ }
+
+ return( ret );
+} /* parse_post_data */
+
+
+/***************************************************************************
+ * Function Name: send_error
+ * Description : This function sends an HTTP error response to the browser.
+ * Returns : None.
+ ***************************************************************************/
+static void send_error( int s, int status, char* title, char* extra_header,
+ char* text )
+{
+ int tcpret = 0;
+ char buf[128];
+ send_headers( s, status, title, extra_header, "text/html" );
+ sprintf( (char *) buf, "<HTML><HEAD><TITLE>%d %s</TITLE></HEAD>\n"
+ "<BODY BGCOLOR=\"#cc9999\"><H4>%d %s</H4>\n", status, title, status,
+ title );
+ tcpret = tcp_send( s, (unsigned char*)buf, strlen(buf) );
+ sprintf( (char *) buf, "%s\n", text );
+ tcpret = tcp_send( s, (unsigned char*)buf, strlen(buf) );
+ sprintf( (char *) buf, "<HR>\n<ADDRESS><A HREF=\"%s\">%s</A></ADDRESS>\n"
+ "</BODY></HTML>\n", SERVER_URL, SERVER_NAME );
+ tcpret = tcp_send( s, (unsigned char*)buf, strlen(buf) );
+
+ if( tcpret < 0 )
+ console_log("web error: TCP write error sending error response.");
+} /* send_error */
+
+
+/***************************************************************************
+ * Function Name: send_headers
+ * Description : This function sends an HTTP response to the browser.
+ * Returns : None.
+ ***************************************************************************/
+static void send_headers( int s, int status, char* title, char* extra_header,
+ char* mime_type )
+{
+ int tcpret = 0;
+ char buf[128];
+ unsigned long secs = (unsigned long) cfe_ticks / CFE_HZ;
+
+ sprintf( buf, "%s %d %s\r\n", PROTOCOL, status, title );
+ tcpret = tcp_send( s, (unsigned char*)buf, strlen(buf) );
+ sprintf( buf, "Server: %s\r\n", SERVER_NAME );
+ tcpret = tcp_send( s, (unsigned char*)buf, strlen(buf) );
+ sprintf( buf, "Date: Thu, 01 Jan 1970 %2.2d:%2.2d:%2.2d GMT\r\n",
+ secs / 3600, (secs % 3600) / 60, secs % 60 );
+ tcpret = tcp_send( s, (unsigned char*)buf, strlen(buf) );
+ if ( extra_header != (char*) 0 )
+ {
+ sprintf( buf, "%s\r\n", extra_header );
+ tcpret = tcp_send( s, (unsigned char*)buf, strlen(buf) );
+ }
+ if ( mime_type != (char*) 0 )
+ {
+ sprintf( buf, "Content-Type: %s\r\n", mime_type );
+ tcpret = tcp_send( s, (unsigned char*)buf, strlen(buf) );
+ }
+ sprintf( buf, "Connection: close\r\n\r\n" );
+ tcpret = tcp_send( s, (unsigned char*)buf, strlen(buf) );
+
+ if( tcpret < 0 )
+ console_log("web error: TCP write error sending header.");
+} /* send_headers */
+
+
+/***************************************************************************
+ * Function Name: send_page
+ * Description : This function sends a web page to the browser.
+ * Returns : None.
+ ***************************************************************************/
+static void send_page( int s, char *path, int send_headers_flag,
+ char **substs, int num_substs )
+{
+ PWEB_PAGE_MAP map;
+
+ /* Find the specified web page. */
+ for( map = g_web_page_map; map->wp_name; map++ )
+ {
+ if( !strcmp( map->wp_name, path ) )
+ {
+ /* Found the web page. */
+ char *p2 = NULL;
+ char *p = (char *) map->wp_content_buf;
+ int size = *map->wp_content_size;
+ int i = 0;
+
+ if( send_headers_flag )
+ send_headers( s, 200, "Ok", (char *) 0, map->wp_mime_type );
+
+ /* Make substitutions. */
+ while( i < num_substs && (p2 = strnchr( p, '<', size )) != NULL )
+ {
+ if( p2[1] == '%' )
+ {
+ /* Found a substituion pattern. Send up to that point. */
+ if( cfe_web_tcp_send( s, p, (int) (p2 - p) ) < 0 )
+ break;
+
+ /* Send substitution value. */
+ if( cfe_web_tcp_send( s, substs[i], strlen(substs[i]) ) < 0 )
+ break;
+
+ i++;
+
+ /* Skip to end of substitution pattern. */
+ p = p2 + 2; /* skip '<%' */
+ while( p[0] != '%' || p[1] != '>' )
+ p++;
+ p += 2; /* skip '%.' */
+ }
+ else
+ {
+ /* Was not a substitution pattern. Send up that point. */
+ p2++;
+ if( cfe_web_tcp_send( s, p, (int) (p2 - p) ) < 0 )
+ break;
+
+ p = p2;
+ }
+
+ size = *map->wp_content_size - ((int)p-(int)map->wp_content_buf);
+ }
+
+ /* Send remaining part of web page after the last substitution. */
+ cfe_web_tcp_send( s, p, size );
+
+ break; /* for loop */
+ }
+ }
+
+ if( map->wp_name == NULL )
+ send_error( s, 404, "Not Found", (char*) 0, "File not found." );
+} /* send_page */
+
+
+/***************************************************************************
+ * Function Name: cfe_web_tcp_send
+ * Description : Sends data on a TCP non blocking connection and waits for
+ * it to finish.
+ * Returns : > 0 - bytes send, < 0 - TCP error
+ ***************************************************************************/
+static int cfe_web_tcp_send( int s, char *buf, int size )
+{
+ int i, len = 0;
+
+ for( i = 0; i < size; i += len )
+ {
+ POLL();
+ cfe_web_listen( &g_listen_idx );
+ len = tcp_send( s, (unsigned char*)(buf + i), size - i );
+ if( len < 0 )
+ {
+ console_log("web error: TCP write error sending a web page.");
+ break;
+ }
+ }
+
+ return( len );
+} /* cfe_web_tcp_send */
+
+
+/**
+ * memmove - Copy one area of memory to another
+ * @dest: Where to copy to
+ * @src: Where to copy from
+ * @count: The size of the area.
+ *
+ * Unlike memcpy(), memmove() copes with overlapping areas.
+ */
+void * memmove(void * dest,const void *src,size_t count)
+{
+ char *tmp, *s;
+
+ if (dest <= src) {
+ tmp = (char *) dest;
+ s = (char *) src;
+ while (count--)
+ *tmp++ = *s++;
+ }
+ else {
+ tmp = (char *) dest + count;
+ s = (char *) src + count;
+ while (count--)
+ *--tmp = *--s;
+ }
+
+ return dest;
+}
+
+#else
+
+/***************************************************************************
+ * Function Name: Functions stubs.
+ * Description : Used when the web server is not compiled into the CFE.
+ * Returns : None.
+ ***************************************************************************/
+
+int cfe_web_check(void);
+void cfe_web_fg_process(void);
+void cfe_web_poll(void *x);
+
+int cfe_web_check(void)
+{
+ return(0);
+}
+
+void cfe_web_fg_process(void)
+{
+}
+
+void cfe_web_poll(void *x)
+{
+}
+
+#endif
+
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_ldr_elf.c b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_ldr_elf.c
new file mode 100755
index 0000000..fb3f122
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_ldr_elf.c
@@ -0,0 +1,388 @@
+
+//********** for boot -elf thing from cfe_ldr_elf.c
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * ELF Program Loader File: cfe_ldr_elf.c
+ *
+ * This program parses ELF executables and loads them into memory.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "cfe_error.h"
+#include "cfe_devfuncs.h"
+#include "cfe_timer.h"
+#include "cfe_mem.h"
+
+#include "cfe.h"
+#include "cfe_loader.h"
+#include "cfe_fileops.h"
+#include "elf.h"
+
+#include "cfe_boot.h"
+
+/* *********************************************************************
+ * Externs
+ ********************************************************************* */
+
+int bcm63xx_cfe_elfload(cfe_loadargs_t *la);
+
+const cfe_loader_t elfloader = {
+ "elf",
+ bcm63xx_cfe_elfload,
+ 0};
+
+/* *********************************************************************
+ * readprogsegment(fsctx,ref,addr,size)
+ *
+ * Read a program segment, generally corresponding to one
+ * section of the file.
+ *
+ * Input parameters:
+ * fsctx - file I/O dispatch
+ * ref - reference data for open file handle
+ * addr - target virtual address
+ * size - size of region to read
+ *
+ * Return value:
+ * Number of bytes copied or <0 if error occured
+ ********************************************************************* */
+
+static int readprogsegment(fileio_ctx_t *fsctx,void *ref,
+ void *addr,int size,int flags)
+{
+ int res;
+
+#ifdef __long64
+ if (flags & LOADFLG_NOISY) xprintf("0x%016llx/%d ",addr,size);
+#else
+ if (flags & LOADFLG_NOISY) xprintf("0x%x/%d ",addr,size);
+#endif
+
+ res = fs_read(fsctx,ref,addr,size);
+
+ if (res < 0) return CFE_ERR_IOERR;
+ if (res != size) return CFE_ERR_BADELFFMT;
+
+ return size;
+}
+
+
+/* *********************************************************************
+ * readclearbss(addr,size)
+ *
+ * Process a BSS section, zeroing memory corresponding to
+ * the BSS.
+ *
+ * Input parameters:
+ * addr - address to zero
+ * size - length of area to zero
+ *
+ * Return value:
+ * number of zeroed bytes or <0 if error occured
+ ********************************************************************* */
+
+static int readclearbss(void *addr,int size,int flags)
+{
+
+#ifdef __long64
+ if (flags & LOADFLG_NOISY) xprintf("0x%016llx/%d ",addr,size);
+#else
+ if (flags & LOADFLG_NOISY) xprintf("0x%x/%d ",addr,size);
+#endif
+
+ if (size > 0) memset(addr,0,size);
+ return size;
+}
+
+
+/* *********************************************************************
+ * elfgetshdr(ops,ref,ep)
+ *
+ * Get a section header from the ELF file
+ *
+ * Input parameters:
+ * ops - file I/O dispatch
+ * ref - reference data for open file
+ * ep - extended header info
+ *
+ * Return value:
+ * copy of section header (malloc'd) or NULL if no memory
+ ********************************************************************* */
+
+static Elf32_Shdr *elfgetshdr(fileio_ctx_t *fsctx,void *ref,Elf32_Ehdr *ep)
+{
+ Elf32_Shdr *shtab;
+ unsigned size = ep->e_shnum * sizeof(Elf32_Shdr);
+
+ shtab = (Elf32_Shdr *) KMALLOC(size,0);
+ if (!shtab) {
+ return NULL;
+ }
+
+ if (fs_seek(fsctx,ref,ep->e_shoff,FILE_SEEK_BEGINNING) != ep->e_shoff ||
+ fs_read(fsctx,ref,(uint8_t *)shtab,size) != size) {
+ KFREE(shtab);
+ return NULL;
+ }
+
+ return (shtab);
+}
+
+/* *********************************************************************
+ * elfload_internal(ops,ref,entrypt,flags)
+ *
+ * Read an ELF file (main routine)
+ *
+ * Input parameters:
+ * ops - file I/O dispatch
+ * ref - open file handle
+ * entrypt - filled in with entry vector
+ * flags - generic boot flags
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int elfload_internal(fileio_ctx_t *fsctx,void *ref,
+ long *entrypt,int flags)
+{
+ Elf32_Ehdr *ep;
+ Elf32_Phdr *phtab = 0;
+ Elf32_Shdr *shtab = 0;
+ unsigned int nbytes;
+ int i;
+ int res;
+ Elf32_Ehdr ehdr;
+
+ ep = &ehdr;
+ if (fs_read(fsctx,ref,(uint8_t *) ep,sizeof(*ep)) != sizeof(*ep)) {
+ return CFE_ERR_IOERR;
+ }
+
+ /* check header validity */
+ if (ep->e_ident[EI_MAG0] != ELFMAG0 ||
+ ep->e_ident[EI_MAG1] != ELFMAG1 ||
+ ep->e_ident[EI_MAG2] != ELFMAG2 ||
+ ep->e_ident[EI_MAG3] != ELFMAG3) {
+ return CFE_ERR_NOTELF;
+ }
+
+ if (ep->e_ident[EI_CLASS] != ELFCLASS32) return CFE_ERR_NOT32BIT;
+
+#ifdef __MIPSEB
+ if (ep->e_ident[EI_DATA] != ELFDATA2MSB) return CFE_ERR_WRONGENDIAN; /* big endian */
+#endif
+#ifdef __MIPSEL
+ if (ep->e_ident[EI_DATA] != ELFDATA2LSB) return CFE_ERR_WRONGENDIAN; /* little endian */
+#endif
+
+ if (ep->e_ident[EI_VERSION] != EV_CURRENT) return CFE_ERR_BADELFVERS;
+ if (ep->e_machine != EM_MIPS) return CFE_ERR_NOTMIPS;
+
+ /* Is there a program header? */
+ if (ep->e_phoff == 0 || ep->e_phnum == 0 ||
+ ep->e_phentsize != sizeof(Elf32_Phdr)) {
+ return CFE_ERR_BADELFFMT;
+ }
+
+ /* Load program header */
+ nbytes = ep->e_phnum * sizeof(Elf32_Phdr);
+ phtab = (Elf32_Phdr *) KMALLOC(nbytes,0);
+ if (!phtab) {
+ return CFE_ERR_NOMEM;
+ }
+
+ if (fs_seek(fsctx,ref,ep->e_phoff,FILE_SEEK_BEGINNING) != ep->e_phoff ||
+ fs_read(fsctx,ref,(uint8_t *)phtab,nbytes) != nbytes) {
+ KFREE(phtab);
+ return CFE_ERR_IOERR;
+ }
+
+ /*
+ * From now on we've got no guarantee about the file order,
+ * even where the section header is. Hopefully most linkers
+ * will put the section header after the program header, when
+ * they know that the executable is not demand paged. We assume
+ * that the symbol and string tables always follow the program
+ * segments.
+ */
+
+ /* read section table (if before first program segment) */
+ if (ep->e_shoff < phtab[0].p_offset) {
+ shtab = elfgetshdr(fsctx,ref,ep);
+ }
+
+ /* load program segments */
+ /* We cope with a badly sorted program header, as produced by
+ * older versions of the GNU linker, by loading the segments
+ * in file offset order, not in program header order. */
+
+ while (1) {
+ Elf32_Off lowest_offset = ~0;
+ Elf32_Phdr *ph = 0;
+
+ /* find nearest loadable segment */
+ for (i = 0; i < ep->e_phnum; i++)
+ if ((phtab[i].p_type == PT_LOAD) && (phtab[i].p_offset < lowest_offset)) {
+ ph = &phtab[i];
+ lowest_offset = ph->p_offset;
+ }
+ if (!ph) {
+ break; /* none found, finished */
+ }
+ /* load the segment */
+ if (ph->p_filesz) {
+ if (fs_seek(fsctx,ref,ph->p_offset,FILE_SEEK_BEGINNING) != ph->p_offset) {
+ if (shtab) KFREE(shtab);
+ KFREE(phtab);
+ return CFE_ERR_BADELFFMT;
+ }
+ res = readprogsegment(fsctx,ref,
+ (void *)(intptr_t)(signed)ph->p_vaddr,
+ ph->p_filesz,flags);
+ if (res != ph->p_filesz) {
+ if (shtab) KFREE(shtab);
+ KFREE(phtab);
+ return res;
+ }
+ }
+ if (ph->p_filesz < ph->p_memsz) {
+ res = readclearbss((void *)(intptr_t)(signed)ph->p_vaddr + ph->p_filesz,
+ ph->p_memsz - ph->p_filesz,flags);
+ if (res < 0) {
+ if (shtab) KFREE(shtab);
+ KFREE(phtab);
+ return res;
+ }
+ }
+
+ ph->p_type = PT_NULL; /* remove from consideration */
+ }
+
+ KFREE(phtab);
+
+ *entrypt = (intptr_t)ep->e_entry; /* return entry point */
+ return 0;
+}
+
+
+
+/* *********************************************************************
+ * cfe_elfload(ops,file,flags)
+ *
+ * Read an ELF file (main entry point)
+ *
+ * Input parameters:
+ * ops - fileio dispatch
+ * file - name of file to read
+ * ept - where to put entry point
+ * flags - load flags
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+int bcm63xx_cfe_elfload(cfe_loadargs_t *la)
+{
+ fileio_ctx_t *fsctx;
+ void *ref;
+ int res;
+
+ /*
+ * Look up the file system type and get a context
+ */
+
+
+ res = fs_init(la->la_filesys,&fsctx,la->la_device);
+ if (res != 0) {
+ return res;
+ }
+
+ /*
+ * Turn on compression if we're doing that.
+ */
+
+ if (la->la_flags & LOADFLG_COMPRESSED) {
+ res = fs_hook(fsctx,"z");
+ if (res != 0) {
+ return res;
+ }
+ }
+
+ /*
+ * Open the remote file
+ */
+
+ res = fs_open(fsctx,&ref,la->la_filename,FILE_MODE_READ);
+ if (res != 0) {
+ fs_uninit(fsctx);
+ return CFE_ERR_FILENOTFOUND;
+ }
+
+ /*
+ * Load the image.
+ */
+
+ la->la_entrypt = 0;
+ res = elfload_internal(fsctx,ref,&(la->la_entrypt),la->la_flags);
+
+ /*
+ * All done, release resources
+ */
+
+ fs_close(fsctx,ref);
+ fs_uninit(fsctx);
+
+ return res;
+}
+
+
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_ldr_raw.c b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_ldr_raw.c
new file mode 100755
index 0000000..eaabf14
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_ldr_raw.c
@@ -0,0 +1,368 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * RAW Program Loader File: cfe_ldr_raw.c
+ *
+ * This program reads raw binaries into memory.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_error.h"
+#include "cfe_devfuncs.h"
+
+#include "cfe.h"
+#include "cfe_fileops.h"
+
+#include "cfe_boot.h"
+#include "cfe_bootblock.h"
+
+#include "cfe_loader.h"
+
+/* *********************************************************************
+ * Externs
+ ********************************************************************* */
+
+int bcm63xx_cfe_rawload(cfe_loadargs_t *la);
+
+const cfe_loader_t rawloader = {
+ "raw",
+ bcm63xx_cfe_rawload,
+ 0};
+
+/* *********************************************************************
+ * cfe_findbootblock(la,fsctx,ref)
+ *
+ * Find the boot block on the specified device.
+ *
+ * Input parameters:
+ * la - loader args (to be filled in)
+ * ops - file operations
+ * ref - reference for open file handle
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+static int cfe_findbootblock(cfe_loadargs_t *la,
+ fileio_ctx_t *fsctx,
+ void *ref,
+ struct boot_block *bootblock)
+{
+ uint32_t checksum = 0;
+ uint32_t calcsum = 0;
+ uint32_t secsize = 0;
+ uint64_t secoffset = 0;
+ int res;
+ int curblk;
+
+ /*
+ * Search for the boot block. Stop when we find
+ * something with a matching checksum and magic
+ * number.
+ */
+
+ fs_seek(fsctx,ref,0,FILE_SEEK_BEGINNING);
+
+ for (curblk = 0; curblk < BOOT_BLOCK_MAXLOC; curblk++) {
+
+
+ /* Read a block */
+
+ res = fs_read(fsctx,ref,
+ (unsigned char *) bootblock,
+ sizeof(struct boot_block));
+
+ if (res != sizeof(struct boot_block)) {
+ return CFE_ERR_IOERR;
+ }
+
+ /* Verify magic number */
+
+#if defined(CONFIG_MIPS_BRCM)
+ continue;
+#else
+ if (bootblock->bb_magic != BOOT_MAGIC_NUMBER) {
+ continue;
+ }
+#endif
+
+ /* Extract fields from block */
+
+ checksum = ((uint32_t) (bootblock->bb_hdrinfo & BOOT_HDR_CHECKSUM_MASK));
+ bootblock->bb_hdrinfo &= ~BOOT_HDR_CHECKSUM_MASK;
+ secsize = ((uint32_t) (bootblock->bb_secsize & BOOT_SECSIZE_MASK));
+ secoffset = bootblock->bb_secstart;
+
+ /* Verify block's checksum */
+
+ CHECKSUM_BOOT_DATA(&(bootblock->bb_magic),BOOT_BLOCK_SIZE,&calcsum);
+
+ if (checksum == calcsum) {
+ break;
+ }
+ }
+
+ /*
+ * Okay, determine if we were successful.
+ */
+
+#if !defined(CONFIG_MIPS_BRCM)
+ if (bootblock->bb_magic != BOOT_MAGIC_NUMBER) {
+ return CFE_ERR_INVBOOTBLOCK;
+ }
+#endif
+
+ if (checksum != calcsum) {
+ return CFE_ERR_BBCHECKSUM;
+ }
+
+ /*
+ * If we get here, we had a valid boot block.
+ */
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * cfe_rawload(la)
+ *
+ * Read a raw (unformatted) boot file
+ *
+ * Input parameters:
+ * la - loader args
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+int bcm63xx_cfe_rawload(cfe_loadargs_t *la)
+{
+ int res;
+ fileio_ctx_t *fsctx;
+ const fileio_dispatch_t *ops;
+ void *ref;
+ int ttlcopy = 0;
+ int findbb;
+ int devinfo;
+ struct boot_block bootblock;
+ uint8_t *ptr;
+ uint8_t *bootcode;
+#if !defined(CONFIG_MIPS_BRCM)
+ uint32_t checksum,calcsum;
+#endif
+ uint64_t secoffset = 0;
+ int32_t maxsize;
+ int amtcopy;
+ int thisamt;
+ uint32_t loadflags;
+ int onedot;
+
+ loadflags = la->la_flags;
+
+ /*
+ * Set starting address and maximum size. You can either
+ * explicitly set this (with LOADFLG_SPECADDR) or
+ * let CFE decide. If CFE decides, the load address
+ * will be BOOT_START_ADDRESS in all cases.
+ * The size is dependant on the device type: block and flash
+ * devices will get this info from the boot block,
+ * and network devices will get the info by reaching EOF
+ * on reads, up to the maximum size of the boot area.
+ */
+
+ if (loadflags & LOADFLG_SPECADDR) {
+ bootcode = (uint8_t *) la->la_address;
+ maxsize = la->la_maxsize;
+ findbb = FALSE; /* don't find a boot block */
+ }
+ else {
+ bootcode = (uint8_t *) BOOT_START_ADDRESS;
+ maxsize = BOOT_AREA_SIZE;
+ findbb = FALSE;
+ devinfo = la->la_device ? cfe_getdevinfo(la->la_device) : 0;
+
+ /*
+ * If the device is either a disk or a flash device,
+ * we will expect to find a boot block.
+ * Serial and network devices do not have boot blocks.
+ */
+ if ((devinfo >= 0) &&
+ ( ((devinfo & CFE_DEV_MASK) == CFE_DEV_DISK) ||
+ ((devinfo & CFE_DEV_MASK) == CFE_DEV_FLASH) )) {
+ findbb = TRUE;
+ }
+ }
+
+
+ /*
+ * merge in any filesystem-specific flags
+ */
+
+ ops = cfe_findfilesys(la->la_filesys);
+ if (!ops) return CFE_ERR_FSNOTAVAIL;
+ loadflags |= ops->loadflags;
+
+ /*
+ * turn off the boot block if requested.
+ */
+
+ if (loadflags & LOADFLG_NOBB) findbb = FALSE;
+
+ /*
+ * Create a file system context
+ */
+
+ res = fs_init(la->la_filesys,&fsctx,la->la_device);
+ if (res != 0) {
+ return res;
+ }
+
+ /*
+ * Turn on compression if we're doing that.
+ */
+
+ if (!findbb && (la->la_flags & LOADFLG_COMPRESSED)) {
+ res = fs_hook(fsctx,"z");
+ if (res != 0) {
+ return res;
+ }
+ }
+
+ /*
+ * Open the boot device
+ */
+
+ res = fs_open(fsctx,&ref,la->la_filename,FILE_MODE_READ);
+ if (res != 0) {
+ fs_uninit(fsctx);
+ return res;
+ }
+
+ /*
+ * If we need to find a boot block, do it now.
+ */
+
+ if (findbb) {
+ res = cfe_findbootblock(la,fsctx,ref,&bootblock);
+
+ /*
+ * If we found the boot block, seek to the part of the
+ * disk where the boot code is.
+ * Otherwise, get out now, since the disk has no boot block.
+ */
+
+ if (res == 0) {
+ maxsize = (int) ((uint32_t) (bootblock.bb_secsize & BOOT_SECSIZE_MASK));
+ secoffset = bootblock.bb_secstart;
+ fs_seek(fsctx,ref,secoffset,FILE_SEEK_BEGINNING);
+ }
+ else {
+ fs_close(fsctx,ref);
+ fs_uninit(fsctx);
+ return res;
+ }
+
+ }
+
+ /*
+ * Okay, go load the boot file.
+ */
+
+ ptr = bootcode;
+ amtcopy = maxsize;
+ ttlcopy = 0;
+
+ onedot = amtcopy / 10; /* ten dots for entire load */
+ if (onedot < 4096) onedot = 4096; /* but minimum 4096 bytes per dot */
+ onedot = (onedot + 1) & ~4095; /* round to multiple of 4096 */
+
+ while (amtcopy > 0) {
+ thisamt = onedot;
+ if (thisamt > amtcopy) thisamt = amtcopy;
+
+ res = fs_read(fsctx,ref,ptr,thisamt);
+ if (la->la_flags & LOADFLG_NOISY) {
+ xprintf(".");
+ }
+ if (res <= 0) break;
+ ptr += res;
+ amtcopy -= res;
+ ttlcopy += res;
+ }
+
+ /*
+ * We're done with the file.
+ */
+
+ fs_close(fsctx,ref);
+ fs_uninit(fsctx);
+
+ /*
+ * Verify the boot loader checksum if we were reading
+ * the disk.
+ */
+
+#if !defined(CONFIG_MIPS_BRCM)
+ if (findbb) {
+ CHECKSUM_BOOT_DATA(bootcode,maxsize,&calcsum);
+ checksum = (uint32_t) ((bootblock.bb_secsize & BOOT_DATA_CHECKSUM_MASK)
+ >> BOOT_DATA_CHECKSUM_SHIFT);
+
+ if (checksum != calcsum) {
+ return CFE_ERR_BOOTPROGCHKSUM;
+ }
+ }
+#endif
+
+ la->la_entrypt = (uintptr_t) bootcode;
+
+ if (la->la_flags & LOADFLG_NOISY) xprintf(" %d bytes read\n",ttlcopy);
+
+ return (res < 0) ? res : ttlcopy;
+
+}
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_main.c b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_main.c
new file mode 100755
index 0000000..2cf2546
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_main.c
@@ -0,0 +1,611 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Main Module File: cfe_main.c
+ *
+ * This module contains the main "C" routine for CFE and
+ * the main processing loop. There should not be any board-specific
+ * stuff in here.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "cfe_timer.h"
+
+#include "env_subr.h"
+#include "cfe_mem.h"
+#include "cfe.h"
+
+#include "exception.h"
+
+#include "bsp_config.h"
+#include "bcm_hwdefs.h"
+#include "boardparms.h"
+#include "bcm_map.h"
+#include "bcm_cpu.h"
+#include "bcm63xx_util.h"
+
+#include "segtable.h"
+#include "initdata.h"
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#ifndef CFG_STACK_SIZE
+#define STACK_SIZE 8192
+#else
+#define STACK_SIZE ((CFG_STACK_SIZE+1023) & ~1023)
+#endif
+
+/* *********************************************************************
+ * Externs
+ ********************************************************************* */
+
+void cfe_main(int,int);
+void cfe_command_restart(uint64_t status);
+
+extern void cfe_device_poll(void *x);
+
+extern int cfe_web_check(void);
+extern void cfe_web_fg_process(void);
+extern void cfe_web_poll(void *x);
+
+extern const char *builddate;
+extern const char *builduser;
+
+/* Foxconn add start by Cliff Wang, 03/23/2010 */
+extern int ui_init_netcmds(void);
+/* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+const char *cfe_boardname = CFG_BOARDNAME;
+unsigned int cfe_startflags = 0;
+#if defined (_BCM96368_)
+static int cfe_bus_speed = 0;
+static int cfe_ref_speed = 0;
+#endif
+#if defined (_BCM96328_) || defined (_BCM96362_) || defined (_BCM96816_)
+static int cfe_bus_speed = 0;
+static int cfe_ddr_speed = 0;
+#endif
+unsigned long cfe_sdramsize = 8 * 1024 * 1024;
+
+static void calculateCpuSpeed(void);
+
+#if defined (_BCM96328_)
+const uint32 cpu_speed_table[0x20] = {
+ 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
+ 0, 320, 160, 200, 160, 200, 400, 320, 320, 160, 384, 320, 192, 320, 320, 320
+};
+const uint32 ddr_speed_table[0x20] = {
+ 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
+ 0, 80, 100, 100, 160, 200, 400, 400, 80, 160, 160, 160, 192, 192, 240, 320
+};
+const uint32 bus_speed_table[0x20] = {
+ 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
+ 0, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160
+};
+#endif
+
+#if defined (_BCM96362_)
+const uint32 cpu_speed_table[0x20] = {
+ 320, 320, 320, 240, 160, 400, 440, 384, 320, 320, 320, 240, 160, 320, 400, 320,
+ 320, 320, 320, 240, 160, 200, 400, 384, 320, 320, 320, 240, 160, 200, 400, 400
+};
+const uint32 ddr_speed_table[0x20] = {
+ 320, 400, 192, 320, 200, 400, 367, 320, 320, 400, 192, 320, 200, 400, 400, 320,
+ 320, 400, 192, 320, 200, 267, 400, 320, 320, 320, 192, 320, 200, 200, 400, 333
+};
+const uint32 bus_speed_table[0x20] = {
+ 160, 200, 96, 160, 100, 160, 183, 160, 160, 200, 96, 160, 100, 160, 200, 160,
+ 160, 200, 96, 160, 100, 100, 200, 160, 160, 160, 96, 160, 100, 100, 200, 166
+};
+#endif
+
+#if defined (_BCM96816_)
+const uint32 cpu_speed_table[0x20] = {
+ 200, 400, 400, 320, 200, 400, 333, 333, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 400, 400, 200, 360, 400, 400, 300, 300, 320, 320, 400, 400
+};
+const uint32 ddr_speed_table[0x20] = {
+ 200, 333, 200, 200, 200, 333, 333, 333, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 400, 200, 200, 300, 300, 300, 300, 300, 400, 400, 400, 400
+};
+const uint32 bus_speed_table[0x20] = {
+ 200, 200, 200, 160, 100, 167, 200, 167, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 200, 200, 160, 180, 171, 200, 171, 200, 160, 200, 160, 200
+};
+#endif
+
+static unsigned long cfe_get_sdram_size(void);
+
+/* *********************************************************************
+ * cfe_setup_default_env()
+ *
+ * Initialize the default environment for CFE. These are all
+ * the temporary variables that do not get stored in the NVRAM
+ * but are available to other programs and command-line macros.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void cfe_setup_default_env(void)
+{
+ char buffer[80];
+
+ xsprintf(buffer,"%d.%d.%d",CFE_VER_MAJOR,CFE_VER_MINOR,CFE_VER_BUILD);
+ env_setenv("CFE_VERSION",buffer,ENV_FLG_BUILTIN | ENV_FLG_READONLY);
+
+ if (cfe_boardname) {
+ env_setenv("CFE_BOARDNAME",(char *) cfe_boardname,
+ ENV_FLG_BUILTIN | ENV_FLG_READONLY);
+ }
+}
+
+
+/* *********************************************************************
+ * cfe_ledstr(leds)
+ *
+ * Display a string on the board's LED display, if it has one.
+ * This routine depends on the board-support package to
+ * include a "driver" to write to the actual LED, if the board
+ * does not have one this routine will do nothing.
+ *
+ * The LEDs are written at various places in the initialization
+ * sequence, to debug board problems.
+ *
+ * Input parameters:
+ * leds - pointer to four-character ASCII string
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void cfe_ledstr(const char *leds)
+{
+#if 0
+ unsigned int val;
+
+ val = ((((unsigned int) leds[0]) << 24) |
+ (((unsigned int) leds[1]) << 16) |
+ (((unsigned int) leds[2]) << 8) |
+ ((unsigned int) leds[3]));
+
+ cfe_leds(val);
+#endif
+}
+
+
+/* *********************************************************************
+ * cfe_say_hello()
+ *
+ * Print out the CFE startup message and copyright notice
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void cfe_command_restart(uint64_t status)
+{
+}
+
+static void cfe_say_hello(void)
+{
+ xprintf("\n\n");
+ xprintf("CFE version 2.0.3"
+#ifdef CFE_VER_RELEASE
+ ".%d"
+#endif
+ " for DGN2200v2 (%s)\n",
+ //CFE_VER_MAJOR,CFE_VER_MINOR,CFE_VER_BUILD, BCM63XX_MAJOR, BCM63XX_MINOR,
+#ifdef CFE_VER_RELEASE
+ CFE_VER_RELEASE,
+#endif
+ //cfe_boardname,
+#ifdef __long64
+ "64bit,"
+#else
+ "32bit,"
+#endif
+#if CFG_MULTI_CPUS
+ "MP,"
+#else
+ "SP,"
+#endif
+#ifdef __MIPSEL
+ "LE"
+#endif
+#ifdef __MIPSEB
+ "BE"
+#endif
+#if CFG_VAPI
+ ",VAPI"
+#endif
+ );
+
+ xprintf("Build Date: %s (%s)\n",builddate,builduser);
+ xprintf("Copyright (C) 2000-2009 Broadcom Corporation.\n");
+ xprintf("\n");
+}
+
+
+/* *********************************************************************
+ * cfe_restart()
+ *
+ * Restart CFE from scratch, jumping back to the boot vector.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * does not return
+ ********************************************************************* */
+
+void cfe_restart(void)
+{
+ _exc_restart();
+}
+
+
+/* *********************************************************************
+ * cfe_start(ept)
+ *
+ * Start a user program
+ *
+ * Input parameters:
+ * ept - entry point
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+void cfe_start(unsigned long ept)
+{
+ cfe_launch(ept);
+}
+
+/* *********************************************************************
+ * cfe_startup_info()
+ *
+ * Display startup memory configuration messages
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void cfe_startup_info(void)
+{
+ xprintf("Chip ID: BCM%X%X, ", (PERF->RevID & 0xFFFF0000) >> 16, PERF->RevID & 0xFF);
+ xprintf("MIPS: %dMHz",cfe_cpu_speed/1000000);
+#if defined (_BCM96328_) || defined (_BCM96362_) || defined (_BCM96816_)
+ xprintf(", DDR: %dMHz, Bus: %dMHz\n", cfe_ddr_speed/1000000, cfe_bus_speed/1000000);
+#else
+ xprintf("\n");
+#endif
+ {
+ unsigned long tp;
+ __asm __volatile(
+ "mfc0 $9, $22, 3;"
+ "move %0, $9"
+ :"=r" (tp));
+ tp = ((tp & CP0_CMT_TPID) == CP0_CMT_TPID) ? 1 : 0;
+ xprintf("Main Thread: TP%d\n", tp);
+ }
+#if defined (_BCM96328_) || defined (_BCM96362_) || defined (_BCM96816_)
+ if (DDR->TEST_CFG1 & 0x2) { /* Memory Test is finished */
+ xprintf("Memory Test ");
+ if (DDR->TEST_CFG1 & 0x4) {
+ xprintf("Failed\n");
+ }
+ else {
+ xprintf("Passed\n");
+ }
+ }
+#endif
+ cfe_sdramsize = cfe_get_sdram_size();
+ xprintf("Total Memory: %lu bytes (%luMB)\n", cfe_sdramsize, cfe_sdramsize >> 20);
+ xprintf("Boot Address: 0x%x\n\n", FLASH_BASE);
+}
+
+#if defined (_BCM96816_)
+/* *********************************************************************
+ * apm_hvg_init()
+ *
+ * Work around 6816-specific reset logic
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * does not return
+ ********************************************************************* */
+
+static void apm_hvg_init(void)
+{
+ HVG->reg_hvg_cha_misc ^= HVG_SOFT_INIT_0;
+ HVG->reg_hvg_chb_misc ^= HVG_SOFT_INIT_0;
+}
+#endif
+
+/* *********************************************************************
+ * cfe_main(a,b)
+ *
+ * It's gotta start somewhere.
+ *
+ * Input parameters:
+ * a,b - not used
+ *
+ * Return value:
+ * does not return
+ ********************************************************************* */
+
+void cfe_main(int a,int b)
+{
+ /*
+ * By the time this routine is called, the following things have
+ * already been done:
+ *
+ * 1. The processor(s) is(are) initialized.
+ * 2. The caches are initialized.
+ * 3. The memory controller is initialized.
+ * 4. BSS has been zeroed.
+ * 5. The data has been moved to R/W space.
+ * 6. The "C" Stack has been initialized.
+ */
+
+ cfe_bg_init(); /* init background processing */
+ cfe_attach_init();
+ calculateCpuSpeed();
+ cfe_timer_init(); /* Timer process */
+ cfe_bg_add(cfe_device_poll,NULL);
+
+ /*
+ * Initialize the memory allocator
+ */
+ KMEMINIT((unsigned char *) (uintptr_t) mem_heapstart,
+ ((CFG_HEAP_SIZE)*1024));
+
+ /*
+ * Initialize the console. It is done before the other devices
+ * get turned on.
+ */
+
+ board_console_init();
+ cfe_setup_exceptions();
+ cfe_say_hello();
+
+#if defined(CONFIG_BRCM_IKOS)
+ {
+ /*0x694b6f32 (iKo2) is replaced with actual addr during the build process*/
+ static unsigned long linuxStartAddr=0x694b6f32;
+ printf("IKOS Build: Jump to Linux start address 0x%8.8lx.\n\n",
+ linuxStartAddr);
+ cfe_launch(linuxStartAddr);
+ }
+#endif
+
+ cfe_arena_init();
+ board_device_init();
+ cfe_startup_info();
+ cfe_setup_default_env();
+ ui_init_cmddisp();
+ getBootLine();
+ getBoardParam();
+#if defined (_BCM96816_)
+ apm_hvg_init();
+#endif
+
+ /* Foxconn add start by Cliff Wang, 03/23/2010 */
+ ui_init_netcmds();
+ /* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+ board_final_init();
+ cfe_command_loop();
+
+
+}
+
+
+/* *********************************************************************
+ * cfe_command_loop()
+ *
+ * This routine reads and processes user commands
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * does not return
+ ********************************************************************* */
+
+void cfe_command_loop()
+{
+ char buffer[300];
+ int status;
+ char *prompt;
+
+ /* Start Web interface. */
+ cfe_bg_add(cfe_web_poll,NULL);
+
+ for (;;) {
+ prompt = env_getenv("PROMPT");
+ if (!prompt) prompt = "CFE> ";
+ console_readline(prompt,buffer,sizeof(buffer));
+
+ if (cfe_web_check())
+ cfe_web_fg_process();
+ else {
+ status = ui_docommands(buffer);
+ if (status != CMD_ERR_BLANK) {
+ xprintf("*** command status = %d\n", status);
+ }
+ }
+ }
+}
+
+/* *********************************************************************
+ * cfe_errortext(err)
+ *
+ * Returns an error message with a number in it. The number can be
+ * looked up in cfe_error.h.
+ *
+ * Input parameters:
+ * err - error code
+ *
+ * Return value:
+ * string description of error
+ ********************************************************************* */
+
+const char *cfe_errortext(int err)
+{
+ static char err_buf[20];
+
+ sprintf(err_buf, "CFE error %d", err);
+ return (const char *) err_buf;
+}
+
+#if defined (_BCM96368_)
+/* *********************************************************************
+ * calculateCpuSpeed()
+ * Calculate BCM6368 CPU speed by reading the PLL Config register
+ * and applying the following formula:
+ * Fref_clk = (64 * (P2/P1) * (MIPSDDR_NDIV / REF_MDIV)
+ * Fbus_clk = (64 * (P2/P1) * (MIPSDDR_NDIV / DDR_MDIV)
+ * Fcpu_clk = (64 * (P2/P1) * (MIPSDDR_NDIV / CPU_MDIV)
+ * Input parameters:
+ * none
+ * Return value:
+ * none
+ ********************************************************************* */
+void static calculateCpuSpeed(void)
+{
+ UINT32 numerator;
+ UINT32 pllConfig = DDR->MIPSDDRPLLConfig;
+ UINT32 pllMDiv = DDR->MIPSDDRPLLMDiv;
+
+ numerator = 64000000 / ((pllConfig & MIPSDDR_P1_MASK) >> MIPSDDR_P1_SHFT) *
+ ((pllConfig & MIPSDDR_P2_MASK) >> MIPSDDR_P2_SHFT) *
+ ((pllConfig & MIPSDDR_NDIV_MASK) >> MIPSDDR_NDIV_SHFT);
+
+ cfe_cpu_speed = numerator / ((pllMDiv & MIPS_MDIV_MASK) >> MIPS_MDIV_SHFT);
+ cfe_bus_speed = numerator / ((pllMDiv & DDR_MDIV_MASK) >> DDR_MDIV_SHFT);
+ cfe_ref_speed = numerator / ((pllConfig & REF_MDIV_MASK) >> REF_MDIV_SHFT);
+}
+#endif
+
+#if defined (_BCM96328_) || defined (_BCM96362_) || (_BCM96816_)
+/* *********************************************************************
+ * calculateCpuSpeed()
+ * Calculate CPU speed by reading strap register
+ * Input parameters:
+ * none
+ * Return value:
+ * none
+ ********************************************************************* */
+void static calculateCpuSpeed(void)
+{
+ uint32 mips_pll_fvco;
+
+ mips_pll_fvco = MISC->miscStrapBus & MISC_STRAP_BUS_MIPS_PLL_FVCO_MASK;
+ mips_pll_fvco >>= MISC_STRAP_BUS_MIPS_PLL_FVCO_SHIFT;
+ cfe_cpu_speed = cpu_speed_table[mips_pll_fvco] * 1000000;
+ cfe_ddr_speed = ddr_speed_table[mips_pll_fvco] * 1000000;
+ cfe_bus_speed = bus_speed_table[mips_pll_fvco] * 1000000;
+}
+#endif
+
+/* *********************************************************************
+ * cfe_get_sdram_size(void)
+ *
+ * Return amount of SDRAM on the board.
+ *
+ * Input parameters:
+ * None.
+ *
+ * Return value:
+ * Amount of SDRAM on the board.
+ ********************************************************************* */
+static unsigned long cfe_get_sdram_size(void)
+{
+#if defined (_BCM96368_)
+ uint32 size;
+ uint32 memCfg;
+
+ size = 1;
+ memCfg = MEMC->Config;
+ /* Number of column bits */
+ size <<= (((memCfg & MEMC_COL_MASK) >> MEMC_COL_SHFT) + 8);
+ /* Plus number of row bits */
+ size <<= (((memCfg & MEMC_ROW_MASK) >> MEMC_ROW_SHFT) + 11);
+ /* Plus bus width */
+ if (((memCfg & MEMC_WIDTH_MASK) >> MEMC_WIDTH_SHFT) == MEMC_32BIT_BUS)
+ size <<= 2;
+ else
+ size <<= 1;
+
+ /* Plus number of banks */
+ size <<= 2;
+
+ return( size );
+#else
+ return (DDR->CSEND << 24);
+#endif
+}
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_net_icmp.c b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_net_icmp.c
new file mode 100755
index 0000000..89802f8
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_net_icmp.c
@@ -0,0 +1,199 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * ICMP Protocol File: net_icmp.c
+ *
+ * This module implements portions of the ICMP protocol. Note
+ * that it is not a complete implementation, just enough to
+ * generate and respond to ICMP echo requests.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_timer.h"
+
+#include "net_ebuf.h"
+#include "net_ether.h"
+
+#include "net_ip.h"
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define ICMP_CODE_ECHO 0
+#define ICMP_TYPE_ECHOREPLY 0
+#define ICMP_TYPE_ECHOREQ 8
+
+#define ICMPMSG(type,code) (((type)<<8)|(code))
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+struct icmp_info_s {
+ ip_info_t *icmp_ipinfo;
+ queue_t icmp_echoreplies;
+ int icmp_maxreplies;
+};
+
+/* *********************************************************************
+ * ICMP_RX_CALLBACK(ref,buf,dst,src)
+ *
+ * This routine is called by the IP layer when we receive
+ * ICMP protocol messages.
+ *
+ * Input parameters:
+ * ref - reference data (an icmp_info_t)
+ * buf - the ebuf containing the buffer
+ * dst - destination IP address (us, usually)
+ * src - source IP address
+ *
+ * Return value:
+ * ETH_KEEP to keep packet, ETH_DROP to cause packet to be freed
+ ********************************************************************* */
+
+static int icmp_rx_callback(void *ref,ebuf_t *buf,uint8_t *dst,uint8_t *src)
+{
+ icmp_info_t *icmp = (icmp_info_t *)ref;
+ ip_info_t *ipi = icmp->icmp_ipinfo;
+ uint16_t imsg;
+ uint16_t cksum;
+ ebuf_t *txbuf;
+ uint8_t *icmphdr;
+ int res;
+
+ imsg = ICMPMSG(buf->eb_ptr[0],buf->eb_ptr[1]);
+
+ res = ETH_DROP; /* assume we're dropping the pkt */
+
+ switch (imsg) {
+ case ICMPMSG(ICMP_TYPE_ECHOREQ,ICMP_CODE_ECHO):
+ txbuf = _ip_alloc(ipi);
+ if (txbuf) {
+ /* Construct reply from the original packet. */
+ icmphdr = txbuf->eb_ptr;
+ ebuf_append_bytes(txbuf,buf->eb_ptr,buf->eb_length);
+ icmphdr[0] = ICMP_TYPE_ECHOREPLY;
+ icmphdr[1] = ICMP_CODE_ECHO;
+ icmphdr[2] = 0; icmphdr[3] = 0;
+ cksum = ~ip_chksum(0,icmphdr,ebuf_length(txbuf));
+ icmphdr[2] = (cksum >> 8) & 0xFF;
+ icmphdr[3] = (cksum & 0xFF);
+ if (_ip_send(ipi,txbuf,src,IPPROTO_ICMP) < 0) {
+ _ip_free(ipi,txbuf);
+ }
+ }
+ break;
+
+ case ICMPMSG(ICMP_TYPE_ECHOREPLY,ICMP_CODE_ECHO):
+ if (q_count(&(icmp->icmp_echoreplies)) < icmp->icmp_maxreplies) {
+ /* We're keeping this packet, put it on the queue and don't
+ free it in the driver. */
+ q_enqueue(&(icmp->icmp_echoreplies),(queue_t *) buf);
+ res = ETH_KEEP;
+ }
+ break;
+
+ default:
+ res = ETH_DROP;
+ }
+
+ return res;
+}
+
+
+/* *********************************************************************
+ * _ICMP_INIT(ipi)
+ *
+ * Initialize the ICMP layer.
+ *
+ * Input parameters:
+ * ipi - ipinfo structure of IP layer to attach to
+ *
+ * Return value:
+ * icmp_info_t structure or NULL if error occurs
+ ********************************************************************* */
+
+icmp_info_t *_icmp_init(ip_info_t *ipi)
+{
+ icmp_info_t *icmp;
+
+ icmp = (icmp_info_t *) KMALLOC(sizeof(icmp_info_t),0);
+ if (!icmp) return NULL;
+
+ icmp->icmp_ipinfo = ipi;
+ q_init(&(icmp->icmp_echoreplies));
+ icmp->icmp_maxreplies = 0;
+
+ _ip_register(ipi,IPPROTO_ICMP,icmp_rx_callback,icmp);
+
+ return icmp;
+}
+
+/* *********************************************************************
+ * _ICMP_UNINIT(icmp)
+ *
+ * Un-initialize the ICMP layer.
+ *
+ * Input parameters:
+ * icmp - icmp_info_t structure
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void _icmp_uninit(icmp_info_t *icmp)
+{
+ _ip_deregister(icmp->icmp_ipinfo,IPPROTO_ICMP);
+
+ KFREE(icmp);
+}
+
+int _icmp_ping(icmp_info_t *icmp,uint8_t *dest,int seq,int len)
+{
+ return 0;
+}
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_ram_boot.S b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_ram_boot.S
new file mode 100755
index 0000000..cf48de0
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_ram_boot.S
@@ -0,0 +1,88 @@
+#include "sbmips.h"
+
+/* *********************************************************************
+ * BOARD_EARLYINIT()
+ *
+ * Initialize board registers. This is the earliest
+ * time the BSP gets control. This routine cannot assume that
+ * memory is operational, and therefore all code in this routine
+ * must run from registers only. The $ra register must not
+ * be modified, as it contains the return address.
+ *
+ * This routine will be called from uncached space, before
+ * the caches are initialized. If you want to make
+ * subroutine calls from here, you must use the CALLKSEG1 macro.
+ *
+ * Among other things, this is where the GPIO registers get
+ * programmed to make on-board LEDs function, or other startup
+ * that has to be done before anything will work.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+LEAF(board_earlyinit)
+ j ra
+END(board_earlyinit)
+
+/* *********************************************************************
+ * BOARD_DRAMINFO
+ *
+ * Return the address of the DRAM information table
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * v0 - DRAM info table, return 0 to use default table
+ ********************************************************************* */
+LEAF(board_draminfo)
+ j ra
+END(board_draminfo)
+
+/* *********************************************************************
+ * BOARD_DRAMINIT
+ *
+ * This routine should activate memory.
+ *
+ * Input parameters:
+ * a0 - points to configuration table returned by board_draminfo
+ * or 0 to use an automatic table
+ *
+ * Return value:
+ * v0 - total memory installed
+ *
+ * Registers used:
+ * can use all registers.
+ ********************************************************************* */
+LEAF(board_draminit)
+ j ra
+END(board_draminit)
+
+/* *********************************************************************
+ * BOARD_SETLEDS(x)
+ *
+ * Set LEDs for boot-time progress indication. Not used if
+ * the board does not have progress LEDs. This routine
+ * must not call any other routines, since it may be invoked
+ * either from KSEG0 or KSEG1 and it may be invoked
+ * whether or not the icache is operational.
+ *
+ * Input parameters:
+ * a0 - LED value (8 bits per character, 4 characters)
+ *
+ * Return value:
+ * nothing
+ *
+ * Registers used:
+ * t0,t1,t2,t3
+ ********************************************************************* */
+LEAF(board_setleds)
+ j ra
+END(board_setleds)
+
+LEAF(bcmcore_tp1_switch)
+ j ra
+END(bcmcore_tp1_switch)
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_util.c b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_util.c
new file mode 100755
index 0000000..91e1ad0
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/bcm63xx_util.c
@@ -0,0 +1,1375 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * bcm63xx utility functions
+ *
+ * Created on : 04/18/2002 seanl
+ *
+ *********************************************************************
+
+<:copyright-broadcom
+
+ Copyright (c) 2002 Broadcom Corporation
+ All Rights Reserved
+ No portions of this material may be reproduced in any form without the
+ written permission of:
+ Broadcom Corporation
+ 16215 Alton Parkway
+ Irvine, California 92619
+ All information contained in this document is Broadcom Corporation
+ company private, proprietary, and trade secret.
+
+:>
+*/
+
+#define BCMTAG_EXE_USE
+#include "bcm63xx_util.h"
+#include "flash_api.h"
+#include "jffs2.h"
+
+#define je16_to_cpu(x) ((x).v16)
+#define je32_to_cpu(x) ((x).v32)
+
+static void convertBootInfo(void);
+static int checkChipId(int tagChipId, char *sig2);
+static void UpdateImageSequenceNumber( char *imageSequence );
+
+BOOT_INFO bootInfo;
+
+static int parseFilename(char *fn)
+{
+ if (strlen(fn) < BOOT_FILENAME_LEN)
+ return 0;
+ else
+ return 1;
+}
+
+static int parseChoiceFh(char *choice)
+{
+
+ if (*choice == 'f' || *choice == 'h')
+ return 0;
+ else
+ return 1;
+}
+
+
+static int parseBootPartition(char *choice)
+{
+ return( (*choice == BOOT_LATEST_IMAGE || *choice == BOOT_PREVIOUS_IMAGE)
+ ? 0 : 1 );
+}
+
+static int parseChoice09(char *choice)
+{
+ int bChoice = *choice - '0';
+
+ if (bChoice >= 0 && bChoice <= 9)
+ return 0;
+ else
+ return 1;
+}
+
+static int parseIpAddr(char *ipStr);
+static int parseGwIpAddr(char *ipStr);
+static int parseAfeId(char *afeIdStr);
+
+#define PARAM_IDX_BOARD_IPADDR 0
+#define PARAM_IDX_HOST_IPADDR 1
+#define PARAM_IDX_GW_IPADDR 2
+#define PARAM_IDX_RUN_FROM 3
+#define PARAM_IDX_RUN_FILENAME 4
+#define PARAM_IDX_FLASH_FILENAME 5
+#define PARAM_IDX_BOOT_DELAY 6
+#define PARAM_IDX_BOOT_IMAGE 7
+
+static PARAMETER_SETTING gBootParam[] =
+{
+ // prompt name Error Prompt Boot Define Boot Param Validation function
+ {"Board IP address :", IP_PROMPT , "e=",
+ "", 24, parseIpAddr, TRUE}, // index 0
+ {"Host IP address :", IP_PROMPT , "h=",
+ "", 15, parseIpAddr, TRUE}, // index 1
+ {"Gateway IP address :", IP_PROMPT , "g=",
+ "", 15, parseGwIpAddr, TRUE}, // index 2
+ {"Run from flash/host (f/h) :", RUN_FROM_PROMPT , "r=",
+ "", 1, parseChoiceFh, TRUE}, // index 3
+ {"Default host run file name :", HOST_FN_PROMPT , "f=",
+ "", MAX_PROMPT_LEN - 1, parseFilename, TRUE}, // index 4
+ {"Default host flash file name :", FLASH_FN_PROMPT , "i=",
+ "", MAX_PROMPT_LEN - 1, parseFilename, TRUE}, // index 5
+ {"Boot delay (0-9 seconds) :", BOOT_DELAY_PROMPT, "d=",
+ "", 1, parseChoice09, TRUE}, // index 6
+ {"Boot image (0=latest, 1=previous) :", BOOT_PARTITION_PROMPT, "p=",
+ "", 1, parseBootPartition, TRUE}, // index 7
+ {NULL},
+};
+
+static int gNumBootParams = (sizeof(gBootParam) / sizeof(PARAMETER_SETTING))-1;
+
+static PARAMETER_SETTING gAfeId[] =
+{
+ // prompt name Error Prompt Boot Define Boot Param Validation function
+ {"Primary AFE ID :", AFE_PROMPT, "", "", 12, parseAfeId, TRUE}, // index 0
+ {"Bonding AFE ID :", AFE_PROMPT, "", "", 12, parseAfeId, TRUE}, // index 1
+ {NULL},
+};
+static int gAfeIdParams = (sizeof(gAfeId) / sizeof(PARAMETER_SETTING))-1;
+
+// move from lib_misc.c
+int parseipaddr(const char *ipaddr,uint8_t *dest)
+{
+ int a,b,c,d;
+ char *x;
+
+ /* make sure it's all digits and dots. */
+ x = (char *) ipaddr;
+ while (*x) {
+ if ((*x == '.') || ((*x >= '0') && (*x <= '9'))) {
+ x++;
+ continue;
+ }
+ return -1;
+ }
+
+ x = (char *) ipaddr;
+ a = lib_atoi(ipaddr);
+ x = lib_strchr(x,'.');
+ if (!x) return -1;
+ b = lib_atoi(x+1);
+ x = lib_strchr(x+1,'.');
+ if (!x) return -1;
+ c = lib_atoi(x+1);
+ x = lib_strchr(x+1,'.');
+ if (!x) return -1;
+ d = lib_atoi(x+1);
+
+ if ((a < 0) || (a > 255)) return -1;
+ if ((b < 0) || (b > 255)) return -1;
+ if ((c < 0) || (c > 255)) return -1;
+ if ((d < 0) || (d > 255)) return -1;
+
+ dest[0] = (uint8_t) a;
+ dest[1] = (uint8_t) b;
+ dest[2] = (uint8_t) c;
+ dest[3] = (uint8_t) d;
+
+ return 0;
+}
+
+#if 0
+static const char hextable[16] = "0123456789ABCDEF";
+void dumpHex(unsigned char *start, int len)
+{
+ unsigned char *ptr = start,
+ *end = start + len;
+
+ while (ptr < end)
+ {
+ long offset = ptr - start;
+ unsigned char text[120],
+ *p = text;
+ while (ptr < end && p < &text[16 * 3])
+ {
+ *p++ = hextable[*ptr >> 4];
+ *p++ = hextable[*ptr++ & 0xF];
+ *p++ = ' ';
+ }
+ p[-1] = 0;
+ printf("%4lX %s\n", offset, text);
+ }
+}
+
+#endif
+
+int parsexdigit(char str)
+{
+ int digit;
+
+ if ((str >= '0') && (str <= '9'))
+ digit = str - '0';
+ else if ((str >= 'a') && (str <= 'f'))
+ digit = str - 'a' + 10;
+ else if ((str >= 'A') && (str <= 'F'))
+ digit = str - 'A' + 10;
+ else
+ return -1;
+
+ return digit;
+}
+
+
+// convert in = fffffff00 to out=255.255.255.0
+// return 0 = OK, 1 failed.
+static int convertMaskStr(char *in, char *out)
+{
+ int i;
+ char twoHex[4];
+ uint8_t dest[4];
+ char mask[BOOT_IP_LEN];
+
+ if (strlen(in) != MASK_LEN) // mask len has to 8
+ return 1;
+
+ memset(twoHex, 0, sizeof(twoHex));
+ for (i = 0; i < 4; i++)
+ {
+ twoHex[0] = (uint8_t)*in++;
+ twoHex[1] = (uint8_t)*in++;
+ if (parsexdigit(*twoHex) == -1)
+ return 1;
+ dest[i] = (uint8_t) xtoi(twoHex);
+ }
+ sprintf(mask, "%d.%d.%d.%d", dest[0], dest[1], dest[2], dest[3]);
+ strcpy(out, mask);
+ return 0;
+}
+
+// return 0 - OK, !0 - Bad ip
+static int parseIpAddr(char *ipStr)
+{
+ char *x;
+ uint8_t dest[4];
+ char mask[BOOT_IP_LEN];
+ char ipMaskStr[2*BOOT_IP_LEN];
+
+ strcpy(ipMaskStr, ipStr);
+
+ x = strchr(ipMaskStr,':');
+ if (!x) // no mask
+ return parseipaddr(ipMaskStr, dest);
+
+ *x = '\0';
+
+ if (parseipaddr(ipMaskStr, dest)) // ipStr is not ok
+ return 1;
+
+ x++;
+ return convertMaskStr(x, mask); // mask is not used here
+
+}
+
+// return 0 - OK, !0 - Bad ip
+static int parseGwIpAddr(char *ipStr)
+{
+ int ret = 0;
+ if( *ipStr )
+ ret = parseIpAddr(ipStr);
+ return(ret);
+}
+
+// return 0 - OK, !0 - Bad ip
+static int parseAfeId(char *afeIdStr)
+{
+ return 0;
+}
+
+// port from ifconfig command in ui_netcmds.c
+void enet_init(void)
+{
+ char devname[] = "eth0";
+ uint8_t addr[IP_ADDR_LEN];
+ int res;
+ NVRAM_DATA nvramData;
+
+ readNvramData(&nvramData);
+
+ if (net_getparam(NET_DEVNAME) == NULL) {
+ res = net_init(devname); /* turn interface on */
+ if (res < 0) {
+ ui_showerror(res, "Could not activate network interface '%s'", devname);
+ return;
+ }
+ }
+
+ net_setparam(NET_HWADDR, nvramData.ucaBaseMacAddr);
+
+ parseipaddr(bootInfo.boardIp, addr);
+ net_setparam(NET_IPADDR, addr);
+
+ if (strlen(bootInfo.boardMask) > 0) {
+ parseipaddr(bootInfo.boardMask, addr);
+ net_setparam(NET_NETMASK, addr);
+ }
+
+ if (strlen(bootInfo.gatewayIp) > 0) {
+ parseipaddr(bootInfo.gatewayIp, addr);
+ net_setparam(NET_GATEWAY, addr);
+ }
+
+ net_setnetvars();
+}
+
+/***************************************************************************
+// Function Name: getCrc32
+// Description : caculate the CRC 32 of the given data.
+// Parameters : pdata - array of data.
+// size - number of input data bytes.
+// crc - either CRC32_INIT_VALUE or previous return value.
+// Returns : crc.
+****************************************************************************/
+UINT32 getCrc32(byte *pdata, UINT32 size, UINT32 crc)
+{
+ while (size-- > 0)
+ crc = (crc >> 8) ^ Crc32_table[(crc ^ *pdata++) & 0xff];
+
+ return crc;
+}
+
+
+// return 0, ok. return -1 = wrong chip
+static int checkChipId(int tagChipId, char *sig2)
+{
+ unsigned int chipId = (PERF->RevID & 0xFFFE0000) >> 16;
+ int result = 0;
+
+ /* Force BCM681x variants to be be BCM6816) */
+ if( (chipId & 0xfff0) == 0x6810 )
+ chipId = 0x6816;
+
+ if (tagChipId == chipId)
+ result = 0;
+ else {
+ printf("Chip Id error. Image Chip Id = %04x, Board Chip Id = %04x.\n", tagChipId, chipId);
+ result = -1;
+ }
+
+ return result;
+}
+
+// return -1: fail.
+// 0: OK.
+int verifyTag( PFILE_TAG pTag, int verbose )
+{
+ UINT32 crc;
+ FLASH_ADDR_INFO info;
+ int tagVer, curVer;
+
+ kerSysFlashAddrInfoGet( &info );
+
+ tagVer = atoi(pTag->tagVersion);
+ curVer = atoi(BCM_TAG_VER);
+
+ if (tagVer != curVer)
+ {
+ if( verbose )
+ {
+ printf("Firmware tag version [%d] is not compatible with the current Tag version [%d].\n", \
+ tagVer, curVer);
+ }
+ return -1;
+ }
+
+ if (checkChipId(xtoi(pTag->chipId), pTag->signiture_2) != 0)
+ return -1;
+
+ // check tag validate token first
+ crc = CRC32_INIT_VALUE;
+ crc = getCrc32((byte *) pTag, (UINT32)TAG_LEN-TOKEN_LEN, crc);
+
+ if (crc != (UINT32)(*(UINT32*)(pTag->tagValidationToken)))
+ {
+ if( verbose )
+ printf("Illegal image ! Tag crc failed.\n");
+ return -1;
+ }
+ return 0;
+}
+
+#if (INC_NAND_FLASH_DRIVER==0)
+PFILE_TAG getTagFromPartition(int imageNumber)
+{
+ static unsigned char sectAddr1[sizeof(FILE_TAG)];
+ static unsigned char sectAddr2[sizeof(FILE_TAG)];
+ int blk = 0;
+ UINT32 crc;
+ PFILE_TAG pTag = NULL;
+ unsigned char *pBase = flash_get_memptr(0);
+ unsigned char *pSectAddr = NULL;
+
+ /* The image tag for the first image is always after the boot loader.
+ * The image tag for the second image, if it exists, is at one half
+ * of the flash size.
+ */
+ if( imageNumber == 1 )
+ {
+
+ FLASH_ADDR_INFO flash_info;
+
+ kerSysFlashAddrInfoGet(&flash_info);
+ blk = flash_get_blk((int)(pBase+flash_info.flash_rootfs_start_offset));
+ pSectAddr = sectAddr1;
+ }
+ else
+ if( imageNumber == 2 )
+ {
+ blk = flash_get_blk((int) (pBase + (flash_get_total_size() / 2)));
+ pSectAddr = sectAddr2;
+ }
+
+ if( blk )
+ {
+ memset(pSectAddr, 0x00, sizeof(FILE_TAG));
+ flash_read_buf((unsigned short) blk, 0, pSectAddr, sizeof(FILE_TAG));
+ crc = CRC32_INIT_VALUE;
+ crc = getCrc32(pSectAddr, (UINT32)TAG_LEN-TOKEN_LEN, crc);
+ pTag = (PFILE_TAG) pSectAddr;
+ if (crc != (UINT32)(*(UINT32*)(pTag->tagValidationToken)))
+ pTag = NULL;
+ }
+
+ return( pTag );
+}
+#else
+#define tag_not_searched 0
+#define tag_not_found 1
+#define tag_found 2
+PFILE_TAG getTagFromPartition(int imageNumber)
+{
+ extern unsigned char *mem_topofmem;
+ static FILE_TAG Tag1 = {{tag_not_searched}};
+ static FILE_TAG Tag2 = {{tag_not_searched}};
+ PFILE_TAG pTag = (imageNumber == 2) ? &Tag2 : &Tag1;
+ PFILE_TAG ret = NULL;
+
+ switch( pTag->tagVersion[0] )
+ {
+ case tag_not_searched:
+ {
+ int rootfs = (imageNumber == 2) ? NP_ROOTFS_2 : NP_ROOTFS_1;
+ char fname[] = NAND_CFE_RAM_NAME;
+ int fname_actual_len = strlen(fname);
+ int fname_cmp_len = strlen(fname) - 3; /* last three are digits */
+ unsigned char *buf = (unsigned char *) mem_topofmem + 1024;
+ unsigned char *p;
+ int len = flash_get_sector_size(0);
+ int num_blks = flash_get_numsectors();
+ int i, done, start_blk, end_blk;
+ struct jffs2_raw_dirent *pdir;
+ unsigned long version = 0;
+ NVRAM_DATA nvramData;
+
+ pTag->tagVersion[0] = tag_not_found;
+ readNvramData(&nvramData);
+ validateNandPartTbl(&nvramData);
+
+ if( nvramData.ulNandPartOfsKb[rootfs] > 0 &&
+ nvramData.ulNandPartOfsKb[rootfs] < ((num_blks * len) / 1024) &&
+ nvramData.ulNandPartSizeKb[rootfs] > 0 &&
+ nvramData.ulNandPartSizeKb[rootfs] < ((num_blks * len) / 1024) )
+ {
+ const int max_not_jffs2 = 10;
+ int not_jffs2 = 0;
+
+ start_blk = nvramData.ulNandPartOfsKb[rootfs] / (len / 1024);
+ end_blk =
+ start_blk + (nvramData.ulNandPartSizeKb[rootfs] / (len / 1024));
+
+ /* Find the directory entry. */
+ for( i = start_blk, done = 0; i < end_blk && done == 0; i++ )
+ {
+ if( flash_read_buf(i, 0, buf, len) > 0 )
+ {
+ p = buf;
+ while( p < buf + len )
+ {
+ pdir = (struct jffs2_raw_dirent *) p;
+ if( je16_to_cpu(pdir->magic) == JFFS2_MAGIC_BITMASK )
+ {
+ if( je16_to_cpu(pdir->nodetype) ==
+ JFFS2_NODETYPE_DIRENT &&
+ fname_actual_len == pdir->nsize &&
+ !memcmp(fname, pdir->name, fname_cmp_len) )
+ {
+ if( je32_to_cpu(pdir->version) > version )
+ {
+ if( je32_to_cpu(pdir->ino) != 0 )
+ {
+ unsigned char *seq =
+ pdir->name + fname_cmp_len;
+ pTag->imageSequence[0] = seq[0];
+ pTag->imageSequence[1] = seq[1];
+ pTag->imageSequence[2] = seq[2];
+ pTag->imageSequence[3] = '\0';
+ pTag->tagVersion[0] = tag_found;
+
+ version = je32_to_cpu(pdir->version);
+
+ /* Setting 'done = 1' assumes there is
+ * only one version of the directory
+ * entry.
+ */
+ done = 1;
+ ret = pTag;
+ break;
+ }
+ }
+ }
+
+ p += (je32_to_cpu(pdir->totlen) + 0x03) & ~0x03;
+ not_jffs2 = 0;
+ }
+ else
+ {
+ if( not_jffs2++ > max_not_jffs2 )
+ done = 1;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ break;
+
+ case tag_found:
+ ret = pTag;
+ break;
+
+ case tag_not_found:
+ ret = NULL;
+ break;
+ }
+
+ return(ret);
+}
+#endif
+
+
+int getPartitionFromTag( PFILE_TAG pTag )
+{
+ int ret = 0;
+
+ if( pTag )
+ {
+ PFILE_TAG pTag1 = getTagFromPartition(1);
+ PFILE_TAG pTag2 = getTagFromPartition(2);
+ int sequence = atoi(pTag->imageSequence);
+ int sequence1 = (pTag1) ? atoi(pTag1->imageSequence) : -1;
+ int sequence2 = (pTag2) ? atoi(pTag2->imageSequence) : -1;
+
+ if( pTag1 && sequence == sequence1 )
+ ret = 1;
+ else
+ if( pTag2 && sequence == sequence2 )
+ ret = 2;
+ }
+
+ return( ret );
+}
+
+PFILE_TAG getBootImageTag(void)
+{
+ PFILE_TAG pTag = NULL;
+
+ if( flash_get_flash_type() != FLASH_IFC_NAND )
+ {
+ PFILE_TAG pTag1 = getTagFromPartition(1);
+
+ /* Foxconn modified end pling 10/13/2008 */
+ PFILE_TAG pTag2 = NULL;
+ // PFILE_TAG pTag2 = getTagFromPartition(2);
+ //* Foxconn modified end pling 10/13/2008 */
+
+ if( pTag1 && pTag2 )
+ {
+ /* Two images are flashed. */
+ int sequence1 = atoi(pTag1->imageSequence);
+ int sequence2 = atoi(pTag2->imageSequence);
+
+ if( bootInfo.bootPartition == BOOT_LATEST_IMAGE )
+ pTag = (sequence2 > sequence1) ? pTag2 : pTag1;
+ else /* Boot from the previous image. */
+ pTag = (sequence2 < sequence1) ? pTag2 : pTag1;
+ }
+ else
+ /* One image is flashed. */
+ pTag = (pTag2) ? pTag2 : pTag1;
+ }
+ else
+ {
+ /* TBD. Verify that linux is on the file system. */
+ /* pTag pointer is only compared to NULL for NAND flash boot. */
+ pTag = (PFILE_TAG) 1;
+ }
+
+ return( pTag );
+}
+
+static void UpdateImageSequenceNumber( char *imageSequence )
+{
+ int newImageSequence = 0;
+ PFILE_TAG pTag = getTagFromPartition(1);
+
+ if( pTag )
+ newImageSequence = atoi(pTag->imageSequence);
+
+ pTag = getTagFromPartition(2);
+ if( pTag && atoi(pTag->imageSequence) > newImageSequence )
+ newImageSequence = atoi(pTag->imageSequence);
+
+ newImageSequence++;
+ sprintf(imageSequence, "%d", newImageSequence);
+}
+
+// return -1: fail.
+// 0: OK.
+int flashImage(uint8_t *imagePtr)
+{
+ UINT32 crc;
+ FLASH_ADDR_INFO info;
+ int totalImageSize = 0;
+ int cfeSize;
+ int cfeAddr, rootfsAddr, kernelAddr;
+ int status = 0;
+ PFILE_TAG pTag = (PFILE_TAG) imagePtr;
+ NVRAM_DATA nvramData, tmpNvramData;
+
+ if( flash_get_flash_type() == FLASH_IFC_NAND )
+ {
+ printf("ERROR: Image is not a valid NAND flash image.\n");
+ return -1;
+ }
+
+ // save existing NVRAM data into a local structure
+ readNvramData(&nvramData);
+
+ if( verifyTag( pTag, 1 ) == -1 )
+ return -1;
+
+ kerSysFlashAddrInfoGet( &info );
+
+ // check imageCrc
+ totalImageSize = atoi(pTag->totalImageLen);
+ crc = CRC32_INIT_VALUE;
+ crc = getCrc32((imagePtr+TAG_LEN), (UINT32) totalImageSize, crc);
+
+ if (crc != (UINT32) (*(UINT32*)(pTag->imageValidationToken)))
+ {
+ printf(" Illegal image ! Image crc failed.\n");
+ return -1;
+ }
+
+ cfeSize = cfeAddr = rootfsAddr = kernelAddr = 0;
+
+ // check cfe's existence
+ cfeAddr = atoi(pTag->cfeAddress);
+ if (cfeAddr)
+ {
+ cfeSize = atoi(pTag->cfeLen);
+ if( (cfeSize <= 0) )
+ {
+ printf("Illegal cfe size [%d].\n", cfeSize );
+ return -1;
+ }
+
+ printf("\nFlashing CFE: ");
+ if ((status = kerSysBcmImageSet(cfeAddr+BOOT_OFFSET, imagePtr+TAG_LEN,
+ cfeSize, 0)) != 0)
+ {
+ printf("Failed to flash CFE. Error: %d\n", status);
+ return status;
+ }
+
+ // Check if the new image has valid NVRAM
+ if ((readNvramData(&tmpNvramData) != 0) || (BpSetBoardId(tmpNvramData.szBoardId) != BP_SUCCESS) || (BpSetVoiceBoardId(tmpNvramData.szBoardId) != BP_SUCCESS))
+ writeNvramData(&nvramData);
+ }
+
+ // check root filesystem and kernel existence
+ rootfsAddr = atoi(pTag->rootfsAddress);
+ kernelAddr = atoi(pTag->kernelAddress);
+
+ if( rootfsAddr && kernelAddr )
+ {
+ char *p;
+ unsigned char *tagFs = imagePtr;
+ unsigned int baseAddr = (unsigned int) flash_get_memptr(0);
+ unsigned int totalSize = (unsigned int) flash_get_total_size();
+ unsigned int reservedBytesAtEnd;
+ unsigned int availableSizeOneImg;
+ unsigned int reserveForTwoImages;
+ unsigned int availableSizeTwoImgs;
+ unsigned int newImgSize = atoi(pTag->rootfsLen)+atoi(pTag->kernelLen);
+ PFILE_TAG pCurTag = getBootImageTag();
+ UINT32 crc;
+ unsigned int curImgSize = 0;
+ unsigned int rootfsOffset = (unsigned int)rootfsAddr-IMAGE_BASE-TAG_LEN;
+ FLASH_ADDR_INFO flash_info;
+
+ kerSysFlashAddrInfoGet(&flash_info);
+ if( rootfsOffset < flash_info.flash_rootfs_start_offset )
+ {
+ // Increase rootfs and kernel addresses by the difference between
+ // rootfs offset and what it needs to be.
+ rootfsAddr += flash_info.flash_rootfs_start_offset - rootfsOffset;
+ kernelAddr += flash_info.flash_rootfs_start_offset - rootfsOffset;
+ sprintf(pTag->rootfsAddress,"%lu", (unsigned long) rootfsAddr);
+ sprintf(pTag->kernelAddress,"%lu", (unsigned long) kernelAddr);
+ crc = CRC32_INIT_VALUE;
+ crc = getCrc32((unsigned char *)pTag,(UINT32)TAG_LEN-TOKEN_LEN,crc);
+ *(unsigned long *) &pTag->tagValidationToken[0] = crc;
+ }
+
+ rootfsAddr += BOOT_OFFSET;
+ kernelAddr += BOOT_OFFSET;
+
+ reservedBytesAtEnd = flash_get_reserved_bytes_at_end(&flash_info);
+ availableSizeOneImg = totalSize - ((unsigned int)rootfsAddr-baseAddr) -
+ reservedBytesAtEnd;
+ reserveForTwoImages =
+ (flash_info.flash_rootfs_start_offset > reservedBytesAtEnd)
+ ? flash_info.flash_rootfs_start_offset : reservedBytesAtEnd;
+ availableSizeTwoImgs = (totalSize / 2) - reserveForTwoImages;
+
+// printf("availableSizeOneImage=%dKB availableSizeTwoImgs=%dKB reserve=%dKB\n",
+// availableSizeOneImg/1024, availableSizeTwoImgs/1024, reserveForTwoImages/1024);
+
+ if( pCurTag )
+ curImgSize = atoi(pCurTag->rootfsLen) + atoi(pCurTag->kernelLen);
+
+ if( newImgSize > availableSizeOneImg)
+ {
+ printf("Illegal image size %d. Image size must not be greater "
+ "than %d.\n", newImgSize, availableSizeOneImg);
+ return -1;
+ }
+
+ // tag is alway at the sector start of fs
+ if (cfeAddr)
+ {
+ // will trash cfe memory, but cfe is already flashed
+ tagFs = imagePtr + cfeSize;
+ memcpy(tagFs, imagePtr, TAG_LEN);
+ }
+
+ // If the current image fits in half the flash space and the new
+ // image to flash also fits in half the flash space, then flash it
+ // in the partition that is not currently being used to boot from.
+ if( curImgSize <= availableSizeTwoImgs &&
+ newImgSize <= availableSizeTwoImgs &&
+ getPartitionFromTag( pCurTag ) == 1 )
+ {
+ // Update rootfsAddr to point to the second boot partition.
+ int offset = (totalSize / 2) + TAG_LEN;
+
+ sprintf(((PFILE_TAG) tagFs)->kernelAddress, "%lu",
+ (unsigned long) IMAGE_BASE + offset + (kernelAddr-rootfsAddr));
+ kernelAddr = baseAddr + offset + (kernelAddr - rootfsAddr);
+
+ sprintf(((PFILE_TAG) tagFs)->rootfsAddress, "%lu",
+ (unsigned long) IMAGE_BASE + offset);
+ rootfsAddr = baseAddr + offset;
+ }
+
+ UpdateImageSequenceNumber( ((PFILE_TAG) tagFs)->imageSequence );
+ crc = CRC32_INIT_VALUE;
+ crc = getCrc32((unsigned char *)tagFs, (UINT32)TAG_LEN-TOKEN_LEN, crc);
+ *(unsigned long *) &((PFILE_TAG) tagFs)->tagValidationToken[0] = crc;
+
+ printf("\nFlashing root file system and kernel at 0x%8.8lx: ",
+ rootfsAddr - TAG_LEN);
+ if( (status = kerSysBcmImageSet((rootfsAddr-TAG_LEN), tagFs,
+ TAG_LEN + newImgSize, 0)) != 0 )
+ {
+ printf("Failed to flash root file system. Error: %d\n", status);
+ return status;
+ }
+
+ for( p = nvramData.szBootline; p[2] != '\0'; p++ )
+ {
+ if( p[0] == 'p' && p[1] == '=' && p[2] != BOOT_LATEST_IMAGE )
+ {
+ // Change boot partition to boot from new image.
+ p[2] = BOOT_LATEST_IMAGE;
+ writeNvramData(&nvramData);
+ break;
+ }
+ }
+ }
+
+ printf(".\n*** Image flash done *** !\n");
+
+ return status;
+}
+
+static int nandUpdateImageSequenceNumber( uint8_t *imagePtr, int imageSize )
+{
+ unsigned char *buf, *p;
+ char fname[] = NAND_CFE_RAM_NAME;
+ int fname_actual_len = strlen(fname);
+ int fname_cmp_len = strlen(fname) - 3; /* last three are digits */
+ int len = flash_get_sector_size(0);
+ struct jffs2_raw_dirent *pdir;
+ unsigned long version = 0;
+ PFILE_TAG pTag1 = getTagFromPartition(1);
+ PFILE_TAG pTag2 = getTagFromPartition(2);
+ int seq = (pTag1) ? atoi(pTag1->imageSequence) : -1;
+ int seq2 = (pTag2) ? atoi(pTag2->imageSequence) : -1;
+ int ret = 0;
+
+ if( seq2 > seq )
+ seq = seq2;
+
+ if( seq != -1 )
+ {
+ int done = 0;
+
+ /* Increment the new highest sequence number. Add it to the CFE RAM
+ * file name.
+ */
+ seq++;
+
+ for(buf = imagePtr; buf < imagePtr+imageSize && done == 0; buf += len)
+ {
+ p = buf;
+ while( p < buf + len )
+ {
+ pdir = (struct jffs2_raw_dirent *) p;
+ if( je16_to_cpu(pdir->magic) == JFFS2_MAGIC_BITMASK )
+ {
+ if( je16_to_cpu(pdir->nodetype) == JFFS2_NODETYPE_DIRENT &&
+ fname_actual_len == pdir->nsize &&
+ !memcmp(fname, pdir->name, fname_cmp_len) &&
+ je32_to_cpu(pdir->version) > version &&
+ je32_to_cpu(pdir->ino) != 0 )
+ {
+ p = pdir->name + fname_cmp_len;
+ p[0] = (seq / 100) + '0';
+ p[1] = ((seq % 100) / 10) + '0';
+ p[2] = ((seq % 100) % 10) + '0';
+ p[3] = '\0';
+
+ je32_to_cpu(pdir->name_crc) = getCrc32(pdir->name,
+ (unsigned long) fname_actual_len, 0);
+
+ version = je32_to_cpu(pdir->version);
+
+ /* Setting 'done = 1' assumes there is only one version
+ * of the directory entry.
+ */
+ done = 1;
+ ret = (buf - imagePtr) / len; /* block number */
+ break;
+ }
+
+ p += (je32_to_cpu(pdir->totlen) + 0x03) & ~0x03;
+ }
+ else
+ break;
+ }
+ }
+ }
+
+ return(ret);
+}
+
+// return -1: fail.
+// 0: OK.
+int writeWholeImage(uint8_t *imagePtr, int wholeImageSize)
+{
+ UINT32 crc;
+ int status = 0;
+ int offset = 0;
+ int imageSize = wholeImageSize - TOKEN_LEN;
+ unsigned char crcBuf[CRC_LEN];
+ NVRAM_DATA nvramData, tmpNvramData;
+ WFI_TAG wfiTag;
+#if (INC_SPI_PROG_NAND==1)
+ if( flash_get_flash_type() != FLASH_IFC_NAND && wholeImageSize > FLASH_LENGTH_BOOT_ROM)
+ flash_change_flash_type(FLASH_IFC_NAND);
+#endif
+
+ // if whole image size (plus TOKEN_LEN of crc) is greater than total flash size, return error
+ if (wholeImageSize > (flash_get_total_size() + TOKEN_LEN))
+ {
+ printf("Image size too big\n");
+ return -1;
+ }
+
+ memcpy(&wfiTag, imagePtr + imageSize, sizeof(wfiTag));
+ if( (wfiTag.wfiVersion & WFI_ANY_VERS_MASK) == WFI_ANY_VERS &&
+ checkChipId(wfiTag.wfiChipId, NULL) != 0 )
+ return -1;
+
+ // check tag validate token first
+ crc = CRC32_INIT_VALUE;
+ crc = getCrc32(imagePtr, (UINT32)imageSize, crc);
+ memcpy(crcBuf, imagePtr+imageSize, CRC_LEN);
+ if (memcmp(&crc, crcBuf, CRC_LEN) != 0)
+ {
+ printf("Illegal whole flash image\n");
+ return -1;
+ }
+
+ // save existing NVRAM data into a local structure
+ readNvramData(&nvramData);
+
+ if( flash_get_flash_type() == FLASH_IFC_NAND )
+ {
+ /* The CFE ROM boot loader saved the rootfs partition index at the
+ * memory location before CFE RAM load address.
+ */
+ extern unsigned char _ftext;
+
+ /* Allow addition blocks to flash cfram block that has sequence number
+ * and is flashed last.
+ */
+ const int overhead_blocks = 8;
+
+ int rootfs = (int) *(&_ftext - 1);
+ int blksize = flash_get_sector_size(0) / 1024;
+ int sectsize = flash_get_sector_size(0);
+ int i, cferam_blk, after_cferam, cferam_overhead;
+
+ if( (wfiTag.wfiVersion & WFI_ANY_VERS_MASK) == WFI_ANY_VERS &&
+ ((blksize == 16 && wfiTag.wfiFlashType != WFI_NAND16_FLASH) ||
+ (blksize == 128 && wfiTag.wfiFlashType != WFI_NAND128_FLASH)) )
+ {
+ printf("\nERROR: NAND flash block size does not match image "
+ "block size\n\n");
+ return -1;
+ }
+
+ if( *(unsigned short *) imagePtr != JFFS2_MAGIC_BITMASK )
+ {
+ /* Flash block 0 (cferom). */
+ PNVRAM_DATA pnd = (PNVRAM_DATA) (imagePtr + NVRAM_DATA_OFFSET);
+ char *p;
+
+ /* Copy NVRAM data to block to be flashed so it is preserved. */
+ memcpy((unsigned char *) pnd, (unsigned char *) &nvramData,
+ sizeof(NVRAM_DATA));
+ for( p = pnd->szBootline; p[2] != '\0'; p++ )
+ {
+ if( p[0] == 'p' && p[1] == '=' && p[2] != BOOT_LATEST_IMAGE )
+ {
+ // Change boot partition to boot from new image.
+ p[2] = BOOT_LATEST_IMAGE;
+ break;
+ }
+ }
+
+ /* Recalculate the nvramData CRC. */
+ pnd->ulCheckSum = 0;
+ pnd->ulCheckSum = getCrc32((unsigned char *) pnd,
+ sizeof(NVRAM_DATA), CRC32_INIT_VALUE);
+
+ if((status = kerSysBcmImageSet(FLASH_BASE,imagePtr,sectsize,0)) != 0)
+ printf("Failed to flash block 0. Error: %d\n", status);
+ imagePtr += sectsize;
+ imageSize -= sectsize;
+ }
+
+ validateNandPartTbl(&nvramData);
+ cferam_blk = nandUpdateImageSequenceNumber(imagePtr, imageSize);
+
+ /* rootfs is the partition that the CFE RAM booted from. Write the
+ * image to the other rootfs partition.
+ */
+ if(rootfs == NP_ROOTFS_1 && nvramData.ulNandPartSizeKb[NP_ROOTFS_2]>0)
+ offset = nvramData.ulNandPartOfsKb[NP_ROOTFS_2] * 1024;
+ else
+ offset = nvramData.ulNandPartOfsKb[NP_ROOTFS_1] * 1024;
+
+ after_cferam = (cferam_blk + 1) * sectsize;
+ cferam_overhead = overhead_blocks * sectsize;
+
+ /* Erase block with cferam JFFS2 directory entry so if flashing this
+ * image does not finish, the partition will not be valid.
+ */
+ for( i = 0; i < (cferam_blk + 1 + overhead_blocks); i++ )
+ flash_sector_erase_int((offset / sectsize) + i);
+
+ /* Flash image after cferam directory entry. */
+ printf("\nFlashing root file system at 0x%8.8lx: ", FLASH_BASE+offset);
+ if((status = kerSysBcmImageSet(FLASH_BASE + offset + after_cferam +
+ cferam_overhead, imagePtr + after_cferam, imageSize - after_cferam,
+ 1)) != 0)
+ {
+ printf("Failed to flash whole image. Error: %d\n", status);
+ return status;
+ }
+
+ /* Flash block(s) up to and including the block with cferam JFFS2
+ * directory entry.
+ */
+ if((status = kerSysBcmImageSet(FLASH_BASE + offset, imagePtr,
+ after_cferam, 0)) != 0)
+ {
+ printf("Failed to flash whole image. Error: %d\n", status);
+ return status;
+ }
+ }
+ else /* NOR FLASH */
+ {
+ printf("\nFlashing root file system and kernel at 0x%8.8lx\n",
+ FLASH_BASE+offset);
+
+ if( (wfiTag.wfiVersion & WFI_ANY_VERS_MASK) == WFI_ANY_VERS &&
+ wfiTag.wfiFlashType != WFI_NOR_FLASH )
+ {
+ printf("\nERROR: Image does not support a NOR flash device.\n\n");
+ return -1;
+ }
+
+ if((status = kerSysBcmImageSet(FLASH_BASE+offset, imagePtr, imageSize,
+ 1)) != 0)
+ {
+ printf("Failed to flash whole image. Error: %d\n", status);
+ return status;
+ }
+ }
+
+ // Check if the new image has valid NVRAM
+ // Also check if the new image still supports currently configured board ID
+ if( (readNvramData(&tmpNvramData) != 0) ||
+ (BpSetBoardId(tmpNvramData.szBoardId) != BP_SUCCESS) ||
+ (BpSetVoiceBoardId(tmpNvramData.szVoiceBoardId) != BP_SUCCESS) )
+ {
+ // Don't write NVRAM area if we are flashing tiny bridge image.
+ // unlike cfe.w, the tiny bridge .w image will not have NVRAM_DATA_ID set
+ if (*(unsigned long *) &tmpNvramData == NVRAM_DATA_ID)
+ writeNvramData(&nvramData);
+ }
+
+ return status;
+}
+
+int processPrompt(PPARAMETER_SETTING promptPtr, int promptCt)
+{
+ char tmpBuf[MAX_PROMPT_LEN];
+ int i = 0;
+ int bChange = FALSE;
+
+ printf("Press: <enter> to use current value\r\n");
+ printf(" '-' to go previous parameter\r\n");
+ printf(" '.' to clear the current value\r\n");
+ printf(" 'x' to exit this command\r\n");
+
+ memset(tmpBuf, 0, MAX_PROMPT_LEN);
+ while (i < promptCt)
+ {
+ if( (promptPtr+i)->enabled == FALSE )
+ {
+ if( tmpBuf[0] == '-' )
+ {
+ if( i > 0 )
+ {
+ i--;
+ continue;
+ }
+ }
+ else
+ {
+ i++;
+ continue;
+ }
+ }
+
+ if (strlen((promptPtr+i)->parameter) > 0)
+ printf("%s %s ", (promptPtr+i)->promptName, (promptPtr+i)->parameter);
+ else
+ printf("%s %s", (promptPtr+i)->promptName, (promptPtr+i)->parameter);
+
+ memset(tmpBuf, 0, MAX_PROMPT_LEN);
+ console_readline ("", tmpBuf, (promptPtr+i)->maxValueLength + 1);
+
+ switch (tmpBuf[0])
+ {
+ case '-': // go back one parameter
+ if (i > 0)
+ i--;
+ break;
+ case 'x': // get out the b command
+ if ((promptPtr+i)->func != 0) // validate function is supplied, do a check
+ {
+ if ((promptPtr+i)->func((promptPtr+i)->parameter))
+ {
+ printf("\n%s; Try again!\n", (promptPtr+i)->errorPrompt);
+ break;
+ }
+ }
+ i = promptCt;
+ break;
+ case '.': // clear the current parameter and advance
+ if ((promptPtr+i)->func != 0) // validate function is supplied, do a check
+ {
+ if ((promptPtr+i)->func(""))
+ {
+ printf("\n%s; Try again!\n", (promptPtr+i)->errorPrompt);
+ break;
+ }
+ }
+ memset((promptPtr+i)->parameter, 0, MAX_PROMPT_LEN);
+ i++;
+ bChange = TRUE;
+ break;
+ case 0: // no input; use default if it is OK
+ if ((promptPtr+i)->func != 0) // validate function is supplied, do a check
+ {
+ if ((promptPtr+i)->func((promptPtr+i)->parameter))
+ {
+ printf("\n%s; Try again!\n", (promptPtr+i)->errorPrompt);
+ break;
+ }
+ }
+ i++;
+ break;
+ default: // new parameter
+ if ((promptPtr+i)->func != 0) // validate function is supplied, do a check
+ {
+ if ((promptPtr+i)->func(tmpBuf))
+ {
+ printf("\n%s; Try again!\n", (promptPtr+i)->errorPrompt);
+ break;
+ }
+ }
+ memset((promptPtr+i)->parameter, 0, MAX_PROMPT_LEN);
+ memcpy((promptPtr+i)->parameter, tmpBuf, strlen(tmpBuf));
+ i++;
+ bChange = TRUE;
+ }
+ }
+
+ return bChange;
+
+} // processPrompt
+
+// write the nvramData struct to nvram after CRC is calculated
+void writeNvramData(PNVRAM_DATA pNvramData)
+{
+ UINT32 crc = CRC32_INIT_VALUE;
+
+ pNvramData->ulCheckSum = 0;
+ crc = getCrc32((unsigned char *)pNvramData, sizeof(NVRAM_DATA), crc);
+ pNvramData->ulCheckSum = crc;
+ kerSysNvRamSet((unsigned char *)pNvramData, sizeof(NVRAM_DATA), 0);
+}
+
+// read the nvramData struct from nvram
+// return -1: crc fail, 0 ok
+int readNvramData(PNVRAM_DATA pNvramData)
+{
+ UINT32 crc = CRC32_INIT_VALUE, savedCrc;
+
+ kerSysNvRamGet((unsigned char *)pNvramData, sizeof(NVRAM_DATA), 0);
+ savedCrc = pNvramData->ulCheckSum;
+ pNvramData->ulCheckSum = 0;
+ crc = getCrc32((unsigned char *)pNvramData, sizeof(NVRAM_DATA), crc);
+ if (savedCrc != crc)
+ return -1;
+
+ return 0;
+}
+
+static void convertBootInfo(void)
+{
+ char *x;
+
+ memset(&bootInfo, 0, sizeof(BOOT_INFO));
+ strcpy(bootInfo.boardIp, gBootParam[PARAM_IDX_BOARD_IPADDR].parameter);
+
+ if ((x = strchr(bootInfo.boardIp, ':'))) // has mask
+ {
+ *x = '\0';
+ convertMaskStr((x+1), bootInfo.boardMask);
+ }
+ strcpy(bootInfo.hostIp, gBootParam[PARAM_IDX_HOST_IPADDR].parameter);
+ if ((x = strchr(bootInfo.hostIp, ':'))) // ignore host mask
+ *x = '\0';
+ strcpy(bootInfo.gatewayIp, gBootParam[PARAM_IDX_GW_IPADDR].parameter);
+ if ((x = strchr(bootInfo.gatewayIp, ':'))) // ignore gw mask
+ *x = '\0';
+ bootInfo.runFrom = gBootParam[PARAM_IDX_RUN_FROM].parameter[0];
+ strcpy(bootInfo.hostFileName, gBootParam[PARAM_IDX_RUN_FILENAME].parameter);
+ strcpy(bootInfo.flashFileName, gBootParam[PARAM_IDX_FLASH_FILENAME].parameter);
+ bootInfo.bootDelay = (int)(gBootParam[PARAM_IDX_BOOT_DELAY].parameter[0] - '0');
+ bootInfo.bootPartition = gBootParam[PARAM_IDX_BOOT_IMAGE].parameter[0];
+}
+
+void getBootLine(void)
+{
+ int i;
+ char *curPtr;
+ char *dPtr;
+ NVRAM_DATA nvramData;
+
+ readNvramData(&nvramData);
+
+ if ((nvramData.szBootline[0] == (char)0xff) ||
+ (nvramData.szBootline[0] == (char)0))
+ {
+ setDefaultBootline();
+ return;
+ }
+
+ curPtr = nvramData.szBootline;
+ for (i = 0; (i < gNumBootParams) && (curPtr != 0); i++)
+ {
+ curPtr = strchr(curPtr, '=');
+ if (curPtr) // found '=' and get the param.
+ {
+ dPtr = strchr(curPtr, ' '); // find param. deliminator ' '
+ memset(gBootParam[i].parameter, 0, MAX_PROMPT_LEN);
+ memcpy(gBootParam[i].parameter, curPtr+1, dPtr-curPtr-1);
+ // move to next param.
+ curPtr = dPtr;
+ }
+ } // for loop
+
+ if (i < gNumBootParams) {
+ setDefaultBootline();
+ return;
+ }
+
+ convertBootInfo();
+}
+
+// print the bootline and board parameter info and fill in the struct for later use
+//
+int printSysInfo(void)
+{
+ int i;
+ ETHERNET_MAC_INFO EnetInfos[BP_MAX_ENET_MACS];
+
+ // display the bootline info
+
+ if( getTagFromPartition(1) == NULL || getTagFromPartition(2) == NULL )
+ gBootParam[PARAM_IDX_BOOT_IMAGE].enabled = FALSE;
+
+ for (i = 0; i < gNumBootParams; i++)
+ if( gBootParam[i].enabled )
+ printf("%s %s \n", gBootParam[i].promptName, gBootParam[i].parameter);
+
+ // display the board param
+ displayBoardParam();
+
+ if( BpGetEthernetMacInfo( EnetInfos, BP_MAX_ENET_MACS ) == BP_SUCCESS )
+ {
+ // Here we should print whether EMAC1 or EMAC2 is selected
+ }
+
+ printf("\n");
+
+ return 0;
+}
+
+
+//**************************************************************************
+// Function Name: changeBootLine
+// Description : Use vxWorks bootrom style parameter input method:
+// Press <enter> to use default, '-' to go to previous parameter
+// Note: Parameter is set to current value in the menu.
+// Returns : None.
+//**************************************************************************
+int changeBootLine(void)
+{
+ int i;
+ char boardIpSaved[BOOT_IP_LEN];
+ NVRAM_DATA nvramData;
+
+ readNvramData(&nvramData);
+
+ strcpy(boardIpSaved, bootInfo.boardIp);
+
+ if (processPrompt(gBootParam, gNumBootParams))
+ {
+ char *blPtr = nvramData.szBootline;
+ int paramLen;
+
+ memset(blPtr, 0, NVRAM_BOOTLINE_LEN);
+ for (i = 0; i < gNumBootParams; i++)
+ {
+ memcpy(blPtr, gBootParam[i].promptDefine, PROMPT_DEFINE_LEN);
+ blPtr += PROMPT_DEFINE_LEN;
+ paramLen = strlen(gBootParam[i].parameter);
+ memcpy(blPtr, gBootParam[i].parameter, paramLen);
+ blPtr += paramLen;
+ if (!(gBootParam[i].parameter[0] == ' '))
+ {
+ memcpy(blPtr, " ", 1);
+ blPtr += 1;
+ }
+ }
+ writeNvramData(&nvramData);
+ }
+
+ getBootLine();
+
+ // if board ip differs, do enet init
+ if (strcmp(boardIpSaved, bootInfo.boardIp) != 0)
+ enet_init();
+
+ return 0;
+
+}
+
+void setDefaultBootline(void)
+{
+ char boardIpSaved[BOOT_IP_LEN];
+ NVRAM_DATA nvramData;
+
+ readNvramData(&nvramData);
+ strcpy(boardIpSaved, bootInfo.boardIp);
+
+ memset(nvramData.szBootline, 0, NVRAM_BOOTLINE_LEN);
+ strncpy(nvramData.szBootline, DEFAULT_BOOTLINE, strlen(DEFAULT_BOOTLINE));
+ printf("Use default boot line parameters: %s\n", DEFAULT_BOOTLINE);
+ writeNvramData(&nvramData);
+
+ getBootLine();
+
+ // if board ip differs, do enet init
+ if (strcmp(boardIpSaved, bootInfo.boardIp) != 0)
+ enet_init();
+}
+
+//**************************************************************************
+// Function Name: changeAfeId
+// Description : Use vxWorks bootrom style parameter input method:
+// Press <enter> to use default, '-' to go to previous parameter
+// Note: Parameter is set to current value in the menu.
+// Returns : None.
+//**************************************************************************
+static void hex2Str(unsigned long num, char *str)
+{
+ static const char hextable[16] = "0123456789ABCDEF";
+ unsigned long i, n;
+ str[0] = '0';
+ str[1] = 'x';
+ if (0 == num) {
+ str[2] = '0';
+ str[3] = 0;
+ return;
+ }
+ str +=2;
+ n = num >> 28;
+ i = 0;
+ while (0 == n) {
+ num <<= 4;
+ n = num >> 28;
+ i++;
+ }
+ for (; i < 8; i++) {
+ *str++ = hextable[num >> 28];
+ num <<= 4;
+ }
+ *str = 0;
+}
+
+int changeAfeId(void)
+{
+ NVRAM_DATA nvramData;
+
+ readNvramData(&nvramData);
+ hex2Str(nvramData.afeId[0], gAfeId[0].parameter);
+ hex2Str(nvramData.afeId[1], gAfeId[1].parameter);
+ if (processPrompt(gAfeId, gAfeIdParams))
+ {
+ nvramData.afeId[0] = lib_atoi(gAfeId[0].parameter);
+ nvramData.afeId[1] = lib_atoi(gAfeId[1].parameter);
+ writeNvramData(&nvramData);
+ }
+ return 0;
+}
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/src/dev_bcm63xx_eth.c b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/dev_bcm63xx_eth.c
new file mode 100755
index 0000000..c4ea465
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/dev_bcm63xx_eth.c
@@ -0,0 +1,547 @@
+/*
+<:copyright-broadcom
+
+ Copyright (c) 2002 Broadcom Corporation
+ All Rights Reserved
+ No portions of this material may be reproduced in any form without the
+ written permission of:
+ Broadcom Corporation
+ 16215 Alton Parkway
+ Irvine, California 92619
+ All information contained in this document is Broadcom Corporation
+ company private, proprietary, and trade secret.
+
+:>
+*/
+
+/** Includes. **/
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_ioctl.h"
+#include "cfe_device.h"
+#include "cfe_devfuncs.h"
+#include "sbmips.h"
+#include "cfe_timer.h"
+#include "dev_bcm63xx_eth.h"
+#include "dev_bcm63xx_flash.h"
+#include "mii.h"
+#include "robosw_reg.h"
+
+#define DMA_RX_CHAN (softc->dmaPort * 2)
+#define DMA_TX_CHAN (softc->dmaPort * 2 + 1)
+
+#define CACHE_ALIGN 16
+extern void _cfe_flushcache(int, uint8_t *, uint8_t *);
+#define INVAL_RANGE(s,l) _cfe_flushcache(CFE_CACHE_INVAL_RANGE,((uint8_t *) (s)),((uint8_t *) (s))+(l))
+#define FLUSH_RANGE(s,l) _cfe_flushcache(CFE_CACHE_FLUSH_RANGE,((uint8_t *) (s)),((uint8_t *) (s))+(l))
+
+/** Externs. **/
+extern unsigned long sysGetEnetModeFlag(void);
+
+/** Prototypes. **/
+static void bcm63xx_ether_probe( cfe_driver_t * drv, unsigned long probe_a,
+ unsigned long probe_b, void * probe_ptr );
+static int bcm63xx_ether_open(cfe_devctx_t *ctx);
+static int bcm63xx_ether_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int bcm63xx_ether_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat);
+static int bcm63xx_ether_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int bcm63xx_ether_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int bcm63xx_ether_close(cfe_devctx_t *ctx);
+static int internal_open(bcmenet_softc * softc);
+
+/** Variables. **/
+const static cfe_devdisp_t bcm63xx_ether_dispatch = {
+ bcm63xx_ether_open,
+ bcm63xx_ether_read,
+ bcm63xx_ether_inpstat,
+ bcm63xx_ether_write,
+ bcm63xx_ether_ioctl,
+ bcm63xx_ether_close,
+ NULL,
+ NULL
+};
+
+const cfe_driver_t bcm63xx_enet = {
+ "BCM63xx Ethernet",
+ "eth",
+ CFE_DEV_NETWORK,
+ &bcm63xx_ether_dispatch,
+ bcm63xx_ether_probe
+};
+
+/** Functions. **/
+static void bcm63xx_ether_probe( cfe_driver_t * drv, unsigned long probe_a,
+ unsigned long probe_b, void * probe_ptr )
+{
+ bcmenet_softc * softc;
+ char descr[100];
+
+ softc = (bcmenet_softc *) KMALLOC( sizeof(bcmenet_softc), CACHE_ALIGN );
+ if( softc == NULL ) {
+ xprintf( "BCM63xx : Failed to allocate softc memory.\n" );
+ } else {
+ memset( softc, 0, sizeof(bcmenet_softc) );
+
+ if (internal_open( softc ) == -1)
+ xprintf("Failed initializing enet hardware\n");
+ else
+ {
+ cfe_attach( drv, softc, NULL, descr );
+ }
+ }
+}
+
+static int bcm63xx_ether_open(cfe_devctx_t *ctx)
+{
+ /* FIXME -- See if this can be returned to its normal place. */
+ return 0;
+}
+
+/*
+ * init_dma: Initialize DMA control register
+ */
+static void init_dma(bcmenet_softc *softc)
+{
+ uint32 *StateRam;
+ int i;
+
+ /*
+ * clear State RAM
+ */
+ StateRam = (UINT32 *)&softc->dmaCtrl->stram.s[0];
+ for (i = 0; i < sizeof(DmaStateRam) / sizeof(UINT32) * NUM_PORTS * 2; i++)
+ StateRam[i] = 0;
+
+ /*
+ * initialize IUDMA controller register
+ */
+ softc->dmaCtrl->controller_cfg = DMA_FLOWC_CH1_EN;
+ softc->dmaCtrl->flowctl_ch1_thresh_lo = DMA_FC_THRESH_LO;
+ softc->dmaCtrl->flowctl_ch1_thresh_hi = DMA_FC_THRESH_HI;
+ softc->dmaCtrl->flowctl_ch1_alloc = 0;
+
+ // transmit
+ softc->txDma->cfg = 0; /* initialize first (will enable later) */
+ softc->txDma->maxBurst = DMA_MAX_BURST_LENGTH;
+ softc->txDma->intMask = 0; /* mask all ints */
+ /* clr any pending interrupts on channel */
+ softc->txDma->intStat = DMA_DONE|DMA_NO_DESC|DMA_BUFF_DONE;
+ softc->txDma->intMask = DMA_DONE;
+ softc->dmaCtrl->stram.s[DMA_TX_CHAN].baseDescPtr = (uint32)K1_TO_PHYS((uint32_t)(softc->txFirstBdPtr));
+
+ // receive
+ softc->rxDma->cfg = 0; // initialize first (will enable later)
+ softc->rxDma->maxBurst = DMA_MAX_BURST_LENGTH;
+ softc->rxDma->intMask = 0; /* mask all ints */
+ /* clr any pending interrupts on channel */
+ softc->rxDma->intStat = DMA_DONE|DMA_NO_DESC|DMA_BUFF_DONE;
+ softc->rxDma->intMask = DMA_DONE;
+ softc->dmaCtrl->stram.s[DMA_RX_CHAN].baseDescPtr = (uint32)K1_TO_PHYS((uint32_t)(softc->rxFirstBdPtr));
+}
+
+
+static int internal_open(bcmenet_softc * softc)
+{
+ int i;
+ void *p;
+
+ robosw_init();
+ softc->dmaCtrl = (DmaRegs *)(SWITCH_DMA_BASE);
+
+ softc->rxDma = &softc->dmaCtrl->chcfg[DMA_RX_CHAN];
+ softc->txDma = &softc->dmaCtrl->chcfg[DMA_TX_CHAN];
+
+ // If doing SW reboot in EPI the controller can still be active
+ softc->rxDma->cfg = 0;
+ softc->txDma->cfg = 0;
+ softc->dmaCtrl->controller_cfg &= ~DMA_MASTER_EN;
+
+ p = KMALLOC( NR_TX_BDS * sizeof(DmaDesc), CACHE_ALIGN );
+ if( p == NULL ) {
+ xprintf( "BCM63xx : Failed to allocate txBds memory.\n" );
+ return -1;
+ }
+ INVAL_RANGE(p, NR_TX_BDS * sizeof(DmaDesc));
+ softc->txBds = (DmaDesc *)K0_TO_K1((uint32) p);
+
+ p = KMALLOC( NR_RX_BDS * sizeof(DmaDesc), CACHE_ALIGN );
+ if( p== NULL ) {
+ xprintf( "BCM63xx : Failed to allocate rxBds memory.\n" );
+ KFREE( (void *)(softc->txBds) );
+ softc->txBds = NULL;
+ return -1;
+ }
+ INVAL_RANGE(p, NR_RX_BDS * sizeof(DmaDesc));
+ softc->rxBds = (DmaDesc *)K0_TO_K1((uint32) p);
+
+ softc->rxBuffers = (uint32_t)KMALLOC( NR_RX_BDS * ENET_BUF_SIZE, CACHE_ALIGN );
+ if( softc->rxBuffers == NULL ) {
+ xprintf( "BCM63xx : Failed to allocate RxBuffer memory.\n" );
+ KFREE( (void *)(softc->txBds) );
+ softc->txBds = NULL;
+ KFREE( (void *)(softc->rxBds) );
+ softc->rxBds = NULL;
+ return -1;
+ }
+ INVAL_RANGE(softc->rxBuffers, NR_RX_BDS * ENET_BUF_SIZE);
+
+ softc->txBuffers = (uint32_t)KMALLOC( NR_TX_BDS * ENET_BUF_SIZE, CACHE_ALIGN );
+ if( softc->txBuffers == NULL ) {
+ xprintf( "BCM63xx : Failed to allocate txBuffer memory.\n" );
+ KFREE( (void *)(softc->rxBuffers) );
+ softc->rxBuffers = NULL;
+ KFREE( (void *)(softc->txBds) );
+ softc->txBds = NULL;
+ KFREE( (void *)(softc->rxBds) );
+ softc->rxBds = NULL;
+ return -1;
+ }
+ INVAL_RANGE(softc->txBuffers, NR_TX_BDS * ENET_BUF_SIZE);
+
+ /* Init the Receive Buffer Descriptor Ring. */
+ softc->rxFirstBdPtr = softc->rxBdReadPtr = softc->rxBds;
+ softc->rxLastBdPtr = softc->rxBds + NR_RX_BDS - 1;
+
+ for(i = 0; i < NR_RX_BDS; i++) {
+ (softc->rxBds + i)->status = DMA_OWN;
+ (softc->rxBds + i)->length = ENET_BUF_SIZE;
+ (softc->rxBds + i)->address = softc->rxBuffers + i * ENET_BUF_SIZE;
+ (softc->rxBds + i)->address = K1_TO_PHYS( (softc->rxBds + i)->address );
+ softc->dmaCtrl->flowctl_ch1_alloc = 1;
+ }
+ softc->rxLastBdPtr->status |= DMA_WRAP;
+
+ /* Init Transmit Buffer Descriptor Ring. */
+ softc->txFirstBdPtr = softc->txNextBdPtr = softc->txBds;
+ softc->txLastBdPtr = softc->txBds + NR_TX_BDS - 1;
+
+ for(i = 0; i < NR_TX_BDS; i++) {
+ (softc->txBds + i)->status = 0;
+ (softc->txBds + i)->length = 0;
+ (softc->txBds + i)->address = softc->txBuffers + i * ENET_BUF_SIZE;
+ (softc->txBds + i)->address = K1_TO_PHYS( (softc->txBds + i)->address );
+ }
+ softc->txLastBdPtr->status = DMA_WRAP;
+
+ /* init dma registers */
+ init_dma(softc);
+
+ robosw_configure_ports();
+
+ softc->dmaCtrl->controller_cfg |= DMA_MASTER_EN;
+
+ softc->rxDma->cfg |= DMA_ENABLE;
+
+ softc->linkCheck = 0;
+
+ return 0;
+}
+
+static int bcm63xx_ether_read( cfe_devctx_t * ctx, iocb_buffer_t * buffer )
+{
+ unsigned char * dstptr;
+ unsigned char * srcptr;
+ volatile DmaDesc * CurrentBdPtr;
+ bcmenet_softc * softc = (bcmenet_softc *) ctx->dev_softc;
+ uint16 dmaFlag;
+
+ if( ctx == NULL ) {
+ xprintf( "No context\n" );
+ return -1;
+ }
+
+ if( buffer == NULL ) {
+ xprintf( "No dst buffer\n" );
+ return -1;
+ }
+
+ if( softc == NULL ) {
+ xprintf( "softc has not been initialized.\n" );
+ return -1;
+ }
+
+ dmaFlag = (uint16) softc->rxBdReadPtr->status;
+ if (!(dmaFlag & DMA_EOP))
+ {
+ xprintf("dmaFlag (return -1)[%04x]\n", dmaFlag);
+ return -1;
+ }
+
+ dstptr = buffer->buf_ptr;
+ CurrentBdPtr = softc->rxBdReadPtr;
+
+ srcptr = (unsigned char *)( PHYS_TO_K1(CurrentBdPtr->address) );
+
+ buffer->buf_retlen = ((CurrentBdPtr->length < buffer->buf_length) ? CurrentBdPtr->length : buffer->buf_length);
+
+ memcpy( dstptr, srcptr, buffer->buf_retlen );
+
+ CurrentBdPtr->length = ENET_BUF_SIZE;
+ CurrentBdPtr->status &= DMA_WRAP;
+ CurrentBdPtr->status |= DMA_OWN;
+
+ IncRxBdPtr( CurrentBdPtr, softc );
+ softc->rxBdReadPtr = CurrentBdPtr;
+ softc->dmaCtrl->flowctl_ch1_alloc = 1;
+
+ // enable rx dma
+ softc->rxDma->cfg = DMA_ENABLE;
+ return 0;
+}
+
+
+static int bcm63xx_ether_inpstat( cfe_devctx_t * ctx, iocb_inpstat_t * inpstat )
+{
+ bcmenet_softc * softc;
+ volatile DmaDesc * CurrentBdPtr;
+
+ /* ============================= ASSERTIONS ============================= */
+
+ if( ctx == NULL ) {
+ xprintf( "No context\n" );
+ return -1;
+ }
+
+ if( inpstat == NULL ) {
+ xprintf( "No inpstat buffer\n" );
+ return -1;
+ }
+
+ softc = (bcmenet_softc *)ctx->dev_softc;
+ if( softc == NULL ) {
+ xprintf( "softc has not been initialized.\n" );
+ return -1;
+ }
+
+ /* ====================================================================== */
+
+
+ CurrentBdPtr = softc->rxBdReadPtr;
+
+ // inp_status == 1 -> data available
+ inpstat->inp_status = (CurrentBdPtr->status & DMA_OWN) ? 0 : 1;
+
+ if (!inpstat->inp_status || (++softc->linkCheck > 100)) {
+ // Don't check link state too often when receiving data
+ softc->linkCheck = 0;
+ robosw_check_ports();
+ }
+
+ return 0;
+}
+
+
+static int bcm63xx_ether_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ uint32_t status;
+ unsigned char * dstptr;
+ bcmenet_softc * softc;
+ volatile DmaDesc * CurrentBdPtr;
+ volatile uint32 txEvents = 0;
+
+ /* ============================= ASSERTIONS ============================= */
+
+ if( ctx == NULL ) {
+ xprintf( "No context\n" );
+ return -1;
+ }
+
+ if( buffer == NULL ) {
+ xprintf( "No dst buffer\n" );
+ return -1;
+ }
+
+ if( buffer->buf_length > ENET_MAX_MTU_SIZE ) {
+ xprintf( "src buffer too large.\n" );
+ xprintf( "size is %d\n", buffer->buf_length );
+ return -1;
+ }
+
+ softc = (bcmenet_softc *) ctx->dev_softc;
+ if( softc == NULL ) {
+ xprintf( "softc has not been initialized.\n" );
+ return -1;
+ }
+
+ /* ====================================================================== */
+
+ CurrentBdPtr = softc->txNextBdPtr;
+
+ /* Find out if the next BD is available. */
+ if( CurrentBdPtr->status & DMA_OWN ) {
+ xprintf( "No tx BD available ?!\n" );
+ return -1;
+ }
+
+ dstptr = (unsigned char *)PHYS_TO_K1( CurrentBdPtr->address );
+ memcpy( dstptr, buffer->buf_ptr, buffer->buf_length );
+
+ /* Set status of DMA BD to be transmitted. */
+ status = DMA_SOP | DMA_EOP | DMA_APPEND_CRC | DMA_OWN;
+ if( CurrentBdPtr == softc->txLastBdPtr ) {
+ status |= DMA_WRAP;
+ }
+
+ CurrentBdPtr->length = ((buffer->buf_length < ETH_ZLEN) ? ETH_ZLEN : buffer->buf_length);
+ CurrentBdPtr->status = status;
+
+ // Enable DMA for this channel
+ softc->txDma->cfg |= DMA_ENABLE;
+
+ // poll the dma status until done
+ do
+ {
+ txEvents = CurrentBdPtr->status;
+ } while (txEvents & DMA_OWN);
+
+
+ //Advance BD pointer to next in the chain.
+ InctxBdPtr( CurrentBdPtr, softc );
+ softc->txNextBdPtr = CurrentBdPtr;
+
+ return 0;
+}
+
+static int bcm63xx_ether_ioctl(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ bcmenet_softc *softc = (bcmenet_softc *) ctx->dev_softc;
+
+ switch ((int)buffer->buf_ioctlcmd) {
+ case IOCTL_ETHER_GETHWADDR:
+ memcpy(buffer->buf_ptr, softc->hwaddr, sizeof(softc->hwaddr));
+ return 0;
+
+ case IOCTL_ETHER_SETHWADDR:
+ memcpy(softc->hwaddr, buffer->buf_ptr, sizeof(softc->hwaddr));
+ return 0;
+
+ default:
+ return -1;
+ }
+
+ return 0;
+}
+
+/*
+ * bcm63xx_ether_flush: Flushes packets from the DMA receive ring
+ */
+static int bcm63xx_ether_flush(bcmenet_softc * softc)
+{
+ volatile DmaDesc * CurrentBdPtr;
+ uint16 dmaFlag;
+ unsigned char * srcptr;
+ uint16 len;
+ uint32 rxBdsCount = 0;
+ int i;
+
+ if( softc == NULL ) {
+ xprintf( "softc has not been initialized.\n" );
+ return -1;
+ }
+
+ xprintf("Disabling Switch ports.\n");
+
+ /* disable forwarding */
+ SWITCH->SwitchMode &= ~SwitchMode_FwdgEn;
+
+ /* Bring the link down on all switch ports */
+ for(i=0; i<8; ++i) {
+ SWITCH->PortOverride[i] &= ~PortOverride_Linkup;
+ /* disable Rx and Tx */
+ SWITCH->PortCtrl[i] = PortCtrl_DisableTx | PortCtrl_DisableRx;
+ }
+
+ for(i=0; i<1000; ++i) {
+ cfe_usleep(1000);
+ }
+
+ xprintf("Flushing Receive Buffers...\n");
+
+ while(!((dmaFlag = (uint16) softc->rxBdReadPtr->status) & DMA_OWN)) {
+
+ if (!(dmaFlag & DMA_EOP))
+ {
+ xprintf("dmaFlag (return -1)[%04x]\n", dmaFlag);
+ return -1;
+ }
+
+ CurrentBdPtr = softc->rxBdReadPtr;
+
+ srcptr = (unsigned char *)( PHYS_TO_K1(CurrentBdPtr->address) );
+
+ len = CurrentBdPtr->length;
+
+ ++rxBdsCount;
+
+ CurrentBdPtr->length = ENET_BUF_SIZE;
+ CurrentBdPtr->status &= DMA_WRAP;
+ CurrentBdPtr->status |= DMA_OWN;
+
+ IncRxBdPtr( CurrentBdPtr, softc );
+ softc->rxBdReadPtr = CurrentBdPtr;
+ softc->dmaCtrl->flowctl_ch1_alloc = 1;
+
+ // enable rx dma
+ softc->rxDma->cfg = DMA_ENABLE;
+ }
+
+ xprintf("%d buffers found.\n", rxBdsCount);
+
+ return 0;
+}
+
+static int bcm63xx_ether_close(cfe_devctx_t *ctx)
+{
+ int i;
+ bcmenet_softc * softc = (bcmenet_softc *) ctx->dev_softc;
+ unsigned long sts;
+
+ /* flush Rx DMA Channel */
+ bcm63xx_ether_flush(softc);
+
+ xprintf("Closing DMA Channels.\n");
+
+ sts = softc->rxDma->intStat;
+ softc->rxDma->intStat = sts;
+ softc->rxDma->intMask = 0;
+ softc->rxDma->cfg = 0;
+ // wait the current packet to complete before turning off EMAC, otherwise memory corruption can occur.
+ for(i=0; softc->rxDma->cfg & DMA_ENABLE; i++) {
+ // put the line below inside - it seems the signal can be lost and DMA never stops
+ softc->rxDma->cfg = 0;
+ if (i >= 20) {
+ xprintf("Rx Timeout !!!\n");
+ break;
+ }
+ cfe_usleep(100);
+ }
+
+ sts = softc->txDma->intStat;
+ softc->txDma->intStat = sts;
+ softc->txDma->intMask = 0;
+ softc->txDma->cfg = 0;
+ for(i=0; softc->txDma->cfg & DMA_ENABLE; i++) {
+ // put the line below inside - it seems the signal can be lost and DMA never stops
+ softc->txDma->cfg = 0;
+ if (i >= 20) {
+ xprintf("Tx Timeout !!!\n");
+ break;
+ }
+ cfe_usleep(100);
+ }
+
+ /* return buffer allocation register internal count to 0 */
+ softc->dmaCtrl->flowctl_ch1_alloc = (DMA_BUF_ALLOC_FORCE | 0);
+
+ softc->dmaCtrl->controller_cfg &= ~DMA_MASTER_EN;
+
+ KFREE( (void *)(softc->txBuffers) );
+ KFREE( (void *)(softc->rxBuffers) );
+ KFREE( (void *)(softc->txBds) );
+ KFREE( (void *)(softc->rxBds) );
+ return 0;
+}
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/src/dev_bcm63xx_flash.c b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/dev_bcm63xx_flash.c
new file mode 100755
index 0000000..cf38104
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/dev_bcm63xx_flash.c
@@ -0,0 +1,629 @@
+/***************************************************************************
+ * Broadcom Corp. Confidential
+ * Copyright 2001 Broadcom Corp. All Rights Reserved.
+ *
+ * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED
+ * SOFTWARE LICENSE AGREEMENT BETWEEN THE USER AND BROADCOM.
+ * YOU HAVE NO RIGHT TO USE OR EXPLOIT THIS MATERIAL EXCEPT
+ * SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
+ *
+ ***************************************************************************
+ * File Name : bcm63xx_flash.c
+ *
+ * Description: This file contains the flash device driver for bcm63xx board. Very similar to
+ * board.c in linux development.
+ *
+ * Created on : 4/18/2002 seanl
+ *
+ ***************************************************************************/
+
+
+/* Includes. */
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+
+#include "bcm_map.h"
+#include "bcm_hwdefs.h"
+#include "dev_bcm63xx_flash.h"
+#include "flash_api.h"
+#include "boardparms.h"
+#include "boardparms_voice.h"
+#include "bcm63xx_util.h"
+
+//#define DEBUG_FLASH
+
+/* This driver determines the NVRAM and persistent storage flash address and
+ * length.
+ */
+/* Foxconn start jenny add for timeout */
+extern int NMRPKeepAlive(void);
+extern int NMRPTFTPWaiting(void);
+extern int g_nmrp_keepalive;
+extern int nmrp_server_detected;
+/* Foxconn end jenny add for timeout*/
+
+static FLASH_ADDR_INFO fInfo;
+
+//**************************************************************************************
+// Flash read/write and image downloading..
+//**************************************************************************************
+
+void kerSysFlashInit( void )
+{
+ NVRAM_DATA nvramData;
+
+ flash_init();
+
+ while ((readNvramData(&nvramData) != 0) || (BpSetBoardId(nvramData.szBoardId) != BP_SUCCESS))
+ {
+ printf("\n*** Board is not initialized properly ***\n\n");
+ //setBoardParam(); /* Bob removed to set default board parameters, 11/01/2010 */
+ setDefaultBoardParam(); /* Bob added to set default board parameters, 11/01/2010 */
+ }
+
+ fInfo.flash_rootfs_start_offset = flash_get_sector_size(0);
+ if( fInfo.flash_rootfs_start_offset < FLASH_LENGTH_BOOT_ROM )
+ fInfo.flash_rootfs_start_offset = FLASH_LENGTH_BOOT_ROM;
+
+ flash_init_info(&nvramData, &fInfo);
+
+#if (INC_NAND_FLASH_DRIVER==1)
+ validateNandPartTbl(&nvramData);
+
+ /* Check if spare area data contains non 0xff values after JFFS2 clean
+ * marker. Early version of this CFE driver filled bytes 8 - 11 with
+ * 0 which Linux does not like.
+ */
+ {
+ extern int read_spare_data(int blk, unsigned char *buf, int bufsize);
+
+ int blk_size = flash_get_sector_size(0) / 1024;
+ int blk_start = nvramData.ulNandPartOfsKb[NP_DATA] / blk_size;
+ unsigned char spare[64];
+
+ memset(spare, 0xff, sizeof(spare));
+ if( read_spare_data(blk_start, spare, sizeof(spare)) == FLASH_API_OK )
+ {
+ const int spare_len = 8; /* Linux JFFS2 spare area is 8 bytes */
+ int i;
+
+ for( i = spare_len; i < sizeof(spare); i++ )
+ {
+ if( spare[i] != 0xff )
+ {
+ printf("Data spare area is not correct, erasing psi\n");
+ printf("%8.8lx %8.8lx %8.8lx %8.8lx\n",
+ *(unsigned long *) &spare[0],*(unsigned long *)&spare[4],
+ *(unsigned long *) &spare[8],*(unsigned long *)&spare[12]);
+ kerSysErasePsi();
+ break;
+ }
+ }
+ }
+ }
+#endif
+}
+
+#if (INC_NAND_FLASH_DRIVER==1) || (INC_SPI_PROG_NAND==1)
+/***********************************************************************
+ * Function Name: validateNandPartTbl
+ * Description : Checks the NAND partition table fields in NVRAM data.
+ * If nay of the fields are not valid, new values are set.
+ * Returns : None.
+ ***********************************************************************/
+void validateNandPartTbl(PNVRAM_DATA pNvramData)
+{
+ unsigned long ulBlockSizeKb = (unsigned long)flash_get_sector_size(0)/1024;
+ unsigned long ulTotalSizeKb = (unsigned long)flash_get_total_size() / 1024;
+
+#if (INC_SPI_PROG_NAND==1)
+ if( flash_get_flash_type() != FLASH_IFC_NAND )
+ return;
+#endif
+ if( pNvramData->ulNandPartSizeKb[NP_BOOT] != ulBlockSizeKb ||
+ pNvramData->ulNandPartSizeKb[NP_DATA] != NAND_DATA_SIZE_KB ||
+ (pNvramData->ulNandPartSizeKb[NP_BBT] != NAND_BBT_SMALL_SIZE_KB &&
+ pNvramData->ulNandPartSizeKb[NP_BBT] != NAND_BBT_BIG_SIZE_KB) )
+ {
+ /* Initialize NAND flash partition table. */
+ unsigned long ulRootfsSizeKb;
+ unsigned long ulBbtSizeKb = (ulTotalSizeKb > NAND_BBT_THRESHOLD_KB)
+ ? NAND_BBT_BIG_SIZE_KB : NAND_BBT_SMALL_SIZE_KB;
+
+ /* The Boot partition is first and is one block in size. */
+ pNvramData->ulNandPartOfsKb[NP_BOOT] = 0;
+ pNvramData->ulNandPartSizeKb[NP_BOOT] = ulBlockSizeKb;
+
+ /* The Bad Block Table partition is last and is a constant size. */
+ pNvramData->ulNandPartOfsKb[NP_BBT] = ulTotalSizeKb - ulBbtSizeKb;
+ pNvramData->ulNandPartSizeKb[NP_BBT] = ulBbtSizeKb;
+
+ /* The Data partition is before the BBT and is a constant size. */
+ pNvramData->ulNandPartOfsKb[NP_DATA] =
+ pNvramData->ulNandPartOfsKb[NP_BBT] - NAND_DATA_SIZE_KB;
+ pNvramData->ulNandPartSizeKb[NP_DATA] = NAND_DATA_SIZE_KB;
+
+ /* The first rootfs partition starts at the second sector. */
+ pNvramData->ulNandPartOfsKb[NP_ROOTFS_1] = ulBlockSizeKb;
+
+ /* The size of the two root file system partitions is whatever is left
+ * after the Boot, Data and BBT paritions divided by 2 and evenly
+ * divisible by the NAND flash block size.
+ */
+ ulRootfsSizeKb = ((pNvramData->ulNandPartOfsKb[NP_DATA] -
+ pNvramData->ulNandPartOfsKb[NP_ROOTFS_1]) / 2);
+ ulRootfsSizeKb = (ulRootfsSizeKb / ulBlockSizeKb) * ulBlockSizeKb;
+
+#if 1 /* support two file system partitions */
+ pNvramData->ulNandPartSizeKb[NP_ROOTFS_1] = ulRootfsSizeKb;
+
+ pNvramData->ulNandPartOfsKb[NP_ROOTFS_2] =
+ pNvramData->ulNandPartOfsKb[NP_ROOTFS_1] + ulRootfsSizeKb;
+ pNvramData->ulNandPartSizeKb[NP_ROOTFS_2] = ulRootfsSizeKb;
+#else /* support one file system partition */
+ pNvramData->ulNandPartSizeKb[NP_ROOTFS_1] = ulRootfsSizeKb * 2;
+
+ pNvramData->ulNandPartOfsKb[NP_ROOTFS_2] = ulTotalSizeKb;
+ pNvramData->ulNandPartSizeKb[NP_ROOTFS_2] = 0;
+#endif
+
+ writeNvramData(pNvramData);
+
+#if defined(DEBUG_FLASH)
+ printf("boot offset=0x%8.8lx, size=0x%8.8lx\n",
+ pNvramData->ulNandPartOfsKb[NP_BOOT],
+ pNvramData->ulNandPartSizeKb[NP_BOOT]);
+ printf("rootfs1 offset=0x%8.8lx, size=0x%8.8lx\n",
+ pNvramData->ulNandPartOfsKb[NP_ROOTFS_1],
+ pNvramData->ulNandPartSizeKb[NP_ROOTFS_1]);
+ printf("rootfs2 offset=0x%8.8lx, size=0x%8.8lx\n",
+ pNvramData->ulNandPartOfsKb[NP_ROOTFS_2],
+ pNvramData->ulNandPartSizeKb[NP_ROOTFS_2]);
+ printf("data offset=0x%8.8lx, size=0x%8.8lx\n",
+ pNvramData->ulNandPartOfsKb[NP_DATA],
+ pNvramData->ulNandPartSizeKb[NP_DATA]);
+ printf("bbt offset=0x%8.8lx, size=0x%8.8lx\n",
+ pNvramData->ulNandPartOfsKb[NP_BBT],
+ pNvramData->ulNandPartSizeKb[NP_BBT]);
+#endif
+ }
+}
+#else
+void validateNandPartTbl(PNVRAM_DATA pNvramData)
+{
+}
+#endif
+
+
+/***********************************************************************
+ * Function Name: kerSysFlashAddrInfoGet
+ * Description : Fills in a structure with information about the NVRAM
+ * and persistent storage sections of flash memory.
+ * Returns : None.
+ ***********************************************************************/
+void kerSysFlashAddrInfoGet(PFLASH_ADDR_INFO pflash_addr_info)
+{
+ memcpy(pflash_addr_info, &fInfo, sizeof(FLASH_ADDR_INFO));
+}
+
+// get shared blks into *** pTempBuf *** which has to be released bye the caller!
+// return: if pTempBuf != NULL, poits to the data with the dataSize of the buffer
+// !NULL -- ok
+// NULL -- fail
+static unsigned char *getSharedBlks(int start_blk, int num_blks)
+{
+ int i = 0;
+ int usedBlkSize = 0;
+ int sect_size = 0;
+ unsigned char *pTempBuf = NULL;
+ unsigned char *pBuf = NULL;
+
+ for (i = start_blk; i < (start_blk + num_blks); i++)
+ usedBlkSize += flash_get_sector_size((unsigned short) i);
+
+ if ((pTempBuf = (unsigned char *) KMALLOC(usedBlkSize, sizeof(long))) == NULL)
+ {
+ printf("failed to allocate memory with size: %d\n", usedBlkSize);
+ return pTempBuf;
+ }
+
+ pBuf = pTempBuf;
+ for (i = start_blk; i < (start_blk + num_blks); i++)
+ {
+ sect_size = flash_get_sector_size((unsigned short) i);
+#if defined(DEBUG_FLASH)
+ printf("getShareBlks: blk=%d, sect_size=%d\n", i, sect_size);
+#endif
+ flash_read_buf((unsigned short)i, 0, pBuf, sect_size);
+ pBuf += sect_size;
+ }
+
+ return pTempBuf;
+}
+
+
+
+// Set the pTempBuf to flash from start_blk for num_blks
+// return:
+// 0 -- ok
+// -1 -- fail
+static int setSharedBlks(int start_blk, int num_blks, unsigned char *pTempBuf)
+{
+ int i = 0;
+ int sect_size = 0;
+ int sts = 0;
+ unsigned char *pBuf = pTempBuf;
+
+ for (i = start_blk; i < (start_blk + num_blks); i++)
+ {
+ sect_size = flash_get_sector_size((unsigned short) i);
+ flash_sector_erase_int(i);
+ if (flash_write_buf(i, 0, pBuf, sect_size) != sect_size)
+ {
+ printf("Error writing flash sector %d.", i);
+ sts = -1;
+ break;
+ }
+
+#if defined(DEBUG_FLASH)
+ printf("setShareBlks: blk=%d, sect_size=%d\n", i, sect_size);
+#endif
+
+ pBuf += sect_size;
+ }
+
+ return sts;
+}
+
+
+
+/*******************************************************************************
+ * NVRAM functions
+ *******************************************************************************/
+
+// get nvram data
+// return:
+// 0 - ok
+// -1 - fail
+int kerSysNvRamGet(unsigned char *string, int strLen, int offset)
+{
+ unsigned char *pBuf = NULL;
+
+ if ((pBuf = getSharedBlks(NVRAM_SECTOR, 1)) == NULL)
+ return -1;
+
+ // get string off the memory buffer
+ memcpy(string, (pBuf + NVRAM_DATA_OFFSET + offset), strLen);
+
+ KFREE(pBuf);
+
+ return 0;
+}
+
+
+// set nvram
+// return:
+// 0 - ok
+// -1 - fail
+int kerSysNvRamSet(unsigned char *string, int strLen, int offset)
+{
+ int sts = 0;
+ unsigned char *pBuf = NULL;
+
+ if ((pBuf = getSharedBlks(NVRAM_SECTOR, 1)) == NULL)
+ return -1;
+
+ // set string to the memory buffer
+ memcpy((pBuf + NVRAM_DATA_OFFSET + offset), string, strLen);
+
+ if (setSharedBlks(NVRAM_SECTOR, 1, pBuf) != 0)
+ sts = -1;
+
+ KFREE(pBuf);
+
+ return sts;
+}
+
+/***********************************************************************
+ * Function Name: kerSysEraseNvRam
+ * Description : Erase the NVRAM storage section of flash memory.
+ * Returns : 1 -- ok, 0 -- fail
+ ***********************************************************************/
+int kerSysEraseNvRam(void)
+{
+ int sts = 1;
+ unsigned char *tempStorage = KMALLOC(NVRAM_LENGTH, sizeof(long));
+
+ // just write the whole buf with '0xff' to the flash
+ if (!tempStorage)
+ sts = 0;
+ else
+ {
+ memset(tempStorage, 0xff, NVRAM_LENGTH);
+ if (kerSysNvRamSet(tempStorage, NVRAM_LENGTH, 0) != 0)
+ sts = 0;
+ KFREE(tempStorage);
+ }
+
+ return sts;
+}
+
+
+/*******************************************************************************
+ * PSI functions
+ *******************************************************************************/
+
+#if (INC_NAND_FLASH_DRIVER!=1)
+/** set psi while preserving any other data that might be sharing sectors with
+ * the psi, e.g. scratch pad.
+ *
+ * @param string (IN) buffer that holds the data to be written.
+ * @param strLen (IN) length of buffer.
+ *
+ * @return 0 if OK, -1 on failure.
+ */
+static int kerSysPsiSet(const unsigned char *string, int strLen)
+{
+ int sts = 0;
+ unsigned char *pBuf = NULL;
+
+ if ((pBuf = getSharedBlks(fInfo.flash_persistent_start_blk,
+ fInfo.flash_persistent_number_blk)) == NULL)
+ return -1;
+
+ // set string to the memory buffer
+ memcpy((pBuf + fInfo.flash_persistent_blk_offset), string, strLen);
+
+ if (setSharedBlks(fInfo.flash_persistent_start_blk,
+ fInfo.flash_persistent_number_blk, pBuf) != 0)
+ sts = -1;
+
+ KFREE(pBuf);
+
+ return sts;
+}
+
+/** set backup psi
+ *
+ * Backup PSI does not share its sectors with anything else, so this
+ * function does not need to read first and write. Just write.
+ * This function expects the length of the buffer to be exactly the
+ * length of the entire PSI.
+ *
+ * @param string (IN) buffer that holds the data to be written.
+ *
+ * @return 0 if OK, -1 on failure.
+ */
+static int kerSysBackupPsiSet(const unsigned char *string)
+{
+ int sts = 0;
+
+ if (setSharedBlks(fInfo.flash_backup_psi_start_blk,
+ fInfo.flash_backup_psi_number_blk,
+ (unsigned char *) string) != 0)
+ sts = -1;
+
+ return sts;
+}
+
+/***********************************************************************
+ * Function Name: kerSysErasePsi
+ * Description : Erase the Psi storage section of flash memory.
+ * Returns : 1 -- ok, 0 -- fail
+ ***********************************************************************/
+int kerSysErasePsi(void)
+{
+ int sts = 1;
+ unsigned char *tempStorage;
+
+ if (fInfo.flash_persistent_start_blk == 0) {
+ sts = 0;
+ }
+ else {
+ tempStorage = KMALLOC(fInfo.flash_persistent_length, sizeof(long));
+ // just write the whole buf with '0xff' to the flash
+ if (!tempStorage)
+ sts = 0;
+ else
+ {
+ memset(tempStorage, 0xff, fInfo.flash_persistent_length);
+ if (kerSysPsiSet(tempStorage, fInfo.flash_persistent_length) != 0)
+ sts = 0;
+
+ // Also erase backup psi if it is there
+ if (fInfo.flash_backup_psi_number_blk > 0)
+ {
+ if (kerSysBackupPsiSet(tempStorage) != 0)
+ sts = 0;
+ }
+
+ KFREE(tempStorage);
+ }
+ }
+ return sts;
+}
+#else
+int kerSysErasePsi(void)
+{
+ int sts = 1;
+ NVRAM_DATA nvramData;
+
+ if( readNvramData(&nvramData) == 0 )
+ {
+ int blk_size = flash_get_sector_size(0) / 1024;
+ int blk_start = nvramData.ulNandPartOfsKb[NP_DATA] / blk_size;
+ int total_blks =
+ blk_start + (nvramData.ulNandPartSizeKb[NP_DATA]) / blk_size;
+
+ while( blk_start < total_blks )
+ {
+ flash_sector_erase_int(blk_start);
+ blk_start++;
+ }
+ sts = 0;
+ }
+
+ return(sts);
+}
+#endif
+
+// flash bcm image
+// return:
+// 0 - ok
+// !0 - the sector number fail to be flashed (should not be 0)
+int kerSysBcmImageSet( int flash_start_addr, unsigned char *string, int size, int fWholeImage)
+{
+ int sts;
+ int sect_size;
+ int blk_start;
+ // int savedSize = size;
+ int total_blks = flash_get_numsectors();
+
+ /* Foxconn add by Cliff Wang, 03/23/2010 */
+ unsigned char *pTempBuf = NULL;
+ int savedBlkStart;
+ /* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+ if( flash_get_flash_type() == FLASH_IFC_NAND )
+ {
+ if( flash_start_addr == FLASH_BASE )
+ total_blks = 1;
+ else
+ {
+ NVRAM_DATA nvramData;
+
+ if( readNvramData(&nvramData) == 0 )
+ {
+ sect_size = flash_get_sector_size(0);
+ int rootfs =
+ ((flash_start_addr - FLASH_BASE) / 1024 ==
+ nvramData.ulNandPartOfsKb[NP_ROOTFS_2])
+ ? NP_ROOTFS_2 : NP_ROOTFS_1;
+
+ total_blks = (nvramData.ulNandPartOfsKb[rootfs] +
+ nvramData.ulNandPartSizeKb[rootfs]) / (sect_size/ 1024);
+ }
+ }
+ }
+
+#if defined(DEBUG_FLASH)
+ printf("kerSysBcmImageSet: flash_start_addr=0x%x string=%p len=%d wholeImage=%d\n",
+ flash_start_addr, string, size, fWholeImage);
+#endif
+
+ blk_start = flash_get_blk(flash_start_addr);
+ /* Foxconn add start by Cliff Wang, 03/23/2010 */
+ savedBlkStart = blk_start;
+ if( blk_start < 0 )
+ return( -1 );
+ /* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+ /* write image to flash memory */
+ do
+ {
+ g_nmrp_keepalive = 1; /* Foxconn add by Cliff Wang, 03/23/2010 */
+
+ sect_size = flash_get_sector_size(blk_start);
+
+#if defined(DEBUG_FLASH)
+ printf("Image flashing on block: %d\n", blk_start);
+#endif
+
+ // share the blk with psi only when fWholeImage == 0
+ // Foxconn modified by Silver Shih for burn board Id
+ if ((!fWholeImage && blk_start == fInfo.flash_persistent_start_blk) || (fWholeImage == 5))
+ {
+
+#if 0
+ if (size > (sect_size - fInfo.flash_persistent_length))
+ {
+ printf("Image is too big\n");
+ break; // image is too big. Can not overwrite to psi
+ }
+#endif
+
+ if ((pTempBuf = (unsigned char *) KMALLOC(sect_size, sizeof(long))) == NULL)
+ {
+ printf("Failed to allocate memory with size: %d\n", sect_size);
+ break;
+ }
+ flash_read_buf((unsigned short)blk_start, 0, pTempBuf, sect_size);
+ memcpy(pTempBuf, string, size);
+ flash_sector_erase_int(blk_start); // erase blk before flash
+
+
+ if (flash_write_buf(blk_start, 0, pTempBuf, sect_size) == sect_size)
+ size = 0; // break out and say all is ok
+ break;
+ }
+
+ flash_sector_erase_int(blk_start); // erase blk before flash
+
+ if (sect_size > size)
+ {
+ if (size & 1)
+ size++;
+ sect_size = size;
+ }
+ if (flash_write_buf(blk_start, 0, string, sect_size) != sect_size) {
+ if( flash_get_flash_type() != FLASH_IFC_NAND )
+ break;
+ blk_start++;
+ }
+ else {
+ printf(".");
+ blk_start++;
+ string += sect_size;
+ size -= sect_size;
+
+ /* Foxconn added start by jenny @NMRP */
+ if(nmrp_server_detected==1) // in NMRP mode
+ {
+ if(blk_start - savedBlkStart == 30)
+ {
+ savedBlkStart = blk_start;
+ printf("\n");
+ NMRPKeepAlive();
+ }
+ }
+ /* Foxconn added end by jenny @NMRP */
+ }
+ } while (size > 0);
+ g_nmrp_keepalive = 0; /* Foxconn added by jenny add for timeout */
+
+#if 0 /* Foxconn removed by EricHuang */
+ if (size == 0 && fWholeImage && savedSize > FLASH_LENGTH_BOOT_ROM)
+ {
+ // If flashing a whole image, erase to end of flash.
+ while( blk_start < total_blks )
+ {
+ flash_sector_erase_int(blk_start);
+ printf(".");
+ blk_start++;
+ }
+ }
+#endif
+
+ printf("\n\n");
+
+ if( size == 0 )
+ sts = 0; // ok
+ else
+ sts = blk_start; // failed to flash this sector
+
+ g_nmrp_keepalive = 0; /* Foxconn jenny add for timeout */
+ return sts;
+}
+
+unsigned long kerSysReadFromFlash( void *toaddr, unsigned long fromaddr,
+ unsigned long len )
+{
+ int sect = flash_get_blk((int) fromaddr);
+ unsigned char *start = flash_get_memptr(sect);
+ flash_read_buf( sect, (int) fromaddr - (int) start, toaddr, len );
+
+ return(len);
+}
+
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/src/dev_bcm63xx_uart.c b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/dev_bcm63xx_uart.c
new file mode 100755
index 0000000..3b2ce63
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/dev_bcm63xx_uart.c
@@ -0,0 +1,211 @@
+#include "cfe.h"
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_ioctl.h"
+
+#include "sbmips.h"
+#include "bsp_config.h"
+
+#include "bcm_hwdefs.h"
+#include "bcm_map.h"
+
+static void bcm63xx_uart_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+static int bcm63xx_uart_open(cfe_devctx_t *ctx);
+static int bcm63xx_uart_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int bcm63xx_uart_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat);
+static int bcm63xx_uart_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int bcm63xx_uart_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int bcm63xx_uart_close(cfe_devctx_t *ctx);
+
+const static cfe_devdisp_t bcm63xx_uart_dispatch = {
+ bcm63xx_uart_open,
+ bcm63xx_uart_read,
+ bcm63xx_uart_inpstat,
+ bcm63xx_uart_write,
+ bcm63xx_uart_ioctl,
+ bcm63xx_uart_close,
+ NULL,
+ NULL
+};
+
+
+const cfe_driver_t bcm63xx_uart = {
+ "BCM63xx DUART",
+ "uart",
+ CFE_DEV_SERIAL,
+ &bcm63xx_uart_dispatch,
+ bcm63xx_uart_probe
+};
+
+
+typedef struct bcm63xx_uart_s {
+ int baudrate;
+} bcm63xx_uart_t;
+
+
+static void bcm63xx_set_baudrate( bcm63xx_uart_t * softc )
+{
+ uint32_t baudwd;
+
+ baudwd = (FPERIPH / softc->baudrate) / 16;
+ if( baudwd & 0x1 ) {
+ baudwd = baudwd / 2;
+ } else {
+ baudwd = baudwd / 2 - 1;
+ }
+ UART->baudword = baudwd;
+}
+
+
+static void bcm63xx_uart_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr)
+{
+ bcm63xx_uart_t * softc;
+ char descr[80];
+
+ /* enable the transmitter interrupt? */
+
+ /*
+ * probe_a is the DUART base address.
+ * probe_b is the channel-number-within-duart (0 or 1)
+ * probe_ptr is unused.
+ */
+ softc = (bcm63xx_uart_t *) KMALLOC(sizeof(bcm63xx_uart_t),0);
+ if (softc) {
+ xsprintf( descr, "%s channel %d", drv->drv_description, probe_b );
+ cfe_attach( drv, softc, NULL, descr );
+ }
+}
+
+static int bcm63xx_uart_open(cfe_devctx_t *ctx)
+{
+ bcm63xx_uart_t * softc = ctx->dev_softc;
+
+ /* Enable the UART clock */
+ softc->baudrate = CFG_SERIAL_BAUD_RATE;
+ bcm63xx_set_baudrate( softc );
+
+ UART->control = BRGEN | TXEN | RXEN;
+ UART->config = BITS8SYM | ONESTOP;
+ UART->fifoctl = RSTTXFIFOS | RSTRXFIFOS;
+ UART->intMask = 0;
+
+ return 0;
+}
+
+
+static int bcm63xx_uart_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ unsigned char * bptr;
+ int blen;
+ uint32_t status;
+ char inval;
+
+ bptr = buffer->buf_ptr;
+ blen = buffer->buf_length;
+
+ while (blen > 0) {
+ status = UART->intStatus;
+ if(status & (RXOVFERR | RXPARERR | RXFRAMERR | RXBRK)) {
+ /* RX over flow */
+ if(status & RXOVFERR) {
+ /* reset RX FIFO to clr interrupt */
+ UART->fifoctl |= RSTRXFIFOS;
+ }
+
+ /* other errors just read the bad character to clear the bit */
+ inval = UART->Data;
+ }
+ else if(status & RXFIFONE) {
+ *bptr++ = UART->Data;
+ blen--;
+ }
+ else
+ break;
+ }
+
+ buffer->buf_retlen = buffer->buf_length - blen;
+ return 0;
+}
+
+
+static int bcm63xx_uart_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat)
+{
+ inpstat->inp_status = UART->intStatus & RXFIFONE;
+ return 0;
+}
+
+
+static int bcm63xx_uart_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ unsigned char * bptr;
+ int blen;
+ uint32_t status;
+
+ bptr = buffer->buf_ptr;
+ blen = buffer->buf_length;
+
+ status = 0;
+ while( (blen > 0) && !status ) {
+ /* Wait for the buffer to empty before we write the next character */
+ /* FIXME - The serial port should be able to accept more than one */
+ /* character at a time. Why doesn't it work though? */
+ do {
+ status = UART->intStatus & TXFIFOEMT;
+ } while( !status );
+ UART->Data = *bptr;
+ bptr++;
+ blen--;
+
+ status = UART->intStatus & (TXOVFERR|TXUNDERR);
+ }
+
+ if( status ) {
+ /* Reset TX FIFO */
+ UART->fifoctl |= RSTTXFIFOS;
+ blen++;
+ }
+
+ buffer->buf_retlen = buffer->buf_length - blen;
+ return 0;
+}
+
+
+static int bcm63xx_uart_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ bcm63xx_uart_t * softc = ctx->dev_softc;
+ unsigned int * info = (unsigned int *) buffer->buf_ptr;
+
+ switch ((int)buffer->buf_ioctlcmd) {
+ case IOCTL_SERIAL_GETSPEED:
+ *info = softc->baudrate;
+ break;
+ case IOCTL_SERIAL_SETSPEED:
+ softc->baudrate = *info;
+ bcm63xx_set_baudrate( softc );
+ break;
+ case IOCTL_SERIAL_GETFLOW:
+ *info = SERIAL_FLOW_NONE;
+ break;
+ case IOCTL_SERIAL_SETFLOW:
+ break;
+ default:
+ return -1;
+ }
+
+ return 0;
+}
+
+
+static int bcm63xx_uart_close(cfe_devctx_t *ctx)
+{
+ /* Turn off the UART clock. */
+ return 0;
+}
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/src/html/ul.html b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/html/ul.html
new file mode 100755
index 0000000..a663a35
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/html/ul.html
@@ -0,0 +1,48 @@
+<html>
+ <head>
+ <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
+ <script language="javascript">
+<!-- hide
+
+var progress = 0;
+
+function isInProgress() {
+ if ( progress == 0 ) {
+ progress = 1;
+ return true;
+ }
+ alert('Upload software is in progress. Please wait for a minute.');
+ return false;
+}
+
+// done hiding -->
+</script>
+ </head>
+ <body>
+ <blockquote>
+ <form method='post' ENCTYPE='multipart/form-data' action='upload.cgi' onSubmit='return isInProgress();'>
+ <b>Update Software</b><br>
+ <br>
+ <b>Step 1:</b> Obtain an updated software image file from your ISP.<br>
+ <br>
+ <b>Step 2:</b> Enter the path to the image file location in the box below or
+ click the &quot;Browse&quot; button to locate the image file.<br>
+ <br>
+ <b>Step 3:</b> Click the "Update Software" button once to upload the new image
+ file.<br>
+ <br>
+ NOTE: The update process takes about 2 minutes to complete, and your DSL Router
+ will reboot.<br>
+ <br>
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td>Software File Name:&nbsp;
+ </td>
+ <td><input type='file' name='filename' size='15'></td>
+ </tr>
+ </table>
+ <p align="center"><input type='submit' value='Update Software'></p>
+ </form>
+ </blockquote>
+ </body>
+</html>
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/src/html/ulinfo.html b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/html/ulinfo.html
new file mode 100755
index 0000000..1edb2ae
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/html/ulinfo.html
@@ -0,0 +1,60 @@
+<html>
+ <head>
+ <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
+ <script language="javascript">
+<!-- hide
+var msg = new Array();
+msg[0] = 'New software is being programmed to the flash memory. The DSL Router will reboot upon completion. This process will take about 2 minutes.';
+msg[1] = 'Image uploading failed. The system is out of memory. The DSL Router is rebooting.';
+msg[2] = 'Image uploading failed. No image file was selected.';
+msg[3] = 'Image uploading failed. The selected file contains an illegal image.';
+msg[4] = 'Image uploading failed. The selected file contains an illegal image.';
+msg[5] = 'Image uploading failed. The selected file contains an illegal image.';
+msg[6] = ' ';
+msg[7] = 'Image uploading failed. The selected file contains an illegal image.';
+
+var idxStr = '<%%>';
+
+function getMsgIndex() {
+ var idxNum = parseInt(idxStr);
+ if ( isNaN(idxNum) || idxNum < 0 || idxNum > 7 )
+ idxNum = 7;
+
+ return idxNum;
+}
+
+function reboot() {
+ var loc = 'upload.html';
+
+ var code = 'location.assign("' + loc + '")';
+ eval(code);
+}
+
+function frmLoad() {
+ setTimeout('reboot()', 40000);
+}
+
+function btnBack() {
+ var code = 'location.assign("' + 'upload.html' + '")';
+ eval(code);
+}
+
+// done hiding -->
+</script>
+ </head>
+ <body onLoad='frmLoad()'>
+ <blockquote> <b>DSL Router Software Upgrade</b><br>
+ <br>
+ <script language="javascript">
+<!-- hide
+document.write(msg[getMsgIndex()]);
+// done hiding -->
+</script>
+ <br>
+ <br>
+ <center>
+ <input type='button' onClick='btnBack()' value='Back'>
+ </center>
+ </blockquote>
+ </body>
+</html>
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/src/ram_cfe.mk b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/ram_cfe.mk
new file mode 100755
index 0000000..a540170
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/ram_cfe.mk
@@ -0,0 +1,378 @@
+
+#
+# CFE's version number
+#
+
+include ${TOP}/main/cfe_version.mk
+
+#
+# Default values for certain parameters
+#
+
+CFG_MLONG64 ?= 0
+CFG_LITTLE ?= 0
+CFG_RELOC ?= 0
+CFG_UNCACHED ?= 0
+CFG_NEWRELOC ?= 0
+CFG_BOOTRAM ?= 0
+CFG_VGACONSOLE ?= 0
+CFG_PCI ?= 1
+CFG_LDT_REV_017 ?= 0
+CFG_ZLIB ?= 0
+CFG_BIENDIAN ?= 0
+CFG_DOWNLOAD ?= 0
+CFG_RAMAPP ?= 0
+CFG_USB ?= 0
+
+#
+# Paths to other parts of the firmware. Everything's relative to ${TOP}
+# so that you can actually do a build anywhere you want.
+#
+
+ARCH_TOP = ${TOP}/arch/${ARCH}
+ARCH_SRC = ${ARCH_TOP}/common/src
+ARCH_INC = ${ARCH_TOP}/common/include
+CPU_SRC = ${ARCH_TOP}/cpu/${CPU}/src
+CPU_INC = ${ARCH_TOP}/cpu/${CPU}/include
+
+#
+# It's actually optional to have a 'board'
+# directory. If you don't specify BOARD,
+# don't include the files.
+#
+
+ifneq ("$(strip ${BOARD})","")
+BOARD_SRC = ${ARCH_TOP}/board/${BOARD}/src
+BOARD_INC = ${ARCH_TOP}/board/${BOARD}/include
+endif
+
+#
+# Preprocessor defines for CFE's version number
+#
+
+VDEF = -DCFE_VER_MAJ=${CFE_VER_MAJ} -DCFE_VER_MIN=${CFE_VER_MIN} -DCFE_VER_ECO=${CFE_VER_ECO}
+
+#
+# Construct the list of paths that will eventually become the include
+# paths and VPATH
+#
+
+SRCDIRS = ${ARCH_SRC} ${CPU_SRC} ${LZMZ_SRC} ${BOARD_SRC} ${TOP}/main ${TOP}/vendor ${TOP}/include ${TOP}/net ${TOP}/dev ${TOP}/pci ${TOP}/ui ${TOP}/lib ${TOP}/common ${TOP}/verif ${TOP}/lzma
+
+CFE_INC = ${TOP}/include ${TOP}/pci ${TOP}/net
+
+ifeq ($(strip ${CFG_VGACONSOLE}),1)
+SRCDIRS += ${TOP}/x86emu ${TOP}/pccons
+CFE_INC += ${TOP}/x86emu ${TOP}/pccons
+endif
+
+ifeq ($(strip ${CFG_VAPI}),1)
+SRCDIRS += ${TOP}/verif
+CFE_INC += ${TOP}/verif
+endif
+
+ifeq ($(strip ${CFG_ZLIB}),1)
+SRCDIRS += ${TOP}/zlib
+CFE_INC += ${TOP}/zlib
+endif
+
+
+INCDIRS = $(patsubst %,-I%,$(subst :, ,$(ARCH_INC) $(CPU_INC) $(BOARD_INC) $(CFE_INC)))
+
+VPATH = $(SRCDIRS)
+
+#
+# Bi-endian support: If we're building the little-endian
+# version, use a different linker script so we can locate the
+# ROM at a higher address. You'd think we could do this with
+# normal linker command line switches, but there appears to be no
+# command-line way to override the 'AT' qualifier in the linker script.
+#
+
+CFG_TEXTAT1MB=0
+ifeq ($(strip ${CFG_BIENDIAN}),1)
+ ifeq ($(strip ${CFG_LITTLE}),1)
+ CFG_TEXTAT1MB=1
+ endif
+endif
+
+
+#
+# Configure tools and basic tools flags. This include sets up
+# macros for calling the C compiler, basic flags,
+# and linker scripts.
+#
+
+include ${ARCH_SRC}/tools.mk
+
+#
+# Add some common flags that are used on any architecture.
+#
+
+CFLAGS += -I. $(INCDIRS)
+CFLAGS += -D_CFE_ ${VDEF} -DCFG_BOARDNAME=\"${CFG_BOARDNAME}\" -DCONFIG_MIPS_BRCM
+
+#
+# Add flash driver support.
+#
+# INC_xxx_FLASH_DRIVER is exported from rom_cfe.mk
+
+CFLAGS += -DINC_CFI_FLASH_DRIVER=$(INC_CFI_FLASH_DRIVER)
+CFLAGS += -DINC_SPI_FLASH_DRIVER=$(INC_SPI_FLASH_DRIVER)
+CFLAGS += -DINC_NAND_FLASH_DRIVER=$(INC_NAND_FLASH_DRIVER)
+CFLAGS += -DINC_SPI_PROG_NAND=$(INC_SPI_PROG_NAND)
+
+#
+# Set CFG_TCP=0 to not include the TCP protocol.
+#
+
+CFG_TCP=1
+ifeq ($(strip ${CFG_TCP}),1)
+CFLAGS += -DCFG_TCP
+endif
+
+#
+# Set CFG_WEB_SERVER=0 to not include the web server.
+#
+
+CFG_WEB_SERVER=1
+CFLAGS += -DCFG_WEB_SERVER=${CFG_WEB_SERVER}
+
+#
+# Gross - allow more options to be supplied from command line
+#
+
+ifdef CFG_OPTIONS
+OPTFLAGS = $(patsubst %,-D%,$(subst :, ,$(CFG_OPTIONS)))
+CFLAGS += ${OPTFLAGS}
+endif
+
+
+#
+# IKOS Build
+#
+
+ifeq ($(strip $(BRCM_IKOS)),y)
+CFLAGS += -DCONFIG_BRCM_IKOS
+endif
+
+#
+# This is the makefile's main target. Note that we actually
+# do most of the work in 'ALL' not 'all', since we include
+# other makefiles after this point.
+#
+
+all : build_date.c ALL
+
+#
+# Macros that expand to the list of arch-independent files
+#
+
+LZMAOBJS = LzmaDecode.o dcapi.o
+DEVOBJS =
+## dev_newflash.o dev_null.o dev_promice.o dev_ide_common.o dev_ns16550.o dev_ds17887clock.o dev_flash.o
+LIBOBJS = lib_malloc.o lib_printf.o lib_queue.o lib_string.o lib_string2.o \
+ lib_setjmp.o lib_arena.o
+##lib_hssubr.o lib_physio.o lib_misc.o lib_qsort.o
+
+## Foxconn add start by Cliff Wang, 03/23/2010 ##
+#NETOBJS = net_ether.o net_tftp.o net_ip.o net_udp.o net_dns.o net_arp.o \
+ net_api.o net_tcp.o net_tcpbuf.o
+NETOBJS = net_ether.o net_tftp.o net_ip.o net_udp.o net_dns.o net_arp.o \
+ net_api.o net_tcp.o net_tcpbuf.o net_nmrp.o
+## Foxconn add end by Cliff Wang, 03/23/2010
+
+## dev_tcpconsole.o net_dhcp.o net_icmp.o
+CFEOBJS = cfe_attach.o cfe_iocb_dispatch.o cfe_devfuncs.o \
+ cfe_console.o cfe_mem.o cfe_timer.o \
+ cfe_background.o build_date.o \
+ cfe_xreq.o cfe_filesys.o
+## cfe_error.o cfe_rawfs.o cfe_fatfs.o cfe_httpfs.o cfe_ldr_srec.o cfe_autoboot.o cfe_boot.o cfe_ldr_elf.o cfe_ldr_raw.o cfe_loader.o
+## cfe_main.o nvram_subr.o url.o cfe_savedata.o env_subr.o cfe_zlibfs.o
+
+#UIOBJS = ui_command.o ui_cmddisp.o
+# Foxconn add start by Cliff Wang, 03/23/2010
+UIOBJS = ui_command.o ui_cmddisp.o ui_tftpd.o ui_netcmds.o
+
+## ui_pcicmds.o \ui_tcpcmds.o ui_memcmds.o ui_loadcmds.o ui_flash.o ui_envcmds.o ui_devcmds.o ui_netcmds.o
+## ui_examcmds.o ui_misccmds.o \
+## ui_test_disk.o ui_test_ether.o ui_test_flash.o ui_test_uart.o
+
+#
+# Add more object files if we're supporting PCI
+#
+
+ifeq ($(strip ${CFG_PCI}),1)
+PCIOBJS = pciconf.o ldtinit.o pci_subr.o
+PCIOBJS += pci_devs.o
+DEVOBJS += dev_sp1011.o dev_ht7520.o
+DEVOBJS += dev_ide_pci.o dev_ns16550_pci.o
+DEVOBJS += dev_tulip.o dev_dp83815.o
+CFLAGS += -DCFG_PCI=1
+ifeq ($(strip ${CFG_LDT_REV_017}),1)
+CFLAGS += -DCFG_LDT_REV_017=1
+endif
+ifeq ($(strip ${CFG_DOWNLOAD}),1)
+DEVOBJS += dev_bcm1250.o download.data
+CFLAGS += -DCFG_DOWNLOAD=1
+endif
+endif
+
+#
+# If doing bi-endian, add the compiler switch to change
+# the way the vectors are generated. These switches are
+# only added to the big-endian portion of the ROM,
+# which is located at the real boot vector.
+#
+
+ifeq ($(strip ${CFG_BIENDIAN}),1)
+ ifeq ($(strip ${CFG_LITTLE}),0)
+ CFLAGS += -DCFG_BIENDIAN=1
+ endif
+endif
+
+#
+# Include the makefiles for the architecture-common, cpu-specific,
+# and board-specific directories. Each of these will supply
+# some files to "ALLOBJS". The BOARD directory is optional
+# as some ports are so simple they don't need boad-specific stuff.
+#
+
+include ${ARCH_SRC}/Makefile
+include ${CPU_SRC}/Makefile
+
+ifneq ("$(strip ${BOARD})","")
+include ${BOARD_SRC}/Makefile
+endif
+
+#
+# Add the common object files here.
+#
+
+ALLOBJS += $(LIBOBJS) $(DEVOBJS) $(CFEOBJS) $(VENOBJS) $(UIOBJS) $(NETOBJS) $(LZMAOBJS)
+#$(PCIOBJS)
+
+#
+# VAPI continues to be a special case.
+#
+
+ifeq ($(strip ${CFG_VAPI}),1)
+include ${TOP}/verif/Makefile
+endif
+
+#
+# USB support
+#
+
+ifeq ($(strip ${CFG_USB}),1)
+SRCDIRS += ${TOP}/usb
+CFE_INC += ${TOP}/usb
+include ${TOP}/usb/Makefile
+endif
+
+#
+# If we're doing the VGA console thing, pull in the x86 emulator
+# and the pcconsole subsystem
+#
+
+ifeq ($(strip ${CFG_VGACONSOLE}),1)
+include ${TOP}/x86emu/Makefile
+include ${TOP}/pccons/Makefile
+endif
+
+#
+# If we're including ZLIB, then add its makefile.
+#
+
+ifeq ($(strip ${CFG_ZLIB}),1)
+include ${TOP}/zlib/Makefile
+CFLAGS += -DCFG_ZLIB=1 -DMY_ZCALLOC -DNO_MEMCPY
+endif
+
+#
+# Vendor extensions come next - they live in their own directory.
+#
+
+include ${TOP}/vendor/Makefile
+
+.PHONY : all
+.PHONY : ALL
+.PHONY : build_date.c
+
+#
+# Build the local tools that we use to construct other source files
+#
+
+mkpcidb : ${TOP}/hosttools/mkpcidb.c
+ gcc -o mkpcidb ${TOP}/hosttools/mkpcidb.c
+
+memconfig : ${TOP}/hosttools/memconfig.c
+ gcc -o memconfig -D_MCSTANDALONE_ -D_MCSTANDALONE_NOISY_ -I${TOP}/arch/mips/cpu/sb1250/include ${TOP}/hosttools/memconfig.c ${TOP}/arch/${ARCH}/cpu/${CPU}/src/sb1250_draminit.c
+
+pcidevs_data2.h : mkpcidb ${TOP}/pci/pcidevs_data.h
+ ./mkpcidb > pcidevs_data2.h
+
+mkflashimage : ${TOP}/hosttools/mkflashimage.c
+ gcc -o mkflashimage -I${TOP}/include ${TOP}/hosttools/mkflashimage.c
+
+pci_subr.o : ${TOP}/pci/pci_subr.c pcidevs_data2.h
+
+build_date.c :
+ echo "const char *builddate = \"`date`\";" > build_date.c
+ echo "const char *builduser = \"`whoami`@`hostname`\";" >> build_date.c
+
+#
+# Make a define for the board name
+#
+
+CFLAGS += -D_$(patsubst "%",%,${CFG_BOARDNAME})_
+
+LIBCFE = libcfe.a
+
+%.o : %.c
+ $(GCC) $(CFLAGS) -o $@ $<
+
+%.o : %.S
+ $(GCC) $(CFLAGS) -o $@ $<
+
+%.o : %.html
+ echo unsigned char $*_html[] = { > $*.c
+ hexdump -v -e '" " 12/1 "0x%2.2x, " "\n"' $< | sed -e "s/ 0x .*$\//" -e "\$$s/, *$$//" >> $*.c
+ echo ' };' >> $*.c
+ echo 'int $*_html_size = sizeof($*_html);' >> $*.c
+ echo >> $*.c
+ $(GCC) $(CFLAGS) -o $@ $*.c
+ rm -f $*.c
+
+%.o : %.css
+ echo unsigned char $*_css[] = { > $*.c
+ hexdump -v -e '" " 12/1 "0x%2.2x, " "\n"' $< | sed -e "s/ 0x .*$\//" -e "\$$s/, *$$//" >> $*.c
+ echo ' };' >> $*.c
+ echo 'int $*_css_size = sizeof($*_css);' >> $*.c
+ echo >> $*.c
+ $(GCC) $(CFLAGS) -o $@ $*.c
+ rm -f $*.c
+
+%.o : %.gif
+ echo unsigned char $*_gif[] = { > $*.c
+ hexdump -v -e '" " 12/1 "0x%2.2x, " "\n"' $< | sed -e "s/ 0x .*$\//" -e "\$$s/, *$$//" >> $*.c
+ echo ' };' >> $*.c
+ echo 'int $*_gif_size = sizeof($*_gif);' >> $*.c
+ echo >> $*.c
+ $(GCC) $(CFLAGS) -o $@ $*.c
+ rm -f $*.c
+
+#
+# This rule constructs "libcfe.a" which contains most of the object
+# files.
+#
+
+$(LIBCFE) : $(ALLOBJS)
+ rm -f $(LIBCFE)
+ $(AR) cr $(LIBCFE) $(ALLOBJS)
+ $(RANLIB) $(LIBCFE)
+
+
+
+
+
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_ram/src/robosw_reg.c b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/robosw_reg.c
new file mode 100755
index 0000000..15dad53
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_ram/src/robosw_reg.c
@@ -0,0 +1,615 @@
+/*
+<:copyright-broadcom
+
+ Copyright (c) 2007 Broadcom Corporation
+ All Rights Reserved
+ No portions of this material may be reproduced in any form without the
+ written permission of:
+ Broadcom Corporation
+ 16215 Alton Parkway
+ Irvine, California 92619
+ All information contained in this document is Broadcom Corporation
+ company private, proprietary, and trade secret.
+
+:>
+*/
+
+#include "bcm_map.h"
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+#include "mii.h"
+#include "bcmmii.h"
+#include "sbmips.h"
+#include "cfe_iocb.h"
+#include "cfe_timer.h"
+#include "robosw_reg.h"
+#include "dev_bcm63xx_eth.h"
+#include "bcmSpiRes.h"
+
+static uint32 mii_read(uint32 uPhyAddr, uint32 uRegAddr);
+static void mii_write(uint32 uPhyAddr, uint32 uRegAddr, uint32 data);
+
+static int ext_switch_init(void);
+static int ethsw_spi_ss_id(void);
+static void ethsw_spi_select(int page);
+static void ethsw_spi_rreg(int page, int reg, uint8 *data, int len);
+static void ethsw_spi_wreg(int page, int reg, uint8 *data, int len);
+
+void ethsw_rreg_ext(int access_type, int page, int reg, uint8 *data, int len);
+void ethsw_wreg_ext(int access_type, int page, int reg, uint8 *data, int len);
+
+
+static ETHERNET_MAC_INFO EnetInfo[BP_MAX_ENET_MACS];
+static uint16 PortLinkState[BP_MAX_SWITCH_PORTS];
+
+#define MDIO_BUS 0
+#define SPI_BUS 1
+#define TX_BDS 3
+#define RX_BDS 16
+#define CACHE_ALIGN 16
+#define BUF_LENGTH 160
+extern void _cfe_flushcache(int, uint8_t *, uint8_t *);
+#define INVAL_RANGE(s,l) _cfe_flushcache(CFE_CACHE_INVAL_RANGE,((uint8_t *) (s)),((uint8_t *) (s))+(l))
+
+/* read a value from the MII */
+static uint32 mii_read(uint32 uPhyAddr, uint32 uRegAddr)
+{
+ SWITCH->MdioCtrl = 0x0;
+ SWITCH->MdioCtrl = MdioCtrl_Read | (IsExtPhyId(uPhyAddr) ? MdioCtrl_Ext : 0) |
+ ((uPhyAddr << MdioCtrl_ID_Shift) & MdioCtrl_ID_Mask) |
+ (uRegAddr << MdioCtrl_Addr_Shift);
+ cfe_usleep(100);
+ return SWITCH->MdioData;
+}
+
+/* write a value to the MII */
+static void mii_write(uint32 uPhyAddr, uint32 uRegAddr, uint32 data)
+{
+ SWITCH->MdioCtrl = 0x0;
+ SWITCH->MdioCtrl = MdioCtrl_Write | (IsExtPhyId(uPhyAddr) ? MdioCtrl_Ext : 0) |
+ ((uPhyAddr << MdioCtrl_ID_Shift) & MdioCtrl_ID_Mask) |
+ (uRegAddr << MdioCtrl_Addr_Shift) | data;
+ cfe_usleep(100);
+}
+
+static int clkHz = 781000;
+#if !defined(_BCM96328_)
+static int clk781k = 2;
+#endif
+static int ethsw_spi_ss_id()
+{
+ int slave_select;
+
+ switch(EnetInfo[1].usConfigType) {
+ case BP_ENET_CONFIG_SPI_SSB_0:
+ slave_select = 0;
+ break;
+ case BP_ENET_CONFIG_SPI_SSB_1:
+ slave_select = 1;
+ break;
+ case BP_ENET_CONFIG_SPI_SSB_2:
+ slave_select = 2;
+ break;
+ case BP_ENET_CONFIG_SPI_SSB_3:
+ slave_select = 3;
+ break;
+ default:
+ slave_select = 1;
+ xprintf("Invalid SPI_SS in usConfigType, Assuming 1\n");
+ break;
+ }
+ return slave_select;
+}
+
+static void ethsw_spi_select(int page)
+{
+ unsigned char buf[3];
+ int spi_ss, cid = 0;
+
+ spi_ss = ethsw_spi_ss_id();
+ /* Select new chip */
+ buf[0] = BCM5325_SPI_CMD_NORMAL | BCM5325_SPI_CMD_WRITE |
+ ((cid & BCM5325_SPI_CHIPID_MASK) << BCM5325_SPI_CHIPID_SHIFT);
+
+ /* Select new page */
+ buf[1] = PAGE_SELECT;
+ buf[2] = (char)page;
+#if defined(_BCM96328_)
+ BcmSpi_Write(buf, sizeof(buf), HS_SPI_BUS_NUM, spi_ss, clkHz);
+#else
+ BcmSpi_Write(buf, sizeof(buf), LEG_SPI_BUS_NUM, spi_ss, clkHz);
+#endif
+
+}
+
+static void ethsw_spi_rreg(int page, int reg, uint8 *data, int len)
+{
+ unsigned char buf[64];
+ int rc;
+ int i;
+ int max_check_spi_sts;
+ int prependCnt = BCM5325_SPI_PREPENDCNT, spi_ss, cid = 0;
+
+ spi_ss = ethsw_spi_ss_id();
+
+ ethsw_spi_select(page);
+
+ /* write command byte and register address */
+ buf[0] = BCM5325_SPI_CMD_NORMAL | BCM5325_SPI_CMD_READ |
+ ((cid & BCM5325_SPI_CHIPID_MASK) << BCM5325_SPI_CHIPID_SHIFT);
+ buf[1] = (unsigned char)reg;
+#if defined(_BCM96328_)
+ rc = BcmSpi_Read(buf, prependCnt, 1, HS_SPI_BUS_NUM, spi_ss, clkHz);
+#else
+ rc = BcmSpi_Read(buf, prependCnt, 1, LEG_SPI_BUS_NUM, spi_ss, clkHz);
+#endif
+
+ if (rc == SPI_STATUS_OK) {
+ max_check_spi_sts = 0;
+ do {
+ /* write command byte and read spi_sts address */
+ buf[0] = BCM5325_SPI_CMD_NORMAL | BCM5325_SPI_CMD_READ |
+ ((cid & BCM5325_SPI_CHIPID_MASK) << BCM5325_SPI_CHIPID_SHIFT);
+ buf[1] = (unsigned char)BCM5325_SPI_STS;
+#if defined(_BCM96328_)
+ rc = BcmSpi_Read(buf, prependCnt, 1, HS_SPI_BUS_NUM, spi_ss, clkHz);
+#else
+ rc = BcmSpi_Read(buf, prependCnt, 1, LEG_SPI_BUS_NUM, spi_ss, clkHz);
+#endif
+ if (rc == SPI_STATUS_OK) {
+ /* check the bit 0 RACK bit is set */
+ if (buf[0] & BCM5325_SPI_CMD_RACK) {
+ break;
+ }
+ cfe_usleep(10000);
+ } else {
+ break;
+ }
+ } while (max_check_spi_sts++ < 10);
+
+ if (rc == SPI_STATUS_OK) {
+ for (i = 0; i < len; i++) {
+ buf[0] = BCM5325_SPI_CMD_NORMAL | BCM5325_SPI_CMD_READ |
+ ((cid & BCM5325_SPI_CHIPID_MASK) << BCM5325_SPI_CHIPID_SHIFT);
+ buf[1] = (unsigned char)0xf0;
+#if defined(_BCM96328_)
+ rc = BcmSpi_Read(buf, prependCnt, 1, HS_SPI_BUS_NUM, spi_ss, clkHz);
+#else
+ rc = BcmSpi_Read(buf, prependCnt, 1, LEG_SPI_BUS_NUM, spi_ss, clkHz);
+#endif
+ if (rc == SPI_STATUS_OK) {
+ *(data + (len - i - 1)) = buf[0];
+ }
+ }
+ }
+ }
+}
+
+static void ethsw_spi_wreg(int page, int reg, uint8 *data, int len)
+{
+ unsigned char buf[64];
+ int i;
+ int spi_ss, cid = 0;
+
+ ethsw_spi_select(page);
+
+ spi_ss = ethsw_spi_ss_id();
+ buf[0] = BCM5325_SPI_CMD_NORMAL | BCM5325_SPI_CMD_WRITE |
+ ((cid & BCM5325_SPI_CHIPID_MASK) << BCM5325_SPI_CHIPID_SHIFT);
+
+ buf[1] = (char)reg;
+ for (i = 0; i < len; i++) {
+ /* Write the data out in LE format to the switch */
+ buf[BCM5325_SPI_PREPENDCNT+i] = *(data + (len - i - 1));
+ }
+ BcmSpi_Write(buf, len+BCM5325_SPI_PREPENDCNT, LEG_SPI_BUS_NUM, spi_ss, clkHz);
+}
+
+/* External switch register access through MDC/MDIO */
+static void ethsw_mdio_rreg(int page, int reg, uint8 *data, int len)
+{
+ uint32 cmd, res, ret;
+ int max_retry = 0;
+
+ cmd = (page << REG_PPM_REG16_SWITCH_PAGE_NUMBER_SHIFT) | REG_PPM_REG16_MDIO_ENABLE;
+ mii_write(PSEUDO_PHY_ADDR, REG_PSEUDO_PHY_MII_REG16, cmd);
+
+ cmd = (reg << REG_PPM_REG17_REG_NUMBER_SHIFT) | REG_PPM_REG17_OP_READ;
+ mii_write(PSEUDO_PHY_ADDR, REG_PSEUDO_PHY_MII_REG17, cmd);
+
+ do {
+ res = mii_read(PSEUDO_PHY_ADDR, REG_PSEUDO_PHY_MII_REG17);
+ cfe_usleep(10);
+ } while (((res & (REG_PPM_REG17_OP_WRITE|REG_PPM_REG17_OP_READ)) != REG_PPM_REG17_OP_DONE) &&
+ (max_retry++ < 5));
+
+ ret = 0;
+ ret |= mii_read(PSEUDO_PHY_ADDR, REG_PSEUDO_PHY_MII_REG24) << 0;
+ ret |= mii_read(PSEUDO_PHY_ADDR, REG_PSEUDO_PHY_MII_REG25) << 16;
+ switch (len) {
+ case 1:
+ *data = (uint8)ret;
+ break;
+ case 2:
+ *(uint16 *)data = (uint16)ret;
+ break;
+ case 4:
+ *(uint32 *)data = ret;
+ break;
+ }
+}
+
+static void ethsw_mdio_wreg(int page, int reg, uint8 *data, int len)
+{
+ uint32 cmd, res;
+ uint32 val = 0;
+ int max_retry = 0;
+
+ switch (len) {
+ case 1:
+ val = *data;
+ break;
+ case 2:
+ val = *(uint16 *)data;
+ break;
+ case 4:
+ val = *(uint32 *)data;
+ break;
+ }
+ cmd = (page << REG_PPM_REG16_SWITCH_PAGE_NUMBER_SHIFT) | REG_PPM_REG16_MDIO_ENABLE;
+ mii_write(PSEUDO_PHY_ADDR, REG_PSEUDO_PHY_MII_REG16, cmd);
+
+ cmd = val>>0 & 0xffff;
+ mii_write(PSEUDO_PHY_ADDR, REG_PSEUDO_PHY_MII_REG24, cmd);
+ cmd = val>>16 & 0xffff;
+ mii_write(PSEUDO_PHY_ADDR, REG_PSEUDO_PHY_MII_REG25, cmd);
+ cmd = 0;
+ mii_write(PSEUDO_PHY_ADDR, REG_PSEUDO_PHY_MII_REG26, cmd);
+ cmd = 0;
+ mii_write(PSEUDO_PHY_ADDR, REG_PSEUDO_PHY_MII_REG27, cmd);
+
+ cmd = (reg << REG_PPM_REG17_REG_NUMBER_SHIFT) | REG_PPM_REG17_OP_WRITE;
+ mii_write(PSEUDO_PHY_ADDR, REG_PSEUDO_PHY_MII_REG17, cmd);
+
+ do {
+ res = mii_read(PSEUDO_PHY_ADDR, REG_PSEUDO_PHY_MII_REG17);
+ cfe_usleep(10);
+ } while (((res & (REG_PPM_REG17_OP_WRITE|REG_PPM_REG17_OP_READ)) != REG_PPM_REG17_OP_DONE) &&
+ (max_retry++ < 5));
+}
+
+void ethsw_rreg_ext(int access_type, int page, int reg, uint8 *data, int len)
+{
+ if (access_type == MDIO_BUS) {
+ ethsw_mdio_rreg(page, reg, data, len);
+
+ } else {
+ ethsw_spi_rreg(page, reg, data, len);
+ }
+}
+
+void ethsw_wreg_ext(int access_type, int page, int reg, uint8 *data, int len)
+{
+ if (access_type == MDIO_BUS) {
+ ethsw_mdio_wreg(page, reg, data, len);
+ } else {
+ ethsw_spi_wreg(page, reg, data, len);
+ }
+}
+
+int ext_switch_init(void)
+{
+ uint8 data8;
+ uint32 data32, access_type;
+#if !defined(_BCM96328_)
+ uint32 clkSave;
+#endif
+
+ switch (EnetInfo[1].usConfigType) {
+ case BP_ENET_CONFIG_SPI_SSB_0:
+ case BP_ENET_CONFIG_SPI_SSB_1:
+ case BP_ENET_CONFIG_SPI_SSB_2:
+ case BP_ENET_CONFIG_SPI_SSB_3:
+ access_type = SPI_BUS;
+#if !defined(_BCM96328_)
+ clkSave = SPI->spiClkCfg & SPI_CLK_MASK;
+ xprintf("spiClkCfg = %x; clkSave = %d \n", SPI->spiClkCfg, clkSave);
+ SPI->spiClkCfg = (SPI->spiClkCfg & ~SPI_CLK_MASK) | clk781k;
+#endif
+ break;
+
+ case BP_ENET_CONFIG_MDIO_PSEUDO_PHY:
+ access_type = MDIO_BUS;
+ break;
+
+ default:
+ xprintf("Unknown PHY configuration type\n");
+ return -1;
+ }
+
+ ethsw_rreg_ext(access_type, PAGE_MANAGEMENT, REG_DEVICE_ID, (uint8 *)&data32, sizeof(data32));
+ xprintf("External switch id = %x \n", data32);
+
+ if (data32 == 0x53115)
+ {
+ /* setup Switch MII1 port state override */
+ data8 = (REG_CONTROL_MPSO_MII_SW_OVERRIDE |
+ REG_CONTROL_MPSO_SPEED1000 |
+ REG_CONTROL_MPSO_FDX |
+ REG_CONTROL_MPSO_LINKPASS);
+ ethsw_wreg_ext(access_type, PAGE_CONTROL,
+ REG_CONTROL_MII1_PORT_STATE_OVERRIDE, &data8, sizeof(data8));
+ /* management mode, enable forwarding */
+ data8 = REG_SWITCH_MODE_FRAME_MANAGE_MODE | REG_SWITCH_MODE_SW_FWDG_EN;
+ ethsw_wreg_ext(access_type, PAGE_CONTROL,
+ REG_SWITCH_MODE, &data8, sizeof(data8));
+ /* Enable IMP Port */
+ data8 = ENABLE_MII_PORT;
+ ethsw_wreg_ext(access_type, PAGE_MANAGEMENT,
+ REG_GLOBAL_CONFIG, &data8, sizeof(data8));
+ /* Disable BRCM Tag for IMP */
+ data8 = ~REG_BRCM_HDR_ENABLE;
+ ethsw_wreg_ext(access_type, PAGE_MANAGEMENT,
+ REG_BRCM_HDR_CTRL, &data8, sizeof(data8));
+ /* enable rx bcast, ucast and mcast of imp port */
+ data8 = (REG_MII_PORT_CONTROL_RX_UCST_EN |
+ REG_MII_PORT_CONTROL_RX_MCST_EN |
+ REG_MII_PORT_CONTROL_RX_BCST_EN);
+ ethsw_wreg_ext(access_type, PAGE_CONTROL, REG_MII_PORT_CONTROL, &data8, sizeof(data8));
+ }
+
+#if !defined(_BCM96328_)
+ if (access_type == SPI_BUS)
+ SPI->spiClkCfg = (SPI->spiClkCfg & ~SPI_CLK_MASK) | clkSave;
+#endif
+ return 0;
+}
+
+
+void robosw_init(void)
+{
+ int port;
+
+ BpGetEthernetMacInfo(EnetInfo, BP_MAX_ENET_MACS);
+
+ // Power up and reset EPHYs
+ GPIO->RoboswEphyCtrl = 0;
+ cfe_usleep(1000);
+
+ // Take EPHYs out of reset
+ GPIO->RoboswEphyCtrl =
+ EPHY_RST_4 |
+ EPHY_RST_3 |
+ EPHY_RST_2 |
+ EPHY_RST_1;
+ cfe_usleep(1000);
+
+#if defined(_BCM96328_) || defined(_BCM96362_)
+ GPIO->RoboswSwitchCtrl |= (RSW_MII_DUMB_FWDG_EN | RSW_HW_FWDG_EN);
+#endif
+#if defined(_BCM96368_) || defined(_BCM96816_)
+ GPIO->RoboswEphyCtrl |= (RSW_MII_DUMB_FWDG_EN | RSW_HW_FWDG_EN);
+#endif
+
+ // Enable Switch clock
+ PERF->blkEnables |= ROBOSW_CLK_EN;
+#if defined(_BCM96368_)
+ PERF->blkEnables |= SWPKT_SAR_CLK_EN | SWPKT_USB_CLK_EN;
+#endif
+#if defined(_BCM96816_)
+ PERF->blkEnables |= SWPKT_GPON_CLK_EN | SWPKT_USB_CLK_EN;
+#endif
+
+ cfe_usleep(1000);
+
+ PERF->softResetB &= ~SOFT_RST_SWITCH;
+ cfe_usleep(1000);
+ PERF->softResetB |= SOFT_RST_SWITCH;
+ cfe_usleep(1000);
+
+ /* Disable Rx and Tx on all Ethernet Ports */
+ for (port = 0; port < EPHY_PORTS; port++) {
+ SWITCH->PortCtrl[port] = 0x03;
+ }
+
+ if (EnetInfo[1].ucPhyType == BP_ENET_EXTERNAL_SWITCH) {
+ ext_switch_init();
+ }
+
+}
+
+void robosw_configure_ports()
+{
+ uint16 data;
+ int i;
+
+ for (i = 0; i < 6; i++) {
+ if ((EnetInfo[0].sw.port_map & (1 << i)) != 0) {
+ if (EnetInfo[0].sw.phy_id[i] == 0xff) {
+#if defined(_BCM96368_)
+ if (i == 4)
+ GPIO->GPIOBaseMode |= (EN_GMII1);
+ if (i == 5)
+ GPIO->GPIOBaseMode |= (EN_GMII2);
+#endif
+ continue;
+ }
+ if (IsWanPort(EnetInfo[0].sw.phy_id[i])) {
+ *(SWITCH_PBVLAN + i) = PBMAP_MIPS;
+ SWITCH->DisableLearn |= (1 << i);
+ }
+ // Reset
+ mii_write(EnetInfo[0].sw.phy_id[i], MII_BMCR, BMCR_RESET);
+ PortLinkState[i] = 0;
+ if (!IsExtPhyId(EnetInfo[0].sw.phy_id[i])) {
+ // Configure PHY link/act LED
+#if defined(_BCM96368_)
+ // Enable status change notification */
+ mii_write(EnetInfo[0].sw.phy_id[i], MII_INTERRUPT, MII_INTR_ENABLE);
+ // Configure LEDs
+ data = mii_read(EnetInfo[0].sw.phy_id[i], MII_RESERVED_1B);
+ mii_write(EnetInfo[0].sw.phy_id[i], MII_RESERVED_1B, data | MII_RESERVED_1B_ACT_LED);
+#elif defined(_BCM96816_)
+ // Configure LEDs
+ mii_write(EnetInfo[0].sw.phy_id[i], 0x1c, 0xa410);
+#elif defined(_BCM96328_) || defined(_BCM96362_)
+ // Configure LEDs
+ // Enable Shadow register 2
+ data = mii_read(EnetInfo[0].sw.phy_id[i], MII_BRCM_TEST);
+ mii_write(EnetInfo[0].sw.phy_id[i], MII_BRCM_TEST, (data | MII_BRCM_TEST_SHADOW2_ENABLE));
+ // Set LED0 to speed. Set LED1 to blinky link
+ mii_write(EnetInfo[0].sw.phy_id[i], 0x15, 0x71);
+ // Disable Shadow register 2
+ mii_write(EnetInfo[0].sw.phy_id[i], MII_BRCM_TEST, (data & ~MII_BRCM_TEST_SHADOW2_ENABLE));
+#endif
+ } else {
+#if defined(_BCM96368_)
+ if (i == 4)
+ GPIO->GPIOBaseMode |= (EN_GMII1);
+ if (i == 5)
+ GPIO->GPIOBaseMode |= (EN_GMII2);
+#endif
+#if defined(_BCM96816_)
+ if (i == 2)
+ GPIO->GPIOBaseMode |= (EN_GMII1);
+ if (i == 3)
+ GPIO->GPIOBaseMode |= (EN_GMII2);
+#endif
+#if defined(_BCM96362_)
+ if (i == 4)
+ GPIO->RoboswSwitchCtrl |= (RSW_MII_SEL_2P5V << RSW_MII_SEL_SHIFT);
+ if (i == 5)
+ GPIO->RoboswSwitchCtrl |= (RSW_MII_2_IFC_EN | (RSW_MII_SEL_2P5V << RSW_MII_2_SEL_SHIFT));
+#endif
+#if defined(_BCM96328_)
+ if (i == 4)
+ MISC->miscPadCtrlHigh |= (MISC_MII_SEL_2P5V << MISC_MII_SEL_SHIFT);
+#endif
+ // Reset
+ mii_write(EnetInfo[0].sw.phy_id[i], MII_BMCR, BMCR_RESET);
+ // Enable auto-negotiation
+ mii_write(EnetInfo[0].sw.phy_id[i], MII_ANAR, ANAR_TXFD | ANAR_TXHD | ANAR_10FD | ANAR_10HD | PSB_802_3);
+
+ // Configure LED for link/activity
+ data = MII_1C_SHADOW_LED_CONTROL << MII_1C_SHADOW_REG_SEL_S;
+ mii_write(EnetInfo[0].sw.phy_id[i], MII_REGISTER_1C, data);
+ data = mii_read(EnetInfo[0].sw.phy_id[i], MII_REGISTER_1C);
+ data |= ACT_LINK_LED_ENABLE;
+ data |= MII_1C_WRITE_ENABLE;
+ mii_write(EnetInfo[0].sw.phy_id[i], MII_REGISTER_1C, data);
+
+ data = mii_read(EnetInfo[0].sw.phy_id[i], MII_PHYIDR2);
+ if ((data & BCM_PHYID_M) == (BCM54610_PHYID2 & BCM_PHYID_M)) {
+ // Configure RGMII timing for 54610 GPHY
+ data = MII_1C_SHADOW_CLK_ALIGN_CTRL << MII_1C_SHADOW_REG_SEL_S;
+ mii_write(EnetInfo[0].sw.phy_id[i], MII_REGISTER_1C, data);
+ data = mii_read(EnetInfo[0].sw.phy_id[i], MII_REGISTER_1C);
+ data &= (~GTXCLK_DELAY_BYPASS_DISABLE);
+ data |= MII_1C_WRITE_ENABLE;
+ mii_write(EnetInfo[0].sw.phy_id[i], MII_REGISTER_1C, data);
+
+ // Configure LOM LED Mode
+ data = MII_1C_EXTERNAL_CONTROL_1 << MII_1C_SHADOW_REG_SEL_S;
+ mii_write(EnetInfo[0].sw.phy_id[i], MII_REGISTER_1C, data);
+ data = mii_read(EnetInfo[0].sw.phy_id[i], MII_REGISTER_1C);
+ data |= LOM_LED_MODE;
+ data |= MII_1C_WRITE_ENABLE;
+ mii_write(EnetInfo[0].sw.phy_id[i], MII_REGISTER_1C, data);
+ }
+ }
+ // Restart auto-negotiation
+ data = mii_read(EnetInfo[0].sw.phy_id[i], MII_BMCR);
+ mii_write(EnetInfo[0].sw.phy_id[i], MII_BMCR, data | BMCR_RESTARTAN);
+ }
+ }
+
+#if defined(_BCM96816_)
+ // Disable SERDES, MoCA, USB and GPON port
+ SWITCH->PortOverride[SERDES_PORT_ID] = PortOverride_Enable;
+ SWITCH->PortOverride[MOCA_PORT_ID] = PortOverride_Enable;
+ SWITCH->PortOverride[USB_PORT_ID] = PortOverride_Enable;
+ SWITCH->PortOverride[GPON_PORT_ID] = PortOverride_Enable;
+#endif
+
+#if defined(_BCM96328_) || defined(_BCM96362_)
+ // Ports 6 and 7 are not used on 6328 and 6362
+ SWITCH->PortOverride[PORT_6_PORT_ID] = PortOverride_Enable;
+ SWITCH->PortOverride[PORT_7_PORT_ID] = PortOverride_Enable;
+#endif
+
+#if defined(_BCM96368_)
+ // Disable SAR and USB port
+ SWITCH->PortOverride[USB_PORT_ID] = PortOverride_Enable;
+ SWITCH->PortOverride[SAR_PORT_ID] = PortOverride_Enable;
+#endif
+
+ // Enable the GMII clocks.
+ SWITCH->ImpRgmiiCtrlP4 |= ImpRgmiiCtrl_GMII_En;
+ /* RGMII Delay Programming. Enable ID mode */
+ SWITCH->ImpRgmiiCtrlP4 |= ImpRgmiiCtrl_Timing_Sel;
+
+#if !defined(_BCM96328_)
+ SWITCH->ImpRgmiiCtrlP5 |= ImpRgmiiCtrl_GMII_En;
+ SWITCH->ImpRgmiiCtrlP5 |= ImpRgmiiCtrl_Timing_Sel;
+#endif
+
+ // Reset MIB counters
+ SWITCH->GlbMgmt = GlbMgmt_ResetMib;
+ cfe_usleep(100);
+ SWITCH->GlbMgmt = 0;
+
+ SWITCH->ImpOverride |= ImpOverride_Force | ImpOverride_Linkup;
+
+}
+
+void robosw_check_ports()
+{
+ uint16 data;
+ uint8 PortOverride;
+ int i;
+
+ for (i = 0; i < EPHY_PORTS; i++) {
+ if ((EnetInfo[0].sw.port_map & (1 << i)) != 0) {
+ if (EnetInfo[0].sw.phy_id[i] == 0xff) {
+ PortOverride = PortOverride_Enable | PortOverride_1000Mbs |
+ PortOverride_Fdx | PortOverride_Linkup;
+ if ((SWITCH->PortOverride[i] & PortOverride) != PortOverride) {
+ SWITCH->PortOverride[i] = PortOverride;
+ SWITCH->PortCtrl[i] = 0;
+ PortLinkState[i] = 1;
+ }
+ continue;
+ }
+ PortOverride = PortOverride_Enable;
+ data = mii_read(EnetInfo[0].sw.phy_id[i], MII_ASR);
+ if (PortLinkState[i] != MII_ASR_LINK(data)) {
+
+ if (MII_ASR_LINK(data))
+ PortOverride |= PortOverride_Linkup;
+
+ if (MII_ASR_DONE(data)) {
+ if (MII_ASR_FDX(data))
+ PortOverride |= PortOverride_Fdx;
+ if (MII_ASR_1000(data))
+ PortOverride |= PortOverride_1000Mbs;
+ else if (MII_ASR_100(data))
+ PortOverride |= PortOverride_100Mbs;
+ else
+ PortOverride |= PortOverride_10Mbs;
+ }
+
+ SWITCH->PortOverride[i] = PortOverride;
+
+ if(PortOverride & PortOverride_Linkup) {
+ /* Enable Rx and Tx */
+ SWITCH->PortCtrl[i] = 0;
+ }
+
+ PortLinkState[i] = MII_ASR_LINK(data);
+ }
+ }
+ }
+}
+
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_rom/src/Makefile b/cfe/cfe/arch/mips/board/bcm63xx_rom/src/Makefile
new file mode 100755
index 0000000..808ddc2
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_rom/src/Makefile
@@ -0,0 +1,23 @@
+ifeq ($(strip ${CFG_BOARDNAME}),"BCM96328")
+BSPOBJS += \
+ bcm63xx_impl1_rom_boot.o
+endif
+ifeq ($(strip ${CFG_BOARDNAME}),"BCM96362")
+BSPOBJS += \
+ bcm63xx_impl1_rom_boot.o
+endif
+ifeq ($(strip ${CFG_BOARDNAME}),"BCM96368")
+BSPOBJS += \
+ bcm6368_rom_boot.o \
+ bcm6368_sdramDqs.o
+endif
+ifeq ($(strip ${CFG_BOARDNAME}),"BCM96816")
+BSPOBJS += \
+ bcm63xx_impl1_rom_boot.o
+endif
+ifeq ($(strip ${INC_NAND_FLASH_DRIVER}),1)
+BSPOBJS += \
+ nandflash.o
+endif
+BSPOBJS += \
+ bcm63xx_main.o
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_rom/src/bcm6368_rom_boot.S b/cfe/cfe/arch/mips/board/bcm63xx_rom/src/bcm6368_rom_boot.S
new file mode 100755
index 0000000..f1cba19
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_rom/src/bcm6368_rom_boot.S
@@ -0,0 +1,548 @@
+#include "sbmips.h"
+#include "bsp_config.h"
+
+#include "6368_cpu.h"
+#include "6368_common.h"
+#include "bcm_hwdefs.h"
+#include "boardparms.h"
+#include "mipsmacros.h"
+
+#define SETLEDS1(a,b,c,d) \
+ li a0,(((a)<<24)|((b)<<16)|((c)<<8)|(d)) ; \
+ bal board_setleds
+
+/* *********************************************************************
+ * BOARD_EARLYINIT()
+ *
+ * Initialize board registers. This is the earliest
+ * time the BSP gets control. This routine cannot assume that
+ * memory is operational, and therefore all code in this routine
+ * must run from registers only. The $ra register must not
+ * be modified, as it contains the return address.
+ *
+ * This routine will be called from uncached space, before
+ * the caches are initialized. If you want to make
+ * subroutine calls from here, you must use the CALLKSEG1 macro.
+ *
+ * Among other things, this is where the GPIO registers get
+ * programmed to make on-board LEDs function, or other startup
+ * that has to be done before anything will work.
+ *
+ * Input parameters:
+ * a0 - Flash base address (address of MIPS reset)
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+LEAF(board_earlyinit)
+
+ .set noreorder
+
+ mfc0 t1, C0_BCM_CONFIG, 3
+ li t2, CP0_CMT_TPID
+ and t1, t2
+ bnez t1, 2f # if we are running on thread 1, skip init
+ nop
+
+#if 0
+ /* wait for a while to allow catch by jtag debugger */
+ li t8, -(200000000*3) /* we will count up to 0 to delay a couple of seconds */
+ /* and give the emulator a chance to catch us */
+ mtc0 t8, C0_COUNT
+catchloop:
+ bltz t8, catchloop
+ mfc0 t8, C0_COUNT
+#endif
+
+ /**--------------------------------------------------------------**/
+ /** platform specific code **/
+ /**--------------------------------------------------------------**/
+ /**----- Enable I Cache -----------------------------------------**/
+ mfc0 t1, C0_BCM_CONFIG
+ or t1, (CP0_BCM_CFG_ICSHEN | CP0_BCM_CFG_DCSHEN)
+ mtc0 t1, C0_BCM_CONFIG # Enable I Cache
+
+ // In the begining MIPS core registers are mapped to 0xbfax_xxxx
+ li t1, 0x1FA0000C # Set up CBR to 1FAx_xxxx
+ mtc0 t1, C0_BCM_CONFIG, 6
+
+ li t1, MIPS_BASE_BOOT
+ lw t2, MIPS_LMB_CR(t1)
+ or t2, 0xC0000000 # enable ffxx_xxxx space
+ sw t2, MIPS_LMB_CR(t1)
+ li t2, 0xFFF80001 # SBR FFF8_xxxx and enable
+ sw t2, MIPS_SBR(t1)
+
+ // Now map MIPS core registers to 0xFF4x_xxxx space
+ li t1, 0xFF40000C # CBR FF4x_xxxx (and reserved bits 0xc).
+ mtc0 t1, C0_BCM_CONFIG, 6
+
+ /**----- Initialize EBI -----------------------------------------**/
+ li t1, MPI_BASE
+ li t2, EBI_SIZE_32M
+ or t2, a0
+ sw t2, CS0BASE(t1) # CS[0] Base
+ li t2, THREEWT|EBI_WORD_WIDE|EBI_ENABLE
+ sw t2, CS0CNTL(t1) # CS[0] Control
+
+ /**----- Initialize Serial --------------------------------------**/
+ li t3, ((FPERIPH / 115200) / 16)
+ /*
+ # Baudword = (FPeriph)/Baud/32-1. We have to perform rounding
+ # and subtraction. Above we divided by 16 (instead of 32). If
+ # bit0 is set, we round up. However, we then subtract 1, so final
+ # result should be t3/2. If bit0 is 0, then we truncate and subtract
+ # 1, t3=t3/2-1.
+ */
+ andi t0, t3, 0x1
+ bne t0,zero,1f # do shift only (in delay slot)
+ # and jump to apply
+ srl t3,1 # do divide by 2
+ addiu t3, -1 # subtract 1
+1:
+
+ # t3 contains the UART BAUDWORD
+ li t0, UART_BASE
+ sw t3, UART0BAUD(t0) # Store BaudRate
+ li t1, BITS8SYM|ONESTOP
+ sb t1, UART0CONFIG(t0) # 8 Bits/1 Stop
+ li t1, TXEN|RXEN|BRGEN
+ sb t1, UART0CONTROL(t0) # Enable, No Parity
+ move t1, zero
+ sh t1, UART0INTMASK(t0)
+
+ .set reorder
+2:
+ j ra
+END(board_earlyinit)
+
+/* *********************************************************************
+ * BOARD_DRAMINFO
+ *
+ * Return the address of the DRAM information table
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * v0 - DRAM info table, return 0 to use default table
+ ********************************************************************* */
+LEAF(board_draminfo)
+ j ra
+END(board_draminfo)
+
+/* *********************************************************************
+ * BOARD_DRAMINIT
+ *
+ * This routine should activate memory.
+ *
+ * Input parameters:
+ * None
+ *
+ * Return value:
+ * None
+ *
+ * Registers used:
+ * can use all registers.
+ ********************************************************************* */
+LEAF(board_draminit)
+ .set noreorder
+
+ li t0, MEMC_BASE
+ li t1, DDR_BASE
+
+ li t4, (7 << 28) | (7 << 24) | (1 << 20) | (7 << 16) # UBUS_CNTR_CYCLES = 7, LLMB_CNTR_CYCLES = 7, PH_CNTR_EN = 1, PH_CNTR_CYCLES = 7
+ sw t4, DDR_MIPS_PHASE_CNTL(t1)
+
+ # Calculate a value for a 90 degree phase shift.
+
+ lw t2, DDR_MIPSDDR_PLL_MDIV(t1)
+ srl t2, 8 # Shift and mask off DDR_MDIV
+ and t2, 0xff
+ sll t2, 2 # PI_steps = (90deg * 16 * MBUS(t2) + 2)/360 ~= MBUS * 4
+ or t2, (1 << 14) # set the count direction
+
+ lw t3, DDR_DDR3_4_PHASE_CNTL(t1) # Get current DDR3/4 value.
+ ori t3, 0x7fff # Clear low 15 bits (DDR3 value).
+ xori t3, 0x7fff
+ or t3, t2 # Set new DDR3 value, preserving existing DDR4 value.
+ sw t3, DDR_DDR3_4_PHASE_CNTL(t1)
+
+ li t4, (1 << 28) | (7 << 24) | (1 << 23) | (1 << 20) | (7 << 16) # UBUS_CNTR_CYCLES = 1, LLMB_CNTR_CYCLES = 7, UBUS_CNTR_EN = 1, PH_CNTR_EN = 1, PH_CNTR_CYCLES = 7
+ sw t4, DDR_MIPS_PHASE_CNTL(t1)
+
+ li t4, 0x103e
+ sw t4, DDR_UBUS_PI_DSK1(t1)
+ li t4, 0x40000000
+ sw t4, DDR_UBUS_PI_DSK0(t1)
+
+ ## Set PI mask, and frequnecy of updates
+ # bit[5:0] 1 to 31, controls how often feedback is send back to PI
+ # bit[7] update register in sampling logic to take the new value in bit[5:0]
+ # bit[14:8] masking bits for the sampling result
+
+ li t2, 0x00000010 # 0x8 for 8 DDR cycles, 0x10 for 16 DDR cycles, 0x4 for 4 DDR cycles, can take values from 1 to 31
+ sw t2, DDR_UBUS_PI_DSK0(t1) # set PI update to 16 ddr cycles
+ li t2, 0x00000090 # update value
+ sw t2, DDR_UBUS_PI_DSK0(t1)
+ li t2, 0x00000c90 # set mask to 0001100; 0x1890 will set mask to 0011000
+ sw t2, DDR_UBUS_PI_DSK0(t1)
+
+ ###### Check to see if we found the edge...
+ ###### Ideally we want to loop here until we find an edge....
+
+ li t3, 0
+ li t2, 10000
+
+1:
+ # Looking for a rising edge.
+ lw t4, DDR_UBUS_PI_DSK0(t1) # Read a sample value.
+ srl t4, 16 # The sample is in the upper 16 bits.
+ andi t4, 0x41 # Look at the 2 outermost bits; if the LSB is 0 and the MSB is 1,
+ beq t4, 0x40, 2f # then there is an edge somewhere in the sample.
+
+ addi t3, 1
+ bne t2, t3, 1b
+ nop
+
+2:
+
+ /**----- Configure DDR controller ------------------------------------**/
+ li v0, 16
+ li t2, ((MEMC_12BIT_ROW << MEMC_ROW_SHFT) | (MEMC_9BIT_COL << MEMC_COL_SHFT))
+ or t2, (MEMC_16BIT_BUS << MEMC_WIDTH_SHFT)
+ or t2, (MEMC_SEL_PRIORITY)
+ or t2, (2 << MEMC_EARLY_HDR_CNT_SHFT)
+ or t2, (MEMC_USE_HDR_CNT)
+// or t2, (MEMC_EN_FAST_REPLY)
+ or t2, (MEMC_RR_ARB)
+ or t2, (MEMC_DQS_GATE_EN | MEMC_MEMTYPE_DDR)
+ sw t2, MEMC_CONFIG(t0) # Enable DDR Mem & SEQ EN, 16MB
+
+ li t2, 0x7 # Reduce drive strength for command pins (per John Lorek)
+ sw t2, DDR_CMD_PAD_CNTL(t1)
+
+ li t2, 0x00A778DD
+ sw t2, MEMC_DRAM_TIM(t0) # DDR Timing Set Latency 2.5 Latency,tRAS period =7,tRFC period=12, tWR=3
+ li t2, 0x00000003
+ sw t2, MEMC_CONTROL(t0) # Turn on CKE
+ li t2, 0x0000000B
+ sw t2, MEMC_CONTROL(t0) # PreCharge
+ li t2, 0x00004002
+ sw t2, MEMC_M_EM_BUF(t0) # Value for Extended Mode Register, DDR Reduced Drive Strength On
+ li t2, 0x00000013
+ sw t2, MEMC_CONTROL(t0) # MRS command
+ li t2, 0x00000163
+ sw t2, MEMC_M_EM_BUF(t0) # Reset DLL, Burst Length = 8, Burst Type Sequential 2.5 Latency
+ li t2, 0x00000013
+ sw t2, MEMC_CONTROL(t0) # MRS command
+ nop # Delay 200 DDR clock cycles (~1.5 uS)
+ nop
+ nop
+ li t2, 0x0000000B
+ sw t2, MEMC_CONTROL(t0) # Precharge
+ li t2, 0x0000840f
+ sw t2, MEMC_REF_PD_CONTROL(t0) # Enable auto refresh
+ li t2, 0x00000007
+ sw t2, MEMC_CONTROL(t0) # Set Auto Refresh Mode
+ li t2, 0x00000007
+ sw t2, MEMC_CONTROL(t0) # Set Auto Refresh Mode
+ li t2, 0x00000063
+ sw t2, MEMC_M_EM_BUF(t0) # Reset DLL, Burst Length = 8, Burst Type Sequential 2.5 Latency
+ li t2, 0x00000013
+ sw t2, MEMC_CONTROL(t0) # MRS
+
+ .set reorder
+
+ li sp, 0x80001000
+ sub sp, 8
+ sw ra, 0(sp)
+ sw v0, 4(sp)
+ bal sdramDqsPhaseSet
+ lw v0, 4(sp)
+ lw ra, 0(sp)
+ add sp, 8
+
+ /**----- switch to sync -----------------------------------------**/
+ li t0, 0xff410000
+ li t1, DDR_BASE
+ li t2, 4048
+ li t3, 1
+
+1:
+ lw t4, 0x40(t0) # Read a sample value.
+ srl t4, 16 # The sample is in the upper 16 bits.
+
+ andi t4, t4, 0x41 # Look at the 2 outermost bits; if the LSB is 0 and the MSB is 1,
+ beq t4, 0x40, 2f # then there is an edge somewhere in the sample.
+
+ lw t5, DDR_MIPS_PHASE_CNTL(t1)
+ and t5, 0xffff0000
+ or t5, t3
+ or t5, (1<<14)
+ sw t5, DDR_MIPS_PHASE_CNTL(t1)
+
+ lw t5, 0x40(t0) # Delay before reading another sample.
+ add t3, 1
+ bne t2, t3, 1b
+ b 3f
+
+2:
+ # Success
+ lw t2, DDR_MIPS_PHASE_CNTL(t1) # Turn on auto-PI mode.
+ and t2, 0xf0ffffff
+ or t2, (1 << 24) | (1 << 21) # LLMB_CNTR_CYCLES_CNTL = 1, LLMB_CNTR_EN = 1
+ sw t2, DDR_MIPS_PHASE_CNTL(t1)
+
+ li t2, 0x0010 # Set PI mask to 0000110, and check new value every 16 MIPS cycles.
+ sw t2, 0x40(t0) # set PI update to 16 ddr cycles
+ li t2, 0x80000090 # Enable MIPS auto-PI | Enable update period | Set 16 clock update
+ sw t2, 0x40(t0)
+ li t2, 0x80000c90 # Enable MIPS auto-PI | Enable comparator | Enable update period | Set 16 clock update
+ sw t2, 0x40(t0)
+
+ lw t2, 0x40(t0) # Do a few reads to wait till the edge is stable...
+ lw t2, 0x40(t0)
+ lw t2, 0x40(t0)
+ lw t2, 0x40(t0)
+ lw t2, 0x40(t0)
+
+ mfc0 t1, C0_BCM_CONFIG, 5
+ and t1, ~(0x1 << 28)
+ mtc0 t1, C0_BCM_CONFIG, 5
+
+ /**----- Enable RAC and LMB -------------------------------------**/
+ li t1, MIPS_BASE
+ lw t2, MIPS_LMB_CR(t1)
+ or t2, LMB_EN # Enable LMB
+ sw t2, MIPS_LMB_CR(t1)
+
+ li t2, 0xFFF << RAC_UPB_SHFT # Enable prefetch for RAM address range up to 256MB
+ sw t2, MIPS_RAC_ARR(t1)
+
+ lw t2, MIPS_RAC_CR0(t1)
+ or t2, (RAC_C_INV | RAC_I | RAC_PF_I)
+ sw t2, MIPS_RAC_CR0(t1)
+
+ lw t2, MIPS_RAC_CR1(t1)
+ or t2, (RAC_C_INV | RAC_I | RAC_PF_I)
+ sw t2, MIPS_RAC_CR1(t1)
+
+3:
+ /**----- Enable branch prediction and non-blocking data cache ---**/
+ mfc0 t1, C0_BCM_CONFIG
+ and t1, ~CP0_BCM_CFG_BTHD
+ or t1, CP0_BCM_CFG_NBK
+ or t1, CP0_BCM_CFG_CLF
+ mtc0 t1, C0_BCM_CONFIG
+
+ /* Test whether memory is 16 or 32 bit wide */
+ li t0, MEMC_BASE
+ lw t2, MEMC_CONFIG(t0)
+ and t2, ~MEMC_WIDTH_MASK
+ or t2, (MEMC_32BIT_BUS << MEMC_WIDTH_SHFT)
+ sw t2, MEMC_CONFIG(t0)
+
+ li t3, DRAM_BASE_NOCACHE
+ li t4, 0x12345678
+ sw t4, 0(t3)
+ li t4, 0x87654321
+ sw t4, 4(t3)
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ li t4, 0x12345678
+ lw t5, 0(t3)
+ beq t4, t5, 4f
+
+ /* 16 bit wide memory */
+ lw t2, MEMC_CONFIG(t0)
+ and t2, ~MEMC_WIDTH_MASK
+ or t2, (MEMC_16BIT_BUS << MEMC_WIDTH_SHFT)
+ sw t2, MEMC_CONFIG(t0)
+4:
+ j ra
+
+END(board_draminit)
+
+/* *********************************************************************
+ * BOARD_SETLEDS(x)
+ *
+ * Set LEDs for boot-time progress indication. Not used if
+ * the board does not have progress LEDs. This routine
+ * must not call any other routines, since it may be invoked
+ * either from KSEG0 or KSEG1 and it may be invoked
+ * whether or not the icache is operational.
+ *
+ * Input parameters:
+ * a0 - LED value (8 bits per character, 4 characters)
+ *
+ * Return value:
+ * nothing
+ *
+ * Registers used:
+ * t0,t1,t2,t3
+ ********************************************************************* */
+LEAF(board_setleds)
+#if 0
+ li t0, UART_BASE
+ li t2, TXFIFOEMT
+
+1: lh t1, UART0INTSTAT(t0)
+ and t1, t2
+ bne t1, t2, 1b
+
+ srl t3, a0, 24
+ sb t3, UART0DATA(t0)
+ srl t3, a0, 16
+ sb t3, UART0DATA(t0)
+ srl t3, a0, 8
+ sb t3, UART0DATA(t0)
+ sb a0, UART0DATA(t0)
+ li a0, '\r'
+ sb a0, UART0DATA(t0)
+ li a0, '\n'
+ sb a0, UART0DATA(t0)
+#endif
+ j ra
+END(board_setleds)
+
+/* *********************************************************************
+ * BCMCORE_TP1_SWITCH()
+ *
+ * Check if the thread switch is required. If we are already
+ * running on thread 1 this function will do nothing and just return
+ * If we are running on thread 0 this function will take thread 1
+ * out of reset and put thread 0 to sleep waiting for singnal from
+ * thread 1.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+LEAF(bcmcore_tp1_switch)
+
+ mfc0 t1, C0_BCM_CONFIG, 3
+ li t2, CP0_CMT_TPID
+ and t1, t2
+ bnez t1, tp1 # Already running on thread 1
+
+# Start TP1
+# Set boot address for TP1
+ li t1, MIPS_BASE
+ li t2, 0x98000000 | ENABLE_ALT_BV
+ sw t2, MIPS_TP1_ALT_BV(t1)
+
+# Set a flag so we can wait for TP1 to catch up
+ li t1, 0x0
+ mtc0 t1, $31 # CO_DESAVE
+
+# Take TP1 out of reset
+ mfc0 t1, C0_BCM_CONFIG, 2
+ or t1, CP0_CMT_RSTSE
+ mtc0 t1, C0_BCM_CONFIG, 2
+
+ /* wait until second thread catches up with the first */
+waittp1:
+ mfc0 t0, $31 # CO_DESAVE
+ beqz t0, waittp1
+
+ li t0, THREAD_NUM_ADDRESS
+ FIXUP(t0)
+ lw t0, 0(t0)
+ li t1, 1
+ bne t0, t1, return # Linux will run on TP0, continue running bootloader
+
+# Voice will run on TP0. Set it up and put it to sleep
+
+ # enable interrupts and enable SW IRQ 0
+ li t0, M_SR_IE | M_SR_IBIT1
+ mtc0 t0, C0_SR
+
+ # Set up to use alternate exception vector 0x80000200
+ li t0, M_CAUSE_IV
+ mtc0 t0, C0_CAUSE
+
+ mfc0 t1, C0_BCM_CONFIG, 1
+ # set all ints except IRQ1 to TP1 and cross over SW IRQ 0
+ or t1, (CP0_CMT_XIR_4 | CP0_CMT_XIR_3 | CP0_CMT_XIR_2 | CP0_CMT_XIR_0 | CP0_CMT_SIR_0 | CP0_CMT_NMIR_TP1)
+ mtc0 t1, C0_BCM_CONFIG, 1
+
+ mfc0 t1, C0_BCM_CONFIG, 2
+ # Set debug on TP1, give priority to TP0, and
+ # set TLB exception serialization to ignore SCNT value in CP0 reg22 sel 4
+ and t1, ~CP0_CMT_TPS_MASK;
+ or t1, (CP0_CMT_DSU_TP1 | CP0_CMT_PRIO_TP0 | (1 << CP0_CMT_TPS_SHFT))
+ mtc0 t1, C0_BCM_CONFIG, 2
+
+ # Enable Data RAC on TP0
+ li t1, MIPS_BASE
+ lw t2, MIPS_RAC_CR0(t1)
+ or t2, (RAC_D | RAC_PF_D)
+ sw t2, MIPS_RAC_CR0(t1)
+
+2:
+ li t8, 0
+ b wait_for_wake
+
+tp1:
+# Running on TP1....
+# First signal to TP0 that TP1 is up
+ li t1, 0x1
+ mtc0 t1, $31 # CO_DESAVE
+
+ li t0, THREAD_NUM_ADDRESS
+ FIXUP(t0)
+ lw t0, 0(t0)
+ li t1, 1
+ beq t0, t1, return # Linux will run on TP1, continue running bootloader
+
+# Voice will run on TP1. Set it up and put it to sleep
+
+ # enable interrupts and enable SW IRQ 0
+ li t0, M_SR_IE | M_SR_IBIT1
+ mtc0 t0, C0_SR
+
+ # Set up to use alternate exception vector 0x80000200
+ li t0, M_CAUSE_IV
+ mtc0 t0, C0_CAUSE
+
+ mfc0 t1, C0_BCM_CONFIG, 1
+ # set IRQ1 to TP1 and cross over SW IRQ 0
+ or t1, (CP0_CMT_XIR_1 | CP0_CMT_SIR_0 | CP0_CMT_NMIR_TP0)
+ mtc0 t1, C0_BCM_CONFIG, 1
+
+ mfc0 t1, C0_BCM_CONFIG, 2
+ # Set debug on TP0, give priority to TP1, and
+ # set TLB exception serialization to ignore SCNT value in CP0 reg22 sel 4
+ and t1, ~CP0_CMT_TPS_MASK;
+ or t1, (CP0_CMT_PRIO_TP1 | (1 << CP0_CMT_TPS_SHFT))
+ mtc0 t1, C0_BCM_CONFIG, 2
+
+ # Enable Data RAC on TP1
+ li t1, MIPS_BASE
+ lw t2, MIPS_RAC_CR1(t1)
+ or t2, (RAC_D | RAC_PF_D)
+ sw t2, MIPS_RAC_CR1(t1)
+ b 2b
+
+return:
+ j ra
+
+END(bcmcore_tp1_switch)
+
+# align this code to cache line. NAND flash is not memory mapped after system boots
+# so when we are signaling to the second TP to wake we need
+# jal instruction to be in cache
+ .align 4
+LEAF(wait_for_wake)
+ sync
+ wait # wait for interrupt
+ jal t8 # jump to entry point
+END(wait_for_wake)
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_rom/src/bcm6368_sdramDqs.c b/cfe/cfe/arch/mips/board/bcm63xx_rom/src/bcm6368_sdramDqs.c
new file mode 100755
index 0000000..96d5000
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_rom/src/bcm6368_sdramDqs.c
@@ -0,0 +1,439 @@
+/***************************************************************************
+*
+* Copyright (c) 2004 Broadcom Corporation, All Rights Reserved.
+* Contains proprietary and confidential information.
+*
+* No portions of this material may be reproduced in any form without the
+* written permission of:
+*
+* Broadcom Corporation
+* 16215 Alton Parkway
+* P.O. Box 57013
+* Irvine, California 92619-7013
+*
+* All information contained in this document is Broadcom Corporation
+* company private, proprietary, and trade secret.
+*
+****************************************************************************/
+#include "lib_types.h"
+#include "bcm_map.h"
+
+// Uncomment out the below line to use MemoryTestSuite()
+// #define EXTENDED_MEMORY_TESTS
+
+/* ---- Private Constants and Types -------------------------------------- */
+#define VCDL_PHASE_DEFAULT 16
+#define VCDL_PHASE_MAX 47 /* 154.69 degree */
+#define VCDL_PHASE_MIN 0 /* 22.5 degree */
+
+typedef unsigned long u;
+
+#define N 32*1024 // Size of the copy operation
+ // Must be at least equal to the L2 cache size
+#define S (1*sizeof(u))
+
+/* ---- Private Function Prototypes -------------------------------------- */
+inline static int MemoryTest(void) __attribute__((always_inline));
+inline static void PI_upper_set(volatile uint32 *, int bitOffset, int shift) __attribute__((always_inline));
+inline static void PI_shmoo(volatile uint32 *PI_reg, int bitOffset, int minValue, int maxValue, int increment) __attribute__((always_inline));
+inline static void shmooVcdl(int minValue, int maxValue, int increment) __attribute__((always_inline));
+
+// #define DEBUG_SHMOO 1
+#if DEBUG_SHMOO
+inline static void dumpChar(uint8 c) __attribute__((always_inline));
+inline static void dumpChar(uint8 c)
+{
+ //wait till tx fifo below threshold
+ while (UART->txf_levl > 14);
+ UART->Data = c;
+}
+
+#else
+#define dumpChar(c)
+#endif
+
+#if defined(EXTENDED_MEMORY_TESTS)
+#include "memtest.c"/* Suite memory tests SCAN, MARCH, SLIDING, SHIFT ADDRESS */
+inline static int MemoryTestSuite(void) __attribute__((always_inline));
+#endif
+
+/* ==== Public Functions ================================================= */
+void sdramDqsPhaseSet(void);
+void vcdlCalibration(void);
+
+/*******************************************************************************/
+void sdramDqsPhaseSet(void)
+{
+ int dqOutPhaseMax;
+ int delay;
+ int ubusPhase, mipsPhase;
+ int equalCount = 0;
+
+ // Reset VCDL
+ DDR->Spare1 |= 0x1;
+ delay = 1000;
+ while(delay--);
+ DDR->Spare1 &= ~0x1;
+
+ // Calculate max phase offset from PLL config register.
+ dqOutPhaseMax = ((DDR->MIPSDDRPLLMDiv & DDR_MDIV_MASK) >> DDR_MDIV_SHFT) * 8;
+
+ dumpChar('\n');
+ dumpChar('\r');
+
+ // Start by setting VCDL to the default. This almost always works.
+ // Enable squelch
+ DDR->WSliceCntl |= (0x1<<20) | (0x1<<4);
+ DDR->VCDLPhaseCntl0 = (VCDL_PHASE_DEFAULT << 22) | (VCDL_PHASE_DEFAULT << 16) | (VCDL_PHASE_DEFAULT << 6) | VCDL_PHASE_DEFAULT;
+ DDR->VCDLPhaseCntl1 = (VCDL_PHASE_DEFAULT << 22) | (VCDL_PHASE_DEFAULT << 16) | (VCDL_PHASE_DEFAULT << 6) | VCDL_PHASE_DEFAULT;
+ DDR->WSliceCntl &= ~((0x1<<20) | (0x1<<4));
+
+ // Now shmoo over DQ phase to find an optimum value.
+ dumpChar('D');dumpChar('D');dumpChar('R');dumpChar('2');
+ dumpChar('\n');
+ dumpChar('\r');
+ PI_shmoo(&DDR->DDR1_2PhaseCntl0, 16, -dqOutPhaseMax, dqOutPhaseMax, 1);
+
+ dumpChar('V');dumpChar('C');dumpChar('D');dumpChar('L');
+ dumpChar('\n');
+ dumpChar('\r');
+ shmooVcdl(VCDL_PHASE_MIN, VCDL_PHASE_MAX, 1);
+
+ // Now setup the UBUS clock
+ dumpChar('U');dumpChar('B');dumpChar('U');dumpChar('S');
+ dumpChar('\n');
+ dumpChar('\r');
+
+ MEMC->RefreshPdControl &= ~MEMC_REFRESH_ENABLE; // Turn off refresh while messing with UBus clock
+
+ DDR->MIPSPhaseCntl &= ~(0x1<<23); // turn off ubus PI auto mode
+
+ mipsPhase = DDR->MIPSPhaseCntl;
+ do {
+ if (DDR->MIPSPhaseCntl == mipsPhase)
+ equalCount++;
+ else {
+ equalCount = 0;
+ mipsPhase = DDR->MIPSPhaseCntl;
+ }
+ } while (equalCount < 3);
+
+ ubusPhase = ((DDR->UBUSPhaseCntl) & 0x3ffe); // make it even and decrease count
+ DDR->UBUSPhaseCntl = ubusPhase;
+
+ // Wait until we match several times in a row, to be sure we wait long enough
+ do {
+ if (DDR->UBUSPhaseCntl == ubusPhase)
+ equalCount++;
+ else
+ equalCount = 0;
+ } while (equalCount < 3);
+
+ MEMC->RefreshPdControl |= MEMC_REFRESH_ENABLE;
+}
+
+
+/* ==== Private Functions ================================================ */
+
+inline static void PI_upper_set(volatile uint32 *PI_reg, int bitOffset, int shift)
+{
+ uint32 oldVal;
+ uint32 newVal;
+ int32 oldPhase;
+ int32 newPhase;
+ int equalCount = 0;
+
+ oldVal = *PI_reg; // get the phase config (may have other controls in other 16 bits)
+
+ oldPhase = ( oldVal >> bitOffset ) & 0x3fff;
+ if ( oldPhase & (0x1<<13) ) {
+ oldPhase |= ~0x3fff; // sign extend
+ }
+
+ newPhase = shift & 0x3fff; // set up phase shift value[13:0]
+ if (shift > oldPhase) { // set up up/down [14], shift is signed value
+ newPhase |= 0x1<<14;
+ }
+
+ newPhase = newPhase << bitOffset;
+ oldVal = oldVal & (0xffff << (16-bitOffset)); // Keep the other control bits
+ newVal = newPhase | oldVal;
+ *PI_reg = newVal;
+
+ // Wait until we match several times in a row, to be sure we wait long enough
+ do {
+ if (*PI_reg == newVal)
+ equalCount++;
+ else
+ equalCount = 0;
+ } while (equalCount < 3);
+}
+
+
+inline static void PI_shmoo(volatile uint32 *PI_reg, int bitOffset, int minValue, int maxValue, int increment)
+{
+ int piPhase, piPhaseCnt, passStatus;
+ int pass1Start, pass1Fail, pass2Start, pass2Fail;
+ int pass1Cnt, pass2Cnt;
+
+ PI_upper_set(PI_reg, bitOffset, minValue);
+
+ passStatus = 0;
+ pass1Start = maxValue;
+ pass1Fail = minValue;
+ pass2Start = minValue;
+ pass2Fail = minValue;
+
+ for (piPhase = minValue; piPhase <= maxValue; piPhase += increment) {
+
+ // if (MemoryTestSuite())
+ if (MemoryTest())
+ {
+ if (passStatus == 0x0) { // first_pass start
+ passStatus = 0x1;
+ pass1Start = piPhase;
+ }
+ else if (passStatus == 0x2) { // second_pass start
+ passStatus = 0x3;
+ pass2Start = piPhase;
+ }
+ dumpChar('p');
+ }
+ else {
+ if (passStatus == 0x1) { // fisrt_pass end
+ passStatus = 0x2;
+ pass1Fail = piPhase;
+ }
+ else if (passStatus == 0x3) { // second_pass end
+ passStatus = 0x4;
+ pass2Fail = piPhase;
+ }
+ dumpChar('.');
+ }
+
+ piPhaseCnt = ( piPhase + 0x01) & 0x3fff;
+ if (increment) {
+ piPhaseCnt |= (0x01<<14);
+ }
+
+ *PI_reg = (*PI_reg & (0xffff << (16-bitOffset))) | (piPhaseCnt<<bitOffset);
+
+ }
+
+ // Figure out the middle point of the pass window
+ // valid window 1 -- .......PPPPPPPPPPPPPP.......
+ // valid window 2 -- PPPPPPP........PPPPPPPPPPPPP
+
+ if ((pass1Start != maxValue) && (pass2Start == minValue)) { // valid window 1
+ if (pass1Fail == minValue) {
+ piPhaseCnt = (pass1Start + maxValue) >> 1; // mid-point of the pass window
+ } else {
+ piPhaseCnt = (pass1Start + pass1Fail - 0x1) >> 1; // mid-point of the pass window
+ }
+ }
+ else if ((pass1Start == minValue) && (pass2Start != minValue) && (pass2Fail == minValue)) { // valid window 2
+ pass1Cnt = pass1Fail - minValue;
+ pass2Cnt = maxValue - pass2Start + 1;
+ passStatus= (pass1Cnt + pass2Cnt) >> 1;
+ if (passStatus < pass1Cnt) { // mid-point of the overall pass window is in sub-window 1
+ piPhaseCnt = minValue + ( pass1Cnt - passStatus );
+ }
+ else {
+ piPhaseCnt = pass2Start - 0x1 + passStatus;
+ }
+ }
+ else {
+ piPhaseCnt = 0x0; // shmoo failed.
+ }
+
+ piPhaseCnt &= ~0x01; // make it even number
+
+ PI_upper_set(PI_reg, bitOffset, piPhaseCnt); // set the final phase value
+
+ dumpChar('\n');
+ dumpChar('\r');
+}
+
+
+inline static void shmooVcdl(int minValue, int maxValue, int increment)
+{
+ UINT32 dqsInPhase;
+ UINT32 dqsInSum = 0;
+ UINT32 passCnt = 0;
+ volatile int delay;
+
+ for (dqsInPhase = minValue; dqsInPhase <= maxValue; dqsInPhase += increment) {
+ delay = 1000;
+ while(delay--);
+ // Enable squelch
+ DDR->WSliceCntl |= (0x1<<20) | (0x1<<4);
+ DDR->VCDLPhaseCntl0 = (dqsInPhase << 22) | (dqsInPhase << 16) | (dqsInPhase << 6) | dqsInPhase;
+ DDR->VCDLPhaseCntl1 = (dqsInPhase << 22) | (dqsInPhase << 16) | (dqsInPhase << 6) | dqsInPhase;
+ DDR->WSliceCntl &= ~((0x1<<20) | (0x1<<4));
+
+ delay = 1000;
+ while(delay--);
+
+#if defined(EXTENDED_MEMORY_TESTS)
+ if (MemoryTestSuite() == MEMTEST_SUCCESS )
+#else
+ if (MemoryTest())
+#endif
+ {
+ dqsInSum += dqsInPhase;
+ passCnt++;
+ dumpChar('p');
+ }
+ else {
+ dumpChar('.');
+ }
+ }
+ delay = 1000;
+ while(delay--);
+ // Enable squelch
+ DDR->WSliceCntl |= (0x1<<20) | (0x1<<4);
+ if (passCnt > 0) {
+ dqsInPhase = dqsInSum / passCnt;
+ DDR->VCDLPhaseCntl0 = (dqsInPhase << 22) | (dqsInPhase << 16) | (dqsInPhase << 6) | dqsInPhase;
+ DDR->VCDLPhaseCntl1 = (dqsInPhase << 22) | (dqsInPhase << 16) | (dqsInPhase << 6) | dqsInPhase;
+ }
+ else {
+ DDR->VCDLPhaseCntl0 = (VCDL_PHASE_DEFAULT << 22) | (VCDL_PHASE_DEFAULT << 16) | (VCDL_PHASE_DEFAULT << 6) | VCDL_PHASE_DEFAULT;
+ DDR->VCDLPhaseCntl1 = (VCDL_PHASE_DEFAULT << 22) | (VCDL_PHASE_DEFAULT << 16) | (VCDL_PHASE_DEFAULT << 6) | VCDL_PHASE_DEFAULT;
+ }
+ DDR->WSliceCntl &= ~((0x1<<20) | (0x1<<4));
+ dumpChar('\n');
+ dumpChar('\r');
+}
+
+#if defined(EXTENDED_MEMORY_TESTS)
+
+// Define the memory size for use by the memory test suite
+#define MEMORY_SIZE (2 * 1024)
+
+int MemoryTestSuite(void)
+{
+ int test = 1;
+ uint32_t * memory = (uint32_t*) (0xa0000000);
+ Pattern_t pat32, patIx;
+
+ for (patIx = PATTERN_0x00000000; patIx < PATTERN_MAX; patIx++ )
+ {
+ pat32 = pattern[ patIx ];
+
+ fill_memory( memory, MEMORY_SIZE, 0x0 );
+ if ( scanWordValue( memory, MEMORY_SIZE, pat32 ) == MEMTEST_FAILURE )
+ goto exit_tests;
+
+ test++;
+
+ fill_memory( memory, MEMORY_SIZE, 0x0 );
+ if ( scanBulkValue( memory, MEMORY_SIZE, pat32 ) == MEMTEST_FAILURE )
+ goto exit_tests;
+
+ test++;
+
+ fill_memory( memory, MEMORY_SIZE, 0x0 );
+ if ( scanBulkAltInv( memory, MEMORY_SIZE, pat32 ) == MEMTEST_FAILURE )
+ goto exit_tests;
+
+ test++;
+
+ fill_memory( memory, MEMORY_SIZE, 0x0 );
+ if ( slidingAltInv( memory, MEMORY_SIZE, pat32 ) == MEMTEST_FAILURE )
+ goto exit_tests;
+
+ test++;
+
+ fill_memory( memory, MEMORY_SIZE, 0x0 );
+ if ( slidingDiag( memory, MEMORY_SIZE, pat32 ) == MEMTEST_FAILURE )
+ goto exit_tests;
+
+ test++;
+ }
+
+ fill_memory( memory, MEMORY_SIZE, 0x0 );
+ if ( scanWordSelf( memory, MEMORY_SIZE ) == MEMTEST_FAILURE )
+ goto exit_tests;
+
+ test++;
+
+ fill_memory( memory, MEMORY_SIZE, 0x0 );
+ if ( scanBulkSelf( memory, MEMORY_SIZE ) == MEMTEST_FAILURE )
+ goto exit_tests;
+
+ test++;
+
+ fill_alt_memory( memory, MEMORY_SIZE, 0XAAAAAAAA, 0x55555555 );
+ if ( memoryBulkCopy( memory, (memory + ((MEMORY_SIZE/2)/sizeof(uint32_t))),
+ MEMORY_SIZE/2 ) == MEMTEST_FAILURE )
+ goto exit_tests;
+
+ // return tests;
+ return MEMTEST_SUCCESS;
+
+exit_tests:
+ return MEMTEST_FAILURE;
+
+}
+#endif /* defined(EXTENDED_MEMORY_TESTS) */
+
+//
+// Returns: 0=FAILURE, 1=SUCCESS
+inline static int MemoryTest(void)
+{
+ // Test 32-bit write/read
+ volatile uint32 *memAddr;
+ uint32 memBase;
+ uint32 testValue;
+ int i;
+ int j;
+ int k;
+
+ memBase = 0xa0000000;
+ for (i = 2; i < 24; i++) {
+ memAddr = (void *) (memBase + (1 << i));
+ for (k = 0; k < 2; k++) {
+ /* walking one */
+ testValue = 1;
+ for (j = 0; j < 32; j++) {
+ *memAddr = testValue;
+ if (*memAddr != testValue)
+ return 0;
+
+ testValue <<= 1;
+ }
+ /* walking zero */
+ testValue = ~1;
+ for (j = 0; j < 32; j++) {
+ *memAddr = testValue;
+ if (*memAddr != testValue)
+ return 0;
+
+ testValue = (testValue << 1) | 1;
+ }
+ /* shift in zeroes */
+ testValue = -1;
+ for (j = 0; j < 32; j++) {
+ *memAddr = testValue;
+ *(uint32*)memBase = 0;
+ if (*memAddr != testValue)
+ return 0;
+
+ testValue <<= 1;
+ }
+ /* shift in ones */
+ testValue = 1;
+ for (j = 0; j < 32; j++) {
+ *memAddr = testValue;
+ *(uint32*)memBase = 0;
+ if (*memAddr != testValue)
+ return 0;
+
+ testValue = (testValue << 1) | 1;
+ }
+ }
+ }
+ return 1;
+}
+
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_rom/src/bcm63xx_impl1_rom_boot.S b/cfe/cfe/arch/mips/board/bcm63xx_rom/src/bcm63xx_impl1_rom_boot.S
new file mode 100755
index 0000000..b3986ed
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_rom/src/bcm63xx_impl1_rom_boot.S
@@ -0,0 +1,1818 @@
+#include "sbmips.h"
+#include "bsp_config.h"
+
+#include "bcm_cpu.h"
+#include "bcm_common.h"
+
+#include "bcm_hwdefs.h"
+#include "boardparms.h"
+#include "mipsmacros.h"
+
+#define DDR_TEST 1
+#define UBUS_SYNC_ENABLE 1
+#define LMB_SYNC_ENABLE 1
+#define MIPS_SYNC_ENABLE 1
+#define LMB_ENABLE 1
+
+/* Memory mapping table for different size DRAMs (256Mb, 512Mb, 1Gb, 2Gb) */
+ .globl dram_map_table_x8
+dram_map_table_x8:
+ // 128Mb 64B Interleaving (x8 Mode) 32MB
+ // This is just a place holder. This memory does not exist
+ _LONG_ 0x0F0E0D0C, 0x13121110, 0x17161514, 0x00000018 // Row00_0 Row00_1 Row01_0 Row01_1
+ _LONG_ 0x04000000, 0x0A090805, 0x0000000B, 0x00000000 // Col00_0 Col00_1 Col01_0 Col01_1
+ _LONG_ 0x00080706, 0x00000002, 0x00000055 // Bank CS_End Dramsize
+
+ // 256Mb 64B Interleaving (x8 Mode) 64MB
+ _LONG_ 0x100F0E0D, 0x14131211, 0x18171615, 0x00000019 // Row00_0 Row00_1 Row01_0 Row01_1
+ _LONG_ 0x04000000, 0x0A090805, 0x00000C0B, 0x00000000 // Col00_0 Col00_1 Col01_0 Col01_1
+ _LONG_ 0x00000706, 0x00000004, 0x00000066 // Bank CS_End Dramsize
+
+ // 512Mb 64B Interleaving (x8 Mode) 128MB
+ _LONG_ 0x100F0E0D, 0x14131211, 0x18171615, 0x00001A19 // Row00_0 Row00_1 Row01_0 Row01_1
+ _LONG_ 0x04000000, 0x0A090805, 0x00000C0B, 0x00000000 // Col00_0 Col00_1 Col01_0 Col01_1
+ _LONG_ 0x00000706, 0x00000008, 0x00000077 // Bank CS_End Dramsize
+
+ // 1Gb 64B Interleaving (x8 Mode) 256MB
+ _LONG_ 0x11100F0E, 0x15141312, 0x19181716, 0x00001B1A // Row00_0 Row00_1 Row01_0 Row01_1
+ _LONG_ 0x04000000, 0x0B0A0905, 0x00000D0C, 0x00000000 // Col00_0 Col00_1 Col01_0 Col01_1
+ _LONG_ 0x00080706, 0x00000010, 0x00000088 // Bank CS_End Dramsize
+
+ .globl dram_map_table_x16
+dram_map_table_x16:
+ // 256Mb 64B Interleaving (x16 Mode) 32MB
+ _LONG_ 0x0F0E0D0C, 0x13121110, 0x17161514, 0x00000018 // Row00_0 Row00_1 Row01_0 Row01_1
+ _LONG_ 0x04000000, 0x0A090805, 0x0000000B, 0x00000000 // Col00_0 Col00_1 Col01_0 Col01_1
+ _LONG_ 0x00000706, 0x00000002, 0x00000055 // Bank CS_End Dramsize
+
+ // 512Mb 64B Interleaving (x16 Mode) 64MB
+ _LONG_ 0x100F0E0D, 0x14131211, 0x18171615, 0x00000019 // Row00_0 Row00_1 Row01_0 Row01_1
+ _LONG_ 0x04000000, 0x0A090805, 0x00000C0B, 0x00000000 // Col00_0 Col00_1 Col01_0 Col01_1
+ _LONG_ 0x00000706, 0x00000004, 0x00000066 // Bank CS_End Dramsize
+
+ // 1Gb 64B Interleaving (x16 Mode) 128MB
+ _LONG_ 0x11100F0E, 0x15141312, 0x19181716, 0x0000001A // Row00_0 Row00_1 Row01_0 Row01_1
+ _LONG_ 0x04000000, 0x0B0A0905, 0x00000D0C, 0x00000000 // Col00_0 Col00_1 Col01_0 Col01_1
+ _LONG_ 0x00080706, 0x00000008, 0x00000077 // Bank CS_End Dramsize
+
+ // 2Gb 64B Interleaving (x16 Mode) 256MB
+ _LONG_ 0x11100F0E, 0x15141312, 0x19181716, 0x00001B1A // Row00_0 Row00_1 Row01_0 Row01_1
+ _LONG_ 0x04000000, 0x0B0A0905, 0x00000D0C, 0x00000000 // Col00_0 Col00_1 Col01_0 Col01_1
+ _LONG_ 0x00080706, 0x00000010, 0x00000088 // Bank CS_End Dramsize
+
+ .globl dram_tRefi_table
+dram_tRefi_table: /* Refresh Interval table for different Speed DRAMs (100-200, 300-333, 400) */
+ _LONG_ 0x16, 0x49, 0x5D // 100-200 300-333 400 (MHz)
+
+ .globl dram_tRFC_table
+dram_tRFC_table: /* tRFC table for different size & Speed DRAMs (256Mb, 512Mb, 1Gb)/(200, 333, 400) */
+// 200 333 400 (MHz)
+ _LONG_ 0xF, 0x19, 0x1E // 256Mb
+ _LONG_ 0x15, 0x23, 0x2A // 512Mb
+ _LONG_ 0x1A, 0x2B, 0x33 // 1Gb
+ _LONG_ 0x28, 0x42, 0x4F // 2Gb
+
+ .globl dram_timing_table
+dram_timing_table: /* */
+// tRCD tCL tWR tWL tRP tRRD tRC tFAW tW2R tR2W tR2R tAL tRTP tW2W
+// ---------------------------------------------------------------------
+ .byte 0x03,0x04,0x03,0x03,0x03,0x02,0x11,0x00,0x01,0x01,0x00,0x02,0x02,0x00,0x00,0x00 // 200MHz
+ .byte 0x05,0x05,0x05,0x04,0x05,0x04,0x13,0x00,0x02,0x01,0x00,0x04,0x03,0x00,0x00,0x00 // 300MHz
+ .byte 0x05,0x05,0x06,0x04,0x06,0x05,0x18,0x00,0x02,0x01,0x00,0x04,0x03,0x00,0x00,0x00 // 400MHz
+
+ .globl dram_sync_table
+dram_sync_table: /* Bit vector table for Ubus sync modes and Lmb sync modes */
+#if defined(_BCM96328_)
+ _LONG_ 0x8E10FFFF, 0x8A10FFFF, 0xEDC2FFFF // UBUS Sync , LMB Sync, Mips Sync
+#elif defined(_BCM96362_)
+ _LONG_ 0xFFBFBFBF, 0x6341C101, 0xE7E5E5E5 // UBUS Sync , LMB Sync, Mips Sync
+#elif defined(_BCM96816_)
+ _LONG_ 0xC03033B5, 0x80303095, 0xFF90FFFF // UBUS Sync , LMB Sync, Mips Sync
+#endif
+ .globl dram_speed_table
+dram_speed_table: /* Memory Speed Table for different clock strap values */
+ /* 0=200Mhz 1=333MHz 2=400MHz */
+#if defined(_BCM96328_)
+ .byte 0 // 0x0
+ .byte 0 // 0x1
+ .byte 0 // 0x2
+ .byte 0 // 0x3
+ .byte 0 // 0x4
+ .byte 0 // 0x5
+ .byte 0 // 0x6
+ .byte 0 // 0x7
+ .byte 0 // 0x8
+ .byte 0 // 0x9
+ .byte 0 // 0xa
+ .byte 0 // 0xb
+ .byte 0 // 0xc
+ .byte 0 // 0xd
+ .byte 0 // 0xe
+ .byte 0 // 0xf
+ .byte 0 // 0x10
+ .byte 0 // 0x11
+ .byte 0 // 0x12
+ .byte 0 // 0x13
+ .byte 0 // 0x14
+ .byte 0 // 0x15
+ .byte 2 // 0x16
+ .byte 2 // 0x17
+ .byte 0 // 0x18
+ .byte 0 // 0x19
+ .byte 0 // 0x1a
+ .byte 0 // 0x1b
+ .byte 0 // 0x1c
+ .byte 0 // 0x1d
+ .byte 0 // 0x1e
+ .byte 1 // 0x1f
+#elif defined(_BCM96362_)
+ .byte 1 // 0x0
+ .byte 2 // 0x1
+ .byte 0 // 0x2
+ .byte 1 // 0x3
+ .byte 0 // 0x4
+ .byte 2 // 0x5
+ .byte 2 // 0x6
+ .byte 1 // 0x7
+ .byte 1 // 0x8
+ .byte 2 // 0x9
+ .byte 0 // 0xa
+ .byte 1 // 0xb
+ .byte 0 // 0xc
+ .byte 2 // 0xd
+ .byte 2 // 0xe
+ .byte 1 // 0xf
+ .byte 1 // 0x10
+ .byte 2 // 0x11
+ .byte 0 // 0x12
+ .byte 1 // 0x13
+ .byte 0 // 0x14
+ .byte 1 // 0x15 // 267MHz. Need to change tREFI if this is used.
+ .byte 2 // 0x16
+ .byte 1 // 0x17
+ .byte 1 // 0x18
+ .byte 1 // 0x19
+ .byte 0 // 0x1a
+ .byte 1 // 0x1b
+ .byte 0 // 0x1c
+ .byte 0 // 0x1d
+ .byte 2 // 0x1e
+ .byte 1 // 0x1f
+#elif defined(_BCM96816_)
+ .byte 0 // 0x0
+ .byte 1 // 0x1
+ .byte 0 // 0x2
+ .byte 0 // 0x3
+ .byte 0 // 0x4
+ .byte 1 // 0x5
+ .byte 1 // 0x6
+ .byte 1 // 0x7
+ .byte 1 // 0x8
+ .byte 1 // 0x9
+ .byte 1 // 0xa
+ .byte 2 // 0xb
+ .byte 2 // 0xc
+ .byte 2 // 0xd
+ .byte 2 // 0xe
+ .byte 2 // 0xf
+ .byte 2 // 0x10
+ .byte 2 // 0x11
+ .byte 2 // 0x12
+ .byte 2 // 0x13
+ .byte 2 // 0x14
+ .byte 0 // 0x15
+ .byte 0 // 0x16
+ .byte 1 // 0x17
+ .byte 1 // 0x18
+ .byte 1 // 0x19
+ .byte 1 // 0x1a
+ .byte 1 // 0x1b
+ .byte 2 // 0x1c
+ .byte 2 // 0x1d
+ .byte 2 // 0x1e
+ .byte 2 // 0x1f
+#endif
+
+ .globl memc_ubus_ratio_table
+memc_ubus_ratio_table: /* Memory Speed Table for different clock strap values */
+#if defined(_BCM96328_)
+// 6328 Clock Speed Table
+ .byte 3 // 0x0
+ .byte 3 // 0x1
+ .byte 3 // 0x2
+ .byte 3 // 0x3
+ .byte 3 // 0x4
+ .byte 3 // 0x5
+ .byte 3 // 0x6
+ .byte 3 // 0x7
+ .byte 3 // 0x8
+ .byte 3 // 0x9
+ .byte 3 // 0xa
+ .byte 3 // 0xb
+ .byte 3 // 0xc
+ .byte 3 // 0xd
+ .byte 3 // 0xe
+ .byte 3 // 0xf
+ .byte 3 // 0x10
+ .byte 3 // 0x11
+ .byte 0xf // 0x12
+ .byte 0xf // 0x13
+ .byte 3 // 0x14
+ .byte 9 // 0x15
+ .byte 9 // 0x16
+ .byte 9 // 0x17
+ .byte 3 // 0x18
+ .byte 3 // 0x19
+ .byte 3 // 0x1a
+ .byte 3 // 0x1b
+ .byte 0xb // 0x1c
+ .byte 0xb // 0x1d
+ .byte 0xb // 0x1e
+ .byte 3 // 0x1f
+#elif defined(_BCM96362_)
+// 6362 Clock Speed Table
+ .byte 3 // 0x0
+ .byte 3 // 0x1
+ .byte 3 // 0x2
+ .byte 3 // 0x3
+ .byte 3 // 0x4
+ .byte 3 // 0x5
+ .byte 3 // 0x6
+ .byte 3 // 0x7
+ .byte 3 // 0x8
+ .byte 3 // 0x9
+ .byte 3 // 0xa
+ .byte 3 // 0xb
+ .byte 3 // 0xc
+ .byte 3 // 0xd
+ .byte 3 // 0xe
+ .byte 3 // 0xf
+ .byte 3 // 0x10
+ .byte 3 // 0x11
+ .byte 3 // 0x12
+ .byte 3 // 0x13
+ .byte 4 // 0x14
+ .byte 4 // 0x15
+ .byte 15 // 0x16
+ .byte 3 // 0x17
+ .byte 3 // 0x18
+ .byte 3 // 0x19
+ .byte 3 // 0x1a
+ .byte 3 // 0x1b
+ .byte 3 // 0x1c
+ .byte 3 // 0x1d
+ .byte 3 // 0x1e
+ .byte 3 // 0x1f
+#elif defined(_BCM96816_)
+// 6816 Clock Speed Table
+ .byte 3 // 0x0
+ .byte 9 // 0x1
+ .byte 3 // 0x2
+ .byte 4 // 0x3
+ .byte 3 // 0x4
+ .byte 3 // 0x5
+ .byte 9 // 0x6
+ .byte 3 // 0x7
+ .byte 3 // 0x8
+ .byte 3 // 0x9
+ .byte 2 // 0xa
+ .byte 4 // 0xb
+ .byte 2 // 0xc
+ .byte 3 // 0xd
+ .byte 4 // 0xe
+ .byte 9 // 0xf
+ .byte 1 // 0x10
+ .byte 1 // 0x11
+ .byte 1 // 0x12
+ .byte 1 // 0x13
+ .byte 3 // 0x14
+ .byte 3 // 0x15
+ .byte 4 // 0x16
+ .byte 9 // 0x17
+ .byte 6 // 0x18
+ .byte 2 // 0x19
+ .byte 6 // 0x1a
+ .byte 2 // 0x1b
+ .byte 4 // 0x1c
+ .byte 3 // 0x1d
+ .byte 4 // 0x1e
+ .byte 3 // 0x1f
+#endif
+
+#if defined(_BCM96816_)
+ .globl periph_fix_table
+periph_fix_table: // Periph Clock fix vector for different clock strap values
+ _LONG_ 0xAA30A047
+#endif
+
+#define SETLEDS1(a,b,c,d) \
+ li a0,(((a)<<24)|((b)<<16)|((c)<<8)|(d)) ; \
+ bal board_setleds; \
+ nop
+
+/* *********************************************************************
+ * BOARD_EARLYINIT()
+ *
+ * Initialize board registers. This is the earliest
+ * time the BSP gets control. This routine cannot assume that
+ * memory is operational, and therefore all code in this routine
+ * must run from registers only. The $ra register must not
+ * be modified, as it contains the return address.
+ *
+ * This routine will be called from uncached space, before
+ * the caches are initialized. If you want to make
+ * subroutine calls from here, you must use the CALLKSEG1 macro.
+ *
+ * Among other things, this is where the GPIO registers get
+ * programmed to make on-board LEDs function, or other startup
+ * that has to be done before anything will work.
+ *
+ * Input parameters:
+ * a0 - Flash base address (address of MIPS reset)
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+LEAF(board_earlyinit)
+
+ .set noreorder
+
+ mfc0 t1, C0_BCM_CONFIG, 3
+ li t2, CP0_CMT_TPID
+ and t1, t2
+ bnez t1, 3f # if we are running on thread 1, skip init
+ nop
+
+ /**-------------------------------------------------------------**/
+ /** platform specific code **/
+ /**-------------------------------------------------------------**/
+
+#if defined(_BCM96816_)
+ /**----- Offset UBUS Clock 180 degrees -------------------------**/
+ li t2, MISC_BASE
+ lw t1, MISC_STRAP_BUS(t2)
+
+ srl t1, MISC_STRAP_BUS_MIPS_PLL_FVCO_SHIFT
+ andi t1, 0x1f // Mask out strap bits
+
+ move s0,ra
+ LOADREL(t2, periph_fix_table)
+ lw t2, 0(t2)
+ srl t2, t1
+ andi t2, 1
+ move ra,s0
+
+ beq t2, zero, 2f
+ nop
+
+ li t0, DDR_BASE
+ li t1, 0x00070000 // send new phase value to PLL every 8 cycles
+ sw t1, DDR_CTL_PI_UBUS_CTL(t0)
+ ori t1, 0x4080 // shift 128 steps in the positive direction to be 180 degree's offset VCO 1.6GHz
+ sw t1, DDR_CTL_PI_UBUS_CTL(t0)
+ li t1, 0x00000001
+ sw t1, DDR_CTL_PI_GCF(t0)
+
+ li t1, 0x10000 // delay
+1:
+ bnez t1, 1b
+ addi t1, -1
+
+2:
+ /**----- Set 1.2V and 2.5V Voltage regulators ------------------**/
+ li t1, GPIO_BASE
+ lw t2, GPIO_SWREG_CONFIG(t1)
+ and t2, ~GPIO_SW_VREG_SEL_MASK
+ or t2, (0x0 << GPIO_SW_VREG_SEL_SHIFT)
+ and t2, ~GPIO_LIN_VREG_ADJ_MASK
+ or t2, (0x0 << GPIO_LIN_VREG_ADJ_SHIFT)
+ sw t2, GPIO_SWREG_CONFIG(t1)
+
+ li t1, 0x10000
+1:
+ bnez t1, 1b
+ addi t1, -1
+#endif
+
+#if defined (_BCM96328_) || defined (_BCM96362_)
+ /* slow down mips clk (div 4) to unlock memory */
+ mfc0 t1, C0_BCM_CONFIG, 5
+ or t2, t1, 0x40000000
+ mtc0 t2, C0_BCM_CONFIG, 5
+ nop
+
+ mtc0 t1, C0_BCM_CONFIG, 5
+ nop
+#endif
+
+#if defined (_BCM96362_)
+ /* Adjust VREG frequency up by 50% to improve DSL performance */
+ li t2, MISC_BASE
+
+ /* First set ramp control */
+ lw t1, MISC_VREG_CONTROL0(t2)
+ or t1, (0x2 << MISC_VREG_CONTROL0_VREG_RAMP1P8_SHIFT) | (0x2 << MISC_VREG_CONTROL0_VREG_RAMP1P2_SHIFT)
+ sw t1, MISC_VREG_CONTROL0(t2)
+
+ /* wait 10ms for the setting to take effect */
+ li t8, -2000000
+ mtc0 t8, C0_COUNT
+1:
+ bltz t8, 1b
+ mfc0 t8, C0_COUNT
+
+ and t1, ~((0x7 << MISC_VREG_CONTROL0_VREG_RAMP1P8_SHIFT) | (0x7 << MISC_VREG_CONTROL0_VREG_RAMP1P2_SHIFT))
+ or t1, (0x3 << MISC_VREG_CONTROL0_VREG_ADJ_SHIFT)
+ sw t1, MISC_VREG_CONTROL0(t2)
+
+ /* Increase 2.5V regulator to provide increased range for 1.8V */
+ lw t1, MISC_VREG_CONTROL1(t2)
+ and t1, ~MISC_VREG_CONTROL1_VREG_ISEL2P5_MASK
+ or t1, (MISC_VREG_LDO_2P61 << MISC_VREG_CONTROL1_VREG_ISEL2P5_SHIFT)
+ sw t1, MISC_VREG_CONTROL1(t2)
+#endif
+
+#if 0
+ /* wait for a while to allow catch by jtag debugger */
+ li t8, -(200000000*3) /* we will count up to 0 to delay a couple of seconds */
+ /* and give the emulator a chance to catch us */
+ mtc0 t8, C0_COUNT
+catchloop:
+ bltz t8, catchloop
+ mfc0 t8, C0_COUNT
+#endif
+
+ /**----- Enable I Cache -----------------------------------------**/
+ mfc0 t1, C0_BCM_CONFIG
+ or t1, (CP0_BCM_CFG_ICSHEN | CP0_BCM_CFG_DCSHEN)
+ mtc0 t1, C0_BCM_CONFIG # Enable I Cache
+
+ // In the begining MIPS core registers are mapped to 0xbfax_xxxx
+ li t1, 0x1FA0000C # Set up CBR to 1FAx_xxxx
+ mtc0 t1, C0_BCM_CONFIG, 6
+
+ li t1, MIPS_BASE_BOOT
+ lw t2, MIPS_LMB_CR(t1)
+ or t2, 0xC0000000 # enable ffxx_xxxx space
+ sw t2, MIPS_LMB_CR(t1)
+ li t2, 0xFFF80001 # SBR FFF8_xxxx and enable
+ sw t2, MIPS_SBR(t1)
+
+ // Now map MIPS core registers to 0xFF4x_xxxx space
+ li t1, 0xFF40000C # CBR FF4x_xxxx (and reserved bits 0xc).
+ mtc0 t1, C0_BCM_CONFIG, 6
+
+#if defined(_BCM96816_)
+ /**----- Initialize EBI -----------------------------------------**/
+ li t1, MPI_BASE
+ li t2, EBI_SIZE_32M
+ or t2, a0
+ sw t2, CS0BASE(t1) # CS[0] Base
+ li t2, THREEWT|EBI_WORD_WIDE|EBI_ENABLE
+ sw t2, CS0CNTL(t1) # CS[0] Control
+#endif
+
+ /**----- Initialize Serial --------------------------------------**/
+ li t3, ((FPERIPH / 115200) / 16)
+ /*
+ # Baudword = (FPeriph)/Baud/32-1. We have to perform rounding
+ # and subtraction. Above we divided by 16 (instead of 32). If
+ # bit0 is set, we round up. However, we then subtract 1, so final
+ # result should be t3/2. If bit0 is 0, then we truncate and subtract
+ # 1, t3=t3/2-1.
+ */
+ andi t0, t3, 0x1
+ bne t0,zero,1f # do shift only (in delay slot)
+ # and jump to apply
+ srl t3,1 # do divide by 2
+ addiu t3, -1 # subtract 1
+1:
+
+ // t3 contains the UART BAUDWORD
+ li t0, UART_BASE
+ sw t3, UART0BAUD(t0) # Store BaudRate
+ li t1, BITS8SYM|ONESTOP
+ sb t1, UART0CONFIG(t0) # 8 Bits/1 Stop
+ li t1, TXEN|RXEN|BRGEN
+ sb t1, UART0CONTROL(t0) # Enable, No Parity
+ move t1, zero
+ sh t1, UART0INTMASK(t0)
+
+ .set reorder
+3:
+ j ra
+END(board_earlyinit)
+
+/* *********************************************************************
+ * BOARD_DRAMINFO
+ *
+ * Return the address of the DRAM information table
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * v0 - DRAM info table, return 0 to use default table
+ ********************************************************************* */
+LEAF(board_draminfo)
+ j ra
+END(board_draminfo)
+
+/* *********************************************************************
+ * BOARD_DRAMINIT
+ *
+ * This routine should activate memory.
+ *
+ * Input parameters:
+ * None
+ *
+ * Return value:
+ * None
+ *
+ * Registers used:
+ * can use all registers.
+ ********************************************************************* */
+LEAF(board_draminit)
+ .set noreorder
+
+ move s0,ra
+
+/***** Load DDR Base *************************************/
+ li t0, DDR_BASE
+
+/***** Disable Auto refresh ******************************/
+ li t1, 0x10000
+ sw t1, DDR_CTL_CLKS(t0)
+ SETLEDS1('-','-','-', '-')
+ SETLEDS1('P','H','Y','S')
+
+ li t1, 0x10 // Loop count value
+ li t3, 1
+
+zq_loop:
+ sub t1, t3 // Decrement count by 1
+ beq t1, zero, zq_error
+ nop
+
+ sw zero, PHY_CONTROL_REGS_ZQ_PVT_COMP_CTL(t0) // Reset the calibration engine
+ li t4, (1 << 26)
+ sw t4, PHY_CONTROL_REGS_ZQ_PVT_COMP_CTL(t0) // Start the calibration
+
+ li t2, 0x100 // Timeout value
+
+wait_zq1:
+ beq t2, zero, zq_timeout
+ nop
+
+ lw t4, PHY_CONTROL_REGS_ZQ_PVT_COMP_CTL(t0) // Read the calibration result
+ move t5, t4 // Save calibration result1
+ and t4, (1 << 28)
+ beq t4, zero, wait_zq1
+ sub t2, t3
+
+ sw zero, PHY_CONTROL_REGS_ZQ_PVT_COMP_CTL(t0) // Reset the calibration engine
+ li t4, (1 << 26)
+ sw t4, PHY_CONTROL_REGS_ZQ_PVT_COMP_CTL(t0) // Start the calibration
+
+ li t2, 0x100 // Timeout value
+
+wait_zq2:
+ beq t2, zero, zq_timeout
+ nop
+
+ lw t4, PHY_CONTROL_REGS_ZQ_PVT_COMP_CTL(t0) // Read the calibration result
+ move t6, t4 // Save calibration result1
+ and t4, (1 << 28)
+ beq t4, zero, wait_zq2
+ sub t2, t3
+
+ sw zero, PHY_CONTROL_REGS_ZQ_PVT_COMP_CTL(t0) // Reset the calibration engine
+ li t4, (1 << 26)
+ sw t4, PHY_CONTROL_REGS_ZQ_PVT_COMP_CTL(t0) // Start the calibration
+
+ li t2, 0x100 // Timeout value
+
+wait_zq3:
+ beq t2, zero, zq_timeout
+ nop
+
+ lw t4, PHY_CONTROL_REGS_ZQ_PVT_COMP_CTL(t0) // Read the calibration result
+ move t7, t4 // Save calibration result1
+ and t4, (1 << 28)
+ beq t4, zero, wait_zq3
+ sub t2, t3
+
+ bne t5, t6, zq_loop
+ nop
+ bne t5, t7, zq_loop
+ nop
+ bne t6, t7, zq_loop
+ nop
+
+ b zq_done;
+ nop
+
+zq_error:
+ SETLEDS1('Z','Q','E','R')
+ b zq_done
+ nop
+
+zq_timeout:
+ SETLEDS1('Z','Q','T','O')
+ nop
+zq_done:
+ sw zero, PHY_CONTROL_REGS_ZQ_PVT_COMP_CTL(t0) // Reset the calibration engine
+
+ SETLEDS1('Z','Q','D','N')
+ nop
+
+/****** Set control pad strength to half ********/
+ lw t2, PHY_CONTROL_REGS_DRIVE_PAD_CTL(t0)
+ or t2, 0x4
+ sw t2, PHY_CONTROL_REGS_DRIVE_PAD_CTL(t0)
+
+#if defined(_BCM96816_)
+/****** Disable byte lanes 2 and 3 ********/
+ li t1, 0x800fffff
+ sw t1, PHY_BYTE_LANE_2_IDLE_PAD_CONTROL(t0)
+ sw t1, PHY_BYTE_LANE_3_IDLE_PAD_CONTROL(t0)
+#endif
+
+/****** Disable byte lane 1 clock ********/
+ li t1, 1
+ sw t1, PHY_BYTE_LANE_1_CLOCK_PAD_DISABLE(t0)
+
+ddr_x8:
+
+/****** Change the slew and receiver power to full strength in the byte lanes ********/
+ li t1, 0xFFFFFFFC
+ lw t2, PHY_BYTE_LANE_0_DRIVE_PAD_CTL(t0)
+ and t2, t2, t1
+ sw t2, PHY_BYTE_LANE_0_DRIVE_PAD_CTL(t0)
+ lw t2, PHY_BYTE_LANE_1_DRIVE_PAD_CTL(t0)
+ and t2, t2, t1
+ sw t2, PHY_BYTE_LANE_1_DRIVE_PAD_CTL(t0)
+
+/****** Hardware calibrate VDL *******/
+ li t1, 3
+ sw t1, PHY_BYTE_LANE_0_VDL_CALIBRATE(t0)
+ sw t1, PHY_BYTE_LANE_1_VDL_CALIBRATE(t0)
+
+ li t1, 0x1000
+1:
+ bnez t1, 1b
+ addi t1, -1
+
+/****** Check strap value to figure out 400MHz or 200Mhz DDR ******/
+ li t2, MISC_BASE
+ lw t1, MISC_STRAP_BUS(t2)
+
+ srl t1, MISC_STRAP_BUS_MIPS_PLL_FVCO_SHIFT
+ andi t1, 0x1f // Mask out strap bits
+
+ LOADREL(t2, dram_speed_table)
+
+ add t2, t1
+ lb t1, 0x00(t2)
+ beq t1, zero, ddr_clk_200
+ li t2, 1
+ beq t1, t2, ddr_clk_300
+ nop
+
+/****** Software override rd_en VDL and ADDRESS VDL ********/
+ddr_clk_450:
+ddr_clk_400:
+ li a1, 2 // Set speed to 400MHz (2)
+ b 1f
+ nop
+ddr_clk_300:
+ li a1, 1 // Set speed to 300MHz (1)
+
+/* At higher frequencies set Read_en VDL value to calibrated VDL value + 10 */
+1: li t2, 0x10000
+ lw t1, PHY_BYTE_LANE_0_VDL_STATUS(t0)
+ srl t1, 8
+ addi t1, 0xA
+ or t1, t1, t2
+ sw t1, PHY_BYTE_LANE_0_VDL_OVERRIDE_2(t0)
+ lw t1, PHY_BYTE_LANE_1_VDL_STATUS(t0)
+ srl t1, 8
+ addi t1, 0xA
+ or t1, t1, t2
+ sw t1, PHY_BYTE_LANE_1_VDL_OVERRIDE_2(t0)
+ b vdl_override_cont
+ nop
+
+ddr_clk_200:
+ li a1, 0 // Set speed to 200MHz (0)
+ li t3, 0x1f // Set maximum VDL step size for 200MHz
+ b 1f
+ nop
+
+vdl_override_cont:
+ lw t2, PHY_BYTE_LANE_0_VDL_STATUS(t0)
+ andi t3, t2, 0x1f00
+ srl t3, 8
+ addi t3, t3, 0x4 // Add Stepsize 4
+
+1: li t1, 0x110000 // Enable & Force Override
+ or t1, t3 // Fine rise and fine fall are set to 0
+
+ sw t1, PHY_CONTROL_REGS_STATIC_VDL_OVERRIDE(t0)
+ li t1, 0x0c
+ sw t1, DDR_CTL_DCMD(t0) // Set VDL
+
+ SETLEDS1('P','H','Y','E')
+
+/* Program MC Timing Registers
+
+ Read each timing parameter based on the speed and then create the
+ timing registers and program them.
+*/
+ LOADREL(t2, dram_timing_table)
+
+ li t1, 0x10 // size of dram_timing_table element
+ mult t1, a1
+ mflo t1 // dram_timing_table offset
+ add t2, t1
+
+ move t3, zero
+ lb t1, 0x00(t2) // tRCD
+ andi t1, 0xf
+ move t3, t1
+ lb t1, 0x01(t2) // tCL
+ andi t1, 0xf
+
+ move t4, t1
+ and t4, 0x7 // Make sure that only 3 bits are written to DRAM's tCL field
+ sll t4, 20
+ sw t4, DDR_CTL_DMODE_0 (t0) // Write tCL to the MRS register holder
+
+ sll t1, 4
+ or t3, t1
+ lb t1, 0x02(t2) // tWR
+ andi t1, 0xf
+
+ // Here we create the MRS register values
+ move t4, t1
+ li t5, 1
+ subu t4, t5 // tWR written to DRAM is 1 less than real tWR value
+ andi t4, 0x7
+ sll t4, 25
+ li t5, 0x01030000 // Sequential burst mode, burst of 8, reset DLL
+ or t4, t5
+ lw t5, DDR_CTL_DMODE_0 (t0)
+ or t5, t4
+ sw t5, DDR_CTL_DMODE_0 (t0) // Add tWR to the MRS register holder
+
+ sll t1, 9
+ or t3, t1
+ lb t1, 0x03(t2) // tWL
+ andi t1, 0xf
+ sll t1, 12
+ or t3, t1
+ lb t1, 0x04(t2) // tRP
+ andi t1, 0xf
+ sll t1, 16
+ or t3, t1
+ lb t1, 0x05(t2) // tRRD
+ andi t1, 0xf
+ sll t1, 20
+ or t3, t1
+ lb t1, 0x06(t2) // tRC
+ andi t1, 0x1f
+ sll t1, 24 // tRCw
+ or t3, t1
+ sw t3, DDR_CTL_TIM1_0(t0) // Program TIM1_0 register
+
+ move t3, zero
+ lb t1, 0x06(t2) // tRC
+ andi t1, 0x1f
+ or t3, t1 // tRCr
+ lb t1, 0x07(t2) // tFAW
+ andi t1, 0x3f
+ sll t1, 8
+ or t3, t1
+ li t1, 0xff // tRFC = 0xff (Set to max value first.
+ sll t1, 16 // We'll fix it after we determine dram size)
+ or t3, t1
+
+ // We skip tFIFO since it needs to be 0
+
+ lb t1, 0x08(t2) // tW2R
+ andi t1, 0x3
+ sll t1, 26
+ or t3, t1
+ lb t1, 0x09(t2) // tR2W
+ andi t1, 0x3
+ sll t1, 28
+ or t3, t1
+ lb t1, 0x0a(t2) // tR2R
+ andi t1, 0x1
+ sll t1, 30
+ or t3, t1
+ sw t3, DDR_CTL_TIM1_1(t0) // Program TIM1_1 register
+
+ move t3, zero
+ lb t1, 0x0b(t2) // tAL
+ andi t1, 0xf
+
+ // Here we create the EMRS register values
+ move t4, t1
+ andi t4, 0x7
+ sll t4, 3
+ li t5, 0x384 // RTT=75ohm, OCD Enter
+ or t4, t5
+ lw t5, DDR_CTL_DMODE_0 (t0)
+ or t5, t4
+ sw t5, DDR_CTL_DMODE_0 (t0) // Store required values in EMRS holding register
+
+ or t3, t1
+ lb t1, 0x0c(t2) // tRTP
+ andi t1, 0x7
+ sll t1, 4
+ or t3, t1
+ lb t1, 0x0d(t2) // tW2W
+ andi t1, 0x3
+ sll t1, 8
+ or t3, t1
+ sw t3, DDR_CTL_TIM2(t0) // Program TIM2 register
+
+/*
+// (tRRD is incremented by 1 due to tFAW bug for >=1Gb devices)
+ li t1, 0x18564c55 // tRCD=5,tWR=6,tCL=5,tWL=4,tRP=6,tRRD=5,tRCw=0x18
+// li t1, 0x13554a55 // tRCD=5,tWR=5,tCL=5,tWL=4,tRP=5,tRRD=5,tRCw=0x13
+ sw t1, DDR_CTL_TIM1_0(t0)
+ li t1, 0x18330018 // tR2W=1,tR2R=0,tW2R=2,tFIFO=0,tRFC=0x33,tFAW=0,tRCr=0x18
+// li t1, 0x182b0013 // tR2W=1,tR2R=0,tW2R=2,tFIFO=0,tRFC=0x2b,tFAW=0,tRCr=0x13
+ sw t1, DDR_CTL_TIM1_1(t0)
+ li t1, 0x00000034 // tAL=4 (tRCD-1), tRTP=3, tW2W=0
+ sw t1, DDR_CTL_TIM2(t0)
+*/
+
+// Set x16 mode and Page policy
+ li t1, 0x100
+ sw t1, DDR_CTL_DMODE_1(t0)
+
+// Enable ODT for writes
+ li t1, 0x104
+ sw t1, DDR_CTL_ODT(t0)
+
+/***** Turn on CKE ***************/
+ li t1, 0x35
+ sw t1, DDR_CTL_DCMD(t0)
+
+ li t1, 0x200
+2:
+ bnez t1, 2b
+ addi t1, -1
+
+/***** Set arbitor for Burst Round Robin Mode ***/
+ lw t1, DDR_CTL_ARB(t0)
+ or t1, 4 << 16
+ sw t1, DDR_CTL_ARB(t0)
+
+/***** Issue Precharge All Banks Command ***/
+ li t1, 0x32
+ sw t1, DDR_CTL_DCMD(t0)
+
+/***** Issue EMRS2 Command ***/
+ li t1, 0x0
+ lw t2, DDR_CTL_DMODE_0 (t0) // Load previous value to t2 to preserve it
+ nop
+ sw t1, DDR_CTL_DMODE_0 (t0)
+ li t1, 0x38
+ sw t1, DDR_CTL_DCMD(t0)
+
+/***** Issue EMRS3 Command***/
+ li t1, 0x0
+ sw t1, DDR_CTL_DMODE_0 (t0)
+ li t1, 0x39
+ sw t1, DDR_CTL_DCMD(t0)
+
+// Enable DLL by issuing EMRS Command
+// li t1, 0x0
+// sw t1, DDR_CTL_DMODE_0 (t0)
+ sw t2, DDR_CTL_DMODE_0 (t0) // Use the saved value back to DMODE_0 register
+ li t1, 0x30
+ sw t1, DDR_CTL_DCMD(t0)
+
+/*
+// Issue MRS Command tCL=5 tWL=4
+ li t1, 0x0b530000
+// li t1, 0x07530000 // tCL=5 tWR=5, Reset DLL, Sequential Mode, Burst Length = 8
+ sw t1, DDR_CTL_DMODE_0 (t0)
+ li t1, 0x31
+ sw t1, DDR_CTL_DCMD(t0)
+*/
+// Issue MRS Command. Set Reset DLL bit
+ li t1, 0x31
+ sw t1, DDR_CTL_DCMD(t0)
+
+// Issue Precharge All Banks Command
+ li t1, 0x32
+ sw t1, DDR_CTL_DCMD(t0)
+
+// Issue Autorefresh Command
+ li t1, 0x33
+ sw t1, DDR_CTL_DCMD(t0)
+ li t1, 0x33
+ sw t1, DDR_CTL_DCMD(t0)
+
+ li t1, 0x200
+3:
+ bnez t1, 3b
+ addi t1, -1
+
+/*
+// Clear DLL Reset by Issuing MRS Command, tCL=5 tWL=4
+ li t1, 0x0a530000
+ sw t1, DDR_CTL_DMODE_0 (t0)
+ li t1, 0x31
+ sw t1, DDR_CTL_DCMD(t0)
+*/
+
+// Issue MRS Command w/ DLL Reset bit set to 0
+ lw t1, DDR_CTL_DMODE_0 (t0)
+ li t2, 0xFEFFFFFF // Reset DLL reset bit
+ and t1, t2
+ sw t1, DDR_CTL_DMODE_0 (t0)
+ li t1, 0x31
+ sw t1, DDR_CTL_DCMD(t0)
+
+/*
+// Issue EMRS Command (Enter OCD Calibration)
+ li t1, 0x380
+ sw t1, DDR_CTL_DMODE_0 (t0)
+ li t1, 0x30
+ sw t1, DDR_CTL_DCMD(t0)
+*/
+
+// Issue EMRS Command (Enter OCD Calibration) 75 Ohm, Full strength Drive, tAL=tRCD-1
+ li t1, 0x30
+ sw t1, DDR_CTL_DCMD(t0)
+
+// Issue EMRS Command (Exit OCD Calibration)
+ lw t1, DDR_CTL_DMODE_0 (t0)
+ li t2, 0xFC7F // Reset OCD field for exit mode
+ and t1, t2
+ sw t1, DDR_CTL_DMODE_0 (t0)
+ li t1, 0x30
+ sw t1, DDR_CTL_DCMD(t0)
+
+// Check x8 or x16 DDR
+ li t1, 0x12345678
+ li t3, 0xA0000000
+ sw zero, 0(t3)
+ sw t1, 0(t3)
+ lw t2, 0(t3)
+ bne t1, t2, 3f // Failed
+ nop
+// Do the test twice. Just in case random values match...
+ li t1, 0x87654321
+ sw t1, 0(t3)
+ lw t2, 0(t3)
+ beq t1, t2, 1f // Clock lines are enabled as needed
+ nop
+
+3:
+// Memory test failed. Need to re-enable byte lane 1 clock
+ sw zero, PHY_BYTE_LANE_1_CLOCK_PAD_DISABLE(t0)
+ li t1, 0x200
+2:
+ bnez t1, 2b // Delay after enabling clocks
+ addi t1, -1
+ b ddr_x8
+ nop
+
+1:
+// Find memory size. a3 keeps the size: 0=256Mb, 1=512Mb, 2=1Gb, 3=2Gb
+// Start from 2Gb device
+ LOADREL(t7, dram_map_table_x8)
+ lw t1, PHY_BYTE_LANE_1_CLOCK_PAD_DISABLE(t0)
+ beqz t1, 1f
+ nop
+ LOADREL(t7, dram_map_table_x16)
+
+1:
+ li a3, 4
+ddr_size:
+ addi a3, -1
+
+ li t1, 0x2c // size of dram_map_table element
+ mult t1, a3
+ mflo t2 // dram_map_table offset
+ add t2, t7
+
+ lw t1, 0x00(t2) // Row00_0
+ sw t1, DDR_CTL_ROW00_0(t0)
+
+ lw t1, 0x04(t2) // Row00_1
+ sw t1, DDR_CTL_ROW00_1(t0)
+
+ lw t1, 0x08(t2) // Row01_0
+ sw t1, DDR_CTL_ROW01_0(t0)
+
+ lw t1, 0x0C(t2) // Row01_1
+ sw t1, DDR_CTL_ROW01_1(t0)
+
+ lw t1, 0x10(t2) // Col00_0
+ sw t1, DDR_CTL_COL00_0(t0)
+
+ lw t1, 0x14(t2) // Col00_1
+ sw t1, DDR_CTL_COL00_1(t0)
+
+ lw t1, 0x18(t2) // Col01_0
+ sw t1, DDR_CTL_COL01_0(t0)
+
+ lw t1, 0x1C(t2) // Col01_1
+ sw t1, DDR_CTL_COL01_1(t0)
+
+ lw t1, 0x20(t2) // Bank
+ sw t1, DDR_CTL_BNK10(t0)
+
+ li t1, 0x0 // CS_Start
+ sw t1, DDR_CTL_CSST(t0)
+
+ lw t1, 0x24(t2) // CS_End
+ sw t1, DDR_CTL_CSEND(t0)
+
+ li t1, 0x0 // CS Interleaving CFG
+ sw t1, DDR_CTL_CNFG(t0)
+
+ lw t3, 0x28(t2) // Dram Size
+ lw t1, DDR_CTL_GCFG(t0) // GCFG
+ li t2, 0xFFFFFF00
+ and t1, t1, t2 // Mask out Dram Size Fields
+ or t1, t3, t1 // insert new DRAM Size value
+ sw t1, DDR_CTL_GCFG(t0)
+ beqz a3, ddr_speed
+ nop
+
+// Check for memory aliasing
+// This assumes that the bank interleaving is below address bits 8.
+ li t1, 8
+ li t2, 24
+ add t2, a3 // Scan up to maximum memory size
+ li t3, 0xA0000000
+
+check_alias:
+ li t4, 1
+ sll t4, t1
+ add t4, t3
+
+ sw zero, 0(t3)
+ li t5, -1
+ sw t5, 0(t4)
+ lw t6, 0(t3)
+
+ beq t5, t6, ddr_size
+ nop
+
+ bne t1, t2, check_alias
+ addi t1, 1
+
+ddr_speed:
+ li t1, 3
+ lw t2, PHY_BYTE_LANE_1_CLOCK_PAD_DISABLE(t0)
+ beqz t2, 1f
+ nop
+ li t1, 2
+1:
+ blt a3, t1, tRefi_update // If smaller than 1Gb device, keep tRRD same
+ nop
+
+ lw t1, DDR_CTL_TIM1_0(t0) // Load DDR_CTL_TIM1_0 register
+ move t2, t1
+ srl t2, 20
+ andi t2, 0xf
+ addi t2, 1 // Increment ttRRD by one (software work around for a bug)
+ sll t2, 20
+ li t3, 0xFF0FFFFF
+ and t1, t3 // Clear tRRD field
+ or t1, t2 // Insert the new tRRD value
+ sw t1, DDR_CTL_TIM1_0(t0) // Store DDR_CTL_TIM1_0 register
+ nop
+
+tRefi_update:
+ LOADREL(t2, dram_tRefi_table)
+
+ li t1, 0x4 // size of dram_tRefi_table entry
+ mult t1, a1
+ mflo t1 // dram_tRefi_table offset
+ add t2, t1
+
+ lw t1, 0x0(t2) // tRefi
+ sll t1, 8
+ sw t1, DDR_CTL_CLKS(t0)
+
+ LOADREL(t2, dram_tRFC_table)
+
+ li t1, 0x4 // size of dram_tRFC_table entry
+ mult t1, a1
+ mflo t1 // dram_tRefi_table offset
+ add t2, t1 // Calculate address in the row
+
+ li t1, 0xc // size of dram_tRFC_table row
+ mult t1, a3
+ mflo t1 // dram_tRefi_table offset
+ add t2, t1 // Calculate address in the column
+
+ lw t3, 0x0(t2) // Load tRFC value
+ andi t3, 0xFF // Mask tRFC to 8-bits
+ sll t3, 16 // Move it to bit location [23:16]
+
+ lw t1, DDR_CTL_TIM1_1(t0) // Load DDR_CTL_TIM1_1 register
+ li t2, 0xFF00FFFF
+ and t1, t1, t2 // Mask out tRFC Field
+ or t1, t3, t1 // insert new tRFC value
+ sw t1, DDR_CTL_TIM1_1(t0) // Write to TIM1_1 register
+
+ SETLEDS1('D','I','N','T')
+
+/***** UBUS align to MEMC *****/
+align_memc:
+
+/*** check MEMC clk ratio to set sampling freq *****/
+ li t2, MISC_BASE
+ lw t1, MISC_STRAP_BUS(t2)
+
+ srl t1, MISC_STRAP_BUS_MIPS_PLL_FVCO_SHIFT
+ andi t1, 0x1f // Mask out strap bits
+
+#if defined(_BCM96816_)
+ LOADREL(t2, periph_fix_table)
+ lw t2, 0(t2)
+ srl t2, t1
+ andi t2, 1
+ bne t2, zero, 2f
+#endif
+
+ LOADREL(t2, memc_ubus_ratio_table)
+
+ add t2, t1
+ lb t1, 0x00(t2)
+ sll t4,t1,28 // Update Sampling Period Field
+
+pi_ubus:
+ li t2, 4048
+ li t3, 1
+
+ sw zero, DDR_CTL_PI_GCF(t0)
+ li t1, 0x00001c0b // send feedback command every 11 cycles
+ or t1, t1, t4
+ sw t1, DDR_CTL_PI_UBUS_SMPL(t0)
+ ori t1, 0x80 // trigger stoke signal to latch in new counter value
+ sw t1, DDR_CTL_PI_UBUS_SMPL(t0)
+ li t1, 0x00040000 // send new phase value to PLL every 5 cycles
+ sw t1, DDR_CTL_PI_UBUS_CTL(t0)
+ li t1, 0x00000001 // enable enable counter that change PLL phase
+ sw t1, DDR_CTL_PI_GCF(t0)
+ nop
+
+#if defined (_BCM96328_) || defined(_BCM96362_)
+// Enable PHY MIPS PI
+ li t1, 0x00130000
+ sw t1, DDR_CTL_PI_DSL_MIPS_CTL(t0)
+ nop
+#endif
+
+1:
+ lw t4, DDR_CTL_PI_UBUS_SMPL(t0) // Read a sample value.
+ srl t4, 16 // The sample is in the upper 16 bits.
+
+ andi t4, t4, 0x22 // Look at the 2 outermost bits; if the LSB is 0 and the MSB is 1,
+ beq t4, 0x20, 2f // then there is an edge somewhere in the sample.
+ nop
+ lw t5, DDR_CTL_PI_UBUS_CTL(t0)
+ and t5, 0xffff0000
+ or t5, t3
+ or t5, (1<<14) // move phase in positive direction
+ sw t5, DDR_CTL_PI_UBUS_CTL(t0)
+ nop
+ lw t5, DDR_CTL_PI_UBUS_CTL(t0) // Delay before reading another sample.
+ add t3, 1
+ bne t2, t3, 1b
+ nop
+
+ SETLEDS1('U','A','S','Y')
+ SETLEDS1('L','A','S','Y')
+ SETLEDS1('M','A','S','Y')
+ b run_async // failed to set sync mode
+ nop
+
+2:
+/*** check MIPS clk ratio *****/
+ li t4, 0xff410010
+ li t2, MISC_BASE
+ lw t1, MISC_STRAP_BUS(t2)
+
+ srl t1, MISC_STRAP_BUS_MIPS_PLL_FVCO_SHIFT
+ andi t1, 0x1f // Mask out strap bits
+
+ b _mips_align_2_ubus // none of the above means it is either 1/1 or 2/1
+ nop
+
+
+_mips_align_2_ubus:
+
+/***** MIPS align to UBUS *****/
+ li t1, 0xff410000
+
+ li t2, 0x00040000 // update PLL phase value every 5 MC cycles
+ sw t2, DDR_CTL_PI_MIPS_CTL(t0)
+
+ li t2, 0xc0001c03 // force update on mclk_period
+ sw t2, 0x40(t1)
+ li t2, 0x80001c83
+ sw t2, 0x40(t1)
+
+ lw t2, DDR_CTL_PI_MIPS_CTL(t0) // add delay
+ li t3, 1
+
+1: lw t4, 0x40(t1) // Read a sample value.
+ srl t4, 16 // The sample is in the upper 16 bits.
+
+ andi t4, t4, 0x22 // Look at the 2 outermost bits, if the LSB is 0 and the MSB is 1,
+ beq t4, 0x20, 2f // then there is an edge somewhere in the sample.
+ nop
+ lw t5, DDR_CTL_PI_MIPS_CTL(t0)
+ and t5, 0xffff0000
+ or t5, t3
+ or t5, (1<<14) // move phase in positive direction
+ sw t5, DDR_CTL_PI_MIPS_CTL(t0)
+ nop
+ lw t5, DDR_CTL_PI_MIPS_CTL(t0) // Delay before reading another sample.
+ add t3, 1
+ bne t2, t3, 1b
+ nop
+
+ SETLEDS1('U','A','S','Y')
+ SETLEDS1('L','A','S','Y')
+ SETLEDS1('M','A','S','Y')
+ b run_async // failed to set sync mode
+ nop
+2:
+ // Success
+ lw t2, DDR_CTL_PI_MIPS_CTL(t0) // Turn on auto-PI mode.
+ or t2, (1 << 20) // PI_UBUS_CTL_Hw_Cntr_En = 1
+ sw t2, DDR_CTL_PI_MIPS_CTL(t0)
+
+ /**----- Enable DDR/UBUS and DDR/LMB sync mode ------------------**/
+ /*** only MIPS in sync mode for these strap options */
+
+ li t2, MISC_BASE
+ lw t1, MISC_STRAP_BUS(t2)
+
+ srl t1, MISC_STRAP_BUS_MIPS_PLL_FVCO_SHIFT
+ andi t1, 0x1f // Mask out strap bits
+
+ li t3, 0 // Used to keep MC/MIPS and MC/UBUS sync/async mode
+
+ LOADREL(t2, dram_sync_table)
+
+ lw t4, 0x0(t2) // Ubus Sync vector
+ lw t5, 0x4(t2) // Lmb Sync vector
+
+#if defined (_96816_)
+ move t4, t6
+#endif
+ lw t6, 0x8(t2) // Mips Sync vector
+
+ srl t4, t1 // Get the ubus sync flag
+ srl t5, t1 // Get the lmb sync flag
+ srl t6, t1 // Get the mips sync flag
+ andi t4, 1 // Mask out other bits
+ andi t5, 1 // Mask out other bits
+ andi t6, 1 // Mask out other bits
+
+ li t2, 1
+ bne t4, t2, ubus_async // 1f below. If ubus is not sync, lmb can't be in sync
+ nop // Go to ubus_async (1f)
+
+ // Ubus Sync Mode. Turn on Ubus Clock tracking
+ lw t2, DDR_CTL_PI_UBUS_CTL(t0) // Turn on auto-PI mode.
+ or t2, (1 << 20) // PI_UBUS_CTL_Hw_Cntr_En = 1
+ sw t2, DDR_CTL_PI_UBUS_CTL(t0)
+
+ // Is LMB Sync as well?
+ li t2, 1
+ beq t5, t2, memc_all_sync // If both ubus and lmb are sync, go to memc_all_sync
+ nop
+
+memc_ubus_sync:
+#if UBUS_SYNC_ENABLE
+// set MC/UBUS to SYNC
+ li t3, 0x4
+ SETLEDS1('L','A','S','Y')
+ SETLEDS1('U','S','Y','N')
+#else
+// set MC/UBUS to ASYNC
+ li t3, 0xc
+ SETLEDS1('L','A','S','Y')
+ SETLEDS1('U','A','S','Y')
+#endif
+
+ b update_sync_mode
+ nop
+
+memc_all_sync:
+#if LMB_SYNC_ENABLE
+// set MC/MIPS to SYNC
+ nop
+ SETLEDS1('L','S','Y','N')
+#else
+// set MC/MIPS to ASYNC
+ li t1, 0x4
+ or t3, t1
+ SETLEDS1('L','A','S','Y')
+#endif
+#if UBUS_SYNC_ENABLE
+// set MC/UBUS to SYNC
+ nop
+ SETLEDS1('U','S','Y','N')
+#else
+// set MC/UBUS to ASYNC
+ li t1, 0x8
+ or t3, t1
+ SETLEDS1('U','A','S','Y')
+#endif
+
+update_sync_mode:
+ li t1, MISC_BASE
+ sw t3, MISC_MEMC_CONTROL(t1)
+ b 2f
+ nop
+1:
+ubus_async:
+ SETLEDS1('L','A','S','Y')
+ SETLEDS1('U','A','S','Y')
+
+2:
+ // Can Mips run in sync mode? If not, skip all below
+ beq t6, zero, run_async
+ nop
+
+#if MIPS_SYNC_ENABLE
+ /**----- Clear MIPS Async mode bit ------------------------------**/
+ mfc0 t1, C0_BCM_CONFIG, 5
+ and t1, ~(0x1 << 28)
+ mtc0 t1, C0_BCM_CONFIG, 5
+
+ SETLEDS1('M','S','Y','N')
+#else
+ SETLEDS1('M','A','S','Y')
+#endif
+
+3:
+ /**----- Enable RAC and LMB -------------------------------------**/
+ li t0, MIPS_BASE
+ lw t2, MIPS_LMB_CR(t0)
+#if LMB_ENABLE
+ or t2, LMB_EN // Enable LMB
+ SETLEDS1('L','M','B','E')
+#else
+ SETLEDS1('L','M','B','D')
+#endif
+ sw t2, MIPS_LMB_CR(t0)
+
+ li t2, 0xFFF << RAC_UPB_SHFT // Enable prefetch for RAM address range up to 256MB
+ sw t2, MIPS_RAC_ARR(t0)
+
+ lw t2, MIPS_RAC_CR0(t0)
+ or t2, (RAC_C_INV | RAC_I | RAC_PF_I)
+ sw t2, MIPS_RAC_CR0(t0)
+
+ lw t2, MIPS_RAC_CR1(t0)
+ or t2, (RAC_C_INV | RAC_I | RAC_PF_I)
+ sw t2, MIPS_RAC_CR1(t0)
+
+run_async:
+ /**----- Enable branch prediction and non-blocking data cache ---**/
+ mfc0 t1, C0_BCM_CONFIG
+ and t1, ~CP0_BCM_CFG_BTHD
+ or t1, CP0_BCM_CFG_NBK
+ or t1, CP0_BCM_CFG_CLF
+ mtc0 t1, C0_BCM_CONFIG
+
+#if DDR_TEST
+#######################################
+# Run test on DRAM using Test Engine #
+#######################################
+#define BACKGND_MODE_DATA 0x0
+#define BACKGND_MODE_LFSR 0x400
+#define BACKGND_MODE_PRBS 0x800
+#define BACKGND_MODE_NOT_PRBS 0xc00
+#define BACKGND_MODE_PAT 0x1000
+#define BACKGND_MODE_NOT_PAT 0x1400
+
+#define VICT_MODE_PRBS 0
+#define VICT_MODE_NOT_PRBS 0x100
+#define VICT_MODE_PAT 0x200
+#define VICT_MODE_NOT_PAT 0x300
+
+#define VICT_ENABLE 0x8000
+#define VICT_SWEEP_ENABLE 0x10000
+#define VICT_COUNT 0x0
+
+#define PRBS_ORDER(x) ((x & 0x3) << 13)
+
+#define TEST_COUNT 0x1000
+#define TEST_ADDR 0x0
+#define TEST_ADDR_UPDT 0x1
+#define TEST_PATTERN0 0x5555
+#define TEST_PATTERN1 0xaaaa
+#define TEST_PATTERN (TEST_PATTERN1 << 16 | TEST_PATTERN0)
+
+#define TEST_ENABLE 0x1
+#define TEST_DONE 0x2
+#define TEST_ERROR 0x4
+#define TEST_WRITE 0x10
+#define TEST_READ 0x0
+
+#define BACKGND_DATA0 0xa5a5a5a5
+#define BACKGND_DATA1 0x5a5a5a5a
+#define BACKGND_DATA2 0xa5a5a5a5
+#define BACKGND_DATA3 0x5a5a5a5a
+
+#define TEST_DATA0 0x02468ace
+#define TEST_DATA1 0x13579bdf
+#define TEST_DATA2 0x33cccc33
+#define TEST_DATA3 0x55aaaa55
+
+/***** Load DDR Base *************************************/
+ li t0, DDR_BASE
+ li t1, BACKGND_DATA0
+ sw t1, DDR_CTL_TEST_DATA0(t0)
+ li t1, BACKGND_DATA1
+ sw t1, DDR_CTL_TEST_DATA1(t0)
+ li t1, BACKGND_DATA2
+ sw t1, DDR_CTL_TEST_DATA2(t0)
+ li t1, BACKGND_DATA3
+ sw t1, DDR_CTL_TEST_DATA3(t0)
+ li t1, TEST_COUNT
+ li t2, VICT_COUNT
+ or t1, t2 # add victim count value
+ sw t1, DDR_CTL_TEST_COUNT(t0)
+ li t1, TEST_ADDR
+ sw t1, DDR_CTL_TEST_ADDR(t0)
+ li t1, TEST_ADDR_UPDT
+ sw t1, DDR_CTL_TEST_ADDR_UPDT(t0)
+ li t1, TEST_PATTERN
+ sw t1, DDR_CTL_TEST_PAT(t0)
+
+# Write a background pattern first
+ li t1, BACKGND_MODE_DATA
+ li t2, TEST_WRITE
+ or t1, t2
+ li t2, TEST_ENABLE
+ or t1, t2
+ sw t1, DDR_CTL_TEST_CFG1(t0)
+
+ li t2, 0x2
+ li t3, MISC_BASE
+
+ li t5, 0x10000
+2: li t1, 0x100
+1: addiu t1, -1
+ bnez t1, 1b
+ nop
+
+ lw t4, MISC_MEMC_CONTROL(t3)
+ and t4, 0x2
+ beq t4, t2, backgnd_write_done
+ nop
+ addiu t5, -1
+ bnez t5, 2b
+ nop
+
+# Background write operation is finished
+
+backgnd_write_done:
+ li t1, TEST_DATA0
+ sw t1, DDR_CTL_TEST_DATA0(t0)
+ li t1, TEST_DATA1
+ sw t1, DDR_CTL_TEST_DATA1(t0)
+ li t1, TEST_DATA2
+ sw t1, DDR_CTL_TEST_DATA2(t0)
+ li t1, TEST_DATA3
+ sw t1, DDR_CTL_TEST_DATA3(t0)
+ li t1, TEST_COUNT
+ li t2, VICT_COUNT
+ or t1, t2 # add victim count value
+ sw t1, DDR_CTL_TEST_COUNT(t0)
+ li t1, TEST_ADDR
+ sw t1, DDR_CTL_TEST_ADDR(t0)
+ li t1, TEST_ADDR_UPDT
+ sw t1, DDR_CTL_TEST_ADDR_UPDT(t0)
+ li t1, TEST_PATTERN
+ sw t1, DDR_CTL_TEST_PAT(t0)
+
+# li t1, BACKGND_MODE_DATA
+# li t1, BACKGND_MODE_PAT
+# li t2, VICT_MODE_NOT_PAT
+ li t1, BACKGND_MODE_PRBS
+ li t2, VICT_MODE_NOT_PRBS
+
+ or t1, t2
+ li t2, VICT_ENABLE
+ or t1, t2
+ li t2, VICT_SWEEP_ENABLE
+ or t1, t2
+ li t2, PRBS_ORDER(0)
+ or t1, t2
+ li t2, TEST_WRITE
+ or t1, t2
+ li t2, TEST_ENABLE
+ or t1, t2
+ sw t1, DDR_CTL_TEST_CFG1(t0)
+
+ li t2, 0x2
+ li t3, MISC_BASE
+
+ li t5, 0x10000
+2: li t1, 0x100
+1: addiu t1, -1
+ bnez t1, 1b
+ nop
+
+ lw t4, MISC_MEMC_CONTROL(t3)
+ and t4, 0x2
+ beq t4, t2, test_write_done
+ nop
+ addiu t5, -1
+ bnez t5, 2b
+ nop
+
+# Test write operation is finished
+
+test_write_done:
+ li t1, TEST_DATA0
+ sw t1, DDR_CTL_TEST_DATA0(t0)
+ li t1, TEST_DATA1
+ sw t1, DDR_CTL_TEST_DATA1(t0)
+ li t1, TEST_DATA2
+ sw t1, DDR_CTL_TEST_DATA2(t0)
+ li t1, TEST_DATA3
+ sw t1, DDR_CTL_TEST_DATA3(t0)
+ li t1, TEST_COUNT
+ li t2, VICT_COUNT
+ or t1, t2 # add victim count value
+ sw t1, DDR_CTL_TEST_COUNT(t0)
+ li t1, TEST_ADDR
+ sw t1, DDR_CTL_TEST_ADDR(t0)
+ li t1, TEST_ADDR_UPDT
+ sw t1, DDR_CTL_TEST_ADDR_UPDT(t0)
+ li t1, TEST_PATTERN
+ sw t1, DDR_CTL_TEST_PAT(t0)
+
+# li t1, BACKGND_MODE_DATA
+# li t1, BACKGND_MODE_PAT
+# li t2, VICT_MODE_NOT_PAT
+ li t1, BACKGND_MODE_PRBS
+ li t2, VICT_MODE_NOT_PRBS
+
+ or t1, t2
+ li t2, VICT_ENABLE
+ or t1, t2
+ li t2, VICT_SWEEP_ENABLE
+ or t1, t2
+ li t2, PRBS_ORDER(0)
+ or t1, t2
+ li t2, TEST_READ
+ or t1, t2
+ li t2, TEST_ENABLE
+ or t1, t2
+ sw t1, DDR_CTL_TEST_CFG1(t0)
+
+ li t3, MISC_BASE
+ li t2, 0x2
+
+ li t5, 0x10000
+2: li t1, 0x100
+1: addiu t1, -1
+ bnez t1, 1b
+ nop
+
+ lw t4, MISC_MEMC_CONTROL(t3)
+ and t4, 0x2
+ beq t4, t2, test_read_done
+ nop
+ addiu t5, -1
+ bnez t5, 2b
+ nop
+
+# Test read operation is finished
+
+test_read_done:
+ lw t1, DDR_CTL_TEST_CFG1(t0)
+ srl t1, 2
+ and t1, 1
+ beq t1, zero, test_passed
+ nop
+
+test_failed:
+ SETLEDS1('F','A','I','L')
+ b 1f
+ nop
+test_passed:
+ SETLEDS1('P','A','S','S')
+1:
+ SETLEDS1('-','-','-', '-')
+#endif
+
+ move ra,s0
+ j ra
+ nop
+
+ .set reorder
+
+END(board_draminit)
+
+/* *********************************************************************
+ * BOARD_SETLEDS(x)
+ *
+ * Set LEDs for boot-time progress indication. Not used if
+ * the board does not have progress LEDs. This routine
+ * must not call any other routines, since it may be invoked
+ * either from KSEG0 or KSEG1 and it may be invoked
+ * whether or not the icache is operational.
+ *
+ * Input parameters:
+ * a0 - LED value (8 bits per character, 4 characters)
+ *
+ * Return value:
+ * nothing
+ *
+ * Registers used:
+ * t7,t8,t9
+ ********************************************************************* */
+LEAF(board_setleds)
+#if 1
+ li t7, UART_BASE
+ li t8, TXFIFOEMT
+
+1: lh t9, UART0INTSTAT(t7)
+ and t9, t8
+ bne t9, t8, 1b
+
+ srl t8, a0, 24
+ sb t8, UART0DATA(t7)
+ srl t8, a0, 16
+ sb t8, UART0DATA(t7)
+ srl t8, a0, 8
+ sb t8, UART0DATA(t7)
+ sb a0, UART0DATA(t7)
+ li a0, '\r'
+ sb a0, UART0DATA(t7)
+ li a0, '\n'
+ sb a0, UART0DATA(t7)
+#endif
+ j ra
+END(board_setleds)
+
+/* *********************************************************************
+ * BCMCORE_TP1_SWITCH()
+ *
+ * Check if the thread switch is required. If we are already
+ * running on thread 1 this function will do nothing and just return
+ * If we are running on thread 0 this function will take thread 1
+ * out of reset and put thread 0 to sleep waiting for singnal from
+ * thread 1.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+LEAF(bcmcore_tp1_switch)
+
+#if defined(_BCM96328_)
+ li t1, OTP_BASE
+ addi t1, OTP_USER_BITS
+ addi t1, 0xc - ((OTP_TP1_DISABLE_BIT / 8) & ~3)
+ lw t0, 0(t1)
+ andi t0, 1 << (OTP_TP1_DISABLE_BIT % 32)
+ beqz t0, 1f
+ j ra
+1:
+#endif
+ mfc0 t1, C0_BCM_CONFIG, 3
+ li t2, CP0_CMT_TPID
+ and t1, t2
+ bnez t1, tp1 # Already running on thread 1
+
+# Start TP1
+# Set boot address for TP1
+ li t1, MIPS_BASE
+ li t2, 0x98000000 | ENABLE_ALT_BV
+ sw t2, MIPS_TP1_ALT_BV(t1)
+
+# Set a flag so we can wait for TP1 to catch up
+ li t1, 0x0
+ mtc0 t1, $31 # CO_DESAVE
+
+# Take TP1 out of reset
+ mfc0 t1, C0_BCM_CONFIG, 2
+ or t1, CP0_CMT_RSTSE
+ mtc0 t1, C0_BCM_CONFIG, 2
+
+ /* wait until second thread catches up with the first */
+waittp1:
+ mfc0 t0, $31 # CO_DESAVE
+ beqz t0, waittp1
+
+ li t0, THREAD_NUM_ADDRESS
+ FIXUP(t0)
+ lw t0, 0(t0)
+ li t1, 1
+ bne t0, t1, return # Linux will run on TP0, continue running bootloader
+
+# Voice will run on TP0. Set it up and put it to sleep
+
+ # enable interrupts and enable SW IRQ 0
+ li t0, M_SR_IE | M_SR_IBIT1
+ mtc0 t0, C0_SR
+
+ # Set up to use alternate exception vector 0x80000200
+ li t0, M_CAUSE_IV
+ mtc0 t0, C0_CAUSE
+
+ mfc0 t1, C0_BCM_CONFIG, 1
+ # set all ints except IRQ1 to TP1 and cross over SW IRQ 0
+ or t1, (CP0_CMT_XIR_4 | CP0_CMT_XIR_3 | CP0_CMT_XIR_2 | CP0_CMT_XIR_0 | CP0_CMT_SIR_0 | CP0_CMT_NMIR_TP1)
+ mtc0 t1, C0_BCM_CONFIG, 1
+
+ mfc0 t1, C0_BCM_CONFIG, 2
+ # Set debug on TP1, give priority to TP0, and
+ # set TLB exception serialization to ignore SCNT value in CP0 reg22 sel 4
+ and t1, ~CP0_CMT_TPS_MASK;
+ or t1, (CP0_CMT_DSU_TP1 | CP0_CMT_PRIO_TP0 | (1 << CP0_CMT_TPS_SHFT))
+ mtc0 t1, C0_BCM_CONFIG, 2
+
+ # Enable Data RAC on TP0
+ li t1, MIPS_BASE
+ lw t2, MIPS_RAC_CR0(t1)
+ or t2, (RAC_D | RAC_PF_D)
+ sw t2, MIPS_RAC_CR0(t1)
+
+2:
+ b wait_for_wake
+
+tp1:
+# Running on TP1....
+# First signal to TP0 that TP1 is up
+ li t1, 0x1
+ mtc0 t1, $31 # CO_DESAVE
+
+ li t0, THREAD_NUM_ADDRESS
+ FIXUP(t0)
+ lw t0, 0(t0)
+ li t1, 1
+ beq t0, t1, return # Linux will run on TP1, continue running bootloader
+
+# Voice will run on TP1. Set it up and put it to sleep
+
+ # enable interrupts and enable SW IRQ 0
+ li t0, M_SR_IE | M_SR_IBIT1
+ mtc0 t0, C0_SR
+
+ # Set up to use alternate exception vector 0x80000200
+ li t0, M_CAUSE_IV
+ mtc0 t0, C0_CAUSE
+
+ mfc0 t1, C0_BCM_CONFIG, 1
+ # set IRQ1 to TP1 and cross over SW IRQ 0
+ or t1, (CP0_CMT_XIR_1 | CP0_CMT_SIR_0 | CP0_CMT_NMIR_TP0)
+ mtc0 t1, C0_BCM_CONFIG, 1
+
+ mfc0 t1, C0_BCM_CONFIG, 2
+ # Set debug on TP0, give priority to TP1, and
+ # set TLB exception serialization to ignore SCNT value in CP0 reg22 sel 4
+ and t1, ~CP0_CMT_TPS_MASK;
+ or t1, (CP0_CMT_PRIO_TP1 | (1 << CP0_CMT_TPS_SHFT))
+ mtc0 t1, C0_BCM_CONFIG, 2
+
+ # Enable Data RAC on TP1
+ li t1, MIPS_BASE
+ lw t2, MIPS_RAC_CR1(t1)
+ or t2, (RAC_D | RAC_PF_D)
+ sw t2, MIPS_RAC_CR1(t1)
+ b 2b
+
+return:
+ j ra
+
+END(bcmcore_tp1_switch)
+
+# align this code to cache line. NAND flash is not memory mapped after system boots
+# so when we are signaling to the second TP to wake we need
+# jal instruction to be in cache
+ .align 4
+LEAF(wait_for_wake)
+ sync
+ wait # wait for interrupt
+ jal t8 # jump to entry point
+END(wait_for_wake)
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_rom/src/bcm63xx_main.c b/cfe/cfe/arch/mips/board/bcm63xx_rom/src/bcm63xx_main.c
new file mode 100755
index 0000000..201d6d8
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_rom/src/bcm63xx_main.c
@@ -0,0 +1,649 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Main Module File: bcm63xxBoot_main.c
+ *
+ * This module contains the main "C" routine for CFE bootstrap loader
+ * and decompressor to decompress the real CFE to ram and jump over.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ * Revised: seanl
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "cfe_timer.h"
+
+#include "env_subr.h"
+#include "ui_command.h"
+#include "cfe_mem.h"
+#include "cfe.h"
+
+#include "bsp_config.h"
+#include "bcm_hwdefs.h"
+#include "bcm_map.h"
+
+#include "exception.h"
+
+#include "segtable.h"
+
+#include "initdata.h"
+
+#if defined(_BCM96368_) || defined(_BCM96362_) || defined(_BCM96328_) || defined(_BCM96816_)
+#include "flash_api.h"
+#include "jffs2.h"
+#endif
+
+#if CFG_PCI
+#include "pcivar.h"
+#endif
+
+
+
+int cfe_size_ram(void);
+inline static int is_aliased(int max_bits) __attribute__((always_inline));
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#ifndef CFG_STACK_SIZE
+#define STACK_SIZE 8192
+#else
+#define STACK_SIZE ((CFG_STACK_SIZE+1023) & ~1023)
+#endif
+
+inline static int is_aliased(int max_bits)
+{
+ volatile uint32 *mem_base;
+ volatile uint32 *test_ptr;
+ uint32 tmp;
+ int bit;
+ int res = 0;
+
+ mem_base = (uint32*)DRAM_BASE_NOCACHE;
+
+ *mem_base = 0;
+
+ for (bit = 8; bit < max_bits; bit++) {
+ test_ptr = (uint32*)((uint32)mem_base | 1 << bit);
+ /* ram may contain useful data, save location before modifying */
+ tmp = *test_ptr;
+ *test_ptr = -1;
+ if (*mem_base == *test_ptr) {
+ *test_ptr = tmp;
+ res = 1;
+ break;
+ }
+ *test_ptr = tmp;
+ }
+ return res;
+}
+
+#define MEMC_MAX_ROWS 14
+
+int cfe_size_ram(void)
+{
+#if !(defined(_BCM96328_) || defined (_BCM96362_) || defined(_BCM96816_))
+ uint32 col_bits, row_bits, bus_bits, bank_bits;
+ uint32 size;
+
+ /* Bus width is configured during early boot */
+ if (((MEMC->Config & MEMC_WIDTH_MASK) >> MEMC_WIDTH_SHFT) == MEMC_32BIT_BUS)
+ bus_bits = 2;
+ else
+ bus_bits = 1;
+
+ bank_bits = 2;
+ /* Start from setting to the lowest possible configuration */
+ col_bits = 8;
+ row_bits = 11;
+
+ MEMC->Config &= ~MEMC_COL_MASK;
+ MEMC->Config |= ((col_bits - 8) << MEMC_COL_SHFT);
+
+ MEMC->Config &= ~MEMC_ROW_MASK;
+ MEMC->Config |= ((row_bits - 11) << MEMC_ROW_SHFT);
+
+ /* Determine number of rows */
+ for (row_bits = 12; row_bits <= MEMC_MAX_ROWS; row_bits++) {
+ MEMC->Config &= ~MEMC_ROW_MASK;
+ MEMC->Config |= ((row_bits - 11) << MEMC_ROW_SHFT);
+ /* check if this address bit is valid */
+ if (is_aliased (col_bits + row_bits + bus_bits + bank_bits))
+ break;
+ }
+ row_bits -= 1;
+ MEMC->Config &= ~MEMC_ROW_MASK;
+ MEMC->Config |= ((row_bits - 11) << MEMC_ROW_SHFT);
+
+ /* Determine number of columns */
+ for (col_bits = 9; col_bits <= 11; col_bits++) {
+ MEMC->Config &= ~MEMC_COL_MASK;
+ MEMC->Config |= ((col_bits - 8) << MEMC_COL_SHFT);
+ /* check if this address bit is valid */
+ if (is_aliased (col_bits + row_bits + bus_bits + bank_bits))
+ break;
+ }
+ col_bits -= 1;
+ MEMC->Config &= ~MEMC_COL_MASK;
+ MEMC->Config |= ((col_bits - 8) << MEMC_COL_SHFT);
+
+ /* Compute memory size in MB */
+ size = 1 << (bus_bits + col_bits + row_bits + bank_bits - 20);
+
+ return size;
+#else
+ return (DDR->CSEND << 24);
+#endif
+}
+
+// fake functions for not to modifying init_mips.S
+void _exc_entry(void);
+void cfe_command_restart(void);
+void cfe_doxreq(void);
+
+void _exc_entry(void)
+{
+}
+
+void cfe_command_restart(void)
+{
+}
+void cfe_doxreq(void)
+{
+}
+
+/* *********************************************************************
+ * Externs
+ ********************************************************************* */
+
+void cfe_main(int,int);
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+void cfe_ledstr(const char *leds)
+{
+}
+
+#if !defined(CONFIG_BRCM_IKOS)
+extern void _binArrayStart(void);
+extern void _binArrayEnd(void);
+extern int decompressLZMA(unsigned char *in, unsigned insize, unsigned char *out, unsigned outsize);
+
+#if (INC_NAND_FLASH_DRIVER==1) || (INC_SPI_PROG_NAND==1)
+#define je16_to_cpu(x) ((x).v16)
+#define je32_to_cpu(x) ((x).v32)
+extern void rom_nand_flash_init(void);
+extern int nand_flash_get_sector_size(unsigned short sector);
+extern int nand_flash_get_numsectors(void);
+extern int nand_flash_read_buf(unsigned short blk, int offset,
+ unsigned char *buffer, int len);
+extern void board_setleds(unsigned long);
+
+void *lib_memcpy(void *dest,const void *src,size_t cnt)
+{
+ unsigned char *d;
+ const unsigned char *s;
+
+ d = (unsigned char *) dest;
+ s = (const unsigned char *) src;
+
+ while (cnt) {
+ *d++ = *s++;
+ cnt--;
+ }
+
+ return dest;
+}
+
+int lib_memcmp(const void *dest,const void *src,size_t cnt)
+{
+ const unsigned char *d;
+ const unsigned char *s;
+
+ d = (const unsigned char *) dest;
+ s = (const unsigned char *) src;
+
+ while (cnt) {
+ if (*d < *s) return -1;
+ if (*d > *s) return 1;
+ d++; s++; cnt--;
+ }
+
+ return 0;
+}
+
+#if (INC_NAND_FLASH_DRIVER==1)
+/* Find uncompressed file cferam.bin on the JFFS2 file system, load it into
+ * memory and jump to its entry point function.
+ */
+char g_fname[] = NAND_CFE_RAM_NAME;
+int g_fname_actual_len = sizeof(g_fname) - 1;
+int g_fname_cmp_len = sizeof(g_fname) - 4; /* last three are digits */
+static void bootImageFromNand(void)
+{
+ const unsigned long bv_invalid = 0xfffffff;
+ const int max_not_jffs2 = 10;
+
+ struct rootfs_info
+ {
+ int rootfs;
+ int start_blk;
+ int end_blk;
+ unsigned long boot_val;
+ unsigned long ino;
+ } rfs_info[2], *prfs_info[2], *rfsi;
+
+ unsigned char *buf = (unsigned char *) mem_heapstart;
+ unsigned long version = 0;
+ struct jffs2_raw_dirent *pdir;
+ struct jffs2_raw_inode *pino;
+ unsigned char *p;
+ int i, j, k, done, not_jffs2;
+ int num_blks;
+ int len;
+ int boot_prev;
+ PNVRAM_DATA nd;
+ static int err0=0, err1=1;
+
+ rom_nand_flash_init();
+ num_blks = nand_flash_get_numsectors();
+ len = nand_flash_get_sector_size(0);
+ nd = (PNVRAM_DATA) (buf + len);
+
+ NAND->NandNandBootConfig = NBC_AUTO_DEV_ID_CFG | 0x101;
+ NAND->NandCsNandXor = 1;
+
+ memcpy((unsigned char *) nd, (unsigned char *)
+ FLASH_BASE + NVRAM_DATA_OFFSET, sizeof(NVRAM_DATA));
+
+ NAND->NandNandBootConfig = NBC_AUTO_DEV_ID_CFG | 0x2;
+ NAND->NandCsNandXor = 0;
+
+ /* Look at config to determine whether to boot current or previous image.*/
+ for( i = 0, p = (unsigned char *) nd->szBootline, boot_prev = 0;
+ i < NVRAM_BOOTLINE_LEN; i++, p++ )
+ {
+ if( p[0] == ' ' && p[1] == 'p' && p[2] == '=' )
+ {
+ boot_prev = p[3] - '0';
+ if( boot_prev != 0 && boot_prev != 1 )
+ boot_prev = '0';
+ break;
+ }
+ }
+
+ /* Find the CFE ram inode entry point for both root file systems. */
+ board_setleds((boot_prev == 0) ? 0x4e414e30 : 0x4e414e31);
+ for( k = 0, rfsi = rfs_info; k < 2; k++, rfsi++ )
+ {
+ version = 0;
+ not_jffs2 = 0;
+ rfsi->rootfs = k + NP_ROOTFS_1;
+ rfsi->boot_val = bv_invalid;
+ if( nd->ulNandPartOfsKb[rfsi->rootfs] > 0 &&
+ nd->ulNandPartOfsKb[rfsi->rootfs] < ((num_blks * len) / 1024))
+ {
+ rfsi->start_blk = nd->ulNandPartOfsKb[rfsi->rootfs] / (len/1024);
+ rfsi->end_blk = rfsi->start_blk +
+ (nd->ulNandPartSizeKb[rfsi->rootfs] / (len / 1024));
+ }
+ else
+ rfsi->start_blk = rfsi->end_blk = 0;
+
+ if( rfsi->start_blk == 0 || rfsi->start_blk >= rfsi->end_blk ||
+ rfsi->start_blk >= num_blks || rfsi->end_blk >= num_blks )
+ {
+ /* NVRAM_DATA fields for this rootfs are not valid. */
+ if( k == 0 )
+ {
+ /* Skip this rootfs. */
+ board_setleds(0x4e414e36);
+ continue;
+ }
+
+ if( rfs_info[0].boot_val == bv_invalid )
+ {
+ /* File system info cannot be found for either rootfs.
+ * NVRAM_DATA may not be set. Use default values.
+ */
+ board_setleds(0x4e414e37);
+ rfsi = rfs_info;
+ rfsi->start_blk = 1;
+ rfsi->end_blk = num_blks;
+ }
+ }
+
+ /* Find the directory entry. */
+ for( i = rfsi->start_blk, done = 0; i < rfsi->end_blk && done == 0; i++ )
+ {
+ /* This loop sequentially reads a NAND flash block into memory and
+ * processes it.
+ */
+ if( nand_flash_read_buf(i, 0, buf, len) > 0 )
+ {
+ /* This loop reads inodes in a block. */
+ p = buf;
+ while( p < buf + len )
+ {
+ pdir = (struct jffs2_raw_dirent *) p;
+ if( je16_to_cpu(pdir->magic) == JFFS2_MAGIC_BITMASK )
+ {
+ if( je16_to_cpu(pdir->nodetype) ==
+ JFFS2_NODETYPE_DIRENT &&
+ g_fname_actual_len == pdir->nsize &&
+ !memcmp(g_fname, pdir->name, g_fname_cmp_len) )
+ {
+ /* The desired directory was found. */
+ if( je32_to_cpu(pdir->version) > version )
+ {
+ if( (rfsi->ino = je32_to_cpu(pdir->ino)) != 0 )
+ {
+ unsigned char *fname =
+ pdir->name + g_fname_cmp_len;
+ rfsi->boot_val =
+ ((fname[0] - '0') * 100) +
+ ((fname[1] - '0') * 10) +
+ ((fname[2] - '0') * 1);
+ version = je32_to_cpu(pdir->version);
+
+ board_setleds(0x42540000 +
+ ((unsigned long) fname[1] << 8) +
+ (unsigned long) fname[2]);
+
+ /* Setting 'done = 1' assumes there is only
+ * one version of the directory entry. This
+ * may not be correct if the file is
+ * updated after it was initially flashed.
+ *
+ * TBD. Look for a higher version of the
+ * directory entry without searching the
+ * entire flash part.
+ */
+ done = 1;
+ break;
+ }
+ }
+ }
+
+ p += (je32_to_cpu(pdir->totlen) + 0x03) & ~0x03;
+ not_jffs2 = 0;
+ }
+ else
+ {
+ if( not_jffs2++ > max_not_jffs2 )
+ {
+ /* No JFFS2 magic bitmask for consecutive blocks.
+ * Assume this partion does not have a file system
+ * on it.
+ */
+ board_setleds(0x53544F50);
+ done = 1;
+ }
+ break;
+ }
+ }
+ }
+ else
+ {
+ if(!err0)
+ {
+ err0=1;
+ board_setleds(0x45525230);
+ }
+ }
+ }
+ board_setleds(0x4e414e39);
+ }
+
+ /* Set the rfs_info to the index to boot from. */
+ if( (boot_prev == 0 && rfs_info[0].boot_val > rfs_info[1].boot_val) ||
+ (boot_prev == 1 && rfs_info[0].boot_val < rfs_info[1].boot_val) ||
+ rfs_info[1].boot_val == bv_invalid )
+ {
+ /* Boot from the most recent image. */
+ prfs_info[0] = &rfs_info[0];
+ prfs_info[1] = &rfs_info[1];
+ }
+ else
+ {
+ /* Boot from the previous image. */
+ prfs_info[0] = &rfs_info[1];
+ prfs_info[1] = &rfs_info[0];
+ }
+
+ /* If the directory entry for the desired file, which is the CFE RAM image,
+ * is found, read it into memory and jump to its entry point function.
+ * This loop checks for CFE RAM image in two possible rootfs file sytems.
+ */
+ for( k = 0; k < 2; k++ )
+ {
+ unsigned char *pucDest = NULL;
+ unsigned char *pucEntry = NULL;
+ long isize = 0;
+
+ board_setleds(0x4e414e33);
+ rfsi = prfs_info[k];
+ if( rfsi->boot_val == bv_invalid )
+ continue;
+
+ /* When j == 0, get the first inode to find the entry point address.
+ * When j == 1, read the file contents into memory.
+ */
+ for( j = 0; j < 2; j++ )
+ {
+ /* This loop sequentially reads a NAND flash block into memory and
+ * processes it.
+ */
+ for(i = rfsi->start_blk, done = 0; i<rfsi->end_blk && done==0; i++)
+ {
+ if( nand_flash_read_buf(i, 0, buf, len) > 0 )
+ {
+ /* This loop reads inodes in a block. */
+ p = buf;
+ while( p < buf + len )
+ {
+ /* Verify the first short word is the JFFS2 magic
+ * number.
+ */
+ pino = (struct jffs2_raw_inode *) p;
+ if( je16_to_cpu(pino->magic) == JFFS2_MAGIC_BITMASK )
+ {
+ if( je16_to_cpu(pino->nodetype) ==
+ JFFS2_NODETYPE_INODE &&
+ je32_to_cpu(pino->ino) == rfsi->ino )
+ {
+ unsigned long size = je32_to_cpu(pino->dsize);
+ unsigned long ofs = je32_to_cpu(pino->offset);
+
+ if( size )
+ {
+ /* A node of the CFE RAM file was found
+ * with data. */
+ if( pucDest == NULL )
+ {
+ /* The entry point and copy destination
+ * addresses have not been obtained.
+ * If this is the first node of the CFE
+ * RAM file, obtain this information.
+ */
+ if( ofs == 0 )
+ {
+ /* The first 12 bytes contain a
+ * header. The first word is the
+ * entry point address.
+ */
+ pucEntry = (unsigned char *)
+ *(unsigned long *) pino->data;
+ pucDest = pucEntry - 12;
+ isize = je32_to_cpu(pino->isize);
+ done = 1;
+ board_setleds(0x52465330 |
+ rfsi->rootfs);
+ break;
+ }
+ }
+ else
+ {
+ /* Copy the image to memory. Stop when
+ * the entire image has been copied.
+ */
+ memcpy(pucDest+ofs, pino->data, size);
+ if( (isize -= size) <= 0 )
+ {
+ done = 1;
+ break;
+ }
+ }
+ }
+ }
+
+ /* Skip to the next inode entry. */
+ p += (je32_to_cpu(pino->totlen) + 0x03) & ~0x03;
+ }
+ else
+ break;
+ }
+ }
+ else
+ {
+ if(!err1)
+ {
+ err1=1;
+ board_setleds(0x45525231);
+ }
+ }
+ }
+ }
+
+ if( pucEntry && isize <= 0 )
+ {
+ board_setleds(0x4e414e35);
+
+ /* Save the rootfs partition that the CFE RAM image boots from
+ * at the memory location before the CFE RAM load address. The
+ * CFE RAM image uses this value to determine the partition to
+ * flash a new rootfs to.
+ */
+ *(pucEntry - 1) = (unsigned char) rfsi->rootfs;
+
+ cfe_launch((unsigned long) pucEntry); // never return...
+ }
+ board_setleds(0x4e414e38);
+ }
+
+ /* Error occurred. */
+ board_setleds(0x44494530);
+ while(1);
+}
+#endif
+#endif
+
+/* *********************************************************************
+ * cfe_main(a,b)
+ *
+ * It's gotta start somewhere.
+ * Input parameters:
+ * a,b - not used
+ *
+ * Return value:
+ * does not return
+ ********************************************************************* */
+
+void cfe_main(int a,int b)
+{
+ unsigned char *pucSrc;
+ unsigned char *pucDst;
+ unsigned int *entryPoint;
+ unsigned int binArrayStart = (unsigned int) _binArrayStart;
+ unsigned int binArrayEnd = (unsigned int) _binArrayEnd;
+ unsigned int dataLen = binArrayEnd - binArrayStart - 4;
+ int ret;
+
+ KMEMINIT((unsigned char *) (uint32_t) mem_heapstart,
+ ((CFG_HEAP_SIZE)*1024));
+
+#if (INC_NAND_FLASH_DRIVER==1) && (defined(_BCM96816_) || defined(_BCM96362_) || defined(_BCM96328_))
+ if( ((MISC->miscStrapBus & MISC_STRAP_BUS_BOOT_SEL_MASK) >>
+ MISC_STRAP_BUS_BOOT_SEL_SHIFT) == MISC_STRAP_BUS_BOOT_NAND )
+ {
+ bootImageFromNand(); /* Will not return. */
+ }
+#elif (INC_NAND_FLASH_DRIVER==1) && defined(_BCM96368_)
+ if( ((GPIO->StrapBus & MISC_STRAP_BUS_BOOT_SEL_MASK) >>
+ MISC_STRAP_BUS_BOOT_SEL_SHIFT) == MISC_STRAP_BUS_BOOT_NAND )
+ {
+ bootImageFromNand(); /* Will not return. */
+ }
+#endif
+
+ entryPoint = (unsigned int*) binArrayStart;
+ pucSrc = (unsigned char *) (binArrayStart + 4);
+
+ pucDst = (unsigned char *) *entryPoint;
+ ret = decompressLZMA((unsigned char*)pucSrc,
+ (unsigned int)dataLen,
+ (unsigned char *) pucDst,
+ 23*1024*1024);
+
+ if (ret != 0)
+ while (1); // if not decompressed ok, loop for EJTAG
+
+ cfe_launch((unsigned long) pucDst); // never return...
+}
+#else
+/* 0x694b6f31 (iKo1) is replaced with actual address during the build process.*/
+unsigned long cfeRamStartAddr=0x694b6f31;
+void cfe_main(int a,int b)
+{
+ cfe_size_ram();
+ cfe_launch(cfeRamStartAddr); // never return...
+}
+#endif
+
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_rom/src/memtest.c b/cfe/cfe/arch/mips/board/bcm63xx_rom/src/memtest.c
new file mode 100755
index 0000000..310fb40
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_rom/src/memtest.c
@@ -0,0 +1,1031 @@
+/*
+ *----------------------------------------------------------------------------*
+ * Collection of Memory Tests.
+ *----------------------------------------------------------------------------*
+ */
+
+//
+// NOTE: Blatant inlining ... (not sure whether caller supports EABI calls).
+// WARNING CFE: Must NOT use function calls !!!
+//
+#define _ALWAYS_INLINE_ __attribute__((always_inline))
+#define _INLINE_ inline static
+
+typedef enum memTestResult {
+ MEMTEST_FAILURE = 0,
+ MEMTEST_SUCCESS,
+ MEMTEST_ERROR,
+} MemTestResult_t;
+
+/* ------------------------------------------------------------------------- */
+
+#undef PATTERN
+#define PATTERN(x) PATTERN_##x,
+
+/*
+ * For each pattern listed, the inverse pattern is also automatically used.
+ * E.g. 0x55555555, the inverse of defined 0xAAAAAAAA is covered.
+ */
+typedef enum pattern {
+ PATTERN(0x00000000)
+ PATTERN(0xAAAAAAAA)
+ PATTERN(0xCCCCCCCC)
+ PATTERN(0x77777777)
+ PATTERN(0xF0F0F0F0)
+ PATTERN(0xFF00FF00)
+ PATTERN(0xFFFF0000)
+ PATTERN(0x01234567)
+ PATTERN(0x89ABCDEF)
+ PATTERN_MAX,
+} Pattern_t;
+
+#undef PATTERN
+#define PATTERN(x) x,
+const uint32_t pattern[] = {
+ PATTERN(0x00000000)
+ PATTERN(0xAAAAAAAA)
+ PATTERN(0xCCCCCCCC)
+ PATTERN(0x77777777)
+ PATTERN(0xF0F0F0F0)
+ PATTERN(0xFF00FF00)
+ PATTERN(0xFFFF0000)
+ PATTERN(0x01234567)
+ PATTERN(0x89ABCDEF)
+ PATTERN_MAX,
+};
+
+/* ------------------------------------------------------------------------- */
+
+#ifndef NBBY
+#define NBBY 8 /* FreeBSD style: Number Bits per BYte */
+#endif
+
+/* ------------------------------------------------------------------------- */
+
+#define NBITS(type) (sizeof(type) * NBBY)
+#define NBITVAL(nbits) (1 << (nbits))
+#define MAXBITVAL(nbits) ( NBITVAL(nbits) - 1)
+#define NBITMASK(nbits) MAXBITVAL(nbits)
+#define MAXNBVAL(nbyte) MAXBITVAL((nbyte) * NBBY)
+
+#define DIVBY(val32,by) ((val32)>>(by))
+#define MODBY(val32,by) ((val32) & ((1 <<(by)) - 1) )
+
+#define IS_POWEROF2(val32) ( (((val32)-1) & (val32)) == 0 )
+
+#define ROUNDDN(addr, align) ( (addr) & ~((align) - 1) )
+#define ROUNDUP(addr, align) ( ((addr) + (align) - 1) & ~((align) - 1) )
+//#define ROUNDUP(x,y) ((((x)+((y)-1))/(y))*(y))
+#define ALIGN_ADDR(addr, bytes) (void *)( ((uint32_t *)(addr) + (bytes) - 1) \
+ & ~((bytes) - 1) )
+#define IS_ALIGNED(addr, bytes) (((uint32_t)(addr) & ((bytes)-1)) == 0)
+
+#define OFFSET_OF(stype,member) ((uint32_t) &((struct stype *)0)->member)
+#define RELOC(base,stype,member) ((base) + OFFSET_OF(stype, member))
+
+#define RROTATE32(val32) (((val32) << 31) | ((val32) >> 1))
+#define LROTATE32(val32) (((val32) << 1) | ((val32) >> 31))
+
+/* ------------------------------------------------------------------------- */
+
+/* Aligned (32bit register) read/write access */
+#define RD16(addr16) (*(volatile uint32_t *)(addr16))
+#define WR16(addr16,val16) (*(volatile uint32_t *)(addr16))=(val16)
+#define RD32(addr32) (*(volatile uint32_t *)(addr32))
+#define WR32(addr32,val32) (*(volatile uint32_t *)(addr32))=(val32)
+
+/*---------------------------------------------------------------------------*/
+
+/* Forward declaration */
+_INLINE_ void fill_memory( uint32_t * addr, uint32_t bytes, uint32_t fill32)
+ _ALWAYS_INLINE_;
+_INLINE_ void fill_alt_memory(uint32_t * addr, uint32_t bytes,
+ uint32_t fillA32, uint32_t fillB32) _ALWAYS_INLINE_;
+
+void fill_memory( uint32_t * addr, uint32_t bytes, uint32_t fill32)
+{
+ uint32_t * at, * end_p;
+ uint32_t words;
+ words = bytes / sizeof(uint32_t);
+ if ( words == 0 ) return;
+
+ end_p = addr + words;
+ for ( at = addr; at < end_p; at++ )
+ WR32( at, fill32 );
+}
+
+void fill_alt_memory( uint32_t * addr, uint32_t bytes,
+ uint32_t fillA32, uint32_t fillB32)
+{
+ uint32_t * at, * end_p;
+ uint32_t words;
+ words = bytes / sizeof(uint32_t);
+ words = ROUNDDN( words, 2 );
+ if ( words == 0 ) return;
+
+ end_p = addr + words;
+ for ( at = addr; at < end_p; at+=2 )
+ {
+ WR32( at+0, fillA32 );
+ WR32( at+1, fillB32 );
+ }
+}
+
+/* Forward declaration */
+_INLINE_ MemTestResult_t scanWordValue( uint32_t * addr, uint32_t bytes,
+ uint32_t pat32 ) _ALWAYS_INLINE_;
+_INLINE_ MemTestResult_t scanBulkValue( uint32_t * addr, uint32_t bytes,
+ uint32_t pat32 ) _ALWAYS_INLINE_;
+_INLINE_ MemTestResult_t scanBulkAltInv( uint32_t * addr, uint32_t bytes,
+ uint32_t pat32 ) _ALWAYS_INLINE_;
+_INLINE_ MemTestResult_t scanWordSelf( uint32_t * addr, uint32_t bytes )
+ _ALWAYS_INLINE_;
+_INLINE_ MemTestResult_t scanBulkSelf( uint32_t * addr, uint32_t bytes )
+ _ALWAYS_INLINE_;
+_INLINE_ MemTestResult_t slidingAltInv( uint32_t * addr, uint32_t bytes,
+ uint32_t pat32 ) _ALWAYS_INLINE_;
+_INLINE_ MemTestResult_t slidingDiag( uint32_t * addr, uint32_t bytes,
+ uint32_t pat32 ) _ALWAYS_INLINE_;
+_INLINE_ MemTestResult_t memoryBulkCopy( uint32_t * saddr, uint32_t * daddr,
+ uint32_t bytes ) _ALWAYS_INLINE_;
+
+/*
+ *-----------------------------------------------------------------------------
+ * Function: scanWordValue
+ *
+ * Description:
+ * 4 Passes are conducted on the memory region.
+ * Pass 1. In INcreasing memory address, write a word with value and verify.
+ * Pass 2. In DEcreasing memory address, write a word with value and verify.
+ * Pass 3. In INcreasing memory address, write a word with INVERSE and verify.
+ * Pass 4. In DEcreasing memory address, write a word with INVERSE and verify.
+ * Pass 5. In INcreasing shifted memory address, write word with value verify.
+ * Pass 6. In INcreasing shifted memory address, write word with INVERSE verify.
+ *
+ * Parameters:
+ * addr: word aligned pointer to memory region
+ * bytes: size in bytes of memory region to test
+ * pat32: 32bit pattern, e.g. 0x0U, 0xAAAAAAAA, 0xFF00FF00, 0xFFFF0000,
+ * 0xF0F0F0F0, 0xC3C3C3C3, 0x87878787
+ *-----------------------------------------------------------------------------
+ */
+MemTestResult_t scanWordValue( uint32_t * addr, uint32_t bytes, uint32_t pat32 )
+{
+ volatile uint32_t * at, * end_p;
+ uint32_t expected, read, words;
+ uint32_t shift;
+
+ if ( ! IS_ALIGNED(addr,4) ) return MEMTEST_ERROR;
+
+ words = bytes / sizeof(uint32_t); /* in whole words (4byte multiple) */
+ if ( words == 0 )
+ return MEMTEST_ERROR;
+
+ expected = pat32; /* ORIGINAL value */
+
+ /* INCREASING traversal */
+ end_p = addr + words;
+ for ( at = addr; at < end_p; at++ )
+ {
+ WR32( at, expected );
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ /* DECREASING traversal */
+ end_p = addr;
+ for ( at = addr + words - 1; at >= end_p; at-- )
+ {
+ WR32( at, expected );
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ expected = ~pat32; /* INVERSE value */
+
+ /* INCREASING traversal */
+ end_p = addr + words;
+ for ( at = addr; at < end_p; at++ )
+ {
+ WR32( at, expected );
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ /* DECREASING traversal */
+ end_p = addr;
+ for ( at = addr + words - 1; at >= end_p; at-- )
+ {
+ WR32( at, expected );
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ /* PASS 5: Shifting address walk, ORIGINAL */
+ expected = pat32; /* ORIGINAL value */
+
+ end_p = addr + words;
+ shift = sizeof(uint32_t);
+ for ( at = addr + shift; at < end_p; shift <<= 1, at = addr + shift )
+ {
+ WR32( at, expected );
+ WR32( addr, ~expected ); /* noise at base addr */
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ expected = ~pat32; /* INVERSE value */
+
+ /* PASS 6: Shifting address walk, INVERSE */
+ end_p = addr + words;
+ shift = sizeof(uint32_t);
+ for ( at = addr + shift; at < end_p; shift <<= 1, at = addr + shift )
+ {
+ WR32( at, expected );
+ WR32( addr, ~expected ); /* noise at base addr */
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ return MEMTEST_SUCCESS;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Function: scanBulkValue
+ *
+ * Description:
+ * Pass 1. Fill entire memory in INcreasing memory address with value
+ * then in INcreasing memory address read and verify.
+ * Pass 2. Fill entire memory in DEcreasing memory address with value
+ * then in DEcreasing memory address read and verify.
+ * Pass 3. Fill entire memory in INcreasing memory address with inverse value
+ * then in INcreasing memory address read and verify.
+ * Pass 4. Fill entire memory in DEcreasing memory address with inverse value
+ * then in DEcreasing memory address read and verify.
+ * Pass 5. INcreasing shifted, ORIGINAL
+ * Pass 6. INcreasing shifted, INVERSE
+ *
+ * Parameters:
+ * addr: word aligned pointer to memory region
+ * bytes: size in bytes of memory region to test
+ * pat32: 32bit pattern, e.g. 0x0U, 0xAAAAAAAA, 0xFF00FF00, 0xFFFF0000,
+ * 0xF0F0F0F0, 0xC3C3C3C3, 0x87878787
+ *-----------------------------------------------------------------------------
+ */
+MemTestResult_t scanBulkValue( uint32_t * addr, uint32_t bytes, uint32_t pat32 )
+{
+ volatile uint32_t * at, * end_p;
+ uint32_t expected, read, words;
+ uint32_t shift;
+
+ if ( ! IS_ALIGNED(addr,4) ) return MEMTEST_ERROR;
+
+ words = bytes / sizeof(uint32_t); /* in whole words (4byte multiple) */
+ if ( words == 0 ) return MEMTEST_ERROR;
+
+ expected = pat32; /* ORIGINAL value */
+
+ /* INCREASING traversal */
+ end_p = addr + words;
+ for ( at = addr; at < end_p; at++ )
+ {
+ WR32( at, expected );
+ }
+ for ( at = addr; at < end_p; at++ )
+ {
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ /* DECREASING traversal */
+ end_p = addr;
+ for ( at = addr + words - 1; at >= end_p; at-- )
+ {
+ WR32( at, expected );
+ }
+ for ( at = addr + words - 1; at >= end_p; at-- )
+ {
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ expected = ~pat32; /* INVERSE value */
+
+ /* INCREASING traversal */
+ end_p = addr + words;
+ for ( at = addr; at < end_p; at++ )
+ {
+ WR32( at, expected );
+ }
+ for ( at = addr; at < end_p; at++ )
+ {
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ /* DECREASING traversal */
+ end_p = addr;
+ for ( at = addr + words - 1; at >= end_p; at-- )
+ {
+ WR32( at, expected );
+ }
+ for ( at = addr + words - 1; at >= end_p; at-- )
+ {
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ /* Pass 5. INCREASING Shifted traversal */
+ expected = pat32; /* ORIGINAL value */
+ end_p = addr + words;
+ shift = sizeof(uint32_t);
+ for ( at = addr + shift; at < end_p; shift <<= 1, at = addr + shift )
+ {
+ WR32( at, expected );
+ WR32( addr, ~expected ); /* noise at base addr */
+ }
+ shift = sizeof(uint32_t);
+ for ( at = addr + shift; at < end_p; shift <<= 1, at = addr + shift )
+ {
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ expected = ~pat32; /* INVERSE value */
+ end_p = addr + words;
+ shift = sizeof(uint32_t);
+ for ( at = addr + shift; at < end_p; shift <<= 1, at = addr + shift )
+ {
+ WR32( at, expected );
+ WR32( addr, ~expected ); /* noise at base addr */
+ }
+ shift = sizeof(uint32_t);
+ for ( at = addr + shift; at < end_p; shift <<= 1, at = addr + shift )
+ {
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ return MEMTEST_SUCCESS;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Function: scanBulkAltInv
+ *
+ * Description:
+ * Pass 1. Fill entire memory in INcreasing memory address with alternating
+ * value, then in INcreasing memory address read and verify.
+ * Pass 2. Fill entire memory in DEcreasing memory address with alternating
+ * value, then in DEcreasing memory address read and verify.
+ * Pass 3. Same as one but with shifted address.
+ *
+ * Parameters:
+ * addr: word aligned pointer to memory region
+ * bytes: size in bytes of memory region to test
+ * pat32: 32bit pattern, e.g. 0x0U, 0xAAAAAAAA, 0xFF00FF00, 0xFFFF0000,
+ * 0xF0F0F0F0, 0xC3C3C3C3, 0x87878787
+ *-----------------------------------------------------------------------------
+ */
+MemTestResult_t scanBulkAltInv( uint32_t * addr, uint32_t bytes, uint32_t pat32 )
+{
+ volatile uint32_t * at, * end_p;
+ uint32_t read, words;
+ uint32_t shift;
+
+ if ( ! IS_ALIGNED(addr,4) ) return MEMTEST_ERROR;
+
+ words = bytes / sizeof(uint32_t); /* in whole words (4byte multiple) */
+ words = ROUNDDN( words, 2 );
+ if ( words == 0 ) return MEMTEST_ERROR;
+
+ /* INCREASING traversal */
+ end_p = addr + words;
+ for ( at = addr; at < end_p; at+=2 )
+ {
+ WR32( at+0, pat32 );
+ WR32( at+1, ~pat32 );
+ }
+ for ( at = addr; at < end_p; at+=2 )
+ {
+ read = RD32( at+0 );
+ if ( read != pat32 )
+ {
+ return MEMTEST_FAILURE;
+ }
+ read = RD32( at+1 );
+ if ( read != ~pat32 )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ /* DECREASING traversal */
+ end_p = addr;
+ for ( at = addr + words - 1; at >= end_p; at-=2 )
+ {
+ WR32( at+0, pat32 );
+ WR32( at+1, ~pat32 );
+ }
+ for ( at = addr + words - 1; at >= end_p; at-=2 )
+ {
+ read = RD32( at+0 );
+ if ( read != pat32 )
+ {
+ return MEMTEST_FAILURE;
+ }
+ read = RD32( at+1 );
+ if ( read != ~pat32 )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ /* INCREASING SHIFTED traversal */
+ end_p = addr + words;
+ shift = sizeof(uint32_t);
+ for ( at = addr + shift; at < end_p; shift <<= 1, at = addr + shift )
+ {
+ WR32( at+0, pat32 );
+ WR32( addr, 0 );
+ WR32( at+1, ~pat32 );
+ WR32( addr, 0 );
+ }
+ shift = sizeof(uint32_t);
+ for ( at = addr + shift; at < end_p; shift <<= 1, at = addr + shift )
+ {
+ read = RD32( at+0 );
+ if ( read != pat32 )
+ {
+ return MEMTEST_FAILURE;
+ }
+ read = RD32( at+1 );
+ if ( read != ~pat32 )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ return MEMTEST_SUCCESS;
+}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ * Function: scanWordSelf
+ *
+ * Description:
+ * 4 Passes are conducted on the memory region.
+ * Pass 1. In INcreasing memory address, write a word with selfaddr and verify.
+ * Pass 2. In DEcreasing memory address, write a word with INVERSE and verify.
+ * Pass 3. In INcreasing memory address, write a word with INVERSE and verify.
+ * Pass 4. In DEcreasing memory address, write a word with selfaddr and verify.
+ * Pass 5. value = ORIGINAL address, INCREASING SHIFTED traversal.
+ * Pass 6. value = INVERSE address, INCREASING SHIFTED traversal.
+ *
+ * In Pass 2 Read+Modify+Write, and in Pass 3, Read+Write is used
+ *
+ * Parameters:
+ * addr: word aligned pointer to memory region
+ * bytes: size in bytes of memory region to test
+ *
+ *-----------------------------------------------------------------------------
+ */
+MemTestResult_t scanWordSelf( uint32_t * addr, uint32_t bytes )
+{
+ volatile uint32_t * at, * end_p;
+ uint32_t expected, read, words;
+ uint32_t shift;
+
+ if ( ! IS_ALIGNED(addr,4) ) return MEMTEST_FAILURE;
+
+ words = bytes / sizeof(uint32_t); /* in whole words (4byte multiple) */
+ if ( words == 0 ) return MEMTEST_ERROR;
+
+ /* ORIGINAL value */
+
+ /* INCREASING traversal */
+ end_p = addr + words;
+ for ( at = addr; at < end_p; at++ )
+ {
+ expected = (uint32_t)at;
+ WR32( at, expected );
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ /* DECREASING traversal */
+ end_p = addr;
+ for ( at = addr + words - 1; at >= end_p; at-- )
+ {
+ expected = ~( (uint32_t)RD32(at) );
+ WR32( at, expected );
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ /* INCREASING traversal */
+ end_p = addr + words;
+ for ( at = addr; at < end_p; at++ )
+ {
+ expected = ((uint32_t)RD32(at));
+ WR32( at, expected );
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ /* DECREASING traversal */
+ end_p = addr;
+ for ( at = addr + words - 1; at >= end_p; at-- )
+ {
+ expected = ~((uint32_t)at);
+ WR32( at, expected );
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ /* value = ORIGINAL address, INCREASING SHIFTED traversal */
+ end_p = addr + words;
+ shift = sizeof(uint32_t);
+ for ( at = addr + shift; at < end_p; shift <<= 1, at = addr + shift )
+ {
+ expected = (uint32_t)at; /* Not read modify write */
+ WR32( at, expected );
+ WR32( addr, ~expected );
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ /* value = INVERSE address, INCREASING SHIFTED traversal */
+ end_p = addr + words;
+ shift = sizeof(uint32_t);
+ for ( at = addr + shift; at < end_p; shift <<= 1, at = addr + shift )
+ {
+ expected = ~(uint32_t)(at); /* Not read modify write */
+ WR32( at, expected );
+ WR32( addr, ~expected );
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ return MEMTEST_SUCCESS;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Function: scanBulkSelf
+ *
+ * Description:
+ * Pass 1. Fill entire memory in INcreasing memory address with self address
+ * then in INcreasing memory address read and verify.
+ * Pass 2. Fill entire memory in DEcreasing memory address with self address
+ * then in DEcreasing memory address read and verify.
+ * Pass 3. Fill entire memory in INcreasing memory address with inverse addr
+ * then in INcreasing memory address read and verify.
+ * Pass 4. Fill entire memory in DEcreasing memory address with inverse addr
+ * then in DEcreasing memory address read and verify.
+ * Pass 5. Same as Pass 1 but with shifted address
+ * Pass 6. Same as Pass 3 but with shifted address
+ *
+ * Parameters:
+ * addr: word aligned pointer to memory region
+ * bytes: size in bytes of memory region to test
+ *-----------------------------------------------------------------------------
+ */
+MemTestResult_t scanBulkSelf( uint32_t * addr, uint32_t bytes )
+{
+ volatile uint32_t * at, * end_p;
+ uint32_t read, words;
+ uint32_t shift;
+
+ if ( ! IS_ALIGNED(addr,4) ) return MEMTEST_ERROR;
+
+ words = bytes / sizeof(uint32_t); /* in whole words (4byte multiple) */
+ if ( words == 0 ) return MEMTEST_ERROR;
+
+ /* INCREASING traversal */
+ end_p = addr + words;
+ for ( at = addr; at < end_p; at++ )
+ {
+ WR32( at, (uint32_t)at );
+ }
+ for ( at = addr; at < end_p; at++ )
+ {
+ read = RD32(at);
+ if ( read != (uint32_t)at )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ /* DECREASING traversal */
+ end_p = addr;
+ for ( at = addr + words - 1; at >= end_p; at-- )
+ {
+ WR32( at, (uint32_t)at );
+ }
+ for ( at = addr + words - 1; at >= end_p; at-- )
+ {
+ read = RD32(at);
+ if ( read != (uint32_t)at )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ /* INCREASING traversal */
+ end_p = addr + words;
+ for ( at = addr; at < end_p; at++ )
+ {
+ WR32( at, ~((uint32_t)at) );
+ }
+ for ( at = addr; at < end_p; at++ )
+ {
+ read = RD32(at);
+ if ( read != ~((uint32_t)at) )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ /* DECREASING traversal */
+ end_p = addr;
+ for ( at = addr + words - 1; at >= end_p; at-- )
+ {
+ WR32( at, ~((uint32_t)at) );
+ }
+ for ( at = addr + words - 1; at >= end_p; at-- )
+ {
+ read = RD32(at);
+ if ( read != ~((uint32_t)at) )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ /* INCREASING traversal */
+ end_p = addr + words;
+ shift = sizeof(uint32_t);
+ for ( at = addr + shift; at < end_p; shift <<= 1, at = addr + shift )
+ {
+ WR32( at, (uint32_t)at );
+ WR32( addr, ~((uint32_t)at) );
+ }
+ shift = sizeof(uint32_t);
+ for ( at = addr + shift; at < end_p; shift <<= 1, at = addr + shift )
+ {
+ read = RD32(at);
+ if ( read != (uint32_t)at )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ /* INCREASING traversal */
+ end_p = addr + words;
+ shift = sizeof(uint32_t);
+ for ( at = addr + shift; at < end_p; shift <<= 1, at = addr + shift )
+ {
+ WR32( at, ~((uint32_t)at) );
+ WR32( addr, ((uint32_t)at) );
+ }
+ shift = sizeof(uint32_t);
+ for ( at = addr + shift; at < end_p; shift <<= 1, at = addr + shift )
+ {
+ read = RD32(at);
+ if ( read != ~((uint32_t)at) )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ return MEMTEST_SUCCESS;
+}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ * Function: slidingAltInv
+ *
+ * Description:
+ * This is the same as scanBulkAltInv, where in each invocation the value is
+ * rotated to the right. The starting value is usedefined.
+ *
+ * Parameters:
+ * addr: word aligned pointer to memory region
+ * bytes: size in bytes of memory region to test
+ * pat32: pattern to slide per pass
+ *-----------------------------------------------------------------------------
+ */
+MemTestResult_t slidingAltInv( uint32_t * addr, uint32_t bytes, uint32_t pat32 )
+{
+ uint32_t sliding_pat32, i;
+
+ if ( pat32 == 0x0 ) pat32 = 0x80000000;
+ if ( pat32 == ~0x0 ) pat32 = 0x7FFFFFFF;
+
+ sliding_pat32 = pat32;
+
+ for ( i=0; i<32; i++ )
+ {
+ if ( scanBulkAltInv( addr, bytes, sliding_pat32 )
+ == MEMTEST_FAILURE )
+ {
+ return MEMTEST_FAILURE;
+ }
+
+ sliding_pat32 = RROTATE32( sliding_pat32 );
+ }
+
+ sliding_pat32 = pat32;
+ for (i=0; i<32; i++)
+ {
+ if ( scanBulkAltInv( addr, bytes, sliding_pat32 )
+ == MEMTEST_FAILURE )
+ {
+ return MEMTEST_FAILURE;
+ }
+
+ sliding_pat32 = LROTATE32( sliding_pat32 );
+ }
+
+ return MEMTEST_SUCCESS;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Function: slidingDiag
+ *
+ * Description:
+ * Pass 1. Fill entire memory in INcreasing memory address with pattern right
+ * shifted. Then read in INcreasing order and verify.
+ * Pass 2. Fill entire memory in DEcreasing memory address with inverse of
+ * read value. Then read in DEcreasing order and verify.
+ * Pass 3. Fill entire memory in DEcreasing memory address with pattern right
+ * shifted. Then read in DEcreasing order and verify.
+ * Pass 4. Fill entire memory in INcreasing memory address with inverse of
+ * read value. Then read in INcreasing order and verify.
+ *
+ * Parameters:
+ * addr: word aligned pointer to memory region
+ * bytes: size in bytes of memory region to test
+ * pat32: pattern to be filled shifted each write
+ *-----------------------------------------------------------------------------
+ */
+MemTestResult_t slidingDiag( uint32_t * addr, uint32_t bytes, uint32_t pat32 )
+{
+ volatile uint32_t * at, * end_p;
+ uint32_t expected, read = 0, words, last;
+
+ if ( ! IS_ALIGNED(addr,4) ) return MEMTEST_ERROR;
+
+ words = bytes / sizeof(uint32_t); /* in whole words (4byte multiple) */
+ if ( words == 0 ) return MEMTEST_ERROR;
+
+
+ /* INCREASING traversal */
+ expected = pat32; /* ORIGINAL value */
+ end_p = addr + words;
+ for ( at = addr; at < end_p; at++ )
+ {
+ WR32( at, expected );
+ expected = RROTATE32( expected ); /* next expected */
+ }
+ expected = pat32; /* ORIGINAL value */
+ for ( at = addr; at < end_p; at++ )
+ {
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ expected = RROTATE32( expected ); /* next expected */
+ }
+
+ last = ~( read ); /* Starting value for decreasing traversal, next */
+
+ /* DECREASING traversal */
+ end_p = addr;
+ for ( at = addr + words - 1; at >= end_p; at-- )
+ {
+ expected = ~( RD32(at) );
+ WR32( at, expected );
+ }
+ expected = last;
+ for ( at = addr + words - 1; at >= end_p; at-- )
+ {
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ expected = LROTATE32( expected );
+ }
+
+ /* DECREASING traversal */
+ expected = pat32; /* ORIGINAL value */
+ end_p = addr;
+ for ( at = addr + words - 1; at >= end_p; at-- )
+ {
+ WR32( at, expected );
+ expected = RROTATE32( expected ); /* next expected */
+ }
+ expected = pat32; /* ORIGINAL value */
+ for ( at = addr + words - 1; at >= end_p; at-- )
+ {
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ expected = RROTATE32( expected ); /* next expected */
+ }
+
+ last = ~( read );
+
+ /* INCREASING traversal */
+ end_p = addr + words;
+ for ( at = addr; at < end_p; at++ )
+ {
+ expected = ~( RD32(at) );
+ WR32( at, expected );
+ }
+ expected = last;
+ for ( at = addr; at < end_p; at++ )
+ {
+ read = RD32(at);
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ expected = LROTATE32( expected );
+ }
+
+ return MEMTEST_SUCCESS;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Function: memoryBulkCopy
+ *
+ * Description:
+ * Pass 1. Copy entire ORIGINAL memory in INcreasing memory address, then verify
+ * Pass 2. Copy entire ORIGINAL memory in DEcreasing memory address, then verify
+ * Pass 3. Copy entire INVERSE memory in INcreasing memory address, then verify
+ * Pass 4. Copy entire INVERSE memory in DEcreasing memory address, then verify
+ *-----------------------------------------------------------------------------
+ */
+MemTestResult_t memoryBulkCopy( uint32_t * saddr, uint32_t * daddr,
+ uint32_t bytes )
+{
+ volatile uint32_t * src_p, * dst_p, * end_p;
+ uint32_t expected, read, words;
+
+ if ( ! IS_ALIGNED(saddr,4) ) return MEMTEST_ERROR;
+ if ( ! IS_ALIGNED(daddr,4) ) return MEMTEST_ERROR;
+
+ words = bytes / sizeof(uint32_t); /* in whole words (4byte multiple) */
+ if ( words == 0 ) return MEMTEST_ERROR;
+
+ if ( (uint32_t)saddr < (uint32_t)daddr )
+ {
+ if ( (uint32_t)(saddr + words) > (uint32_t)daddr )
+ return MEMTEST_ERROR;
+ }
+ else if ( (uint32_t)daddr < (uint32_t)saddr )
+ {
+ if ( (uint32_t)(daddr + words) > (uint32_t)saddr )
+ return MEMTEST_ERROR;
+ }
+
+ /* INCREASING traversal ORIGINAL */
+ end_p = saddr + words;
+ for ( src_p = saddr, dst_p = daddr; src_p < end_p; src_p++, dst_p++ )
+ {
+ expected = RD32( dst_p );
+ WR32( src_p, expected );
+ }
+ for ( src_p = saddr, dst_p = daddr; src_p < end_p; src_p++, dst_p++ )
+ {
+ expected = RD32( dst_p );
+ read = RD32( src_p );
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ /* DECREASING traversal ORIGINAL */
+ end_p = saddr;
+ for ( src_p = saddr + words - 1, dst_p = daddr + words - 1;
+ src_p >= end_p; src_p--, dst_p-- )
+ {
+ expected = RD32( dst_p );
+ WR32( src_p, expected );
+ }
+ for ( src_p = saddr + words - 1, dst_p = daddr + words - 1;
+ src_p >= end_p; src_p--, dst_p-- )
+ {
+ expected = RD32( dst_p );
+ read = RD32( src_p );
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ /* INCREASING traversal INVERSE */
+ end_p = saddr + words;
+ for ( src_p = saddr, dst_p = daddr; src_p < end_p; src_p++, dst_p++ )
+ {
+ expected = ~( RD32( dst_p ) );
+ WR32( src_p, expected );
+ }
+ for ( src_p = saddr, dst_p = daddr; src_p < end_p; src_p++, dst_p++ )
+ {
+ expected = ~( RD32( dst_p ) );
+ read = RD32( src_p );
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ /* DECREASING traversal INVERSE */
+ end_p = saddr;
+ for ( src_p = saddr + words - 1, dst_p = daddr + words - 1;
+ src_p >= end_p; src_p--, dst_p-- )
+ {
+ expected = ~( RD32( dst_p ) );
+ WR32( src_p, expected );
+ }
+ for ( src_p = saddr + words - 1, dst_p = daddr + words - 1;
+ src_p >= end_p; src_p--, dst_p-- )
+ {
+ expected = ~( RD32( dst_p ) );
+ read = RD32( src_p );
+ if ( read != expected )
+ {
+ return MEMTEST_FAILURE;
+ }
+ }
+
+ return MEMTEST_SUCCESS;
+}
+
+/*---------------------------------------------------------------------------*/
diff --git a/cfe/cfe/arch/mips/board/bcm63xx_rom/src/rom_cfe.mk b/cfe/cfe/arch/mips/board/bcm63xx_rom/src/rom_cfe.mk
new file mode 100755
index 0000000..c45aea7
--- /dev/null
+++ b/cfe/cfe/arch/mips/board/bcm63xx_rom/src/rom_cfe.mk
@@ -0,0 +1,370 @@
+
+#
+# CFE's version number
+#
+
+include ${TOP}/main/cfe_version.mk
+
+#
+# Default values for certain parameters
+#
+
+CFG_MLONG64 ?= 0
+CFG_LITTLE ?= 0
+CFG_RELOC ?= 0
+CFG_UNCACHED ?= 0
+CFG_NEWRELOC ?= 0
+CFG_BOOTRAM ?= 0
+CFG_VGACONSOLE ?= 0
+CFG_PCI ?= 1
+CFG_LDT_REV_017 ?= 0
+CFG_ZLIB ?= 0
+CFG_BIENDIAN ?= 0
+CFG_DOWNLOAD ?= 0
+CFG_RAMAPP ?= 0
+CFG_USB ?= 0
+
+#
+# Paths to other parts of the firmware. Everything's relative to ${TOP}
+# so that you can actually do a build anywhere you want.
+#
+
+ARCH_TOP = ${TOP}/arch/${ARCH}
+ARCH_SRC = ${ARCH_TOP}/common/src
+ARCH_INC = ${ARCH_TOP}/common/include
+CPU_SRC = ${ARCH_TOP}/cpu/${CPU}/src
+CPU_INC = ${ARCH_TOP}/cpu/${CPU}/include
+#
+# It's actually optional to have a 'board'
+# directory. If you don't specify BOARD,
+# don't include the files.
+#
+
+ifneq ("$(strip ${BOARD})","")
+BOARD_SRC = ${ARCH_TOP}/board/${BOARD}/src
+BOARD_INC = ${ARCH_TOP}/board/${BOARD}/include
+endif
+
+#
+# Preprocessor defines for CFE's version number
+#
+
+VDEF = -DCFE_VER_MAJ=${CFE_VER_MAJ} -DCFE_VER_MIN=${CFE_VER_MIN} -DCFE_VER_ECO=${CFE_VER_ECO}
+
+#
+# Construct the list of paths that will eventually become the include
+# paths and VPATH
+#
+
+SRCDIRS = ${ARCH_SRC} ${CPU_SRC} ${BOARD_SRC} ${TOP}/main ${TOP}/vendor ${TOP}/include ${TOP}/net ${TOP}/dev ${TOP}/pci ${TOP}/ui ${TOP}/lib ${TOP}/common ${TOP}/verif ${TOP}/lzma
+
+CFE_INC = ${TOP}/include ${TOP}/pci ${TOP}/net
+
+ifeq ($(strip ${CFG_VGACONSOLE}),1)
+SRCDIRS += ${TOP}/x86emu ${TOP}/pccons
+CFE_INC += ${TOP}/x86emu ${TOP}/pccons
+endif
+
+ifeq ($(strip ${CFG_VAPI}),1)
+SRCDIRS += ${TOP}/verif
+CFE_INC += ${TOP}/verif
+endif
+
+ifeq ($(strip ${CFG_ZLIB}),1)
+SRCDIRS += ${TOP}/zlib
+CFE_INC += ${TOP}/zlib
+endif
+
+
+INCDIRS = $(patsubst %,-I%,$(subst :, ,$(ARCH_INC) $(CPU_INC) $(BOARD_INC) $(CFE_INC)))
+
+VPATH = $(SRCDIRS)
+
+#
+# Bi-endian support: If we're building the little-endian
+# version, use a different linker script so we can locate the
+# ROM at a higher address. You'd think we could do this with
+# normal linker command line switches, but there appears to be no
+# command-line way to override the 'AT' qualifier in the linker script.
+#
+
+CFG_TEXTAT1MB=0
+ifeq ($(strip ${CFG_BIENDIAN}),1)
+ ifeq ($(strip ${CFG_LITTLE}),1)
+ CFG_TEXTAT1MB=1
+ endif
+endif
+
+
+#
+# Configure tools and basic tools flags. This include sets up
+# macros for calling the C compiler, basic flags,
+# and linker scripts.
+#
+
+include ${ARCH_SRC}/tools.mk
+
+#
+# Add some common flags that are used on any architecture.
+#
+
+CFLAGS += -I. $(INCDIRS)
+CFLAGS += -D_CFE_ ${VDEF} -DCFG_BOARDNAME=\"${CFG_BOARDNAME}\"
+
+#
+# Gross - allow more options to be supplied from command line
+#
+
+ifdef CFG_OPTIONS
+OPTFLAGS = $(patsubst %,-D%,$(subst :, ,$(CFG_OPTIONS)))
+CFLAGS += ${OPTFLAGS}
+endif
+
+ifeq ($(strip $(BRCM_IKOS)),y)
+CFLAGS += -DCONFIG_BRCM_IKOS
+endif
+
+#
+# Add flash driver support.
+#
+
+ifeq ($(strip $(BLD_NAND)),1)
+# BUILD NAND flash boot loader
+ifeq ($(strip $(BRCM_CHIP)),6328)
+INC_CFI_FLASH_DRIVER=0
+INC_SPI_FLASH_DRIVER=0
+INC_NAND_FLASH_DRIVER=1
+endif
+ifeq ($(strip $(BRCM_CHIP)),6362)
+INC_CFI_FLASH_DRIVER=0
+INC_SPI_FLASH_DRIVER=0
+INC_NAND_FLASH_DRIVER=1
+endif
+ifeq ($(strip $(BRCM_CHIP)),6368)
+INC_CFI_FLASH_DRIVER=0
+INC_SPI_FLASH_DRIVER=0
+INC_NAND_FLASH_DRIVER=1
+endif
+ifeq ($(strip $(BRCM_CHIP)),6816)
+INC_CFI_FLASH_DRIVER=0
+INC_SPI_FLASH_DRIVER=0
+INC_NAND_FLASH_DRIVER=1
+endif
+
+else
+# BUILD NOR flash boot loader
+ifeq ($(strip $(BRCM_CHIP)),6328)
+INC_CFI_FLASH_DRIVER=0
+INC_SPI_FLASH_DRIVER=1
+INC_NAND_FLASH_DRIVER=0
+endif
+ifeq ($(strip $(BRCM_CHIP)),6362)
+INC_CFI_FLASH_DRIVER=0
+INC_SPI_FLASH_DRIVER=1
+INC_NAND_FLASH_DRIVER=0
+endif
+ifeq ($(strip $(BRCM_CHIP)),6368)
+INC_CFI_FLASH_DRIVER=1
+INC_SPI_FLASH_DRIVER=1
+INC_NAND_FLASH_DRIVER=0
+endif
+ifeq ($(strip $(BRCM_CHIP)),6816)
+INC_CFI_FLASH_DRIVER=1
+INC_SPI_FLASH_DRIVER=1
+INC_NAND_FLASH_DRIVER=0
+endif
+endif
+
+ifeq ($(strip $(BLD_SPI_NAND)),1)
+INC_CFI_FLASH_DRIVER=0
+INC_SPI_FLASH_DRIVER=1
+INC_NAND_FLASH_DRIVER=0
+INC_SPI_PROG_NAND=1
+else
+INC_SPI_PROG_NAND=0
+endif
+
+CFLAGS += -DINC_CFI_FLASH_DRIVER=$(INC_CFI_FLASH_DRIVER)
+CFLAGS += -DINC_SPI_FLASH_DRIVER=$(INC_SPI_FLASH_DRIVER)
+CFLAGS += -DINC_NAND_FLASH_DRIVER=$(INC_NAND_FLASH_DRIVER)
+CFLAGS += -DINC_SPI_PROG_NAND=$(INC_SPI_PROG_NAND)
+
+#
+# This is the makefile's main target. Note that we actually
+# do most of the work in 'ALL' not 'all', since we include
+# other makefiles after this point.
+#
+
+all : build_date.c ALL
+
+#
+# Macros that expand to the list of arch-independent files
+#
+
+LZMAOBJS = LzmaDecode.o dcapi.o
+DEVOBJS = lib_malloc.o
+## dev_newflash.o dev_null.o dev_promice.o dev_ide_common.o dev_ns16550.o dev_ds17887clock.o dev_flash.o
+
+##lib_hssubr.o lib_physio.o lib_printf.o lib_misc.o \ lib_arena.o lib_queue.o
+## lib_qsort.o lib_string.o lib_string2.o
+
+NETOBJS =
+## net_tcp.o net_tcpbuf.o dev_tcpconsole.o net_dhcp.o net_icmp.o net_ether.o net_tftp.o net_ip.o net_udp.o net_dns.o net_arp.o net_api.o
+
+CFEOBJS =
+## cfe_iocb_dispatch.o cfe_devfuncs.o \ cfe_console.o cfe_timer.o cfe_attach.o cfe_background.o cfe_zlibfs.o
+## cfe_mem.o
+## cfe_error.o build_date.o \
+## cfe_rawfs.o cfe_xreq.o cfe_filesys.o
+## cfe_fatfs.o cfe_httpfs.o cfe_ldr_srec.o cfe_autoboot.o cfe_boot.o cfe_ldr_elf.o cfe_ldr_raw.o cfe_loader.o
+## cfe_main.o nvram_subr.o url.o cfe_savedata.o env_subr.o
+UIOBJS =
+##ui_command.o ui_cmddisp.o
+## ui_pcicmds.o \ui_tcpcmds.o ui_memcmds.o ui_loadcmds.o ui_flash.o ui_netcmds.o ui_envcmds.o ui_devcmds.o
+## ui_examcmds.o ui_misccmds.o \
+## ui_test_disk.o ui_test_ether.o ui_test_flash.o ui_test_uart.o
+
+#
+# Add more object files if we're supporting PCI
+#
+
+ifeq ($(strip ${CFG_PCI}),1)
+PCIOBJS = pciconf.o ldtinit.o pci_subr.o
+PCIOBJS += pci_devs.o
+DEVOBJS += dev_sp1011.o dev_ht7520.o
+DEVOBJS += dev_ide_pci.o dev_ns16550_pci.o
+DEVOBJS += dev_tulip.o dev_dp83815.o
+CFLAGS += -DCFG_PCI=1
+ifeq ($(strip ${CFG_LDT_REV_017}),1)
+CFLAGS += -DCFG_LDT_REV_017=1
+endif
+ifeq ($(strip ${CFG_DOWNLOAD}),1)
+DEVOBJS += dev_bcm1250.o download.data
+CFLAGS += -DCFG_DOWNLOAD=1
+endif
+endif
+
+#
+# If doing bi-endian, add the compiler switch to change
+# the way the vectors are generated. These switches are
+# only added to the big-endian portion of the ROM,
+# which is located at the real boot vector.
+#
+
+ifeq ($(strip ${CFG_BIENDIAN}),1)
+ ifeq ($(strip ${CFG_LITTLE}),0)
+ CFLAGS += -DCFG_BIENDIAN=1
+ endif
+endif
+
+#
+# Include the makefiles for the architecture-common, cpu-specific,
+# and board-specific directories. Each of these will supply
+# some files to "ALLOBJS". The BOARD directory is optional
+# as some ports are so simple they don't need boad-specific stuff.
+#
+
+include ${ARCH_SRC}/Makefile
+include ${CPU_SRC}/Makefile
+
+ifneq ("$(strip ${BOARD})","")
+include ${BOARD_SRC}/Makefile
+endif
+
+#
+# Add the common object files here.
+#
+
+ALLOBJS += $(LIBOBJS) $(DEVOBJS) $(CFEOBJS) $(VENOBJS) $(UIOBJS) $(NETOBJS)
+#$(PCIOBJS)
+
+#
+# VAPI continues to be a special case.
+#
+
+ifeq ($(strip ${CFG_VAPI}),1)
+include ${TOP}/verif/Makefile
+endif
+
+#
+# USB support
+#
+
+ifeq ($(strip ${CFG_USB}),1)
+SRCDIRS += ${TOP}/usb
+CFE_INC += ${TOP}/usb
+include ${TOP}/usb/Makefile
+endif
+
+#
+# If we're doing the VGA console thing, pull in the x86 emulator
+# and the pcconsole subsystem
+#
+
+ifeq ($(strip ${CFG_VGACONSOLE}),1)
+include ${TOP}/x86emu/Makefile
+include ${TOP}/pccons/Makefile
+endif
+
+#
+# If we're including ZLIB, then add its makefile.
+#
+
+##ifeq ($(strip ${CFG_ZLIB}),1)
+##include ${TOP}/zlib/Makefile
+CFLAGS += -DCFG_ZLIB=1 -DMY_ZCALLOC -DNO_MEMCPY
+##endif
+
+.PHONY : all
+.PHONY : ALL
+.PHONY : build_date.c
+
+#
+# Build the local tools that we use to construct other source files
+#
+
+mkpcidb : ${TOP}/hosttools/mkpcidb.c
+ gcc -o mkpcidb ${TOP}/hosttools/mkpcidb.c
+
+memconfig : ${TOP}/hosttools/memconfig.c
+ gcc -o memconfig -D_MCSTANDALONE_ -D_MCSTANDALONE_NOISY_ -I${TOP}/arch/mips/cpu/sb1250/include ${TOP}/hosttools/memconfig.c ${TOP}/arch/${ARCH}/cpu/${CPU}/src/sb1250_draminit.c
+
+pcidevs_data2.h : mkpcidb ${TOP}/pci/pcidevs_data.h
+ ./mkpcidb > pcidevs_data2.h
+
+mkflashimage : ${TOP}/hosttools/mkflashimage.c
+ gcc -o mkflashimage -I${TOP}/include ${TOP}/hosttools/mkflashimage.c
+
+pci_subr.o : ${TOP}/pci/pci_subr.c pcidevs_data2.h
+
+##build_date.c :
+## echo "const char *builddate = \"`date`\";" > build_date.c
+## echo "const char *builduser = \"`whoami`@`hostname`\";" >> build_date.c
+
+#
+# Make a define for the board name
+#
+
+CFLAGS += -D_$(patsubst "%",%,${CFG_BOARDNAME})_
+
+LIBCFE = libcfe.a
+
+%.o : %.c
+ $(GCC) $(CFLAGS) -o $@ $<
+
+%.o : %.S
+ $(GCC) $(CFLAGS) -o $@ $<
+
+#
+# This rule constructs "libcfe.a" which contains most of the object
+# files.
+#
+
+$(LIBCFE) : $(ALLOBJS)
+ rm -f $(LIBCFE)
+ $(AR) cr $(LIBCFE) $(ALLOBJS)
+ $(RANLIB) $(LIBCFE)
+
+
+
+
diff --git a/cfe/cfe/arch/mips/common/include/addrspace.h b/cfe/cfe/arch/mips/common/include/addrspace.h
new file mode 100644
index 0000000..6330851
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/include/addrspace.h
@@ -0,0 +1,63 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Address space macros File: addrspace.h
+ *
+ * Macros to deal with physical, virtual, and uncached addresses.
+ * for MIPS, these map to the appropriate KSEG0/KSEG1 macros
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "sbmips.h"
+
+#define PHYSADDR(x) K0_TO_PHYS(x)
+
+/* If running uncached, force all kernel addresses to be uncached */
+#if CFG_RUNFROMKSEG0
+#define KERNADDR(x) PHYS_TO_K0(x)
+#else
+#define KERNADDR(x) PHYS_TO_K1(x)
+#endif
+
+#define UNCADDR(x) PHYS_TO_K1(x)
+
+
+
diff --git a/cfe/cfe/arch/mips/common/include/disasm.h b/cfe/cfe/arch/mips/common/include/disasm.h
new file mode 100644
index 0000000..8a8e7b7
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/include/disasm.h
@@ -0,0 +1,61 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * MIPS disassembler File: disasm.h
+ *
+ * MIPS disassembler (used by ui_examcmds.c)
+ *
+ * Author: Justin Carlson (carlson@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#ifndef DISASM_H
+#define DISASM_H
+
+/* Returns a pointer to a read-only string containing the intstruction name */
+char *disasm_inst_name(uint32_t inst);
+
+/* Copies a disassembled version of the instruction into buf, null terminating the
+string. Will not exceed buf_size bytes written; if the disassembled string is
+longer than buf_size, buf_size-1 bytes of the string will be written and that string
+will be null-terminated */
+void disasm_inst(char *buf, int buf_size, uint32_t inst, uint64_t pc);
+#endif
+
+
+
diff --git a/cfe/cfe/arch/mips/common/include/exception.h b/cfe/cfe/arch/mips/common/include/exception.h
new file mode 100644
index 0000000..70e87c2
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/include/exception.h
@@ -0,0 +1,223 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Exception/trap handler defs File: exception.h
+ *
+ * This module describes the exception handlers, exception
+ * trap frames, and dispatch.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#ifdef __ASSEMBLER__
+#define _XAIDX(x) (8*(x))
+#else
+#define _XAIDX(x) (x)
+#endif
+
+
+/* *********************************************************************
+ * Exception vectors from the MIPS specification
+ ********************************************************************* */
+
+#define MIPS_ROM_VEC_RESET 0x0000
+#define MIPS_ROM_VEC_TLBFILL 0x0200
+#define MIPS_ROM_VEC_XTLBFILL 0x0280
+#define MIPS_ROM_VEC_CACHEERR 0x0300
+#define MIPS_ROM_VEC_EXCEPTION 0x0380
+#define MIPS_ROM_VEC_INTERRUPT 0x0400
+#define MIPS_ROM_VEC_EJTAG 0x0480
+
+#define MIPS_RAM_VEC_TLBFILL 0x0000
+#define MIPS_RAM_VEC_XTLBFILL 0x0080
+#define MIPS_RAM_VEC_EXCEPTION 0x0180
+#define MIPS_RAM_VEC_INTERRUPT 0x0200
+#define MIPS_RAM_VEC_CACHEERR 0x0100
+#define MIPS_RAM_VEC_END 0x0300
+
+#define MIPS_RAM_EXL_VEC_TLBFILL 0x0100
+#define MIPS_RAM_EXL_VEC_XTLBFILL 0x0180
+
+
+/* *********************************************************************
+ * Fixed locations of other low-memory objects. We stuff some
+ * important data in the spaces between the vectors.
+ ********************************************************************* */
+
+#define CFE_LOCORE_GLOBAL_GP 0x0040 /* our "handle" */
+#define CFE_LOCORE_GLOBAL_SP 0x0048 /* Stack pointer for exceptions */
+#define CFE_LOCORE_GLOBAL_K0TMP 0x0050 /* Used by cache error handler */
+#define CFE_LOCORE_GLOBAL_K1TMP 0x0058 /* Used by cache error handler */
+#define CFE_LOCORE_GLOBAL_RATMP 0x0060 /* Used by cache error handler */
+#define CFE_LOCORE_GLOBAL_GPTMP 0x0068 /* Used by cache error handler */
+#define CFE_LOCORE_GLOBAL_CERRH 0x0070 /* Pointer to cache error handler */
+
+#define CFE_LOCORE_GLOBAL_T0TMP 0x0240 /* used by cache error handler */
+#define CFE_LOCORE_GLOBAL_T1TMP 0x0248 /* used by cache error handler */
+#define CFE_LOCORE_GLOBAL_T2TMP 0x0250 /* used by cache error handler */
+#define CFE_LOCORE_GLOBAL_T3TMP 0x0258 /* used by cache error handler */
+
+/* *********************************************************************
+ * Offsets into our exception handler table.
+ ********************************************************************* */
+
+#define XTYPE_RESET 0
+#define XTYPE_TLBFILL 8
+#define XTYPE_XTLBFILL 16
+#define XTYPE_CACHEERR 24
+#define XTYPE_EXCEPTION 32
+#define XTYPE_INTERRUPT 40
+#define XTYPE_EJTAG 48
+
+/* *********************************************************************
+ * Exception frame definitions.
+ ********************************************************************* */
+
+/*
+ * The exception frame is divided up into pieces, representing the different
+ * parts of the processor that the data comes from:
+ *
+ * CP0: Words 0..7
+ * Int Regs: Words 8..41
+ * FP Regs: Words 42..73
+ * Total size: 74 words
+ */
+
+#define EXCEPTION_SIZE _XAIDX(74)
+
+#define XCP0_BASE 0
+#define XGR_BASE 8
+#define XFR_BASE 42
+
+#define _XCP0IDX(x) _XAIDX((x)+XCP0_BASE)
+#define XCP0_SR _XCP0IDX(0)
+#define XCP0_CAUSE _XCP0IDX(1)
+#define XCP0_EPC _XCP0IDX(2)
+#define XCP0_VADDR _XCP0IDX(3)
+#define XCP0_PRID _XCP0IDX(4)
+
+#define _XGRIDX(x) _XAIDX((x)+XGR_BASE)
+#define XGR_ZERO _XGRIDX(0)
+#define XGR_AT _XGRIDX(1)
+#define XGR_V0 _XGRIDX(2)
+#define XGR_V1 _XGRIDX(3)
+#define XGR_A0 _XGRIDX(4)
+#define XGR_A1 _XGRIDX(5)
+#define XGR_A2 _XGRIDX(6)
+#define XGR_A3 _XGRIDX(7)
+#define XGR_T0 _XGRIDX(8)
+#define XGR_T1 _XGRIDX(9)
+#define XGR_T2 _XGRIDX(10)
+#define XGR_T3 _XGRIDX(11)
+#define XGR_T4 _XGRIDX(12)
+#define XGR_T5 _XGRIDX(13)
+#define XGR_T6 _XGRIDX(14)
+#define XGR_T7 _XGRIDX(15)
+#define XGR_S0 _XGRIDX(16)
+#define XGR_S1 _XGRIDX(17)
+#define XGR_S2 _XGRIDX(18)
+#define XGR_S3 _XGRIDX(19)
+#define XGR_S4 _XGRIDX(20)
+#define XGR_S5 _XGRIDX(21)
+#define XGR_S6 _XGRIDX(22)
+#define XGR_S7 _XGRIDX(23)
+#define XGR_T8 _XGRIDX(24)
+#define XGR_T9 _XGRIDX(25)
+#define XGR_K0 _XGRIDX(26)
+#define XGR_K1 _XGRIDX(27)
+#define XGR_GP _XGRIDX(28)
+#define XGR_SP _XGRIDX(29)
+#define XGR_FP _XGRIDX(30)
+#define XGR_RA _XGRIDX(31)
+#define XGR_LO _XGRIDX(32)
+#define XGR_HI _XGRIDX(33)
+
+
+#define _XFRIDX(x) _XAIDX((x)+XFR_BASE)
+#define XR_F0 _XFRIDX(0)
+#define XR_F1 _XFRIDX(1)
+#define XR_F2 _XFRIDX(2)
+#define XR_F3 _XFRIDX(3)
+#define XR_F4 _XFRIDX(4)
+#define XR_F5 _XFRIDX(5)
+#define XR_F6 _XFRIDX(6)
+#define XR_F7 _XFRIDX(7)
+#define XR_F8 _XFRIDX(8)
+#define XR_F9 _XFRIDX(9)
+#define XR_F10 _XFRIDX(10)
+#define XR_F11 _XFRIDX(11)
+#define XR_F12 _XFRIDX(12)
+#define XR_F13 _XFRIDX(13)
+#define XR_F14 _XFRIDX(14)
+#define XR_F15 _XFRIDX(15)
+#define XR_F16 _XFRIDX(16)
+#define XR_F17 _XFRIDX(17)
+#define XR_F18 _XFRIDX(18)
+#define XR_F19 _XFRIDX(19)
+#define XR_F20 _XFRIDX(20)
+#define XR_F21 _XFRIDX(21)
+#define XR_F22 _XFRIDX(22)
+#define XR_F23 _XFRIDX(23)
+#define XR_F24 _XFRIDX(24)
+#define XR_F25 _XFRIDX(25)
+#define XR_F26 _XFRIDX(26)
+#define XR_F27 _XFRIDX(27)
+#define XR_F28 _XFRIDX(28)
+#define XR_F29 _XFRIDX(29)
+#define XR_F30 _XFRIDX(30)
+#define XR_F31 _XFRIDX(31)
+#define XR_FCR _XFRIDX(32)
+#define XR_FID _XFRIDX(33)
+
+
+#ifndef __ASSEMBLER__
+extern void _exc_setvector(int vectype, void *vecaddr);
+extern void _exc_crash_sim(void);
+extern void _exc_cache_crash_sim(void);
+extern void _exc_restart(void);
+extern void _exc_clear_sr_exl(void);
+extern void _exc_clear_sr_erl(void);
+void cfe_exception(int code,uint64_t *info);
+void cfe_setup_exceptions(void);
+#endif
+
+
+
+
+
diff --git a/cfe/cfe/arch/mips/common/include/exchandler.h b/cfe/cfe/arch/mips/common/include/exchandler.h
new file mode 100644
index 0000000..af268f1
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/include/exchandler.h
@@ -0,0 +1,85 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Exception Handler definitions File: exchandler.h
+ *
+ * Exception handler functions and constants
+ *
+ * Author: Binh Vo (binh@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#ifndef _LIB_SETJMP_H
+#include "lib_setjmp.h"
+#endif
+
+#ifndef _LIB_QUEUE_H
+#include "lib_queue.h"
+#endif
+
+#define MEM_BYTE 1
+#define MEM_HALFWORD 2
+#define MEM_WORD 3
+#define MEM_QUADWORD 4
+
+#define EXC_NORMAL_RETURN 0
+#define EXC_CHAIN_EXC 1
+
+typedef struct jmpbuf_s {
+ queue_t stack;
+ jmp_buf jmpbuf;
+} jmpbuf_t;
+
+typedef struct exc_handler_s {
+ int catch_exc;
+ int chain_exc;
+ queue_t jmpbuf_stack;
+} exc_handler_t;
+
+extern exc_handler_t exc_handler;
+
+jmpbuf_t *exc_initialize_block(void);
+void exc_cleanup_block(jmpbuf_t *);
+void exc_cleanup_handler(jmpbuf_t *, int);
+void exc_longjmp_handler(void);
+int mem_peek(void*, long, int);
+int mem_poke(long, uint64_t, int);
+
+
+#define exc_try(jb) (lib_setjmp(((jb)->jmpbuf)))
diff --git a/cfe/cfe/arch/mips/common/include/initdata.h b/cfe/cfe/arch/mips/common/include/initdata.h
new file mode 100644
index 0000000..c5fc0d8
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/include/initdata.h
@@ -0,0 +1,68 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Data stored in initialization module File: initdata.h
+ *
+ * This file contains data declared by the init module. It also
+ * contains externs for that data so we can keep the types straight.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#if defined(__ASSEMBLER__)
+#define DECLARE_INITVAR(x) \
+ .globl x ; \
+x: _LONG_ 0
+#else
+#define DECLARE_INITVAR(x) \
+ extern long x;
+#endif
+
+DECLARE_INITVAR(mem_textreloc)
+DECLARE_INITVAR(mem_textbase)
+DECLARE_INITVAR(mem_textsize)
+DECLARE_INITVAR(mem_totalsize)
+DECLARE_INITVAR(mem_topofmem)
+DECLARE_INITVAR(mem_heapstart)
+DECLARE_INITVAR(mem_bottomofmem)
+DECLARE_INITVAR(mem_datareloc)
+DECLARE_INITVAR(cpu_prid)
+
+
diff --git a/cfe/cfe/arch/mips/common/include/lib_hssubr.h b/cfe/cfe/arch/mips/common/include/lib_hssubr.h
new file mode 100644
index 0000000..b4df439
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/include/lib_hssubr.h
@@ -0,0 +1,84 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * "Hyperspace" access routines File: lib_hssubr.h
+ *
+ * Constants, macros, and definitions for routines to deal with
+ * hyperspace (beyond 256MB) on MIPS processors.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#ifndef _LIB_HSSUBR_H
+#define _LIB_HSSUBR_H
+
+/*
+ * If __long64 we can do this via macros. Otherwise, call
+ * the magic functions.
+ */
+
+#if __long64
+
+typedef long hsaddr_t;
+
+#define hs_write8(a,b) *((volatile uint8_t *) (a)) = (b)
+#define hs_write16(a,b) *((volatile uint16_t *) (a)) = (b)
+#define hs_write32(a,b) *((volatile uint32_t *) (a)) = (b)
+#define hs_write64(a,b) *((volatile uint32_t *) (a)) = (b)
+#define hs_read8(a) *((volatile uint8_t *) (a))
+#define hs_read16(a) *((volatile uint16_t *) (a))
+#define hs_read32(a) *((volatile uint32_t *) (a))
+#define hs_read64(a) *((volatile uint64_t *) (a))
+
+#else /* not __long64 */
+
+typedef long long hsaddr_t;
+
+extern void hs_write8(hsaddr_t a,uint8_t b);
+extern void hs_write16(hsaddr_t a,uint16_t b);
+extern void hs_write32(hsaddr_t a,uint32_t b);
+extern void hs_write64(hsaddr_t a,uint64_t b);
+extern uint8_t hs_read8(hsaddr_t a);
+extern uint16_t hs_read16(hsaddr_t a);
+extern uint32_t hs_read32(hsaddr_t a);
+extern uint64_t hs_read64(hsaddr_t a);
+#endif
+
+#endif
diff --git a/cfe/cfe/arch/mips/common/include/lib_physio.h b/cfe/cfe/arch/mips/common/include/lib_physio.h
new file mode 100644
index 0000000..00d0093
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/include/lib_physio.h
@@ -0,0 +1,100 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Physical memory peek/poke routines File: lib_physio.h
+ *
+ * Little stub routines to allow access to arbitrary physical
+ * addresses. In most cases this should not be needed, as
+ * many physical addresses are within kseg1, but this handles
+ * the cases that are not automagically, so we don't need
+ * to mess up the code with icky macros and such.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#ifndef _LIB_PHYSIO_H
+#define _LIB_PHYSIO_H
+
+//#ifndef _SB_MIPS_H
+//#include "sbmips.h"
+//#endif
+
+/*
+ * If __long64 we can do this via macros. Otherwise, call
+ * the magic functions.
+ */
+
+#if __long64
+
+typedef long physaddr_t;
+#define _PHYSADDR_T_DEFINED_
+
+/*#define __UNCADDRX(x) PHYS_TO_XKSEG_UNCACHED(x)*/
+#define __UNCADDRX(x) (((physaddr_t)(x))|0x9000000000000000)
+
+
+#define phys_write8(a,b) *((volatile uint8_t *) __UNCADDRX(a)) = (b)
+#define phys_write16(a,b) *((volatile uint16_t *) __UNCADDRX(a)) = (b)
+#define phys_write32(a,b) *((volatile uint32_t *) __UNCADDRX(a)) = (b)
+#define phys_write64(a,b) *((volatile uint64_t *) __UNCADDRX(a)) = (b)
+#define phys_read8(a) *((volatile uint8_t *) __UNCADDRX(a))
+#define phys_read16(a) *((volatile uint16_t *) __UNCADDRX(a))
+#define phys_read32(a) *((volatile uint32_t *) __UNCADDRX(a))
+#define phys_read64(a) *((volatile uint64_t *) __UNCADDRX(a))
+
+#else /* not __long64 */
+
+#ifdef _MIPSREGS32_
+typedef long physaddr_t; /* 32-bit-only processors can't have >32bit pa's */
+#else
+typedef long long physaddr_t; /* Otherwise, they might. */
+#endif
+
+extern void phys_write8(physaddr_t a,uint8_t b);
+extern void phys_write16(physaddr_t a,uint16_t b);
+extern void phys_write32(physaddr_t a,uint32_t b);
+extern void phys_write64(physaddr_t a,uint64_t b);
+extern uint8_t phys_read8(physaddr_t a);
+extern uint16_t phys_read16(physaddr_t a);
+extern uint32_t phys_read32(physaddr_t a);
+extern uint64_t phys_read64(physaddr_t a);
+#endif
+
+#endif
diff --git a/cfe/cfe/arch/mips/common/include/lib_setjmp.h b/cfe/cfe/arch/mips/common/include/lib_setjmp.h
new file mode 100644
index 0000000..b673222
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/include/lib_setjmp.h
@@ -0,0 +1,81 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * setjmp/longjmp defs File: lib_setjmp.h
+ *
+ * Description of the jmp_buf structure for setjmp and longjmp
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+/*
+ * Note that while lib_setjmp() and lib_longjmp() behave like setjmp()
+ * and longjmp() normally do, gcc 3.1.x (and later) assumes things about
+ * how setjmp() and longjmp() should work (even with -fno-builtins). We
+ * don't want it to do those, so these functions must be named differently.
+ */
+
+#ifdef __ASSEMBLER__
+#define _JBIDX(x) (8*(x))
+#else
+#define _JBIDX(x) (x)
+#endif
+
+
+#define JMPB_S0 _JBIDX(0)
+#define JMPB_S1 _JBIDX(1)
+#define JMPB_S2 _JBIDX(2)
+#define JMPB_S3 _JBIDX(3)
+#define JMPB_S4 _JBIDX(4)
+#define JMPB_S5 _JBIDX(5)
+#define JMPB_S6 _JBIDX(6)
+#define JMPB_S7 _JBIDX(7)
+#define JMPB_FP _JBIDX(8)
+#define JMPB_SP _JBIDX(9)
+#define JMPB_RA _JBIDX(10)
+
+#define JMPB_SIZE _JBIDX(11)
+
+#ifndef __ASSEMBLER__
+typedef long long jmp_buf[JMPB_SIZE];
+extern int lib_setjmp(jmp_buf);
+extern void lib_longjmp(jmp_buf,int val);
+#endif
+
diff --git a/cfe/cfe/arch/mips/common/include/mipsmacros.h b/cfe/cfe/arch/mips/common/include/mipsmacros.h
new file mode 100755
index 0000000..072a5e6
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/include/mipsmacros.h
@@ -0,0 +1,376 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * MIPS Macros File: mipsmacros.h
+ *
+ * Macros to deal with various mips-related things.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+/* *********************************************************************
+ * 32/64-bit macros
+ ********************************************************************* */
+
+#ifdef __long64
+#define _VECT_ .dword
+#define _LONG_ .dword
+#define SR sd
+#define LR ld
+#define ADD dadd
+#define SUB dsub
+#define MFC0 dmfc0
+#define MTC0 dmtc0
+#define REGSIZE 8
+#define BPWSIZE 3 /* bits per word size */
+#define _TBLIDX(x) ((x)*REGSIZE)
+#else
+#define _VECT_ .word
+#define _LONG_ .word
+#define SR sw
+#define LR lw
+#define ADD add
+#define SUB sub
+#define MFC0 mfc0
+#define MTC0 mtc0
+#define REGSIZE 4
+#define BPWSIZE 2
+#define _TBLIDX(x) ((x)*REGSIZE)
+#endif
+
+
+/* *********************************************************************
+ * NORMAL_VECTOR(addr,vecname,vecdest)
+ * NORMAL_XVECTOR(addr,vecname,vecdest,code)
+ *
+ * Declare a trap or dispatch vector. There are two flavors,
+ * DECLARE_XVECTOR sets up an indentifying code in k0 before
+ * jumping to the dispatch routine.
+ *
+ * Input parameters:
+ * addr - vector address
+ * vecname - for label at that address
+ * vecdest - destination (place vector jumps to)
+ * code - code to place in k0 before jumping
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+
+#define NORMAL_VECTOR(addr,vecname,vecdest) \
+ .globl vecname ; \
+ .org addr ; \
+vecname: b vecdest ; \
+ nop;
+
+#define NORMAL_XVECTOR(addr,vecname,vecdest,code) \
+ .globl vecname ; \
+ .org addr ; \
+vecname: b vecdest ; \
+ li k0,code ; \
+ nop;
+
+
+/* *********************************************************************
+ * Evil macros for bi-endian support.
+ *
+ * The magic here is in the instruction encoded as 0x10000014.
+ *
+ * This instruction in big-endian is: "b .+0x54"
+ * this instruction in little-endian is: "bne zero,zero,.+0x44"
+ *
+ * So, depending on what the system endianness is, it will either
+ * branch to .+0x54 or not branch at all.
+ *
+ * the instructions that follow are:
+ *
+ * 0x10000014 "magic branch" (either-endian)
+ * 0x00000000 nop (bds) (either-endian)
+ * 0xD0BF1A3C lui k0,0xBFD0 (little-endian)
+ * 0xxxxx5A27 addu k0,vector (little-endian)
+ * 0x08004003 jr k0 (little-endian)
+ * 0x00000000 nop (bds) (little-endian)
+ * ... space up to offset 0x54
+ * ......... b vecaddr (big-endian)
+ *
+ * The idea is that the big-endian firmware is first, from 0..1MB
+ * in the flash, and the little-endian firmware is second,
+ * from 1..2MB in the flash. The little-endian firmware is
+ * set to load at BFD00000, so that its initial routines will
+ * work until relocation is completed.
+ *
+ * the instructions at the vectors will either jump to the
+ * big-endian or little-endian code based on system endianness.
+ *
+ * The ROM is built by compiling CFE twice, first with
+ * CFG_BIENDIAN=1 and CFG_LITTLE=0 (big-endian) and again
+ * with CFG_BIENDIAN=1 and CFG_LITTLE=1. The resulting
+ * cfe.bin files are located at 0xBFC00000 and 0xBFD00000
+ * for big and little-endian versions, respectively.
+ *
+ * More information about how this works can be found in the
+ * CFE Manual.
+ ********************************************************************* */
+
+#define __SWAPW(x) ((((x) & 0xFF) << 8) | (((x) & 0xFF00) >> 8))
+
+#define BIENDIAN_VECTOR(addr,vecname,vecdest) \
+ .globl vecname ; \
+ .org addr ; \
+vecname: .word 0x10000014 ; \
+ .word 0 ; \
+ .word ((__SWAPW(BIENDIAN_LE_BASE >> 16)) << 16) | 0x1A3C ; \
+ .word (0x00005A27 | (((addr) & 0xFF) << 24) | (((addr) & 0xFF00) << 8)) ; \
+ .word 0x08004003 ; \
+ .word 0 ; \
+ .org ((addr) + 0x54) ; \
+ b vecdest ; \
+ nop;
+
+#define BIENDIAN_XVECTOR(addr,vecname,vecdest,code) \
+ .globl vecname ; \
+ .org addr ; \
+vecname: .word 0x10000014 ; \
+ .word 0 ; \
+ .word ((__SWAPW(BIENDIAN_LE_BASE >> 16)) << 16) | 0x1A3C ; \
+ .word (0x00005A27 | (((addr) & 0xFF) << 24) | (((addr) & 0xFF00) << 8)) ; \
+ .word 0x08004003 ; \
+ .word 0 ; \
+ .org ((addr) + 0x54) ; \
+ b vecdest ; \
+ li k0,code ; \
+ nop;
+
+
+
+/* *********************************************************************
+ * Declare the right versions of DECLARE_VECTOR and
+ * DECLARE_XVECTOR depending on how we're building stuff.
+ * Generally, we only use the biendian version if we're building
+ * as CFG_BIENDIAN=1 and we're doing the big-endian MIPS version.
+ ********************************************************************* */
+
+#if (CFG_BIENDIAN) && defined(__MIPSEB)
+#define DECLARE_VECTOR BIENDIAN_VECTOR
+#define DECLARE_XVECTOR BIENDIAN_XVECTOR
+#else
+#define DECLARE_VECTOR NORMAL_VECTOR
+#define DECLARE_XVECTOR NORMAL_XVECTOR
+#endif
+
+
+
+/* *********************************************************************
+ * LOADREL(reg,label)
+ *
+ * Load the address of a label, but do it in a position-independent
+ * way.
+ *
+ * Input parameters:
+ * reg - register to load
+ * label - label whose address to load
+ *
+ * Return value:
+ * ra is trashed!
+ ********************************************************************* */
+
+#if (!(CFG_RAMAPP))
+#define LOADREL(reg,label) \
+ la reg, label ; \
+ la ra, 100f ; \
+ sub reg, ra ; \
+ .set push ; \
+ .set noreorder ; \
+ bal 100f ; \
+ nop ; \
+ .set pop ; \
+100: ; \
+ addu reg, ra
+#else
+#define LOADREL(reg,label) \
+ la reg,label
+#endif
+
+#if (CFG_RAMAPP)
+#define FIXUP(addr)
+#else
+#define FIXUP(addr) \
+ addu addr, s6
+#endif
+
+
+
+/* *********************************************************************
+ * CALLINIT_KSEG1(label,table,offset)
+ * CALLINIT_KSEG0(label,table,offset)
+ *
+ * Call an initialization routine (usually in another module).
+ * If initialization routine lives in KSEG1 it may need
+ * special fixing if using the cached version of CFE (this is
+ * the default case). CFE is linked at a KSEG0 address.
+ *
+ * Embedded PIC is especially tricky, since the "la"
+ * instruction expands to calculations involving GP.
+ * In that case, use our table of offsets to
+ * load the routine address from a table in memory.
+ *
+ * Input parameters:
+ * label - routine to call if we can call directly
+ * table - symbol name of table containing routine addresses
+ * offset - offset within the above table
+ *
+ * Return value:
+ * k1,ra is trashed.
+ ********************************************************************* */
+
+
+#if CFG_RUNFROMKSEG0
+/* Cached PIC code - call indirect through table */
+#define CALLINIT_KSEG1(table,tableoffset) \
+ LOADREL(k1,table) ; \
+ or k1,K1BASE ; \
+ LR k1,tableoffset(k1) ; \
+ FIXUP (k1); \
+ or k1,K1BASE ; \
+ jal k1
+#define CALLINIT_KSEG0(table,tableoffset) \
+ LOADREL(k1,table) ; \
+ LR k1,tableoffset(k1) ; \
+ FIXUP (k1); \
+ jal k1
+#else
+/* Uncached PIC code - call indirect through table, always same KSEG */
+#define CALLINIT_KSEG1(table,tableoffset) \
+ LOADREL(k1,table) ; \
+ LR k1,tableoffset(k1) ; \
+ FIXUP (k1); \
+ jal k1
+#define CALLINIT_KSEG0 CALLINIT_KSEG1
+#endif
+
+/*
+ * CALLINIT_RELOC is used once CFE's relocation is complete and
+ * the "mem_textreloc" variable is set up. (yes, this is nasty.)
+ * If 'gp' is set, we can presume that we've relocated
+ * and it's safe to read "mem_textreloc", otherwise use the
+ * address as-is from the table.
+ */
+
+#define CALLINIT_RELOC CALLINIT_KSEG0
+
+/* *********************************************************************
+ * SPIN_LOCK(lock,reg1,reg2)
+ *
+ * Acquire a spin lock.
+ *
+ * Input parameters:
+ * lock - symbol (address) of lock to acquire
+ * reg1,reg2 - registers we can use to acquire lock
+ *
+ * Return value:
+ * nothing (lock acquired)
+ ********************************************************************* */
+
+#define SPIN_LOCK(lock,reg1,reg2) \
+ la reg1,lock ; \
+1: sync ; \
+ ll reg2,0(reg1) ; \
+ bne reg2,zero,1b ; \
+ li reg2,1 ; \
+ sc reg2,0(reg1) ; \
+ beq reg2,zero,1b ; \
+ nop
+
+/* *********************************************************************
+ * SPIN_UNLOCK(lock,reg1)
+ *
+ * Release a spin lock.
+ *
+ * Input parameters:
+ * lock - symbol (address) of lock to release
+ * reg1 - a register we can use
+ *
+ * Return value:
+ * nothing (lock released)
+ ********************************************************************* */
+
+
+#define SPIN_UNLOCK(lock,reg1) \
+ la reg1,lock ; \
+ sw zero,0(reg1)
+
+
+/* *********************************************************************
+ * SETCCAMODE(treg,mode)
+ *
+ * Set cacheability mode. For some of the pass1 workarounds we
+ * do this alot, so here's a handy macro.
+ *
+ * Input parameters:
+ * treg - temporary register we can use
+ * mode - new mode (K_CFG_K0COH_xxx)
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+#define SETCCAMODE(treg,mode) \
+ mfc0 treg,C0_CONFIG ; \
+ srl treg,treg,3 ; \
+ sll treg,treg,3 ; \
+ or treg,treg,mode ; \
+ mtc0 treg,C0_CONFIG ; \
+ HAZARD
+
+
+/* *********************************************************************
+ * Declare variables
+ ********************************************************************* */
+
+#define DECLARE_LONG(x) \
+ .global x ; \
+x: _LONG_ 0
+
+
+
+
+/*
+ * end
+ */
diff --git a/cfe/cfe/arch/mips/common/include/segtable.h b/cfe/cfe/arch/mips/common/include/segtable.h
new file mode 100755
index 0000000..8a003f0
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/include/segtable.h
@@ -0,0 +1,97 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Segment Table definitions File: segtable.h
+ *
+ * The 'segment table' (bad name) is just a list of addresses
+ * of important stuff used during initialization. We use these
+ * indirections to make life less complicated during code
+ * relocation.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#if !defined(__ASSEMBLER__)
+#define _TBLIDX(x) (x) /* C handles indexing for us */
+typedef long segtable_t; /* 32 for long32, 64 for long64 */
+#endif
+
+/*
+ * Definitions for the segment_table
+ */
+
+#define R_SEG_ETEXT _TBLIDX(0) /* end of text segment */
+#define R_SEG_FDATA _TBLIDX(1) /* Beginning of data segment */
+#define R_SEG_EDATA _TBLIDX(2) /* end of data segment */
+#define R_SEG_END _TBLIDX(3) /* End of BSS */
+#define R_SEG_FTEXT _TBLIDX(4) /* Beginning of text segment */
+#define R_SEG_FBSS _TBLIDX(5) /* Beginning of BSS */
+#define R_SEG_GP _TBLIDX(6) /* Global Pointer */
+#define R_SEG_RELOCSTART _TBLIDX(7) /* Start of reloc table */
+#define R_SEG_RELOCEND _TBLIDX(8) /* End of reloc table */
+#define R_SEG_APIENTRY _TBLIDX(9) /* API Entry address */
+
+/*
+ * Definitions for the init_table
+ */
+
+#define R_INIT_EARLYINIT _TBLIDX(0) /* pointer to board_earlyinit */
+#define R_INIT_SETLEDS _TBLIDX(1) /* pointer to board_setleds */
+#define R_INIT_DRAMINFO _TBLIDX(2) /* pointer to board_draminfo */
+#define R_INIT_CPUINIT _TBLIDX(3) /* pointer tp cpuinit */
+#define R_INIT_ALTCPU_START1 _TBLIDX(4) /* pointer to altcpu_start1 */
+#define R_INIT_ALTCPU_START2 _TBLIDX(5) /* pointer to altcpu_start2 */
+#define R_INIT_ALTCPU_RESET _TBLIDX(6) /* pointer to altcpu_reset */
+#define R_INIT_CPURESTART _TBLIDX(7) /* pointer to cpurestart */
+#define R_INIT_DRAMINIT _TBLIDX(8) /* pointer to draminit */
+#define R_INIT_CACHEOPS _TBLIDX(9) /* pointer to cacheops */
+#define R_INIT_TLBHANDLER _TBLIDX(10) /* pointer to TLB fault handler */
+#define R_INIT_CMDSTART _TBLIDX(11) /* pointer to cfe_main */
+#define R_INIT_CMDRESTART _TBLIDX(12) /* pointer to cfe_cmd_restart */
+#define R_INIT_DOXREQ _TBLIDX(13) /* pointer to cfe_doxreq */
+#define R_INIT_TP1_SWITCH _TBLIDX(14) /* pointer to tp1_switch */
+#define R_INIT_SIZERAM _TBLIDX(15) /* pointer to board_sizeram */
+
+/*
+ * Definitions for the diag_table
+ */
+
+#define R_DIAG_TEST1 _TBLIDX(0) /* after CPU and cache init, before DRAM init */
+#define R_DIAG_TEST2 _TBLIDX(1) /* after DRAM init, before main */
diff --git a/cfe/cfe/arch/mips/common/src/Makefile b/cfe/cfe/arch/mips/common/src/Makefile
new file mode 100755
index 0000000..638113d
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/Makefile
@@ -0,0 +1,38 @@
+
+#
+# This is just a Makefile fragment -- it is included by the master
+# makefile, cfe.mk
+#
+# This file should just append object file names to "ALLOBJS",
+# but since it is mean to be linked *first*, it will append
+# modules to "CRT0OBJS"
+#
+
+ifndef INIT_MIPS
+INIT_MIPS = init_mips.o
+endif
+
+ifeq ($(strip ${CFG_RAMAPP}),1)
+CRT0OBJS += init_ram.o exception.o
+else
+CRT0OBJS += $(INIT_MIPS)
+endif
+
+ifeq ($(strip ${CFG_RAMAPP}),1)
+ALLOBJS += lib_hssubr.o lib_setjmp.o mips_arena.o exchandler.o
+ALLOBJS += dev_flash_all.o dev_flashop_engine.o
+ALLOBJS += ui_memtest.o
+endif
+
+makereg : ${TOP}/hosttools/makereg.c
+ gcc -o makereg ${TOP}/hosttools/makereg.c
+
+%.inc : %.regdef makereg
+ ./makereg $< $@
+
+ui_soccmds.o : ${CPU_SRC}/ui_soccmds.c ${CPU}_socregs.inc
+
+vapi.o : ${TOP}/verif/vapi.S sb1250_socregs.inc
+
+
+
diff --git a/cfe/cfe/arch/mips/common/src/cfe_ram_cached.lds b/cfe/cfe/arch/mips/common/src/cfe_ram_cached.lds
new file mode 100644
index 0000000..4b8ce87
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/cfe_ram_cached.lds
@@ -0,0 +1,40 @@
+OUTPUT_ARCH(mips)
+ENTRY(vec_reset)
+SECTIONS
+{
+ . = 0x9fc00000; /* was 0x9fc00000 */
+ .text :
+/* AT ( 0xBFC00000 ) */ /* was 0xbfc00000 */
+ {
+ _ftext = . ;
+ *(.init)
+ eprol = .;
+ *(.text)
+ *(.fini)
+ *(.rodata)
+ _etext = .;
+ }
+
+ .data :
+ {
+ _fdata = ALIGN(16) ;
+ *(.data)
+ CONSTRUCTORS
+ . = ALIGN(16);
+ _gp = . + 0x8000;
+ *(.sdata)
+ }
+ . = ALIGN(16);
+ _edata = .;
+ _fbss = .;
+ .sbss : {
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss : {
+ *(.bss)
+ *(COMMON)
+ }
+ . = ALIGN(16);
+ _end = .;
+}
diff --git a/cfe/cfe/arch/mips/common/src/cfe_ram_uncached.lds b/cfe/cfe/arch/mips/common/src/cfe_ram_uncached.lds
new file mode 100644
index 0000000..4295fe4
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/cfe_ram_uncached.lds
@@ -0,0 +1,40 @@
+OUTPUT_ARCH(mips)
+ENTRY(vec_reset)
+SECTIONS
+{
+ . = 0xbfc00000; /* was 0x9fc00000 */
+ .text :
+/* AT ( 0xBFC00000 ) */ /* was 0xbfc00000 */
+ {
+ _ftext = . ;
+ *(.init)
+ eprol = .;
+ *(.text)
+ *(.fini)
+ *(.rodata)
+ _etext = .;
+ }
+
+ .data :
+ {
+ _fdata = ALIGN(16) ;
+ *(.data)
+ CONSTRUCTORS
+ . = ALIGN(16);
+ _gp = . + 0x8000;
+ *(.sdata)
+ }
+ . = ALIGN(16);
+ _edata = .;
+ _fbss = .;
+ .sbss : {
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss : {
+ *(.bss)
+ *(COMMON)
+ }
+ . = ALIGN(16);
+ _end = .;
+}
diff --git a/cfe/cfe/arch/mips/common/src/cfe_ramapp.lds b/cfe/cfe/arch/mips/common/src/cfe_ramapp.lds
new file mode 100755
index 0000000..5a7a377
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/cfe_ramapp.lds
@@ -0,0 +1,41 @@
+OUTPUT_ARCH(mips)
+ENTRY(vec_reset)
+SECTIONS
+{
+ . = 0x80601000;
+ .text :
+ {
+ _ftext = . ;
+ *(.init)
+ eprol = .;
+ *(.text)
+ *(.fini)
+ *(.rodata)
+ *(.rodata.str1.4)
+ *(.gnu.linkonce.r.*)
+ _etext = .;
+ }
+
+ .data :
+ {
+ _fdata = ALIGN(16) ;
+ *(.data)
+ CONSTRUCTORS
+ . = ALIGN(16);
+ _gp = . + 0x8000;
+ *(.sdata)
+ }
+ . = ALIGN(16);
+ _edata = .;
+ _fbss = .;
+ .sbss : {
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss : {
+ *(.bss)
+ *(COMMON)
+ }
+ . = ALIGN(16);
+ _end = .;
+}
diff --git a/cfe/cfe/arch/mips/common/src/cfe_rom_cached.lds b/cfe/cfe/arch/mips/common/src/cfe_rom_cached.lds
new file mode 100755
index 0000000..2ca1353
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/cfe_rom_cached.lds
@@ -0,0 +1,40 @@
+OUTPUT_ARCH(mips)
+ENTRY(vec_reset)
+SECTIONS
+{
+ . = 0x80000000;
+ .text :
+ {
+ _ftext = . ;
+ *(.init)
+ eprol = .;
+ *(.text)
+ *(.fini)
+ *(.rodata)
+ _etext = .;
+ }
+
+ .data :
+ {
+ _fdata = ALIGN(16) ;
+ *(.data)
+ CONSTRUCTORS
+ . = ALIGN(16);
+ _gp = . + 0x8000;
+ *(.sdata)
+ }
+ . = ALIGN(16);
+ _edata = .;
+ .reginfo : {}
+ _fbss = .;
+ .sbss : {
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss : {
+ *(.bss)
+ *(COMMON)
+ }
+ . = ALIGN(16);
+ _end = .;
+}
diff --git a/cfe/cfe/arch/mips/common/src/cfe_rom_reloc_cached.lds b/cfe/cfe/arch/mips/common/src/cfe_rom_reloc_cached.lds
new file mode 100644
index 0000000..ee94831
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/cfe_rom_reloc_cached.lds
@@ -0,0 +1,43 @@
+OUTPUT_ARCH(mips)
+ENTRY(vec_reset)
+SECTIONS
+{
+ . = 0x9FC00000;
+ .text :
+ AT ( 0xBFC00000 )
+ {
+ _ftext = . ;
+ *(.init)
+ eprol = .;
+ *(.text)
+ PROVIDE (__runtime_reloc_start = .);
+ *(.rel.sdata)
+ PROVIDE (__runtime_reloc_stop = .);
+ *(.fini)
+ *(.rodata)
+ _etext = .;
+ }
+ .data 0x80001000 :
+ AT ( ((ADDR(.text)|0xB0000000) + SIZEOF ( .text ) + 15) & 0xFFFFFFF0)
+ {
+ _gp = ALIGN(16) + 0x8000;
+ _fdata = .;
+ *(.rdata)
+ *(.data)
+ CONSTRUCTORS
+ *(.sdata)
+ }
+ . = ALIGN(16);
+ _edata = .;
+ _fbss = .;
+ .sbss : {
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss : {
+ *(.bss)
+ *(COMMON)
+ }
+ . = ALIGN(16);
+ _end = .;
+}
diff --git a/cfe/cfe/arch/mips/common/src/cfe_rom_reloc_cached_biendian.lds b/cfe/cfe/arch/mips/common/src/cfe_rom_reloc_cached_biendian.lds
new file mode 100644
index 0000000..78421a4
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/cfe_rom_reloc_cached_biendian.lds
@@ -0,0 +1,49 @@
+/*
+ * This linker script is exactly the same as cfe_rom_reloc_cached.lds
+ * except our start address is at BFD00000, 1MB into the
+ * ROM. We locate the little-endian version of CFE at this address
+ * in bi-endian ROM support.
+ */
+OUTPUT_ARCH(mips)
+ENTRY(vec_reset)
+SECTIONS
+{
+ . = 0x9FD00000;
+ .text :
+ AT ( 0xBFD00000 )
+ {
+ _ftext = . ;
+ *(.init)
+ eprol = .;
+ *(.text)
+ PROVIDE (__runtime_reloc_start = .);
+ *(.rel.sdata)
+ PROVIDE (__runtime_reloc_stop = .);
+ *(.fini)
+ *(.rodata)
+ _etext = .;
+ }
+ .data 0x80001000 :
+ AT ( ((ADDR(.text)|0xB0000000) + SIZEOF ( .text ) + 15) & 0xFFFFFFF0)
+ {
+ _gp = ALIGN(16) + 0x8000;
+ _fdata = .;
+ *(.rdata)
+ *(.data)
+ CONSTRUCTORS
+ *(.sdata)
+ }
+ . = ALIGN(16);
+ _edata = .;
+ _fbss = .;
+ .sbss : {
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss : {
+ *(.bss)
+ *(COMMON)
+ }
+ . = ALIGN(16);
+ _end = .;
+}
diff --git a/cfe/cfe/arch/mips/common/src/cfe_rom_reloc_uncached.lds b/cfe/cfe/arch/mips/common/src/cfe_rom_reloc_uncached.lds
new file mode 100644
index 0000000..0c62889
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/cfe_rom_reloc_uncached.lds
@@ -0,0 +1,41 @@
+OUTPUT_ARCH(mips)
+ENTRY(vec_reset)
+SECTIONS
+{
+ . = 0xBFC00000;
+ .text : {
+ _ftext = . ;
+ *(.init)
+ eprol = .;
+ *(.text)
+ PROVIDE (__runtime_reloc_start = .);
+ *(.rel.sdata)
+ PROVIDE (__runtime_reloc_stop = .);
+ *(.fini)
+ *(.rodata)
+ _etext = .;
+ }
+ .data 0xA0001000 :
+ AT ( ((ADDR(.text)|0xB0000000) + SIZEOF ( .text ) + 15) & 0xFFFFFFF0)
+ {
+ _gp = ALIGN(16) + 0x8000;
+ _fdata = .;
+ *(.rdata)
+ *(.data)
+ CONSTRUCTORS
+ *(.sdata)
+ }
+ . = ALIGN(16);
+ _edata = .;
+ _fbss = .;
+ .sbss : {
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss : {
+ *(.bss)
+ *(COMMON)
+ }
+ . = ALIGN(16);
+ _end = .;
+}
diff --git a/cfe/cfe/arch/mips/common/src/cfe_rom_uncached.lds b/cfe/cfe/arch/mips/common/src/cfe_rom_uncached.lds
new file mode 100644
index 0000000..a0362ba
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/cfe_rom_uncached.lds
@@ -0,0 +1,39 @@
+OUTPUT_ARCH(mips)
+ENTRY(vec_reset)
+SECTIONS
+{
+ . = 0xBFC00000;
+ .text : {
+ _ftext = . ;
+ *(.init)
+ eprol = .;
+ *(.text)
+ *(.fini)
+ *(.rodata)
+ _etext = .;
+ }
+
+ .data 0xA1F00000 :
+ AT ( ((ADDR(.text)|0xB0000000) + SIZEOF ( .text ) + 15) & 0xFFFFFFF0)
+ {
+ _fdata = ALIGN(16) ;
+ *(.data)
+ CONSTRUCTORS
+ . = ALIGN(16);
+ _gp = . + 0x8000;
+ *(.sdata)
+ }
+ . = ALIGN(16);
+ _edata = .;
+ _fbss = .;
+ .sbss : {
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss : {
+ *(.bss)
+ *(COMMON)
+ }
+ . = ALIGN(16);
+ _end = .;
+}
diff --git a/cfe/cfe/arch/mips/common/src/dev_flash_all.S b/cfe/cfe/arch/mips/common/src/dev_flash_all.S
new file mode 100644
index 0000000..6dbb581
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/dev_flash_all.S
@@ -0,0 +1,220 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Flash "self-write" module File: flash_write_all.S
+ *
+ * This module takes care of the case of writing to the flash
+ * memory that CFE is currently reading its code from. It is
+ * assumed that you'll be doing a complete flash update,
+ * so this code erases the affected sectors, reprograms them,
+ * and jumps to the boot sector.
+ *
+ * Note: this code is written to be position-independent, even
+ * for non-PIC versions of CFE! It will be copied (with memcpy)
+ * into the heap for execution.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "sbmips.h"
+#include "dev_flash.h"
+#include "mipsmacros.h"
+
+#define WRITEFLASH(base,offset,value) \
+ li t0,value ; \
+ sb t0,offset(base)
+
+
+/* *********************************************************************
+ * flash_write_all(data,flashbase,size,secsize)
+ *
+ * Write bytes to flash, erasing affected sectors first.
+ *
+ * Input parameters:
+ * a0 - data - pointer to data to write
+ * a1 - flashbase - base (phys addr) of flash area
+ * a2 - size - number of bytes to write
+ * a3 - secsize - flash sector size
+ *
+ * Return value:
+ * does not return
+ ********************************************************************* */
+
+#define data a0
+#define flashbase a1
+#define datasize a2
+#define secsize a3
+
+#define secidx t4
+#define secptr t5
+
+LEAF(flash_write_all)
+
+ /*
+ * Mask all interrupts. An exception with BEV set would be very bad.
+ */
+
+ mfc0 v0,C0_SR # Get current interrupt flag
+ li v1,M_SR_IE # master interrupt control
+ not v1 # disable interrupts
+ and v0,v1 # SR now has IE=0
+ mtc0 v0,C0_SR # put back into CP0
+
+ /*
+ * Get KSEG1 addr of flash
+ */
+
+ or flashbase,K1BASE
+
+
+ /*
+ * Do an "unlock write" sequence (cycles 1-2)
+ */
+
+ WRITEFLASH(flashbase,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1)
+ WRITEFLASH(flashbase,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2)
+
+ /*
+ * send the erase command (cycle 3)
+ */
+
+ WRITEFLASH(flashbase,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_ERASE_3)
+
+ /*
+ * Do an "unlock write" sequence (cycles 4-5)
+ */
+
+ WRITEFLASH(flashbase,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1)
+ WRITEFLASH(flashbase,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2)
+
+ /*
+ * Send the "erase all" qualifier (cycle 6)
+ */
+
+ WRITEFLASH(flashbase,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_ERASE_ALL_6)
+
+ /*
+ * Wait for the erase to complete
+ */
+
+1: lb t0,0(secptr) # get byte
+ and t0,0xFF # test hi byte
+ bne t0,0xFF,1b # go till bit is set
+
+
+ /*
+ * Okay, now loop through the bytes and write them to the
+ * flash.
+ */
+
+ move secptr,flashbase
+ move secidx,datasize
+
+proglp:
+
+ /*
+ * Do an "unlock write" sequence
+ */
+
+ WRITEFLASH(flashbase,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1)
+ WRITEFLASH(flashbase,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2)
+
+ /*
+ * Send a program command
+ */
+ WRITEFLASH(flashbase,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_PROGRAM)
+
+ /*
+ * Write a byte
+ */
+
+ lbu t0,0(data)
+ sb t0,0(secptr) # t0 = byte written to flash
+
+
+ /*
+ * Wait for write to complete
+ */
+
+1: lbu t2,0(secptr) # t2 = byte from flash
+
+ and t1,t2,0x80 # done if bit7 of flash
+ and t0,t0,0x80 # is same as bit7 of data
+ beq t1,t0,2f
+
+ and t1,t2,0x20 # not done if bit5
+ bne t1,0x20,1b # is still set
+2:
+
+ /*
+ * next byte...
+ */
+
+ add a0,1 # next source byte
+ add secptr,1 # next dest byte
+ sub datasize,1 # one less count
+ bgt datasize,0,proglp
+
+ /*
+ * All done, reboot system
+ */
+
+ li v0,0xBFC00000
+ j v0
+
+flash_write_all_end:
+ nop
+
+END(flash_write_all)
+
+/* *********************************************************************
+ * Data
+ ********************************************************************* */
+
+ .sdata
+
+ .globl flash_write_all_ptr
+ .globl flash_write_all_len
+
+flash_write_all_ptr:
+ _VECT_ flash_write_all
+flash_write_all_len:
+ .word flash_write_all_end-flash_write_all
+
+
diff --git a/cfe/cfe/arch/mips/common/src/dev_flashop_engine.S b/cfe/cfe/arch/mips/common/src/dev_flashop_engine.S
new file mode 100644
index 0000000..29ade6a
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/dev_flashop_engine.S
@@ -0,0 +1,695 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Flash "self-write" module File: dev_flashop_engine.S
+ *
+ * This module takes care of the case of writing to the flash
+ * memory that CFE is currently reading its code from.
+ *
+ * Note: this code is written to be position-independent, even
+ * for non-PIC versions of CFE! It will be copied (with memcpy)
+ * into the heap for execution.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "sbmips.h"
+#include "mipsmacros.h"
+
+#include "bsp_config.h"
+#include "dev_newflash.h"
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#define FLASHCMD_8(base,offset,value) \
+ li t0,value ; \
+ sb t0,offset(base)
+
+#define FLASHCMD_16(base,offset,value) \
+ li t0,value ; \
+ sh t0,((offset)<<1)(base)
+
+#define FLASHCMD_16B(base,offset,value) \
+ li t0,value ; \
+ sb t0,((offset)<<1)(base)
+
+
+/* *********************************************************************
+ * flashop_engine
+ *
+ * This routine is written in a PIC method to allow us to do
+ * flash operations without any help from CFE. We need to do
+ * this when we're not relocated and want to muck with the
+ * flash we're running from.
+ *
+ * This routine follows some simple instructions in a table,
+ * so you can batch up the operations in one place.
+ *
+ * Input parameters:
+ * a0 - pointer to instruction list
+ *
+ * Return value:
+ * v0 - 0 if all instructions succeeded
+ * else less than zero, # of failing instructions
+ ********************************************************************* */
+
+ .text
+
+#define reg_op t3
+#define reg_base t4
+#define reg_dest t5
+#define reg_src t6
+#define reg_cnt t7
+
+LEAF(flashop_engine)
+
+instloop: LR reg_op,FEINST_OP(a0) /* Load instruction */
+ LR reg_base,FEINST_BASE(a0)
+ LR reg_dest,FEINST_DEST(a0)
+ LR reg_src,FEINST_SRC(a0)
+ LR reg_cnt,FEINST_CNT(a0)
+ li v0,0 /* total of result values */
+ li v1,0 /* result for this function */
+
+#ifdef __long64
+ dli t0,0x9000000000000000 /* uncached - XKPHYS */
+ or reg_base,t0 /* so we can access flash beyond KSEG */
+#else
+ or reg_base,K1BASE /* 32-bit, regular KSEG */
+#endif
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+ bne reg_op,FEOP_RETURN,99f /* Return to main prog */
+
+ j ra
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+99: bne reg_op,FEOP_REBOOT,99f /* restart system */
+
+ li t0,0xBFC00000 /* jump to boot vector */
+ j t0
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+99: bne reg_op,FEOP_READ8,99f /* Read, 8-bit mode */
+
+ ADD reg_src,reg_src,reg_base
+
+1: lbu t0,0(reg_src) /* Copy user data */
+ sb t0,0(reg_dest)
+ ADD reg_src,1
+ add reg_dest,1
+ sub reg_cnt,1
+ bgt reg_cnt,zero,1b
+
+ b nextinst
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+99: bne reg_op,FEOP_READ16,99f /* Read, 16-bit mode */
+
+ ADD reg_src,reg_src,reg_base
+
+ li t0,1 /* test bottom bit */
+ and t0,t0,reg_src /* t0 == 1 if odd */
+ beq t0,zero,1f /* no odd byte to worry about */
+
+ SUB reg_src,reg_src,t0 /* make even value */
+ lh t0,0(reg_src) /* interesting byte is odd */
+#ifdef __MIPSEB
+ sb t0,0(reg_dest) /* interesting byte in low 8 bits */
+#else
+ srl t0,t0,8 /* little endian */
+ sb t0,0(reg_dest) /* interesting byte is high 8 bits */
+#endif
+
+ ADD reg_src,2 /* advance one word (we made addr even above) */
+ add reg_dest,1 /* dest always written by bytes */
+ sub reg_cnt,1
+
+1: beq reg_cnt,zero,nextinst
+
+ lh t0,0(reg_src) /* Copy user data */
+
+#ifdef __MIPSEB
+ sb t0,1(reg_dest) /* Big endian to memory */
+ srl t0,t0,8 /* t0 = 0x1234 -> 0x12 0x34 */
+ sb t0,0(reg_dest)
+#else
+ sb t0,0(reg_dest) /* little endian */
+ srl t0,t0,8 /* t0 = 0x1234 -> 0x34 0x12 */
+ sb t0,1(reg_dest)
+#endif
+
+ ADD reg_src,2
+ add reg_dest,2
+ sub reg_cnt,2
+ bgt reg_cnt,1,1b
+
+ beq reg_cnt,zero,nextinst /* no straggler */
+
+ lh t0,0(reg_src) /* interesting byte is odd */
+#ifdef __MIPSEB
+ srl t0,t0,8 /* little endian */
+ sb t0,0(reg_dest) /* interesting byte in high 8 bits */
+#else
+ sb t0,0(reg_dest) /* interesting byte is low 8 bits */
+#endif
+
+ b nextinst
+/* CFI - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+#if (FLASH_DRIVERS & FLASH_DRIVER_CFI)
+99: bne reg_op,FEOP_CFIQUERY8,99f /* CFI Query 8-bit */
+
+ ADD reg_src,reg_src,reg_base
+
+ FLASHCMD_8(reg_base,FLASH_CFI_QUERY_ADDR,FLASH_CFI_QUERY_MODE)
+
+1: lbu t0,0(reg_src) /* Copy CFI data */
+ sb t0,0(reg_dest)
+ ADD reg_src,1
+ add reg_dest,1
+ sub reg_cnt,1
+ bgt reg_cnt,zero,1b
+
+ FLASHCMD_8(reg_base,FLASH_CFI_QUERY_ADDR,FLASH_CFI_QUERY_EXIT)
+
+ b nextinst
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+99: bne reg_op,FEOP_CFIQUERY16,99f /* CFI Query 16-bit in word mode */
+
+ ADD reg_src,reg_src,reg_base
+
+ FLASHCMD_16(reg_base,FLASH_CFI_QUERY_ADDR,FLASH_CFI_QUERY_MODE)
+
+1: lh t0,0(reg_src) /* Copy CFI data */
+ sh t0,0(reg_dest)
+ ADD reg_src,2
+ add reg_dest,2
+ sub reg_cnt,2
+ bgt reg_cnt,zero,1b
+
+ FLASHCMD_16(reg_base,FLASH_CFI_QUERY_ADDR,FLASH_CFI_QUERY_EXIT)
+
+ b nextinst
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+99: bne reg_op,FEOP_CFIQUERY16B,99f /* CFI Query 16-bit in byte mode */
+
+ ADD reg_src,reg_src,reg_base
+
+ FLASHCMD_16B(reg_base,FLASH_CFI_QUERY_ADDR,FLASH_CFI_QUERY_MODE)
+
+1: lb t0,0(reg_src) /* Copy CFI data */
+ sb t0,0(reg_dest)
+ ADD reg_src,1
+ add reg_dest,1
+ sub reg_cnt,1
+ bgt reg_cnt,zero,1b
+
+ FLASHCMD_16B(reg_base,FLASH_CFI_QUERY_ADDR,FLASH_CFI_QUERY_EXIT)
+
+ b nextinst
+#endif
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+99: bne reg_op,FEOP_MEMCPY,99f /* Generic memcpy */
+
+1: lbu t0,0(reg_src)
+ sb t0,0(reg_dest)
+ add reg_src,1
+ add reg_dest,1
+ sub reg_cnt,1
+ bgt reg_cnt,zero,1b
+
+ b nextinst
+
+
+/* AMD - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+#if (FLASH_DRIVERS & FLASH_DRIVER_AMD)
+99: bne reg_op,FEOP_AMD_ERASE8,99f /* AMD erase (8-bit) */
+
+ ADD reg_dest,reg_dest,reg_base
+
+ /* Do an "unlock write" sequence (cycles 1-2) */
+
+ FLASHCMD_8(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1)
+ FLASHCMD_8(reg_base,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2)
+
+ /* send the erase command (cycle 3) */
+
+ FLASHCMD_8(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_ERASE_3)
+
+ /* Do an "unlock write" sequence (cycles 4-5) */
+
+ FLASHCMD_8(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1)
+ FLASHCMD_8(reg_base,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2)
+
+ /* Send the "erase sector" qualifier (cycle 6) */
+
+ FLASHCMD_8(reg_dest,0,AMD_FLASH_ERASE_SEC_6)
+
+ /* Wait for the erase to complete */
+
+1: lb t0,0(reg_dest) # get byte
+ and t0,0xFF # test hi byte
+ bne t0,0xFF,1b # go till bit is set
+
+ b nextinst
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+99: bne reg_op,FEOP_AMD_ERASE16,99f /* AMD erase (16-bit in word mode) */
+
+ ADD reg_dest,reg_dest,reg_base
+
+ /* Do an "unlock write" sequence (cycles 1-2) */
+
+ FLASHCMD_16(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1)
+ FLASHCMD_16(reg_base,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2)
+
+ /* send the erase command (cycle 3) */
+
+ FLASHCMD_16(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_ERASE_3)
+
+ /* Do an "unlock write" sequence (cycles 4-5) */
+
+ FLASHCMD_16(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1)
+ FLASHCMD_16(reg_base,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2)
+
+ /* Send the "erase sector" qualifier (cycle 6) */
+
+ FLASHCMD_16(reg_dest,0,AMD_FLASH_ERASE_SEC_6)
+
+ /* Wait for the erase to complete */
+
+1: lh t0,0(reg_dest) # get word
+ and t0,0xFF # test byte
+ bne t0,0xFF,1b # go till erased
+
+ b nextinst
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+99: bne reg_op,FEOP_AMD_ERASE16B,99f /* AMD erase (16-bit in byte mode) */
+
+ ADD reg_dest,reg_dest,reg_base
+
+ /* Do an "unlock write" sequence (cycles 1-2) */
+
+ FLASHCMD_16B(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1)
+ FLASHCMD_16B(reg_base,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2)
+
+ /* send the erase command (cycle 3) */
+
+ FLASHCMD_16B(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_ERASE_3)
+
+ /* Do an "unlock write" sequence (cycles 4-5) */
+
+ FLASHCMD_16B(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1)
+ FLASHCMD_16B(reg_base,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2)
+
+ /* Send the "erase sector" qualifier (cycle 6) */
+
+ FLASHCMD_16B(reg_dest,0,AMD_FLASH_ERASE_SEC_6)
+
+ /* Wait for the erase to complete */
+
+1: lh t0,0(reg_dest) # get word
+ and t0,0xFF # test byte
+ bne t0,0xFF,1b # go till erased
+
+ b nextinst
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+99: bne reg_op,FEOP_AMD_PGM8,99f /* AMD 8-bit program */
+
+ ADD reg_dest,reg_dest,reg_base
+
+ /* Do an "unlock write" sequence (cycles 1-2) */
+11:
+ FLASHCMD_8(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1)
+ FLASHCMD_8(reg_base,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2)
+
+ /* Send a program command (cycle 3) */
+
+ FLASHCMD_8(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_PROGRAM)
+
+ /* Write a byte (cycle 4) */
+
+ lbu t0,0(reg_src)
+ sb t0,0(reg_dest) # t0 = byte written to flash
+
+ /* Wait for write to complete */
+
+1: lbu t2,0(reg_dest) # t2 = byte from flash
+
+ and t1,t2,0x80 # done if bit7 of flash
+ and t0,t0,0x80 # is same as bit7 of data
+ beq t1,t0,2f
+
+ and t1,t2,0x20 # not done if bit5
+ bne t1,0x20,1b # is still set
+2:
+
+ /* next byte... */
+
+ add reg_src,1 # next source byte
+ ADD reg_dest,1 # next dest byte
+ sub reg_cnt,1 # one less count
+ bgt reg_cnt,0,11b
+
+
+ b nextinst
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+99: bne reg_op,FEOP_AMD_PGM16,99f /* AMD 16-bit program */
+
+ ADD reg_dest,reg_dest,reg_base
+
+ /* Do an "unlock write" sequence (cycles 1-2) */
+11:
+ FLASHCMD_16(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1)
+ FLASHCMD_16(reg_base,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2)
+
+ /* Send a program command (cycle 3) */
+
+ FLASHCMD_16(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_PROGRAM)
+
+ /* Write a byte (cycle 4) */
+
+ lh t0,0(reg_src)
+ sh t0,0(reg_dest) # t0 = byte written to flash
+
+ /* Wait for write to complete */
+
+1: lh t2,0(reg_dest) # t2 = byte from flash
+
+ and t1,t2,0x80 # done if bit7 of flash
+ and t0,t0,0x80 # is same as bit7 of data
+ beq t1,t0,2f
+
+ and t1,t2,0x20 # not done if bit5
+ bne t1,0x20,1b # is still set
+2:
+
+ /* next byte... */
+
+ add reg_src,2 # next source word
+ ADD reg_dest,2 # next dest word
+ sub reg_cnt,2 # one less count
+ bgt reg_cnt,0,11b
+
+ b nextinst
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+99: bne reg_op,FEOP_AMD_PGM16B,99f /* AMD 16-bit pgm in 8-bit mode */
+
+ ADD reg_dest,reg_dest,reg_base
+
+ /* Do an "unlock write" sequence (cycles 1-2) */
+11:
+ FLASHCMD_16B(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1)
+ FLASHCMD_16B(reg_base,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2)
+
+ /* Send a program command (cycle 3) */
+
+ FLASHCMD_16B(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_PROGRAM)
+
+ /* Write a byte (cycle 4) */
+
+ lb t0,0(reg_src)
+ sb t0,0(reg_dest) # t0 = byte written to flash
+
+ /* Wait for write to complete */
+
+1: lb t2,0(reg_dest) # t2 = byte from flash
+
+ and t1,t2,0x80 # done if bit7 of flash
+ and t0,t0,0x80 # is same as bit7 of data
+ beq t1,t0,2f
+
+ and t1,t2,0x20 # not done if bit5
+ bne t1,0x20,1b # is still set
+2:
+
+ /* next byte... */
+
+ add reg_src,1 # next source word
+ ADD reg_dest,1 # next dest word
+ sub reg_cnt,1 # one less count
+ bgt reg_cnt,0,11b
+
+ b nextinst
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+99: bne reg_op,FEOP_AMD_DEVCODE8,99f /* AMD 8-bit - Boot Block Location */
+
+ ADD reg_src,reg_src,reg_base
+
+ FLASHCMD_8(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1)
+ FLASHCMD_8(reg_base,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2)
+ FLASHCMD_8(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_AUTOSEL)
+
+ lbu t0,AMD_FLASH_DEVCODE8(reg_src)
+ sb t0,0(reg_dest)
+ li t0,AMD_FLASH_RESET
+ sb t0,0(reg_src)
+
+
+ b nextinst
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+99: bne reg_op,FEOP_AMD_DEVCODE16,99f /* AMD 8-bit - Boot Block Location */
+
+ ADD reg_src,reg_src,reg_base
+
+ FLASHCMD_16(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1)
+ FLASHCMD_16(reg_base,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2)
+ FLASHCMD_16(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_AUTOSEL)
+
+ lw t0,0(reg_src)
+#ifdef __MIPSEB
+ srl t0,t0,8 /* ((3-AMD_FLASH_DEVCODE16)*8) */
+#else
+ srl t0,t0,16 /* (AMD_FLASH_DEVCODE16*8) */
+#endif
+ sb t0,0(reg_dest)
+ li t0,AMD_FLASH_RESET
+ sb t0,0(reg_src)
+
+ b nextinst
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+99: bne reg_op,FEOP_AMD_DEVCODE16B,99f /* AMD 8-bit - Boot Block Location */
+
+ ADD reg_src,reg_src,reg_base
+
+ FLASHCMD_16B(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1)
+ FLASHCMD_16B(reg_base,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2)
+ FLASHCMD_16B(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_AUTOSEL)
+
+ lw t0,0(reg_src)
+#ifdef __MIPSEB
+#else
+ srl t0,t0,16 /* (AMD_FLASH_DEVCODE16B*8)*/
+#endif
+
+ sb t0,0(reg_dest)
+ li t0,AMD_FLASH_RESET
+ sb t0,0(reg_src)
+
+ b nextinst
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+99: bne reg_op,FEOP_AMD_MANID8,99f /* AMD 8-bit - Boot Block Location */
+
+ ADD reg_src,reg_src,reg_base
+
+ FLASHCMD_8(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1)
+ FLASHCMD_8(reg_base,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2)
+ FLASHCMD_8(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_AUTOSEL)
+
+ lbu t0,AMD_FLASH_MANID(reg_src)
+ sb t0,0(reg_dest)
+ li t0,AMD_FLASH_RESET
+ sb t0,0(reg_src)
+
+
+ b nextinst
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+99: bne reg_op,FEOP_AMD_MANID16,99f /* AMD 8-bit - Boot Block Location */
+
+ ADD reg_src,reg_src,reg_base
+
+ FLASHCMD_16(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1)
+ FLASHCMD_16(reg_base,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2)
+ FLASHCMD_16(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_AUTOSEL)
+
+ lw t0,0(reg_src)
+#ifdef __MIPSEB
+ srl t0,t0,((3-AMD_FLASH_MANID)*8)
+#else
+ srl t0,t0,(AMD_FLASH_MANID*8)
+#endif
+ sb t0,0(reg_dest)
+ li t0,AMD_FLASH_RESET
+ sb t0,0(reg_src)
+
+ b nextinst
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+99: bne reg_op,FEOP_AMD_MANID16B,99f /* AMD 8-bit - Boot Block Location */
+
+ ADD reg_src,reg_src,reg_base
+
+ FLASHCMD_16B(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1)
+ FLASHCMD_16B(reg_base,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2)
+ FLASHCMD_16B(reg_base,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_AUTOSEL)
+
+ lbu t0,AMD_FLASH_MANID(reg_src)
+
+ sb t0,0(reg_dest)
+ li t0,AMD_FLASH_RESET
+ sb t0,0(reg_src)
+
+ b nextinst
+
+#endif
+
+/* INTEL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+#if (FLASH_DRIVERS & FLASH_DRIVER_INTEL)
+99: bne reg_op,FEOP_INTEL_ERASE8,99f /* Intel erase 8-bit */
+
+ ADD reg_dest,reg_dest,reg_base
+
+ FLASHCMD_8(reg_dest,0,INTEL_FLASH_ERASE_BLOCK)
+ FLASHCMD_8(reg_dest,0,INTEL_FLASH_ERASE_CONFIRM)
+
+1: lbu t0,0(reg_dest) /* loop till bit 7 is set */
+ andi t0,0x80
+ beq t0,zero,1b
+
+ FLASHCMD_8(reg_dest,0,INTEL_FLASH_READ_MODE)
+
+ b nextinst
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+99: bne reg_op,FEOP_INTEL_ERASE16,99f /* Intel erase 16-bit */
+
+ ADD reg_dest,reg_dest,reg_base
+
+/* XXX copy of 8-bit erase, is this right? */
+
+ FLASHCMD_8(reg_dest,0,INTEL_FLASH_ERASE_BLOCK)
+ FLASHCMD_8(reg_dest,0,INTEL_FLASH_ERASE_CONFIRM)
+
+1: lbu t0,0(reg_dest) /* loop till bit 7 is set */
+ andi t0,0x80
+ beq t0,zero,1b
+
+ FLASHCMD_8(reg_dest,0,INTEL_FLASH_READ_MODE)
+
+ b nextinst
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+99: bne reg_op,FEOP_INTEL_PGM8,99f /* Intel 8-bit program */
+
+ ADD reg_dest,reg_dest,reg_base
+
+11: FLASHCMD_8(reg_dest,0,INTEL_FLASH_PROGRAM)
+
+ lbu t0,0(reg_src)
+ sb t0,0(reg_dest)
+
+1: lbu t0,0(reg_dest) /* loop till bit 7 is set */
+ andi t0,0x80
+ beq t0,zero,1b
+
+ lbu t0,0(reg_dest) /* contains final result */
+ /* If good, bits 1, 3, 4 will not be set */
+
+ add reg_src,1
+ ADD reg_dest,1
+ sub reg_cnt,1
+ bgt reg_cnt,zero,11b
+
+ FLASHCMD_8(reg_dest,0,INTEL_FLASH_READ_MODE)
+
+ b nextinst
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+99: bne reg_op,FEOP_INTEL_PGM16,99f /* Intel 16-bit prog */
+
+ ADD reg_dest,reg_dest,reg_base
+
+11: FLASHCMD_16(reg_dest,0,INTEL_FLASH_PROGRAM)
+
+ lh t0,0(reg_src)
+ sh t0,0(reg_dest)
+
+1: lh t0,0(reg_dest) /* loop till bit 7 is set */
+ andi t0,0x80
+ beq t0,zero,1b
+
+ lh t0,0(reg_dest) /* contains final result */
+ /* If good, bits 1, 3, 4 will not be set */
+
+ add reg_src,2
+ ADD reg_dest,2
+ sub reg_cnt,2
+ bgt reg_cnt,zero,11b
+
+ FLASHCMD_16(reg_dest,0,INTEL_FLASH_READ_MODE)
+
+ b nextinst
+#endif
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+99: li v1,-1 /* invalid command */
+
+nextinst: SR v1,FEINST_RESULT(a0) /* store result of instruction */
+ ADD v0,v0,v1 /* add to total */
+ ADD a0,FEINST_SIZE /* advance to next instr. */
+ b instloop
+
+flashop_engine_end:
+ nop
+
+END(flashop_engine)
+
+ .sdata
+
+ .globl flashop_engine_ptr
+ .globl flashop_engine_len
+
+flashop_engine_ptr:
+ _VECT_ flashop_engine
+flashop_engine_len:
+ .word flashop_engine_end-flashop_engine
+
+
+
+/* *********************************************************************
+ * end
+ ********************************************************************* */
+
+
diff --git a/cfe/cfe/arch/mips/common/src/disasm.c b/cfe/cfe/arch/mips/common/src/disasm.c
new file mode 100644
index 0000000..1b76fee
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/disasm.c
@@ -0,0 +1,2111 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * MIPS disassembler File: disasm.c
+ *
+ * MIPS disassembler (used by ui_examcmds.c)
+ *
+ * Author: Justin Carlson (carlson@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "disasm.h"
+#include "lib_printf.h"
+
+#define UINT64_T(x) ((uint64_t) (x))
+#define PF_64 "ll"
+#define PF_32 ""
+/* These aren't guaranteed to be portable, either */
+#define SEXT_32(bit, val) \
+ ((((int32_t)(val))<<(31-(bit)))>>(31-(bit)))
+#define SEXT_64(bit, val) \
+ ((((int64_t)(val))<<(63-(bit)))>>(63-(bit)))
+
+#define DATASEG __attribute__ ((section(".text")))
+
+
+#define REGNAME(r) (&_regnames[(r)*5])
+static const char * const _regnames =
+ "zero\0"
+ "AT\0 "
+ "v0\0 "
+ "v1\0 "
+ "a0\0 "
+ "a1\0 "
+ "a2\0 "
+ "a3\0 "
+ "t0\0 "
+ "t1\0 "
+ "t2\0 "
+ "t3\0 "
+ "t4\0 "
+ "t5\0 "
+ "t6\0 "
+ "t7\0 "
+ "s0\0 "
+ "s1\0 "
+ "s2\0 "
+ "s3\0 "
+ "s4\0 "
+ "s5\0 "
+ "s6\0 "
+ "s7\0 "
+ "t8\0 "
+ "t9\0 "
+ "k0\0 "
+ "k1\0 "
+ "gp\0 "
+ "sp\0 "
+ "fp\0 "
+ "ra\0 ";
+
+#define CP0REGNAME(r) (&_cp0names[(r)*12])
+static const char * const _cp0names =
+ "C0_INX\0 "
+ "C0_RAND\0 "
+ "C0_TLBLO0\0 "
+ "C0_TLBLO1\0 "
+
+ "C0_CTEXT\0 "
+ "C0_PGMASK\0 "
+ "C0_WIRED\0 "
+ "C0_reserved\0"
+
+ "C0_BADVADDR\0"
+ "C0_COUNT\0 "
+ "C0_TLBHI\0 "
+ "C0_COMPARE\0 "
+
+ "C0_SR\0 "
+ "C0_CAUSE\0 "
+ "C0_EPC\0 "
+ "C0_PRID\0 "
+
+ "C0_CONFIG\0 "
+ "C0_LLADDR\0 "
+ "C0_WATCHLO\0 "
+ "C0_WATCHHI\0 "
+
+ "C0_XCTEXT\0 "
+ "C0_reserved\0"
+ "C0_reserved\0"
+ "C0_reserved\0"
+
+ "C0_reserved\0"
+ "C0_reserved\0"
+ "C0_reserved\0"
+ "C0_reserved\0"
+
+ "C0_TAGLO\0 "
+ "C0_TAGHI\0 "
+ "C0_ERREPC\0 "
+ "C0_reserved\0";
+
+
+
+/*
+ * MIPS instruction set disassembly module.
+ */
+
+typedef enum {
+ DC_RD_RS_RT,
+ DC_RD_RT_RS,
+ DC_RT_RS_SIMM,
+ DC_RT_RS_XIMM,
+ DC_RS_RT_OFS,
+ DC_RS_OFS,
+ DC_RD_RT_SA,
+ DC_RT_UIMM,
+ DC_RD,
+ DC_J,
+ DC_RD_RS,
+ DC_RS_RT,
+ DC_RT_RS,
+ DC_RT_RD_SEL,
+ DC_RT_CR_SEL,
+ DC_RS,
+ DC_RS_SIMM,
+ DC_RT_OFS_BASE,
+ DC_FT_OFS_BASE,
+ DC_FD_IDX_BASE,
+ DC_FS_IDX_BASE,
+ DC_FD_FS_FT,
+ DC_FD_FS_RT,
+ DC_FD_FS,
+ DC_PREF_OFS,
+ DC_PREF_IDX,
+ DC_CC_OFS,
+ DC_FD_FS_CC,
+ DC_RD_RS_CC,
+ DC_FD_FR_FS_FT,
+ DC_FD_FS_FT_RS,
+ DC_CC_FS_FT,
+ DC_BARE,
+ DC_RT_FS,
+ DC_SYSCALL,
+ DC_BREAK,
+ DC_VD_VS_VT_VEC,
+ DC_VD_VS_VT,
+ DC_VS_VT,
+ DC_VS_VT_VEC,
+ DC_VD_VS_VT_RS,
+ DC_VD_VS_VT_IMM,
+ DC_VD_VT,
+ DC_VD,
+ DC_VS,
+ DC_DEREF,
+ DC_OOPS
+} DISASM_CLASS;
+
+
+
+
+/* We're pulling some trickery here. Most of the time, this structure operates
+ exactly as one would expect. The special case, when type == DC_DREF,
+ means name points to a byte that is an index into a dereferencing array. */
+
+/*
+ * To make matters worse, the whole module has been coded to reduce the
+ * number of relocations present, so we don't actually store pointers
+ * in the dereferencing array. Instead, we store fixed-width strings
+ * and use digits to represent indicies into the deref array.
+ *
+ * This is all to make more things fit in the relocatable version,
+ * since every initialized pointer goes into our small data segment.
+ */
+
+typedef struct {
+ char name[15];
+ char type;
+} disasm_t;
+
+typedef struct {
+ const disasm_t *ptr;
+ int shift;
+ uint32_t mask;
+} disasm_deref_t;
+
+/* Forward declaration of deref array, we need this for the disasm_t definitions */
+
+
+extern const disasm_deref_t disasm_deref[];
+
+static const disasm_t disasm_normal[64] DATASEG =
+{{"$1" , DC_DEREF },
+ {"$2" , DC_DEREF },
+ {"j" , DC_J },
+ {"jal" , DC_J },
+ {"beq" , DC_RS_RT_OFS },
+ {"bne" , DC_RS_RT_OFS },
+ {"blez" , DC_RS_OFS },
+ {"bgtz" , DC_RS_OFS },
+ {"addi" , DC_RT_RS_SIMM },
+ {"addiu" , DC_RT_RS_SIMM },
+ {"slti" , DC_RT_RS_SIMM },
+ {"sltiu" , DC_RT_RS_SIMM },
+ {"andi" , DC_RT_RS_XIMM },
+ {"ori" , DC_RT_RS_XIMM },
+ {"xori" , DC_RT_RS_XIMM },
+ {"lui" , DC_RT_UIMM },
+ {"$4" , DC_DEREF },
+ {"$6" , DC_DEREF },
+ {"invalid" , DC_BARE },
+ {"$15" , DC_DEREF },
+ {"beql" , DC_RS_RT_OFS },
+ {"bnel" , DC_RS_RT_OFS },
+ {"blezl" , DC_RS_OFS },
+ {"bgtzl" , DC_RS_OFS },
+ {"daddi" , DC_RT_RS_SIMM },
+ {"daddiu" , DC_RT_RS_SIMM },
+ {"ldl" , DC_RT_OFS_BASE },
+ {"ldr" , DC_RT_OFS_BASE },
+ {"$3" , DC_DEREF },
+ {"invalid" , DC_BARE },
+ {"$18" , DC_DEREF },
+ {"invalid" , DC_BARE },
+ {"lb" , DC_RT_OFS_BASE },
+ {"lh" , DC_RT_OFS_BASE },
+ {"lwl" , DC_RT_OFS_BASE },
+ {"lw" , DC_RT_OFS_BASE },
+ {"lbu" , DC_RT_OFS_BASE },
+ {"lhu" , DC_RT_OFS_BASE },
+ {"lwr" , DC_RT_OFS_BASE },
+ {"lwu" , DC_RT_OFS_BASE },
+ {"sb" , DC_RT_OFS_BASE },
+ {"sh" , DC_RT_OFS_BASE },
+ {"swl" , DC_RT_OFS_BASE },
+ {"sw" , DC_RT_OFS_BASE },
+ {"sdl" , DC_RT_OFS_BASE },
+ {"sdr" , DC_RT_OFS_BASE },
+ {"swr" , DC_RT_OFS_BASE },
+ {"cache" , DC_BARE },
+ {"ll" , DC_RT_OFS_BASE },
+ {"lwc1" , DC_FT_OFS_BASE },
+ {"invalid" , DC_BARE },
+ {"pref" , DC_PREF_OFS },
+ {"lld" , DC_RT_OFS_BASE },
+ {"ldc1" , DC_FT_OFS_BASE },
+ {"invalid" , DC_BARE },
+ {"ld" , DC_RT_OFS_BASE },
+ {"sc" , DC_RT_OFS_BASE },
+ {"swc1" , DC_FT_OFS_BASE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"scd" , DC_RT_OFS_BASE },
+ {"sdc1" , DC_FT_OFS_BASE },
+ {"invalid" , DC_BARE },
+ {"sd" , DC_RT_OFS_BASE }};
+
+static const disasm_t disasm_special[64] DATASEG =
+{{"sll" , DC_RD_RT_SA },
+ {"$16" , DC_DEREF },
+ {"srl" , DC_RD_RT_SA },
+ {"sra" , DC_RD_RT_SA },
+ {"sllv" , DC_RD_RT_RS },
+ {"invalid" , DC_BARE },
+ {"srlv" , DC_RD_RT_RS },
+ {"srav" , DC_RD_RT_RS },
+ {"jr" , DC_RS },
+ {"jalr" , DC_RD_RS },
+ {"movz" , DC_RD_RS_RT },
+ {"movn" , DC_RD_RS_RT },
+ {"syscall" , DC_SYSCALL },
+ {"break" , DC_BREAK },
+ {"invalid" , DC_BARE },
+ {"sync" , DC_BARE },
+ {"mfhi" , DC_RD },
+ {"mthi" , DC_RS },
+ {"mflo" , DC_RD },
+ {"mtlo" , DC_RS },
+ {"dsllv" , DC_RD_RT_RS },
+ {"invalid" , DC_BARE },
+ {"dsrlv" , DC_RD_RT_RS },
+ {"dsrav" , DC_RD_RT_RS },
+ {"mult" , DC_RS_RT },
+ {"multu" , DC_RS_RT },
+ {"div" , DC_RS_RT },
+ {"divu" , DC_RS_RT },
+ {"dmult" , DC_RS_RT },
+ {"dmultu" , DC_RS_RT },
+ {"ddiv" , DC_RS_RT },
+ {"ddivu" , DC_RS_RT },
+ {"add" , DC_RD_RS_RT },
+ {"addu" , DC_RD_RS_RT },
+ {"sub" , DC_RD_RS_RT },
+ {"subu" , DC_RD_RS_RT },
+ {"and" , DC_RD_RS_RT },
+ {"or" , DC_RD_RS_RT },
+ {"xor" , DC_RD_RS_RT },
+ {"nor" , DC_RD_RS_RT },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"slt" , DC_RD_RS_RT },
+ {"sltu" , DC_RD_RS_RT },
+ {"dadd" , DC_RD_RS_RT },
+ {"daddu" , DC_RD_RS_RT },
+ {"dsub" , DC_RD_RS_RT },
+ {"dsubu" , DC_RD_RS_RT },
+ {"tge" , DC_RS_RT },
+ {"tgeu" , DC_RS_RT },
+ {"tlt" , DC_RS_RT },
+ {"tltu" , DC_RS_RT },
+ {"teq" , DC_RS_RT },
+ {"invalid" , DC_BARE },
+ {"tne" , DC_RS_RT },
+ {"invalid" , DC_BARE },
+ {"dsll" , DC_RD_RT_SA },
+ {"invalid" , DC_BARE },
+ {"dsrl" , DC_RD_RT_SA },
+ {"dsra" , DC_RD_RT_SA },
+ {"dsll32" , DC_RD_RT_SA },
+ {"invalid" , DC_BARE },
+ {"dsrl32" , DC_RD_RT_SA },
+ {"dsra32" , DC_RD_RT_SA }};
+
+static const disasm_t disasm_movci[2] DATASEG =
+{{"movf" , DC_RD_RS_CC },
+ {"movt" , DC_RD_RS_CC }};
+
+static const disasm_t disasm_regimm[32] DATASEG =
+{{"bltz" , DC_RS_OFS },
+ {"bgez" , DC_RS_OFS },
+ {"bltzl" , DC_RS_OFS },
+ {"bgezl" , DC_RS_OFS },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"tgei" , DC_RS_SIMM },
+ {"tgeiu" , DC_RS_SIMM },
+ {"tlti" , DC_RS_SIMM },
+ {"tltiu" , DC_RS_SIMM },
+ {"teqi" , DC_RS_SIMM },
+ {"invalid" , DC_BARE },
+ {"tnei" , DC_RS_SIMM },
+ {"invalid" , DC_BARE },
+ {"bltzal" , DC_RS_OFS },
+ {"bgezal" , DC_RS_OFS },
+ {"bltzall" , DC_RS_OFS },
+ {"bgezall" , DC_RS_OFS },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE }};
+
+static const disasm_t disasm_spec2[64] DATASEG =
+{{"madd" , DC_RS_RT },
+ {"maddu" , DC_RS_RT },
+ {"mul" , DC_RD_RS_RT },
+ {"invalid" , DC_BARE },
+ {"msub" , DC_RS_RT },
+ {"msubu" , DC_RS_RT },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"clz" , DC_RT_RS },
+ {"clo" , DC_RT_RS },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"dclz" , DC_RT_RS },
+ {"dclo" , DC_RT_RS },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"sdbbp" , DC_BARE }};
+
+static const disasm_t disasm_cop0[32] DATASEG =
+{{"mfc0@1" , DC_RT_CR_SEL },
+ {"dmfc0@1" , DC_RT_CR_SEL },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"mtc0@1" , DC_RT_CR_SEL },
+ {"dmtc0@1" , DC_RT_CR_SEL },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"$5" , DC_DEREF },
+ {"$5" , DC_DEREF },
+ {"$5" , DC_DEREF },
+ {"$5" , DC_DEREF },
+ {"$5" , DC_DEREF },
+ {"$5" , DC_DEREF },
+ {"$5" , DC_DEREF },
+ {"$5" , DC_DEREF },
+ {"$5" , DC_DEREF },
+ {"$5" , DC_DEREF },
+ {"$5" , DC_DEREF },
+ {"$5" , DC_DEREF },
+ {"$5" , DC_DEREF },
+ {"$5" , DC_DEREF },
+ {"$5" , DC_DEREF },
+ {"$5" , DC_DEREF }};
+
+static const disasm_t disasm_cop0_c0[64] DATASEG =
+{{"invalid" , DC_BARE },
+ {"tlbr" , DC_BARE },
+ {"tlbwi" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"tlbwr" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"tlbp" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"eret" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"deret" , DC_BARE },
+ {"wait" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE }};
+
+static const disasm_t disasm_cop1[32] DATASEG =
+{{"mfc1" , DC_RT_FS },
+ {"dmfc1" , DC_RT_FS },
+ {"cfc1" , DC_RT_FS },
+ {"invalid" , DC_BARE },
+ {"mtc1" , DC_RT_FS },
+ {"dmtc1" , DC_RT_FS },
+ {"ctc1" , DC_RT_FS },
+ {"invalid" , DC_BARE },
+ {"$17" , DC_DEREF },
+ {"$36" , DC_DEREF },
+ {"$37" , DC_DEREF },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"$7" , DC_DEREF },
+ {"$9" , DC_DEREF },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"$11" , DC_DEREF },
+ {"$12" , DC_DEREF },
+ {"$13" , DC_DEREF },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE }};
+
+static const disasm_t disasm_cop1_bc1[4] DATASEG =
+{{"bc1f" , DC_CC_OFS },
+ {"bc1t" , DC_CC_OFS },
+ {"bc1fl" , DC_CC_OFS },
+ {"bc1tl" , DC_CC_OFS },
+};
+
+static const disasm_t disasm_cop1_bc1any2[2] DATASEG =
+{{"bc1any2f" , DC_CC_OFS },
+ {"bc1any2t" , DC_CC_OFS },
+};
+
+static const disasm_t disasm_cop1_bc1any4[2] DATASEG =
+{{"bc1any4f" , DC_CC_OFS },
+ {"bc1any4t" , DC_CC_OFS },
+};
+
+static const disasm_t disasm_cop1_s[64] DATASEG =
+{{"add.s" , DC_FD_FS_FT },
+ {"sub.s" , DC_FD_FS_FT },
+ {"mul.s" , DC_FD_FS_FT },
+ {"div.s" , DC_FD_FS_FT },
+ {"sqrt.s" , DC_FD_FS },
+ {"abs.s" , DC_FD_FS },
+ {"mov.s" , DC_FD_FS },
+ {"neg.s" , DC_FD_FS },
+ {"round.l.s" , DC_FD_FS },
+ {"trunc.l.s" , DC_FD_FS },
+ {"ceil.l.s" , DC_FD_FS },
+ {"floor.l.s" , DC_FD_FS },
+ {"round.w.s" , DC_FD_FS },
+ {"trunc.w.s" , DC_FD_FS },
+ {"ceil.w.s" , DC_FD_FS },
+ {"floor.w.s" , DC_FD_FS },
+ {"invalid" , DC_BARE },
+ {"$8" , DC_DEREF },
+ {"movz.s" , DC_FD_FS_RT },
+ {"movn.s" , DC_FD_FS_RT },
+ {"invalid" , DC_BARE },
+ {"recip.s" , DC_FD_FS },
+ {"rsqrt.s" , DC_FD_FS },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"recip2.s" , DC_FD_FS_FT },
+ {"recip1.s" , DC_FD_FS },
+ {"rsqrt1.s" , DC_FD_FS },
+ {"rsqrt2.s" , DC_FD_FS_FT },
+ {"invalid" , DC_BARE },
+ {"cvt.d.s" , DC_FD_FS },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"cvt.w.s" , DC_FD_FS },
+ {"cvt.l.s" , DC_FD_FS },
+ {"cvt.ps.s" , DC_FD_FS_FT },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"$38" , DC_DEREF },
+ {"$39" , DC_DEREF },
+ {"$40" , DC_DEREF },
+ {"$41" , DC_DEREF },
+ {"$42" , DC_DEREF },
+ {"$43" , DC_DEREF },
+ {"$44" , DC_DEREF },
+ {"$45" , DC_DEREF },
+ {"$46" , DC_DEREF },
+ {"$47" , DC_DEREF },
+ {"$48" , DC_DEREF },
+ {"$49" , DC_DEREF },
+ {"$50" , DC_DEREF },
+ {"$51" , DC_DEREF },
+ {"$52" , DC_DEREF },
+ {"$53" , DC_DEREF }};
+
+static const disasm_t disasm_cop1_s_mvcf[2] DATASEG =
+{{"movf.s" , DC_FD_FS_CC },
+ {"movt.s" , DC_FD_FS_CC }};
+
+static const disasm_t disasm_cop1_d[64] DATASEG =
+{{"add.d" , DC_FD_FS_FT },
+ {"sub.d" , DC_FD_FS_FT },
+ {"mul.d" , DC_FD_FS_FT },
+ {"div.d" , DC_FD_FS_FT },
+ {"sqrt.d" , DC_FD_FS },
+ {"abs.d" , DC_FD_FS },
+ {"mov.d" , DC_FD_FS },
+ {"neg.d" , DC_FD_FS },
+ {"round.l.d" , DC_FD_FS },
+ {"trunc.l.d" , DC_FD_FS },
+ {"ceil.l.d" , DC_FD_FS },
+ {"floor.l.d" , DC_FD_FS },
+ {"round.w.d" , DC_FD_FS },
+ {"trunc.w.d" , DC_FD_FS },
+ {"ceil.w.d" , DC_FD_FS },
+ {"floor.w.d" , DC_FD_FS },
+ {"invalid" , DC_BARE },
+ {"$10" , DC_DEREF },
+ {"movz.d" , DC_FD_FS_RT },
+ {"movn.d" , DC_FD_FS_RT },
+ {"invalid" , DC_BARE },
+ {"recip.d" , DC_FD_FS },
+ {"rsqrt.d" , DC_FD_FS },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"recip2.d" , DC_FD_FS_FT },
+ {"recip1.d" , DC_FD_FS },
+ {"rsqrt1.d" , DC_FD_FS },
+ {"rsqrt2.d" , DC_FD_FS_FT },
+ {"cvt.s.d" , DC_FD_FS },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"cvt.w.d" , DC_FD_FS },
+ {"cvt.l.d" , DC_FD_FS },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"$54" , DC_DEREF },
+ {"$55" , DC_DEREF },
+ {"$56" , DC_DEREF },
+ {"$57" , DC_DEREF },
+ {"$58" , DC_DEREF },
+ {"$59" , DC_DEREF },
+ {"$60" , DC_DEREF },
+ {"$61" , DC_DEREF },
+ {"$62" , DC_DEREF },
+ {"$63" , DC_DEREF },
+ {"$64" , DC_DEREF },
+ {"$65" , DC_DEREF },
+ {"$66" , DC_DEREF },
+ {"$67" , DC_DEREF },
+ {"$68" , DC_DEREF },
+ {"$69" , DC_DEREF }};
+
+static const disasm_t disasm_cop1_d_mvcf[2] DATASEG =
+{{"movf.d" , DC_FD_FS_CC },
+ {"movt.d" , DC_FD_FS_CC }};
+
+static const disasm_t disasm_cop1_w[64] DATASEG =
+{{"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"cvt.s.w" , DC_FD_FS },
+ {"cvt.d.w" , DC_FD_FS },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"cvt.ps.pw" , DC_FD_FS },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE }};
+
+static const disasm_t disasm_cop1_l[64] DATASEG =
+{{"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"cvt.s.l" , DC_FD_FS },
+ {"cvt.d.l" , DC_FD_FS },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE }};
+
+static const disasm_t disasm_cop1_ps[64] DATASEG =
+{{"add.ps" , DC_FD_FS_FT },
+ {"sub.ps" , DC_FD_FS_FT },
+ {"mul.ps" , DC_FD_FS_FT },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"abs.ps" , DC_FD_FS },
+ {"mov.ps" , DC_FD_FS },
+ {"neg.ps" , DC_FD_FS },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"$14" , DC_DEREF },
+ {"movz.ps" , DC_FD_FS_RT },
+ {"movn.ps" , DC_FD_FS_RT },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"addr.ps" , DC_FD_FS_FT },
+ {"invalid" , DC_BARE },
+ {"mulr.ps" , DC_FD_FS_FT },
+ {"invalid" , DC_BARE },
+ {"recip2.ps" , DC_FD_FS_FT },
+ {"recip1.ps" , DC_FD_FS },
+ {"rsqrt1.ps" , DC_FD_FS },
+ {"rsqrt2.ps" , DC_FD_FS_FT },
+ {"cvt.s.pu" , DC_FD_FS },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"cvt.pw.ps" , DC_FD_FS },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"cvt.s.pl" , DC_FD_FS },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"pll.ps" , DC_FD_FS_FT },
+ {"plu.ps" , DC_FD_FS_FT },
+ {"pul.ps" , DC_FD_FS_FT },
+ {"puu.ps" , DC_FD_FS_FT },
+ {"$70" , DC_DEREF },
+ {"$71" , DC_DEREF },
+ {"$72" , DC_DEREF },
+ {"$73" , DC_DEREF },
+ {"$74" , DC_DEREF },
+ {"$75" , DC_DEREF },
+ {"$76" , DC_DEREF },
+ {"$77" , DC_DEREF },
+ {"$78" , DC_DEREF },
+ {"$79" , DC_DEREF },
+ {"$80" , DC_DEREF },
+ {"$81" , DC_DEREF },
+ {"$82" , DC_DEREF },
+ {"$83" , DC_DEREF },
+ {"$84" , DC_DEREF },
+ {"$85" , DC_DEREF }};
+
+static const disasm_t disasm_cop1_c_f_s[2] DATASEG =
+{{"c.f.s" , DC_CC_FS_FT },
+ {"cabs.f.s" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_un_s[2] DATASEG =
+{{"c.un.s" , DC_CC_FS_FT },
+ {"cabs.un.s" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_eq_s[2] DATASEG =
+{{"c.eq.s" , DC_CC_FS_FT },
+ {"cabs.eq.s" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_ueq_s[2] DATASEG =
+{{"c.ueq.s" , DC_CC_FS_FT },
+ {"cabs.ueq.s" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_olt_s[2] DATASEG =
+{{"c.olt.s" , DC_CC_FS_FT },
+ {"cabs.olt.s" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_ult_s[2] DATASEG =
+{{"c.ult.s" , DC_CC_FS_FT },
+ {"cabs.ult.s" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_ole_s[2] DATASEG =
+{{"c.ole.s" , DC_CC_FS_FT },
+ {"cabs.ole.s" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_ule_s[2] DATASEG =
+{{"c.ule.s" , DC_CC_FS_FT },
+ {"cabs.ule.s" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_sf_s[2] DATASEG =
+{{"c.sf.s" , DC_CC_FS_FT },
+ {"cabs.sf.s" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_ngle_s[2] DATASEG =
+{{"c.ngle.s" , DC_CC_FS_FT },
+ {"cabs.ngle.s" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_seq_s[2] DATASEG =
+{{"c.seq.s" , DC_CC_FS_FT },
+ {"cabs.seq.s" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_ngl_s[2] DATASEG =
+{{"c.ngl.s" , DC_CC_FS_FT },
+ {"cabs.ngl.s" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_lt_s[2] DATASEG =
+{{"c.lt.s" , DC_CC_FS_FT },
+ {"cabs.lt.s" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_nge_s[2] DATASEG =
+{{"c.nge.s" , DC_CC_FS_FT },
+ {"cabs.nge.s" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_le_s[2] DATASEG =
+{{"c.le.s" , DC_CC_FS_FT },
+ {"cabs.le.s" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_ngt_s[2] DATASEG =
+{{"c.ngt.s" , DC_CC_FS_FT },
+ {"cabs.ngt.s" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_f_d[2] DATASEG =
+{{"c.f.d" , DC_CC_FS_FT },
+ {"cabs.f.d" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_un_d[2] DATASEG =
+{{"c.un.d" , DC_CC_FS_FT },
+ {"cabs.un.d" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_eq_d[2] DATASEG =
+{{"c.eq.d" , DC_CC_FS_FT },
+ {"cabs.eq.d" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_ueq_d[2] DATASEG =
+{{"c.ueq.d" , DC_CC_FS_FT },
+ {"cabs.ueq.d" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_olt_d[2] DATASEG =
+{{"c.olt.d" , DC_CC_FS_FT },
+ {"cabs.olt.d" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_ult_d[2] DATASEG =
+{{"c.ult.d" , DC_CC_FS_FT },
+ {"cabs.ult.d" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_ole_d[2] DATASEG =
+{{"c.ole.d" , DC_CC_FS_FT },
+ {"cabs.ole.d" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_ule_d[2] DATASEG =
+{{"c.ule.d" , DC_CC_FS_FT },
+ {"cabs.ule.d" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_sf_d[2] DATASEG =
+{{"c.sf.d" , DC_CC_FS_FT },
+ {"cabs.sf.d" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_ngle_d[2] DATASEG =
+{{"c.ngle.d" , DC_CC_FS_FT },
+ {"cabs.ngle.d" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_seq_d[2] DATASEG =
+{{"c.seq.d" , DC_CC_FS_FT },
+ {"cabs.seq.d" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_ngl_d[2] DATASEG =
+{{"c.ngl.d" , DC_CC_FS_FT },
+ {"cabs.ngl.d" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_lt_d[2] DATASEG =
+{{"c.lt.d" , DC_CC_FS_FT },
+ {"cabs.lt.d" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_nge_d[2] DATASEG =
+{{"c.nge.d" , DC_CC_FS_FT },
+ {"cabs.nge.d" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_le_d[2] DATASEG =
+{{"c.le.d" , DC_CC_FS_FT },
+ {"cabs.le.d" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_ngt_d[2] DATASEG =
+{{"c.ngt.d" , DC_CC_FS_FT },
+ {"cabs.ngt.d" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_f_ps[2] DATASEG =
+{{"c.f.ps" , DC_CC_FS_FT },
+ {"cabs.f.ps" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_un_ps[2] DATASEG =
+{{"c.un.ps" , DC_CC_FS_FT },
+ {"cabs.un.ps" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_eq_ps[2] DATASEG =
+{{"c.eq.ps" , DC_CC_FS_FT },
+ {"cabs.eq.ps" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_ueq_ps[2] DATASEG =
+{{"c.ueq.ps" , DC_CC_FS_FT },
+ {"cabs.ueq.ps" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_olt_ps[2] DATASEG =
+{{"c.olt.ps" , DC_CC_FS_FT },
+ {"cabs.olt.ps" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_ult_ps[2] DATASEG =
+{{"c.ult.ps" , DC_CC_FS_FT },
+ {"cabs.ult.ps" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_ole_ps[2] DATASEG =
+{{"c.ole.ps" , DC_CC_FS_FT },
+ {"cabs.ole.ps" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_ule_ps[2] DATASEG =
+{{"c.ule.ps" , DC_CC_FS_FT },
+ {"cabs.ule.ps" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_sf_ps[2] DATASEG =
+{{"c.sf.ps" , DC_CC_FS_FT },
+ {"cabs.sf.ps" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_ngle_ps[2] DATASEG =
+{{"c.ngle.ps" , DC_CC_FS_FT },
+ {"cabs.ngle.ps" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_seq_ps[2] DATASEG =
+{{"c.seq.ps" , DC_CC_FS_FT },
+ {"cabs.seq.ps" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_ngl_ps[2] DATASEG =
+{{"c.ngl.ps" , DC_CC_FS_FT },
+ {"cabs.ngl.ps" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_lt_ps[2] DATASEG =
+{{"c.lt.ps" , DC_CC_FS_FT },
+ {"cabs.lt.ps" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_nge_ps[2] DATASEG =
+{{"c.nge.ps" , DC_CC_FS_FT },
+ {"cabs.nge.ps" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_le_ps[2] DATASEG =
+{{"c.le.ps" , DC_CC_FS_FT },
+ {"cabs.le.ps" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_c_ngt_ps[2] DATASEG =
+{{"c.ngt.ps" , DC_CC_FS_FT },
+ {"cabs.ngt.ps" , DC_CC_FS_FT }};
+
+static const disasm_t disasm_cop1_ps_mvcf[2] DATASEG =
+{{"movf.ps" , DC_FD_FS_CC },
+ {"movt.ps" , DC_FD_FS_CC }};
+
+static const disasm_t disasm_cop1x[64] DATASEG =
+{{"lwxc1" , DC_FD_IDX_BASE },
+ {"ldxc1" , DC_FD_IDX_BASE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"luxc1" , DC_FD_IDX_BASE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"swxc1" , DC_FS_IDX_BASE },
+ {"sdxc1" , DC_FS_IDX_BASE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"suxc1" , DC_FS_IDX_BASE },
+ {"invalid" , DC_BARE },
+ {"prefx" , DC_PREF_IDX },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"alnv.ps" , DC_FD_FS_FT_RS },
+ {"invalid" , DC_BARE },
+ {"madd.s" , DC_FD_FR_FS_FT },
+ {"madd.d" , DC_FD_FR_FS_FT },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"madd.ps" , DC_FD_FR_FS_FT },
+ {"invalid" , DC_BARE },
+ {"msub.s" , DC_FD_FR_FS_FT },
+ {"msub.d" , DC_FD_FR_FS_FT },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"msub.ps" , DC_FD_FR_FS_FT },
+ {"invalid" , DC_BARE },
+ {"nmadd.s" , DC_FD_FR_FS_FT },
+ {"nmadd.d" , DC_FD_FR_FS_FT },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"nmadd.ps" , DC_FD_FR_FS_FT },
+ {"invalid" , DC_BARE },
+ {"nmsub.s" , DC_FD_FR_FS_FT },
+ {"nmsub.d" , DC_FD_FR_FS_FT },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"invalid" , DC_BARE },
+ {"nmsub.ps" , DC_FD_FR_FS_FT },
+ {"invalid" , DC_BARE }};
+
+static const disasm_t disasm_mdmx[8] DATASEG =
+{{ "$20" , DC_DEREF },
+ { "$19" , DC_DEREF },
+ { "$20" , DC_DEREF },
+ { "$33" , DC_DEREF },
+ { "$20" , DC_DEREF },
+ { "$19" , DC_DEREF },
+ { "$20" , DC_DEREF },
+ { "$33" , DC_DEREF },
+};
+
+static const disasm_t disasm_mdmx_qh[64] DATASEG =
+{{ "msgn.qh" , DC_VD_VS_VT_VEC},
+ { "c.eq.qh" , DC_VS_VT_VEC },
+ { "pickf.qh" , DC_VD_VS_VT_VEC},
+ { "pickt.qh" , DC_VD_VS_VT_VEC},
+ { "c.lt.qh" , DC_VS_VT_VEC },
+ { "c.le.qh" , DC_VS_VT_VEC },
+ { "min.qh" , DC_VD_VS_VT_VEC},
+ { "max.qh" , DC_VD_VS_VT_VEC},
+
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "sub.qh" , DC_VD_VS_VT_VEC},
+ { "add.qh" , DC_VD_VS_VT_VEC},
+ { "and.qh" , DC_VD_VS_VT_VEC},
+ { "xor.qh" , DC_VD_VS_VT_VEC},
+ { "or.qh" , DC_VD_VS_VT_VEC},
+ { "nor.qh" , DC_VD_VS_VT_VEC},
+
+ { "sll.qh" , DC_VD_VS_VT_VEC},
+ { "invalid" , DC_BARE },
+ { "srl.qh" , DC_VD_VS_VT_VEC},
+ { "sra.qh" , DC_VD_VS_VT_VEC},
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+
+ { "alni.ob" , DC_VD_VS_VT_IMM},
+ { "alnv.ob" , DC_VD_VS_VT_RS },
+ { "alni.qh" , DC_VD_VS_VT_IMM},
+ { "alnv.qh" , DC_VD_VS_VT_RS },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "$34" , DC_DEREF },
+
+ { "rzu.qh" , DC_VD_VT },
+ { "rnau.qh" , DC_VD_VT },
+ { "rneu.qh" , DC_VD_VT },
+ { "invalid" , DC_BARE },
+ { "rzs.qh" , DC_VD_VT },
+ { "rnas.qh" , DC_VD_VT },
+ { "rnes.qh" , DC_VD_VT },
+ { "invalid" , DC_BARE },
+
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+
+ { "mul.qh" , DC_VD_VS_VT_VEC},
+ { "invalid" , DC_BARE },
+ { "$21" , DC_DEREF },
+ { "$22" , DC_DEREF },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "$23" , DC_DEREF },
+ { "$24" , DC_DEREF },
+
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "$25" , DC_DEREF },
+ { "$26" , DC_DEREF },
+};
+
+static const disasm_t disasm_mdmx_ob[64] DATASEG =
+{{ "invalid" , DC_BARE },
+ { "c.eq.ob" , DC_VS_VT_VEC },
+ { "pickf.ob" , DC_VD_VS_VT_VEC},
+ { "pickt.ob" , DC_VD_VS_VT_VEC},
+ { "c.lt.ob" , DC_VS_VT_VEC },
+ { "c.le.ob" , DC_VS_VT_VEC },
+ { "min.ob" , DC_VD_VS_VT_VEC},
+ { "max.ob" , DC_VD_VS_VT_VEC},
+
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "sub.ob" , DC_VD_VS_VT_VEC},
+ { "add.ob" , DC_VD_VS_VT_VEC},
+ { "and.ob" , DC_VD_VS_VT_VEC},
+ { "xor.ob" , DC_VD_VS_VT_VEC},
+ { "or.ob" , DC_VD_VS_VT_VEC},
+ { "nor.ob" , DC_VD_VS_VT_VEC},
+
+ { "sll.ob" , DC_VD_VS_VT_VEC},
+ { "invalid" , DC_BARE },
+ { "srl.ob" , DC_VD_VS_VT_VEC},
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+
+ { "alni.ob" , DC_VD_VS_VT_IMM},
+ { "alnv.ob" , DC_VD_VS_VT_RS },
+ { "alni.qh" , DC_VD_VS_VT_IMM},
+ { "alnv.qh" , DC_VD_VS_VT_RS },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "$35" , DC_DEREF },
+
+ { "rzu.ob" , DC_VD_VT },
+ { "rnau.ob" , DC_VD_VT },
+ { "rneu.ob" , DC_VD_VT },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+
+ { "mul.ob" , DC_VD_VS_VT_VEC},
+ { "invalid" , DC_BARE },
+ { "$27" , DC_DEREF },
+ { "$28" , DC_DEREF },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "$29" , DC_DEREF },
+ { "$30" , DC_DEREF },
+
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "$31" , DC_DEREF },
+ { "$32" , DC_DEREF },
+};
+
+static const disasm_t disasm_mdmx_alni[64] DATASEG =
+{{ "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+
+ { "alni.ob" , DC_VD_VS_VT_IMM},
+ { "alnv.ob" , DC_VD_VS_VT_RS },
+ { "alni.qh" , DC_VD_VS_VT_IMM},
+ { "alnv.qh" , DC_VD_VS_VT_RS },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+};
+
+static const disasm_t disasm_mdmx_muls_qh[2] DATASEG =
+{{ "muls.qh" , DC_VS_VT_VEC },
+ { "mulsl.qh" , DC_VS_VT_VEC },
+};
+
+static const disasm_t disasm_mdmx_mul_qh[2] DATASEG =
+{{ "mula.qh" , DC_VS_VT_VEC },
+ { "mull.qh" , DC_VS_VT_VEC },
+};
+
+static const disasm_t disasm_mdmx_sub_qh[2] DATASEG =
+{{ "suba.qh" , DC_VS_VT_VEC },
+ { "subl.qh" , DC_VS_VT_VEC },
+};
+
+static const disasm_t disasm_mdmx_add_qh[2] DATASEG =
+{{ "adda.qh" , DC_VS_VT_VEC },
+ { "addl.qh" , DC_VS_VT_VEC },
+};
+
+static const disasm_t disasm_mdmx_wac_qh[4] DATASEG =
+{{ "wacl.qh" , DC_VS_VT },
+ { "invalid" , DC_BARE },
+ { "wach.qh" , DC_VS },
+ { "invalid" , DC_BARE },
+};
+
+static const disasm_t disasm_mdmx_rac_qh[4] DATASEG =
+{{ "racl.qh" , DC_VD },
+ { "racm.qh" , DC_VD },
+ { "rach.qh" , DC_VD },
+ { "invalid" , DC_BARE },
+};
+
+static const disasm_t disasm_mdmx_muls_ob[2] DATASEG =
+{{ "muls.ob" , DC_VS_VT_VEC },
+ { "mulsl.ob" , DC_VS_VT_VEC },
+};
+
+static const disasm_t disasm_mdmx_mul_ob[2] DATASEG =
+{{ "mula.ob" , DC_VS_VT_VEC },
+ { "mull.ob" , DC_VS_VT_VEC },
+};
+
+static const disasm_t disasm_mdmx_sub_ob[2] DATASEG =
+{{ "suba.ob" , DC_VS_VT_VEC },
+ { "subl.ob" , DC_VS_VT_VEC },
+};
+
+static const disasm_t disasm_mdmx_add_ob[2] DATASEG =
+{{ "adda.ob" , DC_VS_VT_VEC },
+ { "addl.ob" , DC_VS_VT_VEC },
+};
+
+static const disasm_t disasm_mdmx_wac_ob[4] DATASEG =
+{{ "wacl.ob" , DC_VS_VT },
+ { "invalid" , DC_BARE },
+ { "wach.ob" , DC_VS },
+ { "invalid" , DC_BARE },
+};
+
+static const disasm_t disasm_mdmx_rac_ob[4] DATASEG =
+{{ "racl.ob" , DC_VD },
+ { "racm.ob" , DC_VD },
+ { "rach.ob" , DC_VD },
+ { "invalid" , DC_BARE },
+};
+
+static const disasm_t disasm_mdmx_shfl_ob[16] DATASEG =
+{{ "shfl.upsl.ob" , DC_VD_VS_VT },
+ { "shfl.pach.ob" , DC_VD_VS_VT },
+ { "shfl.mixh.ob" , DC_VD_VS_VT },
+ { "shfl.mixl.ob" , DC_VD_VS_VT },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+};
+
+static const disasm_t disasm_mdmx_shfl_qh[8] DATASEG =
+{{ "shfl.bfla.qh" , DC_VD_VS_VT },
+ { "shfl.pach.qh" , DC_VD_VS_VT },
+ { "shfl.mixh.qh" , DC_VD_VS_VT },
+ { "shfl.mixl.qh" , DC_VD_VS_VT },
+ { "shfl.repa.qh" , DC_VD_VS_VT },
+ { "shfl.repb.qh" , DC_VD_VS_VT },
+ { "invalid" , DC_BARE },
+ { "invalid" , DC_BARE },
+};
+
+
+
+const disasm_deref_t disasm_deref[] =
+/* Disasm array shft msk */
+{{ disasm_normal , 26, 0x3f }, /* 0 */
+ { disasm_special , 0, 0x3f }, /* 1 */
+ { disasm_regimm , 16, 0x1f }, /* 2 */
+ { disasm_spec2 , 0, 0x3f }, /* 3 */
+ { disasm_cop0 , 21, 0x1f }, /* 4 */
+ { disasm_cop0_c0 , 0, 0x3f }, /* 5 */
+ { disasm_cop1 , 21, 0x1f }, /* 6 */
+ { disasm_cop1_s , 0, 0x3f }, /* 7 */
+ { disasm_cop1_s_mvcf , 16, 0x1 }, /* 8 */
+ { disasm_cop1_d , 0, 0x3f }, /* 9 */
+ { disasm_cop1_d_mvcf , 16, 0x1 }, /* 10 */
+ { disasm_cop1_w , 0, 0x3f }, /* 11 */
+ { disasm_cop1_l , 0, 0x3f }, /* 12 */
+ { disasm_cop1_ps , 0, 0x3f }, /* 13 */
+ { disasm_cop1_ps_mvcf, 16, 0x1 }, /* 14 */
+ { disasm_cop1x , 0, 0x3f }, /* 15 */
+ { disasm_movci , 16, 0x1 }, /* 16 */
+ { disasm_cop1_bc1 , 16, 0x3 }, /* 17 */
+ { disasm_mdmx , 21, 0x7 }, /* 18 */
+ { disasm_mdmx_qh , 0, 0x3f }, /* 19 */
+ { disasm_mdmx_ob , 0, 0x3f }, /* 20 */
+ { disasm_mdmx_muls_qh, 10, 0x1 }, /* 21 */
+ { disasm_mdmx_mul_qh , 10, 0x1 }, /* 22 */
+ { disasm_mdmx_sub_qh , 10, 0x1 }, /* 23 */
+ { disasm_mdmx_add_qh , 10, 0x1 }, /* 24 */
+ { disasm_mdmx_wac_qh , 24, 0x3 }, /* 25 */
+ { disasm_mdmx_rac_qh , 24, 0x3 }, /* 26 */
+ { disasm_mdmx_muls_ob, 10, 0x1 }, /* 27 */
+ { disasm_mdmx_mul_ob , 10, 0x1 }, /* 28 */
+ { disasm_mdmx_sub_ob , 10, 0x1 }, /* 29 */
+ { disasm_mdmx_add_ob , 10, 0x1 }, /* 30 */
+ { disasm_mdmx_wac_ob , 24, 0x3 }, /* 31 */
+ { disasm_mdmx_rac_ob , 24, 0x3 }, /* 32 */
+ { disasm_mdmx_alni , 0, 0x3f }, /* 33 */
+ { disasm_mdmx_shfl_ob, 22, 0xf }, /* 34 */
+ { disasm_mdmx_shfl_qh, 23, 0x7 }, /* 35 */
+ { disasm_cop1_bc1any2, 16, 0x1 }, /* 36 */
+ { disasm_cop1_bc1any4, 16, 0x1 }, /* 37 */
+ { disasm_cop1_c_f_s , 6, 0x1 }, /* 38 */
+ { disasm_cop1_c_un_s , 6, 0x1 }, /* 39 */
+ { disasm_cop1_c_eq_s , 6, 0x1 }, /* 40 */
+ { disasm_cop1_c_ueq_s, 6, 0x1 }, /* 41 */
+ { disasm_cop1_c_olt_s, 6, 0x1 }, /* 42 */
+ { disasm_cop1_c_ult_s, 6, 0x1 }, /* 43 */
+ { disasm_cop1_c_ole_s, 6, 0x1 }, /* 44 */
+ { disasm_cop1_c_ule_s, 6, 0x1 }, /* 45 */
+ { disasm_cop1_c_sf_s , 6, 0x1 }, /* 46 */
+ { disasm_cop1_c_ngle_s, 6, 0x1 }, /* 47 */
+ { disasm_cop1_c_seq_s, 6, 0x1 }, /* 48 */
+ { disasm_cop1_c_ngl_s, 6, 0x1 }, /* 49 */
+ { disasm_cop1_c_lt_s , 6, 0x1 }, /* 50 */
+ { disasm_cop1_c_nge_s, 6, 0x1 }, /* 51 */
+ { disasm_cop1_c_le_s , 6, 0x1 }, /* 52 */
+ { disasm_cop1_c_ngt_s, 6, 0x1 }, /* 53 */
+ { disasm_cop1_c_f_d , 6, 0x1 }, /* 54 */
+ { disasm_cop1_c_un_d , 6, 0x1 }, /* 55 */
+ { disasm_cop1_c_eq_d , 6, 0x1 }, /* 56 */
+ { disasm_cop1_c_ueq_d, 6, 0x1 }, /* 57 */
+ { disasm_cop1_c_olt_d, 6, 0x1 }, /* 58 */
+ { disasm_cop1_c_ult_d, 6, 0x1 }, /* 59 */
+ { disasm_cop1_c_ole_d, 6, 0x1 }, /* 60 */
+ { disasm_cop1_c_ule_d, 6, 0x1 }, /* 61 */
+ { disasm_cop1_c_sf_d , 6, 0x1 }, /* 62 */
+ { disasm_cop1_c_ngle_d, 6, 0x1 }, /* 63 */
+ { disasm_cop1_c_seq_d, 6, 0x1 }, /* 64 */
+ { disasm_cop1_c_ngl_d, 6, 0x1 }, /* 65 */
+ { disasm_cop1_c_lt_d , 6, 0x1 }, /* 66 */
+ { disasm_cop1_c_nge_d, 6, 0x1 }, /* 67 */
+ { disasm_cop1_c_le_d , 6, 0x1 }, /* 68 */
+ { disasm_cop1_c_ngt_d, 6, 0x1 }, /* 69 */
+ { disasm_cop1_c_f_ps , 6, 0x1 }, /* 70 */
+ { disasm_cop1_c_un_ps, 6, 0x1 }, /* 71 */
+ { disasm_cop1_c_eq_ps, 6, 0x1 }, /* 72 */
+ { disasm_cop1_c_ueq_ps, 6, 0x1 }, /* 73 */
+ { disasm_cop1_c_olt_ps, 6, 0x1 }, /* 74 */
+ { disasm_cop1_c_ult_ps, 6, 0x1 }, /* 75 */
+ { disasm_cop1_c_ole_ps, 6, 0x1 }, /* 76 */
+ { disasm_cop1_c_ule_ps, 6, 0x1 }, /* 77 */
+ { disasm_cop1_c_sf_ps, 6, 0x1 }, /* 78 */
+ { disasm_cop1_c_ngle_ps, 6, 0x1 }, /* 79 */
+ { disasm_cop1_c_seq_ps, 6, 0x1 }, /* 80 */
+ { disasm_cop1_c_ngl_ps, 6, 0x1 }, /* 81 */
+ { disasm_cop1_c_lt_ps, 6, 0x1 }, /* 82 */
+ { disasm_cop1_c_nge_ps, 6, 0x1 }, /* 83 */
+ { disasm_cop1_c_le_ps, 6, 0x1 }, /* 84 */
+ { disasm_cop1_c_ngt_ps, 6, 0x1 }, /* 85 */
+};
+
+#define PREFHINT(x) (&pref_hints[(x)*9])
+static char *pref_hints =
+ "load \0"
+ "store \0"
+ "reserved\0"
+ "reserved\0"
+
+ "ld_strm \0"
+ "st_strm \0"
+ "ld_retn \0"
+ "st_retn \0"
+
+ "reserved\0"
+ "reserved\0"
+ "reserved\0"
+ "reserved\0"
+
+ "reserved\0"
+ "reserved\0"
+ "reserved\0"
+ "reserved\0"
+
+ "reserved\0"
+ "reserved\0"
+ "reserved\0"
+ "reserved\0"
+
+ "reserved\0"
+ "reserved\0"
+ "reserved\0"
+ "reserved\0"
+
+ "reserved\0"
+ "wb_inval\0"
+ "reserved\0"
+ "reserved\0"
+
+ "reserved\0"
+ "reserved\0"
+ "reserved\0"
+ "reserved\0";
+
+
+static int snprintf(char *buf,int len,const char *templat,...)
+{
+ va_list marker;
+ int count;
+
+ va_start(marker,templat);
+ count = xvsprintf(buf,templat,marker);
+ va_end(marker);
+
+ return count;
+}
+
+static const disasm_t *get_disasm_field(uint32_t inst)
+{
+ const disasm_deref_t *tmp = &disasm_deref[0];
+ const disasm_t *rec;
+ do {
+ rec = &(tmp->ptr[(inst>>tmp->shift) & tmp->mask]);
+ tmp = &disasm_deref[atoi(&(rec->name[1]))];
+ } while (rec->type == DC_DEREF);
+ return rec;
+}
+
+char *disasm_inst_name(uint32_t inst)
+{
+ return (char *)(get_disasm_field(inst)->name);
+}
+
+void disasm_inst(char *buf, int buf_size, uint32_t inst, uint64_t pc)
+{
+ const disasm_t *tmp;
+ char instname[32];
+ int commentmode = 0;
+ char *x;
+
+ tmp = get_disasm_field(inst);
+
+ strcpy(instname,(char *) tmp->name);
+
+ if ((x = strchr(instname,'@'))) {
+ *x++ = 0;
+ commentmode = atoi(x);
+ }
+
+ switch (tmp->type) {
+ case DC_RD_RS_RT:
+ snprintf(buf, buf_size, "%-8s %s,%s,%s",
+ instname,
+ REGNAME((inst>>11) & 0x1f),
+ REGNAME((inst>>21) & 0x1f),
+ REGNAME((inst>>16) & 0x1f));
+ break;
+ case DC_RD_RT_RS:
+ snprintf(buf, buf_size, "%-8s %s,%s,%s",
+ instname,
+ REGNAME((inst>>11) & 0x1f),
+ REGNAME((inst>>16) & 0x1f),
+ REGNAME((inst>>21) & 0x1f));
+ break;
+ case DC_RT_RS_SIMM:
+ snprintf(buf, buf_size, "%-8s %s,%s,#%" PF_32 "d",
+ instname,
+ REGNAME((inst>>16) & 0x1f),
+ REGNAME((inst>>21) & 0x1f),
+ SEXT_32(15, inst & 0xffff));
+ break;
+ case DC_RT_RS_XIMM:
+ snprintf(buf, buf_size, "%-8s %s,%s,#0x%" PF_32 "x",
+ instname,
+ REGNAME((inst>>16) & 0x1f),
+ REGNAME((inst>>21) & 0x1f),
+ inst & 0xffff);
+ break;
+ case DC_RS_RT_OFS:
+ snprintf(buf, buf_size, "%-8s %s,%s,0x%" PF_64 "x",
+ instname,
+ REGNAME((inst>>21) & 0x1f),
+ REGNAME((inst>>16) & 0x1f),
+ pc + 4 + (SEXT_64(15, inst & 0xffff)<<2));
+ break;
+ case DC_RS_OFS:
+ snprintf(buf, buf_size, "%-8s %s,0x%" PF_64 "x",
+ instname,
+ REGNAME((inst>>21) & 0x1f),
+ pc + 4 + (SEXT_64(16, inst & 0xffff)<<2));
+ break;
+ case DC_RD_RT_SA:
+ snprintf(buf, buf_size, "%-8s %s,%s,#%d",
+ instname,
+ REGNAME((inst>>11) & 0x1f),
+ REGNAME((inst>>16) & 0x1f),
+ (inst>>6) & 0x1f);
+ break;
+ case DC_RT_UIMM:
+ snprintf(buf, buf_size, "%-8s %s,#%d",
+ instname,
+ REGNAME((inst>>16) & 0x1f),
+ inst & 0xffff);
+ break;
+ case DC_RD:
+ snprintf(buf, buf_size, "%-8s %s",
+ instname,
+ REGNAME((inst>>11) & 0x1f));
+ break;
+ case DC_J:
+ snprintf(buf, buf_size, "%-8s 0x%" PF_64 "x",
+ instname,
+ (pc & UINT64_T(0xfffffffff0000000)) | ((inst & 0x3ffffff)<<2));
+ break;
+ case DC_RD_RS:
+ snprintf(buf, buf_size, "%-8s %s,%s",
+ instname,
+ REGNAME((inst>>11) & 0x1f),
+ REGNAME((inst>>21) & 0x1f));
+ break;
+ case DC_RS_RT:
+ snprintf(buf, buf_size, "%-8s %s,%s",
+ instname,
+ REGNAME((inst>>21) & 0x1f),
+ REGNAME((inst>>16) & 0x1f));
+ break;
+ case DC_RT_RS:
+ snprintf(buf, buf_size, "%-8s %s,%s",
+ instname,
+ REGNAME((inst>>16) & 0x1f),
+ REGNAME((inst>>21) & 0x1f));
+ break;
+ case DC_RT_RD_SEL:
+ snprintf(buf, buf_size, "%-8s %s,%s,#%d",
+ instname,
+ REGNAME((inst>>16) & 0x1f),
+ REGNAME((inst>>11) & 0x1f),
+ inst & 0x3);
+ break;
+ case DC_RT_CR_SEL:
+ snprintf(buf, buf_size, "%-8s %s,%d,#%d",
+ instname,
+ REGNAME((inst>>16) & 0x1f),
+ (inst>>11) & 0x1f,
+ inst & 0x3);
+ break;
+ case DC_RS:
+ snprintf(buf, buf_size, "%-8s %s",
+ instname,
+ REGNAME((inst>>21) & 0x1f));
+ break;
+ case DC_RS_SIMM:
+ snprintf(buf, buf_size, "%-8s %s,#%" PF_32 "d",
+ instname,
+ REGNAME((inst>>21) & 0x1f),
+ SEXT_32(15, inst & 0xffff));
+ break;
+ case DC_RT_OFS_BASE:
+ snprintf(buf, buf_size, "%-8s %s,#%" PF_32 "d(%s)",
+ instname,
+ REGNAME((inst>>16) & 0x1f),
+ SEXT_32(15, inst),
+ REGNAME((inst>>21) & 0x1f));
+ break;
+ case DC_FT_OFS_BASE:
+ snprintf(buf, buf_size, "%-8s f%d,#%" PF_32 "d(%s)",
+ instname,
+ (inst>>16) & 0x1f,
+ SEXT_32(15, inst),
+ REGNAME((inst>>21) & 0x1f));
+ break;
+ case DC_FD_IDX_BASE:
+ snprintf(buf, buf_size, "%-8s f%d,%s(%s)",
+ instname,
+ (inst>>6) & 0x1f,
+ REGNAME((inst>>16) & 0x1f),
+ REGNAME((inst>>21) & 0x1f));
+ break;
+ case DC_FS_IDX_BASE:
+ snprintf(buf, buf_size, "%-8s f%d,%s(%s)",
+ instname,
+ (inst>>11) & 0x1f,
+ REGNAME((inst>>16) & 0x1f),
+ REGNAME((inst>>21) & 0x1f));
+ break;
+ case DC_FD_FS_FT:
+ snprintf(buf, buf_size, "%-8s f%d,f%d,f%d",
+ instname,
+ (inst>>6) & 0x1f,
+ (inst>>11) & 0x1f,
+ (inst>>16) & 0x1f);
+ break;
+ case DC_FD_FS_RT:
+ snprintf(buf, buf_size, "%-8s f%d,f%d,%s",
+ instname,
+ (inst>>6) & 0x1f,
+ (inst>>11) & 0x1f,
+ REGNAME((inst>>16) & 0x1f));
+ break;
+ case DC_FD_FS:
+ snprintf(buf, buf_size, "%-8s f%d,f%d",
+ instname,
+ (inst>>6)&0x1f,
+ (inst>>11)&0x1f);
+ break;
+ case DC_PREF_OFS:
+ snprintf(buf, buf_size, "%-8s #%" PF_32 "d(%s) /* %s */",
+ instname,
+ SEXT_32(15, inst & 0xffff),
+ REGNAME((inst>>21) & 0x1f),
+ PREFHINT((inst>>16) & 0x1f));
+ break;
+ case DC_PREF_IDX:
+ snprintf(buf, buf_size, "%-8s %s(%s) /* %s */",
+ instname,
+ REGNAME((inst>>16) & 0x1f),
+ REGNAME((inst>>21) & 0x1f),
+ PREFHINT((inst>>16) & 0x1f));
+ break;
+ case DC_CC_OFS:
+ snprintf(buf, buf_size, "%-8s %d,0x%" PF_64 "x",
+ instname,
+ (inst>>18) & 0x7,
+ pc + 4 + (SEXT_64(15, inst & 0xffff)<<2));
+ break;
+ case DC_RD_RS_CC:
+ snprintf(buf, buf_size, "%-8s %s,%s,%d",
+ instname,
+ REGNAME((inst>>11) & 0x1f),
+ REGNAME((inst>>21) & 0x1f),
+ (inst>>18) & 0x7);
+ break;
+ case DC_FD_FS_CC:
+ snprintf(buf, buf_size, "%-8s f%d,f%d,%d",
+ instname,
+ (inst>>6) & 0x1f,
+ (inst>>11) & 0x1f,
+ (inst>>18) & 0x7);
+ break;
+ case DC_FD_FR_FS_FT:
+ snprintf(buf, buf_size, "%-8s f%d,f%d,f%d,f%d",
+ instname,
+ (inst>>6) & 0x1f,
+ (inst>>21) & 0x1f,
+ (inst>>11) & 0x1f,
+ (inst>>16) & 0x1f);
+ break;
+ case DC_FD_FS_FT_RS:
+ snprintf(buf, buf_size, "%-8s f%d,f%d,f%d,%s",
+ instname,
+ (inst>>6) & 0x1f,
+ (inst>>11) & 0x1f,
+ (inst>>16) & 0x1f,
+ REGNAME((inst>>21) & 0x1f));
+ break;
+ case DC_CC_FS_FT:
+ snprintf(buf, buf_size, "%-8s %d,f%d,f%d",
+ instname,
+ (inst>>8) & 0x7,
+ (inst>>11) & 0x1f,
+ (inst>>16) & 0x1f);
+ break;
+ case DC_BARE:
+ snprintf(buf, buf_size, "%-8s", instname);
+ break;
+ case DC_RT_FS:
+ snprintf(buf, buf_size, "%-8s %s,f%d",
+ instname,
+ REGNAME((inst>>16) & 0x1f),
+ (inst>>11) & 0x1f);
+ break;
+ case DC_VS:
+ snprintf(buf, buf_size, "%-8s $v%d",
+ instname,
+ (inst>>11) & 0x1f);
+ break;
+ case DC_VD:
+ snprintf(buf, buf_size, "%-8s $v%d",
+ instname,
+ (inst>>6) & 0x1f);
+ break;
+ case DC_VD_VT:
+ snprintf(buf, buf_size, "%-8s $v%d,$v%d",
+ instname,
+ (inst>>6) & 0x1f,
+ (inst>>16) & 0x1f);
+ break;
+ case DC_VD_VS_VT_IMM:
+ snprintf(buf, buf_size, "%-8s $v%d,$v%d,$v%d,#%d",
+ instname,
+ (inst>>6) & 0x1f,
+ (inst>>11) & 0x1f,
+ (inst>>16) & 0x1f,
+ (inst>>21) & 0x7);
+ break;
+ case DC_VD_VS_VT_RS:
+ snprintf(buf, buf_size, "%-8s $v%d,$v%d,$v%d,%s",
+ instname,
+ (inst>>6) & 0x1f,
+ (inst>>11) & 0x1f,
+ (inst>>16) & 0x1f,
+ REGNAME((inst>>21) & 0x1f));
+ break;
+ case DC_VD_VS_VT:
+ snprintf(buf, buf_size, "%-8s $v%d,$v%d,$v%d",
+ instname,
+ (inst>>6) & 0x1f,
+ (inst>>11) & 0x1f,
+ (inst>>16) & 0x1f);
+ break;
+ case DC_VS_VT:
+ snprintf(buf, buf_size, "%-8s $v%d,$v%d",
+ instname,
+ (inst>>11) & 0x1f,
+ (inst>>16) & 0x1f);
+ break;
+ case DC_VS_VT_VEC:
+ switch((inst>>24) & 0x3) {
+ case 0:
+ case 1:
+ /* element select */
+ if ((inst>>21) & 1) {
+ /* QH */
+ snprintf(buf, buf_size, "%-8s $v%d,$v%d[%d]",
+ instname,
+ (inst>>11) & 0x1f,
+ (inst>>16) & 0x1f,
+ (inst>>23) & 0x3);
+ } else {
+ /* OB */
+ snprintf(buf, buf_size, "%-8s $v%d,$v%d[%d]",
+ instname,
+ (inst>>11) & 0x1f,
+ (inst>>16) & 0x1f,
+ (inst>>22) & 0x7);
+
+ }
+ break;
+ case 2:
+ /* Vector select */
+ snprintf(buf, buf_size, "%-8s $v%d,$v%d",
+ instname,
+ (inst>>11) & 0x1f,
+ (inst>>16) & 0x1f);
+ break;
+ case 3:
+ /* immediate select */
+ snprintf(buf, buf_size, "%-8s $v%d,$#%d",
+ instname,
+ (inst>>11) & 0x1f,
+ (inst>>16) & 0x1f);
+ break;
+ }
+ break;
+
+ case DC_VD_VS_VT_VEC:
+ switch((inst>>24) & 0x3) {
+ case 0:
+ case 1:
+ /* element select */
+ if ((inst>>21) & 1) {
+ /* QH */
+ snprintf(buf, buf_size, "%-8s $v%d,$v%d,$v%d[%d]",
+ instname,
+ (inst>>6) & 0x1f,
+ (inst>>11) & 0x1f,
+ (inst>>16) & 0x1f,
+ (inst>>23) & 0x3);
+ } else {
+ /* OB */
+ snprintf(buf, buf_size, "%-8s $v%d,$v%d,$v%d[%d]",
+ instname,
+ (inst>>6) & 0x1f,
+ (inst>>11) & 0x1f,
+ (inst>>16) & 0x1f,
+ (inst>>22) & 0x7);
+
+ }
+ break;
+ case 2:
+ /* Vector select */
+ snprintf(buf, buf_size, "%-8s $v%d,$v%d,$v%d",
+ instname,
+ (inst>>6) & 0x1f,
+ (inst>>11) & 0x1f,
+ (inst>>16) & 0x1f);
+ break;
+ case 3:
+ /* immediate select */
+ snprintf(buf, buf_size, "%-8s $v%d,$v%d,$#%d",
+ instname,
+ (inst>>6) & 0x1f,
+ (inst>>11) & 0x1f,
+ (inst>>16) & 0x1f);
+ break;
+ }
+ break;
+
+ case DC_SYSCALL:
+ snprintf(buf, buf_size, "%-8s #%d",
+ instname,
+ (inst>>6) & 0xfffff);
+ break;
+ case DC_BREAK:
+ snprintf(buf, buf_size, "%-8s %d", instname, (inst>>6)&0xfffff);
+ break;
+ case DC_OOPS:
+ snprintf(buf, buf_size, "%s OOPS! FIXME!", instname);
+ break;
+ default:
+ /* Hit something we don't know about...Shouldn't happen. */
+ break;
+ }
+
+ /*
+ * Handle comment field
+ */
+
+
+ switch (commentmode) {
+ case 1: /* CP0 ops */
+ if ((inst & 3) == 0) { /* select 0 */
+ snprintf(buf + strlen(buf),buf_size-strlen(buf)," /* %s */",
+ CP0REGNAME((inst >> 11) & 0x1f));
+ }
+ break;
+ default:
+ break;
+ }
+
+ buf[buf_size-1] = 0;
+
+}
diff --git a/cfe/cfe/arch/mips/common/src/exception.S b/cfe/cfe/arch/mips/common/src/exception.S
new file mode 100644
index 0000000..8036b35
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/exception.S
@@ -0,0 +1,546 @@
+/* *********************************************************************
+ * SB1250 Board Support Package
+ *
+ * Exception Handler File: exception.S
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "sbmips.h"
+#include "exception.h"
+#include "mipsmacros.h"
+#include "cpu_config.h" /* for definition of HAZARD and ERET */
+#include "bsp_config.h"
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#ifdef _MIPSREGS32_
+#define LREG lw
+#define SREG sw
+#define SRL srl
+#define SLL sll
+#else
+#define LREG ld
+#define SREG sd
+#define SRL dsrl
+#define SLL dsll
+#endif
+
+
+/* *********************************************************************
+ * Data
+ ********************************************************************* */
+
+ .sdata
+
+ .globl _exc_vectab
+_exc_vectab: _LONG_ 0 # XTYPE_RESET
+ _LONG_ 0 # XTYPE_TLBFILL (not used)
+ _LONG_ 0 # XTYPE_XTLBFILL
+ _LONG_ 0 # XTYPE_CACHEERR (not used)
+ _LONG_ 0 # XTYPE_EXCEPTION
+ _LONG_ 0 # XTYPE_INTERRUPT
+ _LONG_ 0 # XTYPE_EJTAG
+
+/* *********************************************************************
+ * Common Data
+ ********************************************************************* */
+
+ .bss
+
+
+/* *********************************************************************
+ * Code
+ ********************************************************************* */
+
+ .text
+
+#define R_EXC_CERR_TEMPLATE _TBLIDX(0)
+#define R_EXC_CERR_TEMPLATE_END _TBLIDX(1)
+
+ .globl _exc_cerr_htable
+_exc_cerr_htable:
+ _LONG_ _exc_cerr_template
+ _LONG_ _exc_cerr_template_end
+
+
+/* *********************************************************************
+ * _exc_cerr_template
+ *
+ * This is a template routine for our cache error handler.
+ * We save a couple of registers in our magic save area, then
+ * dispatch to code elsewhere in CFE.
+ *
+ * This code is copied right to the vector address, so it has
+ * to be kept tiny!
+ *
+ * Input parameters:
+ * nothing - running uncached, all registers trashed
+ *
+ * Return value:
+ * might return, might not
+ ********************************************************************* */
+
+LEAF(_exc_cerr_template)
+
+ /*
+ * Magic! When the cache error handler is running,
+ * we are in a very special state, running uncached
+ * and with translations turned off. We can use offsets
+ * from r0(zero) to store registers we need to use
+ * during the error handler.
+ */
+
+ .set push ; .set noreorder
+
+ SR k0,CFE_LOCORE_GLOBAL_K0TMP(zero)
+ SR k1,CFE_LOCORE_GLOBAL_K1TMP(zero)
+ SR ra,CFE_LOCORE_GLOBAL_RATMP(zero)
+ SR gp,CFE_LOCORE_GLOBAL_GPTMP(zero)
+
+ LR k0,CFE_LOCORE_GLOBAL_CERRH(zero)
+ jal k0
+ nop
+
+ LR k0,CFE_LOCORE_GLOBAL_K0TMP(zero)
+ LR k1,CFE_LOCORE_GLOBAL_K1TMP(zero)
+ LR ra,CFE_LOCORE_GLOBAL_RATMP(zero)
+ LR gp,CFE_LOCORE_GLOBAL_GPTMP(zero)
+ ERET
+
+ .set pop
+
+ /*
+ * Note: make sure this routine does not exceed 128 bytes
+ */
+
+_exc_cerr_template_end:
+
+END(_exc_cerr_template)
+
+/* *********************************************************************
+ * _exc_setup_locore(cerrh)
+ *
+ * Set global data into the low-memory region. We do this in
+ * assembly language so it's easier to deal with the 32-bit/64-bit
+ * issues that arise in the "C" code.
+ *
+ * Input parameters:
+ * a0 - cache error handler
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+LEAF(_exc_setup_locore)
+
+ move t4,ra
+
+ /*
+ * Save GP for easy re-use, using uncached writes.
+ */
+
+ li t0,PHYS_TO_K1(CFE_LOCORE_GLOBAL_GP)
+ SR gp,0(t0)
+
+ /*
+ * Initialize cache error handler pointer. Make it
+ * uncached, since cache error handlers should not
+ * touch the cache.
+ */
+
+ li t1,(K0SIZE-1)
+ and a0,a0,t1 # keep just physical part
+ li t1,K1BASE
+ or a0,a0,t1 # make into an uncached address
+
+ li t0,PHYS_TO_K1(CFE_LOCORE_GLOBAL_CERRH)
+ SR a0,0(t0)
+
+ /*
+ * Move the cache error handler into low RAM.
+ */
+
+ li t0,PHYS_TO_K1(MIPS_RAM_VEC_CACHEERR)
+
+ LOADREL(t1,_exc_cerr_htable)
+ LR t2,R_EXC_CERR_TEMPLATE_END(t1)
+ LR t1,R_EXC_CERR_TEMPLATE(t1)
+
+1: lw t3,0(t1) # get a word
+ sw t3,0(t0) # write a word
+ ADD t0,4 # next word...
+ ADD t1,4
+ blt t1,t2,1b # till done
+
+ /*
+ * Now do the whole thing again, but with cached writes.
+ * Writing uncached makes sure the data is actually in memory,
+ * and writing cached makes sure we write the same
+ * stuff again when the cache is evicted.
+ * This way we don't have to bother with cacheops,
+ * a bonus on the BCM1250 with its funky L2.
+ */
+
+ li t0,PHYS_TO_K0(CFE_LOCORE_GLOBAL_GP)
+ SR gp,0(t0)
+
+ li t0,PHYS_TO_K0(CFE_LOCORE_GLOBAL_CERRH)
+ SR a0,0(t0)
+
+ li t0,PHYS_TO_K0(MIPS_RAM_VEC_CACHEERR)
+
+ LOADREL(t1,_exc_cerr_htable)
+ LR t2,R_EXC_CERR_TEMPLATE_END(t1)
+ LR t1,R_EXC_CERR_TEMPLATE(t1)
+
+1: lw t3,0(t1) # get a word
+ sw t3,0(t0) # write a word
+ ADD t0,4 # next word...
+ ADD t1,4
+ blt t1,t2,1b # till done
+
+
+ /*
+ * done!
+ */
+
+ move ra,t4
+ j ra
+
+END(_exc_setup_locore)
+
+
+
+
+/* *********************************************************************
+ * _exc_setvector(xtype,addr)
+ *
+ * Set an exception vector address
+ *
+ * Input parameters:
+ * xtype - exception vector type
+ * addr - routine address
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+LEAF(_exc_setvector)
+
+ la v0,_exc_vectab
+ srl a0,3 /* convert 8-byte index to array index */
+ sll a0,BPWSIZE /* convert back to index appropriate for word size */
+ add v0,a0
+ SR a1,(v0)
+ j ra
+
+END(_exc_setvector)
+
+
+/* *********************************************************************
+ * _exc_crash_sim()
+ *
+ * Crash the GDB simulator, causing it to exit.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing - does not return
+ ********************************************************************* */
+
+
+LEAF(_exc_crash_sim)
+
+ li $2,1
+ li $3,0xdead
+ li $4,0
+ syscall 0xca
+1: b 1b
+
+END(_exc_crash_sim)
+
+
+/* *********************************************************************
+ * _exc_cache_crash_sim()
+ *
+ * As _exc_crash_sim, but distinguish cache error exception.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing - does not return
+ ********************************************************************* */
+
+
+LEAF(_exc_cache_crash_sim)
+
+ li $2,1
+ li $3,0xbadc
+ li $4,0
+ syscall 0xca
+1: b 1b
+
+END(_exc_cache_crash_sim)
+
+
+/* *********************************************************************
+ * _exc_restart()
+ *
+ * Restart the firmware at the boot address
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+LEAF(_exc_restart)
+
+ li t0,0xBFC00000 # ROM restart vector
+ jr t0
+
+END(_exc_restart)
+
+/* *********************************************************************
+ * _exc_entry(k0)
+ *
+ * Main exception entry point.
+ *
+ * Input parameters:
+ * k0 - exception type
+ *
+ * Return value:
+ * ...
+ ********************************************************************* */
+
+LEAF(_exc_entry)
+
+ .set noreorder
+ .set noat
+
+ subu k1,sp,EXCEPTION_SIZE
+ SRL k1,3
+ SLL k1,3
+
+ SREG zero,XGR_ZERO(k1)
+ SREG AT,XGR_AT(k1)
+
+ SREG v0,XGR_V0(k1)
+ SREG v1,XGR_V1(k1)
+
+ SREG a0,XGR_A0(k1)
+ SREG a1,XGR_A1(k1)
+ SREG a2,XGR_A2(k1)
+ SREG a3,XGR_A3(k1)
+
+ SREG t0,XGR_T0(k1)
+ SREG t1,XGR_T1(k1)
+ SREG t2,XGR_T2(k1)
+ SREG t3,XGR_T3(k1)
+ SREG t4,XGR_T4(k1)
+ SREG t5,XGR_T5(k1)
+ SREG t6,XGR_T6(k1)
+ SREG t7,XGR_T7(k1)
+
+ SREG s0,XGR_S0(k1)
+ SREG s1,XGR_S1(k1)
+ SREG s2,XGR_S2(k1)
+ SREG s3,XGR_S3(k1)
+ SREG s4,XGR_S4(k1)
+ SREG s5,XGR_S5(k1)
+ SREG s6,XGR_S6(k1)
+ SREG s7,XGR_S7(k1)
+
+ SREG t8,XGR_T8(k1)
+ SREG t9,XGR_T9(k1)
+
+ SREG gp,XGR_GP(k1)
+ SREG sp,XGR_SP(k1)
+ SREG fp,XGR_FP(k1)
+ SREG ra,XGR_RA(k1)
+
+ mfc0 t0,C0_CAUSE
+ mfc0 t1,C0_SR
+ MFC0 t2,C0_BADVADDR
+ MFC0 t3,C0_EPC
+ mfc0 t4,C0_PRID
+ mflo t5
+ mfhi t6
+ SREG t0,XCP0_CAUSE(k1)
+ SREG t1,XCP0_SR(k1)
+ SREG t2,XCP0_VADDR(k1)
+ SREG t3,XCP0_EPC(k1)
+ SREG t4,XCP0_PRID(k1)
+ SREG t5,XGR_LO(k1)
+ SREG t6,XGR_HI(k1)
+
+#if CFG_EMBEDDED_PIC
+ la gp,PHYS_TO_K0(CFE_LOCORE_GLOBAL_GP)
+ LR gp,0(gp) # get our GP handle from low memory vector
+#else
+ la gp,_gp # Load up GP, not relocated so it's easy
+#endif
+
+ move a0,k0 # Pass exception type
+ move a1,k1 # Pass frame to exception handler
+ la t0,_exc_vectab # get base of exception vectors
+ srl k0,3 # convert 8-byte index to array index
+ sll k0,BPWSIZE # convert back to index appropriate for word size
+ addu t0,k0 # get vector address
+ LR t0,(t0) # to call handler
+
+ move sp,k1 # "C" gets fresh stack area
+
+ jalr t0 # Call exception handler
+ nop
+
+ move k1, sp
+ LREG AT,XGR_AT(k1)
+
+ LREG t0,XGR_LO(k1)
+ LREG t1,XGR_HI(k1)
+ mtlo t0
+ mthi t1
+
+ LREG a0,XGR_A0(k1)
+ LREG a1,XGR_A1(k1)
+ LREG a2,XGR_A2(k1)
+ LREG a3,XGR_A3(k1)
+
+ LREG t0,XGR_T0(k1)
+ LREG t1,XGR_T1(k1)
+ LREG t2,XGR_T2(k1)
+ LREG t3,XGR_T3(k1)
+ LREG t4,XGR_T4(k1)
+ LREG t5,XGR_T5(k1)
+ LREG t6,XGR_T6(k1)
+ LREG t7,XGR_T7(k1)
+
+ LREG s0,XGR_S0(k1)
+ LREG s1,XGR_S1(k1)
+ LREG s2,XGR_S2(k1)
+ LREG s3,XGR_S3(k1)
+ LREG s4,XGR_S4(k1)
+ LREG s5,XGR_S5(k1)
+ LREG s6,XGR_S6(k1)
+ LREG s7,XGR_S7(k1)
+
+ LREG t8,XGR_T8(k1)
+ LREG t9,XGR_T9(k1)
+
+ LREG gp,XGR_GP(k1)
+ LREG sp,XGR_SP(k1)
+ LREG fp,XGR_FP(k1)
+ LREG ra,XGR_RA(k1)
+
+/* do any CP0 cleanup here */
+
+ LREG v0,XGR_V0(k1)
+ LREG v1,XGR_V1(k1)
+
+ ERET
+
+ .set at
+ .set reorder
+
+
+END(_exc_entry)
+
+
+/* *********************************************************************
+ * _exc_clear_sr_exl()
+ *
+ * Clear SR(EXL) and return to caller.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+LEAF(_exc_clear_sr_exl)
+
+ mfc0 t0,C0_SR
+ and t0,t0,~(0x02) # clear SR(EXL). Bit 1
+ mtc0 t0,C0_SR
+
+ HAZARD
+
+ j ra
+
+END(_exc_clear_sr_exl)
+
+/* *********************************************************************
+ * _exc_clear_sr_erl()
+ *
+ * Clear SR(ERL) and return to caller.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+LEAF(_exc_clear_sr_erl)
+
+ mfc0 t0,C0_SR
+ and t0,t0,~(0x04) # clear SR(ERL). Bit 2
+ mtc0 t0,C0_SR
+
+ HAZARD
+
+ j ra
+
+END(_exc_clear_sr_erl)
+
+
+/* *********************************************************************
+ * End
+ ********************************************************************* */
+
+
diff --git a/cfe/cfe/arch/mips/common/src/exchandler.c b/cfe/cfe/arch/mips/common/src/exchandler.c
new file mode 100644
index 0000000..d69b980
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/exchandler.c
@@ -0,0 +1,580 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Exception Handler File: exchandler.c
+ *
+ * This is the "C" part of the exception handler and the
+ * associated setup routines. We call these routines from
+ * the assembly-language exception handler.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "sbmips.h"
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "exception.h"
+#include "cfe.h"
+#include "cfe_error.h"
+#include "cfe_iocb.h"
+#include "exchandler.h"
+#include "cpu_config.h"
+#include "bsp_config.h"
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+/*
+ * Temporary until all our CPU packages support a cache error handler
+ */
+
+#ifndef CPUCFG_CERRHANDLER
+#define CPUCFG_CERRHANDLER 0xBFC00000
+#else
+extern void CPUCFG_CERRHANDLER(void);
+#endif
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+exc_handler_t exc_handler;
+extern void _exc_entry(void);
+extern void _exc_setup_locore(long);
+extern void CPUCFG_TLBHANDLER(void);
+extern void cfe_flushcache(uint32_t,long,long);
+extern uint32_t _getstatus(void);
+extern void _setstatus(uint32_t);
+
+static const char *regnames = "0 ATv0v1a0a1a2a3t0t1t2t3t4t5t6t7"
+ "s0s1s2s3s4s5s6s7t8t9k0k1gpspfpra";
+static const char *excnames =
+ "Interrupt" /* 0 */
+ "TLBMod " /* 1 */
+ "TLBMissRd" /* 2 */
+ "TLBMissWr" /* 3 */
+ "AddrErrRd" /* 4 */
+ "AddrErrWr" /* 5 */
+ "BusErrRd " /* 6 */
+ "BusErrWr " /* 7 */
+ "Syscall " /* 8 */
+ "Breakpt " /* 9 */
+ "InvOpcode" /* 10 */
+ "CoProcUnu" /* 11 */
+ "ArithOvfl" /* 12 */
+ "TrapExc " /* 13 */
+ "VCEI " /* 14 */
+ "FPUExc " /* 15 */
+ "CP2Exc " /* 16 */
+ "Exc17 " /* 17 */
+ "Exc18 " /* 18 */
+ "Exc19 " /* 19 */
+ "Exc20 " /* 20 */
+ "Exc21 " /* 21 */
+ "Exc22 " /* 22 */
+ "Watchpt " /* 23 */
+ "Exc24 " /* 24 */
+ "Exc25 " /* 25 */
+ "Exc26 " /* 26 */
+ "Exc27 " /* 27 */
+ "Exc28 " /* 28 */
+ "Exc29 " /* 29 */
+ "Exc30 " /* 30 */
+ "VCED "; /* 31 */
+
+
+
+/* *********************************************************************
+ * cfe_exception(code,info)
+ *
+ * Exception handler. This routine is called when any CPU
+ * exception that is handled by the assembly-language
+ * vectors is reached. The usual thing to do here is just to
+ * reboot.
+ *
+ * Input parameters:
+ * code - exception type
+ * info - exception stack frame
+ *
+ * Return value:
+ * usually reboots
+ ********************************************************************* */
+
+void cfe_exception(int code,uint64_t *info)
+{
+ int idx;
+
+ SETLEDS("EXC!");
+
+ if(exc_handler.catch_exc == 1) {
+ /*Deal with exception without restarting CFE.*/
+
+ /*Clear relevant SR bits*/
+ _exc_clear_sr_exl();
+ _exc_clear_sr_erl();
+
+ /*Reset flag*/
+ exc_handler.catch_exc = 0;
+
+ exc_longjmp_handler();
+ }
+
+
+#ifdef _MIPSREGS32_
+ xprintf("**Exception %d: EPC=%08X, Cause=%08X (%9s)\n",
+ code,(uint32_t)info[XCP0_EPC],
+ (uint32_t)info[XCP0_CAUSE],
+ excnames + G_CAUSE_EXC((uint32_t)info[XCP0_CAUSE])*9);
+ xprintf(" RA=%08X, VAddr=%08X\n",
+ (uint32_t)info[XGR_RA],(uint32_t)info[XCP0_VADDR]);
+ xprintf("\n");
+ for (idx = 0;idx < 32; idx+= 2) {
+ xprintf(" %2s ($%2d) = %08X %2s ($%2d) = %08X\n",
+ regnames+(idx*2),
+ idx,(uint32_t)info[XGR_ZERO+idx],
+ regnames+((idx+1)*2),
+ idx+1,(uint32_t)info[XGR_ZERO+idx+1]);
+ }
+#else
+ xprintf("**Exception %d: EPC=%016llX, Cause=%08X (%9s)\n",
+ code,info[XCP0_EPC],info[XCP0_CAUSE],
+ excnames + G_CAUSE_EXC((uint32_t)info[XCP0_CAUSE])*9);
+ xprintf(" RA=%016llX, VAddr=%016llX\n",
+ info[XGR_RA],info[XCP0_VADDR]);
+ xprintf("\n");
+ for (idx = 0;idx < 32; idx+= 2) {
+ xprintf(" %2s ($%2d) = %016llX %2s ($%2d) = %016llX\n",
+ regnames+(idx*2),
+ idx,info[XGR_ZERO+idx],
+ regnames+((idx+1)*2),
+ idx+1,info[XGR_ZERO+idx+1]);
+ }
+#endif
+
+ xprintf("\n");
+ _exc_restart();
+}
+
+#if (!CFG_BOOTRAM) && (CFG_RUNFROMKSEG0)
+/* *********************************************************************
+ * exc_setup_hw_vector(vecoffset,target,k0code)
+ *
+ * Install a patch of code at the specified offset in low
+ * KSEG0 memory that will jump to 'target' and load k0
+ * with the specified code value. This is used when we
+ * run with RAM vectors.
+ *
+ * Input parameters:
+ * vecoffset - offset into KSEG0
+ * target - location where we should branch when vector is called
+ * k0code - value to load into K0 before branching
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void exc_setup_hw_vector(uint32_t vecoffset,
+ void *target,
+ uint32_t k0code)
+{
+ uint32_t *vec;
+ uint32_t new;
+ uint32_t lower,upper;
+
+ new = (uint32_t) (intptr_t) target; /* warning: assumes compatibility addresses! */
+
+ lower = new & 0xffff;
+ upper = (new >> 16) & 0xffff;
+ if ((lower & 0x8000) != 0) {
+ upper++;
+ }
+
+ /*
+ * Get a KSEG0 version of the vector offset.
+ */
+ vec = (uint32_t *) PHYS_TO_K0(vecoffset);
+
+ /*
+ * Patch in the vector. Note that we have to flush
+ * the L1 Dcache and invalidate the L1 Icache before
+ * we can use this.
+ */
+
+ vec[0] = 0x3c1b0000 | upper; /* lui k1, HIGH(new) */
+ vec[1] = 0x277b0000 | lower; /* addiu k1, k1, LOW(new) */
+ vec[2] = 0x03600008; /* jr k1 */
+ vec[3] = 0x241a0000 | k0code; /* li k0, code */
+
+}
+
+
+/* *********************************************************************
+ * exc_install_ram_vectors()
+ *
+ * Install all of the hardware vectors into low memory,
+ * flush the cache, and clear the BEV bit so we can start
+ * using them.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void exc_install_ram_vectors(void)
+{
+ uint32_t *ptr;
+ int idx;
+
+ /* Debug: blow away the vector area so we can see what we did */
+ ptr = (uint32_t *) PHYS_TO_K0(0);
+ for (idx = 0; idx < 0x1000/sizeof(uint32_t); idx++) *ptr++ = 0;
+
+ /*
+ * Set up the vectors. The cache error handler is set up
+ * specially.
+ */
+
+ exc_setup_hw_vector(MIPS_RAM_VEC_TLBFILL, CPUCFG_TLBHANDLER,XTYPE_TLBFILL);
+ exc_setup_hw_vector(MIPS_RAM_VEC_XTLBFILL, _exc_entry,XTYPE_XTLBFILL);
+ exc_setup_hw_vector(MIPS_RAM_VEC_CACHEERR, _exc_entry,XTYPE_CACHEERR);
+ exc_setup_hw_vector(MIPS_RAM_VEC_EXCEPTION,_exc_entry,XTYPE_EXCEPTION);
+ exc_setup_hw_vector(MIPS_RAM_VEC_INTERRUPT,_exc_entry,XTYPE_INTERRUPT);
+
+ /*
+ * Flush the D-cache and invalidate the I-cache so we can start
+ * using these vectors.
+ */
+
+ cfe_flushcache(CFE_CACHE_FLUSH_D | CFE_CACHE_INVAL_I,0,0);
+
+ /*
+ * Write the handle into our low memory space. If we need to save
+ * other stuff down there, this is a good place to do it.
+ * This call uses uncached writes - we have not touched the
+ * memory in the handlers just yet, so they should not be
+ * in our caches.
+ */
+
+ _exc_setup_locore((intptr_t) CPUCFG_CERRHANDLER);
+
+ /*
+ * Finally, clear BEV so we'll use the vectors in RAM.
+ */
+
+ _setstatus(_getstatus() & ~M_SR_BEV);
+
+ /*
+ * XXX There's a hazard here, but we're not going to worry about
+ * XXX it. It is unlikely we'll use the vectors any time soon.
+ */
+}
+#endif
+
+/* *********************************************************************
+ * cfe_setup_exceptions()
+ *
+ * Set up the exception handlers.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+void cfe_setup_exceptions(void)
+{
+ _exc_setvector(XTYPE_TLBFILL, (void *) cfe_exception);
+ _exc_setvector(XTYPE_XTLBFILL, (void *) cfe_exception);
+ _exc_setvector(XTYPE_CACHEERR, (void *) _exc_cache_crash_sim);
+ _exc_setvector(XTYPE_EXCEPTION,(void *) cfe_exception);
+ _exc_setvector(XTYPE_INTERRUPT,(void *) cfe_exception);
+ _exc_setvector(XTYPE_EJTAG, (void *) cfe_exception);
+
+ exc_handler.catch_exc = 0;
+ q_init( &(exc_handler.jmpbuf_stack));
+
+#if (!CFG_BOOTRAM) && (CFG_RUNFROMKSEG0)
+ /*
+ * Install RAM vectors, and clear the BEV bit in the status
+ * register. Don't do this if we're running from PromICE RAM
+ */
+ exc_install_ram_vectors();
+#endif
+}
+
+
+
+/* *********************************************************************
+ * exc_initialize_block()
+ *
+ * Set up the exception handler. Allow exceptions to be caught.
+ * Allocate memory for jmpbuf and store it away.
+ *
+ * Returns NULL if error in memory allocation.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * jmpbuf_t structure, or NULL if no memory
+ ********************************************************************* */
+jmpbuf_t *exc_initialize_block(void)
+{
+ jmpbuf_t *jmpbuf_local;
+
+ exc_handler.catch_exc = 1;
+
+ /* Create the jmpbuf_t object */
+ jmpbuf_local = (jmpbuf_t *) KMALLOC((sizeof(jmpbuf_t)),0);
+
+ if (jmpbuf_local == NULL) {
+ return NULL;
+ }
+
+ q_enqueue( &(exc_handler.jmpbuf_stack), &((*jmpbuf_local).stack));
+
+ return jmpbuf_local;
+}
+
+/* *********************************************************************
+ * exc_cleanup_block(dq_jmpbuf)
+ *
+ * Remove dq_jmpbuf from the exception handler stack and free
+ * the memory.
+ *
+ * Input parameters:
+ * dq_jmpbuf - block to deallocate
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void exc_cleanup_block(jmpbuf_t *dq_jmpbuf)
+{
+ int count;
+
+ if (dq_jmpbuf == NULL) {
+ return;
+ }
+
+ count = q_count( &(exc_handler.jmpbuf_stack));
+
+ if( count > 0 ) {
+ q_dequeue( &(*dq_jmpbuf).stack );
+ KFREE(dq_jmpbuf);
+ }
+}
+
+/* *********************************************************************
+ * exc_cleanup_handler(dq_jmpbuf,chain_exc)
+ *
+ * Clean a block, then chain to the next exception if required.
+ *
+ * Input parameters:
+ * dq_jmpbuf - current exception
+ * chain_exc - true if we should chain to the next handler
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void exc_cleanup_handler(jmpbuf_t *dq_jmpbuf, int chain_exc)
+{
+ exc_cleanup_block(dq_jmpbuf);
+
+ if( chain_exc == EXC_CHAIN_EXC ) {
+ /*Go to next exception on stack */
+ exc_longjmp_handler();
+ }
+}
+
+
+
+/* *********************************************************************
+ * exc_longjmp_handler()
+ *
+ * This routine long jumps to the exception handler on the top
+ * of the exception stack.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+void exc_longjmp_handler(void)
+{
+ int count;
+ jmpbuf_t *jmpbuf_local;
+
+ count = q_count( &(exc_handler.jmpbuf_stack));
+
+ if( count > 0 ) {
+ jmpbuf_local = (jmpbuf_t *) q_getlast(&(exc_handler.jmpbuf_stack));
+
+ SETLEDS("CFE ");
+
+ lib_longjmp( (*jmpbuf_local).jmpbuf, -1);
+ }
+}
+
+
+/* *********************************************************************
+ * mem_peek(d,addr,type)
+ *
+ * Read memory of the specified type at the specified address.
+ * Exceptions are caught in the case of a bad memory reference.
+ *
+ * Input parameters:
+ * d - pointer to where data should be placed
+ * addr - address to read
+ * type - type of read to do (MEM_BYTE, etc.)
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int mem_peek(void *d, long addr, int type)
+{
+
+ jmpbuf_t *jb;
+
+ jb = exc_initialize_block();
+ if( jb == NULL ) {
+ return CFE_ERR_NOMEM;
+ }
+
+ if (exc_try(jb) == 0) {
+
+ switch (type) {
+ case MEM_BYTE:
+ *(uint8_t *)d = *((volatile uint8_t *) addr);
+ break;
+ case MEM_HALFWORD:
+ *(uint16_t *)d = *((volatile uint16_t *) addr);
+ break;
+ case MEM_WORD:
+ *(uint32_t *)d = *((volatile uint32_t *) addr);
+ break;
+ case MEM_QUADWORD:
+ *(uint64_t *)d = *((volatile uint64_t *) addr);
+ break;
+ default:
+ return CFE_ERR_INV_PARAM;
+ }
+
+ exc_cleanup_block(jb);
+ }
+ else {
+ /*Exception handler*/
+
+ exc_cleanup_handler(jb, EXC_NORMAL_RETURN);
+ return CFE_ERR_GETMEM;
+ }
+
+ return 0;
+}
+
+/* *********************************************************************
+ * Write memory of type at address addr with value val.
+ * Exceptions are caught, handled (error message) and function
+ * returns with 0.
+ *
+ * 1 success
+ * 0 failure
+ ********************************************************************* */
+
+int mem_poke(long addr, uint64_t val, int type)
+{
+
+ jmpbuf_t *jb;
+
+ jb = exc_initialize_block();
+ if( jb == NULL ) {
+ return CFE_ERR_NOMEM;
+ }
+
+ if (exc_try(jb) == 0) {
+
+ switch (type) {
+ case MEM_BYTE:
+ *((volatile uint8_t *) addr) = (uint8_t) val;
+ break;
+ case MEM_HALFWORD:
+ *((volatile uint16_t *) addr) = (uint16_t) val;
+ break;
+ case MEM_WORD:
+ *((volatile uint32_t *) addr) = (uint32_t) val;
+ break;
+ case MEM_QUADWORD:
+ *((volatile uint64_t *) addr) = (uint64_t) val;
+ break;
+ default:
+ return CFE_ERR_INV_PARAM;
+ }
+
+ exc_cleanup_block(jb);
+ }
+ else {
+ /*Exception handler*/
+
+ exc_cleanup_handler(jb, EXC_NORMAL_RETURN);
+ return CFE_ERR_SETMEM;
+ }
+
+ return 0;
+}
+
+
+
+
+
+
+
+
+
+
diff --git a/cfe/cfe/arch/mips/common/src/init_mips.S b/cfe/cfe/arch/mips/common/src/init_mips.S
new file mode 100755
index 0000000..3f59539
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/init_mips.S
@@ -0,0 +1,683 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * CPU init module File: init_mips.S
+ *
+ * This module contains the vectors and lowest-level CPU startup
+ * functions for CFE.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "sbmips.h"
+#include "exception.h"
+
+#include "bsp_config.h"
+#include "cpu_config.h"
+
+#ifdef _CFE_
+#include "cfe_devfuncs.h"
+#else
+
+#define cfe_command_restart 0
+#endif
+
+/* BCM63XX specific change. */
+#include "bcm_hwdefs.h"
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#include "mipsmacros.h"
+
+
+/* *********************************************************************
+ * SETLEDS(a,b,c,d)
+ * SETLEDS1(a,b,c,d)
+ *
+ * Sets the on-board LED display (if present). Two variants
+ * of this routine are provided. If you're running KSEG1,
+ * call the SETLEDS1 variant, else call SETLEDS.
+ *
+ * Input parameters:
+ * a,b,c,d - four ASCII characters (literal constants)
+ *
+ * Return value:
+ * a0,k1,ra trashed
+ ********************************************************************* */
+
+#define SETLEDS(a,b,c,d) \
+ li a0,(((a)<<24)|((b)<<16)|((c)<<8)|(d)) ; \
+ CALLINIT_KSEG0(init_table,R_INIT_SETLEDS)
+
+#define SETLEDS1(a,b,c,d) \
+ li a0,(((a)<<24)|((b)<<16)|((c)<<8)|(d)) ; \
+ CALLINIT_KSEG1(init_table,R_INIT_SETLEDS)
+
+
+/* *********************************************************************
+ * Other constants
+ ********************************************************************* */
+
+/*
+ * This is the size of the stack, rounded to KByte boundaries.
+ */
+
+#ifndef CFG_STACK_SIZE
+#error "CFG_STACK_SIZE not defined"
+#else
+#define STACK_SIZE ((CFG_STACK_SIZE+1023) & ~1023)
+#endif
+
+#ifdef __MIPSEB
+#define TEXTSECTION 0x2e746578 # ".tex", big-endian
+#else
+#define TEXTSECTION 0x7865742e # ".tex", little-endian
+#endif
+
+/*
+ * Duplicates from cfe_iocb.h -- warning!
+ */
+
+#define CFE_CACHE_FLUSH_D 1
+#define CFE_CACHE_INVAL_I 2
+#define CFE_CACHE_INVAL_D 4
+#define CFE_CACHE_INVAL_L2 8
+#define CFE_CACHE_FLUSH_L2 16
+#define CFE_CACHE_INVAL_RANGE 32
+#define CFE_CACHE_FLUSH_RANGE 64
+
+
+/*
+ * To make life easier reading this code, define "KSEGBASE"
+ * to either K0BASE or K1BASE depending on whether we're running
+ * uncached.
+ */
+
+#if CFG_RUNFROMKSEG0
+#define KSEGBASE K0BASE
+#else
+#define KSEGBASE K1BASE
+#endif
+
+
+/* *********************************************************************
+ * Names of registers used in this module
+ ********************************************************************* */
+
+#define RELOCOFFSET s8 /* $30 (fp) */
+#define TEXTOFFSET t9 /* $25 (t9) */
+#define MEMTOP t8 /* $24 (t8) */
+#define TEXTBASE s7 /* $23 (s7) */
+#undef BOOT_OFFSET
+#define BOOT_OFFSET s6 /* $22 (s6) */
+
+ .sdata
+
+#include "initdata.h" /* declare variables we use here */
+
+#if CFG_MULTI_CPUS
+ .globl cfe_spinlock
+cfe_spinlock: .word 0
+#endif
+
+ .extern _fdata
+ .extern _edata
+ .extern _etext
+
+/* *********************************************************************
+ * uninitialized data
+ ********************************************************************* */
+
+ .bss
+
+ .comm __junk,4
+
+/* *********************************************************************
+ * Exception Vectors
+ ********************************************************************* */
+
+ .text
+
+ .set noreorder
+
+/*
+ * Declare the actual vectors. This expands to code that
+ * must be at the very beginning of the text segment.
+ */
+
+DECLARE_VECTOR(0x0000,vec_reset,cpu_reset)
+
+ .set reorder
+
+/* *********************************************************************
+ * Some offsets depend on our current configuration
+ ********************************************************************* */
+
+#define RUNTIME_RELOC_START 0
+#define RUNTIME_RELOC_STOP 0
+
+/* *********************************************************************
+ * Segment Table.
+ *
+ * Addresses of data segments and of certain routines we're going
+ * to call from KSEG1. These are here mostly for the embedded
+ * PIC case, since we can't count on the 'la' instruction to
+ * do the expected thing (the assembler expands it into a macro
+ * for doing GP-relative stuff, and the code is NOT GP-relative.
+ * So, we (relocatably) get the offset of this table and then
+ * index within it.
+ *
+ * Pointer values in this segment will be relative to KSEG0 for
+ * cached versions of CFE, so we need to OR in K1BASE in the
+ * case of calling to a uncached address.
+ *
+ * The LOADREL macro handles most of the nastiness here.
+ ********************************************************************* */
+
+#include "segtable.h"
+#include "cfe.h"
+
+ .org 0x570
+ .byte 'c','f','e','-','v',CFE_VER_MAJOR,CFE_VER_MINOR,CFE_VER_BUILD,BCM63XX_MAJOR,BCM63XX_MINOR # CFE version info for applications
+ .org 0x580 # move past exception vectors
+
+ /*
+ * BCM963XX NVRAM Data Storage
+ */
+
+ .globl nvram_data_storage
+nvram_data_storage:
+ .word NVRAM_DATA_ID
+ .space 0x400
+
+ .globl segment_table
+segment_table:
+ _LONG_ _etext # [ 0] End of text (R_SEG_ETEXT)
+ _LONG_ _fdata # [ 1] Beginning of data (R_SEG_FDATA)
+ _LONG_ _edata # [ 2] End of data (R_SEG_EDATA)
+ _LONG_ _end # [ 3] End of BSS (R_SEG_END)
+ _LONG_ _ftext # [ 4] Beginning of text (R_SEG_FTEXT)
+ _LONG_ _fbss # [ 5] Beginning of BSS (R_SEG_FBSS)
+ _LONG_ _gp # [ 6] Global Pointer (R_SEG_GP)
+ _LONG_ 0 # [ 7] Beginning of reloc entries
+ _LONG_ 0 # [ 8] End of reloc entries
+ _LONG_ 0 # [ 9] R_SEG_APIENTRY
+
+/* *********************************************************************
+ * Init Table.
+ *
+ * This is like segment_table except it contains pointers to
+ * routines used during initialization. It serves both as a
+ * table for doing PIC stuff and also to separate out
+ * machine-specific init routines.
+ *
+ * The CALLINIT_xxx macros are used to call routines in this table.
+ ********************************************************************* */
+
+
+ .globl init_table
+init_table:
+ _LONG_ board_earlyinit # [ 0] R_INIT_EARLYINIT
+ _LONG_ board_setleds # [ 1] R_INIT_SETLEDS
+ _LONG_ board_draminfo # [ 2] R_INIT_DRAMINFO
+ _LONG_ CPUCFG_CPUINIT # [ 3] R_INIT_CPUINIT
+ _LONG_ CPUCFG_ALTCPU_START1 # [ 4] R_INIT_ALTCPU_START1
+ _LONG_ CPUCFG_ALTCPU_START2 # [ 5] R_INIT_ALTCPU_START2
+ _LONG_ CPUCFG_ALTCPU_RESET # [ 6] R_INIT_ALTCPU_RESET
+ _LONG_ CPUCFG_CPURESTART # [ 7] R_INIT_CPURESTART
+ _LONG_ CPUCFG_DRAMINIT # [ 8] R_INIT_DRAMINIT
+ _LONG_ CPUCFG_CACHEOPS # [ 9] R_INIT_CACHEOPS
+ _LONG_ CPUCFG_TLBHANDLER # [ 10] R_INIT_TLBHANDLER
+ _LONG_ cfe_main # [ 11] R_INIT_CMDSTART
+ _LONG_ cfe_command_restart # [ 12] R_INIT_CMDRESTART
+ _LONG_ cfe_doxreq # [ 13] R_INIT_DOXREQ
+ _LONG_ CPUCFG_TP1_SWITCH # [ 14] R_INIT_TP1_SWITCH
+ _LONG_ cfe_size_ram # [ 15] R_INIT_SIZERAM
+
+/* *********************************************************************
+ * CPU Startup Code
+ ********************************************************************* */
+
+cpu_reset:
+
+ /*
+ * Start with GP as zero. Nobody should touch
+ * this or set it to any other value until we're ready
+ * to use it. This is used to tell when we should start
+ * using relocated references in the init table,
+ * so beware! (see CALLINIT_RELOC in mipsmacros.h)
+ */
+
+ move gp,zero # start with no GP.
+
+ .set noreorder
+ bal 1f
+ nop
+1: nop
+ .set reorder
+ li BOOT_OFFSET, 0x1fff0000
+ and BOOT_OFFSET, ra
+
+#------------------------------------------------------------------------------
+
+ /*
+ * Do low-level board initialization. This is our first
+ * chance to customize the startup sequence.
+ */
+ move a0, BOOT_OFFSET
+
+ CALLINIT_KSEG1(init_table,R_INIT_EARLYINIT)
+
+ SETLEDS1('H','E','L','O')
+
+ CALLINIT_KSEG1(init_table,R_INIT_CPUINIT)
+
+#------------------------------------------------------------------------------
+
+ /*
+ * Now, switch from KSEG1 to KSEG0
+ */
+
+#if CFG_RUNFROMKSEG0
+ bal cpu_kseg0_switch
+#endif
+
+#------------------------------------------------------------------------------
+ /*
+ * Now running on cpu0 in K0SEG.
+ */
+
+#if CFG_CMT
+ /*
+ * Check if the thread switch is required. If we are already
+ * running on thread 1 this function will do nothing and just return
+ * If we are running on thread 0 this function will take thread 1
+ * out of reset and put thread 0 to sleep waiting for singnal from
+ * thread 1.
+ */
+ CALLINIT_KSEG0(init_table,R_INIT_TP1_SWITCH)
+#endif
+
+#if CFG_INIT_DRAM
+ SETLEDS('D','R','A','M')
+
+ CALLINIT_KSEG0(init_table,R_INIT_DRAMINFO)
+
+ move a0,v0 # pass these params
+ CALLINIT_KSEG0(init_table,R_INIT_DRAMINIT)
+ CALLINIT_KSEG0(init_table,R_INIT_SIZERAM)
+ move k0,v0 # Save in k0 for now
+#else
+ li k0,(CFG_DRAM_SIZE * 1024)
+#endif
+
+#------------------------------------------------------------------------------
+
+#if CFG_BOOTRAM
+ b have_ram # No RAM is ok if using emulator RAM
+#endif
+
+ bne k0,zero,have_ram
+
+ SETLEDS('R','A','M','X') # die here if no ram
+
+die1: b die1
+
+have_ram:
+
+ /*
+ * If this is the 64-bit version, turn on the KX bit
+ * to allow 64-bit accesses.
+ */
+
+#ifdef __long64
+ mfc0 t0,C0_SR
+ or t0,t0,M_SR_KX
+ mtc0 t0,C0_SR
+#endif
+
+#------------------------------------------------------------------------------
+ /*
+ * K0 contains the RAM size (and therefore the top of RAM
+ * offset). Start there, and subtract the amount of memory
+ * we expect to use. If we have more than 256MB of
+ * physical memory, work backwards from the 256MB
+ * boundary.
+ */
+
+__CalcMemTop: li MEMTOP,256 # 256MB boundary
+ bgt k0,MEMTOP,1f # use 256MB if k0 is greater
+ move MEMTOP,k0 # otherwise keep top
+1: sll MEMTOP,20 # make into byte amount
+
+ li RELOCOFFSET,0 # not relocating, no offset
+ li TEXTOFFSET,0
+
+ /*
+ * DRAM is now running, and we're alive in cacheable memory
+ * on cpu0 in K0SEG. Set up GP.
+ */
+
+ LOADREL(a0,segment_table)
+ LR gp,R_SEG_GP(a0)
+ add gp,RELOCOFFSET
+
+#------------------------------------------------------------------------------
+ /*
+ * Zero BSS
+ */
+
+ SETLEDS('Z','B','S','S')
+
+ LOADREL(a0,segment_table)
+__ZeroBss:
+
+ LR v0,R_SEG_FBSS(a0)
+ LR v1,R_SEG_END(a0)
+ ADD v0,RELOCOFFSET # Relocate to actual data segment
+ ADD v1,RELOCOFFSET
+
+1: SR zero,0(v0) # Zero one cacheline at a time
+ SR zero,(REGSIZE*1)(v0)
+ SR zero,(REGSIZE*2)(v0)
+ SR zero,(REGSIZE*3)(v0)
+ add v0,REGSIZE*4
+ blt v0,v1,1b
+
+#------------------------------------------------------------------------------
+ /*
+ * Copy code
+ */
+
+ SETLEDS('C','O','D','E')
+
+ LOADREL(a0,segment_table)
+__CopyCode:
+
+ LR t1,R_SEG_FTEXT(a0) # destination address
+ move TEXTBASE,t1
+
+ LR t2,R_SEG_FTEXT(a0) # Source address
+ FIXUP (t2);
+ LR t3,R_SEG_ETEXT(a0)
+ FIXUP (t3);
+
+1: LR t4,0(t2) # read one cache line
+ LR t5,(REGSIZE*1)(t2)
+ LR t6,(REGSIZE*2)(t2)
+ LR t7,(REGSIZE*3)(t2)
+ SR t4,0(t1) # write one cache line
+ SR t5,(REGSIZE*1)(t1)
+ SR t6,(REGSIZE*2)(t1)
+ SR t7,(REGSIZE*3)(t1)
+ add t1,REGSIZE*4
+ add t2,REGSIZE*4
+ bltu t2,t3,1b
+
+#------------------------------------------------------------------------------
+ /*
+ * Copy initialized data
+ */
+
+#if (CFG_BOOTRAM == 0)
+
+ SETLEDS('D','A','T','A')
+
+ LOADREL(a0,segment_table)
+
+__CopyData:
+ LR t1,R_SEG_FDATA(a0)
+ FIXUP (t1);
+ li t0,15
+ add t1,t0
+ not t0
+ and t1,t0 # t1 = _etext rounded up to 16-byte boundary
+
+ LR t2,R_SEG_FDATA(a0)
+ LR t3,R_SEG_EDATA(a0)
+ ADD t2,RELOCOFFSET # Relocate to actual data segment
+ ADD t3,RELOCOFFSET
+
+1: LR t4,0(t1) # read one cache line
+ LR t5,(REGSIZE*1)(t1)
+ LR t6,(REGSIZE*2)(t1)
+ LR t7,(REGSIZE*3)(t1)
+ SR t4,0(t2) # write one cache line
+ SR t5,(REGSIZE*1)(t2)
+ SR t6,(REGSIZE*2)(t2)
+ SR t7,(REGSIZE*3)(t2)
+ add t1,(REGSIZE*4)
+ add t2,(REGSIZE*4)
+ bltu t2,t3,1b
+
+#endif
+
+#------------------------------------------------------------------------------
+
+ /*
+ * Flush the cache, then switch to relocated code
+ * We need to flush the cache since we just moved the code and
+ * it may still live in our L1 DCache. We also need to
+ * flush L2, since there are some rare times we run
+ * uncached from DRAM, like when we start/stop a CPU.
+ *
+ * In the case of running completely uncached, don't flush the
+ * cache. It should not have any dirty lines in it, but you
+ * never know...
+ */
+
+__GoRelo:
+
+#if CFG_RUNFROMKSEG0
+ SETLEDS('L','1','2','F')
+
+ li a0,CFE_CACHE_FLUSH_D | CFE_CACHE_FLUSH_L2
+ CALLINIT_KSEG0(init_table,R_INIT_CACHEOPS)
+ li a0,CFE_CACHE_INVAL_I
+ CALLINIT_KSEG0(init_table,R_INIT_CACHEOPS)
+#endif /* CFG_RUNFROMKSEG0 */
+
+ la t0,gorelo # Now jump to an address code was compiled for
+ j t0 # and go there
+gorelo: nop
+ li BOOT_OFFSET, 0 # no longer running at offset
+
+ /*
+ * Remember total amount of memory. This is *still* in k0
+ * after all this time. Hopefully.
+ */
+
+__MemVars:
+ SR k0,mem_totalsize
+ SR RELOCOFFSET,mem_datareloc
+
+ move v0,zero
+
+ LOADREL(a0,segment_table) # trashed by l2 cache flush
+ LR v0,R_SEG_FDATA(a0)
+ ADD v0,RELOCOFFSET
+ LR v1,R_SEG_END(a0)
+ ADD v1,RELOCOFFSET
+
+ SR v0,mem_bottomofmem
+ SR v1,mem_heapstart
+
+ add v1,(CFG_HEAP_SIZE*1024) # Otherwise
+ add v1,STACK_SIZE
+ SR v1,mem_topofmem
+
+ SR TEXTOFFSET,mem_textreloc
+
+ /* At this point it's safe to use the CALLINIT_RELOC macro */
+
+ LR t1,R_SEG_FTEXT(a0)
+ FIXUP (t1);
+ LR t0,R_SEG_ETEXT(a0)
+ FIXUP (t0);
+ sub t0,t0,t1
+ SR t0,mem_textsize
+ add t1,TEXTOFFSET
+ SR t1,mem_textbase
+
+
+#------------------------------------------------------------------------------
+
+ /*
+ * Stash away some config register stuff
+ */
+
+ mfc0 v0,C0_PRID
+ SR v0,cpu_prid
+
+
+#------------------------------------------------------------------------------
+
+ /*
+ * Set up the "C" stack and jump to the main routine.
+ */
+
+ SETLEDS('M','A','I','N')
+
+ LR sp,mem_heapstart
+ ADD sp,((CFG_HEAP_SIZE*1024)+STACK_SIZE - 8)
+ li a0,0 # call as "cfe_main(0,0)"
+ li a1,0
+
+ CALLINIT_RELOC(init_table,R_INIT_CMDSTART) # should not return
+
+/* *********************************************************************
+ * CFE_LAUNCH
+ *
+ * Start the user program. The program is passed a handle
+ * that must be passed back when calling the firmware.
+ *
+ * Parameters passed to the called program are as follows:
+ *
+ * a0 - CFE handle
+ * a1 - entry vector
+ * a2 - reserved, will be 0
+ * a3 - entrypoint signature.
+ *
+ * Input parameters:
+ * a0 - entry vector
+ *
+ * Return value:
+ * does not return
+ ********************************************************************* */
+
+LEAF(cfe_launch)
+
+ sub sp,8
+ SR a0,0(sp)
+
+ /*
+ * This function runs in RAM so BOOT_OFFSET is 0. It is called from
+ * C which could have modified the BOOT_OFFSET register, s6.
+ */
+ li BOOT_OFFSET, 0
+
+
+ /*
+ * Mask all interrupts.
+ */
+ mfc0 v0,C0_SR # Get current interrupt flag
+ li v1,M_SR_IE # master interrupt control
+ not v1 # disable interrupts
+ and v0,v1 # SR now has IE=0
+ mtc0 v0,C0_SR # put back into CP0
+
+
+ /*
+ * Flush the D-Cache, since the program we loaded is "data".
+ * Invalidate the I-Cache, so that addresses in the program
+ * region will miss and need to be filled from the data we
+ * just flushed above.
+ */
+
+ li a0,CFE_CACHE_FLUSH_D|CFE_CACHE_INVAL_I
+ CALLINIT_RELOC(init_table,R_INIT_CACHEOPS)
+
+
+ /*
+ * Set things up for launching the program. Pass the
+ * handle in A0 - apps need to remember that and pass it
+ * back.
+ */
+
+ j RunProgram
+
+END(cfe_launch)
+
+ /*
+ * This is a nice place to set a breakpoint.
+ */
+LEAF(RunProgram)
+ LR t0,0(sp) # entry point
+
+ j t0 # go for it.
+END(RunProgram)
+
+/* *********************************************************************
+ * CPU_KSEG0_SWITCH
+ *
+ * Hack the return address so we will come back in KSEG0
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+LEAF(cpu_kseg0_switch)
+
+ and ra,(K0SIZE-1)
+ or ra,K0BASE
+ jr ra
+
+END(cpu_kseg0_switch)
+
+/* *********************************************************************
+ * End
+ ********************************************************************* */
+
+
diff --git a/cfe/cfe/arch/mips/common/src/init_ram.S b/cfe/cfe/arch/mips/common/src/init_ram.S
new file mode 100755
index 0000000..2531700
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/init_ram.S
@@ -0,0 +1,889 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * CPU init module File: init_ram.S
+ *
+ * This module contains the vectors and lowest-level CPU startup
+ * functions for CFE.
+ *
+ * This is very similar to "init_mips.S" but is used when
+ * you want to locate CFE in DRAM, loading it like an
+ * application program.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "sbmips.h"
+#include "exception.h"
+
+#include "bsp_config.h"
+#include "cpu_config.h"
+
+#include "cfe_devfuncs.h"
+
+/* *********************************************************************
+ * Check some stuff
+ ********************************************************************* */
+
+#if CFG_RELOC
+#error "RAM version is not compatible with relocation."
+#endif
+#if !(CFG_RUNFROMKSEG0)
+#error "RAM version should be run cached"
+#endif
+
+#if CFG_MULTI_CPUS
+#error "Multiple CPUs not compatible with RAM version"
+#endif
+
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#include "mipsmacros.h"
+
+
+/* *********************************************************************
+ * SETLEDS(a,b,c,d)
+ *
+ * Sets the on-board LED display (if present).
+ *
+ * Input parameters:
+ * a,b,c,d - four ASCII characters (literal constants)
+ *
+ * Return value:
+ * a0,k1,ra trashed
+ ********************************************************************* */
+
+
+#define SETLEDS(a,b,c,d) \
+ li a0,(((a)<<24)|((b)<<16)|((c)<<8)|(d)) ; \
+ jal board_setleds ;
+
+
+/* *********************************************************************
+ * Other constants
+ ********************************************************************* */
+
+/*
+ * This is the size of the stack, rounded to KByte boundaries.
+ */
+
+#ifndef CFG_STACK_SIZE
+#error "CFG_STACK_SIZE not defined"
+#else
+#define STACK_SIZE ((CFG_STACK_SIZE+1023) & ~1023)
+#endif
+
+/*
+ * Duplicates from cfe_iocb.h -- warning!
+ */
+
+#define CFE_CACHE_FLUSH_D 1
+#define CFE_CACHE_INVAL_I 2
+#define CFE_CACHE_INVAL_D 4
+#define CFE_CACHE_INVAL_L2 8
+#define CFE_CACHE_FLUSH_L2 16
+#define CFE_CACHE_INVAL_RANGE 32
+#define CFE_CACHE_FLUSH_RANGE 64
+
+
+/*
+ * To make life easier reading this code, define "KSEGBASE"
+ * to either K0BASE or K1BASE depending on whether we're running
+ * uncached.
+ */
+
+#define KSEGBASE K0BASE /* RAM version always cached */
+
+
+/* *********************************************************************
+ * Names of registers used in this module
+ ********************************************************************* */
+
+ .sdata
+
+#include "initdata.h" /* declare variables we use here */
+
+#if CFG_MULTI_CPUS
+ .globl cfe_spinlock
+cfe_spinlock: .word 0
+#endif
+
+ .extern _fdata
+ .extern _edata
+ .extern _etext
+
+/* *********************************************************************
+ * uninitialized data
+ ********************************************************************* */
+
+ .bss
+
+ .comm __junk,4
+
+ .text
+
+ .set noreorder
+
+
+/* *********************************************************************
+ * CFE Entry Point (used by OS boot loaders and such)
+ ********************************************************************* */
+
+ .set noreorder
+
+ .globl vec_reset
+
+vec_reset: b cpu_reset
+ nop
+
+
+vec_apientry: b cpu_apientry
+ nop
+ .word CFE_EPTSEAL
+ .word CFE_EPTSEAL
+
+ .set reorder
+
+
+/* *********************************************************************
+ * Segment Table.
+ *
+ * Addresses of data segments and of certain routines we're going
+ * to call from KSEG1. These are here mostly for the embedded
+ * PIC case, since we can't count on the 'la' instruction to
+ * do the expected thing (the assembler expands it into a macro
+ * for doing GP-relative stuff, and the code is NOT GP-relative.
+ * So, we (relocatably) get the offset of this table and then
+ * index within it.
+ *
+ * Pointer values in this segment will be relative to KSEG0 for
+ * cached versions of CFE, so we need to OR in K1BASE in the
+ * case of calling to a uncached address.
+ *
+ * The LOADREL macro handles most of the nastiness here.
+ ********************************************************************* */
+
+
+#include "segtable.h"
+
+ .globl segment_table
+segment_table:
+ _LONG_ _etext # [ 0] End of text (R_SEG_ETEXT)
+ _LONG_ _fdata # [ 1] Beginning of data (R_SEG_FDATA)
+ _LONG_ _edata # [ 2] End of data (R_SEG_EDATA)
+ _LONG_ _end # [ 3] End of BSS (R_SEG_END)
+ _LONG_ _ftext # [ 4] Beginning of text (R_SEG_FTEXT)
+ _LONG_ _fbss # [ 5] Beginning of BSS (R_SEG_FBSS)
+ _LONG_ _gp # [ 6] Global Pointer (R_SEG_GP)
+ _LONG_ 0 # [ 7] Beginning of reloc entries
+ _LONG_ 0 # [ 8] End of reloc entries
+ _LONG_ cpu_apientry # [ 9] R_SEG_APIENTRY
+
+
+/* *********************************************************************
+ * Init Table.
+ *
+ * This is like segment_table except it contains pointers to
+ * routines used during initialization. It serves both as a
+ * table for doing PIC stuff and also to separate out
+ * machine-specific init routines.
+ *
+ * The CALLINIT_xxx macros are used to call routines in this table.
+ ********************************************************************* */
+
+
+ .globl init_table
+init_table:
+ _LONG_ board_earlyinit # [ 0] R_INIT_EARLYINIT
+ _LONG_ board_setleds # [ 1] R_INIT_SETLEDS
+ _LONG_ board_draminfo # [ 2] R_INIT_DRAMINFO
+ _LONG_ CPUCFG_CPUINIT # [ 3] R_INIT_CPUINIT
+ _LONG_ CPUCFG_ALTCPU_START1 # [ 4] R_INIT_ALTCPU_START1
+ _LONG_ CPUCFG_ALTCPU_START2 # [ 5] R_INIT_ALTCPU_START2
+ _LONG_ CPUCFG_ALTCPU_RESET # [ 6] R_INIT_ALTCPU_RESET
+ _LONG_ CPUCFG_CPURESTART # [ 7] R_INIT_CPURESTART
+ _LONG_ CPUCFG_DRAMINIT # [ 8] R_INIT_DRAMINIT
+ _LONG_ CPUCFG_CACHEOPS # [ 9] R_INIT_CACHEOPS
+ _LONG_ CPUCFG_TLBHANDLER # [ 10] R_INIT_TLBHANDLER
+ _LONG_ cfe_main # [ 11] R_INIT_CMDSTART
+ _LONG_ cfe_command_restart # [ 12] R_INIT_CMDRESTART
+ _LONG_ cfe_doxreq # [ 13] R_INIT_DOXREQ
+ _LONG_ CPUCFG_TP1_SWITCH # [ 14] R_INIT_TP1_SWITCH
+ _LONG_ bcmcore_null # [ 15] R_INIT_SIZERAM
+
+/* *********************************************************************
+ * CPU Startup Code
+ ********************************************************************* */
+
+
+cpu_reset:
+
+#------------------------------------------------------------------------------
+
+ /*
+ * Do low-level board initialization. This is our first
+ * chance to customize the startup sequence.
+ */
+
+ CALLINIT_KSEG0(init_table,R_INIT_EARLYINIT)
+
+ SETLEDS('H','E','L','O')
+
+#------------------------------------------------------------------------------
+
+ /*
+ * DRAM is now running, and we're alive in cacheable memory
+ * on cpu0 in K0SEG. Set up GP.
+ */
+
+ LOADREL(a0,segment_table)
+ LR gp,R_SEG_GP(a0)
+
+#------------------------------------------------------------------------------
+ /*
+ * Zero BSS
+ */
+
+ SETLEDS('Z','B','S','S')
+
+ LOADREL(a0,segment_table)
+__ZeroBss:
+
+ LR v0,R_SEG_FBSS(a0)
+ LR v1,R_SEG_END(a0)
+
+1: SR zero,0(v0) # Zero one cacheline at a time
+ SR zero,(REGSIZE*1)(v0)
+ SR zero,(REGSIZE*2)(v0)
+ SR zero,(REGSIZE*3)(v0)
+ add v0,REGSIZE*4
+ blt v0,v1,1b
+
+
+#------------------------------------------------------------------------------
+
+ li k0,256 # memory size in megabytes
+
+
+#ifdef __long64
+ mfc0 t0,C0_SR
+ or t0,t0,M_SR_KX
+ mtc0 t0,C0_SR
+#endif
+
+#------------------------------------------------------------------------------
+
+ /*
+ * Remember total amount of memory. This is *still* in k0
+ * after all this time. Hopefully.
+ */
+
+__MemVars:
+ SR k0,mem_totalsize
+ SR zero,mem_datareloc
+
+ move v0,zero
+
+ LOADREL(a0,segment_table) # trashed by l2 cache flush
+ LR v0,R_SEG_FTEXT(a0) # bottom = beginning of text
+ LR v1,R_SEG_END(a0)
+
+ SR v0,mem_bottomofmem
+ SR v1,mem_heapstart
+
+ add v1,(CFG_HEAP_SIZE*1024) # Otherwise
+ add v1,STACK_SIZE
+ SR v1,mem_topofmem
+
+ SR zero,mem_textreloc
+
+
+ LR t1,R_SEG_FTEXT(a0)
+ LR t0,R_SEG_ETEXT(a0)
+ sub t0,t0,t1
+ SR t0,mem_textsize
+ SR t1,mem_textbase
+
+
+#------------------------------------------------------------------------------
+
+#if CFG_MULTI_CPUS
+ /*
+ * Let secondary CPU(s) run their idle loops. Set the
+ * mailbox register to our relocation factor so we can read
+ * it out of the mailbox register and relocate GP properly.
+ */
+
+ move a0,zero
+ CALLINIT_KSEG0(init_table,R_INIT_ALTCPU_START2)
+#endif
+
+ /*
+ * Stash away some config register stuff
+ */
+
+ mfc0 v0,C0_PRID
+ SR v0,cpu_prid
+
+
+#------------------------------------------------------------------------------
+
+ /*
+ * Set up the "C" stack and jump to the main routine.
+ */
+
+ SETLEDS('M','A','I','N')
+
+ LR sp,mem_heapstart
+ ADD sp,((CFG_HEAP_SIZE*1024)+STACK_SIZE - 8)
+ li a0,0 # call as "cfe_main(0,0)"
+ li a1,0
+
+ CALLINIT_KSEG0(init_table,R_INIT_CMDSTART) # should not return
+
+
+ /*
+ * Terminate the simulator.
+ */
+
+crash_sim: li $2,1
+ li $4,0
+ syscall 0xCA
+ b cpu_reset
+
+
+
+/* *********************************************************************
+ * CFE_WARMSTART
+ *
+ * Restart the command interpreter
+ *
+ * Input parameters:
+ * A0 - command status
+ * nothing (GP has already been set up for us)
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+LEAF(cfe_warmstart)
+
+ SR a0,0(sp) # store on old stack
+ LOADREL(v0,init_table)
+ LR v0,R_INIT_CPURESTART(v0)
+ jal v0 # had better not trash GP or K1
+ LR a0,0(sp)
+
+ LR sp,mem_heapstart
+ ADD sp,((CFG_HEAP_SIZE*1024)+STACK_SIZE - 8)
+
+ /*
+ * If someone called the API to do a warm start, clear the
+ * spin lock, since the call will never return.
+ */
+
+#if CFG_MULTI_CPUS
+ SPIN_UNLOCK(cfe_spinlock,t0)
+#endif
+
+ CALLINIT_KSEG0(init_table,R_INIT_CMDRESTART) # should not return
+
+END(cfe_warmstart)
+
+/* *********************************************************************
+ * CFE_FLUSHCACHE
+ *
+ * Perform certain cache operations
+ *
+ * Input parameters:
+ * a0 - flags (CFE_CACHE_xxx flags, or zero for a default)
+ * a1,a2 - start/end of range for "range invalidate" operations
+ * (not used otherwise)
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+LEAF(_cfe_flushcache)
+
+ sub sp,32
+ SR ra,0(sp)
+ SR a0,8(sp)
+ SR s0,16(sp)
+ SR v1,24(sp)
+
+
+ CALLINIT_KSEG0(init_table,R_INIT_CACHEOPS)
+
+ LR v1,24(sp)
+ LR s0,16(sp)
+ LR a0,8(sp)
+ LR ra,0(sp)
+ add sp,32
+ j ra
+
+END(_cfe_flushcache)
+
+
+/* *********************************************************************
+ * CFE_LAUNCH
+ *
+ * Start the user program. The program is passed a handle
+ * that must be passed back when calling the firmware.
+ *
+ * Parameters passed to the called program are as follows:
+ *
+ * a0 - CFE handle
+ * a1 - entry vector
+ * a2 - reserved, will be 0
+ * a3 - entrypoint signature.
+ *
+ * Input parameters:
+ * a0 - entry vector
+ *
+ * Return value:
+ * does not return
+ ********************************************************************* */
+
+LEAF(cfe_launch)
+
+ sub sp,8
+ SR a0,0(sp)
+
+ /*
+ * Mask all interrupts.
+ */
+ mfc0 v0,C0_SR # Get current interrupt flag
+ li v1,M_SR_IE # master interrupt control
+ not v1 # disable interrupts
+ and v0,v1 # SR now has IE=0
+ mtc0 v0,C0_SR # put back into CP0
+
+ /*
+ * Flush the D-Cache, since the program we loaded is "data".
+ * Invalidate the I-Cache, so that addresses in the program
+ * region will miss and need to be filled from the data we
+ * just flushed above.
+ */
+
+ li a0,CFE_CACHE_FLUSH_D|CFE_CACHE_INVAL_I
+ CALLINIT_KSEG0(init_table,R_INIT_CACHEOPS)
+
+ /*
+ * Set things up for launching the program. Pass the
+ * handle in A0 - apps need to remember that and pass it
+ * back.
+ */
+
+ j RunProgram
+
+END(cfe_launch)
+
+ /*
+ * This is a nice place to set a breakpoint.
+ */
+LEAF(RunProgram)
+
+ LOADREL(a2,segment_table)
+ LR a2,R_SEG_APIENTRY(a2) # A2 = code entry
+ move t0,a0 #
+ move a1,zero # A1 = 0
+ move a0,gp # A0 = handle
+ li a3,CFE_EPTSEAL # A3 = entrypoint signature
+ LR t0,0(sp) # entry point
+ j t0 # go for it.
+END(RunProgram)
+
+
+
+
+/* *********************************************************************
+ * CFE_LEDS
+ *
+ * Set the on-board LEDs.
+ *
+ * Input parameters:
+ * a0 - LEDs
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+LEAF(cfe_leds)
+
+ j board_setleds # jump to BSP routine
+
+END(cfe_leds)
+
+/* *********************************************************************
+ * TLB Fill Exeption Handler
+ ********************************************************************* */
+
+cpu_tlbfill:
+ move k0,ra # Save, we're about to trash
+ LOADREL(k1,init_table) # Load offset of init table
+ LR k1,R_INIT_TLBHANDLER(k1) # Get entry from table
+ move ra,k0 # restore trashed ra
+ j k1 # Dispatch to handler
+
+/* *********************************************************************
+ * XTLB Fill Exception Handler
+ ********************************************************************* */
+
+cpu_xtlbfill:
+ j _exc_entry
+
+/* *********************************************************************
+ * Cache Error Exception Handler
+ ********************************************************************* */
+
+cpu_cacheerr:
+ j _exc_entry
+
+
+/* *********************************************************************
+ * General Exception Handler
+ ********************************************************************* */
+
+cpu_exception:
+ j _exc_entry
+
+
+/* *********************************************************************
+ * General Interrupt Handler
+ ********************************************************************* */
+
+cpu_interrupt:
+ j _exc_entry
+
+
+/* *********************************************************************
+ * EJTAG Debug Exception Handler
+ ********************************************************************* */
+
+cpu_ejtag:
+ j cpu_reset
+
+/* *********************************************************************
+ * cpu_apientry(handle,iocb)
+ *
+ * API entry point for external apps.
+ *
+ * Input parameters:
+ * a0 - firmware handle (used to determine the location of
+ * our relocated data)
+ * a1 - pointer to IOCB to execute
+ *
+ * Return value:
+ * v0 - return code, 0 if ok
+ ********************************************************************* */
+
+#define _regidx(x) ((x)*8)
+
+#define CAE_SRSAVE _regidx(0)
+#define CAE_GPSAVE _regidx(1)
+#define CAE_RASAVE _regidx(2)
+#define CAE_S0SAVE _regidx(3)
+#define CAE_S1SAVE _regidx(4)
+#define CAE_S2SAVE _regidx(5)
+#define CAE_S3SAVE _regidx(6)
+#define CAE_S4SAVE _regidx(7)
+#define CAE_S5SAVE _regidx(8)
+#define CAE_S6SAVE _regidx(9)
+#define CAE_S7SAVE _regidx(10)
+
+#define CAE_STKSIZE _regidx(11)
+
+LEAF(cpu_apientry)
+
+ sub sp,CAE_STKSIZE # Make room for our stuff
+
+ mfc0 v0,C0_SR # Get current interrupt flag
+ SR v0,CAE_SRSAVE(sp) # save on stack
+ li t0,M_SR_IE # master interrupt control
+ not t0 # disable interrupts
+ and v0,t0 # SR now has IE=0
+ mtc0 v0,C0_SR # put back into CP0
+
+ SR gp,CAE_GPSAVE(sp) # save GP
+ SR ra,CAE_RASAVE(sp) # and old RA
+
+ SR s0,CAE_S0SAVE(sp)
+ SR s1,CAE_S1SAVE(sp)
+ SR s2,CAE_S2SAVE(sp)
+ SR s3,CAE_S3SAVE(sp)
+ SR s4,CAE_S4SAVE(sp)
+ SR s5,CAE_S5SAVE(sp)
+ SR s6,CAE_S6SAVE(sp)
+ SR s7,CAE_S7SAVE(sp)
+
+ move gp,a0 # set up new GP
+ move a0,a1 # A0 points at IOCB
+
+
+#if CFG_MULTI_CPUS
+ SPIN_LOCK(cfe_spinlock,t0,t1)
+#endif
+
+ CALLINIT_KSEG0(init_table,R_INIT_DOXREQ) # should not return
+
+#if CFG_MULTI_CPUS
+ SPIN_UNLOCK(cfe_spinlock,t0)
+#endif
+
+ #
+ # Restore the saved registers.
+ #
+
+ LR s7,CAE_S7SAVE(sp)
+ LR s6,CAE_S6SAVE(sp)
+ LR s5,CAE_S5SAVE(sp)
+ LR s4,CAE_S4SAVE(sp)
+ LR s3,CAE_S3SAVE(sp)
+ LR s2,CAE_S2SAVE(sp)
+ LR s1,CAE_S1SAVE(sp)
+ LR s0,CAE_S0SAVE(sp)
+
+ LR ra,CAE_RASAVE(sp) # unwind the stack
+ LR gp,CAE_GPSAVE(sp)
+
+ LR t0,CAE_SRSAVE(sp) # old interrupt mask
+
+ add sp,CAE_STKSIZE # restore old stack pointer
+
+ mtc0 t0,C0_SR # restore interrupts
+ j ra
+ nop
+
+END(cpu_apientry)
+
+
+/* *********************************************************************
+ * CPU_KSEG0_SWITCH
+ *
+ * Hack the return address so we will come back in KSEG0
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+LEAF(cpu_kseg0_switch)
+
+ and ra,(K0SIZE-1)
+ or ra,K0BASE
+ jr ra
+
+END(cpu_kseg0_switch)
+
+
+
+
+/* *********************************************************************
+ * _GETSTATUS()
+ *
+ * Read the STATUS register into v0
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * v0 - Status register
+ ********************************************************************* */
+
+LEAF(_getstatus)
+
+ mfc0 v0,C0_SR
+ j ra
+END(_getstatus)
+
+
+/* *********************************************************************
+ * _SETSTATUS()
+ *
+ * Set the STATUS register to the value in a0
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * v0 - Status register
+ ********************************************************************* */
+
+LEAF(_setstatus)
+
+ mtc0 a0,C0_SR
+ j ra
+END(_setstatus)
+
+/* *********************************************************************
+ * _GETCAUSE()
+ *
+ * Read the CAUSE register into v0
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * v0 - Cause register
+ ********************************************************************* */
+
+LEAF(_getcause)
+
+ mfc0 v0,C0_CAUSE
+ j ra
+END(_getcause)
+
+
+/* *********************************************************************
+ * _GETTICKS()
+ *
+ * Read the COUNT register into v0
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * v0 - count register
+ ********************************************************************* */
+
+LEAF(_getticks)
+
+ mfc0 v0,C0_COUNT
+ j ra
+END(_getticks)
+
+
+/* *********************************************************************
+ * _SETALARM(ticks)
+ *
+ * Set the C0_Compare register from a0
+ *
+ * Input parameters:
+ * a0 - compare register
+ *
+ * Return value:
+ * none
+ ********************************************************************* */
+
+LEAF(_setalarm)
+
+ mtc0 a0,C0_COMPARE
+ j ra
+END(_setalarm)
+
+
+/* *********************************************************************
+ * _SETCONTEXT()
+ *
+ * Set the CONTEXT register.
+ *
+ * Input parameters:
+ * a0 - context
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+LEAF(_setcontext)
+
+ mtc0 a0,C0_CTEXT
+ j ra
+END(_setcontext)
+
+/* *********************************************************************
+ * _GETSEGTBL()
+ *
+ * Return the address of the segment table. We use this
+ * to display the startup messages.
+ *
+ * You can't just address the table from C because it lives
+ * in the text segment.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * address of table
+ ********************************************************************* */
+
+
+LEAF(_getsegtbl)
+ move t0,ra
+ LOADREL(v0,segment_table)
+ move ra,t0
+ j ra
+END(_getsegtbl)
+
+
+/* *********************************************************************
+ * _wbflush()
+ *
+ * Flush the write buffer. This is probably not necessary
+ * on SiByte CPUs, but we have it for completeness.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+LEAF(_wbflush)
+
+ sync /* drain the buffers */
+ la t0,__junk /* do an uncached read to force it out */
+ or t0,K1BASE
+ lw zero,0(t0)
+ j ra
+
+END(_wbflush)
+
+
+/* *********************************************************************
+ * End
+ ********************************************************************* */
+
+
diff --git a/cfe/cfe/arch/mips/common/src/lib_hssubr.S b/cfe/cfe/arch/mips/common/src/lib_hssubr.S
new file mode 100644
index 0000000..07085e3
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/lib_hssubr.S
@@ -0,0 +1,194 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Hyperspace Subroutines File: lib_hssubr.S
+ *
+ * Little stub routines to allow access to KXSEG from 32-bit progs.
+ *
+ * Author: Mitch Lichtenberg (mitch@sibyte.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "sbmips.h"
+#include "mipsmacros.h"
+#include "cpu_config.h" /* for definition of HAZARD */
+
+
+/* *********************************************************************
+ * hs_read8 - read 8-bit bytes
+ ********************************************************************* */
+
+
+LEAF(hs_read8)
+ mfc0 t2,C0_SR
+ or t1,t2,M_SR_KX
+ mtc0 t1,C0_SR
+ HAZARD
+
+ lbu v0,(a0)
+
+ mtc0 t2,C0_SR
+ HAZARD
+ j ra
+END(hs_read8)
+
+/* *********************************************************************
+ * hs_read16 - read 16-bit shorts
+ ********************************************************************* */
+
+LEAF(hs_read16)
+ mfc0 t2,C0_SR
+ or t1,t2,M_SR_KX
+ mtc0 t1,C0_SR
+ HAZARD
+
+ lhu v0,(a0)
+
+ mtc0 t2,C0_SR
+ HAZARD
+ j ra
+END(hs_read16)
+
+/* *********************************************************************
+ * hs_read32 - read 32-bit ints
+ ********************************************************************* */
+
+LEAF(hs_read32)
+ mfc0 t2,C0_SR
+ or t1,t2,M_SR_KX
+ mtc0 t1,C0_SR
+ HAZARD
+
+ lw v0,(a0)
+
+ mtc0 t2,C0_SR
+ HAZARD
+ j ra
+END(hs_read32)
+
+/* *********************************************************************
+ * hs_read64 - read 64-bit longs
+ ********************************************************************* */
+
+LEAF(hs_read64)
+ mfc0 t2,C0_SR
+ or t1,t2,M_SR_KX
+ mtc0 t1,C0_SR
+ HAZARD
+
+ ld v0,(a0)
+
+ mtc0 t2,C0_SR
+ HAZARD
+ j ra
+END(hs_read64)
+
+/* *********************************************************************
+ * hs_write8 - write 8-bit bytes
+ ********************************************************************* */
+
+LEAF(hs_write8)
+ mfc0 t2,C0_SR
+ or t1,t2,M_SR_KX
+ mtc0 t1,C0_SR
+ HAZARD
+
+ sb a1,(a0)
+
+ mtc0 t2,C0_SR
+ HAZARD
+ j ra
+END(hs_write8)
+
+/* *********************************************************************
+ * hs_write16 - write 16-bit shorts
+ ********************************************************************* */
+
+LEAF(hs_write16)
+ mfc0 t2,C0_SR
+ or t1,t2,M_SR_KX
+ mtc0 t1,C0_SR
+ HAZARD
+
+ sh a1,(a0)
+
+ mtc0 t2,C0_SR
+ HAZARD
+ j ra
+END(hs_write16)
+
+/* *********************************************************************
+ * hs_write32 - write 32-bit longs
+ ********************************************************************* */
+
+LEAF(hs_write32)
+ mfc0 t2,C0_SR
+ or t1,t2,M_SR_KX
+ mtc0 t1,C0_SR
+ HAZARD
+
+ sw a1,(a0)
+
+ mtc0 t2,C0_SR
+ HAZARD
+ j ra
+END(hs_write32)
+
+/* *********************************************************************
+ * hs_write64 - write 64-bit longs
+ ********************************************************************* */
+
+LEAF(hs_write64)
+ mfc0 t2,C0_SR
+ or t1,t2,M_SR_KX
+ mtc0 t1,C0_SR
+ HAZARD
+
+ sd a1,(a0)
+
+ mtc0 t2,C0_SR
+ HAZARD
+ j ra
+END(hs_write64)
+
+
+/* *********************************************************************
+ * End
+ ********************************************************************* */
+
diff --git a/cfe/cfe/arch/mips/common/src/lib_physio.S b/cfe/cfe/arch/mips/common/src/lib_physio.S
new file mode 100644
index 0000000..7f57fea
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/lib_physio.S
@@ -0,0 +1,173 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Physical memory peek/poke routines File: lib_physio.S
+ *
+ * Little stub routines to allow access to arbitrary physical
+ * addresses. In most cases this should not be needed, as
+ * many physical addresses are within kseg1, but this handles
+ * the cases that are not automagically, so we don't need
+ * to mess up the code with icky macros and such.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "sbmips.h"
+#include "mipsmacros.h"
+#include "cpu_config.h" /* for definition of HAZARD */
+
+
+/* *********************************************************************
+ * PHYSOP(inst,a)
+ *
+ * Macro to construct code for doing the physical I/O
+ * We try to avoid messing with KX or doing 64-bit stuff
+ * unless necessary.
+ *
+ * Input parameters:
+ * INST - instruction name to run
+ * A - register containing arg or return value
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+
+
+#ifdef _MIPSREGS32_
+#define PHYSOP(INST,A) \
+ or a0,a0,K1BASE ; \
+ INST A,0(a0) ; \
+ j ra ;
+#else
+#define PHYSOP(INST,A) \
+ lui t0,0x2000 ; \
+ bgeu a0,t0,1f ; \
+ or a0,a0,K1BASE ; \
+ INST A,0(a0) ; \
+ j ra ; \
+1: lui t0,0x9000 ; \
+ dsll t0,t0,32 ; \
+ or a0,a0,t0 ; \
+ mfc0 t1,C0_SR ; \
+ and t0,t1,M_SR_KX ; \
+ beq t0,zero,1f ; \
+ INST A,0(a0) ; \
+ j ra ; \
+1: or t0,t1,M_SR_KX ; \
+ mtc0 t0,C0_SR ; \
+ HAZARD ; \
+ INST A,0(a0) ; \
+ mtc0 t1,C0_SR ; \
+ HAZARD ; \
+ j ra ;
+#endif
+
+
+/* *********************************************************************
+ * phys_read8 - read 8-bit bytes
+ ********************************************************************* */
+
+
+LEAF(phys_read8)
+PHYSOP(lbu,v0)
+END(phys_read8)
+
+/* *********************************************************************
+ * phys_read16 - read 16-bit shorts
+ ********************************************************************* */
+
+LEAF(phys_read16)
+PHYSOP(lh,v0)
+END(phys_read16)
+
+/* *********************************************************************
+ * phys_read32 - read 32-bit ints
+ ********************************************************************* */
+
+LEAF(phys_read32)
+PHYSOP(lw,v0)
+END(phys_read32)
+
+/* *********************************************************************
+ * phys_read64 - read 64-bit longs
+ ********************************************************************* */
+
+LEAF(phys_read64)
+PHYSOP(ld,v0)
+END(phys_read64)
+
+/* *********************************************************************
+ * phys_write8 - write 8-bit bytes
+ ********************************************************************* */
+
+LEAF(phys_write8)
+PHYSOP(sb,a1)
+END(phys_write8)
+
+/* *********************************************************************
+ * phys_write16 - write 16-bit shorts
+ ********************************************************************* */
+
+LEAF(phys_write16)
+PHYSOP(sh,a1)
+END(phys_write16)
+
+/* *********************************************************************
+ * phys_write32 - write 32-bit longs
+ ********************************************************************* */
+
+LEAF(phys_write32)
+PHYSOP(sw,a1)
+END(phys_write32)
+
+/* *********************************************************************
+ * phys_write64 - write 64-bit longs
+ ********************************************************************* */
+
+LEAF(phys_write64)
+PHYSOP(sd,a1)
+END(phys_write64)
+
+
+/* *********************************************************************
+ * End
+ ********************************************************************* */
+
diff --git a/cfe/cfe/arch/mips/common/src/lib_setjmp.S b/cfe/cfe/arch/mips/common/src/lib_setjmp.S
new file mode 100644
index 0000000..b8c82b3
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/lib_setjmp.S
@@ -0,0 +1,94 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Simple setjmp/longjmp File: lib_setjmp.S
+ *
+ * A very simple SETJMP and LONGJMP
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+
+
+#include "sbmips.h"
+#include "lib_setjmp.h"
+
+#ifdef _MIPSREGS32_
+#define SREG sw
+#define LREG lw
+#else
+#define SREG sd
+#define LREG ld
+#endif
+
+LEAF(lib_setjmp)
+
+ SREG s0,JMPB_S0(a0)
+ SREG s1,JMPB_S1(a0)
+ SREG s2,JMPB_S2(a0)
+ SREG s3,JMPB_S3(a0)
+ SREG s4,JMPB_S4(a0)
+ SREG s5,JMPB_S5(a0)
+ SREG s6,JMPB_S6(a0)
+ SREG s7,JMPB_S7(a0)
+ SREG fp,JMPB_FP(a0)
+ SREG sp,JMPB_SP(a0)
+ SREG ra,JMPB_RA(a0)
+ move v0,zero
+ j ra
+
+END(lib_setjmp)
+
+LEAF(lib_longjmp)
+ LREG s0,JMPB_S0(a0)
+ LREG s1,JMPB_S1(a0)
+ LREG s2,JMPB_S2(a0)
+ LREG s3,JMPB_S3(a0)
+ LREG s4,JMPB_S4(a0)
+ LREG s5,JMPB_S5(a0)
+ LREG s6,JMPB_S6(a0)
+ LREG s7,JMPB_S7(a0)
+ LREG fp,JMPB_FP(a0)
+ LREG sp,JMPB_SP(a0)
+ LREG ra,JMPB_RA(a0)
+ move v0,a1
+ jr ra
+END(lib_longjmp)
+
diff --git a/cfe/cfe/arch/mips/common/src/mips_arena.c b/cfe/cfe/arch/mips/common/src/mips_arena.c
new file mode 100644
index 0000000..d96fee6
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/mips_arena.c
@@ -0,0 +1,186 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Physical Memory (arena) manager File: sb1250_arena.c
+ *
+ * This module describes the physical memory available to the
+ * firmware.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "lib_arena.h"
+
+#include "cfe_error.h"
+
+#include "cfe.h"
+#include "cfe_mem.h"
+
+#include "initdata.h"
+
+#define _NOPROTOS_
+#include "cfe_boot.h"
+#undef _NOPROTOS_
+
+#include "cpu_config.h"
+
+#include "addrspace.h"
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+
+#define MEG (1024*1024)
+#define KB 1024
+#define PAGESIZE 4096
+#define CFE_BOOTAREA_SIZE (256*KB)
+#define CFE_BOOTAREA_ADDR 0x20000000
+
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+extern arena_t cfe_arena;
+uint64_t *cfe_pagetable = NULL;
+
+extern void CPUCFG_PAGETBLINIT(uint64_t *ptaddr,unsigned int ptstart);
+
+void cfe_bootarea_init(void);
+extern void _setcontext(int64_t);
+
+
+/* *********************************************************************
+ * CFE_BOOTAREA_INIT()
+ *
+ * Initialize the page table and map our boot program area.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void cfe_bootarea_init(void)
+{
+ unsigned char *pte;
+ int64_t pte_int;
+ unsigned int addr = 16*MEG;
+ unsigned int topmem;
+ unsigned int topcfe;
+ unsigned int botcfe;
+ unsigned int beforecfe;
+ unsigned int aftercfe;
+
+ /*
+ * Calculate the location where the boot area will
+ * live. It lives either above or below the
+ * firmware, depending on where there's more space.
+ */
+
+ /*
+ * The firmware will always be loaded in the first
+ * 256M. Calculate the top of that region. The bottom
+ * of that region is always the beginning of our
+ * data segment.
+ */
+ if (mem_totalsize > (uint64_t)256) {
+ topmem = 256*MEG;
+ }
+ else {
+ topmem = (unsigned int) (mem_totalsize << 20);
+ }
+ botcfe = (unsigned int) K1_TO_PHYS(mem_bottomofmem);
+ topcfe = (unsigned int) K1_TO_PHYS(mem_topofmem);
+
+ beforecfe = botcfe;
+ aftercfe = topmem-topcfe;
+
+ if (beforecfe > aftercfe) {
+ botcfe -= (PAGESIZE-1);
+ botcfe &= ~(PAGESIZE-1); /* round down to page boundary */
+ addr = botcfe - CFE_BOOTAREA_SIZE; /* this is the address */
+ }
+ else {
+ topcfe += (PAGESIZE-1); /* round *up* to a page address */
+ topcfe &= ~(PAGESIZE-1);
+ addr = topcfe;
+ }
+
+ mem_bootarea_start = addr;
+ mem_bootarea_size = CFE_BOOTAREA_SIZE;
+
+ /*
+ * Allocate the page table
+ */
+
+ pte = KMALLOC(1024,1024);
+
+#ifdef __long64
+ pte_int = (int64_t) pte;
+#else
+ pte_int = (int64_t) ((int) pte);
+#endif
+
+ /*
+ * Set the CP0 CONTEXT register to point at the page table
+ */
+
+ pte_int <<= 13;
+ cfe_pagetable = (uint64_t *) pte;
+
+ _setcontext(pte_int);
+
+
+ /*
+ * Initialize page table entries
+ */
+
+ CPUCFG_PAGETBLINIT(cfe_pagetable,addr);
+
+
+}
+
diff --git a/cfe/cfe/arch/mips/common/src/tools.mk b/cfe/cfe/arch/mips/common/src/tools.mk
new file mode 100755
index 0000000..d195de9
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/tools.mk
@@ -0,0 +1,83 @@
+#
+# Basic compiler options and preprocessor flags
+#
+
+CFLAGS += -g -c -ffreestanding
+CFLAGS += -O1 -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
+
+#
+# Tools locations
+#
+
+ifndef TOOLS
+TOOLS=/opt/toolchains/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-
+endif
+
+GCC ?= $(TOOLS)gcc
+GLD ?= $(TOOLS)ld
+AR ?= $(TOOLS)ar
+OBJDUMP ?= $(TOOLS)objdump
+OBJCOPY ?= $(TOOLS)objcopy
+RANLIB ?= $(TOOLS)ranlib
+
+#
+# Check for 64-bit mode
+#
+
+ifeq ($(strip ${CFG_MLONG64}),1)
+ CFLAGS += -mlong64 -D__long64
+endif
+
+#
+# Figure out which linker script to use
+#
+
+ifeq ($(strip ${CFG_RAMAPP}),1)
+ CFLAGS += -DCFG_RAMAPP=1
+ LDFLAGS = -g --script ${ARCH_SRC}/cfe_ramapp.lds
+ CFLAGS += -DCFG_RUNFROMKSEG0=1
+else
+ ifeq ($(strip ${CFG_RELOC}),0)
+ ifeq ($(strip ${CFG_BOOTRAM}),1)
+ CFLAGS += -DCFG_BOOTRAM=1
+ ROMRAM = ram
+ else
+ CFLAGS += -DCFG_BOOTRAM=0
+ ROMRAM = rom
+ endif
+ ifeq ($(strip ${CFG_UNCACHED}),1)
+ CFLAGS += -DCFG_RUNFROMKSEG0=0
+ LDFLAGS = -g --script ${ARCH_SRC}/cfe_${ROMRAM}_uncached.lds
+ else
+ CFLAGS += -DCFG_RUNFROMKSEG0=1
+ LDFLAGS = -g --script ${ARCH_SRC}/cfe_${ROMRAM}_cached.lds
+ endif
+ else
+ CFLAGS += -membedded-pic -mlong-calls -DCFG_EMBEDDED_PIC=1
+ ifeq ($(strip ${CFG_UNCACHED}),1)
+ CFLAGS += -DCFG_RUNFROMKSEG0=0
+ LDFLAGS = -g --script ${ARCH_SRC}/cfe_rom_reloc_uncached.lds --embedded-relocs
+ else
+ CFLAGS += -DCFG_RUNFROMKSEG0=1
+ ifeq ($(strip ${CFG_TEXTAT1MB}),1)
+ LDFLAGS = -g --script ${ARCH_SRC}/cfe_rom_reloc_cached_biendian.lds --embedded-relocs
+ else
+ LDFLAGS = -g --script ${ARCH_SRC}/cfe_rom_reloc_cached.lds --embedded-relocs
+ endif
+ endif
+ endif
+endif
+#
+# Determine target endianness
+#
+
+ifeq ($(strip ${CFG_LITTLE}),1)
+ ENDIAN = -EL
+ CFLAGS += -EL
+ LDFLAGS += -EL
+else
+ ENDIAN = -EB
+ CFLAGS += -EB
+ LDFLAGS += -EB
+endif
+
diff --git a/cfe/cfe/arch/mips/common/src/ui_memtest.c b/cfe/cfe/arch/mips/common/src/ui_memtest.c
new file mode 100644
index 0000000..5388fd8
--- /dev/null
+++ b/cfe/cfe/arch/mips/common/src/ui_memtest.c
@@ -0,0 +1,282 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Test commands File: ui_memtest.c
+ *
+ * A simple memory test
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "sbmips.h"
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "cfe_devfuncs.h"
+
+#include "cfe_error.h"
+
+#include "ui_command.h"
+#include "cfe.h"
+
+#include "bsp_config.h"
+
+#include "cfe_mem.h"
+
+
+#ifdef __long64
+static int ui_cmd_memorytest(ui_cmdline_t *cmd,int argc,char *argv[]);
+#endif
+
+#ifndef _SB_MAKE64
+#define _SB_MAKE64(x) ((uint64_t)(x))
+#endif
+#ifndef _SB_MAKEMASK
+#define _SB_MAKEMASK(v,n) (_SB_MAKE64((_SB_MAKE64(1)<<(v))-1) << _SB_MAKE64(n))
+#endif
+#ifndef _SB_MAKEMASK1
+#define _SB_MAKEMASK1(n) (_SB_MAKE64(1) << _SB_MAKE64(n))
+#endif
+
+
+int ui_init_memtestcmds(void);
+
+int ui_init_memtestcmds(void)
+{
+#ifdef __long64
+ cmd_addcmd("memorytest",
+ ui_cmd_memorytest,
+ NULL,
+ "Tests all available memory",
+ "",
+ "-loop;Loop forever or until keypress|"
+ "-stoponerror;Stop if error occurs while looping|"
+ "-cca=*;Use specified cacheability attribute|"
+ "-arena=*;Test only specified arena index");
+#endif
+ return 0;
+}
+
+
+#ifdef __long64
+/* extensive memory tests */
+
+static void inline uacwrite(volatile long *srcadr,long *dstadr)
+{
+__asm __volatile ("ld $8, 0(%0) ; "
+ "ld $9, 8(%0) ; "
+ "ld $10, 16(%0) ; "
+ "ld $11, 24(%0) ; "
+ "sync ; "
+ "sd $8, 0(%1) ; "
+ "sd $9, 8(%1) ; "
+ "sd $10, 16(%1) ; "
+ "sd $11, 24(%1) ; "
+ "sync" :: "r"(srcadr),"r"(dstadr) : "$8","$9","$10","$11");
+}
+
+
+#define TEST_DATA_LEN 4
+#define CACHE_LINE_LEN 32
+
+static int ui_cmd_memorytest(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+
+ static volatile long test_data[TEST_DATA_LEN] = {
+ 0xaaaaaaaaaaaaaaaa, 0x5555555555555555, 0xcccccccccccccccc, 0x3333333333333333, /* one cache line */
+ };
+ int arena, exitLoop;
+ int error;
+ int arena_type;
+ uint64_t arena_start, arena_size;
+ long phys_addr, offset, mem_base, cache_mem_base, i;
+ long *dst_adr, *cache_dst_adr;
+ long cda,tda;
+ int forever;
+ int passcnt;
+ int stoponerr = 0;
+ int cca = K_CALG_UNCACHED_ACCEL;
+ int arenanum = -1;
+ char *x;
+
+ arena = 0;
+ exitLoop = 0;
+ offset = 0;
+ mem_base = 0;
+ passcnt = 0;
+ error = 0;
+
+ forever = cmd_sw_isset(cmd,"-loop");
+ stoponerr = cmd_sw_isset(cmd,"-stoponerror");
+ if (cmd_sw_value(cmd,"-cca",&x)) cca = atoi(x);
+ if (cmd_sw_value(cmd,"-arena",&x)) arenanum = atoi(x);
+
+ printf("Available memory arenas:\n");
+ while (cfe_arena_enum(arena, &arena_type, &arena_start, &arena_size, FALSE) == 0) {
+ phys_addr = (long) arena_start; /* actual physical address */
+ mem_base = PHYS_TO_XKPHYS(cca, phys_addr); /* virtual address */
+ xprintf("phys = %016llX, virt = %016llX, size = %016llX\n", phys_addr, mem_base, arena_size);
+ arena++;
+ }
+
+ printf("\nTesting memory.\n");
+ do {
+
+ passcnt++;
+ if (forever) {
+ if (console_status()) break;
+ printf("***** Iteration %d *****\n",passcnt);
+ }
+
+ arena = 0;
+ exitLoop = 0;
+ error = 0;
+
+ while (cfe_arena_enum(arena, &arena_type, &arena_start, &arena_size, FALSE) == 0) {
+
+ if ((arenanum >= 0) && (arena != arenanum)) {
+ arena++;
+ continue;
+ }
+
+ test_data[0] = 0xAAAAAAAAAAAAAAAA;
+ test_data[1] = 0x5555555555555555;
+ test_data[2] = 0xCCCCCCCCCCCCCCCC;
+ test_data[3] = 0x3333333333333333;
+
+ phys_addr = (long) arena_start; /* actual physical address */
+ mem_base = PHYS_TO_XKPHYS(cca, phys_addr); /* virtual address */
+ cache_mem_base = PHYS_TO_K0(phys_addr);
+
+ xprintf("\n");
+ xprintf("Testing: phys = %016llX, virt = %016llX, size = %016llX\n", phys_addr, mem_base, arena_size);
+
+ xprintf("Writing: a/5/c/3\n");
+
+ for (offset = 0; (offset < arena_size); offset += CACHE_LINE_LEN) {
+ dst_adr = (long*)(mem_base+offset);
+ uacwrite(test_data, dst_adr);
+ }
+
+ xprintf("Reading: a/5/c/3\n");
+
+ for (offset = 0; (offset < arena_size); offset += CACHE_LINE_LEN) {
+ dst_adr = (long*)(mem_base+offset);
+ cache_dst_adr = (long*)(mem_base+offset);
+ for (i = 0; i < TEST_DATA_LEN; i++) {
+ cda = cache_dst_adr[i];
+ tda = test_data[i];
+ if (cda != tda) {
+ xprintf("mem[%016llX] %016llX != %016llX\n",
+ mem_base+offset+(i*8), cda, tda);
+ exitLoop = 1;
+ }
+ }
+ if (exitLoop) break;
+ }
+
+
+ if (exitLoop) {
+ exitLoop = 0;
+ error++;
+ arena++;
+ continue;
+ }
+
+ xprintf("Writing: address|5555/inv/aaaa|address\n");
+ exitLoop = 0;
+
+ for (offset = 0; (offset < arena_size); offset += CACHE_LINE_LEN) {
+ dst_adr = (long*)(mem_base+offset);
+ test_data[0] = ((long)dst_adr<<32)|0x55555555;
+ test_data[1] = ~test_data[0];
+ test_data[2] = 0xaaaaaaaa00000000|((long)dst_adr & 0xffffffff);
+ test_data[3] = ~test_data[2];
+ uacwrite(test_data, dst_adr);
+ }
+
+ xprintf("Reading: address|5555/inv/aaaa|address\n");
+
+ for (offset = 0; (offset < arena_size); offset += CACHE_LINE_LEN) {
+ dst_adr = (long*)(mem_base+offset);
+ test_data[0] = ((long)dst_adr<<32)|0x55555555;
+ test_data[1] = ~test_data[0];
+ test_data[2] = 0xaaaaaaaa00000000|((long)dst_adr & 0xffffffff);
+ test_data[3] = ~test_data[2];
+ cache_dst_adr = (long*)(mem_base+offset);
+ for (i = 0; i < TEST_DATA_LEN; i++) {
+ cda = cache_dst_adr[i];
+ tda = test_data[i];
+ if (cda != tda) {
+ xprintf("mem[%016llX] %016llX != %016llX\n",
+ mem_base+offset+(i*8),cda,tda);
+ exitLoop = 1;
+ }
+ }
+ if (exitLoop) break;
+ }
+
+ if (exitLoop) {
+ error++;
+ exitLoop = 0;
+ if (stoponerr) forever = 0;
+ }
+
+ arena++;
+ }
+ } while (forever);
+
+ if (error) printf("Failing address: %016llX\n",mem_base+offset);
+
+ return error ? -1 : 0;
+}
+
+#endif
+
+
+
+
diff --git a/cfe/cfe/arch/mips/cpu/SIBYTE_PRIVATE_FILES b/cfe/cfe/arch/mips/cpu/SIBYTE_PRIVATE_FILES
new file mode 100644
index 0000000..1e7d4b6
--- /dev/null
+++ b/cfe/cfe/arch/mips/cpu/SIBYTE_PRIVATE_FILES
@@ -0,0 +1,2 @@
+bcmcore
+bcm1400
diff --git a/cfe/cfe/arch/mips/cpu/bcmcore/include/bcm4710.h b/cfe/cfe/arch/mips/cpu/bcmcore/include/bcm4710.h
new file mode 100644
index 0000000..f499bc9
--- /dev/null
+++ b/cfe/cfe/arch/mips/cpu/bcmcore/include/bcm4710.h
@@ -0,0 +1,58 @@
+/*
+ Copyright 2001, Broadcom Corporation
+ All Rights Reserved.
+
+ This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
+ the contents of this file may not be disclosed to third parties, copied or
+ duplicated in any form, in whole or in part, without the prior written
+ permission of Broadcom Corporation.
+*/
+/*
+ * BCM4710 address space map and definitions
+ *
+ * Think twice before adding to this file, this is not the kitchen sink
+ * These definitions are not guaranteed for all 47xx chips, only the 4710
+ *
+ * Copyright (C) 2000 Broadcom Corporation
+ * $Id: bcm4710.h,v 1.1 2001/10/31 18:49:25 mpl Exp $
+ */
+
+#ifndef _bcm4710_h_
+#define _bcm4710_h_
+
+/* Address map */
+#define BCM4710_SDRAM 0x00000000 /* Physical SDRAM */
+#define BCM4710_PCI_MEM 0x08000000 /* Host Mode PCI memory access space (64 MB) */
+#define BCM4710_PCI_CFG 0x0c000000 /* Host Mode PCI configuration space (64 MB) */
+#define BCM4710_PCI_DMA 0x40000000 /* Client Mode PCI memory access space (1 GB) */
+#define BCM4710_SDRAM_SWAPPED 0x10000000 /* Byteswapped Physical SDRAM */
+#define BCM4710_ENUM 0x18000000 /* Beginning of core enumeration space */
+
+/* Core register space */
+#define BCM4710_REG_SDRAM 0x18000000 /* SDRAM core registers */
+#define BCM4710_REG_ILINE20 0x18001000 /* InsideLine20 core registers */
+#define BCM4710_REG_EMAC0 0x18002000 /* Ethernet MAC 0 core registers */
+#define BCM4710_REG_CODEC 0x18003000 /* Codec core registers */
+#define BCM4710_REG_USB 0x18004000 /* USB core registers */
+#define BCM4710_REG_PCI 0x18005000 /* PCI core registers */
+#define BCM4710_REG_MIPS 0x18006000 /* MIPS core registers */
+#define BCM4710_REG_EXTIF 0x18007000 /* External Interface core registers */
+#define BCM4710_REG_EMAC1 0x18008000 /* Ethernet MAC 1 core registers */
+
+#define BCM4710_EXTIF 0x1f000000 /* External Interface base address */
+#define BCM4710_EJTAG 0xff200000 /* MIPS EJTAG space (2M) */
+
+#define BCM4710_UART (BCM4710_REG_EXTIF + 0x00000300)
+
+#define BCM4710_EUART (BCM4710_EXTIF + 0x00800000)
+#define BCM4710_LED (BCM4710_EXTIF + 0x00900000)
+
+#ifdef CONFIG_VSIM
+#define BCM4710_TRACE(trval) do { *((int *)0xa0002ff8) = (trval); } while (0)
+#else
+#define BCM4710_TRACE(trval) do { *((unsigned char *)KSEG1ADDR(BCM4710_LED)) = (trval); \
+ *((int *)0xa0002ff8) = (trval); } while (0)
+#endif
+
+
+#endif /* _bcm4710_h_ */
diff --git a/cfe/cfe/arch/mips/cpu/bcmcore/include/bcm47xx.h b/cfe/cfe/arch/mips/cpu/bcmcore/include/bcm47xx.h
new file mode 100644
index 0000000..eb752e5
--- /dev/null
+++ b/cfe/cfe/arch/mips/cpu/bcmcore/include/bcm47xx.h
@@ -0,0 +1,8 @@
+#ifndef _BCM47XX_H
+#define _BCM47XX_H
+
+/* uart defaults */
+#define DIV_LO 0x36
+#define DIV_HI 0
+
+#endif
diff --git a/cfe/cfe/arch/mips/cpu/bcmcore/include/bcmnvram.h b/cfe/cfe/arch/mips/cpu/bcmcore/include/bcmnvram.h
new file mode 100644
index 0000000..b9d37e6
--- /dev/null
+++ b/cfe/cfe/arch/mips/cpu/bcmcore/include/bcmnvram.h
@@ -0,0 +1,123 @@
+/*
+ Copyright 2001, Broadcom Corporation
+ All Rights Reserved.
+
+ This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
+ the contents of this file may not be disclosed to third parties, copied or
+ duplicated in any form, in whole or in part, without the prior written
+ permission of Broadcom Corporation.
+*/
+/*
+ * NVRAM variable manipulation
+ *
+ * Copyright (C) 2001 Broadcom Corporation
+ *
+ * $Id: bcmnvram.h,v 1.1 2001/10/31 18:49:25 mpl Exp $
+ */
+
+#ifndef _bcmnvram_h_
+#define _bcmnvram_h_
+
+#ifndef _LANGUAGE_ASSEMBLY
+
+struct nvram_header {
+ unsigned long magic;
+ unsigned long len;
+ unsigned long crc_ver_init; /* 0:7 crc, 8:15 ver, 16:27 init, mem. test 28, 29-31 reserved */
+ unsigned long config_refresh; /* 0:15 config, 16:31 refresh */
+ unsigned long reserved;
+};
+
+struct nvram_tuple {
+ char *name;
+ char *value;
+ struct nvram_tuple *next;
+};
+
+/* Compatibility */
+typedef struct nvram_tuple EnvRec;
+
+/*
+ * Get the value of an NVRAM variable
+ * @param name name of variable to get
+ * @return value of variable or NULL if undefined
+ */
+extern char * nvram_get(const char *name);
+
+/*
+ * Get the value of an NVRAM variable
+ * @param name name of variable to get
+ * @return value of variable or NUL if undefined
+ */
+#define nvram_safe_get(name) (nvram_get(name) ? : "")
+
+/*
+ * Match an NVRAM variable
+ * @param name name of variable to match
+ * @param match value to compare against value of variable
+ * @return TRUE if variable is defined and its value is string equal to match or FALSE otherwise
+ */
+#define nvram_match(name, match) ({ \
+ const char *value = nvram_get(name); \
+ (value && !strcmp(value, match)); \
+})
+
+/*
+ * Match an NVRAM variable
+ * @param name name of variable to match
+ * @param match value to compare against value of variable
+ * @return TRUE if variable is defined and its value is not string equal to invmatch or FALSE otherwise
+ */
+#define nvram_invmatch(name, invmatch) ({ \
+ const char *value = nvram_get(name); \
+ (value && strcmp(value, invmatch)); \
+})
+
+/*
+ * Set the value of an NVRAM variable
+ * @param name name of variable to set
+ * @param value value of variable
+ * @return 0 on success and errno on failure
+ * NOTE: use nvram_commit to commit this change to flash.
+ */
+extern int nvram_set(const char *name, const char *value);
+
+/*
+ * Unset an NVRAM variable
+ * @param name name of variable to unset
+ * @return 0 on success and errno on failure
+ * NOTE: use nvram_commit to commit this change to flash.
+ */
+extern int nvram_unset(const char *name);
+
+/*
+ * Permanently commit NVRAM variables
+ * @return 0 on success and errno on failure
+ */
+extern int nvram_commit(void);
+
+/*
+ * Get all NVRAM variables (format name=value\0 ... \0\0)
+ * @param buf buffer to store variables
+ * @param count size of buffer in bytes
+ * @return 0 on success and errno on failure
+ */
+extern int nvram_getall(char *buf, int count);
+
+/*
+ * Invalidate the current NVRAM header
+ * @return 0 on success and errno on failure
+ */
+extern int nvram_invalidate(void);
+
+#endif /* _LANGUAGE_ASSEMBLY */
+
+#define NVRAM_MAGIC 0x48534C46 /* 'FLSH' */
+#define NVRAM_VERSION 1
+#define NVRAM_HEADER_SIZE 20
+#define NVRAM_FIRST_LOC 0xbfcf8000
+#define NVRAM_LAST_LOC 0xbfff8000
+#define NVRAM_LOC_GAP 0x100000
+#define NVRAM_SPACE 0x8000
+
+#endif /* _bcmnvram_h_ */
diff --git a/cfe/cfe/arch/mips/cpu/bcmcore/include/cpu_config.h b/cfe/cfe/arch/mips/cpu/bcmcore/include/cpu_config.h
new file mode 100755
index 0000000..51cf4e1
--- /dev/null
+++ b/cfe/cfe/arch/mips/cpu/bcmcore/include/cpu_config.h
@@ -0,0 +1,62 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * CPU Configuration file File: cpu_config.h
+ *
+ * This file contains the names of the routines to be used
+ * in the dispatch table in init_mips.S
+ *
+ * It lives here in the CPU directory so we can direct
+ * the init calls to routines named in this directory.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * XX Copyright 2000,2001
+ * Broadcom Corporation. All rights reserved.
+ *
+ * BROADCOM PROPRIETARY AND CONFIDENTIAL
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the license.
+ ********************************************************************* */
+
+/*
+ */
+
+#define CPUCFG_CPUINIT bcmcore_cpuinit
+#define CPUCFG_ALTCPU_START1 bcmcore_null
+#define CPUCFG_ALTCPU_START2 bcmcore_null
+#define CPUCFG_ALTCPU_RESET bcmcore_null
+#define CPUCFG_CPURESTART bcmcore_cpurestart
+#define CPUCFG_DRAMINIT board_draminit /* no dram on CPU */
+#define CPUCFG_CACHEOPS bcmcore_cacheops
+#define CPUCFG_ARENAINIT bcmcore_arena_init
+#define CPUCFG_PAGETBLINIT bcmcore_pagetable_init
+#define CPUCFG_TLBHANDLER bcmcore_tlbhandler
+#define CPUCFG_DIAG_TEST1 bcmcore_null
+#define CPUCFG_DIAG_TEST2 bcmcore_null
+#if CFG_CMT
+#define CPUCFG_TP1_SWITCH bcmcore_tp1_switch
+#else
+#define CPUCFG_TP1_SWITCH bcmcore_null
+#endif
+/*
+ * The BCMCORE ticks CP0 every other cycle.
+ */
+
+#define CPUCFG_CYCLESPERCPUTICK 2
+
+/*
+ * Hazard macro
+ */
+
+#define HAZARD nop ; nop ; nop ; nop ; nop ; nop ; nop
+#define ERET \
+ .set push ; \
+ .set mips4 ; \
+ eret ; \
+ .set pop
+
+
diff --git a/cfe/cfe/arch/mips/cpu/bcmcore/include/sbmips.h b/cfe/cfe/arch/mips/cpu/bcmcore/include/sbmips.h
new file mode 100644
index 0000000..0f4e055
--- /dev/null
+++ b/cfe/cfe/arch/mips/cpu/bcmcore/include/sbmips.h
@@ -0,0 +1,670 @@
+/* *********************************************************************
+ * SB1250 Board Support Package
+ *
+ * MIPS64 CPU definitions File: sbmips.h
+ *
+ * This module contains constants and macros specific to the
+ * SB1 MIPS64 core.
+ *
+ * Author: Mitch Lichtenberg (mitch@sibyte.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#ifndef _SB_MIPS_H
+#define _SB_MIPS_H
+
+/* *********************************************************************
+ * Configure language
+ ********************************************************************* */
+
+#if defined(__ASSEMBLER__)
+#define _ATYPE_
+#define _ATYPE32_
+#define _ATYPE64_
+#else
+#define _ATYPE_ (__SIZE_TYPE__)
+#define _ATYPE32_ (int)
+#define _ATYPE64_ (long long)
+#endif
+
+
+/* *********************************************************************
+ * Bitfield macros
+ ********************************************************************* */
+
+/*
+ * Make a mask for 1 bit at position 'n'
+ */
+
+#define _MM_MAKEMASK1(n) (1 << (n))
+
+/*
+ * Make a mask for 'v' bits at position 'n'
+ */
+
+#define _MM_MAKEMASK(v,n) (((1<<(v))-1) << (n))
+
+/*
+ * Make a value at 'v' at bit position 'n'
+ */
+
+#define _MM_MAKEVALUE(v,n) ((v) << (n))
+
+/*
+ * Retrieve a value from 'v' at bit position 'n' with 'm' mask bits
+ */
+
+#define _MM_GETVALUE(v,n,m) (((v) & (m)) >> (n))
+
+
+
+/* *********************************************************************
+ * 32-bit MIPS Address Spaces
+ ********************************************************************* */
+
+#ifdef __ASSEMBLER__
+#define _ACAST32_
+#define _ACAST64_
+#else
+#define _ACAST32_ _ATYPE_ _ATYPE32_ /* widen if necessary */
+#define _ACAST64_ _ATYPE64_ /* do _not_ narrow */
+#endif
+
+/* 32-bit address map */
+#define UBASE 0x00000000 /* user+ mapped */
+#define USIZE 0x80000000
+#define K0BASE (_ACAST32_ 0x80000000) /* kernel unmapped cached */
+#define K0SIZE 0x20000000
+#define K1BASE (_ACAST32_ 0xa0000000) /* kernel unmapped uncached */
+#define K1SIZE 0x20000000
+#define KSBASE (_ACAST32_ 0xc0000000) /* supervisor+ mapped */
+#define KSSIZE 0x20000000
+#define K3BASE (_ACAST32_ 0xe0000000) /* kernel mapped */
+#define K3SIZE 0x20000000
+
+/* 64-bit address map additions to the above (sign-extended) ranges */
+#define XUBASE (_ACAST64_ 0x0000000080000000) /* user+ mapped */
+#define XUSIZE (_ACAST64_ 0x00000FFF80000000)
+#define XSSEGBASE (_ACAST64_ 0x4000000000000000) /* supervisor+ mapped */
+#define XSSEGSIZE (_ACAST64_ 0x0000100000000000)
+#define XKPHYSBASE (_ACAST64_ 0x8000000000000000) /* kernel unmapped */
+#define XKPHYSSIZE (_ACAST64_ 0x0000100000000000)
+#define XKSEGBASE (_ACAST64_ 0xC000000000000000) /* kernel mapped */
+#define XKSEGSIZE (_ACAST64_ 0x00000FFF80000000)
+
+#define GEN_VECT (_ACAST32_ 0x80000080)
+#define UTLB_VECT (_ACAST32_ 0x80000000)
+
+/* *********************************************************************
+ * Address space coercion macros
+ ********************************************************************* */
+
+#define PHYS_TO_K0(pa) (K0BASE | (pa))
+#define PHYS_TO_K1(pa) (K1BASE | (pa))
+#define K0_TO_PHYS(va) ((va) & (K0SIZE-1))
+#define K1_TO_PHYS(va) ((va) & (K1SIZE-1))
+#define K0_TO_K1(va) ((va) | K1SIZE)
+#define K1_TO_K0(va) ((va) & ~K1SIZE)
+
+#define PHYS_TO_XK1(p) (_ACAST64_ (0xffffffffa0000000 | (p)))
+#define XK1_TO_PHYS(p) ((p) & (K1SIZE-1))
+#define PHYS_TO_XKPHYS(cca,p) (_SB_MAKEMASK1(63) | (_SB_MAKE64(cca) << 59) | (p))
+#define PHYS_TO_XKSEG_UNCACHED(p) PHYS_TO_XKPHYS(K_CALG_UNCACHED,(p))
+#define PHYS_TO_XKSEG_CACHED(p) PHYS_TO_XKPHYS(K_CALG_COH_SHAREABLE,(p))
+#define XKPHYS_TO_PHYS(p) ((p) & _SB_MAKEMASK(0,59))
+
+
+#if !defined(__ASSEMBLER__)
+#define mips_wbflush() __asm__ __volatile__ ("sync" : : : "memory")
+#define ISK0SEG(va) ((va) >= K0BASE && (va) <= (K0BASE + K0SIZE - 1))
+#define ISK1SEG(va) ((va) >= K1BASE && (va) <= (K1BASE + K1SIZE - 1))
+#endif
+
+/* *********************************************************************
+ * Register aliases
+ ********************************************************************* */
+
+#if defined(__ASSEMBLER__)
+#define zero $0
+#define AT $1 /* assembler temporaries */
+#define v0 $2 /* value holders */
+#define v1 $3
+#define a0 $4 /* arguments */
+#define a1 $5
+#define a2 $6
+#define a3 $7
+#define t0 $8 /* temporaries */
+#define t1 $9
+#define t2 $10
+#define t3 $11
+#define t4 $12
+#define t5 $13
+#define t6 $14
+#define t7 $15
+#define ta0 $12
+#define ta1 $13
+#define ta2 $14
+#define ta3 $15
+#define s0 $16 /* saved registers */
+#define s1 $17
+#define s2 $18
+#define s3 $19
+#define s4 $20
+#define s5 $21
+#define s6 $22
+#define s7 $23
+#define t8 $24 /* temporaries */
+#define t9 $25
+#define k0 $26 /* kernel registers */
+#define k1 $27
+#define gp $28 /* global pointer */
+#define sp $29 /* stack pointer */
+#define s8 $30 /* saved register */
+#define fp $30 /* frame pointer */
+#define ra $31 /* return address */
+#endif
+
+/* *********************************************************************
+ * CP0 Registers
+ ********************************************************************* */
+
+#if defined(__ASSEMBLER__)
+#define C0_INX $0 /* CP0: TLB Index */
+#define C0_RAND $1 /* CP0: TLB Random */
+#define C0_TLBLO0 $2 /* CP0: TLB EntryLo0 */
+#define C0_TLBLO C0_TLBLO0 /* CP0: TLB EntryLo0 */
+#define C0_TLBLO1 $3 /* CP0: TLB EntryLo1 */
+#define C0_CTEXT $4 /* CP0: Context */
+#define C0_PGMASK $5 /* CP0: TLB PageMask */
+#define C0_WIRED $6 /* CP0: TLB Wired */
+#define C0_BADVADDR $8 /* CP0: Bad Virtual Address */
+#define C0_COUNT $9 /* CP0: Count */
+#define C0_TLBHI $10 /* CP0: TLB EntryHi */
+#define C0_COMPARE $11 /* CP0: Compare */
+#define C0_SR $12 /* CP0: Processor Status */
+#define C0_STATUS C0_SR /* CP0: Processor Status */
+#define C0_CAUSE $13 /* CP0: Exception Cause */
+#define C0_EPC $14 /* CP0: Exception PC */
+#define C0_PRID $15 /* CP0: Processor Revision Indentifier */
+#define C0_CONFIG $16 /* CP0: Config */
+#define C0_LLADDR $17 /* CP0: LLAddr */
+#define C0_WATCHLO $18 /* CP0: WatchpointLo */
+#define C0_WATCHHI $19 /* CP0: WatchpointHi */
+#define C0_XCTEXT $20 /* CP0: XContext */
+#define C0_ECC $26 /* CP0: ECC */
+#define C0_CACHEERR $27 /* CP0: CacheErr */
+#define C0_TAGLO $28 /* CP0: TagLo */
+#define C0_TAGHI $29 /* CP0: TagHi */
+#define C0_ERREPC $30 /* CP0: ErrorEPC */
+#else
+#define C0_INX 0 /* CP0: TLB Index */
+#define C0_RAND 1 /* CP0: TLB Random */
+#define C0_TLBLO0 2 /* CP0: TLB EntryLo0 */
+#define C0_TLBLO C0_TLBLO0 /* CP0: TLB EntryLo0 */
+#define C0_TLBLO1 3 /* CP0: TLB EntryLo1 */
+#define C0_CTEXT 4 /* CP0: Context */
+#define C0_PGMASK 5 /* CP0: TLB PageMask */
+#define C0_WIRED 6 /* CP0: TLB Wired */
+#define C0_BADVADDR 8 /* CP0: Bad Virtual Address */
+#define C0_COUNT 9 /* CP0: Count */
+#define C0_TLBHI 10 /* CP0: TLB EntryHi */
+#define C0_COMPARE 11 /* CP0: Compare */
+#define C0_SR 12 /* CP0: Processor Status */
+#define C0_STATUS C0_SR /* CP0: Processor Status */
+#define C0_CAUSE 13 /* CP0: Exception Cause */
+#define C0_EPC 14 /* CP0: Exception PC */
+#define C0_PRID 15 /* CP0: Processor Revision Indentifier */
+#define C0_CONFIG 16 /* CP0: Config */
+#define C0_LLADDR 17 /* CP0: LLAddr */
+#define C0_WATCHLO 18 /* CP0: WatchpointLo */
+#define C0_WATCHHI 19 /* CP0: WatchpointHi */
+#define C0_XCTEXT 20 /* CP0: XContext */
+#define C0_ECC 26 /* CP0: ECC */
+#define C0_CACHEERR 27 /* CP0: CacheErr */
+#define C0_TAGLO 28 /* CP0: TagLo */
+#define C0_TAGHI 29 /* CP0: TagHi */
+#define C0_ERREPC 30 /* CP0: ErrorEPC */
+#endif
+
+/* *********************************************************************
+ * CP1 (floating point) control registers
+ ********************************************************************* */
+
+#define FPA_IRR 0 /* CP1: Implementation/Revision */
+#define FPA_CSR 31 /* CP1: Control/Status */
+
+/* *********************************************************************
+ * Macros for generating assembly language routines
+ ********************************************************************* */
+
+#if defined(__ASSEMBLER__)
+
+/* global leaf function (does not call other functions) */
+#define LEAF(name) \
+ .globl name; \
+ .ent name; \
+name:
+
+/* global alternate entry to (local or global) leaf function */
+#define XLEAF(name) \
+ .globl name; \
+ .aent name; \
+name:
+
+/* end of a global function */
+#define END(name) \
+ .size name,.-name; \
+ .end name
+
+/* local leaf function (does not call other functions) */
+#define SLEAF(name) \
+ .ent name; \
+name:
+
+/* local alternate entry to (local or global) leaf function */
+#define SXLEAF(name) \
+ .aent name; \
+name:
+
+/* end of a local function */
+#define SEND(name) \
+ END(name)
+
+/* define & export a symbol */
+#define EXPORT(name) \
+ .globl name; \
+name:
+
+/* import a symbol */
+#define IMPORT(name, size) \
+ .extern name,size
+
+/* define a zero-fill common block (BSS if not overridden) with a global name */
+#define COMM(name,size) \
+ .comm name,size
+
+/* define a zero-fill common block (BSS if not overridden) with a local name */
+#define LCOMM(name,size) \
+ .lcomm name,size
+
+#endif
+
+
+/* Floating-Point Control register bits */
+#define CSR_C 0x00800000
+#define CSR_EXC 0x0003f000
+#define CSR_EE 0x00020000
+#define CSR_EV 0x00010000
+#define CSR_EZ 0x00008000
+#define CSR_EO 0x00004000
+#define CSR_EU 0x00002000
+#define CSR_EI 0x00001000
+#define CSR_TV 0x00000800
+#define CSR_TZ 0x00000400
+#define CSR_TO 0x00000200
+#define CSR_TU 0x00000100
+#define CSR_TI 0x00000080
+#define CSR_SV 0x00000040
+#define CSR_SZ 0x00000020
+#define CSR_SO 0x00000010
+#define CSR_SU 0x00000008
+#define CSR_SI 0x00000004
+#define CSR_RM 0x00000003
+
+/* Status Register */
+#define M_SR_CUMASK _MM_MAKEMASK(4,28) /* coprocessor usable bits */
+#define M_SR_CU3 _MM_MAKEMASK1(31) /* coprocessor 3 usable */
+#define M_SR_CU2 _MM_MAKEMASK1(30) /* coprocessor 2 usable */
+#define M_SR_CU1 _MM_MAKEMASK1(29) /* coprocessor 1 usable */
+#define M_SR_CU0 _MM_MAKEMASK1(28) /* coprocessor 0 usable */
+
+#define M_SR_RP _MM_MAKEMASK1(27) /* reduced power mode */
+#define M_SR_FR _MM_MAKEMASK1(26) /* fpu regs any data */
+#define M_SR_RE _MM_MAKEMASK1(25) /* reverse endian */
+#define M_SR_MX _MM_MAKEMASK1(24) /* MDMX */
+#define M_SR_PX _MM_MAKEMASK1(23) /* 64-bit ops in user mode */
+#define M_SR_BEV _MM_MAKEMASK1(22) /* boot exception vectors */
+#define M_SR_TS _MM_MAKEMASK1(21) /* TLB is shut down */
+#define M_SR_SR _MM_MAKEMASK1(20) /* soft reset */
+#define M_SR_NMI _MM_MAKEMASK1(19) /* nonmaskable interrupt */
+
+#define M_SR_IMASK _MM_MAKEMASK(8,8) /* all interrupt mask bits */
+
+#define M_SR_IBIT8 _MM_MAKEMASK1(15) /* individual bits */
+#define M_SR_IBIT7 _MM_MAKEMASK1(14)
+#define M_SR_IBIT6 _MM_MAKEMASK1(13)
+#define M_SR_IBIT5 _MM_MAKEMASK1(12)
+#define M_SR_IBIT4 _MM_MAKEMASK1(11)
+#define M_SR_IBIT3 _MM_MAKEMASK1(10)
+#define M_SR_IBIT2 _MM_MAKEMASK1(9)
+#define M_SR_IBIT1 _MM_MAKEMASK1(8)
+
+#define M_SR_IMASK8 0 /* masks for nested int levels */
+#define M_SR_IMASK7 _MM_MAKEMASK(1,15)
+#define M_SR_IMASK6 _MM_MAKEMASK(2,14)
+#define M_SR_IMASK5 _MM_MAKEMASK(3,13)
+#define M_SR_IMASK4 _MM_MAKEMASK(4,12)
+#define M_SR_IMASK3 _MM_MAKEMASK(5,11)
+#define M_SR_IMASK2 _MM_MAKEMASK(6,10)
+#define M_SR_IMASK1 _MM_MAKEMASK(7,9)
+#define M_SR_IMASK0 _MM_MAKEMASK(8,8)
+
+#define M_SR_KX _MM_MAKEMASK1(7) /* 64-bit access for kernel */
+#define M_SR_SX _MM_MAKEMASK1(6) /* .. for supervisor */
+#define M_SR_UX _MM_MAKEMASK1(5) /* .. for user */
+
+#define S_SR_KSU 3 /* base operating mode mode */
+#define M_SR_KSU _MM_MAKEMASK(2,S_SR_KSU)
+#define V_SR_KSU(x) _MM_MAKEVALUE(x,S_SR_KSU)
+#define G_SR_KSU(x) _MM_GETVALUE(x,S_SR_KSU,M_SR_KSU)
+#define K_SR_KSU_KERNEL 0
+#define K_SR_KSU_SUPR 1
+#define K_SR_KSU_USER 2
+
+#define M_SR_UM _MM_MAKEMASK1(4)
+#define M_SR_ERL _MM_MAKEMASK1(2)
+#define M_SR_EXL _MM_MAKEMASK1(1)
+#define M_SR_IE _MM_MAKEMASK1(0)
+
+/*
+ * Cause Register
+ */
+#define M_CAUSE_BD _MM_MAKEMASK1(31) /* exception in BD slot */
+
+#define S_CAUSE_CE 28 /* coprocessor error */
+#define M_CAUSE_CE _MM_MAKEMASK(2,S_CAUSE_CE)
+#define V_CAUSE_CE(x) _MM_MAKEVALUE(x,S_CAUSE_CE)
+#define G_CAUSE_CE(x) _MM_GETVALUE(x,S_CAUSE_CE,M_CAUSE_CE)
+
+#define M_CAUSE_IV _MM_MAKEMASK1(23) /* special interrupt */
+#define M_CAUSE_WP _MM_MAKEMASK1(22) /* watch interrupt deferred */
+
+#define S_CAUSE_IPMASK 8
+#define M_CAUSE_IPMASK _MM_MAKEMASK(8,S_CAUSE_IPMASK)
+#define M_CAUSE_IP8 _MM_MAKEMASK1(15) /* hardware interrupts */
+#define M_CAUSE_IP7 _MM_MAKEMASK1(14)
+#define M_CAUSE_IP6 _MM_MAKEMASK1(13)
+#define M_CAUSE_IP5 _MM_MAKEMASK1(12)
+#define M_CAUSE_IP4 _MM_MAKEMASK1(11)
+#define M_CAUSE_IP3 _MM_MAKEMASK1(10)
+#define M_CAUSE_SW2 _MM_MAKEMASK1(9) /* software interrupts */
+#define M_CAUSE_SW1 _MM_MAKEMASK1(8)
+
+#define S_CAUSE_EXC 2
+#define M_CAUSE_EXC _MM_MAKEMASK(5,S_CAUSE_EXC)
+#define V_CAUSE_EXC(x) _MM_MAKEVALUE(x,S_CAUSE_EXC)
+#define G_CAUSE_EXC(x) _MM_GETVALUE(x,S_CAUSE_EXC,M_CAUSE_EXC)
+
+/* Exception Code */
+#define K_CAUSE_EXC_INT 0 /* External interrupt */
+#define K_CAUSE_EXC_MOD 1 /* TLB modification */
+#define K_CAUSE_EXC_TLBL 2 /* TLB miss (Load or Ifetch) */
+#define K_CAUSE_EXC_TLBS 3 /* TLB miss (Save) */
+#define K_CAUSE_EXC_ADEL 4 /* Address error (Load or Ifetch) */
+#define K_CAUSE_EXC_ADES 5 /* Address error (Save) */
+#define K_CAUSE_EXC_IBE 6 /* Bus error (Ifetch) */
+#define K_CAUSE_EXC_DBE 7 /* Bus error (data load or store) */
+#define K_CAUSE_EXC_SYS 8 /* System call */
+#define K_CAUSE_EXC_BP 9 /* Break point */
+#define K_CAUSE_EXC_RI 10 /* Reserved instruction */
+#define K_CAUSE_EXC_CPU 11 /* Coprocessor unusable */
+#define K_CAUSE_EXC_OVF 12 /* Arithmetic overflow */
+#define K_CAUSE_EXC_TRAP 13 /* Trap exception */
+#define K_CAUSE_EXC_VCEI 14 /* Virtual Coherency Exception (I) */
+#define K_CAUSE_EXC_FPE 15 /* Floating Point Exception */
+#define K_CAUSE_EXC_CP2 16 /* Cp2 Exception */
+#define K_CAUSE_EXC_WATCH 23 /* Watchpoint exception */
+#define K_CAUSE_EXC_VCED 31 /* Virtual Coherency Exception (D) */
+
+#define K_NTLBENTRIES 64
+
+#define HI_HALF(x) ((x) >> 16)
+#define LO_HALF(x) ((x) & 0xffff)
+
+/* FPU stuff */
+
+#if defined(__ASSEMBLER__)
+#define C1_CSR $31
+#define C1_FRID $0
+#else
+#define C1_CSR 31
+#define C1_FRID 0
+#endif
+
+#define S_FCSR_CAUSE 12
+#define M_FCSR_CAUSE _MM_MAKEMASK(5,S_FCSR_CAUSE)
+#define V_FCSR_CAUSE(x) _MM_MAKEVALUE(x,S_FCSR_CAUSE)
+#define G_FCSR_CAUSE(x) _MM_GETVALUE(x,S_FCSR_CAUSE,M_FCSR_CAUSE)
+
+#define S_FCSR_ENABLES 7
+#define M_FCSR_ENABLES _MM_MAKEMASK(5,S_FCSR_ENABLES)
+#define V_FCSR_ENABLES(x) _MM_MAKEVALUE(x,S_FCSR_ENABLES)
+#define G_FCSR_ENABLES(x) _MM_GETVALUE(x,S_FCSR_ENABLES,M_FCSR_ENABLES)
+
+#define S_FCSR_FLAGS 2
+#define M_FCSR_FLAGS _MM_MAKEMASK(5,S_FCSR_FLAGS)
+#define V_FCSR_FLAGS(x) _MM_MAKEVALUE(x,S_FCSR_FLAGS)
+#define G_FCSR_FLAGS(x) _MM_GETVALUE(x,S_FCSR_FLAGS,M_FCSR_FLAGS)
+
+
+/*
+ * MIPS64 Config Register (select 0)
+ */
+#define M_CFG_CFG1 _MM_MAKEMASK1(31) /* config1 select1 is impl */
+#define M_CFG_BE _MM_MAKEMASK1(15) /* big-endian mode */
+
+#define S_CFG_AT 13 /* Architecture Type */
+#define M_CFG_AT _MM_MAKEMASK(2,S_CFG_AT)
+#define V_CFG_AT(x) _MM_MAKEVALUE(x,S_CFG_AT)
+#define G_CFG_AT(x) _MM_GETVALUE(x,S_CFG_AT,M_CFG_AT)
+#define K_CFG_AT_MIPS32 0
+#define K_CFG_AT_MIPS64_32 1
+#define K_CFG_AT_MIPS64 2
+
+#define S_CFG_AR 10 /* Architecture Revision */
+#define M_CFG_AR _MM_MAKEMASK(3,S_CFG_AR)
+#define V_CFG_AR(x) _MM_MAKEVALUE(x,S_CFG_AR)
+#define G_CFG_AR(x) _MM_GETVALUE(x,S_CFG_AR,M_CFG_AR)
+#define K_CFG_AR_REV1 0
+
+#define S_CFG_MMU 7 /* MMU Type */
+#define M_CFG_MMU _MM_MAKEMASK(3,S_CFG_MMU)
+#define V_CFG_MMU(x) _MM_MAKEVALUE(x,S_CFG_MMU)
+#define G_CFG_MMU(x) _MM_GETVALUE(x,S_CFG_MMU,M_CFG_MMU)
+#define K_CFG_MMU_NONE 0
+#define K_CFG_MMU_TLB 1
+#define K_CFG_MMU_BAT 2
+#define K_CFG_MMU_FIXED 3
+
+#define S_CFG_K0COH 0 /* K0seg coherency */
+#define M_CFG_K0COH _MM_MAKEMASK(3,S_CFG_K0COH)
+#define V_CFG_K0COH(x) _MM_MAKEVALUE(x,S_CFG_K0COH)
+#define G_CFG_K0COH(x) _MM_GETVALUE(x,S_CFG_K0COH,M_CFG_K0COH)
+#define K_CFG_K0COH_UNCACHED 2
+#define K_CFG_K0COH_CACHEABLE 3
+#define K_CFG_K0COH_COHERENT 5
+
+/*
+ * MIPS64 Config Register (select 1)
+ */
+
+#define M_CFG_CFG2 _MM_MAKEMASK1(31) /* config2 select2 is impl */
+
+#define S_CFG_MMUSIZE 25
+#define M_CFG_MMUSIZE _MM_MAKEMASK(6,S_CFG_MMUSIZE)
+
+#define S_CFG_IS 22
+#define M_CFG_IS _MM_MAKEMASK(3,S_CFG_IS)
+#define V_CFG_IS(x) _MM_MAKEVALUE(x,S_CFG_IS)
+#define G_CFG_IS(x) _MM_GETVALUE(x,S_CFG_IS,M_CFG_IS)
+
+#define S_CFG_IL 19
+#define M_CFG_IL _MM_MAKEMASK(S_CFG_IL,3)
+#define V_CFG_IL(x) _MM_MAKEVALUE(x,S_CFG_IL)
+#define G_CFG_IL(x) _MM_GETVALUE(x,S_CFG_IL,M_CFG_IL)
+
+#define S_CFG_IA 16
+#define M_CFG_IA _MM_MAKEMASK(3,S_CFG_IA)
+#define V_CFG_IA(x) _MM_MAKEVALUE(x,S_CFG_IA)
+#define G_CFG_IA(x) _MM_GETVALUE(x,S_CFG_IA,M_CFG_IA)
+
+#define S_CFG_DS 13
+#define M_CFG_DS _MM_MAKEMASK(3,S_CFG_DS)
+#define V_CFG_DS(x) _MM_MAKEVALUE(x,S_CFG_DS)
+#define G_CFG_DS(x) _MM_GETVALUE(x,S_CFG_DS,M_CFG_DS)
+
+#define S_CFG_DL 10
+#define M_CFG_DL _MM_MAKEMASK(3,S_CFG_DL)
+#define V_CFG_DL(x) _MM_MAKEVALUE(x,S_CFG_DL)
+#define G_CFG_DL(x) _MM_GETVALUE(x,S_CFG_DL,M_CFG_DL)
+
+#define S_CFG_DA 7
+#define M_CFG_DA _MM_MAKEMASK(3,S_CFG_DA)
+#define V_CFG_DA(x) _MM_MAKEVALUE(x,S_CFG_DA)
+#define G_CFG_DA(x) _MM_GETVALUE(x,S_CFG_DA,M_CFG_DA)
+
+#define M_CFG_PC _MM_MAKEMASK1(4) /* perf ctrs present */
+#define M_CFG_WR _MM_MAKEMASK1(3) /* watch regs present */
+#define M_CFG_CA _MM_MAKEMASK1(2) /* MIPS16 present */
+#define M_CFG_EP _MM_MAKEMASK1(1) /* EJTAG present */
+#define M_CFG_FP _MM_MAKEMASK1(0) /* FPU present */
+
+
+
+/*
+ * Primary Cache TagLo
+ */
+
+#define S_TAGLO_PTAG 8
+#define M_TAGLO_PTAG _MM_MAKEMASK(56,S_TAGLO_PTAG)
+
+#define S_TAGLO_PSTATE 6
+#define M_TAGLO_PSTATE _MM_MAKEMASK(2,S_TAGLO_PSTATE)
+#define V_TAGLO_PSTATE(x) _MM_MAKEVALUE(x,S_TAGLO_PSTATE)
+#define G_TAGLO_PSTATE(x) _MM_GETVALUE(x,S_TAGLO_PSTATE,M_TAGLO_PSTATE)
+#define K_TAGLO_PSTATE_INVAL 0
+#define K_TAGLO_PSTATE_SHARED 1
+#define K_TAGLO_PSTATE_CLEAN_EXCL 2
+#define K_TAGLO_PSTATE_DIRTY_EXCL 3
+
+#define M_TAGLO_LOCK _MM_MAKEMASK1(5)
+#define M_TAGLO_PARITY _MM_MAKEMASK1(0)
+
+
+/*
+ * CP0 CacheErr register
+ */
+#define M_CERR_DATA _MM_MAKEMASK1(31) /* err in D space */
+#define M_CERR_SCACHE _MM_MAKEMASK1(30) /* err in l2, not l1 */
+#define M_CERR_DERR _MM_MAKEMASK1(29) /* data error */
+#define M_CERR_TERR _MM_MAKEMASK1(28) /* tag error */
+#define M_CERR_EXTRQ _MM_MAKEMASK1(27) /* external req caused err */
+#define M_CERR_BPAR _MM_MAKEMASK1(26) /* bus parity err */
+#define M_CERR_ADATA _MM_MAKEMASK1(25) /* additional data */
+#define M_CERR_IDX _MM_MAKEMASK(22,0)
+
+
+
+/*
+ * Primary Cache operations
+ */
+#define Index_Invalidate_I 0x0 /* 0 0 */
+#define Index_Writeback_Inv_D 0x1 /* 0 1 */
+#define Index_Invalidate_SI 0x2 /* 0 2 */
+#define Index_Writeback_Inv_SD 0x3 /* 0 3 */
+#define Index_Load_Tag_I 0x4 /* 1 0 */
+#define Index_Load_Tag_D 0x5 /* 1 1 */
+#define Index_Load_Tag_SI 0x6 /* 1 2 */
+#define Index_Load_Tag_SD 0x7 /* 1 3 */
+#define Index_Store_Tag_I 0x8 /* 2 0 */
+#define Index_Store_Tag_D 0x9 /* 2 1 */
+#define Index_Store_Tag_SI 0xA /* 2 2 */
+#define Index_Store_Tag_SD 0xB /* 2 3 */
+#define Create_Dirty_Exc_D 0xD /* 3 1 */
+#define Create_Dirty_Exc_SD 0xF /* 3 3 */
+#define Hit_Invalidate_I 0x10 /* 4 0 */
+#define Hit_Invalidate_D 0x11 /* 4 1 */
+#define Hit_Invalidate_SI 0x12 /* 4 2 */
+#define Hit_Invalidate_SD 0x13 /* 4 3 */
+#define Fill_I 0x14 /* 5 0 */
+#define Hit_Writeback_Inv_D 0x15 /* 5 1 */
+#define Hit_Writeback_Inv_SD 0x17 /* 5 3 */
+#define Hit_Writeback_I 0x18 /* 6 0 */
+#define Hit_Writeback_D 0x19 /* 6 1 */
+#define Hit_Writeback_SD 0x1B /* 6 3 */
+#define Hit_Set_Virtual_SI 0x1E /* 7 2 */
+#define Hit_Set_Virtual_SD 0x1F /* 7 3 */
+
+/* Watchpoint Register */
+#define M_WATCH_PA 0xfffffff8
+#define M_WATCH_R 0x00000002
+#define M_WATCH_W 0x00000001
+
+
+/* TLB entries */
+#define M_TLBHI_ASID _MM_MAKEMASK(0,8)
+#define M_TLBHI_VPN2 _MM_MAKEMASK(27,13)
+
+#define M_TLBLO_G _MM_MAKEMASK1(0)
+#define M_TLBLO_V _MM_MAKEMASK1(1)
+#define M_TLBLO_D _MM_MAKEMASK1(2)
+
+#define S_TLBLO_CALG 3
+#define M_TLBLO_CALG _MM_MAKEMASK(3,S_TLBLO_CALG)
+#define V_TLBLO_CALG(x) _MM_MAKEVALUE(x,S_TLBLO_CALG)
+#define G_TLBLO_CALG(x) _MM_GETVALUE(x,S_TLBLO_CALG,M_TLBLO_CALG)
+
+#define K_CALG_COH_EXCL1_NOL2 0
+#define K_CALG_COH_SHRL1_NOL2 1
+#define K_CALG_UNCACHED 2
+#define K_CALG_NONCOHERENT 3
+#define K_CALG_COH_EXCL 4
+#define K_CALG_COH_SHAREABLE 5
+#define K_CALG_NOTUSED 6
+#define K_CALG_UNCACHED_ACCEL 7
+
+#define S_TLBLO_PFNMASK 6
+#define M_TLBLO_PFNMASK _MM_MAKEMASK(24,S_TLBLO_PFNMASK)
+#define V_TLBLO_PFNMASK(x) _MM_MAKEVALUE(x,S_TLBLO_PFNMASK)
+#define G_TLBLO_PFNMASK(x) _MM_GETVALUE(x,S_TLBLO_PFNMASK,M_TLBLO_PFNMASK)
+
+
+
+#endif /* _SB_MIPS_H */
+
+
diff --git a/cfe/cfe/arch/mips/cpu/bcmcore/include/sbsdram.h b/cfe/cfe/arch/mips/cpu/bcmcore/include/sbsdram.h
new file mode 100644
index 0000000..80e93e3
--- /dev/null
+++ b/cfe/cfe/arch/mips/cpu/bcmcore/include/sbsdram.h
@@ -0,0 +1,92 @@
+/*
+ Copyright 2001, Broadcom Corporation
+ All Rights Reserved.
+
+ This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
+ the contents of this file may not be disclosed to third parties, copied or
+ duplicated in any form, in whole or in part, without the prior written
+ permission of Broadcom Corporation.
+*/
+/*
+ * BCM47XX Sonics SiliconBackplane SDRAM controller core hardware definitions.
+ *
+ * $Id: sbsdram.h,v 1.1 2001/10/31 18:49:26 mpl Exp $
+ */
+
+#ifndef _SBSDRAM_H
+#define _SBSDRAM_H
+
+#ifndef _LANGUAGE_ASSEMBLY
+
+/* Sonics side: SDRAM core registers */
+typedef volatile struct sbsdramregs {
+ uint32 initcontrol; /* Generates external SDRAM initialization sequence */
+ uint32 config; /* Initializes external SDRAM mode register */
+ uint32 refresh; /* Controls external SDRAM refresh rate */
+ uint32 pad1;
+ uint32 pad2;
+} sbsdramregs_t;
+
+#endif
+
+/* SDRAM initialization control (initcontrol) register bits */
+#define SDRAM_CBR 0x0001 /* Writing 1 generates refresh cycle and toggles bit */
+#define SDRAM_PRE 0x0002 /* Writing 1 generates precharge cycle and toggles bit */
+#define SDRAM_MRS 0x0004 /* Writing 1 generates mode register select cycle and toggles bit */
+#define SDRAM_EN 0x0008 /* When set, enables access to SDRAM */
+#define SDRAM_16Mb 0x0000 /* Use 16 Megabit SDRAM */
+#define SDRAM_64Mb 0x0010 /* Use 64 Megabit SDRAM */
+#define SDRAM_128Mb 0x0020 /* Use 128 Megabit SDRAM */
+#define SDRAM_RSVMb 0x0030 /* Use special SDRAM */
+#define SDRAM_RST 0x0080 /* Writing 1 causes soft reset of controller */
+#define SDRAM_SELFREF 0x0100 /* Writing 1 enables self refresh mode */
+#define SDRAM_PWRDOWN 0x0200 /* Writing 1 causes controller to power down */
+#define SDRAM_32BIT 0x0400 /* When set, indicates 32 bit SDRAM interface */
+#define SDRAM_9BITCOL 0x0800 /* When set, indicates 9 bit column */
+
+/* SDRAM configuration (config) register bits */
+#define SDRAM_BURSTFULL 0x0000 /* Use full page bursts */
+#define SDRAM_BURST8 0x0001 /* Use burst of 8 */
+#define SDRAM_BURST4 0x0002 /* Use burst of 4 */
+#define SDRAM_BURST2 0x0003 /* Use burst of 2 */
+#define SDRAM_CAS3 0x0000 /* Use CAS latency of 3 */
+#define SDRAM_CAS2 0x0004 /* Use CAS latency of 2 */
+
+/* SDRAM refresh control (refresh) register bits */
+#define SDRAM_REF(p) (((p)&0xff) | SDRAM_REF_EN) /* Refresh period */
+#define SDRAM_REF_EN 0x8000 /* Writing 1 enables periodic refresh */
+
+/* SDRAM Core Init values (OCP ID 0x803) */
+
+#define SDRAM_CONFIG SDRAM_BURSTFULL
+#define SDRAM_REFRESH SDRAM_REF(0x40)
+
+#if defined(MEM1MX16_KM)
+#define SDRAM_INIT 0x009
+#elif defined(MEM1MX16X2_KM)
+#define SDRAM_INIT 0x409
+#elif defined(MEM2MX8X2_KM)
+#define SDRAM_INIT 0x809
+#elif defined(MEM2MX8X4_KM)
+#define SDRAM_INIT 0xc09
+#elif defined(MEM2MX32_KM)
+#define SDRAM_INIT 0x439
+#elif defined(MEM4MX16_KM)
+#define SDRAM_INIT 0x019
+#elif defined(MEM4MX16X2_KM)
+#define SDRAM_INIT 0x419
+#elif defined(MEM8MX8X2_KM)
+#define SDRAM_INIT 0x819
+#elif defined(MEM8MX8X4_KM)
+#define SDRAM_INIT 0xc19
+#elif defined(MEM8MX16_KM)
+#define SDRAM_INIT 0x829
+#elif defined(MEM8MX16X2_KM)
+#define SDRAM_INIT 0xc29
+#elif defined(MEM4MX32_KM)
+#define SDRAM_INIT 0x429
+#else /* DEFAULT MEM */
+#define SDRAM_INIT 0x419
+#endif
+
+#endif /* _SBSDRAM_H */
diff --git a/cfe/cfe/arch/mips/cpu/bcmcore/src/Makefile b/cfe/cfe/arch/mips/cpu/bcmcore/src/Makefile
new file mode 100755
index 0000000..76662a0
--- /dev/null
+++ b/cfe/cfe/arch/mips/cpu/bcmcore/src/Makefile
@@ -0,0 +1,8 @@
+
+ALLOBJS += bcmcore_cpuinit.o bcmcore_l1cache.o
+ifeq ($(strip ${CFG_RAMAPP}),1)
+ALLOBJS += bcmcore_arena.o
+endif
+CFLAGS += -mips32 -D_MIPSREGS32_ -mno-abicalls -fPIC
+# CFLAGS += -mips2 -D_MIPSREGS32_
+
diff --git a/cfe/cfe/arch/mips/cpu/bcmcore/src/bcmcore_arena.c b/cfe/cfe/arch/mips/cpu/bcmcore/src/bcmcore_arena.c
new file mode 100755
index 0000000..b368158
--- /dev/null
+++ b/cfe/cfe/arch/mips/cpu/bcmcore/src/bcmcore_arena.c
@@ -0,0 +1,170 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Physical Memory (arena) manager File: bcmcore_arena.c
+ *
+ * This module describes the physical memory available to the
+ * firmware.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "sbmips.h"
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "lib_arena.h"
+
+#include "cfe_error.h"
+
+#include "cfe.h"
+#include "cfe_mem.h"
+
+#include "initdata.h"
+
+#define _NOPROTOS_
+#include "cfe_boot.h"
+#undef _NOPROTOS_
+
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#define ARENA_RANGE(bottom,top,type) arena_markrange(&cfe_arena,(uint64_t)(bottom), \
+ (uint64_t)(top)-(uint64_t)bottom+1,(type),NULL)
+
+#define MEG (1024*1024)
+#define KB 1024
+#define PAGESIZE 4096
+#define CFE_BOOTAREA_SIZE (256*KB)
+#define CFE_BOOTAREA_ADDR 0x20000000
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+extern arena_t cfe_arena;
+
+unsigned int mem_bootarea_start;
+unsigned int mem_bootarea_size;
+
+void bcmcore_arena_init(void);
+void bcmcore_pagetable_init(uint64_t *ptaddr,unsigned int physaddr);
+
+
+/* *********************************************************************
+ * bcmcore_arena_init()
+ *
+ * Create the initial map of physical memory
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void bcmcore_arena_init(void)
+{
+ int64_t memleft;
+
+#if 1 /* defined(CONFIG_MIPS_BRCM) */
+ arena_init(&cfe_arena,0x0,0x0); /* 2^32 physical bytes */
+#else
+ arena_init(&cfe_arena,0x0,0x100000000); /* 2^32 physical bytes */
+#endif
+
+ /*
+ * Mark the ranges from the SB1250's memory map
+ */
+
+ ARENA_RANGE(0x0000000000,0x000FFFFFFF,MEMTYPE_DRAM_NOTINSTALLED);
+
+ /*
+ * Now, fix up the map with what is known about *this* system.
+ *
+ * Do each 256MB chunk.
+ */
+
+ memleft = ((int64_t) mem_totalsize) << 20;
+
+ arena_markrange(&cfe_arena,0x00000000,memleft,MEMTYPE_DRAM_AVAILABLE,NULL);
+
+ /*
+ * Do the boot ROM
+ */
+
+ arena_markrange(&cfe_arena,0x1FC00000,2*1024*1024,MEMTYPE_BOOTROM,NULL);
+
+}
+
+
+/* *********************************************************************
+ * BCMCORE_PAGETABLE_INIT(ptaddr,physaddr)
+ *
+ * This routine constructs the page table. 256KB is mapped
+ * starting at physical address 'physaddr' - the resulting
+ * table entries are placed at 'ptaddr'
+ *
+ * Input parameters:
+ * ptaddr - base of page table
+ * physaddr - starting physical addr of area to map
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void bcmcore_pagetable_init(uint64_t *ptaddr,unsigned int physaddr)
+{
+ int idx;
+
+ for (idx = 0; idx < (CFE_BOOTAREA_SIZE/PAGESIZE); idx++) {
+ ptaddr[idx] = (physaddr >> 6) |
+ V_TLBLO_CALG(K_CALG_NONCOHERENT) |
+ M_TLBLO_V |
+ M_TLBLO_D;
+ physaddr += PAGESIZE;
+ }
+
+}
+
diff --git a/cfe/cfe/arch/mips/cpu/bcmcore/src/bcmcore_cpuinit.S b/cfe/cfe/arch/mips/cpu/bcmcore/src/bcmcore_cpuinit.S
new file mode 100755
index 0000000..7c04b51
--- /dev/null
+++ b/cfe/cfe/arch/mips/cpu/bcmcore/src/bcmcore_cpuinit.S
@@ -0,0 +1,490 @@
+/* *********************************************************************
+ * SB1250 Board Support Package
+ *
+ * CPU initialization File: bcmcore_cpuinit.S
+ *
+ * This module contains code to initialize the CPU cores.
+ *
+ * Note: all the routines in this module rely on registers only,
+ * since DRAM may not be active yet.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * XX Copyright 2000,2001
+ * Broadcom Corporation. All rights reserved.
+ *
+ * BROADCOM PROPRIETARY AND CONFIDENTIAL
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the license.
+ ********************************************************************* */
+
+#include "sbmips.h"
+#include "exception.h"
+#include "bsp_config.h"
+#include "mipsmacros.h"
+#include "cpu_config.h" /* for ERET and HAZARD */
+
+
+ .text
+
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#define LINESIZE 16
+
+#define CACHEOP(cachename,op) ((cachename) | ((op) << 2))
+
+#define CACHE_OP_IDXINVAL 0
+#define CACHE_OP_IDXLOADTAG 1
+#define CACHE_OP_IDXSTORETAG 2
+#define CACHE_OP_IMPLRSVD 3
+#define CACHE_OP_HITINVAL 4
+#define CACHE_OP_FILL 5
+#define CACHE_OP_HITWRITEBACK_INVAL 5
+#define CACHE_OP_HITWRITEBACK 6
+#define CACHE_OP_FETCHLOCK 7
+
+#define L2C 3
+#define L1C_I 0
+#define L1C_D 1
+
+
+/*
+ * Duplicates from cfe_iocb.h -- warning!
+ */
+
+#define CFE_CACHE_FLUSH_D 1
+#define CFE_CACHE_INVAL_I 2
+#define CFE_CACHE_INVAL_D 4
+#define CFE_CACHE_INVAL_L2 8
+#define CFE_CACHE_FLUSH_L2 16
+#define CFE_CACHE_INVAL_RANGE 32
+#define CFE_CACHE_FLUSH_RANGE 64
+
+#define BCMCORE_NTLBENTRIES 32
+
+
+
+#define SENDCHAR(c) \
+ li t0,0xBF800000 ; \
+ li t1,c ; \
+ sb t1,0(t0)
+
+
+#define R_CPU_CP0INIT _TBLIDX(0)
+#define R_CPU_L1CINIT _TBLIDX(1)
+#define R_CPU_SETLEDS _TBLIDX(2)
+#define R_CPU_L1CFLASHD _TBLIDX(3)
+#define R_CPU_L1CINVALI _TBLIDX(4)
+
+#define SETLEDS1(a,b,c,d) \
+ li a0,(((a)<<24)|((b)<<16)|((c)<<8)|(d)) ; \
+ CALLINIT_KSEG1(cpuinit_table,R_CPU_SETLEDS)
+#define SETLEDS(a,b,c,d) \
+ li a0,(((a)<<24)|((b)<<16)|((c)<<8)|(d)) ; \
+ CALLINIT_KSEG0(cpuinit_table,R_CPU_SETLEDS)
+
+cpuinit_table:
+ _LONG_ bcmcore_cp0_init # [ 0 ] R_CPU_CP0INIT
+ _LONG_ bcmcore_l1cache_init # [ 1 ] R_CPU_L1CINIT
+ _LONG_ board_setleds # [ 2 ] R_CPU_SETLEDS
+ _LONG_ bcmcore_l1cache_flush_d # [ 3 ] R_CPU_L1CFLASHD
+ _LONG_ bcmcore_l1cache_inval_i # [ 4 ] R_CPU_L1CINVALI
+
+
+/* *********************************************************************
+ * BCMCORE_CP0_INIT()
+ *
+ * Initialize an BCMCORE CPU's CP0 registers
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ *
+ * Registers used:
+ * all
+ ********************************************************************* */
+
+
+LEAF(bcmcore_cp0_init)
+
+ .set noreorder
+
+ mtc0 zero,C0_WATCHLO # Watch registers.
+ mtc0 zero,C0_WATCHHI
+ mtc0 zero,C0_CAUSE # must clear before writing SR
+
+ mfc0 v0,C0_SR # Get status register
+ and v0,M_SR_SR # preserve soft reset
+#ifdef DEBUG_ENV_ICE
+ and v0,~M_SR_BEV
+#else
+ or v0,M_SR_BEV # exceptions to boot vector
+#endif
+ mtc0 v0,C0_SR # set up the status register
+
+
+ mfc0 v0,C0_CONFIG # get current CONFIG register
+ srl v0,v0,3 # strip out K0 bits
+ sll v0,v0,3 # k0 bits now zero
+ or v0,v0,K_CFG_K0COH_CACHEABLE # K0 is cacheable.
+ mtc0 v0,C0_CONFIG
+ nop
+
+ mtc0 zero,C0_WATCHLO # Watch registers.
+ mtc0 zero,C0_WATCHHI
+
+ mtc0 zero,C0_TLBHI # TLB entry (high half)
+ nop
+
+
+ #
+ # This is probably not the right init value for C0_COMPARE,
+ # but it seems to be necessary for the sim model right now.
+ #
+
+ li v0,-1
+ mtc0 v0,C0_COMPARE
+ nop
+
+ #
+ # Initialize all the TLB entries to some invalid value
+ #
+
+ mtc0 zero,C0_TLBLO0 /* tlblo0 = invalid */
+ nop
+ mtc0 zero,C0_TLBLO1 /* tlblo1 = invalid */
+ nop
+ mtc0 zero,C0_PGMASK /* 4K pages */
+ nop
+
+ li t0,K1BASE /* tlbhi = impossible vpn */
+ li t1,(BCMCORE_NTLBENTRIES-1) /* index */
+
+
+ nop
+1: mtc0 t0,C0_TLBHI
+ nop
+ mtc0 t1,C0_INX
+ nop
+ addu t0,0x2000 /* inc vpn */
+ tlbwi
+ bnez t1,1b
+ subu t1,1 # BDSLOT
+ .set reorder
+
+
+/*
+ * XXX What other CP0 initialization do I need?
+ */
+
+ jr ra
+
+
+END(bcmcore_cp0_init)
+
+
+/* *********************************************************************
+ * BCMCORE_CPUINIT
+ *
+ * Do initialization of the Broadcom core
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+
+LEAF(bcmcore_cpuinit)
+
+ move fp,ra
+
+ SETLEDS1('C','P','U','I')
+ CALLINIT_KSEG1(cpuinit_table,R_CPU_CP0INIT)
+
+ SETLEDS1('L','1','C','I')
+ CALLINIT_KSEG1(cpuinit_table,R_CPU_L1CINIT)
+
+ move ra,fp
+ j ra
+
+END(bcmcore_cpuinit)
+
+
+/* *********************************************************************
+ * BCMCORE_KSEG0_SWITCH
+ *
+ * Return to the address of the routine that called us, except
+ * in K0seg instead of K1seg
+ *
+ * Input parameters:
+ * nothing - ra is return address
+ *
+ * Return value:
+ * ra = same return address in K0
+ ********************************************************************* */
+
+LEAF(bcmcore_kseg0_switch)
+
+ and ra,(K0SIZE-1)
+ or ra,K0BASE
+ jr ra
+
+END(bcmcore_kseg0_switch)
+
+/* *********************************************************************
+ * BCMCORE_NULL
+ *
+ * Dummy handler for routines we don't need to implement, like
+ * the multiprocessor stuff
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ *
+ * Registers used:
+ * none
+ ********************************************************************* */
+
+LEAF(bcmcore_null)
+
+ j ra
+
+END(bcmcore_null)
+
+
+/* *********************************************************************
+ * BCMCORE_CPURESTART
+ *
+ * This routine is called when someone soft-exits to CFE. We
+ * reinitialize any CP0 stuff here.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+LEAF(bcmcore_cpurestart)
+
+ j ra
+
+END(bcmcore_cpurestart)
+
+
+/* *********************************************************************
+ * BCMCORE_CACHEOPS
+ *
+ * Perform various cache operations on a BCM Core
+ *
+ * Input parameters:
+ * a0 - flag bits (CFE_CACHE_xxx)
+ *
+ * Return value:
+ * nothing
+ *
+ * Registers used:
+ * t0,t1,t2,t3,v1,s0
+ ********************************************************************* */
+
+LEAF(bcmcore_cacheops)
+
+ move s0,ra
+
+ move v1,a0
+
+ /*
+ * With no flags, we flush L1D and invalid L1I
+ */
+
+ bne v1,zero,1f
+ li v1,CFE_CACHE_FLUSH_D | CFE_CACHE_INVAL_I
+1:
+
+ /*
+ * Flush the D-Cache, since the program we loaded is "data".
+ */
+
+ and a0,v1,CFE_CACHE_FLUSH_D
+ beq a0,zero,1f
+ CALLINIT_KSEG1(cpuinit_table,R_CPU_L1CFLASHD)
+1:
+
+ /*
+ * Invalidate the I-Cache, so that addresses in the program
+ * region will miss and need to be filled from the data we
+ * just flushed above.
+ */
+
+ and a0,v1,CFE_CACHE_INVAL_I
+ beq a0,zero,1f
+ CALLINIT_KSEG1(cpuinit_table,R_CPU_L1CINVALI)
+1:
+
+
+ .set push
+ .set mips32
+
+ /*
+ * Invalidate cache range
+ */
+
+ and a0,v1,CFE_CACHE_INVAL_RANGE
+ beq a0,zero,2f
+
+ move t0,a1
+1: cache CACHEOP(L1C_D,CACHE_OP_HITINVAL),0(t0)
+ add t0,LINESIZE
+ blt t0,a2,1b
+
+ /*
+ * Flush cache range
+ */
+
+
+2:
+ and a0,v1,CFE_CACHE_FLUSH_RANGE
+ beq a0,zero,2f
+
+ move t0,a1
+1: cache CACHEOP(L1C_D,CACHE_OP_HITWRITEBACK_INVAL),0(t0)
+ add t0,LINESIZE
+ blt t0,a2,1b
+
+2:
+
+ .set pop
+
+
+ move ra,s0
+ j ra
+
+END(bcmcore_cacheops)
+
+
+
+/* *********************************************************************
+ * BCMCORE_TLBHANDLER
+ *
+ * This is the TLB exception handler for the bcmcore
+ *
+ * Note: only K0 and K1 are available to us at this time.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+
+LEAF(bcmcore_tlbhandler)
+ .set noreorder
+ .set noat
+
+/*
+ * XXX XXX XXX XXX XXX
+ *
+ * This won't work as-is on the BCMCORE. The CONTEXT register is not
+ * wide enough! In fact, it's broken on all pre-mips4 CPUs.
+ *
+ * XXX XXX XXX XXX XXX
+ */
+
+/*
+ * This requires a bit of explanation: We only support 256KB
+ * of mapped space for the boot program. This space will be
+ * mapped from 0x2000_0000 to 0x2004_0000 to some physical
+ * memory allocated by the firmware. This is 64 pages
+ * of 4KB each.
+ *
+ * We know our BadVPN2 will be in the range
+ * 0x100000 to 0x1001F0, since the memory is mapped from
+ * 0x2000_0000 to 0x2004_0000. BadVPN2 plus the four bits
+ * of zeroes at the end are bits 31..9
+ *
+ * We also want to place the PTEbase on something other than
+ * a 16MB boundary. Each entry is 16 bytes, and there
+ * are 64 entries, so we need only 10 bits to address
+ * the entire table (it can therefore be aligned on a
+ * 1KB boundary).
+ *
+ * To make this work, we'll shift PTEbase to the right, leaving
+ * the bottom ten bits for the page number, as:
+ *
+ * Bits 31..10: PTEbase
+ * Bits 9..4: BadVPN
+ * Bits 3..0: 16 bytes for table entry
+ *
+ * Therefore:
+ * PTEbase gets shifted right 13 bits.
+ * BadVPN gets masked at 6 bits (mask is 0x3F0)
+ * The bottom 4 bits are zero.
+ *
+ * To range check the address, we can shift the Bad VPN
+ * right by 9 bits, and check for values of 0x1000 and
+ * 0x1001.
+ */
+
+
+ /*
+ * This part range checks the VPN2 field in the
+ * context register. We only handle
+ * VPN2s in the range 0x100000 to 0x1001F0
+ */
+ mfc0 k0,C0_TLBHI
+
+ mfc0 k0,C0_CTEXT # Get context
+ sra k0,8 # keep hi part
+ and k0,0x1FFF # of VPN2
+ li k1,0x1000 # 0x1000 is ok
+ beq k0,k1,1f #
+ nop # BDSLOT
+ li k1,0x1001 # 0x1001 is ok
+ beq k0,k1,1f #
+ nop # BDSLOT
+
+ li k0,XTYPE_TLBFILL # all other bits are not
+ b _exc_entry
+ nop # BDSLOT
+
+1: mfc0 k0,C0_CTEXT # Get context
+ sra k0,13 # Shift PTEbase
+ li k1,0x3FF # Generate mask to kill
+ not k1 # BadVPN2 bits
+ and k0,k1 # keep only PTEBase part.
+
+ mfc0 k1,C0_CTEXT # Get Context
+ and k1,0x3F0 # Keep only BadVPN2 bits
+ or k1,k0 # Replace PTEBase
+
+ ld k0,0(k1) # Load entrylo0
+ ld k1,8(k1) # Load entrylo1
+ mtc0 k0,C0_TLBLO0 # and write to CP0
+ mtc0 k1,C0_TLBLO1
+ tlbwr # put it in the TLB
+ ERET
+ nop
+
+ .set reorder
+ .set at
+
+END(bcmcore_tlbhandler)
+
+
+/* *********************************************************************
+ * End
+ ********************************************************************* */
+
diff --git a/cfe/cfe/arch/mips/cpu/bcmcore/src/bcmcore_l1cache.S b/cfe/cfe/arch/mips/cpu/bcmcore/src/bcmcore_l1cache.S
new file mode 100755
index 0000000..fa39bfd
--- /dev/null
+++ b/cfe/cfe/arch/mips/cpu/bcmcore/src/bcmcore_l1cache.S
@@ -0,0 +1,219 @@
+/* *********************************************************************
+ * SB1250 Board Support Package
+ *
+ * L1C initialization File: bcmcore_l1cache.S
+ *
+ * This module contains code to initialize the CPU's caches
+ *
+ * Note: all the routines in this module rely on registers only,
+ * since DRAM may not be active yet.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * XX Copyright 2000,2001
+ * Broadcom Corporation. All rights reserved.
+ *
+ * BROADCOM PROPRIETARY AND CONFIDENTIAL
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the license.
+ ********************************************************************* */
+
+#include "sbmips.h"
+#include "bsp_config.h"
+
+ .text
+
+ .set push
+ .set mips32
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#define CP0_CFG_ISMSK (0x7 << 22)
+#define CP0_CFG_ISSHF 22
+#define CP0_CFG_ILMSK (0x7 << 19)
+#define CP0_CFG_ILSHF 19
+#define CP0_CFG_IAMSK (0x7 << 16)
+#define CP0_CFG_IASHF 16
+#define CP0_CFG_DSMSK (0x7 << 13)
+#define CP0_CFG_DSSHF 13
+#define CP0_CFG_DLMSK (0x7 << 10)
+#define CP0_CFG_DLSHF 10
+#define CP0_CFG_DAMSK (0x7 << 7)
+#define CP0_CFG_DASHF 7
+
+#define cacheop(kva, size, linesize, op) \
+ .set noreorder; \
+ addu t1, kva, size; \
+ subu t2, linesize, 1; \
+ not t2; \
+ and t0, kva, t2; \
+ addu t1, -1; \
+ and t1, t2; \
+10: cache op, 0(t0); \
+ bne t0, t1, 10b; \
+ addu t0, linesize; \
+11: \
+ .set reorder
+
+#define size_icache(size, linesize) \
+ mfc0 t7, C0_CONFIG, 1; \
+ and t0, t7, CP0_CFG_ILMSK; \
+ srl t0, t0, CP0_CFG_ILSHF; \
+ move linesize, zero; \
+ beq t0, zero,1f; \
+ add t0, 1; \
+ li linesize, 1; \
+ sll linesize, t0; \
+1: and t0, t7, CP0_CFG_ISMSK; \
+ srl t0, t0, CP0_CFG_ISSHF; \
+ li size, 64; \
+ sll size, t0; \
+ and t0, t7, CP0_CFG_IAMSK; \
+ srl t0, t0, CP0_CFG_IASHF; \
+ add t0, 1; \
+ mult size, t0; \
+ mflo size; \
+ mult size, linesize; \
+ mflo size
+
+#define size_dcache(size, linesize) \
+ mfc0 t7, C0_CONFIG, 1; \
+ and t0, t7, CP0_CFG_DLMSK; \
+ srl t0, t0, CP0_CFG_DLSHF; \
+ move linesize, zero; \
+ beq t0, zero,1f; \
+ add t0, 1; \
+ li linesize, 1; \
+ sll linesize, t0; \
+1: and t0, t7, CP0_CFG_DSMSK; \
+ srl t0, t0, CP0_CFG_DSSHF; \
+ li size, 64; \
+ sll size, t0; \
+ and t0, t7, CP0_CFG_DAMSK; \
+ srl t0, t0, CP0_CFG_DASHF; \
+ add t0, 1; \
+ mult size, t0; \
+ mflo size; \
+ mult size, linesize; \
+ mflo size
+
+
+/* *********************************************************************
+ * BCMCORE_L1CACHE_INIT()
+ *
+ * Initialize the L1 Cache
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ *
+ * Registers used:
+ * t0,t1,t2
+ ********************************************************************* */
+
+LEAF(bcmcore_l1cache_init)
+
+ mtc0 zero, C0_TAGLO # Initialize TAGLO register
+ mtc0 zero, C0_TAGLO,1 # Initialize DataLo register
+
+ li a0, K0BASE # Initialise primary instruction cache.
+ size_icache(a1, a2)
+ cacheop(a0, a1, a2, Index_Store_Tag_I)
+
+ li a0, K0BASE # Initialise primary data cache.
+ size_dcache(a1, a2)
+ cacheop(a0, a1, a2, Index_Store_Tag_D)
+
+ jr ra
+
+END(bcmcore_l1cache_init)
+
+/* *********************************************************************
+ * BCMCORE_L1CACHE_INVAL_I()
+ *
+ * Invalidate the entire ICache
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ *
+ * Registers used:
+ * t0,t1,t2
+ ********************************************************************* */
+LEAF(bcmcore_l1cache_inval_i)
+
+ li a0, K0BASE
+ size_icache(a1, a2)
+ cacheop(a0, a1, a2, Index_Invalidate_I)
+
+ j ra
+
+END(bcmcore_l1cache_inval_i)
+
+/* *********************************************************************
+ * BCMCORE_L1CACHE_FLUSH_D()
+ *
+ * Flush the entire DCache
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ *
+ * Registers used:
+ * t0,t1,t2
+ ********************************************************************* */
+LEAF(bcmcore_l1cache_flush_d)
+
+ li a0, K0BASE
+ size_dcache(a1, a2)
+
+# before flushing cache clear tags pointing to flash memory to avoid writes into flash
+ addu t1, a0, a1
+ subu t2, a2, 1
+ not t2
+ and t0, a0, t2
+ addu t1, -1
+ and t1, t2
+1:
+ cache Index_Load_Tag_D, 0(t0)
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ mfc0 t2, C0_TAGLO # Read TAGLO register
+ and t2, 0x1f000000 # check address
+ li t3, 0x1f000000
+ bne t2, t3, 2f
+ mtc0 zero, C0_TAGLO
+ cache Index_Store_Tag_D, 0(t0) # Reset tag for flash memory locations
+2:
+ .set noreorder;
+ bne t0, t1, 1b
+ addu t0, a2
+ .set reorder
+
+ cacheop(a0, a1, a2, Index_Writeback_Inv_D)
+
+ j ra
+
+END(bcmcore_l1cache_flush_d)
+
+ .set pop
+
+/* *********************************************************************
+ * End
+ ********************************************************************* */
+
diff --git a/cfe/cfe/dev/SIBYTE_PRIVATE_FILES b/cfe/cfe/dev/SIBYTE_PRIVATE_FILES
new file mode 100644
index 0000000..eae0411
--- /dev/null
+++ b/cfe/cfe/dev/SIBYTE_PRIVATE_FILES
@@ -0,0 +1,6 @@
+dev_ptflash.c
+bcm5700.h
+dev_bcm5700.c
+bcm5821.h
+dev_bcm5821.c
+
diff --git a/cfe/cfe/dev/bcm5700.h b/cfe/cfe/dev/bcm5700.h
new file mode 100644
index 0000000..76aa3ea
--- /dev/null
+++ b/cfe/cfe/dev/bcm5700.h
@@ -0,0 +1,1007 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * BCM5700 (10/100/1K EthernetMAC) registers File: bcm5700.c
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#ifndef _BCM5700_H_
+#define _BCM5700_H_
+
+/*
+ * Register and bit definitions for the Broadcom BCM570X family (aka
+ * Tigon3) of Integrated MACs.
+ *
+ * References:
+ *
+ * Host Programmer Interface Specification for the BCM570X Family
+ * of Highly-Integrated Media Access Controllers, 570X-PG106-R.
+ * Broadcom Corp., 16215 Alton Parkway, Irvine CA, 09/27/02
+ *
+ * Simplified Programmer Interface Specification for the BCM570X Family
+ * of Highly Integrated Media Access Controllers, 570X-PG202-R.
+ * Broadcom Corp., 16215 Alton Parkway, Irvine CA, 10/14/02
+ */
+
+#define K_PCI_VENDOR_BROADCOM 0x14e4
+#define K_PCI_ID_BCM5700 0x1644
+#define K_PCI_ID_BCM5701 0x1645
+#define K_PCI_ID_BCM5702 0x16A6
+#define K_PCI_ID_BCM5703 0x16A7
+#define K_PCI_ID_BCM5704C 0x1648
+#define K_PCI_ID_BCM5704S 0x16A8
+#define K_PCI_ID_BCM5705 0x1653
+
+#define _DD_MAKEMASK1(n) (1 << (n))
+#define _DD_MAKEMASK(v,n) ((((1)<<(v))-1) << (n))
+#define _DD_MAKEVALUE(v,n) ((v) << (n))
+#define _DD_GETVALUE(v,n,m) (((v) & (m)) >> (n))
+
+
+/* Registers 0x0000 - 0x00FF are PCI Configuration registers (shadow) */
+
+#define PCI_PCIX_CMD_REG 0x40
+#define PCI_PCIX_STAT_REG 0x44
+
+#define PCI_PMC_REG 0x48
+#define PCI_PMCSR_REG 0x4C
+
+#define R_MISC_HOST_CTRL 0x0068
+#define R_DMA_RW_CTRL 0x006C
+#define R_PCI_STATE 0x0070
+#define R_PCI_CLK_CTRL 0x0074
+#define R_REG_BASE_ADDR 0x0078
+#define R_MEMWIN_BASE_ADDR 0x007C
+#define R_REG_DATA 0x0080
+#define R_MEMWIN_DATA 0x0084
+/* For 5700 and 5701, 0x0088-0x0090 shadow 0x6800-0x6808 */
+#define R_INT_MBOX0 0x0B0 /* 8 bytes, shadows R_INT_MBOX(0) */
+
+/* Registers 0x0200 - 0x03FF are High Priority Mailbox registers */
+
+#define R_INT_MBOX(n) (0x0200 + 8*(n)) /* 0 <= n < 4 */
+#define R_GEN_MBOX(n) (0x0220 + 8*(n)-8) /* 1 <= n <= 8 */
+#define R_RELOAD_STATS_MBOX 0x0260
+#define R_RCV_BD_STD_PI 0x0268
+#define R_RCV_BD_JUMBO_PI 0x0270
+#define R_RCV_BD_MINI_PI 0x0278
+#define R_RCV_BD_RTN_CI(n) (0x0280 + 8*(n)-8) /* 1 <= n <= 16 */
+#define R_SND_BD_PI(n) (0x0300 + 8*(n)-8) /* 1 <= n <= 16 */
+#define R_SND_BD_NIC_PI(n) (0x0380 + 8*(n)-8) /* 1 <= n <= 16 */
+
+/* Registers 0x0400 - 0x0BFF are MAC Control registers */
+
+#define R_MAC_MODE 0x0400
+#define R_MAC_STATUS 0x0404
+#define R_MAC_EVENT_ENB 0x0408
+#define R_MAC_LED_CTRL 0x040C
+
+#define R_MAC_ADDR1_HIGH 0x0410
+#define R_MAC_ADDR1_LOW 0x0414
+#define R_MAC_ADDR2_HIGH 0x0418
+#define R_MAC_ADDR2_LOW 0x041C
+#define R_MAC_ADDR3_HIGH 0x0420
+#define R_MAC_ADDR3_LOW 0x0424
+#define R_MAC_ADDR4_HIGH 0x0428
+#define R_MAC_ADDR4_LOW 0x042C
+
+#define R_WOL_PATTERN_PTR 0x0430
+#define R_WOL_PATTERN_CFG 0x0434
+#define R_TX_BACKOFF 0x0438
+#define R_RX_MTU 0x043C
+#define R_PCS_TEST 0x0440
+#define R_TX_AUTONEG 0x0444
+#define R_RX_AUTONEG 0x0448
+
+#define R_MI_COMM 0x044C
+#define R_MI_STATUS 0x0450
+#define R_MI_MODE 0x0454
+
+#define R_AUTOPOLL_STAT 0x0458
+#define R_TX_MODE 0x045C
+#define R_TX_STAT 0x0460
+#define R_TX_LENS 0x0464
+#define R_RX_MODE 0x0468
+#define R_RX_STAT 0x046C
+
+#define R_MAC_HASH(n) (0x0470 + 4*(n)) /* 0 <= n < 4 */
+
+#define R_RX_BD_RULES_CTRL(n) (0x0480 + 8*(n)) /* 0 <= n < 16 */
+#define R_RX_BD_RULES_MASK(n) (0x0484 + 8*(n))
+
+#define R_RX_RULES_CFG 0x0500
+#define R_RX_FRAMES_LOW 0x0504
+#define R_MAC_HASH_EXT(n) (0x0520 + 4*(n)) /* 0 <= n < 4 */
+#define R_MAC_ADDR_EXT(n) (0x0530 + 8*(n)) /* 0 <= n < 12 */
+#define R_SERDES_CTRL 0x0590
+#define R_SERDES_STAT 0x0594
+#define R_RX_STATS_MEM 0x0800
+#define R_TX_STATS_MEM 0x0880
+
+
+/*
+ * Note on Buffer Descriptor (BD) Ring indices:
+ * Numbering follows Broadcom literature, which uses indices 1-16.
+ * PI = producer index, CI = consumer index.
+ */
+
+/* Registers 0x0C00 - 0x0FFF are Send Data Initiator Control registers */
+
+#define R_SND_DATA_MODE 0x0C00
+#define R_SND_DATA_STAT 0x0C04
+#define R_SND_DATA_STATS_CTRL 0x0C08
+#define R_SND_DATA_STATS_ENB 0x0C0C
+#define R_SND_DATA_STATS_INCR 0x0C10
+
+#define R_STATS_CTR_SND_COS(n) (0x0C80 + 4*(n)-4) /* 1 <= n <= 16 */
+#define R_STATS_DMA_RDQ_FULL 0x0CC0
+#define R_STATS_DMA_HP_RDQ_FULL 0x0CC4
+#define R_STATS_SDCQ_FULL 0x0CC8
+#define R_STATS_NIC_SET_SND_PI 0x0CCC
+#define R_STATS_STAT_UPDATED 0x0CD0
+#define R_STATS_IRQS 0x0CD4
+#define R_STATS_IRQS_AVOIDED 0x0CD8
+#define R_STATS_SND_THRSH_HIT 0x0CDC
+
+/* Registers 0x1000 - 0x13FF are Send Data Completion Control registers */
+
+#define R_SND_DATA_COMP_MODE 0x1000
+
+/* Registers 0x1400 - 0x17FF are Send BD Ring Selection Control registers */
+
+#define R_SND_BD_SEL_MODE 0x1400
+#define R_SND_BD_SEL_STAT 0x1404
+#define R_SND_BD_DIAG 0x1408
+#define R_SND_BD_SEL_CI(n) (0x1440 + 4*(n)-4) /* 1 <= n <= 16 */
+
+/* Registers 0x1800 - 0x1BFF are Send BD Initiator Control registers */
+
+#define R_SND_BD_INIT_MODE 0x1800
+#define R_SND_BD_INIT_STAT 0x1804
+#define R_SND_BD_INIT_PI(n) (0x1808 + 4*(n)-4) /* 1 <= n <= 16 */
+
+/* Registers 0x1C00 - 0x1FFF are Send BD Completion Control registers */
+
+#define R_SND_BD_COMP_MODE 0x1C00
+
+/* Registers 0x2000 - 0x23FF are Receive List Placement Control registers */
+
+#define R_RCV_LIST_MODE 0x2000
+#define R_RCV_LIST_STAT 0x2004
+#define R_RCV_LIST_LOCK 0x2008
+#define R_RCV_NONEMPTY_BITS 0x200C
+#define R_RCV_LIST_CFG 0x2010
+#define R_RCV_LIST_STATS_CTRL 0x2014
+#define R_RCV_LIST_STATS_ENB 0x2018
+#define R_RCV_LIST_STATS_INC 0x201C
+#define R_RCV_LIST_HEAD(n) (0x2100 + 16*(n)-16) /* 1 <= n <= 16 */
+#define R_RCV_LIST_TAIL(n) (0x2104 + 16*(n)-16)
+#define R_RCV_LIST_CNT(n) (0x2108 + 16*(n)-16)
+#define R_STATS_CTR_RCV_COS(n) (0x2200 + 4*(n)-4) /* 1 <= n <= 16 */
+#define R_STATS_FILT_DROP 0x2240
+#define R_STATS_DMA_WRQ_FULL 0x2244
+#define R_STATS_DMA_HP_WRQ_FULL 0x2248
+#define R_STATS_NO_RCV_BDS 0x224C
+#define R_STATS_IN_DISCARDS 0x2250
+#define R_STATS_IN_ERRORS 0x2254
+#define R_STATS_RCV_THRSH_HIT 0x2258
+
+/* Registers 0x2400 - 0x27FF are Receive Data/BD Initiator Control registers */
+
+#define R_RCV_DATA_INIT_MODE 0x2400
+#define R_RCV_DATA_INIT_STAT 0x2404
+#define R_JUMBO_RCV_BD_RCB 0x2440 /* 16 bytes */
+#define R_STD_RCV_BD_RCB 0x2450 /* 16 bytes */
+#define R_MINI_RCV_BD_RCB 0x2460 /* 16 bytes */
+#define R_RCV_BD_INIT_JUMBO_CI 0x2470
+#define R_RCV_BD_INIT_STD_CI 0x2474
+#define R_RCV_BD_INIT_MINI_CI 0x2478
+#define R_RCV_BD_INIT_RTN_PI(n) (0x2480 + 4*(n)-4) /* 1 <= n <= 16 */
+#define R_RCV_BD_INIT_DIAG 0x24C0
+
+/* Registers 0x2800 - 0x2BFF are Receive Data Completion Control registers */
+
+#define R_RCV_COMP_MODE 0x2800
+
+/* Registers 0x2C00 - 0x2FFF are Receive BD Initiator Control registers */
+
+#define R_RCV_BD_INIT_MODE 0x2C00
+#define R_RCV_BD_INIT_STAT 0x2C04
+#define R_RCV_BD_INIT_JUMBO_PI 0x2C08
+#define R_RCV_BD_INIT_STD_PI 0x2C0C
+#define R_RCV_BD_INIT_MINI_PI 0x2C10
+#define R_MINI_RCV_BD_THRESH 0x2C14
+#define R_STD_RCV_BD_THRESH 0x2C18
+#define R_JUMBO_RCV_BD_THRESH 0x2C1C
+
+/* Registers 0x3000 - 0x33FF are Receive BD Completion Control registers */
+
+#define R_RCV_BD_COMP_MODE 0x3000
+#define R_RCV_BD_COMP_STAT 0x3004
+#define R_NIC_JUMBO_RCV_BD_PI 0x3008
+#define R_NIC_STD_RCV_BD_PI 0x300C
+#define R_NIC_MINI_RCV_BD_PI 0x3010
+
+/* Registers 0x3400 - 0x37FF are Receive List Selector Control registers */
+
+#define R_RCV_LIST_SEL_MODE 0x3400
+#define R_RCV_LIST_SEL_STATUS 0x3404
+
+/* Registers 0x3800 - 0x3BFF are Mbuf Cluster Free registers */
+
+#define R_MBUF_FREE_MODE 0x3800
+#define R_MBUF_FREE_STATUS 0x3804
+
+/* Registers 0x3C00 - 0x3FFF are Host Coalescing Control registers */
+
+#define R_HOST_COAL_MODE 0x3C00
+#define R_HOST_COAL_STAT 0x3C04
+#define R_RCV_COAL_TICKS 0x3C08
+#define R_SND_COAL_TICKS 0x3C0C
+#define R_RCV_COAL_MAX_CNT 0x3C10
+#define R_SND_COAL_MAX_CNT 0x3C14
+#define R_RCV_COAL_INT_TICKS 0x3C18
+#define R_SND_COAL_INT_TICKS 0x3C1C
+#define R_RCV_COAL_INT_CNT 0x3C20
+#define R_SND_COAL_INT_CNT 0x3C24
+#define R_STATS_TICKS 0x3C28
+#define R_STATS_HOST_ADDR 0x3C30 /* 8 bytes */
+#define R_STATUS_HOST_ADDR 0x3C38 /* 8 bytes */
+#define R_STATS_BASE_ADDR 0x3C40
+#define R_STATUS_BASE_ADDR 0x3C44
+#define R_FLOW_ATTN 0x3C48
+#define R_NIC_JUMBO_RCV_BD_CI 0x3C50
+#define R_NIC_STD_RCV_BD_CI 0x3C54
+#define R_NIC_MINI_RCV_BD_CI 0x3C58
+#define R_NIC_RTN_PI(n) (0x3C80 + 4*(n)-4) /* 1 <= n <= 16 */
+#define R_NIC_SND_BD_CD(n) (0x3CC0 + 4*(n)-4) /* 1 <= n <= 16 */
+
+/* Registers 0x4000 - 0x43FF are Memory Arbiter registers */
+
+#define R_MEM_MODE 0x4000
+#define R_MEM_STATUS 0x4004
+#define R_MEM_TRAP_LOW 0x4008
+#define R_MEM_TRAP_HIGH 0x400C
+
+
+/* Registers 0x4400 - 0x47FF are Buffer Manager Control registers */
+
+#define R_BMGR_MODE 0x4400
+#define R_BMGR_STATUS 0x4404
+#define R_BMGR_MBUF_BASE 0x4408
+#define R_BMGR_MBUF_LEN 0x440C
+#define R_BMGR_MBUF_DMA_LOW 0x4410
+#define R_BMGR_MBUF_RX_LOW 0x4414
+#define R_BMGR_MBUF_HIGH 0x4418
+
+#define R_BMGR_DMA_BASE 0x442C
+#define R_BMGR_DMA_LEN 0x4430
+#define R_BMGR_DMA_LOW 0x4434
+#define R_BMGR_DMA_HIGH 0x4438
+
+#define R_BMGR_DIAG1 0x444C
+#define R_BMGR_DIAG2 0x4450
+#define R_BMGR_DIAG3 0x4454
+#define R_BMGR_RCV_FLOW_THRESH 0x4458
+
+/* Registers 0x4800 - 0x4BFF are Read DMA Control registers */
+
+#define R_RD_DMA_MODE 0x4800
+#define R_RD_DMA_STAT 0x4804
+
+/* Registers 0x4C00 - 0x4FFF are Write DMA Control registers */
+
+#define R_WR_DMA_MODE 0x4C00
+#define R_WR_DMA_STAT 0x4C04
+
+/* Registers 0x5000 - 0x53FF are RX RISC registers */
+
+#define R_RX_RISC_MODE 0x5000
+#define R_RX_RISC_STATE 0x5004
+#define R_RX_RISC_PC 0x501C
+
+/* Registers 0x5400 - 0x57FF are TX RISC registers */
+
+#define R_TX_RISC_MODE 0x5400
+#define R_TX_RISC_STATE 0x5404
+#define R_TX_RISC_PC 0x541C
+
+/* Registers 0x5800 - 0x5BFF are Low Priority Mailbox registers (8 bytes) */
+
+#define R_LP_INT_MBOX(n) (0x5800 + 8*(n)) /* 0 <= n < 4 */
+#define R_LP_GEN_MBOX(n) (0x5820 + 8*(n)-8) /* 1 <= n <= 8 */
+#define R_LP_RELOAD_STATS_MBOX 0x5860
+#define R_LP_RCV_BD_STD_PI 0x5868
+#define R_LP_RCV_BD_JUMBO_PI 0x5870
+#define R_LP_RCV_BD_MINI_PI 0x5878
+#define R_LP_RCV_BD_RTN_CI(n) (0x5880 + 8*(n)-8) /* 1 <= n <= 16 */
+#define R_LP_SND_BD_PI(n) (0x5900 + 8*(n)-8) /* 1 <= n <= 16 */
+
+/* Registers 0x5C00 - 0x5C03 are Flow Through Queues */
+
+#define R_FTQ_RESET 0x5C00
+
+/* Registers 0x6000 - 0x63FF are Message Signaled Interrupt registers */
+
+/* Registers 0x6400 - 0x67FF are DMA Completion registers */
+
+#define R_DMA_COMP_MODE 0x6400
+
+/* Registers 0x6800 - 0x68ff are General Control registers */
+
+#define R_MODE_CTRL 0x6800
+#define R_MISC_CFG 0x6804
+#define R_MISC_LOCAL_CTRL 0x6808
+#define R_TIMER 0x680C
+#define R_MEM_PWRUP 0x6030 /* 8 bytes */
+#define R_EEPROM_ADDR 0x6838
+#define R_EEPROM_DATA 0x683C
+#define R_EEPROM_CTRL 0x6840
+#define R_MDI_CTRL 0x6844
+#define R_EEPROM_DELAY 0x6848
+
+/* Registers 0x6C00 - 0x6CFF are ASF Support registers (NYI) */
+
+/* Registers 0x7000 - 0x7024 are NVM Interface registers (NYI) */
+
+
+/* PCI Capability registers (should be moved to PCI headers) */
+
+/* PCI-X Capability and Command Register (0x40) */
+
+#define PCIX_CMD_DPREC_ENABLE 0x00010000
+#define PCIX_CMD_RLXORDER_ENABLE 0x00020000
+#define PCIX_CMD_RD_CNT_SHIFT 18
+#define PCIX_CMD_RD_CNT_MASK 0x000C0000
+#define PCIX_CMD_MAX_SPLIT_SHIFT 20
+#define PCIX_CMD_MAX_SPLIT_MASK 0x00700000
+
+/* PCI-X Status Register (0x44) */
+
+
+/* Generic bit fields shared by most MODE and STATUS registers */
+
+#define M_MODE_RESET _DD_MAKEMASK1(0)
+#define M_MODE_ENABLE _DD_MAKEMASK1(1)
+#define M_MODE_ATTNENABLE _DD_MAKEMASK1(2)
+
+#define M_STAT_ERROR _DD_MAKEMASK1(1)
+
+/* Generic bit fields shared by STATS_CTRL registers */
+
+#define M_STATS_ENABLE _DD_MAKEMASK1(0)
+#define M_STATS_FASTUPDATE _DD_MAKEMASK1(1)
+#define M_STATS_CLEAR _DD_MAKEMASK1(2)
+#define M_STATS_FLUSH _DD_MAKEMASK1(3)
+#define M_STATS_ZERO _DD_MAKEMASK1(4)
+
+/* Private PCI Configuration registers (p 335) */
+
+/* MHC: Miscellaneous Host Control Register (0x68) */
+
+#define M_MHC_CLEARINTA _DD_MAKEMASK1(0)
+#define M_MHC_MASKPCIINT _DD_MAKEMASK1(1)
+#define M_MHC_ENBYTESWAP _DD_MAKEMASK1(2)
+#define M_MHC_ENWORDSWAP _DD_MAKEMASK1(3)
+#define M_MHC_ENPCISTATERW _DD_MAKEMASK1(4)
+#define M_MHC_ENCLKCTRLRW _DD_MAKEMASK1(5)
+#define M_MHC_ENREGWORDSWAP _DD_MAKEMASK1(6)
+#define M_MHC_ENINDIRECT _DD_MAKEMASK1(7)
+#define S_MHC_ASICREV 16
+#define M_MHC_ASICREV _DD_MAKEMASK(16,S_MHC_ASICREV)
+#define G_MHC_ASICREV(x) _DD_GETVALUE(x,S_MHC_ASICREV,M_MHC_ASICREV)
+
+/* DMAC: DMA Read/Write Control Register (0x6c) */
+
+#define S_DMAC_MINDMA 0
+#define M_DMAC_MINDMA _DD_MAKEMASK(8,S_DMAC_MINDMA)
+#define V_DMAC_MINDMA(x) _DD_MAKEVALUE(x,S_DMAC_MINDMA)
+#define G_DMAC_MINDMA(x) _DD_GETVALUE(x,S_DMAC_MINDMA,M_DMAC_MINDMA)
+
+#define M_DMAC_MEMRDMULT _DD_MAKEMASK1(22) /* 570{0,1} only */
+#define M_DMAC_BEALL _DD_MAKEMASK1(23) /* 570{0,1} only */
+
+#define S_DMAC_RDCMD 24 /* 570{0,1} only */
+#define M_DMAC_RDCMD _DD_MAKEMASK(4,S_DMAC_RDCMD)
+#define V_DMAC_RDCMD(x) _DD_MAKEVALUE(x,S_DMAC_RDCMD)
+#define G_DMAC_RDCMD(x) _DD_GETVALUE(x,S_DMAC_RDCMD,M_DMAC_RDCMD)
+#define K_PCI_MEMRD 0x6
+
+#define S_DMAC_WRCMD 28
+#define M_DMAC_WRCMD _DD_MAKEMASK(4,S_DMAC_WRCMD)
+#define V_DMAC_WRCMD(x) _DD_MAKEVALUE(x,S_DMAC_WRCMD)
+#define G_DMAC_WRCMD(x) _DD_GETVALUE(x,S_DMAC_WRCMD,M_DMAC_WRCMD)
+#define K_PCI_MEMWR 0x7
+
+/* PCIS: PCI State Register (0x70) */
+
+#define M_PCIS_RESET _DD_MAKEMASK1(0)
+#define M_PCIS_INT _DD_MAKEMASK1(1)
+#define M_PCIS_MODE _DD_MAKEMASK1(2)
+#define M_PCIS_33MHZ _DD_MAKEMASK1(3)
+#define M_PCIS_32BIT _DD_MAKEMASK1(4)
+#define M_PCIS_ROMEN _DD_MAKEMASK1(5)
+#define M_PCIS_ROMRETRY _DD_MAKEMASK1(6)
+#define M_PCIS_FLATVIEW _DD_MAKEMASK1(8)
+/* ... more ... */
+
+/* PCI Clock Control Register (0x74) */
+
+/* Register Base Address Register (0x78) */
+
+/* Memory Window Base Address Register (0x7c) */
+
+
+/* High Priority Mailboxes (p 323) */
+
+
+/* Ethernet MAC Control registers (p 358) */
+
+/* MACM: Ethernet MAC Mode Register (0x400) */
+
+#define M_MACM_GLBRESET _DD_MAKEMASK1(0)
+#define M_MACM_HALFDUPLEX _DD_MAKEMASK1(1)
+
+#define S_MACM_PORTMODE 2
+#define M_MACM_PORTMODE _DD_MAKEMASK(2,S_MACM_PORTMODE)
+#define V_MACM_PORTMODE(x) _DD_MAKEVALUE(x,S_MACM_PORTMODE)
+#define G_MACM_PORTMODE(x) _DD_GETVALUE(x,S_MACM_PORTMODE,M_MACM_PORTMODE)
+#define K_MACM_PORTMODE_NONE 0x0
+#define K_MACM_PORTMODE_MII 0x1
+#define K_MACM_PORTMODE_GMII 0x2
+#define K_MACM_PORTMODE_TBI 0x3
+
+#define M_MACM_LOOPBACK _DD_MAKEMASK1(4)
+#define M_MACM_TAGGEDMAC _DD_MAKEMASK1(7)
+#define M_MACM_TXBURST _DD_MAKEMASK1(8)
+#define M_MACM_MAXDEFER _DD_MAKEMASK1(9)
+#define M_MACM_LINKPOLARITY _DD_MAKEMASK1(10)
+#define M_MACM_RXSTATSENB _DD_MAKEMASK1(11)
+#define M_MACM_RXSTATSCLR _DD_MAKEMASK1(12)
+#define M_MACM_RXSTATSFLUSH _DD_MAKEMASK1(13)
+#define M_MACM_TXSTATSENB _DD_MAKEMASK1(14)
+#define M_MACM_TXSTATSCLR _DD_MAKEMASK1(15)
+#define M_MACM_TXSTATSFLUSH _DD_MAKEMASK1(16)
+#define M_MACM_SENDCFGS _DD_MAKEMASK1(17)
+#define M_MACM_MAGICPKT _DD_MAKEMASK1(18)
+#define M_MACM_ACPI _DD_MAKEMASK1(19)
+#define M_MACM_MIPENB _DD_MAKEMASK1(20)
+#define M_MACM_TDEENB _DD_MAKEMASK1(21)
+#define M_MACM_RDEENB _DD_MAKEMASK1(22)
+#define M_MACM_FHDEENB _DD_MAKEMASK1(23)
+
+/* MACSTAT: Ethernet MAC Status Register (0x404) */
+/* MACEVNT: Ethernet MAC Event Enable Register (0x408) */
+
+/* Status Register only */
+#define M_MACSTAT_PCSSYNC _DD_MAKEMASK1(0)
+#define M_MACSTAT_SIGDET _DD_MAKEMASK1(1)
+#define M_MACSTAT_RCVCFG _DD_MAKEMASK1(2)
+#define M_MACSTAT_CFGCHNG _DD_MAKEMASK1(3)
+#define M_MACSTAT_SYNCCHNG _DD_MAKEMASK1(4)
+/* Status and Enable Registers */
+#define M_EVT_PORTERR _DD_MAKEMASK1(10)
+#define M_EVT_LINKCHNG _DD_MAKEMASK1(12)
+#define M_EVT_MICOMPLETE _DD_MAKEMASK1(22)
+#define M_EVT_MIINT _DD_MAKEMASK1(23)
+#define M_EVT_APERR _DD_MAKEMASK1(24)
+#define M_EVT_ODIERR _DD_MAKEMASK1(25)
+#define M_EVT_RXSTATOVRUN _DD_MAKEMASK1(26)
+#define M_EVT_TXSTATOVRUN _DD_MAKEMASK1(27)
+
+/* MICOMM: MI Communication Register (0x44c) */
+
+#define S_MICOMM_DATA 0
+#define M_MICOMM_DATA _DD_MAKEMASK(16,S_MICOMM_DATA)
+#define V_MICOMM_DATA(x) _DD_MAKEVALUE(x,S_MICOMM_DATA)
+#define G_MICOMM_DATA(x) _DD_GETVALUE(x,S_MICOMM_DATA,M_MICOMM_DATA)
+
+#define S_MICOMM_REG 16
+#define M_MICOMM_REG _DD_MAKEMASK(5,S_MICOMM_REG)
+#define V_MICOMM_REG(x) _DD_MAKEVALUE(x,S_MICOMM_REG)
+#define G_MICOMM_REG(x) _DD_GETVALUE(x,S_MICOMM_REG,M_MICOMM_REG)
+
+#define S_MICOMM_PHY 21
+#define M_MICOMM_PHY _DD_MAKEMASK(5,S_MICOMM_PHY)
+#define V_MICOMM_PHY(x) _DD_MAKEVALUE(x,S_MICOMM_PHY)
+#define G_MICOMM_PHY(x) _DD_GETVALUE(x,S_MICOMM_PHY,M_MICOMM_PHY)
+
+#define S_MICOMM_CMD 26
+#define M_MICOMM_CMD _DD_MAKEMASK(2,S_MICOMM_CMD)
+#define V_MICOMM_CMD(x) _DD_MAKEVALUE(x,S_MICOMM_CMD)
+#define G_MICOMM_CMD(x) _DD_GETVALUE(x,S_MICOMM_CMD,M_MICOMM_CMD)
+#define K_MICOMM_CMD_WR 0x1
+#define K_MICOMM_CMD_RD 0x2
+#define V_MICOMM_CMD_WR V_MICOMM_CMD(K_MICOMM_CMD_WR)
+#define V_MICOMM_CMD_RD V_MICOMM_CMD(K_MICOMM_CMD_RD)
+
+#define M_MICOMM_RDFAIL _DD_MAKEMASK1(28)
+#define M_MICOMM_BUSY _DD_MAKEMASK1(29)
+
+/* MISTAT: MI Status Register (0x450) */
+
+#define M_MISTAT_LINKED _DD_MAKEMASK1(0)
+#define M_MISTAT_10MBPS _DD_MAKEMASK1(1)
+
+/* MIMODE: MI Mode Register (0x454) */
+
+#define M_MIMODE_SHORTPREAMBLE _DD_MAKEMASK1(1)
+#define M_MIMODE_POLLING _DD_MAKEMASK1(4)
+
+#define S_MIMODE_CLKCNT 16
+#define M_MIMODE_CLKCNT _DD_MAKEMASK(5,S_MIMODE_CLKCNT)
+#define V_MIMODE_CLKCNT(x) _DD_MAKEVALUE(x,S_MIMODE_CLKCNT)
+#define G_MIMODE_CLKCNT(x) _DD_GETVALUE(x,S_MIMODE_CLKCNT,M_MIMODE_CLKCNT)
+
+/* TXLEN: Transmit MAC Lengths Register (0x464) */
+
+#define S_TXLEN_SLOT 0
+#define M_TXLEN_SLOT _DD_MAKEMASK(8,S_TXLEN_SLOT)
+#define V_TXLEN_SLOT(x) _DD_MAKEVALUE(x,S_TXLEN_SLOT)
+#define G_TXLEN_SLOT(x) _DD_GETVALUE(x,S_TXLEN_SLOT,M_TXLEN_SLOT)
+
+#define S_TXLEN_IPG 8
+#define M_TXLEN_IPG _DD_MAKEMASK(4,S_TXLEN_IPG)
+#define V_TXLEN_IPG(x) _DD_MAKEVALUE(x,S_TXLEN_IPG)
+#define G_TXLEN_IPG(x) _DD_GETVALUE(x,S_TXLEN_IPG,M_TXLEN_IPG)
+
+#define S_TXLEN_IPGCRS 12
+#define M_TXLEN_IPGCRS _DD_MAKEMASK(2,S_TXLEN_IPGCRS)
+#define V_TXLEN_IPGCRS(x) _DD_MAKEVALUE(x,S_TXLEN_IPGCRS)
+#define G_TXLEN_IPGCRS(x) _DD_GETVALUE(x,S_TXLEN_IPGCRS,M_TXLEN_IPGCRS)
+
+/* RULESCFG: Receive Rules Configuration Register (0x500) */
+
+#define S_RULESCFG_DEFAULT 3
+#define M_RULESCFG_DEFAULT _DD_MAKEMASK(5,S_RULESCFG_DEFAULT)
+#define V_RULESCFG_DEFAULT(x) _DD_MAKEVALUE(x,S_RULESCFG_DEFAULT)
+#define G_RULESCFG_DEFAULT(x) _DD_GETVALUE(x,S_RULESCFG_DEFAULT,M_RULESCFG_DEFAULT)
+
+
+/* Send Data Initiator Control Registers (p 383) */
+/* Send BD Ring Selector Control Registers (p 387) */
+/* Send BD Initiator Control Registers (p 389) */
+
+
+/* Receive List Placement Control Registers (p 392) */
+
+/* LISTCFG: Receive List Placement Configuration Register (0x2010) */
+
+#define S_LISTCFG_GROUP 0
+#define M_LISTCFG_GROUP _DD_MAKEMASK(3,S_LISTCFG_GROUP)
+#define V_LISTCFG_GROUP(x) _DD_MAKEVALUE(x,S_LISTCFG_GROUP)
+#define G_LISTCFG_GROUP(x) _DD_GETVALUE(x,S_LISTCFG_GROUP,M_LISTCFG_GROUP)
+
+#define S_LISTCFG_ACTIVE 3
+#define M_LISTCFG_ACTIVE _DD_MAKEMASK(5,S_LISTCFG_ACTIVE)
+#define V_LISTCFG_ACTIVE(x) _DD_MAKEVALUE(x,S_LISTCFG_ACTIVE)
+#define G_LISTCFG_ACTIVE(x) _DD_GETVALUE(x,S_LISTCFG_ACTIVE,M_LISTCFG_ACTIVE)
+
+#define S_LISTCFG_BAD 8
+#define M_LISTCFG_BAD _DD_MAKEMASK(5,S_LISTCFG_BAD)
+#define V_LISTCFG_BAD(x) _DD_MAKEVALUE(x,S_LISTCFG_BAD)
+#define G_LISTCFG_BAD(x) _DD_GETVALUE(x,S_LISTCFG_BAD,M_LISTCFG_BAD)
+
+#define S_LISTCFG_DEFAULT 13
+#define M_LISTCFG_DEFAULT _DD_MAKEMASK(2,S_LISTCFG_DEFAULT)
+#define V_LISTCFG_DEFAULT(x) _DD_MAKEVALUE(x,S_LISTCFG_DEFAULT)
+#define G_LISTCFG_DEFAULT(x) _DD_GETVALUE(x,S_LISTCFG_DEFAULT,M_LISTCFG_DEFAULT)
+
+
+/* Receive Data and Receive BD Initiator Control Registers (p 399) */
+
+/* RCVINITMODE: Receive Data and Receive BD Initiator Mode Register (0x2400) */
+
+#define M_RCVINITMODE_JUMBO _DD_MAKEMASK1(2)
+#define M_RCVINITMODE_FRMSIZE _DD_MAKEMASK1(3)
+#define M_RCVINITMODE_RTNSIZE _DD_MAKEMASK1(4)
+
+
+/* Receive Initiator Control Registers (p 404) */
+/* Receive BD Completion Control Registers (p 406) */
+/* Receive List Selector Control Registers (p 408) */
+/* Mbuf Cluster Free Registers (p 409) */
+
+
+/* Host Coalescing Control registers (p 410) */
+
+/* HCM: Host Coalescing Mode Register (0x3C00) */
+
+#define M_HCM_RESET _DD_MAKEMASK1(0)
+#define M_HCM_ENABLE _DD_MAKEMASK1(1)
+#define M_HCM_ATTN _DD_MAKEMASK1(2)
+#define M_HCM_COAL_NOW _DD_MAKEMASK1(3)
+
+#define S_HCM_MSIBITS 4
+#define M_HCM_MSIBITS _DD_MAKEMASK(3,S_HCM_MSIBITS)
+#define V_HCM_MSIBITS(x) _DD_MAKEVALUE(x,S_HCM_MSIBITS)
+#define G_HCM_MSIBITS _DD_GETVALUE(x,S_HCM_MSIBITS,M_HCM_MSIBITS)
+
+#define S_HCM_SBSIZE 7
+#define M_HCM_SBSIZE _DD_MAKEMASK(2,S_HCM_SBSIZE)
+#define V_HCM_SBSIZE(x) _DD_MAKEVALUE(x,S_HCM_SBSIZE)
+#define G_HCM_SBSIZE _DD_GETVALUE(x,S_HCM_SBSIZE,M_HCM_SBSIZE)
+#define K_HCM_SBSIZE_80 0x0
+#define K_HCM_SBSIZE_64 0x1
+#define K_HCM_SBSIZE_32 0x2
+/* ... more ... */
+
+
+/* Memory Arbiter Registers (p 420) */
+
+/* MAM: Memory Arbiter Mode Register (0x4000) */
+
+#define M_MAM_RESET _DD_MAKEMASK1(0)
+#define M_MAM_ENABLE _DD_MAKEMASK1(1)
+
+/* Memory Arbiter Status Register (0x4004) */
+
+/* Memory Arbiter Trap Low and Trap High Registers (0x4008, 0x400C) */
+
+
+/* Buffer Manager Control Registers (p 424) */
+
+/* BMODE: Buffer Manager Control Register (0x4400) */
+
+#define M_BMODE_RESET _DD_MAKEMASK1(0)
+#define M_BMODE_ENABLE _DD_MAKEMASK1(1)
+#define M_BMODE_ATTN _DD_MAKEMASK1(2)
+#define M_BMODE_TEST _DD_MAKEMASK1(3)
+#define M_BMODE_MBUFLOWATTN _DD_MAKEMASK1(4)
+
+
+/* Read DMA Control Registers (p 428) */
+/* Write DMA Control Registers (p 431) */
+
+/* Bit fields shared by DMA_MODE and DMA_STATUS registers */
+
+#define M_ATTN_TGTABORT _DD_MAKEMASK1(2)
+#define M_ATTN_MSTRABORT _DD_MAKEMASK1(3)
+#define M_ATTN_PERR _DD_MAKEMASK1(4)
+#define M_ATTN_ADDROVFL _DD_MAKEMASK1(5)
+#define M_ATTN_FIFOOVFL _DD_MAKEMASK1(6)
+#define M_ATTN_FIFOUNFL _DD_MAKEMASK1(7)
+#define M_ATTN_FIFOREAD _DD_MAKEMASK1(8)
+#define M_ATTN_LENERR _DD_MAKEMASK1(9)
+#define M_ATTN_ALL (M_ATTN_TGTABORT | M_ATTN_MSTRABORT | \
+ M_ATTN_PERR | M_ATTN_ADDROVFL | \
+ M_ATTN_FIFOOVFL | M_ATTN_FIFOUNFL | \
+ M_ATTN_FIFOREAD | M_ATTN_LENERR)
+
+/* Read DMA Mode Register (0x4800) */
+/* Write DMA Mode Register (0x4C00) */
+
+/* Read DMA Status Register (0x4804) */
+/* Write DMA Status Register (0x4C04) */
+
+
+/* RX RISC Registers (p 433) */
+/* TX RISC Registers (p 437) */
+/* Low Priority Mailboxes (p 441) */
+/* Flow Through Queues (p 445) */
+/* Message Signaled Interrupt Registers (p 447) */
+/* DMA Completion Registers (p 449) */
+
+
+/* General Control registers (p 450) */
+
+/* MCTL: Miscellaneous Host Control Register (0x6800) */
+
+#define M_MCTL_UPDATE _DD_MAKEMASK1(0)
+#define M_MCTL_BSWAPCTRL _DD_MAKEMASK1(1)
+#define M_MCTL_WSWAPCTRL _DD_MAKEMASK1(2)
+#define M_MCTL_BSWAPDATA _DD_MAKEMASK1(4)
+#define M_MCTL_WSWAPDATA _DD_MAKEMASK1(5)
+#define M_MCTL_NOCRACK _DD_MAKEMASK1(9)
+#define M_MCTL_NOCRC _DD_MAKEMASK1(10)
+#define M_MCTL_ACCEPTBAD _DD_MAKEMASK1(11)
+#define M_MCTL_NOTXINT _DD_MAKEMASK1(13)
+#define M_MCTL_NORTRNINT _DD_MAKEMASK1(14)
+#define M_MCTL_PCI32 _DD_MAKEMASK1(15)
+#define M_MCTL_HOSTUP _DD_MAKEMASK1(16)
+#define M_MCTL_HOSTBDS _DD_MAKEMASK1(17)
+#define M_MCTL_NOTXPHSUM _DD_MAKEMASK1(20)
+#define M_MCTL_NORXPHSUM _DD_MAKEMASK1(23)
+#define M_MCTL_TXINT _DD_MAKEMASK1(24)
+#define M_MCTL_RXINT _DD_MAKEMASK1(25)
+#define M_MCTL_MACINT _DD_MAKEMASK1(26)
+#define M_MCTL_DMAINT _DD_MAKEMASK1(27)
+#define M_MCTL_FLOWINT _DD_MAKEMASK1(28)
+#define M_MCTL_4XRINGS _DD_MAKEMASK1(29)
+#define M_MCTL_MCASTEN _DD_MAKEMASK1(30)
+
+/* MCFG: Miscellaneous Configuration Register (0x6804) */
+
+#define M_MCFG_CORERESET _DD_MAKEMASK1(0)
+#define S_MCFG_PRESCALER 1
+#define M_MCFG_PRESCALER _DD_MAKEMASK(7,S_MCFG_PRESCALER)
+#define V_MCFG_PRESCALER(x) _DD_MAKEVALUE(x,S_MCFG_PRESCALER)
+#define G_MCFG_PRESCALER(x) _DD_GETVALUE(x,S_MCFG_PRESCALER,M_MCFG_PRESCALER)
+
+/* MLCTL: Miscellaneous Local Control Register (0x6808) */
+
+#define M_MLCTL_INTSTATE _DD_MAKEMASK1(0)
+#define M_MLCTL_INTCLR _DD_MAKEMASK1(1)
+#define M_MLCTL_INTSET _DD_MAKEMASK1(2)
+#define M_MLCTL_INTATTN _DD_MAKEMASK1(3)
+/* ... */
+#define M_MLCTL_EPAUTOACCESS _DD_MAKEMASK1(24)
+
+/* EPADDR: Serial EEPROM Address Register (0x6838) */
+
+#define S_EPADDR_ADDR 0
+#define M_EPADDR_ADDR (_DD_MAKEMASK(16,S_EPADDR_ADDR) & ~3)
+#define V_EPADDR_ADDR(x) _DD_MAKEVALUE(x,S_EPADDR_ADDR)
+#define G_EPADDR_ADDR(x) _DD_GETVALUE(x,S_EPADDR_ADDR,M_EPADDR_ADDR)
+
+#define S_EPADDR_HPERIOD 16
+#define M_EPADDR_HPERIOD _DD_MAKEMASK(9,S_EPADDR_HPERIOD)
+#define V_EPADDR_HPERIOD(x) _DD_MAKEVALUE(x,S_EPADDR_HPERIOD)
+#define G_EPADDR_HPERIOD(x) _DD_GETVALUE(x,S_EPADDR_HPERIOD,M_EPADDR_HPERIOD)
+
+#define M_EPADDR_START _DD_MAKEMASK1(25)
+
+#define S_EPADDR_DEVID 26
+#define M_EPADDR_DEVID _DD_MAKEMASK(3,S_EPADDR_DEVID)
+#define V_EPADDR_DEVID(x) _DD_MAKEVALUE(x,S_EPADDR_DEVID)
+#define G_EPADDR_DEVID(x) _DD_GETVALUE(x,S_EPADDR_DEVID,M_EPADDR_DEVID)
+
+#define M_EPADDR_RESET _DD_MAKEMASK1(29)
+#define M_EPADDR_COMPLETE _DD_MAKEMASK1(30)
+#define M_EPADDR_RW _DD_MAKEMASK1(31)
+
+/* EPDATA: Serial EEPROM Data Register (0x683C) */
+
+/* EPCTL: Serial EEPROM Control Register (0x6840) */
+
+#define M_EPCTL_CLOCKTS0 _DD_MAKEMASK1(0)
+#define M_EPCTL_CLOCKO _DD_MAKEMASK1(1)
+#define M_EPCTL_CLOCKI _DD_MAKEMASK1(2)
+#define M_EPCTL_DATATSO _DD_MAKEMASK1(3)
+#define M_EPCTL_DATAO _DD_MAKEMASK1(4)
+#define M_EPCTL_DATAI _DD_MAKEMASK1(5)
+
+/* MDCTL: MDI Control Register (0x6844) */
+
+#define M_MDCTL_DATA _DD_MAKEMASK1(0)
+#define M_MDCTL_ENABLE _DD_MAKEMASK1(1)
+#define M_MDCTL_SELECT _DD_MAKEMASK1(2)
+#define M_MDCTL_CLOCK _DD_MAKEMASK1(3)
+
+
+/* Ring Control Blocks (p 97) */
+
+#define RCB_HOST_ADDR_HIGH 0x0
+#define RCB_HOST_ADDR_LOW 0x4
+#define RCB_CTRL 0x8
+#define RCB_NIC_ADDR 0xC
+
+#define RCB_SIZE 0x10
+
+#define RCB_FLAG_USE_EXT_RCV_BD _DD_MAKEMASK1(0)
+#define RCB_FLAG_RING_DISABLED _DD_MAKEMASK1(1)
+
+#define S_RCB_MAXLEN 16
+#define M_RCB_MAXLEN _DD_MAKEMASK(16,S_RCB_MAXLEN)
+#define V_RCB_MAXLEN(x) _DD_MAKEVALUE(x,S_RCB_MAXLEN)
+#define G_RCB_MAXLEN(x) _DD_GETVALUE(x,S_RCB_MAXLEN,M_RCB_MAXLEN)
+
+
+/* On-chip Memory Map (Tables 70 and 71, pp 178-179) This is the map
+ for the 5700 with no external SRAM, the 5701, 5702 and 5703. The
+ 5705 does not fully implement some ranges and maps the buffer pool
+ differently. */
+
+/* Locations 0x0000 - 0x00FF are Page Zero */
+
+/* Locations 0x0100 - 0x01FF are Send Producer Ring RCBs */
+
+#define A_SND_RCBS 0x0100
+#define L_SND_RCBS (16*RCB_SIZE)
+#define A_SND_RCB(n) (A_SND_RCBS + ((n)-1)*RCB_SIZE)
+
+/* Locations 0x0200 - 0x02FF are Receive Return Ring RCBs */
+
+#define A_RTN_RCBS 0x0200
+#define L_RTN_RCBS (16*RCB_SIZE)
+#define A_RTN_RCB(n) (A_RTN_RCBS + ((n)-1)*RCB_SIZE)
+
+/* Locations 0x0300 - 0x0AFF are Statistics Block */
+
+#define A_MAC_STATS 0x0300
+#define L_MAC_STATS (0x0B00-A_MAC_STATS)
+
+/* Locations 0x0B00 - 0x0B4F are Status Block */
+
+#define A_MAC_STATUS 0x0B00
+#define L_MAC_STATUS (0x0B50-A_MAC_STATUS)
+
+/* Locations 0x0B50 - 0x0FFF are Software General Communication */
+
+#define A_PXE_MAILBOX 0x0B50
+#define T3_MAGIC_NUMBER 0x4B657654
+
+/* Locations 0x1000 - 0x1FFF are unmapped */
+
+/* Locations 0x2000 - 0x3FFF are DMA Descriptors */
+
+#define A_DMA_DESCS 0x2000
+#define L_DMA_DESCS (0x4000-A_DMA_DESCS)
+
+/* Locations 0x4000 - 0x5FFF are Send Rings 1-4 */
+
+#define A_SND_RINGS 0x4000
+#define L_SND_RINGS (0x6000-A_SND_RINGS)
+
+/* Locations 0x6000 - 0x6FFF are Standard Receive Rings */
+
+#define A_STD_RCV_RINGS 0x6000
+#define L_STD_RCV_RINGS (0x7000-A_STD_RCV_RINGS)
+
+/* Locations 0x7000 - 0x7FFF are Jumbo Receive Rings */
+
+#define A_JUMBO_RCV_RINGS 0x7000
+#define L_JUMBO_RCV_RINGS (0x8000-A_JUMBO_RCV_RINGS)
+
+/* Locations 0x08000 - 0x0FFFF are Buffer Pool 1 */
+/* Locations 0x10000 - 0x17FFF are Buffer Pool 2 */
+/* Locations 0x18000 - 0x1FFFF are Buffer Pool 3 */
+
+#define A_BUFFER_POOL 0x08000
+#define L_BUFFER_POOL (0x20000-A_BUFFER_POOL)
+
+/* Locations 0x08000 - 0x09FFF are TXMBUF (5705) */
+/* Locations 0x10000 - 0x1DFFF are RXMBUF (5705) */
+
+#define A_TXMBUF 0x080000
+#define L_TXMBUF (0x0A000-A_TXMBUF)
+#define A_RXMBUF 0x100000
+#define L_RXMBUF (0x1E000-A_RXMBUF)
+
+
+/* Indices of (8-byte) counters in the Statistics Block. */
+
+#define ifHCInOctets 32
+#define etherStatsFragments 34
+#define ifHCInUcastPkts 35
+#define ifHCInMulticastPkts 36
+#define ifHCInBroadcastPkts 37
+#define dot3StatsFCSErrors 38
+#define dot3StatsAlignmentErrors 39
+#define xonPauseFramesReceived 40
+#define xoffPauseFramesReceived 41
+#define macControlFramesReceived 42
+#define xoffSateEntered 43
+#define dot3StatsFrameTooLongs 44
+#define etherStatsJabbers 45
+#define etherStatsUndersizePkts 46
+#define inRangeLengthError 47
+#define outRangeLengthError 48
+#define etherStatsPkts64Octets 49
+#define etherStatsPkts65to127Octets 50
+#define etherStatsPkts128to255Octets 51
+#define etherStatsPkts256to511Octets 52
+#define etherStatsPkts512to1023Octets 53
+#define etherStatsPkts1024to1522Octets 54
+#define etherStatsPkts1523to2047Octets 55
+#define etherStatsPkts2048to4095Octets 56
+#define etherStatsPkts4096to8191Octets 57
+#define etherStatsPkts8192to9022Octets 58
+
+#define ifHCOutOctets 96
+#define etherStatsCollisions 98
+#define outXonSent 99
+#define outXoffSent 100
+#define flowControlDone 101
+#define dot3StatsInternalMacTransmitErrors 102
+#define dot3StatsSingleCollisionFrames 103
+#define dot3StatsMultipleCollisionFrames 104
+#define dot3StatsDeferredTransmissions 105
+#define dot3StatsExcessiveCollisions 107
+#define dot3StatsLateCollisions 108
+#define dot3Collided2Times 109
+#define dot3Collided3Times 110
+#define dot3Collided4Times 111
+#define dot3Collided5Times 112
+#define dot3Collided6Times 113
+#define dot3Collided7Times 114
+#define dot3Collided8Times 115
+#define dot3Collided9Times 116
+#define dot3Collided10Times 117
+#define dot3Collided11Times 118
+#define dot3Collided12Times 119
+#define dot3Collided13Times 120
+#define dot3Collided14Times 121
+#define dot3Collided15Times 122
+#define ifHCOutUcastPkts 123
+#define ifHCOutMulticastPkts 124
+#define ifHCOutBroadcastPkts 125
+#define dot3StatsCarrierSenseErrors 126
+#define ifOutDiscards 127
+#define ifOutErrors 128
+
+#define COSifHCInPkts1 160
+#define COSifHCInPkts2 161
+#define COSifHCInPkts3 162
+#define COSifHCInPkts4 163
+#define COSifHCInPkts5 164
+#define COSifHCInPkts6 165
+#define COSifHCInPkts7 166
+#define COSifHCInPkts8 167
+#define COSifHCInPkts9 168
+#define COSifHCInPkts10 169
+#define COSifHCInPkts11 170
+#define COSifHCInPkts12 171
+#define COSifHCInPkts13 172
+#define COSifHCInPkts14 173
+#define COSifHCInPkts15 174
+#define COSifHCInPkts16 175
+#define COSFramesDroppedDueToFilters 176
+#define nicDmaWriteQueueFull 177
+#define nicDmaWriteHighPriQueueFull 178
+#define nicNoMoreRxBDs 179
+#define ifInDiscards 180
+#define ifInErrors 181
+#define nicRecvThresholdHit 182
+
+#define COSifHCOutPkts1 192
+#define COSifHCOutPkts2 193
+#define COSifHCOutPkts3 194
+#define COSifHCOutPkts4 195
+#define COSifHCOutPkts5 196
+#define COSifHCOutPkts6 197
+#define COSifHCOutPkts7 198
+#define COSifHCOutPkts8 199
+#define COSifHCOutPkts9 200
+#define COSifHCOutPkts10 201
+#define COSifHCOutPkts11 202
+#define COSifHCOutPkts12 203
+#define COSifHCOutPkts13 204
+#define COSifHCOutPkts14 205
+#define COSifHCOutPkts15 206
+#define COSifHCOutPkts16 207
+#define nicDmaReadQueueFull 208
+#define nicDmaReadHighPriQueueFull 209
+#define nicSendDataCompQueueFull 210
+#define nicRingSetSendProdIndex 211
+#define nicRingStatusUpdate 212
+#define nicInterrupts 213
+#define nicAvoidedInterrupts 214
+#define nicSendThresholdHit 215
+
+#endif /* _BCM_5700_H_ */
diff --git a/cfe/cfe/dev/bcm5821.h b/cfe/cfe/dev/bcm5821.h
new file mode 100644
index 0000000..29ece60
--- /dev/null
+++ b/cfe/cfe/dev/bcm5821.h
@@ -0,0 +1,278 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * BCM5821 cryptoaccelerator File: bcm5821.h
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#ifndef _BCM5821_H_
+#define _BCM5821_H_
+
+/* Register and field definitions for the Broadcom BCM5821 crypto
+ accelerator. The BCM5820 implements a compatible (modulo bugs)
+ subset of the BCM5821. */
+
+#define K_PCI_VENDOR_BROADCOM 0x14e4
+#define K_PCI_ID_BCM5820 0x5820
+#define K_PCI_ID_BCM5821 0x5821
+
+#define _DD_MAKEMASK1(n) (1 << (n))
+#define _DD_MAKEMASK(v,n) ((((1)<<(v))-1) << (n))
+#define _DD_MAKEVALUE(v,n) ((v) << (n))
+#define _DD_GETVALUE(v,n,m) (((v) & (m)) >> (n))
+
+
+/* DMA Control and Status Register offsets */
+
+#define R_MCR1 0x00
+#define R_DMA_CTRL 0x04
+#define R_DMA_STAT 0x08
+#define R_DMA_ERR 0x0C
+#define R_MCR2 0x10
+
+
+/* 0x00 MCR1@: Master Command Record 1 Address */
+/* 0x10 MCR2@: Master Command Record 2 Address */
+
+
+/* 0x04 DMA Control */
+
+#define M_DMA_CTRL_WR_BURST _DD_MAKEMASK1(16) /* Not 5820 */
+
+#define K_DMA_WR_BURST_128 0
+#define K_DMA_WR_BURST_240 M_DMA_CRTL_WR_BURST
+
+#define M_DMA_CTRL_MOD_NORM _DD_MAKEMASK1(22)
+#define M_DMA_CTRL_RNG_MODE _DD_MAKEMASK1(23)
+#define M_DMA_CTRL_DMAERR_EN _DD_MAKEMASK1(25)
+#define M_DMA_CTRL_NORM_PCI _DD_MAKEMASK1(26) /* Not 5820 */
+#define M_DMA_CTRL_LE_CRYPTO _DD_MAKEMASK1(27) /* Not 5820 */
+#define M_DMA_CTRL_MCR1_INT_EN _DD_MAKEMASK1(29)
+#define M_DMA_CTRL_MCR2_INT_EN _DD_MAKEMASK1(30)
+#define M_DMA_CTRL_RESET _DD_MAKEMASK1(31)
+
+
+/* 0x08 DMA Status */
+
+#define M_DMA_STAT_MCR2_EMPTY _DD_MAKEMASK1(24) /* Not 5820 */
+#define M_DMA_STAT_MCR1_EMPTY _DD_MAKEMASK1(25) /* Not 5820 */
+#define M_DMA_STAT_MCR2_INTR _DD_MAKEMASK1(26)
+#define M_DMA_STAT_MCR2_FULL _DD_MAKEMASK1(27)
+#define M_DMA_STAT_DMAERR_INTR _DD_MAKEMASK1(28)
+#define M_DMA_STAT_MCR1_INTR _DD_MAKEMASK1(29)
+#define M_DMA_STAT_MCR1_FULL _DD_MAKEMASK1(30)
+#define M_DMA_STAT_MSTR_ACCESS _DD_MAKEMASK1(31)
+
+/* 0x0C DMA Error Address */
+
+#define M_DMA_ERR_RD_FAULT _DD_MAKEMASK1(1)
+#define M_DMA_ERR_ADDR 0xFFFFFFFC
+
+
+/* Master Command Record Header Format */
+
+#define S_MCR_NUM_PACKETS 0
+#define M_MCR_NUM_PACKETS _DD_MAKEMASK(16,S_MCR_NUM_PACKETS)
+#define V_MCR_NUM_PACKETS(x) _DD_MAKEVALUE(x,S_MCR_NUM_PACKETS)
+#define G_MCR_NUM_PACKETS(x) _DD_GETVALUE(x,S_MCR_NUM_PACKETS,M_MCR_NUM_PACKETS)
+
+/* Input flags */
+
+#define M_MCR_SUPPRESS_INTR _DD_MAKEMASK1(31)
+
+/* Output flags */
+
+#define M_MCR_DONE _DD_MAKEMASK1(16)
+#define M_MCR_ERROR _DD_MAKEMASK1(17)
+
+#define S_MCR_ERROR_CODE 24
+#define M_MCR_ERROR_CODE _DD_MAKEMASK(8,S_MCR_ERROR_CODE)
+#define V_MCR_ERROR_CODE(x) _DD_MAKEVALUE(x,S_MCR_ERROR_CODE)
+#define G_MCR_ERROR_CODE(x) _DD_GETVALUE(x,S_MCR_ERROR_CODE,M_MCR_ERROR_CODE)
+#define K_MCR_ERROR_OK 0
+#define K_MCR_ERROR_UNKNOWN_OP 1
+#define K_MCR_ERROR_DSA_SHORT 2
+#define K_MCR_ERROR_PKI_SHORT 3
+#define K_MCR_ERROR_PKO_SHORT 4 /* Not 5820 */
+#define K_MCR_ERROR_CHAIN_SHORT 5 /* Not 5820 */
+#define K_MCR_ERROR_FIFO 6 /* Not 5820 */
+
+/* In both cases, the header word is followed by an array of N PD entries:
+ commandContext[0]
+ dataBuffer[0]
+ pktLen[0]
+ outputBuffer[0]
+ ...
+ commandContext[n-1]
+ dataBuffer[n-1]
+ pktLen[n-1]
+ outputBuffer[n-1]
+*/
+
+#define MCR_WORDS(n) (1+8*(n))
+#define MCR_BYTES(n) ((1+8*(n))*4)
+
+
+/* Data Buffer Chain Entry Offsets */
+
+#define DBC_ADDR 0
+#define DBC_NEXT 4
+#define DBC_LEN 8
+
+#define CHAIN_WORDS 3
+
+#define S_DBC_DATA_LEN 0
+#define M_DBC_DATA_LEN _DD_MAKEMASK(16,S_DBC_DATA_LEN)
+#define V_DBC_DATA_LEN(x) _DD_MAKEVALUE(x,S_DBC_DATA_LEN)
+#define G_DBC_DATA_LEN(x) _DD_GETVALUE(x,S_DBC_DATA_LEN,M_DBC_DATA_LEN)
+
+/* Packet Descriptor Offsets */
+
+#define PD_CC_ADDR 0
+#define PD_INPUT_FRAG 4
+#define PD_INPUT_FRAG_ADDR (PD_INPUT_FRAG+DBC_ADDR)
+#define PD_INPUT_FRAG_NEXT (PD_INPUT_FRAG+DBC_NEXT)
+#define PD_INPUT_FRAG_LEN (PD_INPUT_FRAG+DBC_LEN)
+#define PD_PKT_LEN 16
+#define PD_OUTPUT_FRAG 20
+#define PD_OUTPUT_FRAG_ADDR (PD_OUTPUT_FRAG+DBC_ADDR)
+#define PD_OUTPUT_FRAG_NEXT (PD_OUTPUT_FRAG+DBC_NEXT)
+#define PD_OUTPUT_FRAG_LEN (PD_OUTPUT_FRAG+DBC_LEN)
+
+#define PD_SIZE 32
+
+#define S_PD_PKT_LEN 16
+#define M_PD_PKT_LEN _DD_MAKEMASK(16,S_PD_PKT_LEN)
+#define V_PD_PKT_LEN(x) _DD_MAKEVALUE(x,S_PD_PKT_LEN)
+#define G_PD_PKT_LEN(x) _DD_GETVALUE(x,S_PD_PKT_LEN,M_PD_PKT_LEN)
+
+
+/* Crypotographic Operations */
+
+/* MCR1 only (symmetric) */
+#define K_IPSEC_3DES 0x0000 /* Not 5820 */
+#define K_SSL_MAC 0x0001
+#define K_TLS_HMAC 0x0002
+#define K_SSL_3DES 0x0003
+#define K_ARC4 0x0004
+#define K_HASH 0x0005
+
+/* MCR2 only (asymmetric) */
+#define K_DH_PK_GEN 0x0001
+#define K_DH_SK_GEN 0x0002
+#define K_RSA_PK_OP 0x0003
+#define K_RSA_SK_OP 0x0004
+#define K_DSA_SIGN 0x0005
+#define K_DSA_VERIF 0x0006
+#define K_RNG_DIRECT 0x0041
+#define K_RNG_SHA1 0x0042
+#define K_MOD_ADD 0x0043
+#define K_MOD_SUB 0x0044
+#define K_MOD_MUL 0x0045
+#define K_MOD_REDUCE 0x0046
+#define K_MOD_EXP 0x0047
+#define K_MOD_INV 0x0048 /* Not 5821 */
+#define K_MOD_2EXP 0x0049 /* Not 5820 */
+
+
+/* Command Context Header */
+
+/* Word 0 */
+
+#define S_CC_OPCODE 16
+#define M_CC_OPCODE _DD_MAKEMASK(16,S_CC_OPCODE)
+#define V_CC_OPCODE(x) _DD_MAKEVALUE(x,S_CC_OPCODE)
+#define G_CC_OPCODE(x) _DD_GETVALUE(x,S_CC_OPCODE,M_CC_OPCODE)
+
+#define S_CC_LEN 0
+#define M_CC_LEN _DD_MAKEMASK(16,S_CC_LEN)
+#define V_CC_LEN(x) _DD_MAKEVALUE(x,S_CC_LEN)
+#define G_CC_LEN(x) _DD_GETVALUE(x,S_CC_LEN,M_CC_LEN)
+
+/* Word 1 */
+
+#define S_CC_FLAGS 12
+#define M_CC_FLAGS _DD_MAKEMASK(4,S_CC_FLAGS)
+#define V_CC_FLAGS(x) _DD_MAKEVALUE(x,S_CC_FLAGS)
+#define G_CC_FLAGS(x) _DD_GETVALUE(x,S_CC_OPCODE,M_CC_OPCODE)
+
+/* The remaining command context fields depend on the opcode. */
+
+/* IPSEC 3DES (K_IPSEC_3DES) */
+
+/* SSL MAC (K_SSL_MAC) */
+/* TLS HMAC (K_TLS_HMAC) */
+/* Pure MD5/SHA-1 Hash (K_HASH) */
+
+#define K_HASH_FLAGS_MD5 1
+#define K_HASH_FLAGS_SHA1 2
+
+/* SSL MAC (K_SSL_MAC) */
+
+#define SSL_MAC_CMD_WORDS 22
+
+/* TLS HMAC (K_TLS_HMAC) */
+
+#define TLS_HMAC_CMD_WORDS 16
+
+/* Pure MD5/SHA-1 Hash (K_HASH) */
+
+/* SSL/TLS DES/3DES (K_SSL_3DES) */
+
+/* ARCFOUR (K_ARC4) */
+
+#define ARC4_STATE_WORDS (1 + 256/4)
+#define ARC4_CMD_WORDS (2 + ARC4_STATE_WORDS)
+
+#define M_ARC4_FLAGS_KEY _DD_MAKEMASK1(10)
+#define M_ARC4_FLAGS_WRITEBACK _DD_MAKEMASK1(11)
+#define M_ARC4_FLAGS_NULLDATA _DD_MAKEMASK1(12)
+
+
+/* Random number generation (K_RNG_DIRECT, K_RNG_SHA1) */
+
+/* Modular arithmetic (K_MOD_ADD, K_MOD_SUB, K_MOD_MUL) */
+
+/* Modular Remainder (K_MOD_REDUCE) */
+
+/* Modular Exponentiation (K_MOD_EXP) */
+
+/* Double Modular Exponentiation (K_MOD_2EXP) */
+
+
+#endif /* _BCM_5821_H_ */
diff --git a/cfe/cfe/dev/dc21143.h b/cfe/cfe/dev/dc21143.h
new file mode 100644
index 0000000..65f3255
--- /dev/null
+++ b/cfe/cfe/dev/dc21143.h
@@ -0,0 +1,588 @@
+/*
+ * Register and bit definitions for the DEC/Intel 21143 Ethernet controller,
+ * part of the Tulip family of 10 and 10/100 controllers.
+ * Reference:
+ * 21143 PCI/CardBus 10/100 Mb/s Ethernet LAN Controller,
+ * Hardware Reference Manual, Revision 1.0.
+ * Document No. 278074-001
+ * Intel Corp., October 1998
+ * Includes extensions/alternatives for the DEC 21040, 21041 and 21140(A)
+ * Ethernet controllers.
+ */
+#ifndef _DC21143_H_
+#define _DC21143_H_
+
+#define _DD_MAKEMASK1(n) (1 << (n))
+#define _DD_MAKEMASK(v,n) ((((1)<<(v))-1) << (n))
+#define _DD_MAKEVALUE(v,n) ((v) << (n))
+#define _DD_GETVALUE(v,n,m) (((v) & (m)) >> (n))
+
+
+/* *********************************************************************
+ * PCI Configuration Register offsets (Tulip nomenclature)
+ ********************************************************************* */
+
+#define R_CFG_CFID PCI_ID_REG
+#define K_PCI_VENDOR_DEC 0x1011
+#define K_PCI_ID_DC21040 0x0002
+#define K_PCI_ID_DC21041 0x0014
+#define K_PCI_ID_DC21140 0x0009
+#define K_PCI_ID_DC21143 0x0019
+
+#define R_CFG_CFRV PCI_CLASS_REG
+
+#define R_CFG_CBIO PCI_MAPREG(0)
+#define R_CFG_CBMA PCI_MAPREG(1)
+
+#define R_CFG_CFIT PCI_BPARAM_INTERRUPT_REG
+
+/* Tulip extensions */
+#define R_CFG_CFDD 0x40
+
+#define M_CFDD_SLEEP __DD_MAKEMASK1(31)
+#define M_CFDD_SNOOZE __DD_MAKEMASK1(30)
+
+#define R_CFG_CPMS 0xE0
+
+
+/* *********************************************************************
+ * CSRs: offsets
+ ********************************************************************* */
+
+#define R_CSR_BUSMODE 0x00
+#define R_CSR_TXPOLL 0x08
+#define R_CSR_RXPOLL 0x10
+#define R_CSR_RXRING 0x18
+#define R_CSR_TXRING 0x20
+#define R_CSR_STATUS 0x28
+#define R_CSR_OPMODE 0x30
+#define R_CSR_INTMASK 0x38
+#define R_CSR_MISSEDFRAME 0x40
+#define R_CSR_ROM_MII 0x48
+#define R_CSR_BOOTROM_ADRR 0x50
+#define R_CSR_GENTIMER 0x58
+
+/* The following registers are specific to the 21040 */
+
+#define R_CSR_FDUPLEX 0x58
+
+/* The following registers are specific to the 21040/21041 and 21142/21143 */
+
+#define R_CSR_SIASTATUS 0x60
+#define R_CSR_SIAMODE0 0x68
+#define R_CSR_SIAMODE1 0x70
+#define R_CSR_SIAMODE2 0x78
+
+/* The following registers are specific to the 21140/21140A */
+
+#define R_CSR_GENPORT 0x60
+#define R_CSR_WATCHDOG_TIMER 0x78
+
+
+/* CSR0: Bus Mode register */
+
+#define M_CSR0_SWRESET _DD_MAKEMASK1(0)
+#define M_CSR0_BUSARB _DD_MAKEMASK1(1)
+
+#define S_CSR0_SKIPLEN 2
+#define M_CSR0_SKIPLEN _DD_MAKEMASK(5,S_CSR0_SKIPLEN)
+#define V_CSR0_SKIPLEN(x) _DD_MAKEVALUE(x,S_CSR0_SKIPLEN)
+#define G_CSR0_SKIPLEN(x) _DD_GETVALUE(x,S_CSR0_SKIPLEN,M_CSR0_SKIPLEN)
+
+#define M_CSR0_BIGENDIAN _DD_MAKEMASK1(7)
+
+#define S_CSR0_BURSTLEN 8
+#define M_CSR0_BURSTLEN _DD_MAKEMASK(6,S_CSR0_BURSTLEN)
+#define V_CSR0_BURSTLEN(x) _DD_MAKEVALUE(x,S_CSR0_BURSTLEN)
+#define G_CSR0_BURSTLEN(x) _DD_GETVALUE(x,S_CSR0_BURSTLEN,M_CSR0_BURSTLEN)
+
+#define S_CSR0_CACHEALIGN 14
+#define M_CSR0_CACHEALIGN _DD_MAKEMASK(2,S_CSR0_CACHEALIGN)
+#define V_CSR0_CACHEALIGN(x) _DD_MAKEVALUE(x,S_CSR0_CACHEALIGN)
+#define G_CSR0_CACHEALIGN(x) _DD_GETVALUE(x,S_CSR0_CACHEALIGN,M_CSR0_CACHEALIGN)
+
+#define S_CSR0_TXAUTOPOLL 17
+#define M_CSR0_TXAUTOPOLL _DD_MAKEMASK(3,S_CSR0_AUTOPOLL)
+#define V_CSR0_TXAUTOPOLL(x) _DD_MAKEVALUE(x,S_CSR0_TXAUTOPOLL)
+#define G_CSR0_TXAUTOPOLL(x) _DD_GETVALUE(x,S_CSR0_TXAUTOPOLL,M_CSR0_TXAUTOPOLL)
+
+#define M_CSR0_DESCBYTEORDER _DD_MAKEMASK1(20) /* not 21040 */
+#define M_CSR0_READMULTENAB _DD_MAKEMASK1(21) /* not 2104{0,1} */
+#define M_CSR0_READLINEENAB _DD_MAKEMASK1(23) /* not 2104{0,1} */
+#define M_CSR0_WRITEINVALENAB _DD_MAKEMASK1(24) /* not 2104{0,1} */
+
+#define K_CSR0_TAPDISABLED 0x00
+#define K_CSR0_TAP200US 0x01
+#define K_CSR0_TAP800US 0x02
+#define K_CSR0_TAP1600US 0x03
+
+#define K_CSR0_ALIGNNONE 0
+#define K_CSR0_ALIGN32 1
+#define K_CSR0_ALIGN64 2
+#define K_CSR0_ALIGN128 3
+
+#define K_CSR0_BURST32 32
+#define K_CSR0_BURST16 16
+#define K_CSR0_BURST8 8
+#define K_CSR0_BURST4 4
+#define K_CSR0_BURST2 2
+#define K_CSR0_BURST1 1
+
+
+#define M_CSR3_RXDSCRADDR 0xFFFFFFFC
+#define M_CSR4_TXDSCRADDR 0xFFFFFFFC
+
+
+/* CSR5: Status register */
+
+#define M_CSR5_TXINT _DD_MAKEMASK1(0)
+#define M_CSR5_TXSTOP _DD_MAKEMASK1(1)
+#define M_CSR5_TXBUFUNAVAIL _DD_MAKEMASK1(2)
+#define M_CSR5_TXJABTIMEOUT _DD_MAKEMASK1(3)
+#define M_CSR5_LINKPASS _DD_MAKEMASK1(4) /* not 21040 */
+#define M_CSR5_TXUNDERFLOW _DD_MAKEMASK1(5)
+#define M_CSR5_RXINT _DD_MAKEMASK1(6)
+#define M_CSR5_RXBUFUNAVAIL _DD_MAKEMASK1(7)
+#define M_CSR5_RXSTOPPED _DD_MAKEMASK1(8)
+#define M_CSR5_RXWDOGTIMEOUT _DD_MAKEMASK1(9)
+#define M_CSR5_AUITPPIN _DD_MAKEMASK1(10) /* 21040 only */
+#define M_CSR5_TXEARLYINT _DD_MAKEMASK1(10) /* not 2104{0,1} */
+#define M_CSR5_FDSHORTFRAME _DD_MAKEMASK1(11) /* 21040 only */
+#define M_CSR5_GPTIMEREXPIRE _DD_MAKEMASK1(11) /* not 21040 */
+#define M_CSR5_LINKFAIL _DD_MAKEMASK1(12)
+#define M_CSR5_FATALBUSERROR _DD_MAKEMASK1(13)
+#define M_CSR5_RXEARLYINT _DD_MAKEMASK1(14) /* not 21040 */
+#define M_CSR5_ABNORMALINT _DD_MAKEMASK1(15)
+#define M_CSR5_NORMALINT _DD_MAKEMASK1(16)
+
+#define S_CSR5_RXPROCSTATE 17
+#define M_CSR5_RXPROCSTATE _DD_MAKEMASK(3,S_CSR5_RXPROCSTATE)
+#define V_CSR5_RXPROCSTATE(x) _DD_MAKEVALUE(x,S_CSR5_RXPROCSTATE)
+#define G_CSR5_RXPROCSTATE(x) _DD_GETVALUE(x,S_CSR5_RXPROCSTATE,M_CSR5_RXPROCSTATE)
+
+#define K_CSR5_RXSTOPPED 0x00 /* RESET or STOP command */
+#define K_CSR5_RXFETCH 0x01 /* fetching rx desc */
+#define K_CSR5_RXCHECK 0x02 /* checking end of rx pkt */
+#define K_CSR5_RXWAIT 0x03 /* waiting for rx pkt */
+#define K_CSR5_RXSUSPEND 0x04 /* unavailable rx buffer */
+#define K_CSR5_RXCLOSE 0x05 /* closing rx desc */
+#define K_CSR5_RXFLUSH 0x06 /* flushing rx frame */
+#define K_CSR5_RXQUEUE 0x07 /* reading rx frame from FIFO */
+
+#define S_CSR5_TXPROCSTATE 20
+#define M_CSR5_TXPROCSTATE _DD_MAKEMASK(3,S_CSR5_TXPROCSTATE)
+#define V_CSR5_TXPROCSTATE(x) _DD_MAKEVALUE(x,S_CSR5_TXPROCSTATE)
+#define G_CSR5_TXPROCSTATE(x) _DD_GETVALUE(x,S_CSR5_TXPROCSTATE,M_CSR5_TXPROCSTATE)
+
+#define K_CSR5_TXSTOPPED 0x00 /* RESET or STOP command */
+#define K_CSR5_TXFETCH 0x01 /* fetching tx desc */
+#define K_CSR5_TXWAIT 0x02 /* waiting for end of tx */
+#define K_CSR5_TXREAD 0x03 /* reading buffer into FIFO */
+#define K_CSR5_TXSETUP 0x05 /* setup packet */
+#define K_CSR5_TXSUSPEND 0x06 /* tx underflow or no tx desc */
+#define K_CSR5_TXCLOSE 0x07 /* closing tx desc */
+
+#define S_CSR5_ERRORBITS 23
+#define M_CSR5_ERRORBITS _DD_MAKEMASK(3,S_CSR5_ERRORBITS)
+#define V_CSR5_ERRORBITS(x) _DD_MAKEVALUE(x,S_CSR5_ERRORBITS)
+#define G_CSR5_ERRORBITS(x) _DD_GETVALUE(x,S_CSR5_ERRORBITS,M_CSR5_ERRORBITS)
+
+#define K_CSR5_FBE_PARITY 0x00
+#define K_CSR5_FBE_MABORT 0x01
+#define K_CSR5_FBE_TABORT 0x02
+
+#define M_CSR5_GPPORTINT _DD_MAKEMASK1(26) /* not 2104{0,1} */
+#define M_CSR5_LINKCHANGED _DD_MAKEMASK1(27) /* not 2104{0,1} */
+
+
+/* CSR6: Operating Mode register */
+
+#define M_CSR6_RXHASHFILT _DD_MAKEMASK1(0)
+#define M_CSR6_RXSTART _DD_MAKEMASK1(1)
+#define M_CSR6_HASHONLY _DD_MAKEMASK1(2)
+#define M_CSR6_PASSBADFRAMES _DD_MAKEMASK1(3)
+#define M_CSR6_INVERSEFILT _DD_MAKEMASK1(4)
+#define M_CSR6_STOPBACKOFF _DD_MAKEMASK1(5)
+#define M_CSR6_PROMISCUOUS _DD_MAKEMASK1(6)
+#define M_CSR6_PASSALLMULTI _DD_MAKEMASK1(7)
+#define M_CSR6_FULLDUPLEX _DD_MAKEMASK1(9)
+
+#define M_CSR6_INTLOOPBACK _DD_MAKEMASK1(10)
+#define M_CSR6_EXTLOOPBACK _DD_MAKEMASK1(11)
+
+#define S_CSR6_OPMODE 10
+#define M_CSR6_OPMODE _DD_MAKEMASK(2,S_CSR6_OPMODE)
+#define V_CSR6_OPMODE(x) _DD_MAKEVALUE(x,S_CSR6_OPMODE)
+#define G_CSR6_OPMODE(x) _DD_GETVALUE(x,S_CSR6_OPMODE,M_CSR6_OPMODE)
+
+#define M_CSR6_FORCECOLL _DD_MAKEMASK1(12)
+#define M_CSR6_TXSTART _DD_MAKEMASK1(13)
+
+#define S_CSR6_THRESHCONTROL 14
+#define M_CSR6_THRESHCONTROL _DD_MAKEMASK(2,S_CSR6_THRESHCONTROL)
+#define V_CSR6_THRESHCONTROL(x) _DD_MAKEVALUE(x,S_CSR6_THRESHCONTROL)
+#define G_CSR6_THRESHCONTROL(x) _DD_GETVALUE(x,S_CSR6_THRESHCONTROL,M_CSR6_THRESHCONTROL)
+
+#define M_CSR6_BACKPRESSURE _DD_MAKEMASK1(16) /* 21040 only */
+#define M_CSR6_CAPTUREEFFECT _DD_MAKEMASK1(17)
+
+#define M_CSR6_PORTSEL _DD_MAKEMASK1(18) /* not 2104{0,1} */
+#define M_CSR6_HBDISABLE _DD_MAKEMASK1(19) /* not 2104{0,1} */
+#define M_CSR6_STOREFWD _DD_MAKEMASK1(21) /* not 2104{0,1} */
+#define M_CSR6_TXTHRESH _DD_MAKEMASK1(22) /* not 2104{0,1} */
+#define M_CSR6_PCSFUNC _DD_MAKEMASK1(23) /* not 2104{0,1} */
+#define M_CSR6_SCRAMMODE _DD_MAKEMASK1(24) /* not 2104{0,1} */
+#define M_CSR6_MBO _DD_MAKEMASK1(25) /* not 2104{0,1} */
+#define M_CSR6_RXALL _DD_MAKEMASK1(30) /* not 2104{0,1} */
+
+#define M_CSR6_SPECCAP _DD_MAKEMASK1(31) /* not 21040 */
+
+#define K_CSR6_TXTHRES_128_72 0x00
+#define K_CSR6_TXTHRES_256_96 0x01
+#define K_CSR6_TXTHRES_512_128 0x02
+#define K_CSR6_TXTHRES_1024_160 0x03
+
+
+#define M_CSR6_SPEED_10 (M_CSR6_TXTHRESH)
+
+#define M_CSR6_SPEED_100 (M_CSR6_HBDISABLE | \
+ M_CSR6_SCRAMMODE | \
+ M_CSR6_PCSFUNC | \
+ M_CSR6_PORTSEL)
+
+#define M_CSR6_SPEED_10_MII (M_CSR6_TXTHRESH | \
+ M_CSR6_PORTSEL)
+
+#define M_CSR6_SPEED_100_MII (M_CSR6_HBDISABLE | \
+ M_CSR6_PORTSEL)
+
+
+/* CSR7: Interrupt mask register */
+
+#define M_CSR7_TXINT _DD_MAKEMASK1(0)
+#define M_CSR7_TXSTOP _DD_MAKEMASK1(1)
+#define M_CSR7_TXBUFUNAVAIL _DD_MAKEMASK1(2)
+#define M_CSR7_TXJABTIMEOUT _DD_MAKEMASK1(3)
+#define M_CSR7_LINKPASS _DD_MAKEMASK1(4) /* not 21040 */
+#define M_CSR7_TXUNDERFLOW _DD_MAKEMASK1(5)
+#define M_CSR7_RXINT _DD_MAKEMASK1(6)
+#define M_CSR7_RXBUFUNAVAIL _DD_MAKEMASK1(7)
+#define M_CSR7_RXSTOPPED _DD_MAKEMASK1(8)
+#define M_CSR7_RXWDOGTIMEOUT _DD_MAKEMASK1(9)
+#define M_CSR7_AUITPSW _DD_MAKEMASK1(10) /* 21040 only */
+#define M_CSR7_TXEARLY _DD_MAKEMASK1(10) /* not 2104{0,1} */
+#define M_CSR7_FD _DD_MAKEMASK1(11) /* 21040 only */
+#define M_CSR7_GPTIMER _DD_MAKEMASK1(11) /* not 21040 */
+#define M_CSR7_LINKFAIL _DD_MAKEMASK1(12)
+#define M_CSR7_FATALBUSERROR _DD_MAKEMASK1(13)
+#define M_CSR7_RXEARLY _DD_MAKEMASK1(14) /* not 21040 */
+#define M_CSR7_ABNORMALINT _DD_MAKEMASK1(15)
+#define M_CSR7_NORMALINT _DD_MAKEMASK1(16)
+#define M_CSR7_GPPORT _DD_MAKEMASK1(26) /* not 2104{0,1} */
+#define M_CSR7_LINKCHANGED _DD_MAKEMASK1(27) /* not 2104{0,1} */
+
+
+/* CSR8: Missed Frame register */
+
+#define M_CSR8_RXOVER_WRAP _DD_MAKEMASK1(28) /* not 2104{0,1} */
+#define S_CSR8_RXOVER 17
+#define M_CSR8_RXOVER _DD_MAKEMASK(11,S_CSR8_RXOVER) /* not 2104{0,1} */
+#define V_CSR8_RXOVER(x) _DD_MAKEVALUE(x,S_CSR8_RXOVER)
+#define G_CSR8_RXOVER(x) _DD_GETVALUE(x,S_CSR8_RXOVER,M_CSR8_RXOVER)
+
+#define M_CSR8_MISSEDWRAP _DD_MAKEMASK1(16)
+#define S_CSR8_MISSED 0
+#define M_CSR8_MISSED _DD_MAKEMASK(16,S_CSR8_MISSED)
+#define V_CSR8_MISSED(x) _DD_MAKEVALUE(x,S_CSR8_MISSED)
+#define G_CSR8_MISSED(x) _DD_GETVALUE(x,S_CSR8_MISSED,M_CSR8_MISSED)
+
+
+/* CSR9: ROM and MII register */
+
+#define S_CSR9_ROMDATA 0
+#define M_CSR9_ROMDATA _DD_MAKEMASK(8,S_CSR9_ROMDATA)
+#define V_CSR9_ROMDATA(x) _DD_MAKEVALUE(x,S_CSR9_ROMDATA)
+#define G_CSR9_ROMDATA(x) _DD_GETVALUE(x,S_CSR9_ROMDATA,M_CSR9_ROMDATA)
+
+#define M_CSR9_SROMCHIPSEL _DD_MAKEMASK1(0) /* not 21040 */
+#define M_CSR9_SROMCLOCK _DD_MAKEMASK1(1) /* not 21040 */
+#define M_CSR9_SROMDATAIN _DD_MAKEMASK1(2) /* not 21040 */
+#define M_CSR9_SROMDATAOUT _DD_MAKEMASK1(3) /* not 21040 */
+
+#define M_CSR9_REGSELECT _DD_MAKEMASK1(10) /* not 21040 */
+#define M_CSR9_SERROMSEL _DD_MAKEMASK1(11) /* not 21040 */
+#define M_CSR9_ROMSEL _DD_MAKEMASK1(12) /* not 21040 */
+#define M_CSR9_ROMWRITE _DD_MAKEMASK1(13) /* not 21040 */
+#define M_CSR9_ROMREAD _DD_MAKEMASK1(14) /* not 21040 */
+#define M_CSR9_MODESEL _DD_MAKEMASK1(15) /* 21041 only */
+#define M_CSR9_MDC _DD_MAKEMASK1(16) /* not 2104{0,1} */
+#define M_CSR9_MDO _DD_MAKEMASK1(17) /* not 2104{0,1} */
+#define M_CSR9_MIIMODE _DD_MAKEMASK1(18) /* not 2104{0,1} */
+#define M_CSR9_MDI _DD_MAKEMASK1(19) /* not 2104{0,1} */
+
+#define M_CSR9_DATANOTVALID _DD_MAKEMASK1(31) /* 21040 only */
+
+#define M_CSR10_BOOTROMADDR _DD_MAKEMASK(18,0) /* not 21040 */
+
+
+/* CSR11 General Purpose Timer register */
+
+#define S_CSR11_GPTIMER 0 /* not 21040 */
+#define M_CSR11_GPTIMER _DD_MAKEMASK(16,S_CSR11_GPTIMER)
+#define V_CSR11_GPTIMER(x) _DD_MAKEVALUE(x,S_CSR11_GPTIMER)
+#define G_CSR11_GPTIMER(x) _DD_GETVALUE(x,S_CSR11_GPTIMER,M_CSR11_GPTIMER)
+
+
+#define M_CSR11_GPTIMERCONT _DD_MAKEMASK1(16) /* not 21040 */
+
+#define S_CSR11_FDAUTOCONF 0 /* 21040 only */
+#define M_CSR11_FDAUTOCONF _DD_MAKEMASK(16,S_CSR11_FDAUTOCONF)
+#define V_CSR11_FDAUTOCONF(x) _DD_MAKEVALUE(x,S_CSR11_FDAUTOCONF)
+#define G_CSR11_FRAUTOCONF(x) _DD_GETVALUE(x,S_CSR11_FDAUTOCONF,M_CSR11_AUTOCONF)
+
+
+/* CSR12: SIA Status register (21143) */
+
+#define M_CSR12_MIIRPA _DD_MAKEMASK1(0)
+#define M_CSR12_100MBLINK _DD_MAKEMASK1(1)
+#define M_CSR12_10MBLINK _DD_MAKEMASK1(2)
+#define M_CSR12_AUTOPOLSTATE _DD_MAKEMASK1(3)
+
+#define M_CSR12_RXAUIACT _DD_MAKEMASK1(8)
+#define M_CSR12_RX10BASETACT _DD_MAKEMASK1(9)
+#define M_CSR12_NLPDETECT _DD_MAKEMASK1(10)
+#define M_CSR12_TXREMFAULT _DD_MAKEMASK1(11)
+
+#define S_CSR12_AUTONEGARBIT 12
+#define M_CSR12_AUTONEGARBIT _DD_MAKEMASK(3,S_CSR12_AUTONEGARBIT)
+#define V_CSR12_AUTONEGARBIT(x) _DD_MAKEVALUE(x,S_CSR12_AUTONEGARBIT)
+#define G_CSR12_AUTONEGARBIT(x) _DD_GETVALUE(x,S_CSR12_AUTONEGARBIT,M_CSR12_AUTONEGARBIT)
+
+#define M_CSR12_LINKPARTNEG _DD_MAKEMASK1(15)
+
+#define S_CSR12_LINKPARTCODE 16
+#define M_CSR12_LINKPARTCODE _DD_MAKEMASK(16,S_CSR12_LINKPARTCODE)
+#define V_CSR12_LINKPARTCODE(x) _DD_MAKEVALUE(x,S_CSR12_LINKPARTCODE)
+#define G_CSR12_LINKPARTCODE(x) _DD_GETVALUE(x,S_CSR12_LINKPARTCODE,M_CSR12_LINKPARTCODE)
+
+
+/* CSR12: SIA Status register (21041, also 31:12, 3:3 as for 21143) */
+
+#define M_CSR12_NETCONNERR _DD_MAKEMASK1(1)
+#define M_CSR12_LINKFAIL _DD_MAKEMASK1(2)
+#define M_CSR12_SELPORTACT _DD_MAKEMASK1(8)
+#define M_CSR12_NONSELPORTACT _DD_MAKEMASK1(9)
+#define M_CSR12_AUTONEGRESTART _DD_MAKEMASK1(10)
+#define M_CSR12_UNSTABLENLP _DD_MAKEMASK1(11)
+
+
+/* CSR12: General Purpose Port register (21140) */
+
+#define S_CSR12_DATA 0
+#define M_CSR12_DATA _DD_MAKEMASK(8,S_CSR12_DATA)
+#define V_CSR12_DATA _DD_MAKEVALUE(x,S_CSR12_DATA,M_CSR12_DATA)
+#define G_CSR12_DATA(x) _DD_GETVALUE(x,S_CSR12_DATA,M_CSR12_DATA)
+
+#define M_CSR12_CONTROL _DD_MAKEMASK1(8)
+
+
+/* CSR13: SIA Mode 0 register (21143 and 21041) */
+
+#define M_CSR13_CONN_NOT_RESET _DD_MAKEMASK1(0)
+#define M_CSR13_CONN_CSR_AUTO _DD_MAKEMAKS1(2) /* 21041 only */
+#define M_CSR13_CONN_AUI_10BT _DD_MAKEMASK1(3)
+
+
+/* CSR14: SIA Mode 1 register (21143 and 21041) */
+
+#define M_CSR14_ENCODER _DD_MAKEMASK1(0)
+#define M_CSR14_LOOPBACK _DD_MAKEMASK1(1)
+#define M_CSR14_DRIVER _DD_MAKEMASK1(2)
+#define M_CSR14_LINKPULSE _DD_MAKEMASK1(3)
+
+#define S_CSR14_COMPENSATE 4
+#define M_CSR14_COMPENSATE _DD_MAKEMASK(2,S_CSR14_COMPENSATE)
+#define V_CSR15_COMPENSATE(x) _DD_MAKEVALUE(x,S_CSR15_COMPENSATE)
+#define G_CSR15_COMPENSATE(x) _DD_GETVALUE(x,S_CSR15_COMPENSATE,M_CSR15_COMPENSATE)
+
+#define M_CSR14_HALFDUPLEX10BASET _DD_MAKEMASK1(6)
+#define M_CSR14_AUTONEGOTIATE _DD_MAKEMASK1(7)
+#define M_CSR14_RXSQUELCH _DD_MAKEMASK1(8)
+#define M_CSR14_COLLSQUELCH _DD_MAKEMASK1(9)
+#define M_CSR14_COLLDETECT _DD_MAKEMASK1(10)
+#define M_CSR14_SIGQUALGEN _DD_MAKEMASK1(11)
+#define M_CSR14_LINKTEST _DD_MAKEMASK1(12)
+#define M_CSR14_AUTOPOLARITY _DD_MAKEMASK1(13)
+#define M_CSR14_SETPOLARITY _DD_MAKEMASK1(14)
+#define M_CSR14_10BASETAUIAUTO _DD_MAKEMASK1(15)
+#define M_CSR14_100BASETHALFDUP _DD_MAKEMASK1(16) /* not 21041 */
+#define M_CSR14_100BASETFULLDUP _DD_MAKEMASK1(17) /* not 21041 */
+#define M_CSR14_100BASET4 _DD_MAKEMASK1(18) /* not 21041 */
+
+#define M_CSR14_10BT_HD 0x7F3F
+#define M_CSR14_10BT_FD 0x7F3D
+
+
+/* CSR15: SIA Mode 2 register (21143 and 21041) */
+
+#define M_CSR15_GP_JABBERDIS _DD_MAKEMASK1(0) /* 21041 only */
+#define M_CSR15_GP_HOSTUNJAB _DD_MAKEMASK1(1)
+#define M_CSR15_GP_JABBERCLK _DD_MAKEMASK1(2)
+#define M_CSR15_GP_AUIBNC _DD_MAKEMASK1(3)
+#define M_CSR15_GP_RXWATCHDIS _DD_MAKEMASK1(4)
+#define M_CSR15_GP_RXWATCHREL _DD_MAKEMASK1(5)
+
+/* (CSR15: 21143 only) */
+
+#define S_CSR15_GP_GPDATA 16
+#define M_CSR15_GP_GPDATA _DD_MAKEMASK(4,S_CSR15_GP_GPDATA)
+#define V_CSR15_GP_GPDATA(x) _DD_MAKEVALUE(x,S_CSR15_GP_GPDATA)
+#define G_CSR15_GP_GPDATA(x) _DD_GETVALUE(x,S_CSR15_GP_GPDATA,M_CSR15_GP_GPDATA)
+
+#define M_CSR15_GP_LED0 _DD_MAKEMASK1(20)
+#define M_CSR15_GP_LED1 _DD_MAKEMASK1(21)
+#define M_CSR15_GP_LED2 _DD_MAKEMASK1(22)
+#define M_CSR15_GP_LED3 _DD_MAKEMASK1(23)
+#define M_CSR15_GP_INTPORT0 _DD_MAKEMASK1(24)
+#define M_CSR15_GP_INTPORT1 _DD_MAKEMASK1(25)
+#define M_CSR15_GP_RXMATCH _DD_MAKEMASK1(26)
+#define M_CSR15_GP_CONTROLWRITE _DD_MAKEMASK1(27)
+#define M_CSR15_GP_GPINT0 _DD_MAKEMASK1(28)
+#define M_CSR15_GP_GPINT1 _DD_MAKEMASK1(29)
+#define M_CSR15_GP_RXMATCHINT _DD_MAKEMASK1(30)
+
+#define M_CSR15_DEFAULT_VALUE 0x00050008
+#define M_CSR15_CONFIG_GEPS_LEDS 0x08af0000
+
+/* (CSR15: 21041 only) */
+
+#define M_CSR15_GP_LED1ENB _DD_MAKEMASK1(6)
+#define M_CSR15_GP_LED1VALUE _DD_MAKEMASK1(7)
+#define M_CSR15_GP_TSTCLK _DD_MAKEMASK1(8)
+#define M_CSR15_GP_FORCEUNSQ _DD_MAKEMASK1(9)
+#define M_CSR15_GP_FORCEFAIL _DD_MAKEMASK1(10)
+#define M_CSR15_GP_LEDSTRDIS _DD_MAKEMASK1(11)
+#define M_CSR15_GP_PLLTEST _DD_MAKEMASK1(12)
+#define M_CSR15_GP_FORCERXLOW _DD_MAKEMASK1(13)
+#define M_CSR15_GP_LED2ENB _DD_MAKEMASK1(14)
+#define M_CSR15_GP_LED2VALUE _DD_MAKEMASK1(15)
+
+
+/* CSR15: Watchdog Timer register (21140) */
+
+#define M_CSR15_WT_JABBER _DD_MAKEMASK1(0)
+#define M_CSR15_WT_HOSTUNJAB _DD_MAKEMASK1(1)
+#define M_CSR15_WT_JABBERCLK _DD_MAKEMASK1(2)
+#define M_CSR15_WT_RXWATCHDIS _DD_MAKEMASK1(4)
+#define M_CSR15_WT_RXWATCHREL _DD_MAKEMASK1(5)
+
+
+/* *********************************************************************
+ * Receive Descriptors
+ ********************************************************************* */
+
+#define M_RDES0_OWNSYS 0
+#define M_RDES0_OWNADAP _DD_MAKEMASK1(31)
+
+#define S_RDES0_FRAMELEN 16
+#define M_RDES0_FRAMELEN _DD_MAKEMASK(14,S_RDES0_FRAMELEN)
+#define V_RDES0_FRAMELEN(x) _DD_MAKEVALUE(x,S_RDES0_FRAMELEN)
+#define G_RDES0_FRAMELEN(x) _DD_GETVALUE(x,S_RDES0_FRAMELEN,M_RDES0_FRAMELEN)
+
+#define M_RDES0_ZERO _DD_MAKEMASK1(0)
+#define M_RDES0_OVFL _DD_MAKEMAKS1(0) /* 21041 only */
+#define M_RDES0_CRCERR _DD_MAKEMASK1(1)
+#define M_RDES0_DRIBBLE _DD_MAKEMASK1(2)
+#define M_RDES0_MIIERROR _DD_MAKEMASK1(3) /* not 21041 */
+#define M_RDES0_WDOGTIMER _DD_MAKEMASK1(4)
+#define M_RDES0_FRAMETYPE _DD_MAKEMASK1(5)
+#define M_RDES0_COLLSEEN _DD_MAKEMASK1(6)
+#define M_RDES0_FRAMETOOLONG _DD_MAKEMASK1(7)
+#define M_RDES0_LASTDES _DD_MAKEMASK1(8)
+#define M_RDES0_FIRSTDES _DD_MAKEMASK1(9)
+#define M_RDES0_MCASTFRAME _DD_MAKEMASK1(10)
+#define M_RDES0_RUNTFRAME _DD_MAKEMASK1(11)
+
+#define S_RDES0_DATATYPE 12
+#define M_RDES0_DATATYPE _DD_MAKEMASK(2,S_RDES0_DATATYPE)
+#define V_RDES0_DATATYPE(x) _DD_MAKEVALUE(x,S_RDES0_DATATYPE)
+#define G_RDES0_DATATYPE(x) _DD_GETVALUE(x,S_RDES0_DATATYPE,M_RDES0_DATATYPE)
+
+#define M_RDES0_ERROR _DD_MAKEMASK1(14)
+#define M_RDES0_ERRORSUM _DD_MAKEMASK1(15)
+#define M_RDES0_FILTFAIL _DD_MAKEMASK1(30) /* not 21041 */
+
+#define S_RDES1_BUF1SIZE 0
+#define M_RDES1_BUF1SIZE _DD_MAKEMASK(11,S_TDES1_BUF1SIZE)
+#define V_RDES1_BUF1SIZE(x) _DD_MAKEVALUE(x,S_RDES1_BUF1SIZE)
+#define G_RDES1_BUF1SIZE(x) _DD_GETVALUE(x,S_RDES1_BUF1SIZE,M_RDES1_BUF1SIZE)
+
+#define S_RDES1_BUF2SIZE 11
+#define M_RDES1_BUF2SIZE _DD_MAKEMASK(11,S_TDES2_BUF2SIZE)
+#define V_RDES1_BUF2SIZE(x) _DD_MAKEVALUE(x,S_RDES1_BUF2SIZE)
+#define G_RDES1_BUF2SIZE(x) _DD_GETVALUE(x,S_RDES1_BUF2SIZE,M_RDES1_BUF2SIZE)
+
+#define M_RDES1_CHAINED _DD_MAKEMASK1(24)
+#define M_RDES1_ENDOFRING _DD_MAKEMASK1(25)
+
+#define M_RDES2_BUFADDR 0xFFFFFFFF
+#define M_RDES3_BUFADDR 0xFFFFFFFF
+
+/* *********************************************************************
+ * Transmit Descriptors
+ ********************************************************************* */
+
+#define M_TDES0_OWNSYS 0
+#define M_TDES0_OWNADAP _DD_MAKEMASK1(31)
+
+#define M_TDES0_DEFERRED _DD_MAKEMASK1(0)
+#define M_TDES0_UNDERFLOW _DD_MAKEMASK1(1)
+#define M_TDES0_LINK_FAIL _DD_MAKEMASK1(2)
+
+#define S_TDES0_COLLCOUNT 3
+#define M_TDES0_COLLCOUNT _DD_MAKEMASK(4,S_TDES0_COLLCOUNT)
+#define V_TDES0_COLLCOUNT(x) _DD_MAKEVALUE(x,S_TDES0_COLLCOUNT)
+#define G_TDES0_COLLCOUNT(x) _DD_GETVALUE(x,S_TDES0_COLLCOUNT,M_TDES0_COLLCOUNT)
+
+#define M_TDES0_HEARTBEAT_FAIL _DD_MAKEMASK1(7)
+#define M_TDES0_EXCESSIVE_COLLISIONS _DD_MAKEMASK1(8)
+#define M_TDES0_LATE_COLLISION _DD_MAKEMASK1(9)
+#define M_TDES0_NO_CARRIER _DD_MAKEMASK1(10)
+#define M_TDES0_LOSS_OF_CARRIER _DD_MAKEMASK1(11)
+#define M_TDES0_TX_JABBER_TIMEOUT _DD_MAKEMASK1(14)
+#define M_TDES0_ERROR_SUMMARY _DD_MAKEMASK1(15)
+#define M_TDES0_OWN_BIT _DD_MAKEMASK1(31)
+
+#define S_TDES1_BUF1SIZE 0
+#define M_TDES1_BUF1SIZE _DD_MAKEMASK(11,S_TDES1_BUF1SIZE)
+#define V_TDES1_BUF1SIZE(x) _DD_MAKEVALUE(x,S_TDES1_BUF1SIZE)
+#define G_TDES1_BUF1SIZE(x) _DD_GETVALUE(x,S_TDES1_BUF1SIZE,M_TDES1_BUF1SIZE)
+
+#define S_TDES1_BUF2SIZE 11
+#define M_TDES1_BUF2SIZE _DD_MAKEMASK(11,S_TDES2_BUF2SIZE)
+#define V_TDES1_BUF2SIZE(x) _DD_MAKEVALUE(x,S_TDES1_BUF2SIZE)
+#define G_TDES1_BUF2SIZE(x) _DD_GETVALUE(x,S_TDES1_BUF2SIZE,M_TDES1_BUF2SIZE)
+
+#define M_TDES1_FT0 _DD_MAKEMASK1(22)
+#define M_TDES1_NOPADDING _DD_MAKEMASK1(23)
+#define M_TDES1_CHAINED _DD_MAKEMASK1(24)
+#define M_TDES1_ENDOFRING _DD_MAKEMASK1(25)
+#define M_TDES1_NOADDCRC _DD_MAKEMASK1(26)
+#define M_TDES1_SETUP _DD_MAKEMASK1(27)
+#define M_TDES1_FT1 _DD_MAKEMASK1(28)
+#define M_TDES1_FIRSTSEG _DD_MAKEMASK1(29)
+#define M_TDES1_LASTSEG _DD_MAKEMASK1(30)
+#define M_TDES1_INTERRUPT _DD_MAKEMASK1(31)
+
+#define M_TDES2_BUFADDR 0xFFFFFFFF
+#define M_TDES3_BUFADDR 0xFFFFFFFF
+
+
+/* CAM */
+
+#define CAM_HASH_THRESHOLD 14
+#define CAM_PERFECT_ENTRIES 16
+
+#define CAM_SETUP_BUFFER_SIZE 192
+
+#endif /* _DC21143_H_ */
diff --git a/cfe/cfe/dev/dev_atapi.c b/cfe/cfe/dev/dev_atapi.c
new file mode 100644
index 0000000..b5f4d9a
--- /dev/null
+++ b/cfe/cfe/dev/dev_atapi.c
@@ -0,0 +1,222 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * ATAPI device driver File: dev_atapi.c
+ *
+ * This is a simple driver for ATAPI devices. The disks
+ * are expected to be connected to the generic bus (this
+ * driver doesn't support PCI).
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "sbmips.h"
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "cfe_timer.h"
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_ioctl.h"
+
+#include "dev_ide_common.h"
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#define GETWORD_LE(buf,wordidx) (((unsigned int) (buf)[(wordidx)*2]) + \
+ (((unsigned int) (buf)[(wordidx)*2+1]) << 8))
+
+
+/* *********************************************************************
+ * Forward declarations
+ ********************************************************************* */
+
+extern void _wbflush(void);
+static void atapidrv_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+
+const static cfe_devdisp_t atapidrv_dispatch = {
+ idecommon_open,
+ idecommon_read,
+ idecommon_inpstat,
+ idecommon_write,
+ idecommon_ioctl,
+ idecommon_close,
+ NULL,
+ NULL
+};
+
+const cfe_driver_t atapidrv = {
+ "ATAPI device",
+ "atapi",
+ CFE_DEV_DISK,
+ &atapidrv_dispatch,
+ atapidrv_probe
+};
+
+
+
+/* *********************************************************************
+ * Port I/O routines
+ *
+ * These routines are called back from the common code to do
+ * I/O cycles to the IDE disk. We provide routines for
+ * reading and writing bytes, words, and strings of words.
+ ********************************************************************* */
+
+static uint8_t atapidrv_inb(idecommon_dispatch_t *disp,uint32_t reg)
+{
+ return *((volatile uint8_t *) PHYS_TO_K1(reg+disp->baseaddr));
+}
+
+static uint16_t atapidrv_inw(idecommon_dispatch_t *disp,uint32_t reg)
+{
+ return *((volatile uint16_t *) PHYS_TO_K1((reg+disp->baseaddr)));
+}
+
+static void atapidrv_ins(idecommon_dispatch_t *disp,uint32_t reg,uint8_t *buf,int len)
+{
+ uint16_t data;
+
+ while (len > 0) {
+ data = *((volatile uint16_t *) PHYS_TO_K1(reg+disp->baseaddr));
+
+#ifdef _BYTESWAP_
+ *buf++ = (data >> 8) & 0xFF;
+ *buf++ = (data & 0xFF);
+#else
+ *buf++ = (data & 0xFF);
+ *buf++ = (data >> 8) & 0xFF;
+#endif
+ len--;
+ len--;
+ }
+
+}
+
+static void atapidrv_outb(idecommon_dispatch_t *disp,uint32_t reg,uint8_t val)
+{
+ *((volatile uint8_t *) PHYS_TO_K1(reg+disp->baseaddr)) = val;
+ _wbflush();
+}
+
+static void atapidrv_outw(idecommon_dispatch_t *disp,uint32_t reg,uint16_t val)
+{
+ *((volatile uint16_t *) PHYS_TO_K1(reg+disp->baseaddr)) = val;
+ _wbflush();
+}
+
+static void atapidrv_outs(idecommon_dispatch_t *disp,uint32_t reg,uint8_t *buf,int len)
+{
+ uint16_t data;
+
+ while (len > 0) {
+#ifdef _BYTESWAP_
+ data = (uint16_t) buf[1] + ((uint16_t) buf[0] << 8);
+#else
+ data = (uint16_t) buf[0] + ((uint16_t) buf[1] << 8);
+#endif
+
+ *((volatile uint16_t *) PHYS_TO_K1(reg+disp->baseaddr)) = data;
+ _wbflush();
+
+ buf++;
+ buf++;
+ len--;
+ len--;
+ }
+}
+
+
+
+static void atapidrv_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr)
+{
+ idecommon_t *softc;
+ idecommon_dispatch_t *disp;
+ char descr[80];
+ char unitstr[50];
+ int res;
+
+ /*
+ * probe_a is the IDE base address
+ * probe_b is the unit number and other flags
+ * probe_ptr is unused.
+ */
+
+ softc = (idecommon_t *) KMALLOC(sizeof(idecommon_t),0);
+ disp = (idecommon_dispatch_t *) KMALLOC(sizeof(idecommon_dispatch_t),0);
+
+ if (softc && disp) {
+ softc->idecommon_addr = probe_a;
+ softc->idecommon_unit = probe_b;
+
+ disp->ref = softc;
+ disp->baseaddr = softc->idecommon_addr;
+ softc->idecommon_dispatch = disp;
+
+ disp->outb = atapidrv_outb;
+ disp->outw = atapidrv_outw;
+ disp->outs = atapidrv_outs;
+
+ disp->inb = atapidrv_inb;
+ disp->inw = atapidrv_inw;
+ disp->ins = atapidrv_ins;
+
+ res = idecommon_devprobe(softc);
+ if (res < 0) {
+ KFREE(softc);
+ KFREE(disp);
+ return;
+ }
+
+ xsprintf(descr,"%s unit %d at %08X",drv->drv_description,probe_b,probe_a);
+ xsprintf(unitstr,"%d",probe_b);
+ cfe_attach(drv,softc,unitstr,descr);
+ }
+}
+
+
diff --git a/cfe/cfe/dev/dev_bcm1250.c b/cfe/cfe/dev/dev_bcm1250.c
new file mode 100644
index 0000000..8343a46
--- /dev/null
+++ b/cfe/cfe/dev/dev_bcm1250.c
@@ -0,0 +1,275 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * BCM1250 (BCM1250 as PCI device) driver File: dev_bcm1250.c
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "sbmips.h"
+
+#ifndef _SB_MAKE64
+#define _SB_MAKE64(x) ((uint64_t)(x))
+#endif
+#ifndef _SB_MAKEMASK1
+#define _SB_MAKEMASK1(n) (_SB_MAKE64(1) << _SB_MAKE64(n))
+#endif
+
+#include "lib_types.h"
+#include "lib_hssubr.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_error.h"
+#include "cfe_device.h"
+
+#include "pcivar.h"
+#include "pcireg.h"
+
+#include "bsp_config.h"
+
+/* Note that PHYSADDR only works with 32-bit addresses */
+#define PHYSADDR(x) (K0_TO_PHYS((uint32_t)(uintptr_t)(x)))
+
+
+static void bcm1250_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+static int bcm1250_open(cfe_devctx_t *ctx);
+static int bcm1250_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int bcm1250_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat);
+static int bcm1250_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int bcm1250_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int bcm1250_close(cfe_devctx_t *ctx);
+
+const static cfe_devdisp_t bcm1250_dispatch = {
+ bcm1250_open,
+ bcm1250_read,
+ bcm1250_inpstat,
+ bcm1250_write,
+ bcm1250_ioctl,
+ bcm1250_close,
+ NULL,
+ NULL
+};
+
+const cfe_driver_t bcm1250drv = {
+ "BCM1250",
+ "widget",
+ CFE_DEV_OTHER,
+ &bcm1250_dispatch,
+ bcm1250_probe
+};
+
+
+typedef struct bcm1250_s {
+ uint64_t mailbox;
+ uint64_t mem_base;
+ uint8_t irq; /* interrupt mapping */
+ pcitag_t tag; /* tag for configuration register */
+
+ int downloaded; /* code has already been downloaded. */
+} bcm1250_t;
+
+
+/*
+ * BCM1250_PROBE
+ * probe_a, probe_b and probe_ptr all unused
+ */
+
+static void
+bcm1250_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr)
+{
+ int index;
+
+ index = 0;
+ for (;;) {
+ pcitag_t tag;
+
+ if (pci_find_device(0x166d, 0x0001, index, &tag) != 0)
+ break;
+
+ if (tag != 0x00000000) { /* don't configure ourselves */
+ bcm1250_t *softc;
+ char descr[80];
+ phys_addr_t pa;
+
+ softc = (bcm1250_t *) KMALLOC(sizeof(bcm1250_t), 0);
+ if (softc == NULL) {
+ xprintf("BCM1250: No memory to complete probe\n");
+ break;
+ }
+
+ softc->tag = tag;
+
+ pci_map_mem(tag, PCI_MAPREG(0), PCI_MATCH_BYTES, &pa);
+ xsprintf(descr, "%s at 0x%X", drv->drv_description, (uint32_t)pa);
+ softc->mem_base = PHYS_TO_XKSEG_UNCACHED(pa);
+
+ /* Map the CPU0 mailbox registers of the device 1250.
+ Note that our BAR2 space maps to its "alias" mailbox
+ registers. Set bit 3 for mbox_set; clear bit 3 for
+ reading. Address bits 15-4 are don't cares. */
+ pci_map_mem(tag, PCI_MAPREG(2), PCI_MATCH_BYTES, &pa);
+ softc->mailbox = PHYS_TO_XKSEG_UNCACHED(pa);
+
+ softc->downloaded = 0;
+
+ cfe_attach(drv, softc, NULL, descr);
+ }
+ index++;
+ }
+}
+
+
+#include "elf.h"
+
+static int
+elf_header (const uint8_t *hdr)
+{
+ return (hdr[EI_MAG0] == ELFMAG0 &&
+ hdr[EI_MAG1] == ELFMAG1 &&
+ hdr[EI_MAG2] == ELFMAG2 &&
+ hdr[EI_MAG3] == ELFMAG3);
+}
+
+
+#include "cfe_timer.h"
+
+typedef struct {
+ uint32_t addr; /* source address, in device's PCI space */
+ uint32_t len; /* length of this chunk */
+} chunk_desc;
+
+
+#define MBOX_SET_BIT 0x8
+
+extern void download_start(void), download_end(void);
+
+static int
+bcm1250_open(cfe_devctx_t *ctx)
+{
+ bcm1250_t *softc = ctx->dev_softc;
+ uint64_t cmd_p = softc->mailbox + 4;
+
+ if (softc->downloaded) {
+ xprintf("bcm1250_open: Warning: Device previously downloaded\n");
+ softc->downloaded = 0;
+ }
+
+ if (hs_read32(cmd_p) != 0) {
+ xprintf("bcm1250_open: Device not in initial state\n");
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+bcm1250_read(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ return -1;
+}
+
+static int
+bcm1250_inpstat(cfe_devctx_t *ctx, iocb_inpstat_t *inpstat)
+{
+ return -1;
+}
+
+static int
+bcm1250_write(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ bcm1250_t *softc = ctx->dev_softc;
+ uint64_t arg_p = softc->mailbox + 0;
+ uint64_t cmd_p = softc->mailbox + 4;
+ chunk_desc code;
+ uint32_t cmd;
+ int64_t timer;
+ int res;
+
+ /* Note: This code assumes that PHYSADDR gives a PCI memory space
+ address that is accessible via our BAR4 or BAR5 */
+
+ code.addr = PHYSADDR((uint8_t *)buffer->buf_ptr);
+ code.len = buffer->buf_length;
+
+ cmd = 0x1; /* load */
+ if (!elf_header((uint8_t *)buffer->buf_ptr)) {
+ /* No recognizable elf seal, so assume compressed. */
+ cmd |= 0x2;
+ }
+
+ hs_write32(arg_p | MBOX_SET_BIT, PHYSADDR(&code));
+ hs_write32(cmd_p | MBOX_SET_BIT, cmd); /* load */
+
+ /* Wait for handshake */
+
+ res = CFE_ERR_TIMEOUT;
+ TIMER_SET(timer, 5*CFE_HZ);
+ while (!TIMER_EXPIRED(timer)) {
+ if ((hs_read32(cmd_p) & 0x3) == 0) {
+ softc->downloaded = 1;
+ buffer->buf_retlen = 0; /* XXX check this */
+ /* Note that the result code need not be translated only
+ because we are assuming a CFE in the device that is
+ compatible with us. */
+ res = (int)hs_read32(arg_p);
+ break;
+ }
+ POLL();
+ }
+
+ return res;
+}
+
+static int
+bcm1250_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ return -1;
+}
+
+static int
+bcm1250_close(cfe_devctx_t *ctx)
+{
+ return 0;
+}
diff --git a/cfe/cfe/dev/dev_bcm5700.c b/cfe/cfe/dev/dev_bcm5700.c
new file mode 100644
index 0000000..a7bef89
--- /dev/null
+++ b/cfe/cfe/dev/dev_bcm5700.c
@@ -0,0 +1,2557 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * BCM5700/Tigon3 (10/100/1000 EthernetMAC) driver File: dev_bcm5700.c
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "sbmips.h"
+
+#ifndef _SB_MAKE64
+#define _SB_MAKE64(x) ((uint64_t)(x))
+#endif
+#ifndef _SB_MAKEMASK1
+#define _SB_MAKEMASK1(n) (_SB_MAKE64(1) << _SB_MAKE64(n))
+#endif
+
+#include "lib_types.h"
+#include "lib_hssubr.h"
+#include "lib_malloc.h"
+#include "lib_string.h"
+#define blockcopy memcpy
+#include "lib_printf.h"
+#include "lib_queue.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_ioctl.h"
+#include "cfe_timer.h"
+#include "cfe_error.h"
+#include "cfe_irq.h"
+
+#include "pcivar.h"
+#include "pcireg.h"
+
+#include "bcm5700.h"
+#include "mii.h"
+
+/* This is a driver for the Broadcom 570x ("Tigon 3") 10/100/1000 MAC.
+ Currently, only the 5700, 5701 and 5705 have been tested. The 5704
+ dual MAC is not supported, nor is any device with a SerDes PHY.
+
+ Reference:
+ Host Programmer Interface Specification for the BCM570X Family
+ of Highly-Integrated Media Access Controllers, 570X-PG106-R.
+ Broadcom Corp., 16215 Alton Parkway, Irvine CA, 09/27/02
+
+ This BCM1250 version takes advantage of DMA coherence and uses
+ "preserve bit lanes" addresses for all accesses that cross the
+ ZBbus-PCI bridge.
+
+ Note that the 5705 does not fully map all address ranges. Per
+ the manual, reads and writes of the unmapped regions are permitted
+ and do not fault; however, it apparently has some poisoned registers,
+ at least in early revs, that should not be touched. See the
+ conditionals in the code. */
+
+/* PIOSWAP controls whether word-swapping takes place for transactions
+ in which the 570x is the target device. In theory, either value
+ should work (with access macros adjusted as below) and it should be
+ set to be consistent with the settings for 570x as initiator.
+ Empirically, however, some combinations work with the bit clear:
+
+ SWAP=0 SWAP=1
+ 5700 32 PCI OK OK
+ 5700 64 Sturgeon OK OK
+ 5701-32 32 PCI OK OK
+ 5701-32 64 Sturgeon OK OK
+ 5701-32 64 Golem OK OK
+ 5701-64 64 Sturgeon OK OK
+ 5701-64 64 Golem OK FAIL
+ 5705 32 PCI OK OK
+ 5705 64 Sturgeon (OK)* FAIL
+ 5705 64 Golem OK OK
+
+ * PCI status/interrupt ordering problem under load. */
+
+#define PIOSWAP 0
+
+#ifndef T3_DEBUG
+#define T3_DEBUG 0
+#endif
+
+#ifndef T3_BRINGUP
+#define T3_BRINGUP 0
+#endif
+
+/* Broadcom recommends using PHY interrupts instead of autopolling,
+ but I haven't made it work yet. */
+#define T3_AUTOPOLL 1
+
+/* Set IPOLL to drive processing through the pseudo-interrupt
+ dispatcher. Set XPOLL to drive processing by an external polling
+ agent. One must be set; setting both is ok. */
+
+#ifndef IPOLL
+#define IPOLL 0
+#endif
+#ifndef XPOLL
+#define XPOLL 1
+#endif
+
+#define ENET_ADDR_LEN 6 /* size of an ethernet address */
+#define MIN_ETHER_PACK 64 /* min size of a packet */
+#define MAX_ETHER_PACK 1518 /* max size of a packet */
+#define VLAN_TAG_LEN 4 /* VLAN type plus tag */
+#define CRC_SIZE 4 /* size of CRC field */
+
+/* Packet buffers. For the Tigon 3, packet buffer alignment is
+ arbitrary and can be to any byte boundary. We would like it
+ aligned to a cache line boundary for performance, although there is
+ a trade-off with IP/TCP header alignment. */
+
+#define ETH_PKTBUF_LEN (((MAX_ETHER_PACK+31)/32)*32)
+
+#if __long64
+typedef struct eth_pkt_s {
+ queue_t next; /* 16 */
+ uint8_t *buffer; /* 8 */
+ uint32_t flags; /* 4 */
+ int32_t length; /* 4 */
+ uint8_t data[ETH_PKTBUF_LEN];
+} eth_pkt_t;
+#else
+typedef struct eth_pkt_s {
+ queue_t next; /* 8 */
+ uint8_t *buffer; /* 4 */
+ uint32_t flags; /* 4 */
+ int32_t length; /* 4 */
+ uint32_t unused[3]; /* 12 */
+ uint8_t data[ETH_PKTBUF_LEN];
+} eth_pkt_t;
+#endif
+
+#define CACHE_ALIGN 32
+#define ETH_PKTBUF_LINES ((sizeof(eth_pkt_t) + (CACHE_ALIGN-1))/CACHE_ALIGN)
+#define ETH_PKTBUF_SIZE (ETH_PKTBUF_LINES*CACHE_ALIGN)
+#define ETH_PKTBUF_OFFSET (offsetof(eth_pkt_t, data))
+
+#define ETH_PKT_BASE(data) ((eth_pkt_t *)((data) - ETH_PKTBUF_OFFSET))
+
+static void
+show_packet(char c, eth_pkt_t *pkt)
+{
+ int i;
+ int n = (pkt->length < 32 ? pkt->length : 32);
+
+ xprintf("%c[%4d]:", c, pkt->length);
+ for (i = 0; i < n; i++) {
+ if (i % 4 == 0)
+ xprintf(" ");
+ xprintf("%02x", pkt->buffer[i]);
+ }
+ xprintf("\n");
+}
+
+
+static void t3_ether_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+
+/* BCM570X Hardware Common Data Structures
+ XXX These work for 1250 big endian. Need endian testing.
+ XXX Should they move to the header file? */
+
+/* Chip documentation numbers the rings with 1-origin. */
+
+#define RI(n) ((n)-1)
+
+/* BCM570x Ring Sizes (no external memory). Pages 97-98 */
+
+#define TXP_MAX_RINGS 16
+#define TXP_INTERNAL_RINGS 4
+#define TXP_RING_ENTRIES 512
+
+#define RXP_STD_ENTRIES 512
+
+#define RXR_MAX_RINGS 16
+#define RXR_RING_ENTRIES 1024
+
+#define RXR_MAX_RINGS_05 1
+#define RXR_RING_ENTRIES_05 512
+
+
+/* BCM570x Send Buffer Descriptors as a struct. Pages 100-101 */
+
+typedef struct t3_snd_bd_s {
+ uint32_t bufptr_hi;
+ uint32_t bufptr_lo;
+#ifdef __MIPSEB
+ uint16_t length;
+ uint16_t flags;
+ uint16_t pad;
+ uint16_t vlan_tag;
+#elif __MIPSEL
+ uint16_t flags;
+ uint16_t length;
+ uint16_t vlan_tag;
+ uint16_t pad;
+#else
+#error "bcm5700: endian not set"
+#endif
+} t3_snd_bd_t;
+
+#define SND_BD_SIZE 16
+
+#define TX_FLAG_TCP_CKSUM 0x0001
+#define TX_FLAG_IP_CKSUM 0x0002
+#define TX_FLAG_PACKET_END 0x0004
+#define TX_FLAG_IP_FRAG 0x0008
+#define TX_FLAG_IP_FRAG_END 0x0010
+#define TX_FLAG_VLAN_TAG 0x0040
+#define TX_FLAG_COAL_NOW 0x0080
+#define TX_FLAG_CPU_PRE_DMA 0x0100
+#define TX_FLAG_CPU_POST_DMA 0x0200
+#define TX_FLAG_ADD_SRC 0x1000
+#define TX_FLAG_SRC_ADDR_SEL 0x6000
+#define TX_FLAG_NO_CRC 0x8000
+
+/* BCM570x Receive Buffer Descriptors as a struct. Pages 105-107 */
+
+typedef struct t3_rcv_bd_s {
+ uint32_t bufptr_hi;
+ uint32_t bufptr_lo;
+#ifdef __MIPSEB
+ uint16_t index;
+ uint16_t length;
+ uint16_t type;
+ uint16_t flags;
+ uint16_t ip_cksum;
+ uint16_t tcp_cksum;
+ uint16_t error_flag;
+ uint16_t vlan_tag;
+#elif __MIPSEL
+ uint16_t length;
+ uint16_t index;
+ uint16_t flags;
+ uint16_t type;
+ uint16_t tcp_cksum;
+ uint16_t ip_cksum;
+ uint16_t vlan_tag;
+ uint16_t error_flag;
+#else
+#error "bcm5700: endian not set"
+#endif
+ uint32_t pad;
+ uint32_t opaque;
+} t3_rcv_bd_t;
+
+#define RCV_BD_SIZE 32
+
+#define RX_FLAG_PACKET_END 0x0004
+#define RX_FLAG_JUMBO_RING 0x0020
+#define RX_FLAG_VLAN_TAG 0x0040
+#define RX_FLAG_ERROR 0x0400
+#define RX_FLAG_MINI_RING 0x0800
+#define RX_FLAG_IP_CKSUM 0x1000
+#define RX_FLAG_TCP_CKSUM 0x2000
+#define RX_FLAG_IS_TCP 0x4000
+
+#define RX_ERR_BAD_CRC 0x0001
+#define RX_ERR_COLL_DETECT 0x0002
+#define RX_ERR_LINK_LOST 0x0004
+#define RX_ERR_PHY_DECODE 0x0008
+#define RX_ERR_DRIBBLE 0x0010
+#define RX_ERR_MAC_ABORT 0x0020
+#define RX_ERR_SHORT_PKT 0x0040
+#define RX_ERR_TRUNC_NO_RES 0x0080
+#define RX_ERR_GIANT_PKT 0x0100
+
+/* BCM570x Status Block format as a struct (not BCM5705). Pages 110-111. */
+
+typedef struct t3_status_s {
+ uint32_t status;
+ uint32_t tag;
+#ifdef __MIPSEB
+ uint16_t rxc_std_index;
+ uint16_t rxc_jumbo_index;
+ uint16_t reserved2;
+ uint16_t rxc_mini_index;
+ struct {
+ uint16_t send_c;
+ uint16_t return_p;
+ } index [16];
+#elif __MIPSEL
+ uint16_t rxc_jumbo_index;
+ uint16_t rxc_std_index;
+ uint16_t rxc_mini_index;
+ uint16_t reserved2;
+ struct {
+ uint16_t return_p;
+ uint16_t send_c;
+ } index [16];
+#else
+#error "bcm5700: endian not set"
+#endif
+} t3_status_t;
+
+#define M_STATUS_UPDATED 0x00000001
+#define M_STATUS_LINKCHNG 0x00000002
+#define M_STATUS_ERROR 0x00000004
+
+/* BCM570x Statistics Block format as a struct. Pages 112-120 */
+
+typedef struct t3_stats_s {
+ uint64_t stats[L_MAC_STATS/sizeof(uint64_t)];
+} t3_stats_t;
+
+/* End of 570X defined data structures */
+
+
+typedef enum {
+ eth_state_uninit,
+ eth_state_off,
+ eth_state_on,
+} eth_state_t;
+
+typedef struct t3_ether_s {
+ /* status block */
+ volatile t3_status_t *status; /* should be cache-aligned */
+
+ /* PCI access information */
+ uint32_t regbase;
+ uint32_t membase;
+ uint8_t irq;
+ pcitag_t tag; /* tag for configuration registers */
+
+ uint8_t hwaddr[6];
+ uint16_t device; /* chip device code */
+ uint8_t revision; /* chip revision */
+
+ eth_state_t state; /* current state */
+ uint32_t intmask; /* interrupt mask */
+
+ /* packet lists */
+ queue_t freelist;
+ uint8_t *pktpool;
+ queue_t rxqueue;
+
+ /* rings */
+ /* For now, support only the standard Rx Producer Ring */
+ t3_rcv_bd_t *rxp_std; /* Standard Rx Producer Ring */
+ uint32_t rxp_std_index;
+ uint32_t prev_rxp_std_index;
+
+ /* For now, support only 1 priority */
+ uint32_t rxr_entries;
+ t3_rcv_bd_t *rxr_1; /* Rx Return Ring 1 */
+ uint32_t rxr_1_index;
+ t3_snd_bd_t *txp_1; /* Send Ring 1 */
+ uint32_t txp_1_index;
+ uint32_t txc_1_index;
+
+ cfe_devctx_t *devctx;
+
+ /* PHY access */
+ int phy_addr;
+ uint16_t phy_status;
+ uint16_t phy_ability;
+ uint16_t phy_xability;
+
+ /* MII polling control */
+ int phy_change;
+ int mii_polling;
+
+ /* statistics block */
+ t3_stats_t *stats; /* should be cache-aligned */
+
+ /* additional driver statistics */
+ uint32_t rx_interrupts;
+ uint32_t tx_interrupts;
+ uint32_t bogus_interrupts;
+} t3_ether_t;
+
+
+/* Address mapping macros */
+
+#define PTR_TO_PHYS(x) (K0_TO_PHYS((uintptr_t)(x)))
+#define PHYS_TO_PTR(a) ((uint8_t *)PHYS_TO_K0(a))
+
+/* All mappings through the PCI host bridge use match bits mode. */
+#define PHYS_TO_PCI(a) ((uint32_t) (a) | 0x20000000)
+#define PCI_TO_PHYS(a) ((uint32_t) (a) & 0x1FFFFFFF)
+
+#define PCI_TO_PTR(a) (PHYS_TO_PTR(PCI_TO_PHYS(a)))
+#define PTR_TO_PCI(x) (PHYS_TO_PCI(PTR_TO_PHYS(x)))
+
+
+/* Chip access macros */
+
+/* These macros attempt to be compatible with match-bits mode,
+ which may put the data and byte masks into the wrong 32-bit word
+ for 64-bit accesses. See the comment above on PIOSWAP.
+ Externally mastered DMA (control and data) uses match-bits and does
+ specify word-swaps when operating big endian. */
+
+/* Most registers are 32 bits wide and are accessed by 32-bit
+ transactions. The mailbox registers and on-chip RAM are 64-bits
+ wide but are generally accessed by 32-bit transactions.
+ Furthermore, the documentation is ambiguous about which 32-bits of
+ the mailbox is significant. To localize the potential confusions,
+ we define macros for the 3 different cases. */
+
+#if __long64
+#define READCSR(sc,csr) \
+ (*((volatile uint32_t *) \
+ (PHYS_TO_XKSEG_UNCACHED((sc)->regbase+(csr)))))
+
+#define WRITECSR(sc,csr,val) \
+ (*((volatile uint32_t *) \
+ (PHYS_TO_XKSEG_UNCACHED((sc)->regbase+(csr)))) = (val))
+
+#if PIOSWAP
+#define READMBOX(sc,csr) \
+ (*((volatile uint32_t *) \
+ (PHYS_TO_XKSEG_UNCACHED((sc)->regbase+((csr)+4)))))
+
+#define WRITEMBOX(sc,csr,val) \
+ (*((volatile uint32_t *) \
+ (PHYS_TO_XKSEG_UNCACHED((sc)->regbase+((csr)+4)))) = (val))
+
+#define READMEM(sc,csr) \
+ (*((volatile uint32_t *) \
+ (PHYS_TO_XKSEG_UNCACHED((sc)->membase+(csr)))))
+
+#define WRITEMEM(sc,csr,val) \
+ (*((volatile uint32_t *) \
+ (PHYS_TO_XKSEG_UNCACHED((sc)->membase+(csr)))) = (val))
+
+#else
+#define READMBOX(sc,csr) \
+ (*((volatile uint32_t *) \
+ (PHYS_TO_XKSEG_UNCACHED((sc)->regbase+(csr)))))
+
+#define WRITEMBOX(sc,csr,val) \
+ (*((volatile uint32_t *) \
+ (PHYS_TO_XKSEG_UNCACHED((sc)->regbase+(csr)))) = (val))
+
+#define READMEM(sc,csr) \
+ (*((volatile uint32_t *) \
+ (PHYS_TO_XKSEG_UNCACHED((sc)->membase+((csr) ^ 4)))))
+
+#define WRITEMEM(sc,csr,val) \
+ (*((volatile uint32_t *) \
+ (PHYS_TO_XKSEG_UNCACHED((sc)->membase+((csr) ^ 4)))) = (val))
+
+#endif
+#else
+#define READCSR(sc,csr) \
+ (hs_read32(PHYS_TO_XKSEG_UNCACHED((sc)->regbase+(csr))))
+
+#define WRITECSR(sc,csr,val) \
+ (hs_write32(PHYS_TO_XKSEG_UNCACHED((sc)->regbase+(csr), (val))))
+
+#define READMBOX(sc,csr) \
+ (hs_read32(PHYS_TO_XKSEG_UNCACHED((sc)->regbase+(csr)))))
+
+#define WRITEMBOX(sc,csr,val) \
+ (hs_write32(PHYS_TO_XKSEG_UNCACHED((sc)->regbase+(csr)))) = (val))
+
+#define READMEM(sc,csr) \
+ (hs_read32(PHYS_TO_XKSEG_UNCACHED((sc)->membase+(csr))))
+
+#define WRITEMEM(sc,csr,val) \
+ (hs_write32(PHYS_TO_XKSEG_UNCACHED((sc)->membase+(csr), (val))))
+
+#endif
+
+
+/* Entry to and exit from critical sections (currently relative to
+ interrupts only, not SMP) */
+
+#if CFG_INTERRUPTS
+#define CS_ENTER(sc) cfe_disable_irq(sc->irq)
+#define CS_EXIT(sc) cfe_enable_irq(sc->irq)
+#else
+#define CS_ENTER(sc) ((void)0)
+#define CS_EXIT(sc) ((void)0)
+#endif
+
+
+static void
+dumpseq(t3_ether_t *sc, int start, int next)
+{
+ int offset, i, j;
+ int columns = 4;
+ int lines = (((next - start)/4 + 1) + 3)/columns;
+ int step = lines*4;
+
+ offset = start;
+ for (i = 0; i < lines; i++) {
+ xprintf("\nCSR");
+ for (j = 0; j < columns; j++) {
+ if (offset + j*step < next)
+ xprintf(" %04X: %08X ",
+ offset+j*step, READCSR(sc, offset+j*step));
+ }
+ offset += 4;
+ }
+ xprintf("\n");
+}
+
+static void
+dumpcsrs(t3_ether_t *sc, const char *legend)
+{
+ xprintf("%s:\n", legend);
+
+ /* Some device-specific PCI configuration registers */
+ xprintf("-----PCI-----");
+ dumpseq(sc, 0x68, 0x78);
+
+ /* Some general control registers */
+ xprintf("---General---");
+ dumpseq(sc, 0x6800, 0x6810);
+
+ xprintf("-------------\n");
+}
+
+
+/* Packet management */
+
+#define ETH_PKTPOOL_SIZE 64
+#define MIN_RXP_STD_BDS 32
+
+
+static eth_pkt_t *
+eth_alloc_pkt(t3_ether_t *sc)
+{
+ eth_pkt_t *pkt;
+
+ CS_ENTER(sc);
+ pkt = (eth_pkt_t *) q_deqnext(&sc->freelist);
+ CS_EXIT(sc);
+ if (!pkt) return NULL;
+
+ pkt->buffer = pkt->data;
+ pkt->length = ETH_PKTBUF_LEN;
+ pkt->flags = 0;
+
+ return pkt;
+}
+
+
+static void
+eth_free_pkt(t3_ether_t *sc, eth_pkt_t *pkt)
+{
+ CS_ENTER(sc);
+ q_enqueue(&sc->freelist, &pkt->next);
+ CS_EXIT(sc);
+}
+
+static void
+eth_initfreelist(t3_ether_t *sc)
+{
+ int idx;
+ uint8_t *ptr;
+ eth_pkt_t *pkt;
+
+ q_init(&sc->freelist);
+
+ ptr = sc->pktpool;
+ for (idx = 0; idx < ETH_PKTPOOL_SIZE; idx++) {
+ pkt = (eth_pkt_t *) ptr;
+ eth_free_pkt(sc, pkt);
+ ptr += ETH_PKTBUF_SIZE;
+ }
+}
+
+
+/* Utilities */
+
+static const char *
+t3_devname(t3_ether_t *sc)
+{
+ return (sc->devctx != NULL ? cfe_device_name(sc->devctx) : "eth?");
+}
+
+
+/* CRCs */
+
+#define IEEE_CRC32_POLY 0xEDB88320UL /* CRC-32 Poly -- either endian */
+
+uint32_t eth_crc32(const uint8_t *databuf, unsigned int datalen);
+/*static*/ uint32_t
+eth_crc32(const uint8_t *databuf, unsigned int datalen)
+{
+ unsigned int idx, bit, data;
+ uint32_t crc;
+
+ crc = 0xFFFFFFFFUL;
+ for (idx = 0; idx < datalen; idx++)
+ for (data = *databuf++, bit = 0; bit < 8; bit++, data >>= 1)
+ crc = (crc >> 1) ^ (((crc ^ data) & 1) ? IEEE_CRC32_POLY : 0);
+ return crc;
+}
+
+
+/* Descriptor ring management */
+
+static int
+t3_add_rcvbuf(t3_ether_t *sc, eth_pkt_t *pkt)
+{
+ t3_rcv_bd_t *rxp;
+
+ rxp = &(sc->rxp_std[sc->rxp_std_index]);
+ rxp->bufptr_lo = PTR_TO_PCI(pkt->buffer);
+ rxp->length = ETH_PKTBUF_LEN;
+ sc->rxp_std_index++;
+ if (sc->rxp_std_index == RXP_STD_ENTRIES)
+ sc->rxp_std_index = 0;
+ return 0;
+}
+
+static void
+t3_fillrxring(t3_ether_t *sc)
+{
+ eth_pkt_t *pkt;
+ unsigned rxp_ci, rxp_onring;
+
+ rxp_ci = sc->status->rxc_std_index; /* Get a snapshot */
+
+ if (sc->rxp_std_index >= rxp_ci)
+ rxp_onring = sc->rxp_std_index - rxp_ci;
+ else
+ rxp_onring = (sc->rxp_std_index + RXP_STD_ENTRIES) - rxp_ci;
+
+ while (rxp_onring < MIN_RXP_STD_BDS) {
+ pkt = eth_alloc_pkt(sc);
+ if (pkt == NULL) {
+ /* could not allocate a buffer */
+ break;
+ }
+ if (t3_add_rcvbuf(sc, pkt) != 0) {
+ /* could not add buffer to ring */
+ eth_free_pkt(sc, pkt);
+ break;
+ }
+ rxp_onring++;
+ }
+}
+
+static void
+t3_rx_callback(t3_ether_t *sc, eth_pkt_t *pkt)
+{
+ if (T3_DEBUG) show_packet('>', pkt); /* debug */
+
+ CS_ENTER(sc);
+ q_enqueue(&sc->rxqueue, &pkt->next);
+ CS_EXIT(sc);
+}
+
+static void
+t3_procrxring(t3_ether_t *sc)
+{
+ eth_pkt_t *pkt;
+ t3_rcv_bd_t *rxc;
+ volatile t3_status_t *status = sc->status;
+
+ rxc = &(sc->rxr_1[sc->rxr_1_index]);
+ do {
+ pkt = ETH_PKT_BASE(PCI_TO_PTR(rxc->bufptr_lo));
+ pkt->length = rxc->length;
+ if ((rxc->flags & RX_FLAG_ERROR) == 0)
+ t3_rx_callback(sc, pkt);
+ else {
+#if T3_BRINGUP
+ xprintf("%s: rx error %04X\n", t3_devname(sc), rxc->error_flag);
+#endif
+ eth_free_pkt(sc, pkt); /* Could optimize */
+ }
+ sc->rxr_1_index++;
+ rxc++;
+ if (sc->rxr_1_index == sc->rxr_entries) {
+ sc->rxr_1_index = 0;
+ rxc = &(sc->rxr_1[0]);
+ }
+ } while (status->index[RI(1)].return_p != sc->rxr_1_index);
+
+ /* Update the return ring */
+ WRITEMBOX(sc, R_RCV_BD_RTN_CI(1), sc->rxr_1_index);
+
+ /* Refill the producer ring */
+ t3_fillrxring(sc);
+}
+
+
+static int
+t3_transmit(t3_ether_t *sc, eth_pkt_t *pkt)
+{
+ t3_snd_bd_t *txp;
+
+ if (T3_DEBUG) show_packet('<', pkt); /* debug */
+
+ txp = &(sc->txp_1[sc->txp_1_index]);
+ txp->bufptr_hi = 0;
+ txp->bufptr_lo = PTR_TO_PCI(pkt->buffer);
+ txp->length = pkt->length;
+ txp->flags = TX_FLAG_PACKET_END;
+
+ sc->txp_1_index++;
+ if (sc->txp_1_index == TXP_RING_ENTRIES)
+ sc->txp_1_index = 0;
+
+ WRITEMBOX(sc, R_SND_BD_PI(1), sc->txp_1_index);
+
+ return 0;
+}
+
+
+static void
+t3_proctxring(t3_ether_t *sc)
+{
+ eth_pkt_t *pkt;
+ t3_snd_bd_t *txc;
+ volatile t3_status_t *status = sc->status;
+
+ txc = &(sc->txp_1[sc->txc_1_index]);
+ do {
+ pkt = ETH_PKT_BASE(PCI_TO_PTR(txc->bufptr_lo));
+ eth_free_pkt(sc, pkt);
+ sc->txc_1_index++;
+ txc++;
+ if (sc->txc_1_index == TXP_RING_ENTRIES) {
+ sc->txc_1_index = 0;
+ txc = &(sc->txp_1[0]);
+ }
+ } while (status->index[RI(1)].send_c != sc->txc_1_index);
+}
+
+
+static void
+t3_initrings(t3_ether_t *sc)
+{
+ int i;
+ t3_rcv_bd_t *rxp;
+ volatile t3_status_t *status = sc->status;
+
+ /* Clear all Producer BDs */
+ rxp = &(sc->rxp_std[0]);
+ for (i = 0; i < RXP_STD_ENTRIES; i++) {
+ rxp->bufptr_hi = rxp->bufptr_lo = 0;
+ rxp->length = 0;
+ rxp->index = i;
+ rxp->flags = 0;
+ rxp->type = 0;
+ rxp->ip_cksum = rxp->tcp_cksum = 0;
+ rxp++;
+ }
+
+ /* Init the ring pointers */
+
+ sc->rxp_std_index = 0; status->rxc_std_index = 0;
+ sc->rxr_1_index = 0; status->index[RI(1)].return_p = 0;
+ sc->txp_1_index = 0; status->index[RI(1)].send_c = 0;
+
+ /* Allocate some initial buffers for the Producer BD ring */
+ sc->prev_rxp_std_index = 0;
+ t3_fillrxring(sc);
+
+ /* Nothing consumed yet */
+ sc->txc_1_index = 0;
+}
+
+static void
+t3_init(t3_ether_t *sc)
+{
+ /* Allocate buffer pool */
+ sc->pktpool = KMALLOC(ETH_PKTPOOL_SIZE*ETH_PKTBUF_SIZE, CACHE_ALIGN);
+ eth_initfreelist(sc);
+ q_init(&sc->rxqueue);
+
+ t3_initrings(sc);
+}
+
+static void
+t3_reinit(t3_ether_t *sc)
+{
+ eth_initfreelist(sc);
+ q_init(&sc->rxqueue);
+
+ t3_initrings(sc);
+}
+
+
+/* Byte swap utilities. */
+
+#define SWAP4(x) \
+ ((((x) & 0x00FF) << 24) | \
+ (((x) & 0xFF00) << 8) | \
+ (((x) >> 8) & 0xFF00) | \
+ (((x) >> 24) & 0x00FF))
+
+static uint32_t
+swap4(uint32_t x)
+{
+ uint32_t t;
+
+ t = ((x & 0xFF00FF00) >> 8) | ((x & 0x00FF00FF) << 8);
+ return (t >> 16) | ((t & 0xFFFF) << 16);
+}
+
+
+/* EEPROM access functions (BCM5700 and BCM5701 version) */
+
+/* The 570x chips support multiple access methods. We use "Auto Access",
+ which requires that
+ Miscellaneous_Local_Control.Auto_SEEPROM_Access be set,
+ Serial_EEprom.Address.HalfClock be programmed for <= 400 Hz.
+ (both done by initialization code) */
+
+#define EP_MAX_RETRIES 500
+#define EP_DEVICE_ID 0x00 /* default ATMEL device ID */
+
+static void
+eeprom_access_init(t3_ether_t *sc)
+{
+ uint32_t mlctl;
+
+ WRITECSR(sc, R_EEPROM_ADDR, M_EPADDR_RESET | V_EPADDR_HPERIOD(0x60));
+
+ mlctl = READCSR(sc, R_MISC_LOCAL_CTRL);
+ mlctl |= M_MLCTL_EPAUTOACCESS;
+ WRITECSR(sc, R_MISC_LOCAL_CTRL, mlctl);
+}
+
+
+static uint32_t
+eeprom_read_word(t3_ether_t *sc, unsigned int offset)
+{
+ /* Assumes that SEEPROM is already set up for auto access. */
+ uint32_t epaddr, epdata;
+ volatile uint32_t temp;
+ int i;
+
+ epaddr = READCSR(sc, R_EEPROM_ADDR);
+ epaddr &= M_EPADDR_HPERIOD;
+ epaddr |= (V_EPADDR_ADDR(offset) | V_EPADDR_DEVID(EP_DEVICE_ID)
+ | M_EPADDR_RW | M_EPADDR_START | M_EPADDR_COMPLETE);
+ WRITECSR(sc, R_EEPROM_ADDR, epaddr);
+ temp = READCSR(sc, R_EEPROM_ADDR); /* push */
+
+ for (i = 0; i < EP_MAX_RETRIES; i++) {
+ temp = READCSR(sc, R_EEPROM_ADDR);
+ if ((temp & M_EPADDR_COMPLETE) != 0)
+ break;
+ cfe_usleep(10);
+ }
+ if (i == EP_MAX_RETRIES)
+ xprintf("%s: eeprom_read_word: no SEEPROM response @ %x\n",
+ t3_devname(sc), offset);
+
+ epdata = READCSR(sc, R_EEPROM_DATA); /* little endian */
+#ifdef __MIPSEB
+ return swap4(epdata);
+#else
+ return epdata;
+#endif
+}
+
+static int
+eeprom_read_range(t3_ether_t *sc, unsigned int offset, unsigned int len,
+ uint32_t buf[])
+{
+ int index;
+
+ offset &= ~3; len &= ~3; /* 4-byte words only */
+ index = 0;
+
+ while (len > 0) {
+ buf[index++] = eeprom_read_word(sc, offset);
+ offset += 4; len -= 4;
+ }
+
+ return index;
+}
+
+static void
+eeprom_dump_range(const char *label,
+ uint32_t buf[], unsigned int offset, unsigned int len)
+{
+ int index;
+
+ xprintf("EEPROM: %s", label);
+
+ offset &= ~3; len &= ~3; /* 4-byte words only */
+ index = 0;
+
+ for (index = 0; len > 0; index++) {
+ if (index % 8 == 0)
+ xprintf("\n %04x: ", offset);
+ xprintf(" %08x", buf[offset/4]);
+ offset += 4; len -= 4;
+ }
+ xprintf("\n");
+}
+
+
+/* MII access functions. */
+
+/* BCM5401 device specific registers */
+
+#define MII_ISR 0x1A /* Interrupt Status Register */
+#define MII_IMR 0x1B /* Interrupt Mask Register */
+
+#define M_INT_LINKCHNG 0x0002
+
+
+/* The 570x chips support multiple access methods. We use "Auto
+ Access", which requires that MDI_Control_Register.MDI_Select be
+ clear (done by initialization code) */
+
+#define MII_MAX_RETRIES 5000
+
+static void
+mii_access_init(t3_ether_t *sc)
+{
+ WRITECSR(sc, R_MDI_CTRL, 0); /* here for now */
+#if !T3_AUTOPOLL
+ WRITECSR(sc, R_MI_MODE, V_MIMODE_CLKCNT(0x1F)); /* max divider */
+#endif
+}
+
+/* XXX Autopolling should be disabled during reads and writes per the
+ manual, but doing so currently generates recurvise LINKCHNG
+ attentions. */
+
+static uint16_t
+mii_read_register(t3_ether_t *sc, int phy, int index)
+{
+ uint32_t mode;
+ uint32_t comm, val;
+ int i;
+
+ mode = READCSR(sc, R_MI_MODE);
+#if 0 /* for now */
+ if (mode & M_MIMODE_POLLING) {
+ WRITECSR(sc, R_MI_MODE, mode & ~M_MIMODE_POLLING);
+ cfe_usleep(40);
+ }
+#endif
+
+ comm = (V_MICOMM_CMD_RD | V_MICOMM_PHY(phy) | V_MICOMM_REG(index)
+ | M_MICOMM_BUSY);
+ WRITECSR(sc, R_MI_COMM, comm);
+
+ for (i = 0; i < MII_MAX_RETRIES; i++) {
+ val = READCSR(sc, R_MI_COMM);
+ if ((val & M_MICOMM_BUSY) == 0)
+ break;
+ }
+ if (i == MII_MAX_RETRIES)
+ xprintf("%s: mii_read_register: MII always busy\n", t3_devname(sc));
+
+#if 0
+ if (mode & M_MIMODE_POLLING)
+ WRITECSR(sc, R_MI_MODE, mode);
+#endif
+
+ return G_MICOMM_DATA(val);
+}
+
+/* Register reads occasionally return spurious 0's. Verify a zero by
+ doing a second read, or spinning when a zero is "impossible". */
+static uint16_t
+mii_read_register_v(t3_ether_t *sc, int phy, int index, int spin)
+{
+ uint32_t val;
+
+ val = mii_read_register(sc, phy, index);
+ if (val == 0) {
+ do {
+ val = mii_read_register(sc, phy, index);
+ } while (spin && val == 0);
+ }
+ return val;
+}
+
+static void
+mii_write_register(t3_ether_t *sc, int phy, int index, uint16_t value)
+{
+ uint32_t mode;
+ uint32_t comm, val;
+ int i;
+
+ mode = READCSR(sc, R_MI_MODE);
+#if 0 /* for now */
+ if (mode & M_MIMODE_POLLING) {
+ WRITECSR(sc, R_MI_MODE, mode & ~M_MIMODE_POLLING);
+ cfe_usleep(40);
+ }
+#endif
+
+ comm = (V_MICOMM_CMD_WR | V_MICOMM_PHY(phy) | V_MICOMM_REG(index)
+ | V_MICOMM_DATA(value) | M_MICOMM_BUSY);
+ WRITECSR(sc, R_MI_COMM, comm);
+
+ for (i = 0; i < MII_MAX_RETRIES; i++) {
+ val = READCSR(sc, R_MI_COMM);
+ if ((val & M_MICOMM_BUSY) == 0)
+ break;
+ }
+ if (i == MII_MAX_RETRIES)
+ xprintf("%s: mii_write_register: MII always busy\n", t3_devname(sc));
+
+#if 0
+ if (mode & M_MIMODE_POLLING)
+ WRITECSR(sc, R_MI_MODE, mode);
+#endif
+}
+
+static int
+mii_probe(t3_ether_t *sc)
+{
+#if T3_AUTOPOLL /* With autopolling, the code below is not reliable. */
+ return 1; /* Guaranteed for integrated PHYs */
+#else
+ int i;
+ uint16_t id1, id2;
+
+ for (i = 0; i < 32; i++) {
+ id1 = mii_read_register(sc, i, MII_PHYIDR1);
+ id2 = mii_read_register(sc, i, MII_PHYIDR2);
+ if ((id1 != 0x0000 && id1 != 0xFFFF) ||
+ (id2 != 0x0000 && id2 != 0xFFFF)) {
+ if (id1 != id2) return i;
+ }
+ }
+ return -1;
+#endif
+}
+
+#if T3_DEBUG
+#define OUI_BCM 0x001018
+#define IDR_BCM 0x000818
+/* 5400: 4, 5401: 5, 5411: 6, 5421: e, 5701: 11 */
+
+static void
+mii_dump(t3_ether_t *sc, const char *label)
+{
+ int i;
+ uint16_t r;
+ uint32_t idr, part;
+
+ xprintf("%s, MII:\n", label);
+ idr = part = 0;
+
+ /* Required registers */
+ for (i = 0x0; i <= 0x6; ++i) {
+ r = mii_read_register(sc, sc->phy_addr, i);
+ xprintf(" REG%02X: %04X", i, r);
+ if (i == 3 || i == 6)
+ xprintf("\n");
+ if (i == MII_PHYIDR1) {
+ idr |= r << 6;
+ }
+ else if (i == MII_PHYIDR2) {
+ idr |= (r >> 10) & 0x3F;
+ part = (r >> 4) & 0x3F;
+ }
+ }
+
+ /* GMII extensions */
+ for (i = 0x9; i <= 0xA; ++i) {
+ r = mii_read_register(sc, sc->phy_addr, i);
+ xprintf(" REG%02X: %04X", i, r);
+ }
+ r = mii_read_register(sc, sc->phy_addr, 0xF);
+ xprintf(" REG%02X: %04X\n", 0xF, r);
+
+ /* Broadcom extensions (54xx family) */
+ if (idr == IDR_BCM) {
+ for (i = 0x10; i <= 0x14; i++) {
+ r = mii_read_register(sc, sc->phy_addr, i);
+ xprintf(" REG%02X: %04X", i, r);
+ }
+ xprintf("\n");
+ for (i = 0x18; i <= 0x1A; i++) {
+ r = mii_read_register(sc, sc->phy_addr, i);
+ xprintf(" REG%02X: %04X", i, r);
+ }
+ xprintf("\n");
+ }
+}
+#else
+#define mii_dump(sc,label)
+#endif
+
+static void
+mii_enable_interrupts(t3_ether_t *sc)
+{
+ mii_write_register(sc, sc->phy_addr, MII_IMR, ~M_INT_LINKCHNG);
+}
+
+
+/* For 5700/5701, LINKCHNG is read-only in the status register and
+ cleared by writing to CFGCHNG | SYNCCHNG. For the 5705
+ (empirically), LINKCHNG is cleared by writing a one, while CFGCHNG
+ and SYNCCHNG are unimplemented. Thus we can safely clear the
+ interrupt by writing ones to all the above bits. */
+
+#define M_LINKCHNG_CLR \
+ (M_EVT_LINKCHNG | M_MACSTAT_CFGCHNG | M_MACSTAT_SYNCCHNG)
+
+static int
+mii_poll(t3_ether_t *sc)
+{
+ uint32_t macstat;
+ uint16_t status, ability, xability;
+ uint16_t isr;
+
+ macstat = READCSR(sc, R_MAC_STATUS);
+ if ((macstat & (M_EVT_LINKCHNG | M_EVT_MIINT)) != 0)
+ WRITECSR(sc, R_MAC_STATUS, M_LINKCHNG_CLR);
+
+ /* BMSR has read-to-clear bits; read twice. */
+
+ status = mii_read_register(sc, sc->phy_addr, MII_BMSR);
+ status = mii_read_register_v(sc, sc->phy_addr, MII_BMSR, 1);
+ ability = mii_read_register_v(sc, sc->phy_addr, MII_ANLPAR, 0);
+ if (status & BMSR_1000BT_XSR)
+ xability = mii_read_register_v(sc, sc->phy_addr, MII_K1STSR, 0);
+ else
+ xability = 0;
+ isr = mii_read_register(sc, sc->phy_addr, MII_ISR);
+
+ if (status != sc->phy_status
+ || ability != sc->phy_ability || xability != sc->phy_xability) {
+#if T3_DEBUG
+ xprintf("[%04x]", isr);
+ xprintf((macstat & (M_EVT_LINKCHNG | M_EVT_MIINT)) != 0 ? "+" : "-");
+
+ if (status != sc->phy_status)
+ xprintf(" ST: %04x %04x", sc->phy_status, status);
+ if (ability != sc->phy_ability)
+ xprintf(" AB: %04x %04x", sc->phy_ability, ability);
+ if (xability != sc->phy_xability)
+ xprintf(" XA: %04x %04x", sc->phy_xability, xability);
+ xprintf("\n");
+#endif
+ sc->phy_status = status;
+ sc->phy_ability = ability;
+ sc->phy_xability = xability;
+ return 1;
+ }
+ else if ((macstat & (M_EVT_LINKCHNG | M_EVT_MIINT)) != 0) {
+ isr = mii_read_register(sc, sc->phy_addr, MII_ISR);
+ }
+ return 0;
+}
+
+static void
+mii_set_speed(t3_ether_t *sc, int speed)
+{
+ uint16_t control;
+
+ control = mii_read_register(sc, sc->phy_addr, MII_BMCR);
+
+ control &= ~(BMCR_ANENABLE | BMCR_RESTARTAN);
+ mii_write_register(sc, sc->phy_addr, MII_BMCR, control);
+ control &= ~(BMCR_SPEED0 | BMCR_SPEED1 | BMCR_DUPLEX);
+
+ switch (speed) {
+ case ETHER_SPEED_10HDX:
+ default:
+ break;
+ case ETHER_SPEED_10FDX:
+ control |= BMCR_DUPLEX;
+ break;
+ case ETHER_SPEED_100HDX:
+ control |= BMCR_SPEED100;
+ break;
+ case ETHER_SPEED_100FDX:
+ control |= BMCR_SPEED100 | BMCR_DUPLEX ;
+ break;
+ }
+
+ mii_write_register(sc, sc->phy_addr, MII_BMCR, control);
+}
+
+static void
+mii_autonegotiate(t3_ether_t *sc)
+{
+ uint16_t control, status, remote, xremote;
+ unsigned int timeout;
+ int linkspeed;
+ uint32_t mode;
+
+ linkspeed = ETHER_SPEED_UNKNOWN;
+
+ /* Read twice to clear latching bits */
+ status = mii_read_register(sc, sc->phy_addr, MII_BMSR);
+ status = mii_read_register_v(sc, sc->phy_addr, MII_BMSR, 1);
+ mii_dump(sc, "query PHY");
+
+ if ((status & (BMSR_AUTONEG | BMSR_LINKSTAT)) ==
+ (BMSR_AUTONEG | BMSR_LINKSTAT))
+ control = mii_read_register(sc, sc->phy_addr, MII_BMCR);
+ else {
+ for (timeout = 4*CFE_HZ; timeout > 0; timeout -= CFE_HZ/2) {
+ status = mii_read_register(sc, sc->phy_addr, MII_BMSR);
+ if ((status & BMSR_ANCOMPLETE) != 0 || timeout <= 0)
+ break;
+ cfe_sleep(CFE_HZ/2);
+ }
+ }
+
+ remote = mii_read_register_v(sc, sc->phy_addr, MII_ANLPAR, 0);
+
+ /* XXX Empirically, it appears best to set/keep PortMode non-null to
+ get STATUS_LINKCHNG assertions. */
+ mode = READCSR(sc, R_MAC_MODE);
+
+ xprintf("%s: Link speed: ", t3_devname(sc));
+ if ((status & BMSR_ANCOMPLETE) != 0) {
+ /* A link partner was negogiated... */
+
+ if (status & BMSR_1000BT_XSR)
+ xremote = mii_read_register_v(sc, sc->phy_addr, MII_K1STSR, 0);
+ else
+ xremote = 0;
+
+ mode &= ~(M_MACM_PORTMODE | M_MACM_HALFDUPLEX);
+
+ if ((xremote & K1STSR_LP1KFD) != 0) {
+ xprintf("1000BaseT FDX\n");
+ linkspeed = ETHER_SPEED_1000FDX;
+ mode |= V_MACM_PORTMODE(K_MACM_PORTMODE_GMII);
+ }
+ else if ((xremote & K1STSR_LP1KHD) != 0) {
+ xprintf("1000BaseT HDX\n");
+ linkspeed = ETHER_SPEED_1000HDX;
+ mode |= V_MACM_PORTMODE(K_MACM_PORTMODE_GMII) | M_MACM_HALFDUPLEX;
+ }
+ else if ((remote & ANLPAR_TXFD) != 0) {
+ xprintf("100BaseT FDX\n");
+ linkspeed = ETHER_SPEED_100FDX;
+ mode |= V_MACM_PORTMODE(K_MACM_PORTMODE_MII);
+ }
+ else if ((remote & ANLPAR_TXHD) != 0) {
+ xprintf("100BaseT HDX\n");
+ linkspeed = ETHER_SPEED_100HDX;
+ mode |= V_MACM_PORTMODE(K_MACM_PORTMODE_MII) | M_MACM_HALFDUPLEX;
+ }
+ else if ((remote & ANLPAR_10FD) != 0) {
+ xprintf("10BaseT FDX\n");
+ linkspeed = ETHER_SPEED_10FDX;
+ mode |= V_MACM_PORTMODE(K_MACM_PORTMODE_MII);
+ }
+ else if ((remote & ANLPAR_10HD) != 0) {
+ xprintf("10BaseT HDX\n");
+ linkspeed = ETHER_SPEED_10HDX;
+ mode |= V_MACM_PORTMODE(K_MACM_PORTMODE_MII) | M_MACM_HALFDUPLEX;
+ }
+
+ WRITECSR(sc, R_MAC_MODE, mode);
+ }
+ else {
+ /* no link partner convergence */
+ xprintf("Unknown\n");
+ linkspeed = ETHER_SPEED_UNKNOWN;
+ remote = xremote = 0;
+ if (G_MACM_PORTMODE(mode) == K_MACM_PORTMODE_NONE) {
+ /* Keep any previous port mode as the one most likely to reappear.
+ Otherwise, choose one, and 10/100FDX is more likely. */
+ mode |= V_MACM_PORTMODE(K_MACM_PORTMODE_MII);
+ WRITECSR(sc, R_MAC_MODE, mode);
+ }
+ }
+
+ /* clear latching bits, XXX fix flakey reads */
+ status = mii_read_register_v(sc, sc->phy_addr, MII_BMSR, 1);
+ (void)mii_read_register(sc, sc->phy_addr, MII_ISR);
+
+ sc->phy_status = status;
+ sc->phy_ability = remote;
+ sc->phy_xability = xremote;
+
+ mii_dump(sc, "final PHY");
+}
+
+
+static void
+t3_clear(t3_ether_t *sc, unsigned reg, uint32_t mask)
+{
+ uint32_t val;
+ int timeout;
+
+ val = READCSR(sc, reg);
+ val &= ~mask;
+ WRITECSR(sc, reg, val);
+ val = READCSR(sc, reg);
+
+ for (timeout = 4000; (val & mask) != 0 && timeout > 0; timeout -= 100) {
+ cfe_usleep(100);
+ val = READCSR(sc, reg);
+ }
+ if (timeout <= 0)
+ xprintf("%s: cannot clear %04X/%08X\n", t3_devname(sc), reg, mask);
+}
+
+
+/* The following functions collectively implement the recommended
+ BCM5700 Initialization Procedure (Section 8: Device Control) */
+
+static int
+t3_coldreset(t3_ether_t *sc)
+{
+ pcireg_t cmd;
+ pcireg_t bhlc, subsysid;
+ pcireg_t bar0, bar1;
+ pcireg_t cmdx;
+ uint32_t mhc, mcr, mcfg;
+ uint32_t mode;
+ int timeout;
+
+ /* Steps 1-18 */
+ /* Enable memory, also clear R/WC status bits (1) */
+ cmd = pci_conf_read(sc->tag, PCI_COMMAND_STATUS_REG);
+ cmd |= PCI_COMMAND_MEM_ENABLE | PCI_COMMAND_MASTER_ENABLE;
+ pci_conf_write(sc->tag, PCI_COMMAND_STATUS_REG, cmd);
+
+ /* Clear and disable INTA output. (2) */
+ mhc = READCSR(sc, R_MISC_HOST_CTRL);
+ mhc |= M_MHC_MASKPCIINT | M_MHC_CLEARINTA;
+ WRITECSR(sc, R_MISC_HOST_CTRL, mhc);
+
+ /* Save some config registers modified by core clock reset (3). */
+ bhlc = pci_conf_read(sc->tag, PCI_BHLC_REG);
+ subsysid = pci_conf_read(sc->tag, PCI_SUBSYS_ID_REG);
+ /* Empirically, these are clobbered too. */
+ bar0 = pci_conf_read(sc->tag, PCI_MAPREG(0));
+ bar1 = pci_conf_read(sc->tag, PCI_MAPREG(1));
+
+ /* Reset the core clocks (4, 5). */
+ mcfg = READCSR(sc, R_MISC_CFG);
+ mcfg |= M_MCFG_CORERESET;
+ WRITECSR(sc, R_MISC_CFG, mcfg);
+ cfe_usleep(100); /* 100 usec delay */
+
+ /* NB: Until the BARs are restored and reenabled, only PCI
+ configuration reads and writes will succeed. */
+
+ /* Reenable MAC memory (7) */
+ pci_conf_write(sc->tag, PCI_MAPREG(0), bar0);
+ pci_conf_write(sc->tag, PCI_MAPREG(1), bar1);
+ (void)pci_conf_read(sc->tag, PCI_MAPREG(1)); /* push */
+ pci_conf_write(sc->tag, PCI_COMMAND_STATUS_REG, cmd);
+ (void)pci_conf_read(sc->tag, PCI_COMMAND_STATUS_REG); /* push */
+
+ /* Undo some of the resets (6) */
+ mhc = READCSR(sc, R_MISC_HOST_CTRL);
+ mhc |= M_MHC_MASKPCIINT;
+ WRITECSR(sc, R_MISC_HOST_CTRL, mhc);
+
+ /* Verify that core clock resets completed and autocleared. */
+ mcfg = READCSR(sc, R_MISC_CFG);
+ if ((mcfg & M_MCFG_CORERESET) != 0) {
+ xprintf("bcm5700: core clocks stuck in reset\n");
+ }
+
+ /* Configure PCI-X (8) */
+ if (sc->device != K_PCI_ID_BCM5705) {
+ cmdx = pci_conf_read(sc->tag, PCI_PCIX_CMD_REG);
+ cmdx &= ~PCIX_CMD_RLXORDER_ENABLE;
+ pci_conf_write(sc->tag, PCI_PCIX_CMD_REG, cmdx);
+ }
+
+ /* Enable memory arbiter (9) */
+ mode = READCSR(sc, R_MEM_MODE);
+ mode |= M_MAM_ENABLE; /* enable memory arbiter */
+ WRITECSR(sc, R_MEM_MODE, mode);
+
+ /* Assume no external SRAM for now (10) */
+
+ /* Set up MHC for endianness and write enables (11-15) */
+ mhc = READCSR(sc, R_MISC_HOST_CTRL);
+#ifdef __MIPSEL
+ mhc |= M_MHC_ENWORDSWAP; /* XXX check this */
+#endif
+#ifdef __MIPSEB
+ /* Since we use match-bits for Direct PCI access, don't swap bytes. */
+#if PIOSWAP
+ mhc |= M_MHC_ENWORDSWAP;
+#endif
+#endif
+ mhc |= M_MHC_ENINDIRECT | M_MHC_ENPCISTATERW | M_MHC_ENCLKCTRLRW;
+ WRITECSR(sc, R_MISC_HOST_CTRL, mhc);
+
+ /* Set byte swapping (16, 17) */
+ mcr = READCSR(sc, R_MODE_CTRL);
+#ifdef __MIPSEL
+ mcr &= ~M_MCTL_BSWAPDATA;
+ mcr |= M_MCTL_WSWAPCTRL | M_MCTL_WSWAPDATA; /* XXX check this */
+#endif
+#ifdef __MIPSEB
+ mcr &= ~(M_MCTL_BSWAPCTRL | M_MCTL_BSWAPDATA);
+ mcr |= M_MCTL_WSWAPCTRL | M_MCTL_WSWAPDATA;
+#endif
+ WRITECSR(sc, R_MODE_CTRL, mcr);
+
+ /* Disable PXE restart, wait for firmware (18, 19) */
+ if (READMEM(sc, A_PXE_MAILBOX) != T3_MAGIC_NUMBER) {
+ /* Apparently, if the magic number is already set, firmware
+ ignores this attempted handshake. */
+ WRITEMEM(sc, A_PXE_MAILBOX, T3_MAGIC_NUMBER);
+ for (timeout = CFE_HZ; timeout > 0; timeout -= CFE_HZ/10) {
+ if (READMEM(sc, A_PXE_MAILBOX) == ~T3_MAGIC_NUMBER)
+ break;
+ cfe_sleep(CFE_HZ/10);
+ }
+ if (READMEM(sc, A_PXE_MAILBOX) != ~T3_MAGIC_NUMBER)
+ xprintf("bcm5700: no firmware PXE rendevous\n");
+ }
+ else
+ xprintf("bcm5700: PXE magic number already set\n");
+
+ /* Clear Ethernet MAC Mode (20) */
+ WRITECSR(sc, R_MAC_MODE, 0x00000000);
+
+ /* Restore remaining config registers (21) */
+ pci_conf_write(sc->tag, PCI_BHLC_REG, bhlc);
+ pci_conf_write(sc->tag, PCI_SUBSYS_ID_REG, subsysid);
+
+ return 0;
+}
+
+/* XXX Not clear that the following is useful. */
+static int
+t3_warmreset(t3_ether_t *sc)
+{
+ uint32_t mode;
+
+ /* Enable memory arbiter (9) */
+ mode = READCSR(sc, R_MEM_MODE);
+ mode |= M_MAM_ENABLE; /* enable memory arbiter */
+ WRITECSR(sc, R_MEM_MODE, mode);
+
+ /* Clear Ethernet MAC Mode (20) */
+ WRITECSR(sc, R_MAC_MODE, 0x00000000);
+
+ return 0;
+}
+
+
+static int
+t3_init_registers(t3_ether_t *sc)
+{
+ unsigned offset;
+ uint32_t dmac, mcr, mcfg;
+
+ /* Steps 22-29 */
+
+ /* Clear MAC statistics block (22) */
+ for (offset = A_MAC_STATS; offset < A_MAC_STATS+L_MAC_STATS; offset += 4) {
+ WRITEMEM(sc, offset, 0);
+ }
+
+ /* Clear driver status memory region (23) */
+ /* ASSERT (sizeof(t3_status_t) == L_MAC_STATUS) */
+ memset((uint8_t *)sc->status, 0, sizeof(t3_status_t));
+
+ /* Set up PCI DMA control (24) */
+ dmac = READCSR(sc, R_DMA_RW_CTRL);
+ dmac &= ~(M_DMAC_RDCMD | M_DMAC_WRCMD | M_DMAC_MINDMA);
+ dmac |= V_DMAC_RDCMD(K_PCI_MEMRD) | V_DMAC_WRCMD(K_PCI_MEMWR);
+ switch (sc->device) {
+ case K_PCI_ID_BCM5700:
+ case K_PCI_ID_BCM5701:
+ case K_PCI_ID_BCM5702:
+ dmac |= V_DMAC_MINDMA(0xF); /* "Recommended" */
+ break;
+ default:
+ dmac |= V_DMAC_MINDMA(0x0);
+ break;
+ }
+ WRITECSR(sc, R_DMA_RW_CTRL, dmac);
+
+ /* Set DMA byte swapping (25) - XXX repeat of (17) */
+ mcr = READCSR(sc, R_MODE_CTRL);
+#ifdef __MIPSEL
+ mcr &= ~M_MCTL_BSWAPDATA;
+ mcr |= M_MCTL_WSWAPCTRL | M_MCTL_WSWAPDATA; /* XXX check this */
+#endif
+#ifdef __MIPSEB
+ mcr &= ~(M_MCTL_BSWAPCTRL | M_MCTL_BSWAPDATA);
+ mcr |= M_MCTL_WSWAPCTRL | M_MCTL_WSWAPDATA;
+#endif
+ WRITECSR(sc, R_MODE_CTRL, mcr);
+
+ /* Configure host rings (26) */
+ mcr |= M_MCTL_HOSTBDS;
+ WRITECSR(sc, R_MODE_CTRL, mcr);
+
+ /* Indicate driver ready, disable checksums (27, 28) */
+ mcr |= M_MCTL_HOSTUP;
+ mcr |= (M_MCTL_NOTXPHSUM | M_MCTL_NORXPHSUM);
+ WRITECSR(sc, R_MODE_CTRL, mcr);
+
+ /* Configure timer (29) */
+ mcfg = READCSR(sc, R_MISC_CFG);
+ mcfg &= ~M_MCFG_PRESCALER;
+ mcfg |= V_MCFG_PRESCALER(66-1); /* 66 MHz */
+ WRITECSR(sc, R_MISC_CFG, mcfg);
+
+ return 0;
+}
+
+static int
+t3_init_pools(t3_ether_t *sc)
+{
+ uint32_t mode;
+ int timeout;
+
+ /* Steps 30-36. These use "recommended" settings (p 150) */
+
+ /* Configure the MAC memory pool (30) */
+ if (sc->device != K_PCI_ID_BCM5705) {
+ WRITECSR(sc, R_BMGR_MBUF_BASE, A_BUFFER_POOL);
+ WRITECSR(sc, R_BMGR_MBUF_LEN, L_BUFFER_POOL);
+ }
+ else {
+ /* Note: manual appears to recommend not even writing these (?) */
+ /* WRITECSR(sc, R_BMGR_MBUF_BASE, A_RXMBUF); */
+ /* WRITECSR(sc, R_BMGR_MBUF_LEN, 0x8000); */
+ }
+
+ /* Configure the MAC DMA resource pool (31) */
+ WRITECSR(sc, R_BMGR_DMA_BASE, A_DMA_DESCS);
+ WRITECSR(sc, R_BMGR_DMA_LEN, L_DMA_DESCS);
+
+ /* Configure the MAC memory watermarks (32) */
+ WRITECSR(sc, R_BMGR_MBUF_DMA_LOW, 0x50);
+ WRITECSR(sc, R_BMGR_MBUF_RX_LOW, 0x20);
+ WRITECSR(sc, R_BMGR_MBUF_HIGH, 0x60);
+
+ /* Configure the DMA resource watermarks (33) */
+ WRITECSR(sc, R_BMGR_DMA_LOW, 5);
+ WRITECSR(sc, R_BMGR_DMA_HIGH, 10);
+
+ /* Enable the buffer manager (34, 35) */
+ mode = READCSR(sc, R_BMGR_MODE);
+ mode |= (M_BMODE_ENABLE | M_BMODE_MBUFLOWATTN);
+ WRITECSR(sc, R_BMGR_MODE, mode);
+ for (timeout = CFE_HZ/2; timeout > 0; timeout -= CFE_HZ/10) {
+ mode = READCSR(sc, R_BMGR_MODE);
+ if ((mode & M_BMODE_ENABLE) != 0)
+ break;
+ cfe_sleep(CFE_HZ/10);
+ }
+ if ((mode & M_BMODE_ENABLE) == 0)
+ xprintf("bcm5700: buffer manager not enabled\n");
+
+ /* Enable internal queues (36) */
+ WRITECSR(sc, R_FTQ_RESET, 0xFFFFFFFF);
+ (void)READCSR(sc, R_FTQ_RESET); /* push */
+ cfe_sleep(1);
+ WRITECSR(sc, R_FTQ_RESET, 0x00000000);
+
+ return 0;
+}
+
+static int
+t3_init_rings(t3_ether_t *sc)
+{
+ unsigned rcbp;
+ int i;
+
+ /* Steps 37-46 */
+
+ /* Initialize RCBs for Standard Receive Buffer Ring (37) */
+ WRITECSR(sc, R_STD_RCV_BD_RCB+RCB_HOST_ADDR_HIGH, 0);
+ WRITECSR(sc, R_STD_RCV_BD_RCB+RCB_HOST_ADDR_LOW, PTR_TO_PCI(sc->rxp_std));
+ WRITECSR(sc, R_STD_RCV_BD_RCB+RCB_CTRL, V_RCB_MAXLEN(ETH_PKTBUF_LEN));
+ WRITECSR(sc, R_STD_RCV_BD_RCB+RCB_NIC_ADDR, A_STD_RCV_RINGS);
+
+ /* Disable RCBs for Jumbo and Mini Receive Buffer Rings (38,39) */
+ WRITECSR(sc, R_JUMBO_RCV_BD_RCB+RCB_CTRL,
+ RCB_FLAG_USE_EXT_RCV_BD | RCB_FLAG_RING_DISABLED);
+ WRITECSR(sc, R_JUMBO_RCV_BD_RCB+RCB_NIC_ADDR, A_JUMBO_RCV_RINGS);
+ WRITECSR(sc, R_MINI_RCV_BD_RCB+RCB_CTRL, RCB_FLAG_RING_DISABLED);
+ WRITECSR(sc, R_MINI_RCV_BD_RCB+RCB_NIC_ADDR, 0xe000);
+
+ /* Set BD ring replenish thresholds (40) */
+ WRITECSR(sc, R_MINI_RCV_BD_THRESH, 128);
+#if T3_BRINGUP
+ WRITECSR(sc, R_STD_RCV_BD_THRESH, 1);
+#else
+ WRITECSR(sc, R_STD_RCV_BD_THRESH, 25);
+#endif
+ WRITECSR(sc, R_JUMBO_RCV_BD_THRESH, 16);
+
+ /* Disable unused send producer rings 2-16 (41) */
+ for (rcbp = A_SND_RCB(1); rcbp <= A_SND_RCB(16); rcbp += RCB_SIZE)
+ WRITEMEM(sc, rcbp+RCB_CTRL, RCB_FLAG_RING_DISABLED);
+
+ /* Initialize send producer index registers (42) */
+ for (i = 1; i <= TXP_MAX_RINGS; i++) {
+ WRITEMBOX(sc, R_SND_BD_PI(i), 0);
+ WRITEMBOX(sc, R_SND_BD_NIC_PI(i), 0);
+ }
+
+ /* Initialize send producer ring 1 (43) */
+ WRITEMEM(sc, A_SND_RCB(1)+RCB_HOST_ADDR_HIGH, 0);
+ WRITEMEM(sc, A_SND_RCB(1)+RCB_HOST_ADDR_LOW, PTR_TO_PCI(sc->txp_1));
+ WRITEMEM(sc, A_SND_RCB(1)+RCB_CTRL, V_RCB_MAXLEN(TXP_RING_ENTRIES));
+ WRITEMEM(sc, A_SND_RCB(1)+RCB_NIC_ADDR, A_SND_RINGS);
+
+ /* Disable unused receive return rings (44) */
+ for (rcbp = A_RTN_RCB(1); rcbp <= A_RTN_RCB(16); rcbp += RCB_SIZE)
+ WRITEMEM(sc, rcbp+RCB_CTRL, RCB_FLAG_RING_DISABLED);
+
+ /* Initialize receive return ring 1 (45) */
+ WRITEMEM(sc, A_RTN_RCB(1)+RCB_HOST_ADDR_HIGH, 0);
+ WRITEMEM(sc, A_RTN_RCB(1)+RCB_HOST_ADDR_LOW, PTR_TO_PCI(sc->rxr_1));
+ WRITEMEM(sc, A_RTN_RCB(1)+RCB_CTRL, V_RCB_MAXLEN(sc->rxr_entries));
+ WRITEMEM(sc, A_RTN_RCB(1)+RCB_NIC_ADDR, 0x0000);
+
+ /* Initialize receive producer ring mailboxes (46) */
+ WRITEMBOX(sc, R_RCV_BD_STD_PI, 0);
+ WRITEMBOX(sc, R_RCV_BD_JUMBO_PI, 0);
+ WRITEMBOX(sc, R_RCV_BD_MINI_PI, 0);
+
+ return 0;
+}
+
+static int
+t3_configure_mac(t3_ether_t *sc)
+{
+ uint32_t low, high;
+ uint32_t seed;
+ int i;
+
+ /* Steps 47-52 */
+
+ /* Configure the MAC unicast address (47) */
+ high = (sc->hwaddr[0] << 8) | (sc->hwaddr[1]);
+ low = ((sc->hwaddr[2] << 24) | (sc->hwaddr[3] << 16)
+ | (sc->hwaddr[4] << 8) | sc->hwaddr[5]);
+ /* For now, use a single MAC address */
+ WRITECSR(sc, R_MAC_ADDR1_HIGH, high); WRITECSR(sc, R_MAC_ADDR1_LOW, low);
+ WRITECSR(sc, R_MAC_ADDR2_HIGH, high); WRITECSR(sc, R_MAC_ADDR2_LOW, low);
+ WRITECSR(sc, R_MAC_ADDR3_HIGH, high); WRITECSR(sc, R_MAC_ADDR3_LOW, low);
+ WRITECSR(sc, R_MAC_ADDR4_HIGH, high); WRITECSR(sc, R_MAC_ADDR4_LOW, low);
+
+ /* Configure the random backoff seed (48) */
+ seed = 0;
+ for (i = 0; i < 6; i++)
+ seed += sc->hwaddr[i];
+ seed &= 0x3FF;
+ WRITECSR(sc, R_TX_BACKOFF, seed);
+
+ /* Configure the MTU (49) */
+ WRITECSR(sc, R_RX_MTU, MAX_ETHER_PACK+VLAN_TAG_LEN);
+
+ /* Configure the tx IPG (50) */
+ WRITECSR(sc, R_TX_LENS,
+ V_TXLEN_SLOT(0x20) | V_TXLEN_IPG(0x6) | V_TXLEN_IPGCRS(0x2));
+
+ /* Configure the default rx return ring 1 (51) */
+ WRITECSR(sc, R_RX_RULES_CFG, V_RULESCFG_DEFAULT(1));
+
+ /* Configure the receive lists and enable statistics (52) */
+ WRITECSR(sc, R_RCV_LIST_CFG,
+ V_LISTCFG_GROUP(1) | V_LISTCFG_ACTIVE(1) | V_LISTCFG_BAD(1));
+ /* was V_LISTCFG_DEFAULT(1) | V_LISTCFG_ACTIVE(16) | V_LISTCFG_BAD(1) */
+
+ return 0;
+}
+
+static int
+t3_enable_stats(t3_ether_t *sc)
+{
+ uint32_t ctrl;
+
+ /* Steps 53-56 */
+
+ /* Enable rx stats (53,54) */
+ WRITECSR(sc, R_RCV_LIST_STATS_ENB, 0xFFFFFF);
+ ctrl = READCSR(sc, R_RCV_LIST_STATS_CTRL);
+ ctrl |= M_STATS_ENABLE;
+ WRITECSR(sc, R_RCV_LIST_STATS_CTRL, ctrl);
+
+ /* Enable tx stats (55,56) */
+ WRITECSR(sc, R_SND_DATA_STATS_ENB, 0xFFFFFF);
+ ctrl = READCSR(sc, R_SND_DATA_STATS_CTRL);
+ ctrl |= (M_STATS_ENABLE | M_STATS_FASTUPDATE);
+ WRITECSR(sc, R_SND_DATA_STATS_CTRL, ctrl);
+
+ return 0;
+}
+
+static int
+t3_init_coalescing(t3_ether_t *sc)
+{
+ uint32_t mode;
+ int timeout;
+
+ /* Steps 57-68 */
+
+ /* Disable the host coalescing engine (57, 58) */
+ WRITECSR(sc, R_HOST_COAL_MODE, 0);
+ for (timeout = CFE_HZ/2; timeout > 0; timeout -= CFE_HZ/10) {
+ mode = READCSR(sc, R_HOST_COAL_MODE);
+ if (mode == 0)
+ break;
+ cfe_sleep(CFE_HZ/10);
+ }
+ if (mode != 0)
+ xprintf("bcm5700: coalescing engine not disabled\n");
+
+ /* Set coalescing parameters (59-62) */
+#if T3_BRINGUP
+ WRITECSR(sc, R_RCV_COAL_TICKS, 0);
+ WRITECSR(sc, R_RCV_COAL_MAX_CNT, 1);
+#else
+ WRITECSR(sc, R_RCV_COAL_TICKS, 150);
+ WRITECSR(sc, R_RCV_COAL_MAX_CNT, 10);
+#endif
+ WRITECSR(sc, R_RCV_COAL_INT_TICKS, 0);
+ WRITECSR(sc, R_RCV_COAL_INT_CNT, 0);
+#if T3_BRINGUP
+ WRITECSR(sc, R_SND_COAL_TICKS, 0);
+ WRITECSR(sc, R_SND_COAL_MAX_CNT, 1);
+#else
+ WRITECSR(sc, R_SND_COAL_TICKS, 150);
+ WRITECSR(sc, R_SND_COAL_MAX_CNT, 10);
+#endif
+ WRITECSR(sc, R_SND_COAL_INT_TICKS, 0);
+ WRITECSR(sc, R_SND_COAL_INT_CNT, 0);
+
+ /* Initialize host status block address (63) */
+ WRITECSR(sc, R_STATUS_HOST_ADDR, 0);
+ WRITECSR(sc, R_STATUS_HOST_ADDR+4, PTR_TO_PCI(sc->status));
+
+ /* Initialize host statistics block address (64) */
+ WRITECSR(sc, R_STATS_HOST_ADDR, 0);
+ WRITECSR(sc, R_STATS_HOST_ADDR+4, PTR_TO_PCI(sc->stats));
+
+ /* Set statistics block NIC address and tick count (65, 66) */
+ WRITECSR(sc, R_STATS_TICKS, 1000000);
+ WRITECSR(sc, R_STATS_BASE_ADDR, A_MAC_STATS);
+
+ /* Set status block NIC address (67) */
+ WRITECSR(sc, R_STATUS_BASE_ADDR, A_MAC_STATUS);
+
+ /* Enable the host coalescing engine (68) */
+ WRITECSR(sc, R_HOST_COAL_MODE, M_HCM_ENABLE);
+
+ return 0;
+}
+
+static int
+t3_init_dma(t3_ether_t *sc)
+{
+ uint32_t mode;
+
+ /* Steps 69-87 */
+
+ /* Enable receive BD completion, placement, and selector blocks (69-71) */
+ WRITECSR(sc, R_RCV_BD_COMP_MODE, M_MODE_ENABLE | M_MODE_ATTNENABLE);
+ WRITECSR(sc, R_RCV_LIST_MODE, M_MODE_ENABLE);
+ if (sc->device != K_PCI_ID_BCM5705) {
+ WRITECSR(sc, R_RCV_LIST_SEL_MODE, M_MODE_ENABLE | M_MODE_ATTNENABLE);
+ }
+
+ /* Enable DMA engines, enable and clear statistics (72, 73) */
+ mode = READCSR(sc, R_MAC_MODE);
+ mode |= (M_MACM_FHDEENB | M_MACM_RDEENB | M_MACM_TDEENB |
+ M_MACM_RXSTATSENB | M_MACM_RXSTATSCLR |
+ M_MACM_TXSTATSENB | M_MACM_TXSTATSCLR);
+#if T3_AUTOPOLL
+ mode |= V_MACM_PORTMODE(K_MACM_PORTMODE_MII);
+#endif
+
+ WRITECSR(sc, R_MAC_MODE, mode);
+
+#if T3_AUTOPOLL
+ WRITECSR(sc, R_MISC_LOCAL_CTRL, M_MLCTL_INTATTN);
+#endif
+
+ /* Configure GPIOs (74) - skipped */
+
+ /* Clear interrupt mailbox (75) */
+ WRITEMBOX(sc, R_INT_MBOX(0), 0);
+
+ /* Enable DMA completion block (76) */
+ if (sc->device != K_PCI_ID_BCM5705) {
+ WRITECSR(sc, R_DMA_COMP_MODE, M_MODE_ENABLE);
+ }
+
+ /* Configure write and read DMA modes (77, 78) */
+ WRITECSR(sc, R_WR_DMA_MODE, M_MODE_ENABLE | M_ATTN_ALL);
+ WRITECSR(sc, R_RD_DMA_MODE, M_MODE_ENABLE | M_ATTN_ALL);
+
+ return 0;
+}
+
+static int
+t3_init_enable(t3_ether_t *sc)
+{
+ uint32_t mhc;
+ uint32_t pmcs;
+#if T3_AUTOPOLL
+ uint32_t mode, mask;
+#else
+ int i;
+#endif
+
+ /* Steps 79-97 */
+
+ /* Enable completion functional blocks (79-82) */
+ WRITECSR(sc, R_RCV_COMP_MODE, M_MODE_ENABLE | M_MODE_ATTNENABLE);
+ if (sc->device != K_PCI_ID_BCM5705) {
+ WRITECSR(sc, R_MBUF_FREE_MODE, M_MODE_ENABLE);
+ }
+ WRITECSR(sc, R_SND_DATA_COMP_MODE, M_MODE_ENABLE);
+ WRITECSR(sc, R_SND_BD_COMP_MODE, M_MODE_ENABLE | M_MODE_ATTNENABLE);
+
+ /* Enable initiator functional blocks (83-86) */
+ WRITECSR(sc, R_RCV_BD_INIT_MODE, M_MODE_ENABLE | M_MODE_ATTNENABLE);
+ WRITECSR(sc, R_RCV_DATA_INIT_MODE, M_MODE_ENABLE | M_RCVINITMODE_RTNSIZE);
+ WRITECSR(sc, R_SND_DATA_MODE, M_MODE_ENABLE);
+ WRITECSR(sc, R_SND_BD_INIT_MODE, M_MODE_ENABLE | M_MODE_ATTNENABLE);
+
+ /* Enable the send BD selector (87) */
+ WRITECSR(sc, R_SND_BD_SEL_MODE, M_MODE_ENABLE | M_MODE_ATTNENABLE);
+
+ /* Download firmware (88) - skipped */
+
+ /* Enable the MAC (89,90) */
+ WRITECSR(sc, R_TX_MODE, M_MODE_ENABLE); /* optional flow control */
+ WRITECSR(sc, R_RX_MODE, M_MODE_ENABLE); /* other options */
+
+ /* Disable auto-polling (91) */
+ mii_access_init(sc);
+
+ /* Configure power state (92) */
+ pmcs = READCSR(sc, PCI_PMCSR_REG);
+ pmcs &= ~PCI_PMCSR_STATE_MASK;
+ pmcs |= PCI_PMCSR_STATE_D0;
+ WRITECSR(sc, PCI_PMCSR_REG, pmcs);
+
+#if T3_AUTOPOLL
+ /* Program hardware LED control (93) */
+ WRITECSR(sc, R_MAC_LED_CTRL, 0x00); /* LEDs at PHY layer */
+#endif
+
+#if T3_AUTOPOLL
+ /* Ack/clear link change events */
+ WRITECSR(sc, R_MAC_STATUS, M_LINKCHNG_CLR);
+ WRITECSR(sc, R_MI_STATUS, 0);
+
+ /* Enable autopolling */
+ mode = READCSR(sc, R_MI_MODE);
+ mode |= M_MIMODE_POLLING | 0x000c000;
+ WRITECSR(sc, R_MI_MODE, mode);
+
+ /* Enable link state attentions */
+ mask = READCSR(sc, R_MAC_EVENT_ENB);
+ mask |= M_EVT_LINKCHNG;
+ WRITECSR(sc, R_MAC_EVENT_ENB, mask);
+#else
+ /* Initialize link (94) */
+ WRITECSR(sc, R_MI_STATUS, M_MISTAT_LINKED);
+
+ /* Start autonegotiation (95) - see t3_initlink below */
+
+ /* Setup multicast filters (96) */
+ for (i = 0; i < 4; i++)
+ WRITECSR(sc, R_MAC_HASH(i), 0);
+#endif /* T3_AUTOPOLL */
+
+ /* Enable interrupts (97) */
+ mhc = READCSR(sc, R_MISC_HOST_CTRL);
+ mhc &= ~M_MHC_MASKPCIINT;
+ WRITECSR(sc, R_MISC_HOST_CTRL, mhc);
+
+ return 0;
+}
+
+
+static void
+t3_initlink(t3_ether_t *sc)
+{
+ uint32_t mcr;
+
+ sc->phy_addr = mii_probe(sc);
+ if (sc->phy_addr < 0) {
+ xprintf("%s: no PHY found\n", t3_devname(sc));
+ return;
+ }
+#if T3_DEBUG
+ xprintf("%s: PHY addr %d\n", t3_devname(sc), sc->phy_addr);
+#endif
+ if (1) /* XXX Support only autonegotiation for now */
+ mii_autonegotiate(sc);
+ else
+ mii_set_speed(sc, ETHER_SPEED_10HDX);
+
+ mii_enable_interrupts(sc);
+
+ mcr = READCSR(sc, R_MODE_CTRL);
+ mcr |= M_MCTL_MACINT;
+ WRITECSR(sc, R_MODE_CTRL, mcr);
+
+ sc->mii_polling = 0;
+ sc->phy_change = 0;
+}
+
+static void
+t3_shutdownlink(t3_ether_t *sc)
+{
+ uint32_t mcr;
+
+ mcr = READCSR(sc, R_MODE_CTRL);
+ mcr &= ~M_MCTL_MACINT;
+ WRITECSR(sc, R_MODE_CTRL, mcr);
+
+ WRITECSR(sc, R_MAC_EVENT_ENB, 0);
+
+ /* The manual is fuzzy about what to do with the PHY at this
+ point. Empirically, resetting the 5705 PHY (but not others)
+ will cause it to get stuck in 10/100 MII mode. */
+ if (sc->device != K_PCI_ID_BCM5705)
+ mii_write_register(sc, sc->phy_addr, MII_BMCR, BMCR_RESET);
+
+ sc->mii_polling = 0;
+ sc->phy_change = 0;
+}
+
+
+static void
+t3_hwinit(t3_ether_t *sc)
+{
+ if (sc->state != eth_state_on) {
+
+ if (sc->state == eth_state_uninit) {
+ WRITECSR(sc, R_MEMWIN_BASE_ADDR, 0); /* Default memory window */
+ t3_coldreset(sc);
+ }
+ else
+ t3_warmreset(sc);
+
+ t3_init_registers(sc);
+ t3_init_pools(sc);
+ t3_init_rings(sc);
+ t3_configure_mac(sc);
+ t3_enable_stats(sc);
+ t3_init_coalescing(sc);
+ t3_init_dma(sc);
+ t3_init_enable(sc);
+#if T3_DEBUG
+ dumpcsrs(sc, "end init");
+#else
+ (void)dumpcsrs;
+#endif
+
+ eeprom_access_init(sc);
+#if T3_DEBUG
+ {
+ uint32_t eeprom[0x100/4];
+ int i;
+
+ cfe_sleep(1);
+ /* XXX Apparently a few reads can be required to get the
+ AutoAccess logic into a good state. ??? */
+ for (i = 0; i < 4; i++) {
+ eeprom_read_range(sc, 0, 4, eeprom);
+ }
+
+ eeprom_read_range(sc, 0, sizeof(eeprom), eeprom);
+ eeprom_dump_range("Boot Strap", eeprom, 0x00, 20);
+ eeprom_dump_range("Manufacturing Info", eeprom, 0x74, 140);
+ }
+#else
+ (void)eeprom_read_range;
+ (void)eeprom_dump_range;
+#endif
+
+ t3_initlink(sc);
+
+ sc->state = eth_state_off;
+ }
+}
+
+static void
+t3_hwshutdown(t3_ether_t *sc)
+{
+ /* Receive path shutdown */
+ t3_clear(sc, R_RX_MODE, M_MODE_ENABLE);
+ t3_clear(sc, R_RCV_BD_INIT_MODE, M_MODE_ENABLE);
+ t3_clear(sc, R_RCV_LIST_MODE, M_MODE_ENABLE);
+ if (sc->device != K_PCI_ID_BCM5705) {
+ t3_clear(sc, R_RCV_LIST_SEL_MODE, M_MODE_ENABLE);
+ }
+ t3_clear(sc, R_RCV_DATA_INIT_MODE, M_MODE_ENABLE);
+ t3_clear(sc, R_RCV_COMP_MODE, M_MODE_ENABLE);
+ t3_clear(sc, R_RCV_BD_COMP_MODE, M_MODE_ENABLE);
+
+ /* Transmit path shutdown */
+ t3_clear(sc, R_SND_BD_SEL_MODE, M_MODE_ENABLE);
+ t3_clear(sc, R_SND_BD_INIT_MODE, M_MODE_ENABLE);
+ t3_clear(sc, R_SND_DATA_MODE, M_MODE_ENABLE);
+ t3_clear(sc, R_RD_DMA_MODE, M_MODE_ENABLE);
+ t3_clear(sc, R_SND_DATA_COMP_MODE, M_MODE_ENABLE);
+ if (sc->device != K_PCI_ID_BCM5705) {
+ t3_clear(sc, R_DMA_COMP_MODE, M_MODE_ENABLE);
+ }
+ t3_clear(sc, R_SND_BD_COMP_MODE, M_MODE_ENABLE);
+ t3_clear(sc, R_TX_MODE, M_MODE_ENABLE);
+
+ /* Memory shutdown */
+ t3_clear(sc, R_HOST_COAL_MODE, M_HCM_ENABLE);
+ t3_clear(sc, R_WR_DMA_MODE, M_MODE_ENABLE);
+ if (sc->device != K_PCI_ID_BCM5705) {
+ t3_clear(sc, R_MBUF_FREE_MODE, M_MODE_ENABLE);
+ }
+ WRITECSR(sc, R_FTQ_RESET, 0xFFFFFFFF);
+ cfe_sleep(1);
+ WRITECSR(sc, R_FTQ_RESET, 0x00000000);
+ t3_clear(sc, R_BMGR_MODE, M_BMODE_ENABLE);
+ t3_clear(sc, R_MEM_MODE, M_MAM_ENABLE);
+
+ t3_shutdownlink(sc);
+
+ WRITECSR(sc, R_MEMWIN_BASE_ADDR, 0); /* Default memory window */
+ t3_coldreset(sc);
+
+ sc->state = eth_state_uninit;
+}
+
+
+static void
+t3_isr(void *arg)
+{
+ t3_ether_t *sc = (t3_ether_t *)arg;
+ volatile t3_status_t *status = sc->status;
+ uint32_t mac_status;
+ int handled;
+
+ do {
+ WRITEMBOX(sc, R_INT_MBOX(0), 1);
+
+ handled = 0;
+ mac_status = READCSR(sc, R_MAC_STATUS); /* force ordering */
+ status->status &= ~M_STATUS_UPDATED;
+
+ if (status->index[RI(1)].return_p != sc->rxr_1_index) {
+ handled = 1;
+ if (IPOLL) sc->rx_interrupts++;
+ t3_procrxring(sc);
+ }
+
+ if (status->index[RI(1)].send_c != sc->txc_1_index) {
+ handled = 1;
+ if (IPOLL) sc->tx_interrupts++;
+ t3_proctxring(sc);
+ }
+
+ if ((status->status & M_STATUS_LINKCHNG) != 0) {
+ handled = 1;
+#if T3_AUTOPOLL
+ WRITECSR(sc, R_MAC_STATUS, M_LINKCHNG_CLR);
+#endif
+ WRITECSR(sc, R_MAC_STATUS, M_EVT_MICOMPLETE);
+
+ status->status &= ~M_STATUS_LINKCHNG;
+ sc->phy_change = 1;
+ }
+
+ WRITEMBOX(sc, R_INT_MBOX(0), 0);
+ (void)READMBOX(sc, R_INT_MBOX(0)); /* push */
+
+#if (!XPOLL)
+ if (!handled)
+ sc->bogus_interrupts++;
+#endif
+
+ } while ((status->status & M_STATUS_UPDATED) != 0);
+
+ if (sc->rxp_std_index != sc->prev_rxp_std_index) {
+ sc->prev_rxp_std_index = sc->rxp_std_index;
+ WRITEMBOX(sc, R_RCV_BD_STD_PI, sc->rxp_std_index);
+ }
+}
+
+
+static void
+t3_start(t3_ether_t *sc)
+{
+ t3_hwinit(sc);
+
+ sc->intmask = 0;
+
+#if IPOLL
+ cfe_request_irq(sc->irq, t3_isr, sc, CFE_IRQ_FLAGS_SHARED, 0);
+
+#if T3_AUTOPOLL
+ sc->intmask |= M_EVT_LINKCHNG;
+#else
+ sc->intmask |= M_EVT_LINKCHNG | M_EVT_MIINT;
+#endif
+ WRITECSR(sc, R_MAC_EVENT_ENB, sc->intmask);
+#endif
+
+ /* Post some Rcv Producer buffers */
+ sc->prev_rxp_std_index = sc->rxp_std_index;
+ WRITEMBOX(sc, R_RCV_BD_STD_PI, sc->rxp_std_index);
+
+ sc->state = eth_state_on;
+}
+
+static void
+t3_stop(t3_ether_t *sc)
+{
+ WRITECSR(sc, R_MAC_EVENT_ENB, 0);
+ sc->intmask = 0;
+#if IPOLL
+ cfe_free_irq(sc->irq, 0);
+#endif
+
+ if (sc->state == eth_state_on) {
+ sc->state = eth_state_off;
+ t3_hwshutdown(sc);
+ t3_reinit(sc);
+ }
+}
+
+
+static int t3_ether_open(cfe_devctx_t *ctx);
+static int t3_ether_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int t3_ether_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat);
+static int t3_ether_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int t3_ether_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int t3_ether_close(cfe_devctx_t *ctx);
+static void t3_ether_poll(cfe_devctx_t *ctx, int64_t ticks);
+static void t3_ether_reset(void *softc);
+
+const static cfe_devdisp_t t3_ether_dispatch = {
+ t3_ether_open,
+ t3_ether_read,
+ t3_ether_inpstat,
+ t3_ether_write,
+ t3_ether_ioctl,
+ t3_ether_close,
+ t3_ether_poll,
+ t3_ether_reset
+};
+
+cfe_driver_t bcm5700drv = {
+ "BCM570x Ethernet",
+ "eth",
+ CFE_DEV_NETWORK,
+ &t3_ether_dispatch,
+ t3_ether_probe
+};
+
+
+static void
+t3_delete_sc(t3_ether_t *sc)
+{
+ xprintf("BCM570x attach: No memory to complete probe\n");
+ if (sc != NULL) {
+ if (sc->txp_1 != NULL)
+ KFREE(sc->txp_1);
+ if (sc->rxr_1 != NULL)
+ KFREE(sc->rxr_1);
+ if (sc->rxp_std != NULL)
+ KFREE(sc->rxp_std);
+ if (sc->stats != NULL)
+ KFREE(sc->stats);
+ if (sc->status != NULL)
+ KFREE((t3_ether_t *)sc->status);
+ KFREE(sc);
+ }
+}
+
+static int
+t3_ether_attach(cfe_driver_t *drv, pcitag_t tag, int index)
+{
+ t3_ether_t *sc;
+ char descr[80];
+ phys_addr_t pa;
+ uint32_t base;
+ uint32_t pcictrl;
+ uint32_t addr;
+ pcireg_t device, class;
+ const char *devname;
+ int i;
+
+ pci_map_mem(tag, PCI_MAPREG(0), PCI_MATCH_BITS, &pa);
+ base = (uint32_t)pa;
+
+ sc = (t3_ether_t *) KMALLOC(sizeof(t3_ether_t), 0);
+ if (sc == NULL) {
+ t3_delete_sc(sc);
+ return 0;
+ }
+
+ memset(sc, 0, sizeof(*sc));
+
+ sc->status = NULL;
+ sc->stats = NULL;
+
+ device = pci_conf_read(tag, PCI_ID_REG);
+ class = pci_conf_read(tag, PCI_CLASS_REG);
+ sc->tag = tag;
+ sc->device = PCI_PRODUCT(device);
+ sc->revision = PCI_REVISION(class);
+
+ sc->status = (t3_status_t *) KMALLOC(sizeof(t3_status_t), CACHE_ALIGN);
+ if (sc->status == NULL) {
+ t3_delete_sc(sc);
+ return 0;
+ }
+
+ sc->stats = (t3_stats_t *) KMALLOC(sizeof(t3_stats_t), CACHE_ALIGN);
+ if (sc->stats == NULL) {
+ t3_delete_sc(sc);
+ return 0;
+ }
+
+ if (sc->device == K_PCI_ID_BCM5705)
+ sc->rxr_entries = RXR_RING_ENTRIES_05;
+ else
+ sc->rxr_entries = RXR_RING_ENTRIES;
+
+ sc->rxp_std =
+ (t3_rcv_bd_t *) KMALLOC(RXP_STD_ENTRIES*RCV_BD_SIZE, CACHE_ALIGN);
+ sc->rxr_1 =
+ (t3_rcv_bd_t *) KMALLOC(sc->rxr_entries*RCV_BD_SIZE, CACHE_ALIGN);
+ sc->txp_1 =
+ (t3_snd_bd_t *) KMALLOC(TXP_RING_ENTRIES*SND_BD_SIZE, CACHE_ALIGN);
+ if (sc->rxp_std == NULL || sc->rxr_1 == NULL || sc->txp_1 == NULL) {
+ t3_delete_sc(sc);
+ return 0;
+ }
+
+ sc->regbase = base;
+
+ /* NB: the relative base of memory depends on the access model */
+ pcictrl = pci_conf_read(tag, R_PCI_STATE);
+#if 0 /* XXX This gets spontaneously reset somehow! */
+ if ((pcictrl & M_PCIS_FLATVIEW) != 0)
+ sc->membase = base + 0x01000000; /* Flat mode */
+ else
+#endif
+ sc->membase = base + 0x8000; /* Normal mode: 32K window */
+
+ sc->irq = pci_conf_read(tag, PCI_BPARAM_INTERRUPT_REG) & 0xFF;
+
+ sc->devctx = NULL;
+
+ /* Assume on-chip firmware has initialized the MAC address. */
+ addr = READCSR(sc, R_MAC_ADDR1_HIGH);
+ for (i = 0; i < 2; i++)
+ sc->hwaddr[i] = (addr >> (8*(1-i))) & 0xff;
+ addr = READCSR(sc, R_MAC_ADDR1_LOW);
+ for (i = 0; i < 4; i++)
+ sc->hwaddr[2+i] = (addr >> (8*(3-i))) & 0xff;
+
+ t3_init(sc);
+
+ sc->state = eth_state_uninit;
+
+ switch (sc->device) {
+ case K_PCI_ID_BCM5700:
+ devname = "BCM5700"; break;
+ case K_PCI_ID_BCM5701:
+ devname = "BCM5701"; break;
+ case K_PCI_ID_BCM5702:
+ devname = "BCM5702"; break;
+ case K_PCI_ID_BCM5703:
+ devname = "BCM5703"; break;
+ case K_PCI_ID_BCM5705:
+ devname = "BCM5705"; break;
+ default:
+ devname = "BCM570x"; break;
+ }
+ xsprintf(descr, "%s Ethernet at 0x%X (%02X-%02X-%02X-%02X-%02X-%02X)",
+ devname, sc->regbase,
+ sc->hwaddr[0], sc->hwaddr[1], sc->hwaddr[2],
+ sc->hwaddr[3], sc->hwaddr[4], sc->hwaddr[5]);
+
+ cfe_attach(drv, sc, NULL, descr);
+ return 1;
+}
+
+static void
+t3_ether_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr)
+{
+ int index;
+ int n;
+
+ n = 0;
+ index = 0;
+ for (;;) {
+ pcitag_t tag;
+ pcireg_t device;
+
+ if (pci_find_class(PCI_CLASS_NETWORK, index, &tag) != 0)
+ break;
+
+ index++;
+
+ device = pci_conf_read(tag, PCI_ID_REG);
+ if (PCI_VENDOR(device) == K_PCI_VENDOR_BROADCOM) {
+ switch (PCI_PRODUCT(device)) {
+ case K_PCI_ID_BCM5700:
+ case K_PCI_ID_BCM5701:
+ case K_PCI_ID_BCM5702:
+ case K_PCI_ID_BCM5703:
+ case K_PCI_ID_BCM5705:
+ t3_ether_attach(drv, tag, n);
+ n++;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+}
+
+
+/* The functions below are called via the dispatch vector for the Tigon 3 */
+
+static int
+t3_ether_open(cfe_devctx_t *ctx)
+{
+ t3_ether_t *sc = ctx->dev_softc;
+ t3_stats_t *stats = sc->stats;
+ int i;
+
+ if (sc->state == eth_state_on)
+ t3_stop(sc);
+
+ sc->devctx = ctx;
+
+ sc->rx_interrupts = sc->tx_interrupts = sc->bogus_interrupts = 0;
+ for (i = 0; i < L_MAC_STATS/sizeof(uint64_t); i++)
+ stats->stats[i] = 0;
+
+ t3_start(sc);
+
+ if (XPOLL) t3_isr(sc);
+ return 0;
+}
+
+static int
+t3_ether_read(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ t3_ether_t *sc = ctx->dev_softc;
+ eth_pkt_t *pkt;
+ int blen;
+
+ if (XPOLL) t3_isr(sc);
+
+ if (sc->state != eth_state_on) return -1;
+
+ CS_ENTER(sc);
+ pkt = (eth_pkt_t *) q_deqnext(&(sc->rxqueue));
+ CS_EXIT(sc);
+
+ if (pkt == NULL) {
+ buffer->buf_retlen = 0;
+ return 0;
+ }
+
+ blen = buffer->buf_length;
+ if (blen > pkt->length) blen = pkt->length;
+
+ blockcopy(buffer->buf_ptr, pkt->buffer, blen);
+ buffer->buf_retlen = blen;
+
+ eth_free_pkt(sc, pkt);
+
+ if (XPOLL) t3_isr(sc);
+ return 0;
+}
+
+static int
+t3_ether_inpstat(cfe_devctx_t *ctx, iocb_inpstat_t *inpstat)
+{
+ t3_ether_t *sc = ctx->dev_softc;
+
+ if (XPOLL) t3_isr(sc);
+
+ if (sc->state != eth_state_on) return -1;
+
+ /* We avoid an interlock here because the result is a hint and an
+ interrupt cannot turn a non-empty queue into an empty one. */
+ inpstat->inp_status = (q_isempty(&(sc->rxqueue))) ? 0 : 1;
+
+ return 0;
+}
+
+static int
+t3_ether_write(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ t3_ether_t *sc = ctx->dev_softc;
+ eth_pkt_t *pkt;
+ int blen;
+
+ if (XPOLL) t3_isr(sc);
+
+ if (sc->state != eth_state_on) return -1;
+
+ pkt = eth_alloc_pkt(sc);
+ if (!pkt) return CFE_ERR_NOMEM;
+
+ blen = buffer->buf_length;
+ if (blen > pkt->length) blen = pkt->length;
+
+ blockcopy(pkt->buffer, buffer->buf_ptr, blen);
+ pkt->length = blen;
+
+ if (t3_transmit(sc, pkt) != 0) {
+ eth_free_pkt(sc,pkt);
+ return CFE_ERR_IOERR;
+ }
+
+ if (XPOLL) t3_isr(sc);
+ return 0;
+}
+
+static int
+t3_ether_ioctl(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ t3_ether_t *sc = ctx->dev_softc;
+
+ switch ((int)buffer->buf_ioctlcmd) {
+ case IOCTL_ETHER_GETHWADDR:
+ memcpy(buffer->buf_ptr, sc->hwaddr, sizeof(sc->hwaddr));
+ return 0;
+
+ default:
+ return -1;
+ }
+}
+
+static int
+t3_ether_close(cfe_devctx_t *ctx)
+{
+ t3_ether_t *sc = ctx->dev_softc;
+ t3_stats_t *stats = sc->stats;
+ uint32_t inpkts, outpkts, interrupts;
+ int i;
+
+ t3_stop(sc);
+
+#if T3_BRINGUP
+ for (i = 0; i < L_MAC_STATS/sizeof(uint64_t); i++) {
+ if (stats->stats[i] != 0)
+ xprintf(" stats[%d] = %8lld\n", i, stats->stats[i]);
+ }
+#else
+ (void) i;
+#endif
+
+ inpkts = stats->stats[ifHCInUcastPkts]
+ + stats->stats[ifHCInMulticastPkts]
+ + stats->stats[ifHCInBroadcastPkts];
+ outpkts = stats->stats[ifHCOutUcastPkts]
+ + stats->stats[ifHCOutMulticastPkts]
+ + stats->stats[ifHCOutBroadcastPkts];
+ interrupts = stats->stats[nicInterrupts];
+
+ /* Empirically, counters on the 5705 are always zero. */
+ if (sc->device != K_PCI_ID_BCM5705) {
+ xprintf("%s: %d sent, %d received, %d interrupts\n",
+ t3_devname(sc), outpkts, inpkts, interrupts);
+ if (IPOLL) {
+ xprintf(" %d rx interrupts, %d tx interrupts",
+ sc->rx_interrupts, sc->tx_interrupts);
+ if (sc->bogus_interrupts != 0)
+ xprintf(", %d bogus interrupts", sc->bogus_interrupts);
+ xprintf("\n");
+ }
+ }
+
+ sc->devctx = NULL;
+ return 0;
+}
+
+static void
+t3_ether_poll(cfe_devctx_t *ctx, int64_t ticks)
+{
+ t3_ether_t *sc = ctx->dev_softc;
+ int changed;
+
+ if (sc->phy_change && sc->state != eth_state_uninit && !sc->mii_polling) {
+ uint32_t mask;
+
+ sc->mii_polling++;
+ mask = READCSR(sc, R_MAC_EVENT_ENB);
+ WRITECSR(sc, R_MAC_EVENT_ENB, 0);
+
+ changed = mii_poll(sc);
+ if (changed) {
+ mii_autonegotiate(sc);
+ }
+ sc->phy_change = 0;
+ sc->mii_polling--;
+
+ WRITECSR(sc, R_MAC_EVENT_ENB, mask);
+ }
+}
+
+static void
+t3_ether_reset(void *softc)
+{
+ t3_ether_t *sc = (t3_ether_t *)softc;
+
+ /* Turn off the Ethernet interface. */
+
+ if (sc->state == eth_state_on)
+ t3_stop(sc);
+
+ sc->state = eth_state_uninit;
+}
diff --git a/cfe/cfe/dev/dev_bcm5821.c b/cfe/cfe/dev/dev_bcm5821.c
new file mode 100644
index 0000000..3dede0f
--- /dev/null
+++ b/cfe/cfe/dev/dev_bcm5821.c
@@ -0,0 +1,1592 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * BC5821 crypto accelerator driver File: dev_bcm5821.c
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+/*
+ CFE Driver plus test programs for the BCM5820 and BCM5821 crypto
+ coprocessor chips.
+ Reference:
+ BCM5821 Super-eCommerce Processor
+ Data Sheet 5821-DS105-D1 (draft, 7/26/02)
+ Broadcom Corp., 16215 Alton Parkway, Irvine, CA.
+*/
+
+/* The performance counter usage assumes a BCM11xx or BCM1250 part */
+#ifndef _SB14XX_
+
+#include "sbmips.h"
+#include "sb1250_defs.h"
+#include "sb1250_regs.h"
+
+#ifndef _SB_MAKE64
+#define _SB_MAKE64(x) ((uint64_t)(x))
+#endif
+#ifndef _SB_MAKEMASK1
+#define _SB_MAKEMASK1(n) (_SB_MAKE64(1) << _SB_MAKE64(n))
+#endif
+
+#include "lib_types.h"
+#include "lib_hssubr.h"
+#include "lib_malloc.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+#include "lib_queue.h"
+
+#include "addrspace.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_timer.h"
+#include "cfe_devfuncs.h"
+#include "cfe_irq.h"
+
+#include "pcivar.h"
+#include "pcireg.h"
+
+#include "bcm5821.h"
+
+/* The version that works by polling the CPU's Cause register doesn't
+ do handshakes or checks to detect merged interrupts. It currently
+ works when the 5821 is on the direct PCI bus but can behave
+ erratically when the 5821 is behind an LDT-to-PCI bridge that does
+ interrupt mapping and relies on EOI. */
+
+extern int32_t _getcause(void); /* return value of CP0 CAUSE */
+
+#define IMR_POINTER(cpu,reg) \
+ ((volatile uint64_t *)(PHYS_TO_K1(A_IMR_REGISTER(cpu,reg))))
+
+#define CACHE_LINE_SIZE 32
+
+static void bcm5821_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+typedef struct bcm5821_state_s {
+ uint32_t regbase;
+ uint8_t irq;
+ pcitag_t tag; /* tag for configuration registers */
+
+ uint16_t device; /* chip device code */
+ uint8_t revision; /* chip revision */
+
+} bcm5821_state_t;
+
+
+/* Address mapping macros */
+
+/* Note that PTR_TO_PHYS only works with 32-bit addresses, but then
+ so does the bcm528x. */
+#define PTR_TO_PHYS(x) (K0_TO_PHYS((uintptr_t)(x)))
+#define PHYS_TO_PTR(a) ((void *)PHYS_TO_K0(a))
+
+/* For the 5821, all mappings through the PCI host bridge use match
+ bits mode. This works because the NORM_PCI bit in DMA Control is
+ clear. The 5820 does not have such a bit, so pointers to data byte
+ sequences use match bytes, but control blocks use match bits. */
+#define PHYS_TO_PCI(a) ((uint32_t) (a) | 0x20000000)
+#define PHYS_TO_PCI_D(a) (a)
+#define PCI_TO_PHYS(a) ((uint32_t) (a) & 0x1FFFFFFF)
+
+#if __long64
+#define READCSR(sc,csr) \
+ (*((volatile uint32_t *) \
+ (PHYS_TO_XKSEG_UNCACHED((sc)->regbase+(csr)))))
+
+#define WRITECSR(sc,csr,val) \
+ (*((volatile uint32_t *) \
+ (PHYS_TO_XKSEG_UNCACHED((sc)->regbase+(csr)))) = (val))
+#else
+#define READCSR(sc,csr) \
+ (hs_read32(PHYS_TO_XKSEG_UNCACHED((sc)->regbase+(csr))))
+
+#define WRITECSR(sc,csr,val) \
+ (hs_write32(PHYS_TO_XKSEG_UNCACHED((sc)->regbase+(csr)), (val)))
+#endif
+
+static void
+dumpcsrs(bcm5821_state_t *sc, const char *legend)
+{
+ xprintf("%s:\n", legend);
+ xprintf("---DMA---\n");
+ /* DMA control and status registers */
+ xprintf("MCR1: %08X CTRL: %08X STAT: %08X ERR: %08X\n",
+ READCSR(sc, R_MCR1), READCSR(sc, R_DMA_CTRL),
+ READCSR(sc, R_DMA_STAT), READCSR(sc, R_DMA_ERR));
+ xprintf("MCR2: %08X\n", READCSR(sc, R_MCR2));
+ xprintf("-------------\n");
+}
+
+
+static void
+bcm5821_init(bcm5821_state_t *sc)
+{
+}
+
+static void
+bcm5821_hwinit(bcm5821_state_t *sc)
+{
+ uint32_t ctrl;
+ uint32_t status;
+
+ ctrl = (M_DMA_CTRL_MCR1_INT_EN | M_DMA_CTRL_MCR2_INT_EN |
+ M_DMA_CTRL_DMAERR_EN);
+ if (sc->device == K_PCI_ID_BCM5820)
+ ctrl |= (M_DMA_CTRL_NORM_PCI | M_DMA_CTRL_LE_CRYPTO);
+ /* Note for 5821: M_DMA_CTRL_NORM_PCI, M_DMA_CTRL_LE_CRYPTO not set. */
+#if 0 /* Empirically, this reduces performance. */
+ if (sc->device != K_PCI_ID_BCM5820)
+ ctrl |= M_DMA_CTRL_WR_BURST;
+#endif
+ WRITECSR(sc, R_DMA_CTRL, ctrl);
+
+ status = READCSR(sc, R_DMA_STAT);
+ WRITECSR(sc, R_DMA_STAT, status); /* reset write-to-clear bits */
+ status = READCSR(sc, R_DMA_STAT);
+
+ dumpcsrs(sc, "init");
+}
+
+
+static void
+bcm5821_start(bcm5821_state_t *sc)
+{
+ bcm5821_hwinit(sc);
+}
+
+static void
+bcm5821_stop(bcm5821_state_t *sc)
+{
+ WRITECSR(sc, R_DMA_CTRL, 0);
+}
+
+
+static int bcm5821_open(cfe_devctx_t *ctx);
+static int bcm5821_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int bcm5821_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat);
+static int bcm5821_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int bcm5821_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int bcm5821_close(cfe_devctx_t *ctx);
+
+const static cfe_devdisp_t bcm5821_dispatch = {
+ bcm5821_open,
+ bcm5821_read,
+ bcm5821_inpstat,
+ bcm5821_write,
+ bcm5821_ioctl,
+ bcm5821_close,
+ NULL,
+ NULL
+};
+
+cfe_driver_t bcm5821drv = {
+ "BCM582x crypto",
+ "crypt",
+ CFE_DEV_OTHER,
+ &bcm5821_dispatch,
+ bcm5821_probe
+};
+
+
+static int
+bcm5821_attach(cfe_driver_t *drv, pcitag_t tag, int index)
+{
+ bcm5821_state_t *sc;
+ char descr[80];
+ phys_addr_t pa;
+ uint32_t base;
+ pcireg_t device, class;
+
+ pci_map_mem(tag, PCI_MAPREG(0), PCI_MATCH_BITS, &pa);
+ base = (uint32_t)pa;
+
+ sc = (bcm5821_state_t *) KMALLOC(sizeof(bcm5821_state_t),0);
+ if (sc == NULL) {
+ xprintf("BCM5821: No memory to complete probe\n");
+ return 0;
+ }
+
+ memset(sc, 0, sizeof(*sc));
+
+ sc->regbase = base;
+
+ sc->irq = pci_conf_read(tag, PCI_BPARAM_INTERRUPT_REG) & 0xFF;
+
+ device = pci_conf_read(tag, PCI_ID_REG);
+ class = pci_conf_read(tag, PCI_CLASS_REG);
+
+ sc->tag = tag;
+ sc->device = PCI_PRODUCT(device);
+ sc->revision = PCI_REVISION(class);
+
+ bcm5821_init(sc);
+
+ xsprintf(descr, "BCM%04X Crypto at 0x%08X", sc->device, base);
+ cfe_attach(drv, sc, NULL, descr);
+
+ return 1;
+}
+
+static void
+bcm5821_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr)
+{
+ int index;
+ int n;
+
+ n = 0;
+ index = 0;
+ for (;;) {
+ pcitag_t tag;
+ pcireg_t device;
+
+ if (pci_find_class(PCI_CLASS_PROCESSOR, index, &tag) != 0)
+ break;
+
+ index++;
+
+ device = pci_conf_read(tag, PCI_ID_REG);
+ if (PCI_VENDOR(device) == K_PCI_VENDOR_BROADCOM) {
+ if (PCI_PRODUCT(device) == K_PCI_ID_BCM5820 ||
+ PCI_PRODUCT(device) == K_PCI_ID_BCM5821) {
+ bcm5821_attach(drv, tag, n);
+ n++;
+ }
+ }
+ }
+}
+
+
+/* The functions below are called via the dispatch vector for the 5821 */
+
+static int
+bcm5821_open(cfe_devctx_t *ctx)
+{
+ bcm5821_state_t *sc = ctx->dev_softc;
+
+ bcm5821_start(sc);
+ return 0;
+}
+
+static int
+bcm5821_read(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ return -1;
+}
+
+static int
+bcm5821_inpstat(cfe_devctx_t *ctx, iocb_inpstat_t *inpstat)
+{
+ return 0;
+}
+
+static int
+bcm5821_write(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ return -1;
+}
+
+static int
+bcm5821_ioctl(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ return -1;
+}
+
+static int
+bcm5821_close(cfe_devctx_t *ctx)
+{
+ bcm5821_state_t *sc = ctx->dev_softc;
+
+ bcm5821_stop(sc);
+ return 0;
+}
+
+
+/* Additional hooks for testing. */
+
+static int
+bcm5821_dump_cc1 (uint32_t *cc)
+{
+ int i;
+ unsigned op = G_CC_OPCODE(cc[0]);
+ unsigned cc_words = G_CC_LEN(cc[0])/4;
+ int chain_out; /* Whether the output is chained or fixed */
+
+ chain_out = 1; /* default */
+
+ switch (op) {
+
+ case K_SSL_MAC:
+ xprintf("(SSL_MAC)\n");
+ for (i = 0; i < SSL_MAC_CMD_WORDS; i++)
+ xprintf(" %2d: %08x\n", i, cc[i]);
+ chain_out = 0;
+ break;
+
+ case K_ARC4:
+ xprintf("(ARCFOUR)\n");
+ for (i = 0; i < 3; i++)
+ xprintf(" %2d: %08x\n", i, cc[i]);
+ for (i = 0; i < 256/4; i += 4)
+ xprintf(" %2d: %08x %08x %08x %08x\n",
+ i+3, cc[i+3], cc[i+4], cc[i+5], cc[i+6]);
+ break;
+
+ case K_HASH:
+ xprintf("(HASH)\n");
+ for (i = 0; i < 2; i++)
+ xprintf(" %2d: %08x\n", i, cc[i]);
+ chain_out = 0;
+ break;
+
+ case K_TLS_HMAC:
+ chain_out = 0;
+ /* fall through */
+
+ default: /* NYI: K_IPSEC_3DES (5821 only), K_SSL_3DES */
+ xprintf("\n");
+ for (i = 0; i < cc_words; i++)
+ xprintf(" %2d: %08x\n", i, cc[i]);
+ break;
+ }
+
+ return chain_out;
+}
+
+static int
+bcm5821_dump_cc2 (uint32_t *cc)
+{
+ int i;
+ unsigned op = G_CC_OPCODE(cc[0]);
+ unsigned cc_words = G_CC_LEN(cc[0])/4;
+ int chain_out; /* Whether the output is chained or fixed */
+
+ chain_out = 1; /* default */
+
+ switch (op) {
+
+ case K_RNG_DIRECT:
+ xprintf(" RNG_DIRECT\n");
+ chain_out = 0;
+ for (i = 0; i < 1; i++)
+ xprintf(" %2d: %08x\n", i, cc[i]);
+ break;
+
+ case K_RNG_SHA1:
+ xprintf(" RNG_SHA1\n");
+ chain_out = 0;
+ for (i = 0; i < 1; i++)
+ xprintf(" %2d: %08x\n", i, cc[i]);
+ break;
+
+ default: /* NYI: K_DH_*_GEN, K_RSA_*_OP, K_DSA_*, K_MOD_* */
+ xprintf(" %04x\n", op);
+ for (i = 0; i < cc_words; i++)
+ xprintf(" %2d: %08x\n", i, cc[i]);
+ break;
+ }
+ return chain_out;
+}
+
+static void
+bcm5821_dump_pkt (uint32_t *pkt, int port)
+{
+ uint32_t *cc = PHYS_TO_PTR(PCI_TO_PHYS(pkt[0]));
+ uint32_t *chain;
+ int chain_out;
+ int i, j;
+
+ xprintf(" %2d: %08x ", 0, pkt[0]);
+ chain_out = (port == 1 ? bcm5821_dump_cc1 : bcm5821_dump_cc2)(cc);
+
+ for (i = 1; i < PD_SIZE/4; i++) {
+ xprintf(" %2d: %08x\n", i, pkt[i]);
+
+ if (pkt[i] != 0) {
+ switch (i) {
+ case 2:
+ chain = PHYS_TO_PTR(PCI_TO_PHYS(pkt[i]));
+ for (j = 0; j < CHAIN_WORDS; j++)
+ xprintf(" %2d: %08x\n", j, chain[j]);
+ break;
+ case 6:
+ if (chain_out) {
+ chain = PHYS_TO_PTR(PCI_TO_PHYS(pkt[i]));
+ for (j = 0; j < CHAIN_WORDS; j++)
+ xprintf(" %2d: %08x\n", j, chain[j]);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+}
+
+static void
+bcm5821_dump_mcr (uint32_t mcr[], int port)
+{
+ unsigned i;
+ unsigned npkts = G_MCR_NUM_PACKETS(mcr[0]);
+
+ xprintf("MCR header %08x at %p:\n", mcr[0], mcr);
+ for (i = 0; i < npkts; i++) {
+ xprintf(" packet %d:\n", i+1);
+ bcm5821_dump_pkt(&mcr[1 + i*(PD_SIZE/4)], port);
+ }
+}
+
+
+static void
+bcm5821_show_pkt1 (uint32_t *pkt)
+{
+ uint32_t *cc = PHYS_TO_PTR(PCI_TO_PHYS(pkt[0]));
+ unsigned op = G_CC_OPCODE(cc[0]);
+ int i;
+
+ switch (op) {
+ case K_SSL_MAC:
+ {
+ uint32_t *hash = PHYS_TO_PTR(PCI_TO_PHYS(pkt[6]));
+ xprintf("SSL_MAC hash:\n");
+ xprintf(" %08x %08x %08x %08x\n",
+ hash[0], hash[1], hash[2], hash[3]);
+ xprintf(" %08x\n", hash[4]);
+ }
+ break;
+ case K_TLS_HMAC:
+ {
+ uint32_t *hash = PHYS_TO_PTR(PCI_TO_PHYS(pkt[7]));
+ xprintf("TLS_HMAC hash:\n");
+ xprintf(" %08x %08x %08x %08x\n",
+ hash[0], hash[1], hash[2], hash[3]);
+ xprintf(" %08x\n", hash[4]);
+ }
+ break;
+ case K_ARC4:
+ {
+ uint32_t *output = PHYS_TO_PTR(PCI_TO_PHYS(pkt[5]));
+ uint32_t *chain = PHYS_TO_PTR(PCI_TO_PHYS(pkt[6]));
+ uint32_t *update = PHYS_TO_PTR(PCI_TO_PHYS(chain[0]));
+
+ xprintf("ARCFOUR output\n");
+ for (i = 0; i < 64; i += 4)
+ xprintf (" %08x %08x %08x %08x\n",
+ output[i+0], output[i+1], output[i+2], output[i+3]);
+ xprintf("ARCFOUR update\n");
+ xprintf(" %08x\n", update[0]);
+ for (i = 0; i < 256/4; i += 4)
+ xprintf (" %08x %08x %08x %08x\n",
+ update[i+1], update[i+2], update[i+3], update[i+4]);
+ }
+ break;
+ case K_HASH:
+ {
+ uint8_t *digest = PHYS_TO_PTR(PCI_TO_PHYS(pkt[6]));
+
+ xprintf("HASH digest ");
+ for (i = 0; i < 16; i++)
+ xprintf("%02x", digest[i]);
+ xprintf("\n");
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+static void
+bcm5821_show_pkt2 (uint32_t *pkt)
+{
+ uint32_t *cc = PHYS_TO_PTR(PCI_TO_PHYS(pkt[0]));
+ unsigned op = G_CC_OPCODE(cc[0]);
+ int i;
+
+ switch (op) {
+ case K_RNG_DIRECT:
+ case K_RNG_SHA1:
+ {
+ uint32_t *output = PHYS_TO_PTR(PCI_TO_PHYS(pkt[5]));
+ size_t len = V_DBC_DATA_LEN(pkt[7])/sizeof(uint32_t);
+
+ xprintf("RNG output\n");
+ for (i = 0; i < len; i += 4)
+ xprintf (" %08x %08x %08x %08x\n",
+ output[i+0], output[i+1], output[i+2], output[i+3]);
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+static void
+bcm5821_show_mcr (uint32_t mcr[], int port)
+{
+ unsigned i;
+ unsigned npkts = G_MCR_NUM_PACKETS(mcr[0]);
+
+ xprintf("MCR at %p:\n", mcr);
+ for (i = 0; i < npkts; i++) {
+ xprintf("packet %d:\n", i+1);
+ if (port == 1)
+ bcm5821_show_pkt1(&mcr[1 + i*(PD_SIZE/4)]);
+ else
+ bcm5821_show_pkt2(&mcr[1 + i*(PD_SIZE/4)]);
+ }
+}
+
+
+static uint32_t *
+bcm5821_alloc_hash (const uint8_t *msg, size_t msg_len, int swap)
+{
+ uint32_t *mcr;
+ uint32_t *cmd; /* always reads at least 64 bytes */
+ uint8_t *message;
+ uint8_t *digest;
+ int i;
+
+ message = KMALLOC(msg_len, CACHE_LINE_SIZE);
+ for (i = 0; i < msg_len; i++)
+ message[i] = msg[i];
+
+ digest = KMALLOC(16, CACHE_LINE_SIZE);
+ for (i = 0; i < 16; i++)
+ digest[i] = 0;
+
+ mcr = KMALLOC(MCR_WORDS(1)*4, CACHE_LINE_SIZE);
+ mcr[0] = V_MCR_NUM_PACKETS(1);
+
+ cmd = KMALLOC(64, CACHE_LINE_SIZE); /* Always allocate >= 64 bytes */
+ cmd[0] = V_CC_OPCODE(K_HASH) | V_CC_LEN(8);
+ cmd[1] = V_CC_FLAGS(K_HASH_FLAGS_MD5);
+
+ mcr[1] = PHYS_TO_PCI(PTR_TO_PHYS(cmd));
+
+ /* input fragment */
+ mcr[2] = swap ? PHYS_TO_PCI_D(PTR_TO_PHYS(message))
+ : PHYS_TO_PCI(PTR_TO_PHYS(message));
+ mcr[3] = 0;
+ mcr[4] = V_DBC_DATA_LEN(msg_len);
+
+ mcr[5] = V_PD_PKT_LEN(msg_len);
+
+ mcr[6] = 0;
+ mcr[7] = swap ? PHYS_TO_PCI_D(PTR_TO_PHYS(digest))
+ : PHYS_TO_PCI(PTR_TO_PHYS(digest));
+ mcr[8] = 0;
+
+ return mcr;
+}
+
+static void
+bcm5821_free_hash (uint32_t mcr[])
+{
+ KFREE(PHYS_TO_PTR(PCI_TO_PHYS(mcr[1])));
+ KFREE(PHYS_TO_PTR(PCI_TO_PHYS(mcr[2])));
+ KFREE(PHYS_TO_PTR(PCI_TO_PHYS(mcr[7])));
+
+ KFREE(mcr);
+}
+
+
+static uint32_t *
+bcm5821_alloc_hmac (const char *key, int key_len,
+ const char *msg, int msg_len,
+ int swap)
+{
+ uint32_t *message;
+ uint32_t *cmd;
+ uint32_t *mcr;
+ uint32_t *hash;
+ int i;
+
+ message = KMALLOC(msg_len, CACHE_LINE_SIZE);
+ memcpy((uint8_t *)message, msg, msg_len);
+
+ mcr = KMALLOC(MCR_WORDS(1)*4, CACHE_LINE_SIZE);
+ mcr[0] = V_MCR_NUM_PACKETS(1);
+
+ /* packet 1 */
+
+ cmd = KMALLOC(TLS_HMAC_CMD_WORDS*4, CACHE_LINE_SIZE);
+ cmd[0] = V_CC_OPCODE(K_TLS_HMAC) | V_CC_LEN(TLS_HMAC_CMD_WORDS*4);
+ cmd[1] = V_CC_FLAGS(K_HASH_FLAGS_MD5);
+
+ /* XXX This is not correct. The key is used to compute the inner
+ and outer states. */
+ for (i = 2; i < 7; i++)
+ cmd[i] = 0x36363636; /* XXX MAC write secret */
+ cmd[6] = 0x00000000; /* must be zero for SSL */
+ for (i = 8; i < 13; i++)
+ cmd[i] = 0x5c5c5c5c;
+ cmd[13] = 0; /* seq num */
+ cmd[14] = 1;
+ cmd[15] = 0x03000000 | (msg_len << 8); /* XXX type/len/rsvd */
+
+ mcr[1] = PHYS_TO_PCI(PTR_TO_PHYS(cmd));
+
+ /* input fragment */
+ mcr[2] = swap ? PHYS_TO_PCI_D(PTR_TO_PHYS(message))
+ : PHYS_TO_PCI(PTR_TO_PHYS(message));
+ mcr[3] = 0;
+ mcr[4] = V_DBC_DATA_LEN(msg_len);
+
+ mcr[5] = V_PD_PKT_LEN(msg_len);
+
+ hash = KMALLOC(5*4, CACHE_LINE_SIZE);
+ for (i = 0; i < 5; i++)
+ hash[i] = 0;
+
+ mcr[6] = 0;
+ mcr[7] = swap ? PHYS_TO_PCI_D(PTR_TO_PHYS(hash))
+ : PHYS_TO_PCI(PTR_TO_PHYS(hash));
+ mcr[8] = 0;
+
+ return mcr;
+}
+
+static void
+bcm5821_free_hmac (uint32_t mcr[])
+{
+ KFREE(PHYS_TO_PTR(PCI_TO_PHYS(mcr[1])));
+ KFREE(PHYS_TO_PTR(PCI_TO_PHYS(mcr[2])));
+ KFREE(PHYS_TO_PTR(PCI_TO_PHYS(mcr[7])));
+
+ KFREE(mcr);
+}
+
+
+static int test_init = 0;
+
+/* Timing */
+
+/* For Pass 1, dedicate an SCD peformance counter to use as a counter
+ of ZBbus cycles. */
+#include "sb1250_scd.h"
+#define ZCTR_MODULUS 0x10000000000LL
+
+/* The counter is a shared resource that must be reset periodically
+ since it doesn't roll over. Furthermore, there is a pass one bug
+ that makes the interrupt unreliable and the final value either all
+ ones or all zeros. We therefore reset the count when it exceeds
+ half the modulus. We also assume that intervals of interest
+ are much less than half the modulus and attempt to adjust for
+ the reset in zclk_elapsed. */
+
+static void
+zclk_init(uint64_t val)
+{
+ *((volatile uint64_t *) UNCADDR(A_SCD_PERF_CNT_0)) = val;
+ *((volatile uint64_t *) UNCADDR(A_SCD_PERF_CNT_CFG)) =
+ V_SPC_CFG_SRC0(1) | M_SPC_CFG_ENABLE;
+}
+
+static uint64_t
+zclk_get(void)
+{
+ uint64_t ticks;
+
+ ticks = *((volatile uint64_t *) UNCADDR(A_SCD_PERF_CNT_0));
+ if (ticks == 0 || ticks == ZCTR_MODULUS-1) {
+ ticks = 0;
+ zclk_init(ticks);
+ }
+ else if (ticks >= ZCTR_MODULUS/2) {
+ ticks -= ZCTR_MODULUS/2;
+ zclk_init(ticks); /* Ignore the fudge and lose a few ticks */
+ }
+ return ticks;
+}
+
+static uint64_t
+zclk_elapsed(uint64_t stop, uint64_t start)
+{
+ return ((stop >= start) ? stop : stop + ZCTR_MODULUS/2) - start;
+}
+
+
+/* Auxiliary functions */
+
+static uint32_t *
+bcm5821_alloc_composite(int input_size)
+{
+ uint32_t *input, *output;
+ uint32_t *cmd;
+ uint32_t *chain;
+ uint32_t *mcr;
+ uint32_t *hash;
+ uint32_t *update;
+ uint8_t *arc4_state;
+ int i;
+
+ input = KMALLOC(input_size, CACHE_LINE_SIZE);
+ for (i = 0; i < input_size; i++)
+ ((uint8_t *)input)[i] = i & 0xFF;
+ output = KMALLOC(input_size + 16, CACHE_LINE_SIZE);
+ for (i = 0; i < input_size + 16; i++)
+ ((uint8_t *)output)[i] = 0xFF;
+
+ mcr = KMALLOC(MCR_WORDS(2)*4, CACHE_LINE_SIZE);
+ mcr[0] = V_MCR_NUM_PACKETS(2);
+
+ /* packet 1 */
+
+ cmd = KMALLOC(SSL_MAC_CMD_WORDS*4, CACHE_LINE_SIZE);
+ cmd[0] = V_CC_OPCODE(K_SSL_MAC) | V_CC_LEN(SSL_MAC_CMD_WORDS*4);
+ cmd[1] = V_CC_FLAGS(K_HASH_FLAGS_MD5);
+ for (i = 2; i < 6; i++)
+ cmd[i] = 0x01020304; /* XXX MAC write secret */
+ cmd[6] = 0x00000000; /* must be zero for SSL */
+ for (i = 7; i < 19; i++)
+ cmd[i] = 0x36363636;
+ cmd[19] = 0; /* seq num */
+ cmd[20] = 1;
+ cmd[21] = 0x03000000 | (input_size << 8); /* type/len/rsvd */
+
+ mcr[1] = PHYS_TO_PCI(PTR_TO_PHYS(cmd));
+
+ /* input fragment */
+ mcr[2] = PHYS_TO_PCI(PTR_TO_PHYS(input));
+ mcr[3] = 0;
+ mcr[4] = V_DBC_DATA_LEN(input_size);
+
+ mcr[5] = V_PD_PKT_LEN(input_size);
+
+ hash = KMALLOC(5*4, CACHE_LINE_SIZE);
+ for (i = 0; i < 5; i++)
+ hash[i] = 0;
+
+ mcr[6] = 0;
+ mcr[7] = PHYS_TO_PCI(PTR_TO_PHYS(hash));
+ mcr[8] = 0;
+
+ /* packet 2 */
+
+ cmd = KMALLOC(ARC4_CMD_WORDS*4, CACHE_LINE_SIZE);
+ cmd[0] = V_CC_OPCODE(K_ARC4) | V_CC_LEN(ARC4_CMD_WORDS*4);
+ cmd[1] = M_ARC4_FLAGS_WRITEBACK;
+ cmd[2] = 0x000100F3;
+ arc4_state = (uint8_t *)&cmd[3];
+ for (i = 0; i < 256; i++)
+ arc4_state[i] = i;
+
+ mcr[8+1] = PHYS_TO_PCI(PTR_TO_PHYS(cmd));
+
+ /* input fragment */
+ chain = KMALLOC(CHAIN_WORDS*4, CACHE_LINE_SIZE);
+
+ mcr[8+2] = PHYS_TO_PCI(PTR_TO_PHYS(input));
+ mcr[8+3] = PHYS_TO_PCI(PTR_TO_PHYS(chain));
+ mcr[8+4] = V_DBC_DATA_LEN(input_size);
+
+ /* MAC fragment */
+ chain[0] = PHYS_TO_PCI(PTR_TO_PHYS(hash));
+ chain[1] = 0;
+ chain[2] = V_DBC_DATA_LEN(16);
+
+ mcr[8+5] = V_PD_PKT_LEN(input_size + 16);
+
+ /* output fragment */
+ chain = KMALLOC(CHAIN_WORDS*4, CACHE_LINE_SIZE);
+
+ mcr[8+6] = PHYS_TO_PCI(PTR_TO_PHYS(output));
+ mcr[8+7] = PHYS_TO_PCI(PTR_TO_PHYS(chain));
+ mcr[8+8] = V_DBC_DATA_LEN(input_size + 16);
+
+ update = KMALLOC(ARC4_STATE_WORDS*4, CACHE_LINE_SIZE);
+ for (i = 0; i < ARC4_STATE_WORDS; i++)
+ update[i] = 0xFFFFFFFF;
+
+ /* output update */
+ chain[0] = PHYS_TO_PCI(PTR_TO_PHYS(update));
+ chain[1] = 0;
+ chain[2] = V_DBC_DATA_LEN(ARC4_STATE_WORDS*4); /* not actually used */
+
+ return mcr;
+}
+
+static void
+bcm5821_free_composite (uint32_t mcr[])
+{
+ uint32_t *chain;
+
+ /* packet 1 */
+
+ KFREE(PHYS_TO_PTR(PCI_TO_PHYS(mcr[1])));
+ KFREE(PHYS_TO_PTR(PCI_TO_PHYS(mcr[2])));
+ KFREE(PHYS_TO_PTR(PCI_TO_PHYS(mcr[7])));
+
+ /* packet 2 */
+ KFREE(PHYS_TO_PTR(PCI_TO_PHYS(mcr[8+1])));
+ /* mcr[8+2] already freed */
+ chain = PHYS_TO_PTR(PCI_TO_PHYS(mcr[8+3]));
+ KFREE(PHYS_TO_PTR(PCI_TO_PHYS(chain[0]))); KFREE(chain);
+ KFREE(PHYS_TO_PTR(PCI_TO_PHYS(mcr[8+6])));
+ chain = PHYS_TO_PTR(PCI_TO_PHYS(mcr[8+7]));
+ KFREE(PHYS_TO_PTR(PCI_TO_PHYS(chain[0]))); KFREE(chain);
+
+ KFREE(mcr);
+}
+
+
+static void
+flush_l2(void)
+{
+ /* Temporary hack: churn through all of L2 */
+ volatile uint64_t *lomem;
+ uint64_t t;
+ int i;
+
+ lomem = (uint64_t *)(0xFFFFFFFF80000000LL); /* kseg0 @ 0 */
+ t = 0;
+ for (i = 0; i < (512/8)*1024; i++)
+ t ^= lomem[i];
+}
+
+#ifdef IRQ
+static void
+bcm5821_interrupt(void *ctx)
+{
+}
+#endif
+
+
+#define POOL_SIZE 4
+#define MCR_QUEUE_DEPTH 2
+
+static int
+bcm5821_composite (bcm5821_state_t *sc, size_t len, int trials)
+{
+ uint32_t *mcr[POOL_SIZE];
+ uint32_t status;
+ uint64_t start, stop, ticks;
+ uint64_t tpb, Mbs;
+ int i;
+ int next, last, run;
+
+ for (i = 0; i < POOL_SIZE; i++)
+ mcr[i] = bcm5821_alloc_composite(len);
+
+ (void)bcm5821_dump_mcr; /*bcm5821_dump_mcr(mcr[0], 1);*/
+
+ next = last = 0;
+ run = 0;
+
+ /* Force all descriptors and buffers out of L1 */
+ cfe_flushcache(CFE_CACHE_FLUSH_D);
+ (void)flush_l2; /* XXX for now */
+
+ status = READCSR(sc, R_DMA_STAT);
+ WRITECSR(sc, R_DMA_STAT, status); /* clear pending bits */
+ status = READCSR(sc, R_DMA_STAT);
+
+ for (i = 0; i < 1000; i++) {
+ status = READCSR(sc, R_DMA_STAT);
+ if ((status & M_DMA_STAT_MCR1_FULL) == 0)
+ break;
+ cfe_sleep(1);
+ }
+ if (i == 1000) {
+ dumpcsrs(sc, "bcm5821: full bit never clears");
+ return -1;
+ }
+
+#ifdef IRQ
+ /* Enable interrupt polling, but the handler is never called. */
+ cfe_request_irq(sc->irq, bcm5821_interrupt, NULL, 0, 0);
+#endif
+
+ zclk_init(0); /* Time origin is arbitrary. */
+ start = zclk_get();
+
+ /* MCR ports are double buffered. */
+ for (i = 0; i < MCR_QUEUE_DEPTH; i++) {
+ while ((READCSR(sc, R_DMA_STAT) & M_DMA_STAT_MCR1_FULL) != 0)
+ continue;
+ WRITECSR(sc, R_MCR1, PHYS_TO_PCI(PTR_TO_PHYS(mcr[next])));
+ next = (next + 1) % POOL_SIZE;
+ }
+
+ while (1) {
+#ifdef IRQ
+ while ((_getcause() & M_CAUSE_IP2) == 0)
+ continue;
+
+ status = READCSR(sc, R_DMA_STAT);
+ if ((status & M_DMA_STAT_MCR1_INTR) == 0) {
+ /* This apparently is MCR1_ALL_EMPTY, timing of which is unclear. */
+ WRITECSR(sc, R_DMA_STAT,
+ M_DMA_STAT_DMAERR_INTR | M_DMA_STAT_MCR1_INTR);
+ continue;
+ }
+
+ stop = zclk_get();
+ WRITECSR(sc, R_DMA_STAT,
+ M_DMA_STAT_DMAERR_INTR | M_DMA_STAT_MCR1_INTR);
+#else
+ volatile uint32_t *last_mcr = mcr[last];
+
+ while ((*last_mcr & M_MCR_DONE) == 0)
+ continue;
+
+ stop = zclk_get();
+#endif
+
+ run++;
+ if (run == trials)
+ break;
+
+ while ((READCSR(sc, R_DMA_STAT) & M_DMA_STAT_MCR1_FULL) != 0)
+ continue;
+ WRITECSR(sc, R_MCR1, PHYS_TO_PCI(PTR_TO_PHYS(mcr[next])));
+ next = (next + 1) % POOL_SIZE;
+
+ /* Clear the DONE and ERROR bits. This will bring one line of
+ the MCR back into L1. Flush? */
+ mcr[last][0] = V_MCR_NUM_PACKETS(2);
+ last = (last + 1) % POOL_SIZE;
+ }
+
+#ifdef IRQ
+ status = READCSR(sc, R_DMA_STAT);
+ WRITECSR(sc, R_DMA_STAT, status); /* clear pending bits */
+ cfe_free_irq(sc->irq, 0);
+#endif
+
+ ticks = zclk_elapsed(stop, start) / trials;
+ xprintf("bcm5821: Composite %lld ticks for %d bytes, %d packets\n",
+ ticks, len, trials);
+ /* Scaling for two decimal places. */
+ tpb = (ticks*100) / len;
+ Mbs = (2000*100)*100 / tpb;
+ xprintf(" rate %lld.%02lld Mbps\n", Mbs/100, Mbs % 100);
+
+ if (trials == 1)
+ {
+ bcm5821_show_mcr(mcr[0], 1);
+ }
+
+ for (i = 0; i < POOL_SIZE; i++)
+ bcm5821_free_composite(mcr[i]);
+
+ return 0;
+}
+
+
+/* The following code depends on having a separate interrupt per
+ device, and there are only 4 PCI interrupts. */
+#define MAX_DEVICES 4
+
+struct dev_info {
+ bcm5821_state_t *sc;
+ uint64_t irq_mask;
+ int index[MCR_QUEUE_DEPTH];
+};
+
+
+#define N_DEVICES 2
+
+static int
+bcm5821_composite2 (bcm5821_state_t *sc0, bcm5821_state_t *sc1,
+ size_t len, int trials)
+{
+ uint32_t *mcr[POOL_SIZE];
+ uint32_t ring[POOL_SIZE];
+ uint32_t status;
+ uint64_t start, stop, ticks;
+ uint64_t tpb, Mbs;
+ int i;
+ int next, last;
+ int started, run;
+ int d;
+ struct dev_info dev[N_DEVICES];
+ uint64_t masks;
+ bcm5821_state_t *sc;
+#ifdef IRQ
+ volatile uint64_t *irqstat = IMR_POINTER(0, R_IMR_INTERRUPT_SOURCE_STATUS);
+#endif
+ uint64_t pending;
+
+ dev[0].sc = sc0; dev[1].sc = sc1;
+
+ for (i = 0; i < POOL_SIZE; i++)
+ mcr[i] = bcm5821_alloc_composite(len);
+ for (i = 0; i < POOL_SIZE; i++)
+ ring[i] = i;
+ next = last = 0;
+
+ (void)bcm5821_dump_mcr; /*bcm5821_dump_mcr(mcr[0], 1);*/
+
+ started = run = 0;
+
+ /* Force all descriptors and buffers out of L1 */
+ cfe_flushcache(CFE_CACHE_FLUSH_D);
+ (void)flush_l2; /* XXX for now */
+
+ masks = 0;
+ for (d = 0; d < N_DEVICES; d++) {
+ sc = dev[d].sc;
+ dev[d].irq_mask = 1LL << (sc->irq);
+ masks |= dev[d].irq_mask;
+
+ status = READCSR(sc, R_DMA_STAT);
+ WRITECSR(sc, R_DMA_STAT, status); /* clear pending bits */
+ status = READCSR(sc, R_DMA_STAT);
+
+ for (i = 0; i < 1000; i++) {
+ status = READCSR(sc, R_DMA_STAT);
+ if ((status & M_DMA_STAT_MCR1_FULL) == 0)
+ break;
+ cfe_sleep(1);
+ }
+
+ if (i == 1000) {
+ dumpcsrs(sc, "bcm5821: full bit never clears");
+ return -1;
+ }
+
+#ifdef IRQ
+ /* Enable interrupt polling, but the handler is never called. */
+ cfe_request_irq(sc->irq, bcm5821_interrupt, NULL, 0, 0);
+#endif
+ }
+
+ stop = 0; /* Keep compiler happy */
+ zclk_init(0); /* Time origin is arbitrary. */
+ start = zclk_get();
+
+ for (d = 0; d < N_DEVICES; d++) {
+ sc = dev[d].sc;
+
+ /* MCR ports are double buffered. */
+ for (i = 0; i < 2; i++) {
+ int index = ring[next];
+ while ((READCSR(sc, R_DMA_STAT) & M_DMA_STAT_MCR1_FULL) != 0)
+ continue;
+ WRITECSR(sc, R_MCR1, PHYS_TO_PCI(PTR_TO_PHYS(mcr[index])));
+ dev[d].index[i] = index;
+ next = (next + 1) % POOL_SIZE;
+ started++;
+ }
+ }
+
+ while (trials == 0 || run != trials) {
+#ifdef IRQ
+ while ((_getcause() & M_CAUSE_IP2) == 0)
+ continue;
+
+ pending = *irqstat;
+#else
+ pending = 0;
+ while (pending == 0) {
+ for (d = 0; d < N_DEVICES; d++) {
+ volatile uint32_t *last_mcr = mcr[dev[d].index[0]];
+
+ if ((*last_mcr & M_MCR_DONE) != 0)
+ pending |= dev[d].irq_mask;
+ }
+ }
+#endif
+
+ stop = zclk_get();
+
+ for (d = 0; d < N_DEVICES; d++) {
+ if ((dev[d].irq_mask & pending) != 0) {
+ sc = dev[d].sc;
+
+#ifdef IRQ
+ status = READCSR(sc, R_DMA_STAT);
+ if ((status & M_DMA_STAT_MCR1_INTR) == 0) {
+ /* Apparently MCR1_ALL_EMPTY, timing of which is unclear. */
+ WRITECSR(sc, R_DMA_STAT,
+ M_DMA_STAT_DMAERR_INTR | M_DMA_STAT_MCR1_INTR);
+ continue;
+ }
+ WRITECSR(sc, R_DMA_STAT,
+ M_DMA_STAT_DMAERR_INTR | M_DMA_STAT_MCR1_INTR);
+#endif
+ ring[last] = dev[d].index[0];
+ /* Clear the DONE and ERROR bits. This will bring one line of
+ the MCR back into L1. Flush? */
+ mcr[ring[last]][0] = V_MCR_NUM_PACKETS(2);
+ last = (last + 1) % POOL_SIZE;
+
+ run++;
+ if (run == trials)
+ break;
+
+ dev[d].index[0] = dev[d].index[1];
+ if (trials == 0 || started < trials) {
+ int index = ring[next];
+ while ((READCSR(sc, R_DMA_STAT) & M_DMA_STAT_MCR1_FULL) != 0)
+ continue;
+ WRITECSR(sc, R_MCR1, PHYS_TO_PCI(PTR_TO_PHYS(mcr[index])));
+ dev[d].index[1] = index;
+ next = (next + 1) % POOL_SIZE;
+ started++;
+ }
+ }
+ }
+ }
+
+ for (d = 0; d < N_DEVICES; d++) {
+ sc = dev[d].sc;
+ status = READCSR(sc, R_DMA_STAT);
+ WRITECSR(sc, R_DMA_STAT, status); /* clear pending bits */
+#ifdef IRQ
+ cfe_free_irq(sc->irq, 0);
+#endif
+ }
+
+ ticks = zclk_elapsed(stop, start) / trials;
+ xprintf("bcm5821: Composite %lld ticks for %d bytes, %d packets\n",
+ ticks, len, trials);
+ /* Scaling for two decimal places. */
+ tpb = (ticks*100) / len;
+ Mbs = (2000*100)*100 / tpb;
+ xprintf(" rate %lld.%02lld Mbps\n", Mbs/100, Mbs % 100);
+
+ for (i = 0; i < POOL_SIZE; i++)
+ bcm5821_free_composite(mcr[i]);
+
+ return 0;
+}
+
+
+extern cfe_devctx_t *cfe_handle_table[];
+
+int bcm5821_test (int device, int trials);
+int
+bcm5821_test (int device, int trials)
+{
+ cfe_devctx_t *ctx = cfe_handle_table[device];
+ bcm5821_state_t *sc = ctx->dev_softc;
+
+ if (!test_init) {
+ zclk_init(0); /* Time origin is arbitrary */
+ test_init = 1;
+ }
+
+ bcm5821_composite(sc, 1472, trials);
+
+ return 0;
+}
+
+int bcm5821_test2 (int device0, int device2, int trials);
+int
+bcm5821_test2 (int device0, int device1, int trials)
+{
+ cfe_devctx_t *ctx0 = cfe_handle_table[device0];
+ cfe_devctx_t *ctx1 = cfe_handle_table[device1];
+ bcm5821_state_t *sc0 = ctx0->dev_softc;
+ bcm5821_state_t *sc1 = ctx1->dev_softc;
+
+ if (!test_init) {
+ zclk_init(0); /* Time origin is arbitrary */
+ test_init = 1;
+ }
+
+ bcm5821_composite2(sc0, sc1, 1472, trials);
+
+ return 0;
+}
+
+
+static int
+bcm5821_hash_md5 (bcm5821_state_t *sc, const char *msg)
+{
+ size_t len = strlen(msg);
+ uint32_t *mcr;
+ uint32_t status;
+ int i;
+ int swap = (sc->device == K_PCI_ID_BCM5820);
+
+ mcr = bcm5821_alloc_hash(msg, len, swap);
+
+ /* bcm5821_dump_mcr(mcr, 1); */
+
+ status = READCSR(sc, R_DMA_STAT);
+ WRITECSR(sc, R_DMA_STAT, status); /* clear pending bits */
+ status = READCSR(sc, R_DMA_STAT);
+
+ for (i = 0; i < 1000; i++) {
+ status = READCSR(sc, R_DMA_STAT);
+ if ((status & M_DMA_STAT_MCR1_FULL) == 0)
+ break;
+ cfe_sleep(1);
+ }
+ if (i == 1000) {
+ dumpcsrs(sc, "bcm5821: full bit never clears");
+ return -1;
+ }
+
+ WRITECSR(sc, R_MCR1, PHYS_TO_PCI(PTR_TO_PHYS(mcr)));
+
+ for (i = 0; i < 1000; i++) {
+#ifdef IRQ
+ status = READCSR(sc, R_DMA_STAT);
+ if ((status & M_DMA_STAT_MCR1_INTR) != 0)
+ break;
+#else
+ if ((mcr[0] & M_MCR_DONE) != 0)
+ break;
+#endif
+ cfe_sleep(1);
+ }
+ if (i == 1000) {
+ dumpcsrs(sc, "bcm5821: done bit never sets");
+ /*return -1;*/
+ }
+
+ status = READCSR(sc, R_DMA_STAT);
+ WRITECSR(sc, R_DMA_STAT, status); /* clear pending bits */
+
+ /* bcm5821_dump_mcr(mcr, 1); */
+
+ bcm5821_show_mcr(mcr, 1);
+
+ bcm5821_free_hash(mcr);
+
+ return 0;
+}
+
+
+static int
+bcm5821_hmac_md5 (bcm5821_state_t *sc,
+ const uint8_t key[], size_t key_len,
+ const uint8_t data[], size_t data_len)
+{
+ uint32_t *mcr;
+ uint32_t status;
+ int i;
+ int swap = (sc->device == K_PCI_ID_BCM5820);
+
+ mcr = bcm5821_alloc_hmac(key, key_len, data, data_len, swap);
+
+ status = READCSR(sc, R_DMA_STAT);
+ WRITECSR(sc, R_DMA_STAT, status); /* clear pending bits */
+ status = READCSR(sc, R_DMA_STAT);
+
+ for (i = 0; i < 1000; i++) {
+ status = READCSR(sc, R_DMA_STAT);
+ if ((status & M_DMA_STAT_MCR1_FULL) == 0)
+ break;
+ cfe_sleep(1);
+ }
+ if (i == 1000) {
+ dumpcsrs(sc, "bcm5821: full bit never clears");
+ return -1;
+ }
+#if 0 /* disable: work in progress */
+
+ while ((READCSR(sc, R_DMA_STAT) & M_DMA_STAT_MCR1_FULL) != 0)
+ continue;
+ WRITECSR(sc, R_MCR1, PHYS_TO_PCI(PTR_TO_PHYS(mcr)));
+
+ for (i = 0; i < 1000; i++) {
+ if ((mcr[0] & M_MCR_DONE) != 0)
+ break;
+ cfe_sleep(1);
+ }
+ if (i == 1000) {
+ dumpcsrs(sc, "bcm5821: done bit never sets");
+ return -1;
+ }
+
+ status = READCSR(sc, R_DMA_STAT);
+ WRITECSR(sc, R_DMA_STAT, status); /* clear pending bits */
+
+ bcm5821_show_mcr(mcr, 1);
+#endif
+
+ bcm5821_free_hmac(mcr);
+ return 0;
+}
+
+/* Sanity check on the implementation using RFC test suites. */
+
+int bcm5821_check (int device);
+int
+bcm5821_check (int device)
+{
+ static unsigned char k1[16] = {
+ 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
+ 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b
+ };
+ static unsigned char m1[] = "Hi There";
+
+ static unsigned char k2[] = "Jefe";
+ static unsigned char m2[] = "what do ya want for nothing?";
+
+ static unsigned char k3[16] = {
+ 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
+ 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA
+ };
+ static unsigned char m3[50] = {
+ 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
+ 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
+ 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
+ 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
+ 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD
+ };
+
+ cfe_devctx_t *ctx = cfe_handle_table[device];
+ bcm5821_state_t *sc = ctx->dev_softc;
+
+ if (!test_init) {
+ zclk_init(0); /* Time origin is arbitrary */
+ test_init = 1;
+ }
+
+#if 0 /* 5821 cannot handle 0-length fragments (see Appendix B) */
+ bcm5821_hash_md5(sc, "");
+#endif
+ bcm5821_hash_md5(sc, "a");
+ bcm5821_hash_md5(sc, "abc");
+ bcm5821_hash_md5(sc, "message digest");
+ bcm5821_hash_md5(sc, "abcdefghijklmnopqrstuvwxyz");
+ bcm5821_hash_md5(sc, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
+ bcm5821_hash_md5(sc, "12345678901234567890123456789012345678901234567890123456789012345678901234567890");
+
+ bcm5821_hmac_md5(sc, k1, sizeof(k1), m1, strlen(m1));
+ bcm5821_hmac_md5(sc, k2, strlen(k2), m2, strlen(m2));
+ bcm5821_hmac_md5(sc, k3, sizeof(k3), m3, sizeof(m3));
+
+ return 0;
+}
+
+/* Output of md5 test suite (md5 -x)
+
+MD5 test suite:
+MD5 ("") = d41d8cd98f00b204e9800998ecf8427e
+MD5 ("a") = 0cc175b9c0f1b6a831c399e269772661
+MD5 ("abc") = 900150983cd24fb0d6963f7d28e17f72
+MD5 ("message digest") = f96b697d7cb7938d525a2f31aaf161d0
+MD5 ("abcdefghijklmnopqrstuvwxyz") = c3fcd3d76192e4007dfb496cca67e13b
+MD5 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") = d174ab98d277d9f5a5611c2c9f419d9f
+MD5 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") = 57edf4a22be3c955ac49da2e2107b67a
+
+*/
+
+/* HMAC-MD5 test suite
+
+Test Vectors (Trailing '\0' of a character string not included in test):
+
+ key = 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
+ key_len = 16 bytes
+ data = "Hi There"
+ data_len = 8 bytes
+ digest = 0x9294727a3638bb1c13f48ef8158bfc9d
+
+ key = "Jefe"
+ data = "what do ya want for nothing?"
+ data_len = 28 bytes
+ digest = 0x750c783e6ab0b503eaa86e310a5db738
+
+ key = 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ key_len 16 bytes
+ data = 0xDDDDDDDDDDDDDDDDDDDD...
+ ..DDDDDDDDDDDDDDDDDDDD...
+ ..DDDDDDDDDDDDDDDDDDDD...
+ ..DDDDDDDDDDDDDDDDDDDD...
+ ..DDDDDDDDDDDDDDDDDDDD
+ data_len = 50 bytes
+ digest = 0x56be34521d144c88dbb8c733f0e8b3f6
+
+*/
+#endif /* !_BCM14XX_ */
+
+
+#if 0 /* ---------- XXX still under construction XXX ---------- */
+
+static uint32_t *
+bcm5821_alloc_rng (int output_size)
+{
+ uint32_t *output;
+ uint32_t *mcr;
+ uint32_t *cmd;
+ int i;
+
+ output = (uint32_t *)KMALLOC(output_size, CACHE_LINE_SIZE);
+ for (i = 0; i < output_size/sizeof(uint32_t); i++)
+ output[i] = 0xDEADBEEF;
+
+ mcr = KMALLOC(MCR_WORDS(1)*4, CACHE_LINE_SIZE);
+ mcr[0] = V_MCR_NUM_PACKETS(1);
+
+ cmd = KMALLOC(16, CACHE_LINE_SIZE); /* Always allocate >= 64 bytes */
+ cmd[0] = V_CC_OPCODE(K_RNG_DIRECT) | V_CC_LEN(4);
+
+ mcr[1] = PHYS_TO_PCI(PTR_TO_PHYS(cmd));
+
+ /* input fragment */
+ mcr[2] = 0;
+ mcr[3] = 0;
+ mcr[4] = V_DBC_DATA_LEN(0);
+
+ mcr[5] = V_PD_PKT_LEN(output_size);
+
+ /* output fragment */
+ mcr[6] = PHYS_TO_PCI(PTR_TO_PHYS(output));
+ mcr[7] = 0;
+ mcr[8] = V_DBC_DATA_LEN(sizeof(output));
+
+ return mcr;
+}
+
+
+static uint32_t *
+bcm5821_alloc_ssl_mac (int msg_size)
+{
+ uint32_t *message;
+ uint32_t *cmd;
+ uint32_t *mcr;
+ uint32_t *hash;
+ int i;
+
+ message = KMALLOC(msg_size, CACHE_LINE_SIZE);
+ for (i = 0; i < msg_size; i++)
+ ((uint8_t *)message)[i] = i & 0xFF; /* was 0xDEADBEEF */
+
+ mcr = KMALLOC(MCR_WORDS(1)*4, CACHE_LINE_SIZE);
+ mcr[0] = V_MCR_NUM_PACKETS(1);
+
+ /* packet 1 */
+
+ cmd = KMALLOC(SSL_MAC_CMD_WORDS*4, CACHE_LINE_SIZE);
+ cmd[0] = V_CC_OPCODE(K_SSL_MAC) | V_CC_LEN(SSL_MAC_CMD_WORDS*4);
+ cmd[1] = V_CC_FLAGS(K_HASH_FLAGS_MD5);
+ for (i = 2; i < 6; i++)
+ cmd[i] = 0x01020304; /* XXX MAC write secret */
+ cmd[6] = 0x00000000; /* must be zero for SSL */
+ for (i = 7; i < 19; i++)
+ cmd[i] = 0x36363636;
+ cmd[19] = 0; /* seq num */
+ cmd[20] = 1;
+ cmd[21] = 0x03000000 | (msg_size << 8); /* type/len/rsvd */
+
+ mcr[1] = PHYS_TO_PCI(PTR_TO_PHYS(cmd));
+
+ /* input fragment */
+ mcr[2] = PHYS_TO_PCI(PTR_TO_PHYS(message));
+ mcr[3] = 0;
+ mcr[4] = V_DBC_DATA_LEN(msg_size);
+
+ mcr[5] = V_PD_PKT_LEN(msg_size);
+
+ hash = KMALLOC(5*4, CACHE_LINE_SIZE);
+ for (i = 0; i < 5; i++)
+ hash[i] = 0;
+
+ mcr[6] = 0;
+ mcr[7] = PHYS_TO_PCI(PTR_TO_PHYS(hash));
+ mcr[8] = 0;
+
+ return mcr;
+}
+
+static uint32_t *
+bcm5821_alloc_arc4 (int input_size)
+{
+ uint32_t *mcr;
+ uint32_t cmd[3 + 256/4];
+ uint32_t input[64], output[64];
+ uint32_t chain[3];
+ uint32_t update[1 + 256/4];
+ uint32_t status;
+ uint8_t *arc4_state;
+ int i;
+
+ xprintf("\nARC4\n");
+
+ status = READCSR(sc, R_DMA_STAT);
+ WRITECSR(sc, R_DMA_STAT, status); /* clear pending bits */
+ status = READCSR(sc, R_DMA_STAT);
+
+ for (i = 0; i < 64; i++)
+#if 0
+ input[i] = (i << 24) | ((i+1) << 16) | ((i+2) << 8) | (i+3);
+#else
+ input[i] = 0x5555AAAA;
+#endif
+ for (i = 0; i < 64; i++)
+ output[i] = 0xDEADBEEF;
+ for (i = 0; i < 1 + 256/4; i++)
+ update[i] = 0xFEEDFACE;
+
+ cmd[0] = V_CC_OPCODE(K_ARC4) | V_CC_LEN(sizeof(cmd));
+ cmd[1] = M_ARC4_FLAGS_WRITEBACK;
+#if 0
+ cmd[2] = 0x000100F3;
+#else
+ cmd[2] = 0x00000000;
+#endif
+ arc4_state = (uint8_t *)&cmd[3];
+ for (i = 0; i < 256; i++)
+ arc4_state[i] = i;
+
+ mcr[0] = V_MCR_NUM_PACKETS(1);
+
+ /* packet 1 */
+ mcr[1] = PHYS_TO_PCI(PTR_TO_PHYS(cmd));
+
+ /* input fragment */
+ mcr[2] = PHYS_TO_PCI(PTR_TO_PHYS(input));
+ mcr[3] = 0;
+ mcr[4] = V_DBC_DATA_LEN(sizeof(input));
+
+ mcr[5] = V_PD_PKT_LEN(sizeof(input));
+
+ /* output fragment */
+ mcr[6] = PHYS_TO_PCI(PTR_TO_PHYS(output));
+ mcr[7] = PHYS_TO_PCI(PTR_TO_PHYS(chain));
+ mcr[8] = V_DBC_DATA_LEN(sizeof(output));
+
+ /* output update */
+ chain[0] = PHYS_TO_PCI(PTR_TO_PHYS(update));
+ chain[1] = 0;
+ chain[2] = V_DBC_DATA_LEN(sizeof(update)); /* not actually used */
+
+ return mcr;
+}
+#endif /* 0 */
diff --git a/cfe/cfe/dev/dev_dc21143.c b/cfe/cfe/dev/dev_dc21143.c
new file mode 100644
index 0000000..f133cbb
--- /dev/null
+++ b/cfe/cfe/dev/dev_dc21143.c
@@ -0,0 +1,2388 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * DC2114x Ethernet Driver File: dev_dc21143.c
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "sbmips.h"
+
+#ifndef _SB_MAKE64
+#define _SB_MAKE64(x) ((uint64_t)(x))
+#endif
+#ifndef _SB_MAKEMASK1
+#define _SB_MAKEMASK1(n) (_SB_MAKE64(1) << _SB_MAKE64(n))
+#endif
+
+#include "lib_types.h"
+#include "lib_hssubr.h"
+#include "lib_malloc.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+#include "lib_queue.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_ioctl.h"
+#include "cfe_timer.h"
+#include "cfe_irq.h"
+
+#include "pcivar.h"
+#include "pcireg.h"
+
+#include "dc21143.h"
+#include "mii.h"
+
+/* This is a driver for specific configurations of the DC21041,
+ DC21140A and DC21143, not a generic Tulip driver. The prefix
+ "tulip_" is used to indicate generic Tulip functions, while
+ "dc21041_", "dc21140_" or "dc21143_" indicates functions specific
+ to a chip variant.
+
+ The 21041 driver assumes a 10BT HD interface, since autonegotiation
+ is known to be broken in the early revisons of that chip. Example
+ cards come from DEC.
+
+ The 21140 driver assumes that the PHY uses a standard MII interface
+ for both 100BT and 10BT. Example cards come from DEC (National DP83840
+ Twister PHY) and Netgear (Level One PHY).
+
+ The 21143 driver assumes that the PHY uses the SYM ("5 wire") interface
+ for 100BT with pass-through for 10BT. Example cards come from DEC
+ (MicroLinear ML6694 PHY) and Znyx (Kendin KS8761 PHY). There is no
+ support for MII or AUI interfaces.
+
+ This SB1250 version takes advantage of DMA coherence and uses
+ "preserve bit lanes" addresses for all accesses that cross the
+ ZBbus-PCI bridge. */
+
+#ifndef TULIP_DEBUG
+#define TULIP_DEBUG 0
+#endif
+
+#ifndef TULIP_TUNE
+#define TULIP_TUNE 1
+#endif
+
+#define ENET_ADDR_LEN 6 /* size of an ethernet address */
+#define MAX_ETHER_PACK 1518 /* max size of a packet */
+#define CRC_SIZE 4 /* size of CRC field */
+
+/* The following must be a multiple of 4. In late versions of the
+ tulip, the rx DMA engine also apparently writes beyond 1520 bytes
+ for received packets > 1516 bytes (WriteInvalidate only?). */
+#define ETH_BUFFER_SIZE 1536
+
+typedef struct eth_pkt_s {
+ queue_t next;
+ void *devctx;
+ unsigned char *buffer;
+ unsigned int flags;
+ int length;
+ /* packet data goes here, should always be longword aligned */
+} eth_pkt_t;
+
+/* packet flags */
+#define ETH_TX_SETUP 1
+
+static void
+show_packet(eth_pkt_t *pkt)
+{
+ int i;
+ int n = (pkt->length < 32 ? pkt->length : 32);
+
+ xprintf("[%4d]:", pkt->length);
+ for (i = 0; i < n; i++) {
+ if (i % 4 == 0)
+ xprintf(" ");
+ xprintf("%02x", pkt->buffer[i]);
+ }
+ xprintf("\n");
+}
+
+
+/* Descriptor structures */
+
+typedef struct rx_dscr {
+ uint32_t rxd_flags;
+ uint32_t rxd_bufsize;
+ uint32_t rxd_bufaddr1;
+ uint32_t rxd_bufaddr2;
+} rx_dscr;
+
+typedef struct tx_dscr {
+ uint32_t txd_flags;
+ uint32_t txd_bufsize;
+ uint32_t txd_bufaddr1;
+ uint32_t txd_bufaddr2;
+} tx_dscr;
+
+/* CAM structure */
+
+typedef union {
+ struct {
+ uint32_t physical[CAM_PERFECT_ENTRIES][3];
+ } p;
+ struct {
+ uint32_t hash[32];
+ uint32_t mbz[7];
+ uint32_t physical[3];
+ } h;
+} tulip_cam;
+
+
+typedef enum {
+ eth_state_uninit,
+ eth_state_setup,
+ eth_state_off,
+ eth_state_on,
+ eth_state_broken
+} eth_state_t;
+
+#define ETH_PKTPOOL_SIZE 20
+#define ETH_PKTBUF_SIZE (sizeof(eth_pkt_t) + ((ETH_BUFFER_SIZE+7)&~7))
+
+typedef struct tulip_softc {
+ uint32_t membase;
+ uint8_t irq; /* interrupt mapping (not currently used) */
+ pcitag_t tag; /* tag for configuration registers */
+
+ uint8_t hwaddr[ENET_ADDR_LEN];
+ uint16_t device; /* chip device code */
+ uint8_t revision; /* chip revision and step (Table 3-7) */
+
+ /* current state */
+ eth_state_t state;
+ int bus_errors;
+
+ /* These fields are the chip startup values. */
+// uint16_t media; /* media type */
+ uint32_t opmode; /* operating mode */
+ uint32_t intmask; /* interrupt mask */
+
+ /* This field is set before calling dc2114x_hwinit */
+ int linkspeed; /* encoding from cfe_ioctl */
+
+ /* Packet free list */
+ queue_t freelist;
+ uint8_t *pktpool;
+ queue_t rxqueue;
+
+ /* The descriptor tables */
+ uint8_t *rxdscrmem; /* receive descriptors */
+ uint8_t *txdscrmem; /* transmit descriptors */
+
+ eth_pkt_t **rxdscrinfo;
+ eth_pkt_t **txdscrinfo;
+
+ /* These fields keep track of where we are in tx/rx processing */
+ volatile rx_dscr *rxdscr_start; /* beginning of ring */
+ volatile rx_dscr *rxdscr_end; /* end of ring */
+ volatile rx_dscr *rxdscr_remove; /* next one we expect tulip to use */
+ volatile rx_dscr *rxdscr_add; /* next place to put a buffer */
+ int rxdscr_onring;
+
+ volatile tx_dscr *txdscr_start; /* beginning of ring */
+ volatile tx_dscr *txdscr_end; /* end of ring */
+ volatile tx_dscr *txdscr_remove; /* next one we will use for tx */
+ volatile tx_dscr *txdscr_add; /* next place to put a buffer */
+
+ /* These fields describe the PHY */
+ int mii_addr;
+
+} tulip_softc;
+
+
+/* Driver parameterization */
+
+#define MAXRXDSCR 16
+#define MAXTXDSCR 16
+#define MINRXRING 8
+
+#define MEDIA_UNKNOWN 0
+#define MEDIA_AUI 1
+#define MEDIA_BNC 2
+#define MEDIA_UTP_FULL_DUPLEX 3
+#define MEDIA_UTP_NO_LINK_TEST 4
+#define MEDIA_UTP 5
+
+/* Prototypes */
+
+static void tulip_ether_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+
+/* Address mapping macros */
+
+/* Note that PHYSADDR only works with 32-bit addresses, but the
+ so does the Tulip. */
+#define PHYSADDR(sc,x) (K0_TO_PHYS((uintptr_t)(x)))
+
+#define PCIADDR(a,b) ((uint32_t) (b))
+#define PCIADDRX(a,b) ((uint32_t) (b) | 0x20000000)
+#define PCI_TO_CPU(a) (a)
+
+#if __long64
+#define READCSR(sc,csr) \
+ (*((volatile uint32_t *) \
+ (PHYS_TO_XKSEG_UNCACHED(PCI_TO_CPU((sc)->membase)+(csr)))))
+
+#define WRITECSR(sc,csr,val) \
+ (*((volatile uint32_t *) \
+ (PHYS_TO_XKSEG_UNCACHED(PCI_TO_CPU((sc)->membase)+(csr)))) = (val))
+
+#else
+#define READCSR(sc,csr) \
+ (hs_read32(PHYS_TO_XKSEG_UNCACHED(PCI_TO_CPU((sc)->membase)+(csr))))
+
+#define WRITECSR(sc,csr,val) \
+ (hs_write32(PHYS_TO_XKSEG_UNCACHED(PCI_TO_CPU((sc)->membase)+(csr)), \
+ (val)))
+
+#endif
+
+
+#define RESET_ADAPTER(sc) \
+ { \
+ WRITECSR((sc), R_CSR_BUSMODE, M_CSR0_SWRESET); \
+ cfe_sleep(CFE_HZ/10); \
+ }
+
+
+/* Debugging */
+
+static void
+dumpstat(tulip_softc *sc)
+{
+ xprintf("-- CSR 5 = %08X CSR 6 = %08x\n",
+ READCSR(sc, R_CSR_STATUS), READCSR(sc, R_CSR_OPMODE));
+}
+
+static void
+dumpcsrs(tulip_softc *sc)
+{
+ int idx;
+
+ xprintf("-------------\n");
+ for (idx = 0; idx < 16; idx++) {
+ xprintf("CSR %2d = %08X\n", idx, READCSR(sc, idx*8));
+ }
+ xprintf("-------------\n");
+}
+
+
+/* Packet management */
+
+/* *********************************************************************
+ * ETH_ALLOC_PKT(s)
+ *
+ * Allocate a packet from the free list.
+ *
+ * Input parameters:
+ * s - eth structure
+ *
+ * Return value:
+ * pointer to packet structure, or NULL if none available
+ ********************************************************************* */
+#define ETHPKT_ALIGN ((uintptr_t) 4)
+
+static eth_pkt_t *
+eth_alloc_pkt(tulip_softc *s)
+{
+ uintptr_t addr;
+ eth_pkt_t *pkt;
+
+ pkt = (eth_pkt_t *) q_deqnext(&s->freelist);
+ if (!pkt) return NULL;
+
+ addr = (uintptr_t) (pkt+1);
+ if (addr & (ETHPKT_ALIGN-1)) {
+ addr = (addr + ETHPKT_ALIGN) & ~(ETHPKT_ALIGN-1);
+ }
+
+ pkt->buffer = (uint8_t *) addr;
+ pkt->length = ETH_BUFFER_SIZE;
+ pkt->flags = 0;
+
+ return pkt;
+}
+
+
+/* *********************************************************************
+ * ETH_FREE_PKT(s,pkt)
+ *
+ * Return a packet to the free list
+ *
+ * Input parameters:
+ * s - sbmac structure
+ * pkt - packet to return
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+static void
+eth_free_pkt(tulip_softc *s, eth_pkt_t *pkt)
+{
+ q_enqueue(&s->freelist, &pkt->next);
+}
+
+
+/* *********************************************************************
+ * ETH_INITFREELIST(s)
+ *
+ * Initialize the buffer free list for this mac. The memory
+ * allocated to the free list is carved up and placed on a linked
+ * list of buffers for use by the mac.
+ *
+ * Input parameters:
+ * s - eth structure
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+static void
+eth_initfreelist(tulip_softc *s)
+{
+ int idx;
+ unsigned char *ptr;
+ eth_pkt_t *pkt;
+
+ q_init(&s->freelist);
+
+ ptr = s->pktpool;
+ for (idx = 0; idx < ETH_PKTPOOL_SIZE; idx++) {
+ pkt = (eth_pkt_t *) ptr;
+ eth_free_pkt(s, pkt);
+ ptr += ETH_PKTBUF_SIZE;
+ }
+}
+
+
+/* Descriptor ring management */
+
+static int
+tulip_add_rcvbuf(tulip_softc *sc, eth_pkt_t *pkt)
+{
+ volatile rx_dscr *rxd;
+ volatile rx_dscr *nextrxd;
+ int idx;
+ uint32_t flags = 0;
+
+ rxd = sc->rxdscr_add;
+
+ /* Figure out where the next descriptor will go */
+ nextrxd = rxd+1;
+ if (nextrxd == sc->rxdscr_end) {
+ nextrxd = sc->rxdscr_start;
+ flags = M_RDES1_ENDOFRING;
+ }
+
+ /*
+ * If the next one is the same as our remove pointer,
+ * the ring is considered full. (it actually has room for
+ * one more, but we reserve the remove == add case for "empty")
+ */
+ if (nextrxd == sc->rxdscr_remove) return -1;
+
+ /* Save this packet pointer. */
+ idx = rxd - sc->rxdscr_start;
+ sc->rxdscrinfo[idx] = pkt;
+
+ rxd->rxd_bufsize = V_RDES1_BUF1SIZE(ETH_BUFFER_SIZE) | flags;
+ rxd->rxd_bufaddr1 = PCIADDRX(sc, PHYSADDR(sc, pkt->buffer));
+ rxd->rxd_bufaddr2 = 0;
+ rxd->rxd_flags = M_RDES0_OWNADAP;
+
+ /* success, advance the pointer */
+ sc->rxdscr_add = nextrxd;
+ sc->rxdscr_onring++;
+
+ return 0;
+}
+
+static void
+tulip_fillrxring(tulip_softc *sc)
+{
+ eth_pkt_t *pkt;
+
+ while (sc->rxdscr_onring < MINRXRING) {
+ pkt = eth_alloc_pkt(sc);
+ if (pkt == NULL) {
+ /* could not allocate a buffer */
+ break;
+ }
+ if (tulip_add_rcvbuf(sc, pkt) != 0) {
+ /* could not add buffer to ring */
+ eth_free_pkt(sc, pkt);
+ break;
+ }
+ }
+}
+
+
+/* *********************************************************************
+ * TULIP_RX_CALLBACK(sc, pkt)
+ *
+ * Receive callback routine. This routine is invoked when a
+ * buffer queued for receives is filled. In this simple driver,
+ * all we do is add the packet to a per-MAC queue for later
+ * processing, and try to put a new packet in the place of the one
+ * that was removed from the queue.
+ *
+ * Input parameters:
+ * sc - interface
+ * ptk - packet context (sbeth_pkt structure)
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+static void
+tulip_rx_callback(tulip_softc *sc, eth_pkt_t *pkt)
+{
+ if (TULIP_DEBUG) show_packet(pkt); /* debug */
+
+ q_enqueue(&sc->rxqueue, &pkt->next);
+
+ tulip_fillrxring(sc);
+}
+
+
+static void
+tulip_procrxring(tulip_softc *sc)
+{
+ volatile rx_dscr *rxd;
+ eth_pkt_t *pkt;
+ eth_pkt_t *newpkt;
+ int idx;
+ uint32_t flags;
+
+ for (;;) {
+ rxd = (volatile rx_dscr *) sc->rxdscr_remove;
+ idx = rxd - sc->rxdscr_start;
+
+ flags = rxd->rxd_flags;
+
+ if (flags & M_RDES0_OWNADAP) {
+ /* end of ring, no more packets */
+ break;
+ }
+
+ pkt = sc->rxdscrinfo[idx];
+
+ /* Drop error packets */
+ if (flags & M_RDES0_ERRORSUM) {
+ xprintf("DC2114x: rx error %04X\n", flags & 0xFFFF);
+ tulip_add_rcvbuf(sc, pkt);
+ goto next;
+ }
+
+ /* Pass up the packet */
+ pkt->length = G_RDES0_FRAMELEN(flags) - CRC_SIZE;
+ tulip_rx_callback(sc, pkt);
+
+ /* put a buffer back on the ring to replace this one */
+ newpkt = eth_alloc_pkt(sc);
+ if (newpkt) tulip_add_rcvbuf(sc, newpkt);
+
+next:
+ /* update the pointer, accounting for buffer wrap. */
+ rxd++;
+ if (rxd == sc->rxdscr_end)
+ rxd = sc->rxdscr_start;
+
+ sc->rxdscr_remove = (rx_dscr *) rxd;
+ sc->rxdscr_onring--;
+ }
+}
+
+
+static int
+tulip_add_txbuf(tulip_softc *sc, eth_pkt_t *pkt)
+{
+ volatile tx_dscr *txd;
+ volatile tx_dscr *nexttxd;
+ int idx;
+ uint32_t bufsize = 0;
+
+ txd = sc->txdscr_add;
+
+ /* Figure out where the next descriptor will go */
+ nexttxd = (txd+1);
+ if (nexttxd == sc->txdscr_end) {
+ nexttxd = sc->txdscr_start;
+ bufsize = M_TDES1_ENDOFRING;
+ }
+
+ /* If the next one is the same as our remove pointer,
+ the ring is considered full. (it actually has room for
+ one more, but we reserve the remove == add case for "empty") */
+
+ if (nexttxd == sc->txdscr_remove) return -1;
+
+ /* Save this packet pointer. */
+ idx = txd - sc->txdscr_start;
+ sc->txdscrinfo[idx] = pkt;
+
+ bufsize |= V_TDES1_BUF1SIZE(pkt->length) |
+ M_TDES1_FIRSTSEG | M_TDES1_LASTSEG | M_TDES1_INTERRUPT;
+ if (pkt->flags & ETH_TX_SETUP) {
+ /* For a setup packet, FIRSTSEG and LASTSEG should be clear (!) */
+ bufsize ^= M_TDES1_SETUP | M_TDES1_FIRSTSEG | M_TDES1_LASTSEG;
+ }
+ txd->txd_bufsize = bufsize;
+ txd->txd_bufaddr1 = PCIADDRX(sc, PHYSADDR(sc, pkt->buffer));
+ txd->txd_bufaddr2 = 0;
+ txd->txd_flags = M_TDES0_OWNADAP;
+
+ /* success, advance the pointer */
+ sc->txdscr_add = nexttxd;
+
+ return 0;
+}
+
+
+static int
+tulip_transmit(tulip_softc *sc,eth_pkt_t *pkt)
+{
+ tulip_add_txbuf(sc, pkt);
+
+ WRITECSR(sc, R_CSR_TXPOLL, 1);
+ return 0;
+}
+
+
+static void
+tulip_proctxring(tulip_softc *sc)
+{
+ volatile tx_dscr *txd;
+ eth_pkt_t *pkt;
+ int idx;
+ uint32_t flags;
+
+ for (;;) {
+ txd = (volatile tx_dscr *) sc->txdscr_remove;
+ idx = txd - sc->txdscr_start;
+
+ flags = txd->txd_flags;
+
+ if (txd == sc->txdscr_add) {
+ /* ring is empty, no buffers to process */
+ break;
+ }
+
+ if (flags & M_RDES0_OWNADAP) {
+ /* Reached a packet still being transmitted */
+ break;
+ }
+
+ /* Check for a completed setup packet */
+ pkt = sc->txdscrinfo[idx];
+ if (pkt->flags & ETH_TX_SETUP) {
+ if (sc->state == eth_state_setup) {
+ /* check flag bits */
+ sc->state = eth_state_on;
+ }
+ pkt->flags &=~ ETH_TX_SETUP;
+ }
+
+ /* Just free the packet */
+ eth_free_pkt(sc, pkt);
+
+ /* update the pointer, accounting for buffer wrap. */
+ txd++;
+ if (txd == sc->txdscr_end)
+ txd = sc->txdscr_start;
+
+ sc->txdscr_remove = (tx_dscr *) txd;
+ }
+}
+
+
+static void
+tulip_initrings(tulip_softc *sc)
+{
+ volatile tx_dscr *txd;
+ volatile rx_dscr *rxd;
+
+ /* Claim ownership of all transmit descriptors */
+
+ for (txd = sc->txdscr_start; txd != sc->txdscr_end; txd++)
+ txd->txd_flags = 0;
+ for (rxd = sc->rxdscr_start; rxd != sc->rxdscr_end; rxd++)
+ rxd->rxd_flags = 0;
+
+ /* Init the ring pointers */
+
+ sc->txdscr_add = sc->txdscr_remove = sc->txdscr_start;
+ sc->rxdscr_add = sc->rxdscr_remove = sc->rxdscr_start;
+ sc->rxdscr_onring = 0;
+
+ /* Add stuff to the receive ring */
+
+ tulip_fillrxring(sc);
+}
+
+
+static int
+tulip_init(tulip_softc *sc)
+{
+ /* Allocate descriptor rings and lookaside lists */
+ sc->rxdscrmem = KMALLOC(MAXRXDSCR*sizeof(rx_dscr),sizeof(rx_dscr));
+ sc->txdscrmem = KMALLOC(MAXTXDSCR*sizeof(tx_dscr),sizeof(tx_dscr));
+ sc->rxdscrinfo = KMALLOC(MAXRXDSCR*sizeof(eth_pkt_t *),sizeof(eth_pkt_t));
+ sc->txdscrinfo = KMALLOC(MAXTXDSCR*sizeof(eth_pkt_t *),sizeof(eth_pkt_t));
+
+ /* Allocate buffer pool */
+ sc->pktpool = KMALLOC(ETH_PKTPOOL_SIZE*ETH_PKTBUF_SIZE, 0);
+ eth_initfreelist(sc);
+ q_init(&sc->rxqueue);
+
+ /* Fill in pointers to the rings */
+ sc->rxdscr_start = (rx_dscr *) (sc->rxdscrmem);
+ sc->rxdscr_end = sc->rxdscr_start + MAXRXDSCR;
+ sc->rxdscr_add = sc->rxdscr_start;
+ sc->rxdscr_remove = sc->rxdscr_start;
+ sc->rxdscr_onring = 0;
+
+ sc->txdscr_start = (tx_dscr *) (sc->txdscrmem);
+ sc->txdscr_end = sc->txdscr_start + MAXTXDSCR;
+ sc->txdscr_add = sc->txdscr_start;
+ sc->txdscr_remove = sc->txdscr_start;
+
+ tulip_initrings(sc);
+
+ return 0;
+}
+
+
+static void
+tulip_resetrings(tulip_softc *sc)
+{
+ volatile tx_dscr *txd;
+ volatile rx_dscr *rxd;
+ int idx;
+
+ /* Free already-sent descriptors and buffers */
+ tulip_proctxring(sc);
+
+ /* Free any pending but unsent */
+ txd = (volatile tx_dscr *) sc->txdscr_remove;
+ while (txd != sc->txdscr_add) {
+ idx = txd - sc->txdscr_start;
+ eth_free_pkt(sc, sc->txdscrinfo[idx]);
+ txd->txd_flags &=~ M_TDES0_OWNADAP;
+
+ txd++;
+ if (txd == sc->txdscr_end)
+ txd = sc->txdscr_start;
+ }
+ sc->txdscr_add = sc->txdscr_remove;
+
+ /* Discard any received packets as well as all free buffers */
+ rxd = (volatile rx_dscr *) sc->rxdscr_remove;
+ while (rxd != sc->rxdscr_add) {
+ idx = rxd - sc->rxdscr_start;
+ eth_free_pkt(sc, sc->rxdscrinfo[idx]);
+ rxd->rxd_flags &=~ M_RDES0_OWNADAP;
+
+ rxd++;
+ if (rxd == sc->rxdscr_end)
+ rxd = sc->rxdscr_start;
+ sc->rxdscr_onring--;
+ }
+
+ /* Reestablish the initial state. */
+ tulip_initrings(sc);
+}
+
+
+/* CRCs */
+
+#define IEEE_CRC32_POLY 0xEDB88320UL /* CRC-32 Poly -- either endian */
+
+static uint32_t
+tulip_crc32(const uint8_t *databuf, unsigned int datalen)
+{
+ unsigned int idx, bit, data;
+ uint32_t crc;
+
+ crc = 0xFFFFFFFFUL;
+ for (idx = 0; idx < datalen; idx++)
+ for (data = *databuf++, bit = 0; bit < 8; bit++, data >>= 1)
+ crc = (crc >> 1) ^ (((crc ^ data) & 1) ? IEEE_CRC32_POLY : 0);
+ return crc;
+}
+
+#define tulip_mchash(mca) (tulip_crc32((mca), 6) & 0x1FF)
+
+
+/* Serial ROM access */
+
+/****************************************************************************
+ * tulip_spin(sc, ns)
+ *
+ * Spin for a short interval (nominally in nanoseconds)
+ *
+ * Input Parameters: ns - minimum required nsec.
+ *
+ * The delay loop uses uncached PCI reads, each of which requires
+ * at least 3 PCI bus clocks (45 ns at 66 MHz) to complete. The
+ * actual delay will be longer (much longer if preempted).
+ ***************************************************************************/
+
+#define PCI_MIN_DELAY 45
+
+static void
+tulip_spin(tulip_softc *sc, long nanoseconds)
+{
+ long delay;
+ volatile uint32_t t;
+
+ for (delay = nanoseconds; delay > 0; delay -= PCI_MIN_DELAY)
+ t = READCSR(sc, R_CSR_BUSMODE);
+}
+
+
+/*
+ * Delays below are chosen to meet specs for NS93C64 (slow M variant).
+ * Current parts are faster.
+ * Reference: NS Memory Data Book, 1994
+ */
+
+#define SROM_SIZE 128
+#define SROM_MAX_CYCLES 32
+
+#define SROM_CMD_BITS 3
+#define SROM_ADDR_BITS 6
+
+#define K_SROM_READ_CMD 06
+#define K_SROM_WRITE_CMD 05
+
+#define SROM_ADDR_OFFSET 0x14
+#define SROM_CRC_OFFSET (SROM_SIZE-2)
+
+
+static void
+srom_idle_state(tulip_softc *sc)
+{
+ uint32_t csr9;
+ unsigned int i;
+
+ csr9 = READCSR(sc, R_CSR_ROM_MII);
+
+ csr9 |= M_CSR9_SROMCHIPSEL;
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ tulip_spin(sc, 100); /* CS setup (Tcss=100) */
+
+ /* Run the clock through the maximum number of pending read cycles */
+ for (i = 0; i < SROM_MAX_CYCLES*2; i++) {
+ csr9 ^= M_CSR9_SROMCLOCK;
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ tulip_spin(sc, 1000); /* SK period (Fsk=0.5MHz) */
+ }
+
+ /* Deassert SROM Chip Select */
+ csr9 &=~ M_CSR9_SROMCHIPSEL;
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ tulip_spin(sc, 50); /* CS recovery (Tsks=50) */
+}
+
+static void
+srom_send_command_bit(tulip_softc *sc, unsigned int data)
+{
+ uint32_t csr9;
+
+ csr9 = READCSR(sc, R_CSR_ROM_MII);
+
+ /* Place the data bit on the bus */
+ if (data == 1)
+ csr9 |= M_CSR9_SROMDATAIN;
+ else
+ csr9 &=~ M_CSR9_SROMDATAIN;
+
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ tulip_spin(sc, 360); /* setup: Tdis=200 */
+
+ /* Now clock the data into the SROM */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9 | M_CSR9_SROMCLOCK);
+ tulip_spin(sc, 900); /* clock high, Tskh=500 */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ tulip_spin(sc, 450); /* clock low, Tskl=250 */
+
+ /* Now clear the data bit */
+ csr9 &=~ M_CSR9_SROMDATAIN; /* data invalid, Tidh=20 for SK^ */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ tulip_spin(sc, 270); /* min cycle, 1/Fsk=2000 */
+}
+
+static uint16_t
+srom_read_bit(tulip_softc *sc)
+{
+ uint32_t csr9;
+
+ csr9 = READCSR(sc, R_CSR_ROM_MII);
+
+ /* Generate a clock cycle before doing a read */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9 | M_CSR9_SROMCLOCK); /* rising edge */
+ tulip_spin(sc, 1000); /* clock high, Tskh=500, Tpd=1000 */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9); /* falling edge */
+ tulip_spin(sc, 1000); /* clock low, 1/Fsk=2000 */
+
+ csr9 = READCSR(sc, R_CSR_ROM_MII);
+ return ((csr9 & M_CSR9_SROMDATAOUT) != 0 ? 1 : 0);
+}
+
+#define CMD_BIT_MASK (1 << (SROM_CMD_BITS+SROM_ADDR_BITS-1))
+
+static uint16_t
+srom_read_word(tulip_softc *sc, unsigned int index)
+{
+ uint16_t command, word;
+ uint32_t csr9;
+ unsigned int i;
+
+ csr9 = READCSR(sc, R_CSR_ROM_MII) | M_CSR9_SROMCHIPSEL;
+
+ /* Assert the SROM CS line */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ tulip_spin(sc, 100); /* CS setup, Tcss = 100 */
+
+ /* Send the read command to the SROM */
+ command = (K_SROM_READ_CMD << SROM_ADDR_BITS) | index;
+ for (i = 0; i < SROM_CMD_BITS+SROM_ADDR_BITS; i++) {
+ srom_send_command_bit(sc, (command & CMD_BIT_MASK) != 0 ? 1 : 0);
+ command <<= 1;
+ }
+
+ /* Now read the bits from the SROM (MSB first) */
+ word = 0;
+ for (i = 0; i < 16; ++i) {
+ word <<= 1;
+ word |= srom_read_bit(sc);
+ }
+
+ /* Clear the SROM CS Line, CS hold, Tcsh = 0 */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9 &~ M_CSR9_SROMCHIPSEL);
+
+ return word;
+}
+
+
+/****************************************************************************
+ * srom_calc_crc()
+ *
+ * Calculate the CRC of the SROM and return it. We compute the
+ * CRC per Appendix A of the 21140A ROM/external register data
+ * sheet (EC-QPQWA-TE).
+ ***************************************************************************/
+
+static uint16_t
+srom_calc_crc(tulip_softc *sc, uint8_t srom[], int length)
+{
+ uint32_t crc = tulip_crc32(srom, length) ^ 0xffffffff;
+
+ return (uint16_t)(crc & 0xffff);
+}
+
+/****************************************************************************
+ * srom_read_all(sc, uint8_t dest)
+ *
+ * Read the entire SROM into the srom array
+ *
+ * Input parameters:
+ * sc - tulip state
+ ***************************************************************************/
+
+#define STORED_CRC(rom) \
+ ((rom)[SROM_CRC_OFFSET] | ((rom)[SROM_CRC_OFFSET+1] << 8))
+
+static int
+srom_read_all(tulip_softc *sc, uint8_t dest[])
+{
+ int i;
+ uint16_t crc, temp;
+
+ WRITECSR(sc, R_CSR_ROM_MII, M_CSR9_SERROMSEL|M_CSR9_ROMREAD);
+
+ srom_idle_state(sc);
+
+ for (i = 0; i < SROM_SIZE/2; i++) {
+ temp = srom_read_word(sc, i);
+ dest[2*i] = temp & 0xff;
+ dest[2*i+1] =temp >> 8;
+ }
+
+ WRITECSR(sc, R_CSR_ROM_MII, 0); /* CS hold, Tcsh=0 */
+
+ crc = srom_calc_crc(sc, dest, SROM_CRC_OFFSET);
+ if (crc != STORED_CRC(dest)) {
+ crc = srom_calc_crc(sc, dest, 94); /* "alternative" */
+ if (crc != STORED_CRC(dest)) {
+ xprintf("DC2114x: Invalid SROM CRC, calc %04x, stored %04x\n",
+ crc, STORED_CRC(dest));
+ return 0/*-1*/;
+ }
+ }
+ return 0;
+}
+
+static int
+srom_read_addr(tulip_softc *sc, uint8_t buf[])
+{
+ uint8_t srom[SROM_SIZE];
+
+ if (srom_read_all(sc, srom) == 0) {
+ memcpy(buf, &srom[SROM_ADDR_OFFSET], ENET_ADDR_LEN);
+ return 0;
+ }
+
+ return -1;
+}
+
+
+/****************************************************************************
+ * MII access utility routines
+ ***************************************************************************/
+
+/* MII clock limited to 2.5 MHz, transactions end with MDIO tristated */
+
+static void
+mii_write_bits(tulip_softc *sc, uint32_t data, unsigned int count)
+{
+ uint32_t csr9;
+ uint32_t bitmask;
+
+ csr9 = READCSR(sc, R_CSR_ROM_MII) &~ (M_CSR9_MDC | M_CSR9_MIIMODE);
+
+ for (bitmask = 1 << (count-1); bitmask != 0; bitmask >>= 1) {
+ csr9 &=~ M_CSR9_MDO;
+ if ((data & bitmask) != 0) csr9 |= M_CSR9_MDO;
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+
+ tulip_spin(sc, 2000); /* setup */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9 | M_CSR9_MDC);
+ tulip_spin(sc, 2000); /* hold */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ }
+}
+
+static void
+mii_turnaround(tulip_softc *sc)
+{
+ uint32_t csr9;
+
+ csr9 = READCSR(sc, R_CSR_ROM_MII) | M_CSR9_MIIMODE;
+
+ /* stop driving data */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ tulip_spin(sc, 2000); /* setup */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9 | M_CSR9_MDC);
+ tulip_spin(sc, 2000); /* clock high */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+
+ /* read back and check for 0 here? */
+}
+
+/****************************************************************************
+ * mii_read_register
+ *
+ * This routine reads a register from the PHY chip using the MII
+ * serial management interface.
+ *
+ * Input parameters:
+ * index - index of register to read (0-31)
+ *
+ * Return value:
+ * word read from register
+ ***************************************************************************/
+
+static uint16_t
+mii_read_register(tulip_softc *sc, unsigned int index)
+{
+ /* Send the command and address to the PHY. The sequence is
+ a synchronization sequence (32 1 bits)
+ a "start" command (2 bits)
+ a "read" command (2 bits)
+ the PHY addr (5 bits)
+ the register index (5 bits)
+ */
+ uint32_t csr9;
+ uint16_t word;
+ int i;
+
+ mii_write_bits(sc, 0xff, 8);
+ mii_write_bits(sc, 0xffffffff, 32);
+ mii_write_bits(sc, MII_COMMAND_START, 2);
+ mii_write_bits(sc, MII_COMMAND_READ, 2);
+ mii_write_bits(sc, sc->mii_addr /* XXX sc->phy.index */, 5);
+ mii_write_bits(sc, index, 5);
+
+ mii_turnaround(sc);
+
+ csr9 = (READCSR(sc, R_CSR_ROM_MII) &~ M_CSR9_MDC) | M_CSR9_MIIMODE;
+ word = 0;
+
+ for (i = 0; i < 16; i++) {
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ tulip_spin(sc, 2000); /* clock width low */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9 | M_CSR9_MDC);
+ tulip_spin(sc, 2000); /* clock width high */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ tulip_spin(sc, 1000); /* output delay */
+ word <<= 1;
+ if ((READCSR(sc, R_CSR_ROM_MII) & M_CSR9_MDI) != 0)
+ word |= 0x0001;
+ }
+
+ return word;
+
+ /* reset to output mode? */
+}
+
+/****************************************************************************
+ * mii_write_register
+ *
+ * This routine writes a register in the PHY chip using the MII
+ * serial management interface.
+ *
+ * Input parameters:
+ * index - index of register to write (0-31)
+ * value - word to write
+ ***************************************************************************/
+
+static void
+mii_write_register(tulip_softc *sc, unsigned int index, uint16_t value)
+{
+ mii_write_bits(sc, 0xff, 8);
+ mii_write_bits(sc, 0xffffffff, 32);
+ mii_write_bits(sc, MII_COMMAND_START, 2);
+ mii_write_bits(sc, MII_COMMAND_WRITE, 2);
+ mii_write_bits(sc, sc->mii_addr /* XXX sc->phy.index */, 5);
+ mii_write_bits(sc, index, 5);
+ mii_write_bits(sc, MII_COMMAND_ACK, 2);
+ mii_write_bits(sc, value, 16);
+
+ /* reset to input mode? */
+}
+
+
+static int
+mii_probe(tulip_softc *sc)
+{
+ int i;
+ uint16_t id1, id2;
+
+ for (i = 0; i < 32; i++) {
+ sc->mii_addr = i;
+ id1 = mii_read_register(sc, MII_PHYIDR1);
+ id2 = mii_read_register(sc, MII_PHYIDR2);
+ if ((id1 != 0xffff || id2 != 0xffff) &&
+ (id1 != 0x0000 || id2 != 0x0000)) {
+ return 0;
+ }
+ }
+ return -1;
+}
+
+#if 0
+static void
+mii_dump(tulip_softc *sc)
+{
+ int i;
+ uint16_t r;
+
+ for (i = 0; i <=6; ++i) {
+ r = mii_read_register(sc, i);
+ if (r != 0) xprintf("MII_REG%02x: %04x\n", i, r);
+ }
+ for (i = 21; i <= 25; ++i) {
+ r = mii_read_register(sc, i);
+ if (r != 0) printf("MII_REG%02x: %04x\n", i, r);
+ }
+}
+#else
+#define mii_dump(sc)
+#endif
+
+
+#if 0
+static void
+tulip_getaddr(tulip_softc *sc, uint8_t *buf)
+{
+ memcpy(buf, sc->hwaddr, ENET_ADDR_LEN);
+}
+#endif
+
+
+/* Chip specific code */
+
+static void
+dc21143_set_speed(tulip_softc *sc, int speed)
+{
+ uint32_t opmode = 0;
+
+ WRITECSR(sc, R_CSR_SIAMODE0, 0);
+
+ switch (speed) {
+ case ETHER_SPEED_AUTO:
+ break;
+ case ETHER_SPEED_10HDX:
+ default:
+ WRITECSR(sc, R_CSR_SIAMODE1, M_CSR14_10BT_HD);
+ WRITECSR(sc, R_CSR_SIAMODE2, M_CSR15_DEFAULT_VALUE);
+ opmode = M_CSR6_SPEED_10;
+ break;
+ case ETHER_SPEED_10FDX:
+ WRITECSR(sc, R_CSR_SIAMODE1, M_CSR14_10BT_FD);
+ WRITECSR(sc, R_CSR_SIAMODE2, M_CSR15_DEFAULT_VALUE);
+ opmode = M_CSR6_SPEED_10 | M_CSR6_FULLDUPLEX;
+ break;
+ case ETHER_SPEED_100HDX:
+ WRITECSR(sc, R_CSR_SIAMODE1, 0);
+ WRITECSR(sc, R_CSR_SIAMODE2, M_CSR15_DEFAULT_VALUE);
+ opmode = M_CSR6_SPEED_100;
+ break;
+ case ETHER_SPEED_100FDX:
+ WRITECSR(sc, R_CSR_SIAMODE1, 0);
+ WRITECSR(sc, R_CSR_SIAMODE2, M_CSR15_DEFAULT_VALUE);
+ opmode = M_CSR6_SPEED_100 | M_CSR6_FULLDUPLEX;
+ break;
+ }
+
+ WRITECSR(sc, R_CSR_SIAMODE0, M_CSR13_CONN_NOT_RESET);
+
+ opmode |= M_CSR6_MBO;
+#if TULIP_TUNE
+ opmode |= V_CSR6_THRESHCONTROL(K_CSR6_TXTHRES_128_72);
+#else
+ opmode |= M_CSR6_STOREFWD;
+#endif
+ WRITECSR(sc, R_CSR_OPMODE, opmode);
+}
+
+static void
+dc21143_autonegotiate(tulip_softc *sc)
+{
+ uint32_t opmode;
+ uint32_t tempword;
+ int count;
+ int linkspeed;
+
+ linkspeed = ETHER_SPEED_UNKNOWN;
+
+ /* Program the media setup into the CSRs. */
+ /* reset SIA */
+ WRITECSR(sc, R_CSR_SIAMODE0, 0);
+
+ /* set to speed_10, fullduplex to start_nway */
+ opmode =
+ M_CSR6_SPEED_10 |
+ M_CSR6_FULLDUPLEX |
+ M_CSR6_MBO;
+ WRITECSR(sc, R_CSR_OPMODE, opmode);
+
+ /* Choose advertised capabilities */
+ tempword =
+ M_CSR14_100BASETHALFDUP |
+ M_CSR14_100BASETFULLDUP |
+ M_CSR14_HALFDUPLEX10BASET;
+ WRITECSR(sc, R_CSR_SIAMODE1, tempword);
+
+ /* Enable autonegotiation */
+ tempword |= M_CSR14_AUTONEGOTIATE | 0xffff;
+ WRITECSR(sc, R_CSR_SIAMODE1, tempword);
+ WRITECSR(sc, R_CSR_SIAMODE2, M_CSR15_DEFAULT_VALUE);
+ WRITECSR(sc, R_CSR_OPMODE, opmode);
+ WRITECSR(sc, R_CSR_SIAMODE0, M_CSR13_CONN_NOT_RESET);
+
+ /* STATE check nway, poll until a valid 10/100mbs signal seen */
+ WRITECSR(sc, R_CSR_STATUS, M_CSR5_LINKPASS); /* try to clear this... */
+
+ /* (Re)start negotiation */
+ tempword = READCSR(sc, R_CSR_SIASTATUS);
+ tempword &=~ M_CSR12_AUTONEGARBIT;
+ tempword |= V_CSR12_AUTONEGARBIT(0x1);
+
+ for (count = 0; count <= 130; count++) {
+ tempword = READCSR(sc, R_CSR_STATUS);
+ if (tempword & M_CSR5_LINKPASS)
+ break;
+ cfe_sleep(CFE_HZ/100);
+ }
+
+ if (count > 130)
+ xprintf("DC21143: Link autonegotiation failed\n");
+
+ /* STATE configure nway, check to see if any abilities common to us.
+ If they do, set to highest mode, if not, we will see if the partner
+ will do 100mb or 10mb - then set it */
+
+ tempword = READCSR(sc, R_CSR_SIASTATUS);
+ /* clear the autonegogiate complete bit */
+ WRITECSR(sc, R_CSR_STATUS, M_CSR5_LINKPASS);
+
+ if (tempword & M_CSR12_LINKPARTNEG) {
+ /* A link partner was negogiated... */
+
+ xprintf("DC21143: Negotiated ");
+ if (tempword & 0x01000000) { /* 100FD */
+ xprintf("100Mb/s FDX");
+ linkspeed = ETHER_SPEED_100FDX;
+ }
+ else if (tempword & 0x00800000) { /* 100HD */
+ xprintf("100Mb/s HDX");
+ linkspeed = ETHER_SPEED_100HDX;
+ }
+ else if (tempword & 0x00400000) { /* 10FD */
+ xprintf("10Mb/s FDX");
+ linkspeed = ETHER_SPEED_10FDX;
+ }
+ else if (tempword & 0x00200000) { /* 10HD */
+ xprintf("10Mb/s HDX");
+ linkspeed = ETHER_SPEED_10HDX;
+ }
+ xprintf("\n");
+ }
+ else {
+ /* no link partner negotiation */
+ /* disable link for 1.3 seconds to break any existing connections */
+
+ /* xprintf("Disabling link, setting to 10mb half duplex\n"); */
+ dc21143_set_speed(sc, ETHER_SPEED_10HDX);
+ cfe_sleep(CFE_HZ/8);
+
+ tempword = READCSR(sc, R_CSR_SIASTATUS);
+
+ if ((tempword & 0x02) == 0) {
+ /* 100 mb signal present set to 100mb */
+ xprintf("No link partner... setting to 100mb/s HDX\n");
+ linkspeed = ETHER_SPEED_100HDX;
+ }
+ else if ((tempword & 0x04) == 0) {
+ /* 10 mb signal present */
+ xprintf("No link partner... setting to 10mb/s HDX\n");
+ linkspeed = ETHER_SPEED_10HDX;
+ }
+ else {
+ /* couldn't determine line speed, so set to 10mbs */
+ xprintf("Unknown; defaulting to 10Mb/s HDX\n");
+ linkspeed = ETHER_SPEED_10HDX;
+ }
+ }
+
+ dc21143_set_speed(sc, linkspeed);
+}
+
+static void
+dc21143_set_loopback(tulip_softc *sc, int mode)
+{
+ uint32_t v;
+
+ WRITECSR(sc, R_CSR_SIAMODE0, 0);
+ if (mode == ETHER_LOOPBACK_EXT) {
+ /* deal with CSRs 13-15 */
+ }
+ cfe_sleep(CFE_HZ/10); /* check this */
+
+ /* Update the SIA registers */
+ v = READCSR(sc, R_CSR_SIAMODE0);
+ WRITECSR(sc, R_CSR_SIAMODE0, v &~ 0xFFFF);
+ v = READCSR(sc, R_CSR_SIAMODE1);
+ WRITECSR(sc, R_CSR_SIAMODE1, v &~ 0xFFFF);
+ v = READCSR(sc, R_CSR_SIAMODE2);
+ WRITECSR(sc, R_CSR_SIAMODE2, v | 0xC000); /* WC of HCKR, RMP */
+ WRITECSR(sc, R_CSR_SIAMODE2, (v &~ 0xFFFF) | M_CSR15_GP_AUIBNC);
+
+ WRITECSR(sc, R_CSR_SIAMODE0, M_CSR13_CONN_NOT_RESET);
+}
+
+static void
+dc21143_hwinit(tulip_softc *sc)
+{
+ uint32_t v;
+ uint32_t csr6word, csr14word;
+
+ /* CSR0 - bus mode */
+ WRITECSR(sc, R_CSR_SIAMODE2, M_CSR15_CONFIG_GEPS_LEDS);
+#if TULIP_TUNE
+ v = V_CSR0_SKIPLEN(0) |
+ V_CSR0_CACHEALIGN(K_CSR0_ALIGN32) |
+ M_CSR0_READMULTENAB | M_CSR0_READLINEENAB |
+ M_CSR0_WRITEINVALENAB |
+ V_CSR0_BURSTLEN(K_CSR0_BURST32);
+#else
+ v = V_CSR0_SKIPLEN(0) |
+ V_CSR0_CACHEALIGN(K_CSR0_ALIGN128) |
+ V_CSR0_BURSTLEN(K_CSR0_BURST32);
+#endif
+#ifdef __MIPSEB
+ v |= M_CSR0_BIGENDIAN; /* big-endian data serialization */
+#endif
+ WRITECSR(sc, R_CSR_BUSMODE, v);
+
+ /* CSR6 - operation mode */
+ v = M_CSR6_PORTSEL |
+#if TULIP_TUNE
+ V_CSR6_THRESHCONTROL(K_CSR6_TXTHRES_128_72) |
+#else
+ M_CSR6_STOREFWD |
+#endif
+ M_CSR6_MBO |
+ M_CSR6_PCSFUNC |
+ M_CSR6_SCRAMMODE;
+ WRITECSR(sc, R_CSR_OPMODE, v);
+
+ /* About to muck the SIA, reset it.(?) */
+ /* WRITECSR(sc, R_CSR_SIASTATUS, 1); */
+
+ /* Must shut off all transmit/receive in order to attempt to
+ achieve Full Duplex */
+ csr6word = READCSR(sc, R_CSR_OPMODE);
+ WRITECSR(sc, R_CSR_OPMODE, csr6word &~ (M_CSR6_TXSTART | M_CSR6_RXSTART));
+ csr6word = READCSR(sc, R_CSR_OPMODE);
+
+ WRITECSR(sc, R_CSR_RXRING, PCIADDRX(sc, PHYSADDR(sc, sc->rxdscr_start)));
+ WRITECSR(sc, R_CSR_TXRING, PCIADDRX(sc, PHYSADDR(sc, sc->txdscr_start)));
+
+ if (sc->linkspeed == ETHER_SPEED_AUTO) {
+ dc21143_autonegotiate(sc);
+ }
+ else {
+ /* disable autonegotiate so we can set full duplex to on */
+ WRITECSR(sc, R_CSR_SIAMODE0, 0);
+ csr14word = READCSR(sc, R_CSR_SIAMODE1);
+ csr14word &=~ M_CSR14_AUTONEGOTIATE;
+ WRITECSR(sc, R_CSR_SIAMODE1, csr14word);
+ WRITECSR(sc, R_CSR_SIAMODE0, M_CSR13_CONN_NOT_RESET);
+
+ dc21143_set_speed(sc, sc->linkspeed);
+ }
+}
+
+
+static void
+dc21140_set_speed(tulip_softc *sc, int speed, int autoneg)
+{
+ uint16_t control;
+ uint16_t pcr;
+ uint32_t opmode = 0;
+
+ pcr = mii_read_register(sc, 0x17);
+ pcr |= (0x400|0x100|0x40|0x20);
+ mii_write_register(sc, 0x17, pcr);
+
+ control = mii_read_register(sc, MII_BMCR);
+
+ if (!autoneg) {
+ control &=~ (BMCR_ANENABLE | BMCR_RESTARTAN);
+ mii_write_register(sc, MII_BMCR, control);
+ control &=~ (BMCR_SPEED0 | BMCR_SPEED1 | BMCR_DUPLEX);
+ }
+
+ switch (speed) {
+ case ETHER_SPEED_10HDX:
+ default:
+ opmode = M_CSR6_SPEED_10_MII;
+ break;
+ case ETHER_SPEED_10FDX:
+ control |= BMCR_DUPLEX;
+ opmode = M_CSR6_SPEED_10_MII | M_CSR6_FULLDUPLEX;
+ break;
+ case ETHER_SPEED_100HDX:
+ control |= BMCR_SPEED100;
+ opmode = M_CSR6_SPEED_100_MII;
+ break;
+ case ETHER_SPEED_100FDX:
+ control |= BMCR_SPEED100 | BMCR_DUPLEX ;
+ opmode = M_CSR6_SPEED_100_MII | M_CSR6_FULLDUPLEX;
+ break;
+ }
+
+ if (!autoneg)
+ mii_write_register(sc, MII_BMCR, control);
+
+ opmode |= M_CSR6_MBO;
+#if TULIP_TUNE
+ opmode |= V_CSR6_THRESHCONTROL(K_CSR6_TXTHRES_128_72);
+#else
+ opmode |= M_CSR6_STOREFWD;
+#endif
+ WRITECSR(sc, R_CSR_OPMODE, opmode);
+#if 0
+ xprintf("setspeed PHY\n"); mii_dump(sc);
+#endif
+}
+
+static void
+dc21140_autonegotiate(tulip_softc *sc)
+{
+ uint16_t control, status, cap;
+ unsigned int timeout;
+ int linkspeed;
+ int autoneg;
+
+ linkspeed = ETHER_SPEED_UNKNOWN;
+
+ /* Read twice to clear latching bits */
+ status = mii_read_register(sc, MII_BMSR);
+ status = mii_read_register(sc, MII_BMSR);
+#if 0
+ xprintf("query PHY\n"); mii_dump(sc);
+#endif
+
+ if ((status & (BMSR_AUTONEG | BMSR_LINKSTAT)) ==
+ (BMSR_AUTONEG | BMSR_LINKSTAT))
+ control = mii_read_register(sc, MII_BMCR);
+ else {
+ /* reset the PHY */
+ mii_write_register(sc, MII_BMCR, BMCR_RESET);
+ timeout = 3000;
+ for (;;) {
+ control = mii_read_register(sc, MII_BMCR);
+ if ((control && BMCR_RESET) == 0) break;
+ cfe_sleep(CFE_HZ/2);
+ timeout -= 500;
+ if (timeout <= 0) break;
+ }
+ if ((control & BMCR_RESET) != 0) {
+ xprintf("DC21140: PHY reset failed\n");
+ return;
+ }
+
+ status = mii_read_register(sc, MII_BMSR);
+ cap = ((status >> 6) & (ANAR_TXFD | ANAR_TXHD | ANAR_10FD | ANAR_10HD))
+ | PSB_802_3;
+ mii_write_register(sc, MII_ANAR, cap);
+ control |= (BMCR_ANENABLE | BMCR_RESTARTAN);
+ mii_write_register(sc, MII_BMCR, control);
+
+ timeout = 3000;
+ for (;;) {
+ status = mii_read_register(sc, MII_BMSR);
+ if ((status & BMSR_ANCOMPLETE) != 0) break;
+ cfe_sleep(CFE_HZ/2);
+ timeout -= 500;
+ if (timeout <= 0) break;
+ }
+#if 0
+ xprintf("done PHY\n"); mii_dump(sc);
+#endif
+ }
+
+ if ((status & BMSR_ANCOMPLETE) != 0) {
+ /* A link partner was negogiated... */
+
+ uint16_t remote = mii_read_register(sc, MII_ANLPAR);
+
+ autoneg = 1;
+ xprintf("DC21140: Negotiated ");
+ if ((remote & ANLPAR_TXFD) != 0) {
+ xprintf("100Mb/s FDX");
+ linkspeed = ETHER_SPEED_100FDX;
+ }
+ else if ((remote & ANLPAR_TXHD) != 0) {
+ xprintf("100Mb/s HDX");
+ linkspeed = ETHER_SPEED_100HDX;
+ }
+ else if ((remote & ANLPAR_10FD) != 0) {
+ xprintf("10Mb/s FDX");
+ linkspeed = ETHER_SPEED_10FDX;
+ }
+ else if ((remote & ANLPAR_10HD) != 0) {
+ xprintf("10Mb/s HDX");
+ linkspeed = ETHER_SPEED_10HDX;
+ }
+ xprintf("\n");
+ }
+ else {
+ /* no link partner negotiation */
+
+ autoneg = 0;
+ xprintf("DC21140: MII negotiation failed, assuming 10BT\n");
+ control &=~ (BMCR_ANENABLE | BMCR_RESTARTAN);
+ mii_write_register(sc, MII_BMCR, control);
+ linkspeed = ETHER_SPEED_10HDX;
+ }
+
+ if ((status & BMSR_LINKSTAT) == 0)
+ mii_write_register(sc, MII_BMCR, control);
+ dc21140_set_speed(sc, linkspeed, autoneg);
+
+ status = mii_read_register(sc, MII_BMSR); /* clear latching bits */
+#if 0
+ xprintf("final PHY\n"); mii_dump(sc);
+#endif
+}
+
+static void
+dc21140_set_loopback(tulip_softc *sc, int mode)
+{
+ if (mode == ETHER_LOOPBACK_EXT)
+ xprintf("DC21140: external loopback mode NYI\n");
+}
+
+static void
+dc21140_hwinit(tulip_softc *sc)
+{
+ uint32_t v;
+ uint32_t csr6word;
+
+ /* The following assume GP port bits wired per the DEC reference design.
+ XXX Interpret the srom initialization strings instead */
+ WRITECSR(sc, R_CSR_GENPORT, M_CSR12_CONTROL | 0x1F);
+ WRITECSR(sc, R_CSR_GENPORT, 0); /* release PHY reset */
+
+ /* Select MII interface */
+ WRITECSR(sc, R_CSR_OPMODE, M_CSR6_PORTSEL);
+ RESET_ADAPTER(sc);
+
+ mii_probe(sc);
+
+ /* CSR0 - bus mode */
+#if TULIP_TUNE
+ v = V_CSR0_SKIPLEN(0) |
+ V_CSR0_CACHEALIGN(K_CSR0_ALIGN32) |
+ M_CSR0_READMULTENAB | M_CSR0_READLINEENAB |
+ M_CSR0_WRITEINVALENAB |
+ V_CSR0_BURSTLEN(K_CSR0_BURST32);
+#else
+ v = V_CSR0_SKIPLEN(0) |
+ V_CSR0_CACHEALIGN(K_CSR0_ALIGN128) |
+ V_CSR0_BURSTLEN(K_CSR0_BURST32);
+#endif
+#ifdef __MIPSEB
+ v |= M_CSR0_BIGENDIAN; /* big-endian data serialization */
+#endif
+ WRITECSR(sc, R_CSR_BUSMODE, v);
+
+ /* CSR6 - operation mode */
+ v = M_CSR6_PORTSEL |
+#if TULIP_TUNE
+ V_CSR6_THRESHCONTROL(K_CSR6_TXTHRES_128_72) |
+#else
+ M_CSR6_STOREFWD |
+#endif
+ M_CSR6_MBO;
+ WRITECSR(sc, R_CSR_OPMODE, v);
+
+ /* Must shut off all transmit/receive in order to attempt to
+ achieve Full Duplex */
+ csr6word = READCSR(sc, R_CSR_OPMODE);
+ WRITECSR(sc, R_CSR_OPMODE, csr6word &~ (M_CSR6_TXSTART | M_CSR6_RXSTART));
+ csr6word = READCSR(sc, R_CSR_OPMODE);
+
+ WRITECSR(sc, R_CSR_RXRING, PCIADDRX(sc, PHYSADDR(sc, sc->rxdscr_start)));
+ WRITECSR(sc, R_CSR_TXRING, PCIADDRX(sc, PHYSADDR(sc, sc->txdscr_start)));
+
+ if (sc->linkspeed == ETHER_SPEED_AUTO) {
+ dc21140_autonegotiate(sc);
+ }
+ else {
+ dc21140_set_speed(sc, sc->linkspeed, 0);
+ }
+}
+
+
+static void
+dc21041_set_loopback(tulip_softc *sc, int mode)
+{
+ uint32_t v;
+
+ WRITECSR(sc, R_CSR_SIAMODE0, 0);
+ if (mode == ETHER_LOOPBACK_EXT) {
+ /* deal with CSRs 13-15 */
+ }
+ cfe_sleep(CFE_HZ/10); /* check this */
+
+ /* Update the SIA registers */
+ v = READCSR(sc, R_CSR_SIAMODE0);
+ WRITECSR(sc, R_CSR_SIAMODE0, v &~ 0xFFFF);
+ WRITECSR(sc, R_CSR_SIAMODE1, 0x7A3F);
+ WRITECSR(sc, R_CSR_SIAMODE2, 0x0008);
+
+ WRITECSR(sc, R_CSR_SIAMODE0, 0xEF01);
+}
+
+static void
+dc21041_hwinit(tulip_softc *sc)
+{
+ uint32_t v;
+ uint32_t opmode;
+
+ /* CSR0 - bus mode */
+ v = V_CSR0_SKIPLEN(0) |
+ V_CSR0_CACHEALIGN(K_CSR0_ALIGN128) |
+ V_CSR0_BURSTLEN(K_CSR0_BURST32);
+#ifdef __MIPSEB
+ v |= M_CSR0_BIGENDIAN; /* big-endian data serialization */
+#endif
+ WRITECSR(sc, R_CSR_BUSMODE, v);
+
+ /* set initial interrupt mask here? */
+
+ WRITECSR(sc, R_CSR_RXRING, PCIADDRX(sc, PHYSADDR(sc, sc->rxdscr_start)));
+ WRITECSR(sc, R_CSR_TXRING, PCIADDRX(sc, PHYSADDR(sc, sc->txdscr_start)));
+
+ WRITECSR(sc, R_CSR_SIAMODE0, 0);
+
+ /* For now, always force 10BT, HDX */
+ WRITECSR(sc, R_CSR_SIAMODE1, 0x7F3F);
+ WRITECSR(sc, R_CSR_SIAMODE2, 0x0008);
+ opmode = M_CSR6_SPEED_10;
+
+ WRITECSR(sc, R_CSR_SIAMODE0, 0xEF01);
+ cfe_sleep(CFE_HZ/10);
+
+ opmode |= V_CSR6_THRESHCONTROL(K_CSR6_TXTHRES_128_72);
+ WRITECSR(sc, R_CSR_OPMODE, opmode);
+}
+
+
+static void
+tulip_hwinit(tulip_softc *sc)
+{
+ if (sc->state == eth_state_uninit) {
+ RESET_ADAPTER(sc);
+ sc->state = eth_state_off;
+ sc->bus_errors = 0;
+
+ switch (sc->device) {
+ case K_PCI_ID_DC21041:
+ dc21041_hwinit(sc);
+ break;
+ case K_PCI_ID_DC21140:
+ dc21140_hwinit(sc);
+ break;
+ case K_PCI_ID_DC21143:
+ dc21143_hwinit(sc);
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+
+static void
+tulip_isr(tulip_softc *sc)
+{
+ uint32_t status;
+ uint32_t csr5;
+
+ for (;;) {
+
+ /* Read the interrupt status. */
+ csr5 = READCSR(sc, R_CSR_STATUS);
+// status &= sc->intmask; /* keep only the bits we like. */
+ status = csr5 & (
+ M_CSR5_RXINT | M_CSR5_RXBUFUNAVAIL |
+ M_CSR5_TXINT | M_CSR5_TXUNDERFLOW |
+ M_CSR5_FATALBUSERROR);
+
+ /* if there are no more interrupts, leave now. */
+ if (status == 0) break;
+
+ /* Clear the pending interrupt. */
+ WRITECSR(sc, R_CSR_STATUS, status);
+
+ /* Now, test each unmasked bit in the interrupt register and
+ handle each interrupt type appropriately. */
+
+ if (status & M_CSR5_FATALBUSERROR) {
+ xprintf("DC21143: bus error %02x\n", G_CSR5_ERRORBITS(csr5));
+ dumpstat(sc);
+ sc->bus_errors++;
+ if (sc->bus_errors >= 2) {
+ dumpcsrs(sc);
+ RESET_ADAPTER(sc);
+ sc->state = eth_state_off;
+ sc->bus_errors = 0;
+ }
+ }
+
+ if (status & M_CSR5_RXINT) {
+ tulip_procrxring(sc);
+ }
+
+ if (status & M_CSR5_TXINT) {
+ tulip_proctxring(sc);
+ }
+
+ if (status & (M_CSR5_TXUNDERFLOW | M_CSR5_RXBUFUNAVAIL)) {
+ if (status & M_CSR5_TXUNDERFLOW) {
+ xprintf("DC21143: tx underrun, %08x\n", csr5);
+ /* Try to restart */
+ WRITECSR(sc, R_CSR_TXPOLL, 1);
+ }
+ if (status & M_CSR5_RXBUFUNAVAIL) {
+ /* Try to restart */
+ WRITECSR(sc, R_CSR_RXPOLL, 1);
+ }
+ }
+ }
+}
+
+
+static void
+tulip_start(tulip_softc *sc)
+{
+ uint32_t opmode;
+ int idx;
+ tulip_cam *cam;
+ eth_pkt_t *pkt;
+
+ tulip_hwinit(sc);
+
+ WRITECSR(sc, R_CSR_RXRING, PCIADDRX(sc, PHYSADDR(sc, sc->rxdscr_start)));
+ WRITECSR(sc, R_CSR_TXRING, PCIADDRX(sc, PHYSADDR(sc, sc->txdscr_start)));
+
+ opmode = READCSR(sc, R_CSR_OPMODE);
+ opmode &=~ M_CSR6_OPMODE; /* no loopback */
+ opmode |= (M_CSR6_TXSTART | M_CSR6_RXSTART);
+
+ sc->intmask = 0;
+ WRITECSR(sc, R_CSR_INTMASK, 0); /* no interrupts */
+ WRITECSR(sc, R_CSR_OPMODE, opmode);
+
+ pkt = eth_alloc_pkt(sc);
+ if (pkt) {
+ pkt->length = CAM_SETUP_BUFFER_SIZE;
+ cam = (tulip_cam *) pkt->buffer;
+
+#ifdef __MIPSEB
+ cam->p.physical[0][0] = (((uint32_t) sc->hwaddr[0] << 8) |
+ (uint32_t) sc->hwaddr[1]) << 16;
+ cam->p.physical[0][1] = (((uint32_t) sc->hwaddr[2] << 8) |
+ (uint32_t) sc->hwaddr[3]) << 16;
+ cam->p.physical[0][2] = (((uint32_t) sc->hwaddr[4] << 8) |
+ (uint32_t) sc->hwaddr[5]) << 16;
+ for (idx = 1; idx < CAM_PERFECT_ENTRIES; idx++) {
+ cam->p.physical[idx][0] = 0xFFFF0000;
+ cam->p.physical[idx][1] = 0xFFFF0000;
+ cam->p.physical[idx][2] = 0xFFFF0000;
+ }
+#else
+ cam->p.physical[0][0] = ((uint32_t) sc->hwaddr[0]) |
+ (((uint32_t) sc->hwaddr[1]) << 8);
+ cam->p.physical[0][1] = ((uint32_t) sc->hwaddr[2]) |
+ (((uint32_t) sc->hwaddr[3]) << 8);
+ cam->p.physical[0][2] = ((uint32_t) sc->hwaddr[4]) |
+ (((uint32_t) sc->hwaddr[5]) << 8);
+ for (idx = 1; idx < CAM_PERFECT_ENTRIES; idx++) {
+ cam->p.physical[idx][0] = 0x0000FFFF;
+ cam->p.physical[idx][1] = 0x0000FFFF;
+ cam->p.physical[idx][2] = 0x0000FFFF;
+ }
+#endif
+
+ pkt->flags |= ETH_TX_SETUP;
+ if (tulip_transmit(sc, pkt) != 0) {
+ xprintf("DC21143: failed setup\n");
+ dumpstat(sc);
+ eth_free_pkt(sc, pkt);
+ return;
+ }
+ sc->state = eth_state_setup;
+ }
+}
+
+static void
+tulip_stop(tulip_softc *sc)
+{
+ uint32_t opmode;
+ uint32_t status;
+ int count;
+
+ WRITECSR(sc, R_CSR_INTMASK, 0);
+ sc->intmask = 0;
+
+ opmode = READCSR(sc, R_CSR_OPMODE);
+ opmode &=~ (M_CSR6_TXSTART | M_CSR6_RXSTART);
+ WRITECSR(sc, R_CSR_OPMODE, opmode);
+
+ /* wait for any DMA activity to terminate */
+ for (count = 0; count <= 130; count++) {
+ status = READCSR(sc, R_CSR_STATUS);
+ if ((status & (M_CSR5_RXPROCSTATE | M_CSR5_TXPROCSTATE)) == 0)
+ break;
+ cfe_sleep(CFE_HZ/10);
+ }
+ if (count > 130) {
+ xprintf("DC21143: idle state not achieved\n");
+ dumpstat(sc);
+ }
+}
+
+
+static void
+tulip_start_loopback(tulip_softc *sc, int mode)
+{
+ uint32_t opmode;
+
+ opmode = READCSR(sc, R_CSR_OPMODE);
+
+ switch (sc->device) {
+ case K_PCI_ID_DC21041:
+ dc21041_set_loopback(sc, mode);
+ break;
+ case K_PCI_ID_DC21140:
+ dc21140_set_loopback(sc, mode);
+ break;
+ case K_PCI_ID_DC21143:
+ dc21143_set_loopback(sc, mode);
+ break;
+ default:
+ break;
+ }
+ cfe_sleep(CFE_HZ/10);
+
+ WRITECSR(sc, R_CSR_RXRING, PCIADDRX(sc, PHYSADDR(sc, sc->rxdscr_start)));
+ WRITECSR(sc, R_CSR_TXRING, PCIADDRX(sc, PHYSADDR(sc, sc->txdscr_start)));
+
+ sc->intmask = 0; /* no interrupts */
+ WRITECSR(sc, R_CSR_INTMASK, 0);
+
+ opmode &=~ (M_CSR6_OPMODE | M_CSR6_FULLDUPLEX);
+ opmode |= M_CSR6_PORTSEL;
+ if (mode == ETHER_LOOPBACK_EXT)
+ opmode |= M_CSR6_EXTLOOPBACK;
+ else
+ opmode |= M_CSR6_INTLOOPBACK;
+ opmode |= M_CSR6_TXSTART | M_CSR6_RXSTART;
+ WRITECSR(sc, R_CSR_OPMODE, opmode);
+}
+
+
+/* *********************************************************************
+ * ETH_PARSE_XDIGIT(c)
+ *
+ * Parse a hex digit, returning its value
+ *
+ * Input parameters:
+ * c - character
+ *
+ * Return value:
+ * hex value, or -1 if invalid
+ ********************************************************************* */
+static int
+eth_parse_xdigit(char c)
+{
+ int digit;
+
+ if ((c >= '0') && (c <= '9')) digit = c - '0';
+ else if ((c >= 'a') && (c <= 'f')) digit = c - 'a' + 10;
+ else if ((c >= 'A') && (c <= 'F')) digit = c - 'A' + 10;
+ else digit = -1;
+
+ return digit;
+}
+
+/* *********************************************************************
+ * ETH_PARSE_HWADDR(str,hwaddr)
+ *
+ * Convert a string in the form xx:xx:xx:xx:xx:xx into a 6-byte
+ * Ethernet address.
+ *
+ * Input parameters:
+ * str - string
+ * hwaddr - pointer to hardware address
+ *
+ * Return value:
+ * 0 if ok, else -1
+ ********************************************************************* */
+static int
+eth_parse_hwaddr(char *str, uint8_t *hwaddr)
+{
+ int digit1, digit2;
+ int idx = ENET_ADDR_LEN;
+
+ while (*str && (idx > 0)) {
+ digit1 = eth_parse_xdigit(*str);
+ if (digit1 < 0) return -1;
+ str++;
+ if (!*str) return -1;
+
+ if ((*str == ':') || (*str == '-')) {
+ digit2 = digit1;
+ digit1 = 0;
+ }
+ else {
+ digit2 = eth_parse_xdigit(*str);
+ if (digit2 < 0) return -1;
+ str++;
+ }
+
+ *hwaddr++ = (digit1 << 4) | digit2;
+ idx--;
+
+ if ((*str == ':') || (*str == '-'))
+ str++;
+ }
+ return 0;
+}
+
+/* *********************************************************************
+ * ETH_INCR_HWADDR(hwaddr,incr)
+ *
+ * Increment a 6-byte Ethernet hardware address, with carries
+ *
+ * Input parameters:
+ * hwaddr - pointer to hardware address
+ * incr - desired increment
+ *
+ * Return value:
+ * none
+ ********************************************************************* */
+static void
+eth_incr_hwaddr(uint8_t *hwaddr, unsigned incr)
+{
+ int idx;
+ int carry;
+
+ idx = 5;
+ carry = incr;
+ while (idx >= 0 && carry != 0) {
+ unsigned sum = hwaddr[idx] + carry;
+
+ hwaddr[idx] = sum & 0xff;
+ carry = sum >> 8;
+ idx--;
+ }
+}
+
+
+/* *********************************************************************
+ * Declarations for CFE Device Driver Interface routines
+ ********************************************************************* */
+
+static int tulip_ether_open(cfe_devctx_t *ctx);
+static int tulip_ether_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int tulip_ether_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat);
+static int tulip_ether_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int tulip_ether_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int tulip_ether_close(cfe_devctx_t *ctx);
+
+/* *********************************************************************
+ * CFE Device Driver dispatch structure
+ ********************************************************************* */
+
+const static cfe_devdisp_t tulip_ether_dispatch = {
+ tulip_ether_open,
+ tulip_ether_read,
+ tulip_ether_inpstat,
+ tulip_ether_write,
+ tulip_ether_ioctl,
+ tulip_ether_close,
+ NULL,
+ NULL
+};
+
+/* *********************************************************************
+ * CFE Device Driver descriptor
+ ********************************************************************* */
+
+const cfe_driver_t dc21143drv = {
+ "DC2114x Ethernet",
+ "eth",
+ CFE_DEV_NETWORK,
+ &tulip_ether_dispatch,
+ tulip_ether_probe
+};
+
+
+static int
+tulip_ether_attach(cfe_driver_t *drv,
+ pcitag_t tag, int index, uint8_t hwaddr[], int host)
+{
+ tulip_softc *softc;
+ uint32_t device;
+ uint32_t class;
+ uint32_t reg;
+ phys_addr_t pa;
+ char descr[100];
+ uint8_t romaddr[ENET_ADDR_LEN];
+#if 0 /* temporary */
+ int i;
+ uint8_t srom[SROM_SIZE];
+#endif
+
+ device = pci_conf_read(tag, R_CFG_CFID);
+
+ class = pci_conf_read(tag, R_CFG_CFRV);
+
+ reg = pci_conf_read(tag, R_CFG_CPMS);
+
+ reg = pci_conf_read(tag, R_CFG_CFDD);
+ pci_conf_write(tag, R_CFG_CFDD, 0);
+ reg = pci_conf_read(tag, R_CFG_CFDD);
+
+#if 1
+ /* Use memory space for the CSRs */
+ pci_map_mem(tag, R_CFG_CBMA, PCI_MATCH_BITS, &pa);
+#else
+ /* Use i/o space for the CSRs */
+ pci_map_io(tag, R_CFG_CBIO, PCI_MATCH_BITS, &pa);
+#endif
+
+ softc = (tulip_softc *) KMALLOC(sizeof(tulip_softc), 0);
+ if (softc == NULL) {
+ xprintf("DC2114x: No memory to complete probe\n");
+ return 0;
+ }
+
+ memset(softc, 0, sizeof(*softc));
+
+ softc->membase = (uint32_t)pa;
+
+ /* If we are in Host mode, we can receive interrupts. Otherwise,
+ we can see the CSRs but our CPU will not get interrupts. */
+ if (host)
+ softc->irq = pci_conf_read(tag, R_CFG_CFIT) & 0xFF;
+ else
+ softc->irq = 0xFF;
+
+ softc->tag = tag;
+ softc->device = PCI_PRODUCT(device);
+ softc->revision = PCI_REVISION(class);
+#if 1
+ softc->linkspeed = ETHER_SPEED_AUTO; /* select autonegotiation */
+#else
+ softc->linkspeed = ETHER_SPEED_100HDX; /* 100 Mbps, full duplex */
+#endif
+ memcpy(softc->hwaddr, hwaddr, ENET_ADDR_LEN);
+
+ tulip_init(softc);
+
+ /* Prefer address in srom */
+ if (srom_read_addr(softc, romaddr) == 0)
+ memcpy(softc->hwaddr, romaddr, ENET_ADDR_LEN);
+
+ softc->state = eth_state_uninit;
+
+ xsprintf(descr, "%s at 0x%X (%02x-%02x-%02x-%02x-%02x-%02x)",
+ drv->drv_description, softc->membase,
+ softc->hwaddr[0], softc->hwaddr[1], softc->hwaddr[2],
+ softc->hwaddr[3], softc->hwaddr[4], softc->hwaddr[5]);
+ cfe_attach(drv, softc, NULL, descr);
+ return 1;
+}
+
+
+/* *********************************************************************
+ * TULIP_ETHER_PROBE(drv,probe_a,probe_b,probe_ptr)
+ *
+ * Probe and install drivers for all DC2114x Ethernet controllers.
+ * For each, creates a context structure and attaches to the
+ * specified MAC devices.
+ *
+ * Input parameters:
+ * drv - driver descriptor
+ * probe_a - not used
+ * probe_b - not used
+ * probe_ptr - string pointer to hardware address for the first
+ * MAC, in the form xx:xx:xx:xx:xx:xx
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+static void
+tulip_ether_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr)
+{
+ int index;
+ int n;
+ uint8_t hwaddr[ENET_ADDR_LEN];
+
+ if (probe_ptr)
+ eth_parse_hwaddr((char *) probe_ptr, hwaddr);
+ else {
+ /* use default address 40-00-00-10-11-11 */
+ hwaddr[0] = 0x40; hwaddr[1] = 0x00;
+ hwaddr[2] = 0x00; hwaddr[3] = 0x10;
+ hwaddr[4] = 0x11; hwaddr[5] = 0x11;
+ }
+
+ n = 0;
+ index = 0;
+ for (;;) {
+ pcitag_t tag;
+ pcireg_t device;
+
+ if (pci_find_class(PCI_CLASS_NETWORK, index, &tag) != 0)
+ break;
+
+ index++;
+
+ device = pci_conf_read(tag, R_CFG_CFID);
+ if (PCI_VENDOR(device) != K_PCI_VENDOR_DEC)
+ continue;
+ switch (PCI_PRODUCT(device)) {
+ case K_PCI_ID_DC21041:
+ break;
+ case K_PCI_ID_DC21140:
+ break;
+ case K_PCI_ID_DC21143:
+ break;
+ default:
+ continue;
+ }
+
+ tulip_ether_attach(drv, tag, index, hwaddr, 1);
+
+ n++;
+ eth_incr_hwaddr(hwaddr, 1);
+ }
+}
+
+
+/* The functions below are called via the dispatch vector for the 2114x. */
+
+/* *********************************************************************
+ * TULIP_ETHER_OPEN(ctx)
+ *
+ * Open the Ethernet device. The MAC is reset, initialized, and
+ * prepared to receive and send packets.
+ *
+ * Input parameters:
+ * ctx - device context (includes ptr to our softc)
+ *
+ * Return value:
+ * status, 0 = ok
+ ********************************************************************* */
+static int
+tulip_ether_open(cfe_devctx_t *ctx)
+{
+ tulip_softc *softc = ctx->dev_softc;
+
+ if (softc->state == eth_state_on)
+ tulip_stop(softc);
+
+ tulip_start(softc);
+ softc->state = eth_state_on;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * TULIP_ETHER_READ(ctx,buffer)
+ *
+ * Read a packet from the Ethernet device. If no packets are
+ * available, the read will succeed but return 0 bytes.
+ *
+ * Input parameters:
+ * ctx - device context (includes ptr to our softc)
+ * buffer - pointer to buffer descriptor.
+ *
+ * Return value:
+ * status, 0 = ok
+ ********************************************************************* */
+static int
+tulip_ether_read(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ tulip_softc *softc = ctx->dev_softc;
+ eth_pkt_t *pkt;
+ int blen;
+
+ if (softc->state != eth_state_on) return -1;
+
+ tulip_isr(softc);
+
+ pkt = (eth_pkt_t *) q_deqnext(&(softc->rxqueue));
+
+ if (pkt == NULL) {
+ buffer->buf_retlen = 0;
+ return 0;
+ }
+
+ blen = buffer->buf_length;
+ if (blen > pkt->length) blen = pkt->length;
+
+ memcpy(buffer->buf_ptr, pkt->buffer, blen);
+ buffer->buf_retlen = blen;
+
+ eth_free_pkt(softc,pkt);
+ tulip_fillrxring(softc);
+ tulip_isr(softc);
+
+ return 0;
+}
+
+/* *********************************************************************
+ * TULIP_ETHER_INPSTAT(ctx,inpstat)
+ *
+ * Check for received packets on the Ethernet device
+ *
+ * Input parameters:
+ * ctx - device context (includes ptr to our softc)
+ * inpstat - pointer to input status structure
+ *
+ * Return value:
+ * status, 0 = ok
+ ********************************************************************* */
+static int
+tulip_ether_inpstat(cfe_devctx_t *ctx, iocb_inpstat_t *inpstat)
+{
+ tulip_softc *softc = ctx->dev_softc;
+
+ if (softc->state != eth_state_on) return -1;
+
+ tulip_isr(softc);
+
+ inpstat->inp_status = (q_isempty(&(softc->rxqueue))) ? 0 : 1;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * TULIP_ETHER_WRITE(ctx,buffer)
+ *
+ * Write a packet to the Ethernet device.
+ *
+ * Input parameters:
+ * ctx - device context (includes ptr to our softc)
+ * buffer - pointer to buffer descriptor.
+ *
+ * Return value:
+ * status, 0 = ok
+ ********************************************************************* */
+static int
+tulip_ether_write(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ tulip_softc *softc = ctx->dev_softc;
+ eth_pkt_t *pkt;
+ int blen;
+
+ if (softc->state != eth_state_on) return -1;
+
+ pkt = eth_alloc_pkt(softc);
+ if (!pkt) return -1;
+
+ blen = buffer->buf_length;
+ if (blen > pkt->length) blen = pkt->length;
+
+ memcpy(pkt->buffer, buffer->buf_ptr, blen);
+ pkt->length = blen;
+
+ tulip_isr(softc);
+
+ if (tulip_transmit(softc, pkt) != 0) {
+ eth_free_pkt(softc,pkt);
+ return -1;
+ }
+
+ tulip_isr(softc);
+
+ return 0;
+}
+
+/* *********************************************************************
+ * TULIP_ETHER_IOCTL(ctx,buffer)
+ *
+ * Do device-specific I/O control operations for the device
+ *
+ * Input parameters:
+ * ctx - device context (includes ptr to our softc)
+ * buffer - pointer to buffer descriptor.
+ *
+ * Return value:
+ * status, 0 = ok
+ ********************************************************************* */
+static int
+tulip_ether_ioctl(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ tulip_softc *softc = ctx->dev_softc;
+ int mode;
+
+ switch ((int)buffer->buf_ioctlcmd) {
+ case IOCTL_ETHER_GETHWADDR:
+ memcpy(buffer->buf_ptr, softc->hwaddr, sizeof(softc->hwaddr));
+ return 0;
+
+ case IOCTL_ETHER_SETHWADDR:
+ return -1; /* need to do this carefully */
+
+ /* XXX IOCTLs to set speed, etc.? */
+
+ case IOCTL_ETHER_GETLOOPBACK:
+ *((int *) buffer) = 0; /* XXX place holder */
+ return 0;
+
+ case IOCTL_ETHER_SETLOOPBACK:
+ tulip_stop(softc);
+ tulip_resetrings(softc);
+ mode = *((int *) buffer->buf_ptr);
+ if (mode == ETHER_LOOPBACK_INT || mode == ETHER_LOOPBACK_EXT) {
+ tulip_start_loopback(softc, mode);
+ }
+ else if (mode == ETHER_LOOPBACK_OFF) {
+ tulip_start(softc);
+ }
+ softc->state = eth_state_on;
+ return 0;
+
+ default:
+ return -1;
+ }
+}
+
+/* *********************************************************************
+ * TULIP_ETHER_CLOSE(ctx)
+ *
+ * Close the Ethernet device.
+ *
+ * Input parameters:
+ * ctx - device context (includes ptr to our softc)
+ *
+ * Return value:
+ * status, 0 = ok
+ ********************************************************************* */
+static int
+tulip_ether_close(cfe_devctx_t *ctx)
+{
+ tulip_softc *softc = ctx->dev_softc;
+
+ tulip_stop(softc);
+ softc->state = eth_state_off;
+
+ /* resynchronize descriptor rings */
+ tulip_resetrings(softc);
+
+ return 0;
+}
diff --git a/cfe/cfe/dev/dev_dp83815.c b/cfe/cfe/dev/dev_dp83815.c
new file mode 100644
index 0000000..b9fb644
--- /dev/null
+++ b/cfe/cfe/dev/dev_dp83815.c
@@ -0,0 +1,2290 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * NS DP83815 Ethernet Driver File: dev_dp83815.c
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "sbmips.h"
+
+#ifndef _SB_MAKE64
+#define _SB_MAKE64(x) ((uint64_t)(x))
+#endif
+#ifndef _SB_MAKEMASK1
+#define _SB_MAKEMASK1(n) (_SB_MAKE64(1) << _SB_MAKE64(n))
+#endif
+
+#include "lib_types.h"
+#include "lib_hssubr.h"
+#include "lib_malloc.h"
+#include "lib_string.h"
+#define blockcopy memcpy
+#include "lib_printf.h"
+#include "lib_queue.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_ioctl.h"
+#include "cfe_timer.h"
+#include "cfe_error.h"
+#include "cfe_irq.h"
+
+#include "pcivar.h"
+#include "pcireg.h"
+
+#include "dp83815.h"
+#include "mii.h"
+
+/* This is a driver for the National Semiconductor DP83815 (MacPhyter)
+ 10/100 MAC with integrated PHY.
+
+ The current version has been developed for the Netgear FA311 and
+ FA312 NICs. These include an EEPROM with automatically loaded
+ setup information that includes station address filtering.
+ Operation without such an EEPROM has not been tested.
+
+ This SB1250 version takes advantage of DMA coherence and uses
+ "preserve bit lanes" addresses for all accesses that cross the
+ ZBbus-PCI bridge. */
+
+#ifndef MACPHYTER_DEBUG
+#define MACPHYTER_DEBUG 0
+#endif
+#ifndef MACPHYTER_TEST
+#define MACPHYTER_TEST 0
+#endif
+
+/* Set IPOLL to drive processing through the pseudo-interrupt
+ dispatcher. Set XPOLL to drive processing by an external polling
+ agent. Setting both is ok. */
+
+#ifndef IPOLL
+#define IPOLL 0
+#endif
+#ifndef XPOLL
+#define XPOLL 1
+#endif
+
+#define ENET_ADDR_LEN 6 /* size of an ethernet address */
+#define MIN_ETHER_PACK 64 /* min size of a packet */
+#define MAX_ETHER_PACK 1518 /* max size of a packet */
+#define CRC_SIZE 4 /* size of CRC field */
+
+/* Packet buffers. For the DP83815, an rx packet must be aligned to a
+ 32-bit word boundary, and we would like it aligned to a cache line
+ boundary for performance. Also, the buffers "should" be allocated
+ in 32 byte multiples (5.3.2). */
+
+#define ETH_PKTBUF_LEN (((MAX_ETHER_PACK+31)/32)*32)
+
+#if __long64
+typedef struct eth_pkt_s {
+ queue_t next; /* 16 */
+ uint8_t *buffer; /* 8 */
+ uint32_t flags; /* 4 */
+ int32_t length; /* 4 */
+ uint8_t data[ETH_PKTBUF_LEN];
+} eth_pkt_t;
+#else
+typedef struct eth_pkt_s {
+ queue_t next; /* 8 */
+ uint8_t *buffer; /* 4 */
+ uint32_t flags; /* 4 */
+ int32_t length; /* 4 */
+ uint32_t unused[3]; /* 12 */
+ uint8_t data[ETH_PKTBUF_LEN];
+} eth_pkt_t;
+#endif
+
+#define CACHE_ALIGN 32
+#define ETH_PKTBUF_LINES ((sizeof(eth_pkt_t) + (CACHE_ALIGN-1))/CACHE_ALIGN)
+#define ETH_PKTBUF_SIZE (ETH_PKTBUF_LINES*CACHE_ALIGN)
+#define ETH_PKTBUF_OFFSET (offsetof(eth_pkt_t, data))
+
+#define ETH_PKT_BASE(data) ((eth_pkt_t *)((data) - ETH_PKTBUF_OFFSET))
+
+/* packet flags */
+#define ETH_TX_SETUP 1 /* assumes Perfect Filtering format */
+
+static void
+show_packet(char c, eth_pkt_t *pkt)
+{
+ int i;
+ int n = (pkt->length < 32 ? pkt->length : 32);
+
+ xprintf("%c[%4d]:", c, pkt->length);
+ for (i = 0; i < n; i++) {
+ if (i % 4 == 0)
+ xprintf(" ");
+ xprintf("%02x", pkt->buffer[i]);
+ }
+ xprintf("\n");
+}
+
+
+/* Descriptor structures. NOTE: To avoid having descriptors straddle
+ cache lines, we append a pad word, ignored by DMA, to each. */
+
+typedef struct rx_dscr {
+ pci_addr_t rxd_link;
+ uint32_t rxd_cmdsts;
+ pci_addr_t rxd_bufptr;
+ uint32_t rxd_pad;
+} rx_dscr;
+
+typedef struct tx_dscr {
+ pci_addr_t txd_link;
+ uint32_t txd_cmdsts;
+ pci_addr_t txd_bufptr;
+ uint32_t txd_pad;
+} tx_dscr;
+
+
+/* Driver data structures */
+
+typedef enum {
+ eth_state_uninit,
+ eth_state_off,
+ eth_state_on,
+ eth_state_broken
+} eth_state_t;
+
+#define ETH_PKTPOOL_SIZE 32
+
+typedef struct dp83815_softc {
+ uint32_t membase;
+ uint8_t irq; /* interrupt mapping (used if IPOLL) */
+ pcitag_t tag; /* tag for configuration registers */
+
+ uint8_t hwaddr[ENET_ADDR_LEN];
+ uint16_t device; /* chip device code */
+ uint8_t revision; /* chip revision and step */
+
+ eth_state_t state; /* current state */
+ uint32_t intmask; /* interrupt mask */
+
+ /* These fields are set before calling dp83815_hwinit */
+ int linkspeed; /* encodings from cfe_ioctl */
+ int loopback;
+
+ /* Packet free list */
+ queue_t freelist;
+ uint8_t *pktpool;
+ queue_t rxqueue;
+
+ /* The descriptor tables */
+ uint8_t *rxdscrmem; /* receive descriptors */
+ uint8_t *txdscrmem; /* transmit descriptors */
+
+ /* These fields keep track of where we are in tx/rx processing */
+ volatile rx_dscr *rxdscr_start; /* beginning of ring */
+ volatile rx_dscr *rxdscr_end; /* end of ring */
+ volatile rx_dscr *rxdscr_remove; /* next one we expect DMA to use */
+ volatile rx_dscr *rxdscr_add; /* next place to put a buffer */
+ int rxdscr_onring;
+
+ volatile tx_dscr *txdscr_start; /* beginning of ring */
+ volatile tx_dscr *txdscr_end; /* end of ring */
+ volatile tx_dscr *txdscr_remove; /* next one we will use for tx */
+ volatile tx_dscr *txdscr_add; /* next place to put a buffer */
+
+ cfe_devctx_t *devctx;
+
+ /* These fields describe the PHY */
+ int phy_addr;
+ int phy_check;
+ uint32_t phy_status;
+
+ /* Statistics */
+ uint32_t inpkts;
+ uint32_t outpkts;
+ uint32_t interrupts;
+ uint32_t rx_interrupts;
+ uint32_t tx_interrupts;
+ uint32_t bus_errors;
+} dp83815_softc;
+
+
+/* Entry to and exit from critical sections (currently relative to
+ interrupts only, not SMP) */
+
+#if CFG_INTERRUPTS
+#define CS_ENTER(sc) cfe_disable_irq(sc->irq)
+#define CS_EXIT(sc) cfe_enable_irq(sc->irq)
+#else
+#define CS_ENTER(sc) ((void)0)
+#define CS_EXIT(sc) ((void)0)
+#endif
+
+
+/* Driver parameterization */
+
+#define MAXRXDSCR 32
+#define MAXTXDSCR 32
+#define MINRXRING 8
+
+
+/* Prototypes */
+
+static void dp83815_ether_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+
+/* Address mapping macros */
+
+/* Note that PTR_TO_PHYS only works with 32-bit addresses, but then
+ so does the dp83815. */
+#define PTR_TO_PHYS(x) (K0_TO_PHYS((uintptr_t)(x)))
+#define PHYS_TO_PTR(a) ((uint8_t *)PHYS_TO_K0(a))
+
+/* All mappings through the PCI host bridge use match bits mode. */
+#define PHYS_TO_PCI(a) ((uint32_t) (a) | 0x20000000)
+#define PCI_TO_PHYS(a) ((uint32_t) (a) & 0x1FFFFFFF)
+
+#define PCI_TO_PTR(a) (PHYS_TO_PTR(PCI_TO_PHYS(a)))
+#define PTR_TO_PCI(x) (PHYS_TO_PCI(PTR_TO_PHYS(x)))
+
+#if __long64
+#define READCSR(sc,csr) \
+ (*((volatile uint32_t *) (PHYS_TO_XKSEG_UNCACHED((sc)->membase + (csr)))))
+
+#define WRITECSR(sc,csr,val) \
+ (*((volatile uint32_t *) \
+ (PHYS_TO_XKSEG_UNCACHED((sc)->membase + (csr)))) = (val))
+
+#else
+#define READCSR(sc,csr) \
+ (hs_read32(PHYS_TO_XKSEG_UNCACHED((sc)->membase + (csr))))
+
+#define WRITECSR(sc,csr,val) \
+ (hs_write32(PHYS_TO_XKSEG_UNCACHED((sc)->membase + (csr)), (val)))
+
+#endif
+
+#define RESET_ADAPTER(sc) \
+ { \
+ /* XXX */ \
+ }
+
+
+/* Debugging */
+
+static void
+dumpstat(dp83815_softc *sc)
+{
+ xprintf("-- CR = %08X CFG = %08x\n",
+ READCSR(sc, R_CR), READCSR(sc, R_CFG));
+}
+
+static void
+dumpcsrs(dp83815_softc *sc)
+{
+ int reg;
+
+ xprintf("-------------\n");
+ for (reg = 0; reg < R_MIBC; reg += 4) {
+ xprintf("CSR %02X = %08X\n", reg, READCSR(sc, reg));
+ }
+ xprintf("-------------\n");
+}
+
+
+/* Packet management */
+
+/* *********************************************************************
+ * ETH_ALLOC_PKT(sc)
+ *
+ * Allocate a packet from the free list.
+ *
+ * Input parameters:
+ * sc - eth structure
+ *
+ * Return value:
+ * pointer to packet structure, or NULL if none available
+ ********************************************************************* */
+static eth_pkt_t *
+eth_alloc_pkt(dp83815_softc *sc)
+{
+ eth_pkt_t *pkt;
+
+ CS_ENTER(sc);
+ pkt = (eth_pkt_t *) q_deqnext(&sc->freelist);
+ CS_EXIT(sc);
+ if (!pkt) return NULL;
+
+ pkt->buffer = pkt->data;
+ pkt->length = ETH_PKTBUF_LEN;
+ pkt->flags = 0;
+
+ return pkt;
+}
+
+
+/* *********************************************************************
+ * ETH_FREE_PKT(sc,pkt)
+ *
+ * Return a packet to the free list
+ *
+ * Input parameters:
+ * sc - sbmac structure
+ * pkt - packet to return
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+static void
+eth_free_pkt(dp83815_softc *sc, eth_pkt_t *pkt)
+{
+ CS_ENTER(sc);
+ q_enqueue(&sc->freelist, &pkt->next);
+ CS_EXIT(sc);
+}
+
+
+/* *********************************************************************
+ * ETH_INITFREELIST(sc)
+ *
+ * Initialize the buffer free list for this mac. The memory
+ * allocated to the free list is carved up and placed on a linked
+ * list of buffers for use by the mac.
+ *
+ * Input parameters:
+ * sc - eth structure
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+static void
+eth_initfreelist(dp83815_softc *sc)
+{
+ int idx;
+ uint8_t *ptr;
+ eth_pkt_t *pkt;
+
+ q_init(&sc->freelist);
+
+ ptr = sc->pktpool;
+ for (idx = 0; idx < ETH_PKTPOOL_SIZE; idx++) {
+ pkt = (eth_pkt_t *) ptr;
+ eth_free_pkt(sc, pkt);
+ ptr += ETH_PKTBUF_SIZE;
+ }
+}
+
+
+/* Utilities */
+
+static const char *
+dp83815_devname(dp83815_softc *sc)
+{
+ return (sc->devctx != NULL ? cfe_device_name(sc->devctx) : "eth?");
+}
+
+
+/* Descriptor ring management */
+
+static int
+dp83815_add_rcvbuf(dp83815_softc *sc, eth_pkt_t *pkt)
+{
+ volatile rx_dscr *rxd;
+ volatile rx_dscr *nextrxd;
+
+ rxd = sc->rxdscr_add;
+
+ /* Figure out where the next descriptor will go */
+ nextrxd = rxd+1;
+ if (nextrxd == sc->rxdscr_end) {
+ nextrxd = sc->rxdscr_start;
+ }
+
+ /*
+ * If the next one is the same as our remove pointer,
+ * the ring is considered full. (it actually has room for
+ * one more, but we reserve the remove == add case for "empty")
+ */
+ if (nextrxd == sc->rxdscr_remove) return -1;
+
+ rxd->rxd_bufptr = PTR_TO_PCI(pkt->buffer);
+ rxd->rxd_cmdsts = M_DES1_INTR | V_DES1_SIZE(ETH_PKTBUF_LEN);
+
+ /* success, advance the pointer */
+ sc->rxdscr_add = nextrxd;
+ CS_ENTER(sc);
+ sc->rxdscr_onring++;
+ CS_EXIT(sc);
+
+ return 0;
+}
+
+static void
+dp83815_fillrxring(dp83815_softc *sc)
+{
+ eth_pkt_t *pkt;
+
+ while (1) {
+ CS_ENTER(sc);
+ if (sc->rxdscr_onring >= MINRXRING) {
+ CS_EXIT(sc);
+ break;
+ }
+ CS_EXIT(sc);
+ pkt = eth_alloc_pkt(sc);
+ if (pkt == NULL) {
+ /* could not allocate a buffer */
+ break;
+ }
+ if (dp83815_add_rcvbuf(sc, pkt) != 0) {
+ /* could not add buffer to ring */
+ eth_free_pkt(sc, pkt);
+ break;
+ }
+ }
+}
+
+
+/* *********************************************************************
+ * DP83815_RX_CALLBACK(sc, pkt)
+ *
+ * Receive callback routine. This routine is invoked when a
+ * buffer queued for receives is filled. In this simple driver,
+ * all we do is add the packet to a per-MAC queue for later
+ * processing, and try to put a new packet in the place of the one
+ * that was removed from the queue.
+ *
+ * Input parameters:
+ * sc - interface
+ * ptk - packet context (eth_pkt structure)
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+static void
+dp83815_rx_callback(dp83815_softc *sc, eth_pkt_t *pkt)
+{
+ if (MACPHYTER_DEBUG) show_packet('>', pkt); /* debug */
+
+ CS_ENTER(sc);
+ q_enqueue(&sc->rxqueue, &pkt->next);
+ CS_EXIT(sc);
+ sc->inpkts++;
+
+ dp83815_fillrxring(sc);
+}
+
+
+static void
+dp83815_procrxring(dp83815_softc *sc)
+{
+ volatile rx_dscr *rxd;
+ eth_pkt_t *pkt;
+ eth_pkt_t *newpkt;
+ uint32_t cmdsts;
+
+ for (;;) {
+ rxd = (volatile rx_dscr *) sc->rxdscr_remove;
+
+ cmdsts = rxd->rxd_cmdsts;
+ if ((cmdsts & M_DES1_OWN) == 0) {
+ /* end of ring, no more packets */
+ break;
+ }
+
+ pkt = ETH_PKT_BASE(PCI_TO_PTR(rxd->rxd_bufptr));
+ pkt->length = G_DES1_SIZE(cmdsts) - CRC_SIZE;
+
+ /* Drop error packets */
+ if (cmdsts & M_DES1_RX_ERRORS) {
+#if MACPHYTER_DEBUG
+ if (pkt->length >= MIN_ETHER_PACK - CRC_SIZE)
+ xprintf("%s: rx error %08X\n", dp83815_devname(sc), cmdsts);
+#endif
+ dp83815_add_rcvbuf(sc, pkt);
+ goto next;
+ }
+
+ /* Pass up the packet */
+ dp83815_rx_callback(sc, pkt);
+
+ /* put a buffer back on the ring to replace this one */
+ newpkt = eth_alloc_pkt(sc);
+ if (newpkt) dp83815_add_rcvbuf(sc, newpkt);
+
+next:
+ /* update the pointer, accounting for buffer wrap. */
+ rxd++;
+ if (rxd == sc->rxdscr_end)
+ rxd = sc->rxdscr_start;
+
+ sc->rxdscr_remove = (rx_dscr *) rxd;
+ CS_ENTER(sc);
+ sc->rxdscr_onring--;
+ CS_EXIT(sc);
+ }
+}
+
+
+static int
+dp83815_add_txbuf(dp83815_softc *sc, eth_pkt_t *pkt)
+{
+ volatile tx_dscr *txd;
+ volatile tx_dscr *nexttxd;
+
+ txd = sc->txdscr_add;
+
+ /* Figure out where the next descriptor will go */
+ nexttxd = (txd+1);
+ if (nexttxd == sc->txdscr_end) {
+ nexttxd = sc->txdscr_start;
+ }
+
+ /* If the next one is the same as our remove pointer,
+ the ring is considered full. (it actually has room for
+ one more, but we reserve the remove == add case for "empty") */
+
+ if (nexttxd == sc->txdscr_remove) return -1;
+
+ txd->txd_bufptr = PTR_TO_PCI(pkt->buffer);
+ txd->txd_cmdsts = M_DES1_INTR | M_DES1_OWN | V_DES1_SIZE(pkt->length);
+
+ /* success, advance the pointer */
+ sc->txdscr_add = nexttxd;
+
+ return 0;
+}
+
+
+static int
+dp83815_transmit(dp83815_softc *sc,eth_pkt_t *pkt)
+{
+ int rv;
+
+ if (MACPHYTER_DEBUG) show_packet('<', pkt); /* debug */
+
+ rv = dp83815_add_txbuf(sc, pkt);
+ sc->outpkts++;
+
+ WRITECSR(sc, R_CR, M_CR_TXE | M_CR_RXE);
+ return rv;
+}
+
+
+static void
+dp83815_proctxring(dp83815_softc *sc)
+{
+ volatile tx_dscr *txd;
+ eth_pkt_t *pkt;
+ uint32_t cmdsts;
+
+ for (;;) {
+ txd = (volatile tx_dscr *) sc->txdscr_remove;
+
+ if (txd == sc->txdscr_add) {
+ /* ring is empty, no buffers to process */
+ break;
+ }
+
+ cmdsts = txd->txd_cmdsts;
+ if (cmdsts & M_DES1_OWN) {
+ /* Reached a packet still being transmitted */
+ break;
+ }
+
+ /* Just free the packet */
+ pkt = ETH_PKT_BASE(PCI_TO_PTR(txd->txd_bufptr));
+ eth_free_pkt(sc, pkt);
+
+ /* update the pointer, accounting for buffer wrap. */
+ txd++;
+ if (txd == sc->txdscr_end)
+ txd = sc->txdscr_start;
+
+ sc->txdscr_remove = (tx_dscr *) txd;
+ }
+}
+
+
+static void
+dp83815_initrings(dp83815_softc *sc)
+{
+ volatile tx_dscr *txd, *txn;
+ volatile rx_dscr *rxd, *rxn;
+
+ /* Claim ownership of all descriptors for the driver */
+
+ for (txd = sc->txdscr_start; txd != sc->txdscr_end; txd++) {
+ txn = txd + 1;
+ if (txn == sc->txdscr_end) txn = sc->txdscr_start;
+ txd->txd_link = PTR_TO_PCI(txn);
+ txd->txd_cmdsts = 0;
+ txd->txd_pad = 0;
+ }
+ for (rxd = sc->rxdscr_start; rxd != sc->rxdscr_end; rxd++) {
+ rxn = rxd + 1;
+ if (rxn == sc->rxdscr_end) rxn = sc->rxdscr_start;
+ rxd->rxd_link = PTR_TO_PCI(rxn);
+ rxd->rxd_cmdsts = M_DES1_OWN;
+ rxd->rxd_pad = 0;
+ }
+
+ /* Init the ring pointers */
+
+ sc->txdscr_add = sc->txdscr_remove = sc->txdscr_start;
+ sc->rxdscr_add = sc->rxdscr_remove = sc->rxdscr_start;
+ sc->rxdscr_onring = 0;
+
+ /* Add stuff to the receive ring */
+
+ dp83815_fillrxring(sc);
+}
+
+
+static int
+dp83815_init(dp83815_softc *sc)
+{
+ /* Allocate descriptor rings */
+ sc->rxdscrmem = KMALLOC(MAXRXDSCR*sizeof(rx_dscr), sizeof(rx_dscr));
+ sc->txdscrmem = KMALLOC(MAXTXDSCR*sizeof(tx_dscr), sizeof(tx_dscr));
+
+ /* Allocate buffer pool */
+ sc->pktpool = KMALLOC(ETH_PKTPOOL_SIZE*ETH_PKTBUF_SIZE, CACHE_ALIGN);
+ eth_initfreelist(sc);
+ q_init(&sc->rxqueue);
+
+ /* Fill in pointers to the rings */
+ sc->rxdscr_start = (rx_dscr *) (sc->rxdscrmem);
+ sc->rxdscr_end = sc->rxdscr_start + MAXRXDSCR;
+ sc->rxdscr_add = sc->rxdscr_start;
+ sc->rxdscr_remove = sc->rxdscr_start;
+ sc->rxdscr_onring = 0;
+
+ sc->txdscr_start = (tx_dscr *) (sc->txdscrmem);
+ sc->txdscr_end = sc->txdscr_start + MAXTXDSCR;
+ sc->txdscr_add = sc->txdscr_start;
+ sc->txdscr_remove = sc->txdscr_start;
+
+ dp83815_initrings(sc);
+
+ return 0;
+}
+
+
+static void
+dp83815_resetrings(dp83815_softc *sc)
+{
+ volatile tx_dscr *txd;
+ volatile rx_dscr *rxd;
+ eth_pkt_t *pkt;
+
+ /* Free already-sent descriptors and buffers */
+ dp83815_proctxring(sc);
+
+ /* Free any pending but unsent */
+ txd = (volatile tx_dscr *) sc->txdscr_remove;
+ while (txd != sc->txdscr_add) {
+ txd->txd_cmdsts &=~ M_DES1_OWN;
+ pkt = ETH_PKT_BASE(PCI_TO_PTR(txd->txd_bufptr));
+ eth_free_pkt(sc, pkt);
+
+ txd++;
+ if (txd == sc->txdscr_end)
+ txd = sc->txdscr_start;
+ }
+ sc->txdscr_add = sc->txdscr_remove;
+
+ /* Discard any received packets as well as all free buffers */
+ rxd = (volatile rx_dscr *) sc->rxdscr_remove;
+ while (rxd != sc->rxdscr_add) {
+ rxd->rxd_cmdsts |= M_DES1_OWN;
+ pkt = ETH_PKT_BASE(PCI_TO_PTR(rxd->rxd_bufptr));
+ eth_free_pkt(sc, pkt);
+
+ rxd++;
+ if (rxd == sc->rxdscr_end)
+ rxd = sc->rxdscr_start;
+ CS_ENTER(sc);
+ sc->rxdscr_onring--;
+ CS_EXIT(sc);
+ }
+
+ /* Reestablish the initial state. */
+ dp83815_initrings(sc);
+}
+
+
+#if 0 /* XXX Multicast filtering not yet implemented. */
+/* CRCs */
+
+#define IEEE_CRC32_POLY 0xEDB88320UL /* CRC-32 Poly -- either endian */
+
+static uint32_t
+dp83815_crc32(const uint8_t *databuf, unsigned int datalen)
+{
+ unsigned int idx, bit, data;
+ uint32_t crc;
+
+ crc = 0xFFFFFFFFUL;
+ for (idx = 0; idx < datalen; idx++)
+ for (data = *databuf++, bit = 0; bit < 8; bit++, data >>= 1)
+ crc = (crc >> 1) ^ (((crc ^ data) & 1) ? IEEE_CRC32_POLY : 0);
+ return crc;
+}
+
+#define dp83815_mchash(mca) (dp83815_crc32((mca), 6) & 0x1FF)
+#endif
+
+
+#if MACPHYTER_TEST
+/* EEPROM access */
+
+/* Current NICs use the EEPROM auto-load feature and there is no need
+ for explicit EEPROM access. The following routines are included
+ for future applications and have been tested (Netgear FA311). */
+
+/****************************************************************************
+ * dp83815_spin(sc, ns)
+ *
+ * Spin for a short interval (nominally in nanoseconds)
+ *
+ * Input Parameters: ns - minimum required nsec.
+ *
+ * The delay loop uses uncached PCI reads, each of which requires
+ * at least 3 PCI bus clocks (45 ns at 66 MHz) to complete. The
+ * actual delay will be longer (much longer if preempted).
+ ***************************************************************************/
+
+#define PCI_MIN_DELAY 45
+
+static void
+dp83815_spin(dp83815_softc *sc, long nanoseconds)
+{
+ long delay;
+ volatile uint32_t t;
+
+ for (delay = nanoseconds; delay > 0; delay -= PCI_MIN_DELAY)
+ t = READCSR(sc, R_SRR);
+}
+
+
+/*
+ * The recommended EEPROM is the NM9306.
+ * Delays below are chosen to meet specs for NS93C64 (slow M variant).
+ * Current parts are faster.
+ * Reference: NS Memory Data Book, 1994
+ */
+
+#define EEPROM_SIZE (2*0x0C)
+#define EEPROM_MAX_CYCLES 32
+
+#define EEPROM_CMD_BITS 3
+#define EEPROM_ADDR_BITS 6
+
+#define K_EEPROM_READ_CMD 06
+#define K_EEPROM_WRITE_CMD 05
+
+#define EEPROM_CRC_INDEX (EEPROM_SIZE-2)
+
+#define EEPROM_WORD(rom,offset) ((rom)[offset] | ((rom)[offset+1] << 8))
+
+static void
+eeprom_idle_state(dp83815_softc *sc)
+{
+ uint32_t ctrl;
+ unsigned int i;
+
+ ctrl = READCSR(sc, R_MEAR);
+
+ ctrl |= M_MEAR_EESEL;
+ WRITECSR(sc, R_MEAR, ctrl);
+ dp83815_spin(sc, 100); /* CS setup (Tcss=100) */
+
+ /* Run the clock through the maximum number of pending read cycles */
+ for (i = 0; i < EEPROM_MAX_CYCLES*2; i++) {
+ ctrl ^= M_MEAR_EECLK;
+ WRITECSR(sc, R_MEAR, ctrl);
+ dp83815_spin(sc, 1000); /* SK period (Fsk=0.5MHz) */
+ }
+
+ /* Deassert EEPROM Chip Select */
+ ctrl &=~ M_MEAR_EESEL;
+ WRITECSR(sc, R_MEAR, ctrl);
+ dp83815_spin(sc, 50); /* CS recovery (Tsks=50) */
+}
+
+static void
+eeprom_send_command_bit(dp83815_softc *sc, unsigned int data)
+{
+ uint32_t ctrl;
+
+ ctrl = READCSR(sc, R_MEAR);
+
+ /* Place the data bit on the bus */
+ if (data == 1)
+ ctrl |= M_MEAR_EEDI;
+ else
+ ctrl &=~ M_MEAR_EEDI;
+
+ WRITECSR(sc, R_MEAR, ctrl);
+ dp83815_spin(sc, 360); /* setup: Tdis=200 */
+
+ /* Now clock the data into the EEPROM */
+ WRITECSR(sc, R_MEAR, ctrl | M_MEAR_EECLK);
+ dp83815_spin(sc, 900); /* clock high, Tskh=500 */
+ WRITECSR(sc, R_MEAR, ctrl);
+ dp83815_spin(sc, 450); /* clock low, Tskl=250 */
+
+ /* Now clear the data bit */
+ ctrl &=~ M_MEAR_EEDI; /* data invalid, Tidh=20 for SK^ */
+ WRITECSR(sc, R_MEAR, ctrl);
+ dp83815_spin(sc, 270); /* min cycle, 1/Fsk=2000 */
+}
+
+static uint16_t
+eeprom_read_bit(dp83815_softc *sc)
+{
+ uint32_t ctrl;
+
+ ctrl = READCSR(sc, R_MEAR);
+
+ /* Generate a clock cycle before doing a read */
+ WRITECSR(sc, R_MEAR, ctrl | M_MEAR_EECLK); /* rising edge */
+ dp83815_spin(sc, 1000); /* clock high, Tskh=500, Tpd=1000 */
+ WRITECSR(sc, R_MEAR, ctrl); /* falling edge */
+ dp83815_spin(sc, 1000); /* clock low, 1/Fsk=2000 */
+
+ ctrl = READCSR(sc, R_MEAR);
+ return ((ctrl & M_MEAR_EEDO) != 0 ? 1 : 0);
+}
+
+#define CMD_BIT_MASK (1 << (EEPROM_CMD_BITS+EEPROM_ADDR_BITS-1))
+
+static uint16_t
+eeprom_read_word(dp83815_softc *sc, unsigned int index)
+{
+ uint16_t command, word;
+ uint32_t ctrl;
+ unsigned int i;
+
+ ctrl = READCSR(sc, R_MEAR) | M_MEAR_EESEL;
+
+ /* Assert the EEPROM CS line */
+ WRITECSR(sc, R_MEAR, ctrl);
+ dp83815_spin(sc, 100); /* CS setup, Tcss = 100 */
+
+ /* Send the read command to the EEPROM */
+ command = (K_EEPROM_READ_CMD << EEPROM_ADDR_BITS) | index;
+ for (i = 0; i < EEPROM_CMD_BITS+EEPROM_ADDR_BITS; i++) {
+ eeprom_send_command_bit(sc, (command & CMD_BIT_MASK) != 0 ? 1 : 0);
+ command <<= 1;
+ }
+
+ /* Now read the bits from the EEPROM (MSB first) */
+ word = 0;
+ for (i = 0; i < 16; ++i) {
+ word <<= 1;
+ word |= eeprom_read_bit(sc);
+ }
+
+ /* Clear the EEPROM CS Line, CS hold, Tcsh = 0 */
+ WRITECSR(sc, R_MEAR, ctrl &~ M_MEAR_EESEL);
+
+ return word;
+}
+
+
+/****************************************************************************
+ * eeprom_checksum()
+ *
+ * Calculate the checksum of the EEPROM and return it. See Section
+ * 4.2.4 for the algorithm.
+ ***************************************************************************/
+
+static uint16_t
+eeprom_checksum(const uint8_t rom[])
+{
+ uint16_t sum;
+ int i;
+
+ sum = 0;
+ for (i = 0; i < EEPROM_SIZE-1; i++)
+ sum += rom[i];
+ sum ^= 0xFF;
+ return (((sum + 1) & 0xFF) << 8) | 0x55;
+}
+
+
+/****************************************************************************
+ * eeprom_read_all(sc, uint8_t dest)
+ *
+ * Read the entire EEPROM into the srom array
+ *
+ * Input parameters:
+ * sc - dp83815 state
+ ***************************************************************************/
+
+static int
+eeprom_read_all(dp83815_softc *sc, uint8_t dest[])
+{
+ int i;
+ uint16_t cksum, temp;
+
+ WRITECSR(sc, R_MEAR, M_MEAR_EESEL);
+
+ eeprom_idle_state(sc);
+
+ for (i = 0; i < EEPROM_SIZE/2; i++) {
+ temp = eeprom_read_word(sc, i);
+ dest[2*i] = temp & 0xFF;
+ dest[2*i+1] = temp >> 8;
+ }
+
+ WRITECSR(sc, R_MEAR, 0); /* CS hold, Tcsh=0 */
+
+ cksum = eeprom_checksum(dest);;
+ if (cksum != EEPROM_WORD(dest, EEPROM_CRC_INDEX)) {
+ xprintf("%s: Invalid EEPROM CHECKSUM, calc %04x, stored %04x\n",
+ dp83815_devname(sc),
+ cksum, EEPROM_WORD(dest, EEPROM_CRC_INDEX));
+ return 0/*-1*/;
+ }
+ return 0;
+}
+
+static int
+eeprom_read_addr(const uint8_t rom[], uint8_t buf[])
+{
+ uint16_t s;
+ unsigned offset, mask;
+ int i, j;
+
+ if (eeprom_checksum(rom) != EEPROM_WORD(rom, EEPROM_SIZE-2))
+ return -1;
+
+ s = 0;
+ offset = 2*6; mask = 0x1;
+ i = j = 0;
+ do {
+ s >>= 1;
+ if ((EEPROM_WORD(rom, offset) & mask) != 0) s |= 0x8000;
+ mask >>= 1;
+ if (mask == 0) {
+ offset +=2; mask = 0x8000;
+ }
+ i++;
+ if (i % 16 == 0) {
+ buf[j++] = s & 0xFF;
+ buf[j++] = s >> 8;
+ s = 0;
+ }
+ } while (i < ENET_ADDR_LEN*8);
+
+ return 0;
+}
+#endif /* MACPHYTER_TEST */
+
+#if 0
+static void
+eeprom_dump(uint8_t srom[])
+{
+ int i;
+
+ xprintf("DP83815: EEPROM data:");
+ for (i = 0; i < EEPROM_SIZE; i++) {
+ if (i % 16 == 0)
+ xprintf("\n %02x: ", i);
+ xprintf(" %02x", srom[i]);
+ }
+ xprintf("\n");
+}
+#else
+#define eeprom_dump(srom)
+#endif
+
+
+static int
+dp83815_get_pm_addr(dp83815_softc *sc, uint8_t buf[])
+{
+ uint32_t rfcr;
+ unsigned rfaddr;
+ unsigned i;
+ uint32_t rfdata;
+
+ rfcr = READCSR(sc, R_RFCR);
+ rfaddr = K_RFCR_PMATCH_ADDR;
+
+ for (i = 0; i < ENET_ADDR_LEN/2; i++) {
+ rfcr &=~ M_RFCR_RFADDR;
+ rfcr |= V_RFCR_RFADDR(rfaddr);
+ WRITECSR(sc, R_RFCR, rfcr);
+ rfdata = READCSR(sc, R_RFDR);
+ buf[2*i] = rfdata & 0xFF;
+ buf[2*i+1] = (rfdata >> 8) & 0xFF;
+ rfaddr += 2;
+ }
+
+ return 0;
+}
+
+
+#if MACPHYTER_TEST
+/* MII access */
+
+/* Current NICs use the internal PHY, which can be accessed more
+ simply via internal registers. The following routines are
+ primarily for management access to an external PHY and are retained
+ for future applications. They have been tested on a Netgear FA311. */
+
+/****************************************************************************
+ * MII access utility routines
+ ***************************************************************************/
+
+/* MII clock limited to 2.5 MHz (DP83815 allows 25 MHz), transactions
+ end with MDIO tristated */
+
+static void
+mii_write_bits(dp83815_softc *sc, uint32_t data, unsigned int count)
+{
+ uint32_t ctrl;
+ uint32_t bitmask;
+
+ ctrl = READCSR(sc, R_MEAR) & ~M_MEAR_MDC;
+ ctrl |= M_MEAR_MDDIR;
+
+ for (bitmask = 1 << (count-1); bitmask != 0; bitmask >>= 1) {
+ ctrl &=~ M_MEAR_MDIO;
+ if ((data & bitmask) != 0) ctrl |= M_MEAR_MDIO;
+ WRITECSR(sc, R_MEAR, ctrl);
+
+ dp83815_spin(sc, 2000); /* setup */
+ WRITECSR(sc, R_MEAR, ctrl | M_MEAR_MDC);
+ dp83815_spin(sc, 2000); /* hold */
+ WRITECSR(sc, R_MEAR, ctrl);
+ }
+}
+
+static void
+mii_turnaround(dp83815_softc *sc)
+{
+ uint32_t ctrl;
+
+ ctrl = READCSR(sc, R_MEAR) &~ M_MEAR_MDDIR;
+
+ /* stop driving data */
+ WRITECSR(sc, R_MEAR, ctrl);
+ dp83815_spin(sc, 2000); /* setup */
+ WRITECSR(sc, R_MEAR, ctrl | M_MEAR_MDC);
+ dp83815_spin(sc, 2000); /* clock high */
+ WRITECSR(sc, R_MEAR, ctrl);
+
+ /* read back and check for 0 here? */
+}
+
+/****************************************************************************
+ * mii_read_register
+ *
+ * This routine reads a register from the PHY chip using the MII
+ * serial management interface.
+ *
+ * Input parameters:
+ * index - index of register to read (0-31)
+ *
+ * Return value:
+ * word read from register
+ ***************************************************************************/
+
+static uint16_t
+mii_read_register(dp83815_softc *sc, unsigned int index)
+{
+ /* Send the command and address to the PHY. The sequence is
+ a synchronization sequence (32 1 bits)
+ a "start" command (2 bits)
+ a "read" command (2 bits)
+ the PHY addr (5 bits)
+ the register index (5 bits)
+ */
+ uint32_t ctrl;
+ uint16_t word;
+ int i;
+
+ mii_write_bits(sc, 0xFF, 8);
+ mii_write_bits(sc, 0xFFFFFFFF, 32);
+ mii_write_bits(sc, MII_COMMAND_START, 2);
+ mii_write_bits(sc, MII_COMMAND_READ, 2);
+ mii_write_bits(sc, sc->phy_addr, 5);
+ mii_write_bits(sc, index, 5);
+
+ mii_turnaround(sc);
+
+ ctrl = READCSR(sc, R_MEAR) &~ (M_MEAR_MDC | M_MEAR_MDDIR);
+ word = 0;
+
+ for (i = 0; i < 16; i++) {
+ WRITECSR(sc, R_MEAR, ctrl);
+ dp83815_spin(sc, 2000); /* clock width low */
+ WRITECSR(sc, R_MEAR, ctrl | M_MEAR_MDC);
+ dp83815_spin(sc, 2000); /* clock width high */
+ WRITECSR(sc, R_MEAR, ctrl);
+ dp83815_spin(sc, 1000); /* output delay */
+ word <<= 1;
+ if ((READCSR(sc, R_MEAR) & M_MEAR_MDIO) != 0)
+ word |= 0x0001;
+ }
+
+ return word;
+
+ /* reset to output mode? */
+}
+
+/****************************************************************************
+ * mii_write_register
+ *
+ * This routine writes a register in the PHY chip using the MII
+ * serial management interface.
+ *
+ * Input parameters:
+ * index - index of register to write (0-31)
+ * value - word to write
+ ***************************************************************************/
+
+static void
+mii_write_register(dp83815_softc *sc, unsigned int index, uint16_t value)
+{
+ mii_write_bits(sc, 0xFF, 8);
+ mii_write_bits(sc, 0xFFFFFFFF, 32);
+ mii_write_bits(sc, MII_COMMAND_START, 2);
+ mii_write_bits(sc, MII_COMMAND_WRITE, 2);
+ mii_write_bits(sc, sc->phy_addr, 5);
+ mii_write_bits(sc, index, 5);
+ mii_write_bits(sc, MII_COMMAND_ACK, 2);
+ mii_write_bits(sc, value, 16);
+
+ /* reset to input mode? */
+}
+
+
+static int
+mii_probe(dp83815_softc *sc)
+{
+ int i;
+ uint16_t id1, id2;
+
+ /* Empirically, bit-banged access will return register 0 of the
+ integrated PHY for all registers of all unpopulated PHY
+ addresses. */
+ for (i = 0; i < 32; i++) {
+ sc->phy_addr = i;
+ id1 = mii_read_register(sc, MII_PHYIDR1);
+ id2 = mii_read_register(sc, MII_PHYIDR2);
+ if ((id1 != 0x0000 && id1 != 0xFFFF) ||
+ (id2 != 0x0000 && id2 != 0xFFFF)) {
+ if (id1 != id2) return 0;
+ }
+ }
+ return -1;
+}
+
+#if 0
+#define OUI_NAT_SEMI 0x080017
+#define IDR_NAT_SEMI 0x080017 /* NSC does not bit-reverse each byte */
+#define PART_83815 0x02
+
+static void
+mii_dump(dp83815_softc *sc, const char *label)
+{
+ int i;
+ uint16_t r;
+ uint32_t idr, part;
+
+ xprintf("%s\n", label);
+ idr = 0;
+ for (i = 0; i <= 6; ++i) {
+ r = mii_read_register(sc, i);
+ xprintf("MII_REG%02x: %04x\n", i, r);
+ if (i == MII_PHYIDR1) {
+ idr |= r << 6;
+ }
+ else if (i == MII_PHYIDR2) {
+ idr |= (r >> 10) & 0x3F;
+ part = (r >> 4) & 0x3F;
+ }
+ }
+ if (idr == IDR_NAT_SEMI && part == PART_83815) {
+ r = mii_read_register(sc, 7);
+ xprintf("MII_REG%02x: %04x\n", i, r);
+ for (i = 0x10; i <= 0x16; ++i) {
+ r = mii_read_register(sc, i);
+ xprintf("MII_REG%02x: %04x\n", i, r);
+ }
+ for (i = 0x19; i <= 0x1A; ++i) {
+ r = mii_read_register(sc, i);
+ xprintf("MII_REG%02x: %04x\n", i, r);
+ }
+ }
+}
+#else
+#define mii_dump(sc,label)
+#endif
+
+
+/* The following functions are suitable for explicit MII access. */
+
+static void
+mii_set_speed(dp83815_softc *sc, int speed)
+{
+ uint16_t control;
+
+ control = mii_read_register(sc, MII_BMCR);
+
+ control &=~ (BMCR_ANENABLE | BMCR_RESTARTAN);
+ mii_write_register(sc, MII_BMCR, control);
+ control &=~ (BMCR_SPEED0 | BMCR_SPEED1 | BMCR_DUPLEX);
+
+ switch (speed) {
+ case ETHER_SPEED_10HDX:
+ default:
+ break;
+ case ETHER_SPEED_10FDX:
+ control |= BMCR_DUPLEX;
+ break;
+ case ETHER_SPEED_100HDX:
+ control |= BMCR_SPEED100;
+ break;
+ case ETHER_SPEED_100FDX:
+ control |= BMCR_SPEED100 | BMCR_DUPLEX ;
+ break;
+ }
+
+ mii_write_register(sc, MII_BMCR, control);
+}
+
+static void
+mii_autonegotiate(dp83815_softc *sc)
+{
+ uint16_t control, status, cap;
+ int timeout;
+ int linkspeed;
+
+ linkspeed = ETHER_SPEED_UNKNOWN;
+
+ /* Read twice to clear latching bits */
+ status = mii_read_register(sc, MII_BMSR);
+ status = mii_read_register(sc, MII_BMSR);
+ mii_dump(sc, "query PHY");
+
+ if ((status & (BMSR_AUTONEG | BMSR_LINKSTAT)) ==
+ (BMSR_AUTONEG | BMSR_LINKSTAT))
+ control = mii_read_register(sc, MII_BMCR);
+ else {
+ /* reset the PHY */
+ mii_write_register(sc, MII_BMCR, BMCR_RESET);
+ timeout = 3*CFE_HZ;
+ for (;;) {
+ control = mii_read_register(sc, MII_BMCR);
+ if ((control && BMCR_RESET) == 0 || timeout <= 0)
+ break;
+ cfe_sleep(CFE_HZ/2);
+ timeout -= CFE_HZ/2;
+ }
+ if ((control & BMCR_RESET) != 0) {
+ xprintf("%s: PHY reset failed\n", dp83815_devname(sc));
+ return;
+ }
+
+ status = mii_read_register(sc, MII_BMSR);
+ cap = ((status >> 6) & (ANAR_TXFD | ANAR_TXHD | ANAR_10FD | ANAR_10HD))
+ | PSB_802_3;
+ mii_write_register(sc, MII_ANAR, cap);
+ control |= (BMCR_ANENABLE | BMCR_RESTARTAN);
+ mii_write_register(sc, MII_BMCR, control);
+
+ timeout = 3*CFE_HZ;
+ for (;;) {
+ status = mii_read_register(sc, MII_BMSR);
+ if ((status & BMSR_ANCOMPLETE) != 0 || timeout <= 0)
+ break;
+ cfe_sleep(CFE_HZ/2);
+ timeout -= CFE_HZ/2;
+ }
+ mii_dump(sc, "done PHY");
+ }
+
+ xprintf("%s: Link speed: ", dp83815_devname(sc));
+ if ((status & BMSR_ANCOMPLETE) != 0) {
+ /* A link partner was negogiated... */
+
+ uint16_t remote = mii_read_register(sc, MII_ANLPAR);
+
+ if ((remote & ANLPAR_TXFD) != 0) {
+ xprintf("100BaseT FDX\n");
+ linkspeed = ETHER_SPEED_100FDX;
+ }
+ else if ((remote & ANLPAR_TXHD) != 0) {
+ xprintf("100BaseT HDX\n");
+ linkspeed = ETHER_SPEED_100HDX;
+ }
+ else if ((remote & ANLPAR_10FD) != 0) {
+ xprintf("10BaseT FDX\n");
+ linkspeed = ETHER_SPEED_10FDX;
+ }
+ else if ((remote & ANLPAR_10HD) != 0) {
+ xprintf("10BaseT HDX\n");
+ linkspeed = ETHER_SPEED_10HDX;
+ }
+ }
+ else {
+ /* no link partner negotiation */
+ control &=~ (BMCR_ANENABLE | BMCR_RESTARTAN);
+ mii_write_register(sc, MII_BMCR, control);
+ xprintf("10BaseT HDX (assumed)\n");
+ linkspeed = ETHER_SPEED_10HDX;
+ if ((status & BMSR_LINKSTAT) == 0)
+ mii_write_register(sc, MII_BMCR, control);
+ mii_set_speed(sc, linkspeed);
+ }
+
+ status = mii_read_register(sc, MII_BMSR); /* clear latching bits */
+ mii_dump(sc, "final PHY");
+}
+#endif /* MACPHYTER_TEST */
+
+
+static void
+dp83815_phyupdate(dp83815_softc *sc, uint32_t status)
+{
+ xprintf("%s: Link speed: ", dp83815_devname(sc));
+ if ((status & M_CFG_LNKSTS) != 0) {
+ switch (status & (M_CFG_SPEED100 | M_CFG_FDUP)) {
+ case (M_CFG_SPEED100 | M_CFG_FDUP):
+ sc->linkspeed = ETHER_SPEED_100FDX;
+ xprintf("100BaseT FDX\n");
+ break;
+ case (M_CFG_SPEED100):
+ sc->linkspeed = ETHER_SPEED_100HDX;
+ xprintf("100BaseT HDX\n");
+ break;
+ case (M_CFG_FDUP):
+ sc->linkspeed = ETHER_SPEED_10FDX;
+ xprintf("10BaseT FDX\n");
+ break;
+ default:
+ sc->linkspeed = ETHER_SPEED_10HDX;
+ xprintf("10BaseT HDX\n");
+ break;
+ }
+ if ((status & M_CFG_SPEED100) != 0) {
+ uint32_t t;
+
+ /* This is a reputed fix that improves 100BT rx
+ performance on short cables with "a small number"
+ of DP83815 chips. It comes from Bruce at NatSemi
+ via the Soekris support web page (see appended
+ note). */
+
+ WRITECSR(sc, R_PGSEL, 0x0001);
+ (void)READCSR(sc, R_PGSEL); /* push */
+ t = READCSR(sc, R_DSPCFG);
+ WRITECSR(sc, R_DSPCFG, (t & 0xFFF) | 0x1000);
+ cfe_sleep(1);
+ t = READCSR(sc, R_TSTDAT) & 0xFF;
+ if ((t & 0x0080) == 0 || ((t > 0x00D8) && (t <= 0x00FF))) {
+ WRITECSR(sc, R_TSTDAT, 0x00E8);
+ t = READCSR(sc, R_DSPCFG);
+ WRITECSR(sc, R_DSPCFG, t | 0x0020);
+ }
+ WRITECSR(sc, R_PGSEL, 0);
+ }
+ if ((status & M_CFG_FDUP) != (sc->phy_status & M_CFG_FDUP)) {
+ uint32_t txcfg;
+
+ txcfg = READCSR(sc, R_TXCFG);
+ if (status & M_CFG_FDUP)
+ txcfg |= M_TXCFG_CSI;
+ else
+ txcfg &= ~M_TXCFG_CSI;
+ WRITECSR(sc, R_RXCFG, txcfg);
+ }
+ }
+ else {
+ xprintf("Unknown\n");
+ }
+
+ sc->phy_status = status;
+}
+
+static void
+dp83815_hwinit(dp83815_softc *sc)
+{
+ if (sc->state == eth_state_uninit) {
+ uint32_t cfg;
+ uint32_t txcfg, rxcfg;
+ uint32_t ready;
+ int timeout;
+
+ /* RESET_ADAPTER(sc); */
+ sc->state = eth_state_off;
+ sc->bus_errors = 0;
+
+ cfg = READCSR(sc, R_CFG);
+ cfg |= M_CFG_BEM; /* We will use match bits */
+ WRITECSR(sc, R_CFG, cfg);
+
+ sc->phy_status = 0;
+ dp83815_phyupdate(sc, cfg & M_CFG_LNKSUMMARY);
+
+ txcfg = READCSR(sc, R_TXCFG);
+ txcfg |= M_TXCFG_ATP;
+ /* XXX fix up FLTH, DRTH? */
+ WRITECSR(sc, R_TXCFG, txcfg);
+
+ rxcfg = READCSR(sc, R_RXCFG);
+ /* Set an aggressive rx drain threshhold of 16 (2*8) bytes */
+ rxcfg &= ~M_RXCFG_DRTH;
+ rxcfg |= V_RXCFG_DRTH(2);
+ WRITECSR(sc, R_RXCFG, rxcfg);
+
+#if MACPHYTER_TEST
+ {
+ uint8_t srom[EEPROM_SIZE];
+ uint8_t addr[ENET_ADDR_LEN];
+
+ eeprom_read_all(sc, srom);
+ eeprom_dump(srom);
+ xprintf(" checksum %04x\n", eeprom_checksum(srom));
+ if (eeprom_read_addr(srom, addr) == 0)
+ xprintf(" addr: %02x-%02x-%02x-%02x-%02x-%02x\n",
+ addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
+
+ mii_probe(sc);
+ xprintf("MII address %02x\n", sc->phy_addr);
+ mii_dump(sc, "DP83815 PHY:");
+ (void)mii_autonegotiate;
+ }
+#endif /* MACPHYTER_TEST */
+
+ /* XXX fix up rx filtering here. We are relying on the EEPROM. */
+
+ /* XXX This is inappropriate on a restart. */
+ timeout = 2*CFE_HZ;
+ ready = 0;
+ for (;;) {
+ ready |= READCSR(sc, R_ISR);
+ if ((ready & (M_INT_TXRCMP | M_INT_RXRCMP))
+ == (M_INT_TXRCMP | M_INT_RXRCMP) || timeout <= 0)
+ break;
+ cfe_sleep(CFE_HZ/10);
+ timeout -= CFE_HZ/10;
+ }
+ if ((ready & M_INT_TXRCMP) == 0)
+ xprintf("%s: tx reset failed\n", dp83815_devname(sc));
+ if ((ready & M_INT_RXRCMP) == 0)
+ xprintf("%s: rx reset failed\n", dp83815_devname(sc));
+ }
+}
+
+static void
+dp83815_setspeed(dp83815_softc *sc, int speed)
+{
+ /* XXX Not yet implemented - autonegotiation only. */
+}
+
+static void
+dp83815_setloopback(dp83815_softc *sc, int mode)
+{
+ /* XXX Not yet implemented. */
+}
+
+
+static void
+dp83815_isr(void *arg)
+{
+ dp83815_softc *sc = (dp83815_softc *)arg;
+ uint32_t status;
+ uint32_t isr;
+
+#if IPOLL
+ sc->interrupts++;
+#endif
+
+ for (;;) {
+
+ /* Read (and clear) the interrupt status. */
+ isr = READCSR(sc, R_ISR);
+ status = isr & sc->intmask;
+
+ /* if there are no more interrupts, leave now. */
+ if (status == 0) break;
+
+ /* Now, test each unmasked bit in the interrupt register and
+ handle each interrupt type appropriately. */
+
+ if (status & (M_INT_RTABT | M_INT_RMABT)) {
+ WRITECSR(sc, R_IER, 0);
+
+ xprintf("%s: bus error\n", dp83815_devname(sc));
+ dumpstat(sc);
+ sc->bus_errors++;
+ if (sc->bus_errors >= 2) {
+ dumpcsrs(sc);
+ RESET_ADAPTER(sc);
+ sc->state = eth_state_off;
+ sc->bus_errors = 0;
+ }
+#if IPOLL
+ else
+ WRITECSR(sc, R_IMR, sc->intmask);
+#endif
+ }
+
+ if (status & M_INT_RXDESC) {
+#if IPOLL
+ sc->rx_interrupts++;
+#endif
+ dp83815_procrxring(sc);
+ }
+
+ if (status & M_INT_TXDESC) {
+#if IPOLL
+ sc->tx_interrupts++;
+#endif
+ dp83815_proctxring(sc);
+ }
+
+ if (status & (M_INT_TXURN | M_INT_RXORN)) {
+ if (status & M_INT_TXURN) {
+ xprintf("%s: tx underrun, %08x\n", dp83815_devname(sc), isr);
+ /* XXX Try to restart */
+ }
+ if (status & M_INT_RXORN) {
+ xprintf("%s: tx overrun, %08x\n", dp83815_devname(sc), isr);
+ /* XXX Try to restart */
+ }
+ }
+
+ if (status & M_INT_PHY) {
+ sc->intmask &= ~ M_INT_PHY;
+ WRITECSR(sc, R_IMR, sc->intmask);
+ (void)READCSR(sc, R_MISR); /* Clear at PHY */
+ sc->phy_check = 1;
+ }
+
+ }
+}
+
+static void
+dp83815_checkphy(dp83815_softc *sc)
+{
+ uint32_t cfg;
+ uint32_t status;
+
+ (void)READCSR(sc, R_MISR); /* Clear at PHY */
+ cfg = READCSR(sc, R_CFG);
+ status = cfg & M_CFG_LNKSUMMARY;
+ if (status != sc->phy_status) {
+ /* XXX Can we really do the phy update with active rx and tx? */
+ dp83815_phyupdate(sc, status);
+ }
+
+ sc->intmask |= M_INT_PHY;
+ WRITECSR(sc, R_IMR, sc->intmask);
+}
+
+
+static void
+dp83815_start(dp83815_softc *sc)
+{
+ dp83815_hwinit(sc);
+
+ /* Set up loopback here */
+
+ sc->intmask = 0;
+ WRITECSR(sc, R_IER, 0); /* no interrupts */
+ WRITECSR(sc, R_IMR, 0);
+ (void)READCSR(sc, R_ISR); /* clear any pending */
+
+ sc->phy_status = READCSR(sc, R_CFG) & M_CFG_LNKSUMMARY;
+ sc->phy_check = 0;
+
+ sc->intmask = M_INT_RXDESC | M_INT_TXDESC;
+ sc->intmask |= M_INT_RTABT | M_INT_RMABT | M_INT_RXORN | M_INT_TXURN;
+ sc->intmask |= M_INT_PHY;
+
+#if IPOLL
+ cfe_request_irq(sc->irq, dp83815_isr, sc, CFE_IRQ_FLAGS_SHARED, 0);
+ WRITECSR(sc, R_IMR, sc->intmask);
+ WRITECSR(sc, R_IER, M_IER_IE);
+#endif
+
+ (void)READCSR(sc, R_MISR); /* clear any pending */
+ WRITECSR(sc, R_MISR, MISR_MSKJAB | MISR_MSKRF | MISR_MSKFHF | MISR_MSKRHF);
+ WRITECSR(sc, R_MICR, MICR_INTEN);
+
+ WRITECSR(sc, R_TXDP, PTR_TO_PCI(sc->txdscr_start));
+ WRITECSR(sc, R_RXDP, PTR_TO_PCI(sc->rxdscr_start));
+
+ WRITECSR(sc, R_MIBC, M_MIBC_ACLR); /* zero hw MIB counters */
+
+ WRITECSR(sc, R_CR, M_CR_TXE | M_CR_RXE);
+ sc->state = eth_state_on;
+}
+
+static void
+dp83815_stop(dp83815_softc *sc)
+{
+ uint32_t status;
+ int count;
+
+ /* Make sure that no further interrutps will be processed. */
+ sc->intmask = 0;
+ WRITECSR(sc, R_IER, 0);
+ WRITECSR(sc, R_IMR, 0);
+
+#if IPOLL
+ (void)READCSR(sc, R_IER); /* Push */
+ cfe_free_irq(sc->irq, 0);
+#endif
+
+ WRITECSR(sc, R_CR, M_CR_TXD | M_CR_RXD);
+
+ /* wait for any DMA activity to terminate */
+ for (count = 0; count <= 13; count++) {
+ status = READCSR(sc, R_CR);
+ if ((status & (M_CR_TXE | M_CR_RXE)) == 0)
+ break;
+ cfe_sleep(CFE_HZ/10);
+ }
+ if (count > 13) {
+ xprintf("%s: idle state not achieved\n", dp83815_devname(sc));
+ dumpstat(sc);
+ RESET_ADAPTER(sc);
+ sc->state = eth_state_uninit;
+#if 1
+ sc->linkspeed = ETHER_SPEED_AUTO;
+#endif
+ }
+#if 0 /* XXX Not yet implemented. */
+ else if (sc->loopback != ETHER_LOOPBACK_OFF) {
+ dp83815_setloopback(sc, ETHER_LOOPBACK_OFF);
+ }
+#endif
+
+ (void)READCSR(sc, R_ISR); /* Clear any stragglers. */
+}
+
+
+/* *********************************************************************
+ * ETH_PARSE_XDIGIT(c)
+ *
+ * Parse a hex digit, returning its value
+ *
+ * Input parameters:
+ * c - character
+ *
+ * Return value:
+ * hex value, or -1 if invalid
+ ********************************************************************* */
+static int
+eth_parse_xdigit(char c)
+{
+ int digit;
+
+ if ((c >= '0') && (c <= '9')) digit = c - '0';
+ else if ((c >= 'a') && (c <= 'f')) digit = c - 'a' + 10;
+ else if ((c >= 'A') && (c <= 'F')) digit = c - 'A' + 10;
+ else digit = -1;
+
+ return digit;
+}
+
+/* *********************************************************************
+ * ETH_PARSE_HWADDR(str,hwaddr)
+ *
+ * Convert a string in the form xx:xx:xx:xx:xx:xx into a 6-byte
+ * Ethernet address.
+ *
+ * Input parameters:
+ * str - string
+ * hwaddr - pointer to hardware address
+ *
+ * Return value:
+ * 0 if ok, else -1
+ ********************************************************************* */
+static int
+eth_parse_hwaddr(char *str, uint8_t *hwaddr)
+{
+ int digit1, digit2;
+ int idx = ENET_ADDR_LEN;
+
+ while (*str && (idx > 0)) {
+ digit1 = eth_parse_xdigit(*str);
+ if (digit1 < 0) return -1;
+ str++;
+ if (!*str) return -1;
+
+ if ((*str == ':') || (*str == '-')) {
+ digit2 = digit1;
+ digit1 = 0;
+ }
+ else {
+ digit2 = eth_parse_xdigit(*str);
+ if (digit2 < 0) return -1;
+ str++;
+ }
+
+ *hwaddr++ = (digit1 << 4) | digit2;
+ idx--;
+
+ if ((*str == ':') || (*str == '-'))
+ str++;
+ }
+ return 0;
+}
+
+/* *********************************************************************
+ * ETH_INCR_HWADDR(hwaddr,incr)
+ *
+ * Increment a 6-byte Ethernet hardware address, with carries
+ *
+ * Input parameters:
+ * hwaddr - pointer to hardware address
+ * incr - desired increment
+ *
+ * Return value:
+ * none
+ ********************************************************************* */
+static void
+eth_incr_hwaddr(uint8_t *hwaddr, unsigned incr)
+{
+ int idx;
+ int carry;
+
+ idx = 5;
+ carry = incr;
+ while (idx >= 0 && carry != 0) {
+ unsigned sum = hwaddr[idx] + carry;
+
+ hwaddr[idx] = sum & 0xFF;
+ carry = sum >> 8;
+ idx--;
+ }
+}
+
+
+/* *********************************************************************
+ * Declarations for CFE Device Driver Interface routines
+ ********************************************************************* */
+
+static int dp83815_ether_open(cfe_devctx_t *ctx);
+static int dp83815_ether_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int dp83815_ether_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat);
+static int dp83815_ether_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int dp83815_ether_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int dp83815_ether_close(cfe_devctx_t *ctx);
+static void dp83815_ether_poll(cfe_devctx_t *ctx, int64_t ticks);
+static void dp83815_ether_reset(void *softc);
+
+/* *********************************************************************
+ * CFE Device Driver dispatch structure
+ ********************************************************************* */
+
+const static cfe_devdisp_t dp83815_ether_dispatch = {
+ dp83815_ether_open,
+ dp83815_ether_read,
+ dp83815_ether_inpstat,
+ dp83815_ether_write,
+ dp83815_ether_ioctl,
+ dp83815_ether_close,
+ dp83815_ether_poll,
+ dp83815_ether_reset
+};
+
+/* *********************************************************************
+ * CFE Device Driver descriptor
+ ********************************************************************* */
+
+const cfe_driver_t dp83815drv = {
+ "DP83815 Ethernet",
+ "eth",
+ CFE_DEV_NETWORK,
+ &dp83815_ether_dispatch,
+ dp83815_ether_probe
+};
+
+
+static int
+dp83815_ether_attach(cfe_driver_t *drv,
+ pcitag_t tag, int index, uint8_t hwaddr[])
+{
+ dp83815_softc *sc;
+ uint32_t device;
+ uint32_t class;
+ phys_addr_t pa;
+ uint8_t promaddr[ENET_ADDR_LEN];
+ char descr[100];
+ uint32_t srr;
+
+ device = pci_conf_read(tag, R_CFGID);
+ class = pci_conf_read(tag, R_CFGRID);
+
+#if 1
+ /* Use memory space for the CSRs */
+ pci_map_mem(tag, R_CFGMA, PCI_MATCH_BITS, &pa);
+#else
+ /* Use i/o space for the CSRs */
+ pci_map_io(tag, R_CFGIOA, PCI_MATCH_BITS, &pa);
+#endif
+
+ sc = (dp83815_softc *) KMALLOC(sizeof(dp83815_softc), 0);
+
+ if (sc == NULL) {
+ xprintf("DP83815: No memory to complete probe\n");
+ return 0;
+ }
+ memset(sc, 0, sizeof(*sc));
+
+ sc->membase = (uint32_t)pa;
+ sc->irq = pci_conf_read(tag, R_CFGINT) & 0xFF;
+ sc->tag = tag;
+ sc->device = PCI_PRODUCT(device);
+ sc->revision = PCI_REVISION(class);
+ sc->devctx = NULL;
+
+#if 1
+ sc->linkspeed = ETHER_SPEED_AUTO; /* select autonegotiation */
+#else
+ sc->linkspeed = ETHER_SPEED_100FDX; /* 100 Mbps, full duplex */
+#endif
+ sc->loopback = ETHER_LOOPBACK_OFF;
+ memcpy(sc->hwaddr, hwaddr, ENET_ADDR_LEN);
+
+ srr = READCSR(sc, R_SRR);
+#if 0
+ /* The NS data sheet recommends the following for "optimal
+ performance" of CVNG parts. Tested on a sample of one CVNG
+ part on an NS "Macphyter Demo II" eval board, it seemed to
+ produce slightly less reliable initial behavior. */
+ if (G_SRR_REV(srr) == K_REV_CVNG) {
+ /* Update PHY DSP registers per data sheet. */
+ WRITECSR(sc, R_PGSEL, 0x0001);
+ (void)READCSR(sc, R_PGSEL); /* push */
+ WRITECSR(sc, R_PMDCSR, 0x189C);
+ WRITECSR(sc, R_TSTDAT, 0x0000);
+ WRITECSR(sc, R_DSPCFG, 0x5040);
+ WRITECSR(sc, R_SDCFG, 0x008C);
+ }
+#endif
+
+ dp83815_init(sc);
+
+ /* Prefer the address in EEPROM. This will be read into the
+ PMATCH register upon power up. Unfortunately, how to test for
+ completion of the auto-load (but see PTSCR_EELOAD_EN). */
+ if (dp83815_get_pm_addr(sc, promaddr) == 0) {
+ memcpy(sc->hwaddr, promaddr, ENET_ADDR_LEN);
+ }
+
+ sc->state = eth_state_uninit;
+
+ xsprintf(descr, "%s at 0x%X (%02x-%02x-%02x-%02x-%02x-%02x)",
+ drv->drv_description, sc->membase,
+ sc->hwaddr[0], sc->hwaddr[1], sc->hwaddr[2],
+ sc->hwaddr[3], sc->hwaddr[4], sc->hwaddr[5]);
+
+ cfe_attach(drv, sc, NULL, descr);
+ return 1;
+}
+
+
+/* *********************************************************************
+ * DP83815_ETHER_PROBE(drv,probe_a,probe_b,probe_ptr)
+ *
+ * Probe and install drivers for all dp83815 Ethernet controllers.
+ * For each, create a context structure and attach to the
+ * specified network device.
+ *
+ * Input parameters:
+ * drv - driver descriptor
+ * probe_a - not used
+ * probe_b - not used
+ * probe_ptr - string pointer to hardware address for the first
+ * MAC, in the form xx:xx:xx:xx:xx:xx
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+static void
+dp83815_ether_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr)
+{
+ int n;
+ uint8_t hwaddr[ENET_ADDR_LEN];
+
+ if (probe_ptr)
+ eth_parse_hwaddr((char *) probe_ptr, hwaddr);
+ else {
+ /* use default address 02-00-00-10-0B-00 */
+ hwaddr[0] = 0x02; hwaddr[1] = 0x00; hwaddr[2] = 0x00;
+ hwaddr[3] = 0x10; hwaddr[4] = 0x0B; hwaddr[5] = 0x00;
+ }
+
+ n = 0;
+ for (;;) {
+ pcitag_t tag;
+
+ if (pci_find_device(K_PCI_VENDOR_NSC, K_PCI_ID_DP83815, n, &tag) != 0)
+ break;
+ dp83815_ether_attach(drv, tag, n, hwaddr);
+ n++;
+ eth_incr_hwaddr(hwaddr, 1);
+ }
+}
+
+
+/* The functions below are called via the dispatch vector for the 83815. */
+
+/* *********************************************************************
+ * DP83815_ETHER_OPEN(ctx)
+ *
+ * Open the Ethernet device. The MAC is reset, initialized, and
+ * prepared to receive and send packets.
+ *
+ * Input parameters:
+ * ctx - device context (includes ptr to our softc)
+ *
+ * Return value:
+ * status, 0 = ok
+ ********************************************************************* */
+static int
+dp83815_ether_open(cfe_devctx_t *ctx)
+{
+ dp83815_softc *sc = ctx->dev_softc;
+
+ if (sc->state == eth_state_on)
+ dp83815_stop(sc);
+
+ sc->devctx = ctx;
+
+ sc->inpkts = sc->outpkts = 0;
+ sc->interrupts = 0;
+ sc->rx_interrupts = sc->tx_interrupts = 0;
+
+ dp83815_start(sc);
+
+#if XPOLL
+ dp83815_isr(sc);
+#endif
+
+ return 0;
+}
+
+/* *********************************************************************
+ * DP83815_ETHER_READ(ctx,buffer)
+ *
+ * Read a packet from the Ethernet device. If no packets are
+ * available, the read will succeed but return 0 bytes.
+ *
+ * Input parameters:
+ * ctx - device context (includes ptr to our softc)
+ * buffer - pointer to buffer descriptor.
+ *
+ * Return value:
+ * status, 0 = ok
+ ********************************************************************* */
+static int
+dp83815_ether_read(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ dp83815_softc *sc = ctx->dev_softc;
+ eth_pkt_t *pkt;
+ int blen;
+
+#if XPOLL
+ dp83815_isr(sc);
+#endif
+
+ if (sc->state != eth_state_on) return -1;
+
+ CS_ENTER(sc);
+ pkt = (eth_pkt_t *) q_deqnext(&(sc->rxqueue));
+ CS_EXIT(sc);
+
+ if (pkt == NULL) {
+ buffer->buf_retlen = 0;
+ return 0;
+ }
+
+ blen = buffer->buf_length;
+ if (blen > pkt->length) blen = pkt->length;
+
+ blockcopy(buffer->buf_ptr, pkt->buffer, blen);
+ buffer->buf_retlen = blen;
+
+ eth_free_pkt(sc, pkt);
+ dp83815_fillrxring(sc);
+
+#if XPOLL
+ dp83815_isr(sc);
+#endif
+
+ return 0;
+}
+
+/* *********************************************************************
+ * DP83815_ETHER_INPSTAT(ctx,inpstat)
+ *
+ * Check for received packets on the Ethernet device
+ *
+ * Input parameters:
+ * ctx - device context (includes ptr to our softc)
+ * inpstat - pointer to input status structure
+ *
+ * Return value:
+ * status, 0 = ok
+ ********************************************************************* */
+static int
+dp83815_ether_inpstat(cfe_devctx_t *ctx, iocb_inpstat_t *inpstat)
+{
+ dp83815_softc *sc = ctx->dev_softc;
+
+#if XPOLL
+ dp83815_isr(sc);
+#endif
+
+ if (sc->state != eth_state_on) return -1;
+
+ /* We avoid an interlock here because the result is a hint and an
+ interrupt cannot turn a non-empty queue into an empty one. */
+ inpstat->inp_status = (q_isempty(&(sc->rxqueue))) ? 0 : 1;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * DP83815_ETHER_WRITE(ctx,buffer)
+ *
+ * Write a packet to the Ethernet device.
+ *
+ * Input parameters:
+ * ctx - device context (includes ptr to our softc)
+ * buffer - pointer to buffer descriptor.
+ *
+ * Return value:
+ * status, 0 = ok
+ ********************************************************************* */
+static int
+dp83815_ether_write(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ dp83815_softc *sc = ctx->dev_softc;
+ eth_pkt_t *pkt;
+ int blen;
+
+#if XPOLL
+ dp83815_isr(sc);
+#endif
+
+ if (sc->state != eth_state_on) return -1;
+
+ pkt = eth_alloc_pkt(sc);
+ if (!pkt) return CFE_ERR_NOMEM;
+
+ blen = buffer->buf_length;
+ if (blen > pkt->length) blen = pkt->length;
+
+ blockcopy(pkt->buffer, buffer->buf_ptr, blen);
+ pkt->length = blen;
+
+ if (dp83815_transmit(sc, pkt) != 0) {
+ eth_free_pkt(sc,pkt);
+ return CFE_ERR_IOERR;
+ }
+
+#if XPOLL
+ dp83815_isr(sc);
+#endif
+
+ return 0;
+}
+
+/* *********************************************************************
+ * DP83815_ETHER_IOCTL(ctx,buffer)
+ *
+ * Do device-specific I/O control operations for the device
+ *
+ * Input parameters:
+ * ctx - device context (includes ptr to our softc)
+ * buffer - pointer to buffer descriptor.
+ *
+ * Return value:
+ * status, 0 = ok
+ ********************************************************************* */
+static int
+dp83815_ether_ioctl(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ dp83815_softc *sc = ctx->dev_softc;
+ int *argp;
+ int mode;
+ int speed;
+
+ switch ((int)buffer->buf_ioctlcmd) {
+ case IOCTL_ETHER_GETHWADDR:
+ memcpy(buffer->buf_ptr, sc->hwaddr, sizeof(sc->hwaddr));
+ return 0;
+
+ case IOCTL_ETHER_SETHWADDR:
+ return -1; /* not supported */
+
+ case IOCTL_ETHER_GETSPEED:
+ argp = (int *) buffer->buf_ptr;
+ *argp = sc->linkspeed;
+ return 0;
+
+ case IOCTL_ETHER_SETSPEED:
+ dp83815_stop(sc);
+ dp83815_resetrings(sc);
+ speed = *((int *) buffer->buf_ptr);
+ dp83815_setspeed(sc, speed);
+ dp83815_start(sc);
+ sc->state = eth_state_on;
+ return 0;
+
+ case IOCTL_ETHER_GETLINK:
+ argp = (int *) buffer->buf_ptr;
+ *argp = sc->linkspeed;
+ return 0;
+
+ case IOCTL_ETHER_GETLOOPBACK:
+ *((int *) buffer) = sc->loopback;
+ return 0;
+
+ case IOCTL_ETHER_SETLOOPBACK:
+ dp83815_stop(sc);
+ dp83815_resetrings(sc);
+ mode = *((int *) buffer->buf_ptr);
+ sc->loopback = ETHER_LOOPBACK_OFF; /* default */
+ if (mode == ETHER_LOOPBACK_INT || mode == ETHER_LOOPBACK_EXT) {
+ dp83815_setloopback(sc, mode);
+ }
+ dp83815_start(sc);
+ sc->state = eth_state_on;
+ return 0;
+
+ default:
+ return -1;
+ }
+}
+
+/* *********************************************************************
+ * DP83815_ETHER_CLOSE(ctx)
+ *
+ * Close the Ethernet device.
+ *
+ * Input parameters:
+ * ctx - device context (includes ptr to our softc)
+ *
+ * Return value:
+ * status, 0 = ok
+ ********************************************************************* */
+static int
+dp83815_ether_close(cfe_devctx_t *ctx)
+{
+ dp83815_softc *sc = ctx->dev_softc;
+
+ sc->state = eth_state_off;
+ dp83815_stop(sc);
+
+ /* resynchronize descriptor rings */
+ dp83815_resetrings(sc);
+
+ xprintf("%s: %d sent, %d received, %d interrupts\n",
+ dp83815_devname(sc), sc->outpkts, sc->inpkts, sc->interrupts);
+ xprintf(" %d rx interrupts, %d tx interrupts\n",
+ sc->rx_interrupts, sc->tx_interrupts);
+
+ sc->devctx = NULL;
+ return 0;
+}
+
+
+/* *********************************************************************
+ * DP83815_ETHER_POLL(ctx,ticks)
+ *
+ * TBD
+ *
+ * Input parameters:
+ * ctx - device context (includes ptr to our softc)
+ * ticks- current time in ticks
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void
+dp83815_ether_poll(cfe_devctx_t *ctx, int64_t ticks)
+{
+ dp83815_softc *sc = ctx->dev_softc;
+
+ if (sc->phy_check) {
+ sc->phy_check = 0;
+ dp83815_checkphy(sc);
+ }
+}
+
+
+/* *********************************************************************
+ * DP83815_ETHER_RESET(softc)
+ *
+ * This routine is called when CFE is restarted after a
+ * program exits. We can clean up pending I/Os here.
+ *
+ * Input parameters:
+ * softc - pointer to dp83815_softc
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void
+dp83815_ether_reset(void *softc)
+{
+ dp83815_softc *sc = (dp83815_softc *)softc;
+
+ /* Turn off the Ethernet interface. */
+
+ /* RESET_ADAPTER(sc); */
+
+ sc->state = eth_state_uninit;
+}
diff --git a/cfe/cfe/dev/dev_ds17887clock.c b/cfe/cfe/dev/dev_ds17887clock.c
new file mode 100644
index 0000000..2ee82a3
--- /dev/null
+++ b/cfe/cfe/dev/dev_ds17887clock.c
@@ -0,0 +1,422 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * DS17887-3 RTC driver File: dev_sb1250_ds17887clock.c
+ *
+ * This module contains a CFE driver for a DS17887-3 generic bus
+ * real-time-clock.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_ioctl.h"
+
+#include "lib_physio.h"
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+/*
+ * Register bits
+ */
+
+#define DS17887REGA_UIP 0x80 /* Update-in-progress */
+#define DS17887REGA_DV2 0x40 /* Countdown chain */
+#define DS17887REGA_DV1 0x20 /* Oscillator enable */
+#define DS17887REGA_DV0 0x10 /* Bank Select */
+#define DS17887REGA_RS3 0x08 /* Rate-selection bits */
+#define DS17887REGA_RS2 0x04
+#define DS17887REGA_RS1 0x02
+#define DS17887REGA_RS0 0x01
+
+#define DS17887REGB_SET 0x80 /* Set bit */
+#define DS17887REGB_PIE 0x40 /* Periodic Interrupt Enable */
+#define DS17887REGB_AIE 0x20 /* Alarm Interrupt Enable */
+#define DS17887REGB_UIE 0x10 /* Update-ended Interrupt Enable */
+#define DS17887REGB_SQWE 0x08 /* Square-wave Enable */
+#define DS17887REGB_DM 0x04 /* Data Mode (binary) */
+#define DS17887REGB_24 0x02 /* 24-hour mode control bit */
+#define DS17887REGB_DSE 0x01 /* Daylight Savings Enable */
+
+#define DS17887REGC_IRQF 0x80 /* Interrupt request flag */
+#define DS17887REGC_PF 0x40 /* Periodic interrupt flag */
+#define DS17887REGC_AF 0x20 /* Alarm interrupt flag */
+#define DS17887REGC_UF 0x10 /* Update ended interrupt flag */
+
+#define DS17887REGD_VRT 0x80 /* Valid RAM and time */
+
+/*
+ * Register numbers
+ */
+
+#define DS17887REG_SC 0x00 /* seconds */
+#define DS17887REG_SCA 0x01 /* seconds alarm */
+#define DS17887REG_MN 0x02 /* minutes */
+#define DS17887REG_MNA 0x03 /* minutes alarm */
+#define DS17887REG_HR 0x04 /* hours */
+#define DS17887REG_HRA 0x05 /* hours alarm */
+#define DS17887REG_DW 0x06 /* day of week */
+#define DS17887REG_DM 0x07 /* day of month */
+#define DS17887REG_MO 0x08 /* month */
+#define DS17887REG_YR 0x09 /* year */
+#define DS17887REG_A 0x0A /* register A */
+#define DS17887REG_B 0x0B /* register B */
+#define DS17887REG_C 0x0C /* register C */
+#define DS17887REG_D 0x0D /* register D */
+
+#define DS17887REG_CE 0x48 /* century (bank 1 only) */
+
+#define BCD(x) (((x) % 10) + (((x) / 10) << 4))
+#define SET_TIME 0x00
+#define SET_DATE 0x01
+
+#define WRITECSR(p,v) phys_write8((p),(v))
+#define READCSR(p) phys_read8((p))
+
+/* *********************************************************************
+ * Forward declarations
+ ********************************************************************* */
+
+static void ds17887_clock_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+static int ds17887_clock_open(cfe_devctx_t *ctx);
+static int ds17887_clock_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int ds17887_clock_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat);
+static int ds17887_clock_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int ds17887_clock_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int ds17887_clock_close(cfe_devctx_t *ctx);
+
+
+/* *********************************************************************
+ * Device dispatch
+ ********************************************************************* */
+
+const static cfe_devdisp_t ds17887_clock_dispatch = {
+ ds17887_clock_open,
+ ds17887_clock_read,
+ ds17887_clock_inpstat,
+ ds17887_clock_write,
+ ds17887_clock_ioctl,
+ ds17887_clock_close,
+ NULL,
+ NULL
+};
+
+const cfe_driver_t ds17887_clock = {
+ "DS17887 RTC",
+ "clock",
+ CFE_DEV_CLOCK,
+ &ds17887_clock_dispatch,
+ ds17887_clock_probe
+};
+
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+typedef struct ds17887_clock_s {
+ physaddr_t clock_base;
+} ds17887_clock_t;
+
+/* *********************************************************************
+ * ds17887_clock_probe(drv,a,b,ptr)
+ *
+ * Probe routine for this driver. This routine creates the
+ * local device context and attaches it to the driver list
+ * within CFE.
+ *
+ * Input parameters:
+ * drv - driver handle
+ * a,b - probe hints (longs)
+ * ptr - probe hint (pointer)
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void ds17887_clock_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr)
+{
+ ds17887_clock_t *softc;
+ char descr[80];
+
+ softc = (ds17887_clock_t *) KMALLOC(sizeof(ds17887_clock_t),0);
+
+ /*
+ * Probe_a is the clock base address
+ * Probe_b is unused.
+ * Probe_ptr is unused.
+ */
+
+ softc->clock_base = probe_a;
+
+ xsprintf(descr,"%s at 0x%X",
+ drv->drv_description,(uint32_t)probe_a);
+ cfe_attach(drv,softc,NULL,descr);
+
+}
+
+/* *********************************************************************
+ * ds17887_clock_open(ctx)
+ *
+ * Open this device. For the DS17887, we do a quick test
+ * read to be sure the device is out there.
+ *
+ * Input parameters:
+ * ctx - device context (can obtain our softc here)
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int ds17887_clock_open(cfe_devctx_t *ctx)
+{
+ ds17887_clock_t *softc = ctx->dev_softc;
+ uint8_t byte;
+ physaddr_t clockbase;
+
+ clockbase = softc->clock_base;
+
+ /* Make sure battery is still good and RTC valid */
+ if ( !(READCSR(clockbase+DS17887REG_D) & DS17887REGD_VRT) ) {
+ printf("Warning: Battery has failed. Clock setting is not accurate.\n");
+ }
+
+ /* Switch to bank 1. Mainly for century byte */
+ byte = (uint8_t) (READCSR(clockbase+DS17887REG_A) & 0xFF);
+ WRITECSR(clockbase+DS17887REG_A,DS17887REGA_DV0 | DS17887REGA_DV1 | byte);
+
+ /* Set data mode to BCD, 24-hour mode, and enable daylight savings */
+ byte = (uint8_t) (READCSR(clockbase+DS17887REG_B) & 0xFF);
+ byte &= (~DS17887REGB_DM & ~DS17887REGB_AIE);
+ WRITECSR(clockbase+DS17887REG_B, DS17887REGB_24 | DS17887REGB_DSE | byte );
+
+ return 0;
+}
+
+/* *********************************************************************
+ * ds17887_clock_read(ctx,buffer)
+ *
+ * Read time/date from the RTC. Read a total of 8 bytes in this format:
+ * hour-minute-second-month-day-year1-year2
+ *
+ * Input parameters:
+ * ctx - device context (can obtain our softc here)
+ * buffer - buffer descriptor (target buffer, length, offset)
+ *
+ * Return value:
+ * number of bytes read
+ * -1 if an error occured
+ ********************************************************************* */
+
+static int ds17887_clock_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+
+ ds17887_clock_t *softc = ctx->dev_softc;
+ unsigned char *bptr;
+ physaddr_t clockbase;
+
+ clockbase = softc->clock_base;
+
+ bptr = buffer->buf_ptr;
+
+ *bptr++ = READCSR(clockbase+DS17887REG_HR);
+ *bptr++ = READCSR(clockbase+DS17887REG_MN);
+ *bptr++ = READCSR(clockbase+DS17887REG_SC);
+ *bptr++ = READCSR(clockbase+DS17887REG_MO);
+ *bptr++ = READCSR(clockbase+DS17887REG_DM);
+ *bptr++ = READCSR(clockbase+DS17887REG_YR);
+ *bptr++ = READCSR(clockbase+DS17887REG_CE);
+
+ buffer->buf_retlen = 8;
+ return 0;
+}
+
+/* *********************************************************************
+ * ds17887_clock_write(ctx,buffer)
+ *
+ * Write time/date to the RTC. Write in this format:
+ * hour-minute-second-month-day-year1-year2-(time/date flag)
+ *
+ * Input parameters:
+ * ctx - device context (can obtain our softc here)
+ * buffer - buffer descriptor (target buffer, length, offset)
+ *
+ * Return value:
+ * number of bytes written
+ * -1 if an error occured
+ ********************************************************************* */
+
+static int ds17887_clock_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ ds17887_clock_t *softc = ctx->dev_softc;
+ uint8_t byte;
+ unsigned char *bptr;
+ uint8_t hr,min,sec;
+ uint8_t mo,day,yr,y2k;
+ uint8_t timeDateFlag;
+ physaddr_t clockbase;
+
+ clockbase = softc->clock_base;
+
+ bptr = buffer->buf_ptr;
+
+ /* Set SET bit */
+ byte = (uint8_t) (READCSR(clockbase+DS17887REG_B) & 0xFF);
+ WRITECSR(clockbase+DS17887REG_B,DS17887REGB_SET | byte);
+
+ timeDateFlag = *(bptr + 7);
+
+ /* write time or date */
+ if(timeDateFlag == SET_TIME) {
+
+ hr = (uint8_t) *bptr;
+ WRITECSR(clockbase+DS17887REG_HR,BCD(hr));
+
+ min = (uint8_t) *(bptr+1);
+ WRITECSR(clockbase+DS17887REG_MN,BCD(min));
+
+ sec = (uint8_t) *(bptr+2);
+ WRITECSR(clockbase+DS17887REG_SC,BCD(sec));
+
+ buffer->buf_retlen = 3;
+ }
+ else if(timeDateFlag == SET_DATE) {
+
+ mo = (uint8_t) *(bptr+3);
+ WRITECSR(clockbase+DS17887REG_MO,BCD(mo));
+
+ day = (uint8_t) *(bptr+4);
+ WRITECSR(clockbase+DS17887REG_DM,BCD(day));
+
+ yr = (uint8_t) *(bptr+5);
+ WRITECSR(clockbase+DS17887REG_YR,BCD(yr));
+
+ y2k = (uint8_t) *(bptr+6);
+ WRITECSR(clockbase+DS17887REG_CE,y2k);
+
+ buffer->buf_retlen = 4;
+ }
+ else {
+ return -1;
+ }
+
+ /* clear SET bit */
+ byte = (uint8_t) (READCSR(clockbase+DS17887REG_B) & 0xFF);
+ WRITECSR(clockbase+DS17887REG_B,~DS17887REGB_SET & byte);
+
+ return 0;
+}
+
+/* *********************************************************************
+ * ds17887_clock_inpstat(ctx,inpstat)
+ *
+ * Test input (read) status for the device
+ *
+ * Input parameters:
+ * ctx - device context (can obtain our softc here)
+ * inpstat - input status descriptor to receive value
+ *
+ * Return value:
+ * 0 if ok
+ * -1 if an error occured
+ ********************************************************************* */
+
+static int ds17887_clock_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat)
+{
+ inpstat->inp_status = 1;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * ds17887_clock_ioctl(ctx,buffer)
+ *
+ * Perform miscellaneous I/O control operations on the device.
+ *
+ * Input parameters:
+ * ctx - device context (can obtain our softc here)
+ * buffer - buffer descriptor (target buffer, length, offset)
+ *
+ * Return value:
+ * number of bytes read
+ * -1 if an error occured
+ ********************************************************************* */
+
+static int ds17887_clock_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ return 0;
+}
+
+/* *********************************************************************
+ * ds17887_clock_close(ctx,buffer)
+ *
+ * Close the device.
+ *
+ * Input parameters:
+ * ctx - device context (can obtain our softc here)
+ *
+ * Return value:
+ * 0 if ok
+ * -1 if an error occured
+ ********************************************************************* */
+
+static int ds17887_clock_close(cfe_devctx_t *ctx)
+{
+ return 0;
+}
+
+
+
+
+
+
+
+
diff --git a/cfe/cfe/dev/dev_flash.c b/cfe/cfe/dev/dev_flash.c
new file mode 100644
index 0000000..98ad3e7
--- /dev/null
+++ b/cfe/cfe/dev/dev_flash.c
@@ -0,0 +1,1367 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Flash device driver File: dev_flash.c
+ *
+ * This driver supports various types of flash
+ * parts. You can also put the environment storage in
+ * the flash - the top sector is reserved for that purpose.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "addrspace.h"
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_ioctl.h"
+#include "cfe_error.h"
+
+#include "dev_flash.h"
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#define FLASHCMD(sc,x,y) *((volatile unsigned char *)(sc->flashdrv_cmdaddr+ \
+ ((x)<<(sc)->flashdrv_widemode))) = (y)
+#define FLASHSTATUS(sc,x) *((volatile unsigned char *)(sc->flashdrv_cmdaddr+ \
+ ((x)<<(sc)->flashdrv_widemode)))
+
+#define WRITEFLASH_K1(sc,x,y) *((volatile unsigned char *)(sc->flashdrv_cmdaddr+(x))) = (y)
+#define READFLASH_K1(sc,x) *((volatile unsigned char *)(sc->flashdrv_cmdaddr+(x)))
+
+#define WRITEFLASH_K1W(sc,x,y) *((volatile unsigned short *)(sc->flashdrv_cmdaddr+(x))) = (y)
+#define READFLASH_K1W(sc,x) *((volatile unsigned short *)(sc->flashdrv_cmdaddr+(x)))
+
+
+#define GETCFIBYTE(softc,offset) READFLASH_K1(softc,((offset) << (softc->flashdrv_widemode)))
+
+/* *********************************************************************
+ * Forward declarations
+ ********************************************************************* */
+
+
+static void flashdrv_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+
+static int flashdrv_open(cfe_devctx_t *ctx);
+static int flashdrv_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int flashdrv_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat);
+static int flashdrv_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int flashdrv_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int flashdrv_close(cfe_devctx_t *ctx);
+
+/* *********************************************************************
+ * Device dispatch
+ ********************************************************************* */
+
+const static cfe_devdisp_t flashdrv_dispatch = {
+ flashdrv_open,
+ flashdrv_read,
+ flashdrv_inpstat,
+ flashdrv_write,
+ flashdrv_ioctl,
+ flashdrv_close,
+ NULL,
+ NULL
+};
+
+const cfe_driver_t flashdrv = {
+ "CFI flash",
+ "flash",
+ CFE_DEV_FLASH,
+ &flashdrv_dispatch,
+ flashdrv_probe
+};
+
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+typedef struct flash_cfidata_s {
+ unsigned int cfidata_cmdset; /* ID of primary command set */
+ unsigned int cfidata_devif; /* device interface byte */
+ unsigned int cfidata_size; /* probed device size */
+} flash_cfidata_t;
+
+typedef struct flashops_s flashops_t;
+
+typedef struct flashdrv_s {
+ flash_probe_t flashdrv_probe; /* data from probe */
+ int flashdrv_devsize; /* size reported by driver */
+ unsigned char *flashdrv_cmdaddr; /* virtual address (K1) */
+ int flashdrv_widemode; /* 1=wide flash in byte mode, 0=narrow flash */
+ int flashdrv_initialized; /* true if we've probed already */
+ flash_info_t flashdrv_info;
+ int flashdrv_nvram_ok; /* true if we can use as NVRAM */
+ int flashdrv_unlocked; /* true if we can r/w past devsize */
+ nvram_info_t flashdrv_nvraminfo;
+ flashops_t *flashdrv_ops;
+ flash_cfidata_t flashdrv_cfidata;
+} flashdrv_t;
+
+struct flashops_s {
+ int (*erasesector)(flashdrv_t *f,int offset);
+ int (*writeblk)(flashdrv_t *f,int offset,void *buf,int len);
+};
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#define FLASHOP_ERASE_SECTOR(softc,sect) (*((softc)->flashdrv_ops->erasesector))((softc),(sect))
+#define FLASHOP_WRITE_BLOCK(softc,off,buf,len) (*((softc)->flashdrv_ops->writeblk))((softc),(off),(buf),(len))
+
+/* *********************************************************************
+ * forward declarations
+ ********************************************************************* */
+
+
+static int flash_sector_query(flashdrv_t *softc,flash_sector_t *sector);
+
+static int amd_flash_write_block(flashdrv_t *softc,int offset,void *buf,int len);
+static int amd_flash_erase_sector(flashdrv_t *softc,int offset);
+
+static int intel_flash_write_block(flashdrv_t *softc,int offset,void *buf,int len);
+static int intel_flash_erase_sector(flashdrv_t *softc,int offset);
+
+static flashops_t amd_flashops = {
+ amd_flash_erase_sector,
+ amd_flash_write_block,
+};
+
+static flashops_t intel_flashops = {
+ intel_flash_erase_sector,
+ intel_flash_write_block,
+};
+
+#define FLASHOPS_DEFAULT amd_flashops
+
+
+
+/* *********************************************************************
+ * Externs
+ ********************************************************************* */
+
+extern void *flash_write_all_ptr;
+extern int flash_write_all_len;
+
+extern void _cfe_flushcache(int);
+
+
+#if 0
+/* *********************************************************************
+ * jedec_flash_maufacturer(softc)
+ *
+ * Return the manufacturer ID for this flash part.
+ *
+ * Input parameters:
+ * softc - flash context
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static unsigned int jedec_flash_manufacturer(flashdrv_t *softc)
+{
+ unsigned int res;
+
+ /* Do an "unlock write" sequence */
+ FLASHCMD(softc,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1);
+ FLASHCMD(softc,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2);
+ FLASHCMD(softc,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_AUTOSEL);
+
+ res = FLASHSTATUS(softc,FLASH_JEDEC_OFFSET_MFR) & 0xFF;
+
+ FLASHCMD(softc,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_RESET);
+
+ return res;
+}
+
+/* *********************************************************************
+ * jedec_flash_type(softc)
+ *
+ * Return the manufacturer's type for the flash
+ *
+ * Input parameters:
+ * softc - flash context
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+static unsigned int jedec_flash_type(flashdrv_t *softc)
+{
+ unsigned int res;
+
+ /* Do an "unlock write" sequence */
+ FLASHCMD(softc,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1);
+ FLASHCMD(softc,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2);
+ FLASHCMD(softc,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_AUTOSEL);
+
+ res = FLASHSTATUS(softc,FLASH_JEDEC_OFFSET_DEV) & 0xFF;
+
+ FLASHCMD(softc,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_RESET);
+
+ return res;
+}
+
+#endif
+
+/* *********************************************************************
+ * amd_flash_write_byte(softc,offset,val)
+ *
+ * Write a single byte to the flash. The sector that the flash
+ * byte is in should have been previously erased, or else this
+ * routine may hang.
+ *
+ * Input parameters:
+ * softc - flash context
+ * offset - distance in bytes into the flash
+ * val - byte to write
+ *
+ * Return value:
+ * 0 if ok
+ * else if flash could not be written
+ ********************************************************************* */
+static inline int amd_flash_write_byte(flashdrv_t *softc,int offset, unsigned char val)
+{
+ unsigned int value;
+
+ /* Do an "unlock write" sequence */
+ FLASHCMD(softc,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1);
+ FLASHCMD(softc,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2);
+
+ /* Send a program command */
+ FLASHCMD(softc,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_PROGRAM);
+
+ /* Write a byte */
+ WRITEFLASH_K1(softc,offset,val);
+
+ for (;;) {
+ value = READFLASH_K1(softc,offset) & 0xFF;
+
+ if ((value & 0x80) == (val & 0x80)) {
+ return 0;
+ }
+ if ((value & 0x20) != 0x20) {
+ continue;
+ }
+
+ if ((READFLASH_K1(softc,offset) & 0x80) == (val & 0x80)) {
+ return 0;
+ }
+ else {
+ return -1;
+ }
+ }
+}
+
+
+/* *********************************************************************
+ * amd_flash_write_block(softc,offset,val)
+ *
+ * Write a single byte to the flash. The sector that the flash
+ * byte is in should have been previously erased, or else this
+ * routine may hang.
+ *
+ * Input parameters:
+ * softc - flash context
+ * offset - distance in bytes into the flash
+ * buf - buffer of bytes to write
+ * len - number of bytes to write
+ *
+ * Return value:
+ * number of bytes written
+ ********************************************************************* */
+static int amd_flash_write_block(flashdrv_t *softc,int offset,void *buf,int len)
+{
+ unsigned char *ptr;
+
+ ptr = buf;
+
+ while (len) {
+ if (amd_flash_write_byte(softc,offset,*ptr) < 0) break;
+ len--;
+ ptr++;
+ offset++;
+
+ }
+
+ return (ptr - (unsigned char *)buf);
+}
+
+
+/* *********************************************************************
+ * amd_flash_erase_sector(softc,offset)
+ *
+ * Erase a single sector in the flash device
+ *
+ * Input parameters:
+ * softc - device context
+ * offset - offset in flash of sector to erase
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+static int amd_flash_erase_sector(flashdrv_t *softc,int offset)
+{
+ /* Do an "unlock write" sequence */
+ FLASHCMD(softc,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1); /* cycles 1-2 */
+ FLASHCMD(softc,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2);
+
+ /* send the erase command */
+ FLASHCMD(softc,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_ERASE_3); /* cycle 3 */
+
+ /* Do an "unlock write" sequence */
+ FLASHCMD(softc,AMD_FLASH_MAGIC_ADDR_1,AMD_FLASH_MAGIC_1); /* cycles 4-5 */
+ FLASHCMD(softc,AMD_FLASH_MAGIC_ADDR_2,AMD_FLASH_MAGIC_2);
+
+ /*
+ * Send the "erase sector" qualifier - don't use FLASHCMD
+ * because it changes the offset.
+ */
+ WRITEFLASH_K1(softc,offset,AMD_FLASH_ERASE_SEC_6);
+
+ while ((READFLASH_K1(softc,offset) & 0x80) != 0x80) {
+ /* NULL LOOP */
+ }
+
+ return 0;
+}
+
+
+
+/* *********************************************************************
+ * intel_flash_write_byte(softc,offset,val)
+ *
+ * Write a single byte to the flash. The sector that the flash
+ * byte is in should have been previously erased, or else this
+ * routine may hang.
+ *
+ * Input parameters:
+ * softc - flash context
+ * offset - distance in bytes into the flash
+ * val - byte to write
+ *
+ * Return value:
+ * 0 if ok
+ * else if flash could not be written
+ ********************************************************************* */
+static inline int intel_flash_write_byte(flashdrv_t *softc,
+ int offset, unsigned char val)
+{
+ unsigned int value;
+
+ /* Send a program command */
+ WRITEFLASH_K1(softc,offset,INTEL_FLASH_PROGRAM);
+
+ /* Write a byte */
+ WRITEFLASH_K1(softc,offset,val);
+
+
+ while ((READFLASH_K1(softc,offset) & 0x80) != 0x80) {
+ /* NULL LOOP */
+ }
+
+ value = READFLASH_K1(softc,offset) & 0xFF;
+
+ if (value & (0x01|0x08|0x10)) return -1;
+ return 0;
+}
+
+/* *********************************************************************
+ * intel_flash_write_word(softc,offset,val)
+ *
+ * Write a single word to the flash. The sector that the flash
+ * byte is in should have been previously erased, or else this
+ * routine may hang.
+ *
+ * Input parameters:
+ * softc - flash context
+ * offset - distance in bytes into the flash
+ * val - word to write
+ *
+ * Return value:
+ * 0 if ok
+ * else if flash could not be written
+ ********************************************************************* */
+static inline int intel_flash_write_word(flashdrv_t *softc,
+ int offset, unsigned short val)
+{
+ unsigned int value;
+
+
+ /* Send a program command */
+ WRITEFLASH_K1W(softc,offset,INTEL_FLASH_PROGRAM);
+
+ /* Write a byte */
+ WRITEFLASH_K1W(softc,offset,val);
+
+
+ while ((READFLASH_K1W(softc,offset) & 0x80) != 0x80) {
+ /* NULL LOOP */
+ }
+
+ value = READFLASH_K1W(softc,offset) & 0xFF;
+
+ if (value & (0x01|0x08|0x10)) return -1;
+ return 0;
+}
+
+/* *********************************************************************
+ * intel_flash_write_block(softc,offset,val)
+ *
+ * Write a single byte to the flash. The sector that the flash
+ * byte is in should have been previously erased, or else this
+ * routine may hang.
+ *
+ * Input parameters:
+ * softc - flash context
+ * offset - distance in bytes into the flash
+ * buf - buffer of bytes to write
+ * len - number of bytes to write
+ *
+ * Return value:
+ * number of bytes written
+ ********************************************************************* */
+static int intel_flash_write_block(flashdrv_t *softc,int offset,void *buf,int len)
+{
+ unsigned char *ptr;
+ unsigned short *ptrw;
+
+ if (softc->flashdrv_probe.flash_flags & FLASH_FLG_16BIT) {
+ ptrw = buf;
+ offset &= ~1; /* offset must be even */
+ while (len > 0) {
+ if (intel_flash_write_word(softc,offset,*ptrw) < 0) break;
+ len-=2;
+ ptrw++;
+ offset+=2;
+ }
+ WRITEFLASH_K1(softc,offset,INTEL_FLASH_READ_MODE);
+ return ((unsigned char *) ptrw - (unsigned char *)buf);
+ }
+ else {
+ ptr = buf;
+ while (len) {
+ if (intel_flash_write_byte(softc,offset,*ptr) < 0) break;
+ len--;
+ ptr++;
+ offset++;
+ }
+ WRITEFLASH_K1(softc,offset,INTEL_FLASH_READ_MODE);
+ return (ptr - (unsigned char *)buf);
+ }
+
+}
+
+
+/* *********************************************************************
+ * intel_flash_erase_sector(softc,offset)
+ *
+ * Erase a single sector on the flash device
+ *
+ * Input parameters:
+ * softc - device context
+ * offset - offset in flash of sector to erase
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+static int intel_flash_erase_sector(flashdrv_t *softc,int offset)
+{
+ WRITEFLASH_K1(softc,offset,INTEL_FLASH_ERASE_BLOCK);
+ WRITEFLASH_K1(softc,offset,INTEL_FLASH_ERASE_CONFIRM);
+
+ while ((READFLASH_K1(softc,offset) & 0x80) != 0x80) {
+ /* NULL LOOP */
+ }
+ WRITEFLASH_K1(softc,offset,INTEL_FLASH_READ_MODE);
+
+ return 0;
+}
+
+
+
+
+
+/* *********************************************************************
+ * FLASH_ERASE_RANGE(softc,range)
+ *
+ * Erase a range of sectors
+ *
+ * Input parameters:
+ * softc - our flash
+ * range - range structure
+ *
+ * Return value:
+ * 0 if ok
+ * else error
+ ********************************************************************* */
+
+static int flash_erase_range(flashdrv_t *softc,flash_range_t *range)
+{
+ flash_sector_t sector;
+ int res;
+
+ if (softc->flashdrv_info.flash_type != FLASH_TYPE_FLASH) {
+ return CFE_ERR_UNSUPPORTED;
+ }
+
+
+ if (range->range_base+range->range_length > softc->flashdrv_devsize) {
+ return CFE_ERR_INV_PARAM;
+ }
+
+ res = 0;
+
+ sector.flash_sector_idx = 0;
+
+ for (;;) {
+ res = flash_sector_query(softc,&sector);
+ if (res != 0) break;
+ if (sector.flash_sector_status == FLASH_SECTOR_INVALID) {
+ break;
+ }
+
+ if ((sector.flash_sector_offset >= range->range_base) &&
+ (sector.flash_sector_offset <
+ (range->range_base+range->range_length-1))) {
+
+ if (softc->flashdrv_nvram_ok &&
+ (sector.flash_sector_offset >= softc->flashdrv_nvraminfo.nvram_offset)) {
+ break;
+ }
+ res = FLASHOP_ERASE_SECTOR(softc,sector.flash_sector_offset);
+ if (res != 0) break;
+ }
+ sector.flash_sector_idx++;
+ }
+
+ return res;
+
+}
+
+/* *********************************************************************
+ * FLASH_ERASE_ALL(softc)
+ *
+ * Erase the entire flash device, except the NVRAM area,
+ * sector-by-sector.
+ *
+ * Input parameters:
+ * softc - our flash
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int flash_erase_all(flashdrv_t *softc)
+{
+ flash_range_t range;
+
+ range.range_base = 0;
+ range.range_length = softc->flashdrv_devsize;
+
+ return flash_erase_range(softc,&range);
+}
+
+/* *********************************************************************
+ * FLASH_CFI_GETSECTORS(softc)
+ *
+ * Query the CFI information and store the sector info in our
+ * private probe structure.
+ *
+ * Input parameters:
+ * softc - our flash info
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int flash_cfi_getsectors(flashdrv_t *softc)
+{
+ int idx;
+ int regcnt;
+ int nblks;
+ int blksiz;
+
+ regcnt = GETCFIBYTE(softc,FLASH_CFI_REGION_COUNT);
+
+ softc->flashdrv_probe.flash_nsectors = regcnt;
+
+ for (idx = 0; idx < regcnt; idx++) {
+ nblks = ((int)GETCFIBYTE(softc,FLASH_CFI_REGION_TABLE+0+idx*4) +
+ (int)(GETCFIBYTE(softc,FLASH_CFI_REGION_TABLE+1+idx*4)<<8)) + 1;
+ blksiz = ((int)GETCFIBYTE(softc,FLASH_CFI_REGION_TABLE+2+idx*4) +
+ (int)(GETCFIBYTE(softc,FLASH_CFI_REGION_TABLE+3+idx*4)<<8)) * 256;
+ softc->flashdrv_probe.flash_sectors[idx] =
+ FLASH_SECTOR_RANGE(nblks,blksiz);
+ }
+
+
+ return 0;
+}
+
+/* *********************************************************************
+ * FLASH_SECTOR_QUERY(softc,sector)
+ *
+ * Query the sector information about a particular sector. You can
+ * call this iteratively to find out about all of the sectors.
+ *
+ * Input parameters:
+ * softc - our flash info
+ * sector - structure to receive sector information
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int flash_sector_query(flashdrv_t *softc,flash_sector_t *sector)
+{
+ int idx;
+ int nblks;
+ int blksiz;
+ unsigned int offset;
+ int curblk;
+
+ if (softc->flashdrv_info.flash_type != FLASH_TYPE_FLASH) {
+ return CFE_ERR_UNSUPPORTED;
+ }
+
+ if (softc->flashdrv_probe.flash_nsectors == 0) {
+ return CFE_ERR_UNSUPPORTED;
+ }
+
+ offset = 0;
+ curblk = 0;
+ for (idx = 0; idx < softc->flashdrv_probe.flash_nsectors; idx++) {
+ nblks = FLASH_SECTOR_NBLKS(softc->flashdrv_probe.flash_sectors[idx]);
+ blksiz = FLASH_SECTOR_SIZE(softc->flashdrv_probe.flash_sectors[idx]);
+ if (sector->flash_sector_idx < curblk+nblks) {
+ sector->flash_sector_status = FLASH_SECTOR_OK;
+ sector->flash_sector_offset =
+ offset + (sector->flash_sector_idx-curblk)*blksiz;
+ sector->flash_sector_size = blksiz;
+ break;
+ }
+
+ offset += (nblks)*blksiz;
+ curblk += nblks;
+ }
+
+
+ if (idx == softc->flashdrv_probe.flash_nsectors) {
+ sector->flash_sector_status = FLASH_SECTOR_INVALID;
+ }
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * FLASH_SET_CMDSET(softc,cmdset)
+ *
+ * Set the command-set that we'll honor for this flash.
+ *
+ * Input parameters:
+ * softc - our flash
+ * cmdset - FLASH_CFI_CMDSET_xxx
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void flash_set_cmdset(flashdrv_t *softc,int cmdset)
+{
+ switch (cmdset) {
+ case FLASH_CFI_CMDSET_INTEL_ECS:
+ case FLASH_CFI_CMDSET_INTEL_STD:
+ softc->flashdrv_ops = &intel_flashops;
+ /* XXX: Intel flashes don't have the "a-1" line. Yay. */
+ softc->flashdrv_widemode = 0;
+ break;
+ case FLASH_CFI_CMDSET_AMD_STD:
+ case FLASH_CFI_CMDSET_AMD_ECS:
+ softc->flashdrv_ops = &amd_flashops;
+ break;
+ default:
+ /* we don't understand the command set - treat it like ROM */
+ softc->flashdrv_info.flash_type = FLASH_TYPE_ROM;
+ }
+}
+
+
+/* *********************************************************************
+ * FLASH_CFI_PROBE(softc)
+ *
+ * Try to do a CFI query on this device. If we find the m
+ * magic signature, extract some useful information from the
+ * query structure.
+ *
+ * Input parameters:
+ * softc - out flash
+ *
+ * Return value:
+ * 0 if successful, <0 if error
+ ********************************************************************* */
+static int flash_cfi_probe(flashdrv_t *softc)
+{
+ FLASHCMD(softc,FLASH_CFI_QUERY_ADDR,FLASH_CFI_QUERY_MODE);
+
+ if (!((GETCFIBYTE(softc,FLASH_CFI_SIGNATURE+0) == 'Q') &&
+ (GETCFIBYTE(softc,FLASH_CFI_SIGNATURE+1) == 'R') &&
+ (GETCFIBYTE(softc,FLASH_CFI_SIGNATURE+2) == 'Y'))) {
+
+ FLASHCMD(softc,FLASH_CFI_QUERY_ADDR,FLASH_CFI_QUERY_EXIT);
+ return CFE_ERR_UNSUPPORTED;
+ }
+
+ /*
+ * Gather info from flash
+ */
+
+ softc->flashdrv_cfidata.cfidata_cmdset =
+ ((unsigned int) (GETCFIBYTE(softc,FLASH_CFI_COMMAND_SET))) +
+ (((unsigned int) (GETCFIBYTE(softc,FLASH_CFI_COMMAND_SET+1))) << 8);
+
+ softc->flashdrv_cfidata.cfidata_devif =
+ ((unsigned int) (GETCFIBYTE(softc,FLASH_CFI_DEVICE_INTERFACE))) +
+ (((unsigned int) (GETCFIBYTE(softc,FLASH_CFI_DEVICE_INTERFACE+1))) << 8);
+
+ softc->flashdrv_cfidata.cfidata_size =
+ 1 << ((unsigned int) (GETCFIBYTE(softc,FLASH_CFI_DEVICE_SIZE)));
+
+ flash_cfi_getsectors(softc);
+
+ /*
+ * Don't need to be in query mode anymore.
+ */
+
+ FLASHCMD(softc,FLASH_CFI_QUERY_ADDR,FLASH_CFI_QUERY_EXIT);
+
+ softc->flashdrv_info.flash_type = FLASH_TYPE_FLASH;
+
+ flash_set_cmdset(softc,softc->flashdrv_cfidata.cfidata_cmdset);
+
+ return 0;
+
+}
+
+/* *********************************************************************
+ * FLASH_GETWIDTH(softc,info)
+ *
+ * Try to determine the width of the flash. This is needed for
+ * management purposes, since some 16-bit flash parts in 8-bit mode
+ * have an "A-1" (address line -1) wire to select bytes within
+ * a 16-bit word. When this is present, the flash commands
+ * will have different offsets.
+ *
+ * Input parameters:
+ * softc - our flash
+ * info - flash info structure
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void flash_getwidth(flashdrv_t *softc,flash_info_t *info)
+{
+ softc->flashdrv_widemode = 0; /* first try narrow */
+
+ if (flash_cfi_probe(softc) == 0) {
+ return;
+ }
+
+ softc->flashdrv_widemode = 1; /* then wide */
+
+ if (flash_cfi_probe(softc) == 0) {
+ return;
+ }
+
+ /* Just return, assume not wide if no CFI interface */
+ softc->flashdrv_widemode = 0;
+
+ softc->flashdrv_info.flash_type = FLASH_TYPE_ROM; /* no CFI: treat as ROM */
+}
+
+/* *********************************************************************
+ * flash_getinfo(softc)
+ *
+ * Try to determine if the specified region is flash, ROM, SRAM,
+ * or something else.
+ *
+ * Input parameters:
+ * softc - our context
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void flash_getinfo(flashdrv_t *softc)
+{
+ uint8_t save0,save1;
+ volatile uint8_t *ptr;
+ flash_info_t *info = &(softc->flashdrv_info);
+
+ /*
+ * Set up some defaults based on the probe data
+ */
+
+ softc->flashdrv_widemode = 0;
+ info->flash_base = softc->flashdrv_probe.flash_phys;
+ info->flash_size = softc->flashdrv_probe.flash_size;
+ softc->flashdrv_devsize = softc->flashdrv_probe.flash_size;
+ info->flash_type = FLASH_TYPE_UNKNOWN;
+ info->flash_flags = 0;
+
+ /*
+ * If we've been told not to try probing, just assume
+ * we're a flash part.
+ */
+
+ if (softc->flashdrv_probe.flash_flags & FLASH_FLG_MANUAL) {
+ info->flash_type = FLASH_TYPE_FLASH;
+ if (softc->flashdrv_probe.flash_flags & FLASH_FLG_WIDE) {
+ softc->flashdrv_widemode = TRUE;
+ }
+ if (softc->flashdrv_probe.flash_cmdset) {
+ flash_set_cmdset(softc,softc->flashdrv_probe.flash_cmdset);
+ }
+ return;
+ }
+
+ /*
+ * Attempt to read/write byte zero. If it is changable,
+ * this is SRAM (or maybe a ROM emulator with the write line hooked up)
+ */
+
+ ptr = (volatile uint8_t *) UNCADDR(softc->flashdrv_probe.flash_phys);
+ save0 = *ptr; /* save old value */
+ save1 = *(ptr+1); /* save old value */
+ *(ptr) = 0x55;
+ if ((*ptr) == 0x55) {
+ *(ptr) = 0xAA;
+ if ((*ptr) == 0xAA) {
+ info->flash_type = FLASH_TYPE_SRAM;
+ }
+ }
+
+ if (*ptr == save0) info->flash_type = FLASH_TYPE_ROM;
+ else (*ptr) = save0; /* restore old value */
+
+ /*
+ * If we thought it was ROM, try doing a CFI query
+ * to see if it was flash. This check is kind of kludgey
+ * but should work.
+ */
+
+ if (info->flash_type == FLASH_TYPE_ROM) {
+ flash_getwidth(softc,info);
+ if (info->flash_type == FLASH_TYPE_FLASH) {
+ }
+ }
+}
+
+/* *********************************************************************
+ * flashdrv_setup_nvram(softc)
+ *
+ * If we're going to be using a sector of the flash for NVRAM,
+ * go find that sector and set it up.
+ *
+ * Input parameters:
+ * softc - our flash
+ *
+ * Return value:
+ * nothing. flashdrv_nvram_ok might change though.
+ ********************************************************************* */
+
+static void flashdrv_setup_nvram(flashdrv_t *softc)
+{
+ flash_sector_t sector;
+ int res;
+
+ softc->flashdrv_nvram_ok = FALSE;
+
+ if (softc->flashdrv_info.flash_type != FLASH_TYPE_FLASH) {
+ return;
+ }
+
+ sector.flash_sector_idx = 0;
+ for (;;) {
+ res = flash_sector_query(softc,&sector);
+ if (res == CFE_ERR_UNSUPPORTED) break;
+ if (res == 0) {
+ if (sector.flash_sector_status != FLASH_SECTOR_INVALID) {
+ sector.flash_sector_idx++;
+ continue;
+ }
+ }
+ break;
+ }
+
+ /* The sector offset will still contain the value at the end
+ of the last successful call. That's the last sector, so
+ we can now use this to fill in the NVRAM info structure */
+
+ if (res != CFE_ERR_UNSUPPORTED) {
+ softc->flashdrv_nvraminfo.nvram_offset = sector.flash_sector_offset;
+ softc->flashdrv_nvraminfo.nvram_size = sector.flash_sector_size;
+ softc->flashdrv_nvraminfo.nvram_eraseflg = TRUE; /* needs erase */
+ softc->flashdrv_nvram_ok = TRUE;
+ /*
+ * Set the flash's size as reported in the flash_info structure
+ * to be the size without the NVRAM sector at the end.
+ */
+ softc->flashdrv_info.flash_size = sector.flash_sector_offset;
+ softc->flashdrv_devsize = sector.flash_sector_offset;
+ }
+
+}
+
+
+/* *********************************************************************
+ * flashdrv_probe(drv,probe_a,probe_b,probe_ptr)
+ *
+ * Device probe routine. Attach the flash device to
+ * CFE's device table.
+ *
+ * Input parameters:
+ * drv - driver descriptor
+ * probe_a - physical address of flash
+ * probe_b - size of flash (bytes)
+ * probe_ptr - unused
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void flashdrv_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr)
+{
+ flashdrv_t *softc;
+ flash_probe_t *probe;
+ char descr[80];
+
+ probe = (flash_probe_t *) probe_ptr;
+
+ /*
+ * probe_a is the flash base address
+ * probe_b is the size of the flash
+ * probe_ptr is unused.
+ */
+
+ softc = (flashdrv_t *) KMALLOC(sizeof(flashdrv_t),0);
+ if (softc) {
+ memset(softc,0,sizeof(flashdrv_t));
+
+ if (probe) {
+ /* Passed probe structure, do fancy stuff */
+ memcpy(&(softc->flashdrv_probe),probe,sizeof(flash_probe_t));
+ if (softc->flashdrv_probe.flash_prog_phys == 0) {
+ softc->flashdrv_probe.flash_prog_phys =
+ softc->flashdrv_probe.flash_phys;
+ }
+ }
+ else {
+ /* Didn't pass probe structure, do the compatible thing */
+ softc->flashdrv_probe.flash_phys = probe_a;
+ softc->flashdrv_probe.flash_prog_phys = probe_a;
+ softc->flashdrv_probe.flash_size = probe_b;
+ softc->flashdrv_probe.flash_flags = FLASH_FLG_NVRAM;
+ }
+
+ softc->flashdrv_cmdaddr = (char *) UNCADDR(softc->flashdrv_probe.flash_prog_phys);
+ softc->flashdrv_initialized = 0;
+ softc->flashdrv_ops = &FLASHOPS_DEFAULT;
+ xsprintf(descr,"%s at %08X size %uKB",drv->drv_description,
+ softc->flashdrv_probe.flash_phys,
+ softc->flashdrv_probe.flash_size/1024);
+ cfe_attach(drv,softc,NULL,descr);
+ }
+
+}
+
+
+/* *********************************************************************
+ * flashdrv_open(ctx)
+ *
+ * Called when the flash device is opened.
+ *
+ * Input parameters:
+ * ctx - device context
+ *
+ * Return value:
+ * 0 if ok else error code
+ ********************************************************************* */
+
+static int flashdrv_open(cfe_devctx_t *ctx)
+{
+ flashdrv_t *softc = ctx->dev_softc;
+
+ /*
+ * do initialization
+ */
+
+ if (!softc->flashdrv_initialized) {
+
+ /*
+ * Assume it's not an NVRAM-capable flash
+ */
+
+ softc->flashdrv_nvram_ok = FALSE;
+
+ /*
+ * Probe flash for geometry
+ */
+ flash_getinfo(softc);
+
+ /*
+ * Find the last sector if in NVRAM mode
+ */
+
+ if (softc->flashdrv_probe.flash_flags & FLASH_FLG_NVRAM) {
+ flashdrv_setup_nvram(softc);
+ }
+
+ softc->flashdrv_initialized = TRUE;
+ }
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * flashdrv_read(ctx,buffer)
+ *
+ * Read data from the flash device. The flash device is
+ * considered to be like a disk (you need to specify the offset).
+ *
+ * Input parameters:
+ * ctx - device context
+ * buffer - buffer descriptor
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+static int flashdrv_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ flashdrv_t *softc = ctx->dev_softc;
+ unsigned char *bptr;
+ unsigned char *flashbase;
+ int offset;
+ int blen;
+
+ /*
+ * For now, read the flash from K1 (always). Eventually
+ * we need to flush the cache after a write.
+ */
+
+ flashbase = (unsigned char *) UNCADDR(softc->flashdrv_probe.flash_phys);
+
+ bptr = buffer->buf_ptr;
+ blen = buffer->buf_length;
+ offset = (int) buffer->buf_offset;
+
+ if (!(softc->flashdrv_unlocked)) {
+ if ((offset + blen) > softc->flashdrv_devsize) {
+ blen = softc->flashdrv_devsize - offset;
+ }
+ }
+
+#ifdef _FLASH_BROKEN_BYTEREAD_
+ /*
+ * BCM1250 users: don't worry about this. This hack is for
+ * something else and should not be used with the BCM1250.
+ */
+ if (softc->flashdrv_probe.flash_flags & FLASH_FLG_16BIT) {
+ uint16_t *src;
+ int len = blen;
+ int idx = 0;
+ union {
+ uint16_t x;
+ char b[2];
+ } u;
+
+ src = (uint16_t *) flashbase;
+ while (len > 0) {
+ u.x = src[(idx+offset)>>1];
+ *bptr++ = u.b[(idx+offset)&1];
+ len--;
+ idx++;
+ }
+ }
+ else {
+ memcpy(bptr,flashbase + offset, blen);
+ }
+#else
+ memcpy(bptr,flashbase + offset, blen);
+#endif
+
+ buffer->buf_retlen = blen;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * flashdrv_inpstat(ctx,inpstat)
+ *
+ * Return "input status". For flash devices, we always return true.
+ *
+ * Input parameters:
+ * ctx - device context
+ * inpstat - input status structure
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+static int flashdrv_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat)
+{
+ /* flashdrv_t *softc = ctx->dev_softc; */
+
+ inpstat->inp_status = 1;
+ return 0;
+}
+
+
+/* *********************************************************************
+ * flash_writeall(softc,buffer)
+ *
+ * Write the entire flash and reboot. This is a special case
+ * used for when the flash currently being used for CFE's
+ * execution is updated. A small assembly routine is relocated
+ * to DRAM to do the update (so that the programming routine is
+ * not erased while we're running it), and then the update
+ * is done. When completed, CFE is restarted.
+ *
+ * (we could get really sleazy here and touch the routine first
+ * so it will stay in the cache, thereby eliminating the need
+ * to relocate it, but that's dangerous)
+ *
+ * Input parameters:
+ * softc - our context
+ * buffer - buffer descriptor
+ *
+ * Return value:
+ * does not return
+ ********************************************************************* */
+
+static int flash_writeall(flashdrv_t *softc,iocb_buffer_t *buffer)
+{
+ void *rptr;
+ void (*routine)(unsigned char *data,unsigned int flashbase,
+ unsigned int size,unsigned int secsize);
+
+ rptr = KMALLOC(flash_write_all_len,0);
+
+ if (!rptr) return CFE_ERR_NOMEM;
+
+ memcpy(rptr,flash_write_all_ptr,flash_write_all_len);
+
+ _cfe_flushcache(0);
+
+ routine = rptr;
+
+ (*routine)(buffer->buf_ptr,
+ softc->flashdrv_probe.flash_phys,
+ buffer->buf_length,
+ 65536);
+
+ return -1;
+}
+
+
+/* *********************************************************************
+ * flashdrv_write(ctx,buffer)
+ *
+ * Write data to the flash device. The flash device is
+ * considered to be like a disk (you need to specify the offset).
+ *
+ * Input parameters:
+ * ctx - device context
+ * buffer - buffer descriptor
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+static int flashdrv_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ flashdrv_t *softc = ctx->dev_softc;
+ unsigned char *bptr;
+ int offset;
+ int blen;
+ int res;
+
+ bptr = buffer->buf_ptr;
+ blen = buffer->buf_length;
+ offset = (int) buffer->buf_offset;
+
+ if (!(softc->flashdrv_unlocked)) {
+ if ((offset + blen) > softc->flashdrv_devsize) {
+ blen = softc->flashdrv_devsize - offset;
+ }
+ }
+
+ res = FLASHOP_WRITE_BLOCK(softc,offset,bptr,blen);
+
+ buffer->buf_retlen = res;
+
+ /* XXX flush the cache here? */
+
+ return (res == blen) ? 0 : CFE_ERR_IOERR;
+}
+
+/* *********************************************************************
+ * flashdrv_ioctl(ctx,buffer)
+ *
+ * Handle special IOCTL functions for the flash. Flash devices
+ * support NVRAM information, sector and chip erase, and a
+ * special IOCTL for updating the running copy of CFE.
+ *
+ * Input parameters:
+ * ctx - device context
+ * buffer - descriptor for IOCTL parameters
+ *
+ * Return value:
+ * 0 if ok else error
+ ********************************************************************* */
+static int flashdrv_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ flashdrv_t *softc = ctx->dev_softc;
+ nvram_info_t *info;
+ int offset;
+
+ /*
+ * If using flash to store environment, only the last sector
+ * is used for environment stuff.
+ */
+
+ switch ((int)buffer->buf_ioctlcmd) {
+ case IOCTL_NVRAM_ERASE:
+ if (softc->flashdrv_nvram_ok == FALSE) return CFE_ERR_UNSUPPORTED;
+ FLASHOP_ERASE_SECTOR(softc,softc->flashdrv_nvraminfo.nvram_offset);
+ return 0;
+
+ case IOCTL_NVRAM_GETINFO:
+ info = (nvram_info_t *) buffer->buf_ptr;
+ if (buffer->buf_length != sizeof(nvram_info_t)) return CFE_ERR_INV_PARAM;
+ if (softc->flashdrv_nvram_ok == FALSE) return CFE_ERR_UNSUPPORTED;
+ info->nvram_offset = softc->flashdrv_nvraminfo.nvram_offset;
+ info->nvram_size = softc->flashdrv_nvraminfo.nvram_size;
+ info->nvram_eraseflg = softc->flashdrv_nvraminfo.nvram_eraseflg;
+ buffer->buf_retlen = sizeof(nvram_info_t);
+ return 0;
+
+ case IOCTL_FLASH_ERASE_SECTOR:
+ offset = (int) buffer->buf_offset;
+ if (!(softc->flashdrv_unlocked)) {
+ if (offset >= softc->flashdrv_devsize) return -1;
+ }
+ FLASHOP_ERASE_SECTOR(softc,offset);
+ return 0;
+
+ case IOCTL_FLASH_ERASE_ALL:
+ offset = (int) buffer->buf_offset;
+ if (offset != 0) return -1;
+ flash_erase_all(softc);
+ return 0;
+
+ case IOCTL_FLASH_WRITE_ALL:
+ flash_writeall(softc,buffer);
+ return -1; /* should not return */
+
+ case IOCTL_FLASH_GETINFO:
+ memcpy(buffer->buf_ptr,&(softc->flashdrv_info),sizeof(flash_info_t));
+ return 0;
+
+ case IOCTL_FLASH_GETSECTORS:
+ return flash_sector_query(softc,(flash_sector_t *) buffer->buf_ptr);
+
+
+ case IOCTL_FLASH_ERASE_RANGE:
+ return flash_erase_range(softc,(flash_range_t *) buffer->buf_ptr);
+
+ case IOCTL_NVRAM_UNLOCK:
+ softc->flashdrv_unlocked = TRUE;
+ break;
+
+ default:
+ return -1;
+ }
+
+ return -1;
+}
+
+
+/* *********************************************************************
+ * flashdrv_close(ctx)
+ *
+ * Close the flash device.
+ *
+ * Input parameters:
+ * ctx - device context
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+static int flashdrv_close(cfe_devctx_t *ctx)
+{
+ /* flashdrv_t *softc = ctx->dev_softc; */
+
+ /* XXX Invalidate the cache */
+
+ return 0;
+}
+
+
diff --git a/cfe/cfe/dev/dev_ht7520.c b/cfe/cfe/dev/dev_ht7520.c
new file mode 100644
index 0000000..8e64971
--- /dev/null
+++ b/cfe/cfe/dev/dev_ht7520.c
@@ -0,0 +1,167 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * HT7520 (Golem) Bridge Support File: dev_ht7520.c
+ *
+ *********************************************************************
+ *
+ * Copyright 2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "lib_types.h"
+#include "lib_physio.h"
+
+#include "pcireg.h"
+#include "pcivar.h"
+
+extern int eoi_implemented;
+
+void ht7520apic_preset (pcitag_t tag);
+void ht7520apic_setup (pcitag_t tag);
+
+
+/* PLX HT7520 (LDT to PCI-X bridge + APIC) specific definitions */
+
+#define PCI_VENDOR_AMD 0x1022
+#define PCI_PRODUCT_PLX_HT7520 0x7450
+#define PCI_PRODUCT_PLX_HT7520_APIC 0x7451
+
+/* HT7520 specific registers */
+
+/* APIC configuration registers */
+
+#define APIC_CONTROL_REG 0x0044
+
+#define APIC_CONTROL_OSVISBAR (1 << 0)
+#define APIC_CONTROL_IOAEN (1 << 1)
+
+#define APIC_BASE_ADDR_REG 0x0048
+
+/* APIC registers in BAR0 memory space */
+
+#define HT7520_APIC_INDEX_REG 0x0000
+#define HT7520_APIC_DATA_REG 0x0010
+
+#define APIC_ID_INDEX 0x00
+#define APIC_VERSION_INDEX 0x01
+#define APIC_ARBID_INDEX 0x02
+#define APIC_RDR_BASE_INDEX 0x10
+#define APIC_RDR_LO_INDEX(n) (APIC_RDR_BASE_INDEX + 2*(n))
+#define APIC_RDR_HI_INDEX(n) (APIC_RDR_BASE_INDEX + 2*(n) + 1)
+
+#define RDR_HI_DEST_SHIFT (56-32)
+#define RDR_HI_DEST_MASK (0xff << RDR_HI_DEST_SHIFT)
+#define RDR_LO_IM (1 << 16)
+#define RDR_LO_TM (1 << 15)
+#define RDR_LO_IRR (1 << 14)
+#define RDR_LO_POL (1 << 13)
+#define RDR_LO_DS (1 << 12)
+#define RDR_LO_DM (1 << 11)
+#define RDR_LO_MT_SHIFT 8
+#define RDR_LO_MT_MASK (3 << RDR_LO_MT_SHIFT)
+#define RDR_LO_IV_SHIFT 0
+#define RDR_LO_IV_MASK (0xff << RDR_LO_IV_SHIFT)
+
+void
+ht7520apic_preset (pcitag_t tag)
+{
+ pcireg_t ctrl;
+
+ /* For some reason, BAR0 (necessary for setting the interrupt
+ mapping) is hidden by default; the following makes it
+ visible. */
+ ctrl = pci_conf_read(tag, APIC_CONTROL_REG);
+ ctrl |= APIC_CONTROL_IOAEN | APIC_CONTROL_OSVISBAR;
+ pci_conf_write(tag, APIC_CONTROL_REG, ctrl);
+ ctrl = pci_conf_read(tag, APIC_CONTROL_REG); /* push */
+}
+
+void
+ht7520apic_setup (pcitag_t tag)
+{
+ int bus, device, function;
+ pcitag_t br_tag;
+ int secondary;
+ struct pci_bus *pb;
+ unsigned offset;
+ phys_addr_t apic_addr;
+ uint32_t rdrh, rdrl;
+ int i;
+
+ /* The HT7520 splits the bridge and APIC functionality between two
+ functions. The following code depends upon a known
+ relationship between the bridge and APIC tags, with a temporary
+ fudge for the simulator. NB: We assume that the bridge
+ function has already been initialized. */
+
+ pci_break_tag(tag, &bus, &device, &function);
+
+#ifdef _FUNCSIM_
+ br_tag = pci_make_tag(bus, device-2, 0);
+#else
+ br_tag = pci_make_tag(bus, device, function-1);
+#endif
+ secondary = (pci_conf_read(br_tag, PPB_BUSINFO_REG) >> 8) & 0xff;
+ pb = &_pci_bus[secondary];
+
+ /* Set up interrupt mappings. */
+ pci_map_mem(tag, PCI_MAPREG(0), PCI_MATCH_BITS, &apic_addr);
+
+ offset = pb->inta_shift % 4;
+ for (i = 0; i < 4; i++) {
+ phys_write32(apic_addr + HT7520_APIC_INDEX_REG, APIC_RDR_HI_INDEX(i));
+ rdrh = 0x03 << RDR_HI_DEST_SHIFT; /* CPU 0 + CPU 1 */
+ phys_write32(apic_addr + HT7520_APIC_DATA_REG, rdrh);
+ rdrh = phys_read32(apic_addr + HT7520_APIC_DATA_REG); /* push */
+
+ phys_write32(apic_addr + HT7520_APIC_INDEX_REG, APIC_RDR_LO_INDEX(i));
+ if (eoi_implemented) {
+ /* Passes >=2 have working EOI. Trigger=Level */
+ rdrl = (RDR_LO_TM | /* Level */
+ RDR_LO_POL | /* Active Low */
+ RDR_LO_DM | /* Logical */
+ 0x0 << RDR_LO_MT_SHIFT | /* Fixed */
+ (56+offset) << RDR_LO_IV_SHIFT); /* Vector */
+ } else {
+ /* Pass 1 lacks working EOI. Trigger=Edge. Note that
+ LO_POL appears mis-documented for edges. */
+ rdrl = (RDR_LO_DM | /* Logical */
+ 0x0 << RDR_LO_MT_SHIFT | /* Fixed */
+ (56+offset) << RDR_LO_IV_SHIFT); /* Vector */
+ }
+ phys_write32(apic_addr + HT7520_APIC_DATA_REG, rdrl);
+ offset = (offset + 1) % 4;
+ }
+}
diff --git a/cfe/cfe/dev/dev_ide_common.c b/cfe/cfe/dev/dev_ide_common.c
new file mode 100644
index 0000000..e15ac8a
--- /dev/null
+++ b/cfe/cfe/dev/dev_ide_common.c
@@ -0,0 +1,1249 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Generic IDE disk driver File: dev_ide_common.c
+ *
+ * This is a simple driver for IDE hard disks. The mechanics
+ * of talking to the I/O ports are abstracted sufficiently to make
+ * this driver usable for various bus interfaces.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "cfe_timer.h"
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_ioctl.h"
+#include "cfe_error.h"
+
+#include "dev_ide_common.h"
+
+#include "dev_ide.h"
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#define DISK_MASTER 0
+#define DISK_SLAVE 1
+
+#define IDE_WRITEREG8(ide,reg,val) IDEDISP_WRITEREG8(ide->idecommon_dispatch,reg,val)
+#define IDE_WRITEREG16(ide,reg,val) IDEDISP_WRITEREG8(ide->idecommon_dispatch,reg,val)
+#define IDE_WRITEBUF(ide,reg,buf,len) IDEDISP_WRITEBUF(ide->idecommon_dispatch,reg,buf,len)
+#define IDE_READREG8(ide,reg) IDEDISP_READREG8(ide->idecommon_dispatch,reg)
+#define IDE_READREG16(ide,reg) IDEDISP_READREG16(ide->idecommon_dispatch,reg)
+#define IDE_READBUF(ide,reg,buf,len) IDEDISP_READBUF(ide->idecommon_dispatch,reg,buf,len)
+
+#define GETWORD_LE(buf,wordidx) (((unsigned int) (buf)[(wordidx)*2]) + \
+ (((unsigned int) (buf)[(wordidx)*2+1]) << 8))
+
+#define _IDE_DEBUG_
+
+
+static void idecommon_testdrq(idecommon_t *ide);
+
+/* *********************************************************************
+ * idecommon_sectorshift(size)
+ *
+ * Given a sector size, return log2(size). We cheat; this is
+ * only needed for 2048 and 512-byte sectors.
+ * Explicitly using shifts and masks in sector number calculations
+ * helps on 32-bit-only platforms, since we probably won't need
+ * a helper library.
+ *
+ * Input parameters:
+ * size - sector size
+ *
+ * Return value:
+ * # of bits to shift
+ ********************************************************************* */
+
+#define idecommon_sectorshift(size) (((size)==2048)?11:9)
+
+/* *********************************************************************
+ * idecommon_waitnotbusy(ide)
+ *
+ * Wait for an IDE device to report "not busy"
+ *
+ * Input parameters:
+ * ide - IDE interface
+ *
+ * Return value:
+ * 0 if ok, else -1 if timeout
+ ********************************************************************* */
+
+static int idecommon_waitnotbusy(idecommon_t *ide)
+{
+ int32_t timer;
+ uint8_t status;
+
+ TIMER_SET(timer,10*CFE_HZ);
+
+ while (!TIMER_EXPIRED(timer)) {
+ status = IDE_READREG8(ide,IDE_REG_STATUS);
+ if (!(status & IDE_STS_BSY) && (status & IDE_STS_DRQ)) {
+ idecommon_testdrq(ide);
+ continue;
+ }
+ if ((status & (IDE_STS_BSY | IDE_STS_DRQ )) == 0) return 0;
+ POLL();
+ }
+
+#ifdef _IDE_DEBUG_
+ xprintf("Device did not become unbusy\n");
+#endif
+ return -1;
+}
+
+#if 0
+/* *********************************************************************
+ * idecommon_waitready(ide)
+ *
+ * Wait for the specified device to become ready.
+ *
+ * Input parameters:
+ * ide - IDE interface
+ *
+ * Return value:
+ * 0 if device became ready
+ * -1 if device did not become ready
+ ********************************************************************* */
+
+static int idecommon_waitready(idecommon_t *ide)
+{
+ int32_t timer;
+ uint8_t status;
+
+ TIMER_SET(timer,10*CFE_HZ);
+
+ while (!TIMER_EXPIRED(timer)) {
+ status = IDE_READREG8(ide,IDE_REG_STATUS);
+ if (status & IDE_STS_RDY) return 0;
+ POLL();
+ }
+
+#ifdef _IDE_DEBUG_
+ xprintf("Disk did not become ready\n");
+#endif
+
+ return -1;
+}
+#endif
+
+/* *********************************************************************
+ * idecommon_waitbusy(idx)
+ *
+ * Wait for an IDE disk to start processing a command, or at
+ * least long enough to indicate that it is doing so.
+ * The code below looks suspiciously like a timing loop.
+ * unfortunately, that's what it is, determined empirically
+ * for certain ATA flash cards. Without this many reads to the
+ * ALTSTAT register, the PCMCIA controller deasserts the
+ * card detect pins briefly. Anyone have any clues?
+ *
+ * Input parameters:
+ * ide - IDE interface
+ *
+ * Return value:
+ * void
+ ********************************************************************* */
+
+static void idecommon_waitbusy(idecommon_t *ide)
+{
+ int idx;
+
+ for (idx = 0; idx < 10; idx++) {
+ IDE_READREG8(ide,IDE_REG_ALTSTAT);
+ IDE_READREG8(ide,IDE_REG_ALTSTAT);
+ IDE_READREG8(ide,IDE_REG_ALTSTAT);
+ IDE_READREG8(ide,IDE_REG_ALTSTAT);
+ }
+}
+
+
+/* *********************************************************************
+ * idecommon_wait_drq(ide)
+ *
+ * Wait for the BUSY bit to be clear and the DRQ bit to be set.
+ * This is usually the indication that it's time to transfer data.
+ *
+ * Input parameters:
+ * ide - IDE interface
+ * 0 if DRQ is set
+ * -1 if timeout occured
+ ********************************************************************* */
+
+static int idecommon_wait_drq(idecommon_t *ide)
+{
+ int32_t timer;
+ uint8_t status;
+
+ TIMER_SET(timer,10*CFE_HZ);
+
+ while (!TIMER_EXPIRED(timer)) {
+ POLL();
+ status = IDE_READREG8(ide,IDE_REG_STATUS);
+ if (!(status & IDE_STS_BSY) && (status & IDE_STS_ERR)) {
+ xprintf("Drive status: %02X error %02X\n",status,
+ IDE_READREG8(ide,IDE_REG_ERROR));
+ return -1;
+ }
+ if (!(status & IDE_STS_BSY) && (status & IDE_STS_DRQ)) return 0;
+ }
+
+#ifdef _IDE_DEBUG_
+ xprintf("Timeout waiting for disk\n");
+#endif
+
+ return -1;
+}
+
+/* *********************************************************************
+ * idecommon_testdrq(ide)
+ *
+ * Debug routine. Check the DRQ bit. If it's set, it is not
+ * supposed to be, so transfer data until it clears and report
+ * how much we had to transfer.
+ *
+ * Input parameters:
+ * ide - IDE interface
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+#ifdef _IDE_DEBUG_
+static void idecommon_testdrq(idecommon_t *ide)
+{
+ uint8_t status;
+ uint16_t data;
+ int idx;
+
+ status = IDE_READREG8(ide,IDE_REG_STATUS);
+ if (status & IDE_STS_DRQ) {
+ xprintf("Error: DRQ should be zero\n");
+ idx = 0;
+ while (status & IDE_STS_DRQ) {
+ data = IDE_READREG16(ide,IDE_REG_DATA);
+ idx++;
+ status = IDE_READREG8(ide,IDE_REG_STATUS);
+ }
+ xprintf("Had to read data %d times to clear DRQ\n",idx);
+ }
+}
+#else
+#define idecommon_testdrq(ide)
+#endif
+
+
+/* *********************************************************************
+ * idecommon_dumpregs(ide)
+ *
+ * Dump out the IDE registers. (debug routine)
+ *
+ * Input parameters:
+ * ide - ide disk
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void idecommon_dumpregs(idecommon_t *ide)
+{
+#if 0
+ uint8_t reg = 0;
+
+ reg = IDE_READREG8(ide,IDE_REG_STATUS);
+ xprintf("Status:%02X ",reg);
+
+ reg = IDE_READREG8(ide,IDE_REG_DRVHD);
+ xprintf("DrvHd:%02X ",reg);
+
+ reg = IDE_READREG8(ide,IDE_REG_CYLLSB);
+ xprintf("CylLSB:%02X ",reg);
+
+ reg = IDE_READREG8(ide,IDE_REG_CYLMSB);
+ xprintf("CylMSB:%02X ",reg);
+
+ reg = IDE_READREG8(ide,IDE_REG_SECNUM);
+ xprintf("SecNum:%02X ",reg);
+
+ reg = IDE_READREG8(ide,IDE_REG_SECCNT);
+ xprintf("SecCnt:%02X ",reg);
+
+ xprintf("\n");
+#endif
+}
+
+
+/* *********************************************************************
+ * idecommon_reset(ide)
+ *
+ * Reset the IDE interface.
+ *
+ * Input parameters:
+ * ide - IDE interface
+ *
+ * Return value:
+ * 0 if ok, else -1 if a timeout occured
+ ********************************************************************* */
+
+static int idecommon_reset(idecommon_t *ide)
+{
+ return 0;
+}
+
+/* *********************************************************************
+ * idecommon_identify(ide,buffer)
+ *
+ * Execute an IDENTIFY command to get information about the disk.
+ *
+ * Input parameters:
+ * ide - IDE interface
+ * buffer - pointer to 512 byte buffer
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int idecommon_identify(idecommon_t *ide,unsigned char *buffer)
+{
+
+ /* Device Select Protocol; see ATAPI-4 sect 9.6 */
+
+ if (idecommon_waitnotbusy(ide) < 0) return -1;
+ IDE_WRITEREG8(ide,IDE_REG_DRVHD,(ide->idecommon_unit<<4)|0);
+ if (idecommon_waitnotbusy(ide) < 0) return -1;
+
+ /* Set device registers */
+
+ IDE_WRITEREG8(ide,IDE_REG_CYLLSB,0);
+ IDE_WRITEREG8(ide,IDE_REG_CYLMSB,0);
+ IDE_WRITEREG8(ide,IDE_REG_SECNUM,1);
+ IDE_WRITEREG8(ide,IDE_REG_SECCNT,1);
+
+ idecommon_testdrq(ide);
+
+ /* Issue command, then read ALT STATUS (9.7) */
+
+ if (ide->idecommon_atapi) {
+ IDE_WRITEREG8(ide,IDE_REG_COMMAND,IDE_CMD_ATAPI_IDENTIFY);
+ }
+ else {
+ IDE_WRITEREG8(ide,IDE_REG_COMMAND,IDE_CMD_DRIVE_INFO);
+ }
+
+ IDE_READREG8(ide,IDE_REG_ALTSTAT);
+ idecommon_waitbusy(ide); /* should not be necessary */
+
+ /* Wait BSY=0 && DRQ=1, then read buffer, see sect 9.7 */
+
+ if (idecommon_wait_drq(ide) < 0) return -1;
+ IDE_READBUF(ide,IDE_REG_DATA,buffer,DISK_SECTORSIZE);
+
+ idecommon_testdrq(ide);
+
+ return 0;
+}
+
+/* *********************************************************************
+ * idecommon_packet(ide,packet,pktlen,databuf,datalen)
+ *
+ * Process an IDE "packet" command, for ATAPI devices
+ *
+ * Input parameters:
+ * ide - IDE interface
+ * packet,pktlen - command packet
+ * databuf,datalen - data buffer
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int idecommon_packet(idecommon_t *ide,
+ uint8_t *packet,int pktlen,
+ uint8_t *databuf,int datalen)
+{
+ uint8_t status;
+
+ /*
+ * Not valid on non-ATAPI disks
+ */
+
+ if (!ide->idecommon_atapi) return -1;
+
+ /*
+ * Set up the standard IDE registers for an ATAPI PACKET command
+ */
+
+ /* Device Select Protocol */
+ if (idecommon_waitnotbusy(ide) < 0) return -1;
+ IDE_WRITEREG8(ide,IDE_REG_DRVHD,(ide->idecommon_unit<<4));
+ if (idecommon_waitnotbusy(ide) < 0) return -1;
+
+ /* Device Registers */
+ IDE_WRITEREG8(ide,IDE_REG_BCLSB,(datalen & 0xFF));
+ IDE_WRITEREG8(ide,IDE_REG_BCMSB,((datalen >> 8) & 0xFF));
+ IDE_WRITEREG8(ide,IDE_REG_SECNUM,0);
+ IDE_WRITEREG8(ide,IDE_REG_SECCNT,0);
+ IDE_WRITEREG8(ide,IDE_REG_COMMAND,IDE_CMD_ATAPI_PACKET);
+
+ /*
+ * Wait for the DRQ bit to indicate that we should send
+ * the packet.
+ */
+
+ if (idecommon_wait_drq(ide) < 0) return -1;
+
+ status = IDE_READREG8(ide,IDE_REG_IR);
+
+ /*
+ * Send the packet to the device
+ */
+
+ IDE_WRITEBUF(ide,IDE_REG_DATA,packet,pktlen);
+
+ /*
+ * Wait for BSY to be cleared and DRQ to be set.
+ */
+
+ if (idecommon_wait_drq(ide) < 0) return -1;
+ status = IDE_READREG8(ide,IDE_REG_ALTSTAT);
+ if (idecommon_wait_drq(ide) < 0) return -1;
+ status = IDE_READREG8(ide,IDE_REG_IR);
+
+
+ /*
+ * Transfer data, if necessary. The direction will depend
+ * on what the drive says. If this is a non-data command,
+ * passing databuf == NULL can avoid all this.
+ */
+
+ if (databuf) {
+ status = IDE_READREG8(ide,IDE_REG_IR);
+ if (status & IDE_IR_CD) {
+ xprintf("Error: Command/data should be zero\n");
+ }
+
+ if (status & IDE_IR_IO) { /* from device (READ) */
+ IDE_READBUF(ide,IDE_REG_DATA,databuf,datalen);
+ }
+ else { /* to device (WRITE) */
+ IDE_WRITEBUF(ide,IDE_REG_DATA,databuf,datalen);
+ }
+
+ }
+
+
+ idecommon_testdrq(ide);
+
+ return 0;
+
+}
+
+
+/* *********************************************************************
+ * idecommon_request_sense(ide)
+ *
+ * Request sense data. This also clears a UNIT_ATTENTION condition
+ *
+ * Input parameters:
+ * ide - IDE interface
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+static int idecommon_request_sense(idecommon_t *ide)
+{
+ uint8_t cdb[12];
+ uint8_t sensedata[32];
+ int res;
+ int numbytes;
+
+ numbytes = sizeof(sensedata);
+
+ cdb[0] = CDB_CMD_REQSENSE;
+ cdb[1] = 0;
+ cdb[2] = 0;
+ cdb[3] = 0;
+ cdb[4] = sizeof(sensedata);
+ cdb[5] = 0;
+ cdb[6] = 0;
+ cdb[7] = 0;
+ cdb[8] = 0;
+ cdb[9] = 0;
+ cdb[10] = 0;
+ cdb[11] = 0;
+
+ memset(sensedata,0,sizeof(sensedata));
+
+ res = idecommon_packet(ide,cdb,sizeof(cdb),sensedata,numbytes);
+
+#if 0
+ xprintf("Sense data: ");
+ xprintf("Err:%02X ",sensedata[0]);
+ xprintf("Key:%02X ",sensedata[1]);
+ xprintf("Information:%02X%02X ",sensedata[2],sensedata[3]);
+ xprintf("ASC:%02X ASCQ:%02X ",sensedata[12],sensedata[13]);
+ xprintf("\n");
+#endif
+
+ idecommon_testdrq(ide);
+
+ return res;
+}
+
+
+/* *********************************************************************
+ * idecommon_read_atapi(ide,lba,numsec,buffer)
+ *
+ * Read sector(s) from the device. This version is for ATAPI devs.
+ *
+ * Input parameters:
+ * ide - IDE interface
+ * lba - logical block address
+ * numsec - number of sectors
+ * buffer - buffer address
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int idecommon_read_atapi(idecommon_t *ide,uint64_t lba,
+ int numsec,unsigned char *buffer)
+{
+ uint8_t cdb[12];
+ int res = 0;
+ int numbytes;
+ int idx;
+
+ numbytes = numsec << idecommon_sectorshift(ide->idecommon_sectorsize);
+
+ cdb[0] = CDB_CMD_READ;
+ cdb[1] = 0;
+ cdb[2] = ((lba >> 24) & 0xFF);
+ cdb[3] = ((lba >> 16) & 0xFF);
+ cdb[4] = ((lba >> 8) & 0xFF);
+ cdb[5] = ((lba >> 0) & 0xFF);
+ cdb[6] = 0;
+ cdb[7] = ((numsec >> 8) & 0xFF);
+ cdb[8] = ((numsec >> 0) & 0xFF);
+ cdb[9] = 0;
+ cdb[10] = 0;
+ cdb[11] = 0;
+
+ for (idx = 0; idx < 4; idx++) {
+ res = idecommon_packet(ide,cdb,sizeof(cdb),buffer,numbytes);
+ if (res < 0) {
+ idecommon_request_sense(ide);
+ continue;
+ }
+ break;
+ }
+
+ return res;
+}
+
+
+/* *********************************************************************
+ * idecommon_write_atapi(ide,lba,numsec,buffer)
+ *
+ * Write sector(s) to the device. This version is for ATAPI disks
+ *
+ * Input parameters:
+ * ide - IDE interface
+ * lba - logical block address
+ * numsec - number of sectors
+ * buffer - buffer address
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int idecommon_write_atapi(idecommon_t *ide,uint64_t lba,
+ int numsec,unsigned char *buffer)
+{
+ uint8_t cdb[12];
+ int res;
+ int numbytes;
+
+ numbytes = numsec << idecommon_sectorshift(ide->idecommon_sectorsize);
+
+ cdb[0] = CDB_CMD_WRITE;
+ cdb[1] = 0;
+ cdb[2] = ((lba >> 24) & 0xFF);
+ cdb[3] = ((lba >> 16) & 0xFF);
+ cdb[4] = ((lba >> 8) & 0xFF);
+ cdb[5] = ((lba >> 0) & 0xFF);
+ cdb[6] = 0;
+ cdb[7] = ((numsec >> 8) & 0xFF);
+ cdb[8] = ((numsec >> 0) & 0xFF);
+ cdb[9] = 0;
+ cdb[10] = 0;
+ cdb[11] = 0;
+
+ res = idecommon_packet(ide,cdb,sizeof(cdb),buffer,numbytes);
+
+ return res;
+}
+
+
+/* *********************************************************************
+ * idecommon_read_lba(ide,lba,numsec,buffer)
+ *
+ * Read sector(s) from the device.
+ *
+ * Input parameters:
+ * ide - IDE interface
+ * lba - logical block address
+ * numsec - number of sectors
+ * buffer - buffer address
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int idecommon_read_lba(idecommon_t *ide,uint64_t lba,int numsec,unsigned char *buffer)
+{
+ int secidx;
+ unsigned char *ptr;
+
+ if (idecommon_waitnotbusy(ide) < 0) return -1;
+ IDE_WRITEREG8(ide,IDE_REG_DRVHD,(ide->idecommon_unit<<4) | ((lba >> 24) & 0x0F) | 0x40);
+ if (idecommon_waitnotbusy(ide) < 0) return -1;
+
+ IDE_WRITEREG8(ide,IDE_REG_CYLMSB,((lba >> 16) & 0xFF));
+ IDE_WRITEREG8(ide,IDE_REG_CYLLSB,((lba >> 8) & 0xFF));
+ IDE_WRITEREG8(ide,IDE_REG_SECNUM,(lba & 0xFF));
+ IDE_WRITEREG8(ide,IDE_REG_SECCNT,numsec);
+
+ idecommon_testdrq(ide);
+
+ IDE_WRITEREG8(ide,IDE_REG_COMMAND,IDE_CMD_READ);
+
+ idecommon_waitbusy(ide);
+ if (idecommon_wait_drq(ide) < 0) return -1;
+
+ ptr = buffer;
+
+ for (secidx = 0; secidx < numsec; secidx++) {
+ IDE_READBUF(ide,IDE_REG_DATA,ptr,ide->idecommon_sectorsize);
+ ptr += ide->idecommon_sectorsize;
+ }
+
+ idecommon_testdrq(ide);
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * idecommon_write_lba(ide,lba,numsec,buffer)
+ *
+ * Write sector(s) from the device.
+ *
+ * Input parameters:
+ * ide - IDE interface
+ * lba - logical block address
+ * numsec - number of sectors
+ * buffer - buffer address
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int idecommon_write_lba(idecommon_t *ide,uint64_t lba,int numsec,unsigned char *buffer)
+{
+ int secidx;
+ uint8_t *ptr;
+
+ if (idecommon_waitnotbusy(ide) < 0) return -1;
+ IDE_WRITEREG8(ide,IDE_REG_DRVHD,(ide->idecommon_unit<<4) | ((lba >> 24) & 0x0F) | 0x40);
+ if (idecommon_waitnotbusy(ide) < 0) return -1;
+
+ IDE_WRITEREG8(ide,IDE_REG_CYLMSB,((lba >> 16) & 0xFF));
+ IDE_WRITEREG8(ide,IDE_REG_CYLLSB,((lba >> 8) & 0xFF));
+ IDE_WRITEREG8(ide,IDE_REG_SECNUM,(lba & 0xFF));
+ IDE_WRITEREG8(ide,IDE_REG_SECCNT,numsec);
+
+ IDE_WRITEREG8(ide,IDE_REG_COMMAND,IDE_CMD_WRITE);
+
+ if (idecommon_wait_drq(ide) < 0) return -1;
+
+ ptr = buffer;
+
+ for (secidx = 0; secidx < numsec; secidx++) {
+ IDE_WRITEBUF(ide,IDE_REG_DATA,ptr,ide->idecommon_sectorsize);
+ ptr += ide->idecommon_sectorsize;
+ }
+
+ idecommon_testdrq(ide);
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * idecommon_diagnostic(ide)
+ *
+ * run the device diagnostics on the IDE device. This also
+ * helps us determine if it's an IDE or ATAPI disk, since the
+ * diagnostic will leave a signature in the registers.
+ *
+ * Input parameters:
+ * softc - IDE interface
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int idecommon_diagnostic(idecommon_t *softc)
+{
+ if (idecommon_waitnotbusy(softc) < 0) return -1;
+ IDE_WRITEREG8(softc,IDE_REG_DRVHD,(softc->idecommon_unit<<4));
+ if (idecommon_waitnotbusy(softc) < 0) return -1;
+
+ IDE_WRITEREG8(softc,IDE_REG_COMMAND,IDE_CMD_DIAGNOSTIC);
+ if (idecommon_waitnotbusy(softc) < 0) return -1;
+
+ cfe_sleep(CFE_HZ/2);
+ idecommon_dumpregs(softc);
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * idecommon_getmodel(buffer,model)
+ *
+ * Get the ASCII model name out of an IDE identify buffer. some
+ * byte swapping is involved here. The trailing blanks are trimmed.
+ *
+ * Input parameters:
+ * buffer - 512-byte buffer from IDENTIFY command
+ * model - 41-byte string (max) for model name
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void idecommon_getmodel(uint8_t *buffer,char *model)
+{
+ uint16_t w;
+ int idx;
+
+ for (idx = 0; idx < 20; idx++) {
+ w = GETWORD_LE(buffer,27+idx);
+ model[idx*2] = w >> 8;
+ model[idx*2+1] = w & 0xFF;
+ }
+ for (idx = 39; idx > 0; idx--) {
+ if (model[idx] != ' ') {
+ model[idx+1] = '\0';
+ break;
+ }
+ }
+
+}
+
+/* *********************************************************************
+ * idecommon_devprobe(softc)
+ *
+ * Probe the IDE device, to determine if it's actually present
+ * or not. If present, determine if it's IDE or ATAPI and
+ * get the device size. Init our internal structures so we know
+ * how to talk to the device.
+ *
+ * Input parameters:
+ * softc - IDE structure
+ * noisy - display stuff as we probe
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+int idecommon_devprobe(idecommon_t *softc,int noisy)
+{
+ int res;
+ int atapi;
+ unsigned char buffer[DISK_SECTORSIZE];
+ unsigned char model[41];
+ uint64_t ttlsect;
+ int devtype;
+ uint16_t w;
+ char *typename;
+
+ /*
+ * Reset the drive
+ */
+
+ res = idecommon_reset(softc);
+ if (res < 0) return -1;
+
+ /*
+ * Run diagnostic to get the signature.
+ */
+
+ res = idecommon_diagnostic(softc);
+ if (res < 0) return res;
+
+ /*
+ * Test signature
+ */
+
+ atapi = 0;
+ if ((IDE_READREG8(softc,IDE_REG_CYLLSB) == ATAPI_SIG_LSB) &&
+ (IDE_READREG8(softc,IDE_REG_CYLMSB) == ATAPI_SIG_MSB)) {
+ atapi = 1;
+ }
+
+ if (noisy) {
+ if (atapi) xprintf("ATAPI: ");
+ else xprintf("IDE: ");
+ }
+
+ /*
+ * Do tha appropriate IDENTIFY command to get device information
+ */
+
+ softc->idecommon_atapi = atapi;
+ res = idecommon_identify(softc,buffer);
+ if (res < 0) return -1;
+
+ /*
+ * Using that information, determine our device type
+ */
+
+ if (!atapi) {
+ devtype = IDE_DEVTYPE_DISK;
+ typename = "Disk";
+ }
+ else {
+ w = GETWORD_LE(buffer,0);
+ switch ((w >> 8) & 31) {
+ case 5: /* CD-ROM */
+ devtype = IDE_DEVTYPE_CDROM;
+ typename = "CD-ROM";
+ break;
+ default:
+ devtype = IDE_DEVTYPE_ATAPIDISK;
+ typename = "Disk";
+ break;
+ }
+ }
+
+ /*
+ * Say nice things about the device.
+ */
+
+ idecommon_getmodel(buffer,model);
+ if (noisy) xprintf("%s, \"%s\"",typename,model);
+
+
+#ifdef _IDE_DEBUG_
+ if (!softc->idecommon_atapi) {
+ ttlsect = (GETWORD_LE(buffer,57) + (GETWORD_LE(buffer,58) << 16));
+ if (noisy) xprintf(", Sectors: %llu (%lld MB)",ttlsect,
+ (uint64_t) (ttlsect/2048));
+ }
+ else {
+ ttlsect = 0;
+ }
+#endif
+ if (noisy) xprintf("\n");
+
+ /*
+ * Initialize internal structure info, especially pointers to the
+ * read/write routines and the sector size.
+ */
+
+ softc->idecommon_ttlsect = ttlsect;
+ idecommon_init(softc,devtype);
+
+ return res;
+}
+
+/* *********************************************************************
+ * idecommon_open(ctx)
+ *
+ * Process the CFE OPEN call for this device. For IDE disks,
+ * the device is reset and identified, and the geometry is
+ * determined.
+ *
+ * Input parameters:
+ * ctx - device context
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+
+int idecommon_open(cfe_devctx_t *ctx)
+{
+ idecommon_t *softc = ctx->dev_softc;
+ int res;
+
+ if (softc->idecommon_deferprobe) {
+ res = idecommon_devprobe(softc,0);
+ if (res < 0) return res;
+ }
+
+ return 0;
+}
+
+/* *********************************************************************
+ * idecommon_read(ctx,buffer)
+ *
+ * Process a CFE READ command for the IDE device. This is
+ * more complex than it looks, since CFE offsets are byte offsets
+ * and we may need to read partial sectors.
+ *
+ * Input parameters:
+ * ctx - device context
+ * buffer - buffer descriptor
+ *
+ * Return value:
+ * number of bytes read, or <0 if an error occured
+ ********************************************************************* */
+
+int idecommon_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ idecommon_t *softc = ctx->dev_softc;
+ unsigned char *bptr;
+ int blen;
+ int numsec;
+ int res = 0;
+ int amtcopy;
+ uint64_t lba;
+ uint64_t offset;
+ unsigned char sector[MAX_SECTORSIZE];
+ int sectorshift;
+
+ sectorshift = idecommon_sectorshift(softc->idecommon_sectorsize);
+
+ bptr = buffer->buf_ptr;
+ blen = buffer->buf_length;
+ offset = buffer->buf_offset;
+ numsec = (blen + softc->idecommon_sectorsize - 1) >> sectorshift;
+
+ if (offset & (softc->idecommon_sectorsize-1)) {
+ lba = (offset >> sectorshift);
+ res = (*softc->idecommon_readfunc)(softc,lba,1,sector);
+ if (res < 0) goto out;
+ amtcopy = softc->idecommon_sectorsize - (offset & (softc->idecommon_sectorsize-1));
+ if (amtcopy > blen) amtcopy = blen;
+ memcpy(bptr,&sector[offset & (softc->idecommon_sectorsize-1)],amtcopy);
+ bptr += amtcopy;
+ offset += amtcopy;
+ blen -= amtcopy;
+ }
+
+ while (blen >= softc->idecommon_sectorsize) {
+ lba = (offset >> sectorshift);
+ amtcopy = softc->idecommon_sectorsize;
+ res = (*softc->idecommon_readfunc)(softc,lba,1,bptr);
+ if (res < 0) goto out;
+ bptr += amtcopy;
+ offset += amtcopy;
+ blen -= amtcopy;
+ }
+
+ if (blen) {
+ lba = (offset >> sectorshift);
+ res = (*softc->idecommon_readfunc)(softc,lba,1,sector);
+ if (res < 0) goto out;
+ amtcopy = blen;
+ memcpy(bptr,sector,amtcopy);
+ bptr += amtcopy;
+ offset += amtcopy;
+ blen -= amtcopy;
+ }
+
+out:
+ buffer->buf_retlen = bptr - buffer->buf_ptr;
+
+ return res;
+}
+
+/* *********************************************************************
+ * idecommon_inpstat(ctx,inpstat)
+ *
+ * Test input status for the IDE disk. Disks are always ready
+ * to read.
+ *
+ * Input parameters:
+ * ctx - device context
+ * inpstat - input status structure
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+int idecommon_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat)
+{
+ /* idecommon_t *softc = ctx->dev_softc; */
+
+ inpstat->inp_status = 1;
+ return 0;
+}
+
+/* *********************************************************************
+ * idecommon_write(ctx,buffer)
+ *
+ * Process a CFE WRITE command for the IDE device. If the write
+ * involves partial sectors, the affected sectors are read first
+ * and the changes are merged in.
+ *
+ * Input parameters:
+ * ctx - device context
+ * buffer - buffer descriptor
+ *
+ * Return value:
+ * number of bytes write, or <0 if an error occured
+ ********************************************************************* */
+
+int idecommon_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ idecommon_t *softc = ctx->dev_softc;
+ unsigned char *bptr;
+ int blen;
+ int numsec;
+ int res = 0;
+ int amtcopy;
+ uint64_t offset;
+ uint64_t lba;
+ unsigned char sector[MAX_SECTORSIZE];
+ int sectorshift;
+
+ sectorshift = (softc->idecommon_sectorsize == 2048) ? 11 : 9;
+
+ bptr = buffer->buf_ptr;
+ blen = buffer->buf_length;
+ offset = buffer->buf_offset;
+ numsec = (blen + softc->idecommon_sectorsize - 1) >> sectorshift;
+
+ if (offset & (softc->idecommon_sectorsize-1)) {
+ lba = (offset >> sectorshift);
+ res = (*softc->idecommon_readfunc)(softc,lba,1,sector);
+ if (res < 0) goto out;
+ amtcopy = softc->idecommon_sectorsize - (offset & (softc->idecommon_sectorsize-1));
+ if (amtcopy > blen) amtcopy = blen;
+ memcpy(&sector[offset & (softc->idecommon_sectorsize-1)],bptr,amtcopy);
+ res = (*softc->idecommon_writefunc)(softc,lba,1,sector);
+ if (res < 0) goto out;
+ bptr += amtcopy;
+ offset += amtcopy;
+ blen -= amtcopy;
+ }
+
+ while (blen >= softc->idecommon_sectorsize) {
+ amtcopy = softc->idecommon_sectorsize;
+ lba = (offset >> sectorshift);
+ res = (*softc->idecommon_writefunc)(softc,lba,1,bptr);
+ if (res < 0) goto out;
+ bptr += amtcopy;
+ offset += amtcopy;
+ blen -= amtcopy;
+ }
+
+ if (blen) {
+ lba = (offset >> sectorshift);
+ res = (*softc->idecommon_readfunc)(softc,lba,1,sector);
+ if (res < 0) goto out;
+ amtcopy = blen;
+ memcpy(sector,bptr,amtcopy);
+ res = (*softc->idecommon_writefunc)(softc,lba,1,sector);
+ if (res < 0) goto out;
+ bptr += amtcopy;
+ offset += amtcopy;
+ blen -= amtcopy;
+ }
+
+out:
+ buffer->buf_retlen = bptr - buffer->buf_ptr;
+
+ return res;
+}
+
+
+/* *********************************************************************
+ * idecommon_ioctl(ctx,buffer)
+ *
+ * Process device I/O control requests for the IDE device.
+ *
+ * Input parameters:
+ * ctx - device context
+ * buffer - buffer descriptor
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int idecommon_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ idecommon_t *softc = ctx->dev_softc;
+ unsigned int *info = (unsigned int *) buffer->buf_ptr;
+ unsigned long long *linfo = (unsigned long long *) buffer->buf_ptr;
+ blockdev_info_t *devinfo;
+
+ switch ((int)buffer->buf_ioctlcmd) {
+ case IOCTL_BLOCK_GETBLOCKSIZE:
+ *info = softc->idecommon_sectorsize;
+ break;
+ case IOCTL_BLOCK_GETTOTALBLOCKS:
+ *linfo = softc->idecommon_ttlsect;
+ break;
+ case IOCTL_BLOCK_GETDEVTYPE:
+ devinfo = (blockdev_info_t *) buffer->buf_ptr;
+ devinfo->blkdev_totalblocks = softc->idecommon_ttlsect;
+ devinfo->blkdev_blocksize = softc->idecommon_sectorsize;
+ devinfo->blkdev_devtype = (softc->idecommon_devtype == IDE_DEVTYPE_CDROM) ?
+ BLOCK_DEVTYPE_CDROM : BLOCK_DEVTYPE_DISK;
+ break;
+ default:
+ return -1;
+ }
+
+ return 0;
+}
+
+/* *********************************************************************
+ * idecommon_close(ctx)
+ *
+ * Close the I/O device.
+ *
+ * Input parameters:
+ * ctx - device context
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+int idecommon_close(cfe_devctx_t *ctx)
+{
+ /* idecommon_t *softc = ctx->dev_softc; */
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * idecommon_init(ide,devtype)
+ *
+ * Set up internal values based on the device type
+ *
+ * Input parameters:
+ * ide - IDE interface
+ * devtype - device type
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void idecommon_init(idecommon_t *ide,int devtype)
+{
+
+ ide->idecommon_devtype = devtype;
+
+ switch (ide->idecommon_devtype) {
+ case IDE_DEVTYPE_DISK:
+ ide->idecommon_atapi = FALSE;
+ ide->idecommon_sectorsize = DISK_SECTORSIZE;
+ break;
+ case IDE_DEVTYPE_CDROM:
+ ide->idecommon_atapi = TRUE;
+ ide->idecommon_sectorsize = CDROM_SECTORSIZE;
+ break;
+ case IDE_DEVTYPE_ATAPIDISK:
+ ide->idecommon_atapi = TRUE;
+ ide->idecommon_sectorsize = DISK_SECTORSIZE;
+ break;
+ default:
+ ide->idecommon_atapi = FALSE;
+ ide->idecommon_sectorsize = DISK_SECTORSIZE;
+ break;
+ }
+
+ if (ide->idecommon_atapi) {
+ ide->idecommon_readfunc = idecommon_read_atapi;
+ ide->idecommon_writefunc = idecommon_write_atapi;
+ }
+ else {
+ ide->idecommon_readfunc = idecommon_read_lba;
+ ide->idecommon_writefunc = idecommon_write_lba;
+ }
+}
+
+/* *********************************************************************
+ * idecommon_attach(devdisp)
+ *
+ * Set up a cfe_devdisp structure that points at the idecommon
+ * structures.
+ *
+ * Input parameters:
+ * devdisp - cfe_devdisp_t structure
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+void idecommon_attach(cfe_devdisp_t *disp)
+{
+ disp->dev_open = idecommon_open;
+ disp->dev_read = idecommon_read;
+ disp->dev_inpstat = idecommon_inpstat;
+ disp->dev_write = idecommon_write;
+ disp->dev_ioctl = idecommon_ioctl;
+ disp->dev_close = idecommon_close;
+ disp->dev_poll = NULL;
+ disp->dev_reset = NULL;
+}
diff --git a/cfe/cfe/dev/dev_ide_pci.c b/cfe/cfe/dev/dev_ide_pci.c
new file mode 100644
index 0000000..ecf4c2a
--- /dev/null
+++ b/cfe/cfe/dev/dev_ide_pci.c
@@ -0,0 +1,358 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * PCI IDE disk driver File: dev_ide_pci.c
+ *
+ * This is a simple driver for IDE hard disks that are connected
+ * to PCI IDE controllers, such as a Promise UltraXX.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "cfe_timer.h"
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_ioctl.h"
+
+#include "dev_ide_common.h"
+
+#include "dev_ide.h"
+
+#include "pcivar.h"
+#include "pcireg.h"
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#define _BYTESWAP_ /* don't byteswap these disks */
+
+#define OUTB(x,y) outb(x,y)
+#define OUTW(x,y) outw(x,y)
+#define INB(x) inb(x)
+#define INW(x) inw(x)
+
+/* *********************************************************************
+ * Forward declarations
+ ********************************************************************* */
+
+extern void _wbflush(void);
+
+static void idedrv_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+/* *********************************************************************
+ * Device Dispatch
+ ********************************************************************* */
+
+static cfe_devdisp_t idedrv_dispatch = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+const cfe_driver_t pciidedrv = {
+ "PCI IDE disk",
+ "ide",
+ CFE_DEV_DISK,
+ &idedrv_dispatch,
+ idedrv_probe
+};
+
+const cfe_driver_t pciatapidrv = {
+ "PCI ATAPI device",
+ "atapi",
+ CFE_DEV_DISK,
+ &idedrv_dispatch,
+ idedrv_probe
+};
+
+/* *********************************************************************
+ * Supported PCI devices
+ ********************************************************************* */
+
+#define DEVID(vid,pid) (((pid)<<16)|(vid))
+
+static uint32_t pciidedrv_devlist[] = {
+ DEVID(0x105a,0x4d33), /* Promise Ultra33 */
+ DEVID(0x1095,0x0649), /* CMD PCI0649 */
+ DEVID(0x1095,0x0648), /* CMD PCI0648 */
+ 0xFFFFFFFF
+};
+
+
+/* *********************************************************************
+ * Port I/O routines
+ *
+ * These routines are called back from the common code to do
+ * I/O cycles to the IDE disk. We provide routines for
+ * reading and writing bytes, words, and strings of words.
+ ********************************************************************* */
+
+static uint8_t idedrv_inb(idecommon_dispatch_t *disp,uint32_t reg)
+{
+ return INB(reg+disp->baseaddr);
+}
+
+static uint16_t idedrv_inw(idecommon_dispatch_t *disp,uint32_t reg)
+{
+ return INW(reg+disp->baseaddr);
+}
+
+static void idedrv_ins(idecommon_dispatch_t *disp,uint32_t reg,uint8_t *buf,int len)
+{
+ uint16_t data;
+
+ while (len > 0) {
+ data = INW(reg+disp->baseaddr);
+
+#ifdef _BYTESWAP_
+ *buf++ = (data >> 8) & 0xFF;
+ *buf++ = (data & 0xFF);
+#else
+ *buf++ = (data & 0xFF);
+ *buf++ = (data >> 8) & 0xFF;
+#endif
+ len--;
+ len--;
+ }
+
+}
+
+static void idedrv_outb(idecommon_dispatch_t *disp,uint32_t reg,uint8_t val)
+{
+ OUTB(reg+disp->baseaddr,val);
+}
+
+static void idedrv_outw(idecommon_dispatch_t *disp,uint32_t reg,uint16_t val)
+{
+ OUTW(reg+disp->baseaddr,val);
+}
+
+static void idedrv_outs(idecommon_dispatch_t *disp,uint32_t reg,uint8_t *buf,int len)
+{
+ uint16_t data;
+
+ while (len > 0) {
+#ifdef _BYTESWAP_
+ data = (uint16_t) buf[1] + ((uint16_t) buf[0] << 8);
+#else
+ data = (uint16_t) buf[0] + ((uint16_t) buf[1] << 8);
+#endif
+
+ OUTW(reg+disp->baseaddr,data);
+
+ buf++;
+ buf++;
+ len--;
+ len--;
+ }
+}
+
+
+/* *********************************************************************
+ * pciidedrv_find(devid,list)
+ *
+ * Find a particular product ID on the list. Return >= 0 if
+ * the ID is valid.
+ *
+ * Input parameters:
+ * devid - product and device ID we have
+ * list - list of product and device IDs we're looking for
+ *
+ * Return value:
+ * index into table, or -1 if not found
+ ********************************************************************* */
+static int pciidedrv_find(uint32_t devid,uint32_t *list)
+{
+ int idx = 0;
+
+ while (list[idx] != 0xFFFFFFFF) {
+ if (list[idx] == devid) return idx;
+ idx++;
+ }
+
+ return -1;
+}
+
+
+/* *********************************************************************
+ * idedrv_probe(drv,probe_a,probe_b,probe_ptr)
+ *
+ * Our probe routine. Attach an IDE device to the firmware.
+ *
+ * Input parameters:
+ * drv - driver structure
+ * probe_a - physical address of IDE registers
+ * probe_b - unit number
+ * probe_ptr - not used
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void idedrv_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr)
+{
+ idecommon_t *softc;
+ idecommon_dispatch_t *disp;
+ char descr[80];
+ char unitstr[50];
+ pcitag_t tag;
+ int index;
+ uint32_t devid;
+ uint32_t reg;
+ int res;
+ int unit;
+ cfe_driver_t *realdrv;
+ int attached = 0;
+
+ /*
+ * probe_a is unused
+ * probe_b is unused
+ * probe_ptr is unused.
+ */
+
+ index = 0;
+
+ for (;;) {
+ if (pci_find_class(PCI_CLASS_MASS_STORAGE,index,&tag) != 0) break;
+ index++;
+ devid = pci_conf_read(tag,PCI_ID_REG);
+
+ if (pciidedrv_find(devid,pciidedrv_devlist) < 0) {
+ continue;
+ }
+
+
+ reg = pci_conf_read(tag,PCI_MAPREG(0));
+
+ if (PCI_MAPREG_TYPE(reg) != PCI_MAPREG_TYPE_IO) {
+ xprintf("Skipping this IDE device, we don't do memory mapped IDE yet\n");
+ continue;
+ }
+
+ reg &= ~PCI_MAPREG_TYPE_MASK;
+
+ for (unit = 0; unit < 2; unit++) {
+
+ /*
+ * If we've deliberately disabled probing of this
+ * device, then skip it.
+ */
+
+ if (IDE_PROBE_GET_TYPE(probe_b,unit) == IDE_DEVTYPE_NOPROBE) {
+ continue;
+ }
+
+ softc = (idecommon_t *) KMALLOC(sizeof(idecommon_t),0);
+ disp = (idecommon_dispatch_t *) KMALLOC(sizeof(idecommon_dispatch_t),0);
+
+ if (!softc || !disp) {
+ if (softc) KFREE(softc);
+ if (disp) KFREE(disp);
+ return; /* out of memory, stop here */
+ }
+
+
+ softc->idecommon_addr = reg;
+ disp->ref = softc;
+ disp->baseaddr = softc->idecommon_addr;
+ softc->idecommon_deferprobe = 0;
+ softc->idecommon_dispatch = disp;
+ softc->idecommon_unit = unit;
+
+ disp->outb = idedrv_outb;
+ disp->outw = idedrv_outw;
+ disp->outs = idedrv_outs;
+
+ disp->inb = idedrv_inb;
+ disp->inw = idedrv_inw;
+ disp->ins = idedrv_ins;
+
+ /*
+ * If we're autoprobing, do it now. Loop back if we have
+ * trouble finding the device.
+ *
+ * If not autoprobing, assume the device is there and set the
+ * common routines to double check later.
+ */
+
+ if (IDE_PROBE_GET_TYPE(probe_b,unit) == IDE_DEVTYPE_AUTO) {
+ res = idecommon_devprobe(softc,1);
+ if (res < 0) {
+ KFREE(softc);
+ KFREE(disp);
+ continue;
+ }
+ }
+ else {
+ idecommon_init(softc,IDE_PROBE_GET_TYPE(probe_b,unit));
+ softc->idecommon_deferprobe = 1;
+ }
+
+ xsprintf(descr,"%s unit %d at I/O %04X",drv->drv_description,
+ softc->idecommon_unit,softc->idecommon_addr);
+ xsprintf(unitstr,"%d",unit);
+
+ realdrv = (cfe_driver_t *) (softc->idecommon_atapi ? &pciatapidrv : &pciidedrv);
+
+ idecommon_attach(&idedrv_dispatch);
+ cfe_attach(realdrv,softc,unitstr,descr);
+ attached++;
+ }
+
+ }
+
+ xprintf("PCIIDE: %d controllers found\n",attached);
+}
+
+
diff --git a/cfe/cfe/dev/dev_newflash.c b/cfe/cfe/dev/dev_newflash.c
new file mode 100644
index 0000000..d196e92
--- /dev/null
+++ b/cfe/cfe/dev/dev_newflash.c
@@ -0,0 +1,1428 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * "New" Flash device driver File: dev_newflash.c
+ *
+ * This driver supports various types of flash
+ * parts.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "addrspace.h"
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_ioctl.h"
+#include "cfe_error.h"
+
+#include "bsp_config.h"
+#include "dev_newflash.h"
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#define GETCFIBYTE(arr,x) (arr[(x)*2])
+
+#define min(a,b) ((a) < (b) ? (a) : (b))
+#define max(a,b) ((a) > (b) ? (a) : (b))
+
+/*
+ * Get the address of the flash sector buffer from the
+ * config file. Addresses are PHYSICAL.
+ */
+
+#ifndef CFG_FLASH_SECTOR_BUFFER_ADDR
+#define CFG_FLASH_SECTOR_BUFFER_ADDR (100*1024*1024-128*1024)
+#endif
+
+#ifndef CFG_FLASH_SECTOR_BUFFER_SIZE
+#define CFG_FLASH_SECTOR_BUFFER_SIZE (128*1024)
+#endif
+
+
+/*#define _NEWFLASH_DEBUG_ */
+
+/* *********************************************************************
+ * Forward declarations
+ ********************************************************************* */
+
+
+static void flashdrv_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+
+static int flashdrv_open(cfe_devctx_t *ctx);
+static int flashdrv_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int flashdrv_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat);
+static int flashdrv_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int flashdrv_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int flashdrv_close(cfe_devctx_t *ctx);
+
+/* *********************************************************************
+ * Device dispatch
+ ********************************************************************* */
+
+const static cfe_devdisp_t flashdrv_dispatch = {
+ flashdrv_open,
+ flashdrv_read,
+ flashdrv_inpstat,
+ flashdrv_write,
+ flashdrv_ioctl,
+ flashdrv_close,
+ NULL,
+ NULL
+};
+
+const cfe_driver_t newflashdrv = {
+ "New CFI flash",
+ "flash",
+ CFE_DEV_FLASH,
+ &flashdrv_dispatch,
+ flashdrv_probe
+};
+
+
+
+/* *********************************************************************
+ * Externs
+ ********************************************************************* */
+
+extern void *flashop_engine_ptr;
+extern int flashop_engine_len;
+
+extern void _cfe_flushcache(int);
+
+static int flash_sector_query(flashdev_t *softc,flash_sector_t *sector);
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+/*
+ * This is a pointer to a DRAM version of our flash subroutines.
+ * We make a global here so that it doesn't get copied multiple
+ * times for each flash we instantiate.
+ */
+
+static int (*flashop_engine_ram)(flashinstr_t *prog) = NULL;
+static uint8_t *flash_sector_buffer = NULL;
+
+/* *********************************************************************
+ * FLASH_OP_BEGIN(softc)
+ *
+ * Reset the pointer to the flash operations so that we can
+ * begin filling in new instructions to execute
+ *
+ * Input parameters:
+ * softc - our softc.
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+#define flash_op_begin(softc) softc->fd_iptr = 0;
+
+/* *********************************************************************
+ * FLASH_OP_ADD(softc,op,dest,src,cnt)
+ *
+ * Add an instruction to the flashop table
+ *
+ * Input parameters:
+ * softc - our flash
+ * op,dest,src,cnt - data for the opcode
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void flash_op_add(flashdev_t *softc,long base,long op,long dest,long src,long cnt)
+{
+ flashinstr_t *fi = &(softc->fd_inst[softc->fd_iptr]);
+
+ fi->fi_op = op;
+ fi->fi_base = base;
+ fi->fi_dest = dest;
+ fi->fi_src = src;
+ fi->fi_cnt = cnt;
+
+ softc->fd_iptr++;
+}
+
+
+/* *********************************************************************
+ * FLASH_OP_EXECUTE(softc)
+ *
+ * Execute the stored "flash operations"
+ *
+ * Input parameters:
+ * softc - our flash
+ *
+ * Return value:
+ * 0 if ok, else # of failures (less than zero)
+ ********************************************************************* */
+
+static int flash_op_execute(flashdev_t *softc)
+{
+ flash_op_add(softc,softc->fd_probe.flash_phys,FEOP_RETURN,0,0,0);
+
+#ifdef _NEWFLASH_DEBUG_
+ if (1) {
+ int idx;
+ printf("---------------\nCalling engine @ %08X\n",flashop_engine_ram);
+ for (idx = 0; idx < softc->fd_iptr; idx++) {
+ printf("%2d %08X %08X %08X %08X\n",
+ softc->fd_inst[idx].fi_op,
+ softc->fd_inst[idx].fi_base,
+ softc->fd_inst[idx].fi_dest,
+ softc->fd_inst[idx].fi_src,
+ softc->fd_inst[idx].fi_cnt);
+ }
+ }
+#endif
+
+ /*
+ * If someone hooked the flashop engine, call the hook.
+ */
+ if (softc->fd_probe.flash_engine_hook) {
+ return (*(softc->fd_probe.flash_engine_hook))(&(softc->fd_inst[0]));
+ }
+
+ /*
+ * Otherwise, call the standard one.
+ */
+ if (!flashop_engine_ram) return CFE_ERR_UNSUPPORTED;
+ return (*flashop_engine_ram)(&(softc->fd_inst[0]));
+}
+
+
+/* *********************************************************************
+ * FLASH_SETUP_ENGINE()
+ *
+ * Set up the "flash engine", copying the routine to DRAM
+ * and flushing the cache so we can call it.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void flash_setup_engine(void)
+{
+#if ((CFG_RAMAPP) || (CFG_EMBEDDED_PIC))
+ /* CFE is relocated, no need to copy flash engine to heap */
+ flashop_engine_ram = (void *) flashop_engine_ptr;
+#else
+ /* Copy flash engine to heap */
+ uint32_t *dst,*src;
+ int idx;
+
+ if (flashop_engine_ram) return; /* already done */
+
+ /*
+ * Allocate space for engine
+ */
+
+ flashop_engine_ram = (void *) KMALLOC(flashop_engine_len,0);
+ if (!flashop_engine_ram) return;
+
+ /*
+ * Copy engine to RAM - do it 32-bits at a time to avoid
+ * a certain platform with broken byte reads (no, not the 1250)
+ */
+
+ dst = (uint32_t *) flashop_engine_ram;
+ src = (uint32_t *) flashop_engine_ptr;
+ for (idx = 0; idx < flashop_engine_len/sizeof(uint32_t); idx++) {
+ *dst++ = *src++;
+ }
+
+ /*
+ * Flush the d-cache, invalidate the I-cache.
+ */
+
+ _cfe_flushcache(1);
+ _cfe_flushcache(2);
+#endif
+}
+
+/* *********************************************************************
+ * FLASH_ERASE_RANGE(softc,range)
+ *
+ * Erase a range of sectors
+ *
+ * Input parameters:
+ * softc - our flash
+ * range - range structure
+ *
+ * Return value:
+ * 0 if ok
+ * else error
+ ********************************************************************* */
+
+static int flash_erase_range(flashdev_t *softc,flash_range_t *range)
+{
+ flash_sector_t sector;
+ int res;
+
+ if (softc->fd_probe.flash_type != FLASH_TYPE_FLASH) {
+ return CFE_ERR_UNSUPPORTED;
+ }
+
+ if (range->range_base+range->range_length > softc->fd_probe.flash_size) {
+ return CFE_ERR_INV_PARAM;
+ }
+
+ res = 0;
+
+ sector.flash_sector_idx = 0;
+
+ for (;;) {
+ res = flash_sector_query(softc,&sector);
+ if (res != 0) break;
+ if (sector.flash_sector_status == FLASH_SECTOR_INVALID) {
+ break;
+ }
+
+ if ((sector.flash_sector_offset >= range->range_base) &&
+ (sector.flash_sector_offset <
+ (range->range_base+range->range_length-1))) {
+
+ flash_op_begin(softc);
+ flash_op_add(softc,softc->fd_probe.flash_phys,
+ softc->fd_erasefunc,
+ sector.flash_sector_offset,
+ 0,0);
+ res = flash_op_execute(softc);
+
+ if (res != 0) break;
+ }
+ sector.flash_sector_idx++;
+ }
+
+ return res;
+
+}
+
+/* *********************************************************************
+ * FLASH_ERASE_ALL(softc)
+ *
+ * Erase the entire flash device, except the NVRAM area,
+ * sector-by-sector.
+ *
+ * Input parameters:
+ * softc - our flash
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int flash_erase_all(flashdev_t *softc)
+{
+ flash_range_t range;
+
+ range.range_base = 0;
+ range.range_length = softc->fd_probe.flash_size *
+ softc->fd_probe.flash_nchips;
+
+ return flash_erase_range(softc,&range);
+}
+
+
+/* *********************************************************************
+ * flash_range_intersection(sector,inrange,outrange)
+ *
+ * Compute the intersection between a flash range and a
+ * sector.
+ *
+ * Input parameters:
+ * sector - sector to examine
+ * range - range we are checking
+ * outrange - where to put resulting intersection range
+ *
+ * Return value:
+ * 1 - range is an entire sector
+ * 0 - range is a partial sector
+ * -1 - range has no intersection
+ ********************************************************************* */
+
+static int flash_range_intersection(flash_sector_t *sector,
+ flash_range_t *inrange,
+ flash_range_t *outrange)
+{
+ int start,end;
+
+ /*
+ * compute the start and end pointers
+ */
+
+ start = (int) (max(sector->flash_sector_offset,
+ inrange->range_base));
+
+ end = (int) (min((sector->flash_sector_offset+sector->flash_sector_size),
+ (inrange->range_base+inrange->range_length)));
+
+ /*
+ * if the end is in the right place wrt the start,
+ * there is an intersection.
+ */
+
+ if (end > start) {
+ outrange->range_base = (unsigned int) start;
+ outrange->range_length = (unsigned int) (end-start);
+
+ if ((sector->flash_sector_offset == outrange->range_base) &&
+ (sector->flash_sector_size == outrange->range_length)) {
+ return 1; /* instersection: entire sector */
+ }
+ else {
+ return 0; /* intersection: partial sector */
+ }
+ }
+ else {
+ outrange->range_base = (unsigned int) start;
+ outrange->range_length = 0;
+ return -1; /* intersection: none */
+ }
+}
+
+
+/* *********************************************************************
+ * FLASH_SECTOR_QUERY(softc,sector)
+ *
+ * Query the sector information about a particular sector. You can
+ * call this iteratively to find out about all of the sectors.
+ *
+ * Input parameters:
+ * softc - our flash info
+ * sector - structure to receive sector information
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int flash_sector_query(flashdev_t *softc,flash_sector_t *sector)
+{
+ int idx;
+ int nblks;
+ int blksiz;
+ unsigned int offset;
+ int whichchip;
+ int secidx;
+ int curblk;
+
+ if (softc->fd_probe.flash_type != FLASH_TYPE_FLASH) {
+ return CFE_ERR_UNSUPPORTED;
+ }
+
+ if (softc->fd_probe.flash_nsectors == 0) {
+ return CFE_ERR_UNSUPPORTED;
+ }
+
+ /* Figure out which chip */
+ whichchip = sector->flash_sector_idx / softc->fd_ttlsect;
+ if (whichchip >= softc->fd_probe.flash_nchips) {
+ sector->flash_sector_status = FLASH_SECTOR_INVALID;
+ return 0;
+ }
+
+ /* Within that chip, get sector info */
+ offset = softc->fd_probe.flash_size * whichchip;
+ secidx = sector->flash_sector_idx % softc->fd_ttlsect;
+ curblk = 0;
+
+ for (idx = 0; idx < softc->fd_probe.flash_nsectors; idx++) {
+ nblks = FLASH_SECTOR_NBLKS(softc->fd_probe.flash_sectors[idx]);
+ blksiz = FLASH_SECTOR_SIZE(softc->fd_probe.flash_sectors[idx]);
+ if (secidx < curblk+nblks) {
+ sector->flash_sector_status = FLASH_SECTOR_OK;
+ sector->flash_sector_offset =
+ offset + (secidx-curblk)*blksiz;
+ sector->flash_sector_size = blksiz;
+ break;
+ }
+
+ offset += (nblks)*blksiz;
+ curblk += nblks;
+ }
+
+
+ if (idx == softc->fd_probe.flash_nsectors) {
+ sector->flash_sector_status = FLASH_SECTOR_INVALID;
+ }
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * FLASH_SET_CMDSET(softc,cmdset,bus16,dev16)
+ *
+ * Set the command-set that we'll honor for this flash.
+ *
+ * Input parameters:
+ * softc - our flash
+ * cmdset - FLASH_CFI_CMDSET_xxx
+ * bus16 - true if bus is 16 bits wide
+ * dev16 - true if device supports 16-bit operation
+ *
+ * So: bus16 && dev16 -> 16-bit commands
+ * !bus16 && dev16 -> 8-bit commands to 16-bit flash with BYTE#
+ * !bus16 && !dev16 -> 8-bit commands
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void flash_set_cmdset(flashdev_t *softc,int cmdset,int bus16,int dev16)
+{
+ switch (cmdset) {
+#if (FLASH_DRIVERS & FLASH_DRIVER_INTEL)
+ case FLASH_CFI_CMDSET_INTEL_ECS:
+ case FLASH_CFI_CMDSET_INTEL_STD:
+ if (bus16) {
+ softc->fd_erasefunc = FEOP_INTEL_ERASE16;
+ softc->fd_pgmfunc = FEOP_INTEL_PGM16;
+ softc->fd_readfunc = FEOP_READ16;
+ }
+ else {
+ softc->fd_erasefunc = FEOP_INTEL_ERASE8;
+ softc->fd_pgmfunc = FEOP_INTEL_PGM8;
+ softc->fd_readfunc = FEOP_READ8;
+ }
+ break;
+#endif
+#if (FLASH_DRIVERS & FLASH_DRIVER_AMD)
+ case FLASH_CFI_CMDSET_AMD_STD:
+ case FLASH_CFI_CMDSET_AMD_ECS:
+ if (!bus16 && !dev16) { /* 8-bit bus, 8-bit flash */
+ softc->fd_erasefunc = FEOP_AMD_ERASE8;
+ softc->fd_pgmfunc = FEOP_AMD_PGM8;
+ softc->fd_readfunc = FEOP_READ8;
+ }
+ else if (bus16 && dev16) { /* 16-bit bus, 16-bit flash */
+ softc->fd_erasefunc = FEOP_AMD_ERASE16;
+ softc->fd_pgmfunc = FEOP_AMD_PGM16;
+ softc->fd_readfunc = FEOP_READ16;
+ }
+ else { /* 8-bit bus, 16-bit flash w/BYTE# */
+ softc->fd_erasefunc = FEOP_AMD_ERASE16B;
+ softc->fd_pgmfunc = FEOP_AMD_PGM16B;
+ softc->fd_readfunc = FEOP_READ8;
+ }
+ break;
+#endif
+ default:
+ /* we don't understand the command set - treat it like ROM */
+ softc->fd_erasefunc = FEOP_RETURN;
+ softc->fd_pgmfunc = FEOP_RETURN;
+ softc->fd_readfunc = bus16 ? FEOP_READ16 : FEOP_READ8;
+ break;
+ }
+}
+
+#if (FLASH_DRIVERS & FLASH_DRIVER_CFI)
+/* *********************************************************************
+ * FLASH_CFI_PROBE(softc)
+ *
+ * Try to do a CFI query on this device. If we find the m
+ * magic signature, extract some useful information from the
+ * query structure.
+ *
+ * Input parameters:
+ * softc - out flash
+ *
+ * Return value:
+ * 0 if successful, <0 if error
+ ********************************************************************* */
+static int flash_cfi_probe(flashdev_t *softc)
+{
+ uint8_t cfidata[FLASH_MAX_CFIDATA];
+ unsigned int cmdset;
+ unsigned int devif;
+ int bus16 = 0;
+ int dev16 = 0;
+ int idx;
+ int found = 0;
+ int regcnt;
+ int nblks;
+ int blksiz;
+ int insane = 0;
+ uint8_t insaner = 0;
+
+ if (softc->fd_probe.flash_flags & FLASH_FLG_BUS16) {
+ bus16 = 1;
+ }
+
+ /*
+ * Do a CFI query (16-bit)
+ */
+
+ idx = FEOP_CFIQUERY8;
+ if (softc->fd_probe.flash_flags & FLASH_FLG_DEV16) {
+ idx = (softc->fd_probe.flash_flags & FLASH_FLG_BUS16) ?
+ FEOP_CFIQUERY16 : FEOP_CFIQUERY16B;
+ }
+
+ flash_op_begin(softc);
+ flash_op_add(softc,softc->fd_probe.flash_phys,
+ idx,(long)cfidata,0,FLASH_MAX_CFIDATA);
+ flash_op_execute(softc);
+
+ /*
+ * Look for signature.
+ */
+
+
+ if ((GETCFIBYTE(cfidata,FLASH_CFI_SIGNATURE+0) == 'Q') &&
+ (GETCFIBYTE(cfidata,FLASH_CFI_SIGNATURE+1) == 'R') &&
+ (GETCFIBYTE(cfidata,FLASH_CFI_SIGNATURE+2) == 'Y')) {
+ found = 1;
+ }
+
+
+ /*
+ * No CFI, bail. First, set the command set to an invalid
+ * value so that we'll use default routines to read but not do programming
+ */
+
+ if (!found) {
+ flash_set_cmdset(softc,-1,bus16,dev16);
+ return CFE_ERR_UNSUPPORTED;
+ }
+
+ softc->fd_probe.flash_type = FLASH_TYPE_FLASH;
+
+ /*
+ * Gather info from flash
+ */
+
+ cmdset = ((unsigned int) (GETCFIBYTE(cfidata,FLASH_CFI_COMMAND_SET))) +
+ (((unsigned int) (GETCFIBYTE(cfidata,FLASH_CFI_COMMAND_SET+1))) << 8);
+
+
+ devif = ((unsigned int) (GETCFIBYTE(cfidata,FLASH_CFI_DEVICE_INTERFACE))) +
+ (((unsigned int) (GETCFIBYTE(cfidata,FLASH_CFI_DEVICE_INTERFACE+1))) << 8);
+
+
+ softc->fd_probe.flash_size = (1 << (unsigned int)(GETCFIBYTE(cfidata,FLASH_CFI_DEVICE_SIZE)));
+
+ /*
+ * It's a 16-bit device if it is either always 16 bits or can be.
+ * we'll use "bus16" to decide if the BYTE# pin was strapped
+ */
+
+ dev16 = 0;
+ if ((devif == FLASH_CFI_DEVIF_X16) || (devif == FLASH_CFI_DEVIF_X8X16)) dev16 = 1;
+
+ regcnt = GETCFIBYTE(cfidata,FLASH_CFI_REGION_COUNT);
+
+ softc->fd_probe.flash_nsectors = regcnt;
+
+#if 1
+ /*
+ * Hiss! Some AMD top-boot flash parts have broken CFI tables - they are backwards!
+ * Do some extra probing to find it.
+ */
+
+ if (cmdset == FLASH_CFI_CMDSET_AMD_STD) {
+ idx = FEOP_AMD_DEVCODE8;
+ if (softc->fd_probe.flash_flags & FLASH_FLG_DEV16) {
+ idx = (softc->fd_probe.flash_flags & FLASH_FLG_BUS16) ?
+ FEOP_AMD_DEVCODE16 : FEOP_AMD_DEVCODE16B;
+ }
+
+ flash_op_begin(softc);
+ flash_op_add(softc,softc->fd_probe.flash_phys,
+ idx,(long)&insaner,0,0);
+ flash_op_execute(softc);
+#ifdef _NEWFLASH_DEBUG_
+ xprintf("Insaner = 0x%x\n", insaner);
+#endif /* _NEWFLASH_DEBUG_ */
+ if(((insaner & 0xFF) == 0xC4)||((insaner & 0xFF) == 0xF6)){
+ insane = 1;
+#ifdef _NEWFLASH_DEBUG_
+ xprintf("Warning: insane AMD part, backwards CFI table!\n");
+#endif /* _NEWFLASH_DEBUG_ */
+ }
+ }
+#else
+ insane = insaner = 1;
+#endif /* 0 */
+
+
+ for (idx = 0; idx < regcnt; idx++) {
+ nblks = ((int)GETCFIBYTE(cfidata,FLASH_CFI_REGION_TABLE+0+idx*4) +
+ (int)(GETCFIBYTE(cfidata,FLASH_CFI_REGION_TABLE+1+idx*4)<<8)) + 1;
+ blksiz = ((int)GETCFIBYTE(cfidata,FLASH_CFI_REGION_TABLE+2+idx*4) +
+ (int)(GETCFIBYTE(cfidata,FLASH_CFI_REGION_TABLE+3+idx*4)<<8)) * 256;
+
+ if (insane) {
+ /* Insane */
+ softc->fd_probe.flash_sectors[((regcnt-1)-idx)] =
+ FLASH_SECTOR_RANGE(nblks,blksiz);
+ }
+ else {
+ /* Sane */
+ softc->fd_probe.flash_sectors[idx] =
+ FLASH_SECTOR_RANGE(nblks,blksiz);
+ }
+ }
+
+ /*
+ * Set the command set we're going to use.
+ */
+
+ flash_set_cmdset(softc,cmdset,bus16,dev16);
+
+ return 0;
+
+}
+
+
+
+/* *********************************************************************
+ * FLASH_DO_PROBE(softc)
+ *
+ * Probe to see if we're ROM or RAM. If ROM, see if we're flash.
+ * If flash, do CFI query.
+ *
+ * Input parameters:
+ * softc - our structure
+ *
+ * Return value:
+ * FLASH_TYPE_xxx
+ ********************************************************************* */
+static int flash_do_probe(flashdev_t *softc)
+{
+ uint8_t test_byte0,test_byte1;
+ uint8_t save0,save1;
+ volatile uint8_t *ptr;
+
+ /*
+ * flash_do_probe is called before we open the device, so we
+ * need to allocate space for instructions so the flashop
+ * engine will work.
+ */
+
+ softc->fd_inst = KMALLOC(FLASH_MAX_INST*sizeof(flashinstr_t),0);
+ if (!softc->fd_inst) return FLASH_TYPE_ROM;
+
+ /*
+ * Attempt to read/write byte zero. If it is changable,
+ * this is SRAM (or maybe a ROM emulator with the write line hooked up)
+ */
+
+ ptr = (volatile uint8_t *) UNCADDR(softc->fd_probe.flash_phys);
+ save0 = *ptr; /* save old value */
+ save1 = *(ptr+1); /* save old value */
+
+ test_byte0 = (save0 != 0x88) ? 0x88 : 0x89;
+ test_byte1 = (save1 != 0x99) ? 0x99 : 0x91;
+
+ *(ptr) = test_byte0;
+ *(ptr+1) = test_byte1;
+
+ if ((*ptr == test_byte0) && (*(ptr+1) == test_byte1)) {
+ softc->fd_probe.flash_type = FLASH_TYPE_SRAM;
+
+ /*Only write back saved values if it's RAM*/
+ *(ptr) = save0;
+ *(ptr+1) = save1;
+
+#ifdef _NEWFLASH_DEBUG_
+ xprintf("Flash type SRAM\n");
+#endif
+
+ }
+ else {
+ softc->fd_probe.flash_type = FLASH_TYPE_ROM;
+
+#ifdef _NEWFLASH_DEBUG_
+ xprintf("Flash type ROM\n");
+#endif
+
+ }
+
+ /*
+ * If we thought it was ROM, try doing a CFI query
+ * to see if it was flash. This check is kind of kludgey
+ * but should work.
+ */
+
+ if (softc->fd_probe.flash_type == FLASH_TYPE_ROM) {
+ flash_cfi_probe(softc);
+ }
+
+
+ KFREE(softc->fd_inst);
+ softc->fd_inst = NULL;
+
+ return softc->fd_probe.flash_type;
+}
+
+#endif /* (FLASH_DRIVERS & FLASH_DRIVER_CFI) */
+
+
+/* *********************************************************************
+ * flash_do_parts(probe,parts)
+ *
+ * Partition the flash into the sizes specified. We use
+ * the sizes in the table to generate a table of {offset,size}
+ * pairs that eventually become partitions.
+ *
+ * The only thing magical about this is that size "0" means
+ * "fill to max" and that partitions beyond the "0" are aligned
+ * to the top of the flash. Therefore, if you had a 4MB
+ * flash and listed four partitions, 512K, 0, 512K, 512K,
+ * then there would be a 2.5M partition in the middle and two
+ * 512K partitions at the top.
+ *
+ * Input parameters:
+ * probe - flash probe data (user-supplied table)
+ * parts - our partition table (output)
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void flash_do_parts(flashdev_t *softc)
+{
+ int idx;
+ int middlepart = -1;
+ int lobound = 0;
+ newflash_probe_t *probe = &(softc->fd_probe);
+ flashpart_t *parts = &(softc->fd_parts[0]);
+ int hibound = probe->flash_size*probe->flash_nchips;
+
+ for (idx = 0; idx < probe->flash_nparts; idx++) {
+ if (probe->flash_parts[idx].fp_size == 0) {
+ middlepart = idx;
+ break;
+ }
+ parts[idx].fp_offset = lobound;
+ parts[idx].fp_size = probe->flash_parts[idx].fp_size;
+ lobound += probe->flash_parts[idx].fp_size;
+ }
+
+ if (idx != probe->flash_nparts) {
+ for (idx = probe->flash_nparts - 1; idx > middlepart;
+ idx--) {
+ parts[idx].fp_size = probe->flash_parts[idx].fp_size;
+ hibound -= probe->flash_parts[idx].fp_size;
+ parts[idx].fp_offset = hibound;
+ }
+ }
+
+ if (middlepart != -1) {
+ parts[middlepart].fp_offset = lobound;
+ parts[middlepart].fp_size = hibound - lobound;
+ }
+
+#ifdef _NEWFLASH_DEBUG_
+ printf("Partition information:\n");
+ for (idx = 0; idx < probe->flash_nparts;idx++) {
+ printf("#%02d %08X -> %08X (%d)\n",idx,
+ parts[idx].fp_offset,parts[idx].fp_offset+parts[idx].fp_size-1,
+ parts[idx].fp_size);
+ }
+#endif
+}
+
+
+/* *********************************************************************
+ * flashdrv_allocbuf(dev)
+ *
+ * Allocate sector buffer for flash programming. Use a global
+ * buffer for all devices.
+ *
+ * Input parameters:
+ * dev - our device
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+static void flashdrv_allocbuf(flashdev_t *softc)
+{
+ if (!flash_sector_buffer) {
+#if CFG_FLASH_ALLOC_SECTOR_BUFFER
+ flash_sector_buffer = KMALLOC(CFG_FLASH_SECTOR_BUFFER_SIZE,0);
+ if (!flash_sector_buffer) {
+ printf("FLASH: Could not allocate sector buffer, using default\n");
+ flash_sector_buffer = (uint8_t *) KERNADDR(CFG_FLASH_SECTOR_BUFFER_SIZE);
+ }
+#else
+ flash_sector_buffer = (uint8_t *) KERNADDR(CFG_FLASH_SECTOR_BUFFER_ADDR);
+#endif
+ }
+
+ softc->fd_sectorbuffer = flash_sector_buffer;
+}
+
+/* *********************************************************************
+ * flashdrv_probe(drv,probe_a,probe_b,probe_ptr)
+ *
+ * Device probe routine. Attach the flash device to
+ * CFE's device table.
+ *
+ * Input parameters:
+ * drv - driver descriptor
+ * probe_a - physical address of flash
+ * probe_b - size of flash (bytes)
+ * probe_ptr - unused
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void flashdrv_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr)
+{
+ flashdev_t *softc;
+ newflash_probe_t *probe;
+ int idx;
+ char descr[80];
+ static int flashidx = 0;
+ char *x;
+
+ /*
+ * First thing to do is configure the flashop engine
+ * if not already done. Basically we copy a bit of
+ * position-independent code into the DRAM.
+ */
+
+ flash_setup_engine();
+
+ /*
+ * Now, on with the probing.
+ */
+
+ probe = (newflash_probe_t *) probe_ptr;
+
+ /*
+ * probe_a is the flash base address
+ * probe_b is the size of the flash
+ * probe_ptr is unused.
+ */
+
+ softc = (flashdev_t *) KMALLOC(sizeof(flashdev_t),0);
+ if (softc) {
+ memset(softc,0,sizeof(flashdev_t));
+
+ flashdrv_allocbuf(softc);
+
+ if (probe) {
+ /*
+ * Passed probe structure, do fancy stuff
+ */
+ memcpy(&(softc->fd_probe),probe,sizeof(newflash_probe_t));
+ if (softc->fd_probe.flash_nchips == 0) {
+ softc->fd_probe.flash_nchips = 1;
+ }
+ }
+ else {
+ /* Didn't pass probe structure, do the compatible thing */
+ softc->fd_probe.flash_phys = probe_a;
+ softc->fd_probe.flash_size = (probe_b & FLASH_SIZE_MASK);
+ softc->fd_probe.flash_flags = (probe_b & FLASH_FLG_MASK);
+ softc->fd_probe.flash_nchips = 1;
+ }
+
+ if (softc->fd_probe.flash_flags & FLASH_FLG_MANUAL) {
+ /* Manual probing, just set the command set. */
+ flash_set_cmdset(softc,softc->fd_probe.flash_cmdset,
+ ((softc->fd_probe.flash_flags & FLASH_FLG_BUS16) ? 1 : 0),
+ ((softc->fd_probe.flash_flags & FLASH_FLG_DEV16) ? 1 : 0));
+ }
+ else {
+ /* Do automatic probing */
+#if (FLASH_DRIVERS & FLASH_DRIVER_CFI)
+ flash_do_probe(softc);
+#else
+ return; /* No automatic probing, bail! */
+#endif
+ }
+
+ /* Remember total size of all devices */
+ softc->fd_ttlsize = softc->fd_probe.flash_nchips * softc->fd_probe.flash_size;
+
+ /* Set description */
+ x = descr;
+ x += xsprintf(x,"%s at %08X size %uKB",drv->drv_description,
+ softc->fd_probe.flash_phys,
+ softc->fd_ttlsize/1024);
+ if (softc->fd_probe.flash_nchips > 1) {
+ xsprintf(x," (%d chips)",softc->fd_probe.flash_nchips);
+ }
+
+ /*
+ * If flash is not partitioned, just instantiate one
+ * device. Otherwise, instantiate multiple flashes
+ * to cover the entire device.
+ */
+
+ if (softc->fd_probe.flash_nparts == 0) {
+ softc->fd_parts[0].fp_dev = softc;
+ softc->fd_parts[0].fp_offset = 0;
+ softc->fd_parts[0].fp_size = softc->fd_probe.flash_size;
+ cfe_attach(drv,&(softc->fd_parts[0]),NULL,descr);
+ }
+ else {
+ /*
+ * Partition flash into chunks
+ */
+ flash_do_parts(softc);
+
+ /*
+ * Instantiate devices for each piece
+ */
+
+ for (idx = 0; idx < softc->fd_probe.flash_nparts; idx++) {
+ char name[32];
+ char *nptr;
+
+ xsprintf(descr,"%s at %08X offset %08X size %uKB",
+ drv->drv_description,
+ softc->fd_probe.flash_phys,
+ softc->fd_parts[idx].fp_offset,
+ (softc->fd_parts[idx].fp_size+1023)/1024);
+
+ softc->fd_parts[idx].fp_dev = softc;
+ if (softc->fd_probe.flash_parts[idx].fp_name == NULL) {
+ sprintf(name,"%d",idx);
+ nptr = name;
+ }
+ else {
+ nptr = softc->fd_probe.flash_parts[idx].fp_name;
+ }
+ cfe_attach_idx(drv,
+ flashidx,
+ &(softc->fd_parts[idx]),
+ nptr,
+ descr);
+ }
+ }
+
+ flashidx++;
+
+ /* Count total sectors on the device */
+
+ softc->fd_ttlsect = 0;
+ for (idx = 0; idx < softc->fd_probe.flash_nsectors; idx++) {
+ softc->fd_ttlsect += FLASH_SECTOR_NBLKS(softc->fd_probe.flash_sectors[idx]);
+ }
+
+ }
+
+}
+
+
+/* *********************************************************************
+ * flashdrv_open(ctx)
+ *
+ * Called when the flash device is opened.
+ *
+ * Input parameters:
+ * ctx - device context
+ *
+ * Return value:
+ * 0 if ok else error code
+ ********************************************************************* */
+
+static int flashdrv_open(cfe_devctx_t *ctx)
+{
+ flashpart_t *part = ctx->dev_softc;
+ flashdev_t *softc = part->fp_dev;
+ int ttlsect = softc->fd_ttlsect;
+
+ /*
+ * Calculate number of flashop instructions we'll need at most.
+ * This will be two for each sector plus two more for the first
+ * and last sectors, plus two extra
+ */
+
+ ttlsect = (ttlsect * 2 * softc->fd_probe.flash_nchips) + 6;
+
+ /*
+ * Allocate memory for instructions.
+ */
+
+#ifdef _NEWFLASH_DEBUG_
+ printf("%s: allocating %d instructions\n",cfe_device_name(ctx),ttlsect);
+#endif
+
+ softc->fd_inst = KMALLOC(ttlsect*sizeof(flashinstr_t),0);
+ if (!softc->fd_inst) return CFE_ERR_NOMEM;
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * flashdrv_read(ctx,buffer)
+ *
+ * Read data from the flash device. The flash device is
+ * considered to be like a disk (you need to specify the offset).
+ *
+ * Input parameters:
+ * ctx - device context
+ * buffer - buffer descriptor
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+static int flashdrv_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ flashpart_t *part = ctx->dev_softc;
+ flashdev_t *softc = part->fp_dev;
+ int blen;
+ int offset;
+
+ blen = buffer->buf_length;
+ offset = (long)buffer->buf_offset;
+
+ if ((offset + blen) > part->fp_size) {
+ blen = part->fp_size - offset;
+ }
+
+ offset += part->fp_offset;
+
+ if (blen > 0) {
+ flash_op_begin(softc);
+ flash_op_add(softc,softc->fd_probe.flash_phys,
+ softc->fd_readfunc,(long)buffer->buf_ptr,offset,blen);
+ flash_op_execute(softc);
+ }
+
+ buffer->buf_retlen = blen;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * flashdrv_inpstat(ctx,inpstat)
+ *
+ * Return "input status". For flash devices, we always return true.
+ *
+ * Input parameters:
+ * ctx - device context
+ * inpstat - input status structure
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+static int flashdrv_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat)
+{
+ inpstat->inp_status = 1;
+ return 0;
+}
+
+
+/* *********************************************************************
+ * flashdrv_write(ctx,buffer)
+ *
+ * Write data to the flash device. The flash device is
+ * considered to be like a disk (you need to specify the offset).
+ *
+ * Input parameters:
+ * ctx - device context
+ * buffer - buffer descriptor
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+static int flashdrv_write2(cfe_devctx_t *ctx,iocb_buffer_t *buffer,int reboot)
+{
+ flashpart_t *part = ctx->dev_softc;
+ flashdev_t *softc = part->fp_dev;
+ int blen;
+ int res;
+ int offset;
+ int whichchip;
+ long chipbase;
+ flash_range_t outrange;
+ flash_range_t inrange;
+ flash_sector_t sector;
+
+ blen = buffer->buf_length;
+ offset = (long)buffer->buf_offset;
+
+ /* Compute range within physical flash */
+
+ if ((offset + blen) > part->fp_size) {
+ blen = part->fp_size - offset;
+ }
+
+ offset += part->fp_offset;
+
+ /* Handle case of writing nothing */
+
+ if (blen == 0) {
+ buffer->buf_retlen = blen;
+ return (buffer->buf_length == blen) ? 0 : CFE_ERR_IOERR;
+ }
+
+ /* now, offset/blen forms the range we want to write to. */
+
+ inrange.range_base = offset;
+ inrange.range_length = blen;
+
+ sector.flash_sector_idx = 0;
+
+ flash_op_begin(softc);
+
+ for (;;) {
+ res = flash_sector_query(softc,&sector);
+ if (res != 0) break;
+ if (sector.flash_sector_status == FLASH_SECTOR_INVALID) {
+ break;
+ }
+
+ whichchip = sector.flash_sector_idx / softc->fd_ttlsect;
+ chipbase = softc->fd_probe.flash_phys +
+ (long) (whichchip * softc->fd_probe.flash_size);
+
+ res = flash_range_intersection(&sector,&inrange,&outrange);
+
+ switch (res) {
+ case 1: /* Erease/program entire sector */
+ flash_op_add(softc,chipbase,
+ softc->fd_erasefunc,
+ sector.flash_sector_offset,
+ 0,0);
+ flash_op_add(softc,chipbase,
+ softc->fd_pgmfunc,
+ outrange.range_base,
+ ((long)buffer->buf_ptr)+(outrange.range_base-inrange.range_base),
+ outrange.range_length);
+ break;
+
+ case 0: /* Erase/reprogram partial sector */
+ /* Save old sector */
+ flash_op_add(softc,chipbase,
+ softc->fd_readfunc,
+ (long)(softc->fd_sectorbuffer),
+ sector.flash_sector_offset,
+ sector.flash_sector_size);
+ /* Copy in new stuff */
+ flash_op_add(softc,chipbase,
+ FEOP_MEMCPY,
+ ((long)(softc->fd_sectorbuffer))+(outrange.range_base-sector.flash_sector_offset),
+ ((long)buffer->buf_ptr)+(outrange.range_base-inrange.range_base),
+ outrange.range_length);
+ /* Erase sector */
+ flash_op_add(softc,chipbase,
+ softc->fd_erasefunc,
+ sector.flash_sector_offset,
+ 0,0);
+ /* Program sector */
+ flash_op_add(softc,chipbase,
+ softc->fd_pgmfunc,
+ sector.flash_sector_offset,
+ (long)(softc->fd_sectorbuffer),
+ sector.flash_sector_size);
+ break;
+
+ case -1: /* No intersection */
+ break;
+ }
+
+ sector.flash_sector_idx++;
+
+ }
+
+ if (reboot) {
+ flash_op_add(softc,softc->fd_probe.flash_phys,FEOP_REBOOT,0,0,0);
+ }
+
+ res = flash_op_execute(softc);
+
+ buffer->buf_retlen = blen;
+
+ return (res == 0) ? 0 : CFE_ERR_IOERR;
+}
+
+static int flashdrv_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ return flashdrv_write2(ctx,buffer,0);
+}
+
+
+/* *********************************************************************
+ * flashdrv_ioctl(ctx,buffer)
+ *
+ * Handle special IOCTL functions for the flash. Flash devices
+ * support NVRAM information, sector and chip erase, and a
+ * special IOCTL for updating the running copy of CFE.
+ *
+ * Input parameters:
+ * ctx - device context
+ * buffer - descriptor for IOCTL parameters
+ *
+ * Return value:
+ * 0 if ok else error
+ ********************************************************************* */
+static int flashdrv_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ flashpart_t *part = ctx->dev_softc;
+ flashdev_t *softc = part->fp_dev;
+ nvram_info_t *nvinfo;
+ flash_info_t *info;
+ flash_range_t range;
+ int offset;
+
+ switch ((int)buffer->buf_ioctlcmd) {
+ case IOCTL_NVRAM_GETINFO:
+ /*
+ * We only support NVRAM on flashes that have been partitioned
+ * into at least two partitions. Every partition supports
+ * being an NVRAM in that case, but we'll only attach one
+ * of them to the environment subsystem.
+ */
+ if (softc->fd_probe.flash_nparts <= 1) {
+ return CFE_ERR_UNSUPPORTED;
+ }
+ nvinfo = (nvram_info_t *) buffer->buf_ptr;
+ if (buffer->buf_length != sizeof(nvram_info_t)) return CFE_ERR_INV_PARAM;
+
+ nvinfo->nvram_offset = 0;
+ nvinfo->nvram_size = part->fp_size;
+ nvinfo->nvram_eraseflg = 1;
+ buffer->buf_retlen = sizeof(nvram_info_t);
+ return 0;
+ break;
+
+ case IOCTL_FLASH_ERASE_SECTOR:
+ offset = (int) buffer->buf_offset;
+ offset += part->fp_offset;
+ if (offset >= softc->fd_probe.flash_size) return -1;
+
+ flash_op_begin(softc);
+ flash_op_add(softc,
+ softc->fd_probe.flash_phys,
+ softc->fd_erasefunc,
+ offset,
+ 0,0);
+ flash_op_execute(softc);
+ return 0;
+
+ case IOCTL_FLASH_ERASE_ALL:
+ offset = (int) buffer->buf_offset;
+ if (offset != 0) return -1;
+ flash_erase_all(softc);
+ return 0;
+
+ case IOCTL_FLASH_WRITE_ALL:
+ /* Write file and reboot */
+ flashdrv_write2(ctx,buffer,1);
+ return -1; /* should not return */
+
+ case IOCTL_FLASH_GETINFO:
+ info = (flash_info_t *) buffer->buf_ptr;
+ info->flash_base = softc->fd_probe.flash_phys;
+ info->flash_size = softc->fd_probe.flash_size;
+ info->flash_type = softc->fd_probe.flash_type;
+ info->flash_flags = FLASH_FLAG_NOERASE;
+ return 0;
+
+ case IOCTL_FLASH_GETSECTORS:
+ return flash_sector_query(softc,(flash_sector_t *) buffer->buf_ptr);
+
+ case IOCTL_FLASH_ERASE_RANGE:
+ memcpy(&range,buffer->buf_ptr,sizeof(flash_range_t));
+ range.range_base += part->fp_offset;
+ if (range.range_length > part->fp_size) {
+ range.range_length = part->fp_size;
+ }
+ return flash_erase_range(softc,&range);
+
+ default:
+ /* Call hook if present. */
+ if (softc->fd_probe.flash_ioctl_hook) {
+ return (*(softc->fd_probe.flash_ioctl_hook))(ctx,buffer);
+ }
+ return -1;
+ }
+
+ return -1;
+}
+
+
+/* *********************************************************************
+ * flashdrv_close(ctx)
+ *
+ * Close the flash device.
+ *
+ * Input parameters:
+ * ctx - device context
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+static int flashdrv_close(cfe_devctx_t *ctx)
+{
+ flashpart_t *part = ctx->dev_softc;
+ flashdev_t *softc = part->fp_dev;
+
+ if (softc->fd_inst) {
+ KFREE(softc->fd_inst);
+ }
+
+ softc->fd_inst = NULL;
+
+ /* XXX Invalidate the cache ?!?! */
+
+ return 0;
+}
+
+
diff --git a/cfe/cfe/dev/dev_ns16550.c b/cfe/cfe/dev/dev_ns16550.c
new file mode 100644
index 0000000..a70eecf
--- /dev/null
+++ b/cfe/cfe/dev/dev_ns16550.c
@@ -0,0 +1,255 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * NS16550 UART driver File: dev_ns16550.c
+ *
+ * This is a console device driver for an NS16550 UART, either
+ * on-board or as a PCI-device. In the case of a PCI device,
+ * our probe routine is called from the PCI probe code
+ * over in dev_ns16550_pci.c
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_ioctl.h"
+
+#include "lib_physio.h"
+
+#include "bsp_config.h"
+
+#include "ns16550.h"
+
+#define WRITECSR(p,v) phys_write8((p),(v))
+#define READCSR(p) phys_read8((p))
+
+static int ns16550_uart_open(cfe_devctx_t *ctx);
+static int ns16550_uart_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int ns16550_uart_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat);
+static int ns16550_uart_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int ns16550_uart_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int ns16550_uart_close(cfe_devctx_t *ctx);
+
+void ns16550_uart_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+
+const cfe_devdisp_t ns16550_uart_dispatch = {
+ ns16550_uart_open,
+ ns16550_uart_read,
+ ns16550_uart_inpstat,
+ ns16550_uart_write,
+ ns16550_uart_ioctl,
+ ns16550_uart_close,
+ NULL,
+ NULL
+};
+
+const cfe_driver_t ns16550_uart = {
+ "NS16550 UART",
+ "uart",
+ CFE_DEV_SERIAL,
+ &ns16550_uart_dispatch,
+ ns16550_uart_probe
+};
+
+typedef struct ns16550_uart_s {
+ physaddr_t uart_base;
+ int uart_flowcontrol;
+ int uart_speed;
+} ns16550_uart_t;
+
+
+/*
+ * NS16550-compatible UART.
+ * probe_a: physical address of UART
+ */
+
+void ns16550_uart_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr)
+{
+ ns16550_uart_t *softc;
+ char descr[80];
+
+ softc = (ns16550_uart_t *) KMALLOC(sizeof(ns16550_uart_t),0);
+ if (softc) {
+ softc->uart_base = probe_a;
+ softc->uart_speed = CFG_SERIAL_BAUD_RATE;
+ softc->uart_flowcontrol = SERIAL_FLOW_NONE;
+ xsprintf(descr, "%s at 0x%X", drv->drv_description, (uint32_t)probe_a);
+
+ cfe_attach(drv, softc, NULL, descr);
+ }
+}
+
+#define DELAY(n) delay(n)
+extern int32_t _getticks(void);
+static void delay(int ticks)
+{
+ int32_t t;
+
+ t = _getticks() + ticks;
+ while (_getticks() < t)
+ ; /* NULL LOOP */
+}
+
+static void ns16550_uart_setflow(ns16550_uart_t *softc)
+{
+ /* noop for now */
+}
+
+
+static int ns16550_uart_open(cfe_devctx_t *ctx)
+{
+ ns16550_uart_t *softc = ctx->dev_softc;
+ int baudrate = CFG_SERIAL_BAUD_RATE;
+ unsigned int brtc;
+
+ brtc = BRTC(baudrate);
+
+ WRITECSR(softc->uart_base+R_UART_CFCR,CFCR_DLAB);
+ WRITECSR(softc->uart_base+R_UART_DATA,brtc & 0xFF);
+ WRITECSR(softc->uart_base+R_UART_IER,brtc>>8);
+ WRITECSR(softc->uart_base+R_UART_CFCR,CFCR_8BITS);
+ WRITECSR(softc->uart_base+R_UART_MCR,MCR_DTR | MCR_RTS | MCR_IENABLE);
+ WRITECSR(softc->uart_base+R_UART_IER,0);
+
+ WRITECSR(softc->uart_base+R_UART_FIFO,FIFO_ENABLE);
+ DELAY(100);
+ WRITECSR(softc->uart_base+R_UART_FIFO,
+ FIFO_ENABLE | FIFO_RCV_RST | FIFO_XMT_RST | FIFO_TRIGGER_1);
+ DELAY(100);
+
+ if ((READCSR(softc->uart_base+R_UART_IIR) & IIR_FIFO_MASK) != IIR_FIFO_MASK) {
+ WRITECSR(softc->uart_base+R_UART_FIFO,0);
+ }
+ ns16550_uart_setflow(softc);
+
+ return 0;
+}
+
+static int ns16550_uart_read(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ ns16550_uart_t *softc = ctx->dev_softc;
+ unsigned char *bptr;
+ int blen;
+
+ bptr = buffer->buf_ptr;
+ blen = buffer->buf_length;
+
+ while ((blen > 0) && (READCSR(softc->uart_base+R_UART_LSR) & LSR_RXRDY)) {
+ *bptr++ = (READCSR(softc->uart_base+R_UART_DATA) & 0xFF);
+ blen--;
+ }
+
+ buffer->buf_retlen = buffer->buf_length - blen;
+ return 0;
+}
+
+static int ns16550_uart_inpstat(cfe_devctx_t *ctx, iocb_inpstat_t *inpstat)
+{
+ ns16550_uart_t *softc = ctx->dev_softc;
+
+ inpstat->inp_status = (READCSR(softc->uart_base+R_UART_LSR) & LSR_RXRDY) ? 1 : 0;
+
+ return 0;
+}
+
+static int ns16550_uart_write(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ ns16550_uart_t *softc = ctx->dev_softc;
+ unsigned char *bptr;
+ int blen;
+
+ bptr = buffer->buf_ptr;
+ blen = buffer->buf_length;
+ while ((blen > 0) && (READCSR(softc->uart_base+R_UART_LSR) & LSR_TXRDY)) {
+ WRITECSR(softc->uart_base+R_UART_DATA, *bptr++);
+ blen--;
+ }
+
+ buffer->buf_retlen = buffer->buf_length - blen;
+ return 0;
+}
+
+static int ns16550_uart_ioctl(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ ns16550_uart_t *softc = ctx->dev_softc;
+
+ unsigned int *info = (unsigned int *) buffer->buf_ptr;
+
+ switch ((int)buffer->buf_ioctlcmd) {
+ case IOCTL_SERIAL_GETSPEED:
+ *info = softc->uart_speed;
+ break;
+ case IOCTL_SERIAL_SETSPEED:
+ softc->uart_speed = *info;
+ /* NYI */
+ break;
+ case IOCTL_SERIAL_GETFLOW:
+ *info = softc->uart_flowcontrol;
+ break;
+ case IOCTL_SERIAL_SETFLOW:
+ softc->uart_flowcontrol = *info;
+ ns16550_uart_setflow(softc);
+ break;
+ default:
+ return -1;
+ }
+
+ return 0;
+}
+
+static int ns16550_uart_close(cfe_devctx_t *ctx)
+{
+ ns16550_uart_t *softc = ctx->dev_softc;
+
+ WRITECSR(softc->uart_base+R_UART_MCR,0);
+
+ return 0;
+}
+
+
diff --git a/cfe/cfe/dev/dev_ns16550_pci.c b/cfe/cfe/dev/dev_ns16550_pci.c
new file mode 100644
index 0000000..021f34c
--- /dev/null
+++ b/cfe/cfe/dev/dev_ns16550_pci.c
@@ -0,0 +1,114 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * NS16550 UART driver (PCI) File: dev_ns16550_pci.c
+ *
+ * This is a console device driver for a PCI NS16550 UART
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_ioctl.h"
+
+#include "pcivar.h"
+#include "pcireg.h"
+
+
+/* Probe routine for real UART driver */
+extern void ns16550_uart_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+/* Probe routine for this UART driver. */
+static void ns16550pci_uart_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+/* We just glom onto the dispatch table in the real driver */
+extern const cfe_devdisp_t ns16550_uart_dispatch;
+
+const cfe_driver_t ns16550pci_uart = {
+ "PCI NS16550 UART",
+ "uart",
+ CFE_DEV_SERIAL,
+ &ns16550_uart_dispatch,
+ ns16550pci_uart_probe
+};
+
+
+static void ns16550pci_uart_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr)
+{
+ phys_addr_t pa;
+ pcitag_t tag;
+ int index = 0;
+
+ /*
+ * NS16550-compatible UART on the PCI bus
+ * probe_a, probe_b and probe_ptr are unused.
+ */
+
+ /*
+ * This is for a SIIG card. Should probably do a little
+ * vendor ID table like we did for the IDE driver so
+ * we can spport other cards.
+ */
+
+ for (;;) {
+
+ if (pci_find_device(0x131f,0x2000,index,&tag) != 0) {
+ break;
+ }
+
+ pci_map_io(tag, PCI_MAPREG(0), PCI_MATCH_BYTES, &pa);
+ xprintf("NS16550PCI: I/O mapped registers start at %08X", (uint32_t)pa);
+
+ ns16550_uart_probe(drv,pa,0,NULL);
+
+ index++;
+ }
+}
+
diff --git a/cfe/cfe/dev/dev_null.c b/cfe/cfe/dev/dev_null.c
new file mode 100644
index 0000000..d995919
--- /dev/null
+++ b/cfe/cfe/dev/dev_null.c
@@ -0,0 +1,142 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Null console device File: dev_null.c
+ *
+ * This is a null console device, useful for console-less
+ * operation, or when using chip simulators.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+
+static void nulldrv_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+
+static int nulldrv_open(cfe_devctx_t *ctx);
+static int nulldrv_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int nulldrv_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat);
+static int nulldrv_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int nulldrv_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int nulldrv_close(cfe_devctx_t *ctx);
+
+const static cfe_devdisp_t nulldrv_dispatch = {
+ nulldrv_open,
+ nulldrv_read,
+ nulldrv_inpstat,
+ nulldrv_write,
+ nulldrv_ioctl,
+ nulldrv_close,
+ NULL,
+ NULL
+};
+
+const cfe_driver_t nulldrv = {
+ "Null console device",
+ "null",
+ CFE_DEV_SERIAL,
+ &nulldrv_dispatch,
+ nulldrv_probe
+};
+
+
+static void nulldrv_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr)
+{
+ cfe_attach(drv,NULL,NULL,drv->drv_description);
+}
+
+
+static int nulldrv_open(cfe_devctx_t *ctx)
+{
+/* nulldrv_t *softc = ctx->dev_softc; */
+
+ return 0;
+}
+
+static int nulldrv_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+/* nulldrv_t *softc = ctx->dev_softc; */
+
+ buffer->buf_retlen = buffer->buf_length;
+ return 0;
+}
+
+static int nulldrv_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat)
+{
+/* nulldrv_t *softc = ctx->dev_softc; */
+
+ inpstat->inp_status = 0;
+
+ return 0;
+}
+
+static int nulldrv_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+/* nulldrv_t *softc = ctx->dev_softc; */
+
+ buffer->buf_retlen = buffer->buf_length;
+ return 0;
+}
+
+static int nulldrv_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+/* nulldrv_t *softc = ctx->dev_softc;*/
+
+ return -1;
+}
+
+static int nulldrv_close(cfe_devctx_t *ctx)
+{
+/* nulldrv_t *softc = ctx->dev_softc; */
+
+ return 0;
+}
+
+
diff --git a/cfe/cfe/dev/dev_promice.c b/cfe/cfe/dev/dev_promice.c
new file mode 100644
index 0000000..fe79086
--- /dev/null
+++ b/cfe/cfe/dev/dev_promice.c
@@ -0,0 +1,402 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * PromICE console device File: dev_promice.c
+ *
+ * This device driver supports Grammar Engine's PromICE AI2
+ * serial communications options. With this console, you can
+ * communicate with the firmware using only uncached reads in the
+ * boot ROM space. See Grammar Engine's PromICE manuals
+ * for more information at http://www.gei.com
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+/*
+ * Example PromICE initialization file:
+ *
+ * -----------------------
+ * output=com1
+ * pponly=lpt1
+ * rom=27040
+ * word=8
+ * file=cfe.srec
+ * ailoc 7FC00,9600
+ * -----------------------
+ *
+ * The offset specified in the 'ailoc' line must be the location where you
+ * will configure the AI2 serial port. In this example, the ROM is assumed
+ * to be 512KB, and the AI2 serial port is at 511KB, or offset 0x7FC00.
+ * This area is filled with 0xCC to detect AI2's initialization sequence
+ * properly (see the PromICE manual). You should connect your
+ * PromICE's serial port up to the PC and run a terminal emulator on it.
+ * The parallel port will be used for downloading data to the PromICE.
+ *
+ * If you have connected the write line to the PromICE, then you can
+ * define the _AIDIRT_ symbol to increase performance.
+ */
+
+
+
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "addrspace.h"
+
+#define _AIDIRT_
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+static void promice_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+
+static int promice_open(cfe_devctx_t *ctx);
+static int promice_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int promice_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat);
+static int promice_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int promice_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int promice_close(cfe_devctx_t *ctx);
+
+/* *********************************************************************
+ * Device dispatch table
+ ********************************************************************* */
+
+const static cfe_devdisp_t promice_dispatch = {
+ promice_open,
+ promice_read,
+ promice_inpstat,
+ promice_write,
+ promice_ioctl,
+ promice_close,
+ NULL,
+ NULL
+};
+
+/* *********************************************************************
+ * Device descriptor
+ ********************************************************************* */
+
+const cfe_driver_t promice_uart = {
+ "PromICE AI2 Serial Port",
+ "promice",
+ CFE_DEV_SERIAL,
+ &promice_dispatch,
+ promice_probe
+};
+
+/* *********************************************************************
+ * Local constants and structures
+ ********************************************************************* */
+
+/*
+ * If your PromICE is connected to a 32-bit host (emulating four
+ * flash ROMs) and the SB1250 is set to boot from that host, define
+ * the PROMICE_32BITS symbol to make sure the AI2 interface is
+ * configured correctly.
+ */
+
+/*#define PROMICE_32BITS*/
+
+#ifdef PROMICE_32BITS
+#define WORDSIZE 4
+#define WORDTYPE uint32_t
+#else
+#define WORDSIZE 1
+#define WORDTYPE uint8_t
+#endif
+
+
+#define ZERO_OFFSET (0)
+#define ONE_OFFSET (1)
+#define DATA_OFFSET (2)
+#define STATUS_OFFSET (3)
+
+#define TDA 0x01 /* Target data available */
+#define HDA 0x02 /* Host data available */
+#define OVR 0x04 /* Host data overflow */
+
+typedef struct promice_s {
+ unsigned long ai2_addr;
+ unsigned int ai2_wordsize;
+ volatile WORDTYPE *zero;
+ volatile WORDTYPE *one;
+ volatile WORDTYPE *data;
+ volatile WORDTYPE *status;
+} promice_t;
+
+
+/* *********************************************************************
+ * promice_probe(drv,probe_a,probe_b,probe_ptr)
+ *
+ * Device "Probe" routine. This routine creates the soft
+ * context for the device and calls the attach routine.
+ *
+ * Input parameters:
+ * drv - driver structure
+ * probe_a,probe_b,probe_ptr - probe args
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+
+static void promice_probe(cfe_driver_t *drv,
+ unsigned long probe_a,
+ unsigned long probe_b,
+ void *probe_ptr)
+{
+ promice_t *softc;
+ char descr[80];
+
+ /*
+ * probe_a is the address in the ROM of the AI2 interface
+ * on the PromICE.
+ * probe_b is the word size (1,2,4)
+ */
+
+ softc = (promice_t *) KMALLOC(sizeof(promice_t),0);
+ if (softc) {
+ softc->ai2_addr = probe_a;
+ if (probe_b) softc->ai2_wordsize = probe_b;
+ else softc->ai2_wordsize = WORDSIZE;
+ xsprintf(descr,"%s at 0x%X",drv->drv_description,probe_a);
+ cfe_attach(drv,softc,NULL,descr);
+ }
+}
+
+
+
+/* *********************************************************************
+ * promice_open(ctx)
+ *
+ * Open the device
+ *
+ * Input parameters:
+ * ctx - device context
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+static int promice_open(cfe_devctx_t *ctx)
+{
+ promice_t *softc = ctx->dev_softc;
+ uint8_t dummy;
+
+ softc->zero = (volatile WORDTYPE *)
+ UNCADDR(softc->ai2_addr + (ZERO_OFFSET*softc->ai2_wordsize));
+ softc->one = (volatile WORDTYPE *)
+ UNCADDR(softc->ai2_addr + (ONE_OFFSET*softc->ai2_wordsize));
+ softc->data = (volatile WORDTYPE *)
+ UNCADDR(softc->ai2_addr + (DATA_OFFSET*softc->ai2_wordsize));
+ softc->status = (volatile WORDTYPE *)
+ UNCADDR(softc->ai2_addr + (STATUS_OFFSET*softc->ai2_wordsize));
+
+ /*
+ * Wait for bit 3 to clear so we know the interface is ready.
+ */
+
+ while (*(softc->status) == 0xCC) ; /* NULL LOOP */
+
+ /*
+ * a dummy read is required to clear out the interface.
+ */
+
+ dummy = *(softc->data);
+
+ return 0;
+}
+
+/* *********************************************************************
+ * promice_read(ctx,buffer)
+ *
+ * Read data from the device
+ *
+ * Input parameters:
+ * ctx - device context
+ * buffer - I/O buffer descriptor
+ *
+ * Return value:
+ * number of bytes transferred, or <0 if error
+ ********************************************************************* */
+static int promice_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ promice_t *softc = ctx->dev_softc;
+ unsigned char *bptr;
+ int blen;
+
+ bptr = buffer->buf_ptr;
+ blen = buffer->buf_length;
+
+ while ((blen > 0) && (*(softc->status) & HDA)) {
+ *bptr++ = *(softc->data);
+ blen--;
+ }
+
+ buffer->buf_retlen = buffer->buf_length - blen;
+ return 0;
+}
+
+/* *********************************************************************
+ * promice_inpstat(ctx,inpstat)
+ *
+ * Determine if read data is available
+ *
+ * Input parameters:
+ * ctx - device context
+ * inpstat - input status structure
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+static int promice_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat)
+{
+ promice_t *softc = ctx->dev_softc;
+
+ inpstat->inp_status = (*(softc->status) & HDA) ? 1 : 0;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * promice_write(ctx,buffer)
+ *
+ * Write data to the device
+ *
+ * Input parameters:
+ * ctx - device context
+ * buffer - I/O buffer descriptor
+ *
+ * Return value:
+ * number of bytes transferred, or <0 if error
+ ********************************************************************* */
+static int promice_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ promice_t *softc = ctx->dev_softc;
+ unsigned char *bptr;
+ int blen;
+ uint8_t data;
+#ifndef _AIDIRT_
+ uint8_t dummy;
+ int count;
+#endif
+
+ bptr = buffer->buf_ptr;
+ blen = buffer->buf_length;
+
+
+ /*
+ * The AI2 interface requires you to transmit characters
+ * one bit at a time. First a '1' start bit,
+ * then 8 data bits (lsb first) then another '1' stop bit.
+ *
+ * Just reference the right memory location to transmit a bit.
+ */
+
+ while ((blen > 0) && !(*(softc->status) & TDA)) {
+
+#ifdef _AIDIRT_
+ data = *bptr++;
+ *(softc->zero) = data;
+#else
+ dummy = *(softc->one); /* send start bit */
+
+ data = *bptr++;
+
+ for (count = 0; count < 8; count++) {
+ if (data & 1) dummy = *(softc->one);
+ else dummy = *(softc->zero);
+ data >>= 1; /* shift in next bit */
+ }
+
+ dummy = *(softc->one); /* send stop bit */
+#endif
+
+ blen--;
+ }
+
+ buffer->buf_retlen = buffer->buf_length - blen;
+ return 0;
+}
+
+/* *********************************************************************
+ * promice_ioctl(ctx,buffer)
+ *
+ * Do I/O control operations
+ *
+ * Input parameters:
+ * ctx - device context
+ * buffer - I/O control args
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int promice_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ return -1;
+}
+
+/* *********************************************************************
+ * promice_close(ctx)
+ *
+ * Close the device.
+ *
+ * Input parameters:
+ * ctx - device context
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+static int promice_close(cfe_devctx_t *ctx)
+{
+ return 0;
+}
+
+
diff --git a/cfe/cfe/dev/dev_sp1011.c b/cfe/cfe/dev/dev_sp1011.c
new file mode 100644
index 0000000..8e0d16b
--- /dev/null
+++ b/cfe/cfe/dev/dev_sp1011.c
@@ -0,0 +1,151 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * SP1011 (Sturgeon) Support File: dev_sp1011.c
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "lib_types.h"
+
+#include "pcireg.h"
+#include "pcivar.h"
+
+extern int eoi_implemented;
+
+void sturgeon_setup (pcitag_t tag, pci_flags_t flags);
+
+
+/* Sturgeon LDT-to-PCI bridge (LPB) specific definitions. */
+
+#define PCI_VENDOR_API 0x14d9
+#define PCI_PRODUCT_API_STURGEON 0x0010
+
+/* Sturgeon specific registers */
+#define LPB_READ_CTRL_REG 0x60
+#define LPB_READ_CTRL_MASK 0xffffff
+
+#define LPB_READ_CTRL_PREF_EN (1 << 0)
+#define LPB_READ_CTRL_RD_PREF_EN (1 << 1)
+#define LPB_READ_CTRL_MULT_PREF_SHIFT 2
+#define LPB_READ_CTRL_MULT_PREF_MASK (7 << LPB_READ_CTRL_MULT_PREF_SHIFT)
+#define LPB_READ_CTRL_LINE_PREF_SHIFT 5
+#define LPB_READ_CTRL_LINE_PREF_MASK (7 << LPB_READ_CTRL_LINE_PREF_SHIFT)
+#define LPB_READ_CTRL_DEL_REQ_SHIFT 8
+#define LPB_READ_CTRL_DEL_REQ_MASK (3 << LPB_READ_CTRL_DEL_REQ_SHIFT)
+
+#define LPB_INT_CTRL_BASE 0xa0
+
+#define LPB_INT_CTRL_ENABLE (1 << 15)
+#define LPB_INT_CTRL_DESTMODE (1 << 14)
+#define LPB_INT_CTRL_DEST_SHIFT 6
+#define LPB_INT_CTRL_DEST_MASK (0xff << LPB_INT_CTRL_DEST_SHIFT)
+#define LPB_INT_CTRL_MSGTYPE_SHIFT 4
+#define LPB_INT_CTRL_MSGTYPE_MASK (0x3 << LPB_INT_CTRL_MSGTYPE_SHIFT)
+#define LPB_INT_CTRL_POLARITY (1 << 3)
+#define LPB_INT_CTRL_TRIGGERMODE (1 << 2)
+#define LPB_INT_CTRL_VECTOR_SHIFT 0
+#define LPB_INT_CTRL_VECTOR_MASK (0x3 << 0)
+
+#define LPB_INT_BLOCK1_REG 0xc4
+
+void
+sturgeon_setup (pcitag_t tag, pci_flags_t flags)
+{
+ int bus, device, function;
+ int secondary;
+ struct pci_bus *pb;
+ unsigned offset;
+ pcireg_t t, ctrl, intmap;
+
+ pci_break_tag(tag, &bus, &device, &function);
+
+ secondary = (pci_conf_read(tag, PPB_BUSINFO_REG) >> 8) & 0xff;
+ pb = &_pci_bus[secondary];
+
+ /* set up READ CONTROL register for selected prefetch option */
+ ctrl = pci_conf_read(tag, LPB_READ_CTRL_REG) & ~LPB_READ_CTRL_MASK;
+ if ((flags & PCI_FLG_LDT_PREFETCH) != 0) {
+ /* Prefetch enable: all cycle types, 2 delayed requests,
+ 4 lines of fetch ahead for MemRdMult */
+ ctrl |= (LPB_READ_CTRL_PREF_EN
+ | LPB_READ_CTRL_RD_PREF_EN
+ | (3 << LPB_READ_CTRL_MULT_PREF_SHIFT)
+ | (1 << LPB_READ_CTRL_DEL_REQ_SHIFT));
+ } else {
+ /* No prefetch */
+ ctrl |= 0;
+ }
+ pci_conf_write(tag, LPB_READ_CTRL_REG, ctrl);
+
+ /* It's apparently not possible for software to distinguish
+ the CSWARM's debug Sturgeon (which has floating interrupt
+ inputs), so we route interrupts only if there are secondary
+ devices. */
+ if (pb->ndev > 0) {
+ /* Setup interrupt mapping for Block 1:
+ Enabled, Dest=Logical (CPU 0 + CPU 1), Type=Fixed */
+ intmap = (LPB_INT_CTRL_ENABLE |
+ LPB_INT_CTRL_DESTMODE | /* Logical */
+ (0x3 << LPB_INT_CTRL_DEST_SHIFT) | /* CPU 0+1 */
+ (0x0 << LPB_INT_CTRL_MSGTYPE_SHIFT)); /* Fixed */
+ if (eoi_implemented) {
+ /* Passes >=2 have working EOI. Trigger=Level */
+ intmap |= LPB_INT_CTRL_TRIGGERMODE; /* Level */
+ } else {
+ /* Pass 1 lacks working EOI. Trigger=Edge */
+ intmap |= 0; /* Edge */
+ }
+
+ offset = pb->inta_shift % 4;
+ t = (intmap + offset);
+ offset = (offset+1) % 4;
+ t |= (intmap + offset) << 16;
+ pci_conf_write(tag, LPB_INT_CTRL_BASE + 8, t);
+
+ offset = (offset+1) % 4;
+ t = (intmap + offset);
+ offset = (offset+1) % 4;
+ t |= (intmap + offset) << 16;
+ pci_conf_write(tag, LPB_INT_CTRL_BASE + 12, t);
+
+ t = pci_conf_read(tag, LPB_INT_BLOCK1_REG);
+ t &= 0xffffff00;
+ t |= (0x40 | (56 >> 2));
+ pci_conf_write(tag, LPB_INT_BLOCK1_REG, t);
+ }
+}
diff --git a/cfe/cfe/dev/dev_tulip.c b/cfe/cfe/dev/dev_tulip.c
new file mode 100644
index 0000000..dec6b56
--- /dev/null
+++ b/cfe/cfe/dev/dev_tulip.c
@@ -0,0 +1,2985 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * DC21x4x Ethernet Driver File: dev_tulip.c
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "sbmips.h"
+
+#ifndef _SB_MAKE64
+#define _SB_MAKE64(x) ((uint64_t)(x))
+#endif
+#ifndef _SB_MAKEMASK1
+#define _SB_MAKEMASK1(n) (_SB_MAKE64(1) << _SB_MAKE64(n))
+#endif
+
+#include "lib_types.h"
+#include "lib_hssubr.h"
+#include "lib_malloc.h"
+#include "lib_string.h"
+#define blockcopy memcpy
+#include "lib_printf.h"
+#include "lib_queue.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_ioctl.h"
+#include "cfe_timer.h"
+#include "cfe_error.h"
+#include "cfe_irq.h"
+
+#include "pcivar.h"
+#include "pcireg.h"
+
+#include "dc21143.h"
+#include "mii.h"
+
+/* This is a driver for specific configurations of the DC21040, DC21041,
+ DC21140A and DC21143, not a generic Tulip driver. The prefix
+ "tulip_" is used to indicate generic Tulip functions, while
+ "dc21040_", "dc21041_", "dc21140_" or "dc21143_" indicates functions
+ specific to a chip variant.
+
+ The 21041 driver assumes a 10BT HD interface, since autonegotiation
+ is known to be broken in the early revisons of that chip. Example
+ cards come from DEC and SMC. Essentially the same driver is used
+ for 21040 cards.
+
+ The 21140 driver assumes that the PHY uses a standard MII interface
+ for both 100BT and 10BT. Example cards come from DEC (National DP83840
+ plus Twister PHY) and Netgear (Level One PHY).
+
+ Some early 21140 boards are exceptions and use SYM plus SRL
+ with different PHY chips for 10 and 100 (limited support).
+
+ The 21143 driver assumes by default that the PHY uses the SYM ("5
+ wire") interface for 100BT with pass-through for 10BT. Example
+ cards come from DEC (MicroLinear ML6694 PHY) and Znyx (QS6611 or
+ Kendin KS8761 PHY). It also supports an MII interface for
+ recognized adapters. An example card comes from Adaptec (National
+ DP83840A and Twister PHY). There is no support for AUI interfaces.
+
+ This SB1250 version takes advantage of DMA coherence and uses
+ "preserve bit lanes" addresses for all accesses that cross the
+ ZBbus-PCI bridge. */
+
+#ifndef TULIP_DEBUG
+#define TULIP_DEBUG 0
+#endif
+
+#ifndef TULIP_TUNE
+#define TULIP_TUNE 1
+#endif
+
+/* Set IPOLL to drive processing through the pseudo-interrupt
+ dispatcher. Set XPOLL to drive processing by an external polling
+ agent. Setting both is ok. */
+
+#ifndef IPOLL
+#define IPOLL 0
+#endif
+#ifndef XPOLL
+#define XPOLL 1
+#endif
+
+#define ENET_ADDR_LEN 6 /* size of an ethernet address */
+#define MAX_ETHER_PACK 1518 /* max size of a packet */
+#define CRC_SIZE 4 /* size of CRC field */
+
+/* Packet buffers. For tulip, the packet must be aligned to a 32-bit
+ word boundary, and we would like it aligned to a cache line
+ boundary for performance. */
+
+#define CACHE_ALIGN 32
+
+#if __long64
+typedef struct eth_pkt_s {
+ queue_t next; /* 16 */
+ uint8_t *buffer; /* 8 */
+ uint32_t flags; /* 4 */
+ int32_t length; /* 4 */
+ uint8_t data[MAX_ETHER_PACK];
+} eth_pkt_t;
+#else
+typedef struct eth_pkt_s {
+ queue_t next; /* 8 */
+ uint8_t *buffer; /* 4 */
+ uint32_t flags; /* 4 */
+ int32_t length; /* 4 */
+ uint32_t unused[3]; /* 12 */
+ uint8_t data[MAX_ETHER_PACK];
+} eth_pkt_t;
+#endif
+
+#define ETH_PKTBUF_LINES ((sizeof(eth_pkt_t) + (CACHE_ALIGN-1))/CACHE_ALIGN)
+#define ETH_PKTBUF_SIZE (ETH_PKTBUF_LINES*CACHE_ALIGN)
+#define ETH_PKTBUF_OFFSET (offsetof(eth_pkt_t, data))
+
+#define ETH_PKT_BASE(data) ((eth_pkt_t *)((data) - ETH_PKTBUF_OFFSET))
+
+/* packet flags */
+#define ETH_TX_SETUP 1 /* assumes Perfect Filtering format */
+
+static void
+show_packet(char c, eth_pkt_t *pkt)
+{
+ int i;
+ int n = (pkt->length < 32 ? pkt->length : 32);
+
+ xprintf("%c[%4d]:", c, pkt->length);
+ for (i = 0; i < n; i++) {
+ if (i % 4 == 0)
+ xprintf(" ");
+ xprintf("%02x", pkt->buffer[i]);
+ }
+ xprintf("\n");
+}
+
+
+/* Descriptor structures */
+
+typedef struct rx_dscr {
+ uint32_t rxd_flags;
+ uint32_t rxd_bufsize;
+ pci_addr_t rxd_bufaddr1;
+ pci_addr_t rxd_bufaddr2;
+} rx_dscr;
+
+typedef struct tx_dscr {
+ uint32_t txd_flags;
+ uint32_t txd_bufsize;
+ pci_addr_t txd_bufaddr1;
+ pci_addr_t txd_bufaddr2;
+} tx_dscr;
+
+/* CAM structure */
+
+typedef union {
+ struct {
+ uint32_t physical[CAM_PERFECT_ENTRIES][3];
+ } p;
+ struct {
+ uint32_t hash[32];
+ uint32_t mbz[7];
+ uint32_t physical[3];
+ } h;
+} tulip_cam;
+
+
+/* Driver data structures */
+
+typedef enum {
+ eth_state_uninit,
+ eth_state_setup,
+ eth_state_off,
+ eth_state_on,
+ eth_state_broken
+} eth_state_t;
+
+#define ETH_PKTPOOL_SIZE 32
+#define ETH_PKT_SIZE MAX_ETHER_PACK
+
+typedef struct tulip_softc {
+ uint32_t membase;
+ uint8_t irq; /* interrupt mapping (used if IPOLL) */
+ pcitag_t tag; /* tag for configuration registers */
+
+ uint8_t hwaddr[ENET_ADDR_LEN];
+ uint16_t device; /* chip device code */
+ uint8_t revision; /* chip revision and step (Table 3-7) */
+
+ /* current state */
+ eth_state_t state;
+
+ /* These fields are the chip startup values. */
+// uint16_t media; /* media type */
+ uint32_t opmode; /* operating mode */
+ uint32_t intmask; /* interrupt mask */
+ uint32_t gpdata; /* output bits for csr15 (21143) */
+
+ /* These fields are set before calling dc21x4x_hwinit */
+ int linkspeed; /* encodings from cfe_ioctl */
+ int loopback;
+
+ /* Packet free list */
+ queue_t freelist;
+ uint8_t *pktpool;
+ queue_t rxqueue;
+
+ /* The descriptor tables */
+ uint8_t *rxdscrmem; /* receive descriptors */
+ uint8_t *txdscrmem; /* transmit descriptors */
+
+ /* These fields keep track of where we are in tx/rx processing */
+ volatile rx_dscr *rxdscr_start; /* beginning of ring */
+ volatile rx_dscr *rxdscr_end; /* end of ring */
+ volatile rx_dscr *rxdscr_remove; /* next one we expect tulip to use */
+ volatile rx_dscr *rxdscr_add; /* next place to put a buffer */
+ int rxdscr_onring;
+
+ volatile tx_dscr *txdscr_start; /* beginning of ring */
+ volatile tx_dscr *txdscr_end; /* end of ring */
+ volatile tx_dscr *txdscr_remove; /* next one we will use for tx */
+ volatile tx_dscr *txdscr_add; /* next place to put a buffer */
+
+ cfe_devctx_t *devctx;
+
+ /* These fields describe the PHY */
+ enum {SRL, MII, SYM} phy_type;
+ int mii_addr;
+
+ /* Statistics */
+ uint32_t inpkts;
+ uint32_t outpkts;
+ uint32_t interrupts;
+ uint32_t rx_interrupts;
+ uint32_t tx_interrupts;
+ uint32_t bus_errors;
+} tulip_softc;
+
+
+/* Entry to and exit from critical sections (currently relative to
+ interrupts only, not SMP) */
+
+#if CFG_INTERRUPTS
+#define CS_ENTER(sc) cfe_disable_irq(sc->irq)
+#define CS_EXIT(sc) cfe_enable_irq(sc->irq)
+#else
+#define CS_ENTER(sc) ((void)0)
+#define CS_EXIT(sc) ((void)0)
+#endif
+
+
+/* Driver parameterization */
+
+#define MAXRXDSCR 32
+#define MAXTXDSCR 32
+#define MINRXRING 8
+
+#define MEDIA_UNKNOWN 0
+#define MEDIA_AUI 1
+#define MEDIA_BNC 2
+#define MEDIA_UTP_FULL_DUPLEX 3
+#define MEDIA_UTP_NO_LINK_TEST 4
+#define MEDIA_UTP 5
+
+/* Prototypes */
+
+static void tulip_ether_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+
+/* Address mapping macros */
+
+/* Note that PTR_TO_PHYS only works with 32-bit addresses, but then
+ so does the Tulip. */
+#define PTR_TO_PHYS(x) (K0_TO_PHYS((uintptr_t)(x)))
+#define PHYS_TO_PTR(a) ((uint8_t *)PHYS_TO_K0(a))
+
+/* All mappings through the PCI host bridge use match bits mode. */
+#define PHYS_TO_PCI(a) ((uint32_t) (a) | 0x20000000)
+#define PCI_TO_PHYS(a) ((uint32_t) (a) & 0x1FFFFFFF)
+
+#define PCI_TO_PTR(a) (PHYS_TO_PTR(PCI_TO_PHYS(a)))
+#define PTR_TO_PCI(x) (PHYS_TO_PCI(PTR_TO_PHYS(x)))
+
+#if __long64
+#define READCSR(sc,csr) \
+ (*((volatile uint32_t *) (PHYS_TO_XKSEG_UNCACHED((sc)->membase + (csr)))))
+
+#define WRITECSR(sc,csr,val) \
+ (*((volatile uint32_t *) \
+ (PHYS_TO_XKSEG_UNCACHED((sc)->membase + (csr)))) = (val))
+
+#else
+#define READCSR(sc,csr) \
+ (hs_read32(PHYS_TO_XKSEG_UNCACHED((sc)->membase + (csr))))
+
+#define WRITECSR(sc,csr,val) \
+ (hs_write32(PHYS_TO_XKSEG_UNCACHED((sc)->membase + (csr)), (val)))
+
+#endif
+
+#define RESET_ADAPTER(sc) \
+ { \
+ WRITECSR((sc), R_CSR_BUSMODE, M_CSR0_SWRESET); \
+ cfe_sleep(CFE_HZ/10); \
+ }
+
+
+/* Debugging */
+
+static void
+dumpstat(tulip_softc *sc)
+{
+ xprintf("-- CSR 5 = %08X CSR 6 = %08x\n",
+ READCSR(sc, R_CSR_STATUS), READCSR(sc, R_CSR_OPMODE));
+}
+
+static void
+dumpcsrs(tulip_softc *sc)
+{
+ int idx;
+
+ xprintf("-------------\n");
+ for (idx = 0; idx < 16; idx++) {
+ xprintf("CSR %2d = %08X\n", idx, READCSR(sc, idx*8));
+ }
+ xprintf("-------------\n");
+}
+
+
+/* Packet management */
+
+/* *********************************************************************
+ * ETH_ALLOC_PKT(sc)
+ *
+ * Allocate a packet from the free list.
+ *
+ * Input parameters:
+ * sc - eth structure
+ *
+ * Return value:
+ * pointer to packet structure, or NULL if none available
+ ********************************************************************* */
+static eth_pkt_t *
+eth_alloc_pkt(tulip_softc *sc)
+{
+ eth_pkt_t *pkt;
+
+ CS_ENTER(sc);
+ pkt = (eth_pkt_t *) q_deqnext(&sc->freelist);
+ CS_EXIT(sc);
+ if (!pkt) return NULL;
+
+ pkt->buffer = pkt->data;
+ pkt->length = ETH_PKT_SIZE;
+ pkt->flags = 0;
+
+ return pkt;
+}
+
+
+/* *********************************************************************
+ * ETH_FREE_PKT(sc,pkt)
+ *
+ * Return a packet to the free list
+ *
+ * Input parameters:
+ * sc - sbmac structure
+ * pkt - packet to return
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+static void
+eth_free_pkt(tulip_softc *sc, eth_pkt_t *pkt)
+{
+ CS_ENTER(sc);
+ q_enqueue(&sc->freelist, &pkt->next);
+ CS_EXIT(sc);
+}
+
+
+/* *********************************************************************
+ * ETH_INITFREELIST(sc)
+ *
+ * Initialize the buffer free list for this mac. The memory
+ * allocated to the free list is carved up and placed on a linked
+ * list of buffers for use by the mac.
+ *
+ * Input parameters:
+ * sc - eth structure
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+static void
+eth_initfreelist(tulip_softc *sc)
+{
+ int idx;
+ uint8_t *ptr;
+ eth_pkt_t *pkt;
+
+ q_init(&sc->freelist);
+
+ ptr = sc->pktpool;
+ for (idx = 0; idx < ETH_PKTPOOL_SIZE; idx++) {
+ pkt = (eth_pkt_t *) ptr;
+ eth_free_pkt(sc, pkt);
+ ptr += ETH_PKTBUF_SIZE;
+ }
+}
+
+
+/* Utilities */
+
+static const char *
+tulip_devname(tulip_softc *sc)
+{
+ return (sc->devctx != NULL ? cfe_device_name(sc->devctx) : "eth?");
+}
+
+
+/* Descriptor ring management */
+
+static int
+tulip_add_rcvbuf(tulip_softc *sc, eth_pkt_t *pkt)
+{
+ volatile rx_dscr *rxd;
+ volatile rx_dscr *nextrxd;
+ uint32_t flags = 0;
+
+ rxd = sc->rxdscr_add;
+
+ /* Figure out where the next descriptor will go */
+ nextrxd = rxd+1;
+ if (nextrxd == sc->rxdscr_end) {
+ nextrxd = sc->rxdscr_start;
+ flags = M_RDES1_ENDOFRING;
+ }
+
+ /*
+ * If the next one is the same as our remove pointer,
+ * the ring is considered full. (it actually has room for
+ * one more, but we reserve the remove == add case for "empty")
+ */
+ if (nextrxd == sc->rxdscr_remove) return -1;
+
+ rxd->rxd_bufsize = V_RDES1_BUF1SIZE(1520) | flags;
+ rxd->rxd_bufaddr1 = PTR_TO_PCI(pkt->buffer);
+ rxd->rxd_bufaddr2 = 0;
+ rxd->rxd_flags = M_RDES0_OWNADAP;
+
+ /* success, advance the pointer */
+ sc->rxdscr_add = nextrxd;
+ CS_ENTER(sc);
+ sc->rxdscr_onring++;
+ CS_EXIT(sc);
+
+ return 0;
+}
+
+static void
+tulip_fillrxring(tulip_softc *sc)
+{
+ eth_pkt_t *pkt;
+
+ while (1) {
+ CS_ENTER(sc);
+ if (sc->rxdscr_onring >= MINRXRING) {
+ CS_EXIT(sc);
+ break;
+ }
+ CS_EXIT(sc);
+ pkt = eth_alloc_pkt(sc);
+ if (pkt == NULL) {
+ /* could not allocate a buffer */
+ break;
+ }
+ if (tulip_add_rcvbuf(sc, pkt) != 0) {
+ /* could not add buffer to ring */
+ eth_free_pkt(sc, pkt);
+ break;
+ }
+ }
+}
+
+
+/* *********************************************************************
+ * TULIP_RX_CALLBACK(sc, pkt)
+ *
+ * Receive callback routine. This routine is invoked when a
+ * buffer queued for receives is filled. In this simple driver,
+ * all we do is add the packet to a per-MAC queue for later
+ * processing, and try to put a new packet in the place of the one
+ * that was removed from the queue.
+ *
+ * Input parameters:
+ * sc - interface
+ * ptk - packet context (eth_pkt structure)
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+static void
+tulip_rx_callback(tulip_softc *sc, eth_pkt_t *pkt)
+{
+ if (TULIP_DEBUG) show_packet('>', pkt); /* debug */
+
+ CS_ENTER(sc);
+ q_enqueue(&sc->rxqueue, &pkt->next);
+ CS_EXIT(sc);
+ sc->inpkts++;
+
+ tulip_fillrxring(sc);
+}
+
+
+static void
+tulip_procrxring(tulip_softc *sc)
+{
+ volatile rx_dscr *rxd;
+ eth_pkt_t *pkt;
+ eth_pkt_t *newpkt;
+ uint32_t flags;
+
+ for (;;) {
+ rxd = (volatile rx_dscr *) sc->rxdscr_remove;
+
+ flags = rxd->rxd_flags;
+ if (flags & M_RDES0_OWNADAP) {
+ /* end of ring, no more packets */
+ break;
+ }
+
+ pkt = ETH_PKT_BASE(PCI_TO_PTR(rxd->rxd_bufaddr1));
+
+ /* Drop error packets */
+ if (flags & M_RDES0_ERRORSUM) {
+ xprintf("%s: rx error %04X\n", tulip_devname(sc), flags & 0xFFFF);
+ tulip_add_rcvbuf(sc, pkt);
+ goto next;
+ }
+
+ /* Pass up the packet */
+ pkt->length = G_RDES0_FRAMELEN(flags) - CRC_SIZE;
+ tulip_rx_callback(sc, pkt);
+
+ /* put a buffer back on the ring to replace this one */
+ newpkt = eth_alloc_pkt(sc);
+ if (newpkt) tulip_add_rcvbuf(sc, newpkt);
+
+next:
+ /* update the pointer, accounting for buffer wrap. */
+ rxd++;
+ if (rxd == sc->rxdscr_end)
+ rxd = sc->rxdscr_start;
+
+ sc->rxdscr_remove = (rx_dscr *) rxd;
+ CS_ENTER(sc);
+ sc->rxdscr_onring--;
+ CS_EXIT(sc);
+ }
+}
+
+
+static int
+tulip_add_txbuf(tulip_softc *sc, eth_pkt_t *pkt)
+{
+ volatile tx_dscr *txd;
+ volatile tx_dscr *nexttxd;
+ uint32_t bufsize = 0;
+
+ txd = sc->txdscr_add;
+
+ /* Figure out where the next descriptor will go */
+ nexttxd = (txd+1);
+ if (nexttxd == sc->txdscr_end) {
+ nexttxd = sc->txdscr_start;
+ bufsize = M_TDES1_ENDOFRING;
+ }
+
+ /* If the next one is the same as our remove pointer,
+ the ring is considered full. (it actually has room for
+ one more, but we reserve the remove == add case for "empty") */
+
+ if (nexttxd == sc->txdscr_remove) return -1;
+
+ bufsize |= V_TDES1_BUF1SIZE(pkt->length) |
+ M_TDES1_FIRSTSEG | M_TDES1_LASTSEG | M_TDES1_INTERRUPT;
+ if (pkt->flags & ETH_TX_SETUP) {
+ /* For a setup packet, FIRSTSEG and LASTSEG should be clear (!) */
+ bufsize ^= M_TDES1_SETUP | M_TDES1_FIRSTSEG | M_TDES1_LASTSEG;
+ }
+ txd->txd_bufsize = bufsize;
+ txd->txd_bufaddr1 = PTR_TO_PCI(pkt->buffer);
+ txd->txd_bufaddr2 = 0;
+ txd->txd_flags = M_TDES0_OWNADAP;
+
+ /* success, advance the pointer */
+ sc->txdscr_add = nexttxd;
+
+ return 0;
+}
+
+
+static int
+tulip_transmit(tulip_softc *sc,eth_pkt_t *pkt)
+{
+ int rv;
+
+ if (TULIP_DEBUG) show_packet('<', pkt); /* debug */
+
+ rv = tulip_add_txbuf(sc, pkt);
+ sc->outpkts++;
+
+ WRITECSR(sc, R_CSR_TXPOLL, 1);
+ return rv;
+}
+
+
+static void
+tulip_proctxring(tulip_softc *sc)
+{
+ volatile tx_dscr *txd;
+ eth_pkt_t *pkt;
+ uint32_t flags;
+
+ for (;;) {
+ txd = (volatile tx_dscr *) sc->txdscr_remove;
+
+ if (txd == sc->txdscr_add) {
+ /* ring is empty, no buffers to process */
+ break;
+ }
+
+ flags = txd->txd_flags;
+ if (flags & M_TDES0_OWNADAP) {
+ /* Reached a packet still being transmitted */
+ break;
+ }
+
+ /* Check for a completed setup packet */
+ pkt = ETH_PKT_BASE(PCI_TO_PTR(txd->txd_bufaddr1));
+ if (pkt->flags & ETH_TX_SETUP) {
+ if (sc->state == eth_state_setup) {
+ uint32_t opmode;
+
+ /* check flag bits */
+ opmode = READCSR(sc, R_CSR_OPMODE);
+ opmode |= M_CSR6_RXSTART;
+ WRITECSR(sc, R_CSR_OPMODE, opmode);
+ sc->inpkts = sc->outpkts = 0;
+ sc->state =eth_state_on;
+ }
+ pkt->flags &=~ ETH_TX_SETUP;
+ }
+
+ /* Just free the packet */
+ eth_free_pkt(sc, pkt);
+
+ /* update the pointer, accounting for buffer wrap. */
+ txd++;
+ if (txd == sc->txdscr_end)
+ txd = sc->txdscr_start;
+
+ sc->txdscr_remove = (tx_dscr *) txd;
+ }
+}
+
+
+static void
+tulip_initrings(tulip_softc *sc)
+{
+ volatile tx_dscr *txd;
+ volatile rx_dscr *rxd;
+
+ /* Claim ownership of all descriptors for the driver */
+
+ for (txd = sc->txdscr_start; txd != sc->txdscr_end; txd++)
+ txd->txd_flags = 0;
+ for (rxd = sc->rxdscr_start; rxd != sc->rxdscr_end; rxd++)
+ rxd->rxd_flags = 0;
+
+ /* Init the ring pointers */
+
+ sc->txdscr_add = sc->txdscr_remove = sc->txdscr_start;
+ sc->rxdscr_add = sc->rxdscr_remove = sc->rxdscr_start;
+ sc->rxdscr_onring = 0;
+
+ /* Add stuff to the receive ring */
+
+ tulip_fillrxring(sc);
+}
+
+
+static int
+tulip_init(tulip_softc *sc)
+{
+ /* Allocate descriptor rings */
+ sc->rxdscrmem = KMALLOC(MAXRXDSCR*sizeof(rx_dscr), sizeof(rx_dscr));
+ sc->txdscrmem = KMALLOC(MAXTXDSCR*sizeof(tx_dscr), sizeof(tx_dscr));
+
+ /* Allocate buffer pool */
+ sc->pktpool = KMALLOC(ETH_PKTPOOL_SIZE*ETH_PKTBUF_SIZE, CACHE_ALIGN);
+ eth_initfreelist(sc);
+ q_init(&sc->rxqueue);
+
+ /* Fill in pointers to the rings */
+ sc->rxdscr_start = (rx_dscr *) (sc->rxdscrmem);
+ sc->rxdscr_end = sc->rxdscr_start + MAXRXDSCR;
+ sc->rxdscr_add = sc->rxdscr_start;
+ sc->rxdscr_remove = sc->rxdscr_start;
+ sc->rxdscr_onring = 0;
+
+ sc->txdscr_start = (tx_dscr *) (sc->txdscrmem);
+ sc->txdscr_end = sc->txdscr_start + MAXTXDSCR;
+ sc->txdscr_add = sc->txdscr_start;
+ sc->txdscr_remove = sc->txdscr_start;
+
+ tulip_initrings(sc);
+
+ return 0;
+}
+
+
+static void
+tulip_resetrings(tulip_softc *sc)
+{
+ volatile tx_dscr *txd;
+ volatile rx_dscr *rxd;
+ eth_pkt_t *pkt;
+
+ /* Free already-sent descriptors and buffers */
+ tulip_proctxring(sc);
+
+ /* Free any pending but unsent */
+ txd = (volatile tx_dscr *) sc->txdscr_remove;
+ while (txd != sc->txdscr_add) {
+ txd->txd_flags &=~ M_TDES0_OWNADAP;
+ pkt = ETH_PKT_BASE(PCI_TO_PTR(txd->txd_bufaddr1));
+ eth_free_pkt(sc, pkt);
+
+ txd++;
+ if (txd == sc->txdscr_end)
+ txd = sc->txdscr_start;
+ }
+ sc->txdscr_add = sc->txdscr_remove;
+
+ /* Discard any received packets as well as all free buffers */
+ rxd = (volatile rx_dscr *) sc->rxdscr_remove;
+ while (rxd != sc->rxdscr_add) {
+ rxd->rxd_flags &=~ M_RDES0_OWNADAP;
+ pkt = ETH_PKT_BASE(PCI_TO_PTR(rxd->rxd_bufaddr1));
+ eth_free_pkt(sc, pkt);
+
+ rxd++;
+ if (rxd == sc->rxdscr_end)
+ rxd = sc->rxdscr_start;
+ CS_ENTER(sc);
+ sc->rxdscr_onring--;
+ CS_EXIT(sc);
+ }
+
+ /* Reestablish the initial state. */
+ tulip_initrings(sc);
+}
+
+
+/* CRCs */
+
+#define IEEE_CRC32_POLY 0xEDB88320UL /* CRC-32 Poly -- either endian */
+
+static uint32_t
+tulip_crc32(const uint8_t *databuf, unsigned int datalen)
+{
+ unsigned int idx, bit, data;
+ uint32_t crc;
+
+ crc = 0xFFFFFFFFUL;
+ for (idx = 0; idx < datalen; idx++)
+ for (data = *databuf++, bit = 0; bit < 8; bit++, data >>= 1)
+ crc = (crc >> 1) ^ (((crc ^ data) & 1) ? IEEE_CRC32_POLY : 0);
+ return crc;
+}
+
+#define tulip_mchash(mca) (tulip_crc32((mca), 6) & 0x1FF)
+
+
+/* Serial ROM access */
+
+/****************************************************************************
+ * tulip_spin(sc, ns)
+ *
+ * Spin for a short interval (nominally in nanoseconds)
+ *
+ * Input Parameters: ns - minimum required nsec.
+ *
+ * The delay loop uses uncached PCI reads, each of which requires
+ * at least 3 PCI bus clocks (45 ns at 66 MHz) to complete. The
+ * actual delay will be longer (much longer if preempted).
+ ***************************************************************************/
+
+#define PCI_MIN_DELAY 45
+
+static void
+tulip_spin(tulip_softc *sc, long nanoseconds)
+{
+ long delay;
+ volatile uint32_t t;
+
+ for (delay = nanoseconds; delay > 0; delay -= PCI_MIN_DELAY)
+ t = READCSR(sc, R_CSR_BUSMODE);
+}
+
+
+/*
+ * Delays below are chosen to meet specs for NS93C64 (slow M variant).
+ * Current parts are faster.
+ * Reference: NS Memory Data Book, 1994
+ */
+
+#define SROM_SIZE 128
+#define SROM_MAX_CYCLES 32
+
+#define SROM_CMD_BITS 3
+#define SROM_ADDR_BITS 6
+
+#define K_SROM_READ_CMD 06
+#define K_SROM_WRITE_CMD 05
+
+#define SROM_VENDOR_INDEX 0x00
+#define SROM_FORMAT_INDEX 0x12
+#define SROM_ADDR_INDEX 0x14
+
+#define SROM_DEVICE0_INDEX 0x1A
+#define SROM_LEAF0_OFFSET_INDEX 0x1B
+
+#define SROM_CRC_INDEX (SROM_SIZE-2)
+/* Note recent chips supporting wake-on-lan have CRC in bytes 94, 95 */
+
+#define SROM_WORD(rom,offset) ((rom)[offset] | ((rom)[offset+1] << 8))
+
+static void
+srom_idle_state(tulip_softc *sc)
+{
+ uint32_t csr9;
+ unsigned int i;
+
+ csr9 = READCSR(sc, R_CSR_ROM_MII);
+
+ csr9 |= M_CSR9_SROMCHIPSEL;
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ tulip_spin(sc, 100); /* CS setup (Tcss=100) */
+
+ /* Run the clock through the maximum number of pending read cycles */
+ for (i = 0; i < SROM_MAX_CYCLES*2; i++) {
+ csr9 ^= M_CSR9_SROMCLOCK;
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ tulip_spin(sc, 1000); /* SK period (Fsk=0.5MHz) */
+ }
+
+ /* Deassert SROM Chip Select */
+ csr9 &=~ M_CSR9_SROMCHIPSEL;
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ tulip_spin(sc, 50); /* CS recovery (Tsks=50) */
+}
+
+static void
+srom_send_command_bit(tulip_softc *sc, unsigned int data)
+{
+ uint32_t csr9;
+
+ csr9 = READCSR(sc, R_CSR_ROM_MII);
+
+ /* Place the data bit on the bus */
+ if (data == 1)
+ csr9 |= M_CSR9_SROMDATAIN;
+ else
+ csr9 &=~ M_CSR9_SROMDATAIN;
+
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ tulip_spin(sc, 360); /* setup: Tdis=200 */
+
+ /* Now clock the data into the SROM */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9 | M_CSR9_SROMCLOCK);
+ tulip_spin(sc, 900); /* clock high, Tskh=500 */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ tulip_spin(sc, 450); /* clock low, Tskl=250 */
+
+ /* Now clear the data bit */
+ csr9 &=~ M_CSR9_SROMDATAIN; /* data invalid, Tidh=20 for SK^ */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ tulip_spin(sc, 270); /* min cycle, 1/Fsk=2000 */
+}
+
+static uint16_t
+srom_read_bit(tulip_softc *sc)
+{
+ uint32_t csr9;
+
+ csr9 = READCSR(sc, R_CSR_ROM_MII);
+
+ /* Generate a clock cycle before doing a read */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9 | M_CSR9_SROMCLOCK); /* rising edge */
+ tulip_spin(sc, 1000); /* clock high, Tskh=500, Tpd=1000 */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9); /* falling edge */
+ tulip_spin(sc, 1000); /* clock low, 1/Fsk=2000 */
+
+ csr9 = READCSR(sc, R_CSR_ROM_MII);
+ return ((csr9 & M_CSR9_SROMDATAOUT) != 0 ? 1 : 0);
+}
+
+#define CMD_BIT_MASK (1 << (SROM_CMD_BITS+SROM_ADDR_BITS-1))
+
+static uint16_t
+srom_read_word(tulip_softc *sc, unsigned int index)
+{
+ uint16_t command, word;
+ uint32_t csr9;
+ unsigned int i;
+
+ csr9 = READCSR(sc, R_CSR_ROM_MII) | M_CSR9_SROMCHIPSEL;
+
+ /* Assert the SROM CS line */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ tulip_spin(sc, 100); /* CS setup, Tcss = 100 */
+
+ /* Send the read command to the SROM */
+ command = (K_SROM_READ_CMD << SROM_ADDR_BITS) | index;
+ for (i = 0; i < SROM_CMD_BITS+SROM_ADDR_BITS; i++) {
+ srom_send_command_bit(sc, (command & CMD_BIT_MASK) != 0 ? 1 : 0);
+ command <<= 1;
+ }
+
+ /* Now read the bits from the SROM (MSB first) */
+ word = 0;
+ for (i = 0; i < 16; ++i) {
+ word <<= 1;
+ word |= srom_read_bit(sc);
+ }
+
+ /* Clear the SROM CS Line, CS hold, Tcsh = 0 */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9 &~ M_CSR9_SROMCHIPSEL);
+
+ return word;
+}
+
+
+/****************************************************************************
+ * srom_calc_crc()
+ *
+ * Calculate the CRC of the SROM and return it. We compute the
+ * CRC per Appendix A of the 21140A ROM/external register data
+ * sheet (EC-QPQWA-TE).
+ ***************************************************************************/
+
+static uint16_t
+srom_calc_crc(tulip_softc *sc, uint8_t srom[], int length)
+{
+ uint32_t crc = tulip_crc32(srom, length) ^ 0xFFFFFFFF;
+
+ return (uint16_t)(crc & 0xFFFF);
+}
+
+/****************************************************************************
+ * srom_read_all(sc, uint8_t dest)
+ *
+ * Read the entire SROM into the srom array
+ *
+ * Input parameters:
+ * sc - tulip state
+ ***************************************************************************/
+
+static int
+srom_read_all(tulip_softc *sc, uint8_t dest[])
+{
+ int i;
+ uint16_t crc, temp;
+
+ WRITECSR(sc, R_CSR_ROM_MII, M_CSR9_SERROMSEL|M_CSR9_ROMREAD);
+
+ srom_idle_state(sc);
+
+ for (i = 0; i < SROM_SIZE/2; i++) {
+ temp = srom_read_word(sc, i);
+ dest[2*i] = temp & 0xFF;
+ dest[2*i+1] =temp >> 8;
+ }
+
+ WRITECSR(sc, R_CSR_ROM_MII, 0); /* CS hold, Tcsh=0 */
+
+ crc = srom_calc_crc(sc, dest, SROM_CRC_INDEX);
+ if (crc != SROM_WORD(dest, SROM_CRC_INDEX)) {
+ crc = srom_calc_crc(sc, dest, 94); /* "alternative" */
+ if (crc != SROM_WORD(dest, 94)) {
+ xprintf("%s: Invalid SROM CRC, calc %04x, stored %04x\n",
+ tulip_devname(sc), crc, SROM_WORD(dest, 94));
+ return 0/*-1*/;
+ }
+ }
+ return 0;
+}
+
+static int
+srom_read_addr(tulip_softc *sc, uint8_t buf[])
+{
+ uint8_t srom[SROM_SIZE];
+
+ if (srom_read_all(sc, srom) == 0) {
+ memcpy(buf, &srom[SROM_ADDR_INDEX], ENET_ADDR_LEN);
+ return 0;
+ }
+
+ return -1;
+}
+
+
+/****************************************************************************
+ * earom_read_all(sc, uint8_t dest)
+ *
+ * Read the entire Ethernet address ROM into the srom array (21040 only)
+ *
+ * Input parameters:
+ * sc - tulip state
+ ***************************************************************************/
+
+static int
+earom_read_all(tulip_softc *sc, uint8_t dest[])
+{
+ int i;
+ uint32_t csr9;
+
+ WRITECSR(sc, R_CSR_ROM_MII, 0); /* reset pointer */
+
+ for (i = 0; i < SROM_SIZE; i++) {
+ for (;;) {
+ csr9 = READCSR(sc, R_CSR_ROM_MII);
+ if ((csr9 & M_CSR9_DATANOTVALID) == 0)
+ break;
+ POLL(); /* XXX need a timeout */
+ }
+ dest[i] = G_CSR9_ROMDATA(csr9);
+ }
+
+ return 0;
+}
+
+static int
+earom_read_addr(tulip_softc *sc, uint8_t buf[])
+{
+ uint8_t srom[SROM_SIZE];
+
+ if (earom_read_all(sc, srom) == 0) {
+ memcpy(buf, &srom[0], ENET_ADDR_LEN);
+ return 0;
+ }
+
+ return -1;
+}
+
+
+static int
+rom_read_all(tulip_softc *sc, uint8_t buf[])
+{
+ if (sc->device == K_PCI_ID_DC21040)
+ return earom_read_all(sc, buf);
+ else
+ return srom_read_all(sc, buf);
+}
+
+static int
+rom_read_addr(tulip_softc *sc, uint8_t buf[])
+{
+ if (sc->device == K_PCI_ID_DC21040)
+ return earom_read_addr(sc, buf);
+ else
+ return srom_read_addr(sc, buf);
+}
+
+#if 0
+static void
+rom_dump(uint8_t srom[])
+{
+ int i;
+
+ xprintf("DC21x4x: SROM data:");
+ for (i = 0; i < SROM_SIZE; i++) {
+ if (i % 16 == 0)
+ xprintf("\n %02x: ", i);
+ xprintf(" %02x", srom[i]);
+ }
+ xprintf("\n");
+}
+#else
+#define rom_dump(srom)
+#endif
+
+
+/****************************************************************************
+ * MII access utility routines
+ ***************************************************************************/
+
+/* MII clock limited to 2.5 MHz, transactions end with MDIO tristated */
+
+static void
+mii_write_bits(tulip_softc *sc, uint32_t data, unsigned int count)
+{
+ uint32_t csr9;
+ uint32_t bitmask;
+
+ csr9 = READCSR(sc, R_CSR_ROM_MII) &~ (M_CSR9_MDC | M_CSR9_MIIMODE);
+
+ for (bitmask = 1 << (count-1); bitmask != 0; bitmask >>= 1) {
+ csr9 &=~ M_CSR9_MDO;
+ if ((data & bitmask) != 0) csr9 |= M_CSR9_MDO;
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+
+ tulip_spin(sc, 2000); /* setup */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9 | M_CSR9_MDC);
+ tulip_spin(sc, 2000); /* hold */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ }
+}
+
+static void
+mii_turnaround(tulip_softc *sc)
+{
+ uint32_t csr9;
+
+ csr9 = READCSR(sc, R_CSR_ROM_MII) | M_CSR9_MIIMODE;
+
+ /* stop driving data */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ tulip_spin(sc, 2000); /* setup */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9 | M_CSR9_MDC);
+ tulip_spin(sc, 2000); /* clock high */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+
+ /* read back and check for 0 here? */
+}
+
+/****************************************************************************
+ * mii_read_register
+ *
+ * This routine reads a register from the PHY chip using the MII
+ * serial management interface.
+ *
+ * Input parameters:
+ * index - index of register to read (0-31)
+ *
+ * Return value:
+ * word read from register
+ ***************************************************************************/
+
+static uint16_t
+mii_read_register(tulip_softc *sc, unsigned int index)
+{
+ /* Send the command and address to the PHY. The sequence is
+ a synchronization sequence (32 1 bits)
+ a "start" command (2 bits)
+ a "read" command (2 bits)
+ the PHY addr (5 bits)
+ the register index (5 bits)
+ */
+ uint32_t csr9;
+ uint16_t word;
+ int i;
+
+ mii_write_bits(sc, 0xFF, 8);
+ mii_write_bits(sc, 0xFFFFFFFF, 32);
+ mii_write_bits(sc, MII_COMMAND_START, 2);
+ mii_write_bits(sc, MII_COMMAND_READ, 2);
+ mii_write_bits(sc, sc->mii_addr, 5);
+ mii_write_bits(sc, index, 5);
+
+ mii_turnaround(sc);
+
+ csr9 = (READCSR(sc, R_CSR_ROM_MII) &~ M_CSR9_MDC) | M_CSR9_MIIMODE;
+ word = 0;
+
+ for (i = 0; i < 16; i++) {
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ tulip_spin(sc, 2000); /* clock width low */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9 | M_CSR9_MDC);
+ tulip_spin(sc, 2000); /* clock width high */
+ WRITECSR(sc, R_CSR_ROM_MII, csr9);
+ tulip_spin(sc, 1000); /* output delay */
+ word <<= 1;
+ if ((READCSR(sc, R_CSR_ROM_MII) & M_CSR9_MDI) != 0)
+ word |= 0x0001;
+ }
+
+ return word;
+
+ /* reset to output mode? */
+}
+
+/****************************************************************************
+ * mii_write_register
+ *
+ * This routine writes a register in the PHY chip using the MII
+ * serial management interface.
+ *
+ * Input parameters:
+ * index - index of register to write (0-31)
+ * value - word to write
+ ***************************************************************************/
+
+static void
+mii_write_register(tulip_softc *sc, unsigned int index, uint16_t value)
+{
+ mii_write_bits(sc, 0xFF, 8);
+ mii_write_bits(sc, 0xFFFFFFFF, 32);
+ mii_write_bits(sc, MII_COMMAND_START, 2);
+ mii_write_bits(sc, MII_COMMAND_WRITE, 2);
+ mii_write_bits(sc, sc->mii_addr, 5);
+ mii_write_bits(sc, index, 5);
+ mii_write_bits(sc, MII_COMMAND_ACK, 2);
+ mii_write_bits(sc, value, 16);
+
+ /* reset to input mode? */
+}
+
+
+static int
+mii_probe(tulip_softc *sc)
+{
+ int i;
+ uint16_t id1, id2;
+
+ for (i = 0; i < 32; i++) {
+ sc->mii_addr = i;
+ id1 = mii_read_register(sc, MII_PHYIDR1);
+ id2 = mii_read_register(sc, MII_PHYIDR2);
+ if ((id1 != 0x0000 && id1 != 0xFFFF) ||
+ (id2 != 0x0000 && id2 != 0xFFFF)) {
+ return 0;
+ }
+ }
+ return -1;
+}
+
+#if 0
+#define OUI_NAT_SEMI 0x080017
+#define OUI_LEVEL_ONE 0x1E0400 /* 0x00207B, bit reversed and truncated */
+
+static void
+mii_dump(tulip_softc *sc, const char *label)
+{
+ int i;
+ uint16_t r;
+ uint32_t oui, part;
+
+ xprintf("%s\n", label);
+ oui = 0;
+ for (i = 0; i <= 6; ++i) {
+ r = mii_read_register(sc, i);
+ if (r != 0) xprintf("MII_REG%02x: %04x\n", i, r);
+ if (i == MII_PHYIDR1) {
+ oui = r << 6;
+ }
+ else if (i == MII_PHYIDR2) {
+ oui |= (r >> 10) & 0x3F;
+ part = (r >> 4) & 0x3F;
+ }
+ }
+ if (oui == OUI_NAT_SEMI) { /* DP83840, DP83840A */
+ for (i = 0x15; i <= 0x19; ++i) {
+ r = mii_read_register(sc, i);
+ if (r != 0) xprintf("MII_REG%02x: %04x\n", i, r);
+ }
+ }
+ else if (oui == OUI_LEVEL_ONE) { /* LXT970, etc. */
+ for (i = 0x10; i <= 0x14; ++i) {
+ r = mii_read_register(sc, i);
+ if (r != 0) xprintf("MII_REG%02x: %04x\n", i, r);
+ }
+ }
+}
+#else
+#define mii_dump(sc,label)
+#endif
+
+
+/* The following functions are suitable for all tulips with MII
+ interfaces. */
+
+static void
+mii_set_speed(tulip_softc *sc, int speed, int autoneg)
+{
+ uint16_t control;
+ uint16_t pcr;
+ uint32_t opmode = 0;
+
+ /* This is really just for NS DP83840/A. Needed? */
+ pcr = mii_read_register(sc, 0x17);
+ pcr |= (0x400|0x100|0x40|0x20);
+ mii_write_register(sc, 0x17, pcr);
+
+ control = mii_read_register(sc, MII_BMCR);
+
+ if (!autoneg) {
+ control &=~ (BMCR_ANENABLE | BMCR_RESTARTAN);
+ mii_write_register(sc, MII_BMCR, control);
+ control &=~ (BMCR_SPEED0 | BMCR_SPEED1 | BMCR_DUPLEX);
+ }
+
+ switch (speed) {
+ case ETHER_SPEED_10HDX:
+ default:
+ opmode = M_CSR6_SPEED_10_MII;
+ break;
+ case ETHER_SPEED_10FDX:
+ control |= BMCR_DUPLEX;
+ opmode = M_CSR6_SPEED_10_MII | M_CSR6_FULLDUPLEX;
+ break;
+ case ETHER_SPEED_100HDX:
+ control |= BMCR_SPEED100;
+ opmode = M_CSR6_SPEED_100_MII;
+ break;
+ case ETHER_SPEED_100FDX:
+ control |= BMCR_SPEED100 | BMCR_DUPLEX ;
+ opmode = M_CSR6_SPEED_100_MII | M_CSR6_FULLDUPLEX;
+ break;
+ }
+
+ if (!autoneg)
+ mii_write_register(sc, MII_BMCR, control);
+
+ opmode |= M_CSR6_MBO;
+#if TULIP_TUNE
+ opmode |= V_CSR6_THRESHCONTROL(K_CSR6_TXTHRES_128_72);
+#else
+ opmode |= M_CSR6_STOREFWD;
+#endif
+ WRITECSR(sc, R_CSR_OPMODE, opmode);
+ mii_dump(sc, "setspeed PHY");
+}
+
+static void
+mii_autonegotiate(tulip_softc *sc)
+{
+ uint16_t control, status, cap;
+ unsigned int timeout;
+ int linkspeed;
+ int autoneg;
+
+ linkspeed = ETHER_SPEED_UNKNOWN;
+
+ /* Read twice to clear latching bits */
+ status = mii_read_register(sc, MII_BMSR);
+ status = mii_read_register(sc, MII_BMSR);
+ mii_dump(sc, "query PHY");
+
+ if ((status & (BMSR_AUTONEG | BMSR_LINKSTAT)) ==
+ (BMSR_AUTONEG | BMSR_LINKSTAT))
+ control = mii_read_register(sc, MII_BMCR);
+ else {
+ /* reset the PHY */
+ mii_write_register(sc, MII_BMCR, BMCR_RESET);
+ timeout = 3000;
+ for (;;) {
+ control = mii_read_register(sc, MII_BMCR);
+ if ((control && BMCR_RESET) == 0) break;
+ cfe_sleep(CFE_HZ/2);
+ timeout -= 500;
+ if (timeout <= 0) break;
+ }
+ if ((control & BMCR_RESET) != 0) {
+ xprintf("%s: PHY reset failed\n", tulip_devname(sc));
+ return;
+ }
+
+ status = mii_read_register(sc, MII_BMSR);
+ cap = ((status >> 6) & (ANAR_TXFD | ANAR_TXHD | ANAR_10FD | ANAR_10HD))
+ | PSB_802_3;
+ mii_write_register(sc, MII_ANAR, cap);
+ control |= (BMCR_ANENABLE | BMCR_RESTARTAN);
+ mii_write_register(sc, MII_BMCR, control);
+
+ timeout = 3000;
+ for (;;) {
+ status = mii_read_register(sc, MII_BMSR);
+ if ((status & BMSR_ANCOMPLETE) != 0) break;
+ cfe_sleep(CFE_HZ/2);
+ timeout -= 500;
+ if (timeout <= 0) break;
+ }
+ mii_dump(sc, "done PHY");
+ }
+
+ xprintf("%s: Link speed: ", tulip_devname(sc));
+ if ((status & BMSR_ANCOMPLETE) != 0) {
+ /* A link partner was negogiated... */
+
+ uint16_t remote = mii_read_register(sc, MII_ANLPAR);
+
+ autoneg = 1;
+ if ((remote & ANLPAR_TXFD) != 0) {
+ xprintf("100BaseT FDX");
+ linkspeed = ETHER_SPEED_100FDX;
+ }
+ else if ((remote & ANLPAR_TXHD) != 0) {
+ xprintf("100BaseT HDX");
+ linkspeed = ETHER_SPEED_100HDX;
+ }
+ else if ((remote & ANLPAR_10FD) != 0) {
+ xprintf("10BaseT FDX");
+ linkspeed = ETHER_SPEED_10FDX;
+ }
+ else if ((remote & ANLPAR_10HD) != 0) {
+ xprintf("10BaseT HDX");
+ linkspeed = ETHER_SPEED_10HDX;
+ }
+ xprintf("\n");
+ }
+ else {
+ /* no link partner negotiation */
+
+ autoneg = 0;
+ xprintf("Unknown, assuming 10BaseT\n");
+ control &=~ (BMCR_ANENABLE | BMCR_RESTARTAN);
+ mii_write_register(sc, MII_BMCR, control);
+ linkspeed = ETHER_SPEED_10HDX;
+ }
+
+ if ((status & BMSR_LINKSTAT) == 0)
+ mii_write_register(sc, MII_BMCR, control);
+ mii_set_speed(sc, linkspeed, autoneg);
+
+ status = mii_read_register(sc, MII_BMSR); /* clear latching bits */
+ mii_dump(sc, "final PHY");
+}
+
+
+/* Chip specific code */
+
+static void
+dc21143_set_speed(tulip_softc *sc, int speed)
+{
+ uint32_t opmode = 0;
+
+ WRITECSR(sc, R_CSR_SIAMODE0, 0);
+
+ switch (speed) {
+ case ETHER_SPEED_AUTO:
+ break;
+ case ETHER_SPEED_10HDX:
+ default:
+ WRITECSR(sc, R_CSR_SIAMODE1, M_CSR14_10BT_HD);
+ WRITECSR(sc, R_CSR_SIAMODE2, sc->gpdata);
+ opmode = M_CSR6_SPEED_10;
+ break;
+ case ETHER_SPEED_10FDX:
+ WRITECSR(sc, R_CSR_SIAMODE1, M_CSR14_10BT_FD);
+ WRITECSR(sc, R_CSR_SIAMODE2, sc->gpdata);
+ opmode = M_CSR6_SPEED_10 | M_CSR6_FULLDUPLEX;
+ break;
+ case ETHER_SPEED_100HDX:
+ WRITECSR(sc, R_CSR_SIAMODE1, 0);
+ WRITECSR(sc, R_CSR_SIAMODE2, sc->gpdata);
+ opmode = M_CSR6_SPEED_100;
+ break;
+ case ETHER_SPEED_100FDX:
+ WRITECSR(sc, R_CSR_SIAMODE1, 0);
+ WRITECSR(sc, R_CSR_SIAMODE2, sc->gpdata);
+ opmode = M_CSR6_SPEED_100 | M_CSR6_FULLDUPLEX;
+ break;
+ }
+
+ WRITECSR(sc, R_CSR_SIAMODE0, M_CSR13_CONN_NOT_RESET);
+
+ opmode |= M_CSR6_MBO;
+#if TULIP_TUNE
+ opmode |= V_CSR6_THRESHCONTROL(K_CSR6_TXTHRES_128_72);
+#else
+ opmode |= M_CSR6_STOREFWD;
+#endif
+ WRITECSR(sc, R_CSR_OPMODE, opmode);
+}
+
+static void
+dc21143_autonegotiate(tulip_softc *sc)
+{
+ uint32_t opmode;
+ uint32_t tempword;
+ int count;
+ int linkspeed;
+
+ linkspeed = ETHER_SPEED_UNKNOWN;
+
+ /* Program the media setup into the CSRs. */
+ /* reset SIA */
+ WRITECSR(sc, R_CSR_SIAMODE0, 0);
+
+ /* set to speed_10, fullduplex to start_nway */
+ opmode =
+ M_CSR6_SPEED_10 |
+ M_CSR6_FULLDUPLEX |
+ M_CSR6_MBO;
+ WRITECSR(sc, R_CSR_OPMODE, opmode);
+
+ /* Choose advertised capabilities */
+ tempword =
+ M_CSR14_100BASETHALFDUP |
+ M_CSR14_100BASETFULLDUP |
+ M_CSR14_HALFDUPLEX10BASET;
+ WRITECSR(sc, R_CSR_SIAMODE1, tempword);
+
+ /* Enable autonegotiation */
+ tempword |= M_CSR14_AUTONEGOTIATE | 0xFFFF;
+ WRITECSR(sc, R_CSR_SIAMODE1, tempword);
+ WRITECSR(sc, R_CSR_SIAMODE2, sc->gpdata);
+ WRITECSR(sc, R_CSR_OPMODE, opmode);
+ WRITECSR(sc, R_CSR_SIAMODE0, M_CSR13_CONN_NOT_RESET);
+
+ /* STATE check nway, poll until a valid 10/100mbs signal seen */
+ WRITECSR(sc, R_CSR_STATUS, M_CSR5_LINKPASS); /* try to clear this... */
+
+ /* (Re)start negotiation */
+ tempword = READCSR(sc, R_CSR_SIASTATUS);
+ tempword &=~ M_CSR12_AUTONEGARBIT;
+ tempword |= V_CSR12_AUTONEGARBIT(0x1);
+
+ for (count = 0; count <= 13; count++) {
+ tempword = READCSR(sc, R_CSR_STATUS);
+ if (tempword & M_CSR5_LINKPASS)
+ break;
+ cfe_sleep(CFE_HZ/10);
+ }
+
+ if (count > 13)
+ xprintf("%s: Link autonegotiation failed\n", tulip_devname(sc));
+
+ /* STATE configure nway, check to see if any abilities common to us.
+ If they do, set to highest mode, if not, we will see if the partner
+ will do 100mb or 10mb - then set it */
+
+ tempword = READCSR(sc, R_CSR_SIASTATUS);
+ /* clear the autonegogiate complete bit */
+ WRITECSR(sc, R_CSR_STATUS, M_CSR5_LINKPASS);
+
+ if (tempword & M_CSR12_LINKPARTNEG) {
+ /* A link partner was negogiated... */
+
+ xprintf("%s: Link speed: ", tulip_devname(sc));
+ if (tempword & 0x01000000) { /* 100FD */
+ xprintf("100BaseT FDX");
+ linkspeed = ETHER_SPEED_100FDX;
+ }
+ else if (tempword & 0x00800000) { /* 100HD */
+ xprintf("100BaseT HDX");
+ linkspeed = ETHER_SPEED_100HDX;
+ }
+ else if (tempword & 0x00400000) { /* 10FD */
+ xprintf("10BaseT FDX");
+ linkspeed = ETHER_SPEED_10FDX;
+ }
+ else if (tempword & 0x00200000) { /* 10HD */
+ xprintf("10BaseT HDX");
+ linkspeed = ETHER_SPEED_10HDX;
+ }
+ xprintf("\n");
+ }
+ else {
+ /* no link partner negotiation */
+ /* disable link for 1.3 seconds to break any existing connections */
+
+ xprintf("%s: ", tulip_devname(sc));
+ dc21143_set_speed(sc, ETHER_SPEED_10HDX);
+ cfe_sleep(CFE_HZ/8);
+
+ tempword = READCSR(sc, R_CSR_SIASTATUS);
+
+ if ((tempword & 0x02) == 0) {
+ /* 100 mb signal present set to 100mb */
+ xprintf("No link partner... setting to 100BaseT HDX\n");
+ linkspeed = ETHER_SPEED_100HDX;
+ }
+ else if ((tempword & 0x04) == 0) {
+ /* 10 mb signal present */
+ xprintf("No link partner... setting to 10BaseT HDX\n");
+ linkspeed = ETHER_SPEED_10HDX;
+ }
+ else {
+ /* couldn't determine line speed, so set to 10mbs */
+ xprintf("Unknown; defaulting to 10BaseT HDX\n");
+ linkspeed = ETHER_SPEED_10HDX;
+ }
+ }
+
+ dc21143_set_speed(sc, linkspeed);
+}
+
+static void
+dc21143_set_loopback(tulip_softc *sc, int mode)
+{
+ uint32_t v;
+
+ WRITECSR(sc, R_CSR_SIAMODE0, 0);
+ if (mode == ETHER_LOOPBACK_EXT) {
+ /* deal with CSRs 13-15 */
+ }
+ cfe_sleep(CFE_HZ/10); /* check this */
+
+ /* Update the SIA registers */
+ v = READCSR(sc, R_CSR_SIAMODE0);
+ WRITECSR(sc, R_CSR_SIAMODE0, v &~ 0xFFFF);
+ v = READCSR(sc, R_CSR_SIAMODE1);
+ WRITECSR(sc, R_CSR_SIAMODE1, v &~ 0xFFFF);
+ v = READCSR(sc, R_CSR_SIAMODE2);
+ WRITECSR(sc, R_CSR_SIAMODE2, v | 0xC000); /* WC of HCKR, RMP */
+ if (mode == ETHER_LOOPBACK_OFF)
+ WRITECSR(sc, R_CSR_SIAMODE2, sc->gpdata);
+ else
+ WRITECSR(sc, R_CSR_SIAMODE2, (v &~ 0xFFFF) | M_CSR15_GP_AUIBNC);
+
+ WRITECSR(sc, R_CSR_SIAMODE0, M_CSR13_CONN_NOT_RESET);
+
+ sc->loopback = mode;
+}
+
+/* Known vendors with cards requiring special initialization. */
+#define K_PCI_VENDOR_COGENT 0x1109 /* inherited by Adaptec */
+#define K_PCI_VENDOR_PHOBOS 0x13D8
+#define K_PCI_VENDOR_ZNYZ 0x110D
+#define K_PCI_VENDOR_KINGSTON 0x2646
+
+static void
+dc21143_hwinit(tulip_softc *sc, uint8_t srom[])
+{
+ uint32_t v;
+ uint32_t csr6word, csr14word;
+
+ if (SROM_WORD(srom, SROM_VENDOR_INDEX) == K_PCI_VENDOR_COGENT) {
+ /* Cogent/Adaptec MII (ANA-6911A). */
+ sc->phy_type = MII;
+ WRITECSR(sc, R_CSR_SIAMODE2, 0x0821 << 16);
+ WRITECSR(sc, R_CSR_SIAMODE2, 0x0001 << 16);
+ cfe_sleep(CFE_HZ/10);
+ WRITECSR(sc, R_CSR_SIAMODE2, 0x0000 << 16);
+ cfe_sleep(CFE_HZ/2);
+ sc->gpdata = 0;
+ }
+ else if (SROM_WORD(srom, SROM_VENDOR_INDEX) == K_PCI_VENDOR_ZNYZ) {
+ /* Znyz 34xQ adapters */
+ sc->phy_type = SYM;
+
+ /* The ZX345Q with wake-on-LAN enabled apparently clears ANE and
+ TAS on power up (but not cold reset) */
+ WRITECSR(sc, R_CSR_SIAMODE1, 0xFFFFFFFF);
+
+ /* The following is a reset workaround for QS/Kendin PHYs
+ as suggested by an Intel app note. Bit 0x40000 is the PHY
+ reset (low true) on Znyx cards. */
+ WRITECSR(sc, R_CSR_SIAMODE2,
+ M_CSR15_GP_CONTROLWRITE |
+ 0xF0000 | /* all outputs */
+ M_CSR15_GP_LED1 |
+ M_CSR15_GP_AUIBNC);
+ cfe_sleep(CFE_HZ/5);
+ WRITECSR(sc, R_CSR_SIAMODE2, 0x40000); /* release reset */
+ cfe_sleep(CFE_HZ/5);
+ sc->gpdata = 0x40000 | M_CSR15_GP_AUIBNC;
+ }
+ else if (SROM_WORD(srom, SROM_VENDOR_INDEX) == K_PCI_VENDOR_KINGSTON) {
+ /* Kingston KNE100TX */
+ sc->phy_type = MII;
+ sc->gpdata = 0;
+ }
+ else if (SROM_WORD(srom, SROM_VENDOR_INDEX) == K_PCI_VENDOR_PHOBOS) {
+ /* Phobos 430TX quad card */
+ sc->phy_type = MII;
+#if 0 /* per EEPROM */
+ WRITECSR(sc, R_CSR_SIAMODE2, 0x080E << 16);
+ WRITECSR(sc, R_CSR_SIAMODE2, 0x000E << 16);
+ cfe_sleep(CFE_HZ/10);
+ sc->gpdata = 0x0E;
+#else /* following Adaptec 21143 with MII interface */
+ WRITECSR(sc, R_CSR_SIAMODE2, 0x0821 << 16);
+ WRITECSR(sc, R_CSR_SIAMODE2, 0x0001 << 16);
+ cfe_sleep(CFE_HZ/10);
+ WRITECSR(sc, R_CSR_SIAMODE2, 0x0000 << 16);
+ cfe_sleep(CFE_HZ/2);
+ sc->gpdata = 0;
+#endif
+ }
+ else {
+ /* Most 21143 cards use the SYM interface. */
+ sc->phy_type = SYM;
+ WRITECSR(sc, R_CSR_SIAMODE2, M_CSR15_CONFIG_GEPS_LEDS);
+ sc->gpdata = M_CSR15_DEFAULT_VALUE;
+ }
+
+ if (sc->phy_type == MII) {
+ mii_probe(sc);
+ }
+
+ /* CSR0 - bus mode */
+#if TULIP_TUNE
+ v = V_CSR0_SKIPLEN(0) |
+ V_CSR0_CACHEALIGN(K_CSR0_ALIGN32) |
+ M_CSR0_READMULTENAB | M_CSR0_READLINEENAB |
+ M_CSR0_WRITEINVALENAB |
+ V_CSR0_BURSTLEN(K_CSR0_BURST32);
+#else
+ v = V_CSR0_SKIPLEN(0) |
+ V_CSR0_CACHEALIGN(K_CSR0_ALIGN32) |
+ V_CSR0_BURSTLEN(K_CSR0_BURST32);
+#endif
+#ifdef __MIPSEB
+ v |= M_CSR0_BIGENDIAN; /* big-endian data serialization */
+#endif
+ WRITECSR(sc, R_CSR_BUSMODE, v);
+
+ /* CSR6 - operation mode */
+ v = M_CSR6_PORTSEL |
+#if TULIP_TUNE
+ V_CSR6_THRESHCONTROL(K_CSR6_TXTHRES_128_72) |
+#else
+ M_CSR6_STOREFWD |
+#endif
+ M_CSR6_MBO;
+ if (sc->phy_type == SYM)
+ v |= M_CSR6_PCSFUNC |M_CSR6_SCRAMMODE;
+ WRITECSR(sc, R_CSR_OPMODE, v);
+
+ /* About to muck with the SIA, reset it.(?) */
+ /* WRITECSR(sc, R_CSR_SIASTATUS, 0); */
+
+ /* Must shut off all transmit/receive in order to attempt to
+ achieve Full Duplex */
+ csr6word = READCSR(sc, R_CSR_OPMODE);
+ WRITECSR(sc, R_CSR_OPMODE, csr6word &~ (M_CSR6_TXSTART | M_CSR6_RXSTART));
+ csr6word = READCSR(sc, R_CSR_OPMODE);
+
+ WRITECSR(sc, R_CSR_RXRING, PTR_TO_PCI(sc->rxdscr_start));
+ WRITECSR(sc, R_CSR_TXRING, PTR_TO_PCI(sc->txdscr_start));
+
+ if (sc->phy_type == MII) {
+ if (sc->linkspeed == ETHER_SPEED_AUTO)
+ mii_autonegotiate(sc);
+ else
+ mii_set_speed(sc, sc->linkspeed, 0);
+ }
+ else {
+ if (sc->linkspeed == ETHER_SPEED_AUTO) {
+ dc21143_autonegotiate(sc);
+ }
+ else {
+ /* disable autonegotiate so we can set full duplex to on */
+ WRITECSR(sc, R_CSR_SIAMODE0, 0);
+ csr14word = READCSR(sc, R_CSR_SIAMODE1);
+ csr14word &=~ M_CSR14_AUTONEGOTIATE;
+ WRITECSR(sc, R_CSR_SIAMODE1, csr14word);
+ WRITECSR(sc, R_CSR_SIAMODE0, M_CSR13_CONN_NOT_RESET);
+
+ dc21143_set_speed(sc, sc->linkspeed);
+ }
+ }
+}
+
+
+static void
+dc21140_set_speed(tulip_softc *sc, int speed, int autoneg)
+{
+ mii_set_speed(sc, speed, autoneg);
+}
+
+static void
+dc21140_set_loopback(tulip_softc *sc, int mode)
+{
+ if (mode == ETHER_LOOPBACK_EXT) {
+ xprintf("%s: external loopback mode NYI\n", tulip_devname(sc));
+ mode = ETHER_LOOPBACK_OFF;
+ }
+ else if (mode != ETHER_LOOPBACK_INT)
+ mode = ETHER_LOOPBACK_OFF;
+
+ sc->loopback = mode;
+}
+
+static void
+dc21140_hwinit(tulip_softc *sc, uint8_t srom[])
+{
+ uint16_t leaf;
+ uint8_t gpr_control, gpr_data;
+ uint32_t v;
+ uint32_t opmode;
+
+ if (srom[SROM_FORMAT_INDEX] == 0 || srom[SROM_FORMAT_INDEX] > 4) {
+ gpr_control = 0x1F;
+ gpr_data = 0x00;
+ sc->phy_type = MII; /* Most 21140 cards use MII */
+ }
+ else {
+ leaf = SROM_WORD(srom, SROM_LEAF0_OFFSET_INDEX);
+ gpr_control = srom[leaf+2];
+ /* XXX We should parse and check all the leaf info */
+ if ((srom[leaf+4] & 0x80) == 0) {
+ gpr_data = 0x85; /* SYM, 100 Mb/s */
+ sc->phy_type = SYM;
+ }
+ else {
+ gpr_data = 0x00; /* MII */
+ sc->phy_type = MII;
+ }
+ }
+
+ /* Assume that we will use MII or SYM interface */
+ WRITECSR(sc, R_CSR_OPMODE, M_CSR6_PORTSEL);
+ RESET_ADAPTER(sc);
+
+ WRITECSR(sc, R_CSR_GENPORT, M_CSR12_CONTROL | gpr_control);
+ WRITECSR(sc, R_CSR_GENPORT, gpr_data); /* setup PHY */
+
+ if (sc->phy_type == MII) {
+ mii_probe(sc);
+ }
+
+ /* CSR0 - bus mode */
+#if TULIP_TUNE
+ v = V_CSR0_SKIPLEN(0) |
+ V_CSR0_CACHEALIGN(K_CSR0_ALIGN32) |
+ M_CSR0_READMULTENAB | M_CSR0_READLINEENAB |
+ M_CSR0_WRITEINVALENAB |
+ V_CSR0_BURSTLEN(K_CSR0_BURST32);
+#else
+ v = V_CSR0_SKIPLEN(0) |
+ V_CSR0_CACHEALIGN(K_CSR0_ALIGN32) |
+ V_CSR0_BURSTLEN(K_CSR0_BURST32);
+#endif
+#ifdef __MIPSEB
+ v |= M_CSR0_BIGENDIAN; /* big-endian data serialization */
+#endif
+ WRITECSR(sc, R_CSR_BUSMODE, v);
+
+ /* CSR6 - operation mode */
+ v = M_CSR6_PORTSEL |
+#if TULIP_TUNE
+ V_CSR6_THRESHCONTROL(K_CSR6_TXTHRES_128_72) |
+#else
+ M_CSR6_STOREFWD |
+#endif
+ M_CSR6_MBO;
+ WRITECSR(sc, R_CSR_OPMODE, v);
+
+ /* Must shut off all transmit/receive in order to attempt to
+ achieve Full Duplex */
+ opmode = READCSR(sc, R_CSR_OPMODE);
+ WRITECSR(sc, R_CSR_OPMODE, opmode &~ (M_CSR6_TXSTART | M_CSR6_RXSTART));
+ opmode = READCSR(sc, R_CSR_OPMODE);
+
+ WRITECSR(sc, R_CSR_RXRING, PTR_TO_PCI(sc->rxdscr_start));
+ WRITECSR(sc, R_CSR_TXRING, PTR_TO_PCI(sc->txdscr_start));
+
+ if (sc->phy_type == MII) {
+ if (sc->linkspeed == ETHER_SPEED_AUTO)
+ mii_autonegotiate(sc);
+ else
+ mii_set_speed(sc, sc->linkspeed, 0);
+ }
+ else {
+ /* XXX The 21140 requires a soft reset after changing PORTSEL.
+ For now, remain committed to the SYM port (100 Mb/s) */
+ switch (sc->linkspeed) {
+ default:
+ sc->linkspeed = ETHER_SPEED_100HDX; /* for now */
+ /* fall through */
+ case ETHER_SPEED_100HDX:
+ opmode |= M_CSR6_SPEED_100;
+ break;
+ case ETHER_SPEED_100FDX:
+ opmode |= M_CSR6_SPEED_100 | M_CSR6_FULLDUPLEX;
+ break;
+ }
+
+ /* XXX Need to reset and reinitialize if we choose SPEED_10 above */
+ WRITECSR(sc, R_CSR_OPMODE, opmode);
+ }
+}
+
+
+static void
+dc21041_set_speed(tulip_softc *sc, int speed)
+{
+ uint32_t opmode = 0;
+
+ WRITECSR(sc, R_CSR_SIAMODE0, 0);
+
+ /* For now, always force 10BT, HDX (21041, Table 3-62) */
+ switch (speed) {
+ case ETHER_SPEED_10HDX:
+ default:
+ WRITECSR(sc, R_CSR_SIAMODE1, 0x7F3F);
+ WRITECSR(sc, R_CSR_SIAMODE2, 0x0008);
+ opmode = M_CSR6_SPEED_10;
+ break;
+ }
+
+ WRITECSR(sc, R_CSR_SIAMODE0, 0xEF00 | M_CSR13_CONN_NOT_RESET);
+ cfe_sleep(CFE_HZ/10);
+
+ opmode |= V_CSR6_THRESHCONTROL(K_CSR6_TXTHRES_128_72);
+ WRITECSR(sc, R_CSR_OPMODE, opmode);
+}
+
+static void
+dc21041_set_loopback(tulip_softc *sc, int mode)
+{
+ /* For now, always assume 10BT */
+ uint32_t mode0;
+
+ WRITECSR(sc, R_CSR_SIAMODE0, 0);
+ cfe_sleep(CFE_HZ/10); /* check this */
+
+ /* Update the SIA registers */
+ if (mode == ETHER_LOOPBACK_EXT) {
+ /* NB: this is really just internal but through the 10BT endec */
+ WRITECSR(sc, R_CSR_SIAMODE1, 0x7A3F);
+ WRITECSR(sc, R_CSR_SIAMODE2, 0x0008);
+ mode0 = 0;
+ }
+ else if (mode == ETHER_LOOPBACK_INT) {
+ /* MAC internal loopback, no SIA */
+ WRITECSR(sc, R_CSR_SIAMODE1, 0x0000);
+ WRITECSR(sc, R_CSR_SIAMODE2, 0x000E);
+ mode0 = M_CSR13_CONN_AUI_10BT;
+ }
+ else {
+ mode = ETHER_LOOPBACK_OFF;
+ WRITECSR(sc, R_CSR_SIAMODE1, 0x7F3F);
+ WRITECSR(sc, R_CSR_SIAMODE2, 0x0008);
+ mode0 = 0;
+ }
+
+ WRITECSR(sc, R_CSR_SIAMODE0, 0xEF00 | mode0 | M_CSR13_CONN_NOT_RESET );
+
+ sc->loopback = mode;
+}
+
+static void
+dc21041_hwinit(tulip_softc *sc, uint8_t srom[])
+{
+ uint32_t v;
+
+ sc->phy_type = SRL;
+
+ /* CSR0 - bus mode */
+ v = V_CSR0_SKIPLEN(0) |
+ V_CSR0_CACHEALIGN(K_CSR0_ALIGN32) |
+ V_CSR0_BURSTLEN(K_CSR0_BURST32);
+#ifdef __MIPSEB
+ v |= M_CSR0_BIGENDIAN; /* big-endian data serialization */
+#endif
+ WRITECSR(sc, R_CSR_BUSMODE, v);
+
+ WRITECSR(sc, R_CSR_INTMASK, 0);
+
+ WRITECSR(sc, R_CSR_RXRING, PTR_TO_PCI(sc->rxdscr_start));
+ WRITECSR(sc, R_CSR_TXRING, PTR_TO_PCI(sc->txdscr_start));
+
+ /* For now, always force 10BT, HDX (21041, Table 3-62) */
+ dc21041_set_speed(sc, ETHER_SPEED_10HDX);
+}
+
+
+static void
+dc21040_set_speed(tulip_softc *sc, int speed)
+{
+ uint32_t opmode = 0;
+
+ WRITECSR(sc, R_CSR_SIAMODE0, 0);
+
+ /* For now, force 10BT, HDX unless FDX requested (21040, Table 3-53) */
+ switch (speed) {
+ case ETHER_SPEED_10HDX:
+ default:
+ WRITECSR(sc, R_CSR_SIAMODE1, 0xFFFF);
+ WRITECSR(sc, R_CSR_SIAMODE2, 0x0000);
+ opmode = 0;
+ break;
+ case ETHER_SPEED_10FDX:
+ WRITECSR(sc, R_CSR_SIAMODE1, 0xFFFD);
+ WRITECSR(sc, R_CSR_SIAMODE2, 0x0000);
+ opmode = M_CSR6_FULLDUPLEX;
+ break;
+ }
+
+ WRITECSR(sc, R_CSR_SIAMODE0, 0xEF00 | M_CSR13_CONN_NOT_RESET);
+ cfe_sleep(CFE_HZ/10);
+
+ opmode |= V_CSR6_THRESHCONTROL(K_CSR6_TXTHRES_128_72);
+ WRITECSR(sc, R_CSR_OPMODE, opmode);
+}
+
+static void
+dc21040_set_loopback(tulip_softc *sc, int mode)
+{
+ WRITECSR(sc, R_CSR_SIAMODE0, 0);
+ cfe_sleep(CFE_HZ/10); /* check this */
+
+ /* Update the SIA registers */
+ if (mode == ETHER_LOOPBACK_EXT) {
+ /* NB: this is on-chip loopback through the 10BT endec */
+ WRITECSR(sc, R_CSR_SIAMODE1, 0xFEFB);
+ WRITECSR(sc, R_CSR_SIAMODE2, 0x0008);
+ }
+ else if (mode == ETHER_LOOPBACK_INT) {
+ /* MAC internal loopback, no SIA */
+ WRITECSR(sc, R_CSR_SIAMODE1, 0x0000);
+ WRITECSR(sc, R_CSR_SIAMODE2, 0x0000);
+ }
+ else {
+ mode = ETHER_LOOPBACK_OFF;
+ WRITECSR(sc, R_CSR_SIAMODE1, 0xFFFF);
+ WRITECSR(sc, R_CSR_SIAMODE2, 0x0000);
+ }
+
+ WRITECSR(sc, R_CSR_SIAMODE0, 0x8F00 | M_CSR13_CONN_NOT_RESET );
+
+ sc->loopback = mode;
+}
+
+static void
+dc21040_hwinit(tulip_softc *sc, uint8_t srom[])
+{
+ uint32_t v;
+
+ sc->phy_type = SRL;
+
+ /* CSR0 - bus mode */
+ v = V_CSR0_SKIPLEN(0) |
+ V_CSR0_CACHEALIGN(K_CSR0_ALIGN32) |
+ V_CSR0_BURSTLEN(K_CSR0_BURST32);
+#ifdef __MIPSEB
+ v |= M_CSR0_BIGENDIAN; /* big-endian data serialization */
+#endif
+ WRITECSR(sc, R_CSR_BUSMODE, v);
+
+ WRITECSR(sc, R_CSR_INTMASK, 0);
+
+ dc21040_set_speed(sc, sc->linkspeed);
+}
+
+
+static void
+tulip_hwinit(tulip_softc *sc)
+{
+ if (sc->state == eth_state_uninit) {
+ uint8_t srom[SROM_SIZE];
+
+ /* Wake-on-LAN apparently powers up with PORTSEL = 1 */
+ WRITECSR(sc, R_CSR_OPMODE,
+ READCSR(sc, R_CSR_OPMODE) &~ M_CSR6_PORTSEL);
+
+ RESET_ADAPTER(sc);
+ sc->state = eth_state_off;
+ sc->bus_errors = 0;
+
+ rom_read_all(sc, srom); /* XXX read just once? */
+ rom_dump(srom);
+
+ switch (sc->device) {
+ case K_PCI_ID_DC21040:
+ dc21040_hwinit(sc, srom);
+ break;
+ case K_PCI_ID_DC21041:
+ dc21041_hwinit(sc, srom);
+ break;
+ case K_PCI_ID_DC21140:
+ dc21140_hwinit(sc, srom);
+ break;
+ case K_PCI_ID_DC21143:
+ dc21143_hwinit(sc, srom);
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+static void
+tulip_setaddr(tulip_softc *sc)
+{
+ int idx;
+ tulip_cam *cam;
+ eth_pkt_t *pkt;
+
+ pkt = eth_alloc_pkt(sc);
+ if (pkt) {
+ pkt->length = CAM_SETUP_BUFFER_SIZE;
+ cam = (tulip_cam *) pkt->buffer;
+
+#ifdef __MIPSEB
+ cam->p.physical[0][0] = (((uint32_t) sc->hwaddr[0] << 8) |
+ (uint32_t) sc->hwaddr[1]) << 16;
+ cam->p.physical[0][1] = (((uint32_t) sc->hwaddr[2] << 8) |
+ (uint32_t) sc->hwaddr[3]) << 16;
+ cam->p.physical[0][2] = (((uint32_t) sc->hwaddr[4] << 8) |
+ (uint32_t) sc->hwaddr[5]) << 16;
+ for (idx = 1; idx < CAM_PERFECT_ENTRIES; idx++) {
+ cam->p.physical[idx][0] = 0xFFFF0000;
+ cam->p.physical[idx][1] = 0xFFFF0000;
+ cam->p.physical[idx][2] = 0xFFFF0000;
+ }
+#else
+ cam->p.physical[0][0] = ((uint32_t) sc->hwaddr[0]) |
+ (((uint32_t) sc->hwaddr[1]) << 8);
+ cam->p.physical[0][1] = ((uint32_t) sc->hwaddr[2]) |
+ (((uint32_t) sc->hwaddr[3]) << 8);
+ cam->p.physical[0][2] = ((uint32_t) sc->hwaddr[4]) |
+ (((uint32_t) sc->hwaddr[5]) << 8);
+ for (idx = 1; idx < CAM_PERFECT_ENTRIES; idx++) {
+ cam->p.physical[idx][0] = 0x0000FFFF;
+ cam->p.physical[idx][1] = 0x0000FFFF;
+ cam->p.physical[idx][2] = 0x0000FFFF;
+ }
+#endif
+
+ pkt->flags |= ETH_TX_SETUP;
+ sc->state = eth_state_setup;
+ if (tulip_transmit(sc, pkt) != 0) {
+ xprintf("%s: failed setup\n", tulip_devname(sc));
+ dumpstat(sc);
+ eth_free_pkt(sc, pkt);
+ }
+ }
+}
+
+static void
+tulip_setspeed(tulip_softc *sc, int speed)
+{
+ switch (sc->device) {
+ case K_PCI_ID_DC21040:
+ dc21040_set_speed(sc, speed);
+ break;
+ case K_PCI_ID_DC21041:
+ dc21041_set_speed(sc, speed);
+ break;
+ case K_PCI_ID_DC21140:
+ dc21140_set_speed(sc, speed, 0);
+ break;
+ case K_PCI_ID_DC21143:
+ dc21143_set_speed(sc, speed);
+ break;
+ default:
+ break;
+ }
+}
+
+static void
+tulip_setloopback(tulip_softc *sc, int mode)
+{
+ switch (sc->device) {
+ case K_PCI_ID_DC21040:
+ dc21040_set_loopback(sc, mode);
+ break;
+ case K_PCI_ID_DC21041:
+ dc21041_set_loopback(sc, mode);
+ break;
+ case K_PCI_ID_DC21140:
+ dc21140_set_loopback(sc, mode);
+ break;
+ case K_PCI_ID_DC21143:
+ dc21143_set_loopback(sc, mode);
+ break;
+ default:
+ break;
+ }
+ cfe_sleep(CFE_HZ/10);
+}
+
+
+static void
+tulip_isr(void *arg)
+{
+ uint32_t status;
+ uint32_t csr5;
+ tulip_softc *sc = (tulip_softc *)arg;
+
+#if IPOLL
+ sc->interrupts++;
+#endif
+
+ for (;;) {
+
+ /* Read the interrupt status. */
+ csr5 = READCSR(sc, R_CSR_STATUS);
+ status = csr5 & (
+ M_CSR5_RXINT | M_CSR5_RXBUFUNAVAIL |
+ M_CSR5_TXINT | M_CSR5_TXUNDERFLOW |
+ M_CSR5_FATALBUSERROR);
+
+ /* if there are no more interrupts, leave now. */
+ if (status == 0) break;
+
+ /* Clear the pending interrupt. */
+ WRITECSR(sc, R_CSR_STATUS, status);
+
+ /* Now, test each unmasked bit in the interrupt register and
+ handle each interrupt type appropriately. */
+
+ if (status & M_CSR5_FATALBUSERROR) {
+ WRITECSR(sc, R_CSR_INTMASK, 0);
+
+ xprintf("%s: bus error %02x\n",
+ tulip_devname(sc), G_CSR5_ERRORBITS(csr5));
+ dumpstat(sc);
+ sc->bus_errors++;
+ if (sc->bus_errors >= 2) {
+ dumpcsrs(sc);
+ RESET_ADAPTER(sc);
+ sc->state = eth_state_off;
+ sc->bus_errors = 0;
+ }
+#if IPOLL
+ else
+ WRITECSR(sc, R_CSR_INTMASK, sc->intmask);
+#endif
+ }
+
+ if (status & M_CSR5_RXINT) {
+#if IPOLL
+ sc->rx_interrupts++;
+#endif
+ tulip_procrxring(sc);
+ }
+
+ if (status & M_CSR5_TXINT) {
+#if IPOLL
+ sc->tx_interrupts++;
+#endif
+ tulip_proctxring(sc);
+ }
+
+ if (status & (M_CSR5_TXUNDERFLOW | M_CSR5_RXBUFUNAVAIL)) {
+ if (status & M_CSR5_TXUNDERFLOW) {
+ xprintf("%s: tx underrun, %08x\n", tulip_devname(sc), csr5);
+ /* Try to restart */
+ WRITECSR(sc, R_CSR_TXPOLL, 1);
+ }
+ if (status & M_CSR5_RXBUFUNAVAIL) {
+ /* Try to restart */
+ WRITECSR(sc, R_CSR_RXPOLL, 1);
+ }
+ }
+ }
+}
+
+
+static void
+tulip_start(tulip_softc *sc)
+{
+ uint32_t opmode;
+
+ tulip_hwinit(sc);
+
+ WRITECSR(sc, R_CSR_RXRING, PTR_TO_PCI(sc->rxdscr_start));
+ WRITECSR(sc, R_CSR_TXRING, PTR_TO_PCI(sc->txdscr_start));
+
+ opmode = READCSR(sc, R_CSR_OPMODE);
+ opmode &=~ M_CSR6_OPMODE; /* no loopback */
+ if (sc->loopback != ETHER_LOOPBACK_OFF) {
+ opmode &=~ M_CSR6_FULLDUPLEX;
+ opmode |= M_CSR6_PORTSEL;
+ if (sc->loopback == ETHER_LOOPBACK_EXT)
+ opmode |= M_CSR6_EXTLOOPBACK;
+ else
+ opmode |= M_CSR6_INTLOOPBACK;
+ }
+
+ sc->intmask = 0;
+ WRITECSR(sc, R_CSR_INTMASK, 0); /* no interrupts */
+ WRITECSR(sc, R_CSR_STATUS, 0x1FFFF); /* clear any pending */
+ READCSR(sc, R_CSR_STATUS); /* push the write */
+
+ sc->interrupts = 0;
+ sc->rx_interrupts = sc->tx_interrupts = 0;
+
+#if IPOLL
+ cfe_request_irq(sc->irq, tulip_isr, sc, CFE_IRQ_FLAGS_SHARED, 0);
+
+ sc->intmask = M_CSR7_RXINT | M_CSR7_TXINT |
+ M_CSR7_NORMALINT;
+ sc->intmask |= M_CSR7_FATALBUSERROR | M_CSR7_TXUNDERFLOW |
+ M_CSR7_ABNORMALINT;
+ WRITECSR(sc, R_CSR_INTMASK, sc->intmask);
+#endif
+
+ if (sc->loopback == ETHER_LOOPBACK_OFF) {
+ opmode |= M_CSR6_TXSTART;
+ WRITECSR(sc, R_CSR_OPMODE, opmode);
+ tulip_setaddr(sc);
+ }
+ else {
+ opmode |= M_CSR6_TXSTART | M_CSR6_RXSTART;
+ WRITECSR(sc, R_CSR_OPMODE, opmode);
+ }
+}
+
+static void
+tulip_stop(tulip_softc *sc)
+{
+ uint32_t opmode;
+ uint32_t status;
+ int count;
+
+ WRITECSR(sc, R_CSR_INTMASK, 0);
+ sc->intmask = 0;
+#if IPOLL
+ cfe_free_irq(sc->irq, 0);
+#endif
+ WRITECSR(sc, R_CSR_STATUS, 0x1FFFF);
+ opmode = READCSR(sc, R_CSR_OPMODE);
+ opmode &=~ (M_CSR6_TXSTART | M_CSR6_RXSTART);
+ WRITECSR(sc, R_CSR_OPMODE, opmode);
+
+ /* wait for any DMA activity to terminate */
+ for (count = 0; count <= 13; count++) {
+ status = READCSR(sc, R_CSR_STATUS);
+ if ((status & (M_CSR5_RXPROCSTATE | M_CSR5_TXPROCSTATE)) == 0)
+ break;
+ cfe_sleep(CFE_HZ/10);
+ }
+ if (count > 13) {
+ xprintf("%s: idle state not achieved\n", tulip_devname(sc));
+ dumpstat(sc);
+ RESET_ADAPTER(sc);
+ sc->state = eth_state_uninit;
+#if 1
+ sc->linkspeed = ETHER_SPEED_AUTO;
+#endif
+ }
+ else if (sc->loopback != ETHER_LOOPBACK_OFF) {
+ tulip_setloopback(sc, ETHER_LOOPBACK_OFF);
+ opmode &=~ M_CSR6_OPMODE;
+ WRITECSR(sc, R_CSR_OPMODE, opmode);
+ }
+
+ if (sc->outpkts > 1) {
+ /* heuristic: suppress stats for initial mode changes */
+ xprintf("%s: %d sent, %d received, %d interrupts\n",
+ tulip_devname(sc), sc->outpkts, sc->inpkts, sc->interrupts);
+ xprintf(" %d rx interrupts, %d tx interrupts\n",
+ sc->rx_interrupts, sc->tx_interrupts);
+ }
+}
+
+
+/* *********************************************************************
+ * ETH_PARSE_XDIGIT(c)
+ *
+ * Parse a hex digit, returning its value
+ *
+ * Input parameters:
+ * c - character
+ *
+ * Return value:
+ * hex value, or -1 if invalid
+ ********************************************************************* */
+static int
+eth_parse_xdigit(char c)
+{
+ int digit;
+
+ if ((c >= '0') && (c <= '9')) digit = c - '0';
+ else if ((c >= 'a') && (c <= 'f')) digit = c - 'a' + 10;
+ else if ((c >= 'A') && (c <= 'F')) digit = c - 'A' + 10;
+ else digit = -1;
+
+ return digit;
+}
+
+/* *********************************************************************
+ * ETH_PARSE_HWADDR(str,hwaddr)
+ *
+ * Convert a string in the form xx:xx:xx:xx:xx:xx into a 6-byte
+ * Ethernet address.
+ *
+ * Input parameters:
+ * str - string
+ * hwaddr - pointer to hardware address
+ *
+ * Return value:
+ * 0 if ok, else -1
+ ********************************************************************* */
+static int
+eth_parse_hwaddr(char *str, uint8_t *hwaddr)
+{
+ int digit1, digit2;
+ int idx = ENET_ADDR_LEN;
+
+ while (*str && (idx > 0)) {
+ digit1 = eth_parse_xdigit(*str);
+ if (digit1 < 0) return -1;
+ str++;
+ if (!*str) return -1;
+
+ if ((*str == ':') || (*str == '-')) {
+ digit2 = digit1;
+ digit1 = 0;
+ }
+ else {
+ digit2 = eth_parse_xdigit(*str);
+ if (digit2 < 0) return -1;
+ str++;
+ }
+
+ *hwaddr++ = (digit1 << 4) | digit2;
+ idx--;
+
+ if ((*str == ':') || (*str == '-'))
+ str++;
+ }
+ return 0;
+}
+
+/* *********************************************************************
+ * ETH_INCR_HWADDR(hwaddr,incr)
+ *
+ * Increment a 6-byte Ethernet hardware address, with carries
+ *
+ * Input parameters:
+ * hwaddr - pointer to hardware address
+ * incr - desired increment
+ *
+ * Return value:
+ * none
+ ********************************************************************* */
+static void
+eth_incr_hwaddr(uint8_t *hwaddr, unsigned incr)
+{
+ int idx;
+ int carry;
+
+ idx = 5;
+ carry = incr;
+ while (idx >= 0 && carry != 0) {
+ unsigned sum = hwaddr[idx] + carry;
+
+ hwaddr[idx] = sum & 0xFF;
+ carry = sum >> 8;
+ idx--;
+ }
+}
+
+
+/* *********************************************************************
+ * Declarations for CFE Device Driver Interface routines
+ ********************************************************************* */
+
+static int tulip_ether_open(cfe_devctx_t *ctx);
+static int tulip_ether_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int tulip_ether_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat);
+static int tulip_ether_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int tulip_ether_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int tulip_ether_close(cfe_devctx_t *ctx);
+#if 0
+static void tulip_ether_reset(void *softc);
+#endif
+
+/* *********************************************************************
+ * CFE Device Driver dispatch structure
+ ********************************************************************* */
+
+const static cfe_devdisp_t tulip_ether_dispatch = {
+ tulip_ether_open,
+ tulip_ether_read,
+ tulip_ether_inpstat,
+ tulip_ether_write,
+ tulip_ether_ioctl,
+ tulip_ether_close,
+ NULL, /* tulip_ether_poll */
+ NULL /* tulip_ether_reset */
+};
+
+/* *********************************************************************
+ * CFE Device Driver descriptor
+ ********************************************************************* */
+
+const cfe_driver_t dc21143drv = {
+ "DC21x4x Ethernet",
+ "eth",
+ CFE_DEV_NETWORK,
+ &tulip_ether_dispatch,
+ tulip_ether_probe
+};
+
+
+static int
+tulip_ether_attach(cfe_driver_t *drv,
+ pcitag_t tag, int index, uint8_t hwaddr[])
+{
+ tulip_softc *softc;
+ uint32_t device;
+ uint32_t class;
+ uint32_t reg;
+ phys_addr_t pa;
+ const char *devname;
+ char descr[100];
+ uint8_t romaddr[ENET_ADDR_LEN];
+
+ device = pci_conf_read(tag, R_CFG_CFID);
+ class = pci_conf_read(tag, R_CFG_CFRV);
+
+ reg = pci_conf_read(tag, R_CFG_CPMS);
+
+ reg = pci_conf_read(tag, R_CFG_CFDD);
+ pci_conf_write(tag, R_CFG_CFDD, 0);
+ reg = pci_conf_read(tag, R_CFG_CFDD);
+
+#if 1
+ /* Use memory space for the CSRs */
+ pci_map_mem(tag, R_CFG_CBMA, PCI_MATCH_BITS, &pa);
+#else
+ /* Use i/o space for the CSRs */
+ pci_map_io(tag, R_CFG_CBIO, PCI_MATCH_BITS, &pa);
+#endif
+
+ softc = (tulip_softc *) KMALLOC(sizeof(tulip_softc), 0);
+ if (softc == NULL) {
+ xprintf("DC21x4x: No memory to complete probe\n");
+ return 0;
+ }
+ memset(softc, 0, sizeof(*softc));
+
+ softc->membase = (uint32_t)pa;
+ softc->irq = pci_conf_read(tag, R_CFG_CFIT) & 0xFF;
+
+ softc->tag = tag;
+ softc->device = PCI_PRODUCT(device);
+ softc->revision = PCI_REVISION(class);
+ softc->devctx = NULL;
+
+#if 1
+ softc->linkspeed = ETHER_SPEED_AUTO; /* select autonegotiation */
+#else
+ softc->linkspeed = ETHER_SPEED_100FDX; /* 100 Mbps, full duplex */
+#endif
+ softc->loopback = ETHER_LOOPBACK_OFF;
+ memcpy(softc->hwaddr, hwaddr, ENET_ADDR_LEN);
+
+ tulip_init(softc);
+
+ /* Prefer address in srom */
+ if (rom_read_addr(softc, romaddr) == 0) {
+ memcpy(softc->hwaddr, romaddr, ENET_ADDR_LEN);
+ }
+
+ softc->state = eth_state_uninit;
+
+ switch (PCI_PRODUCT(device)) {
+ case K_PCI_ID_DC21040:
+ devname = "DC21040"; break;
+ case K_PCI_ID_DC21041:
+ devname = "DC21041"; break;
+ case K_PCI_ID_DC21140:
+ devname = "DC21140"; break;
+ case K_PCI_ID_DC21143:
+ devname = "DC21143"; break;
+ default:
+ devname = "DC21x4x"; break;
+ }
+
+ xsprintf(descr, "%s Ethernet at 0x%X (%02X-%02X-%02X-%02X-%02X-%02X)",
+ devname, softc->membase,
+ softc->hwaddr[0], softc->hwaddr[1], softc->hwaddr[2],
+ softc->hwaddr[3], softc->hwaddr[4], softc->hwaddr[5]);
+
+ cfe_attach(drv, softc, NULL, descr);
+ return 1;
+}
+
+
+/* *********************************************************************
+ * TULIP_ETHER_PROBE(drv,probe_a,probe_b,probe_ptr)
+ *
+ * Probe and install drivers for all DC21x4x Ethernet controllers.
+ * For each, create a context structure and attach to the
+ * specified network device.
+ *
+ * Input parameters:
+ * drv - driver descriptor
+ * probe_a - not used
+ * probe_b - not used
+ * probe_ptr - string pointer to hardware address for the first
+ * MAC, in the form xx:xx:xx:xx:xx:xx
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+static void
+tulip_ether_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr)
+{
+ int index;
+ int n;
+ uint8_t hwaddr[ENET_ADDR_LEN];
+
+ if (probe_ptr)
+ eth_parse_hwaddr((char *) probe_ptr, hwaddr);
+ else {
+ /* use default address 40-00-00-10-11-11 */
+ hwaddr[0] = 0x40; hwaddr[1] = 0x00; hwaddr[2] = 0x00;
+ hwaddr[3] = 0x10; hwaddr[4] = 0x11; hwaddr[5] = 0x11;
+ }
+
+ n = 0;
+ index = 0;
+ for (;;) {
+ pcitag_t tag;
+ pcireg_t device;
+
+ if (pci_find_class(PCI_CLASS_NETWORK, index, &tag) != 0)
+ break;
+
+ index++;
+
+ device = pci_conf_read(tag, R_CFG_CFID);
+ if (PCI_VENDOR(device) == K_PCI_VENDOR_DEC) {
+#if 0 /* this currently (2.1.1) generates a bad code in PIC mode */
+ switch (PCI_PRODUCT(device)) {
+ case K_PCI_ID_DC21040:
+ case K_PCI_ID_DC21041:
+ case K_PCI_ID_DC21140:
+ case K_PCI_ID_DC21143:
+ tulip_ether_attach(drv, tag, n, hwaddr);
+ n++;
+ eth_incr_hwaddr(hwaddr, 1);
+ break;
+ default:
+ break;
+ }
+#else
+ if (PCI_PRODUCT(device) == K_PCI_ID_DC21040 ||
+ PCI_PRODUCT(device) == K_PCI_ID_DC21041 ||
+ PCI_PRODUCT(device) == K_PCI_ID_DC21140 ||
+ PCI_PRODUCT(device) == K_PCI_ID_DC21143) {
+
+ tulip_ether_attach(drv, tag, n, hwaddr);
+ n++;
+ eth_incr_hwaddr(hwaddr, 1);
+ }
+#endif
+ }
+ }
+}
+
+
+/* The functions below are called via the dispatch vector for the 21x4x. */
+
+/* *********************************************************************
+ * TULIP_ETHER_OPEN(ctx)
+ *
+ * Open the Ethernet device. The MAC is reset, initialized, and
+ * prepared to receive and send packets.
+ *
+ * Input parameters:
+ * ctx - device context (includes ptr to our softc)
+ *
+ * Return value:
+ * status, 0 = ok
+ ********************************************************************* */
+static int
+tulip_ether_open(cfe_devctx_t *ctx)
+{
+ tulip_softc *softc = ctx->dev_softc;
+
+ if (softc->state == eth_state_on)
+ tulip_stop(softc);
+
+ softc->devctx = ctx;
+ tulip_start(softc);
+
+#if XPOLL
+ tulip_isr(softc);
+#endif
+
+ return 0;
+}
+
+/* *********************************************************************
+ * TULIP_ETHER_READ(ctx,buffer)
+ *
+ * Read a packet from the Ethernet device. If no packets are
+ * available, the read will succeed but return 0 bytes.
+ *
+ * Input parameters:
+ * ctx - device context (includes ptr to our softc)
+ * buffer - pointer to buffer descriptor.
+ *
+ * Return value:
+ * status, 0 = ok
+ ********************************************************************* */
+static int
+tulip_ether_read(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ tulip_softc *softc = ctx->dev_softc;
+ eth_pkt_t *pkt;
+ int blen;
+
+#if XPOLL
+ tulip_isr(softc);
+#endif
+
+ if (softc->state != eth_state_on) return -1;
+
+ CS_ENTER(softc);
+ pkt = (eth_pkt_t *) q_deqnext(&(softc->rxqueue));
+ CS_EXIT(softc);
+
+ if (pkt == NULL) {
+ buffer->buf_retlen = 0;
+ return 0;
+ }
+
+ blen = buffer->buf_length;
+ if (blen > pkt->length) blen = pkt->length;
+
+ blockcopy(buffer->buf_ptr, pkt->buffer, blen);
+ buffer->buf_retlen = blen;
+
+ eth_free_pkt(softc, pkt);
+ tulip_fillrxring(softc);
+
+#if XPOLL
+ tulip_isr(softc);
+#endif
+
+ return 0;
+}
+
+/* *********************************************************************
+ * TULIP_ETHER_INPSTAT(ctx,inpstat)
+ *
+ * Check for received packets on the Ethernet device
+ *
+ * Input parameters:
+ * ctx - device context (includes ptr to our softc)
+ * inpstat - pointer to input status structure
+ *
+ * Return value:
+ * status, 0 = ok
+ ********************************************************************* */
+static int
+tulip_ether_inpstat(cfe_devctx_t *ctx, iocb_inpstat_t *inpstat)
+{
+ tulip_softc *softc = ctx->dev_softc;
+
+#if XPOLL
+ tulip_isr(softc);
+#endif
+
+ if (softc->state != eth_state_on) return -1;
+
+ /* We avoid an interlock here because the result is a hint and an
+ interrupt cannot turn a non-empty queue into an empty one. */
+ inpstat->inp_status = (q_isempty(&(softc->rxqueue))) ? 0 : 1;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * TULIP_ETHER_WRITE(ctx,buffer)
+ *
+ * Write a packet to the Ethernet device.
+ *
+ * Input parameters:
+ * ctx - device context (includes ptr to our softc)
+ * buffer - pointer to buffer descriptor.
+ *
+ * Return value:
+ * status, 0 = ok
+ ********************************************************************* */
+static int
+tulip_ether_write(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ tulip_softc *softc = ctx->dev_softc;
+ eth_pkt_t *pkt;
+ int blen;
+
+#if XPOLL
+ tulip_isr(softc);
+#endif
+
+ if (softc->state != eth_state_on) return -1;
+
+ pkt = eth_alloc_pkt(softc);
+ if (!pkt) return CFE_ERR_NOMEM;
+
+ blen = buffer->buf_length;
+ if (blen > pkt->length) blen = pkt->length;
+
+ blockcopy(pkt->buffer, buffer->buf_ptr, blen);
+ pkt->length = blen;
+
+ if (tulip_transmit(softc, pkt) != 0) {
+ eth_free_pkt(softc,pkt);
+ return CFE_ERR_IOERR;
+ }
+
+#if XPOLL
+ tulip_isr(softc);
+#endif
+
+ return 0;
+}
+
+/* *********************************************************************
+ * TULIP_ETHER_IOCTL(ctx,buffer)
+ *
+ * Do device-specific I/O control operations for the device
+ *
+ * Input parameters:
+ * ctx - device context (includes ptr to our softc)
+ * buffer - pointer to buffer descriptor.
+ *
+ * Return value:
+ * status, 0 = ok
+ ********************************************************************* */
+static int
+tulip_ether_ioctl(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ tulip_softc *softc = ctx->dev_softc;
+ int *argp;
+ int mode;
+ int speed;
+
+ switch ((int)buffer->buf_ioctlcmd) {
+ case IOCTL_ETHER_GETHWADDR:
+ memcpy(buffer->buf_ptr, softc->hwaddr, sizeof(softc->hwaddr));
+ return 0;
+
+ case IOCTL_ETHER_SETHWADDR:
+ return -1; /* not supported */
+
+ case IOCTL_ETHER_GETSPEED:
+ argp = (int *) buffer->buf_ptr;
+ *argp = softc->linkspeed;
+ return 0;
+
+ case IOCTL_ETHER_SETSPEED:
+ tulip_stop(softc);
+ tulip_resetrings(softc);
+ speed = *((int *) buffer->buf_ptr);
+ tulip_setspeed(softc, speed);
+ tulip_start(softc);
+ softc->state = eth_state_on;
+ return 0;
+
+ case IOCTL_ETHER_GETLINK:
+ argp = (int *) buffer->buf_ptr;
+ *argp = softc->linkspeed;
+ return 0;
+
+ case IOCTL_ETHER_GETLOOPBACK:
+ *((int *) buffer) = softc->loopback;
+ return 0;
+
+ case IOCTL_ETHER_SETLOOPBACK:
+ tulip_stop(softc);
+ tulip_resetrings(softc);
+ mode = *((int *) buffer->buf_ptr);
+ softc->loopback = ETHER_LOOPBACK_OFF; /* default */
+ if (mode == ETHER_LOOPBACK_INT || mode == ETHER_LOOPBACK_EXT) {
+ tulip_setloopback(softc, mode);
+ }
+ tulip_start(softc);
+ softc->state = eth_state_on;
+ return 0;
+
+ default:
+ return -1;
+ }
+}
+
+/* *********************************************************************
+ * TULIP_ETHER_CLOSE(ctx)
+ *
+ * Close the Ethernet device.
+ *
+ * Input parameters:
+ * ctx - device context (includes ptr to our softc)
+ *
+ * Return value:
+ * status, 0 = ok
+ ********************************************************************* */
+static int
+tulip_ether_close(cfe_devctx_t *ctx)
+{
+ tulip_softc *softc = ctx->dev_softc;
+
+ softc->state = eth_state_off;
+ tulip_stop(softc);
+
+ /* resynchronize descriptor rings */
+ tulip_resetrings(softc);
+
+ softc->devctx = NULL;
+ return 0;
+}
+
+
+#if 0
+/* *********************************************************************
+ * TULIP_ETHER_POLL(ctx,ticks)
+ *
+ * TBD
+ *
+ * Input parameters:
+ * ctx - device context (includes ptr to our softc)
+ * ticks- current time in ticks
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void
+tulip_ether_poll(cfe_devctx_t *ctx, int64_t ticks)
+{
+}
+
+/* *********************************************************************
+ * TULIP_ETHER_RESET(softc)
+ *
+ * This routine is called when CFE is restarted after a
+ * program exits. We can clean up pending I/Os here.
+ *
+ * Input parameters:
+ * softc - pointer to tulip_softc
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void
+tulip_ether_reset(void *softc)
+{
+ tulip_softc *sc = (tulip_softc *)softc;
+
+ /* Turn off the Ethernet interface. */
+
+ RESET_ADAPTER(sc);
+}
+#endif
diff --git a/cfe/cfe/dev/dp83815.h b/cfe/cfe/dev/dp83815.h
new file mode 100644
index 0000000..1d50422
--- /dev/null
+++ b/cfe/cfe/dev/dp83815.h
@@ -0,0 +1,559 @@
+/*
+ * Register and bit definitions for the National Semiconductor
+ * DP83815 10/100 Integrated Ethernet MAC and PHY.
+ * Reference:
+ * DP83815 10/100 Mb/s Integrated PCI Ethernet Media Access
+ * Controller and Physical Layer (MacPhyter)
+ * Hardware Reference Manual, Revision 1.0.
+ * National Semiconductor Corp., December 2000
+ */
+#ifndef _DP83815_H_
+#define _DP83815_H_
+
+#define _DD_MAKEMASK1(n) (1 << (n))
+#define _DD_MAKEMASK(v,n) ((((1)<<(v))-1) << (n))
+#define _DD_MAKEVALUE(v,n) ((v) << (n))
+#define _DD_GETVALUE(v,n,m) (((v) & (m)) >> (n))
+
+
+/* PCI Configuration Register offsets (MacPhyter nomenclature) */
+
+#define R_CFGID PCI_ID_REG
+#define K_PCI_VENDOR_NSC 0x100B
+#define K_PCI_ID_DP83815 0x0020
+
+#define R_CFGCS PCI_COMMAND_STATUS_REG
+#define R_CFGRID PCI_CLASS_REG
+#define R_CFGLAT PCI_BHLC_REG
+
+#define R_CFGIOA PCI_MAPREG(0)
+#define R_CFGMA PCI_MAPREG(1)
+
+#define R_CFGSID PCI_SUBSYS_ID_REG
+#define R_CFGROM PCI_MAPREG_ROM
+#define R_CAPPTR PCI_CAPLISTPTR_REG
+#define R_CFGINT PCI_BPARAM_INTERRUPT_REG
+
+/* Power management capability */
+#define R_PMCAP 0x40
+#define R_PMCSR 0x44
+
+
+/* MacPhyter Operational Register offsets */
+
+#define R_CR 0x00
+#define R_CFG 0x04
+#define R_MEAR 0x08
+#define R_PTSCR 0x0C
+#define R_ISR 0x10
+#define R_IMR 0x14
+#define R_IER 0x18
+#define R_TXDP 0x20
+#define R_TXCFG 0x24
+#define R_RXDP 0x30
+#define R_RXCFG 0x34
+#define R_CCSR 0x3C
+#define R_WCSR 0x40
+#define R_PCR 0x44
+#define R_RFCR 0x48
+#define R_RFDR 0x4C
+#define R_BRAR 0x50
+#define R_BRDR 0x54
+#define R_SRR 0x58
+#define R_MIBC 0x5C
+#define R_MIB(n) (0x60+4*(n))
+
+/* MacPhyter MIB Registers */
+
+#define R_MIB_RXErroredPkts R_MIB(0)
+#define R_MIB_RXFCSErrors R_MIB(1)
+#define R_MIB_RXMsdPktErrors R_MIB(2)
+#define R_MIB_RXFAErrors R_MIB(3)
+#define R_MIB_RXSymbolErrors R_MIB(4)
+#define R_MIB_RXFrameTooLong R_MIB(5)
+#define R_MIB_TXSQEErrors R_MIB(6)
+
+#define N_MIB_REGISTERS 7
+
+
+/* MacPhyter Internal PHY Register offsets */
+
+#define R_BMCR 0x80
+#define R_BMSR 0x84
+#define R_PHYIDR1 0x88
+#define R_PHYIDR2 0x8C
+#define R_ANAR 0x90
+#define R_ANLPAR 0x94
+#define R_ANER 0x98
+#define R_ANNPTR 0x9C
+#define R_PHYSTS 0xC0
+#define R_MICR 0xC4
+#define R_MISR 0xC8
+#define R_FCSCR 0xD0
+#define R_RECR 0xD4
+#define R_PHYCR 0xE4
+#define R_TBTSCR 0xE8
+
+/* Undocumented, updated for CVNG (SRR=0x0302) parts */
+
+#define R_PGSEL 0xCC
+#define R_PMDCSR 0xE4 /* R_PHYCR */
+#define R_DSPCFG 0xF4
+#define R_SDCFG 0xF8
+#define R_TSTDAT 0xFC
+
+
+/* 0x00 CR: Command Register */
+
+#define M_CR_TXE _DD_MAKEMASK1(0)
+#define M_CR_TXD _DD_MAKEMASK1(1)
+#define M_CR_RXE _DD_MAKEMASK1(2)
+#define M_CR_RXD _DD_MAKEMASK1(3)
+#define M_CR_TXR _DD_MAKEMASK1(4)
+#define M_CR_RXR _DD_MAKEMASK1(5)
+#define M_CR_SWI _DD_MAKEMASK1(7)
+#define M_CR_RST _DD_MAKEMASK1(8)
+
+
+/* 0x04 CFG: Configuration and Media Status Register */
+
+#define M_CFG_BEM _DD_MAKEMASK1(0)
+#define M_CFG_BROM_DIS _DD_MAKEMASK1(2)
+#define M_CFG_PESEL _DD_MAKEMASK1(3)
+#define M_CFG_EXD _DD_MAKEMASK1(4)
+#define M_CFG_POW _DD_MAKEMASK1(5)
+#define M_CFG_SB _DD_MAKEMASK1(6)
+#define M_CFG_REQALG _DD_MAKEMASK1(7)
+#define M_CFG_EUPHCOMP _DD_MAKEMASK1(8)
+#define M_CFG_PHY_DIS _DD_MAKEMASK1(9)
+#define M_CFG_PHY_RST _DD_MAKEMASK1(10)
+#define M_CFG_EXT_PHY _DD_MAKEMASK1(12)
+
+#define S_CFG_ANEG_SEL 13
+#define M_CFG_ANEG_SEL _DD_MAKEMASK(3,S_CFG_ANEG_SEL)
+#define V_CFG_ANEG_SEL(x) _DD_MAKEVALUE(x,S_CFG_ANEG_SEL)
+#define G_CFG_ANEG_SEL(x) _DD_GETVALUE(x,S_CFG_ANEG_SEL,M_CFG_ANEG_SEL)
+
+#define K_ANEG_10H 0x0
+#define K_ANEG_100H 0x2
+#define K_ANEG_10F 0x4
+#define K_ANEG_100F 0x6
+#define K_ANEG_10HF 0x1
+#define K_ANEG_10H_100H 0x3
+#define K_ANEG_100HF 0x5
+#define K_ANEG_10HF_100HF 0x7
+#define K_ANEG_ALL 0x7
+
+#define M_CFG_PAUSE_ADV _DD_MAKEMASK1(16)
+#define M_CFG_PINT_ACEN _DD_MAKEMASK1(17)
+
+#define S_CFG_PHY_CFG 18
+#define M_CFG_PHY_CFG _DD_MAKEMASK(6,S_CFG_PHY_CFG)
+
+#define M_CFG_ANEG_DN _DD_MAKEMASK1(27)
+#define M_CFG_POL _DD_MAKEMASK1(28)
+#define M_CFG_FDUP _DD_MAKEMASK1(29)
+#define M_CFG_SPEED100 _DD_MAKEMASK1(30)
+#define M_CFG_LNKSTS _DD_MAKEMASK1(31)
+#define M_CFG_LNKSUMMARY (M_CFG_LNKSTS | M_CFG_SPEED100 | M_CFG_FDUP)
+
+
+/* 0x08 MEAR: EEPROM Access Register (see 4.2.4 for EEPROM Map) */
+
+#define M_MEAR_EEDI _DD_MAKEMASK1(0)
+#define M_MEAR_EEDO _DD_MAKEMASK1(1)
+#define M_MEAR_EECLK _DD_MAKEMASK1(2)
+#define M_MEAR_EESEL _DD_MAKEMASK1(3)
+#define M_MEAR_MDIO _DD_MAKEMASK1(4)
+#define M_MEAR_MDDIR _DD_MAKEMASK1(5)
+#define M_MEAR_MDC _DD_MAKEMASK1(6)
+
+
+/* 0x0C PTSCR: PCI Test Control Register */
+
+#define M_PTSCR_EEBIST_FAIL _DD_MAKEMASK1(0)
+#define M_PTSCR_EEBIST_EN _DD_MAKEMASK1(1)
+#define M_PTSCR_EELOAD_EN _DD_MAKEMASK1(2)
+#define M_PTSCR_RBIST_RXFFAIL _DD_MAKEMASK1(3)
+#define M_PTSCR_RBIST_TXFAIL _DD_MAKEMASK1(4)
+#define M_PTSCR_RBIST_RXFAIL _DD_MAKEMASK1(5)
+#define M_PTSCR_RBIST_DONE _DD_MAKEMASK1(6)
+#define M_PTSCR_RBIST_EN _DD_MAKEMASK1(7)
+#define M_PTSCR_MBZ8 _DD_MAKEMASK1(8)
+#define M_PTSCR_MBZ9 _DD_MAKEMASK1(9)
+#define M_PTSCR_RBIST_RST _DD_MAKEMASK1(10)
+#define M_PTSCR_MBZ12 _DD_MAKEMASK1(12)
+
+
+/* 0x10 ISR: Interrupt Status Register */
+/* 0x14 IMR: Interrupt Mask Register */
+
+#define M_INT_RXOK _DD_MAKEMASK1(0)
+#define M_INT_RXDESC _DD_MAKEMASK1(1)
+#define M_INT_RXERR _DD_MAKEMASK1(2)
+#define M_INT_RXEARLY _DD_MAKEMASK1(3)
+#define M_INT_RXIDLE _DD_MAKEMASK1(4)
+#define M_INT_RXORN _DD_MAKEMASK1(5)
+#define M_INT_TXOK _DD_MAKEMASK1(6)
+#define M_INT_TXDESC _DD_MAKEMASK1(7)
+#define M_INT_TXERR _DD_MAKEMASK1(8)
+#define M_INT_TXIDLE _DD_MAKEMASK1(9)
+#define M_INT_TXURN _DD_MAKEMASK1(10)
+#define M_INT_MIB _DD_MAKEMASK1(11)
+#define M_INT_SWI _DD_MAKEMASK1(12)
+#define M_INT_PME _DD_MAKEMASK1(13)
+#define M_INT_PHY _DD_MAKEMASK1(14)
+#define M_INT_HIBERR _DD_MAKEMASK1(15)
+#define M_INT_RXSOVR _DD_MAKEMASK1(16)
+#define M_INT_RTABT _DD_MAKEMASK1(20)
+#define M_INT_RMABT _DD_MAKEMASK1(21)
+#define M_INT_SSERR _DD_MAKEMASK1(22)
+#define M_INT_DPERR _DD_MAKEMASK1(23)
+#define M_INT_RXRCMP _DD_MAKEMASK1(24)
+#define M_INT_TXRCMP _DD_MAKEMASK1(25)
+
+
+/* 0x18 IER: Interrupt Enable Register */
+
+#define M_IER_IE _DD_MAKEMASK1(0)
+
+
+/* 0x20 TXDP: Transmit Descriptor Pointer Register */
+
+
+/* 0x24 TXCFG: Transmit Configuration Register */
+
+#define S_TXCFG_DRTH 0
+#define M_TXCFG_DRTH _DD_MAKEMASK(6,S_TXCFG_DRTH)
+#define V_TXCFG_DRTH(x) _DD_MAKEVALUE(x,S_TXCFG_DRTH)
+#define G_TXCFG_DRTH(x) _DD_GETVALUE(x,S_TXCFG_DRTH,M_TXCFG_DRTH)
+
+#define S_TXCFG_FLTH 8
+#define M_TXCFG_FLTH _DD_MAKEMASK(6,S_TXCFG_FLTH)
+#define V_TXCFG_FLTH(x) _DD_MAKEVALUE(x,S_TXCFG_FLTH)
+#define G_TXCFG_FLTH(x) _DD_GETVALUE(x,S_TXCFG_FLTH,M_TXCFG_FLTH)
+
+#define S_TXCFG_MXDMA 20
+#define M_TXCFG_MXDMA _DD_MAKEMASK(3,S_TXCFG_MXDMA)
+#define V_TXCFG_MXDMA(x) _DD_MAKEVALUE(x,S_TXCFG_MXDMA)
+#define G_TXCFG_MXDMA(x) _DD_GETVALUE(x,S_TXCFG_MXDMA,M_TXCFG_MXDMA)
+
+/* Max DMA burst size (bytes) - RX also */
+#define K_MXDMA_512 0x0
+#define K_MXDMA_4 0x1
+#define K_MXDMA_8 0x2
+#define K_MXDMA_16 0x3
+#define K_MXDMA_32 0x4
+#define K_MXDMA_64 0x5
+#define K_MXDMA_128 0x6
+#define K_MXDMA_256 0x7
+
+#define M_TXCFG_ECRETRY _DD_MAKEMASK1(23)
+
+#define S_TXCFG_IFG 26
+#define M_TXCFG_IFG _DD_MAKEMASK(2,S_TXCFG_IFG)
+#define V_TXCFG_IFG(x) _DD_MAKEVALUE(x,S_TXCFG_IFG)
+#define G_TXCFG_IFG(x) _DD_GETVALUE(x,S_TXCFG_IFG,M_TXCFG_IFG)
+
+#define M_TXCFG_ATP _DD_MAKEMASK1(28)
+#define M_TXCFG_MLB _DD_MAKEMASK1(29)
+#define M_TXCFG_HBI _DD_MAKEMASK1(30)
+#define M_TXCFG_CSI _DD_MAKEMASK1(31)
+
+
+/* 0x30 RXDP: Receive Descriptor Pointer Register */
+
+
+/* 0x34 RXCFG: Receive Configuration Register */
+
+#define S_RXCFG_DRTH 1
+#define M_RXCFG_DRTH _DD_MAKEMASK(5,S_RXCFG_DRTH)
+#define V_RXCFG_DRTH(x) _DD_MAKEVALUE(x,S_RXCFG_DRTH)
+#define G_RXCFG_DRTH(x) _DD_GETVALUE(x,S_RXCFG_DRTH,M_RXCFG_DRTH)
+
+#define S_RXCFG_MXDMA 20
+#define M_RXCFG_MXDMA _DD_MAKEMASK(3,S_RXCFG_MXDMA)
+#define V_RXCFG_MXDMA(x) _DD_MAKEVALUE(x,S_RXCFG_MXDMA)
+#define G_RXCFG_MXDMA(x) _DD_GETVALUE(x,S_RXCFG_MXDMA,M_RXCFG_MXDMA)
+
+#define M_RXCFG_ALP _DD_MAKEMASK1(27)
+#define M_RXCFG_ATX _DD_MAKEMASK1(28)
+#define M_RXCFG_ARP _DD_MAKEMASK1(30)
+#define M_RXCFG_AEP _DD_MAKEMASK1(31)
+
+
+/* 0x3C CCSR: CLKRUN Control/Status Register */
+
+#define M_CCSR_CLKRUN_EN _DD_MAKEMASK1(0)
+#define M_CCSR_PMEEN _DD_MAKEMASK1(8)
+#define M_CCSR_PMESTS _DD_MAKEMASK1(15)
+
+
+/* 0x40 WCSR: Wake Command/Status Register */
+
+#define M_WCSR_WKPHY _DD_MAKEMASK1(0)
+#define M_WCSR_WKUCP _DD_MAKEMASK1(1)
+#define M_WCSR_WKMCP _DD_MAKEMASK1(2)
+#define M_WCSR_WKBCP _DD_MAKEMASK1(3)
+#define M_WCSR_WKARP _DD_MAKEMASK1(4)
+#define M_WCSR_WKPAT0 _DD_MAKEMASK1(5)
+#define M_WCSR_WKPAT1 _DD_MAKEMASK1(6)
+#define M_WCSR_WKPAT2 _DD_MAKEMASK1(7)
+#define M_WCSR_WKPAT3 _DD_MAKEMASK1(8)
+#define M_WCSR_WKMAG _DD_MAKEMASK1(9)
+#define M_WCSR_MPSOE _DD_MAKEMASK1(10)
+#define M_WCSR_SOHACK _DD_MAKEMASK1(20)
+#define M_WCSR_PHYINT _DD_MAKEMASK1(22)
+#define M_WCSR_UCASTR _DD_MAKEMASK1(23)
+#define M_WCSR_MCASTR _DD_MAKEMASK1(24)
+#define M_WCSR_BCASTR _DD_MAKEMASK1(25)
+#define M_WCSR_ARPR _DD_MAKEMASK1(26)
+#define M_WCSR_PATM0 _DD_MAKEMASK1(27)
+#define M_WCSR_PATM1 _DD_MAKEMASK1(28)
+#define M_WCSR_PATM2 _DD_MAKEMASK1(29)
+#define M_WCSR_PATM3 _DD_MAKEMASK1(30)
+#define M_WCSR_MPR _DD_MAKEMASK1(31)
+
+
+/* 0x44 PCR: Pause Control/Status Register */
+
+#define S_PCR_PAUSE_CNT 0
+#define M_PCR_PAUSE_CNT _DD_MAKEMASK(16,S_PCR_PAUSE_CNT)
+#define V_PCR_PAUSE_CNT(x) _DD_MAKEVALUE(x,S_PCR_PAUSE_CNT)
+#define G_PCR_PAUSE_CNT(x) _DD_GETVALUE(x,S_PCR_PAUSE_CNT,M_PCR_PAUSE_CNT)
+
+#define M_PCR_MLD_EN _DD_MAKEMASK1(16)
+#define M_PCR_PSNEG _DD_MAKEMASK1(21)
+#define M_PCR_PS_RCVD _DD_MAKEMASK1(22)
+#define M_PCR_PS_ACT _DD_MAKEMASK1(23)
+#define M_PCR_PS_DA _DD_MAKEMASK1(29)
+#define M_PCR_PS_MCAST _DD_MAKEMASK1(30)
+#define M_PCR_PSEN _DD_MAKEMASK1(31)
+
+
+/* 0x48 RFCR: Receive Filter/Match Control Register */
+
+
+#define S_RFCR_RFADDR 0
+#define M_RFCR_RFADDR _DD_MAKEMASK(10,S_RFCR_RFADDR)
+#define V_RFCR_RFADDR(x) _DD_MAKEVALUE(x,S_RFCR_RFADDR)
+#define G_RFCR_RFADDR(x) _DD_GETVALUE(x,S_RFCR_RFADDR,M_RFCR_RFADDR)
+
+#define K_RFCR_PMATCH_ADDR 0x000
+#define K_RFCR_PCOUNT_ADDR 0x006
+#define K_RFCR_FILTER_ADDR 0x200
+
+#define M_RFCR_ULM _DD_MAKEMASK1(19)
+#define M_RFCR_UHEN _DD_MAKEMASK1(20)
+#define M_RFCR_MHEN _DD_MAKEMASK1(21)
+#define M_RFCR_AARP _DD_MAKEMASK1(22)
+#define M_RFCR_APAT0 _DD_MAKEMASK1(23)
+#define M_RFCR_APAT1 _DD_MAKEMASK1(24)
+#define M_RFCR_APAT2 _DD_MAKEMASK1(25)
+#define M_RFCR_APAT3 _DD_MAKEMASK1(26)
+#define M_RFCR_APAT (M_RFCR_APAT0 | M_RFCR_APAT1 | \
+ M_RFCR_APAT2 | M_RFCR_APAT3 )
+#define M_RFCR_APM _DD_MAKEMASK1(27)
+#define M_RFCR_AAU _DD_MAKEMASK1(28)
+#define M_RFCR_AAM _DD_MAKEMASK1(29)
+#define M_RFCR_AAB _DD_MAKEMASK1(30)
+#define M_RFCR_RFEN _DD_MAKEMASK1(31)
+
+
+/* 0x4C RFDR: Receive Filter/Match Data Register */
+
+#define S_RFDR_RFDATA 0
+#define M_RFDR_RFDATA _DD_MAKEMASK(16,S_RFDR_RFDATA)
+#define V_RFDR_RFDATA(x) _DD_MAKEVALUE(x,S_RFDR_RFDATA)
+#define G_RFDR_RFDATA(x) _DD_GETVALUE(x,S_RFDR_RFDATA,M_RFDR_RFDATA)
+
+#define S_RFDR_BMASK 16
+#define M_RFDR_BMASK _DD_MAKEMASK(2,S_RFDR_BMASK)
+#define V_RFDR_BMASK(x) _DD_MAKEVALUE(x,S_RFDR_BMASK)
+#define G_RFDR_BMASK(x) _DD_GETVALUE(x,S_RFDR_BMASK,M_RFDR_BMASK)
+
+
+/* 0x50 BRAR: Boot ROM Address Register */
+
+#define S_BRAR_ADDR 0
+#define M_BRAR_ADDR _DD_MAKEMASK(16,S_BRAR_ADDR)
+#define V_BRAR_ADDR(x) _DD_MAKEVALUE(x,S_BRAR_ADDR)
+#define G_BRAR_ADDR(x) _DD_GETVALUE(x,S_BRAR_ADDR,M_BRAR_ADDR)
+
+#define M_BRAR_AUTOINC _DD_MAKEMASK1(31)
+
+
+/* 0x54 BRDR: Boot ROM Data Register */
+
+
+/* 0x58 SRR: Silicon Revision Register */
+
+#define S_SRR_REV 0
+#define M_SRR_REV _DD_MAKEMASK(16,S_SRR_REV)
+#define V_SRR_REV(x) _DD_MAKEVALUE(x,S_SRR_REV)
+#define G_SRR_REV(x) _DD_GETVALUE(x,S_SRR_REV,M_SRR_REV)
+
+#define K_REV_CVNG 0x00000302
+#define K_REV_DVNG_UJB 0x00000403
+
+
+/* 0x5C MIBC: Management Information Base Control Register */
+
+#define M_MIBC_WRN _DD_MAKEMASK1(0)
+#define M_MIBC_FRZ _DD_MAKEMASK1(1)
+#define M_MIBC_ACLR _DD_MAKEMASK1(2)
+#define M_MIBC_MIBS _DD_MAKEMASK1(3)
+
+
+/* MIB Counters */
+
+/* 0x60 RXErroredPkts */
+/* 0x64 RXFCSErrors */
+/* 0x68 RXMsdPktErrors */
+/* 0x6C RXFAErrors */
+/* 0x70 RXSymbolErrors */
+/* 0x74 RXFrameTooLong */
+/* 0x78 TXSQEErrors */
+
+
+/* See ../net/mii.h for fields of standard (MII) PHY registers */
+
+#define K_83815_PHYID1 0x2000
+#define K_83815_PHYID2 0x5C21
+
+#define K_ANNPTR_NULL 0x0001
+
+
+/* 0xC0 PHYSTS: PHY Status Register */
+
+#define PHYSTS_RXERRLATCH 0x2000
+#define PHYSTS_POLARITYSTAT 0x1000
+#define PHYSTS_FALSECARRLATCH 0x0800
+#define PHYSTS_SIGNALDETECT 0x0400
+#define PHYSTS_DESCRAMBLOCK 0x0200
+#define PHYSTS_PAGERECVD 0x0100
+#define PHYSTS_MIIINT 0x0080
+#define PHYSTS_REMOTEFAULT 0x0040
+#define PHYSTS_JABBERDET 0x0020
+#define PHYSTS_ANCOMPLETE 0x0010
+#define PHYSTS_LOOPBACK 0x0008
+#define PHYSTS_DUPLEX 0x0004
+#define PHYSTS_SPEED10 0x0002
+#define PHYSTS_LINKSTAT 0x0001
+
+
+/* 0xC4 MICR: MII Interrupt Control Register */
+
+#define MICR_INTEN 0x0002
+#define MICR_TINT 0x0001
+
+
+/* 0xC8 MISR: MII Interrupt Status and Misc. Control Register */
+
+#define MISR_MINT 0x8000
+#define MISR_MSKLINK 0x4000
+#define MISR_MSKJAB 0x2000
+#define MISR_MSKRF 0x1000
+#define MISR_MSKANC 0x0800
+#define MISR_MSKFHF 0x0400
+#define MISR_MSKRHF 0x0200
+
+
+/* 0xD0 FCSCR: False Carrier Sense Counter Register */
+
+#define FCSCR_FCSCNT 0x00FF
+
+
+/* 0xD4 RECR: Receiver Error Counter Register */
+
+#define RECR_RXERCNT 0x00FF
+
+
+/* 0xD8 PCSR: 100 Mb/s PCS Configuration and Status Register */
+
+#define PCSR_BYP4B5B 0x1000
+#define PCSR_FREECLK 0x0800
+#define PCSR_TQEN 0x0400
+#define PCSR_SDFORCEB 0x0200
+#define PCSR_SDOPTION 0x0100
+#define PCSR_FORCE100OK 0x0020
+#define PCSR_NRZIBYPASS 0x0004
+
+
+/* 0xE4 PHYCR: PHY Control Register */
+
+#define PHYCR_PSR15 0x0800
+#define PHYCR_BISTSTATUS 0x0400
+#define PHYCR_BISTSTART 0x0200
+#define PHYCR_BPSTRETCH 0x0100
+#define PHYCR_PAUSESTS 0x0080
+#define PHYCR_PHYADDR 0x001F
+
+
+/* 0xE8 TBTSCR: 10Base-T Status/Control Register */
+
+#define TBTSCR_LPBK10DIS 0x0100
+#define TBTSCR_LPDIS 0x0080
+#define TBTSCR_FORCELINK10 0x0040
+#define TBTSCR_FORCEPOLCOR 0x0020
+#define TBTSCR_POLARITY 0x0010
+#define TBTSCR_AUTOPOLDIS 0x0008
+#define TBTSCR_HBDIS 0x0002
+#define TBTSCR_JABBERDIS 0x0001
+
+
+/* MacPhyter Transmit and Receive Descriptors */
+
+/* Common Command/Status Fields */
+#define S_DES1_SIZE 0
+#define M_DES1_SIZE _DD_MAKEMASK(12,S_DES1_SIZE)
+#define V_DES1_SIZE(x) _DD_MAKEVALUE(x,S_DES1_SIZE)
+#define G_DES1_SIZE(x) _DD_GETVALUE(x,S_DES1_SIZE,M_DES1_SIZE)
+
+#define M_DES1_OK _DD_MAKEMASK1(27)
+#define M_DES1_INTR _DD_MAKEMASK1(29)
+#define M_DES1_MORE _DD_MAKEMASK1(30)
+#define M_DES1_OWN _DD_MAKEMASK1(31)
+
+/* Transmit Command/Status Bits */
+#define S_DES1_CCNT 16
+#define M_DES1_CCNT _DD_MAKEMASK(4,S_DES1_CCNT)
+#define V_DES1_CCNT(x) _DD_MAKEVALUE(x,S_DES1_CCNT)
+#define G_DES1_CCNT(x) _DD_GETVALUE(x,S_DES1_CCNT,M_DES1_CCNT)
+
+#define M_DES1_EC _DD_MAKEMASK1(20)
+#define M_DES1_OWC _DD_MAKEMASK1(21)
+#define M_DES1_ED _DD_MAKEMASK1(22)
+#define M_DES1_TD _DD_MAKEMASK1(23)
+#define M_DES1_CRS _DD_MAKEMASK1(24)
+#define M_DES1_TFU _DD_MAKEMASK1(25)
+#define M_DES1_TXA _DD_MAKEMASK1(26)
+#define M_DES1_SUPCRC _DD_MAKEMASK1(28)
+
+/* Receive Command/Status Bits */
+#define M_DES1_COL _DD_MAKEMASK1(16)
+#define M_DES1_LBP _DD_MAKEMASK1(17)
+#define M_DES1_FAE _DD_MAKEMASK1(18)
+#define M_DES1_CRCE _DD_MAKEMASK1(19)
+#define M_DES1_ISE _DD_MAKEMASK1(20)
+#define M_DES1_RUNT _DD_MAKEMASK1(21)
+#define M_DES1_LONG _DD_MAKEMASK1(22)
+#define M_DES1_RX_ERRORS (M_DES1_CRCE | \
+ M_DES1_COL | M_DES1_FAE | M_DES1_ISE | \
+ M_DES1_RUNT | M_DES1_LONG | M_DES1_RXO)
+
+#define S_DES1_DEST 23
+#define M_DES1_DEST _DD_MAKEMASK(2,S_DES1_DEST)
+#define V_DES1_DEST(x) _DD_MAKEVALUE(x,S_DES1_DEST)
+#define G_DES1_DEST(x) _DD_GETVALUE(x,S_DES1_DEST,M_DES1_DEST)
+
+#define K_DEST_REJECT 0
+#define K_DEST_UNICAST 1
+#define K_DEST_MULTICAST 2
+#define K_DEST_BROADCAST 3
+
+#define M_DES1_RXO _DD_MAKEMASK1(25)
+#define M_DES1_RXA _DD_MAKEMASK1(26)
+#define M_DES1_INCCRC _DD_MAKEMASK1(28)
+
+#endif /* _DP83815_H_ */
diff --git a/cfe/cfe/dev/ns16550.h b/cfe/cfe/dev/ns16550.h
new file mode 100644
index 0000000..b603ccc
--- /dev/null
+++ b/cfe/cfe/dev/ns16550.h
@@ -0,0 +1,143 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * NS16550 Serial Port definitions File: ns16550.h
+ *
+ * This defines the hardware registers of 16550 compatible UARTs
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+/*
+ * NS16550 UART registers
+ */
+
+#ifndef _NS16550_H_
+#define _NS16550_H_
+
+#ifndef NS16550_HZ
+#define NS16550_HZ 1843200
+#endif
+
+/*
+ * NS16550 UART registers
+ */
+
+/* Register definitions */
+
+#define R_UART_DATA 0
+#define R_UART_IER 1
+#define R_UART_IIR 2
+#define R_UART_FIFO R_UART_IIR
+#define R_UART_CFCR 3
+#define R_UART_MCR 4
+#define R_UART_LSR 5
+#define R_UART_MSR 6
+#define R_UART_SCR 7
+
+/* 16 bit baud rate divisor (lower byte in UART_DATA, upper in UART_IER) */
+#define BRTC(x) (NS16550_HZ / (16*(x)))
+
+/* interrupt enable register */
+#define IER_ERXRDY 0x1 /* int on rx ready */
+#define IER_ETXRDY 0x2 /* int on tx ready */
+#define IER_ERLS 0x4 /* int on line status change */
+#define IER_EMSC 0x8 /* int on modem status change */
+
+/* interrupt identification register */
+#define IIR_IMASK 0xf /* mask */
+#define IIR_RXTOUT 0xc /* receive timeout */
+#define IIR_RLS 0x6 /* receive line status */
+#define IIR_RXRDY 0x4 /* receive ready */
+#define IIR_TXRDY 0x2 /* transmit ready */
+#define IIR_NOPEND 0x1 /* nothing */
+#define IIR_MLSC 0x0 /* modem status */
+#define IIR_FIFO_MASK 0xc0 /* set if FIFOs are enabled */
+
+/* fifo control register */
+#define FIFO_ENABLE 0x01 /* enable fifo */
+#define FIFO_RCV_RST 0x02 /* reset receive fifo */
+#define FIFO_XMT_RST 0x04 /* reset transmit fifo */
+#define FIFO_DMA_MODE 0x08 /* enable dma mode */
+#define FIFO_TRIGGER_1 0x00 /* trigger at 1 char */
+#define FIFO_TRIGGER_4 0x40 /* trigger at 4 chars */
+#define FIFO_TRIGGER_8 0x80 /* trigger at 8 chars */
+#define FIFO_TRIGGER_14 0xc0 /* trigger at 14 chars */
+
+/* character format control register */
+#define CFCR_DLAB 0x80 /* divisor latch */
+#define CFCR_SBREAK 0x40 /* send break */
+#define CFCR_PZERO 0x30 /* zero parity */
+#define CFCR_PONE 0x20 /* one parity */
+#define CFCR_PEVEN 0x10 /* even parity */
+#define CFCR_PODD 0x00 /* odd parity */
+#define CFCR_PENAB 0x08 /* parity enable */
+#define CFCR_STOPB 0x04 /* 2 stop bits */
+#define CFCR_8BITS 0x03 /* 8 data bits */
+#define CFCR_7BITS 0x02 /* 7 data bits */
+#define CFCR_6BITS 0x01 /* 6 data bits */
+#define CFCR_5BITS 0x00 /* 5 data bits */
+
+/* modem control register */
+#define MCR_LOOPBACK 0x10 /* loopback */
+#define MCR_IENABLE 0x08 /* output 2 = int enable */
+#define MCR_DRS 0x04 /* output 1 = xxx */
+#define MCR_RTS 0x02 /* enable RTS */
+#define MCR_DTR 0x01 /* enable DTR */
+
+/* line status register */
+#define LSR_RCV_FIFO 0x80 /* error in receive fifo */
+#define LSR_TSRE 0x40 /* transmitter empty */
+#define LSR_TXRDY 0x20 /* transmitter ready */
+#define LSR_BI 0x10 /* break detected */
+#define LSR_FE 0x08 /* framing error */
+#define LSR_PE 0x04 /* parity error */
+#define LSR_OE 0x02 /* overrun error */
+#define LSR_RXRDY 0x01 /* receiver ready */
+#define LSR_RCV_MASK 0x1f
+
+/* modem status register */
+#define MSR_DCD 0x80 /* DCD active */
+#define MSR_RI 0x40 /* RI active */
+#define MSR_DSR 0x20 /* DSR active */
+#define MSR_CTS 0x10 /* CTS active */
+#define MSR_DDCD 0x08 /* DCD changed */
+#define MSR_TERI 0x04 /* RI changed */
+#define MSR_DDSR 0x02 /* DSR changed */
+#define MSR_DCTS 0x01 /* CTS changed */
+
+#endif /* _NS16550_H_ */
diff --git a/cfe/cfe/dev/pci_devs.c b/cfe/cfe/dev/pci_devs.c
new file mode 100644
index 0000000..a1ba789
--- /dev/null
+++ b/cfe/cfe/dev/pci_devs.c
@@ -0,0 +1,79 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * PCI device selection and initialization File: pci_devs.c
+ *
+ * These are the routines to include the PCI drivers and to hook any
+ * devices with special configuration requirements..
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#if CFG_PCI
+#include "sbmips.h"
+#include "lib_types.h"
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "dev_ide.h"
+#include "env_subr.h"
+
+extern cfe_driver_t pciidedrv; /* PCI IDE controller */
+extern cfe_driver_t dc21143drv; /* Tulip Ethernet */
+extern cfe_driver_t dp83815drv; /* MacPhyter Ethernet */
+#if CFG_DOWNLOAD
+extern cfe_driver_t bcm1250drv; /* BCM1250 as a device */
+#endif
+extern cfe_driver_t ns16550pci_uart; /* PCI serial port */
+
+void pci_add_devices(int init_pci);
+void pci_add_devices(int init_pci)
+{
+ if (init_pci) {
+ cfe_add_device(&pciidedrv,0,IDE_PROBE_MASTER_TYPE(IDE_DEVTYPE_DISK),NULL);
+ cfe_add_device(&dc21143drv,0,0,env_getenv("TULIP0_HWADDR"));
+ cfe_add_device(&dp83815drv,0,0,NULL);
+
+#if CFG_DOWNLOAD
+ /* Access to bcm1250 in PCI device mode */
+ cfe_add_device(&bcm1250drv,0,0,NULL);
+#endif
+ cfe_add_device(&ns16550pci_uart,0,0,0);
+ }
+}
+#endif /* CFG_PCI */
+
diff --git a/cfe/cfe/hosttools/Makefile b/cfe/cfe/hosttools/Makefile
new file mode 100644
index 0000000..2f04639
--- /dev/null
+++ b/cfe/cfe/hosttools/Makefile
@@ -0,0 +1,12 @@
+
+CC = gcc
+CFLAGS = -I ../include
+
+all : mkbootimage installboot
+
+mkbootimage : mkbootimage.c
+ $(CC) $(CFLAGS) -o mkbootimage mkbootimage.c
+
+installboot : installboot.c
+ $(CC) $(CFLAGS) -o installboot installboot.c
+
diff --git a/cfe/cfe/hosttools/README b/cfe/cfe/hosttools/README
new file mode 100644
index 0000000..7976c6d
--- /dev/null
+++ b/cfe/cfe/hosttools/README
@@ -0,0 +1,49 @@
+
+This directory contains some "host tools" that may be useful for
+porting CFE.
+
+MKBOOTIMAGE
+-----------
+
+The 'mkbootimage' program is used to attach a CFE boot block to
+an image file. Boot blocks are used on block-structured devices
+such as disks and CD-ROM.
+
+The boot block contains information to help CFE locate the boot
+loader program and verify its validity. To create boot file,
+link your boot loader to be executable within CFE's boot
+environment (it should be a binary file, not an ELF file).
+
+Convert the file to a boot block using:
+
+ mkbootimage [-EB] [-EL] myfile.elf myfile.boot
+
+Supply the -EB or -EL switch to configure the target endianness,
+since the values in the boot block are endian-specific.
+
+
+INSTALLBOOT
+-----------
+
+Once you have a boot file, the 'installboot' program can
+insert the boot file into a simulated disk file (such as the
+file that you can use with the IDE emulation in the
+BCM12500's functional simulator). The 'installboot' program
+installs your boot file into a disk image file starting at
+the first sector, preserving the beginning part of the boot
+sector where the the boot block lives.
+
+Install the boot block using:
+
+ installboot myfile.boot my_disk_image.dsk
+
+Where the "my_disk_image.dsk" is the simulated disk file for
+the functional simulator.
+
+installboot could probably be ported to the target OS to
+install boot blocks on raw disk devices.
+
+
+
+
+
diff --git a/cfe/cfe/hosttools/installboot.c b/cfe/cfe/hosttools/installboot.c
new file mode 100644
index 0000000..2f61415
--- /dev/null
+++ b/cfe/cfe/hosttools/installboot.c
@@ -0,0 +1,352 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Boot program installer File: installboot.c
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ * This program converts a binary file (bootstrap program)
+ * into a boot block by prepending the boot block sector
+ * to the program. It generates the appropriate
+ * boot block checksums and such. The resulting file may
+ * be used by installboot (for example) to put into a disk
+ * image for the simulator.
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+typedef unsigned long long uint64_t;
+typedef unsigned long uint32_t;
+
+#include "cfe_bootblock.h"
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#define roundup(x,align) (((x)+(align)-1)&~((align)-1))
+#define howmany(x,align) (((x)+(align)-1)/(align))
+
+static int verbose = 0;
+static int big_endian = 1;
+static int swapflg = 1;
+static unsigned long bootcode_offset = 2;
+static unsigned long bootsect_offset = 1;
+
+static void usage(void)
+{
+ fprintf(stderr,"usage: installboot [-bootsect <sector offset>] [-bootcode <sector offset>]\n"
+ " [-v] [-EB] [-EL] bootloaderfile.bin devicefile\n\n");
+ fprintf(stderr,"This program installs a boot block onto a disk. Typically, installboot\n"
+ "is used to install sibyl or other OS bootloaders. The binary you install\n"
+ "should be a raw program (not ELF) located to run in CFE's boot area\n"
+ "at address 0x2000_0000. The devicefile should be the name of the raw device\n"
+ "such as /dev/hda on Linux.\n\n"
+ "Care must be taken when choosing the values for -bootsect and -bootcode\n"
+ "not to interfere with other partitions on your disk. When partitioning,\n"
+ "it's a good idea to reserve 3 cylinders at the beginning of the disk for\n"
+ "the boot loader.\n\n"
+ "-bootsect nn specifies that the boot sector will be placed on sector 'nn'\n"
+ "-bootcode nn specifies that the boot program itself will be placed\n"
+ " on sectors starting with 'nn'. The boot sector will point\n"
+ " to this sector.\n");
+
+ exit(1);
+}
+
+static void bswap32(uint32_t *ptr)
+{
+ unsigned char b;
+ unsigned char *bptr;
+
+ if (swapflg) {
+ bptr = (unsigned char *) ptr;
+ b = bptr[0]; bptr[0] = bptr[3]; bptr[3] = b;
+ b = bptr[1]; bptr[1] = bptr[2]; bptr[2] = b;
+ }
+}
+
+static void bswap64(uint64_t *ptr)
+{
+ unsigned char b;
+ unsigned char *bptr;
+
+ bptr = (unsigned char *) ptr;
+
+ if (swapflg) {
+ b = bptr[0]; bptr[0] = bptr[7]; bptr[7] = b;
+ b = bptr[1]; bptr[1] = bptr[6]; bptr[6] = b;
+ b = bptr[2]; bptr[2] = bptr[5]; bptr[5] = b;
+ b = bptr[3]; bptr[3] = bptr[4]; bptr[4] = b;
+ }
+}
+
+
+static void bswap_bootblock(struct boot_block *bb)
+{
+ int idx;
+
+ for (idx = 59; idx <= 63; idx++) {
+ bswap64(&(bb->bb_data[idx]));
+ }
+}
+
+static void do_checksum(void *ptr,int length,uint32_t *csptr,int swap)
+{
+ uint32_t *p;
+ uint32_t chksum = 0;
+ uint32_t d;
+
+ p = (uint32_t *) ptr;
+
+ length /= sizeof(uint32_t);
+
+ while (length) {
+ d = *p;
+ if (swap) bswap32(&d);
+ chksum += d;
+ p++;
+ length--;
+ }
+
+ if (swap) bswap32(&chksum);
+
+ *csptr = chksum;
+}
+
+
+static void dumpbootblock(struct boot_block *bb)
+{
+ int idx;
+
+ fprintf(stderr,"Magic Number: %016llX\n",
+ bb->bb_magic);
+ fprintf(stderr,"Boot code offset: %llu\n",
+ (unsigned long long)bb->bb_secstart);
+ fprintf(stderr,"Boot code size: %u\n",
+ (uint32_t) (bb->bb_secsize & BOOT_SECSIZE_MASK));
+ fprintf(stderr,"Header checksum: %08X\n",
+ (uint32_t) (bb->bb_hdrinfo & BOOT_HDR_CHECKSUM_MASK));
+ fprintf(stderr,"Header version: %d\n",
+ (uint32_t) ((bb->bb_hdrinfo & BOOT_HDR_VER_MASK) >> BOOT_HDR_VER_SHIFT));
+ fprintf(stderr,"Data checksum: %08X\n",
+ (uint32_t) ((bb->bb_secsize & BOOT_DATA_CHECKSUM_MASK) >> BOOT_DATA_CHECKSUM_SHIFT));
+ fprintf(stderr,"Architecture info: %08X\n",
+ (uint32_t) (bb->bb_archinfo & BOOT_ARCHINFO_MASK));
+ fprintf(stderr,"\n");
+
+ for (idx = 59; idx <= 63; idx++) {
+ fprintf(stderr,"Word %d = %016llX\n",idx,bb->bb_data[idx]);
+ }
+}
+
+static int host_is_little(void)
+{
+ unsigned long var = 1;
+ unsigned char *pvar = (unsigned char *) &var;
+
+ return (*pvar == 1);
+}
+
+int main(int argc, char *argv[])
+{
+ int fh;
+ long bootsize;
+ long bootbufsize;
+ unsigned char *bootcode;
+ struct boot_block bootblock;
+ uint32_t datacsum,hdrcsum;
+ int host_le;
+
+ while ((argc > 1) && (argv[1][0] == '-')) {
+ if (strcmp(argv[1],"-v") == 0) {
+ verbose = 1;
+ }
+ else if (strcmp(argv[1],"-EB") == 0) {
+ big_endian = 1;
+ }
+ else if (strcmp(argv[1],"-EL") == 0) {
+ big_endian = 0;
+ }
+ else if (strcmp(argv[1],"-bootsect") == 0) {
+ char *tmp_ptr;
+ argv++;
+ argc--;
+ if (argc == 1) {
+ fprintf(stderr,"-bootsect requires an argument\n");
+ exit(1);
+ }
+ bootsect_offset = strtoul(argv[1], &tmp_ptr, 0);
+ bootcode_offset = bootsect_offset + 1; /* default if -bootcode not specified */
+ if (*tmp_ptr) {
+ fprintf(stderr,"Unable to parse %s as a sector offset\n", argv[1]);
+ exit(1);
+ }
+ }
+ else if (strcmp(argv[1],"-bootcode") == 0) {
+ char *tmp_ptr;
+ argv++;
+ argc--;
+ if (argc == 1) {
+ fprintf(stderr,"-bootcode requires an argument\n");
+ exit(1);
+ }
+ bootcode_offset = strtoul(argv[1], &tmp_ptr, 0);
+ if (*tmp_ptr) {
+ fprintf(stderr,"Unable to parse %s as a sector offset\n", argv[1]);
+ exit(1);
+ }
+ }
+ else {
+ fprintf(stderr,"Invalid switch: %s\n",argv[1]);
+ exit(1);
+ }
+ argv++;
+ argc--;
+ }
+
+ /*
+ * We need to swap things around if the host and
+ * target are different endianness
+ */
+
+ swapflg = 0;
+ host_le = host_is_little();
+
+ if (big_endian && host_is_little()) swapflg = 1;
+ if ((big_endian == 0) && !(host_is_little())) swapflg = 1;
+
+ fprintf(stderr,"Host is %s-endian.\n",host_le ? "little" : "big");
+ fprintf(stderr,"Target is %s-endian.\n",big_endian ? "big" : "little");
+
+ if (argc != 3) {
+ usage();
+ }
+
+ /*
+ * Read in the boot file
+ */
+
+ fh = open(argv[1],O_RDONLY);
+ if (fh < 0) {
+ perror(argv[1]);
+ }
+
+ bootsize = lseek(fh,0L,SEEK_END);
+ lseek(fh,0L,SEEK_SET);
+
+ bootbufsize = roundup(bootsize,BOOT_BLOCK_BLOCKSIZE);
+
+ bootcode = malloc(bootbufsize);
+ if (bootcode == NULL) {
+ perror("malloc");
+ exit(1);
+ }
+ memset(bootcode,0,bootbufsize);
+ if (read(fh,bootcode,bootsize) != bootsize) {
+ perror("read");
+ exit(1);
+ }
+
+ close(fh);
+
+ /*
+ * Construct the boot block
+ */
+
+
+ /* Checksum the boot code */
+ do_checksum(bootcode,bootbufsize,&datacsum,1);
+ bswap32(&datacsum);
+
+
+ /* fill in the boot block fields, and checksum the boot block */
+ bootblock.bb_magic = BOOT_MAGIC_NUMBER;
+ bootblock.bb_hdrinfo = (((uint64_t) BOOT_HDR_VERSION) << BOOT_HDR_VER_SHIFT);
+ bootblock.bb_secstart = (bootcode_offset * 512);
+ bootblock.bb_secsize = ((uint64_t) bootbufsize) |
+ (((uint64_t) datacsum) << BOOT_DATA_CHECKSUM_SHIFT);
+ bootblock.bb_archinfo = 0; /* XXX */
+
+ do_checksum(&(bootblock.bb_magic),BOOT_BLOCK_SIZE,&hdrcsum,0);
+ bootblock.bb_hdrinfo |= (uint64_t) hdrcsum;
+
+ if (verbose) dumpbootblock(&bootblock);
+
+ bswap_bootblock(&bootblock);
+
+ /*
+ * Now write the output file
+ */
+
+ fh = open(argv[2],O_RDWR|O_CREAT,S_IREAD|S_IWRITE);
+ if (fh < 0) {
+ perror(argv[2]);
+ exit(1);
+ }
+
+ fprintf(stderr,"Installing boot block\n");
+ if (lseek(fh, bootsect_offset * 512, SEEK_SET) != (bootsect_offset * 512)) {
+ perror(argv[2]);
+ exit(1);
+ }
+ if (write(fh,&bootblock,sizeof(bootblock)) != sizeof(bootblock)) {
+ perror(argv[2]);
+ exit(1);
+ }
+ fprintf(stderr,"Installing bootstrap program\n");
+ if (lseek(fh, bootcode_offset * 512, SEEK_SET) != (bootcode_offset * 512)) {
+ perror(argv[2]);
+ exit(1);
+ }
+ if (write(fh,bootcode,bootbufsize) != bootbufsize) {
+ perror(argv[2]);
+ exit(1);
+ }
+
+ close(fh);
+
+ fprintf(stderr,"Done. %s installed on %s\n",argv[1],argv[2]);
+
+ exit(0);
+
+
+}
+
diff --git a/cfe/cfe/hosttools/makereg.c b/cfe/cfe/hosttools/makereg.c
new file mode 100644
index 0000000..0ff53e1
--- /dev/null
+++ b/cfe/cfe/hosttools/makereg.c
@@ -0,0 +1,481 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Register Table Generator File: makereg.c
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ * Warning: don't eat your lunch before reading this program.
+ * It's nasty!
+ *
+ * This program generates tables of SOC registers and values
+ * that are easy for us to display.
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include <stdio.h>
+#include <string.h>
+#include <malloc.h>
+#include <stdlib.h>
+
+#if defined(_MSC_VER) || defined(__CYGWIN__)
+#define TEXTMODE "t"
+#else
+#define TEXTMODE ""
+#endif
+
+typedef struct Cons {
+ char *str;
+ int num;
+} CONS;
+
+typedef struct RegInfo {
+ unsigned long reg_mask;
+ char *reg_agent;
+ int reg_agentidx;
+ char *reg_addr;
+ char *reg_inst;
+ char *reg_subinst;
+ char *reg_printfunc;
+ char *reg_description;
+} REGINFO;
+
+typedef struct ConstInfo {
+ char *name;
+ unsigned int value;
+} CONSTINFO;
+
+#define MAXCONST 64
+CONSTINFO constants[MAXCONST];
+int constcnt = 0;
+
+#define MAXREGS 2000
+REGINFO allregs[MAXREGS];
+int regcnt = 0;
+
+int maskcnt = 0;
+
+#define MAXAGENTS 32
+char *agentnames[MAXAGENTS];
+int agentcnt;
+
+#define CMD_AGENT 1
+#define CMD_ENDAGENT 2
+
+CONS commands[] = {
+ {"!agent",CMD_AGENT},
+ {"!endagent",CMD_ENDAGENT},
+ {NULL,0}};
+
+
+int assoc(CONS *list,char *str)
+{
+ while (list->str) {
+ if (strcmp(list->str,str) == 0) return list->num;
+ list++;
+ }
+
+ return -1;
+}
+
+char *gettoken(char **ptr)
+{
+ char *p = *ptr;
+ char *ret;
+
+ /* skip white space */
+
+ while (*p && isspace(*p)) p++;
+ ret = p;
+
+ /* check for end of string */
+
+ if (!*p) {
+ *ptr = p;
+ return NULL;
+ }
+
+ /* skip non-whitespace */
+
+ while (*p) {
+ if (isspace(*p)) break;
+
+ /* do quoted strings */
+
+ if (*p == '"') {
+ p++;
+ ret = p;
+ while (*p && (*p != '"')) p++;
+ if (*p == '"') *p = '\0';
+ }
+
+ p++;
+
+ }
+
+ if (*p) {
+ *p++ = '\0';
+ }
+ *ptr = p;
+
+ return ret;
+}
+
+static int readline(FILE *str,char *dest,int destlen)
+{
+ char *x;
+
+ for (;;) {
+ if (!fgets(dest,destlen,str)) return -1;
+ if (x = strchr(dest,'\n')) *x = '\0';
+ if (dest[0] == '\0') continue;
+ if (dest[0] == ';') continue;
+ break;
+ }
+
+ return 0;
+}
+
+
+static void fatal(char *str,char *val)
+{
+ fprintf(stderr,"fatal error: %s %s\n",str,val ? val : "");
+ exit(1);
+}
+
+static unsigned int newmask(void)
+{
+ int res;
+
+ res = maskcnt;
+
+ if (maskcnt == 32) {
+ fatal("Out of mask bits",NULL);
+ }
+
+ maskcnt++;
+
+ return 1<<res;
+}
+
+static void addconst(char *name,unsigned int val)
+{
+ if (constcnt == MAXCONST) {
+ fatal("Out of constant space",NULL);
+ }
+
+ constants[constcnt].name = strdup(name);
+ constants[constcnt].value = val;
+
+ constcnt++;
+}
+
+static void addreg(
+ char *agentname,
+ int agentidx,
+ unsigned long mask,
+ char *addr,
+ char *inst,
+ char *subinst,
+ char *printfunc,
+ char *description)
+{
+ allregs[regcnt].reg_mask = mask;
+ allregs[regcnt].reg_addr = strdup(addr);
+ allregs[regcnt].reg_agent = strdup(agentname);
+ allregs[regcnt].reg_agentidx = agentidx;
+ allregs[regcnt].reg_inst = strdup(inst);
+ allregs[regcnt].reg_subinst = strdup(subinst);
+ allregs[regcnt].reg_printfunc = strdup(printfunc);
+ allregs[regcnt].reg_description = strdup(description);
+ regcnt++;
+}
+
+
+static void macroexpand(char *instr,char *exp,char *outstr)
+{
+ while (*instr) {
+ if (*instr == '$') {
+ strcpy(outstr,exp);
+ outstr += strlen(outstr);
+ instr++;
+ }
+ else {
+ *outstr++ = *instr++;
+ }
+ }
+
+ *outstr = '\0';
+}
+
+
+static void doagentcmd(FILE *str,char *line)
+{
+ char *agentname;
+ char *instances;
+ char *inst;
+ char *ptr;
+ char regline[500];
+ char cumlname[100];
+ REGINFO regs[100];
+ char temp[20];
+ int rmax = 0;
+ int idx;
+ unsigned int cumlmask;
+ int agentidx;
+
+ agentname = gettoken(&line);
+ instances = gettoken(&line);
+ if (!instances) {
+ strcpy(temp,"*");
+ instances = temp;
+ }
+
+ fprintf(stderr,"Agent %s Instances %s\n",agentname,instances);
+
+ if (agentcnt == MAXAGENTS) {
+ fatal("Out of agent slots\n",NULL);
+ }
+
+ agentnames[agentcnt] = strdup(agentname);
+ agentidx = agentcnt;
+ agentcnt++;
+
+ regline[0] = '\0';
+
+ while ((readline(str,regline,sizeof(regline)) >= 0) && (rmax < 100)) {
+ char *atext,*subinst,*pfunc,*descr;
+
+ if (regline[0] == '!') break;
+
+ ptr = regline;
+ atext = gettoken(&ptr);
+ subinst = gettoken(&ptr);
+ pfunc = gettoken(&ptr);
+ descr = gettoken(&ptr);
+
+ if (!descr) {
+ fatal("Missing fields for ",atext);
+ }
+
+ regs[rmax].reg_addr = strdup(atext);
+ regs[rmax].reg_subinst = strdup(subinst);
+ regs[rmax].reg_printfunc = strdup(pfunc);
+ regs[rmax].reg_description = strdup(descr);
+ regs[rmax].reg_mask = 0;
+ rmax++;
+ }
+
+ if (rmax == 100) fatal("Too many registers in section ",agentname);
+
+ inst = strtok(instances,",");
+
+ cumlmask = 0;
+ while (inst) {
+ char defname[100];
+ unsigned int curmask;
+
+ sprintf(defname,"SOC_AGENT_%s%s",
+ agentname,inst[0] == '*' ? "" : inst);
+
+ curmask = newmask();
+ cumlmask |= curmask;
+
+ addconst(defname,curmask);
+
+ for (idx = 0; idx < rmax; idx++) {
+ char descr[100];
+ char atext[200];
+
+ macroexpand(regs[idx].reg_addr,inst,atext);
+#if 0
+ strcpy(descr,agentname);
+ if (inst[0] != '*') {
+ strcat(descr,inst);
+ }
+ strcat(descr," ");
+ if (regs[idx].reg_subinst[0] != '*') {
+ strcat(descr,regs[idx].reg_subinst);
+ strcat(descr," ");
+ }
+ strcat(descr,regs[idx].reg_description);
+#else
+ strcpy(descr,regs[idx].reg_description);
+#endif
+
+ addreg(agentname,
+ agentidx,
+ curmask,
+ atext,
+ inst,
+ regs[idx].reg_subinst,
+ regs[idx].reg_printfunc,
+ descr);
+ }
+ inst = strtok(NULL,",");
+ }
+
+ if (instances[0] != '*') {
+ sprintf(cumlname,"SOC_AGENT_%s",agentname);
+ addconst(cumlname,cumlmask);
+ }
+}
+
+static void docommand(FILE *str,char *line)
+{
+ char *cmd;
+
+ cmd = gettoken(&line);
+ if (!cmd) return;
+
+ switch (assoc(commands,cmd)) {
+ case CMD_AGENT:
+ doagentcmd(str,line);
+ break;
+ default:
+ fatal("Invalid command",cmd);
+ break;
+ }
+
+}
+
+static int ingestfile(FILE *str)
+{
+ char line[500];
+
+ while (readline(str,line,sizeof(line)) >= 0) {
+ if (line[0] == '!') {
+ docommand(str,line);
+ }
+ else {
+ fatal("Command string required before register data",NULL);
+ }
+ }
+}
+
+
+void saveincfile(char *fname)
+{
+ FILE *str;
+ int idx;
+
+ str = fopen(fname,"w" TEXTMODE);
+ if (!str) {
+ perror(fname);
+ exit(1);
+ }
+
+ fprintf(str,"\n\n");
+
+ fprintf(str,"#ifndef %s\n",constants[0].name);
+ for (idx = 0; idx < constcnt; idx++) {
+ fprintf(str,"#define %s 0x%08X\n",constants[idx].name,
+ constants[idx].value);
+ }
+ fprintf(str,"#endif\n");
+
+ fprintf(str,"\n\n");
+
+ fprintf(str,"#ifdef _CFE_\n");
+ fprintf(str,"#ifdef __ASSEMBLER__\n");
+ fprintf(str,"\t.globl socstatetable\n");
+ fprintf(str,"socstatetable:\n");
+ for (idx = 0; idx < regcnt; idx++) {
+ fprintf(str,"\t\t.word 0x%08X,%s\n",
+ allregs[idx].reg_mask,allregs[idx].reg_addr);
+ }
+ fprintf(str,"\t\t.word 0,0\n");
+ fprintf(str,"#endif\n");
+
+ fprintf(str,"\n\n");
+ fprintf(str,"#ifndef __ASSEMBLER__\n");
+
+ /* Addr Agent Inst Subinst Mask Printfunc Descr */
+
+ fprintf(str,"char *socagents[] = {\n");
+ for (idx = 0; idx < agentcnt; idx++) {
+ fprintf(str,"\t\"%s\",\n",agentnames[idx]);
+ }
+ fprintf(str,"\tNULL};\n\n");
+
+ fprintf(str,"const socreg_t socregs[] = {\n");
+ for (idx = 0; idx < regcnt; idx++) {
+ fprintf(str," {%s,%d,\"%s\",\"%s\",\n 0x%08X,%s,\"%s\"},\n",
+ allregs[idx].reg_addr,
+ allregs[idx].reg_agentidx,
+ allregs[idx].reg_inst,
+ allregs[idx].reg_subinst,
+ allregs[idx].reg_mask,
+ allregs[idx].reg_printfunc,
+ allregs[idx].reg_description);
+ }
+ fprintf(str," {0,0,NULL,NULL,0,NULL,NULL}};\n\n");
+
+ fprintf(str,"#endif\n");
+ fprintf(str,"#endif\n");
+ fclose(str);
+}
+
+int main(int argc,char *argv[])
+{
+ FILE *str;
+ int idx;
+
+ if (argc != 3) {
+ fprintf(stderr,"usage: makereg inputfile outputfile\n");
+ exit(1);
+ }
+
+ str = fopen(argv[1],"r" TEXTMODE);
+
+ if (!str) {
+ perror(argv[1]);
+ exit(1);
+ }
+
+ ingestfile(str);
+
+ fclose(str);
+
+ fprintf(stderr,"Total registers: %d\n",regcnt);
+
+ saveincfile(argv[2]);
+
+ exit(0);
+ return 0;
+}
diff --git a/cfe/cfe/hosttools/memconfig.c b/cfe/cfe/hosttools/memconfig.c
new file mode 100644
index 0000000..3d84b05
--- /dev/null
+++ b/cfe/cfe/hosttools/memconfig.c
@@ -0,0 +1,654 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Memory Config Utility File: memconfig.c
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ * This host tool lets you enter DRAM parameters and run CFE's
+ * standard memory configuration to calculate the relevant timing
+ * parameters. It's a good way to see what CFE would have done,
+ * to find bogus timing calculations.
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include <stdio.h>
+#include <string.h>
+
+/* *********************************************************************
+ * Basic types
+ ********************************************************************* */
+
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned long uint32_t;
+typedef unsigned long long uint64_t;
+
+/* *********************************************************************
+ * SB1250 stuff
+ ********************************************************************* */
+
+#include "sb1250_defs.h"
+#include "sb1250_mc.h"
+#include "sb1250_draminit.h"
+#include "sb1250_regs.h"
+#include "sb1250_scd.h"
+
+/* *********************************************************************
+ * BCD macros
+ ********************************************************************* */
+
+#define DECTO10THS(x) ((((x) >> 4)*10)+((x) & 0x0F))
+
+/* *********************************************************************
+ * Global defaults
+ ********************************************************************* */
+
+#define MIN_tMEMCLK DRT10(8,0)
+#define tROUNDTRIP DRT10(2,5)
+
+/* *********************************************************************
+ * Types
+ ********************************************************************* */
+
+typedef struct encvalue_s {
+ char *name;
+ uint8_t val;
+} encvalue_t;
+
+typedef struct spdbyte_s {
+ char *name;
+ uint8_t *data;
+ int decimal;
+ encvalue_t *values;
+ char *units;
+ char *description;
+ char *deflt;
+} spdbyte_t;
+
+#define SPD_DEC_BCD 1
+#define SPD_DEC_QTR 2
+#define SPD_ENCODED 3
+#define SPD_ENCODED2 4
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+
+uint8_t spd[64] = {0}; /* SPD data */
+uint8_t mintmemclk = MIN_tMEMCLK; /* Default value: 8.0ns */
+uint8_t roundtrip = tROUNDTRIP; /* Default value: 2.5ns */
+uint8_t dramtype = JEDEC; /* Regular DDR SDRAMs */
+uint8_t plldiv = 10; /* 500 MHz using 100Mhz refclk */
+uint8_t refclk = 100; /* 100Mhz reference clock */
+uint8_t portintlv = 0; /* no port interleaving */
+
+uint8_t addrskew = 0xF;
+uint8_t dqoskew = 0x8;
+uint8_t dqiskew = 0x8;
+uint8_t addrdrive = 0xF;
+uint8_t datadrive = 0xF;
+uint8_t clkdrive = 0;
+
+uint64_t mc0_mclkcfg; /* Value programmed by draminit */
+uint64_t mc0_timing1; /* Value programmed by draminit */
+uint64_t smbus0_start = 0; /* Rememberd SMBus register value */
+uint64_t smbus0_cmd = 0; /* Rememberd SMBus register value */
+
+extern int sb1250_refclk; /* from draminit - reference clock */
+extern int dram_cas_latency; /* from draminit - calc'd cas latency */
+extern int dram_tMemClk; /* from draminit - calc'd tMemClk */
+
+draminittab_t inittab[16]; /* our init tab */
+
+int debug = 0;
+
+/* *********************************************************************
+ * Parameter and value tables
+ ********************************************************************* */
+
+encvalue_t caslatencies[] = {
+ {"3.5",JEDEC_CASLAT_35},
+ {"3.0",JEDEC_CASLAT_30},
+ {"2.5",JEDEC_CASLAT_25},
+ {"2.0",JEDEC_CASLAT_20},
+ {"1.5",JEDEC_CASLAT_15},
+ {"1.0",JEDEC_CASLAT_10},
+ {NULL,0}};
+
+encvalue_t refreshrates[] = {
+ {"64",JEDEC_RFSH_64khz},
+ {"256",JEDEC_RFSH_256khz},
+ {"128",JEDEC_RFSH_128khz},
+ {"32",JEDEC_RFSH_32khz},
+ {"16",JEDEC_RFSH_16khz},
+ {"8",JEDEC_RFSH_8khz},
+ {NULL,0}};
+
+encvalue_t modattribs[] = {
+ {"none",0},
+ {"reg",JEDEC_ATTRIB_REG},
+ {"diffclk",0x20},
+ {NULL,0}};
+
+encvalue_t dramtypes[] = {
+ {"jedec",JEDEC},
+ {"fcram",FCRAM},
+ {"sgram",SGRAM},
+ {NULL,0}};
+
+spdbyte_t spdfields[] = {
+ {"mintmemclk",&mintmemclk,SPD_DEC_BCD,NULL,"ns","Minimum value for tMEMCLK","8.0"},
+ {"roundtrip", &roundtrip, SPD_DEC_BCD,NULL,"ns","Round trip time from CLK to returned DQS","2.5"},
+ {"plldiv", &plldiv, 0,NULL,"","PLL Ratio (System Config Register)","10"},
+ {"refclk", &refclk, 0,NULL,"Mhz","Reference clock, usually 100Mhz","100"},
+// {"portintlv", &portintlv, 0,NULL,"","Port interleave (1=on)","0"},
+ {"memtype", &dramtype, SPD_ENCODED,dramtypes,"","Memory type (jedec, fcram, sgram)","jedec"},
+ {"rows", &spd[JEDEC_SPD_ROWS],0,NULL,"","[3 ] Number of row bits","13"},
+ {"cols", &spd[JEDEC_SPD_COLS],0,NULL,"","[4 ] Number of column bits","9"},
+ {"banks", &spd[JEDEC_SPD_BANKS],0,NULL,"","[17] Number of banks","4"},
+ {"tCK25", &spd[JEDEC_SPD_tCK25],SPD_DEC_BCD,NULL,"ns","[9 ] tCK value for CAS Latency 2.5","7.5"},
+ {"tCK20", &spd[JEDEC_SPD_tCK20],SPD_DEC_BCD,NULL,"ns","[23] tCK value for CAS Latency 2.0","0"},
+ {"tCK10", &spd[JEDEC_SPD_tCK10],SPD_DEC_BCD,NULL,"ns","[25] tCK value for CAS Latency 1.0","0"},
+ {"rfsh", &spd[JEDEC_SPD_RFSH],SPD_ENCODED,refreshrates,"","[12] Refresh rate (KHz)","8"},
+ {"caslat", &spd[JEDEC_SPD_CASLATENCIES],SPD_ENCODED2,caslatencies,"","[18] CAS Latencies supported","2.5"},
+ {"attrib", &spd[JEDEC_SPD_ATTRIBUTES],SPD_ENCODED,modattribs,"","[21] Module attributes","none"},
+ {"tRAS", &spd[JEDEC_SPD_tRAS],0,NULL,"ns","[30]","45"},
+ {"tRP", &spd[JEDEC_SPD_tRP],SPD_DEC_QTR,NULL,"ns","[27]","20.0"},
+ {"tRRD", &spd[JEDEC_SPD_tRRD],SPD_DEC_QTR,NULL,"ns","[28]","15.0"},
+ {"tRCD", &spd[JEDEC_SPD_tRCD],SPD_DEC_QTR,NULL,"ns","[29]","20.0"},
+ {"tRFC", &spd[JEDEC_SPD_tRFC],0,NULL,"ns","[42]","0"},
+ {"tRC", &spd[JEDEC_SPD_tRC],0,NULL,"ns","[41]","0"},
+
+ {"addrskew", &addrskew, 0, NULL, "","Address Skew","0x0F"},
+ {"dqoskew", &dqoskew, 0, NULL, "","DQO Skew","0x08"},
+ {"dqikew", &dqiskew, 0, NULL, "","DQI Skew","0x08"},
+ {"addrdrive", &addrdrive, 0, NULL, "","Address Drive","0x0F"},
+ {"datadrive", &datadrive, 0, NULL, "","Data Drive","0x0F"},
+ {"clkdrive", &clkdrive, 0, NULL, "","Clock Drive","0"},
+ {NULL,0,0,NULL,NULL,NULL,NULL}};
+
+char *lookupstr(encvalue_t *ev,uint8_t val)
+{
+ while (ev->name) {
+ if (ev->val == val) return ev->name;
+ ev++;
+ }
+ return "unknown";
+}
+
+uint64_t sbreadcsr(uint64_t reg)
+{
+ uint64_t val = 0;
+
+ if (debug) printf("READ %08X\n",(uint32_t) reg);
+
+ switch ((uint32_t) reg) {
+ case A_SCD_SYSTEM_REVISION:
+ val = V_SYS_PART(0x1250) | V_SYS_WID(0) | V_SYS_REVISION(1) | 0xFF;
+ break;
+ case A_SCD_SYSTEM_CFG:
+ val = V_SYS_PLL_DIV(plldiv);
+ break;
+ case A_SMB_STATUS_0:
+ val = 0;
+ break;
+ case A_SMB_CMD_0:
+ val = smbus0_cmd;
+ break;
+ case A_SMB_START_0:
+ val = smbus0_start;
+ break;
+ case A_SMB_DATA_0:
+ val = spd[smbus0_cmd & 0x3F];
+ break;
+ }
+ return val;
+}
+
+void sbwritecsr(uint64_t reg,uint64_t val)
+{
+ if (debug) printf("WRITE %08X %016llX\n",(uint32_t) reg,val);
+
+ switch ((uint32_t) reg) {
+ case A_MC_REGISTER(0,R_MC_MCLK_CFG):
+ mc0_mclkcfg = val;
+ break;
+ case A_MC_REGISTER(0,R_MC_TIMING1):
+ mc0_timing1 = val;
+ break;
+ case A_SMB_CMD_0:
+ smbus0_cmd = val;
+ break;
+ case A_SMB_START_0:
+ smbus0_start = val;
+ break;
+ }
+}
+
+
+int procfield(char *txt)
+{
+ int num = 0;
+ int a,b;
+ spdbyte_t *sf;
+ encvalue_t *ev;
+ char *x;
+ char *tok;
+
+ x = strchr(txt,'=');
+ if (!x) {
+ printf("Fields must be specified as 'name=value'\n");
+ exit(1);
+ }
+ *x++ = '\0';
+
+ sf = spdfields;
+ while (sf->name) {
+ if (strcmp(sf->name,txt) == 0) break;
+ sf++;
+ }
+
+ if (sf->name == NULL) {
+ printf("Invalid field name: %s\n",txt);
+ return -1;
+ }
+
+ if (memcmp(x,"0x",2) == 0) {
+ sscanf(x+2,"%x",&num);
+ }
+ else {
+ if (strchr(x,'.')) {
+ if (sscanf(x,"%d.%d",&a,&b) != 2) {
+ printf("%s: invalid number: %s\n",sf->name,x);
+ return -1;
+ }
+ }
+ else {
+ a = atoi(x);
+ b = 0;
+ }
+
+ switch (sf->decimal) {
+ case SPD_DEC_BCD:
+ if ((b < 0) || (b > 9)) {
+ printf("%s: Invalid BCD number: %s\n",sf->name,x);
+ return -1;
+ }
+ num = (a*16)+b;
+ break;
+ case SPD_DEC_QTR:
+ if ((b != 0) && (b != 25) && (b != 50) && (b != 75)) {
+ printf("%s: Invalid 2-bit fraction number: %s\n",sf->name,x);
+ printf("(number after decimal should be 0,25,50,75)\n");
+ exit(1);
+ }
+ num = (a*4)+(b/25);
+ break;
+ case SPD_ENCODED:
+ ev = sf->values;
+ while (ev->name) {
+ if (strcmp(ev->name,x) == 0) break;
+ ev++;
+ }
+ if (!ev->name) {
+ printf("%s: Invalid value. Valid values are: ",x);
+ ev = sf->values;
+ while (ev->name) { printf("%s ",ev->name); ev++; }
+ printf("\n");
+ return -1;
+ }
+ num = ev->val;
+ break;
+ case SPD_ENCODED2:
+ tok = strtok(x," ,");
+ num = 0;
+ while (tok) {
+ ev = sf->values;
+ while (ev->name) {
+ if (strcmp(ev->name,tok) == 0) break;
+ ev++;
+ }
+ if (!ev->name) {
+ printf("%s: Invalid value. Valid values are: ",tok);
+ ev = sf->values;
+ while (ev->name) { printf("%s ",ev->name); ev++; }
+ printf("\n");
+ return -1;
+ }
+ num |= ev->val;
+ tok = strtok(NULL," ,");
+ }
+ break;
+ default:
+ num = a;
+ break;
+ }
+ }
+
+ *(sf->data) = num;
+
+ return 0;
+}
+
+void interactive(void)
+{
+ spdbyte_t *sf;
+ char field[100];
+ char ask[100];
+ char prompt[100];
+ char *x;
+
+ sf = spdfields;
+
+ printf("%-65.65s: Value\n","Parameter");
+ printf("%-65.65s: -----\n","-----------------------------------------------------------------");
+
+ while (sf->name) {
+ for (;;) {
+ x = prompt;
+ x += sprintf(x,"%s (%s", sf->name,sf->description);
+ if (sf->units && sf->units[0]) {
+ if (sf->description && sf->description[0]) x += sprintf(x,", ");
+ x += sprintf(x,"%s",sf->units);
+ }
+ x += sprintf(x,"): [%s]", sf->deflt);
+ printf("%-65.65s: ",prompt);
+
+ fgets(ask,sizeof(ask),stdin);
+ if ((x = strchr(ask,'\n'))) *x = '\0';
+ if (ask[0] == 0) strcpy(ask,sf->deflt);
+ sprintf(field,"%s=%s",sf->name,ask);
+ if (procfield(field) < 0) continue;
+ break;
+ }
+ sf++;
+ }
+
+ printf("\n\n");
+}
+
+int swcnt = 0;
+char *swnames[32];
+
+int proc_args(int argc,char *argv[])
+{
+ int inidx,outidx;
+
+ outidx = 1;
+
+ for (inidx = 1; inidx < argc; inidx++) {
+ if (argv[inidx][0] != '-') {
+ argv[outidx++] = argv[inidx];
+ }
+ else {
+ swnames[swcnt] = argv[inidx];
+ swcnt++;
+ }
+ }
+
+ return outidx;
+}
+
+int swisset(char *x)
+{
+ int idx;
+
+ for (idx = 0; idx < swcnt; idx++) {
+ if (strcmp(x,swnames[idx]) == 0) return 1;
+ }
+ return 0;
+}
+
+void dumpmclkcfg(uint64_t val)
+{
+ printf("clk_ratio = %d\n",G_MC_CLK_RATIO(val));
+ printf("ref_rate = %d\n",G_MC_REF_RATE(val));
+
+}
+
+void dumptiming1(uint64_t val)
+{
+ printf("w2rIdle = %d\n",(val & M_MC_w2rIDLE_TWOCYCLES) ? 1 : 0);
+ printf("r2rIdle = %d\n",(val & M_MC_r2rIDLE_TWOCYCLES) ? 1 : 0);
+ printf("r2wIdle = %d\n",(val & M_MC_r2wIDLE_TWOCYCLES) ? 1 : 0);
+ printf("tCrD = %d\n",(int)G_MC_tCrD(val));
+ printf("tCrDh = %d\n",(val & M_MC_tCrDh) ? 1 : 0);
+ printf("tFIFO = %d\n",(int)G_MC_tFIFO(val));
+ printf("tCwD = %d\n",(int)G_MC_tCwD(val));
+
+ printf("tRP = %d\n",(int)G_MC_tRP(val));
+ printf("tRRD = %d\n",(int)G_MC_tRRD(val));
+ printf("tRCD = %d\n",(int)G_MC_tRCD(val));
+
+ printf("tRFC = %d\n",(int)G_MC_tRFC(val));
+ printf("tRCw = %d\n",(int)G_MC_tRCw(val));
+ printf("tRCr = %d\n",(int)G_MC_tRCr(val));
+ printf("tCwCr = %d\n",(int)G_MC_tCwCr(val));
+}
+
+int main(int argc,char *argv[])
+{
+ spdbyte_t *sf;
+ uint8_t t;
+ int idx;
+ int mclk;
+ draminittab_t *init;
+
+ spd[JEDEC_SPD_MEMTYPE] = JEDEC_MEMTYPE_DDRSDRAM2;
+ spd[JEDEC_SPD_ROWS] = 13;
+ spd[JEDEC_SPD_COLS] = 9;
+ spd[JEDEC_SPD_BANKS] = 2;
+ spd[JEDEC_SPD_SIDES] = 1;
+ spd[JEDEC_SPD_WIDTH] = 72;
+
+ argc = proc_args(argc,argv);
+
+ if ((argc == 1) && !swisset("-i")) {
+ printf("usage: memconfig name=value name=value ...\n");
+ printf("\n");
+ printf("Available fields: ");
+ sf = spdfields;
+ while (sf->name) {
+ printf("%s ",sf->name);
+ sf++;
+ }
+ printf("\n");
+ exit(1);
+ }
+
+ if (swisset("-i")) {
+ interactive();
+ }
+ else {
+ for (idx = 1; idx < argc; idx++) {
+ if (procfield(argv[idx]) < 0) exit(1);
+ }
+ }
+
+ debug = swisset("-d");
+
+ printf("-------Memory Parameters---------\n");
+
+ sf = spdfields;
+ while (sf->name) {
+ char buffer[64];
+ char *p = buffer;
+
+ t = *(sf->data);
+ printf("%-10.10s = 0x%02X ",sf->name,t);
+ switch (sf->decimal) {
+ case SPD_DEC_BCD:
+ p += sprintf(p,"(%d.%d)",
+ t >> 4, t & 0x0F);
+ break;
+ case SPD_DEC_QTR:
+ p += sprintf(p,"(%d.%02d)",
+ t/4,(t&3)*25);
+ break;
+ case SPD_ENCODED:
+ p += sprintf(p,"(%s)",lookupstr(sf->values,t));
+ break;
+ default:
+ p += sprintf(p,"(%d)",t);
+ break;
+ }
+
+ p += sprintf(p," %s",sf->units);
+ printf("%-16.16s %s\n",buffer,sf->description);
+ sf++;
+ }
+
+ printf("\n");
+
+ init = &inittab[0];
+ memset(inittab,0,sizeof(inittab));
+
+ init->gbl.gbl_type = MCR_GLOBALS;
+ init->gbl.gbl_intlv_ch = portintlv;
+ init++;
+
+ init->cfg.cfg_type = MCR_CHCFG;
+ init->cfg.cfg_chan = 0;
+ init->cfg.cfg_mintmemclk = mintmemclk;
+ init->cfg.cfg_dramtype = dramtype;
+ init->cfg.cfg_pagepolicy = CASCHECK;
+ init->cfg.cfg_blksize = BLKSIZE32;
+ init->cfg.cfg_intlv_cs = NOCSINTLV;
+ init->cfg.cfg_ecc = 0;
+ init->cfg.cfg_roundtrip = roundtrip;
+ init++;
+
+ init->clk.clk_type = MCR_CLKCFG;
+ init->clk.clk_addrskew = addrskew;
+ init->clk.clk_dqoskew = dqoskew;
+ init->clk.clk_dqiskew = dqiskew;
+ init->clk.clk_addrdrive = addrdrive;
+ init->clk.clk_datadrive = datadrive;
+ init->clk.clk_clkdrive = clkdrive;
+ init++;
+
+ init->geom.geom_type = MCR_GEOM;
+ init->geom.geom_csel = 0;
+ init->geom.geom_rows = spd[JEDEC_SPD_ROWS];
+ init->geom.geom_cols = spd[JEDEC_SPD_COLS];
+ init->geom.geom_banks = spd[JEDEC_SPD_BANKS];
+ init++;
+
+#if 0
+ init->tmg.tmg_type = MCR_TIMING;
+ init->tmg.tmg_tCK = spd[JEDEC_SPD_tCK25];
+ init->tmg.tmg_rfsh = spd[JEDEC_SPD_RFSH];
+ init->tmg.tmg_caslatency = spd[JEDEC_SPD_CASLATENCIES];
+ init->tmg.tmg_attributes = spd[JEDEC_SPD_ATTRIBUTES];
+ init->tmg.tmg_tRAS = spd[JEDEC_SPD_tRAS];
+ init->tmg.tmg_tRP = spd[JEDEC_SPD_tRP];
+ init->tmg.tmg_tRRD = spd[JEDEC_SPD_tRRD];
+ init->tmg.tmg_tRCD = spd[JEDEC_SPD_tRCD];
+ init->tmg.tmg_tRFC = spd[JEDEC_SPD_tRFC];
+ init->tmg.tmg_tRC = spd[JEDEC_SPD_tRC];
+ init++;
+#else
+ init->spd.spd_type = MCR_SPD;
+ init->spd.spd_csel = 0;
+ init->spd.spd_flags = 0;
+ init->spd.spd_smbuschan = 0;
+ init->spd.spd_smbusdev = 0x50;
+ init++;
+#endif
+
+ init->mcr.mcr_type = MCR_EOT;
+
+
+ sb1250_refclk = (int) refclk;
+
+ sb1250_dram_init(inittab);
+
+
+ printf("-----Memory Timing Register Values-----\n");
+ printf("System Clock %dMHz\n",plldiv*refclk/2);
+ printf("CAS latency %d.%d\n",dram_cas_latency>>1,(dram_cas_latency&1)?5:0);
+ printf("tMemClk %d.%d ns\n",dram_tMemClk/10,dram_tMemClk%10);
+ mclk = (plldiv*refclk)*10/2/((int)G_MC_CLK_RATIO(mc0_mclkcfg));
+ printf("MCLK Freq %d.%dMHz\n",mclk/10,mclk%10);
+ printf("\n");
+ printf("MC_TIMING1 = %016llX\n",mc0_timing1);
+ printf("MCLK_CONFIG = %016llX\n",mc0_mclkcfg);
+ printf("\n");
+
+ printf("-----Memory Timing Register Fields-----\n");
+ dumptiming1(mc0_timing1);
+
+ printf("-----Memory Clock Config Register Fields-----\n");
+ dumpmclkcfg(mc0_mclkcfg);
+
+ printf("---Done!---\n");
+
+ printf("%s ",argv[0]);
+ sf = spdfields;
+ while (sf->name) {
+ char buffer[64];
+ char *p = buffer;
+
+ t = *(sf->data);
+
+ p += sprintf(p,"%s=",sf->name);
+ switch (sf->decimal) {
+ case SPD_DEC_BCD:
+ p += sprintf(p,"%d.%d",
+ t >> 4, t & 0x0F);
+ break;
+ case SPD_DEC_QTR:
+ p += sprintf(p,"%d.%02d",
+ t/4,(t&3)*25);
+ break;
+ case SPD_ENCODED:
+ default:
+ p += sprintf(p,"0x%02X",t);
+ break;
+ }
+
+ printf("%s ",buffer);
+ sf++;
+ }
+
+ printf("\n");
+
+ return 0;
+}
diff --git a/cfe/cfe/hosttools/mkbootimage.c b/cfe/cfe/hosttools/mkbootimage.c
new file mode 100644
index 0000000..862f8ed
--- /dev/null
+++ b/cfe/cfe/hosttools/mkbootimage.c
@@ -0,0 +1,314 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Boot block generator File: mkbootimage.c
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ * This program converts a binary file (bootstrap program)
+ * into a boot block by prepending the boot block sector
+ * to the program. It generates the appropriate
+ * boot block checksums and such. The resulting file may
+ * be used by installboot (for example) to put into a disk
+ * image for the simulator.
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+typedef unsigned long long uint64_t;
+typedef unsigned long uint32_t;
+
+#include "cfe_bootblock.h"
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#define roundup(x,align) (((x)+(align)-1)&~((align)-1))
+#define howmany(x,align) (((x)+(align)-1)/(align))
+
+static int verbose = 0;
+static int big_endian = 1;
+static int swapflg = 1;
+static unsigned long sector_offset = 0;
+
+static void usage(void)
+{
+ fprintf(stderr,"usage: mkbootimage [-S <sector offset>] [-v] [-EB] [-EL] inputfile outputfile\n");
+ exit(1);
+}
+
+static void bswap32(uint32_t *ptr)
+{
+ unsigned char b;
+ unsigned char *bptr;
+
+ if (swapflg) {
+ bptr = (unsigned char *) ptr;
+ b = bptr[0]; bptr[0] = bptr[3]; bptr[3] = b;
+ b = bptr[1]; bptr[1] = bptr[2]; bptr[2] = b;
+ }
+}
+
+static void bswap64(uint64_t *ptr)
+{
+ unsigned char b;
+ unsigned char *bptr;
+
+ bptr = (unsigned char *) ptr;
+
+ if (swapflg) {
+ b = bptr[0]; bptr[0] = bptr[7]; bptr[7] = b;
+ b = bptr[1]; bptr[1] = bptr[6]; bptr[6] = b;
+ b = bptr[2]; bptr[2] = bptr[5]; bptr[5] = b;
+ b = bptr[3]; bptr[3] = bptr[4]; bptr[4] = b;
+ }
+}
+
+
+static void bswap_bootblock(struct boot_block *bb)
+{
+ int idx;
+
+ for (idx = 59; idx <= 63; idx++) {
+ bswap64(&(bb->bb_data[idx]));
+ }
+}
+
+static void do_checksum(void *ptr,int length,uint32_t *csptr,int swap)
+{
+ uint32_t *p;
+ uint32_t chksum = 0;
+ uint32_t d;
+
+ p = (uint32_t *) ptr;
+
+ length /= sizeof(uint32_t);
+
+ while (length) {
+ d = *p;
+ if (swap) bswap32(&d);
+ chksum += d;
+ p++;
+ length--;
+ }
+
+ if (swap) bswap32(&chksum);
+
+ *csptr = chksum;
+}
+
+
+static void dumpbootblock(struct boot_block *bb)
+{
+ int idx;
+
+ fprintf(stderr,"Magic Number: %016llX\n",
+ bb->bb_magic);
+ fprintf(stderr,"Boot code offset: %llu\n",
+ (unsigned long long)bb->bb_secstart);
+ fprintf(stderr,"Boot code size: %u\n",
+ (uint32_t) (bb->bb_secsize & BOOT_SECSIZE_MASK));
+ fprintf(stderr,"Header checksum: %08X\n",
+ (uint32_t) (bb->bb_hdrinfo & BOOT_HDR_CHECKSUM_MASK));
+ fprintf(stderr,"Header version: %d\n",
+ (uint32_t) ((bb->bb_hdrinfo & BOOT_HDR_VER_MASK) >> BOOT_HDR_VER_SHIFT));
+ fprintf(stderr,"Data checksum: %08X\n",
+ (uint32_t) ((bb->bb_secsize & BOOT_DATA_CHECKSUM_MASK) >> BOOT_DATA_CHECKSUM_SHIFT));
+ fprintf(stderr,"Architecture info: %08X\n",
+ (uint32_t) (bb->bb_archinfo & BOOT_ARCHINFO_MASK));
+ fprintf(stderr,"\n");
+
+ for (idx = 59; idx <= 63; idx++) {
+ fprintf(stderr,"Word %d = %016llX\n",idx,bb->bb_data[idx]);
+ }
+}
+
+static int host_is_little(void)
+{
+ unsigned long var = 1;
+ unsigned char *pvar = (unsigned char *) &var;
+
+ return (*pvar == 1);
+}
+
+int main(int argc, char *argv[])
+{
+ int fh;
+ long bootsize;
+ long bootbufsize;
+ unsigned char *bootcode;
+ struct boot_block bootblock;
+ uint32_t datacsum,hdrcsum;
+ int host_le;
+
+ while ((argc > 1) && (argv[1][0] == '-')) {
+ if (strcmp(argv[1],"-v") == 0) {
+ verbose = 1;
+ }
+ else if (strcmp(argv[1],"-EB") == 0) {
+ big_endian = 1;
+ }
+ else if (strcmp(argv[1],"-EL") == 0) {
+ big_endian = 0;
+ }
+ else if (strcmp(argv[1],"-S") == 0) {
+ char *tmp_ptr;
+ argv++;
+ argc--;
+ if (argc == 1) {
+ fprintf(stderr,"-S requires an argument\n");
+ exit(1);
+ }
+ sector_offset = strtoul(argv[1], &tmp_ptr, 0);
+ if (*tmp_ptr) {
+ fprintf(stderr,"Unable to parse %s as a sector offset\n", argv[1]);
+ exit(1);
+ }
+ }
+ else {
+ fprintf(stderr,"Invalid switch: %s\n",argv[1]);
+ exit(1);
+ }
+ argv++;
+ argc--;
+ }
+
+ /*
+ * We need to swap things around if the host and
+ * target are different endianness
+ */
+
+ swapflg = 0;
+ host_le = host_is_little();
+
+ if (big_endian && host_is_little()) swapflg = 1;
+ if ((big_endian == 0) && !(host_is_little())) swapflg = 1;
+
+ fprintf(stderr,"Host is %s-endian.\n",host_le ? "little" : "big");
+ fprintf(stderr,"Target is %s-endian.\n",big_endian ? "big" : "little");
+
+ if (argc != 3) {
+ usage();
+ }
+
+ /*
+ * Read in the boot file
+ */
+
+ fh = open(argv[1],O_RDONLY);
+ if (fh < 0) {
+ perror(argv[1]);
+ }
+
+ bootsize = lseek(fh,0L,SEEK_END);
+ lseek(fh,0L,SEEK_SET);
+
+ bootbufsize = roundup(bootsize,BOOT_BLOCK_BLOCKSIZE);
+
+ bootcode = malloc(bootbufsize);
+ if (bootcode == NULL) {
+ perror("malloc");
+ exit(1);
+ }
+ memset(bootcode,0,bootbufsize);
+ if (read(fh,bootcode,bootsize) != bootsize) {
+ perror("read");
+ exit(1);
+ }
+
+ close(fh);
+
+ /*
+ * Construct the boot block
+ */
+
+
+ /* Checksum the boot code */
+ do_checksum(bootcode,bootbufsize,&datacsum,1);
+ bswap32(&datacsum);
+
+
+ /* fill in the boot block fields, and checksum the boot block */
+ bootblock.bb_magic = BOOT_MAGIC_NUMBER;
+ bootblock.bb_hdrinfo = (((uint64_t) BOOT_HDR_VERSION) << BOOT_HDR_VER_SHIFT);
+ bootblock.bb_secstart = BOOT_BLOCK_BLOCKSIZE + (sector_offset * 512);
+ bootblock.bb_secsize = ((uint64_t) bootbufsize) |
+ (((uint64_t) datacsum) << BOOT_DATA_CHECKSUM_SHIFT);
+ bootblock.bb_archinfo = 0; /* XXX */
+
+ do_checksum(&(bootblock.bb_magic),BOOT_BLOCK_SIZE,&hdrcsum,0);
+ bootblock.bb_hdrinfo |= (uint64_t) hdrcsum;
+
+ if (verbose) dumpbootblock(&bootblock);
+
+ bswap_bootblock(&bootblock);
+
+ /*
+ * Now write the output file
+ */
+
+ fh = open(argv[2],O_RDWR|O_CREAT,S_IREAD|S_IWRITE);
+ if (fh < 0) {
+ perror(argv[2]);
+ exit(1);
+ }
+ if (lseek(fh, sector_offset * 512, SEEK_SET) != (sector_offset * 512)) {
+ perror(argv[2]);
+ exit(1);
+ }
+ if (write(fh,&bootblock,sizeof(bootblock)) != sizeof(bootblock)) {
+ perror(argv[2]);
+ exit(1);
+ }
+ if (write(fh,bootcode,bootbufsize) != bootbufsize) {
+ perror(argv[2]);
+ exit(1);
+ }
+
+ close(fh);
+
+ fprintf(stderr,"%s -> %s : OK\n",argv[1],argv[2]);
+
+ exit(0);
+
+
+}
+
diff --git a/cfe/cfe/hosttools/mkflashimage.c b/cfe/cfe/hosttools/mkflashimage.c
new file mode 100644
index 0000000..84ec77c
--- /dev/null
+++ b/cfe/cfe/hosttools/mkflashimage.c
@@ -0,0 +1,347 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Flash Image generator File: mkflashimage.c
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ * This program sticks a header on the front of a binary
+ * file making it suitable for use with the 'flash' command
+ * in CFE. The header contains the CFE version # and board
+ * type, a CRC, and other info to help prevent us from
+ * flashing bad stuff onto a board.
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#ifndef _SYS_INT_TYPES_H
+typedef unsigned char uint8_t;
+typedef unsigned long long uint64_t;
+typedef unsigned long uint32_t;
+#endif
+
+#include "cfe_flashimage.h"
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+
+static int verbose = 0;
+static int big_endian = 1;
+static int both_endian = 0;
+int mlong64 = 0;
+char boardname[32];
+
+/*
+ * This is the offset in the flash where the little-endian image goes
+ * if we're making a bi-endian flash.
+ */
+
+#define CFE_BIENDIAN_LE_OFFSET (1024*1024)
+
+static void usage(void)
+{
+ fprintf(stderr,"usage: mkflashimage [-v] [-EB] [-EL] [-64] [-B boardname] [-V v.v.v] binfile outfile\n");
+ fprintf(stderr,"\n");
+ fprintf(stderr," mkflashimage [-v] -EX [-64] [-B boardname] [-V v.v.v] BE-binfile LE-binfile outfile\n");
+ fprintf(stderr," (this variant used for making bi-endian flash files)\n");
+ exit(1);
+}
+
+
+static int host_is_little(void)
+{
+ unsigned long var = 1;
+ unsigned char *pvar = (unsigned char *) &var;
+
+ return (*pvar == 1);
+}
+
+#define CRC32_POLY 0xEDB88320UL /* CRC-32 Poly */
+
+static unsigned int
+crc32(const unsigned char *databuf, unsigned int datalen)
+{
+ unsigned int idx, bit, data, crc = 0xFFFFFFFFUL;
+
+ for (idx = 0; idx < datalen; idx++) {
+ for (data = *databuf++, bit = 0; bit < 8; bit++, data >>= 1) {
+ crc = (crc >> 1) ^ (((crc ^ data) & 1) ? CRC32_POLY : 0);
+ }
+ }
+
+ return crc;
+}
+
+
+void stuff_be32(uint8_t *dest,unsigned int src)
+{
+ *dest++ = (src >> 24) & 0xFF;
+ *dest++ = (src >> 16) & 0xFF;
+ *dest++ = (src >> 8) & 0xFF;
+ *dest++ = (src >> 0) & 0xFF;
+}
+
+int main(int argc, char *argv[])
+{
+ int fh;
+ int flashsize;
+ unsigned char *flashcode;
+ cfe_flashimage_t header;
+ int host_le;
+ int majver,minver,ecover;
+ uint32_t crc;
+ uint32_t flags;
+ char *outfile;
+
+ majver = minver = ecover = 0;
+ boardname[0] = 0;
+
+ while ((argc > 1) && (argv[1][0] == '-')) {
+ if (strcmp(argv[1],"-v") == 0) {
+ verbose = 1;
+ }
+ else if (strcmp(argv[1],"-EX") == 0) {
+ if (verbose) fprintf(stderr,"[Image file will be marked Bi-Endian]\n");
+ both_endian = 1;
+ }
+ else if (strcmp(argv[1],"-EB") == 0) {
+ if (verbose) fprintf(stderr,"[Image file will be marked Big-Endian]\n");
+ big_endian = 1;
+ }
+ else if (strcmp(argv[1],"-EL") == 0) {
+ if (verbose) fprintf(stderr,"[Image file will be marked Little-Endian]\n");
+ big_endian = 0;
+ }
+ else if (strcmp(argv[1],"-64") == 0) {
+ if (verbose) fprintf(stderr,"[Image file will be marked 64-bit]\n");
+ mlong64 = 1;
+ }
+ else if (strcmp(argv[1],"-B") == 0) {
+ argc--;
+ argv++;
+ strcpy(boardname,argv[1]);
+ if (verbose) fprintf(stderr,"[Board name: %s]\n",boardname);
+ }
+ else if (strcmp(argv[1],"-V") == 0) {
+ argc--;
+ argv++;
+ sscanf(argv[1],"%d.%d.%d",&majver,&minver,&ecover);
+ if (verbose) fprintf(stderr,"[Image version: %d.%d.%d]\n",majver,minver,ecover);
+ }
+ else {
+ fprintf(stderr,"Invalid switch: %s\n",argv[1]);
+ exit(1);
+ }
+ argv++;
+ argc--;
+ }
+
+ /*
+ * We need to swap things around if the host and
+ * target are different endianness
+ */
+
+ host_le = host_is_little();
+
+ if (verbose) {
+ fprintf(stderr,"Host is %s-endian.\n",host_le ? "little" : "big");
+ if (both_endian) {
+ fprintf(stderr,"Target is bi-endian.\n");
+ }
+ else {
+ fprintf(stderr,"Target is %s-endian.\n",big_endian ? "big" : "little");
+ }
+ }
+
+ if ((both_endian && (argc != 4)) || (!both_endian && (argc != 3))) {
+ usage();
+ }
+
+ /*
+ * Read in the boot file(s)
+ */
+
+ flags = 0;
+
+ if (both_endian) {
+ int be_size;
+
+ flags |= (CFE_IMAGE_EB | CFE_IMAGE_EL);
+
+ if (verbose) fprintf(stderr,"Reading: %s\n",argv[2]);
+
+ fh = open(argv[2],O_RDONLY);
+ if (fh < 0) {
+ perror(argv[2]);
+ }
+
+ flashsize = lseek(fh,0L,SEEK_END);
+ lseek(fh,0L,SEEK_SET);
+
+ flashcode = malloc(flashsize+CFE_BIENDIAN_LE_OFFSET);
+ if (flashcode == NULL) {
+ perror("malloc");
+ exit(1);
+ }
+ memset(flashcode,0xFF,flashsize+CFE_BIENDIAN_LE_OFFSET);
+
+ if (read(fh,flashcode+CFE_BIENDIAN_LE_OFFSET,flashsize) != flashsize) {
+ perror("read");
+ exit(1);
+ }
+
+ close(fh);
+
+ if (memcmp(flashcode+CFE_BIENDIAN_LE_OFFSET,CFE_IMAGE_SEAL,4) == 0) {
+ fprintf(stderr,"File '%s' already has an image header.\n",argv[2]);
+ exit(1);
+ }
+
+ flashsize += CFE_BIENDIAN_LE_OFFSET; /* actual file size */
+
+ if (verbose) fprintf(stderr,"Reading: %s\n",argv[1]);
+
+ fh = open(argv[1],O_RDONLY);
+ if (fh < 0) {
+ perror(argv[1]);
+ exit(1);
+ }
+
+ be_size = lseek(fh,0L,SEEK_END);
+ lseek(fh,0L,SEEK_SET);
+ if (be_size > CFE_BIENDIAN_LE_OFFSET) {
+ fprintf(stderr,"File '%s' will not fit within first %d bytes of flash image\n",
+ argv[1],CFE_BIENDIAN_LE_OFFSET);
+ close(fh);
+ exit(1);
+ }
+
+ if (read(fh,flashcode,be_size) != be_size) {
+ perror("read");
+ exit(1);
+ }
+
+ close(fh);
+
+ outfile = argv[3];
+
+ }
+ else {
+ if (big_endian) flags |= CFE_IMAGE_EB;
+ else flags |= CFE_IMAGE_EL;
+
+ fh = open(argv[1],O_RDONLY);
+ if (fh < 0) {
+ perror(argv[1]);
+ exit(1);
+ }
+
+ flashsize = lseek(fh,0L,SEEK_END);
+ lseek(fh,0L,SEEK_SET);
+
+ flashcode = malloc(flashsize);
+ if (flashcode == NULL) {
+ perror("malloc");
+ exit(1);
+ }
+ memset(flashcode,0,flashsize);
+ if (read(fh,flashcode,flashsize) != flashsize) {
+ perror("read");
+ exit(1);
+ }
+
+ close(fh);
+
+ if (memcmp(flashcode,CFE_IMAGE_SEAL,4) == 0) {
+ fprintf(stderr,"File '%s' already has an image header.\n",argv[1]);
+ exit(1);
+ }
+
+ outfile = argv[2];
+ }
+
+
+ /*
+ * Construct the flash header
+ */
+
+ if (mlong64) flags |= CFE_IMAGE_MLONG64;
+ crc = crc32(flashcode,flashsize);
+
+ memset(&header,0,sizeof(header));
+ memcpy(header.seal,CFE_IMAGE_SEAL,sizeof(header.seal));
+ stuff_be32(header.flags,flags);
+ stuff_be32(header.size,flashsize);
+ stuff_be32(header.crc,crc);
+ header.majver = majver;
+ header.minver = minver;
+ header.ecover = ecover;
+ header.miscver = 0;
+ strcpy(header.boardname,boardname);
+
+ /*
+ * Now write the output file
+ */
+
+ fh = open(outfile,O_RDWR|O_CREAT|O_TRUNC,S_IREAD|S_IWRITE|S_IRGRP|S_IWGRP|S_IROTH);
+ if (fh < 0) {
+ perror(outfile);
+ exit(1);
+ }
+ if (write(fh,&header,sizeof(header)) != sizeof(header)) {
+ perror(outfile);
+ exit(1);
+ }
+ if (write(fh,flashcode,flashsize) != flashsize) {
+ perror(outfile);
+ exit(1);
+ }
+
+ fprintf(stderr,"Wrote %d bytes to %s\n",sizeof(header)+flashsize,outfile);
+
+ close(fh);
+
+ exit(0);
+
+
+}
+
diff --git a/cfe/cfe/hosttools/mkpcidb.c b/cfe/cfe/hosttools/mkpcidb.c
new file mode 100644
index 0000000..fe7d314
--- /dev/null
+++ b/cfe/cfe/hosttools/mkpcidb.c
@@ -0,0 +1,157 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * PCI Table Generator File: mkpcidb.c
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ * This program munges the PCI table into a form that uses
+ * fewer embedded pointers. Pointers are evil for the
+ * relocatable version of CFE since they chew up valuable
+ * initialized data segment space, and we only have
+ * 64KB of that.
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include <stdio.h>
+
+typedef unsigned short pci_vendor_id_t;
+typedef unsigned short pci_product_id_t;
+
+struct pci_knowndev {
+ pci_vendor_id_t vendor;
+ pci_product_id_t product;
+ int flags;
+ char *vendorname, *productname;
+};
+
+#include "../pci/pcidevs.h"
+#define PCI_KNOWNDEV_NOPROD 0x01
+#include "../pci/pcidevs_data.h"
+
+
+
+struct pci_knowndev2 {
+ pci_vendor_id_t vendor;
+ pci_product_id_t product;
+ int flags;
+ int vendorname;
+ int productname;
+};
+
+#define MAXPCIDEVS 5000
+#define MAXSTRINGTABLE (1024*1024)
+
+struct pci_knowndev2 knowndevs[MAXPCIDEVS];
+char stringtable[MAXSTRINGTABLE];
+int curstringptr = 0;
+
+int allocstring(char *string)
+{
+ int ptr;
+
+ if (!string) return -1;
+
+ ptr = curstringptr;
+ strcpy(&stringtable[ptr],string);
+ curstringptr += strlen(string)+1;
+ return ptr;
+}
+
+int main(int argc,char *argv[])
+{
+ struct pci_knowndev2 *outdev;
+ const struct pci_knowndev *indev;
+ int cnt = 0;
+ int idx;
+
+ indev = pci_knowndevs;
+ outdev = knowndevs;
+ cnt = 0;
+
+ while (indev->vendorname) {
+ outdev->vendor = indev->vendor;
+ outdev->product = indev->product;
+ outdev->flags = indev->flags;
+ outdev->vendorname = allocstring(indev->vendorname);
+ outdev->productname = allocstring(indev->productname);
+ cnt++;
+ indev++;
+ outdev++;
+ }
+
+ outdev->vendor = 0;
+ outdev->product = 0;
+ outdev->flags = 0;
+ outdev->vendorname = -1;
+ outdev->productname = -1;
+ cnt++;
+
+ fprintf(stderr,"%d total devices (%d bytes), %d bytes of strings\n",
+ cnt,cnt*sizeof(struct pci_knowndev2),curstringptr);
+
+ printf("\n\n\n");
+ printf("const static struct pci_knowndev2 _pci_knowndevs[] __attribute__ ((section (\".text\"))) = {\n");
+ for (idx = 0; idx < cnt; idx++) {
+ printf("\t{0x%04X,0x%04X,0x%08X,%d,%d},\n",
+ knowndevs[idx].vendor,
+ knowndevs[idx].product,
+ knowndevs[idx].flags,
+ knowndevs[idx].vendorname,
+ knowndevs[idx].productname);
+ }
+ printf("};\n\n\n");
+ printf("const static char _pci_knowndevs_text[] __attribute__ ((section (\".text\"))) = {\n");
+ for (idx = 0; idx < curstringptr; idx++) {
+ if ((idx % 16) == 0) printf("\t");
+ printf("0x%02X,",stringtable[idx]);
+ if ((idx % 16) == 15) printf("\n");
+ }
+ printf("0};\n\n");
+
+ printf("static const struct pci_knowndev2 *pci_knowndevs = _pci_knowndevs;\n");
+ printf("static const char *pci_knowndevs_text = _pci_knowndevs_text;\n");
+ printf("#define PCI_STRING_NULL (-1)\n");
+ printf("#define PCI_STRING(x) (&pci_knowndevs_text[(x)])\n\n");
+
+
+
+ exit(0);
+}
+
+
diff --git a/cfe/cfe/include/cfe.h b/cfe/cfe/include/cfe.h
new file mode 100755
index 0000000..013fb13
--- /dev/null
+++ b/cfe/cfe/include/cfe.h
@@ -0,0 +1,101 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * CFE version # and prototypes File: cfe.h
+ *
+ * CFE's version # temporarily lives here.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+/* *********************************************************************
+ * Version number
+ ********************************************************************* */
+
+#define CFE_VER_MAJOR CFE_VER_MAJ
+#define CFE_VER_MINOR CFE_VER_MIN
+#define CFE_VER_BUILD CFE_VER_ECO
+
+/* Numbers must not exceed 255 */
+#define BCM63XX_MAJOR 106
+#define BCM63XX_MINOR 24
+
+/* *********************************************************************
+ * Some runtime startup parameters
+ ********************************************************************* */
+#if !defined(__ASSEMBLER__)
+extern unsigned cfe_startflags;
+#endif
+
+#define CFE_INIT_USER 0x0000FFFF /* these are BSP-specific flags */
+#define CFE_INIT_SAFE 0x00010000 /* "Safe mode" */
+#define CFE_INIT_PCI 0x00020000 /* Initialize PCI */
+#define CFE_LDT_SLAVE 0x00040000 /* Select LDT slave mode */
+
+/* *********************************************************************
+ * Other constants
+ ********************************************************************* */
+
+#define CFE_MAX_HANDLE 64 /* max file handles */
+
+#if !defined(__ASSEMBLER__)
+
+/* *********************************************************************
+ * prototypes
+ ********************************************************************* */
+
+void board_console_init(void);
+void board_device_init(void);
+void board_final_init(void);
+void board_device_reset(void);
+#define CFE_BUFFER_CONSOLE "buffer"
+int cfe_set_console(char *);
+int cfe_set_envdevice(char *);
+void cfe_restart(void);
+void cfe_command_loop(void);
+void cfe_leds(unsigned int val);
+void cfe_ledstr(const char *str);
+void cfe_launch(unsigned long ept);
+void cfe_start(unsigned long ept);
+void cfe_warmstart(unsigned long long);
+#define SETLEDS(x) cfe_ledstr(x)
+const char *cfe_errortext(int err);
+
+#endif
diff --git a/cfe/cfe/include/cfe_autoboot.h b/cfe/cfe/include/cfe_autoboot.h
new file mode 100644
index 0000000..603803b
--- /dev/null
+++ b/cfe/cfe/include/cfe_autoboot.h
@@ -0,0 +1,71 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Automatic OS bootstrap File: cfe_autoboot.h
+ *
+ * This module handles OS bootstrap stuff. We use this version
+ * to do "automatic" booting; walking down a list of possible boot
+ * options, trying them until something good happens.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#define CFE_AUTOBOOT_END 0
+#define CFE_AUTOBOOT_NETWORK 1
+#define CFE_AUTOBOOT_DISK 2
+#define CFE_AUTOBOOT_RAW 3
+
+typedef struct cfe_autoboot_method_s {
+ queue_t ab_qblock;
+ int ab_type;
+ int ab_flags;
+ char *ab_dev;
+ char *ab_loader;
+ char *ab_filesys;
+ char *ab_file;
+} cfe_autoboot_method_t;
+
+#define CFE_AUTOFLG_POLLCONSOLE 1 /* boot can be interrupted */
+#define CFE_AUTOFLG_TRYFOREVER 2 /* keep trying forever */
+
+int cfe_autoboot(char *dev,int flags);
+int cfe_add_autoboot(int type,int flags,char *dev,char *loader,char *filesys,char *file);
+
+
diff --git a/cfe/cfe/include/cfe_boot.h b/cfe/cfe/include/cfe_boot.h
new file mode 100644
index 0000000..93c3c6d
--- /dev/null
+++ b/cfe/cfe/include/cfe_boot.h
@@ -0,0 +1,58 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Bootstrap prototypes File: cfe_boot.h
+ *
+ * Prototypes for main bootstrap routines
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define BOOT_START_ADDRESS 0x20000000 /* VA of boot area */
+#define BOOT_AREA_SIZE (256*1024) /* 256K */
+
+
+
+
diff --git a/cfe/cfe/include/cfe_bootblock.h b/cfe/cfe/include/cfe_bootblock.h
new file mode 100644
index 0000000..c3a93f0
--- /dev/null
+++ b/cfe/cfe/include/cfe_bootblock.h
@@ -0,0 +1,129 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Boot Block File: cfe_bootblock.h
+ *
+ * The structure of the boot block used on block-style devices
+ * like disks and CDROMs
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+/*
+ * CFE boot block, modeled loosely on Alpha.
+ *
+ * It consists of:
+ *
+ * BSD disk label
+ * <blank space>
+ * Boot block info (5 u_int_64s)
+ *
+ * The boot block portion looks like:
+ *
+ *
+ * +-------+-------+-------+-------+-------+-------+-------+-------+
+ * | BOOT_MAGIC_NUMBER |
+ * +-------+-------+-------+-------+-------+-------+-------+-------+
+ * | Flags | Reserved | Vers | Header Checksum |
+ * +-------+-------+-------+-------+-------+-------+-------+-------+
+ * | Secondary Loader Location (bytes) |
+ * +-------+-------+-------+-------+-------+-------+-------+-------+
+ * | Loader Checksum | Size of loader (bytes) |
+ * +-------+-------+-------+-------+-------+-------+-------+-------+
+ * | Reserved | Architecture Information |
+ * +-------+-------+-------+-------+-------+-------+-------+-------+
+ *
+ * Boot block fields should always be read as 64-bit numbers.
+ *
+ */
+
+
+struct boot_block {
+ uint64_t bb_data[64]; /* data (disklabel, also as below) */
+};
+#define bb_magic bb_data[59] /* magic number */
+#define bb_hdrinfo bb_data[60] /* header checksum, ver, flags */
+#define bb_secstart bb_data[61] /* secondary start (bytes) */
+#define bb_secsize bb_data[62] /* secondary size (bytes) */
+#define bb_archinfo bb_data[63] /* architecture info */
+
+#define BOOT_BLOCK_OFFSET 0 /* offset of boot block. */
+#define BOOT_BLOCK_BLOCKSIZE 512 /* block size for sec. size/start,
+ * and for boot block itself
+ */
+#define BOOT_BLOCK_SIZE 40 /* 5 64-bit words */
+
+/*
+ * This is the highest block number that we look at when
+ * searching for a valid boot block
+ */
+#define BOOT_BLOCK_MAXLOC 16
+
+/*
+ * Fields within the boot block
+ */
+#define _U64(x) ((uint64_t) x)
+#define BOOT_MAGIC_NUMBER _U64(0x43465631424f4f54)
+#define BOOT_HDR_CHECKSUM_MASK _U64(0x00000000FFFFFFFF)
+#define BOOT_HDR_VER_MASK _U64(0x000000FF00000000)
+#define BOOT_HDR_VER_SHIFT 32
+#define BOOT_HDR_FLAGS_MASK _U64(0xFF00000000000000)
+#define BOOT_SECSIZE_MASK _U64(0x00000000FFFFFFFF)
+#define BOOT_DATA_CHECKSUM_MASK _U64(0xFFFFFFFF00000000)
+#define BOOT_DATA_CHECKSUM_SHIFT 32
+#define BOOT_ARCHINFO_MASK _U64(0x00000000FFFFFFFF)
+
+#define BOOT_HDR_VERSION 1
+
+#define CHECKSUM_BOOT_DATA(data,len,cksum) \
+ do { \
+ uint32_t *_ptr = (uint32_t *) (data); \
+ uint32_t _cksum; \
+ int _i; \
+ \
+ _cksum = 0; \
+ for (_i = 0; \
+ _i < ((len) / sizeof (uint32_t)); \
+ _i++) \
+ _cksum += _ptr[_i]; \
+ *(cksum) = _cksum; \
+ } while (0)
+
+
diff --git a/cfe/cfe/include/cfe_console.h b/cfe/cfe/include/cfe_console.h
new file mode 100755
index 0000000..7ee1056
--- /dev/null
+++ b/cfe/cfe/include/cfe_console.h
@@ -0,0 +1,92 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Console prototypes File: cfe_console.c
+ *
+ * Prototypes for routines dealing with the console.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define VKEY(x) (0x100|(x))
+#define VKEY_UP VKEY(1)
+#define VKEY_DOWN VKEY(2)
+#define VKEY_LEFT VKEY(3)
+#define VKEY_RIGHT VKEY(4)
+#define VKEY_PGUP VKEY(5)
+#define VKEY_PGDN VKEY(6)
+#define VKEY_HOME VKEY(7)
+#define VKEY_END VKEY(8)
+#define VKEY_F1 VKEY(0x10)
+#define VKEY_F2 VKEY(0x11)
+#define VKEY_F3 VKEY(0x12)
+#define VKEY_F4 VKEY(0x13)
+#define VKEY_F5 VKEY(0x14)
+#define VKEY_F6 VKEY(0x15)
+#define VKEY_F7 VKEY(0x16)
+#define VKEY_F8 VKEY(0x17)
+#define VKEY_F9 VKEY(0x18)
+#define VKEY_F10 VKEY(0x19)
+#define VKEY_F11 VKEY(0x1A)
+#define VKEY_F12 VKEY(0x1B)
+#define VKEY_ESC 27
+
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+int console_open(char *name);
+int console_close(void);
+int console_read(char *buffer,int length);
+int console_write(char *buffer,int length);
+int console_status(void);
+int console_readkey(void);
+int console_readline(char *prompt,char *str,int len);
+int console_readline_noedit(char *prompt,char *str,int len);
+int console_readline(char *prompt,char *str,int len);
+extern char *console_name;
+extern int console_handle;
+void console_log(const char *tmplt,...);
+
+
diff --git a/cfe/cfe/include/cfe_devfuncs.h b/cfe/cfe/include/cfe_devfuncs.h
new file mode 100644
index 0000000..207c4a6
--- /dev/null
+++ b/cfe/cfe/include/cfe_devfuncs.h
@@ -0,0 +1,76 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Device function prototypes File: cfe_devfuncs.h
+ *
+ * This module contains prototypes for cfe_devfuncs.c, a set
+ * of wrapper routines to the IOCB interface. This file,
+ * along with cfe_devfuncs.c, can be incorporated into programs
+ * that need to call CFE.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#define CFE_EPTSEAL 0x43464531
+#if (CFG_BIENDIAN) && defined(__MIPSEB)
+#define CFE_EPTSEAL_REV 0x31454643
+#endif
+
+#define CFE_APISEAL 0xBFC004E0
+#define CFE_APIENTRY 0xBFC00500
+
+
+
+#ifndef __ASSEMBLER__
+int cfe_open(char *name);
+int cfe_close(int handle);
+int cfe_readblk(int handle,cfe_offset_t offset,unsigned char *buffer,int length);
+int cfe_read(int handle,unsigned char *buffer,int length);
+int cfe_writeblk(int handle,cfe_offset_t offset,unsigned char *buffer,int length);
+int cfe_write(int handle,unsigned char *buffer,int length);
+int cfe_ioctl(int handle,unsigned int ioctlnum,unsigned char *buffer,int length,int *retlen,
+ cfe_offset_t offset);
+int cfe_inpstat(int handle);
+int cfe_getenv(char *name,char *dest,int destlen);
+long long cfe_getticks(void);
+int cfe_exit(int warm,int code);
+int cfe_flushcache(int flg);
+int cfe_getdevinfo(char *name);
+int cfe_flushcache(int);
+#endif
diff --git a/cfe/cfe/include/cfe_device.h b/cfe/cfe/include/cfe_device.h
new file mode 100644
index 0000000..f90b167
--- /dev/null
+++ b/cfe/cfe/include/cfe_device.h
@@ -0,0 +1,118 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Device manager definitions File: cfe_device.h
+ *
+ * Structures, constants, etc. for the device manager, which keeps
+ * track of installed devices in CFE.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#ifndef _CFE_DEVICE_H
+#define _CFE_DEVICE_H
+
+#include "lib_queue.h"
+
+typedef struct cfe_devdisp_s cfe_devdisp_t;
+
+
+/*
+ * The Device structure defines a particular instance of a device.
+ * They are generated as a result of calling the cfe_attach call.
+ */
+
+typedef struct cfe_device_s {
+ queue_t dev_next;
+ char *dev_fullname;
+ void *dev_softc;
+ int dev_class;
+ const cfe_devdisp_t *dev_dispatch;
+ int dev_opencount;
+ char *dev_description;
+} cfe_device_t;
+
+/*
+ * This is what gets returned from the OPEN call
+ */
+typedef struct cfe_devctx_s {
+ cfe_device_t *dev_dev;
+ void *dev_softc;
+ void *dev_openinfo;
+} cfe_devctx_t;
+
+
+/*
+ * This defines a given device class. Even though there are
+ * three identical MACs, there is only one of these.
+ */
+
+struct cfe_devdisp_s {
+ int (*dev_open)(cfe_devctx_t *ctx);
+ int (*dev_read)(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+ int (*dev_inpstat)(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat);
+ int (*dev_write)(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+ int (*dev_ioctl)(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+ int (*dev_close)(cfe_devctx_t *ctx);
+ void (*dev_poll)(cfe_devctx_t *ctx,int64_t ticks);
+ void (*dev_reset)(void *softc); /* called when device is closed, so no devctx_t */
+};
+
+
+
+typedef struct cfe_driver_s {
+ char *drv_description; /* Description of device for SHOW commands */
+ char *drv_bootname; /* Device's name prefix for open() */
+ int drv_class;
+ const cfe_devdisp_t *drv_dispatch;
+ void (*drv_probe)(struct cfe_driver_s *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+} cfe_driver_t;
+
+char *cfe_device_name(cfe_devctx_t *ctx);
+void cfe_attach(cfe_driver_t *devname,void *softc,char *bootinfo,char *description);
+int cfe_attach_idx(cfe_driver_t *drv,int idx,void *softc,char *bootinfo,char *description);
+cfe_device_t *cfe_finddev(char *name);
+void cfe_attach_init(void);
+#define cfe_add_device(devdescr,a,b,ptr) (devdescr)->drv_probe(devdescr,a,b,ptr)
+void cfe_device_reset(void);
+
+#endif
diff --git a/cfe/cfe/include/cfe_error.h b/cfe/cfe/include/cfe_error.h
new file mode 100644
index 0000000..9c564e1
--- /dev/null
+++ b/cfe/cfe/include/cfe_error.h
@@ -0,0 +1,110 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Error codes File: cfe_error.h
+ *
+ * CFE's global error code list is here.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+
+
+#define CFE_OK 0
+#define CFE_ERR -1 /* generic error */
+#define CFE_ERR_INV_COMMAND -2
+#define CFE_ERR_EOF -3
+#define CFE_ERR_IOERR -4
+#define CFE_ERR_NOMEM -5
+#define CFE_ERR_DEVNOTFOUND -6
+#define CFE_ERR_DEVOPEN -7
+#define CFE_ERR_INV_PARAM -8
+#define CFE_ERR_ENVNOTFOUND -9
+#define CFE_ERR_ENVREADONLY -10
+
+#define CFE_ERR_NOTELF -11
+#define CFE_ERR_NOT32BIT -12
+#define CFE_ERR_WRONGENDIAN -13
+#define CFE_ERR_BADELFVERS -14
+#define CFE_ERR_NOTMIPS -15
+#define CFE_ERR_BADELFFMT -16
+#define CFE_ERR_BADADDR -17
+
+#define CFE_ERR_FILENOTFOUND -18
+#define CFE_ERR_UNSUPPORTED -19
+
+#define CFE_ERR_HOSTUNKNOWN -20
+
+#define CFE_ERR_TIMEOUT -21
+
+#define CFE_ERR_PROTOCOLERR -22
+
+#define CFE_ERR_NETDOWN -23
+#define CFE_ERR_NONAMESERVER -24
+
+#define CFE_ERR_NOHANDLES -25
+#define CFE_ERR_ALREADYBOUND -26
+
+#define CFE_ERR_CANNOTSET -27
+#define CFE_ERR_NOMORE -28
+#define CFE_ERR_BADFILESYS -29
+#define CFE_ERR_FSNOTAVAIL -30
+
+#define CFE_ERR_INVBOOTBLOCK -31
+#define CFE_ERR_WRONGDEVTYPE -32
+#define CFE_ERR_BBCHECKSUM -33
+#define CFE_ERR_BOOTPROGCHKSUM -34
+
+#define CFE_ERR_LDRNOTAVAIL -35
+
+#define CFE_ERR_NOTREADY -36
+
+#define CFE_ERR_GETMEM -37
+#define CFE_ERR_SETMEM -38
+
+#define CFE_ERR_NOTCONN -39
+#define CFE_ERR_ADDRINUSE -40
+
+/* Foxconn add start by Cliff Wang, 03/23/2010 */
+#define CFE_ERR_INTR -41
+#define CFE_ERR_BADIMAGE -42
+/* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+
diff --git a/cfe/cfe/include/cfe_fileops.h b/cfe/cfe/include/cfe_fileops.h
new file mode 100644
index 0000000..f119037
--- /dev/null
+++ b/cfe/cfe/include/cfe_fileops.h
@@ -0,0 +1,109 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Filesystem dispatch defs File: cfe_fileops.h
+ *
+ * CFE supports multiple access methods to files on boot
+ * media. This module contains the dispatch table structures
+ * for "file systems".
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define FILE_SEEK_BEGINNING 0
+#define FILE_SEEK_CURRENT 1
+
+#define FILE_MODE_READ 1
+#define FILE_MODE_WRITE 2
+
+/* These flags should not conflict with the loader arg flags (see cfe_loadargs_t) */
+#define FSYS_TYPE_NETWORK 0x40000000
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#define BDINIT(ops,fsctx,name) (ops)->init((fsctx),(name))
+#define BDOPEN(ops,ref,fsctx,name) (ops)->open((ref),(fsctx),(name),FILE_MODE_READ)
+#define BDOPEN2(ops,ref,fsctx,name,mode) (ops)->open((ref),(fsctx),(name),(mode))
+#define BDOPEN_WR(ops,ref,fsctx,name) (ops)->open((ref),(fsctx),(name),FILE_MODE_WRITE)
+#define BDREAD(ops,ref,buf,len) (ops)->read((ref),(buf),(len))
+#define BDWRITE(ops,ref,buf,len) (ops)->write((ref),(buf),(len))
+#define BDCLOSE(ops,ref) (ops)->close((ref))
+#define BDUNINIT(ops,ref) (ops)->uninit((ref))
+#define BDSEEK(ops,ref,offset,how) (ops)->seek((ref),(offset),(how))
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+typedef struct fileio_dispatch_s {
+ const char *method;
+ unsigned int loadflags;
+ int (*init)(void **fsctx,void *device);
+ int (*open)(void **ref,void *fsctx,char *filename,int mode);
+ int (*read)(void *ref,uint8_t *buf,int len);
+ int (*write)(void *ref,uint8_t *buf,int len);
+ int (*seek)(void *ref,int offset,int how);
+ void (*close)(void *ref);
+ void (*uninit)(void *devctx);
+} fileio_dispatch_t;
+
+typedef struct fileio_ctx_s {
+ const fileio_dispatch_t *ops;
+ void *fsctx;
+} fileio_ctx_t;
+
+const fileio_dispatch_t *cfe_findfilesys(const char *name);
+
+int fs_init(char *fsname,fileio_ctx_t **fsctx,void *device);
+int fs_uninit(fileio_ctx_t *);
+int fs_open(fileio_ctx_t *,void **ref,char *filename,int mode);
+int fs_close(fileio_ctx_t *,void *ref);
+int fs_read(fileio_ctx_t *,void *ref,uint8_t *buffer,int len);
+int fs_write(fileio_ctx_t *,void *ref,uint8_t *buffer,int len);
+int fs_seek(fileio_ctx_t *,void *ref,int offset,int how);
+int fs_hook(fileio_ctx_t *fsctx,char *fsname);
+
+
diff --git a/cfe/cfe/include/cfe_flashimage.h b/cfe/cfe/include/cfe_flashimage.h
new file mode 100644
index 0000000..4e4647c
--- /dev/null
+++ b/cfe/cfe/include/cfe_flashimage.h
@@ -0,0 +1,64 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Flash Image defs File: cfe_flashimage.h
+ *
+ * This file contains stuff that describes the image header on
+ * the front of our flash images.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+typedef struct cfe_flashimage_s {
+ uint8_t seal[4]; /* CFE1 */
+ uint8_t flags[4]; /* Various flags, always big-endian */
+ uint8_t size[4]; /* Image size, in bytes, always big-endian */
+ uint8_t crc[4]; /* CRC-32, always big-endian */
+ uint8_t boardname[32]; /* Board name */
+ uint8_t majver,minver,ecover,miscver; /* Firmware version */
+ uint8_t reserved[12]; /* not used just yet */
+} cfe_flashimage_t; /* should be 64 bytes */
+
+
+#define CFE_IMAGE_SEAL "CFE1"
+#define CFE_IMAGE_EB 0x00000001
+#define CFE_IMAGE_EL 0x00000002
+#define CFE_IMAGE_MLONG64 0x00000004
+
diff --git a/cfe/cfe/include/cfe_iocb.h b/cfe/cfe/include/cfe_iocb.h
new file mode 100644
index 0000000..bc62078
--- /dev/null
+++ b/cfe/cfe/include/cfe_iocb.h
@@ -0,0 +1,211 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * IOCB definitions File: cfe_iocb.h
+ *
+ * This module describes CFE's IOCB structure, the main
+ * data structure used to communicate API requests with CFE.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#ifndef _CFE_IOCB_H
+#define _CFE_IOCB_H
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define CFE_CMD_FW_GETINFO 0
+#define CFE_CMD_FW_RESTART 1
+#define CFE_CMD_FW_BOOT 2
+#define CFE_CMD_FW_CPUCTL 3
+#define CFE_CMD_FW_GETTIME 4
+#define CFE_CMD_FW_MEMENUM 5
+#define CFE_CMD_FW_FLUSHCACHE 6
+
+#define CFE_CMD_DEV_GETHANDLE 9
+#define CFE_CMD_DEV_ENUM 10
+#define CFE_CMD_DEV_OPEN 11
+#define CFE_CMD_DEV_INPSTAT 12
+#define CFE_CMD_DEV_READ 13
+#define CFE_CMD_DEV_WRITE 14
+#define CFE_CMD_DEV_IOCTL 15
+#define CFE_CMD_DEV_CLOSE 16
+#define CFE_CMD_DEV_GETINFO 17
+
+#define CFE_CMD_ENV_ENUM 20
+#define CFE_CMD_ENV_GET 22
+#define CFE_CMD_ENV_SET 23
+#define CFE_CMD_ENV_DEL 24
+
+#define CFE_CMD_MAX 32
+
+#define CFE_CMD_VENDOR_USE 0x8000 /* codes above this are for customer use */
+
+#define CFE_MI_RESERVED 0 /* memory is reserved, do not use */
+#define CFE_MI_AVAILABLE 1 /* memory is available */
+
+#define CFE_FLG_WARMSTART 0x00000001
+#define CFE_FLG_FULL_ARENA 0x00000001
+#define CFE_FLG_ENV_PERMANENT 0x00000001
+
+#define CFE_CPU_CMD_START 1
+#define CFE_CPU_CMD_STOP 0
+
+#define CFE_STDHANDLE_CONSOLE 0
+
+#define CFE_DEV_NETWORK 1
+#define CFE_DEV_DISK 2
+#define CFE_DEV_FLASH 3
+#define CFE_DEV_SERIAL 4
+#define CFE_DEV_CPU 5
+#define CFE_DEV_NVRAM 6
+#define CFE_DEV_CLOCK 7
+#define CFE_DEV_OTHER 8
+#define CFE_DEV_MASK 0x0F
+
+#define CFE_CACHE_FLUSH_D 1
+#define CFE_CACHE_INVAL_I 2
+#define CFE_CACHE_INVAL_D 4
+#define CFE_CACHE_INVAL_L2 8
+#define CFE_CACHE_FLUSH_L2 16
+#define CFE_CACHE_INVAL_RANGE 32
+#define CFE_CACHE_FLUSH_RANGE 64
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+#define unsigned signed /* Kludge to get unsigned size-shaped type. */
+typedef __SIZE_TYPE__ cfe_int_t;
+#undef unsigned
+typedef __SIZE_TYPE__ cfe_uint_t;
+typedef unsigned long long cfe_offset_t;
+typedef long long cfe_int64_t;
+typedef unsigned char *cfe_ptr_t;
+
+typedef struct iocb_buffer_s {
+ cfe_offset_t buf_offset; /* offset on device (bytes) */
+ cfe_ptr_t buf_ptr; /* pointer to a buffer */
+ cfe_uint_t buf_length; /* length of this buffer */
+ cfe_uint_t buf_retlen; /* returned length (for read ops) */
+ cfe_uint_t buf_ioctlcmd; /* IOCTL command (used only for IOCTLs) */
+} iocb_buffer_t;
+
+#define buf_devflags buf_ioctlcmd /* returned device info flags */
+
+typedef struct iocb_inpstat_s {
+ cfe_uint_t inp_status; /* 1 means input available */
+} iocb_inpstat_t;
+
+typedef struct iocb_envbuf_s {
+ int enum_idx; /* 0-based enumeration index */
+ cfe_ptr_t name_ptr; /* name string buffer */
+ cfe_int_t name_length; /* size of name buffer */
+ cfe_ptr_t val_ptr; /* value string buffer */
+ cfe_int_t val_length; /* size of value string buffer */
+} iocb_envbuf_t;
+
+typedef struct iocb_cpuctl_s {
+ cfe_uint_t cpu_number; /* cpu number to control */
+ cfe_uint_t cpu_command; /* command to issue to CPU */
+ cfe_uint_t start_addr; /* CPU start address */
+ cfe_uint_t gp_val; /* starting GP value */
+ cfe_uint_t sp_val; /* starting SP value */
+ cfe_uint_t a1_val; /* starting A1 value */
+} iocb_cpuctl_t;
+
+typedef struct iocb_time_s {
+ long long ticks; /* current time in ticks */
+} iocb_time_t;
+
+typedef struct iocb_exitstat_s {
+ cfe_int_t status;
+} iocb_exitstat_t;
+
+typedef struct iocb_meminfo_s {
+ cfe_int_t mi_idx; /* 0-based enumeration index */
+ cfe_int_t mi_type; /* type of memory block */
+ cfe_int64_t mi_addr; /* physical start address */
+ cfe_int64_t mi_size; /* block size */
+} iocb_meminfo_t;
+
+#define CFE_FWI_64BIT 0x00000001
+#define CFE_FWI_32BIT 0x00000002
+#define CFE_FWI_RELOC 0x00000004
+#define CFE_FWI_UNCACHED 0x00000008
+#define CFE_FWI_MULTICPU 0x00000010
+#define CFE_FWI_FUNCSIM 0x00000020
+#define CFE_FWI_RTLSIM 0x00000040
+
+typedef struct iocb_fwinfo_s {
+ cfe_int64_t fwi_version; /* major, minor, eco version */
+ cfe_int64_t fwi_totalmem; /* total installed mem */
+ cfe_int64_t fwi_flags; /* various flags */
+ cfe_int64_t fwi_boardid; /* board ID */
+ cfe_int64_t fwi_bootarea_va; /* VA of boot area */
+ cfe_int64_t fwi_bootarea_pa; /* PA of boot area */
+ cfe_int64_t fwi_bootarea_size; /* size of boot area */
+ cfe_int64_t fwi_reserved1;
+ cfe_int64_t fwi_reserved2;
+ cfe_int64_t fwi_reserved3;
+} iocb_fwinfo_t;
+
+
+typedef struct cfe_iocb_s {
+ cfe_uint_t iocb_fcode; /* IOCB function code */
+ cfe_int_t iocb_status; /* return status */
+ cfe_int_t iocb_handle; /* file/device handle */
+ cfe_uint_t iocb_flags; /* flags for this IOCB */
+ cfe_uint_t iocb_psize; /* size of parameter list */
+ union {
+ iocb_buffer_t iocb_buffer; /* buffer parameters */
+ iocb_inpstat_t iocb_inpstat; /* input status parameters */
+ iocb_envbuf_t iocb_envbuf; /* environment function parameters */
+ iocb_cpuctl_t iocb_cpuctl; /* CPU control parameters */
+ iocb_time_t iocb_time; /* timer parameters */
+ iocb_meminfo_t iocb_meminfo; /* memory arena info parameters */
+ iocb_fwinfo_t iocb_fwinfo; /* firmware information */
+ iocb_exitstat_t iocb_exitstat; /* Exit Status */
+ } plist;
+} cfe_iocb_t;
+
+
+#endif
diff --git a/cfe/cfe/include/cfe_ioctl.h b/cfe/cfe/include/cfe_ioctl.h
new file mode 100644
index 0000000..1a389f8
--- /dev/null
+++ b/cfe/cfe/include/cfe_ioctl.h
@@ -0,0 +1,167 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * IOCTL definitions File: cfe_ioctl.h
+ *
+ * IOCTL function numbers and I/O data structures.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+/* *********************************************************************
+ * NVFAM and FLASH stuff
+ ********************************************************************* */
+
+#define IOCTL_NVRAM_GETINFO 1 /* return nvram_info_t */
+#define IOCTL_NVRAM_ERASE 2 /* erase sector containing nvram_info_t area */
+#define IOCTL_FLASH_ERASE_SECTOR 3 /* erase an arbitrary sector */
+#define IOCTL_FLASH_ERASE_ALL 4 /* Erase the entire flash */
+#define IOCTL_FLASH_WRITE_ALL 5 /* write entire flash */
+#define IOCTL_FLASH_GETINFO 6 /* get flash device info */
+#define IOCTL_FLASH_GETSECTORS 7 /* get sector information */
+#define IOCTL_FLASH_ERASE_RANGE 8 /* erase range of bytes */
+#define IOCTL_NVRAM_UNLOCK 9 /* allow r/w beyond logical end of device */
+#define IOCTL_FLASH_PROTECT_RANGE 10 /* Protect a group of sectors */
+#define IOCTL_FLASH_UNPROTECT_RANGE 11 /* unprotect a group of sectors */
+#define IOCTL_FLASH_DATA_WIDTH_MODE 12 /* switch flash and gen bus to support 8 or 16-bit mode I/Os */
+#define IOCTL_FLASH_BURST_MODE 13 /* configure gen bus for burst mode */
+
+typedef struct flash_range_s {
+ unsigned int range_base;
+ unsigned int range_length;
+} flash_range_t;
+
+typedef struct flash_info_s {
+ unsigned long long flash_base; /* flash physical base address */
+ unsigned int flash_size; /* available device size in bytes */
+ unsigned int flash_type; /* type, from FLASH_TYPE below */
+ unsigned int flash_flags; /* Various flags (FLASH_FLAG_xxx) */
+} flash_info_t;
+
+typedef struct flash_sector_s {
+ int flash_sector_idx;
+ int flash_sector_status;
+ unsigned int flash_sector_offset;
+ unsigned int flash_sector_size;
+} flash_sector_t;
+
+#define FLASH_SECTOR_OK 0
+#define FLASH_SECTOR_INVALID -1
+
+#define FLASH_TYPE_UNKNOWN 0 /* not sure what kind of flash */
+#define FLASH_TYPE_SRAM 1 /* not flash: it's SRAM */
+#define FLASH_TYPE_ROM 2 /* not flash: it's ROM */
+#define FLASH_TYPE_FLASH 3 /* it's flash memory of some sort */
+
+#define FLASH_FLAG_NOERASE 1 /* Byte-range writes supported,
+ Erasing is not necessary */
+
+typedef struct nvram_info_s {
+ int nvram_offset; /* offset of environment area */
+ int nvram_size; /* size of environment area */
+ int nvram_eraseflg; /* true if we need to erase first */
+} nvram_info_t;
+
+/* *********************************************************************
+ * Ethernet stuff
+ ********************************************************************* */
+
+#define IOCTL_ETHER_GETHWADDR 1 /* Get hardware address (6bytes) */
+#define IOCTL_ETHER_SETHWADDR 2 /* Set hardware address (6bytes) */
+#define IOCTL_ETHER_GETSPEED 3 /* Get Speed and Media (int) */
+#define IOCTL_ETHER_SETSPEED 4 /* Set Speed and Media (int) */
+#define IOCTL_ETHER_GETLINK 5 /* get link status (int) */
+#define IOCTL_ETHER_GETLOOPBACK 7 /* get loopback state */
+#define IOCTL_ETHER_SETLOOPBACK 8 /* set loopback state */
+#define IOCTL_ETHER_SETPACKETFIFO 9 /* set packet fifo mode (int) */
+#define IOCTL_ETHER_SETSTROBESIG 10 /* set strobe signal (int) */
+
+#define ETHER_LOOPBACK_OFF 0 /* no loopback */
+#define ETHER_LOOPBACK_INT 1 /* Internal loopback */
+#define ETHER_LOOPBACK_EXT 2 /* External loopback (through PHY) */
+
+#define ETHER_SPEED_AUTO 0 /* Auto detect */
+#define ETHER_SPEED_UNKNOWN 0 /* Speed not known (on link status) */
+#define ETHER_SPEED_10HDX 1 /* 10MB hdx and fdx */
+#define ETHER_SPEED_10FDX 2
+#define ETHER_SPEED_100HDX 3 /* 100MB hdx and fdx */
+#define ETHER_SPEED_100FDX 4
+#define ETHER_SPEED_1000HDX 5 /* 1000MB hdx and fdx */
+#define ETHER_SPEED_1000FDX 6
+
+#define ETHER_FIFO_8 0 /* 8-bit packet fifo mode */
+#define ETHER_FIFO_16 1 /* 16-bit packet fifo mode */
+#define ETHER_ETHER 2 /* Standard ethernet mode */
+
+#define ETHER_STROBE_GMII 0 /* GMII style strobe signal */
+#define ETHER_STROBE_ENCODED 1 /* Encoded */
+#define ETHER_STROBE_SOP 2 /* SOP flagged. Only in 8-bit mode*/
+#define ETHER_STROBE_EOP 3 /* EOP flagged. Only in 8-bit mode*/
+
+/* *********************************************************************
+ * Serial Ports
+ ********************************************************************* */
+
+#define IOCTL_SERIAL_SETSPEED 1 /* get baud rate (int) */
+#define IOCTL_SERIAL_GETSPEED 2 /* set baud rate (int) */
+#define IOCTL_SERIAL_SETFLOW 3 /* Set Flow Control */
+#define IOCTL_SERIAL_GETFLOW 4 /* Get Flow Control */
+
+#define SERIAL_FLOW_NONE 0 /* no flow control */
+#define SERIAL_FLOW_SOFTWARE 1 /* software flow control (not impl) */
+#define SERIAL_FLOW_HARDWARE 2 /* hardware flow control */
+
+/* *********************************************************************
+ * Block device stuff
+ ********************************************************************* */
+
+#define IOCTL_BLOCK_GETBLOCKSIZE 1 /* get block size (int) */
+#define IOCTL_BLOCK_GETTOTALBLOCKS 2 /* get total bocks (long long) */
+#define IOCTL_BLOCK_GETDEVTYPE 3 /* get device type (struct) */
+
+typedef struct blockdev_info_s {
+ unsigned long long blkdev_totalblocks;
+ unsigned int blkdev_blocksize;
+ unsigned int blkdev_devtype;
+} blockdev_info_t;
+
+#define BLOCK_DEVTYPE_DISK 0
+#define BLOCK_DEVTYPE_CDROM 1
+
diff --git a/cfe/cfe/include/cfe_irq.h b/cfe/cfe/include/cfe_irq.h
new file mode 100644
index 0000000..7605b5e
--- /dev/null
+++ b/cfe/cfe/include/cfe_irq.h
@@ -0,0 +1,103 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * IRQ related definitions File: cfe_irq.h
+ *
+ * This module describes CFE's interface for dispatching
+ * to driver-supplied service routines. Dispatch can be based
+ * either on asynchronous interrupt events or on synchrnous
+ * polling of the interrupt status registers from the idle loop.
+ *
+ * The interface attempts to accomodate the concept of interrupt
+ * mapping as is common on high-integration parts with standard
+ * cores. The details are motivated by the bcm1250/MIPS
+ * architecture, where the mapping abstraction is somewhat violated
+ * by CP0 interrupts that do not go through the mapper.
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define NR_IRQS 64
+
+#define CFE_IRQ_FLAGS_SHARED 0x1
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+/* *********************************************************************
+ * Functions
+ ********************************************************************* */
+
+void cfe_irq_init(void);
+
+
+/* Functions that use interrupt mapping, i.e., the irq argument is the
+ interrupt number at the input to the mapper. */
+
+void cfe_mask_irq(int cpu, unsigned int irq);
+void cfe_unmask_irq(int cpu, unsigned int irq);
+
+void cfe_enable_irq(unsigned int irq);
+void cfe_disable_irq(unsigned int irq);
+
+int cfe_request_irq(unsigned int irq,
+ void (*handler)(void *), void *arg,
+ unsigned long irqflags, int device);
+void cfe_free_irq(unsigned int irq, int device);
+
+/* pseudo-interrupts, by polling request lines and invoking handlers */
+
+void cfe_irq_poll(void *);
+
+
+/* Functions that bypass interrupt mapping, i.e., the ip argument
+ is the interrupt number at the output of the mapper and/or the
+ input to the CPU. */
+
+typedef void (* ip_handler_t)(int ip);
+
+void cfe_irq_setvector(int ip, ip_handler_t handler);
+
+/* enable/disable interrupts at the CPU level. */
+
+void cfe_irq_enable(int mask);
+int cfe_irq_disable(void);
diff --git a/cfe/cfe/include/cfe_loader.h b/cfe/cfe/include/cfe_loader.h
new file mode 100644
index 0000000..9ed0c13
--- /dev/null
+++ b/cfe/cfe/include/cfe_loader.h
@@ -0,0 +1,86 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Loader API File: cfe_loader.h
+ *
+ * This is the main API for the program loader.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#ifndef _CFE_LOADER_H_
+#define _CFE_LOADER_H_
+
+#define LOADFLG_NOISY 0x0001 /* print out noisy info */
+#define LOADFLG_EXECUTE 0x0002 /* execute loaded program */
+#define LOADFLG_SPECADDR 0x0004 /* Use a specific size & addr */
+#define LOADFLG_NOBB 0x0008 /* don't look for a boot block */
+#define LOADFLG_NOCLOSE 0x0010 /* don't close network */
+#define LOADFLG_COMPRESSED 0x0020 /* file is compressed */
+#define LOADFLG_BATCH 0x0040 /* batch file */
+
+typedef struct cfe_loadargs_s {
+ char *la_filename; /* name of file on I/O device */
+ char *la_filesys; /* file system name */
+ char *la_device; /* device name (ide0, etc.) */
+ char *la_options; /* args to pass to loaded prog */
+ char *la_loader; /* binary file loader to use */
+ unsigned int la_flags; /* various flags */
+ long la_address; /* used by SPECADDR only */
+ unsigned long la_maxsize; /* used by SPECADDR only */
+ long la_entrypt; /* returned entry point */
+} cfe_loadargs_t;
+
+
+typedef struct cfe_loader_s {
+ char *name; /* name of loader */
+ int (*loader)(cfe_loadargs_t *); /* access function */
+ int flags; /* flags */
+} cfe_loader_t;
+
+#define LDRLOAD(ldr,arg) (*((ldr)->loader))(arg)
+
+int cfe_load_program(char *name,cfe_loadargs_t *la);
+const cfe_loader_t *cfe_findloader(char *name);
+void splitpath(char *path,char **devname,char **filename);
+void cfe_go(cfe_loadargs_t *la);
+int cfe_boot(char *ldrname,cfe_loadargs_t *la);
+int cfe_savedata(char *fsname,char *devname,char *filename,uint8_t *start,uint8_t *end);
+
+#endif /* _CFE_LOADER_H_ */
diff --git a/cfe/cfe/include/cfe_mem.h b/cfe/cfe/include/cfe_mem.h
new file mode 100644
index 0000000..83c3be2
--- /dev/null
+++ b/cfe/cfe/include/cfe_mem.h
@@ -0,0 +1,79 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Memory manager definitions File: cfe_mem.h
+ *
+ * Function prototypes and contants for the memory manager
+ * (used to manage the physical memory arena)
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define MEMTYPE_EMPTY 0
+#define MEMTYPE_DRAM_AVAILABLE 1 /* must match value in cfe_iocb.h */
+#define MEMTYPE_DRAM_NOTINSTALLED 2
+#define MEMTYPE_DRAM_USEDBYFIRMWARE 3
+#define MEMTYPE_BOOTROM 4
+#define MEMTYPE_IOREGISTERS 5
+#define MEMTYPE_RESERVED 6
+#define MEMTYPE_L2CACHE 7
+#define MEMTYPE_LDT_PCI 8
+#define MEMTYPE_DRAM_BOOTPROGRAM 9
+
+/* *********************************************************************
+ * External data
+ ********************************************************************* */
+
+extern unsigned int mem_bootarea_start;
+extern unsigned int mem_bootarea_size;
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+void cfe_arena_init(void);
+int cfe_arena_loadcheck(uintptr_t start,unsigned int size);
+int cfe_arena_enum(int idx,int *type,uint64_t *start,uint64_t *size,int allrecs);
+void cfe_pagetable_init(void);
+
diff --git a/cfe/cfe/include/cfe_timer.h b/cfe/cfe/include/cfe_timer.h
new file mode 100644
index 0000000..8c6a26f
--- /dev/null
+++ b/cfe/cfe/include/cfe_timer.h
@@ -0,0 +1,74 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Timer defs and prototypes File: cfe_timer.h
+ *
+ * Definitions, prototypes, and macros related to the timer.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#ifndef _CFE_TIMER_T
+#define _CFE_TIMER_T
+
+void cfe_bg_init(void);
+void cfe_bg_add(void (*func)(void *),void *arg);
+void cfe_bg_remove(void (*func)(void *));
+
+void background(void);
+
+#define POLL() background()
+
+typedef int64_t cfe_timer_t;
+
+void cfe_timer_init(void);
+extern volatile int64_t cfe_ticks;
+extern int cfe_cpu_speed;
+
+void cfe_sleep(int ticks);
+void cfe_usleep(int usec);
+
+#define CFE_HZ 10 /* ticks per second */
+
+#define TIMER_SET(x,v) x = cfe_ticks + (v)
+#define TIMER_EXPIRED(x) ((x) && (cfe_ticks > (x)))
+#define TIMER_CLEAR(x) x = 0
+#define TIMER_RUNNING(x) ((x) != 0)
+
+#endif
diff --git a/cfe/cfe/include/cfe_xiocb.h b/cfe/cfe/include/cfe_xiocb.h
new file mode 100644
index 0000000..75a336a
--- /dev/null
+++ b/cfe/cfe/include/cfe_xiocb.h
@@ -0,0 +1,202 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * IOCB definitions File: cfe_iocb.h
+ *
+ * This module describes CFE's IOCB structure, the main
+ * data structure used to communicate API requests with CFE.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#ifndef _CFE_XIOCB_H
+#define _CFE_XIOCB_H
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define CFE_CMD_FW_GETINFO 0
+#define CFE_CMD_FW_RESTART 1
+#define CFE_CMD_FW_BOOT 2
+#define CFE_CMD_FW_CPUCTL 3
+#define CFE_CMD_FW_GETTIME 4
+#define CFE_CMD_FW_MEMENUM 5
+#define CFE_CMD_FW_FLUSHCACHE 6
+
+#define CFE_CMD_DEV_GETHANDLE 9
+#define CFE_CMD_DEV_ENUM 10
+#define CFE_CMD_DEV_OPEN 11
+#define CFE_CMD_DEV_INPSTAT 12
+#define CFE_CMD_DEV_READ 13
+#define CFE_CMD_DEV_WRITE 14
+#define CFE_CMD_DEV_IOCTL 15
+#define CFE_CMD_DEV_CLOSE 16
+#define CFE_CMD_DEV_GETINFO 17
+
+#define CFE_CMD_ENV_ENUM 20
+#define CFE_CMD_ENV_GET 22
+#define CFE_CMD_ENV_SET 23
+#define CFE_CMD_ENV_DEL 24
+
+#define CFE_CMD_MAX 32
+
+#define CFE_CMD_VENDOR_USE 0x8000 /* codes above this are for customer use */
+
+#define CFE_MI_RESERVED 0 /* memory is reserved, do not use */
+#define CFE_MI_AVAILABLE 1 /* memory is available */
+
+#define CFE_FLG_WARMSTART 0x00000001
+#define CFE_FLG_FULL_ARENA 0x00000001
+#define CFE_FLG_ENV_PERMANENT 0x00000001
+
+#define CFE_CPU_CMD_START 1
+#define CFE_CPU_CMD_STOP 0
+
+#define CFE_STDHANDLE_CONSOLE 0
+
+#define CFE_DEV_NETWORK 1
+#define CFE_DEV_DISK 2
+#define CFE_DEV_FLASH 3
+#define CFE_DEV_SERIAL 4
+#define CFE_DEV_CPU 5
+#define CFE_DEV_NVRAM 6
+#define CFE_DEV_CLOCK 7
+#define CFE_DEV_OTHER 8
+#define CFE_DEV_MASK 0x0F
+
+#define CFE_CACHE_FLUSH_D 1
+#define CFE_CACHE_INVAL_I 2
+#define CFE_CACHE_INVAL_D 4
+#define CFE_CACHE_INVAL_L2 8
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+typedef unsigned long long cfe_xuint_t;
+typedef long long cfe_xint_t;
+typedef long long cfe_xptr_t;
+
+typedef struct xiocb_buffer_s {
+ cfe_xuint_t buf_offset; /* offset on device (bytes) */
+ cfe_xptr_t buf_ptr; /* pointer to a buffer */
+ cfe_xuint_t buf_length; /* length of this buffer */
+ cfe_xuint_t buf_retlen; /* returned length (for read ops) */
+ cfe_xuint_t buf_ioctlcmd; /* IOCTL command (used only for IOCTLs) */
+} xiocb_buffer_t;
+
+#define buf_devflags buf_ioctlcmd /* returned device info flags */
+
+typedef struct xiocb_inpstat_s {
+ cfe_xuint_t inp_status; /* 1 means input available */
+} xiocb_inpstat_t;
+
+typedef struct xiocb_envbuf_s {
+ cfe_xint_t enum_idx; /* 0-based enumeration index */
+ cfe_xptr_t name_ptr; /* name string buffer */
+ cfe_xint_t name_length; /* size of name buffer */
+ cfe_xptr_t val_ptr; /* value string buffer */
+ cfe_xint_t val_length; /* size of value string buffer */
+} xiocb_envbuf_t;
+
+typedef struct xiocb_cpuctl_s {
+ cfe_xuint_t cpu_number; /* cpu number to control */
+ cfe_xuint_t cpu_command; /* command to issue to CPU */
+ cfe_xuint_t start_addr; /* CPU start address */
+ cfe_xuint_t gp_val; /* starting GP value */
+ cfe_xuint_t sp_val; /* starting SP value */
+ cfe_xuint_t a1_val; /* starting A1 value */
+} xiocb_cpuctl_t;
+
+typedef struct xiocb_time_s {
+ cfe_xint_t ticks; /* current time in ticks */
+} xiocb_time_t;
+
+typedef struct xiocb_exitstat_s {
+ cfe_xint_t status;
+} xiocb_exitstat_t;
+
+typedef struct xiocb_meminfo_s {
+ cfe_xint_t mi_idx; /* 0-based enumeration index */
+ cfe_xint_t mi_type; /* type of memory block */
+ cfe_xuint_t mi_addr; /* physical start address */
+ cfe_xuint_t mi_size; /* block size */
+} xiocb_meminfo_t;
+
+#define CFE_FWI_64BIT 0x00000001
+#define CFE_FWI_32BIT 0x00000002
+#define CFE_FWI_RELOC 0x00000004
+#define CFE_FWI_UNCACHED 0x00000008
+#define CFE_FWI_MULTICPU 0x00000010
+#define CFE_FWI_FUNCSIM 0x00000020
+#define CFE_FWI_RTLSIM 0x00000040
+
+typedef struct xiocb_fwinfo_s {
+ cfe_xint_t fwi_version; /* major, minor, eco version */
+ cfe_xint_t fwi_totalmem; /* total installed mem */
+ cfe_xint_t fwi_flags; /* various flags */
+ cfe_xint_t fwi_boardid; /* board ID */
+ cfe_xint_t fwi_bootarea_va; /* VA of boot area */
+ cfe_xint_t fwi_bootarea_pa; /* PA of boot area */
+ cfe_xint_t fwi_bootarea_size; /* size of boot area */
+ cfe_xint_t fwi_reserved1;
+ cfe_xint_t fwi_reserved2;
+ cfe_xint_t fwi_reserved3;
+} xiocb_fwinfo_t;
+
+typedef struct cfe_xiocb_s {
+ cfe_xuint_t xiocb_fcode; /* IOCB function code */
+ cfe_xint_t xiocb_status; /* return status */
+ cfe_xint_t xiocb_handle; /* file/device handle */
+ cfe_xuint_t xiocb_flags; /* flags for this IOCB */
+ cfe_xuint_t xiocb_psize; /* size of parameter list */
+ union {
+ xiocb_buffer_t xiocb_buffer; /* buffer parameters */
+ xiocb_inpstat_t xiocb_inpstat; /* input status parameters */
+ xiocb_envbuf_t xiocb_envbuf; /* environment function parameters */
+ xiocb_cpuctl_t xiocb_cpuctl; /* CPU control parameters */
+ xiocb_time_t xiocb_time; /* timer parameters */
+ xiocb_meminfo_t xiocb_meminfo; /* memory arena info parameters */
+ xiocb_fwinfo_t xiocb_fwinfo; /* firmware information */
+ xiocb_exitstat_t xiocb_exitstat; /* Exit Status */
+ } plist;
+} cfe_xiocb_t;
+
+#endif
diff --git a/cfe/cfe/include/dev_flash.h b/cfe/cfe/include/dev_flash.h
new file mode 100644
index 0000000..8cbce48
--- /dev/null
+++ b/cfe/cfe/include/dev_flash.h
@@ -0,0 +1,168 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Flash memory definitions File: dev_flash.h
+ *
+ * Stuff we use when manipulating flash memory devices.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+/*
+ * AMD Flash commands and magic offsets
+ */
+
+#define AMD_FLASH_MAGIC_ADDR_1 0x555 /* AAA for 16-bit devices in 8-bit mode */
+#define AMD_FLASH_MAGIC_ADDR_2 0x2AA /* 554 for 16-bit devices in 8-bit mode */
+
+#define AMD_FLASH_RESET 0xF0
+#define AMD_FLASH_MAGIC_1 0xAA
+#define AMD_FLASH_MAGIC_2 0x55
+#define AMD_FLASH_AUTOSEL 0x90
+#define AMD_FLASH_PROGRAM 0xA0
+#define AMD_FLASH_UNLOCK_BYPASS 0x20
+#define AMD_FLASH_ERASE_3 0x80
+#define AMD_FLASH_ERASE_4 0xAA
+#define AMD_FLASH_ERASE_5 0x55
+#define AMD_FLASH_ERASE_ALL_6 0x10
+#define AMD_FLASH_ERASE_SEC_6 0x30
+
+/*
+ * INTEL Flash commands and magic offsets
+ */
+
+#define INTEL_FLASH_READ_MODE 0xFF
+#define INTEL_FLASH_ERASE_BLOCK 0x20
+#define INTEL_FLASH_ERASE_CONFIRM 0xD0
+#define INTEL_FLASH_PROGRAM 0x40
+
+/* INTEL Flash commands for 16-bit mode */
+#define INTEL_FLASH_16BIT_READ_MODE 0xFF00
+#define INTEL_FLASH_16BIT_ERASE_BLOCK 0x2000
+#define INTEL_FLASH_16BIT_ERASE_CONFIRM 0xD000
+#define INTEL_FLASH_16BIT_PROGRAM 0x4000
+#define INTEL_FLASH_8BIT 0
+#define INTEL_FLASH_16BIT 1
+
+
+/*
+ * Common Flash Interface (CFI) commands and offsets
+ */
+
+#define FLASH_CFI_QUERY_ADDR 0x55
+#define FLASH_CFI_QUERY_MODE 0x98
+#define FLASH_CFI_QUERY_EXIT 0xFF
+
+#define FLASH_CFI_MANUFACTURER 0x00
+#define FLASH_CFI_DEVICE 0x01
+#define FLASH_CFI_SIGNATURE 0x10
+#define FLASH_CFI_QUERY_STRING 0x10
+#define FLASH_CFI_COMMAND_SET 0x13
+#define FLASH_CFI_DEVICE_SIZE 0x27
+#define FLASH_CFI_DEVICE_INTERFACE 0x28
+#define FLASH_CFI_REGION_COUNT 0x2C
+#define FLASH_CFI_REGION_TABLE 0x2D
+
+#define FLASH_CFI_CMDSET_INTEL_ECS 0x0001 /* Intel extended */
+#define FLASH_CFI_CMDSET_AMD_STD 0x0002 /* AMD Standard */
+#define FLASH_CFI_CMDSET_INTEL_STD 0x0003 /* Intel Standard */
+#define FLASH_CFI_CMDSET_AMD_ECS 0x0004 /* AMD Extended */
+
+#define FLASH_CFI_DEVIF_X8 0x0000 /* 8-bit asynchronous */
+#define FLASH_CFI_DEVIF_X16 0x0001 /* 16-bit asynchronous */
+#define FLASH_CFI_DEVIF_X8X16 0x0002 /* 8 or 16-bit with BYTE# pin */
+#define FLASH_CFI_DEVIF_X32 0x0003 /* 32-bit asynchronous */
+
+/*
+ * JEDEC offsets
+ */
+
+#define FLASH_JEDEC_OFFSET_MFR 0
+#define FLASH_JEDEC_OFFSET_DEV 1
+
+/* Vendor-specific flash identifiers */
+
+#define FLASH_MFR_HYUNDAI 0xAD
+
+/* *********************************************************************
+ * Macros for defining custom sector tables
+ ********************************************************************* */
+
+#define FLASH_SECTOR_RANGE(nblks,size) (((nblks)-1) << 16) + ((size)/256)
+#define FLASH_SECTOR_NBLKS(x) (((x) >> 16)+1)
+#define FLASH_SECTOR_SIZE(x) (((x) & 0xFFFF)*256)
+#define FLASH_MAXSECTORS 8
+
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+/*
+ * This structure is passed in the "probe_ptr" field of the
+ * flash's probe routines and can be used for advanced
+ * configuration. If you pass this structure, probe_a and
+ * probe_b will be ignored by the driver
+ *
+ * flash_prog_phys is the base address you use for flash commands -
+ * you can put 0 here if it's the same as flash_phys. some boards,
+ * like the Algor P5064, have a different PA region used for doing
+ * byte accesses to the flash. In this case the special
+ * "flash_prog_phys" field is used for that.
+ */
+
+
+#define FLASH_FLG_NVRAM 0x00000001 /* Reserve space for NVRAM */
+#define FLASH_FLG_AUTOSIZE 0x00000002 /* resize to actual device size */
+#define FLASH_FLG_16BIT 0x00000004 /* it's a 16-bit ROM in 16-bit mode */
+#define FLASH_FLG_MANUAL 0x00000008 /* Not CFI, manual sectoring */
+#define FLASH_FLG_WIDE 0x00000010 /* must shift control addresses left one bit */
+
+#ifndef __ASSEMBLER__
+typedef struct flash_probe_t {
+ long flash_phys;
+ long flash_prog_phys; /* base address for programming, if different */
+ int flash_size; /* total flash size */
+ int flash_flags;
+ /* The following are used when manually sectoring */
+ int flash_cmdset;
+ int flash_nsectors; /* number of ranges */
+ int flash_sectors[FLASH_MAXSECTORS];
+} flash_probe_t;
+#endif
diff --git a/cfe/cfe/include/dev_ide.h b/cfe/cfe/include/dev_ide.h
new file mode 100644
index 0000000..96d3e18
--- /dev/null
+++ b/cfe/cfe/include/dev_ide.h
@@ -0,0 +1,90 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * IDE disk driver File: dev_ide.h
+ *
+ * Probe constants for the IDE disk device. Various flags
+ * can be passed to the probe routine to configure various
+ * things. This is where they are defined.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+/*
+ * Use the macros below to set the type of the master and slave devices
+ * on the IDE bus. If you want automatic probing, then you need
+ * to specify that IDE_DEV_TYPE_AUTO as the device type.
+ */
+
+
+/*
+ * XXX: If you have more than one PCI IDE controller
+ * installed, this will be applied to all installed
+ * controllers. Clearly not right, we'll need to add
+ * a field here for a controller index.
+ */
+
+
+#define IDE_PROBE_TYPE_MASK 0x0F
+#define IDE_PROBE_MASTER_SHIFT 0
+#define IDE_PROBE_SLAVE_SHIFT 4
+
+#define IDE_PROBE_MASTER_TYPE(x) ((x) << IDE_PROBE_MASTER_SHIFT)
+#define IDE_PROBE_SLAVE_TYPE(x) ((x) << IDE_PROBE_SLAVE_SHIFT)
+
+#define IDE_PROBE_GET_TYPE(pb,unit) (((pb) >> (unit*4)) & IDE_PROBE_TYPE_MASK)
+
+/*
+ * Device types.
+ */
+
+#define IDE_DEVTYPE_NOPROBE 0 /* none */
+#define IDE_DEVTYPE_AUTO 0x0F /* automatically probe */
+
+#define IDE_DEVTYPE_DISK 1 /* hard drives */
+#define IDE_DEVTYPE_CDROM 2 /* CD-ROMs */
+#define IDE_DEVTYPE_ATAPIDISK 3 /* ZIP disks, etc. */
+
+
+
diff --git a/cfe/cfe/include/dev_ide_common.h b/cfe/cfe/include/dev_ide_common.h
new file mode 100644
index 0000000..736fd99
--- /dev/null
+++ b/cfe/cfe/include/dev_ide_common.h
@@ -0,0 +1,204 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Generic IDE disk driver File: dev_ide_common.c
+ *
+ * This file contains common constants and structures for IDE
+ * disks and CFE drivers for them.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define IDE_REG_DATA 0x0
+#define IDE_REG_ERROR 0x1
+#define IDE_REG_PRECOMP 0x1
+#define IDE_REG_SECCNT 0x2
+#define IDE_REG_IR 0x2 /* ATAPI */
+#define IDE_REG_SECNUM 0x3
+#define IDE_REG_BCLSB 0x4 /* ATAPI */
+#define IDE_REG_BCMSB 0x5 /* ATAPI */
+#define IDE_REG_CYLLSB 0x4
+#define IDE_REG_CYLMSB 0x5
+#define IDE_REG_DRVHD 0x6
+#define IDE_REG_STATUS 0x7
+#define IDE_REG_COMMAND 0x7
+#define IDE_REG_ALTSTAT 0x6 /* Note: ALTSTAT is really 0x3F6, what do we do? */
+#define IDE_REG_DIGOUT 0x6
+
+#define IDE_IR_CD 0x01 /* 1 = command, 0 = data */
+#define IDE_IR_IO 0x02 /* 1 = from device, 0 = to device */
+#define IDE_IR_REL 0x04
+
+#define IDE_ERR_BBK 0x80 /* sector marked bad by host */
+#define IDE_ERR_UNC 0x40 /* uncorrectable error */
+#define IDE_ERR_MC 0x20 /* medium changed */
+#define IDE_ERR_NID 0x10 /* no ID mark found */
+#define IDE_ERR_MCR 0x08 /* medium change required */
+#define IDE_ERR_ABT 0x04 /* command aborted */
+#define IDE_ERR_NT0 0x02 /* track 0 not found */
+#define IDE_ERR_NDM 0x01 /* address mark not found */
+
+#define IDE_DRV_SLAVE 0x10
+#define IDE_DRV_LBA 0x40
+#define IDE_DRV_MBO 0xA0
+#define IDE_DRV_HDMASK 0x0F
+
+#define IDE_STS_BSY 0x80 /* drive is busy */
+#define IDE_STS_RDY 0x40 /* drive is ready */
+#define IDE_STS_WFT 0x20 /* write fault */
+#define IDE_STS_SKC 0x10 /* seek complete */
+#define IDE_STS_DRQ 0x08 /* data can be transferred */
+#define IDE_STS_CORR 0x04 /* correctable data error */
+#define IDE_STS_IDX 0x02 /* index mark just passed */
+#define IDE_STS_ERR 0x01 /* Error register contains info */
+
+#define IDE_CMD_RECAL 0x10
+#define IDE_CMD_READ 0x20
+#define IDE_CMD_READRETRY 0x21
+#define IDE_CMD_WRITE 0x30
+#define IDE_CMD_READVERIFY 0x40
+#define IDE_CMD_DIAGNOSTIC 0x90
+#define IDE_CMD_INITPARAMS 0x91
+#define IDE_CMD_SETMULTIPLE 0xC6
+#define IDE_CMD_POWER_MODE 0xE5
+#define IDE_CMD_DRIVE_INFO 0xEC
+
+#define IDE_CMD_ATAPI_SOFTRESET 0x08
+#define IDE_CMD_ATAPI_PACKET 0xA0
+#define IDE_CMD_ATAPI_IDENTIFY 0xA1
+#define IDE_CMD_ATAPI_SERVICE 0xA2
+
+#define IDE_DOR_SRST 0x04
+#define IDE_DOR_IEN 0x02
+
+#define DISK_SECTORSIZE 512
+#define CDROM_SECTORSIZE 2048
+#define MAX_SECTORSIZE 2048
+
+#define ATAPI_SENSE_MASK 0xF0
+#define ATAPI_SENSE_NONE 0x00
+#define ATAPI_SENSE_RECOVERED 0x10
+#define ATAPI_SENSE_NOTREADY 0x20
+#define ATAPI_SENSE_MEDIUMERROR 0x30
+#define ATAPI_SENSE_HWERROR 0x40
+#define ATAPI_SENSE_ILLREQUEST 0x50
+#define ATAPI_SENSE_ATTENTION 0x60
+#define ATAPI_SENSE_PROTECT 0x70
+#define ATAPI_SENSE_BLANKCHECK 0x80
+#define ATAPI_SENSE_VSPECIFIC 0x90
+#define ATAPI_SENSE_COPYABORT 0xA0
+#define ATAPI_SENSE_CMDABORT 0xB0
+#define ATAPI_SENSE_EQUAL 0xC0
+#define ATAPI_SENSE_VOLOVERFLOW 0xD0
+#define ATAPI_SENSE_MISCOMPARE 0xE0
+#define ATAPI_SENSE_RESERVED 0xF0
+
+#define ATAPI_SIG_LSB 0x14
+#define ATAPI_SIG_MSB 0xEB
+
+#define CDB_CMD_READ 0x28
+#define CDB_CMD_WRITE 0x2A
+#define CDB_CMD_REQSENSE 0x03
+
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+typedef struct idecommon_dispatch_s idecommon_dispatch_t;
+
+struct idecommon_dispatch_s {
+ void *ref;
+ uint32_t baseaddr;
+ uint8_t (*inb)(idecommon_dispatch_t *disp,uint32_t reg);
+ uint16_t (*inw)(idecommon_dispatch_t *disp,uint32_t reg);
+ void (*ins)(idecommon_dispatch_t *disp,uint32_t reg,uint8_t *buf,int len);
+
+ void (*outb)(idecommon_dispatch_t *disp,uint32_t reg,uint8_t val);
+ void (*outw)(idecommon_dispatch_t *disp,uint32_t reg,uint16_t val);
+ void (*outs)(idecommon_dispatch_t *disp,uint32_t reg,uint8_t *buf,int len);
+};
+
+#define IDEDISP_WRITEREG8(ide,reg,val) (*((ide)->outb))(ide,reg,val)
+#define IDEDISP_WRITEREG16(ide,reg,val) (*((ide)->outw))(ide,reg,val)
+#define IDEDISP_WRITEBUF(ide,reg,buf,len) (*((ide)->outs))(ide,reg,buf,len)
+#define IDEDISP_READREG8(ide,reg) (*((ide)->inb))(ide,reg)
+#define IDEDISP_READREG16(ide,reg) (*((ide)->inw))(ide,reg)
+#define IDEDISP_READBUF(ide,reg,buf,len) (*((ide)->ins))(ide,reg,buf,len)
+
+typedef struct idecommon_s idecommon_t;
+
+struct idecommon_s {
+ idecommon_dispatch_t *idecommon_dispatch;
+ unsigned long idecommon_addr; /* physical address */
+ int idecommon_unit; /* 0 or 1 master/slave */
+ int idecommon_sectorsize; /* size of each sector */
+ long long idecommon_ttlsect; /* total sectors */
+ int idecommon_atapi; /* 1 if ATAPI device */
+ int idecommon_devtype; /* device type */
+ uint64_t idecommon_deferprobe; /* Defer probe to open */
+ uint32_t idecommon_flags; /* flags for underlying driver */
+ int (*idecommon_readfunc)(idecommon_t *ide,uint64_t lba,int numsec,uint8_t *buffer);
+ int (*idecommon_writefunc)(idecommon_t *ide,uint64_t lba,int numsec,uint8_t *buffer);
+
+ uint32_t timer;
+};
+
+
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+extern void idecommon_init(idecommon_t *ide,int devtype);
+extern int idecommon_open(cfe_devctx_t *ctx);
+extern int idecommon_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+extern int idecommon_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat);
+extern int idecommon_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+extern int idecommon_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+extern int idecommon_identify(idecommon_t *ide,unsigned char *buffer);
+extern int idecommon_close(cfe_devctx_t *ctx);
+extern int idecommon_devprobe(idecommon_t *ide,int noisy);
+void idecommon_attach(cfe_devdisp_t *disp);
+
diff --git a/cfe/cfe/include/dev_newflash.h b/cfe/cfe/include/dev_newflash.h
new file mode 100644
index 0000000..5efced0
--- /dev/null
+++ b/cfe/cfe/include/dev_newflash.h
@@ -0,0 +1,344 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Flash memory definitions File: dev_newflash.h
+ *
+ * Stuff we use when manipulating flash memory devices.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#ifndef __ASSEMBLER__
+#include "cfe_device.h"
+#include "cfe_iocb.h"
+#endif
+
+/* *********************************************************************
+ * Configuration
+ ********************************************************************* */
+
+/* Bits for compile-time removal of features */
+#define FLASH_DRIVER_INTEL 1 /* support Intel cmd sets */
+#define FLASH_DRIVER_AMD 2 /* support AMD cmd sets */
+#define FLASH_DRIVER_CFI 4 /* support auto probing */
+
+/* Default value unless overridden in bsp_config.h */
+#ifndef FLASH_DRIVERS
+#define FLASH_DRIVERS (FLASH_DRIVER_INTEL | FLASH_DRIVER_AMD | FLASH_DRIVER_CFI)
+#endif
+
+/* *********************************************************************
+ * Flash magic numbers
+ ********************************************************************* */
+
+/*
+ * AMD Flash commands and magic offsets
+ */
+
+#define AMD_FLASH_MAGIC_ADDR_1 0x555 /* AAA for 16-bit devices in 8-bit mode */
+#define AMD_FLASH_MAGIC_ADDR_2 0x2AA /* 554 for 16-bit devices in 8-bit mode */
+
+#define AMD_FLASH_RESET 0xF0
+#define AMD_FLASH_MAGIC_1 0xAA
+#define AMD_FLASH_MAGIC_2 0x55
+#define AMD_FLASH_AUTOSEL 0x90
+#define AMD_FLASH_DEVCODE8 0x2
+#define AMD_FLASH_DEVCODE16 0x1
+#define AMD_FLASH_DEVCODE16B 0x2
+#define AMD_FLASH_MANID 0x0
+#define AMD_FLASH_PROGRAM 0xA0
+#define AMD_FLASH_UNLOCK_BYPASS 0x20
+#define AMD_FLASH_ERASE_3 0x80
+#define AMD_FLASH_ERASE_4 0xAA
+#define AMD_FLASH_ERASE_5 0x55
+#define AMD_FLASH_ERASE_ALL_6 0x10
+#define AMD_FLASH_ERASE_SEC_6 0x30
+
+/*
+ * INTEL Flash commands and magic offsets
+ */
+
+#define INTEL_FLASH_READ_MODE 0xFF
+#define INTEL_FLASH_ERASE_BLOCK 0x20
+#define INTEL_FLASH_ERASE_CONFIRM 0xD0
+#define INTEL_FLASH_PROGRAM 0x40
+
+/* INTEL Flash commands for 16-bit mode */
+#define INTEL_FLASH_16BIT_READ_MODE 0xFF00
+#define INTEL_FLASH_16BIT_ERASE_BLOCK 0x2000
+#define INTEL_FLASH_16BIT_ERASE_CONFIRM 0xD000
+#define INTEL_FLASH_16BIT_PROGRAM 0x4000
+#define INTEL_FLASH_8BIT 0
+#define INTEL_FLASH_16BIT 1
+
+
+/*
+ * Common Flash Interface (CFI) commands and offsets
+ */
+
+#define FLASH_CFI_QUERY_ADDR 0x55
+#define FLASH_CFI_QUERY_MODE 0x98
+#define FLASH_CFI_QUERY_EXIT 0xFF
+
+#define FLASH_CFI_MANUFACTURER 0x00
+#define FLASH_CFI_DEVICE 0x01
+#define FLASH_CFI_SIGNATURE 0x10
+#define FLASH_CFI_QUERY_STRING 0x10
+#define FLASH_CFI_COMMAND_SET 0x13
+#define FLASH_CFI_DEVICE_SIZE 0x27
+#define FLASH_CFI_DEVICE_INTERFACE 0x28
+#define FLASH_CFI_REGION_COUNT 0x2C
+#define FLASH_CFI_REGION_TABLE 0x2D
+
+#define FLASH_CFI_CMDSET_INTEL_ECS 0x0001 /* Intel extended */
+#define FLASH_CFI_CMDSET_AMD_STD 0x0002 /* AMD Standard */
+#define FLASH_CFI_CMDSET_INTEL_STD 0x0003 /* Intel Standard */
+#define FLASH_CFI_CMDSET_AMD_ECS 0x0004 /* AMD Extended */
+
+#define FLASH_CFI_DEVIF_X8 0x0000 /* 8-bit asynchronous */
+#define FLASH_CFI_DEVIF_X16 0x0001 /* 16-bit asynchronous */
+#define FLASH_CFI_DEVIF_X8X16 0x0002 /* 8 or 16-bit with BYTE# pin */
+#define FLASH_CFI_DEVIF_X32 0x0003 /* 32-bit asynchronous */
+
+/*
+ * JEDEC offsets
+ */
+
+#define FLASH_JEDEC_OFFSET_MFR 0
+#define FLASH_JEDEC_OFFSET_DEV 1
+
+/* Vendor-specific flash identifiers */
+
+#define FLASH_MFR_HYUNDAI 0xAD
+#define FLASH_MFR_AMD 0x01
+
+/* *********************************************************************
+ * Macros for defining custom sector tables
+ ********************************************************************* */
+
+#define FLASH_SECTOR_RANGE(nblks,size) (((nblks)-1) << 16) + ((size)/256)
+#define FLASH_SECTOR_NBLKS(x) (((x) >> 16)+1)
+#define FLASH_SECTOR_SIZE(x) (((x) & 0xFFFF)*256)
+#define FLASH_MAXSECTORS 8
+
+/* *********************************************************************
+ * Flashop engine constants and structures
+ * The flashop engine interprets a little table of commands
+ * to manipulate flash parts - we do this so we can operate
+ * on the flash that we're currently running from.
+ ********************************************************************* */
+
+/*
+ * Structure of the "instruction" table is six words,
+ * size dependant on the machine word size (32 or 64 bits).
+ *
+ * opcode
+ * flash base
+ * destination
+ * source
+ * length
+ * result
+ */
+
+#define FEINST_OP _TBLIDX(0)
+#define FEINST_BASE _TBLIDX(1)
+#define FEINST_DEST _TBLIDX(2)
+#define FEINST_SRC _TBLIDX(3)
+#define FEINST_CNT _TBLIDX(4)
+#define FEINST_RESULT _TBLIDX(5)
+#define FEINST_SIZE _TBLIDX(6) /* size of an instruction */
+
+#ifndef __ASSEMBLER__
+typedef struct flashinstr_s { /* must match offsets above */
+ long fi_op;
+ long fi_base;
+ long fi_dest;
+ long fi_src;
+ long fi_cnt;
+ long fi_result;
+} flashinstr_t;
+#endif
+
+/*
+ * Flash opcodes
+ */
+
+#define FEOP_RETURN 0 /* return to CFE */
+#define FEOP_REBOOT 1 /* Reboot system */
+#define FEOP_READ8 2 /* read, 8 bits at a time */
+#define FEOP_READ16 3 /* read, 16 bits at a time */
+#define FEOP_CFIQUERY8 4 /* CFI Query 8-bit */
+#define FEOP_CFIQUERY16 5 /* CFI Query 16-bit */
+#define FEOP_CFIQUERY16B 6 /* CFI Query 16-bit */
+#define FEOP_MEMCPY 7 /* generic memcpy */
+#define FEOP_AMD_ERASE8 8 /* AMD-style 8-bit erase-sector */
+#define FEOP_AMD_ERASE16 9 /* AMD-style 16-bit erase-sector */
+#define FEOP_AMD_ERASE16B 10 /* AMD-style 16-bit erase-sector */
+#define FEOP_AMD_PGM8 11 /* AMD-style 8-bit program */
+#define FEOP_AMD_PGM16 12 /* AMD-style 16-bit program */
+#define FEOP_AMD_PGM16B 13 /* AMD-style 16-bit program */
+#define FEOP_AMD_DEVCODE8 14 /* AMD-style 8-bit Boot Block Info */
+#define FEOP_AMD_DEVCODE16 15 /* AMD-style 8-bit Boot Block Info */
+#define FEOP_AMD_DEVCODE16B 16 /* AMD-style 8-bit Boot Block Info */
+#define FEOP_AMD_MANID8 17 /* AMD-style 8-bit Boot Block Info */
+#define FEOP_AMD_MANID16 18 /* AMD-style 8-bit Boot Block Info */
+#define FEOP_AMD_MANID16B 19 /* AMD-style 8-bit Boot Block Info */
+#define FEOP_INTEL_ERASE8 20 /* Intel-style 8-bit erase-sector */
+#define FEOP_INTEL_ERASE16 21 /* Intel-style 16-bit erase-sector */
+#define FEOP_INTEL_PGM8 22 /* Intel-style 8-bit program */
+#define FEOP_INTEL_PGM16 23 /* Intel-style 16-bit program */
+
+/*
+ * Flashop result values.
+ */
+
+#define FERES_OK 0
+#define FERES_ERROR -1
+
+
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+/*
+ * Flags. If you instantiate the driver with probe_a = physical
+ * address and probe_b = size, you should also OR in the
+ * bus and device width below.
+ */
+
+#define FLASH_FLG_AUTOSIZE 0x00000002 /* resize to actual device size */
+#define FLASH_FLG_BUS8 0
+#define FLASH_FLG_BUS16 0x00000004 /* ROM is connected to 16-bit bus */
+#define FLASH_FLG_DEV8 0
+#define FLASH_FLG_DEV16 0x00000010 /* ROM has 16-bit data width */
+#define FLASH_FLG_MANUAL 0x00000008 /* Not CFI, manual sectoring */
+#define FLASH_FLG_MASK 0x000000FF /* mask of probe bits for flags */
+#define FLASH_SIZE_MASK 0xFFFFFF00 /* mask of probe bits for size */
+/* you don't have to shift the size, we assume it's in multiples of 256bytes */
+
+#ifndef __ASSEMBLER__
+
+/*
+ * Partition structure - use this to define a flash "partition."
+ * The partitions are assigned in order from the beginning of the flash.
+ * The special size '0' means 'fill to end of flash', and you can
+ * have more partitions after that which are aligned with the top
+ * of the flash.
+ * Therefore if you have a 1MB flash and set up
+ * partitions for 256KB, 0, 128KB, the 128KB part will be aligned
+ * to the top of the flash and the middle block will be 768KB.
+ * Partitions can be on byte boundaries.
+ */
+
+typedef struct newflash_part_t {
+ int fp_size;
+ char *fp_name;
+} newflash_part_t;
+#define FLASH_MAX_PARTITIONS 8
+
+/*
+ * Probe structure - this is used when we want to describe to the flash
+ * driver the layout of our flash, particularly when you want to
+ * manually describe the sectors.
+ */
+
+typedef struct newflash_probe_t {
+ long flash_phys; /* physical address of flash */
+ int flash_size; /* total flash size */
+ int flash_flags; /* flags (FLASH_FLG_xxx) */
+ int flash_type; /* FLASH_TYPE_xxx */
+ /* The following are used when manually sectoring */
+ int flash_cmdset; /* FLASH_CMDSET_xxx */
+ int flash_nsectors; /* number of ranges */
+ int flash_sectors[FLASH_MAXSECTORS];
+ /* This says how many contiguous flash chips are in this region */
+ int flash_nchips; /* "flash_size" is just for one chip */
+ /* The following are used for partitioned flashes */
+ int flash_nparts; /* zero means not partitioned */
+ newflash_part_t flash_parts[FLASH_MAX_PARTITIONS];
+ /* The following are used for whacky, weird flashes */
+ int (*flash_ioctl_hook)(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+ /* You can replace the flash engine with your own */
+ int (*flash_engine_hook)(flashinstr_t *prog);
+} newflash_probe_t;
+
+
+/* *********************************************************************
+ * PRIVATE STRUCTURES
+ *
+ * These structures are actually the "property" of the
+ * flash driver. The only reason a board package might
+ * want to dig around in here is if it implements a hook
+ * or overrides functions to support special, weird flash parts.
+ ********************************************************************* */
+
+typedef struct flashdev_s flashdev_t;
+
+typedef struct flashpart_s {
+ flashdev_t *fp_dev;
+ int fp_offset;
+ int fp_size;
+} flashpart_t;
+
+#define FLASH_MAX_CFIDATA 256 /* total size of CFI Data */
+#define FLASH_MAX_INST 8 /* instructions we use during probing */
+
+struct flashdev_s {
+ newflash_probe_t fd_probe; /* probe information */
+
+ uint8_t fd_erasefunc; /* Erase routine to use */
+ uint8_t fd_pgmfunc; /* program routine to use */
+ uint8_t fd_readfunc; /* Read routine to use */
+ flashpart_t fd_parts[FLASH_MAX_PARTITIONS];
+
+ uint8_t *fd_sectorbuffer; /* sector copy buffer */
+ int fd_ttlsect; /* total sectors on one device */
+ int fd_ttlsize; /* total size of all devices (flash size * nchips) */
+
+ int fd_iptr; /* flashop engine instructions */
+ flashinstr_t *fd_inst;
+};
+
+
+
+#endif
+
+
+
diff --git a/cfe/cfe/include/elf.h b/cfe/cfe/include/elf.h
new file mode 100644
index 0000000..944aab4
--- /dev/null
+++ b/cfe/cfe/include/elf.h
@@ -0,0 +1,194 @@
+/*
+ * ELF data structures and values
+ */
+
+typedef unsigned short Elf32_Half;
+typedef unsigned int Elf32_Word;
+typedef signed int Elf32_Sword;
+typedef unsigned int Elf32_Off;
+typedef unsigned int Elf32_Addr;
+typedef unsigned char Elf_Char;
+
+/*
+ * File Header
+ */
+
+#define EI_NIDENT 16
+
+typedef struct {
+ Elf_Char e_ident[EI_NIDENT];
+ Elf32_Half e_type;
+ Elf32_Half e_machine;
+ Elf32_Word e_version;
+ Elf32_Addr e_entry;
+ Elf32_Off e_phoff;
+ Elf32_Off e_shoff;
+ Elf32_Word e_flags;
+ Elf32_Half e_ehsize;
+ Elf32_Half e_phentsize;
+ Elf32_Half e_phnum;
+ Elf32_Half e_shentsize;
+ Elf32_Half e_shnum;
+ Elf32_Half e_shstrndx;
+} Elf32_Ehdr;
+
+/* e_indent */
+#define EI_MAG0 0 /* File identification byte 0 index */
+#define EI_MAG1 1 /* File identification byte 1 index */
+#define EI_MAG2 2 /* File identification byte 2 index */
+#define EI_MAG3 3 /* File identification byte 3 index */
+#define EI_CLASS 4 /* File class */
+#define ELFCLASSNONE 0 /* Invalid class */
+#define ELFCLASS32 1 /* 32-bit objects */
+#define ELFCLASS64 2 /* 64-bit objects */
+#define EI_DATA 5 /* Data encoding */
+#define ELFDATANONE 0 /* Invalid data encoding */
+#define ELFDATA2LSB 1 /* 2's complement, little endian */
+#define ELFDATA2MSB 2 /* 2's complement, big endian */
+#define EI_VERSION 6 /* File version */
+#define EI_PAD 7 /* Start of padding bytes */
+
+#define ELFMAG0 0x7F /* Magic number byte 0 */
+#define ELFMAG1 'E' /* Magic number byte 1 */
+#define ELFMAG2 'L' /* Magic number byte 2 */
+#define ELFMAG3 'F' /* Magic number byte 3 */
+
+/* e_type */
+#define ET_NONE 0 /* No file type */
+#define ET_REL 1 /* Relocatable file */
+#define ET_EXEC 2 /* Executable file */
+#define ET_DYN 3 /* Shared object file */
+#define ET_CORE 4 /* Core file */
+#define ET_LOPROC 0xFF00 /* Processor-specific */
+#define ET_HIPROC 0xFFFF /* Processor-specific */
+
+/* e_machine */
+#define EM_NONE 0 /* No machine */
+#define EM_M32 1 /* AT&T WE 32100 */
+#define EM_SPARC 2 /* SUN SPARC */
+#define EM_386 3 /* Intel 80386 */
+#define EM_68K 4 /* Motorola m68k family */
+#define EM_88K 5 /* Motorola m88k family */
+#define EM_860 7 /* Intel 80860 */
+#define EM_MIPS 8 /* MIPS R3000 */
+
+/* e_version */
+#define EV_NONE 0 /* Invalid ELF version */
+#define EV_CURRENT 1 /* Current version */
+
+
+/*
+ * Program Header
+ */
+typedef struct {
+ Elf32_Word p_type; /* Identifies program segment type */
+ Elf32_Off p_offset; /* Segment file offset */
+ Elf32_Addr p_vaddr; /* Segment virtual address */
+ Elf32_Addr p_paddr; /* Segment physical address */
+ Elf32_Word p_filesz; /* Segment size in file */
+ Elf32_Word p_memsz; /* Segment size in memory */
+ Elf32_Word p_flags; /* Segment flags */
+ Elf32_Word p_align; /* Segment alignment, file & memory */
+} Elf32_Phdr;
+
+
+/* p_type */
+#define PT_NULL 0 /* Program header table entry unused */
+#define PT_LOAD 1 /* Loadable program segment */
+#define PT_DYNAMIC 2 /* Dynamic linking information */
+#define PT_INTERP 3 /* Program interpreter */
+#define PT_NOTE 4 /* Auxiliary information */
+#define PT_SHLIB 5 /* Reserved, unspecified semantics */
+#define PT_PHDR 6 /* Entry for header table itself */
+#define PT_LOPROC 0x70000000 /* Processor-specific */
+#define PT_HIPROC 0x7FFFFFFF /* Processor-specific */
+
+/* p_flags */
+#define PF_X (1 << 0) /* Segment is executable */
+#define PF_W (1 << 1) /* Segment is writable */
+#define PF_R (1 << 2) /* Segment is readable */
+#define PF_MASKPROC 0xF0000000 /* Processor-specific reserved bits */
+
+
+/*
+ * Section Header
+ */
+typedef struct {
+ Elf32_Word sh_name;
+ Elf32_Word sh_type;
+ Elf32_Word sh_flags;
+ Elf32_Addr sh_addr;
+ Elf32_Off sh_offset;
+ Elf32_Word sh_size;
+ Elf32_Word sh_link;
+ Elf32_Word sh_info;
+ Elf32_Word sh_addralign;
+ Elf32_Word sh_entsize;
+} Elf32_Shdr;
+
+/* sh_type */
+#define SHT_NULL 0 /* Section header table entry unused */
+#define SHT_PROGBITS 1 /* Program specific (private) data */
+#define SHT_SYMTAB 2 /* Link editing symbol table */
+#define SHT_STRTAB 3 /* A string table */
+#define SHT_RELA 4 /* Relocation entries with addends */
+#define SHT_HASH 5 /* A symbol hash table */
+#define SHT_DYNAMIC 6 /* Information for dynamic linking */
+#define SHT_NOTE 7 /* Information that marks file */
+#define SHT_NOBITS 8 /* Section occupies no space in file */
+#define SHT_REL 9 /* Relocation entries, no addends */
+#define SHT_SHLIB 10 /* Reserved, unspecified semantics */
+#define SHT_DYNSYM 11 /* Dynamic linking symbol table */
+#define SHT_LOPROC 0x70000000 /* Processor-specific semantics, lo */
+#define SHT_HIPROC 0x7FFFFFFF /* Processor-specific semantics, hi */
+#define SHT_LOUSER 0x80000000 /* Application-specific semantics */
+#define SHT_HIUSER 0x8FFFFFFF /* Application-specific semantics */
+
+/* sh_flags */
+#define SHF_WRITE (1 << 0) /* Writable data during execution */
+#define SHF_ALLOC (1 << 1) /* Occupies memory during execution */
+#define SHF_EXECINSTR (1 << 2) /* Executable machine instructions */
+#define SHF_MASKPROC 0xF0000000 /* Processor-specific semantics */
+
+
+/*
+ * Symbol Table
+ */
+typedef struct {
+ Elf32_Word st_name;
+ Elf32_Addr st_value;
+ Elf32_Word st_size;
+ Elf_Char st_info;
+ Elf_Char st_other;
+ Elf32_Half st_shndx;
+} Elf32_Sym;
+
+
+#define ELF_ST_BIND(val) (((unsigned int)(val)) >> 4)
+#define ELF_ST_TYPE(val) ((val) & 0xF)
+#define ELF_ST_INFO(bind,type) (((bind) << 4) | ((type) & 0xF))
+
+/* symbol binding */
+#define STB_LOCAL 0 /* Symbol not visible outside obj */
+#define STB_GLOBAL 1 /* Symbol visible outside obj */
+#define STB_WEAK 2 /* Like globals, lower precedence */
+#define STB_LOPROC 13 /* Application-specific semantics */
+#define STB_HIPROC 15 /* Application-specific semantics */
+
+/* symbol type */
+#define STT_NOTYPE 0 /* Symbol type is unspecified */
+#define STT_OBJECT 1 /* Symbol is a data object */
+#define STT_FUNC 2 /* Symbol is a code object */
+#define STT_SECTION 3 /* Symbol associated with a section */
+#define STT_FILE 4 /* Symbol gives a file name */
+#define STT_LOPROC 13 /* Application-specific semantics */
+#define STT_HIPROC 15 /* Application-specific semantics */
+
+/* special values st_shndx */
+#define SHN_UNDEF 0 /* Undefined section reference */
+#define SHN_LORESERV 0xFF00 /* Begin range of reserved indices */
+#define SHN_LOPROC 0xFF00 /* Begin range of appl-specific */
+#define SHN_HIPROC 0xFF1F /* End range of appl-specific */
+#define SHN_ABS 0xFFF1 /* Associated symbol is absolute */
+#define SHN_COMMON 0xFFF2 /* Associated symbol is in common */
+#define SHN_HIRESERVE 0xFFFF /* End range of reserved indices */
diff --git a/cfe/cfe/include/env_subr.h b/cfe/cfe/include/env_subr.h
new file mode 100644
index 0000000..f5dfb9f
--- /dev/null
+++ b/cfe/cfe/include/env_subr.h
@@ -0,0 +1,117 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Environment helper routines File: env_subr.h
+ *
+ * Definitions and prototypes for environment variable subroutines
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+
+/*
+ * TLV types. These codes are used in the "type-length-value"
+ * encoding of the items stored in the NVRAM device (flash or EEPROM)
+ *
+ * The layout of the flash/nvram is as follows:
+ *
+ * <type> <length> <data ...> <type> <length> <data ...> <type_end>
+ *
+ * The type code of "ENV_TLV_TYPE_END" marks the end of the list.
+ * The "length" field marks the length of the data section, not
+ * including the type and length fields.
+ *
+ * Environment variables are stored as follows:
+ *
+ * <type_env> <length> <flags> <name> = <value>
+ *
+ * If bit 0 (low bit) is set, the length is an 8-bit value.
+ * If bit 0 (low bit) is clear, the length is a 16-bit value
+ *
+ * Bit 7 set indicates "user" TLVs. In this case, bit 0 still
+ * indicates the size of the length field.
+ *
+ * Flags are from the constants below:
+ *
+ */
+
+#define ENV_LENGTH_16BITS 0x00 /* for low bit */
+#define ENV_LENGTH_8BITS 0x01
+
+#define ENV_TYPE_USER 0x80
+
+#define ENV_CODE_SYS(n,l) (((n)<<1)|(l))
+#define ENV_CODE_USER(n,l) ((((n)<<1)|(l)) | ENV_TYPE_USER)
+
+/*
+ * The actual TLV types we support
+ */
+
+#define ENV_TLV_TYPE_END 0x00
+#define ENV_TLV_TYPE_ENV ENV_CODE_SYS(0,ENV_LENGTH_8BITS)
+
+/*
+ * Environment variable flags
+ */
+
+#define ENV_FLG_NORMAL 0x00 /* normal read/write */
+#define ENV_FLG_BUILTIN 0x01 /* builtin - not stored in flash */
+#define ENV_FLG_READONLY 0x02 /* read-only - cannot be changed */
+
+#define ENV_FLG_MASK 0xFF /* mask of attributes we keep */
+#define ENV_FLG_ADMIN 0x100 /* lets us internally override permissions */
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+int env_delenv(const char *name);
+char *env_getenv(const char *name);
+int env_setenv(const char *name,char *value,int flags);
+int env_load(void);
+int env_save(void);
+int env_enum(int idx,char *name,int *namelen,char *val,int *vallen);
+int env_envtype(const char *name);
+
diff --git a/cfe/cfe/include/foxconnCfg.h b/cfe/cfe/include/foxconnCfg.h
new file mode 100755
index 0000000..3c43675
--- /dev/null
+++ b/cfe/cfe/include/foxconnCfg.h
@@ -0,0 +1,9 @@
+#ifndef _FOXCONNCFG_H
+#define _FOXCONNCFG_H
+
+#define FOXCONN_BOARD_ID "U12L161T00_NETGEAR"
+#define GPIO_POWER_RED_LED 18
+#define GPIO_POWER_RED_LED_ON 1
+#define GPIO_POWER_RED_LED_OFF 0
+
+#endif \ No newline at end of file
diff --git a/cfe/cfe/include/lib_arena.h b/cfe/cfe/include/lib_arena.h
new file mode 100644
index 0000000..2ae49d6
--- /dev/null
+++ b/cfe/cfe/include/lib_arena.h
@@ -0,0 +1,76 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Arena definitions File: lib_arena.h
+ *
+ * Definitions for the arena manager, which is used to keep
+ * track of ranges of physical memory.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+typedef struct arena_node_s {
+ queue_t an_next;
+ uint64_t an_address;
+ uint64_t an_length;
+ int an_type;
+ char *an_descr;
+} arena_node_t;
+
+
+typedef struct arena_s {
+ queue_t arena_list;
+ uint64_t arena_base;
+ uint64_t arena_size;
+} arena_t;
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+int arena_markrange(arena_t *arena,uint64_t address,uint64_t length,
+ int type,char *descr);
+void arena_init(arena_t *arena,uint64_t physmembase,uint64_t physmemsize);
+
diff --git a/cfe/cfe/include/lib_malloc.h b/cfe/cfe/include/lib_malloc.h
new file mode 100644
index 0000000..da1e27b
--- /dev/null
+++ b/cfe/cfe/include/lib_malloc.h
@@ -0,0 +1,78 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Local memory manager File: mempool.h
+ *
+ * This routine is used to manage memory allocated within the
+ * firmware. You give it a chunk of memory to manage, and then
+ * these routines manage suballocations from there.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#ifndef _LIB_MALLOC_H
+#define _LIB_MALLOC_H
+
+typedef struct memstats_s {
+ int mem_totalbytes;
+ int mem_allocbytes;
+ int mem_freebytes;
+ int mem_allocnodes;
+ int mem_freenodes;
+ int mem_largest;
+} memstats_t;
+
+typedef struct mempool_s mempool_t;
+void kmeminit(mempool_t *pool,unsigned char *buffer,int length);
+void kfree(mempool_t *pool,void *ptr);
+void *kmalloc(mempool_t *pool,unsigned int size,unsigned int align);
+int kmemchk(mempool_t *pool,int verbose);
+extern mempool_t kmempool;
+void *kmempoolbase(mempool_t *pool);
+int kmempoolsize(mempool_t *pool);
+int kmemstats(mempool_t *pool,memstats_t *stats);
+
+#define KMEMINIT(buffer,length) kmeminit(&kmempool,(buffer),(length))
+#define KMEMPOOLBASE() kmempoolbase(&kmempool)
+#define KMEMPOOLSIZE() kmempoolsize(&kmempool)
+#define KMALLOC(size,align) kmalloc(&kmempool,(size),(align))
+#define KFREE(ptr) kfree(&kmempool,(ptr))
+#define KMEMSTATS(s) kmemstats(&kmempool,(s))
+
+#endif
diff --git a/cfe/cfe/include/lib_printf.h b/cfe/cfe/include/lib_printf.h
new file mode 100755
index 0000000..e4d2860
--- /dev/null
+++ b/cfe/cfe/include/lib_printf.h
@@ -0,0 +1,69 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * simple printf File: lib_printf.h
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ * This module contains a very, very, very simple printf
+ * suitable for use in the boot ROM.
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include <stdarg.h>
+
+int xvsprintf(char *outbuf,const char *templat,va_list marker);
+int xsprintf(char *buf,const char *templat,...);
+#if CFG_RAMAPP
+int xprintf(const char *templat,...);
+#else
+#define xprintf(...)
+#endif
+
+extern int (*xprinthook)(const char *);
+int xvprintf(const char *template,va_list marker);
+
+/*
+ * compatibility macros
+ */
+
+
+#define printf xprintf
+#define sprintf xsprintf
+#define vsprintf xvsprintf
+#define vprintf xvprintf
diff --git a/cfe/cfe/include/lib_queue.h b/cfe/cfe/include/lib_queue.h
new file mode 100644
index 0000000..530c70f
--- /dev/null
+++ b/cfe/cfe/include/lib_queue.h
@@ -0,0 +1,85 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Queue management prototypes File: lib_queue.h
+ *
+ * Constants, structures, and function prototypes for the queue
+ * manager.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#ifndef _LIB_QUEUE_H
+#define _LIB_QUEUE_H
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#define q_init(q) (q)->q_prev = (q), (q)->q_next = (q)
+#define q_isempty(q) ((q)->q_next == (q))
+#define q_getfirst(q) ((q)->q_next)
+#define q_getlast(q) ((q)->q_prev)
+
+/* *********************************************************************
+ * Types
+ ********************************************************************* */
+
+
+typedef struct queue_s {
+ struct queue_s *q_next;
+ struct queue_s *q_prev;
+} queue_t;
+
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+void q_enqueue(queue_t *,queue_t *);
+void q_dequeue(queue_t *);
+queue_t *q_deqnext(queue_t *);
+int q_map(queue_t *qb,int (*func)(queue_t *,unsigned int,unsigned int),
+ unsigned int a,unsigned int b);
+int q_count(queue_t *);
+int q_find(queue_t *,queue_t *);
+
+
+#endif
diff --git a/cfe/cfe/include/lib_string.h b/cfe/cfe/include/lib_string.h
new file mode 100644
index 0000000..4d0f3d8
--- /dev/null
+++ b/cfe/cfe/include/lib_string.h
@@ -0,0 +1,117 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * string prototypes File: lib_string.h
+ *
+ * Function prototypes for the string routines
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+char *lib_strcpy(char *dest,const char *src);
+char *lib_strncpy(char *dest,const char *src,size_t cnt);
+size_t lib_xstrncpy(char *dest,const char *src,size_t cnt);
+size_t lib_strlen(const char *str);
+
+int lib_strcmp(const char *dest,const char *src);
+
+/* Foxconn add start by Cliff Wang, 03/23/2010 */
+int lib_strncmp(const char *dest, const char *src, size_t cnt );
+/* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+int lib_strcmpi(const char *dest,const char *src);
+char *lib_strchr(const char *dest,int c);
+char *lib_strrchr(const char *dest,int c);
+int lib_memcmp(const void *dest,const void *src,size_t cnt);
+void *lib_memcpy(void *dest,const void *src,size_t cnt);
+void *lib_memset(void *dest,int c,size_t cnt);
+char *lib_strdup(char *str);
+void lib_trimleading(char *str);
+void lib_chop_filename(char *str,char **host,char **file);
+void lib_strupr(char *s);
+char lib_toupper(char c);
+char *lib_strcat(char *dest,const char *src);
+char *lib_gettoken(char **str);
+char *lib_strnchr(const char *dest,int c,size_t cnt);
+int lib_parseipaddr(const char *ipaddr,uint8_t *dest);
+int lib_atoi(const char *dest);
+int lib_lookup(const cons_t *list,char *str);
+int lib_setoptions(const cons_t *list,char *str,unsigned int *flags);
+int lib_xtoi(const char *dest);
+uint64_t lib_xtoq(const char *dest);
+
+
+
+#ifndef _LIB_NO_MACROS_
+#define strcpy(d,s) lib_strcpy(d,s)
+#define strncpy(d,s,c) lib_strncpy(d,s,c)
+#define xstrncpy(d,s,c) lib_xstrncpy(d,s,c)
+#define strlen(s) lib_strlen(s)
+#define strchr(s,c) lib_strchr(s,c)
+#define strrchr(s,c) lib_strrchr(s,c)
+#define strdup(s) lib_strdup(s)
+#define strcmp(d,s) lib_strcmp(d,s)
+
+/* Foxconn add start by Cliff Wang, 03/23/2010 */
+#define strncmp(d,s,c) lib_strncmp(d,s,c)
+/* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+#define strcmpi(d,s) lib_strcmpi(d,s)
+#define memcmp(d,s,c) lib_memcmp(d,s,c)
+#define memset(d,s,c) lib_memset(d,s,c)
+#define memcpy(d,s,c) lib_memcpy(d,s,c)
+#define bcopy(s,d,c) lib_memcpy(d,s,c)
+#define bzero(d,c) lib_memset(d,0,c)
+#define strupr(s) lib_strupr(s)
+#define toupper(c) lib_toupper(c)
+#define strcat(d,s) lib_strcat(d,s)
+#define gettoken(s) lib_gettoken(s)
+#define strnchr(d,ch,cnt) lib_strnchr(d,ch,cnt)
+#define atoi(d) lib_atoi(d)
+#define xtoi(d) lib_xtoi(d)
+#define xtoq(d) lib_xtoq(d)
+#define parseipaddr(i,d) lib_parseipaddr(i,d)
+#define lookup(x,y) lib_lookup(x,y)
+#define setoptions(x,y,z) lib_setoptions(x,y,z)
+#endif
+
+void
+qsort(void *bot, size_t nmemb, size_t size, int (*compar)(const void *,const void *));
+
diff --git a/cfe/cfe/include/lib_types.h b/cfe/cfe/include/lib_types.h
new file mode 100644
index 0000000..7453a0d
--- /dev/null
+++ b/cfe/cfe/include/lib_types.h
@@ -0,0 +1,120 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Basic types File: lib_types.h
+ *
+ * This module defines the basic types used in CFE. Simple
+ * types, such as uint64_t, are defined here.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#ifdef __mips
+#if ((defined(__MIPSEB)+defined(__MIPSEL)) != 1)
+#error "Either __MIPSEB or __MIPSEL must be defined!"
+#endif
+#endif
+
+
+#ifndef _LIB_TYPES_H
+#define _LIB_TYPES_H
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+/* *********************************************************************
+ * Basic types
+ ********************************************************************* */
+
+typedef int size_t;
+
+typedef char int8_t;
+typedef unsigned char uint8_t;
+
+typedef short int16_t;
+typedef unsigned short uint16_t;
+
+#ifdef __long64
+typedef int int32_t;
+typedef unsigned int uint32_t;
+#else
+typedef long int32_t;
+typedef unsigned long uint32_t;
+#endif
+
+typedef long long int64_t;
+typedef unsigned long long uint64_t;
+
+#define unsigned signed /* Kludge to get unsigned size-shaped type. */
+typedef __SIZE_TYPE__ intptr_t;
+#undef unsigned
+typedef __SIZE_TYPE__ uintptr_t;
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#ifndef offsetof
+#define offsetof(type,memb) ((size_t)&((type *)0)->memb)
+#endif
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+typedef struct cons_s {
+ char *str;
+ int num;
+} cons_t;
+
+#endif
diff --git a/cfe/cfe/include/socregs.h b/cfe/cfe/include/socregs.h
new file mode 100644
index 0000000..835f8aa
--- /dev/null
+++ b/cfe/cfe/include/socregs.h
@@ -0,0 +1,63 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * SOC Register table defs File: socregs.h
+ *
+ * Data structures related to the "show soc" command and the
+ * "makereg" program.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+typedef struct socreg_s socreg_t;
+
+struct socreg_s {
+ uint32_t reg_addr;
+ uint32_t reg_agent;
+ const char *reg_inst;
+ const char *reg_subinst;
+ uint32_t reg_mask;
+ void (*reg_printfunc)(const socreg_t *reg,uint64_t value);
+ const char *reg_descr;
+};
+
+
+
+
diff --git a/cfe/cfe/include/tftpd.h b/cfe/cfe/include/tftpd.h
new file mode 100755
index 0000000..d7a15a9
--- /dev/null
+++ b/cfe/cfe/include/tftpd.h
@@ -0,0 +1,26 @@
+/***************************************************************************
+***
+*** Copyright 2005 Hon Hai Precision Ind. Co. Ltd.
+*** All Rights Reserved.
+*** No portions of this material shall be reproduced in any form without the
+*** written permission of Hon Hai Precision Ind. Co. Ltd.
+***
+*** All information contained in this document is Hon Hai Precision Ind.
+*** Co. Ltd. company private, proprietary, and trade secret property and
+*** are protected by international intellectual property laws and treaties.
+***
+****************************************************************************/
+
+#ifndef __TFTPD_H
+#define __TFTPD_H
+
+/* Foxconn add start by Cliff Wang, 03/23/2010 */
+#define TFTPD_STATE_OFF 0
+#define TFTPD_STATE_WAIT_IMAGE 1
+#define TFTPD_STATE_WRITE_IMAGE 2
+
+extern int get_tftpd_state(void);
+extern int set_tftpd_state(int state);
+/* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+#endif
diff --git a/cfe/cfe/include/ui_command.h b/cfe/cfe/include/ui_command.h
new file mode 100644
index 0000000..e85a3ae
--- /dev/null
+++ b/cfe/cfe/include/ui_command.h
@@ -0,0 +1,140 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Command interpreter defs File: ui_command.h
+ *
+ * This file contains structures related to the
+ * command interpreter.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#ifndef _LIB_QUEUE_H
+#include "lib_queue.h"
+#endif
+
+typedef struct ui_cmdsw_s {
+ int swidx;
+ char *swname;
+ char *swvalue;
+} ui_cmdsw_t;
+
+#define MAX_TOKENS 64
+#define MAX_SWITCHES 16
+#define MAX_TOKEN_SIZE 1000
+typedef struct ui_cmdline_s {
+ int argc;
+ char *argv[MAX_TOKENS];
+ int swc;
+ ui_cmdsw_t swv[MAX_SWITCHES];
+ int (*func)(struct ui_cmdline_s *,int argc,char *argv[]);
+ int argidx;
+ char *ref;
+ char *usage;
+ char *switches;
+} ui_cmdline_t;
+
+typedef struct ui_command_s {
+ queue_t list;
+ int term;
+ char *ptr;
+ queue_t head;
+} ui_command_t;
+
+typedef struct ui_token_s {
+ queue_t qb;
+ char token;
+} ui_token_t;
+
+#define CMD_TERM_EOL 0
+#define CMD_TERM_SEMI 1
+#define CMD_TERM_AND 2
+#define CMD_TERM_OR 3
+
+int cmd_sw_value(ui_cmdline_t *cmd,char *swname,char **swvalue);
+int cmd_sw_posn(ui_cmdline_t *cmd,char *swname);
+char *cmd_sw_name(ui_cmdline_t *cmd,int swidx);
+int cmd_sw_isset(ui_cmdline_t *cmd,char *swname);
+char *cmd_getarg(ui_cmdline_t *cmd,int argnum);
+void cmd_free(ui_cmdline_t *cmd);
+int cmd_sw_validate(ui_cmdline_t *cmd,char *validstr);
+void cmd_parse(ui_cmdline_t *cmd,char *line);
+int cmd_addcmd(char *command,
+ int (*func)(ui_cmdline_t *,int argc,char *argv[]),
+ void *ref,
+ char *help,
+ char *usage,
+ char *switches);
+int cmd_lookup(queue_t *head,ui_cmdline_t *cmd);
+void cmd_init(void);
+int cmd_getcommand(ui_cmdline_t *cmd);
+void cmd_showusage(ui_cmdline_t *cmd);
+
+
+
+#define CMD_ERR_INVALID -1
+#define CMD_ERR_AMBIGUOUS -2
+#define CMD_ERR_BLANK -3
+
+
+/* *********************************************************************
+ * Prototypes (public routines)
+ ********************************************************************* */
+
+const char *ui_errstring(int errcode);
+int ui_showerror(int errcode,char *tmplt,...);
+int ui_showusage(ui_cmdline_t *cmd);
+int ui_docommands(char *str);
+#define ui_docommand(str) ui_docommands(str)
+void ui_restart(int);
+int ui_init_cmddisp(void);
+
+
+/* *********************************************************************
+ * Prototypes (internal routines)
+ ********************************************************************* */
+
+ui_command_t *cmd_readcommand(queue_t *head);
+void cmd_build_list(queue_t *qb,char *buf);
+void cmd_walk_and_expand(queue_t *qb);
+ui_command_t *cmd_readcommand(queue_t *head);
+void cmd_free_tokens(queue_t *list);
+void cmd_build_cmdline(queue_t *head, ui_cmdline_t *cmd);
+
+
diff --git a/cfe/cfe/lib/lib_arena.c b/cfe/cfe/lib/lib_arena.c
new file mode 100644
index 0000000..41867dc
--- /dev/null
+++ b/cfe/cfe/lib/lib_arena.c
@@ -0,0 +1,389 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Arena Manager File lib_arena.c
+ *
+ * This module manages the _arena_, a sorted linked list of
+ * memory regions and attributes. We use this to keep track
+ * of physical memory regions and what is assigned to them.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "lib_types.h"
+#include "lib_queue.h"
+#include "lib_arena.h"
+#include "lib_malloc.h"
+
+/* *********************************************************************
+ * arena_print(arena,msg)
+ *
+ * Debug routine to print out an arena entry
+ *
+ * Input parameters:
+ * arena - arena descriptor
+ * msg - heading message
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+#ifdef _TESTPROG_
+static void arena_print(arena_t *arena,char *msg)
+{
+ arena_node_t *node;
+ queue_t *qb;
+
+ printf("%s\n",msg);
+
+ for (qb = (arena->arena_list.q_next); qb != &(arena->arena_list);
+ qb = qb->q_next) {
+ node = (arena_node_t *) qb;
+
+ printf("Start %5I64d End %5I64d Type %d\n",
+ node->an_address,
+ node->an_address+node->an_length,
+ node->an_type);
+
+ }
+
+}
+#endif
+
+/* *********************************************************************
+ * arena_init(arena,physmembase,physmemsize)
+ *
+ * Initialize an arena descriptor. The arena is typically
+ * created to describe the entire physical memory address space.
+ *
+ * Input parameters:
+ * arena - arena descriptor
+ * physmembase - base of region to manage (usually 0)
+ * physmemsize - size of region to manage (typically maxint)
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void arena_init(arena_t *arena,uint64_t physmembase,uint64_t physmemsize)
+{
+ arena_node_t *an = NULL;
+
+ an = (arena_node_t *) KMALLOC(sizeof(arena_node_t),sizeof(uint64_t));
+
+ /* XXX check return value */
+
+ arena->arena_base = physmembase;
+ arena->arena_size = physmemsize;
+
+ an->an_address = physmembase;
+ an->an_length = physmemsize;
+ an->an_type = 0;
+ an->an_descr = NULL;
+
+ q_init(&(arena->arena_list));
+ q_enqueue(&(arena->arena_list),(queue_t *) an);
+}
+
+
+/* *********************************************************************
+ * arena_find(arena,pt)
+ *
+ * Locate the arena node containing a particular point in the
+ * address space. This routine walks the list and finds the node
+ * whose address range contains the specified point.
+ *
+ * Input parameters:
+ * arena - arena descriptor
+ * pt - point to look for
+ *
+ * Return value:
+ * arena node pointer, or NULL if no node found
+ ********************************************************************* */
+
+static arena_node_t *arena_find(arena_t *arena,uint64_t pt)
+{
+ queue_t *qb;
+ arena_node_t *an;
+
+ for (qb = (arena->arena_list.q_next); qb != &(arena->arena_list);
+ qb = qb->q_next) {
+ an = (arena_node_t *) qb;
+
+ if ((pt >= an->an_address) &&
+ (pt < (an->an_address + an->an_length))) return an;
+
+ }
+
+ return NULL;
+}
+
+/* *********************************************************************
+ * arena_split(arena,splitpoint)
+ *
+ * Split the node containing the specified point. When we carve
+ * the arena up, we split the arena at the points on the edges
+ * of the new region, change their types, and then coalesce the
+ * arena. This handles the "split" part of that process.
+ *
+ * Input parameters:
+ * arena - arena descriptor
+ * splitpoint - address to split arena at
+ *
+ * Return value:
+ * 0 if ok
+ * -1 if could not split
+ ********************************************************************* */
+
+static int arena_split(arena_t *arena,uint64_t splitpoint)
+{
+ arena_node_t *node;
+ arena_node_t *newnode;
+
+ /*
+ * Don't need to split if it's the *last* address in the arena
+ */
+
+ if (splitpoint == (arena->arena_base+arena->arena_size)) return 0;
+
+ /*
+ * Find the block that contains the split point.
+ */
+
+ node = arena_find(arena,splitpoint);
+ if (node == NULL) return -1; /* should not happen */
+
+ /*
+ * If the address matches exactly, don't need to split
+ */
+ if (node->an_address == splitpoint) return 0;
+
+ /*
+ * Allocate a new node and adjust the length of the node we're
+ * splitting.
+ */
+
+ newnode = (arena_node_t *) KMALLOC(sizeof(arena_node_t),sizeof(uint64_t));
+
+ newnode->an_length = node->an_length - (splitpoint - node->an_address);
+ node->an_length = splitpoint - node->an_address;
+ newnode->an_address = splitpoint;
+ newnode->an_type = node->an_type;
+
+ /*
+ * Put the new node in the arena
+ */
+
+ q_enqueue(node->an_next.q_next,(queue_t *) newnode);
+
+ return 0;
+}
+
+/* *********************************************************************
+ * arena_coalesce(arena)
+ *
+ * Coalesce the arena, merging regions that have the same type
+ * together. After coalescing, no two adjacent nodes will
+ * have the same type.
+ *
+ * Input parameters:
+ * arena - arena descriptor
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void arena_coalesce(arena_t *arena)
+{
+ arena_node_t *node;
+ arena_node_t *nextnode;
+ int removed;
+ queue_t *qb;
+
+ do {
+ removed = 0;
+ for (qb = (arena->arena_list.q_next); qb != &(arena->arena_list);
+ qb = qb->q_next) {
+
+ node = (arena_node_t *) qb;
+ nextnode = (arena_node_t *) node->an_next.q_next;
+
+ if ((queue_t *) nextnode == &(arena->arena_list)) break;
+
+ if (node->an_type == nextnode->an_type) {
+ node->an_length += nextnode->an_length;
+ q_dequeue((queue_t *) nextnode);
+ KFREE(nextnode);
+ removed++;
+ }
+ }
+ } while (removed > 0);
+}
+
+
+/* *********************************************************************
+ * arena_markrange(arena,address,length,type,descr)
+ *
+ * Mark a region in the arena, changing the types of nodes and
+ * splitting nodes as necessary. This routine is called for
+ * each region we want to add. The order of marking regions is
+ * important, since new marks overwrite old ones. Therefore, you
+ * could mark a whole range as DRAM, and then mark sub-regions
+ * within that as used by firmware.
+ *
+ * Input parameters:
+ * arena - arena descriptor
+ * address,length - region to mark
+ * type - type code for region
+ * descr - text description of region (optional)
+ *
+ * Return value:
+ * 0 if ok
+ * -1 if error
+ ********************************************************************* */
+
+int arena_markrange(arena_t *arena,uint64_t address,uint64_t length,int type,char *descr)
+{
+ queue_t *qb;
+ arena_node_t *node;
+
+ /*
+ * Range check the region we want to mark
+ */
+
+ if ((address < arena->arena_base) ||
+ ((address+length) > (arena->arena_base + arena->arena_size))) {
+ return -1;
+ }
+
+ /*
+ * Force the arena to be split at the two points at the
+ * beginning and end of the range we want. If we have
+ * problems, coalesce the arena again and get out.
+ */
+
+ if (arena_split(arena,address) < 0) {
+ /* don't need to coalesce, we didn't split */
+ return -1;
+ }
+ if (arena_split(arena,(address+length)) < 0) {
+ /* recombine nodes split above */
+ arena_coalesce(arena);
+ return -1;
+ }
+
+ /*
+ * Assuming we've split the arena at the beginning and ending
+ * split points, we'll never mark any places outside the range
+ * specified in the "Address,length" args.
+ */
+
+ for (qb = (arena->arena_list.q_next); qb != &(arena->arena_list);
+ qb = qb->q_next) {
+ node = (arena_node_t *) qb;
+
+ if ((node->an_address >= address) &&
+ ((node->an_address + node->an_length) <= (address+length))) {
+ node->an_type = type;
+ node->an_descr = descr;
+ }
+ }
+
+ /*
+ * Now, coalesce adjacent pieces with the same type back together again
+ */
+
+ arena_coalesce(arena);
+
+ return 0;
+}
+
+
+
+/* *********************************************************************
+ * main(argc,argv)
+ *
+ * Test program.
+ *
+ * Input parameters:
+ * argc,argv - guess
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+#ifdef _TESTPROG_
+void main(int argc,char *argv[])
+{
+ arena_t arena;
+
+ arena_init(&arena,0,1024);
+#if 0
+ arena_print(&arena,"empty arena------------");
+
+ arena_split(&arena,5);
+ arena_print(&arena,"split at 5-------------");
+
+ arena_split(&arena,300);
+ arena_print(&arena,"split at 300-----------");
+
+ arena_split(&arena,100);
+ arena_print(&arena,"split at 100-----------");
+
+ arena_coalesce(&arena);
+ arena_print(&arena,"coalesced again--------");
+
+ arena_markrange(&arena,100,50,1);
+ arena_print(&arena,"addrange 100-150-------");
+ arena_markrange(&arena,10,50,1);
+ arena_print(&arena,"addrange 10-60---------");
+ arena_markrange(&arena,1000,24,3);
+ arena_print(&arena,"addrange 1000-1023-----");
+#endif
+
+ arena_markrange(&arena,100,10,1);
+ arena_markrange(&arena,120,10,2);
+ arena_markrange(&arena,140,10,3);
+ arena_print(&arena,"Before big markrange---------");
+
+ arena_markrange(&arena,50,200,4);
+ arena_print(&arena,"after big markrange---------");
+
+}
+#endif
diff --git a/cfe/cfe/lib/lib_malloc.c b/cfe/cfe/lib/lib_malloc.c
new file mode 100644
index 0000000..f7e33b2
--- /dev/null
+++ b/cfe/cfe/lib/lib_malloc.c
@@ -0,0 +1,620 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Local memory manager File: cfe_malloc.c
+ *
+ * This routine is used to manage memory allocated within the
+ * firmware. You give it a chunk of memory to manage, and then
+ * these routines manage suballocations from there.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#ifdef TESTPROG
+#include <stdio.h>
+#include <malloc.h>
+#include <stdlib.h>
+#endif
+
+#include "lib_types.h"
+#include "lib_printf.h"
+#include "lib_malloc.h"
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define MEMNODE_SEAL 0xFAAFA123 /* just some random constant */
+#define MINBLKSIZE 64
+
+/* *********************************************************************
+ * Types
+ ********************************************************************* */
+
+typedef enum { memnode_free = 0, memnode_alloc } memnode_status_t;
+
+typedef struct memnode_s {
+ unsigned int seal;
+ struct memnode_s *next; /* pointer to next node */
+ unsigned int length; /* length of the entire data section */
+ memnode_status_t status; /* alloc/free status */
+ unsigned char *data; /* points to actual user data */
+ void *memnodeptr; /* memnode back pointer (see comments) */
+} memnode_t;
+
+struct mempool_s {
+ memnode_t *root; /* pointer to root node */
+ unsigned char *base; /* base of memory region */
+ unsigned int length; /* size of memory region */
+};
+
+#define memnode_data(t,m) (t) (((memnode_t *) (m))+1)
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+mempool_t kmempool; /* default pool */
+
+/* *********************************************************************
+ * kmeminit(pool,buffer,length)
+ *
+ * Initialize the memory manager, given a pointer to an area
+ * of memory and a size. This routine simply initializes the
+ * root node to be a single block of empty space.
+ *
+ * Input parameters:
+ * pool - pool pointer
+ * buffer - beginning of buffer area, must be pointer-aligned
+ * length - length of buffer area
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+
+void kmeminit(mempool_t *pool,unsigned char *buffer,int length)
+{
+ pool->root = (memnode_t *) buffer;
+ pool->root->seal = MEMNODE_SEAL;
+ pool->root->length = length - sizeof(memnode_t);
+ pool->root->data = memnode_data(unsigned char *,pool->root);
+ pool->root->status = memnode_free;
+ pool->root->next = NULL;
+
+ pool->base = buffer;
+ pool->length = length;
+}
+
+
+/* *********************************************************************
+ * kmempoolbase(pool)
+ *
+ * Returns the base address of the specified memory pool
+ *
+ * Input parameters:
+ * pool - pool pointer
+ *
+ * Return value:
+ * pointer to beginning of pool's memory
+ ********************************************************************* */
+void *kmempoolbase(mempool_t *pool)
+{
+ return pool->base;
+}
+
+/* *********************************************************************
+ * kmempoolsize(pool)
+ *
+ * Returns the total size of the specified memory pool
+ *
+ * Input parameters:
+ * pool - pool pointer
+ *
+ * Return value:
+ * size of pool in bytes
+ ********************************************************************* */
+
+int kmempoolsize(mempool_t *pool)
+{
+ return pool->length;
+}
+
+/* *********************************************************************
+ * kmemcompact(pool)
+ *
+ * Compact the memory blocks, coalescing consectutive free blocks
+ * on the list.
+ *
+ * Input parameters:
+ * pool - pool descriptor
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void kmemcompact(mempool_t *pool)
+{
+ memnode_t *m;
+ int compacted;
+
+ do {
+ compacted = 0;
+
+ for (m = pool->root; m; m = m->next) {
+
+ /* Check seal to be sure that we're doing ok */
+
+ if (m->seal != MEMNODE_SEAL) {
+#ifdef TESTPROG
+ printf("Memory list corrupted!\n");
+#endif
+ return;
+ }
+
+ /*
+ * If we're not on the last block and both this
+ * block and the next one are free, combine them
+ */
+
+ if (m->next &&
+ (m->status == memnode_free) &&
+ (m->next->status == memnode_free)) {
+ m->length += sizeof(memnode_t) + m->next->length;
+ m->next->seal = 0;
+ m->next = m->next->next;
+ compacted++;
+ }
+
+ /* Keep going till we make a pass without doing anything. */
+ }
+ } while (compacted > 0);
+}
+
+
+/* *********************************************************************
+ * kfree(ptr)
+ *
+ * Return some memory to the pool.
+ *
+ * Input parameters:
+ * ptr - pointer to something allocated via kmalloc()
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void kfree(mempool_t *pool,void *ptr)
+{
+ memnode_t **backptr;
+ memnode_t *m;
+
+ if (((unsigned char *) ptr < pool->base) ||
+ ((unsigned char *) ptr >= (pool->base+pool->length))) {
+#ifdef TESTPROG
+ printf("Pointer %08X does not belong to pool %08X\n",ptr,pool);
+#endif
+ return;
+ }
+
+ backptr = (memnode_t **) (((unsigned char *) ptr) - sizeof(memnode_t *));
+ m = *backptr;
+
+ if (m->seal != MEMNODE_SEAL) {
+#ifdef TESTPROG
+ printf("Invalid node freed: %08X\n",m);
+#endif
+ return;
+ }
+
+ m->status = memnode_free;
+
+ kmemcompact(pool);
+}
+
+/* *********************************************************************
+ * lib_outofmemory()
+ *
+ * Called when we run out of memory.
+ * XXX replace with something real someday
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void lib_outofmemory(void);
+void lib_outofmemory(void)
+{
+ xprintf("PANIC: out of memory!\n");
+}
+
+/* *********************************************************************
+ * kmalloc(pool,size,align)
+ *
+ * Allocate some memory from the pool.
+ *
+ * Input parameters:
+ * pool - pool structure
+ * size - size of item to allocate
+ * align - alignment (must be zero or a power of 2)
+ *
+ * Return value:
+ * pointer to data, or NULL if no memory left
+ ********************************************************************* */
+
+void *kmalloc(mempool_t *pool,unsigned int size,unsigned int align)
+{
+ memnode_t *m;
+ memnode_t *newm;
+ memnode_t **backptr;
+ uintptr_t daddr = 0;
+ uintptr_t realsize = 0;
+ uintptr_t extra;
+ uintptr_t blkend;
+ uintptr_t ptralign;
+
+ /*
+ * Everything should be aligned by at least the
+ * size of an int64
+ */
+
+ ptralign = (uintptr_t) align;
+ if (ptralign < sizeof(void *)) ptralign = sizeof(uint64_t);
+
+ /*
+ * Everything should be at least a multiple of the
+ * size of a pointer.
+ */
+
+ if (size == 0) size = sizeof(void *);
+ if (size & (sizeof(void *)-1)) {
+ size += sizeof(void *);
+ size &= ~(sizeof(void *)-1);
+ }
+
+ /*
+ * Find a memnode at least big enough to hold the storage we
+ * want.
+ */
+
+ for (m = pool->root; m; m = m->next) {
+
+ if (m->status == memnode_alloc) continue;
+
+ /*
+ * If we wanted a particular alignment, we will
+ * need to adjust the size.
+ */
+
+ daddr = memnode_data(uintptr_t,m);
+ extra = 0;
+ if (daddr & (ptralign-1)) {
+ extra = size + (ptralign - (daddr & (ptralign-1)));
+ }
+ realsize = size + extra;
+
+ if (m->length < realsize) continue;
+ break;
+ }
+
+ /*
+ * If m is null, there's no memory left.
+ */
+
+ if (m == NULL) {
+ lib_outofmemory();
+ return NULL;
+ }
+
+ /*
+ * Otherwise, use this block. Calculate the address of the data
+ * to preserve the alignment.
+ */
+
+ if (daddr & (ptralign-1)) {
+ daddr += ptralign;
+ daddr &= ~(ptralign-1);
+ }
+
+ /* Mark this node as allocated. */
+
+ m->data = (unsigned char *) daddr;
+ m->status = memnode_alloc;
+
+ /*
+ * Okay, this is ugly. Store a pointer to the original
+ * memnode just before what we've allocated. It's guaranteed
+ * to be aligned at least well enough for this pointer.
+ * If for some reason the memnode was already exactly
+ * aligned, backing up will put us inside the memnode
+ * structure itself... that's why the memnodeptr field
+ * is there, as a placeholder for this eventuality.
+ */
+
+ backptr = (memnode_t **) (m->data - sizeof(memnode_t *));
+ *backptr = m;
+
+ /*
+ * See if we need to split it.
+ * Don't bother to split if the resulting size will be
+ * less than MINBLKSIZE bytes
+ */
+
+ if (m->length - realsize < MINBLKSIZE) {
+ return m->data;
+ }
+
+ /*
+ * Split this block. Align the address on a pointer-size
+ * boundary.
+ */
+
+ daddr += size;
+ if (daddr & (uintptr_t)(sizeof(void *)-1)) {
+ daddr += (uintptr_t)sizeof(void *);
+ daddr &= ~(uintptr_t)(sizeof(void *)-1);
+ }
+
+ blkend = memnode_data(uintptr_t,m) + (uintptr_t)(m->length);
+
+ newm = (memnode_t *) daddr;
+
+ newm->next = m->next;
+ m->length = (unsigned int) (daddr - memnode_data(uintptr_t,m));
+ m->next = newm;
+ m->status = memnode_alloc;
+ newm->seal = MEMNODE_SEAL;
+ newm->data = memnode_data(unsigned char *,newm);
+ newm->length = (unsigned int) (blkend - memnode_data(uintptr_t,newm));
+ newm->status = memnode_free;
+
+ return m->data;
+}
+
+
+int kmemstats(mempool_t *pool,memstats_t *stats)
+{
+ memnode_t *m;
+ memnode_t **backptr;
+ uintptr_t daddr;
+
+ stats->mem_totalbytes = pool->length;
+ stats->mem_allocbytes = 0;
+ stats->mem_freebytes = 0;
+ stats->mem_allocnodes = 0;
+ stats->mem_freenodes = 0;
+ stats->mem_largest = 0;
+
+ for (m = pool->root; m; m = m->next) {
+ if (m->status) {
+ stats->mem_allocnodes++;
+ stats->mem_allocbytes += m->length;
+ }
+ else {
+ stats->mem_freenodes++;
+ stats->mem_freebytes += m->length;
+ if (m->length > stats->mem_largest) {
+ stats->mem_largest = m->length;
+ }
+ }
+
+ daddr = memnode_data(uintptr_t,m);
+ if (m->seal != MEMNODE_SEAL) {
+ return -1;
+ }
+ if (m->next && ((daddr + m->length) != (uintptr_t) m->next)) {
+ return -1;
+ }
+ if (m->next && (m->next < m)) {
+ return -1;
+ }
+ if (m->data < (unsigned char *) m) {
+ return -1;
+ }
+ if (m->status == memnode_alloc) {
+ backptr = (memnode_t **) (m->data - sizeof(void *));
+ if (*backptr != m) {
+ return -1;
+ }
+ }
+ }
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * kmemchk()
+ *
+ * Check the consistency of the memory pool.
+ *
+ * Input parameters:
+ * pool - pool pointer
+ *
+ * Return value:
+ * 0 - pool is consistent
+ * -1 - pool is corrupt
+ ********************************************************************* */
+
+#ifdef TESTPROG
+int kmemchk(mempool_t *pool,int verbose)
+{
+ memnode_t *m;
+ memnode_t **backptr;
+ unsigned int daddr;
+
+ for (m = pool->root; m; m = m->next) {
+ if (verbose) {
+ printf("%08X: Next=%08X Len=%5u %s Data=%08X ",
+ m,m->next,m->length,
+ m->status ? "alloc" : "free ",
+ m->data);
+ }
+ daddr = memnode_data(uintptr_t,m);
+ if (m->seal != MEMNODE_SEAL) {
+ if (verbose) printf("BadSeal ");
+ else return -1;
+ }
+ if (m->next && (daddr + m->length != (unsigned int) m->next)) {
+ if (verbose) printf("BadLength ");
+ else return -1;
+ }
+ if (m->next && (m->next < m)) {
+ if (verbose) printf("BadOrder ");
+ else return -1;
+ }
+ if (m->data < (unsigned char *) m) {
+ if (verbose) printf("BadData ");
+ else return -1;
+ }
+ if (m->status == memnode_alloc) {
+ backptr = (memnode_t **) (m->data - sizeof(void *));
+ if (*backptr != m) {
+ if (verbose) printf("BadBackPtr ");
+ else return -1;
+ }
+ }
+ if (verbose) printf("\n");
+ }
+
+ return 0;
+}
+
+
+#define MEMSIZE 1024*1024
+
+unsigned char *ptrs[4096];
+unsigned int sizes[4096];
+
+/* *********************************************************************
+ * main(argc,argv)
+ *
+ * Test program for the memory allocator
+ *
+ * Input parameters:
+ * argc,argv
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+
+void main(int argc,char *argv[])
+{
+ unsigned char *mem;
+ int items = 0;
+ int idx;
+ int size;
+ int totalsize = 0;
+ int nfree,freecnt;
+ mempool_t *pool = &kmempool;
+
+ mem = malloc(MEMSIZE);
+ kmeminit(pool,mem,MEMSIZE);
+
+ items = 0;
+
+ for (;;) {
+
+ for (;;) {
+ if (items == 4096) break;
+ size = rand() % 1024;
+ ptrs[items] = kmalloc(pool,size,1<<(rand() & 7));
+ if (!ptrs[items]) break;
+ sizes[items] = size;
+ items++;
+ totalsize += size;
+ }
+
+ printf("%d items allocated, %d total bytes\n",items,totalsize);
+
+ if (kmemchk(pool,0) < 0) {
+ kmemchk(pool,1);
+ exit(1);
+ }
+
+ /* Scramble the pointers */
+ idx = items - 1;
+
+ while (idx) {
+ if (rand() & 2) {
+ mem = ptrs[0];
+ ptrs[0] = ptrs[idx];
+ ptrs[idx] = mem;
+
+ nfree = sizes[0];
+ sizes[0] = sizes[idx];
+ sizes[idx] = nfree;
+ }
+ idx--;
+ }
+
+ /* now free a random number of elements */
+
+ nfree = rand() % items;
+ freecnt = 0;
+
+ for (idx = nfree; idx < items; idx++) {
+ kfree(pool,ptrs[idx]);
+ totalsize -= sizes[idx];
+ freecnt++;
+ ptrs[idx] = NULL;
+ sizes[idx] = 0;
+ if (kmemchk(pool,0) < 0) {
+ kmemchk(pool,1);
+ exit(1);
+ }
+ }
+
+ items -= freecnt;
+
+ printf(".");
+
+ }
+
+ kmemchk(pool,1);
+
+ exit(0);
+}
+
+#endif /* TESTPROG */
diff --git a/cfe/cfe/lib/lib_misc.c b/cfe/cfe/lib/lib_misc.c
new file mode 100644
index 0000000..e5a2a02
--- /dev/null
+++ b/cfe/cfe/lib/lib_misc.c
@@ -0,0 +1,229 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Misc. library routines File: lib_misc.c
+ *
+ * Miscellaneous library routines.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_malloc.h"
+#define _LIB_NO_MACROS_
+#include "lib_string.h"
+
+
+/* *********************************************************************
+ * lib_parseipaddr(ipaddr,dest)
+ *
+ * Parse an IP address.
+ *
+ * Input parameters:
+ * ipaddr - string of IP address
+ * dest - pointer to 4 bytes to receive binary IP address
+ *
+ * Return value:
+ * 0 if ok
+ * -1 if ip address is invalid
+ ********************************************************************* */
+
+int lib_parseipaddr(const char *ipaddr,uint8_t *dest)
+{
+ int a,b,c,d;
+ char *x;
+
+ /* make sure it's all digits and dots. */
+ x = (char *) ipaddr;
+ while (*x) {
+ if ((*x == '.') || ((*x >= '0') && (*x <= '9'))) {
+ x++;
+ continue;
+ }
+ return -1;
+ }
+
+ x = (char *) ipaddr;
+ a = lib_atoi(ipaddr);
+ x = lib_strchr(x,'.');
+ if (!x) return -1;
+ b = lib_atoi(x+1);
+ x = lib_strchr(x+1,'.');
+ if (!x) return -1;
+ c = lib_atoi(x+1);
+ x = lib_strchr(x+1,'.');
+ if (!x) return -1;
+ d = lib_atoi(x+1);
+
+ if ((a < 0) || (a > 255)) return -1;
+ if ((b < 0) || (b > 255)) return -1;
+ if ((c < 0) || (c > 255)) return -1;
+ if ((d < 0) || (d > 255)) return -1;
+
+ dest[0] = (uint8_t) a;
+ dest[1] = (uint8_t) b;
+ dest[2] = (uint8_t) c;
+ dest[3] = (uint8_t) d;
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * lib_lookup(list,str)
+ *
+ * Look up an element on a {string,value} list.
+ *
+ * Input parameters:
+ * list - list to search
+ * str - string to find on the list
+ *
+ * Return value:
+ * 0 if string was not found
+ * else number associated with this string
+ ********************************************************************* */
+
+int lib_lookup(const cons_t *list,char *str)
+{
+ while (list->str) {
+ if (lib_strcmp(list->str,str) == 0) return list->num;
+ list++;
+ }
+
+ return 0;
+
+}
+
+/* *********************************************************************
+ * lib_findinlist(list,str)
+ *
+ * Like lib_lookup but returns cons structure instead of value
+ *
+ * Input parameters:
+ * list - list of associations
+ * str - what to find
+ *
+ * Return value:
+ * cons_t or null if not found
+ ********************************************************************* */
+
+static const cons_t *lib_findinlist(const cons_t *list,char *str)
+{
+ while (list->str) {
+ if (lib_strcmp(list->str,str) == 0) return list;
+ list++;
+ }
+ return NULL;
+}
+
+
+/* *********************************************************************
+ * lib_setoptions(list,str,flags)
+ *
+ * Set or reset one or more bits in a flags variable based
+ * on the list of valid bits and a string containing what
+ * to change. flags starts off as a default value.
+ *
+ * The input string is a comma-separated list of options,
+ * optionally prefixed by "no_" or "no" to invert the
+ * sense of the option. negative values in the table
+ * remove options, positive add options (you can't use
+ * bit 31 as an option for this reason).
+ *
+ * Input parameters:
+ * list - list of valid options
+ * str - options to parse
+ * flags - pointer to variable to be modified
+ *
+ * Return value:
+ * number of options we did not understand, 0=ok
+ ********************************************************************* */
+
+int lib_setoptions(const cons_t *list,char *str,unsigned int *flags)
+{
+ char *dupstr;
+ char *x;
+ char *ptr;
+ const cons_t *val;
+ int newbits;
+ int errors = 0;
+
+ if (!list || !str || !flags) return 0;
+
+ dupstr = lib_strdup(str);
+ if (!dupstr) return 0;
+
+ ptr = dupstr;
+
+ while (*ptr) {
+ if ((x = lib_strchr(ptr,','))) {
+ *x = '\0';
+ }
+
+ val = lib_findinlist(list,ptr);
+ newbits = 0;
+ if (!val) {
+ if (lib_memcmp(ptr,"no_",3) == 0) {
+ val = lib_findinlist(list,ptr+3);
+ }
+ else if (lib_memcmp(ptr,"no",2) == 0) {
+ val = lib_findinlist(list,ptr+2);
+ }
+ if (val) newbits = ~((unsigned int) (val->num));
+ else errors++;
+ }
+ else {
+ newbits = (val->num);
+ }
+
+ /* if new bits are negative, it's an AND mask
+ otherwise it's an OR mask */
+
+ if (newbits < 0) *flags &= (unsigned int) newbits;
+ else *flags |= (unsigned int) newbits;
+
+ if (x) ptr = x+1;
+ else break;
+ }
+
+ KFREE(dupstr);
+
+ return errors;
+}
diff --git a/cfe/cfe/lib/lib_printf.c b/cfe/cfe/lib/lib_printf.c
new file mode 100644
index 0000000..7dc3442
--- /dev/null
+++ b/cfe/cfe/lib/lib_printf.c
@@ -0,0 +1,442 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * simple printf File: lib_printf.c
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ * This module contains a very, very, very simple printf
+ * suitable for use in the boot ROM.
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include <stdarg.h>
+#include "lib_types.h"
+#include "lib_printf.h"
+
+/* *********************************************************************
+ * Externs *
+ ********************************************************************* */
+
+/* *********************************************************************
+ * Globals *
+ ********************************************************************* */
+
+static const char digits[17] = "0123456789ABCDEF";
+static const char ldigits[17] = "0123456789abcdef";
+
+int (*xprinthook)(const char *str) = NULL;
+
+/* *********************************************************************
+ * __atox(buf,num,radix,width)
+ *
+ * Convert a number to a string
+ *
+ * Input Parameters:
+ * buf - where to put characters
+ * num - number to convert
+ * radix - radix to convert number to (usually 10 or 16)
+ * width - width in characters
+ *
+ * Return Value:
+ * number of digits placed in output buffer
+ ********************************************************************* */
+static int __atox(char *buf,unsigned int num,unsigned int radix,int width,
+ const char *digits)
+{
+ char buffer[16];
+ char *op;
+ int retval;
+
+ op = &buffer[0];
+ retval = 0;
+
+ do {
+ *op++ = digits[num % radix];
+ retval++;
+ num /= radix;
+ } while (num != 0);
+
+ if (width && (width > retval)) {
+ width = width - retval;
+ while (width) {
+ *op++ = '0';
+ retval++;
+ width--;
+ }
+ }
+
+ while (op != buffer) {
+ op--;
+ *buf++ = *op;
+ }
+
+ return retval;
+}
+
+
+/* *********************************************************************
+ * __llatox(buf,num,radix,width)
+ *
+ * Convert a long number to a string
+ *
+ * Input Parameters:
+ * buf - where to put characters
+ * num - number to convert
+ * radix - radix to convert number to (usually 10 or 16)
+ * width - width in characters
+ *
+ * Return Value:
+ * number of digits placed in output buffer
+ ********************************************************************* */
+static int __llatox(char *buf,unsigned long long num,unsigned int radix,
+ int width,const char *digits)
+{
+ char buffer[16];
+ char *op;
+ int retval;
+
+ op = &buffer[0];
+ retval = 0;
+
+#ifdef _MIPSREGS32_
+ /*
+ * Hack: to avoid pulling in the helper library that isn't necessarily
+ * compatible with PIC code, force radix to 16, use shifts and masks
+ */
+ do {
+ *op++ = digits[num & 0x0F];
+ retval++;
+ num >>= 4;
+ } while (num != 0);
+#else
+ do {
+ *op++ = digits[num % radix];
+ retval++;
+ num /= radix;
+ } while (num != 0);
+#endif
+
+ if (width && (width > retval)) {
+ width = width - retval;
+ while (width) {
+ *op++ = '0';
+ retval++;
+ width--;
+ }
+ }
+
+ while (op != buffer) {
+ op--;
+ *buf++ = *op;
+ }
+
+ return retval;
+}
+
+/* *********************************************************************
+ * xvsprintf(outbuf,template,arglist)
+ *
+ * Format a string into the output buffer
+ *
+ * Input Parameters:
+ * outbuf - output buffer
+ * template - template string
+ * arglist - parameters
+ *
+ * Return Value:
+ * number of characters copied
+ ********************************************************************* */
+#define isdigit(x) (((x) >= '0') && ((x) <= '9'))
+int xvsprintf(char *outbuf,const char *templat,va_list marker)
+{
+ char *optr;
+ const char *iptr;
+ unsigned char *tmpptr;
+ unsigned int x;
+ unsigned long long lx;
+ int i;
+ long long ll;
+ int leadingzero;
+ int leadingnegsign;
+ int islong;
+ int width;
+ int width2 = 0;
+ int hashash = 0;
+
+ optr = outbuf;
+ iptr = templat;
+
+ while (*iptr) {
+ if (*iptr != '%') {*optr++ = *iptr++; continue;}
+
+ iptr++;
+
+ if (*iptr == '#') { hashash = 1; iptr++; }
+ if (*iptr == '-') {
+ leadingnegsign = 1;
+ iptr++;
+ }
+ else leadingnegsign = 0;
+
+ if (*iptr == '0') leadingzero = 1;
+ else leadingzero = 0;
+
+ width = 0;
+ while (*iptr && isdigit(*iptr)) {
+ width += (*iptr - '0');
+ iptr++;
+ if (isdigit(*iptr)) width *= 10;
+ }
+ if (*iptr == '.') {
+ iptr++;
+ width2 = 0;
+ while (*iptr && isdigit(*iptr)) {
+ width2 += (*iptr - '0');
+ iptr++;
+ if (isdigit(*iptr)) width2 *= 10;
+ }
+ }
+
+ islong = 0;
+ if (*iptr == 'l') { islong++; iptr++; }
+ if (*iptr == 'l') { islong++; iptr++; }
+
+ switch (*iptr) {
+ case 'I':
+ tmpptr = (unsigned char *) va_arg(marker,unsigned char *);
+ optr += __atox(optr,*tmpptr++,10,0,digits);
+ *optr++ = '.';
+ optr += __atox(optr,*tmpptr++,10,0,digits);
+ *optr++ = '.';
+ optr += __atox(optr,*tmpptr++,10,0,digits);
+ *optr++ = '.';
+ optr += __atox(optr,*tmpptr++,10,0,digits);
+ break;
+ case 's':
+ tmpptr = (unsigned char *) va_arg(marker,unsigned char *);
+ if (!tmpptr) tmpptr = (unsigned char *) "(null)";
+ if ((width == 0) & (width2 == 0)) {
+ while (*tmpptr) *optr++ = *tmpptr++;
+ break;
+ }
+ while (width && *tmpptr) {
+ *optr++ = *tmpptr++;
+ width--;
+ }
+ while (width) {
+ *optr++ = ' ';
+ width--;
+ }
+ break;
+ case 'a':
+ tmpptr = (unsigned char *) va_arg(marker,unsigned char *);
+ for (x = 0; x < 5; x++) {
+ optr += __atox(optr,*tmpptr++,16,2,digits);
+ *optr++ = '-';
+ }
+ optr += __atox(optr,*tmpptr++,16,2,digits);
+ break;
+ case 'd':
+ switch (islong) {
+ case 0:
+ case 1:
+ i = va_arg(marker,int);
+ if (i < 0) { *optr++='-'; i = -i;}
+ optr += __atox(optr,i,10,width,digits);
+ break;
+ case 2:
+ ll = va_arg(marker,long long int);
+ if (ll < 0) { *optr++='-'; ll = -ll;}
+ optr += __llatox(optr,ll,10,width,digits);
+ break;
+ }
+ break;
+ case 'u':
+ switch (islong) {
+ case 0:
+ case 1:
+ x = va_arg(marker,unsigned int);
+ optr += __atox(optr,x,10,width,digits);
+ break;
+ case 2:
+ lx = va_arg(marker,unsigned long long);
+ optr += __llatox(optr,lx,10,width,digits);
+ break;
+ }
+ break;
+ case 'X':
+ case 'x':
+ switch (islong) {
+ case 0:
+ case 1:
+ x = va_arg(marker,unsigned int);
+ optr += __atox(optr,x,16,width,
+ (*iptr == 'X') ? digits : ldigits);
+ break;
+ case 2:
+ lx = va_arg(marker,unsigned long long);
+ optr += __llatox(optr,lx,16,width,
+ (*iptr == 'X') ? digits : ldigits);
+ break;
+ }
+ break;
+ case 'p':
+ case 'P':
+#ifdef __long64
+ lx = va_arg(marker,unsigned long long);
+ optr += __llatox(optr,lx,16,16,
+ (*iptr == 'P') ? digits : ldigits);
+#else
+ x = va_arg(marker,unsigned int);
+ optr += __atox(optr,x,16,8,
+ (*iptr == 'P') ? digits : ldigits);
+#endif
+ break;
+ case 'w':
+ x = va_arg(marker,unsigned int);
+ x &= 0x0000FFFF;
+ optr += __atox(optr,x,16,4,digits);
+ break;
+ case 'b':
+ x = va_arg(marker,unsigned int);
+ x &= 0x0000FF;
+ optr += __atox(optr,x,16,2,digits);
+ break;
+ case 'Z':
+ x = va_arg(marker,unsigned int);
+ tmpptr = va_arg(marker,unsigned char *);
+ while (x) {
+ optr += __atox(optr,*tmpptr++,16,2,digits);
+ x--;
+ }
+ break;
+ case 'c':
+ x = va_arg(marker, int);
+ *optr++ = x & 0xff;
+ break;
+
+ default:
+ *optr++ = *iptr;
+ break;
+ }
+ iptr++;
+ }
+
+ *optr = '\0';
+
+ return (optr - outbuf);
+}
+
+
+/* *********************************************************************
+ * xsprintf(buf,template,params..)
+ *
+ * format messages from template into a buffer.
+ *
+ * Input Parameters:
+ * buf - output buffer
+ * template - template string
+ * params... parameters
+ *
+ * Return Value:
+ * number of bytes copied to buffer
+ ********************************************************************* */
+int xsprintf(char *buf,const char *templat,...)
+{
+ va_list marker;
+ int count;
+
+ va_start(marker,templat);
+ count = xvsprintf(buf,templat,marker);
+ va_end(marker);
+
+ return count;
+}
+
+/* *********************************************************************
+ * xprintf(template,...)
+ *
+ * A miniature printf.
+ *
+ * %a - Ethernet address (16 bytes)
+ * %s - unpacked string, null terminated
+ * %x - hex word (machine size)
+ * %w - hex word (16 bits)
+ * %b - hex byte (8 bits)
+ * %Z - buffer (put length first, then buffer address)
+ *
+ * Return value:
+ * number of bytes written
+ ********************************************************************* */
+
+int xprintf(const char *templat,...)
+{
+ va_list marker;
+ int count;
+ char buffer[512];
+
+ va_start(marker,templat);
+ count = xvsprintf(buffer,templat,marker);
+ va_end(marker);
+
+ if (xprinthook) (*xprinthook)(buffer);
+
+ return count;
+}
+
+
+int xvprintf(const char *templat,va_list marker)
+{
+ int count;
+ char buffer[512];
+
+ count = xvsprintf(buffer,templat,marker);
+
+ if (xprinthook) (*xprinthook)(buffer);
+
+ return count;
+}
+
+
+
+
+
+
+
+
diff --git a/cfe/cfe/lib/lib_qsort.c b/cfe/cfe/lib/lib_qsort.c
new file mode 100644
index 0000000..f3c60b8
--- /dev/null
+++ b/cfe/cfe/lib/lib_qsort.c
@@ -0,0 +1,88 @@
+#include "lib_types.h"
+#include "lib_string.h"
+
+#define CHAR_BIT 8
+#define MAXSTACK (sizeof(int) * CHAR_BIT)
+
+static void qsexchange(void *a, void *b, size_t size)
+{
+ size_t i;
+
+ /******************
+ * exchange a,b *
+ ******************/
+
+ for (i = sizeof(int); i <= size; i += sizeof(int)) {
+ int t = *((int *)a);
+ *(((int *)a)++) = *((int *)b);
+ *(((int *)b)++) = t;
+ }
+ for (i = i - sizeof(int) + 1; i <= size; i++) {
+ char t = *((char *)a);
+ *(((char *)a)++) = *((char *)b);
+ *(((char *)b)++) = t;
+ }
+}
+
+void qsort(void *base, size_t nmemb, size_t size,
+ int (*compar)(const void *, const void *))
+{
+ void *lbStack[MAXSTACK], *ubStack[MAXSTACK];
+ int sp;
+ unsigned int offset;
+
+ /********************
+ * ANSI-C qsort() *
+ ********************/
+
+ lbStack[0] = (char *)base;
+ ubStack[0] = (char *)base + (nmemb-1)*size;
+ for (sp = 0; sp >= 0; sp--) {
+ char *lb, *ub, *m;
+ char *P, *i, *j;
+
+ lb = lbStack[sp];
+ ub = ubStack[sp];
+
+ while (lb < ub) {
+
+ /* select pivot and exchange with 1st element */
+ offset = (ub - lb) >> 1;
+ P = lb + offset - offset % size;
+ qsexchange (lb, P, size);
+
+ /* partition into two segments */
+ i = lb + size;
+ j = ub;
+ while (1) {
+ while (i < j && compar(lb, i) > 0) i += size;
+ while (j >= i && compar(j, lb) > 0) j -= size;
+ if (i >= j) break;
+ qsexchange (i, j, size);
+ j -= size;
+ i += size;
+ }
+
+ /* pivot belongs in A[j] */
+ qsexchange (lb, j, size);
+ m = j;
+
+ /* keep processing smallest segment, and stack largest */
+ if (m - lb <= ub - m) {
+ if (m + size < ub) {
+ lbStack[sp] = m + size;
+ ubStack[sp++] = ub;
+ }
+ ub = m - size;
+ }
+ else {
+ if (m - size > lb) {
+ lbStack[sp] = lb;
+ ubStack[sp++] = m - size;
+ }
+ lb = m + size;
+ }
+ }
+ }
+}
+
diff --git a/cfe/cfe/lib/lib_queue.c b/cfe/cfe/lib/lib_queue.c
new file mode 100644
index 0000000..0712adf
--- /dev/null
+++ b/cfe/cfe/lib/lib_queue.c
@@ -0,0 +1,219 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Queue Management routines File: lib_queue.c
+ *
+ * Routines to manage doubly-linked queues.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_queue.h"
+
+
+/* *********************************************************************
+ * Q_ENQUEUE(qb,item)
+ *
+ * Add item to a queue
+ *
+ * Input Parameters:
+ * qb - queue block
+ * item - item to add
+ *
+ * Return Value:
+ * Nothing.
+ ********************************************************************* */
+
+void q_enqueue(queue_t *qb,queue_t *item)
+{
+ qb->q_prev->q_next = item;
+ item->q_next = qb;
+ item->q_prev = qb->q_prev;
+ qb->q_prev = item;
+}
+
+
+/* *********************************************************************
+ * Q_DEQUEUE(element)
+ *
+ * Remove an element from the queue
+ *
+ * Input Parameters:
+ * element - element to remove
+ *
+ * Return Value:
+ * Nothing.
+ ********************************************************************* */
+
+void q_dequeue(queue_t *item)
+{
+ item->q_prev->q_next = item->q_next;
+ item->q_next->q_prev = item->q_prev;
+}
+
+
+/* *********************************************************************
+ * Q_DEQNEXT(qb)
+ *
+ * Dequeue next element from the specified queue
+ *
+ * Input Parameters:
+ * qb - queue block
+ *
+ * Return Value:
+ * next element, or NULL
+ ********************************************************************* */
+
+queue_t *q_deqnext(queue_t *qb)
+{
+ if (qb->q_next == qb) {
+ return NULL;
+ }
+
+ qb = qb->q_next;
+
+ qb->q_prev->q_next = qb->q_next;
+ qb->q_next->q_prev = qb->q_prev;
+
+ return qb;
+}
+
+
+/* *********************************************************************
+ * Q_MAP(qb)
+ *
+ * "Map" a queue, calling the specified function for each
+ * element in the queue
+ *
+ * If the function returns nonzero, q_map will terminate.
+ *
+ * Input Parameters:
+ * qb - queue block
+ * fn - function pointer
+ * a,b - parameters for the function
+ *
+ * Return Value:
+ * return value from function, or zero if entire queue
+ * was mapped.
+ ********************************************************************* */
+
+int q_map(queue_t *qb, int (*func)(queue_t *,unsigned int,unsigned int),
+ unsigned int a,unsigned int b)
+{
+ queue_t *qe;
+ queue_t *nextq;
+ int res;
+
+ qe = qb;
+
+ qe = qb->q_next;
+
+ while (qe != qb) {
+ nextq = qe->q_next;
+ if ((res = (*func)(qe,a,b))) return res;
+ qe = nextq;
+ }
+
+ return 0;
+}
+
+
+
+
+
+/* *********************************************************************
+ * Q_COUNT(qb) *
+ * *
+ * Counts the elements on a queue (not interlocked) *
+ * *
+ * Input Parameters: *
+ * qb - queue block *
+ * *
+ * Return Value: *
+ * number of elements *
+ ********************************************************************* */
+int q_count(queue_t *qb)
+{
+ queue_t *qe;
+ int res = 0;
+
+ qe = qb;
+
+ while (qe->q_next != qb) {
+ qe = qe->q_next;
+ res++;
+ }
+
+ return res;
+}
+
+
+
+
+/* *********************************************************************
+ * Q_FIND(qb,item)
+ *
+ * Determines if a particular element is on a queue.
+ *
+ * Input Parameters:
+ * qb - queue block
+ * item - queue element
+ *
+ * Return Value:
+ * 0 - not on queue
+ * >0 - position on queue
+ ********************************************************************* */
+int q_find(queue_t *qb,queue_t *item)
+{
+ queue_t *q;
+ int res = 1;
+
+ q = qb->q_next;
+
+ while (q != item) {
+ if (q == qb) return 0;
+ q = q->q_next;
+ res++;
+ }
+
+ return res;
+}
+
diff --git a/cfe/cfe/lib/lib_string.c b/cfe/cfe/lib/lib_string.c
new file mode 100644
index 0000000..08e9ee7
--- /dev/null
+++ b/cfe/cfe/lib/lib_string.c
@@ -0,0 +1,386 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * String routines File: lib_string.c
+ *
+ * Some standard routines for messing with strings.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+
+
+#include "lib_types.h"
+#define _LIB_NO_MACROS_
+#include "lib_string.h"
+
+char *lib_strcpy(char *dest,const char *src)
+{
+ char *ptr = dest;
+
+ while (*src) *ptr++ = *src++;
+ *ptr = '\0';
+
+ return dest;
+}
+
+char *lib_strncpy(char *dest,const char *src,size_t cnt)
+{
+ char *ptr = dest;
+
+ while (*src && (cnt > 0)) {
+ *ptr++ = *src++;
+ cnt--;
+ }
+ if (cnt > 0) *ptr = '\0';
+
+ return dest;
+}
+
+
+size_t lib_xstrncpy(char *dest,const char *src,size_t cnt)
+{
+ char *ptr = dest;
+ size_t copied = 0;
+
+ while (*src && (cnt > 1)) {
+ *ptr++ = *src++;
+ cnt--;
+ copied++;
+ }
+ *ptr = '\0';
+
+ return copied;
+}
+
+size_t lib_strlen(const char *str)
+{
+ size_t cnt = 0;
+
+ while (*str) {
+ str++;
+ cnt++;
+ }
+
+ return cnt;
+}
+
+
+int lib_strcmp(const char *dest,const char *src)
+{
+ while (*src && *dest) {
+ if (*dest < *src) return -1;
+ if (*dest > *src) return 1;
+ dest++;
+ src++;
+ }
+
+ if (*dest && !*src) return 1;
+ if (!*dest && *src) return -1;
+ return 0;
+}
+
+/* Foxconn add start by Jenny Zhao, 07/02/2008*/
+int lib_strncmp(const char *dest, const char *src, size_t cnt )
+{
+ while (*src && *dest && cnt) {
+ if (*dest < *src ) return -1;
+ if (*dest > *src) return 1;
+ dest++;
+ src++;
+ cnt--;
+ }
+
+ if (!cnt) return 0;
+ if (*dest && !*src) return 1;
+ if (!*dest && *src) return -1;
+ return 0;
+}
+/* Foxconn add start by Jenny Zhao, 07/02/2008*/
+
+
+int lib_strcmpi(const char *dest,const char *src)
+{
+ char dc,sc;
+
+ while (*src && *dest) {
+ dc = lib_toupper(*dest);
+ sc = lib_toupper(*src);
+ if (dc < sc) return -1;
+ if (dc > sc) return 1;
+ dest++;
+ src++;
+ }
+
+ if (*dest && !*src) return 1;
+ if (!*dest && *src) return -1;
+ return 0;
+}
+
+
+char *lib_strchr(const char *dest,int c)
+{
+ while (*dest) {
+ if (*dest == c) return (char *) dest;
+ dest++;
+ }
+ return NULL;
+}
+
+char *lib_strnchr(const char *dest,int c,size_t cnt)
+{
+ while (*dest && (cnt > 0)) {
+ if (*dest == c) return (char *) dest;
+ dest++;
+ cnt--;
+ }
+ return NULL;
+}
+
+char *lib_strrchr(const char *dest,int c)
+{
+ char *ret = NULL;
+
+ while (*dest) {
+ if (*dest == c) ret = (char *) dest;
+ dest++;
+ }
+
+ return ret;
+}
+
+
+int lib_memcmp(const void *dest,const void *src,size_t cnt)
+{
+ const unsigned char *d;
+ const unsigned char *s;
+
+ d = (const unsigned char *) dest;
+ s = (const unsigned char *) src;
+
+ while (cnt) {
+ if (*d < *s) return -1;
+ if (*d > *s) return 1;
+ d++; s++; cnt--;
+ }
+
+ return 0;
+}
+
+void *lib_memcpy(void *dest,const void *src,size_t cnt)
+{
+ unsigned char *d;
+ const unsigned char *s;
+
+ d = (unsigned char *) dest;
+ s = (const unsigned char *) src;
+
+ while (cnt) {
+ *d++ = *s++;
+ cnt--;
+ }
+
+ return dest;
+}
+
+void *lib_memset(void *dest,int c,size_t cnt)
+{
+ unsigned char *d;
+
+ d = dest;
+
+ while (cnt) {
+ *d++ = (unsigned char) c;
+ cnt--;
+ }
+
+ return d;
+}
+
+char lib_toupper(char c)
+{
+ if ((c >= 'a') && (c <= 'z')) c -= 32;
+ return c;
+}
+
+void lib_strupr(char *str)
+{
+ while (*str) {
+ *str = lib_toupper(*str);
+ str++;
+ }
+}
+
+char *lib_strcat(char *dest,const char *src)
+{
+ char *ptr = dest;
+
+ while (*ptr) ptr++;
+ while (*src) *ptr++ = *src++;
+ *ptr = '\0';
+
+ return dest;
+}
+
+#define isspace(x) (((x) == ' ') || ((x) == '\t'))
+
+char *lib_gettoken(char **ptr)
+{
+ char *p = *ptr;
+ char *ret;
+
+ /* skip white space */
+
+ while (*p && isspace(*p)) p++;
+ ret = p;
+
+ /* check for end of string */
+
+ if (!*p) {
+ *ptr = p;
+ return NULL;
+ }
+
+ /* skip non-whitespace */
+
+ while (*p) {
+ if (isspace(*p)) break;
+
+ /* do quoted strings */
+
+ if (*p == '"') {
+ p++;
+ ret = p;
+ while (*p && (*p != '"')) p++;
+ if (*p == '"') *p = '\0';
+ }
+
+ p++;
+
+ }
+
+ if (*p) {
+ *p++ = '\0';
+ }
+ *ptr = p;
+
+ return ret;
+}
+
+
+int lib_atoi(const char *dest)
+{
+ int x = 0;
+ int digit;
+
+ if ((*dest == '0') && (*(dest+1) == 'x')) {
+ return lib_xtoi(dest+2);
+ }
+
+ while (*dest) {
+ if ((*dest >= '0') && (*dest <= '9')) {
+ digit = *dest - '0';
+ }
+ else {
+ break;
+ }
+ x *= 10;
+ x += digit;
+ dest++;
+ }
+
+ return x;
+}
+
+uint64_t lib_xtoq(const char *dest)
+{
+ uint64_t x = 0;
+ unsigned int digit;
+
+ if ((*dest == '0') && (*(dest+1) == 'x')) dest += 2;
+
+ while (*dest) {
+ if ((*dest >= '0') && (*dest <= '9')) {
+ digit = *dest - '0';
+ }
+ else if ((*dest >= 'A') && (*dest <= 'F')) {
+ digit = 10 + *dest - 'A';
+ }
+ else if ((*dest >= 'a') && (*dest <= 'f')) {
+ digit = 10 + *dest - 'a';
+ }
+ else {
+ break;
+ }
+ x *= 16;
+ x += digit;
+ dest++;
+ }
+
+ return x;
+}
+
+int lib_xtoi(const char *dest)
+{
+ int x = 0;
+ int digit;
+
+ if ((*dest == '0') && (*(dest+1) == 'x')) dest += 2;
+
+ while (*dest) {
+ if ((*dest >= '0') && (*dest <= '9')) {
+ digit = *dest - '0';
+ }
+ else if ((*dest >= 'A') && (*dest <= 'F')) {
+ digit = 10 + *dest - 'A';
+ }
+ else if ((*dest >= 'a') && (*dest <= 'f')) {
+ digit = 10 + *dest - 'a';
+ }
+ else {
+ break;
+ }
+ x *= 16;
+ x += digit;
+ dest++;
+ }
+
+ return x;
+}
diff --git a/cfe/cfe/lib/lib_string2.c b/cfe/cfe/lib/lib_string2.c
new file mode 100644
index 0000000..e42070a
--- /dev/null
+++ b/cfe/cfe/lib/lib_string2.c
@@ -0,0 +1,96 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * More string routines File: lib_string2.c
+ *
+ * More routines to muck with strings; these routines typically
+ * need malloc to operate. This way lib_string.c can be incorporated
+ * into other programs that don't need malloc
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+
+#include "lib_types.h"
+#include "lib_malloc.h"
+#define _LIB_NO_MACROS_
+#include "lib_string.h"
+
+
+char *lib_strdup(char *str)
+{
+ char *buf;
+
+ buf = KMALLOC(lib_strlen(str)+1,0);
+ if (buf) {
+ lib_strcpy(buf,str);
+ }
+
+ return buf;
+}
+
+void lib_trimleading(char *path)
+{
+ if (*path == '/') {
+ lib_strcpy(path, path+1);
+ }
+
+ return;
+}
+
+void lib_chop_filename(char *str,char **host,char **file)
+{
+ char *p;
+
+ *host = str;
+
+ p = lib_strchr(str,':');
+ if (!p) p = lib_strchr(str,'/');
+
+ if (p) {
+ *p++ = '\0';
+ *file = p;
+ }
+ else {
+ *file = NULL;
+ }
+}
+
+
diff --git a/cfe/cfe/lzma/LzmaDecode.c b/cfe/cfe/lzma/LzmaDecode.c
new file mode 100755
index 0000000..cb83453
--- /dev/null
+++ b/cfe/cfe/lzma/LzmaDecode.c
@@ -0,0 +1,584 @@
+/*
+ LzmaDecode.c
+ LZMA Decoder (optimized for Speed version)
+
+ LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01)
+ http://www.7-zip.org/
+
+ LZMA SDK is licensed under two licenses:
+ 1) GNU Lesser General Public License (GNU LGPL)
+ 2) Common Public License (CPL)
+ It means that you can select one of these two licenses and
+ follow rules of that license.
+
+ SPECIAL EXCEPTION:
+ Igor Pavlov, as the author of this Code, expressly permits you to
+ statically or dynamically link your Code (or bind by name) to the
+ interfaces of this file without subjecting your linked Code to the
+ terms of the CPL or GNU LGPL. Any modifications or additions
+ to this file, however, are subject to the LGPL or CPL terms.
+*/
+
+#include "LzmaDecode.h"
+
+#define kNumTopBits 24
+#define kTopValue ((UInt32)1 << kNumTopBits)
+
+#define kNumBitModelTotalBits 11
+#define kBitModelTotal (1 << kNumBitModelTotalBits)
+#define kNumMoveBits 5
+
+#define RC_READ_BYTE (*Buffer++)
+
+#define RC_INIT2 Code = 0; Range = 0xFFFFFFFF; \
+ { int i; for(i = 0; i < 5; i++) { RC_TEST; Code = (Code << 8) | RC_READ_BYTE; }}
+
+#ifdef _LZMA_IN_CB
+
+#define RC_TEST { if (Buffer == BufferLim) \
+ { SizeT size; int result = InCallback->Read(InCallback, &Buffer, &size); if (result != LZMA_RESULT_OK) return result; \
+ BufferLim = Buffer + size; if (size == 0) return LZMA_RESULT_DATA_ERROR; }}
+
+#define RC_INIT Buffer = BufferLim = 0; RC_INIT2
+
+#else
+
+#define RC_TEST { if (Buffer == BufferLim) return LZMA_RESULT_DATA_ERROR; }
+
+#define RC_INIT(buffer, bufferSize) Buffer = buffer; BufferLim = buffer + bufferSize; RC_INIT2
+
+#endif
+
+#define RC_NORMALIZE if (Range < kTopValue) { RC_TEST; Range <<= 8; Code = (Code << 8) | RC_READ_BYTE; }
+
+#define IfBit0(p) RC_NORMALIZE; bound = (Range >> kNumBitModelTotalBits) * *(p); if (Code < bound)
+#define UpdateBit0(p) Range = bound; *(p) += (kBitModelTotal - *(p)) >> kNumMoveBits;
+#define UpdateBit1(p) Range -= bound; Code -= bound; *(p) -= (*(p)) >> kNumMoveBits;
+
+#define RC_GET_BIT2(p, mi, A0, A1) IfBit0(p) \
+ { UpdateBit0(p); mi <<= 1; A0; } else \
+ { UpdateBit1(p); mi = (mi + mi) + 1; A1; }
+
+#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ; , ;)
+
+#define RangeDecoderBitTreeDecode(probs, numLevels, res) \
+ { int i = numLevels; res = 1; \
+ do { CProb *p = probs + res; RC_GET_BIT(p, res) } while(--i != 0); \
+ res -= (1 << numLevels); }
+
+
+#define kNumPosBitsMax 4
+#define kNumPosStatesMax (1 << kNumPosBitsMax)
+
+#define kLenNumLowBits 3
+#define kLenNumLowSymbols (1 << kLenNumLowBits)
+#define kLenNumMidBits 3
+#define kLenNumMidSymbols (1 << kLenNumMidBits)
+#define kLenNumHighBits 8
+#define kLenNumHighSymbols (1 << kLenNumHighBits)
+
+#define LenChoice 0
+#define LenChoice2 (LenChoice + 1)
+#define LenLow (LenChoice2 + 1)
+#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
+#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
+#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
+
+
+#define kNumStates 12
+#define kNumLitStates 7
+
+#define kStartPosModelIndex 4
+#define kEndPosModelIndex 14
+#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
+
+#define kNumPosSlotBits 6
+#define kNumLenToPosStates 4
+
+#define kNumAlignBits 4
+#define kAlignTableSize (1 << kNumAlignBits)
+
+#define kMatchMinLen 2
+
+#define IsMatch 0
+#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax))
+#define IsRepG0 (IsRep + kNumStates)
+#define IsRepG1 (IsRepG0 + kNumStates)
+#define IsRepG2 (IsRepG1 + kNumStates)
+#define IsRep0Long (IsRepG2 + kNumStates)
+#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax))
+#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits))
+#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex)
+#define LenCoder (Align + kAlignTableSize)
+#define RepLenCoder (LenCoder + kNumLenProbs)
+#define Literal (RepLenCoder + kNumLenProbs)
+
+#if Literal != LZMA_BASE_SIZE
+StopCompilingDueBUG
+#endif
+
+int LzmaDecodeProperties(CLzmaProperties *propsRes, const unsigned char *propsData, int size)
+{
+ unsigned char prop0;
+ if (size < LZMA_PROPERTIES_SIZE)
+ return LZMA_RESULT_DATA_ERROR;
+ prop0 = propsData[0];
+ if (prop0 >= (9 * 5 * 5))
+ return LZMA_RESULT_DATA_ERROR;
+ {
+ for (propsRes->pb = 0; prop0 >= (9 * 5); propsRes->pb++, prop0 -= (9 * 5));
+ for (propsRes->lp = 0; prop0 >= 9; propsRes->lp++, prop0 -= 9);
+ propsRes->lc = prop0;
+ /*
+ unsigned char remainder = (unsigned char)(prop0 / 9);
+ propsRes->lc = prop0 % 9;
+ propsRes->pb = remainder / 5;
+ propsRes->lp = remainder % 5;
+ */
+ }
+
+ #ifdef _LZMA_OUT_READ
+ {
+ int i;
+ propsRes->DictionarySize = 0;
+ for (i = 0; i < 4; i++)
+ propsRes->DictionarySize += (UInt32)(propsData[1 + i]) << (i * 8);
+ if (propsRes->DictionarySize == 0)
+ propsRes->DictionarySize = 1;
+ }
+ #endif
+ return LZMA_RESULT_OK;
+}
+
+#define kLzmaStreamWasFinishedId (-1)
+
+int LzmaDecode(CLzmaDecoderState *vs,
+ #ifdef _LZMA_IN_CB
+ ILzmaInCallback *InCallback,
+ #else
+ const unsigned char *inStream, SizeT inSize, SizeT *inSizeProcessed,
+ #endif
+ unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed)
+{
+ CProb *p = vs->Probs;
+ SizeT nowPos = 0;
+ Byte previousByte = 0;
+ UInt32 posStateMask = (1 << (vs->Properties.pb)) - 1;
+ UInt32 literalPosMask = (1 << (vs->Properties.lp)) - 1;
+ int lc = vs->Properties.lc;
+
+ #ifdef _LZMA_OUT_READ
+
+ UInt32 Range = vs->Range;
+ UInt32 Code = vs->Code;
+ #ifdef _LZMA_IN_CB
+ const Byte *Buffer = vs->Buffer;
+ const Byte *BufferLim = vs->BufferLim;
+ #else
+ const Byte *Buffer = inStream;
+ const Byte *BufferLim = inStream + inSize;
+ #endif
+ int state = vs->State;
+ UInt32 rep0 = vs->Reps[0], rep1 = vs->Reps[1], rep2 = vs->Reps[2], rep3 = vs->Reps[3];
+ int len = vs->RemainLen;
+ UInt32 globalPos = vs->GlobalPos;
+ UInt32 distanceLimit = vs->DistanceLimit;
+
+ Byte *dictionary = vs->Dictionary;
+ UInt32 dictionarySize = vs->Properties.DictionarySize;
+ UInt32 dictionaryPos = vs->DictionaryPos;
+
+ Byte tempDictionary[4];
+
+ #ifndef _LZMA_IN_CB
+ *inSizeProcessed = 0;
+ #endif
+ *outSizeProcessed = 0;
+ if (len == kLzmaStreamWasFinishedId)
+ return LZMA_RESULT_OK;
+
+ if (dictionarySize == 0)
+ {
+ dictionary = tempDictionary;
+ dictionarySize = 1;
+ tempDictionary[0] = vs->TempDictionary[0];
+ }
+
+ if (len == kLzmaNeedInitId)
+ {
+ {
+ UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp));
+ UInt32 i;
+ for (i = 0; i < numProbs; i++)
+ p[i] = kBitModelTotal >> 1;
+ rep0 = rep1 = rep2 = rep3 = 1;
+ state = 0;
+ globalPos = 0;
+ distanceLimit = 0;
+ dictionaryPos = 0;
+ dictionary[dictionarySize - 1] = 0;
+ #ifdef _LZMA_IN_CB
+ RC_INIT;
+ #else
+ RC_INIT(inStream, inSize);
+ #endif
+ }
+ len = 0;
+ }
+ while(len != 0 && nowPos < outSize)
+ {
+ UInt32 pos = dictionaryPos - rep0;
+ if (pos >= dictionarySize)
+ pos += dictionarySize;
+ outStream[nowPos++] = dictionary[dictionaryPos] = dictionary[pos];
+ if (++dictionaryPos == dictionarySize)
+ dictionaryPos = 0;
+ len--;
+ }
+ if (dictionaryPos == 0)
+ previousByte = dictionary[dictionarySize - 1];
+ else
+ previousByte = dictionary[dictionaryPos - 1];
+
+ #else /* if !_LZMA_OUT_READ */
+
+ int state = 0;
+ UInt32 rep0 = 1, rep1 = 1, rep2 = 1, rep3 = 1;
+ int len = 0;
+ const Byte *Buffer;
+ const Byte *BufferLim;
+ UInt32 Range;
+ UInt32 Code;
+
+ #ifndef _LZMA_IN_CB
+ *inSizeProcessed = 0;
+ #endif
+ *outSizeProcessed = 0;
+
+ {
+ UInt32 i;
+ UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp));
+ for (i = 0; i < numProbs; i++)
+ p[i] = kBitModelTotal >> 1;
+ }
+
+ #ifdef _LZMA_IN_CB
+ RC_INIT;
+ #else
+ RC_INIT(inStream, inSize);
+ #endif
+
+ #endif /* _LZMA_OUT_READ */
+
+ while(nowPos < outSize)
+ {
+ CProb *prob;
+ UInt32 bound;
+ int posState = (int)(
+ (nowPos
+ #ifdef _LZMA_OUT_READ
+ + globalPos
+ #endif
+ )
+ & posStateMask);
+
+ prob = p + IsMatch + (state << kNumPosBitsMax) + posState;
+ IfBit0(prob)
+ {
+ int symbol = 1;
+ UpdateBit0(prob)
+ prob = p + Literal + (LZMA_LIT_SIZE *
+ (((
+ (nowPos
+ #ifdef _LZMA_OUT_READ
+ + globalPos
+ #endif
+ )
+ & literalPosMask) << lc) + (previousByte >> (8 - lc))));
+
+ if (state >= kNumLitStates)
+ {
+ int matchByte;
+ #ifdef _LZMA_OUT_READ
+ UInt32 pos = dictionaryPos - rep0;
+ if (pos >= dictionarySize)
+ pos += dictionarySize;
+ matchByte = dictionary[pos];
+ #else
+ matchByte = outStream[nowPos - rep0];
+ #endif
+ do
+ {
+ int bit;
+ CProb *probLit;
+ matchByte <<= 1;
+ bit = (matchByte & 0x100);
+ probLit = prob + 0x100 + bit + symbol;
+ RC_GET_BIT2(probLit, symbol, if (bit != 0) break, if (bit == 0) break)
+ }
+ while (symbol < 0x100);
+ }
+ while (symbol < 0x100)
+ {
+ CProb *probLit = prob + symbol;
+ RC_GET_BIT(probLit, symbol)
+ }
+ previousByte = (Byte)symbol;
+
+ outStream[nowPos++] = previousByte;
+ #ifdef _LZMA_OUT_READ
+ if (distanceLimit < dictionarySize)
+ distanceLimit++;
+
+ dictionary[dictionaryPos] = previousByte;
+ if (++dictionaryPos == dictionarySize)
+ dictionaryPos = 0;
+ #endif
+ if (state < 4) state = 0;
+ else if (state < 10) state -= 3;
+ else state -= 6;
+ }
+ else
+ {
+ UpdateBit1(prob);
+ prob = p + IsRep + state;
+ IfBit0(prob)
+ {
+ UpdateBit0(prob);
+ rep3 = rep2;
+ rep2 = rep1;
+ rep1 = rep0;
+ state = state < kNumLitStates ? 0 : 3;
+ prob = p + LenCoder;
+ }
+ else
+ {
+ UpdateBit1(prob);
+ prob = p + IsRepG0 + state;
+ IfBit0(prob)
+ {
+ UpdateBit0(prob);
+ prob = p + IsRep0Long + (state << kNumPosBitsMax) + posState;
+ IfBit0(prob)
+ {
+ #ifdef _LZMA_OUT_READ
+ UInt32 pos;
+ #endif
+ UpdateBit0(prob);
+
+ #ifdef _LZMA_OUT_READ
+ if (distanceLimit == 0)
+ #else
+ if (nowPos == 0)
+ #endif
+ return LZMA_RESULT_DATA_ERROR;
+
+ state = state < kNumLitStates ? 9 : 11;
+ #ifdef _LZMA_OUT_READ
+ pos = dictionaryPos - rep0;
+ if (pos >= dictionarySize)
+ pos += dictionarySize;
+ previousByte = dictionary[pos];
+ dictionary[dictionaryPos] = previousByte;
+ if (++dictionaryPos == dictionarySize)
+ dictionaryPos = 0;
+ #else
+ previousByte = outStream[nowPos - rep0];
+ #endif
+ outStream[nowPos++] = previousByte;
+ #ifdef _LZMA_OUT_READ
+ if (distanceLimit < dictionarySize)
+ distanceLimit++;
+ #endif
+
+ continue;
+ }
+ else
+ {
+ UpdateBit1(prob);
+ }
+ }
+ else
+ {
+ UInt32 distance;
+ UpdateBit1(prob);
+ prob = p + IsRepG1 + state;
+ IfBit0(prob)
+ {
+ UpdateBit0(prob);
+ distance = rep1;
+ }
+ else
+ {
+ UpdateBit1(prob);
+ prob = p + IsRepG2 + state;
+ IfBit0(prob)
+ {
+ UpdateBit0(prob);
+ distance = rep2;
+ }
+ else
+ {
+ UpdateBit1(prob);
+ distance = rep3;
+ rep3 = rep2;
+ }
+ rep2 = rep1;
+ }
+ rep1 = rep0;
+ rep0 = distance;
+ }
+ state = state < kNumLitStates ? 8 : 11;
+ prob = p + RepLenCoder;
+ }
+ {
+ int numBits, offset;
+ CProb *probLen = prob + LenChoice;
+ IfBit0(probLen)
+ {
+ UpdateBit0(probLen);
+ probLen = prob + LenLow + (posState << kLenNumLowBits);
+ offset = 0;
+ numBits = kLenNumLowBits;
+ }
+ else
+ {
+ UpdateBit1(probLen);
+ probLen = prob + LenChoice2;
+ IfBit0(probLen)
+ {
+ UpdateBit0(probLen);
+ probLen = prob + LenMid + (posState << kLenNumMidBits);
+ offset = kLenNumLowSymbols;
+ numBits = kLenNumMidBits;
+ }
+ else
+ {
+ UpdateBit1(probLen);
+ probLen = prob + LenHigh;
+ offset = kLenNumLowSymbols + kLenNumMidSymbols;
+ numBits = kLenNumHighBits;
+ }
+ }
+ RangeDecoderBitTreeDecode(probLen, numBits, len);
+ len += offset;
+ }
+
+ if (state < 4)
+ {
+ int posSlot;
+ state += kNumLitStates;
+ prob = p + PosSlot +
+ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
+ kNumPosSlotBits);
+ RangeDecoderBitTreeDecode(prob, kNumPosSlotBits, posSlot);
+ if (posSlot >= kStartPosModelIndex)
+ {
+ int numDirectBits = ((posSlot >> 1) - 1);
+ rep0 = (2 | ((UInt32)posSlot & 1));
+ if (posSlot < kEndPosModelIndex)
+ {
+ rep0 <<= numDirectBits;
+ prob = p + SpecPos + rep0 - posSlot - 1;
+ }
+ else
+ {
+ numDirectBits -= kNumAlignBits;
+ do
+ {
+ RC_NORMALIZE
+ Range >>= 1;
+ rep0 <<= 1;
+ if (Code >= Range)
+ {
+ Code -= Range;
+ rep0 |= 1;
+ }
+ }
+ while (--numDirectBits != 0);
+ prob = p + Align;
+ rep0 <<= kNumAlignBits;
+ numDirectBits = kNumAlignBits;
+ }
+ {
+ int i = 1;
+ int mi = 1;
+ do
+ {
+ CProb *prob3 = prob + mi;
+ RC_GET_BIT2(prob3, mi, ; , rep0 |= i);
+ i <<= 1;
+ }
+ while(--numDirectBits != 0);
+ }
+ }
+ else
+ rep0 = posSlot;
+ if (++rep0 == (UInt32)(0))
+ {
+ /* it's for stream version */
+ len = kLzmaStreamWasFinishedId;
+ break;
+ }
+ }
+
+ len += kMatchMinLen;
+ #ifdef _LZMA_OUT_READ
+ if (rep0 > distanceLimit)
+ #else
+ if (rep0 > nowPos)
+ #endif
+ return LZMA_RESULT_DATA_ERROR;
+
+ #ifdef _LZMA_OUT_READ
+ if (dictionarySize - distanceLimit > (UInt32)len)
+ distanceLimit += len;
+ else
+ distanceLimit = dictionarySize;
+ #endif
+
+ do
+ {
+ #ifdef _LZMA_OUT_READ
+ UInt32 pos = dictionaryPos - rep0;
+ if (pos >= dictionarySize)
+ pos += dictionarySize;
+ previousByte = dictionary[pos];
+ dictionary[dictionaryPos] = previousByte;
+ if (++dictionaryPos == dictionarySize)
+ dictionaryPos = 0;
+ #else
+ previousByte = outStream[nowPos - rep0];
+ #endif
+ len--;
+ outStream[nowPos++] = previousByte;
+ }
+ while(len != 0 && nowPos < outSize);
+ }
+ }
+ RC_NORMALIZE;
+
+ #ifdef _LZMA_OUT_READ
+ vs->Range = Range;
+ vs->Code = Code;
+ vs->DictionaryPos = dictionaryPos;
+ vs->GlobalPos = globalPos + (UInt32)nowPos;
+ vs->DistanceLimit = distanceLimit;
+ vs->Reps[0] = rep0;
+ vs->Reps[1] = rep1;
+ vs->Reps[2] = rep2;
+ vs->Reps[3] = rep3;
+ vs->State = state;
+ vs->RemainLen = len;
+ vs->TempDictionary[0] = tempDictionary[0];
+ #endif
+
+ #ifdef _LZMA_IN_CB
+ vs->Buffer = Buffer;
+ vs->BufferLim = BufferLim;
+ #else
+ *inSizeProcessed = (SizeT)(Buffer - inStream);
+ #endif
+ *outSizeProcessed = nowPos;
+ return LZMA_RESULT_OK;
+}
diff --git a/cfe/cfe/lzma/LzmaDecode.h b/cfe/cfe/lzma/LzmaDecode.h
new file mode 100755
index 0000000..2870eeb
--- /dev/null
+++ b/cfe/cfe/lzma/LzmaDecode.h
@@ -0,0 +1,113 @@
+/*
+ LzmaDecode.h
+ LZMA Decoder interface
+
+ LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01)
+ http://www.7-zip.org/
+
+ LZMA SDK is licensed under two licenses:
+ 1) GNU Lesser General Public License (GNU LGPL)
+ 2) Common Public License (CPL)
+ It means that you can select one of these two licenses and
+ follow rules of that license.
+
+ SPECIAL EXCEPTION:
+ Igor Pavlov, as the author of this code, expressly permits you to
+ statically or dynamically link your code (or bind by name) to the
+ interfaces of this file without subjecting your linked code to the
+ terms of the CPL or GNU LGPL. Any modifications or additions
+ to this file, however, are subject to the LGPL or CPL terms.
+*/
+
+#ifndef __LZMADECODE_H
+#define __LZMADECODE_H
+
+#include "LzmaTypes.h"
+
+/* #define _LZMA_IN_CB */
+/* Use callback for input data */
+
+/* #define _LZMA_OUT_READ */
+/* Use read function for output data */
+
+/* #define _LZMA_PROB32 */
+/* It can increase speed on some 32-bit CPUs,
+ but memory usage will be doubled in that case */
+
+/* #define _LZMA_LOC_OPT */
+/* Enable local speed optimizations inside code */
+
+#ifdef _LZMA_PROB32
+#define CProb UInt32
+#else
+#define CProb UInt16
+#endif
+
+#define LZMA_RESULT_OK 0
+#define LZMA_RESULT_DATA_ERROR 1
+
+#ifdef _LZMA_IN_CB
+typedef struct _ILzmaInCallback
+{
+ int (*Read)(void *object, const unsigned char **buffer, SizeT *bufferSize);
+} ILzmaInCallback;
+#endif
+
+#define LZMA_BASE_SIZE 1846
+#define LZMA_LIT_SIZE 768
+
+#define LZMA_PROPERTIES_SIZE 5
+
+typedef struct _CLzmaProperties
+{
+ int lc;
+ int lp;
+ int pb;
+ #ifdef _LZMA_OUT_READ
+ UInt32 DictionarySize;
+ #endif
+}CLzmaProperties;
+
+int LzmaDecodeProperties(CLzmaProperties *propsRes, const unsigned char *propsData, int size);
+
+#define LzmaGetNumProbs(Properties) (LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((Properties)->lc + (Properties)->lp)))
+
+#define kLzmaNeedInitId (-2)
+
+typedef struct _CLzmaDecoderState
+{
+ CLzmaProperties Properties;
+ CProb *Probs;
+
+ #ifdef _LZMA_IN_CB
+ const unsigned char *Buffer;
+ const unsigned char *BufferLim;
+ #endif
+
+ #ifdef _LZMA_OUT_READ
+ unsigned char *Dictionary;
+ UInt32 Range;
+ UInt32 Code;
+ UInt32 DictionaryPos;
+ UInt32 GlobalPos;
+ UInt32 DistanceLimit;
+ UInt32 Reps[4];
+ int State;
+ int RemainLen;
+ unsigned char TempDictionary[4];
+ #endif
+} CLzmaDecoderState;
+
+#ifdef _LZMA_OUT_READ
+#define LzmaDecoderInit(vs) { (vs)->RemainLen = kLzmaNeedInitId; }
+#endif
+
+int LzmaDecode(CLzmaDecoderState *vs,
+ #ifdef _LZMA_IN_CB
+ ILzmaInCallback *inCallback,
+ #else
+ const unsigned char *inStream, SizeT inSize, SizeT *inSizeProcessed,
+ #endif
+ unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed);
+
+#endif
diff --git a/cfe/cfe/lzma/LzmaDecodeSize.c b/cfe/cfe/lzma/LzmaDecodeSize.c
new file mode 100755
index 0000000..a3a5eb9
--- /dev/null
+++ b/cfe/cfe/lzma/LzmaDecodeSize.c
@@ -0,0 +1,712 @@
+/*
+ LzmaDecodeSize.c
+ LZMA Decoder (optimized for Size version)
+
+ LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01)
+ http://www.7-zip.org/
+
+ LZMA SDK is licensed under two licenses:
+ 1) GNU Lesser General Public License (GNU LGPL)
+ 2) Common Public License (CPL)
+ It means that you can select one of these two licenses and
+ follow rules of that license.
+
+ SPECIAL EXCEPTION:
+ Igor Pavlov, as the author of this code, expressly permits you to
+ statically or dynamically link your code (or bind by name) to the
+ interfaces of this file without subjecting your linked code to the
+ terms of the CPL or GNU LGPL. Any modifications or additions
+ to this file, however, are subject to the LGPL or CPL terms.
+*/
+
+#include "LzmaDecode.h"
+
+#define kNumTopBits 24
+#define kTopValue ((UInt32)1 << kNumTopBits)
+
+#define kNumBitModelTotalBits 11
+#define kBitModelTotal (1 << kNumBitModelTotalBits)
+#define kNumMoveBits 5
+
+typedef struct _CRangeDecoder
+{
+ const Byte *Buffer;
+ const Byte *BufferLim;
+ UInt32 Range;
+ UInt32 Code;
+ #ifdef _LZMA_IN_CB
+ ILzmaInCallback *InCallback;
+ int Result;
+ #endif
+ int ExtraBytes;
+} CRangeDecoder;
+
+Byte RangeDecoderReadByte(CRangeDecoder *rd)
+{
+ if (rd->Buffer == rd->BufferLim)
+ {
+ #ifdef _LZMA_IN_CB
+ SizeT size;
+ rd->Result = rd->InCallback->Read(rd->InCallback, &rd->Buffer, &size);
+ rd->BufferLim = rd->Buffer + size;
+ if (size == 0)
+ #endif
+ {
+ rd->ExtraBytes = 1;
+ return 0xFF;
+ }
+ }
+ return (*rd->Buffer++);
+}
+
+/* #define ReadByte (*rd->Buffer++) */
+#define ReadByte (RangeDecoderReadByte(rd))
+
+void RangeDecoderInit(CRangeDecoder *rd
+ #ifndef _LZMA_IN_CB
+ , const Byte *stream, SizeT bufferSize
+ #endif
+ )
+{
+ int i;
+ #ifdef _LZMA_IN_CB
+ rd->Buffer = rd->BufferLim = 0;
+ #else
+ rd->Buffer = stream;
+ rd->BufferLim = stream + bufferSize;
+ #endif
+ rd->ExtraBytes = 0;
+ rd->Code = 0;
+ rd->Range = (0xFFFFFFFF);
+ for(i = 0; i < 5; i++)
+ rd->Code = (rd->Code << 8) | ReadByte;
+}
+
+#define RC_INIT_VAR UInt32 range = rd->Range; UInt32 code = rd->Code;
+#define RC_FLUSH_VAR rd->Range = range; rd->Code = code;
+#define RC_NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | ReadByte; }
+
+UInt32 RangeDecoderDecodeDirectBits(CRangeDecoder *rd, int numTotalBits)
+{
+ RC_INIT_VAR
+ UInt32 result = 0;
+ int i;
+ for (i = numTotalBits; i != 0; i--)
+ {
+ /* UInt32 t; */
+ range >>= 1;
+
+ result <<= 1;
+ if (code >= range)
+ {
+ code -= range;
+ result |= 1;
+ }
+ /*
+ t = (code - range) >> 31;
+ t &= 1;
+ code -= range & (t - 1);
+ result = (result + result) | (1 - t);
+ */
+ RC_NORMALIZE
+ }
+ RC_FLUSH_VAR
+ return result;
+}
+
+int RangeDecoderBitDecode(CProb *prob, CRangeDecoder *rd)
+{
+ UInt32 bound = (rd->Range >> kNumBitModelTotalBits) * *prob;
+ if (rd->Code < bound)
+ {
+ rd->Range = bound;
+ *prob += (kBitModelTotal - *prob) >> kNumMoveBits;
+ if (rd->Range < kTopValue)
+ {
+ rd->Code = (rd->Code << 8) | ReadByte;
+ rd->Range <<= 8;
+ }
+ return 0;
+ }
+ else
+ {
+ rd->Range -= bound;
+ rd->Code -= bound;
+ *prob -= (*prob) >> kNumMoveBits;
+ if (rd->Range < kTopValue)
+ {
+ rd->Code = (rd->Code << 8) | ReadByte;
+ rd->Range <<= 8;
+ }
+ return 1;
+ }
+}
+
+#define RC_GET_BIT2(prob, mi, A0, A1) \
+ UInt32 bound = (range >> kNumBitModelTotalBits) * *prob; \
+ if (code < bound) \
+ { A0; range = bound; *prob += (kBitModelTotal - *prob) >> kNumMoveBits; mi <<= 1; } \
+ else \
+ { A1; range -= bound; code -= bound; *prob -= (*prob) >> kNumMoveBits; mi = (mi + mi) + 1; } \
+ RC_NORMALIZE
+
+#define RC_GET_BIT(prob, mi) RC_GET_BIT2(prob, mi, ; , ;)
+
+int RangeDecoderBitTreeDecode(CProb *probs, int numLevels, CRangeDecoder *rd)
+{
+ int mi = 1;
+ int i;
+ #ifdef _LZMA_LOC_OPT
+ RC_INIT_VAR
+ #endif
+ for(i = numLevels; i != 0; i--)
+ {
+ #ifdef _LZMA_LOC_OPT
+ CProb *prob = probs + mi;
+ RC_GET_BIT(prob, mi)
+ #else
+ mi = (mi + mi) + RangeDecoderBitDecode(probs + mi, rd);
+ #endif
+ }
+ #ifdef _LZMA_LOC_OPT
+ RC_FLUSH_VAR
+ #endif
+ return mi - (1 << numLevels);
+}
+
+int RangeDecoderReverseBitTreeDecode(CProb *probs, int numLevels, CRangeDecoder *rd)
+{
+ int mi = 1;
+ int i;
+ int symbol = 0;
+ #ifdef _LZMA_LOC_OPT
+ RC_INIT_VAR
+ #endif
+ for(i = 0; i < numLevels; i++)
+ {
+ #ifdef _LZMA_LOC_OPT
+ CProb *prob = probs + mi;
+ RC_GET_BIT2(prob, mi, ; , symbol |= (1 << i))
+ #else
+ int bit = RangeDecoderBitDecode(probs + mi, rd);
+ mi = mi + mi + bit;
+ symbol |= (bit << i);
+ #endif
+ }
+ #ifdef _LZMA_LOC_OPT
+ RC_FLUSH_VAR
+ #endif
+ return symbol;
+}
+
+Byte LzmaLiteralDecode(CProb *probs, CRangeDecoder *rd)
+{
+ int symbol = 1;
+ #ifdef _LZMA_LOC_OPT
+ RC_INIT_VAR
+ #endif
+ do
+ {
+ #ifdef _LZMA_LOC_OPT
+ CProb *prob = probs + symbol;
+ RC_GET_BIT(prob, symbol)
+ #else
+ symbol = (symbol + symbol) | RangeDecoderBitDecode(probs + symbol, rd);
+ #endif
+ }
+ while (symbol < 0x100);
+ #ifdef _LZMA_LOC_OPT
+ RC_FLUSH_VAR
+ #endif
+ return symbol;
+}
+
+Byte LzmaLiteralDecodeMatch(CProb *probs, CRangeDecoder *rd, Byte matchByte)
+{
+ int symbol = 1;
+ #ifdef _LZMA_LOC_OPT
+ RC_INIT_VAR
+ #endif
+ do
+ {
+ int bit;
+ int matchBit = (matchByte >> 7) & 1;
+ matchByte <<= 1;
+ #ifdef _LZMA_LOC_OPT
+ {
+ CProb *prob = probs + 0x100 + (matchBit << 8) + symbol;
+ RC_GET_BIT2(prob, symbol, bit = 0, bit = 1)
+ }
+ #else
+ bit = RangeDecoderBitDecode(probs + 0x100 + (matchBit << 8) + symbol, rd);
+ symbol = (symbol << 1) | bit;
+ #endif
+ if (matchBit != bit)
+ {
+ while (symbol < 0x100)
+ {
+ #ifdef _LZMA_LOC_OPT
+ CProb *prob = probs + symbol;
+ RC_GET_BIT(prob, symbol)
+ #else
+ symbol = (symbol + symbol) | RangeDecoderBitDecode(probs + symbol, rd);
+ #endif
+ }
+ break;
+ }
+ }
+ while (symbol < 0x100);
+ #ifdef _LZMA_LOC_OPT
+ RC_FLUSH_VAR
+ #endif
+ return symbol;
+}
+
+#define kNumPosBitsMax 4
+#define kNumPosStatesMax (1 << kNumPosBitsMax)
+
+#define kLenNumLowBits 3
+#define kLenNumLowSymbols (1 << kLenNumLowBits)
+#define kLenNumMidBits 3
+#define kLenNumMidSymbols (1 << kLenNumMidBits)
+#define kLenNumHighBits 8
+#define kLenNumHighSymbols (1 << kLenNumHighBits)
+
+#define LenChoice 0
+#define LenChoice2 (LenChoice + 1)
+#define LenLow (LenChoice2 + 1)
+#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
+#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
+#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
+
+int LzmaLenDecode(CProb *p, CRangeDecoder *rd, int posState)
+{
+ if(RangeDecoderBitDecode(p + LenChoice, rd) == 0)
+ return RangeDecoderBitTreeDecode(p + LenLow +
+ (posState << kLenNumLowBits), kLenNumLowBits, rd);
+ if(RangeDecoderBitDecode(p + LenChoice2, rd) == 0)
+ return kLenNumLowSymbols + RangeDecoderBitTreeDecode(p + LenMid +
+ (posState << kLenNumMidBits), kLenNumMidBits, rd);
+ return kLenNumLowSymbols + kLenNumMidSymbols +
+ RangeDecoderBitTreeDecode(p + LenHigh, kLenNumHighBits, rd);
+}
+
+#define kNumStates 12
+#define kNumLitStates 7
+
+#define kStartPosModelIndex 4
+#define kEndPosModelIndex 14
+#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
+
+#define kNumPosSlotBits 6
+#define kNumLenToPosStates 4
+
+#define kNumAlignBits 4
+#define kAlignTableSize (1 << kNumAlignBits)
+
+#define kMatchMinLen 2
+
+#define IsMatch 0
+#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax))
+#define IsRepG0 (IsRep + kNumStates)
+#define IsRepG1 (IsRepG0 + kNumStates)
+#define IsRepG2 (IsRepG1 + kNumStates)
+#define IsRep0Long (IsRepG2 + kNumStates)
+#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax))
+#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits))
+#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex)
+#define LenCoder (Align + kAlignTableSize)
+#define RepLenCoder (LenCoder + kNumLenProbs)
+#define Literal (RepLenCoder + kNumLenProbs)
+
+#if Literal != LZMA_BASE_SIZE
+StopCompilingDueBUG
+#endif
+
+int LzmaDecodeProperties(CLzmaProperties *propsRes, const unsigned char *propsData, int size)
+{
+ unsigned char prop0;
+ if (size < LZMA_PROPERTIES_SIZE)
+ return LZMA_RESULT_DATA_ERROR;
+ prop0 = propsData[0];
+ if (prop0 >= (9 * 5 * 5))
+ return LZMA_RESULT_DATA_ERROR;
+ {
+ for (propsRes->pb = 0; prop0 >= (9 * 5); propsRes->pb++, prop0 -= (9 * 5));
+ for (propsRes->lp = 0; prop0 >= 9; propsRes->lp++, prop0 -= 9);
+ propsRes->lc = prop0;
+ /*
+ unsigned char remainder = (unsigned char)(prop0 / 9);
+ propsRes->lc = prop0 % 9;
+ propsRes->pb = remainder / 5;
+ propsRes->lp = remainder % 5;
+ */
+ }
+
+ #ifdef _LZMA_OUT_READ
+ {
+ int i;
+ propsRes->DictionarySize = 0;
+ for (i = 0; i < 4; i++)
+ propsRes->DictionarySize += (UInt32)(propsData[1 + i]) << (i * 8);
+ if (propsRes->DictionarySize == 0)
+ propsRes->DictionarySize = 1;
+ }
+ #endif
+ return LZMA_RESULT_OK;
+}
+
+#define kLzmaStreamWasFinishedId (-1)
+
+int LzmaDecode(CLzmaDecoderState *vs,
+ #ifdef _LZMA_IN_CB
+ ILzmaInCallback *InCallback,
+ #else
+ const unsigned char *inStream, SizeT inSize, SizeT *inSizeProcessed,
+ #endif
+ unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed)
+{
+ CProb *p = vs->Probs;
+ SizeT nowPos = 0;
+ Byte previousByte = 0;
+ UInt32 posStateMask = (1 << (vs->Properties.pb)) - 1;
+ UInt32 literalPosMask = (1 << (vs->Properties.lp)) - 1;
+ int lc = vs->Properties.lc;
+ CRangeDecoder rd;
+
+ #ifdef _LZMA_OUT_READ
+
+ int state = vs->State;
+ UInt32 rep0 = vs->Reps[0], rep1 = vs->Reps[1], rep2 = vs->Reps[2], rep3 = vs->Reps[3];
+ int len = vs->RemainLen;
+ UInt32 globalPos = vs->GlobalPos;
+ UInt32 distanceLimit = vs->DistanceLimit;
+
+ Byte *dictionary = vs->Dictionary;
+ UInt32 dictionarySize = vs->Properties.DictionarySize;
+ UInt32 dictionaryPos = vs->DictionaryPos;
+
+ Byte tempDictionary[4];
+
+ rd.Range = vs->Range;
+ rd.Code = vs->Code;
+ #ifdef _LZMA_IN_CB
+ rd.InCallback = InCallback;
+ rd.Buffer = vs->Buffer;
+ rd.BufferLim = vs->BufferLim;
+ #else
+ rd.Buffer = inStream;
+ rd.BufferLim = inStream + inSize;
+ #endif
+
+ #ifndef _LZMA_IN_CB
+ *inSizeProcessed = 0;
+ #endif
+ *outSizeProcessed = 0;
+ if (len == kLzmaStreamWasFinishedId)
+ return LZMA_RESULT_OK;
+
+ if (dictionarySize == 0)
+ {
+ dictionary = tempDictionary;
+ dictionarySize = 1;
+ tempDictionary[0] = vs->TempDictionary[0];
+ }
+
+ if (len == kLzmaNeedInitId)
+ {
+ {
+ UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp));
+ UInt32 i;
+ for (i = 0; i < numProbs; i++)
+ p[i] = kBitModelTotal >> 1;
+ rep0 = rep1 = rep2 = rep3 = 1;
+ state = 0;
+ globalPos = 0;
+ distanceLimit = 0;
+ dictionaryPos = 0;
+ dictionary[dictionarySize - 1] = 0;
+ RangeDecoderInit(&rd
+ #ifndef _LZMA_IN_CB
+ , inStream, inSize
+ #endif
+ );
+ #ifdef _LZMA_IN_CB
+ if (rd.Result != LZMA_RESULT_OK)
+ return rd.Result;
+ #endif
+ if (rd.ExtraBytes != 0)
+ return LZMA_RESULT_DATA_ERROR;
+ }
+ len = 0;
+ }
+ while(len != 0 && nowPos < outSize)
+ {
+ UInt32 pos = dictionaryPos - rep0;
+ if (pos >= dictionarySize)
+ pos += dictionarySize;
+ outStream[nowPos++] = dictionary[dictionaryPos] = dictionary[pos];
+ if (++dictionaryPos == dictionarySize)
+ dictionaryPos = 0;
+ len--;
+ }
+ if (dictionaryPos == 0)
+ previousByte = dictionary[dictionarySize - 1];
+ else
+ previousByte = dictionary[dictionaryPos - 1];
+
+ #ifdef _LZMA_IN_CB
+ rd.Result = LZMA_RESULT_OK;
+ #endif
+ rd.ExtraBytes = 0;
+
+ #else /* if !_LZMA_OUT_READ */
+
+ int state = 0;
+ UInt32 rep0 = 1, rep1 = 1, rep2 = 1, rep3 = 1;
+ int len = 0;
+
+ #ifndef _LZMA_IN_CB
+ *inSizeProcessed = 0;
+ #endif
+ *outSizeProcessed = 0;
+
+ {
+ UInt32 i;
+ UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp));
+ for (i = 0; i < numProbs; i++)
+ p[i] = kBitModelTotal >> 1;
+ }
+
+ #ifdef _LZMA_IN_CB
+ rd.InCallback = InCallback;
+ #endif
+ RangeDecoderInit(&rd
+ #ifndef _LZMA_IN_CB
+ , inStream, inSize
+ #endif
+ );
+
+ #ifdef _LZMA_IN_CB
+ if (rd.Result != LZMA_RESULT_OK)
+ return rd.Result;
+ #endif
+ if (rd.ExtraBytes != 0)
+ return LZMA_RESULT_DATA_ERROR;
+
+ #endif /* _LZMA_OUT_READ */
+
+
+ while(nowPos < outSize)
+ {
+ int posState = (int)(
+ (nowPos
+ #ifdef _LZMA_OUT_READ
+ + globalPos
+ #endif
+ )
+ & posStateMask);
+ #ifdef _LZMA_IN_CB
+ if (rd.Result != LZMA_RESULT_OK)
+ return rd.Result;
+ #endif
+ if (rd.ExtraBytes != 0)
+ return LZMA_RESULT_DATA_ERROR;
+ if (RangeDecoderBitDecode(p + IsMatch + (state << kNumPosBitsMax) + posState, &rd) == 0)
+ {
+ CProb *probs = p + Literal + (LZMA_LIT_SIZE *
+ (((
+ (nowPos
+ #ifdef _LZMA_OUT_READ
+ + globalPos
+ #endif
+ )
+ & literalPosMask) << lc) + (previousByte >> (8 - lc))));
+
+ if (state >= kNumLitStates)
+ {
+ Byte matchByte;
+ #ifdef _LZMA_OUT_READ
+ UInt32 pos = dictionaryPos - rep0;
+ if (pos >= dictionarySize)
+ pos += dictionarySize;
+ matchByte = dictionary[pos];
+ #else
+ matchByte = outStream[nowPos - rep0];
+ #endif
+ previousByte = LzmaLiteralDecodeMatch(probs, &rd, matchByte);
+ }
+ else
+ previousByte = LzmaLiteralDecode(probs, &rd);
+ outStream[nowPos++] = previousByte;
+ #ifdef _LZMA_OUT_READ
+ if (distanceLimit < dictionarySize)
+ distanceLimit++;
+
+ dictionary[dictionaryPos] = previousByte;
+ if (++dictionaryPos == dictionarySize)
+ dictionaryPos = 0;
+ #endif
+ if (state < 4) state = 0;
+ else if (state < 10) state -= 3;
+ else state -= 6;
+ }
+ else
+ {
+ if (RangeDecoderBitDecode(p + IsRep + state, &rd) == 1)
+ {
+ if (RangeDecoderBitDecode(p + IsRepG0 + state, &rd) == 0)
+ {
+ if (RangeDecoderBitDecode(p + IsRep0Long + (state << kNumPosBitsMax) + posState, &rd) == 0)
+ {
+ #ifdef _LZMA_OUT_READ
+ UInt32 pos;
+ #endif
+
+ #ifdef _LZMA_OUT_READ
+ if (distanceLimit == 0)
+ #else
+ if (nowPos == 0)
+ #endif
+ return LZMA_RESULT_DATA_ERROR;
+
+ state = state < 7 ? 9 : 11;
+ #ifdef _LZMA_OUT_READ
+ pos = dictionaryPos - rep0;
+ if (pos >= dictionarySize)
+ pos += dictionarySize;
+ previousByte = dictionary[pos];
+ dictionary[dictionaryPos] = previousByte;
+ if (++dictionaryPos == dictionarySize)
+ dictionaryPos = 0;
+ #else
+ previousByte = outStream[nowPos - rep0];
+ #endif
+ outStream[nowPos++] = previousByte;
+
+ #ifdef _LZMA_OUT_READ
+ if (distanceLimit < dictionarySize)
+ distanceLimit++;
+ #endif
+ continue;
+ }
+ }
+ else
+ {
+ UInt32 distance;
+ if(RangeDecoderBitDecode(p + IsRepG1 + state, &rd) == 0)
+ distance = rep1;
+ else
+ {
+ if(RangeDecoderBitDecode(p + IsRepG2 + state, &rd) == 0)
+ distance = rep2;
+ else
+ {
+ distance = rep3;
+ rep3 = rep2;
+ }
+ rep2 = rep1;
+ }
+ rep1 = rep0;
+ rep0 = distance;
+ }
+ len = LzmaLenDecode(p + RepLenCoder, &rd, posState);
+ state = state < 7 ? 8 : 11;
+ }
+ else
+ {
+ int posSlot;
+ rep3 = rep2;
+ rep2 = rep1;
+ rep1 = rep0;
+ state = state < 7 ? 7 : 10;
+ len = LzmaLenDecode(p + LenCoder, &rd, posState);
+ posSlot = RangeDecoderBitTreeDecode(p + PosSlot +
+ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
+ kNumPosSlotBits), kNumPosSlotBits, &rd);
+ if (posSlot >= kStartPosModelIndex)
+ {
+ int numDirectBits = ((posSlot >> 1) - 1);
+ rep0 = ((2 | ((UInt32)posSlot & 1)) << numDirectBits);
+ if (posSlot < kEndPosModelIndex)
+ {
+ rep0 += RangeDecoderReverseBitTreeDecode(
+ p + SpecPos + rep0 - posSlot - 1, numDirectBits, &rd);
+ }
+ else
+ {
+ rep0 += RangeDecoderDecodeDirectBits(&rd,
+ numDirectBits - kNumAlignBits) << kNumAlignBits;
+ rep0 += RangeDecoderReverseBitTreeDecode(p + Align, kNumAlignBits, &rd);
+ }
+ }
+ else
+ rep0 = posSlot;
+ if (++rep0 == (UInt32)(0))
+ {
+ /* it's for stream version */
+ len = kLzmaStreamWasFinishedId;
+ break;
+ }
+ }
+
+ len += kMatchMinLen;
+ #ifdef _LZMA_OUT_READ
+ if (rep0 > distanceLimit)
+ #else
+ if (rep0 > nowPos)
+ #endif
+ return LZMA_RESULT_DATA_ERROR;
+
+ #ifdef _LZMA_OUT_READ
+ if (dictionarySize - distanceLimit > (UInt32)len)
+ distanceLimit += len;
+ else
+ distanceLimit = dictionarySize;
+ #endif
+
+ do
+ {
+ #ifdef _LZMA_OUT_READ
+ UInt32 pos = dictionaryPos - rep0;
+ if (pos >= dictionarySize)
+ pos += dictionarySize;
+ previousByte = dictionary[pos];
+ dictionary[dictionaryPos] = previousByte;
+ if (++dictionaryPos == dictionarySize)
+ dictionaryPos = 0;
+ #else
+ previousByte = outStream[nowPos - rep0];
+ #endif
+ len--;
+ outStream[nowPos++] = previousByte;
+ }
+ while(len != 0 && nowPos < outSize);
+ }
+ }
+
+
+ #ifdef _LZMA_OUT_READ
+ vs->Range = rd.Range;
+ vs->Code = rd.Code;
+ vs->DictionaryPos = dictionaryPos;
+ vs->GlobalPos = globalPos + (UInt32)nowPos;
+ vs->DistanceLimit = distanceLimit;
+ vs->Reps[0] = rep0;
+ vs->Reps[1] = rep1;
+ vs->Reps[2] = rep2;
+ vs->Reps[3] = rep3;
+ vs->State = state;
+ vs->RemainLen = len;
+ vs->TempDictionary[0] = tempDictionary[0];
+ #endif
+
+ #ifdef _LZMA_IN_CB
+ vs->Buffer = rd.Buffer;
+ vs->BufferLim = rd.BufferLim;
+ #else
+ *inSizeProcessed = (SizeT)(rd.Buffer - inStream);
+ #endif
+ *outSizeProcessed = nowPos;
+ return LZMA_RESULT_OK;
+}
diff --git a/cfe/cfe/lzma/LzmaStateDecode.c b/cfe/cfe/lzma/LzmaStateDecode.c
new file mode 100755
index 0000000..e50f88b
--- /dev/null
+++ b/cfe/cfe/lzma/LzmaStateDecode.c
@@ -0,0 +1,521 @@
+/*
+ LzmaStateDecode.c
+ LZMA Decoder (State version)
+
+ LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01)
+ http://www.7-zip.org/
+
+ LZMA SDK is licensed under two licenses:
+ 1) GNU Lesser General Public License (GNU LGPL)
+ 2) Common Public License (CPL)
+ It means that you can select one of these two licenses and
+ follow rules of that license.
+
+ SPECIAL EXCEPTION:
+ Igor Pavlov, as the author of this Code, expressly permits you to
+ statically or dynamically link your Code (or bind by name) to the
+ interfaces of this file without subjecting your linked Code to the
+ terms of the CPL or GNU LGPL. Any modifications or additions
+ to this file, however, are subject to the LGPL or CPL terms.
+*/
+
+#include "LzmaStateDecode.h"
+
+#define kNumTopBits 24
+#define kTopValue ((UInt32)1 << kNumTopBits)
+
+#define kNumBitModelTotalBits 11
+#define kBitModelTotal (1 << kNumBitModelTotalBits)
+#define kNumMoveBits 5
+
+#define RC_READ_BYTE (*Buffer++)
+
+#define RC_INIT Code = 0; Range = 0xFFFFFFFF; \
+ { int i; for(i = 0; i < 5; i++) { Code = (Code << 8) | RC_READ_BYTE; }}
+
+#define RC_NORMALIZE if (Range < kTopValue) { Range <<= 8; Code = (Code << 8) | RC_READ_BYTE; }
+
+#define IfBit0(p) RC_NORMALIZE; bound = (Range >> kNumBitModelTotalBits) * *(p); if (Code < bound)
+#define UpdateBit0(p) Range = bound; *(p) += (kBitModelTotal - *(p)) >> kNumMoveBits;
+#define UpdateBit1(p) Range -= bound; Code -= bound; *(p) -= (*(p)) >> kNumMoveBits;
+
+#define RC_GET_BIT2(p, mi, A0, A1) IfBit0(p) \
+ { UpdateBit0(p); mi <<= 1; A0; } else \
+ { UpdateBit1(p); mi = (mi + mi) + 1; A1; }
+
+#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ; , ;)
+
+#define RangeDecoderBitTreeDecode(probs, numLevels, res) \
+ { int i = numLevels; res = 1; \
+ do { CProb *p = probs + res; RC_GET_BIT(p, res) } while(--i != 0); \
+ res -= (1 << numLevels); }
+
+
+#define kNumPosBitsMax 4
+#define kNumPosStatesMax (1 << kNumPosBitsMax)
+
+#define kLenNumLowBits 3
+#define kLenNumLowSymbols (1 << kLenNumLowBits)
+#define kLenNumMidBits 3
+#define kLenNumMidSymbols (1 << kLenNumMidBits)
+#define kLenNumHighBits 8
+#define kLenNumHighSymbols (1 << kLenNumHighBits)
+
+#define LenChoice 0
+#define LenChoice2 (LenChoice + 1)
+#define LenLow (LenChoice2 + 1)
+#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
+#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
+#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
+
+
+#define kNumStates 12
+#define kNumLitStates 7
+
+#define kStartPosModelIndex 4
+#define kEndPosModelIndex 14
+#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
+
+#define kNumPosSlotBits 6
+#define kNumLenToPosStates 4
+
+#define kNumAlignBits 4
+#define kAlignTableSize (1 << kNumAlignBits)
+
+#define kMatchMinLen 2
+
+#define IsMatch 0
+#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax))
+#define IsRepG0 (IsRep + kNumStates)
+#define IsRepG1 (IsRepG0 + kNumStates)
+#define IsRepG2 (IsRepG1 + kNumStates)
+#define IsRep0Long (IsRepG2 + kNumStates)
+#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax))
+#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits))
+#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex)
+#define LenCoder (Align + kAlignTableSize)
+#define RepLenCoder (LenCoder + kNumLenProbs)
+#define Literal (RepLenCoder + kNumLenProbs)
+
+#if Literal != LZMA_BASE_SIZE
+StopCompilingDueBUG
+#endif
+
+/* kRequiredInBufferSize = number of required input bytes for worst case:
+ longest match with longest distance.
+ kLzmaInBufferSize must be larger than kRequiredInBufferSize
+ 23 bits = 2 (match select) + 10 (len) + 6 (distance) + 4(align) + 1 (RC_NORMALIZE)
+*/
+
+#define kRequiredInBufferSize ((23 * (kNumBitModelTotalBits - kNumMoveBits + 1) + 26 + 9) / 8)
+
+#define kLzmaStreamWasFinishedId (-1)
+
+int LzmaDecodeProperties(CLzmaProperties *propsRes, const unsigned char *propsData, int size)
+{
+ unsigned char prop0;
+ if (size < LZMA_PROPERTIES_SIZE)
+ return LZMA_RESULT_DATA_ERROR;
+ prop0 = propsData[0];
+ if (prop0 >= (9 * 5 * 5))
+ return LZMA_RESULT_DATA_ERROR;
+ {
+ for (propsRes->pb = 0; prop0 >= (9 * 5); propsRes->pb++, prop0 -= (9 * 5));
+ for (propsRes->lp = 0; prop0 >= 9; propsRes->lp++, prop0 -= 9);
+ propsRes->lc = prop0;
+ /*
+ unsigned char remainder = (unsigned char)(prop0 / 9);
+ propsRes->lc = prop0 % 9;
+ propsRes->pb = remainder / 5;
+ propsRes->lp = remainder % 5;
+ */
+ }
+
+ {
+ int i;
+ propsRes->DictionarySize = 0;
+ for (i = 0; i < 4; i++)
+ propsRes->DictionarySize += (UInt32)(propsData[1 + i]) << (i * 8);
+ if (propsRes->DictionarySize == 0)
+ propsRes->DictionarySize = 1;
+ return LZMA_RESULT_OK;
+ }
+}
+
+int LzmaDecode(
+ CLzmaDecoderState *vs,
+ const unsigned char *inStream, SizeT inSize, SizeT *inSizeProcessed,
+ unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed,
+ int finishDecoding)
+{
+ UInt32 Range = vs->Range;
+ UInt32 Code = vs->Code;
+
+ unsigned char *Buffer = vs->Buffer;
+ int BufferSize = vs->BufferSize; /* don't change it to unsigned int */
+ CProb *p = vs->Probs;
+
+ int state = vs->State;
+ unsigned char previousByte;
+ UInt32 rep0 = vs->Reps[0], rep1 = vs->Reps[1], rep2 = vs->Reps[2], rep3 = vs->Reps[3];
+ SizeT nowPos = 0;
+ UInt32 posStateMask = (1 << (vs->Properties.pb)) - 1;
+ UInt32 literalPosMask = (1 << (vs->Properties.lp)) - 1;
+ int lc = vs->Properties.lc;
+ int len = vs->RemainLen;
+ UInt32 globalPos = vs->GlobalPos;
+ UInt32 distanceLimit = vs->DistanceLimit;
+
+ unsigned char *dictionary = vs->Dictionary;
+ UInt32 dictionarySize = vs->Properties.DictionarySize;
+ UInt32 dictionaryPos = vs->DictionaryPos;
+
+ unsigned char tempDictionary[4];
+
+ (*inSizeProcessed) = 0;
+ (*outSizeProcessed) = 0;
+ if (len == kLzmaStreamWasFinishedId)
+ return LZMA_RESULT_OK;
+
+ if (dictionarySize == 0)
+ {
+ dictionary = tempDictionary;
+ dictionarySize = 1;
+ tempDictionary[0] = vs->TempDictionary[0];
+ }
+
+ if (len == kLzmaNeedInitId)
+ {
+ while (inSize > 0 && BufferSize < kLzmaInBufferSize)
+ {
+ Buffer[BufferSize++] = *inStream++;
+ (*inSizeProcessed)++;
+ inSize--;
+ }
+ if (BufferSize < 5)
+ {
+ vs->BufferSize = BufferSize;
+ return finishDecoding ? LZMA_RESULT_DATA_ERROR : LZMA_RESULT_OK;
+ }
+ {
+ UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp));
+ UInt32 i;
+ for (i = 0; i < numProbs; i++)
+ p[i] = kBitModelTotal >> 1;
+ rep0 = rep1 = rep2 = rep3 = 1;
+ state = 0;
+ globalPos = 0;
+ distanceLimit = 0;
+ dictionaryPos = 0;
+ dictionary[dictionarySize - 1] = 0;
+ RC_INIT;
+ }
+ len = 0;
+ }
+ while(len != 0 && nowPos < outSize)
+ {
+ UInt32 pos = dictionaryPos - rep0;
+ if (pos >= dictionarySize)
+ pos += dictionarySize;
+ outStream[nowPos++] = dictionary[dictionaryPos] = dictionary[pos];
+ if (++dictionaryPos == dictionarySize)
+ dictionaryPos = 0;
+ len--;
+ }
+ if (dictionaryPos == 0)
+ previousByte = dictionary[dictionarySize - 1];
+ else
+ previousByte = dictionary[dictionaryPos - 1];
+
+ while(1)
+ {
+ int bufferPos = (int)(Buffer - vs->Buffer);
+ if (BufferSize - bufferPos < kRequiredInBufferSize)
+ {
+ int i;
+ BufferSize -= bufferPos;
+ if (BufferSize < 0)
+ return LZMA_RESULT_DATA_ERROR;
+ for (i = 0; i < BufferSize; i++)
+ vs->Buffer[i] = Buffer[i];
+ Buffer = vs->Buffer;
+ while (inSize > 0 && BufferSize < kLzmaInBufferSize)
+ {
+ Buffer[BufferSize++] = *inStream++;
+ (*inSizeProcessed)++;
+ inSize--;
+ }
+ if (BufferSize < kRequiredInBufferSize && !finishDecoding)
+ break;
+ }
+ if (nowPos >= outSize)
+ break;
+ {
+ CProb *prob;
+ UInt32 bound;
+ int posState = (int)((nowPos + globalPos) & posStateMask);
+
+ prob = p + IsMatch + (state << kNumPosBitsMax) + posState;
+ IfBit0(prob)
+ {
+ int symbol = 1;
+ UpdateBit0(prob)
+ prob = p + Literal + (LZMA_LIT_SIZE *
+ ((((nowPos + globalPos)& literalPosMask) << lc) + (previousByte >> (8 - lc))));
+
+ if (state >= kNumLitStates)
+ {
+ int matchByte;
+ UInt32 pos = dictionaryPos - rep0;
+ if (pos >= dictionarySize)
+ pos += dictionarySize;
+ matchByte = dictionary[pos];
+ do
+ {
+ int bit;
+ CProb *probLit;
+ matchByte <<= 1;
+ bit = (matchByte & 0x100);
+ probLit = prob + 0x100 + bit + symbol;
+ RC_GET_BIT2(probLit, symbol, if (bit != 0) break, if (bit == 0) break)
+ }
+ while (symbol < 0x100);
+ }
+ while (symbol < 0x100)
+ {
+ CProb *probLit = prob + symbol;
+ RC_GET_BIT(probLit, symbol)
+ }
+ previousByte = (unsigned char)symbol;
+
+ outStream[nowPos++] = previousByte;
+ if (distanceLimit < dictionarySize)
+ distanceLimit++;
+
+ dictionary[dictionaryPos] = previousByte;
+ if (++dictionaryPos == dictionarySize)
+ dictionaryPos = 0;
+ if (state < 4) state = 0;
+ else if (state < 10) state -= 3;
+ else state -= 6;
+ }
+ else
+ {
+ UpdateBit1(prob);
+ prob = p + IsRep + state;
+ IfBit0(prob)
+ {
+ UpdateBit0(prob);
+ rep3 = rep2;
+ rep2 = rep1;
+ rep1 = rep0;
+ state = state < kNumLitStates ? 0 : 3;
+ prob = p + LenCoder;
+ }
+ else
+ {
+ UpdateBit1(prob);
+ prob = p + IsRepG0 + state;
+ IfBit0(prob)
+ {
+ UpdateBit0(prob);
+ prob = p + IsRep0Long + (state << kNumPosBitsMax) + posState;
+ IfBit0(prob)
+ {
+ UInt32 pos;
+ UpdateBit0(prob);
+ if (distanceLimit == 0)
+ return LZMA_RESULT_DATA_ERROR;
+ if (distanceLimit < dictionarySize)
+ distanceLimit++;
+ state = state < kNumLitStates ? 9 : 11;
+ pos = dictionaryPos - rep0;
+ if (pos >= dictionarySize)
+ pos += dictionarySize;
+ previousByte = dictionary[pos];
+ dictionary[dictionaryPos] = previousByte;
+ if (++dictionaryPos == dictionarySize)
+ dictionaryPos = 0;
+ outStream[nowPos++] = previousByte;
+ continue;
+ }
+ else
+ {
+ UpdateBit1(prob);
+ }
+ }
+ else
+ {
+ UInt32 distance;
+ UpdateBit1(prob);
+ prob = p + IsRepG1 + state;
+ IfBit0(prob)
+ {
+ UpdateBit0(prob);
+ distance = rep1;
+ }
+ else
+ {
+ UpdateBit1(prob);
+ prob = p + IsRepG2 + state;
+ IfBit0(prob)
+ {
+ UpdateBit0(prob);
+ distance = rep2;
+ }
+ else
+ {
+ UpdateBit1(prob);
+ distance = rep3;
+ rep3 = rep2;
+ }
+ rep2 = rep1;
+ }
+ rep1 = rep0;
+ rep0 = distance;
+ }
+ state = state < kNumLitStates ? 8 : 11;
+ prob = p + RepLenCoder;
+ }
+ {
+ int numBits, offset;
+ CProb *probLen = prob + LenChoice;
+ IfBit0(probLen)
+ {
+ UpdateBit0(probLen);
+ probLen = prob + LenLow + (posState << kLenNumLowBits);
+ offset = 0;
+ numBits = kLenNumLowBits;
+ }
+ else
+ {
+ UpdateBit1(probLen);
+ probLen = prob + LenChoice2;
+ IfBit0(probLen)
+ {
+ UpdateBit0(probLen);
+ probLen = prob + LenMid + (posState << kLenNumMidBits);
+ offset = kLenNumLowSymbols;
+ numBits = kLenNumMidBits;
+ }
+ else
+ {
+ UpdateBit1(probLen);
+ probLen = prob + LenHigh;
+ offset = kLenNumLowSymbols + kLenNumMidSymbols;
+ numBits = kLenNumHighBits;
+ }
+ }
+ RangeDecoderBitTreeDecode(probLen, numBits, len);
+ len += offset;
+ }
+
+ if (state < 4)
+ {
+ int posSlot;
+ state += kNumLitStates;
+ prob = p + PosSlot +
+ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
+ kNumPosSlotBits);
+ RangeDecoderBitTreeDecode(prob, kNumPosSlotBits, posSlot);
+ if (posSlot >= kStartPosModelIndex)
+ {
+ int numDirectBits = ((posSlot >> 1) - 1);
+ rep0 = (2 | ((UInt32)posSlot & 1));
+ if (posSlot < kEndPosModelIndex)
+ {
+ rep0 <<= numDirectBits;
+ prob = p + SpecPos + rep0 - posSlot - 1;
+ }
+ else
+ {
+ numDirectBits -= kNumAlignBits;
+ do
+ {
+ RC_NORMALIZE
+ Range >>= 1;
+ rep0 <<= 1;
+ if (Code >= Range)
+ {
+ Code -= Range;
+ rep0 |= 1;
+ }
+ }
+ while (--numDirectBits != 0);
+ prob = p + Align;
+ rep0 <<= kNumAlignBits;
+ numDirectBits = kNumAlignBits;
+ }
+ {
+ int i = 1;
+ int mi = 1;
+ do
+ {
+ CProb *prob3 = prob + mi;
+ RC_GET_BIT2(prob3, mi, ; , rep0 |= i);
+ i <<= 1;
+ }
+ while(--numDirectBits != 0);
+ }
+ }
+ else
+ rep0 = posSlot;
+ if (++rep0 == (UInt32)(0))
+ {
+ /* it's for stream version */
+ len = kLzmaStreamWasFinishedId;
+ break;
+ }
+ }
+
+ len += kMatchMinLen;
+ if (rep0 > distanceLimit)
+ return LZMA_RESULT_DATA_ERROR;
+ if (dictionarySize - distanceLimit > (UInt32)len)
+ distanceLimit += len;
+ else
+ distanceLimit = dictionarySize;
+
+ do
+ {
+ UInt32 pos = dictionaryPos - rep0;
+ if (pos >= dictionarySize)
+ pos += dictionarySize;
+ previousByte = dictionary[pos];
+ dictionary[dictionaryPos] = previousByte;
+ if (++dictionaryPos == dictionarySize)
+ dictionaryPos = 0;
+ len--;
+ outStream[nowPos++] = previousByte;
+ }
+ while(len != 0 && nowPos < outSize);
+ }
+ }
+ }
+ RC_NORMALIZE;
+
+ BufferSize -= (int)(Buffer - vs->Buffer);
+ if (BufferSize < 0)
+ return LZMA_RESULT_DATA_ERROR;
+ {
+ int i;
+ for (i = 0; i < BufferSize; i++)
+ vs->Buffer[i] = Buffer[i];
+ }
+ vs->BufferSize = BufferSize;
+ vs->Range = Range;
+ vs->Code = Code;
+ vs->DictionaryPos = dictionaryPos;
+ vs->GlobalPos = (UInt32)(globalPos + nowPos);
+ vs->DistanceLimit = distanceLimit;
+ vs->Reps[0] = rep0;
+ vs->Reps[1] = rep1;
+ vs->Reps[2] = rep2;
+ vs->Reps[3] = rep3;
+ vs->State = state;
+ vs->RemainLen = len;
+ vs->TempDictionary[0] = tempDictionary[0];
+
+ (*outSizeProcessed) = nowPos;
+ return LZMA_RESULT_OK;
+}
diff --git a/cfe/cfe/lzma/LzmaStateDecode.h b/cfe/cfe/lzma/LzmaStateDecode.h
new file mode 100755
index 0000000..26490d6
--- /dev/null
+++ b/cfe/cfe/lzma/LzmaStateDecode.h
@@ -0,0 +1,96 @@
+/*
+ LzmaStateDecode.h
+ LZMA Decoder interface (State version)
+
+ LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01)
+ http://www.7-zip.org/
+
+ LZMA SDK is licensed under two licenses:
+ 1) GNU Lesser General Public License (GNU LGPL)
+ 2) Common Public License (CPL)
+ It means that you can select one of these two licenses and
+ follow rules of that license.
+
+ SPECIAL EXCEPTION:
+ Igor Pavlov, as the author of this code, expressly permits you to
+ statically or dynamically link your code (or bind by name) to the
+ interfaces of this file without subjecting your linked code to the
+ terms of the CPL or GNU LGPL. Any modifications or additions
+ to this file, however, are subject to the LGPL or CPL terms.
+*/
+
+#ifndef __LZMASTATEDECODE_H
+#define __LZMASTATEDECODE_H
+
+#include "LzmaTypes.h"
+
+/* #define _LZMA_PROB32 */
+/* It can increase speed on some 32-bit CPUs,
+ but memory usage will be doubled in that case */
+
+#ifdef _LZMA_PROB32
+#define CProb UInt32
+#else
+#define CProb UInt16
+#endif
+
+#define LZMA_RESULT_OK 0
+#define LZMA_RESULT_DATA_ERROR 1
+
+#define LZMA_BASE_SIZE 1846
+#define LZMA_LIT_SIZE 768
+
+#define LZMA_PROPERTIES_SIZE 5
+
+typedef struct _CLzmaProperties
+{
+ int lc;
+ int lp;
+ int pb;
+ UInt32 DictionarySize;
+}CLzmaProperties;
+
+int LzmaDecodeProperties(CLzmaProperties *propsRes, const unsigned char *propsData, int size);
+
+#define LzmaGetNumProbs(lzmaProps) (LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((lzmaProps)->lc + (lzmaProps)->lp)))
+
+#define kLzmaInBufferSize 64 /* don't change it. it must be larger than kRequiredInBufferSize */
+
+#define kLzmaNeedInitId (-2)
+
+typedef struct _CLzmaDecoderState
+{
+ CLzmaProperties Properties;
+ CProb *Probs;
+ unsigned char *Dictionary;
+
+ unsigned char Buffer[kLzmaInBufferSize];
+ int BufferSize;
+
+ UInt32 Range;
+ UInt32 Code;
+ UInt32 DictionaryPos;
+ UInt32 GlobalPos;
+ UInt32 DistanceLimit;
+ UInt32 Reps[4];
+ int State;
+ int RemainLen; /* -2: decoder needs internal initialization
+ -1: stream was finished,
+ 0: ok
+ > 0: need to write RemainLen bytes as match Reps[0],
+ */
+ unsigned char TempDictionary[4]; /* it's required when DictionarySize = 0 */
+} CLzmaDecoderState;
+
+#define LzmaDecoderInit(vs) { (vs)->RemainLen = kLzmaNeedInitId; (vs)->BufferSize = 0; }
+
+/* LzmaDecode: decoding from input stream to output stream.
+ If finishDecoding != 0, then there are no more bytes in input stream
+ after inStream[inSize - 1]. */
+
+int LzmaDecode(CLzmaDecoderState *vs,
+ const unsigned char *inStream, SizeT inSize, SizeT *inSizeProcessed,
+ unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed,
+ int finishDecoding);
+
+#endif
diff --git a/cfe/cfe/lzma/LzmaStateTest.c b/cfe/cfe/lzma/LzmaStateTest.c
new file mode 100755
index 0000000..5df4e43
--- /dev/null
+++ b/cfe/cfe/lzma/LzmaStateTest.c
@@ -0,0 +1,195 @@
+/*
+LzmaStateTest.c
+Test application for LZMA Decoder (State version)
+
+This file written and distributed to public domain by Igor Pavlov.
+This file is part of LZMA SDK 4.26 (2005-08-02)
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "LzmaStateDecode.h"
+
+const char *kCantReadMessage = "Can not read input file";
+const char *kCantWriteMessage = "Can not write output file";
+const char *kCantAllocateMessage = "Can not allocate memory";
+
+#define kInBufferSize (1 << 15)
+#define kOutBufferSize (1 << 15)
+
+unsigned char g_InBuffer[kInBufferSize];
+unsigned char g_OutBuffer[kOutBufferSize];
+
+size_t MyReadFile(FILE *file, void *data, size_t size)
+ { return fread(data, 1, size, file); }
+
+int MyReadFileAndCheck(FILE *file, void *data, size_t size)
+ { return (MyReadFile(file, data, size) == size); }
+
+int PrintError(char *buffer, const char *message)
+{
+ sprintf(buffer + strlen(buffer), "\nError: ");
+ sprintf(buffer + strlen(buffer), message);
+ return 1;
+}
+
+int main3(FILE *inFile, FILE *outFile, char *rs)
+{
+ /* We use two 32-bit integers to construct 64-bit integer for file size.
+ You can remove outSizeHigh, if you don't need >= 4GB supporting,
+ or you can use UInt64 outSize, if your compiler supports 64-bit integers*/
+ UInt32 outSize = 0;
+ UInt32 outSizeHigh = 0;
+
+ int waitEOS = 1;
+ /* waitEOS = 1, if there is no uncompressed size in headers,
+ so decoder will wait EOS (End of Stream Marker) in compressed stream */
+
+ int i;
+ int res = 0;
+ CLzmaDecoderState state; /* it's about 140 bytes structure, if int is 32-bit */
+ unsigned char properties[LZMA_PROPERTIES_SIZE];
+ SizeT inAvail = 0;
+ unsigned char *inBuffer = 0;
+
+ if (sizeof(UInt32) < 4)
+ return PrintError(rs, "LZMA decoder needs correct UInt32");
+
+ /* Read LZMA properties for compressed stream */
+
+ if (!MyReadFileAndCheck(inFile, properties, sizeof(properties)))
+ return PrintError(rs, kCantReadMessage);
+
+ /* Read uncompressed size */
+
+ for (i = 0; i < 8; i++)
+ {
+ unsigned char b;
+ if (!MyReadFileAndCheck(inFile, &b, 1))
+ return PrintError(rs, kCantReadMessage);
+ if (b != 0xFF)
+ waitEOS = 0;
+ if (i < 4)
+ outSize += (UInt32)(b) << (i * 8);
+ else
+ outSizeHigh += (UInt32)(b) << ((i - 4) * 8);
+ }
+
+ /* Decode LZMA properties and allocate memory */
+
+ if (LzmaDecodeProperties(&state.Properties, properties, LZMA_PROPERTIES_SIZE) != LZMA_RESULT_OK)
+ return PrintError(rs, "Incorrect stream properties");
+ state.Probs = (CProb *)malloc(LzmaGetNumProbs(&state.Properties) * sizeof(CProb));
+ if (state.Probs == 0)
+ return PrintError(rs, kCantAllocateMessage);
+
+ if (state.Properties.DictionarySize == 0)
+ state.Dictionary = 0;
+ else
+ {
+ state.Dictionary = (unsigned char *)malloc(state.Properties.DictionarySize);
+ if (state.Dictionary == 0)
+ {
+ free(state.Probs);
+ return PrintError(rs, kCantAllocateMessage);
+ }
+ }
+
+ /* Decompress */
+
+ LzmaDecoderInit(&state);
+
+ do
+ {
+ SizeT inProcessed, outProcessed;
+ int finishDecoding;
+ UInt32 outAvail = kOutBufferSize;
+ if (!waitEOS && outSizeHigh == 0 && outAvail > outSize)
+ outAvail = outSize;
+ if (inAvail == 0)
+ {
+ inAvail = (SizeT)MyReadFile(inFile, g_InBuffer, kInBufferSize);
+ inBuffer = g_InBuffer;
+ }
+ finishDecoding = (inAvail == 0);
+ res = LzmaDecode(&state,
+ inBuffer, inAvail, &inProcessed,
+ g_OutBuffer, outAvail, &outProcessed,
+ finishDecoding);
+ if (res != 0)
+ {
+ sprintf(rs + strlen(rs), "\nDecoding error = %d\n", res);
+ res = 1;
+ break;
+ }
+ inAvail -= inProcessed;
+ inBuffer += inProcessed;
+
+ if (outFile != 0)
+ if (fwrite(g_OutBuffer, 1, outProcessed, outFile) != outProcessed)
+ {
+ PrintError(rs, kCantWriteMessage);
+ res = 1;
+ break;
+ }
+
+ if (outSize < outProcessed)
+ outSizeHigh--;
+ outSize -= (UInt32)outProcessed;
+ outSize &= 0xFFFFFFFF;
+
+ if (outProcessed == 0 && finishDecoding)
+ {
+ if (!waitEOS && (outSize != 0 || outSizeHigh != 0))
+ res = 1;
+ break;
+ }
+ }
+ while ((outSize != 0 && outSizeHigh == 0) || outSizeHigh != 0 || waitEOS);
+
+ free(state.Dictionary);
+ free(state.Probs);
+ return res;
+}
+
+int main2(int numArgs, const char *args[], char *rs)
+{
+ FILE *inFile = 0;
+ FILE *outFile = 0;
+ int res;
+
+ sprintf(rs + strlen(rs), "\nLZMA Decoder 4.26 Copyright (c) 1999-2005 Igor Pavlov 2005-08-02\n");
+ if (numArgs < 2 || numArgs > 3)
+ {
+ sprintf(rs + strlen(rs), "\nUsage: lzmadec file.lzma [outFile]\n");
+ return 1;
+ }
+
+ inFile = fopen(args[1], "rb");
+ if (inFile == 0)
+ return PrintError(rs, "Can not open input file");
+
+ if (numArgs > 2)
+ {
+ outFile = fopen(args[2], "wb+");
+ if (outFile == 0)
+ return PrintError(rs, "Can not open output file");
+ }
+
+ res = main3(inFile, outFile, rs);
+
+ if (outFile != 0)
+ fclose(outFile);
+ fclose(inFile);
+ return res;
+}
+
+int main(int numArgs, const char *args[])
+{
+ char rs[800] = { 0 };
+ int res = main2(numArgs, args, rs);
+ printf(rs);
+ return res;
+}
diff --git a/cfe/cfe/lzma/LzmaTest.c b/cfe/cfe/lzma/LzmaTest.c
new file mode 100755
index 0000000..f95a753
--- /dev/null
+++ b/cfe/cfe/lzma/LzmaTest.c
@@ -0,0 +1,342 @@
+/*
+LzmaTest.c
+Test application for LZMA Decoder
+
+This file written and distributed to public domain by Igor Pavlov.
+This file is part of LZMA SDK 4.26 (2005-08-05)
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "LzmaDecode.h"
+
+const char *kCantReadMessage = "Can not read input file";
+const char *kCantWriteMessage = "Can not write output file";
+const char *kCantAllocateMessage = "Can not allocate memory";
+
+size_t MyReadFile(FILE *file, void *data, size_t size)
+{
+ if (size == 0)
+ return 0;
+ return fread(data, 1, size, file);
+}
+
+int MyReadFileAndCheck(FILE *file, void *data, size_t size)
+ { return (MyReadFile(file, data, size) == size);}
+
+size_t MyWriteFile(FILE *file, const void *data, size_t size)
+{
+ if (size == 0)
+ return 0;
+ return fwrite(data, 1, size, file);
+}
+
+int MyWriteFileAndCheck(FILE *file, const void *data, size_t size)
+ { return (MyWriteFile(file, data, size) == size); }
+
+#ifdef _LZMA_IN_CB
+#define kInBufferSize (1 << 15)
+typedef struct _CBuffer
+{
+ ILzmaInCallback InCallback;
+ FILE *File;
+ unsigned char Buffer[kInBufferSize];
+} CBuffer;
+
+int LzmaReadCompressed(void *object, const unsigned char **buffer, SizeT *size)
+{
+ CBuffer *b = (CBuffer *)object;
+ *buffer = b->Buffer;
+ *size = (SizeT)MyReadFile(b->File, b->Buffer, kInBufferSize);
+ return LZMA_RESULT_OK;
+}
+CBuffer g_InBuffer;
+
+#endif
+
+#ifdef _LZMA_OUT_READ
+#define kOutBufferSize (1 << 15)
+unsigned char g_OutBuffer[kOutBufferSize];
+#endif
+
+int PrintError(char *buffer, const char *message)
+{
+ sprintf(buffer + strlen(buffer), "\nError: ");
+ sprintf(buffer + strlen(buffer), message);
+ return 1;
+}
+
+int main3(FILE *inFile, FILE *outFile, char *rs)
+{
+ /* We use two 32-bit integers to construct 64-bit integer for file size.
+ You can remove outSizeHigh, if you don't need >= 4GB supporting,
+ or you can use UInt64 outSize, if your compiler supports 64-bit integers*/
+ UInt32 outSize = 0;
+ UInt32 outSizeHigh = 0;
+ #ifndef _LZMA_OUT_READ
+ SizeT outSizeFull;
+ unsigned char *outStream;
+ #endif
+
+ int waitEOS = 1;
+ /* waitEOS = 1, if there is no uncompressed size in headers,
+ so decoder will wait EOS (End of Stream Marker) in compressed stream */
+
+ #ifndef _LZMA_IN_CB
+ SizeT compressedSize;
+ unsigned char *inStream;
+ #endif
+
+ CLzmaDecoderState state; /* it's about 24-80 bytes structure, if int is 32-bit */
+ unsigned char properties[LZMA_PROPERTIES_SIZE];
+
+ int res;
+
+ #ifdef _LZMA_IN_CB
+ g_InBuffer.File = inFile;
+ #endif
+
+ if (sizeof(UInt32) < 4)
+ return PrintError(rs, "LZMA decoder needs correct UInt32");
+
+ #ifndef _LZMA_IN_CB
+ {
+ long length;
+ fseek(inFile, 0, SEEK_END);
+ length = ftell(inFile);
+ fseek(inFile, 0, SEEK_SET);
+ if ((long)(SizeT)length != length)
+ return PrintError(rs, "Too big compressed stream");
+ compressedSize = (SizeT)(length - (LZMA_PROPERTIES_SIZE + 8));
+ }
+ #endif
+
+ /* Read LZMA properties for compressed stream */
+
+ if (!MyReadFileAndCheck(inFile, properties, sizeof(properties)))
+ return PrintError(rs, kCantReadMessage);
+
+ /* Read uncompressed size */
+
+ {
+ int i;
+ for (i = 0; i < 8; i++)
+ {
+ unsigned char b;
+ if (!MyReadFileAndCheck(inFile, &b, 1))
+ return PrintError(rs, kCantReadMessage);
+ if (b != 0xFF)
+ waitEOS = 0;
+ if (i < 4)
+ outSize += (UInt32)(b) << (i * 8);
+ else
+ outSizeHigh += (UInt32)(b) << ((i - 4) * 8);
+ }
+
+ #ifndef _LZMA_OUT_READ
+ if (waitEOS)
+ return PrintError(rs, "Stream with EOS marker is not supported");
+ outSizeFull = (SizeT)outSize;
+ if (sizeof(SizeT) >= 8)
+ outSizeFull |= (((SizeT)outSizeHigh << 16) << 16);
+ else if (outSizeHigh != 0 || (UInt32)(SizeT)outSize != outSize)
+ return PrintError(rs, "Too big uncompressed stream");
+ #endif
+ }
+
+ /* Decode LZMA properties and allocate memory */
+
+ if (LzmaDecodeProperties(&state.Properties, properties, LZMA_PROPERTIES_SIZE) != LZMA_RESULT_OK)
+ return PrintError(rs, "Incorrect stream properties");
+ state.Probs = (CProb *)malloc(LzmaGetNumProbs(&state.Properties) * sizeof(CProb));
+
+ #ifdef _LZMA_OUT_READ
+ if (state.Properties.DictionarySize == 0)
+ state.Dictionary = 0;
+ else
+ state.Dictionary = (unsigned char *)malloc(state.Properties.DictionarySize);
+ #else
+ if (outSizeFull == 0)
+ outStream = 0;
+ else
+ outStream = (unsigned char *)malloc(outSizeFull);
+ #endif
+
+ #ifndef _LZMA_IN_CB
+ if (compressedSize == 0)
+ inStream = 0;
+ else
+ inStream = (unsigned char *)malloc(compressedSize);
+ #endif
+
+ if (state.Probs == 0
+ #ifdef _LZMA_OUT_READ
+ || (state.Dictionary == 0 && state.Properties.DictionarySize != 0)
+ #else
+ || (outStream == 0 && outSizeFull != 0)
+ #endif
+ #ifndef _LZMA_IN_CB
+ || (inStream == 0 && compressedSize != 0)
+ #endif
+ )
+ {
+ free(state.Probs);
+ #ifdef _LZMA_OUT_READ
+ free(state.Dictionary);
+ #else
+ free(outStream);
+ #endif
+ #ifndef _LZMA_IN_CB
+ free(inStream);
+ #endif
+ return PrintError(rs, kCantAllocateMessage);
+ }
+
+ /* Decompress */
+
+ #ifdef _LZMA_IN_CB
+ g_InBuffer.InCallback.Read = LzmaReadCompressed;
+ #else
+ if (!MyReadFileAndCheck(inFile, inStream, compressedSize))
+ return PrintError(rs, kCantReadMessage);
+ #endif
+
+ #ifdef _LZMA_OUT_READ
+ {
+ #ifndef _LZMA_IN_CB
+ SizeT inAvail = compressedSize;
+ const unsigned char *inBuffer = inStream;
+ #endif
+ LzmaDecoderInit(&state);
+ do
+ {
+ #ifndef _LZMA_IN_CB
+ SizeT inProcessed;
+ #endif
+ SizeT outProcessed;
+ SizeT outAvail = kOutBufferSize;
+ if (!waitEOS && outSizeHigh == 0 && outAvail > outSize)
+ outAvail = (SizeT)outSize;
+ res = LzmaDecode(&state,
+ #ifdef _LZMA_IN_CB
+ &g_InBuffer.InCallback,
+ #else
+ inBuffer, inAvail, &inProcessed,
+ #endif
+ g_OutBuffer, outAvail, &outProcessed);
+ if (res != 0)
+ {
+ sprintf(rs + strlen(rs), "\nDecoding error = %d\n", res);
+ res = 1;
+ break;
+ }
+ #ifndef _LZMA_IN_CB
+ inAvail -= inProcessed;
+ inBuffer += inProcessed;
+ #endif
+
+ if (outFile != 0)
+ if (!MyWriteFileAndCheck(outFile, g_OutBuffer, (size_t)outProcessed))
+ {
+ PrintError(rs, kCantWriteMessage);
+ res = 1;
+ break;
+ }
+
+ if (outSize < outProcessed)
+ outSizeHigh--;
+ outSize -= (UInt32)outProcessed;
+ outSize &= 0xFFFFFFFF;
+
+ if (outProcessed == 0)
+ {
+ if (!waitEOS && (outSize != 0 || outSizeHigh != 0))
+ res = 1;
+ break;
+ }
+ }
+ while ((outSize != 0 && outSizeHigh == 0) || outSizeHigh != 0 || waitEOS);
+ }
+
+ #else
+ {
+ #ifndef _LZMA_IN_CB
+ SizeT inProcessed;
+ #endif
+ SizeT outProcessed;
+ res = LzmaDecode(&state,
+ #ifdef _LZMA_IN_CB
+ &g_InBuffer.InCallback,
+ #else
+ inStream, compressedSize, &inProcessed,
+ #endif
+ outStream, outSizeFull, &outProcessed);
+ if (res != 0)
+ {
+ sprintf(rs + strlen(rs), "\nDecoding error = %d\n", res);
+ res = 1;
+ }
+ else if (outFile != 0)
+ {
+ if (!MyWriteFileAndCheck(outFile, outStream, (size_t)outProcessed))
+ {
+ PrintError(rs, kCantWriteMessage);
+ res = 1;
+ }
+ }
+ }
+ #endif
+
+ free(state.Probs);
+ #ifdef _LZMA_OUT_READ
+ free(state.Dictionary);
+ #else
+ free(outStream);
+ #endif
+ #ifndef _LZMA_IN_CB
+ free(inStream);
+ #endif
+ return res;
+}
+
+int main2(int numArgs, const char *args[], char *rs)
+{
+ FILE *inFile = 0;
+ FILE *outFile = 0;
+ int res;
+
+ sprintf(rs + strlen(rs), "\nLZMA Decoder 4.26 Copyright (c) 1999-2005 Igor Pavlov 2005-08-05\n");
+ if (numArgs < 2 || numArgs > 3)
+ {
+ sprintf(rs + strlen(rs), "\nUsage: lzmadec file.lzma [outFile]\n");
+ return 1;
+ }
+
+ inFile = fopen(args[1], "rb");
+ if (inFile == 0)
+ return PrintError(rs, "Can not open input file");
+
+ if (numArgs > 2)
+ {
+ outFile = fopen(args[2], "wb+");
+ if (outFile == 0)
+ return PrintError(rs, "Can not open output file");
+ }
+
+ res = main3(inFile, outFile, rs);
+
+ if (outFile != 0)
+ fclose(outFile);
+ fclose(inFile);
+ return res;
+}
+
+int main(int numArgs, const char *args[])
+{
+ char rs[800] = { 0 };
+ int res = main2(numArgs, args, rs);
+ printf(rs);
+ return res;
+}
diff --git a/cfe/cfe/lzma/LzmaTypes.h b/cfe/cfe/lzma/LzmaTypes.h
new file mode 100755
index 0000000..288c5e4
--- /dev/null
+++ b/cfe/cfe/lzma/LzmaTypes.h
@@ -0,0 +1,45 @@
+/*
+LzmaTypes.h
+
+Types for LZMA Decoder
+
+This file written and distributed to public domain by Igor Pavlov.
+This file is part of LZMA SDK 4.40 (2006-05-01)
+*/
+
+#ifndef __LZMATYPES_H
+#define __LZMATYPES_H
+
+#ifndef _7ZIP_BYTE_DEFINED
+#define _7ZIP_BYTE_DEFINED
+typedef unsigned char Byte;
+#endif
+
+#ifndef _7ZIP_UINT16_DEFINED
+#define _7ZIP_UINT16_DEFINED
+typedef unsigned short UInt16;
+#endif
+
+#ifndef _7ZIP_UINT32_DEFINED
+#define _7ZIP_UINT32_DEFINED
+#ifdef _LZMA_UINT32_IS_ULONG
+typedef unsigned long UInt32;
+#else
+typedef unsigned int UInt32;
+#endif
+#endif
+
+/* #define _LZMA_SYSTEM_SIZE_T */
+/* Use system's size_t. You can use it to enable 64-bit sizes supporting */
+
+#ifndef _7ZIP_SIZET_DEFINED
+#define _7ZIP_SIZET_DEFINED
+#ifdef _LZMA_SYSTEM_SIZE_T
+#include <stddef.h>
+typedef size_t SizeT;
+#else
+typedef UInt32 SizeT;
+#endif
+#endif
+
+#endif
diff --git a/cfe/cfe/lzma/Makefile b/cfe/cfe/lzma/Makefile
new file mode 100755
index 0000000..3611459
--- /dev/null
+++ b/cfe/cfe/lzma/Makefile
@@ -0,0 +1,5 @@
+
+BSPOBJS += \
+ dcapi.o \
+ LzmaDecode.o
+
diff --git a/cfe/cfe/lzma/dcapi.c b/cfe/cfe/lzma/dcapi.c
new file mode 100755
index 0000000..b8f59b0
--- /dev/null
+++ b/cfe/cfe/lzma/dcapi.c
@@ -0,0 +1,50 @@
+#include "LzmaDecode.h"
+#include "bcm63xx_util.h"
+#include "lib_malloc.h"
+
+#define LZMA_ORIGSIZE_SIZE 8
+
+int decompressLZMA(unsigned char *in, unsigned insize, unsigned char *out, unsigned outsize);
+
+// Call ANSI C LZMA decoder to decompress a LZMA block
+int decompressLZMA(unsigned char *in, unsigned insize, unsigned char *out, unsigned outsize)
+{
+
+ SizeT inProcessed, outProcessed;
+ unsigned origsize;
+ int ret;
+ CLzmaDecoderState state;
+
+ ret = LzmaDecodeProperties(&state.Properties, in, LZMA_PROPERTIES_SIZE);
+ if (ret != LZMA_RESULT_OK) {
+ return ret;
+ }
+ in += LZMA_PROPERTIES_SIZE;
+
+ state.Probs = (CProb *)KMALLOC(LzmaGetNumProbs(&state.Properties) * sizeof(CProb), 0);
+ if (!state.Probs) {
+ return 1001;
+ }
+
+ if (in[4]==0 && in[5]==0 && in[6]==0 && in[7]==0) { // uncompressed size < 4GB (should be)
+ origsize = in[0] | (in[1] << 8) | (in[2] << 16) | (in[3] << 24);
+ in += LZMA_ORIGSIZE_SIZE;
+ if (origsize <= outsize) {
+ ret = LzmaDecode(&state, in, insize, &inProcessed, out, origsize, &outProcessed);
+ }
+ else {
+ // output buffer too small
+ ret = 1000;
+ }
+ }
+ else { // uncompressed size > 4GB, old lzma format or corrupted image, assume old format here
+ printf("LZMA: Prossible old LZMA format, trying to decompress..\n");
+ LzmaDecode(&state, in, insize, &inProcessed, out, outsize, &outProcessed);
+ ret = 0; // It would return an error code as the output buffer size doesn't match. We need to ignore the code.
+ }
+
+ KFREE(state.Probs);
+
+ return ret;
+}
+
diff --git a/cfe/cfe/main/cfe.mk b/cfe/cfe/main/cfe.mk
new file mode 100644
index 0000000..05b16b6
--- /dev/null
+++ b/cfe/cfe/main/cfe.mk
@@ -0,0 +1,301 @@
+
+#
+# CFE's version number
+#
+
+include ${TOP}/main/cfe_version.mk
+
+#
+# Default values for certain parameters
+#
+
+CFG_MLONG64 ?= 0
+CFG_LITTLE ?= 0
+CFG_RELOC ?= 0
+CFG_UNCACHED ?= 0
+CFG_NEWRELOC ?= 0
+CFG_BOOTRAM ?= 0
+CFG_VGACONSOLE ?= 0
+CFG_PCI ?= 1
+CFG_LDT_REV_017 ?= 0
+CFG_ZLIB ?= 0
+CFG_BIENDIAN ?= 0
+CFG_DOWNLOAD ?= 0
+CFG_RAMAPP ?= 0
+CFG_USB ?= 0
+
+#
+# Paths to other parts of the firmware. Everything's relative to ${TOP}
+# so that you can actually do a build anywhere you want.
+#
+
+ARCH_TOP = ${TOP}/arch/${ARCH}
+ARCH_SRC = ${ARCH_TOP}/common/src
+ARCH_INC = ${ARCH_TOP}/common/include
+CPU_SRC = ${ARCH_TOP}/cpu/${CPU}/src
+CPU_INC = ${ARCH_TOP}/cpu/${CPU}/include
+
+#
+# It's actually optional to have a 'board'
+# directory. If you don't specify BOARD,
+# don't include the files.
+#
+
+ifneq ("$(strip ${BOARD})","")
+BOARD_SRC = ${ARCH_TOP}/board/${BOARD}/src
+BOARD_INC = ${ARCH_TOP}/board/${BOARD}/include
+endif
+
+#
+# Preprocessor defines for CFE's version number
+#
+
+VDEF = -DCFE_VER_MAJ=${CFE_VER_MAJ} -DCFE_VER_MIN=${CFE_VER_MIN} -DCFE_VER_ECO=${CFE_VER_ECO}
+
+#
+# Construct the list of paths that will eventually become the include
+# paths and VPATH
+#
+
+SRCDIRS = ${ARCH_SRC} ${CPU_SRC} ${BOARD_SRC} ${TOP}/main ${TOP}/vendor ${TOP}/include ${TOP}/net ${TOP}/dev ${TOP}/pci ${TOP}/ui ${TOP}/lib ${TOP}/common ${TOP}/verif
+
+CFE_INC = ${TOP}/include ${TOP}/pci ${TOP}/net
+
+ifeq ($(strip ${CFG_VGACONSOLE}),1)
+SRCDIRS += ${TOP}/x86emu ${TOP}/pccons
+CFE_INC += ${TOP}/x86emu ${TOP}/pccons
+endif
+
+ifeq ($(strip ${CFG_VAPI}),1)
+SRCDIRS += ${TOP}/verif
+CFE_INC += ${TOP}/verif
+endif
+
+ifeq ($(strip ${CFG_ZLIB}),1)
+SRCDIRS += ${TOP}/zlib
+CFE_INC += ${TOP}/zlib
+endif
+
+
+INCDIRS = $(patsubst %,-I%,$(subst :, ,$(ARCH_INC) $(CPU_INC) $(BOARD_INC) $(CFE_INC)))
+
+VPATH = $(SRCDIRS)
+
+#
+# Bi-endian support: If we're building the little-endian
+# version, use a different linker script so we can locate the
+# ROM at a higher address. You'd think we could do this with
+# normal linker command line switches, but there appears to be no
+# command-line way to override the 'AT' qualifier in the linker script.
+#
+
+CFG_TEXTAT1MB=0
+ifeq ($(strip ${CFG_BIENDIAN}),1)
+ ifeq ($(strip ${CFG_LITTLE}),1)
+ CFG_TEXTAT1MB=1
+ endif
+endif
+
+
+#
+# Configure tools and basic tools flags. This include sets up
+# macros for calling the C compiler, basic flags,
+# and linker scripts.
+#
+
+include ${ARCH_SRC}/tools.mk
+
+#
+# Add some common flags that are used on any architecture.
+#
+
+CFLAGS += -I. $(INCDIRS)
+CFLAGS += -D_CFE_ ${VDEF} -DCFG_BOARDNAME=\"${CFG_BOARDNAME}\"
+
+#
+# Gross - allow more options to be supplied from command line
+#
+
+ifdef CFG_OPTIONS
+OPTFLAGS = $(patsubst %,-D%,$(subst :, ,$(CFG_OPTIONS)))
+CFLAGS += ${OPTFLAGS}
+endif
+
+
+#
+# This is the makefile's main target. Note that we actually
+# do most of the work in 'ALL' not 'all', since we include
+# other makefiles after this point.
+#
+
+all : build_date.c makereg pcidevs_data2.h ALL
+
+#
+# Macros that expand to the list of arch-independent files
+#
+
+DEVOBJS = dev_flash.o dev_newflash.o dev_null.o dev_promice.o \
+ dev_ide_common.o dev_ns16550.o dev_ds17887clock.o
+LIBOBJS = lib_malloc.o lib_printf.o lib_queue.o lib_string.o lib_string2.o \
+ lib_arena.o lib_misc.o lib_setjmp.o lib_qsort.o lib_hssubr.o lib_physio.o
+NETOBJS = net_ether.o net_arp.o net_ip.o net_udp.o net_api.o net_dns.o \
+ net_dhcp.o net_tftp.o net_icmp.o net_tcp.o net_tcpbuf.o dev_tcpconsole.o
+CFEOBJS = env_subr.o cfe_attach.o cfe_iocb_dispatch.o cfe_devfuncs.o \
+ nvram_subr.o cfe_console.o cfe_main.o cfe_mem.o cfe_timer.o \
+ cfe_background.o cfe_error.o build_date.o \
+ cfe_rawfs.o cfe_zlibfs.o cfe_xreq.o cfe_fatfs.o cfe_httpfs.o cfe_filesys.o cfe_boot.o \
+ cfe_autoboot.o cfe_ldr_elf.o cfe_ldr_raw.o cfe_ldr_srec.o cfe_loader.o url.o \
+ cfe_savedata.o
+UIOBJS = ui_command.o ui_cmddisp.o ui_envcmds.o ui_devcmds.o \
+ ui_netcmds.o ui_tcpcmds.o ui_memcmds.o ui_loadcmds.o ui_pcicmds.o \
+ ui_examcmds.o ui_flash.o ui_misccmds.o \
+ ui_test_disk.o ui_test_ether.o ui_test_flash.o ui_test_uart.o
+
+#
+# Add more object files if we're supporting PCI
+#
+
+ifeq ($(strip ${CFG_PCI}),1)
+PCIOBJS = pciconf.o ldtinit.o pci_subr.o
+PCIOBJS += pci_devs.o
+DEVOBJS += dev_sp1011.o dev_ht7520.o
+DEVOBJS += dev_ide_pci.o dev_ns16550_pci.o
+DEVOBJS += dev_tulip.o dev_dp83815.o
+CFLAGS += -DCFG_PCI=1
+ifeq ($(strip ${CFG_LDT_REV_017}),1)
+CFLAGS += -DCFG_LDT_REV_017=1
+endif
+ifeq ($(strip ${CFG_DOWNLOAD}),1)
+DEVOBJS += dev_bcm1250.o download.data
+CFLAGS += -DCFG_DOWNLOAD=1
+endif
+endif
+
+#
+# If doing bi-endian, add the compiler switch to change
+# the way the vectors are generated. These switches are
+# only added to the big-endian portion of the ROM,
+# which is located at the real boot vector.
+#
+
+ifeq ($(strip ${CFG_BIENDIAN}),1)
+ ifeq ($(strip ${CFG_LITTLE}),0)
+ CFLAGS += -DCFG_BIENDIAN=1
+ endif
+endif
+
+#
+# Include the makefiles for the architecture-common, cpu-specific,
+# and board-specific directories. Each of these will supply
+# some files to "ALLOBJS". The BOARD directory is optional
+# as some ports are so simple they don't need boad-specific stuff.
+#
+
+include ${ARCH_SRC}/Makefile
+include ${CPU_SRC}/Makefile
+
+ifneq ("$(strip ${BOARD})","")
+include ${BOARD_SRC}/Makefile
+endif
+
+#
+# Add the common object files here.
+#
+
+ALLOBJS += $(LIBOBJS) $(DEVOBJS) $(CFEOBJS) $(VENOBJS) $(UIOBJS) $(NETOBJS) $(PCIOBJS)
+
+#
+# VAPI continues to be a special case.
+#
+
+ifeq ($(strip ${CFG_VAPI}),1)
+include ${TOP}/verif/Makefile
+endif
+
+#
+# USB support
+#
+
+ifeq ($(strip ${CFG_USB}),1)
+SRCDIRS += ${TOP}/usb
+CFE_INC += ${TOP}/usb
+include ${TOP}/usb/Makefile
+endif
+
+#
+# If we're doing the VGA console thing, pull in the x86 emulator
+# and the pcconsole subsystem
+#
+
+ifeq ($(strip ${CFG_VGACONSOLE}),1)
+include ${TOP}/x86emu/Makefile
+include ${TOP}/pccons/Makefile
+endif
+
+#
+# If we're including ZLIB, then add its makefile.
+#
+
+ifeq ($(strip ${CFG_ZLIB}),1)
+include ${TOP}/zlib/Makefile
+CFLAGS += -DCFG_ZLIB=1 -DMY_ZCALLOC -DNO_MEMCPY
+endif
+
+#
+# Vendor extensions come next - they live in their own directory.
+#
+
+include ${TOP}/vendor/Makefile
+
+.PHONY : all
+.PHONY : ALL
+.PHONY : build_date.c
+
+#
+# Build the local tools that we use to construct other source files
+#
+
+mkpcidb : ${TOP}/hosttools/mkpcidb.c
+ gcc -o mkpcidb ${TOP}/hosttools/mkpcidb.c
+
+memconfig : ${TOP}/hosttools/memconfig.c
+ gcc -o memconfig -D_MCSTANDALONE_ -D_MCSTANDALONE_NOISY_ -I${TOP}/arch/mips/cpu/sb1250/include ${TOP}/hosttools/memconfig.c ${TOP}/arch/${ARCH}/cpu/${CPU}/src/sb1250_draminit.c
+
+pcidevs_data2.h : mkpcidb ${TOP}/pci/pcidevs_data.h
+ ./mkpcidb > pcidevs_data2.h
+
+mkflashimage : ${TOP}/hosttools/mkflashimage.c
+ gcc -o mkflashimage -I${TOP}/include ${TOP}/hosttools/mkflashimage.c
+
+pci_subr.o : ${TOP}/pci/pci_subr.c pcidevs_data2.h
+
+build_date.c :
+ echo "const char *builddate = \"`date`\";" > build_date.c
+ echo "const char *builduser = \"`whoami`@`hostname`\";" >> build_date.c
+
+#
+# Make a define for the board name
+#
+
+CFLAGS += -D_$(patsubst "%",%,${CFG_BOARDNAME})_
+
+LIBCFE = libcfe.a
+
+%.o : %.c
+ $(GCC) $(CFLAGS) -o $@ $<
+
+%.o : %.S
+ $(GCC) $(CFLAGS) -o $@ $<
+
+#
+# This rule constructs "libcfe.a" which contains most of the object
+# files.
+#
+
+$(LIBCFE) : $(ALLOBJS)
+ rm -f $(LIBCFE)
+ $(AR) cr $(LIBCFE) $(ALLOBJS)
+ $(RANLIB) $(LIBCFE)
+
+
+
diff --git a/cfe/cfe/main/cfe_attach.c b/cfe/cfe/main/cfe_attach.c
new file mode 100644
index 0000000..1235d6e
--- /dev/null
+++ b/cfe/cfe/main/cfe_attach.c
@@ -0,0 +1,265 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Device Attach routines File: cfe_attach.c
+ *
+ * This module manages the list of device drivers. When a driver
+ * is probed, it can call cfe_attach to create actual device
+ * instances. The routines in this module manage the
+ * device list and the assignment of device names.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_queue.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define CFE_MAX_DEVINST 64 /* max # of instances of devices */
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+/*
+ * Our device list.
+ */
+
+queue_t cfe_devices = {&cfe_devices, &cfe_devices};
+
+/* *********************************************************************
+ * cfe_finddev(name)
+ *
+ * Locate a device in the device list by its name and return
+ * a pointer to the device structure.
+ *
+ * Input parameters:
+ * name - name of device, e.g., "uart0"
+ *
+ * Return value:
+ * cfe_device_t pointer or NULL
+ ********************************************************************* */
+
+cfe_device_t *cfe_finddev(char *name)
+{
+ queue_t *qb;
+ cfe_device_t *dev;
+
+ for (qb = cfe_devices.q_next; qb != &cfe_devices; qb = qb->q_next) {
+ dev = (cfe_device_t *) qb;
+ if (strcmp(dev->dev_fullname,name) == 0) {
+ return dev;
+ }
+ }
+
+ return NULL;
+}
+
+
+/* *********************************************************************
+ * cfe_device_reset()
+ *
+ * Call all the "reset" methods in the devices on the device
+ * list. Note that the methods get called even when the
+ * devices are closed!
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void cfe_device_reset(void)
+{
+ queue_t *qb;
+ cfe_device_t *dev;
+
+ for (qb = cfe_devices.q_next; qb != &cfe_devices; qb = qb->q_next) {
+ dev = (cfe_device_t *) qb;
+ if (dev->dev_dispatch->dev_reset) {
+ (*(dev->dev_dispatch->dev_reset))(dev->dev_softc);
+ }
+ }
+}
+
+/* *********************************************************************
+ * cfe_attach_idx(drv,idx,softc,bootinfo,description)
+ *
+ * Add a device to the device list at a specific index. This
+ * is mainly used for devices like SCSI disks or CD-ROMs so
+ * we can use an index that matches the target ID or LUN.
+ *
+ * Input parameters:
+ * drv - driver structure (from the device driver module)
+ * idx - requested index (e.g., uartn where 'n' is the idx)
+ * softc - Unique information maintained for this device
+ * bootinfo - suffix for long form of the device name. For
+ * example, scsi0.3.1 might mean SCSI controller
+ * 0, device ID 3, LUN 1. The bootinfo would be
+ * "3.1"
+ * description - something nice to say for the devices command
+ *
+ * Return value:
+ * 0 if device has already been added at this index
+ * <0 for other problems
+ * 1 if we were successful.
+ ********************************************************************* */
+
+int cfe_attach_idx(cfe_driver_t *drv,int idx,void *softc,
+ char *bootinfo,char *description)
+{
+ char name[64];
+ cfe_device_t *dev;
+
+ xsprintf(name,"%s%d",drv->drv_bootname,idx);
+
+ if (bootinfo) {
+ strcat(name,".");
+ strcat(name,bootinfo);
+ }
+
+ if (cfe_finddev(name) != NULL) {
+ return 0;
+ }
+
+ dev = (cfe_device_t *) KMALLOC(sizeof(cfe_device_t),0);
+ if (!dev) return -1;
+
+ dev->dev_fullname = strdup(name);
+ dev->dev_softc = softc;
+ dev->dev_class = drv->drv_class;
+ dev->dev_dispatch = drv->drv_dispatch;
+ dev->dev_description = description ? strdup(description) : NULL;
+ dev->dev_opencount = 0;
+
+ q_enqueue(&cfe_devices,(queue_t *) dev);
+
+ return 1;
+
+}
+
+
+
+/* *********************************************************************
+ * cfe_attach(drv,softc,bootinfo,description
+ *
+ * Add a device to the system. This is a callback from the
+ * probe routine, and is used to actually add devices to CFE's
+ * device list.
+ *
+ * Input parameters:
+ * drv - driver structure (from the device driver module)
+ * softc - Unique information maintained for this device
+ * bootinfo - suffix for long form of the device name. For
+ * example, scsi0.3.1 might mean SCSI controller
+ * 0, device ID 3, LUN 1. The bootinfo would be
+ * "3.1"
+ * description - something nice to say for the devices command
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void cfe_attach(cfe_driver_t *drv,void *softc,
+ char *bootinfo,
+ char *description)
+{
+ int idx;
+ int res;
+
+ /*
+ * Try device indicies 0..CFE_MAX_DEVINST to assign a unique
+ * device name for this device. This is a really braindead way to
+ * do this, but how many devices are we expecting anyway?
+ */
+
+ for (idx = 0; idx < CFE_MAX_DEVINST; idx++) {
+
+ res = cfe_attach_idx(drv,idx,softc,bootinfo,description);
+
+ if (res < 0) break; /* out of memory or other badness */
+ if (res > 0) break; /* success! */
+ /* otherwise, try again, slot is taken */
+ }
+
+}
+
+/* *********************************************************************
+ * cfe_attach_init()
+ *
+ * Initialize this module.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+void cfe_attach_init(void)
+{
+ q_init(&(cfe_devices));
+}
+
+
+/* *********************************************************************
+ * cfe_device_name(ctx)
+ *
+ * Given a device context, return a device name
+ *
+ * Input parameters:
+ * ctx - context
+ *
+ * Return value:
+ * name
+ ********************************************************************* */
+
+char *cfe_device_name(cfe_devctx_t *ctx)
+{
+ return ctx->dev_dev->dev_fullname;
+}
diff --git a/cfe/cfe/main/cfe_autoboot.c b/cfe/cfe/main/cfe_autoboot.c
new file mode 100644
index 0000000..14f3d3c
--- /dev/null
+++ b/cfe/cfe/main/cfe_autoboot.c
@@ -0,0 +1,456 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Automatic OS bootstrap File: cfe_autoboot.c
+ *
+ * This module handles OS bootstrap stuff. We use this version
+ * to do "automatic" booting; walking down a list of possible boot
+ * options, trying them until something good happens.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "cfe_devfuncs.h"
+#include "cfe_timer.h"
+
+#include "cfe_error.h"
+
+#include "env_subr.h"
+#include "cfe.h"
+
+#include "net_ebuf.h"
+#include "net_ether.h"
+
+#include "net_api.h"
+#include "cfe_fileops.h"
+#include "cfe_bootblock.h"
+#include "bsp_config.h"
+#include "cfe_boot.h"
+
+#include "cfe_loader.h"
+
+#include "cfe_autoboot.h"
+
+/* *********************************************************************
+ * data
+ ********************************************************************* */
+
+queue_t cfe_autoboot_list = {&cfe_autoboot_list,&cfe_autoboot_list};
+
+extern cfe_loadargs_t cfe_loadargs; /* from cfe_boot.c */
+extern const char *bootvar_device;
+extern const char *bootvar_file;
+extern const char *bootvar_flags;
+
+extern char *varchars;
+
+/* *********************************************************************
+ * macroexpand(instr,outstr)
+ *
+ * Expand environment variables in "instr" to "outstr"
+ *
+ * Input parameters:
+ * instr - to be expanded
+ * outstr - expanded.
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void macroexpand(char *instr,char *outstr)
+{
+ char macroname[50];
+ char *m;
+
+ while (*instr) {
+ if (*instr == '$') {
+ instr++;
+ m = macroname;
+ while (*instr && strchr(varchars,*instr)) {
+ *m++ = *instr++;
+ }
+ *m = '\0';
+ m = env_getenv(macroname);
+ if (m) {
+ while (*m) *outstr++ = *m++;
+ }
+ }
+ else {
+ *outstr++ = *instr++;
+ }
+ }
+
+ *outstr = '\0';
+}
+
+/* *********************************************************************
+ * cfe_tryauto_common(method,loadargs)
+ *
+ * Common portion of autoboot
+ *
+ * Input parameters:
+ * method - details on device to boot from
+ * filename - canonical name of file to load
+ * loadargs - cfe_loadargs_t of digested load parameters.
+ *
+ * Return value:
+ * does not return if successful
+ ********************************************************************* */
+
+static int cfe_tryauto_common(cfe_autoboot_method_t *method,
+ char *filename,
+ cfe_loadargs_t *la)
+{
+ int res;
+
+ la->la_filename = filename;
+ la->la_options = env_getenv(bootvar_flags);
+ la->la_filesys = method->ab_filesys;
+ la->la_device = method->ab_dev;
+ la->la_flags = method->ab_flags | LOADFLG_NOISY | LOADFLG_EXECUTE;
+ la->la_address = 0;
+ la->la_maxsize = 0;
+ la->la_entrypt = 0;
+
+ /* okay, go for it. */
+
+ xprintf("Loader:%s Filesys:%s Dev:%s File:%s Options:%s\n",
+ method->ab_loader,la->la_filesys,la->la_device,la->la_filename,la->la_options);
+
+ res = cfe_boot(method->ab_loader,&cfe_loadargs);
+
+ return res;
+
+}
+
+
+/* *********************************************************************
+ * cfe_tryauto_network(method)
+ *
+ * Try to autoboot from a network device.
+ *
+ * Input parameters:
+ * method - details on device to boot from
+ *
+ * Return value:
+ * does not return unless there is an error
+ ********************************************************************* */
+
+#if CFG_NETWORK
+static int cfe_tryauto_network(cfe_autoboot_method_t *method)
+{
+ int res;
+ dhcpreply_t *reply = NULL;
+ cfe_loadargs_t *la = &cfe_loadargs;
+ char buffer[512];
+ char *x;
+
+ /*
+ * First turn off any network interface that is currently active.
+ */
+
+ net_uninit();
+
+ /*
+ * Now activate the network hardware.
+ */
+
+ res = net_init(method->ab_dev);
+ if (res < 0) {
+ printf("Could not initialize network device %s: %s\n",
+ method->ab_dev,
+ cfe_errortext(res));
+ return res;
+ }
+
+ /*
+ * Do a DHCP query.
+ */
+
+ res = dhcp_bootrequest(&reply);
+ if (res < 0) {
+ printf("DHCP request failed on device %s: %s\n",method->ab_dev,
+ cfe_errortext(res));
+ net_uninit();
+ return res;
+ }
+
+ net_setparam(NET_IPADDR,reply->dr_ipaddr);
+ net_setparam(NET_NETMASK,reply->dr_netmask);
+ net_setparam(NET_GATEWAY,reply->dr_gateway);
+ net_setparam(NET_NAMESERVER,reply->dr_nameserver);
+ net_setparam(NET_DOMAIN,reply->dr_domainname);
+
+ /* Set all our environment variables. */
+ net_setnetvars();
+ dhcp_set_envvars(reply);
+
+ if (reply) dhcp_free_reply(reply);
+
+ /*
+ * Interface is now configured and ready, we can
+ * load programs now.
+ */
+
+ /*
+ * Construct the file name to load. If the method does not
+ * specify a file name directly, get it from DHCP.
+ *
+ * For network booting, the format of the file name
+ * is 'hostname:filename'
+ *
+ * If the method's filename includes a hostname, ignore
+ * BOOT_SERVER. Otherwise, combine BOOT_SERVER with the
+ * filename. This way we can provide the name here
+ * but have the file come off the server specified in the
+ * DHCP message.
+ */
+
+ if (method->ab_file && strchr(method->ab_file,':')) {
+ macroexpand(method->ab_file,buffer);
+ }
+ else {
+ buffer[0] = '\0';
+ x = env_getenv("BOOT_SERVER");
+ if (x) {
+ strcat(buffer,x);
+ strcat(buffer,":");
+ }
+
+ x = method->ab_file;
+ if (!x) x = env_getenv(bootvar_file);
+ if (x) {
+ strcat(buffer,x);
+ }
+ }
+
+ /* Okay, do it. */
+
+ cfe_tryauto_common(method,buffer,la);
+
+ /* If we get here, something bad happened. */
+
+ net_uninit();
+
+ return res;
+
+}
+
+#endif
+
+
+/* *********************************************************************
+ * cfe_tryauto_disk(method)
+ *
+ * Try to autoboot from a disk device.
+ *
+ * Input parameters:
+ * method - details on device to boot from
+ *
+ * Return value:
+ * does not return unless there is an error
+ ********************************************************************* */
+static int cfe_tryauto_disk(cfe_autoboot_method_t *method)
+{
+ int res;
+ cfe_loadargs_t *la = &cfe_loadargs;
+ char buffer[512];
+ char *filename;
+
+ buffer[0] = '\0';
+
+ if (method->ab_file) {
+ macroexpand(method->ab_file,buffer);
+ filename = buffer;
+ }
+ else {
+ filename = env_getenv("BOOT_FILE");
+ if (filename) strcpy(buffer,filename);
+ }
+
+ res = cfe_tryauto_common(method,filename,la);
+
+ return res;
+}
+
+/* *********************************************************************
+ * cfe_tryauto(method)
+ *
+ * Try a single autoboot method.
+ *
+ * Input parameters:
+ * method - autoboot method to try
+ *
+ * Return value:
+ * does not return if bootstrap is successful
+ * else error code
+ ********************************************************************* */
+
+static int cfe_tryauto(cfe_autoboot_method_t *method)
+{
+ switch (method->ab_type) {
+#if CFG_NETWORK
+ case CFE_AUTOBOOT_NETWORK:
+ return cfe_tryauto_network(method);
+ break;
+#endif
+
+ case CFE_AUTOBOOT_DISK:
+ case CFE_AUTOBOOT_RAW:
+ return cfe_tryauto_disk(method);
+ break;
+ }
+
+ return -1;
+}
+
+/* *********************************************************************
+ * cfe_autoboot(dev,flags)
+ *
+ * Try to perform an automatic system bootstrap
+ *
+ * Input parameters:
+ * dev - if not NULL, restrict bootstrap to named device
+ * flags - controls behaviour of cfe_autoboot
+ *
+ * Return value:
+ * should not return if bootstrap is successful, otherwise
+ * error code
+ ********************************************************************* */
+int cfe_autoboot(char *dev,int flags)
+{
+ queue_t *qb;
+ cfe_autoboot_method_t *method;
+ int res;
+ cfe_timer_t timer;
+ int forever;
+ int pollconsole;
+
+ forever = (flags & CFE_AUTOFLG_TRYFOREVER) ? 1 : 0;
+ pollconsole = (flags & CFE_AUTOFLG_POLLCONSOLE) ? 1 : 0;
+
+ do { /* potentially forever */
+ for (qb = cfe_autoboot_list.q_next; qb != &cfe_autoboot_list; qb = qb->q_next) {
+
+ method = (cfe_autoboot_method_t *) qb;
+
+ /*
+ * Skip other devices if we passed in a specific one.
+ */
+
+ if (dev && (strcmp(dev,method->ab_dev) != 0)) continue;
+
+ printf("\n*** Autoboot: Trying device '%s' ", method->ab_dev);
+ if (method->ab_file) printf("file %s ",method->ab_file);
+ printf("(%s,%s)\n\n",method->ab_dev,method->ab_filesys,method->ab_loader);
+
+ /*
+ * Scan keyboard if requested.
+ */
+ if (pollconsole) {
+ TIMER_SET(timer,CFE_HZ);
+ while (!TIMER_EXPIRED(timer)) {
+ POLL();
+ if (console_status()) goto done;
+ }
+ }
+
+ /*
+ * Try something. may not return.
+ */
+
+ res = cfe_tryauto(method);
+ }
+ } while (forever);
+
+ /* bail. */
+done:
+
+ printf("\n*** Autoboot failed.\n\n");
+
+ return -1;
+}
+
+
+/* *********************************************************************
+ * cfe_add_autoboot(type,flags,dev,loader,filesys,file)
+ *
+ * Add an autoboot method to the table.
+ * This is typically called in the board_finalinit one or more
+ * times to provide a list of bootstrap methods to try for autoboot
+ *
+ * Input parameters:
+ * type - CFE_AUTOBOOT_xxx (disk,network,raw)
+ * flags - loader flags (LOADFLG_xxx)
+ * loader - loader string (elf, raw, srec)
+ * filesys - file system string (raw, tftp, fat)
+ * file - name of file to load (if null, will try to guess)
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+int cfe_add_autoboot(int type,int flags,char *dev,char *loader,char *filesys,char *file)
+{
+ cfe_autoboot_method_t *method;
+
+ method = (cfe_autoboot_method_t *) KMALLOC(sizeof(cfe_autoboot_method_t),0);
+
+ if (!method) return CFE_ERR_NOMEM;
+
+ method->ab_type = type;
+ method->ab_flags = flags;
+ method->ab_dev = dev;
+ method->ab_loader = loader;
+ method->ab_filesys = filesys;
+ method->ab_file = file;
+
+ q_enqueue(&cfe_autoboot_list,(queue_t *)method);
+ return 0;
+}
diff --git a/cfe/cfe/main/cfe_background.c b/cfe/cfe/main/cfe_background.c
new file mode 100644
index 0000000..9a64e0a
--- /dev/null
+++ b/cfe/cfe/main/cfe_background.c
@@ -0,0 +1,174 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Timer routines File: cfe_timer.c
+ *
+ * This module manages the list of routines to call periodically
+ * during "background processing." CFE has no interrupts or
+ * multitasking, so this is just where all the polling routines
+ * get called from.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+
+#include "cfe_timer.h"
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define MAX_BACKGROUND_TASKS 16
+
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+static void (*cfe_bg_tasklist[MAX_BACKGROUND_TASKS])(void *);
+static void *cfe_bg_args[MAX_BACKGROUND_TASKS];
+
+
+/* *********************************************************************
+ * cfe_bg_init()
+ *
+ * Initialize the background task list
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void cfe_bg_init(void)
+{
+ memset(cfe_bg_tasklist,0,sizeof(cfe_bg_tasklist));
+}
+
+
+/* *********************************************************************
+ * cfe_bg_add(func,arg)
+ *
+ * Add a function to be called periodically in the background
+ * polling loop.
+ *
+ * Input parameters:
+ * func - function pointer
+ * arg - arg to pass to function
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void cfe_bg_add(void (*func)(void *x),void *arg)
+{
+ int idx;
+
+ for (idx = 0; idx < MAX_BACKGROUND_TASKS; idx++) {
+ if (cfe_bg_tasklist[idx] == NULL) {
+ cfe_bg_tasklist[idx] = func;
+ cfe_bg_args[idx] = arg;
+ return;
+ }
+ }
+}
+
+/* *********************************************************************
+ * cfe_bg_remove(func)
+ *
+ * Remove a function from the background polling loop
+ *
+ * Input parameters:
+ * func - function pointer
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void cfe_bg_remove(void (*func)(void *))
+{
+ int idx;
+
+ for (idx = 0; idx < MAX_BACKGROUND_TASKS; idx++) {
+ if (cfe_bg_tasklist[idx] == func) break;
+ }
+
+ if (idx == MAX_BACKGROUND_TASKS) return;
+
+ for (; idx < MAX_BACKGROUND_TASKS-1; idx++) {
+ cfe_bg_tasklist[idx] = cfe_bg_tasklist[idx+1];
+ cfe_bg_args[idx] = cfe_bg_args[idx+1];
+ }
+
+ cfe_bg_tasklist[idx] = NULL;
+ cfe_bg_args[idx] = NULL;
+}
+
+
+/* *********************************************************************
+ * background()
+ *
+ * The main loop and other places that wait for stuff call
+ * this routine to make sure the background handlers get their
+ * time.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void background(void)
+{
+ int idx;
+ void (*func)(void *arg);
+
+ for (idx = 0; idx < MAX_BACKGROUND_TASKS; idx++) {
+ func = cfe_bg_tasklist[idx];
+ if (func == NULL) break;
+ (*func)(cfe_bg_args[idx]);
+ }
+}
diff --git a/cfe/cfe/main/cfe_boot.c b/cfe/cfe/main/cfe_boot.c
new file mode 100644
index 0000000..12fecaa
--- /dev/null
+++ b/cfe/cfe/main/cfe_boot.c
@@ -0,0 +1,248 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * OS bootstrap File: cfe_boot.c
+ *
+ * This module handles OS bootstrap stuff
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "cfe_devfuncs.h"
+#include "cfe_timer.h"
+
+#include "cfe_error.h"
+
+#include "env_subr.h"
+#include "cfe.h"
+
+#include "net_ebuf.h"
+#include "net_ether.h"
+
+#include "net_api.h"
+#include "cfe_fileops.h"
+#include "cfe_bootblock.h"
+#include "bsp_config.h"
+#include "cfe_boot.h"
+
+#include "cfe_loader.h"
+
+#if CFG_UI
+extern int ui_docommands(char *buf);
+#endif
+
+/* *********************************************************************
+ * data
+ ********************************************************************* */
+
+const char *bootvar_device = "BOOT_DEVICE";
+const char *bootvar_file = "BOOT_FILE";
+const char *bootvar_flags = "BOOT_FLAGS";
+
+cfe_loadargs_t cfe_loadargs;
+
+/* *********************************************************************
+ * splitpath(path,devname,filename)
+ *
+ * Split a path name (a boot path, in the form device:filename)
+ * into its parts
+ *
+ * Input parameters:
+ * path - pointer to path string
+ * devname - receives pointer to device name
+ * filename - receives pointer to file name
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void splitpath(char *path,char **devname,char **filename)
+{
+ char *x;
+
+ *devname = NULL;
+ *filename = NULL;
+
+ x = strchr(path,':');
+
+ if (!x) {
+ *devname = NULL; /* path consists of device name */
+ *filename = path;
+ }
+ else {
+ *x++ = '\0'; /* have both device and file name */
+ *filename = x;
+ *devname = path;
+ }
+}
+
+
+/* *********************************************************************
+ * cfe_go(la)
+ *
+ * Starts a previously loaded program. cfe_loadargs.la_entrypt
+ * must be set to the entry point of the program to be started
+ *
+ * Input parameters:
+ * la - loader args
+ *
+ * Return value:
+ * does not return
+ ********************************************************************* */
+
+void cfe_go(cfe_loadargs_t *la)
+{
+ if (la->la_entrypt == 0) {
+ xprintf("No program has been loaded.\n");
+ return;
+ }
+
+#if CFG_NETWORK
+ if (!(la->la_flags & LOADFLG_NOCLOSE)) {
+ if (net_getparam(NET_DEVNAME)) {
+ xprintf("Closing network.\n");
+ net_uninit();
+ }
+ }
+#endif
+
+ xprintf("Starting program at 0x%p\n",la->la_entrypt);
+
+ cfe_start(la->la_entrypt);
+}
+
+
+/* *********************************************************************
+ * cfe_boot(la)
+ *
+ * Bootstrap the system.
+ *
+ * Input parameters:
+ * la - loader arguments
+ *
+ * Return value:
+ * error, or does not return
+ ********************************************************************* */
+int cfe_boot(char *ldrname,cfe_loadargs_t *la)
+{
+ int res;
+
+ la->la_entrypt = 0;
+
+ if (la->la_flags & LOADFLG_NOISY) {
+ xprintf("Loading: ");
+ }
+
+ res = cfe_load_program(ldrname,la);
+
+ if (res < 0) {
+ if (la->la_flags & LOADFLG_NOISY) {
+ xprintf("Failed.\n");
+ }
+ return res;
+ }
+
+ /*
+ * Special case: If loading a batch file, just do the commands here
+ * and return. For batch files we don't want to set up the
+ * environment variables.
+ */
+
+ if (la->la_flags & LOADFLG_BATCH) {
+#if CFG_UI
+ ui_docommands((char *) la->la_entrypt);
+#endif
+ return 0;
+ }
+
+ /*
+ * Otherwise set up for running a real program.
+ */
+
+ if (la->la_flags & LOADFLG_NOISY) {
+ xprintf("Entry at 0x%p\n",la->la_entrypt);
+ }
+
+ /*
+ * Set up the environment variables for the bootstrap
+ */
+
+ if (la->la_device) {
+ env_setenv(bootvar_device,la->la_device,ENV_FLG_BUILTIN);
+ }
+ else {
+ env_delenv(bootvar_device);
+ }
+
+ if (la->la_filename) {
+ env_setenv(bootvar_file,la->la_filename,ENV_FLG_BUILTIN);
+ }
+ else {
+ env_delenv(bootvar_file);
+ }
+
+ if (la->la_options) {
+ env_setenv(bootvar_flags,la->la_options,ENV_FLG_BUILTIN);
+ }
+ else {
+ env_delenv(bootvar_flags);
+ }
+
+ /*
+ * Banzai! Run the program.
+ */
+
+ if ((la->la_flags & LOADFLG_EXECUTE) &&
+ (la->la_entrypt != 0)) {
+ cfe_go(la);
+ }
+
+ return 0;
+}
+
diff --git a/cfe/cfe/main/cfe_console.c b/cfe/cfe/main/cfe_console.c
new file mode 100755
index 0000000..a9464f1
--- /dev/null
+++ b/cfe/cfe/main/cfe_console.c
@@ -0,0 +1,1190 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Console Interface File: cfe_console.c
+ *
+ * This module contains high-level routines for dealing with
+ * the console (TTY-style) device.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include <stdarg.h>
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_devfuncs.h"
+#include "cfe_timer.h"
+#include "cfe_error.h"
+#include "env_subr.h"
+#include "cfe_console.h"
+#include "cfe.h"
+
+#include "bsp_config.h"
+
+
+/*
+ * Escape sequences:
+ *
+ * Sequence Descr Emulator
+ *
+ * ESC [ A UP xterm
+ * ESC [ B DOWN xterm
+ * ESC [ C RIGHT xterm
+ * ESC [ D LEFT xterm
+ *
+ * ESC O P F1 xterm
+ * ESC O Q F2 xterm
+ * ESC O R F3 xterm
+ * ESC O S F4 xterm
+ *
+ * ESC [ 1 1 ~ F1 teraterm
+ * ESC [ 1 2 ~ F2 teraterm
+ * ESC [ 1 3 ~ F3 teraterm
+ * ESC [ 1 4 ~ F4 teraterm
+ *
+ * ESC [ 1 5 ~ F5 xterm,teraterm
+ * ESC [ 1 7 ~ F6 xterm,teraterm
+ * ESC [ 1 8 ~ F7 xterm,teraterm
+ * ESC [ 1 9 ~ F8 xterm,teraterm
+ * ESC [ 2 0 ~ F9 xterm,teraterm
+ * ESC [ 2 1 ~ F10 xterm,teraterm
+ * ESC [ 2 3 ~ F11 xterm,teraterm
+ * ESC [ 2 4 ~ F12 xterm,teraterm
+ *
+ * ESC [ 5 ~ PGUP xterm
+ * ESC [ 6 ~ PGDN xterm
+ * ESC [ F HOME xterm
+ * ESC [ H END xterm
+ *
+ * ESC [ 2 ~ HOME teraterm
+ * ESC [ 3 ~ PGUP teraterm
+ * ESC [ 5 ~ END teraterm
+ * ESC [ 6 ~ PGDN teraterm
+ *
+ */
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+
+#define CTRL(x) ((x)-'@')
+
+#define GETCHAR(x) while (console_read(&(x),1) != 1) { POLL(); }
+
+#define XTERM 0
+#define TERATERM 1
+
+#define MAXSAVELINES 30
+#define MSGQUEUEMAX 10 /* number of chunks of log to keep */
+#define MSGQUEUESIZE 256 /* size of each chunk of console log */
+
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+typedef struct msgqueue_s { /* saved console log message */
+ queue_t link;
+ int len;
+ char data[MSGQUEUESIZE];
+} msgqueue_t;
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+#if !CFG_MINIMAL_SIZE
+int console_nextsave = 0;
+char *console_savedlines[MAXSAVELINES] = {0};
+static char *console_killbuffer = NULL;
+queue_t console_msgq = {&console_msgq,&console_msgq};
+static int console_buffer_flg = 0;
+static int console_mode = XTERM;
+
+static void console_flushbuffer(void);
+static void console_save(unsigned char *buffer,int length);
+
+#endif
+
+#if defined(CONFIG_MIPS_BRCM)
+int g_console_abort = 0;
+#endif
+int console_handle = -1;
+static int console_xprint(const char *str);
+char *console_name = NULL;
+static int console_inreadline = 0;
+static int console_redisplay = 0;
+
+/* *********************************************************************
+ * console_log(tmplt,...)
+ *
+ * Sort of like printf, but used during things that might be
+ * called in the polling loop. If you print out a message
+ * using this call and it happens to be printed while processing
+ * the console "readline" loop, the readline and the associated
+ * prompt will be redisplayed. Don't include the \r\n in the
+ * string to be displayed.
+ *
+ * Input parameters:
+ * tmplt, ... - printf parameters
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void console_log(const char *tmplt,...)
+{
+ char buffer[256];
+ va_list marker;
+ int count;
+
+ va_start(marker,tmplt);
+ count = xvsprintf(buffer,tmplt,marker);
+ va_end(marker);
+ xprintf("\r%s\033[J\r\n",buffer);
+
+ if (console_inreadline) console_redisplay = 1;
+}
+
+/* *********************************************************************
+ * console_open(name)
+ *
+ * Open the specified device and make it the console
+ *
+ * Input parameters:
+ * name - name of device
+ *
+ * Return value:
+ * 0 if ok, else return code.
+ * console_handle contains the console's handle
+ ********************************************************************* */
+
+int console_open(char *name)
+{
+#if CFG_MINIMAL_SIZE
+ if (console_handle != -1) {
+ console_close();
+ }
+
+ console_handle = cfe_open(name);
+ if (console_handle < 0) return CFE_ERR_DEVNOTFOUND;
+
+#else
+
+ int flushbuf;
+
+ console_name = NULL;
+
+ if (console_handle != -1) {
+ console_close();
+ }
+
+ flushbuf = console_buffer_flg;
+ console_buffer_flg = 0;
+
+ console_handle = cfe_open(name);
+ if (console_handle < 0) return CFE_ERR_DEVNOTFOUND;
+
+ console_name = name;
+ if (flushbuf) console_flushbuffer();
+#endif
+
+ return 0;
+}
+
+/* *********************************************************************
+ * console_close()
+ *
+ * Close the console device
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+int console_close(void)
+{
+ if (console_handle != -1) {
+ cfe_close(console_handle);
+ }
+
+ console_handle = -1;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * console_read(buffer,length)
+ *
+ * Read characters from the console.
+ *
+ * Input parameters:
+ * buffer - pointer to buffer to receive characters
+ * length - total size of the buffer
+ *
+ * Return value:
+ * number of characters received, or <0 if error code
+ ********************************************************************* */
+
+int console_read(char *buffer,int length)
+{
+ if (console_handle == -1) return -1;
+
+ return cfe_read(console_handle,(unsigned char*)buffer,length);
+}
+
+
+/* *********************************************************************
+ * console_write(buffer,length)
+ *
+ * Write text to the console. If the console is not open and
+ * we're "saving" text, put the text on the in-memory queue
+ *
+ * Input parameters:
+ * buffer - pointer to data
+ * length - number of characters to write
+ *
+ * Return value:
+ * number of characters written or <0 if error
+ ********************************************************************* */
+
+int console_write(char *buffer,int length)
+{
+ int res;
+
+#if !CFG_MINIMAL_SIZE
+ /*
+ * Buffer text if requested
+ */
+ if (console_buffer_flg) {
+ console_save(buffer,length);
+ return length;
+ }
+#endif
+
+ /*
+ * Do nothing if no console
+ */
+
+ if (console_handle == -1) return -1;
+
+ /*
+ * Write text to device
+ */
+
+ for (;;) {
+ res = cfe_write(console_handle,(unsigned char*)buffer,length);
+ if (res < 0) break;
+ buffer += res;
+ length -= res;
+ if (length == 0) break;
+ }
+
+ if (res < 0) return -1;
+ return 0;
+}
+
+/* *********************************************************************
+ * console_status()
+ *
+ * Return the status of input for the console.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * 0 if no characters are available
+ * 1 if characters are available.
+ ********************************************************************* */
+
+int console_status(void)
+{
+ if (console_handle == -1) return 0;
+
+ return cfe_inpstat(console_handle);
+}
+
+/* *********************************************************************
+ * console_xprint(str)
+ *
+ * printf callback for the console device. the "xprintf"
+ * routine ends up calling this. This routine also cooks the
+ * output, turning "\n" into "\r\n"
+ *
+ * Input parameters:
+ * str - string to write
+ *
+ * Return value:
+ * number of characters written
+ ********************************************************************* */
+
+static int console_xprint(const char *str)
+{
+ int count = 0;
+ int len;
+ const char *p;
+
+ /* Convert CR to CRLF as we write things out */
+
+ while ((p = strchr(str,'\n'))) {
+ console_write((char*)str,p-str);
+ console_write("\r\n",2);
+ count += (p-str);
+ str = p + 1;
+ }
+
+ len = strlen(str);
+ console_write((char*)str, len);
+ count += len;
+
+ return count;
+}
+
+
+/* *********************************************************************
+ * console_readline_noedit(str,len)
+ *
+ * A simple 'gets' type routine for the console. We support
+ * backspace and carriage return. No line editing support here,
+ * this routine is used in places where we don't want it.
+ *
+ * Input parameters:
+ * prompt - prompt string
+ * str - pointer to user buffer
+ * len - length of user buffer
+ *
+ * Return value:
+ * number of characters read (terminating newline is not
+ * placed in the buffer)
+ ********************************************************************* */
+
+int console_readline_noedit(char *prompt,char *str,int len)
+{
+ int reading = 1;
+ char ch;
+ int res = -1;
+ int idx = 0;
+
+ console_inreadline++;
+
+ if (prompt && *prompt) console_write(prompt,strlen(prompt));
+
+ POLL();
+ while (reading) {
+
+ /*
+ * If someone used console_log (above) or hit Control-C (below),
+ * redisplay the prompt and the string we've got so far.
+ */
+
+ if (console_redisplay) {
+ if (prompt && *prompt) console_write(prompt,strlen(prompt));
+ console_write(str,idx);
+ console_redisplay = 0;
+ continue;
+ }
+
+#if defined(CONFIG_MIPS_BRCM)
+
+ /*
+ * If a background process has set the global g_console_abort flag, stop
+ * reading from the keyboard.
+ */
+
+ if (g_console_abort) {
+ g_console_abort = 0;
+ break;
+ }
+
+#endif
+
+ /*
+ * if nobody's typed anything, keep polling
+ */
+
+ if (console_status() == 0) {
+ POLL();
+ continue;
+ }
+
+ /*
+ * Get the char from the keyboard
+ */
+
+ res = console_read(&ch,1);
+ if (res < 0) break;
+ if (res == 0) continue;
+
+ /*
+ * And dispatch it
+ */
+
+ switch (ch) {
+ case 3: /* Ctrl-C */
+ console_write("^C\r\n",4);
+ console_redisplay = 1;
+ idx = 0;
+ break;
+ case 0x7f:
+ case '\b':
+ if (idx > 0) {
+ idx--;
+ console_write("\b \b",3);
+ }
+ break;
+ case 21: /* Ctrl-U */
+ while (idx > 0) {
+ idx--;
+ console_write("\b \b",3);
+ }
+ break;
+ case '\r':
+ case '\n':
+ console_write("\r\n",2);
+ reading = 0;
+ break;
+ default:
+ if (ch >= ' ') {
+ if (idx < (len-1)) {
+ str[idx] = ch;
+ idx++;
+ console_write(&ch,1);
+ }
+ }
+ break;
+ }
+ }
+ POLL();
+
+ console_inreadline--;
+
+ str[idx] = 0;
+ return idx;
+}
+
+
+/* *********************************************************************
+ * cfe_set_console(name)
+ *
+ * This routine is usually called from the BSP's initialization
+ * module to set up the console device. We set the xprintf
+ * callback and open the console device. If we open a special
+ * magic console device (CFE_BUFFER_CONSOLE) the console subsystem
+ * will buffer text instead. A later call to cfe_set_console
+ * with a real console name will cause this text to be flushed.
+ *
+ * Input parameters:
+ * name - name of console device
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int cfe_set_console(char *name)
+{
+ xprinthook = console_xprint;
+
+#if !CFG_MINIMAL_SIZE
+ if (strcmp(name,CFE_BUFFER_CONSOLE) == 0) {
+ console_buffer_flg = 1;
+ return 0;
+ }
+#endif
+
+ if (name) {
+ int res;
+ res = env_setenv("BOOT_CONSOLE",name,
+ ENV_FLG_BUILTIN | ENV_FLG_READONLY | ENV_FLG_ADMIN);
+ return console_open(name);
+ }
+ return -1;
+}
+
+#if !CFG_MINIMAL_SIZE
+
+/* *********************************************************************
+ * console_flushbuffer()
+ *
+ * Flush queued (saved) console messages to the real console
+ * device. This is used if we need to delay console
+ * initialization until after other devices are initialized,
+ * for example, with a VGA console that won't work until
+ * after PCI initialization.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void console_flushbuffer(void)
+{
+ msgqueue_t *msg;
+ char *buffer;
+ int length;
+ int res;
+
+ /*
+ * Remove console messages from the queue
+ */
+
+ while ((msg = (msgqueue_t *) q_deqnext(&console_msgq))) {
+
+ buffer = msg->data;
+ length = msg->len;
+ res = 0;
+
+ /*
+ * Write each message to the console
+ */
+
+ for (;;) {
+ res = cfe_write(console_handle,buffer,length);
+ if (res < 0) break;
+ buffer += res;
+ length -= res;
+ if (length == 0) break;
+ }
+
+ /*
+ * Free the storage
+ */
+
+ KFREE(msg);
+ }
+}
+
+
+/* *********************************************************************
+ * console_save(buffer,length)
+ *
+ * This is used when we want to generate console output
+ * before the device is initialized. The console_save
+ * routine saves a copy of the log messages in a queue
+ * for later retrieval when the console device is open.
+ *
+ * Input parameters:
+ * buffer - message text to save
+ * length - number of bytes
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void console_save(unsigned char *buffer,int length)
+{
+ msgqueue_t *msg;
+
+ /*
+ * Get a pointer to the last message in the queue. If
+ * it's full, preprare to allocate a new one
+ */
+
+ msg = (msgqueue_t *) console_msgq.q_prev;
+ if (q_isempty(&(console_msgq)) || (msg->len == MSGQUEUESIZE)) {
+ msg = NULL;
+ }
+
+ /*
+ * Stuff characters into message chunks till we're done
+ */
+
+ while (length) {
+
+ /*
+ * New chunk
+ */
+ if (msg == NULL) {
+
+ msg = (msgqueue_t *) KMALLOC(sizeof(msgqueue_t),0);
+ if (msg == NULL) return;
+ msg->len = 0;
+ q_enqueue(&console_msgq,(queue_t *) msg);
+
+ /*
+ * Remove chunks to prevent chewing too much memory
+ */
+
+ while (q_count(&console_msgq) > MSGQUEUEMAX) {
+ msgqueue_t *dropmsg;
+ dropmsg = (msgqueue_t *) q_deqnext(&console_msgq);
+ if (dropmsg) KFREE(dropmsg);
+ }
+ }
+
+ /*
+ * Save text. If we run off the end of the buffer, prepare
+ * to allocate a new one
+ */
+ msg->data[msg->len++] = *buffer++;
+ length--;
+ if (msg->len == MSGQUEUESIZE) msg = NULL;
+ }
+}
+
+
+/* *********************************************************************
+ * console_readnum(num,ch)
+ *
+ * Read digits from the console until we get a non-digit. This
+ * is used to process escape sequences like ESC [ digits ~
+ *
+ * Input parameters:
+ * num - where to put returned number
+ * ch - pointer to character that starts sequence, returns
+ * character that terminated sequence
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void console_readnum(int *num,char *ch)
+{
+ int total = 0;
+
+ for (;;) {
+ total = (total * 10) + (*ch - '0');
+ while (console_read(ch,1) != 1) { POLL(); }
+ if (!((*ch >= '0') && (*ch <= '9'))) break;
+ }
+
+ *num = total;
+}
+
+
+/* *********************************************************************
+ * console_readkey(void)
+ *
+ * Very simple ANSI escape sequence parser, returns virtual
+ * key codes for function keys, arrows, etc.
+ *
+ * Hold your lunch, three levels of nested switch statements! :-)
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * virtual key code
+ ********************************************************************* */
+
+int console_readkey(void)
+{
+ unsigned char ch;
+ int num;
+
+ GETCHAR(ch);
+
+ switch (ch) {
+ case VKEY_ESC:
+ GETCHAR(ch);
+ switch (ch) {
+ case 'O':
+ GETCHAR(ch);
+ switch (ch) {
+ case 'P':
+ return VKEY_F1;
+ case 'Q':
+ return VKEY_F2;
+ case 'R':
+ return VKEY_F3;
+ case 'S':
+ return VKEY_F4;
+ }
+ return (int)ch;
+
+ case '[':
+ GETCHAR(ch);
+ if ((ch >= '0') && (ch <= '9')) {
+ console_readnum(&num,&ch);
+ if (ch == '~') {
+ switch (num) {
+ case 2:
+ return VKEY_HOME;
+ case 3:
+ return VKEY_PGUP;
+ case 5:
+ if (console_mode == XTERM) return VKEY_PGUP;
+ return VKEY_END;
+ case 6:
+ if (console_mode == XTERM) return VKEY_PGDN;
+ return VKEY_PGDN;
+ case 11:
+ return VKEY_F1;
+ case 12:
+ return VKEY_F2;
+ case 13:
+ return VKEY_F3;
+ case 14:
+ return VKEY_F4;
+ case 15:
+ return VKEY_F5;
+ case 17:
+ return VKEY_F6;
+ case 18:
+ return VKEY_F7;
+ case 19:
+ return VKEY_F8;
+ case 20:
+ return VKEY_F9;
+ case 21:
+ return VKEY_F10;
+ case 23:
+ return VKEY_F11;
+ case 24:
+ return VKEY_F12;
+ }
+ return (int)ch;
+ }
+ }
+ else {
+ switch (ch) {
+ case 'A':
+ return VKEY_UP;
+ case 'B':
+ return VKEY_DOWN;
+ case 'C':
+ return VKEY_RIGHT;
+ case 'D':
+ return VKEY_LEFT;
+ case 'F':
+ return VKEY_HOME;
+ case 'H':
+ return VKEY_END;
+ default:
+ return (int) ch;
+ }
+ }
+ default:
+ return (int)ch;
+
+ }
+ default:
+ return (int) ch;
+ }
+}
+
+
+/* *********************************************************************
+ * console_xxx(...)
+ *
+ * Various small routines to write out cursor control sequences.
+ *
+ * Input parameters:
+ * # of iterations, if necessary
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void console_backspace(int n)
+{
+ int t;
+
+ for (t = 0; t < n; t++) console_write("\b",1);
+}
+
+static void console_whiteout(int n)
+{
+ int t;
+
+ for (t = 0; t < n; t++) console_write(" ",1);
+ for (t = 0; t < n; t++) console_write("\b",1);
+}
+
+
+static void console_eraseeol(void)
+{
+ console_write("\033[K",3);
+}
+
+static void console_crlf(void)
+{
+ console_write("\r\n",2);
+}
+
+/* *********************************************************************
+ * console_readline(str,len)
+ *
+ * A simple 'gets' type routine for the console, with line
+ * editing support.
+ *
+ * Input parameters:
+ * prompt - prompt string
+ * str - pointer to user buffer
+ * len - length of user buffer
+ *
+ * Return value:
+ * number of characters read (terminating newline is not
+ * placed in the buffer)
+ ********************************************************************* */
+
+int console_readline(char *prompt,char *str,int maxlen)
+{
+ int reading = 1;
+ int ch;
+ int idx = 0;
+ int len = 0;
+ int t;
+ int klen;
+ int recall;
+ int nosave = 0;
+ char *x;
+ char env[10];
+
+ console_inreadline++;
+ recall = console_nextsave;
+
+ if (console_savedlines[console_nextsave]) {
+ KFREE(console_savedlines[console_nextsave]);
+ console_savedlines[console_nextsave] = NULL;
+ }
+ console_savedlines[console_nextsave] = strdup("");
+
+ if (prompt && *prompt) console_write(prompt,strlen(prompt));
+
+ POLL();
+ while (reading) {
+
+ /*
+ * If someone used console_log (above) or hit Control-C (below),
+ * redisplay the prompt and the string we've got so far.
+ */
+
+ if (console_redisplay) {
+ if (prompt && *prompt) console_write(prompt,strlen(prompt));
+ console_write(str,idx);
+ console_redisplay = 0;
+ continue;
+ }
+
+#if defined(CONFIG_MIPS_BRCM)
+
+ /*
+ * If a background process has set the global g_console_abort flag, stop
+ * reading from the keyboard.
+ */
+
+ if (g_console_abort) {
+ g_console_abort = 0;
+ break;
+ }
+
+#endif
+
+ /*
+ * if nobody's typed anything, keep polling
+ */
+
+ if (console_status() == 0) {
+ POLL();
+ continue;
+ }
+
+ /*
+ * Get the char from the keyboard
+ */
+
+ ch = console_readkey();
+ if (ch < 0) break;
+ if (ch == 0) continue;
+
+ /*
+ * And dispatch it. Lots of yucky character manipulation follows
+ */
+
+ switch (ch) {
+ case CTRL('C'): /* Ctrl-C - cancel line */
+ console_write("^C\r\n",4);
+ console_redisplay = 1;
+ nosave = 1;
+ idx = 0;
+ break;
+
+ case 0x7f: /* Backspace, Delete */
+ case CTRL('H'):
+ if (idx > 0) {
+ nosave = 0;
+ len--;
+ idx--;
+ console_write("\b",1);
+ if (len != idx) {
+ for (t = idx; t < len; t++) str[t] = str[t+1];
+ console_write(&str[idx],len-idx);
+ console_whiteout(1);
+ console_backspace(len-idx);
+ }
+ else {
+ console_whiteout(1);
+ }
+ }
+ break;
+
+ case CTRL('D'): /* Ctrl-D */
+ if ((idx >= 0) && (len != idx)) {
+ nosave = 0;
+ len--;
+ for (t = idx; t < len; t++) str[t] = str[t+1];
+ console_write(&str[idx],len-idx);
+ console_whiteout(1);
+ console_backspace(len-idx);
+ }
+ break;
+
+ case CTRL('B'): /* cursor left */
+ case VKEY_LEFT:
+ if (idx > 0) {
+ idx--;
+ console_backspace(1);
+ }
+ break;
+
+ case CTRL('F'): /* cursor right */
+ case VKEY_RIGHT:
+ if (idx < len) {
+ console_write(&str[idx],1);
+ idx++;
+ }
+ break;
+
+ case CTRL('A'): /* cursor to BOL */
+ console_backspace(idx);
+ idx = 0;
+ break;
+
+ case CTRL('E'): /* cursor to EOL */
+ if (len-idx > 0) console_write(&str[idx],len-idx);
+ idx = len;
+ break;
+
+ case CTRL('K'): /* Kill to EOL */
+ if (idx != len) {
+ str[len] = '\0';
+ if (console_killbuffer) KFREE(console_killbuffer);
+ console_killbuffer = strdup(&str[idx]);
+ console_whiteout(len-idx);
+ len = idx;
+ nosave = 0;
+ }
+ break;
+
+ case CTRL('Y'): /* Yank killed data */
+ if (console_killbuffer == NULL) break;
+ klen = strlen(console_killbuffer);
+ if (klen == 0) break;
+ if (len + klen > maxlen) break;
+ nosave = 0;
+ for (t = len + klen; t > idx; t--) {
+ str[t-1] = str[t-klen-1];
+ }
+ for (t = 0; t < klen; t++) str[t+idx] = console_killbuffer[t];
+ len += klen;
+ console_write(&str[idx],len-idx);
+ idx += klen;
+ console_backspace(len-idx-1);
+ break;
+
+ case CTRL('R'): /* Redisplay line */
+ str[len] = 0;
+ console_crlf();
+ console_write(prompt,strlen(prompt));
+ console_write(str,len);
+ console_backspace(len-idx);
+ break;
+
+ case CTRL('U'): /* Cancel line */
+ console_backspace(idx);
+ console_eraseeol();
+ if (len > 0) nosave = 1;
+ idx = 0;
+ len = 0;
+ break;
+
+ case CTRL('M'): /* terminate */
+ case CTRL('J'):
+ console_crlf();
+ reading = 0;
+ break;
+
+ case CTRL('P'):
+ case VKEY_UP: /* recall previous line */
+ t = recall;
+ t--;
+ if (t < 0) t = MAXSAVELINES-1;
+ if (console_savedlines[t] == NULL) break;
+ recall = t;
+ console_backspace(idx);
+ strcpy(str,console_savedlines[recall]);
+ len = idx = strlen(console_savedlines[recall]);
+ console_eraseeol();
+ console_write(str,len);
+ nosave = (t == ((console_nextsave - 1) % MAXSAVELINES));
+ break;
+
+ case CTRL('N'):
+ case VKEY_DOWN: /* Recall next line */
+ t = recall;
+ t++;
+ if (t == MAXSAVELINES) t = 0;
+ if (console_savedlines[t] == NULL) break;
+ recall = t;
+ console_backspace(idx);
+ strcpy(str,console_savedlines[recall]);
+ len = idx = strlen(console_savedlines[recall]);
+ console_eraseeol();
+ console_write(str,len);
+ nosave = 1;
+ break;
+
+ case VKEY_F1:
+ case VKEY_F2:
+ case VKEY_F3:
+ case VKEY_F4:
+ case VKEY_F5:
+ case VKEY_F6:
+ case VKEY_F7:
+ case VKEY_F8:
+ case VKEY_F9:
+ case VKEY_F10:
+ case VKEY_F11:
+ case VKEY_F12:
+ sprintf(env,"F%d",ch-VKEY_F1+1);
+ x = env_getenv(env);
+ if (x) {
+ console_backspace(idx);
+ strcpy(str,x);
+ idx = len = strlen(str);
+ console_eraseeol();
+ console_write(str,len);
+ console_crlf();
+ reading = 0;
+ nosave = 1;
+ }
+ /*
+ * If F12 is undefined, it means "repeat last command"
+ */
+ if (ch == VKEY_F12) {
+ t = recall;
+ t--;
+ if (t < 0) t = MAXSAVELINES-1;
+ if (console_savedlines[t] == NULL) break;
+ recall = t;
+ console_backspace(idx);
+ strcpy(str,console_savedlines[recall]);
+ len = idx = strlen(console_savedlines[recall]);
+ console_eraseeol();
+ console_write(str,len);
+ console_crlf();
+ reading = 0;
+ nosave = 1;
+ }
+ break;
+
+ default: /* insert character */
+ if (ch >= ' ') {
+ if (idx < (maxlen-1)) {
+ nosave = 0;
+ for (t = len; t > idx; t--) {
+ str[t] = str[t-1];
+ }
+ str[idx] = ch;
+ len++;
+ if (len != idx) {
+ console_write(&str[idx],len-idx);
+ console_backspace(len-idx-1);
+ }
+ idx++;
+ }
+ }
+ break;
+ }
+ }
+ POLL();
+
+ console_inreadline--;
+
+ str[len] = 0;
+
+ if ((len != 0) && !nosave) {
+ if (console_savedlines[console_nextsave]) {
+ KFREE(console_savedlines[console_nextsave]);
+ }
+ console_savedlines[console_nextsave] = strdup(str);
+ console_nextsave++;
+ if (console_nextsave == MAXSAVELINES) console_nextsave = 0;
+ }
+
+ return len;
+}
+
+#else /* CFG_MINIMAL_SIZE */
+/* *********************************************************************
+ * console_readline(str,len)
+ *
+ * A simple 'gets' type routine for the console,
+ * just calls the "noedit" variant for minimal code
+ * size builds.
+ *
+ * Input parameters:
+ * prompt - prompt string
+ * str - pointer to user buffer
+ * len - length of user buffer
+ *
+ * Return value:
+ * number of characters read (terminating newline is not
+ * placed in the buffer)
+ ********************************************************************* */
+
+int console_readline(char *prompt,char *str,int len)
+{
+ return console_readline_noedit(prompt,str,len);
+}
+
+#endif
diff --git a/cfe/cfe/main/cfe_devfuncs.c b/cfe/cfe/main/cfe_devfuncs.c
new file mode 100755
index 0000000..c3ab905
--- /dev/null
+++ b/cfe/cfe/main/cfe_devfuncs.c
@@ -0,0 +1,279 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Device Function stubs File: cfe_devfuncs.c
+ *
+ * This module contains device function stubs (small routines to
+ * call the standard "iocb" interface entry point to CFE).
+ * There should be one routine here per iocb function call.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "cfe_iocb.h"
+#include "cfe_devfuncs.h"
+
+extern int cfe_iocb_dispatch(cfe_iocb_t *iocb);
+
+static int cfe_strlen(char *name)
+{
+ int count = 0;
+
+ while (*name) {
+ count++;
+ name++;
+ }
+
+ return count;
+}
+
+int cfe_open(char *name)
+{
+ cfe_iocb_t iocb;
+
+ iocb.iocb_fcode = CFE_CMD_DEV_OPEN;
+ iocb.iocb_status = 0;
+ iocb.iocb_handle = 0;
+ iocb.iocb_flags = 0;
+ iocb.iocb_psize = sizeof(iocb_buffer_t);
+ iocb.plist.iocb_buffer.buf_offset = 0;
+ iocb.plist.iocb_buffer.buf_ptr = (unsigned char*)name;
+ iocb.plist.iocb_buffer.buf_length = cfe_strlen(name);
+
+ cfe_iocb_dispatch(&iocb);
+
+ return (iocb.iocb_status < 0) ? iocb.iocb_status : iocb.iocb_handle;
+}
+
+int cfe_close(int handle)
+{
+ cfe_iocb_t iocb;
+
+ iocb.iocb_fcode = CFE_CMD_DEV_CLOSE;
+ iocb.iocb_status = 0;
+ iocb.iocb_handle = handle;
+ iocb.iocb_flags = 0;
+ iocb.iocb_psize = 0;
+
+ cfe_iocb_dispatch(&iocb);
+
+ return (iocb.iocb_status);
+
+}
+
+int cfe_readblk(int handle,cfe_offset_t offset,unsigned char *buffer,int length)
+{
+ cfe_iocb_t iocb;
+
+ iocb.iocb_fcode = CFE_CMD_DEV_READ;
+ iocb.iocb_status = 0;
+ iocb.iocb_handle = handle;
+ iocb.iocb_flags = 0;
+ iocb.iocb_psize = sizeof(iocb_buffer_t);
+ iocb.plist.iocb_buffer.buf_offset = offset;
+ iocb.plist.iocb_buffer.buf_ptr = buffer;
+ iocb.plist.iocb_buffer.buf_length = length;
+
+ cfe_iocb_dispatch(&iocb);
+
+ return (iocb.iocb_status < 0) ? iocb.iocb_status : iocb.plist.iocb_buffer.buf_retlen;
+}
+
+int cfe_read(int handle,unsigned char *buffer,int length)
+{
+ return cfe_readblk(handle,0,buffer,length);
+}
+
+
+int cfe_writeblk(int handle,cfe_offset_t offset,unsigned char *buffer,int length)
+{
+ cfe_iocb_t iocb;
+
+ iocb.iocb_fcode = CFE_CMD_DEV_WRITE;
+ iocb.iocb_status = 0;
+ iocb.iocb_handle = handle;
+ iocb.iocb_flags = 0;
+ iocb.iocb_psize = sizeof(iocb_buffer_t);
+ iocb.plist.iocb_buffer.buf_offset = offset;
+ iocb.plist.iocb_buffer.buf_ptr = buffer;
+ iocb.plist.iocb_buffer.buf_length = length;
+
+ cfe_iocb_dispatch(&iocb);
+
+ return (iocb.iocb_status < 0) ? iocb.iocb_status : iocb.plist.iocb_buffer.buf_retlen;
+}
+
+int cfe_write(int handle,unsigned char *buffer,int length)
+{
+ return cfe_writeblk(handle,0,buffer,length);
+}
+
+
+int cfe_ioctl(int handle,unsigned int ioctlnum,
+ unsigned char *buffer,int length,int *retlen,
+ cfe_offset_t offset)
+{
+ cfe_iocb_t iocb;
+
+ iocb.iocb_fcode = CFE_CMD_DEV_IOCTL;
+ iocb.iocb_status = 0;
+ iocb.iocb_handle = handle;
+ iocb.iocb_flags = 0;
+ iocb.iocb_psize = sizeof(iocb_buffer_t);
+ iocb.plist.iocb_buffer.buf_offset = offset;
+ iocb.plist.iocb_buffer.buf_ioctlcmd = (cfe_offset_t) ioctlnum;
+ iocb.plist.iocb_buffer.buf_ptr = buffer;
+ iocb.plist.iocb_buffer.buf_length = length;
+
+ cfe_iocb_dispatch(&iocb);
+
+ if (retlen) *retlen = iocb.plist.iocb_buffer.buf_retlen;
+ return iocb.iocb_status;
+}
+
+int cfe_inpstat(int handle)
+{
+ cfe_iocb_t iocb;
+
+ iocb.iocb_fcode = CFE_CMD_DEV_INPSTAT;
+ iocb.iocb_status = 0;
+ iocb.iocb_handle = handle;
+ iocb.iocb_flags = 0;
+ iocb.iocb_psize = sizeof(iocb_inpstat_t);
+ iocb.plist.iocb_inpstat.inp_status = 0;
+
+ cfe_iocb_dispatch(&iocb);
+
+ if (iocb.iocb_status < 0) return iocb.iocb_status;
+
+ return iocb.plist.iocb_inpstat.inp_status;
+
+}
+
+long long cfe_getticks(void)
+{
+ cfe_iocb_t iocb;
+
+ iocb.iocb_fcode = CFE_CMD_FW_GETTIME;
+ iocb.iocb_status = 0;
+ iocb.iocb_handle = 0;
+ iocb.iocb_flags = 0;
+ iocb.iocb_psize = sizeof(iocb_time_t);
+ iocb.plist.iocb_time.ticks = 0;
+
+ cfe_iocb_dispatch(&iocb);
+
+ return iocb.plist.iocb_time.ticks;
+
+}
+
+int cfe_getenv(char *name,char *dest,int destlen)
+{
+ cfe_iocb_t iocb;
+
+ *dest = NULL;
+
+ iocb.iocb_fcode = CFE_CMD_ENV_GET;
+ iocb.iocb_status = 0;
+ iocb.iocb_handle = 0;
+ iocb.iocb_flags = 0;
+ iocb.iocb_psize = sizeof(iocb_envbuf_t);
+ iocb.plist.iocb_envbuf.enum_idx = 0;
+ iocb.plist.iocb_envbuf.name_ptr = (unsigned char*)name;
+ iocb.plist.iocb_envbuf.name_length = strlen(name)+1;
+ iocb.plist.iocb_envbuf.val_ptr = (unsigned char*)dest;
+ iocb.plist.iocb_envbuf.val_length = destlen;
+
+ cfe_iocb_dispatch(&iocb);
+
+ return iocb.iocb_status;
+}
+
+int cfe_exit(int warm,int code)
+{
+ cfe_iocb_t iocb;
+
+ iocb.iocb_fcode = CFE_CMD_FW_RESTART;
+ iocb.iocb_status = 0;
+ iocb.iocb_handle = 0;
+ iocb.iocb_flags = warm ? CFE_FLG_WARMSTART : 0;
+ iocb.iocb_psize = sizeof(iocb_exitstat_t);
+ iocb.plist.iocb_exitstat.status = code;
+
+ cfe_iocb_dispatch(&iocb);
+
+ return (iocb.iocb_status);
+
+}
+
+int cfe_flushcache(int flg)
+{
+ cfe_iocb_t iocb;
+
+ iocb.iocb_fcode = CFE_CMD_FW_FLUSHCACHE;
+ iocb.iocb_status = 0;
+ iocb.iocb_handle = 0;
+ iocb.iocb_flags = flg;
+ iocb.iocb_psize = 0;
+
+ cfe_iocb_dispatch(&iocb);
+
+ return iocb.iocb_status;
+}
+
+int cfe_getdevinfo(char *name)
+{
+ cfe_iocb_t iocb;
+
+ iocb.iocb_fcode = CFE_CMD_DEV_GETINFO;
+ iocb.iocb_status = 0;
+ iocb.iocb_handle = 0;
+ iocb.iocb_flags = 0;
+ iocb.iocb_psize = sizeof(iocb_buffer_t);
+ iocb.plist.iocb_buffer.buf_offset = 0;
+ iocb.plist.iocb_buffer.buf_ptr = (unsigned char*)name;
+ iocb.plist.iocb_buffer.buf_length = cfe_strlen(name);
+
+ cfe_iocb_dispatch(&iocb);
+
+ return (iocb.iocb_status < 0) ? iocb.iocb_status : (int)iocb.plist.iocb_buffer.buf_devflags;
+}
diff --git a/cfe/cfe/main/cfe_error.c b/cfe/cfe/main/cfe_error.c
new file mode 100644
index 0000000..198e7a4
--- /dev/null
+++ b/cfe/cfe/main/cfe_error.c
@@ -0,0 +1,134 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Error strings File: cfe_error.h
+ *
+ * This file contains a mapping from error codes to strings
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "cfe.h"
+#include "cfe_error.h"
+
+/* *********************************************************************
+ * Types
+ ********************************************************************* */
+
+
+typedef struct errmap_s {
+ int errcode;
+ const char *string;
+} errmap_t;
+
+/* *********************************************************************
+ * Error code list
+ ********************************************************************* */
+
+errmap_t cfe_errorstrings[] = {
+ {CFE_OK ,"No error"},
+ {CFE_ERR ,"Error"},
+ {CFE_ERR_INV_COMMAND ,"Invalid command"},
+ {CFE_ERR_EOF ,"End of file reached"},
+ {CFE_ERR_IOERR ,"I/O error"},
+ {CFE_ERR_NOMEM ,"Insufficient memory"},
+ {CFE_ERR_DEVNOTFOUND ,"Device not found"},
+ {CFE_ERR_DEVOPEN ,"Device is open"},
+ {CFE_ERR_INV_PARAM ,"Invalid parameter"},
+ {CFE_ERR_ENVNOTFOUND ,"Environment variable not found"},
+ {CFE_ERR_ENVREADONLY ,"Environment variable is read-only"},
+ {CFE_ERR_NOTELF ,"Not an ELF-format executable"},
+ {CFE_ERR_NOT32BIT ,"Not a 32-bit executable"},
+ {CFE_ERR_WRONGENDIAN ,"Executable is wrong-endian"},
+ {CFE_ERR_BADELFVERS ,"Invalid ELF file version"},
+ {CFE_ERR_NOTMIPS ,"Not a MIPS ELF file"},
+ {CFE_ERR_BADELFFMT ,"Invalid ELF file"},
+ {CFE_ERR_BADADDR ,"Section would load outside available DRAM"},
+ {CFE_ERR_FILENOTFOUND ,"File not found"},
+ {CFE_ERR_UNSUPPORTED ,"Unsupported function"},
+ {CFE_ERR_HOSTUNKNOWN ,"Host name unknown"},
+ {CFE_ERR_TIMEOUT ,"Timeout occured"},
+ {CFE_ERR_PROTOCOLERR ,"Network protocol error"},
+ {CFE_ERR_NETDOWN ,"Network is down"},
+ {CFE_ERR_NONAMESERVER ,"No name server configured"},
+ {CFE_ERR_NOHANDLES ,"No more handles"},
+ {CFE_ERR_ALREADYBOUND ,"Already bound"},
+ {CFE_ERR_CANNOTSET ,"Cannot set network parameter"},
+ {CFE_ERR_NOMORE ,"No more enumerated items"},
+ {CFE_ERR_BADFILESYS ,"File system not recognized"},
+ {CFE_ERR_FSNOTAVAIL ,"File system not available"},
+ {CFE_ERR_INVBOOTBLOCK ,"Invalid boot block on disk"},
+ {CFE_ERR_WRONGDEVTYPE ,"Device type is incorrect for boot method"},
+ {CFE_ERR_BBCHECKSUM ,"Boot block checksum is invalid"},
+ {CFE_ERR_BOOTPROGCHKSUM ,"Boot program checksum is invalid"},
+ {CFE_ERR_LDRNOTAVAIL, "Loader is not available"},
+ {CFE_ERR_NOTREADY, "Device is not ready"},
+ {CFE_ERR_GETMEM, "Cannot get memory at specified address"},
+ {CFE_ERR_SETMEM, "Cannot set memory at specified address"},
+ {CFE_ERR_NOTCONN, "Socket is not connected"},
+ {CFE_ERR_ADDRINUSE, "Address is in use"},
+ {0,NULL}};
+
+
+/* *********************************************************************
+ * cfe_errortext(err)
+ *
+ * Returns the text corresponding to a CFE error code
+ *
+ * Input parameters:
+ * err - error code
+ *
+ * Return value:
+ * string description of error
+ ********************************************************************* */
+
+const char *cfe_errortext(int err)
+{
+ errmap_t *e = cfe_errorstrings;
+
+ while (e->string) {
+ if (e->errcode == err) return e->string;
+ e++;
+ }
+
+ return (const char *) "Unknown error";
+}
+
diff --git a/cfe/cfe/main/cfe_fatfs.c b/cfe/cfe/main/cfe_fatfs.c
new file mode 100644
index 0000000..f2fa49f
--- /dev/null
+++ b/cfe/cfe/main/cfe_fatfs.c
@@ -0,0 +1,1983 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * FAT file system File: cfe_fatfs.c
+ *
+ * This module knows how to read files from a FAT formatted
+ * file system (12 or 16 bit fats only for now)
+ *
+ * Eventually, we'll also include support for the FAT Translation
+ * Layer (FTL) on PCMCIA flash file systems.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_error.h"
+#include "cfe_fileops.h"
+#include "cfe_iocb.h"
+#include "cfe_devfuncs.h"
+
+#include "cfe_loader.h"
+
+#include "cfe.h"
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define SECTORSIZE 512
+#define DIRENTRYSIZE 32
+#define DIRPERSECTOR (SECTORSIZE/DIRENTRYSIZE)
+
+/*#define _FATFS_DEBUG_*/
+
+/*
+ * Bios Parameter Block offsets and values
+ */
+
+#define BPB_JMPINSTR 0x00
+#define BPB_JMPINSTR_VALUE 0xEB
+#define BPB_JMPINSTR_VALUE2 0xE9
+#define BPB_SEAL 0x1FE
+#define BPB_SEAL_VALUE 0xAA55
+
+#define BPB_BYTESPERSECTOR 0x0B
+#define BPB_SECTORSPERCLUSTER 0x0D
+#define BPB_RESERVEDSECTORS 0x0E
+#define BPB_NUMFATS 0x10
+#define BPB_MAXROOTDIR 0x11
+#define BPB_TOTALSECTORS 0x13
+#define BPB_SECTORSPERFAT 0x16
+#define BPB_SECTORSPERTRACK 0x18
+#define BPB_NUMHEADS 0x1A
+#define BPB_HIDDENSECTORS 0x1C
+#define BPB_SYSTEMID 54
+#define BPB_MEDIADESCRIPTOR 21
+#define BPB_SIGNATURE 38
+#define BPB_SIGNATURE_VALUE1 0x28
+#define BPB_SIGNATURE_VALUE2 0x29
+
+/*
+ * Partition types
+ */
+
+#define PARTTYPE_EMPTY 0
+#define PARTTYPE_FAT12 1
+#define PARTTYPE_FAT16 4
+#define PARTTYPE_FAT16BIG 6
+#define PARTTYPE_FAT32 0x0B
+
+/*
+ * Partition table offsets
+ */
+#define PTABLE_STATUS 0
+#define PTABLE_STARTHEAD 1
+#define PTABLE_STARTSECCYL 2 /* 2 bytes */
+#define PTABLE_TYPE 4
+#define PTABLE_ENDHEAD 5
+#define PTABLE_ENDSECCYL 6 /* 2 bytes */
+#define PTABLE_BOOTSECTOR 8 /* 4 bytes */
+#define PTABLE_NUMSECTORS 12 /* 4 bytes */
+
+#define PTABLE_SIZE 16
+#define PTABLE_COUNT 4
+#define PTABLE_OFFSET (512-2-(PTABLE_COUNT*PTABLE_SIZE))
+
+#define PTABLE_STATUS_ACTIVE 0x80
+
+/*
+ * Directory attributes
+ */
+
+#define ATTRIB_NORMAL 0x00
+#define ATTRIB_READONLY 0x01
+#define ATTRIB_HIDDEN 0x02
+#define ATTRIB_SYSTEM 0x04
+#define ATTRIB_LABEL 0x08
+#define ATTRIB_DIR 0x10
+#define ATTRIB_ARCHIVE 0x20
+
+#define ATTRIB_LFN 0x0F
+
+/*
+ * Macros to read fields in directory & BPB entries
+ */
+
+#define READWORD(buffer,x) (((unsigned int) (buffer)[(x)]) | \
+ (((unsigned int) (buffer)[(x)+1]) << 8))
+
+#define READWORD32(buffer,x) (READWORD(buffer,(x)) | (READWORD(buffer,(x)+2) << 16))
+
+#define READBYTE(buffer,x) ((unsigned int) (buffer)[(x)])
+
+/*
+ * Directory entry offsets and values
+ */
+
+#define DIR_CHECKSUM 13
+#define DIR_FILELENGTH 28
+#define DIR_STARTCLUSTER 26
+#define DIR_ATTRIB 11
+#define DIR_NAMEOFFSET 0
+#define DIR_NAMELEN 8
+#define DIR_EXTOFFSET 8
+#define DIR_EXTLEN 3
+
+#define DIRENTRY_CHECKSUM(e) READBYTE(e,DIR_CHECKSUM)
+#define DIRENTRY_FILELENGTH(e) READWORD32(e,DIR_FILELENGTH)
+#define DIRENTRY_STARTCLUSTER(e) READWORD(e,DIR_STARTCLUSTER)
+#define DIRENTRY_ATTRIB(e) READBYTE(e,DIR_ATTRIB)
+
+#define DIRENTRY_LAST 0
+#define DIRENTRY_DELETED 0xE5
+#define DIRENTRY_PARENTDIR 0x2E
+
+#define DIRENTRY_LFNIDX(e) READBYTE(e,0)
+#define LFNIDX_MASK 0x1F
+#define LFNIDX_END 0x40
+#define LFNIDX_MAX 20
+
+/* *********************************************************************
+ * Types
+ ********************************************************************* */
+
+/*
+ * Internalized BPB
+ */
+
+typedef struct bpb_s {
+ unsigned int bpb_bytespersector;
+ unsigned int bpb_sectorspercluster;
+ unsigned int bpb_reservedsectors;
+ unsigned int bpb_numfats;
+ unsigned int bpb_maxrootdir;
+ unsigned int bpb_totalsectors;
+ unsigned int bpb_sectorsperfat;
+ unsigned int bpb_sectorspertrack;
+ unsigned int bpb_numheads;
+ unsigned int bpb_hiddensectors;
+} bpb_t;
+
+/*
+ * FAT Filesystem descriptor - contains working information
+ * about an "open" file system
+ */
+
+typedef struct fatfs_s {
+ int fat_fh;
+ int fat_refcnt;
+ bpb_t fat_bpb;
+ int fat_twelvebit;
+ int fat_partstart;
+ uint8_t fat_dirsector[SECTORSIZE];
+ int fat_dirsecnum;
+ uint8_t fat_fatsector[SECTORSIZE];
+ int fat_fatsecnum;
+} fatfs_t;
+
+/*
+ * FAT Chain - describes a series of FAT entries
+ */
+
+typedef struct fatchain_s {
+ int fat_start;
+ uint16_t *fat_entries;
+ int fat_count;
+} fatchain_t;
+
+/*
+ * FAT File descriptor - contains working information
+ * about an open file (including the filesystem info)
+ */
+
+typedef struct fatfile_s {
+ fatfs_t *ff_fat;
+ int ff_filelength;
+ fatchain_t ff_chain;
+ int ff_curpos;
+ int ff_cursector;
+ uint8_t ff_sector[SECTORSIZE];
+} fatfile_t;
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+static int fatfs_fileop_xinit(void **fsctx,void *filename);
+static int fatfs_fileop_pinit(void **fsctx,void *filename);
+static int fatfs_fileop_open(void **ref,void *fsctx,char *filename,int mode);
+static int fatfs_fileop_read(void *ref,uint8_t *buf,int len);
+static int fatfs_fileop_write(void *ref,uint8_t *buf,int len);
+static int fatfs_fileop_seek(void *ref,int offset,int how);
+static void fatfs_fileop_close(void *ref);
+static void fatfs_fileop_uninit(void *fsctx);
+
+static int fatfs_check_for_partition_table(fatfs_t *fatfs);
+
+/* *********************************************************************
+ * FAT fileio dispatch table
+ ********************************************************************* */
+
+/*
+ * Raw FAT (no partition table) - used only on floppies
+ */
+
+const fileio_dispatch_t fatfs_fileops = {
+ "rfat",
+ LOADFLG_NOBB,
+ fatfs_fileop_xinit,
+ fatfs_fileop_open,
+ fatfs_fileop_read,
+ fatfs_fileop_write,
+ fatfs_fileop_seek,
+ fatfs_fileop_close,
+ fatfs_fileop_uninit
+};
+
+/*
+ * Partitioned FAT - used on Zip disks, removable hard disks,
+ * hard disks, flash cards, etc.
+ */
+
+const fileio_dispatch_t pfatfs_fileops = {
+ "fat",
+ LOADFLG_NOBB,
+ fatfs_fileop_pinit,
+ fatfs_fileop_open,
+ fatfs_fileop_read,
+ fatfs_fileop_write,
+ fatfs_fileop_seek,
+ fatfs_fileop_close,
+ fatfs_fileop_uninit
+};
+
+
+/* *********************************************************************
+ * fat_readsector(fatfs,sector,numsec,buffer)
+ *
+ * Read one or more sectors from the disk into memory
+ *
+ * Input parameters:
+ * fatfs - fat filesystem descriptor
+ * sector - sector number
+ * numsec - number of sectors to read
+ * buffer - buffer to read sectors into
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int fat_readsector(fatfs_t *fatfs,int sector,int numsec,uint8_t *buffer)
+{
+ int res;
+
+ res = cfe_readblk(fatfs->fat_fh,(sector+fatfs->fat_partstart)*SECTORSIZE,
+ buffer,numsec*SECTORSIZE);
+
+ if (res != numsec*SECTORSIZE) return CFE_ERR_IOERR;
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * fat_dumpbpb(bpb)
+ *
+ * Debug function; display fields in a BPB
+ *
+ * Input parameters:
+ * bpb - BIOS parameter block structure
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+#ifdef _FATFS_DEBUG_
+static void fat_dumpbpb(bpb_t *bpb)
+{
+ xprintf("Bytes per sector %d\n",bpb->bpb_bytespersector);
+ xprintf("Sectors per cluster %d\n",bpb->bpb_sectorspercluster);
+ xprintf("Reserved sectors %d\n",bpb->bpb_reservedsectors);
+ xprintf("Number of FATs %d\n",bpb->bpb_numfats);
+ xprintf("Root dir entries %d\n",bpb->bpb_maxrootdir);
+ xprintf("Total sectors %d\n",bpb->bpb_totalsectors);
+ xprintf("Sectors per FAT %d\n",bpb->bpb_sectorsperfat);
+ xprintf("Sectors per track %d\n",bpb->bpb_sectorspertrack);
+ xprintf("Number of heads %d\n",bpb->bpb_numheads);
+ xprintf("Hidden sectors %d\n",bpb->bpb_hiddensectors);
+}
+#endif
+
+/* *********************************************************************
+ * fat_findpart(fatfs)
+ *
+ * For partitioned disks, locate the active partition
+ * and set "fat_partstart" accordingly
+ *
+ * Input parameters:
+ * fatfs - FAT filesystem descriptor
+ *
+ * Return value:
+ * 0 if we found a valid partition table; else error code
+ ********************************************************************* */
+
+static int fat_findpart(fatfs_t *fatfs)
+{
+ uint8_t buffer[SECTORSIZE];
+ uint8_t *part;
+ int res;
+ int idx;
+
+ fatfs->fat_partstart = 0; /* make sure we get real boot sector */
+ res = fat_readsector(fatfs,0,1,buffer);
+ if (res < 0) return res;
+
+ /*
+ * Normally you're supposed to check for a JMP instruction.
+ * At least that's what many people do. Flash MBRs don't start
+ * with JMP instructions, so just look for the seal.
+ *
+ *
+ * if (READBYTE(buffer,BPB_JMPINSTR) != BPB_JMPINSTR_VALUE) {
+ * return CFE_ERR_BADFILESYS;
+ * }
+ */
+
+ /*
+ * Check the seal at the end of th sector
+ */
+
+ if (READWORD(buffer,BPB_SEAL) != BPB_SEAL_VALUE) return CFE_ERR_BADFILESYS;
+
+ /*
+ * Look for an active FAT partition. The partition we want must
+ * be the active one. We do not deal with extended partitions
+ * here. Hey, this is supposed to be boot code!
+ */
+
+ part = &buffer[PTABLE_OFFSET];
+ for (idx = 0; idx < PTABLE_COUNT; idx++) {
+ if ((part[PTABLE_STATUS] == PTABLE_STATUS_ACTIVE) &&
+ ((part[PTABLE_TYPE] == PARTTYPE_FAT12) ||
+ (part[PTABLE_TYPE] == PARTTYPE_FAT16) ||
+ (part[PTABLE_TYPE] == PARTTYPE_FAT16BIG))) {
+ break;
+ }
+
+ part += PTABLE_SIZE;
+ }
+
+ if (idx == PTABLE_COUNT) return CFE_ERR_BADFILESYS;
+
+ /*
+ * The info we want is really just the pointer to the
+ * boot (BPB) sector. Get that and we'll use it for an
+ * offset into the disk later.
+ */
+
+ fatfs->fat_partstart = READWORD32(part,PTABLE_BOOTSECTOR);
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * fat_readbpb(fatfs)
+ *
+ * Read and internalize the BIOS Parameter Block
+ *
+ * Input parameters:
+ * fatfs - FAT filesystem descriptor
+ *
+ * Return value:
+ * 0 if ok
+ * else error code (usually, BPB is not valid)
+ ********************************************************************* */
+
+static int fat_readbpb(fatfs_t *fatfs)
+{
+ uint8_t buffer[SECTORSIZE];
+ int res;
+
+ res = fat_readsector(fatfs,0,1,buffer);
+ if (res < 0) return res;
+
+ if (READBYTE(buffer,BPB_JMPINSTR) != BPB_JMPINSTR_VALUE) return CFE_ERR_BADFILESYS;
+ if (READWORD(buffer,BPB_SEAL) != BPB_SEAL_VALUE) return CFE_ERR_BADFILESYS;
+
+ fatfs->fat_bpb.bpb_bytespersector = READWORD(buffer,BPB_BYTESPERSECTOR);
+ fatfs->fat_bpb.bpb_sectorspercluster = READBYTE(buffer,BPB_SECTORSPERCLUSTER);
+ fatfs->fat_bpb.bpb_reservedsectors = READWORD(buffer,BPB_RESERVEDSECTORS);
+ fatfs->fat_bpb.bpb_numfats = READBYTE(buffer,BPB_NUMFATS);
+ fatfs->fat_bpb.bpb_maxrootdir = READWORD(buffer,BPB_MAXROOTDIR);
+ fatfs->fat_bpb.bpb_totalsectors = READWORD(buffer,BPB_TOTALSECTORS);
+ fatfs->fat_bpb.bpb_sectorsperfat = READWORD(buffer,BPB_SECTORSPERFAT);
+ fatfs->fat_bpb.bpb_sectorspertrack = READWORD(buffer,BPB_SECTORSPERTRACK);
+ fatfs->fat_bpb.bpb_numheads = READWORD(buffer,BPB_NUMHEADS);
+ fatfs->fat_bpb.bpb_hiddensectors = READWORD(buffer,BPB_HIDDENSECTORS);
+
+ fatfs->fat_twelvebit = 1;
+ if (memcmp(&buffer[0x36],"FAT16 ",8) == 0) fatfs->fat_twelvebit = 0;
+
+ if (fatfs->fat_bpb.bpb_bytespersector != SECTORSIZE) return CFE_ERR_BADFILESYS;
+ if (fatfs->fat_bpb.bpb_numfats > 2) return CFE_ERR_BADFILESYS;
+
+ /*
+ * XXX sanity check other fields
+ */
+
+#ifdef _FATFS_DEBUG_
+ fat_dumpbpb(&(fatfs->fat_bpb));
+#endif
+
+ return 0;
+}
+
+
+
+/* *********************************************************************
+ * fat_getentry(fatfs,entry)
+ *
+ * Read a FAT entry. This is more involved than you'd think,
+ * since we have to deal with 12 and 16 (and someday 32) bit FATs,
+ * and the nasty case where a 12-bit FAT entry crosses a sector
+ * boundary.
+ *
+ * Input parameters:
+ * fatfs - FAT filesystem descriptor
+ * entry - index of FAT entry
+ *
+ * Return value:
+ * FAT entry, or <0 if an error occured
+ ********************************************************************* */
+
+static int fat_getfatentry(fatfs_t *fatfs,int entry)
+{
+ int fatsect;
+ int byteoffset;
+ int fatstart;
+ int fatoffset;
+ uint8_t b1,b2,b3;
+ int res;
+
+ fatstart = fatfs->fat_bpb.bpb_reservedsectors;
+
+ if (fatfs->fat_twelvebit) {
+ int odd;
+ odd = entry & 1;
+ byteoffset = ((entry & ~1) * 3) / 2;
+ fatsect = byteoffset / SECTORSIZE;
+ fatoffset = byteoffset % SECTORSIZE;
+
+ if (fatfs->fat_fatsecnum != fatsect) {
+ res = fat_readsector(fatfs,fatsect+fatstart,1,fatfs->fat_fatsector);
+ if (res < 0) {
+ return res;
+ }
+ fatfs->fat_fatsecnum = fatsect;
+ }
+
+ b1 = fatfs->fat_fatsector[fatoffset];
+
+ if ((fatoffset+1) >= SECTORSIZE) {
+ res = fat_readsector(fatfs,fatsect+1+fatstart,1,fatfs->fat_fatsector);
+ if (res < 0) {
+ return res;
+ }
+ fatfs->fat_fatsecnum = fatsect+1;
+ fatoffset -= SECTORSIZE;
+ }
+
+ b2 = fatfs->fat_fatsector[fatoffset+1];
+
+ if ((fatoffset+2) >= SECTORSIZE) {
+ res = fat_readsector(fatfs,fatsect+1+fatstart,1,fatfs->fat_fatsector);
+ if (res < 0) {
+ return res;
+ }
+ fatfs->fat_fatsecnum = fatsect+1;
+ fatoffset -= SECTORSIZE;
+ }
+
+ b3 = fatfs->fat_fatsector[fatoffset+2];
+
+ if (odd) {
+ return ((unsigned int) b3 << 4) + ((unsigned int) (b2 & 0xF0) >> 4);
+ }
+ else {
+ return ((unsigned int) (b2 & 0x0F) << 8) + ((unsigned int) b1);
+ }
+
+ }
+ else {
+ byteoffset = entry * 2;
+ fatsect = byteoffset / SECTORSIZE;
+ fatoffset = byteoffset % SECTORSIZE;
+
+ if (fatfs->fat_fatsecnum != fatsect) {
+ res = fat_readsector(fatfs,fatsect+fatstart,1,fatfs->fat_fatsector);
+ if (res < 0) {
+ return res;
+ }
+ fatfs->fat_fatsecnum = fatsect;
+ }
+
+ b1 = fatfs->fat_fatsector[fatoffset];
+ b2 = fatfs->fat_fatsector[fatoffset+1];
+ return ((unsigned int) b1) + (((unsigned int) b2) << 8);
+ }
+}
+
+/* *********************************************************************
+ * fat_getrootdirentry(fatfs,entryidx,entry)
+ *
+ * Read a root directory entry. The FAT12/16 root directory
+ * is a contiguous group of sectors, whose size is specified in
+ * the BPB. This routine just digs out an entry from there
+ *
+ * Input parameters:
+ * fatfs - FAT filesystem descriptor
+ * entryidx - 0-based entry index to read
+ * entry - pointer to directory entry (32 bytes)
+ *
+ * Return value:
+ * 0 if ok
+ * <0 if error occured
+ ********************************************************************* */
+
+static int fat_getrootdirentry(fatfs_t *fatfs,int entryidx,uint8_t *entry)
+{
+ int rootdirstart;
+ int rootdirsize;
+ int dirsecnum;
+ int res;
+
+ if (entryidx >= fatfs->fat_bpb.bpb_maxrootdir) {
+ memset(entry,0,DIRENTRYSIZE);
+ return CFE_ERR_INV_PARAM;
+ }
+
+ rootdirstart = fatfs->fat_bpb.bpb_reservedsectors +
+ fatfs->fat_bpb.bpb_numfats * fatfs->fat_bpb.bpb_sectorsperfat;
+
+ rootdirsize = fatfs->fat_bpb.bpb_maxrootdir / DIRENTRYSIZE;
+
+ dirsecnum = rootdirstart + entryidx / DIRPERSECTOR;
+
+ if (fatfs->fat_dirsecnum != dirsecnum) {
+ res = fat_readsector(fatfs,dirsecnum,1,fatfs->fat_dirsector);
+ if (res < 0) {
+ return res;
+ }
+ fatfs->fat_dirsecnum = dirsecnum;
+ }
+
+ memcpy(entry,&(fatfs->fat_dirsector[(entryidx % DIRPERSECTOR)*DIRENTRYSIZE]),
+ DIRENTRYSIZE);
+
+ return 0;
+}
+
+/* *********************************************************************
+ * fat_checksumname(name)
+ *
+ * Calculate the "long filename" checksum for a given short name.
+ * All LFN directory entries associated with the short name are
+ * given the same checksum byte, to help keep the long name
+ * consistent.
+ *
+ * Input parameters:
+ * name - pointer to 32-byte directory entry
+ *
+ * Return value:
+ * checksum value
+ ********************************************************************* */
+
+static uint8_t fat_checksumname(uint8_t *name)
+{
+ uint8_t sum = 0;
+ uint8_t newbit;
+ int idx;
+
+ for (idx = 0; idx < 11; idx++) {
+ newbit = (sum & 1) ? 0x80 : 0x00;
+ sum >>= 1;
+ sum |= newbit;
+ sum += name[idx];
+ }
+
+ return sum;
+}
+
+#ifdef _FATFS_DEBUG_
+void fat_dumpdirentry(uint8_t *entry);
+void fat_dumpdirentry(uint8_t *entry)
+{
+ uint8_t name[32];
+ int idx;
+
+ if (entry[11] != ATTRIB_LFN) {
+ memcpy(name,entry,11);
+ name[11] = 0;
+ xprintf("%s %02X %04X %d\n",
+ name,DIRENTRY_ATTRIB(entry),
+ DIRENTRY_STARTCLUSTER(entry),
+ DIRENTRY_FILELENGTH(entry));
+ }
+ else {
+ for (idx = 0; idx < 5; idx++) {
+ name[idx] = entry[(idx*2)+1];
+ }
+ for (idx = 0; idx < 6; idx++) {
+ name[idx+5] = entry[(idx*2)+14];
+ }
+ for (idx = 0; idx < 2; idx++) {
+ name[idx+11] = entry[(idx*2)+28];
+ }
+ name[13] = '\0';
+ xprintf("%02X: %s %04X cksum %02X\n",entry[0],
+ name,READWORD(entry,0x1A),entry[13]);
+ }
+}
+#endif
+
+
+/* *********************************************************************
+ * fat_walkfatchain(fat,start,arg,func)
+ *
+ * Walk a FAT chain, calling a callback routine for each entry
+ * we find along the way.
+ *
+ * Input parameters:
+ * fat - FAT filesystem descriptor
+ * start - starting FAT entry (from the directory, usually)
+ * arg - argument to pass to callback routine
+ * func - function to call for each FAT entry
+ *
+ * Return value:
+ * 0 if all elements processed
+ * <0 if error occured
+ * >0 if callback routine returned a nonzero value
+ ********************************************************************* */
+
+static int fat_walkfatchain(fatfs_t *fat,int start,
+ void *arg,
+ int (*func)(fatfs_t *fat,
+ int e,
+ int prev_e,
+ void *arg))
+{
+ int prev_e = 0;
+ int ending_e;
+ int e;
+ int res = 0;
+
+ e = start;
+
+ /* Note: ending FAT entry can be 0x(F)FF8..0x(F)FFF. We assume that the
+ 'getfatentry' call won't return values above that. */
+ if (fat->fat_twelvebit) {
+ ending_e = 0xFF8;
+ }
+ else {
+ ending_e = 0xFFF8;
+ }
+
+ while (e < ending_e) {
+ res = (*func)(fat,e,prev_e,arg);
+ if (res) break;
+ prev_e = e;
+ e = fat_getfatentry(fat,e);
+ if (e < 0) return e;
+ }
+
+ return res;
+}
+
+/* *********************************************************************
+ * fat_getwalkfunc(fat,e,prev_e,arg)
+ *
+ * Callback routien to collect all of the FAT entries into
+ * a FAT chain descriptor
+ *
+ * Input parameters:
+ * fat - FAT filesystem descriptor
+ * e - current entry
+ * prev_e - previous entry (0 if first entry)
+ * arg - argument passed to fat_walkfatchain
+ *
+ * Return value:
+ * 0 to keep walking
+ * else value to return from fat_walkfatchain
+ ********************************************************************* */
+
+static int fat_getwalkfunc(fatfs_t *fat,int e,
+ int prev_e,void *arg)
+{
+ fatchain_t *chain = arg;
+
+ if (chain->fat_entries) {
+ chain->fat_entries[chain->fat_count] = (uint16_t) e;
+ }
+
+ chain->fat_count++;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * fat_getchain(fat,start,chain)
+ *
+ * Walk an entire FAT chain and remember the chain in a
+ * FAT chain descriptor
+ *
+ * Input parameters:
+ * fat - FAT filesystem descriptor
+ * start - starting FAT entry
+ * chain - chain descriptor
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int fat_getchain(fatfs_t *fat,int start,fatchain_t *chain)
+{
+ int res;
+
+ chain->fat_entries = NULL;
+ chain->fat_count = 0;
+ chain->fat_start = start;
+
+ /*
+ * walk once to count the entries.
+ *
+ * For regular files, you probably don't have to do this
+ * since you can predict exactly how many FAT entries
+ * there are given the file length.
+ */
+
+ res = fat_walkfatchain(fat,start,chain,fat_getwalkfunc);
+ if (res < 0) return res;
+
+ /*
+ * allocate space for the entries. Include one extra
+ * slot for the first entry, since the first entry
+ * does not actually appear in the FAT (the fat is
+ * only the 'next' pointers).
+ */
+
+ if (chain->fat_count == 0) return 0;
+ chain->fat_entries = KMALLOC((chain->fat_count+1)*sizeof(uint16_t),0);
+ chain->fat_count = 0;
+
+ /*
+ * walk again to collect entries
+ */
+ res = fat_walkfatchain(fat,start,chain,fat_getwalkfunc);
+ if (res < 0) return res;
+
+ return chain->fat_count;
+}
+
+
+/* *********************************************************************
+ * fat_freechain(chain)
+ *
+ * Free memory associated with a FAT chain
+ *
+ * Input parameters:
+ * chain - chain descriptor
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void fat_freechain(fatchain_t *chain)
+{
+ if (chain->fat_entries) {
+ KFREE(chain->fat_entries);
+ chain->fat_entries = NULL;
+ }
+ chain->fat_count = 0;
+}
+
+/* *********************************************************************
+ * fat_clusteridx(fat,chain,idx)
+ *
+ * Index into a FAT chain and return the nth cluster number
+ * from the chain
+ *
+ * Input parameters:
+ * fat - fat filesystem descriptor
+ * chain - chain descriptor
+ * idx - index into FAT chain
+ *
+ * Return value:
+ * FAT entry at the nth index, or
+ * <0 if an error occured
+ ********************************************************************* */
+static int fat_clusteridx(fatfs_t *fat,fatchain_t *chain,int idx)
+{
+ if (idx >= chain->fat_count) return CFE_ERR_INV_PARAM; /* error! */
+ return (int) (unsigned int) chain->fat_entries[idx];
+}
+
+/* *********************************************************************
+ * fat_sectoridx(fat,chain,idx)
+ *
+ * Return the sector nunber of the nth sector in a given
+ * FAT chain. This routine knows how to translate cluster
+ * numbers into sector numbers.
+ *
+ * Input parameters:
+ * fat - FAT filesystem descriptor
+ * chain - FAT chain
+ * idx - index of which sector to find
+ *
+ * Return value:
+ * sector number
+ * <0 if an error occured
+ ********************************************************************* */
+static int fat_sectoridx(fatfs_t *fat,fatchain_t *chain,int idx)
+{
+ int clusteridx;
+ int sectoridx;
+ int sector;
+ int fatentry;
+
+ clusteridx = idx / fat->fat_bpb.bpb_sectorspercluster;
+ sectoridx = idx % fat->fat_bpb.bpb_sectorspercluster;
+
+ fatentry = fat_clusteridx(fat,chain,clusteridx);
+
+ if (fatentry < 0) xprintf("ran off end of fat chain!\n");
+ if (fatentry < 2) xprintf("fat entries should be >= 2\n");
+
+ sector = fat->fat_bpb.bpb_reservedsectors +
+ (fat->fat_bpb.bpb_maxrootdir * DIRENTRYSIZE)/SECTORSIZE +
+ (fat->fat_bpb.bpb_numfats * fat->fat_bpb.bpb_sectorsperfat) +
+ (fatentry - 2) * fat->fat_bpb.bpb_sectorspercluster +
+ sectoridx;
+
+ return sector;
+}
+
+/* *********************************************************************
+ * fat_getsubdirentry(fat,chain,idx,direntry)
+ *
+ * This routine is similar to fat_getrootdirentry except it
+ * works on a subdirectory. FAT subdirectories are like files
+ * containing directory entries, so we use the "get nth sector
+ * in chain" routines to walk the chains of sectors reading directory
+ * entries.
+ *
+ * Input parameters:
+ * fat - FAT filesystem descriptor
+ * chain - FAT chain
+ * idx - index of entry to read
+ * direntry - place to put directory entry we read
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int fat_getsubdirentry(fatfs_t *fat,fatchain_t *chain,
+ int idx,uint8_t *direntry)
+{
+ int sector;
+ int res;
+
+ sector = fat_sectoridx(fat,chain,idx/DIRPERSECTOR);
+
+ if (sector < 0) return sector;
+
+ if (fat->fat_dirsecnum != sector) {
+ res = fat_readsector(fat,sector,1,fat->fat_dirsector);
+ if (res < 0) {
+ return res;
+ }
+ fat->fat_dirsecnum = sector;
+ }
+
+ memcpy(direntry,&(fat->fat_dirsector[(idx % DIRPERSECTOR)*DIRENTRYSIZE]),
+ DIRENTRYSIZE);
+
+ return 0;
+}
+
+/* *********************************************************************
+ * fat_getshortname(direntry,name)
+ *
+ * Read the short filename from a directory entry, converting
+ * it into its classic 8.3 form
+ *
+ * Input parameters:
+ * direntry - directory entry
+ * name - place to put 8.3 name
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void fat_getshortname(uint8_t *direntry,char *name)
+{
+ int idx;
+
+ /*
+ * Collect the base file name
+ */
+
+ for (idx = DIR_NAMEOFFSET; idx < (DIR_NAMEOFFSET+DIR_NAMELEN); idx++) {
+ if (direntry[idx] == ' ') break;
+ *name++ = direntry[idx];
+ }
+
+ /*
+ * Put in the dot for the extension only if there
+ * is an extension.
+ */
+
+ if (direntry[DIR_EXTOFFSET] != ' ') *name++ = '.';
+
+ /*
+ * Collect the extension
+ */
+
+ for (idx = DIR_EXTOFFSET; idx < (DIR_EXTOFFSET+DIR_EXTLEN); idx++) {
+ if (direntry[idx] == ' ') break;
+ *name++ = direntry[idx];
+ }
+
+ *name = '\0';
+}
+
+
+/* *********************************************************************
+ * fat_getlongname(fat,chain,diridx,shortentry,longname)
+ *
+ * Look backwards in the directory to locate the long file name
+ * that corresponds to the short file name passed in 'shortentry'
+ *
+ * Input parameters:
+ * fat - FAT filesystem descriptor
+ * chain - chain describing current directory, or NULL
+ * if the current directory is the root directory
+ * diridx - index of the short file name
+ * shortentry - points to the short directory entry
+ * longname - buffer to receive long file name (up to 261 chars)
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int fat_getlongname(fatfs_t *fat,fatchain_t *chain,int diridx,
+ uint8_t *shortentry,char *longname)
+{
+ int lfnidx = 1;
+ uint8_t checksum;
+ uint8_t direntry[DIRENTRYSIZE];
+ int idx;
+ char *lfnptr;
+ int badlfn = 0;
+
+ *longname = '\0';
+
+ /*
+ * idx is the entry # of the short name
+ */
+
+ checksum = fat_checksumname(shortentry);
+
+ /*
+ * Start working backwards from current entry
+ * and collect pieces of the lfn
+ */
+
+ lfnptr = longname;
+ diridx--;
+
+ while (diridx > 0) {
+
+ /*
+ * Read previous entry
+ */
+
+ if (chain) {
+ fat_getsubdirentry(fat,chain,diridx,direntry);
+ }
+ else {
+ fat_getrootdirentry(fat,diridx,direntry);
+ }
+
+ /*
+ * Checksum must match, it must have the right entry index,
+ * and it must have the LFN attribute
+ */
+
+ if (DIRENTRY_CHECKSUM(direntry) != checksum) {
+ badlfn = 1;
+ break;
+ }
+ if ((DIRENTRY_LFNIDX(direntry) & LFNIDX_MASK) != lfnidx) {
+ badlfn = 1;
+ break;
+ }
+
+ if (DIRENTRY_ATTRIB(direntry) != ATTRIB_LFN) {
+ badlfn = 1;
+ break;
+ }
+
+ /*
+ * Collect the chars from the filename. Note we
+ * don't deal well with real unicode chars here.
+ */
+
+ for (idx = 0; idx < 5; idx++) {
+ *lfnptr++ = direntry[(idx*2)+1];
+ }
+ for (idx = 0; idx < 6; idx++) {
+ *lfnptr++ = direntry[(idx*2)+14];
+ }
+ for (idx = 0; idx < 2; idx++) {
+ *lfnptr++ = direntry[(idx*2)+28];
+ }
+
+ /*
+ * Don't go too far
+ */
+
+ if (DIRENTRY_LFNIDX(direntry) & LFNIDX_END) break;
+ lfnidx++;
+ if (lfnidx > LFNIDX_MAX) {
+ badlfn = 1;
+ break;
+ }
+
+ diridx--;
+ }
+
+ /*
+ * Null terminate the lfn
+ */
+
+ *lfnptr = 0;
+
+ if (badlfn) {
+ longname[0] = 0;
+ return CFE_ERR_FILENOTFOUND;
+ }
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * fat_scandir(fat,chain,name,direntry)
+ *
+ * Scan a single directory looking for a file name
+ *
+ * Input parameters:
+ * fat - FAT filesystem descriptor
+ * chain - FAT chain for directory or NULL for root directory
+ * name - name of file to look for (short or long name)
+ * direntry - place to put directory entry if we find one
+ *
+ * Return value:
+ * 1 if name was found
+ * 0 if name was not found
+ * else <0 is error code
+ ********************************************************************* */
+
+
+static int fat_scandir(fatfs_t *fat,fatchain_t *chain,
+ char *name,uint8_t *direntry)
+{
+ int idx;
+ int count;
+ char shortname[16];
+ char longname[280];
+
+ /*
+ * Get directory size
+ */
+
+ if (chain) {
+ count = (chain->fat_count * fat->fat_bpb.bpb_sectorspercluster) * DIRPERSECTOR;
+ }
+ else {
+ count = (int) fat->fat_bpb.bpb_maxrootdir;
+ }
+
+ /*
+ * Scan whole directory
+ */
+
+ for (idx = 0; idx < count; idx++) {
+
+ /*
+ * Get entry by root or chain depending...
+ */
+
+ if (chain) {
+ fat_getsubdirentry(fat,chain,idx,direntry);
+ }
+ else {
+ fat_getrootdirentry(fat,idx,direntry);
+ }
+
+ /*
+ * Ignore stuff we don't want to see
+ */
+
+ if (direntry[0] == DIRENTRY_LAST) break; /* stop if at end of dir */
+ if (direntry[0] == DIRENTRY_DELETED) continue; /* skip deleted entries */
+ if (direntry[0] == DIRENTRY_PARENTDIR) continue; /* skip ./.. entries */
+
+ if (DIRENTRY_ATTRIB(direntry) == ATTRIB_LFN) continue; /* skip LFNs */
+ if (DIRENTRY_ATTRIB(direntry) & ATTRIB_LABEL) continue; /* skip volume labels */
+
+ /*
+ * Get actual file names from directory
+ */
+
+ fat_getshortname(direntry,shortname);
+ fat_getlongname(fat,chain,idx,direntry,longname);
+
+
+ if (name) {
+ if (strcmpi(name,shortname) == 0) return 1;
+ if (longname[0] && (strcmpi(name,longname) == 0)) return 1;
+ }
+ else {
+ xprintf("%-30s",longname[0] ? longname : shortname);
+// xprintf(" Clus=%04X",DIRENTRY_STARTCLUSTER(direntry));
+// xprintf(" Attrib=%02X",DIRENTRY_ATTRIB(direntry));
+// xprintf(" Size=%d",DIRENTRY_FILELENGTH(direntry));
+ xprintf("%d",DIRENTRY_FILELENGTH(direntry));
+ xprintf("\n");
+ }
+ }
+
+ return 0;
+}
+
+/* *********************************************************************
+ * fat_findfile(fat,name,direntry)
+ *
+ * Locate a directory entry given a complete path name
+ *
+ * Input parameters:
+ * fat - FAT filesystem descriptor
+ * name - name of file to locate (forward or reverse slashses ok)
+ * direntry - place to put directory entry we find
+ *
+ * Return value:
+ * 0 if file not found
+ * 1 if file was found
+ * <0 if error occurs
+ ********************************************************************* */
+
+static int fat_findfile(fatfs_t *fat,char *name,uint8_t *direntry)
+{
+ char *namecopy;
+ char *namepart;
+ char *ptr;
+ fatchain_t chain;
+ int res;
+ int e;
+
+ /*
+ * Copy the name, we're going to hack it up
+ */
+
+ namecopy = strdup(name);
+
+ /*
+ * Chew off the first piece up to the first slash. Remove
+ * a leading slash if it is there.
+ */
+
+ ptr = namecopy;
+
+ if ((*ptr == '/') || (*ptr == '\\')) ptr++;
+
+ namepart = ptr;
+ while (*ptr && (*ptr != '/') && (*ptr != '\\')) ptr++;
+ if (*ptr) *ptr++ = '\0';
+
+ /*
+ * Scan the root directory looking for the first piece
+ */
+
+ res = fat_scandir(fat,NULL,namepart,direntry);
+ if (res == 0) {
+ KFREE(namecopy);
+ return 0; /* file not found */
+ }
+
+
+ /*
+ * Start scanning subdirectories until we run out
+ * of directory components.
+ */
+
+ namepart = ptr;
+ while (*ptr && (*ptr != '/') && (*ptr != '\\')) ptr++;
+ if (*ptr) *ptr++ = '\0';
+ if (!*namepart) namepart = NULL;
+
+
+ while (namepart) {
+
+ /*
+ * Scan the subdirectory
+ */
+
+ e = DIRENTRY_STARTCLUSTER(direntry);
+ memset(&chain,0,sizeof(chain));
+ fat_getchain(fat,e,&chain);
+ res = fat_scandir(fat,&chain,namepart,direntry);
+ if (res == 0) {
+ break;
+ }
+ fat_freechain(&chain);
+
+ /*
+ * Advance to the next piece
+ */
+
+ namepart = ptr;
+ while (*ptr && (*ptr != '/') && (*ptr != '\\')) ptr++;
+ if (*ptr) *ptr++ = '\0';
+ if (!*namepart) namepart = NULL;
+
+ /*
+ * If there's more to go and we hit something that
+ * is not a directory, stop here.
+ */
+
+ if (namepart && !(DIRENTRY_ATTRIB(direntry) & ATTRIB_DIR)) {
+ res = 0;
+ }
+ }
+
+ KFREE(namecopy);
+
+ /*
+ * The last piece we enumerate has to be a file.
+ */
+
+ if ((res > 0) &&
+ (DIRENTRY_ATTRIB(direntry) & ATTRIB_DIR)) {
+ return 0;
+ }
+
+ return res;
+}
+
+
+/* *********************************************************************
+ * fat_init(fat,name)
+ *
+ * Create the filesystem descriptor and attach to the hardware
+ * device.
+ *
+ * Input parameters:
+ * fat - filesystem descriptor
+ * name - hardware device name
+ * part - true to look for partition tables
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int fat_init(fatfs_t *fat,char *name,int part)
+{
+ int res;
+
+ memset(fat,0,sizeof(fatfs_t));
+ fat->fat_dirsecnum = -1;
+ fat->fat_fatsecnum = -1;
+
+ fat->fat_fh = cfe_open(name);
+
+ if (fat->fat_fh < 0) return fat->fat_fh;
+
+ res = fatfs_check_for_partition_table(fat);
+ /* If we were able to figure it out, use that as the default */
+ if (res >= 0) part = res;
+
+ if (part) {
+ res = fat_findpart(fat);
+ if (res < 0) {
+ cfe_close(fat->fat_fh);
+ fat->fat_fh = -1;
+ return res;
+ }
+ }
+
+ res = fat_readbpb(fat);
+ if (res != 0) {
+ cfe_close(fat->fat_fh);
+ fat->fat_fh = -1;
+ return res;
+ }
+
+ return 0;
+}
+
+/* *********************************************************************
+ * fat_uninit(fat)
+ *
+ * Uninit the filesystem descriptor and release any resources
+ * we allocated.
+ *
+ * Input parameters:
+ * fat - filesystem descriptor
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void fat_uninit(fatfs_t *fat)
+{
+ if (fat->fat_fh >= 0) cfe_close(fat->fat_fh);
+ fat->fat_fh = -1;
+}
+
+int fatfs_fileop_dir(void *fsctx);
+int fatfs_fileop_dir(void *fsctx)
+{
+ fatfs_t *fatfs = fsctx;
+ uint8_t direntry[32];
+
+ fat_scandir(fatfs,NULL,NULL,direntry);
+
+ return 0;
+}
+
+/* *********************************************************************
+ * fatfs_fileop_init(fsctx,devname)
+ *
+ * Create a FAT filesystem context and open the associated
+ * block device.
+ *
+ * Input parameters:
+ * fsctx - file system context (return pointer)
+ * devname - device name to open
+ * part - true to look for a partition table
+ *
+ * Return value:
+ * 0 if ok, else error
+ ********************************************************************* */
+
+static int fatfs_fileop_init(void **fsctx,char *devname,int part)
+{
+ int res;
+ fatfs_t *fatfs;
+
+ /*
+ * Allocate a file system context
+ */
+
+ fatfs = (fatfs_t *) KMALLOC(sizeof(fatfs_t),0);
+ if (!fatfs) return CFE_ERR_NOMEM;
+
+ /*
+ * Open a handle to the underlying device
+ */
+
+ res = fat_init(fatfs,devname,part);
+ if (res != 0) {
+ KFREE(fatfs);
+ return res;
+ }
+
+ *fsctx = fatfs;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * fatfs_check_for_partition_table(fatfs)
+ *
+ * This routine attempts to determine if the disk contains a
+ * partition table or if it contains a standard MS-DOS boot recod.
+ * We try to find both, and return what we find, or an error
+ * if it is still unclear.
+ *
+ * Input parameters:
+ * fatfs - fat filesystem context
+ *
+ * Return value:
+ * 0 if no partition table
+ * 1 if partition table
+ * <0 = error occured, could not tell or I/O error
+ ********************************************************************* */
+
+static int fatfs_check_for_partition_table(fatfs_t *fatfs)
+{
+ int res;
+ uint8_t buffer[SECTORSIZE];
+ uint8_t *part;
+ int idx;
+ int foundit = 0;
+
+ /*
+ * Read sector 0
+ */
+
+ fatfs->fat_partstart = 0;
+ res = fat_readsector(fatfs,0,1,buffer);
+ if (res < 0) return res;
+
+ /*
+ * Check the seal at the end of th sector. Both
+ * boot sector and MBR should contain this seal.
+ */
+ if (READWORD(buffer,BPB_SEAL) != BPB_SEAL_VALUE) {
+ res = CFE_ERR_BADFILESYS;
+ return res;
+ }
+
+ /*
+ * See Microsoft Knowledgebase article # Q140418, it contains
+ * a good description of the boot sector format.
+ *
+ * If the extended information is present, and SystemID is "FAT"
+ * and the "bytes per sector" is 512, assume it's a regular boot block
+ */
+
+ if (((buffer[BPB_SIGNATURE] == BPB_SIGNATURE_VALUE1) ||
+ (buffer[BPB_SIGNATURE] == BPB_SIGNATURE_VALUE2)) &&
+ (memcmp(&buffer[BPB_SYSTEMID],"FAT",3) == 0) &&
+ (READWORD(buffer,BPB_BYTESPERSECTOR) == 512)) {
+ /* Not partitioned */
+ res = 0;
+ return res;
+ }
+
+ /* If no extended information is present, check a few other key values. */
+
+ if ((READWORD(buffer,BPB_BYTESPERSECTOR) == 512) &&
+ (READWORD(buffer,BPB_RESERVEDSECTORS) >= 1) &&
+ ((READWORD(buffer,BPB_MEDIADESCRIPTOR) & 0xF0) == 0xF0)) {
+ res = 0;
+ return res;
+ }
+
+ /*
+ * If we're still confused, look for a partition table with a valid FAT
+ * partition on it. We might not detect a partition table that has
+ * only non-FAT partitions on it, like a disk with all Linux partitions,
+ * but that is fine here in the FATFS module, since we only want to
+ * find FAT partitions anyway.
+ */
+ part = &buffer[PTABLE_OFFSET];
+ for (idx = 0; idx < PTABLE_COUNT; idx++) {
+
+ if (((part[PTABLE_STATUS] == PTABLE_STATUS_ACTIVE) ||
+ (part[PTABLE_STATUS] == 0x00)) &&
+ ((part[PTABLE_TYPE] == PARTTYPE_FAT12) ||
+ (part[PTABLE_TYPE] == PARTTYPE_FAT16) ||
+ (part[PTABLE_TYPE] == PARTTYPE_FAT16BIG))) {
+ foundit = 1;
+ res = 1; /*Partition table present*/
+ break;
+ }
+ part += PTABLE_SIZE;
+ }
+
+ /*
+ * If at this point we did not find what we were looking for,
+ * return an error.
+ */
+ if (foundit) {
+ res = 1; /*Partition table is present.*/
+ }
+ else {
+ /*Error! We can't decide if partition table exists or not*/
+ res = CFE_ERR_BADFILESYS;
+ }
+
+ return res;
+}
+
+static int fatfs_fileop_xinit(void **fsctx,void *dev)
+{
+ char *devname = (char *) dev;
+
+ return fatfs_fileop_init(fsctx,devname,0);
+}
+
+static int fatfs_fileop_pinit(void **fsctx,void *dev)
+{
+ char *devname = (char *) dev;
+
+ return fatfs_fileop_init(fsctx,devname,1);
+}
+
+
+
+/* *********************************************************************
+ * fatfs_fileop_open(ref,name)
+ *
+ * Open a file on the FAT device.
+ *
+ * Input parameters:
+ * ref - place to store pointer to fileinfo
+ * fsctx - filesystem context
+ * name - name of file to open
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int fatfs_fileop_open(void **ref,void *fsctx,char *name,int mode)
+{
+ int res;
+ uint8_t direntry[DIRENTRYSIZE];
+ fatfile_t *ff;
+ fatfs_t *fatfs;
+
+ if (mode != FILE_MODE_READ) return CFE_ERR_UNSUPPORTED;
+
+ fatfs = (fatfs_t *) fsctx;
+
+ ff = (fatfile_t *) KMALLOC(sizeof(fatfile_t),0);
+ if (ff == NULL) return CFE_ERR_NOMEM;
+
+ memset(ff,0,sizeof(fatfile_t));
+
+ ff->ff_fat = fatfs;
+
+ res = fat_findfile(ff->ff_fat,name,direntry);
+ if (res <= 0) {
+ return CFE_ERR_FILENOTFOUND; /* not found */
+ }
+
+ /*
+ * Okay, the file was found. Enumerate the FAT chain
+ * associated with this file.
+ */
+
+ ff->ff_filelength = DIRENTRY_FILELENGTH(direntry);
+
+ ff->ff_curpos = 0;
+ ff->ff_cursector = -1;
+
+ res = fat_getchain(ff->ff_fat,
+ DIRENTRY_STARTCLUSTER(direntry),
+ &(ff->ff_chain));
+
+ if (res < 0) {
+ KFREE(ff);
+ return res;
+ }
+
+ /*
+ * Return the file handle
+ */
+
+
+ fatfs->fat_refcnt++;
+ *ref = (void *) ff;
+ return 0;
+}
+
+
+/* *********************************************************************
+ * fatfs_fileop_close(ref)
+ *
+ * Close the file.
+ *
+ * Input parameters:
+ * ref - pointer to open file information
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void fatfs_fileop_close(void *ref)
+{
+ fatfile_t *file = (fatfile_t *) ref;
+ fatfs_t *fatctx = file->ff_fat;
+
+ fatctx->fat_refcnt--;
+
+ fat_freechain(&(file->ff_chain));
+ KFREE(file);
+}
+
+
+/* *********************************************************************
+ * fatfs_fileop_uninit(ref)
+ *
+ * Uninitialize the file system.
+ *
+ * Input parameters:
+ * fsctx - filesystem context
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+static void fatfs_fileop_uninit(void *fsctx)
+{
+ fatfs_t *fatctx = (fatfs_t *) fsctx;
+
+ if (fatctx->fat_refcnt) {
+ xprintf("fatfs_fileop_unint: warning: refcnt should be zero\n");
+ }
+
+ fat_uninit(fatctx);
+
+ KFREE(fatctx);
+}
+
+
+/* *********************************************************************
+ * fatfs_fileop_seek(ref,offset,how)
+ *
+ * Move the file pointer within the file
+ *
+ * Input parameters:
+ * ref - pointer to open file information
+ * offset - new file location or distance to move
+ * how - method for moving
+ *
+ * Return value:
+ * new file offset
+ * <0 if error occured
+ ********************************************************************* */
+
+static int fatfs_fileop_seek(void *ref,int offset,int how)
+{
+ fatfile_t *file = (fatfile_t *) ref;
+
+ switch (how) {
+ case FILE_SEEK_BEGINNING:
+ file->ff_curpos = offset;
+ break;
+ case FILE_SEEK_CURRENT:
+ file->ff_curpos += offset;
+ break;
+ default:
+ break;
+ }
+
+ if (file->ff_curpos >= file->ff_filelength) {
+ file->ff_curpos = file->ff_filelength;
+ }
+
+ return file->ff_curpos;
+}
+
+
+/* *********************************************************************
+ * fatfs_fileop_read(ref,buf,len)
+ *
+ * Read data from the file.
+ *
+ * Input parameters:
+ * ref - pointer to open file information
+ * buf - buffer to read data into
+ * len - number of bytes to read
+ *
+ * Return value:
+ * number of bytes read
+ * <0 if error occured
+ * 0 means eof
+ ********************************************************************* */
+
+static int fatfs_fileop_read(void *ref,uint8_t *buf,int len)
+{
+ fatfile_t *file = (fatfile_t *) ref;
+ int amtcopy;
+ int ttlcopy = 0;
+ int offset;
+ int sector;
+ int secidx;
+ int origpos;
+ int res;
+ uint8_t temp_buf[SECTORSIZE];
+
+ /*
+ * Remember orig position in case we have an error
+ */
+
+ origpos = file->ff_curpos;
+
+ /*
+ * bounds check the length based on the file length
+ */
+
+ if ((file->ff_curpos + len) > file->ff_filelength) {
+ len = file->ff_filelength - file->ff_curpos;
+ }
+
+ res = 0;
+
+ /*
+ * while ther is still data to be transferred
+ */
+
+
+ while (len) {
+
+ /*
+ * Calculate the sector offset and index in the sector
+ */
+
+ offset = file->ff_curpos % SECTORSIZE;
+ secidx = file->ff_curpos / SECTORSIZE;
+
+ sector = fat_sectoridx(file->ff_fat,&(file->ff_chain),secidx);
+
+ if (sector < 0) {
+ xprintf("should not happen, sector = -1!\n");
+ return sector;
+ }
+
+ /*
+ * first transfer up to the sector boundary
+ */
+
+ amtcopy = len;
+ if (amtcopy > (SECTORSIZE-offset)) {
+ amtcopy = (SECTORSIZE-offset);
+ }
+
+ /*
+ * If transferring exactly a sector, on a sector
+ * boundary, read the data directly into the user buffer
+ *
+ * Extra credit: See if we can transfer more than one
+ * sector at a time, by determining if we can read a run of
+ * contiguous sectors (very likely)
+ *
+ * Otherwise: read into the sector buffer and
+ * transfer the data to user memory.
+ */
+
+ if ((offset == 0) && (amtcopy == SECTORSIZE)) {
+ res = fat_readsector(file->ff_fat,sector,1,temp_buf);
+ if (res < 0) {
+ xprintf("I/O error!\n");
+ break;
+ }
+ memcpy(buf,temp_buf,amtcopy);
+ }
+ else {
+ if (file->ff_cursector != sector) {
+ res = fat_readsector(file->ff_fat,sector,1,file->ff_sector);
+ if (res < 0) {
+ break;
+ }
+ file->ff_cursector = sector;
+ }
+ memcpy(buf,&(file->ff_sector[offset]),amtcopy);
+ }
+
+ /*
+ * Adjust/update all our pointers.
+ */
+
+ buf += amtcopy;
+ file->ff_curpos += amtcopy;
+ ttlcopy += amtcopy;
+ len -= amtcopy;
+
+ /*
+ * see if we ran off the end of the file. Should not
+ * be necessary.
+ */
+
+ if (file->ff_curpos >= file->ff_filelength) {
+ /* should not be necessary */
+ break;
+ }
+ }
+
+ /*
+ * If an error occured, get out now.
+ */
+
+ if (res < 0) {
+ file->ff_curpos = origpos;
+ return res;
+ }
+
+ return ttlcopy;
+
+}
+
+static int fatfs_fileop_write(void *ref,uint8_t *buf,int len)
+{
+ return CFE_ERR_UNSUPPORTED;
+}
+
+
+#if 0
+
+void main(int argc,char *argv[])
+{
+ fatfs_t fat;
+ int idx;
+ unsigned int e;
+ uint8_t direntry[DIRENTRYSIZE];
+ fatchain_t chain;
+ int res;
+
+
+ fat_init(&fat,"floppy.raw");
+
+
+ if (fat_readbpb(&fat) == 0) {
+ fat_dumpbpb(&fat.fat_bpb);
+ }
+
+#if 0
+ for (idx = 0; idx < (int) fat.fat_bpb.bpb_maxrootdir; idx++) {
+ fat_getrootdirentry(&fat,idx,direntry);
+ if (direntry[0] == 0) break;
+ if (direntry[0] == 0xE5) continue;
+ xprintf("%3d: ",idx);
+ fat_dumpdirentry(direntry);
+ }
+#endif
+
+ fat_scandir(&fat,NULL,NULL,direntry);
+
+ for (e = 0x150; e < 0x160; e++) {
+ xprintf("Entry %03X is %03X\n",e,fat_getfatentry(&fat,e));
+ }
+
+#if 0
+ e = 0x36E;
+ while (e != 0xFFF) {
+ e = fat_getfatentry(&fat,e);
+ xprintf("%03X ",e);
+ }
+#endif
+
+
+ xprintf("\n\n");
+ e = 0x36E;
+ memset(&chain,0,sizeof(chain));
+ fat_getchain(&fat,e,&chain);
+ fat_scandir(&fat,&chain,NULL,direntry);
+ fat_freechain(&chain);
+
+ xprintf("\n\n");
+ e = 0x36F;
+ memset(&chain,0,sizeof(chain));
+ fat_getchain(&fat,e,&chain);
+ fat_scandir(&fat,&chain,NULL,direntry);
+ fat_freechain(&chain);
+
+ xprintf("\n\n");
+ e = 0x370;
+ memset(&chain,0,sizeof(chain));
+ fat_getchain(&fat,e,&chain);
+ fat_scandir(&fat,&chain,NULL,direntry);
+ fat_freechain(&chain);
+
+ xprintf("\n\n");
+
+ res = fat_findfile(&fat,argc > 1 ? argv[1] : "/usr/local/include/ansidecl.h",direntry);
+ xprintf("res = %d\n",res);
+
+ if (res) fat_dumpdirentry(direntry);
+
+ close(fat.fat_fh);
+}
+
+void main(int argc,char *argv[])
+{
+ void *ref;
+ int res;
+ char buffer[257];
+ int total = 0;
+
+// res = fatfs_fileop_open(&ref,"floppy.raw:/usr/local/include/bfdlink.h");
+ res = fatfs_fileop_open(&ref,"floppy.raw:/idedrv.h");
+
+ if (res != 0) {
+ xprintf("Could not open file: %d\n",res);
+ exit(1);
+ }
+
+ for (;;) {
+ res = fatfs_fileop_read(ref,buffer,39);
+// xprintf("read returned %d\n",res);
+ if (res <= 0) break;
+
+ if (res > 0) {
+ total += res;
+ buffer[res] = 0;
+ xprintf("%s",buffer);
+ }
+ }
+
+ if (res < 0) xprintf("error! \n");
+
+ xprintf("[total %d]\n",total);
+
+ fatfs_fileop_close(ref);
+
+ exit(0);
+
+}
+
+#endif
diff --git a/cfe/cfe/main/cfe_filesys.c b/cfe/cfe/main/cfe_filesys.c
new file mode 100755
index 0000000..569d7bc
--- /dev/null
+++ b/cfe/cfe/main/cfe_filesys.c
@@ -0,0 +1,343 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Filesystem manager File: cfe_filesys.c
+ *
+ * This module maintains the list of available file systems.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_malloc.h"
+
+#include "cfe_error.h"
+#include "cfe_fileops.h"
+
+#include "cfe.h"
+
+#include "bsp_config.h"
+
+/* *********************************************************************
+ * Externs
+ ********************************************************************* */
+
+extern const fileio_dispatch_t raw_fileops;
+#if CFG_NETWORK
+extern const fileio_dispatch_t tftp_fileops;
+#if (CFG_TCP) && (CFG_HTTPFS)
+extern const fileio_dispatch_t http_fileops;
+#endif
+#endif
+#if CFG_FATFS
+extern const fileio_dispatch_t fatfs_fileops;
+extern const fileio_dispatch_t pfatfs_fileops;
+#endif
+#if CFG_ZLIB
+extern const fileio_dispatch_t zlibfs_fileops;
+#endif
+
+/* *********************************************************************
+ * File system list
+ ********************************************************************* */
+
+static const fileio_dispatch_t * const cfe_filesystems[] = {
+#if !defined(CONFIG_MIPS_BRCM)
+ &raw_fileops,
+#endif
+#if CFG_NETWORK
+ &tftp_fileops,
+#if (CFG_TCP) & (CFG_HTTPFS)
+ &http_fileops,
+#endif
+#endif
+#if CFG_FATFS
+ &fatfs_fileops,
+ &pfatfs_fileops,
+#endif
+#if CFG_ZLIB
+ &zlibfs_fileops,
+#endif
+ NULL
+};
+
+/* *********************************************************************
+ * cfe_findfilesys(name)
+ *
+ * Locate the dispatch record for a particular file system.
+ *
+ * Input parameters:
+ * name - name of filesys to locate
+ *
+ * Return value:
+ * pointer to dispatch table or NULL if not found
+ ********************************************************************* */
+
+const fileio_dispatch_t *cfe_findfilesys(const char *name)
+{
+ const fileio_dispatch_t * const *disp;
+
+ disp = cfe_filesystems;
+
+ while (*disp) {
+ if (strcmp((*disp)->method,name) == 0) return *disp;
+ disp++;
+ }
+
+ return NULL;
+}
+
+/* *********************************************************************
+ * fs_init(name,fsctx,device)
+ *
+ * Initialize a filesystem context
+ *
+ * Input parameters:
+ * name - name of file system
+ * fsctx - returns a filesystem context
+ * device - device name or other info
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+int fs_init(char *fsname,fileio_ctx_t **fsctx,void *device)
+{
+ fileio_ctx_t *ctx;
+ int res;
+ const fileio_dispatch_t *ops;
+
+ ops = cfe_findfilesys((const char *)fsname);
+ if (!ops) return CFE_ERR_FSNOTAVAIL;
+
+ ctx = (fileio_ctx_t *) KMALLOC(sizeof(fileio_ctx_t),0);
+ if (!ctx) return CFE_ERR_NOMEM;
+
+ ctx->ops = ops;
+ res = BDINIT(ops,&(ctx->fsctx),device);
+
+ if (res != 0) {
+ KFREE(ctx);
+ }
+
+ *fsctx = ctx;
+
+ return res;
+}
+
+
+/* *********************************************************************
+ * fs_hook(fsctx,name)
+ *
+ * "Hook" a filesystem to attach a filter, like a decompression
+ * or decryption engine.
+ *
+ * Input parameters:
+ * fsctx - result from a previous fs_init
+ * name - name of fs to hook onto the beginning
+ *
+ * Return value:
+ * 0 if ok
+ * else error
+ ********************************************************************* */
+
+int fs_hook(fileio_ctx_t *fsctx,char *fsname)
+{
+ void *hookfsctx;
+ const fileio_dispatch_t *ops;
+ int res;
+
+ /*
+ * Find the hook filesystem (well, actually a filter)
+ */
+
+ ops = cfe_findfilesys((const char *)fsname);
+ if (!ops) return CFE_ERR_FSNOTAVAIL;
+
+ /*
+ * initialize our hook file filter.
+ */
+
+ res = BDINIT(ops,&hookfsctx,fsctx);
+ if (res != 0) return res;
+
+ /*
+ * Now replace dispatch table for current filesystem
+ * with the hook's dispatch table. When fs_read is called,
+ * we'll go to the hook, and the hook will call the original.
+ *
+ * When fs_uninit is called, the hook will call the original's
+ * uninit routine.
+ */
+
+ fsctx->ops = ops;
+ fsctx->fsctx = hookfsctx;
+
+ return 0;
+
+}
+
+/* *********************************************************************
+ * fs_uninit(fsctx)
+ *
+ * Uninitialize a file system context.
+ *
+ * Input parameters:
+ * fsctx - filesystem context to remove (from fs_init)
+ *
+ * Return value:
+ * 0 if ok
+ * else error
+ ********************************************************************* */
+int fs_uninit(fileio_ctx_t *fsctx)
+{
+ BDUNINIT(fsctx->ops,fsctx->fsctx);
+
+ KFREE(fsctx);
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * fs_open(fsctx,ref,filename,mode)
+ *
+ * Open a file on the file system
+ *
+ * Input parameters:
+ * fsctx - filesystem context (from fs_init)
+ * ref - returns file handle
+ * filename - name of file to open
+ * mode - file open mode
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+int fs_open(fileio_ctx_t *fsctx,void **ref,char *filename,int mode)
+{
+ return BDOPEN2(fsctx->ops,ref,fsctx->fsctx,filename,mode);
+}
+
+/* *********************************************************************
+ * fs_close(fsctx,ref)
+ *
+ * Close a file on the file system
+ *
+ * Input parameters:
+ * fsctx - filesystem context (from fs_init)
+ * ref - file handle (from fs_open)
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+int fs_close(fileio_ctx_t *fsctx,void *ref)
+{
+ BDCLOSE(fsctx->ops,ref);
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * fs_read(fsctx,ref,buffer,len)
+ *
+ * Read data from the device.
+ *
+ * Input parameters:
+ * fsctx - filesystem context (from fs_init)
+ * ref - file handle (from fs_open)
+ * buffer - buffer pointer
+ * len - length
+ *
+ * Return value:
+ * number of bytes read
+ * 0=eof
+ * <0 = error
+ ********************************************************************* */
+
+int fs_read(fileio_ctx_t *fsctx,void *ref,uint8_t *buffer,int len)
+{
+ return BDREAD(fsctx->ops,ref,buffer,len);
+}
+
+/* *********************************************************************
+ * fs_write(fsctx,ref,buffer,len)
+ *
+ * write data from the device.
+ *
+ * Input parameters:
+ * fsctx - filesystem context (from fs_init)
+ * ref - file handle (from fs_open)
+ * buffer - buffer pointer
+ * len - length
+ *
+ * Return value:
+ * number of bytes written
+ * 0=eof
+ * <0 = error
+ ********************************************************************* */
+
+int fs_write(fileio_ctx_t *fsctx,void *ref,uint8_t *buffer,int len)
+{
+ return BDWRITE(fsctx->ops,ref,buffer,len);
+}
+
+/* *********************************************************************
+ * fs_seek(fsctx,ref,offset,how)
+ *
+ * move file pointer on the device
+ *
+ * Input parameters:
+ * fsctx - filesystem context (from fs_init)
+ * ref - file handle (from fs_open)
+ * offset - distance to move
+ * how - origin (FILE_SEEK_xxx)
+ *
+ * Return value:
+ * new offset
+ * <0 = error
+ ********************************************************************* */
+
+int fs_seek(fileio_ctx_t *fsctx,void *ref,int offset,int how)
+{
+ return BDSEEK(fsctx->ops,ref,offset,how);
+}
diff --git a/cfe/cfe/main/cfe_httpfs.c b/cfe/cfe/main/cfe_httpfs.c
new file mode 100644
index 0000000..4ebad4c
--- /dev/null
+++ b/cfe/cfe/main/cfe_httpfs.c
@@ -0,0 +1,396 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * "HTTP" file system File: cfe_httpfs.c
+ *
+ * This filesystem driver lets you read files from an HTTP
+ * server.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_error.h"
+#include "cfe_fileops.h"
+#include "cfe_iocb.h"
+#include "cfe_devfuncs.h"
+#include "cfe_console.h"
+
+#include "cfe.h"
+
+#include "bsp_config.h"
+
+#if (CFG_TCP) && (CFG_HTTPFS)
+
+#include "net_ebuf.h"
+#include "net_api.h"
+
+
+/* *********************************************************************
+ * HTTP context
+ ********************************************************************* */
+
+/*
+ * File system context - describes overall file system info,
+ * such as the handle to the underlying device.
+ */
+
+typedef struct http_fsctx_s {
+ int http_tmp; /* context not really needed */
+} http_fsctx_t;
+
+/*
+ * File context - describes an open file on the file system.
+ */
+
+#define HTTP_BUFSIZE 1024
+typedef struct http_file_s {
+ http_fsctx_t *http_fsctx;
+ int http_socket;
+ uint8_t http_buffer[HTTP_BUFSIZE];
+ uint8_t *http_bptr;
+ int http_blen;
+ int http_offset;
+ char *http_filename;
+} http_file_t;
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+static int http_fileop_init(void **fsctx,void *devicename);
+static int http_fileop_open(void **ref,void *fsctx,char *filename,int mode);
+static int http_fileop_read(void *ref,uint8_t *buf,int len);
+static int http_fileop_write(void *ref,uint8_t *buf,int len);
+static int http_fileop_seek(void *ref,int offset,int how);
+static void http_fileop_close(void *ref);
+static void http_fileop_uninit(void *fsctx);
+
+/* *********************************************************************
+ * RAW fileio dispatch table
+ ********************************************************************* */
+
+const fileio_dispatch_t http_fileops = {
+ "http",
+ FSYS_TYPE_NETWORK,
+ http_fileop_init,
+ http_fileop_open,
+ http_fileop_read,
+ http_fileop_write,
+ http_fileop_seek,
+ http_fileop_close,
+ http_fileop_uninit
+};
+
+static int http_fileop_init(void **newfsctx,void *dev)
+{
+ http_fsctx_t *fsctx;
+
+ *newfsctx = NULL;
+
+ fsctx = KMALLOC(sizeof(http_fsctx_t),0);
+ if (!fsctx) {
+ return CFE_ERR_NOMEM;
+ }
+
+ fsctx->http_tmp = 0;
+ *newfsctx = fsctx;
+
+ return 0;
+}
+
+static int http_fileop_open(void **ref,void *fsctx_arg,char *filename,int mode)
+{
+ http_fsctx_t *fsctx;
+ http_file_t *file;
+ char temp[200];
+ char *hostname, *filen;
+ int hlen;
+ int termidx;
+ int res;
+ int err = 0;
+ char *hptr;
+ char *tok;
+ uint8_t hostaddr[IP_ADDR_LEN];
+ uint8_t termstr[4];
+ uint8_t b;
+
+ if (mode != FILE_MODE_READ) return CFE_ERR_UNSUPPORTED;
+
+ fsctx = (http_fsctx_t *) fsctx_arg;
+
+ file = KMALLOC(sizeof(http_file_t),0);
+ if (!file) {
+ return CFE_ERR_NOMEM;
+ }
+
+ file->http_filename = lib_strdup(filename);
+ if (!file->http_filename) {
+ KFREE(file);
+ return CFE_ERR_NOMEM;
+ }
+
+ lib_chop_filename(file->http_filename,&hostname,&filen);
+
+ /*
+ * Look up remote host
+ */
+
+ res = dns_lookup(hostname,hostaddr);
+ if (res < 0) {
+ KFREE(file);
+ return res;
+ }
+
+ file->http_socket = tcp_socket();
+ if (file->http_socket < 0) {
+ KFREE(file->http_filename);
+ KFREE(file);
+ return -1;
+ }
+
+ /*
+ * Connect to remote host.
+ */
+
+ tcp_setflags(file->http_socket,0); /* set socket to blocking */
+ res = tcp_connect(file->http_socket,hostaddr,80);
+
+ if (res < 0) {
+ tcp_close(file->http_socket);
+ KFREE(file->http_filename);
+ KFREE(file);
+ return res;
+ }
+
+ /*
+ * Send GET command. Supply the hostname (for HTTP 1.1 requirements)
+ * and set the connection to close as soon as all the data is received.
+ */
+
+ hlen = sprintf(temp,"GET /%s HTTP/1.1\r\nHost: %s\r\nConnection: close\r\n\r\n",filen,hostname);
+
+ res = tcp_send(file->http_socket,temp,hlen);
+ if (res < 0) {
+ tcp_close(file->http_socket);
+ KFREE(file->http_filename);
+ KFREE(file);
+ return res;
+ }
+
+ /*
+ * Read bytes until we either reach EOF or we see "\r\n\r\n"
+ * This is the server's status string.
+ */
+
+ termstr[0] = '\r'; termstr[1] = '\n';
+ termstr[2] = '\r'; termstr[3] = '\n';
+ termidx = 0;
+
+ file->http_offset = 0;
+ file->http_blen = 0;
+ file->http_bptr = file->http_buffer;
+
+ res = 0;
+ for (;;) {
+ res = tcp_recv(file->http_socket,&b,1);
+ if (res < 0) break;
+ if (b == termstr[termidx]) {
+ termidx++;
+ if (termidx == 4) break;
+ }
+ else {
+ termidx = 0;
+ }
+
+ /*
+ * Save the bytes from the header up to our buffer
+ * size. It's okay if we don't save it all,
+ * since all we want is the result code which comes
+ * first.
+ */
+
+ if (file->http_blen < (HTTP_BUFSIZE-1)) {
+ *(file->http_bptr) = b;
+ file->http_bptr++;
+ file->http_blen++;
+ }
+ }
+
+ /*
+ * Premature EOFs are not good, bail now.
+ */
+
+ if (res < 0) {
+ err = CFE_ERR_EOF;
+ goto protocolerr;
+ }
+
+ /*
+ * Skip past the HTTP response header and grab the result code.
+ * Sanity check it a little.
+ */
+
+ *(file->http_bptr) = 0;
+
+ hptr = file->http_buffer;
+ tok = lib_gettoken(&hptr);
+ if (!tok || (memcmp(tok,"HTTP",4) != 0)) {
+ err = CFE_ERR_PROTOCOLERR;
+ goto protocolerr;
+ }
+
+ tok = lib_gettoken(&hptr);
+ if (!tok) {
+ err = CFE_ERR_PROTOCOLERR;
+ goto protocolerr;
+ }
+
+ switch (lib_atoi(tok)) {
+ case 200:
+ err = 0;
+ break;
+ case 404:
+ err = CFE_ERR_FILENOTFOUND;
+ break;
+
+ }
+
+ /*
+ * If we get to here, the file is okay and we're about to receive data.
+ */
+
+ if (err == 0) {
+ *ref = file;
+ return 0;
+ }
+
+protocolerr:
+ tcp_close(file->http_socket);
+ KFREE(file->http_filename);
+ KFREE(file);
+ *ref = NULL;
+ return err;
+}
+
+static int http_fileop_read(void *ref,uint8_t *buf,int len)
+{
+ http_file_t *file = (http_file_t *) ref;
+ int res;
+
+ res = tcp_recv(file->http_socket,buf,len);
+
+ if (res > 0) {
+ file->http_offset += res;
+ return res;
+ }
+
+ return 0; /* Any error becomes "EOF" */
+}
+
+static int http_fileop_write(void *ref,uint8_t *buf,int len)
+{
+ return CFE_ERR_UNSUPPORTED;
+}
+
+static int http_fileop_seek(void *ref,int offset,int how)
+{
+ http_file_t *file = (http_file_t *) ref;
+ int newoffset;
+ int res;
+ int buflen;
+
+ switch (how) {
+ case FILE_SEEK_BEGINNING:
+ newoffset = offset;
+ break;
+ case FILE_SEEK_CURRENT:
+ newoffset = file->http_offset + offset;
+ break;
+ default:
+ newoffset = offset;
+ break;
+ }
+
+ /*
+ * Can't seek backwards.
+ */
+ if (newoffset < file->http_offset) {
+ return CFE_ERR_UNSUPPORTED;
+ }
+
+ /*
+ * Eat data till offset reaches where we want.
+ */
+
+ while (file->http_offset != newoffset) {
+ buflen = HTTP_BUFSIZE;
+ if (buflen > (newoffset - file->http_offset)) buflen = (newoffset-file->http_offset);
+ res = tcp_recv(file->http_socket,file->http_buffer,buflen);
+ if (res < 0) break;
+ file->http_offset += res;
+ }
+
+ return file->http_offset;
+}
+
+
+static void http_fileop_close(void *ref)
+{
+ http_file_t *file = (http_file_t *) ref;
+
+ tcp_close(file->http_socket);
+ KFREE(file->http_filename);
+ KFREE(file);
+}
+
+static void http_fileop_uninit(void *fsctx_arg)
+{
+ http_fsctx_t *fsctx = (http_fsctx_t *) fsctx_arg;
+
+ KFREE(fsctx);
+}
+
+#endif
diff --git a/cfe/cfe/main/cfe_iocb_dispatch.c b/cfe/cfe/main/cfe_iocb_dispatch.c
new file mode 100755
index 0000000..24aea0a
--- /dev/null
+++ b/cfe/cfe/main/cfe_iocb_dispatch.c
@@ -0,0 +1,647 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * IOCB dispatcher File: cfe_iocb_dispatch.c
+ *
+ * This routine is the main API dispatch for CFE. User API
+ * calls, via the ROM entry point, get dispatched to routines
+ * in this module.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_queue.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "cfe_iocb.h"
+#include "cfe_error.h"
+#include "cfe_device.h"
+#include "cfe_timer.h"
+#include "cfe_mem.h"
+#include "cfe_fileops.h"
+#include "cfe_boot.h"
+#include "env_subr.h"
+#include "cfe.h"
+#include "cfe_console.h"
+#include "bsp_config.h"
+#include "initdata.h"
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define HV 1 /* handle valid */
+
+#ifndef CFG_BOARD_ID
+#define CFG_BOARD_ID 0
+#endif
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+cfe_devctx_t *cfe_handle_table[CFE_MAX_HANDLE];
+
+extern void _cfe_flushcache(int);
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+int cfe_iocb_dispatch(cfe_iocb_t *iocb);
+void cfe_device_poll(void *);
+
+#if CFG_MULTI_CPUS
+extern int altcpu_cmd_start(uint64_t,uint64_t *);
+extern int altcpu_cmd_stop(uint64_t);
+#endif
+
+/* *********************************************************************
+ * Dispatch table
+ ********************************************************************* */
+
+struct cfe_cmd_dispatch_s {
+ int plistsize;
+ int flags;
+ int (*func)(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+};
+
+
+static int cfe_cmd_fw_getinfo(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+static int cfe_cmd_fw_restart(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+static int cfe_cmd_fw_boot(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+static int cfe_cmd_fw_cpuctl(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+static int cfe_cmd_fw_gettime(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+static int cfe_cmd_fw_memenum(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+static int cfe_cmd_fw_flushcache(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+
+static int cfe_cmd_dev_gethandle(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+static int cfe_cmd_dev_enum(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+static int cfe_cmd_dev_open(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+static int cfe_cmd_dev_inpstat(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+static int cfe_cmd_dev_read(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+static int cfe_cmd_dev_write(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+static int cfe_cmd_dev_ioctl(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+static int cfe_cmd_dev_close(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+static int cfe_cmd_dev_getinfo(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+
+static int cfe_cmd_env_enum(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+static int cfe_cmd_env_get(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+static int cfe_cmd_env_set(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+static int cfe_cmd_env_del(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+
+const static struct cfe_cmd_dispatch_s cfe_cmd_dispatch_table[CFE_CMD_MAX] = {
+ {sizeof(iocb_fwinfo_t), 0, cfe_cmd_fw_getinfo}, /* 0 : CFE_CMD_FW_GETINFO */
+ {sizeof(iocb_exitstat_t),0, cfe_cmd_fw_restart}, /* 1 : CFE_CMD_FW_RESTART */
+ {sizeof(iocb_buffer_t), 0, cfe_cmd_fw_boot}, /* 2 : CFE_CMD_FW_BOOT */
+ {sizeof(iocb_cpuctl_t), 0, cfe_cmd_fw_cpuctl}, /* 3 : CFE_CMD_FW_CPUCTL */
+ {sizeof(iocb_time_t), 0, cfe_cmd_fw_gettime}, /* 4 : CFE_CMD_FW_GETTIME */
+ {sizeof(iocb_meminfo_t),0, cfe_cmd_fw_memenum}, /* 5 : CFE_CMD_FW_MEMENUM */
+ {0, 0, cfe_cmd_fw_flushcache}, /* 6 : CFE_CMD_FW_FLUSHCACHE */
+ {-1, 0, NULL}, /* 7 : */
+ {-1, 0, NULL}, /* 8 : */
+ {0, 0, cfe_cmd_dev_gethandle}, /* 9 : CFE_CMD_DEV_GETHANDLE */
+ {sizeof(iocb_envbuf_t), 0, cfe_cmd_dev_enum}, /* 10 : CFE_CMD_DEV_ENUM */
+ {sizeof(iocb_buffer_t), 0, cfe_cmd_dev_open}, /* 11 : CFE_CMD_DEV_OPEN */
+ {sizeof(iocb_inpstat_t),HV, cfe_cmd_dev_inpstat}, /* 12 : CFE_CMD_DEV_INPSTAT */
+ {sizeof(iocb_buffer_t), HV, cfe_cmd_dev_read}, /* 13 : CFE_CMD_DEV_READ */
+ {sizeof(iocb_buffer_t), HV, cfe_cmd_dev_write}, /* 14 : CFE_CMD_DEV_WRITE */
+ {sizeof(iocb_buffer_t), HV, cfe_cmd_dev_ioctl}, /* 15 : CFE_CMD_DEV_IOCTL */
+ {0, HV, cfe_cmd_dev_close}, /* 16 : CFE_CMD_DEV_CLOSE */
+ {sizeof(iocb_buffer_t), 0, cfe_cmd_dev_getinfo}, /* 17 : CFE_CMD_DEV_GETINFO */
+ {-1, 0, NULL}, /* 18 : */
+ {-1, 0, NULL}, /* 19 : */
+ {sizeof(iocb_envbuf_t), 0, cfe_cmd_env_enum}, /* 20 : CFE_CMD_ENV_ENUM */
+ {-1, 0, NULL}, /* 21 : */
+ {sizeof(iocb_envbuf_t), 0, cfe_cmd_env_get}, /* 22 : CFE_CMD_ENV_GET */
+ {sizeof(iocb_envbuf_t), 0, cfe_cmd_env_set}, /* 23 : CFE_CMD_ENV_SET */
+ {sizeof(iocb_envbuf_t), 0, cfe_cmd_env_del}, /* 24 : CFE_CMD_ENV_DEL */
+ {-1, 0, NULL}, /* 25 : */
+ {-1, 0, NULL}, /* 26 : */
+ {-1, 0, NULL}, /* 27 : */
+ {-1, 0, NULL}, /* 28 : */
+ {-1, 0, NULL}, /* 29 : */
+ {-1, 0, NULL}, /* 30 : */
+ {-1, 0, NULL} /* 31 : */
+};
+
+/* *********************************************************************
+ * IOCB dispatch routines
+ ********************************************************************* */
+
+void cfe_device_poll(void *x)
+{
+ int idx;
+ cfe_devctx_t **ctx = cfe_handle_table;
+
+ for (idx = 0; idx < CFE_MAX_HANDLE; idx++,ctx++) {
+ if ((*ctx) && ((*ctx)->dev_dev->dev_dispatch->dev_poll)) {
+ (*ctx)->dev_dev->dev_dispatch->dev_poll(*ctx,cfe_ticks);
+ }
+ }
+}
+
+int cfe_iocb_dispatch(cfe_iocb_t *iocb)
+{
+ const struct cfe_cmd_dispatch_s *disp;
+ int res;
+ cfe_devctx_t *ctx;
+
+ /*
+ * Check for commands codes out of range
+ */
+
+ if ((iocb->iocb_fcode < 0) || (iocb->iocb_fcode >= CFE_CMD_MAX)) {
+ iocb->iocb_status = CFE_ERR_INV_COMMAND;
+ return iocb->iocb_status;
+ }
+
+ /*
+ * Check for command codes in range but invalid
+ */
+
+ disp = &cfe_cmd_dispatch_table[iocb->iocb_fcode];
+
+ if (disp->plistsize < 0) {
+ iocb->iocb_status = CFE_ERR_INV_COMMAND;
+ return iocb->iocb_status;
+ }
+
+ /*
+ * Check for invalid parameter list size
+ */
+
+ if (disp->plistsize != iocb->iocb_psize) {
+ iocb->iocb_status = CFE_ERR_INV_PARAM;
+ return iocb->iocb_status;
+ }
+
+ /*
+ * Determine handle
+ */
+
+ ctx = NULL;
+ if (disp->flags & HV) {
+ if ((iocb->iocb_handle >= CFE_MAX_HANDLE) ||
+ (iocb->iocb_handle < 0) ||
+ (cfe_handle_table[iocb->iocb_handle] == NULL)){
+ iocb->iocb_status = CFE_ERR_INV_PARAM;
+ return iocb->iocb_status;
+ }
+ ctx = cfe_handle_table[iocb->iocb_handle];
+ }
+
+ /*
+ * Dispatch to handler routine
+ */
+
+ res = (*disp->func)(ctx,iocb);
+
+ iocb->iocb_status = res;
+ return res;
+}
+
+static int cfe_newhandle(void)
+{
+ int idx;
+
+ for (idx = 0; idx < CFE_MAX_HANDLE; idx++) {
+ if (cfe_handle_table[idx] == NULL) break;
+ }
+
+ if (idx == CFE_MAX_HANDLE) return -1;
+
+ return idx;
+}
+
+
+/* *********************************************************************
+ * Implementation routines for each IOCB function
+ ********************************************************************* */
+
+static int cfe_cmd_fw_getinfo(cfe_devctx_t *ctx,cfe_iocb_t *iocb)
+{
+ iocb_fwinfo_t *info = &iocb->plist.iocb_fwinfo;
+
+ info->fwi_version = (CFE_VER_MAJOR << 16) |
+ (CFE_VER_MINOR << 8) |
+ (CFE_VER_BUILD);
+ info->fwi_totalmem = ((cfe_int64_t) mem_totalsize) << 20;
+ info->fwi_flags =
+#ifdef __long64
+ CFE_FWI_64BIT |
+#else
+ CFE_FWI_32BIT |
+#endif
+#if (CFG_EMBEDDED_PIC)
+ CFE_FWI_RELOC |
+#endif
+#if (!CFG_RUNFROMKSEG0)
+ CFE_FWI_UNCACHED |
+#endif
+#if CFG_MULTI_CPUS
+ CFE_FWI_MULTICPU |
+#endif
+#ifdef _VERILOG_
+ CFE_FWI_RTLSIM |
+#endif
+#ifdef _FUNCSIM_
+ CFE_FWI_FUNCSIM |
+#endif
+ 0;
+
+ info->fwi_boardid = CFG_BOARD_ID;
+ info->fwi_bootarea_pa = (cfe_int64_t) mem_bootarea_start;
+ info->fwi_bootarea_va = BOOT_START_ADDRESS;
+ info->fwi_bootarea_size = (cfe_int64_t) mem_bootarea_size;
+ info->fwi_reserved1 = 0;
+ info->fwi_reserved2 = 0;
+ info->fwi_reserved3 = 0;
+
+ return CFE_OK;
+}
+
+static int cfe_cmd_fw_restart(cfe_devctx_t *ctx,cfe_iocb_t *iocb)
+{
+ if (iocb->iocb_flags & CFE_FLG_WARMSTART) {
+ cfe_warmstart(iocb->plist.iocb_exitstat.status);
+ }
+ else {
+ cfe_restart();
+ }
+
+ /* should not get here */
+
+ return CFE_OK;
+}
+
+static int cfe_cmd_fw_boot(cfe_devctx_t *ctx,cfe_iocb_t *iocb)
+{
+ return CFE_ERR_INV_COMMAND; /* not implemented yet */
+}
+
+static int cfe_cmd_fw_cpuctl(cfe_devctx_t *ctx,cfe_iocb_t *iocb)
+{
+#if CFG_MULTI_CPUS
+ int res;
+ uint64_t startargs[4];
+
+ switch (iocb->plist.iocb_cpuctl.cpu_command) {
+ case CFE_CPU_CMD_START:
+
+ startargs[0] = iocb->plist.iocb_cpuctl.start_addr;
+ startargs[1] = iocb->plist.iocb_cpuctl.sp_val;
+ startargs[2] = iocb->plist.iocb_cpuctl.gp_val;
+ startargs[3] = iocb->plist.iocb_cpuctl.a1_val;
+
+ res = altcpu_cmd_start(iocb->plist.iocb_cpuctl.cpu_number,
+ startargs);
+ break;
+ case CFE_CPU_CMD_STOP:
+ res = altcpu_cmd_stop(iocb->plist.iocb_cpuctl.cpu_number);
+ break;
+ default:
+ res = CFE_ERR_INV_PARAM;
+ }
+
+ return res;
+#else
+ return CFE_ERR_INV_COMMAND;
+#endif
+}
+
+static int cfe_cmd_fw_gettime(cfe_devctx_t *ctx,cfe_iocb_t *iocb)
+{
+ POLL();
+
+ iocb->plist.iocb_time.ticks = cfe_ticks;
+
+ return CFE_OK;
+}
+
+static int cfe_cmd_fw_memenum(cfe_devctx_t *ctx,cfe_iocb_t *iocb)
+{
+ int type;
+ int res;
+ uint64_t addr,size;
+
+ res = cfe_arena_enum(iocb->plist.iocb_meminfo.mi_idx,
+ &type,
+ &addr,
+ &size,
+ (iocb->iocb_flags & CFE_FLG_FULL_ARENA) ? TRUE : FALSE);
+
+ iocb->plist.iocb_meminfo.mi_addr = addr;
+ iocb->plist.iocb_meminfo.mi_size = size;
+ iocb->plist.iocb_meminfo.mi_type = type;
+
+ if (res == 0) {
+ if (type == MEMTYPE_DRAM_AVAILABLE) {
+ iocb->plist.iocb_meminfo.mi_type = CFE_MI_AVAILABLE;
+ }
+ else {
+ iocb->plist.iocb_meminfo.mi_type = CFE_MI_RESERVED;
+ }
+ }
+
+ return res;
+}
+
+static int cfe_cmd_fw_flushcache(cfe_devctx_t *ctx,cfe_iocb_t *iocb)
+{
+ _cfe_flushcache(iocb->iocb_flags);
+ return CFE_OK;
+}
+
+static int cfe_cmd_dev_enum(cfe_devctx_t *ctx,cfe_iocb_t *iocb)
+{
+ return CFE_ERR_INV_COMMAND;
+}
+
+static int cfe_cmd_dev_gethandle(cfe_devctx_t *ctx,cfe_iocb_t *iocb)
+{
+ switch (iocb->iocb_flags) {
+ case CFE_STDHANDLE_CONSOLE:
+ if (console_handle == -1) return CFE_ERR_DEVNOTFOUND;
+ iocb->iocb_handle = console_handle;
+ return CFE_OK;
+ break;
+ default:
+ return CFE_ERR_INV_PARAM;
+ }
+}
+
+static int cfe_cmd_dev_open(cfe_devctx_t *ctx,cfe_iocb_t *iocb)
+{
+ int h;
+ cfe_device_t *dev;
+ char devname[64];
+ int res;
+
+ /*
+ * Get device name
+ */
+
+ xstrncpy(devname,(char*)iocb->plist.iocb_buffer.buf_ptr,sizeof(devname));
+
+ /*
+ * Find device in device table
+ */
+
+ dev = cfe_finddev(devname);
+ if (!dev) return CFE_ERR_DEVNOTFOUND;
+
+ /*
+ * Fail if someone else already has the device open
+ */
+
+ if (dev->dev_opencount > 0) return CFE_ERR_DEVOPEN;
+
+ /*
+ * Generate a new handle
+ */
+
+ h = cfe_newhandle();
+ if (h < 0) return CFE_ERR_NOMEM;
+
+ /*
+ * Allocate a context
+ */
+
+ ctx = (cfe_devctx_t *) KMALLOC(sizeof(cfe_devctx_t),0);
+ if (ctx == NULL) return CFE_ERR_NOMEM;
+
+ /*
+ * Fill in the context
+ */
+
+ ctx->dev_dev = dev;
+ ctx->dev_softc = dev->dev_softc;
+ ctx->dev_openinfo = NULL;
+
+ /*
+ * Call driver's open func
+ */
+
+ res = dev->dev_dispatch->dev_open(ctx);
+
+ if (res != 0) {
+ KFREE(ctx);
+ return res;
+ }
+
+ /*
+ * Increment refcnt and save handle
+ */
+
+ dev->dev_opencount++;
+ cfe_handle_table[h] = ctx;
+ iocb->iocb_handle = h;
+
+ /*
+ * Success!
+ */
+
+ return CFE_OK;
+}
+
+static int cfe_cmd_dev_inpstat(cfe_devctx_t *ctx,cfe_iocb_t *iocb)
+{
+ int status;
+
+ status = ctx->dev_dev->dev_dispatch->dev_inpstat(ctx,&(iocb->plist.iocb_inpstat));
+
+ return status;
+}
+
+static int cfe_cmd_dev_read(cfe_devctx_t *ctx,cfe_iocb_t *iocb)
+{
+ int status;
+
+ status = ctx->dev_dev->dev_dispatch->dev_read(ctx,&(iocb->plist.iocb_buffer));
+
+ return status;
+}
+
+static int cfe_cmd_dev_write(cfe_devctx_t *ctx,cfe_iocb_t *iocb)
+{
+ int status;
+
+ status = ctx->dev_dev->dev_dispatch->dev_write(ctx,&(iocb->plist.iocb_buffer));
+
+ return status;
+}
+
+static int cfe_cmd_dev_ioctl(cfe_devctx_t *ctx,cfe_iocb_t *iocb)
+{
+ int status;
+
+ status = ctx->dev_dev->dev_dispatch->dev_ioctl(ctx,&(iocb->plist.iocb_buffer));
+
+ return status;
+}
+
+static int cfe_cmd_dev_close(cfe_devctx_t *ctx,cfe_iocb_t *iocb)
+{
+ /*
+ * Call device close function
+ */
+
+ ctx->dev_dev->dev_dispatch->dev_close(ctx);
+
+ /*
+ * Decrement refcnt
+ */
+
+ ctx->dev_dev->dev_opencount--;
+
+ /*
+ * Wipe out handle
+ */
+
+ cfe_handle_table[iocb->iocb_handle] = NULL;
+
+ /*
+ * Release device context
+ */
+
+ KFREE(ctx);
+
+ return CFE_OK;
+}
+
+static int cfe_cmd_dev_getinfo(cfe_devctx_t *ctx,cfe_iocb_t *iocb)
+{
+ cfe_device_t *dev;
+ char devname[64];
+ char *x;
+
+ /*
+ * Get device name
+ */
+
+ xstrncpy(devname,(char*)iocb->plist.iocb_buffer.buf_ptr,sizeof(devname));
+
+ /*
+ * Find device in device table
+ */
+
+ if ((x = strchr(devname,':'))) *x = '\0';
+ dev = cfe_finddev(devname);
+ if (!dev) return CFE_ERR_DEVNOTFOUND;
+
+ /*
+ * Return device class
+ */
+
+ iocb->plist.iocb_buffer.buf_devflags = dev->dev_class;
+
+ return CFE_OK;
+}
+
+static int cfe_cmd_env_enum(cfe_devctx_t *ctx,cfe_iocb_t *iocb)
+{
+ int vallen,namelen,res;
+
+ namelen = iocb->plist.iocb_envbuf.name_length;
+ vallen = iocb->plist.iocb_envbuf.val_length;
+
+ res = env_enum(iocb->plist.iocb_envbuf.enum_idx,
+ (char*)iocb->plist.iocb_envbuf.name_ptr,
+ &namelen,
+ (char*)iocb->plist.iocb_envbuf.val_ptr,
+ &vallen);
+
+ if (res < 0) return CFE_ERR_ENVNOTFOUND;
+
+ return CFE_OK;
+}
+
+
+static int cfe_cmd_env_get(cfe_devctx_t *ctx,cfe_iocb_t *iocb)
+{
+ char *env;
+
+ env = env_getenv((char*)iocb->plist.iocb_envbuf.name_ptr);
+
+ if (env == NULL) return CFE_ERR_ENVNOTFOUND;
+
+ xstrncpy((char*)iocb->plist.iocb_envbuf.val_ptr,
+ env,
+ iocb->plist.iocb_envbuf.val_length);
+
+ return CFE_OK;
+}
+
+static int cfe_cmd_env_set(cfe_devctx_t *ctx,cfe_iocb_t *iocb)
+{
+ int res;
+ int flg;
+
+
+ flg = (iocb->iocb_flags & CFE_FLG_ENV_PERMANENT) ?
+ ENV_FLG_NORMAL : ENV_FLG_BUILTIN;
+
+ res = env_setenv((char*)iocb->plist.iocb_envbuf.name_ptr,
+ (char*)iocb->plist.iocb_envbuf.val_ptr,
+ flg);
+
+ if (res == 0) {
+ if (iocb->iocb_flags & CFE_FLG_ENV_PERMANENT) res = env_save();
+ }
+
+ if (res < 0) return res;
+
+ return CFE_OK;
+}
+
+static int cfe_cmd_env_del(cfe_devctx_t *ctx,cfe_iocb_t *iocb)
+{
+ int res;
+
+ res = env_delenv((char*)iocb->plist.iocb_envbuf.name_ptr);
+
+ return res;
+}
+
+
+
diff --git a/cfe/cfe/main/cfe_ldr_elf.c b/cfe/cfe/main/cfe_ldr_elf.c
new file mode 100644
index 0000000..0581241
--- /dev/null
+++ b/cfe/cfe/main/cfe_ldr_elf.c
@@ -0,0 +1,396 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * ELF Program Loader File: cfe_ldr_elf.c
+ *
+ * This program parses ELF executables and loads them into memory.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "cfe_error.h"
+#include "cfe_devfuncs.h"
+#include "cfe_timer.h"
+#include "cfe_mem.h"
+
+#include "cfe.h"
+#include "cfe_loader.h"
+#include "cfe_fileops.h"
+#include "elf.h"
+
+#include "cfe_boot.h"
+
+/* *********************************************************************
+ * Externs
+ ********************************************************************* */
+
+static int cfe_elfload(cfe_loadargs_t *la);
+
+const cfe_loader_t elfloader = {
+ "elf",
+ cfe_elfload,
+ 0};
+
+/* *********************************************************************
+ * readprogsegment(fsctx,ref,addr,size)
+ *
+ * Read a program segment, generally corresponding to one
+ * section of the file.
+ *
+ * Input parameters:
+ * fsctx - file I/O dispatch
+ * ref - reference data for open file handle
+ * addr - target virtual address
+ * size - size of region to read
+ *
+ * Return value:
+ * Number of bytes copied or <0 if error occured
+ ********************************************************************* */
+
+static int readprogsegment(fileio_ctx_t *fsctx,void *ref,
+ void *addr,int size,int flags)
+{
+ int res;
+
+#ifdef __long64
+ if (flags & LOADFLG_NOISY) xprintf("0x%016llx/%d ",addr,size);
+#else
+ if (flags & LOADFLG_NOISY) xprintf("0x%x/%d ",addr,size);
+#endif
+
+ if (!cfe_arena_loadcheck((uintptr_t) addr,size)) {
+ return CFE_ERR_BADADDR;
+ }
+
+ res = fs_read(fsctx,ref,addr,size);
+
+ if (res < 0) return CFE_ERR_IOERR;
+ if (res != size) return CFE_ERR_BADELFFMT;
+
+ return size;
+}
+
+
+/* *********************************************************************
+ * readclearbss(addr,size)
+ *
+ * Process a BSS section, zeroing memory corresponding to
+ * the BSS.
+ *
+ * Input parameters:
+ * addr - address to zero
+ * size - length of area to zero
+ *
+ * Return value:
+ * number of zeroed bytes or <0 if error occured
+ ********************************************************************* */
+
+static int readclearbss(void *addr,int size,int flags)
+{
+
+#ifdef __long64
+ if (flags & LOADFLG_NOISY) xprintf("0x%016llx/%d ",addr,size);
+#else
+ if (flags & LOADFLG_NOISY) xprintf("0x%x/%d ",addr,size);
+#endif
+
+ if (!cfe_arena_loadcheck((uintptr_t) addr,size)) {
+ return CFE_ERR_BADADDR;
+ }
+
+ if (size > 0) memset(addr,0,size);
+ return size;
+}
+
+
+/* *********************************************************************
+ * elfgetshdr(ops,ref,ep)
+ *
+ * Get a section header from the ELF file
+ *
+ * Input parameters:
+ * ops - file I/O dispatch
+ * ref - reference data for open file
+ * ep - extended header info
+ *
+ * Return value:
+ * copy of section header (malloc'd) or NULL if no memory
+ ********************************************************************* */
+
+static Elf32_Shdr *elfgetshdr(fileio_ctx_t *fsctx,void *ref,Elf32_Ehdr *ep)
+{
+ Elf32_Shdr *shtab;
+ unsigned size = ep->e_shnum * sizeof(Elf32_Shdr);
+
+ shtab = (Elf32_Shdr *) KMALLOC(size,0);
+ if (!shtab) {
+ return NULL;
+ }
+
+ if (fs_seek(fsctx,ref,ep->e_shoff,FILE_SEEK_BEGINNING) != ep->e_shoff ||
+ fs_read(fsctx,ref,(uint8_t *)shtab,size) != size) {
+ KFREE(shtab);
+ return NULL;
+ }
+
+ return (shtab);
+}
+
+/* *********************************************************************
+ * elfload_internal(ops,ref,entrypt,flags)
+ *
+ * Read an ELF file (main routine)
+ *
+ * Input parameters:
+ * ops - file I/O dispatch
+ * ref - open file handle
+ * entrypt - filled in with entry vector
+ * flags - generic boot flags
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int elfload_internal(fileio_ctx_t *fsctx,void *ref,
+ unsigned long *entrypt,int flags)
+{
+ Elf32_Ehdr *ep;
+ Elf32_Phdr *phtab = 0;
+ Elf32_Shdr *shtab = 0;
+ unsigned int nbytes;
+ int i;
+ int res;
+ Elf32_Ehdr ehdr;
+
+ ep = &ehdr;
+ if (fs_read(fsctx,ref,(uint8_t *) ep,sizeof(*ep)) != sizeof(*ep)) {
+ return CFE_ERR_IOERR;
+ }
+
+ /* check header validity */
+ if (ep->e_ident[EI_MAG0] != ELFMAG0 ||
+ ep->e_ident[EI_MAG1] != ELFMAG1 ||
+ ep->e_ident[EI_MAG2] != ELFMAG2 ||
+ ep->e_ident[EI_MAG3] != ELFMAG3) {
+ return CFE_ERR_NOTELF;
+ }
+
+ if (ep->e_ident[EI_CLASS] != ELFCLASS32) return CFE_ERR_NOT32BIT;
+
+#ifdef __MIPSEB
+ if (ep->e_ident[EI_DATA] != ELFDATA2MSB) return CFE_ERR_WRONGENDIAN; /* big endian */
+#endif
+#ifdef __MIPSEL
+ if (ep->e_ident[EI_DATA] != ELFDATA2LSB) return CFE_ERR_WRONGENDIAN; /* little endian */
+#endif
+
+ if (ep->e_ident[EI_VERSION] != EV_CURRENT) return CFE_ERR_BADELFVERS;
+ if (ep->e_machine != EM_MIPS) return CFE_ERR_NOTMIPS;
+
+ /* Is there a program header? */
+ if (ep->e_phoff == 0 || ep->e_phnum == 0 ||
+ ep->e_phentsize != sizeof(Elf32_Phdr)) {
+ return CFE_ERR_BADELFFMT;
+ }
+
+ /* Load program header */
+ nbytes = ep->e_phnum * sizeof(Elf32_Phdr);
+ phtab = (Elf32_Phdr *) KMALLOC(nbytes,0);
+ if (!phtab) {
+ return CFE_ERR_NOMEM;
+ }
+
+ if (fs_seek(fsctx,ref,ep->e_phoff,FILE_SEEK_BEGINNING) != ep->e_phoff ||
+ fs_read(fsctx,ref,(uint8_t *)phtab,nbytes) != nbytes) {
+ KFREE(phtab);
+ return CFE_ERR_IOERR;
+ }
+
+ /*
+ * From now on we've got no guarantee about the file order,
+ * even where the section header is. Hopefully most linkers
+ * will put the section header after the program header, when
+ * they know that the executable is not demand paged. We assume
+ * that the symbol and string tables always follow the program
+ * segments.
+ */
+
+ /* read section table (if before first program segment) */
+ if (ep->e_shoff < phtab[0].p_offset) {
+ shtab = elfgetshdr(fsctx,ref,ep);
+ }
+
+ /* load program segments */
+ /* We cope with a badly sorted program header, as produced by
+ * older versions of the GNU linker, by loading the segments
+ * in file offset order, not in program header order. */
+
+ while (1) {
+ Elf32_Off lowest_offset = ~0;
+ Elf32_Phdr *ph = 0;
+
+ /* find nearest loadable segment */
+ for (i = 0; i < ep->e_phnum; i++)
+ if ((phtab[i].p_type == PT_LOAD) && (phtab[i].p_offset < lowest_offset)) {
+ ph = &phtab[i];
+ lowest_offset = ph->p_offset;
+ }
+ if (!ph) {
+ break; /* none found, finished */
+ }
+
+ /* load the segment */
+ if (ph->p_filesz) {
+ if (fs_seek(fsctx,ref,ph->p_offset,FILE_SEEK_BEGINNING) != ph->p_offset) {
+ if (shtab) KFREE(shtab);
+ KFREE(phtab);
+ return CFE_ERR_BADELFFMT;
+ }
+ res = readprogsegment(fsctx,ref,
+ (void *)(intptr_t)(signed)ph->p_vaddr,
+ ph->p_filesz,flags);
+ if (res != ph->p_filesz) {
+ if (shtab) KFREE(shtab);
+ KFREE(phtab);
+ return res;
+ }
+ }
+
+ if (ph->p_filesz < ph->p_memsz) {
+ res = readclearbss((void *)(intptr_t)(signed)ph->p_vaddr + ph->p_filesz,
+ ph->p_memsz - ph->p_filesz,flags);
+ if (res < 0) {
+ if (shtab) KFREE(shtab);
+ KFREE(phtab);
+ return res;
+ }
+ }
+
+ ph->p_type = PT_NULL; /* remove from consideration */
+ }
+
+ KFREE(phtab);
+
+ *entrypt = (intptr_t)(signed)ep->e_entry; /* return entry point */
+ return 0;
+}
+
+
+
+/* *********************************************************************
+ * cfe_elfload(ops,file,flags)
+ *
+ * Read an ELF file (main entry point)
+ *
+ * Input parameters:
+ * ops - fileio dispatch
+ * file - name of file to read
+ * ept - where to put entry point
+ * flags - load flags
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+static int cfe_elfload(cfe_loadargs_t *la)
+{
+ fileio_ctx_t *fsctx;
+ void *ref;
+ int res;
+
+ /*
+ * Look up the file system type and get a context
+ */
+
+
+ res = fs_init(la->la_filesys,&fsctx,la->la_device);
+ if (res != 0) {
+ return res;
+ }
+
+ /*
+ * Turn on compression if we're doing that.
+ */
+
+ if (la->la_flags & LOADFLG_COMPRESSED) {
+ res = fs_hook(fsctx,"z");
+ if (res != 0) {
+ return res;
+ }
+ }
+
+ /*
+ * Open the remote file
+ */
+
+ res = fs_open(fsctx,&ref,la->la_filename,FILE_MODE_READ);
+ if (res != 0) {
+ fs_uninit(fsctx);
+ return CFE_ERR_FILENOTFOUND;
+ }
+
+ /*
+ * Load the image.
+ */
+
+ la->la_entrypt = 0;
+ res = elfload_internal(fsctx,ref,&(la->la_entrypt),la->la_flags);
+
+ /*
+ * All done, release resources
+ */
+
+ fs_close(fsctx,ref);
+ fs_uninit(fsctx);
+
+ return res;
+}
+
+
diff --git a/cfe/cfe/main/cfe_ldr_raw.c b/cfe/cfe/main/cfe_ldr_raw.c
new file mode 100644
index 0000000..d436849
--- /dev/null
+++ b/cfe/cfe/main/cfe_ldr_raw.c
@@ -0,0 +1,360 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * RAW Program Loader File: cfe_ldr_raw.c
+ *
+ * This program reads raw binaries into memory.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_error.h"
+#include "cfe_devfuncs.h"
+
+#include "cfe.h"
+#include "cfe_fileops.h"
+
+#include "cfe_boot.h"
+#include "cfe_bootblock.h"
+
+#include "cfe_loader.h"
+
+/* *********************************************************************
+ * Externs
+ ********************************************************************* */
+
+static int cfe_rawload(cfe_loadargs_t *la);
+
+const cfe_loader_t rawloader = {
+ "raw",
+ cfe_rawload,
+ 0};
+
+/* *********************************************************************
+ * cfe_findbootblock(la,fsctx,ref)
+ *
+ * Find the boot block on the specified device.
+ *
+ * Input parameters:
+ * la - loader args (to be filled in)
+ * ops - file operations
+ * ref - reference for open file handle
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+static int cfe_findbootblock(cfe_loadargs_t *la,
+ fileio_ctx_t *fsctx,
+ void *ref,
+ struct boot_block *bootblock)
+{
+ uint32_t checksum = 0;
+ uint32_t calcsum;
+ uint32_t secsize = 0;
+ uint64_t secoffset = 0;
+ int res;
+ int curblk;
+
+ /*
+ * Search for the boot block. Stop when we find
+ * something with a matching checksum and magic
+ * number.
+ */
+
+ fs_seek(fsctx,ref,0,FILE_SEEK_BEGINNING);
+
+ for (curblk = 0; curblk < BOOT_BLOCK_MAXLOC; curblk++) {
+
+
+ /* Read a block */
+
+ res = fs_read(fsctx,ref,
+ (unsigned char *) bootblock,
+ sizeof(struct boot_block));
+
+ if (res != sizeof(struct boot_block)) {
+ return CFE_ERR_IOERR;
+ }
+
+ /* Verify magic number */
+
+ if (bootblock->bb_magic != BOOT_MAGIC_NUMBER) {
+ continue;
+ }
+
+ /* Extract fields from block */
+
+ checksum = ((uint32_t) (bootblock->bb_hdrinfo & BOOT_HDR_CHECKSUM_MASK));
+ bootblock->bb_hdrinfo &= ~BOOT_HDR_CHECKSUM_MASK;
+ secsize = ((uint32_t) (bootblock->bb_secsize & BOOT_SECSIZE_MASK));
+ secoffset = bootblock->bb_secstart;
+
+ /* Verify block's checksum */
+
+ CHECKSUM_BOOT_DATA(&(bootblock->bb_magic),BOOT_BLOCK_SIZE,&calcsum);
+
+ if (checksum == calcsum) {
+ break;
+ }
+ }
+
+ /*
+ * Okay, determine if we were successful.
+ */
+
+ if (bootblock->bb_magic != BOOT_MAGIC_NUMBER) {
+ return CFE_ERR_INVBOOTBLOCK;
+ }
+
+ if (checksum != calcsum) {
+ return CFE_ERR_BBCHECKSUM;
+ }
+
+ /*
+ * If we get here, we had a valid boot block.
+ */
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * cfe_rawload(la)
+ *
+ * Read a raw (unformatted) boot file
+ *
+ * Input parameters:
+ * la - loader args
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+static int cfe_rawload(cfe_loadargs_t *la)
+{
+ int res;
+ fileio_ctx_t *fsctx;
+ const fileio_dispatch_t *ops;
+ void *ref;
+ int ttlcopy = 0;
+ int findbb;
+ int devinfo;
+ struct boot_block bootblock;
+ uint8_t *ptr;
+ uint8_t *bootcode;
+ uint32_t checksum,calcsum;
+ uint64_t secoffset = 0;
+ int32_t maxsize;
+ int amtcopy;
+ int thisamt;
+ uint32_t loadflags;
+ int onedot;
+
+ loadflags = la->la_flags;
+
+ /*
+ * Set starting address and maximum size. You can either
+ * explicitly set this (with LOADFLG_SPECADDR) or
+ * let CFE decide. If CFE decides, the load address
+ * will be BOOT_START_ADDRESS in all cases.
+ * The size is dependant on the device type: block and flash
+ * devices will get this info from the boot block,
+ * and network devices will get the info by reaching EOF
+ * on reads, up to the maximum size of the boot area.
+ */
+
+ if (loadflags & LOADFLG_SPECADDR) {
+ bootcode = (uint8_t *) la->la_address;
+ maxsize = la->la_maxsize;
+ findbb = FALSE; /* don't find a boot block */
+ }
+ else {
+ bootcode = (uint8_t *) BOOT_START_ADDRESS;
+ maxsize = BOOT_AREA_SIZE;
+ findbb = FALSE;
+ devinfo = la->la_device ? cfe_getdevinfo(la->la_device) : 0;
+
+ /*
+ * If the device is either a disk or a flash device,
+ * we will expect to find a boot block.
+ * Serial and network devices do not have boot blocks.
+ */
+ if ((devinfo >= 0) &&
+ ( ((devinfo & CFE_DEV_MASK) == CFE_DEV_DISK) ||
+ ((devinfo & CFE_DEV_MASK) == CFE_DEV_FLASH) )) {
+ findbb = TRUE;
+ }
+ }
+
+
+ /*
+ * merge in any filesystem-specific flags
+ */
+
+ ops = cfe_findfilesys(la->la_filesys);
+ if (!ops) return CFE_ERR_FSNOTAVAIL;
+ loadflags |= ops->loadflags;
+
+ /*
+ * turn off the boot block if requested.
+ */
+
+ if (loadflags & LOADFLG_NOBB) findbb = FALSE;
+
+ /*
+ * Create a file system context
+ */
+
+ res = fs_init(la->la_filesys,&fsctx,la->la_device);
+ if (res != 0) {
+ return res;
+ }
+
+ /*
+ * Turn on compression if we're doing that.
+ */
+
+ if (!findbb && (la->la_flags & LOADFLG_COMPRESSED)) {
+ res = fs_hook(fsctx,"z");
+ if (res != 0) {
+ return res;
+ }
+ }
+
+ /*
+ * Open the boot device
+ */
+
+ res = fs_open(fsctx,&ref,la->la_filename,FILE_MODE_READ);
+ if (res != 0) {
+ fs_uninit(fsctx);
+ return res;
+ }
+
+ /*
+ * If we need to find a boot block, do it now.
+ */
+
+ if (findbb) {
+ res = cfe_findbootblock(la,fsctx,ref,&bootblock);
+
+ /*
+ * If we found the boot block, seek to the part of the
+ * disk where the boot code is.
+ * Otherwise, get out now, since the disk has no boot block.
+ */
+
+ if (res == 0) {
+ maxsize = (int) ((uint32_t) (bootblock.bb_secsize & BOOT_SECSIZE_MASK));
+ secoffset = bootblock.bb_secstart;
+ fs_seek(fsctx,ref,secoffset,FILE_SEEK_BEGINNING);
+ }
+ else {
+ fs_close(fsctx,ref);
+ fs_uninit(fsctx);
+ return res;
+ }
+
+ }
+
+ /*
+ * Okay, go load the boot file.
+ */
+
+ ptr = bootcode;
+ amtcopy = maxsize;
+ ttlcopy = 0;
+
+ onedot = amtcopy / 10; /* ten dots for entire load */
+ if (onedot < 4096) onedot = 4096; /* but minimum 4096 bytes per dot */
+ onedot = (onedot + 1) & ~4095; /* round to multiple of 4096 */
+
+ while (amtcopy > 0) {
+ thisamt = onedot;
+ if (thisamt > amtcopy) thisamt = amtcopy;
+
+ res = fs_read(fsctx,ref,ptr,thisamt);
+ if (la->la_flags & LOADFLG_NOISY) {
+ xprintf(".");
+ }
+ if (res <= 0) break;
+ ptr += res;
+ amtcopy -= res;
+ ttlcopy += res;
+ }
+
+ /*
+ * We're done with the file.
+ */
+
+ fs_close(fsctx,ref);
+ fs_uninit(fsctx);
+
+ /*
+ * Verify the boot loader checksum if we were reading
+ * the disk.
+ */
+
+ if (findbb) {
+ CHECKSUM_BOOT_DATA(bootcode,maxsize,&calcsum);
+ checksum = (uint32_t) ((bootblock.bb_secsize & BOOT_DATA_CHECKSUM_MASK)
+ >> BOOT_DATA_CHECKSUM_SHIFT);
+
+ if (checksum != calcsum) {
+ return CFE_ERR_BOOTPROGCHKSUM;
+ }
+ }
+
+ la->la_entrypt = (uintptr_t) bootcode;
+
+ if (la->la_flags & LOADFLG_NOISY) xprintf(" %d bytes read\n",ttlcopy);
+
+ return (res < 0) ? res : ttlcopy;
+
+}
+
diff --git a/cfe/cfe/main/cfe_ldr_srec.c b/cfe/cfe/main/cfe_ldr_srec.c
new file mode 100644
index 0000000..b067f2b
--- /dev/null
+++ b/cfe/cfe/main/cfe_ldr_srec.c
@@ -0,0 +1,557 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * SREC Program Loader File: cfe_ldr_srec.c
+ *
+ * This program reads Motorola S-record files into memory
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_error.h"
+#include "cfe_devfuncs.h"
+
+#include "cfe.h"
+#include "cfe_fileops.h"
+
+#include "cfe_boot.h"
+#include "cfe_bootblock.h"
+
+#include "cfe_loader.h"
+
+#include "cfe_mem.h"
+
+/* *********************************************************************
+ * Externs
+ ********************************************************************* */
+
+static int cfe_srecload(cfe_loadargs_t *la);
+
+const cfe_loader_t srecloader = {
+ "srec",
+ cfe_srecload,
+ 0};
+
+
+typedef struct linebuf_s {
+ char linebuf[256];
+ int curidx;
+ int buflen;
+ int eof;
+ void *ref;
+ fileio_ctx_t *fsctx;
+} linebuf_t;
+
+#define initlinebuf(b,r,o) (b)->curidx = 0; (b)->buflen = 0; \
+ (b)->eof = 0 ; (b)->ref = r; (b)->fsctx = o
+
+
+/* *********************************************************************
+ * readchar(file)
+ *
+ * Read a character from a file. It's kind of like getchar
+ * on "C" FILE devices, but not so fancy.
+ *
+ * Input parameters:
+ * file - pointer to a linebuf_t containing reader state
+ *
+ * Return value:
+ * character, or -1 if at EOF
+ ********************************************************************* */
+
+static int readchar(linebuf_t *file)
+{
+ int ch;
+ int res;
+
+ if (file->eof) return -1;
+
+ if (file->curidx == file->buflen) {
+ for (;;) {
+ res = fs_read(file->fsctx,file->ref,file->linebuf,sizeof(file->linebuf));
+ if (res < 0) {
+ file->eof = -1;
+ return -1;
+ }
+ if (res == 0) continue;
+ file->buflen = res;
+ file->curidx = 0;
+ break;
+ }
+ }
+
+ ch = file->linebuf[file->curidx];
+ file->curidx++;
+ return ch;
+}
+
+
+/* *********************************************************************
+ * readline(file,buffer,maxlen)
+ *
+ * Read a line of text from a file using our crude file stream
+ * mechanism.
+ *
+ * Input parameters:
+ * file - pointer to a linebuf_t containing reader state
+ * buffer - will receive line of text
+ * maxlen - number of bytes that will fit in buffer
+ *
+ * Return value:
+ * 0 if ok, else <0 if at EOF
+ ********************************************************************* */
+
+static int readline(linebuf_t *file,char *buffer,int maxlen)
+{
+ int ch;
+ char *ptr;
+
+ ptr = buffer;
+ maxlen--; /* account for terminating null */
+
+ while (maxlen) {
+ ch = readchar(file);
+ if (ch == -1) return -1;
+ if (ch == 27) return -1; /* ESC */
+ if ((ch == '\n') || (ch == '\r')) break;
+ *ptr++ = (char) ch;
+ maxlen--;
+ }
+
+ *ptr = '\0';
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * getxdigit(c)
+ *
+ * Convert a hex digit into its numeric equivalent
+ *
+ * Input parameters:
+ * c - character
+ *
+ * Return value:
+ * value
+ ********************************************************************* */
+
+static int getxdigit(char c)
+{
+ if ((c >= '0') && (c <= '9')) return c - '0';
+ if ((c >= 'A') && (c <= 'F')) return c - 'A' + 10;
+ if ((c >= 'a') && (c <= 'f')) return c - 'a' + 10;
+ return -1;
+}
+
+/* *********************************************************************
+ * getbyte(line)
+ *
+ * Process two hex digits and return the value
+ *
+ * Input parameters:
+ * line - pointer to pointer to characters (updated on exit)
+ *
+ * Return value:
+ * byte value, or <0 if bad hex digits
+ ********************************************************************* */
+
+static int getbyte(char **line)
+{
+ int res;
+ int c1,c2;
+
+ c1 = getxdigit(*(*(line)+0));
+ if (c1 < 0) return -1;
+
+ c2 = getxdigit(*(*(line)+1));
+ if (c2 < 0) return -1;
+
+ res = (c1*16+c2);
+ (*line) += 2;
+
+ return res;
+}
+
+
+/* *********************************************************************
+ * procsrec(line,loadaddr,blklen,data)
+ *
+ * Process an S-record, reading the data into a local buffer
+ * and returning the block's address.
+ *
+ * Input parameters:
+ * line - line of text (s-record line)
+ * loadaddr - will be filled with address where data should go
+ * blklen - will be filled in with size of record
+ * data - points to buffer to receive data
+ *
+ * Return value:
+ * <0 if error occured (not an s-record)
+ ********************************************************************* */
+
+static int procsrec(char *line,
+ unsigned int *loadaddr,
+ unsigned int *blklen,
+ unsigned char *data)
+{
+ char rectype;
+ unsigned char b;
+ unsigned int len;
+ unsigned int minlen;
+ unsigned int linelen;
+ unsigned int addr;
+ unsigned int chksum;
+
+ int idx;
+ int ret = 0;
+
+ addr = 0;
+
+ if (*line++ != 'S')
+ return -1; /* not an S record */
+
+ rectype = *line++;
+
+ minlen = 3; /* type 1 record */
+ switch (rectype) {
+ case '0':
+ break;
+
+ /*
+ * data bytes
+ */
+ case '3':
+ minlen++;
+ /* fall through */
+ case '2':
+ minlen++;
+ /* fall through */
+ case '1':
+ chksum = 0;
+ linelen = getbyte(&line);
+ if (linelen < minlen) {
+ xprintf("srec: line too short\n");
+ return -1;
+ }
+ chksum += (unsigned int)linelen;
+
+ /*
+ * There are two address bytes in a type 1 record, and three
+ * in a type 2 record. The high-order byte is first, then
+ * one or two lower-order bytes. Build up the adddress.
+ */
+ b = getbyte(&line);
+ chksum += (unsigned int)b;
+ addr = b;
+ b = getbyte(&line);
+ chksum += (unsigned int)b;
+ addr <<= 8;
+ addr += b;
+ if (rectype == '2') {
+ b = getbyte(&line);
+ chksum += (unsigned int)b;
+ addr <<= 8;
+ addr += b;
+ }
+ if (rectype == '3') {
+ b = getbyte(&line);
+ chksum += (unsigned int)b;
+ addr <<= 8;
+ addr += b;
+ b = getbyte(&line);
+ chksum += (unsigned int)b;
+ addr <<= 8;
+ addr += b;
+ }
+
+#if VERBOSE
+ printf("Addr: %08X Len: %3u(0x%x)\n", addr , linelen - minlen,
+ linelen-minlen);
+#endif
+
+ *loadaddr = addr;
+ len = linelen - minlen;
+ *blklen = len;
+
+ for (idx = 0; idx < len; idx++) {
+ b = getbyte(&line);
+ chksum += (unsigned int) b;
+ data[idx] = (unsigned char ) b;
+ }
+
+ b = getbyte(&line);
+ chksum = (~chksum) & 0x000000FF;
+ if (chksum != b) {
+ xprintf("Checksum error in s-record file\n");
+ return -1;
+ }
+ ret = 1;
+ break;
+
+ case '9':
+ linelen = getbyte(&line);
+ b = getbyte(&line);
+ addr = b;
+ b = getbyte(&line);
+ addr <<= 8;
+ addr += b;
+ *loadaddr = addr;
+ ret = -2;
+ break;
+
+ case '8':
+ linelen = getbyte(&line);
+ b = getbyte(&line);
+ addr = b;
+ b = getbyte(&line);
+ addr <<= 8;
+ addr += b;
+ b = getbyte(&line);
+ addr <<= 8;
+ addr += b;
+ *loadaddr = addr;
+ ret = -2;
+ break;
+
+ case '7':
+ linelen = getbyte(&line);
+ b = getbyte(&line);
+ addr = b;
+ b = getbyte(&line);
+ addr <<= 8;
+ addr += b;
+ b = getbyte(&line);
+ addr <<= 8;
+ addr += b;
+ b = getbyte(&line);
+ addr <<= 8;
+ addr += b;
+ *loadaddr = addr;
+ ret = -2;
+ break;
+
+ default:
+ xprintf("Unknown S-record type: %c\n",rectype);
+ return -1;
+ break;
+ }
+
+ return ret;
+}
+
+
+/* *********************************************************************
+ * cfe_srecload(la)
+ *
+ * Read an s-record file
+ *
+ * Input parameters:
+ * la - loader args
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+static int cfe_srecload(cfe_loadargs_t *la)
+{
+ int res;
+ fileio_ctx_t *fsctx;
+ void *ref;
+ int devinfo;
+ int serial = FALSE;
+ unsigned int loadaddr;
+ unsigned int blklen;
+ linebuf_t lb;
+ char line[256];
+ uint8_t data[256];
+ int cnt;
+ unsigned int specaddr; /* current address if loading to a special address */
+ int specflg; /* true if in "special address" mode */
+ int firstrec = 1; /* true if we have not seen the first record */
+
+ /*
+ * We might want to know something about the boot device.
+ */
+
+ devinfo = la->la_device ? cfe_getdevinfo(la->la_device) : 0;
+
+ /*
+ * Figure out if we're loading to a "special address". This lets
+ * us load S-records into a temporary buffer, ignoring the
+ * addresses in the records (but using them so we'll know where
+ * they go relative to each other
+ */
+
+ specflg = (la->la_flags & LOADFLG_SPECADDR) ? 1 : 0;
+ specaddr = 0;
+
+ /*
+ * If the device is a serial port, we want to know that.
+ */
+
+ if ((devinfo >= 0) &&
+ ((devinfo & CFE_DEV_MASK) == CFE_DEV_SERIAL)) {
+ serial = TRUE;
+ }
+
+ /*
+ * Create a file system context
+ */
+
+ res = fs_init(la->la_filesys,&fsctx,la->la_device);
+ if (res != 0) {
+ return res;
+ }
+
+ /*
+ * Turn on compression if we're doing that.
+ */
+
+ if (la->la_flags & LOADFLG_COMPRESSED) {
+ res = fs_hook(fsctx,"z");
+ if (res != 0) {
+ return res;
+ }
+ }
+
+ /*
+ * Open the boot device
+ */
+
+ res = fs_open(fsctx,&ref,la->la_filename,FILE_MODE_READ);
+ if (res != 0) {
+ fs_uninit(fsctx);
+ return res;
+ }
+
+ /*
+ * Okay, go load the boot file. Process S-records until
+ * we get an entry point record (usually at the end).
+ *
+ * XXX what if it's *not* at the end?
+ */
+
+ initlinebuf(&lb,ref,fsctx);
+
+ cnt = 0;
+ for (;;) {
+ /*
+ * Read a line of text
+ */
+ res = readline(&lb,line,sizeof(line));
+ if (res < 0) break; /* reached EOF */
+
+ /*
+ * Process the S-record. If at EOF, procsrec returns 0.
+ * Invalid s-records returns -1.
+ */
+
+ if (line[0] == 0) continue;
+
+ res = procsrec(line,&loadaddr,&blklen,data);
+
+#if 0
+ if (res == -2 || res >= 0)
+ xprintf(".");
+#endif
+ if (res < 0) break;
+
+ /*
+ * Handle "special address" mode. All S-records will be
+ * loaded into a buffer passed by the caller to the loader.
+ * We use the addresses in the S-records to determine
+ * relative placement of the data, keying on the first
+ * S-record in the file.
+ */
+
+ if ((res == 1) && (specflg)) {
+ if (firstrec) {
+ /* First S-record seen sets the base for all that follow */
+ specaddr = loadaddr;
+ firstrec = 0;
+ }
+ loadaddr = la->la_address + (intptr_t) (loadaddr - specaddr);
+ }
+
+ cnt++;
+
+ if (res == 1) {
+ if (!cfe_arena_loadcheck((intptr_t) loadaddr,blklen)) {
+ xprintf("Invalid address: %P\n",loadaddr);
+ res = -1;
+ break;
+ }
+ memcpy((uint8_t *) (intptr_t) (signed)loadaddr,data,blklen);
+ }
+ }
+
+ /*
+ * We're done with the file.
+ */
+
+ fs_close(fsctx,ref);
+ fs_uninit(fsctx);
+
+ /*
+ * Say something cute on the LEDs.
+ * Don't do this for every s-record, because if logging the LED
+ * changes out the serial port, that can take a Long Time. Just
+ * goes to show: too much cuteness is a _very_ bad thing.
+ */
+ xsprintf(line,"%04d",cnt);
+ cfe_ledstr(line);
+
+ if (res == -2) {
+ la->la_entrypt = (intptr_t) (signed) loadaddr;
+ res = 0;
+ }
+
+ return res;
+}
+
+
diff --git a/cfe/cfe/main/cfe_link.mk b/cfe/cfe/main/cfe_link.mk
new file mode 100644
index 0000000..7529dc4
--- /dev/null
+++ b/cfe/cfe/main/cfe_link.mk
@@ -0,0 +1,26 @@
+#
+# This Makefile snippet takes care of linking the firmware.
+#
+
+pci : $(PCICOMMON) $(PCIMACHDEP)
+ echo done
+
+cfe cfe.bin : $(CRT0OBJS) $(BSPOBJS) $(LIBCFE)
+ $(GLD) -o cfe -Map cfe.map $(LDFLAGS) $(CRT0OBJS) $(BSPOBJS) -L. -lcfe $(LDLIBS)
+ $(OBJDUMP) -d cfe > cfe.dis
+ $(OBJCOPY) --output-target=binary cfe cfe.bin
+ $(OBJCOPY) --input-target=binary --output-target=srec cfe.bin cfe.srec
+
+cfe.flash : cfe.bin mkflashimage
+ ./mkflashimage -v ${ENDIAN} -B ${CFG_BOARDNAME} -V ${CFE_VER_MAJ}.${CFE_VER_MIN}.${CFE_VER_ECO} cfe.bin cfe.flash
+ $(OBJCOPY) --input-target=binary --output-target=srec cfe.flash cfe.flash.srec
+
+
+clean :
+ rm -f *.o *~ cfe cfe.bin cfe.dis cfe.map cfe.srec
+ rm -f makereg ${CPU}_socregs.inc mkpcidb pcidevs_data2.h mkflashimage
+ rm -f build_date.c
+ rm -f libcfe.a
+ rm -f cfe.flash cfe.flash.srec $(CLEANOBJS)
+
+distclean : clean
diff --git a/cfe/cfe/main/cfe_loader.c b/cfe/cfe/main/cfe_loader.c
new file mode 100644
index 0000000..bbd3eb4
--- /dev/null
+++ b/cfe/cfe/main/cfe_loader.c
@@ -0,0 +1,135 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Loader API File: cfe_loader.c
+ *
+ * This is the main API for the program loader. CFE supports
+ * multiple "installable" methods for loading programs, allowing
+ * us to deal with a variety of methods for moving programs
+ * into memory for execution.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+
+#include "cfe_error.h"
+
+#include "cfe.h"
+#include "cfe_fileops.h"
+
+#include "cfe_loader.h"
+
+#include "bsp_config.h"
+
+
+/* *********************************************************************
+ * Externs
+ ********************************************************************* */
+
+extern const cfe_loader_t elfloader;
+extern const cfe_loader_t rawloader;
+extern const cfe_loader_t srecloader;
+
+/* *********************************************************************
+ * Loader list
+ ********************************************************************* */
+
+const cfe_loader_t * const cfe_loaders[] = {
+ &elfloader,
+#if !CFG_MINIMAL_SIZE
+ &rawloader,
+ &srecloader,
+#endif
+ NULL};
+
+/* *********************************************************************
+ * cfe_findloader(name)
+ *
+ * Find a loader by name
+ *
+ * Input parameters:
+ * name - name of loader to find
+ *
+ * Return value:
+ * pointer to loader structure or NULL
+ ********************************************************************* */
+
+const cfe_loader_t *cfe_findloader(char *name)
+{
+ const cfe_loader_t * const *ldr;
+
+ ldr = cfe_loaders;
+
+ while (*ldr) {
+ if (strcmp(name,(*ldr)->name) == 0) return (*ldr);
+ ldr++;
+ }
+
+ return NULL;
+}
+
+
+/* *********************************************************************
+ * cfe_load_progam(name,args)
+ *
+ * Look up a loader and call it.
+ *
+ * Input parameters:
+ * name - name of loader to run
+ * args - arguments to pass
+ *
+ * Return value:
+ * return value
+ ********************************************************************* */
+
+int cfe_load_program(char *name,cfe_loadargs_t *la)
+{
+ const cfe_loader_t *ldr;
+ int res;
+
+ ldr = cfe_findloader(name);
+ if (!ldr) return CFE_ERR_LDRNOTAVAIL;
+
+ res = LDRLOAD(ldr,la);
+
+ return res;
+}
diff --git a/cfe/cfe/main/cfe_main.c b/cfe/cfe/main/cfe_main.c
new file mode 100644
index 0000000..1a451a6
--- /dev/null
+++ b/cfe/cfe/main/cfe_main.c
@@ -0,0 +1,636 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Main Module File: cfe_main.c
+ *
+ * This module contains the main "C" routine for CFE and
+ * the main processing loop. There should not be any board-specific
+ * stuff in here.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "cfe_timer.h"
+
+#include "env_subr.h"
+#include "ui_command.h"
+#include "cfe_mem.h"
+#include "cfe.h"
+
+#include "exception.h"
+
+#include "bsp_config.h"
+
+#include "segtable.h"
+
+#include "initdata.h"
+
+#if CFG_PCI
+#include "pcivar.h"
+#endif
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#ifndef CFG_STACK_SIZE
+#define STACK_SIZE 8192
+#else
+#define STACK_SIZE ((CFG_STACK_SIZE+1023) & ~1023)
+#endif
+
+/* *********************************************************************
+ * Externs
+ ********************************************************************* */
+
+void cfe_main(int,int);
+extern void cfe_device_poll(void *x);
+
+extern int ui_init_envcmds(void);
+extern int ui_init_devcmds(void);
+extern int ui_init_netcmds(void);
+extern int ui_init_memcmds(void);
+extern int ui_init_loadcmds(void);
+extern int ui_init_pcicmds(void);
+extern int ui_init_examcmds(void);
+extern int ui_init_flashcmds(void);
+extern int ui_init_misccmds(void);
+#if CFG_VAPI
+extern int ui_init_vapicmds(void);
+#endif
+
+#if CFG_VENDOR_EXTENSIONS
+extern int ui_init_vendorcmds(void);
+#endif
+
+void cfe_command_restart(uint64_t status);
+
+extern segtable_t *_getsegtbl(void);
+
+extern const char *builddate;
+extern const char *builduser;
+
+#if CFG_MULTI_CPUS
+extern int altcpu_cmd_start(uint64_t,uint64_t *);
+extern int altcpu_cmd_stop(uint64_t);
+#endif
+
+
+
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+const char *cfe_boardname = CFG_BOARDNAME;
+unsigned int cfe_startflags =
+#if CFG_PCI
+ CFE_INIT_PCI |
+#endif
+ 0;
+
+/* *********************************************************************
+ * cfe_setup_default_env()
+ *
+ * Initialize the default environment for CFE. These are all
+ * the temporary variables that do not get stored in the NVRAM
+ * but are available to other programs and command-line macros.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void cfe_setup_default_env(void)
+{
+ char buffer[80];
+
+ xsprintf(buffer,"%d.%d.%d",CFE_VER_MAJOR,CFE_VER_MINOR,CFE_VER_BUILD);
+ env_setenv("CFE_VERSION",buffer,ENV_FLG_BUILTIN | ENV_FLG_READONLY);
+
+ if (cfe_boardname) {
+ env_setenv("CFE_BOARDNAME",(char *) cfe_boardname,
+ ENV_FLG_BUILTIN | ENV_FLG_READONLY);
+ }
+
+ xsprintf(buffer,"%d",mem_totalsize);
+ env_setenv("CFE_MEMORYSIZE",buffer,ENV_FLG_BUILTIN | ENV_FLG_READONLY);
+
+}
+
+
+/* *********************************************************************
+ * cfe_init_ui()
+ *
+ * Call all the other UI initialization modules. Each of these
+ * modules usually calls back to the UI dispatcher to add command
+ * tables.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+#if CFG_MINIMAL_SIZE
+#define OPTIONAL(x)
+#else
+#define OPTIONAL(x) x
+#endif
+
+static void cfe_init_ui(void)
+{
+ ui_init_cmddisp();
+
+ ui_init_envcmds();
+ OPTIONAL(ui_init_devcmds());
+#if CFG_NETWORK
+ ui_init_netcmds();
+#endif
+ ui_init_loadcmds();
+ OPTIONAL(ui_init_memcmds());
+
+#if CFG_PCI
+ ui_init_pcicmds();
+#endif
+ OPTIONAL(ui_init_examcmds());
+ ui_init_flashcmds();
+#if CFG_VAPI
+ ui_init_vapicmds();
+#endif
+
+#if CFG_VENDOR_EXTENSIONS
+ ui_init_vendorcmds();
+#endif
+
+ OPTIONAL(ui_init_misccmds());
+
+}
+
+
+/* *********************************************************************
+ * cfe_ledstr(leds)
+ *
+ * Display a string on the board's LED display, if it has one.
+ * This routine depends on the board-support package to
+ * include a "driver" to write to the actual LED, if the board
+ * does not have one this routine will do nothing.
+ *
+ * The LEDs are written at various places in the initialization
+ * sequence, to debug board problems.
+ *
+ * Input parameters:
+ * leds - pointer to four-character ASCII string
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void cfe_ledstr(const char *leds)
+{
+ unsigned int val;
+
+ val = ((((unsigned int) leds[0]) << 24) |
+ (((unsigned int) leds[1]) << 16) |
+ (((unsigned int) leds[2]) << 8) |
+ ((unsigned int) leds[3]));
+
+ cfe_leds(val);
+}
+
+
+/* *********************************************************************
+ * cfe_say_hello()
+ *
+ * Print out the CFE startup message and copyright notice
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+
+static void cfe_say_hello(void)
+{
+ xprintf("\n\n");
+ xprintf("CFE version 2.0.2"
+#ifdef CFE_VER_RELEASE
+ ".%d"
+#endif
+ " for DGN2200v2 (%s)\n",
+ //CFE_VER_MAJOR,CFE_VER_MINOR,CFE_VER_BUILD,
+#ifdef CFE_VER_RELEASE
+ CFE_VER_RELEASE,
+#endif
+ //cfe_boardname,
+#ifdef __long64
+ "64bit,"
+#else
+ "32bit,"
+#endif
+#if CFG_MULTI_CPUS
+ "MP,"
+#else
+ "SP,"
+#endif
+#ifdef __MIPSEL
+ "LE"
+#endif
+#ifdef __MIPSEB
+ "BE"
+#endif
+#if CFG_VAPI
+ ",VAPI"
+#endif
+ );
+
+ xprintf("Build Date: %s (%s)\n",builddate,builduser);
+ xprintf("Copyright (C) 2000,2001,2002,2003 Broadcom Corporation.\n");
+ xprintf("\n");
+}
+
+
+/* *********************************************************************
+ * cfe_restart()
+ *
+ * Restart CFE from scratch, jumping back to the boot vector.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * does not return
+ ********************************************************************* */
+
+void cfe_restart(void)
+{
+ _exc_restart();
+}
+
+
+/* *********************************************************************
+ * cfe_start(ept)
+ *
+ * Start a user program
+ *
+ * Input parameters:
+ * ept - entry point
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+void cfe_start(unsigned long ept)
+{
+ SETLEDS("RUN!");
+ cfe_launch(ept);
+}
+
+
+/* *********************************************************************
+ * cfe_startup_info()
+ *
+ * Display startup memory configuration messages
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void cfe_startup_info(void)
+{
+ segtable_t *segtbl;
+
+ segtbl = _getsegtbl();
+ xprintf("CPU type 0x%X: ",(uint32_t)cpu_prid);
+ if (cfe_cpu_speed < 1000000) xprintf("%dKHz\n",cfe_cpu_speed/1000);
+ else xprintf("%dMHz\n",cfe_cpu_speed/1000000);
+ xprintf("Total memory: 0x%llX bytes (%dMB)\n",
+ (((uint64_t)mem_totalsize) << 20),(uint32_t)mem_totalsize);
+
+ xprintf("\n");
+ xprintf("Total memory used by CFE: 0x%08X - 0x%08X (%d)\n",
+ (uint32_t) mem_bottomofmem,
+ (uint32_t) mem_topofmem,
+ (uint32_t) mem_topofmem-mem_bottomofmem);
+ xprintf("Initialized Data: 0x%08X - 0x%08X (%d)\n",
+ (uint32_t) (segtbl[R_SEG_FDATA] + mem_datareloc),
+ (uint32_t) (segtbl[R_SEG_EDATA] + mem_datareloc),
+ (uint32_t) (segtbl[R_SEG_EDATA] - segtbl[R_SEG_FDATA]));
+ xprintf("BSS Area: 0x%08X - 0x%08X (%d)\n",
+ (uint32_t) (segtbl[R_SEG_FBSS] + mem_datareloc),
+ (uint32_t) (segtbl[R_SEG_END] + mem_datareloc),
+ (uint32_t) (segtbl[R_SEG_END] - segtbl[R_SEG_FBSS]));
+ xprintf("Local Heap: 0x%08X - 0x%08X (%d)\n",
+ (uint32_t)(mem_heapstart),
+ (uint32_t)(mem_heapstart + (CFG_HEAP_SIZE*1024)),
+ (CFG_HEAP_SIZE*1024));
+ xprintf("Stack Area: 0x%08X - 0x%08X (%d)\n",
+ (uint32_t)(mem_heapstart + (CFG_HEAP_SIZE*1024)),
+ (uint32_t)(mem_heapstart + (CFG_HEAP_SIZE*1024) + STACK_SIZE),
+ STACK_SIZE);
+ xprintf("Text (code) segment: 0x%08X - 0x%08X (%d)\n",
+ (uint32_t)mem_textbase,
+ (uint32_t)(mem_textbase+mem_textsize),
+ (uint32_t) mem_textsize);
+ xprintf("Boot area (physical): 0x%08X - 0x%08X\n",
+ mem_bootarea_start,mem_bootarea_start+mem_bootarea_size);
+ xprintf("Relocation Factor: I:%08X - D:%08X\n",
+ (uint32_t) mem_textreloc,(uint32_t) mem_datareloc);
+
+}
+
+
+/* *********************************************************************
+ * cfe_autostart()
+ *
+ * Process automatic commands at startup
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void cfe_autostart(void)
+{
+ char *env;
+ int noauto = 0;
+ char ch;
+
+ env = env_getenv("STARTUP");
+ if (!env) return;
+
+ while (console_status()) {
+ console_read(&ch,1);
+ if (ch == 3) noauto = TRUE; /* Ctrl-C means no auto */
+ }
+
+ if (noauto) {
+ xprintf("Automatic startup canceled via Ctrl-C\n");
+ return;
+ }
+
+ ui_docommands(env);
+}
+
+/* *********************************************************************
+ * cfe_main(a,b)
+ *
+ * It's gotta start somewhere.
+ *
+ * Input parameters:
+ * a,b - not used
+ *
+ * Return value:
+ * does not return
+ ********************************************************************* */
+
+void cfe_main(int a,int b)
+{
+
+ /*
+ * By the time this routine is called, the following things have
+ * already been done:
+ *
+ * 1. The processor(s) is(are) initialized.
+ * 2. The caches are initialized.
+ * 3. The memory controller is initialized.
+ * 4. BSS has been zeroed.
+ * 5. The data has been moved to R/W space.
+ * 6. The "C" Stack has been initialized.
+ */
+
+ cfe_bg_init(); /* init background processing */
+ cfe_attach_init();
+ cfe_timer_init(); /* Timer process */
+ cfe_bg_add(cfe_device_poll,NULL);
+
+ /*
+ * Initialize the memory allocator
+ */
+
+ SETLEDS("KMEM");
+ KMEMINIT((unsigned char *) (uintptr_t) mem_heapstart,
+ ((CFG_HEAP_SIZE)*1024));
+
+ /*
+ * Initialize the console. It is done before the other devices
+ * get turned on. The console init also sets the variable that
+ * contains the CPU speed.
+ */
+
+ SETLEDS("CONS");
+ board_console_init();
+
+ /*
+ * Set up the exception vectors
+ */
+
+ cfe_setup_exceptions();
+
+ /*
+ * Say hello.
+ */
+
+ SETLEDS("CIOK");
+ cfe_say_hello();
+
+ /*
+ * Initialize the other devices.
+ */
+
+ SETLEDS("AREN");
+ xprintf("Initializing Arena.\n");
+ cfe_arena_init();
+
+#if CFG_PCI
+ if (cfe_startflags & CFE_INIT_PCI) {
+ pci_flags_t flags = PCI_FLG_NORMAL | PCI_FLG_LDT_PREFETCH;
+ char *str;
+ extern cons_t pci_optnames[];
+
+ flags = PCI_FLG_NORMAL | PCI_FLG_LDT_PREFETCH;
+#if CFG_LDT_REV_017
+ flags |= PCI_FLG_LDT_REV_017;
+#endif
+ str = env_getenv("PCI_OPTIONS");
+ setoptions(pci_optnames,str,&flags);
+
+ xprintf("Initializing PCI. [%s]\n",str ? str : "normal");
+ pci_configure(flags);
+ }
+#endif
+
+ SETLEDS("DEVI");
+ xprintf("Initializing Devices.\n");
+ board_device_init();
+
+ cfe_startup_info();
+ SETLEDS("ENVI");
+ cfe_setup_default_env();
+
+ xprintf("\n");
+
+ cfe_init_ui();
+
+ board_final_init();
+
+ cfe_autostart();
+
+ cfe_command_loop();
+}
+
+/* *********************************************************************
+ * cfe_command_restart()
+ *
+ * This routine is called when an application wants to restart
+ * the firmware's command processor. Reopen the console and
+ * jump back into the command loop.
+ *
+ * Input parameters:
+ * status - A0 value of program returning to firmware
+ *
+ * Return value:
+ * does not return
+ ********************************************************************* */
+
+void cfe_command_restart(uint64_t status)
+{
+ /*
+ * Stop alternate CPU(s). If they're already stopped, this
+ * command will make sure they're stopped.
+ */
+
+#if CFG_MULTI_CPUS
+ altcpu_cmd_stop(1); /* stop CPU 1 (XXX more CPUs?) */
+#endif
+
+ /*
+ * Call board reset functions
+ */
+ board_device_reset();
+
+ /*
+ * Reset devices
+ */
+ cfe_device_reset();
+
+ /*
+ * Reset timers
+ */
+ cfe_timer_init();
+
+ /*
+ * Reopen console
+ */
+ console_open(console_name);
+
+ /*
+ * Display program return status
+ */
+
+ xprintf("*** program exit status = %d\n", (int)status);
+
+ /*
+ * Back to processing user commands
+ */
+ cfe_command_loop();
+}
+
+
+
+/* *********************************************************************
+ * cfe_command_loop()
+ *
+ * This routine reads and processes user commands
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * does not return
+ ********************************************************************* */
+
+void cfe_command_loop()
+{
+ char buffer[300];
+ int status;
+ char *prompt;
+
+ SETLEDS("CFE ");
+
+ for (;;) {
+ prompt = env_getenv("PROMPT");
+#if CFG_RAMAPP
+ SETLEDS("CFE*");
+ if (!prompt) prompt = "CFE_RAM> ";
+#else
+ if (!prompt) prompt = "CFE> ";
+#endif
+ console_readline(prompt,buffer,sizeof(buffer));
+
+ status = ui_docommands(buffer);
+
+ if (status != CMD_ERR_BLANK) {
+ xprintf("*** command status = %d\n", status);
+ }
+ }
+}
+
+
+
+
+
diff --git a/cfe/cfe/main/cfe_mem.c b/cfe/cfe/main/cfe_mem.c
new file mode 100644
index 0000000..1c424e1
--- /dev/null
+++ b/cfe/cfe/main/cfe_mem.c
@@ -0,0 +1,256 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Physical Memory (arena) manager File: cfe_mem.c
+ *
+ * This module describes the physical memory available to the
+ * firmware.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "lib_arena.h"
+
+#include "cfe_error.h"
+
+#include "cfe.h"
+#include "cfe_mem.h"
+
+#include "initdata.h"
+
+#define _NOPROTOS_
+#include "cfe_boot.h"
+#undef _NOPROTOS_
+
+#include "cpu_config.h" /* for definition of CPUCFG_ARENAINIT */
+
+#include "addrspace.h" /* for macros dealing with addresses */
+
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#define ARENA_RANGE(bottom,top,type) arena_markrange(&cfe_arena,(uint64_t)(bottom), \
+ (uint64_t)(top)-(uint64_t)bottom+1,(type),NULL)
+
+#define MEG (1024*1024)
+#define KB 1024
+#define PAGESIZE 4096
+#define CFE_BOOTAREA_SIZE (256*KB)
+#define CFE_BOOTAREA_ADDR 0x20000000
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+arena_t cfe_arena;
+extern void _setcontext(int64_t);
+
+unsigned int mem_bootarea_start;
+unsigned int mem_bootarea_size;
+
+extern void CPUCFG_ARENAINIT(void);
+extern void cfe_bootarea_init(void);
+extern void CPUCFG_PAGETBLINIT(uint64_t *ptaddr,unsigned int ptstart);
+
+
+
+/* *********************************************************************
+ * cfe_arena_init()
+ *
+ * Create the initial map of physical memory
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void cfe_arena_init(void)
+{
+ uint64_t memlo,memhi;
+
+ /*
+ * This macro expands via cpu_config.h to an appropriate function
+ * name for creating an empty arena appropriately for our CPU
+ */
+
+ CPUCFG_ARENAINIT();
+
+ /*
+ * Round the area used by the firmware to a page boundary and
+ * mark it in use
+ */
+
+ memhi = PHYSADDR((mem_topofmem + 4095) & ~4095);
+ memlo = PHYSADDR(mem_bottomofmem) & ~4095;
+
+ ARENA_RANGE(memlo,memhi-1,MEMTYPE_DRAM_USEDBYFIRMWARE);
+
+ /*
+ * Create the initial page table
+ */
+
+ cfe_bootarea_init();
+
+}
+
+
+/* *********************************************************************
+ * cfe_arena_enum(idx,type,start,size)
+ *
+ * Enumerate available memory. This is called by the user
+ * API dispatcher so that operating systems can determine what
+ * memory regions are available to them.
+ *
+ * Input parameters:
+ * idx - index. Start at zero and increment until an error
+ * is returned.
+ * type,start,size: pointers to variables to receive the
+ * arena entry's information
+ * allrecs - true to retrieve all records, false to retrieve
+ * only available DRAM
+ *
+ * Return value:
+ * 0 if ok
+ * CFE_ERR_NOMORE if idx is beyond the last entry
+ ********************************************************************* */
+
+int cfe_arena_enum(int idx,int *type,uint64_t *start,uint64_t *size,int allrecs)
+{
+ arena_node_t *node;
+ queue_t *qb;
+ arena_t *arena = &cfe_arena;
+
+
+ for (qb = (arena->arena_list.q_next); qb != &(arena->arena_list);
+ qb = qb->q_next) {
+ node = (arena_node_t *) qb;
+
+ if (allrecs || (!allrecs && (node->an_type == MEMTYPE_DRAM_AVAILABLE))) {
+ if (idx == 0) {
+ *type = node->an_type;
+ *start = node->an_address;
+ *size = node->an_length;
+ return 0;
+ }
+ idx--;
+ }
+ }
+
+ return CFE_ERR_NOMORE;
+
+}
+
+/* *********************************************************************
+ * cfe_arena_loadcheck(start,size)
+ *
+ * Determine if the specified memory area is within the available
+ * DRAM. This is used while loading executables to be sure we
+ * don't trash the firmware.
+ *
+ * Input parameters:
+ * start - starting physical address
+ * size - size of requested region
+ *
+ * Return value:
+ * true - ok to copy memory here
+ * false - not ok, memory overlaps firmware
+ ********************************************************************* */
+
+int cfe_arena_loadcheck(uintptr_t start,unsigned int size)
+{
+ arena_node_t *node;
+ queue_t *qb;
+ arena_t *arena = &cfe_arena;
+
+ /*
+ * If the address is in our boot area, it's okay
+ * for it to be a virtual address.
+ */
+
+ if ((start >= BOOT_START_ADDRESS) &&
+ ((start+size) <= (BOOT_START_ADDRESS+BOOT_AREA_SIZE))) {
+ return TRUE;
+ }
+
+ /*
+ * Otherwise, make a physical address.
+ */
+
+ start = PHYSADDR(start);
+
+ /*
+ * Because all of the arena nodes of the same type are
+ * coalesced together, all we need to do is determine if the
+ * requested region is entirely within an arena node,
+ * so there's no need to look for things that span nodes.
+ */
+
+ for (qb = (arena->arena_list.q_next); qb != &(arena->arena_list);
+ qb = qb->q_next) {
+ node = (arena_node_t *) qb;
+
+ /* If the memory is available, the region is OK. */
+
+ if ((start >= node->an_address) &&
+ ((start+size) <= (node->an_address+node->an_length)) &&
+ (node->an_type == MEMTYPE_DRAM_AVAILABLE)) {
+ return TRUE;
+ }
+ }
+
+ /*
+ * Otherwise, it's not. We could go through the arena again and
+ * look for regions of other types that intersect the requested
+ * region, to get a more detailed error, but this'll do.
+ */
+
+ return FALSE;
+
+}
+
diff --git a/cfe/cfe/main/cfe_rawfs.c b/cfe/cfe/main/cfe_rawfs.c
new file mode 100644
index 0000000..4c29349
--- /dev/null
+++ b/cfe/cfe/main/cfe_rawfs.c
@@ -0,0 +1,293 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * "Raw" file system File: cfe_rawfs.c
+ *
+ * This filesystem dispatch is used to read files directly
+ * from a block device. For example, you can 'dd' an elf
+ * file directly onto a disk or flash card and then run
+ * it using this module.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_error.h"
+#include "cfe_fileops.h"
+#include "cfe_iocb.h"
+#include "cfe_devfuncs.h"
+#include "cfe_console.h"
+
+#include "cfe.h"
+
+/* *********************************************************************
+ * RAW context
+ ********************************************************************* */
+
+/*
+ * File system context - describes overall file system info,
+ * such as the handle to the underlying device.
+ */
+
+typedef struct raw_fsctx_s {
+ int raw_dev;
+ int raw_isconsole;
+ int raw_refcnt;
+} raw_fsctx_t;
+
+/*
+ * File context - describes an open file on the file system.
+ * For raw devices, this is pretty meaningless, but we do
+ * keep track of where we are.
+ */
+
+typedef struct raw_file_s {
+ raw_fsctx_t *raw_fsctx;
+ int raw_fileoffset;
+ int raw_baseoffset; /* starting offset of raw "file" */
+ int raw_length; /* length of file, -1 for whole device */
+} raw_file_t;
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+static int raw_fileop_init(void **fsctx,void *devicename);
+static int raw_fileop_open(void **ref,void *fsctx,char *filename,int mode);
+static int raw_fileop_read(void *ref,uint8_t *buf,int len);
+static int raw_fileop_write(void *ref,uint8_t *buf,int len);
+static int raw_fileop_seek(void *ref,int offset,int how);
+static void raw_fileop_close(void *ref);
+static void raw_fileop_uninit(void *fsctx);
+
+/* *********************************************************************
+ * RAW fileio dispatch table
+ ********************************************************************* */
+
+const fileio_dispatch_t raw_fileops = {
+ "raw",
+ 0,
+ raw_fileop_init,
+ raw_fileop_open,
+ raw_fileop_read,
+ raw_fileop_write,
+ raw_fileop_seek,
+ raw_fileop_close,
+ raw_fileop_uninit
+};
+
+static int raw_fileop_init(void **newfsctx,void *dev)
+{
+ raw_fsctx_t *fsctx;
+ char *devicename = (char *) dev;
+
+ *newfsctx = NULL;
+
+ fsctx = KMALLOC(sizeof(raw_fsctx_t),0);
+ if (!fsctx) {
+ return CFE_ERR_NOMEM;
+ }
+
+ if (strcmp(devicename,console_name) == 0) {
+ fsctx->raw_dev = console_handle;
+ fsctx->raw_isconsole = TRUE;
+ }
+ else {
+ fsctx->raw_dev = cfe_open(devicename);
+ fsctx->raw_isconsole = FALSE;
+ }
+
+ fsctx->raw_refcnt = 0;
+
+ if (fsctx->raw_dev >= 0) {
+ *newfsctx = fsctx;
+ return 0;
+ }
+
+ KFREE(fsctx);
+
+ return CFE_ERR_FILENOTFOUND;
+}
+
+static int raw_fileop_open(void **ref,void *fsctx_arg,char *filename,int mode)
+{
+ raw_fsctx_t *fsctx;
+ raw_file_t *file;
+ char temp[100];
+ char *len;
+
+ if (mode != FILE_MODE_READ) return CFE_ERR_UNSUPPORTED;
+
+ fsctx = (raw_fsctx_t *) fsctx_arg;
+
+ file = KMALLOC(sizeof(raw_file_t),0);
+ if (!file) {
+ return CFE_ERR_NOMEM;
+ }
+
+ file->raw_fileoffset = 0;
+ file->raw_fsctx = fsctx;
+
+ /* Assume the whole device. */
+ file->raw_baseoffset = 0;
+ file->raw_length = -1;
+
+ /*
+ * If a filename was specified, it will be in the form
+ * offset,length - for example, 0x10000,0x200
+ * Parse this into two pieces and set up our internal
+ * file extent information. you can use either decimal
+ * or "0x" notation.
+ */
+ if (filename) {
+ lib_trimleading(filename);
+ strncpy(temp,filename,sizeof(temp));
+ len = strchr(temp,',');
+ if (len) *len++ = '\0';
+ if (temp[0]) {
+ file->raw_baseoffset = lib_atoi(temp);
+ }
+ if (len) {
+ file->raw_length = lib_atoi(len);
+ }
+ }
+
+ fsctx->raw_refcnt++;
+
+ *ref = file;
+ return 0;
+}
+
+static int raw_fileop_read(void *ref,uint8_t *buf,int len)
+{
+ raw_file_t *file = (raw_file_t *) ref;
+ int res;
+
+ /*
+ * Bound the length based on our "file length" if one
+ * was specified.
+ */
+
+ if (file->raw_length >= 0) {
+ if ((file->raw_length - file->raw_fileoffset) < len) {
+ len = file->raw_length - file->raw_fileoffset;
+ }
+ }
+
+ if (len == 0) return 0;
+
+ /*
+ * Read the data, adding in the base address.
+ */
+
+ res = cfe_readblk(file->raw_fsctx->raw_dev,
+ file->raw_baseoffset + file->raw_fileoffset,
+ buf,len);
+
+ if (res > 0) {
+ file->raw_fileoffset += res;
+ }
+
+ return res;
+}
+
+static int raw_fileop_write(void *ref,uint8_t *buf,int len)
+{
+ return CFE_ERR_UNSUPPORTED;
+}
+
+static int raw_fileop_seek(void *ref,int offset,int how)
+{
+ raw_file_t *file = (raw_file_t *) ref;
+
+ switch (how) {
+ case FILE_SEEK_BEGINNING:
+ file->raw_fileoffset = offset;
+ break;
+ case FILE_SEEK_CURRENT:
+ file->raw_fileoffset += offset;
+ if (file->raw_fileoffset < 0) file->raw_fileoffset = 0;
+ break;
+ default:
+ break;
+ }
+
+ /*
+ * Make sure we don't attempt to seek past the end of the file.
+ */
+
+ if (file->raw_length >= 0) {
+ if (file->raw_fileoffset > file->raw_length) {
+ file->raw_fileoffset = file->raw_length;
+ }
+ }
+
+ return file->raw_fileoffset;
+}
+
+
+static void raw_fileop_close(void *ref)
+{
+ raw_file_t *file = (raw_file_t *) ref;
+
+ file->raw_fsctx->raw_refcnt--;
+
+ KFREE(file);
+}
+
+static void raw_fileop_uninit(void *fsctx_arg)
+{
+ raw_fsctx_t *fsctx = (raw_fsctx_t *) fsctx_arg;
+
+ if (fsctx->raw_refcnt) {
+ xprintf("raw_fileop_uninit: warning: refcnt not zero\n");
+ }
+
+ if (fsctx->raw_isconsole == FALSE) {
+ cfe_close(fsctx->raw_dev);
+ }
+
+ KFREE(fsctx);
+}
diff --git a/cfe/cfe/main/cfe_savedata.c b/cfe/cfe/main/cfe_savedata.c
new file mode 100644
index 0000000..e1d27c4
--- /dev/null
+++ b/cfe/cfe/main/cfe_savedata.c
@@ -0,0 +1,123 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Data Save routine File: cfe_savedata.c
+ *
+ * This module is used for dumping memory to an output device
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_error.h"
+#include "cfe_devfuncs.h"
+
+#include "cfe.h"
+#include "cfe_fileops.h"
+
+#include "cfe_loader.h"
+
+/* *********************************************************************
+ * Externs
+ ********************************************************************* */
+
+/* *********************************************************************
+ * cfe_savedata(fsname,filename,start,end)
+ *
+ * Write memory contents to the specified device
+ *
+ * Input parameters:
+ * fsname - name of file system
+ * filename - name of file within file system
+ * start - starting address (pointer)
+ * end - ending address (pointer)
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+int cfe_savedata(char *fsname,char *devname,char *filename,uint8_t *start,uint8_t *end)
+{
+ int res;
+ fileio_ctx_t *fsctx;
+ void *ref;
+
+ /*
+ * Create a file system context
+ */
+
+ res = fs_init(fsname,&fsctx,devname);
+ if (res != 0) {
+ return res;
+ }
+
+ /*
+ * Open the device
+ */
+
+ res = fs_open(fsctx,&ref,filename,FILE_MODE_WRITE);
+ if (res != 0) {
+ fs_uninit(fsctx);
+ return res;
+ }
+
+ /*
+ * Write the data
+ */
+
+ res = fs_write(fsctx,ref,start,end-start);
+
+ /*
+ * Close
+ */
+
+ fs_close(fsctx,ref);
+ fs_uninit(fsctx);
+
+ return res;
+
+}
+
diff --git a/cfe/cfe/main/cfe_timer.c b/cfe/cfe/main/cfe_timer.c
new file mode 100644
index 0000000..2b8a0fc
--- /dev/null
+++ b/cfe/cfe/main/cfe_timer.c
@@ -0,0 +1,286 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Timer routines File: cfe_timer.c
+ *
+ * This module contains routines to keep track of the system time,.
+ * Since we don't have any interrupts in the firmware, even the
+ * timer is polled. The timer must be called often enough
+ * to prevent missing the overflow of the CP0 COUNT
+ * register, approximately 2 billion cycles (half the count)
+ *
+ * Be sure to use the POLL() macro each time you enter a loop
+ * where you are waiting for some I/O event to occur or
+ * are waiting for time to elapse.
+ *
+ * It is *not* a time-of-year clock. The timer is only used
+ * for timing I/O events.
+ *
+ * Internally, time is maintained in units of "CLOCKSPERTICK",
+ * which should be about tenths of seconds.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_printf.h"
+
+#include "cfe_timer.h"
+
+#include "cfe.h"
+
+#include "bsp_config.h"
+#include "cpu_config.h"
+
+/* Foxconn add start by Jenny Zhao, 07/02/2008*/
+#include "boardparms.h"
+#include "bcm63xx_util.h"
+#include "tftpd.h"
+/* Foxconn add end by Jenny Zhao, 07/02/2008*/
+
+#ifndef CFG_CPU_SPEED
+#define CFG_CPU_SPEED 500000 /* CPU speed in Hz */
+#endif
+
+#ifndef CPUCFG_CYCLESPERCPUTICK
+#define CPUCFG_CYCLESPERCPUTICK 1 /* CPU clock ticks per CP0 COUNT */
+#endif
+
+/* *********************************************************************
+ * Externs
+ ********************************************************************* */
+
+extern int32_t _getticks(void); /* return value of CP0 COUNT */
+
+/* *********************************************************************
+ * Data
+ ********************************************************************* */
+
+volatile int64_t cfe_ticks; /* current system time */
+
+int cfe_cpu_speed = CFG_CPU_SPEED; /* CPU speed in clocks/second */
+
+static unsigned int cfe_clocks_per_usec;
+static unsigned int cfe_clocks_per_tick;
+
+static int32_t cfe_oldcount; /* For keeping track of ticks */
+static int32_t cfe_remticks;
+static int cfe_timer_initflg = 0;
+
+/*
+ * C0_COUNT clocks per microsecond and per tick. Some CPUs tick CP0
+ * every 'n' cycles, that's what CPUCFG_CYCLESPERCPUTICK is for. */
+#define CFE_CLOCKSPERUSEC (cfe_cpu_speed/1000000/(CPUCFG_CYCLESPERCPUTICK))
+#define CFE_CLOCKSPERTICK (cfe_cpu_speed/(CFE_HZ)/(CPUCFG_CYCLESPERCPUTICK))
+
+/* Foxconn add start by Jenny Zhao, 07/02/2008*/
+extern int ui_docommands(char *str);
+
+extern int g_tftp_upgrade_success;
+extern int nmrp_server_detected;
+
+//extern int g_reboot;
+///* Foxconn add end by Jenny Zhao, 07/02/2008*/
+
+/* *********************************************************************
+ * cfe_timer_task()
+ *
+ * This routine is called as part of normal device polling to
+ * update the system time. We read the CP0 COUNT register,
+ * add the delta into our current time, convert to ticks,
+ * and keep track of the COUNT register overflow
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+
+static void cfe_timer_task(void *arg)
+{
+ int32_t count;
+ int32_t deltaticks;
+ int32_t clockspertick;
+
+ /* Foxconn add start by Jenny Zhao, 07/02/2008*/
+ static int64_t nmrp_previous_trigger_ticks = 0;
+ static int64_t tftp_previous_trigger_ticks = 0;
+ static int tftp_led_state = 0;
+ /* Foxconn add start by Jenny Zhao, 07/02/2008*/
+
+ clockspertick = CFE_CLOCKSPERTICK;
+
+ count = _getticks();
+
+ if (count >= cfe_oldcount) {
+ deltaticks = (count - cfe_oldcount) / clockspertick;
+ cfe_remticks += (count - cfe_oldcount) % clockspertick;
+ }
+ else {
+ deltaticks = (cfe_oldcount - count) / clockspertick;
+ cfe_remticks += (cfe_oldcount - count) % clockspertick;
+ }
+
+ cfe_ticks += deltaticks + (cfe_remticks / clockspertick);
+ cfe_remticks %= clockspertick;
+ cfe_oldcount = count;
+
+ /* Foxconn add start by Jenny Zhao, 07/02/2008*/
+ if(g_tftp_upgrade_success==1)
+ {
+ if((cfe_ticks - nmrp_previous_trigger_ticks) > 5) //500 ms
+ {
+ nmrp_previous_trigger_ticks = cfe_ticks;
+ nmrp_led_toggle();
+ }
+ }
+
+ /* Blink Power LED in tftpd mode */
+ if ( (get_tftpd_state() != TFTPD_STATE_OFF) && (nmrp_server_detected==0) )
+ {
+ if(tftp_led_state == 0) //led is off
+ {
+ if((cfe_ticks - tftp_previous_trigger_ticks) > 7) //700ms, spec. is 750ms
+ {
+ tftp_led_state = 1;
+ power_led_toggle(tftp_led_state);
+ tftp_previous_trigger_ticks = cfe_ticks;
+ }
+ }
+ else // led is currently on
+ {
+ if((cfe_ticks - tftp_previous_trigger_ticks) > 3) //300ms, spec. is 250ms
+ {
+ tftp_led_state = 0;
+ power_led_toggle(tftp_led_state);
+ tftp_previous_trigger_ticks = cfe_ticks;
+ }
+ }
+ }
+ /* Foxconn add end by Jenny Zhao, 07/02/2008*/
+}
+
+
+/* *********************************************************************
+ * cfe_timer_init()
+ *
+ * Initialize the timer module.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void cfe_timer_init(void)
+{
+ cfe_clocks_per_tick = CFE_CLOCKSPERTICK;
+ cfe_clocks_per_usec = CFE_CLOCKSPERUSEC;
+ if (cfe_clocks_per_usec == 0)
+ cfe_clocks_per_usec = 1; /* for the simulator */
+
+ cfe_oldcount = _getticks(); /* get current COUNT register */
+ cfe_ticks = 0;
+
+ if (!cfe_timer_initflg) {
+ cfe_bg_add(cfe_timer_task,NULL); /* add task for background polling */
+ cfe_timer_initflg = 1;
+ }
+}
+
+
+/* *********************************************************************
+ * cfe_sleep(ticks)
+ *
+ * Sleep for 'ticks' ticks. Background tasks are processed while
+ * we wait.
+ *
+ * Input parameters:
+ * ticks - number of ticks to sleep (note: *not* clocks!)
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void cfe_sleep(int ticks)
+{
+ int64_t timer;
+
+ TIMER_SET(timer,ticks);
+ while (!TIMER_EXPIRED(timer)) {
+ POLL();
+ }
+}
+
+
+
+/* *********************************************************************
+ * cfe_usleep(usec)
+ *
+ * Sleep for approximately the specified number of microseconds.
+ *
+ * Input parameters:
+ * usec - number of microseconds to wait
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void cfe_usleep(int usec)
+{
+ uint32_t newcount;
+ uint32_t now;
+
+ /* XXX fix the wrap problem */
+
+ now = _getticks();
+ newcount = now + usec*cfe_clocks_per_usec;
+
+ if (newcount < now) /* wait for wraparound */
+ while (_getticks() > now)
+ ;
+
+
+ while (_getticks() < newcount)
+ ;
+}
diff --git a/cfe/cfe/main/cfe_version.mk b/cfe/cfe/main/cfe_version.mk
new file mode 100755
index 0000000..653cbf9
--- /dev/null
+++ b/cfe/cfe/main/cfe_version.mk
@@ -0,0 +1,12 @@
+
+#
+# CFE's version number
+# Warning: Don't put spaces on either side of the equal signs
+# Put just the version number in here. This file is sourced
+# like a shell script in some cases!
+#
+
+CFE_VER_MAJ=1
+CFE_VER_MIN=0
+CFE_VER_ECO=37
+
diff --git a/cfe/cfe/main/cfe_xreq.c b/cfe/cfe/main/cfe_xreq.c
new file mode 100644
index 0000000..d12b1f2
--- /dev/null
+++ b/cfe/cfe/main/cfe_xreq.c
@@ -0,0 +1,346 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * IOCB dispatcher File: cfe_xreq.c
+ *
+ * This routine is the main API dispatch for CFE. User API
+ * calls, via the ROM entry point, get dispatched to routines
+ * in this module.
+ *
+ * This module looks similar to cfe_iocb_dispatch - it is different
+ * in that the data structure used, cfe_xiocb_t, uses fixed
+ * size field members (specifically, all 64-bits) no matter how
+ * the firmware is compiled. This ensures a consistent API
+ * interface on any implementation. When you call CFE
+ * from another program, the entry vector comes here first.
+ *
+ * Should the normal cfe_iocb interface change, this one should
+ * be kept the same for backward compatibility reasons.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "bsp_config.h"
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_queue.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "cfe_iocb.h"
+#include "cfe_xiocb.h"
+#if CFG_VENDOR_EXTENSIONS
+#include "cfe_vendor_iocb.h"
+#include "cfe_vendor_xiocb.h"
+#endif
+#include "cfe_error.h"
+#include "cfe_device.h"
+#include "cfe_timer.h"
+#include "cfe_mem.h"
+#include "env_subr.h"
+#include "cfe.h"
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+/* enum values for various plist types */
+
+#define PLBUF 1 /* iocb_buffer_t */
+#define PLCPU 2 /* iocb_cpuctl_t */
+#define PLMEM 3 /* iocb_meminfo_t */
+#define PLENV 4 /* iocb_envbuf_t */
+#define PLINP 5 /* iocb_inpstat_t */
+#define PLTIM 6 /* iocb_time_t */
+#define PLINF 7 /* iocb_fwinfo_t */
+#define PLEXIT 8 /* iocb_exitstat_t */
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+struct cfe_xcmd_dispatch_s {
+ int xplistsize;
+ int iplistsize;
+ int plisttype;
+};
+
+
+/* *********************************************************************
+ * Command conversion table
+ * This table contains useful information for converting
+ * iocbs to xiocbs.
+ ********************************************************************* */
+
+const static struct cfe_xcmd_dispatch_s cfe_xcmd_dispatch_table[CFE_CMD_MAX] = {
+ {sizeof(xiocb_fwinfo_t), sizeof(iocb_fwinfo_t), PLINF}, /* 0 : CFE_CMD_FW_GETINFO */
+ {sizeof(xiocb_exitstat_t),sizeof(iocb_exitstat_t),PLEXIT}, /* 1 : CFE_CMD_FW_RESTART */
+ {sizeof(xiocb_buffer_t), sizeof(iocb_buffer_t), PLBUF}, /* 2 : CFE_CMD_FW_BOOT */
+ {sizeof(xiocb_cpuctl_t), sizeof(iocb_cpuctl_t), PLCPU}, /* 3 : CFE_CMD_FW_CPUCTL */
+ {sizeof(xiocb_time_t), sizeof(iocb_time_t), PLTIM}, /* 4 : CFE_CMD_FW_GETTIME */
+ {sizeof(xiocb_meminfo_t),sizeof(iocb_meminfo_t),PLMEM}, /* 5 : CFE_CMD_FW_MEMENUM */
+ {0, 0, 0}, /* 6 : CFE_CMD_FW_FLUSHCACHE */
+ {-1, 0, 0}, /* 7 : */
+ {-1, 0, 0}, /* 8 : */
+ {0, 0, 0}, /* 9 : CFE_CMD_DEV_GETHANDLE */
+ {sizeof(xiocb_envbuf_t), sizeof(iocb_envbuf_t), PLENV}, /* 10 : CFE_CMD_DEV_ENUM */
+ {sizeof(xiocb_buffer_t), sizeof(iocb_buffer_t), PLBUF}, /* 11 : CFE_CMD_DEV_OPEN_*/
+ {sizeof(xiocb_inpstat_t),sizeof(iocb_inpstat_t),PLINP}, /* 12 : CFE_CMD_DEV_INPSTAT */
+ {sizeof(xiocb_buffer_t), sizeof(iocb_buffer_t), PLBUF}, /* 13 : CFE_CMD_DEV_READ */
+ {sizeof(xiocb_buffer_t), sizeof(iocb_buffer_t), PLBUF}, /* 14 : CFE_CMD_DEV_WRITE */
+ {sizeof(xiocb_buffer_t), sizeof(iocb_buffer_t), PLBUF}, /* 15 : CFE_CMD_DEV_IOCTL */
+ {0, 0, 0}, /* 16 : CFE_CMD_DEV_CLOSE */
+ {sizeof(xiocb_buffer_t), sizeof(iocb_buffer_t), PLBUF}, /* 17 : CFE_CMD_DEV_GETINFO */
+ {-1, 0, 0}, /* 18 : */
+ {-1, 0, 0}, /* 19 : */
+ {sizeof(xiocb_envbuf_t), sizeof(iocb_envbuf_t), PLENV}, /* 20 : CFE_CMD_ENV_ENUM */
+ {-1, 0, 0}, /* 21 : */
+ {sizeof(xiocb_envbuf_t), sizeof(iocb_envbuf_t), PLENV}, /* 22 : CFE_CMD_ENV_GET */
+ {sizeof(xiocb_envbuf_t), sizeof(iocb_envbuf_t), PLENV}, /* 23 : CFE_CMD_ENV_SET */
+ {sizeof(xiocb_envbuf_t), sizeof(iocb_envbuf_t), PLENV}, /* 24 : CFE_CMD_ENV_DEL */
+ {-1, 0, 0}, /* 25 : */
+ {-1, 0, 0}, /* 26 : */
+ {-1, 0, 0}, /* 27 : */
+ {-1, 0, 0}, /* 28 : */
+ {-1, 0, 0}, /* 29 : */
+ {-1, 0, 0}, /* 30 : */
+ {-1, 0, 0} /* 31 : */
+};
+
+
+/* *********************************************************************
+ * Externs
+ ********************************************************************* */
+
+extern int cfe_iocb_dispatch(cfe_iocb_t *iocb);
+cfe_int_t cfe_doxreq(cfe_xiocb_t *xiocb);
+#if CFG_VENDOR_EXTENSIONS
+extern cfe_int_t cfe_vendor_doxreq(cfe_vendor_xiocb_t *xiocb);
+#endif
+
+/* *********************************************************************
+ * cfe_doxreq(xiocb)
+ *
+ * Process an xiocb request. This routine converts an xiocb
+ * into an iocb, calls the IOCB dispatcher, converts the results
+ * back into the xiocb, and returns.
+ *
+ * Input parameters:
+ * xiocb - pointer to user xiocb
+ *
+ * Return value:
+ * command status, <0 if error occured
+ ********************************************************************* */
+
+cfe_int_t cfe_doxreq(cfe_xiocb_t *xiocb)
+{
+ const struct cfe_xcmd_dispatch_s *disp;
+ cfe_iocb_t iiocb;
+ cfe_int_t res;
+
+ /*
+ * Call out to customer-specific IOCBs. Customers may choose
+ * to implement their own XIOCBs directly, or go through their own
+ * translation layer (xiocb->iocb like CFE does) to insulate
+ * themselves from IOCB changes in the future.
+ */
+ if (xiocb->xiocb_fcode >= CFE_CMD_VENDOR_USE) {
+#if CFG_VENDOR_EXTENSIONS
+ return cfe_vendor_doxreq((cfe_vendor_xiocb_t *)xiocb);
+#else
+ return CFE_ERR_INV_COMMAND;
+#endif
+ }
+
+ /*
+ * Check for commands codes out of range
+ */
+
+ if ((xiocb->xiocb_fcode < 0) || (xiocb->xiocb_fcode >= CFE_CMD_MAX)) {
+ xiocb->xiocb_status = CFE_ERR_INV_COMMAND;
+ return xiocb->xiocb_status;
+ }
+
+ /*
+ * Check for command codes in range but invalid
+ */
+
+ disp = &cfe_xcmd_dispatch_table[xiocb->xiocb_fcode];
+
+ if (disp->xplistsize < 0) {
+ xiocb->xiocb_status = CFE_ERR_INV_COMMAND;
+ return xiocb->xiocb_status;
+ }
+
+ /*
+ * Check for invalid parameter list size
+ */
+
+ if (disp->xplistsize != xiocb->xiocb_psize) {
+ xiocb->xiocb_status = CFE_ERR_INV_PARAM;
+ return xiocb->xiocb_status;
+ }
+
+ /*
+ * Okay, copy parameters into the internal IOCB.
+ * First, the fixed header.
+ */
+
+ iiocb.iocb_fcode = (unsigned int) xiocb->xiocb_fcode;
+ iiocb.iocb_status = (int) xiocb->xiocb_status;
+ iiocb.iocb_handle = (int) xiocb->xiocb_handle;
+ iiocb.iocb_flags = (unsigned int) xiocb->xiocb_flags;
+ iiocb.iocb_psize = (unsigned int) disp->iplistsize;
+
+ /*
+ * Now the parameter list
+ */
+
+ switch (disp->plisttype) {
+ case PLBUF:
+ iiocb.plist.iocb_buffer.buf_offset = (cfe_offset_t) xiocb->plist.xiocb_buffer.buf_offset;
+ iiocb.plist.iocb_buffer.buf_ptr = (unsigned char *) (uintptr_t) xiocb->plist.xiocb_buffer.buf_ptr;
+ iiocb.plist.iocb_buffer.buf_length = (unsigned int) xiocb->plist.xiocb_buffer.buf_length;
+ iiocb.plist.iocb_buffer.buf_retlen = (unsigned int) xiocb->plist.xiocb_buffer.buf_retlen;
+ iiocb.plist.iocb_buffer.buf_ioctlcmd = (unsigned int) xiocb->plist.xiocb_buffer.buf_ioctlcmd;
+ break;
+ case PLCPU:
+ iiocb.plist.iocb_cpuctl.cpu_number = (unsigned int) xiocb->plist.xiocb_cpuctl.cpu_number;
+ iiocb.plist.iocb_cpuctl.cpu_command = (unsigned int) xiocb->plist.xiocb_cpuctl.cpu_command;
+ iiocb.plist.iocb_cpuctl.start_addr = (unsigned long) xiocb->plist.xiocb_cpuctl.start_addr;
+ iiocb.plist.iocb_cpuctl.gp_val = (unsigned long) xiocb->plist.xiocb_cpuctl.gp_val;
+ iiocb.plist.iocb_cpuctl.sp_val = (unsigned long) xiocb->plist.xiocb_cpuctl.sp_val;
+ iiocb.plist.iocb_cpuctl.a1_val = (unsigned long) xiocb->plist.xiocb_cpuctl.a1_val;
+ break;
+ case PLMEM:
+ iiocb.plist.iocb_meminfo.mi_idx = (int) xiocb->plist.xiocb_meminfo.mi_idx;
+ iiocb.plist.iocb_meminfo.mi_type = (int) xiocb->plist.xiocb_meminfo.mi_type;
+ iiocb.plist.iocb_meminfo.mi_addr = (unsigned long long) xiocb->plist.xiocb_meminfo.mi_addr;
+ iiocb.plist.iocb_meminfo.mi_size = (unsigned long long) xiocb->plist.xiocb_meminfo.mi_size;
+ break;
+ case PLENV:
+ iiocb.plist.iocb_envbuf.enum_idx = (int) xiocb->plist.xiocb_envbuf.enum_idx;
+ iiocb.plist.iocb_envbuf.name_ptr = (unsigned char *) (uintptr_t) xiocb->plist.xiocb_envbuf.name_ptr;
+ iiocb.plist.iocb_envbuf.name_length = (int) xiocb->plist.xiocb_envbuf.name_length;
+ iiocb.plist.iocb_envbuf.val_ptr = (unsigned char *) (uintptr_t) xiocb->plist.xiocb_envbuf.val_ptr;
+ iiocb.plist.iocb_envbuf.val_length = (int) xiocb->plist.xiocb_envbuf.val_length;
+ break;
+ case PLINP:
+ iiocb.plist.iocb_inpstat.inp_status = (int) xiocb->plist.xiocb_inpstat.inp_status;
+ break;
+ case PLTIM:
+ iiocb.plist.iocb_time.ticks = (long long) xiocb->plist.xiocb_time.ticks;
+ break;
+ case PLINF:
+ break;
+ case PLEXIT:
+ iiocb.plist.iocb_exitstat.status = (long long) xiocb->plist.xiocb_exitstat.status;
+ break;
+ }
+
+ /*
+ * Do the internal function dispatch
+ */
+
+ res = (cfe_int_t) cfe_iocb_dispatch(&iiocb);
+
+ /*
+ * Now convert the parameter list members back
+ */
+
+ switch (disp->plisttype) {
+ case PLBUF:
+ xiocb->plist.xiocb_buffer.buf_offset = (cfe_uint_t) iiocb.plist.iocb_buffer.buf_offset;
+ xiocb->plist.xiocb_buffer.buf_ptr = (cfe_xptr_t) (uintptr_t) iiocb.plist.iocb_buffer.buf_ptr;
+ xiocb->plist.xiocb_buffer.buf_length = (cfe_uint_t) iiocb.plist.iocb_buffer.buf_length;
+ xiocb->plist.xiocb_buffer.buf_retlen = (cfe_uint_t) iiocb.plist.iocb_buffer.buf_retlen;
+ xiocb->plist.xiocb_buffer.buf_ioctlcmd = (cfe_uint_t) iiocb.plist.iocb_buffer.buf_ioctlcmd;
+ break;
+ case PLCPU:
+ xiocb->plist.xiocb_cpuctl.cpu_number = (cfe_uint_t) iiocb.plist.iocb_cpuctl.cpu_number;
+ xiocb->plist.xiocb_cpuctl.cpu_command = (cfe_uint_t) iiocb.plist.iocb_cpuctl.cpu_command;
+ xiocb->plist.xiocb_cpuctl.start_addr = (cfe_uint_t) iiocb.plist.iocb_cpuctl.start_addr;
+ break;
+ case PLMEM:
+ xiocb->plist.xiocb_meminfo.mi_idx = (cfe_int_t) iiocb.plist.iocb_meminfo.mi_idx;
+ xiocb->plist.xiocb_meminfo.mi_type = (cfe_int_t) iiocb.plist.iocb_meminfo.mi_type;
+ xiocb->plist.xiocb_meminfo.mi_addr = (cfe_int64_t) iiocb.plist.iocb_meminfo.mi_addr;
+ xiocb->plist.xiocb_meminfo.mi_size = (cfe_int64_t) iiocb.plist.iocb_meminfo.mi_size;
+ break;
+ case PLENV:
+ xiocb->plist.xiocb_envbuf.enum_idx = (cfe_int_t) iiocb.plist.iocb_envbuf.enum_idx;
+ xiocb->plist.xiocb_envbuf.name_ptr = (cfe_xptr_t) (uintptr_t) iiocb.plist.iocb_envbuf.name_ptr;
+ xiocb->plist.xiocb_envbuf.name_length = (cfe_int_t) iiocb.plist.iocb_envbuf.name_length;
+ xiocb->plist.xiocb_envbuf.val_ptr = (cfe_xptr_t) (uintptr_t) iiocb.plist.iocb_envbuf.val_ptr;
+ xiocb->plist.xiocb_envbuf.val_length = (cfe_int_t) iiocb.plist.iocb_envbuf.val_length;
+ break;
+ case PLINP:
+ xiocb->plist.xiocb_inpstat.inp_status = (cfe_int_t) iiocb.plist.iocb_inpstat.inp_status;
+ break;
+ case PLTIM:
+ xiocb->plist.xiocb_time.ticks = (cfe_int_t) iiocb.plist.iocb_time.ticks;
+ break;
+ case PLINF:
+ xiocb->plist.xiocb_fwinfo.fwi_version = iiocb.plist.iocb_fwinfo.fwi_version;
+ xiocb->plist.xiocb_fwinfo.fwi_totalmem = iiocb.plist.iocb_fwinfo.fwi_totalmem;
+ xiocb->plist.xiocb_fwinfo.fwi_flags = iiocb.plist.iocb_fwinfo.fwi_flags;
+ xiocb->plist.xiocb_fwinfo.fwi_boardid = iiocb.plist.iocb_fwinfo.fwi_boardid;
+ xiocb->plist.xiocb_fwinfo.fwi_bootarea_va = iiocb.plist.iocb_fwinfo.fwi_bootarea_va;
+ xiocb->plist.xiocb_fwinfo.fwi_bootarea_pa = iiocb.plist.iocb_fwinfo.fwi_bootarea_pa;
+ xiocb->plist.xiocb_fwinfo.fwi_bootarea_size = iiocb.plist.iocb_fwinfo.fwi_bootarea_size;
+ xiocb->plist.xiocb_fwinfo.fwi_reserved1 = iiocb.plist.iocb_fwinfo.fwi_reserved1;
+ xiocb->plist.xiocb_fwinfo.fwi_reserved2 = iiocb.plist.iocb_fwinfo.fwi_reserved2;
+ xiocb->plist.xiocb_fwinfo.fwi_reserved3 = iiocb.plist.iocb_fwinfo.fwi_reserved3;
+ break;
+ case PLEXIT:
+ xiocb->plist.xiocb_exitstat.status = (cfe_int_t) iiocb.plist.iocb_exitstat.status;
+ break;
+ }
+
+ /*
+ * And the fixed header
+ */
+
+ xiocb->xiocb_status = (cfe_int_t) iiocb.iocb_status;
+ xiocb->xiocb_handle = (cfe_int_t) iiocb.iocb_handle;
+ xiocb->xiocb_flags = (cfe_uint_t) iiocb.iocb_flags;
+
+ return xiocb->xiocb_status;
+}
diff --git a/cfe/cfe/main/cfe_zlibfs.c b/cfe/cfe/main/cfe_zlibfs.c
new file mode 100644
index 0000000..7ad0847
--- /dev/null
+++ b/cfe/cfe/main/cfe_zlibfs.c
@@ -0,0 +1,453 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * "Compressed" file system File: cfe_zlibfs.c
+ *
+ * This is more of a filesystem "hook" than an actual file system.
+ * You can stick it on the front of the chain of file systems
+ * that CFE calls and it will route data read from the
+ * underlying filesystem through ZLIB before passing it up to the
+ * user.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#if CFG_ZLIB
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_error.h"
+#include "cfe_fileops.h"
+#include "cfe_iocb.h"
+#include "cfe_devfuncs.h"
+#include "cfe_console.h"
+
+#include "cfe.h"
+
+#include "zlib.h"
+
+/* *********************************************************************
+ * ZLIBFS context
+ ********************************************************************* */
+
+/*
+ * File system context - describes overall file system info,
+ * such as the handle to the underlying device.
+ */
+
+typedef struct zlibfs_fsctx_s {
+ void *zlibfsctx_subfsctx;
+ const fileio_dispatch_t *zlibfsctx_subops;
+ int zlibfsctx_refcnt;
+} zlibfs_fsctx_t;
+
+/*
+ * File context - describes an open file on the file system.
+ * For raw devices, this is pretty meaningless, but we do
+ * keep track of where we are.
+ */
+
+#define ZLIBFS_BUFSIZE 1024
+typedef struct zlibfs_file_s {
+ zlibfs_fsctx_t *zlibfs_fsctx;
+ int zlibfs_fileoffset;
+ void *zlibfs_subfile;
+ z_stream zlibfs_stream;
+ uint8_t *zlibfs_inbuf;
+ uint8_t *zlibfs_outbuf;
+ int zlibfs_outlen;
+ uint8_t *zlibfs_outptr;
+ int zlibfs_eofseen;
+} zlibfs_file_t;
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+static int zlibfs_fileop_init(void **fsctx,void *ctx);
+static int zlibfs_fileop_open(void **ref,void *fsctx,char *filename,int mode);
+static int zlibfs_fileop_read(void *ref,uint8_t *buf,int len);
+static int zlibfs_fileop_write(void *ref,uint8_t *buf,int len);
+static int zlibfs_fileop_seek(void *ref,int offset,int how);
+static void zlibfs_fileop_close(void *ref);
+static void zlibfs_fileop_uninit(void *fsctx);
+
+voidpf zcalloc(voidpf opaque,unsigned items, unsigned size);
+void zcfree(voidpf opaque,voidpf ptr);
+
+/* *********************************************************************
+ * ZLIB fileio dispatch table
+ ********************************************************************* */
+
+
+static uint8_t gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
+
+
+/* gzip flag byte */
+#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */
+#define HEAD_CRC 0x02 /* bit 1 set: header CRC present */
+#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
+#define ORIG_NAME 0x08 /* bit 3 set: original file name present */
+#define COMMENT 0x10 /* bit 4 set: file comment present */
+#define RESERVED 0xE0 /* bits 5..7: reserved */
+
+const fileio_dispatch_t zlibfs_fileops = {
+ "z",
+ 0,
+ zlibfs_fileop_init,
+ zlibfs_fileop_open,
+ zlibfs_fileop_read,
+ zlibfs_fileop_write,
+ zlibfs_fileop_seek,
+ zlibfs_fileop_close,
+ zlibfs_fileop_uninit
+};
+
+/*
+ * Utility functions needed by the ZLIB routines
+ */
+voidpf zcalloc(voidpf opaque,unsigned items, unsigned size)
+{
+ void *ptr;
+
+ ptr = KMALLOC(items*size,0);
+ if (ptr) lib_memset(ptr,0,items*size);
+ return ptr;
+}
+
+void zcfree(voidpf opaque,voidpf ptr)
+{
+ KFREE(ptr);
+}
+
+
+static int zlibfs_fileop_init(void **newfsctx,void *curfsvoid)
+{
+ zlibfs_fsctx_t *fsctx;
+ fileio_ctx_t *curfsctx = (fileio_ctx_t *) curfsvoid;
+
+ *newfsctx = NULL;
+
+ fsctx = KMALLOC(sizeof(zlibfs_fsctx_t),0);
+ if (!fsctx) {
+ return CFE_ERR_NOMEM;
+ }
+
+ fsctx->zlibfsctx_refcnt = 0;
+ fsctx->zlibfsctx_subops = curfsctx->ops;
+ fsctx->zlibfsctx_subfsctx = curfsctx->fsctx;
+
+ *newfsctx = fsctx;
+
+ return 0;
+}
+
+
+static int get_byte(zlibfs_file_t *file,uint8_t *ch)
+{
+ int res;
+
+ res = BDREAD(file->zlibfs_fsctx->zlibfsctx_subops,
+ file->zlibfs_subfile,
+ ch,
+ 1);
+
+ return res;
+}
+
+
+static int check_header(zlibfs_file_t *file)
+{
+ int method; /* method byte */
+ int flags; /* flags byte */
+ uInt len;
+ uint8_t c;
+ int res;
+
+ /* Check the gzip magic header */
+ for (len = 0; len < 2; len++) {
+ res = get_byte(file,&c);
+ if (c != gz_magic[len]) {
+ return -1;
+ }
+ }
+
+ get_byte(file,&c); method = (int) c;
+ get_byte(file,&c); flags = (int) c;
+
+ if (method != Z_DEFLATED || (flags & RESERVED) != 0) {
+ return -1;
+ }
+
+ /* Discard time, xflags and OS code: */
+ for (len = 0; len < 6; len++) (void)get_byte(file,&c);
+
+ if ((flags & EXTRA_FIELD) != 0) { /* skip the extra field */
+ get_byte(file,&c);
+ len = (uInt) c;
+ get_byte(file,&c);
+ len += ((uInt)c)<<8;
+ /* len is garbage if EOF but the loop below will quit anyway */
+ while ((len-- != 0) && (get_byte(file,&c) == 1)) ;
+ }
+ if ((flags & ORIG_NAME) != 0) { /* skip the original file name */
+ while ((get_byte(file,&c) == 1) && (c != 0)) ;
+ }
+ if ((flags & COMMENT) != 0) { /* skip the .gz file comment */
+ while ((get_byte(file,&c) == 1) && (c != 0)) ;
+ }
+ if ((flags & HEAD_CRC) != 0) { /* skip the header crc */
+ for (len = 0; len < 2; len++) (void)get_byte(file,&c);
+ }
+
+ return 0;
+}
+
+static int zlibfs_fileop_open(void **ref,void *fsctx_arg,char *filename,int mode)
+{
+ zlibfs_fsctx_t *fsctx;
+ zlibfs_file_t *file;
+ int err;
+
+ if (mode != FILE_MODE_READ) return CFE_ERR_UNSUPPORTED;
+
+ fsctx = (zlibfs_fsctx_t *) fsctx_arg;
+
+ file = KMALLOC(sizeof(zlibfs_file_t),0);
+ if (!file) {
+ return CFE_ERR_NOMEM;
+ }
+
+ file->zlibfs_fileoffset = 0;
+ file->zlibfs_fsctx = fsctx;
+ file->zlibfs_inbuf = NULL;
+ file->zlibfs_outbuf = NULL;
+ file->zlibfs_eofseen = 0;
+
+ err = BDOPEN(fsctx->zlibfsctx_subops,&(file->zlibfs_subfile),
+ fsctx->zlibfsctx_subfsctx,filename);
+
+ if (err != 0) {
+ goto error2;
+ return err;
+ }
+
+ /* Open the zstream */
+
+ file->zlibfs_inbuf = KMALLOC(ZLIBFS_BUFSIZE,0);
+ file->zlibfs_outbuf = KMALLOC(ZLIBFS_BUFSIZE,0);
+
+ if (!file->zlibfs_inbuf || !file->zlibfs_outbuf) {
+ err = CFE_ERR_NOMEM;
+ goto error;
+ }
+
+ file->zlibfs_stream.next_in = NULL;
+ file->zlibfs_stream.avail_in = 0;
+ file->zlibfs_stream.next_out = file->zlibfs_outbuf;
+ file->zlibfs_stream.avail_out = ZLIBFS_BUFSIZE;
+ file->zlibfs_stream.zalloc = (alloc_func)0;
+ file->zlibfs_stream.zfree = (free_func)0;
+
+ file->zlibfs_outlen = 0;
+ file->zlibfs_outptr = file->zlibfs_outbuf;
+
+ err = inflateInit2(&(file->zlibfs_stream),-15);
+ if (err != Z_OK) {
+ err = CFE_ERR;
+ goto error;
+ }
+
+ check_header(file);
+
+ fsctx->zlibfsctx_refcnt++;
+
+ *ref = file;
+ return 0;
+
+error:
+ BDCLOSE(file->zlibfs_fsctx->zlibfsctx_subops,file->zlibfs_subfile);
+error2:
+ if (file->zlibfs_inbuf) KFREE(file->zlibfs_inbuf);
+ if (file->zlibfs_outbuf) KFREE(file->zlibfs_outbuf);
+ KFREE(file);
+ return err;
+}
+
+static int zlibfs_fileop_read(void *ref,uint8_t *buf,int len)
+{
+ zlibfs_file_t *file = (zlibfs_file_t *) ref;
+ int res = 0;
+ int err;
+ int amtcopy;
+ int ttlcopy = 0;
+
+ if (len == 0) return 0;
+
+ while (len) {
+
+ /* Figure the amount to copy. This is the min of what we
+ have left to do and what is available. */
+ amtcopy = len;
+ if (amtcopy > file->zlibfs_outlen) {
+ amtcopy = file->zlibfs_outlen;
+ }
+
+ /* Copy the data. */
+
+ if (buf) {
+ memcpy(buf,file->zlibfs_outptr,amtcopy);
+ buf += amtcopy;
+ }
+
+ /* Update the pointers. */
+ file->zlibfs_outptr += amtcopy;
+ file->zlibfs_outlen -= amtcopy;
+ len -= amtcopy;
+ ttlcopy += amtcopy;
+
+ /* If we've eaten all of the output, reset and call inflate
+ again. */
+
+ if (file->zlibfs_outlen == 0) {
+ /* If no input data to decompress, get some more if we can. */
+ if (file->zlibfs_eofseen) break;
+ if (file->zlibfs_stream.avail_in == 0) {
+ res = BDREAD(file->zlibfs_fsctx->zlibfsctx_subops,
+ file->zlibfs_subfile,
+ file->zlibfs_inbuf,
+ ZLIBFS_BUFSIZE);
+ /* If at EOF or error, get out. */
+ if (res <= 0) break;
+ file->zlibfs_stream.next_in = file->zlibfs_inbuf;
+ file->zlibfs_stream.avail_in = res;
+ }
+
+ /* inflate the input data. */
+ file->zlibfs_stream.next_out = file->zlibfs_outbuf;
+ file->zlibfs_stream.avail_out = ZLIBFS_BUFSIZE;
+ file->zlibfs_outptr = file->zlibfs_outbuf;
+ err = inflate(&(file->zlibfs_stream),Z_SYNC_FLUSH);
+ if (err == Z_STREAM_END) {
+ /* We can get a partial buffer fill here. */
+ file->zlibfs_eofseen = 1;
+ }
+ else if (err != Z_OK) {
+ res = CFE_ERR;
+ break;
+ }
+ file->zlibfs_outlen = file->zlibfs_stream.next_out -
+ file->zlibfs_outptr;
+ }
+
+ }
+
+ file->zlibfs_fileoffset += ttlcopy;
+
+ return (res < 0) ? res : ttlcopy;
+}
+
+static int zlibfs_fileop_write(void *ref,uint8_t *buf,int len)
+{
+ return CFE_ERR_UNSUPPORTED;
+}
+
+static int zlibfs_fileop_seek(void *ref,int offset,int how)
+{
+ zlibfs_file_t *file = (zlibfs_file_t *) ref;
+ int res;
+ int delta;
+
+ switch (how) {
+ case FILE_SEEK_BEGINNING:
+ delta = offset - file->zlibfs_fileoffset;
+ break;
+ case FILE_SEEK_CURRENT:
+ delta = offset;
+ break;
+ default:
+ return CFE_ERR_UNSUPPORTED;
+ break;
+ }
+
+ /* backward seeking not allowed on compressed streams */
+ if (delta < 0) {
+ return CFE_ERR_UNSUPPORTED;
+ }
+
+ res = zlibfs_fileop_read(ref,NULL,delta);
+
+ if (res < 0) return res;
+
+ return file->zlibfs_fileoffset;
+}
+
+
+static void zlibfs_fileop_close(void *ref)
+{
+ zlibfs_file_t *file = (zlibfs_file_t *) ref;
+
+ file->zlibfs_fsctx->zlibfsctx_refcnt--;
+
+ inflateEnd(&(file->zlibfs_stream));
+
+ BDCLOSE(file->zlibfs_fsctx->zlibfsctx_subops,file->zlibfs_subfile);
+
+ KFREE(file);
+}
+
+static void zlibfs_fileop_uninit(void *fsctx_arg)
+{
+ zlibfs_fsctx_t *fsctx = (zlibfs_fsctx_t *) fsctx_arg;
+
+ if (fsctx->zlibfsctx_refcnt) {
+ xprintf("zlibfs_fileop_uninit: warning: refcnt not zero\n");
+ }
+
+ BDUNINIT(fsctx->zlibfsctx_subops,fsctx->zlibfsctx_subfsctx);
+
+ KFREE(fsctx);
+}
+
+
+#endif
diff --git a/cfe/cfe/main/env_subr.c b/cfe/cfe/main/env_subr.c
new file mode 100644
index 0000000..5f12359
--- /dev/null
+++ b/cfe/cfe/main/env_subr.c
@@ -0,0 +1,474 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Environment variable subroutines File: env_subr.c
+ *
+ * This module contains routines to muck with environment variables
+ * (manage the list, read/write to nvram, etc.)
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "env_subr.h"
+#include "nvram_subr.h"
+
+#include "cfe_error.h"
+#include "cfe.h"
+
+/* *********************************************************************
+ * Types
+ ********************************************************************* */
+
+typedef struct cfe_envvar_s {
+ queue_t qb;
+ int flags;
+ char *name;
+ char *value;
+ /* name and value go here */
+} cfe_envvar_t;
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+queue_t env_envvars = {&env_envvars,&env_envvars};
+extern unsigned int cfe_startflags;
+
+/* *********************************************************************
+ * env_findenv(name)
+ *
+ * Locate an environment variable in the in-memory list
+ *
+ * Input parameters:
+ * name - name of env var to find
+ *
+ * Return value:
+ * cfe_envvar_t pointer, or NULL if not found
+ ********************************************************************* */
+
+static cfe_envvar_t *env_findenv(const char *name)
+{
+ queue_t *qb;
+ cfe_envvar_t *env;
+
+ for (qb = env_envvars.q_next; qb != &env_envvars; qb = qb->q_next) {
+ env = (cfe_envvar_t *) qb;
+ if (strcmp(env->name,name) == 0) break;
+ }
+
+ if (qb == &env_envvars) return NULL;
+
+ return (cfe_envvar_t *) qb;
+
+}
+
+/* *********************************************************************
+ * env_enum(idx,name,namelen,val,vallen)
+ *
+ * Enumerate environment variables. This routine locates
+ * the nth environment variable and copies its name and value
+ * to user buffers.
+ *
+ * The namelen and vallen variables must be preinitialized to
+ * the maximum size of the output buffer.
+ *
+ * Input parameters:
+ * idx - variable index to find (starting with zero)
+ * name,namelen - name buffer and length
+ * val,vallen - value buffer and length
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int env_enum(int idx,char *name,int *namelen,char *val,int *vallen)
+{
+ queue_t *qb;
+ cfe_envvar_t *env;
+
+ for (qb = env_envvars.q_next; qb != &env_envvars; qb = qb->q_next) {
+ if (idx == 0) break;
+ idx--;
+ }
+
+ if (qb == &env_envvars) return CFE_ERR_ENVNOTFOUND;
+ env = (cfe_envvar_t *) qb;
+
+ *namelen = xstrncpy(name,env->name,*namelen);
+ *vallen = xstrncpy(val,env->value,*vallen);
+
+ return 0;
+
+}
+
+/* *********************************************************************
+ * env_envtype(name)
+ *
+ * Return the type of the environment variable
+ *
+ * Input parameters:
+ * name - name of environment variable
+ *
+ * Return value:
+ * flags, or <0 if error occured
+ ********************************************************************* */
+int env_envtype(const char *name)
+{
+ cfe_envvar_t *env;
+
+ env = env_findenv(name);
+
+ if (env) {
+ return env->flags;
+ }
+
+ return CFE_ERR_ENVNOTFOUND;
+}
+
+
+
+/* *********************************************************************
+ * env_delenv(name)
+ *
+ * Delete an environment variable
+ *
+ * Input parameters:
+ * name - environment variable to delete
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int env_delenv(const char *name)
+{
+ cfe_envvar_t *env;
+
+ env = env_findenv(name);
+
+ if (!env) return 0;
+
+ if (!(env->flags & ENV_FLG_READONLY)) {
+ q_dequeue((queue_t *) env);
+ KFREE(env);
+ return 0;
+ }
+
+ return CFE_ERR_ENVNOTFOUND;
+}
+
+/* *********************************************************************
+ * env_getenv(name)
+ *
+ * Retrieve the value of an environment variable
+ *
+ * Input parameters:
+ * name - name of environment variable to find
+ *
+ * Return value:
+ * value, or NULL if variable is not found
+ ********************************************************************* */
+
+char *env_getenv(const char *name)
+{
+ cfe_envvar_t *env;
+
+ env = env_findenv(name);
+
+ if (env) {
+ return env->value;
+ }
+
+ return NULL;
+}
+
+
+/* *********************************************************************
+ * env_setenv(name,value,flags)
+ *
+ * Set the value of an environment variable
+ *
+ * Input parameters:
+ * name - name of variable
+ * value - value of variable
+ * flags - flags for variable (ENV_FLG_xxx)
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int env_setenv(const char *name,char *value,int flags)
+{
+ cfe_envvar_t *env;
+ int namelen;
+
+ env = env_findenv(name);
+ if (env) {
+ if (!(flags & ENV_FLG_ADMIN)) {
+ if (env->flags & ENV_FLG_READONLY) return CFE_ERR_ENVREADONLY;
+ }
+ q_dequeue((queue_t *) env);
+ KFREE(env);
+ }
+
+ namelen = strlen(name);
+
+ env = KMALLOC(sizeof(cfe_envvar_t) + namelen + 1 + strlen(value) + 1,0);
+ if (!env) return CFE_ERR_NOMEM;
+
+ env->name = (char *) (env+1);
+ env->value = env->name + namelen + 1;
+ env->flags = (flags & ENV_FLG_MASK);
+
+ strcpy(env->name,name);
+ strcpy(env->value,value);
+
+ q_enqueue(&env_envvars,(queue_t *) env);
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * env_load()
+ *
+ * Load the environment from the NVRAM device.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+
+int env_load(void)
+{
+ int size;
+ unsigned char *buffer;
+ unsigned char *ptr;
+ unsigned char *envval;
+ unsigned int reclen;
+ unsigned int rectype;
+ int offset;
+ int flg;
+ int retval = -1;
+ char valuestr[256];
+
+ /*
+ * If in 'safe mode', don't read the environment the first time.
+ */
+
+ if (cfe_startflags & CFE_INIT_SAFE) {
+ cfe_startflags &= ~CFE_INIT_SAFE;
+ return 0;
+ }
+
+ flg = nvram_open();
+ if (flg < 0) return flg;
+
+ size = nvram_getsize();
+ buffer = KMALLOC(size,0);
+
+ if (buffer == NULL) return CFE_ERR_NOMEM;
+
+ ptr = buffer;
+ offset = 0;
+
+ /* Read the record type and length */
+ if (nvram_read(ptr,offset,1) != 1) {
+ retval = CFE_ERR_IOERR;
+ goto error;
+ }
+
+ while ((*ptr != ENV_TLV_TYPE_END) && (size > 1)) {
+
+ /* Adjust pointer for TLV type */
+ rectype = *(ptr);
+ offset++;
+ size--;
+
+ /*
+ * Read the length. It can be either 1 or 2 bytes
+ * depending on the code
+ */
+ if (rectype & ENV_LENGTH_8BITS) {
+ /* Read the record type and length - 8 bits */
+ if (nvram_read(ptr,offset,1) != 1) {
+ retval = CFE_ERR_IOERR;
+ goto error;
+ }
+ reclen = *(ptr);
+ size--;
+ offset++;
+ }
+ else {
+ /* Read the record type and length - 16 bits, MSB first */
+ if (nvram_read(ptr,offset,2) != 2) {
+ retval = CFE_ERR_IOERR;
+ goto error;
+ }
+ reclen = (((unsigned int) *(ptr)) << 8) + (unsigned int) *(ptr+1);
+ size -= 2;
+ offset += 2;
+ }
+
+ if (reclen > size) break; /* should not happen, bad NVRAM */
+
+ switch (rectype) {
+ case ENV_TLV_TYPE_ENV:
+ /* Read the TLV data */
+ if (nvram_read(ptr,offset,reclen) != reclen) goto error;
+ flg = *ptr++;
+ envval = (unsigned char *) strnchr(ptr,'=',(reclen-1));
+ if (envval) {
+ *envval++ = '\0';
+ memcpy(valuestr,envval,(reclen-1)-(envval-ptr));
+ valuestr[(reclen-1)-(envval-ptr)] = '\0';
+ env_setenv(ptr,valuestr,flg);
+ }
+ break;
+
+ default:
+ /* Unknown TLV type, skip it. */
+ break;
+ }
+
+ /*
+ * Advance to next TLV
+ */
+
+ size -= (int)reclen;
+ offset += reclen;
+
+ /* Read the next record type */
+ ptr = buffer;
+ if (nvram_read(ptr,offset,1) != 1) goto error;
+ }
+
+ retval = 0; /* success! */
+
+error:
+ KFREE(buffer);
+ nvram_close();
+
+ return retval;
+
+}
+
+
+/* *********************************************************************
+ * env_save()
+ *
+ * Write the environment to the NVRAM device.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+int env_save(void)
+{
+ int size;
+ unsigned char *buffer;
+ unsigned char *buffer_end;
+ unsigned char *ptr;
+ queue_t *qb;
+ cfe_envvar_t *env;
+ int namelen;
+ int valuelen;
+ int flg;
+
+ flg = nvram_open();
+ if (flg < 0) return flg;
+
+ nvram_erase();
+
+ size = nvram_getsize();
+ buffer = KMALLOC(size,0);
+
+ if (buffer == NULL) return CFE_ERR_NOMEM;
+
+ buffer_end = buffer + size;
+
+ ptr = buffer;
+
+ for (qb = env_envvars.q_next; qb != &env_envvars; qb = qb->q_next) {
+ env = (cfe_envvar_t *) qb;
+
+ if (env->flags & (ENV_FLG_BUILTIN)) continue;
+
+ namelen = strlen(env->name);
+ valuelen = strlen(env->value);
+
+ if ((ptr + 2 + namelen + valuelen + 1 + 1 + 1) > buffer_end) break;
+
+ *ptr++ = ENV_TLV_TYPE_ENV; /* TLV record type */
+ *ptr++ = (namelen + valuelen + 1 + 1); /* TLV record length */
+
+ *ptr++ = (unsigned char)env->flags;
+ memcpy(ptr,env->name,namelen); /* TLV record data */
+ ptr += namelen;
+ *ptr++ = '=';
+ memcpy(ptr,env->value,valuelen);
+ ptr += valuelen;
+
+ }
+
+ *ptr++ = ENV_TLV_TYPE_END;
+
+ size = nvram_write(buffer,0,ptr-buffer);
+
+ KFREE(buffer);
+
+ nvram_close();
+
+ return (size == (ptr-buffer)) ? 0 : CFE_ERR_IOERR;
+}
diff --git a/cfe/cfe/main/nvram_subr.c b/cfe/cfe/main/nvram_subr.c
new file mode 100644
index 0000000..2c44bca
--- /dev/null
+++ b/cfe/cfe/main/nvram_subr.c
@@ -0,0 +1,300 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * NVRAM subroutines File: nvram_subr.c
+ *
+ * High-level routines to read/write the NVRAM device.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_devfuncs.h"
+#include "cfe_ioctl.h"
+
+#include "cfe_error.h"
+#include "env_subr.h"
+#include "nvram_subr.h"
+#include "cfe.h"
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+static int nvram_handle = -1;
+static nvram_info_t nvram_info;
+static char *nvram_devname = NULL;
+
+/* *********************************************************************
+ * nvram_getinfo(info)
+ *
+ * Obtain information about the NVRAM device from the device
+ * driver. A flash device might only dedicate a single sector
+ * to the environment, so we need to ask the driver first.
+ *
+ * Input parameters:
+ * info - nvram info
+ *
+ * Return value:
+ * 0 if ok
+ * <0 = error code
+ ********************************************************************* */
+
+static int nvram_getinfo(nvram_info_t *info)
+{
+ int retlen;
+
+ if (nvram_handle == -1) return -1;
+
+ cfe_ioctl(nvram_handle,IOCTL_NVRAM_UNLOCK,NULL,0,NULL,0);
+
+ if (cfe_ioctl(nvram_handle,IOCTL_NVRAM_GETINFO,
+ (unsigned char *) info,
+ sizeof(nvram_info_t),
+ &retlen,0) != 0) {
+ return -1;
+ }
+
+ return 0;
+
+}
+
+/* *********************************************************************
+ * nvram_open()
+ *
+ * Open the default NVRAM device and get the information from the
+ * device driver.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int nvram_open(void)
+{
+ if (nvram_handle != -1) {
+ nvram_close();
+ }
+
+ if (nvram_devname == NULL) {
+ return CFE_ERR_DEVNOTFOUND;
+ }
+
+ nvram_handle = cfe_open(nvram_devname);
+
+ if (nvram_handle < 0) {
+ return CFE_ERR_DEVNOTFOUND;
+ }
+
+ if (nvram_getinfo(&nvram_info) < 0) {
+ nvram_close();
+ return CFE_ERR_IOERR;
+ }
+
+ return 0;
+}
+
+/* *********************************************************************
+ * nvram_close()
+ *
+ * Close the NVRAM device
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+int nvram_close(void)
+{
+ if (nvram_handle != -1) {
+ cfe_close(nvram_handle);
+ nvram_handle = -1;
+ }
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * nvram_getsize()
+ *
+ * Return the total size of the NVRAM device. Note that
+ * this is the total size that is used for the NVRAM functions,
+ * not the size of the underlying media.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * size. <0 if error
+ ********************************************************************* */
+
+int nvram_getsize(void)
+{
+ if (nvram_handle < 0) return 0;
+ return nvram_info.nvram_size;
+}
+
+
+/* *********************************************************************
+ * nvram_read(buffer,offset,length)
+ *
+ * Read data from the NVRAM device
+ *
+ * Input parameters:
+ * buffer - destination buffer
+ * offset - offset of data to read
+ * length - number of bytes to read
+ *
+ * Return value:
+ * number of bytes read, or <0 if error occured
+ ********************************************************************* */
+int nvram_read(unsigned char *buffer,int offset,int length)
+{
+ if (nvram_handle == -1) return -1;
+
+ return cfe_readblk(nvram_handle,
+ (cfe_offset_t) (offset+nvram_info.nvram_offset),
+ buffer,
+ length);
+}
+
+/* *********************************************************************
+ * nvram_write(buffer,offset,length)
+ *
+ * Write data to the NVRAM device
+ *
+ * Input parameters:
+ * buffer - source buffer
+ * offset - offset of data to write
+ * length - number of bytes to write
+ *
+ * Return value:
+ * number of bytes written, or -1 if error occured
+ ********************************************************************* */
+int nvram_write(unsigned char *buffer,int offset,int length)
+{
+ if (nvram_handle == -1) return -1;
+
+ return cfe_writeblk(nvram_handle,
+ (cfe_offset_t) (offset+nvram_info.nvram_offset),
+ buffer,
+ length);
+}
+
+
+/* *********************************************************************
+ * nvram_erase()
+ *
+ * Erase the NVRAM device. Not all devices need to be erased,
+ * but flash memory does.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int nvram_erase(void)
+{
+ int retlen;
+
+ if (nvram_handle < 0) {
+ return -1;
+ }
+
+ if (nvram_info.nvram_eraseflg == FALSE) return 0;
+
+ if (cfe_ioctl(nvram_handle,IOCTL_NVRAM_ERASE,
+ (unsigned char *) &nvram_info,
+ sizeof(nvram_info_t),
+ &retlen,0) != 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * cfe_set_envdevice(name)
+ *
+ * Set the environment NVRAM device name
+ *
+ * Input parameters:
+ * name - name of device to use for NVRAM
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int cfe_set_envdevice(char *name)
+{
+ int res;
+
+ nvram_devname = strdup(name);
+
+ res = nvram_open();
+
+ if (res != 0) {
+ xprintf("!! Could not open NVRAM device %s\n",nvram_devname);
+ return res;
+ }
+
+ nvram_close();
+
+ res = env_load();
+
+ return res;
+}
diff --git a/cfe/cfe/main/nvram_subr.h b/cfe/cfe/main/nvram_subr.h
new file mode 100644
index 0000000..f614ec2
--- /dev/null
+++ b/cfe/cfe/main/nvram_subr.h
@@ -0,0 +1,54 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * NVRAM prototypes File: nvram_subr.h
+ *
+ * Prototypes for NVRAM routines.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+int nvram_getsize(void);
+int nvram_read(unsigned char *buffer,int,int);
+int nvram_write(unsigned char *buffer,int,int);
+int nvram_open(void);
+int nvram_close(void);
+int nvram_erase(void);
+
diff --git a/cfe/cfe/net/README b/cfe/cfe/net/README
new file mode 100644
index 0000000..f4c1c8c
--- /dev/null
+++ b/cfe/cfe/net/README
@@ -0,0 +1,17 @@
+
+This directory contains the network modules for CFE. The
+following standards are implemented here:
+
+* Ethernet datalink
+* ARP
+* IP
+* UDP
+* ICMP
+* TFTP
+* BOOTP/DHCP
+* DNS (for queries only)
+* TCP
+
+If anyone really screams for it, I've considered putting a simple
+(very simple) TCP stack in here as well, but it doesn't seem worth it.
+
diff --git a/cfe/cfe/net/dev_tcpconsole.c b/cfe/cfe/net/dev_tcpconsole.c
new file mode 100644
index 0000000..43b4f1c
--- /dev/null
+++ b/cfe/cfe/net/dev_tcpconsole.c
@@ -0,0 +1,341 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * TCP Console Driver File: dev_tcpconsole.c
+ *
+ * Evil hack: A console driver that uses a TCP socket.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_ioctl.h"
+#include "addrspace.h"
+
+#include "cfe_timer.h"
+
+#include "bsp_config.h"
+
+#if CFG_TCP
+#include "net_ebuf.h"
+#include "net_api.h"
+
+/*
+ * Friendly warning: Don't put printfs in here or enable any
+ * debugging messages in the TCP stack if you're really
+ * going to use this for your console device. You'll end up
+ * with a recursion loop!
+ */
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define TCPCONSOLE_DEFAULT_PORT 23 /* telnet */
+
+/* *********************************************************************
+ * Forward
+ ********************************************************************* */
+
+static void tcpconsole_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+static int tcpconsole_open(cfe_devctx_t *ctx);
+static int tcpconsole_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int tcpconsole_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat);
+static int tcpconsole_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int tcpconsole_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int tcpconsole_close(cfe_devctx_t *ctx);
+
+const static cfe_devdisp_t tcpconsole_dispatch = {
+ tcpconsole_open,
+ tcpconsole_read,
+ tcpconsole_inpstat,
+ tcpconsole_write,
+ tcpconsole_ioctl,
+ tcpconsole_close,
+ NULL,
+ NULL
+};
+
+const cfe_driver_t tcpconsole = {
+ "TCP Console",
+ "tcpconsole",
+ CFE_DEV_SERIAL,
+ &tcpconsole_dispatch,
+ tcpconsole_probe
+};
+
+
+/* *********************************************************************
+ * tcpconsole structure
+ ********************************************************************* */
+
+/*
+ * States our connection can be in
+ */
+
+#define TCPCONSTAT_IDLE 0
+#define TCPCONSTAT_LISTEN 1
+#define TCPCONSTAT_CONNECTED 2
+#define TCPCONSTAT_DISCONNECTED 3
+#define TCPCONSTAT_BROKEN 4
+
+/*
+ * state information
+ */
+
+typedef struct tcpconsole_s {
+ int tcp_socket;
+ int tcp_status;
+ int tcp_port;
+} tcpconsole_t;
+
+
+static void tcpconsole_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr)
+{
+ tcpconsole_t *softc;
+ char descr[80];
+
+ softc = (tcpconsole_t *) KMALLOC(sizeof(tcpconsole_t),0);
+ if (softc) {
+ softc->tcp_socket = -1;
+ softc->tcp_status = TCPCONSTAT_IDLE;
+ xsprintf(descr, "%s", drv->drv_description);
+
+ if (probe_a == 0) probe_a = TCPCONSOLE_DEFAULT_PORT;
+
+ softc->tcp_port = (int)probe_a;
+
+ cfe_attach(drv, softc, NULL, descr);
+ }
+}
+
+
+static int tcpconsole_isready(tcpconsole_t *softc,int *rxbytes)
+{
+ int res;
+ int connstat,rxeof;
+
+ res = tcp_status(softc->tcp_socket,&connstat,rxbytes,&rxeof);
+
+ /*
+ * Return:
+ * -1 if we could not get status
+ * 0 if we are not connected or are connected and at EOF
+ * 1 if we are connected.
+ */
+
+ if (res < 0) return res;
+ if (connstat != TCPSTATUS_CONNECTED) return 0;
+ if (!rxeof) return 1;
+
+ return 0;
+}
+
+
+static int tcpconsole_process(tcpconsole_t *softc)
+{
+ int res = 0;
+
+ switch (softc->tcp_status) {
+ case TCPCONSTAT_IDLE:
+ /* Idle, set up listening socket */
+ res = tcp_socket();
+ if (res < 0) {
+ softc->tcp_status = TCPCONSTAT_BROKEN;
+ return res;
+ }
+ softc->tcp_socket = res;
+
+ res = tcp_listen(softc->tcp_socket,softc->tcp_port);
+
+ if (res < 0) {
+ tcp_close(softc->tcp_socket);
+ softc->tcp_status = TCPCONSTAT_BROKEN;
+ softc->tcp_socket = -1;
+ return res;
+ }
+ softc->tcp_status = TCPCONSTAT_LISTEN;
+ break;
+
+ case TCPCONSTAT_LISTEN:
+ /* Still waiting for a connection */
+ res = 0;
+ if (tcpconsole_isready(softc,NULL) > 0) {
+ softc->tcp_status = TCPCONSTAT_CONNECTED;
+ }
+ break;
+
+ case TCPCONSTAT_CONNECTED:
+ res = 0; /* do nothing, we're okay */
+ break;
+
+ case TCPCONSTAT_DISCONNECTED:
+ /* Currently connected, kill off this connection */
+ tcp_close(softc->tcp_socket);
+ softc->tcp_socket = -1;
+ softc->tcp_status = TCPCONSTAT_IDLE;
+ break;
+
+ case TCPCONSTAT_BROKEN:
+ /* Broken. Stay broken. */
+ res = 0;
+ break;
+ }
+
+ return res;
+}
+
+
+static int tcpconsole_open(cfe_devctx_t *ctx)
+{
+ return 0;
+}
+
+static int tcpconsole_read(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ tcpconsole_t *softc = ctx->dev_softc;
+ unsigned char *bptr;
+ int blen;
+ int res;
+
+ POLL();
+ tcpconsole_process(softc);
+
+ buffer->buf_retlen = 0;
+
+ if (softc->tcp_status == TCPCONSTAT_CONNECTED) {
+ bptr = buffer->buf_ptr;
+ blen = buffer->buf_length;
+
+ if (tcpconsole_isready(softc,NULL) <= 0) {
+ softc->tcp_status = TCPCONSTAT_DISCONNECTED;
+ return 0;
+ }
+
+ res = tcp_recv(softc->tcp_socket,bptr,blen);
+
+ if (res > 0) {
+ buffer->buf_retlen = res;
+ }
+ }
+
+ return 0;
+}
+
+static int tcpconsole_inpstat(cfe_devctx_t *ctx, iocb_inpstat_t *inpstat)
+{
+ tcpconsole_t *softc = ctx->dev_softc;
+ unsigned int rxbytes;
+
+ POLL();
+ tcpconsole_process(softc);
+
+ inpstat->inp_status = 0;
+
+ if (softc->tcp_status == TCPCONSTAT_CONNECTED) {
+ if (tcpconsole_isready(softc,&rxbytes) <= 0) {
+ softc->tcp_status = TCPCONSTAT_DISCONNECTED;
+ }
+ else {
+ inpstat->inp_status = (rxbytes > 0);
+ }
+ }
+
+ return 0;
+}
+
+static int tcpconsole_write(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ tcpconsole_t *softc = ctx->dev_softc;
+ unsigned char *bptr;
+ int blen;
+ int res;
+
+ POLL();
+ tcpconsole_process(softc);
+
+ buffer->buf_retlen = 0;
+
+ if (softc->tcp_status == TCPCONSTAT_CONNECTED) {
+ bptr = buffer->buf_ptr;
+ blen = buffer->buf_length;
+
+ if (tcpconsole_isready(softc,NULL) <= 0) {
+ softc->tcp_status = TCPCONSTAT_DISCONNECTED;
+ return 0;
+ }
+
+ res = tcp_send(softc->tcp_socket,bptr,blen);
+
+ if (res > 0) {
+ buffer->buf_retlen = res;
+ }
+ }
+
+ return 0;
+}
+
+static int tcpconsole_ioctl(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ return -1;
+}
+
+static int tcpconsole_close(cfe_devctx_t *ctx)
+{
+ tcpconsole_t *softc = ctx->dev_softc;
+
+ if (softc->tcp_status == TCPCONSTAT_CONNECTED) {
+ softc->tcp_status = TCPCONSTAT_DISCONNECTED;
+ }
+
+ return 0;
+}
+
+
+#endif
diff --git a/cfe/cfe/net/mii.h b/cfe/cfe/net/mii.h
new file mode 100644
index 0000000..ac56958
--- /dev/null
+++ b/cfe/cfe/net/mii.h
@@ -0,0 +1,187 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * MII register definitions File: mii.h
+ *
+ * Register and bit definitions for the standard MII management
+ * interface.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#ifndef _MII_H_
+#define _MII_H_
+
+/* Access/command codes */
+
+#define MII_COMMAND_START 0x01
+#define MII_COMMAND_READ 0x02
+#define MII_COMMAND_WRITE 0x01
+#define MII_COMMAND_ACK 0x02
+
+
+/* Registers */
+
+#define MII_BMCR 0x00 /* Basic Mode Control (rw) */
+#define MII_BMSR 0x01 /* Basic Mode Status (ro) */
+#define MII_PHYIDR1 0x02
+#define MII_PHYIDR2 0x03
+#define MII_ANAR 0x04 /* Autonegotiation Advertisement */
+#define MII_ANLPAR 0x05 /* Autonegotiation Link Partner Ability (rw) */
+#define MII_ANER 0x06 /* Autonegotiation Expansion */
+#define MII_K1CTL 0x09 /* 1000baseT control */
+#define MII_K1STSR 0x0A /* 1K Status Register (ro) */
+#define MII_AUXCTL 0x18 /* aux control register */
+
+
+/* Basic Mode Control register (RW) */
+
+#define BMCR_RESET 0x8000
+#define BMCR_LOOPBACK 0x4000
+#define BMCR_SPEED0 0x2000
+#define BMCR_ANENABLE 0x1000
+#define BMCR_POWERDOWN 0x0800
+#define BMCR_ISOLATE 0x0400
+#define BMCR_RESTARTAN 0x0200
+#define BMCR_DUPLEX 0x0100
+#define BMCR_COLTEST 0x0080
+#define BMCR_SPEED1 0x0040
+#define BMCR_SPEED1000 (BMCR_SPEED1)
+#define BMCR_SPEED100 (BMCR_SPEED0)
+#define BMCR_SPEED10 0
+
+
+/* Basic Mode Status register (RO) */
+
+#define BMSR_100BT4 0x8000
+#define BMSR_100BT_FDX 0x4000
+#define BMSR_100BT_HDX 0x2000
+#define BMSR_10BT_FDX 0x1000
+#define BMSR_10BT_HDX 0x0800
+#define BMSR_100BT2_FDX 0x0400
+#define BMSR_100BT2_HDX 0x0200
+#define BMSR_1000BT_XSR 0x0100
+#define BMSR_PRESUP 0x0040
+#define BMSR_ANCOMPLETE 0x0020
+#define BMSR_REMFAULT 0x0010
+#define BMSR_AUTONEG 0x0008
+#define BMSR_LINKSTAT 0x0004
+#define BMSR_JABDETECT 0x0002
+#define BMSR_EXTCAPAB 0x0001
+
+
+/* PHY Identifer registers (RO) */
+
+#define PHYIDR1 0x2000
+#define PHYIDR2 0x5C60
+
+
+/* Autonegotiation Advertisement register (RW) */
+
+#define ANAR_NP 0x8000
+#define ANAR_RF 0x2000
+#define ANAR_ASYPAUSE 0x0800
+#define ANAR_PAUSE 0x0400
+#define ANAR_T4 0x0200
+#define ANAR_TXFD 0x0100
+#define ANAR_TXHD 0x0080
+#define ANAR_10FD 0x0040
+#define ANAR_10HD 0x0020
+#define ANAR_PSB 0x001F
+
+#define PSB_802_3 0x0001 /* 802.3 */
+
+/* Autonegotiation Link Partner Abilities register (RW) */
+
+#define ANLPAR_NP 0x8000
+#define ANLPAR_ACK 0x4000
+#define ANLPAR_RF 0x2000
+#define ANLPAR_ASYPAUSE 0x0800
+#define ANLPAR_PAUSE 0x0400
+#define ANLPAR_T4 0x0200
+#define ANLPAR_TXFD 0x0100
+#define ANLPAR_TXHD 0x0080
+#define ANLPAR_10FD 0x0040
+#define ANLPAR_10HD 0x0020
+#define ANLPAR_PSB 0x001F
+
+
+/* Autonegotiation Expansion register (RO) */
+
+#define ANER_PDF 0x0010
+#define ANER_LPNPABLE 0x0008
+#define ANER_NPABLE 0x0004
+#define ANER_PAGERX 0x0002
+#define ANER_LPANABLE 0x0001
+
+
+#define ANNPTR_NP 0x8000
+#define ANNPTR_MP 0x2000
+#define ANNPTR_ACK2 0x1000
+#define ANNPTR_TOGTX 0x0800
+#define ANNPTR_CODE 0x0008
+
+#define ANNPRR_NP 0x8000
+#define ANNPRR_MP 0x2000
+#define ANNPRR_ACK3 0x1000
+#define ANNPRR_TOGTX 0x0800
+#define ANNPRR_CODE 0x0008
+
+
+#define K1TCR_TESTMODE 0x0000
+#define K1TCR_MSMCE 0x1000
+#define K1TCR_MSCV 0x0800
+#define K1TCR_RPTR 0x0400
+#define K1TCR_1000BT_FDX 0x200
+#define K1TCR_1000BT_HDX 0x100
+
+#define K1STSR_MSMCFLT 0x8000
+#define K1STSR_MSCFGRES 0x4000
+#define K1STSR_LRSTAT 0x2000
+#define K1STSR_RRSTAT 0x1000
+#define K1STSR_LP1KFD 0x0800
+#define K1STSR_LP1KHD 0x0400
+#define K1STSR_LPASMDIR 0x0200
+
+#define K1SCR_1KX_FDX 0x8000
+#define K1SCR_1KX_HDX 0x4000
+#define K1SCR_1KT_FDX 0x2000
+#define K1SCR_1KT_HDX 0x1000
+
+#endif /* _MII_H_ */
diff --git a/cfe/cfe/net/net_api.c b/cfe/cfe/net/net_api.c
new file mode 100755
index 0000000..c9f119e
--- /dev/null
+++ b/cfe/cfe/net/net_api.c
@@ -0,0 +1,1095 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Top-level API to network File: net_api.c
+ *
+ * This routine contains the highest-level API to the network
+ * routines. The global handle to the network state is right here.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "bsp_config.h"
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_devfuncs.h"
+#include "cfe_ioctl.h"
+#include "cfe_timer.h"
+
+#include "cfe_error.h"
+
+#include "net_ebuf.h"
+#include "net_ether.h"
+
+#include "cfe_timer.h"
+
+#include "net_ip.h"
+#include "net_ip_internal.h"
+#include "net_api.h"
+
+#include "env_subr.h"
+
+#if CFG_TCP
+#include "net_tcp.h"
+#endif
+
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+/*
+ * Net context. All the soft context structures of all the
+ * layers of the network stack are bundled here. There's only one
+ * of these in the system when the network is active.
+ */
+
+typedef struct net_ctx_s {
+ /* Global info */
+ int64_t timer;
+
+ /* device name */
+ char *devname;
+
+ /* Run-time info for IP interface */
+ ip_info_t *ipinfo;
+
+ /* Info for Ethernet interface */
+ ether_info_t *ethinfo;
+
+ /* Info specific to UDP */
+ udp_info_t *udpinfo;
+
+ /* Info specific to ICMP */
+ icmp_info_t *icmpinfo;
+
+#if CFG_TCP
+ /* Info specific to TCP */
+ tcp_info_t *tcpinfo;
+#endif
+} net_ctx_t;
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+/* Foxconn add start by Cliff Wang, 03/23/2010 */
+net_ctx_t *netctx = NULL;
+// static net_ctx_t *netctx = NULL;
+/* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+/* *********************************************************************
+ * UDP INTERFACE
+ ********************************************************************* */
+
+/* *********************************************************************
+ * udp_alloc()
+ *
+ * Allocate an ebuf with fields reserved for the UDP layer.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * pointer to ebuf, or NULL if no EBUFs are available
+ ********************************************************************* */
+
+ebuf_t *udp_alloc(void)
+{
+ if (!netctx) return NULL;
+ return _udp_alloc(netctx->udpinfo);
+}
+
+/* *********************************************************************
+ * udp_free(buf)
+ *
+ * Return an ebuf to the pool. The ebuf was presumably allocated
+ * via udp_alloc() first.
+ *
+ * Input parameters:
+ * buf - ebuf to return to the pool
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+void udp_free(ebuf_t *buf)
+{
+ if (!netctx) return;
+ _udp_free(netctx->udpinfo,buf);
+}
+
+/* *********************************************************************
+ * udp_socket(port)
+ *
+ * Open a UDP socket. Once open, datagrams sent on the socket will
+ * go to the specified port number. You can change the port later
+ * using the "udp_connect" function.
+ *
+ * Input parameters:
+ * port - port number
+ *
+ * Return value:
+ * UDP port handle, or -1 if no ports are available.
+ ********************************************************************* */
+
+int udp_socket(uint16_t port)
+{
+ if (!netctx) return -1;
+
+ return _udp_socket(netctx->udpinfo,port);
+}
+
+/* *********************************************************************
+ * udp_close(sock)
+ *
+ * Close a udp socket. You pass this handle returned from a previous
+ * call to udp_open.
+ *
+ * Input parameters:
+ * handle - UDP port handle, from udp_open()
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void udp_close(int portnum)
+{
+ if (!netctx) return;
+
+ _udp_close(netctx->udpinfo,portnum);
+}
+
+
+/* *********************************************************************
+ * udp_send(s,buf,dest)
+ *
+ * Send a datagram to the specified destination address. The
+ * source and destination UDP port numbers are taken from the
+ * values passed to earlier calls to udp_open, udp_bind, and
+ * udp_connect.
+ *
+ * Input parameters:
+ * s - socket handle, from udp_open
+ * buf - ebuf to send (allocated via udp_alloc)
+ * dest - pointer to 4-byte destination IP address
+ *
+ * Return value:
+ * 0 if ok
+ * <0 if an error occured.
+ ********************************************************************* */
+
+int udp_send(int s,ebuf_t *buf,uint8_t *dest)
+{
+ if (!netctx) return -1;
+
+ return _udp_send(netctx->udpinfo,s,buf,dest);
+}
+
+/* *********************************************************************
+ * udp_bind(s,port)
+ *
+ * Re-"bind" the specified udp socket to a new source port.
+ * This changes the source port number that will be transmitted
+ * in subsequent calls to udp_send()
+ *
+ * Input parameters:
+ * s - socket handle
+ * port - new port number
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+int udp_bind(int s,uint16_t port)
+{
+ if (!netctx) return -1;
+
+ return _udp_bind(netctx->udpinfo,s,port);
+}
+
+
+/* *********************************************************************
+ * udp_connect(s,port)
+ *
+ * Set the port number to be used in the destination port field
+ * for subsequent calls to udp_send().
+ *
+ * Input parameters:
+ * s - udp socket handle
+ * port - new destination port number
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+int udp_connect(int s,uint16_t port)
+{
+ if (!netctx) return -1;
+
+ return _udp_connect(netctx->udpinfo,s,port);
+}
+
+/* *********************************************************************
+ * udp_recv(s)
+ *
+ * Return the next packet from the receive queue for this port.
+ * If no packets are available, NULL is returned.
+ *
+ * Input parameters:
+ * s - udp port handle
+ *
+ * Return value:
+ * ebuf (if a packet is available)
+ * NULL (no packet available)
+ ********************************************************************* */
+
+ebuf_t *udp_recv(int s)
+{
+ if (!netctx) return NULL;
+
+ return _udp_recv(netctx->udpinfo,s);
+}
+
+
+/* *********************************************************************
+ * udp_recv_with_timeout(s,seconds)
+ *
+ * Return the next packet from the receive queue for this socket,
+ * waiting for one to arrive if there are none available.
+ *
+ * Input parameters:
+ * s - udp socket handle
+ * seconds - number of seconds to wait
+ *
+ * Return value:
+ * ebuf (if a packet is available)
+ * NULL (no packet available after timeout)
+ ********************************************************************* */
+
+ebuf_t *udp_recv_with_timeout(int s,int seconds)
+{
+ ebuf_t *buf = NULL;
+ int64_t timer;
+
+ if (!netctx) return NULL;
+
+ TIMER_SET(timer,seconds*CFE_HZ);
+
+ while (!TIMER_EXPIRED(timer)) {
+ POLL();
+ buf = _udp_recv(netctx->udpinfo,s);
+ if (buf) break;
+ }
+
+ return buf;
+}
+
+
+
+#if CFG_TCP
+/* *********************************************************************
+ * TCP INTERFACE
+ ********************************************************************* */
+
+
+/* *********************************************************************
+ * tcp_socket()
+ *
+ * Create a new TCP port.
+ *
+ * Input parameters:
+ * nothing.
+ *
+ * Return value:
+ * TCP port handle, or <0 if no ports are available.
+ ********************************************************************* */
+
+int tcp_socket(void)
+{
+ if (!netctx) return -1;
+
+ return _tcp_socket(netctx->tcpinfo);
+}
+
+/* *********************************************************************
+ * tcp_connect(handle,dest,port)
+ *
+ * Connect to a remote TCP destination.
+ *
+ * Input parameters:
+ * handle - returned from tcp_create
+ * dest - destination IP address
+ * port - destination port number
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int tcp_connect(int s,uint8_t *dest,uint16_t port)
+{
+ int res;
+ unsigned int flags;
+ unsigned int connflag;
+
+ if (!netctx) return -1;
+
+ /*
+ * Get socket's blocking status
+ * If nonblocking, just call the tcp stack
+ * and return what it returns.
+ */
+
+ res = _tcp_getflags(netctx->tcpinfo,s,&flags);
+ if (res < 0) return res;
+
+ if (flags & TCPFLG_NBIO) {
+ return _tcp_connect(netctx->tcpinfo,s,dest,port);
+ }
+
+ /*
+ * Otherwise, call connect and poll till the status
+ * changes. We want to see a transition to the
+ * CONNECTED state, so we loop while we see "CONNECTING"
+ * and return a status based on what it changes to.
+ */
+
+ res = _tcp_connect(netctx->tcpinfo,s,dest,port);
+ if (res < 0) return res;
+ connflag = TCPSTATUS_NOTCONN;
+
+ for (;;) {
+ POLL();
+
+ res = _tcp_status(netctx->tcpinfo,s,&connflag,NULL,NULL);
+ if (res < 0) break;
+
+ if (connflag == TCPSTATUS_CONNECTING) continue;
+ break;
+ }
+
+ if (connflag != TCPSTATUS_CONNECTED) return CFE_ERR_NOTCONN;
+
+ return res;
+}
+
+/* *********************************************************************
+ * tcp_close(s)
+ *
+ * Disconnect a connection (cleanly)
+ *
+ * Input parameters:
+ * s - handle from tcp_create
+ *
+ * Return value:
+ * 0 if ok
+ * else error
+ ********************************************************************* */
+
+int tcp_close(int s)
+{
+ if (!netctx) return -1;
+
+ return _tcp_close(netctx->tcpinfo,s);
+}
+
+
+
+/* *********************************************************************
+ * tcp_send(s,buf,len)
+ *
+ * Send a buffer to the other TCP, buffering as much data as
+ * will fit in the send buffer.
+ *
+ * Input parameters:
+ * s - port handle, from tcp_open
+ * buf - buffer pointer
+ * len - length of buffer to send
+ *
+ * Return value:
+ * >=0 if ok (number of bytes sent)
+ * <0 if an error occured.
+ ********************************************************************* */
+
+int tcp_send(int s,uint8_t *buf,int len)
+{
+ unsigned int flags;
+ int res;
+ int total = 0;
+
+ if (!netctx) return -1;
+
+ /*
+ * Get socket's blocking status
+ * If nonblocking, just call the tcp stack
+ * and return what it returns.
+ */
+
+ res = _tcp_getflags(netctx->tcpinfo,s,&flags);
+ if (res < 0) return res;
+
+ if (flags & TCPFLG_NBIO) {
+ return _tcp_send(netctx->tcpinfo,s,buf,len);
+ }
+
+ /*
+ * The first time we'll check the return code for an
+ * error so we can pass up the failure.
+ */
+
+ res = _tcp_send(netctx->tcpinfo,s,buf,len);
+ if (res < 0) return res;
+
+ buf += res;
+ len -= res;
+ total += res;
+
+ while (len > 0) {
+ /*
+ * Give the TCP stack and devices a chance to run
+ */
+
+ POLL();
+
+ /*
+ * Try to send some more. If we get an error, get out.
+ * otherwise, keep going till all the data is gone.
+ */
+
+ res = _tcp_send(netctx->tcpinfo,s,buf,len);
+ if (res < 0) break;
+ buf += res;
+ len -= res;
+ total += res;
+ }
+
+ /*
+ * If we sent nothing and have an error, return the error.
+ * Otherwise return the amount of data we sent.
+ */
+ if ((total == 0) && (res < 0)) return res;
+ else return total;
+}
+
+/* *********************************************************************
+ * tcp_recv(s,buf,len)
+ *
+ * Receive data from the remote TCP session
+ *
+ * Input parameters:
+ * s - port handle, from tcp_open
+ * buf - buffer pointer
+ * len - length of buffer to send
+ *
+ * Return value:
+ * >=0 if ok (number of bytes received)
+ * <0 if an error occured.
+ ********************************************************************* */
+
+int tcp_recv(int s,uint8_t *buf,int len)
+{
+ unsigned int flags;
+ int res;
+ int total = 0;
+
+ if (!netctx) return -1;
+
+ /*
+ * Get socket's blocking status
+ * If nonblocking, just call the tcp stack
+ * and return what it returns.
+ */
+
+ res = _tcp_getflags(netctx->tcpinfo,s,&flags);
+ if (res < 0) return res;
+
+ if (flags & TCPFLG_NBIO) {
+ return _tcp_recv(netctx->tcpinfo,s,buf,len);
+ }
+
+ /*
+ * The first time we'll check the return code for an
+ * error so we can pass up the failure.
+ */
+
+ res = _tcp_recv(netctx->tcpinfo,s,buf,len);
+ if (res < 0) return res;
+
+ buf += res;
+ len -= res;
+ total += res;
+
+ while (len > 0) {
+ /*
+ * Give the TCP stack and devices a chance to run
+ */
+
+ POLL();
+
+ /*
+ * Try to receive some more. If we get an error, get out.
+ * otherwise, keep going till all the data is gone.
+ */
+
+ res = _tcp_recv(netctx->tcpinfo,s,buf,len);
+ if (res < 0) break;
+
+ if (res == 0) {
+ _tcp_status(netctx->tcpinfo,s,&flags,NULL,NULL);
+ if (flags != TCPSTATUS_CONNECTED) {
+ res = CFE_ERR_NOTCONN;
+ break;
+ }
+ }
+
+ buf += res;
+ len -= res;
+ total += res;
+ }
+
+ /*
+ * If we sent received and have an error, return the error.
+ * Otherwise return the amount of data we sent.
+ */
+ if ((total == 0) && (res < 0)) return res;
+ else return total;
+
+}
+
+/* *********************************************************************
+ * tcp_bind(s,port)
+ *
+ * Re-"bind" the specified tcp port handle to a new source port.
+ *
+ * Used for listening sockets.
+ *
+ * Input parameters:
+ * s - port handle
+ * port - new port number
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+int tcp_bind(int s,uint16_t port)
+{
+ if (!netctx) return -1;
+
+ return _tcp_bind(netctx->tcpinfo,s,port);
+}
+
+/* *********************************************************************
+ * tcp_peeraddr(s,addr,port)
+ *
+ * Return the address of the remote peer.
+ *
+ * Input parameters:
+ * s - port handle
+ * addr - points to 4-byte buffer to receive IP address
+ * port - points to uint16 to receive port number
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+int tcp_peeraddr(int s,uint8_t *addr,uint16_t *port)
+{
+ if (!netctx) return -1;
+
+ return _tcp_peeraddr(netctx->tcpinfo,s,addr,port);
+}
+
+/* *********************************************************************
+ * tcp_setflags(s,addr,flags)
+ *
+ * Set per-socket flags (nodelay, etc.)
+ *
+ * Input parameters:
+ * s - port handle
+ * flags - flags for this socket
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+int tcp_setflags(int s,unsigned int flags)
+{
+ if (!netctx) return -1;
+
+ return _tcp_setflags(netctx->tcpinfo,s,flags);
+}
+
+/* *********************************************************************
+ * tcp_getflags(s,addr,flags)
+ *
+ * Get per-socket flags (nodelay, etc.)
+ *
+ * Input parameters:
+ * s - port handle
+ * flags - flags for this socket
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+int tcp_getflags(int s,unsigned int *flags)
+{
+ if (!netctx) return -1;
+
+ return _tcp_getflags(netctx->tcpinfo,s,flags);
+}
+
+
+/* *********************************************************************
+ * tcp_listen(s)
+ *
+ * Set the socket into "listen" mode.
+ *
+ * Input parameters:
+ * s - port handle
+ * port - port # to listen on
+ *
+ * Return value:
+ * 0 if ok
+ * else error
+ ********************************************************************* */
+
+int tcp_listen(int s,uint16_t port)
+{
+ if (!netctx) return -1;
+
+ return _tcp_listen(netctx->tcpinfo,s,port);
+}
+
+/* *********************************************************************
+ * tcp_status(s,connflag,rxready,rxeof)
+ *
+ * Return the TCP connection's status
+ *
+ * Input parameters:
+ * s - port handle
+ * connflag - points to flag to receive connected status
+ * rxready - returns # of bytes ready to receive
+ * rxeof - returns TRUE if we've been FINed.
+ *
+ * Return value:
+ * 0 if ok
+ * else error
+ ********************************************************************* */
+
+int tcp_status(int s,unsigned int *connflag,int *rxready,int *rxeof)
+{
+ if (!netctx) return -1;
+
+ return _tcp_status(netctx->tcpinfo,s,connflag,rxready,rxeof);
+}
+
+/* *********************************************************************
+ * tcp_debug(s,arg)
+ *
+ * Call the debug routine in the tcp stack.
+ *
+ * Input parameters:
+ * s - socket handle
+ * arg - passed to debug routine
+ *
+ * Return value:
+ * return value from debug routine
+ ********************************************************************* */
+
+int tcp_debug(int s,int arg)
+{
+ if (!netctx) return -1;
+ return _tcp_debug(netctx->tcpinfo,s,arg);
+}
+
+#endif
+
+/* *********************************************************************
+ * ARP FUNCTIONS
+ ********************************************************************* */
+
+
+/* *********************************************************************
+ * arp_add(destip,desthw)
+ *
+ * Add a permanent entry to the ARP table. This entry will
+ * persist until deleted or the interface is deactivated.
+ * This may cause a stale entry to be deleted if the table is full
+ *
+ * Input parameters:
+ * destip - pointer to 4-byte destination IP address
+ * desthw - pointer to 6-byte destination hardware address
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void arp_add(uint8_t *destip,uint8_t *desthw)
+{
+ if (netctx) _arp_add(netctx->ipinfo,destip,desthw);
+}
+
+/* *********************************************************************
+ * arp_lookup(destip)
+ *
+ * Look up the hardware address for an IP address.
+ *
+ * Input parameters:
+ * destip - pointer to 4-byte IP address
+ *
+ * Return value:
+ * pointer to 6-byte hardware address, or NULL if there are
+ * no matching entries in the table.
+ ********************************************************************* */
+
+uint8_t *arp_lookup(uint8_t *destip)
+{
+ if (!netctx) return NULL;
+ return _arp_lookup(netctx->ipinfo,destip);
+}
+
+
+/* *********************************************************************
+ * arp_enumerate(entrynum,ipaddr,hwaddr)
+ *
+ * Return an entry from the ARP table.
+ *
+ * Input parameters:
+ * entrynum - entry number to return, starting with zero
+ * ipaddr - pointer to 4 bytes to receive IP address
+ * hwaddr - pointer to 6 bytes to receive hardware address
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int arp_enumerate(int entrynum,uint8_t *ipaddr,uint8_t *hwaddr)
+{
+ if (!netctx) return -1;
+ return _arp_enumerate(netctx->ipinfo,entrynum,ipaddr,hwaddr);
+}
+
+/* *********************************************************************
+ * arp_delete(ipaddr)
+ *
+ * Delete an entry from the ARP table.
+ *
+ * Input parameters:
+ * ipaddr - pointer to 4-byte IP address
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int arp_delete(uint8_t *ipaddr)
+{
+ if (!netctx) return -1;
+ return _arp_delete(netctx->ipinfo,ipaddr);
+}
+
+/* *********************************************************************
+ * ICMP FUNCTIONS
+ ********************************************************************* */
+
+/* *********************************************************************
+ * icmp_ping(dest,seq,len)
+ *
+ * Ping a remote host, transmitting the ICMP_ECHO message and
+ * waiting for the corresponding ICMP_ECHO_REPLY.
+ *
+ * Input parameters:
+ * dest - pointer to 4-byte destination IP address
+ * seq - sequence number to put in to the ICMP packet
+ * len - length of data to place in ICMP packet
+ *
+ * Return value:
+ * 0 if ok (remote host responded)
+ * else error code
+ ********************************************************************* */
+
+int icmp_ping(uint8_t *dest,int seq,int len)
+{
+ if (!netctx) return -1;
+ return _icmp_ping(netctx->icmpinfo,dest,seq,len);
+}
+
+/* *********************************************************************
+ * INIT/CONFIG FUNCTIONS
+ ********************************************************************* */
+
+/* *********************************************************************
+ * net_getparam(param)
+ *
+ * Return a parameter from the current IP configuration. This is
+ * the main call to set the IP address, netmask, gateway,
+ * name server, host name, etc.
+ *
+ * Input parameters:
+ * param - parameter number (see net_api.h)
+ *
+ * Return value:
+ * pointer to value of parameter, or NULL if parameter
+ * ID is invalid
+ ********************************************************************* */
+
+uint8_t *net_getparam(int param)
+{
+ if (!netctx) return NULL;
+ if (param == NET_DEVNAME) return (uint8_t *) netctx->devname;
+ return _ip_getparam(netctx->ipinfo,param);
+
+}
+
+/* *********************************************************************
+ * net_setparam(param,ptr)
+ *
+ * Set the value of an IP configuration parameter
+ *
+ * Input parameters:
+ * param - parameter number (see net_api.h)
+ * ptr - pointer to parameter's new value
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int net_setparam(int param,uint8_t *ptr)
+{
+ if (!netctx) return NULL;
+ return _ip_setparam(netctx->ipinfo,param,ptr);
+}
+
+/* *********************************************************************
+ * net_poll()
+ *
+ * Process background tasks for the network stack, maintaining
+ * the ARP table, receive queues, etc.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void net_poll(void *arg)
+{
+ if (netctx) {
+ eth_poll(netctx->ethinfo);
+ if (TIMER_EXPIRED(netctx->timer)) {
+ _ip_timer_tick(netctx->ipinfo);
+ TIMER_SET(netctx->timer,CFE_HZ);
+ }
+ }
+}
+
+/* *********************************************************************
+ * net_init(devname)
+ *
+ * Initialize the network interface. This is the main call, once
+ * completed you should call net_setparam to set up the network
+ * addresses and stuff.
+ *
+ * Input parameters:
+ * devname - CFE device name for network device
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int net_init(char *devname)
+{
+ net_ctx_t *ctx;
+
+ if (netctx) net_uninit();
+
+ ctx = KMALLOC(sizeof(net_ctx_t),0);
+
+ if (!ctx) return -1;
+
+ ctx->devname = strdup(devname);
+
+ ctx->ethinfo = eth_init(devname);
+ if (ctx->ethinfo == NULL) {
+ return -1;
+ }
+
+ ctx->ipinfo = _ip_init(ctx->ethinfo);
+ if (ctx->ipinfo == NULL) {
+ eth_uninit(ctx->ethinfo);
+ return -1;
+ }
+
+ ctx->udpinfo = _udp_init(ctx->ipinfo,ctx->ipinfo);
+ if (ctx->udpinfo == NULL) {
+ _ip_uninit(ctx->ipinfo);
+ eth_uninit(ctx->ethinfo);
+ return -1;
+ }
+
+ ctx->icmpinfo = _icmp_init(ctx->ipinfo);
+ if (ctx->icmpinfo == NULL) {
+ _udp_uninit(ctx->udpinfo);
+ _ip_uninit(ctx->ipinfo);
+ eth_uninit(ctx->ethinfo);
+ return -1;
+ }
+
+ cfe_bg_add(net_poll,ctx);
+ TIMER_SET(ctx->timer,CFE_HZ);
+
+#if CFG_TCP
+ ctx->tcpinfo = _tcp_init(ctx->ipinfo,ctx->ipinfo);
+ cfe_bg_add(_tcp_poll,ctx->tcpinfo);
+#endif
+
+ netctx = ctx;
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * net_uninit()
+ *
+ * Uninitialize the network, deallocating all resources allocated
+ * to the network and closing all open device handles
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void net_uninit(void)
+{
+ if (netctx) {
+#if CFG_TCP
+ cfe_bg_remove(_tcp_poll);
+ _tcp_uninit(netctx->tcpinfo);
+#endif
+ TIMER_CLEAR(netctx->timer);
+ _icmp_uninit(netctx->icmpinfo);
+ _udp_uninit(netctx->udpinfo);
+ _ip_uninit(netctx->ipinfo);
+ eth_uninit(netctx->ethinfo);
+ KFREE(netctx->devname);
+ KFREE(netctx);
+ netctx = NULL;
+ cfe_bg_remove(net_poll);
+ }
+}
+
+
+/* *********************************************************************
+ * net_setnetvars()
+ *
+ * Set environment variables related to the network.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void net_setnetvars(void)
+{
+ char *x;
+ uint8_t *addr;
+ char str[60];
+
+ /* Clear out all the environment variables */
+ env_delenv("NET_DEVICE");
+ env_delenv("NET_IPADDR");
+ env_delenv("NET_NETMASK");
+ env_delenv("NET_GATEWAY");
+ env_delenv("NET_NAMESERVER");
+ env_delenv("NET_DOMAIN");
+
+ x = (char *) net_getparam(NET_DEVNAME);
+ if (!x) {
+ return;
+ }
+
+ x = (char *) net_getparam(NET_DEVNAME);
+ if (x) env_setenv("NET_DEVICE",x,ENV_FLG_BUILTIN);
+
+ x = (char *) net_getparam(NET_DOMAIN);
+ if (x) env_setenv("NET_DOMAIN",x,ENV_FLG_BUILTIN);
+
+ addr = net_getparam(NET_IPADDR);
+ if (addr) {
+ xsprintf(str,"%I",addr);
+ env_setenv("NET_IPADDR",str,ENV_FLG_BUILTIN);
+ }
+
+ addr = net_getparam(NET_NETMASK);
+ if (addr) {
+ xsprintf(str,"%I",addr);
+ env_setenv("NET_NETMASK",str,ENV_FLG_BUILTIN);
+ }
+
+ addr = net_getparam(NET_GATEWAY);
+ if (addr) {
+ xsprintf(str,"%I",addr);
+ env_setenv("NET_GATEWAY",str,ENV_FLG_BUILTIN);
+ }
+
+ addr = net_getparam(NET_NAMESERVER);
+ if (addr) {
+ xsprintf(str,"%I",addr);
+ env_setenv("NET_NAMESERVER",str,ENV_FLG_BUILTIN);
+ }
+
+}
+
diff --git a/cfe/cfe/net/net_api.h b/cfe/cfe/net/net_api.h
new file mode 100755
index 0000000..f28b917
--- /dev/null
+++ b/cfe/cfe/net/net_api.h
@@ -0,0 +1,179 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * High-level network API defs File: net_api.h
+ *
+ * This module contains prototypes and constants for the
+ * network (TCP/IP) interface.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#ifndef IP_ADDR_LEN
+#define IP_ADDR_LEN 4
+#endif
+
+/* *********************************************************************
+ * DHCP Protocol
+ ********************************************************************* */
+
+typedef struct dhcpreply_s {
+ uint8_t dr_ipaddr[IP_ADDR_LEN];
+ uint8_t dr_netmask[IP_ADDR_LEN];
+ uint8_t dr_gateway[IP_ADDR_LEN];
+ uint8_t dr_nameserver[IP_ADDR_LEN];
+ uint8_t dr_dhcpserver[IP_ADDR_LEN];
+ uint8_t dr_bootserver[IP_ADDR_LEN];
+ char *dr_hostname;
+ char *dr_domainname;
+ char *dr_bootfile;
+ char *dr_rootpath;
+ char *dr_swapserver;
+ char *dr_script;
+ char *dr_options;
+} dhcpreply_t;
+
+
+int dhcp_bootrequest(dhcpreply_t **reply);
+void dhcp_free_reply(dhcpreply_t *reply);
+void dhcp_set_envvars(dhcpreply_t *reply);
+
+/* *********************************************************************
+ * IP Layer
+ ********************************************************************* */
+
+void ip_uninit(void);
+int ip_init(char *,uint8_t *);
+ebuf_t *ip_alloc(void);
+void ip_free(ebuf_t *buf);
+int ip_send(ebuf_t *buf,uint8_t *destaddr,uint8_t proto);
+uint16_t ip_chksum(uint16_t initchksum,uint8_t *ptr,int len);
+
+/* *********************************************************************
+ * UDP Layer
+ ********************************************************************* */
+
+ebuf_t *udp_alloc(void);
+void udp_free(ebuf_t *buf);
+
+int udp_socket(uint16_t port);
+int udp_bind(int portnum,uint16_t port);
+int udp_connect(int portnum,uint16_t port);
+void udp_close(int portnum);
+int udp_send(int portnum,ebuf_t *buf,uint8_t *dest);
+ebuf_t *udp_recv_with_timeout(int portnum,int seconds);
+ebuf_t *udp_recv(int portnum);
+
+/* *********************************************************************
+ * TCP Layer
+ ********************************************************************* */
+
+#if CFG_TCP
+#ifndef TCPFLG_NODELAY /* XXX should be kept in sync with net_tcp.h */
+#define TCPFLG_NODELAY 1 /* disable nagle */
+#define TCPFLG_NBIO 2 /* non-blocking I/O */
+
+#define TCPSTATUS_NOTCONN 0
+#define TCPSTATUS_CONNECTING 1
+#define TCPSTATUS_CONNECTED 2
+#endif
+int tcp_socket(void);
+void tcp_destroy(int portnum);
+int tcp_connect(int s,uint8_t *dest,uint16_t port);
+int tcp_close(int s);
+int tcp_send(int s,uint8_t *buf,int len);
+int tcp_recv(int s,uint8_t *buf,int len);
+int tcp_bind(int s,uint16_t port);
+int tcp_peeraddr(int s,uint8_t *addr,uint16_t *port);
+int tcp_listen(int s,uint16_t port);
+int tcp_status(int s,unsigned int *connflag,int *rxready,int *rxeof);
+int tcp_debug(int s,int arg);
+int tcp_setflags(int s,unsigned int flags);
+int tcp_getflags(int s,unsigned int *flags);
+#endif
+
+/* *********************************************************************
+ * ARP Layer
+ ********************************************************************* */
+
+uint8_t *arp_lookup(uint8_t *destip);
+void arp_add(uint8_t *destip,uint8_t *desthw);
+int arp_enumerate(int entrynum,uint8_t *ipaddr,uint8_t *hwaddr);
+int arp_delete(uint8_t *ipaddr);
+
+/* *********************************************************************
+ * Network Configuration
+ ********************************************************************* */
+
+#ifndef NET_IPADDR
+#define NET_IPADDR 0
+#define NET_NETMASK 1
+#define NET_GATEWAY 2
+#define NET_NAMESERVER 3
+#define NET_HWADDR 4
+#define NET_DOMAIN 5
+#define NET_HOSTNAME 6
+#define NET_SPEED 7
+#define NET_LOOPBACK 8
+#endif
+#define NET_DEVNAME 10
+
+uint8_t *net_getparam(int param);
+int net_setparam(int param,uint8_t *ptr);
+int net_init(char *devname);
+void net_uninit(void);
+void net_setnetvars(void);
+
+/* *********************************************************************
+ * DNS
+ ********************************************************************* */
+
+int dns_lookup(char *hostname,uint8_t *ipaddr);
+
+/* *********************************************************************
+ * ICMP
+ ********************************************************************* */
+
+int icmp_ping(uint8_t *dest,int seq,int len);
+
diff --git a/cfe/cfe/net/net_arp.c b/cfe/cfe/net/net_arp.c
new file mode 100755
index 0000000..1c12457
--- /dev/null
+++ b/cfe/cfe/net/net_arp.c
@@ -0,0 +1,865 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Address Resolution Protocol File: net_arp.c
+ *
+ * This module implements RFC826, the Address Resolution Protocol.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "net_ebuf.h"
+#include "net_ether.h"
+
+#include "net_ip.h"
+#include "net_ip_internal.h"
+
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+static int arp_tx_query(ip_info_t *ipi,uint8_t *destaddr);
+static void arp_delete(arpentry_t *ae);
+static void arp_tx_waiting(arpentry_t *ae);
+static arpentry_t *arp_new_entry(ip_info_t *ipi);
+static arpentry_t *arp_find_entry(ip_info_t *ipi,uint8_t *ipaddr);
+static int arp_rx_query(ip_info_t *ipi,uint8_t *srcaddr,
+ uint8_t *targethw,uint8_t *targetip);
+static int arp_rx_response(ip_info_t *ipi,uint8_t *senderhw,
+ uint8_t *senderip);
+static int arp_rx_callback(ebuf_t *buf,void *ref);
+
+
+/* *********************************************************************
+ * arp_tx_query(ipi,destaddr)
+ *
+ * Transmit an ARP QUERY message. ARP QUERY messages are sent
+ * to the Ethernet broadcast address.
+ *
+ * Input parameters:
+ * ipi - IP information
+ * destaddr - IP address to query
+ *
+ * Return value:
+ * 0 - success
+ * <0 - failure
+ ********************************************************************* */
+
+static int arp_tx_query(ip_info_t *ipi,uint8_t *destaddr)
+{
+ ebuf_t *buf;
+ uint8_t hwaddr[ENET_ADDR_LEN];
+
+ /*
+ * Get a buffer.
+ */
+
+ buf = eth_alloc(ipi->eth_info,ipi->arp_port);
+ if (!buf) return -1;
+
+ /*
+ * fill in the fields
+ */
+
+ ebuf_append_u16_be(buf,ARP_HWADDRSPACE_ETHERNET);
+ ebuf_append_u16_be(buf,PROTOSPACE_IP);
+ ebuf_append_u8(buf,ENET_ADDR_LEN);
+ ebuf_append_u8(buf,IP_ADDR_LEN);
+ ebuf_append_u16_be(buf,ARP_OPCODE_REQUEST);
+ ebuf_append_bytes(buf,ipi->arp_hwaddr,ENET_ADDR_LEN);
+ ebuf_append_bytes(buf,ipi->net_info.ip_addr,IP_ADDR_LEN);
+ memset(hwaddr,0,ENET_ADDR_LEN);
+ ebuf_append_bytes(buf,hwaddr,ENET_ADDR_LEN);
+ ebuf_append_bytes(buf,destaddr,IP_ADDR_LEN);
+
+ /*
+ * Transmit the packet
+ */
+
+ eth_send(buf,(uint8_t *)eth_broadcast);
+ eth_free(buf);
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * arp_delete(ae)
+ *
+ * Delete an ARP entry. The usual reason for calling this routine
+ * is to reclaim unused ARP entries, but an ARP entry may be
+ * manually deleted as well.
+ *
+ * Input parameters:
+ * ae - arp entry
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void arp_delete(arpentry_t *ae)
+{
+ ebuf_t *buf;
+
+ /*
+ * Free any buffers associated with the ARP entry.
+ */
+
+ while ((buf = (ebuf_t *) q_deqnext(&(ae->ae_txqueue)))) {
+ eth_free(buf);
+ }
+
+ /*
+ * Reset the important fields
+ */
+
+ ae->ae_timer = 0;
+ ae->ae_usage = 0;
+ ae->ae_retries = 0;
+ ae->ae_state = ae_unused;
+}
+
+
+/* *********************************************************************
+ * _arp_add(ipi,destip,desthw)
+ *
+ * Add a new ARP entry to the ARP table [internal routine]. If
+ * there is no room in the table, some other entry is kicked
+ * out.
+ *
+ * Input parameters:
+ * ipi - IP information
+ * destip - target IP address
+ * desthw - target hardware address
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void _arp_add(ip_info_t *ipi,uint8_t *destip,uint8_t *desthw)
+{
+ arpentry_t *ae;
+
+ ae = arp_find_entry(ipi,desthw);
+ if (!ae) {
+ ae = arp_new_entry(ipi);
+ }
+
+ memcpy(ae->ae_ipaddr,destip,IP_ADDR_LEN);
+ memcpy(ae->ae_ethaddr,desthw,ENET_ADDR_LEN);
+
+ ae->ae_retries = 0;
+ ae->ae_timer = 0; /* keep forever */
+ ae->ae_permanent = TRUE;
+ ae->ae_state = ae_established;
+
+ arp_tx_waiting(ae);
+}
+
+
+/* *********************************************************************
+ * _arp_lookup(ipi,destip)
+ *
+ * Look up an ARP entry [internal routine]. Given an IP address,
+ * return the hardware address to send the packets to, or
+ * NULL if no ARP entry exists.
+ *
+ * Input parameters:
+ * ipi - IP information
+ * destip - destination IP address
+ *
+ * Return value:
+ * pointer to Ethernet hardware address, or NULL if not found
+ ********************************************************************* */
+
+uint8_t *_arp_lookup(ip_info_t *ipi,uint8_t *destip)
+{
+ arpentry_t *ae;
+
+ ae = arp_find_entry(ipi,destip);
+ if (ae == NULL) return NULL;
+
+ return ae->ae_ethaddr;
+}
+
+/* *********************************************************************
+ * _arp_lookup_and_send(ipi,buf,dest)
+ *
+ * Transmit a packet [internal routine]. This routine is called
+ * by the IP layer when it wants to send a packet. We look
+ * through the ARP table to find a suitable destination host and
+ * transmit the packet. If there is no ARP entry, an ARP request
+ * is transmitted and the packet is saved on a queue for when
+ * the address is resolved.
+ *
+ * Input parameters:
+ * ipi - IP information
+ * buf - ebuf to transmit
+ * dest - destination IP address
+ *
+ * Return value:
+ * 0 if ok
+ * <0 if error
+ ********************************************************************* */
+
+int _arp_lookup_and_send(ip_info_t *ipi,ebuf_t *buf,uint8_t *dest)
+{
+ arpentry_t *ae;
+
+ ae = arp_find_entry(ipi,dest);
+
+ if (ae == NULL) {
+ /*
+ * No ARP entry yet, create one and send the query
+ */
+ ae = arp_new_entry(ipi);
+ memcpy(ae->ae_ipaddr,dest,IP_ADDR_LEN);
+ q_enqueue(&(ae->ae_txqueue),(queue_t *) buf);
+ ae->ae_retries = ARP_QUERY_RETRIES;
+ ae->ae_timer = ARP_QUERY_TIMER;
+ ae->ae_state = ae_arping;
+ arp_tx_query(ipi,ae->ae_ipaddr);
+ }
+ else {
+ /*
+ * have an ARP entry. If established, just send the
+ * packet now. Otherwise, queue on arp queue if there's room.
+ */
+ if (ae->ae_state == ae_established) {
+ ae->ae_usage++;
+ if (!ae->ae_permanent) {
+ ae->ae_timer = ARP_KEEP_TIMER;
+ }
+ eth_send(buf,ae->ae_ethaddr);
+ eth_free(buf);
+ }
+ else {
+ if (q_count(&(ae->ae_txqueue)) < ARP_TXWAIT_MAX) {
+ q_enqueue(&(ae->ae_txqueue),(queue_t *) buf);
+ }
+ else {
+ /* no room, silently drop */
+ eth_free(buf);
+ }
+ }
+ }
+
+ return 0;
+}
+
+/* *********************************************************************
+ * arp_tx_waiting(ae)
+ *
+ * Transmit all pending packets on the specified ARP entry's
+ * queue. Packets get queued to an ARP entry when the address
+ * has not completed resolution. Once resolved, this routine
+ * is called to flush the packets out.
+ *
+ * Input parameters:
+ * ae - arp entry
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void arp_tx_waiting(arpentry_t *ae)
+{
+ ebuf_t *buf;
+
+ while ((buf = (ebuf_t *) q_deqnext(&(ae->ae_txqueue)))) {
+ eth_send(buf,ae->ae_ethaddr);
+ eth_free(buf);
+ }
+}
+
+
+/* *********************************************************************
+ * arp_new_entry(ipi)
+ *
+ * Create a new ARP entry, deleting an active entry if necessary.
+ *
+ * Input parameters:
+ * ipi - IP information
+ *
+ * Return value:
+ * arp entry pointer
+ ********************************************************************* */
+
+static arpentry_t *arp_new_entry(ip_info_t *ipi)
+{
+ arpentry_t *ae;
+ arpentry_t *victim = NULL;
+ int idx;
+ int minusage = 0x7FFFFFFF;
+
+ /*
+ * First scan the table and find an empty entry.
+ */
+
+ ae = ipi->arp_table;
+ for (idx = 0; idx < ARP_TABLE_SIZE; idx++,ae++) {
+ if (ae->ae_state == ae_unused) {
+ return ae;
+ }
+ }
+
+ /*
+ * If all entries are in use, pick the one with the
+ * lowest usage count. This isn't very scientific,
+ * and perhaps should use a timer of some sort.
+ */
+
+ ae = ipi->arp_table;
+ for (idx = 0; idx < ARP_TABLE_SIZE; idx++,ae++) {
+ if (ae->ae_usage < minusage) {
+ victim = ae;
+ minusage = ae->ae_usage;
+ }
+ }
+
+ /*
+ * In the highly unlikely event that all entries have
+ * overflow values in their usage counters, just take the
+ * first table entry.
+ */
+
+ if (victim == NULL) victim = ipi->arp_table;
+
+ /*
+ * Clear out the old entry and use it.
+ */
+
+ arp_delete(victim);
+
+ return victim;
+}
+
+/* *********************************************************************
+ * arp_find_entry(ipi,ipaddr)
+ *
+ * Find an ARP entry in the table. Given an IP address, this
+ * routine locates the corresponding ARP table entry. We also
+ * reset the expiration timer for the ARP entry, to prevent
+ * it from from being deleted.
+ *
+ * Input parameters:
+ * ipi - IP info
+ * ipaddr - IP address we're looking for
+ *
+ * Return value:
+ * arp entry pointer, or NULL if not found
+ ********************************************************************* */
+
+static arpentry_t *arp_find_entry(ip_info_t *ipi,uint8_t *ipaddr)
+{
+ arpentry_t *ae;
+ int idx;
+
+ ae = ipi->arp_table;
+
+ for (idx = 0; idx < ARP_TABLE_SIZE; idx++,ae++) {
+ if (ae->ae_state != ae_unused) {
+ if (memcmp(ae->ae_ipaddr,ipaddr,IP_ADDR_LEN) == 0) {
+ if (ae->ae_state == ae_established)
+ ae->ae_timer = ARP_KEEP_TIMER;
+ return ae;
+ }
+ }
+ }
+ return NULL;
+}
+
+
+/* *********************************************************************
+ * arp_rx_query(ipi,srcaddr,targethw,targetip)
+ *
+ * Process a received ARP QUERY message. When we get an ARP,
+ * transmit a reply to the sender.
+ *
+ * Input parameters:
+ * ipi - IP information
+ * srcaddr - source IP address
+ * targethw - target hardware address
+ * targetip - target IP address (should be our address)
+ *
+ * Input parameters:
+ * 0 if ok
+ * else <0 = error
+ ********************************************************************* */
+
+static int arp_rx_query(ip_info_t *ipi,uint8_t *srcaddr,
+ uint8_t *targethw,uint8_t *targetip)
+{
+ ebuf_t *txbuf;
+
+ /*
+ * Allocate a packet and form the reply
+ */
+
+ txbuf = eth_alloc(ipi->eth_info,ipi->arp_port);
+ if (!txbuf) return -1;
+
+ ebuf_append_u16_be(txbuf,ARP_HWADDRSPACE_ETHERNET);
+ ebuf_append_u16_be(txbuf,PROTOSPACE_IP);
+ ebuf_append_u8(txbuf,ENET_ADDR_LEN);
+ ebuf_append_u8(txbuf,IP_ADDR_LEN);
+ ebuf_append_u16_be(txbuf,ARP_OPCODE_REPLY);
+
+ ebuf_append_bytes(txbuf,ipi->arp_hwaddr,ENET_ADDR_LEN);
+ ebuf_append_bytes(txbuf,ipi->net_info.ip_addr,IP_ADDR_LEN);
+
+ ebuf_append_bytes(txbuf,targethw,ENET_ADDR_LEN);
+ ebuf_append_bytes(txbuf,targetip,IP_ADDR_LEN);
+
+ eth_send(txbuf,srcaddr);
+ eth_free(txbuf);
+
+ return 0;
+}
+
+/* *********************************************************************
+ * arp_rx_response(ipi,senderhw,senderip)
+ *
+ * Process a received ARP RESPONSE packet. This packet contains
+ * the hardware address of some host we were querying. Fill
+ * in the rest of the entries in the ARP table and
+ * transmit any pending packets.
+ *
+ * Input parameters:
+ * ipi - IP information
+ * senderhw - sender's hardware address
+ * senderip - sender's IP address
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+static int arp_rx_response(ip_info_t *ipi,uint8_t *senderhw,uint8_t *senderip)
+{
+ int idx;
+ arpentry_t *ae;
+
+ ae = ipi->arp_table;
+
+ for (idx = 0; idx < ARP_TABLE_SIZE; idx++,ae++) {
+ if (ae->ae_state != ae_unused) {
+ if (memcmp(ae->ae_ipaddr,senderip,IP_ADDR_LEN) == 0) {
+ memcpy(ae->ae_ethaddr,senderhw,ENET_ADDR_LEN);
+ ae->ae_state = ae_established;
+ ae->ae_timer = ARP_KEEP_TIMER;
+ ae->ae_retries = 0;
+ ae->ae_permanent = FALSE;
+ arp_tx_waiting(ae);
+ }
+ }
+ }
+
+ return 0;
+}
+
+/* *********************************************************************
+ * arp_rx_callback(buf,ref)
+ *
+ * Callback for ARP protocol packets. This routine is called
+ * by the datalink layer when we receive an ARP packet. Parse
+ * the packet and call any packet-specific processing routines
+ *
+ * Input parameters:
+ * buf - ebuf that we received
+ * ref - reference data when we opened the port. This is
+ * our IP information structure
+ *
+ * Return value:
+ * ETH_DROP or ETH_KEEP.
+ ********************************************************************* */
+
+static int arp_rx_callback(ebuf_t *buf,void *ref)
+{
+ ip_info_t *ipi = ref;
+ uint16_t t16;
+ uint8_t t8;
+ uint16_t opcode;
+ uint8_t senderip[IP_ADDR_LEN];
+ uint8_t senderhw[ENET_ADDR_LEN];
+ uint8_t targetip[IP_ADDR_LEN];
+ uint8_t targethw[ENET_ADDR_LEN];
+
+ /*
+ * ARP packets have to be at least 28 bytes
+ */
+
+ if (ebuf_length(buf) < 28) goto drop;
+
+ /*
+ * We only do the Ethernet hardware space
+ */
+
+ ebuf_get_u16_be(buf,t16);
+ if (t16 != ARP_HWADDRSPACE_ETHERNET) goto drop;
+
+ /*
+ * We only do the IP protocol space
+ */
+
+ ebuf_get_u16_be(buf,t16);
+ if (t16 != PROTOSPACE_IP) goto drop;
+
+ /*
+ * The IP and Ethernet address lengths had better be right.
+ */
+
+ ebuf_get_u8(buf,t8);
+ if (t8 != ENET_ADDR_LEN) goto drop;
+
+ ebuf_get_u8(buf,t8);
+ if (t8 != IP_ADDR_LEN) goto drop;
+
+ /*
+ * Get the opcode and other fields.
+ */
+
+ ebuf_get_u16_be(buf,opcode);
+
+ ebuf_get_bytes(buf,senderhw,ENET_ADDR_LEN);
+ ebuf_get_bytes(buf,senderip,IP_ADDR_LEN);
+ ebuf_get_bytes(buf,targethw,ENET_ADDR_LEN);
+ ebuf_get_bytes(buf,targetip,IP_ADDR_LEN);
+
+ /*
+ * If it's not for us, just drop it.
+ */
+
+ if (memcmp(targetip,ipi->net_info.ip_addr,IP_ADDR_LEN) != 0) goto drop;
+
+ /*
+ * Dispatch to an appropriate routine.
+ */
+
+ switch (opcode) {
+ case ARP_OPCODE_REQUEST:
+ arp_rx_query(ipi,ebuf_srcaddr(buf),senderhw,senderip);
+ break;
+ case ARP_OPCODE_REPLY:
+ arp_rx_response(ipi,senderhw,senderip);
+ break;
+ }
+
+drop:
+ return ETH_DROP;
+}
+
+/* *********************************************************************
+ * _arp_timer_tick(ipi)
+ *
+ * ARP timer processing [internal routine]. This routine
+ * counts down timer ticks in the ARP entries, causing retransmits
+ * or ARP entry expirations to happen.
+ *
+ * Input parameters:
+ * ipi - IP information
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void _arp_timer_tick(ip_info_t *ipi)
+{
+ int idx;
+ arpentry_t *ae;
+
+ ae = ipi->arp_table;
+
+ /*
+ * Walk through the ARP table.
+ */
+
+ for (idx = 0; idx < ARP_TABLE_SIZE; idx++,ae++) {
+
+ switch (ae->ae_state) {
+ case ae_unused:
+ /*
+ * Unused entry. Do nothing.
+ */
+ break;
+
+ case ae_arping:
+ /*
+ * Entry is arping. Count down the timer, and retransmit
+ * the ARP message.
+ */
+ ae->ae_timer--;
+ if (ae->ae_timer <= 0) {
+ if (ae->ae_retries == 0) {
+ arp_delete(ae);
+ }
+ else {
+ ae->ae_retries--;
+ ae->ae_timer = ARP_QUERY_TIMER;
+ arp_tx_query(ipi,ae->ae_ipaddr);
+ }
+ }
+ break;
+
+ case ae_established:
+ /*
+ * Established entry. Count down the timer and
+ * delete the ARP entry. If the timer is zero
+ * already, it's a permanent ARP entry.
+ */
+ if (ae->ae_timer == 0) break;
+ ae->ae_timer--;
+ if (ae->ae_timer == 0) arp_delete(ae);
+ break;
+ }
+ }
+
+}
+
+/* *********************************************************************
+ * _arp_send_gratuitous(ipi)
+ *
+ * Transmit the "gratuitous arp" (an ARP for our own IP address).
+ * This is done customarily when an interface is initialized.
+ *
+ * Input parameters:
+ * ipi - IP information
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void _arp_send_gratuitous(ip_info_t *ipi)
+{
+ if (!ip_addriszero(ipi->net_info.ip_addr)) {
+ arp_tx_query(ipi,ipi->net_info.ip_addr);
+ }
+}
+
+/* *********************************************************************
+ * _arp_init(ipi)
+ *
+ * Initialize the ARP layer [internal routine]
+ *
+ * Input parameters:
+ * ipi - IP information
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int _arp_init(ip_info_t *ipi)
+{
+ int8_t arpproto[2];
+ int idx;
+ arpentry_t *ae;
+
+ /*
+ * Allocate space for the ARP table
+ */
+
+ ipi->arp_table = KMALLOC(ARP_TABLE_SIZE*sizeof(arpentry_t),0);
+
+ if (ipi->arp_table == NULL) return NULL;
+
+ /*
+ * Initialize the ARP table.
+ */
+
+ ae = ipi->arp_table;
+ for (idx = 0; idx < ARP_TABLE_SIZE; idx++) {
+ ae->ae_state = ae_unused;
+ ae->ae_timer = 0;
+ ae->ae_usage = 0;
+ ae->ae_retries = 0;
+ ae->ae_permanent = 0;
+ q_init(&(ae->ae_txqueue));
+ ae++;
+ }
+
+ /*
+ * Open the Ethernet portal for ARP packets
+ */
+
+ arpproto[0] = (PROTOSPACE_ARP >> 8) & 0xFF;
+ arpproto[1] = (PROTOSPACE_ARP & 0xFF);
+ ipi->arp_port = eth_open(ipi->eth_info,ETH_PTYPE_DIX,arpproto,arp_rx_callback,ipi);
+
+ if (ipi->arp_port < 0) {
+ KFREE(ipi->arp_table);
+ ipi->arp_table = NULL;
+ return -1;
+ }
+
+ /*
+ * Remember our hardware address
+ */
+
+ eth_gethwaddr(ipi->eth_info,ipi->arp_hwaddr);
+
+ /*
+ * Send a query for ourselves if our IP address is set
+ */
+
+ _arp_send_gratuitous(ipi);
+
+ return 0;
+
+}
+
+
+/* *********************************************************************
+ * _arp_uninit(ipi)
+ *
+ * Uninitialize the ARP interface. This is called when the
+ * network module is shut down.
+ *
+ * Input parameters:
+ * ipi - IP information
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void _arp_uninit(ip_info_t *ipi)
+{
+ int idx;
+ arpentry_t *ae;
+
+ /*
+ * Close the Ethernet portal
+ */
+
+ eth_close(ipi->eth_info,ipi->arp_port);
+
+ /*
+ * Clear out the ARP Table.
+ */
+
+ ae = ipi->arp_table;
+ for (idx = 0; idx < ARP_TABLE_SIZE; idx++) {
+ if (ae->ae_state != ae_unused) arp_delete(ae);
+ ae++;
+ }
+
+ /*
+ * Free up the memory.
+ */
+
+ KFREE(ipi->arp_table);
+ ipi->arp_table = NULL;
+ ipi->arp_port = -1;
+}
+
+
+/* *********************************************************************
+ * _arp_enumerate(ipi,entrynum,ipaddr,hwaddr)
+ *
+ * Enumerate the ARP table. This is used by user-interface
+ * routines to display the current contents of the ARP table.
+ *
+ * Input parameters:
+ * ipi - IP information
+ * entrynum - entry index
+ * ipaddr - buffer to copy entry's IP address to
+ * hwaddr - buffer to copy entry's hardware address to
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int _arp_enumerate(ip_info_t *ipi,int entrynum,uint8_t *ipaddr,uint8_t *hwaddr)
+{
+ arpentry_t *ae;
+ int idx;
+
+ ae = ipi->arp_table;
+ for (idx = 0; idx < ARP_TABLE_SIZE; idx++) {
+ if (ae->ae_state != ae_unused) {
+ if (entrynum == 0) {
+ memcpy(ipaddr,ae->ae_ipaddr,IP_ADDR_LEN);
+ memcpy(hwaddr,ae->ae_ethaddr,ENET_ADDR_LEN);
+ return 0;
+ }
+ entrynum--;
+ }
+ ae++;
+ }
+
+ return -1;
+}
+
+
+/* *********************************************************************
+ * _arp_delete(ipi,ipaddr)
+ *
+ * Delete an ARP entry. This routine takes an IP address, looks
+ * up its ARP table entry, and removes it from the table.
+ *
+ * Input parameters:
+ * ipi - IP information
+ * ipaddr - IP address whose entry to delete
+ *
+ * Return value:
+ * 0 if entry was deleted
+ * <0 if entry was not found
+ ********************************************************************* */
+
+int _arp_delete(ip_info_t *ipi,uint8_t *ipaddr)
+{
+ arpentry_t *ae;
+
+ ae = arp_find_entry(ipi,ipaddr);
+
+ if (ae) {
+ arp_delete(ae);
+ return 0;
+ }
+ return -1;
+}
diff --git a/cfe/cfe/net/net_dhcp.c b/cfe/cfe/net/net_dhcp.c
new file mode 100644
index 0000000..84a39e6
--- /dev/null
+++ b/cfe/cfe/net/net_dhcp.c
@@ -0,0 +1,869 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * DHCP Client File: net_dhcp.c
+ *
+ * This module contains a DHCP client.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "env_subr.h"
+
+#include "cfe_iocb.h"
+#include "cfe_devfuncs.h"
+#include "cfe_ioctl.h"
+#include "cfe_timer.h"
+#include "cfe_error.h"
+
+#include "net_ebuf.h"
+#include "net_ether.h"
+
+#include "cfe.h"
+
+#include "net_api.h"
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+
+#define UDP_PORT_BOOTPS 67
+#define UDP_PORT_BOOTPC 68
+
+#define DHCP_REQ_TIMEOUT (1*CFE_HZ)
+#define DHCP_NUM_RETRIES 8
+
+#define DHCP_OP_BOOTREQUEST 1
+#define DHCP_OP_BOOTREPLY 2
+
+#define DHCP_HWTYPE_ETHERNET 1
+
+#define DHCP_TAG_FUNCTION 53
+#define DHCP_FUNCTION_DISCOVER 1
+#define DHCP_FUNCTION_OFFER 2
+#define DHCP_FUNCTION_REQUEST 3
+#define DHCP_FUNCTION_ACK 5
+
+#define DHCP_TAG_NETMASK 1
+#define DHCP_TAG_DOMAINNAME 0x0F
+#define DHCP_TAG_GATEWAY 0x03
+#define DHCP_TAG_NAMESERVER 0x06
+#define DHCP_TAG_SWAPSERVER 0x10
+#define DHCP_TAG_ROOTPATH 0x11
+#define DHCP_TAG_EXTENSIONS 0x12
+#define DHCP_TAG_SERVERIDENT 54
+#define DHCP_TAG_PARAMLIST 55
+#define DHCP_TAG_CLIENTID 61
+#define DHCP_TAG_CLASSID 60
+#define DHCP_TAG_REQADDR 50
+#define DHCP_TAG_LEASE_TIME 51
+#define DHCP_TAG_SCRIPT 130 /* CFE extended option */
+#define DHCP_TAG_OPTIONS 131 /* CFE extended option */
+
+#define DHCP_TAG_END 0xFF
+
+#define DHCP_MAGIC_NUMBER 0x63825363
+
+/*#define _DEBUG_*/
+
+
+/* *********************************************************************
+ * dhcp_set_envvars(reply)
+ *
+ * Using the supplied DHCP reply data, set environment variables
+ * to contain data from the reply.
+ *
+ * Input parameters:
+ * reply - dhcp reply
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void dhcp_set_envvars(dhcpreply_t *reply)
+{
+ char buffer[50];
+
+ env_delenv("BOOT_SERVER");
+ env_delenv("BOOT_FILE");
+ env_delenv("BOOT_SCRIPT");
+ env_delenv("BOOT_OPTIONS");
+
+ if (reply->dr_bootserver[0] | reply->dr_bootserver[1] |
+ reply->dr_bootserver[2] | reply->dr_bootserver[3]) {
+ sprintf(buffer,"%I",reply->dr_bootserver);
+ env_setenv("BOOT_SERVER",buffer,ENV_FLG_BUILTIN);
+ }
+
+ if (reply->dr_bootfile && reply->dr_bootfile[0]) {
+ env_setenv("BOOT_FILE",reply->dr_bootfile,ENV_FLG_BUILTIN);
+ }
+
+ if (reply->dr_script && reply->dr_script[0]) {
+ env_setenv("BOOT_SCRIPT",reply->dr_script,ENV_FLG_BUILTIN);
+ }
+
+ if (reply->dr_options && reply->dr_options[0]) {
+ env_setenv("BOOT_OPTIONS",reply->dr_options,ENV_FLG_BUILTIN);
+ }
+}
+
+/* *********************************************************************
+ * dhcp_dumptag(tag,len,buf)
+ *
+ * Dump out information from a DHCP tag
+ *
+ * Input parameters:
+ * tag - tag ID
+ * len - length of data
+ * buf - data
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+#ifdef _DEBUG_
+static void dhcp_dumptag(uint8_t tag,uint8_t len,uint8_t *buf)
+{
+ unsigned int idx;
+
+ xprintf("DHCP: ");
+
+ switch (tag) {
+ case DHCP_TAG_FUNCTION:
+ xprintf("DHCP Function: %d\n",buf[0]);
+ break;
+ case DHCP_TAG_LEASE_TIME:
+ idx = (((unsigned int) buf[0]) << 24) |
+ (((unsigned int) buf[1]) << 16) |
+ (((unsigned int) buf[2]) << 8) |
+ (((unsigned int) buf[3]) << 0);
+ xprintf("Lease Time: %d seconds\n",idx);
+ break;
+ case DHCP_TAG_SERVERIDENT:
+ xprintf("DHCP Server ID: %d.%d.%d.%d\n",
+ buf[0],buf[1],buf[2],buf[3]);
+ break;
+ case DHCP_TAG_NETMASK:
+ xprintf("Netmask: %d.%d.%d.%d\n",buf[0],buf[1],buf[2],buf[3]);
+ break;
+ case DHCP_TAG_DOMAINNAME:
+ buf[len] = 0;
+ xprintf("Domain: %s\n",buf);
+ break;
+ case DHCP_TAG_GATEWAY:
+ xprintf("Gateway: %d.%d.%d.%d\n",buf[0],buf[1],buf[2],buf[3]);
+ break;
+ case DHCP_TAG_NAMESERVER:
+ xprintf("Nameserver: %d.%d.%d.%d\n",buf[0],buf[1],buf[2],buf[3]);
+ break;
+ case DHCP_TAG_SWAPSERVER:
+ buf[len] = 0;
+ xprintf("Swapserver: %s\n",buf);
+ break;
+ case DHCP_TAG_ROOTPATH:
+ buf[len] = 0;
+ xprintf("Rootpath: %s\n",buf);
+ break;
+ case DHCP_TAG_SCRIPT:
+ buf[len] = 0;
+ xprintf("CFE Script: %s\n",buf);
+ break;
+ case DHCP_TAG_OPTIONS:
+ buf[len] = 0;
+ xprintf("CFE Boot Options: %s\n",buf);
+ break;
+ default:
+ xprintf("Tag %d len %d [",tag,len);
+ for (idx = 0; idx < len; idx++) {
+ if ((buf[idx] >= 32) && (buf[idx] < 127)) xprintf("%c",buf[idx]);
+ }
+ xprintf("]\n");
+ break;
+
+ }
+}
+#endif
+
+/* *********************************************************************
+ * dhcp_free_reply(reply)
+ *
+ * Free memory associated with a DHCP reply.
+ *
+ * Input parameters:
+ * reply - pointer to DHCP reply
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void dhcp_free_reply(dhcpreply_t *reply)
+{
+ if (reply->dr_hostname) KFREE(reply->dr_hostname);
+ if (reply->dr_domainname) KFREE(reply->dr_domainname);
+ if (reply->dr_bootfile) KFREE(reply->dr_bootfile);
+ if (reply->dr_rootpath) KFREE(reply->dr_rootpath);
+ if (reply->dr_swapserver) KFREE(reply->dr_swapserver);
+ if (reply->dr_script) KFREE(reply->dr_script);
+ if (reply->dr_options) KFREE(reply->dr_options);
+ KFREE(reply);
+}
+
+/* *********************************************************************
+ * dhcp_build_discover()
+ *
+ * Build a DHCP DISCOVER packet
+ *
+ * Input parameters:
+ * hwaddr - our hardware address
+ * idptr - pointer to int to receive the DHCP packet ID
+ * serveraddr - pointer to server address (REQUEST) or
+ * NULL (DISCOVER)
+ * ebufptr - receives pointer to ebuf
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+static int dhcp_build_discover(uint8_t *hwaddr,
+ uint32_t id,
+ ebuf_t **ebufptr)
+{
+ uint8_t ipaddr[IP_ADDR_LEN];
+ ebuf_t *buf;
+ uint8_t junk[128];
+
+ /*
+ * Get a buffer and fill it in.
+ */
+
+ ipaddr[0] = 0; ipaddr[1] = 0; ipaddr[2] = 0; ipaddr[3] = 0;
+ memset(junk,0,sizeof(junk));
+
+ buf = udp_alloc();
+
+ if (buf == NULL) {
+ return CFE_ERR_NOMEM;
+ }
+
+ memset(buf->eb_ptr,0,548);
+
+ ebuf_append_u8(buf,DHCP_OP_BOOTREQUEST);
+ ebuf_append_u8(buf,DHCP_HWTYPE_ETHERNET);
+ ebuf_append_u8(buf,ENET_ADDR_LEN);
+ ebuf_append_u8(buf,0); /* hops */
+ ebuf_append_u32_be(buf,id);
+ ebuf_append_u16_be(buf,0); /* sec since boot */
+ ebuf_append_u16_be(buf,0); /* flags */
+
+ ebuf_append_bytes(buf,ipaddr,IP_ADDR_LEN); /* ciaddr */
+ ebuf_append_bytes(buf,ipaddr,IP_ADDR_LEN); /* yiaddr */
+ ebuf_append_bytes(buf,ipaddr,IP_ADDR_LEN); /* siaddr */
+ ebuf_append_bytes(buf,ipaddr,IP_ADDR_LEN); /* giaddr */
+
+ ebuf_append_bytes(buf,hwaddr,ENET_ADDR_LEN); /* chaddr */
+ ebuf_append_bytes(buf,junk,10); /* rest of chaddr */
+ ebuf_append_bytes(buf,junk,64); /* sname */
+ ebuf_append_bytes(buf,junk,128); /* file */
+
+ ebuf_append_u32_be(buf,DHCP_MAGIC_NUMBER);
+
+ ebuf_append_u8(buf,DHCP_TAG_FUNCTION); /* function code */
+ ebuf_append_u8(buf,1);
+ ebuf_append_u8(buf,DHCP_FUNCTION_DISCOVER);
+
+ ebuf_append_u8(buf,DHCP_TAG_PARAMLIST);
+ ebuf_append_u8(buf,8); /* count of tags that follow */
+ ebuf_append_u8(buf,DHCP_TAG_NETMASK);
+ ebuf_append_u8(buf,DHCP_TAG_DOMAINNAME);
+ ebuf_append_u8(buf,DHCP_TAG_GATEWAY);
+ ebuf_append_u8(buf,DHCP_TAG_NAMESERVER);
+ ebuf_append_u8(buf,DHCP_TAG_SWAPSERVER);
+ ebuf_append_u8(buf,DHCP_TAG_ROOTPATH);
+ ebuf_append_u8(buf,DHCP_TAG_SCRIPT);
+ ebuf_append_u8(buf,DHCP_TAG_OPTIONS);
+
+
+ ebuf_append_u8(buf,DHCP_TAG_END); /* terminator */
+
+ /*
+ * Return the packet
+ */
+
+ *ebufptr = buf;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * dhcp_build_request()
+ *
+ * Build a DHCP DISCOVER or REQUEST packet
+ *
+ * Input parameters:
+ * hwaddr - our hardware address
+ * idptr - pointer to int to receive the DHCP packet ID
+ * serveraddr - pointer to server address (REQUEST) or
+ * NULL (DISCOVER)
+ * ebufptr - receives pointer to ebuf
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+static int dhcp_build_request(uint8_t *hwaddr,
+ uint32_t id,
+ uint8_t *serveraddr,
+ uint8_t *reqip,
+ ebuf_t **ebufptr)
+{
+ uint8_t ipaddr[IP_ADDR_LEN];
+ ebuf_t *buf;
+ uint8_t junk[128];
+
+ /*
+ * Get a buffer and fill it in.
+ */
+
+ ipaddr[0] = 0; ipaddr[1] = 0; ipaddr[2] = 0; ipaddr[3] = 0;
+ memset(junk,0,sizeof(junk));
+
+ buf = udp_alloc();
+
+ if (buf == NULL) {
+ return CFE_ERR_NOMEM;
+ }
+
+ memset(buf->eb_ptr,0,548);
+
+ ebuf_append_u8(buf,DHCP_OP_BOOTREQUEST);
+ ebuf_append_u8(buf,DHCP_HWTYPE_ETHERNET);
+ ebuf_append_u8(buf,ENET_ADDR_LEN);
+ ebuf_append_u8(buf,0); /* hops */
+ ebuf_append_u32_be(buf,id);
+ ebuf_append_u16_be(buf,0); /* sec since boot */
+ ebuf_append_u16_be(buf,0); /* flags */
+
+ ebuf_append_bytes(buf,ipaddr,IP_ADDR_LEN); /* ciaddr */
+ ebuf_append_bytes(buf,ipaddr,IP_ADDR_LEN); /* yiaddr */
+ ebuf_append_bytes(buf,ipaddr,IP_ADDR_LEN); /* siaddr */
+ ebuf_append_bytes(buf,ipaddr,IP_ADDR_LEN); /* giaddr */
+
+ ebuf_append_bytes(buf,hwaddr,ENET_ADDR_LEN); /* chaddr */
+ ebuf_append_bytes(buf,junk,10); /* rest of chaddr */
+
+ ebuf_append_bytes(buf,junk,64); /* sname */
+
+ ebuf_append_bytes(buf,junk,128); /* file */
+
+ ebuf_append_u32_be(buf,DHCP_MAGIC_NUMBER);
+
+ ebuf_append_u8(buf,DHCP_TAG_FUNCTION); /* function code */
+ ebuf_append_u8(buf,1);
+
+ ebuf_append_u8(buf,DHCP_FUNCTION_REQUEST);
+
+ ebuf_append_u8(buf,DHCP_TAG_REQADDR);
+ ebuf_append_u8(buf,IP_ADDR_LEN);
+ ebuf_append_bytes(buf,reqip,IP_ADDR_LEN);
+
+ ebuf_append_u8(buf,DHCP_TAG_SERVERIDENT); /* server ID */
+ ebuf_append_u8(buf,IP_ADDR_LEN);
+ ebuf_append_bytes(buf,serveraddr,IP_ADDR_LEN);
+
+ ebuf_append_u8(buf,DHCP_TAG_CLIENTID); /* client ID */
+ ebuf_append_u8(buf,7);
+ ebuf_append_u8(buf,1);
+ ebuf_append_bytes(buf,hwaddr,ENET_ADDR_LEN);
+
+ ebuf_append_u8(buf,DHCP_TAG_PARAMLIST);
+ ebuf_append_u8(buf,8); /* count of tags that follow */
+ ebuf_append_u8(buf,DHCP_TAG_NETMASK);
+ ebuf_append_u8(buf,DHCP_TAG_DOMAINNAME);
+ ebuf_append_u8(buf,DHCP_TAG_GATEWAY);
+ ebuf_append_u8(buf,DHCP_TAG_NAMESERVER);
+ ebuf_append_u8(buf,DHCP_TAG_SWAPSERVER);
+ ebuf_append_u8(buf,DHCP_TAG_ROOTPATH);
+ ebuf_append_u8(buf,DHCP_TAG_SCRIPT);
+ ebuf_append_u8(buf,DHCP_TAG_OPTIONS);
+
+
+ ebuf_append_u8(buf,DHCP_TAG_END); /* terminator */
+
+ /*
+ * Return the packet
+ */
+
+ *ebufptr = buf;
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * dhcp_wait_reply(s,id,reply,serveraddr)
+ *
+ * Wait for a reply from the DHCP server
+ *
+ * Input parameters:
+ * s - socket
+ * id - ID of request we sent
+ * reply - structure to store results in
+ * expfcode - expected DHCP_FUNCTION tag value
+ *
+ * Return value:
+ * 0 if ok (reply found)
+ * else error
+ ********************************************************************* */
+
+static int dhcp_wait_reply(int s,uint32_t id,dhcpreply_t *reply,int expfcode)
+{
+ uint32_t tmpd;
+ uint8_t tmpb;
+ int64_t timer;
+ int nres = 0;
+ uint8_t ciaddr[IP_ADDR_LEN];
+ uint8_t yiaddr[IP_ADDR_LEN];
+ uint8_t siaddr[IP_ADDR_LEN];
+ uint8_t giaddr[IP_ADDR_LEN];
+ uint8_t junk[128];
+ char *hostname;
+ char *bootfile;
+ ebuf_t *buf;
+ int fcode = -1;
+
+ /*
+ * Set a timer for the response
+ */
+
+ TIMER_SET(timer,DHCP_REQ_TIMEOUT);
+
+ /*
+ * Start waiting...
+ */
+
+ while (!TIMER_EXPIRED(timer)) {
+ POLL();
+
+ buf = udp_recv(s);
+ if (!buf) continue;
+
+ ebuf_get_u8(buf,tmpb);
+ if (tmpb != DHCP_OP_BOOTREPLY) {
+ goto drop;
+ }
+
+ ebuf_get_u8(buf,tmpb);
+ if (tmpb != DHCP_HWTYPE_ETHERNET) {
+ goto drop;
+ }
+
+ ebuf_get_u8(buf,tmpb);
+ if (tmpb != ENET_ADDR_LEN) {
+ goto drop;
+ }
+
+ ebuf_skip(buf,1); /* hops */
+
+ ebuf_get_u32_be(buf,tmpd); /* check ID */
+ if (tmpd != id) {
+ goto drop;
+ }
+
+ ebuf_skip(buf,2); /* seconds since boot */
+ ebuf_skip(buf,2); /* flags */
+
+ ebuf_get_bytes(buf,ciaddr,IP_ADDR_LEN);
+ ebuf_get_bytes(buf,yiaddr,IP_ADDR_LEN);
+ ebuf_get_bytes(buf,siaddr,IP_ADDR_LEN);
+ ebuf_get_bytes(buf,giaddr,IP_ADDR_LEN);
+
+ ebuf_skip(buf,16); /* hardware address */
+ hostname = ebuf_ptr(buf);
+ ebuf_skip(buf,64);
+ bootfile = ebuf_ptr(buf);
+
+ ebuf_skip(buf,128);
+
+#ifdef _DEBUG_
+ xprintf("Client IP: %d.%d.%d.%d\n",ciaddr[0],ciaddr[1],ciaddr[2],ciaddr[3]);
+ xprintf("Your IP: %d.%d.%d.%d\n",yiaddr[0],yiaddr[1],yiaddr[2],yiaddr[3]);
+ xprintf("Server IP: %d.%d.%d.%d\n",siaddr[0],siaddr[1],siaddr[2],siaddr[3]);
+ xprintf("Gateway IP: %d.%d.%d.%d\n",giaddr[0],giaddr[1],giaddr[2],giaddr[3]);
+ xprintf("hostname: %s\n",hostname);
+ xprintf("boot file: %s\n",bootfile);
+#endif
+
+ memcpy(reply->dr_ipaddr,yiaddr,IP_ADDR_LEN);
+ memcpy(reply->dr_gateway,giaddr,IP_ADDR_LEN);
+ memcpy(reply->dr_bootserver,siaddr,IP_ADDR_LEN);
+ if (*hostname) reply->dr_hostname = strdup(hostname);
+ if (*bootfile) reply->dr_bootfile = strdup(bootfile);
+
+ /*
+ * Test for options - look for magic number
+ */
+
+ ebuf_get_u32_be(buf,tmpd);
+
+ memcpy(reply->dr_dhcpserver,buf->eb_usrptr,IP_ADDR_LEN);
+
+ if (tmpd == DHCP_MAGIC_NUMBER) {
+ uint8_t tag;
+ uint8_t len;
+
+ while (buf->eb_length > 0) {
+ ebuf_get_u8(buf,tag);
+ if (tag == DHCP_TAG_END) break;
+ ebuf_get_u8(buf,len);
+ ebuf_get_bytes(buf,junk,len);
+
+#ifdef _DEBUG_
+ dhcp_dumptag(tag,len,junk);
+#endif
+
+ switch (tag) {
+ case DHCP_TAG_FUNCTION:
+ fcode = (uint8_t) junk[0];
+ break;
+ case DHCP_TAG_NETMASK:
+ memcpy(reply->dr_netmask,junk,IP_ADDR_LEN);
+ break;
+ case DHCP_TAG_GATEWAY:
+ memcpy(reply->dr_gateway,junk,IP_ADDR_LEN);
+ break;
+ case DHCP_TAG_NAMESERVER:
+ memcpy(reply->dr_nameserver,junk,IP_ADDR_LEN);
+ break;
+ case DHCP_TAG_DOMAINNAME:
+ junk[len] = 0;
+ if (len) reply->dr_domainname = strdup(junk);
+ break;
+ case DHCP_TAG_SWAPSERVER:
+ junk[len] = 0;
+ if (len) reply->dr_swapserver = strdup(junk);
+ break;
+ case DHCP_TAG_SERVERIDENT:
+ if (len == IP_ADDR_LEN) {
+ memcpy(reply->dr_dhcpserver,junk,len);
+ }
+ break;
+ case DHCP_TAG_ROOTPATH:
+ junk[len] = 0;
+ if (len) reply->dr_rootpath = strdup(junk);
+ break;
+ case DHCP_TAG_SCRIPT:
+ junk[len] = 0;
+ if (len) reply->dr_script = strdup(junk);
+ break;
+ case DHCP_TAG_OPTIONS:
+ junk[len] = 0;
+ if (len) reply->dr_options = strdup(junk);
+ break;
+ }
+ }
+ }
+
+ if (fcode != expfcode) {
+ goto drop;
+ }
+
+ udp_free(buf);
+ nres++;
+ break;
+
+ drop:
+ udp_free(buf);
+ }
+
+ if (nres > 0) return 0;
+ else return CFE_ERR_TIMEOUT;
+}
+
+
+/* *********************************************************************
+ * dhcp_do_dhcpdiscover(s,hwaddr,reply)
+ *
+ * Request an IP address from the DHCP server. On success, the
+ * dhcpreply_t structure will be filled in
+ *
+ * Input parameters:
+ * s - udp socket
+ * hwaddr - our hardware address
+ * reply - pointer to reply buffer.
+ *
+ * Return value:
+ * 0 if a response was received
+ * else error code
+ ********************************************************************* */
+
+static int dhcp_do_dhcpdiscover(int s,uint8_t *hwaddr,dhcpreply_t *reply)
+{
+ ebuf_t *buf;
+ uint32_t id;
+ uint8_t ipaddr[IP_ADDR_LEN];
+ int res;
+
+ /*
+ * Packet ID is the current time
+ */
+
+ id = (uint32_t)cfe_ticks;
+
+ /*
+ * Build the DISCOVER request
+ */
+
+ res = dhcp_build_discover(hwaddr,id,&buf);
+ if (res != 0) return res;
+
+ /*
+ * Send the packet to the IP broadcast (255.255.255.255)
+ */
+
+ ipaddr[0] = 0xFF; ipaddr[1] = 0xFF; ipaddr[2] = 0xFF; ipaddr[3] = 0xFF;
+ udp_send(s,buf,ipaddr);
+
+ /*
+ * Wait for a reply
+ */
+
+ res = dhcp_wait_reply(s,id,reply,DHCP_FUNCTION_OFFER);
+
+ return res;
+}
+
+
+/* *********************************************************************
+ * dhcp_do_dhcprequest(s,hwaddr,reply,discover_reply)
+ *
+ * Request an IP address from the DHCP server. On success, the
+ * dhcpreply_t structure will be filled in
+ *
+ * Input parameters:
+ * s - udp socket
+ * hwaddr - our hardware address
+ * reply - pointer to reply buffer.
+ * discover_reply - pointer to previously received DISCOVER data
+ *
+ * Return value:
+ * 0 if a response was received
+ * else error code
+ ********************************************************************* */
+
+static int dhcp_do_dhcprequest(int s,uint8_t *hwaddr,
+ dhcpreply_t *reply,
+ dhcpreply_t *discover_reply)
+{
+ ebuf_t *buf;
+ uint32_t id;
+ uint8_t ipaddr[IP_ADDR_LEN];
+ int res;
+
+ /*
+ * Packet ID is the current time
+ */
+
+ id = (uint32_t)cfe_ticks;
+
+ /*
+ * Build the DHCP REQUEST request
+ */
+
+ res = dhcp_build_request(hwaddr,
+ id,
+ discover_reply->dr_dhcpserver,
+ discover_reply->dr_ipaddr,
+ &buf);
+
+ if (res != 0) return res;
+
+ /*
+ * Send the packet to the IP broadcast (255.255.255.255)
+ */
+
+ ipaddr[0] = 0xFF; ipaddr[1] = 0xFF; ipaddr[2] = 0xFF; ipaddr[3] = 0xFF;
+ udp_send(s,buf,ipaddr);
+
+ /*
+ * Wait for a reply
+ */
+
+ res = dhcp_wait_reply(s,id,reply,DHCP_FUNCTION_ACK);
+
+ return res;
+}
+
+
+/* *********************************************************************
+ * dhcp_bootrequest(reply)
+ *
+ * Request an IP address from the DHCP server. On success, the
+ * dhcpreply_t structure will be allocated.
+ *
+ * Input parameters:
+ * reply - pointer to pointer to reply.
+ *
+ * Return value:
+ * 0 if no responses received
+ * >0 for some responses received
+ * else error code
+ ********************************************************************* */
+
+int dhcp_bootrequest(dhcpreply_t **rep)
+{
+ uint8_t *hwaddr;
+ int s;
+ dhcpreply_t *discover_reply;
+ dhcpreply_t *request_reply;
+ int nres = 0;
+ int retries;
+ uint32_t id;
+
+ id = (uint32_t) cfe_ticks;
+
+ /*
+ * Start with empty reply buffers. Since we use a portion of the
+ * discover reply in the request, we'll keep two of them.
+ */
+
+ discover_reply = KMALLOC(sizeof(dhcpreply_t),0);
+ if (discover_reply == NULL) {
+ return CFE_ERR_NOMEM;
+ }
+ memset(discover_reply,0,sizeof(dhcpreply_t));
+
+ request_reply = KMALLOC(sizeof(dhcpreply_t),0);
+ if (request_reply == NULL) {
+ KFREE(discover_reply);
+ return CFE_ERR_NOMEM;
+ }
+ memset(request_reply,0,sizeof(dhcpreply_t));
+
+
+ /*
+ * Get our hw addr
+ */
+
+ hwaddr = net_getparam(NET_HWADDR);
+ if (!hwaddr) {
+ KFREE(discover_reply);
+ KFREE(request_reply);
+ return CFE_ERR_NETDOWN;
+ }
+
+ /*
+ * Open UDP port
+ */
+
+ s = udp_socket(UDP_PORT_BOOTPS);
+ if (s < 0) {
+ KFREE(discover_reply);
+ KFREE(request_reply);
+ return CFE_ERR_NOHANDLES;
+ }
+
+ udp_bind(s,UDP_PORT_BOOTPC);
+
+ /*
+ * Do the boot request. Start by sending the OFFER message
+ */
+
+ nres = CFE_ERR_TIMEOUT;
+ for (retries = 0; retries < DHCP_NUM_RETRIES; retries++) {
+ nres = dhcp_do_dhcpdiscover(s,hwaddr,discover_reply);
+ if (nres == 0) break;
+ if (nres == CFE_ERR_TIMEOUT) continue;
+ break;
+ }
+
+ /*
+ * If someone sent us a response, send the REQUEST message
+ * to get a lease.
+ */
+
+ if (nres == 0) {
+
+ /*
+ * Now, send the REQUEST message and get a response.
+ */
+
+ for (retries = 0; retries < DHCP_NUM_RETRIES; retries++) {
+ nres = dhcp_do_dhcprequest(s,hwaddr,
+ request_reply,
+ discover_reply);
+ if (nres == 0) break;
+ if (nres == CFE_ERR_TIMEOUT) continue;
+ break;
+ }
+ }
+
+ /*
+ * All done with the discover reply.
+ */
+
+ dhcp_free_reply(discover_reply);
+
+ /*
+ * All done with UDP
+ */
+
+ udp_close(s);
+
+ /*
+ * Return the reply info.
+ */
+
+ if (nres == 0) {
+ *rep = request_reply;
+ }
+ else {
+ *rep = NULL;
+ dhcp_free_reply(request_reply);
+ }
+
+ return nres;
+}
diff --git a/cfe/cfe/net/net_dns.c b/cfe/cfe/net/net_dns.c
new file mode 100755
index 0000000..89b50b1
--- /dev/null
+++ b/cfe/cfe/net/net_dns.c
@@ -0,0 +1,354 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Domain Name System Resolver File: net_dns.c
+ *
+ * This module provides minimal support for looking up IP addresses
+ * from DNS name servers (RFCxxxx)
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_timer.h"
+#include "cfe_error.h"
+
+#include "net_ebuf.h"
+#include "net_ether.h"
+
+#include "cfe.h"
+
+#include "net_api.h"
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#define ip_addriszero(a) (((a)[0]|(a)[1]|(a)[2]|(a)[3]) == 0)
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define UDP_PORT_DNS 53
+
+#define DNS_FLG_QUERY 0x0000
+#define DNS_FLG_RESPONSE 0x8000
+#define DNS_OPCODE_QUERY 0x0000
+#define DNS_FLG_AA 0x0400
+#define DNS_FLG_TC 0x0200
+#define DNS_FLG_RD 0x0100
+#define DNS_FLG_RA 0x0080
+#define DNS_RCODE_MASK 0x000F
+#define DNS_RCODE_OK 0x0000
+#define DNS_RCODE_NAMEERR 0x0003
+
+
+#define QTYPE_HOSTADDR 1
+#define QCLASS_INTERNET 1
+
+#define DNS_QUERY_TIMEOUT 1 /* seconds */
+#define DNS_RETRY_COUNT 8
+
+
+/* *********************************************************************
+ * dns_dolookup(s,hostname,ipaddr)
+ *
+ * Look up a host name and return its IP address.
+ *
+ * Input parameters:
+ * s - udp socket
+ * server - name server to query
+ * hostname - host name to find
+ * ipaddr - buffer to place IP address
+ *
+ * Return value:
+ * 0 if no responses found
+ * >0 to indicate number of response records (usually 1)
+ * else error code
+ ********************************************************************* */
+
+static int dns_dolookup(int s,uint8_t *server,char *hostname,uint8_t *ipaddr)
+{
+ ebuf_t *buf;
+ uint16_t id;
+ uint16_t tmp;
+ char *tok;
+ char *ptr;
+ int64_t timer;
+ int nres = 0;
+ uint16_t nqr,nar,nns,nxr;
+ uint8_t tmpb;
+ int expired;
+
+
+ /*
+ * Use the current time for our request ID
+ */
+
+ id = (uint16_t) cfe_ticks;
+
+ /*
+ * Get a buffer and fill it in.
+ */
+
+ buf = udp_alloc();
+
+ ebuf_append_u16_be(buf,id);
+ ebuf_append_u16_be(buf,(DNS_FLG_QUERY | DNS_OPCODE_QUERY | DNS_FLG_RD));
+ ebuf_append_u16_be(buf,1); /* one question */
+ ebuf_append_u16_be(buf,0); /* no answers */
+ ebuf_append_u16_be(buf,0); /* no server resource records */
+ ebuf_append_u16_be(buf,0); /* no additional records */
+
+ /*
+ * Chop up the hostname into pieces, basically replacing
+ * the dots with length indicators.
+ */
+
+ ptr = hostname;
+
+ while ((tok = strchr(ptr,'.'))) {
+ ebuf_append_u8(buf,(tok-ptr));
+ ebuf_append_bytes(buf,ptr,(tok-ptr));
+ ptr = tok + 1;
+ }
+
+ ebuf_append_u8(buf,strlen(ptr));
+ ebuf_append_bytes(buf,ptr,strlen(ptr));
+ ebuf_append_u8(buf,0);
+ ebuf_append_u16_be(buf,QTYPE_HOSTADDR);
+ ebuf_append_u16_be(buf,QCLASS_INTERNET);
+
+ /*
+ * Send the request to the name server
+ */
+
+ udp_send(s,buf,server);
+
+ /*
+ * Set a timer for the response
+ */
+
+ TIMER_SET(timer,DNS_QUERY_TIMEOUT*CFE_HZ);
+
+ /*
+ * Start waiting...
+ */
+
+ while (!(expired = TIMER_EXPIRED(timer))) {
+ POLL();
+
+ buf = udp_recv(s);
+ if (!buf) continue;
+
+ /* IDs must match */
+
+ ebuf_get_u16_be(buf,tmp);
+ if (id != tmp) goto drop;
+
+ /* It must be a response */
+
+ ebuf_get_u16_be(buf,tmp);
+
+ if ((tmp & DNS_FLG_RESPONSE) == 0) goto drop;
+
+ if ((tmp & DNS_RCODE_MASK) != DNS_RCODE_OK) {
+ udp_free(buf);
+ /* name error */
+ break;
+ }
+
+ ebuf_get_u16_be(buf,nqr);
+ ebuf_get_u16_be(buf,nar);
+ ebuf_get_u16_be(buf,nns);
+ ebuf_get_u16_be(buf,nxr);
+
+ if (nar == 0) {
+ goto drop;
+ }
+
+ while (nqr > 0) {
+ if (ebuf_length(buf) <= 0) {
+ goto drop;
+ }
+ for (;;) {
+ ebuf_get_u8(buf,tmpb);
+ if (tmpb == 0) break;
+ ebuf_skip(buf,tmpb);
+ if (ebuf_length(buf) <= 0) {
+ goto drop;
+ }
+ }
+ ebuf_skip(buf,2); /* skip QTYPE */
+ ebuf_skip(buf,2); /* skip QCLASS */
+ nqr--; /* next question record */
+ }
+
+ /*
+ * Loop through the answer records to find
+ * a HOSTADDR record. Ignore any other records
+ * we find.
+ */
+
+ while (nar > 0) {
+ uint16_t rname,rtype,rclass,dlen;
+
+ ebuf_get_u16_be(buf,rname); /* resource name */
+
+ ebuf_get_u16_be(buf,rtype); /* resource type */
+
+ ebuf_get_u16_be(buf,rclass); /* resource class */
+
+ ebuf_skip(buf,4); /* time to live */
+
+ ebuf_get_u16_be(buf,dlen); /* length of data */
+
+ if (rtype != QTYPE_HOSTADDR) {
+ ebuf_skip(buf,dlen);
+ nar--;
+ continue;
+ }
+ if (rclass != QCLASS_INTERNET) {
+ ebuf_skip(buf,dlen);
+ nar--;
+ continue;
+ }
+
+ if (dlen != IP_ADDR_LEN) {
+ ebuf_skip(buf,dlen);
+ nar--;
+ continue;
+ }
+
+ ebuf_get_bytes(buf,ipaddr,IP_ADDR_LEN);
+ break;
+ }
+
+ if (nar == 0) goto drop;
+
+ udp_free(buf);
+ nres++;
+ break;
+
+ drop:
+ udp_free(buf);
+ }
+
+ if (expired) return CFE_ERR_TIMEOUT;
+ if (nres == 0) return CFE_ERR_HOSTUNKNOWN;
+ return nres;
+}
+
+
+/* *********************************************************************
+ * dns_lookup(hostname,ipaddr)
+ *
+ * Look up a host name and return its IP address.
+ *
+ * Input parameters:
+ * hostname - host name to find
+ * ipaddr - buffer to place IP address
+ *
+ * Return value:
+ * 0 if no responses found
+ * >0 to indicate number of response records (usually 1)
+ * else error code
+ ********************************************************************* */
+
+int dns_lookup(char *hostname,uint8_t *ipaddr)
+{
+ int s;
+ int nres = 0;
+ int retries;
+ char temphostname[100];
+ uint8_t *server;
+ uint8_t *tok;
+
+ /*
+ * If it's a valid IP address, don't look it up.
+ */
+
+ if (parseipaddr(hostname,ipaddr) == 0) return 1;
+
+ /*
+ * Add default domain if no domain was specified
+ */
+
+ if (strchr(hostname,'.') == NULL) {
+ tok = net_getparam(NET_DOMAIN);
+ if (tok) {
+ xsprintf(temphostname,"%s.%s",hostname,tok);
+ hostname = temphostname;
+ }
+ }
+
+ /*
+ * Figure out who the name server is
+ */
+
+ server = net_getparam(NET_NAMESERVER);
+
+ if (!server) return CFE_ERR_NETDOWN;
+ if (ip_addriszero(server)) return CFE_ERR_NONAMESERVER;
+
+ /*
+ * Go do the name server lookup
+ */
+
+ s = udp_socket(UDP_PORT_DNS);
+ if (s < 0) return CFE_ERR_NOHANDLES;
+
+ for (retries = 0; retries < DNS_RETRY_COUNT; retries++) {
+ nres = dns_dolookup(s,server,hostname,ipaddr);
+ if (nres == CFE_ERR_TIMEOUT) continue;
+ if (nres >= 0) break;
+ }
+
+ udp_close(s);
+
+ return nres;
+
+}
diff --git a/cfe/cfe/net/net_ebuf.h b/cfe/cfe/net/net_ebuf.h
new file mode 100644
index 0000000..11d83c1
--- /dev/null
+++ b/cfe/cfe/net/net_ebuf.h
@@ -0,0 +1,165 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Network EBUF macros File: net_ebuf.h
+ *
+ * This file contains macros and function prototypes for
+ * messing with "ebuf" buffers. ebufs describe network
+ * packets. They're sort of like poor-man's mbufs :-)
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+
+#define ENET_MAX_PKT 1514
+#define ENET_CRC_SIZE 4
+#define ENET_ADDR_LEN 6
+#define ENET_DIX_HEADER 14
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+
+typedef struct ebuf_s {
+ queue_t eb_qblock; /* linkage */
+ unsigned int eb_length; /* length of area at eb_ptr */
+ unsigned int eb_status; /* rx/tx status */
+ int eb_port; /* eth port that owns buffer */
+ void *eb_device; /* underlying net device */
+ int eb_usrdata; /* user-defined stuff */
+ uint8_t *eb_usrptr; /* user-defined stuff */
+ uint8_t *eb_ptr; /* current ptr within pkt */
+ uint8_t eb_data[0x5F0]; /* data, must be > ENET_MAX_PKT */
+ /* and divisible by sizeof(uint) */
+} ebuf_t;
+
+/*
+ * Macros to initialize ebufs
+ */
+
+#define ebuf_init_rx(eb) (eb)->eb_ptr = (eb)->eb_data; \
+ (eb)->eb_length = 0; \
+ (eb)->eb_status = 0
+
+#define ebuf_init_tx(eb) (eb)->eb_ptr = (eb)->eb_data; \
+ (eb)->eb_length = 0; \
+ (eb)->eb_status = 0
+
+/*
+ * Macros to move the currens position within an ebuf
+ */
+
+#define ebuf_prepend(eb,amt) (eb)->eb_ptr -= amt; (eb)->eb_length += (amt)
+#define ebuf_adjust(eb,amt) (eb)->eb_ptr += (amt); (eb)->eb_length += (amt)
+#define ebuf_seek(eb,amt) (eb)->eb_ptr += (amt)
+
+#define ebuf_remlen(eb) ((eb)->eb_length)
+#define ebuf_length(eb) ((eb)->eb_length)
+#define ebuf_ptr(eb) ((eb)->eb_ptr)
+#define ebuf_setlength(eb,amt) (eb)->eb_length = (amt)
+
+/*
+ * ebuf_append_xxx macros - these macros add data to the
+ * end of a packet, adjusting the length
+ */
+
+#define ebuf_append_u8(eb,b) ((eb)->eb_ptr[(eb)->eb_length++]) = (b) ;
+#define ebuf_append_u16_be(eb,w) ebuf_append_u8(eb,((w) >> 8) & 0xFF) ; \
+ ebuf_append_u8(eb,((w) & 0xFF))
+
+#define ebuf_append_u32_be(eb,w) ebuf_append_u8(eb,((w) >> 24) & 0xFF) ; \
+ ebuf_append_u8(eb,((w) >> 16) & 0xFF) ; \
+ ebuf_append_u8(eb,((w) >> 8) & 0xFF) ; \
+ ebuf_append_u8(eb,((w) & 0xFF))
+
+#define ebuf_append_bytes(eb,b,l) memcpy(&((eb)->eb_ptr[(eb)->eb_length]),(b),(l)); \
+ (eb)->eb_length += (l)
+
+/*
+ * ebuf_put_xxx macros - these macros modify data in the middle
+ * of a packet, typically in an area already allocated with
+ * ebuf_adjust. The length is not updated, but the pointer is.
+ */
+
+#define ebuf_put_u8(eb,b) *((eb)->eb_ptr++) = (b)
+#define ebuf_put_u16_be(eb,w) ebuf_put_u8(eb,((w) >> 8) & 0xFF) ; \
+ ebuf_put_u8(eb,((w) & 0xFF))
+
+#define ebuf_put_u32_be(eb,w) ebuf_put_u8(eb,((w) >> 24) & 0xFF) ; \
+ ebuf_put_u8(eb,((w) >> 16) & 0xFF) ; \
+ ebuf_put_u8(eb,((w) >> 8) & 0xFF) ; \
+ ebuf_put_u8(eb,((w) & 0xFF))
+
+#define ebuf_put_bytes(eb,b,l) memcpy((buf)->eb_ptr,(b),(l)) ; (buf)->eb_ptr += (l)
+
+#define ebuf_srcaddr(eb) &((eb)->eb_data[6])
+#define ebuf_destaddr(eb) &((eb)->eb_data[0])
+
+/* return next byte from the ebuf, and advance pointer */
+
+#define ebuf_skip(eb,amt) (eb)->eb_length -= (amt); (eb)->eb_ptr += (amt)
+
+#define ebuf_get_u8(eb,v) (eb)->eb_length--; \
+ v = (*((eb)->eb_ptr++))
+
+/* return next u16 from the ebuf, big-endian */
+
+#define ebuf_get_u16_be(eb,v) (eb)->eb_ptr+=2; \
+ (eb)->eb_length-=2; \
+ v = ( ((uint16_t)*((eb)->eb_ptr-1)) | \
+ (((uint16_t)*((eb)->eb_ptr-2)) << 8) )
+
+/* return next u32 from the ebuf, big-endian */
+
+#define ebuf_get_u32_be(eb,v) (eb)->eb_ptr+=4; \
+ (eb)->eb_length-=4; \
+ v = ( ((uint32_t)*((eb)->eb_ptr-1)) | \
+ (((uint32_t)*((eb)->eb_ptr-2)) << 8) | \
+ (((uint32_t)*((eb)->eb_ptr-3)) << 16) | \
+ (((uint32_t)*((eb)->eb_ptr-4)) << 24) )
+
+#define ebuf_get_bytes(eb,b,l) memcpy((b),(buf)->eb_ptr,(l)) ; (eb)->eb_ptr += (l) ; (eb)->eb_length -= (l)
+
+
diff --git a/cfe/cfe/net/net_ether.c b/cfe/cfe/net/net_ether.c
new file mode 100644
index 0000000..0dec6e8
--- /dev/null
+++ b/cfe/cfe/net/net_ether.c
@@ -0,0 +1,705 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Ethernet Datalink File: net_ether.c
+ *
+ * This module provides a simple datalink (LLC1) interface
+ * capable of demultiplexing standard DIX-style Ethernet packets.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_devfuncs.h"
+#include "cfe_ioctl.h"
+#include "cfe_error.h"
+
+#include "net_ebuf.h"
+#include "net_ether.h"
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define ETH_MAX_PORTS 4
+#define ETH_MAX_BUFFERS 8
+
+/* *********************************************************************
+ * Types
+ ********************************************************************* */
+
+typedef struct ether_port_s {
+ int ep_dev;
+ uint8_t ep_proto[8];
+ int ep_ptype;
+ int ep_mtu;
+ int (*ep_rxcallback)(ebuf_t *buf,void *ref);
+ void *ep_ref;
+} ether_port_t;
+
+struct ether_info_s {
+ ether_port_t *eth_ports;
+ queue_t eth_freelist;
+ uint8_t eth_hwaddr[6];
+ int eth_devhandle;
+ ebuf_t *eth_bufpool;
+};
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+const uint8_t eth_broadcast[ENET_ADDR_LEN] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
+
+
+/* *********************************************************************
+ * eth_open(eth,ptye,pdata,cb)
+ *
+ * Open an Ethernet portal.
+ *
+ * Input parameters:
+ * eth - ethernet context
+ * ptype - protocol type (ETH_PTYPE_xxx)
+ * pdata - protocol data (two bytes for DIX protocols)
+ * cb - callback for receive packets
+ *
+ * Return value:
+ * portal number
+ * or <0 if error occured
+ ********************************************************************* */
+
+int eth_open(ether_info_t *eth,int ptype,char *pdata,
+ int (*cb)(ebuf_t *buf,void *ref),void *ref)
+{
+ ether_port_t *p;
+ int portnum;
+
+ p = eth->eth_ports;
+
+ for (portnum = 0; portnum < ETH_MAX_PORTS; portnum++,p++) {
+ if (p->ep_rxcallback == NULL) break;
+ }
+
+ if (portnum == ETH_MAX_PORTS) {
+ return CFE_ERR_NOHANDLES; /* no ports left */
+ }
+
+ switch (ptype) {
+ case ETH_PTYPE_DIX:
+ p->ep_proto[0] = pdata[0];
+ p->ep_proto[1] = pdata[1];
+ p->ep_mtu = ENET_MAX_PKT - ENET_DIX_HEADER;
+ break;
+
+ case ETH_PTYPE_802SAP:
+ case ETH_PTYPE_802SNAP:
+ default:
+ /*
+ * we only support DIX etypes right now. If we ever want to support
+ * non-IP stacks (unlikely) this will need to change.
+ */
+ return CFE_ERR_UNSUPPORTED;
+ }
+
+ p->ep_ptype = ptype;
+ p->ep_rxcallback = cb;
+ p->ep_dev = eth->eth_devhandle;
+ p->ep_ref = ref;
+
+ return portnum;
+}
+
+
+/* *********************************************************************
+ * eth_close(eth,port)
+ *
+ * Close an Ethernet portal, freeing resources allocated to it.
+ *
+ * Input parameters:
+ * eth - ethernet context
+ * port - portal number
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void eth_close(ether_info_t *eth,int port)
+{
+ ether_port_t *p = &(eth->eth_ports[port]);
+
+ p->ep_ptype = 0;
+ p->ep_rxcallback = NULL;
+ p->ep_dev = 0;
+ memset(&(p->ep_proto[0]),0,sizeof(p->ep_proto));
+}
+
+
+/* *********************************************************************
+ * eth_findport(eth,buf)
+ *
+ * Locate the portal associated with a particular Ethernet packet.
+ * Parse the packet enough to determine if it's addressed
+ * correctly and to a valid protocol, and then look up the
+ * corresponding portal.
+ *
+ * Input parameters:
+ * eth - ethernet context
+ * buf - ethernet buffer to check
+ *
+ * Return value:
+ * eth_port_t structure or NULL if packet should be dropped
+ ********************************************************************* */
+
+static ether_port_t *eth_findport(ether_info_t *eth,ebuf_t *buf)
+{
+ int idx;
+ ether_port_t *p;
+
+ /*
+ * A few pre-flight checks: packets *from* multicast addresses
+ * are not allowed.
+ */
+
+ if (buf->eb_ptr[6] & 1) return NULL;
+
+ /*
+ * Packets smaller than minimum size are not allowed.
+ */
+
+ if (buf->eb_length < 60) return NULL;
+
+ /*
+ * Packets with bad status are not allowed
+ */
+
+ /* XXX if (buf->eb_status != 0) return NULL; */
+
+ /*
+ * Okay, scan the port list and find the matching portal.
+ */
+
+ for (idx = 0, p = eth->eth_ports; idx < ETH_MAX_PORTS; idx++,p++) {
+ if (!p->ep_rxcallback) continue; /* port not in use */
+
+ switch (p->ep_ptype) {
+ case ETH_PTYPE_DIX:
+ if ((p->ep_proto[0] == buf->eb_ptr[12]) &&
+ (p->ep_proto[1] == buf->eb_ptr[13])) {
+ ebuf_skip(buf,ENET_DIX_HEADER);
+ return p;
+ }
+ break;
+ case ETH_PTYPE_802SAP:
+ case ETH_PTYPE_802SNAP:
+ default:
+ break;
+ }
+ }
+
+ return NULL;
+}
+
+/* *********************************************************************
+ * eth_poll(eth)
+ *
+ * Poll devices and process inbound packets. If new packets arrive,
+ * call the appropriate callback routine.
+ *
+ * Input parameters:
+ * eth - ethernet context
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void eth_poll(ether_info_t *eth)
+{
+ ebuf_t *buf;
+ ether_port_t *p;
+ int res;
+
+ /* XXX should this loop until all packets are processed? */
+
+ /*
+ * If no packets, just get out now
+ */
+
+ if (cfe_inpstat(eth->eth_devhandle) == 0) return;
+
+ /*
+ * get a packet from the free list
+ */
+
+ buf = (ebuf_t *) q_deqnext(&(eth->eth_freelist));
+ if (!buf) return;
+
+ /*
+ * Receive network data into the packet buffer
+ */
+
+ ebuf_init_rx(buf);
+ res = cfe_read(eth->eth_devhandle,buf->eb_ptr,ENET_MAX_PKT);
+
+ /*
+ * if receive error, get out now.
+ */
+
+ if (res <= 0) {
+ q_enqueue(&(eth->eth_freelist),(queue_t *) buf);
+ return;
+ }
+
+ /*
+ * init the rest of the fields in the ebuf
+ */
+
+ buf->eb_length = res;
+ buf->eb_status = 0;
+ buf->eb_device = eth;
+ buf->eb_usrdata = 0;
+
+ /*
+ * Look up the portal to receive the new packet
+ */
+
+ p = eth_findport(eth,buf);
+
+ /*
+ * Call the callback routine if we want to keep this
+ * buffer. Otherwise, drop it on the floor
+ */
+
+ if (p) {
+ buf->eb_port = p - eth->eth_ports;
+ res = (*(p->ep_rxcallback))(buf,p->ep_ref);
+ if (res == ETH_DROP) eth_free(buf);
+ }
+ else {
+ eth_free(buf);
+ }
+}
+
+
+/* *********************************************************************
+ * eth_gethwaddr(eth,hwaddr)
+ *
+ * Obtain the hardware address of the Ethernet interface.
+ *
+ * Input parameters:
+ * eth - ethernet context
+ * hwaddr - place to put hardware address - 6 bytes
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void eth_gethwaddr(ether_info_t *eth,uint8_t *hwaddr)
+{
+ memcpy(hwaddr,eth->eth_hwaddr,ENET_ADDR_LEN);
+}
+
+/* *********************************************************************
+ * eth_sethwaddr(eth,hwaddr)
+ *
+ * Set the hardware address of the Ethernet interface.
+ *
+ * Input parameters:
+ * eth - ethernet context
+ * hwaddr - new hardware address - 6 bytes
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void eth_sethwaddr(ether_info_t *eth,uint8_t *hwaddr)
+{
+ int retlen;
+
+ memcpy(eth->eth_hwaddr,hwaddr,ENET_ADDR_LEN);
+ cfe_ioctl(eth->eth_devhandle,IOCTL_ETHER_SETHWADDR,&(eth->eth_hwaddr[0]),
+ sizeof(eth->eth_hwaddr),&retlen,0);
+
+}
+
+
+
+/* *********************************************************************
+ * eth_setspeed(eth,speed)
+ *
+ * Set the speed of the Ethernet interface.
+ *
+ * Input parameters:
+ * eth - ethernet context
+ * speed - target speed (or auto for automatic)
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+int eth_setspeed(ether_info_t *eth,int speed)
+{
+ int retlen;
+
+ return cfe_ioctl(eth->eth_devhandle,IOCTL_ETHER_SETSPEED,
+ (uint8_t *) &speed,sizeof(speed),&retlen,0);
+
+}
+
+/* *********************************************************************
+ * eth_setloopback(eth,loop)
+ *
+ * Configure loopback mode options for the Ethernet
+ *
+ * Input parameters:
+ * eth - ethernet context
+ * loop - loopback mode to set
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+int eth_setloopback(ether_info_t *eth,int loop)
+{
+ int retlen;
+
+ return cfe_ioctl(eth->eth_devhandle,IOCTL_ETHER_SETLOOPBACK,
+ (uint8_t *) &loop,sizeof(loop),&retlen,0);
+
+}
+
+/* *********************************************************************
+ * eth_getspeed(eth,speed)
+ *
+ * Get the current setting for the Ethernet speed (note that this
+ * is the speed we want to achieve, not the current speed)
+ *
+ * Input parameters:
+ * eth - ethernet context
+ * speed - pointer to int to receive speed
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+int eth_getspeed(ether_info_t *eth,int *speed)
+{
+ int retlen;
+
+ return cfe_ioctl(eth->eth_devhandle,IOCTL_ETHER_GETSPEED,
+ (uint8_t *) speed,sizeof(*speed),&retlen,0);
+
+}
+
+/* *********************************************************************
+ * eth_getloopback(eth,loop)
+ *
+ * Read the loopback state of the Ethernet interface
+ *
+ * Input parameters:
+ * eth - ethernet context
+ * loop - pointer to int to receive loopback state
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+int eth_getloopback(ether_info_t *eth,int *loop)
+{
+ int retlen;
+
+ return cfe_ioctl(eth->eth_devhandle,IOCTL_ETHER_GETLOOPBACK,
+ (uint8_t *) loop,sizeof(*loop),&retlen,0);
+
+}
+
+/* *********************************************************************
+ * eth_send(buf,dest)
+ *
+ * Transmit a packet.
+ *
+ * Input parameters:
+ * buf - ebuf structure describing packet
+ * dest - destination hardware address
+ *
+ * Return value:
+ * 0 - no error
+ * else error code
+ ********************************************************************* */
+
+int eth_send(ebuf_t *buf,uint8_t *dest)
+{
+ ether_info_t *eth = buf->eb_device;
+ ether_port_t *p = &(eth->eth_ports[buf->eb_port]);
+ int res;
+
+ switch (p->ep_ptype) {
+ case ETH_PTYPE_DIX:
+ ebuf_seek(buf,-ENET_DIX_HEADER);
+ ebuf_put_bytes(buf,dest,ENET_ADDR_LEN);
+ ebuf_put_bytes(buf,eth->eth_hwaddr,ENET_ADDR_LEN);
+ ebuf_put_bytes(buf,p->ep_proto,2);
+ /* adjust pointer and add in DIX header length */
+ ebuf_prepend(buf,ENET_DIX_HEADER);
+ break;
+ case ETH_PTYPE_802SAP:
+ case ETH_PTYPE_802SNAP:
+ default:
+ eth_free(buf); /* should not happen */
+ return CFE_ERR_UNSUPPORTED;
+ }
+
+ res = cfe_write(p->ep_dev,ebuf_ptr(buf),ebuf_length(buf));
+
+ /* XXX - should we free buffers here? */
+
+ return res;
+}
+
+/* *********************************************************************
+ * eth_alloc(eth,port)
+ *
+ * Allocate an Ethernet buffer. Ethernet buffers know what
+ * ports they are associated with, since we need to reserve
+ * space for the EThernet header, which might vary in size
+ * for DIX, 802, etc.
+ *
+ * Input parameters:
+ * eth - ethernet context
+ * port - portal ID
+ *
+ * Return value:
+ * ebuf, or NULL if no ebufs left
+ ********************************************************************* */
+
+ebuf_t *eth_alloc(ether_info_t *eth,int port)
+{
+ ebuf_t *buf;
+ ether_port_t *p = &(eth->eth_ports[port]);
+
+ buf = (ebuf_t *) q_deqnext(&(eth->eth_freelist));
+ if (buf == NULL) return NULL;
+
+ buf->eb_status = 0;
+ buf->eb_port = port;
+ buf->eb_device = eth;
+ ebuf_init_tx(buf);
+
+ switch (p->ep_ptype) {
+ case ETH_PTYPE_NONE:
+ break;
+ case ETH_PTYPE_DIX:
+ ebuf_seek(buf,ENET_DIX_HEADER);
+ break;
+ case ETH_PTYPE_802SAP:
+ case ETH_PTYPE_802SNAP:
+ default:
+ /* XXX Other ether types here */
+ break;
+ }
+
+ /*
+ * 'eb_ptr' points at new data, length is cleared.
+ * We will add the length back in at send time when the
+ * ethernet header is filled in.
+ */
+ buf->eb_length = 0;
+
+ return buf;
+}
+
+/* *********************************************************************
+ * eth_free(buf)
+ *
+ * Free an ebuf.
+ *
+ * Input parameters:
+ * buf - ebuf to free
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void eth_free(ebuf_t *buf)
+{
+ ether_info_t *eth = buf->eb_device;
+
+ q_enqueue(&(eth->eth_freelist),(queue_t *) buf);
+}
+
+
+/* *********************************************************************
+ * eth_getmtu(eth,port)
+ *
+ * Return the mtu of the specified Ethernet port. The mtu
+ * is the maximum number of bytes you can put in the buffer,
+ * excluding the Ethernet header.
+ *
+ * Input parameters:
+ * eth - ethernet context
+ * port - portal ID
+ *
+ * Return value:
+ * number of bytes
+ ********************************************************************* */
+
+
+int eth_getmtu(ether_info_t *eth,int port)
+{
+ ether_port_t *p = &(eth->eth_ports[port]);
+
+ return p->ep_mtu;
+}
+
+
+/* *********************************************************************
+ * eth_init(devname)
+ *
+ * Create an Ethernet context for a particular Ethernet device.
+ *
+ * Input parameters:
+ * devname - device name for underlying Ethernet driver
+ *
+ * Return value:
+ * ethernet context, or NULL of it could not be created.
+ ********************************************************************* */
+
+ether_info_t *eth_init(char *devname)
+{
+ int idx;
+ ebuf_t *buf;
+ ether_info_t *eth;
+ int devhandle;
+ int retlen;
+
+ /*
+ * Open the device driver
+ */
+
+ devhandle = cfe_open(devname);
+ if (devhandle < 0) return NULL;
+
+ eth = KMALLOC(sizeof(ether_info_t),0);
+ if (!eth) {
+ cfe_close(devhandle);
+ return NULL;
+ }
+
+ memset(eth,0,sizeof(ether_info_t));
+
+ /*
+ * Obtain hardware address
+ */
+
+ cfe_ioctl(devhandle,IOCTL_ETHER_GETHWADDR,&(eth->eth_hwaddr[0]),
+ sizeof(eth->eth_hwaddr),&retlen,0);
+
+ /*
+ * Allocate portal table
+ */
+
+ eth->eth_ports = KMALLOC(ETH_MAX_PORTS*sizeof(ether_port_t),0);
+ if (!eth->eth_ports) {
+ cfe_close(devhandle);
+ KFREE(eth);
+ return NULL;
+ }
+
+ memset(eth->eth_ports,0,ETH_MAX_PORTS*sizeof(ether_port_t));
+
+ /*
+ * Allocate buffer pool
+ */
+
+ eth->eth_bufpool = (ebuf_t *) KMALLOC(sizeof(ebuf_t)*ETH_MAX_BUFFERS,0);
+ if (!eth->eth_bufpool) {
+ cfe_close(devhandle);
+ KFREE(eth->eth_ports);
+ KFREE(eth);
+ return NULL;
+ }
+
+ /*
+ * Chain buffers onto the free list
+ */
+
+ q_init(&(eth->eth_freelist));
+ buf = eth->eth_bufpool;
+ for (idx = 0; idx < ETH_MAX_BUFFERS; idx++) {
+ q_enqueue(&(eth->eth_freelist),(queue_t *) buf);
+ buf++;
+ }
+
+ /*
+ * Remember the device handle
+ */
+
+ eth->eth_devhandle = devhandle;
+
+ return eth;
+}
+
+
+/* *********************************************************************
+ * eth_uninit(eth)
+ *
+ * Close and free up an Ethernet context
+ *
+ * Input parameters:
+ * eth - ethernet context
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void eth_uninit(ether_info_t *eth)
+{
+ cfe_close(eth->eth_devhandle);
+ KFREE(eth->eth_bufpool);
+ KFREE(eth->eth_ports);
+ KFREE(eth);
+}
+
+
diff --git a/cfe/cfe/net/net_ether.h b/cfe/cfe/net/net_ether.h
new file mode 100644
index 0000000..a94130b
--- /dev/null
+++ b/cfe/cfe/net/net_ether.h
@@ -0,0 +1,89 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Ethernet protocol demux defns File: net_ether.h
+ *
+ * constants and prototypes for the Ethernet datalink
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define ETH_PTYPE_NONE 0
+#define ETH_PTYPE_DIX 1
+#define ETH_PTYPE_802SAP 2
+#define ETH_PTYPE_802SNAP 3
+
+#define ETH_KEEP 1
+#define ETH_DROP 0
+
+/* *********************************************************************
+ * types
+ ********************************************************************* */
+
+typedef struct ether_info_s ether_info_t;
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+int eth_open(ether_info_t *eth,int ptype,char *pdata,int (*cb)(ebuf_t *buf,void *ref),void *ref);
+void eth_close(ether_info_t *eth,int port);
+void eth_poll(ether_info_t *eth);
+int eth_send(ebuf_t *buf,uint8_t *dest);
+ebuf_t *eth_alloc(ether_info_t *eth,int port);
+void eth_free(ebuf_t *buf);
+ether_info_t *eth_init(char *devname);
+void eth_uninit(ether_info_t *eth);
+int eth_getmtu(ether_info_t *,int port);
+void eth_gethwaddr(ether_info_t *,uint8_t *hwaddr);
+void eth_sethwaddr(ether_info_t *,uint8_t *hwaddr);
+int eth_getspeed(ether_info_t *,int *speed);
+int eth_setspeed(ether_info_t *,int speed);
+int eth_getloopback(ether_info_t *,int *loop);
+int eth_setloopback(ether_info_t *,int loop);
+extern const uint8_t eth_broadcast[ENET_ADDR_LEN];
+
+
+
diff --git a/cfe/cfe/net/net_icmp.c b/cfe/cfe/net/net_icmp.c
new file mode 100644
index 0000000..e98bc87
--- /dev/null
+++ b/cfe/cfe/net/net_icmp.c
@@ -0,0 +1,312 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * ICMP Protocol File: net_icmp.c
+ *
+ * This module implements portions of the ICMP protocol. Note
+ * that it is not a complete implementation, just enough to
+ * generate and respond to ICMP echo requests.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_timer.h"
+
+#include "net_ebuf.h"
+#include "net_ether.h"
+
+#include "net_ip.h"
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define ICMP_CODE_ECHO 0
+#define ICMP_TYPE_ECHOREPLY 0
+#define ICMP_TYPE_ECHOREQ 8
+
+#define ICMPMSG(type,code) (((type)<<8)|(code))
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+struct icmp_info_s {
+ ip_info_t *icmp_ipinfo;
+ queue_t icmp_echoreplies;
+ int icmp_maxreplies;
+};
+
+/* *********************************************************************
+ * ICMP_RX_CALLBACK(ref,buf,dst,src)
+ *
+ * This routine is called by the IP layer when we receive
+ * ICMP protocol messages.
+ *
+ * Input parameters:
+ * ref - reference data (an icmp_info_t)
+ * buf - the ebuf containing the buffer
+ * dst - destination IP address (us, usually)
+ * src - source IP address
+ *
+ * Return value:
+ * ETH_KEEP to keep packet, ETH_DROP to cause packet to be freed
+ ********************************************************************* */
+
+static int icmp_rx_callback(void *ref,ebuf_t *buf,uint8_t *dst,uint8_t *src)
+{
+ icmp_info_t *icmp = (icmp_info_t *)ref;
+ ip_info_t *ipi = icmp->icmp_ipinfo;
+ uint16_t imsg;
+ uint16_t cksum;
+ ebuf_t *txbuf;
+ uint8_t *icmphdr;
+ int res;
+
+ imsg = ICMPMSG(buf->eb_ptr[0],buf->eb_ptr[1]);
+
+ res = ETH_DROP; /* assume we're dropping the pkt */
+
+ switch (imsg) {
+ case ICMPMSG(ICMP_TYPE_ECHOREQ,ICMP_CODE_ECHO):
+ txbuf = _ip_alloc(ipi);
+ if (txbuf) {
+ /* Construct reply from the original packet. */
+ icmphdr = txbuf->eb_ptr;
+ ebuf_append_bytes(txbuf,buf->eb_ptr,buf->eb_length);
+ icmphdr[0] = ICMP_TYPE_ECHOREPLY;
+ icmphdr[1] = ICMP_CODE_ECHO;
+ icmphdr[2] = 0; icmphdr[3] = 0;
+ cksum = ~ip_chksum(0,icmphdr,ebuf_length(txbuf));
+ icmphdr[2] = (cksum >> 8) & 0xFF;
+ icmphdr[3] = (cksum & 0xFF);
+ if (_ip_send(ipi,txbuf,src,IPPROTO_ICMP) < 0) {
+ _ip_free(ipi,txbuf);
+ }
+ }
+ break;
+
+ case ICMPMSG(ICMP_TYPE_ECHOREPLY,ICMP_CODE_ECHO):
+ if (q_count(&(icmp->icmp_echoreplies)) < icmp->icmp_maxreplies) {
+ /* We're keeping this packet, put it on the queue and don't
+ free it in the driver. */
+ q_enqueue(&(icmp->icmp_echoreplies),(queue_t *) buf);
+ res = ETH_KEEP;
+ }
+ break;
+
+ default:
+ res = ETH_DROP;
+ }
+
+ return res;
+}
+
+
+/* *********************************************************************
+ * _ICMP_INIT(ipi)
+ *
+ * Initialize the ICMP layer.
+ *
+ * Input parameters:
+ * ipi - ipinfo structure of IP layer to attach to
+ *
+ * Return value:
+ * icmp_info_t structure or NULL if error occurs
+ ********************************************************************* */
+
+icmp_info_t *_icmp_init(ip_info_t *ipi)
+{
+ icmp_info_t *icmp;
+
+ icmp = (icmp_info_t *) KMALLOC(sizeof(icmp_info_t),0);
+ if (!icmp) return NULL;
+
+ icmp->icmp_ipinfo = ipi;
+ q_init(&(icmp->icmp_echoreplies));
+ icmp->icmp_maxreplies = 0;
+
+ _ip_register(ipi,IPPROTO_ICMP,icmp_rx_callback,icmp);
+
+ return icmp;
+}
+
+/* *********************************************************************
+ * _ICMP_UNINIT(icmp)
+ *
+ * Un-initialize the ICMP layer.
+ *
+ * Input parameters:
+ * icmp - icmp_info_t structure
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void _icmp_uninit(icmp_info_t *icmp)
+{
+ _ip_deregister(icmp->icmp_ipinfo,IPPROTO_ICMP);
+
+ KFREE(icmp);
+}
+
+
+/* *********************************************************************
+ * _ICMP_PING(icmp,dest,seq,len)
+ *
+ * Transmit an ICMP echo request and wait for a reply.
+ *
+ * Input parameters:
+ * icmp - icmp_info_t structure
+ * dest - destination IP address
+ * seq - sequence number for ICMP packet
+ * len - length of data portion of ICMP packet
+ *
+ * Return value:
+ * <0 = error
+ * 0 = timeout
+ * >0 = reply received
+ ********************************************************************* */
+
+int _icmp_ping(icmp_info_t *icmp,uint8_t *dest,int seq,int len)
+{
+ ebuf_t *buf;
+ int64_t timer;
+ uint16_t cksum;
+ uint8_t *icmphdr;
+ uint16_t id;
+ int idx;
+ int result = 0;
+
+ /*
+ * Get an ebuf
+ */
+
+ buf = _ip_alloc(icmp->icmp_ipinfo);
+ if (buf == NULL) return -1;
+
+ /*
+ * Remember where the ICMP header is going to be so we can
+ * calculate the checksum later.
+ */
+
+ icmphdr = buf->eb_ptr;
+
+ id = (uint16_t) cfe_ticks;
+
+ /*
+ * Construct the ICMP header and data portion.
+ */
+
+ ebuf_append_u8(buf,8); /* echo message */
+ ebuf_append_u8(buf,0); /* code = 0 */
+ ebuf_append_u16_be(buf,0); /* empty checksum for now */
+ ebuf_append_u16_be(buf,id); /* packet ID */
+ ebuf_append_u16_be(buf,((uint16_t)seq)); /* sequence # */
+
+ for (idx = 0; idx < len; idx++) {
+ ebuf_append_u8(buf,((idx+0x40)&0xFF)); /* data */
+ }
+
+ /*
+ * Calculate and install the checksum
+ */
+
+ cksum = ~ip_chksum(0,icmphdr,ebuf_length(buf));
+ icmphdr[2] = (cksum >> 8) & 0xFF;
+ icmphdr[3] = (cksum & 0xFF);
+
+ /*
+ * Transmit the ICMP echo
+ */
+
+ icmp->icmp_maxreplies = 1; /* allow ICMP replies */
+ _ip_send(icmp->icmp_ipinfo,buf,dest,IPPROTO_ICMP);
+ buf = NULL;
+
+ /*
+ * Wait for a reply
+ */
+
+ TIMER_SET(timer,2*CFE_HZ);
+
+ while (!TIMER_EXPIRED(timer)) {
+
+ POLL();
+ buf = (ebuf_t *) q_deqnext(&(icmp->icmp_echoreplies));
+
+ /* If we get a packet, make sure it matches. */
+
+ if (buf) {
+ uint16_t rxid,rxseq;
+
+ cksum = ip_chksum(0,buf->eb_ptr,ebuf_length(buf));
+ if (cksum == 0xFFFF) {
+ ebuf_skip(buf,2);
+ ebuf_skip(buf,2); /* skip checksum */
+ ebuf_get_u16_be(buf,rxid);
+ ebuf_get_u16_be(buf,rxseq);
+
+ if ((id == rxid) && ((uint16_t) seq == rxseq)) {
+ result = 1;
+ break;
+ }
+ }
+ _ip_free(icmp->icmp_ipinfo,buf);
+ }
+ }
+
+ /*
+ * Don't accept any more replies.
+ */
+
+ icmp->icmp_maxreplies = 0; /* allow ICMP replies */
+
+ if (buf) _ip_free(icmp->icmp_ipinfo,buf);
+
+ return result;
+
+}
diff --git a/cfe/cfe/net/net_ip.c b/cfe/cfe/net/net_ip.c
new file mode 100755
index 0000000..86303e2
--- /dev/null
+++ b/cfe/cfe/net/net_ip.c
@@ -0,0 +1,722 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Internet Protocol File: net_ip.c
+ *
+ * This module implements the IP layer (RFC791)
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "net_ebuf.h"
+#include "net_ether.h"
+
+#include "net_ip.h"
+#include "net_ip_internal.h"
+
+#include "cfe_error.h"
+
+/* *********************************************************************
+ * Forward declarations
+ ********************************************************************* */
+
+static int ip_rx_callback(ebuf_t *buf,void *ref);
+
+/* *********************************************************************
+ * _ip_alloc(ipi)
+ *
+ * Allocate an ebuf and reserve space for the IP header in it.
+ *
+ * Input parameters:
+ * ipi - IP stack information
+ *
+ * Return value:
+ * ebuf - an ebuf, or NULL if there are none left
+ ********************************************************************* */
+
+ebuf_t *_ip_alloc(ip_info_t *ipi)
+{
+ ebuf_t *buf;
+
+ buf = eth_alloc(ipi->eth_info,ipi->ip_port);
+
+ if (buf == NULL) return buf;
+
+ ebuf_seek(buf,IPHDR_LENGTH);
+ ebuf_setlength(buf,0);
+
+ return buf;
+}
+
+
+/* *********************************************************************
+ * ip_chksum(initcksum,ptr,len)
+ *
+ * Do an IP checksum for the specified buffer. You can pass
+ * an initial checksum if you're continuing a previous checksum
+ * calculation, such as for UDP headers and pseudoheaders.
+ *
+ * Input parameters:
+ * initcksum - initial checksum (usually zero)
+ * ptr - pointer to buffer to checksum
+ * len - length of data in bytes
+ *
+ * Return value:
+ * checksum (16 bits)
+ ********************************************************************* */
+
+uint16_t ip_chksum(uint16_t initcksum,uint8_t *ptr,int len)
+{
+ unsigned int cksum;
+ int idx;
+ int odd;
+
+ cksum = (unsigned int) initcksum;
+
+ odd = len & 1;
+ len -= odd;
+
+ for (idx = 0; idx < len; idx += 2) {
+ cksum += ((unsigned long) ptr[idx] << 8) + ((unsigned long) ptr[idx+1]);
+ }
+
+ if (odd) { /* buffer is odd length */
+ cksum += ((unsigned long) ptr[idx] << 8);
+ }
+
+ /*
+ * Fold in the carries
+ */
+
+ while (cksum >> 16) {
+ cksum = (cksum & 0xFFFF) + (cksum >> 16);
+ }
+
+ return cksum;
+}
+
+
+/* *********************************************************************
+ * _ip_send(ipi,buf,destaddr,proto)
+ *
+ * Send an IP datagram. We only support non-fragmented datagrams
+ * at this time.
+ *
+ * Input parameters:
+ * ipi - IP stack information
+ * buf - an ebuf
+ * destaddr - destination IP address
+ * proto - IP protocol number
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int _ip_send(ip_info_t *ipi,ebuf_t *buf,uint8_t *destaddr,uint8_t proto)
+{
+ uint16_t cksum;
+ uint8_t masksrc[IP_ADDR_LEN];
+ uint8_t maskdest[IP_ADDR_LEN];
+ int pktlen;
+ uint8_t *ptr;
+
+ /* Move to the beginning of the IP hdeader */
+
+ ebuf_seek(buf,-IPHDR_LENGTH);
+
+ pktlen = ebuf_length(buf) + IPHDR_LENGTH;
+
+ ipi->ip_id++;
+
+ /* Insert the IP header */
+
+ ebuf_put_u8(buf,IPHDR_VER_4 | IPHDR_LEN_20);
+ ebuf_put_u8(buf,IPHDR_TOS_DEFAULT);
+ ebuf_put_u16_be(buf,pktlen);
+ ebuf_put_u16_be(buf,ipi->ip_id);
+ ebuf_put_u16_be(buf,0);
+ ebuf_put_u8(buf,IPHDR_TTL_DEFAULT);
+ ebuf_put_u8(buf,proto);
+ ebuf_put_u16_be(buf,0); /* checksum */
+ ebuf_put_bytes(buf,ipi->net_info.ip_addr,IP_ADDR_LEN);
+ ebuf_put_bytes(buf,destaddr,IP_ADDR_LEN);
+
+ /* adjust pointer and add in the header length */
+
+ ebuf_prepend(buf,IPHDR_LENGTH);
+
+ /* Checksum the header */
+
+ ptr = ebuf_ptr(buf);
+ cksum = ip_chksum(0,ptr,IPHDR_LENGTH);
+ cksum = ~cksum;
+ ptr[10] = (cksum >> 8) & 0xFF;
+ ptr[11] = (cksum >> 0) & 0xFF;
+
+ /*
+ * If sending to the IP broadcast address,
+ * send to local broadcast.
+ */
+
+ if (ip_addrisbcast(destaddr)) {
+ eth_send(buf,(uint8_t *) eth_broadcast);
+ eth_free(buf);
+ return 0;
+ }
+
+ /*
+ * If the mask has not been set, don't try to
+ * determine if we should use the gateway or not.
+ */
+
+ if (ip_addriszero(ipi->net_info.ip_netmask)) {
+ return _arp_lookup_and_send(ipi,buf,destaddr);
+ }
+
+ /*
+ * Compute (dest-addr & netmask) and (my-addr & netmask)
+ */
+
+ ip_mask(masksrc,destaddr,ipi->net_info.ip_netmask);
+ ip_mask(maskdest,ipi->net_info.ip_addr,ipi->net_info.ip_netmask);
+
+ /*
+ * if destination and my address are on the same subnet,
+ * send the packet directly. Otherwise, send via
+ * the gateway.
+ */
+
+ if (ip_compareaddr(masksrc,maskdest) == 0) {
+ return _arp_lookup_and_send(ipi,buf,destaddr);
+ }
+ else {
+ /* if no gw configured, drop packet */
+ if (ip_addriszero(ipi->net_info.ip_gateway)) {
+ eth_free(buf); /* silently drop */
+ return 0;
+ }
+ else {
+ return _arp_lookup_and_send(ipi,buf,ipi->net_info.ip_gateway);
+ }
+ }
+
+}
+
+
+/* *********************************************************************
+ * ip_rx_callback(buf,ref)
+ *
+ * Receive callback for IP packets. This routine is called
+ * by the Ethernet datalink. We look up a suitable protocol
+ * handler and pass the packet off.
+ *
+ * Input parameters:
+ * buf - ebuf we received
+ * ref - reference data from the ethernet datalink
+ *
+ * Return value:
+ * ETH_KEEP to keep the packet
+ * ETH_DROP to drop the packet
+ ********************************************************************* */
+
+static int ip_rx_callback(ebuf_t *buf,void *ref)
+{
+ ip_info_t *ipi = ref;
+ uint8_t tmp;
+ int hdrlen;
+ uint8_t *hdr;
+ uint16_t origchksum;
+ uint16_t calcchksum;
+ uint16_t length;
+ uint16_t tmp16;
+ uint8_t proto;
+ uint8_t srcip[IP_ADDR_LEN];
+ uint8_t dstip[IP_ADDR_LEN];
+ ip_protodisp_t *pdisp;
+ int res;
+ int idx;
+
+ hdr = ebuf_ptr(buf); /* save current posn */
+
+ ebuf_get_u8(buf,tmp); /* version and header length */
+
+ /*
+ * Check IP version
+ */
+
+ if ((tmp & 0xF0) != IPHDR_VER_4) {
+ goto drop; /* not IPV4 */
+ }
+ hdrlen = (tmp & 0x0F) * 4;
+
+ /*
+ * Check header size
+ */
+
+ if (hdrlen < IPHDR_LENGTH) {
+ goto drop; /* header < 20 bytes */
+ }
+
+ /*
+ * Check the checksum
+ */
+ origchksum = ((uint16_t) hdr[10] << 8) | (uint16_t) hdr[11];
+ hdr[10] = hdr[11] = 0;
+ calcchksum = ~ip_chksum(0,hdr,hdrlen);
+ if (calcchksum != origchksum) {
+ goto drop;
+ }
+
+ /*
+ * Okay, now go back and check other fields.
+ */
+
+ ebuf_skip(buf,1); /* skip TOS field */
+
+ ebuf_get_u16_be(buf,length);
+ ebuf_skip(buf,2); /* skip ID field */
+
+ ebuf_get_u16_be(buf,tmp16); /* get Fragment Offset field */
+
+ /*
+ * If the fragment offset field is nonzero, or the
+ * "more fragments" bit is set, then this is a packet
+ * fragment. Our trivial IP implementation does not
+ * deal with fragments, so drop the packets.
+ */
+ if ((tmp16 & (IPHDR_FRAGOFFSET | IPHDR_MOREFRAGMENTS)) != 0) {
+ goto drop; /* packet is fragmented */
+ }
+
+ ebuf_skip(buf,1); /* skip TTL */
+ ebuf_get_u8(buf,proto); /* get protocol */
+ ebuf_skip(buf,2); /* skip checksum */
+
+ ebuf_get_bytes(buf,srcip,IP_ADDR_LEN);
+ ebuf_get_bytes(buf,dstip,IP_ADDR_LEN);
+
+ ebuf_skip(buf,hdrlen-IPHDR_LENGTH); /* skip rest of header */
+
+ ebuf_setlength(buf,length-hdrlen); /* set length to just data portion */
+
+ /*
+ * If our address is not set, let anybody in. We need this to
+ * properly pass up DHCP replies that get forwarde through routers.
+ * Otherwise, only let in matching addresses or broadcasts.
+ */
+
+ if (!ip_addriszero(ipi->net_info.ip_addr)) {
+ if ((ip_compareaddr(dstip,ipi->net_info.ip_addr) != 0) &&
+ !(ip_addrisbcast(dstip))) {
+ goto drop; /* not for us */
+ }
+ }
+
+ /*
+ * ebuf's pointer now starts at beginning of protocol data
+ */
+
+ /*
+ * Find matching protocol dispatch
+ */
+
+ pdisp = ipi->ip_protocols;
+ res = ETH_DROP;
+ for (idx = 0; idx < IP_MAX_PROTOCOLS; idx++) {
+ if (pdisp->cb && (pdisp->protocol == proto)) {
+ res = (*(pdisp->cb))(pdisp->ref,buf,dstip,srcip);
+ break;
+ }
+ pdisp++;
+ }
+
+
+ return res;
+
+drop:
+ return ETH_DROP;
+}
+
+
+/* *********************************************************************
+ * _ip_init(eth)
+ *
+ * Initialize the IP layer, attaching it to an underlying Ethernet
+ * datalink interface.
+ *
+ * Input parameters:
+ * eth - Ethernet datalink information
+ *
+ * Return value:
+ * ip_info pointer (IP stack information) or NULL if error
+ ********************************************************************* */
+
+ip_info_t *_ip_init(ether_info_t *eth)
+{
+ ip_info_t *ipi;
+ int8_t ipproto[2];
+
+ /*
+ * Allocate IP stack info
+ */
+
+ ipi = KMALLOC(sizeof(ip_info_t),0);
+ if (ipi == NULL) return NULL;
+
+ memset(ipi,0,sizeof(ip_info_t));
+
+ ipi->eth_info = eth;
+
+ /*
+ * Initialize ARP
+ */
+
+ if (_arp_init(ipi) < 0) {
+ KFREE(ipi);
+ return NULL;
+ }
+
+ /*
+ * Open the Ethernet portal for IP packets
+ */
+
+ ipproto[0] = (PROTOSPACE_IP >> 8) & 0xFF; ipproto[1] = PROTOSPACE_IP & 0xFF;
+ ipi->ip_port = eth_open(ipi->eth_info,ETH_PTYPE_DIX,ipproto,ip_rx_callback,ipi);
+
+ if (ipi->ip_port < 0) {
+ _arp_uninit(ipi);
+ KFREE(ipi);
+ return NULL;
+ }
+
+ return ipi;
+}
+
+
+/* *********************************************************************
+ * _ip_uninit(ipi)
+ *
+ * Un-initialize the IP layer, freeing resources
+ *
+ * Input parameters:
+ * ipi - IP stack information
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void _ip_uninit(ip_info_t *ipi)
+{
+ /*
+ * Close the IP portal
+ */
+
+ eth_close(ipi->eth_info,ipi->ip_port);
+
+ /*
+ * Turn off the ARP layer.
+ */
+
+ _arp_uninit(ipi);
+
+
+ /*
+ * free strings containing the domain and host names
+ */
+
+ if (ipi->net_info.ip_domain) {
+ KFREE(ipi->net_info.ip_domain);
+ }
+
+ if (ipi->net_info.ip_hostname) {
+ KFREE(ipi->net_info.ip_hostname);
+ }
+
+ /*
+ * Free the stack information
+ */
+
+ KFREE(ipi);
+}
+
+
+/* *********************************************************************
+ * _ip_timer_tick(ipi)
+ *
+ * Called once per second while the IP stack is active.
+ *
+ * Input parameters:
+ * ipi - ip stack information
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+
+void _ip_timer_tick(ip_info_t *ipi)
+{
+ _arp_timer_tick(ipi);
+}
+
+
+/* *********************************************************************
+ * _ip_free(ipi,buf)
+ *
+ * Free an ebuf allocated via _ip_alloc
+ *
+ * Input parameters:
+ * ipi - IP stack information
+ * buf - ebuf to free
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void _ip_free(ip_info_t *ipi,ebuf_t *buf)
+{
+ eth_free(buf);
+}
+
+/* *********************************************************************
+ * _ip_getaddr(ipi,buf)
+ *
+ * Return our IP address (is this used?)
+ *
+ * Input parameters:
+ * ipi - IP stack information
+ * buf - pointer to 4-byte buffer to receive IP address
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void _ip_getaddr(ip_info_t *ipi,uint8_t *buf)
+{
+ memcpy(buf,ipi->net_info.ip_addr,IP_ADDR_LEN);
+}
+
+/* *********************************************************************
+ * _ip_getparam(ipi,param)
+ *
+ * Return the value of an IP parameter (address, netmask, etc.).
+ * The return value may need to be coerced if it's not normally
+ * a uint8_t* pointer.
+ *
+ * Input parameters:
+ * ipi - IP stack information
+ * param - parameter number
+ *
+ * Return value:
+ * parameter value, or NULL if the parameter is invalid or
+ * not set.
+ ********************************************************************* */
+
+uint8_t *_ip_getparam(ip_info_t *ipinfo,int param)
+{
+ uint8_t *ret = NULL;
+
+ switch (param) {
+ case NET_IPADDR:
+ ret = ipinfo->net_info.ip_addr;
+ break;
+ case NET_NETMASK:
+ ret = ipinfo->net_info.ip_netmask;
+ break;
+ case NET_GATEWAY:
+ ret = ipinfo->net_info.ip_gateway;
+ break;
+ case NET_NAMESERVER:
+ ret = ipinfo->net_info.ip_nameserver;
+ break;
+ case NET_HWADDR:
+ ret = ipinfo->arp_hwaddr;
+ break;
+ case NET_DOMAIN:
+ ret = ipinfo->net_info.ip_domain;
+ break;
+ case NET_HOSTNAME:
+ ret = ipinfo->net_info.ip_hostname;
+ break;
+ case NET_SPEED:
+ return NULL;
+ break;
+ case NET_LOOPBACK:
+ return NULL;
+ break;
+ }
+
+ return ret;
+}
+
+/* *********************************************************************
+ * _ip_getparam(ipi,param,value)
+ *
+ * Set the value of an IP parameter (address, netmask, etc.).
+ * The value may need to be coerced if it's not normally
+ * a uint8_t* pointer.
+ *
+ * Input parameters:
+ * ipi - IP stack information
+ * param - parameter number
+ * value - parameter's new value
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+int _ip_setparam(ip_info_t *ipinfo,int param,uint8_t *ptr)
+{
+ int res = -1;
+
+ switch (param) {
+ case NET_IPADDR:
+ memcpy(ipinfo->net_info.ip_addr,ptr,IP_ADDR_LEN);
+ _arp_send_gratuitous(ipinfo);
+ res = 0;
+ break;
+ case NET_NETMASK:
+ memcpy(ipinfo->net_info.ip_netmask,ptr,IP_ADDR_LEN);
+ res = 0;
+ break;
+ case NET_GATEWAY:
+ memcpy(ipinfo->net_info.ip_gateway,ptr,IP_ADDR_LEN);
+ res = 0;
+ break;
+ case NET_NAMESERVER:
+ memcpy(ipinfo->net_info.ip_nameserver,ptr,IP_ADDR_LEN);
+ res = 0;
+ break;
+ case NET_DOMAIN:
+ if (ipinfo->net_info.ip_domain) {
+ KFREE(ipinfo->net_info.ip_domain);
+ ipinfo->net_info.ip_domain = NULL;
+ }
+ if (ptr) ipinfo->net_info.ip_domain = (uint8_t*)strdup((char *) ptr);
+ break;
+ case NET_HOSTNAME:
+ if (ipinfo->net_info.ip_hostname) {
+ KFREE(ipinfo->net_info.ip_hostname);
+ ipinfo->net_info.ip_hostname = NULL;
+ }
+ if (ptr) ipinfo->net_info.ip_hostname = (uint8_t*)strdup((char *) ptr);
+ break;
+ case NET_HWADDR:
+ memcpy(ipinfo->arp_hwaddr,ptr,ENET_ADDR_LEN);
+ eth_sethwaddr(ipinfo->eth_info,ptr);
+ res = 0;
+ break;
+ case NET_SPEED:
+ res = eth_setspeed(ipinfo->eth_info,*(int *)ptr);
+ break;
+ case NET_LOOPBACK:
+ res = eth_setloopback(ipinfo->eth_info,*(int *)ptr);
+ break;
+ }
+
+ return res;
+}
+
+/* *********************************************************************
+ * _ip_register(ipinfo,proto,cb)
+ *
+ * Register a protocol handler with the IP layer. IP client
+ * protocols such as UDP, ICMP, etc. call this to register their
+ * callbacks.
+ *
+ * Input parameters:
+ * ipinfo - IP stack information
+ * proto - IP protocol number
+ * cb - callback routine to register
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void _ip_register(ip_info_t *ipinfo,
+ int proto,
+ int (*cb)(void *ref,ebuf_t *buf,uint8_t *dst,uint8_t *src),void *ref)
+{
+ int idx;
+
+ for (idx = 0; idx < IP_MAX_PROTOCOLS; idx++) {
+ if (ipinfo->ip_protocols[idx].cb == NULL) break;
+ }
+
+ if (idx == IP_MAX_PROTOCOLS) return;
+
+ ipinfo->ip_protocols[idx].protocol = (uint8_t) proto;
+ ipinfo->ip_protocols[idx].cb = cb;
+ ipinfo->ip_protocols[idx].ref = ref;
+}
+
+
+/* *********************************************************************
+ * _ip_deregister(ipinfo,proto)
+ *
+ * Deregister an IP protocol.
+ *
+ * Input parameters:
+ * ipinfo - IP stack information
+ * proto - protocol number
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void _ip_deregister(ip_info_t *ipinfo,int proto)
+{
+ int idx;
+
+ for (idx = 0; idx < IP_MAX_PROTOCOLS; idx++) {
+ if (ipinfo->ip_protocols[idx].protocol == (uint8_t) proto) {
+ ipinfo->ip_protocols[idx].protocol = 0;
+ ipinfo->ip_protocols[idx].ref = 0;
+ ipinfo->ip_protocols[idx].cb = NULL;
+ }
+ }
+}
+
diff --git a/cfe/cfe/net/net_ip.h b/cfe/cfe/net/net_ip.h
new file mode 100755
index 0000000..7b1b4be
--- /dev/null
+++ b/cfe/cfe/net/net_ip.h
@@ -0,0 +1,159 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * IP Protocol Definitions File: net_ip.h
+ *
+ * This is the main include file for the CFE network stack.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+
+/* *********************************************************************
+ * Global info
+ ********************************************************************* */
+
+#ifndef IP_ADDR_LEN
+#define IP_ADDR_LEN 4
+#endif
+
+typedef struct ip_info_s ip_info_t;
+
+typedef struct net_info_s {
+ /* Configuration info for IP interface */
+ uint8_t ip_addr[IP_ADDR_LEN];
+ uint8_t ip_netmask[IP_ADDR_LEN];
+ uint8_t ip_gateway[IP_ADDR_LEN];
+ uint8_t ip_nameserver[IP_ADDR_LEN];
+ uint8_t *ip_domain;
+ uint8_t *ip_hostname;
+} net_info_t;
+
+/* *********************************************************************
+ * ARP Information
+ ********************************************************************* */
+
+int _arp_lookup_and_send(ip_info_t *ipi,ebuf_t *buf,uint8_t *dest);
+void _arp_timer_tick(ip_info_t *ipi);
+int _arp_init(ip_info_t *ipi);
+void _arp_uninit(ip_info_t *ipi);
+void _arp_add(ip_info_t *ipi,uint8_t *destip,uint8_t *desthw);
+void _arp_send_gratuitous(ip_info_t *ipi);
+uint8_t *_arp_lookup(ip_info_t *ipi,uint8_t *destip);
+int _arp_enumerate(ip_info_t *ipi,int entrynum,uint8_t *ipaddr,uint8_t *hwaddr);
+int _arp_delete(ip_info_t *ipi,uint8_t *ipaddr);
+
+
+/* *********************************************************************
+ * IP protocol
+ ********************************************************************* */
+
+
+#define IPPROTO_TCP 6
+#define IPPROTO_UDP 17
+#define IPPROTO_ICMP 1
+
+int _ip_send(ip_info_t *ipi,ebuf_t *buf,uint8_t *destaddr,uint8_t proto);
+ip_info_t *_ip_init(ether_info_t *);
+void _ip_timer_tick(ip_info_t *ipi);
+void _ip_uninit(ip_info_t *ipi);
+ebuf_t *_ip_alloc(ip_info_t *ipi);
+void _ip_free(ip_info_t *ipi,ebuf_t *buf);
+void _ip_getaddr(ip_info_t *ipi,uint8_t *buf);
+uint8_t *_ip_getparam(ip_info_t *ipinfo,int param);
+int _ip_setparam(ip_info_t *ipinfo,int param,uint8_t *ptr);
+uint16_t ip_chksum(uint16_t initcksum,uint8_t *ptr,int len);
+void _ip_deregister(ip_info_t *ipinfo,int proto);
+void _ip_register(ip_info_t *ipinfo,
+ int proto,
+ int (*cb)(void *ref,ebuf_t *buf,uint8_t *dst,uint8_t *src),void *ref);
+
+
+#define ip_mask(dest,a,b) (dest)[0] = (a)[0] & (b)[0] ; \
+ (dest)[1] = (a)[1] & (b)[1] ; \
+ (dest)[2] = (a)[2] & (b)[2] ; \
+ (dest)[3] = (a)[3] & (b)[3]
+
+#define ip_compareaddr(a,b) memcmp(a,b,IP_ADDR_LEN)
+
+#define ip_addriszero(a) (((a)[0]|(a)[1]|(a)[2]|(a)[3]) == 0)
+#define ip_addrisbcast(a) ((a[0] == 0xFF) && (a[1] == 0xFF) && (a[2] == 0xFF) && (a[3] == 0xFF))
+
+#ifndef NET_IPADDR
+#define NET_IPADDR 0
+#define NET_NETMASK 1
+#define NET_GATEWAY 2
+#define NET_NAMESERVER 3
+#define NET_HWADDR 4
+#define NET_DOMAIN 5
+#define NET_HOSTNAME 6
+#define NET_SPEED 7
+#define NET_LOOPBACK 8
+#endif
+
+/* *********************************************************************
+ * UDP Protocol
+ ********************************************************************* */
+
+typedef struct udp_info_s udp_info_t;
+
+int _udp_socket(udp_info_t *info,uint16_t port);
+void _udp_close(udp_info_t *info,int s);
+int _udp_send(udp_info_t *info,int s,ebuf_t *buf,uint8_t *dest);
+udp_info_t *_udp_init(ip_info_t *ipi,void *ref);
+void _udp_uninit(udp_info_t *info);
+int _udp_bind(udp_info_t *info,int s,uint16_t port);
+int _udp_connect(udp_info_t *info,int s,uint16_t port);
+ebuf_t *_udp_recv(udp_info_t *info,int s);
+ebuf_t *_udp_alloc(udp_info_t *info);
+void _udp_free(udp_info_t *info,ebuf_t *buf);
+
+/* *********************************************************************
+ * ICMP protocol
+ ********************************************************************* */
+
+typedef struct icmp_info_s icmp_info_t;
+
+icmp_info_t *_icmp_init(ip_info_t *ipi);
+void _icmp_uninit(icmp_info_t *icmp);
+
+int _icmp_ping(icmp_info_t *icmp,uint8_t *ipaddr,int seq,int len);
+
+
diff --git a/cfe/cfe/net/net_ip_internal.h b/cfe/cfe/net/net_ip_internal.h
new file mode 100644
index 0000000..94401e2
--- /dev/null
+++ b/cfe/cfe/net/net_ip_internal.h
@@ -0,0 +1,128 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Internal IP structures File: net_ip_internal.h
+ *
+ * This module contains non-public IP stack constants,
+ * structures, and function prototypes.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+/* *********************************************************************
+ * ARP Protocol
+ ********************************************************************* */
+
+#define ARP_OPCODE_REQUEST 1
+#define ARP_OPCODE_REPLY 2
+
+#define ARP_HWADDRSPACE_ETHERNET 1
+
+#define PROTOSPACE_IP 0x0800
+#define PROTOSPACE_ARP 0x0806
+
+/* Foxconn add start by Cliff Wang, 03/23/2010 */
+#define PROTOSPACE_NMRP 0x0912
+/* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+#define ARP_KEEP_TIMER 60
+#define ARP_QUERY_TIMER 1
+#define ARP_QUERY_RETRIES 4
+#define ARP_TXWAIT_MAX 2
+#define ARP_TABLE_SIZE 8
+
+typedef enum { ae_unused, ae_arping, ae_established } arpstate_t;
+
+typedef struct arpentry_s {
+ arpstate_t ae_state;
+ int ae_usage;
+ int ae_timer;
+ int ae_retries;
+ int ae_permanent;
+ uint8_t ae_ipaddr[IP_ADDR_LEN];
+ uint8_t ae_ethaddr[ENET_ADDR_LEN];
+ queue_t ae_txqueue;
+} arpentry_t;
+
+
+/* *********************************************************************
+ * IP Protocol
+ ********************************************************************* */
+
+#define IPHDR_VER_4 0x40
+#define IPHDR_LEN_20 0x05
+#define IPHDR_LENGTH 20
+#define IPHDR_TOS_DEFAULT 0x00
+#define IPHDR_TTL_DEFAULT 100
+
+#define IPHDR_RESERVED 0x8000
+#define IPHDR_DONTFRAGMENT 0x4000
+#define IPHDR_MOREFRAGMENTS 0x2000
+#define IPHDR_FRAGOFFSET 0x01FFF
+
+typedef struct ip_protodisp_s {
+ uint8_t protocol;
+ int (*cb)(void *ref,ebuf_t *buf,uint8_t *dst,uint8_t *src);
+ void *ref;
+} ip_protodisp_t;
+
+#define IP_MAX_PROTOCOLS 4
+
+
+struct ip_info_s {
+ net_info_t net_info;
+
+ /* Ethernet info */
+ ether_info_t *eth_info;
+
+ /* Info specific to IP */
+ uint16_t ip_id;
+ int ip_port;
+
+ /* IP protocol dispatch table */
+ ip_protodisp_t ip_protocols[IP_MAX_PROTOCOLS];
+
+ /* Info specific to ARP */
+ arpentry_t *arp_table;
+ int arp_port;
+ uint8_t arp_hwaddr[ENET_ADDR_LEN];
+};
+
+
diff --git a/cfe/cfe/net/net_nmrp.c b/cfe/cfe/net/net_nmrp.c
new file mode 100755
index 0000000..696d04d
--- /dev/null
+++ b/cfe/cfe/net/net_nmrp.c
@@ -0,0 +1,656 @@
+#include "bsp_config.h"
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_devfuncs.h"
+#include "cfe_ioctl.h"
+#include "cfe_timer.h"
+
+#include "cfe_error.h"
+
+#include "net_ebuf.h"
+#include "net_ether.h"
+
+#include "cfe_timer.h"
+
+#include "net_ip.h"
+#include "net_ip_internal.h"
+#include "net_api.h"
+
+#include "env_subr.h"
+
+#if CFG_TCP
+#include "net_tcp.h"
+#endif
+
+#include "ui_command.h"
+
+typedef struct net_ctx_s {
+ /* Global info */
+ int64_t timer;
+
+ /* device name */
+ char *devname;
+
+ /* Run-time info for IP interface */
+ ip_info_t *ipinfo;
+
+ /* Info for Ethernet interface */
+ ether_info_t *ethinfo;
+
+ /* Info specific to UDP */
+ udp_info_t *udpinfo;
+
+ /* Info specific to ICMP */
+ icmp_info_t *icmpinfo;
+
+#if CFG_TCP
+ /* Info specific to TCP */
+ tcp_info_t *tcpinfo;
+#endif
+} net_ctx_t;
+
+
+#pragma pack(1)
+
+typedef uint8_t BYTE;
+typedef uint16_t WORD;
+typedef uint32_t DWORD;
+
+/* NMRP timeouts */
+enum _nmrp_timeouts_ {
+ NMRP_TIMEOUT_REQ = 1/2, /* 0.5 sec */
+ NMRP_TIMEOUT_LISTEN = 3, /* 3 sec */
+ NMRP_TIMEOUT_ACTIVE = 60000, /* 1 minute */
+ NMRP_TIMEOUT_CLOSE = 6000, /* 6 sec */
+ NMRP_TIMEOUT_ADVERTISE = 500 /* 0.5 sec */
+};
+
+enum _nmrp_errors_ {
+ NMRP_ERR_NONE = 0,
+ NMRP_ERR_MSG_INVALID_LEN,
+ NMRP_ERR_MSG_TOO_LONG,
+ NMRP_ERR_MSG_TOO_MANY_OPT,
+ NMRP_ERR_MSG_UNKNOWN_OPT,
+ NMRP_ERR_MSG_INVALID_OPT,
+ NMRP_ERR_NO_BUF,
+ NMRP_ERR_GENERAL
+};
+
+/* NMRP codes */
+enum _nmrp_codes_ {
+ NMRP_CODE_ADVERTISE = 0x01,
+ NMRP_CODE_CONF_REQ = 0x02,
+ NMRP_CODE_CONF_ACK = 0x03,
+ NMRP_CODE_CLOSE_REQ = 0x04,
+ NMRP_CODE_CLOSE_ACK = 0x05,
+ NMRP_CODE_KEEP_ALIVE_REQ = 0x06,
+ NMRP_CODE_KEEP_ALIVE_ACK = 0x07,
+ NMRP_CODE_TFTP_UL_REQ = 0x10
+};
+
+/* NMRP option types */
+enum _nmrp_option_types_ {
+ NMRP_OPT_MAGIC_NO = 0x0001,
+ NMRP_OPT_DEV_IP = 0x0002,
+ NMRP_OPT_FW_UP = 0x0101
+};
+
+typedef enum {
+ NMRPC_L2_NO_ERROR = 0,
+ NMRPC_L2_TX_PKT_TOO_LONG,
+ NMRPC_L2_TX_ETHER_PREPEND_FAIL,
+ NMRPC_L2_TX_ERROR,
+ NMRPC_L2_GEN_ERR
+} NMRPC_L2_RET_CODE;
+
+/* NMRP REQ max retries */
+enum _nmrp_req_max_retries_ {
+ NMRP_MAX_RETRY_CONF = 5,
+ NMRP_MAX_RETRY_CLOSE = 9999,
+ NMRP_MAX_RETRY_TFTP_UL = 4
+};
+
+
+enum _nmrp_state_ {
+ NMRP_STATE_LISTEN = 0,
+ NMRP_STATE_CONFIGURE,
+ NMRP_STATE_TRANSFER,
+ NMRP_STATE_CLOSE
+};
+
+#define NMRP_MAX_OPT_PER_MSG (6)
+#define ETHER_NMRP (0x0912)
+
+#define NMRP_HDR_LEN (sizeof(NMRP_MSG) - sizeof(NMRP_OPT))
+#define NMRP_MIN_OPT_LEN (sizeof(NMRP_OPT) - 1)
+
+#define NMRP_MAGIC_NO "\x4E\x54\x47\x52"
+#define NMRP_MAGIC_NO_LEN (sizeof(NMRP_MAGIC_NO) - 1)
+
+typedef struct {
+ uint8_t destMAC[6];
+ uint8_t srcMAC[6];
+ uint16_t etherType;
+} ETHER_HDR;
+
+typedef struct {
+ uint16_t type;
+ uint16_t len;
+ uint8_t value;
+} NMRP_OPT;
+
+typedef struct {
+ uint16_t reserved;
+ uint8_t code;
+ uint8_t id;
+ uint16_t length;
+
+ NMRP_OPT opt;
+} NMRP_MSG;
+
+typedef struct {
+ ETHER_HDR etherHdr;
+ NMRP_MSG nmrpMsg;
+} ETHER_NMRP_PKT;
+
+typedef struct {
+ uint16_t type;
+ uint16_t len;
+
+ union {
+ uint8_t byteVal;
+ uint16_t wordVal;
+ uint32_t dwordVal;
+ const uint8_t *streamVal;
+ } value;
+} NMRP_PARSED_OPT;
+
+typedef struct {
+ uint8_t code;
+ uint8_t id;
+ uint16_t length;
+
+ int numOptions;
+ NMRP_PARSED_OPT options[NMRP_MAX_OPT_PER_MSG];
+} NMRP_PARSED_MSG;
+
+typedef struct {
+ int reqCode;
+ const char reqName[32], respName[32];
+
+ int (* RespParser) (const void *pkt, int pktLen, const BYTE *serverMac, void *userData);
+} NMRP_REQ_CUSTOM;
+
+typedef struct {
+
+ BYTE peerMac[6];
+ BYTE myMac[6];
+
+ DWORD peerIp;
+ DWORD myIp;
+ WORD ipId;
+
+ WORD peerPort;
+ WORD myPort;
+} NET_INFO;
+
+#pragma pack()
+
+#define MIN_ETHER_NMRP_LEN (sizeof(ETHER_HDR) + NMRP_HDR_LEN)
+
+#if 0
+#define HTONCS(constWord) ((((constWord) & 0xff00) >> 8) | (((constWord) & 0xff) << 8))
+#define NTOHCS(constWord) HTONCS(constWord)
+#define HTONCL(constDword) ((((constDword) & 0xff000000) >> 24) | (((constDword) & 0xff0000) >> 8) | (((constDword) & 0xff00) << 8) | (((constDword) & 0xff) << 24))
+#define NTOHCL(constDword) HTONCL(constDword)
+#endif
+
+#define HTONCS(constWord) constWord
+#define NTOHCS(constWord) constWord
+#define HTONCL(constDword) constDword
+#define NTOHCL(constDword) constDword
+/*
+#define IS_NMRP_PKT(etherNmrpPkt, pktLen, parsedNmrpMsg, sourceMAC) \
+ ((pktLen) > MIN_ETHER_NMRP_LEN && (etherNmrpPkt)->etherHdr.etherType == HTONCS(ETHER_NMRP) && \
+ ((sourceMAC) == NULL || memcmp((sourceMAC), (etherNmrpPkt)->etherHdr.srcMAC, 6) == 0) && \
+ NMRP_MsgParsing(&(etherNmrpPkt)->nmrpMsg, (pktLen) - sizeof(ETHER_HDR), (parsedNmrpMsg)) == NMRP_ERR_NONE)
+*/
+
+#define IS_NMRP_PKT(etherNmrpPkt, pktLen, parsedNmrpMsg, sourceMAC) \
+ ((pktLen) > MIN_ETHER_NMRP_LEN && (etherNmrpPkt)->etherHdr.etherType == HTONCS(ETHER_NMRP) && \
+ ((sourceMAC) == NULL || memcmp((sourceMAC), (etherNmrpPkt)->etherHdr.srcMAC, 6) == 0))
+
+static int nmrp_rx_callback(ebuf_t *buf,void *ref);
+int NMRP_MsgParsing(const NMRP_MSG *pkt, int pktLen, NMRP_PARSED_MSG *msg);
+NMRP_PARSED_OPT *NMRP_MsgGetOpt(NMRP_PARSED_MSG *msg, uint16_t optType);
+//int NMRPRequest( const BYTE *serverMac, const BYTE *clientMac, NMRP_REQ_CUSTOM *custom, void *userData);
+static int NMRPConfiguring( const BYTE *serverMac, const BYTE *clientMac, DWORD *ipAddr, DWORD *ipSubnetMask, int *fwUpgrade);
+static int NMRPConfAckParser(const void *pkt, int pktLen, const BYTE *serverMac, void *userData);
+//int NMRPTFTPWaiting(const NET_INFO *netInfo, DWORD *peerIp, WORD *peerPort, WORD *ipId);
+int NMRPTFTPWaiting(void);
+int NMRPKeepAlive(void);
+static int NMRPClosing(void);
+static int NMRPSend(NMRP_REQ_CUSTOM *custom);
+
+int nmrp_server_detected;
+int g_nmrp_config_acked;
+int g_nmrp_close_acked;
+//int g_Listening;
+int g_NMRP_State;
+extern net_ctx_t *netctx;
+
+NET_INFO g_NetInfo;
+//ebuf_t *g_nmrp_txbuf = NULL;
+int g_portal_number;
+NMRP_PARSED_MSG g_nmrpMsg;
+int g_tftp_upgrade_success;
+int g_nmrp_keepalive;//jenny add for fixed NMRP server timeout issue
+unsigned char g_received_packet[1600];
+
+int gpio_control(int gpio, int value);
+extern int32_t _getticks(void); /* return value of CP0 COUNT */
+static unsigned long seed = 1;
+
+void srand(unsigned long local_seed);
+unsigned long rand(void);
+int _start_nmrp(void);
+
+void srand(unsigned long local_seed)
+{
+ seed = local_seed;
+}
+
+unsigned long rand(void)
+{
+
+ long x, hi, lo, t;
+
+ x = seed;
+ hi = x / 127773;
+ lo = x % 127773;
+ t = 16807 * lo - 2836 * hi;
+ if (t <= 0) t += 0x7fffffff;
+ seed = t;
+ return t;
+}
+
+int _start_nmrp (void)
+{
+ uint8_t nmrpproto[2];
+
+ int ret = 0;
+ int ui_cmd_status;
+ int fwUpgrade;
+ int64_t timer;
+ DWORD ipSubnetMask;
+ char buf[512];
+ unsigned char *pIP, *pMask;
+
+ srand( (unsigned long)_getticks());
+
+ //net_init("eth0");
+ nmrpproto[0] = (PROTOSPACE_NMRP >> 8) & 0xFF;
+ nmrpproto[1] = (PROTOSPACE_NMRP & 0xFF);
+ g_tftp_upgrade_success = 0;
+ g_nmrp_keepalive = 0;//jenny add for timeout
+
+ g_portal_number = eth_open(netctx->ethinfo, ETH_PTYPE_DIX, (char*)nmrpproto, nmrp_rx_callback, NULL);
+ if(g_portal_number < 0)
+ {
+ ret = -1;
+ goto _clean_and_exit;
+ }
+
+ eth_gethwaddr(netctx->ethinfo, g_NetInfo.myMac);
+//_retry:
+ g_NMRP_State = NMRP_STATE_LISTEN;
+ nmrp_server_detected = 0;
+ TIMER_SET(timer, NMRP_TIMEOUT_LISTEN*CFE_HZ);
+ while (!TIMER_EXPIRED(timer))
+ {
+ POLL();
+ if(nmrp_server_detected)
+ {
+ xprintf ("find server.\n");
+ break;
+ }
+ }
+
+ if(!nmrp_server_detected)
+ {
+ ret = -1;
+ goto _clean_and_exit;
+ }
+
+ g_nmrp_config_acked = 0;
+
+ if (NMRPConfiguring( g_NetInfo.peerMac, g_NetInfo.myMac, &g_NetInfo.myIp, &ipSubnetMask, &fwUpgrade) == -1)
+ {
+ ret = -1;
+ goto _clean_and_exit;
+ }
+
+ pIP = (unsigned char *)&g_NetInfo.myIp;
+ pMask = (unsigned char *)&ipSubnetMask;
+
+ sprintf(buf, "ifconfig eth0 -addr=%u.%u.%u.%u -mask=%u.%u.%u.%u", *(pIP), *(pIP+1), *(pIP+2), *(pIP+3),
+ *(pMask), *(pMask+1), *(pMask+2), *(pMask+3) );
+ ui_docommand(buf);
+
+
+_retry_tftp:
+
+ NMRPTFTPWaiting();
+ //eth_close(netctx->ethinfo, g_portal_number);
+ //g_portal_number = 0;
+ //net_init("eth0");
+ ui_cmd_status = ui_docommand("tftpd nmrp");
+
+
+ sprintf(buf, "ifconfig eth0 -addr=%u.%u.%u.%u -mask=%u.%u.%u.%u", *(pIP), *(pIP+1), *(pIP+2), *(pIP+3),
+ *(pMask), *(pMask+1), *(pMask+2), *(pMask+3) );
+
+ ui_docommand(buf);
+
+ //net_init("eth0");
+ g_portal_number = eth_open(netctx->ethinfo, ETH_PTYPE_DIX, (char*)nmrpproto, nmrp_rx_callback, NULL);
+
+ if(ui_cmd_status != 0)
+ {
+ goto _retry_tftp;
+ }
+
+ g_nmrp_close_acked = 0;
+ /* Foxconn modified start, zacker,04/07/2008 */
+ /* ui_docommand("nvram erase"); */
+ // nvram_unset("restore_defaults");
+ // nvram_commit();
+ /* Foxconn modified end, zacker,04/07/2008 */
+
+ NMRPClosing();
+ g_tftp_upgrade_success = 1;
+ // gpio_control(7, 1); //turn off power led
+
+_clean_and_exit:
+
+ if(g_portal_number > 0)
+ eth_close(netctx->ethinfo, g_portal_number);
+
+ return ret;
+}
+
+extern void setPowerOnLedOn(void);
+static int nmrp_rx_callback(ebuf_t *buf,void *ref)
+{
+ int pktLen = 0;
+ NMRP_PARSED_MSG nmrpMsg;
+ const ETHER_NMRP_PKT *pkt;
+ unsigned char *p;
+
+ pkt = (const ETHER_NMRP_PKT *)buf->eb_data;
+ pktLen = buf->eb_length + sizeof(ETHER_HDR) - 4;
+
+ p=(unsigned char *)pkt;
+
+ if(g_NMRP_State == NMRP_STATE_LISTEN)
+ {
+ if (IS_NMRP_PKT(pkt, pktLen, &nmrpMsg, NULL) && (*(p+16) == NMRP_CODE_ADVERTISE ) )
+ {
+ if (NMRP_MsgParsing(&(pkt)->nmrpMsg, (pktLen) - sizeof(ETHER_HDR), &nmrpMsg) == NMRP_ERR_NONE)
+ {
+ if(NMRP_MsgGetOpt(&nmrpMsg, NMRP_OPT_MAGIC_NO) != NULL)
+ {
+ memcpy(g_NetInfo.peerMac, buf->eb_data+6, 6);
+ g_NMRP_State = NMRP_STATE_CONFIGURE;
+ nmrp_server_detected = 1;
+ setPowerOnLedOn(); /* Foxconn added for U12H154, turn on TEST LED */
+ }
+ }
+ }
+ }
+ else if(g_NMRP_State == NMRP_STATE_CONFIGURE)
+ {
+ if (IS_NMRP_PKT(pkt, pktLen, &nmrpMsg, NULL) && (*(p+16) == NMRP_CODE_CONF_ACK ) )
+ {
+ memcpy(g_received_packet, pkt, pktLen);
+ pkt = (const ETHER_NMRP_PKT *)g_received_packet;
+ if (NMRP_MsgParsing(&(pkt)->nmrpMsg, (pktLen) - sizeof(ETHER_HDR), &nmrpMsg) == NMRP_ERR_NONE)
+ {
+ if(NMRPConfAckParser(pkt, pktLen, g_NetInfo.peerMac, &nmrpMsg))
+ {
+ g_nmrpMsg = nmrpMsg;
+ g_nmrp_config_acked = 1;
+ g_NMRP_State = NMRP_STATE_TRANSFER;
+ }
+ }
+ }
+ }
+ else if(g_NMRP_State == NMRP_STATE_TRANSFER)
+ {
+ if (IS_NMRP_PKT(pkt, pktLen, &nmrpMsg, NULL) && (*(p+16) == NMRP_CODE_CLOSE_ACK ) )
+ {
+ if (NMRP_MsgParsing(&(pkt)->nmrpMsg, (pktLen) - sizeof(ETHER_HDR), &nmrpMsg) == NMRP_ERR_NONE)
+ {
+ g_NMRP_State =NMRP_STATE_CLOSE;
+ g_nmrp_close_acked = 1;
+ }
+ }
+ }
+
+ return ETH_DROP;
+}
+
+static int NMRP_OptValParsing(NMRP_PARSED_OPT *optParsed, const uint8_t *value)
+{
+ int retVal = NMRP_ERR_NONE;
+
+ switch (optParsed->type) {
+ case NMRP_OPT_MAGIC_NO: /* We require the lenght MUST be correct for the MAGIC-NO option */
+ if (optParsed->len != (NMRP_MIN_OPT_LEN + NMRP_MAGIC_NO_LEN) || memcmp(value, NMRP_MAGIC_NO, NMRP_MAGIC_NO_LEN))
+ {
+ retVal = NMRP_ERR_MSG_INVALID_OPT;
+ }
+ else
+ {
+ optParsed->value.streamVal = value;
+ }
+ break;
+
+ case NMRP_OPT_DEV_IP: /* save the value of IP in the byte stream format, the actual IP is streamVal[0].streamVal[1].streamVal[2].streamVal[3]. */
+ //if ( optParsed->len != (NMRP_MIN_OPT_LEN + 8) || !IsIPAddrValid(ntohl(*(DWORD *) value), ntohl(*(DWORD *) (value + 4))) )
+ if ( optParsed->len != (NMRP_MIN_OPT_LEN + 8) )
+ retVal = NMRP_ERR_MSG_INVALID_OPT;
+ else
+ optParsed->value.streamVal = value;
+ break;
+
+ case NMRP_OPT_FW_UP: /* don't check the length of FW-UP option for future compatibility */
+ break;
+
+ default:
+ retVal = NMRP_ERR_MSG_UNKNOWN_OPT;
+ break;
+ }
+
+ return retVal;
+}
+
+int NMRP_MsgParsing(const NMRP_MSG *pkt, int pktLen, NMRP_PARSED_MSG *msg)
+{
+ if (pktLen < NMRP_HDR_LEN)
+ return NMRP_ERR_MSG_INVALID_LEN;
+
+ msg->code = pkt->code;
+ msg->id = pkt->id;
+
+ if ((msg->length = NTOHCS(pkt->length)) <= pktLen && msg->length >= NMRP_HDR_LEN) {
+ int retVal;
+ uint16_t optLen;
+ NMRP_OPT *opt;
+ NMRP_PARSED_OPT *optParsed;
+
+ opt = (NMRP_OPT *)(((uint8_t *) pkt) + NMRP_HDR_LEN);
+ optParsed = msg->options;
+ msg->numOptions = 0;
+
+ /* use the length indicated in the NMRP header */
+ for (pktLen = msg->length - NMRP_HDR_LEN; pktLen >= NMRP_MIN_OPT_LEN; )
+ {
+ optParsed->type = NTOHCS(opt->type);
+ optParsed->len = optLen = NTOHCS(opt->len);
+
+ if (optParsed->len > pktLen)
+ return NMRP_ERR_MSG_INVALID_OPT;
+
+ if ((retVal = NMRP_OptValParsing(optParsed, &opt->value)) == NMRP_ERR_NONE)
+ {
+ optParsed++;
+
+ if (++msg->numOptions >= NMRP_MAX_OPT_PER_MSG)
+ return NMRP_ERR_MSG_TOO_MANY_OPT;
+ }
+ else if (retVal != NMRP_ERR_MSG_UNKNOWN_OPT)
+ {
+ return NMRP_ERR_MSG_INVALID_OPT;
+ }
+
+ pktLen -= optLen;
+ opt = (NMRP_OPT *)(((uint8_t *) opt) + optLen);
+ }
+ } /* end if the msg->length is larger than the received packet length */
+
+ return pktLen == 0 ? NMRP_ERR_NONE : NMRP_ERR_MSG_INVALID_LEN;
+}
+
+NMRP_PARSED_OPT *NMRP_MsgGetOpt(NMRP_PARSED_MSG *msg, uint16_t optType)
+{
+ NMRP_PARSED_OPT *opt, *optEnd;
+
+ optEnd = &msg->options[msg->numOptions];
+
+ for (opt = msg->options; opt != optEnd; opt++)
+ if (opt->type == optType)
+ break;
+
+ return msg->numOptions == 0 ? NULL : (opt == optEnd ? NULL : opt);
+}
+
+static int NMRPClosing(void)
+{
+ int ret, retries=0;
+ static NMRP_REQ_CUSTOM reqClose = { NMRP_CODE_CLOSE_REQ, "CLOSE-REQ", "CLOSE-ACK", NULL };
+
+ do {
+ ret = NMRPSend(&reqClose);
+ if( !ret)
+ {
+ cfe_sleep(CFE_HZ/2);
+ if(g_nmrp_close_acked)
+ {
+ break;
+ }
+ }
+ } while(++retries <= NMRP_MAX_RETRY_CLOSE);
+
+ return 0;
+}
+
+int NMRPTFTPWaiting(void)
+{
+ static NMRP_REQ_CUSTOM reqTftpUl = { NMRP_CODE_TFTP_UL_REQ, "TFTP-UL-REQ", "TFTP-WRQ", NULL };
+
+ return NMRPSend(&reqTftpUl);
+}
+
+/* Foxconn modify start by Jenny Zhao, 08/07/2008, for fixed timeout issue*/
+int NMRPKeepAlive(void)
+{
+ static NMRP_REQ_CUSTOM reqkeepalive = { NMRP_CODE_KEEP_ALIVE_REQ, "KEEPALIVE_REQ", "KEEPALIVE-ACK", NULL };
+
+ return NMRPSend(&reqkeepalive);
+}
+/* Foxconn modify end by Jenny Zhao, 08/07/2008*/
+
+static int NMRPConfAckParser(const void *pkt, int pktLen, const BYTE *serverMac, void *userData)
+{
+ NMRP_PARSED_MSG *nmrpMsg = (NMRP_PARSED_MSG *) userData;
+
+ return NMRP_MsgGetOpt(nmrpMsg, NMRP_OPT_DEV_IP) != NULL;
+ /*
+ return IS_NMRP_PKT((const ETHER_NMRP_PKT *)pkt, pktLen, nmrpMsg, serverMac) &&
+ nmrpMsg->code == NMRP_CODE_CONF_ACK &&
+ NMRP_MsgGetOpt(nmrpMsg, NMRP_OPT_DEV_IP) != NULL;
+ */
+}
+
+
+static int NMRPConfiguring( const BYTE *serverMac,
+ const BYTE *clientMac,
+ DWORD *ipAddr, DWORD *ipSubnetMask,
+ int *fwUpgrade)
+{
+ //int ret, retries=0;
+ int ret;
+ NMRP_PARSED_OPT *devIp;
+ static NMRP_REQ_CUSTOM reqConf = { NMRP_CODE_CONF_REQ, "CONF-REQ", "CONF-ACK", NMRPConfAckParser };
+
+ do {
+
+ ret = NMRPSend(&reqConf);
+ if( !ret)
+ {
+ cfe_sleep(CFE_HZ/2);
+ if(g_nmrp_config_acked)
+ {
+ break;
+ }
+ }
+
+ //}while(++retries <= NMRP_MAX_RETRY_CLOSE);
+ } while(1);
+
+ if(g_nmrp_config_acked)
+ {
+ devIp = NMRP_MsgGetOpt(&g_nmrpMsg, NMRP_OPT_DEV_IP);
+ *ipAddr = (* (DWORD *) devIp->value.streamVal);
+ *ipSubnetMask = (* (DWORD *) (devIp->value.streamVal + 4));
+ *fwUpgrade = NMRP_MsgGetOpt(&g_nmrpMsg, NMRP_OPT_FW_UP) != NULL;
+ return 0;
+ }
+ return -1;
+}
+
+static int NMRPSend(NMRP_REQ_CUSTOM *custom)
+{
+ ebuf_t *txbuf;
+ NMRP_MSG *msg;
+ unsigned long random_backoff;
+
+ txbuf = eth_alloc(netctx->ethinfo, g_portal_number);
+ if (!txbuf)
+ {
+ return -1;
+ }
+ msg = (NMRP_MSG *)(txbuf->eb_data + 14);
+ msg->reserved = 0;
+ msg->code = custom->reqCode;
+ msg->id = 0;
+ msg->length = HTONCS(NMRP_HDR_LEN); /* header only, no option */
+ txbuf->eb_length = NMRP_HDR_LEN;
+
+ random_backoff = rand();
+ random_backoff = random_backoff % 30;
+ xprintf("%s sent...Waiting for %s...\n", custom->reqName, custom->respName);
+ cfe_sleep(random_backoff);
+ eth_send(txbuf, (uint8_t *)g_NetInfo.peerMac);
+ eth_free(txbuf);
+
+ return 0;
+}
+
diff --git a/cfe/cfe/net/net_nmrp.h b/cfe/cfe/net/net_nmrp.h
new file mode 100755
index 0000000..052ff19
--- /dev/null
+++ b/cfe/cfe/net/net_nmrp.h
@@ -0,0 +1 @@
+int _start_nmrp(void);
diff --git a/cfe/cfe/net/net_tcp.c b/cfe/cfe/net/net_tcp.c
new file mode 100755
index 0000000..377c3c8
--- /dev/null
+++ b/cfe/cfe/net/net_tcp.c
@@ -0,0 +1,2215 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * TCP Protocol File: net_tcp.c
+ *
+ * This file contains a very simple TCP. The basic goals of this
+ * tcp are to be "good enough for firmware." We try to be
+ * correct in our protocol implementation, but not very fancy.
+ * In particular, we don't deal with out-of-order segments,
+ * we don't hesitate to copy data more then necessary, etc.
+ * We strive to implement important protocol features
+ * like slow start, nagle, etc., but even these things are
+ * subsetted and simplified as much as possible.
+ *
+ * Current "todo" list:
+ * slow start
+ * good testing of retransmissions,
+ * round-trip delay calculations
+ * Process received TCP options, particularly segment size
+ * Ignore urgent data (remove from datastream)
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "net_ebuf.h"
+#include "net_ether.h"
+
+#include "net_ip.h"
+#include "net_ip_internal.h"
+
+#include "cfe_timer.h"
+
+#include "cfe_error.h"
+
+#include "net_tcpbuf.h"
+#include "net_tcp_internal.h"
+#include "net_tcp.h"
+
+/* *********************************************************************
+ * Config
+ ********************************************************************* */
+
+//#define _TCP_DEBUG_
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+struct tcp_info_s {
+ void *ti_ref; /* ref data for IP layer */
+ ip_info_t *ti_ipinfo; /* IP layer handle */
+ cfe_timer_t ti_fasttimer; /* 200ms timer */
+ queue_t ti_tcblist; /* list of known TCBs */
+ int ti_onqueue; /* number of TCBs on queue */
+ uint32_t ti_iss; /* initial sequence number */
+ tcb_t *ti_ports[TCP_MAX_PORTS]; /* table of active sockets */
+};
+
+/* *********************************************************************
+ * Forward Declarations
+ ********************************************************************* */
+
+static void _tcp_protosend(tcp_info_t *ti,tcb_t *tcb);
+static int _tcp_rx_callback(void *ref,ebuf_t *buf,uint8_t *destaddr,uint8_t *srcaddr);
+static void _tcp_output(tcp_info_t *ti,tcb_t *tcb);
+static void _tcp_aborttcb(tcp_info_t *ti,tcb_t *tcb);
+static void _tcp_closetcb(tcp_info_t *ti,tcb_t *tcb);
+static tcb_t *_tcp_find_lclport(tcp_info_t *ti,uint16_t port);
+static void _tcp_freetcb(tcp_info_t *ti,tcb_t *tcb);
+static void _tcp_sendctlmsg(tcp_info_t *ti,tcb_t *tcb,uint16_t flags,int timeout);
+
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#ifdef _TCP_DEBUG_
+#define _tcp_setstate(tcb,state) (tcb)->tcb_state = (state); \
+ printf("tcp state = " #state "\n");
+#define DEBUGMSG(x) printf x
+#else
+#define _tcp_setstate(tcb,state) (tcb)->tcb_state = (state);
+#define DEBUGMSG(x)
+#endif
+
+#define _tcp_preparectlmsg(tcb,flags) (tcb)->tcb_txflags = (flags) ; \
+ (tcb)->tcb_flags |= TCB_FLG_SENDMSG;
+
+#define _tcp_canceltimers(tcb) \
+ TIMER_CLEAR((tcb)->tcb_timer_retx); \
+ TIMER_CLEAR((tcb)->tcb_timer_keep); \
+ TIMER_CLEAR((tcb)->tcb_timer_2msl); \
+ TIMER_CLEAR((tcb)->tcb_timer_pers);
+
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+#ifdef _TCP_DEBUG_
+int _tcp_dumpflags = 1;
+#else
+int _tcp_dumpflags = 0;
+#endif
+
+/* *********************************************************************
+ * _tcp_init(ipi,ref)
+ *
+ * Initialize the TCP module. We set up our data structures
+ * and register ourselves with the IP layer.
+ *
+ * Input parameters:
+ * ipi - IP information
+ * ref - will be passed back to IP as needed
+ *
+ * Return value:
+ * tcp_info_t structure, or NULL if problems
+ ********************************************************************* */
+
+tcp_info_t *_tcp_init(ip_info_t *ipi,void *ref)
+{
+ tcp_info_t *ti;
+ int idx;
+
+ ti = (tcp_info_t *) KMALLOC(sizeof(tcp_info_t),0);
+ if (!ti) return NULL;
+
+ ti->ti_ref = ref;
+ ti->ti_ipinfo = ipi;
+
+ /*
+ * Start the "fast" timer
+ */
+
+ TIMER_SET(ti->ti_fasttimer,TCP_FAST_TIMER);
+
+ /*
+ * Initialize the TCB list
+ */
+
+ q_init(&(ti->ti_tcblist));
+
+ for (idx = 0; idx < TCP_MAX_PORTS; idx++) {
+ ti->ti_ports[idx] = NULL;
+ }
+
+ ti->ti_onqueue = 0;
+
+ /*
+ * Set up the initial sequence number
+ */
+
+ extern int32_t _getticks(void); /* return value of CP0 COUNT */
+ ti->ti_iss = (uint32_t) _getticks(); /* XXX nonportable */
+
+ /*
+ * Register our protocol with IP
+ */
+
+ _ip_register(ipi,IPPROTO_TCP,_tcp_rx_callback,ti);
+
+ return ti;
+}
+
+
+/* *********************************************************************
+ * _tcp_uninit(info)
+ *
+ * De-initialize the TCP layer, unregistering from the IP layer.
+ *
+ * Input parameters:
+ * info - our tcp_info_t, from _tcp_init()
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void _tcp_uninit(tcp_info_t *info)
+{
+ tcb_t *tcb;
+
+ /*
+ * Destroy all allocated TCBs, forcefully.
+ */
+
+ while (!q_isempty(&(info->ti_tcblist))) {
+ tcb = (tcb_t *) q_getfirst(&(info->ti_tcblist));
+ /* tcp_freetcb removes tcb from the queue */
+ _tcp_freetcb(info,tcb);
+ }
+
+ /*
+ * Deregister with IP
+ */
+
+ _ip_deregister(info->ti_ipinfo,IPPROTO_TCP);
+
+ /*
+ * Free up the info structure
+ */
+
+ KFREE(info);
+}
+
+
+/* *********************************************************************
+ * _tcp_freetcb(ti,tcb)
+ *
+ * Called when the TIME_WAIT timer expires, we use this to
+ * free up the TCB for good.
+ *
+ * Input parameters:
+ * ti - tcp information
+ * tcb - tcb to free
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void _tcp_freetcb(tcp_info_t *ti,tcb_t *tcb)
+{
+ /*
+ * Undo socket number
+ */
+
+ if (tcb->tcb_socknum >= 0) ti->ti_ports[tcb->tcb_socknum] = NULL;
+ tcb->tcb_socknum = -1;
+
+ /*
+ * Remove from queue
+ */
+
+ ti->ti_onqueue--;
+ q_dequeue(&(tcb->tcb_qb));
+
+ /*
+ * Free buffers (could probably be done in tcb_destroy)
+ */
+
+ tmb_free(&(tcb->tcb_txbuf));
+ tmb_free(&(tcb->tcb_rxbuf));
+
+ /*
+ * Free the TCB
+ */
+
+ KFREE(tcb);
+
+}
+
+/* *********************************************************************
+ * _tcp_socket(info)
+ *
+ * Create a new tcp socket (a new tcb structure is allocated
+ * and entered into the socket table)
+ *
+ * Input parameters:
+ * info - tcp information
+ *
+ * Return value:
+ * new socket number, or <0 if an error occured
+ ********************************************************************* */
+
+int _tcp_socket(tcp_info_t *info)
+{
+ int idx;
+ tcb_t *tcb;
+
+ /*
+ * Find an empty slot.
+ */
+
+ for (idx = 0; idx < TCP_MAX_PORTS; idx++) {
+ if (!info->ti_ports[idx]) break;
+ }
+
+ if (idx == TCP_MAX_PORTS) {
+ return CFE_ERR_NOHANDLES;
+ }
+
+ /*
+ * See if we can create another TCB
+ */
+
+ if (info->ti_onqueue >= TCP_MAX_TCBS) return CFE_ERR_NOMEM;
+
+ /*
+ * Allocate data structures
+ */
+
+ tcb = KMALLOC(sizeof(tcb_t),0);
+ if (!tcb) return CFE_ERR_NOMEM;
+
+ memset(tcb,0,sizeof(tcb_t));
+
+ if (tmb_alloc(&tcb->tcb_txbuf,TCP_BUF_SIZE) < 0) goto error;
+ if (tmb_alloc(&tcb->tcb_rxbuf,TCP_BUF_SIZE) < 0) goto error;
+
+ /*
+ * XXX Temp: our MTU is always 1400. We could/should
+ * XXX get this from the lower layer.
+ */
+
+ tcb->tcb_mtu = 1400;
+
+ /*
+ * Default socket flags
+ */
+
+ tcb->tcb_sockflags = TCPFLG_NBIO;
+
+ /*
+ * Set up initial state. Find an empty port number.
+ * note that the way we do this is pretty gruesome, but it will
+ * work for our small TCP, where the number of TCBs outstanding
+ * will be very small compared to the port number space.
+ *
+ * Try to look up the port number we want - if we find it, increment
+ * it and try again until we find an unused one.
+ * Stay away from ports 0..1023.
+ */
+
+ _tcp_setstate(tcb,TCPSTATE_CLOSED);
+ tcb->tcb_lclport = (uint16_t) (((uint16_t) cfe_ticks) + 1024);
+
+ while (_tcp_find_lclport(info,tcb->tcb_lclport) != NULL) {
+ tcb->tcb_lclport++;
+ if (tcb->tcb_lclport == 0) tcb->tcb_lclport = 1024;
+ }
+
+ /*
+ * Remember this socket in the table
+ */
+
+ info->ti_ports[idx] = tcb;
+ tcb->tcb_socknum = idx;
+
+ info->ti_onqueue++;
+ q_enqueue(&(info->ti_tcblist),&(tcb->tcb_qb));
+
+ return idx;
+
+error:
+ tmb_free(&(tcb->tcb_txbuf));
+ tmb_free(&(tcb->tcb_rxbuf));
+ KFREE(tcb);
+ return CFE_ERR_NOMEM;
+}
+
+
+/* *********************************************************************
+ * _tcp_connect(ti,s,dest,port)
+ *
+ * Connect a socket to a remote port.
+ *
+ * Input parameters:
+ * ti - TCP information
+ * s - socket number, allocated via _tcp_create
+ * dest - destination IP address
+ * port - destination port number
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int _tcp_connect(tcp_info_t *ti,int s,uint8_t *dest,uint16_t port)
+{
+ tcb_t *tcb;
+
+ tcb = ti->ti_ports[s];
+ if (!tcb) return CFE_ERR_INV_PARAM;
+
+ memcpy(tcb->tcb_peeraddr,dest,IP_ADDR_LEN);
+ tcb->tcb_peerport = port;
+
+ tcb->tcb_rcvnext = 0;
+ tcb->tcb_rcvack = 0;
+
+ tcb->tcb_sendnext = ti->ti_iss;
+ tcb->tcb_sendunack = ti->ti_iss;
+ tcb->tcb_sendwindow = 0;
+
+ tmb_init(&tcb->tcb_txbuf);
+ tmb_init(&tcb->tcb_rxbuf);
+
+ TIMER_SET(tcb->tcb_timer_keep,TCP_KEEPALIVE_TIMER);
+ _tcp_setstate(tcb,TCPSTATE_SYN_SENT);
+
+ _tcp_sendctlmsg(ti,tcb,TCPFLG_SYN,TCP_RETX_TIMER);
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * _tcp_close(ti,s)
+ *
+ * Disconnect a TCP socket nicely. Sends a FIN packet to get
+ * us into the disconnect state.
+ *
+ * Input parameters:
+ * ti - tcp information
+ * s - socket number
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int _tcp_close(tcp_info_t *ti,int s)
+{
+ tcb_t *tcb;
+
+ tcb = ti->ti_ports[s];
+ if (!tcb) return CFE_ERR_INV_PARAM;
+
+#if defined(CONFIG_MIPS_BRCM)
+ /*
+ * Flush output data.
+ */
+
+ _tcp_output(ti,tcb);
+#endif
+
+ /*
+ * Reclaim this socket number for future use
+ */
+
+ ti->ti_ports[s] = NULL;
+ tcb->tcb_socknum = -1;
+
+ /*
+ * Decide what action to take based on current state
+ */
+
+ switch (tcb->tcb_state) {
+ case TCPSTATE_SYN_RECEIVED:
+ case TCPSTATE_ESTABLISHED:
+ /*
+ * Transmit the FIN/ACK and wait for a FIN/ACK.
+ *
+ * XXX probably want to wait till all unacked data is
+ * acked before sending the fin?? This would be sort
+ * of like the "linger" option
+ */
+ _tcp_setstate(tcb,TCPSTATE_FINWAIT_1);
+ _tcp_sendctlmsg(ti,tcb,TCPFLG_ACK | TCPFLG_FIN,TCP_RETX_TIMER);
+ break;
+
+ case TCPSTATE_CLOSED:
+ case TCPSTATE_LISTEN:
+ case TCPSTATE_SYN_SENT:
+ /*
+ * Disconnect during our attempt, or from some
+ * idle state that does not require sending anything.
+ * Go back to CLOSED.
+ */
+ _tcp_closetcb(ti,tcb);
+ _tcp_freetcb(ti,tcb);
+ break;
+
+ case TCPSTATE_CLOSE_WAIT:
+ _tcp_setstate(tcb,TCPSTATE_LAST_ACK);
+ _tcp_sendctlmsg(ti,tcb,TCPFLG_ACK | TCPFLG_FIN,TCP_RETX_TIMER);
+ break;
+
+ case TCPSTATE_TIME_WAIT:
+ case TCPSTATE_FINWAIT_1:
+ case TCPSTATE_FINWAIT_2:
+ case TCPSTATE_CLOSING:
+ case TCPSTATE_LAST_ACK:
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+
+
+/* *********************************************************************
+ * _tcp_aborttcb(ti,tcb)
+ *
+ * Forcefully terminate a TCP connection. Sends an RST packet
+ * to nuke the other end. The socket is forced into the CLOSED
+ * state.
+ *
+ * Input parameters:
+ * ti - tcp information
+ * tcb -tcb to abort
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void _tcp_aborttcb(tcp_info_t *ti,tcb_t *tcb)
+{
+ DEBUGMSG(("tcp_abort from state %d\n",tcb->tcb_state));
+
+ /*
+ * Decide what action to take based on current state
+ * If we're in SYN_SENT, RECEIVED, ESTABLISHED, FINWAIT_1,
+ * FINWAIT_2, CLOSING, LAST_ACK, or CLOSE_WAIT we've sent
+ * some traffic on this TCB, so send an RST to kill off
+ * the remote TCB.
+ */
+
+ if (TCPSTATE_IN_SET(tcb->tcb_state,M_TCPSTATE_ABORTSTATES)) {
+ /* Send RST with no timeout, don't retransmit it. */
+ _tcp_canceltimers(tcb);
+ _tcp_sendctlmsg(ti,tcb,TCPFLG_ACK | TCPFLG_RST,0);
+ }
+
+ /*
+ * No matter what, it's now CLOSED.
+ */
+
+ _tcp_closetcb(ti,tcb);
+
+}
+
+
+/* *********************************************************************
+ * _tcp_closetcb(ti,tcb)
+ *
+ * Close a TCB, switching the state to "closed" and resetting
+ * internal variables. The TCB is *not* freed.
+ *
+ * Input parameters:
+ * ti - tcp information
+ * tcb - tcb to close
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void _tcp_closetcb(tcp_info_t *ti,tcb_t *tcb)
+{
+ /*
+ * Set state to "closed" and reset timers
+ */
+
+ _tcp_setstate(tcb,TCPSTATE_CLOSED);
+ tcb->tcb_flags = 0;
+ _tcp_canceltimers(tcb);
+
+ /*
+ * Reinitialize the buffers to waste the stored send data and
+ * clear out any receive data
+ */
+
+ tmb_init(&tcb->tcb_txbuf);
+ tmb_init(&tcb->tcb_rxbuf);
+}
+
+/* *********************************************************************
+ * _tcp_send(ti,s,buf,len)
+ *
+ * Queue some data to be transmitted via a TCP socket
+ *
+ * Input parameters:
+ * ti - TCP information
+ * s - socket number
+ * buf - buffer of data to send
+ * len - size of buffer to send
+ *
+ * Return value:
+ * number of bytes queued
+ * <0 if an error occured
+ ********************************************************************* */
+
+int _tcp_send(tcp_info_t *ti,int s,uint8_t *buf,int len)
+{
+ tcb_t *tcb;
+ int retlen;
+ int curlen;
+
+ tcb = ti->ti_ports[s];
+ if (!tcb) return CFE_ERR_INV_PARAM;
+
+ /*
+ * State must be ESTABLISHED or CLOSE_WAIT. CLOSE_WAIT
+ * means we've received a fin, but we can still send in
+ * the outbound direction.
+ */
+
+ if (!TCPSTATE_IN_SET(tcb->tcb_state,M_TCPSTATE_SEND_OK)) {
+ return CFE_ERR_NOTCONN;
+ }
+
+ /*
+ * Copy the user data into the transmit buffer.
+ */
+
+ curlen = tmb_curlen(&(tcb->tcb_txbuf));
+ retlen = tmb_copyin(&(tcb->tcb_txbuf),buf,len,TRUE);
+
+ /*
+ * Cause some output on the device.
+ */
+
+ /*
+ * Nagle: Call _tcp_output only if there is no outstanding
+ * unacknowledged data. The way our transmit buffer
+ * works, it only holds unacknowledged data, so this
+ * test is easy. It isn't really 100% correct to
+ * do it this way, but the effect is the same; we will
+ * not transmit tinygrams.
+ */
+
+ if ((curlen == 0) || (tcb->tcb_sockflags & TCPFLG_NODELAY)) {
+ _tcp_output(ti,tcb);
+ }
+
+ return retlen;
+}
+
+/* *********************************************************************
+ * _tcp_recv(ti,s,buf,len)
+ *
+ * Get buffered receive data from the TCP socket
+ *
+ * Input parameters:
+ * ti - tcp information
+ * s - socket number
+ * buf - pointer to receive buffer area
+ * len - size of receive buffer area
+ *
+ * Return value:
+ * number of bytes received
+ * <0 if an error occured
+ * ==0 if no data available (or tcp session is closed)
+ ********************************************************************* */
+
+int _tcp_recv(tcp_info_t *ti,int s,uint8_t *buf,int len)
+{
+ tcb_t *tcb;
+ int retlen;
+
+ tcb = ti->ti_ports[s];
+ if (!tcb) return CFE_ERR_INV_PARAM;
+
+ if (!TCPSTATE_IN_SET(tcb->tcb_state,M_TCPSTATE_RECV_OK)) {
+ return CFE_ERR_NOTCONN;
+ }
+
+ retlen = tmb_copyout(&(tcb->tcb_rxbuf),buf,len,TRUE);
+
+ /*
+ * If we've drained all of the data out of the buffer
+ * send an ack. This isn't ideal, but it will
+ * prevent us from keeping the window closed.
+ */
+
+// if (retlen && (tmb_curlen(&(tcb->tcb_rxbuf)) == 0)) {
+// _tcp_preparectlmsg(tcb,TCPFLG_ACK);
+// _tcp_protosend(ti,tcb);
+// tcb->tcb_flags &= ~TCB_FLG_DLYACK;
+// }
+
+ return retlen;
+}
+
+
+/* *********************************************************************
+ * _tcp_bind(ti,s,port)
+ *
+ * "bind" a TCP socket to a particular port - this sets the
+ * outbound local (source) port number.
+ *
+ * Input parameters:
+ * ti - tcp information
+ * s - socket number
+ * port - port number
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int _tcp_bind(tcp_info_t *ti,int s,uint16_t port)
+{
+ tcb_t *tcb;
+
+ tcb = ti->ti_ports[s];
+ if (!tcb) return CFE_ERR_INV_PARAM;
+
+ /* XXX test state - must be in 'closed' */
+
+ if (_tcp_find_lclport(ti,port)) return CFE_ERR_ADDRINUSE;
+
+ tcb->tcb_lclport = port;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * _tcp_setflags(ti,s,flags)
+ *
+ * Set per-socket flags.
+ *
+ * Input parameters:
+ * ti - tcp information
+ * s - socket number
+ * flags - flags to set
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int _tcp_setflags(tcp_info_t *ti,int s,unsigned int flags)
+{
+ tcb_t *tcb;
+
+ tcb = ti->ti_ports[s];
+ if (!tcb) return CFE_ERR_INV_PARAM;
+
+ tcb->tcb_sockflags = flags;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * _tcp_getflags(ti,s,flags)
+ *
+ * Get per-socket flags.
+ *
+ * Input parameters:
+ * ti - tcp information
+ * s - socket number
+ * flags - pointer to int to receive flags
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int _tcp_getflags(tcp_info_t *ti,int s,unsigned int *flags)
+{
+ tcb_t *tcb;
+
+ tcb = ti->ti_ports[s];
+ if (!tcb) return CFE_ERR_INV_PARAM;
+
+ *flags = tcb->tcb_sockflags;
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * _tcp_peeraddr(ti,s,addr,port)
+ *
+ * Return the address of the computer on the other end of this
+ * connection.
+ *
+ * Input parameters:
+ * ti - tcp information
+ * s - socket number
+ * addr - receives IP address of remote
+ * port - port number
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int _tcp_peeraddr(tcp_info_t *ti,int s,uint8_t *addr,uint16_t *port)
+{
+ tcb_t *tcb;
+
+ tcb = ti->ti_ports[s];
+ if (!tcb) return CFE_ERR_INV_PARAM;
+
+ /*
+ * Test for any of the states where we believe the peeraddr in the tcb
+ * is valid.
+ */
+
+ if (!TCPSTATE_IN_SET(tcb->tcb_state,M_TCPSTATE_PEERADDR_OK)) {
+ return CFE_ERR_NOTCONN;
+ }
+
+ if (addr) memcpy(addr,tcb->tcb_peeraddr,IP_ADDR_LEN);
+ if (port) *port = tcb->tcb_peerport;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * _tcp_listen(ti,s,port)
+ *
+ * Set a socket for listening mode, allowing inbound connections
+ * to occur.
+ *
+ * Input parameters:
+ * ti - tcp information
+ * s - socket nunber
+ * port - port number to listen for (implicit tcp_bind)
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int _tcp_listen(tcp_info_t *ti,int s,uint16_t port)
+{
+ tcb_t *tcb;
+ queue_t *qb;
+
+ /*
+ * See if another TCB is listening to this port
+ */
+
+ for (qb = ti->ti_tcblist.q_next; qb != &(ti->ti_tcblist); qb = qb->q_next) {
+ tcb = (tcb_t *) qb;
+
+ if ((tcb->tcb_lclport == port) &&
+ (tcb->tcb_state == TCPSTATE_LISTEN) &&
+ (tcb->tcb_peerport == 0)) return CFE_ERR_ADDRINUSE;
+
+ }
+
+ /*
+ * Otherwise, we're good to go.
+ */
+
+ tcb = ti->ti_ports[s];
+ if (!tcb) return CFE_ERR_INV_PARAM;
+
+ tcb->tcb_lclport = port;
+ _tcp_setstate(tcb,TCPSTATE_LISTEN);
+
+ tcb->tcb_sendnext = 0;
+ tcb->tcb_sendunack = 0;
+ tcb->tcb_sendwindow = 0;
+ _tcp_canceltimers(tcb);
+
+ tcb->tcb_rcvnext = 0;
+ tcb->tcb_rcvack = 0;
+
+ tmb_init(&tcb->tcb_txbuf);
+ tmb_init(&tcb->tcb_rxbuf);
+
+ tcb->tcb_txflags = 0;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * _tcp_status(ti,s,connflag,rxready,rxeof)
+ *
+ * Get status information about the TCP session
+ *
+ * Input parameters:
+ * ti - tcp information
+ * s - socket nunber
+ * connflag - points to an int to receive connection status
+ * (1=connected,0=not connected)
+ * rxready - number of bytes in receive queue
+ * rxeof - returns 1 if we've been FINed.
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int _tcp_status(tcp_info_t *ti,int s,unsigned int *connflag,int *rxready,int *rxeof)
+{
+ tcb_t *tcb;
+ int rxlen;
+
+ tcb = ti->ti_ports[s];
+ if (!tcb) return CFE_ERR_INV_PARAM;
+
+ rxlen = tmb_curlen(&(tcb->tcb_rxbuf));
+
+ /*
+ * We consider the connection "connected" if it's established
+ * or it's in CLOSE_WAIT (FIN received) but we have not drained
+ * all of the receive data.
+ *
+ * Otherwise: If it's not in one of the connection establishment states,
+ * it's not connected.
+ */
+
+ if (connflag) {
+ if ((tcb->tcb_state == TCPSTATE_ESTABLISHED) ||
+ ((rxlen != 0) && (tcb->tcb_state == TCPSTATE_CLOSE_WAIT))) {
+ *connflag = TCPSTATUS_CONNECTED;
+ }
+ else if (TCPSTATE_IN_SET(tcb->tcb_state,M_TCPSTATE_CONNINPROGRESS)) {
+ *connflag = TCPSTATUS_CONNECTING;
+ }
+ else {
+ *connflag = TCPSTATUS_NOTCONN;
+ }
+ }
+
+ if (rxready) {
+ *rxready = rxlen;
+ }
+
+ if (rxeof) {
+ *rxeof = 0;
+ if ((tcb->tcb_state == TCPSTATE_CLOSE_WAIT) ||
+ (tcb->tcb_state == TCPSTATE_LAST_ACK)) {
+ *rxeof = 1;
+ }
+ }
+
+ return 0;
+}
+
+/* *********************************************************************
+ * _tcp_debug(ti,s,arg)
+ *
+ * Perform debug functions on a socket
+ *
+ * Input parameters:
+ * ti - tcp information
+ * s - socket number
+ * arg - argument
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int _tcp_debug(tcp_info_t *ti,int s,int arg)
+{
+ tcb_t *tcb;
+
+ tcb = ti->ti_ports[s];
+ if (!tcb) return CFE_ERR_INV_PARAM;
+
+ printf("State=%d SendNext=%u SendUnack=%u ",
+ tcb->tcb_state,tcb->tcb_sendnext,tcb->tcb_sendunack);
+ printf("SendWin=%d Ack=%u Rxlen=%d\n",
+ tcb->tcb_sendwindow,
+ tcb->tcb_rcvack,tmb_curlen(&(tcb->tcb_rxbuf)));
+
+ return 0;
+}
+
+
+#ifdef _TCP_DEBUG_
+/* *********************************************************************
+ * _tcp_dumppktstate(label,flags,ack,seq,len)
+ *
+ * A debug function.
+ *
+ * Input parameters:
+ * label - printed before packet state
+ * flags - transmit flags for packet
+ * ack,seq,len - from the packet
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+static void _tcp_dumppktstate(char *label,uint16_t flags,
+ uint32_t ack,uint32_t seq,int len)
+{
+ printf("%s: ",label);
+ if (flags & TCPFLG_FIN) printf("FIN ");
+ if (flags & TCPFLG_SYN) printf("SYN ");
+ if (flags & TCPFLG_RST) printf("RST ");
+ if (flags & TCPFLG_PSH) printf("PSH ");
+ if (flags & TCPFLG_ACK) printf("ACK ");
+ if (flags & TCPFLG_URG) printf("URG ");
+ printf("Ack=%u Seq=%u Data=%d\n",ack,seq,len);
+}
+#endif
+
+
+/* *********************************************************************
+ * _tcp_output(ti,tcb)
+ *
+ * Try to perform some output on this TCB. If there is
+ * data to send and we can transmit it (i.e., the remote's
+ * receive window will allow it), segment the data from the
+ * buffer and transmit it, updating local state variables.
+ *
+ * Input parameters:
+ * ti - tcp information
+ * tcb - the tcb to send data on
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void _tcp_output(tcp_info_t *ti,tcb_t *tcb)
+{
+ ebuf_t *b;
+ int tcplen;
+ int window;
+ uint16_t flags;
+ uint8_t *cksumptr;
+ uint8_t *tcphdr;
+ uint16_t cksum;
+ int hdrlen;
+ uint8_t pseudoheader[12];
+ int offset;
+ uint32_t sendmax;
+ uint32_t windowmax;
+ uint32_t cwndmax;
+
+ /*
+ * sendmax is (one plus) the highest sequence number we have
+ * data for.
+ *
+ * windowmax is (one plus) the highest sequence number in the
+ * send window.
+ *
+ * cwndmax is (one plus) the highest sequence number in the
+ * congestion window.
+ */
+
+ sendmax = tcb->tcb_sendunack + tmb_curlen(&(tcb->tcb_txbuf));
+ windowmax = tcb->tcb_sendunack + tcb->tcb_sendwindow;
+ cwndmax = tcb->tcb_sendunack + 5*1400;
+
+ /*
+ * We'll send up to 'sendmax', 'cwndmax', or 'windowmax' bytes, whichever
+ * is sooner. Set 'sendmax' to the earliest sequence number.
+ */
+
+ if (TCPSEQ_GT(sendmax,windowmax)) sendmax = windowmax;
+ if (TCPSEQ_GT(sendmax,cwndmax)) sendmax = cwndmax;
+
+ /*
+ * The (receive) window is whatever it takes to fill the buffer.
+ */
+
+ window = tmb_remlen(&(tcb->tcb_rxbuf));
+ if (window > 65000) window = 65000;
+
+ /*
+ * Spit out packets until "sendnext" either catches up
+ * or exceeds the remote window
+ */
+
+ while (TCPSEQ_LT(tcb->tcb_sendnext,sendmax)) {
+
+ /*
+ * This is the offset into the transmit buffer to start with.
+ * Offset 0 in the transmit buffer corresponds to "send unack"
+ * received acks move this pointer.
+ */
+
+ offset = tcb->tcb_sendnext - tcb->tcb_sendunack;
+
+ /*
+ * Allocate a buffer and remember the pointer to where
+ * the header starts.
+ */
+
+ b = _ip_alloc(ti->ti_ipinfo);
+ if (!b) break;
+
+ tcphdr = ebuf_ptr(b) + ebuf_length(b);
+
+ flags = TCPFLG_ACK | TCPHDRFLG(TCP_HDR_LENGTH);
+ hdrlen = TCP_HDR_LENGTH;
+
+ /*
+ * Fill in the fields according to the RFC.
+ */
+
+ tcb->tcb_rcvack = tcb->tcb_rcvnext; /* Update our "most recent ack" */
+
+ ebuf_append_u16_be(b,tcb->tcb_lclport); /* Local and remote ports */
+ ebuf_append_u16_be(b,tcb->tcb_peerport);
+ ebuf_append_u32_be(b,tcb->tcb_sendnext); /* sequence and ack numbers */
+ ebuf_append_u32_be(b,tcb->tcb_rcvack);
+ ebuf_append_u16_be(b,flags); /* Flags */
+ ebuf_append_u16_be(b,window); /* Window size */
+ cksumptr = ebuf_ptr(b) + ebuf_length(b);
+ ebuf_append_u16_be(b,0); /* dummy checksum for calculation */
+ ebuf_append_u16_be(b,0); /* Urgent Pointer (not used) */
+
+ /*
+ * Append the data, copying pieces out of the transmit buffer
+ * without adjusting its pointers.
+ */
+
+ tcplen = tmb_copyout2(&(tcb->tcb_txbuf),
+ b->eb_ptr + b->eb_length,
+ offset,
+ tcb->tcb_mtu);
+
+ b->eb_length += tcplen;
+
+#ifdef _TCP_DEBUG_
+ if (_tcp_dumpflags) _tcp_dumppktstate("TX_DATA",flags,
+ tcb->tcb_sendnext,
+ tcb->tcb_rcvack,tcplen);
+#endif
+
+ /*
+ * Adjust the "send next" sequence number to account for what
+ * we're about to send.
+ */
+
+ tcb->tcb_sendnext += tcplen;
+
+
+ /*
+ * Build the pseudoheader, which is part of the checksum calculation
+ */
+
+ _ip_getaddr(ti->ti_ipinfo,&pseudoheader[0]);
+ memcpy(&pseudoheader[4],tcb->tcb_peeraddr,IP_ADDR_LEN);
+ pseudoheader[8] = 0;
+ pseudoheader[9] = IPPROTO_TCP;
+ pseudoheader[10] = ((tcplen+hdrlen) >> 8) & 0xFF;
+ pseudoheader[11] = ((tcplen+hdrlen) & 0xFF);
+
+ /*
+ * Checksum the packet and insert the checksum into the header
+ */
+
+ cksum = ip_chksum(0,pseudoheader,sizeof(pseudoheader));
+ cksum = ip_chksum(cksum,tcphdr,tcplen + hdrlen);
+ cksum = ~cksum;
+ cksumptr[0] = (cksum >> 8) & 0xFF;
+ cksumptr[1] = (cksum & 0xFF);
+
+ /*
+ * Transmit the packet. The layer below us will free it.
+ */
+
+ _ip_send(ti->ti_ipinfo,b,tcb->tcb_peeraddr,IPPROTO_TCP);
+
+ /*
+ * Set the timer that we'll use to wait for an acknowledgement.
+ * If this timer goes off, we'll rewind "sendnext" back to
+ * "sendunack" and transmit stuff again.
+ */
+
+ TIMER_SET(tcb->tcb_timer_retx,TCP_RETX_TIMER);
+
+ /*
+ * We just sent an ack, so cancel the delayed ack timer.
+ */
+
+ tcb->tcb_flags &= ~TCB_FLG_DLYACK;
+
+ }
+
+}
+
+/* *********************************************************************
+ * _tcp_protosend(ti,tcb)
+ *
+ * Transmit "protocol messages" on the tcb. This is used for
+ * sending SYN, FIN, ACK, and other control packets.
+ *
+ * Input parameters:
+ * ti - tcp infomration
+ * tcb - tcb we're interested in
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void _tcp_protosend(tcp_info_t *ti,tcb_t *tcb)
+{
+ ebuf_t *b;
+ int tcplen;
+ int window;
+ uint16_t flags;
+ uint8_t *cksumptr;
+ uint8_t *tcphdr;
+ uint16_t cksum;
+ int hdrlen;
+ uint8_t pseudoheader[12];
+
+ /*
+ * Allocate a buffer and remember the pointer to where
+ * the header starts.
+ */
+
+ b = _ip_alloc(ti->ti_ipinfo);
+ if (!b) return;
+
+ tcphdr = ebuf_ptr(b) + ebuf_length(b);
+
+ /*
+ * We're going to send something, so we can clear the flag.
+ * Also clear the delay-ack flag since everything's an ack.
+ */
+
+ tcb->tcb_flags &= ~(TCB_FLG_SENDMSG | TCB_FLG_DLYACK);
+
+ /*
+ * Build the TCP header
+ */
+
+ /* The flags are the current flags + the header length */
+ if (tcb->tcb_txflags & TCPFLG_SYN) {
+ flags = tcb->tcb_txflags | (TCPHDRFLG(TCP_HDR_LENGTH + 4));
+ hdrlen = TCP_HDR_LENGTH + 4;
+ }
+ else {
+ flags = tcb->tcb_txflags | (TCPHDRFLG(TCP_HDR_LENGTH));
+ hdrlen = TCP_HDR_LENGTH;
+ }
+
+
+#ifdef _TCP_DEBUG_
+ if (_tcp_dumpflags) _tcp_dumppktstate("TX_CTL",flags,
+ tcb->tcb_sendnext,
+ tcb->tcb_rcvack,0);
+#endif
+
+ /*
+ * The (receive) window is whatever it takes to fill the buffer.
+ */
+
+ window = tmb_remlen(&(tcb->tcb_rxbuf));
+ if (window > 65000) window = 65000;
+
+ /*
+ * Fill in the fields according to the RFC.
+ */
+
+ tcb->tcb_rcvack = tcb->tcb_rcvnext; /* update last tx ack */
+
+ ebuf_append_u16_be(b,tcb->tcb_lclport); /* Local and remote ports */
+ ebuf_append_u16_be(b,tcb->tcb_peerport);
+ ebuf_append_u32_be(b,tcb->tcb_sendnext); /* sequence and ack numbers */
+ ebuf_append_u32_be(b,tcb->tcb_rcvack);
+ ebuf_append_u16_be(b,flags); /* Flags */
+ ebuf_append_u16_be(b,window); /* Window size */
+ cksumptr = ebuf_ptr(b) + ebuf_length(b);
+ ebuf_append_u16_be(b,0); /* dummy checksum for calculation */
+ ebuf_append_u16_be(b,0); /* Urgent Pointer (not used) */
+
+ /*
+ * Append TCP options on SYN packet
+ */
+
+ if (flags & TCPFLG_SYN) {
+ ebuf_append_u16_be(b,TCP_MAX_SEG_OPT);
+ ebuf_append_u16_be(b,TCP_MAX_SEG_SIZE);
+ }
+
+ tcplen = 0; /* don't transmit data here */
+
+ /*
+ * SYN and FIN packets consume a sequence number, so
+ * increment the "sendnext" variable. If we need to retransmit
+ * these segments, we'll wind "sendnext" back to "sendunack"
+ *
+ * XXX: Can you send a SYN and FIN at the same time?
+ */
+
+ if (flags & (TCPFLG_SYN | TCPFLG_FIN)) tcb->tcb_sendnext++;
+
+ /*
+ * Build the pseudoheader, which is part of the checksum calculation
+ */
+
+ _ip_getaddr(ti->ti_ipinfo,&pseudoheader[0]);
+ memcpy(&pseudoheader[4],tcb->tcb_peeraddr,IP_ADDR_LEN);
+ pseudoheader[8] = 0;
+ pseudoheader[9] = IPPROTO_TCP;
+ pseudoheader[10] = ((tcplen+hdrlen) >> 8) & 0xFF;
+ pseudoheader[11] = ((tcplen+hdrlen) & 0xFF);
+
+ /*
+ * Checksum the packet and insert the checksum into the header
+ */
+
+ cksum = ip_chksum(0,pseudoheader,sizeof(pseudoheader));
+ cksum = ip_chksum(cksum,tcphdr,tcplen + hdrlen);
+ cksum = ~cksum;
+ cksumptr[0] = (cksum >> 8) & 0xFF;
+ cksumptr[1] = (cksum & 0xFF);
+
+ /*
+ * Transmit the packet. The layer below us will free it.
+ */
+
+ _ip_send(ti->ti_ipinfo,b,tcb->tcb_peeraddr,IPPROTO_TCP);
+}
+
+/* *********************************************************************
+ * _tcp_sendreset(ti,dstipaddr,ack,srcport,dstport)
+ *
+ * Transmit "protocol messages" on the tcb. This is used for
+ * sending SYN, FIN, ACK, and other control packets.
+ *
+ * Input parameters:
+ * ti - tcp infomration
+ * tcb - tcb we're interested in
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void _tcp_sendreset(tcp_info_t *ti,uint8_t *dstipaddr,uint32_t ack,
+ uint16_t srcport,uint16_t dstport)
+{
+ tcb_t tcb; /* fake TCB so we can use _tcp_protosend */
+
+ memset(&tcb,0,sizeof(tcb));
+ memcpy(tcb.tcb_peeraddr,dstipaddr,IP_ADDR_LEN);
+ tcb.tcb_peerport = dstport;
+ tcb.tcb_lclport = srcport;
+ tcb.tcb_txflags = TCPFLG_RST|TCPFLG_ACK;
+ tcb.tcb_rcvnext = ack;
+
+ _tcp_protosend(ti,&tcb);
+}
+
+
+/* *********************************************************************
+ * _tcp_sendctlmsg(ti,tcb,flags,timeout)
+ *
+ * Set up for and transmit a control message. This is usually
+ * called on a state transition where we need to send a control
+ * message like a SYN or FIN, with a timeout. We reset the
+ * retry counter, set the retransmit timer, and fire off the message
+ * right here.
+ *
+ * Input parameters:
+ * ti - tcp information
+ * tcb - the tcb for this TCP session
+ * flags - packet flags (TCPFLG_xxx)
+ * timeout - timeout value , in ticks
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void _tcp_sendctlmsg(tcp_info_t *ti,tcb_t *tcb,uint16_t flags,int timeout)
+{
+ tcb->tcb_txflags = flags;
+ tcb->tcb_retrycnt = 0;
+
+ if (timeout >= 0) {
+ if (timeout) {
+ TIMER_SET(tcb->tcb_timer_retx,timeout);
+ }
+ else {
+ TIMER_CLEAR(tcb->tcb_timer_retx);
+ }
+ }
+
+ _tcp_protosend(ti,tcb);
+}
+
+
+/* *********************************************************************
+ * _tcp_find_lclport(ti,port)
+ *
+ * Find the specified local port - mostly to see if it is
+ * already in use.
+ *
+ * Input parameters:
+ * ti - tcp information
+ * port - local port
+ *
+ * Return value:
+ * tcb owning this port, or NULL if none found
+ ********************************************************************* */
+static tcb_t *_tcp_find_lclport(tcp_info_t *ti,uint16_t port)
+{
+ tcb_t *tcb = NULL;
+ queue_t *qb;
+
+ for (qb = ti->ti_tcblist.q_next; qb != &(ti->ti_tcblist); qb = qb->q_next) {
+ tcb = (tcb_t *) qb;
+
+ if (tcb->tcb_lclport == port) return tcb;
+
+ }
+
+ return NULL;
+
+}
+
+/* *********************************************************************
+ * _tcp_find_tcb(ti,srcport,dstport,saddr)
+ *
+ * Locate the TCB in the active TCBs. This is used to match
+ * an inbound TCP packet to a TCB.
+ *
+ * Input parameters:
+ * ti - tcp information
+ * srcport,dstport - source and dest ports from TCP header
+ * saddr - source IP address of sending host
+ *
+ * Return value:
+ * tcb pointer or NULL if no TCB was found
+ ********************************************************************* */
+
+static tcb_t *_tcp_find_tcb(tcp_info_t *ti,uint16_t srcport,uint16_t dstport,uint8_t *saddr)
+{
+ tcb_t *tcb = NULL;
+ queue_t *qb;
+
+ for (qb = ti->ti_tcblist.q_next; qb != &(ti->ti_tcblist); qb = qb->q_next) {
+ tcb = (tcb_t *) qb;
+
+ /* Try active TCBs */
+ if ((tcb->tcb_peerport != 0) &&
+ (tcb->tcb_lclport == dstport) &&
+ (tcb->tcb_peerport == srcport) &&
+ (memcmp(saddr,tcb->tcb_peeraddr,IP_ADDR_LEN) == 0)) break;
+ }
+
+ /* Found it on our active list. */
+ if (qb != &(ti->ti_tcblist)) return tcb;
+
+ /* no dice, try listening ports */
+ for (qb = ti->ti_tcblist.q_next; qb != &(ti->ti_tcblist); qb = qb->q_next) {
+ tcb = (tcb_t *) qb;
+
+ /* Try active TCBs */
+ if ((tcb->tcb_peerport == 0) &&
+ (tcb->tcb_lclport == dstport)) break;
+ }
+
+ /* Found it on our passive list. */
+ if (qb != &(ti->ti_tcblist)) return tcb;
+
+ return NULL;
+}
+
+/* *********************************************************************
+ * _tcp_procack(ti,tcb,ack,flags)
+ *
+ * Process a received acknowledgement.
+ *
+ * Input parameters:
+ * ti - tcp information
+ * tcb - tcb for this tcb session
+ * ack - acknum from received packet
+ * flags - flags from received packet
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void _tcp_procack(tcp_info_t *ti,tcb_t *tcb,uint32_t ack,uint16_t flags)
+{
+ int ackamt;
+ int unacklen;
+
+ /* This is the number of unacknowledged bytes we have */
+ unacklen = tmb_curlen(&(tcb->tcb_txbuf));
+
+ switch (tcb->tcb_state) {
+
+ case TCPSTATE_ESTABLISHED:
+ /*
+ * The ack is valid if it's in the range of
+ * unacknowledged data we're holding onto.
+ *
+ * sendunack < ack <= (sendunack+datalen)
+ *
+ * Do the first comparison as "<=" instead of just "<"
+ * so we can catch duplicate acks.
+ */
+
+ if (!(TCPSEQ_LEQ(tcb->tcb_sendunack,ack) &&
+ TCPSEQ_LEQ(ack,(tcb->tcb_sendunack+unacklen)))) {
+ DEBUGMSG(("Ack is out of range: %u\n",ack));
+ return;
+ }
+
+ /*
+ * Compute the # of bytes spanned by this ack
+ */
+
+ ackamt = TCPSEQ_DIFF(ack,tcb->tcb_sendunack);
+
+ /*
+ * If we actually acked something, adjust the tx buffer
+ * to remove the bytes covered by the ack, then update
+ * the 'next' sequence number so we'll start there next
+ * time.
+ */
+
+ if (ackamt > 0) {
+ tmb_adjust(&tcb->tcb_txbuf,ackamt);
+ tcb->tcb_txflags = TCPFLG_ACK;
+ tcb->tcb_sendunack = ack;
+ tcb->tcb_dup_ackcnt = 0; /* not a duplicate */
+ }
+ else {
+ tcb->tcb_dup_ackcnt++;
+ //DEBUGMSG(("Duplicate ack received\n"));
+ /*
+ * Duplicate ack received
+ * XXX This is where we'd be doing stuff for
+ * XXX slow-start, fast retransmit, etc.
+ */
+ }
+
+ /*
+ * If we're all caught up, we can cancel the
+ * retransmit timer. Otherwise, try to do
+ * some output on the interface. This will
+ * reset the retransmit timer if we did anything.
+ */
+
+ if (tmb_curlen(&(tcb->tcb_txbuf)) != 0) {
+ tcb->tcb_flags |= TCB_FLG_OUTPUT;
+ }
+ else {
+ TIMER_CLEAR(tcb->tcb_timer_retx);
+ }
+
+ break;
+
+ case TCPSTATE_FINWAIT_1:
+ ackamt = TCPSEQ_DIFF(ack,tcb->tcb_sendunack);
+ if (ackamt == 1) {
+ tcb->tcb_sendunack = ack;
+ if (flags & TCPFLG_FIN) {
+ _tcp_setstate(tcb,TCPSTATE_TIME_WAIT);
+ _tcp_canceltimers(tcb);
+ _tcp_preparectlmsg(tcb,TCPFLG_ACK);
+ TIMER_SET(tcb->tcb_timer_2msl,TCP_TIMEWAIT_TIMER);
+ }
+ else {
+ _tcp_setstate(tcb,TCPSTATE_FINWAIT_2);
+ }
+ }
+ break;
+
+ }
+}
+
+/* *********************************************************************
+ * _tcp_procdata(ti,tcb,seqnum,flags,buf)
+ *
+ * Process data in a received TCP packet - we'll put the
+ * data into the receive ring buffer, process the seqnum
+ * field, and prepare to send an ack.
+ *
+ * Input parameters:
+ * ti - tcp information
+ * tcb - tcb describing TCP session
+ * seqnum,flags - from the header of the received TCP packet
+ * buf - ebuf contianing data
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void _tcp_procdata(tcp_info_t *ti,tcb_t *tcb,uint32_t seqnum,
+ uint16_t flags,ebuf_t *buf)
+{
+ int datalen;
+ uint8_t *bp;
+ int rxwin,rwin;
+ uint32_t endseqnum;
+ uint32_t endrxwindow;
+ int reallen;
+
+ /*
+ * Figure out how much we're going to take. This should not
+ * exceed our buffer size because we advertised a window
+ * only big enough to fill our buffer.
+ */
+
+ bp = ebuf_ptr(buf); /* pointer to TCP data */
+ datalen = ebuf_remlen(buf); /* Size of TCP data */
+
+ /*
+ * If there's no data in the buffer, we can skip the data-related
+ * stuff and check for a possible FIN.
+ */
+
+ if (datalen != 0) {
+
+ /*
+ * Figure out if the data fits within the window. We don't deal
+ * with out-of-order segments, so the test is relatively
+ * simple: The received segment must contain (or match)
+ * the sequence number from "rcvnext" to the end of the receive
+ * window.
+ *
+ * Therefore: seqnum <= rcvnext < seqnum+datalen
+ */
+
+ rxwin = tmb_remlen(&(tcb->tcb_rxbuf)); /* receive window size */
+ endseqnum = (seqnum + datalen); /* seq # of end of segment */
+ endrxwindow = tcb->tcb_rcvack + rxwin; /* end of receive window */
+
+ /*
+ * The segment might include data outside the receive window
+ * (it's not supposed to, but it can). Crop the 'endseqnum'
+ * value at the rx window if necessary. Keep the earlier seqnum.
+ */
+//
+// XXX This is just plain broken - "endrxwindow" is the wrong thing to test.
+// if (TCPSEQ_LT(endrxwindow,endseqnum)) {
+// endseqnum = endrxwindow;
+// }
+
+ /*
+ * Test to see if the data is in sequence.
+ */
+
+ rwin = (TCPSEQ_LEQ(seqnum,tcb->tcb_rcvnext) &&
+ TCPSEQ_LT(tcb->tcb_rcvnext,endseqnum));
+
+ if (!rwin) {
+ DEBUGMSG(("Dropping out-of-order packet %u %u %u\n",seqnum,
+ tcb->tcb_rcvnext,endseqnum));
+ return;
+ }
+
+ /*
+ * The actual amount of new data is the distance from
+ * the "rcvnext" pointer to the end sequence number.
+ * typically this will be the entire packet, but we
+ * handle the case of receiving a partial duplicate segment.
+ * Do this by shortening the data length we're going to
+ * copy and adjusting the buffer pointer to point past the
+ * duplicate data. Normally this won't do anything.
+ */
+
+ reallen = endseqnum - tcb->tcb_rcvnext;
+ bp += (tcb->tcb_rcvnext - seqnum);
+
+ if (reallen != datalen) {
+ DEBUGMSG(("newdata(%d) does not match real length(%d)\n",reallen,datalen));
+ }
+
+ if (reallen > 0) {
+
+ /*
+ * Copy the data into the receive buffer. In the
+ * unlikely event that it doesn't fit, update the
+ * length so we'll only ack what we took.
+ */
+
+ reallen = tmb_copyin(&(tcb->tcb_rxbuf),bp,reallen,TRUE);
+
+ tcb->tcb_rcvnext += reallen;
+
+ /*
+ * Set the delayed-ack flag. If it's already set,
+ * then we've already received some data without acking
+ * it, so send the ack now, to encourage us to
+ * ack every other segment at least.
+ */
+
+ if (tcb->tcb_flags & TCB_FLG_DLYACK) {
+ _tcp_preparectlmsg(tcb,TCPFLG_ACK);
+ }
+ else {
+ tcb->tcb_flags |= TCB_FLG_DLYACK;
+ }
+ }
+ }
+
+ /*
+ * Handle the case of data in a FIN packet.
+ */
+
+ if (flags & TCPFLG_FIN) {
+
+ tcb->tcb_rcvnext++; /* Consume the FIN */
+
+ DEBUGMSG(("FIN rcvd in %d ack %u\n",tcb->tcb_state,tcb->tcb_rcvnext));
+
+ switch (tcb->tcb_state) {
+ case TCPSTATE_ESTABLISHED:
+
+ /*
+ * If a FIN is received in the ESTABLISHED state,
+ * go to CLOSE_WAIT.
+ */
+
+ tcb->tcb_flags &= ~TCB_FLG_DLYACK;
+ _tcp_setstate(tcb,TCPSTATE_CLOSE_WAIT);
+ _tcp_sendctlmsg(ti,tcb,TCPFLG_ACK,-1);
+ break;
+
+ case TCPSTATE_FINWAIT_1:
+
+ /*
+ * Two choices: Either we got a FIN or a FIN ACK.
+ * In either case, send an ack. The difference
+ * is what state we end up in.
+ */
+
+ if (flags & TCPFLG_ACK) {
+ /* Received: FIN ACK - go directly to TIME_WAIT */
+ _tcp_canceltimers(tcb);
+ _tcp_preparectlmsg(tcb,TCPFLG_ACK);
+ _tcp_setstate(tcb,TCPSTATE_TIME_WAIT);
+#if defined(CONFIG_MIPS_BRCM)
+ TIMER_SET(tcb->tcb_timer_2msl,TCP_SEND_TIMER);
+#else
+ TIMER_SET(tcb->tcb_timer_2msl,TCP_TIMEWAIT_TIMER);
+#endif
+ }
+ else {
+ /* Received: FIN - simultaneous close, go to CLOSING */
+ _tcp_setstate(tcb,TCPSTATE_CLOSING);
+ _tcp_preparectlmsg(tcb,TCPFLG_ACK);
+ }
+ break;
+
+ case TCPSTATE_FINWAIT_2:
+
+ /*
+ * Received a FIN in FINWAIT_2 - just transmit
+ * an ack and go to TIME_WAIT.
+ */
+
+ _tcp_canceltimers(tcb);
+ _tcp_preparectlmsg(tcb,TCPFLG_ACK);
+ _tcp_setstate(tcb,TCPSTATE_TIME_WAIT);
+ TIMER_SET(tcb->tcb_timer_2msl,TCP_TIMEWAIT_TIMER);
+ break;
+ }
+ }
+
+}
+
+/* *********************************************************************
+ * _tcp_rx_callback(ref,buf,destaddr,srcaddr)
+ *
+ * The IP layer calls this routine when a TCP packet is received.
+ * We dispatch the packet to appropriate handlers from here.
+ *
+ * Input parameters:
+ * ref - our tcp information (held by the ip stack for us)
+ * buf - the ebuf that we received
+ * destaddr,srcaddr - destination and source IP addresses
+ *
+ * Return value:
+ * ETH_DROP or ETH_KEEP, depending if we keep the packet or not
+ ********************************************************************* */
+
+static int _tcp_rx_callback(void *ref,ebuf_t *buf,uint8_t *destaddr,uint8_t *srcaddr)
+{
+ uint8_t pseudoheader[12];
+ int tcplen;
+ uint16_t calccksum;
+ uint16_t origcksum;
+ uint8_t *tcphdr;
+ uint16_t srcport;
+ uint16_t dstport;
+ uint32_t seqnum;
+ uint32_t acknum;
+ uint16_t window;
+ uint16_t flags;
+ tcb_t *tcb;
+ tcp_info_t *ti = (tcp_info_t *) ref;
+
+ /*
+ * get a pointer to the TCP header
+ */
+
+ tcplen = ebuf_length(buf);
+ tcphdr = ebuf_ptr(buf);
+
+ /*
+ * construct the pseudoheader for the cksum calculation
+ */
+
+ memcpy(&pseudoheader[0],srcaddr,IP_ADDR_LEN);
+ memcpy(&pseudoheader[4],destaddr,IP_ADDR_LEN);
+ pseudoheader[8] = 0;
+ pseudoheader[9] = IPPROTO_TCP;
+ pseudoheader[10] = (tcplen >> 8) & 0xFF;
+ pseudoheader[11] = (tcplen & 0xFF);
+
+ origcksum = ((uint16_t) tcphdr[16] << 8) | (uint16_t) tcphdr[17];
+ tcphdr[16] = tcphdr[17] = 0;
+
+ calccksum = ip_chksum(0,pseudoheader,sizeof(pseudoheader));
+ calccksum = ip_chksum(calccksum,tcphdr,tcplen);
+ calccksum = ~calccksum;
+
+ if (calccksum != origcksum) {
+ return ETH_DROP;
+ }
+
+ /* Read the other TCP header fields from the packet */
+
+ ebuf_get_u16_be(buf,srcport);
+ ebuf_get_u16_be(buf,dstport);
+ ebuf_get_u32_be(buf,seqnum);
+ ebuf_get_u32_be(buf,acknum);
+ ebuf_get_u16_be(buf,flags);
+ ebuf_get_u16_be(buf,window);
+ ebuf_skip(buf,4); /* skip checksum and urgent pointer */
+
+ /* Skip options in header */
+ if (TCPHDRSIZE(flags) < TCP_HDR_LENGTH) {
+ return ETH_DROP;
+ }
+ ebuf_skip(buf,(TCPHDRSIZE(flags) - TCP_HDR_LENGTH));
+
+ /*
+ * Okay, start looking for a matching TCB. If no matching TCB,
+ * send a RST.
+ * XXX Extra credit: rate-limit the RSTs.
+ */
+
+ tcb = _tcp_find_tcb(ti,srcport,dstport,srcaddr);
+ if (!tcb) {
+ DEBUGMSG(("Invalid TCB from %I, srcport=%u dstport=%u\n",srcaddr,srcport,dstport));
+ _tcp_sendreset(ti,srcaddr,seqnum+1,dstport,srcport);
+ return ETH_DROP; /* drop packet if no matching port */
+ }
+
+ /*
+ * Any activity on a TCB is enough to reset the keepalive timer
+ */
+
+ if (TCPSTATE_IN_SET(tcb->tcb_state,M_TCPSTATE_RESETKEEPALIVE)) {
+ TIMER_SET(tcb->tcb_timer_keep,TCP_KEEPALIVE_TIMER);
+ }
+
+ /*
+ * Some debugging
+ */
+
+#ifdef _TCP_DEBUG_
+ if (_tcp_dumpflags) _tcp_dumppktstate("Received",flags,
+ acknum,seqnum,ebuf_length(buf));
+#endif
+
+ /*
+ * If someone tries to reset us, just kill off the port.
+ * (except: if we were in SYN_RECEIVED, go back to LISTEN)
+ */
+
+ if (flags & TCPFLG_RST) {
+ if (tcb->tcb_state == TCPSTATE_SYN_RECEIVED) {
+ _tcp_setstate(tcb,TCPSTATE_LISTEN);
+ }
+ else {
+ _tcp_closetcb(ti,tcb);
+ }
+ return ETH_DROP;
+ }
+
+ /*
+ * Remember the window we got.
+ */
+
+ tcb->tcb_sendwindow = window;
+
+ /*
+ * What we do here depends on the current connection state
+ * Most of this is just from the connection state diagram we've
+ * all see way too often.
+ */
+
+ switch ( tcb->tcb_state ) {
+
+ case TCPSTATE_LISTEN:
+ if (flags & TCPFLG_SYN) {
+ tcb->tcb_rcvnext = seqnum + 1;
+ tcb->tcb_peerport = srcport;
+ memcpy(tcb->tcb_peeraddr,srcaddr,IP_ADDR_LEN);
+ TIMER_SET(tcb->tcb_timer_keep,TCP_KEEPALIVE_TIMER);
+ _tcp_setstate(tcb,TCPSTATE_SYN_RECEIVED);
+ _tcp_sendctlmsg(ti,tcb,TCPFLG_SYN | TCPFLG_ACK,TCP_RETX_TIMER);
+ }
+ return ETH_DROP; /* we ignore everything else */
+ break;
+
+ case TCPSTATE_SYN_SENT:
+
+ /*
+ * The only packets we pay attention to in SYN_SENT
+ * are packets with SYN flags.
+ */
+ if (flags & TCPFLG_SYN) {
+
+ /*
+ * Two choices: Either we got a SYN ACK (normal)
+ * or just a SYN (simultaneous open, rare)
+ */
+
+ if ((flags & TCPFLG_ACK) &&
+ (acknum == (tcb->tcb_sendunack + 1))) {
+ /*
+ * If we received a SYN ACK and the acknum
+ * matches our SYN's seqnum + 1, we want
+ * to transition from SYN_SENT to ESTABLISHED.
+ */
+ TIMER_SET(tcb->tcb_timer_keep,TCP_KEEPALIVE_TIMER);
+ _tcp_setstate(tcb,TCPSTATE_ESTABLISHED);
+ tcb->tcb_sendunack = acknum;
+ tcb->tcb_sendnext = tcb->tcb_sendunack;
+ tcb->tcb_rcvnext = seqnum + 1;
+ /*
+ * Send an ack, but don't bother with the timer.
+ * If the remote does not get our ack, it will
+ * retransmit the SYN ACK and we'll ack it from
+ * the "ESTABLISHED" state.
+ * Actually, is that really true?
+ */
+ _tcp_sendctlmsg(ti,tcb,TCPFLG_ACK,0);
+ }
+ else {
+ DEBUGMSG(("Simultaneous open: SYN received in SYN_SENT state\n"));
+ tcb->tcb_rcvnext++; /* consume the SYN */
+ _tcp_setstate(tcb,TCPSTATE_SYN_RECEIVED);
+ _tcp_sendctlmsg(ti,tcb,TCPFLG_SYN|TCPFLG_ACK,TCP_RETX_TIMER);
+ }
+ }
+
+ return ETH_DROP;
+ break;
+
+ case TCPSTATE_SYN_RECEIVED:
+ /*
+ * If we've received a SYN and someone sends us a SYN,
+ * and the sequence numbers don't match,
+ * send back a SYN ACK. (this doesn't sound right,
+ * does it? It's sort of what we do from LISTEN)
+ */
+
+ if (flags & TCPFLG_SYN) {
+ _tcp_sendctlmsg(ti,tcb,TCPFLG_SYN | TCPFLG_ACK,TCP_RETX_TIMER);
+ }
+
+ /*
+ * If we got an ack and the acknum is correct,
+ * switch the state to 'ESTABLISHED' and cancel
+ * the timer. We're ready to rock.
+ */
+
+ if ((flags & TCPFLG_ACK) &&
+ (acknum == (tcb->tcb_sendunack + 1))) {
+ _tcp_sendctlmsg(ti,tcb,TCPFLG_ACK,0);
+ tcb->tcb_sendunack = acknum;
+ tcb->tcb_sendnext = tcb->tcb_sendunack;
+ TIMER_SET(tcb->tcb_timer_keep,TCP_KEEPALIVE_TIMER);
+ _tcp_setstate(tcb,TCPSTATE_ESTABLISHED);
+ }
+
+ return ETH_DROP;
+ break;
+
+ case TCPSTATE_ESTABLISHED:
+ case TCPSTATE_FINWAIT_1:
+ case TCPSTATE_FINWAIT_2:
+
+ /*
+ * ESTABLISHED, FINWAIT_1, and FINWAIT_2 can all
+ * carry data. Process the data here. If the
+ * segment also contains a FIN, these routines
+ * will handle that.
+ */
+
+ if (flags & TCPFLG_ACK) {
+ _tcp_procack(ti,tcb,acknum,flags);
+ }
+ _tcp_procdata(ti,tcb,seqnum,flags,buf);
+ break;
+
+ case TCPSTATE_CLOSING:
+ if (acknum == (tcb->tcb_sendunack + 1)) {
+ _tcp_setstate(tcb,TCPSTATE_TIME_WAIT);
+ _tcp_canceltimers(tcb);
+ TIMER_SET(tcb->tcb_timer_2msl,TCP_TIMEWAIT_TIMER);
+ }
+ break;
+
+ case TCPSTATE_LAST_ACK:
+ if (acknum == (tcb->tcb_sendunack + 1)) {
+ /* Ack matches, just close the TCB here. */
+ _tcp_closetcb(ti,tcb);
+ /* and free it. */
+ _tcp_freetcb(ti,tcb);
+ }
+ else {
+ _tcp_sendctlmsg(ti,tcb,TCPFLG_ACK | TCPFLG_FIN,TCP_RETX_TIMER);
+ }
+ break;
+
+ case TCPSTATE_TIME_WAIT:
+ if (!(flags & TCPFLG_RST)) {
+ tcb->tcb_txflags = TCPFLG_ACK;
+ TIMER_SET(tcb->tcb_timer_2msl,TCP_TIMEWAIT_TIMER);
+ _tcp_protosend(ti,tcb);
+ }
+ break;
+ }
+
+ /*
+ * If we're expected to transmit something, do it now.
+ */
+
+ if (tcb->tcb_flags & TCB_FLG_OUTPUT) {
+ _tcp_output(ti,tcb);
+ tcb->tcb_flags &= ~(TCB_FLG_OUTPUT | TCB_FLG_SENDMSG);
+ }
+
+ if (tcb->tcb_flags & TCB_FLG_SENDMSG) {
+ _tcp_protosend(ti,tcb);
+ }
+
+ /* We always make a copy of the data, so drop the packet. */
+ return ETH_DROP;
+}
+
+/* *********************************************************************
+ * _tcp_fasttimo(ti)
+ *
+ * Handle "fast timeout" for active TCP sockets.
+ *
+ * Input parameters:
+ * ti - tcp_info structure
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+static void _tcp_fasttimo(tcp_info_t *ti)
+{
+ tcb_t *tcb;
+ queue_t *qb;
+
+ /*
+ * First, reset the timer so we'll end up here
+ * again in another 200ms
+ */
+
+ TIMER_SET(ti->ti_fasttimer,TCP_FAST_TIMER); /* 200ms */
+
+ /*
+ * Now, walk down the list of TCBs and handle
+ * all the timers.
+ */
+
+ for (qb = ti->ti_tcblist.q_next; qb != &(ti->ti_tcblist); qb = qb->q_next) {
+ tcb = (tcb_t *) qb;
+ if (tcb->tcb_flags & TCB_FLG_DLYACK) {
+ tcb->tcb_flags &= ~TCB_FLG_DLYACK;
+ _tcp_sendctlmsg(ti,tcb,TCPFLG_ACK,-1);
+ }
+ }
+
+ /*
+ * While we're here, increment TCP's initial sequence number.
+ * BSD suggests 128000 every second, so we'll add 25600 every 200ms.
+ */
+
+ ti->ti_iss += 25600;
+
+}
+
+
+/* *********************************************************************
+ * _tcp_poll(arg)
+ *
+ * CFE calls this routine periodically to allow us to check
+ * and update timers, etc.
+ *
+ * Input parameters:
+ * arg - our tcp information (held by the timer module for us)
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void _tcp_poll(void *arg)
+{
+ tcb_t *tcb;
+ queue_t *qb;
+ tcp_info_t *ti = (tcp_info_t *) arg;
+
+ /*
+ * Handle the "fast" timer. We do this every 200ms
+ */
+
+ if (TIMER_EXPIRED(ti->ti_fasttimer)) {
+ _tcp_fasttimo(ti);
+ /* timer will be reset by the _tcp_fasttimo routine */
+ }
+
+ /*
+ * Check the TCBs for the "slow" timers.
+ */
+
+ for (qb = ti->ti_tcblist.q_next; qb != &(ti->ti_tcblist); qb = qb->q_next) {
+ tcb = (tcb_t *) qb;
+
+ /*
+ * Check the retransmit timer. This is used during connection
+ * attempts to retransmit control messages, or also during
+ * regular data transfer to retransmit messages that are not
+ * acknowledged.
+ *
+ * XXX use the computed round-trip timer here
+ */
+
+ if (TIMER_EXPIRED(tcb->tcb_timer_retx)) {
+ TIMER_CLEAR(tcb->tcb_timer_retx); /* unless it is reset */
+
+ DEBUGMSG(("Retransmit timer expired, retrycnt=%d\n",tcb->tcb_retrycnt));
+
+ switch (tcb->tcb_state) {
+ case TCPSTATE_ESTABLISHED:
+ /*
+ * wind the send seqnum back to the last unacknowledged data,
+ * and send it out again.
+ */
+ TIMER_SET(tcb->tcb_timer_retx,TCP_RETX_TIMER);
+ tcb->tcb_retrycnt++;
+ tcb->tcb_sendnext = tcb->tcb_sendunack;
+ _tcp_output(ti,tcb);
+ break;
+
+ case TCPSTATE_SYN_SENT:
+ TIMER_SET(tcb->tcb_timer_retx,(TCP_RETX_TIMER << tcb->tcb_retrycnt));
+ tcb->tcb_retrycnt++;
+ tcb->tcb_sendnext = tcb->tcb_sendunack;
+ _tcp_protosend(ti,tcb);
+ break;
+
+ }
+ }
+
+ /*
+ * Check the keepalive timer. This is used during connection
+ * attempts to time out the connection, and _can_ be used for
+ * keepalives during established sessions.
+ *
+ * Our TCP does not bother with keepalive messages.
+ */
+
+ if (TIMER_EXPIRED(tcb->tcb_timer_keep)) {
+ TIMER_CLEAR(tcb->tcb_timer_keep); /* unless it is reset */
+ DEBUGMSG(("Keepalive timer expired in state %d\n",tcb->tcb_state));
+ if (TCPSTATE_IN_SET(tcb->tcb_state,M_TCPSTATE_CONNINPROGRESS)) {
+ DEBUGMSG(("Canceling pending connection\n"));
+ _tcp_aborttcb(ti,tcb);
+ }
+ }
+
+ /*
+ * Check the 2MSL timer. This is used in the TIME_WAIT state
+ * to return the tcb to the free list after the time wait
+ * period elapses.
+ */
+
+ if (TIMER_EXPIRED(tcb->tcb_timer_2msl)) {
+ TIMER_CLEAR(tcb->tcb_timer_2msl); /* will not be reset */
+ DEBUGMSG(("2MSL timer expired in state %d\n",tcb->tcb_state));
+ if (tcb->tcb_state == TCPSTATE_TIME_WAIT) {
+ DEBUGMSG(("Freeing TCB\n"));
+ _tcp_closetcb(ti,tcb);
+ _tcp_freetcb(ti,tcb);
+ }
+ }
+
+ }
+
+}
+
+
diff --git a/cfe/cfe/net/net_tcp.h b/cfe/cfe/net/net_tcp.h
new file mode 100755
index 0000000..fa772e6
--- /dev/null
+++ b/cfe/cfe/net/net_tcp.h
@@ -0,0 +1,83 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * TCP Protocol Definitions File: net_tcp.h
+ *
+ * This file contains TCP protocol-specific definitions
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+/* *********************************************************************
+ * TCP Flags - keep in sync with net_api.h
+ ********************************************************************* */
+
+#define TCPFLG_NODELAY 1 /* disable nagle */
+#define TCPFLG_NBIO 2 /* Non-blocking I/O */
+
+#define TCPSTATUS_NOTCONN 0
+#define TCPSTATUS_CONNECTING 1
+#define TCPSTATUS_CONNECTED 2
+
+/* *********************************************************************
+ * TCP API
+ ********************************************************************* */
+
+typedef struct tcp_info_s tcp_info_t;
+
+tcp_info_t *_tcp_init(ip_info_t *ipi,void *ref);
+void _tcp_uninit(tcp_info_t *info);
+
+int _tcp_socket(tcp_info_t *info);
+int _tcp_connect(tcp_info_t *ti,int s,uint8_t *dest,uint16_t port);
+int _tcp_close(tcp_info_t *ti,int s);
+int _tcp_send(tcp_info_t *ti,int s,uint8_t *buf,int len);
+int _tcp_recv(tcp_info_t *ti,int s,uint8_t *buf,int len);
+int _tcp_bind(tcp_info_t *ti,int s,uint16_t port);
+int _tcp_peeraddr(tcp_info_t *ti,int s,uint8_t *addr,uint16_t *port);
+int _tcp_listen(tcp_info_t *ti,int s,uint16_t port);
+int _tcp_status(tcp_info_t *ti,int s,unsigned int *connflag,int *rxready,int *rxeof);
+int _tcp_debug(tcp_info_t *ti,int s,int arg);
+int _tcp_setflags(tcp_info_t *ti,int s,unsigned int flags);
+int _tcp_getflags(tcp_info_t *ti,int s,unsigned int *flags);
+
+void _tcp_poll(void *arg);
+
+
diff --git a/cfe/cfe/net/net_tcp_internal.h b/cfe/cfe/net/net_tcp_internal.h
new file mode 100755
index 0000000..1e3fc6d
--- /dev/null
+++ b/cfe/cfe/net/net_tcp_internal.h
@@ -0,0 +1,244 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * TCP Protocol Internal Definitions File: net_tcp_internal.h
+ *
+ * This file contains the structures and constants needed to
+ * maintain TCP connections.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+
+/* *********************************************************************
+ * TCP Constants
+ ********************************************************************* */
+
+
+#define TCP_MAX_PORTS 8
+#define TCP_MAX_TCBS 16
+#if defined(CONFIG_MIPS_BRCM)
+#define TCP_BUF_SIZE (20 * 1024)
+#else
+#define TCP_BUF_SIZE 65536
+#endif
+
+#define TCP_MAX_SEG_SIZE 1400
+
+#define TCP_CONNECT_TIMER (30*CFE_HZ)
+#define TCP_RETX_TIMER (1*CFE_HZ)
+#define TCP_TIMEWAIT_TIMER (30*CFE_HZ)
+#define TCP_SEND_TIMER (CFE_HZ)
+
+#define TCP_FAST_TIMER (CFE_HZ/5) /* 200ms */
+#define TCP_KEEPALIVE_TIMER (CFE_HZ*60) /* one minute */
+
+
+/* *********************************************************************
+ * TCP Protocol
+ ********************************************************************* */
+
+#define TCPFLG_FIN 0x0001
+#define TCPFLG_SYN 0x0002
+#define TCPFLG_RST 0x0004
+#define TCPFLG_PSH 0x0008
+#define TCPFLG_ACK 0x0010
+#define TCPFLG_URG 0x0020
+#define TCPHDRSIZE(flg) (((flg) >> 12)*4)
+#define TCPHDRFLG(size) (((size)/4)<<12)
+
+#define TCP_HDR_LENGTH 20
+
+#define TCP_MAX_SEG_OPT 0x0204
+
+/* *********************************************************************
+ * TCP State machine
+ ********************************************************************* */
+
+/*
+ * TCB states, see RFC
+ */
+
+#define TCPSTATE_CLOSED 0
+#define TCPSTATE_LISTEN 1
+#define TCPSTATE_SYN_SENT 2
+#define TCPSTATE_SYN_RECEIVED 3
+#define TCPSTATE_ESTABLISHED 4
+#define TCPSTATE_CLOSE_WAIT 5
+#define TCPSTATE_FINWAIT_1 6
+#define TCPSTATE_FINWAIT_2 7
+#define TCPSTATE_CLOSING 8
+#define TCPSTATE_LAST_ACK 9
+#define TCPSTATE_TIME_WAIT 10
+
+/*
+ * Masks for TCP states - we use these so we can make
+ * bit vectors of states for easy tests.
+ */
+
+#define M_TCPSTATE_CLOSED (1 << TCPSTATE_CLOSED)
+#define M_TCPSTATE_LISTEN (1 << TCPSTATE_LISTEN)
+#define M_TCPSTATE_SYN_SENT (1 << TCPSTATE_SYN_SENT)
+#define M_TCPSTATE_SYN_RECEIVED (1 << TCPSTATE_SYN_RECEIVED)
+#define M_TCPSTATE_ESTABLISHED (1 << TCPSTATE_ESTABLISHED)
+#define M_TCPSTATE_CLOSE_WAIT (1 << TCPSTATE_CLOSE_WAIT)
+#define M_TCPSTATE_FINWAIT_1 (1 << TCPSTATE_FINWAIT_1)
+#define M_TCPSTATE_FINWAIT_2 (1 << TCPSTATE_FINWAIT_2)
+#define M_TCPSTATE_CLOSING (1 << TCPSTATE_CLOSING)
+#define M_TCPSTATE_LAST_ACK (1 << TCPSTATE_LAST_ACK)
+#define M_TCPSTATE_TIME_WAIT (1 << TCPSTATE_TIME_WAIT)
+#define M_TCPSTATE_CLOSED (1 << TCPSTATE_CLOSED)
+
+/*
+ * This macro returns true if a given state is in a
+ * set of states (defined below)
+ */
+
+#define TCPSTATE_IN_SET(state,set) ((1 << (state)) & (set))
+
+/*
+ * Intresting groups of TCP states
+ */
+
+/* ABORTSTATES - tcp_abort will send a RST if our TCB is one of these. */
+#define M_TCPSTATE_ABORTSTATES \
+ M_TCPSTATE_SYN_SENT | M_TCPSTATE_SYN_RECEIVED | M_TCPSTATE_ESTABLISHED | \
+ M_TCPSTATE_FINWAIT_1 | M_TCPSTATE_FINWAIT_2 | M_TCPSTATE_CLOSING | \
+ M_TCPSTATE_LAST_ACK | M_TCPSTATE_CLOSE_WAIT
+
+/* SEND_OK - tcp_send will send data if our TCB is one of these */
+#define M_TCPSTATE_SEND_OK \
+ M_TCPSTATE_ESTABLISHED | M_TCPSTATE_CLOSE_WAIT
+
+/* RECV_OK - tcp_recv will pass up data if our TCB is in one of these */
+#define M_TCPSTATE_RECV_OK \
+ M_TCPSTATE_ESTABLISHED | M_TCPSTATE_CLOSE_WAIT
+
+/* PEERADDR_OK - tcp_peeraddr will return a value if TCB is in one of these */
+#define M_TCPSTATE_PEERADDR_OK \
+ M_TCPSTATE_SYN_SENT | M_TCPSTATE_SYN_RECEIVED | M_TCPSTATE_ESTABLISHED | \
+ M_TCPSTATE_FINWAIT_1 | M_TCPSTATE_FINWAIT_2 | M_TCPSTATE_CLOSING | \
+ M_TCPSTATE_LAST_ACK | M_TCPSTATE_CLOSE_WAIT
+
+/* RESETKEEPALIVE - reset keepalive timer in these states */
+#define M_TCPSTATE_RESETKEEPALIVE \
+ M_TCPSTATE_ESTABLISHED | M_TCPSTATE_CLOSE_WAIT | M_TCPSTATE_FINWAIT_1 | \
+ M_TCPSTATE_FINWAIT_2 | M_TCPSTATE_CLOSING | M_TCPSTATE_LAST_ACK
+
+#define CONNINPROGRESS - connection is in progress in these states */
+#define M_TCPSTATE_CONNINPROGRESS \
+ M_TCPSTATE_LISTEN | M_TCPSTATE_SYN_SENT | M_TCPSTATE_SYN_RECEIVED
+
+
+/*
+ * TCP flags for the control block
+ */
+
+#define TCB_FLG_OUTPUT 1 /* need to call tcp_output */
+#define TCB_FLG_SENDMSG 2
+#define TCB_FLG_DLYACK 4 /* delayed ack is pending */
+
+/* *********************************************************************
+ * TCP Control Block
+ ********************************************************************* */
+
+typedef struct tcb_s {
+ queue_t tcb_qb; /* next/previous in list */
+ int tcb_socknum; /* socket number, index into table */
+
+ int tcb_state; /* current connection state */
+
+ uint8_t tcb_peeraddr[IP_ADDR_LEN]; /* Peer's IP Address */
+ uint16_t tcb_peerport; /* Peer's port address */
+ uint16_t tcb_lclport; /* My port address */
+
+ uint16_t tcb_txflags; /* packet flags for next tx packet */
+
+ cfe_timer_t tcb_timer_2msl; /* 2MSL timer, used in TIME_WAIT */
+ cfe_timer_t tcb_timer_keep; /* Timer for keepalives and connections */
+ cfe_timer_t tcb_timer_retx; /* send retransmission timer */
+ cfe_timer_t tcb_timer_pers; /* Persist timer */
+
+ int tcb_retrycnt; /* Retry counter */
+
+ int tcb_mtu; /* MTU if underlying link */
+ unsigned int tcb_flags; /* Misc protocol flags */
+ unsigned int tcb_sockflags; /* flags set by user api */
+
+ /*
+ * Buffers
+ */
+
+ tcpmodbuf_t tcb_txbuf; /* Transmit buffer */
+ tcpmodbuf_t tcb_rxbuf; /* Receive buffer */
+
+ /*
+ * Send sequence variables
+ */
+
+ uint32_t tcb_sendunack; /* oldest unacknowledged seqnum */
+ uint32_t tcb_sendnext; /* Next seqnum to send */
+ uint32_t tcb_sendwindow; /* Last advertised send window */
+
+ /*
+ * Receive sequence variables
+ */
+
+ uint32_t tcb_rcvnext; /* next in-order receive seq num */
+ uint32_t tcb_rcvack; /* last transmitted acknowledgement */
+
+ /*
+ * Window management variables
+ */
+ int tcb_dup_ackcnt; /* Duplicate ack counter */
+
+} tcb_t;
+
+/* *********************************************************************
+ * Macros to muck with sequence numbers
+ ********************************************************************* */
+
+#define TCPSEQ_LT(a,b) ((int)((a)-(b)) < 0)
+#define TCPSEQ_LEQ(a,b) ((int)((a)-(b)) <= 0)
+#define TCPSEQ_GT(a,b) ((int)((a)-(b)) > 0)
+#define TCPSEQ_GEQ(a,b) ((int)((a)-(b)) >= 0)
+
+#define TCPSEQ_DIFF(a,b) ((int)((a)-(b)))
+
diff --git a/cfe/cfe/net/net_tcpbuf.c b/cfe/cfe/net/net_tcpbuf.c
new file mode 100644
index 0000000..08e690b
--- /dev/null
+++ b/cfe/cfe/net/net_tcpbuf.c
@@ -0,0 +1,298 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * TCP Protocol File: net_tcp.c
+ *
+ * This file contains a very simple TCP.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_error.h"
+
+#include "net_tcpbuf.h"
+
+
+
+/* *********************************************************************
+ * tmb_init(buf)
+ *
+ * Initialize a modulo buffer's pointers to the "empty" state
+ *
+ * Input parameters:
+ * buf - modulo buffer structure
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void tmb_init(tcpmodbuf_t *buf)
+{
+ buf->tmb_addptr = 0;
+ buf->tmb_remptr = 0;
+ buf->tmb_len = 0;
+}
+
+/* *********************************************************************
+ * tmb_adjust(buf,amt)
+ *
+ * Move the "remove" pointer ahead by 'amt' without retrieving the
+ * data.
+ *
+ * Input parameters:
+ * buf - modulo buffer structure
+ * amt - number of bytes to move
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+
+void tmb_adjust(tcpmodbuf_t *buf,int amt)
+{
+ /* XXX should we check for moving to far? */
+ buf->tmb_len -= amt;
+ buf->tmb_remptr = (buf->tmb_remptr + amt) % buf->tmb_bufsize;
+}
+
+/* *********************************************************************
+ * tmb_alloc(buf,size)
+ *
+ * Allocate memory for the modulo buffer.
+ *
+ * Input parameters:
+ * buf - modulo buffer structure
+ * size - size of data in modulo buffer
+ *
+ * Return value:
+ * 0 if ok
+ * -1 if error
+ ********************************************************************* */
+
+int tmb_alloc(tcpmodbuf_t *buf,int size)
+{
+ buf->tmb_buf = KMALLOC(size,0);
+ if (!buf->tmb_buf) return -1;
+ buf->tmb_bufsize = size;
+
+ tmb_init(buf);
+
+ return 0;
+}
+
+/* *********************************************************************
+ * tmb_free(buf)
+ *
+ * Free memory associated with the modulo buffer
+ *
+ * Input parameters:
+ * buf - modulo buffer
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void tmb_free(tcpmodbuf_t *buf)
+{
+ if (buf->tmb_buf) KFREE(buf->tmb_buf);
+ buf->tmb_buf = NULL;
+}
+
+
+/* *********************************************************************
+ * tmb_copyin(tmb,buf,len,update)
+ *
+ * Copy data into the modulo buffer at the 'add' pointer
+ *
+ * Input parameters:
+ * tmb - modulo buffer structure
+ * buf,len - buffer and length of buffer to copy in
+ * update - true to advance 'add' pointer (usually true for copyin)
+ *
+ * Return value:
+ * number of bytes actually added to the buffer
+ ********************************************************************* */
+
+int tmb_copyin(tcpmodbuf_t *tmb,uint8_t *buf,int len,int update)
+{
+ int maxlen;
+ int l;
+ int newptr;
+ int retlen;
+
+ if (len == 0) return 0;
+
+ /* Set 'maxlen' to the max # of bytes we will send now */
+ maxlen = tmb->tmb_bufsize - tmb->tmb_len;
+ if (maxlen > len) maxlen = len;
+
+ retlen = maxlen; /* we'll return this later. */
+
+ /* Copy the bytes into the buffer and deal with buffer wrap */
+ l = tmb->tmb_bufsize - tmb->tmb_addptr;
+ if (l > maxlen) l = maxlen;
+
+ memcpy(tmb->tmb_buf + tmb->tmb_addptr,buf,l);
+ maxlen -= l;
+ buf += l;
+
+ if (maxlen) {
+ memcpy(tmb->tmb_buf,buf,maxlen);
+ newptr = maxlen;
+ }
+ else {
+ newptr = tmb->tmb_addptr + l;
+ }
+
+ if (update) {
+ tmb->tmb_len += retlen; /* this many more in the buffer */
+ tmb->tmb_addptr = newptr;
+ }
+
+ return retlen;
+}
+
+/* *********************************************************************
+ * tmb_copyout(tmb,buf,len,update)
+ *
+ * Copy data out of the modulo buffer from the 'remove' pointer
+ *
+ * Input parameters:
+ * tmb - modulo buffer structure
+ * buf,len - buffer and length of buffer to copy out
+ * update - true to advance 'remove' pointer
+ *
+ * Return value:
+ * number of bytes actually removed from the buffer
+ ********************************************************************* */
+
+int tmb_copyout(tcpmodbuf_t *tmb,uint8_t *buf,int len,int update)
+{
+ int maxlen;
+ int l;
+ int newptr;
+ int retlen;
+
+ /* Compute how many bytes to return */
+ maxlen = tmb->tmb_len;
+ if (maxlen > len) maxlen = len;
+
+ retlen = maxlen;
+
+ l = tmb->tmb_bufsize - tmb->tmb_remptr;
+ if (l > maxlen) l = maxlen;
+
+ memcpy(buf,tmb->tmb_buf + tmb->tmb_remptr,l);
+ buf += l;
+ maxlen -= l;
+
+ if (maxlen) {
+ memcpy(buf,tmb->tmb_buf,maxlen);
+ newptr = maxlen;
+ }
+ else {
+ newptr = tmb->tmb_remptr + l;
+ }
+
+ if (update) {
+ tmb->tmb_len -= retlen;
+ tmb->tmb_remptr = newptr;
+ }
+
+ return retlen;
+}
+
+/* *********************************************************************
+ * tmb_copyout2(tmb,buf,offset,len)
+ *
+ * Copy data out of the modulo buffer from a specific offset from
+ * the remove pointer. This is done without updating the
+ * remove pointer - we use this to dig data out when segmenting
+ * packets for transmission.
+ *
+ * Input parameters:
+ * tmb - modulo buffer structure
+ * buf,len - buffer and length of buffer to copy out
+ * offset - offset from remove pointer to start
+ *
+ * Return value:
+ * number of bytes actually copied out of the buffer
+ ********************************************************************* */
+
+int tmb_copyout2(tcpmodbuf_t *tmb,uint8_t *buf,int offset,int len)
+{
+ int maxlen;
+ int l;
+ int retlen;
+ int remptr;
+
+ /* Compute how many bytes to return */
+ maxlen = tmb->tmb_len - offset;
+
+ /* if offset is beyond length, get out now. */
+ if (maxlen <= 0) return 0;
+
+ /* otherwise choose min(max_can_copy,max_to_copy) */
+ if (maxlen > len) maxlen = len;
+ retlen = maxlen;
+
+ /* Adjust remove pointer for offset */
+ remptr = (tmb->tmb_remptr + offset) % tmb->tmb_bufsize;
+
+ l = tmb->tmb_bufsize - remptr;
+ if (l > maxlen) l = maxlen;
+
+ memcpy(buf,tmb->tmb_buf + remptr,l);
+ buf += l;
+ maxlen -= l;
+
+ if (maxlen) {
+ memcpy(buf,tmb->tmb_buf,maxlen);
+ }
+
+ return retlen;
+}
+
diff --git a/cfe/cfe/net/net_tcpbuf.h b/cfe/cfe/net/net_tcpbuf.h
new file mode 100644
index 0000000..0c251e3
--- /dev/null
+++ b/cfe/cfe/net/net_tcpbuf.h
@@ -0,0 +1,83 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * TCP Protocol Definitions File: net_tcp.h
+ *
+ * This file contains TCP protocol-specific definitions
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#define tmb_remlen(tmb) ((tmb)->tmb_bufsize - (tmb)->tmb_len)
+#define tmb_curlen(tmb) ((tmb)->tmb_len)
+
+
+/* *********************************************************************
+ * Modulo Buffer
+ ********************************************************************* */
+
+typedef struct tcpmodbuf_s {
+ uint8_t *tmb_buf; /* Buffer */
+ int tmb_bufsize; /* size of buffer */
+ int tmb_addptr; /* current "add" pointer */
+ int tmb_remptr; /* current "remove" pointer */
+ int tmb_len; /* amount of data in the buffer */
+} tcpmodbuf_t;
+
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+void tmb_init(tcpmodbuf_t *buf);
+void tmb_adjust(tcpmodbuf_t *buf,int amt);
+int tmb_alloc(tcpmodbuf_t *buf,int size);
+void tmb_free(tcpmodbuf_t *buf);
+int tmb_copyin(tcpmodbuf_t *tmb,uint8_t *buf,int len,int update);
+int tmb_copyout(tcpmodbuf_t *tmb,uint8_t *buf,int len,int update);
+int tmb_copyout2(tcpmodbuf_t *tmb,uint8_t *buf,int offset,int len);
+
+
+
+
+
diff --git a/cfe/cfe/net/net_tftp.c b/cfe/cfe/net/net_tftp.c
new file mode 100644
index 0000000..1c3e799
--- /dev/null
+++ b/cfe/cfe/net/net_tftp.c
@@ -0,0 +1,921 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * TFTP Client File: net_tftp.c
+ *
+ * This module contains a TFTP client.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_error.h"
+#include "cfe_fileops.h"
+
+/* Foxconn add start by Cliff Wang, 03/23/2010 */
+#include "cfe_console.h"
+/* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+#include "net_ebuf.h"
+#include "net_ether.h"
+
+#include "cfe.h"
+
+#include "cfe_loader.h"
+
+#include "net_api.h"
+
+
+
+/* *********************************************************************
+ * TFTP protocol
+ ********************************************************************* */
+
+#define UDP_PROTO_TFTP 69
+
+#define TFTP_BLOCKSIZE 512
+
+#define TFTP_OP_RRQ 1
+#define TFTP_OP_WRQ 2
+#define TFTP_OP_DATA 3
+#define TFTP_OP_ACK 4
+#define TFTP_OP_ERROR 5
+
+#define TFTP_ERR_DISKFULL 3
+
+#define TFTP_MAX_RETRIES 8
+
+#define TFTP_RRQ_TIMEOUT 1 /* seconds */
+#define TFTP_RECV_TIMEOUT 1 /* seconds */
+
+/* *********************************************************************
+ * TFTP context
+ ********************************************************************* */
+
+typedef struct tftp_fsctx_s {
+ int dummy;
+} tftp_fsctx_t;
+
+typedef struct tftp_info_s {
+ int tftp_socket;
+ uint8_t tftp_data[TFTP_BLOCKSIZE];
+ int tftp_blklen;
+ int tftp_blkoffset;
+ int tftp_fileoffset;
+ uint16_t tftp_blknum;
+ uint8_t tftp_ipaddr[IP_ADDR_LEN];
+ int tftp_lastblock;
+ int tftp_error;
+ int tftp_filemode;
+ char *tftp_filename;
+} tftp_info_t;
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+static int tftp_fileop_init(void **fsctx,void *devicename);
+static int tftp_fileop_open(void **ref,void *fsctx,char *filename,int mode);
+static int tftp_fileop_read(void *ref,uint8_t *buf,int len);
+static int tftp_fileop_write(void *ref,uint8_t *buf,int len);
+static int tftp_fileop_seek(void *ref,int offset,int how);
+static void tftp_fileop_close(void *ref);
+static void tftp_fileop_uninit(void *fsctx);
+
+/* Foxconn add start by Cliff Wang, 03/23/2010 */
+int tftp_max_retries = TFTP_MAX_RETRIES;
+int tftp_rrq_timeout = TFTP_RRQ_TIMEOUT;
+int tftp_recv_timeout = TFTP_RECV_TIMEOUT;
+/* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+/* *********************************************************************
+ * TFTP fileio dispatch table
+ ********************************************************************* */
+
+const fileio_dispatch_t tftp_fileops = {
+ "tftp",
+ LOADFLG_NOBB | FSYS_TYPE_NETWORK,
+ tftp_fileop_init,
+ tftp_fileop_open,
+ tftp_fileop_read,
+ tftp_fileop_write,
+ tftp_fileop_seek,
+ tftp_fileop_close,
+ tftp_fileop_uninit
+};
+
+
+/* *********************************************************************
+ * _tftp_open(info,hostname,filename,mode)
+ *
+ * Open a file on a remote host, using the TFTP protocol.
+ *
+ * Input parameters:
+ * info - TFTP information
+ * hostname - host name or IP address of remote host
+ * filename - name of file on remote system
+ * mode - file open mode, read or write
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int _tftp_open(tftp_info_t *info,char *hostname,char *filename,int mode)
+{
+ ebuf_t *buf = NULL;
+ const char *datamode = "octet";
+ uint16_t type,error,block;
+ int res;
+ int retries;
+
+ /*
+ * Look up the remote host's IP address
+ */
+
+ res = dns_lookup(hostname,info->tftp_ipaddr);
+ if (res < 0) return res;
+
+ /*
+ * Open a UDP socket to the TFTP server
+ */
+
+ info->tftp_socket = udp_socket(UDP_PROTO_TFTP);
+ info->tftp_lastblock = 0;
+ info->tftp_error = 0;
+ info->tftp_filemode = mode;
+
+ /*
+ * Try to send the RRQ packet to open the file
+ */
+
+ for (retries = 0; retries < TFTP_MAX_RETRIES; retries++) {
+
+ buf = udp_alloc();
+ if (!buf) break;
+
+ if (info->tftp_filemode == FILE_MODE_READ) {
+ ebuf_append_u16_be(buf,TFTP_OP_RRQ); /* read file */
+ }
+ else {
+ ebuf_append_u16_be(buf,TFTP_OP_WRQ); /* write file */
+ }
+ ebuf_append_bytes(buf,filename,strlen(filename)+1);
+ ebuf_append_bytes(buf,datamode,strlen(datamode)+1);
+
+ udp_send(info->tftp_socket,buf,info->tftp_ipaddr);
+
+ buf = udp_recv_with_timeout(info->tftp_socket,TFTP_RRQ_TIMEOUT);
+ if (buf) break;
+ }
+
+ /*
+ * If we got no response, bail now.
+ */
+
+ if (!buf) {
+ udp_close(info->tftp_socket);
+ info->tftp_socket = -1;
+ return CFE_ERR_TIMEOUT;
+ }
+
+ /*
+ * Otherwise, process the response.
+ */
+
+ ebuf_get_u16_be(buf,type);
+
+ switch (type) {
+ case TFTP_OP_ACK:
+ /*
+ * Acks are what we get back on a WRQ command,
+ * but are otherwise unexpected.
+ */
+ if (info->tftp_filemode == FILE_MODE_WRITE) {
+ udp_connect(info->tftp_socket,(uint16_t) buf->eb_usrdata);
+ info->tftp_blknum = 1;
+ info->tftp_blklen = 0;
+ udp_free(buf);
+ return 0;
+ break;
+ }
+ /* fall through */
+ case TFTP_OP_RRQ:
+ case TFTP_OP_WRQ:
+ default:
+ /*
+ * we aren't expecting any of these messages
+ */
+ udp_free(buf);
+ udp_close(info->tftp_socket);
+ info->tftp_socket = -1;
+ return CFE_ERR_PROTOCOLERR;
+
+ case TFTP_OP_ERROR:
+ /*
+ * Process the error return (XXX: remove xprintf here)
+ */
+ ebuf_get_u16_be(buf,error);
+ xprintf("TFTP error %d: %s\n",error,ebuf_ptr(buf));
+ udp_free(buf);
+ udp_close(info->tftp_socket);
+ info->tftp_socket = -1;
+ return CFE_ERR_PROTOCOLERR;
+
+ case TFTP_OP_DATA:
+ /*
+ * Yay, we've got data! Store the first block.
+ */
+ ebuf_get_u16_be(buf,block);
+ udp_connect(info->tftp_socket,(uint16_t) buf->eb_usrdata);
+ info->tftp_blknum = block;
+ info->tftp_blklen = ebuf_length(buf);
+ ebuf_get_bytes(buf,info->tftp_data,ebuf_length(buf));
+ udp_free(buf);
+ if (info->tftp_blklen < TFTP_BLOCKSIZE) {
+ info->tftp_lastblock = 1; /* EOF */
+ }
+ return 0;
+ break;
+
+ }
+}
+
+
+/* *********************************************************************
+ * _tftp_readmore(info)
+ *
+ * Read the next block of the file. We do this by acking the
+ * previous block. Once that block is acked, the TFTP server
+ * should send the next block to us.
+ *
+ * Input parameters:
+ * info - TFTP information
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int _tftp_readmore(tftp_info_t *info)
+{
+ ebuf_t *buf;
+ uint16_t cmd,block;
+ int retries;
+
+ /*
+ * If we've already read the last block, there is no more
+ */
+
+ if (info->tftp_lastblock) return 1;
+ if (info->tftp_error) return CFE_ERR_TIMEOUT;
+
+ /*
+ * Otherwise, ack the current block so another one will come
+ */
+
+ for (retries = 0; retries < TFTP_MAX_RETRIES; retries++) {
+
+ buf = udp_alloc();
+ if (!buf) return -1;
+
+ /*
+ * Send the ack
+ */
+
+ ebuf_append_u16_be(buf,TFTP_OP_ACK);
+ ebuf_append_u16_be(buf,info->tftp_blknum);
+ udp_send(info->tftp_socket,buf,info->tftp_ipaddr);
+
+ /*
+ * Wait for some response, retransmitting as necessary
+ */
+
+ /* Foxconn add start by Cliff Wang, 03/23/2010 */
+ buf = udp_recv_with_timeout(info->tftp_socket,tftp_recv_timeout);
+ // buf = udp_recv_with_timeout(info->tftp_socket,TFTP_RECV_TIMEOUT);
+ /* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+ if (buf == NULL) continue;
+
+ /*
+ * Got a response, make sure it's right
+ */
+
+ ebuf_get_u16_be(buf,cmd);
+ if (cmd != TFTP_OP_DATA) {
+ udp_free(buf);
+ continue;
+ }
+
+ ebuf_get_u16_be(buf,block);
+ if (block != (info->tftp_blknum+1)) {
+ udp_free(buf);
+ continue;
+ }
+
+ /*
+ * It's the correct response. Copy the user data
+ */
+
+ info->tftp_blknum = block;
+ info->tftp_blklen = ebuf_length(buf);
+ ebuf_get_bytes(buf,info->tftp_data,ebuf_length(buf));
+ udp_free(buf);
+ break;
+ }
+
+ /*
+ * If the block is less than 512 bytes long, it's the EOF block.
+ */
+
+ if (retries == TFTP_MAX_RETRIES) {
+ info->tftp_error = 1;
+ return CFE_ERR_TIMEOUT;
+ }
+
+ if (info->tftp_blklen < TFTP_BLOCKSIZE) {
+ info->tftp_lastblock = 1; /* EOF */
+ }
+
+ return 0;
+}
+
+/* *********************************************************************
+ * _tftp_writemore(info)
+ *
+ * Write the next block of the file, sending the data from our
+ * holding buffer. Note that the holding buffer must be full
+ * or else we consider this to be an EOF.
+ *
+ * Input parameters:
+ * info - TFTP information
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int _tftp_writemore(tftp_info_t *info)
+{
+ ebuf_t *buf;
+ uint16_t cmd,block,error;
+ int retries;
+
+ /*
+ * If we've already written the last block, there is no more
+ */
+
+ if (info->tftp_lastblock) return 1;
+ if (info->tftp_error) return CFE_ERR_TIMEOUT;
+
+ /*
+ * Otherwise, send a block
+ */
+
+ for (retries = 0; retries < TFTP_MAX_RETRIES; retries++) {
+
+ buf = udp_alloc();
+ if (!buf) return -1;
+
+ /*
+ * Send the data
+ */
+
+ ebuf_append_u16_be(buf,TFTP_OP_DATA);
+ ebuf_append_u16_be(buf,info->tftp_blknum);
+ ebuf_append_bytes(buf,info->tftp_data,info->tftp_blklen);
+ udp_send(info->tftp_socket,buf,info->tftp_ipaddr);
+
+ /*
+ * Wait for some response, retransmitting as necessary
+ */
+
+ /* Foxconn add start by Cliff Wang, 03/23/2010 */
+ buf = udp_recv_with_timeout(info->tftp_socket, tftp_recv_timeout);
+ // buf = udp_recv_with_timeout(info->tftp_socket,TFTP_RECV_TIMEOUT);
+ /* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+ if (buf == NULL) continue;
+
+ /*
+ * Got a response, make sure it's right
+ */
+
+ ebuf_get_u16_be(buf,cmd);
+
+ if (cmd == TFTP_OP_ERROR) {
+ /*
+ * Process the error return (XXX: remove xprintf here)
+ */
+ ebuf_get_u16_be(buf,error);
+ xprintf("TFTP write error %d: %s\n",error,ebuf_ptr(buf));
+ info->tftp_error = 1;
+ info->tftp_lastblock = 1;
+ udp_free(buf);
+ return CFE_ERR_IOERR;
+ }
+
+ if (cmd != TFTP_OP_ACK) {
+ udp_free(buf);
+ continue;
+ }
+
+ ebuf_get_u16_be(buf,block);
+ if (block != (info->tftp_blknum)) {
+ udp_free(buf);
+ continue;
+ }
+
+ /*
+ * It's the correct response. Update the block #
+ */
+
+ info->tftp_blknum++;
+ if (info->tftp_blklen != TFTP_BLOCKSIZE) info->tftp_lastblock = 1;
+ udp_free(buf);
+ break;
+ }
+
+ /*
+ * If we had some failure, mark the stream with an error
+ */
+
+ if (retries == TFTP_MAX_RETRIES) {
+ info->tftp_error = 1;
+ return CFE_ERR_TIMEOUT;
+ }
+
+ return 0;
+}
+
+/* Foxconn add start by Cliff Wang, 03/23/2010 */
+static int _tftpd_open(tftp_info_t *info,char *hostname,char *filename,int mode)
+{
+ ebuf_t *buf = NULL;
+ uint16_t type;
+ int res;
+ int retries;
+ char ch = 0;
+
+ /*
+ * * Open a UDP socket
+ * */
+
+ info->tftp_socket = udp_socket(UDP_PROTO_TFTP);
+ info->tftp_lastblock = 0;
+ info->tftp_error = 0;
+ info->tftp_filemode = mode;
+
+ /*
+ * * Listen for requests
+ * */
+
+ res = udp_bind(info->tftp_socket,UDP_PROTO_TFTP);
+ if (res < 0) return res;
+
+ res = CFE_ERR_TIMEOUT;
+
+ for (retries = 0; retries < tftp_max_retries; retries++) {
+ while (console_status()) {
+ console_read(&ch,1);
+ if (ch == 3) break;
+ }
+
+ if (ch == 3) {
+ res = CFE_ERR_INTR;
+ break;
+ }
+
+ buf = udp_recv_with_timeout(info->tftp_socket,tftp_recv_timeout);
+ if (buf == NULL) continue;
+
+ /*
+ * * Process the request
+ * */
+
+ ebuf_get_u16_be(buf,type);
+
+ switch (type) {
+ case TFTP_OP_RRQ:
+ udp_connect(info->tftp_socket,(uint16_t) buf->eb_usrdata);
+ memcpy(info->tftp_ipaddr,buf->eb_usrptr,IP_ADDR_LEN);
+ info->tftp_blknum = 1;
+ info->tftp_blklen = 0;
+ res = 0;
+ break;
+
+ case TFTP_OP_WRQ:
+ udp_connect(info->tftp_socket,(uint16_t) buf->eb_usrdata);
+ memcpy(info->tftp_ipaddr,buf->eb_usrptr,IP_ADDR_LEN);
+ info->tftp_blknum = 0;
+ res = _tftp_readmore(info);
+ break;
+
+ default:
+ /*
+ * aren't expecting any of these messages
+ * */
+ res = CFE_ERR_PROTOCOLERR;
+ break;
+ }
+
+ udp_free(buf);
+ break;
+ }
+
+ if (res) {
+ udp_close(info->tftp_socket);
+ info->tftp_socket = -1;
+ }
+
+ return res;
+}
+
+
+/* *********************************************************************
+ * _tftp_close(info)
+ *
+ * Close a TFTP file. There are two cases for what we do
+ * here. If we're closing the file mid-stream, send an error
+ * packet to tell the host we're getting out early. Otherwise,
+ * just ack the final packet and the connection will close
+ * gracefully.
+ *
+ * Input parameters:
+ * info - TFTP info
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+static int _tftp_close(tftp_info_t *info)
+{
+ ebuf_t *buf;
+ const char *emsg = "transfer cancelled"; /* some error message */
+
+ if (info->tftp_socket == -1) return 0;
+
+ if (info->tftp_filemode == FILE_MODE_READ) {
+ buf = udp_alloc();
+ if (buf) {
+ /* If we're on the EOF packet, just send an ack */
+ if (info->tftp_lastblock) {
+ ebuf_append_u16_be(buf,TFTP_OP_ACK);
+ ebuf_append_u16_be(buf,info->tftp_blknum);
+ }
+ else {
+ ebuf_append_u16_be(buf,TFTP_OP_ERROR);
+ ebuf_append_u16_be(buf,TFTP_ERR_DISKFULL);
+ ebuf_append_bytes(buf,emsg,strlen(emsg)+1);
+ }
+ udp_send(info->tftp_socket,buf,info->tftp_ipaddr);
+ }
+ }
+ else {
+ /* Just flush out the remaining write data, if any */
+ _tftp_writemore(info);
+ }
+
+ udp_close(info->tftp_socket);
+ info->tftp_socket = -1;
+ return 0;
+}
+
+
+
+/* *********************************************************************
+ * tftp_fileop_init(fsctx,device)
+ *
+ * Create a file system device context for the TFTP service
+ *
+ * Input parameters:
+ * fsctx - location to place context information
+ * device - underlying device (unused)
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int tftp_fileop_init(void **fsctx,void *dev)
+{
+ void *ref;
+
+ ref = KMALLOC(sizeof(tftp_fsctx_t),0);
+
+ if (!ref) return CFE_ERR_NOMEM;
+ *fsctx = ref;
+ return 0;
+}
+
+/* *********************************************************************
+ * tftp_fileop_open(ref,fsctx,filename,mode)
+ *
+ * This is the filesystem entry point for opening a TFTP file.
+ * Allocate a tftp_info structure, open the TFTP file, and
+ * return a handle.
+ *
+ * Input parameters:
+ * ref - location to place reference data (the TFTP structure)
+ * fsctx - filesystem context
+ * filename - name of remote file to open
+ * mode - FILE_MODE_READ or FILE_MODE_WRITE
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int tftp_fileop_open(void **ref,void *fsctx,char *filename,int mode)
+{
+ tftp_info_t *info;
+ char *host;
+ char *file;
+ int res;
+
+ if ((mode != FILE_MODE_READ) && (mode != FILE_MODE_WRITE)) {
+ /* must be either read or write, not both */
+ return CFE_ERR_UNSUPPORTED;
+ }
+
+ /* Allocate the tftp info structure */
+
+ info = KMALLOC(sizeof(tftp_info_t),0);
+ if (!info) {
+ return CFE_ERR_NOMEM;
+ }
+
+
+ info->tftp_filename = lib_strdup(filename);
+ if (!info->tftp_filename) {
+ KFREE(info);
+ return CFE_ERR_NOMEM;
+ }
+
+ lib_chop_filename(info->tftp_filename,&host,&file);
+
+ /* Open the file */
+ /* Foxconn add start by Cliff Wang, 03/23/2010 */
+ if (!*host && !*file) {
+ /* TFTP server if hostname and filename are not specified */
+ res = _tftpd_open(info,host,file,mode);
+ } else {
+ res = _tftp_open(info,host,file,mode);
+ }
+ /* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+ if (res == 0) {
+ info->tftp_blkoffset = 0;
+ info->tftp_fileoffset = 0;
+ *ref = info;
+ }
+ else {
+ KFREE(info->tftp_filename);
+ KFREE(info);
+ *ref = NULL;
+ }
+ return res;
+}
+
+/* *********************************************************************
+ * tftp_fileop_read(ref,buf,len)
+ *
+ * Read some bytes from the remote TFTP file. Do this by copying
+ * data from the block buffer, and reading more data from the
+ * remote file as necessary.
+ *
+ * Input parameters:
+ * ref - tftp_info structure
+ * buf - destination buffer address (NULL to read data and
+ * not copy it anywhere)
+ * len - number of bytes to read
+ *
+ * Return value:
+ * number of bytes read, 0 for EOF, <0 if an error occured.
+ ********************************************************************* */
+
+static int tftp_fileop_read(void *ref,uint8_t *buf,int len)
+{
+ tftp_info_t *info = (tftp_info_t *) ref;
+ int copied = 0;
+ int amtcopy;
+ int res;
+
+ if (info->tftp_error) return CFE_ERR_IOERR;
+ if (info->tftp_filemode == FILE_MODE_WRITE) return CFE_ERR_UNSUPPORTED;
+
+ while (len) {
+
+ if (info->tftp_blkoffset >= info->tftp_blklen) break;
+ amtcopy = len;
+
+ if (amtcopy > (info->tftp_blklen-info->tftp_blkoffset)) {
+ amtcopy = (info->tftp_blklen-info->tftp_blkoffset);
+ }
+
+ if (buf) {
+ memcpy(buf,&(info->tftp_data[info->tftp_blkoffset]),amtcopy);
+ buf += amtcopy;
+ }
+
+ info->tftp_blkoffset += amtcopy;
+ len -= amtcopy;
+ info->tftp_fileoffset += amtcopy;
+ copied += amtcopy;
+
+ if (info->tftp_blkoffset >= info->tftp_blklen) {
+ res = _tftp_readmore(info);
+ if (res != 0) break;
+ info->tftp_blkoffset = 0;
+ }
+ }
+
+ return copied;
+}
+
+/* *********************************************************************
+ * tftp_fileop_write(ref,buf,len)
+ *
+ * Write some bytes to the remote TFTP file. Do this by copying
+ * data to the block buffer, and writing data to the
+ * remote file as necessary.
+ *
+ * Input parameters:
+ * ref - tftp_info structure
+ * buf - source buffer address
+ * len - number of bytes to write
+ *
+ * Return value:
+ * number of bytes written, 0 for EOF, <0 if an error occured.
+ ********************************************************************* */
+
+static int tftp_fileop_write(void *ref,uint8_t *buf,int len)
+{
+ tftp_info_t *info = (tftp_info_t *) ref;
+ int copied = 0;
+ int amtcopy;
+ int res;
+
+ if (info->tftp_error) return CFE_ERR_IOERR;
+ if (info->tftp_filemode == FILE_MODE_READ) return CFE_ERR_UNSUPPORTED;
+
+ while (len) {
+
+ amtcopy = len;
+ if (amtcopy > (TFTP_BLOCKSIZE - info->tftp_blklen)) {
+ amtcopy = (TFTP_BLOCKSIZE - info->tftp_blklen);
+ }
+
+ memcpy(&(info->tftp_data[info->tftp_blklen]),buf,amtcopy);
+ buf += amtcopy;
+
+ info->tftp_blklen += amtcopy;
+ len -= amtcopy;
+ info->tftp_fileoffset += amtcopy;
+ copied += amtcopy;
+
+ if (info->tftp_blklen == TFTP_BLOCKSIZE) {
+ res = _tftp_writemore(info);
+ if (res != 0) {
+ break;
+ }
+ info->tftp_blklen = 0;
+ }
+ }
+
+ return copied;
+}
+
+/* *********************************************************************
+ * tftp_fileop_seek(ref,offset,how)
+ *
+ * Seek within a TFTP file. Note that you can only seek *forward*,
+ * as TFTP doesn't really let you go backwards. (I suppose you
+ * could reopen the file, but thus far nobody needs to go
+ * backwards). You can only seek in a file in read mode.
+ *
+ * Input parameters:
+ * ref - our tftp information
+ * offset - distance to move
+ * how - how to move, (FILE_SEEK_*)
+ *
+ * Return value:
+ * new offset, or <0 if an error occured.
+ ********************************************************************* */
+
+static int tftp_fileop_seek(void *ref,int offset,int how)
+{
+ tftp_info_t *info = (tftp_info_t *) ref;
+ int delta;
+ int startloc;
+ int res;
+
+ if (info->tftp_filemode == FILE_MODE_WRITE) return CFE_ERR_UNSUPPORTED;
+
+ switch (how) {
+ case FILE_SEEK_BEGINNING:
+ startloc = info->tftp_fileoffset;
+ break;
+ case FILE_SEEK_CURRENT:
+ startloc = 0;
+ break;
+ default:
+ startloc = 0;
+ break;
+ }
+
+ delta = offset - startloc;
+ if (delta < 0) {
+ xprintf("Warning: negative seek on tftp file attempted\n");
+ return CFE_ERR_UNSUPPORTED;
+ }
+ res = tftp_fileop_read(ref,NULL,delta);
+ if (res < 0) return res;
+
+ return info->tftp_fileoffset;
+}
+
+
+/* *********************************************************************
+ * tftp_fileop_close(ref)
+ *
+ * Close the TFTP file.
+ *
+ * Input parameters:
+ * ref - our TFTP info
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void tftp_fileop_close(void *ref)
+{
+ tftp_info_t *info = (tftp_info_t *) ref;
+
+ _tftp_close(info);
+
+ KFREE(info->tftp_filename);
+ KFREE(info);
+}
+
+
+/* *********************************************************************
+ * tftp_fileop_uninit(fsctx)
+ *
+ * Uninitialize the filesystem context, freeing allocated
+ * resources.
+ *
+ * Input parameters:
+ * fsctx - our context
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void tftp_fileop_uninit(void *fsctx)
+{
+ KFREE(fsctx);
+}
diff --git a/cfe/cfe/net/net_udp.c b/cfe/cfe/net/net_udp.c
new file mode 100644
index 0000000..968081a
--- /dev/null
+++ b/cfe/cfe/net/net_udp.c
@@ -0,0 +1,637 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * User Datagram Protocol File: net_udp.c
+ *
+ * This module implements the User Datagram Protocol (RFCxxxx)
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_timer.h"
+
+#include "net_ebuf.h"
+#include "net_ether.h"
+
+#include "net_ip.h"
+
+#include "cfe_error.h"
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define UDP_HDR_LENGTH 8
+#define UDP_PORTBASE 1024
+#define UDP_MAX_PORTS 4
+
+/* *********************************************************************
+ * Types
+ ********************************************************************* */
+
+typedef struct udp_port_s udp_port_t;
+
+/*
+ * UDP port structure - describes an open UDP port.
+ */
+
+struct udp_port_s {
+ uint16_t up_destport; /* destination port number */
+ uint16_t up_srcport; /* source port number */
+ queue_t up_rxqueue; /* queue of received packets */
+ int up_maxqueue; /* max # of elements on rx queue */
+ int up_inuse; /* nonzero if port is in use */
+};
+
+
+/*
+ * UDP stack information - describes the entire UDP layer.
+ */
+
+struct udp_info_s {
+ uint16_t ui_portbase;
+ void *ui_ref;
+ ip_info_t *ui_ipinfo;
+ udp_port_t ui_ports[UDP_MAX_PORTS];
+};
+
+/* *********************************************************************
+ * Forward declarations
+ ********************************************************************* */
+
+static int _udp_rx_callback(void *ref,ebuf_t *buf,uint8_t *destaddr,uint8_t *srcaddr);
+
+
+/* *********************************************************************
+ * udp_find_port(info,port)
+ *
+ * Locate an open port. Scan the list of ports looking for one
+ * that is both open and has a matching source port number.
+ *
+ * Input parameters:
+ * info - UDP stack information
+ * port - source port # we're looking for
+ *
+ * Return value:
+ * udp_port_t pointer or NULL if no port was found
+ ********************************************************************* */
+
+static udp_port_t *_udp_find_port(udp_info_t *info,uint16_t port)
+{
+ int idx;
+ udp_port_t *udp = info->ui_ports;
+
+ for (idx = 0; idx < UDP_MAX_PORTS; idx++) {
+ if (udp->up_inuse && (udp->up_srcport == port)) {
+ return udp;
+ }
+ udp++;
+ }
+
+ return NULL;
+}
+
+/* *********************************************************************
+ * _udp_socket(info,port)
+ *
+ * Open a UDP socket. This is an internal function used by
+ * the network API layer.
+ *
+ * Input parameters:
+ * info - UDP stack information
+ * port - port number to open
+ *
+ * Return value:
+ * port number (0 based) or an error code (<0) if an error
+ * occured.
+ ********************************************************************* */
+
+int _udp_socket(udp_info_t *info,uint16_t port)
+{
+ extern int32_t _getticks(void); /* return value of CP0 COUNT */
+ int idx;
+ udp_port_t *udp;
+ uint16_t srcport = UDP_PORTBASE + (_getticks() & 0xFFF);
+
+ while (_udp_find_port(info,srcport)) { /* should always exit */
+ srcport++;
+ if (srcport > (UDP_PORTBASE+4096)) srcport = UDP_PORTBASE;
+ }
+
+ udp = info->ui_ports;
+
+ for (idx = 0; idx < UDP_MAX_PORTS; idx++) {
+ if (!udp->up_inuse) break;
+ udp++;
+ }
+
+ if (idx == UDP_MAX_PORTS) return CFE_ERR_NOHANDLES;
+
+ udp->up_destport = port;
+ udp->up_srcport = srcport;
+ udp->up_maxqueue = 2;
+ udp->up_inuse = TRUE;
+ q_init(&(udp->up_rxqueue));
+
+ return idx;
+}
+
+
+/* *********************************************************************
+ * _udp_close(info,s)
+ *
+ * Internal function to close an open UDP port. This routine is
+ * called by the high-level network API.
+ *
+ * Input parameters:
+ * info - UDP stack information
+ * s - an open UDP socket handle (returned from _udp_open)
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void _udp_close(udp_info_t *info,int s)
+{
+ udp_port_t *udp = &(info->ui_ports[s]);
+ ebuf_t *buf;
+
+ while ((buf = (ebuf_t *) q_deqnext(&(udp->up_rxqueue)))) {
+ _ip_free(info->ui_ipinfo,buf);
+ }
+
+ udp->up_srcport = 0;
+ udp->up_destport = 0;
+ udp->up_maxqueue = 0;
+ udp->up_inuse = FALSE;
+}
+
+/* *********************************************************************
+ * _udp_send(info,s,buf,dest)
+ *
+ * Transmit a UDP datagram. Note that we never send fragmented
+ * datagrams, so all datagrams must be less than the MTU.
+ *
+ * Input parameters:
+ * info - UDP stack information
+ * s - an open UDP socket handle (returned from _udp_open)
+ * buf - an ebuf to send
+ * dest - destination IP address
+ *
+ * Return value:
+ * 0 if packet was sent
+ * else error code
+ ********************************************************************* */
+
+int _udp_send(udp_info_t *info,int s,ebuf_t *buf,uint8_t *dest)
+{
+ udp_port_t *udp = &(info->ui_ports[s]);
+ uint8_t *udphdr;
+ int udplen;
+ uint8_t pseudoheader[12];
+ uint16_t cksum;
+
+ /*
+ * Calculate the length of the IP datagram (includes UDP header)
+ */
+
+ udplen = ebuf_length(buf) + UDP_HDR_LENGTH;
+
+ /*
+ * Build the pseudoheader, which is part of the checksum calculation
+ */
+
+ _ip_getaddr(info->ui_ipinfo,&pseudoheader[0]);
+ memcpy(&pseudoheader[4],dest,IP_ADDR_LEN);
+ pseudoheader[8] = 0;
+ pseudoheader[9] = IPPROTO_UDP;
+ pseudoheader[10] = (udplen >> 8) & 0xFF;
+ pseudoheader[11] = (udplen & 0xFF);
+
+ /*
+ * Back up and build the actual UDP header in the packet
+ */
+
+ ebuf_seek(buf,-UDP_HDR_LENGTH);
+ udphdr = ebuf_ptr(buf);
+
+ ebuf_put_u16_be(buf,udp->up_srcport);
+ ebuf_put_u16_be(buf,udp->up_destport);
+ ebuf_put_u16_be(buf,udplen);
+ ebuf_put_u16_be(buf,0);
+
+ ebuf_prepend(buf,UDP_HDR_LENGTH);
+
+ /*
+ * Checksum the packet and insert the checksum into the header
+ */
+
+ cksum = ip_chksum(0,pseudoheader,sizeof(pseudoheader));
+ cksum = ip_chksum(cksum,udphdr,udplen);
+ cksum = ~cksum;
+ if (cksum == 0) cksum = 0xFFFF;
+ udphdr[6] = (cksum >> 8) & 0xFF;
+ udphdr[7] = (cksum & 0xFF);
+
+ /*
+ * Off it goes!
+ */
+
+ _ip_send(info->ui_ipinfo,buf,dest,IPPROTO_UDP);
+
+ return 0;
+}
+
+/* *********************************************************************
+ * _udp_bind(info,s,port)
+ *
+ * Bind a UDP socket to a particular port number. Basically,
+ * all this means is we set the "source" port number.
+ *
+ * Input parameters:
+ * info - UDP stack information
+ * s - an open UDP socket (from _udp_open)
+ * port - port number to assign to the UDP socket
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+int _udp_bind(udp_info_t *info,int s,uint16_t port)
+{
+ udp_port_t *udp = &(info->ui_ports[s]);
+
+ if (_udp_find_port(info,port)) return CFE_ERR_ALREADYBOUND;
+
+ udp->up_srcport = port;
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * _udp_connect(info,s,port)
+ *
+ * "connect" a UDP socket to a particular port number. Basically,
+ * this just sets the "destination" port number. It is used for
+ * protocols like TFTP where the destination port number changes
+ * after the port is open.
+ *
+ * Input parameters:
+ * info - UDP stack information
+ * s - an open UDP socket (from _udp_open)
+ * port - port number to assign to the UDP socket
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int _udp_connect(udp_info_t *info,int s,uint16_t port)
+{
+ udp_port_t *udp = &(info->ui_ports[s]);
+
+ udp->up_destport = port;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * _udp_rx_callback(ref,buf,destaddr,srcaddr)
+ *
+ * Receive callback routine from the IP layer. When an IP
+ * packet of protocol type "UDP" is received, this routine gets
+ * called.
+ *
+ * Input parameters:
+ * ref - reference data (pointer to our UDP stack info)
+ * buf - the ebuf, currently pointing at the UDP header
+ * destaddr - the destination IP address (usually our IP address)
+ * srcaddr - the source IP address
+ *
+ * Return value:
+ * ETH_KEEP to keep (not deallocate) the packet
+ * ETH_DROP to deallocate the packet.
+ ********************************************************************* */
+
+static int _udp_rx_callback(void *ref,ebuf_t *buf,uint8_t *destaddr,uint8_t *srcaddr)
+{
+ uint8_t pseudoheader[12];
+ int udplen;
+ uint16_t calccksum;
+ uint16_t origcksum;
+ uint8_t *udphdr;
+ uint16_t srcport;
+ uint16_t dstport;
+ uint16_t udplen2;
+ udp_port_t *udp;
+ udp_info_t *info = (udp_info_t *) ref;
+
+
+
+ /*
+ * get a pointer to the UDP header
+ */
+
+ udplen = ebuf_length(buf);
+ udphdr = ebuf_ptr(buf);
+
+ /*
+ * see if we are checking checksums (cksum field != 0)
+ */
+
+ if ((udphdr[6] | udphdr[7]) != 0) {
+
+ /*
+ * construct the pseudoheader for the cksum calculation
+ */
+
+ memcpy(&pseudoheader[0],srcaddr,IP_ADDR_LEN);
+ memcpy(&pseudoheader[4],destaddr,IP_ADDR_LEN);
+ pseudoheader[8] = 0;
+ pseudoheader[9] = IPPROTO_UDP;
+ pseudoheader[10] = (udplen >> 8) & 0xFF;
+ pseudoheader[11] = (udplen & 0xFF);
+
+ origcksum = ((uint16_t) udphdr[6] << 8) | (uint16_t) udphdr[7];
+ udphdr[6] = udphdr[7] = 0;
+
+ calccksum = ip_chksum(0,pseudoheader,sizeof(pseudoheader));
+ calccksum = ip_chksum(calccksum,udphdr,udplen);
+ if (calccksum != 0xffff) {
+ calccksum = ~calccksum;
+ }
+
+ if (calccksum != origcksum) {
+ return ETH_DROP;
+ }
+ }
+
+ /* Read the other UDP header fields from the packet */
+
+ ebuf_get_u16_be(buf,srcport);
+ ebuf_get_u16_be(buf,dstport);
+ ebuf_get_u16_be(buf,udplen2);
+ ebuf_skip(buf,2);
+
+ /*
+ * It's no good if the lengths don't match. The length
+ * reported by IP should be the length in the UDP header + 8
+ */
+
+ if (udplen2 != (uint16_t) udplen) {
+ return ETH_DROP;
+ }
+
+ /*
+ * Okay, start looking for a matching port
+ */
+
+ udp = _udp_find_port(info,dstport);
+ if (!udp) {
+ return ETH_DROP; /* drop packet if no matching port */
+ /* XXX should send ICMP message here */
+ }
+
+ buf->eb_usrdata = (int) srcport;
+ buf->eb_usrptr = srcaddr;
+
+ /*
+ * Drop packet if queue is full
+ */
+
+ if (q_count(&(udp->up_rxqueue)) >= udp->up_maxqueue) {
+ return ETH_DROP;
+ }
+
+ /*
+ * Add to receive queue
+ */
+
+ ebuf_setlength(buf,udplen2-UDP_HDR_LENGTH);
+ q_enqueue(&(udp->up_rxqueue),(queue_t *) buf);
+
+ return ETH_KEEP;
+}
+
+
+/* *********************************************************************
+ * _udp_recv(info,s)
+ *
+ * Receive a packet from the specified UDP socket.
+ *
+ * Input parameters:
+ * info - UDP stack information
+ * s - an open UDP socket handle (from _udp_open)
+ *
+ * Return value:
+ * an ebuf, or NULL if no packets have been received.
+ ********************************************************************* */
+
+ebuf_t *_udp_recv(udp_info_t *info,int s)
+{
+ ebuf_t *buf;
+ udp_port_t *udp = &(info->ui_ports[s]);
+
+ buf = (ebuf_t *) q_deqnext(&(udp->up_rxqueue));
+
+ return buf;
+}
+
+
+/* *********************************************************************
+ * _udp_init(ipi,ref)
+ *
+ * Initialize the UDP module. This routine registers our
+ * protocol with the IP layer.
+ *
+ * Input parameters:
+ * ipi - IP information (including our IP address, etc.)
+ * ref - reference data, stored in our UDP stack structure
+ *
+ * Return value:
+ * udp_info_t (allocated) or NULL if something went wrong.
+ ********************************************************************* */
+
+udp_info_t *_udp_init(ip_info_t *ipi,void *ref)
+{
+ udp_info_t *info;
+ udp_port_t *udp;
+ int idx;
+
+ /*
+ * Allocate some memory for our structure
+ */
+
+ info = KMALLOC(sizeof(udp_info_t),0);
+
+ if (info == NULL) return NULL;
+
+ memset(info,0,sizeof(udp_info_t));
+
+ /*
+ * Fill in the fields.
+ */
+
+ info->ui_ref = ref;
+ info->ui_ipinfo = ipi;
+ udp = info->ui_ports;
+ for (idx = 0; idx < UDP_MAX_PORTS; idx++) {
+ udp->up_inuse = FALSE;
+ q_init(&(udp->up_rxqueue));
+ udp++;
+ }
+
+ /*
+ * Register our protocol with IP
+ */
+
+ _ip_register(ipi,IPPROTO_UDP,_udp_rx_callback,info);
+
+ return info;
+}
+
+
+/* *********************************************************************
+ * _udp_uninit(info)
+ *
+ * Uninitialize the UDP module, deregistering ourselves from the
+ * IP layer.
+ *
+ * Input parameters:
+ * info - UDP stack information
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void _udp_uninit(udp_info_t *info)
+{
+ int idx;
+ udp_port_t *udp;
+ ebuf_t *buf;
+
+ /*
+ * Unregister from IP
+ */
+
+ _ip_deregister(info->ui_ipinfo,IPPROTO_UDP);
+
+ /*
+ * Free up any packets that were waiting
+ */
+
+ udp = info->ui_ports;
+ for (idx = 0; idx < UDP_MAX_PORTS; idx++) {
+ if (udp->up_inuse) {
+ while ((buf = (ebuf_t *) q_deqnext(&(udp->up_rxqueue)))) {
+ _ip_free(info->ui_ipinfo,buf);
+ }
+ }
+ udp++;
+ }
+
+ /*
+ * Free the stack info
+ */
+
+ KFREE(info);
+}
+
+/* *********************************************************************
+ * _udp_alloc(info)
+ *
+ * Allocate a buffer for use with UDP. This routine obtains an
+ * ebuf and adjusts its header to include room for the UDP
+ * header.
+ *
+ * Input parameters:
+ * info - UDP stack information
+ *
+ * Return value:
+ * ebuf, or NULL if there are none left
+ ********************************************************************* */
+
+ebuf_t *_udp_alloc(udp_info_t *info)
+{
+ ebuf_t *buf;
+
+ /*
+ * Get an ebuf
+ */
+
+ buf = _ip_alloc(info->ui_ipinfo);
+
+ if (!buf) return NULL;
+
+ /*
+ * make room for the udp header
+ */
+
+ ebuf_seek(buf,UDP_HDR_LENGTH);
+ ebuf_setlength(buf,0);
+
+ return buf;
+}
+
+/* *********************************************************************
+ * _udp_free(info,buf)
+ *
+ * Return an ebuf to the pool.
+ *
+ * Input parameters:
+ * info - UDP stack info
+ * buf - an ebuf
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void _udp_free(udp_info_t *info,ebuf_t *buf)
+{
+ _ip_free(info->ui_ipinfo,buf);
+}
diff --git a/cfe/cfe/pccons/Makefile b/cfe/cfe/pccons/Makefile
new file mode 100644
index 0000000..09b8610
--- /dev/null
+++ b/cfe/cfe/pccons/Makefile
@@ -0,0 +1,3 @@
+
+CFLAGS += -DCFG_VGACONSOLE=1
+ALLOBJS += vgainit.o vga_subr.o kbd_subr.o x86mem.o dev_pcconsole.o dev_pcconsole2.o
diff --git a/cfe/cfe/pccons/README b/cfe/cfe/pccons/README
new file mode 100644
index 0000000..0160ad5
--- /dev/null
+++ b/cfe/cfe/pccons/README
@@ -0,0 +1,19 @@
+
+This directory contains "PC Console" routines, to enable the
+SWARM board to use PC-style devices for its console. In
+particular, it contains the code to use the X86 emulator
+to initialize the VGA, and code to map scan codes to
+ASCII characters for a PC keyboard.
+
+What is this good for, you ask? Just for fun, mostly. Many of
+us have had this screwy notion that a SWARM could be used as
+a Linux "workstation" if we could get VGA support and USB
+keyboards implemented (oh, yeah, and there's this whole
+matter of PC console support in Linux, and X, and ...).
+
+Like the USB host stack, this is among the least-supported
+portions of CFE. If you find it useful, great! If it doesn't
+work or build properly, let us know, but we may not get to fixing
+it right away.
+
+
diff --git a/cfe/cfe/pccons/dev_pcconsole.c b/cfe/cfe/pccons/dev_pcconsole.c
new file mode 100644
index 0000000..fe85eca
--- /dev/null
+++ b/cfe/cfe/pccons/dev_pcconsole.c
@@ -0,0 +1,339 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * PC Console driver File: dev_pcconsole.c
+ *
+ * A console driver for a PC-style keyboard and mouse
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+
+
+#include "sbmips.h"
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+
+#include "lib_physio.h"
+
+#include "kbd_subr.h"
+#include "vga_subr.h"
+
+#include "bsp_config.h"
+#include "pcireg.h"
+#include "pcivar.h"
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define KBD_RXFULL 1 /* bit set if kb has data */
+#define KBD_TXFULL 2 /* bit set if we can send cmd */
+#define VGA_TEXTBUF_COLOR 0xB8000 /* VGA frame buffer */
+
+#if defined(_P5064_) || defined(_P6064_)
+ #define PCI_MEM_SPACE 0x10000000 /* 128MB: s/w configurable */
+ #define __ISAaddr(addr) ((physaddr_t)(PCI_MEM_SPACE+(addr)))
+#else
+ #define __ISAaddr(addr) ((physaddr_t)0x40000000+(addr))
+#endif
+
+#define cpu_isamap(x,y) __ISAaddr(x)
+
+/* *********************************************************************
+ * Forward references
+ ********************************************************************* */
+
+static void pcconsole_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+
+static int pcconsole_open(cfe_devctx_t *ctx);
+static int pcconsole_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int pcconsole_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat);
+static int pcconsole_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int pcconsole_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int pcconsole_close(cfe_devctx_t *ctx);
+static void pcconsole_poll(cfe_devctx_t *ctx,int64_t ticks);
+
+const static cfe_devdisp_t pcconsole_dispatch = {
+ pcconsole_open,
+ pcconsole_read,
+ pcconsole_inpstat,
+ pcconsole_write,
+ pcconsole_ioctl,
+ pcconsole_close,
+ pcconsole_poll,
+ NULL
+};
+
+const cfe_driver_t pcconsole = {
+ "PC Console",
+ "pcconsole",
+ CFE_DEV_SERIAL,
+ &pcconsole_dispatch,
+ pcconsole_probe
+};
+
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+
+typedef struct pcconsole_s {
+ vga_term_t vga;
+ keystate_t ks;
+ uint32_t kbd_status;
+ uint32_t kbd_data;
+} pcconsole_t;
+
+
+/* *********************************************************************
+ * pcconsole_poll(ctx,ticks)
+ *
+ * Poll routine - check for new keyboard events
+ *
+ * Input parameters:
+ * ctx - device context
+ * ticks - current time
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+
+static void pcconsole_poll(cfe_devctx_t *ctx,int64_t ticks)
+{
+ pcconsole_t *softc = ctx->dev_softc;
+ uint8_t status;
+ uint8_t b;
+
+ status = inb(softc->kbd_status);
+
+ if (status & KBD_RXFULL) {
+ b = inb(softc->kbd_data);
+ kbd_doscan(&(softc->ks),b);
+ }
+}
+
+/* *********************************************************************
+ * pcconsole_waitcmdready(softc)
+ *
+ * Wait for the keyboard to be ready to accept a command
+ *
+ * Input parameters:
+ * softc - console structure
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void pcconsole_waitcmdready(pcconsole_t *softc)
+{
+ uint8_t status;
+ uint8_t data;
+
+ for (;;) {
+ status = inb(softc->kbd_status); /* read status */
+ if (status & KBD_RXFULL) {
+ data = inb(softc->kbd_data); /* get data */
+ kbd_doscan(&(softc->ks),data); /* process scan codes */
+ }
+ if (!(status & KBD_TXFULL)) break; /* stop when kbd ready */
+ }
+}
+
+
+/* *********************************************************************
+ * pcconsole_setleds(ks,leds)
+ *
+ * Callback from the keyboard routines for setting the LEDS
+ *
+ * Input parameters:
+ * ks - keyboard state
+ * leds - new LED state
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+static int pcconsole_setleds(keystate_t *ks,int leds)
+{
+ pcconsole_t *softc = kbd_getref(ks);
+
+ pcconsole_waitcmdready(softc);
+ outb(softc->kbd_data,KBDCMD_SETLEDS);
+ pcconsole_waitcmdready(softc);
+ outb(softc->kbd_data,(leds & 7));
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * pcconsole_probe(drv,probe_a,probe_b,probe_ptr)
+ *
+ * Probe routine. This routine sets up the pcconsole device
+ *
+ * Input parameters:
+ * drv - driver structure
+ * probe_a
+ * probe_b
+ * probe_ptr
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void pcconsole_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr)
+{
+ pcconsole_t *softc;
+ char descr[80];
+ volatile uint8_t *isamem;
+
+ /*
+ * probe_a is
+ * probe_b is
+ * probe_ptr is
+ */
+
+ softc = (pcconsole_t *) KMALLOC(sizeof(pcconsole_t),0);
+ if (softc) {
+ /*
+ * XXX This should not be hardwired.
+ */
+ softc->kbd_status = 0x64;
+ softc->kbd_data = 0x60;
+ kbd_init(&(softc->ks),pcconsole_setleds,softc);
+
+ /*
+ * XXX this should not be hardwired
+ */
+ isamem = (volatile uint8_t *) ((uintptr_t)cpu_isamap(0,1024*1024));
+ vga_init(&(softc->vga),__ISAaddr(VGA_TEXTBUF_COLOR),outb);
+
+ xsprintf(descr,"%s",drv->drv_description,probe_a,probe_b);
+ cfe_attach(drv,softc,NULL,descr);
+ }
+
+}
+
+
+static int pcconsole_open(cfe_devctx_t *ctx)
+{
+ pcconsole_t *softc = ctx->dev_softc;
+
+ outb(softc->kbd_data,KBDCMD_RESET); /* reset keyboard */
+ kbd_init(&(softc->ks),pcconsole_setleds,softc);
+ vga_clear(&(softc->vga));
+ vga_setcursor(&(softc->vga),0,0);
+
+ return 0;
+}
+
+static int pcconsole_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ pcconsole_t *softc = ctx->dev_softc;
+ unsigned char *bptr;
+ int blen;
+
+ pcconsole_poll(ctx,0);
+
+ bptr = buffer->buf_ptr;
+ blen = buffer->buf_length;
+
+ while ((blen > 0) && (kbd_inpstat(&(softc->ks)))) {
+ *bptr++ = (kbd_read(&(softc->ks)) & 0xFF);
+ blen--;
+ }
+
+ buffer->buf_retlen = buffer->buf_length - blen;
+ return 0;
+}
+
+static int pcconsole_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat)
+{
+ pcconsole_t *softc = ctx->dev_softc;
+
+ pcconsole_poll(ctx,0);
+
+ inpstat->inp_status = kbd_inpstat(&(softc->ks)) ? 1 : 0;
+
+ return 0;
+}
+
+static int pcconsole_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ pcconsole_t *softc = ctx->dev_softc;
+ unsigned char *bptr;
+ int blen;
+
+ bptr = buffer->buf_ptr;
+ blen = buffer->buf_length;
+
+ vga_writestr(&(softc->vga),bptr,7,blen);
+
+ buffer->buf_retlen = buffer->buf_length;
+ return 0;
+}
+
+static int pcconsole_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+/* pcconsole_t *softc = ctx->dev_softc;*/
+
+ return -1;
+}
+
+static int pcconsole_close(cfe_devctx_t *ctx)
+{
+/* pcconsole_t *softc = ctx->dev_softc;*/
+
+ return 0;
+}
+
+
diff --git a/cfe/cfe/pccons/dev_pcconsole2.c b/cfe/cfe/pccons/dev_pcconsole2.c
new file mode 100644
index 0000000..e078c13
--- /dev/null
+++ b/cfe/cfe/pccons/dev_pcconsole2.c
@@ -0,0 +1,298 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * PC Console driver File: dev_pcconsole2.c
+ *
+ * A console driver for a PC-style keyboard and mouse
+ *
+ * This version is for USB keyboards. Someday we'll consolidate
+ * everything.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+
+
+#include "sbmips.h"
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_timer.h"
+
+#include "lib_physio.h"
+
+#include "vga_subr.h"
+
+#include "bsp_config.h"
+#include "pcireg.h"
+#include "pcivar.h"
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define KBD_RXFULL 1 /* bit set if kb has data */
+#define KBD_TXFULL 2 /* bit set if we can send cmd */
+#define VGA_TEXTBUF_COLOR 0xB8000 /* VGA frame buffer */
+
+/* XXX SB1250 specific */
+#define __ISAaddr(x)(0x40000000+(x))
+
+/* *********************************************************************
+ * Forward references
+ ********************************************************************* */
+
+int pcconsole_enqueue(uint8_t ch);
+
+static void pcconsole_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+
+static int pcconsole_open(cfe_devctx_t *ctx);
+static int pcconsole_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int pcconsole_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat);
+static int pcconsole_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int pcconsole_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int pcconsole_close(cfe_devctx_t *ctx);
+static void pcconsole_poll(cfe_devctx_t *ctx,int64_t ticks);
+
+const static cfe_devdisp_t pcconsole_dispatch = {
+ pcconsole_open,
+ pcconsole_read,
+ pcconsole_inpstat,
+ pcconsole_write,
+ pcconsole_ioctl,
+ pcconsole_close,
+ pcconsole_poll,
+ NULL
+};
+
+const cfe_driver_t pcconsole2 = {
+ "PC Console (USB)",
+ "pcconsole",
+ CFE_DEV_SERIAL,
+ &pcconsole_dispatch,
+ pcconsole_probe
+};
+
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+#define KBD_QUEUE_LEN 32
+
+typedef struct pcconsole_s {
+ vga_term_t vga;
+ int kbd_in;
+ int kbd_out;
+ uint8_t kbd_data[KBD_QUEUE_LEN];
+} pcconsole_t;
+
+static pcconsole_t *pcconsole_current = NULL;
+
+/* *********************************************************************
+ * pcconsole_poll(ctx,ticks)
+ *
+ * Poll routine - check for new keyboard events
+ *
+ * Input parameters:
+ * ctx - device context
+ * ticks - current time
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+
+static void pcconsole_poll(cfe_devctx_t *ctx,int64_t ticks)
+{
+ /* No polling needed, USB will do the work for us */
+}
+
+
+
+/* *********************************************************************
+ * pcconsole_probe(drv,probe_a,probe_b,probe_ptr)
+ *
+ * Probe routine. This routine sets up the pcconsole device
+ *
+ * Input parameters:
+ * drv - driver structure
+ * probe_a
+ * probe_b
+ * probe_ptr
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void pcconsole_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr)
+{
+ pcconsole_t *softc;
+ char descr[80];
+
+ /*
+ * probe_a is
+ * probe_b is
+ * probe_ptr is
+ */
+
+ softc = (pcconsole_t *) KMALLOC(sizeof(pcconsole_t),0);
+ if (softc) {
+
+ memset(softc,0,sizeof(pcconsole_t));
+
+ /*
+ * XXX this should not be hardwired
+ */
+ vga_init(&(softc->vga),__ISAaddr(VGA_TEXTBUF_COLOR),outb);
+
+ xsprintf(descr,"%s",drv->drv_description,probe_a,probe_b);
+ cfe_attach(drv,softc,NULL,descr);
+ }
+
+}
+
+
+static int pcconsole_open(cfe_devctx_t *ctx)
+{
+ pcconsole_t *softc = ctx->dev_softc;
+
+ pcconsole_current = softc;
+
+ softc->kbd_in = 0;
+ softc->kbd_out = 0;
+
+ vga_clear(&(softc->vga));
+ vga_setcursor(&(softc->vga),0,0);
+
+ return 0;
+}
+
+static int pcconsole_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ pcconsole_t *softc = ctx->dev_softc;
+ unsigned char *bptr;
+ int blen;
+
+ bptr = buffer->buf_ptr;
+ blen = buffer->buf_length;
+
+ while ((blen > 0) && (softc->kbd_in != softc->kbd_out)) {
+ *bptr++ = softc->kbd_data[softc->kbd_out];
+ softc->kbd_out++;
+ if (softc->kbd_out >= KBD_QUEUE_LEN) {
+ softc->kbd_out = 0;
+ }
+ blen--;
+ }
+
+ buffer->buf_retlen = buffer->buf_length - blen;
+ return 0;
+}
+
+static int pcconsole_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat)
+{
+ pcconsole_t *softc = ctx->dev_softc;
+
+ POLL();
+
+ inpstat->inp_status = (softc->kbd_in != softc->kbd_out);
+
+ return 0;
+}
+
+static int pcconsole_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ pcconsole_t *softc = ctx->dev_softc;
+ unsigned char *bptr;
+ int blen;
+
+ bptr = buffer->buf_ptr;
+ blen = buffer->buf_length;
+
+ vga_writestr(&(softc->vga),bptr,7,blen);
+
+ buffer->buf_retlen = buffer->buf_length;
+ return 0;
+}
+
+static int pcconsole_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+/* pcconsole_t *softc = ctx->dev_softc;*/
+
+ return -1;
+}
+
+static int pcconsole_close(cfe_devctx_t *ctx)
+{
+/* pcconsole_t *softc = ctx->dev_softc;*/
+ pcconsole_current = NULL;
+
+ return 0;
+}
+
+/*
+ * Called by USB system to queue characters.
+ */
+int pcconsole_enqueue(uint8_t ch)
+{
+ int newidx;
+
+ if (!pcconsole_current) return -1;
+
+ newidx = pcconsole_current->kbd_in+1;
+ if (newidx >= KBD_QUEUE_LEN) newidx = 0;
+
+ if (newidx == pcconsole_current->kbd_out) return -1;
+
+ pcconsole_current->kbd_data[pcconsole_current->kbd_in] = ch;
+ pcconsole_current->kbd_in = newidx;
+
+ return 0;
+}
diff --git a/cfe/cfe/pccons/kbd_subr.c b/cfe/cfe/pccons/kbd_subr.c
new file mode 100644
index 0000000..860db94
--- /dev/null
+++ b/cfe/cfe/pccons/kbd_subr.c
@@ -0,0 +1,371 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * PC-style keyboard interface File: KBD_SUBR.C
+ *
+ * This module converts a stream of scancodes into ASCII
+ * characters. The scan codes come from a PC-style
+ * keyboard.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+
+#include "kbd_subr.h"
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define FLG_SCROLL 0x0001 /* Toggles: same as bit positions for LEDs! */
+#define FLG_NUM 0x0002
+#define FLG_CAPS 0x0004
+#define FLG_SHIFT 0x0008 /* Shifts */
+#define FLG_CTRL 0x0100
+#define FLG_ALT 0x0200
+#define FLG_FKEY 0x0400 /* function keys */
+#define FLG_NKPD 0x0800 /* numeric keypad */
+#define FLG_ASCII 0x1000 /* regular ASCII character */
+#define FLG_NONE 0x2000
+#define FLG_BREAKBIT 0x80
+
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+#define KC_RESPLEN 4
+typedef struct keycode_s {
+ int kc_type;
+ char kc_normal[KC_RESPLEN];
+ char kc_shifted[KC_RESPLEN];
+ char kc_ctrl[KC_RESPLEN];
+} keycode_t;
+
+
+/* *********************************************************************
+ * Scan code conversion table
+ ********************************************************************* */
+
+static keycode_t scantable[] = {
+ { FLG_NONE, "", "", "" }, /* 0 */
+ { FLG_ASCII, "\033", "\033", "\033" }, /* 1 ESC */
+ { FLG_ASCII, "1", "!", "!" }, /* 2 1 */
+ { FLG_ASCII, "2", "@", "\000" }, /* 3 2 */
+ { FLG_ASCII, "3", "#", "#" }, /* 4 3 */
+ { FLG_ASCII, "4", "$", "$" }, /* 5 4 */
+ { FLG_ASCII, "5", "%", "%" }, /* 6 5 */
+ { FLG_ASCII, "6", "^", "\036" }, /* 7 6 */
+ { FLG_ASCII, "7", "&", "&" }, /* 8 7 */
+ { FLG_ASCII, "8", "*", "\010" }, /* 9 8 */
+ { FLG_ASCII, "9", "(", "(" }, /* 10 9 */
+ { FLG_ASCII, "0", ")", ")" }, /* 11 0 */
+ { FLG_ASCII, "-", "_", "\037" }, /* 12 - */
+ { FLG_ASCII, "=", "+", "+" }, /* 13 = */
+ { FLG_ASCII, "\177", "\177", "\010" }, /* 14 <- */
+ { FLG_ASCII, "\t", "\177\t", "\t" }, /* 15 ->| */
+ { FLG_ASCII, "q", "Q", "\021" }, /* 16 q */
+ { FLG_ASCII, "w", "W", "\027" }, /* 17 w */
+ { FLG_ASCII, "e", "E", "\005" }, /* 18 e */
+ { FLG_ASCII, "r", "R", "\022" }, /* 19 r */
+ { FLG_ASCII, "t", "T", "\024" }, /* 20 t */
+ { FLG_ASCII, "y", "Y", "\031" }, /* 21 y */
+ { FLG_ASCII, "u", "U", "\025" }, /* 22 u */
+ { FLG_ASCII, "i", "I", "\011" }, /* 23 i */
+ { FLG_ASCII, "o", "O", "\017" }, /* 24 o */
+ { FLG_ASCII, "p", "P", "\020" }, /* 25 p */
+ { FLG_ASCII, "[", "{", "\033" }, /* 26 [ */
+ { FLG_ASCII, "]", "}", "\035" }, /* 27 ] */
+ { FLG_ASCII, "\r", "\r", "\n" }, /* 28 ENT */
+ { FLG_CTRL, "", "", "" }, /* 29 CTRL */
+ { FLG_ASCII, "a", "A", "\001" }, /* 30 a */
+ { FLG_ASCII, "s", "S", "\023" }, /* 31 s */
+ { FLG_ASCII, "d", "D", "\004" }, /* 32 d */
+ { FLG_ASCII, "f", "F", "\006" }, /* 33 f */
+ { FLG_ASCII, "g", "G", "\007" }, /* 34 g */
+ { FLG_ASCII, "h", "H", "\010" }, /* 35 h */
+ { FLG_ASCII, "j", "J", "\n" }, /* 36 j */
+ { FLG_ASCII, "k", "K", "\013" }, /* 37 k */
+ { FLG_ASCII, "l", "L", "\014" }, /* 38 l */
+ { FLG_ASCII, ";", ":", ";" }, /* 39 ; */
+ { FLG_ASCII, "'", "\"", "'" }, /* 40 ' */
+ { FLG_ASCII, "`", "~", "`" }, /* 41 ` */
+ { FLG_SHIFT, "", "", "" }, /* 42 SHIFT */
+ { FLG_ASCII, "\\", "|", "\034" }, /* 43 \ */
+ { FLG_ASCII, "z", "Z", "\032" }, /* 44 z */
+ { FLG_ASCII, "x", "X", "\030" }, /* 45 x */
+ { FLG_ASCII, "c", "C", "\003" }, /* 46 c */
+ { FLG_ASCII, "v", "V", "\026" }, /* 47 v */
+ { FLG_ASCII, "b", "B", "\002" }, /* 48 b */
+ { FLG_ASCII, "n", "N", "\016" }, /* 49 n */
+ { FLG_ASCII, "m", "M", "\r" }, /* 50 m */
+ { FLG_ASCII, ",", "<", "<" }, /* 51 , */
+ { FLG_ASCII, ".", ">", ">" }, /* 52 . */
+ { FLG_ASCII, "/", "?", "\037" }, /* 53 / */
+ { FLG_SHIFT, "", "", "" }, /* 54 SHIFT */
+ { FLG_NKPD, "*", "*", "*" }, /* 55 KP* */
+ { FLG_ALT, "", "", "" }, /* 56 ALT */
+ { FLG_ASCII, " ", " ", "\000" }, /* 57 SPC */
+ { FLG_CAPS, "", "", "" }, /* 58 CAPS */
+ { FLG_FKEY, "\033[M", "\033[Y", "\033[k" }, /* 59 f1 */
+ { FLG_FKEY, "\033[N", "\033[Z", "\033[l" }, /* 60 f2 */
+ { FLG_FKEY, "\033[O", "\033[a", "\033[m" }, /* 61 f3 */
+ { FLG_FKEY, "\033[P", "\033[b", "\033[n" }, /* 62 f4 */
+ { FLG_FKEY, "\033[Q", "\033[c", "\033[o" }, /* 63 f5 */
+ { FLG_FKEY, "\033[R", "\033[d", "\033[p" }, /* 64 f6 */
+ { FLG_FKEY, "\033[S", "\033[e", "\033[q" }, /* 65 f7 */
+ { FLG_FKEY, "\033[T", "\033[f", "\033[r" }, /* 66 f8 */
+ { FLG_FKEY, "\033[U", "\033[g", "\033[s" }, /* 67 f9 */
+ { FLG_FKEY, "\033[V", "\033[h", "\033[t" }, /* 68 f10 */
+ { FLG_NUM, "", "", "" }, /* 69 NUMLK */
+ { FLG_SCROLL, "", "", "" }, /* 70 SCRLK */
+ { FLG_NKPD, "7", "\033[H", "7" }, /* 71 KP7 */
+ { FLG_NKPD, "8", "\033[A", "8" }, /* 72 KP8 */
+ { FLG_NKPD, "9", "\033[I", "9" }, /* 73 KP9 */
+ { FLG_NKPD, "-", "-", "-" }, /* 74 KP- */
+ { FLG_NKPD, "4", "\033[D", "4" }, /* 75 KP4 */
+ { FLG_NKPD, "5", "\033[E", "5" }, /* 76 KP5 */
+ { FLG_NKPD, "6", "\033[C", "6" }, /* 77 KP6 */
+ { FLG_NKPD, "+", "+", "+" }, /* 78 KP+ */
+ { FLG_NKPD, "1", "\033[F", "1" }, /* 79 KP1 */
+ { FLG_NKPD, "2", "\033[B", "2" }, /* 80 KP2 */
+ { FLG_NKPD, "3", "\033[G", "3" }, /* 81 KP3 */
+ { FLG_NKPD, "0", "\033[L", "0" }, /* 82 KP0 */
+ { FLG_NKPD, ".", "\177", "." }, /* 83 KP. */
+ { FLG_NONE, "", "", "" }, /* 84 0 */
+ { FLG_NONE, "100", "", "" }, /* 85 0 */
+ { FLG_NONE, "101", "", "" }, /* 86 0 */
+ { FLG_FKEY, "\033[W", "\033[i", "\033[u" }, /* 87 f11 */
+ { FLG_FKEY, "\033[X", "\033[j", "\033[v" }, /* 88 f12 */
+ { FLG_NONE, "102", "", "" }, /* 89 0 */
+ { FLG_NONE, "103", "", "" }, /* 90 0 */
+ { FLG_NONE, "", "", "" }, /* 91 0 */
+ { FLG_NONE, "", "", "" }, /* 92 0 */
+ { FLG_NONE, "", "", "" }, /* 93 0 */
+ { FLG_NONE, "", "", "" }, /* 94 0 */
+ { FLG_NONE, "", "", "" }, /* 95 0 */
+ { FLG_NONE, "", "", "" }, /* 96 0 */
+ { FLG_NONE, "", "", "" }, /* 97 0 */
+ { FLG_NONE, "", "", "" }, /* 98 0 */
+ { FLG_NONE, "", "", "" }, /* 99 0 */
+ { FLG_NONE, "", "", "" }, /* 100 */
+ { FLG_NONE, "", "", "" }, /* 101 */
+ { FLG_NONE, "", "", "" }, /* 102 */
+ { FLG_NONE, "", "", "" }, /* 103 */
+ { FLG_NONE, "", "", "" }, /* 104 */
+ { FLG_NONE, "", "", "" }, /* 105 */
+ { FLG_NONE, "", "", "" }, /* 106 */
+ { FLG_NONE, "", "", "" }, /* 107 */
+ { FLG_NONE, "", "", "" }, /* 108 */
+ { FLG_NONE, "", "", "" }, /* 109 */
+ { FLG_NONE, "", "", "" }, /* 110 */
+ { FLG_NONE, "", "", "" }, /* 111 */
+ { FLG_NONE, "", "", "" }, /* 112 */
+ { FLG_NONE, "", "", "" }, /* 113 */
+ { FLG_NONE, "", "", "" }, /* 114 */
+ { FLG_NONE, "", "", "" }, /* 115 */
+ { FLG_NONE, "", "", "" }, /* 116 */
+ { FLG_NONE, "", "", "" }, /* 117 */
+ { FLG_NONE, "", "", "" }, /* 118 */
+ { FLG_NONE, "", "", "" }, /* 119 */
+ { FLG_NONE, "", "", "" }, /* 120 */
+ { FLG_NONE, "", "", "" }, /* 121 */
+ { FLG_NONE, "", "", "" }, /* 122 */
+ { FLG_NONE, "", "", "" }, /* 123 */
+ { FLG_NONE, "", "", "" }, /* 124 */
+ { FLG_NONE, "", "", "" }, /* 125 */
+ { FLG_NONE, "", "", "" }, /* 126 */
+ { FLG_NONE, "", "", "" }, /* 127 */
+};
+
+
+/* *********************************************************************
+ * KBD_ENQUEUECHAR(ks,ch)
+ *
+ * Put a character on the queue
+ *
+ * Input parameters:
+ * ks - keyboard state
+ * ch - character to enqueue
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void kbd_enqueuechar(keystate_t *ks,char ch)
+{
+ if (((ks->ks_head+1) & (KEYQUEUELEN-1)) == ks->ks_tail) {
+ /* queue is full */
+ return;
+ }
+ ks->ks_queue[ks->ks_head] = ch;
+ ks->ks_head = (ks->ks_head+1) & (KEYQUEUELEN-1);
+}
+
+
+/* *********************************************************************
+ * KBD_DEQUEUECHAR(ks)
+ *
+ * Remove a character from the queue
+ *
+ * Input parameters:
+ * ks - keystate
+ *
+ * Return value:
+ * 0 if no characters in queue
+ * else character from queue
+ ********************************************************************* */
+static int kbd_dequeuechar(keystate_t *ks)
+{
+ char ch;
+
+ if (ks->ks_head == ks->ks_tail) return 0;
+
+ ch = ks->ks_queue[ks->ks_tail];
+ ks->ks_tail = (ks->ks_tail+1) & (KEYQUEUELEN-1);
+ return ch;
+}
+
+/* *********************************************************************
+ * KBD_READ(ks)
+ *
+ * User call to kbd_dequeuechar - remove a character from
+ * the queue.
+ *
+ * Input parameters:
+ * ks - keyboard state
+ *
+ * Return value:
+ * character from queue or 0 if no chars
+ ********************************************************************* */
+
+int kbd_read(keystate_t *ks)
+{
+ return kbd_dequeuechar(ks);
+}
+
+/* *********************************************************************
+ * KBD_INPSTAT(ks)
+ *
+ * Test input status (see if a character is waiting)
+ *
+ * Input parameters:
+ * ks - keyboard state
+ *
+ * Return value:
+ * 0 if no chars waiting, 1 if characters are waiting
+ ********************************************************************* */
+
+int kbd_inpstat(keystate_t *ks)
+{
+ return (ks->ks_head != ks->ks_tail);
+}
+
+
+/* *********************************************************************
+ * KBD_DOSCAN(ks,scan)
+ *
+ * Process a scan code from the keyboard.
+ *
+ * Input parameters:
+ * ks - keyboard state
+ * scan - scan code from the keyboard
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void kbd_doscan(keystate_t *ks,uint8_t scan)
+{
+ int breakflg;
+ keycode_t *code = 0;
+ char *str;
+
+ breakflg = (scan & FLG_BREAKBIT);
+ scan &= ~FLG_BREAKBIT;
+ code = &scantable[scan];
+
+ if (code->kc_type & (FLG_SHIFT|FLG_CTRL|FLG_ALT)) {
+ if (breakflg) ks->ks_shiftflags &= ~code->kc_type;
+ else ks->ks_shiftflags |= code->kc_type;
+ }
+ if (code->kc_type & (FLG_CAPS|FLG_SCROLL|FLG_NUM)) {
+ if (!breakflg) ks->ks_shiftflags ^= code->kc_type;
+ if (ks->ks_setleds) {
+ (*(ks->ks_setleds))(ks,ks->ks_shiftflags & (FLG_CAPS|FLG_SCROLL|FLG_NUM));
+ }
+ }
+ if (code->kc_type & (FLG_ASCII | FLG_FKEY | FLG_NKPD)) {
+ if (ks->ks_shiftflags & (FLG_SHIFT|FLG_CAPS)) str = code->kc_shifted;
+ else if (ks->ks_shiftflags & FLG_CTRL) str = code->kc_ctrl;
+ else str = code->kc_normal;
+ if (!breakflg) {
+ while (*str) {
+ kbd_enqueuechar(ks,*str++);
+ }
+ }
+ }
+}
+
+
+/* *********************************************************************
+ * KBD_INIT(ks,setleds,ref)
+ *
+ * Initialize a keyboard state object.
+ *
+ * Input parameters:
+ * ks - keyboard state
+ * setleds - routine to call when we want to set the state
+ * of the keyboard's LEDs
+ * ref - data to store in the keyboard state object
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void kbd_init(keystate_t *ks,int (*setleds)(keystate_t *,int),void *ref)
+{
+ memset(ks,0,sizeof(keystate_t));
+ ks->ks_setleds = setleds;
+ ks->ks_ref = ref;
+}
diff --git a/cfe/cfe/pccons/kbd_subr.h b/cfe/cfe/pccons/kbd_subr.h
new file mode 100644
index 0000000..f18f8db
--- /dev/null
+++ b/cfe/cfe/pccons/kbd_subr.h
@@ -0,0 +1,82 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * PC-style keyboard interface File: KBD_SUBR.C
+ *
+ * This module converts a stream of scancodes into ASCII
+ * characters. The scan codes come from a PC-style
+ * keyboard.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define KEYQUEUELEN 16
+
+#define KBDCMD_RESET 0xFF
+#define KBDCMD_SETLEDS 0xED
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+typedef struct keystate_s {
+ int ks_shiftflags;
+ char ks_queue[KEYQUEUELEN];
+ int ks_head;
+ int ks_tail;
+ int (*ks_setleds)(struct keystate_s *ks,int leds);
+ void *ks_ref;
+} keystate_t;
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+int kbd_read(keystate_t *ks);
+int kbd_inpstat(keystate_t *ks);
+void kbd_init(keystate_t *ks,int (*setleds)(keystate_t *,int),void *ref);
+void kbd_doscan(keystate_t *ks,uint8_t scan);
+#define kbd_getref(x) ((x)->ks_ref)
+
+
diff --git a/cfe/cfe/pccons/pcibios.h b/cfe/cfe/pccons/pcibios.h
new file mode 100644
index 0000000..8da8648
--- /dev/null
+++ b/cfe/cfe/pccons/pcibios.h
@@ -0,0 +1,72 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * PCI BIOS constants File: PCIBIOS.H
+ *
+ * This module contains constants related to the X86's PCI
+ * BIOS, as described in the PCI BIOS specification.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#define PCIBIOS_FN_MAJOR 0xB1
+#define PCIBIOS_FN_INSTCHK 0x01
+#define PCIBIOS_FN_FINDDEV 0x02
+#define PCIBIOS_FN_FINDCLASS 0x03
+#define PCIBIOS_FN_RDCFGBYTE 0x08
+#define PCIBIOS_FN_RDCFGWORD 0x09
+#define PCIBIOS_FN_RDCFGDWORD 0x0A
+
+#define PCIBIOS_FN_WRCFGBYTE 0x0B
+#define PCIBIOS_FN_WRCFGWORD 0x0C
+#define PCIBIOS_FN_WRCFGDWORD 0x0D
+#define PCIBIOS_SUCCESSFUL 0
+#define PCIBIOS_DEVICE_NOT_FOUND 0x86
+
+#define PCIBIOS_VERSION 0x0210
+#define PCIBIOS_SIGNATURE 0x20494350
+
+#define PCIBIOS_ROMSIG_OFFSET 0
+#define PCIBIOS_ROMSIG1 0x55
+#define PCIBIOS_ROMSIG2 0xAA
+#define PCIBIOS_ROMSIZE(x) ((unsigned int)(x)*512)
+
+#define PCIBIOS_ROMSIZE_OFFSET 2
+#define PCIBIOS_ROMENTRY_OFFSET 3
diff --git a/cfe/cfe/pccons/vga.h b/cfe/cfe/pccons/vga.h
new file mode 100644
index 0000000..5c43664
--- /dev/null
+++ b/cfe/cfe/pccons/vga.h
@@ -0,0 +1,76 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * VGA definitions File: VGA.H
+ *
+ * This module contains names of the registers and bits
+ * commonly used on VGA adapters.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+
+#define VGA_GFXCTL_INDEX 0x3CE
+#define VGA_GFXCTL_DATA 0x3CF
+#define VGA_CRTC_INDEX 0x3D4
+#define VGA_CRTC_DATA 0x3D5
+#define VGA_SEQ_INDEX 0x3C4
+#define VGA_SEQ_DATA 0x3C5
+#define VGA_INPSTATUS_R 0x3C2
+#define VGA_MISCOUTPUT_W 0x3C2
+#define VGA_MISCOUTPUT_R 0x3CC
+#define VGA_ATTRIB_INDEX 0x3C0
+#define VGA_ATTRIB_DATA 0x3C1
+#define VGA_FEATURES_W 0x3DA
+#define VGA_EXT_INDEX 0x3D6
+#define VGA_EXT_DATA 0x3D7
+
+#define CRTC_CURSOR_HIGH 0x0E
+#define CRTC_CURSOR_LOW 0x0F
+
+#define VGA_TEXTBUF_COLOR 0xB8000
+#define VGA_TEXTBUF_MONO 0xB0000
+#define VGA_TEXTBUF_SIZE 0x8000
+
+#define VGA_ATTRIB_MONO 7
+
+#define VGA_TEXTMODE_COLS 80
+#define VGA_TEXTMODE_ROWS 25
+
diff --git a/cfe/cfe/pccons/vga_subr.c b/cfe/cfe/pccons/vga_subr.c
new file mode 100644
index 0000000..7704054
--- /dev/null
+++ b/cfe/cfe/pccons/vga_subr.c
@@ -0,0 +1,285 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * VGA "teletype" routines File: VGA_SUBR.C
+ *
+ * These routines implement a simple "glass tty" interface
+ * to a vga monitor.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+#include "lib_malloc.h"
+
+#include "lib_physio.h"
+
+#include "vga_subr.h"
+#include "vga.h"
+
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#define OUTB(vga,port,val) (*((vga)->vga_outb))(port,val)
+
+#ifdef __MIPSEB
+#define VGA_SPACE_CHAR 0x2007 /* belongs somewhere else */
+#else
+#define VGA_SPACE_CHAR 0x0720
+#endif
+
+/* *********************************************************************
+ * Data
+ ********************************************************************* */
+
+
+/* *********************************************************************
+ * VGA_CLEAR(vga)
+ *
+ * Clear the VGA screen
+ *
+ * Input parameters:
+ * vga - VGA object
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void vga_clear(vga_term_t *vga)
+{
+ int idx;
+
+ /* Clear the frame buffer */
+
+ for (idx = 0; idx < VGA_TEXTBUF_SIZE; idx+=2) {
+ phys_write16(vga->vga_buffer+idx,VGA_SPACE_CHAR);
+ }
+}
+
+
+/* *********************************************************************
+ * VGA_SETCURSOR(vga,x,y)
+ *
+ * Set the hardware cursor position
+ *
+ * Input parameters:
+ * vga - VGA object
+ * x,y - cursor location
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void vga_setcursor(vga_term_t *vga,int x,int y)
+{
+ unsigned int loc = y*vga->vga_ncols + x;
+
+ OUTB(vga,VGA_CRTC_INDEX,CRTC_CURSOR_HIGH);
+ OUTB(vga,VGA_CRTC_DATA,(loc >> 8) & 0xFF);
+ OUTB(vga,VGA_CRTC_INDEX,CRTC_CURSOR_LOW);
+ OUTB(vga,VGA_CRTC_DATA,(loc >> 0) & 0xFF);
+
+ vga->vga_cursorX = x;
+ vga->vga_cursorY = y;
+}
+
+/* *********************************************************************
+ * VGA_SCROLL(vga)
+ *
+ * Scroll the display up one line
+ *
+ * Input parameters:
+ * vga - VGA object
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void vga_scroll(vga_term_t *vga)
+{
+ int idx;
+ int count;
+ int rowsize;
+ uint32_t t;
+
+ rowsize = vga->vga_ncols * 2;
+ count = (vga->vga_nrows-1) * rowsize;
+
+ for (idx = 0; idx < count; idx+=4) {
+ t = phys_read32(vga->vga_buffer+idx+rowsize);
+ phys_write32(vga->vga_buffer+idx,t);
+ }
+
+ for (idx = 0; idx < rowsize; idx += 2) {
+ phys_write16(vga->vga_buffer+(vga->vga_nrows-1)*rowsize+idx,VGA_SPACE_CHAR);
+ }
+
+ vga_setcursor(vga,0,vga->vga_nrows-1);
+}
+
+/* *********************************************************************
+ * VGA_WRITECHAR(vga,ch,attr)
+ *
+ * Write a character to the display. This routine also
+ * interprets some rudimentary control characters, such
+ * as tab, backspace, linefeed, and carriage return.
+ *
+ * Input parameters:
+ * vga - VGA object
+ * ch - character to write
+ * attr - attribute byte for new character
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void vga_writechar(vga_term_t *vga,uint8_t ch,uint8_t attr)
+{
+ physaddr_t addr;
+
+ switch (ch) {
+ case 0x07:
+ break;
+ case 0x09:
+ vga_writechar(vga,' ',attr);
+ while (vga->vga_cursorX % 8) vga_writechar(vga,' ',attr);
+ break;
+ case 0x0A:
+ vga->vga_cursorY++;
+ if (vga->vga_cursorY > (vga->vga_nrows-1)) {
+ vga_scroll(vga);
+ }
+ break;
+ case 0x08:
+ if (vga->vga_cursorX) {
+ vga->vga_cursorX--;
+ addr = vga->vga_buffer + (vga->vga_cursorX*2+vga->vga_cursorY*vga->vga_ncols*2);
+ phys_write8(addr,' ');
+ }
+ break;
+ case 0x0D:
+ vga->vga_cursorX = 0;
+ break;
+ default:
+ addr = vga->vga_buffer + (vga->vga_cursorX*2+vga->vga_cursorY*vga->vga_ncols*2);
+ phys_write8(addr,ch);
+ phys_write8(addr+1,attr);
+ vga->vga_cursorX++;
+ if (vga->vga_cursorX > (vga->vga_ncols-1)) {
+ vga->vga_cursorX = 0;
+ vga->vga_cursorY++;
+ if (vga->vga_cursorY > (vga->vga_nrows-1)) {
+ vga_scroll(vga);
+ }
+ }
+ break;
+ }
+
+ vga_setcursor(vga,vga->vga_cursorX,vga->vga_cursorY);
+}
+
+/* *********************************************************************
+ * VGA_WRITESTR(vga,str,attr,len)
+ *
+ * Write a string of characters to the VGA
+ *
+ * Input parameters:
+ * vga - VGA object
+ * str - pointer to buffer
+ * attr - attribute byte for characters we're writing
+ * len - number of characters to write
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void vga_writestr(vga_term_t *vga,uint8_t *str,uint8_t attr,int len)
+{
+ while (len) {
+ vga_writechar(vga,*str,attr);
+ str++;
+ len--;
+ }
+}
+
+/* *********************************************************************
+ * VGA_RESET(vga)
+ *
+ * (mostly unused) - reset the VGA
+ *
+ * Input parameters:
+ * vga - vga object
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void vga_reset(vga_term_t *vga)
+{
+ vga_clear(vga);
+}
+
+/* *********************************************************************
+ * VGA_INIT(vga,buffer,outfunc)
+ *
+ * Initialize a VGA object
+ *
+ * Input parameters:
+ * vga - VGA object
+ * buffer - pointer to VGA-style frame buffer (physical addr)
+ * outfunc - pointer to function to write ISA I/O ports
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void vga_init(vga_term_t *vga,physaddr_t buffer,void (*outfunc)(unsigned int port,uint8_t val))
+{
+ vga->vga_buffer = buffer;
+ vga->vga_cursorX = 0;
+ vga->vga_cursorY = 0;
+ vga->vga_nrows = VGA_TEXTMODE_ROWS;
+ vga->vga_ncols = VGA_TEXTMODE_COLS;
+ vga->vga_outb = outfunc;
+}
diff --git a/cfe/cfe/pccons/vga_subr.h b/cfe/cfe/pccons/vga_subr.h
new file mode 100644
index 0000000..eb0e0e0
--- /dev/null
+++ b/cfe/cfe/pccons/vga_subr.h
@@ -0,0 +1,82 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * VGA "teletype" routines File: VGA_SUBR.H
+ *
+ * These routines implement a simple "glass tty" interface
+ * to a vga monitor.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+typedef struct vga_term_s {
+ physaddr_t vga_buffer;
+ int vga_nrows;
+ int vga_ncols;
+ int vga_cursorX;
+ int vga_cursorY;
+ void (*vga_outb)(unsigned int isaport,uint8_t val);
+} vga_term_t;
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+
+void vga_clear(vga_term_t *vga);
+void vga_setcursor(vga_term_t *vga,int x,int y);
+void vga_writechar(vga_term_t *vga,uint8_t ch,uint8_t attr);
+void vga_writestr(vga_term_t *vga,uint8_t *str,uint8_t attr,int len);
+void vga_reset(vga_term_t *vga);
+void vga_init(vga_term_t *vga,physaddr_t buffer,void (*outfunc)(unsigned int port,uint8_t val));
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cfe/cfe/pccons/vgainit.c b/cfe/cfe/pccons/vgainit.c
new file mode 100644
index 0000000..7c22af2
--- /dev/null
+++ b/cfe/cfe/pccons/vgainit.c
@@ -0,0 +1,1164 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * VGA BIOS initialization File: VGAINIT.C
+ *
+ * This module interfaces with the X86 emulator borrowed from
+ * XFree86 to do VGA initialization.
+ *
+ * WARNING: This code is SB1250-specific for now. It's not
+ * hard to change, but then again, aren't we interested in the 1250?
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "sbmips.h"
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+#include "lib_malloc.h"
+#include "pcireg.h"
+#include "pcivar.h"
+#include "cfe_console.h"
+#include "vga.h"
+#include "pcibios.h"
+#include "lib_physio.h"
+#include "vga_subr.h"
+#include "x86mem.h"
+#include "x86emu.h"
+#include "env_subr.h"
+
+
+/* *********************************************************************
+ * Configuration
+ ********************************************************************* */
+
+#define BYTESONLY 0 /* Always write registers as bytes */
+#define VGAINIT_NOISY 0 /* lots of debug output */
+
+/* *********************************************************************
+ * ISA port macros - currently SB1250-specific
+ ********************************************************************* */
+
+#define INB(x) inb(x)
+#define INW(x) inw(x)
+#define INL(x) inl(x)
+#define OUTB(x,y) outb(x,y)
+#define OUTW(x,y) outw(x,y)
+#define OUTL(x,y) outl(x,y)
+
+/* *********************************************************************
+ * ISA memory macros - currently SB1250-specific
+ ********************************************************************* */
+
+typedef uintptr_t vm_offset_t;
+
+#if defined(_P5064_) || defined(_P6064_)
+ #define PCI_MEM_SPACE 0x10000000 /* 128MB: s/w configurable */
+ #define __ISAaddr(addr) ((physaddr_t)(PCI_MEM_SPACE+(addr)))
+#else
+ #define __ISAaddr(addr) ((physaddr_t)0x40000000+(addr))
+#endif
+
+#define __ISAreadbyte(addr) phys_read8(__ISAaddr(addr))
+#define __ISAreadword(addr) phys_read16(__ISAaddr(addr))
+#define __ISAreaddword(addr) phys_read32(__ISAaddr(addr))
+#define __ISAwritebyte(addr,data) phys_write8(__ISAaddr(addr),(data))
+#define __ISAwriteword(addr,data) phys_write16(__ISAaddr(addr),(data))
+#define __ISAwritedword(addr,data) phys_write32(__ISAaddr(addr),(data))
+
+/* *********************************************************************
+ * Other macros
+ ********************************************************************* */
+
+#define OFFSET(addr) (((addr) >> 0) & 0xffff)
+#define SEGMENT(addr) (((addr) >> 4) & 0xf000)
+
+#define BSWAP_SHORT(s) ((((s) >> 8) & 0xFF) | (((s)&0xFF) << 8))
+#define BSWAP_LONG(s) ((((s) & 0xFF000000) >> 24) | \
+ (((s) & 0x00FF0000) >> 8) | \
+ (((s) & 0x0000FF00) << 8) | \
+ (((s) & 0x000000FF) << 24))
+
+
+#ifdef __MIPSEB
+#define CPU_TO_LE16(s) BSWAP_SHORT(s)
+#define CPU_TO_LE32(s) BSWAP_LONG(s)
+#define LE16_TO_CPU(s) BSWAP_SHORT(s)
+#define LE32_TO_CPU(s) BSWAP_LONG(s)
+#else
+#define CPU_TO_LE16(s) (s)
+#define CPU_TO_LE32(s) (s)
+#define LE16_TO_CPU(s) (s)
+#define LE32_TO_CPU(s) (s)
+#endif
+
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+int vga_biosinit(void);
+int vga_probe(void);
+extern void ui_restart(int);
+void vgaraw_dump(char *tail);
+int x86emutest(void);
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+static vga_term_t vga;
+static x86mem_t x86mem;
+
+#define BIOSRAMLOC (0xC0000)
+#define STACKSIZE 4096
+#define IRETOFFSET 12
+static uint8_t x86initcode[] = {
+#if (VGA_TEXTMODE_ROWS == 60)
+ 0xB8,0x02,0x4F, /* mov ax,042F */
+ 0xBB,0x08,0x01, /* mov bx,0108 */ /* VESA 80x60 */
+#else
+ 0xB8,0x03,0x00, /* mov AX,0003 */ /* 80x25 mode */
+#endif
+
+ 0xCD,0x10, /* int 10 */
+ 0xB8,0x34,0x12, /* mov ax,1234 */
+ 0xBB,0x78,0x56, /* mov bx,5678 */
+ 0xCC, /* int 3 */
+ 0xCF}; /* IRET */
+
+static uint8_t x86testcode[] = {
+ 0x90,0x90,0x90,0x90,0x90, /* nop, nop, nop, nop, nop */
+ 0xeb,0x09, /* jmp 10 */
+ 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, /* 9 nops */
+ 0xb8,0x34,0x12, /* mov ax,1234 */
+ 0xbb,0x78,0x56, /* mov bx,5678 */
+ 0xcc, /* int 3 */
+ 0xcf}; /* iret */
+
+static uint32_t __ISAreadmem(x86mem_t *mem,uint32_t addr,int size)
+{
+ unsigned long val;
+
+ switch (size) {
+ case M_BYTE:
+ val = __ISAreadbyte(addr);
+ break;
+ case M_WORD:
+ if (BYTESONLY || (addr & 0x1)) {
+ val = (__ISAreadbyte(addr) | (__ISAreadbyte(addr + 1) << 8));
+ }
+ else {
+ val = __ISAreadword(addr);
+ val = LE16_TO_CPU(val);
+ }
+ break;
+ case M_DWORD:
+ if (BYTESONLY || (addr & 0x3)) {
+ val = (__ISAreadbyte(addr) |
+ (__ISAreadbyte(addr + 1) << 8) |
+ (__ISAreadbyte(addr + 2) << 16) |
+ (__ISAreadbyte(addr + 3) << 24));
+ }
+ else {
+ val = __ISAreaddword(addr);
+ val = LE32_TO_CPU(val);
+ }
+ break;
+ default:
+ val = 0;
+ }
+
+ return val;
+}
+
+
+
+static void __ISAwritemem(x86mem_t *mem,uint32_t addr,uint32_t data,int size)
+{
+ switch (size) {
+ case M_BYTE:
+ __ISAwritebyte(addr, data);
+ break;
+
+ case M_WORD:
+ if (BYTESONLY || (addr & 0x1)) {
+ __ISAwritebyte(addr, data >> 0);
+ __ISAwritebyte(addr + 1, data >> 8);
+ }
+ else {
+ data = CPU_TO_LE16(data);
+ __ISAwriteword(addr, data);
+ }
+ break;
+
+ case M_DWORD:
+ if (BYTESONLY || (addr & 0x3)) {
+ __ISAwritebyte(addr, data >> 0);
+ __ISAwritebyte(addr + 1, data >> 8);
+ __ISAwritebyte(addr + 2, data >> 16);
+ __ISAwritebyte(addr + 3, data >> 24);
+ }
+ else {
+ data = CPU_TO_LE32(data);
+ __ISAwritedword(addr, data);
+ }
+ break;
+ }
+}
+
+
+static u8 __x86emu_rdb(u32 addr)
+{
+#if VGAINIT_NOISY
+ if ((addr < 0x400) || (addr > 0x100000)) {
+ xprintf("Read %08X (int %02X) ",addr,addr/4);
+ printf("CS:IP = %04X:%04X\n",M.x86.R_CS,M.x86.R_IP);
+ }
+#endif
+ return x86mem_readb(&x86mem,addr);
+}
+
+
+static u16 __x86emu_rdw(u32 addr)
+{
+#if VGAINIT_NOISY
+ if ((addr < 0x400) || (addr > 0x100000)) {
+ xprintf("Read %08X (int %02X) ",addr,addr/4);
+ printf("CS:IP = %04X:%04X\n",M.x86.R_CS,M.x86.R_IP);
+ }
+#endif
+ return x86mem_readw(&x86mem,addr);
+}
+
+
+static u32 __x86emu_rdl(u32 addr)
+{
+#if VGAINIT_NOISY
+ if ((addr < 0x400) || (addr > 0x100000)) {
+ xprintf("Read %08X (int %02X) ",addr,addr/4);
+ printf("CS:IP = %04X:%04X\n",M.x86.R_CS,M.x86.R_IP);
+ }
+#endif
+ return x86mem_readl(&x86mem,addr);
+}
+
+
+static void __x86emu_wrb(u32 addr, u8 val)
+{
+#if VGAINIT_NOISY
+ if ((addr < 0x400) || (addr > 0x100000)) {
+ xprintf("Write %08X (int %02X) ",addr,addr/4);
+ printf("CS:IP = %04X:%04X\n",M.x86.R_CS,M.x86.R_IP);
+ }
+#endif
+ x86mem_writeb(&x86mem,addr,val);
+}
+
+
+static void __x86emu_wrw(u32 addr, u16 val)
+{
+#if VGAINIT_NOISY
+ if ((addr < 0x400) || (addr > 0x100000)) {
+ xprintf("Write %08X %04X (int %02X) ",addr,val,addr/4);
+ printf("CS:IP = %04X:%04X\n",M.x86.R_CS,M.x86.R_IP);
+ }
+#endif
+ x86mem_writew(&x86mem,addr,val);
+}
+
+
+static void __x86emu_wrl(u32 addr, u32 val)
+{
+#if VGAINIT_NOISY
+ if ((addr < 0x400) || (addr > 0x100000)) {
+ xprintf("Write %08X (int %02X) ",addr,addr/4);
+ printf("CS:IP = %04X:%04X\n",M.x86.R_CS,M.x86.R_IP);
+ }
+#endif
+ x86mem_writel(&x86mem,addr,val);
+}
+
+
+#define TS_COMMAND 0
+#define TS_DATA1 1
+#define TS_DATA2 2
+static uint16_t timerCount = 0;
+static int timerState = TS_COMMAND;
+static u8 __x86emu_inb(X86EMU_pioAddr port)
+{
+ u8 val;
+
+ /*
+ * Emulate just enough functionality of the
+ * timer chip to fool the Trident BIOS
+ */
+ if (port == 0x40) {
+ timerCount++;
+ switch (timerState) {
+ case TS_COMMAND:
+ return 0;
+ case TS_DATA1:
+ timerState = TS_DATA1;
+ return timerCount & 0xFF;
+ case TS_DATA2:
+ timerState = TS_COMMAND;
+ return (timerCount >> 8) & 0xFF;
+ }
+ }
+
+ val = INB(port);
+
+#if VGAINIT_NOISY
+ /*if (port < 0x100)*/ xprintf("INB %08X %02X\n",port,val);
+ if (console_status()) ui_restart(0);
+#endif
+
+
+ return val;
+}
+
+
+static u16 __x86emu_inw(X86EMU_pioAddr port)
+{
+ u16 val;
+
+ val = INW(port);
+
+ val = LE16_TO_CPU(val);
+
+#if VGAINIT_NOISY
+ /*if (port < 0x100)*/ xprintf("INW %08X %04X\n",port,val);
+#endif
+
+ return val;
+}
+
+
+static u32 __x86emu_inl(X86EMU_pioAddr port)
+{
+ u32 val;
+
+ val = INL(port);
+
+ val = LE32_TO_CPU(val);
+
+#if VGAINIT_NOISY
+ /*if (port < 0x100)*/ xprintf("INL %08X %08X\n",port,val);
+#endif
+
+
+ return val;
+}
+
+
+static void __x86emu_outb(X86EMU_pioAddr port, u8 val)
+{
+ /*
+ * Emulate just enough functionality of the timer
+ * chip to fool the Trident BIOS
+ */
+ if (port == 0x43) {
+ timerCount++;
+ timerState = TS_DATA1;
+ return;
+ }
+
+#if VGAINIT_NOISY
+ /*if (port < 0x100)*/ xprintf("OUTB %08X %08X\n",port,val);
+#endif
+
+ OUTB(port,val);
+}
+
+
+static void __x86emu_outw(X86EMU_pioAddr port, u16 val)
+{
+ val = CPU_TO_LE16(val);
+
+#if VGAINIT_NOISY
+ /*if (port < 0x100)*/ xprintf("OUTW %08X %04X ",port,val);
+ printf("CS:IP = %04X:%04X\n",M.x86.R_CS,M.x86.R_IP);
+#endif
+
+ OUTW(port,val);
+}
+
+
+static void __x86emu_outl(X86EMU_pioAddr port, u32 val)
+{
+ if (port == 0x2D) return;
+
+ val = CPU_TO_LE32(val);
+
+#if VGAINIT_NOISY
+ /*if (port < 0x100)*/ xprintf("OUTL %08X %08X ",port,val);
+ printf("CS:IP = %04X:%04X\n",M.x86.R_CS,M.x86.R_IP);
+#endif
+
+
+ OUTL(port,val);
+}
+
+
+static void regs2tag(pcitag_t *tag)
+{
+ pcitag_t mytag;
+ int bus,device,function;
+
+ bus = M.x86.R_BH;
+ device = M.x86.R_BL >> 3;
+ function = M.x86.R_BL & 0x07;
+
+ mytag = pci_make_tag(bus,device,function);
+
+ *tag = mytag;
+}
+
+static void __SIMint10(int intno)
+{
+#if VGAINIT_NOISY
+ xprintf("Int10: BIOS function AX=%04X\n",M.x86.R_AX);
+#endif
+
+ /*
+ * The only BIOS function that VGAs appear to
+ * depend on in the real BIOS is the one
+ * that enables/disables video memory.
+ */
+
+ if ((M.x86.R_AH == 0x12) && (M.x86.R_BL == 0x32)) {
+ if (M.x86.R_AL == 0) {
+ /* enable video memory */
+ __x86emu_outb(VGA_MISCOUTPUT_W, __x86emu_inb(VGA_MISCOUTPUT_R) | 0x02);
+ return;
+ }
+ else if (M.x86.R_AL == 1) {
+ /* disable video memory */
+ __x86emu_outb(VGA_MISCOUTPUT_W, __x86emu_inb(VGA_MISCOUTPUT_R) & ~0x02);
+ return;
+ }
+ else {
+ xprintf("Int10 unknown function AX=%04X\n",
+ M.x86.R_AX);
+ }
+ }
+ else {
+
+ /* Otherwise, pass the int10 on to the ROM */
+
+ X86EMU_prepareForInt(0x10);
+ }
+}
+
+
+static void __SIMint3(int intno)
+{
+#if VGAINIT_NOISY
+ xprintf("Int3: Breakpoint reached.\n");
+#endif
+ HALT_SYS();
+}
+
+
+static void __SIMintunk(int intno)
+{
+#if VGAINIT_NOISY
+ xprintf("Int%02X: Unhandled interrupt!\n",intno);
+#endif
+ HALT_SYS();
+}
+
+static void __SIMint42(int intno)
+{
+#if VGAINIT_NOISY
+ xprintf("Int42: Function AX=%04X\n",M.x86.R_AX);
+#endif
+ switch (M.x86.R_AH) {
+ case 0:
+ vga_reset(&vga);
+ break;
+ default:
+#if VGAINIT_NOISY
+ xprintf("Int42: Unknown INT42 command: %x\n",M.x86.R_AH);
+#endif
+ break;
+ }
+}
+
+
+static void __SIMint6D(int intno)
+{
+ int reflect = 1;
+
+#if VGAINIT_NOISY
+ xprintf("Int6D: Function AX=%04X\n",M.x86.R_AX);
+#endif
+
+ switch (M.x86.R_AH) {
+ case 0:
+ break;
+ case 0x13:
+ if (M.x86.R_AL == 1) {
+ unsigned long addr;
+ unsigned long count;
+ uint8_t ch;
+
+ addr = (M.x86.R_ES << 4) + M.x86.R_BP;
+ count = M.x86.R_CX;
+
+ while (count) {
+ ch = __x86emu_rdb(addr);
+ vga_writechar(&vga,ch,M.x86.R_BL);
+ addr++;
+ count--;
+ }
+ reflect = 0;
+ }
+ break;
+ default:
+#if VGAINIT_NOISY
+ xprintf("Unknown INT6D command: %x\n",M.x86.R_AH);
+#endif
+ break;
+ }
+
+ if (reflect) X86EMU_prepareForInt(0x6D);
+}
+
+
+
+static void __SIMint1A(int intno)
+{
+ pcitag_t tag;
+ int bus,device,function;
+ int ret;
+
+ if (M.x86.R_AH != PCIBIOS_FN_MAJOR) return;
+
+ switch (M.x86.R_AL) {
+ case PCIBIOS_FN_INSTCHK:
+ M.x86.R_EAX = 0x00;
+ M.x86.R_AL = 0x01;
+ M.x86.R_EDX = PCIBIOS_SIGNATURE;
+ M.x86.R_EBX = PCIBIOS_VERSION;
+ M.x86.R_ECX &= 0xFF00;
+ M.x86.R_CL = 0; /* Highest bus number */
+#ifdef VGAINIT_NOISY
+ xprintf("Int1A: Installation check\n");
+#endif
+ CLEAR_FLAG(F_CF);
+ break;
+
+ case PCIBIOS_FN_FINDDEV:
+ ret = pci_find_device(M.x86.R_DX,M.x86.R_CX,M.x86.R_SI,&tag);
+#if VGAINIT_NOISY
+ xprintf("Int1A: Find device VID=%04X,DID=%04X,Idx=%d: ",
+ M.x86.R_DX,M.x86.R_CX,M.x86.R_SI);
+ if (ret == 0) {
+ pci_break_tag(tag,&bus,&device,&function);
+ xprintf("Found Bus%d, Dev%d, Func%d\n",bus,device,function);
+ }
+ else {
+ xprintf("not found.\n");
+ }
+#endif
+ if (ret == 0) {
+ pci_break_tag(tag,&bus,&device,&function);
+ M.x86.R_BH = bus;
+ M.x86.R_BL = (device << 3) | function;
+ M.x86.R_AH = PCIBIOS_SUCCESSFUL;
+ }
+ else {
+ M.x86.R_AH = PCIBIOS_DEVICE_NOT_FOUND;
+ }
+
+ CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL),F_CF);
+ break;
+
+ case PCIBIOS_FN_FINDCLASS:
+ ret = pci_find_class(M.x86.R_ECX,M.x86.R_SI,&tag);
+#if VGAINIT_NOISY
+ xprintf("Int1A: Find Class %08X,Idx=%d: ",
+ M.x86.R_ECX,M.x86.R_SI);
+ if (ret == 0) {
+ pci_break_tag(tag,&bus,&device,&function);
+ xprintf("Found Bus%d, Dev%d, Func%d\n",bus,device,function);
+ }
+ else {
+ xprintf("not found.\n");
+ }
+#endif
+
+ if (ret == 0) {
+ pci_break_tag(tag,&bus,&device,&function);
+ M.x86.R_BH = bus;
+ M.x86.R_BL = (device << 3) | function;
+ M.x86.R_AH = PCIBIOS_SUCCESSFUL;
+ }
+ else {
+ M.x86.R_AH =PCIBIOS_DEVICE_NOT_FOUND;
+ }
+
+ CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL),F_CF);
+ break;
+
+ case PCIBIOS_FN_RDCFGBYTE:
+ regs2tag(&tag);
+ M.x86.R_CL = pci_conf_read8(tag,M.x86.R_DI);
+ M.x86.R_AH = PCIBIOS_SUCCESSFUL;
+#if VGAINIT_NOISY
+ xprintf("Int1A: Read Cfg Byte %04X from ",M.x86.R_DI);
+ pci_break_tag(tag,&bus,&device,&function);
+ xprintf("Bus%d, Dev%d, Func%d",bus,device,function);
+ xprintf(": %02X\n",M.x86.R_CX);
+#endif
+
+ CLEAR_FLAG(F_CF);
+ break;
+
+ case PCIBIOS_FN_RDCFGWORD:
+ regs2tag(&tag);
+ M.x86.R_CX = pci_conf_read16(tag,M.x86.R_DI);
+ M.x86.R_AH = PCIBIOS_SUCCESSFUL;
+#if VGAINIT_NOISY
+ xprintf("Int1A: Read Cfg Word %04X from ",M.x86.R_DI);
+ pci_break_tag(tag,&bus,&device,&function);
+ xprintf("Bus%d, Dev%d, Func%d",bus,device,function);
+ xprintf(": %04X\n",M.x86.R_CX);
+#endif
+ CLEAR_FLAG(F_CF);
+ break;
+
+ case PCIBIOS_FN_RDCFGDWORD:
+ regs2tag(&tag);
+ M.x86.R_ECX = pci_conf_read(tag,M.x86.R_DI);
+#if VGAINIT_NOISY
+ xprintf("Int1A: Read Cfg Dword %04X from ",M.x86.R_DI);
+ pci_break_tag(tag,&bus,&device,&function);
+ xprintf("Bus%d, Dev%d, Func%d",bus,device,function);
+ xprintf(": %08X\n",M.x86.R_ECX);
+#endif
+ M.x86.R_AH = PCIBIOS_SUCCESSFUL;
+ CLEAR_FLAG(F_CF);
+ break;
+
+ case PCIBIOS_FN_WRCFGBYTE:
+ regs2tag(&tag);
+ pci_conf_write8(tag,M.x86.R_DI,M.x86.R_CL);
+#if VGAINIT_NOISY
+ xprintf("Int1A: Write Cfg byte %04X to ",M.x86.R_DI);
+ pci_break_tag(tag,&bus,&device,&function);
+ xprintf("Bus%d, Dev%d, Func%d",bus,device,function);
+ xprintf(": %02X\n",M.x86.R_CL);
+#endif
+
+ M.x86.R_AH = PCIBIOS_SUCCESSFUL;
+ CLEAR_FLAG(F_CF);
+ break;
+
+ case PCIBIOS_FN_WRCFGWORD:
+ regs2tag(&tag);
+ pci_conf_write16(tag,M.x86.R_DI,M.x86.R_CX);
+#if VGAINIT_NOISY
+ xprintf("Int1A: Write Cfg Word %04X to ",M.x86.R_DI);
+ pci_break_tag(tag,&bus,&device,&function);
+ xprintf("Bus%d, Dev%d, Func%d",bus,device,function);
+ xprintf(": %04X\n",M.x86.R_CX);
+#endif
+ M.x86.R_AH = PCIBIOS_SUCCESSFUL;
+ CLEAR_FLAG(F_CF);
+ break;
+
+ case PCIBIOS_FN_WRCFGDWORD:
+ regs2tag(&tag);
+ pci_conf_write(tag,M.x86.R_DI,M.x86.R_ECX);
+#if VGAINIT_NOISY
+ xprintf("Int1A: Write Cfg Dword %04X to ",M.x86.R_DI);
+ pci_break_tag(tag,&bus,&device,&function);
+ xprintf("Bus%d, Dev%d, Func%d",bus,device,function);
+ xprintf(": %08X\n",M.x86.R_ECX);
+#endif
+ M.x86.R_AH = PCIBIOS_SUCCESSFUL;
+ CLEAR_FLAG(F_CF);
+ break;
+
+ default:
+#if VGAINIT_NOISY
+ xprintf("Int1A: Unimplemented PCI BIOS function AX=%04x\n", M.x86.R_AX);
+#endif
+ break;
+ }
+}
+
+
+
+static int x86init(void)
+{
+ /*
+ * Access functions for I/O ports
+ */
+ static X86EMU_pioFuncs piofuncs = {
+ __x86emu_inb,
+ __x86emu_inw,
+ __x86emu_inl,
+ __x86emu_outb,
+ __x86emu_outw,
+ __x86emu_outl
+ };
+
+ /*
+ * Access functions for memory
+ */
+ static X86EMU_memFuncs memfuncs = {
+ __x86emu_rdb,
+ __x86emu_rdw,
+ __x86emu_rdl,
+ __x86emu_wrb,
+ __x86emu_wrw,
+ __x86emu_wrl
+ };
+
+ /*
+ * Interrupt table
+ */
+ void (*funcs[256])(int num); /* XXX: can be 2 kilobytes! */
+ int idx;
+
+ /*
+ * Establish hooks in the simulator
+ */
+ X86EMU_setupMemFuncs(&memfuncs);
+ X86EMU_setupPioFuncs(&piofuncs);
+
+ /*
+ * Decode what X86 software interrupts we need to hook
+ */
+
+ for (idx = 0; idx < 256; idx++) {
+ funcs[idx] = __SIMintunk; /* assume all are bad */
+ }
+ funcs[0x42] = __SIMint42; /* int42: video BIOS */
+ funcs[0x1F] = NULL; /* reflect INT1F */
+ funcs[0x43] = NULL; /* reflect INT43 */
+ funcs[0x6D] = __SIMint6D; /* int6D: video BIOS */
+
+ funcs[0x03] = __SIMint3; /* int3: firmware exit */
+ funcs[0x10] = __SIMint10; /* int10: video BIOS */
+ funcs[0x1A] = __SIMint1A; /* int1A: PCI BIOS */
+
+ X86EMU_setupIntrFuncs(funcs);
+
+ x86mem_init(&x86mem);
+ x86mem_hook(&x86mem,0xA0000,__ISAreadmem,__ISAwritemem);
+ x86mem_hook(&x86mem,0xA8000,__ISAreadmem,__ISAwritemem);
+ x86mem_hook(&x86mem,0xB0000,__ISAreadmem,__ISAwritemem);
+ x86mem_hook(&x86mem,0xB8000,__ISAreadmem,__ISAwritemem);
+
+ return 0;
+
+}
+
+
+static void x86uninit(void)
+{
+ x86mem_uninit(&x86mem);
+}
+
+
+int vga_probe(void)
+{
+ pcitag_t tag;
+
+ if (pci_find_class(PCI_CLASS_DISPLAY,0,&tag) == 0) {
+ return 0;
+ }
+
+ return -1;
+}
+
+int vga_biosinit(void)
+{
+ physaddr_t biosaddr;
+ pcitag_t tag;
+ uint32_t addr;
+ uint32_t romaddr;
+ uint32_t destaddr;
+ uint32_t stackaddr;
+ uint32_t iretaddr;
+ unsigned int biossize;
+ int bus,device,function;
+ int idx;
+ int res;
+
+ if (pci_find_class(PCI_CLASS_DISPLAY,0,&tag) == 0) {
+ romaddr = pci_conf_read(tag,PCI_MAPREG_ROM);
+ pci_conf_write(tag,PCI_MAPREG_ROM,romaddr | PCI_MAPREG_ROM_ENABLE);
+ }
+ else {
+ xprintf("No suitable VGA device found in the system.\n");
+ return -1;
+ }
+
+ addr = romaddr;
+ addr &= PCI_MAPREG_ROM_ADDR_MASK;
+#if defined(_P5064_) || defined(_P6064_)
+ biosaddr = cpu_isamap((vm_offset_t) romaddr,0);
+#else
+ biosaddr = (physaddr_t) romaddr;
+#endif
+
+ /*
+ * Check for the presence of a VGA BIOS on this adapter.
+ */
+
+ if (!((phys_read8(biosaddr+PCIBIOS_ROMSIG_OFFSET+0) == PCIBIOS_ROMSIG1) &&
+ (phys_read8(biosaddr+PCIBIOS_ROMSIG_OFFSET+1) == PCIBIOS_ROMSIG2))) {
+ xprintf("No VGA BIOS on this adapter.\n");
+ pci_conf_write(tag,PCI_MAPREG_ROM,romaddr);
+ return -1;
+ }
+ biossize = PCIBIOS_ROMSIZE(phys_read8(biosaddr+PCIBIOS_ROMSIZE_OFFSET));
+
+#if VGAINIT_NOISY
+ xprintf("VGA BIOS size is %d bytes\n",biossize);
+#endif
+
+ /*
+ * Initialize the X86 emulator
+ */
+
+ if (x86init() != 0) {
+ xprintf("X86 emulator did not initialize.\n");
+ pci_conf_write(tag,PCI_MAPREG_ROM,romaddr);
+ return -1;
+ }
+
+ /*
+ * Allocate space for the ROM BIOS and the stack.
+ * The basic layout is:
+ *
+ * C000:0000 VGA BIOS
+ * C000:XXXX end of VGA BIOS, start of stack
+ * C000:YYYY end of stack, start of init code
+ * C000:ZZZZ end of allocated memory
+ *
+ * We put a little code stub after the stack to allow us to have
+ * a clean exit from the simulator.
+ */
+
+
+ destaddr = BIOSRAMLOC;
+ stackaddr = destaddr + biossize + STACKSIZE;
+
+ /*
+ * Copy the BIOS from the PCI rom into RAM
+ */
+
+#if VGAINIT_NOISY
+ xprintf("Copying VGA BIOS to RAM.\n");
+#endif
+
+ for (idx = 0; idx < biossize; idx+=4) {
+ uint32_t b;
+
+ b = phys_read32(biosaddr+idx);
+ x86mem_memcpy(&x86mem,destaddr+idx,(uint8_t *) &b,sizeof(uint32_t));
+ }
+
+ /*
+ * Gross! The NVidia TNT2 BIOS expects to
+ * find a PC ROM BIOS date (just the slashes)
+ * at the right place in the ROMs.
+ */
+
+ x86mem_memcpy(&x86mem,0xFFFF5,"08/13/99",8);
+
+ /*
+ * Turn off the BIOS ROM, we have our copy now.
+ */
+
+ pci_conf_write(tag,PCI_MAPREG_ROM,romaddr);
+
+ /*
+ * Point certain vectors at a dummy IRET in our code space.
+ * Some ROMs don't take too kindly to null vectors, like
+ * the 3dfx Voodoo3 BIOS, which makes sure int1a is
+ * filled in before it attempts to call it. The
+ * code here is never really executed, since the emulator
+ * hooks it.
+ */
+
+ iretaddr = stackaddr + IRETOFFSET;
+ __x86emu_wrw(0x1A*4+0,OFFSET(iretaddr));
+ __x86emu_wrw(0x1A*4+2,SEGMENT(iretaddr));
+
+
+ /*
+ * The actual code begins 3 bytes after the beginning of the ROM. Set
+ * the start address to the first byte of executable code.
+ */
+
+ M.x86.R_CS = SEGMENT(destaddr + PCIBIOS_ROMENTRY_OFFSET);
+ M.x86.R_IP = OFFSET(destaddr + PCIBIOS_ROMENTRY_OFFSET);
+
+ /*
+ * Set the stack to point after our copy of the ROM
+ */
+
+ M.x86.R_SS = SEGMENT(stackaddr - 8);
+ M.x86.R_SP = OFFSET(stackaddr - 8);
+
+ /*
+ * GROSS! The Voodoo3 card expects BP to have
+ * the following value:
+ */
+
+ M.x86.R_BP = 0x197;
+
+ /*
+ * The PCI BIOS spec says you pass the bus, device, and function
+ * numbers in the AX register when starting the ROM code.
+ */
+
+ pci_break_tag(tag,&bus,&device,&function);
+ M.x86.R_AH = bus;
+ M.x86.R_AL = (device << 3) | (function & 7);
+
+ /*
+ * Arrange for the return address to point to a little piece
+ * of code that will do an int10 to set text mode, followed
+ * by storing a couple of simple signatures in the registers,
+ * and an int3 to stop the simulator.
+ *
+ * The location of this piece of code is just after our
+ * stack, and since the stack grows down, this is in 'stackaddr'
+ */
+
+ __x86emu_wrw(stackaddr-8,OFFSET(stackaddr));
+ __x86emu_wrw(stackaddr-6,SEGMENT(stackaddr));
+
+ /* copy in the code. */
+
+ for (idx = 0; idx < sizeof(x86initcode); idx++) {
+ __x86emu_wrb(stackaddr+idx,x86initcode[idx]);
+ }
+
+ /*
+ * Set up the VGA console descriptor. We need this to process the
+ * int10's that write firmware copyright notices and such.
+ */
+
+ vga_init(&vga,(__ISAaddr(VGA_TEXTBUF_COLOR)),outb);
+
+ /*
+ * Launch the simulator.
+ */
+
+ xprintf("Initializing VGA.\n");
+#ifdef DEBUG
+ X86EMU_trace_on();
+#endif
+ X86EMU_exec();
+
+ /*
+ * Check for the magic exit values in the registers. These get set
+ * by the code in the array 'x86initcode' that was loaded above
+ */
+
+ if ((M.x86.R_AX == 0x1234) && (M.x86.R_BX == 0x5678)) res = 0;
+ else res = -1;
+
+ /*
+ * Done!
+ */
+
+ x86uninit();
+
+ if (res < 0) {
+ xprintf("VGA initialization failed.\n");
+ }
+ else {
+ char temp[32];
+ char *str = "If you can see this message, the VGA has been successfully initialized!\r\n\r\n";
+
+ xprintf("VGA initialization successful.\n");
+ vga_writestr(&vga,str,0x07,strlen(str));
+
+ sprintf(temp,"%d",VGA_TEXTMODE_ROWS);
+ env_setenv("VGA_ROWS",temp,ENV_FLG_BUILTIN | ENV_FLG_READONLY | ENV_FLG_ADMIN);
+ sprintf(temp,"%d",VGA_TEXTMODE_COLS);
+ env_setenv("VGA_COLS",temp,ENV_FLG_BUILTIN | ENV_FLG_READONLY | ENV_FLG_ADMIN);
+
+ }
+
+ return res;
+}
+
+int x86emutest(void)
+{
+ uint32_t destaddr;
+ uint32_t stackaddr;
+ int res;
+
+ /*
+ * Initialize the X86 emulator
+ */
+
+ if (x86init() != 0) {
+ xprintf("X86 emulator did not initialize.\n");
+ return -1;
+ }
+
+ destaddr = BIOSRAMLOC;
+ stackaddr = destaddr + 1024;
+
+ /*
+ * Copy the BIOS from the PCI rom into RAM
+ */
+
+ xprintf("Copying test program to RAM.\n");
+ x86mem_memcpy(&x86mem,destaddr,x86testcode,sizeof(x86testcode));
+
+ /*
+ * The actual code begins 3 bytes after the beginning of the ROM. Set
+ * the start address to the first byte of executable code.
+ */
+
+ M.x86.R_CS = SEGMENT(destaddr + PCIBIOS_ROMENTRY_OFFSET);
+ M.x86.R_IP = OFFSET(destaddr + PCIBIOS_ROMENTRY_OFFSET);
+
+ /*
+ * Set the stack to point after our copy of the ROM
+ */
+
+ M.x86.R_SS = SEGMENT(stackaddr - 8);
+ M.x86.R_SP = OFFSET(stackaddr - 8);
+
+ /*
+ * Launch the simulator.
+ */
+
+ xprintf("Running X86emu test.\n");
+#ifdef DEBUG
+ X86EMU_trace_on();
+#endif
+ X86EMU_exec();
+
+ /*
+ * Check for the magic exit values in the registers. These get set
+ * by the code in the array 'x86initcode' that was loaded above
+ */
+
+ if ((M.x86.R_AX == 0x1234) && (M.x86.R_BX == 0x5678)) res = 0;
+ else res = -1;
+
+ /*
+ * Done!
+ */
+
+ x86uninit();
+
+ if (res < 0) xprintf("X86emu test failed.\n");
+ else xprintf("X86emu test successful.\n");
+
+ return res;
+}
+
+
+
+void vgaraw_dump(char *tail)
+{
+ physaddr_t biosaddr;
+ pcitag_t tag;
+ uint32_t addr;
+ uint32_t romaddr;
+ unsigned int biossize;
+ int idx;
+ int res;
+
+ if (pci_find_class(PCI_CLASS_DISPLAY,0,&tag) == 0) {
+ romaddr = pci_conf_read(tag,PCI_MAPREG_ROM);
+ pci_conf_write(tag,PCI_MAPREG_ROM,romaddr | PCI_MAPREG_ROM_ENABLE);
+ }
+ else {
+ xprintf("No suitable VGA device found in the system.\n");
+ return ;
+ }
+
+ addr = romaddr;
+ addr &= PCI_MAPREG_ROM_ADDR_MASK;
+
+ /* XXX This won't work if the PCI space is remapped somewhere else. */
+#if defined(_P5064_) || defined(_P6064_)
+ biosaddr = cpu_isamap((vm_offset_t) romaddr,0);
+#else
+ biosaddr = romaddr;
+#endif
+
+ /*
+ * Check for the presence of a VGA BIOS on this adapter.
+ */
+
+ xprintf("VGA BIOS is mapped to %08X\n",(uint32_t) biosaddr);
+
+ if (!((phys_read8(biosaddr+PCIBIOS_ROMSIG_OFFSET+0) == PCIBIOS_ROMSIG1) &&
+ (phys_read8(biosaddr+PCIBIOS_ROMSIG_OFFSET+1) == PCIBIOS_ROMSIG2))) {
+ xprintf("No VGA BIOS on this adapter, assuming 32K ROM\n");
+ biossize = 32768;
+ return;
+ }
+ else {
+ biossize = PCIBIOS_ROMSIZE(phys_read8(biosaddr+PCIBIOS_ROMSIZE_OFFSET));
+ xprintf("VGA BIOS size is %d bytes\n",biossize);
+ }
+
+ for (idx = 0; idx < biossize; idx+=16) {
+ xprintf("%04X: ",idx);
+ for (res = 0; res < 16; res++) {
+ xprintf("%02X ",phys_read8(biosaddr+idx+res));
+ }
+ xprintf("\n");
+ if (console_status()) break;
+ }
+
+// pci_conf_write(tag,PCI_MAPREG_ROM,romaddr);
+
+}
diff --git a/cfe/cfe/pccons/x86mem.c b/cfe/cfe/pccons/x86mem.c
new file mode 100644
index 0000000..2e9c49e
--- /dev/null
+++ b/cfe/cfe/pccons/x86mem.c
@@ -0,0 +1,423 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * X86 simulator sparse memory File: X86MEM.C
+ *
+ * This module implements X86 memory for the X86 emulator
+ * used by the BIOS simulator. To avoid allocating the
+ * entire 1MB of PC's addressable memory, this is a "sparse"
+ * memory model, allocating chunks of storage as needed.
+ * VGA BIOSes seem to do all sorts of bizarre things to memory
+ * so this helps reduce the total amount we need to allocate
+ * significantly.
+ *
+ * In addition, this module lets the simulator "hook"
+ * ranges of memory to be handled by a callback
+ * routine. This is used so that we can redirect
+ * accesses to VGA memory space to the PCI bus handler.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "x86mem.h"
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#define BSWAP_SHORT(s) ((((s) >> 8) & 0xFF) | (((s)&0xFF) << 8))
+#define BSWAP_LONG(s) ((((s) & 0xFF000000) >> 24) | \
+ (((s) & 0x00FF0000) >> 8) | \
+ (((s) & 0x0000FF00) << 8) | \
+ (((s) & 0x000000FF) << 24))
+
+
+/* *********************************************************************
+ * X86MEM_INIT()
+ *
+ * Initialize an X86mem object
+ *
+ * Input parameters:
+ * mem - X86mem object
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void x86mem_init(x86mem_t *mem)
+{
+ memset(mem,0,sizeof(mem));
+}
+
+/* *********************************************************************
+ * X86MEM_UNINIT(mem)
+ *
+ * Uninitialize an X86mem object, freeing any storage
+ * associated with it.
+ *
+ * Input parameters:
+ * mem - x86mem object
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void x86mem_uninit(x86mem_t *mem)
+{
+ int idx;
+
+ for (idx = 0; idx < X86MEM_CHUNKS; idx++) {
+ if (mem->data[idx]) {
+ KFREE(mem->data[idx]);
+ mem->data[idx] = NULL;
+ }
+ }
+}
+
+/* *********************************************************************
+ * X86MEM_READB(mem,addr)
+ *
+ * Read a byte of memory from the X86mem object.
+ *
+ * Input parameters:
+ * mem - x86mem object
+ * addr - address of byte to read
+ *
+ * Return value:
+ * byte read
+ ********************************************************************* */
+
+uint8_t x86mem_readb(x86mem_t *mem,uint32_t addr)
+{
+ uint8_t *p;
+
+ if (mem->read[X86MEM_REGION(addr)]) {
+ return (uint8_t) (*(mem->read[X86MEM_REGION(addr)]))(mem,addr,1);
+ }
+
+ p = (mem->data[X86MEM_REGION(addr)]);
+
+ if (p) {
+ return *(p + X86MEM_OFFSET(addr));
+ }
+ else {
+ return 0;
+ }
+}
+
+/* *********************************************************************
+ * X86MEM_READW(mem,addr)
+ *
+ * Read a 16-bit word of memory from the X86mem object.
+ *
+ * Input parameters:
+ * mem - x86mem object
+ * addr - address of word to read
+ *
+ * Return value:
+ * word read
+ ********************************************************************* */
+
+uint16_t x86mem_readw(x86mem_t *mem,uint32_t addr)
+{
+ uint8_t *p;
+ uint16_t ret;
+
+ if (mem->read[X86MEM_REGION(addr)]) {
+ return (uint8_t) (*(mem->read[X86MEM_REGION(addr)]))(mem,addr,2);
+ }
+
+ p = (mem->data[X86MEM_REGION(addr)]);
+ if (!p) return 0;
+
+ if ((addr & 1) || (X86MEM_OFFSET(addr) == X86MEM_CHUNKSIZE-1)) {
+
+ ret = ((uint16_t) x86mem_readb(mem,addr+0)) |
+ (((uint16_t) x86mem_readb(mem,addr+1)) << 8);
+ return ret;
+ }
+ else {
+ ret = *((uint16_t *) (p+X86MEM_OFFSET(addr)));
+#ifdef __MIPSEB
+ ret = BSWAP_SHORT(ret);
+#endif
+ }
+
+ return ret;
+}
+
+/* *********************************************************************
+ * X86MEM_READL(mem,addr)
+ *
+ * Read a 32-bit dword of memory from the X86mem object.
+ *
+ * Input parameters:
+ * mem - x86mem object
+ * addr - address of dword to read
+ *
+ * Return value:
+ * dword read
+ ********************************************************************* */
+
+uint32_t x86mem_readl(x86mem_t *mem,uint32_t addr)
+{
+ uint8_t *p;
+ uint32_t ret;
+
+ if (mem->read[X86MEM_REGION(addr)]) {
+ return (uint8_t) (*(mem->read[X86MEM_REGION(addr)]))(mem,addr,4);
+ }
+
+ p = (mem->data[X86MEM_REGION(addr)]);
+ if (!p) return 0;
+
+ if ((addr & 3) || (X86MEM_OFFSET(addr) >= X86MEM_CHUNKSIZE-3)) {
+ ret = ((uint32_t) x86mem_readb(mem,addr+0)) |
+ (((uint32_t) x86mem_readb(mem,addr+1)) << 8) |
+ (((uint32_t) x86mem_readb(mem,addr+2)) << 16) |
+ (((uint32_t) x86mem_readb(mem,addr+3)) << 24);
+ }
+ else {
+ ret = *((uint32_t *) (p+X86MEM_OFFSET(addr)));
+#ifdef __MIPSEB
+ ret = BSWAP_LONG(ret);
+#endif
+ }
+
+ return ret;
+}
+
+/* *********************************************************************
+ * X86MEM_WRITEB(mem,addr,data)
+ *
+ * Write a byte to the X86mem object
+ *
+ * Input parameters:
+ * mem - x86mem object
+ * addr - address of byte to write
+ * data - data to write
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+void x86mem_writeb(x86mem_t *mem,uint32_t addr,uint8_t data)
+{
+ uint8_t *p;
+
+ if (mem->write[X86MEM_REGION(addr)]) {
+ (*(mem->write[X86MEM_REGION(addr)]))(mem,addr,data,1);
+ return;
+ }
+
+ p = (mem->data[X86MEM_REGION(addr)]);
+
+ if (p) {
+ *(p + X86MEM_OFFSET(addr)) = data;
+ }
+ else {
+ p = mem->data[X86MEM_REGION(addr)] = KMALLOC(X86MEM_CHUNKSIZE,sizeof(uint32_t));
+ if (p) {
+ memset(p,0,X86MEM_CHUNKSIZE);
+ *(p + X86MEM_OFFSET(addr)) = data;
+ }
+ }
+}
+
+/* *********************************************************************
+ * X86MEM_WRITEW(mem,addr,data)
+ *
+ * Write a 16-bit word to the X86mem object
+ *
+ * Input parameters:
+ * mem - x86mem object
+ * addr - address of word to write
+ * data - data to write
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+void x86mem_writew(x86mem_t *mem,uint32_t addr,uint16_t data)
+{
+ uint8_t *p;
+
+ if (mem->write[X86MEM_REGION(addr)]) {
+ (*(mem->write[X86MEM_REGION(addr)]))(mem,addr,data,2);
+ return;
+ }
+
+ p = (mem->data[X86MEM_REGION(addr)]);
+
+ if (!p || (addr & 1) || (X86MEM_OFFSET(addr) == X86MEM_CHUNKSIZE-1)) {
+ x86mem_writeb(mem,addr+0,(data & 0xFF));
+ x86mem_writeb(mem,addr+1,((data >> 8) & 0xFF));
+ }
+ else {
+#ifdef __MIPSEB
+ data = BSWAP_SHORT(data);
+#endif
+ *((uint16_t *) (p+X86MEM_OFFSET(addr))) = data;
+ }
+}
+
+/* *********************************************************************
+ * X86MEM_WRITEL(mem,addr,data)
+ *
+ * Write a 32-bit dword to the X86mem object
+ *
+ * Input parameters:
+ * mem - x86mem object
+ * addr - address of dword to write
+ * data - data to write
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+void x86mem_writel(x86mem_t *mem,uint32_t addr,uint32_t data)
+{
+ uint8_t *p;
+
+ if (mem->write[X86MEM_REGION(addr)]) {
+ (*(mem->write[X86MEM_REGION(addr)]))(mem,addr,data,4);
+ return;
+ }
+
+ p = (mem->data[X86MEM_REGION(addr)]);
+
+ if (!p || (addr & 3) || (X86MEM_OFFSET(addr) >= X86MEM_CHUNKSIZE-3)) {
+ x86mem_writeb(mem,addr+0,(data & 0xFF));
+ x86mem_writeb(mem,addr+1,((data >> 8) & 0xFF));
+ x86mem_writeb(mem,addr+2,((data >> 16) & 0xFF));
+ x86mem_writeb(mem,addr+3,((data >> 24) & 0xFF));
+ }
+ else {
+#ifdef __MIPSEB
+ data = BSWAP_LONG(data);
+#endif
+ *((uint32_t *) (p+X86MEM_OFFSET(addr))) = data;
+ }
+}
+
+/* *********************************************************************
+ * X86MEM_MEMCPY(mem,dest,src,cnt)
+ *
+ * memcpy data into the X86mem object
+ *
+ * Input parameters:
+ * mem - x86mem object
+ * destaddr - destination x86mem address
+ * src - source local address
+ * cnt - number of bytes to copy
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void x86mem_memcpy(x86mem_t *mem,uint32_t destaddr,uint8_t *src,int count)
+{
+ while (count) {
+ x86mem_writeb(mem,destaddr,*src);
+ destaddr++;
+ src++;
+ count--;
+ }
+}
+
+
+/* *********************************************************************
+ * X86MEM_HOOK(mem,addr,readf,writef)
+ *
+ * Establish a hook for a block of simulated memory
+ *
+ * Input parameters:
+ * mem - x86mem object
+ * addr - address in memory, should be aligned on a "chunk"
+ * boundary.
+ * readf - function to call on READ accesses
+ * writef - function to call on WRITE accesses
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void x86mem_hook(x86mem_t *mem,uint32_t chunkaddr,
+ uint32_t (*readf)(x86mem_t *mem,uint32_t addr,int size),
+ void (*writef)(x86mem_t *mem,uint32_t addr,uint32_t val,int size))
+{
+ if (mem->data[X86MEM_REGION(chunkaddr)]) {
+ KFREE(mem->data[X86MEM_REGION(chunkaddr)]);
+ mem->data[X86MEM_REGION(chunkaddr)] = NULL;
+ }
+ mem->read[X86MEM_REGION(chunkaddr)] = readf;
+ mem->write[X86MEM_REGION(chunkaddr)] = writef;
+}
+
+/* *********************************************************************
+ * X86MEM_HOOK_RANGE(mem,addr,size,readf,writef)
+ *
+ * Establish a hook for a block of simulated memory
+ *
+ * Input parameters:
+ * mem - x86mem object
+ * addr - address in memory, should be aligned on a "chunk"
+ * boundary.
+ * size - size of region to hook. Should be a multiple
+ * of the chunk size
+ * readf - function to call on READ accesses
+ * writef - function to call on WRITE accesses
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void x86mem_hook_range(x86mem_t *mem,uint32_t chunkaddr,int size,
+ uint32_t (*readf)(x86mem_t *mem,uint32_t addr,int size),
+ void (*writef)(x86mem_t *mem,uint32_t addr,uint32_t val,int size))
+{
+ while (size > 0) {
+ x86mem_hook(mem,chunkaddr,readf,writef);
+ size -= X86MEM_CHUNKSIZE;
+ chunkaddr += X86MEM_CHUNKSIZE;
+ }
+}
+
diff --git a/cfe/cfe/pccons/x86mem.h b/cfe/cfe/pccons/x86mem.h
new file mode 100644
index 0000000..ed9132b
--- /dev/null
+++ b/cfe/cfe/pccons/x86mem.h
@@ -0,0 +1,109 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * X86 simulator sparse memory File: X86MEM.H
+ *
+ * This module implements X86 memory for the X86 emulator
+ * used by the BIOS simulator. To avoid allocating the
+ * entire 1MB of PC's addressable memory, this is a "sparse"
+ * memory model, allocating chunks of storage as needed.
+ * VGA BIOSes seem to do all sorts of bizarre things to memory
+ * so this helps reduce the total amount we need to allocate
+ * significantly.
+ *
+ * In addition, this module lets the simulator "hook"
+ * ranges of memory to be handled by a callback
+ * routine. This is used so that we can redirect
+ * accesses to VGA memory space to the PCI bus handler.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define X86MEM_CHUNKBITS 15
+#define X86MEM_ADDRESSBITS 20
+#define X86MEM_CHUNKSIZE (1<<X86MEM_CHUNKBITS)
+#define X86MEM_CHUNKS (1<<(X86MEM_ADDRESSBITS-X86MEM_CHUNKBITS))
+#define X86MEM_REGION(addr) (((addr) >> X86MEM_CHUNKBITS) & (X86MEM_CHUNKS-1))
+#define X86MEM_OFFSET(addr) ((addr) & (X86MEM_CHUNKSIZE-1))
+
+#define M_BYTE 1
+#define M_WORD 2
+#define M_DWORD 4
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+typedef struct x86mem_s {
+ uint8_t *data[X86MEM_CHUNKS];
+ uint32_t (*read[X86MEM_CHUNKS])(struct x86mem_s *x86mem,
+ uint32_t addr,int size);
+ void (*write[X86MEM_CHUNKS])(struct x86mem_s *x86mem,
+ uint32_t addr,uint32_t val,int size);
+} x86mem_t;
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+void x86mem_init(x86mem_t *mem);
+void x86mem_uninit(x86mem_t *mem);
+
+
+uint8_t x86mem_readb(x86mem_t *mem,uint32_t addr);
+uint16_t x86mem_readw(x86mem_t *mem,uint32_t addr);
+uint32_t x86mem_readl(x86mem_t *mem,uint32_t addr);
+
+
+void x86mem_writeb(x86mem_t *mem,uint32_t addr,uint8_t data);
+void x86mem_writew(x86mem_t *mem,uint32_t addr,uint16_t data);
+void x86mem_writel(x86mem_t *mem,uint32_t addr,uint32_t data);
+void x86mem_memcpy(x86mem_t *mem,uint32_t destaddr,uint8_t *src,int count);
+void x86mem_hook(x86mem_t *mem,uint32_t chunkaddr,
+ uint32_t (*readf)(x86mem_t *mem,uint32_t addr,int size),
+ void (*writef)(x86mem_t *mem,uint32_t addr,uint32_t val,int size));
+void x86mem_hook_range(x86mem_t *mem,uint32_t chunkaddr,int size,
+ uint32_t (*readf)(x86mem_t *mem,uint32_t addr,int size),
+ void (*writef)(x86mem_t *mem,uint32_t addr,uint32_t val,int size));
+
diff --git a/cfe/cfe/pci/cfe_pci.h b/cfe/cfe/pci/cfe_pci.h
new file mode 100644
index 0000000..8780a6f
--- /dev/null
+++ b/cfe/cfe/pci/cfe_pci.h
@@ -0,0 +1,52 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * PCI definitions File: cfe_pci.h
+ *
+ * This file includes other files and defines macros to make
+ * our environment match that of the PCI configuration code
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+
+#define panic(x) printf(x)
diff --git a/cfe/cfe/pci/devlist2h.awk b/cfe/cfe/pci/devlist2h.awk
new file mode 100644
index 0000000..1f0b9b4
--- /dev/null
+++ b/cfe/cfe/pci/devlist2h.awk
@@ -0,0 +1,220 @@
+#! /usr/bin/awk -f
+# $NetBSD: devlist2h.awk,v 1.2 1996/01/22 21:08:09 cgd Exp $
+#
+# Copyright (c) 1995, 1996 Christopher G. Demetriou
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by Christopher G. Demetriou.
+# 4. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+BEGIN {
+ nproducts = nvendors = 0
+ dfile="pcidevs_data.h"
+ hfile="pcidevs.h"
+}
+NR == 1 {
+ VERSION = $0
+ gsub("\\$", "", VERSION)
+
+ printf("/*\n") > dfile
+ printf(" * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.\n") \
+ > dfile
+ printf(" *\n") > dfile
+ printf(" * generated from:\n") > dfile
+ printf(" *\t%s\n", VERSION) > dfile
+ printf(" */\n") > dfile
+
+ printf("/*\n") > hfile
+ printf(" * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.\n") \
+ > hfile
+ printf(" *\n") > hfile
+ printf(" * generated from:\n") > hfile
+ printf(" *\t%s\n", VERSION) > hfile
+ printf(" */\n") > hfile
+
+ next
+}
+$1 == "vendor" {
+ nvendors++
+
+ vendorindex[$2] = nvendors; # record index for this name, for later.
+ vendors[nvendors, 1] = $2; # name
+ vendors[nvendors, 2] = $3; # id
+ printf("#define\tPCI_VENDOR_%s\t%s\t", vendors[nvendors, 1],
+ vendors[nvendors, 2]) > hfile
+
+ i = 3; f = 4;
+
+ # comments
+ ocomment = oparen = 0
+ if (f <= NF) {
+ printf("\t/* ") > hfile
+ ocomment = 1;
+ }
+ while (f <= NF) {
+ if ($f == "#") {
+ printf("(") > hfile
+ oparen = 1
+ f++
+ continue
+ }
+ if (oparen) {
+ printf("%s", $f) > hfile
+ if (f < NF)
+ printf(" ") > hfile
+ f++
+ continue
+ }
+ vendors[nvendors, i] = $f
+ printf("%s", vendors[nvendors, i]) > hfile
+ if (f < NF)
+ printf(" ") > hfile
+ i++; f++;
+ }
+ if (oparen)
+ printf(")") > hfile
+ if (ocomment)
+ printf(" */") > hfile
+ printf("\n") > hfile
+
+ next
+}
+$1 == "product" {
+ nproducts++
+
+ products[nproducts, 1] = $2; # vendor name
+ products[nproducts, 2] = $3; # product id
+ products[nproducts, 3] = $4; # id
+ printf("#define\tPCI_PRODUCT_%s_%s\t%s\t", products[nproducts, 1],
+ products[nproducts, 2], products[nproducts, 3]) > hfile
+
+ i=4; f = 5;
+
+ # comments
+ ocomment = oparen = 0
+ if (f <= NF) {
+ printf("\t/* ") > hfile
+ ocomment = 1;
+ }
+ while (f <= NF) {
+ if ($f == "#") {
+ printf("(") > hfile
+ oparen = 1
+ f++
+ continue
+ }
+ if (oparen) {
+ printf("%s", $f) > hfile
+ if (f < NF)
+ printf(" ") > hfile
+ f++
+ continue
+ }
+ products[nproducts, i] = $f
+ printf("%s", products[nproducts, i]) > hfile
+ if (f < NF)
+ printf(" ") > hfile
+ i++; f++;
+ }
+ if (oparen)
+ printf(")") > hfile
+ if (ocomment)
+ printf(" */") > hfile
+ printf("\n") > hfile
+
+ next
+}
+{
+ if ($0 == "")
+ blanklines++
+ print $0 > hfile
+ if (blanklines < 2)
+ print $0 > dfile
+}
+END {
+ # print out the match tables
+
+ printf("\n") > dfile
+
+
+ printf("static const struct pci_knowndev pci_knowndevs[] = {\n") > dfile
+ for (i = 1; i <= nproducts; i++) {
+ printf("\t{\n") > dfile
+ printf("\t PCI_VENDOR_%s, PCI_PRODUCT_%s_%s,\n",
+ products[i, 1], products[i, 1], products[i, 2]) \
+ > dfile
+ printf("\t ") > dfile
+ printf("0") > dfile
+ printf(",\n") > dfile
+
+ vendi = vendorindex[products[i, 1]];
+ printf("\t \"") > dfile
+ j = 3;
+ needspace = 0;
+ while (vendors[vendi, j] != "") {
+ if (needspace)
+ printf(" ") > dfile
+ printf("%s", vendors[vendi, j]) > dfile
+ needspace = 1
+ j++
+ }
+ printf("\",\n") > dfile
+
+ printf("\t \"") > dfile
+ j = 4;
+ needspace = 0;
+ while (products[i, j] != "") {
+ if (needspace)
+ printf(" ") > dfile
+ printf("%s", products[i, j]) > dfile
+ needspace = 1
+ j++
+ }
+ printf("\",\n") > dfile
+ printf("\t},\n") > dfile
+ }
+ for (i = 1; i <= nvendors; i++) {
+ printf("\t{\n") > dfile
+ printf("\t PCI_VENDOR_%s, 0,\n", vendors[i, 1]) \
+ > dfile
+ printf("\t PCI_KNOWNDEV_NOPROD,\n") \
+ > dfile
+ printf("\t \"") > dfile
+ j = 3;
+ needspace = 0;
+ while (vendors[i, j] != "") {
+ if (needspace)
+ printf(" ") > dfile
+ printf("%s", vendors[i, j]) > dfile
+ needspace = 1
+ j++
+ }
+ printf("\",\n") > dfile
+ printf("\t NULL,\n") > dfile
+ printf("\t},\n") > dfile
+ }
+ printf("\t{ 0, 0, 0, NULL, NULL, }\n") > dfile
+ printf("};\n") > dfile
+}
diff --git a/cfe/cfe/pci/ldtinit.c b/cfe/cfe/pci/ldtinit.c
new file mode 100644
index 0000000..26025af
--- /dev/null
+++ b/cfe/cfe/pci/ldtinit.c
@@ -0,0 +1,641 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * LDT Fabric Initialization File: ldtinit.c
+ *
+ *********************************************************************
+ *
+ * Copyright 2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+/*
+ * Copyright 2001,2002
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions as
+ * they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. Neither the "Broadcom
+ * Corporation" name nor any trademark or logo of Broadcom
+ * Corporation may be used to endorse or promote products
+ * derived from this software without the prior written
+ * permission of Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * ldtinit.c: generic LDT fabric initialization and capability
+ * management.
+ */
+
+#include "lib_types.h"
+#include "lib_printf.h"
+#include "cfe_timer.h"
+
+#include "pcivar.h"
+#include "pcireg.h"
+#include "ldtreg.h"
+
+/* Write-to-clear bit masks */
+
+#if CFG_LDT_REV_017 /* XXX not really the right test */
+#define LDT_LINKCTRL_WC (LDT_LINKCTRL_CRCERROR_MASK)
+#else
+#define LDT_LINKCTRL_WC (LDT_LINKCTRL_LINKFAIL | LDT_LINKCTRL_CRCERROR_MASK)
+#endif
+
+
+/* LDT capability lookup. */
+
+unsigned
+pci_find_ldt_cap (pcitag_t tag, int secondary)
+{
+ pcireg_t cpr;
+ pcireg_t cr;
+ int offset, prev;
+ int type;
+
+ cpr = pci_conf_read(tag, PCI_CAPLISTPTR_REG);
+ offset = PCI_CAPLIST_PTR(cpr) &~ 0x3;
+ prev = 0;
+
+ while (offset != 0 && offset != prev) {
+#if (LDT_DEBUG > 1)
+ pci_tagprintf(tag, "read cap offset %04x\n", offset);
+#endif
+ cr = pci_conf_read(tag, offset);
+ if (PCI_CAPLIST_CAP(cr) == PCI_CAP_LDT) {
+ type = LDT_COMMAND_TYPE(cr);
+ if (secondary && type == LDT_COMMAND_TYPE_HOST)
+ return offset;
+ if (!secondary && type == LDT_COMMAND_TYPE_SLAVE)
+ return offset;
+ }
+ prev = offset;
+ offset = PCI_CAPLIST_NEXT(cr) &~ 0x3;
+ }
+ return 0;
+}
+
+
+/* LDT utility functions, mostly for capabilities. */
+
+static pcireg_t
+ldt_get_link(pcitag_t tag, int offset, int index)
+{
+ return pci_conf_read(tag, offset + LDT_LINK_OFF(index));
+}
+
+static void
+ldt_set_link(pcitag_t tag, int offset, int index, pcireg_t lr)
+{
+ pci_conf_write(tag, offset + LDT_LINK_OFF(index), lr);
+}
+
+#if (LDT_DEBUG != 0)
+static void
+ldt_show_cap(pcitag_t tag, int offset, int secondary)
+{
+ printf(" Cmd %08x", pci_conf_read(tag, offset));
+ offset += 4;
+ printf(" Lnk0 %08x", pci_conf_read(tag, offset));
+ offset += 4;
+ if (!secondary) {
+ printf(" Lnk1 %08x", pci_conf_read(tag, offset));
+ offset += 4;
+ }
+ printf(" Freq0 %08x", pci_conf_read(tag, offset));
+ offset += 4;
+ if (!secondary) {
+ printf(" Freq1 %08x", pci_conf_read(tag, offset));
+ offset += 4;
+ }
+ printf("\n");
+}
+#else
+static void
+ldt_show_cap(pcitag_t tag, int offset, int secondary)
+{
+}
+#endif
+
+
+/* LDT bus initialization and sizing. */
+
+/* We expect the entire chain to be ready at approximately the same
+ time, but we add some delay here for possible node-to-node
+ differences.
+
+ Empirically, neither InitDone nor LinkFail is reported for an
+ unconnected link. Thus we do not expect the outgoing link of a
+ terminating tunnel node to become ready.
+
+ Also, CRC errors are observed to occur with InitDone, so link
+ errors do not necessarily force LinkFail.
+*/
+
+static int
+ldt_wait_ready (pcitag_t tag, int offset, int index)
+{
+ int count;
+ pcireg_t lr;
+ int linkerr;
+
+ linkerr = 0;
+ count = 0x10000; /* empirical */
+ do {
+ if (--count == 0)
+ return 1;
+ lr = ldt_get_link(tag, offset, index);
+ if ((lr & (LDT_LINKCTRL_LINKFAIL | LDT_LINKCTRL_CRCERROR_MASK)) != 0)
+ linkerr = 1;
+ } while ((lr & (LDT_LINKCTRL_INITDONE | LDT_LINKCTRL_LINKFAIL)) == 0);
+
+ return linkerr;
+}
+
+static void
+ldt_end_chain (pcitag_t tag, int offset, int index)
+{
+ pcireg_t lr, t;
+
+ lr = ldt_get_link(tag, offset, index);
+ lr |= LDT_LINKCTRL_EOC;
+ ldt_set_link(tag, offset, index, lr);
+ lr |= LDT_LINKCTRL_TXOFF;
+ ldt_set_link(tag, offset, index, lr);
+ t = ldt_get_link(tag, offset, index); /* push */
+}
+
+
+static uint16_t
+ldt_freq_cap (pcitag_t tag, int offset, int index)
+{
+ pcireg_t cmd, cr;
+ uint16_t freq_cap;
+
+ cmd = pci_conf_read(tag, offset + LDT_COMMAND_CAP_OFF);
+ if (LDT_COMMAND_TYPE(cmd) == LDT_COMMAND_TYPE_HOST) {
+ cr = pci_conf_read(tag, offset + LDT_FREQ_OFF);
+ if (LDT_REVISION_ID(cr) == LDT_REV_017) {
+ /* REV 0.17 has restricted support for setting
+ frequencies. We assume that this is the host bridge in
+ pseudo-1.0x mode, in which case the desired maximum
+ frequency was left in the LDT_FREQ register and all
+ lower frequencies are supported. */
+ freq_cap = (1 << (LDT_LINKFREQ(cr) + 1)) - 1;
+ } else {
+ freq_cap = LDT_LINKFREQ_CAP(cr);
+ }
+ } else {
+ cr = pci_conf_read(tag, offset + LDT_FREQ0_OFF);
+ if (LDT_REVISION_ID(cr) == LDT_REV_017) {
+ /* REV 0.17 has restricted support for setting frequencies.
+ This is not the host bridge. What to do? XXX */
+ freq_cap = (1 << LDT_FREQ_200);
+ } else {
+ cr = pci_conf_read(tag, offset + LDT_FREQn_OFF(index));
+ freq_cap = LDT_LINKFREQ_CAP(cr);
+ }
+ }
+ return freq_cap;
+}
+
+static uint8_t
+ldt_max_freq (uint16_t freq_cap)
+{
+ unsigned ldt_freq;
+
+ /* 200 MHz (encoded as 1 << 0) is required for all devices */
+ freq_cap |= (1 << LDT_FREQ_200);
+
+ ldt_freq = 0;
+
+ while (freq_cap != 1) {
+ ldt_freq++;
+ freq_cap >>= 1;
+ }
+
+ return (ldt_freq >= LDT_FREQ_200 && ldt_freq <= LDT_FREQ_1000) ?
+ ldt_freq : LDT_FREQ_200;
+}
+
+static void
+ldt_set_freq (pcitag_t tag, int offset, int index, uint8_t freq)
+{
+ pcireg_t cmd, cr;
+
+ cmd = pci_conf_read(tag, offset + LDT_COMMAND_CAP_OFF);
+ if (LDT_COMMAND_TYPE(cmd) == LDT_COMMAND_TYPE_HOST) {
+ cr = pci_conf_read(tag, offset + LDT_FREQ_OFF);
+ cr &=~ LDT_LINKFREQ_MASK;
+ cr |= (freq << LDT_LINKFREQ_SHIFT);
+ pci_conf_write(tag, offset + LDT_FREQ_OFF, cr);
+ } else {
+ cr = pci_conf_read(tag, offset + LDT_FREQn_OFF(index));
+ cr &=~ LDT_LINKFREQ_MASK;
+ cr |= (freq << LDT_LINKFREQ_SHIFT);
+ pci_conf_write(tag, offset + LDT_FREQn_OFF(index), cr);
+ }
+#if (LDT_DEBUG > 1)
+ pci_tagprintf(tag, "set link %d freq = %02x\n", index, freq);
+#endif
+}
+
+
+/* LDT fabric initialization. See LDT Spec, Section 13.3. */
+static int
+ldt_fabric_init (pcitag_t br_tag, int br_offset, int bus, pci_flags_t flags)
+{
+ int next_free_id;
+ pcitag_t prev_tag, tag;
+ int offset, prev_offset;
+ int link, prev_link;
+ uint16_t prev_cap;
+ pcireg_t cmd, lr, id, t;
+ int double_ended;
+ int linkerr;
+
+ prev_tag = br_tag; prev_offset = br_offset; prev_link = 0;
+ /* Since there is no direct peer-to-peer traffic, there is no
+ point in configuring a downstream link with more capability
+ than the current one. */
+ prev_cap = ldt_freq_cap(br_tag, br_offset, 0);
+
+ next_free_id = 1;
+ double_ended = 0;
+
+#if (LDT_DEBUG != 0)
+ printf("Link sizing for bus %d, bridge freq cap %04x\n",
+ bus, ldt_freq_cap(br_tag, br_offset, 0));
+#endif
+ for (;;) {
+
+ tag = pci_make_tag(bus, 0, 0);
+
+ id = pci_conf_read(tag, PCI_ID_REG);
+#if (LDT_DEBUG > 1)
+ pci_tagprintf(tag, "ldt_fabric_init: id register %08x\n", id);
+#endif
+ if (PCI_VENDOR(id) == 0xffff) {
+ /* The incoming link had InitDone set, but we got an NXA
+ trying to read the vendor id. Either the reverse link
+ is broken or we have found an LDT-Lite node. For now,
+ assume the latter. Since an LDT-Lite device cannot be
+ a tunnel, assume the chain terminates here. */
+ pci_tagprintf(tag, "assumed LDT-LITE device (virtual unit %d)\n",
+ next_free_id);
+ break;
+ }
+
+ offset = pci_find_ldt_cap(tag, LDT_PRIMARY);
+#if (LDT_DEBUG > 1)
+ pci_tagprintf(tag, "ldt_fabric_init: offset %08x\n", offset);
+#endif
+ if (offset == 0) {
+ /* There is no primary interface; we must have found a host. */
+ offset = pci_find_ldt_cap(tag, LDT_SECONDARY);
+ if (offset != 0) {
+ lr = pci_conf_read(tag, offset + LDT_COMMAND_CAP_OFF);
+ lr |= LDT_COMMAND_DOUBLE_ENDED;
+ pci_conf_write(tag, offset + LDT_COMMAND_CAP_OFF, lr);
+ double_ended = 1;
+ }
+ break;
+ }
+
+ /* Otherwise, we have the primary interface. */
+
+ /* Rewrite the old value to set master host bit. */
+ cmd = pci_conf_read(tag, offset + LDT_COMMAND_CAP_OFF);
+#if (LDT_DEBUG > 1)
+ pci_tagprintf(tag, "ldt_fabric_init: set master host\n");
+#endif
+ pci_conf_write(tag, offset + LDT_COMMAND_CAP_OFF, cmd);
+ cmd = pci_conf_read(tag, offset + LDT_COMMAND_CAP_OFF); /* push */
+
+ id = pci_conf_read(tag, PCI_ID_REG);
+
+ /* Update the unit id, gingerly. */
+ cmd &= ~LDT_COMMAND_UNIT_ID_MASK;
+ cmd |= (next_free_id << LDT_COMMAND_UNIT_ID_SHIFT);
+#if (LDT_DEBUG != 0)
+ pci_tagprintf(tag, "ldt_fabric_init: set unit id %d\n", next_free_id);
+#endif
+ if (!pci_conf_write_acked(tag, offset + LDT_COMMAND_CAP_OFF, cmd)) {
+ pci_tagprintf(tag, "no ack of id update to %d\n", next_free_id);
+ }
+
+ /* The unit id just changed. Update the tag */
+ tag = pci_make_tag(bus, next_free_id, 0);
+#if (LDT_DEBUG > 1)
+ pci_tagprintf(tag, "ldt_fabric_init: check unit id\n");
+#endif
+ t = pci_conf_read(tag, PCI_ID_REG);
+ if (t != id) {
+ pci_tagprintf(tag, "id mismatch: old %08x, new %08x\n", id, t);
+ }
+
+ next_free_id += LDT_COMMAND_UNIT_COUNT(cmd);
+
+ link = LDT_COMMAND_MASTER_HOST(cmd); /* Upstream link index */
+
+ /* LDT Rev 0.17 does not support frequency updates. */
+ if ((flags & PCI_FLG_LDT_REV_017) == 0) {
+ /* Find common frequency for upstream link. */
+ uint16_t link_cap, freq_cap_in, freq_cap_out;
+ uint8_t ldt_freq;
+
+ freq_cap_out = ldt_freq_cap(prev_tag, prev_offset, prev_link);
+ freq_cap_in = ldt_freq_cap(tag, offset, link);
+ link_cap = freq_cap_in & freq_cap_out;
+ ldt_freq = ldt_max_freq(link_cap & prev_cap);
+
+#if (LDT_DEBUG != 0)
+ pci_tagprintf(tag, "set freq %d\n", ldt_freq);
+#endif
+ /* Set up frequency registers, next warm reset installs. */
+ ldt_set_freq(prev_tag, prev_offset, prev_link, ldt_freq);
+ ldt_set_freq(tag, offset, link, ldt_freq);
+
+ prev_cap &= link_cap;
+ }
+
+ link ^= 1; /* Downstream */
+ linkerr = ldt_wait_ready(tag, offset, link);
+ lr = ldt_get_link(tag, offset, link);
+ ldt_set_link(tag, offset, link, lr | LDT_LINKCTRL_WC);
+
+#if (LDT_DEBUG != 0)
+ pci_tagprintf(tag, "node: up %d down %d:\n", link ^ 1, link);
+#endif
+ ldt_show_cap(tag, offset, LDT_PRIMARY);
+
+ if (linkerr || next_free_id > 0x1f) {
+ /* No downstream link or too many devices, set end of chain */
+ ldt_end_chain(tag, offset, link);
+ break;
+ }
+
+ prev_tag = tag; prev_offset = offset; prev_link = link;
+ }
+
+ return double_ended;
+}
+
+
+static int
+ldt_fabric_reinit (int bus)
+{
+ int next_free_id;
+ pcitag_t tag;
+ int offset;
+ int link;
+ pcireg_t cmd, lr, id, t;
+ int linkerr;
+
+ next_free_id = 1;
+
+#if (LDT_DEBUG != 0)
+ printf("Link resizing for bus %d\n", bus);
+#endif
+ for (;;) {
+
+ tag = pci_make_tag(bus, 0, 0);
+
+ id = pci_conf_read(tag, PCI_ID_REG);
+ if (PCI_VENDOR(id) == 0xffff) {
+ /* Per the init pass, assume this indicates a link to an
+ LDT-Lite node, and the chain terminates here. */
+ break;
+ }
+
+ offset = pci_find_ldt_cap(tag, LDT_PRIMARY);
+ if (offset == 0) {
+ /* There is no primary interface; we must have found a host. */
+ offset = pci_find_ldt_cap(tag, LDT_SECONDARY);
+ if (offset != 0) {
+ lr = pci_conf_read(tag, offset + LDT_COMMAND_CAP_OFF);
+ lr |= LDT_COMMAND_DOUBLE_ENDED;
+ pci_conf_write(tag, offset + LDT_COMMAND_CAP_OFF, lr);
+ }
+ break;
+ }
+
+ /* Otherwise, we have the primary interface. */
+
+ /* Rewrite the old value to set master host bit. */
+ cmd = pci_conf_read(tag, offset + LDT_COMMAND_CAP_OFF);
+ pci_conf_write(tag, offset + LDT_COMMAND_CAP_OFF, cmd);
+ cmd = pci_conf_read(tag, offset + LDT_COMMAND_CAP_OFF);
+
+ id = pci_conf_read(tag, PCI_ID_REG);
+
+ /* (Re)update the unit id. See above. */
+ cmd &= ~LDT_COMMAND_UNIT_ID_MASK;
+ cmd |= (next_free_id << LDT_COMMAND_UNIT_ID_SHIFT);
+ if (!pci_conf_write_acked(tag, offset + LDT_COMMAND_CAP_OFF, cmd)) {
+ pci_tagprintf(tag, "no ack of id update to %d\n", next_free_id);
+ }
+
+ /* The unit id just changed. Update the tag */
+ tag = pci_make_tag(bus, next_free_id, 0);
+ t = pci_conf_read(tag, PCI_ID_REG); /* for good measure */
+ if (t != id) {
+ pci_tagprintf(tag, "id mismatch: old %08x, new %08x\n", id, t);
+ }
+
+ next_free_id += LDT_COMMAND_UNIT_COUNT(cmd);
+
+ link = LDT_COMMAND_MASTER_HOST(cmd); /* Upstream link index */
+ link ^= 1; /* Downstream */
+
+ linkerr = ldt_wait_ready(tag, offset, link);
+
+ lr = ldt_get_link(tag, offset, link);
+ ldt_set_link(tag, offset, link, lr | LDT_LINKCTRL_WC);
+#if (LDT_DEBUG > 1)
+ pci_tagprintf(tag, "node: up %d down %d:\n", link ^ 1, link);
+ ldt_show_cap(tag, offset, LDT_PRIMARY);
+#endif
+ if (linkerr || next_free_id > 0x1f) {
+ /* No downstream link or too many devices, set end of chain */
+ ldt_end_chain(tag, offset, link);
+ break;
+ }
+ }
+ return next_free_id - 1;
+}
+
+
+/* LDT link reset (warm or cold as set by caller) */
+
+void
+ldt_link_reset (pcitag_t tag, int delay)
+{
+ pcireg_t brctl;
+
+ /* This code may be necessary for LDT buses behind bridges (none
+ of which yet exist) but seems to be a bad idea for the SB-1250
+ LDT bus in pass 1 parts. Note that if we do reset, we must
+ delay to give any attached devices a chance to (re)initialize
+ per the PCI spec. */
+
+ /* Attempt a Secondary Bus Reset. */
+ brctl = pci_conf_read(tag, PPB_BRCTL_INTERRUPT_REG);
+ brctl |= PPB_BRCTL_SECONDARY_RESET;
+ pci_conf_write(tag, PPB_BRCTL_INTERRUPT_REG, brctl);
+
+ brctl = pci_conf_read(tag, PPB_BRCTL_INTERRUPT_REG);
+ if ((brctl & PPB_BRCTL_SECONDARY_RESET) != 0) {
+ int i;
+ /* Bit can be written, assume soft reset is implemented. */
+ brctl &=~ PPB_BRCTL_SECONDARY_RESET;
+ pci_conf_write(tag, PPB_BRCTL_INTERRUPT_REG, brctl);
+
+ /* Add some delay (duration is a guess) */
+ for (i = 0; i < delay; i++)
+ (void)pci_conf_read(tag, PPB_BRCTL_INTERRUPT_REG);
+ /* Alternatively, wait for LinkFail or InitDone. */
+ }
+}
+
+
+/* LDT bridge and fabric initialization for a secondary chain */
+
+int
+ldt_chain_init (pcitag_t tag, int bus, pci_flags_t flags)
+{
+ int offset;
+ int double_ended;
+ int linkerr;
+ pcireg_t cr, lr;
+ int ndev, no_probe;
+
+#if 0
+ /* This code may be necessary for LDT buses behind bridges (none
+ of which yet exist) but seems to be a bad idea for the SB-1250
+ LDT bus in pass 1 parts. Note that if we do reset, we must
+ delay to give any attached devices a chance to (re)initialize
+ per the PCI spec. */
+
+ /* Attempt a Secondary Bus Reset. */
+ ldt_link_reset(tag, 100);
+#endif /* 0 */
+
+ /* To avoid a chip erratum, we must prevent Type 0 configuration
+ probes that get NXAs on a double hosted chain. */
+ no_probe = 0;
+
+ offset = pci_find_ldt_cap(tag, LDT_SECONDARY);
+ if (offset != 0) {
+ linkerr = ldt_wait_ready(tag, offset, 0);
+
+#if (LDT_DEBUG > 1)
+ pci_tagprintf(tag, "bridge secondary:\n");
+ ldt_show_cap(tag, offset, LDT_SECONDARY);
+#endif
+ if (linkerr) {
+ pci_tagprintf(tag, "secondary bad or never ready\n");
+ } else {
+ lr = ldt_get_link(tag, offset, 0);
+ if ((lr & LDT_LINKCTRL_INITDONE) != 0)
+ double_ended = ldt_fabric_init(tag, offset, bus, flags);
+ else {
+ ldt_end_chain(tag, offset, 0);
+ double_ended = 0;
+ }
+ cr = pci_conf_read(tag, offset + LDT_COMMAND_CAP_OFF);
+ if (double_ended)
+ cr |= LDT_COMMAND_DOUBLE_ENDED;
+ else
+ cr &=~ LDT_COMMAND_DOUBLE_ENDED;
+ pci_conf_write(tag, offset + LDT_COMMAND_CAP_OFF, cr);
+
+ /* Rev 0.17 does not support dynamic link resizing. */
+ if ((flags & PCI_FLG_LDT_REV_017) == 0) {
+ /* Issue a warm reset to update link frequencies. */
+ cr = pci_conf_read(tag, offset + LDT_COMMAND_CAP_OFF);
+ cr |= LDT_COMMAND_WARM_RESET;
+ pci_conf_write(tag, offset + LDT_COMMAND_CAP_OFF, cr);
+ cr = pci_conf_read(tag, offset + LDT_COMMAND_CAP_OFF);
+ ldt_link_reset(tag, 100);
+ ldt_wait_ready(tag, offset, 0);
+
+#if (LDT_DEBUG > 1)
+ pci_tagprintf(tag, "bridge secondary:\n");
+ ldt_show_cap(tag, offset, LDT_SECONDARY);
+#endif
+ /* After reset, let secondary devices reinitialize. */
+ cfe_sleep(CFE_HZ/2);
+
+ ndev = ldt_fabric_reinit(bus);
+
+ if (double_ended) {
+ cr = pci_conf_read(tag, offset + LDT_COMMAND_CAP_OFF);
+ cr |= LDT_COMMAND_DOUBLE_ENDED;
+ pci_conf_write(tag, offset + LDT_COMMAND_CAP_OFF, cr);
+
+ /* Bug workaround -- don't scan simple dual-hosted chain */
+ if (ndev == 0)
+ no_probe = 1;
+ }
+ }
+ }
+ }
+
+ return no_probe;
+}
diff --git a/cfe/cfe/pci/ldtreg.h b/cfe/cfe/pci/ldtreg.h
new file mode 100644
index 0000000..140effe
--- /dev/null
+++ b/cfe/cfe/pci/ldtreg.h
@@ -0,0 +1,184 @@
+/*
+ * Copyright 2000,2001
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions as
+ * they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. Neither the "Broadcom
+ * Corporation" name nor any trademark or logo of Broadcom
+ * Corporation may be used to endorse or promote products
+ * derived from this software without the prior written
+ * permission of Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LDTREG_H_
+#define _LDTREG_H_
+
+/*
+ * LDT capability register definitions and macros.
+ * Derived from Revison 0.17 of the LDT (now HyperTransport)
+ * Specification with some 1.02/1.03 features.
+ *
+ * Note: Register and field definitions assume 32-bit register accesses.
+ */
+
+/*
+ * LDT Capability registers (identified by offsets within the capability)
+ */
+
+/*
+ * Command Register; contains command and capability fields.
+ */
+#define LDT_COMMAND_CAP_OFF 0x00
+
+#define LDT_CAP_ID_MASK 0x000000ff
+#define LDT_CAP_ID_SHIFT 0
+#define LDT_CAP_PTR_MASK 0x0000ff00
+#define LDT_CAP_PTR_SHIFT 8
+
+#define LDT_COMMAND_MASK 0xffff0000
+#define LDT_COMMAND_SHIFT 16
+#define LDT_COMMAND(cmd) \
+ (((cmd) & LDT_COMMAND_MASK) >> LDT_COMMAND_SHIFT)
+#define LDT_COMMAND_TYPE_MASK 0xe0000000
+#define LDT_COMMAND_TYPE_SHIFT (16+13)
+#define LDT_COMMAND_TYPE(cmd) \
+ (((cmd) & LDT_COMMAND_TYPE_MASK) >> LDT_COMMAND_TYPE_SHIFT)
+#define LDT_COMMAND_TYPE_SLAVE 0x0
+#define LDT_COMMAND_TYPE_HOST 0x1
+#define LDT_COMMAND_TYPE_IDC 0x4
+#define LDT_COMMAND_TYPE_AMAP 0x5
+/* Following for 1.0x only */
+#define LDT_COMMAND_DROP_ON_INIT 0x10000000
+
+/*
+ * An LDT capability for type Slave (aka Primary, aka "tunnel") consists
+ * of a Command register, two Link registers, and two Freq/Rev registers.
+ */
+/* Slave/Primary commands */
+#define LDT_COMMAND_UNIT_ID_MASK 0x001f0000
+#define LDT_COMMAND_UNIT_ID_SHIFT (16+0)
+#define LDT_COMMAND_UNIT_ID(cmd) \
+ (((cmd) & LDT_COMMAND_UNIT_ID_MASK) >> LDT_COMMAND_UNIT_ID_SHIFT)
+#define LDT_COMMAND_UNIT_COUNT_MASK 0x03e00000
+#define LDT_COMMAND_UNIT_COUNT_SHIFT (16+5)
+#define LDT_COMMAND_UNIT_COUNT(cmd) \
+ (((cmd) & LDT_COMMAND_UNIT_COUNT_MASK) >> LDT_COMMAND_UNIT_COUNT_SHIFT)
+#define LDT_COMMAND_MASTER_HOST_MASK 0x04000000
+#define LDT_COMMAND_MASTER_HOST(cmd) \
+ (((cmd) & LDT_COMMAND_MASTER_HOST_MASK) ? 1 : 0)
+#define LDT_COMMAND_DEFAULT_DIRECTION_MASK 0x08000000
+#define LDT_COMMAND_DEFAULT_DIRECTION(cmd) \
+ (((cmd) & LDT_COMMAND_DEFAULT_DIRECTION_MASK) ? 1 : 0)
+
+/*
+ * An LDT capability for type Host (aka Secondary) consists of a
+ * Command register, a single Link register, and a Freq/Rev register.
+ */
+/* Host/Secondary command fields */
+#define LDT_COMMAND_WARM_RESET 0x00010000
+#define LDT_COMMAND_DOUBLE_ENDED 0x00020000
+#define LDT_COMMAND_DEVICE_NUMBER_MASK 0x007c0000
+#define LDT_COMMAND_DEVICE_NUMBER_SHIFT (16+2)
+/* Following for 1.0x only */
+#define LDT_COMMAND_CHAIN_SIDE 0x00800000
+#define LDT_COMMAND_HOST_HIDE 0x01000000
+#define LDT_COMMAND_ACT_AS_SLAVE 0x02000000
+#define LDT_COMMAND_INBOUND_EOC_ERROR 0x04000000
+
+
+/*
+ * Link Register; contains control and config fields.
+ */
+#define LDT_LINK_OFF(n) (0x04 + ((n)<<2))
+
+#define LDT_LINKCTRL_MASK 0x0000ffff
+#define LDT_LINKCTRL_SHIFT 0
+#define LDT_LINKCTRL(cr) \
+ (((cr) & LDT_LINKCTRL_MASK) >> LDT_LINKCTRL_SHIFT)
+#define LDT_LINKCTRL_CFLE 0x00000002
+#define LDT_LINKCTRL_CST 0x00000004
+#define LDT_LINKCTRL_CFE 0x00000008
+#define LDT_LINKCTRL_LINKFAIL 0x00000010
+#define LDT_LINKCTRL_INITDONE 0x00000020
+#define LDT_LINKCTRL_EOC 0x00000040
+#define LDT_LINKCTRL_TXOFF 0x00000080
+#define LDT_LINKCTRL_CRCERROR_MASK 0x00000f00
+#define LDT_LINKCTRL_CRCERROR_SHIFT 8
+#define LDT_LINKCTRL_ISOCEN 0x00001000
+#define LDT_LINKCTRL_LSEN 0x00002000
+/* Following for 1.0x only */
+#define LDT_LINKCTRL_EXTCTL 0x00004000
+
+#define LDT_LINKCFG_MASK 0xffff0000
+#define LDT_LINKCFG_SHIFT 16
+#define LDT_LINKCFG(cr) \
+ (((cr) & LDT_LINKCFG_MASK) >> LDT_LINKCFG_SHIFT)
+#define LDT_LINKCFG_MAX_WIDTH_IN(cr) \
+ (((cr) >> (16+0)) & 0xf)
+#define LDT_LINKCFG_MAX_WIDTH_OUT(cr) \
+ (((cr) >> (16+4)) & 0xf)
+#define LDT_LINKCFG_WIDTH_IN(cr) \
+ (((cr) >> (16+8)) & 0xf)
+#define LDT_LINKCFG_WIDTH_OUT(cr) \
+ (((cr) >> (16+12)) & 0xf)
+
+
+/*
+ * Link Frequency Register; contains version and frequency fields.
+ */
+#define LDT_LINKFREQ_CAP(cr) \
+ (((cr) >> 16) & 0xffff)
+
+#define LDT_LINKFREQ_MASK 0x00000f00
+#define LDT_LINKFREQ_SHIFT 8
+#define LDT_LINKFREQ(cr) \
+ (((cr) >> 8) & 0x0f)
+
+#define LDT_REVISION_ID(cr) \
+ (((cr) >> 0) & 0xff)
+
+#define LDT_REV_017 0x11
+#define LDT_REV_102 0x22
+
+/* Slave/Primary offsets */
+#define LDT_FREQ0_OFF 0x0c
+#define LDT_FREQ1_OFF 0x10
+#define LDT_FREQn_OFF(n) (0x0c + ((n)<<2))
+
+/* Host/Secondary offsets */
+#define LDT_FREQ_OFF 0x08
+
+#define LDT_FREQ_200 0x00
+#define LDT_FREQ_300 0x01
+#define LDT_FREQ_400 0x02
+#define LDT_FREQ_500 0x03
+#define LDT_FREQ_600 0x04
+#define LDT_FREQ_800 0x05
+#define LDT_FREQ_1000 0x06
+
+#endif /* _LDTREG_H_ */
diff --git a/cfe/cfe/pci/pci_machdep.h b/cfe/cfe/pci/pci_machdep.h
new file mode 100644
index 0000000..c8b57ec
--- /dev/null
+++ b/cfe/cfe/pci/pci_machdep.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2001,2002 SiByte, Inc. All rights reserved.
+ */
+
+#ifndef _PCI_MACHDEP_H_
+#define _PCI_MACHDEP_H_
+
+/*
+ * Machine-specific definitions for PCI autoconfiguration.
+ *
+ * See the comments in pci_machdep.c for more explanation.
+ */
+
+#include "lib_types.h"
+
+/*
+ * Address types, as integers.
+ */
+
+typedef uint32_t pci_addr_t;
+typedef uint64_t phys_addr_t; /* ZBbus physical addresses. */
+
+/*
+ * Configuration tag; created from a {bus,device,function} triplet by
+ * pci_make_tag(), and passed to pci_conf_read() and pci_conf_write().
+ */
+typedef uint32_t pcitag_t;
+
+/*
+ * Type of a value read from or written to a configuration register.
+ * Always 32 bits.
+ */
+typedef uint32_t pcireg_t;
+
+#endif /* _PCI_MACHDEP_H_ */
diff --git a/cfe/cfe/pci/pci_subr.c b/cfe/cfe/pci/pci_subr.c
new file mode 100644
index 0000000..56c65b1
--- /dev/null
+++ b/cfe/cfe/pci/pci_subr.c
@@ -0,0 +1,710 @@
+/*
+ * Copyright (c) 1997 Zubin D. Dittia. All rights reserved.
+ * Copyright (c) 1995, 1996, 1998
+ * Christopher G. Demetriou. All rights reserved.
+ * Copyright (c) 1994 Charles M. Hannum. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Charles M. Hannum.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * PCI autoconfiguration support functions.
+ */
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+#ifndef PCIVERBOSE
+# if CFG_MINIMAL_SIZE
+# define PCIVERBOSE 0
+# else
+# define PCIVERBOSE 1
+# endif
+#endif
+
+#include "pcireg.h"
+#include "pcivar.h"
+
+const char *pci_findvendor(pcireg_t id_reg);
+
+static void pci_conf_print_ids(pcireg_t rval, const char *prefix);
+static int pci_conf_print_bar (pcitag_t,
+ const pcireg_t *, int, const char *, int, int);
+
+/*
+ * Descriptions of known PCI classes and subclasses.
+ *
+ * Subclasses are described in the same way as classes, but have a
+ * NULL subclass pointer.
+ */
+struct pci_class {
+ char *name;
+ int val; /* as wide as pci_{,sub}class_t */
+ struct pci_class *subclasses;
+};
+
+struct pci_class pci_subclass_prehistoric[] = {
+ { "miscellaneous", PCI_SUBCLASS_PREHISTORIC_MISC, },
+ { "VGA", PCI_SUBCLASS_PREHISTORIC_VGA, },
+ { 0 }
+};
+
+struct pci_class pci_subclass_mass_storage[] = {
+ { "SCSI", PCI_SUBCLASS_MASS_STORAGE_SCSI, },
+ { "IDE", PCI_SUBCLASS_MASS_STORAGE_IDE, },
+ { "floppy", PCI_SUBCLASS_MASS_STORAGE_FLOPPY, },
+ { "IPI", PCI_SUBCLASS_MASS_STORAGE_IPI, },
+ { "RAID", PCI_SUBCLASS_MASS_STORAGE_RAID, },
+ { "miscellaneous", PCI_SUBCLASS_MASS_STORAGE_MISC, },
+ { 0 },
+};
+
+struct pci_class pci_subclass_network[] = {
+ { "ethernet", PCI_SUBCLASS_NETWORK_ETHERNET, },
+ { "token ring", PCI_SUBCLASS_NETWORK_TOKENRING, },
+ { "FDDI", PCI_SUBCLASS_NETWORK_FDDI, },
+ { "ATM", PCI_SUBCLASS_NETWORK_ATM, },
+ { "ISDN", PCI_SUBCLASS_NETWORK_ISDN, },
+ { "WorldFip", PCI_SUBCLASS_NETWORK_WORLDFIP, },
+ { "PCMIG MultiComp", PCI_SUBCLASS_NETWORK_PCIMGMULTICOMP, },
+ { "miscellaneous", PCI_SUBCLASS_NETWORK_MISC, },
+ { 0 },
+};
+
+struct pci_class pci_subclass_display[] = {
+ { "VGA", PCI_SUBCLASS_DISPLAY_VGA, },
+ { "XGA", PCI_SUBCLASS_DISPLAY_XGA, },
+ { "3D", PCI_SUBCLASS_DISPLAY_3D, },
+ { "miscellaneous", PCI_SUBCLASS_DISPLAY_MISC, },
+ { 0 },
+};
+
+struct pci_class pci_subclass_multimedia[] = {
+ { "video", PCI_SUBCLASS_MULTIMEDIA_VIDEO, },
+ { "audio", PCI_SUBCLASS_MULTIMEDIA_AUDIO, },
+ { "telephony", PCI_SUBCLASS_MULTIMEDIA_TELEPHONY, },
+ { "miscellaneous", PCI_SUBCLASS_MULTIMEDIA_MISC, },
+ { 0 },
+};
+
+struct pci_class pci_subclass_memory[] = {
+ { "RAM", PCI_SUBCLASS_MEMORY_RAM, },
+ { "flash", PCI_SUBCLASS_MEMORY_FLASH, },
+ { "miscellaneous", PCI_SUBCLASS_MEMORY_MISC, },
+ { 0 },
+};
+
+struct pci_class pci_subclass_bridge[] = {
+ { "host", PCI_SUBCLASS_BRIDGE_HOST, },
+ { "ISA", PCI_SUBCLASS_BRIDGE_ISA, },
+ { "EISA", PCI_SUBCLASS_BRIDGE_EISA, },
+ { "MicroChannel", PCI_SUBCLASS_BRIDGE_MCA, },
+ { "PCI", PCI_SUBCLASS_BRIDGE_PCI, },
+ { "PCMCIA", PCI_SUBCLASS_BRIDGE_PCMCIA, },
+ { "NuBus", PCI_SUBCLASS_BRIDGE_NUBUS, },
+ { "CardBus", PCI_SUBCLASS_BRIDGE_CARDBUS, },
+ { "RACEway", PCI_SUBCLASS_BRIDGE_RACEWAY, },
+ { "Semi-transparent PCI", PCI_SUBCLASS_BRIDGE_STPCI, },
+ { "InfiniBand", PCI_SUBCLASS_BRIDGE_INFINIBAND, },
+ { "miscellaneous", PCI_SUBCLASS_BRIDGE_MISC, },
+ { 0 },
+};
+
+struct pci_class pci_subclass_communications[] = {
+ { "serial", PCI_SUBCLASS_COMMUNICATIONS_SERIAL, },
+ { "parallel", PCI_SUBCLASS_COMMUNICATIONS_PARALLEL, },
+ { "multi-port serial", PCI_SUBCLASS_COMMUNICATIONS_MPSERIAL, },
+ { "modem", PCI_SUBCLASS_COMMUNICATIONS_MODEM, },
+ { "miscellaneous", PCI_SUBCLASS_COMMUNICATIONS_MISC, },
+ { 0 },
+};
+
+struct pci_class pci_subclass_system[] = {
+ { "8259 PIC", PCI_SUBCLASS_SYSTEM_PIC, },
+ { "8237 DMA", PCI_SUBCLASS_SYSTEM_DMA, },
+ { "8254 timer", PCI_SUBCLASS_SYSTEM_TIMER, },
+ { "RTC", PCI_SUBCLASS_SYSTEM_RTC, },
+ { "PCI Hot-Plug", PCI_SUBCLASS_SYSTEM_PCIHOTPLUG, },
+ { "miscellaneous", PCI_SUBCLASS_SYSTEM_MISC, },
+ { 0 },
+};
+
+struct pci_class pci_subclass_input[] = {
+ { "keyboard", PCI_SUBCLASS_INPUT_KEYBOARD, },
+ { "digitizer", PCI_SUBCLASS_INPUT_DIGITIZER, },
+ { "mouse", PCI_SUBCLASS_INPUT_MOUSE, },
+ { "scanner", PCI_SUBCLASS_INPUT_SCANNER, },
+ { "game port", PCI_SUBCLASS_INPUT_GAMEPORT, },
+ { "miscellaneous", PCI_SUBCLASS_INPUT_MISC, },
+ { 0 },
+};
+
+struct pci_class pci_subclass_dock[] = {
+ { "generic", PCI_SUBCLASS_DOCK_GENERIC, },
+ { "miscellaneous", PCI_SUBCLASS_DOCK_MISC, },
+ { 0 },
+};
+
+struct pci_class pci_subclass_processor[] = {
+ { "386", PCI_SUBCLASS_PROCESSOR_386, },
+ { "486", PCI_SUBCLASS_PROCESSOR_486, },
+ { "Pentium", PCI_SUBCLASS_PROCESSOR_PENTIUM, },
+ { "Alpha", PCI_SUBCLASS_PROCESSOR_ALPHA, },
+ { "PowerPC", PCI_SUBCLASS_PROCESSOR_POWERPC, },
+ { "MIPS", PCI_SUBCLASS_PROCESSOR_MIPS, },
+ { "Co-processor", PCI_SUBCLASS_PROCESSOR_COPROC, },
+ { 0 },
+};
+
+struct pci_class pci_subclass_serialbus[] = {
+ { "Firewire", PCI_SUBCLASS_SERIALBUS_FIREWIRE, },
+ { "ACCESS.bus", PCI_SUBCLASS_SERIALBUS_ACCESS, },
+ { "SSA", PCI_SUBCLASS_SERIALBUS_SSA, },
+ { "USB", PCI_SUBCLASS_SERIALBUS_USB, },
+ /* XXX Fiber Channel/_FIBRECHANNEL */
+ { "Fiber Channel", PCI_SUBCLASS_SERIALBUS_FIBER, },
+ { "SMBus", PCI_SUBCLASS_SERIALBUS_SMBUS, },
+ { "InfiniBand", PCI_SUBCLASS_SERIALBUS_INFINIBAND, },
+ { "IPMI", PCI_SUBCLASS_SERIALBUS_IPMI, },
+ { "SERCOS", PCI_SUBCLASS_SERIALBUS_SERCOS, },
+ { "CANbus", PCI_SUBCLASS_SERIALBUS_CANBUS, },
+ { 0 },
+};
+
+struct pci_class pci_subclass_wireless[] = {
+ { "iRDA", PCI_SUBCLASS_WIRELESS_IRDA, },
+ { "Consumer IR", PCI_SUBCLASS_WIRELESS_CONSUMERIR, },
+ { "RF", PCI_SUBCLASS_WIRELESS_RF, },
+ { "miscellaneous", PCI_SUBCLASS_WIRELESS_MISC, },
+ { 0 },
+};
+
+struct pci_class pci_subclass_i2o[] = {
+ { "1.0", PCI_SUBCLASS_I2O_STANDARD, },
+ { 0 },
+};
+
+struct pci_class pci_subclass_satcom[] = {
+ { "TV", PCI_SUBCLASS_SATCOM_TV, },
+ { "audio", PCI_SUBCLASS_SATCOM_AUDIO, },
+ { "voice", PCI_SUBCLASS_SATCOM_VOICE, },
+ { "data", PCI_SUBCLASS_SATCOM_DATA, },
+ { 0 },
+};
+
+struct pci_class pci_subclass_crypto[] = {
+ { "network/computing", PCI_SUBCLASS_CRYPTO_NETCOMP, },
+ { "entertainment", PCI_SUBCLASS_CRYPTO_ENTERTAINMENT, },
+ { "miscellaneous", PCI_SUBCLASS_CRYPTO_MISC, },
+ { 0 },
+};
+
+struct pci_class pci_subclass_dasp[] = {
+ { "DPIO", PCI_SUBCLASS_DASP_DPIO, },
+ { "time and frequency", PCI_SUBCLASS_DASP_TIMERFREQ, },
+ { "miscellaneous", PCI_SUBCLASS_DASP_MISC, },
+ { 0 },
+};
+
+struct pci_class pci_class[] = {
+ { "prehistoric", PCI_CLASS_PREHISTORIC,
+ pci_subclass_prehistoric, },
+ { "mass storage", PCI_CLASS_MASS_STORAGE,
+ pci_subclass_mass_storage, },
+ { "network", PCI_CLASS_NETWORK,
+ pci_subclass_network, },
+ { "display", PCI_CLASS_DISPLAY,
+ pci_subclass_display, },
+ { "multimedia", PCI_CLASS_MULTIMEDIA,
+ pci_subclass_multimedia, },
+ { "memory", PCI_CLASS_MEMORY,
+ pci_subclass_memory, },
+ { "bridge", PCI_CLASS_BRIDGE,
+ pci_subclass_bridge, },
+ { "communications", PCI_CLASS_COMMUNICATIONS,
+ pci_subclass_communications, },
+ { "system", PCI_CLASS_SYSTEM,
+ pci_subclass_system, },
+ { "input", PCI_CLASS_INPUT,
+ pci_subclass_input, },
+ { "dock", PCI_CLASS_DOCK,
+ pci_subclass_dock, },
+ { "processor", PCI_CLASS_PROCESSOR,
+ pci_subclass_processor, },
+ { "serial bus", PCI_CLASS_SERIALBUS,
+ pci_subclass_serialbus, },
+ { "wireless", PCI_CLASS_WIRELESS,
+ pci_subclass_wireless, },
+ { "I2O", PCI_CLASS_I2O,
+ pci_subclass_i2o, },
+ { "satellite comm", PCI_CLASS_SATCOM,
+ pci_subclass_satcom, },
+ { "crypto", PCI_CLASS_CRYPTO,
+ pci_subclass_crypto, },
+ { "DASP", PCI_CLASS_DASP,
+ pci_subclass_dasp, },
+ { "undefined", PCI_CLASS_UNDEFINED,
+ 0, },
+ { 0 },
+};
+
+#if PCIVERBOSE
+/*
+ * Descriptions of of known vendors and devices ("products").
+ */
+#include "pcidevs.h"
+
+struct pci_knowndev2 {
+ pci_vendor_id_t vendor;
+ pci_product_id_t product;
+ int flags;
+ int vendorname, productname;
+};
+#define PCI_KNOWNDEV_NOPROD 0x01 /* match on vendor only */
+#include "pcidevs_data2.h"
+
+const char *
+pci_findvendor(pcireg_t id_reg)
+{
+ pci_vendor_id_t vendor = PCI_VENDOR(id_reg);
+ const struct pci_knowndev2 *kdp;
+
+ kdp = pci_knowndevs;
+ while (kdp->vendorname != PCI_STRING_NULL) { /* all have vendor name */
+ if (kdp->vendor == vendor)
+ break;
+ kdp++;
+ }
+ if (kdp->vendorname == PCI_STRING_NULL) return NULL;
+ return PCI_STRING(kdp->vendorname);
+}
+#else
+const char *
+pci_findvendor(pcireg_t id_reg)
+{
+ return NULL;
+}
+#endif /* PCIVERBOSE */
+
+void
+pci_devinfo(pcireg_t id_reg, pcireg_t class_reg, int showclass, char *cp)
+{
+ pci_vendor_id_t vendor;
+ pci_product_id_t product;
+ pci_class_t class;
+ pci_subclass_t subclass;
+ pci_interface_t interface;
+ pci_revision_t revision;
+ const char *vendor_namep, *product_namep;
+ struct pci_class *classp, *subclassp;
+#if PCIVERBOSE
+ const struct pci_knowndev2 *kdp;
+ const char *unmatched = "unknown ";
+#else
+ const char *unmatched = "";
+#endif
+
+ vendor = PCI_VENDOR(id_reg);
+ product = PCI_PRODUCT(id_reg);
+
+ class = PCI_CLASS(class_reg);
+ subclass = PCI_SUBCLASS(class_reg);
+ interface = PCI_INTERFACE(class_reg);
+ revision = PCI_REVISION(class_reg);
+
+#if PCIVERBOSE
+ kdp = pci_knowndevs;
+ while (kdp->vendorname != PCI_STRING_NULL) { /* all have vendor name */
+ if (kdp->vendor == vendor && (kdp->product == product ||
+ (kdp->flags & PCI_KNOWNDEV_NOPROD) != 0))
+ break;
+ kdp++;
+ }
+ if (kdp->vendorname == PCI_STRING_NULL)
+ vendor_namep = product_namep = NULL;
+ else {
+ vendor_namep = PCI_STRING(kdp->vendorname);
+ product_namep = ((kdp->flags & PCI_KNOWNDEV_NOPROD) == 0 ?
+ PCI_STRING(kdp->productname) : NULL);
+ }
+#else /* PCIVERBOSE */
+ vendor_namep = product_namep = NULL;
+#endif /* PCIVERBOSE */
+
+ classp = pci_class;
+ while (classp->name != NULL) {
+ if (class == classp->val)
+ break;
+ classp++;
+ }
+
+ subclassp = (classp->name != NULL) ? classp->subclasses : NULL;
+ while (subclassp && subclassp->name != NULL) {
+ if (subclass == subclassp->val)
+ break;
+ subclassp++;
+ }
+
+ if (vendor_namep == NULL)
+ cp += sprintf(cp, "%svendor 0x%04x product 0x%04x",
+ unmatched, vendor, product);
+ else if (product_namep != NULL)
+ cp += sprintf(cp, "%s %s", vendor_namep, product_namep);
+ else
+ cp += sprintf(cp, "%s product 0x%04x", vendor_namep, product);
+ if (showclass) {
+ cp += sprintf(cp, " (");
+ if (classp->name == NULL)
+ cp += sprintf(cp, "class 0x%02x, subclass 0x%02x",
+ class, subclass);
+ else {
+ if (subclassp == NULL || subclassp->name == NULL)
+ cp += sprintf(cp, "%s subclass 0x%02x",
+ classp->name, subclass);
+ else
+ cp += sprintf(cp, "%s %s", subclassp->name, classp->name);
+ }
+ if (interface != 0)
+ cp += sprintf(cp, ", interface 0x%02x", interface);
+ if (revision != 0)
+ cp += sprintf(cp, ", revision 0x%02x", revision);
+ cp += sprintf(cp, ")");
+ }
+}
+
+
+/*
+ * Support routines for printing out PCI configuration registers.
+ */
+
+#define i2o(i) ((i) * 4)
+#define o2i(o) ((o) / 4)
+#define onoff(str, bit) \
+ do { \
+ printf(" %s: %s\n", (str), (rval & (bit)) ? "on" : "off"); \
+ } while (0)
+
+#if PCIVERBOSE
+static void
+pci_conf_print_ids(pcireg_t rval, const char *prefix)
+{
+ const struct pci_knowndev2 *kdp;
+
+ for (kdp = pci_knowndevs; kdp->vendorname != PCI_STRING_NULL; kdp++) {
+ if (kdp->vendor == PCI_VENDOR(rval) &&
+ (kdp->product == PCI_PRODUCT(rval) ||
+ (kdp->flags & PCI_KNOWNDEV_NOPROD) != 0)) {
+ break;
+ }
+ }
+ if (kdp->vendorname != PCI_STRING_NULL)
+ printf("%sVendor Name: %s (0x%04x)\n", prefix,
+ PCI_STRING(kdp->vendorname), PCI_VENDOR(rval));
+ else
+ printf("%sVendor ID: 0x%04x\n", prefix, PCI_VENDOR(rval));
+ if (kdp->productname != PCI_STRING_NULL
+ && (kdp->flags & PCI_KNOWNDEV_NOPROD) == 0)
+ printf("%sDevice Name: %s (0x%04x)\n", prefix,
+ PCI_STRING(kdp->productname), PCI_PRODUCT(rval));
+ else
+ printf("%sDevice ID: 0x%04x\n", prefix, PCI_PRODUCT(rval));
+}
+#else
+static void
+pci_conf_print_ids(pcireg_t rval, const char *prefix)
+{
+ printf("%sVendor ID: 0x%04x\n", prefix, PCI_VENDOR(rval));
+ printf("%sDevice ID: 0x%04x\n", prefix, PCI_PRODUCT(rval));
+}
+#endif /* PCIVERBOSE */
+
+static int
+pci_conf_print_bar(
+ pcitag_t tag, const pcireg_t *regs,
+ int reg, const char *name,
+ int sizebar, int onlyimpl)
+{
+ int width;
+ pcireg_t mask, rval;
+ pcireg_t mask64h, rval64h;
+
+#ifdef __GNUC__ /* XXX GCC -Wuninitialized inadequacies */
+ mask64h = rval64h = 0;
+#endif
+
+ width = 4;
+
+ /*
+ * Section 6.2.5.1, `Address Maps', tells us that:
+ *
+ * 1) The builtin software should have already mapped the
+ * device in a reasonable way.
+ *
+ * 2) A device which wants 2^n bytes of memory will hardwire
+ * the bottom n bits of the address to 0. As recommended,
+ * we write all 1s and see what we get back.
+ */
+ rval = regs[o2i(reg)];
+ /* XXX don't size unknown memory type? */
+ if (rval != 0 && sizebar) {
+ uint32_t cmdreg;
+
+ /*
+ * The following sequence seems to make some devices
+ * (e.g. host bus bridges, which don't normally
+ * have their space mapped) very unhappy, to
+ * the point of crashing the system.
+ *
+ * Therefore, if the mapping register is zero to
+ * start out with, don't bother trying.
+ */
+
+ cmdreg = pci_conf_read(tag, PCI_COMMAND_STATUS_REG);
+ cmdreg &= (PCI_COMMAND_MASK << PCI_COMMAND_SHIFT); /* keep status */
+ pci_conf_write(tag, PCI_COMMAND_STATUS_REG,
+ cmdreg & ~(PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE));
+
+ pci_conf_write(tag, reg, 0xffffffff);
+ mask = pci_conf_read(tag, reg);
+ pci_conf_write(tag, reg, rval);
+ if (PCI_MAPREG_TYPE(rval) == PCI_MAPREG_TYPE_MEM &&
+ PCI_MAPREG_MEM_TYPE(rval) == PCI_MAPREG_MEM_TYPE_64BIT) {
+ rval64h = regs[o2i(reg + 4)];
+ pci_conf_write(tag, reg + 4, 0xffffffff);
+ mask64h = pci_conf_read(tag, reg + 4);
+ pci_conf_write(tag, reg + 4, rval64h);
+ width = 8;
+ }
+
+ pci_conf_write(tag, PCI_COMMAND_STATUS_REG, cmdreg);
+ } else
+ mask = 0;
+
+ if (rval == 0 && onlyimpl)
+ return width;
+
+ printf(" Base Address Register at 0x%02x", reg);
+ if (name)
+ printf(" (%s)", name);
+ printf("\n ");
+ if (rval == 0) {
+ printf("not implemented(?)\n");
+ return width;
+ }
+ printf("type: ");
+ if (PCI_MAPREG_TYPE(rval) == PCI_MAPREG_TYPE_MEM) {
+ const char *type, *prefetch;
+
+ switch (PCI_MAPREG_MEM_TYPE(rval)) {
+ case PCI_MAPREG_MEM_TYPE_32BIT:
+ type = "32-bit";
+ break;
+ case PCI_MAPREG_MEM_TYPE_32BIT_1M:
+ type = "32-bit-1M";
+ break;
+ case PCI_MAPREG_MEM_TYPE_64BIT:
+ type = "64-bit";
+ break;
+ default:
+ type = "unknown (XXX)";
+ break;
+ }
+ if (PCI_MAPREG_MEM_PREFETCHABLE(rval))
+ prefetch = "";
+ else
+ prefetch = "non";
+ printf("%s %sprefetchable memory\n", type, prefetch);
+ switch (PCI_MAPREG_MEM_TYPE(rval)) {
+ case PCI_MAPREG_MEM_TYPE_64BIT:
+ printf(" base: 0x%016llx, ",
+ PCI_MAPREG_MEM64_ADDR(
+ ((((long long) rval64h) << 32) | rval)));
+ if (sizebar)
+ printf("size: 0x%016llx",
+ PCI_MAPREG_MEM64_SIZE(
+ ((((long long) mask64h) << 32) | mask)));
+ else
+ printf("not sized");
+ printf("\n");
+ break;
+ case PCI_MAPREG_MEM_TYPE_32BIT:
+ case PCI_MAPREG_MEM_TYPE_32BIT_1M:
+ default:
+ printf(" base: 0x%08x, ", PCI_MAPREG_MEM_ADDR(rval));
+ if (sizebar)
+ printf("size: 0x%08x", PCI_MAPREG_MEM_SIZE(mask));
+ else
+ printf("not sized");
+ printf("\n");
+ break;
+ }
+ } else {
+ if (sizebar)
+ printf("%d-bit ", mask & ~0x0000ffff ? 32 : 16);
+ printf("i/o\n");
+ printf(" base: 0x%08x, ", PCI_MAPREG_IO_ADDR(rval));
+ if (sizebar)
+ printf("size: 0x%08x", PCI_MAPREG_IO_SIZE(mask));
+ else
+ printf("not sized");
+ printf("\n");
+ }
+
+ return width;
+}
+
+
+/* Summary printing: Display device ID, status, memory map only. */
+
+#define on(str, bit) \
+ do { if (rval & (bit)) printf(" %s: on\n", (str)); } while (0)
+
+void
+pci_conf_print(pcitag_t tag)
+{
+ pcireg_t regs[o2i(256)];
+ int off, width;
+ pcireg_t rval;
+ uint32_t base, limit;
+ int sizebars;
+
+ if (!pci_probe_tag(tag)) {
+ printf("no device\n");
+ return;
+ }
+
+ for (off = 0; off < 256; off += 4)
+ regs[o2i(off)] = pci_conf_read(tag, off);
+
+ rval = regs[o2i(PCI_ID_REG)];
+ pci_conf_print_ids(rval, " ");
+
+ rval = regs[o2i(PCI_COMMAND_STATUS_REG)];
+
+ printf(" Command: 0x%04x\n", rval & 0xffff);
+ on("I/O space accesses", PCI_COMMAND_IO_ENABLE);
+ on("Memory space accesses", PCI_COMMAND_MEM_ENABLE);
+ on("Bus mastering", PCI_COMMAND_MASTER_ENABLE);
+
+ printf(" Status: 0x%04x\n", PCI_STATUS(rval));
+ on("Slave signaled Target Abort", PCI_STATUS_TARGET_TARGET_ABORT);
+ on("Master received Target Abort", PCI_STATUS_MASTER_TARGET_ABORT);
+ on("Master received Master Abort", PCI_STATUS_MASTER_ABORT);
+ on("Asserted System Error (SERR)", PCI_STATUS_SYSTEM_ERROR);
+ on("Parity error detected", PCI_STATUS_PARITY_DETECT);
+
+ switch (PCI_HDRTYPE_TYPE(regs[o2i(PCI_BHLC_REG)])) {
+ case 0:
+ /* Standard device header */
+ printf(" Type 0 (normal) header:\n");
+
+ /* sizing host BARs is often bad news */
+ sizebars = 1;
+ if (PCI_CLASS(regs[o2i(PCI_CLASS_REG)]) == PCI_CLASS_BRIDGE &&
+ PCI_SUBCLASS(regs[o2i(PCI_CLASS_REG)]) == PCI_SUBCLASS_BRIDGE_HOST)
+ sizebars = 0;
+ for (off = PCI_MAPREG_START; off < PCI_MAPREG_END; off += width)
+ width = pci_conf_print_bar(tag, regs, off, NULL, sizebars, 1);
+
+ rval = regs[o2i(PCI_BPARAM_INTERRUPT_REG)];
+ printf(" Interrupt Line: 0x%02x\n", PCI_INTERRUPT_LINE(rval));
+ break;
+
+ case 1:
+ /* PCI-PCI bridge header */
+ printf(" Type 1 (PCI-PCI bridge) header:\n");
+
+ rval = regs[o2i(PPB_BUSINFO_REG)];
+ printf(" Buses:\n");
+ printf(" Primary: %d,", PPB_BUSINFO_PRIMARY(rval));
+ printf(" Secondary: %d,", PPB_BUSINFO_SECONDARY(rval));
+ printf(" Subordinate: %d\n", PPB_BUSINFO_SUBORD(rval));
+
+ rval = regs[o2i(PPB_IO_STATUS_REG)];
+ printf(" Secondary Status: 0x%04x\n", PPB_SECSTATUS(rval));
+ on(" Data parity error detected", PCI_STATUS_PARITY_ERROR);
+ on(" Signaled Target Abort", PCI_STATUS_TARGET_TARGET_ABORT);
+ on(" Received Target Abort", PCI_STATUS_MASTER_TARGET_ABORT);
+ on(" Received Master Abort", PCI_STATUS_MASTER_ABORT);
+ on(" System Error", PCI_STATUS_SYSTEM_ERROR);
+ on(" Parity Error", PCI_STATUS_PARITY_DETECT);
+
+ rval = regs[o2i(PPB_IO_STATUS_REG)];
+ base = PPB_IO_BASE(rval);
+ limit = PPB_IO_LIMIT(rval);
+ if (base != 0 || limit != 0) {
+ printf(" I/O Range:\n");
+
+ if ((base & 0xf) != 0 || (limit & 0xf) != 0) {
+ base = ((base & 0xf0) << 8) | 0x000;
+ limit = ((limit & 0xf0) << 8) | 0xfff;
+ rval = regs[o2i(PPB_IO_UPPER_REG)];
+ base |= PPB_BASE(rval) << 16;
+ limit |= PPB_LIMIT(rval) << 16;
+ printf(" base: 0x%08x, limit: 0x%08x\n", base, limit);
+ } else {
+ base = (base << 8) | 0x000;
+ limit = (limit << 8) | 0xfff;
+ printf(" base: 0x%04x, limit: 0x%04x\n", base, limit);
+ }
+ }
+
+ base = PPB_BASE(regs[o2i(PPB_MEM_REG)]) & 0xfff0;
+ limit = PPB_LIMIT(regs[o2i(PPB_MEM_REG)]) & 0xfff0;
+ printf(" Memory Range:\n");
+ base = (base << 16) | 0x00000;
+ limit = (limit << 16) | 0xfffff;
+ printf(" base: 0x%08x, limit: 0x%08x\n", base, limit);
+
+ base = PPB_BASE(regs[o2i(PPB_PREFMEM_REG)]) & 0xffff;
+ limit = PPB_LIMIT(regs[o2i(PPB_PREFMEM_REG)]) & 0xffff;
+ if (base != 0 || limit != 0
+ || regs[o2i(PPB_PREFMEM_BASE_UPPER_REG)] != 0
+ || regs[o2i(PPB_PREFMEM_LIMIT_UPPER_REG)] != 0) {
+ printf(" Prefetchable Memory Range:\n");
+ if ((base & 0xf) != 0 || (limit & 0xf) != 0) {
+ base = ((base & 0xfff0) << 16) | 0x00000;
+ limit = ((limit & 0xfff0) << 16) | 0xfffff;
+ printf(" base: 0x%08x%08x, limit: 0x%08x%08x\n",
+ regs[o2i(PPB_PREFMEM_BASE_UPPER_REG)], base,
+ regs[o2i(PPB_PREFMEM_LIMIT_UPPER_REG)], limit);
+ } else {
+ base = (base << 16) | 0x00000;
+ limit = (limit << 16) | 0xfffff;
+ printf(" base: 0x%08x, limit: 0x%08x\n", base, limit);
+ }
+ }
+
+ if (regs[o2i(PPB_MAPREG_ROM)] != 0)
+ printf(" Expansion ROM Base Address: 0x%08x\n",
+ regs[o2i(PPB_MAPREG_ROM)]);
+ break;
+
+ default:
+ break;
+ }
+}
+
diff --git a/cfe/cfe/pci/pciconf.c b/cfe/cfe/pci/pciconf.c
new file mode 100644
index 0000000..9f23f7c
--- /dev/null
+++ b/cfe/cfe/pci/pciconf.c
@@ -0,0 +1,1296 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * PCI Configuration File: pciconf.c
+ *
+ *********************************************************************
+ *
+ * Copyright 2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Based in part on the algor p5064 version of pciconf.c:
+ * generic PCI bus configuration
+ * Copyright (c) 1999 Algorithmics Ltd
+ * which in turn appears to be based on PMON code.
+ */
+
+#include "cfe_pci.h"
+#include "cfe_timer.h"
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+#include "lib_malloc.h"
+
+#include "pcivar.h"
+#include "pcireg.h"
+#include "pcidevs.h"
+#include "ldtreg.h"
+
+#ifndef MIN
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
+
+#ifndef MAX
+#define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
+
+#define PRINTF printf
+#define VPRINTF vprintf
+
+extern void cfe_ledstr(const char *);
+#define SBD_DISPLAY(msg) cfe_ledstr(msg)
+
+int _pciverbose;
+
+/* pci_devinfo uses sprintf(), and we don't necessarily want to drag
+ in all those tables for a minimal build, so set this function
+ pointer if it is required. */
+void (*_pci_devinfo_func) (pcireg_t, pcireg_t, int, char *);
+
+int _pci_nbus; /* start off with one bus */
+const int _pci_maxbus; /* maximum number of busses */
+int _pci_enumerated = 0;
+
+/* The "devices" here are actually PCI "functions" */
+#ifndef PCIMAX_DEV
+#define PCIMAX_DEV 16 /* arbitrary */
+#endif
+#ifndef PCIMAX_MEMWIN
+#define PCIMAX_MEMWIN 3 /* arbitrary per device */
+#endif
+#ifndef PCIMAX_IOWIN
+#define PCIMAX_IOWIN 1 /* arbitrary per device */
+#endif
+
+struct pcidev {
+ struct pci_attach_args *pa;
+ int bus;
+ unsigned char min_gnt;
+ unsigned char max_lat;
+ short nmemwin;
+ short niowin;
+};
+
+struct pciwin {
+ struct pcidev *dev;
+ int reg;
+ size_t size;
+ pcireg_t address;
+};
+
+struct pcirange {
+ pcireg_t base;
+ pcireg_t next;
+ pcireg_t limit;
+};
+
+static struct pci_attach_args *pciarg; /* the array of devices (external) */
+static struct pcidev *pcidev; /* parallel attr array (internal) */
+static int pcindev;
+static int pcimaxdev;
+
+static struct pciwin *pcimemwin; /* the array of memory windows */
+static int pcinmemwin;
+static int pcimaxmemwin;
+static struct pcirange pcimemaddr;
+
+static struct pciwin *pciiowin; /* the array of i/o windows */
+static int pciniowin;
+static int pcimaxiowin;
+static struct pcirange pciioaddr;
+
+
+/* The pass 1 SB-1250 LDT host bridge (LHB) does not implement the base
+ and limit registers for its secondary bus correctly. To compensate,
+ the following code includes hardware-dependent extensions to:
+ - pad the assignment of addresses on the "first" bus behind that
+ bridge (its secondary) so that the 32 bytes starting at the base
+ address are unused.
+ - pad the assignment of addresses on the "first" bus not behind that
+ bridge (the successor to its subordinate bus) so that the 32 bytes
+ starting at the limit address + 1 are unused.
+ - derive values assigned to the mem and io limit registers from
+ the last allocated address + 1, not from the last allocated
+ address as specified for conforming PCI bridges.
+ For pass 1 parts, the revision of the LHB is 1. This problem is fixed
+ and the workaround is unnecessary for revision numbers greater than 1.
+*/
+
+static int lhb_secondary_bus;
+static int lhb_subordinate_bus;
+
+
+static void
+print_bdf (int bus, int device, int function)
+{
+ PRINTF ("PCI");
+ if (bus >= 0)
+ PRINTF (" bus %d", bus);
+ if (device >= 0)
+ PRINTF (" slot %d", device);
+ if (function >= 0)
+ PRINTF ("/%d", function);
+ PRINTF (": ");
+}
+
+void
+pci_bdfprintf (int bus, int device, int function, const char *fmt, ...)
+{
+ va_list arg;
+
+ print_bdf (bus, device, function);
+#ifdef __VARARGS_H
+ va_start(arg);
+#else
+ va_start(arg, fmt);
+#endif
+ VPRINTF (fmt, arg);
+ va_end(arg);
+}
+
+void
+pci_tagprintf (pcitag_t tag, const char *fmt, ...)
+{
+ va_list arg;
+ int bus, device, function;
+
+ pci_break_tag (tag, &bus, &device, &function);
+ print_bdf (bus, device, function);
+
+#ifdef __VARARGS_H
+ va_start(arg);
+#else
+ va_start(arg, fmt);
+#endif
+ VPRINTF (fmt, arg);
+ va_end(arg);
+}
+
+
+/* Initialize the pci-pci bridges and bus hierarchy. */
+
+/* let rec */
+static void pci_businit (int bus, pci_flags_t flags);
+
+static void
+pci_businit_dev_func (pcitag_t tag, pci_flags_t flags)
+{
+ pcireg_t id, class, bhlc;
+
+ class = pci_conf_read(tag, PCI_CLASS_REG);
+ id = pci_conf_read(tag, PCI_ID_REG);
+ bhlc = pci_conf_read(tag, PCI_BHLC_REG);
+
+ pcindev++;
+
+ if (PCI_CLASS(class) == PCI_CLASS_BRIDGE && PCI_HDRTYPE_TYPE(bhlc) == 1) {
+ enum {NONE, PCI, LDT} sec_type;
+ int offset;
+ int bus, device, function;
+ int bus2;
+ struct pci_bus *psec;
+ pcireg_t data;
+
+ sec_type = NONE;
+ offset = 0;
+ switch (PCI_SUBCLASS(class)) {
+ case PCI_SUBCLASS_BRIDGE_PCI:
+ /* See if there is an LDT capability for the secondary. */
+ offset = pci_find_ldt_cap(tag, LDT_SECONDARY);
+ sec_type = offset == 0 ? PCI : LDT;
+ break;
+ case PCI_SUBCLASS_BRIDGE_HOST:
+ case PCI_SUBCLASS_BRIDGE_MISC:
+ /* A Type 1 host bridge (e.g., SB-1250 LDT) or an
+ X-to-LDT bridge with unassigned subclass (LDT?).
+ Probe iff the secondary is LDT (best policy?) */
+ offset = pci_find_ldt_cap(tag, LDT_SECONDARY);
+ if (offset != 0) sec_type = LDT;
+ break;
+ }
+
+ if (sec_type == NONE || _pci_nbus == _pci_maxbus)
+ return;
+
+ pci_break_tag(tag, &bus, &device, &function);
+
+ if (sec_type == LDT && offset != 0) {
+ pcireg_t cr = pci_conf_read(tag, offset+LDT_COMMAND_CAP_OFF);
+ if ((cr & LDT_COMMAND_DOUBLE_ENDED) != 0)
+ return;
+ }
+
+ bus2 = _pci_nbus;
+ psec = &_pci_bus[_pci_nbus];
+ _pci_nbus++;
+
+ psec->tag = tag;
+ psec->primary = bus;
+
+ /*
+ * set primary to bus
+ * set secondary to _pci_nbus
+ * set subordinate to max possible bus number
+ */
+ data = (PCI_BUSMAX << 16) | (bus2 << 8) | bus;
+ pci_conf_write(tag, PPB_BUSINFO_REG, data);
+
+ /*
+ * set base interrupt mapping.
+ */
+ if (bus == 0) {
+ /* We assume board-specific wiring for bus 0 devices. */
+ psec->inta_shift = pci_int_shift_0(tag);
+ } else {
+ /* We assume expansion boards wired per PCI Bridge spec */
+ psec->inta_shift = (_pci_bus[bus].inta_shift + device) % 4;
+ }
+
+ /* if the new bus is LDT, do the fabric initialization */
+ if (sec_type == LDT)
+ _pci_bus[bus2].no_probe = ldt_chain_init(tag, bus2, flags);
+ else
+ _pci_bus[bus2].no_probe = 0;
+
+#ifdef _CSWARM_
+ /* We must avoid attempting to scan the secondary bus of the
+ diagnostic sturgeon on a cswarm (MasterAbortMode == 0
+ appears not to suppress propagation of aborts). We know
+ its secondary bus number will be 2 on cswarm. */
+ if (bus2 == 2)
+ _pci_bus[bus2].no_probe = 1;
+#endif
+
+ /* Scan the new bus for PCI-PCI bridges and initialize. To
+ avoid a chip erratum, we must skip this for double-hosted
+ chains with no secondary devices. The no_probe attribute
+ is a workaround (see ldt_chain_init above). */
+ if (_pci_bus[bus2].no_probe) {
+ _pci_bus[bus2].min_io_addr = 0xffffffff;
+ _pci_bus[bus2].max_io_addr = 0;
+ _pci_bus[bus2].min_mem_addr = 0xffffffff;
+ _pci_bus[bus2].max_mem_addr = 0;
+ } else
+ pci_businit(bus2, flags);
+
+ /* reset subordinate bus number */
+ data = (data & 0xff00ffff) | ((_pci_nbus - 1) << 16);
+ pci_conf_write(tag, PPB_BUSINFO_REG, data);
+
+ /* SB-1250 pass 1 work-around: remember the buses behind the
+ LDT host bridge. This is not the far end of a
+ double-hosted chain. */
+ if (PCI_VENDOR(id) == PCI_VENDOR_SIBYTE &&
+ PCI_PRODUCT(id) == PCI_PRODUCT_SIBYTE_SB1250_LDT &&
+ PCI_REVISION(class) == 1) {
+ lhb_secondary_bus = bus2;
+ lhb_subordinate_bus = _pci_nbus - 1;
+ }
+ }
+}
+
+static void
+pci_businit_dev (int bus, int device, pci_flags_t flags)
+{
+ pcitag_t tag;
+ pcireg_t bhlc;
+ int function, maxfunc;
+
+ tag = pci_make_tag(bus, device, 0);
+ if (!pci_canscan (tag))
+ return;
+
+ if (!pci_probe_tag(tag))
+ return;
+
+ bhlc = pci_conf_read(tag, PCI_BHLC_REG);
+ maxfunc = PCI_HDRTYPE_MULTIFN(bhlc) ? PCI_FUNCMAX : 0;
+
+ for (function = 0; function <= maxfunc; function++) {
+ tag = pci_make_tag(bus, device, function);
+ if (pci_probe_tag(tag))
+ pci_businit_dev_func(tag, flags);
+ }
+}
+
+
+static void
+pci_businit (int bus, pci_flags_t flags)
+{
+ struct pci_bus *ppri;
+ int device;
+
+ ppri = &_pci_bus[bus];
+ ppri->min_io_addr = 0xffffffff;
+ ppri->max_io_addr = 0;
+ ppri->min_mem_addr = 0xffffffff;
+ ppri->max_mem_addr = 0;
+
+ /* Pass 1 errata: we must number the buses in ascending order to
+ avoid problems with the LDT host bridge capturing all
+ configuration cycles. */
+
+ for (device = 0; device <= PCI_DEVMAX; device++)
+ pci_businit_dev (bus, device, flags);
+}
+
+
+/* Scan each PCI device on the system and record its configuration
+ requirements. */
+
+static void
+pci_query_dev_func (pcitag_t tag)
+{
+ pcireg_t id, class;
+ pcireg_t old, mask;
+ pcireg_t stat;
+ pcireg_t bparam;
+ pcireg_t icr;
+ pcireg_t bhlc;
+ pcireg_t t; /* used for pushing writes to cfg registers */
+ unsigned int x;
+ int reg, mapreg_end, mapreg_rom;
+ struct pci_bus *pb;
+ struct pci_attach_args *pa;
+ struct pcidev *pd;
+ struct pciwin *pm, *pi;
+ int bus, device, function, incr;
+ uint16_t cmd;
+ uint8_t pin, pci_int;
+
+ class = pci_conf_read(tag, PCI_CLASS_REG);
+ id = pci_conf_read(tag, PCI_ID_REG);
+ pci_break_tag(tag, &bus, &device, &function);
+
+ if (_pciverbose && _pci_devinfo_func) {
+ char devinfo[256];
+ (*_pci_devinfo_func)(id, class, 1, devinfo);
+ pci_tagprintf(tag, "%s\n", devinfo);
+ }
+
+ if (pcindev >= pcimaxdev) {
+ panic ("pci: unexpected device number\n");
+ return;
+ }
+
+ pa = &pciarg[pcindev];
+ pa->pa_tag = tag;
+ pa->pa_id = id;
+ pa->pa_class = class;
+
+ pd = &pcidev[pcindev++];
+ pd->pa = pa;
+ pd->bus = bus;
+ pd->nmemwin = 0;
+ pd->niowin = 0;
+
+ pb = &_pci_bus[bus];
+ pb->ndev++;
+
+ stat = pci_conf_read(tag, PCI_COMMAND_STATUS_REG);
+
+ /* do all devices support fast back-to-back */
+ if ((stat & PCI_STATUS_BACKTOBACK_SUPPORT) == 0)
+ pb->fast_b2b = 0; /* no, sorry */
+
+ /* do all devices run at 66 MHz */
+ if ((stat & PCI_STATUS_66MHZ_SUPPORT) == 0)
+ pb->freq66 = 0; /* no, sorry */
+
+ /* find slowest devsel */
+ x = PCI_STATUS_DEVSEL(stat);
+ if (x > pb->devsel)
+ pb->devsel = x;
+
+ bparam = pci_conf_read(tag, PCI_BPARAM_INTERRUPT_REG);
+
+ pd->min_gnt = PCI_BPARAM_GRANT (bparam);
+ pd->max_lat = PCI_BPARAM_LATENCY (bparam);
+
+ if (pd->min_gnt != 0 || pd->max_lat != 0) {
+ /* find largest minimum grant time of all devices */
+ if (pd->min_gnt != 0 && pd->min_gnt > pb->min_gnt)
+ pb->min_gnt = pd->min_gnt;
+
+ /* find smallest maximum latency time of all devices */
+ if (pd->max_lat != 0 && pd->max_lat < pb->max_lat)
+ pb->max_lat = pd->max_lat;
+
+ if (pd->max_lat != 0)
+ /* subtract our minimum on-bus time per sec from bus bandwidth */
+ pb->bandwidth -= pd->min_gnt * 4000000 /
+ (pd->min_gnt + pd->max_lat);
+ }
+
+ /* Hook any special setup code and test for skipping resource
+ allocation, e.g., for our own host bridges. */
+ if (pci_device_preset(tag) != 0)
+ return;
+
+ /* Does the function need an interrupt mapping? */
+ icr = pci_conf_read(tag, PCI_BPARAM_INTERRUPT_REG);
+ pin = PCI_INTERRUPT_PIN(icr);
+ icr &=~ (PCI_INTERRUPT_LINE_MASK << PCI_INTERRUPT_LINE_SHIFT);
+ if (pin == PCI_INTERRUPT_PIN_NONE)
+ pci_int = 0;
+ else if (bus == 0)
+ pci_int = pci_int_map_0(tag);
+ else
+ pci_int = (pb->inta_shift + device + (pin - 1)) % 4 + 1;
+ icr |= pci_int_line(pci_int) << PCI_INTERRUPT_LINE_SHIFT;
+ pci_conf_write(tag, PCI_BPARAM_INTERRUPT_REG, icr);
+
+ /* Find and size the BARs */
+ bhlc = pci_conf_read(tag, PCI_BHLC_REG);
+ switch (PCI_HDRTYPE_TYPE(bhlc)) {
+ case 0: /* Type 0 */
+ mapreg_end = PCI_MAPREG_END;
+ mapreg_rom = PCI_MAPREG_ROM;
+ break;
+ case 1: /* Type 1 (bridge) */
+ mapreg_end = PCI_MAPREG_PPB_END;
+ mapreg_rom = PCI_MAPREG_PPB_ROM;
+ break;
+ case 2: /* Type 2 (cardbus) */
+ mapreg_end = PCI_MAPREG_PCB_END;
+ mapreg_rom = PCI_MAPREG_NONE;
+ break;
+ default: /* unknown */
+ mapreg_end = PCI_MAPREG_START; /* assume none */
+ mapreg_rom = PCI_MAPREG_NONE;
+ break;
+ }
+
+ cmd = pci_conf_read(tag, PCI_COMMAND_STATUS_REG);
+ cmd &= (PCI_COMMAND_MASK << PCI_COMMAND_SHIFT); /* don't clear status */
+ pci_conf_write(tag, PCI_COMMAND_STATUS_REG,
+ cmd & ~(PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE));
+ t = pci_conf_read(tag, PCI_COMMAND_STATUS_REG); /* push the write */
+
+ for (reg = PCI_MAPREG_START; reg < mapreg_end; reg += incr) {
+ old = pci_conf_read(tag, reg);
+ pci_conf_write(tag, reg, 0xffffffff);
+ mask = pci_conf_read(tag, reg);
+ pci_conf_write(tag, reg, old);
+
+ /* Assume 4 byte reg, unless we find out otherwise below. */
+ incr = 4;
+
+ /* 0 if not implemented, all-1s if (for some reason) 2nd half
+ of 64-bit BAR or if device broken and reg not implemented
+ (should return 0). */
+ if (mask == 0 || mask == 0xffffffff)
+ continue;
+
+ if (_pciverbose >= 3)
+ pci_tagprintf (tag, "reg 0x%x = 0x%x\n", reg, mask);
+
+ if (PCI_MAPREG_TYPE(mask) == PCI_MAPREG_TYPE_IO) {
+
+ mask |= 0xffff0000; /* must be ones */
+
+ if (pciniowin >= pcimaxiowin) {
+ PRINTF ("pci: too many i/o windows\n");
+ continue;
+ }
+ pi = &pciiowin[pciniowin++];
+
+ pi->dev = pd;
+ pi->reg = reg;
+ pi->size = -(PCI_MAPREG_IO_ADDR(mask));
+ pd->niowin++;
+ } else {
+ switch (PCI_MAPREG_MEM_TYPE(mask)) {
+ case PCI_MAPREG_MEM_TYPE_32BIT:
+ case PCI_MAPREG_MEM_TYPE_32BIT_1M:
+ break;
+ case PCI_MAPREG_MEM_TYPE_64BIT:
+ incr = 8;
+ {
+ pcireg_t oldhi, maskhi;
+
+ if (reg + 4 >= PCI_MAPREG_END) {
+ pci_tagprintf (tag,
+ "misplaced 64-bit region ignored\n");
+ continue;
+ }
+
+ oldhi = pci_conf_read(tag, reg + 4);
+ pci_conf_write(tag, reg + 4, 0xffffffff);
+ maskhi = pci_conf_read(tag, reg + 4);
+ pci_conf_write(tag, reg + 4, oldhi);
+
+ if (maskhi != 0xffffffff) {
+ pci_tagprintf (tag,
+ "true 64-bit region (%08x) ignored\n",
+ maskhi);
+ continue;
+ }
+ }
+ break;
+ default:
+ pci_tagprintf (tag, "reserved mapping type 0x%x\n",
+ PCI_MAPREG_MEM_TYPE(mask));
+ continue;
+ }
+
+ if (!PCI_MAPREG_MEM_PREFETCHABLE(mask))
+ _pci_bus[bus].prefetch = 0;
+
+ if (pcinmemwin >= pcimaxmemwin) {
+ PRINTF ("pci: too many memory windows\n");
+ continue;
+ }
+ pm = &pcimemwin[pcinmemwin++];
+
+ pm->dev = pd;
+ pm->reg = reg;
+ pm->size = -(PCI_MAPREG_MEM_ADDR(mask));
+ pd->nmemwin++;
+ }
+ }
+
+ /* Finally check for Expansion ROM */
+ if (mapreg_rom != PCI_MAPREG_NONE) {
+ reg = mapreg_rom;
+ old = pci_conf_read(tag, reg);
+ pci_conf_write(tag, reg, 0xfffffffe);
+ mask = pci_conf_read(tag, reg);
+ pci_conf_write(tag, reg, old);
+
+ /* 0 if not implemented, 0xfffffffe or 0xffffffff if device
+ broken and/or register not implemented. */
+ if (mask != 0 && mask != 0xfffffffe && mask != 0xffffffff) {
+ if (_pciverbose >= 3)
+ pci_tagprintf (tag, "reg 0x%x = 0x%x\n", reg, mask);
+
+ if (pcinmemwin >= pcimaxmemwin) {
+ PRINTF ("pci: too many memory windows\n");
+ goto done;
+ }
+
+ pm = &pcimemwin[pcinmemwin++];
+ pm->dev = pd;
+ pm->reg = reg;
+ pm->size = -(PCI_MAPREG_ROM_ADDR(mask));
+ pd->nmemwin++;
+ }
+ }
+
+done:
+ cmd |= PCI_COMMAND_INVALIDATE_ENABLE; /* any reason not to? */
+ pci_conf_write(tag, PCI_COMMAND_STATUS_REG, cmd);
+}
+
+static void
+pci_query_dev (int bus, int device)
+{
+ pcitag_t tag;
+ pcireg_t bhlc;
+ int probed, function, maxfunc;
+
+ tag = pci_make_tag(bus, device, 0);
+ if (!pci_canscan (tag))
+ return;
+
+ if (_pciverbose >= 2)
+ pci_bdfprintf (bus, device, -1, "probe...");
+
+ probed = pci_probe_tag(tag);
+
+ if (_pciverbose >= 2)
+ PRINTF ("completed\n");
+
+ if (!probed)
+ return;
+
+ bhlc = pci_conf_read(tag, PCI_BHLC_REG);
+ maxfunc = PCI_HDRTYPE_MULTIFN(bhlc) ? PCI_FUNCMAX : 0;
+
+ for (function = 0; function <= maxfunc; function++) {
+ tag = pci_make_tag(bus, device, function);
+ if (pci_probe_tag(tag))
+ pci_query_dev_func(tag);
+ }
+
+ if (_pciverbose >= 2)
+ pci_bdfprintf (bus, device, -1, "done\n");
+}
+
+
+static void
+pci_query (int bus)
+{
+ int device;
+ struct pci_bus *pb = &_pci_bus[bus];
+ pcireg_t sec_status;
+ unsigned int def_ltim, max_ltim;
+
+ if (bus != 0) {
+ sec_status = pci_conf_read(pb->tag, PPB_IO_STATUS_REG);
+ pb->fast_b2b = (sec_status & PCI_STATUS_BACKTOBACK_SUPPORT) ? 1 : 0;
+ pb->freq66 = (sec_status & PCI_STATUS_66MHZ_SUPPORT) ? 1 : 0;
+ }
+
+ if (pb->no_probe)
+ pb->ndev = 0;
+ else {
+ for (device = 0; device <= PCI_DEVMAX; device++)
+ pci_query_dev (bus, device);
+ }
+
+ if (pb->ndev != 0) {
+ /* convert largest minimum grant time to cycle count */
+ max_ltim = pb->min_gnt * (pb->freq66 ? 66 : 33) / 4;
+
+ /* now see how much bandwidth is left to distribute */
+ if (pb->bandwidth <= 0) {
+ pci_bdfprintf (bus, -1, -1, "warning: total bandwidth exceeded\n");
+ def_ltim = 1;
+ } else {
+ /* calculate a fair share for each device */
+ def_ltim = pb->bandwidth / pb->ndev;
+ if (def_ltim > pb->max_lat)
+ /* that would exceed critical time for some device */
+ def_ltim = pb->max_lat;
+ /* convert to cycle count */
+ def_ltim = def_ltim * (pb->freq66 ? 66 : 33) / 4;
+ }
+ /* most devices don't implement bottom three bits, so round up */
+ def_ltim = (def_ltim + 7) & ~7;
+ max_ltim = (max_ltim + 7) & ~7;
+
+ pb->def_ltim = MIN (def_ltim, 255);
+ pb->max_ltim = MIN (MAX (max_ltim, def_ltim), 255);
+ }
+}
+
+
+static int
+wincompare (const void *a, const void *b)
+{
+ const struct pciwin *wa = a, *wb = b;
+ if (wa->dev->bus != wb->dev->bus)
+ /* sort into ascending order of bus number */
+ return (int)(wa->dev->bus - wb->dev->bus);
+ else
+ /* sort into descending order of size */
+ return (int)(wb->size - wa->size);
+}
+
+
+static pcireg_t
+pci_allocate_io(pcitag_t tag, size_t size)
+{
+ pcireg_t address;
+
+ /* allocate upwards after rounding to size boundary */
+ address = (pciioaddr.next + (size - 1)) & ~(size - 1);
+ if (address < pciioaddr.next || address + size > pciioaddr.limit)
+ return -1;
+ pciioaddr.next = address + size;
+ return address;
+}
+
+static pcireg_t
+pci_align_io_addr(pcireg_t addr)
+{
+ /* align to appropriate bridge boundaries (4K for Rev 1.1 Bridge Arch).
+ Over/underflow will show up in subsequent allocations. */
+ return (addr + ((1 << 12)-1)) & ~((1 << 12)-1);
+}
+
+static void
+pci_assign_iowins(int bus, struct pciwin *pi_first, struct pciwin *pi_limit)
+{
+ struct pciwin *pi;
+ struct pci_bus *pb = &_pci_bus[bus];
+ pcireg_t t; /* for pushing writes */
+
+ pciioaddr.next = pci_align_io_addr(pciioaddr.next);
+
+ /* Pass 1 errata work around. Avoid assigning any real devices
+ at the base address of the LDT host bridge. */
+ if (bus == lhb_secondary_bus) {
+ pb->min_io_addr = pciioaddr.next;
+ pciioaddr.next += (1 << 12);
+ pb->max_io_addr = pciioaddr.next - 1;
+ }
+
+ for (pi = pi_first; pi < pi_limit; pi++) {
+ struct pcidev *pd = pi->dev;
+ pcitag_t tag = pd->pa->pa_tag;
+ pcireg_t base;
+
+ if (pd->niowin < 0)
+ continue;
+ pi->address = pci_allocate_io (tag, pi->size);
+ if (pi->address == -1) {
+ pci_tagprintf (tag,
+ "not enough PCI i/o space (%ld requested)\n",
+ (long)pi->size);
+ pd->nmemwin = pd->niowin = -1;
+ continue;
+ }
+
+ if (pi->address < pb->min_io_addr)
+ pb->min_io_addr = pi->address;
+ if (pi->address + pi->size - 1 > pb->max_io_addr)
+ pb->max_io_addr = pi->address + pi->size - 1;
+
+ if (_pciverbose >= 2)
+ pci_tagprintf (tag,
+ "I/O BAR at 0x%x gets %ld bytes @ 0x%x\n",
+ pi->reg, (long)pi->size, pi->address);
+ base = pci_conf_read(tag, pi->reg);
+ base = (base & ~PCI_MAPREG_IO_ADDR_MASK) | pi->address;
+ pci_conf_write(tag, pi->reg, base);
+ t = pci_conf_read(tag, pi->reg);
+ }
+
+ if (pb->min_io_addr < pb->max_io_addr) {
+ /* if any io on bus, expand to valid bridge limit */
+ pb->max_io_addr |= ((1 << 12)-1);
+ pciioaddr.next = pb->max_io_addr + 1;
+ }
+
+ /* More Pass 1 errata work around. Make sure the 32 bytes beyond
+ the LDT window are not allocated by reserving an entire quantum
+ of io space. */
+ if (bus == lhb_subordinate_bus) {
+ pciioaddr.next = pci_align_io_addr(pciioaddr.next) + (1 << 12);
+ }
+}
+
+static void
+pci_setup_iowins (void)
+{
+ struct pciwin *pi, *pi_first, *pi_limit;
+ int bus;
+
+ qsort(pciiowin, pciniowin, sizeof(struct pciwin), wincompare);
+ pi_first = pciiowin;
+ pi_limit = &pciiowin[pciniowin];
+
+ for (bus = 0; bus < _pci_nbus; bus++) {
+ pi = pi_first;
+ while (pi != pi_limit && pi->dev->bus == bus)
+ pi++;
+ pci_assign_iowins(bus, pi_first, pi);
+ pi_first = pi;
+ }
+}
+
+
+static pcireg_t
+pci_allocate_mem(pcitag_t tag, size_t size)
+{
+ pcireg_t address;
+
+ /* allocate upwards after rounding to size boundary */
+ address = (pcimemaddr.next + (size - 1)) & ~(size - 1);
+ if (address < pcimemaddr.next || address + size > pcimemaddr.limit)
+ return -1;
+ pcimemaddr.next = address + size;
+ return address;
+}
+
+static pcireg_t
+pci_align_mem_addr(pcireg_t addr)
+{
+ /* align to appropriate bridge boundaries (1M for Rev 1.1 Bridge Arch).
+ Over/underflow will show up in subsequent allocations. */
+ return (addr + ((1 << 20)-1)) & ~((1 << 20)-1);
+}
+
+static void
+pci_assign_memwins(int bus, struct pciwin *pm_first, struct pciwin *pm_limit)
+{
+ struct pciwin *pm;
+ struct pci_bus *pb = &_pci_bus[bus];
+ pcireg_t t; /* for pushing writes */
+
+ pcimemaddr.next = pci_align_mem_addr(pcimemaddr.next);
+
+ /* Pass 1 errata work around. Avoid assigning any real devices
+ at the base address of the LDT host bridge. */
+ if (bus == lhb_secondary_bus) {
+ pb->min_mem_addr = pcimemaddr.next;
+ pcimemaddr.next += (1 << 20);
+ pb->max_mem_addr = pcimemaddr.next - 1;
+ }
+
+ for (pm = pm_first; pm < pm_limit; ++pm) {
+ struct pcidev *pd = pm->dev;
+ pcitag_t tag = pd->pa->pa_tag;
+
+ if (pd->nmemwin < 0)
+ continue;
+ pm->address = pci_allocate_mem (tag, pm->size);
+ if (pm->address == -1) {
+ pci_tagprintf (tag,
+ "not enough PCI mem space (%ld requested)\n",
+ (long)pm->size);
+ pd->nmemwin = pd->niowin = -1;
+ continue;
+ }
+ if (_pciverbose >= 2)
+ pci_tagprintf (tag,
+ "%s BAR at 0x%x gets %ld bytes @ 0x%x\n",
+ pm->reg != PCI_MAPREG_ROM ? "MEM" : "ROM",
+ pm->reg, (long)pm->size, pm->address);
+
+ if (pm->address < pb->min_mem_addr)
+ pb->min_mem_addr = pm->address;
+ if (pm->address + pm->size - 1 > pb->max_mem_addr)
+ pb->max_mem_addr = pm->address + pm->size - 1;
+
+ if (pm->reg != PCI_MAPREG_ROM) {
+ /* normal memory - expansion rom done below */
+ pcireg_t base = pci_conf_read(tag, pm->reg);
+ base = pm->address | (base & ~PCI_MAPREG_MEM_ADDR_MASK);
+ pci_conf_write(tag, pm->reg, base);
+ t = pci_conf_read(tag, pm->reg);
+ if (PCI_MAPREG_MEM_TYPE(t) == PCI_MAPREG_MEM_TYPE_64BIT) {
+ pci_conf_write(tag, pm->reg + 4, 0);
+ t = pci_conf_read(tag, pm->reg + 4);
+ }
+ }
+ }
+
+ /* align final bus window */
+ if (pb->min_mem_addr < pb->max_mem_addr) {
+ pb->max_mem_addr |= ((1 << 20) - 1);
+ pcimemaddr.next = pb->max_mem_addr + 1;
+ }
+
+ /* More pass 1 errata work around. Make sure the next 32 bytes
+ beyond the LDT window are not used by reserving an entire
+ quantum of PCI memory space. */
+ if (bus == lhb_subordinate_bus) {
+ pcimemaddr.next = pci_align_mem_addr(pcimemaddr.next) + (1 << 20);
+ }
+}
+
+static void
+pci_setup_memwins (void)
+{
+ struct pciwin *pm, *pm_first, *pm_limit;
+ int bus;
+
+ qsort(pcimemwin, pcinmemwin, sizeof(struct pciwin), wincompare);
+ pm_first = pcimemwin;
+ pm_limit = &pcimemwin[pcinmemwin];
+
+ for (bus = 0; bus < _pci_nbus; bus++) {
+ pm = pm_first;
+ while (pm != pm_limit && pm->dev->bus == bus)
+ pm++;
+ pci_assign_memwins(bus, pm_first, pm);
+ pm_first = pm;
+ }
+
+ /* Program expansion rom address base after normal memory base,
+ to keep DEC ethernet chip happy */
+ for (pm = pcimemwin; pm < pm_limit; pm++) {
+ if (pm->reg == PCI_MAPREG_ROM && pm->address != -1) {
+ struct pcidev *pd = pm->dev; /* expansion rom */
+ pcitag_t tag = pd->pa->pa_tag;
+ pcireg_t base;
+ pcireg_t t; /* for pushing writes */
+
+ /* Do not enable ROM at this time -- PCI spec 2.2 s6.2.5.2 last
+ paragraph, says that if the expansion ROM is enabled, accesses
+ to other registers via the BARs may not be done by portable
+ software!!! */
+ base = pci_conf_read(tag, pm->reg);
+ base = pm->address | (base & ~PCI_MAPREG_ROM_ADDR_MASK);
+ base &= ~PCI_MAPREG_ROM_ENABLE;
+ pci_conf_write(tag, pm->reg, base);
+ t = pci_conf_read(tag, pm->reg);
+ }
+ }
+}
+
+
+static void
+pci_setup_ppb(pci_flags_t flags)
+{
+ int i;
+
+ for (i = _pci_nbus - 1; i > 0; i--) {
+ struct pci_bus *psec = &_pci_bus[i];
+ struct pci_bus *ppri = &_pci_bus[psec->primary];
+ if (ppri->min_io_addr > psec->min_io_addr)
+ ppri->min_io_addr = psec->min_io_addr;
+ if (ppri->max_io_addr < psec->max_io_addr)
+ ppri->max_io_addr = psec->max_io_addr;
+ if (ppri->min_mem_addr > psec->min_mem_addr)
+ ppri->min_mem_addr = psec->min_mem_addr;
+ if (ppri->max_mem_addr < psec->max_mem_addr)
+ ppri->max_mem_addr = psec->max_mem_addr;
+ }
+
+ if (_pciverbose >= 2) {
+ struct pci_bus *pb = &_pci_bus[0];
+ if (pb->min_io_addr < pb->max_io_addr)
+ pci_bdfprintf (0, -1, -1, "io 0x%08x-0x%08x\n",
+ pb->min_io_addr, pb->max_io_addr);
+ if (pb->min_mem_addr < pb->max_mem_addr)
+ pci_bdfprintf (0, -1, -1, "mem 0x%08x-0x%08x\n",
+ pb->min_mem_addr, pb->max_mem_addr);
+ }
+
+ for (i = 1; i < _pci_nbus; i++) {
+ struct pci_bus *pb = &_pci_bus[i];
+ pcireg_t cmd;
+ pcireg_t iodata, memdata;
+ pcireg_t brctl;
+ pcireg_t t; /* for pushing writes */
+
+ cmd = pci_conf_read(pb->tag, PCI_COMMAND_STATUS_REG);
+ if (_pciverbose >= 2)
+ pci_bdfprintf (i, -1, -1, "subordinate to bus %d\n", pb->primary);
+
+ cmd |= PCI_COMMAND_MASTER_ENABLE;
+ if (pb->min_io_addr < pb->max_io_addr) {
+ uint32_t io_limit;
+
+ /* Pass 1 work-round: limits are next free, not last used. */
+ io_limit = pb->max_io_addr;
+ if (i == lhb_secondary_bus)
+ io_limit++;
+
+ cmd |= PCI_COMMAND_IO_ENABLE;
+ if (_pciverbose >= 2)
+ pci_bdfprintf (i, -1, -1, "io 0x%08x-0x%08x\n",
+ pb->min_io_addr, io_limit);
+ iodata = pci_conf_read(pb->tag, PPB_IO_STATUS_REG);
+ if ((iodata & PPB_IO_ADDR_CAP_MASK) == PPB_IO_ADDR_CAP_32) {
+ pcireg_t upperdata;
+
+ upperdata = ((pb->min_io_addr) >> 16) & PPB_IO_UPPER_BASE_MASK;
+ upperdata |= (io_limit & PPB_IO_UPPER_LIMIT_MASK);
+ pci_conf_write(pb->tag, PPB_IO_UPPER_REG, upperdata);
+ }
+ iodata = (iodata & ~PPB_IO_BASE_MASK)
+ | ((pb->min_io_addr >> 8) & 0xf0);
+ iodata = (iodata & ~PPB_IO_LIMIT_MASK)
+ | ((io_limit & PPB_IO_LIMIT_MASK) & 0xf000);
+ } else {
+ /* Force an empty window */
+ iodata = pci_conf_read(pb->tag, PPB_IO_STATUS_REG);
+ iodata &=~ (PPB_IO_BASE_MASK | PPB_IO_LIMIT_MASK);
+ iodata |= (1 << 4) | (0 << (8+4));
+ }
+ pci_conf_write(pb->tag, PPB_IO_STATUS_REG, iodata);
+ /* Push the write (see SB-1250 Errata, Section 8.10) */
+ t = pci_conf_read(pb->tag, PPB_IO_STATUS_REG);
+
+ if (pb->min_mem_addr < pb->max_mem_addr) {
+ uint32_t mem_limit;
+
+ /* SB-1250 pass 1 workaround: limit is next free, not last used */
+ mem_limit = pb->max_mem_addr;
+ if (i == lhb_secondary_bus)
+ mem_limit++;
+
+ cmd |= PCI_COMMAND_MEM_ENABLE;
+ if (_pciverbose >= 2)
+ pci_bdfprintf (i, -1, -1, "mem 0x%08x-0x%08x\n",
+ pb->min_mem_addr, mem_limit);
+ memdata = pci_conf_read(pb->tag, PPB_MEM_REG);
+ memdata = (memdata & ~PPB_MEM_BASE_MASK)
+ | ((pb->min_mem_addr >> 16) & 0xfff0);
+ memdata = (memdata & ~PPB_MEM_LIMIT_MASK)
+ | ((mem_limit & PPB_MEM_LIMIT_MASK) & 0xfff00000);
+ } else {
+ /* Force an empty window */
+ memdata = pci_conf_read(pb->tag, PPB_MEM_REG);
+ memdata &=~ (PPB_MEM_BASE_MASK | PPB_MEM_LIMIT_MASK);
+ memdata |= (1 << 4) | (0 << (16+4));
+ }
+ pci_conf_write(pb->tag, PPB_MEM_REG, memdata);
+ /* Push the write (see SB-1250 Errata, Section 8.10) */
+ t = pci_conf_read(pb->tag, PPB_MEM_REG);
+
+ /* Force an empty prefetchable memory window */
+ memdata = pci_conf_read(pb->tag, PPB_PREFMEM_REG);
+ memdata &=~ (PPB_MEM_BASE_MASK | PPB_MEM_LIMIT_MASK);
+ memdata |= (1 << 4) | (0 << (16+4));
+ pci_conf_write(pb->tag, PPB_PREFMEM_REG, memdata);
+ /* Push the write (see SB-1250 Errata, Section 8.10) */
+ t = pci_conf_read(pb->tag, PPB_PREFMEM_REG);
+
+ /* Do any final bridge dependent initialization */
+ pci_bridge_setup(pb->tag, flags);
+
+ brctl = pci_conf_read(pb->tag, PPB_BRCTL_INTERRUPT_REG);
+#ifdef _SB1250_PASS2_
+ /* LDT MasterAborts _will_ cause bus errors in pass 2 when
+ enabled. Pending negotiations with clients, leave
+ MasterAbortMode off to disable their propagation. */
+#else
+ brctl |= (PPB_BRCTL_SERR_ENABLE | PPB_BRCTL_MASTER_ABORT_MODE);
+#endif
+ if (pb->fast_b2b)
+ brctl |= PPB_BRCTL_BACKTOBACK_ENABLE;
+ pci_conf_write(pb->tag, PPB_BRCTL_INTERRUPT_REG, brctl);
+ t = pci_conf_read(pb->tag, PPB_BRCTL_INTERRUPT_REG); /* push */
+
+ pci_conf_write(pb->tag, PCI_COMMAND_STATUS_REG, cmd);
+ }
+}
+
+
+int
+pci_cacheline_log2 (void)
+{
+ /* default to 8 words == 2^3 */
+ return 3;
+}
+
+
+int
+pci_maxburst_log2 (void)
+{
+ return 32; /* no limit */
+}
+
+static void
+pci_setup_devices (pci_flags_t flags)
+{
+ struct pcidev *pd;
+
+ /* Enable each PCI interface */
+ for (pd = pcidev; pd < &pcidev[pcindev]; pd++) {
+ struct pci_bus *pb = &_pci_bus[pd->bus];
+ pcitag_t tag = pd->pa->pa_tag;
+ pcireg_t cmd, misc;
+ unsigned int ltim;
+
+ /* Consider setting interrupt line here */
+
+ cmd = pci_conf_read(tag, PCI_COMMAND_STATUS_REG);
+ cmd |= PCI_COMMAND_MASTER_ENABLE
+ | PCI_COMMAND_SERR_ENABLE
+ | PCI_COMMAND_PARITY_ENABLE;
+ /* Always enable i/o & memory space, in case this card is
+ just snarfing space from the fixed ISA block and doesn't
+ declare separate PCI space. */
+ cmd |= PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE;
+ if (pb->fast_b2b)
+ cmd |= PCI_COMMAND_BACKTOBACK_ENABLE;
+
+ /* Write status too, to clear any pending error bits. */
+ pci_conf_write(tag, PCI_COMMAND_STATUS_REG, cmd);
+
+ ltim = pd->min_gnt * (pb->freq66 ? 66 : 33) / 4;
+ ltim = MIN (MAX (pb->def_ltim, ltim), pb->max_ltim);
+
+ misc = pci_conf_read (tag, PCI_BHLC_REG);
+ PCI_LATTIMER_SET (misc, ltim);
+ PCI_CACHELINE_SET (misc, 1 << pci_cacheline_log2());
+ pci_conf_write (tag, PCI_BHLC_REG, misc);
+
+ pci_device_setup (tag); /* hook for post setup */
+ }
+}
+
+
+void
+pci_configure (pci_flags_t flags)
+{
+ int bus;
+
+#if (PCI_DEBUG > 1)
+ _pciverbose = 3;
+#else
+ _pciverbose = (flags & PCI_FLG_VERBOSE);
+#endif
+ _pci_devinfo_func = (_pciverbose != 0) ? pci_devinfo : NULL;
+ pciarg = NULL;
+
+ /* SB-1250 pass 1 workaround: discover LHB buses during traversal. */
+ lhb_secondary_bus = lhb_subordinate_bus = -1;
+
+ /* initialise the host bridge(s) */
+ SBD_DISPLAY ("PCIH");
+ if (pci_hwinit(flags) < 0)
+ return;
+
+ /* initialise any PCI-PCI bridges, discover and number buses */
+ SBD_DISPLAY ("PCIB");
+ pcindev = 0;
+ pci_businit(0, flags);
+
+ /* scan configuration space of all devices to collect attributes */
+ SBD_DISPLAY ("PCIS");
+ pcimaxdev = pcindev;
+ pciarg = (struct pci_attach_args *) KMALLOC (pcimaxdev * sizeof(struct pci_attach_args), 0);
+ if (pciarg == NULL) {
+ PRINTF ("pci: no memory for device table\n");
+ pcimaxdev = 0;
+ } else {
+ pcidev = (struct pcidev *) KMALLOC (pcimaxdev * sizeof(struct pcidev), 0);
+ if (pcidev == NULL) {
+ KFREE (pciarg); pciarg = NULL;
+ PRINTF ("pci: no memory for device attribute table\n");
+ pcimaxdev = 0;
+ }
+ }
+ pcindev = 0;
+
+ pcimaxmemwin = PCIMAX_DEV * PCIMAX_MEMWIN;
+ pcimemwin = (struct pciwin *) KMALLOC (pcimaxmemwin * sizeof(struct pciwin), 0);
+ if (pcimemwin == NULL) {
+ PRINTF ("pci: no memory for window table\n");
+ pcimaxmemwin = 0;
+ }
+ pcimaxiowin = PCIMAX_DEV * PCIMAX_IOWIN;
+ pciiowin = (struct pciwin *) KMALLOC (pcimaxiowin * sizeof(struct pciwin), 0);
+ if (pciiowin == NULL) {
+ PRINTF ("pci: no memory for window table\n");
+ pcimaxiowin = 0;
+ }
+
+ pcinmemwin = pciniowin = 0;
+ for (bus = 0; bus < _pci_nbus; bus++) {
+ pci_query (bus);
+ }
+
+ if (pcindev != pcimaxdev) {
+ panic ("Inconsistent device count\n");
+ return;
+ }
+
+ /* alter PCI bridge parameters based on query data */
+ pci_hwreinit (flags);
+
+ /* setup the individual device windows */
+ pcimemaddr.base = minpcimemaddr;
+ pcimemaddr.limit = maxpcimemaddr;
+ pciioaddr.base = minpciioaddr;
+ pciioaddr.limit = maxpciioaddr;
+
+ pcimemaddr.next = pcimemaddr.base;
+ pciioaddr.next = pciioaddr.base;
+ pci_setup_iowins ();
+ pci_setup_memwins ();
+
+ /* set up and enable each device */
+ if (_pci_nbus > 1)
+ pci_setup_ppb (flags);
+ pci_setup_devices (flags);
+
+ KFREE (pciiowin); pciiowin = NULL;
+ KFREE (pcimemwin); pcimemwin = NULL;
+ KFREE (pcidev); pcidev = NULL;
+
+ _pci_enumerated = 1;
+}
+
+
+int
+pci_foreachdev(int (*fn)(pcitag_t tag))
+{
+ int i, rv;
+
+ for (i = 0, rv = 0; i < pcindev && rv == 0; i++)
+ rv = (*fn)(pciarg[i].pa_tag);
+
+ return rv;
+}
+
+
+static int
+dump_configuration(pcitag_t tag)
+{
+ pci_tagprintf(tag, "dump of ");
+ pci_conf_print(tag);
+ return 0;
+}
+
+void
+pci_show_configuration(void)
+{
+ pci_foreachdev(dump_configuration);
+}
+
+int
+pci_find_class(uint32_t class, int enumidx, pcitag_t *tag)
+{
+ int i;
+ struct pci_attach_args *thisdev;
+
+ thisdev = pciarg;
+ for (i = 0; i < pcindev && enumidx >= 0; i++) {
+ if (PCI_CLASS(thisdev->pa_class) == class) {
+ if (enumidx == 0) {
+ *tag = thisdev->pa_tag;
+ return 0;
+ } else {
+ enumidx--;
+ }
+ }
+ thisdev++;
+ }
+
+ return -1;
+}
+
+int
+pci_find_device(uint32_t vid, uint32_t did, int enumidx, pcitag_t *tag)
+{
+ int i;
+ struct pci_attach_args *thisdev;
+
+ thisdev = pciarg;
+ for (i = 0; i < pcindev && enumidx >= 0; i++) {
+ if ((PCI_VENDOR(thisdev->pa_id) == vid) &&
+ (PCI_PRODUCT(thisdev->pa_id) == did)) {
+ if (enumidx == 0) {
+ *tag = thisdev->pa_tag;
+ return 0;
+ } else {
+ enumidx--;
+ }
+ }
+ thisdev++;
+ }
+
+ return -1;
+}
diff --git a/cfe/cfe/pci/pcidevs b/cfe/cfe/pci/pcidevs
new file mode 100644
index 0000000..65b03ab
--- /dev/null
+++ b/cfe/cfe/pci/pcidevs
@@ -0,0 +1,1355 @@
+$pcidevs 2002/09/03 broadcom $
+
+/*
+ * Copyright (c) 1995, 1996 Christopher G. Demetriou
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Christopher G. Demetriou
+ * for the NetBSD Project.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * NOTE: a fairly complete list of PCI codes can be found at:
+ *
+ * http://members.hyperlink.net.au/~chart/pci.htm
+ *
+ * which replaces the database found at
+ *
+ * http://www.yourvote.com/pci/
+ *
+ * (but it doesn't always seem to match vendor documentation)
+ */
+
+/*
+ * List of known PCI vendors. This list has been trimmed to include
+ * only vendors with products appearing in the lists below.
+ */
+
+vendor COMPAQ 0x0e11 Compaq
+vendor SYMBIOS 0x1000 Symbios Logic
+vendor ATI 0x1002 ATI Technologies
+vendor ULSI 0x1003 ULSI Systems
+vendor VLSI 0x1004 VLSI Technology
+vendor AVANCE 0x1005 Avance Logic
+vendor NS 0x100b National Semiconductor
+vendor TSENG 0x100c Tseng Labs
+vendor WEITEK 0x100e Weitek
+vendor DEC 0x1011 Digital Equipment
+vendor CIRRUS 0x1013 Cirrus Logic
+vendor IBM 0x1014 IBM
+vendor WD 0x101c Western Digital
+vendor AMD 0x1022 Advanced Micro Devices
+vendor TRIDENT 0x1023 Trident Microsystems
+vendor ACER 0x1025 Acer
+vendor MATROX 0x102b Matrox
+vendor CHIPS 0x102c Chips and Technologies
+vendor TOSHIBA 0x102f Toshiba America
+vendor NEC 0x1033 NEC
+vendor FUTUREDOMAIN 0x1036 Future Domain
+vendor SIS 0x1039 Silicon Integrated System
+vendor HP 0x103c Hewlett-Packard
+vendor PCTECH 0x1042 PC Technology
+vendor DPT 0x1044 Distributed Processing Technology
+vendor OPTI 0x1045 Opti
+vendor ELSA 0x1048 Elsa
+vendor SGSTHOMSON 0x104a SGS Thomson Microelectric
+vendor BUSLOGIC 0x104b BusLogic
+vendor TI 0x104c Texas Instruments
+vendor SONY 0x104d Sony
+vendor OAKTECH 0x104e Oak Technology
+vendor WINBOND 0x1050 Winbond Electronics
+vendor MOT 0x1057 Motorola
+vendor PROMISE 0x105a Promise Technology
+vendor NUMBER9 0x105d Number 9 Computer Company
+vendor UMC 0x1060 United Microelectronics
+vendor ITT 0x1061 I. T. T.
+vendor MYLEX 0x1069 Mylex
+vendor APPLE 0x106b Apple Computer
+vendor YAMAHA 0x1073 Yamaha
+vendor NEXGEN 0x1074 NexGen Microsystems
+vendor QLOGIC 0x1077 Q Logic
+vendor LEADTEK 0x107d LeadTek Research
+vendor CONTAQ 0x1080 Contaq Microsystems
+vendor BIT3 0x108a Bit3 Computer Corp.
+vendor OLICOM 0x108d Olicom
+vendor SUN 0x108e Sun Microsystems
+vendor INTERGRAPH 0x1091 Intergraph
+vendor DIAMOND 0x1092 Diamond Computer Systems
+vendor CMDTECH 0x1095 CMD Technology
+vendor QUANTUMDESIGNS 0x1098 Quantum Designs
+vendor BROOKTREE 0x109e Brooktree
+vendor SGI 0x10a9 Silicon Graphics
+vendor ACC 0x10aa ACC Microelectronics
+vendor SYMPHONY 0x10ad Symphony Labs
+vendor PLX 0x10b5 PLX Technology
+vendor MADGE 0x10b6 Madge Networks
+vendor 3COM 0x10B7 3Com
+vendor SMC 0x10b8 Standard Microsystems
+vendor ALI 0x10b9 Acer Labs
+vendor SURECOM 0x10bd Surecom Technology
+vendor SAMSUNGSEMI 0x10c3 Samsung Semiconductors
+vendor NEOMAGIC 0x10c8 Neomagic
+vendor ADVSYS 0x10cd Advanced System Products
+vendor MACRONIX 0x10d9 Macronix
+vendor ES 0x10dd Evans & Sutherland
+vendor NVIDIA 0x10de Nvidia Corporation
+vendor EMULEX 0x10df Emulex
+vendor IMS 0x10e0 Integrated Micro Solutions
+vendor TEKRAM 0x10e1 Tekram Technology (1st PCI Vendor ID)
+vendor NEWBRIDGE 0x10e3 Newbridge Microsystems / Tundra Semiconductor
+vendor AMCIRCUITS 0x10e8 Applied Micro Circuits
+vendor REALTEK 0x10ec Realtek Semiconductor
+vendor NKK 0x10f5 NKK Corporation
+vendor INITIO 0x1101 Initio
+vendor CREATIVELABS 0x1102 Creative Labs
+vendor TRIONES 0x1103 Triones Technologies
+vendor SIGMA 0x1105 Sigma Designs
+vendor VIATECH 0x1106 VIA Technologies
+vendor COGENT 0x1109 Cogent Data Technologies
+vendor RNS 0x1112 RNS
+vendor ACCTON 0x1113 Accton Technology
+vendor VORTEX 0x1119 Vortex Computer Systems
+vendor EFFICIENTNETS 0x111a Efficent Networks
+vendor IDT 0x111d IDT
+vendor FORE 0x1127 FORE Systems
+vendor ZIATECH 0x1138 Ziatech
+vendor ALLIANCE 0x1142 Alliance Semiconductor
+vendor SCHNEIDERKOCH 0x1148 Schneider & Koch
+vendor MUTECH 0x1159 Mutech
+vendor XIRCOM 0x115d Xircom
+vendor ALTERA 0x1172 Altera Corporation
+vendor TOSHIBA2 0x1179 Toshiba America Info Systems
+vendor RICOH 0x1180 Ricoh
+vendor DLINK 0x1186 D-Link Systems
+vendor COROLLARY 0x118c Corrollary
+vendor ACARD 0x1191 Acard
+vendor ZEINET 0x1193 Zeinet
+vendor GALILEO 0x11ab Galileo Technology
+vendor LITEON 0x11ad Lite-On Communications
+vendor V3 0x11b0 V3 Semiconductor
+vendor LUCENT 0x11c1 AT&T Microelectronics
+vendor DOLPHIN 0x11c8 Dolphin Interconnect Solutions
+vendor AURAVISION 0x11d1 Auravision
+vendor ZORAN 0x11de Zoran Corporation
+vendor COMPEX 0x11f6 Compex
+vendor PMCSIERRA 0x11f8 PMC-Sierra
+vendor CYCLADES 0x120e Cyclades
+vendor ESSENTIAL 0x120f Essential Communications
+vendor O2MICRO 0x1217 O2 Micro Inc
+vendor 3DFX 0x121a 3Dfx Interactive
+vendor CCUBE 0x123f C-Cube Microsystems
+vendor AVM 0x1244 AVM
+vendor LINEARSYS 0x1254 Linear Systems
+vendor ASIX 0x125b ASIX Electronics
+vendor ESSTECH 0x125d ESS Technology Inc
+vendor SILMOTION 0x126f Silicon Motion
+vendor ENSONIQ 0x1274 Ensoniq
+vendor DAVICOM 0x1282 Davicom Semiconductor
+vendor ESSTECH2 0x1285 ESS Technology Inc
+vendor TRITECH 0x1292 TriTech Microelectronics
+vendor ALTEON 0x12ae Alteon
+vendor RISCOM 0x12aa RISCom
+vendor USR 0x12b9 US Robotics (3Com)
+vendor NVIDIA_SGS 0x12d2 Nvidia Corporation & SGS Thomson Microelectric
+vendor AUREAL 0x12eb Aureal Semiconductor
+vendor ADMTEK 0x1317 ADMtek
+vendor FORTEMEDIA 0x1319 Forte Media
+vendor DOMEX 0x134a Domex
+vendor LMC 0x1376 LAN Media Corporation
+vendor API 0x14d9 API Networks
+vendor CONEXANT 0x14f1 Conexant Systems
+vendor NETGEAR 0x1385 Netgear
+vendor 3WARE 0x13c1 3ware
+vendor SUNDANCETI 0x13f0 Sundance Technology
+vendor CMEDIA 0x13f6 C-Media Electronics Inc
+vendor DELTA 0x1500 Delta Electronics
+vendor SOLIDUM 0x1588 Solidum Systems Corp.
+vendor SIBYTE 0x166d SiByte, Inc.
+vendor SYMPHONY2 0x1c1c Symphony Labs (2nd PCI Vendor ID)
+vendor TEKRAM2 0x1de1 Tekram Technology (2nd PCI Vendor ID)
+vendor BROADCOM 0x14e4 Broadcom
+vendor 3DLABS 0x3d3d 3D Labs
+vendor AVANCE2 0x4005 Avance Logic (2nd PCI Vendor ID)
+vendor ADDTRON 0x4033 Addtron Technology
+vendor NETVIN 0x4a14 NetVin
+vendor S3 0x5333 S3
+vendor C4T 0x6374 c't Magazin
+vendor INTEL 0x8086 Intel
+vendor PROLAN 0x8c4a ProLAN
+vendor KTI 0x8e2e KTI
+vendor ADP 0x9004 Adaptec
+vendor ADP2 0x9005 Adaptec (2nd PCI Vendor ID)
+vendor ATRONICS 0x907f Atronics
+vendor ARC 0xedd8 ARC Logic
+vendor EPIGRAM 0xfeda Epigram
+vendor INVALID 0xffff INVALID VENDOR ID
+
+/*
+ * List of known products. Grouped by vendor.
+ */
+
+/* 3COM Products */
+product 3COM 3C985 0x0001 3c985 Gigabit Ethernet
+product 3COM 3C590 0x5900 3c590 Ethernet
+product 3COM 3C595TX 0x5950 3c595-TX 10/100 Ethernet
+product 3COM 3C595T4 0x5951 3c595-T4 10/100 Ethernet
+product 3COM 3C595MII 0x5952 3c595-MII 10/100 Ethernet
+product 3COM 3C900TPO 0x9000 3c900-TPO Ethernet
+product 3COM 3C900COMBO 0x9001 3c900-COMBO Ethernet
+product 3COM 3C905TX 0x9050 3c905-TX 10/100 Ethernet
+product 3COM 3C905T4 0x9051 3c905-T4 10/100 Ethernet
+product 3COM 3C900BTPO 0x9004 3c900B-TPO Ethernet
+product 3COM 3C900BCOMBO 0x9005 3c900B-COMBO Ethernet
+product 3COM 3C900BTPC 0x9006 3c900B-TPC Ethernet
+product 3COM 3C905BTX 0x9055 3c905B-TX 10/100 Ethernet
+product 3COM 3C905BT4 0x9056 3c905B-T4 10/100 Ethernet
+product 3COM 3C905BCOMBO 0x9058 3c905B-COMBO 10/100 Ethernet
+product 3COM 3C905BFX 0x905a 3c905B-FX 100 Ethernet
+product 3COM 3C905CTX 0x9200 3c905C-TX 10/100 Ethernet with mngmt
+product 3COM 3C980SRV 0x9800 3c980 Server Adapter 10/100 Ethernet
+product 3COM 3C980CTXM 0x9805 3c980C-TXM 10/100 Ethernet
+product 3COM 3CR990TX97 0x9903 3CR990-TX-97 10/100 Ethernet
+
+/* 3Dfx Interactive producs */
+product 3DFX VOODOO 0x0001 Voodoo
+product 3DFX VOODOO2 0x0002 Voodoo2
+product 3DFX BANSHEE 0x0003 Banshee
+product 3DFX VOODOO3 0x0005 Voodoo3
+
+/* 3D Labs products */
+product 3DLABS 300SX 0x0001 GLINT 300SX
+product 3DLABS 500TX 0x0002 GLINT 500TX
+product 3DLABS DELTA 0x0003 GLINT DELTA
+product 3DLABS PERMEDIA 0x0004 GLINT Permedia
+product 3DLABS 500MX 0x0006 GLINT 500MX
+product 3DLABS PERMEDI2 0x0007 GLINT Permedia 2
+
+/* 3ware products */
+product 3WARE ESCALADE 0x1000 Escalade IDE RAID
+
+/* ACC Products */
+product ACC 2188 0x0000 ACCM 2188 VL-PCI Bridge
+product ACC 2051_HB 0x2051 2051 PCI Single Chip Solution (host bridge)
+product ACC 2051_ISA 0x5842 2051 PCI Single Chip Solution (ISA bridge)
+
+/* Acard products */
+product ACARD AEC6710 0x8002 AEC6710 SCSI
+product ACARD AEC6712UW 0x8010 AEC6712UW SCSI
+product ACARD AEC6712U 0x8020 AEC6712U SCSI
+product ACARD AEC6712S 0x8030 AEC6712S SCSI
+product ACARD AEC6710D 0x8040 AEC6710D SCSI
+product ACARD AEC6715UW 0x8050 AEC6715UW SCSI
+
+/* Accton products */
+product ACCTON MPX5030 0x1211 MPX 5030/5038 Ethernet
+
+/* Acer products */
+product ACER M1435 0x1435 M1435 VL-PCI Bridge
+
+/* Acer Labs products */
+product ALI M1445 0x1445 M1445 VL-PCI Bridge
+product ALI M1449 0x1449 M1449 PCI-ISA Bridge
+product ALI M1451 0x1451 M1451 Host-PCI Bridge
+product ALI M1461 0x1461 M1461 Host-PCI Bridge
+product ALI M1531 0x1531 M1531 Host-PCI Bridge
+product ALI M1541 0x1541 M1541 Host-PCI Bridge
+product ALI M1543 0x1533 M1543 PCI-ISA Bridge
+product ALI M3309 0x3309 M3309 MPEG Decoder
+product ALI M4803 0x5215 M4803
+product ALI M5229 0x5229 M5229 UDMA IDE Controller
+product ALI M5237 0x5237 M5237 USB Host Controller
+product ALI M7101 0x7101 M7101 Power Management Controller
+
+/* Adaptec products */
+product ADP AIC7850 0x5078 AIC-7850
+product ADP AIC7855 0x5578 AIC-7855
+product ADP AIC5900 0x5900 AIC-5900 ATM
+product ADP AIC5905 0x5905 AIC-5905 ATM
+product ADP AIC6915 0x6915 AIC-6915 10/100 Ethernet
+product ADP AIC7860 0x6078 AIC-7860
+product ADP APA1480 0x6075 APA-1480 Ultra
+product ADP 2940AU 0x6178 AHA-2940A Ultra
+product ADP AIC7870 0x7078 AIC-7870
+product ADP 2940 0x7178 AHA-2940
+product ADP 3940 0x7278 AHA-3940
+product ADP 3985 0x7378 AHA-3985
+product ADP 2944 0x7478 AHA-2944
+product ADP AIC7895 0x7895 AIC-7895 Ultra
+product ADP AIC7880 0x8078 AIC-7880 Ultra
+product ADP 2940U 0x8178 AHA-2940 Ultra
+product ADP 3940U 0x8278 AHA-3940 Ultra
+product ADP 389XU 0x8378 AHA-389X Ultra
+product ADP 2944U 0x8478 AHA-2944 Ultra
+product ADP 2940UP 0x8778 AHA-2940 Ultra Pro
+
+product ADP2 2940U2 0x0010 AHA-2940 Ultra2
+product ADP2 2930U2 0x0011 AHA-2930 Ultra2
+product ADP2 AIC7890 0x001f AIC-7890/1
+product ADP2 3950U2B 0x0050 AHA-3950 Ultra2
+product ADP2 3950U2D 0x0051 AHA-3950 Ultra2
+product ADP2 AIC7896 0x005f AIC-7896/7
+
+/* Addtron Products */
+product ADDTRON 8139 0x1360 8139 Ethernet
+
+/* ADMtek products */
+product ADMTEK AL981 0x0981 ADMtek AL981 10/100 Ethernet
+
+/* Advanced System Products */
+product ADVSYS 1200A 0x1100
+product ADVSYS 1200B 0x1200
+product ADVSYS ULTRA 0x1300 ABP-930/40UA
+product ADVSYS WIDE 0x2300 ABP-940UW
+product ADVSYS U2W 0x2500 ASB-3940U2W
+product ADVSYS U3W 0x2700 ASB-3940U3W
+
+/* Alliance products */
+product ALLIANCE AT24 0x6424 AT24
+product ALLIANCE AT25 0x643d AT25
+
+/* Alteon products */
+product ALTEON ACENIC 0x0001 ACEnic Gigabit Ethernet
+
+/* AMD products */
+product AMD PCNET_PCI 0x2000 79c970 PCnet-PCI LANCE Ethernet
+product AMD PCNET_HOME 0x2001 79c978 PCnet-PCI Home
+product AMD PCSCSI_PCI 0x2020 53c974 PCscsi-PCI SCSI
+product AMD PCNETS_PCI 0x2040 79C974 PCnet-PCI Ethernet & SCSI
+product AMD SC751_SC 0x7006 AMD751 System Controller
+product AMD SC751_PPB 0x7007 AMD751 PCI-to-PCI Bridge
+product AMD PBC756_ISA 0x7408 AMD756 PCI-to-ISA Bridge
+product AMD PBC756_IDE 0x7409 AMD756 IDE controller
+product AMD PBC756_PMC 0x740B AMD756 Power Management Controller
+product AMD PBC756_USB 0x740C AMD756 USB Host Controller
+product AMD HT7520 0x7450 (PLX) HT7520 PCIX Tunnel
+product AMD HT7520_PIC 0x7451 (PLX) HT7520 PCIX IOAPIC
+product AMD AMD8151_AGP 0x7454 AMD8151 AGP Device
+product AMD AMD8151 0x7455 AMD8151 HyperTransport-AGP Bridge
+
+/* API Networks products */
+product API STURGEON 0x0010 AP1011 HyperTransport-PCI Bridge
+
+/* Apple products */
+product APPLE BANDIT 0x0001 Bandit Host-PCI Bridge
+product APPLE GC 0x0002 Grand Central I/O Controller
+product APPLE CONTROL 0x0003 Control
+product APPLE PLANB 0x0004 PlanB
+product APPLE OHARE 0x0007 OHare I/O Controller
+product APPLE BANDIT2 0x0008 Bandit Host-PCI Bridge
+product APPLE HEATHROW 0x0010 MAC-IO I/O Controller (Heathrow)
+product APPLE PADDINGTON 0x0017 MAC-IO I/O Controller (Paddington)
+product APPLE KEYLARGO_USB 0x0019 KeyLargo USB Controller
+product APPLE UNINORTH1 0x001e UniNorth Host-PCI Bridge
+product APPLE UNINORTH2 0x001f UniNorth Host-PCI Bridge
+product APPLE UNINORTH_AGP 0x0020 UniNorth AGP Interface
+product APPLE GMAC 0x0021 GMAC Ethernet
+product APPLE KEYLARGO 0x0022 MAC-IO I/O Controller (KeyLargo)
+
+/* ARC Logic products */
+product ARC 1000PV 0xa091 1000PV
+product ARC 2000PV 0xa099 2000PV
+product ARC 2000MT 0xa0a1 2000MT
+
+/* ASIX Electronics products */
+product ASIX AX88140A 0x1400 AX88140A 10/100 Ethernet
+
+/* ATI products */
+product ATI MACH32 0x4158 Mach32
+product ATI MACH64_CT 0x4354 Mach64 CT
+product ATI MACH64_CX 0x4358 Mach64 CX
+product ATI MACH64_ET 0x4554 Mach64 ET
+product ATI MACH64_VT 0x4654 Mach64 VT
+product ATI MACH64_B 0x4750 Mach64 B
+product ATI MACH64_GB 0x4742 Mach64 GB
+product ATI MACH64_GD 0x4744 Mach64 GD
+product ATI MACH64_GI 0x4749 Mach64 GI
+product ATI MACH64_GP 0x4750 Mach64 GP
+product ATI MACH64_GQ 0x4751 Mach64 GQ
+product ATI MACH64_GT 0x4754 Mach64 GT
+product ATI MACH64_GU 0x4755 Mach64 GU
+product ATI MACH64_GV 0x4756 Mach64 GV
+product ATI MACH64_GW 0x4757 Mach64 GW
+product ATI MACH64_GX 0x4758 Mach64 GX
+product ATI MACH64_GZ 0x475a Mach64 GZ
+product ATI MACH64_LB 0x4c42 Mach64 LB
+product ATI MACH64_LD 0x4c44 Mach64 LD
+product ATI MACH64_LG 0x4c47 Mach64 LG
+product ATI MACH64_LI 0x4c49 Mach64 LI
+product ATI MACH64_LM 0x4c4d Mach64 LM
+product ATI MACH64_LP 0x4c50 Mach64 LP
+product ATI MACH64_LR 0x4c52 Mach64 LR
+
+/* Auravision products */
+product AURAVISION VXP524 0x01f7 VxP524 PCI Video Processor
+
+/* Aureal Semiconductor */
+product AUREAL AU8820 0x0001 AU8820 Vortex Digital Audio Processor
+
+/* Applied Micro Circuts products */
+product AMCIRCUITS S5933 0x4750 S5933 PCI Matchmaker
+product AMCIRCUITS LANAI 0x8043 Myrinet LANai Interface
+product AMCIRCUITS S5920 0x5920 S5920 PCI Target
+
+/* Atronics products */
+product ATRONICS IDE_2015PL 0x2015 IDE-2015PL
+
+/* Avance Logic products */
+product AVANCE AVL2301 0x2301 AVL2301
+product AVANCE AVG2302 0x2302 AVG2302
+product AVANCE2 ALG2301 0x2301 ALG2301
+product AVANCE2 ALG2302 0x2302 ALG2302
+
+/* CCUBE products */
+product CCUBE CINEMASTER 0x8888 Cinemaster C 3.0 DVD Decoder
+
+/* AVM products */
+product AVM FRITZ_CARD 0x0a00 Fritz! Card ISDN Interface
+
+/* Bit3 products */
+product BIT3 PCIVME617 0x0001 PCI-VME Interface Mod. 617
+product BIT3 PCIVME618 0x0010 PCI-VME Interface Mod. 618
+product BIT3 PCIVME2706 0x0300 PCI-VME Interface Mod. 2706
+
+/* Broadcom products */
+product BROADCOM BCM4211 0x4211 BCM4211 iLine10 Controller
+product BROADCOM BCM4212 0x4212 BCM4212 V.90 Modem
+product BROADCOM BCM5700 0x1644 BCM5700 10/100/1000 Ethernet
+product BROADCOM BCM5701 0x1645 BCM5701 10/100/1000 Ethernet
+product BROADCOM BCM5702 0x16a6 BCM5702 10/100/1000 Ethernet
+product BROADCOM BCM5703 0x16a7 BCM5703 10/100/1000 Ethernet
+product BROADCOM BCM5705 0x1653 BCM5705 10/100/1000 Ethernet
+product BROADCOM BCM5820 0x5820 BCM5820 eCommerce Processor
+product BROADCOM BCM5821 0x5821 BCM5821 Super-eCommerce Processor
+product BROADCOM BCM5850 0x5850 BCM5850 SSL/TLS Protocol Processor
+
+/* Brooktree products */
+product BROOKTREE BT848 0x0350 Bt848 Video Capture
+product BROOKTREE BT849 0x0351 Bt849 Video Capture
+product BROOKTREE BT878 0x036e Bt878 Video Capture
+product BROOKTREE BT879 0x036f Bt879 Video Capture
+
+/* BusLogic products */
+product BUSLOGIC MULTIMASTER_NC 0x0140 MultiMaster NC
+product BUSLOGIC MULTIMASTER 0x1040 MultiMaster
+product BUSLOGIC FLASHPOINT 0x8130 FlashPoint
+
+/* c't Magazin products */
+product C4T GPPCI 0x6773 GPPCI
+
+/* Chips and Technologies products */
+product CHIPS 64310 0x00b8 64310
+product CHIPS 65545 0x00d8 65545
+product CHIPS 65548 0x00dc 65548
+product CHIPS 65550 0x00e0 65550
+product CHIPS 65554 0x00e4 65554
+
+/* Cirrus Logic products */
+product CIRRUS CL_GD7548 0x0038 CL-GD7548
+product CIRRUS CL_GD5430 0x00a0 CL-GD5430
+product CIRRUS CL_GD5434_4 0x00a4 CL-GD5434-4
+product CIRRUS CL_GD5434_8 0x00a8 CL-GD5434-8
+product CIRRUS CL_GD5436 0x00ac CL-GD5436
+product CIRRUS CL_GD5446 0x00b8 CL-GD5446
+product CIRRUS CL_GD5480 0x00bc CL-GD5480
+product CIRRUS CL_PD6729 0x1100 CL-PD6729
+product CIRRUS CL_PD6832 0x1110 CL-PD6832 PCI-CardBus Bridge
+product CIRRUS CL_PD6833 0x1113 CL-PD6833 PCI-CardBus Bridge
+product CIRRUS CL_GD7542 0x1200 CL-GD7542
+product CIRRUS CL_GD7543 0x1202 CL-GD7543
+product CIRRUS CL_GD7541 0x1204 CL-GD7541
+product CIRRUS CL_CD4400 0x4400 CL-CD4400 Communications Controller
+product CIRRUS CS4610 0x6001 CS4610 SoundFusion Audio Accelerator
+product CIRRUS CS4280 0x6003 CS4280 CrystalClear Audio Interface
+
+/* CMD Technology products -- info gleaned from their web site */
+product CMDTECH 640 0x0640 PCI0640
+/* No data on the CMD Tech. web site for the following as of Mar. 3 '98 */
+product CMDTECH 642 0x0642 PCI0642
+/* datasheets available from www.cmd.com for the followings */
+product CMDTECH 643 0x0643 PCI0643
+product CMDTECH 646 0x0646 PCI0646
+product CMDTECH 647 0x0647 PCI0647
+product CMDTECH 648 0x0648 PCI0648
+product CMDTECH 649 0x0649 PCI0649
+
+/* Inclusion of 'A' in the following entry is probably wrong. */
+/* No data on the CMD Tech. web site for the following as of Mar. 3 '98 */
+product CMDTECH 650A 0x0650 PCI0650A
+product CMDTECH 670 0x0670 USB0670
+product CMDTECH 673 0x0673 USB0673
+
+/* C-Media products */
+product CMEDIA CMI8338A 0x0100 CMI8338A PCI Audio Device
+product CMEDIA CMI8338B 0x0101 CMI8338B PCI Audio Device
+product CMEDIA CMI8738 0x0111 CMI8738/C3DX PCI Audio Device
+product CMEDIA HSP56 0x0211 HSP56 Audiomodem Riser
+
+/* Cogent Data Technologies products */
+product COGENT EM110TX 0x1400 EX110TX PCI Fast Ethernet Adapter
+
+/* Compaq products */
+product COMPAQ PCI_EISA_BRIDGE 0x0001 PCI-EISA Bridge
+product COMPAQ PCI_ISA_BRIDGE 0x0002 PCI-ISA Bridge
+product COMPAQ TRIFLEX1 0x1000 Triflex Host-PCI Bridge
+product COMPAQ TRIFLEX2 0x2000 Triflex Host-PCI Bridge
+product COMPAQ QVISION_V0 0x3032 QVision
+product COMPAQ QVISION_1280P 0x3033 QVision 1280/p
+product COMPAQ QVISION_V2 0x3034 QVision
+product COMPAQ TRIFLEX4 0x4000 Triflex Host-PCI Bridge
+product COMPAQ USB 0x7020 USB Controller
+product COMPAQ SMART2P 0xae10 SMART2P RAID
+product COMPAQ N100TX 0xae32 Netelligent 10/100 TX
+product COMPAQ N10T 0xae34 Netelligent 10 T
+product COMPAQ IntNF3P 0xae35 Integrated NetFlex 3/P
+product COMPAQ DPNet100TX 0xae40 Dual Port Netelligent 10/100 TX
+product COMPAQ IntPL100TX 0xae43 ProLiant Integrated Netelligent 10/100 TX
+product COMPAQ DP4000 0xb011 Deskpro 4000 5233MMX
+product COMPAQ NF3P_BNC 0xf150 NetFlex 3/P w/ BNC
+product COMPAQ NF3P 0xf130 NetFlex 3/P
+
+/* Compex products - XXX better descriptions */
+product COMPEX NE2KETHER 0x1401 Ethernet
+product COMPEX RL100ATX 0x2011 RL100-ATX 10/100 Ethernet
+product COMPEX RL100TX 0x9881 RL100-TX 10/100 Ethernet
+
+/* Conexant Systems products */
+product CONEXANT SOFTK56 0x2443 SoftK56 PCI Software Modem
+
+/* Contaq Microsystems products */
+product CONTAQ 82C599 0x0600 82C599 PCI-VLB Bridge
+product CONTAQ 82C693 0xc693 82C693 PCI-ISA Bridge
+
+/* Corollary Products */
+product COROLLARY CBUSII_PCIB 0x0014 \"C-Bus II\"-PCI Bridge
+
+/* Creative Labs products */
+product CREATIVELABS SBLIVE 0x0002 SBLive! EMU 10000
+product CREATIVELABS SBJOY 0x7002 PCI Gameport Joystick
+product CREATIVELABS EV1938 0x8938 Ectiva 1938
+
+/* Cyclades products */
+product CYCLADES CYCLOMY_1 0x0100 Cyclom-Y below 1M
+product CYCLADES CYCLOMY_2 0x0101 Cyclom-Y above 1M
+product CYCLADES CYCLOM4Y_1 0x0102 Cyclom-4Y below 1M
+product CYCLADES CYCLOM4Y_2 0x0103 Cyclom-4Y above 1M
+product CYCLADES CYCLOM8Y_1 0x0104 Cyclom-8Y below 1M
+product CYCLADES CYCLOM8Y_2 0x0105 Cyclom-8Y above 1M
+product CYCLADES CYCLOMZ_1 0x0200 Cyclom-Z below 1M
+product CYCLADES CYCLOMZ_2 0x0201 Cyclom-Z above 1M
+
+/* Davicom Semiconductor products */
+product DAVICOM DM9102 0x9102 Davicom DM9102 10/100 Ethernet
+
+/* DEC products */
+product DEC 21050 0x0001 DECchip 21050 PCI-PCI Bridge
+product DEC 21040 0x0002 DECchip 21040 Ethernet
+product DEC 21030 0x0004 DECchip 21030 (\"TGA\")
+product DEC NVRAM 0x0007 Zephyr NV-RAM
+product DEC KZPSA 0x0008 KZPSA
+product DEC 21140 0x0009 DECchip 21140 10/100 Ethernet
+product DEC PBXGB 0x000d TGA2
+product DEC DEFPA 0x000f DEFPA
+/* product DEC ??? 0x0010 ??? VME Interface */
+product DEC 21041 0x0014 DECchip 21041 Ethernet
+product DEC DGLPB 0x0016 DGLPB (\"OPPO\")
+product DEC 21142 0x0019 DECchip 21142/21143 10/100 Ethernet
+product DEC 21052 0x0021 DECchip 21052 PCI-PCI Bridge
+product DEC 21150 0x0022 DECchip 21150 PCI-PCI Bridge
+product DEC 21152 0x0024 DECchip 21152 PCI-PCI Bridge
+product DEC 21153 0x0025 DECchip 21153 PCI-PCI Bridge
+product DEC 21154 0x0026 DECchip 21154 PCI-PCI Bridge
+product DEC CPQ42XX 0x0046 Compaq SMART RAID 42xx
+
+/* Delta products */
+product DELTA 8139 0x1360 8139 Ethernet
+
+/* Diamond products */
+product DIAMOND VIPER 0x9001 Viper/PCI
+
+/* D-Link Systems products */
+product DLINK DFE550TX 0x1002 DFE-550TX 10/100 Ethernet
+
+/* Distributed Processing Technology products */
+product DPT SC_RAID 0xa400 SmartCache/SmartRAID
+product DPT RAID_I2O 0xa501 SmartRAID (I2O)
+product DPT MEMCTLR 0x1012 Memory Controller
+
+/* Dolphin products */
+product DOLPHIN PCISCI 0x0658 PCI-SCI Bridge
+
+/* Domex products */
+product DOMEX PCISCSI 0x0001 DMX-3191D
+
+/* ELSA products */
+product ELSA QS1PCI 0x1000 QuickStep 1000 ISDN card
+
+/* Emulex products */
+product EMULEX LPPFC 0x10df \"Light Pulse\" FibreChannel adapter
+
+/* Ensoniq products */
+product ENSONIQ AUDIOPCI 0x5000 AudioPCI
+product ENSONIQ AUDIOPCI97 0x1371 AudioPCI 97
+product ENSONIQ CT5880 0x5880 CT5880
+
+/* Epigram (now Broadcom) products */
+product EPIGRAM BCM4210 0xa0fa BCM4210 iLine10 Controller
+
+/* Essential Communications products */
+product ESSENTIAL RR_HIPPI 0x0001 RoadRunner HIPPI Interface
+product ESSENTIAL RR_GIGE 0x0005 RoadRunner Gig-E Interface
+
+/* ESS Technology Inc products */
+product ESSTECH MAESTRO1 0x0100 Maestro 1 PCI Audio Accelerator
+product ESSTECH MAESTRO2 0x1968 Maestro 2 PCI Audio Accelerator
+product ESSTECH SOLO1 0x1969 Solo-1 PCI AudioDrive
+product ESSTECH MAESTRO2E 0x1978 Maestro 2E PCI Audio Accelerator
+product ESSTECH MAESTRO3 0x1998 Maestro 3 PCI Audio Accelerator
+product ESSTECH MAESTRO3MODEM 0x1999 Maestro 3 Modem
+
+/* ESS Technology Inc products */
+product ESSTECH2 MAESTRO1 0x0100 Maestro 1 PCI Audio Accelerator
+
+/* O2 Micro Inc */
+product O2MICRO OZ6832 0x6832 OZ6832 CardBus Controller
+
+/* Evans & Sutherland products */
+product ES FREEDOM 0x0001 Freedom PCI-GBus Interface
+
+/* FORE products */
+product FORE PCA200 0x0210 ATM PCA-200
+product FORE PCA200E 0x0300 ATM PCA-200e
+
+/* Forte Media products */
+product FORTEMEDIA FM801 0x0801 Forte Media 801 Sound
+
+/* Future Domain products */
+product FUTUREDOMAIN TMC_18C30 0x0000 TMC-18C30 (36C70)
+
+/* Efficient Networks products */
+product EFFICIENTNETS ENI155PF 0x0000 155P-MF1 ATM (FPGA)
+product EFFICIENTNETS ENI155PA 0x0002 155P-MF1 ATM (ASIC)
+product EFFICIENTNETS ENI25P 0x0003 SpeedStream ENI-25p
+product EFFICIENTNETS SS3000 0x0005 SpeedStream 3000
+
+/* Galileo Technology products */
+product GALILEO GT64010A 0x0146 GT-64010A System Controller
+product GALILEO GT64115 0x4111 GT-64115 System Controller
+product GALILEO GT64011 0x4146 GT-64011 System Controller
+product GALILEO GT64120 0x4620 GT-64120 System Controller
+product GALILEO GT64130 0x6320 GT-64130 System Controller
+
+/* Hewlett-Packard products */
+product HP J2585A 0x1030 J2585A
+
+/* IBM products */
+product IBM MCABRIDGE 0x0002 MCA Bridge
+product IBM ALTALITE 0x0005 CPU Bridge - Alta Lite
+product IBM ALTAMP 0x0007 CPU Bridge - Alta MP
+product IBM ISABRIDGE 0x000a ISA Bridge w/PnP
+product IBM CPUBRIDGE 0x0017 CPU Bridge
+product IBM LANSTREAMER 0x0018 Auto LANStreamer
+product IBM GXT150P 0x001b GXT-150P 2D Accelerator
+product IBM MCABRIDGE2 0x0020 MCA Bridge
+product IBM 82351 0x0022 82351 PCI-PCI Bridge
+product IBM SERVERAID 0x002e ServeRAID
+product IBM OLYMPIC 0x003e Token Ring
+product IBM MIAMI 0x0036 Miami/PCI
+product IBM TURBOWAYS25 0x0053 Turboways 25 ATM
+product IBM MPIC2 0xffff MPIC-II
+
+/* IDT products */
+product IDT 77201 0x0001 77201/77211 ATM (\"NICStAR\")
+
+/* Initio products */
+product INITIO I920 0x0002 INIC-920 SCSI
+product INITIO I940 0x9400 INIC-940 SCSI
+product INITIO I935 0x9401 INIC-935 SCSI
+product INITIO I950 0x9500 INIC-950 SCSI
+
+/* Integrated Micro Solutions products */
+product IMS 8849 0x8849 8849
+product IMS TT128M 0x9128 TwinTurbo 128M
+
+/* Intel products */
+product INTEL PCEB 0x0482 82375EB/SB PCI-EISA Bridge (PCEB)
+product INTEL CDC 0x0483 82424ZX Cache and DRAM controller (CDC)
+product INTEL SIO 0x0484 82378ZB System I/O (SIO)
+product INTEL 82426EX 0x0486 82426EX PCI-to-ISA Bridge (PCIB)
+product INTEL PCMC 0x04a3 82434LX/NX PCI, Cache and Memory Controller (PCMC)
+product INTEL IN_BUSINESS 0x1030 InBusiness Fast Ethernet LAN Controller
+product INTEL 82559ER 0x1209 82559ER Fast Ethernet LAN Controller
+product INTEL 82092AA 0x1222 82092AA IDE controller
+product INTEL SAA7116 0x1223 SAA7116
+product INTEL 82596 0x1226 82596 LAN Controller
+product INTEL EEPRO100 0x1227 EE Pro 100 10/100 Fast Ethernet
+product INTEL EEPRO100S 0x1228 EE Pro 100 Smart 10/100 Fast Ethernet
+product INTEL 82557 0x1229 82557 Fast Ethernet LAN Controller
+product INTEL 82437FX 0x122d 82437FX System Controller (TSC)
+product INTEL 82371FB_ISA 0x122e 82371FB PCI-to-ISA Bridge (PIIX)
+product INTEL 82371FB_IDE 0x1230 82371FB IDE controller (PIIX)
+product INTEL 82371MX 0x1234 82371MX Mobile PCI I/O IDE Xcelerator (MPIIX)
+product INTEL 82437MX 0x1235 82437MX Mobile System Controller (MTSC)
+product INTEL 82441FX 0x1237 82441FX PCI and Memory Controller (PMC)
+product INTEL 82380AB 0x123c 82380AB Mobile PCI-to-ISA Bridge (MISA)
+product INTEL 82380FB 0x124b 82380FB Mobile PCI-to-PCI Bridge (MPCI2)
+product INTEL 82439HX 0x1250 82439HX System Controller (TXC)
+product INTEL 82801AA_LPC 0x2410 82801AA LPC Interface Bridge
+product INTEL 82801AA_IDE 0x2411 82801AA IDE Controller
+product INTEL 82801AA_USB 0x2412 82801AA USB Controller
+product INTEL 82801AA_SMB 0x2413 82801AA SMBus Controller
+product INTEL 82801AA_ACA 0x2415 82801AA AC-97 Audio Controller
+product INTEL 82801AA_ACM 0x2416 82801AA AC-97 PCI Modem
+product INTEL 82801AA_HPB 0x2418 82801AA Hub-to-PCI Bridge
+product INTEL 82801AB_LPC 0x2420 82801AB LPC Interface Bridge
+product INTEL 82801AB_IDE 0x2421 82801AB IDE Controller
+product INTEL 82801AB_USB 0x2422 82801AB USB Controller
+product INTEL 82801AB_SMB 0x2423 82801AB SMBus Controller
+product INTEL 82801AB_ACA 0x2425 82801AB AC-97 Audio Controller
+product INTEL 82801AB_ACM 0x2426 82801AB AC-97 PCI Modem
+product INTEL 82801AB_HPB 0x2428 82801AB Hub-to-PCI Bridge
+product INTEL 82801BA_LPC 0x2440 82801BA LPC Interface Bridge
+product INTEL 82801BA_USB1 0x2442 82801BA USB Controller
+product INTEL 82801BA_SMB 0x2443 82801BA SMBus Controller
+product INTEL 82801BA_USB2 0x2444 82801BA USB Controller
+product INTEL 82801BA_ACA 0x2445 82801BA AC-97 Audio Controller
+product INTEL 82801BA_ACM 0x2446 82801BA AC-97 PCI Modem
+product INTEL 82801BA_LAN 0x2449 82801BA LAN Controller
+product INTEL 82801BA_IDE 0x244B 82801BA IDE Controller
+product INTEL 82801BA_HPB 0x244E 82801BA Hub-to-PCI Bridge
+product INTEL 82371SB_ISA 0x7000 82371SB PCI-to-ISA Bridge (PIIX3)
+product INTEL 82371SB_IDE 0x7010 82371SB IDE Interface (PIIX3)
+product INTEL 82371SB_USB 0x7020 82371SB USB Host Controller (PIIX3)
+product INTEL 82437VX 0x7030 82437VX System Controller (TVX)
+product INTEL 82439TX 0x7100 82439TX System Controller (MTXC)
+product INTEL 82371AB_ISA 0x7110 82371AB PCI-to-ISA Bridge (PIIX4)
+product INTEL 82371AB_IDE 0x7111 82371AB IDE controller (PIIX4)
+product INTEL 82371AB_USB 0x7112 82371AB USB Host Controller (PIIX4)
+product INTEL 82371AB_PMC 0x7113 82371AB Power Management Controller (PIIX4)
+product INTEL 82810_MCH 0x7120 82810 Memory Controller Hub
+product INTEL 82810_GC 0x7121 82810 Graphics Controller
+product INTEL 82810_DC100_MCH 0x7122 82810-DC100 Memory Controller Hub
+product INTEL 82810_DC100_GC 0x7123 82810-DC100 Graphics Controller
+product INTEL 82810E_MCH 0x7124 82810E Memory Controller Hub
+product INTEL 82810E_GC 0x7125 82810E Graphics Controller
+product INTEL 82443LX 0x7180 82443LX PCI AGP Controller (PAC)
+product INTEL 82443LX_AGP 0x7181 82443LX AGP Interface (PAC)
+product INTEL 82443BX 0x7190 82443BX Host Bridge/Controller
+product INTEL 82443BX_AGP 0x7191 82443BX AGP Interface
+product INTEL 82443BX_NOAGP 0x7192 82443BX Host Bridge/Controller (AGP disabled)
+product INTEL 82440MX 0x7194 82440MX Host Bridge/Controller
+product INTEL 82440MX_ACA 0x7195 82440MX AC-97 Audio Controller
+product INTEL 82440MX_ISA 0x7198 82440MX PCI-to-ISA Bridge
+product INTEL 82440MX_IDE 0x7199 82440MX IDE Controller
+product INTEL 82440MX_USB 0x719a 82440MX USB Host Controller
+product INTEL 82440MX_PMC 0x719b 82440MX Power Management Controller
+product INTEL I740 0x7800 i740 Graphics Accelerator
+product INTEL PCI450_PB 0x84c4 82454KX/GX PCI Bridge (PB)
+product INTEL PCI450_MC 0x84c5 82451KX/GX Memory Controller (MC)
+product INTEL 82451NX_MIOC 0x84ca 82451NX Memory & I/O Controller (MIOC)
+product INTEL 82451NX_PXB 0x84cb 82451NX PCI Expander Bridge (PXB)
+
+/* Intergraph products */
+product INTERGRAPH 4D50T 0x00e4 Powerstorm 4D50T
+
+/* I. T. T. products */
+product ITT AGX016 0x0001 AGX016
+product ITT ITT3204 0x0002 ITT3204 MPEG Decoder
+
+/* KTI products - XXX better descriptions */
+product KTI NE2KETHER 0x3000 Ethernet
+
+/* LAN Media Corporation */
+product LMC HSSI 0x0003 HSSI Interface
+product LMC DS3 0x0004 DS3 Interface
+product LMC SSI 0x0005 SSI
+
+/* LeadTek Research */
+product LEADTEK S3_805 0x0000 S3 805
+
+/* Linear Systems / CompuModules */
+product LINEARSYS DVB_TX 0x7629 DVB Transmitter
+product LINEARSYS DVB_RX 0x7630 DVB Receiver
+
+/* Lite-On products */
+product LITEON 82C168 0x0002 82C168/82C169 (PNIC) 10/100 Ethernet
+product LITEON 82C115 0xc115 82C115 (PNIC II) 10/100 Ethernet
+
+/* Lucent products */
+product LUCENT LTMODEM_0440 0x0440 K56flex DSVD LTMODEM
+product LUCENT LTMODEM_0441 0x0441 LTMODEM
+product LUCENT LTMODEM_0442 0x0442 LTMODEM
+product LUCENT LTMODEM_0443 0x0443 LTMODEM
+product LUCENT LTMODEM_0444 0x0444 LTMODEM
+product LUCENT LTMODEM_0445 0x0445 LTMODEM
+product LUCENT LTMODEM_0446 0x0446 LTMODEM
+product LUCENT LTMODEM_0447 0x0447 LTMODEM
+product LUCENT LTMODEM_0448 0x0448 LTMODEM
+product LUCENT LTMODEM_0449 0x0449 LTMODEM
+product LUCENT LTMODEM_044A 0x044A LTMODEM
+product LUCENT LTMODEM_044B 0x044B LTMODEM
+product LUCENT LTMODEM_044C 0x044C LTMODEM
+product LUCENT LTMODEM_044D 0x044D LTMODEM
+product LUCENT LTMODEM_044E 0x044E LTMODEM
+product LUCENT LTMODEM_0450 0x0450 LTMODEM
+product LUCENT LTMODEM_0451 0x0451 LTMODEM
+product LUCENT LTMODEM_0452 0x0452 LTMODEM
+product LUCENT LTMODEM_0453 0x0453 LTMODEM
+product LUCENT LTMODEM_0454 0x0454 LTMODEM
+product LUCENT LTMODEM_0455 0x0455 LTMODEM
+product LUCENT LTMODEM_0456 0x0456 LTMODEM
+product LUCENT LTMODEM_0457 0x0457 LTMODEM
+product LUCENT LTMODEM_0458 0x0458 LTMODEM
+product LUCENT LTMODEM_0459 0x0459 LTMODEM
+product LUCENT LTMODEM_045A 0x045A LTMODEM
+product LUCENT USBHC 0x5801 USB Host Controller
+
+/* Macronix */
+product MACRONIX MX98713 0x0512 MX98713 (PMAC) 10/100 Ethernet
+product MACRONIX MX987x5 0x0531 MX987x5 (PMAC) 10/100 Ethernet
+
+/* Madge Networks products */
+product MADGE COLLAGE25 0x1000 Collage 25 ATM adapter
+product MADGE COLLAGE155 0x1001 Collage 155 ATM adapter
+
+/* Matrox products */
+product MATROX ATLAS 0x0518 MGA PX2085 (\"Atlas\")
+product MATROX MILLENNIUM 0x0519 MGA Millennium 2064W
+product MATROX MYSTIQUE 0x051a MGA Mystique 1064SG
+product MATROX MILLENNIUM2 0x051b MGA Millennium II 2164W
+product MATROX MILLENNIUM2_AGP 0x051f MGA Millennium II 2164WA-B AG
+product MATROX G200_PCI 0x0520 MGA G200 PCI
+product MATROX G200_AGP 0x0521 MGA G200 AGP
+product MATROX G400_AGP 0x0525 MGA G400 AGP
+product MATROX IMPRESSION 0x0d10 MGA Impression
+product MATROX G100_PCI 0x1000 MGA G100 PCI
+product MATROX G100_AGP 0x1001 MGA G100 AGP
+
+/* Motorola products */
+product MOT MPC105 0x0001 MPC105 \"Eagle\" Host Bridge
+product MOT MPC106 0x0002 MPC106 \"Grackle\" Host Bridge
+
+/* Mylex products */
+product MYLEX 960P 0x0001 DAC960P RAID controller
+
+/* Mutech products */
+product MUTECH MV1000 0x0001 MV1000
+
+/* NetVin products - XXX better descriptions */
+product NETVIN 5000 0x5000 5000 Ethernet
+
+/* Newbridge / Tundra products */
+product NEWBRIDGE CA91CX42 0x0000 Universe VME bridge
+
+/* National Semiconductor products */
+product NS DP83810 0x0001 DP83810 10/100 Ethernet
+product NS DP83815 0x0020 DP83815 10/100 Ethernet
+product NS NS87410 0xd001 NS87410
+
+/* NCR/Symbios Logic products */
+product SYMBIOS 810 0x0001 53c810
+product SYMBIOS 820 0x0002 53c820
+product SYMBIOS 825 0x0003 53c825
+product SYMBIOS 815 0x0004 53c815
+product SYMBIOS 810AP 0x0005 53c810AP
+product SYMBIOS 860 0x0006 53c860
+product SYMBIOS 896 0x000b 53c896
+product SYMBIOS 895 0x000c 53c895
+product SYMBIOS 885 0x000d 53c885
+product SYMBIOS 875 0x000f 53c875
+product SYMBIOS 1510 0x0010 53c1510
+product SYMBIOS 875J 0x008f 53c875J
+
+/* Packet Engines products */
+product SYMBIOS PE_GNIC 0x0702 Packet Engines G-NIC Ethernet
+
+/* NEC products */
+product NEC USB 0x0035 USB Host Controller
+product NEC POWERVR2 0x0046 PowerVR PCX2
+product NEC PD72872 0x0063 uPD72872 IEEE 1394 OHCI Host Controller
+product NEC PD72870 0x00cd uPD72870 IEEE 1394 OHCI Host Controller
+product NEC PD72871 0x00ce uPD72871 IEEE 1394 OHCI Host Controller
+
+/* Neomagic products */
+product NEOMAGIC NMMG128ZV 0x0003 MagicGraph 128ZV
+product NEOMAGIC NMMG2160 0x0004 MagicGraph 128XD
+product NEOMAGIC NMMM256AV_VGA 0x0005 MagicMedia 256AV VGA
+product NEOMAGIC NMMM256ZX_VGA 0x0006 MagicMedia 256ZX VGA
+product NEOMAGIC NMMM256AV_AU 0x8005 MagicMedia 256AV Audio
+product NEOMAGIC NMMM256ZX_AU 0x8006 MagicMedia 256ZX Audio
+
+/* Netgear products */
+product NETGEAR GA620 0x620a GA620 Gigabit Ethernet
+
+/* NexGen products */
+product NEXGEN NX82C501 0x4e78 NX82C501 Host-PCI Bridge
+
+/* NKK products */
+product NKK NDR4600 0xA001 NDR4600 Host-PCI Bridge
+
+/* Number Nine products */
+product NUMBER9 I128 0x2309 Imagine-128
+product NUMBER9 I128_2 0x2339 Imagine-128 II
+
+/* Nvidia Corporationn products */
+product NVIDIA RIVATNT 0x0020 RIVA TNT
+product NVIDIA RIVATNT2 0x0028 RIVA TNT2
+product NVIDIA RIVATNT2U 0x0029 RIVA TNT2 Ultra
+product NVIDIA VANTA 0x002C Vanta
+product NVIDIA RIVATNT2M64 0x002D RIVA TNT2 Model 64
+product NVIDIA ALADDINTNT2 0x00A0 Aladdin TNT2
+product NVIDIA GEFORCE256 0x0100 GeForce 256
+product NVIDIA GEFORCEDDR 0x0101 GeForce DDR
+product NVIDIA QUADRO 0x0103 Quadro
+product NVIDIA GEFORCE2 0x0150 GeForce2 GTS
+product NVIDIA GEFORCE2DDR 0x0151 GeForce2 GTS (DDR)
+product NVIDIA GEFORCE2BR 0x0152 GeForce2 GTS
+product NVIDIA QUADRO2 0x0153 Quadro2
+
+/* Nvidia Corporation & SGS Thomson Microelectric */
+product NVIDIA_SGS RIVA128 0x0018 Riva 128
+
+/* Oak Technologies products */
+product OAKTECH OTI1007 0x0107 OTI107
+
+/* Olicom products */
+product OLICOM OC2183 0x0013 Olicom OC-2183/2185 Ethernet
+product OLICOM OC2325 0x0012 Olicom OC-2325 Ethernet
+product OLICOM OC2326 0x0014 Olicom OC-2326 10/100-TX Ethernet
+
+/* Opti products */
+product OPTI 82C557 0xc557 82C557
+product OPTI 82C558 0xc558 82C558
+product OPTI 82C568 0xc568 82C568
+product OPTI 82D568 0xd568 82D568
+product OPTI 82C621 0xc621 82C621
+product OPTI 82C822 0xc822 82C822
+product OPTI RM861HA 0xc861 RM861HA
+product OPTI 82C700 0xc700 82C700
+product OPTI 82C701 0xc701 82C701
+
+/* PC Tech products */
+product PCTECH RZ1000 0x1000 RZ1000
+
+/* PLX Technology products */
+product PLX 9060ES 0x906e 9060ES PCI bus controller
+
+/* ProLAN products - XXX better descriptions */
+product PROLAN NE2KETHER 0x1980 Ethernet
+
+/* Promise products */
+product PROMISE DC5030 0x5300 DC5030
+product PROMISE ULTRA33 0x4d33 Ultra33/ATA Bus Master IDE Accelerator
+product PROMISE ULTRA66 0x4d38 Ultra66/ATA Bus Master IDE Accelerator
+product PROMISE ULTRA100 0x4d30 Ultra100/ATA Bus Master IDE Accelerator
+
+/* QLogic products */
+product QLOGIC ISP1020 0x1020 ISP1020
+product QLOGIC ISP1022 0x1022 ISP1022
+product QLOGIC ISP1080 0x1080 ISP1080
+product QLOGIC ISP1240 0x1240 ISP1240
+product QLOGIC ISP2100 0x2100 ISP2100
+
+/* Quantum Designs products */
+product QUANTUMDESIGNS 8500 0x0001 8500
+product QUANTUMDESIGNS 8580 0x0002 8580
+
+/* Realtek (Creative Labs?) products */
+product REALTEK RT8029 0x8029 8029 Ethernet
+product REALTEK RT8129 0x8129 8129 10/100 Ethernet
+product REALTEK RT8139 0x8139 8139 10/100 Ethernet
+
+/* RICOH products */
+product RICOH Rx5C465 0x0465 5C465 PCI-CardBus bridge
+product RICOH Rx5C466 0x0466 5C466 PCI-CardBus bridge
+product RICOH Rx5C475 0x0475 5C475 PCI-CardBus bridge
+product RICOH RL5C476 0x0476 5C476 PCI-CardBus bridge
+product RICOH Rx5C477 0x0477 5C477 PCI-CardBus bridge
+product RICOH Rx5C478 0x0478 5C478 PCI-CardBus bridge
+
+/* RISCom (SDL Communications, Inc?) products */
+product RISCOM N2 0x5568 N2
+
+/* RNS products */
+product RNS FDDI 0x2200 2200 FDDI
+
+/* S3 products */
+product S3 VIRGE 0x5631 ViRGE
+product S3 TRIO32 0x8810 Trio32
+product S3 TRIO64 0x8811 Trio32/64
+product S3 AURORA64P 0x8812 Aurora64V+
+product S3 TRIO64UVP 0x8814 Trio64UV+
+product S3 VIRGE_VX 0x883d ViRGE/VX
+product S3 868 0x8880 868
+product S3 928 0x88b0 86C928
+product S3 864_0 0x88c0 86C864-0
+product S3 864_1 0x88c1 86C864-1
+product S3 864_2 0x88c2 86C864-2
+product S3 864_3 0x88c3 86C864-3
+product S3 964_0 0x88d0 86C964-0
+product S3 964_1 0x88d1 86C964-1
+product S3 964_2 0x88d2 86C964-2
+product S3 964_3 0x88d3 86C964-3
+product S3 968_0 0x88f0 86C968-0
+product S3 968_1 0x88f1 86C968-1
+product S3 968_2 0x88f2 86C968-2
+product S3 968_3 0x88f3 86C968-3
+product S3 TRIO64V2_DX 0x8901 Trio64V2/DX
+product S3 PLATO_PX 0x8901 Plato/PX
+product S3 TRIO3D 0x8904 86C365 Trio3D
+product S3 VIRGE_DX 0x8a01 ViRGE/DX
+product S3 VIRGE_GX2 0x8a10 ViRGE/GX2
+product S3 TRIO3D2X 0x8a13 Trio3D/2X
+product S3 SAVAGE3D 0x8a20 Savage3D
+product S3 SAVAGE3D_MV 0x8a21 Savage3D+MV
+product S3 SAVAGE4 0x8a22 Savage4
+product S3 VIRGE_MX 0x8c01 ViRGE/MX
+product S3 VIRGE_MXP 0x8c03 ViRGE/MXP
+product S3 SAVAGE_MX_MV 0x8c10 Savage/MX+MV
+product S3 SAVAGE_MX 0x8c11 Savage/MX
+product S3 SAVAGE_IX_MV 0x8c12 Savage/IX+MV
+product S3 SAVAGE_IX 0x8c13 Savage/IX
+product S3 SAVAGE2000 0x9102 Savage2000
+product S3 SONICVIBES 0xca00 SonicVibes
+
+/* Samsung Semiconductor products */
+product SAMSUNGSEMI KS8920 0x8920 KS8920 10/100 Ethernet
+
+/* SGI products */
+product SGI IOC3 0x0003 IOC3
+product SGI RAD1 0x0005 PsiTech RAD1
+product SGI TIGON 0x0009 Tigon Gigabit Ethernet
+
+/* SGS Thomson products */
+product SGSTHOMSON 2000 0x0008 STG 2000X
+product SGSTHOMSON 1764 0x1746 STG 1764X
+
+/* SiByte, Inc. products */
+product SIBYTE SB1250_PCI 0x0001 BCM1250 PCI Host Bridge
+product SIBYTE SB1250_LDT 0x0002 BCM1250 HyperTransport Host Bridge
+
+/* Sigma Designs products */
+product SIGMA HOLLYWOODPLUS 0x8300 REALmagic Hollywood-Plus MPEG-2 Decoder
+
+/* Silicon Integrated System products */
+product SIS 86C201 0x0001 86C201
+product SIS 86C202 0x0002 86C202
+product SIS 86C205 0x0005 86C205
+product SIS 85C503 0x0008 85C503 or 5597/5598 ISA bridge
+product SIS 600PMC 0x0009 600 Power Mngmt Controller
+product SIS 5597_VGA 0x0200 5597/5598 integrated VGA
+product SIS 85C501 0x0406 85C501
+product SIS 85C496 0x0496 85C496
+product SIS 530HB 0x0530 530 Host to PCI Bridge
+product SIS 85C601 0x0601 85C601
+product SIS 900 0x0900 SiS 900 10/100 Ethernet
+product SIS 5597_IDE 0x5513 5597/5598 IDE controller
+product SIS 5597_HB 0x5597 5597/5598 host bridge
+product SIS 530VGA 0x6306 530 GUI Accelerator+3D
+product SIS 6326 0x6326 6326 AGP VGA
+product SIS 5597_USB 0x7001 5597/5598 USB host controller
+product SIS 7016 0x7016 SiS 7016 10/100 Ethernet
+
+/* Silicon Motion products */
+product SILMOTION LYNX_E 0x0810 Lynx E
+
+/* SMC products */
+product SMC 37C665 0x1000 FDC 37C665
+product SMC 37C922 0x1001 FDC 37C922
+product SMC 83C170 0x0005 83C170 (\"EPIC/100\") Fast Ethernet
+product SMC 83C175 0x0006 83C175 (\"EPIC/100\") Fast Ethernet
+
+/* Solidum Systems Corporation */
+product SOLIDUM AMD971 0x2000 SNP8023: AMD 971
+product SOLIDUM CLASS802 0x8023 SNP8023: Classifier Engine
+
+/* Sony products */
+product SONY CXD1947A 0x8009 CXD1947A IEEE 1394 Host Controller
+product SONY CXD32222 0x8039 CXD3222 OHCI IEEE 1394 Host Controller
+product SONY MEMSTICK 0x808a Memory Stick I/F Controller
+
+/* Sun Microsystems products */
+product SUN EBUS 0x1000 PCIO Ebus2
+product SUN HMENETWORK 0x1001 PCIO Happy Meal Ethernet
+product SUN SIMBA 0x5000 Simba PCI bridge
+product SUN MS_IIep 0x9000 microSPARC IIep PCI
+product SUN US_IIi 0xa000 UltraSPARC IIi PCI
+
+/* Sundance Technology products */
+product SUNDANCETI ST201 0x0201 ST201 10/100 Ethernet
+
+/* Surecom Technology products */
+product SURECOM NE34 0x0e34 NE-34 Ethernet
+
+/* Symphony Labs products */
+product SYMPHONY 82C101 0x0001 82C101
+product SYMPHONY 82C103 0x0103 82C103
+product SYMPHONY 82C105 0x0105 82C105
+product SYMPHONY2 82C101 0x0001 82C101
+product SYMPHONY 83C553 0x0565 83C553 PCI-ISA Bridge
+
+/* Schneider & Koch (really SysKonnect) products */
+product SCHNEIDERKOCH SKNET_FDDI 0x4000 SK-NET FDDI-xP
+
+/* Tekram Technology products (1st PCI Vendor ID)*/
+product TEKRAM DC290 0xdc29 DC-290(M)
+
+/* Tekram Technology products (2nd PCI Vendor ID) */
+product TEKRAM2 DC690C 0x690c DC-690C
+
+/* Texas Instruments products */
+product TI TLAN 0x0500 TLAN
+product TI TVP4020 0x3d07 TVP4020 Permedia 2
+product TI TSB12LV21 0x8000 TSB12LV21 IEEE 1394 Host Controller
+product TI TSB12LV22 0x8009 TSB12LV22 OHCI IEEE 1394 Host Controller
+product TI TSB12LV23 0x8019 TSB12LV23 OHCI IEEE 1394 Host Controller
+product TI TSB12LV26 0x8020 TSB12LV26 OHCI IEEE 1394 Host Controller
+product TI PCI1130 0xac12 PCI1130 PCI-CardBus Bridge
+product TI PCI1031 0xac13 PCI1031 PCI-PCMCIA Bridge
+product TI PCI1131 0xac15 PCI1131 PCI-CardBus Bridge
+product TI PCI1250 0xac16 PCI1250 PCI-CardBus Bridge
+product TI PCI1220 0xac17 PCI1220 PCI-CardBus Bridge
+product TI PCI1221 0xac19 PCI1221 PCI-CardBus Bridge
+product TI PCI1450 0xac1b PCI1450 PCI-CardBus Bridge
+product TI PCI1225 0xac1c PCI1225 PCI-CardBus Bridge
+product TI PCI1251 0xac1d PCI1251 PCI-CardBus Bridge
+product TI PCI1211 0xac1e PCI1211 PCI-CardBus Bridge
+product TI PCI1251B 0xac1f PCI1251B PCI-CardBus Bridge
+product TI PCI2030 0xac20 PCI2030 PCI-PCI Bridge
+product TI PCI1420 0xac51 PCI1420 PCI-CardBus Bridge
+product TI PCI1451 0xac52 PCI1451 PCI-CardBus Bridge
+
+/* Toshiba America products */
+product TOSHIBA R4X00 0x0009 R4x00 Host-PCI Bridge
+product TOSHIBA TC35856F 0x0020 TC35856F ATM (\"Meteor\")
+
+/* Toshiba America Info Systems products */
+product TOSHIBA2 HOST 0x0601 Host Bridge/Controller
+product TOSHIBA2 ISA 0x0602 ISA Bridge
+product TOSHIBA2 ToPIC95 0x0603 ToPIC95 CardBus-PCI Bridge
+product TOSHIBA2 ToPIC95B 0x060a ToPIC95B CardBus-PCI Bridge
+product TOSHIBA2 ToPIC97 0x060f ToPIC97 CardBus-PCI Bridge
+product TOSHIBA2 ToPIC100 0x0617 ToPIC100 CardBus-PCI Bridge
+product TOSHIBA2 FIRO 0x0701 Fast Infrared Type O
+
+/* Trident products */
+product TRIDENT CYBERBLADE_I7 0x8420 CyberBlade i7
+product TRIDENT TGUI_9320 0x9320 TGUI 9320
+product TRIDENT TGUI_9350 0x9350 TGUI 9350
+product TRIDENT TGUI_9360 0x9360 TGUI 9360
+product TRIDENT CYBER_9397 0x9397 CYBER 9397
+product TRIDENT CYBER_9397DVD 0x939a CYBER 9397DVD
+product TRIDENT CYBER_9525 0x9525 CYBER 9525
+product TRIDENT TGUI_9420 0x9420 TGUI 9420
+product TRIDENT TGUI_9440 0x9440 TGUI 9440
+product TRIDENT TGUI_9660 0x9660 TGUI 9660
+product TRIDENT TGUI_9680 0x9680 TGUI 9680
+product TRIDENT TGUI_9682 0x9682 TGUI 9682
+
+/* Triones Technologies products */
+/* The 366 and 370 controllers have the same product ID */
+product TRIONES HPT366 0x0004 HPT366/370 IDE Controller
+
+/* TriTech Microelectronics products*/
+product TRITECH TR25202 0xfc02 Pyramid3D TR25202
+
+/* Tseng Labs products */
+product TSENG ET4000_W32P_A 0x3202 ET4000w32p rev A
+product TSENG ET4000_W32P_B 0x3205 ET4000w32p rev B
+product TSENG ET4000_W32P_C 0x3206 ET4000w32p rev C
+product TSENG ET4000_W32P_D 0x3207 ET4000w32p rev D
+product TSENG ET6000 0x3208 ET6000
+
+/* UMC products */
+product UMC UM82C881 0x0001 UM82C881 486 Chipset
+product UMC UM82C886 0x0002 UM82C886 ISA Bridge
+product UMC UM8673F 0x0101 UM8673F EIDE Controller
+product UMC UM8881 0x0881 UM8881 HB4 486 PCI Chipset
+product UMC UM82C891 0x0891 UM82C891
+product UMC UM886A 0x1001 UM886A
+product UMC UM8886BF 0x673a UM8886BF
+product UMC UM8710 0x8710 UM8710
+product UMC UM8886 0x886a UM8886
+product UMC UM8881F 0x8881 UM8881F PCI-Host bridge
+product UMC UM8886F 0x8886 UM8886F PCI-ISA bridge
+product UMC UM8886A 0x888a UM8886A
+product UMC UM8891A 0x8891 UM8891A
+product UMC UM9017F 0x9017 UM9017F
+product UMC UM8886N 0xe88a UM8886N
+product UMC UM8891N 0xe891 UM8891N
+
+/* ULSI Systems products */
+product ULSI US201 0x0201 US201
+
+/* US Robotics products */
+product USR 3CP5609 0x1008 3CP5609 PCI 16550 Modem
+
+/* V3 Semiconductor products */
+product V3 V292PBC 0x0292 V292PBC AMD290x0 Host-PCI Bridge
+product V3 V960PBC 0x0960 V960PBC i960 Host-PCI Bridge
+product V3 V96DPC 0xC960 V96DPC i960 (Dual) Host-PCI Bridge
+
+/* VIA Technologies products, from http://www.via.com.tw/ */
+product VIATECH VT8371_HB 0x0391 VT8371 (Apollo KX133) Host Bridge
+product VIATECH VT8501_MVP4 0x0501 VT8501 MVP4 System Controller
+product VIATECH VT82C505 0x0505 VT82C505 (Pluto)
+product VIATECH VT82C561 0x0561 VT82C561
+product VIATECH VT82C586A_IDE 0x0571 VT82C586A IDE Controller
+product VIATECH VT82C576 0x0576 VT82C576 3V
+product VIATECH VT82C580VP 0x0585 VT82C580 (Apollo VP) Host-PCI Bridge
+product VIATECH VT82C586_ISA 0x0586 VT82C586 (Apollo VP) PCI-ISA Bridge
+product VIATECH VT82C595 0x0595 VT82C595 (Apollo VP2) Host-PCI Bridge
+product VIATECH VT82C596A 0x0596 VT82C596A (Apollo Pro) PCI-ISA Bridge
+product VIATECH VT82C597 0x0597 VT82C597 (Apollo VP3) Host-PCI Bridge
+product VIATECH VT82C598PCI 0x0598 VT82C598 (Apollo MVP3) Host-PCI
+product VIATECH VT82C686A_ISA 0x0686 VT82C686A (Apollo KX133) PCI-ISA Bridge
+product VIATECH VT82C691 0x0691 VT82C691 (Apollo Pro) Host-PCI
+product VIATECH VT82C693 0x0693 VT82C693 (Apollo Pro Plus) Host-PCI
+product VIATECH VT86C926 0x0926 VT86C926 Amazon PCI-Ethernet Controller
+product VIATECH VT82C570M 0x1000 VT82C570M (Apollo) Host-PCI Bridge
+product VIATECH VT82C570MV 0x1006 VT82C570M (Apollo) PCI-ISA Bridge
+product VIATECH VT82C586_IDE 0x1571 VT82C586 (Apollo VP) IDE Controller
+product VIATECH VT82C595_2 0x1595 VT82C595 (Apollo VP2) Host-PCI Bridge
+product VIATECH VT83C572 0x3038 VT83C572 USB Controller
+product VIATECH VT82C586_PWR 0x3040 VT82C586 (Apollo VP) Power Management Controller
+product VIATECH VT3043 0x3043 VT3043 (Rhine) 10/100 Ethernet
+product VIATECH VT82C686A_SMB 0x3057 VT82C686A SMBus Controller
+product VIATECH VT82C686A_AC97 0x3058 VT82C686A AC-97 Audio Controller
+product VIATECH VT82C686A_MC97 0x3068 VT82C686A MC-97 Modem Controller
+product VIATECH VT86C100A 0x6100 VT86C100A (Rhine-II) 10/100 Ethernet
+product VIATECH VT8371_PPB 0x8391 VT8371 (Apollo KX133) PCI-PCI Bridge
+product VIATECH VT8501AGP 0x8501 VT8501 PCI-AGP
+product VIATECH VT82C597AGP 0x8597 VT82C597 (Apollo VP3) PCI-AGP
+product VIATECH VT82C598AGP 0x8598 VT82C598 (Apollo MVP3) PCI-AGP
+
+/* Vortex Computer Systems products */
+/* GDT_PCI */
+product VORTEX GDT_60x0 0x0000 GDT6000/6020/6050
+product VORTEX GDT_6000B 0x0001 GDT6000B/6010
+/* GDT_PCINEW */
+product VORTEX GDT_6x10 0x0002 GDT6110/6510
+product VORTEX GDT_6x20 0x0003 GDT6120/6520
+product VORTEX GDT_6530 0x0004 GDT6530
+product VORTEX GDT_6550 0x0005 GDT6550
+/* GDT_PCINEW, wide/ultra SCSI controllers */
+product VORTEX GDT_6x17 0x0006 GDT6117/6517
+product VORTEX GDT_6x27 0x0007 GDT6127/6527
+product VORTEX GDT_6537 0x0008 GDT6537
+product VORTEX GDT_6557 0x0009 GDT6557/6557-ECC
+/* GDT_PCINEW, wide SCSI controllers */
+product VORTEX GDT_6x15 0x0010 GDT6115/6515
+product VORTEX GDT_6x25 0x0011 GDT6125/6525
+product VORTEX GDT_6535 0x0012 GDT6535
+product VORTEX GDT_6555 0x0013 GDT6555/6555-ECC
+/* GDT_MPR, RP series, wide/ultra SCSI */
+product VORTEX GDT_6x17RP 0x0100 GDT6117RP/GDT6517RP
+product VORTEX GDT_6x27RP 0x0101 GDT6127RP/GDT6527RP
+product VORTEX GDT_6537RP 0x0102 GDT6537RP
+product VORTEX GDT_6557RP 0x0103 GDT6557RP
+/* GDT_MPR, RP series, narrow/ultra SCSI */
+product VORTEX GDT_6x11RP 0x0104 GDT6111RP/GDT6511RP
+product VORTEX GDT_6x21RP 0x0105 GDT6121RP/GDT6521RP
+/* GDT_MPR, RD series, wide/ultra SCSI */
+product VORTEX GDT_6x17RD 0x0110 GDT6117RD/GDT6517RD
+product VORTEX GDT_6x27RD 0x0111 GDT6127RD/GDT6527RD
+product VORTEX GDT_6537RD 0x0112 GDT6537RD
+product VORTEX GDT_6557RD 0x0113 GDT6557RD
+/* GDT_MPR, RD series, narrow/ultra SCSI */
+product VORTEX GDT_6x11RD 0x0114 GDT6111RD/GDT6511RD
+product VORTEX GDT_6x21RD 0x0115 GDT6121RD/GDT6521RD
+/* GDT_MPR, RD series, wide/ultra2 SCSI */
+product VORTEX GDT_6x18RD 0x0118 GDT6118RD/GDT6518RD/GDT6618RD
+product VORTEX GDT_6x28RD 0x0119 GDT6128RD/GDT6528RD/GDT6628RD
+product VORTEX GDT_6x38RD 0x011A GDT6538RD/GDT6638RD
+product VORTEX GDT_6x58RD 0x011B GDT6558RD/GDT6658RD
+/* GDT_MPR, RN series (64-bit PCI), wide/ultra2 SCSI */
+product VORTEX GDT_7x18RN 0x0168 GDT7118RN/GDT7518RN/GDT7618RN
+product VORTEX GDT_7x28RN 0x0169 GDT7128RN/GDT7528RN/GDT7628RN
+product VORTEX GDT_7x38RN 0x016A GDT7538RN/GDT7638RN
+product VORTEX GDT_7x58RN 0x016B GDT7558RN/GDT7658RN
+/* GDT_MPR, RD series, Fibre Channel */
+product VORTEX GDT_6x19RD 0x0210 GDT6519RD/GDT6619RD
+product VORTEX GDT_6x29RD 0x0211 GDT6529RD/GDT6629RD
+/* GDT_MPR, RN series (64-bit PCI), Fibre Channel */
+product VORTEX GDT_7x19RN 0x0260 GDT7519RN/GDT7619RN
+product VORTEX GDT_7x29RN 0x0261 GDT7529RN/GDT7629RN
+
+/* VLSI products */
+product VLSI 82C592 0x0005 82C592 CPU Bridge
+product VLSI 82C593 0x0006 82C593 ISA Bridge
+product VLSI 82C594 0x0007 82C594 Wildcat System Controller
+product VLSI 82C596597 0x0008 82C596/597 Wildcat ISA Bridge
+product VLSI 82C541 0x000c 82C541
+product VLSI 82C543 0x000d 82C543
+product VLSI 82C532 0x0101 82C532
+product VLSI 82C534 0x0102 82C534
+product VLSI 82C535 0x0104 82C535
+product VLSI 82C147 0x0105 82C147
+product VLSI 82C975 0x0200 82C975
+product VLSI 82C925 0x0280 82C925
+
+/* Weitek products */
+product WEITEK P9000 0x9001 P9000
+product WEITEK P9100 0x9100 P9100
+
+/* Western Digital products */
+product WD WD33C193A 0x0193 WD33C193A
+product WD WD33C196A 0x0196 WD33C196A
+product WD WD33C197A 0x0197 WD33C197A
+product WD WD7193 0x3193 WD7193
+product WD WD7197 0x3197 WD7197
+product WD WD33C296A 0x3296 WD33C296A
+product WD WD34C296 0x4296 WD34C296
+product WD 90C 0xC24A 90C
+
+/* Winbond Electronics products */
+product WINBOND W83769F 0x0001 W83769F
+product WINBOND W89C840F 0x0840 W89C840F 10/100 Ethernet
+product WINBOND W89C940F 0x0940 W89C940F Ethernet
+product WINBOND W89C940F_1 0x5a5a W89C940F Ethernet
+
+/* Xircom products */
+/* is the `-3' here just indicating revision 3, or is it really part
+ of the device name? */
+product XIRCOM X3201_3 0x0002 X3201-3 Fast Ethernet Controller
+/* this is the device id `indicating 21143 driver compatibility' */
+product XIRCOM X3201_3_21143 0x0003 X3201-3 Fast Ethernet Controller (21143)
+
+/* Yamaha products */
+product YAMAHA YMF724 0x0004 724 Audio
+product YAMAHA YMF740 0x000A 740 Audio
+product YAMAHA YMF740C 0x000C 740C (DS-1) Audio
+product YAMAHA YMF724F 0x000D 724F (DS-1) Audio
+product YAMAHA YMF744B 0x0010 744 (DS-1S) Audio
+product YAMAHA YMF754 0x0012 754 (DS-1E) Audio
+
+/* Zeinet products */
+product ZEINET 1221 0x0001 1221
+
+/* Ziatech products */
+product ZIATECH ZT8905 0x8905 PCI-ST32 Bridge
+
+/* Zoran products */
+product ZORAN ZR36120 0x6120 Video Controller
diff --git a/cfe/cfe/pci/pcidevs.h b/cfe/cfe/pci/pcidevs.h
new file mode 100644
index 0000000..214ef45
--- /dev/null
+++ b/cfe/cfe/pci/pcidevs.h
@@ -0,0 +1,1360 @@
+/*
+ * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
+ *
+ * generated from:
+ * pcidevs 2002/09/03 broadcom
+ */
+
+/*
+ * Copyright (c) 1995, 1996 Christopher G. Demetriou
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Christopher G. Demetriou
+ * for the NetBSD Project.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * NOTE: a fairly complete list of PCI codes can be found at:
+ *
+ * http://members.hyperlink.net.au/~chart/pci.htm
+ *
+ * which replaces the database found at
+ *
+ * http://www.yourvote.com/pci/
+ *
+ * (but it doesn't always seem to match vendor documentation)
+ */
+
+/*
+ * List of known PCI vendors. This list has been trimmed to include
+ * only vendors with products appearing in the lists below.
+ */
+
+#define PCI_VENDOR_COMPAQ 0x0e11 /* Compaq */
+#define PCI_VENDOR_SYMBIOS 0x1000 /* Symbios Logic */
+#define PCI_VENDOR_ATI 0x1002 /* ATI Technologies */
+#define PCI_VENDOR_ULSI 0x1003 /* ULSI Systems */
+#define PCI_VENDOR_VLSI 0x1004 /* VLSI Technology */
+#define PCI_VENDOR_AVANCE 0x1005 /* Avance Logic */
+#define PCI_VENDOR_NS 0x100b /* National Semiconductor */
+#define PCI_VENDOR_TSENG 0x100c /* Tseng Labs */
+#define PCI_VENDOR_WEITEK 0x100e /* Weitek */
+#define PCI_VENDOR_DEC 0x1011 /* Digital Equipment */
+#define PCI_VENDOR_CIRRUS 0x1013 /* Cirrus Logic */
+#define PCI_VENDOR_IBM 0x1014 /* IBM */
+#define PCI_VENDOR_WD 0x101c /* Western Digital */
+#define PCI_VENDOR_AMD 0x1022 /* Advanced Micro Devices */
+#define PCI_VENDOR_TRIDENT 0x1023 /* Trident Microsystems */
+#define PCI_VENDOR_ACER 0x1025 /* Acer */
+#define PCI_VENDOR_MATROX 0x102b /* Matrox */
+#define PCI_VENDOR_CHIPS 0x102c /* Chips and Technologies */
+#define PCI_VENDOR_TOSHIBA 0x102f /* Toshiba America */
+#define PCI_VENDOR_NEC 0x1033 /* NEC */
+#define PCI_VENDOR_FUTUREDOMAIN 0x1036 /* Future Domain */
+#define PCI_VENDOR_SIS 0x1039 /* Silicon Integrated System */
+#define PCI_VENDOR_HP 0x103c /* Hewlett-Packard */
+#define PCI_VENDOR_PCTECH 0x1042 /* PC Technology */
+#define PCI_VENDOR_DPT 0x1044 /* Distributed Processing Technology */
+#define PCI_VENDOR_OPTI 0x1045 /* Opti */
+#define PCI_VENDOR_ELSA 0x1048 /* Elsa */
+#define PCI_VENDOR_SGSTHOMSON 0x104a /* SGS Thomson Microelectric */
+#define PCI_VENDOR_BUSLOGIC 0x104b /* BusLogic */
+#define PCI_VENDOR_TI 0x104c /* Texas Instruments */
+#define PCI_VENDOR_SONY 0x104d /* Sony */
+#define PCI_VENDOR_OAKTECH 0x104e /* Oak Technology */
+#define PCI_VENDOR_WINBOND 0x1050 /* Winbond Electronics */
+#define PCI_VENDOR_MOT 0x1057 /* Motorola */
+#define PCI_VENDOR_PROMISE 0x105a /* Promise Technology */
+#define PCI_VENDOR_NUMBER9 0x105d /* Number 9 Computer Company */
+#define PCI_VENDOR_UMC 0x1060 /* United Microelectronics */
+#define PCI_VENDOR_ITT 0x1061 /* I. T. T. */
+#define PCI_VENDOR_MYLEX 0x1069 /* Mylex */
+#define PCI_VENDOR_APPLE 0x106b /* Apple Computer */
+#define PCI_VENDOR_YAMAHA 0x1073 /* Yamaha */
+#define PCI_VENDOR_NEXGEN 0x1074 /* NexGen Microsystems */
+#define PCI_VENDOR_QLOGIC 0x1077 /* Q Logic */
+#define PCI_VENDOR_LEADTEK 0x107d /* LeadTek Research */
+#define PCI_VENDOR_CONTAQ 0x1080 /* Contaq Microsystems */
+#define PCI_VENDOR_BIT3 0x108a /* Bit3 Computer Corp. */
+#define PCI_VENDOR_OLICOM 0x108d /* Olicom */
+#define PCI_VENDOR_SUN 0x108e /* Sun Microsystems */
+#define PCI_VENDOR_INTERGRAPH 0x1091 /* Intergraph */
+#define PCI_VENDOR_DIAMOND 0x1092 /* Diamond Computer Systems */
+#define PCI_VENDOR_CMDTECH 0x1095 /* CMD Technology */
+#define PCI_VENDOR_QUANTUMDESIGNS 0x1098 /* Quantum Designs */
+#define PCI_VENDOR_BROOKTREE 0x109e /* Brooktree */
+#define PCI_VENDOR_SGI 0x10a9 /* Silicon Graphics */
+#define PCI_VENDOR_ACC 0x10aa /* ACC Microelectronics */
+#define PCI_VENDOR_SYMPHONY 0x10ad /* Symphony Labs */
+#define PCI_VENDOR_PLX 0x10b5 /* PLX Technology */
+#define PCI_VENDOR_MADGE 0x10b6 /* Madge Networks */
+#define PCI_VENDOR_3COM 0x10B7 /* 3Com */
+#define PCI_VENDOR_SMC 0x10b8 /* Standard Microsystems */
+#define PCI_VENDOR_ALI 0x10b9 /* Acer Labs */
+#define PCI_VENDOR_SURECOM 0x10bd /* Surecom Technology */
+#define PCI_VENDOR_SAMSUNGSEMI 0x10c3 /* Samsung Semiconductors */
+#define PCI_VENDOR_NEOMAGIC 0x10c8 /* Neomagic */
+#define PCI_VENDOR_ADVSYS 0x10cd /* Advanced System Products */
+#define PCI_VENDOR_MACRONIX 0x10d9 /* Macronix */
+#define PCI_VENDOR_ES 0x10dd /* Evans & Sutherland */
+#define PCI_VENDOR_NVIDIA 0x10de /* Nvidia Corporation */
+#define PCI_VENDOR_EMULEX 0x10df /* Emulex */
+#define PCI_VENDOR_IMS 0x10e0 /* Integrated Micro Solutions */
+#define PCI_VENDOR_TEKRAM 0x10e1 /* Tekram Technology (1st PCI Vendor ID) */
+#define PCI_VENDOR_NEWBRIDGE 0x10e3 /* Newbridge Microsystems / Tundra Semiconductor */
+#define PCI_VENDOR_AMCIRCUITS 0x10e8 /* Applied Micro Circuits */
+#define PCI_VENDOR_REALTEK 0x10ec /* Realtek Semiconductor */
+#define PCI_VENDOR_NKK 0x10f5 /* NKK Corporation */
+#define PCI_VENDOR_INITIO 0x1101 /* Initio */
+#define PCI_VENDOR_CREATIVELABS 0x1102 /* Creative Labs */
+#define PCI_VENDOR_TRIONES 0x1103 /* Triones Technologies */
+#define PCI_VENDOR_SIGMA 0x1105 /* Sigma Designs */
+#define PCI_VENDOR_VIATECH 0x1106 /* VIA Technologies */
+#define PCI_VENDOR_COGENT 0x1109 /* Cogent Data Technologies */
+#define PCI_VENDOR_RNS 0x1112 /* RNS */
+#define PCI_VENDOR_ACCTON 0x1113 /* Accton Technology */
+#define PCI_VENDOR_VORTEX 0x1119 /* Vortex Computer Systems */
+#define PCI_VENDOR_EFFICIENTNETS 0x111a /* Efficent Networks */
+#define PCI_VENDOR_IDT 0x111d /* IDT */
+#define PCI_VENDOR_FORE 0x1127 /* FORE Systems */
+#define PCI_VENDOR_ZIATECH 0x1138 /* Ziatech */
+#define PCI_VENDOR_ALLIANCE 0x1142 /* Alliance Semiconductor */
+#define PCI_VENDOR_SCHNEIDERKOCH 0x1148 /* Schneider & Koch */
+#define PCI_VENDOR_MUTECH 0x1159 /* Mutech */
+#define PCI_VENDOR_XIRCOM 0x115d /* Xircom */
+#define PCI_VENDOR_ALTERA 0x1172 /* Altera Corporation */
+#define PCI_VENDOR_TOSHIBA2 0x1179 /* Toshiba America Info Systems */
+#define PCI_VENDOR_RICOH 0x1180 /* Ricoh */
+#define PCI_VENDOR_DLINK 0x1186 /* D-Link Systems */
+#define PCI_VENDOR_COROLLARY 0x118c /* Corrollary */
+#define PCI_VENDOR_ACARD 0x1191 /* Acard */
+#define PCI_VENDOR_ZEINET 0x1193 /* Zeinet */
+#define PCI_VENDOR_GALILEO 0x11ab /* Galileo Technology */
+#define PCI_VENDOR_LITEON 0x11ad /* Lite-On Communications */
+#define PCI_VENDOR_V3 0x11b0 /* V3 Semiconductor */
+#define PCI_VENDOR_LUCENT 0x11c1 /* AT&T Microelectronics */
+#define PCI_VENDOR_DOLPHIN 0x11c8 /* Dolphin Interconnect Solutions */
+#define PCI_VENDOR_AURAVISION 0x11d1 /* Auravision */
+#define PCI_VENDOR_ZORAN 0x11de /* Zoran Corporation */
+#define PCI_VENDOR_COMPEX 0x11f6 /* Compex */
+#define PCI_VENDOR_PMCSIERRA 0x11f8 /* PMC-Sierra */
+#define PCI_VENDOR_CYCLADES 0x120e /* Cyclades */
+#define PCI_VENDOR_ESSENTIAL 0x120f /* Essential Communications */
+#define PCI_VENDOR_O2MICRO 0x1217 /* O2 Micro Inc */
+#define PCI_VENDOR_3DFX 0x121a /* 3Dfx Interactive */
+#define PCI_VENDOR_CCUBE 0x123f /* C-Cube Microsystems */
+#define PCI_VENDOR_AVM 0x1244 /* AVM */
+#define PCI_VENDOR_LINEARSYS 0x1254 /* Linear Systems */
+#define PCI_VENDOR_ASIX 0x125b /* ASIX Electronics */
+#define PCI_VENDOR_ESSTECH 0x125d /* ESS Technology Inc */
+#define PCI_VENDOR_SILMOTION 0x126f /* Silicon Motion */
+#define PCI_VENDOR_ENSONIQ 0x1274 /* Ensoniq */
+#define PCI_VENDOR_DAVICOM 0x1282 /* Davicom Semiconductor */
+#define PCI_VENDOR_ESSTECH2 0x1285 /* ESS Technology Inc */
+#define PCI_VENDOR_TRITECH 0x1292 /* TriTech Microelectronics */
+#define PCI_VENDOR_ALTEON 0x12ae /* Alteon */
+#define PCI_VENDOR_RISCOM 0x12aa /* RISCom */
+#define PCI_VENDOR_USR 0x12b9 /* US Robotics (3Com) */
+#define PCI_VENDOR_NVIDIA_SGS 0x12d2 /* Nvidia Corporation & SGS Thomson Microelectric */
+#define PCI_VENDOR_AUREAL 0x12eb /* Aureal Semiconductor */
+#define PCI_VENDOR_ADMTEK 0x1317 /* ADMtek */
+#define PCI_VENDOR_FORTEMEDIA 0x1319 /* Forte Media */
+#define PCI_VENDOR_DOMEX 0x134a /* Domex */
+#define PCI_VENDOR_LMC 0x1376 /* LAN Media Corporation */
+#define PCI_VENDOR_API 0x14d9 /* API Networks */
+#define PCI_VENDOR_CONEXANT 0x14f1 /* Conexant Systems */
+#define PCI_VENDOR_NETGEAR 0x1385 /* Netgear */
+#define PCI_VENDOR_3WARE 0x13c1 /* 3ware */
+#define PCI_VENDOR_SUNDANCETI 0x13f0 /* Sundance Technology */
+#define PCI_VENDOR_CMEDIA 0x13f6 /* C-Media Electronics Inc */
+#define PCI_VENDOR_DELTA 0x1500 /* Delta Electronics */
+#define PCI_VENDOR_SOLIDUM 0x1588 /* Solidum Systems Corp. */
+#define PCI_VENDOR_SIBYTE 0x166d /* SiByte, Inc. */
+#define PCI_VENDOR_SYMPHONY2 0x1c1c /* Symphony Labs (2nd PCI Vendor ID) */
+#define PCI_VENDOR_TEKRAM2 0x1de1 /* Tekram Technology (2nd PCI Vendor ID) */
+#define PCI_VENDOR_BROADCOM 0x14e4 /* Broadcom */
+#define PCI_VENDOR_3DLABS 0x3d3d /* 3D Labs */
+#define PCI_VENDOR_AVANCE2 0x4005 /* Avance Logic (2nd PCI Vendor ID) */
+#define PCI_VENDOR_ADDTRON 0x4033 /* Addtron Technology */
+#define PCI_VENDOR_NETVIN 0x4a14 /* NetVin */
+#define PCI_VENDOR_S3 0x5333 /* S3 */
+#define PCI_VENDOR_C4T 0x6374 /* c't Magazin */
+#define PCI_VENDOR_INTEL 0x8086 /* Intel */
+#define PCI_VENDOR_PROLAN 0x8c4a /* ProLAN */
+#define PCI_VENDOR_KTI 0x8e2e /* KTI */
+#define PCI_VENDOR_ADP 0x9004 /* Adaptec */
+#define PCI_VENDOR_ADP2 0x9005 /* Adaptec (2nd PCI Vendor ID) */
+#define PCI_VENDOR_ATRONICS 0x907f /* Atronics */
+#define PCI_VENDOR_ARC 0xedd8 /* ARC Logic */
+#define PCI_VENDOR_EPIGRAM 0xfeda /* Epigram */
+#define PCI_VENDOR_INVALID 0xffff /* INVALID VENDOR ID */
+
+/*
+ * List of known products. Grouped by vendor.
+ */
+
+/* 3COM Products */
+#define PCI_PRODUCT_3COM_3C985 0x0001 /* 3c985 Gigabit Ethernet */
+#define PCI_PRODUCT_3COM_3C590 0x5900 /* 3c590 Ethernet */
+#define PCI_PRODUCT_3COM_3C595TX 0x5950 /* 3c595-TX 10/100 Ethernet */
+#define PCI_PRODUCT_3COM_3C595T4 0x5951 /* 3c595-T4 10/100 Ethernet */
+#define PCI_PRODUCT_3COM_3C595MII 0x5952 /* 3c595-MII 10/100 Ethernet */
+#define PCI_PRODUCT_3COM_3C900TPO 0x9000 /* 3c900-TPO Ethernet */
+#define PCI_PRODUCT_3COM_3C900COMBO 0x9001 /* 3c900-COMBO Ethernet */
+#define PCI_PRODUCT_3COM_3C905TX 0x9050 /* 3c905-TX 10/100 Ethernet */
+#define PCI_PRODUCT_3COM_3C905T4 0x9051 /* 3c905-T4 10/100 Ethernet */
+#define PCI_PRODUCT_3COM_3C900BTPO 0x9004 /* 3c900B-TPO Ethernet */
+#define PCI_PRODUCT_3COM_3C900BCOMBO 0x9005 /* 3c900B-COMBO Ethernet */
+#define PCI_PRODUCT_3COM_3C900BTPC 0x9006 /* 3c900B-TPC Ethernet */
+#define PCI_PRODUCT_3COM_3C905BTX 0x9055 /* 3c905B-TX 10/100 Ethernet */
+#define PCI_PRODUCT_3COM_3C905BT4 0x9056 /* 3c905B-T4 10/100 Ethernet */
+#define PCI_PRODUCT_3COM_3C905BCOMBO 0x9058 /* 3c905B-COMBO 10/100 Ethernet */
+#define PCI_PRODUCT_3COM_3C905BFX 0x905a /* 3c905B-FX 100 Ethernet */
+#define PCI_PRODUCT_3COM_3C905CTX 0x9200 /* 3c905C-TX 10/100 Ethernet with mngmt */
+#define PCI_PRODUCT_3COM_3C980SRV 0x9800 /* 3c980 Server Adapter 10/100 Ethernet */
+#define PCI_PRODUCT_3COM_3C980CTXM 0x9805 /* 3c980C-TXM 10/100 Ethernet */
+#define PCI_PRODUCT_3COM_3CR990TX97 0x9903 /* 3CR990-TX-97 10/100 Ethernet */
+
+/* 3Dfx Interactive producs */
+#define PCI_PRODUCT_3DFX_VOODOO 0x0001 /* Voodoo */
+#define PCI_PRODUCT_3DFX_VOODOO2 0x0002 /* Voodoo2 */
+#define PCI_PRODUCT_3DFX_BANSHEE 0x0003 /* Banshee */
+#define PCI_PRODUCT_3DFX_VOODOO3 0x0005 /* Voodoo3 */
+
+/* 3D Labs products */
+#define PCI_PRODUCT_3DLABS_300SX 0x0001 /* GLINT 300SX */
+#define PCI_PRODUCT_3DLABS_500TX 0x0002 /* GLINT 500TX */
+#define PCI_PRODUCT_3DLABS_DELTA 0x0003 /* GLINT DELTA */
+#define PCI_PRODUCT_3DLABS_PERMEDIA 0x0004 /* GLINT Permedia */
+#define PCI_PRODUCT_3DLABS_500MX 0x0006 /* GLINT 500MX */
+#define PCI_PRODUCT_3DLABS_PERMEDI2 0x0007 /* GLINT Permedia 2 */
+
+/* 3ware products */
+#define PCI_PRODUCT_3WARE_ESCALADE 0x1000 /* Escalade IDE RAID */
+
+/* ACC Products */
+#define PCI_PRODUCT_ACC_2188 0x0000 /* ACCM 2188 VL-PCI Bridge */
+#define PCI_PRODUCT_ACC_2051_HB 0x2051 /* 2051 PCI Single Chip Solution (host bridge) */
+#define PCI_PRODUCT_ACC_2051_ISA 0x5842 /* 2051 PCI Single Chip Solution (ISA bridge) */
+
+/* Acard products */
+#define PCI_PRODUCT_ACARD_AEC6710 0x8002 /* AEC6710 SCSI */
+#define PCI_PRODUCT_ACARD_AEC6712UW 0x8010 /* AEC6712UW SCSI */
+#define PCI_PRODUCT_ACARD_AEC6712U 0x8020 /* AEC6712U SCSI */
+#define PCI_PRODUCT_ACARD_AEC6712S 0x8030 /* AEC6712S SCSI */
+#define PCI_PRODUCT_ACARD_AEC6710D 0x8040 /* AEC6710D SCSI */
+#define PCI_PRODUCT_ACARD_AEC6715UW 0x8050 /* AEC6715UW SCSI */
+
+/* Accton products */
+#define PCI_PRODUCT_ACCTON_MPX5030 0x1211 /* MPX 5030/5038 Ethernet */
+
+/* Acer products */
+#define PCI_PRODUCT_ACER_M1435 0x1435 /* M1435 VL-PCI Bridge */
+
+/* Acer Labs products */
+#define PCI_PRODUCT_ALI_M1445 0x1445 /* M1445 VL-PCI Bridge */
+#define PCI_PRODUCT_ALI_M1449 0x1449 /* M1449 PCI-ISA Bridge */
+#define PCI_PRODUCT_ALI_M1451 0x1451 /* M1451 Host-PCI Bridge */
+#define PCI_PRODUCT_ALI_M1461 0x1461 /* M1461 Host-PCI Bridge */
+#define PCI_PRODUCT_ALI_M1531 0x1531 /* M1531 Host-PCI Bridge */
+#define PCI_PRODUCT_ALI_M1541 0x1541 /* M1541 Host-PCI Bridge */
+#define PCI_PRODUCT_ALI_M1543 0x1533 /* M1543 PCI-ISA Bridge */
+#define PCI_PRODUCT_ALI_M3309 0x3309 /* M3309 MPEG Decoder */
+#define PCI_PRODUCT_ALI_M4803 0x5215 /* M4803 */
+#define PCI_PRODUCT_ALI_M5229 0x5229 /* M5229 UDMA IDE Controller */
+#define PCI_PRODUCT_ALI_M5237 0x5237 /* M5237 USB Host Controller */
+#define PCI_PRODUCT_ALI_M7101 0x7101 /* M7101 Power Management Controller */
+
+/* Adaptec products */
+#define PCI_PRODUCT_ADP_AIC7850 0x5078 /* AIC-7850 */
+#define PCI_PRODUCT_ADP_AIC7855 0x5578 /* AIC-7855 */
+#define PCI_PRODUCT_ADP_AIC5900 0x5900 /* AIC-5900 ATM */
+#define PCI_PRODUCT_ADP_AIC5905 0x5905 /* AIC-5905 ATM */
+#define PCI_PRODUCT_ADP_AIC6915 0x6915 /* AIC-6915 10/100 Ethernet */
+#define PCI_PRODUCT_ADP_AIC7860 0x6078 /* AIC-7860 */
+#define PCI_PRODUCT_ADP_APA1480 0x6075 /* APA-1480 Ultra */
+#define PCI_PRODUCT_ADP_2940AU 0x6178 /* AHA-2940A Ultra */
+#define PCI_PRODUCT_ADP_AIC7870 0x7078 /* AIC-7870 */
+#define PCI_PRODUCT_ADP_2940 0x7178 /* AHA-2940 */
+#define PCI_PRODUCT_ADP_3940 0x7278 /* AHA-3940 */
+#define PCI_PRODUCT_ADP_3985 0x7378 /* AHA-3985 */
+#define PCI_PRODUCT_ADP_2944 0x7478 /* AHA-2944 */
+#define PCI_PRODUCT_ADP_AIC7895 0x7895 /* AIC-7895 Ultra */
+#define PCI_PRODUCT_ADP_AIC7880 0x8078 /* AIC-7880 Ultra */
+#define PCI_PRODUCT_ADP_2940U 0x8178 /* AHA-2940 Ultra */
+#define PCI_PRODUCT_ADP_3940U 0x8278 /* AHA-3940 Ultra */
+#define PCI_PRODUCT_ADP_389XU 0x8378 /* AHA-389X Ultra */
+#define PCI_PRODUCT_ADP_2944U 0x8478 /* AHA-2944 Ultra */
+#define PCI_PRODUCT_ADP_2940UP 0x8778 /* AHA-2940 Ultra Pro */
+
+#define PCI_PRODUCT_ADP2_2940U2 0x0010 /* AHA-2940 Ultra2 */
+#define PCI_PRODUCT_ADP2_2930U2 0x0011 /* AHA-2930 Ultra2 */
+#define PCI_PRODUCT_ADP2_AIC7890 0x001f /* AIC-7890/1 */
+#define PCI_PRODUCT_ADP2_3950U2B 0x0050 /* AHA-3950 Ultra2 */
+#define PCI_PRODUCT_ADP2_3950U2D 0x0051 /* AHA-3950 Ultra2 */
+#define PCI_PRODUCT_ADP2_AIC7896 0x005f /* AIC-7896/7 */
+
+/* Addtron Products */
+#define PCI_PRODUCT_ADDTRON_8139 0x1360 /* 8139 Ethernet */
+
+/* ADMtek products */
+#define PCI_PRODUCT_ADMTEK_AL981 0x0981 /* ADMtek AL981 10/100 Ethernet */
+
+/* Advanced System Products */
+#define PCI_PRODUCT_ADVSYS_1200A 0x1100
+#define PCI_PRODUCT_ADVSYS_1200B 0x1200
+#define PCI_PRODUCT_ADVSYS_ULTRA 0x1300 /* ABP-930/40UA */
+#define PCI_PRODUCT_ADVSYS_WIDE 0x2300 /* ABP-940UW */
+#define PCI_PRODUCT_ADVSYS_U2W 0x2500 /* ASB-3940U2W */
+#define PCI_PRODUCT_ADVSYS_U3W 0x2700 /* ASB-3940U3W */
+
+/* Alliance products */
+#define PCI_PRODUCT_ALLIANCE_AT24 0x6424 /* AT24 */
+#define PCI_PRODUCT_ALLIANCE_AT25 0x643d /* AT25 */
+
+/* Alteon products */
+#define PCI_PRODUCT_ALTEON_ACENIC 0x0001 /* ACEnic Gigabit Ethernet */
+
+/* AMD products */
+#define PCI_PRODUCT_AMD_PCNET_PCI 0x2000 /* 79c970 PCnet-PCI LANCE Ethernet */
+#define PCI_PRODUCT_AMD_PCNET_HOME 0x2001 /* 79c978 PCnet-PCI Home */
+#define PCI_PRODUCT_AMD_PCSCSI_PCI 0x2020 /* 53c974 PCscsi-PCI SCSI */
+#define PCI_PRODUCT_AMD_PCNETS_PCI 0x2040 /* 79C974 PCnet-PCI Ethernet & SCSI */
+#define PCI_PRODUCT_AMD_SC751_SC 0x7006 /* AMD751 System Controller */
+#define PCI_PRODUCT_AMD_SC751_PPB 0x7007 /* AMD751 PCI-to-PCI Bridge */
+#define PCI_PRODUCT_AMD_PBC756_ISA 0x7408 /* AMD756 PCI-to-ISA Bridge */
+#define PCI_PRODUCT_AMD_PBC756_IDE 0x7409 /* AMD756 IDE controller */
+#define PCI_PRODUCT_AMD_PBC756_PMC 0x740B /* AMD756 Power Management Controller */
+#define PCI_PRODUCT_AMD_PBC756_USB 0x740C /* AMD756 USB Host Controller */
+#define PCI_PRODUCT_AMD_HT7520 0x7450 /* (PLX) HT7520 PCIX Tunnel */
+#define PCI_PRODUCT_AMD_HT7520_PIC 0x7451 /* (PLX) HT7520 PCIX IOAPIC */
+#define PCI_PRODUCT_AMD_AMD8151_AGP 0x7454 /* AMD8151 AGP Device */
+#define PCI_PRODUCT_AMD_AMD8151 0x7455 /* AMD8151 HyperTransport-AGP Bridge */
+
+/* API Networks products */
+#define PCI_PRODUCT_API_STURGEON 0x0010 /* AP1011 HyperTransport-PCI Bridge */
+
+/* Apple products */
+#define PCI_PRODUCT_APPLE_BANDIT 0x0001 /* Bandit Host-PCI Bridge */
+#define PCI_PRODUCT_APPLE_GC 0x0002 /* Grand Central I/O Controller */
+#define PCI_PRODUCT_APPLE_CONTROL 0x0003 /* Control */
+#define PCI_PRODUCT_APPLE_PLANB 0x0004 /* PlanB */
+#define PCI_PRODUCT_APPLE_OHARE 0x0007 /* OHare I/O Controller */
+#define PCI_PRODUCT_APPLE_BANDIT2 0x0008 /* Bandit Host-PCI Bridge */
+#define PCI_PRODUCT_APPLE_HEATHROW 0x0010 /* MAC-IO I/O Controller (Heathrow) */
+#define PCI_PRODUCT_APPLE_PADDINGTON 0x0017 /* MAC-IO I/O Controller (Paddington) */
+#define PCI_PRODUCT_APPLE_KEYLARGO_USB 0x0019 /* KeyLargo USB Controller */
+#define PCI_PRODUCT_APPLE_UNINORTH1 0x001e /* UniNorth Host-PCI Bridge */
+#define PCI_PRODUCT_APPLE_UNINORTH2 0x001f /* UniNorth Host-PCI Bridge */
+#define PCI_PRODUCT_APPLE_UNINORTH_AGP 0x0020 /* UniNorth AGP Interface */
+#define PCI_PRODUCT_APPLE_GMAC 0x0021 /* GMAC Ethernet */
+#define PCI_PRODUCT_APPLE_KEYLARGO 0x0022 /* MAC-IO I/O Controller (KeyLargo) */
+
+/* ARC Logic products */
+#define PCI_PRODUCT_ARC_1000PV 0xa091 /* 1000PV */
+#define PCI_PRODUCT_ARC_2000PV 0xa099 /* 2000PV */
+#define PCI_PRODUCT_ARC_2000MT 0xa0a1 /* 2000MT */
+
+/* ASIX Electronics products */
+#define PCI_PRODUCT_ASIX_AX88140A 0x1400 /* AX88140A 10/100 Ethernet */
+
+/* ATI products */
+#define PCI_PRODUCT_ATI_MACH32 0x4158 /* Mach32 */
+#define PCI_PRODUCT_ATI_MACH64_CT 0x4354 /* Mach64 CT */
+#define PCI_PRODUCT_ATI_MACH64_CX 0x4358 /* Mach64 CX */
+#define PCI_PRODUCT_ATI_MACH64_ET 0x4554 /* Mach64 ET */
+#define PCI_PRODUCT_ATI_MACH64_VT 0x4654 /* Mach64 VT */
+#define PCI_PRODUCT_ATI_MACH64_B 0x4750 /* Mach64 B */
+#define PCI_PRODUCT_ATI_MACH64_GB 0x4742 /* Mach64 GB */
+#define PCI_PRODUCT_ATI_MACH64_GD 0x4744 /* Mach64 GD */
+#define PCI_PRODUCT_ATI_MACH64_GI 0x4749 /* Mach64 GI */
+#define PCI_PRODUCT_ATI_MACH64_GP 0x4750 /* Mach64 GP */
+#define PCI_PRODUCT_ATI_MACH64_GQ 0x4751 /* Mach64 GQ */
+#define PCI_PRODUCT_ATI_MACH64_GT 0x4754 /* Mach64 GT */
+#define PCI_PRODUCT_ATI_MACH64_GU 0x4755 /* Mach64 GU */
+#define PCI_PRODUCT_ATI_MACH64_GV 0x4756 /* Mach64 GV */
+#define PCI_PRODUCT_ATI_MACH64_GW 0x4757 /* Mach64 GW */
+#define PCI_PRODUCT_ATI_MACH64_GX 0x4758 /* Mach64 GX */
+#define PCI_PRODUCT_ATI_MACH64_GZ 0x475a /* Mach64 GZ */
+#define PCI_PRODUCT_ATI_MACH64_LB 0x4c42 /* Mach64 LB */
+#define PCI_PRODUCT_ATI_MACH64_LD 0x4c44 /* Mach64 LD */
+#define PCI_PRODUCT_ATI_MACH64_LG 0x4c47 /* Mach64 LG */
+#define PCI_PRODUCT_ATI_MACH64_LI 0x4c49 /* Mach64 LI */
+#define PCI_PRODUCT_ATI_MACH64_LM 0x4c4d /* Mach64 LM */
+#define PCI_PRODUCT_ATI_MACH64_LP 0x4c50 /* Mach64 LP */
+#define PCI_PRODUCT_ATI_MACH64_LR 0x4c52 /* Mach64 LR */
+
+/* Auravision products */
+#define PCI_PRODUCT_AURAVISION_VXP524 0x01f7 /* VxP524 PCI Video Processor */
+
+/* Aureal Semiconductor */
+#define PCI_PRODUCT_AUREAL_AU8820 0x0001 /* AU8820 Vortex Digital Audio Processor */
+
+/* Applied Micro Circuts products */
+#define PCI_PRODUCT_AMCIRCUITS_S5933 0x4750 /* S5933 PCI Matchmaker */
+#define PCI_PRODUCT_AMCIRCUITS_LANAI 0x8043 /* Myrinet LANai Interface */
+#define PCI_PRODUCT_AMCIRCUITS_S5920 0x5920 /* S5920 PCI Target */
+
+/* Atronics products */
+#define PCI_PRODUCT_ATRONICS_IDE_2015PL 0x2015 /* IDE-2015PL */
+
+/* Avance Logic products */
+#define PCI_PRODUCT_AVANCE_AVL2301 0x2301 /* AVL2301 */
+#define PCI_PRODUCT_AVANCE_AVG2302 0x2302 /* AVG2302 */
+#define PCI_PRODUCT_AVANCE2_ALG2301 0x2301 /* ALG2301 */
+#define PCI_PRODUCT_AVANCE2_ALG2302 0x2302 /* ALG2302 */
+
+/* CCUBE products */
+#define PCI_PRODUCT_CCUBE_CINEMASTER 0x8888 /* Cinemaster C 3.0 DVD Decoder */
+
+/* AVM products */
+#define PCI_PRODUCT_AVM_FRITZ_CARD 0x0a00 /* Fritz! Card ISDN Interface */
+
+/* Bit3 products */
+#define PCI_PRODUCT_BIT3_PCIVME617 0x0001 /* PCI-VME Interface Mod. 617 */
+#define PCI_PRODUCT_BIT3_PCIVME618 0x0010 /* PCI-VME Interface Mod. 618 */
+#define PCI_PRODUCT_BIT3_PCIVME2706 0x0300 /* PCI-VME Interface Mod. 2706 */
+
+/* Broadcom products */
+#define PCI_PRODUCT_BROADCOM_BCM4211 0x4211 /* BCM4211 iLine10 Controller */
+#define PCI_PRODUCT_BROADCOM_BCM4212 0x4212 /* BCM4212 V.90 Modem */
+#define PCI_PRODUCT_BROADCOM_BCM5700 0x1644 /* BCM5700 10/100/1000 Ethernet */
+#define PCI_PRODUCT_BROADCOM_BCM5701 0x1645 /* BCM5701 10/100/1000 Ethernet */
+#define PCI_PRODUCT_BROADCOM_BCM5702 0x16a6 /* BCM5702 10/100/1000 Ethernet */
+#define PCI_PRODUCT_BROADCOM_BCM5703 0x16a7 /* BCM5703 10/100/1000 Ethernet */
+#define PCI_PRODUCT_BROADCOM_BCM5705 0x1653 /* BCM5705 10/100/1000 Ethernet */
+#define PCI_PRODUCT_BROADCOM_BCM5820 0x5820 /* BCM5820 eCommerce Processor */
+#define PCI_PRODUCT_BROADCOM_BCM5821 0x5821 /* BCM5821 Super-eCommerce Processor */
+#define PCI_PRODUCT_BROADCOM_BCM5850 0x5850 /* BCM5850 SSL/TLS Protocol Processor */
+
+/* Brooktree products */
+#define PCI_PRODUCT_BROOKTREE_BT848 0x0350 /* Bt848 Video Capture */
+#define PCI_PRODUCT_BROOKTREE_BT849 0x0351 /* Bt849 Video Capture */
+#define PCI_PRODUCT_BROOKTREE_BT878 0x036e /* Bt878 Video Capture */
+#define PCI_PRODUCT_BROOKTREE_BT879 0x036f /* Bt879 Video Capture */
+
+/* BusLogic products */
+#define PCI_PRODUCT_BUSLOGIC_MULTIMASTER_NC 0x0140 /* MultiMaster NC */
+#define PCI_PRODUCT_BUSLOGIC_MULTIMASTER 0x1040 /* MultiMaster */
+#define PCI_PRODUCT_BUSLOGIC_FLASHPOINT 0x8130 /* FlashPoint */
+
+/* c't Magazin products */
+#define PCI_PRODUCT_C4T_GPPCI 0x6773 /* GPPCI */
+
+/* Chips and Technologies products */
+#define PCI_PRODUCT_CHIPS_64310 0x00b8 /* 64310 */
+#define PCI_PRODUCT_CHIPS_65545 0x00d8 /* 65545 */
+#define PCI_PRODUCT_CHIPS_65548 0x00dc /* 65548 */
+#define PCI_PRODUCT_CHIPS_65550 0x00e0 /* 65550 */
+#define PCI_PRODUCT_CHIPS_65554 0x00e4 /* 65554 */
+
+/* Cirrus Logic products */
+#define PCI_PRODUCT_CIRRUS_CL_GD7548 0x0038 /* CL-GD7548 */
+#define PCI_PRODUCT_CIRRUS_CL_GD5430 0x00a0 /* CL-GD5430 */
+#define PCI_PRODUCT_CIRRUS_CL_GD5434_4 0x00a4 /* CL-GD5434-4 */
+#define PCI_PRODUCT_CIRRUS_CL_GD5434_8 0x00a8 /* CL-GD5434-8 */
+#define PCI_PRODUCT_CIRRUS_CL_GD5436 0x00ac /* CL-GD5436 */
+#define PCI_PRODUCT_CIRRUS_CL_GD5446 0x00b8 /* CL-GD5446 */
+#define PCI_PRODUCT_CIRRUS_CL_GD5480 0x00bc /* CL-GD5480 */
+#define PCI_PRODUCT_CIRRUS_CL_PD6729 0x1100 /* CL-PD6729 */
+#define PCI_PRODUCT_CIRRUS_CL_PD6832 0x1110 /* CL-PD6832 PCI-CardBus Bridge */
+#define PCI_PRODUCT_CIRRUS_CL_PD6833 0x1113 /* CL-PD6833 PCI-CardBus Bridge */
+#define PCI_PRODUCT_CIRRUS_CL_GD7542 0x1200 /* CL-GD7542 */
+#define PCI_PRODUCT_CIRRUS_CL_GD7543 0x1202 /* CL-GD7543 */
+#define PCI_PRODUCT_CIRRUS_CL_GD7541 0x1204 /* CL-GD7541 */
+#define PCI_PRODUCT_CIRRUS_CL_CD4400 0x4400 /* CL-CD4400 Communications Controller */
+#define PCI_PRODUCT_CIRRUS_CS4610 0x6001 /* CS4610 SoundFusion Audio Accelerator */
+#define PCI_PRODUCT_CIRRUS_CS4280 0x6003 /* CS4280 CrystalClear Audio Interface */
+
+/* CMD Technology products -- info gleaned from their web site */
+#define PCI_PRODUCT_CMDTECH_640 0x0640 /* PCI0640 */
+/* No data on the CMD Tech. web site for the following as of Mar. 3 '98 */
+#define PCI_PRODUCT_CMDTECH_642 0x0642 /* PCI0642 */
+/* datasheets available from www.cmd.com for the followings */
+#define PCI_PRODUCT_CMDTECH_643 0x0643 /* PCI0643 */
+#define PCI_PRODUCT_CMDTECH_646 0x0646 /* PCI0646 */
+#define PCI_PRODUCT_CMDTECH_647 0x0647 /* PCI0647 */
+#define PCI_PRODUCT_CMDTECH_648 0x0648 /* PCI0648 */
+#define PCI_PRODUCT_CMDTECH_649 0x0649 /* PCI0649 */
+
+/* Inclusion of 'A' in the following entry is probably wrong. */
+/* No data on the CMD Tech. web site for the following as of Mar. 3 '98 */
+#define PCI_PRODUCT_CMDTECH_650A 0x0650 /* PCI0650A */
+#define PCI_PRODUCT_CMDTECH_670 0x0670 /* USB0670 */
+#define PCI_PRODUCT_CMDTECH_673 0x0673 /* USB0673 */
+
+/* C-Media products */
+#define PCI_PRODUCT_CMEDIA_CMI8338A 0x0100 /* CMI8338A PCI Audio Device */
+#define PCI_PRODUCT_CMEDIA_CMI8338B 0x0101 /* CMI8338B PCI Audio Device */
+#define PCI_PRODUCT_CMEDIA_CMI8738 0x0111 /* CMI8738/C3DX PCI Audio Device */
+#define PCI_PRODUCT_CMEDIA_HSP56 0x0211 /* HSP56 Audiomodem Riser */
+
+/* Cogent Data Technologies products */
+#define PCI_PRODUCT_COGENT_EM110TX 0x1400 /* EX110TX PCI Fast Ethernet Adapter */
+
+/* Compaq products */
+#define PCI_PRODUCT_COMPAQ_PCI_EISA_BRIDGE 0x0001 /* PCI-EISA Bridge */
+#define PCI_PRODUCT_COMPAQ_PCI_ISA_BRIDGE 0x0002 /* PCI-ISA Bridge */
+#define PCI_PRODUCT_COMPAQ_TRIFLEX1 0x1000 /* Triflex Host-PCI Bridge */
+#define PCI_PRODUCT_COMPAQ_TRIFLEX2 0x2000 /* Triflex Host-PCI Bridge */
+#define PCI_PRODUCT_COMPAQ_QVISION_V0 0x3032 /* QVision */
+#define PCI_PRODUCT_COMPAQ_QVISION_1280P 0x3033 /* QVision 1280/p */
+#define PCI_PRODUCT_COMPAQ_QVISION_V2 0x3034 /* QVision */
+#define PCI_PRODUCT_COMPAQ_TRIFLEX4 0x4000 /* Triflex Host-PCI Bridge */
+#define PCI_PRODUCT_COMPAQ_USB 0x7020 /* USB Controller */
+#define PCI_PRODUCT_COMPAQ_SMART2P 0xae10 /* SMART2P RAID */
+#define PCI_PRODUCT_COMPAQ_N100TX 0xae32 /* Netelligent 10/100 TX */
+#define PCI_PRODUCT_COMPAQ_N10T 0xae34 /* Netelligent 10 T */
+#define PCI_PRODUCT_COMPAQ_IntNF3P 0xae35 /* Integrated NetFlex 3/P */
+#define PCI_PRODUCT_COMPAQ_DPNet100TX 0xae40 /* Dual Port Netelligent 10/100 TX */
+#define PCI_PRODUCT_COMPAQ_IntPL100TX 0xae43 /* ProLiant Integrated Netelligent 10/100 TX */
+#define PCI_PRODUCT_COMPAQ_DP4000 0xb011 /* Deskpro 4000 5233MMX */
+#define PCI_PRODUCT_COMPAQ_NF3P_BNC 0xf150 /* NetFlex 3/P w/ BNC */
+#define PCI_PRODUCT_COMPAQ_NF3P 0xf130 /* NetFlex 3/P */
+
+/* Compex products - XXX better descriptions */
+#define PCI_PRODUCT_COMPEX_NE2KETHER 0x1401 /* Ethernet */
+#define PCI_PRODUCT_COMPEX_RL100ATX 0x2011 /* RL100-ATX 10/100 Ethernet */
+#define PCI_PRODUCT_COMPEX_RL100TX 0x9881 /* RL100-TX 10/100 Ethernet */
+
+/* Conexant Systems products */
+#define PCI_PRODUCT_CONEXANT_SOFTK56 0x2443 /* SoftK56 PCI Software Modem */
+
+/* Contaq Microsystems products */
+#define PCI_PRODUCT_CONTAQ_82C599 0x0600 /* 82C599 PCI-VLB Bridge */
+#define PCI_PRODUCT_CONTAQ_82C693 0xc693 /* 82C693 PCI-ISA Bridge */
+
+/* Corollary Products */
+#define PCI_PRODUCT_COROLLARY_CBUSII_PCIB 0x0014 /* \"C-Bus II\"-PCI Bridge */
+
+/* Creative Labs products */
+#define PCI_PRODUCT_CREATIVELABS_SBLIVE 0x0002 /* SBLive! EMU 10000 */
+#define PCI_PRODUCT_CREATIVELABS_SBJOY 0x7002 /* PCI Gameport Joystick */
+#define PCI_PRODUCT_CREATIVELABS_EV1938 0x8938 /* Ectiva 1938 */
+
+/* Cyclades products */
+#define PCI_PRODUCT_CYCLADES_CYCLOMY_1 0x0100 /* Cyclom-Y below 1M */
+#define PCI_PRODUCT_CYCLADES_CYCLOMY_2 0x0101 /* Cyclom-Y above 1M */
+#define PCI_PRODUCT_CYCLADES_CYCLOM4Y_1 0x0102 /* Cyclom-4Y below 1M */
+#define PCI_PRODUCT_CYCLADES_CYCLOM4Y_2 0x0103 /* Cyclom-4Y above 1M */
+#define PCI_PRODUCT_CYCLADES_CYCLOM8Y_1 0x0104 /* Cyclom-8Y below 1M */
+#define PCI_PRODUCT_CYCLADES_CYCLOM8Y_2 0x0105 /* Cyclom-8Y above 1M */
+#define PCI_PRODUCT_CYCLADES_CYCLOMZ_1 0x0200 /* Cyclom-Z below 1M */
+#define PCI_PRODUCT_CYCLADES_CYCLOMZ_2 0x0201 /* Cyclom-Z above 1M */
+
+/* Davicom Semiconductor products */
+#define PCI_PRODUCT_DAVICOM_DM9102 0x9102 /* Davicom DM9102 10/100 Ethernet */
+
+/* DEC products */
+#define PCI_PRODUCT_DEC_21050 0x0001 /* DECchip 21050 PCI-PCI Bridge */
+#define PCI_PRODUCT_DEC_21040 0x0002 /* DECchip 21040 Ethernet */
+#define PCI_PRODUCT_DEC_21030 0x0004 /* DECchip 21030 (\"TGA\") */
+#define PCI_PRODUCT_DEC_NVRAM 0x0007 /* Zephyr NV-RAM */
+#define PCI_PRODUCT_DEC_KZPSA 0x0008 /* KZPSA */
+#define PCI_PRODUCT_DEC_21140 0x0009 /* DECchip 21140 10/100 Ethernet */
+#define PCI_PRODUCT_DEC_PBXGB 0x000d /* TGA2 */
+#define PCI_PRODUCT_DEC_DEFPA 0x000f /* DEFPA */
+/* product DEC ??? 0x0010 ??? VME Interface */
+#define PCI_PRODUCT_DEC_21041 0x0014 /* DECchip 21041 Ethernet */
+#define PCI_PRODUCT_DEC_DGLPB 0x0016 /* DGLPB (\"OPPO\") */
+#define PCI_PRODUCT_DEC_21142 0x0019 /* DECchip 21142/21143 10/100 Ethernet */
+#define PCI_PRODUCT_DEC_21052 0x0021 /* DECchip 21052 PCI-PCI Bridge */
+#define PCI_PRODUCT_DEC_21150 0x0022 /* DECchip 21150 PCI-PCI Bridge */
+#define PCI_PRODUCT_DEC_21152 0x0024 /* DECchip 21152 PCI-PCI Bridge */
+#define PCI_PRODUCT_DEC_21153 0x0025 /* DECchip 21153 PCI-PCI Bridge */
+#define PCI_PRODUCT_DEC_21154 0x0026 /* DECchip 21154 PCI-PCI Bridge */
+#define PCI_PRODUCT_DEC_CPQ42XX 0x0046 /* Compaq SMART RAID 42xx */
+
+/* Delta products */
+#define PCI_PRODUCT_DELTA_8139 0x1360 /* 8139 Ethernet */
+
+/* Diamond products */
+#define PCI_PRODUCT_DIAMOND_VIPER 0x9001 /* Viper/PCI */
+
+/* D-Link Systems products */
+#define PCI_PRODUCT_DLINK_DFE550TX 0x1002 /* DFE-550TX 10/100 Ethernet */
+
+/* Distributed Processing Technology products */
+#define PCI_PRODUCT_DPT_SC_RAID 0xa400 /* SmartCache/SmartRAID */
+#define PCI_PRODUCT_DPT_RAID_I2O 0xa501 /* SmartRAID (I2O) */
+#define PCI_PRODUCT_DPT_MEMCTLR 0x1012 /* Memory Controller */
+
+/* Dolphin products */
+#define PCI_PRODUCT_DOLPHIN_PCISCI 0x0658 /* PCI-SCI Bridge */
+
+/* Domex products */
+#define PCI_PRODUCT_DOMEX_PCISCSI 0x0001 /* DMX-3191D */
+
+/* ELSA products */
+#define PCI_PRODUCT_ELSA_QS1PCI 0x1000 /* QuickStep 1000 ISDN card */
+
+/* Emulex products */
+#define PCI_PRODUCT_EMULEX_LPPFC 0x10df /* \"Light Pulse\" FibreChannel adapter */
+
+/* Ensoniq products */
+#define PCI_PRODUCT_ENSONIQ_AUDIOPCI 0x5000 /* AudioPCI */
+#define PCI_PRODUCT_ENSONIQ_AUDIOPCI97 0x1371 /* AudioPCI 97 */
+#define PCI_PRODUCT_ENSONIQ_CT5880 0x5880 /* CT5880 */
+
+/* Epigram (now Broadcom) products */
+#define PCI_PRODUCT_EPIGRAM_BCM4210 0xa0fa /* BCM4210 iLine10 Controller */
+
+/* Essential Communications products */
+#define PCI_PRODUCT_ESSENTIAL_RR_HIPPI 0x0001 /* RoadRunner HIPPI Interface */
+#define PCI_PRODUCT_ESSENTIAL_RR_GIGE 0x0005 /* RoadRunner Gig-E Interface */
+
+/* ESS Technology Inc products */
+#define PCI_PRODUCT_ESSTECH_MAESTRO1 0x0100 /* Maestro 1 PCI Audio Accelerator */
+#define PCI_PRODUCT_ESSTECH_MAESTRO2 0x1968 /* Maestro 2 PCI Audio Accelerator */
+#define PCI_PRODUCT_ESSTECH_SOLO1 0x1969 /* Solo-1 PCI AudioDrive */
+#define PCI_PRODUCT_ESSTECH_MAESTRO2E 0x1978 /* Maestro 2E PCI Audio Accelerator */
+#define PCI_PRODUCT_ESSTECH_MAESTRO3 0x1998 /* Maestro 3 PCI Audio Accelerator */
+#define PCI_PRODUCT_ESSTECH_MAESTRO3MODEM 0x1999 /* Maestro 3 Modem */
+
+/* ESS Technology Inc products */
+#define PCI_PRODUCT_ESSTECH2_MAESTRO1 0x0100 /* Maestro 1 PCI Audio Accelerator */
+
+/* O2 Micro Inc */
+#define PCI_PRODUCT_O2MICRO_OZ6832 0x6832 /* OZ6832 CardBus Controller */
+
+/* Evans & Sutherland products */
+#define PCI_PRODUCT_ES_FREEDOM 0x0001 /* Freedom PCI-GBus Interface */
+
+/* FORE products */
+#define PCI_PRODUCT_FORE_PCA200 0x0210 /* ATM PCA-200 */
+#define PCI_PRODUCT_FORE_PCA200E 0x0300 /* ATM PCA-200e */
+
+/* Forte Media products */
+#define PCI_PRODUCT_FORTEMEDIA_FM801 0x0801 /* Forte Media 801 Sound */
+
+/* Future Domain products */
+#define PCI_PRODUCT_FUTUREDOMAIN_TMC_18C30 0x0000 /* TMC-18C30 (36C70) */
+
+/* Efficient Networks products */
+#define PCI_PRODUCT_EFFICIENTNETS_ENI155PF 0x0000 /* 155P-MF1 ATM (FPGA) */
+#define PCI_PRODUCT_EFFICIENTNETS_ENI155PA 0x0002 /* 155P-MF1 ATM (ASIC) */
+#define PCI_PRODUCT_EFFICIENTNETS_ENI25P 0x0003 /* SpeedStream ENI-25p */
+#define PCI_PRODUCT_EFFICIENTNETS_SS3000 0x0005 /* SpeedStream 3000 */
+
+/* Galileo Technology products */
+#define PCI_PRODUCT_GALILEO_GT64010A 0x0146 /* GT-64010A System Controller */
+#define PCI_PRODUCT_GALILEO_GT64115 0x4111 /* GT-64115 System Controller */
+#define PCI_PRODUCT_GALILEO_GT64011 0x4146 /* GT-64011 System Controller */
+#define PCI_PRODUCT_GALILEO_GT64120 0x4620 /* GT-64120 System Controller */
+#define PCI_PRODUCT_GALILEO_GT64130 0x6320 /* GT-64130 System Controller */
+
+/* Hewlett-Packard products */
+#define PCI_PRODUCT_HP_J2585A 0x1030 /* J2585A */
+
+/* IBM products */
+#define PCI_PRODUCT_IBM_MCABRIDGE 0x0002 /* MCA Bridge */
+#define PCI_PRODUCT_IBM_ALTALITE 0x0005 /* CPU Bridge - Alta Lite */
+#define PCI_PRODUCT_IBM_ALTAMP 0x0007 /* CPU Bridge - Alta MP */
+#define PCI_PRODUCT_IBM_ISABRIDGE 0x000a /* ISA Bridge w/PnP */
+#define PCI_PRODUCT_IBM_CPUBRIDGE 0x0017 /* CPU Bridge */
+#define PCI_PRODUCT_IBM_LANSTREAMER 0x0018 /* Auto LANStreamer */
+#define PCI_PRODUCT_IBM_GXT150P 0x001b /* GXT-150P 2D Accelerator */
+#define PCI_PRODUCT_IBM_MCABRIDGE2 0x0020 /* MCA Bridge */
+#define PCI_PRODUCT_IBM_82351 0x0022 /* 82351 PCI-PCI Bridge */
+#define PCI_PRODUCT_IBM_SERVERAID 0x002e /* ServeRAID */
+#define PCI_PRODUCT_IBM_OLYMPIC 0x003e /* Token Ring */
+#define PCI_PRODUCT_IBM_MIAMI 0x0036 /* Miami/PCI */
+#define PCI_PRODUCT_IBM_TURBOWAYS25 0x0053 /* Turboways 25 ATM */
+#define PCI_PRODUCT_IBM_MPIC2 0xffff /* MPIC-II */
+
+/* IDT products */
+#define PCI_PRODUCT_IDT_77201 0x0001 /* 77201/77211 ATM (\"NICStAR\") */
+
+/* Initio products */
+#define PCI_PRODUCT_INITIO_I920 0x0002 /* INIC-920 SCSI */
+#define PCI_PRODUCT_INITIO_I940 0x9400 /* INIC-940 SCSI */
+#define PCI_PRODUCT_INITIO_I935 0x9401 /* INIC-935 SCSI */
+#define PCI_PRODUCT_INITIO_I950 0x9500 /* INIC-950 SCSI */
+
+/* Integrated Micro Solutions products */
+#define PCI_PRODUCT_IMS_8849 0x8849 /* 8849 */
+#define PCI_PRODUCT_IMS_TT128M 0x9128 /* TwinTurbo 128M */
+
+/* Intel products */
+#define PCI_PRODUCT_INTEL_PCEB 0x0482 /* 82375EB/SB PCI-EISA Bridge (PCEB) */
+#define PCI_PRODUCT_INTEL_CDC 0x0483 /* 82424ZX Cache and DRAM controller (CDC) */
+#define PCI_PRODUCT_INTEL_SIO 0x0484 /* 82378ZB System I/O (SIO) */
+#define PCI_PRODUCT_INTEL_82426EX 0x0486 /* 82426EX PCI-to-ISA Bridge (PCIB) */
+#define PCI_PRODUCT_INTEL_PCMC 0x04a3 /* 82434LX/NX PCI, Cache and Memory Controller (PCMC) */
+#define PCI_PRODUCT_INTEL_IN_BUSINESS 0x1030 /* InBusiness Fast Ethernet LAN Controller */
+#define PCI_PRODUCT_INTEL_82559ER 0x1209 /* 82559ER Fast Ethernet LAN Controller */
+#define PCI_PRODUCT_INTEL_82092AA 0x1222 /* 82092AA IDE controller */
+#define PCI_PRODUCT_INTEL_SAA7116 0x1223 /* SAA7116 */
+#define PCI_PRODUCT_INTEL_82596 0x1226 /* 82596 LAN Controller */
+#define PCI_PRODUCT_INTEL_EEPRO100 0x1227 /* EE Pro 100 10/100 Fast Ethernet */
+#define PCI_PRODUCT_INTEL_EEPRO100S 0x1228 /* EE Pro 100 Smart 10/100 Fast Ethernet */
+#define PCI_PRODUCT_INTEL_82557 0x1229 /* 82557 Fast Ethernet LAN Controller */
+#define PCI_PRODUCT_INTEL_82437FX 0x122d /* 82437FX System Controller (TSC) */
+#define PCI_PRODUCT_INTEL_82371FB_ISA 0x122e /* 82371FB PCI-to-ISA Bridge (PIIX) */
+#define PCI_PRODUCT_INTEL_82371FB_IDE 0x1230 /* 82371FB IDE controller (PIIX) */
+#define PCI_PRODUCT_INTEL_82371MX 0x1234 /* 82371MX Mobile PCI I/O IDE Xcelerator (MPIIX) */
+#define PCI_PRODUCT_INTEL_82437MX 0x1235 /* 82437MX Mobile System Controller (MTSC) */
+#define PCI_PRODUCT_INTEL_82441FX 0x1237 /* 82441FX PCI and Memory Controller (PMC) */
+#define PCI_PRODUCT_INTEL_82380AB 0x123c /* 82380AB Mobile PCI-to-ISA Bridge (MISA) */
+#define PCI_PRODUCT_INTEL_82380FB 0x124b /* 82380FB Mobile PCI-to-PCI Bridge (MPCI2) */
+#define PCI_PRODUCT_INTEL_82439HX 0x1250 /* 82439HX System Controller (TXC) */
+#define PCI_PRODUCT_INTEL_82801AA_LPC 0x2410 /* 82801AA LPC Interface Bridge */
+#define PCI_PRODUCT_INTEL_82801AA_IDE 0x2411 /* 82801AA IDE Controller */
+#define PCI_PRODUCT_INTEL_82801AA_USB 0x2412 /* 82801AA USB Controller */
+#define PCI_PRODUCT_INTEL_82801AA_SMB 0x2413 /* 82801AA SMBus Controller */
+#define PCI_PRODUCT_INTEL_82801AA_ACA 0x2415 /* 82801AA AC-97 Audio Controller */
+#define PCI_PRODUCT_INTEL_82801AA_ACM 0x2416 /* 82801AA AC-97 PCI Modem */
+#define PCI_PRODUCT_INTEL_82801AA_HPB 0x2418 /* 82801AA Hub-to-PCI Bridge */
+#define PCI_PRODUCT_INTEL_82801AB_LPC 0x2420 /* 82801AB LPC Interface Bridge */
+#define PCI_PRODUCT_INTEL_82801AB_IDE 0x2421 /* 82801AB IDE Controller */
+#define PCI_PRODUCT_INTEL_82801AB_USB 0x2422 /* 82801AB USB Controller */
+#define PCI_PRODUCT_INTEL_82801AB_SMB 0x2423 /* 82801AB SMBus Controller */
+#define PCI_PRODUCT_INTEL_82801AB_ACA 0x2425 /* 82801AB AC-97 Audio Controller */
+#define PCI_PRODUCT_INTEL_82801AB_ACM 0x2426 /* 82801AB AC-97 PCI Modem */
+#define PCI_PRODUCT_INTEL_82801AB_HPB 0x2428 /* 82801AB Hub-to-PCI Bridge */
+#define PCI_PRODUCT_INTEL_82801BA_LPC 0x2440 /* 82801BA LPC Interface Bridge */
+#define PCI_PRODUCT_INTEL_82801BA_USB1 0x2442 /* 82801BA USB Controller */
+#define PCI_PRODUCT_INTEL_82801BA_SMB 0x2443 /* 82801BA SMBus Controller */
+#define PCI_PRODUCT_INTEL_82801BA_USB2 0x2444 /* 82801BA USB Controller */
+#define PCI_PRODUCT_INTEL_82801BA_ACA 0x2445 /* 82801BA AC-97 Audio Controller */
+#define PCI_PRODUCT_INTEL_82801BA_ACM 0x2446 /* 82801BA AC-97 PCI Modem */
+#define PCI_PRODUCT_INTEL_82801BA_LAN 0x2449 /* 82801BA LAN Controller */
+#define PCI_PRODUCT_INTEL_82801BA_IDE 0x244B /* 82801BA IDE Controller */
+#define PCI_PRODUCT_INTEL_82801BA_HPB 0x244E /* 82801BA Hub-to-PCI Bridge */
+#define PCI_PRODUCT_INTEL_82371SB_ISA 0x7000 /* 82371SB PCI-to-ISA Bridge (PIIX3) */
+#define PCI_PRODUCT_INTEL_82371SB_IDE 0x7010 /* 82371SB IDE Interface (PIIX3) */
+#define PCI_PRODUCT_INTEL_82371SB_USB 0x7020 /* 82371SB USB Host Controller (PIIX3) */
+#define PCI_PRODUCT_INTEL_82437VX 0x7030 /* 82437VX System Controller (TVX) */
+#define PCI_PRODUCT_INTEL_82439TX 0x7100 /* 82439TX System Controller (MTXC) */
+#define PCI_PRODUCT_INTEL_82371AB_ISA 0x7110 /* 82371AB PCI-to-ISA Bridge (PIIX4) */
+#define PCI_PRODUCT_INTEL_82371AB_IDE 0x7111 /* 82371AB IDE controller (PIIX4) */
+#define PCI_PRODUCT_INTEL_82371AB_USB 0x7112 /* 82371AB USB Host Controller (PIIX4) */
+#define PCI_PRODUCT_INTEL_82371AB_PMC 0x7113 /* 82371AB Power Management Controller (PIIX4) */
+#define PCI_PRODUCT_INTEL_82810_MCH 0x7120 /* 82810 Memory Controller Hub */
+#define PCI_PRODUCT_INTEL_82810_GC 0x7121 /* 82810 Graphics Controller */
+#define PCI_PRODUCT_INTEL_82810_DC100_MCH 0x7122 /* 82810-DC100 Memory Controller Hub */
+#define PCI_PRODUCT_INTEL_82810_DC100_GC 0x7123 /* 82810-DC100 Graphics Controller */
+#define PCI_PRODUCT_INTEL_82810E_MCH 0x7124 /* 82810E Memory Controller Hub */
+#define PCI_PRODUCT_INTEL_82810E_GC 0x7125 /* 82810E Graphics Controller */
+#define PCI_PRODUCT_INTEL_82443LX 0x7180 /* 82443LX PCI AGP Controller (PAC) */
+#define PCI_PRODUCT_INTEL_82443LX_AGP 0x7181 /* 82443LX AGP Interface (PAC) */
+#define PCI_PRODUCT_INTEL_82443BX 0x7190 /* 82443BX Host Bridge/Controller */
+#define PCI_PRODUCT_INTEL_82443BX_AGP 0x7191 /* 82443BX AGP Interface */
+#define PCI_PRODUCT_INTEL_82443BX_NOAGP 0x7192 /* 82443BX Host Bridge/Controller (AGP disabled) */
+#define PCI_PRODUCT_INTEL_82440MX 0x7194 /* 82440MX Host Bridge/Controller */
+#define PCI_PRODUCT_INTEL_82440MX_ACA 0x7195 /* 82440MX AC-97 Audio Controller */
+#define PCI_PRODUCT_INTEL_82440MX_ISA 0x7198 /* 82440MX PCI-to-ISA Bridge */
+#define PCI_PRODUCT_INTEL_82440MX_IDE 0x7199 /* 82440MX IDE Controller */
+#define PCI_PRODUCT_INTEL_82440MX_USB 0x719a /* 82440MX USB Host Controller */
+#define PCI_PRODUCT_INTEL_82440MX_PMC 0x719b /* 82440MX Power Management Controller */
+#define PCI_PRODUCT_INTEL_I740 0x7800 /* i740 Graphics Accelerator */
+#define PCI_PRODUCT_INTEL_PCI450_PB 0x84c4 /* 82454KX/GX PCI Bridge (PB) */
+#define PCI_PRODUCT_INTEL_PCI450_MC 0x84c5 /* 82451KX/GX Memory Controller (MC) */
+#define PCI_PRODUCT_INTEL_82451NX_MIOC 0x84ca /* 82451NX Memory & I/O Controller (MIOC) */
+#define PCI_PRODUCT_INTEL_82451NX_PXB 0x84cb /* 82451NX PCI Expander Bridge (PXB) */
+
+/* Intergraph products */
+#define PCI_PRODUCT_INTERGRAPH_4D50T 0x00e4 /* Powerstorm 4D50T */
+
+/* I. T. T. products */
+#define PCI_PRODUCT_ITT_AGX016 0x0001 /* AGX016 */
+#define PCI_PRODUCT_ITT_ITT3204 0x0002 /* ITT3204 MPEG Decoder */
+
+/* KTI products - XXX better descriptions */
+#define PCI_PRODUCT_KTI_NE2KETHER 0x3000 /* Ethernet */
+
+/* LAN Media Corporation */
+#define PCI_PRODUCT_LMC_HSSI 0x0003 /* HSSI Interface */
+#define PCI_PRODUCT_LMC_DS3 0x0004 /* DS3 Interface */
+#define PCI_PRODUCT_LMC_SSI 0x0005 /* SSI */
+
+/* LeadTek Research */
+#define PCI_PRODUCT_LEADTEK_S3_805 0x0000 /* S3 805 */
+
+/* Linear Systems / CompuModules */
+#define PCI_PRODUCT_LINEARSYS_DVB_TX 0x7629 /* DVB Transmitter */
+#define PCI_PRODUCT_LINEARSYS_DVB_RX 0x7630 /* DVB Receiver */
+
+/* Lite-On products */
+#define PCI_PRODUCT_LITEON_82C168 0x0002 /* 82C168/82C169 (PNIC) 10/100 Ethernet */
+#define PCI_PRODUCT_LITEON_82C115 0xc115 /* 82C115 (PNIC II) 10/100 Ethernet */
+
+/* Lucent products */
+#define PCI_PRODUCT_LUCENT_LTMODEM_0440 0x0440 /* K56flex DSVD LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_0441 0x0441 /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_0442 0x0442 /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_0443 0x0443 /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_0444 0x0444 /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_0445 0x0445 /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_0446 0x0446 /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_0447 0x0447 /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_0448 0x0448 /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_0449 0x0449 /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_044A 0x044A /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_044B 0x044B /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_044C 0x044C /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_044D 0x044D /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_044E 0x044E /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_0450 0x0450 /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_0451 0x0451 /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_0452 0x0452 /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_0453 0x0453 /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_0454 0x0454 /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_0455 0x0455 /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_0456 0x0456 /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_0457 0x0457 /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_0458 0x0458 /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_0459 0x0459 /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_LTMODEM_045A 0x045A /* LTMODEM */
+#define PCI_PRODUCT_LUCENT_USBHC 0x5801 /* USB Host Controller */
+
+/* Macronix */
+#define PCI_PRODUCT_MACRONIX_MX98713 0x0512 /* MX98713 (PMAC) 10/100 Ethernet */
+#define PCI_PRODUCT_MACRONIX_MX987x5 0x0531 /* MX987x5 (PMAC) 10/100 Ethernet */
+
+/* Madge Networks products */
+#define PCI_PRODUCT_MADGE_COLLAGE25 0x1000 /* Collage 25 ATM adapter */
+#define PCI_PRODUCT_MADGE_COLLAGE155 0x1001 /* Collage 155 ATM adapter */
+
+/* Matrox products */
+#define PCI_PRODUCT_MATROX_ATLAS 0x0518 /* MGA PX2085 (\"Atlas\") */
+#define PCI_PRODUCT_MATROX_MILLENNIUM 0x0519 /* MGA Millennium 2064W */
+#define PCI_PRODUCT_MATROX_MYSTIQUE 0x051a /* MGA Mystique 1064SG */
+#define PCI_PRODUCT_MATROX_MILLENNIUM2 0x051b /* MGA Millennium II 2164W */
+#define PCI_PRODUCT_MATROX_MILLENNIUM2_AGP 0x051f /* MGA Millennium II 2164WA-B AG */
+#define PCI_PRODUCT_MATROX_G200_PCI 0x0520 /* MGA G200 PCI */
+#define PCI_PRODUCT_MATROX_G200_AGP 0x0521 /* MGA G200 AGP */
+#define PCI_PRODUCT_MATROX_G400_AGP 0x0525 /* MGA G400 AGP */
+#define PCI_PRODUCT_MATROX_IMPRESSION 0x0d10 /* MGA Impression */
+#define PCI_PRODUCT_MATROX_G100_PCI 0x1000 /* MGA G100 PCI */
+#define PCI_PRODUCT_MATROX_G100_AGP 0x1001 /* MGA G100 AGP */
+
+/* Motorola products */
+#define PCI_PRODUCT_MOT_MPC105 0x0001 /* MPC105 \"Eagle\" Host Bridge */
+#define PCI_PRODUCT_MOT_MPC106 0x0002 /* MPC106 \"Grackle\" Host Bridge */
+
+/* Mylex products */
+#define PCI_PRODUCT_MYLEX_960P 0x0001 /* DAC960P RAID controller */
+
+/* Mutech products */
+#define PCI_PRODUCT_MUTECH_MV1000 0x0001 /* MV1000 */
+
+/* NetVin products - XXX better descriptions */
+#define PCI_PRODUCT_NETVIN_5000 0x5000 /* 5000 Ethernet */
+
+/* Newbridge / Tundra products */
+#define PCI_PRODUCT_NEWBRIDGE_CA91CX42 0x0000 /* Universe VME bridge */
+
+/* National Semiconductor products */
+#define PCI_PRODUCT_NS_DP83810 0x0001 /* DP83810 10/100 Ethernet */
+#define PCI_PRODUCT_NS_DP83815 0x0020 /* DP83815 10/100 Ethernet */
+#define PCI_PRODUCT_NS_NS87410 0xd001 /* NS87410 */
+
+/* NCR/Symbios Logic products */
+#define PCI_PRODUCT_SYMBIOS_810 0x0001 /* 53c810 */
+#define PCI_PRODUCT_SYMBIOS_820 0x0002 /* 53c820 */
+#define PCI_PRODUCT_SYMBIOS_825 0x0003 /* 53c825 */
+#define PCI_PRODUCT_SYMBIOS_815 0x0004 /* 53c815 */
+#define PCI_PRODUCT_SYMBIOS_810AP 0x0005 /* 53c810AP */
+#define PCI_PRODUCT_SYMBIOS_860 0x0006 /* 53c860 */
+#define PCI_PRODUCT_SYMBIOS_896 0x000b /* 53c896 */
+#define PCI_PRODUCT_SYMBIOS_895 0x000c /* 53c895 */
+#define PCI_PRODUCT_SYMBIOS_885 0x000d /* 53c885 */
+#define PCI_PRODUCT_SYMBIOS_875 0x000f /* 53c875 */
+#define PCI_PRODUCT_SYMBIOS_1510 0x0010 /* 53c1510 */
+#define PCI_PRODUCT_SYMBIOS_875J 0x008f /* 53c875J */
+
+/* Packet Engines products */
+#define PCI_PRODUCT_SYMBIOS_PE_GNIC 0x0702 /* Packet Engines G-NIC Ethernet */
+
+/* NEC products */
+#define PCI_PRODUCT_NEC_USB 0x0035 /* USB Host Controller */
+#define PCI_PRODUCT_NEC_POWERVR2 0x0046 /* PowerVR PCX2 */
+#define PCI_PRODUCT_NEC_PD72872 0x0063 /* uPD72872 IEEE 1394 OHCI Host Controller */
+#define PCI_PRODUCT_NEC_PD72870 0x00cd /* uPD72870 IEEE 1394 OHCI Host Controller */
+#define PCI_PRODUCT_NEC_PD72871 0x00ce /* uPD72871 IEEE 1394 OHCI Host Controller */
+
+/* Neomagic products */
+#define PCI_PRODUCT_NEOMAGIC_NMMG128ZV 0x0003 /* MagicGraph 128ZV */
+#define PCI_PRODUCT_NEOMAGIC_NMMG2160 0x0004 /* MagicGraph 128XD */
+#define PCI_PRODUCT_NEOMAGIC_NMMM256AV_VGA 0x0005 /* MagicMedia 256AV VGA */
+#define PCI_PRODUCT_NEOMAGIC_NMMM256ZX_VGA 0x0006 /* MagicMedia 256ZX VGA */
+#define PCI_PRODUCT_NEOMAGIC_NMMM256AV_AU 0x8005 /* MagicMedia 256AV Audio */
+#define PCI_PRODUCT_NEOMAGIC_NMMM256ZX_AU 0x8006 /* MagicMedia 256ZX Audio */
+
+/* Netgear products */
+#define PCI_PRODUCT_NETGEAR_GA620 0x620a /* GA620 Gigabit Ethernet */
+
+/* NexGen products */
+#define PCI_PRODUCT_NEXGEN_NX82C501 0x4e78 /* NX82C501 Host-PCI Bridge */
+
+/* NKK products */
+#define PCI_PRODUCT_NKK_NDR4600 0xA001 /* NDR4600 Host-PCI Bridge */
+
+/* Number Nine products */
+#define PCI_PRODUCT_NUMBER9_I128 0x2309 /* Imagine-128 */
+#define PCI_PRODUCT_NUMBER9_I128_2 0x2339 /* Imagine-128 II */
+
+/* Nvidia Corporationn products */
+#define PCI_PRODUCT_NVIDIA_RIVATNT 0x0020 /* RIVA TNT */
+#define PCI_PRODUCT_NVIDIA_RIVATNT2 0x0028 /* RIVA TNT2 */
+#define PCI_PRODUCT_NVIDIA_RIVATNT2U 0x0029 /* RIVA TNT2 Ultra */
+#define PCI_PRODUCT_NVIDIA_VANTA 0x002C /* Vanta */
+#define PCI_PRODUCT_NVIDIA_RIVATNT2M64 0x002D /* RIVA TNT2 Model 64 */
+#define PCI_PRODUCT_NVIDIA_ALADDINTNT2 0x00A0 /* Aladdin TNT2 */
+#define PCI_PRODUCT_NVIDIA_GEFORCE256 0x0100 /* GeForce 256 */
+#define PCI_PRODUCT_NVIDIA_GEFORCEDDR 0x0101 /* GeForce DDR */
+#define PCI_PRODUCT_NVIDIA_QUADRO 0x0103 /* Quadro */
+#define PCI_PRODUCT_NVIDIA_GEFORCE2 0x0150 /* GeForce2 GTS */
+#define PCI_PRODUCT_NVIDIA_GEFORCE2DDR 0x0151 /* GeForce2 GTS (DDR) */
+#define PCI_PRODUCT_NVIDIA_GEFORCE2BR 0x0152 /* GeForce2 GTS */
+#define PCI_PRODUCT_NVIDIA_QUADRO2 0x0153 /* Quadro2 */
+
+/* Nvidia Corporation & SGS Thomson Microelectric */
+#define PCI_PRODUCT_NVIDIA_SGS_RIVA128 0x0018 /* Riva 128 */
+
+/* Oak Technologies products */
+#define PCI_PRODUCT_OAKTECH_OTI1007 0x0107 /* OTI107 */
+
+/* Olicom products */
+#define PCI_PRODUCT_OLICOM_OC2183 0x0013 /* Olicom OC-2183/2185 Ethernet */
+#define PCI_PRODUCT_OLICOM_OC2325 0x0012 /* Olicom OC-2325 Ethernet */
+#define PCI_PRODUCT_OLICOM_OC2326 0x0014 /* Olicom OC-2326 10/100-TX Ethernet */
+
+/* Opti products */
+#define PCI_PRODUCT_OPTI_82C557 0xc557 /* 82C557 */
+#define PCI_PRODUCT_OPTI_82C558 0xc558 /* 82C558 */
+#define PCI_PRODUCT_OPTI_82C568 0xc568 /* 82C568 */
+#define PCI_PRODUCT_OPTI_82D568 0xd568 /* 82D568 */
+#define PCI_PRODUCT_OPTI_82C621 0xc621 /* 82C621 */
+#define PCI_PRODUCT_OPTI_82C822 0xc822 /* 82C822 */
+#define PCI_PRODUCT_OPTI_RM861HA 0xc861 /* RM861HA */
+#define PCI_PRODUCT_OPTI_82C700 0xc700 /* 82C700 */
+#define PCI_PRODUCT_OPTI_82C701 0xc701 /* 82C701 */
+
+/* PC Tech products */
+#define PCI_PRODUCT_PCTECH_RZ1000 0x1000 /* RZ1000 */
+
+/* PLX Technology products */
+#define PCI_PRODUCT_PLX_9060ES 0x906e /* 9060ES PCI bus controller */
+
+/* ProLAN products - XXX better descriptions */
+#define PCI_PRODUCT_PROLAN_NE2KETHER 0x1980 /* Ethernet */
+
+/* Promise products */
+#define PCI_PRODUCT_PROMISE_DC5030 0x5300 /* DC5030 */
+#define PCI_PRODUCT_PROMISE_ULTRA33 0x4d33 /* Ultra33/ATA Bus Master IDE Accelerator */
+#define PCI_PRODUCT_PROMISE_ULTRA66 0x4d38 /* Ultra66/ATA Bus Master IDE Accelerator */
+#define PCI_PRODUCT_PROMISE_ULTRA100 0x4d30 /* Ultra100/ATA Bus Master IDE Accelerator */
+
+/* QLogic products */
+#define PCI_PRODUCT_QLOGIC_ISP1020 0x1020 /* ISP1020 */
+#define PCI_PRODUCT_QLOGIC_ISP1022 0x1022 /* ISP1022 */
+#define PCI_PRODUCT_QLOGIC_ISP1080 0x1080 /* ISP1080 */
+#define PCI_PRODUCT_QLOGIC_ISP1240 0x1240 /* ISP1240 */
+#define PCI_PRODUCT_QLOGIC_ISP2100 0x2100 /* ISP2100 */
+
+/* Quantum Designs products */
+#define PCI_PRODUCT_QUANTUMDESIGNS_8500 0x0001 /* 8500 */
+#define PCI_PRODUCT_QUANTUMDESIGNS_8580 0x0002 /* 8580 */
+
+/* Realtek (Creative Labs?) products */
+#define PCI_PRODUCT_REALTEK_RT8029 0x8029 /* 8029 Ethernet */
+#define PCI_PRODUCT_REALTEK_RT8129 0x8129 /* 8129 10/100 Ethernet */
+#define PCI_PRODUCT_REALTEK_RT8139 0x8139 /* 8139 10/100 Ethernet */
+
+/* RICOH products */
+#define PCI_PRODUCT_RICOH_Rx5C465 0x0465 /* 5C465 PCI-CardBus bridge */
+#define PCI_PRODUCT_RICOH_Rx5C466 0x0466 /* 5C466 PCI-CardBus bridge */
+#define PCI_PRODUCT_RICOH_Rx5C475 0x0475 /* 5C475 PCI-CardBus bridge */
+#define PCI_PRODUCT_RICOH_RL5C476 0x0476 /* 5C476 PCI-CardBus bridge */
+#define PCI_PRODUCT_RICOH_Rx5C477 0x0477 /* 5C477 PCI-CardBus bridge */
+#define PCI_PRODUCT_RICOH_Rx5C478 0x0478 /* 5C478 PCI-CardBus bridge */
+
+/* RISCom (SDL Communications, Inc?) products */
+#define PCI_PRODUCT_RISCOM_N2 0x5568 /* N2 */
+
+/* RNS products */
+#define PCI_PRODUCT_RNS_FDDI 0x2200 /* 2200 FDDI */
+
+/* S3 products */
+#define PCI_PRODUCT_S3_VIRGE 0x5631 /* ViRGE */
+#define PCI_PRODUCT_S3_TRIO32 0x8810 /* Trio32 */
+#define PCI_PRODUCT_S3_TRIO64 0x8811 /* Trio32/64 */
+#define PCI_PRODUCT_S3_AURORA64P 0x8812 /* Aurora64V+ */
+#define PCI_PRODUCT_S3_TRIO64UVP 0x8814 /* Trio64UV+ */
+#define PCI_PRODUCT_S3_VIRGE_VX 0x883d /* ViRGE/VX */
+#define PCI_PRODUCT_S3_868 0x8880 /* 868 */
+#define PCI_PRODUCT_S3_928 0x88b0 /* 86C928 */
+#define PCI_PRODUCT_S3_864_0 0x88c0 /* 86C864-0 */
+#define PCI_PRODUCT_S3_864_1 0x88c1 /* 86C864-1 */
+#define PCI_PRODUCT_S3_864_2 0x88c2 /* 86C864-2 */
+#define PCI_PRODUCT_S3_864_3 0x88c3 /* 86C864-3 */
+#define PCI_PRODUCT_S3_964_0 0x88d0 /* 86C964-0 */
+#define PCI_PRODUCT_S3_964_1 0x88d1 /* 86C964-1 */
+#define PCI_PRODUCT_S3_964_2 0x88d2 /* 86C964-2 */
+#define PCI_PRODUCT_S3_964_3 0x88d3 /* 86C964-3 */
+#define PCI_PRODUCT_S3_968_0 0x88f0 /* 86C968-0 */
+#define PCI_PRODUCT_S3_968_1 0x88f1 /* 86C968-1 */
+#define PCI_PRODUCT_S3_968_2 0x88f2 /* 86C968-2 */
+#define PCI_PRODUCT_S3_968_3 0x88f3 /* 86C968-3 */
+#define PCI_PRODUCT_S3_TRIO64V2_DX 0x8901 /* Trio64V2/DX */
+#define PCI_PRODUCT_S3_PLATO_PX 0x8901 /* Plato/PX */
+#define PCI_PRODUCT_S3_TRIO3D 0x8904 /* 86C365 Trio3D */
+#define PCI_PRODUCT_S3_VIRGE_DX 0x8a01 /* ViRGE/DX */
+#define PCI_PRODUCT_S3_VIRGE_GX2 0x8a10 /* ViRGE/GX2 */
+#define PCI_PRODUCT_S3_TRIO3D2X 0x8a13 /* Trio3D/2X */
+#define PCI_PRODUCT_S3_SAVAGE3D 0x8a20 /* Savage3D */
+#define PCI_PRODUCT_S3_SAVAGE3D_MV 0x8a21 /* Savage3D+MV */
+#define PCI_PRODUCT_S3_SAVAGE4 0x8a22 /* Savage4 */
+#define PCI_PRODUCT_S3_VIRGE_MX 0x8c01 /* ViRGE/MX */
+#define PCI_PRODUCT_S3_VIRGE_MXP 0x8c03 /* ViRGE/MXP */
+#define PCI_PRODUCT_S3_SAVAGE_MX_MV 0x8c10 /* Savage/MX+MV */
+#define PCI_PRODUCT_S3_SAVAGE_MX 0x8c11 /* Savage/MX */
+#define PCI_PRODUCT_S3_SAVAGE_IX_MV 0x8c12 /* Savage/IX+MV */
+#define PCI_PRODUCT_S3_SAVAGE_IX 0x8c13 /* Savage/IX */
+#define PCI_PRODUCT_S3_SAVAGE2000 0x9102 /* Savage2000 */
+#define PCI_PRODUCT_S3_SONICVIBES 0xca00 /* SonicVibes */
+
+/* Samsung Semiconductor products */
+#define PCI_PRODUCT_SAMSUNGSEMI_KS8920 0x8920 /* KS8920 10/100 Ethernet */
+
+/* SGI products */
+#define PCI_PRODUCT_SGI_IOC3 0x0003 /* IOC3 */
+#define PCI_PRODUCT_SGI_RAD1 0x0005 /* PsiTech RAD1 */
+#define PCI_PRODUCT_SGI_TIGON 0x0009 /* Tigon Gigabit Ethernet */
+
+/* SGS Thomson products */
+#define PCI_PRODUCT_SGSTHOMSON_2000 0x0008 /* STG 2000X */
+#define PCI_PRODUCT_SGSTHOMSON_1764 0x1746 /* STG 1764X */
+
+/* SiByte, Inc. products */
+#define PCI_PRODUCT_SIBYTE_SB1250_PCI 0x0001 /* BCM1250 PCI Host Bridge */
+#define PCI_PRODUCT_SIBYTE_SB1250_LDT 0x0002 /* BCM1250 HyperTransport Host Bridge */
+
+/* Sigma Designs products */
+#define PCI_PRODUCT_SIGMA_HOLLYWOODPLUS 0x8300 /* REALmagic Hollywood-Plus MPEG-2 Decoder */
+
+/* Silicon Integrated System products */
+#define PCI_PRODUCT_SIS_86C201 0x0001 /* 86C201 */
+#define PCI_PRODUCT_SIS_86C202 0x0002 /* 86C202 */
+#define PCI_PRODUCT_SIS_86C205 0x0005 /* 86C205 */
+#define PCI_PRODUCT_SIS_85C503 0x0008 /* 85C503 or 5597/5598 ISA bridge */
+#define PCI_PRODUCT_SIS_600PMC 0x0009 /* 600 Power Mngmt Controller */
+#define PCI_PRODUCT_SIS_5597_VGA 0x0200 /* 5597/5598 integrated VGA */
+#define PCI_PRODUCT_SIS_85C501 0x0406 /* 85C501 */
+#define PCI_PRODUCT_SIS_85C496 0x0496 /* 85C496 */
+#define PCI_PRODUCT_SIS_530HB 0x0530 /* 530 Host to PCI Bridge */
+#define PCI_PRODUCT_SIS_85C601 0x0601 /* 85C601 */
+#define PCI_PRODUCT_SIS_900 0x0900 /* SiS 900 10/100 Ethernet */
+#define PCI_PRODUCT_SIS_5597_IDE 0x5513 /* 5597/5598 IDE controller */
+#define PCI_PRODUCT_SIS_5597_HB 0x5597 /* 5597/5598 host bridge */
+#define PCI_PRODUCT_SIS_530VGA 0x6306 /* 530 GUI Accelerator+3D */
+#define PCI_PRODUCT_SIS_6326 0x6326 /* 6326 AGP VGA */
+#define PCI_PRODUCT_SIS_5597_USB 0x7001 /* 5597/5598 USB host controller */
+#define PCI_PRODUCT_SIS_7016 0x7016 /* SiS 7016 10/100 Ethernet */
+
+/* Silicon Motion products */
+#define PCI_PRODUCT_SILMOTION_LYNX_E 0x0810 /* Lynx E */
+
+/* SMC products */
+#define PCI_PRODUCT_SMC_37C665 0x1000 /* FDC 37C665 */
+#define PCI_PRODUCT_SMC_37C922 0x1001 /* FDC 37C922 */
+#define PCI_PRODUCT_SMC_83C170 0x0005 /* 83C170 (\"EPIC/100\") Fast Ethernet */
+#define PCI_PRODUCT_SMC_83C175 0x0006 /* 83C175 (\"EPIC/100\") Fast Ethernet */
+
+/* Solidum Systems Corporation */
+#define PCI_PRODUCT_SOLIDUM_AMD971 0x2000 /* SNP8023: AMD 971 */
+#define PCI_PRODUCT_SOLIDUM_CLASS802 0x8023 /* SNP8023: Classifier Engine */
+
+/* Sony products */
+#define PCI_PRODUCT_SONY_CXD1947A 0x8009 /* CXD1947A IEEE 1394 Host Controller */
+#define PCI_PRODUCT_SONY_CXD32222 0x8039 /* CXD3222 OHCI IEEE 1394 Host Controller */
+#define PCI_PRODUCT_SONY_MEMSTICK 0x808a /* Memory Stick I/F Controller */
+
+/* Sun Microsystems products */
+#define PCI_PRODUCT_SUN_EBUS 0x1000 /* PCIO Ebus2 */
+#define PCI_PRODUCT_SUN_HMENETWORK 0x1001 /* PCIO Happy Meal Ethernet */
+#define PCI_PRODUCT_SUN_SIMBA 0x5000 /* Simba PCI bridge */
+#define PCI_PRODUCT_SUN_MS_IIep 0x9000 /* microSPARC IIep PCI */
+#define PCI_PRODUCT_SUN_US_IIi 0xa000 /* UltraSPARC IIi PCI */
+
+/* Sundance Technology products */
+#define PCI_PRODUCT_SUNDANCETI_ST201 0x0201 /* ST201 10/100 Ethernet */
+
+/* Surecom Technology products */
+#define PCI_PRODUCT_SURECOM_NE34 0x0e34 /* NE-34 Ethernet */
+
+/* Symphony Labs products */
+#define PCI_PRODUCT_SYMPHONY_82C101 0x0001 /* 82C101 */
+#define PCI_PRODUCT_SYMPHONY_82C103 0x0103 /* 82C103 */
+#define PCI_PRODUCT_SYMPHONY_82C105 0x0105 /* 82C105 */
+#define PCI_PRODUCT_SYMPHONY2_82C101 0x0001 /* 82C101 */
+#define PCI_PRODUCT_SYMPHONY_83C553 0x0565 /* 83C553 PCI-ISA Bridge */
+
+/* Schneider & Koch (really SysKonnect) products */
+#define PCI_PRODUCT_SCHNEIDERKOCH_SKNET_FDDI 0x4000 /* SK-NET FDDI-xP */
+
+/* Tekram Technology products (1st PCI Vendor ID)*/
+#define PCI_PRODUCT_TEKRAM_DC290 0xdc29 /* DC-290(M) */
+
+/* Tekram Technology products (2nd PCI Vendor ID) */
+#define PCI_PRODUCT_TEKRAM2_DC690C 0x690c /* DC-690C */
+
+/* Texas Instruments products */
+#define PCI_PRODUCT_TI_TLAN 0x0500 /* TLAN */
+#define PCI_PRODUCT_TI_TVP4020 0x3d07 /* TVP4020 Permedia 2 */
+#define PCI_PRODUCT_TI_TSB12LV21 0x8000 /* TSB12LV21 IEEE 1394 Host Controller */
+#define PCI_PRODUCT_TI_TSB12LV22 0x8009 /* TSB12LV22 OHCI IEEE 1394 Host Controller */
+#define PCI_PRODUCT_TI_TSB12LV23 0x8019 /* TSB12LV23 OHCI IEEE 1394 Host Controller */
+#define PCI_PRODUCT_TI_TSB12LV26 0x8020 /* TSB12LV26 OHCI IEEE 1394 Host Controller */
+#define PCI_PRODUCT_TI_PCI1130 0xac12 /* PCI1130 PCI-CardBus Bridge */
+#define PCI_PRODUCT_TI_PCI1031 0xac13 /* PCI1031 PCI-PCMCIA Bridge */
+#define PCI_PRODUCT_TI_PCI1131 0xac15 /* PCI1131 PCI-CardBus Bridge */
+#define PCI_PRODUCT_TI_PCI1250 0xac16 /* PCI1250 PCI-CardBus Bridge */
+#define PCI_PRODUCT_TI_PCI1220 0xac17 /* PCI1220 PCI-CardBus Bridge */
+#define PCI_PRODUCT_TI_PCI1221 0xac19 /* PCI1221 PCI-CardBus Bridge */
+#define PCI_PRODUCT_TI_PCI1450 0xac1b /* PCI1450 PCI-CardBus Bridge */
+#define PCI_PRODUCT_TI_PCI1225 0xac1c /* PCI1225 PCI-CardBus Bridge */
+#define PCI_PRODUCT_TI_PCI1251 0xac1d /* PCI1251 PCI-CardBus Bridge */
+#define PCI_PRODUCT_TI_PCI1211 0xac1e /* PCI1211 PCI-CardBus Bridge */
+#define PCI_PRODUCT_TI_PCI1251B 0xac1f /* PCI1251B PCI-CardBus Bridge */
+#define PCI_PRODUCT_TI_PCI2030 0xac20 /* PCI2030 PCI-PCI Bridge */
+#define PCI_PRODUCT_TI_PCI1420 0xac51 /* PCI1420 PCI-CardBus Bridge */
+#define PCI_PRODUCT_TI_PCI1451 0xac52 /* PCI1451 PCI-CardBus Bridge */
+
+/* Toshiba America products */
+#define PCI_PRODUCT_TOSHIBA_R4X00 0x0009 /* R4x00 Host-PCI Bridge */
+#define PCI_PRODUCT_TOSHIBA_TC35856F 0x0020 /* TC35856F ATM (\"Meteor\") */
+
+/* Toshiba America Info Systems products */
+#define PCI_PRODUCT_TOSHIBA2_HOST 0x0601 /* Host Bridge/Controller */
+#define PCI_PRODUCT_TOSHIBA2_ISA 0x0602 /* ISA Bridge */
+#define PCI_PRODUCT_TOSHIBA2_ToPIC95 0x0603 /* ToPIC95 CardBus-PCI Bridge */
+#define PCI_PRODUCT_TOSHIBA2_ToPIC95B 0x060a /* ToPIC95B CardBus-PCI Bridge */
+#define PCI_PRODUCT_TOSHIBA2_ToPIC97 0x060f /* ToPIC97 CardBus-PCI Bridge */
+#define PCI_PRODUCT_TOSHIBA2_ToPIC100 0x0617 /* ToPIC100 CardBus-PCI Bridge */
+#define PCI_PRODUCT_TOSHIBA2_FIRO 0x0701 /* Fast Infrared Type O */
+
+/* Trident products */
+#define PCI_PRODUCT_TRIDENT_CYBERBLADE_I7 0x8420 /* CyberBlade i7 */
+#define PCI_PRODUCT_TRIDENT_TGUI_9320 0x9320 /* TGUI 9320 */
+#define PCI_PRODUCT_TRIDENT_TGUI_9350 0x9350 /* TGUI 9350 */
+#define PCI_PRODUCT_TRIDENT_TGUI_9360 0x9360 /* TGUI 9360 */
+#define PCI_PRODUCT_TRIDENT_CYBER_9397 0x9397 /* CYBER 9397 */
+#define PCI_PRODUCT_TRIDENT_CYBER_9397DVD 0x939a /* CYBER 9397DVD */
+#define PCI_PRODUCT_TRIDENT_CYBER_9525 0x9525 /* CYBER 9525 */
+#define PCI_PRODUCT_TRIDENT_TGUI_9420 0x9420 /* TGUI 9420 */
+#define PCI_PRODUCT_TRIDENT_TGUI_9440 0x9440 /* TGUI 9440 */
+#define PCI_PRODUCT_TRIDENT_TGUI_9660 0x9660 /* TGUI 9660 */
+#define PCI_PRODUCT_TRIDENT_TGUI_9680 0x9680 /* TGUI 9680 */
+#define PCI_PRODUCT_TRIDENT_TGUI_9682 0x9682 /* TGUI 9682 */
+
+/* Triones Technologies products */
+/* The 366 and 370 controllers have the same product ID */
+#define PCI_PRODUCT_TRIONES_HPT366 0x0004 /* HPT366/370 IDE Controller */
+
+/* TriTech Microelectronics products*/
+#define PCI_PRODUCT_TRITECH_TR25202 0xfc02 /* Pyramid3D TR25202 */
+
+/* Tseng Labs products */
+#define PCI_PRODUCT_TSENG_ET4000_W32P_A 0x3202 /* ET4000w32p rev A */
+#define PCI_PRODUCT_TSENG_ET4000_W32P_B 0x3205 /* ET4000w32p rev B */
+#define PCI_PRODUCT_TSENG_ET4000_W32P_C 0x3206 /* ET4000w32p rev C */
+#define PCI_PRODUCT_TSENG_ET4000_W32P_D 0x3207 /* ET4000w32p rev D */
+#define PCI_PRODUCT_TSENG_ET6000 0x3208 /* ET6000 */
+
+/* UMC products */
+#define PCI_PRODUCT_UMC_UM82C881 0x0001 /* UM82C881 486 Chipset */
+#define PCI_PRODUCT_UMC_UM82C886 0x0002 /* UM82C886 ISA Bridge */
+#define PCI_PRODUCT_UMC_UM8673F 0x0101 /* UM8673F EIDE Controller */
+#define PCI_PRODUCT_UMC_UM8881 0x0881 /* UM8881 HB4 486 PCI Chipset */
+#define PCI_PRODUCT_UMC_UM82C891 0x0891 /* UM82C891 */
+#define PCI_PRODUCT_UMC_UM886A 0x1001 /* UM886A */
+#define PCI_PRODUCT_UMC_UM8886BF 0x673a /* UM8886BF */
+#define PCI_PRODUCT_UMC_UM8710 0x8710 /* UM8710 */
+#define PCI_PRODUCT_UMC_UM8886 0x886a /* UM8886 */
+#define PCI_PRODUCT_UMC_UM8881F 0x8881 /* UM8881F PCI-Host bridge */
+#define PCI_PRODUCT_UMC_UM8886F 0x8886 /* UM8886F PCI-ISA bridge */
+#define PCI_PRODUCT_UMC_UM8886A 0x888a /* UM8886A */
+#define PCI_PRODUCT_UMC_UM8891A 0x8891 /* UM8891A */
+#define PCI_PRODUCT_UMC_UM9017F 0x9017 /* UM9017F */
+#define PCI_PRODUCT_UMC_UM8886N 0xe88a /* UM8886N */
+#define PCI_PRODUCT_UMC_UM8891N 0xe891 /* UM8891N */
+
+/* ULSI Systems products */
+#define PCI_PRODUCT_ULSI_US201 0x0201 /* US201 */
+
+/* US Robotics products */
+#define PCI_PRODUCT_USR_3CP5609 0x1008 /* 3CP5609 PCI 16550 Modem */
+
+/* V3 Semiconductor products */
+#define PCI_PRODUCT_V3_V292PBC 0x0292 /* V292PBC AMD290x0 Host-PCI Bridge */
+#define PCI_PRODUCT_V3_V960PBC 0x0960 /* V960PBC i960 Host-PCI Bridge */
+#define PCI_PRODUCT_V3_V96DPC 0xC960 /* V96DPC i960 (Dual) Host-PCI Bridge */
+
+/* VIA Technologies products, from http://www.via.com.tw/ */
+#define PCI_PRODUCT_VIATECH_VT8371_HB 0x0391 /* VT8371 (Apollo KX133) Host Bridge */
+#define PCI_PRODUCT_VIATECH_VT8501_MVP4 0x0501 /* VT8501 MVP4 System Controller */
+#define PCI_PRODUCT_VIATECH_VT82C505 0x0505 /* VT82C505 (Pluto) */
+#define PCI_PRODUCT_VIATECH_VT82C561 0x0561 /* VT82C561 */
+#define PCI_PRODUCT_VIATECH_VT82C586A_IDE 0x0571 /* VT82C586A IDE Controller */
+#define PCI_PRODUCT_VIATECH_VT82C576 0x0576 /* VT82C576 3V */
+#define PCI_PRODUCT_VIATECH_VT82C580VP 0x0585 /* VT82C580 (Apollo VP) Host-PCI Bridge */
+#define PCI_PRODUCT_VIATECH_VT82C586_ISA 0x0586 /* VT82C586 (Apollo VP) PCI-ISA Bridge */
+#define PCI_PRODUCT_VIATECH_VT82C595 0x0595 /* VT82C595 (Apollo VP2) Host-PCI Bridge */
+#define PCI_PRODUCT_VIATECH_VT82C596A 0x0596 /* VT82C596A (Apollo Pro) PCI-ISA Bridge */
+#define PCI_PRODUCT_VIATECH_VT82C597 0x0597 /* VT82C597 (Apollo VP3) Host-PCI Bridge */
+#define PCI_PRODUCT_VIATECH_VT82C598PCI 0x0598 /* VT82C598 (Apollo MVP3) Host-PCI */
+#define PCI_PRODUCT_VIATECH_VT82C686A_ISA 0x0686 /* VT82C686A (Apollo KX133) PCI-ISA Bridge */
+#define PCI_PRODUCT_VIATECH_VT82C691 0x0691 /* VT82C691 (Apollo Pro) Host-PCI */
+#define PCI_PRODUCT_VIATECH_VT82C693 0x0693 /* VT82C693 (Apollo Pro Plus) Host-PCI */
+#define PCI_PRODUCT_VIATECH_VT86C926 0x0926 /* VT86C926 Amazon PCI-Ethernet Controller */
+#define PCI_PRODUCT_VIATECH_VT82C570M 0x1000 /* VT82C570M (Apollo) Host-PCI Bridge */
+#define PCI_PRODUCT_VIATECH_VT82C570MV 0x1006 /* VT82C570M (Apollo) PCI-ISA Bridge */
+#define PCI_PRODUCT_VIATECH_VT82C586_IDE 0x1571 /* VT82C586 (Apollo VP) IDE Controller */
+#define PCI_PRODUCT_VIATECH_VT82C595_2 0x1595 /* VT82C595 (Apollo VP2) Host-PCI Bridge */
+#define PCI_PRODUCT_VIATECH_VT83C572 0x3038 /* VT83C572 USB Controller */
+#define PCI_PRODUCT_VIATECH_VT82C586_PWR 0x3040 /* VT82C586 (Apollo VP) Power Management Controller */
+#define PCI_PRODUCT_VIATECH_VT3043 0x3043 /* VT3043 (Rhine) 10/100 Ethernet */
+#define PCI_PRODUCT_VIATECH_VT82C686A_SMB 0x3057 /* VT82C686A SMBus Controller */
+#define PCI_PRODUCT_VIATECH_VT82C686A_AC97 0x3058 /* VT82C686A AC-97 Audio Controller */
+#define PCI_PRODUCT_VIATECH_VT82C686A_MC97 0x3068 /* VT82C686A MC-97 Modem Controller */
+#define PCI_PRODUCT_VIATECH_VT86C100A 0x6100 /* VT86C100A (Rhine-II) 10/100 Ethernet */
+#define PCI_PRODUCT_VIATECH_VT8371_PPB 0x8391 /* VT8371 (Apollo KX133) PCI-PCI Bridge */
+#define PCI_PRODUCT_VIATECH_VT8501AGP 0x8501 /* VT8501 PCI-AGP */
+#define PCI_PRODUCT_VIATECH_VT82C597AGP 0x8597 /* VT82C597 (Apollo VP3) PCI-AGP */
+#define PCI_PRODUCT_VIATECH_VT82C598AGP 0x8598 /* VT82C598 (Apollo MVP3) PCI-AGP */
+
+/* Vortex Computer Systems products */
+/* GDT_PCI */
+#define PCI_PRODUCT_VORTEX_GDT_60x0 0x0000 /* GDT6000/6020/6050 */
+#define PCI_PRODUCT_VORTEX_GDT_6000B 0x0001 /* GDT6000B/6010 */
+/* GDT_PCINEW */
+#define PCI_PRODUCT_VORTEX_GDT_6x10 0x0002 /* GDT6110/6510 */
+#define PCI_PRODUCT_VORTEX_GDT_6x20 0x0003 /* GDT6120/6520 */
+#define PCI_PRODUCT_VORTEX_GDT_6530 0x0004 /* GDT6530 */
+#define PCI_PRODUCT_VORTEX_GDT_6550 0x0005 /* GDT6550 */
+/* GDT_PCINEW, wide/ultra SCSI controllers */
+#define PCI_PRODUCT_VORTEX_GDT_6x17 0x0006 /* GDT6117/6517 */
+#define PCI_PRODUCT_VORTEX_GDT_6x27 0x0007 /* GDT6127/6527 */
+#define PCI_PRODUCT_VORTEX_GDT_6537 0x0008 /* GDT6537 */
+#define PCI_PRODUCT_VORTEX_GDT_6557 0x0009 /* GDT6557/6557-ECC */
+/* GDT_PCINEW, wide SCSI controllers */
+#define PCI_PRODUCT_VORTEX_GDT_6x15 0x0010 /* GDT6115/6515 */
+#define PCI_PRODUCT_VORTEX_GDT_6x25 0x0011 /* GDT6125/6525 */
+#define PCI_PRODUCT_VORTEX_GDT_6535 0x0012 /* GDT6535 */
+#define PCI_PRODUCT_VORTEX_GDT_6555 0x0013 /* GDT6555/6555-ECC */
+/* GDT_MPR, RP series, wide/ultra SCSI */
+#define PCI_PRODUCT_VORTEX_GDT_6x17RP 0x0100 /* GDT6117RP/GDT6517RP */
+#define PCI_PRODUCT_VORTEX_GDT_6x27RP 0x0101 /* GDT6127RP/GDT6527RP */
+#define PCI_PRODUCT_VORTEX_GDT_6537RP 0x0102 /* GDT6537RP */
+#define PCI_PRODUCT_VORTEX_GDT_6557RP 0x0103 /* GDT6557RP */
+/* GDT_MPR, RP series, narrow/ultra SCSI */
+#define PCI_PRODUCT_VORTEX_GDT_6x11RP 0x0104 /* GDT6111RP/GDT6511RP */
+#define PCI_PRODUCT_VORTEX_GDT_6x21RP 0x0105 /* GDT6121RP/GDT6521RP */
+/* GDT_MPR, RD series, wide/ultra SCSI */
+#define PCI_PRODUCT_VORTEX_GDT_6x17RD 0x0110 /* GDT6117RD/GDT6517RD */
+#define PCI_PRODUCT_VORTEX_GDT_6x27RD 0x0111 /* GDT6127RD/GDT6527RD */
+#define PCI_PRODUCT_VORTEX_GDT_6537RD 0x0112 /* GDT6537RD */
+#define PCI_PRODUCT_VORTEX_GDT_6557RD 0x0113 /* GDT6557RD */
+/* GDT_MPR, RD series, narrow/ultra SCSI */
+#define PCI_PRODUCT_VORTEX_GDT_6x11RD 0x0114 /* GDT6111RD/GDT6511RD */
+#define PCI_PRODUCT_VORTEX_GDT_6x21RD 0x0115 /* GDT6121RD/GDT6521RD */
+/* GDT_MPR, RD series, wide/ultra2 SCSI */
+#define PCI_PRODUCT_VORTEX_GDT_6x18RD 0x0118 /* GDT6118RD/GDT6518RD/GDT6618RD */
+#define PCI_PRODUCT_VORTEX_GDT_6x28RD 0x0119 /* GDT6128RD/GDT6528RD/GDT6628RD */
+#define PCI_PRODUCT_VORTEX_GDT_6x38RD 0x011A /* GDT6538RD/GDT6638RD */
+#define PCI_PRODUCT_VORTEX_GDT_6x58RD 0x011B /* GDT6558RD/GDT6658RD */
+/* GDT_MPR, RN series (64-bit PCI), wide/ultra2 SCSI */
+#define PCI_PRODUCT_VORTEX_GDT_7x18RN 0x0168 /* GDT7118RN/GDT7518RN/GDT7618RN */
+#define PCI_PRODUCT_VORTEX_GDT_7x28RN 0x0169 /* GDT7128RN/GDT7528RN/GDT7628RN */
+#define PCI_PRODUCT_VORTEX_GDT_7x38RN 0x016A /* GDT7538RN/GDT7638RN */
+#define PCI_PRODUCT_VORTEX_GDT_7x58RN 0x016B /* GDT7558RN/GDT7658RN */
+/* GDT_MPR, RD series, Fibre Channel */
+#define PCI_PRODUCT_VORTEX_GDT_6x19RD 0x0210 /* GDT6519RD/GDT6619RD */
+#define PCI_PRODUCT_VORTEX_GDT_6x29RD 0x0211 /* GDT6529RD/GDT6629RD */
+/* GDT_MPR, RN series (64-bit PCI), Fibre Channel */
+#define PCI_PRODUCT_VORTEX_GDT_7x19RN 0x0260 /* GDT7519RN/GDT7619RN */
+#define PCI_PRODUCT_VORTEX_GDT_7x29RN 0x0261 /* GDT7529RN/GDT7629RN */
+
+/* VLSI products */
+#define PCI_PRODUCT_VLSI_82C592 0x0005 /* 82C592 CPU Bridge */
+#define PCI_PRODUCT_VLSI_82C593 0x0006 /* 82C593 ISA Bridge */
+#define PCI_PRODUCT_VLSI_82C594 0x0007 /* 82C594 Wildcat System Controller */
+#define PCI_PRODUCT_VLSI_82C596597 0x0008 /* 82C596/597 Wildcat ISA Bridge */
+#define PCI_PRODUCT_VLSI_82C541 0x000c /* 82C541 */
+#define PCI_PRODUCT_VLSI_82C543 0x000d /* 82C543 */
+#define PCI_PRODUCT_VLSI_82C532 0x0101 /* 82C532 */
+#define PCI_PRODUCT_VLSI_82C534 0x0102 /* 82C534 */
+#define PCI_PRODUCT_VLSI_82C535 0x0104 /* 82C535 */
+#define PCI_PRODUCT_VLSI_82C147 0x0105 /* 82C147 */
+#define PCI_PRODUCT_VLSI_82C975 0x0200 /* 82C975 */
+#define PCI_PRODUCT_VLSI_82C925 0x0280 /* 82C925 */
+
+/* Weitek products */
+#define PCI_PRODUCT_WEITEK_P9000 0x9001 /* P9000 */
+#define PCI_PRODUCT_WEITEK_P9100 0x9100 /* P9100 */
+
+/* Western Digital products */
+#define PCI_PRODUCT_WD_WD33C193A 0x0193 /* WD33C193A */
+#define PCI_PRODUCT_WD_WD33C196A 0x0196 /* WD33C196A */
+#define PCI_PRODUCT_WD_WD33C197A 0x0197 /* WD33C197A */
+#define PCI_PRODUCT_WD_WD7193 0x3193 /* WD7193 */
+#define PCI_PRODUCT_WD_WD7197 0x3197 /* WD7197 */
+#define PCI_PRODUCT_WD_WD33C296A 0x3296 /* WD33C296A */
+#define PCI_PRODUCT_WD_WD34C296 0x4296 /* WD34C296 */
+#define PCI_PRODUCT_WD_90C 0xC24A /* 90C */
+
+/* Winbond Electronics products */
+#define PCI_PRODUCT_WINBOND_W83769F 0x0001 /* W83769F */
+#define PCI_PRODUCT_WINBOND_W89C840F 0x0840 /* W89C840F 10/100 Ethernet */
+#define PCI_PRODUCT_WINBOND_W89C940F 0x0940 /* W89C940F Ethernet */
+#define PCI_PRODUCT_WINBOND_W89C940F_1 0x5a5a /* W89C940F Ethernet */
+
+/* Xircom products */
+/* is the `-3' here just indicating revision 3, or is it really part
+ of the device name? */
+#define PCI_PRODUCT_XIRCOM_X3201_3 0x0002 /* X3201-3 Fast Ethernet Controller */
+/* this is the device id `indicating 21143 driver compatibility' */
+#define PCI_PRODUCT_XIRCOM_X3201_3_21143 0x0003 /* X3201-3 Fast Ethernet Controller (21143) */
+
+/* Yamaha products */
+#define PCI_PRODUCT_YAMAHA_YMF724 0x0004 /* 724 Audio */
+#define PCI_PRODUCT_YAMAHA_YMF740 0x000A /* 740 Audio */
+#define PCI_PRODUCT_YAMAHA_YMF740C 0x000C /* 740C (DS-1) Audio */
+#define PCI_PRODUCT_YAMAHA_YMF724F 0x000D /* 724F (DS-1) Audio */
+#define PCI_PRODUCT_YAMAHA_YMF744B 0x0010 /* 744 (DS-1S) Audio */
+#define PCI_PRODUCT_YAMAHA_YMF754 0x0012 /* 754 (DS-1E) Audio */
+
+/* Zeinet products */
+#define PCI_PRODUCT_ZEINET_1221 0x0001 /* 1221 */
+
+/* Ziatech products */
+#define PCI_PRODUCT_ZIATECH_ZT8905 0x8905 /* PCI-ST32 Bridge */
+
+/* Zoran products */
+#define PCI_PRODUCT_ZORAN_ZR36120 0x6120 /* Video Controller */
diff --git a/cfe/cfe/pci/pcidevs_data.h b/cfe/cfe/pci/pcidevs_data.h
new file mode 100644
index 0000000..1bdc7f4
--- /dev/null
+++ b/cfe/cfe/pci/pcidevs_data.h
@@ -0,0 +1,5873 @@
+/*
+ * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
+ *
+ * generated from:
+ * pcidevs 2002/09/03 broadcom
+ */
+
+/*
+ * Copyright (c) 1995, 1996 Christopher G. Demetriou
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Christopher G. Demetriou
+ * for the NetBSD Project.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+static const struct pci_knowndev pci_knowndevs[] = {
+ {
+ PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3C985,
+ 0,
+ "3Com",
+ "3c985 Gigabit Ethernet",
+ },
+ {
+ PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3C590,
+ 0,
+ "3Com",
+ "3c590 Ethernet",
+ },
+ {
+ PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3C595TX,
+ 0,
+ "3Com",
+ "3c595-TX 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3C595T4,
+ 0,
+ "3Com",
+ "3c595-T4 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3C595MII,
+ 0,
+ "3Com",
+ "3c595-MII 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3C900TPO,
+ 0,
+ "3Com",
+ "3c900-TPO Ethernet",
+ },
+ {
+ PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3C900COMBO,
+ 0,
+ "3Com",
+ "3c900-COMBO Ethernet",
+ },
+ {
+ PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3C905TX,
+ 0,
+ "3Com",
+ "3c905-TX 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3C905T4,
+ 0,
+ "3Com",
+ "3c905-T4 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3C900BTPO,
+ 0,
+ "3Com",
+ "3c900B-TPO Ethernet",
+ },
+ {
+ PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3C900BCOMBO,
+ 0,
+ "3Com",
+ "3c900B-COMBO Ethernet",
+ },
+ {
+ PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3C900BTPC,
+ 0,
+ "3Com",
+ "3c900B-TPC Ethernet",
+ },
+ {
+ PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3C905BTX,
+ 0,
+ "3Com",
+ "3c905B-TX 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3C905BT4,
+ 0,
+ "3Com",
+ "3c905B-T4 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3C905BCOMBO,
+ 0,
+ "3Com",
+ "3c905B-COMBO 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3C905BFX,
+ 0,
+ "3Com",
+ "3c905B-FX 100 Ethernet",
+ },
+ {
+ PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3C905CTX,
+ 0,
+ "3Com",
+ "3c905C-TX 10/100 Ethernet with mngmt",
+ },
+ {
+ PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3C980SRV,
+ 0,
+ "3Com",
+ "3c980 Server Adapter 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3C980CTXM,
+ 0,
+ "3Com",
+ "3c980C-TXM 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3CR990TX97,
+ 0,
+ "3Com",
+ "3CR990-TX-97 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_3DFX, PCI_PRODUCT_3DFX_VOODOO,
+ 0,
+ "3Dfx Interactive",
+ "Voodoo",
+ },
+ {
+ PCI_VENDOR_3DFX, PCI_PRODUCT_3DFX_VOODOO2,
+ 0,
+ "3Dfx Interactive",
+ "Voodoo2",
+ },
+ {
+ PCI_VENDOR_3DFX, PCI_PRODUCT_3DFX_BANSHEE,
+ 0,
+ "3Dfx Interactive",
+ "Banshee",
+ },
+ {
+ PCI_VENDOR_3DFX, PCI_PRODUCT_3DFX_VOODOO3,
+ 0,
+ "3Dfx Interactive",
+ "Voodoo3",
+ },
+ {
+ PCI_VENDOR_3DLABS, PCI_PRODUCT_3DLABS_300SX,
+ 0,
+ "3D Labs",
+ "GLINT 300SX",
+ },
+ {
+ PCI_VENDOR_3DLABS, PCI_PRODUCT_3DLABS_500TX,
+ 0,
+ "3D Labs",
+ "GLINT 500TX",
+ },
+ {
+ PCI_VENDOR_3DLABS, PCI_PRODUCT_3DLABS_DELTA,
+ 0,
+ "3D Labs",
+ "GLINT DELTA",
+ },
+ {
+ PCI_VENDOR_3DLABS, PCI_PRODUCT_3DLABS_PERMEDIA,
+ 0,
+ "3D Labs",
+ "GLINT Permedia",
+ },
+ {
+ PCI_VENDOR_3DLABS, PCI_PRODUCT_3DLABS_500MX,
+ 0,
+ "3D Labs",
+ "GLINT 500MX",
+ },
+ {
+ PCI_VENDOR_3DLABS, PCI_PRODUCT_3DLABS_PERMEDI2,
+ 0,
+ "3D Labs",
+ "GLINT Permedia 2",
+ },
+ {
+ PCI_VENDOR_3WARE, PCI_PRODUCT_3WARE_ESCALADE,
+ 0,
+ "3ware",
+ "Escalade IDE RAID",
+ },
+ {
+ PCI_VENDOR_ACC, PCI_PRODUCT_ACC_2188,
+ 0,
+ "ACC Microelectronics",
+ "ACCM 2188 VL-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_ACC, PCI_PRODUCT_ACC_2051_HB,
+ 0,
+ "ACC Microelectronics",
+ "2051 PCI Single Chip Solution (host bridge)",
+ },
+ {
+ PCI_VENDOR_ACC, PCI_PRODUCT_ACC_2051_ISA,
+ 0,
+ "ACC Microelectronics",
+ "2051 PCI Single Chip Solution (ISA bridge)",
+ },
+ {
+ PCI_VENDOR_ACARD, PCI_PRODUCT_ACARD_AEC6710,
+ 0,
+ "Acard",
+ "AEC6710 SCSI",
+ },
+ {
+ PCI_VENDOR_ACARD, PCI_PRODUCT_ACARD_AEC6712UW,
+ 0,
+ "Acard",
+ "AEC6712UW SCSI",
+ },
+ {
+ PCI_VENDOR_ACARD, PCI_PRODUCT_ACARD_AEC6712U,
+ 0,
+ "Acard",
+ "AEC6712U SCSI",
+ },
+ {
+ PCI_VENDOR_ACARD, PCI_PRODUCT_ACARD_AEC6712S,
+ 0,
+ "Acard",
+ "AEC6712S SCSI",
+ },
+ {
+ PCI_VENDOR_ACARD, PCI_PRODUCT_ACARD_AEC6710D,
+ 0,
+ "Acard",
+ "AEC6710D SCSI",
+ },
+ {
+ PCI_VENDOR_ACARD, PCI_PRODUCT_ACARD_AEC6715UW,
+ 0,
+ "Acard",
+ "AEC6715UW SCSI",
+ },
+ {
+ PCI_VENDOR_ACCTON, PCI_PRODUCT_ACCTON_MPX5030,
+ 0,
+ "Accton Technology",
+ "MPX 5030/5038 Ethernet",
+ },
+ {
+ PCI_VENDOR_ACER, PCI_PRODUCT_ACER_M1435,
+ 0,
+ "Acer",
+ "M1435 VL-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_ALI, PCI_PRODUCT_ALI_M1445,
+ 0,
+ "Acer Labs",
+ "M1445 VL-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_ALI, PCI_PRODUCT_ALI_M1449,
+ 0,
+ "Acer Labs",
+ "M1449 PCI-ISA Bridge",
+ },
+ {
+ PCI_VENDOR_ALI, PCI_PRODUCT_ALI_M1451,
+ 0,
+ "Acer Labs",
+ "M1451 Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_ALI, PCI_PRODUCT_ALI_M1461,
+ 0,
+ "Acer Labs",
+ "M1461 Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_ALI, PCI_PRODUCT_ALI_M1531,
+ 0,
+ "Acer Labs",
+ "M1531 Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_ALI, PCI_PRODUCT_ALI_M1541,
+ 0,
+ "Acer Labs",
+ "M1541 Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_ALI, PCI_PRODUCT_ALI_M1543,
+ 0,
+ "Acer Labs",
+ "M1543 PCI-ISA Bridge",
+ },
+ {
+ PCI_VENDOR_ALI, PCI_PRODUCT_ALI_M3309,
+ 0,
+ "Acer Labs",
+ "M3309 MPEG Decoder",
+ },
+ {
+ PCI_VENDOR_ALI, PCI_PRODUCT_ALI_M4803,
+ 0,
+ "Acer Labs",
+ "M4803",
+ },
+ {
+ PCI_VENDOR_ALI, PCI_PRODUCT_ALI_M5229,
+ 0,
+ "Acer Labs",
+ "M5229 UDMA IDE Controller",
+ },
+ {
+ PCI_VENDOR_ALI, PCI_PRODUCT_ALI_M5237,
+ 0,
+ "Acer Labs",
+ "M5237 USB Host Controller",
+ },
+ {
+ PCI_VENDOR_ALI, PCI_PRODUCT_ALI_M7101,
+ 0,
+ "Acer Labs",
+ "M7101 Power Management Controller",
+ },
+ {
+ PCI_VENDOR_ADP, PCI_PRODUCT_ADP_AIC7850,
+ 0,
+ "Adaptec",
+ "AIC-7850",
+ },
+ {
+ PCI_VENDOR_ADP, PCI_PRODUCT_ADP_AIC7855,
+ 0,
+ "Adaptec",
+ "AIC-7855",
+ },
+ {
+ PCI_VENDOR_ADP, PCI_PRODUCT_ADP_AIC5900,
+ 0,
+ "Adaptec",
+ "AIC-5900 ATM",
+ },
+ {
+ PCI_VENDOR_ADP, PCI_PRODUCT_ADP_AIC5905,
+ 0,
+ "Adaptec",
+ "AIC-5905 ATM",
+ },
+ {
+ PCI_VENDOR_ADP, PCI_PRODUCT_ADP_AIC6915,
+ 0,
+ "Adaptec",
+ "AIC-6915 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_ADP, PCI_PRODUCT_ADP_AIC7860,
+ 0,
+ "Adaptec",
+ "AIC-7860",
+ },
+ {
+ PCI_VENDOR_ADP, PCI_PRODUCT_ADP_APA1480,
+ 0,
+ "Adaptec",
+ "APA-1480 Ultra",
+ },
+ {
+ PCI_VENDOR_ADP, PCI_PRODUCT_ADP_2940AU,
+ 0,
+ "Adaptec",
+ "AHA-2940A Ultra",
+ },
+ {
+ PCI_VENDOR_ADP, PCI_PRODUCT_ADP_AIC7870,
+ 0,
+ "Adaptec",
+ "AIC-7870",
+ },
+ {
+ PCI_VENDOR_ADP, PCI_PRODUCT_ADP_2940,
+ 0,
+ "Adaptec",
+ "AHA-2940",
+ },
+ {
+ PCI_VENDOR_ADP, PCI_PRODUCT_ADP_3940,
+ 0,
+ "Adaptec",
+ "AHA-3940",
+ },
+ {
+ PCI_VENDOR_ADP, PCI_PRODUCT_ADP_3985,
+ 0,
+ "Adaptec",
+ "AHA-3985",
+ },
+ {
+ PCI_VENDOR_ADP, PCI_PRODUCT_ADP_2944,
+ 0,
+ "Adaptec",
+ "AHA-2944",
+ },
+ {
+ PCI_VENDOR_ADP, PCI_PRODUCT_ADP_AIC7895,
+ 0,
+ "Adaptec",
+ "AIC-7895 Ultra",
+ },
+ {
+ PCI_VENDOR_ADP, PCI_PRODUCT_ADP_AIC7880,
+ 0,
+ "Adaptec",
+ "AIC-7880 Ultra",
+ },
+ {
+ PCI_VENDOR_ADP, PCI_PRODUCT_ADP_2940U,
+ 0,
+ "Adaptec",
+ "AHA-2940 Ultra",
+ },
+ {
+ PCI_VENDOR_ADP, PCI_PRODUCT_ADP_3940U,
+ 0,
+ "Adaptec",
+ "AHA-3940 Ultra",
+ },
+ {
+ PCI_VENDOR_ADP, PCI_PRODUCT_ADP_389XU,
+ 0,
+ "Adaptec",
+ "AHA-389X Ultra",
+ },
+ {
+ PCI_VENDOR_ADP, PCI_PRODUCT_ADP_2944U,
+ 0,
+ "Adaptec",
+ "AHA-2944 Ultra",
+ },
+ {
+ PCI_VENDOR_ADP, PCI_PRODUCT_ADP_2940UP,
+ 0,
+ "Adaptec",
+ "AHA-2940 Ultra Pro",
+ },
+ {
+ PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_2940U2,
+ 0,
+ "Adaptec (2nd PCI Vendor ID)",
+ "AHA-2940 Ultra2",
+ },
+ {
+ PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_2930U2,
+ 0,
+ "Adaptec (2nd PCI Vendor ID)",
+ "AHA-2930 Ultra2",
+ },
+ {
+ PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_AIC7890,
+ 0,
+ "Adaptec (2nd PCI Vendor ID)",
+ "AIC-7890/1",
+ },
+ {
+ PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_3950U2B,
+ 0,
+ "Adaptec (2nd PCI Vendor ID)",
+ "AHA-3950 Ultra2",
+ },
+ {
+ PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_3950U2D,
+ 0,
+ "Adaptec (2nd PCI Vendor ID)",
+ "AHA-3950 Ultra2",
+ },
+ {
+ PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_AIC7896,
+ 0,
+ "Adaptec (2nd PCI Vendor ID)",
+ "AIC-7896/7",
+ },
+ {
+ PCI_VENDOR_ADDTRON, PCI_PRODUCT_ADDTRON_8139,
+ 0,
+ "Addtron Technology",
+ "8139 Ethernet",
+ },
+ {
+ PCI_VENDOR_ADMTEK, PCI_PRODUCT_ADMTEK_AL981,
+ 0,
+ "ADMtek",
+ "ADMtek AL981 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_ADVSYS, PCI_PRODUCT_ADVSYS_1200A,
+ 0,
+ "Advanced System Products",
+ "",
+ },
+ {
+ PCI_VENDOR_ADVSYS, PCI_PRODUCT_ADVSYS_1200B,
+ 0,
+ "Advanced System Products",
+ "",
+ },
+ {
+ PCI_VENDOR_ADVSYS, PCI_PRODUCT_ADVSYS_ULTRA,
+ 0,
+ "Advanced System Products",
+ "ABP-930/40UA",
+ },
+ {
+ PCI_VENDOR_ADVSYS, PCI_PRODUCT_ADVSYS_WIDE,
+ 0,
+ "Advanced System Products",
+ "ABP-940UW",
+ },
+ {
+ PCI_VENDOR_ADVSYS, PCI_PRODUCT_ADVSYS_U2W,
+ 0,
+ "Advanced System Products",
+ "ASB-3940U2W",
+ },
+ {
+ PCI_VENDOR_ADVSYS, PCI_PRODUCT_ADVSYS_U3W,
+ 0,
+ "Advanced System Products",
+ "ASB-3940U3W",
+ },
+ {
+ PCI_VENDOR_ALLIANCE, PCI_PRODUCT_ALLIANCE_AT24,
+ 0,
+ "Alliance Semiconductor",
+ "AT24",
+ },
+ {
+ PCI_VENDOR_ALLIANCE, PCI_PRODUCT_ALLIANCE_AT25,
+ 0,
+ "Alliance Semiconductor",
+ "AT25",
+ },
+ {
+ PCI_VENDOR_ALTEON, PCI_PRODUCT_ALTEON_ACENIC,
+ 0,
+ "Alteon",
+ "ACEnic Gigabit Ethernet",
+ },
+ {
+ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_PCNET_PCI,
+ 0,
+ "Advanced Micro Devices",
+ "79c970 PCnet-PCI LANCE Ethernet",
+ },
+ {
+ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_PCNET_HOME,
+ 0,
+ "Advanced Micro Devices",
+ "79c978 PCnet-PCI Home",
+ },
+ {
+ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_PCSCSI_PCI,
+ 0,
+ "Advanced Micro Devices",
+ "53c974 PCscsi-PCI SCSI",
+ },
+ {
+ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_PCNETS_PCI,
+ 0,
+ "Advanced Micro Devices",
+ "79C974 PCnet-PCI Ethernet & SCSI",
+ },
+ {
+ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_SC751_SC,
+ 0,
+ "Advanced Micro Devices",
+ "AMD751 System Controller",
+ },
+ {
+ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_SC751_PPB,
+ 0,
+ "Advanced Micro Devices",
+ "AMD751 PCI-to-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_PBC756_ISA,
+ 0,
+ "Advanced Micro Devices",
+ "AMD756 PCI-to-ISA Bridge",
+ },
+ {
+ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_PBC756_IDE,
+ 0,
+ "Advanced Micro Devices",
+ "AMD756 IDE controller",
+ },
+ {
+ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_PBC756_PMC,
+ 0,
+ "Advanced Micro Devices",
+ "AMD756 Power Management Controller",
+ },
+ {
+ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_PBC756_USB,
+ 0,
+ "Advanced Micro Devices",
+ "AMD756 USB Host Controller",
+ },
+ {
+ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_HT7520,
+ 0,
+ "Advanced Micro Devices",
+ "(PLX) HT7520 PCIX Tunnel",
+ },
+ {
+ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_HT7520_PIC,
+ 0,
+ "Advanced Micro Devices",
+ "(PLX) HT7520 PCIX IOAPIC",
+ },
+ {
+ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_AMD8151_AGP,
+ 0,
+ "Advanced Micro Devices",
+ "AMD8151 AGP Device",
+ },
+ {
+ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_AMD8151,
+ 0,
+ "Advanced Micro Devices",
+ "AMD8151 HyperTransport-AGP Bridge",
+ },
+ {
+ PCI_VENDOR_API, PCI_PRODUCT_API_STURGEON,
+ 0,
+ "API Networks",
+ "AP1011 HyperTransport-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_APPLE, PCI_PRODUCT_APPLE_BANDIT,
+ 0,
+ "Apple Computer",
+ "Bandit Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_APPLE, PCI_PRODUCT_APPLE_GC,
+ 0,
+ "Apple Computer",
+ "Grand Central I/O Controller",
+ },
+ {
+ PCI_VENDOR_APPLE, PCI_PRODUCT_APPLE_CONTROL,
+ 0,
+ "Apple Computer",
+ "Control",
+ },
+ {
+ PCI_VENDOR_APPLE, PCI_PRODUCT_APPLE_PLANB,
+ 0,
+ "Apple Computer",
+ "PlanB",
+ },
+ {
+ PCI_VENDOR_APPLE, PCI_PRODUCT_APPLE_OHARE,
+ 0,
+ "Apple Computer",
+ "OHare I/O Controller",
+ },
+ {
+ PCI_VENDOR_APPLE, PCI_PRODUCT_APPLE_BANDIT2,
+ 0,
+ "Apple Computer",
+ "Bandit Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_APPLE, PCI_PRODUCT_APPLE_HEATHROW,
+ 0,
+ "Apple Computer",
+ "MAC-IO I/O Controller (Heathrow)",
+ },
+ {
+ PCI_VENDOR_APPLE, PCI_PRODUCT_APPLE_PADDINGTON,
+ 0,
+ "Apple Computer",
+ "MAC-IO I/O Controller (Paddington)",
+ },
+ {
+ PCI_VENDOR_APPLE, PCI_PRODUCT_APPLE_KEYLARGO_USB,
+ 0,
+ "Apple Computer",
+ "KeyLargo USB Controller",
+ },
+ {
+ PCI_VENDOR_APPLE, PCI_PRODUCT_APPLE_UNINORTH1,
+ 0,
+ "Apple Computer",
+ "UniNorth Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_APPLE, PCI_PRODUCT_APPLE_UNINORTH2,
+ 0,
+ "Apple Computer",
+ "UniNorth Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_APPLE, PCI_PRODUCT_APPLE_UNINORTH_AGP,
+ 0,
+ "Apple Computer",
+ "UniNorth AGP Interface",
+ },
+ {
+ PCI_VENDOR_APPLE, PCI_PRODUCT_APPLE_GMAC,
+ 0,
+ "Apple Computer",
+ "GMAC Ethernet",
+ },
+ {
+ PCI_VENDOR_APPLE, PCI_PRODUCT_APPLE_KEYLARGO,
+ 0,
+ "Apple Computer",
+ "MAC-IO I/O Controller (KeyLargo)",
+ },
+ {
+ PCI_VENDOR_ARC, PCI_PRODUCT_ARC_1000PV,
+ 0,
+ "ARC Logic",
+ "1000PV",
+ },
+ {
+ PCI_VENDOR_ARC, PCI_PRODUCT_ARC_2000PV,
+ 0,
+ "ARC Logic",
+ "2000PV",
+ },
+ {
+ PCI_VENDOR_ARC, PCI_PRODUCT_ARC_2000MT,
+ 0,
+ "ARC Logic",
+ "2000MT",
+ },
+ {
+ PCI_VENDOR_ASIX, PCI_PRODUCT_ASIX_AX88140A,
+ 0,
+ "ASIX Electronics",
+ "AX88140A 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH32,
+ 0,
+ "ATI Technologies",
+ "Mach32",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_CT,
+ 0,
+ "ATI Technologies",
+ "Mach64 CT",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_CX,
+ 0,
+ "ATI Technologies",
+ "Mach64 CX",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_ET,
+ 0,
+ "ATI Technologies",
+ "Mach64 ET",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_VT,
+ 0,
+ "ATI Technologies",
+ "Mach64 VT",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_B,
+ 0,
+ "ATI Technologies",
+ "Mach64 B",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_GB,
+ 0,
+ "ATI Technologies",
+ "Mach64 GB",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_GD,
+ 0,
+ "ATI Technologies",
+ "Mach64 GD",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_GI,
+ 0,
+ "ATI Technologies",
+ "Mach64 GI",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_GP,
+ 0,
+ "ATI Technologies",
+ "Mach64 GP",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_GQ,
+ 0,
+ "ATI Technologies",
+ "Mach64 GQ",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_GT,
+ 0,
+ "ATI Technologies",
+ "Mach64 GT",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_GU,
+ 0,
+ "ATI Technologies",
+ "Mach64 GU",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_GV,
+ 0,
+ "ATI Technologies",
+ "Mach64 GV",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_GW,
+ 0,
+ "ATI Technologies",
+ "Mach64 GW",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_GX,
+ 0,
+ "ATI Technologies",
+ "Mach64 GX",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_GZ,
+ 0,
+ "ATI Technologies",
+ "Mach64 GZ",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_LB,
+ 0,
+ "ATI Technologies",
+ "Mach64 LB",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_LD,
+ 0,
+ "ATI Technologies",
+ "Mach64 LD",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_LG,
+ 0,
+ "ATI Technologies",
+ "Mach64 LG",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_LI,
+ 0,
+ "ATI Technologies",
+ "Mach64 LI",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_LM,
+ 0,
+ "ATI Technologies",
+ "Mach64 LM",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_LP,
+ 0,
+ "ATI Technologies",
+ "Mach64 LP",
+ },
+ {
+ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_LR,
+ 0,
+ "ATI Technologies",
+ "Mach64 LR",
+ },
+ {
+ PCI_VENDOR_AURAVISION, PCI_PRODUCT_AURAVISION_VXP524,
+ 0,
+ "Auravision",
+ "VxP524 PCI Video Processor",
+ },
+ {
+ PCI_VENDOR_AUREAL, PCI_PRODUCT_AUREAL_AU8820,
+ 0,
+ "Aureal Semiconductor",
+ "AU8820 Vortex Digital Audio Processor",
+ },
+ {
+ PCI_VENDOR_AMCIRCUITS, PCI_PRODUCT_AMCIRCUITS_S5933,
+ 0,
+ "Applied Micro Circuits",
+ "S5933 PCI Matchmaker",
+ },
+ {
+ PCI_VENDOR_AMCIRCUITS, PCI_PRODUCT_AMCIRCUITS_LANAI,
+ 0,
+ "Applied Micro Circuits",
+ "Myrinet LANai Interface",
+ },
+ {
+ PCI_VENDOR_AMCIRCUITS, PCI_PRODUCT_AMCIRCUITS_S5920,
+ 0,
+ "Applied Micro Circuits",
+ "S5920 PCI Target",
+ },
+ {
+ PCI_VENDOR_ATRONICS, PCI_PRODUCT_ATRONICS_IDE_2015PL,
+ 0,
+ "Atronics",
+ "IDE-2015PL",
+ },
+ {
+ PCI_VENDOR_AVANCE, PCI_PRODUCT_AVANCE_AVL2301,
+ 0,
+ "Avance Logic",
+ "AVL2301",
+ },
+ {
+ PCI_VENDOR_AVANCE, PCI_PRODUCT_AVANCE_AVG2302,
+ 0,
+ "Avance Logic",
+ "AVG2302",
+ },
+ {
+ PCI_VENDOR_AVANCE2, PCI_PRODUCT_AVANCE2_ALG2301,
+ 0,
+ "Avance Logic (2nd PCI Vendor ID)",
+ "ALG2301",
+ },
+ {
+ PCI_VENDOR_AVANCE2, PCI_PRODUCT_AVANCE2_ALG2302,
+ 0,
+ "Avance Logic (2nd PCI Vendor ID)",
+ "ALG2302",
+ },
+ {
+ PCI_VENDOR_CCUBE, PCI_PRODUCT_CCUBE_CINEMASTER,
+ 0,
+ "C-Cube Microsystems",
+ "Cinemaster C 3.0 DVD Decoder",
+ },
+ {
+ PCI_VENDOR_AVM, PCI_PRODUCT_AVM_FRITZ_CARD,
+ 0,
+ "AVM",
+ "Fritz! Card ISDN Interface",
+ },
+ {
+ PCI_VENDOR_BIT3, PCI_PRODUCT_BIT3_PCIVME617,
+ 0,
+ "Bit3 Computer Corp.",
+ "PCI-VME Interface Mod. 617",
+ },
+ {
+ PCI_VENDOR_BIT3, PCI_PRODUCT_BIT3_PCIVME618,
+ 0,
+ "Bit3 Computer Corp.",
+ "PCI-VME Interface Mod. 618",
+ },
+ {
+ PCI_VENDOR_BIT3, PCI_PRODUCT_BIT3_PCIVME2706,
+ 0,
+ "Bit3 Computer Corp.",
+ "PCI-VME Interface Mod. 2706",
+ },
+ {
+ PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM4211,
+ 0,
+ "Broadcom",
+ "BCM4211 iLine10 Controller",
+ },
+ {
+ PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM4212,
+ 0,
+ "Broadcom",
+ "BCM4212 V.90 Modem",
+ },
+ {
+ PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5700,
+ 0,
+ "Broadcom",
+ "BCM5700 10/100/1000 Ethernet",
+ },
+ {
+ PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5701,
+ 0,
+ "Broadcom",
+ "BCM5701 10/100/1000 Ethernet",
+ },
+ {
+ PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5702,
+ 0,
+ "Broadcom",
+ "BCM5702 10/100/1000 Ethernet",
+ },
+ {
+ PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5703,
+ 0,
+ "Broadcom",
+ "BCM5703 10/100/1000 Ethernet",
+ },
+ {
+ PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5705,
+ 0,
+ "Broadcom",
+ "BCM5705 10/100/1000 Ethernet",
+ },
+ {
+ PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5820,
+ 0,
+ "Broadcom",
+ "BCM5820 eCommerce Processor",
+ },
+ {
+ PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5821,
+ 0,
+ "Broadcom",
+ "BCM5821 Super-eCommerce Processor",
+ },
+ {
+ PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_BCM5850,
+ 0,
+ "Broadcom",
+ "BCM5850 SSL/TLS Protocol Processor",
+ },
+ {
+ PCI_VENDOR_BROOKTREE, PCI_PRODUCT_BROOKTREE_BT848,
+ 0,
+ "Brooktree",
+ "Bt848 Video Capture",
+ },
+ {
+ PCI_VENDOR_BROOKTREE, PCI_PRODUCT_BROOKTREE_BT849,
+ 0,
+ "Brooktree",
+ "Bt849 Video Capture",
+ },
+ {
+ PCI_VENDOR_BROOKTREE, PCI_PRODUCT_BROOKTREE_BT878,
+ 0,
+ "Brooktree",
+ "Bt878 Video Capture",
+ },
+ {
+ PCI_VENDOR_BROOKTREE, PCI_PRODUCT_BROOKTREE_BT879,
+ 0,
+ "Brooktree",
+ "Bt879 Video Capture",
+ },
+ {
+ PCI_VENDOR_BUSLOGIC, PCI_PRODUCT_BUSLOGIC_MULTIMASTER_NC,
+ 0,
+ "BusLogic",
+ "MultiMaster NC",
+ },
+ {
+ PCI_VENDOR_BUSLOGIC, PCI_PRODUCT_BUSLOGIC_MULTIMASTER,
+ 0,
+ "BusLogic",
+ "MultiMaster",
+ },
+ {
+ PCI_VENDOR_BUSLOGIC, PCI_PRODUCT_BUSLOGIC_FLASHPOINT,
+ 0,
+ "BusLogic",
+ "FlashPoint",
+ },
+ {
+ PCI_VENDOR_C4T, PCI_PRODUCT_C4T_GPPCI,
+ 0,
+ "c't Magazin",
+ "GPPCI",
+ },
+ {
+ PCI_VENDOR_CHIPS, PCI_PRODUCT_CHIPS_64310,
+ 0,
+ "Chips and Technologies",
+ "64310",
+ },
+ {
+ PCI_VENDOR_CHIPS, PCI_PRODUCT_CHIPS_65545,
+ 0,
+ "Chips and Technologies",
+ "65545",
+ },
+ {
+ PCI_VENDOR_CHIPS, PCI_PRODUCT_CHIPS_65548,
+ 0,
+ "Chips and Technologies",
+ "65548",
+ },
+ {
+ PCI_VENDOR_CHIPS, PCI_PRODUCT_CHIPS_65550,
+ 0,
+ "Chips and Technologies",
+ "65550",
+ },
+ {
+ PCI_VENDOR_CHIPS, PCI_PRODUCT_CHIPS_65554,
+ 0,
+ "Chips and Technologies",
+ "65554",
+ },
+ {
+ PCI_VENDOR_CIRRUS, PCI_PRODUCT_CIRRUS_CL_GD7548,
+ 0,
+ "Cirrus Logic",
+ "CL-GD7548",
+ },
+ {
+ PCI_VENDOR_CIRRUS, PCI_PRODUCT_CIRRUS_CL_GD5430,
+ 0,
+ "Cirrus Logic",
+ "CL-GD5430",
+ },
+ {
+ PCI_VENDOR_CIRRUS, PCI_PRODUCT_CIRRUS_CL_GD5434_4,
+ 0,
+ "Cirrus Logic",
+ "CL-GD5434-4",
+ },
+ {
+ PCI_VENDOR_CIRRUS, PCI_PRODUCT_CIRRUS_CL_GD5434_8,
+ 0,
+ "Cirrus Logic",
+ "CL-GD5434-8",
+ },
+ {
+ PCI_VENDOR_CIRRUS, PCI_PRODUCT_CIRRUS_CL_GD5436,
+ 0,
+ "Cirrus Logic",
+ "CL-GD5436",
+ },
+ {
+ PCI_VENDOR_CIRRUS, PCI_PRODUCT_CIRRUS_CL_GD5446,
+ 0,
+ "Cirrus Logic",
+ "CL-GD5446",
+ },
+ {
+ PCI_VENDOR_CIRRUS, PCI_PRODUCT_CIRRUS_CL_GD5480,
+ 0,
+ "Cirrus Logic",
+ "CL-GD5480",
+ },
+ {
+ PCI_VENDOR_CIRRUS, PCI_PRODUCT_CIRRUS_CL_PD6729,
+ 0,
+ "Cirrus Logic",
+ "CL-PD6729",
+ },
+ {
+ PCI_VENDOR_CIRRUS, PCI_PRODUCT_CIRRUS_CL_PD6832,
+ 0,
+ "Cirrus Logic",
+ "CL-PD6832 PCI-CardBus Bridge",
+ },
+ {
+ PCI_VENDOR_CIRRUS, PCI_PRODUCT_CIRRUS_CL_PD6833,
+ 0,
+ "Cirrus Logic",
+ "CL-PD6833 PCI-CardBus Bridge",
+ },
+ {
+ PCI_VENDOR_CIRRUS, PCI_PRODUCT_CIRRUS_CL_GD7542,
+ 0,
+ "Cirrus Logic",
+ "CL-GD7542",
+ },
+ {
+ PCI_VENDOR_CIRRUS, PCI_PRODUCT_CIRRUS_CL_GD7543,
+ 0,
+ "Cirrus Logic",
+ "CL-GD7543",
+ },
+ {
+ PCI_VENDOR_CIRRUS, PCI_PRODUCT_CIRRUS_CL_GD7541,
+ 0,
+ "Cirrus Logic",
+ "CL-GD7541",
+ },
+ {
+ PCI_VENDOR_CIRRUS, PCI_PRODUCT_CIRRUS_CL_CD4400,
+ 0,
+ "Cirrus Logic",
+ "CL-CD4400 Communications Controller",
+ },
+ {
+ PCI_VENDOR_CIRRUS, PCI_PRODUCT_CIRRUS_CS4610,
+ 0,
+ "Cirrus Logic",
+ "CS4610 SoundFusion Audio Accelerator",
+ },
+ {
+ PCI_VENDOR_CIRRUS, PCI_PRODUCT_CIRRUS_CS4280,
+ 0,
+ "Cirrus Logic",
+ "CS4280 CrystalClear Audio Interface",
+ },
+ {
+ PCI_VENDOR_CMDTECH, PCI_PRODUCT_CMDTECH_640,
+ 0,
+ "CMD Technology",
+ "PCI0640",
+ },
+ {
+ PCI_VENDOR_CMDTECH, PCI_PRODUCT_CMDTECH_642,
+ 0,
+ "CMD Technology",
+ "PCI0642",
+ },
+ {
+ PCI_VENDOR_CMDTECH, PCI_PRODUCT_CMDTECH_643,
+ 0,
+ "CMD Technology",
+ "PCI0643",
+ },
+ {
+ PCI_VENDOR_CMDTECH, PCI_PRODUCT_CMDTECH_646,
+ 0,
+ "CMD Technology",
+ "PCI0646",
+ },
+ {
+ PCI_VENDOR_CMDTECH, PCI_PRODUCT_CMDTECH_647,
+ 0,
+ "CMD Technology",
+ "PCI0647",
+ },
+ {
+ PCI_VENDOR_CMDTECH, PCI_PRODUCT_CMDTECH_648,
+ 0,
+ "CMD Technology",
+ "PCI0648",
+ },
+ {
+ PCI_VENDOR_CMDTECH, PCI_PRODUCT_CMDTECH_649,
+ 0,
+ "CMD Technology",
+ "PCI0649",
+ },
+ {
+ PCI_VENDOR_CMDTECH, PCI_PRODUCT_CMDTECH_650A,
+ 0,
+ "CMD Technology",
+ "PCI0650A",
+ },
+ {
+ PCI_VENDOR_CMDTECH, PCI_PRODUCT_CMDTECH_670,
+ 0,
+ "CMD Technology",
+ "USB0670",
+ },
+ {
+ PCI_VENDOR_CMDTECH, PCI_PRODUCT_CMDTECH_673,
+ 0,
+ "CMD Technology",
+ "USB0673",
+ },
+ {
+ PCI_VENDOR_CMEDIA, PCI_PRODUCT_CMEDIA_CMI8338A,
+ 0,
+ "C-Media Electronics Inc",
+ "CMI8338A PCI Audio Device",
+ },
+ {
+ PCI_VENDOR_CMEDIA, PCI_PRODUCT_CMEDIA_CMI8338B,
+ 0,
+ "C-Media Electronics Inc",
+ "CMI8338B PCI Audio Device",
+ },
+ {
+ PCI_VENDOR_CMEDIA, PCI_PRODUCT_CMEDIA_CMI8738,
+ 0,
+ "C-Media Electronics Inc",
+ "CMI8738/C3DX PCI Audio Device",
+ },
+ {
+ PCI_VENDOR_CMEDIA, PCI_PRODUCT_CMEDIA_HSP56,
+ 0,
+ "C-Media Electronics Inc",
+ "HSP56 Audiomodem Riser",
+ },
+ {
+ PCI_VENDOR_COGENT, PCI_PRODUCT_COGENT_EM110TX,
+ 0,
+ "Cogent Data Technologies",
+ "EX110TX PCI Fast Ethernet Adapter",
+ },
+ {
+ PCI_VENDOR_COMPAQ, PCI_PRODUCT_COMPAQ_PCI_EISA_BRIDGE,
+ 0,
+ "Compaq",
+ "PCI-EISA Bridge",
+ },
+ {
+ PCI_VENDOR_COMPAQ, PCI_PRODUCT_COMPAQ_PCI_ISA_BRIDGE,
+ 0,
+ "Compaq",
+ "PCI-ISA Bridge",
+ },
+ {
+ PCI_VENDOR_COMPAQ, PCI_PRODUCT_COMPAQ_TRIFLEX1,
+ 0,
+ "Compaq",
+ "Triflex Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_COMPAQ, PCI_PRODUCT_COMPAQ_TRIFLEX2,
+ 0,
+ "Compaq",
+ "Triflex Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_COMPAQ, PCI_PRODUCT_COMPAQ_QVISION_V0,
+ 0,
+ "Compaq",
+ "QVision",
+ },
+ {
+ PCI_VENDOR_COMPAQ, PCI_PRODUCT_COMPAQ_QVISION_1280P,
+ 0,
+ "Compaq",
+ "QVision 1280/p",
+ },
+ {
+ PCI_VENDOR_COMPAQ, PCI_PRODUCT_COMPAQ_QVISION_V2,
+ 0,
+ "Compaq",
+ "QVision",
+ },
+ {
+ PCI_VENDOR_COMPAQ, PCI_PRODUCT_COMPAQ_TRIFLEX4,
+ 0,
+ "Compaq",
+ "Triflex Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_COMPAQ, PCI_PRODUCT_COMPAQ_USB,
+ 0,
+ "Compaq",
+ "USB Controller",
+ },
+ {
+ PCI_VENDOR_COMPAQ, PCI_PRODUCT_COMPAQ_SMART2P,
+ 0,
+ "Compaq",
+ "SMART2P RAID",
+ },
+ {
+ PCI_VENDOR_COMPAQ, PCI_PRODUCT_COMPAQ_N100TX,
+ 0,
+ "Compaq",
+ "Netelligent 10/100 TX",
+ },
+ {
+ PCI_VENDOR_COMPAQ, PCI_PRODUCT_COMPAQ_N10T,
+ 0,
+ "Compaq",
+ "Netelligent 10 T",
+ },
+ {
+ PCI_VENDOR_COMPAQ, PCI_PRODUCT_COMPAQ_IntNF3P,
+ 0,
+ "Compaq",
+ "Integrated NetFlex 3/P",
+ },
+ {
+ PCI_VENDOR_COMPAQ, PCI_PRODUCT_COMPAQ_DPNet100TX,
+ 0,
+ "Compaq",
+ "Dual Port Netelligent 10/100 TX",
+ },
+ {
+ PCI_VENDOR_COMPAQ, PCI_PRODUCT_COMPAQ_IntPL100TX,
+ 0,
+ "Compaq",
+ "ProLiant Integrated Netelligent 10/100 TX",
+ },
+ {
+ PCI_VENDOR_COMPAQ, PCI_PRODUCT_COMPAQ_DP4000,
+ 0,
+ "Compaq",
+ "Deskpro 4000 5233MMX",
+ },
+ {
+ PCI_VENDOR_COMPAQ, PCI_PRODUCT_COMPAQ_NF3P_BNC,
+ 0,
+ "Compaq",
+ "NetFlex 3/P w/ BNC",
+ },
+ {
+ PCI_VENDOR_COMPAQ, PCI_PRODUCT_COMPAQ_NF3P,
+ 0,
+ "Compaq",
+ "NetFlex 3/P",
+ },
+ {
+ PCI_VENDOR_COMPEX, PCI_PRODUCT_COMPEX_NE2KETHER,
+ 0,
+ "Compex",
+ "Ethernet",
+ },
+ {
+ PCI_VENDOR_COMPEX, PCI_PRODUCT_COMPEX_RL100ATX,
+ 0,
+ "Compex",
+ "RL100-ATX 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_COMPEX, PCI_PRODUCT_COMPEX_RL100TX,
+ 0,
+ "Compex",
+ "RL100-TX 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_CONEXANT, PCI_PRODUCT_CONEXANT_SOFTK56,
+ 0,
+ "Conexant Systems",
+ "SoftK56 PCI Software Modem",
+ },
+ {
+ PCI_VENDOR_CONTAQ, PCI_PRODUCT_CONTAQ_82C599,
+ 0,
+ "Contaq Microsystems",
+ "82C599 PCI-VLB Bridge",
+ },
+ {
+ PCI_VENDOR_CONTAQ, PCI_PRODUCT_CONTAQ_82C693,
+ 0,
+ "Contaq Microsystems",
+ "82C693 PCI-ISA Bridge",
+ },
+ {
+ PCI_VENDOR_COROLLARY, PCI_PRODUCT_COROLLARY_CBUSII_PCIB,
+ 0,
+ "Corrollary",
+ "\"C-Bus II\"-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_CREATIVELABS, PCI_PRODUCT_CREATIVELABS_SBLIVE,
+ 0,
+ "Creative Labs",
+ "SBLive! EMU 10000",
+ },
+ {
+ PCI_VENDOR_CREATIVELABS, PCI_PRODUCT_CREATIVELABS_SBJOY,
+ 0,
+ "Creative Labs",
+ "PCI Gameport Joystick",
+ },
+ {
+ PCI_VENDOR_CREATIVELABS, PCI_PRODUCT_CREATIVELABS_EV1938,
+ 0,
+ "Creative Labs",
+ "Ectiva 1938",
+ },
+ {
+ PCI_VENDOR_CYCLADES, PCI_PRODUCT_CYCLADES_CYCLOMY_1,
+ 0,
+ "Cyclades",
+ "Cyclom-Y below 1M",
+ },
+ {
+ PCI_VENDOR_CYCLADES, PCI_PRODUCT_CYCLADES_CYCLOMY_2,
+ 0,
+ "Cyclades",
+ "Cyclom-Y above 1M",
+ },
+ {
+ PCI_VENDOR_CYCLADES, PCI_PRODUCT_CYCLADES_CYCLOM4Y_1,
+ 0,
+ "Cyclades",
+ "Cyclom-4Y below 1M",
+ },
+ {
+ PCI_VENDOR_CYCLADES, PCI_PRODUCT_CYCLADES_CYCLOM4Y_2,
+ 0,
+ "Cyclades",
+ "Cyclom-4Y above 1M",
+ },
+ {
+ PCI_VENDOR_CYCLADES, PCI_PRODUCT_CYCLADES_CYCLOM8Y_1,
+ 0,
+ "Cyclades",
+ "Cyclom-8Y below 1M",
+ },
+ {
+ PCI_VENDOR_CYCLADES, PCI_PRODUCT_CYCLADES_CYCLOM8Y_2,
+ 0,
+ "Cyclades",
+ "Cyclom-8Y above 1M",
+ },
+ {
+ PCI_VENDOR_CYCLADES, PCI_PRODUCT_CYCLADES_CYCLOMZ_1,
+ 0,
+ "Cyclades",
+ "Cyclom-Z below 1M",
+ },
+ {
+ PCI_VENDOR_CYCLADES, PCI_PRODUCT_CYCLADES_CYCLOMZ_2,
+ 0,
+ "Cyclades",
+ "Cyclom-Z above 1M",
+ },
+ {
+ PCI_VENDOR_DAVICOM, PCI_PRODUCT_DAVICOM_DM9102,
+ 0,
+ "Davicom Semiconductor",
+ "Davicom DM9102 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_DEC, PCI_PRODUCT_DEC_21050,
+ 0,
+ "Digital Equipment",
+ "DECchip 21050 PCI-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_DEC, PCI_PRODUCT_DEC_21040,
+ 0,
+ "Digital Equipment",
+ "DECchip 21040 Ethernet",
+ },
+ {
+ PCI_VENDOR_DEC, PCI_PRODUCT_DEC_21030,
+ 0,
+ "Digital Equipment",
+ "DECchip 21030 (\"TGA\")",
+ },
+ {
+ PCI_VENDOR_DEC, PCI_PRODUCT_DEC_NVRAM,
+ 0,
+ "Digital Equipment",
+ "Zephyr NV-RAM",
+ },
+ {
+ PCI_VENDOR_DEC, PCI_PRODUCT_DEC_KZPSA,
+ 0,
+ "Digital Equipment",
+ "KZPSA",
+ },
+ {
+ PCI_VENDOR_DEC, PCI_PRODUCT_DEC_21140,
+ 0,
+ "Digital Equipment",
+ "DECchip 21140 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_DEC, PCI_PRODUCT_DEC_PBXGB,
+ 0,
+ "Digital Equipment",
+ "TGA2",
+ },
+ {
+ PCI_VENDOR_DEC, PCI_PRODUCT_DEC_DEFPA,
+ 0,
+ "Digital Equipment",
+ "DEFPA",
+ },
+ {
+ PCI_VENDOR_DEC, PCI_PRODUCT_DEC_21041,
+ 0,
+ "Digital Equipment",
+ "DECchip 21041 Ethernet",
+ },
+ {
+ PCI_VENDOR_DEC, PCI_PRODUCT_DEC_DGLPB,
+ 0,
+ "Digital Equipment",
+ "DGLPB (\"OPPO\")",
+ },
+ {
+ PCI_VENDOR_DEC, PCI_PRODUCT_DEC_21142,
+ 0,
+ "Digital Equipment",
+ "DECchip 21142/21143 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_DEC, PCI_PRODUCT_DEC_21052,
+ 0,
+ "Digital Equipment",
+ "DECchip 21052 PCI-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_DEC, PCI_PRODUCT_DEC_21150,
+ 0,
+ "Digital Equipment",
+ "DECchip 21150 PCI-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_DEC, PCI_PRODUCT_DEC_21152,
+ 0,
+ "Digital Equipment",
+ "DECchip 21152 PCI-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_DEC, PCI_PRODUCT_DEC_21153,
+ 0,
+ "Digital Equipment",
+ "DECchip 21153 PCI-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_DEC, PCI_PRODUCT_DEC_21154,
+ 0,
+ "Digital Equipment",
+ "DECchip 21154 PCI-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_DEC, PCI_PRODUCT_DEC_CPQ42XX,
+ 0,
+ "Digital Equipment",
+ "Compaq SMART RAID 42xx",
+ },
+ {
+ PCI_VENDOR_DELTA, PCI_PRODUCT_DELTA_8139,
+ 0,
+ "Delta Electronics",
+ "8139 Ethernet",
+ },
+ {
+ PCI_VENDOR_DIAMOND, PCI_PRODUCT_DIAMOND_VIPER,
+ 0,
+ "Diamond Computer Systems",
+ "Viper/PCI",
+ },
+ {
+ PCI_VENDOR_DLINK, PCI_PRODUCT_DLINK_DFE550TX,
+ 0,
+ "D-Link Systems",
+ "DFE-550TX 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_DPT, PCI_PRODUCT_DPT_SC_RAID,
+ 0,
+ "Distributed Processing Technology",
+ "SmartCache/SmartRAID",
+ },
+ {
+ PCI_VENDOR_DPT, PCI_PRODUCT_DPT_RAID_I2O,
+ 0,
+ "Distributed Processing Technology",
+ "SmartRAID (I2O)",
+ },
+ {
+ PCI_VENDOR_DPT, PCI_PRODUCT_DPT_MEMCTLR,
+ 0,
+ "Distributed Processing Technology",
+ "Memory Controller",
+ },
+ {
+ PCI_VENDOR_DOLPHIN, PCI_PRODUCT_DOLPHIN_PCISCI,
+ 0,
+ "Dolphin Interconnect Solutions",
+ "PCI-SCI Bridge",
+ },
+ {
+ PCI_VENDOR_DOMEX, PCI_PRODUCT_DOMEX_PCISCSI,
+ 0,
+ "Domex",
+ "DMX-3191D",
+ },
+ {
+ PCI_VENDOR_ELSA, PCI_PRODUCT_ELSA_QS1PCI,
+ 0,
+ "Elsa",
+ "QuickStep 1000 ISDN card",
+ },
+ {
+ PCI_VENDOR_EMULEX, PCI_PRODUCT_EMULEX_LPPFC,
+ 0,
+ "Emulex",
+ "\"Light Pulse\" FibreChannel adapter",
+ },
+ {
+ PCI_VENDOR_ENSONIQ, PCI_PRODUCT_ENSONIQ_AUDIOPCI,
+ 0,
+ "Ensoniq",
+ "AudioPCI",
+ },
+ {
+ PCI_VENDOR_ENSONIQ, PCI_PRODUCT_ENSONIQ_AUDIOPCI97,
+ 0,
+ "Ensoniq",
+ "AudioPCI 97",
+ },
+ {
+ PCI_VENDOR_ENSONIQ, PCI_PRODUCT_ENSONIQ_CT5880,
+ 0,
+ "Ensoniq",
+ "CT5880",
+ },
+ {
+ PCI_VENDOR_EPIGRAM, PCI_PRODUCT_EPIGRAM_BCM4210,
+ 0,
+ "Epigram",
+ "BCM4210 iLine10 Controller",
+ },
+ {
+ PCI_VENDOR_ESSENTIAL, PCI_PRODUCT_ESSENTIAL_RR_HIPPI,
+ 0,
+ "Essential Communications",
+ "RoadRunner HIPPI Interface",
+ },
+ {
+ PCI_VENDOR_ESSENTIAL, PCI_PRODUCT_ESSENTIAL_RR_GIGE,
+ 0,
+ "Essential Communications",
+ "RoadRunner Gig-E Interface",
+ },
+ {
+ PCI_VENDOR_ESSTECH, PCI_PRODUCT_ESSTECH_MAESTRO1,
+ 0,
+ "ESS Technology Inc",
+ "Maestro 1 PCI Audio Accelerator",
+ },
+ {
+ PCI_VENDOR_ESSTECH, PCI_PRODUCT_ESSTECH_MAESTRO2,
+ 0,
+ "ESS Technology Inc",
+ "Maestro 2 PCI Audio Accelerator",
+ },
+ {
+ PCI_VENDOR_ESSTECH, PCI_PRODUCT_ESSTECH_SOLO1,
+ 0,
+ "ESS Technology Inc",
+ "Solo-1 PCI AudioDrive",
+ },
+ {
+ PCI_VENDOR_ESSTECH, PCI_PRODUCT_ESSTECH_MAESTRO2E,
+ 0,
+ "ESS Technology Inc",
+ "Maestro 2E PCI Audio Accelerator",
+ },
+ {
+ PCI_VENDOR_ESSTECH, PCI_PRODUCT_ESSTECH_MAESTRO3,
+ 0,
+ "ESS Technology Inc",
+ "Maestro 3 PCI Audio Accelerator",
+ },
+ {
+ PCI_VENDOR_ESSTECH, PCI_PRODUCT_ESSTECH_MAESTRO3MODEM,
+ 0,
+ "ESS Technology Inc",
+ "Maestro 3 Modem",
+ },
+ {
+ PCI_VENDOR_ESSTECH2, PCI_PRODUCT_ESSTECH2_MAESTRO1,
+ 0,
+ "ESS Technology Inc",
+ "Maestro 1 PCI Audio Accelerator",
+ },
+ {
+ PCI_VENDOR_O2MICRO, PCI_PRODUCT_O2MICRO_OZ6832,
+ 0,
+ "O2 Micro Inc",
+ "OZ6832 CardBus Controller",
+ },
+ {
+ PCI_VENDOR_ES, PCI_PRODUCT_ES_FREEDOM,
+ 0,
+ "Evans & Sutherland",
+ "Freedom PCI-GBus Interface",
+ },
+ {
+ PCI_VENDOR_FORE, PCI_PRODUCT_FORE_PCA200,
+ 0,
+ "FORE Systems",
+ "ATM PCA-200",
+ },
+ {
+ PCI_VENDOR_FORE, PCI_PRODUCT_FORE_PCA200E,
+ 0,
+ "FORE Systems",
+ "ATM PCA-200e",
+ },
+ {
+ PCI_VENDOR_FORTEMEDIA, PCI_PRODUCT_FORTEMEDIA_FM801,
+ 0,
+ "Forte Media",
+ "Forte Media 801 Sound",
+ },
+ {
+ PCI_VENDOR_FUTUREDOMAIN, PCI_PRODUCT_FUTUREDOMAIN_TMC_18C30,
+ 0,
+ "Future Domain",
+ "TMC-18C30 (36C70)",
+ },
+ {
+ PCI_VENDOR_EFFICIENTNETS, PCI_PRODUCT_EFFICIENTNETS_ENI155PF,
+ 0,
+ "Efficent Networks",
+ "155P-MF1 ATM (FPGA)",
+ },
+ {
+ PCI_VENDOR_EFFICIENTNETS, PCI_PRODUCT_EFFICIENTNETS_ENI155PA,
+ 0,
+ "Efficent Networks",
+ "155P-MF1 ATM (ASIC)",
+ },
+ {
+ PCI_VENDOR_EFFICIENTNETS, PCI_PRODUCT_EFFICIENTNETS_ENI25P,
+ 0,
+ "Efficent Networks",
+ "SpeedStream ENI-25p",
+ },
+ {
+ PCI_VENDOR_EFFICIENTNETS, PCI_PRODUCT_EFFICIENTNETS_SS3000,
+ 0,
+ "Efficent Networks",
+ "SpeedStream 3000",
+ },
+ {
+ PCI_VENDOR_GALILEO, PCI_PRODUCT_GALILEO_GT64010A,
+ 0,
+ "Galileo Technology",
+ "GT-64010A System Controller",
+ },
+ {
+ PCI_VENDOR_GALILEO, PCI_PRODUCT_GALILEO_GT64115,
+ 0,
+ "Galileo Technology",
+ "GT-64115 System Controller",
+ },
+ {
+ PCI_VENDOR_GALILEO, PCI_PRODUCT_GALILEO_GT64011,
+ 0,
+ "Galileo Technology",
+ "GT-64011 System Controller",
+ },
+ {
+ PCI_VENDOR_GALILEO, PCI_PRODUCT_GALILEO_GT64120,
+ 0,
+ "Galileo Technology",
+ "GT-64120 System Controller",
+ },
+ {
+ PCI_VENDOR_GALILEO, PCI_PRODUCT_GALILEO_GT64130,
+ 0,
+ "Galileo Technology",
+ "GT-64130 System Controller",
+ },
+ {
+ PCI_VENDOR_HP, PCI_PRODUCT_HP_J2585A,
+ 0,
+ "Hewlett-Packard",
+ "J2585A",
+ },
+ {
+ PCI_VENDOR_IBM, PCI_PRODUCT_IBM_MCABRIDGE,
+ 0,
+ "IBM",
+ "MCA Bridge",
+ },
+ {
+ PCI_VENDOR_IBM, PCI_PRODUCT_IBM_ALTALITE,
+ 0,
+ "IBM",
+ "CPU Bridge - Alta Lite",
+ },
+ {
+ PCI_VENDOR_IBM, PCI_PRODUCT_IBM_ALTAMP,
+ 0,
+ "IBM",
+ "CPU Bridge - Alta MP",
+ },
+ {
+ PCI_VENDOR_IBM, PCI_PRODUCT_IBM_ISABRIDGE,
+ 0,
+ "IBM",
+ "ISA Bridge w/PnP",
+ },
+ {
+ PCI_VENDOR_IBM, PCI_PRODUCT_IBM_CPUBRIDGE,
+ 0,
+ "IBM",
+ "CPU Bridge",
+ },
+ {
+ PCI_VENDOR_IBM, PCI_PRODUCT_IBM_LANSTREAMER,
+ 0,
+ "IBM",
+ "Auto LANStreamer",
+ },
+ {
+ PCI_VENDOR_IBM, PCI_PRODUCT_IBM_GXT150P,
+ 0,
+ "IBM",
+ "GXT-150P 2D Accelerator",
+ },
+ {
+ PCI_VENDOR_IBM, PCI_PRODUCT_IBM_MCABRIDGE2,
+ 0,
+ "IBM",
+ "MCA Bridge",
+ },
+ {
+ PCI_VENDOR_IBM, PCI_PRODUCT_IBM_82351,
+ 0,
+ "IBM",
+ "82351 PCI-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_IBM, PCI_PRODUCT_IBM_SERVERAID,
+ 0,
+ "IBM",
+ "ServeRAID",
+ },
+ {
+ PCI_VENDOR_IBM, PCI_PRODUCT_IBM_OLYMPIC,
+ 0,
+ "IBM",
+ "Token Ring",
+ },
+ {
+ PCI_VENDOR_IBM, PCI_PRODUCT_IBM_MIAMI,
+ 0,
+ "IBM",
+ "Miami/PCI",
+ },
+ {
+ PCI_VENDOR_IBM, PCI_PRODUCT_IBM_TURBOWAYS25,
+ 0,
+ "IBM",
+ "Turboways 25 ATM",
+ },
+ {
+ PCI_VENDOR_IBM, PCI_PRODUCT_IBM_MPIC2,
+ 0,
+ "IBM",
+ "MPIC-II",
+ },
+ {
+ PCI_VENDOR_IDT, PCI_PRODUCT_IDT_77201,
+ 0,
+ "IDT",
+ "77201/77211 ATM (\"NICStAR\")",
+ },
+ {
+ PCI_VENDOR_INITIO, PCI_PRODUCT_INITIO_I920,
+ 0,
+ "Initio",
+ "INIC-920 SCSI",
+ },
+ {
+ PCI_VENDOR_INITIO, PCI_PRODUCT_INITIO_I940,
+ 0,
+ "Initio",
+ "INIC-940 SCSI",
+ },
+ {
+ PCI_VENDOR_INITIO, PCI_PRODUCT_INITIO_I935,
+ 0,
+ "Initio",
+ "INIC-935 SCSI",
+ },
+ {
+ PCI_VENDOR_INITIO, PCI_PRODUCT_INITIO_I950,
+ 0,
+ "Initio",
+ "INIC-950 SCSI",
+ },
+ {
+ PCI_VENDOR_IMS, PCI_PRODUCT_IMS_8849,
+ 0,
+ "Integrated Micro Solutions",
+ "8849",
+ },
+ {
+ PCI_VENDOR_IMS, PCI_PRODUCT_IMS_TT128M,
+ 0,
+ "Integrated Micro Solutions",
+ "TwinTurbo 128M",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_PCEB,
+ 0,
+ "Intel",
+ "82375EB/SB PCI-EISA Bridge (PCEB)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_CDC,
+ 0,
+ "Intel",
+ "82424ZX Cache and DRAM controller (CDC)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_SIO,
+ 0,
+ "Intel",
+ "82378ZB System I/O (SIO)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82426EX,
+ 0,
+ "Intel",
+ "82426EX PCI-to-ISA Bridge (PCIB)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_PCMC,
+ 0,
+ "Intel",
+ "82434LX/NX PCI, Cache and Memory Controller (PCMC)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_IN_BUSINESS,
+ 0,
+ "Intel",
+ "InBusiness Fast Ethernet LAN Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82559ER,
+ 0,
+ "Intel",
+ "82559ER Fast Ethernet LAN Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82092AA,
+ 0,
+ "Intel",
+ "82092AA IDE controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_SAA7116,
+ 0,
+ "Intel",
+ "SAA7116",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82596,
+ 0,
+ "Intel",
+ "82596 LAN Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_EEPRO100,
+ 0,
+ "Intel",
+ "EE Pro 100 10/100 Fast Ethernet",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_EEPRO100S,
+ 0,
+ "Intel",
+ "EE Pro 100 Smart 10/100 Fast Ethernet",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82557,
+ 0,
+ "Intel",
+ "82557 Fast Ethernet LAN Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82437FX,
+ 0,
+ "Intel",
+ "82437FX System Controller (TSC)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82371FB_ISA,
+ 0,
+ "Intel",
+ "82371FB PCI-to-ISA Bridge (PIIX)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82371FB_IDE,
+ 0,
+ "Intel",
+ "82371FB IDE controller (PIIX)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82371MX,
+ 0,
+ "Intel",
+ "82371MX Mobile PCI I/O IDE Xcelerator (MPIIX)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82437MX,
+ 0,
+ "Intel",
+ "82437MX Mobile System Controller (MTSC)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82441FX,
+ 0,
+ "Intel",
+ "82441FX PCI and Memory Controller (PMC)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82380AB,
+ 0,
+ "Intel",
+ "82380AB Mobile PCI-to-ISA Bridge (MISA)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82380FB,
+ 0,
+ "Intel",
+ "82380FB Mobile PCI-to-PCI Bridge (MPCI2)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82439HX,
+ 0,
+ "Intel",
+ "82439HX System Controller (TXC)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801AA_LPC,
+ 0,
+ "Intel",
+ "82801AA LPC Interface Bridge",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801AA_IDE,
+ 0,
+ "Intel",
+ "82801AA IDE Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801AA_USB,
+ 0,
+ "Intel",
+ "82801AA USB Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801AA_SMB,
+ 0,
+ "Intel",
+ "82801AA SMBus Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801AA_ACA,
+ 0,
+ "Intel",
+ "82801AA AC-97 Audio Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801AA_ACM,
+ 0,
+ "Intel",
+ "82801AA AC-97 PCI Modem",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801AA_HPB,
+ 0,
+ "Intel",
+ "82801AA Hub-to-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801AB_LPC,
+ 0,
+ "Intel",
+ "82801AB LPC Interface Bridge",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801AB_IDE,
+ 0,
+ "Intel",
+ "82801AB IDE Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801AB_USB,
+ 0,
+ "Intel",
+ "82801AB USB Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801AB_SMB,
+ 0,
+ "Intel",
+ "82801AB SMBus Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801AB_ACA,
+ 0,
+ "Intel",
+ "82801AB AC-97 Audio Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801AB_ACM,
+ 0,
+ "Intel",
+ "82801AB AC-97 PCI Modem",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801AB_HPB,
+ 0,
+ "Intel",
+ "82801AB Hub-to-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801BA_LPC,
+ 0,
+ "Intel",
+ "82801BA LPC Interface Bridge",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801BA_USB1,
+ 0,
+ "Intel",
+ "82801BA USB Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801BA_SMB,
+ 0,
+ "Intel",
+ "82801BA SMBus Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801BA_USB2,
+ 0,
+ "Intel",
+ "82801BA USB Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801BA_ACA,
+ 0,
+ "Intel",
+ "82801BA AC-97 Audio Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801BA_ACM,
+ 0,
+ "Intel",
+ "82801BA AC-97 PCI Modem",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801BA_LAN,
+ 0,
+ "Intel",
+ "82801BA LAN Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801BA_IDE,
+ 0,
+ "Intel",
+ "82801BA IDE Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801BA_HPB,
+ 0,
+ "Intel",
+ "82801BA Hub-to-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82371SB_ISA,
+ 0,
+ "Intel",
+ "82371SB PCI-to-ISA Bridge (PIIX3)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82371SB_IDE,
+ 0,
+ "Intel",
+ "82371SB IDE Interface (PIIX3)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82371SB_USB,
+ 0,
+ "Intel",
+ "82371SB USB Host Controller (PIIX3)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82437VX,
+ 0,
+ "Intel",
+ "82437VX System Controller (TVX)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82439TX,
+ 0,
+ "Intel",
+ "82439TX System Controller (MTXC)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82371AB_ISA,
+ 0,
+ "Intel",
+ "82371AB PCI-to-ISA Bridge (PIIX4)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82371AB_IDE,
+ 0,
+ "Intel",
+ "82371AB IDE controller (PIIX4)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82371AB_USB,
+ 0,
+ "Intel",
+ "82371AB USB Host Controller (PIIX4)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82371AB_PMC,
+ 0,
+ "Intel",
+ "82371AB Power Management Controller (PIIX4)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82810_MCH,
+ 0,
+ "Intel",
+ "82810 Memory Controller Hub",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82810_GC,
+ 0,
+ "Intel",
+ "82810 Graphics Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82810_DC100_MCH,
+ 0,
+ "Intel",
+ "82810-DC100 Memory Controller Hub",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82810_DC100_GC,
+ 0,
+ "Intel",
+ "82810-DC100 Graphics Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82810E_MCH,
+ 0,
+ "Intel",
+ "82810E Memory Controller Hub",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82810E_GC,
+ 0,
+ "Intel",
+ "82810E Graphics Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82443LX,
+ 0,
+ "Intel",
+ "82443LX PCI AGP Controller (PAC)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82443LX_AGP,
+ 0,
+ "Intel",
+ "82443LX AGP Interface (PAC)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82443BX,
+ 0,
+ "Intel",
+ "82443BX Host Bridge/Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82443BX_AGP,
+ 0,
+ "Intel",
+ "82443BX AGP Interface",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82443BX_NOAGP,
+ 0,
+ "Intel",
+ "82443BX Host Bridge/Controller (AGP disabled)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82440MX,
+ 0,
+ "Intel",
+ "82440MX Host Bridge/Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82440MX_ACA,
+ 0,
+ "Intel",
+ "82440MX AC-97 Audio Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82440MX_ISA,
+ 0,
+ "Intel",
+ "82440MX PCI-to-ISA Bridge",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82440MX_IDE,
+ 0,
+ "Intel",
+ "82440MX IDE Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82440MX_USB,
+ 0,
+ "Intel",
+ "82440MX USB Host Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82440MX_PMC,
+ 0,
+ "Intel",
+ "82440MX Power Management Controller",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I740,
+ 0,
+ "Intel",
+ "i740 Graphics Accelerator",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_PCI450_PB,
+ 0,
+ "Intel",
+ "82454KX/GX PCI Bridge (PB)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_PCI450_MC,
+ 0,
+ "Intel",
+ "82451KX/GX Memory Controller (MC)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82451NX_MIOC,
+ 0,
+ "Intel",
+ "82451NX Memory & I/O Controller (MIOC)",
+ },
+ {
+ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82451NX_PXB,
+ 0,
+ "Intel",
+ "82451NX PCI Expander Bridge (PXB)",
+ },
+ {
+ PCI_VENDOR_INTERGRAPH, PCI_PRODUCT_INTERGRAPH_4D50T,
+ 0,
+ "Intergraph",
+ "Powerstorm 4D50T",
+ },
+ {
+ PCI_VENDOR_ITT, PCI_PRODUCT_ITT_AGX016,
+ 0,
+ "I. T. T.",
+ "AGX016",
+ },
+ {
+ PCI_VENDOR_ITT, PCI_PRODUCT_ITT_ITT3204,
+ 0,
+ "I. T. T.",
+ "ITT3204 MPEG Decoder",
+ },
+ {
+ PCI_VENDOR_KTI, PCI_PRODUCT_KTI_NE2KETHER,
+ 0,
+ "KTI",
+ "Ethernet",
+ },
+ {
+ PCI_VENDOR_LMC, PCI_PRODUCT_LMC_HSSI,
+ 0,
+ "LAN Media Corporation",
+ "HSSI Interface",
+ },
+ {
+ PCI_VENDOR_LMC, PCI_PRODUCT_LMC_DS3,
+ 0,
+ "LAN Media Corporation",
+ "DS3 Interface",
+ },
+ {
+ PCI_VENDOR_LMC, PCI_PRODUCT_LMC_SSI,
+ 0,
+ "LAN Media Corporation",
+ "SSI",
+ },
+ {
+ PCI_VENDOR_LEADTEK, PCI_PRODUCT_LEADTEK_S3_805,
+ 0,
+ "LeadTek Research",
+ "S3 805",
+ },
+ {
+ PCI_VENDOR_LINEARSYS, PCI_PRODUCT_LINEARSYS_DVB_TX,
+ 0,
+ "Linear Systems",
+ "DVB Transmitter",
+ },
+ {
+ PCI_VENDOR_LINEARSYS, PCI_PRODUCT_LINEARSYS_DVB_RX,
+ 0,
+ "Linear Systems",
+ "DVB Receiver",
+ },
+ {
+ PCI_VENDOR_LITEON, PCI_PRODUCT_LITEON_82C168,
+ 0,
+ "Lite-On Communications",
+ "82C168/82C169 (PNIC) 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_LITEON, PCI_PRODUCT_LITEON_82C115,
+ 0,
+ "Lite-On Communications",
+ "82C115 (PNIC II) 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_0440,
+ 0,
+ "AT&T Microelectronics",
+ "K56flex DSVD LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_0441,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_0442,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_0443,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_0444,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_0445,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_0446,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_0447,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_0448,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_0449,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_044A,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_044B,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_044C,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_044D,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_044E,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_0450,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_0451,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_0452,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_0453,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_0454,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_0455,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_0456,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_0457,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_0458,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_0459,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_LTMODEM_045A,
+ 0,
+ "AT&T Microelectronics",
+ "LTMODEM",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_USBHC,
+ 0,
+ "AT&T Microelectronics",
+ "USB Host Controller",
+ },
+ {
+ PCI_VENDOR_MACRONIX, PCI_PRODUCT_MACRONIX_MX98713,
+ 0,
+ "Macronix",
+ "MX98713 (PMAC) 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_MACRONIX, PCI_PRODUCT_MACRONIX_MX987x5,
+ 0,
+ "Macronix",
+ "MX987x5 (PMAC) 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_MADGE, PCI_PRODUCT_MADGE_COLLAGE25,
+ 0,
+ "Madge Networks",
+ "Collage 25 ATM adapter",
+ },
+ {
+ PCI_VENDOR_MADGE, PCI_PRODUCT_MADGE_COLLAGE155,
+ 0,
+ "Madge Networks",
+ "Collage 155 ATM adapter",
+ },
+ {
+ PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_ATLAS,
+ 0,
+ "Matrox",
+ "MGA PX2085 (\"Atlas\")",
+ },
+ {
+ PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_MILLENNIUM,
+ 0,
+ "Matrox",
+ "MGA Millennium 2064W",
+ },
+ {
+ PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_MYSTIQUE,
+ 0,
+ "Matrox",
+ "MGA Mystique 1064SG",
+ },
+ {
+ PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_MILLENNIUM2,
+ 0,
+ "Matrox",
+ "MGA Millennium II 2164W",
+ },
+ {
+ PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_MILLENNIUM2_AGP,
+ 0,
+ "Matrox",
+ "MGA Millennium II 2164WA-B AG",
+ },
+ {
+ PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_G200_PCI,
+ 0,
+ "Matrox",
+ "MGA G200 PCI",
+ },
+ {
+ PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_G200_AGP,
+ 0,
+ "Matrox",
+ "MGA G200 AGP",
+ },
+ {
+ PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_G400_AGP,
+ 0,
+ "Matrox",
+ "MGA G400 AGP",
+ },
+ {
+ PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_IMPRESSION,
+ 0,
+ "Matrox",
+ "MGA Impression",
+ },
+ {
+ PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_G100_PCI,
+ 0,
+ "Matrox",
+ "MGA G100 PCI",
+ },
+ {
+ PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_G100_AGP,
+ 0,
+ "Matrox",
+ "MGA G100 AGP",
+ },
+ {
+ PCI_VENDOR_MOT, PCI_PRODUCT_MOT_MPC105,
+ 0,
+ "Motorola",
+ "MPC105 \"Eagle\" Host Bridge",
+ },
+ {
+ PCI_VENDOR_MOT, PCI_PRODUCT_MOT_MPC106,
+ 0,
+ "Motorola",
+ "MPC106 \"Grackle\" Host Bridge",
+ },
+ {
+ PCI_VENDOR_MYLEX, PCI_PRODUCT_MYLEX_960P,
+ 0,
+ "Mylex",
+ "DAC960P RAID controller",
+ },
+ {
+ PCI_VENDOR_MUTECH, PCI_PRODUCT_MUTECH_MV1000,
+ 0,
+ "Mutech",
+ "MV1000",
+ },
+ {
+ PCI_VENDOR_NETVIN, PCI_PRODUCT_NETVIN_5000,
+ 0,
+ "NetVin",
+ "5000 Ethernet",
+ },
+ {
+ PCI_VENDOR_NEWBRIDGE, PCI_PRODUCT_NEWBRIDGE_CA91CX42,
+ 0,
+ "Newbridge Microsystems / Tundra Semiconductor",
+ "Universe VME bridge",
+ },
+ {
+ PCI_VENDOR_NS, PCI_PRODUCT_NS_DP83810,
+ 0,
+ "National Semiconductor",
+ "DP83810 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_NS, PCI_PRODUCT_NS_DP83815,
+ 0,
+ "National Semiconductor",
+ "DP83815 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_NS, PCI_PRODUCT_NS_NS87410,
+ 0,
+ "National Semiconductor",
+ "NS87410",
+ },
+ {
+ PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_810,
+ 0,
+ "Symbios Logic",
+ "53c810",
+ },
+ {
+ PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_820,
+ 0,
+ "Symbios Logic",
+ "53c820",
+ },
+ {
+ PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_825,
+ 0,
+ "Symbios Logic",
+ "53c825",
+ },
+ {
+ PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_815,
+ 0,
+ "Symbios Logic",
+ "53c815",
+ },
+ {
+ PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_810AP,
+ 0,
+ "Symbios Logic",
+ "53c810AP",
+ },
+ {
+ PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_860,
+ 0,
+ "Symbios Logic",
+ "53c860",
+ },
+ {
+ PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_896,
+ 0,
+ "Symbios Logic",
+ "53c896",
+ },
+ {
+ PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_895,
+ 0,
+ "Symbios Logic",
+ "53c895",
+ },
+ {
+ PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_885,
+ 0,
+ "Symbios Logic",
+ "53c885",
+ },
+ {
+ PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_875,
+ 0,
+ "Symbios Logic",
+ "53c875",
+ },
+ {
+ PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_1510,
+ 0,
+ "Symbios Logic",
+ "53c1510",
+ },
+ {
+ PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_875J,
+ 0,
+ "Symbios Logic",
+ "53c875J",
+ },
+ {
+ PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_PE_GNIC,
+ 0,
+ "Symbios Logic",
+ "Packet Engines G-NIC Ethernet",
+ },
+ {
+ PCI_VENDOR_NEC, PCI_PRODUCT_NEC_USB,
+ 0,
+ "NEC",
+ "USB Host Controller",
+ },
+ {
+ PCI_VENDOR_NEC, PCI_PRODUCT_NEC_POWERVR2,
+ 0,
+ "NEC",
+ "PowerVR PCX2",
+ },
+ {
+ PCI_VENDOR_NEC, PCI_PRODUCT_NEC_PD72872,
+ 0,
+ "NEC",
+ "uPD72872 IEEE 1394 OHCI Host Controller",
+ },
+ {
+ PCI_VENDOR_NEC, PCI_PRODUCT_NEC_PD72870,
+ 0,
+ "NEC",
+ "uPD72870 IEEE 1394 OHCI Host Controller",
+ },
+ {
+ PCI_VENDOR_NEC, PCI_PRODUCT_NEC_PD72871,
+ 0,
+ "NEC",
+ "uPD72871 IEEE 1394 OHCI Host Controller",
+ },
+ {
+ PCI_VENDOR_NEOMAGIC, PCI_PRODUCT_NEOMAGIC_NMMG128ZV,
+ 0,
+ "Neomagic",
+ "MagicGraph 128ZV",
+ },
+ {
+ PCI_VENDOR_NEOMAGIC, PCI_PRODUCT_NEOMAGIC_NMMG2160,
+ 0,
+ "Neomagic",
+ "MagicGraph 128XD",
+ },
+ {
+ PCI_VENDOR_NEOMAGIC, PCI_PRODUCT_NEOMAGIC_NMMM256AV_VGA,
+ 0,
+ "Neomagic",
+ "MagicMedia 256AV VGA",
+ },
+ {
+ PCI_VENDOR_NEOMAGIC, PCI_PRODUCT_NEOMAGIC_NMMM256ZX_VGA,
+ 0,
+ "Neomagic",
+ "MagicMedia 256ZX VGA",
+ },
+ {
+ PCI_VENDOR_NEOMAGIC, PCI_PRODUCT_NEOMAGIC_NMMM256AV_AU,
+ 0,
+ "Neomagic",
+ "MagicMedia 256AV Audio",
+ },
+ {
+ PCI_VENDOR_NEOMAGIC, PCI_PRODUCT_NEOMAGIC_NMMM256ZX_AU,
+ 0,
+ "Neomagic",
+ "MagicMedia 256ZX Audio",
+ },
+ {
+ PCI_VENDOR_NETGEAR, PCI_PRODUCT_NETGEAR_GA620,
+ 0,
+ "Netgear",
+ "GA620 Gigabit Ethernet",
+ },
+ {
+ PCI_VENDOR_NEXGEN, PCI_PRODUCT_NEXGEN_NX82C501,
+ 0,
+ "NexGen Microsystems",
+ "NX82C501 Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_NKK, PCI_PRODUCT_NKK_NDR4600,
+ 0,
+ "NKK Corporation",
+ "NDR4600 Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_NUMBER9, PCI_PRODUCT_NUMBER9_I128,
+ 0,
+ "Number 9 Computer Company",
+ "Imagine-128",
+ },
+ {
+ PCI_VENDOR_NUMBER9, PCI_PRODUCT_NUMBER9_I128_2,
+ 0,
+ "Number 9 Computer Company",
+ "Imagine-128 II",
+ },
+ {
+ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_RIVATNT,
+ 0,
+ "Nvidia Corporation",
+ "RIVA TNT",
+ },
+ {
+ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_RIVATNT2,
+ 0,
+ "Nvidia Corporation",
+ "RIVA TNT2",
+ },
+ {
+ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_RIVATNT2U,
+ 0,
+ "Nvidia Corporation",
+ "RIVA TNT2 Ultra",
+ },
+ {
+ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_VANTA,
+ 0,
+ "Nvidia Corporation",
+ "Vanta",
+ },
+ {
+ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_RIVATNT2M64,
+ 0,
+ "Nvidia Corporation",
+ "RIVA TNT2 Model 64",
+ },
+ {
+ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_ALADDINTNT2,
+ 0,
+ "Nvidia Corporation",
+ "Aladdin TNT2",
+ },
+ {
+ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_GEFORCE256,
+ 0,
+ "Nvidia Corporation",
+ "GeForce 256",
+ },
+ {
+ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_GEFORCEDDR,
+ 0,
+ "Nvidia Corporation",
+ "GeForce DDR",
+ },
+ {
+ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_QUADRO,
+ 0,
+ "Nvidia Corporation",
+ "Quadro",
+ },
+ {
+ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_GEFORCE2,
+ 0,
+ "Nvidia Corporation",
+ "GeForce2 GTS",
+ },
+ {
+ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_GEFORCE2DDR,
+ 0,
+ "Nvidia Corporation",
+ "GeForce2 GTS (DDR)",
+ },
+ {
+ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_GEFORCE2BR,
+ 0,
+ "Nvidia Corporation",
+ "GeForce2 GTS",
+ },
+ {
+ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_QUADRO2,
+ 0,
+ "Nvidia Corporation",
+ "Quadro2",
+ },
+ {
+ PCI_VENDOR_NVIDIA_SGS, PCI_PRODUCT_NVIDIA_SGS_RIVA128,
+ 0,
+ "Nvidia Corporation & SGS Thomson Microelectric",
+ "Riva 128",
+ },
+ {
+ PCI_VENDOR_OAKTECH, PCI_PRODUCT_OAKTECH_OTI1007,
+ 0,
+ "Oak Technology",
+ "OTI107",
+ },
+ {
+ PCI_VENDOR_OLICOM, PCI_PRODUCT_OLICOM_OC2183,
+ 0,
+ "Olicom",
+ "Olicom OC-2183/2185 Ethernet",
+ },
+ {
+ PCI_VENDOR_OLICOM, PCI_PRODUCT_OLICOM_OC2325,
+ 0,
+ "Olicom",
+ "Olicom OC-2325 Ethernet",
+ },
+ {
+ PCI_VENDOR_OLICOM, PCI_PRODUCT_OLICOM_OC2326,
+ 0,
+ "Olicom",
+ "Olicom OC-2326 10/100-TX Ethernet",
+ },
+ {
+ PCI_VENDOR_OPTI, PCI_PRODUCT_OPTI_82C557,
+ 0,
+ "Opti",
+ "82C557",
+ },
+ {
+ PCI_VENDOR_OPTI, PCI_PRODUCT_OPTI_82C558,
+ 0,
+ "Opti",
+ "82C558",
+ },
+ {
+ PCI_VENDOR_OPTI, PCI_PRODUCT_OPTI_82C568,
+ 0,
+ "Opti",
+ "82C568",
+ },
+ {
+ PCI_VENDOR_OPTI, PCI_PRODUCT_OPTI_82D568,
+ 0,
+ "Opti",
+ "82D568",
+ },
+ {
+ PCI_VENDOR_OPTI, PCI_PRODUCT_OPTI_82C621,
+ 0,
+ "Opti",
+ "82C621",
+ },
+ {
+ PCI_VENDOR_OPTI, PCI_PRODUCT_OPTI_82C822,
+ 0,
+ "Opti",
+ "82C822",
+ },
+ {
+ PCI_VENDOR_OPTI, PCI_PRODUCT_OPTI_RM861HA,
+ 0,
+ "Opti",
+ "RM861HA",
+ },
+ {
+ PCI_VENDOR_OPTI, PCI_PRODUCT_OPTI_82C700,
+ 0,
+ "Opti",
+ "82C700",
+ },
+ {
+ PCI_VENDOR_OPTI, PCI_PRODUCT_OPTI_82C701,
+ 0,
+ "Opti",
+ "82C701",
+ },
+ {
+ PCI_VENDOR_PCTECH, PCI_PRODUCT_PCTECH_RZ1000,
+ 0,
+ "PC Technology",
+ "RZ1000",
+ },
+ {
+ PCI_VENDOR_PLX, PCI_PRODUCT_PLX_9060ES,
+ 0,
+ "PLX Technology",
+ "9060ES PCI bus controller",
+ },
+ {
+ PCI_VENDOR_PROLAN, PCI_PRODUCT_PROLAN_NE2KETHER,
+ 0,
+ "ProLAN",
+ "Ethernet",
+ },
+ {
+ PCI_VENDOR_PROMISE, PCI_PRODUCT_PROMISE_DC5030,
+ 0,
+ "Promise Technology",
+ "DC5030",
+ },
+ {
+ PCI_VENDOR_PROMISE, PCI_PRODUCT_PROMISE_ULTRA33,
+ 0,
+ "Promise Technology",
+ "Ultra33/ATA Bus Master IDE Accelerator",
+ },
+ {
+ PCI_VENDOR_PROMISE, PCI_PRODUCT_PROMISE_ULTRA66,
+ 0,
+ "Promise Technology",
+ "Ultra66/ATA Bus Master IDE Accelerator",
+ },
+ {
+ PCI_VENDOR_PROMISE, PCI_PRODUCT_PROMISE_ULTRA100,
+ 0,
+ "Promise Technology",
+ "Ultra100/ATA Bus Master IDE Accelerator",
+ },
+ {
+ PCI_VENDOR_QLOGIC, PCI_PRODUCT_QLOGIC_ISP1020,
+ 0,
+ "Q Logic",
+ "ISP1020",
+ },
+ {
+ PCI_VENDOR_QLOGIC, PCI_PRODUCT_QLOGIC_ISP1022,
+ 0,
+ "Q Logic",
+ "ISP1022",
+ },
+ {
+ PCI_VENDOR_QLOGIC, PCI_PRODUCT_QLOGIC_ISP1080,
+ 0,
+ "Q Logic",
+ "ISP1080",
+ },
+ {
+ PCI_VENDOR_QLOGIC, PCI_PRODUCT_QLOGIC_ISP1240,
+ 0,
+ "Q Logic",
+ "ISP1240",
+ },
+ {
+ PCI_VENDOR_QLOGIC, PCI_PRODUCT_QLOGIC_ISP2100,
+ 0,
+ "Q Logic",
+ "ISP2100",
+ },
+ {
+ PCI_VENDOR_QUANTUMDESIGNS, PCI_PRODUCT_QUANTUMDESIGNS_8500,
+ 0,
+ "Quantum Designs",
+ "8500",
+ },
+ {
+ PCI_VENDOR_QUANTUMDESIGNS, PCI_PRODUCT_QUANTUMDESIGNS_8580,
+ 0,
+ "Quantum Designs",
+ "8580",
+ },
+ {
+ PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8029,
+ 0,
+ "Realtek Semiconductor",
+ "8029 Ethernet",
+ },
+ {
+ PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8129,
+ 0,
+ "Realtek Semiconductor",
+ "8129 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8139,
+ 0,
+ "Realtek Semiconductor",
+ "8139 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_RICOH, PCI_PRODUCT_RICOH_Rx5C465,
+ 0,
+ "Ricoh",
+ "5C465 PCI-CardBus bridge",
+ },
+ {
+ PCI_VENDOR_RICOH, PCI_PRODUCT_RICOH_Rx5C466,
+ 0,
+ "Ricoh",
+ "5C466 PCI-CardBus bridge",
+ },
+ {
+ PCI_VENDOR_RICOH, PCI_PRODUCT_RICOH_Rx5C475,
+ 0,
+ "Ricoh",
+ "5C475 PCI-CardBus bridge",
+ },
+ {
+ PCI_VENDOR_RICOH, PCI_PRODUCT_RICOH_RL5C476,
+ 0,
+ "Ricoh",
+ "5C476 PCI-CardBus bridge",
+ },
+ {
+ PCI_VENDOR_RICOH, PCI_PRODUCT_RICOH_Rx5C477,
+ 0,
+ "Ricoh",
+ "5C477 PCI-CardBus bridge",
+ },
+ {
+ PCI_VENDOR_RICOH, PCI_PRODUCT_RICOH_Rx5C478,
+ 0,
+ "Ricoh",
+ "5C478 PCI-CardBus bridge",
+ },
+ {
+ PCI_VENDOR_RISCOM, PCI_PRODUCT_RISCOM_N2,
+ 0,
+ "RISCom",
+ "N2",
+ },
+ {
+ PCI_VENDOR_RNS, PCI_PRODUCT_RNS_FDDI,
+ 0,
+ "RNS",
+ "2200 FDDI",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_VIRGE,
+ 0,
+ "S3",
+ "ViRGE",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_TRIO32,
+ 0,
+ "S3",
+ "Trio32",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_TRIO64,
+ 0,
+ "S3",
+ "Trio32/64",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_AURORA64P,
+ 0,
+ "S3",
+ "Aurora64V+",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_TRIO64UVP,
+ 0,
+ "S3",
+ "Trio64UV+",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_VIRGE_VX,
+ 0,
+ "S3",
+ "ViRGE/VX",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_868,
+ 0,
+ "S3",
+ "868",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_928,
+ 0,
+ "S3",
+ "86C928",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_864_0,
+ 0,
+ "S3",
+ "86C864-0",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_864_1,
+ 0,
+ "S3",
+ "86C864-1",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_864_2,
+ 0,
+ "S3",
+ "86C864-2",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_864_3,
+ 0,
+ "S3",
+ "86C864-3",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_964_0,
+ 0,
+ "S3",
+ "86C964-0",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_964_1,
+ 0,
+ "S3",
+ "86C964-1",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_964_2,
+ 0,
+ "S3",
+ "86C964-2",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_964_3,
+ 0,
+ "S3",
+ "86C964-3",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_968_0,
+ 0,
+ "S3",
+ "86C968-0",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_968_1,
+ 0,
+ "S3",
+ "86C968-1",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_968_2,
+ 0,
+ "S3",
+ "86C968-2",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_968_3,
+ 0,
+ "S3",
+ "86C968-3",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_TRIO64V2_DX,
+ 0,
+ "S3",
+ "Trio64V2/DX",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_PLATO_PX,
+ 0,
+ "S3",
+ "Plato/PX",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_TRIO3D,
+ 0,
+ "S3",
+ "86C365 Trio3D",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_VIRGE_DX,
+ 0,
+ "S3",
+ "ViRGE/DX",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_VIRGE_GX2,
+ 0,
+ "S3",
+ "ViRGE/GX2",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_TRIO3D2X,
+ 0,
+ "S3",
+ "Trio3D/2X",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_SAVAGE3D,
+ 0,
+ "S3",
+ "Savage3D",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_SAVAGE3D_MV,
+ 0,
+ "S3",
+ "Savage3D+MV",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_SAVAGE4,
+ 0,
+ "S3",
+ "Savage4",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_VIRGE_MX,
+ 0,
+ "S3",
+ "ViRGE/MX",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_VIRGE_MXP,
+ 0,
+ "S3",
+ "ViRGE/MXP",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_SAVAGE_MX_MV,
+ 0,
+ "S3",
+ "Savage/MX+MV",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_SAVAGE_MX,
+ 0,
+ "S3",
+ "Savage/MX",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_SAVAGE_IX_MV,
+ 0,
+ "S3",
+ "Savage/IX+MV",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_SAVAGE_IX,
+ 0,
+ "S3",
+ "Savage/IX",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_SAVAGE2000,
+ 0,
+ "S3",
+ "Savage2000",
+ },
+ {
+ PCI_VENDOR_S3, PCI_PRODUCT_S3_SONICVIBES,
+ 0,
+ "S3",
+ "SonicVibes",
+ },
+ {
+ PCI_VENDOR_SAMSUNGSEMI, PCI_PRODUCT_SAMSUNGSEMI_KS8920,
+ 0,
+ "Samsung Semiconductors",
+ "KS8920 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_SGI, PCI_PRODUCT_SGI_IOC3,
+ 0,
+ "Silicon Graphics",
+ "IOC3",
+ },
+ {
+ PCI_VENDOR_SGI, PCI_PRODUCT_SGI_RAD1,
+ 0,
+ "Silicon Graphics",
+ "PsiTech RAD1",
+ },
+ {
+ PCI_VENDOR_SGI, PCI_PRODUCT_SGI_TIGON,
+ 0,
+ "Silicon Graphics",
+ "Tigon Gigabit Ethernet",
+ },
+ {
+ PCI_VENDOR_SGSTHOMSON, PCI_PRODUCT_SGSTHOMSON_2000,
+ 0,
+ "SGS Thomson Microelectric",
+ "STG 2000X",
+ },
+ {
+ PCI_VENDOR_SGSTHOMSON, PCI_PRODUCT_SGSTHOMSON_1764,
+ 0,
+ "SGS Thomson Microelectric",
+ "STG 1764X",
+ },
+ {
+ PCI_VENDOR_SIBYTE, PCI_PRODUCT_SIBYTE_SB1250_PCI,
+ 0,
+ "SiByte, Inc.",
+ "BCM1250 PCI Host Bridge",
+ },
+ {
+ PCI_VENDOR_SIBYTE, PCI_PRODUCT_SIBYTE_SB1250_LDT,
+ 0,
+ "SiByte, Inc.",
+ "BCM1250 HyperTransport Host Bridge",
+ },
+ {
+ PCI_VENDOR_SIGMA, PCI_PRODUCT_SIGMA_HOLLYWOODPLUS,
+ 0,
+ "Sigma Designs",
+ "REALmagic Hollywood-Plus MPEG-2 Decoder",
+ },
+ {
+ PCI_VENDOR_SIS, PCI_PRODUCT_SIS_86C201,
+ 0,
+ "Silicon Integrated System",
+ "86C201",
+ },
+ {
+ PCI_VENDOR_SIS, PCI_PRODUCT_SIS_86C202,
+ 0,
+ "Silicon Integrated System",
+ "86C202",
+ },
+ {
+ PCI_VENDOR_SIS, PCI_PRODUCT_SIS_86C205,
+ 0,
+ "Silicon Integrated System",
+ "86C205",
+ },
+ {
+ PCI_VENDOR_SIS, PCI_PRODUCT_SIS_85C503,
+ 0,
+ "Silicon Integrated System",
+ "85C503 or 5597/5598 ISA bridge",
+ },
+ {
+ PCI_VENDOR_SIS, PCI_PRODUCT_SIS_600PMC,
+ 0,
+ "Silicon Integrated System",
+ "600 Power Mngmt Controller",
+ },
+ {
+ PCI_VENDOR_SIS, PCI_PRODUCT_SIS_5597_VGA,
+ 0,
+ "Silicon Integrated System",
+ "5597/5598 integrated VGA",
+ },
+ {
+ PCI_VENDOR_SIS, PCI_PRODUCT_SIS_85C501,
+ 0,
+ "Silicon Integrated System",
+ "85C501",
+ },
+ {
+ PCI_VENDOR_SIS, PCI_PRODUCT_SIS_85C496,
+ 0,
+ "Silicon Integrated System",
+ "85C496",
+ },
+ {
+ PCI_VENDOR_SIS, PCI_PRODUCT_SIS_530HB,
+ 0,
+ "Silicon Integrated System",
+ "530 Host to PCI Bridge",
+ },
+ {
+ PCI_VENDOR_SIS, PCI_PRODUCT_SIS_85C601,
+ 0,
+ "Silicon Integrated System",
+ "85C601",
+ },
+ {
+ PCI_VENDOR_SIS, PCI_PRODUCT_SIS_900,
+ 0,
+ "Silicon Integrated System",
+ "SiS 900 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_SIS, PCI_PRODUCT_SIS_5597_IDE,
+ 0,
+ "Silicon Integrated System",
+ "5597/5598 IDE controller",
+ },
+ {
+ PCI_VENDOR_SIS, PCI_PRODUCT_SIS_5597_HB,
+ 0,
+ "Silicon Integrated System",
+ "5597/5598 host bridge",
+ },
+ {
+ PCI_VENDOR_SIS, PCI_PRODUCT_SIS_530VGA,
+ 0,
+ "Silicon Integrated System",
+ "530 GUI Accelerator+3D",
+ },
+ {
+ PCI_VENDOR_SIS, PCI_PRODUCT_SIS_6326,
+ 0,
+ "Silicon Integrated System",
+ "6326 AGP VGA",
+ },
+ {
+ PCI_VENDOR_SIS, PCI_PRODUCT_SIS_5597_USB,
+ 0,
+ "Silicon Integrated System",
+ "5597/5598 USB host controller",
+ },
+ {
+ PCI_VENDOR_SIS, PCI_PRODUCT_SIS_7016,
+ 0,
+ "Silicon Integrated System",
+ "SiS 7016 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_SILMOTION, PCI_PRODUCT_SILMOTION_LYNX_E,
+ 0,
+ "Silicon Motion",
+ "Lynx E",
+ },
+ {
+ PCI_VENDOR_SMC, PCI_PRODUCT_SMC_37C665,
+ 0,
+ "Standard Microsystems",
+ "FDC 37C665",
+ },
+ {
+ PCI_VENDOR_SMC, PCI_PRODUCT_SMC_37C922,
+ 0,
+ "Standard Microsystems",
+ "FDC 37C922",
+ },
+ {
+ PCI_VENDOR_SMC, PCI_PRODUCT_SMC_83C170,
+ 0,
+ "Standard Microsystems",
+ "83C170 (\"EPIC/100\") Fast Ethernet",
+ },
+ {
+ PCI_VENDOR_SMC, PCI_PRODUCT_SMC_83C175,
+ 0,
+ "Standard Microsystems",
+ "83C175 (\"EPIC/100\") Fast Ethernet",
+ },
+ {
+ PCI_VENDOR_SOLIDUM, PCI_PRODUCT_SOLIDUM_AMD971,
+ 0,
+ "Solidum Systems Corp.",
+ "SNP8023: AMD 971",
+ },
+ {
+ PCI_VENDOR_SOLIDUM, PCI_PRODUCT_SOLIDUM_CLASS802,
+ 0,
+ "Solidum Systems Corp.",
+ "SNP8023: Classifier Engine",
+ },
+ {
+ PCI_VENDOR_SONY, PCI_PRODUCT_SONY_CXD1947A,
+ 0,
+ "Sony",
+ "CXD1947A IEEE 1394 Host Controller",
+ },
+ {
+ PCI_VENDOR_SONY, PCI_PRODUCT_SONY_CXD32222,
+ 0,
+ "Sony",
+ "CXD3222 OHCI IEEE 1394 Host Controller",
+ },
+ {
+ PCI_VENDOR_SONY, PCI_PRODUCT_SONY_MEMSTICK,
+ 0,
+ "Sony",
+ "Memory Stick I/F Controller",
+ },
+ {
+ PCI_VENDOR_SUN, PCI_PRODUCT_SUN_EBUS,
+ 0,
+ "Sun Microsystems",
+ "PCIO Ebus2",
+ },
+ {
+ PCI_VENDOR_SUN, PCI_PRODUCT_SUN_HMENETWORK,
+ 0,
+ "Sun Microsystems",
+ "PCIO Happy Meal Ethernet",
+ },
+ {
+ PCI_VENDOR_SUN, PCI_PRODUCT_SUN_SIMBA,
+ 0,
+ "Sun Microsystems",
+ "Simba PCI bridge",
+ },
+ {
+ PCI_VENDOR_SUN, PCI_PRODUCT_SUN_MS_IIep,
+ 0,
+ "Sun Microsystems",
+ "microSPARC IIep PCI",
+ },
+ {
+ PCI_VENDOR_SUN, PCI_PRODUCT_SUN_US_IIi,
+ 0,
+ "Sun Microsystems",
+ "UltraSPARC IIi PCI",
+ },
+ {
+ PCI_VENDOR_SUNDANCETI, PCI_PRODUCT_SUNDANCETI_ST201,
+ 0,
+ "Sundance Technology",
+ "ST201 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_SURECOM, PCI_PRODUCT_SURECOM_NE34,
+ 0,
+ "Surecom Technology",
+ "NE-34 Ethernet",
+ },
+ {
+ PCI_VENDOR_SYMPHONY, PCI_PRODUCT_SYMPHONY_82C101,
+ 0,
+ "Symphony Labs",
+ "82C101",
+ },
+ {
+ PCI_VENDOR_SYMPHONY, PCI_PRODUCT_SYMPHONY_82C103,
+ 0,
+ "Symphony Labs",
+ "82C103",
+ },
+ {
+ PCI_VENDOR_SYMPHONY, PCI_PRODUCT_SYMPHONY_82C105,
+ 0,
+ "Symphony Labs",
+ "82C105",
+ },
+ {
+ PCI_VENDOR_SYMPHONY2, PCI_PRODUCT_SYMPHONY2_82C101,
+ 0,
+ "Symphony Labs (2nd PCI Vendor ID)",
+ "82C101",
+ },
+ {
+ PCI_VENDOR_SYMPHONY, PCI_PRODUCT_SYMPHONY_83C553,
+ 0,
+ "Symphony Labs",
+ "83C553 PCI-ISA Bridge",
+ },
+ {
+ PCI_VENDOR_SCHNEIDERKOCH, PCI_PRODUCT_SCHNEIDERKOCH_SKNET_FDDI,
+ 0,
+ "Schneider & Koch",
+ "SK-NET FDDI-xP",
+ },
+ {
+ PCI_VENDOR_TEKRAM, PCI_PRODUCT_TEKRAM_DC290,
+ 0,
+ "Tekram Technology (1st PCI Vendor ID)",
+ "DC-290(M)",
+ },
+ {
+ PCI_VENDOR_TEKRAM2, PCI_PRODUCT_TEKRAM2_DC690C,
+ 0,
+ "Tekram Technology (2nd PCI Vendor ID)",
+ "DC-690C",
+ },
+ {
+ PCI_VENDOR_TI, PCI_PRODUCT_TI_TLAN,
+ 0,
+ "Texas Instruments",
+ "TLAN",
+ },
+ {
+ PCI_VENDOR_TI, PCI_PRODUCT_TI_TVP4020,
+ 0,
+ "Texas Instruments",
+ "TVP4020 Permedia 2",
+ },
+ {
+ PCI_VENDOR_TI, PCI_PRODUCT_TI_TSB12LV21,
+ 0,
+ "Texas Instruments",
+ "TSB12LV21 IEEE 1394 Host Controller",
+ },
+ {
+ PCI_VENDOR_TI, PCI_PRODUCT_TI_TSB12LV22,
+ 0,
+ "Texas Instruments",
+ "TSB12LV22 OHCI IEEE 1394 Host Controller",
+ },
+ {
+ PCI_VENDOR_TI, PCI_PRODUCT_TI_TSB12LV23,
+ 0,
+ "Texas Instruments",
+ "TSB12LV23 OHCI IEEE 1394 Host Controller",
+ },
+ {
+ PCI_VENDOR_TI, PCI_PRODUCT_TI_TSB12LV26,
+ 0,
+ "Texas Instruments",
+ "TSB12LV26 OHCI IEEE 1394 Host Controller",
+ },
+ {
+ PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1130,
+ 0,
+ "Texas Instruments",
+ "PCI1130 PCI-CardBus Bridge",
+ },
+ {
+ PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1031,
+ 0,
+ "Texas Instruments",
+ "PCI1031 PCI-PCMCIA Bridge",
+ },
+ {
+ PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1131,
+ 0,
+ "Texas Instruments",
+ "PCI1131 PCI-CardBus Bridge",
+ },
+ {
+ PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1250,
+ 0,
+ "Texas Instruments",
+ "PCI1250 PCI-CardBus Bridge",
+ },
+ {
+ PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1220,
+ 0,
+ "Texas Instruments",
+ "PCI1220 PCI-CardBus Bridge",
+ },
+ {
+ PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1221,
+ 0,
+ "Texas Instruments",
+ "PCI1221 PCI-CardBus Bridge",
+ },
+ {
+ PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1450,
+ 0,
+ "Texas Instruments",
+ "PCI1450 PCI-CardBus Bridge",
+ },
+ {
+ PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1225,
+ 0,
+ "Texas Instruments",
+ "PCI1225 PCI-CardBus Bridge",
+ },
+ {
+ PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1251,
+ 0,
+ "Texas Instruments",
+ "PCI1251 PCI-CardBus Bridge",
+ },
+ {
+ PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1211,
+ 0,
+ "Texas Instruments",
+ "PCI1211 PCI-CardBus Bridge",
+ },
+ {
+ PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1251B,
+ 0,
+ "Texas Instruments",
+ "PCI1251B PCI-CardBus Bridge",
+ },
+ {
+ PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI2030,
+ 0,
+ "Texas Instruments",
+ "PCI2030 PCI-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1420,
+ 0,
+ "Texas Instruments",
+ "PCI1420 PCI-CardBus Bridge",
+ },
+ {
+ PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1451,
+ 0,
+ "Texas Instruments",
+ "PCI1451 PCI-CardBus Bridge",
+ },
+ {
+ PCI_VENDOR_TOSHIBA, PCI_PRODUCT_TOSHIBA_R4X00,
+ 0,
+ "Toshiba America",
+ "R4x00 Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_TOSHIBA, PCI_PRODUCT_TOSHIBA_TC35856F,
+ 0,
+ "Toshiba America",
+ "TC35856F ATM (\"Meteor\")",
+ },
+ {
+ PCI_VENDOR_TOSHIBA2, PCI_PRODUCT_TOSHIBA2_HOST,
+ 0,
+ "Toshiba America Info Systems",
+ "Host Bridge/Controller",
+ },
+ {
+ PCI_VENDOR_TOSHIBA2, PCI_PRODUCT_TOSHIBA2_ISA,
+ 0,
+ "Toshiba America Info Systems",
+ "ISA Bridge",
+ },
+ {
+ PCI_VENDOR_TOSHIBA2, PCI_PRODUCT_TOSHIBA2_ToPIC95,
+ 0,
+ "Toshiba America Info Systems",
+ "ToPIC95 CardBus-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_TOSHIBA2, PCI_PRODUCT_TOSHIBA2_ToPIC95B,
+ 0,
+ "Toshiba America Info Systems",
+ "ToPIC95B CardBus-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_TOSHIBA2, PCI_PRODUCT_TOSHIBA2_ToPIC97,
+ 0,
+ "Toshiba America Info Systems",
+ "ToPIC97 CardBus-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_TOSHIBA2, PCI_PRODUCT_TOSHIBA2_ToPIC100,
+ 0,
+ "Toshiba America Info Systems",
+ "ToPIC100 CardBus-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_TOSHIBA2, PCI_PRODUCT_TOSHIBA2_FIRO,
+ 0,
+ "Toshiba America Info Systems",
+ "Fast Infrared Type O",
+ },
+ {
+ PCI_VENDOR_TRIDENT, PCI_PRODUCT_TRIDENT_CYBERBLADE_I7,
+ 0,
+ "Trident Microsystems",
+ "CyberBlade i7",
+ },
+ {
+ PCI_VENDOR_TRIDENT, PCI_PRODUCT_TRIDENT_TGUI_9320,
+ 0,
+ "Trident Microsystems",
+ "TGUI 9320",
+ },
+ {
+ PCI_VENDOR_TRIDENT, PCI_PRODUCT_TRIDENT_TGUI_9350,
+ 0,
+ "Trident Microsystems",
+ "TGUI 9350",
+ },
+ {
+ PCI_VENDOR_TRIDENT, PCI_PRODUCT_TRIDENT_TGUI_9360,
+ 0,
+ "Trident Microsystems",
+ "TGUI 9360",
+ },
+ {
+ PCI_VENDOR_TRIDENT, PCI_PRODUCT_TRIDENT_CYBER_9397,
+ 0,
+ "Trident Microsystems",
+ "CYBER 9397",
+ },
+ {
+ PCI_VENDOR_TRIDENT, PCI_PRODUCT_TRIDENT_CYBER_9397DVD,
+ 0,
+ "Trident Microsystems",
+ "CYBER 9397DVD",
+ },
+ {
+ PCI_VENDOR_TRIDENT, PCI_PRODUCT_TRIDENT_CYBER_9525,
+ 0,
+ "Trident Microsystems",
+ "CYBER 9525",
+ },
+ {
+ PCI_VENDOR_TRIDENT, PCI_PRODUCT_TRIDENT_TGUI_9420,
+ 0,
+ "Trident Microsystems",
+ "TGUI 9420",
+ },
+ {
+ PCI_VENDOR_TRIDENT, PCI_PRODUCT_TRIDENT_TGUI_9440,
+ 0,
+ "Trident Microsystems",
+ "TGUI 9440",
+ },
+ {
+ PCI_VENDOR_TRIDENT, PCI_PRODUCT_TRIDENT_TGUI_9660,
+ 0,
+ "Trident Microsystems",
+ "TGUI 9660",
+ },
+ {
+ PCI_VENDOR_TRIDENT, PCI_PRODUCT_TRIDENT_TGUI_9680,
+ 0,
+ "Trident Microsystems",
+ "TGUI 9680",
+ },
+ {
+ PCI_VENDOR_TRIDENT, PCI_PRODUCT_TRIDENT_TGUI_9682,
+ 0,
+ "Trident Microsystems",
+ "TGUI 9682",
+ },
+ {
+ PCI_VENDOR_TRIONES, PCI_PRODUCT_TRIONES_HPT366,
+ 0,
+ "Triones Technologies",
+ "HPT366/370 IDE Controller",
+ },
+ {
+ PCI_VENDOR_TRITECH, PCI_PRODUCT_TRITECH_TR25202,
+ 0,
+ "TriTech Microelectronics",
+ "Pyramid3D TR25202",
+ },
+ {
+ PCI_VENDOR_TSENG, PCI_PRODUCT_TSENG_ET4000_W32P_A,
+ 0,
+ "Tseng Labs",
+ "ET4000w32p rev A",
+ },
+ {
+ PCI_VENDOR_TSENG, PCI_PRODUCT_TSENG_ET4000_W32P_B,
+ 0,
+ "Tseng Labs",
+ "ET4000w32p rev B",
+ },
+ {
+ PCI_VENDOR_TSENG, PCI_PRODUCT_TSENG_ET4000_W32P_C,
+ 0,
+ "Tseng Labs",
+ "ET4000w32p rev C",
+ },
+ {
+ PCI_VENDOR_TSENG, PCI_PRODUCT_TSENG_ET4000_W32P_D,
+ 0,
+ "Tseng Labs",
+ "ET4000w32p rev D",
+ },
+ {
+ PCI_VENDOR_TSENG, PCI_PRODUCT_TSENG_ET6000,
+ 0,
+ "Tseng Labs",
+ "ET6000",
+ },
+ {
+ PCI_VENDOR_UMC, PCI_PRODUCT_UMC_UM82C881,
+ 0,
+ "United Microelectronics",
+ "UM82C881 486 Chipset",
+ },
+ {
+ PCI_VENDOR_UMC, PCI_PRODUCT_UMC_UM82C886,
+ 0,
+ "United Microelectronics",
+ "UM82C886 ISA Bridge",
+ },
+ {
+ PCI_VENDOR_UMC, PCI_PRODUCT_UMC_UM8673F,
+ 0,
+ "United Microelectronics",
+ "UM8673F EIDE Controller",
+ },
+ {
+ PCI_VENDOR_UMC, PCI_PRODUCT_UMC_UM8881,
+ 0,
+ "United Microelectronics",
+ "UM8881 HB4 486 PCI Chipset",
+ },
+ {
+ PCI_VENDOR_UMC, PCI_PRODUCT_UMC_UM82C891,
+ 0,
+ "United Microelectronics",
+ "UM82C891",
+ },
+ {
+ PCI_VENDOR_UMC, PCI_PRODUCT_UMC_UM886A,
+ 0,
+ "United Microelectronics",
+ "UM886A",
+ },
+ {
+ PCI_VENDOR_UMC, PCI_PRODUCT_UMC_UM8886BF,
+ 0,
+ "United Microelectronics",
+ "UM8886BF",
+ },
+ {
+ PCI_VENDOR_UMC, PCI_PRODUCT_UMC_UM8710,
+ 0,
+ "United Microelectronics",
+ "UM8710",
+ },
+ {
+ PCI_VENDOR_UMC, PCI_PRODUCT_UMC_UM8886,
+ 0,
+ "United Microelectronics",
+ "UM8886",
+ },
+ {
+ PCI_VENDOR_UMC, PCI_PRODUCT_UMC_UM8881F,
+ 0,
+ "United Microelectronics",
+ "UM8881F PCI-Host bridge",
+ },
+ {
+ PCI_VENDOR_UMC, PCI_PRODUCT_UMC_UM8886F,
+ 0,
+ "United Microelectronics",
+ "UM8886F PCI-ISA bridge",
+ },
+ {
+ PCI_VENDOR_UMC, PCI_PRODUCT_UMC_UM8886A,
+ 0,
+ "United Microelectronics",
+ "UM8886A",
+ },
+ {
+ PCI_VENDOR_UMC, PCI_PRODUCT_UMC_UM8891A,
+ 0,
+ "United Microelectronics",
+ "UM8891A",
+ },
+ {
+ PCI_VENDOR_UMC, PCI_PRODUCT_UMC_UM9017F,
+ 0,
+ "United Microelectronics",
+ "UM9017F",
+ },
+ {
+ PCI_VENDOR_UMC, PCI_PRODUCT_UMC_UM8886N,
+ 0,
+ "United Microelectronics",
+ "UM8886N",
+ },
+ {
+ PCI_VENDOR_UMC, PCI_PRODUCT_UMC_UM8891N,
+ 0,
+ "United Microelectronics",
+ "UM8891N",
+ },
+ {
+ PCI_VENDOR_ULSI, PCI_PRODUCT_ULSI_US201,
+ 0,
+ "ULSI Systems",
+ "US201",
+ },
+ {
+ PCI_VENDOR_USR, PCI_PRODUCT_USR_3CP5609,
+ 0,
+ "US Robotics (3Com)",
+ "3CP5609 PCI 16550 Modem",
+ },
+ {
+ PCI_VENDOR_V3, PCI_PRODUCT_V3_V292PBC,
+ 0,
+ "V3 Semiconductor",
+ "V292PBC AMD290x0 Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_V3, PCI_PRODUCT_V3_V960PBC,
+ 0,
+ "V3 Semiconductor",
+ "V960PBC i960 Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_V3, PCI_PRODUCT_V3_V96DPC,
+ 0,
+ "V3 Semiconductor",
+ "V96DPC i960 (Dual) Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT8371_HB,
+ 0,
+ "VIA Technologies",
+ "VT8371 (Apollo KX133) Host Bridge",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT8501_MVP4,
+ 0,
+ "VIA Technologies",
+ "VT8501 MVP4 System Controller",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C505,
+ 0,
+ "VIA Technologies",
+ "VT82C505 (Pluto)",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C561,
+ 0,
+ "VIA Technologies",
+ "VT82C561",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C586A_IDE,
+ 0,
+ "VIA Technologies",
+ "VT82C586A IDE Controller",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C576,
+ 0,
+ "VIA Technologies",
+ "VT82C576 3V",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C580VP,
+ 0,
+ "VIA Technologies",
+ "VT82C580 (Apollo VP) Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C586_ISA,
+ 0,
+ "VIA Technologies",
+ "VT82C586 (Apollo VP) PCI-ISA Bridge",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C595,
+ 0,
+ "VIA Technologies",
+ "VT82C595 (Apollo VP2) Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C596A,
+ 0,
+ "VIA Technologies",
+ "VT82C596A (Apollo Pro) PCI-ISA Bridge",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C597,
+ 0,
+ "VIA Technologies",
+ "VT82C597 (Apollo VP3) Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C598PCI,
+ 0,
+ "VIA Technologies",
+ "VT82C598 (Apollo MVP3) Host-PCI",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C686A_ISA,
+ 0,
+ "VIA Technologies",
+ "VT82C686A (Apollo KX133) PCI-ISA Bridge",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C691,
+ 0,
+ "VIA Technologies",
+ "VT82C691 (Apollo Pro) Host-PCI",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C693,
+ 0,
+ "VIA Technologies",
+ "VT82C693 (Apollo Pro Plus) Host-PCI",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT86C926,
+ 0,
+ "VIA Technologies",
+ "VT86C926 Amazon PCI-Ethernet Controller",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C570M,
+ 0,
+ "VIA Technologies",
+ "VT82C570M (Apollo) Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C570MV,
+ 0,
+ "VIA Technologies",
+ "VT82C570M (Apollo) PCI-ISA Bridge",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C586_IDE,
+ 0,
+ "VIA Technologies",
+ "VT82C586 (Apollo VP) IDE Controller",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C595_2,
+ 0,
+ "VIA Technologies",
+ "VT82C595 (Apollo VP2) Host-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT83C572,
+ 0,
+ "VIA Technologies",
+ "VT83C572 USB Controller",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C586_PWR,
+ 0,
+ "VIA Technologies",
+ "VT82C586 (Apollo VP) Power Management Controller",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT3043,
+ 0,
+ "VIA Technologies",
+ "VT3043 (Rhine) 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C686A_SMB,
+ 0,
+ "VIA Technologies",
+ "VT82C686A SMBus Controller",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C686A_AC97,
+ 0,
+ "VIA Technologies",
+ "VT82C686A AC-97 Audio Controller",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C686A_MC97,
+ 0,
+ "VIA Technologies",
+ "VT82C686A MC-97 Modem Controller",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT86C100A,
+ 0,
+ "VIA Technologies",
+ "VT86C100A (Rhine-II) 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT8371_PPB,
+ 0,
+ "VIA Technologies",
+ "VT8371 (Apollo KX133) PCI-PCI Bridge",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT8501AGP,
+ 0,
+ "VIA Technologies",
+ "VT8501 PCI-AGP",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C597AGP,
+ 0,
+ "VIA Technologies",
+ "VT82C597 (Apollo VP3) PCI-AGP",
+ },
+ {
+ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT82C598AGP,
+ 0,
+ "VIA Technologies",
+ "VT82C598 (Apollo MVP3) PCI-AGP",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_60x0,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6000/6020/6050",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6000B,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6000B/6010",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6x10,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6110/6510",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6x20,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6120/6520",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6530,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6530",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6550,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6550",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6x17,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6117/6517",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6x27,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6127/6527",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6537,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6537",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6557,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6557/6557-ECC",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6x15,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6115/6515",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6x25,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6125/6525",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6535,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6535",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6555,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6555/6555-ECC",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6x17RP,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6117RP/GDT6517RP",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6x27RP,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6127RP/GDT6527RP",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6537RP,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6537RP",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6557RP,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6557RP",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6x11RP,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6111RP/GDT6511RP",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6x21RP,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6121RP/GDT6521RP",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6x17RD,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6117RD/GDT6517RD",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6x27RD,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6127RD/GDT6527RD",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6537RD,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6537RD",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6557RD,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6557RD",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6x11RD,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6111RD/GDT6511RD",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6x21RD,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6121RD/GDT6521RD",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6x18RD,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6118RD/GDT6518RD/GDT6618RD",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6x28RD,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6128RD/GDT6528RD/GDT6628RD",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6x38RD,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6538RD/GDT6638RD",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6x58RD,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6558RD/GDT6658RD",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_7x18RN,
+ 0,
+ "Vortex Computer Systems",
+ "GDT7118RN/GDT7518RN/GDT7618RN",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_7x28RN,
+ 0,
+ "Vortex Computer Systems",
+ "GDT7128RN/GDT7528RN/GDT7628RN",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_7x38RN,
+ 0,
+ "Vortex Computer Systems",
+ "GDT7538RN/GDT7638RN",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_7x58RN,
+ 0,
+ "Vortex Computer Systems",
+ "GDT7558RN/GDT7658RN",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6x19RD,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6519RD/GDT6619RD",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_6x29RD,
+ 0,
+ "Vortex Computer Systems",
+ "GDT6529RD/GDT6629RD",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_7x19RN,
+ 0,
+ "Vortex Computer Systems",
+ "GDT7519RN/GDT7619RN",
+ },
+ {
+ PCI_VENDOR_VORTEX, PCI_PRODUCT_VORTEX_GDT_7x29RN,
+ 0,
+ "Vortex Computer Systems",
+ "GDT7529RN/GDT7629RN",
+ },
+ {
+ PCI_VENDOR_VLSI, PCI_PRODUCT_VLSI_82C592,
+ 0,
+ "VLSI Technology",
+ "82C592 CPU Bridge",
+ },
+ {
+ PCI_VENDOR_VLSI, PCI_PRODUCT_VLSI_82C593,
+ 0,
+ "VLSI Technology",
+ "82C593 ISA Bridge",
+ },
+ {
+ PCI_VENDOR_VLSI, PCI_PRODUCT_VLSI_82C594,
+ 0,
+ "VLSI Technology",
+ "82C594 Wildcat System Controller",
+ },
+ {
+ PCI_VENDOR_VLSI, PCI_PRODUCT_VLSI_82C596597,
+ 0,
+ "VLSI Technology",
+ "82C596/597 Wildcat ISA Bridge",
+ },
+ {
+ PCI_VENDOR_VLSI, PCI_PRODUCT_VLSI_82C541,
+ 0,
+ "VLSI Technology",
+ "82C541",
+ },
+ {
+ PCI_VENDOR_VLSI, PCI_PRODUCT_VLSI_82C543,
+ 0,
+ "VLSI Technology",
+ "82C543",
+ },
+ {
+ PCI_VENDOR_VLSI, PCI_PRODUCT_VLSI_82C532,
+ 0,
+ "VLSI Technology",
+ "82C532",
+ },
+ {
+ PCI_VENDOR_VLSI, PCI_PRODUCT_VLSI_82C534,
+ 0,
+ "VLSI Technology",
+ "82C534",
+ },
+ {
+ PCI_VENDOR_VLSI, PCI_PRODUCT_VLSI_82C535,
+ 0,
+ "VLSI Technology",
+ "82C535",
+ },
+ {
+ PCI_VENDOR_VLSI, PCI_PRODUCT_VLSI_82C147,
+ 0,
+ "VLSI Technology",
+ "82C147",
+ },
+ {
+ PCI_VENDOR_VLSI, PCI_PRODUCT_VLSI_82C975,
+ 0,
+ "VLSI Technology",
+ "82C975",
+ },
+ {
+ PCI_VENDOR_VLSI, PCI_PRODUCT_VLSI_82C925,
+ 0,
+ "VLSI Technology",
+ "82C925",
+ },
+ {
+ PCI_VENDOR_WEITEK, PCI_PRODUCT_WEITEK_P9000,
+ 0,
+ "Weitek",
+ "P9000",
+ },
+ {
+ PCI_VENDOR_WEITEK, PCI_PRODUCT_WEITEK_P9100,
+ 0,
+ "Weitek",
+ "P9100",
+ },
+ {
+ PCI_VENDOR_WD, PCI_PRODUCT_WD_WD33C193A,
+ 0,
+ "Western Digital",
+ "WD33C193A",
+ },
+ {
+ PCI_VENDOR_WD, PCI_PRODUCT_WD_WD33C196A,
+ 0,
+ "Western Digital",
+ "WD33C196A",
+ },
+ {
+ PCI_VENDOR_WD, PCI_PRODUCT_WD_WD33C197A,
+ 0,
+ "Western Digital",
+ "WD33C197A",
+ },
+ {
+ PCI_VENDOR_WD, PCI_PRODUCT_WD_WD7193,
+ 0,
+ "Western Digital",
+ "WD7193",
+ },
+ {
+ PCI_VENDOR_WD, PCI_PRODUCT_WD_WD7197,
+ 0,
+ "Western Digital",
+ "WD7197",
+ },
+ {
+ PCI_VENDOR_WD, PCI_PRODUCT_WD_WD33C296A,
+ 0,
+ "Western Digital",
+ "WD33C296A",
+ },
+ {
+ PCI_VENDOR_WD, PCI_PRODUCT_WD_WD34C296,
+ 0,
+ "Western Digital",
+ "WD34C296",
+ },
+ {
+ PCI_VENDOR_WD, PCI_PRODUCT_WD_90C,
+ 0,
+ "Western Digital",
+ "90C",
+ },
+ {
+ PCI_VENDOR_WINBOND, PCI_PRODUCT_WINBOND_W83769F,
+ 0,
+ "Winbond Electronics",
+ "W83769F",
+ },
+ {
+ PCI_VENDOR_WINBOND, PCI_PRODUCT_WINBOND_W89C840F,
+ 0,
+ "Winbond Electronics",
+ "W89C840F 10/100 Ethernet",
+ },
+ {
+ PCI_VENDOR_WINBOND, PCI_PRODUCT_WINBOND_W89C940F,
+ 0,
+ "Winbond Electronics",
+ "W89C940F Ethernet",
+ },
+ {
+ PCI_VENDOR_WINBOND, PCI_PRODUCT_WINBOND_W89C940F_1,
+ 0,
+ "Winbond Electronics",
+ "W89C940F Ethernet",
+ },
+ {
+ PCI_VENDOR_XIRCOM, PCI_PRODUCT_XIRCOM_X3201_3,
+ 0,
+ "Xircom",
+ "X3201-3 Fast Ethernet Controller",
+ },
+ {
+ PCI_VENDOR_XIRCOM, PCI_PRODUCT_XIRCOM_X3201_3_21143,
+ 0,
+ "Xircom",
+ "X3201-3 Fast Ethernet Controller (21143)",
+ },
+ {
+ PCI_VENDOR_YAMAHA, PCI_PRODUCT_YAMAHA_YMF724,
+ 0,
+ "Yamaha",
+ "724 Audio",
+ },
+ {
+ PCI_VENDOR_YAMAHA, PCI_PRODUCT_YAMAHA_YMF740,
+ 0,
+ "Yamaha",
+ "740 Audio",
+ },
+ {
+ PCI_VENDOR_YAMAHA, PCI_PRODUCT_YAMAHA_YMF740C,
+ 0,
+ "Yamaha",
+ "740C (DS-1) Audio",
+ },
+ {
+ PCI_VENDOR_YAMAHA, PCI_PRODUCT_YAMAHA_YMF724F,
+ 0,
+ "Yamaha",
+ "724F (DS-1) Audio",
+ },
+ {
+ PCI_VENDOR_YAMAHA, PCI_PRODUCT_YAMAHA_YMF744B,
+ 0,
+ "Yamaha",
+ "744 (DS-1S) Audio",
+ },
+ {
+ PCI_VENDOR_YAMAHA, PCI_PRODUCT_YAMAHA_YMF754,
+ 0,
+ "Yamaha",
+ "754 (DS-1E) Audio",
+ },
+ {
+ PCI_VENDOR_ZEINET, PCI_PRODUCT_ZEINET_1221,
+ 0,
+ "Zeinet",
+ "1221",
+ },
+ {
+ PCI_VENDOR_ZIATECH, PCI_PRODUCT_ZIATECH_ZT8905,
+ 0,
+ "Ziatech",
+ "PCI-ST32 Bridge",
+ },
+ {
+ PCI_VENDOR_ZORAN, PCI_PRODUCT_ZORAN_ZR36120,
+ 0,
+ "Zoran Corporation",
+ "Video Controller",
+ },
+ {
+ PCI_VENDOR_COMPAQ, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Compaq",
+ NULL,
+ },
+ {
+ PCI_VENDOR_SYMBIOS, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Symbios Logic",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ATI, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "ATI Technologies",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ULSI, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "ULSI Systems",
+ NULL,
+ },
+ {
+ PCI_VENDOR_VLSI, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "VLSI Technology",
+ NULL,
+ },
+ {
+ PCI_VENDOR_AVANCE, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Avance Logic",
+ NULL,
+ },
+ {
+ PCI_VENDOR_NS, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "National Semiconductor",
+ NULL,
+ },
+ {
+ PCI_VENDOR_TSENG, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Tseng Labs",
+ NULL,
+ },
+ {
+ PCI_VENDOR_WEITEK, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Weitek",
+ NULL,
+ },
+ {
+ PCI_VENDOR_DEC, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Digital Equipment",
+ NULL,
+ },
+ {
+ PCI_VENDOR_CIRRUS, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Cirrus Logic",
+ NULL,
+ },
+ {
+ PCI_VENDOR_IBM, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "IBM",
+ NULL,
+ },
+ {
+ PCI_VENDOR_WD, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Western Digital",
+ NULL,
+ },
+ {
+ PCI_VENDOR_AMD, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Advanced Micro Devices",
+ NULL,
+ },
+ {
+ PCI_VENDOR_TRIDENT, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Trident Microsystems",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ACER, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Acer",
+ NULL,
+ },
+ {
+ PCI_VENDOR_MATROX, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Matrox",
+ NULL,
+ },
+ {
+ PCI_VENDOR_CHIPS, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Chips and Technologies",
+ NULL,
+ },
+ {
+ PCI_VENDOR_TOSHIBA, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Toshiba America",
+ NULL,
+ },
+ {
+ PCI_VENDOR_NEC, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "NEC",
+ NULL,
+ },
+ {
+ PCI_VENDOR_FUTUREDOMAIN, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Future Domain",
+ NULL,
+ },
+ {
+ PCI_VENDOR_SIS, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Silicon Integrated System",
+ NULL,
+ },
+ {
+ PCI_VENDOR_HP, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Hewlett-Packard",
+ NULL,
+ },
+ {
+ PCI_VENDOR_PCTECH, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "PC Technology",
+ NULL,
+ },
+ {
+ PCI_VENDOR_DPT, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Distributed Processing Technology",
+ NULL,
+ },
+ {
+ PCI_VENDOR_OPTI, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Opti",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ELSA, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Elsa",
+ NULL,
+ },
+ {
+ PCI_VENDOR_SGSTHOMSON, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "SGS Thomson Microelectric",
+ NULL,
+ },
+ {
+ PCI_VENDOR_BUSLOGIC, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "BusLogic",
+ NULL,
+ },
+ {
+ PCI_VENDOR_TI, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Texas Instruments",
+ NULL,
+ },
+ {
+ PCI_VENDOR_SONY, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Sony",
+ NULL,
+ },
+ {
+ PCI_VENDOR_OAKTECH, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Oak Technology",
+ NULL,
+ },
+ {
+ PCI_VENDOR_WINBOND, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Winbond Electronics",
+ NULL,
+ },
+ {
+ PCI_VENDOR_MOT, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Motorola",
+ NULL,
+ },
+ {
+ PCI_VENDOR_PROMISE, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Promise Technology",
+ NULL,
+ },
+ {
+ PCI_VENDOR_NUMBER9, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Number 9 Computer Company",
+ NULL,
+ },
+ {
+ PCI_VENDOR_UMC, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "United Microelectronics",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ITT, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "I. T. T.",
+ NULL,
+ },
+ {
+ PCI_VENDOR_MYLEX, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Mylex",
+ NULL,
+ },
+ {
+ PCI_VENDOR_APPLE, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Apple Computer",
+ NULL,
+ },
+ {
+ PCI_VENDOR_YAMAHA, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Yamaha",
+ NULL,
+ },
+ {
+ PCI_VENDOR_NEXGEN, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "NexGen Microsystems",
+ NULL,
+ },
+ {
+ PCI_VENDOR_QLOGIC, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Q Logic",
+ NULL,
+ },
+ {
+ PCI_VENDOR_LEADTEK, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "LeadTek Research",
+ NULL,
+ },
+ {
+ PCI_VENDOR_CONTAQ, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Contaq Microsystems",
+ NULL,
+ },
+ {
+ PCI_VENDOR_BIT3, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Bit3 Computer Corp.",
+ NULL,
+ },
+ {
+ PCI_VENDOR_OLICOM, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Olicom",
+ NULL,
+ },
+ {
+ PCI_VENDOR_SUN, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Sun Microsystems",
+ NULL,
+ },
+ {
+ PCI_VENDOR_INTERGRAPH, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Intergraph",
+ NULL,
+ },
+ {
+ PCI_VENDOR_DIAMOND, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Diamond Computer Systems",
+ NULL,
+ },
+ {
+ PCI_VENDOR_CMDTECH, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "CMD Technology",
+ NULL,
+ },
+ {
+ PCI_VENDOR_QUANTUMDESIGNS, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Quantum Designs",
+ NULL,
+ },
+ {
+ PCI_VENDOR_BROOKTREE, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Brooktree",
+ NULL,
+ },
+ {
+ PCI_VENDOR_SGI, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Silicon Graphics",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ACC, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "ACC Microelectronics",
+ NULL,
+ },
+ {
+ PCI_VENDOR_SYMPHONY, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Symphony Labs",
+ NULL,
+ },
+ {
+ PCI_VENDOR_PLX, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "PLX Technology",
+ NULL,
+ },
+ {
+ PCI_VENDOR_MADGE, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Madge Networks",
+ NULL,
+ },
+ {
+ PCI_VENDOR_3COM, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "3Com",
+ NULL,
+ },
+ {
+ PCI_VENDOR_SMC, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Standard Microsystems",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ALI, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Acer Labs",
+ NULL,
+ },
+ {
+ PCI_VENDOR_SURECOM, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Surecom Technology",
+ NULL,
+ },
+ {
+ PCI_VENDOR_SAMSUNGSEMI, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Samsung Semiconductors",
+ NULL,
+ },
+ {
+ PCI_VENDOR_NEOMAGIC, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Neomagic",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ADVSYS, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Advanced System Products",
+ NULL,
+ },
+ {
+ PCI_VENDOR_MACRONIX, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Macronix",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ES, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Evans & Sutherland",
+ NULL,
+ },
+ {
+ PCI_VENDOR_NVIDIA, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Nvidia Corporation",
+ NULL,
+ },
+ {
+ PCI_VENDOR_EMULEX, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Emulex",
+ NULL,
+ },
+ {
+ PCI_VENDOR_IMS, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Integrated Micro Solutions",
+ NULL,
+ },
+ {
+ PCI_VENDOR_TEKRAM, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Tekram Technology (1st PCI Vendor ID)",
+ NULL,
+ },
+ {
+ PCI_VENDOR_NEWBRIDGE, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Newbridge Microsystems / Tundra Semiconductor",
+ NULL,
+ },
+ {
+ PCI_VENDOR_AMCIRCUITS, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Applied Micro Circuits",
+ NULL,
+ },
+ {
+ PCI_VENDOR_REALTEK, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Realtek Semiconductor",
+ NULL,
+ },
+ {
+ PCI_VENDOR_NKK, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "NKK Corporation",
+ NULL,
+ },
+ {
+ PCI_VENDOR_INITIO, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Initio",
+ NULL,
+ },
+ {
+ PCI_VENDOR_CREATIVELABS, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Creative Labs",
+ NULL,
+ },
+ {
+ PCI_VENDOR_TRIONES, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Triones Technologies",
+ NULL,
+ },
+ {
+ PCI_VENDOR_SIGMA, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Sigma Designs",
+ NULL,
+ },
+ {
+ PCI_VENDOR_VIATECH, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "VIA Technologies",
+ NULL,
+ },
+ {
+ PCI_VENDOR_COGENT, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Cogent Data Technologies",
+ NULL,
+ },
+ {
+ PCI_VENDOR_RNS, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "RNS",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ACCTON, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Accton Technology",
+ NULL,
+ },
+ {
+ PCI_VENDOR_VORTEX, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Vortex Computer Systems",
+ NULL,
+ },
+ {
+ PCI_VENDOR_EFFICIENTNETS, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Efficent Networks",
+ NULL,
+ },
+ {
+ PCI_VENDOR_IDT, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "IDT",
+ NULL,
+ },
+ {
+ PCI_VENDOR_FORE, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "FORE Systems",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ZIATECH, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Ziatech",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ALLIANCE, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Alliance Semiconductor",
+ NULL,
+ },
+ {
+ PCI_VENDOR_SCHNEIDERKOCH, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Schneider & Koch",
+ NULL,
+ },
+ {
+ PCI_VENDOR_MUTECH, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Mutech",
+ NULL,
+ },
+ {
+ PCI_VENDOR_XIRCOM, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Xircom",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ALTERA, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Altera Corporation",
+ NULL,
+ },
+ {
+ PCI_VENDOR_TOSHIBA2, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Toshiba America Info Systems",
+ NULL,
+ },
+ {
+ PCI_VENDOR_RICOH, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Ricoh",
+ NULL,
+ },
+ {
+ PCI_VENDOR_DLINK, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "D-Link Systems",
+ NULL,
+ },
+ {
+ PCI_VENDOR_COROLLARY, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Corrollary",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ACARD, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Acard",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ZEINET, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Zeinet",
+ NULL,
+ },
+ {
+ PCI_VENDOR_GALILEO, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Galileo Technology",
+ NULL,
+ },
+ {
+ PCI_VENDOR_LITEON, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Lite-On Communications",
+ NULL,
+ },
+ {
+ PCI_VENDOR_V3, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "V3 Semiconductor",
+ NULL,
+ },
+ {
+ PCI_VENDOR_LUCENT, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "AT&T Microelectronics",
+ NULL,
+ },
+ {
+ PCI_VENDOR_DOLPHIN, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Dolphin Interconnect Solutions",
+ NULL,
+ },
+ {
+ PCI_VENDOR_AURAVISION, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Auravision",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ZORAN, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Zoran Corporation",
+ NULL,
+ },
+ {
+ PCI_VENDOR_COMPEX, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Compex",
+ NULL,
+ },
+ {
+ PCI_VENDOR_PMCSIERRA, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "PMC-Sierra",
+ NULL,
+ },
+ {
+ PCI_VENDOR_CYCLADES, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Cyclades",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ESSENTIAL, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Essential Communications",
+ NULL,
+ },
+ {
+ PCI_VENDOR_O2MICRO, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "O2 Micro Inc",
+ NULL,
+ },
+ {
+ PCI_VENDOR_3DFX, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "3Dfx Interactive",
+ NULL,
+ },
+ {
+ PCI_VENDOR_CCUBE, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "C-Cube Microsystems",
+ NULL,
+ },
+ {
+ PCI_VENDOR_AVM, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "AVM",
+ NULL,
+ },
+ {
+ PCI_VENDOR_LINEARSYS, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Linear Systems",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ASIX, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "ASIX Electronics",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ESSTECH, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "ESS Technology Inc",
+ NULL,
+ },
+ {
+ PCI_VENDOR_SILMOTION, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Silicon Motion",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ENSONIQ, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Ensoniq",
+ NULL,
+ },
+ {
+ PCI_VENDOR_DAVICOM, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Davicom Semiconductor",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ESSTECH2, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "ESS Technology Inc",
+ NULL,
+ },
+ {
+ PCI_VENDOR_TRITECH, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "TriTech Microelectronics",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ALTEON, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Alteon",
+ NULL,
+ },
+ {
+ PCI_VENDOR_RISCOM, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "RISCom",
+ NULL,
+ },
+ {
+ PCI_VENDOR_USR, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "US Robotics (3Com)",
+ NULL,
+ },
+ {
+ PCI_VENDOR_NVIDIA_SGS, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Nvidia Corporation & SGS Thomson Microelectric",
+ NULL,
+ },
+ {
+ PCI_VENDOR_AUREAL, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Aureal Semiconductor",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ADMTEK, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "ADMtek",
+ NULL,
+ },
+ {
+ PCI_VENDOR_FORTEMEDIA, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Forte Media",
+ NULL,
+ },
+ {
+ PCI_VENDOR_DOMEX, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Domex",
+ NULL,
+ },
+ {
+ PCI_VENDOR_LMC, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "LAN Media Corporation",
+ NULL,
+ },
+ {
+ PCI_VENDOR_API, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "API Networks",
+ NULL,
+ },
+ {
+ PCI_VENDOR_CONEXANT, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Conexant Systems",
+ NULL,
+ },
+ {
+ PCI_VENDOR_NETGEAR, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Netgear",
+ NULL,
+ },
+ {
+ PCI_VENDOR_3WARE, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "3ware",
+ NULL,
+ },
+ {
+ PCI_VENDOR_SUNDANCETI, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Sundance Technology",
+ NULL,
+ },
+ {
+ PCI_VENDOR_CMEDIA, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "C-Media Electronics Inc",
+ NULL,
+ },
+ {
+ PCI_VENDOR_DELTA, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Delta Electronics",
+ NULL,
+ },
+ {
+ PCI_VENDOR_SOLIDUM, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Solidum Systems Corp.",
+ NULL,
+ },
+ {
+ PCI_VENDOR_SIBYTE, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "SiByte, Inc.",
+ NULL,
+ },
+ {
+ PCI_VENDOR_SYMPHONY2, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Symphony Labs (2nd PCI Vendor ID)",
+ NULL,
+ },
+ {
+ PCI_VENDOR_TEKRAM2, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Tekram Technology (2nd PCI Vendor ID)",
+ NULL,
+ },
+ {
+ PCI_VENDOR_BROADCOM, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Broadcom",
+ NULL,
+ },
+ {
+ PCI_VENDOR_3DLABS, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "3D Labs",
+ NULL,
+ },
+ {
+ PCI_VENDOR_AVANCE2, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Avance Logic (2nd PCI Vendor ID)",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ADDTRON, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Addtron Technology",
+ NULL,
+ },
+ {
+ PCI_VENDOR_NETVIN, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "NetVin",
+ NULL,
+ },
+ {
+ PCI_VENDOR_S3, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "S3",
+ NULL,
+ },
+ {
+ PCI_VENDOR_C4T, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "c't Magazin",
+ NULL,
+ },
+ {
+ PCI_VENDOR_INTEL, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Intel",
+ NULL,
+ },
+ {
+ PCI_VENDOR_PROLAN, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "ProLAN",
+ NULL,
+ },
+ {
+ PCI_VENDOR_KTI, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "KTI",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ADP, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Adaptec",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ADP2, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Adaptec (2nd PCI Vendor ID)",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ATRONICS, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Atronics",
+ NULL,
+ },
+ {
+ PCI_VENDOR_ARC, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "ARC Logic",
+ NULL,
+ },
+ {
+ PCI_VENDOR_EPIGRAM, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "Epigram",
+ NULL,
+ },
+ {
+ PCI_VENDOR_INVALID, 0,
+ PCI_KNOWNDEV_NOPROD,
+ "INVALID VENDOR ID",
+ NULL,
+ },
+ { 0, 0, 0, NULL, NULL, }
+};
diff --git a/cfe/cfe/pci/pcireg.h b/cfe/cfe/pci/pcireg.h
new file mode 100644
index 0000000..932fc7d
--- /dev/null
+++ b/cfe/cfe/pci/pcireg.h
@@ -0,0 +1,615 @@
+/*
+ * Copyright (c) 1995, 1996, 1999
+ * Christopher G. Demetriou. All rights reserved.
+ * Copyright (c) 1994, 1996 Charles M. Hannum. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Charles M. Hannum.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _DEV_PCI_PCIREG_H_
+#define _DEV_PCI_PCIREG_H_
+
+/*
+ * Standardized PCI configuration register definitions and macros.
+ * Derived from information found in the ``PCI Local Bus Specification,
+ * Revision 2.2, December 18, 1998.''
+ *
+ * Note: Register and field definitions assume 32-bit register accesses.
+ */
+
+#if !defined(__ASSEMBLER__)
+typedef uint16_t pci_vendor_id_t;
+typedef uint16_t pci_product_id_t;
+
+typedef uint8_t pci_class_t;
+typedef uint8_t pci_subclass_t;
+typedef uint8_t pci_interface_t;
+typedef uint8_t pci_revision_t;
+
+typedef uint8_t pci_intr_latency_t;
+typedef uint8_t pci_intr_grant_t;
+typedef uint8_t pci_intr_pin_t;
+typedef uint8_t pci_intr_line_t;
+#endif
+
+/* some PCI bus constants */
+
+#define PCI_BUSMAX 255
+#define PCI_DEVMAX 31
+#define PCI_FUNCMAX 7
+#define PCI_REGMAX 255
+
+/*
+ * Common PCI header
+ */
+
+/*
+ * Device identification register; contains a vendor ID and a device ID.
+ */
+#define PCI_ID_REG 0x00
+
+#define PCI_VENDOR_SHIFT 0
+#define PCI_VENDOR_MASK 0xffff
+#define PCI_VENDOR(id) \
+ (((id) >> PCI_VENDOR_SHIFT) & PCI_VENDOR_MASK)
+
+#define PCI_PRODUCT_SHIFT 16
+#define PCI_PRODUCT_MASK 0xffff
+#define PCI_PRODUCT(id) \
+ (((id) >> PCI_PRODUCT_SHIFT) & PCI_PRODUCT_MASK)
+
+/*
+ * Command and status register.
+ */
+#define PCI_COMMAND_STATUS_REG 0x04
+
+#define PCI_COMMAND_SHIFT 0
+#define PCI_COMMAND_MASK 0xffff
+#define PCI_COMMAND(csr) \
+ (((csr) >> PCI_COMMAND_SHIFT) & PCI_COMMAND_MASK)
+
+#define PCI_STATUS_SHIFT 16
+#define PCI_STATUS_MASK 0xffff
+#define PCI_STATUS(csr) \
+ (((csr) >> PCI_STATUS_SHIFT) & PCI_STATUS_MASK)
+
+#define PCI_COMMAND_IO_ENABLE 0x00000001
+#define PCI_COMMAND_MEM_ENABLE 0x00000002
+#define PCI_COMMAND_MASTER_ENABLE 0x00000004
+#define PCI_COMMAND_SPECIAL_ENABLE 0x00000008
+#define PCI_COMMAND_INVALIDATE_ENABLE 0x00000010
+#define PCI_COMMAND_PALETTE_ENABLE 0x00000020
+#define PCI_COMMAND_PARITY_ENABLE 0x00000040
+#define PCI_COMMAND_STEPPING_ENABLE 0x00000080
+#define PCI_COMMAND_SERR_ENABLE 0x00000100
+#define PCI_COMMAND_BACKTOBACK_ENABLE 0x00000200
+
+#define PCI_STATUS_CAPLIST_SUPPORT 0x00100000
+#define PCI_STATUS_66MHZ_SUPPORT 0x00200000
+#define PCI_STATUS_UDF_SUPPORT 0x00400000
+#define PCI_STATUS_BACKTOBACK_SUPPORT 0x00800000
+#define PCI_STATUS_PARITY_ERROR 0x01000000
+#define PCI_STATUS_DEVSEL_FAST 0x00000000
+#define PCI_STATUS_DEVSEL_MEDIUM 0x02000000
+#define PCI_STATUS_DEVSEL_SLOW 0x04000000
+#define PCI_STATUS_DEVSEL_MASK 0x06000000
+#define PCI_STATUS_DEVSEL_SHIFT 25
+#define PCI_STATUS_DEVSEL(scr) \
+ (((scr) & PCI_STATUS_DEVSEL_MASK) >> PCI_STATUS_DEVSEL_SHIFT)
+#define PCI_STATUS_TARGET_TARGET_ABORT 0x08000000
+#define PCI_STATUS_MASTER_TARGET_ABORT 0x10000000
+#define PCI_STATUS_MASTER_ABORT 0x20000000
+#define PCI_STATUS_SYSTEM_ERROR 0x40000000
+#define PCI_STATUS_PARITY_DETECT 0x80000000
+
+/*
+ * PCI Class and Revision Register; defines type and revision of device.
+ */
+#define PCI_CLASS_REG 0x08
+
+#define PCI_CLASS_SHIFT 24
+#define PCI_CLASS_MASK 0xff
+#define PCI_CLASS(cr) \
+ (((cr) >> PCI_CLASS_SHIFT) & PCI_CLASS_MASK)
+
+#define PCI_SUBCLASS_SHIFT 16
+#define PCI_SUBCLASS_MASK 0xff
+#define PCI_SUBCLASS(cr) \
+ (((cr) >> PCI_SUBCLASS_SHIFT) & PCI_SUBCLASS_MASK)
+
+#define PCI_INTERFACE_SHIFT 8
+#define PCI_INTERFACE_MASK 0xff
+#define PCI_INTERFACE(cr) \
+ (((cr) >> PCI_INTERFACE_SHIFT) & PCI_INTERFACE_MASK)
+
+#define PCI_REVISION_SHIFT 0
+#define PCI_REVISION_MASK 0xff
+#define PCI_REVISION(cr) \
+ (((cr) >> PCI_REVISION_SHIFT) & PCI_REVISION_MASK)
+
+#define PCI_CLASS_CODE(class, subclass, interface) \
+ ((((class) & PCI_CLASS_MASK) << PCI_CLASS_SHIFT) | \
+ (((subclass) & PCI_SUBCLASS_MASK) << PCI_SUBCLASS_SHIFT) | \
+ (((interface) & PCI_INTERFACE_MASK) << PCI_INTERFACE_SHIFT))
+
+/* base classes */
+#define PCI_CLASS_PREHISTORIC 0x00
+#define PCI_CLASS_MASS_STORAGE 0x01
+#define PCI_CLASS_NETWORK 0x02
+#define PCI_CLASS_DISPLAY 0x03
+#define PCI_CLASS_MULTIMEDIA 0x04
+#define PCI_CLASS_MEMORY 0x05
+#define PCI_CLASS_BRIDGE 0x06
+#define PCI_CLASS_COMMUNICATIONS 0x07
+#define PCI_CLASS_SYSTEM 0x08
+#define PCI_CLASS_INPUT 0x09
+#define PCI_CLASS_DOCK 0x0a
+#define PCI_CLASS_PROCESSOR 0x0b
+#define PCI_CLASS_SERIALBUS 0x0c
+#define PCI_CLASS_WIRELESS 0x0d
+#define PCI_CLASS_I2O 0x0e
+#define PCI_CLASS_SATCOM 0x0f
+#define PCI_CLASS_CRYPTO 0x10
+#define PCI_CLASS_DASP 0x11
+#define PCI_CLASS_UNDEFINED 0xff
+
+/* 0x00 prehistoric subclasses */
+#define PCI_SUBCLASS_PREHISTORIC_MISC 0x00
+#define PCI_SUBCLASS_PREHISTORIC_VGA 0x01
+
+/* 0x01 mass storage subclasses */
+#define PCI_SUBCLASS_MASS_STORAGE_SCSI 0x00
+#define PCI_SUBCLASS_MASS_STORAGE_IDE 0x01
+#define PCI_SUBCLASS_MASS_STORAGE_FLOPPY 0x02
+#define PCI_SUBCLASS_MASS_STORAGE_IPI 0x03
+#define PCI_SUBCLASS_MASS_STORAGE_RAID 0x04
+#define PCI_SUBCLASS_MASS_STORAGE_MISC 0x80
+
+/* 0x02 network subclasses */
+#define PCI_SUBCLASS_NETWORK_ETHERNET 0x00
+#define PCI_SUBCLASS_NETWORK_TOKENRING 0x01
+#define PCI_SUBCLASS_NETWORK_FDDI 0x02
+#define PCI_SUBCLASS_NETWORK_ATM 0x03
+#define PCI_SUBCLASS_NETWORK_ISDN 0x04
+#define PCI_SUBCLASS_NETWORK_WORLDFIP 0x05
+#define PCI_SUBCLASS_NETWORK_PCIMGMULTICOMP 0x06
+#define PCI_SUBCLASS_NETWORK_MISC 0x80
+
+/* 0x03 display subclasses */
+#define PCI_SUBCLASS_DISPLAY_VGA 0x00
+#define PCI_SUBCLASS_DISPLAY_XGA 0x01
+#define PCI_SUBCLASS_DISPLAY_3D 0x02
+#define PCI_SUBCLASS_DISPLAY_MISC 0x80
+
+/* 0x04 multimedia subclasses */
+#define PCI_SUBCLASS_MULTIMEDIA_VIDEO 0x00
+#define PCI_SUBCLASS_MULTIMEDIA_AUDIO 0x01
+#define PCI_SUBCLASS_MULTIMEDIA_TELEPHONY 0x02
+#define PCI_SUBCLASS_MULTIMEDIA_MISC 0x80
+
+/* 0x05 memory subclasses */
+#define PCI_SUBCLASS_MEMORY_RAM 0x00
+#define PCI_SUBCLASS_MEMORY_FLASH 0x01
+#define PCI_SUBCLASS_MEMORY_MISC 0x80
+
+/* 0x06 bridge subclasses */
+#define PCI_SUBCLASS_BRIDGE_HOST 0x00
+#define PCI_SUBCLASS_BRIDGE_ISA 0x01
+#define PCI_SUBCLASS_BRIDGE_EISA 0x02
+#define PCI_SUBCLASS_BRIDGE_MCA 0x03
+#define PCI_SUBCLASS_BRIDGE_PCI 0x04
+#define PCI_SUBCLASS_BRIDGE_PCMCIA 0x05
+#define PCI_SUBCLASS_BRIDGE_NUBUS 0x06
+#define PCI_SUBCLASS_BRIDGE_CARDBUS 0x07
+#define PCI_SUBCLASS_BRIDGE_RACEWAY 0x08
+#define PCI_SUBCLASS_BRIDGE_STPCI 0x09
+#define PCI_SUBCLASS_BRIDGE_INFINIBAND 0x0a
+#define PCI_SUBCLASS_BRIDGE_MISC 0x80
+
+/* 0x07 communications subclasses */
+#define PCI_SUBCLASS_COMMUNICATIONS_SERIAL 0x00
+#define PCI_SUBCLASS_COMMUNICATIONS_PARALLEL 0x01
+#define PCI_SUBCLASS_COMMUNICATIONS_MPSERIAL 0x02
+#define PCI_SUBCLASS_COMMUNICATIONS_MODEM 0x03
+#define PCI_SUBCLASS_COMMUNICATIONS_MISC 0x80
+
+/* 0x08 system subclasses */
+#define PCI_SUBCLASS_SYSTEM_PIC 0x00
+#define PCI_SUBCLASS_SYSTEM_DMA 0x01
+#define PCI_SUBCLASS_SYSTEM_TIMER 0x02
+#define PCI_SUBCLASS_SYSTEM_RTC 0x03
+#define PCI_SUBCLASS_SYSTEM_PCIHOTPLUG 0x04
+#define PCI_SUBCLASS_SYSTEM_MISC 0x80
+
+/* 0x09 input subclasses */
+#define PCI_SUBCLASS_INPUT_KEYBOARD 0x00
+#define PCI_SUBCLASS_INPUT_DIGITIZER 0x01
+#define PCI_SUBCLASS_INPUT_MOUSE 0x02
+#define PCI_SUBCLASS_INPUT_SCANNER 0x03
+#define PCI_SUBCLASS_INPUT_GAMEPORT 0x04
+#define PCI_SUBCLASS_INPUT_MISC 0x80
+
+/* 0x0a dock subclasses */
+#define PCI_SUBCLASS_DOCK_GENERIC 0x00
+#define PCI_SUBCLASS_DOCK_MISC 0x80
+
+/* 0x0b processor subclasses */
+#define PCI_SUBCLASS_PROCESSOR_386 0x00
+#define PCI_SUBCLASS_PROCESSOR_486 0x01
+#define PCI_SUBCLASS_PROCESSOR_PENTIUM 0x02
+#define PCI_SUBCLASS_PROCESSOR_ALPHA 0x10
+#define PCI_SUBCLASS_PROCESSOR_POWERPC 0x20
+#define PCI_SUBCLASS_PROCESSOR_MIPS 0x30
+#define PCI_SUBCLASS_PROCESSOR_COPROC 0x40
+
+/* 0x0c serial bus subclasses */
+#define PCI_SUBCLASS_SERIALBUS_FIREWIRE 0x00
+#define PCI_SUBCLASS_SERIALBUS_ACCESS 0x01
+#define PCI_SUBCLASS_SERIALBUS_SSA 0x02
+#define PCI_SUBCLASS_SERIALBUS_USB 0x03
+#define PCI_SUBCLASS_SERIALBUS_FIBER 0x04 /* XXX _FIBRECHANNEL */
+#define PCI_SUBCLASS_SERIALBUS_SMBUS 0x05
+#define PCI_SUBCLASS_SERIALBUS_INFINIBAND 0x06
+#define PCI_SUBCLASS_SERIALBUS_IPMI 0x07
+#define PCI_SUBCLASS_SERIALBUS_SERCOS 0x08
+#define PCI_SUBCLASS_SERIALBUS_CANBUS 0x09
+
+/* 0x0d wireless subclasses */
+#define PCI_SUBCLASS_WIRELESS_IRDA 0x00
+#define PCI_SUBCLASS_WIRELESS_CONSUMERIR 0x01
+#define PCI_SUBCLASS_WIRELESS_RF 0x10
+#define PCI_SUBCLASS_WIRELESS_MISC 0x80
+
+/* 0x0e I2O (Intelligent I/O) subclasses */
+#define PCI_SUBCLASS_I2O_STANDARD 0x00
+
+/* 0x0f satellite communication subclasses */
+/* PCI_SUBCLASS_SATCOM_??? 0x00 / * XXX ??? */
+#define PCI_SUBCLASS_SATCOM_TV 0x01
+#define PCI_SUBCLASS_SATCOM_AUDIO 0x02
+#define PCI_SUBCLASS_SATCOM_VOICE 0x03
+#define PCI_SUBCLASS_SATCOM_DATA 0x04
+
+/* 0x10 encryption/decryption subclasses */
+#define PCI_SUBCLASS_CRYPTO_NETCOMP 0x00
+#define PCI_SUBCLASS_CRYPTO_ENTERTAINMENT 0x10
+#define PCI_SUBCLASS_CRYPTO_MISC 0x80
+
+/* 0x11 data acquisition and signal processing subclasses */
+#define PCI_SUBCLASS_DASP_DPIO 0x00
+#define PCI_SUBCLASS_DASP_TIMERFREQ 0x01
+#define PCI_SUBCLASS_DASP_MISC 0x80
+
+/*
+ * PCI BIST/Header Type/Latency Timer/Cache Line Size Register.
+ */
+#define PCI_BHLC_REG 0x0c
+
+#define PCI_BIST_SHIFT 24
+#define PCI_BIST_MASK 0xff
+#define PCI_BIST(bhlcr) \
+ (((bhlcr) >> PCI_BIST_SHIFT) & PCI_BIST_MASK)
+
+#define PCI_HDRTYPE_SHIFT 16
+#define PCI_HDRTYPE_MASK 0xff
+#define PCI_HDRTYPE(bhlcr) \
+ (((bhlcr) >> PCI_HDRTYPE_SHIFT) & PCI_HDRTYPE_MASK)
+
+#define PCI_HDRTYPE_TYPE(bhlcr) \
+ (PCI_HDRTYPE(bhlcr) & 0x7f)
+#define PCI_HDRTYPE_MULTIFN(bhlcr) \
+ ((PCI_HDRTYPE(bhlcr) & 0x80) != 0)
+
+#define PCI_LATTIMER_SHIFT 8
+#define PCI_LATTIMER_MASK 0xff
+#define PCI_LATTIMER(bhlcr) \
+ (((bhlcr) >> PCI_LATTIMER_SHIFT) & PCI_LATTIMER_MASK)
+#define PCI_LATTIMER_SET(bhlcr,v) \
+ (bhlcr) = ((bhlcr) & ~(PCI_LATTIMER_MASK << PCI_LATTIMER_SHIFT)) | \
+ ((v) << PCI_LATTIMER_SHIFT)
+
+#define PCI_CACHELINE_SHIFT 0
+#define PCI_CACHELINE_MASK 0xff
+#define PCI_CACHELINE(bhlcr) \
+ (((bhlcr) >> PCI_CACHELINE_SHIFT) & PCI_CACHELINE_MASK)
+#define PCI_CACHELINE_SET(bhlcr,v) \
+ (bhlcr) = ((bhlcr) & ~(PCI_CACHELINE_MASK << PCI_CACHELINE_SHIFT)) | \
+ ((v) << PCI_CACHELINE_SHIFT)
+
+/*
+ * The currently defined header types are
+ * 00h prefix PCI_ below
+ * 01h prefix PPB_ below (PCI-to-PCI bridges)
+ * 02h prefix PCB_ below (Cardbus bridges)
+ */
+
+/*
+ * Type 00h Configuration Space extensions.
+ */
+
+/*
+ * Mapping registers
+ */
+#define PCI_MAPREG_START 0x10
+#define PCI_MAPREG_END 0x28
+
+#define PCI_MAPREG_PPB_END 0x18
+#define PCI_MAPREG_PPB_ROM 0x38
+#define PCI_MAPREG_PCB_END 0x14
+#define PCI_MAPREG_NONE 0x00
+
+#define PCI_MAPREG_TYPE(mr) \
+ ((mr) & PCI_MAPREG_TYPE_MASK)
+#define PCI_MAPREG_TYPE_MASK 0x00000001
+
+#define PCI_MAPREG_TYPE_MEM 0x00000000
+#define PCI_MAPREG_TYPE_IO 0x00000001
+
+#define PCI_MAPREG_MEM_TYPE(mr) \
+ ((mr) & PCI_MAPREG_MEM_TYPE_MASK)
+#define PCI_MAPREG_MEM_TYPE_MASK 0x00000006
+
+#define PCI_MAPREG_MEM_TYPE_32BIT 0x00000000
+#define PCI_MAPREG_MEM_TYPE_32BIT_1M 0x00000002
+#define PCI_MAPREG_MEM_TYPE_64BIT 0x00000004
+
+#define PCI_MAPREG_MEM_PREFETCHABLE(mr) \
+ (((mr) & PCI_MAPREG_MEM_PREFETCHABLE_MASK) != 0)
+#define PCI_MAPREG_MEM_PREFETCHABLE_MASK 0x00000008
+
+#define PCI_MAPREG_MEM_ADDR(mr) \
+ ((mr) & PCI_MAPREG_MEM_ADDR_MASK)
+#define PCI_MAPREG_MEM_SIZE(mr) \
+ (PCI_MAPREG_MEM_ADDR(mr) & -PCI_MAPREG_MEM_ADDR(mr))
+#define PCI_MAPREG_MEM_ADDR_MASK 0xfffffff0
+
+#define PCI_MAPREG_MEM64_ADDR(mr) \
+ ((mr) & PCI_MAPREG_MEM64_ADDR_MASK)
+#define PCI_MAPREG_MEM64_SIZE(mr) \
+ (PCI_MAPREG_MEM64_ADDR(mr) & -PCI_MAPREG_MEM64_ADDR(mr))
+#define PCI_MAPREG_MEM64_ADDR_MASK 0xfffffffffffffff0ULL
+
+#define PCI_MAPREG_IO_ADDR(mr) \
+ ((mr) & PCI_MAPREG_IO_ADDR_MASK)
+#define PCI_MAPREG_IO_SIZE(mr) \
+ (PCI_MAPREG_IO_ADDR(mr) & -PCI_MAPREG_IO_ADDR(mr))
+#define PCI_MAPREG_IO_ADDR_MASK 0xfffffffc
+
+#define PCI_MAPREG_SIZE_TO_MASK(size) \
+ (-(size))
+
+#define PCI_MAPREG(num) (PCI_MAPREG_START + 4*(num))
+#define PCI_MAPREG_NUM(offset) \
+ (((unsigned)(offset)-PCI_MAPREG_START)/4)
+
+/*
+ * Cardbus CIS pointer (PCI rev. 2.1)
+ */
+#define PCI_CARDBUS_CIS_REG 0x28
+
+/*
+ * Subsystem identification register; contains a vendor ID and a device ID.
+ * Types/macros for PCI_ID_REG apply.
+ * (PCI rev. 2.1)
+ */
+#define PCI_SUBSYS_ID_REG 0x2c
+
+/*
+ * Expansion ROM base address register; contains an address and enable bit.
+ */
+#define PCI_MAPREG_ROM 0x30
+#define PCI_MAPREG_ROM_ADDR(mr) \
+ ((mr) & PCI_MAPREG_ROM_ADDR_MASK)
+#define PCI_MAPREG_ROM_ADDR_MASK 0xfffff800
+#define PCI_MAPREG_ROM_ENABLE 0x00000001
+
+/*
+ * capabilities link list (PCI rev. 2.2)
+ */
+#define PCI_CAPLISTPTR_REG 0x34 /* header type 0 */
+#define PCI_CARDBUS_CAPLISTPTR_REG 0x14 /* header type 2 */
+#define PCI_CAPLIST_PTR(cpr) ((cpr) & 0xff)
+#define PCI_CAPLIST_NEXT(cr) (((cr) >> 8) & 0xff)
+#define PCI_CAPLIST_CAP(cr) ((cr) & 0xff)
+
+#define PCI_CAP_RESERVED0 0x00
+#define PCI_CAP_PWRMGMT 0x01
+#define PCI_CAP_AGP 0x02
+#define PCI_CAP_VPD 0x03
+#define PCI_CAP_SLOTID 0x04
+#define PCI_CAP_MBI 0x05
+#define PCI_CAP_CPCI_HOTSWAP 0x06
+#define PCI_CAP_PCIX 0x07
+#define PCI_CAP_LDT 0x08
+#define PCI_CAP_VENDSPEC 0x09
+#define PCI_CAP_DEBUGPORT 0x0a
+#define PCI_CAP_CPCI_RSRCCTL 0x0b
+#define PCI_CAP_HOTPLUG 0x0c
+
+/*
+ * Power Management Control Status Register; access via capability pointer.
+ */
+#define PCI_PMCSR_STATE_MASK 0x03
+#define PCI_PMCSR_STATE_D0 0x00
+#define PCI_PMCSR_STATE_D1 0x01
+#define PCI_PMCSR_STATE_D2 0x02
+#define PCI_PMCSR_STATE_D3 0x03
+
+/*
+ * Bus Parameter and Interrupt Configuration Register;
+ * contains interrupt pin and line.
+ */
+#define PCI_BPARAM_INTERRUPT_REG 0x3c
+
+#define PCI_BPARAM_LATENCY_SHIFT 24
+#define PCI_BPARAM_LATENCY_MASK 0xff
+#define PCI_BPARAM_LATENCY(bpir) \
+ (((bpir) >> PCI_BPARAM_LATENCY_SHIFT) & PCI_BPARAM_LATENCY_MASK)
+
+#define PCI_BPARAM_GRANT_SHIFT 16
+#define PCI_BPARAM_GRANT_MASK 0xff
+#define PCI_BPARAM_GRANT(bpir) \
+ (((bpir) >> PCI_BPARAM_GRANT_SHIFT) & PCI_BPARAM_GRANT_MASK)
+
+#define PCI_INTERRUPT_PIN_SHIFT 8
+#define PCI_INTERRUPT_PIN_MASK 0xff
+#define PCI_INTERRUPT_PIN(bpir) \
+ (((bpir) >> PCI_INTERRUPT_PIN_SHIFT) & PCI_INTERRUPT_PIN_MASK)
+
+#define PCI_INTERRUPT_LINE_SHIFT 0
+#define PCI_INTERRUPT_LINE_MASK 0xff
+#define PCI_INTERRUPT_LINE(bpir) \
+ (((bpir) >> PCI_INTERRUPT_LINE_SHIFT) & PCI_INTERRUPT_LINE_MASK)
+
+#define PCI_INTERRUPT_PIN_NONE 0x00
+#define PCI_INTERRUPT_PIN_A 0x01
+#define PCI_INTERRUPT_PIN_B 0x02
+#define PCI_INTERRUPT_PIN_C 0x03
+#define PCI_INTERRUPT_PIN_D 0x04
+#define PCI_INTERRUPT_PIN_MAX 0x04
+
+
+/*
+ * Type 01h Configuration Space extension:
+ * PCI to PCI Bridge registers (cf ppbreg.h)
+ * Derived from information found in the ``PCI to PCI Bridge
+ * Architecture Specification, Revision 1.1, December 18, 1998.''
+ */
+
+#define PPB_MAPREG_START 0x10
+#define PPB_MAPREG_END 0x18
+
+/*
+ * Bus Information Register; contains bus hierarchy and secondary latency.
+ */
+#define PPB_BUSINFO_REG 0x18
+
+#define PPB_BUSINFO_LATENCY_SHIFT 24
+#define PPB_BUSINFO_LATENCY_MASK 0xff
+#define PPB_BUSINFO_LATENCY(br) \
+ (((br) >> PPB_BUSINFO_LATENCY_SHIFT) & PPB_BUSINFO_LATENCY_MASK)
+
+#define PPB_BUSINFO_SUBORD_SHIFT 16
+#define PPB_BUSINFO_SUBORD_MASK 0xff
+#define PPB_BUSINFO_SUBORD(br) \
+ (((br) >> PPB_BUSINFO_SUBORD_SHIFT) & PPB_BUSINFO_SUBORD_MASK)
+
+#define PPB_BUSINFO_SECONDARY_SHIFT 8
+#define PPB_BUSINFO_SECONDARY_MASK 0xff
+#define PPB_BUSINFO_SECONDARY(br) \
+ (((br) >> PPB_BUSINFO_SECONDARY_SHIFT) & PPB_BUSINFO_SECONDARY_MASK)
+
+#define PPB_BUSINFO_PRIMARY_SHIFT 0
+#define PPB_BUSINFO_PRIMARY_MASK 0xff
+#define PPB_BUSINFO_PRIMARY(br) \
+ (((br) >> PPB_BUSINFO_PRIMARY_SHIFT) & PPB_BUSINFO_PRIMARY_MASK)
+
+/*
+ * IO Status Register; contains I/O base + limit and secondary status.
+ * Masks/macros for PCI_STATUS apply to Secondary Status.
+ */
+#define PPB_IO_STATUS_REG 0x1C
+
+#define PPB_IO_BASE_MASK 0x000000ff
+#define PPB_IO_LIMIT_MASK 0x0000ff00
+#define PPB_IO_ADDR_CAP_MASK 0x00000f0f
+#define PPB_IO_ADDR_CAP_16 0x00000000
+#define PPB_IO_ADDR_CAP_32 0x00000101
+#define PPB_IO_BASE(iosr) \
+ (((iosr) >> 0) & 0xff)
+#define PPB_IO_LIMIT(iosr) \
+ (((iosr) >> 8) & 0xff)
+
+#define PPB_SECSTATUS_SHIFT 16
+#define PPB_SECSTATUS_MASK 0xffff
+#define PPB_SECSTATUS(iosr) \
+ (((iosr) >> PPB_SECSTATUS_SHIFT) & PPB_SECSTATUS_MASK)
+
+/*
+ * Base and limit values for address ranges have common packing.
+ */
+#define PPB_BASE_SHIFT 0
+#define PPB_BASE_MASK 0xffff
+#define PPB_BASE(blr) \
+ (((blr) >> PPB_BASE_SHIFT) & PPB_BASE_MASK)
+
+#define PPB_LIMIT_SHIFT 16
+#define PPB_LIMIT_MASK 0xffff
+#define PPB_LIMIT(blr) \
+ (((blr) >> PPB_LIMIT_SHIFT) & PPB_LIMIT_MASK)
+
+/*
+ * Memory Registers; contains memory base + limit.
+ */
+#define PPB_MEM_REG 0x20
+#define PPB_PREFMEM_REG 0x24
+
+#define PPB_MEM_BASE_MASK 0x0000ffff
+#define PPB_MEM_LIMIT_MASK 0xffff0000
+
+/*
+ * Prefetchable Memory Upper Registers; contain high bits
+ */
+#define PPB_PREFMEM_BASE_UPPER_REG 0x28
+#define PPB_PREFMEM_LIMIT_UPPER_REG 0x2c
+
+/*
+ * IO Upper Register; contains I/O base + limit high bits
+ */
+#define PPB_IO_UPPER_REG 0x30
+
+#define PPB_IO_UPPER_BASE_MASK 0x0000ffff
+#define PPB_IO_UPPER_LIMIT_MASK 0xffff0000
+
+/*
+ * Expansion ROM Base Address Register.
+ */
+#define PPB_MAPREG_ROM 0x38
+
+/*
+ * Bridge Control and Interrupt Register
+ * Masks/macros for PCI_INTERRUPT apply to Interrupt
+ */
+#define PPB_BRCTL_INTERRUPT_REG 0x3C
+
+#define PPB_BRCTL_SHIFT 16
+#define PPB_BRCTL_MASK 0xffff
+#define PPB_BRCTL(bcir) \
+ (((bcir) >> PPB_BRCTL_SHIFT) & PPB_BRCTL_MASK)
+
+#define PPB_BRCTL_PARITY_ENABLE 0x00010000
+#define PPB_BRCTL_SERR_ENABLE 0x00020000
+#define PPB_BRCTL_ISA_ENABLE 0x00040000
+#define PPB_BRCTL_VGA_ENABLE 0x00080000
+#define PPB_BRCTL_MASTER_ABORT_MODE 0x00200000
+#define PPB_BRCTL_SECONDARY_RESET 0x00400000
+#define PPB_BRCTL_BACKTOBACK_ENABLE 0x00800000
+#define PPB_BRCTL_PRIMARY_DISCARD_TIMER 0x01000000
+#define PPB_BRCTL_SECONDARY_DISCARD_TIMER 0x02000000
+#define PPB_BRCTL_DISCARD_TIMER_STATUS 0x04000000
+#define PPB_BRCTL_DISCARD_SERR_ENABLE 0x08000000
+
+#endif /* _DEV_PCI_PCIREG_H_ */
diff --git a/cfe/cfe/pci/pcivar.h b/cfe/cfe/pci/pcivar.h
new file mode 100644
index 0000000..51f0b40
--- /dev/null
+++ b/cfe/cfe/pci/pcivar.h
@@ -0,0 +1,216 @@
+/*
+ * Copyright (c) 1994 Charles Hannum. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Charles Hannum.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _PCIVAR_H_
+#define _PCIVAR_H_
+
+/*
+ * Definitions for PCI autoconfiguration.
+ *
+ * The initial segment of this file describes types and functions
+ * that are exported for PCI configuration and address mapping. */
+
+#include "pci_machdep.h"
+
+/* From <cpu>_pci_machdep.c */
+
+pcitag_t pci_make_tag(int, int, int);
+pcireg_t pci_conf_read(pcitag_t, int);
+void pci_conf_write(pcitag_t, int, pcireg_t);
+
+typedef enum {
+ PCI_MATCH_BYTES = 0,
+ PCI_MATCH_BITS = 1
+} pci_endian_t;
+
+int pci_map_io(pcitag_t, int, pci_endian_t, phys_addr_t *);
+int pci_map_mem(pcitag_t, int, pci_endian_t, phys_addr_t *);
+
+uint8_t inb(unsigned int port);
+uint16_t inw(unsigned int port);
+uint32_t inl(unsigned int port);
+void outb(unsigned int port, uint8_t val);
+void outw(unsigned int port, uint16_t val);
+void outl(unsigned int port, uint32_t val);
+
+int pci_map_window(phys_addr_t pa,
+ unsigned int offset, unsigned int len,
+ int l2ca, int endian);
+int pci_unmap_window(unsigned int offset, unsigned int len);
+
+/* From pciconf.c */
+
+/* Flags controlling PCI/LDT configuration options */
+
+typedef unsigned int pci_flags_t;
+
+#define PCI_FLG_NORMAL 0x00000001
+#define PCI_FLG_VERBOSE 0x00000003
+#define PCI_FLG_LDT_PREFETCH 0x00000004
+#define PCI_FLG_LDT_REV_017 0x00000008
+
+void pci_configure(pci_flags_t flags);
+void pci_show_configuration(void);
+int pci_foreachdev(int (*fn)(pcitag_t tag));
+int pci_cacheline_log2 (void);
+int pci_maxburst_log2 (void);
+
+int pci_find_device(uint32_t vid, uint32_t did, int enumidx, pcitag_t *tag);
+int pci_find_class(uint32_t class, int enumidx, pcitag_t *tag);
+
+/* From pci_subr.c */
+
+void pci_devinfo(pcireg_t, pcireg_t, int, char *);
+void pci_conf_print(pcitag_t tag);
+
+void pci_tagprintf (pcitag_t tag, const char *fmt, ...)
+#ifdef __long64
+ __attribute__((__format__(__printf__,2,3)))
+#endif
+ ;
+
+
+/*
+ * Definitions for PCI autoconfiguration.
+ *
+ * The remainder of this file describes types and functions
+ * that are used only for communication among the PCI modules
+ * implementing autoconfiguration.
+ * XXX This should be split into a separate file. */
+
+/* Build options. Debug levels >1 are for helping to bring up new
+ LDT hardware and will be annoyingly verbose otherwise. */
+
+/* PCI_DEBUG enables general checking and tracing. */
+#ifndef PCI_DEBUG
+#define PCI_DEBUG 0
+#endif
+
+/* LDT_DEBUG enables progress/error reports for LDT fabric initialization. */
+#ifndef LDT_DEBUG
+#define LDT_DEBUG 0
+#endif
+
+
+struct pci_attach_args {
+ pcitag_t pa_tag;
+ pcireg_t pa_id;
+ pcireg_t pa_class;
+};
+
+struct pci_match {
+ pcireg_t class, classmask;
+ pcireg_t id, idmask;
+};
+
+/* From <cpu>_pci_machdep.c */
+
+int pci_hwinit(pci_flags_t flags);
+void pci_hwreinit(pci_flags_t flags);
+int pci_device_preset (pcitag_t tag);
+void pci_device_setup(pcitag_t tag);
+void pci_bridge_setup(pcitag_t tag, pci_flags_t flags);
+void pci_flush(void);
+
+void pci_break_tag(pcitag_t, int *, int *, int *);
+
+int pci_canscan(pcitag_t);
+int pci_probe_tag(pcitag_t tag);
+
+pcireg_t pci_conf_read8(pcitag_t, int);
+void pci_conf_write8(pcitag_t, int, pcireg_t);
+pcireg_t pci_conf_read16(pcitag_t, int);
+void pci_conf_write16(pcitag_t, int, pcireg_t);
+pcireg_t pci_conf_read(pcitag_t, int);
+void pci_conf_write(pcitag_t, int, pcireg_t);
+#define pci_conf_read32 pci_conf_read
+#define pci_conf_write32 pci_conf_write
+int pci_conf_write_acked(pcitag_t, int, pcireg_t);
+
+uint8_t pci_int_line(uint8_t);
+
+
+/* From <board>_pci.c */
+
+uint8_t pci_int_shift_0(pcitag_t);
+uint8_t pci_int_map_0(pcitag_t);
+
+
+/* From ldtinit.c */
+
+#define LDT_PRIMARY 0
+#define LDT_SECONDARY 1
+unsigned pci_find_ldt_cap (pcitag_t tag, int secondary);
+
+void ldt_link_reset (pcitag_t tag, int delay);
+int ldt_chain_init (pcitag_t tag, int bus, pci_flags_t flags);
+
+
+/* From pci_subr.c */
+
+void pci_bdfprintf(int bus, int device, int function, const char *fmt, ...)
+#ifdef __long64
+ __attribute__((__format__(__printf__,4,5)))
+#endif
+ ;
+
+
+/* PCI bus parameters */
+struct pci_bus {
+ unsigned char min_gnt; /* largest min grant */
+ unsigned char max_lat; /* smallest max latency */
+ unsigned char devsel; /* slowest devsel */
+ char fast_b2b; /* support fast b2b */
+ char prefetch; /* support prefetch */
+ char freq66; /* support 66MHz */
+ char width64; /* 64 bit bus */
+ int bandwidth; /* # of .25us ticks/sec @ 33MHz */
+ unsigned char ndev; /* # devices (functions) on bus */
+ unsigned char def_ltim; /* default ltim counter */
+ unsigned char max_ltim; /* maximum ltim counter */
+ uint8_t primary; /* primary bus number */
+ pcitag_t tag; /* tag for this bus */
+ uint32_t min_io_addr; /* min I/O address allocated to bus */
+ uint32_t max_io_addr; /* max I/O address allocated to bus */
+ uint32_t min_mem_addr; /* min mem address allocated to bus */
+ uint32_t max_mem_addr; /* max mem address allocated to bus */
+ uint8_t inta_shift; /* base rotation of interrupt pins */
+ char no_probe; /* skip businit and query probes */
+};
+
+extern pcireg_t minpcimemaddr;
+extern pcireg_t maxpcimemaddr;
+extern pcireg_t minpciioaddr;
+extern pcireg_t maxpciioaddr;
+
+extern struct pci_bus _pci_bus[];
+extern int _pci_nbus;
+extern const int _pci_maxbus;
+
+#endif /* _PCIVAR_H_ */
diff --git a/cfe/cfe/ui/ui_cmddisp.c b/cfe/cfe/ui/ui_cmddisp.c
new file mode 100644
index 0000000..8609f1c
--- /dev/null
+++ b/cfe/cfe/ui/ui_cmddisp.c
@@ -0,0 +1,252 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * UI Command Dispatch File: ui_cmddisp.c
+ *
+ * This module contains routines to maintain the command table,
+ * parse and execute commands
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include <stdarg.h>
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "lib_setjmp.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "cfe_error.h"
+#include "env_subr.h"
+#include "cfe.h"
+#include "ui_command.h"
+
+/* *********************************************************************
+ * Types
+ ********************************************************************* */
+
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+static jmp_buf ui_jmpbuf; /* for getting control in exceptions */
+
+
+
+void dumplist(queue_t *qb);
+void dumplist(queue_t *qb)
+{
+ queue_t *q;
+ ui_token_t *t;
+
+ for (q = qb->q_next; q != qb; q = q->q_next) {
+
+ t = (ui_token_t *) q;
+ printf("[%s] ",&(t->token));
+ }
+ printf("\n");
+}
+
+
+
+const char *ui_errstring(int errcode)
+{
+ return cfe_errortext(errcode);
+}
+
+
+int ui_showerror(int errcode,char *tmplt,...)
+{
+ va_list marker;
+
+ va_start(marker,tmplt);
+ xvprintf(tmplt,marker);
+ va_end(marker);
+ xprintf(": %s\n",ui_errstring(errcode));
+
+ return errcode;
+}
+
+
+
+static int ui_do_one_command(queue_t *head)
+{
+ int res;
+ ui_cmdline_t cmd;
+
+ res = cmd_lookup(head, &cmd);
+
+ if (res == 0) {
+
+ res = cmd_sw_validate(&cmd,cmd.switches);
+ if (res != -1) {
+ xprintf("Invalid switch: %s\n",
+ cmd_sw_name(&cmd,res));
+ return CFE_ERR_INV_PARAM;
+ }
+
+ if (lib_setjmp(ui_jmpbuf) != 0) return -1;
+ res = (*cmd.func)(&cmd,cmd.argc-cmd.argidx,
+ &(cmd.argv[cmd.argidx]));
+ }
+ cmd_free(&cmd);
+ return res;
+}
+
+
+void ui_restart(int arg)
+{
+ if (arg == 0) arg = -1;
+
+ lib_longjmp(ui_jmpbuf,arg);
+}
+
+int ui_init_cmddisp(void)
+{
+ cmd_init();
+
+ return 0;
+}
+
+int ui_showusage(ui_cmdline_t *cmd)
+{
+ cmd_showusage(cmd);
+
+ return CFE_ERR_INV_COMMAND;
+}
+
+
+/* *********************************************************************
+ * ui_docommands_internal(head)
+ *
+ * Process (possibly multiple) commands from a list of tokens
+ *
+ * Input parameters:
+ * buf - buffer
+ *
+ * Return value:
+ * exit status of first command that failed, or null
+ ********************************************************************* */
+static int ui_docommands_internal(queue_t *head)
+{
+ queue_t cmdqueue;
+ ui_command_t *cmd;
+ int status = CMD_ERR_BLANK;
+ int term;
+
+ q_init(&cmdqueue);
+
+ /*
+ * Find all the individual commands
+ */
+
+ while ((cmd = cmd_readcommand(head))) {
+
+ if (cmd == NULL) {
+ return CMD_ERR_BLANK;
+ }
+
+ q_enqueue(&cmdqueue,(queue_t *) cmd);
+ }
+
+ /*
+ * Do each command
+ */
+
+ while ((cmd = (ui_command_t *) q_deqnext(&(cmdqueue)))) {
+ status = ui_do_one_command(&(cmd->head));
+ term = cmd->term;
+ KFREE(cmd);
+ if (status == CMD_ERR_BLANK) continue;
+
+ /*
+ * And causes us to stop at the first failure.
+ */
+ if ((term == CMD_TERM_AND) && (status != 0)) break;
+
+ /*
+ * OR causes us to stop at the first success.
+ */
+
+ if ((term == CMD_TERM_OR) && (status == 0)) break;
+
+ /*
+ * Neither AND nor OR causes us to keep chugging away.
+ */
+ }
+
+ /*
+ * Free any remaining tokens and commands that we did not do
+ */
+
+ while ((cmd = (ui_command_t *) q_deqnext(&(cmdqueue)))) {
+ cmd_free_tokens(&(cmd->head));
+ KFREE(cmd);
+ }
+
+ return status;
+}
+
+
+int ui_docommands(char *str)
+{
+ queue_t cmd_list;
+ int res;
+
+ /* Convert the command into a token list */
+ cmd_build_list(&cmd_list,str);
+
+ /* Walk the list and expand environment variables */
+ cmd_walk_and_expand(&cmd_list);
+
+ /* Process each command. This removes tokens from the list */
+ res = ui_docommands_internal(&cmd_list);
+
+ /* Free any leftover tokens. There should not be any. */
+ cmd_free_tokens(&cmd_list);
+
+ return res;
+}
diff --git a/cfe/cfe/ui/ui_command.c b/cfe/cfe/ui/ui_command.c
new file mode 100644
index 0000000..79d770f
--- /dev/null
+++ b/cfe/cfe/ui/ui_command.c
@@ -0,0 +1,990 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * UI Command Dispatch File: ui_command.c
+ *
+ * This module contains routines to maintain the command table,
+ * parse and execute commands
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include <stdarg.h>
+
+#include "lib_queue.h"
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "cfe_error.h"
+#include "env_subr.h"
+#include "cfe.h"
+
+#include "ui_command.h"
+
+#define MAX_EXPAND 16
+
+typedef struct cmdtab_s {
+ struct cmdtab_s *sibling;
+ struct cmdtab_s *child;
+ char *cmdword;
+ int (*func)(ui_cmdline_t *,int argc,char *argv[]);
+ void *ref;
+ char *help;
+ char *usage;
+ char *switches;
+} cmdtab_t;
+
+cmdtab_t *cmd_root;
+
+static void cmd_rejoin_quotes(queue_t *qb);
+
+#define myisalpha(x) (((x)>='A')&&((x)<='Z')&&((x)>='a')&&((x)<='z'))
+#define myisdigit(x) (((x)>='0')&&((x)<='9'))
+
+char *varchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "abcdefghijklmnopqrstuvwxyz"
+ "0123456789_?";
+
+static char *tokenbreaks = " =\t\n\'\"&|;";
+static char *spacechars = " \t";
+
+
+
+static inline int is_white_space(ui_token_t *t)
+{
+ return (strchr(spacechars,t->token) != NULL);
+}
+
+int cmd_sw_value(ui_cmdline_t *cmd,char *swname,char **swvalue)
+{
+ int idx;
+
+ for (idx = 0; idx < cmd->swc; idx++) {
+ if (strcmp(swname,cmd->swv[idx].swname) == 0) {
+ *swvalue = cmd->swv[idx].swvalue;
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+int cmd_sw_posn(ui_cmdline_t *cmd,char *swname)
+{
+ int idx;
+
+ for (idx = 0; idx < cmd->swc; idx++) {
+ if (strcmp(swname,cmd->swv[idx].swname) == 0) {
+ return cmd->swv[idx].swidx;
+ }
+ }
+
+ return -1;
+}
+
+char *cmd_sw_name(ui_cmdline_t *cmd,int swidx)
+{
+ if ((swidx < 0) || (swidx >= cmd->swc)) return NULL;
+
+ return cmd->swv[swidx].swname;
+}
+
+
+int cmd_sw_isset(ui_cmdline_t *cmd,char *swname)
+{
+ int idx;
+
+ for (idx = 0; idx < cmd->swc; idx++) {
+ if (strcmp(swname,cmd->swv[idx].swname) == 0) {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+char *cmd_getarg(ui_cmdline_t *cmd,int argnum)
+{
+ argnum += cmd->argidx;
+ if ((argnum < 0) || (argnum >= cmd->argc)) return NULL;
+ return cmd->argv[argnum];
+}
+
+void cmd_free(ui_cmdline_t *cmd)
+{
+ int idx;
+
+ for (idx = 0; idx < cmd->argc; idx++) {
+ KFREE(cmd->argv[idx]);
+ }
+
+ for (idx = 0; idx < cmd->swc; idx++) {
+ KFREE(cmd->swv[idx].swname);
+ }
+
+ cmd->argc = 0;
+ cmd->swc = 0;
+}
+
+int cmd_sw_validate(ui_cmdline_t *cmd,char *validstr)
+{
+ char *vdup;
+ char *vptr;
+ char *vnext;
+ char atype;
+ char *x;
+ int idx;
+ int valid;
+
+ if (cmd->swc == 0) return -1;
+
+ vdup = strdup(validstr);
+
+ for (idx = 0; idx < cmd->swc; idx++) {
+ vptr = vdup;
+
+ vnext = vptr;
+ valid = 0;
+
+ while (vnext) {
+
+ /*
+ * Eat the next switch description from the valid string
+ */
+ x = strchr(vptr,'|');
+ if (x) {
+ *x = '\0';
+ vnext = x+1;
+ }
+ else {
+ vnext = NULL;
+ }
+
+ /*
+ * Get the expected arg type, if any
+ */
+ x = strchr(vptr,'=');
+ if (x) {
+ atype = *(x+1);
+ *x = 0;
+ }
+ else {
+ if ((x = strchr(vptr,';'))) *x = 0;
+ atype = 0;
+ }
+
+ /*
+ * See if this matches what the user typed
+ * XXX for now, ignore the arg type processing but
+ * complain if an arg is missing.
+ */
+
+ if (strcmp(vptr,cmd->swv[idx].swname) == 0) {
+ /* Value not needed and not supplied */
+ if ((atype == 0) && (cmd->swv[idx].swvalue == NULL)) {
+ valid = 1;
+ }
+ /* value needed and supplied */
+ if ((atype != 0) && (cmd->swv[idx].swvalue != NULL)) {
+ valid = 1;
+ }
+ strcpy(vdup,validstr);
+ break;
+ }
+
+ /*
+ * Otherwise, next!
+ */
+
+ strcpy(vdup,validstr);
+ vptr = vnext;
+ }
+
+ /*
+ * If not valid, return index of bad switch
+ */
+
+ if (valid == 0) {
+ KFREE(vdup);
+ return idx;
+ }
+
+ }
+
+ /*
+ * Return -1 if everything went well. A little strange,
+ * but it's easier this way.
+ */
+
+ KFREE(vdup);
+ return -1;
+}
+
+static cmdtab_t *cmd_findword(cmdtab_t *list,char *cmdword)
+{
+ while (list) {
+ if (strcmp(cmdword,list->cmdword) == 0) return list;
+ list = list->sibling;
+ }
+
+ return NULL;
+}
+
+
+void cmd_build_cmdline(queue_t *head, ui_cmdline_t *cmd)
+{
+ ui_token_t *t;
+ ui_token_t *next;
+
+ memset(cmd, 0, sizeof(ui_cmdline_t));
+
+ t = (ui_token_t *) q_deqnext(head);
+
+ while (t != NULL) {
+ if (is_white_space(t)) {
+ /* do nothing */
+ }
+ else if (t->token != '-') {
+ if(cmd->argc < MAX_TOKENS){
+ cmd->argv[cmd->argc] = lib_strdup(&(t->token));
+ cmd->argc++;
+ }
+ /* Token is a switch */
+ }
+ else {
+ if (cmd->swc < MAX_SWITCHES) {
+ cmd->swv[cmd->swc].swname = lib_strdup(&(t->token));
+
+ if (t->qb.q_next != head) { /* more tokens */
+ next = (ui_token_t *) t->qb.q_next;
+ if (next->token == '=') { /* switch has value */
+ KFREE(t); /* Free switch name */
+ t = (ui_token_t *) q_deqnext(head); /* eat equal sign */
+ KFREE(t); /* and free it */
+ t = (ui_token_t *) q_deqnext(head); /* now have value */
+ if (t != NULL) {
+ cmd->swv[cmd->swc].swvalue = lib_strdup(&(t->token));
+ }
+ }
+ else { /* no value */
+ cmd->swv[cmd->swc].swvalue = NULL;
+ }
+ }
+ /*
+ * swidx is the index of the argument that this
+ * switch precedes. So, if you have "foo -d bar",
+ * swidx for "-d" would be 1.
+ */
+ cmd->swv[cmd->swc].swidx = cmd->argc;
+ cmd->swc++;
+ }
+ }
+ KFREE(t);
+ t = (ui_token_t *) q_deqnext(head);
+ }
+
+}
+
+int cmd_addcmd(char *command,
+ int (*func)(ui_cmdline_t *,int argc,char *argv[]),
+ void *ref,
+ char *help,
+ char *usage,
+ char *switches)
+{
+ cmdtab_t **list = &cmd_root;
+ cmdtab_t *cmd = NULL;
+ queue_t tokens;
+ queue_t *cur;
+ ui_token_t *t;
+
+ cmd_build_list(&tokens,command);
+ cur = tokens.q_next;
+
+ while (cur != &tokens) {
+ t = (ui_token_t *) cur;
+ if (!is_white_space(t)) {
+ cmd = cmd_findword(*list,&(t->token));
+ if (!cmd) {
+ cmd = KMALLOC(sizeof(cmdtab_t)+strlen(&(t->token))+1,0);
+ memset(cmd,0,sizeof(cmdtab_t));
+ cmd->cmdword = (char *) (cmd+1);
+ strcpy(cmd->cmdword,&(t->token));
+ cmd->sibling = *list;
+ *list = cmd;
+ }
+ list = &(cmd->child);
+ }
+ cur = cur->q_next;
+ }
+
+ cmd_free_tokens(&tokens);
+
+ if (!cmd) return -1;
+
+ cmd->func = func;
+ cmd->usage = usage;
+ cmd->ref = ref;
+ cmd->help = help;
+ cmd->switches = switches;
+
+ return 0;
+}
+
+
+
+static void _dumpindented(char *str,int amt)
+{
+ int idx;
+ char *dupstr;
+ char *end;
+ char *ptr;
+
+ dupstr = strdup(str);
+
+ ptr = dupstr;
+
+ while (*ptr) {
+ for (idx = 0; idx < amt; idx++) printf(" ");
+
+ end = strchr(ptr,'\n');
+
+ if (end) *end++ = '\0';
+ else end = ptr + strlen(ptr);
+
+ printf("%s\n",ptr);
+ ptr = end;
+ }
+
+ KFREE(dupstr);
+}
+
+static void _dumpswitches(char *str)
+{
+ char *switches;
+ char *end;
+ char *ptr;
+ char *semi;
+ char *newline;
+
+ switches = strdup(str);
+
+ ptr = switches;
+
+ while (*ptr) {
+ end = strchr(ptr,'|');
+ if (end) *end++ = '\0';
+ else end = ptr + strlen(ptr);
+
+ printf(" ");
+ if ((semi = strchr(ptr,';'))) {
+ *semi++ = '\0';
+ newline = strchr(semi,'\n');
+ if (newline) *newline++ = '\0';
+ printf("%-12s %s\n",ptr,semi);
+ if (newline) _dumpindented(newline,5+12+1);
+ }
+ else {
+ printf("%-12s (no information)\n",ptr);
+ }
+ ptr = end;
+ }
+
+ KFREE(switches);
+}
+
+static void _dumpcmds(cmdtab_t *cmd,int level,char **words,int verbose)
+{
+ int idx;
+ int len;
+
+ while (cmd) {
+ len = 0;
+ words[level] = cmd->cmdword;
+ if (cmd->func) {
+ for (idx = 0; idx < level; idx++) {
+ printf("%s ",words[idx]);
+ len += strlen(words[idx])+1;
+ }
+ printf("%s",cmd->cmdword);
+ len += strlen(cmd->cmdword);
+ for (idx = len; idx < 20; idx++) printf(" ");
+ printf("%s\n",cmd->help);
+ if (verbose) {
+ printf("\n");
+ _dumpindented(cmd->usage,5);
+ printf("\n");
+ _dumpswitches(cmd->switches);
+ printf("\n");
+ }
+ }
+ _dumpcmds(cmd->child,level+1,words,verbose);
+ cmd = cmd->sibling;
+ }
+}
+
+static void dumpcmds(int verbose)
+{
+ char *words[20];
+
+ _dumpcmds(cmd_root,0,words,verbose);
+}
+
+
+static void _showpossible(ui_cmdline_t *cline,cmdtab_t *cmd)
+{
+ int i;
+
+ if (cline->argidx == 0) {
+ printf("Available commands: ");
+ }
+ else {
+ printf("Available \"");
+ for (i = 0; i < cline->argidx; i++) {
+ printf("%s%s",(i == 0) ? "" : " ",cline->argv[i]);
+ }
+ printf("\" commands: ");
+ }
+
+ while (cmd) {
+ printf("%s",cmd->cmdword);
+ if (cmd->sibling) printf(", ");
+ cmd = cmd->sibling;
+ }
+
+ printf("\n");
+}
+
+static int cmd_help(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ cmdtab_t **tab;
+ cmdtab_t *cword;
+ int idx;
+
+ if (argc == 0) {
+ printf("Available commands:\n\n");
+ dumpcmds(0);
+ printf("\n");
+ printf("For more information about a command, enter 'help command-name'\n");
+ }
+ else {
+ idx = 0;
+ tab = &cmd_root;
+ cword = NULL;
+
+ for (;;) {
+ cword = cmd_findword(*tab,argv[idx]);
+ if (!cword) break;
+ if (cword->func != NULL) break;
+ idx++;
+ tab = &(cword->child);
+ if (idx >= argc) break;
+ }
+
+ if (cword == NULL) {
+ printf("No help available for '%s'.\n\n",argv[idx]);
+ printf("Type 'help' for a list of commands.\n");
+ return -1;
+ }
+
+ if (!cword->func && (idx >= argc)) {
+ printf("No help available for '%s'.\n\n",cword->cmdword);
+ printf("Type 'help' for a list of commands.\n");
+ return -1;
+ }
+
+ printf("\n SUMMARY\n\n");
+ _dumpindented(cword->help,5);
+ printf("\n USAGE\n\n");
+ _dumpindented(cword->usage,5);
+ if (cword->switches && cword->switches[0]) {
+ printf("\n OPTIONS\n\n");
+ _dumpswitches(cword->switches);
+ }
+ printf("\n");
+ }
+
+ return 0;
+}
+
+void cmd_init(void)
+{
+ cmd_root = NULL;
+
+ cmd_addcmd("help",
+ cmd_help,
+ NULL,
+ "Obtain help for CFE commands",
+ "help [command]\n\n"
+ "Without any parameters, the 'help' command will display a summary\n"
+ "of available commands. For more details on a command, type 'help'\n"
+ "and the command name.",
+ "");
+}
+
+
+int cmd_lookup(queue_t *head,ui_cmdline_t *cmd)
+{
+ cmdtab_t **tab;
+ cmdtab_t *cword;
+ int idx;
+
+ /*
+ * Reset the command line
+ */
+
+ memset(cmd,0,sizeof(ui_cmdline_t));
+
+ /*
+ * Break it up into tokens
+ */
+
+ cmd_build_cmdline(head, cmd);
+
+ if (cmd->argc == 0) return CMD_ERR_BLANK;
+
+ /*
+ * Start walking the tree looking for a function
+ * to execute.
+ */
+
+ idx = 0;
+ tab = &cmd_root;
+ cword = NULL;
+
+ for (;;) {
+ cword = cmd_findword(*tab,cmd->argv[idx]);
+ if (!cword) break;
+ if (cword->func != NULL) break;
+ idx++;
+ tab = &(cword->child);
+ if (idx >= cmd->argc) break;
+ }
+
+ cmd->argidx = idx;
+
+/* XXX - Must fix this... the error needs to walk the tree! */
+
+ if (cword == NULL) {
+ printf("Invalid command: \"%s\"\n", cmd->argv[idx]);
+ _showpossible(cmd,*tab);
+ printf("\n");
+ return CMD_ERR_INVALID;
+ }
+
+ if (!cword->func && (idx >= cmd->argc)) {
+ printf("Incomplete command: \"%s\"\n",cmd->argv[idx]);
+ _showpossible(cmd,*tab);
+ printf("\n");
+ return CMD_ERR_AMBIGUOUS;
+ }
+
+ cmd->argidx++;
+ cmd->ref = cword->ref;
+ cmd->usage = cword->usage;
+ cmd->switches = cword->switches;
+ cmd->func = cword->func;
+
+ return 0;
+}
+
+
+void cmd_showusage(ui_cmdline_t *cmd)
+{
+ printf("\n");
+ _dumpindented(cmd->usage,5);
+ printf("\n");
+ if (cmd->switches[0]) {
+ _dumpswitches(cmd->switches);
+ printf("\n");
+ }
+}
+
+
+static void cmd_eat_leading_white(queue_t *head)
+{
+ ui_token_t *t;
+
+ while (!q_isempty(head)) {
+ t = (ui_token_t *) q_getfirst(head);
+ if (is_white_space(t)) {
+ q_dequeue(&(t->qb));
+ KFREE(t);
+ }
+ else break;
+ }
+}
+
+ui_command_t *cmd_readcommand(queue_t *head)
+{
+ char *ptr;
+ int insquote = FALSE;
+ int indquote = FALSE;
+ ui_command_t *cmd;
+ int term = CMD_TERM_EOL;
+ ui_token_t *t;
+
+ cmd_eat_leading_white(head);
+
+ if (q_isempty(head)) return NULL;
+
+ cmd = (ui_command_t *) KMALLOC(sizeof(ui_command_t),0);
+ q_init(&(cmd->head));
+
+ while ((t = (ui_token_t *) q_deqnext(head))) {
+
+ ptr = &(t->token);
+
+ if (!insquote && !indquote) {
+ if ((*ptr == ';') || (*ptr == '\n')) {
+ term = CMD_TERM_SEMI;
+ break;
+ }
+ if ((*ptr == '&') && (*(ptr+1) == '&')) {
+ term = CMD_TERM_AND;
+ break;
+ }
+ if ((*ptr == '|') && (*(ptr+1) == '|')) {
+ term = CMD_TERM_OR;
+ break;
+ }
+ }
+
+ if (*ptr == '\'') {
+ insquote = !insquote;
+ }
+
+ if (!insquote) {
+ if (*ptr == '"') {
+ indquote = !indquote;
+ }
+ }
+
+ q_enqueue(&(cmd->head),&(t->qb));
+
+ }
+
+ cmd->term = term;
+
+ /* If we got out by finding a command separator, eat the separator */
+ if (term != CMD_TERM_EOL) {
+ KFREE(t);
+ }
+
+ /* Turn quoted strings back into tokens */
+
+ cmd_rejoin_quotes(&(cmd->head));
+
+ return cmd;
+}
+
+
+
+static ui_token_t *make_token(char *str,int len)
+{
+ ui_token_t *t = (ui_token_t *) KMALLOC(sizeof(ui_token_t) + len,0);
+
+ memcpy(&(t->token),str,len);
+ (&(t->token))[len] = 0;
+
+ return t;
+}
+
+void cmd_build_list(queue_t *qb,char *buf)
+{
+ char *cur = buf, *start = NULL, *fin = NULL;
+ ui_token_t *t;
+
+ q_init(qb);
+
+ start = cur;
+ while(*cur != '\0'){
+ if (*cur == '&' && *(cur + 1) != '&') {
+ /* Do nothing if we have only one & */
+ }
+ else if (*cur == '|' && *(cur + 1) != '|') {
+ /* Do nothing if we have only one | */
+ }
+ else if (((*cur == ' ')||(*cur == '\t')) &&
+ ((*(cur - 1) == ' ')||(*(cur - 1) == '\t'))) {
+ /* Make one big token for white space */
+ }
+ else {
+
+ if (strchr(tokenbreaks,*cur)) {
+ if (cur != buf) {
+ fin = cur;
+ t = make_token(start,fin-start);
+ q_enqueue(qb,&(t->qb));
+ start = cur; /* Start new token */
+ }
+ }
+ else {
+ /* If we are on a normal character but the last character was */
+ /* a special char we need to start a new token */
+
+ if ((cur > buf) && strchr(tokenbreaks,*(cur-1))) {
+ fin = cur;
+ t = make_token(start,fin-start);
+ q_enqueue(qb,&(t->qb));
+ start = cur; /* Start new token */
+ }
+ else {
+ /* If the last charecter wasn't special keep going with */
+ /* current token */
+ }
+
+
+ }
+
+ }
+ cur++;
+ }
+
+ fin = cur;
+
+ if (fin-start > 0) {
+ t = make_token(start,fin-start);
+ q_enqueue(qb,&(t->qb));
+ }
+
+ return;
+}
+
+static int is_command_separator(ui_token_t *t)
+{
+ char *string = &(t->token);
+ int sep = 0;
+
+ switch(*string){
+ case ';':
+ sep = 1;
+ break;
+ case '&':
+ if(*(string + 1) == '&')
+ sep = 1;
+ break;
+ case '|':
+ if(*(string + 1) == '|')
+ sep = 1;
+ default:
+ break;
+ }
+
+ return(sep);
+}
+
+static void cmd_append_tokens(queue_t *qb,char *str)
+{
+ queue_t *qq;
+ queue_t explist;
+
+ cmd_build_list(&explist,str);
+
+ while ((qq = q_deqnext(&explist))) {
+ q_enqueue(qb,qq);
+ }
+}
+
+static void cmd_squash_and_append(queue_t *list,queue_t *quotelist)
+{
+ int maxlen = 0;
+ queue_t *q;
+ ui_token_t *t;
+ ui_token_t *newtok;
+ char *dest;
+
+ for (q = quotelist->q_next; q != quotelist; q = q->q_next) {
+ maxlen += strlen(&(((ui_token_t *) q)->token));
+ }
+
+ newtok = KMALLOC(sizeof(ui_token_t) + maxlen,0);
+
+ dest = &(newtok->token);
+
+ while ((t = (ui_token_t *) q_deqnext(quotelist))) {
+ strcpy(dest,&(t->token));
+ dest += strlen(dest);
+ KFREE(t);
+ }
+
+ q_enqueue(list,&(newtok->qb));
+}
+
+
+static void cmd_rejoin_quotes(queue_t *qb)
+{
+ queue_t newq;
+ queue_t quotedq;
+ queue_t *q;
+ ui_token_t *t;
+ int insquote = FALSE;
+ int indquote = FALSE;
+
+ q_init(&newq);
+ q_init(&quotedq);
+
+ while ((t = (ui_token_t *) q_deqnext(qb))) {
+
+ switch (t->token) {
+ case '\'':
+ KFREE(t); /* eat the quotes */
+
+ insquote = !insquote;
+
+ if (!insquote) {
+ cmd_squash_and_append(&newq,&quotedq);
+ }
+ break;
+
+ case '"': /* eat the quotes */
+ KFREE(t);
+
+ if (insquote == FALSE) {
+ indquote = !indquote;
+ if (!indquote) {
+ cmd_squash_and_append(&newq,&quotedq);
+ }
+ }
+ break;
+
+ default:
+ if (insquote || indquote) {
+ q_enqueue(&quotedq,&(t->qb));
+ }
+ else {
+ q_enqueue(&newq,&(t->qb));
+ }
+
+ }
+ }
+
+ /*
+ * If a dangling quoted string, just tack it on the list.
+ */
+
+ if (!q_isempty(&quotedq)) {
+ cmd_squash_and_append(&newq,&quotedq);
+ }
+
+ /*
+ * Put everything back on the original list.
+ */
+
+ while ((q = q_deqnext(&newq))) {
+ q_enqueue(qb,q);
+ }
+
+
+}
+
+void cmd_walk_and_expand (queue_t *qb)
+{
+ queue_t *q;
+ queue_t newq;
+ ui_token_t *t;
+ int alias_check = TRUE;
+ int insquote = FALSE;
+ char *envstr;
+
+ q_init(&newq);
+
+ while ((t = (ui_token_t *) q_deqnext(qb))) {
+ if (t->token == '\'') {
+ alias_check = FALSE;
+ insquote = !insquote;
+ /* Check to see if we should try to expand this token */
+ }
+ else if (!insquote) {
+ if (alias_check && !strchr(tokenbreaks,t->token) &&
+ (envstr = env_getenv(&(t->token)))) {
+ /* Aliases: stick into token stream if no environment found */
+ cmd_append_tokens(&newq,envstr);
+ KFREE(t);
+ t = NULL;
+ }
+ else if (t->token == '$') {
+ /* non-aliases: remove from token stream if no env found */
+ envstr = env_getenv(&(t->token)+1);
+ if (envstr) cmd_append_tokens(&newq,envstr);
+ KFREE(t);
+ t = NULL;
+ }
+ else {
+ /* Drop down below, keep this token as-is and append */
+ }
+ }
+
+ /*
+ * If token was not removed, add it to the new queue
+ */
+
+ if (t) {
+ q_enqueue(&newq,&(t->qb));
+ alias_check = is_command_separator(t);
+ }
+
+ }
+
+ /*
+ * Put everything back on the original list.
+ */
+
+ while ((q = q_deqnext(&newq))) {
+ q_enqueue(qb,q);
+ }
+
+}
+
+void cmd_free_tokens(queue_t *list)
+{
+ queue_t *q;
+
+ while ((q = q_deqnext(list))) {
+ KFREE(q);
+ }
+}
+
diff --git a/cfe/cfe/ui/ui_devcmds.c b/cfe/cfe/ui/ui_devcmds.c
new file mode 100644
index 0000000..72ea7bb
--- /dev/null
+++ b/cfe/cfe/ui/ui_devcmds.c
@@ -0,0 +1,101 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Device Commands File: ui_devcmds.c
+ *
+ * User interface for the device manager
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "env_subr.h"
+#include "ui_command.h"
+#include "cfe.h"
+
+
+extern queue_t cfe_devices;
+
+int ui_init_devcmds(void);
+
+static int ui_cmd_devnames(ui_cmdline_t *cmd,int argc,char *argv[]);
+
+
+int ui_cmd_devnames(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ queue_t *qb;
+ cfe_device_t *dev;
+
+ xprintf("Device Name Description\n");
+ xprintf("------------------- ---------------------------------------------------------\n");
+
+ for (qb = cfe_devices.q_next; qb != &cfe_devices; qb = qb->q_next) {
+ dev = (cfe_device_t *) qb;
+
+ xprintf("%19s %s\n",dev->dev_fullname,
+ dev->dev_description);
+
+ }
+
+ return 0;
+}
+
+
+int ui_init_devcmds(void)
+{
+ cmd_addcmd("show devices",
+ ui_cmd_devnames,
+ NULL,
+ "Display information about the installed devices.",
+ "show devices\n\n"
+ "This command displays the names and descriptions of the devices\n"
+ "CFE is configured to support.",
+ "");
+
+ return 0;
+}
diff --git a/cfe/cfe/ui/ui_envcmds.c b/cfe/cfe/ui/ui_envcmds.c
new file mode 100644
index 0000000..9d69f36
--- /dev/null
+++ b/cfe/cfe/ui/ui_envcmds.c
@@ -0,0 +1,190 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Environment commands File: ui_envcmds.c
+ *
+ * User interface for environment variables
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "env_subr.h"
+#include "ui_command.h"
+#include "cfe.h"
+
+
+int ui_init_envcmds(void);
+static int ui_cmd_setenv(ui_cmdline_t *cmd,int argc,char *argv[]);
+static int ui_cmd_printenv(ui_cmdline_t *cmd,int argc,char *argv[]);
+static int ui_cmd_unsetenv(ui_cmdline_t *cmd,int argc,char *argv[]);
+
+
+
+static int ui_cmd_printenv(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char varname[80];
+ char value[256];
+ int varlen,vallen;
+ int idx;
+
+ xprintf("Variable Name Value\n");
+ xprintf("-------------------- --------------------------------------------------\n");
+
+ idx = 0;
+ for (;;) {
+ varlen = sizeof(varname);
+ vallen = sizeof(value);
+ if (env_enum(idx,varname,&varlen,value,&vallen) < 0) break;
+ xprintf("%20s %s\n",varname,value);
+ idx++;
+ }
+
+ return 0;
+
+}
+
+static int ui_cmd_setenv(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char *varname;
+ char *value;
+ int roflag = ENV_FLG_NORMAL;
+ int res;
+
+ varname = cmd_getarg(cmd,0);
+
+ if (!varname) {
+ return ui_showusage(cmd);
+ }
+
+ value = cmd_getarg(cmd,1);
+ if (!value) {
+ return ui_showusage(cmd);
+ }
+
+ if (!cmd_sw_isset(cmd,"-p")) {
+ roflag = ENV_FLG_BUILTIN; /* just in memory, not NVRAM */
+ }
+
+ if (cmd_sw_isset(cmd,"-ro")) {
+ roflag = ENV_FLG_READONLY;
+ }
+
+ if ((res = env_setenv(varname,value,roflag)) == 0) {
+ if (roflag != ENV_FLG_BUILTIN) env_save();
+ }
+ else {
+ return ui_showerror(res,"Could not set environment variable '%s'",
+ varname);
+ }
+
+ return 0;
+}
+
+
+static int ui_cmd_unsetenv(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char *varname;
+ int res;
+ int type;
+
+ varname = cmd_getarg(cmd,0);
+
+ if (!varname) {
+ return ui_showusage(cmd);
+ }
+
+ type = env_envtype(varname);
+
+ if ((res = env_delenv(varname)) == 0) {
+ if ((type >= 0) && (type != ENV_FLG_BUILTIN)) env_save();
+ }
+ else {
+ return ui_showerror(res,"Could not delete environment variable '%s'",
+ varname);
+ }
+
+ return 0;
+}
+
+
+
+int ui_init_envcmds(void)
+{
+
+ cmd_addcmd("setenv",
+ ui_cmd_setenv,
+ NULL,
+ "Set an environment variable.",
+ "setenv [-ro] [-p] varname value\n\n"
+ "This command sets an environment variable. By default, an environment variable\n"
+ "is stored only in memory and will not be retained across system restart.",
+ "-p;Store environment variable permanently in the NVRAM device, if present|"
+ "-ro;Causes variable to be read-only\n"
+ "(cannot be changed in the future, implies -p)");
+
+ cmd_addcmd("printenv",
+ ui_cmd_printenv,
+ NULL,
+ "Display the environment variables",
+ "printenv\n\n"
+ "This command prints a table of the environment variables and their\n"
+ "current values.",
+ "");
+
+ cmd_addcmd("unsetenv",
+ ui_cmd_unsetenv,
+ NULL,
+ "Delete an environment variable.",
+ "unsetenv varname\n\n"
+ "This command deletes an environment variable from memory and also \n"
+ "removes it from the NVRAM device (if present).",
+ "");
+
+ return 0;
+}
diff --git a/cfe/cfe/ui/ui_examcmds.c b/cfe/cfe/ui/ui_examcmds.c
new file mode 100644
index 0000000..91edeee
--- /dev/null
+++ b/cfe/cfe/ui/ui_examcmds.c
@@ -0,0 +1,713 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Memory dump commands File: ui_examcmds.c
+ *
+ * UI functions for examining data in various ways
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_error.h"
+#include "cfe_console.h"
+
+#include "ui_command.h"
+#include "cfe.h"
+#include "disasm.h"
+
+#include "addrspace.h"
+#include "exchandler.h"
+
+
+static int ui_cmd_memdump(ui_cmdline_t *cmd,int argc,char *argv[]);
+static int ui_cmd_memedit(ui_cmdline_t *cmd,int argc,char *argv[]);
+static int ui_cmd_memfill(ui_cmdline_t *cmd,int argc,char *argv[]);
+static int ui_cmd_disasm(ui_cmdline_t *cmd,int argc,char *argv[]);
+
+#ifdef __long64
+#define XTOI(x) xtoq(x)
+#else
+#define XTOI(x) xtoi(x)
+#endif
+
+int ui_init_examcmds(void);
+
+
+#define ATYPE_SIZE_NONE 0
+#define ATYPE_SIZE_BYTE 1
+#define ATYPE_SIZE_HALF 2
+#define ATYPE_SIZE_WORD 4
+#define ATYPE_SIZE_QUAD 8
+#define ATYPE_SIZE_MASK 0x0F
+
+#define ATYPE_TYPE_NONE 0
+#define ATYPE_TYPE_PHYS 0x10
+#define ATYPE_TYPE_KERN 0x20
+#define ATYPE_TYPE_MASK 0xF0
+
+static long prev_addr = 0; /* initialized below in ui_init_examcmds */
+static int prev_length = 256;
+static int prev_dlength = 16;
+static int prev_wtype = ATYPE_SIZE_WORD | ATYPE_TYPE_KERN;
+
+static int getaddrargs(ui_cmdline_t *cmd,int *curtype,long *addr,int *length)
+{
+ int atype = *curtype;
+ long newaddr;
+ int newlen;
+ char *x;
+ long wlen;
+
+ if (cmd_sw_isset(cmd,"-b")) {
+ atype &= ~ATYPE_SIZE_MASK;
+ atype |= ATYPE_SIZE_BYTE;
+ }
+ else if (cmd_sw_isset(cmd,"-h")) {
+ atype &= ~ATYPE_SIZE_MASK;
+ atype |= ATYPE_SIZE_HALF;
+ }
+ else if (cmd_sw_isset(cmd,"-w")) {
+ atype &= ~ATYPE_SIZE_MASK;
+ atype |= ATYPE_SIZE_WORD;
+ }
+ else if (cmd_sw_isset(cmd,"-q")) {
+ atype &= ~ATYPE_SIZE_MASK;
+ atype |= ATYPE_SIZE_QUAD;
+ }
+
+ wlen = atype & ATYPE_SIZE_MASK;
+ if (wlen == 0) wlen = 1; /* bytes are the default */
+
+ if (cmd_sw_isset(cmd,"-p")) {
+ atype &= ~ATYPE_TYPE_MASK;
+ atype |= ATYPE_TYPE_PHYS;
+ }
+ else if (cmd_sw_isset(cmd,"-v")) {
+ atype &= ~ATYPE_TYPE_MASK;
+ atype |= ATYPE_TYPE_KERN;
+ }
+
+ *curtype = atype;
+
+ if (addr) {
+ x = cmd_getarg(cmd,0);
+ if (x) {
+ if (strcmp(x,".") == 0) newaddr = *addr;
+ else {
+ /*
+ * hold on to your lunch, this is really, really bad!
+ * Make 64-bit addresses expressed as 8-digit numbers
+ * sign extend automagically. Saves typing, but is very
+ * gross.
+ */
+ int longaddr = 0;
+ longaddr = strlen(x);
+ if (memcmp(x,"0x",2) == 0) longaddr -= 2;
+ longaddr = (longaddr > 8) ? 1 : 0;
+
+ if (longaddr) newaddr = (long) xtoq(x);
+ else newaddr = (long) xtoi(x);
+ }
+ *addr = newaddr & ~(wlen - 1); /* align to natural boundary */
+ }
+ }
+
+ if (length) {
+ x = cmd_getarg(cmd,1);
+ if (x) {
+ newlen = (long) xtoi(x);
+ *length = newlen;
+ }
+ }
+
+ return 0;
+
+}
+
+static int stuffmem(long addr,int wlen,char *tail)
+{
+ char *tok;
+ int count = 0;
+ uint8_t b;
+ uint16_t h;
+ uint32_t w;
+ uint64_t q;
+ int res = 0;
+
+ addr &= ~(wlen-1);
+
+ while ((tok = gettoken(&tail))) {
+ switch (wlen) {
+ default:
+ case 1:
+ b = (uint8_t) xtoq(tok);
+ if ((res = mem_poke(addr, b, MEM_BYTE))) {
+ /*Did not edit*/
+ return res;
+ }
+ break;
+ case 2:
+ h = (uint16_t) xtoq(tok);
+ if ((res = mem_poke(addr, h, MEM_HALFWORD))) {
+ /*Did not edit*/
+ return res;
+ }
+ break;
+ case 4:
+ w = (uint32_t) xtoq(tok);
+ if ((res = mem_poke(addr, w, MEM_WORD))) {
+ /*Did not edit*/
+ return res;
+ }
+ break;
+ case 8:
+ q = (uint64_t) xtoq(tok);
+ if ((res = mem_poke(addr, q, MEM_QUADWORD))) {
+ /*Did not edit*/
+ return res;
+ }
+ break;
+ }
+
+ addr += wlen;
+ count++;
+ }
+
+ return count;
+}
+
+static int dumpmem(long addr,long dispaddr,int length,int wlen)
+{
+ int idx,x;
+ uint8_t b;
+ uint16_t h;
+ uint32_t w;
+ uint64_t q;
+ int res = 0;
+
+ /*
+ * The reason we save the line in this union is to provide the
+ * property that the dump command will only touch the
+ * memory once. This might be useful when looking at
+ * device registers.
+ */
+
+ union {
+ uint8_t bytes[16];
+ uint16_t halves[8];
+ uint32_t words[4];
+ uint64_t quads[2];
+ } line;
+
+ addr &= ~(wlen-1);
+
+ for (idx = 0; idx < length; idx += 16) {
+ xprintf("%P%c ",dispaddr+idx,(dispaddr != addr) ? '%' : ':');
+ switch (wlen) {
+ default:
+ case 1:
+ for (x = 0; x < 16; x++) {
+ if (idx+x < length) {
+ if ((res = mem_peek(&b, (addr+idx+x), MEM_BYTE))) {
+ return res;
+ }
+ line.bytes[x] = b;
+ xprintf("%02X ",b);
+ }
+ else {
+ xprintf(" ");
+ }
+ }
+ break;
+ case 2:
+ for (x = 0; x < 16; x+=2) {
+ if (idx+x < length) {
+ if ((res = mem_peek(&h, (addr+idx+x), MEM_HALFWORD))) {
+ return res;
+ }
+ line.halves[x/2] = h;
+ xprintf("%04X ",h);
+ }
+ else {
+ xprintf(" ");
+ }
+ }
+ break;
+ case 4:
+ for (x = 0; x < 16; x+=4) {
+ if (idx+x < length) {
+
+ if ((res = mem_peek(&w , (addr+idx+x), MEM_WORD))) {
+ return res;
+ }
+ line.words[x/4] = w;
+ xprintf("%08X ",w);
+ }
+ else {
+ xprintf(" ");
+ }
+ }
+ break;
+ case 8:
+ for (x = 0; x < 16; x+=8) {
+ if (idx+x < length) {
+ if ((res = mem_peek(&q, (addr+idx+x), MEM_QUADWORD))) {
+ return res;
+ }
+ line.quads[x/8] = q;
+ xprintf("%016llX ",q);
+ }
+ else {
+ xprintf(" ");
+ }
+ }
+ break;
+ }
+
+ xprintf(" ");
+ for (x = 0; x < 16; x++) {
+ if (idx+x < length) {
+ b = line.bytes[x];
+ if ((b < 32) || (b > 127)) xprintf(".");
+ else xprintf("%c",b);
+ }
+ else {
+ xprintf(" ");
+ }
+ }
+ xprintf("\n");
+ }
+
+ return 0;
+}
+
+static int ui_cmd_memedit(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ uint8_t b;
+ uint16_t h;
+ uint32_t w;
+ uint64_t q;
+
+ long addr;
+ char *vtext;
+ int wlen;
+ int count;
+ int idx = 1;
+ int stuffed = 0;
+ int res = 0;
+
+ getaddrargs(cmd,&prev_wtype,&prev_addr,NULL);
+
+ wlen = prev_wtype & ATYPE_SIZE_MASK;
+
+ vtext = cmd_getarg(cmd,idx++);
+
+ addr = prev_addr;
+
+ while (vtext) {
+ count = stuffmem(addr,wlen,vtext);
+ if (count < 0) {
+ ui_showerror(count,"Could not modify memory");
+ return count; /* error */
+ }
+ addr += count*wlen;
+ prev_addr += count*wlen;
+ stuffed += count;
+ vtext = cmd_getarg(cmd,idx++);
+ }
+
+ if (stuffed == 0) {
+ char line[256];
+ char prompt[32];
+
+ xprintf("Type '.' to exit, '-' to back up, '=' to dump memory.\n");
+ for (;;) {
+
+ addr = prev_addr;
+ if ((prev_wtype & ATYPE_TYPE_MASK) == ATYPE_TYPE_PHYS) {
+ addr = UNCADDR(addr);
+ }
+
+ xprintf("%P%c ",prev_addr,(addr != prev_addr) ? '%' : ':');
+
+ switch (wlen) {
+ default:
+ case 1:
+ if ((res = mem_peek(&b, addr, MEM_BYTE))) {
+ return res;
+ }
+ xsprintf(prompt,"[%02X]: ", b);
+ break;
+ case 2:
+ if ((res = mem_peek(&h, addr, MEM_HALFWORD))) {
+ return res;
+ }
+ xsprintf(prompt,"[%04X]: ",h);
+ break;
+ case 4:
+ if ((res = mem_peek(&w, addr, MEM_WORD))) {
+ return res;
+ }
+ xsprintf(prompt,"[%08X]: ",w);
+ break;
+ case 8:
+ if ((res = mem_peek(&q, addr, MEM_QUADWORD))) {
+ return res;
+ }
+ xsprintf(prompt,"[%016llX]: ",q);
+ break;
+ }
+
+ console_readline(prompt,line,sizeof(line));
+ if (line[0] == '-') {
+ prev_addr -= wlen;
+ continue;
+ }
+ if (line[0] == '=') {
+ dumpmem(prev_addr,prev_addr,16,wlen);
+ continue;
+ }
+ if (line[0] == '.') {
+ break;
+ }
+ if (line[0] == '\0') {
+ prev_addr += wlen;
+ continue;
+ }
+ count = stuffmem(addr,wlen,line);
+ if (count < 0) return count;
+ if (count == 0) break;
+ prev_addr += count*wlen;
+ }
+ }
+
+ return 0;
+}
+
+static int ui_cmd_memfill(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ long addr;
+ char *atext;
+ int wlen;
+ int idx = 2;
+ int len;
+ uint64_t pattern;
+ uint8_t *b_ptr;
+ uint16_t *h_ptr;
+ uint32_t *w_ptr;
+ uint64_t *q_ptr;
+ int res;
+
+ getaddrargs(cmd,&prev_wtype,&prev_addr,&len);
+
+ atext = cmd_getarg(cmd,idx++);
+ if (!atext) return ui_showusage(cmd);
+ pattern = xtoq(atext);
+
+ addr = prev_addr;
+
+ if ((prev_wtype & ATYPE_TYPE_MASK) == ATYPE_TYPE_PHYS) {
+ addr = UNCADDR(addr);
+ }
+
+ wlen = prev_wtype & ATYPE_SIZE_MASK;
+
+ switch (wlen) {
+ case 1:
+ b_ptr = (uint8_t *) addr;
+ while (len > 0) {
+ if ((res = mem_poke( ((long)(b_ptr)), pattern, MEM_BYTE))) {
+ /*Did not edit*/
+ return 0;
+ }
+ b_ptr++;
+ len--;
+ }
+ break;
+ case 2:
+ h_ptr = (uint16_t *) addr;
+ while (len > 0) {
+ if ((res = mem_poke( ((long)(h_ptr)), pattern, MEM_HALFWORD))) {
+ return 0;
+ }
+ h_ptr++;
+ len--;
+ }
+ break;
+ case 4:
+ w_ptr = (uint32_t *) addr;
+ while (len > 0) {
+ if ((res = mem_poke( ((long)(w_ptr)), pattern, MEM_WORD))) {
+ return -1;
+ }
+ w_ptr++;
+ len--;
+ }
+ break;
+ case 8:
+ q_ptr = (uint64_t *) addr;
+ while (len > 0) {
+ if ((res = mem_poke( ((long)(q_ptr)), pattern, MEM_QUADWORD))) {
+ return 0;
+ }
+ q_ptr++;
+ len--;
+ }
+ break;
+ }
+
+ return 0;
+}
+
+
+#define FILL(ptr,len,pattern) printf("Pattern: %016llX\n",pattern); \
+ for (idx = 0; idx < len; idx++) ptr[idx] = pattern
+#define CHECK(ptr,len,pattern) for (idx = 0; idx < len; idx++) { \
+ if (ptr[idx]!=pattern) {printf("Mismatch at %016llX: Expected %016llX got %016llX", \
+ (uint64_t) (uintptr_t) &(ptr[idx]),pattern,ptr[idx]); \
+ error = 1; loopmode = 0;break;} \
+ }
+
+#define MEMTEST(ptr,len,pattern) if (!error) { FILL(ptr,len,pattern) ; CHECK(ptr,len,pattern); }
+
+static int ui_cmd_memtest(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ long addr = 0;
+ int len = 0;
+ int wtype = 0;
+ int wlen;
+ int idx = 0;
+ uint64_t *ptr;
+ int error = 0;
+ int loopmode = 0;
+ int pass =0;
+
+ getaddrargs(cmd,&wtype,&addr,&len);
+
+ wlen = 8;
+ addr &= ~(wlen-1);
+
+ if ((prev_wtype & ATYPE_TYPE_MASK) == ATYPE_TYPE_PHYS) {
+ addr = UNCADDR(addr);
+ }
+
+ if (cmd_sw_isset(cmd,"-loop")) {
+ loopmode = 1;
+ }
+
+ len /= wlen;
+
+ ptr = (uint64_t *) addr;
+ pass = 0;
+ for (;;) {
+ if (loopmode) {
+ printf("Pass %d\n",pass);
+ if (console_status()) break;
+ }
+ MEMTEST(ptr,len,(idx*8));
+ MEMTEST(ptr,len, 0);
+ MEMTEST(ptr,len,0xFFFFFFFFFFFFFFFF);
+ MEMTEST(ptr,len,0x5555555555555555);
+ MEMTEST(ptr,len,0xAAAAAAAAAAAAAAAA);
+ MEMTEST(ptr,len,0xFF00FF00FF00FF00);
+ MEMTEST(ptr,len,0x00FF00FF00FF00FF);
+ if (!loopmode) break;
+ pass++;
+ }
+
+ return 0;
+}
+
+static int ui_cmd_memdump(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ long addr;
+ int res;
+
+ getaddrargs(cmd,&prev_wtype,&prev_addr,&prev_length);
+
+ addr = prev_addr;
+ if ((prev_wtype & ATYPE_TYPE_MASK) == ATYPE_TYPE_PHYS) {
+ addr = UNCADDR(addr);
+ }
+
+ res = dumpmem(addr,
+ prev_addr,
+ prev_length,
+ prev_wtype & ATYPE_SIZE_MASK);
+
+ if (res < 0) {
+ ui_showerror(res,"Could not display memory");
+ }
+ else {
+ prev_addr += prev_length;
+ }
+
+ return res;
+}
+
+static int ui_cmd_disasm(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ long addr;
+ char buf[512];
+ int idx;
+ uint32_t inst;
+ int res;
+
+ getaddrargs(cmd,&prev_wtype,&prev_addr,&prev_dlength);
+
+ prev_addr &= ~3;
+
+ addr = prev_addr;
+ if ((prev_wtype & ATYPE_TYPE_MASK) == ATYPE_TYPE_PHYS) {
+ addr = UNCADDR(addr);
+ }
+
+ for (idx = 0; idx < prev_dlength; idx++) {
+ if ((res = mem_peek(&inst, addr, MEM_WORD))) {
+ ui_showerror(res,"Could not disassemble memory");
+ return res;
+ }
+ disasm_inst(buf,sizeof(buf),inst,(uint64_t) prev_addr);
+ xprintf("%P%c %08x %s\n",prev_addr,(addr != prev_addr) ? '%' : ':',inst,buf);
+ addr += 4;
+ prev_addr += 4;
+ }
+
+ return 0;
+}
+
+int ui_init_examcmds(void)
+{
+ cmd_addcmd("u",
+ ui_cmd_disasm,
+ NULL,
+ "Disassemble instructions.",
+ "u [addr [length]]\n\n"
+ "This command disassembles instructions at the specified address.\n"
+ "CFE will display standard register names and symbolic names for\n"
+ "certain CP0 registers. The 'u' command remembers the last address\n"
+ "that was disassembled so you can enter 'u' again with no parameters\n"
+ "to continue a previous request.\n",
+ "-p;Address is an uncached physical address|"
+ "-v;Address is a kernel virtual address");
+
+
+ cmd_addcmd("d",
+ ui_cmd_memdump,
+ NULL,
+ "Dump memory.",
+ "d [-b|-h|-w|-q] [addr [length]]\n\n"
+ "This command displays data from memory as bytes, halfwords, words,\n"
+ "or quadwords. ASCII text, if present, will appear to the right of\n"
+ "the hex data. The dump command remembers the previous word size,\n"
+ "dump length and last displayed address, so you can enter 'd' again\n"
+ "to continue a previous dump request.",
+ "-b;Dump memory as bytes|"
+ "-h;Dump memory as halfwords (16-bits)|"
+ "-w;Dump memory as words (32-bits)|"
+ "-q;Dump memory as quadwords (64-bits)|"
+ "-p;Address is an uncached physical address|"
+ "-v;Address is a kernel virtual address");
+
+
+ cmd_addcmd("e",
+ ui_cmd_memedit,
+ NULL,
+ "Modify contents of memory.",
+ "e [-b|-h|-w|-q] [addr [data...]]\n\n"
+ "This command modifies the contents of memory. If you do not specify\n"
+ "data on the command line, CFE will prompt for it. When prompting for\n"
+ "data you may enter '-' to back up, '=' to dump memory at the current\n"
+ "location, or '.' to exit edit mode.",
+ "-b;Edit memory as bytes|"
+ "-h;Edit memory as halfwords (16-bits)|"
+ "-w;Edit memory as words (32-bits)|"
+ "-q;Edit memory as quadwords (64-bits)|"
+ "-p;Address is an uncached physical address|"
+ "-v;Address is a kernel virtual address");
+
+ cmd_addcmd("f",
+ ui_cmd_memfill,
+ NULL,
+ "Fill contents of memory.",
+ "f [-b|-h|-w|-q] addr length pattern\n\n"
+ "This command modifies the contents of memory. You can specify the\n"
+ "starting address, length, and pattern of data to fill (in hex)\n",
+ "-b;Edit memory as bytes|"
+ "-h;Edit memory as halfwords (16-bits)|"
+ "-w;Edit memory as words (32-bits)|"
+ "-q;Edit memory as quadwords (64-bits)|"
+ "-p;Address is an uncached physical address|"
+ "-v;Address is a kernel virtual address");
+
+ cmd_addcmd("memtest",
+ ui_cmd_memtest,
+ NULL,
+ "Test memory.",
+ "memtest [options] addr length\n\n"
+ "This command tests memory. It is a very crude test, so don't\n"
+ "rely on it for anything really important. Addr and length are in hex\n",
+ "-p;Address is an uncached physical address|"
+ "-v;Address is a kernel virtual address|"
+ "-loop;Loop till keypress");
+
+
+ prev_addr = KERNADDR(0);
+
+ return 0;
+}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cfe/cfe/ui/ui_flash.c b/cfe/cfe/ui/ui_flash.c
new file mode 100644
index 0000000..d3ce7c1
--- /dev/null
+++ b/cfe/cfe/ui/ui_flash.c
@@ -0,0 +1,554 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Flash Update commands File: ui_flash.c
+ *
+ * The routines in this file are used for updating the
+ * flash with new firmware.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_devfuncs.h"
+#include "cfe_ioctl.h"
+#include "cfe_timer.h"
+#include "cfe_error.h"
+
+#include "ui_command.h"
+#include "cfe.h"
+
+#include "cfe_fileops.h"
+#include "cfe_boot.h"
+#include "bsp_config.h"
+
+#include "cfe_loader.h"
+
+#include "net_ebuf.h"
+#include "net_ether.h"
+#include "net_api.h"
+
+#include "cfe_flashimage.h"
+
+#include "addrspace.h"
+#include "url.h"
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+/*
+ * Of course, these things really belong somewhere else.
+ */
+
+#define FLASH_STAGING_BUFFER CFG_FLASH_STAGING_BUFFER_ADDR
+#ifdef _FLASHPROG_
+#define FLASH_STAGING_BUFFER_SIZE (1024*1024*16)
+#else
+#define FLASH_STAGING_BUFFER_SIZE CFG_FLASH_STAGING_BUFFER_SIZE
+#endif
+
+
+/* *********************************************************************
+ * Exerns
+ ********************************************************************* */
+
+extern int cfe_iocb_dispatch(cfe_iocb_t *iocb);
+
+int ui_init_flashcmds(void);
+static int ui_cmd_flash(ui_cmdline_t *cmd,int argc,char *argv[]);
+
+
+
+/* *********************************************************************
+ * ui_init_flashcmds()
+ *
+ * Initialize the flash commands, add them to the table.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * 0 if ok, else error
+ ********************************************************************* */
+
+int ui_init_flashcmds(void)
+{
+ cmd_addcmd("flash",
+ ui_cmd_flash,
+ NULL,
+ "Update a flash memory device",
+ "flash [options] filename [flashdevice]\n\n"
+ "Copies data from a source file name or device to a flash memory device.\n"
+ "The source device can be a disk file (FAT filesystem), a remote file\n"
+ "(TFTP) or a flash device. The destination device may be a flash or eeprom.\n"
+#if !CFG_EMBEDDED_PIC
+ "If the destination device is your boot flash (usually flash0), the flash\n"
+ "command will restart the firmware after the flash update is complete\n"
+#endif
+ "",
+ "-noerase;Don't erase flash before writing|"
+ "-offset=*;Begin programming at this offset in the flash device|"
+ "-size=*;Size of source device when programming from flash to flash|"
+ "-noheader;Override header verification, flash binary without checking");
+
+
+ return 0;
+}
+
+/* *********************************************************************
+ * flash_crc32(buf,len)
+ *
+ * Yes, this is an Ethernet CRC. I'm lazy.
+ *
+ * Input parameters:
+ * buf - buffer to CRC
+ * len - length of data
+ *
+ * Return value:
+ * CRC-32
+ ********************************************************************* */
+
+#define CRC32_POLY 0xEDB88320UL /* CRC-32 Poly */
+static unsigned int
+flash_crc32(const unsigned char *databuf, unsigned int datalen)
+{
+ unsigned int idx, bit, data, crc = 0xFFFFFFFFUL;
+
+ for (idx = 0; idx < datalen; idx++) {
+ for (data = *databuf++, bit = 0; bit < 8; bit++, data >>= 1) {
+ crc = (crc >> 1) ^ (((crc ^ data) & 1) ? CRC32_POLY : 0);
+ }
+ }
+
+ return crc;
+}
+
+/* *********************************************************************
+ * flash_validate(ptr)
+ *
+ * Validate the flash header to make sure we can program it.
+ *
+ * Input parameters:
+ * ptr - pointer to flash header
+ * outptr - pointer to data that we should program
+ * outsize - size of data we should program
+ *
+ * Return value:
+ * 0 if ok
+ * else error occured
+ ********************************************************************* */
+
+#define GET32(x) (((uint32_t) (x[0] << 24)) | \
+ ((uint32_t) (x[1] << 16)) | \
+ ((uint32_t) (x[2] << 8)) | \
+ ((uint32_t) (x[3] << 0)))
+
+static int flash_validate(uint8_t *ptr,int insize,uint8_t **outptr,int *outsize)
+{
+ cfe_flashimage_t *hdr = (cfe_flashimage_t *) ptr;
+ uint32_t size;
+ uint32_t flags;
+ uint32_t hdrcrc;
+ uint32_t calccrc;
+
+ if (memcmp(hdr->seal,CFE_IMAGE_SEAL,sizeof(hdr->seal)) != 0) {
+ printf("Invalid header seal. This is not a CFE flash image.\n");
+ return -1;
+ }
+
+ printf("Flash image contains CFE version %d.%d.%d for board '%s'\n",
+ hdr->majver,hdr->minver,hdr->ecover,hdr->boardname);
+
+ size = GET32(hdr->size);
+ flags = GET32(hdr->flags);
+ hdrcrc = GET32(hdr->crc);
+ printf("Flash image is %d bytes, flags %08X, CRC %08X\n",size,flags,hdrcrc);
+
+ if (strcmp(CFG_BOARDNAME,hdr->boardname) != 0) {
+ printf("This flash image is not appropriate for board type '%s'\n",CFG_BOARDNAME);
+ return -1;
+ }
+
+ if ((size == 0) || (size > FLASH_STAGING_BUFFER_SIZE) ||
+ ((size + sizeof(cfe_flashimage_t)) < insize)) {
+ printf("Flash image size is bogus!\n");
+ return -1;
+ }
+
+ calccrc = flash_crc32(ptr + sizeof(cfe_flashimage_t),size);
+
+ if (calccrc != hdrcrc) {
+ printf("CRC is incorrect. Calculated CRC is %08X\n",calccrc);
+ return -1;
+ }
+
+ *outptr = ptr + sizeof(cfe_flashimage_t);
+ *outsize = size;
+ return 0;
+}
+
+/* *********************************************************************
+ * ui_cmd_flash(cmd,argc,argv)
+ *
+ * The 'flash' command lives here. Program the boot flash,
+ * or if a device name is specified, program the alternate
+ * flash device.
+ *
+ * Input parameters:
+ * cmd - command table entry
+ * argc,argv - parameters
+ *
+ * Return value:
+ * 0 if ok
+ * else error
+ ********************************************************************* */
+
+
+static int ui_cmd_flash(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ uint8_t *ptr;
+ int fh;
+ int res;
+#if !CFG_EMBEDDED_PIC
+ int retlen;
+#endif
+ char *fname;
+ char *flashdev;
+ cfe_loadargs_t la;
+ int amtcopy;
+ int devtype;
+ int srcdevtype;
+ int chkheader;
+ int sfd;
+ int copysize;
+ flash_info_t flashinfo;
+ int offset = 0;
+ int noerase = 0;
+ char *x;
+ int size = 0;
+
+ /*
+ * Get the address of the staging buffer. We can't
+ * allocate the space from the heap to store the
+ * new flash image, because the heap may not be big
+ * enough. So, grab some unallocated memory
+ * at the 1MB line (we could also calculate
+ * something, but this will do for now).
+ * We assume the flash will be somewhere between
+ * 1KB (yeah, right) and 4MB.
+ */
+
+#if CFG_RUNFROMKSEG0
+ ptr = (uint8_t *) KERNADDR(FLASH_STAGING_BUFFER);
+#else
+ ptr = (uint8_t *) UNCADDR(FLASH_STAGING_BUFFER);
+#endif
+
+ /*
+ * Parse command line parameters
+ */
+
+ fname = cmd_getarg(cmd,0);
+
+ if (!fname) {
+ return ui_showusage(cmd);
+ }
+
+ flashdev = cmd_getarg(cmd,1);
+ if (!flashdev) flashdev = "flash0.0";
+
+ /*
+ * Make sure it's a flash device.
+ */
+
+ res = cfe_getdevinfo(flashdev);
+ if (res < 0) {
+ return ui_showerror(CFE_ERR_DEVNOTFOUND,flashdev);
+ }
+
+ devtype = res & CFE_DEV_MASK;
+
+ if ((res != CFE_DEV_FLASH) && (res != CFE_DEV_NVRAM)) {
+ xprintf("Device '%s' is not a flash or eeprom device.\n",flashdev);
+ return CFE_ERR_INV_PARAM;
+ }
+
+ /*
+ * We shouldn't really allow this, but there are some circumstances
+ * where you might want to bypass the header check and shoot
+ * yourself in the foot.
+ * Switch normally not supplied, so chkheader will be TRUE.
+ */
+
+ chkheader = !cmd_sw_isset(cmd,"-noheader");
+
+ /*
+ * Check for some obscure options here.
+ */
+
+ noerase = cmd_sw_isset(cmd,"-noerase");
+
+ if (cmd_sw_value(cmd,"-offset",&x)) {
+ offset = atoi(x);
+ }
+
+ if (cmd_sw_value(cmd,"-size",&x)) {
+ size = atoi(x);
+ }
+
+ /*
+ * Read the new flash image from the source device
+ */
+
+ srcdevtype = cfe_getdevinfo(fname) & CFE_DEV_MASK;
+
+ xprintf("Reading %s: ",fname);
+
+ switch (srcdevtype) {
+ case CFE_DEV_FLASH:
+ sfd = cfe_open(fname);
+ if (sfd < 0) {
+ return ui_showerror(sfd,"Could not open source device");
+ }
+ memset(ptr,0xFF,FLASH_STAGING_BUFFER_SIZE);
+
+ /*
+ * If the flash device can be used for NVRAM,
+ * then the max size of or flash is the
+ * offset of the flash info. Otherwise
+ * it is the full staging buffer size.
+ * XXX: if it's larger, we lose.
+ */
+
+ if (cfe_ioctl(sfd,IOCTL_FLASH_GETINFO,
+ (unsigned char *) &flashinfo,
+ sizeof(flash_info_t),
+ &res,0) != 0) {
+ flashinfo.flash_size = FLASH_STAGING_BUFFER_SIZE;
+ }
+
+ if (size > 0) {
+ xprintf("(size=0x%X) ",size);
+ }
+ else {
+ size = flashinfo.flash_size;
+ }
+
+ /* Make sure we don't overrun the staging buffer */
+
+ if (size > FLASH_STAGING_BUFFER_SIZE) {
+ size = FLASH_STAGING_BUFFER_SIZE;
+ }
+
+ /* Read the flash device here. */
+
+ res = cfe_read(sfd,ptr,size);
+
+ cfe_close(sfd);
+ if (res < 0) {
+ return ui_showerror(res,"Could not read from flash");
+ }
+ chkheader = FALSE; /* no header to check */
+ /*
+ * Search for non-0xFF byte at the end. This will work because
+ * flashes get erased to all FF's, we pre-fill our buffer to FF's,
+ */
+ while (res > 0) {
+ if (ptr[res-1] != 0xFF) break;
+ res--;
+ }
+ break;
+
+ case CFE_DEV_SERIAL:
+ la.la_filesys = "raw";
+ la.la_filename = NULL;
+ la.la_device = fname;
+ la.la_address = (intptr_t) ptr;
+ la.la_options = 0;
+ la.la_maxsize = FLASH_STAGING_BUFFER_SIZE;
+ la.la_flags = LOADFLG_SPECADDR;
+
+ res = cfe_load_program("srec",&la);
+
+ if (res < 0) {
+ ui_showerror(res,"Failed.");
+ return res;
+ }
+ break;
+
+ default:
+
+ res = ui_process_url(fname, cmd, &la);
+ if (res < 0) {
+ ui_showerror(res,"Invalid file name %s",fname);
+ return res;
+ }
+
+ la.la_address = (intptr_t) ptr;
+ la.la_options = 0;
+ la.la_maxsize = FLASH_STAGING_BUFFER_SIZE;
+ la.la_flags = LOADFLG_SPECADDR;
+
+ res = cfe_load_program("raw",&la);
+
+ if (res < 0) {
+ ui_showerror(res,"Failed.");
+ return res;
+ }
+ break;
+
+ }
+
+ xprintf("Done. %d bytes read\n",res);
+
+ copysize = res;
+
+ /*
+ * Verify the header and file's CRC.
+ */
+ if (chkheader) {
+ if (flash_validate(ptr,res,&ptr,&copysize) < 0) return -1;
+ }
+
+ if (copysize == 0) return 0; /* 0 bytes, don't flash */
+
+ /*
+ * Open the destination flash device.
+ */
+
+ fh = cfe_open(flashdev);
+ if (fh < 0) {
+ xprintf("Could not open device '%s'\n",flashdev);
+ return CFE_ERR_DEVNOTFOUND;
+ }
+
+ if (cfe_ioctl(fh,IOCTL_FLASH_GETINFO,
+ (unsigned char *) &flashinfo,
+ sizeof(flash_info_t),
+ &res,0) == 0) {
+ /* Truncate write if source size is greater than flash size */
+ if ((copysize + offset) > flashinfo.flash_size) {
+ copysize = flashinfo.flash_size;
+ }
+ }
+
+ /*
+ * If overwriting the boot flash, we need to use the special IOCTL
+ * that will force a reboot after writing the flash.
+ */
+
+ if (flashinfo.flash_base == 0x1FC00000) { /* XXX MIPS-SPECIFIC */
+#if CFG_EMBEDDED_PIC
+ xprintf("\n\n** DO NOT TURN OFF YOUR MACHINE UNTIL THE FLASH UPDATE COMPLETES!! **\n\n");
+#else
+#if CFG_NETWORK
+ if (net_getparam(NET_DEVNAME)) {
+ xprintf("Closing network.\n");
+ net_uninit();
+ }
+#endif
+ xprintf("Rewriting boot flash device '%s'\n",flashdev);
+ xprintf("\n\n**DO NOT TURN OFF YOUR MACHINE UNTIL IT REBOOTS!**\n\n");
+ cfe_ioctl(fh,IOCTL_FLASH_WRITE_ALL, ptr,copysize,&retlen,0);
+ /* should not return */
+ return CFE_ERR;
+#endif
+ }
+
+ /*
+ * Otherwise: it's not the flash we're using right
+ * now, so we can be more verbose about things, and
+ * more importantly, we can return to the command
+ * prompt without rebooting!
+ */
+
+ /*
+ * Erase the flash, if the device requires it. Our new flash
+ * driver does the copy/merge/erase for us.
+ */
+
+ if (!noerase) {
+ if ((devtype == CFE_DEV_FLASH) && !(flashinfo.flash_flags & FLASH_FLAG_NOERASE)) {
+ flash_range_t range;
+ range.range_base = offset;
+ range.range_length = copysize;
+ xprintf("Erasing flash...");
+ if (cfe_ioctl(fh,IOCTL_FLASH_ERASE_RANGE,
+ (uint8_t *) &range,sizeof(range),NULL,0) != 0) {
+ printf("Failed to erase the flash\n");
+ cfe_close(fh);
+ return CFE_ERR_IOERR;
+ }
+ }
+ }
+
+ /*
+ * Program the flash
+ */
+
+ xprintf("Programming...");
+
+ amtcopy = cfe_writeblk(fh,offset,ptr,copysize);
+
+ if (copysize == amtcopy) {
+ xprintf("done. %d bytes written\n",amtcopy);
+ res = 0;
+ }
+ else {
+ ui_showerror(amtcopy,"Failed.");
+ res = CFE_ERR_IOERR;
+ }
+
+ /*
+ * done!
+ */
+
+ cfe_close(fh);
+
+ return res;
+}
+
diff --git a/cfe/cfe/ui/ui_loadcmds.c b/cfe/cfe/ui/ui_loadcmds.c
new file mode 100644
index 0000000..a1df159
--- /dev/null
+++ b/cfe/cfe/ui/ui_loadcmds.c
@@ -0,0 +1,366 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Program Loader commands File: ui_loadcmds.c
+ *
+ * User interface for program loader
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "cfe_devfuncs.h"
+
+#include "ui_command.h"
+#include "cfe.h"
+
+#include "net_ebuf.h"
+#include "net_ether.h"
+#include "net_api.h"
+
+#include "cfe_fileops.h"
+#include "cfe_boot.h"
+
+#include "bsp_config.h"
+#include "cfe_loader.h"
+#include "cfe_autoboot.h"
+
+#include "url.h"
+
+
+int ui_init_loadcmds(void);
+static int ui_cmd_load(ui_cmdline_t *cmd,int argc,char *argv[]);
+
+#if CFG_NETWORK
+static int ui_cmd_save(ui_cmdline_t *cmd,int argc,char *argv[]);
+#endif
+
+static int ui_cmd_autoboot(ui_cmdline_t *cmd,int argc,char *argv[]);
+static int ui_cmd_boot(ui_cmdline_t *cmd,int argc,char *argv[]);
+static int ui_cmd_batch(ui_cmdline_t *cmd,int argc,char *argv[]);
+static int ui_cmd_go(ui_cmdline_t *cmd,int argc,char *argv[]);
+
+
+extern cfe_loadargs_t cfe_loadargs;
+
+static long getaddr(char *str)
+{
+ /*
+ * hold on to your lunch, this is really, really bad!
+ * Make 64-bit addresses expressed as 8-digit numbers
+ * sign extend automagically. Saves typing, but is very
+ * gross. Not very portable, either.
+ */
+ int longaddr = 0;
+ long newaddr;
+
+ longaddr = strlen(str);
+ if (memcmp(str,"0x",2) == 0) longaddr -= 2;
+ longaddr = (longaddr > 8) ? 1 : 0;
+
+ if (longaddr) newaddr = (long) xtoq(str);
+ else newaddr = (long) xtoi(str);
+
+ return newaddr;
+}
+
+
+
+int ui_init_loadcmds(void)
+{
+
+#if CFG_NETWORK
+ cmd_addcmd("save",
+ ui_cmd_save,
+ NULL,
+ "Save a region of memory to a remote file via TFTP",
+ "save [-options] host:filename startaddr length\n\n",
+ "");
+#endif
+
+ cmd_addcmd("load",
+ ui_cmd_load,
+ NULL,
+ "Load an executable file into memory without executing it",
+ "load [-options] host:filename|dev:filename\n\n"
+ "This command loads an executable file into memory, but does not\n"
+ "execute it. It can be used for loading data files, overlays or\n"
+ "other programs needed before the 'boot' command is used. By\n"
+ "default, 'load' will load a raw binary at virtual address 0x20000000.",
+ "-elf;Load the file as an ELF executable|"
+ "-srec;Load the file as ASCII S-records|"
+ "-raw;Load the file as a raw binary|"
+#if CFG_ZLIB
+ "-z;Load compessed file|"
+#endif
+ "-loader=*;Specify CFE loader name|"
+ "-tftp;Load the file using the TFTP protocol|"
+ "-fatfs;Load the file from a FAT file system|"
+ "-rawfs;Load the file from an unformatted file system|"
+#if (CFG_TCP) && (CFG_HTTPFS)
+ "-http;Load the file using the HTTP protocol|"
+#endif
+ "-fs=*;Specify CFE file system name|"
+ "-max=*;Specify the maximum number of bytes to load (raw only)|"
+ "-addr=*;Specify the load address (hex) (raw only)");
+
+ cmd_addcmd("boot",
+ ui_cmd_boot,
+ NULL,
+ "Load an executable file into memory and execute it",
+ "boot [-options] host:filename|dev:filename\n\n"
+ "This command loads and executes a program from a boot device\n"
+ "By default, 'boot' will load a raw binary at virtual \n"
+ "address 0x20000000 and then jump to that address",
+ "-elf;Load the file as an ELF executable|"
+ "-srec;Load the file as ASCII S-records|"
+ "-raw;Load the file as a raw binary|"
+#if CFG_ZLIB
+ "-z;Load compessed file|"
+#endif
+ "-loader=*;Specify CFE loader name|"
+ "-tftp;Load the file using the TFTP protocol|"
+ "-fatfs;Load the file from a FAT file system|"
+ "-rawfs;Load the file from an unformatted file system|"
+#if (CFG_TCP) && (CFG_HTTPFS)
+ "-http;Load the file using the HTTP protocol|"
+#endif
+ "-fs=*;Specify CFE file system name|"
+ "-max=*;Specify the maximum number of bytes to load (raw only)|"
+ "-addr=*;Specify the load address (hex) (raw only)|"
+ "-noclose;Don't close network link before executing program");
+
+ cmd_addcmd("go",
+ ui_cmd_go,
+ NULL,
+ "Start a previously loaded program.",
+ "go [address]\n\n"
+ "The 'go' command will start a program previously loaded with \n"
+ "the 'load' command. You can override the start address by"
+ "specifying it as a parameter to the 'go' command.",
+ "-noclose;Don't close network link before executing program");
+
+ cmd_addcmd("batch",
+ ui_cmd_batch,
+ NULL,
+ "Load a batch file into memory and execute it",
+ "batch [-options] host:filename|dev:filename\n\n"
+ "This command loads and executes a batch file from a boot device",
+#if CFG_ZLIB
+ "-z;Load compessed file|"
+#endif
+ "-tftp;Load the file using the TFTP protocol|"
+ "-fatfs;Load the file from a FAT file system|"
+ "-rawfs;Load the file from an unformatted file system|"
+ "-fs=*;Specify CFE file system name");
+
+
+ cmd_addcmd("autoboot",
+ ui_cmd_autoboot,
+ NULL,
+ "Automatic system bootstrap.",
+ "autoboot [dev]\n\n"
+ "The 'autoboot' command causes an automatic system bootstrap from\n"
+ "a predefined list of devices and boot files. This list is \n"
+ "specific to the board and port of CFE. To try autobooting from\n"
+ "a specific device, you can specify the CFE device name on the command line.",
+ "-forever;Loop over devices until boot is successful|"
+ "-interruptible;Scan console between devices, drop to prompt if key pressed");
+
+ return 0;
+}
+
+
+static int ui_cmd_autoboot(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int res;
+ char *x;
+ int flags = 0;
+
+ if (cmd_sw_isset(cmd,"-forever")) flags |= CFE_AUTOFLG_TRYFOREVER;
+ if (cmd_sw_isset(cmd,"-interruptible")) flags |= CFE_AUTOFLG_POLLCONSOLE;
+
+ x = cmd_getarg(cmd,0);
+ res = cfe_autoboot(x,flags);
+
+ return res;
+}
+
+static int ui_cmd_go(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char *arg;
+
+ arg = cmd_getarg(cmd,0);
+ if (arg) {
+ cfe_loadargs.la_entrypt = getaddr(arg);
+ }
+
+ if (cmd_sw_isset(cmd,"-noclose")) {
+ cfe_loadargs.la_flags |= LOADFLG_NOCLOSE;
+ }
+
+ cfe_go(&cfe_loadargs);
+
+ return 0;
+}
+
+
+
+static int ui_cmd_bootcommon(ui_cmdline_t *cmd,int argc,char *argv[],int flags)
+{
+ int res;
+ char *arg;
+ cfe_loadargs_t *la = &cfe_loadargs;
+ char copy[200];
+
+ la->la_flags = flags;
+
+ arg = cmd_getarg(cmd,0);
+ strncpy(copy,arg,sizeof(copy));
+
+ if (!arg) {
+ xprintf("No program name specified\n");
+ return -1;
+ }
+
+ res = ui_process_url(arg,cmd,la);
+ if (res < 0) return res;
+
+ /*
+ * Pick up the remaining command line parameters for use as
+ * arguments to the loaded program.
+ */
+
+ la->la_options = cmd_getarg(cmd,1);
+
+ /*
+ * Note: we might not come back here if we really launch the program.
+ */
+
+ xprintf("Loader:%s Filesys:%s Dev:%s File:%s Options:%s\n",
+ la->la_loader,la->la_filesys,la->la_device,la->la_filename,la->la_options);
+
+ res = cfe_boot(la->la_loader,la);
+
+ /*
+ * Give the bad news.
+ */
+
+ if (res < 0) xprintf("Could not load %s: %s\n",copy,cfe_errortext(res));
+
+ return res;
+}
+
+
+static int ui_cmd_load(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int flags = LOADFLG_NOISY;
+
+ return ui_cmd_bootcommon(cmd,argc,argv,flags);
+}
+
+
+
+
+static int ui_cmd_boot(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int flags = LOADFLG_NOISY | LOADFLG_EXECUTE;
+
+ return ui_cmd_bootcommon(cmd,argc,argv,flags);
+}
+
+static int ui_cmd_batch(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int flags = LOADFLG_NOISY | LOADFLG_EXECUTE | LOADFLG_BATCH;
+
+ return ui_cmd_bootcommon(cmd,argc,argv,flags);
+}
+
+#if CFG_NETWORK
+static int ui_cmd_save(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char *x;
+ uint8_t *start,*end;
+ int len;
+ char *fname;
+ int res;
+
+ fname = cmd_getarg(cmd,0);
+
+ if ((x = cmd_getarg(cmd,1))) {
+ start = (uint8_t *) getaddr(x);
+ }
+ else {
+ return ui_showusage(cmd);
+ }
+
+ if ((x = cmd_getarg(cmd,2))) {
+ len = xtoi(x);
+ }
+ else {
+ return ui_showusage(cmd);
+ }
+
+ end = start+len;
+
+ res = cfe_savedata("tftp","",fname,start,end);
+
+ if (res < 0) {
+ return ui_showerror(res,"Could not dump data to network");
+ }
+ else {
+ xprintf("%d bytes written to %s\n",res,fname);
+ }
+
+ return 0;
+}
+#endif
+
+
+
+
diff --git a/cfe/cfe/ui/ui_memcmds.c b/cfe/cfe/ui/ui_memcmds.c
new file mode 100644
index 0000000..b48af34
--- /dev/null
+++ b/cfe/cfe/ui/ui_memcmds.c
@@ -0,0 +1,171 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Memory Map commands File: ui_memcmds.c
+ *
+ * Memory Manager user interface
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "lib_arena.h"
+
+#include "ui_command.h"
+
+#include "cfe_mem.h"
+
+#include "cfe.h"
+
+
+const static char * const cfe_arenatypes[] = {
+ "Reserved",
+ "DRAM (available)",
+ "Memory Controller (unused)",
+ "DRAM (in use by firmware)",
+ "ROM",
+ "I/O Registers",
+ "Not available",
+ "L2 Cache",
+ "LDT/PCI",
+ NULL};
+
+extern arena_t cfe_arena;
+
+
+
+int ui_init_memcmds(void);
+
+static int ui_cmd_physmap(ui_cmdline_t *cmd,int argc,char *argv[]);
+static int ui_cmd_heapstats(ui_cmdline_t *cmd,int argc,char *argv[]);
+
+
+int ui_init_memcmds(void)
+{
+ cmd_addcmd("show memory",
+ ui_cmd_physmap,
+ NULL,
+ "Display the system physical memory map.",
+ "show memory [-a]\n\n"
+ "This command displays the arena, or system physical memory map\n"
+ "You can use this command to determine the areas of RAM that will\n"
+ "be made available to operating systems.\n",
+ "-a;Display all entries in the map, not just the blocks\n"
+ "of available memory.");
+
+ cmd_addcmd("show heap",
+ ui_cmd_heapstats,
+ NULL,
+ "Display information about CFE's heap",
+ "show heap\n\n"
+ "This is a debugging command that can be used to determine the health\n"
+ "of CFE's internal memory manager.",
+ "");
+
+ return 0;
+}
+
+static int ui_cmd_heapstats(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int res;
+ memstats_t stats;
+
+ res = KMEMSTATS(&stats);
+
+ xprintf("\n");
+ xprintf("Total bytes: %d\n",stats.mem_totalbytes);
+ xprintf("Free bytes: %d\n",stats.mem_freebytes);
+ xprintf("Free nodes: %d\n",stats.mem_freenodes);
+ xprintf("Allocated bytes: %d\n",stats.mem_allocbytes);
+ xprintf("Allocated nodes: %d\n",stats.mem_allocnodes);
+ xprintf("Largest free node: %d\n",stats.mem_largest);
+ xprintf("Heap status: %s\n",(res == 0) ? "CONSISTENT" : "CORRUPT!");
+ xprintf("\n");
+
+ return res;
+}
+
+
+#define PHYSMAP_FLG_ALL 1
+#define PHYSMAP_FLG_AVAIL 2
+
+static int ui_cmd_physmap(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ arena_node_t *node;
+ queue_t *qb;
+ arena_t *arena = &cfe_arena;
+ int flags = 0;
+
+ if (cmd_sw_isset(cmd,"-a")) {
+ flags |= PHYSMAP_FLG_ALL;
+ }
+ else {
+ flags = PHYSMAP_FLG_AVAIL;
+ }
+
+
+ xprintf("Range Start Range End Range Size Description\n");
+ xprintf("------------ ------------ -------------- --------------------\n");
+
+ for (qb = (arena->arena_list.q_next); qb != &(arena->arena_list);
+ qb = qb->q_next) {
+ node = (arena_node_t *) qb;
+
+ if ((flags & PHYSMAP_FLG_ALL) ||
+ ((flags & PHYSMAP_FLG_AVAIL) && (node->an_type == MEMTYPE_DRAM_AVAILABLE))) {
+
+ xprintf("%012llX-%012llX (%012llX) %s\n",
+ node->an_address,
+ node->an_address+node->an_length-1,
+ node->an_length,
+ cfe_arenatypes[node->an_type]);
+ }
+
+ }
+
+ return 0;
+}
+
diff --git a/cfe/cfe/ui/ui_misccmds.c b/cfe/cfe/ui/ui_misccmds.c
new file mode 100644
index 0000000..156da6a
--- /dev/null
+++ b/cfe/cfe/ui/ui_misccmds.c
@@ -0,0 +1,178 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Miscellaneous commands File: ui_misccmds.c
+ *
+ * Some small but useful commands
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "cfe_error.h"
+#include "cfe_ioctl.h"
+#include "cfe_devfuncs.h"
+#include "ui_command.h"
+#include "cfe.h"
+
+
+static int ui_cmd_loop(ui_cmdline_t *cmd,int argc,char *argv[]);
+#ifdef _FUNCSIM_
+static int ui_cmd_exit(ui_cmdline_t *cmd,int argc,char *argv[]);
+#endif
+static int ui_cmd_console(ui_cmdline_t *cmd,int argc,char *argv[]);
+
+extern int cfe_docommands(char *buf);
+
+int ui_init_misccmds(void);
+
+int ui_init_misccmds(void)
+{
+
+ cmd_addcmd("loop",
+ ui_cmd_loop,
+ NULL,
+ "Loop a command",
+ "loop \"command\" [-count=*]\n"
+ "The 'loop' command causes the specified command or list of commands\n"
+ "to be repeated 'count' times or forever, or until a character is typed",
+ "-count=*;Specifies number of iterations|"
+ "-forever;Loops forever");
+
+#ifdef _FUNCSIM_
+ cmd_addcmd("exit",
+ ui_cmd_exit,
+ NULL,
+ "exit from the functional simulator",
+ "exit [n]\n\n"
+ "This command is useful only when running under the functional\n"
+ "simulator. It causes the simulator to exit and return to the\n"
+ "operating system. If specified, 'n' will be placed in $4 as a\n"
+ "return code.",
+ "");
+#endif
+
+ cmd_addcmd("set console",
+ ui_cmd_console,
+ NULL,
+ "Change the active console device",
+ "set console device-name\n\n"
+ "Changes the console device to the specified device name. The console\n"
+ "must be a serial-style device. Be careful not to change the console\n"
+ "to a device that is not connected!",
+ "");
+
+ return 0;
+}
+
+static int ui_cmd_loop(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int count = 10;
+ char *x;
+ int res;
+ int forever;
+
+ if (cmd_sw_value(cmd,"-count",&x)) count = atoi(x);
+
+ forever = cmd_sw_isset(cmd,"-forever");
+
+ x = cmd_getarg(cmd,0);
+ if (!x) return ui_showusage(cmd);
+
+ res = 0;
+ while (count || forever) {
+ if (console_status()) break;
+ res = ui_docommands(x);
+ if (res != 0) break;
+ count--;
+ }
+
+ return res;
+}
+
+
+#ifdef _FUNCSIM_
+static int ui_cmd_exit(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int val = 0;
+ char *x;
+
+ x = cmd_getarg(cmd,0);
+ if (x) val = atoi(x);
+
+ __asm __volatile ("move $4,%0 ; li $2,1 ; syscall 0xca" : "=r"(val));
+
+ return -1;
+}
+#endif
+
+
+static int ui_cmd_console(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int res;
+ char *dev;
+
+ dev = cmd_getarg(cmd,0);
+ if (!dev) return -1; /* XXX usage */
+
+ res = cfe_getdevinfo(dev);
+ if (res < 0) {
+ xprintf("Device '%s' is not valid\n",dev);
+ return CFE_ERR_DEVNOTFOUND;
+ }
+
+ if ((res & CFE_DEV_MASK) != CFE_DEV_SERIAL) {
+ xprintf("Device '%s' is not the appropriate type to be a console\n",
+ dev);
+ return CFE_ERR_WRONGDEVTYPE;
+ }
+
+ cfe_set_console(dev);
+
+ return 0;
+}
diff --git a/cfe/cfe/ui/ui_netcmds.c b/cfe/cfe/ui/ui_netcmds.c
new file mode 100644
index 0000000..891e127
--- /dev/null
+++ b/cfe/cfe/ui/ui_netcmds.c
@@ -0,0 +1,710 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Network commands File: ui_netcmds.c
+ *
+ * Network user interface
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "cfe_devfuncs.h"
+#include "cfe_timer.h"
+#include "cfe_ioctl.h"
+
+#include "cfe_error.h"
+
+#include "env_subr.h"
+#include "ui_command.h"
+#include "cfe.h"
+
+#include "net_ebuf.h"
+#include "net_ether.h"
+
+#include "net_api.h"
+
+#include "cfe_fileops.h"
+
+#include "bsp_config.h"
+
+#define ip_addriszero(a) (((a)[0]|(a)[1]|(a)[2]|(a)[3]) == 0)
+#define isdigit(d) (((d) >= '0') && ((d) <= '9'))
+
+int ui_init_netcmds(void);
+
+#if CFG_NETWORK
+static int ui_cmd_ifconfig(ui_cmdline_t *cmd,int argc,char *argv[]);
+static int ui_cmd_arp(ui_cmdline_t *cmd,int argc,char *argv[]);
+static int ui_cmd_ping(ui_cmdline_t *cmd,int argc,char *argv[]);
+#if CFG_TCP
+extern int ui_init_tcpcmds(void);
+#endif
+#endif
+
+typedef struct netparam_s {
+ const char *str;
+ int num;
+} netparam_t;
+
+const static netparam_t loopbacktypes[] = {
+ {"off",ETHER_LOOPBACK_OFF},
+ {"internal",ETHER_LOOPBACK_INT},
+ {"external",ETHER_LOOPBACK_EXT},
+ {0,NULL}};
+
+const static netparam_t speedtypes[] = {
+ {"auto",ETHER_SPEED_AUTO},
+ {"10hdx",ETHER_SPEED_10HDX},
+ {"10fdx",ETHER_SPEED_10FDX},
+ {"100hdx",ETHER_SPEED_100HDX},
+ {"100fdx",ETHER_SPEED_100FDX},
+ {"1000hdx",ETHER_SPEED_1000HDX},
+ {"1000fdx",ETHER_SPEED_1000FDX},
+ {0,NULL}};
+
+
+int ui_init_netcmds(void)
+{
+#if CFG_NETWORK
+ cmd_addcmd("ifconfig",
+ ui_cmd_ifconfig,
+ NULL,
+ "Configure the Ethernet interface",
+ "ifconfig device [options..]\n\n"
+ "Activates and configures the specified Ethernet interface and sets its\n"
+ "IP address, netmask, and other parameters. The -auto switch can be used\n"
+ "to set this information via DHCP.",
+ "-auto;Configure interface automatically via DHCP|"
+ "-off;Deactivate the specified interface|"
+ "-addr=*;Specifies the IP address of the interface|"
+ "-mask=*;Specifies the subnet mask for the interface|"
+ "-gw=*;Specifies the gateway address for the interface|"
+ "-dns=*;Specifies the name server address for the interface|"
+ "-domain=*;Specifies the default domain for name service queries|"
+ "-speed=*;Sets the interface speed (auto,10fdx,10hdx,\n100fdx,\n"
+ "100hdx,1000fdx,1000hdx)|"
+ "-loopback=*;Sets the loopback mode (off,internal,external) "
+ "External\nloopback causes the phy to be placed in loopback mode|"
+ "-hwaddr=*;Sets the hardware address (overrides environment)");
+
+ cmd_addcmd("arp",
+ ui_cmd_arp,
+ NULL,
+ "Display or modify the ARP Table",
+ "arp [-d] [ip-address] [dest-address]\n\n"
+ "Without any parameters, the arp command will display the contents of the\n"
+ "arp table. With two parameters, arp can be used to add permanent arp\n"
+ "entries to the table (permanent arp entries do not time out)",
+ "-d;Delete the specified ARP entry. If specified, ip-address\n"
+ "may be * to delete all entries.");
+
+ cmd_addcmd("ping",
+ ui_cmd_ping,
+ NULL,
+ "Ping a remote IP host.",
+ "ping [-t] remote-host\n\n"
+ "This command sends an ICMP ECHO message to a remote host and waits for \n"
+ "a reply. The network interface must be configured and operational for\n"
+ "this command to work. If the interface is configured for loopback mode\n"
+ "the packet will be sent through the network interface, so this command\n"
+ "can be used for a simple network test.",
+ "-t;Ping forever, or until the ENTER key is struck|"
+ "-x;Exit immediately on first error (use with -f or -t)|"
+ "-f;Flood ping (use carefully!) - ping as fast as possible|"
+ "-s=*;Specify the number of ICMP data bytes|"
+ "-c=*;Specify number of packets to echo|"
+ "-A;don't abort even if key is pressed|"
+ "-E;Require all packets sent to be returned, for successful return status");
+
+#if CFG_TCP
+ /* Foxconn add start by Cliff Wang, 03/23/2010 */
+ //ui_init_tcpcmds();
+ /* Foxconn add end by Cliff Wang, 03/23/2010 */
+#endif
+
+
+#endif
+
+ return 0;
+}
+
+
+#if CFG_NETWORK
+static int parsexdigit(char str)
+{
+ int digit;
+
+ if ((str >= '0') && (str <= '9')) digit = str - '0';
+ else if ((str >= 'a') && (str <= 'f')) digit = str - 'a' + 10;
+ else if ((str >= 'A') && (str <= 'F')) digit = str - 'A' + 10;
+ else return -1;
+
+ return digit;
+}
+
+
+static int parsehwaddr(char *str,uint8_t *hwaddr)
+{
+ int digit1,digit2;
+ int idx = 6;
+
+ while (*str && (idx > 0)) {
+ digit1 = parsexdigit(*str);
+ if (digit1 < 0) return -1;
+ str++;
+ if (!*str) return -1;
+
+ if ((*str == ':') || (*str == '-')) {
+ digit2 = digit1;
+ digit1 = 0;
+ }
+ else {
+ digit2 = parsexdigit(*str);
+ if (digit2 < 0) return -1;
+ str++;
+ }
+
+ *hwaddr++ = (digit1 << 4) | digit2;
+ idx--;
+
+ if (*str == '-') str++;
+ if (*str == ':') str++;
+ }
+ return 0;
+}
+
+
+
+static int ui_ifdown(void)
+{
+ char *devname;
+
+ devname = (char *) net_getparam(NET_DEVNAME);
+ if (devname) {
+ xprintf("Device %s has been deactivated.\n",devname);
+ net_uninit();
+ net_setnetvars();
+ }
+
+ return 0;
+}
+
+static void ui_showifconfig(void)
+{
+ char *devname;
+ uint8_t *addr;
+
+ devname = (char *) net_getparam(NET_DEVNAME);
+ if (devname == NULL) {
+ xprintf("Network interface has not been configured\n");
+ return;
+ }
+
+ xprintf("Device %s: ",devname);
+
+ addr = net_getparam(NET_HWADDR);
+ if (addr) xprintf(" hwaddr %a",addr);
+
+ addr = net_getparam(NET_IPADDR);
+ if (addr) {
+ if (ip_addriszero(addr)) xprintf(", ipaddr not set");
+ else xprintf(", ipaddr %I",addr);
+ }
+
+ addr = net_getparam(NET_NETMASK);
+ if (addr) {
+ if (ip_addriszero(addr)) xprintf(", mask not set");
+ else xprintf(", mask %I",addr);
+ }
+
+ xprintf("\n");
+ xprintf(" ");
+
+ addr = net_getparam(NET_GATEWAY);
+ if (addr) {
+ if (ip_addriszero(addr)) xprintf("gateway not set");
+ else xprintf("gateway %I",addr);
+ }
+
+ addr = net_getparam(NET_NAMESERVER);
+ if (addr) {
+ if (ip_addriszero(addr)) xprintf(", nameserver not set");
+ else xprintf(", nameserver %I",addr);
+ }
+
+ addr = net_getparam(NET_DOMAIN);
+ if (addr) {
+ xprintf(", domain %s",addr);
+ }
+
+ xprintf("\n");
+}
+
+/* Foxconn add start by Cliff Wang, 03/23/2010 */
+#if 0
+static int ui_ifconfig_auto(ui_cmdline_t *cmd,char *devname)
+{
+ int err;
+ dhcpreply_t *reply = NULL;
+ char *x;
+ uint8_t hwaddr[6];
+
+ net_uninit();
+
+ err = net_init(devname);
+ if (err < 0) {
+ xprintf("Could not activate device %s: %s\n",
+ devname,cfe_errortext(err));
+ return err;
+ }
+
+ if (cmd_sw_value(cmd,"-hwaddr",&x)) {
+ if (parsehwaddr(x,hwaddr) != 0) {
+ xprintf("Invalid hardware address: %s\n",x);
+ net_uninit();
+ return CFE_ERR_INV_PARAM;
+ }
+ else {
+ net_setparam(NET_HWADDR,hwaddr);
+ }
+ }
+
+ err = dhcp_bootrequest(&reply);
+
+ if (err < 0) {
+ xprintf("DHCP registration failed on device %s\n",devname);
+ net_uninit();
+ return CFE_ERR_NETDOWN;
+ }
+
+ net_setparam(NET_IPADDR,reply->dr_ipaddr);
+ net_setparam(NET_NETMASK,reply->dr_netmask);
+ net_setparam(NET_GATEWAY,reply->dr_gateway);
+ net_setparam(NET_NAMESERVER,reply->dr_nameserver);
+ net_setparam(NET_DOMAIN,reply->dr_domainname);
+
+ dhcp_set_envvars(reply);
+
+ if (reply) dhcp_free_reply(reply);
+
+ ui_showifconfig();
+ net_setnetvars();
+ return 0;
+}
+#endif
+/* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+static int ui_ifconfig_getsw(ui_cmdline_t *cmd,char *swname,char *descr,uint8_t *addr)
+{
+ char *x;
+
+ x = NULL;
+
+ if (cmd_sw_value(cmd,swname,&x) == 0) return 0;
+
+ if ((x == NULL) || (parseipaddr(x,addr) < 0)) {
+ xprintf("Invalid %s: %s\n",descr,x ? x : "(none)");
+ return -1;
+ }
+
+ return 1;
+}
+
+static int ui_ifconfig_lookup(char *name,char *val,const netparam_t *list)
+{
+ const netparam_t *p = list;
+
+ while (p->str) {
+ if (strcmp(p->str,val) == 0) return p->num;
+ p++;
+ }
+
+ xprintf("Invalid parameter for %s: Valid options are: ");
+
+ p = list;
+ while (p->str) {
+ xprintf("%s ",p->str);
+ p++;
+ }
+
+ xprintf("\n");
+ return -1;
+}
+
+
+#define FLG_IPADDR 1
+#define FLG_NETMASK 2
+#define FLG_GATEWAY 4
+#define FLG_NAMESERVER 8
+#define FLG_DOMAIN 16
+#define FLG_LOOPBACK 32
+#define FLG_SPEED 64
+#define FLG_HWADDR 128
+
+static int ui_cmd_ifconfig(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char *devname;
+ int flags = 0;
+ uint8_t ipaddr[IP_ADDR_LEN];
+ uint8_t netmask[IP_ADDR_LEN];
+ uint8_t gateway[IP_ADDR_LEN];
+ uint8_t nameserver[IP_ADDR_LEN];
+ uint8_t hwaddr[6];
+ int speed = ETHER_SPEED_AUTO;
+ int loopback = ETHER_LOOPBACK_OFF;
+ char *domain = NULL;
+ int res;
+ char *x;
+
+ if (argc < 1) {
+ ui_showifconfig();
+ return 0;
+ }
+
+ devname = cmd_getarg(cmd,0);
+
+ if (cmd_sw_isset(cmd,"-off")) {
+ return ui_ifdown();
+ }
+
+ /* Foxconn add start by Cliff Wang, 03/23/2010 */
+#if 0
+ if (cmd_sw_isset(cmd,"-auto")) {
+ return ui_ifconfig_auto(cmd,devname);
+ }
+#endif
+ /* Foxconn add end by Cliff Wang, 03/23/2010 */
+
+ res = ui_ifconfig_getsw(cmd,"-addr","interface IP address",ipaddr);
+ if (res < 0) return CFE_ERR_INV_PARAM;
+ if (res > 0) {
+ flags |= FLG_IPADDR;
+ }
+
+ res = ui_ifconfig_getsw(cmd,"-mask","netmask",netmask);
+ if (res < 0) return CFE_ERR_INV_PARAM;
+ if (res > 0) {
+ flags |= FLG_NETMASK;
+ }
+
+ res = ui_ifconfig_getsw(cmd,"-gw","gateway IP address",gateway);
+ if (res < 0) return CFE_ERR_INV_PARAM;
+ if (res > 0) {
+ flags |= FLG_GATEWAY;
+ }
+
+ res = ui_ifconfig_getsw(cmd,"-dns","name server IP address",nameserver);
+ if (res < 0) return CFE_ERR_INV_PARAM;
+ if (res > 0) {
+ flags |= FLG_NAMESERVER;
+ }
+
+ if (cmd_sw_value(cmd,"-domain",&domain)) {
+ if (domain) flags |= FLG_DOMAIN;
+ }
+
+ if (cmd_sw_value(cmd,"-speed",&x)) {
+ speed = ui_ifconfig_lookup("-speed",x,speedtypes);
+ if (speed >= 0) flags |= FLG_SPEED;
+ else return CFE_ERR_INV_PARAM;
+ }
+
+ if (cmd_sw_value(cmd,"-loopback",&x)) {
+ loopback = ui_ifconfig_lookup("-loopback",x,loopbacktypes);
+ if (loopback >= 0) flags |= FLG_LOOPBACK;
+ else return CFE_ERR_INV_PARAM;
+ }
+
+ if (cmd_sw_value(cmd,"-hwaddr",&x)) {
+ if (parsehwaddr(x,hwaddr) != 0) {
+ xprintf("Invalid hardware address: %s\n",x);
+ return CFE_ERR_INV_PARAM;
+ }
+ else {
+ flags |= FLG_HWADDR;
+ }
+ }
+
+ /*
+ * If the network is running and the device name is
+ * different, uninit the net first.
+ */
+
+ x = (char *) net_getparam(NET_DEVNAME);
+
+ if ((x != NULL) && (strcmp(x,devname) != 0)) {
+ net_uninit();
+ }
+
+ /*
+ * Okay, initialize the network if it is not already on. If it
+ * is OFF, the "net_devname" parameter will be NULL.
+ */
+
+ if (x == NULL) {
+ res = net_init(devname); /* turn interface on */
+ if (res < 0) {
+ ui_showerror(res,"Could not activate network interface '%s'",devname);
+ return res;
+ }
+ }
+
+ /*
+ * Set the parameters
+ */
+
+ if (flags & FLG_HWADDR) net_setparam(NET_HWADDR,hwaddr);
+ if (flags & FLG_IPADDR) net_setparam(NET_IPADDR,ipaddr);
+ if (flags & FLG_NETMASK) net_setparam(NET_NETMASK,netmask);
+ if (flags & FLG_GATEWAY) net_setparam(NET_GATEWAY,gateway);
+ if (flags & FLG_NAMESERVER) net_setparam(NET_NAMESERVER,nameserver);
+ /* Foxconn add start by Cliff Wang, 03/23/2010 */
+ if (flags & FLG_DOMAIN) net_setparam(NET_DOMAIN,(uint8_t *) domain);
+ /* Foxconn add end by Cliff Wang, 03/23/2010 */
+ if (flags & FLG_SPEED) net_setparam(NET_SPEED,(uint8_t *) &speed);
+ if (flags & FLG_LOOPBACK) net_setparam(NET_LOOPBACK,(uint8_t *) &loopback);
+
+ ui_showifconfig();
+ net_setnetvars();
+
+ return 0;
+}
+
+
+static int ui_cmd_arp(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int idx;
+ uint8_t ipaddr[IP_ADDR_LEN];
+ uint8_t hwaddr[ENET_ADDR_LEN];
+ char *x;
+ int once = 0;
+
+ if (cmd_sw_isset(cmd,"-d")) {
+ if ((x = cmd_getarg(cmd,0)) == NULL) {
+ return ui_showusage(cmd);
+ }
+
+ if (strcmp(x,"*") == 0) {
+ while (arp_enumerate(0,ipaddr,hwaddr) >= 0) {
+ arp_delete(ipaddr);
+ }
+ }
+ else {
+ if (parseipaddr(x,ipaddr) < 0) {
+ xprintf("Invalid IP address: %s\n",x);
+ return CFE_ERR_INV_PARAM;
+ }
+ arp_delete(ipaddr);
+ }
+ return 0;
+ }
+
+ /*
+ * Get the IP address. If NULL, display the table.
+ */
+
+ x = cmd_getarg(cmd,0);
+ if (x == NULL) {
+ idx = 0;
+ while (arp_enumerate(idx,ipaddr,hwaddr) >= 0) {
+ if (once == 0) {
+ xprintf("Hardware Address IP Address\n");
+ xprintf("----------------- ---------------\n");
+ once = 1;
+ }
+ xprintf("%a %I\n",hwaddr,ipaddr);
+ idx++;
+ }
+ if (idx == 0) xprintf("No ARP entries.\n");
+ return 0;
+ }
+
+ if (parseipaddr(x,ipaddr) < 0) {
+ xprintf("Invalid IP address: %s\n",x);
+ return CFE_ERR_INV_PARAM;
+ }
+
+ /*
+ * Get the hardware address.
+ */
+
+ x = cmd_getarg(cmd,1);
+ if (x == NULL) {
+ return ui_showusage(cmd);
+ }
+
+ if (parsehwaddr(x,hwaddr) < 0) {
+ xprintf("Invalid hardware address: %s\n",x);
+ return CFE_ERR_INV_PARAM;
+ }
+
+ arp_add(ipaddr,hwaddr);
+
+ return 0;
+}
+
+#define IP_HDR_LENGTH 20
+#define ICMP_HDR_LENGTH 8
+#define PING_HDR_LENGTH (IP_HDR_LENGTH+ICMP_HDR_LENGTH)
+#define MAX_PKT_LENGTH 1500
+
+static int ui_cmd_ping(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char *host;
+ uint8_t hostaddr[IP_ADDR_LEN];
+ int res;
+ int seq = 0;
+ int forever = 0;
+ int count = 1;
+ int ttlcount = 1;
+ int countreturned = 0;
+ int size = 56;
+ int flood = 0;
+ int retval = 0;
+ int exitonerror = 0;
+ int needexact = 0;
+ int noabort = 0;
+ char *x;
+
+ host = cmd_getarg(cmd,0);
+ if (!host) return -1;
+
+ if (cmd_sw_isset(cmd,"-t")) {
+ forever = 1;
+ }
+
+ /* Per traditional Unix usage, the size argument to ping is
+ the number of ICMP data bytes. The frame on the wire will also
+ include the ethernet, IP and ICMP headers (14, 20, and
+ 8 bytes respectively) and ethernet trailer (CRC, 4 bytes). */
+ if (cmd_sw_value(cmd,"-s",&x)) {
+ size = atoi(x);
+ if (size < 0)
+ size = 0;
+ if (size > MAX_PKT_LENGTH - PING_HDR_LENGTH)
+ size = MAX_PKT_LENGTH - PING_HDR_LENGTH;
+ }
+
+ if (cmd_sw_isset(cmd,"-f")) {
+ flood = 1;
+ forever = 1;
+ }
+
+ if (cmd_sw_isset(cmd,"-x")) {
+ exitonerror = 1;
+ }
+
+ if (cmd_sw_value(cmd,"-c",&x)) {
+ count = atoi(x);
+ ttlcount = count;
+ forever = 0;
+ }
+
+ if (cmd_sw_isset(cmd,"-A")) {
+ noabort = 1;
+ }
+
+ if (cmd_sw_isset(cmd,"-E")) {
+ needexact = 1;
+ }
+
+ if (isdigit(*host)) {
+ if (parseipaddr(host,hostaddr) < 0) {
+ xprintf("Invalid IP address: %s\n",host);
+ return -1;
+ }
+ }
+ else {
+ res = dns_lookup(host,hostaddr);
+ if (res < 0) {
+ return ui_showerror(res,"Could not resolve IP address of host %s",host);
+ }
+ }
+
+ if (forever) xprintf("Press ENTER to stop pinging\n");
+
+ do {
+ res = icmp_ping(hostaddr,seq,size);
+
+ if (res < 0) {
+ xprintf("Could not transmit echo request\n");
+ retval = CFE_ERR_IOERR;
+ break;
+ }
+ else if (res == 0) {
+ xprintf("%s (%I) is not responding (seq=%d)\n",host,hostaddr,seq);
+ retval = CFE_ERR_TIMEOUT;
+ if (exitonerror) break;
+ }
+ else {
+ countreturned++;
+ if (!flood || ((seq % 10000) == 0)) {
+ if (forever || (ttlcount > 1)) {
+ xprintf("%s (%I) is alive (seq=%d)\n",host,hostaddr,seq);
+ }
+ else xprintf("%s (%I) is alive\n",host,hostaddr);
+ }
+ }
+
+ if ((forever || (count > 1)) && !flood) {
+ if (res > 0) cfe_sleep(CFE_HZ);
+ }
+
+ seq++;
+ count--;
+
+ } while ((forever || (count > 0)) && (noabort || !console_status()));
+
+ xprintf("%s (%I): %d packets sent, %d received\n",host,hostaddr,
+ ttlcount-count,countreturned);
+ return (needexact ? (countreturned != ttlcount) : (countreturned == 0));
+}
+
+#endif
diff --git a/cfe/cfe/ui/ui_pcicmds.c b/cfe/cfe/ui/ui_pcicmds.c
new file mode 100644
index 0000000..8875f8e
--- /dev/null
+++ b/cfe/cfe/ui/ui_pcicmds.c
@@ -0,0 +1,282 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * PCI Commands File: ui_pcicmds.c
+ *
+ * PCI user interface routines
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "env_subr.h"
+#include "ui_command.h"
+#include "cfe.h"
+
+#include "pcivar.h"
+#include "pcireg.h"
+
+#include "bsp_config.h"
+
+int ui_init_pcicmds(void);
+
+#if CFG_PCI
+static int pci_print_summary(pcitag_t tag)
+{
+ pcireg_t id, class;
+ char devinfo[256];
+
+ class = pci_conf_read(tag, PCI_CLASS_REG);
+ id = pci_conf_read(tag, PCI_ID_REG);
+
+ pci_devinfo(id, class, 1, devinfo);
+ pci_tagprintf (tag, "%s\n", devinfo);
+
+ return 0;
+}
+
+static int pci_print_concise(pcitag_t tag)
+{
+ pci_tagprintf (tag, "\n");
+ pci_conf_print(tag);
+
+ return 0;
+}
+
+static int ui_cmd_pci(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char *argp;
+
+ if (cmd_sw_isset(cmd,"-init")) {
+ pci_configure(PCI_FLG_LDT_PREFETCH | PCI_FLG_NORMAL);
+ return 0;
+ }
+
+ argp = cmd_getarg(cmd,0);
+
+ if (argp == NULL) {
+ if (cmd_sw_isset(cmd,"-v")) {
+ pci_foreachdev(pci_print_concise);
+ }
+ else {
+ pci_foreachdev(pci_print_summary);
+ }
+ }
+ else {
+ /* parse the triplet */
+ int bus, dev, func;
+ pcitag_t tag;
+ char *p;
+
+ bus = dev = func = 0;
+ p = argp;
+
+ while (*p >= '0' && *p <= '9') {
+ bus = bus*10 + (*p - '0');
+ p++;
+ }
+ if (*p != '/')
+ goto fail;
+ p++;
+ while (*p >= '0' && *p <= '9') {
+ dev = dev*10 + (*p - '0');
+ p++;
+ }
+ if (*p != '/')
+ goto fail;
+ p++;
+ while (*p >= '0' && *p <= '9') {
+ func = func*10 + (*p - '0');
+ p++;
+ }
+ if (*p != '\000')
+ goto fail;
+
+ tag = pci_make_tag(bus,dev,func);
+
+ pci_print_concise(tag);
+ }
+
+ return 0;
+
+fail:
+ printf("invalid PCI triplet %s\n", argp);
+ return -1;
+}
+
+
+static uint64_t parse_hex(const char *num)
+{
+ uint64_t x = 0;
+ unsigned int digit;
+
+ if ((*num == '0') && (*(num+1) == 'x')) num += 2;
+
+ while (*num) {
+ if ((*num >= '0') && (*num <= '9')) {
+ digit = *num - '0';
+ }
+ else if ((*num >= 'A') && (*num <= 'F')) {
+ digit = 10 + *num - 'A';
+ }
+ else if ((*num >= 'a') && (*num <= 'f')) {
+ digit = 10 + *num - 'a';
+ }
+ else {
+ break;
+ }
+ x *= 16;
+ x += digit;
+ num++;
+ }
+
+ return x;
+}
+
+static int ui_cmd_map_pci(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ unsigned long offset, size;
+ uint64_t paddr;
+ int l2ca, endian;
+ int enable;
+ int result;
+
+ enable = !cmd_sw_isset(cmd, "-off");
+ if (enable) {
+ offset = parse_hex(cmd_getarg(cmd, 0));
+ size = parse_hex(cmd_getarg(cmd, 1));
+ paddr = parse_hex(cmd_getarg(cmd, 2));
+ l2ca = cmd_sw_isset(cmd,"-l2ca");
+ endian = cmd_sw_isset(cmd, "-matchbits");
+ result = pci_map_window(paddr, offset, size, l2ca, endian);
+ }
+ else {
+ offset = parse_hex(cmd_getarg(cmd, 0));
+ size = parse_hex(cmd_getarg(cmd, 1));
+ result = pci_unmap_window(offset, size);
+ }
+
+ return result;
+}
+#endif
+
+#ifdef CFG_VGACONSOLE
+
+extern int vga_biosinit(void);
+extern int vga_probe(void);
+extern void vgaraw_dump(char *tail);
+
+static int ui_cmd_vgainit(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int res;
+
+ if (vga_probe() == 0) {
+ res = vga_biosinit();
+ xprintf("vgabios_init returns %d\n",res);
+ }
+ else
+ xprintf("vga_probe found no suitable adapter\n");
+
+ return 0;
+}
+
+static int ui_cmd_vgadump(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char *x;
+
+ x = cmd_getarg(cmd,0);
+ if (x == NULL) x = "";
+ vgaraw_dump(x);
+
+ return 0;
+}
+#endif /* CFG_VGACONSOLE */
+
+
+int ui_init_pcicmds(void)
+{
+
+#if CFG_PCI
+ cmd_addcmd("show pci",
+ ui_cmd_pci,
+ NULL,
+ "Display information about PCI buses and devices",
+ "show pci [-v] [bus/dev/func]\n\n"
+ "Displays information about PCI and LDT buses and devices in the\n"
+ "system. If you specify a bus/dev/func triplet, only that device\n"
+ " will be displayed.",
+ "-v;Display verbose information|"
+ "-init;Reinitialize and rescan the PCI bus");
+ cmd_addcmd("map pci",
+ ui_cmd_map_pci,
+ NULL,
+ "Define a BAR0 window available to PCI devices",
+ "map pci offset size paddr [-off] [-l2ca] [-matchbits]\n\n"
+ "Map the region of size bytes starting at paddr to appear\n"
+ "at offset relative to BAR0\n",
+ "-off;Remove the region|"
+ "-l2ca;Make L2 cachable|"
+ "-matchbits;Use match bits policy");
+
+#ifdef CFG_VGACONSOLE
+ cmd_addcmd("vga init",
+ ui_cmd_vgainit,
+ NULL,
+ "Initialize the VGA adapter.",
+ "vgainit",
+ "");
+ cmd_addcmd("vga dumpbios",
+ ui_cmd_vgadump,
+ NULL,
+ "Dump the VGA BIOS to the console",
+ "vga dumpbios",
+ "");
+#endif /* CFG_VGACONSOLE */
+#endif
+ return 0;
+}
diff --git a/cfe/cfe/ui/ui_tcpcmds.c b/cfe/cfe/ui/ui_tcpcmds.c
new file mode 100644
index 0000000..e092021
--- /dev/null
+++ b/cfe/cfe/ui/ui_tcpcmds.c
@@ -0,0 +1,828 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * TCP protocol commands File: ui_tcpcmds.c
+ *
+ * This file contains commands that make use of the TCP protocol
+ * in CFE, assuming it's configured.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_timer.h"
+
+#include "cfe_error.h"
+#include "cfe_console.h"
+
+#include "ui_command.h"
+#include "cfe.h"
+
+#include "cfe_iocb.h"
+#include "cfe_devfuncs.h"
+
+#include "bsp_config.h"
+
+#if CFG_TCP
+#include "net_ebuf.h"
+#include "net_api.h"
+#endif
+
+
+/* *********************************************************************
+ * Configuration
+ ********************************************************************* */
+
+/* *********************************************************************
+ * prototypes
+ ********************************************************************* */
+
+#if CFG_TCP
+
+int ui_init_tcpcmds(void);
+
+static int ui_cmd_rlogin(ui_cmdline_t *cmd,int argc,char *argv[]);
+static int ui_cmd_connect(ui_cmdline_t *cmd,int argc,char *argv[]);
+static int ui_cmd_listen(ui_cmdline_t *cmd,int argc,char *argv[]);
+static int ui_cmd_tcpconstest(ui_cmdline_t *cmd,int argc,char *argv[]);
+static int ui_cmd_ttcp(ui_cmdline_t *cmd,int argc,char *argv[]);
+#define isdigit(d) (((d) >= '0') && ((d) <= '9'))
+
+
+/* *********************************************************************
+ * ui_init_tcpcmds()
+ *
+ * Add TCP-specific commands to the command table
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+
+int ui_init_tcpcmds(void)
+{
+
+ cmd_addcmd("rlogin",
+ ui_cmd_rlogin,
+ NULL,
+ "mini rlogin client.",
+ "rlogin hostname [username]\n\n"
+ "Connects to a remote system using the RLOGIN protocol. The remote"
+ "system must have appropriate permissions in place (usually via the"
+ "file '.rhosts') for CFE to connect. To terminate the session, type"
+ "a tilde (~) character followed by a period (.)",
+ "");
+
+ cmd_addcmd("tcp connect",
+ ui_cmd_connect,
+ NULL,
+ "TCP connection test.",
+ "tcp connect hostname [portnum]",
+ "-q;sink output, don't display on terminal|"
+ "-d;Send junk data to discard|"
+ "-nodelay;set nodelay option on socket|"
+ "-srcport=*;Specify the source port");
+
+ cmd_addcmd("tcp listen",
+ ui_cmd_listen,
+ NULL,
+ "port listener.",
+ "tcp listen portnum",
+ "-q;sink output, don't display on terminal|"
+ "-d;Send junk data to discard|"
+ "-nodelay;set nodelay option on socket");
+
+
+ cmd_addcmd("tcp constest",
+ ui_cmd_tcpconstest,
+ NULL,
+ "tcp console test.",
+ "tcp constest device",
+ "");
+
+ cmd_addcmd("ttcp",
+ ui_cmd_ttcp,
+ NULL,
+ "TCP test command.",
+ "ttcp -t [-options] host\n"
+ "ttcp -r [-options]\n\n",
+ "-t;Source a pattern to the network|"
+ "-r;Sink (discard) data from the network|"
+ "-D;Don't buffer TCP writes (TCP_NODELAY)|"
+ "-n=*;Number of buffers to send (-t only) (default 2048)|"
+ "-l=*;Size of buffer to send/receive (default 2048)|"
+ "-p=*;Port number to use (default 5001)");
+
+ return 0;
+}
+
+
+
+
+
+static unsigned long rand(void)
+{
+ static unsigned long seed = 1;
+ long x, hi, lo, t;
+
+ x = seed;
+ hi = x / 127773;
+ lo = x % 127773;
+ t = 16807 * lo - 2836 * hi;
+ if (t <= 0) t += 0x7fffffff;
+ seed = t;
+ return t;
+}
+
+
+static int ui_cmd_rlogin(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int s;
+ uint8_t hostaddr[IP_ADDR_LEN];
+ char *host;
+ int res;
+ int connflag;
+ int rxdata;
+ int sport;
+ uint8_t data[100];
+ int tilde;
+ char *username;
+ uint8_t *p;
+
+ /*
+ * Process args
+ */
+
+ host = cmd_getarg(cmd,0);
+ if (!host) return ui_showusage(cmd);
+
+ username = cmd_getarg(cmd,1);
+ if (!username) username = "";
+
+ /*
+ * Look up remote host
+ */
+
+ if (isdigit(*host)) {
+ if (parseipaddr(host,hostaddr) < 0) {
+ xprintf("Invalid IP address: %s\n",host);
+ return -1;
+ }
+ }
+ else {
+ res = dns_lookup(host,hostaddr);
+ if (res < 0) {
+ return ui_showerror(res,"Could not resolve IP address of host %s",host);
+ }
+ }
+
+ /*
+ * Create TCP socket and bind to a port number less than 1023
+ * See RFC1282 for more info about this
+ */
+
+ s = tcp_socket();
+
+ if (s < 0) {
+ return ui_showerror(s,"Could not create TCP socket");
+ }
+
+ res = 0;
+ tilde = 0;
+ for (sport = 1023; sport > 513; sport--) {
+ res = tcp_bind(s,sport);
+ if (res == 0) break;
+ }
+
+ if (sport == 513) {
+ ui_showerror(res,"No ports available for RLOGIN");
+ return res;
+ }
+
+ /*
+ * Establish a connection. Our sockets default to nonblocking
+ * so we want to switch to blocking temporarily to
+ * let the tcp_connect routine do this by itself.
+ */
+
+ tcp_setflags(s,0);
+ res = tcp_connect(s,hostaddr,513);
+ if (res < 0) {
+ ui_showerror(res,"Could not connect to host %I",hostaddr);
+ tcp_close(s);
+ return res;
+ }
+
+
+ /*
+ * Construct the initial RLOGIN sequence to include
+ * our user name and terminal type
+ */
+
+ p = data;
+ *p++ = '\0';
+ p += sprintf(p,"%s",username) + 1;
+ p += sprintf(p,"%s",username) + 1;
+ p += sprintf(p,"vt100/38400") + 1;
+
+ tcp_send(s,data,p-&data[0]);
+
+ res = tcp_recv(s,data,1); /* receive result code */
+ if (res <= 0) {
+ goto remdisc;
+ }
+
+ /*
+ * Switch back to nonblocking I/O for the loop
+ */
+
+ tcp_setflags(s,TCPFLG_NBIO);
+
+ /*
+ * Begin processing loop
+ */
+
+ connflag = TRUE;
+ for (;;) {
+
+ /*
+ * Test connection status
+ */
+
+ tcp_status(s,&connflag,&rxdata,NULL);
+ if (connflag != TCPSTATUS_CONNECTED) {
+ goto remdisc;
+ }
+
+ /*
+ * Process received data
+ */
+
+ if (rxdata != 0) {
+ res = tcp_recv(s,data,sizeof(data));
+ if (res > 0) {
+ console_write(data,res);
+ }
+ if (res < 0) {
+ ui_showerror(res,"TCP read error");
+ break;
+ }
+ }
+
+ /*
+ * Process transmitted data
+ */
+
+ if (console_status()) {
+ console_read(data,1);
+ if (tilde == 1) {
+ if (data[0] == '.') break;
+ tcp_send(s,data,1);
+ }
+ else {
+ if (data[0] == '~') tilde = 1;
+ else tcp_send(s,data,1);
+ }
+ }
+
+ /*
+ * Give the background a chance
+ */
+
+ POLL();
+ }
+
+ printf("Disconnecting...");
+ tcp_close(s);
+ printf("done.\n");
+ return 0;
+
+remdisc:
+ printf("Remote host is no longer connected.\n");
+ tcp_close(s);
+ return 0;
+}
+
+
+
+static int ui_cmd_connect(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int s;
+ uint8_t hostaddr[IP_ADDR_LEN];
+ char *host;
+ char *port;
+ int res;
+ int connflag;
+ int rxdata;
+ uint8_t data[100];
+ int quiet;
+ int discard;
+ int total = 0;
+ int total2 = 0;
+ char b = 0;
+ cfe_timer_t t;
+ char *bigbuf;
+ int nodelay;
+ char *sport = NULL;
+
+ bigbuf = KMALLOC(4096,0);
+ for (res = 0; res < 4096; res++) bigbuf[res] = 'A'+(res%26);
+
+ quiet = cmd_sw_isset(cmd,"-q");
+ discard = cmd_sw_isset(cmd,"-d");
+ nodelay = cmd_sw_isset(cmd,"-nodelay");
+
+ host = cmd_getarg(cmd,0);
+ if (!host) return -1;
+
+ port = cmd_getarg(cmd,1);
+ if (!port) port = "23";
+
+ if (strcmp(port,"discard") == 0) port = "9";
+ else if (strcmp(port,"chargen") == 0) port = "19";
+ else if (strcmp(port,"echo") == 0) port = "7";
+
+ if (isdigit(*host)) {
+ if (parseipaddr(host,hostaddr) < 0) {
+ xprintf("Invalid IP address: %s\n",host);
+ return -1;
+ }
+ }
+ else {
+ res = dns_lookup(host,hostaddr);
+ if (res < 0) {
+ return ui_showerror(res,"Could not resolve IP address of host %s",host);
+ }
+ }
+
+
+ s = tcp_socket();
+
+ if (s < 0) {
+ return ui_showerror(s,"Could not create TCP socket");
+ }
+
+ if (cmd_sw_value(cmd,"-srcport",&sport)) {
+ res = tcp_bind(s,atoi(sport));
+ if (res < 0) {
+ ui_showerror(res,"Could not bind to port %s",sport);
+ tcp_close(s);
+ return res;
+ }
+ }
+
+ res = tcp_connect(s,hostaddr,atoi(port));
+ if (res < 0) {
+ ui_showerror(res,"Could not connect to host %I",hostaddr);
+ tcp_close(s);
+ return res;
+ }
+
+ TIMER_SET(t,CFE_HZ*30);
+ connflag = 0;
+ while (!TIMER_EXPIRED(t)) {
+ POLL();
+ tcp_status(s,&connflag,NULL,NULL);
+ if (connflag == TCPSTATUS_CONNECTING) continue;
+ break;
+ }
+
+ if (connflag != TCPSTATUS_CONNECTED) {
+ printf("Could not connect to remote host\n");
+ tcp_close(s);
+ return -1;
+ }
+ else {
+ printf("Connected to remote host.\n");
+ }
+
+
+ if (nodelay) tcp_setflags(s,TCPFLG_NODELAY);
+
+ connflag = TRUE;
+ for (;;) {
+ tcp_status(s,&connflag,&rxdata,NULL);
+ if (connflag != TCPSTATUS_CONNECTED) {
+ printf("Remote host is no longer connected.\n");
+ break;
+ }
+ if (rxdata != 0) {
+ res = tcp_recv(s,data,sizeof(data));
+ if (res > 0) {
+ if (quiet) {
+ total += res;
+ if (total > 1000000) {
+ total -= 1000000;
+ printf(".");
+ }
+ }
+ else {
+ console_write(data,res);
+ }
+ }
+ if (res < 0) {
+ ui_showerror(res,"TCP read error");
+ }
+ }
+ if (console_status()) {
+ console_read(data,1);
+ if (data[0] == 1) break;
+ else if (data[0] == 3) break;
+ else if (data[0] == 4) {
+ for (res = 0; res < 100; res++) data[res] = 'A'+(res%26);
+ tcp_send(s,data,100);
+ }
+ else if (data[0] == 5) tcp_send(s,bigbuf,2048);
+ else if (data[0] == 2) tcp_debug(s,0);
+ else tcp_send(s,data,1);
+ }
+ if (discard) {
+ res = rand() % sizeof(data);
+ memset(data,b,res);
+ b++;
+ res = tcp_send(s,data,res);
+ if (res > 0) {
+ total2 += res;
+ if (total2 > 1000000) {
+ total2 -= 1000000;
+ printf("+");
+ }
+ }
+
+ }
+
+ POLL();
+ }
+
+ printf("Disconnecting...");
+ tcp_close(s);
+ printf("done.\n");
+
+ KFREE(bigbuf);
+
+ return 0;
+}
+
+
+static int ui_cmd_listen(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int s;
+ char *port;
+ int res;
+ int connflag;
+ int rxdata;
+ uint8_t data[100];
+ int quiet;
+ int discard;
+ int total = 0;
+ int total2 = 0;
+ char b = 0;
+ char *bigbuf;
+ uint16_t p;
+ uint16_t remport;
+ uint8_t remaddr[IP_ADDR_LEN];
+ int nodelay;
+
+ bigbuf = KMALLOC(4096,0);
+ for (res = 0; res < 4096; res++) bigbuf[res] = 'A'+(res%26);
+
+ quiet = cmd_sw_isset(cmd,"-q");
+ discard = cmd_sw_isset(cmd,"-d");
+ nodelay = cmd_sw_isset(cmd,"-nodelay");
+
+ port = cmd_getarg(cmd,0);
+ if (!port) port = "1234";
+ p = atoi(port);
+
+ s = tcp_socket();
+
+ if (s < 0) {
+ return ui_showerror(s,"Could not create TCP socket");
+ }
+
+ res = tcp_listen(s,p);
+ if (res < 0) {
+ ui_showerror(res,"Could not set socket to listen");
+ tcp_close(s);
+ return res;
+ }
+
+ printf("Listening...");
+ connflag = FALSE;
+ for (;;) {
+ if (console_status()) break;
+ tcp_status(s,&connflag,NULL,NULL);
+ if (connflag == TCPSTATUS_CONNECTED) break;
+ POLL();
+ }
+
+ if (connflag != TCPSTATUS_CONNECTED) {
+ printf("No connection received from remote host\n");
+ tcp_close(s);
+ return -1;
+ }
+
+ tcp_peeraddr(s,remaddr,&remport);
+ printf("Connection from port %u on %I\n",remport,remaddr);
+
+ if (nodelay) tcp_setflags(s,TCPFLG_NODELAY);
+
+ connflag = TRUE;
+ for (;;) {
+ tcp_status(s,&connflag,&rxdata,NULL);
+ if (connflag != TCPSTATUS_CONNECTED) {
+ printf("Remote host is no longer connected.\n");
+ break;
+ }
+ if (rxdata != 0) {
+ res = tcp_recv(s,data,sizeof(data));
+ if (res > 0) {
+ if (quiet) {
+ total += res;
+ if (total > 1000000) {
+ total -= 1000000;
+ printf(".");
+ }
+ }
+ else {
+ console_write(data,res);
+ }
+ }
+ if (res < 0) {
+ ui_showerror(res,"TCP read error");
+ }
+ }
+ if (console_status()) {
+ console_read(data,1);
+ if (data[0] == 1) break;
+ if (data[0] == 3) break;
+ if (data[0] == 4) {
+ for (res = 0; res < 100; res++) data[res] = 'A'+(res%26);
+ tcp_send(s,data,100);
+ }
+ if (data[0] == 5) tcp_send(s,bigbuf,2048);
+ if (data[0] == 2) tcp_debug(s,0);
+ else tcp_send(s,data,1);
+ }
+ if (discard) {
+ res = rand() % sizeof(data);
+ memset(data,b,res);
+ b++;
+ res = tcp_send(s,data,res);
+ if (res > 0) {
+ total2 += res;
+ if (total2 > 1000000) {
+ total2 -= 1000000;
+ printf("+");
+ }
+ }
+
+ }
+
+ POLL();
+ }
+
+
+ printf("Disconnecting...");
+ tcp_close(s);
+ printf("done.\n");
+
+ KFREE(bigbuf);
+
+ return 0;
+}
+
+
+static int ui_cmd_tcpconstest(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char *x;
+ int fh;
+ int res;
+ uint8_t data[100];
+
+ x = cmd_getarg(cmd,0);
+ if (!x) return ui_showusage(cmd);
+
+ fh = cfe_open(x);
+ if (fh < 0) return ui_showerror(fh,"Could not open device %s",x);
+
+ for (;;) {
+ if (console_status()) break;
+ res = cfe_read(fh,data,sizeof(data));
+ if (res < 0) {
+ ui_showerror(res,"could not read data");
+ break;
+ }
+ console_write(data,res);
+ }
+
+ cfe_close(fh);
+
+ return 0;
+}
+
+static int ui_cmd_ttcp(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int s;
+ uint8_t hostaddr[IP_ADDR_LEN];
+ char *host;
+ int res;
+ int totalbytes = 0;
+ int totalbufs = 0;
+ cfe_timer_t start_time;
+ cfe_timer_t stop_time;
+ cfe_timer_t t;
+ int connflag;
+ char *bigbuf;
+ int nodelay;
+ int numbuf;
+ int buflen;
+ int txmode,rxmode;
+ uint16_t port;
+
+ char *x;
+
+ if (cmd_sw_value(cmd,"-n",&x)) numbuf = atoi(x);
+ else numbuf = 2048;
+
+ if (cmd_sw_value(cmd,"-l",&x)) buflen = atoi(x);
+ else buflen = 2048;
+
+ if (cmd_sw_value(cmd,"-p",&x)) port = atoi(x);
+ else port = 5001;
+
+ if ((numbuf == 0) || (buflen == 0)) return ui_showusage(cmd);
+
+
+ bigbuf = KMALLOC(buflen,0);
+ for (res = 0; res < buflen; res++) bigbuf[res] = 'A'+(res%26);
+
+ txmode = cmd_sw_isset(cmd,"-t");
+ rxmode = cmd_sw_isset(cmd,"-r");
+
+ if (!(txmode ^ rxmode)) {
+ return ui_showerror(-1,"You must specify one of -t or -r");
+ }
+
+ nodelay = cmd_sw_isset(cmd,"-D");
+
+ if (txmode) {
+ host = cmd_getarg(cmd,0);
+ if (!host) return ui_showusage(cmd);
+
+ if (isdigit(*host)) {
+ if (parseipaddr(host,hostaddr) < 0) {
+ return ui_showerror(-1,"Invalid IP address: %s\n",host);
+ }
+ }
+ else {
+ res = dns_lookup(host,hostaddr);
+ if (res < 0) {
+ return ui_showerror(res,"Could not resolve IP address of host %s",host);
+ }
+ }
+ }
+
+
+ s = tcp_socket();
+
+ if (s < 0) {
+ return ui_showerror(s,"Could not create TCP socket");
+ }
+
+
+ if (txmode) {
+ res = tcp_connect(s,hostaddr,port);
+ if (res < 0) {
+ ui_showerror(res,"Could not connect to host %I",hostaddr);
+ tcp_close(s);
+ return res;
+ }
+
+ TIMER_SET(t,CFE_HZ*30);
+ connflag = 0;
+ while (!TIMER_EXPIRED(t)) {
+ POLL();
+ tcp_status(s,&connflag,NULL,NULL);
+ if (connflag == TCPSTATUS_CONNECTING) continue;
+ break;
+ }
+
+ if (connflag != TCPSTATUS_CONNECTED) {
+ printf("Could not connect to remote host\n");
+ tcp_close(s);
+ return -1;
+ }
+ else {
+ printf("Connected to remote host.\n");
+ }
+ }
+
+ if (rxmode) {
+ printf("Waiting for connection on port %d: ",port);
+ tcp_listen(s,port);
+ for (;;) {
+ if (console_status()) break;
+ tcp_status(s,&connflag,NULL,NULL);
+ if (connflag == TCPSTATUS_CONNECTED) break;
+ POLL();
+ }
+ if (connflag != TCPSTATUS_CONNECTED) {
+ printf("No connection received from remote host\n");
+ tcp_close(s);
+ return -1;
+ }
+ printf("done.\n");
+ }
+
+
+ if (nodelay) tcp_setflags(s,TCPFLG_NODELAY); /* also sets blocking */
+ else tcp_setflags(s,0);
+
+ start_time = cfe_ticks;
+
+ if (rxmode) {
+ while (1) {
+ POLL();
+ res = tcp_recv(s,bigbuf,buflen);
+ if (res != buflen) break;
+ totalbytes += res;
+ totalbufs++;
+ }
+ }
+ else {
+ while (numbuf > 0) {
+ POLL();
+ res = tcp_send(s,bigbuf,buflen);
+ if (res != buflen) break;
+ numbuf--;
+ totalbytes += res;
+ totalbufs++;
+ }
+ }
+
+ stop_time = cfe_ticks;
+
+ tcp_close(s);
+
+ if ((res < 0) && !rxmode) {
+ ui_showerror(res,"Network I/O error");
+ }
+ else {
+ printf("%d bytes transferred via %d calls in %lld ticks\n",
+ totalbytes,totalbufs,stop_time-start_time);
+ }
+
+
+ KFREE(bigbuf);
+
+ return 0;
+
+}
+
+#endif /* CFG_TCP */
diff --git a/cfe/cfe/ui/ui_test_disk.c b/cfe/cfe/ui/ui_test_disk.c
new file mode 100644
index 0000000..9e3e5f9
--- /dev/null
+++ b/cfe/cfe/ui/ui_test_disk.c
@@ -0,0 +1,439 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Commands to test block devices File: ui_test_disk.c
+ *
+ * Commands to manipulate block devices live here.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "cfe_error.h"
+#include "cfe_ioctl.h"
+#include "cfe_devfuncs.h"
+#include "ui_command.h"
+#include "cfe.h"
+
+#include "cfe_fileops.h"
+#include "cfe_bootblock.h"
+#include "cfe_boot.h"
+
+static int ui_cmd_disktest(ui_cmdline_t *cmd,int argc,char *argv[]);
+static int ui_cmd_fstest(ui_cmdline_t *cmd,int argc,char *argv[]);
+static int ui_cmd_copydisk(ui_cmdline_t *cmd,int argc,char *argv[]);
+static int ui_cmd_bootblock(ui_cmdline_t *cmd,int argc,char *argv[]);
+
+int ui_init_disktestcmds(void);
+
+int ui_init_disktestcmds(void)
+{
+
+ cmd_addcmd("test disk",
+ ui_cmd_disktest,
+ NULL,
+ "Do a disk test, read/write sectors on the disk",
+ "test disk device-name [-random | sector# | {-w sector offset byte}]",
+ "-random;|"
+ "-w;Write a byte at offset in sector.**DANGER!! BE CAREFUL WHICH DEVICE YOU WRITE TO.**");
+
+ cmd_addcmd("test fatfs",
+ ui_cmd_fstest,
+ NULL,
+ "Do a FAT file system test",
+ "test fatfs device-name",
+ "");
+
+ cmd_addcmd("copydisk",
+ ui_cmd_copydisk,
+ NULL,
+ "Copy a remote disk image to a local disk device via TFTP",
+ "copydisk host:filename device-name [offset]",
+ "");
+
+ cmd_addcmd("show boot",
+ ui_cmd_bootblock,
+ NULL,
+ "Display boot block from device,",
+ "show boot device-name\n\n"
+ "This command displays the boot block on the specified device. The\n"
+ "device-name parameter identifies a block device (disk, tape, CD-ROM)\n"
+ "to be scanned for boot blocks. The first boot block found will be\n"
+ "displayed.",
+ "");
+ return 0;
+}
+
+
+static unsigned long rand(void)
+{
+ static unsigned long seed = 1;
+ long x, hi, lo, t;
+
+ x = seed;
+ hi = x / 127773;
+ lo = x % 127773;
+ t = 16807 * lo - 2836 * hi;
+ if (t <= 0) t += 0x7fffffff;
+ seed = t;
+ return t;
+}
+
+
+static int ui_cmd_bootblock(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int fh;
+ char *tok;
+ struct boot_block bootblock;
+ int res;
+ int idx;
+ int sec;
+ uint32_t checksum;
+ uint32_t checksumd;
+ uint32_t calcsum;
+ uint32_t secsize;
+ uint64_t secoffset;
+ uint8_t *code;
+
+ tok = cmd_getarg(cmd,0);
+ if (!tok) return -1;
+
+ fh = cfe_open(tok);
+ if (fh < 0) {
+ xprintf("Could not open device; %d\n",fh);
+ return -1;
+ }
+ for (sec = 0; sec < BOOT_BLOCK_MAXLOC; sec++) {
+ res = cfe_readblk(fh,sec * BOOT_BLOCK_BLOCKSIZE,
+ (unsigned char *) &bootblock,sizeof(bootblock));
+
+ if (bootblock.bb_magic != BOOT_MAGIC_NUMBER) {
+ continue;
+ }
+ xprintf("Found boot block in sector %d\n", sec);
+ if (res != sizeof(bootblock)) {
+ xprintf("Could not read boot block\n");
+ cfe_close(fh);
+ return -1;
+ }
+
+ xprintf("Boot block data:\n");
+ for (idx = 59; idx < 64; idx++) {
+ xprintf(" %d: %016llX\n",idx,bootblock.bb_data[idx]);
+ }
+ xprintf("\n");
+
+ xprintf("Boot block version is %d\n",
+ (uint32_t) ((bootblock.bb_hdrinfo & BOOT_HDR_VER_MASK) >> BOOT_HDR_VER_SHIFT));
+ xprintf("Boot block flags are %02X\n",
+ (uint32_t) ((bootblock.bb_hdrinfo & BOOT_HDR_FLAGS_MASK) >> 56));
+ checksum = ((uint32_t) (bootblock.bb_hdrinfo & BOOT_HDR_CHECKSUM_MASK));
+ checksumd = ((uint32_t) ((bootblock.bb_secsize & BOOT_DATA_CHECKSUM_MASK) >> BOOT_DATA_CHECKSUM_SHIFT));
+ bootblock.bb_hdrinfo &= ~BOOT_HDR_CHECKSUM_MASK;
+ secsize = ((uint32_t) (bootblock.bb_secsize & BOOT_SECSIZE_MASK));
+ secoffset = bootblock.bb_secstart;
+
+ xprintf("Boot code is %d bytes at %016llX\n",secsize,secoffset);
+
+ CHECKSUM_BOOT_DATA(&(bootblock.bb_magic),BOOT_BLOCK_SIZE,&calcsum);
+
+ if (checksum != calcsum) {
+ xprintf("Header checksum does not match Blk=%08X Calc=%08X\n",
+ checksum,calcsum);
+ }
+ else {
+ xprintf("Header checksum is ok\n");
+ }
+
+ code = KMALLOC(secsize,0);
+ if (code) {
+ res = cfe_readblk(fh,secoffset,code,secsize);
+ if (res != secsize) {
+ xprintf("Could not read boot code\n");
+ cfe_close(fh);
+ KFREE(code);
+ return -1;
+ }
+ CHECKSUM_BOOT_DATA(code,secsize,&calcsum);
+ if (calcsum == checksumd) xprintf("Boot code checksum is ok\n");
+ else xprintf("Boot code checksum is incorrect (Calc=%08X, Blk=%08X)\n",
+ calcsum,checksumd);
+ KFREE(code);
+ }
+ break;
+ }
+ if (sec == BOOT_BLOCK_MAXLOC) {
+ xprintf("No valid boot blocks found in the first %d sectors\n",
+ BOOT_BLOCK_MAXLOC);
+ }
+ cfe_close(fh);
+
+ return 0;
+}
+
+
+
+
+
+extern int fatfs_fileop_dir(void *fsctx);
+
+static int ui_cmd_fstest(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char *tok;
+ char *fname;
+ fileio_ctx_t *fsctx;
+ void *filectx;
+ uint8_t buffer[1000];
+ int res;
+ int total;
+
+ tok = cmd_getarg(cmd,0);
+ if (!tok) return -1;
+
+ fname = cmd_getarg(cmd,1);
+
+ res = fs_init("fat",&fsctx,tok);
+ if (res < 0) {
+ xprintf("Could not init file system: %s\n",cfe_errortext(res));
+ return res;
+ }
+
+ if (!fname) {
+ fatfs_fileop_dir(fsctx->fsctx);
+ }
+ else {
+ res = fs_open(fsctx,&filectx,fname,FILE_MODE_READ);
+ if (res < 0) {
+ xprintf("Could not open %s: %s\n",fname,cfe_errortext(res));
+ }
+ else {
+
+ total = 0;
+ for (;;) {
+ res = fs_read(fsctx,filectx,buffer,sizeof(buffer));
+ if (res < 0) break;
+ total += res;
+ if (res != sizeof(buffer)) break;
+ xprintf(".");
+ }
+ if (res < 0) xprintf("read error %s\n",cfe_errortext(res));
+ else xprintf("Total bytes read: %d\n",total);
+ fs_close(fsctx,filectx);
+ }
+ }
+
+ fs_uninit(fsctx);
+ return 0;
+}
+
+static int ui_cmd_copydisk(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char *fname;
+ fileio_ctx_t *fsctx;
+ void *filectx;
+ char *devname;
+ uint8_t buffer[1024];
+ int fh;
+ int res;
+ int total;
+ int count;
+ int offset;
+ char *toffset;
+
+ fname = cmd_getarg(cmd,0);
+ if (!fname) return ui_showusage(cmd);
+
+ devname = cmd_getarg(cmd,1);
+ if (!devname) return ui_showusage(cmd);
+
+ toffset = cmd_getarg(cmd,2);
+ if (!toffset) offset = 0; else offset = atoi(toffset);
+
+ if ((cfe_getdevinfo(devname) & CFE_DEV_MASK) != CFE_DEV_DISK) {
+ xprintf("Device %s is not a disk.\n",devname);
+ return CFE_ERR_INV_PARAM;
+ }
+
+ fh = cfe_open(devname);
+ if (fh < 0) {
+ return ui_showerror(fh,"Could not open device %s",devname);
+ }
+
+ res = fs_init("tftp",&fsctx,"");
+ if (res < 0) {
+ return ui_showerror(res,"Could not init file system");
+ }
+
+ res = fs_open(fsctx,&filectx,fname,FILE_MODE_READ);
+ if (res < 0) {
+ return ui_showerror(res,"Could not open %s",fname);
+ }
+ else {
+ total = 0;
+ count = 0;
+ for (;;) {
+ res = fs_read(fsctx,filectx,buffer,sizeof(buffer));
+ if (res < 0) break;
+ if (res > 0) cfe_writeblk(fh,total+offset*512,buffer,res);
+ total += res;
+ if (res != sizeof(buffer)) break;
+ count++;
+ if (count == 256) {
+ xprintf(".");
+ count = 0;
+ }
+ }
+ if (res < 0) xprintf("read error %s\n",cfe_errortext(res));
+ else xprintf("Total bytes read: %d\n",total);
+ fs_close(fsctx,filectx);
+ }
+
+ fs_uninit(fsctx);
+ cfe_close(fh);
+ return 0;
+}
+
+static int ui_cmd_disktest(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int fh;
+ char *tok;
+ char *tok2;
+ char *tok3;
+ char *tok4;
+ cfe_offset_t offset;
+ uint64_t sectors;
+ int secsize;
+ long secnum = 0;
+ unsigned char buffer[2048];
+ int res;
+ int idx,idx2;
+ int count = 0;
+ uint8_t byte;
+ int secoffset = 0;
+
+ tok = cmd_getarg(cmd,0);
+ if (!tok) return -1;
+
+ tok2 = cmd_getarg(cmd,1);
+ tok3 = cmd_getarg(cmd,2);
+ tok4 = cmd_getarg(cmd,3);
+
+ fh = cfe_open(tok);
+ if (fh <= 0) {
+ xprintf("Could not open device: %s\n",cfe_errortext(fh));
+ return fh;
+ }
+
+ xprintf("device opened ok\n");
+
+ sectors = 0; secsize = 0;
+ cfe_ioctl(fh,IOCTL_BLOCK_GETTOTALBLOCKS,(uint8_t *) &sectors,sizeof(sectors),&res,0);
+ cfe_ioctl(fh,IOCTL_BLOCK_GETBLOCKSIZE,(uint8_t *) &secsize,sizeof(secsize),&res,0);
+ printf("Total sectors: %lld Sector size: %d\n",sectors,secsize);
+ if (secsize == 0) secsize = 512;
+ if (sectors == 0) sectors = 100000;
+
+ if (tok2) {
+ secnum = atoi(tok2);
+ offset = (cfe_offset_t) secnum * (cfe_offset_t) secsize;
+ if (cmd_sw_isset(cmd,"-w")) {
+ secoffset = atoi(tok3);
+ byte = (uint8_t) xtoq(tok4);
+ res = cfe_writeblk(fh,offset+secoffset,&byte,1);
+ if (res != 1) {
+ xprintf("Write failed\n");
+ return -1;
+ }
+ }
+ res = cfe_readblk(fh,offset,buffer,secsize);
+ if (res != secsize) {
+ xprintf("disk error: %d sector %d\n",res,secnum);
+ }
+ else {
+ for (idx = 0; idx < secsize; idx+=16) {
+ xprintf("%04X: ",idx);
+ for (idx2 = 0; idx2 < 16; idx2++) {
+ xprintf("%02X ",buffer[idx+idx2]);
+ }
+ for (idx2 = 0; idx2 < 16; idx2++) {
+ if ((buffer[idx+idx2] < 32) ||
+ (buffer[idx+idx2] > 127)) {
+ xprintf(".");
+ }
+ else {
+ xprintf("%c",buffer[idx+idx2]);
+ }
+ }
+ xprintf("\n");
+ }
+ }
+ }
+ else {
+ if (cmd_sw_isset(cmd,"-random")) {
+ while (!console_status()) {
+ secnum++;
+ secnum = rand() % sectors;
+ offset = (cfe_offset_t) secnum * (cfe_offset_t) secsize;
+ res = cfe_readblk(fh,offset,buffer,secsize);
+ if (res != secsize) {
+ xprintf("disk error: %d sector %d\n",res,secnum);
+ break;
+ }
+ count++;
+ if ((count % 1000) == 0) xprintf("%d ",count);
+ }
+ }
+ }
+
+ cfe_close(fh);
+
+ return 0;
+}
+
+
+
diff --git a/cfe/cfe/ui/ui_test_ether.c b/cfe/cfe/ui/ui_test_ether.c
new file mode 100644
index 0000000..9a0b328
--- /dev/null
+++ b/cfe/cfe/ui/ui_test_ether.c
@@ -0,0 +1,202 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Ethernet test commands File: ui_test_ether.c
+ *
+ * User interface commands to test Ethernet devices
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "cfe_error.h"
+#include "cfe_ioctl.h"
+#include "cfe_devfuncs.h"
+#include "ui_command.h"
+#include "cfe.h"
+
+typedef struct netparam_s {
+ const char *str;
+ int num;
+} netparam_t;
+
+const static netparam_t speedtypes[] = {
+ {"auto",ETHER_SPEED_AUTO},
+ {"10hdx",ETHER_SPEED_10HDX},
+ {"10fdx",ETHER_SPEED_10FDX},
+ {"100hdx",ETHER_SPEED_100HDX},
+ {"100fdx",ETHER_SPEED_100FDX},
+ {"1000hdx",ETHER_SPEED_1000HDX},
+ {"1000fdx",ETHER_SPEED_1000FDX},
+ {0,NULL}};
+
+
+int ui_init_ethertestcmds(void);
+
+static int ui_cmd_ethertest(ui_cmdline_t *cmd,int argc,char *argv[]);
+
+int ui_init_ethertestcmds(void)
+{
+ cmd_addcmd("test ether",
+ ui_cmd_ethertest,
+ NULL,
+ "Do an ethernet test, reading packets from the net",
+ "test ether device-name",
+ "-speed=*;Specify speed|"
+ "-q;Be quiet|"
+ "-send=*;Transmit packets"
+ );
+
+ return 0;
+}
+
+
+static int ui_ifconfig_lookup(char *name,char *val,const netparam_t *list)
+{
+ const netparam_t *p = list;
+
+ while (p->str) {
+ if (strcmp(p->str,val) == 0) return p->num;
+ p++;
+ }
+
+ xprintf("Invalid parameter for %s: Valid options are: ");
+
+ p = list;
+ while (p->str) {
+ xprintf("%s ",p->str);
+ p++;
+ }
+
+ xprintf("\n");
+ return -1;
+}
+
+static int ui_cmd_ethertest(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char *tok;
+ int fh;
+ uint8_t packet[2048];
+ int res;
+ int idx;
+ int speed = ETHER_SPEED_AUTO;
+ char *x;
+ int count = 0;
+ int quiet;
+
+ tok = cmd_getarg(cmd,0);
+ if (!tok) return -1;
+
+ if (cmd_sw_value(cmd,"-speed",&x)) {
+ speed = ui_ifconfig_lookup("-speed",x,speedtypes);
+ if (speed < 0) return CFE_ERR_INV_PARAM;
+ }
+
+ quiet = cmd_sw_isset(cmd,"-q");
+
+
+ fh = cfe_open(tok);
+ if (fh < 0) {
+ xprintf("Could not open device: %s\n",cfe_errortext(fh));
+ return fh;
+ }
+
+ if (speed != ETHER_SPEED_AUTO) {
+ xprintf("Setting speed to %d...\n",speed);
+ cfe_ioctl(fh,IOCTL_ETHER_SETSPEED,(uint8_t *) &speed,sizeof(speed),&idx,0);
+ }
+
+
+ if (cmd_sw_value(cmd,"-send",&x)) {
+ count = atoi(x);
+ memset(packet,0xEE,sizeof(packet));
+ memcpy(packet,"\xFF\xFF\xFF\xFF\xFF\xFF\x40\x00\x00\x10\x00\x00\x12\x34",16);
+ res = 0;
+ for (idx = 0; idx < count; idx++) {
+ res = cfe_write(fh,packet,128);
+ if (res < 0) break;
+ }
+ if (res) {
+ ui_showerror(res,"Could not transmit packet");
+ }
+ cfe_close(fh);
+ return 0;
+ }
+
+ xprintf("Receiving... press enter to stop\n");
+ while (!console_status()) {
+ res = cfe_read(fh,packet,sizeof(packet));
+ if (res == 0) continue;
+ if (res < 0) {
+ xprintf("Read error: %s\n",cfe_errortext(res));
+ break;
+ }
+
+ if (!quiet) {
+ xprintf("%4d ",res);
+ if (res > 32) res = 32;
+
+ for (idx = 0; idx < res; idx++) {
+ xprintf("%02X",packet[idx]);
+ if ((idx == 5) || (idx == 11) || (idx == 13)) xprintf(" ");
+ }
+
+ xprintf("\n");
+ }
+
+ count++;
+ if (quiet && !(count % 1000)) printf(".");
+ }
+
+ printf("Total packets received: %d\n",count);
+
+ cfe_close(fh);
+
+ return 0;
+}
+
diff --git a/cfe/cfe/ui/ui_test_flash.c b/cfe/cfe/ui/ui_test_flash.c
new file mode 100644
index 0000000..841d3fa
--- /dev/null
+++ b/cfe/cfe/ui/ui_test_flash.c
@@ -0,0 +1,260 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Flash Test commands File: ui_test_flash.c
+ *
+ * Some commands to test the flash device interface.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "cfe_devfuncs.h"
+#include "cfe_timer.h"
+#include "cfe_ioctl.h"
+
+#include "cfe_error.h"
+
+#include "ui_command.h"
+
+int ui_init_flashtestcmds(void);
+
+static int ui_cmd_flashtest(ui_cmdline_t *cmd,int argc,char *argv[]);
+//static int ui_cmd_readnvram(ui_cmdline_t *cmd,int argc,char *argv[]);
+//static int ui_cmd_erasenvram(ui_cmdline_t *cmd,int argc,char *argv[]);
+
+int ui_init_flashtestcmds(void)
+{
+ cmd_addcmd("show flash",
+ ui_cmd_flashtest,
+ NULL,
+ "Display information about a flash device.",
+ "show flash [-sectors]",
+ "-sectors;Display sector information");
+
+#if 0
+ cmd_addcmd("nvram read",
+ ui_cmd_readnvram,
+ NULL,
+ "read the NVRAM",
+ "test nvram devname offset",
+ "");
+
+ cmd_addcmd("nvram erase",
+ ui_cmd_erasenvram,
+ NULL,
+ "erase the NVRAM",
+ "erasenvram devname",
+ "-pattern");
+#endif
+
+
+ return 0;
+}
+
+
+static char *flashtypes[] = {
+ "Unknown","SRAM","ROM","Flash"
+};
+
+
+static int ui_cmd_flashtest(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ flash_info_t info;
+ int fd;
+ int retlen;
+ int res = 0;
+ int idx;
+ flash_sector_t sector;
+ nvram_info_t nvraminfo;
+ char *devname;
+ int showsectors;
+
+ devname = cmd_getarg(cmd,0);
+ if (!devname) return ui_showusage(cmd);
+
+ showsectors = cmd_sw_isset(cmd,"-sectors");
+
+ fd = cfe_open(devname);
+ if (fd < 0) {
+ ui_showerror(fd,"Could not open flash device %s",devname);
+ return fd;
+ }
+
+ res = cfe_ioctl(fd,IOCTL_FLASH_GETINFO,(uint8_t *) &info,sizeof(flash_info_t),&retlen,0);
+ if (res == 0) {
+ printf("FLASH: Base %016llX size %08X type %02X(%s) flags %08X\n",
+ info.flash_base,info.flash_size,info.flash_type,flashtypes[info.flash_type],
+ info.flash_flags);
+ }
+ else {
+ printf("FLASH: Could not determine flash information\n");
+ }
+
+ res = cfe_ioctl(fd,IOCTL_NVRAM_GETINFO,(uint8_t *) &nvraminfo,sizeof(nvram_info_t),&retlen,0);
+ if (res == 0) {
+ printf("NVRAM: Offset %08X Size %08X EraseFlg %d\n",
+ nvraminfo.nvram_offset,nvraminfo.nvram_size,nvraminfo.nvram_eraseflg);
+ }
+ else {
+ printf("NVRAM: Not supported by this flash\n");
+ }
+
+ if (showsectors && (info.flash_type == FLASH_TYPE_FLASH)) {
+ printf("Flash sector information:\n");
+
+ idx = 0;
+ for (;;) {
+ sector.flash_sector_idx = idx;
+ res = cfe_ioctl(fd,IOCTL_FLASH_GETSECTORS,(uint8_t *) &sector,sizeof(flash_sector_t),&retlen,0);
+ if (res != 0) {
+ printf("ioctl error\n");
+ break;
+ }
+ if (sector.flash_sector_status == FLASH_SECTOR_INVALID) break;
+ printf(" Sector %d offset %08X size %d\n",
+ sector.flash_sector_idx,
+ sector.flash_sector_offset,
+ sector.flash_sector_size);
+ idx++;
+ }
+ }
+
+ cfe_close(fd);
+ return 0;
+
+}
+
+
+#if 0
+static int ui_cmd_readnvram(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char *dev;
+ char *tok;
+ int fd;
+ int offset = 0;
+ int res;
+ uint8_t buf[512];
+ int idx;
+
+ dev = cmd_getarg(cmd,0);
+ if (!dev) return ui_showusage(cmd);
+
+ tok = cmd_getarg(cmd,1);
+ if (tok) offset = xtoi(tok);
+ else offset = 0;
+
+ fd = cfe_open(dev);
+ if (fd < 0) {
+ ui_showerror(fd,"could not open NVRAM");
+ return fd;
+ }
+
+ res = cfe_readblk(fd,offset,buf,512);
+ printf("Offset %d Result %d\n",offset,res);
+ for (idx = 0; idx < 512; idx++) {
+ if ((idx % 16) == 0) printf("\n");
+ printf("%02X ",buf[idx]);
+ }
+ printf("\n");
+
+ cfe_close(fd);
+ return 0;
+
+}
+
+static int ui_cmd_erasenvram(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char *dev;
+ int fd;
+ uint8_t buffer[2048];
+ int res;
+ char *tok;
+ int offset;
+ int length;
+ uint8_t data;
+
+ dev = cmd_getarg(cmd,0);
+ if (!dev) return ui_showusage(cmd);
+
+ offset = 0;
+ if ((tok = cmd_getarg(cmd,1))) offset = xtoi(tok);
+ length = 512;
+
+ if ((tok = cmd_getarg(cmd,2))) length = xtoi(tok);
+ if (length > 2048) length = 2048;
+
+ data = 0xFF;
+ if ((tok = cmd_getarg(cmd,3))) data = xtoi(tok);
+
+ fd = cfe_open(dev);
+ if (fd < 0) {
+ ui_showerror(fd,"could not open NVRAM");
+ return fd;
+ }
+
+ if (cmd_sw_isset(cmd,"-pattern")) {
+ memset(buffer,0,sizeof(buffer));
+ for (res = 0; res < 2048; res++) {
+ buffer[res] = res & 0xFF;
+ }
+ }
+ else memset(buffer,data,sizeof(buffer));
+
+ printf("Fill offset %04X length %04X\n",offset,length);
+
+ res = cfe_writeblk(fd,offset,buffer,length);
+
+ printf("write returned %d\n",res);
+
+ cfe_close(fd);
+ return 0;
+
+}
+#endif
+
diff --git a/cfe/cfe/ui/ui_test_uart.c b/cfe/cfe/ui/ui_test_uart.c
new file mode 100644
index 0000000..3eeaef0
--- /dev/null
+++ b/cfe/cfe/ui/ui_test_uart.c
@@ -0,0 +1,117 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * UART Test commands File: ui_test_uart.c
+ *
+ * Some commands to test the uart device interface.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "cfe_devfuncs.h"
+#include "cfe_timer.h"
+#include "cfe_ioctl.h"
+
+#include "cfe_error.h"
+
+#include "ui_command.h"
+
+int ui_init_uarttestcmds(void);
+
+static int ui_cmd_uarttest(ui_cmdline_t *cmd,int argc,char *argv[]);
+
+int ui_init_uarttestcmds(void)
+{
+ cmd_addcmd("test uart",
+ ui_cmd_uarttest,
+ NULL,
+ "Echo characters to a UART",
+ "test uart [devname]",
+ "");
+ return 0;
+}
+
+
+static int ui_cmd_uarttest(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int fd;
+ char *x;
+ char ch;
+ int res;
+ char buffer[64];
+
+ x = cmd_getarg(cmd,0);
+ if (!x) return ui_showusage(cmd);
+
+ fd = cfe_open(x);
+ if (fd < 0) {
+ ui_showerror(fd,"could not open %s",x);
+ return fd;
+ }
+
+ printf("Device open. Stuff you type here goes there. Type ~ to exit.\n");
+ for (;;) {
+ if (console_status()) {
+ console_read(&ch,1);
+ res = cfe_write(fd,&ch,1);
+ if (res < 0) break;
+ if (ch == '~') break;
+ }
+ if (cfe_inpstat(fd)) {
+ res = cfe_read(fd,buffer,sizeof(buffer));
+ if (res > 0) console_write(buffer,res);
+ if (res < 0) break;
+ }
+ POLL();
+ }
+
+ cfe_close(fd);
+ return 0;
+}
+
diff --git a/cfe/cfe/ui/ui_tftpd.c b/cfe/cfe/ui/ui_tftpd.c
new file mode 100755
index 0000000..6cd2e4e
--- /dev/null
+++ b/cfe/cfe/ui/ui_tftpd.c
@@ -0,0 +1,119 @@
+/***************************************************************************
+***
+*** Copyright 2005 Hon Hai Precision Ind. Co. Ltd.
+*** All Rights Reserved.
+*** No portions of this material shall be reproduced in any form without the
+*** written permission of Hon Hai Precision Ind. Co. Ltd.
+***
+*** All information contained in this document is Hon Hai Precision Ind.
+*** Co. Ltd. company private, proprietary, and trade secret property and
+*** are protected by international intellectual property laws and treaties.
+***
+****************************************************************************/
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_devfuncs.h"
+#include "cfe_ioctl.h"
+#include "cfe_timer.h"
+#include "cfe_error.h"
+
+#include "ui_command.h"
+#include "cfe.h"
+
+#include "cfe_fileops.h"
+#include "cfe_boot.h"
+#include "bsp_config.h"
+
+#include "cfe_loader.h"
+
+#include "net_ebuf.h"
+#include "net_ether.h"
+#include "net_api.h"
+
+#include "cfe_flashimage.h"
+
+#include "addrspace.h"
+#include "initdata.h"
+#include "url.h"
+
+#include "tftpd.h"
+
+int ui_init_tftpdcmds(void);
+
+static int tftpd_state = TFTPD_STATE_OFF;
+
+extern int tftp_recv_timeout;
+
+int get_tftpd_state(void)
+{
+ return tftpd_state;
+}
+
+int set_tftpd_state(int state)
+{
+ tftpd_state = state;
+ return 0;
+}
+
+static int ui_cmd_tftpd(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int ret;
+
+ xprintf("enter ui_cmd_tftpd \n");
+
+ if( (argc==1) && strcmp(argv[0], "nmrp") == 0 )
+ {
+ xprintf("Start TFTP server for nmrp \n");
+ ret = ui_docommand("flashimage nmrp");
+ if (ret == CFE_ERR_TIMEOUT || ret == CFE_ERR_BADIMAGE || ret == CFE_ERR_IOERR || (ret == -24))
+ {
+ //printf("Upgrade image failed!\n");
+ return -1;
+ }
+ else
+ {
+ //printf("Upgrade image success!\n");
+ return 0;
+ }
+
+
+ }
+ else
+ {
+ xprintf("Start TFTP server\n");
+ /* Extend the TFTP server timeout */
+ tftp_recv_timeout = 99999;
+
+ while (1)
+ {
+ /* Foxconn modified start pling 12/04/2008 */
+ //ret = ui_docommand("flash -writechksum : flash1.trx");
+ ret = ui_docommand("flashimage :");
+ /* Foxconn modified end pling 12/04/2008 */
+ if (ret == CFE_ERR_TIMEOUT || ret == CFE_ERR_BADIMAGE || ret == CFE_ERR_IOERR)
+ continue;
+ else
+ break;
+ }
+ ui_docommand("reset");
+ return 0;
+ }
+
+}
+int ui_init_tftpdcmds(void)
+{
+ cmd_addcmd("tftpd",
+ ui_cmd_tftpd,
+ NULL,
+ "Start TFTP server",
+ "tftpd",
+ "");
+
+ return 0;
+}
diff --git a/cfe/cfe/ui/ui_toyclock.c b/cfe/cfe/ui/ui_toyclock.c
new file mode 100644
index 0000000..7fdcf49
--- /dev/null
+++ b/cfe/cfe/ui/ui_toyclock.c
@@ -0,0 +1,275 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * SWARM toy clock commands File: ui_toyclock.c
+ *
+ * time-of-year clock
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_devfuncs.h"
+#include "cfe_ioctl.h"
+#include "cfe_timer.h"
+#include "cfe_error.h"
+
+#include "ui_command.h"
+#include "cfe.h"
+
+#include "bsp_config.h"
+
+/* *********************************************************************
+ * prototypes
+ ********************************************************************* */
+
+int ui_init_toyclockcmds(void);
+
+static int ui_cmd_showtime(ui_cmdline_t *cmd,int argc,char *argv[]);
+static int ui_cmd_settime(ui_cmdline_t *cmd,int argc,char *argv[]);
+static int ui_cmd_setdate(ui_cmdline_t *cmd,int argc,char *argv[]);
+
+/* *********************************************************************
+ * ui_init_toyclockcmds()
+ *
+ * Add toy clock commands to the command table
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+int ui_init_toyclockcmds(void)
+{
+
+ cmd_addcmd("show time",
+ ui_cmd_showtime,
+ NULL,
+ "Display current time according to RTC",
+ "show time",
+ "");
+
+ cmd_addcmd("set time",
+ ui_cmd_settime,
+ NULL,
+ "Set current time",
+ "set time hh:mm:ss",
+ "");
+
+ cmd_addcmd("set date",
+ ui_cmd_setdate,
+ NULL,
+ "Set current date",
+ "set date mm/dd/yyyy",
+ "");
+
+ return 0;
+}
+
+/* *********************************************************************
+ * User interface commands
+ ********************************************************************* */
+
+static int ui_cmd_settime(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char *line;
+ char *p;
+ int hr,min,sec;
+ int fd;
+ uint8_t buf[12];
+ int res=0;
+
+ if ((line = cmd_getarg(cmd,0)) == NULL) {
+ return ui_showusage(cmd);
+ }
+
+ /* convert colons to spaces for the gettoken routine */
+ while ((p = strchr(line,':'))) *p = ' ';
+
+ /* parse and check command-line args */
+ hr = -1; min = -1; sec = -1;
+
+ p = gettoken(&line);
+ if (p) hr = atoi(p);
+ p = gettoken(&line);
+ if (p) min = atoi(p);
+ p = gettoken(&line);
+ if (p) sec = atoi(p);
+
+ if ((hr < 0) || (hr > 23) ||
+ (min < 0) || (min >= 60) ||
+ (sec < 0) || (sec >= 60)) {
+ return ui_showusage(cmd);
+ }
+
+ /*
+ * hour-minute-second-month-day-year1-year2-(time/date flag)
+ * time/date flag (offset 7) is used to let device know what
+ * is being set.
+ */
+ buf[0] = hr;
+ buf[1] = min;
+ buf[2] = sec;
+ buf[7] = 0x00; /*SET_TIME = 0x00, SET_DATE = 0x01*/
+
+ fd = cfe_open("clock0");
+ if (fd < 0) {
+ ui_showerror(fd,"could not open clock device");
+ return fd;
+ }
+
+ res = cfe_write(fd,buf,8);
+ if (res < 0) {
+ ui_showerror(res,"could not set time");
+ }
+ cfe_close(fd);
+ return 0;
+}
+
+static int ui_cmd_setdate(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ char *line;
+ char *p;
+ int dt,mo,yr,y2k;
+ int fd;
+ uint8_t buf[12];
+ int res=0;
+
+ if ((line = cmd_getarg(cmd,0)) == NULL) {
+ return ui_showusage(cmd);
+ }
+
+ /* convert colons to spaces for the gettoken routine */
+
+ while ((p = strchr(line,'/'))) *p = ' ';
+
+ /* parse and check command-line args */
+
+ dt = -1; mo = -1; yr = -1;
+
+ p = gettoken(&line);
+ if (p) mo = atoi(p);
+ p = gettoken(&line);
+ if (p) dt = atoi(p);
+ p = gettoken(&line);
+ if (p) yr = atoi(p);
+
+ if ((mo <= 0) || (mo > 12) ||
+ (dt <= 0) || (dt > 31) ||
+ (yr < 1900) || (yr > 2099)) {
+ return ui_showusage(cmd);
+ }
+
+ y2k = (yr >= 2000) ? 0x20 : 0x19;
+ yr %= 100;
+
+ /*
+ * hour-minute-second-month-day-year1-year2-(time/date flag)
+ * time/date flag (offset 7) is used to let device know what
+ * is being set.
+ */
+ buf[3] = mo;
+ buf[4] = dt;
+ buf[5] = yr;
+ buf[6] = y2k;
+ buf[7] = 0x01; /*SET_TIME = 0x00, SET_DATE = 0x01*/
+
+ fd = cfe_open("clock0");
+ if (fd < 0) {
+ ui_showerror(fd,"could not open clock device");
+ return fd;
+ }
+
+ res = cfe_write(fd,buf,8);
+ if (res < 0) {
+ ui_showerror(res,"could not set date");
+ }
+
+ cfe_close(fd);
+ return 0;
+}
+
+
+static int ui_cmd_showtime(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ uint8_t hr,min,sec;
+ uint8_t mo,day,yr,y2k;
+ int res=0;
+ int fd;
+ uint8_t buf[12];
+
+ fd = cfe_open("clock0");
+ if (fd < 0) {
+ ui_showerror(fd,"could not open clock device");
+ return fd;
+ }
+ res = cfe_read(fd,buf,8);
+ if (res < 0) {
+ ui_showerror(res,"could not get time/date");
+ }
+ cfe_close(fd);
+
+ hr = buf[0];
+ min = buf[1];
+ sec = buf[2];
+ mo = buf[3];
+ day = buf[4];
+ yr = buf[5];
+ y2k = buf[6];
+
+ printf("Current date & time is: ");
+ printf("%02X/%02X/%02X%02X %02X:%02X:%02X\n",mo,day,y2k,yr,hr,min,sec);
+
+ return 0;
+}
+
+
+
+
+
+
+
diff --git a/cfe/cfe/ui/url.c b/cfe/cfe/ui/url.c
new file mode 100644
index 0000000..80dc7b0
--- /dev/null
+++ b/cfe/cfe/ui/url.c
@@ -0,0 +1,357 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Program and file loading URLs File: url.c
+ *
+ * Functions to process URLs for loading software.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions as
+ * they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. Neither the "Broadcom
+ * Corporation" name nor any trademark or logo of Broadcom
+ * Corporation may be used to endorse or promote products
+ * derived from this software without the prior written
+ * permission of Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "bsp_config.h"
+#include "cfe_loader.h"
+#include "cfe_autoboot.h"
+#include "cfe_iocb.h"
+#include "cfe_devfuncs.h"
+#include "cfe_fileops.h"
+#include "cfe_error.h"
+
+#include "net_ebuf.h"
+#include "net_ether.h"
+#include "net_api.h"
+
+#include "ui_command.h"
+
+#include "url.h"
+
+static long getaddr(char *str)
+{
+ /*
+ * hold on to your lunch, this is really, really bad!
+ * Make 64-bit addresses expressed as 8-digit numbers
+ * sign extend automagically. Saves typing, but is very
+ * gross. Not very portable, either.
+ */
+ int longaddr = 0;
+ long newaddr;
+
+ longaddr = strlen(str);
+ if (memcmp(str,"0x",2) == 0) longaddr -= 2;
+ longaddr = (longaddr > 8) ? 1 : 0;
+
+ if (longaddr) newaddr = (long) xtoq(str);
+ else newaddr = (long) xtoi(str);
+
+ return newaddr;
+}
+
+static int process_oldstyle(char *str,
+ ui_cmdline_t *cmd,
+ cfe_loadargs_t *la)
+{
+ char *file;
+ char *devname;
+ char *filesys = NULL;
+ char *loader = la->la_loader;
+ char *x;
+ int info;
+ char *colon;
+
+ colon = strchr(str,':');
+
+ if (!colon) {
+ return CFE_ERR_DEVNOTFOUND;
+ }
+
+ devname = str; /* will be used to check protocol later */
+ *colon = '\0';
+ file = colon + 1; /* Ugly, we might put the colon back! */
+
+ /*
+ * Try to determine the load protocol ("filesystem")
+ * first by using the command line, and
+ * if not that try to figure it out automagically
+ */
+
+ if (cmd_sw_isset(cmd,"-fatfs")) filesys = "fat";
+ if (cmd_sw_isset(cmd,"-tftp")) filesys = "tftp";
+ if (cmd_sw_isset(cmd,"-rawfs")) filesys = "raw";
+#if (CFG_TCP) && (CFG_HTTPFS)
+ if (cmd_sw_isset(cmd,"-http")) filesys = "http";
+#endif
+ if (cmd_sw_value(cmd,"-fs",&x)) filesys = x;
+
+ /*
+ * Automagic configuration
+ */
+
+ /*
+ * Determine the device type from the "host" name. If we look
+ * up the host name and it appears to be an invalid CFE device
+ * name, then it's probably a TFTP host name.
+ *
+ * This is where we guess based on the device type what
+ * sort of load method we're going to use.
+ */
+
+ info = devname ? cfe_getdevinfo(devname) : -1;
+ if (info >= 0) {
+ switch (info & CFE_DEV_MASK) {
+ case CFE_DEV_NETWORK:
+ if (!filesys) filesys = "tftp";
+ if (!loader) loader = "raw";
+ break;
+ case CFE_DEV_DISK:
+ if (!filesys) filesys = "raw";
+ if (!loader) loader = "raw";
+ break;
+ case CFE_DEV_FLASH:
+ if (!filesys) filesys = "raw";
+ if (!loader) loader = "raw";
+ break;
+ case CFE_DEV_SERIAL:
+ if (!filesys) filesys = "raw";
+ if (!loader) loader = "srec";
+ break;
+ default:
+ break;
+ }
+ la->la_device = devname;
+ la->la_filename = file;
+ }
+ else {
+ /*
+ * It's probably a network boot. Default to TFTP
+ * if not overridden
+ */
+#if CFG_NETWORK
+ la->la_device = (char *) net_getparam(NET_DEVNAME);
+#else
+ la->la_device = NULL;
+#endif
+ *colon = ':'; /* put the colon back */
+ la->la_filename = devname;
+ if (!filesys) filesys = "tftp";
+ if (!loader) loader = "raw";
+ }
+
+ /*
+ * Remember our file system and loader.
+ */
+
+ la->la_filesys = filesys;
+ la->la_loader = loader;
+
+ return 0;
+}
+
+
+#if CFG_URLS
+static int process_url(char *str,
+ ui_cmdline_t *cmd,
+ cfe_loadargs_t *la)
+{
+ char *p;
+ char *protocol;
+ int idx,len;
+ int network = 0;
+ const fileio_dispatch_t *fdisp;
+
+ /*
+ * All URLs have the string "://" in them somewhere
+ * If that's not there, try the old syntax.
+ */
+
+ len = strlen(str);
+ p = str;
+
+ for (idx = 0; idx < len-3; idx++) {
+ if (memcmp(p,"://",3) == 0) break;
+ p++;
+ }
+
+ if (idx == (len-3)) {
+ return process_oldstyle(str,cmd,la);
+ }
+
+ /*
+ * Break the string apart into protocol, host, file
+ */
+
+ protocol = str;
+ *p = '\0';
+ p += 3;
+
+ /*
+ * Determine if this is a network loader. If that is true,
+ * the meaning of the "device" field is different. Ugh.
+ */
+
+ fdisp = cfe_findfilesys(protocol);
+ if (fdisp && (fdisp->loadflags & FSYS_TYPE_NETWORK)) network = 1;
+
+ /*
+ * Depending on the protocol we parse the file name one of two ways:
+ *
+ * protocol://hostname/filename
+ *
+ * For network devices:
+ *
+ * the "device" is the current Ethernet device.
+ * The filename is the //hostname/filename from the URL.
+ *
+ * For non-network devices:
+ *
+ * The "device" is the CFE device name from the URL 'hostname' field
+ * The filename is from the URL filename field.
+ */
+
+ la->la_filesys = protocol;
+
+ if (network) {
+#if CFG_NETWORK
+ la->la_device = (char *) net_getparam(NET_DEVNAME);
+#else
+ la->la_device = NULL;
+#endif
+ la->la_filename = p;
+ }
+ else {
+ la->la_device = p;
+ p = strchr(p,'/');
+ if (p) {
+ *p++ = '\0';
+ la->la_filename = p;
+ }
+ else {
+ la->la_filename = NULL;
+ }
+ }
+
+ if (!la->la_loader) la->la_loader = "raw";
+
+ return 0;
+}
+#endif
+
+
+
+int ui_process_url(char *url,ui_cmdline_t *cmd,cfe_loadargs_t *la)
+{
+ int res;
+ char *x;
+
+ /*
+ * Skip leading whitespace
+ */
+
+ while (*url && ((*url == ' ') || (*url == '\t'))) url++;
+
+ /*
+ * Process command-line switches to determine the loader stack
+ */
+
+ la->la_loader = NULL;
+ if (cmd_sw_isset(cmd,"-elf")) la->la_loader = "elf";
+ if (cmd_sw_isset(cmd,"-srec")) la->la_loader = "srec";
+ if (cmd_sw_isset(cmd,"-raw")) la->la_loader = "raw";
+ if (cmd_sw_value(cmd,"-loader",&x)) la->la_loader = x;
+
+#if CFG_ZLIB
+ if (cmd_sw_isset(cmd,"-z")) {
+ la->la_flags |= LOADFLG_COMPRESSED;
+ }
+#endif
+
+ /*
+ * Parse the file name into its pieces.
+ */
+
+#if CFG_URLS
+ res = process_url(url,cmd,la);
+ if (res < 0) return res;
+#else
+ res = process_oldstyle(url,cmd,la);
+ if (res < 0) return res;
+#endif
+
+
+ /*
+ * This is used only by "boot" and "load" - to avoid this code
+ * don't include these switches in the command table.
+ */
+
+ if (cmd_sw_value(cmd,"-max",&x)) {
+ la->la_maxsize = atoi(x);
+ }
+
+ if (cmd_sw_value(cmd,"-addr",&x)) {
+ la->la_address = getaddr(x);
+ la->la_flags |= LOADFLG_SPECADDR;
+ }
+
+ if (cmd_sw_isset(cmd,"-noclose")) {
+ la->la_flags |= LOADFLG_NOCLOSE;
+ }
+
+#if 0
+ printf("--- Loader parameters:\n");
+ printf(" Filename = %s\n",la->la_filename);
+ printf(" Filesys = %s\n",la->la_filesys);
+ printf(" Device = %s\n",la->la_device);
+ printf(" Options = %s\n",la->la_options);
+ printf(" Loader = %s\n",la->la_loader);
+ printf(" Flags = %08X\n",la->la_flags);
+ printf(" address = %08X\n",la->la_address);
+ printf(" maxsize = %08X\n",la->la_maxsize);
+ printf(" entrypt = %08X\n",la->la_entrypt);
+#endif
+
+ return 0;
+}
+
+
+
diff --git a/cfe/cfe/ui/url.h b/cfe/cfe/ui/url.h
new file mode 100644
index 0000000..268c7f8
--- /dev/null
+++ b/cfe/cfe/ui/url.h
@@ -0,0 +1,52 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Program and file loading URLs File: url.h
+ *
+ * Functions to process URLs for loading software.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions as
+ * they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. Neither the "Broadcom
+ * Corporation" name nor any trademark or logo of Broadcom
+ * Corporation may be used to endorse or promote products
+ * derived from this software without the prior written
+ * permission of Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+#ifndef _URL_H_
+#define _URL_H_ 1
+
+int ui_process_url(char *URL, ui_cmdline_t *cmd,cfe_loadargs_t *la);
+
+#endif /* _URL_H_ */
diff --git a/cfe/cfe/usb/Makefile b/cfe/cfe/usb/Makefile
new file mode 100644
index 0000000..fa38870
--- /dev/null
+++ b/cfe/cfe/usb/Makefile
@@ -0,0 +1,8 @@
+
+#
+# Makefile for USB stuff
+#
+
+
+ALLOBJS += usbmain.o ohci.o usbd.o usbdevs.o usbhub.o usbdebug.o usbhid.o usbmass.o usbserial.o usbeth.o
+CFLAGS += -DCFG_USB=1
diff --git a/cfe/cfe/usb/README b/cfe/cfe/usb/README
new file mode 100644
index 0000000..28ac9bf
--- /dev/null
+++ b/cfe/cfe/usb/README
@@ -0,0 +1,183 @@
+
+------------------------------------------------------------------------
+This directory contains a basic description of the CFE USB stack,
+its current status and features, and what might be done in the
+future to improve it.
+------------------------------------------------------------------------
+
+Question: A USB stack in CFE? But why?
+
+Answer: Why not? It's not terribly useful on the BCM1250, since we
+ don't expect many of you to use USB in your boards, but there IS
+ a USB host controller on the SWARM (BCM1250 reference design).
+ Besides, CFE is actually being used for other non-SiByte
+ Broadcom chips, and some of those _do_ have USB on them.
+
+------------------------------------------------------------------------
+
+Source Files
+------------
+
+ohci.c OHCI USB Host Controller Driver, tested on a BCM1250
+ with an Opti FireLink PCI USB controller
+
+ohci.h Register definitions for ohci.c
+
+usbchap9.h USB "Chapter 9" definitions (Descriptors, etc.)
+
+usbd.c USB Basic Request and pipe management routines, to
+ manage usb devices, do simple requests on the
+ control pipe, open and manage pipes, etc.
+
+usbd.h Prototypes and data structures for usbd.c
+
+usbdevs.c USB Device Driver list - devices we recognize
+ are listed here - if you add a new USB device,
+ you can add its class or vendor ID entries
+ into the table here.
+
+usbdebug.c Some descriptor dump routines live here.
+
+usbhub.c Class driver for USB hubs. Because hubs are also
+ a major player in device discovery, much of the
+ USB device tree management also lives here.
+
+usbhid.c Class driver for keyboards and mice. Right now
+ not much is done with them except echo characters.
+
+usbmass.c Class driver for USB mass-storage devices. We only
+ support the "bulk-only-no-interrupt" protocol.
+ This driver also includes a top half so that
+ it can be accessed as a CFE mass-storage device.
+
+usbmain.c Top-level interface into CFE. The "usb start"
+ command is instantiated here, as well as a
+ "usb show" command to display attached USB devices.
+
+usbhack.c Main program for the test harness, which lets you
+ develop OHCI code under Linux without hacking on
+ either CFE or the kernel. See the comments in this
+ file for more information.
+
+usbhack.h A dumping ground for CFE definitions not otherwise
+ provided by the standard include files.
+
+usbhack.mk GNU makefile for the test harness
+
+------------------------------------------------------------------------
+
+Overview
+--------
+
+The host controller driver is abstracted through a small set of
+primitives defined in usbd.h - at present only the OHCI driver
+is implemented, but there will eventually be support for the
+ScanLogic SL11H part on the BCM1250CPCI board - this is a simple
+"generic-bus" (non-pci) host controller. I doubt we'll ever
+need EHCI/UHCI, since they are present mostly in Intel chipsets.
+
+All events are polled by this driver. There are two polling functions
+that should be called periodically:
+
+ usb_poll(usbbus_t *bus);
+ usb_daemon(usbbus_t *bus);
+
+The "poll" routine handles interrupts from the devices themselves.
+The "daemon" routine monitors the bus for topology changes and
+instantiates an exploration if something changes. Sometimes "daemon"
+needs to do USB I/O, requiring calls to usb_poll() to get the data
+to go in/out via the controller, hence the two routines. You should
+be careful not to all usb_poll() during polling.
+
+
+Device Drivers
+--------------
+
+USB Device drivers are currently extremely simple: There are
+only two methods that need be exported to the device driver table:
+
+attach() Called when the device is "discovered"
+detach() Called when the device is "removed"
+
+When a device is removed, pending transfer requests will be
+canceled with a "canceled" status.
+
+There is no standard for the top side (user API side) of the
+device driver, that is up to the device class. The bottom half
+should make use of the calls in usbd.c
+
+When a device driver is attached via its attach() method,
+it will be in the "addressed" state according to the USB spec.
+The exploration code takes care of assigning the USB address
+to the device. Devices not otherwise recognized by this code will
+be left in the addressed state without any active configurations.
+
+The descriptors are read by the exploration code and are made
+available to the usb_find_cfg_descr() call - you can use this
+function to obtain the endpoint and interface descriptors for
+your device and then call usb_set_configuration() to activate
+the configuration.
+
+When your detach() method is called, the device should be considered
+already gone, so do not attempt to do any I/O to it. Just clean
+up the mess and return.
+
+
+------------------------------------------------------------------------
+
+What works?
+-----------
+
+* OHCI on a BCM1250 via the Opti Firelink USB controller
+
+* The OHCI root hub emulation
+
+* External hubs, and hubs integrated into other devices like
+ keyboards.
+
+* Interrupt transfers
+
+* Transfers (basic requests) on endpoint 0
+
+* Basic device discovery and removal
+
+* Bulk endpoints and transfers
+
+* Some endpoint stalls are handled.
+
+
+------------------------------------------------------------------------
+
+What doesn't work? What is not implemented?
+--------------------------------------------
+
+* The root hub implementation is really shaky, especially in
+ matters of plug-and-play (device insertion/removal events,
+ etc.) Don't be surprised if removing a device from the
+ root hub causes CFE to freeze.
+
+* There is no error recovery code whatsoever. This kind of goes
+ with the above root hub issue.
+
+* Noncoherent DMA is relatively untested.
+
+* Isochronous endpoints are completely unimplemented (and will probably
+ remain that way)
+
+* Power management (for example, power budget in hubs) is unimplemented.
+ (this should be easy)
+
+* Interrupt endpoints are all on the 10ms endpoint in the interrupt
+ tree (endpoints should be placed at the location to guarantee
+ bandwidth at 'bInterval' ms) - no bandwidth management is being
+ done at the moment, but this is pretty simple.
+
+* The OHCI driver cannot be stopped/unloaded.
+
+
+
+
+
+
+
+
diff --git a/cfe/cfe/usb/ohci.c b/cfe/cfe/usb/ohci.c
new file mode 100644
index 0000000..c002091
--- /dev/null
+++ b/cfe/cfe/usb/ohci.c
@@ -0,0 +1,2126 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * OHCI device driver File: ohci.c
+ *
+ * Open Host Controller Interface low-level routines
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#ifndef _CFE_
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdint.h>
+#include "usbhack.h"
+#define CPUCFG_COHERENT_DMA 1 /* hack runs on a PC, PCs are coherent */
+#else
+#include "lib_types.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "lib_physio.h"
+#include "addrspace.h"
+#include "cpu_config.h" /* for CPUCFG_COHERENT_DMA */
+#endif
+
+#include "lib_malloc.h"
+#include "lib_queue.h"
+#include "usbchap9.h"
+#include "usbd.h"
+#include "ohci.h"
+
+
+/* *********************************************************************
+ * Macros for dealing with hardware
+ *
+ * This is all yucky stuff that needs to be made more
+ * processor-independent. It's mostly here now to help us with
+ * our test harness.
+ ********************************************************************* */
+
+#if defined(_CFE_) && defined(__MIPSEB)
+#define BSWAP32(x) __swap32(x)
+static inline uint32_t __swap32(uint32_t x)
+{
+ uint32_t y;
+
+ y = ((x & 0xFF) << 24) |
+ ((x & 0xFF00) << 8) |
+ ((x & 0xFF0000) >> 8) |
+ ((x & 0xFF000000) >> 24);
+
+ return y;
+}
+#else
+#define BSWAP32(x) (x)
+#endif
+
+
+#ifndef _CFE_
+extern uint32_t vtop(void *ptr);
+extern void *ptov(uint32_t x);
+#define OHCI_VTOP(ptr) vtop(ptr)
+#define OHCI_PTOV(ptr) ptov(ptr)
+#define OHCI_WRITECSR(softc,x,y) \
+ *((volatile uint32_t *) ((softc)->ohci_regs + ((x)/sizeof(uint32_t)))) = (y)
+#define OHCI_READCSR(softc,x) \
+ *((volatile uint32_t *) ((softc)->ohci_regs + ((x)/sizeof(uint32_t))))
+#else
+#define OHCI_VTOP(ptr) ((uint32_t)PHYSADDR((long)(ptr)))
+
+#if CPUCFG_COHERENT_DMA
+#define OHCI_PTOV(ptr) ((void *)(KERNADDR(ptr)))
+#else
+#define OHCI_PTOV(ptr) ((void *)(UNCADDR(ptr)))
+#endif
+
+#define OHCI_WRITECSR(softc,x,y) \
+ phys_write32(((softc)->ohci_regs + (x)),(y))
+#define OHCI_READCSR(softc,x) \
+ phys_read32(((softc)->ohci_regs + (x)))
+#endif
+
+#if CPUCFG_COHERENT_DMA
+#define OHCI_INVAL_RANGE(s,l)
+#define OHCI_FLUSH_RANGE(s,l)
+#else /* not coherent */
+#define CFE_CACHE_INVAL_RANGE 32 /* XXX belongs in include file */
+#define CFE_CACHE_FLUSH_RANGE 64
+extern void _cfe_flushcache(int,uint8_t *,uint8_t *);
+#define OHCI_INVAL_RANGE(s,l) _cfe_flushcache(CFE_CACHE_INVAL_RANGE,((uint8_t *) (s)),((uint8_t *) (s))+(l))
+#define OHCI_FLUSH_RANGE(s,l) _cfe_flushcache(CFE_CACHE_FLUSH_RANGE,((uint8_t *) (s)),((uint8_t *) (s))+(l))
+#endif
+
+
+/* *********************************************************************
+ * Bit-reverse table - this table consists of the numbers
+ * at its index, listed in reverse. So, the reverse of 0000 0010
+ * is 0100 0000.
+ ********************************************************************* */
+
+const static int ohci_revbits[OHCI_INTTABLE_SIZE] = {
+ 0x00, 0x10, 0x08, 0x18, 0x04, 0x14, 0x0c, 0x1c,
+ 0x02, 0x12, 0x0a, 0x1a, 0x06, 0x16, 0x0e, 0x1e,
+ 0x01, 0x11, 0x09, 0x19, 0x05, 0x15, 0x0d, 0x1d,
+ 0x03, 0x13, 0x0b, 0x1b, 0x07, 0x17, 0x0f, 0x1f
+};
+
+
+/* *********************************************************************
+ * Macros to convert from "hardware" endpoint and transfer
+ * descriptors (ohci_ed_t, ohci_td_t) to "software"
+ * data structures (ohci_transfer_t, ohci_endpoint_t).
+ *
+ * Basically, there are two tables, indexed by the same value
+ * By subtracting the base of one pool from a pointer, we get
+ * the index into the other table.
+ *
+ * We *could* have included the ed and td in the software
+ * data structures, but placing all the hardware stuff in one
+ * pool will make it easier for hardware that does not handle
+ * coherent DMA, since we can be less careful about what we flush
+ * and what we invalidate.
+ ********************************************************************* */
+
+#define ohci_td_from_transfer(softc,transfer) \
+ ((softc)->ohci_hwtdpool + ((transfer) - (softc)->ohci_transfer_pool))
+
+#define ohci_transfer_from_td(softc,td) \
+ ((softc)->ohci_transfer_pool + ((td) - (softc)->ohci_hwtdpool))
+
+#define ohci_ed_from_endpoint(softc,endpoint) \
+ ((softc)->ohci_hwedpool + ((endpoint) - (softc)->ohci_endpoint_pool))
+
+#define ohci_endpoint_from_ed(softc,ed) \
+ ((softc)->ohci_endpoint_pool + ((ed) - (softc)->ohci_hwedpool))
+
+/* *********************************************************************
+ * Forward declarations
+ ********************************************************************* */
+
+static int ohci_roothub_xfer(usbbus_t *bus,usb_ept_t *uept,usbreq_t *ur);
+static void ohci_roothub_statchg(ohci_softc_t *softc);
+extern usb_hcdrv_t ohci_driver;
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+int ohcidebug = 0;
+void ohci_dumprhstat(uint32_t reg);
+void ohci_dumpportstat(int idx,uint32_t reg);
+void ohci_dumptd(ohci_td_t *td);
+void ohci_dumptdchain(ohci_td_t *td);
+void ohci_dumped(ohci_ed_t *ed);
+void ohci_dumpedchain(ohci_ed_t *ed);
+
+
+/* *********************************************************************
+ * Some debug routines
+ ********************************************************************* */
+
+#if 1
+void ohci_dumprhstat(uint32_t reg)
+{
+ printf("HubStatus: %08X ",reg);
+
+ if (reg & M_OHCI_RHSTATUS_LPS) printf("LocalPowerStatus ");
+ if (reg & M_OHCI_RHSTATUS_OCI) printf("OverCurrent ");
+ if (reg & M_OHCI_RHSTATUS_DRWE) printf("DeviceRemoteWakeupEnable ");
+ if (reg & M_OHCI_RHSTATUS_LPSC) printf("LocalPowerStatusChange ");
+ if (reg & M_OHCI_RHSTATUS_OCIC) printf("OverCurrentIndicatorChange ");
+ printf("\n");
+
+}
+
+void ohci_dumpportstat(int idx,uint32_t reg)
+{
+ printf("Port %d: %08X ",idx,reg);
+ if (reg & M_OHCI_RHPORTSTAT_CCS) printf("Connected ");
+ if (reg & M_OHCI_RHPORTSTAT_PES) printf("PortEnabled ");
+ if (reg & M_OHCI_RHPORTSTAT_PSS) printf("PortSuspended ");
+ if (reg & M_OHCI_RHPORTSTAT_POCI) printf("PortOverCurrent ");
+ if (reg & M_OHCI_RHPORTSTAT_PRS) printf("PortReset ");
+ if (reg & M_OHCI_RHPORTSTAT_PPS) printf("PortPowered ");
+ if (reg & M_OHCI_RHPORTSTAT_LSDA) printf("LowSpeed ");
+ if (reg & M_OHCI_RHPORTSTAT_CSC) printf("ConnectStatusChange ");
+ if (reg & M_OHCI_RHPORTSTAT_PESC) printf("PortEnableStatusChange ");
+ if (reg & M_OHCI_RHPORTSTAT_PSSC) printf("PortSuspendStatusChange ");
+ if (reg & M_OHCI_RHPORTSTAT_OCIC) printf("OverCurrentIndicatorChange ");
+ if (reg & M_OHCI_RHPORTSTAT_PRSC) printf("PortResetStatusChange ");
+ printf("\n");
+}
+
+void ohci_dumptd(ohci_td_t *td)
+{
+ uint32_t ctl;
+ static char *pids[4] = {"SETUP","OUT","IN","RSVD"};
+
+ ctl = BSWAP32(td->td_control);
+
+ printf("[%08X] ctl=%08X (DP=%s,DI=%d,T=%d,EC=%d,CC=%d%s) cbp=%08X be=%08X next=%08X\n",
+ OHCI_VTOP(td),
+ ctl,
+ pids[G_OHCI_TD_PID(ctl)],
+ G_OHCI_TD_DI(ctl),
+ G_OHCI_TD_DT(ctl),
+ G_OHCI_TD_EC(ctl),
+ G_OHCI_TD_CC(ctl),
+ (ctl & M_OHCI_TD_SHORTOK) ? ",R" : "",
+ BSWAP32(td->td_cbp),
+ BSWAP32(td->td_be),
+ BSWAP32(td->td_next_td));
+}
+
+void ohci_dumptdchain(ohci_td_t *td)
+{
+ int idx = 0;
+ for (;;) {
+ printf("%d:[%08X] ctl=%08X cbp=%08X be=%08X next=%08X\n",
+ idx,
+ OHCI_VTOP(td),
+ BSWAP32(td->td_control),
+ BSWAP32(td->td_cbp),
+ BSWAP32(td->td_be),
+ BSWAP32(td->td_next_td));
+ if (!td->td_next_td) break;
+ td = (ohci_td_t *) OHCI_PTOV(BSWAP32(td->td_next_td));
+ idx++;
+ }
+}
+
+void ohci_dumped(ohci_ed_t *ed)
+{
+ uint32_t ctl;
+ static char *pids[4] = {"FTD","OUT","IN","FTD"};
+
+ ctl = BSWAP32(ed->ed_control),
+
+ printf("[%08X] Ctl=%08X (MPS=%d%s%s%s,EN=%d,FA=%d,D=%s) Tailp=%08X headp=%08X next=%08X %s\n",
+ OHCI_VTOP(ed),
+ ctl,
+ G_OHCI_ED_MPS(ctl),
+ (ctl & M_OHCI_ED_LOWSPEED) ? ",LS" : "",
+ (ctl & M_OHCI_ED_SKIP) ? ",SKIP" : "",
+ (ctl & M_OHCI_ED_ISOCFMT) ? ",ISOC" : "",
+ G_OHCI_ED_EN(ctl),
+ G_OHCI_ED_FA(ctl),
+ pids[G_OHCI_ED_DIR(ctl)],
+ BSWAP32(ed->ed_tailp),
+ BSWAP32(ed->ed_headp),
+ BSWAP32(ed->ed_next_ed),
+ BSWAP32(ed->ed_headp) & M_OHCI_ED_HALT ? "HALT" : "");
+ if ((ed->ed_headp & M_OHCI_ED_PTRMASK) == 0) return;
+ ohci_dumptdchain(OHCI_PTOV(BSWAP32(ed->ed_headp) & M_OHCI_ED_PTRMASK));
+}
+
+void ohci_dumpedchain(ohci_ed_t *ed)
+{
+ int idx = 0;
+ for (;;) {
+ printf("---\nED#%d -> ",idx);
+ ohci_dumped(ed);
+ if (!ed->ed_next_ed) break;
+ if (idx > 50) break;
+ ed = (ohci_ed_t *) OHCI_PTOV(BSWAP32(ed->ed_next_ed));
+ idx++;
+ }
+}
+
+#endif
+
+
+static void eptstats(ohci_softc_t *softc)
+{
+ int cnt;
+ ohci_endpoint_t *e;
+ cnt = 0;
+
+ e = softc->ohci_endpoint_freelist;
+ while (e) { e = e->ep_next; cnt++; }
+ printf("%d left, %d inuse\n",cnt,OHCI_EDPOOL_SIZE-cnt);
+}
+
+/* *********************************************************************
+ * _ohci_allocept(softc)
+ *
+ * Allocate an endpoint data structure from the pool, and
+ * make it ready for use. The endpoint is NOT attached to
+ * the hardware at this time.
+ *
+ * Input parameters:
+ * softc - our OHCI controller
+ *
+ * Return value:
+ * pointer to endpoint or NULL
+ ********************************************************************* */
+
+static ohci_endpoint_t *_ohci_allocept(ohci_softc_t *softc)
+{
+ ohci_endpoint_t *e;
+ ohci_ed_t *ed;
+
+ if (ohcidebug > 2) {
+ printf("AllocEpt: ");eptstats(softc);
+ }
+
+ e = softc->ohci_endpoint_freelist;
+
+ if (!e) {
+ printf("No endpoints left!\n");
+ return NULL;
+ }
+
+ softc->ohci_endpoint_freelist = e->ep_next;
+
+ ed = ohci_ed_from_endpoint(softc,e);
+
+ ed->ed_control = BSWAP32(M_OHCI_ED_SKIP);
+ ed->ed_tailp = BSWAP32(0);
+ ed->ed_headp = BSWAP32(0);
+ ed->ed_next_ed = BSWAP32(0);
+
+ e->ep_phys = OHCI_VTOP(ed);
+ e->ep_next = NULL;
+
+ return e;
+}
+
+/* *********************************************************************
+ * _ohci_allocxfer(softc)
+ *
+ * Allocate a transfer descriptor. It is prepared for use
+ * but not attached to the hardware.
+ *
+ * Input parameters:
+ * softc - our OHCI controller
+ *
+ * Return value:
+ * transfer descriptor, or NULL
+ ********************************************************************* */
+
+static ohci_transfer_t *_ohci_allocxfer(ohci_softc_t *softc)
+{
+ ohci_transfer_t *t;
+ ohci_td_t *td;
+
+ if (ohcidebug > 2) {
+ int cnt;
+ cnt = 0;
+ t = softc->ohci_transfer_freelist;
+ while (t) { t = t->t_next; cnt++; }
+ printf("AllocXfer: %d left, %d inuse\n",cnt,OHCI_TDPOOL_SIZE-cnt);
+ }
+
+ t = softc->ohci_transfer_freelist;
+
+ if (!t) {
+ printf("No more transfer descriptors!\n");
+ return NULL;
+ }
+
+ softc->ohci_transfer_freelist = t->t_next;
+
+ td = ohci_td_from_transfer(softc,t);
+
+ td->td_control = BSWAP32(0);
+ td->td_cbp = BSWAP32(0);
+ td->td_next_td = BSWAP32(0);
+ td->td_be = BSWAP32(0);
+
+ t->t_ref = NULL;
+ t->t_next = NULL;
+
+ return t;
+}
+
+/* *********************************************************************
+ * _ohci_freeept(softc,e)
+ *
+ * Free an endpoint, returning it to the pool.
+ *
+ * Input parameters:
+ * softc - our OHCI controller
+ * e - endpoint descriptor to return
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void _ohci_freeept(ohci_softc_t *softc,ohci_endpoint_t *e)
+{
+ if (ohcidebug > 2) {
+ int cnt;
+ ohci_endpoint_t *ee;
+ cnt = 0;
+ ee = softc->ohci_endpoint_freelist;
+ while (ee) { ee = ee->ep_next; cnt++; }
+ printf("FreeEpt[%p]: %d left, %d inuse\n",e,cnt,OHCI_EDPOOL_SIZE-cnt);
+ }
+
+ e->ep_next = softc->ohci_endpoint_freelist;
+ softc->ohci_endpoint_freelist = e;
+}
+
+/* *********************************************************************
+ * _ohci_freexfer(softc,t)
+ *
+ * Free a transfer descriptor, returning it to the pool.
+ *
+ * Input parameters:
+ * softc - our OHCI controller
+ * t - transfer descriptor to return
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void _ohci_freexfer(ohci_softc_t *softc,ohci_transfer_t *t)
+{
+ t->t_next = softc->ohci_transfer_freelist;
+ softc->ohci_transfer_freelist = t;
+}
+
+/* *********************************************************************
+ * _ohci_initpools(softc)
+ *
+ * Allocate and initialize the various pools of things that
+ * we use in the OHCI driver. We do this by allocating some
+ * big chunks from the heap and carving them up.
+ *
+ * Input parameters:
+ * softc - our OHCI controller
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int _ohci_initpools(ohci_softc_t *softc)
+{
+ int idx;
+
+ /*
+ * Do the transfer descriptor pool
+ */
+
+ softc->ohci_transfer_pool = KMALLOC(OHCI_TDPOOL_SIZE*sizeof(ohci_transfer_t),0);
+ softc->ohci_hwtdpool = KMALLOC(OHCI_TDPOOL_SIZE*sizeof(ohci_td_t),OHCI_TD_ALIGN);
+
+ /*
+ * In the case of noncoherent DMA, make these uncached addresses.
+ * This way all our descriptors will be uncached. Makes life easier, as we
+ * do not need to worry about flushing descriptors, etc.
+ */
+
+#if (!CPUCFG_COHERENT_DMA)
+ softc->ohci_hwtdpool = (void *) UNCADDR(PHYSADDR((uint32_t)(softc->ohci_hwtdpool)));
+#endif
+
+ if (!softc->ohci_transfer_pool || !softc->ohci_hwtdpool) {
+ printf("Could not allocate transfer descriptors\n");
+ return -1;
+ }
+
+ softc->ohci_transfer_freelist = NULL;
+
+ for (idx = 0; idx < OHCI_TDPOOL_SIZE; idx++) {
+ _ohci_freexfer(softc,softc->ohci_transfer_pool+idx);
+ }
+
+ /*
+ * Do the endpoint descriptor pool
+ */
+
+ softc->ohci_endpoint_pool = KMALLOC(OHCI_EDPOOL_SIZE*sizeof(ohci_endpoint_t),0);
+
+ softc->ohci_hwedpool = KMALLOC(OHCI_EDPOOL_SIZE*sizeof(ohci_ed_t),OHCI_ED_ALIGN);
+
+#if (!CPUCFG_COHERENT_DMA)
+ softc->ohci_hwedpool = (void *) UNCADDR(PHYSADDR((uint32_t)(softc->ohci_hwedpool)));
+#endif
+
+ if (!softc->ohci_endpoint_pool || !softc->ohci_hwedpool) {
+ printf("Could not allocate transfer descriptors\n");
+ return -1;
+ }
+
+ softc->ohci_endpoint_freelist = NULL;
+
+ for (idx = 0; idx < OHCI_EDPOOL_SIZE; idx++) {
+ _ohci_freeept(softc,softc->ohci_endpoint_pool+idx);
+ }
+
+ /*
+ * Finally the host communications area
+ */
+
+ softc->ohci_hcca = KMALLOC(sizeof(ohci_hcca_t),sizeof(ohci_hcca_t));
+
+#if (!CPUCFG_COHERENT_DMA)
+ softc->ohci_hcca = (void *) UNCADDR(PHYSADDR((uint32_t)(softc->ohci_hcca)));
+#endif
+
+ memset(softc->ohci_hcca,0,sizeof(ohci_hcca_t));
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * ohci_start(bus)
+ *
+ * Start the OHCI controller. After this routine is called,
+ * the hardware will be operational and ready to accept
+ * descriptors and interrupt calls.
+ *
+ * Input parameters:
+ * bus - bus structure, from ohci_create
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int ohci_start(usbbus_t *bus)
+{
+ ohci_softc_t *softc = (ohci_softc_t *) bus->ub_hwsoftc;
+ uint32_t frameint;
+ uint32_t reg;
+ int idx;
+
+ /*
+ * Force a reset to the controller, followed by a short delay
+ */
+
+ OHCI_WRITECSR(softc,R_OHCI_CONTROL,V_OHCI_CONTROL_HCFS(K_OHCI_HCFS_RESET));
+ usb_delay_ms(bus,OHCI_RESET_DELAY);
+
+ /* Host controller state is now "RESET" */
+
+ /*
+ * We need the frame interval later, so get a copy of it now.
+ */
+ frameint = G_OHCI_FMINTERVAL_FI(OHCI_READCSR(softc,R_OHCI_FMINTERVAL));
+
+ /*
+ * Reset the host controller. When you set the HCR bit
+ * if self-clears when the reset is complete.
+ */
+
+ OHCI_WRITECSR(softc,R_OHCI_CMDSTATUS,M_OHCI_CMDSTATUS_HCR);
+ for (idx = 0; idx < 10000; idx++) {
+ if (!(OHCI_READCSR(softc,R_OHCI_CMDSTATUS) & M_OHCI_CMDSTATUS_HCR)) break;
+ }
+
+ if (OHCI_READCSR(softc,R_OHCI_CMDSTATUS) & M_OHCI_CMDSTATUS_HCR) {
+ /* controller never came out of reset */
+ return -1;
+ }
+
+ /*
+ * Host controller state is now "SUSPEND". We must exit
+ * from this state within 2ms. (5.1.1.4)
+ *
+ * Set up pointers to data structures.
+ */
+
+ OHCI_WRITECSR(softc,R_OHCI_HCCA,OHCI_VTOP(softc->ohci_hcca));
+ OHCI_WRITECSR(softc,R_OHCI_CONTROLHEADED,softc->ohci_ctl_list->ep_phys);
+ OHCI_WRITECSR(softc,R_OHCI_BULKHEADED,softc->ohci_bulk_list->ep_phys);
+
+ /*
+ * Our driver is polled, turn off interrupts
+ */
+
+ OHCI_WRITECSR(softc,R_OHCI_INTDISABLE,M_OHCI_INT_ALL);
+
+ /*
+ * Set up the control register.
+ */
+
+ reg = OHCI_READCSR(softc,R_OHCI_CONTROL);
+
+ reg = M_OHCI_CONTROL_PLE | M_OHCI_CONTROL_CLE | M_OHCI_CONTROL_BLE |
+ M_OHCI_CONTROL_IE |
+ V_OHCI_CONTROL_CBSR(K_OHCI_CBSR_41) |
+ V_OHCI_CONTROL_HCFS(K_OHCI_HCFS_OPERATIONAL);
+
+ OHCI_WRITECSR(softc,R_OHCI_CONTROL,reg);
+
+
+ /*
+ * controller state is now OPERATIONAL
+ */
+
+ reg = OHCI_READCSR(softc,R_OHCI_FMINTERVAL);
+ reg &= M_OHCI_FMINTERVAL_FIT;
+ reg ^= M_OHCI_FMINTERVAL_FIT;
+ reg |= V_OHCI_FMINTERVAL_FSMPS(OHCI_CALC_FSMPS(frameint)) |
+ V_OHCI_FMINTERVAL_FI(frameint);
+ OHCI_WRITECSR(softc,R_OHCI_FMINTERVAL,reg);
+
+ reg = frameint * 9 / 10; /* calculate 90% */
+ OHCI_WRITECSR(softc,R_OHCI_PERIODICSTART,reg);
+
+ usb_delay_ms(softc->ohci_bus,10);
+
+ /*
+ * Remember how many ports we have
+ */
+
+ reg = OHCI_READCSR(softc,R_OHCI_RHDSCRA);
+ softc->ohci_ndp = G_OHCI_RHDSCRA_NDP(reg);
+
+
+ /*
+ * Enable port power
+ */
+
+ OHCI_WRITECSR(softc,R_OHCI_RHSTATUS,M_OHCI_RHSTATUS_LPSC);
+ usb_delay_ms(softc->ohci_bus,10);
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * _ohci_setupepts(softc)
+ *
+ * Set up the endpoint tree, as described in the OHCI manual.
+ * Basically the hardware knows how to scan lists of lists,
+ * so we build a tree where each level is pointed to by two
+ * parent nodes. We can choose our scanning rate by attaching
+ * endpoints anywhere within this tree.
+ *
+ * Input parameters:
+ * softc - our OHCI controller
+ *
+ * Return value:
+ * 0 if ok
+ * else error (out of descriptors)
+ ********************************************************************* */
+
+static int _ohci_setupepts(ohci_softc_t *softc)
+{
+ int idx;
+ ohci_endpoint_t *e;
+ ohci_ed_t *ed;
+ ohci_endpoint_t *child;
+
+ /*
+ * Set up the list heads for the isochronous, control,
+ * and bulk transfer lists. They don't get the same "tree"
+ * treatment that the interrupt devices get.
+ *
+ * For the purposes of CFE, it's probably not necessary
+ * to be this fancy. The only device we're planning to
+ * talk to is the keyboard and some hubs, which should
+ * have pretty minimal requirements. It's conceivable
+ * that this firmware may find a new home in other
+ * devices, so we'll meet halfway and do some things
+ * "fancy."
+ */
+
+ softc->ohci_isoc_list = _ohci_allocept(softc);
+ softc->ohci_ctl_list = _ohci_allocept(softc);
+ softc->ohci_bulk_list = _ohci_allocept(softc);
+
+ /*
+ * Set up a tree of empty endpoint descriptors. This is
+ * tree is scanned by the hardware from the leaves up to
+ * the root. Once a millisecond, the hardware picks the
+ * next leaf and starts scanning descriptors looking
+ * for something to do. It traverses all of the endpoints
+ * along the way until it gets to the root.
+ *
+ * The idea here is if you put a transfer descriptor on the
+ * root node, the hardware will see it every millisecond,
+ * since the root will be examined each time. If you
+ * put the TD on the leaf, it will be 1/32 millisecond.
+ * The tree therefore is six levels deep.
+ */
+
+ for (idx = 0; idx < OHCI_INTTREE_SIZE; idx++) {
+ e = _ohci_allocept(softc); /* allocated with sKip bit set */
+ softc->ohci_edtable[idx] = e;
+ child = (idx == 0) ? softc->ohci_isoc_list : softc->ohci_edtable[(idx-1)/2];
+ ed = ohci_ed_from_endpoint(softc,e);
+ ed->ed_next_ed = BSWAP32(child->ep_phys);
+ e->ep_next = child;
+ }
+
+ /*
+ * We maintain both physical and virtual copies of the interrupt
+ * table (leaves of the tree).
+ */
+
+ for (idx = 0; idx < OHCI_INTTABLE_SIZE; idx++) {
+ child = softc->ohci_edtable[OHCI_INTTREE_SIZE-OHCI_INTTABLE_SIZE+idx];
+ softc->ohci_inttable[ohci_revbits[idx]] = child;
+ softc->ohci_hcca->hcca_inttable[ohci_revbits[idx]] = BSWAP32(child->ep_phys);
+ }
+
+ /*
+ * Okay, at this point the tree is built.
+ */
+ return 0;
+}
+
+/* *********************************************************************
+ * ohci_stop(bus)
+ *
+ * Stop the OHCI hardware.
+ *
+ * Input parameters:
+ * bus - our bus structure
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void ohci_stop(usbbus_t *bus)
+{
+ ohci_softc_t *softc = (ohci_softc_t *) bus->ub_hwsoftc;
+
+ OHCI_WRITECSR(softc,R_OHCI_CONTROL,V_OHCI_CONTROL_HCFS(K_OHCI_HCFS_RESET));
+}
+
+
+/* *********************************************************************
+ * _ohci_queueept(softc,queue,e)
+ *
+ * Add an endpoint to a list of endpoints. This routine
+ * does things in a particular way according to the OHCI
+ * spec so we can add endpoints while the hardware is running.
+ *
+ * Input parameters:
+ * queue - endpoint descriptor for head of queue
+ * e - endpoint to add to queue
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void _ohci_queueept(ohci_softc_t *softc,ohci_endpoint_t *queue,ohci_endpoint_t *newept)
+{
+ ohci_ed_t *qed;
+ ohci_ed_t *newed;
+
+ qed = ohci_ed_from_endpoint(softc,queue);
+ newed = ohci_ed_from_endpoint(softc,newept);
+
+ newept->ep_next = queue->ep_next;
+ newed->ed_next_ed = qed->ed_next_ed;
+
+ queue->ep_next = newept;
+ qed->ed_next_ed = BSWAP32(newept->ep_phys);
+
+ if (ohcidebug > 1) ohci_dumped(newed);
+
+}
+
+/* *********************************************************************
+ * _ohci_deqept(queue,e)
+ *
+ * Remove and endpoint from the list of endpoints. This
+ * routine does things in a particular way according to
+ * the OHCI specification, since we are operating on
+ * a running list.
+ *
+ * Input parameters:
+ * queue - base of queue to look for endpoint on
+ * e - endpoint to remove
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void _ohci_deqept(ohci_softc_t *softc,ohci_endpoint_t *queue,ohci_endpoint_t *e)
+{
+ ohci_endpoint_t *cur;
+ ohci_ed_t *cured;
+ ohci_ed_t *ed;
+
+ cur = queue;
+
+ while (cur && (cur->ep_next != e)) cur = cur->ep_next;
+
+ if (cur == NULL) {
+ printf("Could not remove EP %08X: not on the list!\n",(uint32_t) (intptr_t)e);
+ return;
+ }
+
+ /*
+ * Remove from our regular list
+ */
+
+ cur->ep_next = e->ep_next;
+
+ /*
+ * now remove from the hardware's list
+ */
+
+ cured = ohci_ed_from_endpoint(softc,cur);
+ ed = ohci_ed_from_endpoint(softc,e);
+
+ cured->ed_next_ed = ed->ed_next_ed;
+}
+
+
+/* *********************************************************************
+ * ohci_intr_procdoneq(softc)
+ *
+ * Process the "done" queue for this ohci controller. As
+ * descriptors are retired, the hardware links them to the
+ * "done" queue so we can examine the results.
+ *
+ * Input parameters:
+ * softc - our OHCI controller
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void ohci_intr_procdoneq(ohci_softc_t *softc)
+{
+ uint32_t doneq;
+ ohci_transfer_t *transfer;
+ ohci_td_t *td;
+ int val;
+ usbreq_t *ur;
+
+ /*
+ * Get the head of the queue
+ */
+
+ doneq = softc->ohci_hcca->hcca_donehead;
+ doneq = BSWAP32(doneq);
+
+ td = (ohci_td_t *) OHCI_PTOV(doneq);
+ transfer = ohci_transfer_from_td(softc,td);
+
+ /*
+ * Process all elements from the queue
+ */
+
+ while (doneq) {
+
+ ohci_ed_t *ed;
+ ohci_endpoint_t *ept;
+ usbreq_t *xur = transfer->t_ref;
+
+ if (ohcidebug > 1) {
+ if (xur) {
+ ept = (ohci_endpoint_t *) xur->ur_pipe->up_hwendpoint;
+ ed = ohci_ed_from_endpoint(softc,ept);
+// printf("ProcDoneQ:ED [%08X] -> ",ept->ep_phys);
+// ohci_dumped(ed);
+ }
+ }
+
+ /*
+ * Get the pointer to next one before freeing this one
+ */
+
+ if (ohcidebug > 1) {
+ ur = transfer->t_ref;
+ printf("Done(%d): ",ur ? ur->ur_tdcount : -1);
+ ohci_dumptd(td);
+ }
+
+ doneq = BSWAP32(td->td_next_td);
+
+ val = G_OHCI_TD_CC(BSWAP32(td->td_control));
+
+ if (val != 0) printf("[Transfer error: %d]\n",val);
+
+ /*
+ * See if it's time to call the callback.
+ */
+ ur = transfer->t_ref;
+ if (ur) {
+ ur->ur_status = val;
+ ur->ur_tdcount--;
+ if (BSWAP32(td->td_cbp) == 0) {
+ ur->ur_xferred += transfer->t_length;
+ }
+ else {
+ ur->ur_xferred += transfer->t_length -
+ (BSWAP32(td->td_be) - BSWAP32(td->td_cbp) + 1);
+ }
+ if (ur->ur_tdcount == 0) {
+ /* Noncoherent DMA: need to invalidate, since data is in phys mem */
+ OHCI_INVAL_RANGE(ur->ur_buffer,ur->ur_xferred);
+ usb_complete_request(ur,val);
+ }
+ }
+
+
+ /*
+ * Free up the request
+ */
+ _ohci_freexfer(softc,transfer);
+
+
+ /*
+ * Advance to the next request.
+ */
+
+ td = (ohci_td_t *) OHCI_PTOV(doneq);
+ transfer = ohci_transfer_from_td(softc,td);
+ }
+
+}
+
+/* *********************************************************************
+ * ohci_intr(bus)
+ *
+ * Process pending interrupts for the OHCI controller.
+ *
+ * Input parameters:
+ * bus - our bus structure
+ *
+ * Return value:
+ * 0 if we did nothing
+ * nonzero if we did something.
+ ********************************************************************* */
+
+static int ohci_intr(usbbus_t *bus)
+{
+ uint32_t reg;
+ ohci_softc_t *softc = (ohci_softc_t *) bus->ub_hwsoftc;
+
+ /*
+ * Read the interrupt status register.
+ */
+
+ reg = OHCI_READCSR(softc,R_OHCI_INTSTATUS);
+
+ /*
+ * Don't bother doing anything if nothing happened.
+ */
+ if (reg == 0) {
+ return 0;
+ }
+
+ /* Scheduling Overruns */
+ if (reg & M_OHCI_INT_SO) {
+ printf("SchedOverrun\n");
+ }
+
+ /* Done Queue */
+ if (reg & M_OHCI_INT_WDH) {
+ /* printf("DoneQueue\n"); */
+ ohci_intr_procdoneq(softc);
+ }
+
+ /* Start of Frame */
+ if (reg & M_OHCI_INT_SF) {
+ /* don't be noisy about this */
+ }
+
+ /* Resume Detect */
+ if (reg & M_OHCI_INT_RD) {
+ printf("ResumeDetect\n");
+ }
+
+ /* Unrecoverable errors */
+ if (reg & M_OHCI_INT_UE) {
+ printf("UnrecoverableError\n");
+ }
+
+ /* Frame number overflow */
+ if (reg & M_OHCI_INT_FNO) {
+ /*printf("FrameNumberOverflow\n"); */
+ }
+
+ /* Root Hub Status Change */
+ if ((reg & ~softc->ohci_intdisable) & M_OHCI_INT_RHSC) {
+ uint32_t reg;
+ if (ohcidebug > 0) {
+ printf("RootHubStatusChange: ");
+ reg = OHCI_READCSR(softc,R_OHCI_RHSTATUS);
+ ohci_dumprhstat(reg);
+ reg = OHCI_READCSR(softc,R_OHCI_RHPORTSTATUS(1));
+ ohci_dumpportstat(1,reg);
+ reg = OHCI_READCSR(softc,R_OHCI_RHPORTSTATUS(2));
+ ohci_dumpportstat(2,reg);
+ }
+ ohci_roothub_statchg(softc);
+ }
+
+ /* Ownership Change */
+ if (reg & M_OHCI_INT_OC) {
+ printf("OwnershipChange\n");
+ }
+
+ /*
+ * Write the value back to the interrupt
+ * register to clear the bits that were set.
+ */
+
+ OHCI_WRITECSR(softc,R_OHCI_INTSTATUS,reg);
+
+ return 1;
+}
+
+
+/* *********************************************************************
+ * ohci_delete(bus)
+ *
+ * Remove an OHCI bus structure and all resources allocated to
+ * it (used when shutting down USB)
+ *
+ * Input parameters:
+ * bus - our USB bus structure
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void ohci_delete(usbbus_t *bus)
+{
+ // xxx fill in later.
+}
+
+
+/* *********************************************************************
+ * ohci_create(addr)
+ *
+ * Create a USB bus structure and associate it with our OHCI
+ * controller device.
+ *
+ * Input parameters:
+ * addr - physical address of controller
+ *
+ * Return value:
+ * usbbus structure pointer
+ ********************************************************************* */
+
+static usbbus_t *ohci_create(physaddr_t addr)
+{
+ int res;
+ ohci_softc_t *softc;
+ usbbus_t *bus;
+
+ softc = KMALLOC(sizeof(ohci_softc_t),0);
+ if (!softc) return NULL;
+
+ bus = KMALLOC(sizeof(usbbus_t),0);
+ if (!bus) return NULL;
+
+ memset(softc,0,sizeof(ohci_softc_t));
+ memset(bus,0,sizeof(usbbus_t));
+
+ bus->ub_hwsoftc = (usb_hc_t *) softc;
+ bus->ub_hwdisp = &ohci_driver;
+
+ q_init(&(softc->ohci_rh_intrq));
+
+#ifdef _CFE_
+ softc->ohci_regs = addr;
+#else
+ softc->ohci_regs = (volatile uint32_t *) addr;
+#endif
+
+ softc->ohci_rh_newaddr = -1;
+ softc->ohci_bus = bus;
+
+ if ((res = _ohci_initpools(softc)) != 0) goto error;
+ if ((res = _ohci_setupepts(softc)) != 0) goto error;
+
+ OHCI_WRITECSR(softc,R_OHCI_CONTROL,V_OHCI_CONTROL_HCFS(K_OHCI_HCFS_RESET));
+
+ return bus;
+
+error:
+ KFREE(softc);
+ return NULL;
+}
+
+
+/* *********************************************************************
+ * ohci_ept_create(bus,usbaddr,eptnum,mps,flags)
+ *
+ * Create a hardware endpoint structure and attach it to
+ * the hardware's endpoint list. The hardware manages lists
+ * of queues, and this routine adds a new queue to the appropriate
+ * list of queues for the endpoint in question. It roughly
+ * corresponds to the information in the OHCI specification.
+ *
+ * Input parameters:
+ * bus - the USB bus we're dealing with
+ * usbaddr - USB address (0 means default address)
+ * eptnum - the endpoint number
+ * mps - the packet size for this endpoint
+ * flags - various flags to control endpoint creation
+ *
+ * Return value:
+ * endpoint structure poihter, or NULL
+ ********************************************************************* */
+
+static usb_ept_t *ohci_ept_create(usbbus_t *bus,
+ int usbaddr,
+ int eptnum,
+ int mps,
+ int flags)
+{
+ uint32_t eptflags;
+ ohci_endpoint_t *ept;
+ ohci_ed_t *ed;
+ ohci_transfer_t *tailtransfer;
+ ohci_td_t *tailtd;
+ ohci_softc_t *softc = (ohci_softc_t *) bus->ub_hwsoftc;
+
+ ept = _ohci_allocept(softc);
+ ed = ohci_ed_from_endpoint(softc,ept);
+
+ tailtransfer = _ohci_allocxfer(softc);
+ tailtd = ohci_td_from_transfer(softc,tailtransfer);
+
+ /*
+ * Set up functional address, endpoint number, and packet size
+ */
+
+ eptflags = V_OHCI_ED_FA(usbaddr) |
+ V_OHCI_ED_EN(eptnum) |
+ V_OHCI_ED_MPS(mps) |
+ 0;
+
+ /*
+ * Set up the endpoint type based on the flags
+ * passed to us
+ */
+
+ if (flags & UP_TYPE_IN) {
+ eptflags |= V_OHCI_ED_DIR(K_OHCI_ED_DIR_IN);
+ }
+ else if (flags & UP_TYPE_OUT) {
+ eptflags |= V_OHCI_ED_DIR(K_OHCI_ED_DIR_OUT);
+ }
+ else {
+ eptflags |= V_OHCI_ED_DIR(K_OHCI_ED_DIR_FROMTD);
+ }
+
+ /*
+ * Don't forget about lowspeed devices.
+ */
+
+ if (flags & UP_TYPE_LOWSPEED) {
+ eptflags |= M_OHCI_ED_LOWSPEED;
+ }
+
+ if (ohcidebug > 0) {
+ printf("Create endpoint %d addr %d flags %08X mps %d\n",
+ eptnum,usbaddr,eptflags,mps);
+ }
+
+ /*
+ * Transfer this info into the endpoint descriptor.
+ * No need to flush the cache here, it'll get done when
+ * we add to the hardware list.
+ */
+
+ ed->ed_control = BSWAP32(eptflags);
+ ed->ed_tailp = BSWAP32(OHCI_VTOP(tailtd));
+ ed->ed_headp = BSWAP32(OHCI_VTOP(tailtd));
+ ept->ep_flags = flags;
+ ept->ep_mps = mps;
+ ept->ep_num = eptnum;
+
+ /*
+ * Put it on the right queue
+ */
+
+ if (flags & UP_TYPE_CONTROL) {
+ _ohci_queueept(softc,softc->ohci_ctl_list,ept);
+ }
+ else if (flags & UP_TYPE_BULK) {
+ _ohci_queueept(softc,softc->ohci_bulk_list,ept);
+ }
+ else if (flags & UP_TYPE_INTR) {
+ /* XXX Choose place in inttable properly. */
+ _ohci_queueept(softc,softc->ohci_inttable[0],ept);
+ }
+
+ return (usb_ept_t *) ept;
+}
+
+/* *********************************************************************
+ * ohci_ept_setaddr(bus,ept,usbaddr)
+ *
+ * Change the functional address for a USB endpoint. We do this
+ * when we switch the device's state from DEFAULT to ADDRESSED
+ * and we've already got the default pipe open. This
+ * routine mucks with the descriptor and changes its address
+ * bits.
+ *
+ * Input parameters:
+ * bus - usb bus structure
+ * ept - an open endpoint descriptor
+ * usbaddr - new address for this endpoint
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void ohci_ept_setaddr(usbbus_t *bus,usb_ept_t *uept,int usbaddr)
+{
+ uint32_t eptflags;
+ ohci_endpoint_t *ept = (ohci_endpoint_t *) uept;
+ ohci_softc_t *softc = (ohci_softc_t *) bus->ub_hwsoftc;
+ ohci_ed_t *ed = ohci_ed_from_endpoint(softc,ept);
+
+ eptflags = BSWAP32(ed->ed_control);
+ eptflags &= ~M_OHCI_ED_FA;
+ eptflags |= V_OHCI_ED_FA(usbaddr);
+ ed->ed_control = BSWAP32(eptflags);
+}
+
+
+/* *********************************************************************
+ * ohci_ept_setmps(bus,ept,mps)
+ *
+ * Set the maximum packet size of this endpoint. This is
+ * normally used during the processing of endpoint 0 (default
+ * pipe) after we find out how big ep0's packets can be.
+ *
+ * Input parameters:
+ * bus - our USB bus structure
+ * ept - endpoint structure
+ * mps - new packet size
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void ohci_ept_setmps(usbbus_t *bus,usb_ept_t *uept,int mps)
+{
+ uint32_t eptflags;
+ ohci_softc_t *softc = (ohci_softc_t *) bus->ub_hwsoftc;
+ ohci_endpoint_t *ept = (ohci_endpoint_t *) uept;
+ ohci_ed_t *ed = ohci_ed_from_endpoint(softc,ept);
+
+ eptflags = BSWAP32(ed->ed_control);
+ eptflags &= ~M_OHCI_ED_MPS;
+ eptflags |= V_OHCI_ED_MPS(mps);
+ ed->ed_control = BSWAP32(eptflags);
+ ept->ep_mps = mps;
+
+}
+
+/* *********************************************************************
+ * ohci_ept_cleartoggle(bus,ept,mps)
+ *
+ * Clear the data toggle for the specified endpoint.
+ *
+ * Input parameters:
+ * bus - our USB bus structure
+ * ept - endpoint structure
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void ohci_ept_cleartoggle(usbbus_t *bus,usb_ept_t *uept)
+{
+ uint32_t eptflags;
+ ohci_softc_t *softc = (ohci_softc_t *) bus->ub_hwsoftc;
+ ohci_endpoint_t *ept = (ohci_endpoint_t *) uept;
+ ohci_ed_t *ed = ohci_ed_from_endpoint(softc,ept);
+
+ eptflags = BSWAP32(ed->ed_headp);
+ eptflags &= ~(M_OHCI_ED_HALT | M_OHCI_ED_TOGGLECARRY);
+ ed->ed_headp = BSWAP32(eptflags);
+
+ OHCI_WRITECSR(softc,R_OHCI_CMDSTATUS,M_OHCI_CMDSTATUS_CLF);
+}
+
+/* *********************************************************************
+ * ohci_ept_delete(bus,ept)
+ *
+ * Deletes an endpoint from the OHCI controller. This
+ * routine also completes pending transfers for the
+ * endpoint and gets rid of the hardware ept (queue base).
+ *
+ * Input parameters:
+ * bus - ohci bus structure
+ * ept - endpoint to remove
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void ohci_ept_delete(usbbus_t *bus,usb_ept_t *uept)
+{
+ ohci_endpoint_t *queue;
+ ohci_softc_t *softc = (ohci_softc_t *) bus->ub_hwsoftc;
+ ohci_endpoint_t *ept = (ohci_endpoint_t *) uept;
+ ohci_ed_t *ed = ohci_ed_from_endpoint(softc,ept);
+ uint32_t framenum;
+ uint32_t tdphys;
+ usbreq_t *ur;
+ ohci_td_t *td;
+ ohci_transfer_t *transfer;
+
+ if (ept->ep_flags & UP_TYPE_CONTROL) {
+ queue = softc->ohci_ctl_list;
+ }
+ else if (ept->ep_flags & UP_TYPE_BULK) {
+ queue = softc->ohci_bulk_list;
+ }
+ else if (ept->ep_flags & UP_TYPE_INTR) {
+ queue = softc->ohci_inttable[0];
+ }
+ else {
+ printf("Invalid endpoint\n");
+ return;
+ }
+
+
+ /*
+ * Set the SKIP bit on the endpoint and
+ * wait for two SOFs to guarantee that we're
+ * not processing this ED anymore.
+ */
+
+ ((volatile uint32_t) ed->ed_control) |= BSWAP32(M_OHCI_ED_SKIP);
+
+ framenum = OHCI_READCSR(softc,R_OHCI_FMNUMBER) & 0xFFFF;
+ while ((OHCI_READCSR(softc,R_OHCI_FMNUMBER) & 0xFFFF) == framenum) ; /* NULL LOOP */
+
+ framenum = OHCI_READCSR(softc,R_OHCI_FMNUMBER) & 0xFFFF;
+ while ((OHCI_READCSR(softc,R_OHCI_FMNUMBER) & 0xFFFF) == framenum) ; /* NULL LOOP */
+
+ /*
+ * Remove endpoint from queue
+ */
+
+ _ohci_deqept(softc,queue,ept);
+
+ /*
+ * Free/complete the TDs on the queue
+ */
+
+ tdphys = BSWAP32(ed->ed_headp) & M_OHCI_ED_PTRMASK;
+
+ while (tdphys != BSWAP32(ed->ed_tailp)) {
+ td = (ohci_td_t *) OHCI_PTOV(tdphys);
+ tdphys = BSWAP32(td->td_next_td);
+ transfer = ohci_transfer_from_td(softc,td);
+
+ ur = transfer->t_ref;
+ if (ur) {
+ ur->ur_status = K_OHCI_CC_CANCELLED;
+ ur->ur_tdcount--;
+ if (ur->ur_tdcount == 0) {
+ if (ohcidebug > 0) printf("Completing request due to closed pipe: %p\n",ur);
+ usb_complete_request(ur,K_OHCI_CC_CANCELLED);
+ /* XXX it is expected that the callee will free the usbreq. */
+ }
+ }
+
+ _ohci_freexfer(softc,transfer);
+ }
+
+ /*
+ * tdphys now points at the tail TD. Just free it.
+ */
+
+ td = (ohci_td_t *) OHCI_PTOV(tdphys);
+ _ohci_freexfer(softc,ohci_transfer_from_td(softc,td));
+
+ /*
+ * Return endpoint to free pool
+ */
+
+ _ohci_freeept(softc,ept);
+}
+
+
+
+/* *********************************************************************
+ * ohci_xfer(bus,ept,ur)
+ *
+ * Queue a transfer for the specified endpoint. Depending on
+ * the transfer type, the transfer may go on one of many queues.
+ * When the transfer completes, a callback will be called.
+ *
+ * Input parameters:
+ * bus - bus structure
+ * ept - endpoint descriptor
+ * ur - request (includes pointer to user buffer)
+ *
+ * Return value:
+ * 0 if ok
+ * else error
+ ********************************************************************* */
+
+static int ohci_xfer(usbbus_t *bus,usb_ept_t *uept,usbreq_t *ur)
+{
+ ohci_softc_t *softc = (ohci_softc_t *) bus->ub_hwsoftc;
+ ohci_endpoint_t *ept = (ohci_endpoint_t *) uept;
+ ohci_ed_t *ed = ohci_ed_from_endpoint(softc,ept);
+ ohci_transfer_t *newtailtransfer = 0;
+ ohci_td_t *newtailtd = NULL;
+ ohci_transfer_t *curtransfer;
+ ohci_td_t *curtd;
+ uint8_t *ptr;
+ int len;
+ int amtcopy;
+ int pktlen;
+ uint32_t tdcontrol = 0;
+
+ /*
+ * If the destination USB address matches
+ * the address of the root hub, shunt the request
+ * over to our root hub emulation.
+ */
+
+ if (ur->ur_dev->ud_address == softc->ohci_rh_addr) {
+ return ohci_roothub_xfer(bus,uept,ur);
+ }
+
+ /*
+ * Set up the TD flags based on the
+ * request type.
+ */
+
+// pktlen = ept->ep_mps;
+ pktlen = OHCI_TD_MAX_DATA - 16;
+
+ if (ur->ur_flags & UR_FLAG_SETUP) {
+ tdcontrol = V_OHCI_TD_PID(K_OHCI_TD_SETUP) |
+ V_OHCI_TD_DT(K_OHCI_TD_DT_DATA0) |
+ V_OHCI_TD_CC(K_OHCI_CC_NOTACCESSED) |
+ V_OHCI_TD_DI(1);
+ }
+ else if (ur->ur_flags & UR_FLAG_IN) {
+ tdcontrol = V_OHCI_TD_PID(K_OHCI_TD_IN) |
+ V_OHCI_TD_DT(K_OHCI_TD_DT_TCARRY) |
+ V_OHCI_TD_CC(K_OHCI_CC_NOTACCESSED) |
+ V_OHCI_TD_DI(1);
+ }
+ else if (ur->ur_flags & UR_FLAG_OUT) {
+ tdcontrol = V_OHCI_TD_PID(K_OHCI_TD_OUT) |
+ V_OHCI_TD_DT(K_OHCI_TD_DT_TCARRY) |
+ V_OHCI_TD_CC(K_OHCI_CC_NOTACCESSED) |
+ V_OHCI_TD_DI(1);
+ }
+ else if (ur->ur_flags & UR_FLAG_STATUS_OUT) {
+ tdcontrol = V_OHCI_TD_PID(K_OHCI_TD_OUT) |
+ V_OHCI_TD_DT(K_OHCI_TD_DT_DATA1) |
+ V_OHCI_TD_CC(K_OHCI_CC_NOTACCESSED) |
+ V_OHCI_TD_DI(1);
+ }
+ else if (ur->ur_flags & UR_FLAG_STATUS_IN) {
+ tdcontrol = V_OHCI_TD_PID(K_OHCI_TD_IN) |
+ V_OHCI_TD_DT(K_OHCI_TD_DT_DATA1) |
+ V_OHCI_TD_CC(K_OHCI_CC_NOTACCESSED) |
+ V_OHCI_TD_DI(1);
+ }
+ else {
+ printf("Shouldn't happen!\n");
+ }
+
+ if (ur->ur_flags & UR_FLAG_SHORTOK) {
+ tdcontrol |= M_OHCI_TD_SHORTOK;
+ }
+
+
+ ptr = ur->ur_buffer;
+ len = ur->ur_length;
+ ur->ur_tdcount = 0;
+
+ if (ohcidebug > 1) {
+ printf(">> Queueing xfer addr %d pipe %d ED %08X ptr %016llX length %d\n",
+ ur->ur_dev->ud_address,
+ ur->ur_pipe->up_num,
+ ept->ep_phys,
+ (uint64_t) (uintptr_t) ptr,
+ len);
+// ohci_dumped(ed);
+ }
+
+ curtd = OHCI_PTOV(BSWAP32(ed->ed_tailp));
+ curtransfer = ohci_transfer_from_td(softc,curtd);
+
+ if (len == 0) {
+ newtailtransfer = _ohci_allocxfer(softc);
+ newtailtd = ohci_td_from_transfer(softc,newtailtransfer);
+ curtd->td_cbp = 0;
+ curtd->td_be = 0;
+ curtd->td_next_td = BSWAP32(OHCI_VTOP(newtailtd));
+ curtd->td_control = BSWAP32(tdcontrol);
+ curtransfer->t_next = newtailtransfer;
+ curtransfer->t_ref = ur;
+ curtransfer->t_length = 0;
+ if (ohcidebug > 1) { printf("QueueTD: "); ohci_dumptd(curtd); }
+ ur->ur_tdcount++;
+ }
+ else {
+ /* Noncoherent DMA: need to flush user buffer to real memory first */
+ OHCI_FLUSH_RANGE(ptr,len);
+ while (len > 0) {
+ amtcopy = len;
+ if (amtcopy > pktlen) amtcopy = pktlen;
+ newtailtransfer = _ohci_allocxfer(softc);
+ newtailtd = ohci_td_from_transfer(softc,newtailtransfer);
+ curtd->td_cbp = BSWAP32(OHCI_VTOP(ptr));
+ curtd->td_be = BSWAP32(OHCI_VTOP(ptr+amtcopy)-1);
+ curtd->td_next_td = BSWAP32(OHCI_VTOP(newtailtd));
+ curtd->td_control = BSWAP32(tdcontrol);
+ curtransfer->t_next = newtailtransfer;
+ curtransfer->t_ref = ur;
+ curtransfer->t_length = amtcopy;
+ if (ohcidebug > 1) { printf("QueueTD: "); ohci_dumptd(curtd); }
+ curtd = newtailtd;
+ curtransfer = ohci_transfer_from_td(softc,curtd);
+ ptr += amtcopy;
+ len -= amtcopy;
+ ur->ur_tdcount++;
+ }
+ }
+
+ curtd = OHCI_PTOV(BSWAP32(ed->ed_headp & M_OHCI_ED_PTRMASK));
+ ed->ed_tailp = BSWAP32(OHCI_VTOP(newtailtd));
+
+ /*
+ * Prod the controller depending on what type of list we put
+ * a TD on.
+ */
+
+ if (ept->ep_flags & UP_TYPE_BULK) {
+ OHCI_WRITECSR(softc,R_OHCI_CMDSTATUS,M_OHCI_CMDSTATUS_BLF);
+ }
+ else {
+ /* XXX should probably make sure we're UP_TYPE_CONTROL here */
+ OHCI_WRITECSR(softc,R_OHCI_CMDSTATUS,M_OHCI_CMDSTATUS_CLF);
+ }
+
+ return 0;
+}
+
+/* *********************************************************************
+ * Driver structure
+ ********************************************************************* */
+
+usb_hcdrv_t ohci_driver = {
+ ohci_create,
+ ohci_delete,
+ ohci_start,
+ ohci_stop,
+ ohci_intr,
+ ohci_ept_create,
+ ohci_ept_delete,
+ ohci_ept_setmps,
+ ohci_ept_setaddr,
+ ohci_ept_cleartoggle,
+ ohci_xfer
+};
+
+/* *********************************************************************
+ * Root Hub
+ *
+ * Data structures and functions
+ ********************************************************************* */
+
+/*
+ * Data structures and routines to emulate the root hub.
+ */
+static usb_device_descr_t ohci_root_devdsc = {
+ sizeof(usb_device_descr_t), /* bLength */
+ USB_DEVICE_DESCRIPTOR_TYPE, /* bDescriptorType */
+ USBWORD(0x0100), /* bcdUSB */
+ USB_DEVICE_CLASS_HUB, /* bDeviceClass */
+ 0, /* bDeviceSubClass */
+ 0, /* bDeviceProtocol */
+ 64, /* bMaxPacketSize0 */
+ USBWORD(0), /* idVendor */
+ USBWORD(0), /* idProduct */
+ USBWORD(0x0100), /* bcdDevice */
+ 1, /* iManufacturer */
+ 2, /* iProduct */
+ 0, /* iSerialNumber */
+ 1 /* bNumConfigurations */
+};
+
+static usb_config_descr_t ohci_root_cfgdsc = {
+ sizeof(usb_config_descr_t), /* bLength */
+ USB_CONFIGURATION_DESCRIPTOR_TYPE, /* bDescriptorType */
+ USBWORD(
+ sizeof(usb_config_descr_t) +
+ sizeof(usb_interface_descr_t) +
+ sizeof(usb_endpoint_descr_t)), /* wTotalLength */
+ 1, /* bNumInterfaces */
+ 1, /* bConfigurationValue */
+ 0, /* iConfiguration */
+ USB_CONFIG_SELF_POWERED, /* bmAttributes */
+ 0 /* MaxPower */
+};
+
+static usb_interface_descr_t ohci_root_ifdsc = {
+ sizeof(usb_interface_descr_t), /* bLength */
+ USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */
+ 0, /* bInterfaceNumber */
+ 0, /* bAlternateSetting */
+ 1, /* bNumEndpoints */
+ USB_INTERFACE_CLASS_HUB, /* bInterfaceClass */
+ 0, /* bInterfaceSubClass */
+ 0, /* bInterfaceProtocol */
+ 0 /* iInterface */
+};
+
+static usb_endpoint_descr_t ohci_root_epdsc = {
+ sizeof(usb_endpoint_descr_t), /* bLength */
+ USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType */
+ (USB_ENDPOINT_DIRECTION_IN | 1), /* bEndpointAddress */
+ USB_ENDPOINT_TYPE_INTERRUPT, /* bmAttributes */
+ USBWORD(8), /* wMaxPacketSize */
+ 255 /* bInterval */
+};
+
+static usb_hub_descr_t ohci_root_hubdsc = {
+ USB_HUB_DESCR_SIZE, /* bLength */
+ USB_HUB_DESCRIPTOR_TYPE, /* bDescriptorType */
+ 0, /* bNumberOfPorts */
+ USBWORD(0), /* wHubCharacteristics */
+ 0, /* bPowreOnToPowerGood */
+ 0, /* bHubControl Current */
+ {0} /* bRemoveAndPowerMask */
+};
+
+/* *********************************************************************
+ * ohci_roothb_strdscr(ptr,str)
+ *
+ * Construct a string descriptor for root hub requests
+ *
+ * Input parameters:
+ * ptr - pointer to where to put descriptor
+ * str - regular string to put into descriptor
+ *
+ * Return value:
+ * number of bytes written to descriptor
+ ********************************************************************* */
+
+static int ohci_roothub_strdscr(uint8_t *ptr,char *str)
+{
+ uint8_t *p = ptr;
+
+ *p++ = strlen(str)*2 + 2; /* Unicode strings */
+ *p++ = USB_STRING_DESCRIPTOR_TYPE;
+ while (*str) {
+ *p++ = *str++;
+ *p++ = 0;
+ }
+ return (p - ptr);
+}
+
+/* *********************************************************************
+ * ohci_roothub_req(softc,req)
+ *
+ * Handle a descriptor request on the control pipe for the
+ * root hub. We pretend to be a real root hub here and
+ * return all the standard descriptors.
+ *
+ * Input parameters:
+ * softc - our OHCI controller
+ * req - a usb request (completed immediately)
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int ohci_roothub_req(ohci_softc_t *softc,usb_device_request_t *req)
+{
+ uint8_t *ptr;
+ uint16_t wLength;
+ uint16_t wValue;
+ uint16_t wIndex;
+ usb_port_status_t ups;
+ usb_hub_descr_t hdsc;
+ uint32_t status;
+ uint32_t statport;
+ uint32_t tmpval;
+ int res = 0;
+
+ ptr = softc->ohci_rh_buf;
+
+ wLength = GETUSBFIELD(req,wLength);
+ wValue = GETUSBFIELD(req,wValue);
+ wIndex = GETUSBFIELD(req,wIndex);
+
+ switch (REQSW(req->bRequest,req->bmRequestType)) {
+
+ case REQCODE(USB_REQUEST_GET_STATUS,USBREQ_DIR_IN,USBREQ_TYPE_STD,USBREQ_REC_DEVICE):
+ *ptr++ = (USB_GETSTATUS_SELF_POWERED & 0xFF);
+ *ptr++ = (USB_GETSTATUS_SELF_POWERED >> 8);
+ break;
+
+ case REQCODE(USB_REQUEST_GET_STATUS,USBREQ_DIR_IN,USBREQ_TYPE_STD,USBREQ_REC_ENDPOINT):
+ case REQCODE(USB_REQUEST_GET_STATUS,USBREQ_DIR_IN,USBREQ_TYPE_STD,USBREQ_REC_INTERFACE):
+ *ptr++ = 0;
+ *ptr++ = 0;
+ break;
+
+ case REQCODE(USB_REQUEST_GET_STATUS,USBREQ_DIR_IN,USBREQ_TYPE_CLASS,USBREQ_REC_OTHER):
+ status = OHCI_READCSR(softc,(R_OHCI_RHPORTSTATUS(wIndex)));
+ if (ohcidebug > 0) { printf("RHGetStatus: "); ohci_dumpportstat(wIndex,status);}
+ PUTUSBFIELD((&ups),wPortStatus,(status & 0xFFFF));
+ PUTUSBFIELD((&ups),wPortChange,(status >> 16));
+ memcpy(ptr,&ups,sizeof(ups));
+ ptr += sizeof(ups);
+ break;
+
+ case REQCODE(USB_REQUEST_GET_STATUS,USBREQ_DIR_IN,USBREQ_TYPE_CLASS,USBREQ_REC_DEVICE):
+ *ptr++ = 0;
+ *ptr++ = 0;
+ *ptr++ = 0;
+ *ptr++ = 0;
+ break;
+
+ case REQCODE(USB_REQUEST_CLEAR_FEATURE,USBREQ_DIR_OUT,USBREQ_TYPE_STD,USBREQ_REC_DEVICE):
+ case REQCODE(USB_REQUEST_CLEAR_FEATURE,USBREQ_DIR_OUT,USBREQ_TYPE_STD,USBREQ_REC_INTERFACE):
+ case REQCODE(USB_REQUEST_CLEAR_FEATURE,USBREQ_DIR_OUT,USBREQ_TYPE_STD,USBREQ_REC_ENDPOINT):
+ /* do nothing, not supported */
+ break;
+
+ case REQCODE(USB_REQUEST_CLEAR_FEATURE,USBREQ_DIR_OUT,USBREQ_TYPE_CLASS,USBREQ_REC_OTHER):
+ statport = R_OHCI_RHPORTSTATUS(wIndex);
+ if (ohcidebug> 0) {
+ printf("RHClearFeature(%d): ",wValue); ohci_dumpportstat(wIndex,OHCI_READCSR(softc,statport));
+ }
+ switch (wValue) {
+ case USB_PORT_FEATURE_CONNECTION:
+ break;
+ case USB_PORT_FEATURE_ENABLE:
+ OHCI_WRITECSR(softc,statport,M_OHCI_RHPORTSTAT_CCS);
+ break;
+ case USB_PORT_FEATURE_SUSPEND:
+ OHCI_WRITECSR(softc,statport,M_OHCI_RHPORTSTAT_POCI);
+ break;
+ case USB_PORT_FEATURE_OVER_CURRENT:
+ break;
+ case USB_PORT_FEATURE_RESET:
+ break;
+ case USB_PORT_FEATURE_POWER:
+ OHCI_WRITECSR(softc,statport,M_OHCI_RHPORTSTAT_LSDA);
+ break;
+ case USB_PORT_FEATURE_LOW_SPEED:
+ break;
+ case USB_PORT_FEATURE_C_PORT_CONNECTION:
+ OHCI_WRITECSR(softc,statport,M_OHCI_RHPORTSTAT_CSC);
+ break;
+ case USB_PORT_FEATURE_C_PORT_ENABLE:
+ OHCI_WRITECSR(softc,statport,M_OHCI_RHPORTSTAT_PESC);
+ break;
+ case USB_PORT_FEATURE_C_PORT_SUSPEND:
+ OHCI_WRITECSR(softc,statport,M_OHCI_RHPORTSTAT_PSSC);
+ break;
+ case USB_PORT_FEATURE_C_PORT_OVER_CURRENT:
+ OHCI_WRITECSR(softc,statport,M_OHCI_RHPORTSTAT_OCIC);
+ break;
+ case USB_PORT_FEATURE_C_PORT_RESET:
+ OHCI_WRITECSR(softc,statport,M_OHCI_RHPORTSTAT_PRSC);
+ break;
+
+ }
+
+ /*
+ * If we've cleared all of the conditions that
+ * want our attention on the port status,
+ * then we can accept port status interrupts again.
+ */
+
+ if ((wValue >= USB_PORT_FEATURE_C_PORT_CONNECTION) &&
+ (wValue <= USB_PORT_FEATURE_C_PORT_RESET)) {
+ status = OHCI_READCSR(softc,statport);
+ if ((status & M_OHCI_RHPORTSTAT_ALLC) == 0) {
+ softc->ohci_intdisable &= ~M_OHCI_INT_RHSC;
+ }
+ }
+ break;
+
+ case REQCODE(USB_REQUEST_SET_FEATURE,USBREQ_DIR_OUT,USBREQ_TYPE_STD,USBREQ_REC_DEVICE):
+ case REQCODE(USB_REQUEST_SET_FEATURE,USBREQ_DIR_OUT,USBREQ_TYPE_STD,USBREQ_REC_INTERFACE):
+ case REQCODE(USB_REQUEST_SET_FEATURE,USBREQ_DIR_OUT,USBREQ_TYPE_STD,USBREQ_REC_ENDPOINT):
+ res = -1;
+ break;
+
+ case REQCODE(USB_REQUEST_SET_FEATURE,USBREQ_DIR_OUT,USBREQ_TYPE_CLASS,USBREQ_REC_DEVICE):
+ /* nothing */
+ break;
+
+ case REQCODE(USB_REQUEST_SET_FEATURE,USBREQ_DIR_OUT,USBREQ_TYPE_CLASS,USBREQ_REC_OTHER):
+ statport = R_OHCI_RHPORTSTATUS(wIndex);
+ switch (wValue) {
+ case USB_PORT_FEATURE_CONNECTION:
+ break;
+ case USB_PORT_FEATURE_ENABLE:
+ OHCI_WRITECSR(softc,statport,M_OHCI_RHPORTSTAT_PES);
+ break;
+ case USB_PORT_FEATURE_SUSPEND:
+ OHCI_WRITECSR(softc,statport,M_OHCI_RHPORTSTAT_PSS);
+ break;
+ case USB_PORT_FEATURE_OVER_CURRENT:
+ break;
+ case USB_PORT_FEATURE_RESET:
+ OHCI_WRITECSR(softc,statport,M_OHCI_RHPORTSTAT_PRS);
+ for (;;) { /* XXX timer */
+ usb_delay_ms(softc->ohci_bus,100);
+ if (!(OHCI_READCSR(softc,statport) & M_OHCI_RHPORTSTAT_PRS)) break;
+ }
+ break;
+ case USB_PORT_FEATURE_POWER:
+ OHCI_WRITECSR(softc,statport,M_OHCI_RHPORTSTAT_PPS);
+ break;
+ case USB_PORT_FEATURE_LOW_SPEED:
+ break;
+ case USB_PORT_FEATURE_C_PORT_CONNECTION:
+ break;
+ case USB_PORT_FEATURE_C_PORT_ENABLE:
+ break;
+ case USB_PORT_FEATURE_C_PORT_SUSPEND:
+ break;
+ case USB_PORT_FEATURE_C_PORT_OVER_CURRENT:
+ break;
+ case USB_PORT_FEATURE_C_PORT_RESET:
+ break;
+
+ }
+
+ break;
+
+ case REQCODE(USB_REQUEST_SET_ADDRESS,USBREQ_DIR_OUT,USBREQ_TYPE_STD,USBREQ_REC_DEVICE):
+ softc->ohci_rh_newaddr = wValue;
+ break;
+
+ case REQCODE(USB_REQUEST_GET_DESCRIPTOR,USBREQ_DIR_IN,USBREQ_TYPE_STD,USBREQ_REC_DEVICE):
+ switch (wValue >> 8) {
+ case USB_DEVICE_DESCRIPTOR_TYPE:
+ memcpy(ptr,&ohci_root_devdsc,sizeof(ohci_root_devdsc));
+ ptr += sizeof(ohci_root_devdsc);
+ break;
+ case USB_CONFIGURATION_DESCRIPTOR_TYPE:
+ memcpy(ptr,&ohci_root_cfgdsc,sizeof(ohci_root_cfgdsc));
+ ptr += sizeof(ohci_root_cfgdsc);
+ memcpy(ptr,&ohci_root_ifdsc,sizeof(ohci_root_ifdsc));
+ ptr += sizeof(ohci_root_ifdsc);
+ memcpy(ptr,&ohci_root_epdsc,sizeof(ohci_root_epdsc));
+ ptr += sizeof(ohci_root_epdsc);
+ break;
+ case USB_STRING_DESCRIPTOR_TYPE:
+ switch (wValue & 0xFF) {
+ case 1:
+ ptr += ohci_roothub_strdscr(ptr,"Generic");
+ break;
+ case 2:
+ ptr += ohci_roothub_strdscr(ptr,"Root Hub");
+ break;
+ default:
+ *ptr++ = 0;
+ break;
+ }
+ break;
+ default:
+ res = -1;
+ break;
+ }
+ break;
+
+ case REQCODE(USB_REQUEST_GET_DESCRIPTOR,USBREQ_DIR_IN,USBREQ_TYPE_CLASS,USBREQ_REC_DEVICE):
+ memcpy(&hdsc,&ohci_root_hubdsc,sizeof(hdsc));
+ hdsc.bNumberOfPorts = softc->ohci_ndp;
+ status = OHCI_READCSR(softc,R_OHCI_RHDSCRA);
+ tmpval = 0;
+ if (status & M_OHCI_RHDSCRA_NPS) tmpval |= USB_HUBCHAR_PWR_NONE;
+ if (status & M_OHCI_RHDSCRA_PSM) tmpval |= USB_HUBCHAR_PWR_GANGED;
+ else tmpval |= USB_HUBCHAR_PWR_IND;
+ PUTUSBFIELD((&hdsc),wHubCharacteristics,tmpval);
+ tmpval = G_OHCI_RHDSCRA_POTPGT(status);
+ hdsc.bPowerOnToPowerGood = tmpval;
+ hdsc.bDescriptorLength = USB_HUB_DESCR_SIZE + 1;
+ status = OHCI_READCSR(softc,R_OHCI_RHDSCRB);
+ hdsc.bRemoveAndPowerMask[0] = (uint8_t) status;
+ memcpy(ptr,&hdsc,sizeof(hdsc));
+ ptr += sizeof(hdsc);
+ break;
+
+ case REQCODE(USB_REQUEST_SET_DESCRIPTOR,USBREQ_DIR_OUT,USBREQ_TYPE_CLASS,USBREQ_REC_DEVICE):
+ /* nothing */
+ break;
+
+ case REQCODE(USB_REQUEST_GET_CONFIGURATION,USBREQ_DIR_IN,USBREQ_TYPE_STD,USBREQ_REC_DEVICE):
+ *ptr++ = softc->ohci_rh_conf;
+ break;
+
+ case REQCODE(USB_REQUEST_SET_CONFIGURATION,USBREQ_DIR_OUT,USBREQ_TYPE_STD,USBREQ_REC_DEVICE):
+ softc->ohci_rh_conf = wValue;
+ break;
+
+ case REQCODE(USB_REQUEST_GET_INTERFACE,USBREQ_DIR_IN,USBREQ_TYPE_STD,USBREQ_REC_INTERFACE):
+ *ptr++ = 0;
+ break;
+
+ case REQCODE(USB_REQUEST_SET_INTERFACE,USBREQ_DIR_OUT,USBREQ_TYPE_STD,USBREQ_REC_INTERFACE):
+ /* nothing */
+ break;
+
+ case REQCODE(USB_REQUEST_SYNC_FRAME,USBREQ_DIR_OUT,USBREQ_TYPE_STD,USBREQ_REC_ENDPOINT):
+ /* nothing */
+ break;
+ }
+
+ softc->ohci_rh_ptr = softc->ohci_rh_buf;
+ softc->ohci_rh_len = ptr - softc->ohci_rh_buf;
+
+ return res;
+}
+
+/* *********************************************************************
+ * ohci_roothub_statchg(softc)
+ *
+ * This routine is called from the interrupt service routine
+ * (well, polling routine) for the ohci controller. If the
+ * controller notices a root hub status change, it dequeues an
+ * interrupt transfer from the root hub's queue and completes
+ * it here.
+ *
+ * Input parameters:
+ * softc - our OHCI controller
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void ohci_roothub_statchg(ohci_softc_t *softc)
+{
+ usbreq_t *ur;
+ uint32_t status;
+ uint8_t portstat = 0;
+ int idx;
+
+ /* Note: this only works up to 8 ports */
+ for (idx = 1; idx <= softc->ohci_ndp; idx++) {
+ status = OHCI_READCSR(softc,R_OHCI_RHPORTSTATUS(idx));
+ if (status & M_OHCI_RHPORTSTAT_ALLC) {
+ portstat = (1<<idx);
+ }
+ }
+
+ if (portstat != 0) {
+ softc->ohci_intdisable |= M_OHCI_INT_RHSC;
+ }
+
+ ur = (usbreq_t *) q_deqnext(&(softc->ohci_rh_intrq));
+ if (!ur) return; /* no requests pending, ignore it */
+
+ memset(ur->ur_buffer,0,ur->ur_length);
+ ur->ur_buffer[0] = portstat;
+ ur->ur_xferred = ur->ur_length;
+
+ usb_complete_request(ur,0);
+}
+
+/* *********************************************************************
+ * ohci_roothub_xfer(softc,req)
+ *
+ * Handle a root hub xfer - ohci_xfer transfers control here
+ * if we detect the address of the root hub - no actual transfers
+ * go out on the wire, we just handle the requests directly to
+ * make it look like a hub is attached.
+ *
+ * This seems to be common practice in the USB world, so we do
+ * it here too.
+ *
+ * Input parameters:
+ * softc - our OHCI controller structure
+ * req - usb request destined for host controller
+ *
+ * Return value:
+ * 0 if ok
+ * else error
+ ********************************************************************* */
+
+static int ohci_roothub_xfer(usbbus_t *bus,usb_ept_t *uept,usbreq_t *ur)
+{
+ ohci_softc_t *softc = (ohci_softc_t *) bus->ub_hwsoftc;
+ ohci_endpoint_t *ept = (ohci_endpoint_t *) uept;
+ int res;
+
+ switch (ept->ep_num) {
+
+ /*
+ * CONTROL ENDPOINT
+ */
+ case 0:
+
+ /*
+ * Three types of transfers: OUT (SETUP), IN (data), or STATUS.
+ * figure out which is which.
+ */
+
+ if (ur->ur_flags & UR_FLAG_SETUP) {
+ /*
+ * SETUP packet - this is an OUT request to the control
+ * pipe. We emulate the hub request here.
+ */
+ usb_device_request_t *req;
+
+ req = (usb_device_request_t *) ur->ur_buffer;
+
+ res = ohci_roothub_req(softc,req);
+ if (res != 0) printf("Root hub request returned an error\n");
+
+ ur->ur_xferred = ur->ur_length;
+ ur->ur_status = 0;
+ usb_complete_request(ur,0);
+ }
+
+ else if (ur->ur_flags & UR_FLAG_STATUS_IN) {
+ /*
+ * STATUS IN : it's sort of like a dummy IN request
+ * to acknowledge a SETUP packet that otherwise has no
+ * status. Just complete the usbreq.
+ */
+
+ if (softc->ohci_rh_newaddr != -1) {
+ softc->ohci_rh_addr = softc->ohci_rh_newaddr;
+ softc->ohci_rh_newaddr = -1;
+ }
+
+ ur->ur_status = 0;
+ ur->ur_xferred = 0;
+ usb_complete_request(ur,0);
+ }
+
+ else if (ur->ur_flags & UR_FLAG_STATUS_OUT) {
+ /*
+ * STATUS OUT : it's sort of like a dummy OUT request
+ */
+ ur->ur_status = 0;
+ ur->ur_xferred = 0;
+ usb_complete_request(ur,0);
+ }
+
+ else if (ur->ur_flags & UR_FLAG_IN) {
+ /*
+ * IN : return data from the root hub
+ */
+ int amtcopy;
+
+ amtcopy = softc->ohci_rh_len;
+ if (amtcopy > ur->ur_length) amtcopy = ur->ur_length;
+
+ memcpy(ur->ur_buffer,softc->ohci_rh_ptr,amtcopy);
+
+ softc->ohci_rh_ptr += amtcopy;
+ softc->ohci_rh_len -= amtcopy;
+
+ ur->ur_status = 0;
+ ur->ur_xferred = amtcopy;
+ usb_complete_request(ur,0);
+ }
+
+ else {
+ printf("Unknown root hub transfer type\n");
+ return -1;
+ }
+ break;
+
+ /*
+ * INTERRUPT ENDPOINT
+ */
+
+ case 1: /* interrupt pipe */
+ if (ur->ur_flags & UR_FLAG_IN) {
+ q_enqueue(&(softc->ohci_rh_intrq),(queue_t *) ur);
+ }
+ break;
+
+ }
+
+
+ return 0;
+}
diff --git a/cfe/cfe/usb/ohci.h b/cfe/cfe/usb/ohci.h
new file mode 100644
index 0000000..06368e5
--- /dev/null
+++ b/cfe/cfe/usb/ohci.h
@@ -0,0 +1,490 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * OHCI defs File: ohci.h
+ *
+ * Open Host controller interface definitions
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+/* *********************************************************************
+ * Macros to muck with bitfields
+ ********************************************************************* */
+
+#define _OHCI_MAKE32(x) ((uint32_t)(x))
+
+/*
+ * Make a mask for 1 bit at position 'n'
+ */
+
+#define _OHCI_MAKEMASK1(n) (_OHCI_MAKE32(1) << _OHCI_MAKE32(n))
+
+/*
+ * Make a mask for 'v' bits at position 'n'
+ */
+
+#define _OHCI_MAKEMASK(v,n) (_OHCI_MAKE32((_OHCI_MAKE32(1)<<(v))-1) << _OHCI_MAKE32(n))
+
+/*
+ * Make a value at 'v' at bit position 'n'
+ */
+
+#define _OHCI_MAKEVALUE(v,n) (_OHCI_MAKE32(v) << _OHCI_MAKE32(n))
+#define _OHCI_GETVALUE(v,n,m) ((_OHCI_MAKE32(v) & _OHCI_MAKE32(m)) >> _OHCI_MAKE32(n))
+
+
+
+/* *********************************************************************
+ * Endpoint Descriptor (interrupt, bulk)
+ ********************************************************************* */
+
+#define OHCI_ED_ALIGN 32
+
+typedef struct ohci_ed_s {
+ uint32_t ed_control;
+ uint32_t ed_tailp;
+ uint32_t ed_headp;
+ uint32_t ed_next_ed;
+} ohci_ed_t;
+
+#define S_OHCI_ED_FA 0
+#define M_OHCI_ED_FA _OHCI_MAKEMASK(7,S_OHCI_ED_FA)
+#define V_OHCI_ED_FA(x) _OHCI_MAKEVALUE(x,S_OHCI_ED_FA)
+#define G_OHCI_ED_FA(x) _OHCI_GETVALUE(x,S_OHCI_ED_FA,M_OHCI_ED_FA)
+
+#define S_OHCI_ED_EN 7
+#define M_OHCI_ED_EN _OHCI_MAKEMASK(4,S_OHCI_ED_EN)
+#define V_OHCI_ED_EN(x) _OHCI_MAKEVALUE(x,S_OHCI_ED_EN)
+#define G_OHCI_ED_EN(x) _OHCI_GETVALUE(x,S_OHCI_ED_EN,M_OHCI_ED_EN)
+
+#define S_OHCI_ED_DIR 11
+#define M_OHCI_ED_DIR _OHCI_MAKEMASK(2,S_OHCI_ED_DIR)
+#define V_OHCI_ED_DIR(x) _OHCI_MAKEVALUE(x,S_OHCI_ED_DIR)
+#define G_OHCI_ED_DIR(x) _OHCI_GETVALUE(x,S_OHCI_ED_DIR,M_OHCI_ED_DIR)
+
+#define K_OHCI_ED_DIR_FROMTD 0
+#define K_OHCI_ED_DIR_OUT 1
+#define K_OHCI_ED_DIR_IN 2
+
+#define M_OHCI_ED_LOWSPEED _OHCI_MAKEMASK1(13)
+#define M_OHCI_ED_SKIP _OHCI_MAKEMASK1(14)
+#define M_OHCI_ED_ISOCFMT _OHCI_MAKEMASK1(15)
+
+#define S_OHCI_ED_MPS 16
+#define M_OHCI_ED_MPS _OHCI_MAKEMASK(11,S_OHCI_ED_MPS)
+#define V_OHCI_ED_MPS(x) _OHCI_MAKEVALUE(x,S_OHCI_ED_MPS)
+#define G_OHCI_ED_MPS(x) _OHCI_GETVALUE(x,S_OHCI_ED_MPS,M_OHCI_ED_MPS)
+
+#define M_OHCI_ED_PTRMASK 0xFFFFFFF0
+#define M_OHCI_ED_HALT _OHCI_MAKEMASK1(0)
+#define M_OHCI_ED_TOGGLECARRY _OHCI_MAKEMASK1(1)
+
+/* *********************************************************************
+ * Transfer Descriptor
+ ********************************************************************* */
+
+#define OHCI_TD_ALIGN 32
+
+typedef struct ohci_td_s {
+ uint32_t td_control;
+ uint32_t td_cbp;
+ uint32_t td_next_td;
+ uint32_t td_be;
+} ohci_td_t;
+
+#define M_OHCI_TD_SHORTOK _OHCI_MAKEMASK1(18)
+
+#define S_OHCI_TD_PID 19
+#define M_OHCI_TD_PID _OHCI_MAKEMASK(2,S_OHCI_TD_PID)
+#define V_OHCI_TD_PID(x) _OHCI_MAKEVALUE(x,S_OHCI_TD_PID)
+#define G_OHCI_TD_PID(x) _OHCI_GETVALUE(x,S_OHCI_TD_PID,M_OHCI_TD_PID)
+
+#define K_OHCI_TD_SETUP 0
+#define K_OHCI_TD_OUT 1
+#define K_OHCI_TD_IN 2
+#define K_OHCI_TD_RESERVED 3
+
+#define V_OHCI_TD_SETUP V_OHCI_TD_PID(K_OHCI_TD_SETUP)
+#define V_OHCI_TD_OUT V_OHCI_TD_PID(K_OHCI_TD_OUT)
+#define V_OHCI_TD_IN V_OHCI_TD_PID(K_OHCI_TD_IN)
+#define V_OHCI_TD_RESERVED V_OHCI_TD_PID(K_OHCI_TD_RESERVED)
+
+#define S_OHCI_TD_DI 21
+#define M_OHCI_TD_DI _OHCI_MAKEMASK(3,S_OHCI_TD_DI)
+#define V_OHCI_TD_DI(x) _OHCI_MAKEVALUE(x,S_OHCI_TD_DI)
+#define G_OHCI_TD_DI(x) _OHCI_GETVALUE(x,S_OHCI_TD_DI,M_OHCI_TD_DI)
+
+#define K_OHCI_TD_NOINTR 7
+#define V_OHCI_TD_NOINTR V_OHCI_TD_DI(K_OHCI_TD_NOINTR)
+
+#define S_OHCI_TD_DT 24
+#define M_OHCI_TD_DT _OHCI_MAKEMASK(2,S_OHCI_TD_DT)
+#define V_OHCI_TD_DT(x) _OHCI_MAKEVALUE(x,S_OHCI_TD_DT)
+#define G_OHCI_TD_DT(x) _OHCI_GETVALUE(x,S_OHCI_TD_DT,M_OHCI_TD_DT)
+
+#define K_OHCI_TD_DT_DATA0 2
+#define K_OHCI_TD_DT_DATA1 3
+#define K_OHCI_TD_DT_TCARRY 0
+
+#define S_OHCI_TD_EC 26
+#define M_OHCI_TD_EC _OHCI_MAKEMASK(2,S_OHCI_TD_EC)
+#define V_OHCI_TD_EC(x) _OHCI_MAKEVALUE(x,S_OHCI_TD_EC)
+#define G_OHCI_TD_EC(x) _OHCI_GETVALUE(x,S_OHCI_TD_EC,M_OHCI_TD_EC)
+
+#define S_OHCI_TD_CC 28
+#define M_OHCI_TD_CC _OHCI_MAKEMASK(4,S_OHCI_TD_CC)
+#define V_OHCI_TD_CC(x) _OHCI_MAKEVALUE(x,S_OHCI_TD_CC)
+#define G_OHCI_TD_CC(x) _OHCI_GETVALUE(x,S_OHCI_TD_CC,M_OHCI_TD_CC)
+
+#define K_OHCI_CC_NOERROR 0
+#define K_OHCI_CC_CRC 1
+#define K_OHCI_CC_BITSTUFFING 2
+#define K_OHCI_CC_DATATOGGLEMISMATCH 3
+#define K_OHCI_CC_STALL 4
+#define K_OHCI_CC_DEVICENOTRESPONDING 5
+#define K_OHCI_CC_PIDCHECKFAILURE 6
+#define K_OHCI_CC_UNEXPECTEDPID 7
+#define K_OHCI_CC_DATAOVERRUN 8
+#define K_OHCI_CC_DATAUNDERRUN 9
+#define K_OHCI_CC_BUFFEROVERRUN 12
+#define K_OHCI_CC_BUFFERUNDERRUN 13
+#define K_OHCI_CC_NOTACCESSED 15
+
+#define K_OHCI_CC_CANCELLED 0xFF
+
+#define OHCI_TD_MAX_DATA 8192
+
+
+/* *********************************************************************
+ * Endpoint descriptor (isochronous)
+ ********************************************************************* */
+
+/*
+ * TBA
+ */
+
+/* *********************************************************************
+ * Host Controller Communications Area (HCCA)
+ ********************************************************************* */
+
+#define OHCI_INTTABLE_SIZE 32
+
+#define OHCI_HCCA_ALIGN 256 /* Align on 256-byte boundary */
+
+typedef struct ohci_hcca_s {
+ uint32_t hcca_inttable[OHCI_INTTABLE_SIZE];
+ uint32_t hcca_framenum; /* note: actually two 16-bit fields */
+ uint32_t hcca_donehead;
+ uint32_t hcca_reserved[29]; /* round to 256 bytes */
+ uint32_t hcca_pad;
+} ohci_hcca_t;
+
+/* *********************************************************************
+ * Registers
+ ********************************************************************* */
+
+#define _OHCI_REGIDX(x) ((x)*4)
+
+#define R_OHCI_REVISION _OHCI_REGIDX(0)
+#define R_OHCI_CONTROL _OHCI_REGIDX(1)
+#define R_OHCI_CMDSTATUS _OHCI_REGIDX(2)
+#define R_OHCI_INTSTATUS _OHCI_REGIDX(3)
+#define R_OHCI_INTENABLE _OHCI_REGIDX(4)
+#define R_OHCI_INTDISABLE _OHCI_REGIDX(5)
+#define R_OHCI_HCCA _OHCI_REGIDX(6)
+#define R_OHCI_PERIODCURRENTED _OHCI_REGIDX(7)
+#define R_OHCI_CONTROLHEADED _OHCI_REGIDX(8)
+#define R_OHCI_CONTROLCURRENTED _OHCI_REGIDX(9)
+#define R_OHCI_BULKHEADED _OHCI_REGIDX(10)
+#define R_OHCI_BULKCURRENTED _OHCI_REGIDX(11)
+#define R_OHCI_DONEHEAD _OHCI_REGIDX(12)
+#define R_OHCI_FMINTERVAL _OHCI_REGIDX(13)
+#define R_OHCI_FMREMAINING _OHCI_REGIDX(14)
+#define R_OHCI_FMNUMBER _OHCI_REGIDX(15)
+#define R_OHCI_PERIODICSTART _OHCI_REGIDX(16)
+#define R_OHCI_LSTHRESHOLD _OHCI_REGIDX(17)
+#define R_OHCI_RHDSCRA _OHCI_REGIDX(18)
+#define R_OHCI_RHDSCRB _OHCI_REGIDX(19)
+#define R_OHCI_RHSTATUS _OHCI_REGIDX(20)
+#define R_OHCI_RHPORTSTATUS(x) _OHCI_REGIDX(20+(x)) /* note: 1-based! */
+
+
+/*
+ * R_OHCI_REVISION
+ */
+
+#define S_OHCI_REV_REV 0
+#define M_OHCI_REV_REV _OHCI_MAKEMASK(8,S_OHCI_REV_REV)
+#define V_OHCI_REV_REV(x) _OHCI_MAKEVALUE(x,S_OHCI_REV_REV)
+#define G_OHCI_REV_REV(x) _OHCI_GETVALUE(x,S_OHCI_REV_REV,M_OHCI_REV_REV)
+#define K_OHCI_REV_11 0x10
+
+/*
+ * R_OHCI_CONTROL
+ */
+
+#define S_OHCI_CONTROL_CBSR 0
+#define M_OHCI_CONTROL_CBSR _OHCI_MAKEMASK(2,S_OHCI_CONTROL_CBSR)
+#define V_OHCI_CONTROL_CBSR(x) _OHCI_MAKEVALUE(x,S_OHCI_CONTROL_CBSR)
+#define G_OHCI_CONTROL_CBSR(x) _OHCI_GETVALUE(x,S_OHCI_CONTROL_CBSR,M_OHCI_CONTROL_CBSR)
+
+#define K_OHCI_CBSR_11 0
+#define K_OHCI_CBSR_21 1
+#define K_OHCI_CBSR_31 2
+#define K_OHCI_CBSR_41 3
+
+#define M_OHCI_CONTROL_PLE _OHCI_MAKEMASK1(2)
+#define M_OHCI_CONTROL_IE _OHCI_MAKEMASK1(3)
+#define M_OHCI_CONTROL_CLE _OHCI_MAKEMASK1(4)
+#define M_OHCI_CONTROL_BLE _OHCI_MAKEMASK1(5)
+
+#define S_OHCI_CONTROL_HCFS 6
+#define M_OHCI_CONTROL_HCFS _OHCI_MAKEMASK(2,S_OHCI_CONTROL_HCFS)
+#define V_OHCI_CONTROL_HCFS(x) _OHCI_MAKEVALUE(x,S_OHCI_CONTROL_HCFS)
+#define G_OHCI_CONTROL_HCFS(x) _OHCI_GETVALUE(x,S_OHCI_CONTROL_HCFS,M_OHCI_CONTROL_HCFS)
+
+#define K_OHCI_HCFS_RESET 0
+#define K_OHCI_HCFS_RESUME 1
+#define K_OHCI_HCFS_OPERATIONAL 2
+#define K_OHCI_HCFS_SUSPEND 3
+
+#define M_OHCI_CONTROL_IR _OHCI_MAKEMASK1(8)
+#define M_OHCI_CONTROL_RWC _OHCI_MAKEMASK1(9)
+#define M_OHCI_CONTROL_RWE _OHCI_MAKEMASK1(10)
+
+/*
+ * R_OHCI_CMDSTATUS
+ */
+
+#define M_OHCI_CMDSTATUS_HCR _OHCI_MAKEMASK1(0)
+#define M_OHCI_CMDSTATUS_CLF _OHCI_MAKEMASK1(1)
+#define M_OHCI_CMDSTATUS_BLF _OHCI_MAKEMASK1(2)
+#define M_OHCI_CMDSTATUS_OCR _OHCI_MAKEMASK1(3)
+
+#define S_OHCI_CMDSTATUS_SOC 16
+#define M_OHCI_CMDSTATUS_SOC _OHCI_MAKEMASK(2,S_OHCI_CMDSTATUS_SOC)
+#define V_OHCI_CMDSTATUS_SOC(x) _OHCI_MAKEVALUE(x,S_OHCI_CMDSTATUS_SOC)
+#define G_OHCI_CMDSTATUS_SOC(x) _OHCI_GETVALUE(x,S_OHCI_CMDSTATUS_SOC,M_OHCI_CMDSTATUS_SOC)
+
+/*
+ * R_OHCI_INTSTATUS, R_OHCI_INTENABLE, R_OHCI_INTDISABLE
+ */
+
+
+#define M_OHCI_INT_SO _OHCI_MAKEMASK1(0)
+#define M_OHCI_INT_WDH _OHCI_MAKEMASK1(1)
+#define M_OHCI_INT_SF _OHCI_MAKEMASK1(2)
+#define M_OHCI_INT_RD _OHCI_MAKEMASK1(3)
+#define M_OHCI_INT_UE _OHCI_MAKEMASK1(4)
+#define M_OHCI_INT_FNO _OHCI_MAKEMASK1(5)
+#define M_OHCI_INT_RHSC _OHCI_MAKEMASK1(6)
+#define M_OHCI_INT_OC _OHCI_MAKEMASK1(30)
+#define M_OHCI_INT_MIE _OHCI_MAKEMASK1(31)
+
+#define M_OHCI_INT_ALL M_OHCI_INT_SO | M_OHCI_INT_WDH | M_OHCI_INT_SF | \
+ M_OHCI_INT_RD | M_OHCI_INT_UE | M_OHCI_INT_FNO | \
+ M_OHCI_INT_RHSC | M_OHCI_INT_OC | M_OHCI_INT_MIE
+
+/*
+ * R_OHCI_FMINTERVAL
+ */
+
+
+#define S_OHCI_FMINTERVAL_FI 0
+#define M_OHCI_FMINTERVAL_FI _OHCI_MAKEMASK(14,S_OHCI_FMINTERVAL_FI)
+#define V_OHCI_FMINTERVAL_FI(x) _OHCI_MAKEVALUE(x,S_OHCI_FMINTERVAL_FI)
+#define G_OHCI_FMINTERVAL_FI(x) _OHCI_GETVALUE(x,S_OHCI_FMINTERVAL_FI,M_OHCI_FMINTERVAL_FI)
+
+#define S_OHCI_FMINTERVAL_FSMPS 16
+#define M_OHCI_FMINTERVAL_FSMPS _OHCI_MAKEMASK(15,S_OHCI_FMINTERVAL_FSMPS)
+#define V_OHCI_FMINTERVAL_FSMPS(x) _OHCI_MAKEVALUE(x,S_OHCI_FMINTERVAL_FSMPS)
+#define G_OHCI_FMINTERVAL_FSMPS(x) _OHCI_GETVALUE(x,S_OHCI_FMINTERVAL_FSMPS,M_OHCI_FMINTERVAL_FSMPS)
+
+#define OHCI_CALC_FSMPS(x) ((((x)-210)*6/7))
+
+
+#define M_OHCI_FMINTERVAL_FIT _OHCI_MAKEMASK1(31)
+
+/*
+ * R_OHCI_FMREMAINING
+ */
+
+
+#define S_OHCI_FMREMAINING_FR 0
+#define M_OHCI_FMREMAINING_FR _OHCI_MAKEMASK(14,S_OHCI_FMREMAINING_FR)
+#define V_OHCI_FMREMAINING_FR(x) _OHCI_MAKEVALUE(x,S_OHCI_FMREMAINING_FR)
+#define G_OHCI_FMREMAINING_FR(x) _OHCI_GETVALUE(x,S_OHCI_FMREMAINING_FR,M_OHCI_FMREMAINING_FR)
+
+#define M_OHCI_FMREMAINING_FRT _OHCI_MAKEMASK1(31)
+
+/*
+ * R_OHCI_RHDSCRA
+ */
+
+
+#define S_OHCI_RHDSCRA_NDP 0
+#define M_OHCI_RHDSCRA_NDP _OHCI_MAKEMASK(8,S_OHCI_RHDSCRA_NDP)
+#define V_OHCI_RHDSCRA_NDP(x) _OHCI_MAKEVALUE(x,S_OHCI_RHDSCRA_NDP)
+#define G_OHCI_RHDSCRA_NDP(x) _OHCI_GETVALUE(x,S_OHCI_RHDSCRA_NDP,M_OHCI_RHDSCRA_NDP)
+
+#define M_OHCI_RHDSCRA_PSM _OHCI_MAKEMASK1(8)
+#define M_OHCI_RHDSCRA_NPS _OHCI_MAKEMASK1(9)
+#define M_OHCI_RHDSCRA_DT _OHCI_MAKEMASK1(10)
+#define M_OHCI_RHDSCRA_OCPM _OHCI_MAKEMASK1(11)
+#define M_OHCI_RHDSCRA_NOCP _OHCI_MAKEMASK1(12)
+
+#define S_OHCI_RHDSCRA_POTPGT 24
+#define M_OHCI_RHDSCRA_POTPGT _OHCI_MAKEMASK(8,S_OHCI_RHDSCRA_POTPGT)
+#define V_OHCI_RHDSCRA_POTPGT(x) _OHCI_MAKEVALUE(x,S_OHCI_RHDSCRA_POTPGT)
+#define G_OHCI_RHDSCRA_POTPGT(x) _OHCI_GETVALUE(x,S_OHCI_RHDSCRA_POTPGT,M_OHCI_RHDSCRA_POTPGT)
+
+/*
+ * R_OHCI_RHDSCRB
+ */
+
+#define S_OHCI_RHDSCRB_DR 0
+#define M_OHCI_RHDSCRB_DR _OHCI_MAKEMASK(16,S_OHCI_RHDSCRB_DR)
+#define V_OHCI_RHDSCRB_DR(x) _OHCI_MAKEVALUE(x,S_OHCI_RHDSCRB_DR)
+#define G_OHCI_RHDSCRB_DR(x) _OHCI_GETVALUE(x,S_OHCI_RHDSCRB_DR,M_OHCI_RHDSCRB_DR)
+
+#define S_OHCI_RHDSCRB_PPCM 16
+#define M_OHCI_RHDSCRB_PPCM _OHCI_MAKEMASK(16,S_OHCI_RHDSCRB_PPCM)
+#define V_OHCI_RHDSCRB_PPCM(x) _OHCI_MAKEVALUE(x,S_OHCI_RHDSCRB_PPCM)
+#define G_OHCI_RHDSCRB_PPCM(x) _OHCI_GETVALUE(x,S_OHCI_RHDSCRB_PPCM,M_OHCI_RHDSCRB_PPCM)
+
+/*
+ * R_OHCI_RHSTATUS
+ */
+
+#define M_OHCI_RHSTATUS_LPS _OHCI_MAKEMASK1(0)
+#define M_OHCI_RHSTATUS_OCI _OHCI_MAKEMASK1(1)
+#define M_OHCI_RHSTATUS_DRWE _OHCI_MAKEMASK1(15)
+#define M_OHCI_RHSTATUS_LPSC _OHCI_MAKEMASK1(16)
+#define M_OHCI_RHSTATUS_OCIC _OHCI_MAKEMASK1(17)
+#define M_OHCI_RHSTATUS_CRWE _OHCI_MAKEMASK1(31)
+
+/*
+ * R_OHCI_RHPORTSTATUS
+ */
+
+#define M_OHCI_RHPORTSTAT_CCS _OHCI_MAKEMASK1(0)
+#define M_OHCI_RHPORTSTAT_PES _OHCI_MAKEMASK1(1)
+#define M_OHCI_RHPORTSTAT_PSS _OHCI_MAKEMASK1(2)
+#define M_OHCI_RHPORTSTAT_POCI _OHCI_MAKEMASK1(3)
+#define M_OHCI_RHPORTSTAT_PRS _OHCI_MAKEMASK1(4)
+#define M_OHCI_RHPORTSTAT_PPS _OHCI_MAKEMASK1(8)
+#define M_OHCI_RHPORTSTAT_LSDA _OHCI_MAKEMASK1(9)
+#define M_OHCI_RHPORTSTAT_CSC _OHCI_MAKEMASK1(16)
+#define M_OHCI_RHPORTSTAT_PESC _OHCI_MAKEMASK1(17)
+#define M_OHCI_RHPORTSTAT_PSSC _OHCI_MAKEMASK1(18)
+#define M_OHCI_RHPORTSTAT_OCIC _OHCI_MAKEMASK1(19)
+#define M_OHCI_RHPORTSTAT_PRSC _OHCI_MAKEMASK1(20)
+
+#define M_OHCI_RHPORTSTAT_ALLC (M_OHCI_RHPORTSTAT_CSC | \
+ M_OHCI_RHPORTSTAT_PSSC | \
+ M_OHCI_RHPORTSTAT_OCIC | \
+ M_OHCI_RHPORTSTAT_PRSC)
+
+/* *********************************************************************
+ * OHCI Structures
+ ********************************************************************* */
+
+#define beginningof(ptr,type,field) ((type *) (((int) (ptr)) - ((int) ((type *) 0)->field)))
+
+#define OHCI_INTTREE_SIZE 63
+
+#define OHCI_EDPOOL_SIZE 128
+#define OHCI_TDPOOL_SIZE 32
+
+typedef struct ohci_endpoint_s {
+ struct ohci_endpoint_s *ep_next;
+ uint32_t ep_phys;
+ int ep_flags;
+ int ep_mps;
+ int ep_num;
+} ohci_endpoint_t;
+
+typedef struct ohci_transfer_s {
+ void *t_ref;
+ int t_length;
+ struct ohci_transfer_s *t_next;
+} ohci_transfer_t;
+
+typedef struct ohci_softc_s {
+ ohci_endpoint_t *ohci_edtable[OHCI_INTTREE_SIZE];
+ ohci_endpoint_t *ohci_inttable[OHCI_INTTABLE_SIZE];
+ ohci_endpoint_t *ohci_isoc_list;
+ ohci_endpoint_t *ohci_ctl_list;
+ ohci_endpoint_t *ohci_bulk_list;
+ ohci_hcca_t *ohci_hcca;
+ ohci_endpoint_t *ohci_endpoint_pool;
+ ohci_transfer_t *ohci_transfer_pool;
+ ohci_ed_t *ohci_hwedpool;
+ ohci_td_t *ohci_hwtdpool;
+ ohci_endpoint_t *ohci_endpoint_freelist;
+ ohci_transfer_t *ohci_transfer_freelist;
+#ifdef _CFE_
+ physaddr_t ohci_regs;
+#else
+ volatile uint32_t *ohci_regs;
+#endif
+ int ohci_ndp;
+ long ohci_addr;
+ uint32_t ohci_intdisable;
+
+ int ohci_rh_newaddr; /* Address to be set on next status update */
+ int ohci_rh_addr; /* address of root hub */
+ int ohci_rh_conf; /* current configuration # */
+ uint8_t ohci_rh_buf[128]; /* buffer to hold hub responses */
+ uint8_t *ohci_rh_ptr; /* pointer into buffer */
+ int ohci_rh_len; /* remaining bytes to transfer */
+ queue_t ohci_rh_intrq; /* Interrupt request queue */
+ usbbus_t *ohci_bus; /* owning usbbus structure */
+
+} ohci_softc_t;
+
+
+/*
+ * Misc stuff
+ */
+#define OHCI_RESET_DELAY 10
+
+
diff --git a/cfe/cfe/usb/usbchap9.h b/cfe/cfe/usb/usbchap9.h
new file mode 100644
index 0000000..1afd0db
--- /dev/null
+++ b/cfe/cfe/usb/usbchap9.h
@@ -0,0 +1,389 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Chapter 9 definitions File: usbchap9.h
+ *
+ * This module contains definitions from the USB specification,
+ * chapter 9.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+
+#ifndef _USBCHAP9_H_
+#define _USBCHAP9_H_
+
+#define MAXIMUM_USB_STRING_LENGTH 255
+
+/*
+ * values for the bits returned by the USB GET_STATUS command
+ */
+#define USB_GETSTATUS_SELF_POWERED 0x01
+#define USB_GETSTATUS_REMOTE_WAKEUP_ENABLED 0x02
+
+
+#define USB_DEVICE_DESCRIPTOR_TYPE 0x01
+#define USB_CONFIGURATION_DESCRIPTOR_TYPE 0x02
+#define USB_STRING_DESCRIPTOR_TYPE 0x03
+#define USB_INTERFACE_DESCRIPTOR_TYPE 0x04
+#define USB_ENDPOINT_DESCRIPTOR_TYPE 0x05
+#define USB_POWER_DESCRIPTOR_TYPE 0x06
+#define USB_HID_DESCRIPTOR_TYPE 0x21
+#define USB_HUB_DESCRIPTOR_TYPE 0x29
+
+#define USB_DESCRIPTOR_TYPEINDEX(d, i) ((uint16_t)((uint16_t)(d)<<8 | (i)))
+
+/*
+ * Values for bmAttributes field of an
+ * endpoint descriptor
+ */
+
+#define USB_ENDPOINT_TYPE_MASK 0x03
+
+#define USB_ENDPOINT_TYPE_CONTROL 0x00
+#define USB_ENDPOINT_TYPE_ISOCHRONOUS 0x01
+#define USB_ENDPOINT_TYPE_BULK 0x02
+#define USB_ENDPOINT_TYPE_INTERRUPT 0x03
+
+
+/*
+ * definitions for bits in the bmAttributes field of a
+ * configuration descriptor.
+ */
+#define USB_CONFIG_POWERED_MASK 0xc0
+
+#define USB_CONFIG_BUS_POWERED 0x80
+#define USB_CONFIG_SELF_POWERED 0x40
+#define USB_CONFIG_REMOTE_WAKEUP 0x20
+
+/*
+ * Endpoint direction bit, stored in address
+ */
+
+#define USB_ENDPOINT_DIRECTION_MASK 0x80
+#define USB_ENDPOINT_DIRECTION_IN 0x80 /* bit set means IN */
+
+/*
+ * test direction bit in the bEndpointAddress field of
+ * an endpoint descriptor.
+ */
+#define USB_ENDPOINT_DIR_OUT(addr) (!((addr) & USB_ENDPOINT_DIRECTION_MASK))
+#define USB_ENDPOINT_DIR_IN(addr) ((addr) & USB_ENDPOINT_DIRECTION_MASK)
+
+#define USB_ENDPOINT_ADDRESS(addr) ((addr) & 0x0F)
+
+/*
+ * USB defined request codes
+ * see chapter 9 of the USB 1.0 specifcation for
+ * more information.
+ */
+
+/*
+ * These are the correct values based on the USB 1.0
+ * specification
+ */
+
+#define USB_REQUEST_GET_STATUS 0x00
+#define USB_REQUEST_CLEAR_FEATURE 0x01
+
+#define USB_REQUEST_SET_FEATURE 0x03
+
+#define USB_REQUEST_SET_ADDRESS 0x05
+#define USB_REQUEST_GET_DESCRIPTOR 0x06
+#define USB_REQUEST_SET_DESCRIPTOR 0x07
+#define USB_REQUEST_GET_CONFIGURATION 0x08
+#define USB_REQUEST_SET_CONFIGURATION 0x09
+#define USB_REQUEST_GET_INTERFACE 0x0A
+#define USB_REQUEST_SET_INTERFACE 0x0B
+#define USB_REQUEST_SYNC_FRAME 0x0C
+
+
+/*
+ * defined USB device classes
+ */
+
+
+#define USB_DEVICE_CLASS_RESERVED 0x00
+#define USB_DEVICE_CLASS_AUDIO 0x01
+#define USB_DEVICE_CLASS_COMMUNICATIONS 0x02
+#define USB_DEVICE_CLASS_HUMAN_INTERFACE 0x03
+#define USB_DEVICE_CLASS_MONITOR 0x04
+#define USB_DEVICE_CLASS_PHYSICAL_INTERFACE 0x05
+#define USB_DEVICE_CLASS_POWER 0x06
+#define USB_DEVICE_CLASS_PRINTER 0x07
+#define USB_DEVICE_CLASS_STORAGE 0x08
+#define USB_DEVICE_CLASS_HUB 0x09
+#define USB_DEVICE_CLASS_VENDOR_SPECIFIC 0xFF
+
+/*
+ * USB defined Feature selectors
+ */
+
+#define USB_FEATURE_ENDPOINT_STALL 0x0000
+#define USB_FEATURE_REMOTE_WAKEUP 0x0001
+#define USB_FEATURE_POWER_D0 0x0002
+#define USB_FEATURE_POWER_D1 0x0003
+#define USB_FEATURE_POWER_D2 0x0004
+#define USB_FEATURE_POWER_D3 0x0005
+
+/*
+ * USB Device descriptor.
+ * To reduce problems with compilers trying to optimize
+ * this structure, all the fields are bytes.
+ */
+
+#define USBWORD(x) ((x) & 0xFF),(((x) >> 8) & 0xFF)
+
+#define USB_CONTROL_ENDPOINT_MIN_SIZE 8
+
+typedef struct usb_device_descr_s {
+ uint8_t bLength;
+ uint8_t bDescriptorType;
+ uint8_t bcdUSBLow,bcdUSBHigh;
+ uint8_t bDeviceClass;
+ uint8_t bDeviceSubClass;
+ uint8_t bDeviceProtocol;
+ uint8_t bMaxPacketSize0;
+ uint8_t idVendorLow,idVendorHigh;
+ uint8_t idProductLow,idProductHigh;
+ uint8_t bcdDeviceLow,bcdDeviceHigh;
+ uint8_t iManufacturer;
+ uint8_t iProduct;
+ uint8_t iSerialNumber;
+ uint8_t bNumConfigurations;
+} usb_device_descr_t;
+
+typedef struct usb_endpoint_descr_s {
+ uint8_t bLength;
+ uint8_t bDescriptorType;
+ uint8_t bEndpointAddress;
+ uint8_t bmAttributes;
+ uint8_t wMaxPacketSizeLow,wMaxPacketSizeHigh;
+ uint8_t bInterval;
+} usb_endpoint_descr_t;
+
+/*
+ * values for bmAttributes Field in
+ * USB_CONFIGURATION_DESCRIPTOR
+ */
+
+#define CONFIG_BUS_POWERED 0x80
+#define CONFIG_SELF_POWERED 0x40
+#define CONFIG_REMOTE_WAKEUP 0x20
+
+typedef struct usb_config_descr_s {
+ uint8_t bLength;
+ uint8_t bDescriptorType;
+ uint8_t wTotalLengthLow,wTotalLengthHigh;
+ uint8_t bNumInterfaces;
+ uint8_t bConfigurationValue;
+ uint8_t iConfiguration;
+ uint8_t bmAttributes;
+ uint8_t MaxPower;
+} usb_config_descr_t;
+
+#define USB_INTERFACE_CLASS_HUB 0x09
+
+typedef struct usb_interface_descr_s {
+ uint8_t bLength;
+ uint8_t bDescriptorType;
+ uint8_t bInterfaceNumber;
+ uint8_t bAlternateSetting;
+ uint8_t bNumEndpoints;
+ uint8_t bInterfaceClass;
+ uint8_t bInterfaceSubClass;
+ uint8_t bInterfaceProtocol;
+ uint8_t iInterface;
+} usb_interface_descr_t;
+
+typedef struct usb_string_descr_s {
+ uint8_t bLength;
+ uint8_t bDescriptorType;
+ uint8_t bString[1];
+} usb_string_descr_t;
+
+/*
+ * USB power descriptor added to core specification
+ */
+
+#define USB_SUPPORT_D0_COMMAND 0x01
+#define USB_SUPPORT_D1_COMMAND 0x02
+#define USB_SUPPORT_D2_COMMAND 0x04
+#define USB_SUPPORT_D3_COMMAND 0x08
+
+#define USB_SUPPORT_D1_WAKEUP 0x10
+#define USB_SUPPORT_D2_WAKEUP 0x20
+
+
+typedef struct usb_power_descr_s {
+ uint8_t bLength;
+ uint8_t bDescriptorType;
+ uint8_t bCapabilitiesFlags;
+ uint16_t EventNotification;
+ uint16_t D1LatencyTime;
+ uint16_t D2LatencyTime;
+ uint16_t D3LatencyTime;
+ uint8_t PowerUnit;
+ uint16_t D0PowerConsumption;
+ uint16_t D1PowerConsumption;
+ uint16_t D2PowerConsumption;
+} usb_power_descr_t;
+
+
+typedef struct usb_common_descr_s {
+ uint8_t bLength;
+ uint8_t bDescriptorType;
+} usb_common_descr_t;
+
+typedef struct usb_device_status_s {
+ uint8_t wDeviceStatusLow,wDeviceStatusHigh;
+} usb_device_status_t;
+
+
+/*
+ * Standard USB HUB definitions
+ *
+ * See Chapter 11
+ */
+
+#define USB_HUB_DESCR_SIZE 8
+typedef struct usb_hub_descr_s {
+ uint8_t bDescriptorLength; /* Length of this descriptor */
+ uint8_t bDescriptorType; /* Hub configuration type */
+ uint8_t bNumberOfPorts; /* number of ports on this hub */
+ uint8_t wHubCharacteristicsLow; /* Hub Charateristics */
+ uint8_t wHubCharacteristicsHigh;
+ uint8_t bPowerOnToPowerGood; /* port power on till power good in 2ms */
+ uint8_t bHubControlCurrent; /* max current in mA */
+ /* room for 255 ports power control and removable bitmask */
+ uint8_t bRemoveAndPowerMask[64];
+} usb_hub_descr_t;
+
+#define USB_HUBCHAR_PWR_GANGED 0
+#define USB_HUBCHAR_PWR_IND 1
+#define USB_HUBCHAR_PWR_NONE 2
+
+typedef struct usb_hub_status_s {
+ uint8_t wHubStatusLow,wHubStatusHigh;
+ uint8_t wHubChangeLow,wHubChangeHigh;
+} usb_hub_status_t;
+
+#define USB_PORT_STATUS_CONNECT 0x0001
+#define USB_PORT_STATUS_ENABLED 0x0002
+#define USB_PORT_STATUS_SUSPEND 0x0004
+#define USB_PORT_STATUS_OVERCUR 0x0008
+#define USB_PORT_STATUS_RESET 0x0010
+#define USB_PORT_STATUS_POWER 0x0100
+#define USB_PORT_STATUS_LOWSPD 0x0200
+
+typedef struct usb_port_status_s {
+ uint8_t wPortStatusLow,wPortStatusHigh;
+ uint8_t wPortChangeLow,wPortChangeHigh;
+} usb_port_status_t;
+
+
+#define USB_HUBREQ_GET_STATUS 0
+#define USB_HUBREQ_CLEAR_FEATURE 1
+#define USB_HUBREQ_GET_STATE 2
+#define USB_HUBREQ_SET_FEATURE 3
+#define USB_HUBREQ_GET_DESCRIPTOR 6
+#define USB_HUBREQ_SET_DESCRIPTOR 7
+
+#define USB_HUB_FEATURE_C_LOCAL_POWER 0
+#define USB_HUB_FEATURE_C_OVER_CURRENT 1
+
+#define USB_PORT_FEATURE_CONNECTION 0
+#define USB_PORT_FEATURE_ENABLE 1
+#define USB_PORT_FEATURE_SUSPEND 2
+#define USB_PORT_FEATURE_OVER_CURRENT 3
+#define USB_PORT_FEATURE_RESET 4
+#define USB_PORT_FEATURE_POWER 8
+#define USB_PORT_FEATURE_LOW_SPEED 9
+#define USB_PORT_FEATURE_C_PORT_CONNECTION 16
+#define USB_PORT_FEATURE_C_PORT_ENABLE 17
+#define USB_PORT_FEATURE_C_PORT_SUSPEND 18
+#define USB_PORT_FEATURE_C_PORT_OVER_CURRENT 19
+#define USB_PORT_FEATURE_C_PORT_RESET 20
+
+
+#define GETUSBFIELD(s,f) (((s)->f##Low) | ((s)->f##High << 8))
+#define PUTUSBFIELD(s,f,v) (s)->f##Low = (v & 0xFF); \
+ (s)->f##High = ((v)>>8 & 0xFF)
+
+typedef struct usb_device_request_s {
+ uint8_t bmRequestType;
+ uint8_t bRequest;
+ uint8_t wValueLow,wValueHigh;
+ uint8_t wIndexLow,wIndexHigh;
+ uint8_t wLengthLow,wLengthHigh;
+} usb_device_request_t;
+
+/*
+ * Values for the bmAttributes field of a request
+ */
+#define USBREQ_DIR_IN 0x80
+#define USBREQ_DIR_OUT 0x00
+#define USBREQ_TYPE_STD 0x00
+#define USBREQ_TYPE_CLASS 0x20
+#define USBREQ_TYPE_VENDOR 0x40
+#define USBREQ_TYPE_RSVD 0x60
+#define USBREQ_REC_DEVICE 0x00
+#define USBREQ_REC_INTERFACE 0x01
+#define USBREQ_REC_ENDPOINT 0x02
+#define USBREQ_REC_OTHER 0x03
+
+#define REQCODE(req,dir,type,rec) (((req) << 8) | (dir) | (type) | (rec))
+#define REQSW(req,attr) (((req) << 8) | (attr))
+
+/* *********************************************************************
+ * HID stuff
+ ********************************************************************* */
+
+typedef struct usb_hid_descr_s {
+ uint8_t bLength;
+ uint8_t bDescriptorType;
+ uint8_t bcdHIDLow,bcdHIDHigh;
+ uint8_t bCountryCode;
+ uint8_t bNumDescriptors;
+ uint8_t bClassDescrType;
+ uint8_t wClassDescrLengthLow,wClassDescrLengthHigh;
+} usb_hid_descr_t;
+
+#endif /* _USBCHAP9_H_ */
diff --git a/cfe/cfe/usb/usbd.c b/cfe/cfe/usb/usbd.c
new file mode 100644
index 0000000..3e77049
--- /dev/null
+++ b/cfe/cfe/usb/usbd.c
@@ -0,0 +1,1215 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * USB device layer File: usbd.c
+ *
+ * This module deals with devices (things connected to USB buses)
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#ifndef _CFE_
+#include <stdio.h>
+#include <time.h>
+#include <memory.h>
+#include <stdint.h>
+#include "usbhack.h"
+#else
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+#include "cfe_timer.h"
+#endif
+
+#include "lib_malloc.h"
+#include "lib_queue.h"
+#include "usbchap9.h"
+#include "usbd.h"
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+int usb_noisy = 0;
+
+
+/* *********************************************************************
+ * usb_create_pipe(dev,epaddr,mps,flags)
+ *
+ * Create a pipe, causing the corresponding endpoint to
+ * be created in the host controller driver. Pipes form the
+ * basic "handle" for unidirectional communications with a
+ * USB device.
+ *
+ * Input parameters:
+ * dev - device we're talking about
+ * epaddr - endpoint address open, usually from the endpoint
+ * descriptor
+ * mps - maximum packet size understood by the device
+ * flags - flags for this pipe (UP_xxx flags)
+ *
+ * Return value:
+ * <0 if error
+ * 0 if ok
+ ********************************************************************* */
+
+int usb_create_pipe(usbdev_t *dev,int epaddr,int mps,int flags)
+{
+ usbpipe_t *pipe;
+ int pipeidx;
+
+ pipeidx = USB_EPADDR_TO_IDX(epaddr);
+
+ if (dev->ud_pipes[pipeidx] != NULL) {
+ printf("Trying to create a pipe that was already created!\n");
+ return 0;
+ }
+
+ pipe = KMALLOC(sizeof(usbpipe_t),0);
+
+ if (!pipe) return -1;
+
+ pipe->up_flags = flags;
+ pipe->up_num = pipeidx;
+ pipe->up_mps = mps;
+ pipe->up_dev = dev;
+ if (dev->ud_flags & UD_FLAG_LOWSPEED) flags |= UP_TYPE_LOWSPEED;
+ pipe->up_hwendpoint = UBEPTCREATE(dev->ud_bus,
+ dev->ud_address,
+ USB_ENDPOINT_ADDRESS(epaddr),
+ mps,
+ flags);
+
+ dev->ud_pipes[pipeidx] = pipe;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * usb_open_pipe(dev,epdesc)
+ *
+ * Open a pipe given an endpoint descriptor - this is the
+ * normal way pipes get open, since you've just selected a
+ * configuration and have the descriptors handy with all
+ * the information you need.
+ *
+ * Input parameters:
+ * dev - device we're talking to
+ * epdesc - endpoint descriptor
+ *
+ * Return value:
+ * <0 if error
+ * else endpoint/pipe number (from descriptor)
+ ********************************************************************* */
+
+int usb_open_pipe(usbdev_t *dev,usb_endpoint_descr_t *epdesc)
+{
+ int res;
+ int flags = 0;
+
+ if (USB_ENDPOINT_DIR_IN(epdesc->bEndpointAddress)) flags |= UP_TYPE_IN;
+ else flags |= UP_TYPE_OUT;
+
+ switch (epdesc->bmAttributes & USB_ENDPOINT_TYPE_MASK) {
+ case USB_ENDPOINT_TYPE_CONTROL:
+ flags |= UP_TYPE_CONTROL;
+ break;
+ case USB_ENDPOINT_TYPE_ISOCHRONOUS:
+ flags |= UP_TYPE_ISOC;
+ break;
+ case USB_ENDPOINT_TYPE_BULK:
+ flags |= UP_TYPE_BULK;
+ break;
+ case USB_ENDPOINT_TYPE_INTERRUPT:
+ flags |= UP_TYPE_INTR;
+ break;
+ }
+
+ res = usb_create_pipe(dev,
+ epdesc->bEndpointAddress,
+ GETUSBFIELD(epdesc,wMaxPacketSize),
+ flags);
+
+ if (res < 0) return res;
+
+ return epdesc->bEndpointAddress;
+}
+
+
+/* *********************************************************************
+ * usb_destroy_pipe(dev,epaddr)
+ *
+ * Close(destroy) an open pipe and remove endpoint descriptor
+ *
+ * Input parameters:
+ * dev - device we're talking to
+ * epaddr - pipe to close
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void usb_destroy_pipe(usbdev_t *dev,int epaddr)
+{
+ usbpipe_t *pipe;
+ int pipeidx;
+
+ pipeidx = USB_EPADDR_TO_IDX(epaddr);
+
+ pipe = dev->ud_pipes[pipeidx];
+ if (!pipe) return;
+
+ if (dev->ud_pipes[pipeidx]) {
+ UBEPTDELETE(dev->ud_bus,
+ dev->ud_pipes[pipeidx]->up_hwendpoint);
+ }
+
+ KFREE(dev->ud_pipes[pipeidx]);
+ dev->ud_pipes[pipeidx] = NULL;
+}
+
+/* *********************************************************************
+ * usb_destroy_device(dev)
+ *
+ * Delete an entire USB device, closing its pipes and freeing
+ * the device data structure
+ *
+ * Input parameters:
+ * dev - device to destroy
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void usb_destroy_device(usbdev_t *dev)
+{
+ int idx;
+
+ for (idx = 0; idx < UD_MAX_PIPES; idx++) {
+ if (dev->ud_pipes[idx]) {
+ UBEPTDELETE(dev->ud_bus,
+ dev->ud_pipes[idx]->up_hwendpoint);
+ KFREE(dev->ud_pipes[idx]);
+ }
+ }
+
+ dev->ud_bus->ub_devices[dev->ud_address] = NULL;
+
+ KFREE(dev);
+}
+
+
+/* *********************************************************************
+ * usb_create_device(bus,lowspeed)
+ *
+ * Create a new USB device. This device will be set to
+ * communicate on address zero (default address) and will be
+ * ready for basic stuff so we can figure out what it is.
+ * The control pipe will be open, so you can start requesting
+ * descriptors right away.
+ *
+ * Input parameters:
+ * bus - bus to create device on
+ * lowspeed - true if it's a lowspeed device (the hubs tell
+ * us these things)
+ *
+ * Return value:
+ * usb device structure, or NULL
+ ********************************************************************* */
+
+usbdev_t *usb_create_device(usbbus_t *bus,int lowspeed)
+{
+ usbdev_t *dev;
+ int pipeflags;
+
+ /*
+ * Create the device structure.
+ */
+
+ dev = KMALLOC(sizeof(usbdev_t),0);
+ memset(dev,0,sizeof(usbdev_t));
+
+ dev->ud_bus = bus;
+ dev->ud_address = 0; /* default address */
+ dev->ud_parent = NULL;
+ dev->ud_flags = 0;
+
+ /*
+ * Adjust things based on the target device speed
+ */
+
+ pipeflags = UP_TYPE_CONTROL;
+ if (lowspeed) {
+ pipeflags |= UP_TYPE_LOWSPEED;
+ dev->ud_flags |= UD_FLAG_LOWSPEED;
+ }
+
+ /*
+ * Create the control pipe.
+ */
+
+ usb_create_pipe(dev,0,
+ USB_CONTROL_ENDPOINT_MIN_SIZE,
+ pipeflags);
+
+ return dev;
+}
+
+/* *********************************************************************
+ * usb_make_request(dev,epaddr,buf,len,flags)
+ *
+ * Create a template request structure with basic fields
+ * ready to go. A shorthand routine.
+ *
+ * Input parameters:
+ * dev- device we're talking to
+ * epaddr - endpoint address, from usb_open_pipe()
+ * buf,length - user buffer and buffer length
+ * flags - transfer direction, etc. (UR_xxx flags)
+ *
+ * Return value:
+ * usbreq_t pointer, or NULL
+ ********************************************************************* */
+
+usbreq_t *usb_make_request(usbdev_t *dev,int epaddr,uint8_t *buf,int length,int flags)
+{
+ usbreq_t *ur;
+ usbpipe_t *pipe;
+ int pipeidx;
+
+ pipeidx = USB_EPADDR_TO_IDX(epaddr);
+
+ pipe = dev->ud_pipes[pipeidx];
+
+ if (pipe == NULL) return NULL;
+
+ ur = KMALLOC(sizeof(usbreq_t),0);
+ memset(ur,0,sizeof(usbreq_t));
+
+ ur->ur_dev = dev;
+ ur->ur_pipe = pipe;
+ ur->ur_buffer = buf;
+ ur->ur_length = length;
+ ur->ur_flags = flags;
+ ur->ur_callback = NULL;
+
+ return ur;
+
+}
+
+/* *********************************************************************
+ * usb_poll(bus)
+ *
+ * Handle device-driver polling - simply vectors to host controller
+ * driver.
+ *
+ * Input parameters:
+ * bus - bus structure
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void usb_poll(usbbus_t *bus)
+{
+ UBINTR(bus);
+}
+
+/* *********************************************************************
+ * usb_daemon(bus)
+ *
+ * Polls for topology changes and initiates a bus scan if
+ * necessary.
+ *
+ * Input parameters:
+ * bus - bus to watch
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void usb_daemon(usbbus_t *bus)
+{
+ /*
+ * Just see if someone flagged a need for a scan here
+ * and start the bus scan if necessary.
+ *
+ * The actual scanning is a hub function, starting at the
+ * root hub, so the code for that is over there.
+ */
+
+ if (bus->ub_flags & UB_FLG_NEEDSCAN) {
+ bus->ub_flags &= ~UB_FLG_NEEDSCAN;
+ usb_scan(bus);
+ }
+}
+
+/* *********************************************************************
+ * usb_cancel_request(ur)
+ *
+ * Cancel a pending usb transfer request.
+ *
+ * Input parameters:
+ * ur - request to cancel
+ *
+ * Return value:
+ * 0 if ok
+ * else error (could not find request)
+ ********************************************************************* */
+
+int usb_cancel_request(usbreq_t *ur)
+{
+ printf("usb_cancel_request is not implemented.\n");
+ return 0;
+}
+
+/* *********************************************************************
+ * usb_free_request(ur)
+ *
+ * Return a transfer request to the free pool.
+ *
+ * Input parameters:
+ * ur - request to return
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void usb_free_request(usbreq_t *ur)
+{
+ if (ur->ur_inprogress) {
+ printf("Yow! Tried to free a request that was in progress!\n");
+ return;
+ }
+ KFREE(ur);
+}
+
+/* *********************************************************************
+ * usb_delay_ms(bus,ms)
+ *
+ * Wait a while, calling the polling routine as we go.
+ *
+ * Input parameters:
+ * bus - bus we're talking to
+ * ms - how long to wait
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+
+void usb_delay_ms(usbbus_t *bus,int ms)
+{
+#ifdef _CFE_
+ cfe_sleep(1+((ms*CFE_HZ)/1000));
+#else
+ mydelay(ms);
+#endif
+}
+
+/* *********************************************************************
+ * usb_queue_request(ur)
+ *
+ * Call the transfer handler in the host controller driver to
+ * set up a transfer descriptor
+ *
+ * Input parameters:
+ * ur - request to queue
+ *
+ * Return value:
+ * 0 if ok
+ * else error
+ ********************************************************************* */
+
+int usb_queue_request(usbreq_t *ur)
+{
+ int res;
+
+ ur->ur_inprogress = 1;
+ ur->ur_xferred = 0;
+ res = UBXFER(ur->ur_dev->ud_bus,
+ ur->ur_pipe->up_hwendpoint,
+ ur);
+ return res;
+}
+
+/* *********************************************************************
+ * usb_wait_request(ur)
+ *
+ * Wait until a request completes, calling the polling routine
+ * as we wait.
+ *
+ * Input parameters:
+ * ur - request to wait for
+ *
+ * Return value:
+ * request status
+ ********************************************************************* */
+
+int usb_wait_request(usbreq_t *ur)
+{
+ while ((volatile int) (ur->ur_inprogress)) {
+ usb_poll(ur->ur_dev->ud_bus);
+ }
+
+ return ur->ur_status;
+}
+
+/* *********************************************************************
+ * usb_sync_request(ur)
+ *
+ * Synchronous request - call usb_queue and then usb_wait
+ *
+ * Input parameters:
+ * ur - request to submit
+ *
+ * Return value:
+ * status of request
+ ********************************************************************* */
+
+int usb_sync_request(usbreq_t *ur)
+{
+ usb_queue_request(ur);
+ return usb_wait_request(ur);
+}
+
+/* *********************************************************************
+ * usb_simple_request(dev,reqtype,bRequest,wValue,wIndex)
+ *
+ * Handle a simple USB control pipe request. These are OUT
+ * requests with no data phase.
+ *
+ * Input parameters:
+ * dev - device we're talking to
+ * reqtype - request type (bmRequestType) for descriptor
+ * wValue - wValue for descriptor
+ * wIndex - wIndex for descriptor
+ *
+ * Return value:
+ * 0 if ok
+ * else error
+ ********************************************************************* */
+
+int usb_simple_request(usbdev_t *dev,uint8_t reqtype,int bRequest,int wValue,int wIndex)
+{
+#if 0
+ uint8_t *requestbuf;
+ usb_device_request_t *req;
+ usbreq_t *ur;
+ int res;
+
+ requestbuf = KMALLOC(32,0);
+
+ req = (usb_device_request_t *) requestbuf;
+
+ req->bmRequestType = reqtype;
+ req->bRequest = bRequest;
+ PUTUSBFIELD(req,wValue,wValue);
+ PUTUSBFIELD(req,wIndex,wIndex);
+ PUTUSBFIELD(req,wLength,0);
+
+ if (usb_noisy > 1) printf("Request: ");
+ ur = usb_make_request(dev,0,requestbuf,sizeof(usb_device_request_t),UR_FLAG_SETUP);
+ res = usb_sync_request(ur);
+ usb_free_request(ur);
+
+ if (res == 4) { /* STALL on control pipe */
+ if (usb_noisy > 1) printf("STALL\n");
+ usb_clear_stall(dev,dev->ud_pipes[0]->up_num);
+ return -1;
+ }
+
+ res = ur->ur_xferred;
+ if (usb_noisy > 1) printf("Result %d\n",res);
+
+ if (usb_noisy > 1) printf("Status: ");
+ ur = usb_make_request(dev,0,requestbuf,0,UR_FLAG_STATUS_IN);
+ res = usb_sync_request(ur);
+ usb_free_request(ur);
+ if (usb_noisy > 1) printf("Result %d\n",res);
+
+ if (res == 4) { /* STALL */
+ if (usb_noisy > 1) printf("STALL\n");
+ usb_clear_stall(dev,dev->ud_pipes[0]->up_num);
+ return -1;
+ }
+
+ KFREE(requestbuf);
+
+ return 0;
+#else
+ return usb_std_request(dev,reqtype,bRequest,wValue,wIndex,NULL,0);
+#endif
+
+}
+
+
+/* *********************************************************************
+ * usb_set_configuration(dev,config)
+ *
+ * Set the current configuration for a USB device.
+ *
+ * Input parameters:
+ * dev - device we're talking to
+ * config - bConfigValue for the device
+ *
+ * Return value:
+ * request status
+ ********************************************************************* */
+
+int usb_set_configuration(usbdev_t *dev,int config)
+{
+ int res;
+
+ res = usb_simple_request(dev,0x00,USB_REQUEST_SET_CONFIGURATION,config,0);
+
+ return res;
+}
+
+
+/* *********************************************************************
+ * usb_new_address(bus)
+ *
+ * Return the next available address for the specified bus
+ *
+ * Input parameters:
+ * bus - bus to assign an address for
+ *
+ * Return value:
+ * new address, <0 if error
+ ********************************************************************* */
+
+int usb_new_address(usbbus_t *bus)
+{
+ int idx;
+
+ for (idx = 1; idx < USB_MAX_DEVICES; idx++) {
+ if (bus->ub_devices[idx] == NULL) return idx;
+ }
+
+ return -1;
+}
+
+/* *********************************************************************
+ * usb_set_address(dev,address)
+ *
+ * Set the address of a device. This also puts the device
+ * in the master device table for the bus and reconfigures the
+ * address of the control pipe.
+ *
+ * Input parameters:
+ * dev - device we're talking to
+ * address - new address (1..127)
+ *
+ * Return value:
+ * request status
+ ********************************************************************* */
+
+int usb_set_address(usbdev_t *dev,int address)
+{
+ int res;
+ int idx;
+ usbpipe_t *pipe;
+
+ res = usb_simple_request(dev,0x00,USB_REQUEST_SET_ADDRESS,address,0);
+
+ if (res == 0) {
+ dev->ud_bus->ub_devices[address] = dev;
+ dev->ud_address = address;
+ for (idx = 0; idx < UD_MAX_PIPES; idx++) {
+ pipe = dev->ud_pipes[idx];
+ if (pipe && pipe->up_hwendpoint) {
+ UBEPTSETADDR(dev->ud_bus,pipe->up_hwendpoint,address);
+ }
+ }
+ }
+
+ return res;
+}
+
+/* *********************************************************************
+ * usb_set_ep0mps(dev,mps)
+ *
+ * Set the maximum packet size of endpoint zero (mucks with the
+ * endpoint in the host controller)
+ *
+ * Input parameters:
+ * dev - device we're talking to
+ * mps - max packet size for endpoint zero
+ *
+ * Return value:
+ * request status
+ ********************************************************************* */
+
+int usb_set_ep0mps(usbdev_t *dev,int mps)
+{
+ usbpipe_t *pipe;
+
+ pipe = dev->ud_pipes[0];
+ if (pipe && pipe->up_hwendpoint) {
+ UBEPTSETMPS(dev->ud_bus,pipe->up_hwendpoint,mps);
+ }
+ if (pipe) {
+ pipe->up_mps = mps;
+ }
+
+ return 0;
+}
+
+/* *********************************************************************
+ * usb_clear_stall(dev,epaddr)
+ *
+ * Clear a stall condition on the specified pipe
+ *
+ * Input parameters:
+ * dev - device we're talking to
+ * epaddr - endpoint address
+ *
+ * Return value:
+ * 0 if ok
+ * else error
+ ********************************************************************* */
+int usb_clear_stall(usbdev_t *dev,int epaddr)
+{
+ uint8_t *requestbuf;
+ usb_device_request_t *req;
+ usbreq_t *ur;
+ int res;
+ int pipeidx;
+
+ /*
+ * Clear the stall in the hardware.
+ */
+
+ pipeidx = USB_EPADDR_TO_IDX(epaddr);
+
+ UBEPTCLEARTOGGLE(dev->ud_bus,dev->ud_pipes[pipeidx]->up_hwendpoint);
+
+ /*
+ * Do the "clear stall" request. Note that we should do this
+ * without calling usb_simple_request, since usb_simple_request
+ * may itself stall.
+ */
+
+ requestbuf = KMALLOC(32,0);
+
+ req = (usb_device_request_t *) requestbuf;
+
+ req->bmRequestType = 0x02;
+ req->bRequest = USB_REQUEST_CLEAR_FEATURE;
+ PUTUSBFIELD(req,wValue,0); /* ENDPOINT_HALT */
+ PUTUSBFIELD(req,wIndex,epaddr);
+ PUTUSBFIELD(req,wLength,0);
+
+ ur = usb_make_request(dev,0,requestbuf,
+ sizeof(usb_device_request_t),
+ UR_FLAG_SETUP);
+ res = usb_sync_request(ur);
+ usb_free_request(ur);
+ ur = usb_make_request(dev,0,requestbuf,0,UR_FLAG_STATUS_IN);
+ res = usb_sync_request(ur);
+ usb_free_request(ur);
+
+ KFREE(requestbuf);
+
+ return 0;
+}
+
+
+
+/* *********************************************************************
+ * usb_std_request(dev,bmRequestType,bRequest,wValue,
+ * wIndex,buffer,length)
+ *
+ * Do a standard control request on the control pipe,
+ * with the appropriate setup, data, and status phases.
+ *
+ * Input parameters:
+ * dev - dev we're talking to
+ * bmRequestType,bRequest,wValue,wIndex - fields for the
+ * USB request structure
+ * buffer - user buffer
+ * length - length of user buffer
+ *
+ * Return value:
+ * number of bytes transferred
+ ********************************************************************* */
+
+int usb_std_request(usbdev_t *dev,uint8_t bmRequestType,
+ uint8_t bRequest,uint16_t wValue,
+ uint16_t wIndex,uint8_t *buffer,int length)
+{
+ usbpipe_t *pipe = dev->ud_pipes[0];
+ usbreq_t *ur;
+ int res;
+ usb_device_request_t *req;
+ uint8_t *databuf = NULL;
+
+ req = KMALLOC(32,0);
+
+ if ((buffer != NULL) && (length !=0)) {
+ databuf = KMALLOC(length,0);
+ if (!(bmRequestType & USBREQ_DIR_IN)) {
+ memcpy(databuf,buffer,length);
+ }
+ else {
+ memset(databuf,0,length);
+ }
+ }
+
+ req->bmRequestType = bmRequestType;
+ req->bRequest = bRequest;
+ PUTUSBFIELD(req,wValue,wValue);
+ PUTUSBFIELD(req,wIndex,wIndex);
+ PUTUSBFIELD(req,wLength,length);
+
+ ur = usb_make_request(dev,0,(uint8_t *)req,sizeof(usb_device_request_t),UR_FLAG_SETUP);
+ res = usb_sync_request(ur);
+ usb_free_request(ur);
+
+ if (length != 0) {
+ if (bmRequestType & USBREQ_DIR_IN) {
+ ur = usb_make_request(dev,0,databuf,length,UR_FLAG_IN);
+ }
+ else {
+ ur = usb_make_request(dev,0,databuf,length,UR_FLAG_OUT);
+ }
+
+ res = usb_sync_request(ur);
+
+ if (res == 4) { /* STALL */
+ usb_clear_stall(dev,pipe->up_num);
+ usb_free_request(ur);
+ if (databuf) KFREE(databuf);
+ KFREE(req);
+ return 0;
+ }
+
+ length = ur->ur_xferred;
+ usb_free_request(ur);
+ }
+
+ if ((length != 0) && (databuf != NULL) && (bmRequestType & USBREQ_DIR_IN)) {
+ memcpy(buffer,databuf,length);
+ }
+
+ if (bmRequestType & USBREQ_DIR_IN) {
+ ur = usb_make_request(dev,0,(uint8_t *)req,0,UR_FLAG_STATUS_OUT);
+ }
+ else {
+ ur = usb_make_request(dev,0,(uint8_t *)req,0,UR_FLAG_STATUS_IN);
+ }
+
+ res = usb_sync_request(ur);
+ usb_free_request(ur);
+
+ if (res == 4) { /* STALL */
+ usb_clear_stall(dev,pipe->up_num);
+ if (databuf) KFREE(databuf);
+ KFREE(req);
+ return 0;
+ }
+
+ if (databuf) KFREE(databuf);
+ KFREE(req);
+
+ return length;
+}
+
+
+
+
+/* *********************************************************************
+ * usb_get_descriptor(dev,reqtype,dsctype,dscidx,respbuf,buflen)
+ *
+ * Request a descriptor from the device.
+ *
+ * Input parameters:
+ * dev - device we're talking to
+ * reqtype - bmRequestType field for descriptor we want
+ * dsctype - descriptor type we want
+ * dscidx - index of descriptor we want (often zero)
+ * respbuf - response buffer
+ * buflen - length of response buffer
+ *
+ * Return value:
+ * number of bytes transferred
+ ********************************************************************* */
+
+int usb_get_descriptor(usbdev_t *dev,uint8_t reqtype,int dsctype,int dscidx,
+ uint8_t *respbuf,int buflen)
+{
+ return usb_std_request(dev,
+ reqtype,USB_REQUEST_GET_DESCRIPTOR,
+ USB_DESCRIPTOR_TYPEINDEX(dsctype,dscidx),
+ 0,
+ respbuf,buflen);
+}
+
+/* *********************************************************************
+ * usb_get_string(dev,id,buf,maxlen)
+ *
+ * Request a string from the device, converting it from
+ * unicode to ascii (brutally).
+ *
+ * Input parameters:
+ * dev - device we're talking to
+ * id - string ID
+ * buf - buffer to receive string (null terminated)
+ * maxlen - length of buffer
+ *
+ * Return value:
+ * number of characters in returned string
+ ********************************************************************* */
+
+int usb_get_string(usbdev_t *dev,int id,char *buf,int maxlen)
+{
+ int amtcopy;
+ uint8_t *respbuf;
+ int idx;
+ usb_string_descr_t *sdscr;
+
+ respbuf = KMALLOC(maxlen*2+2,0);
+ sdscr = (usb_string_descr_t *) respbuf;
+
+ /*
+ * First time just get the header of the descriptor so we can
+ * get the string length
+ */
+
+ amtcopy = usb_get_descriptor(dev,USBREQ_DIR_IN,USB_STRING_DESCRIPTOR_TYPE,id,
+ respbuf,2);
+
+ /*
+ * now do it again to get the whole string.
+ */
+
+ if (maxlen > sdscr->bLength) maxlen = sdscr->bLength;
+
+ amtcopy = usb_get_descriptor(dev,USBREQ_DIR_IN,USB_STRING_DESCRIPTOR_TYPE,id,
+ respbuf,maxlen);
+
+ *buf = '\0';
+ amtcopy = sdscr->bLength - 2;
+ if (amtcopy <= 0) return amtcopy;
+
+ for (idx = 0; idx < amtcopy; idx+=2) {
+ *buf++ = sdscr->bString[idx];
+ }
+
+ *buf = '\0';
+
+ KFREE(respbuf);
+
+ return amtcopy;
+}
+
+
+
+/* *********************************************************************
+ * usb_get_device_descriptor(dev,dscr,smallflg)
+ *
+ * Request the device descriptor for the device. This is often
+ * the first descriptor requested, so it needs to be done in
+ * stages so we can find out how big the control pipe is.
+ *
+ * Input parameters:
+ * dev - device we're talking to
+ * dscr - pointer to buffer to receive descriptor
+ * smallflg - TRUE to request just 8 bytes.
+ *
+ * Return value:
+ * number of bytes copied
+ ********************************************************************* */
+
+int usb_get_device_descriptor(usbdev_t *dev,usb_device_descr_t *dscr,int smallflg)
+{
+ int res;
+ uint8_t *respbuf;
+ int amtcopy;
+
+ /*
+ * Smallflg truncates the request 8 bytes. We need to do this for
+ * the very first transaction to a USB device in order to determine
+ * the size of its control pipe. Bad things will happen if you
+ * try to retrieve more data than the control pipe will hold.
+ *
+ * So, be conservative at first and get the first 8 bytes of the
+ * descriptor. Byte 7 is bMaxPacketSize0, the size of the control
+ * pipe. Then you can go back and submit a bigger request for
+ * everything else.
+ */
+
+ amtcopy = smallflg ? USB_CONTROL_ENDPOINT_MIN_SIZE : sizeof(usb_device_descr_t);
+
+ respbuf = KMALLOC(64,0);
+ res = usb_get_descriptor(dev,USBREQ_DIR_IN,USB_DEVICE_DESCRIPTOR_TYPE,0,respbuf,amtcopy);
+ memcpy(dscr,respbuf,amtcopy);
+ KFREE(respbuf);
+ return res;
+
+}
+
+/* *********************************************************************
+ * usb_get_config_descriptor(dev,dscr,idx,maxlen)
+ *
+ * Request the configuration descriptor from the device.
+ *
+ * Input parameters:
+ * dev - device we're talking to
+ * dscr - descriptor buffer (receives data from device)
+ * idx - index of config we want (usually zero)
+ * maxlen - total size of buffer to receive descriptor
+ *
+ * Return value:
+ * number of bytes copied
+ ********************************************************************* */
+
+int usb_get_config_descriptor(usbdev_t *dev,usb_config_descr_t *dscr,int idx,int maxlen)
+{
+ int res;
+ uint8_t *respbuf;
+
+ respbuf = KMALLOC(maxlen,0);
+ res = usb_get_descriptor(dev,USBREQ_DIR_IN,
+ USB_CONFIGURATION_DESCRIPTOR_TYPE,idx,
+ respbuf,maxlen);
+ memcpy(dscr,respbuf,maxlen);
+ KFREE(respbuf);
+ return res;
+
+}
+
+
+
+/* *********************************************************************
+ * usb_get_device_status(dev,status)
+ *
+ * Request status from the device (status descriptor)
+ *
+ * Input parameters:
+ * dev - device we're talking to
+ * status - receives device_status structure
+ *
+ * Return value:
+ * number of bytes returned
+ ********************************************************************* */
+
+int usb_get_device_status(usbdev_t *dev,usb_device_status_t *status)
+{
+ return usb_std_request(dev,
+ USBREQ_DIR_IN,
+ 0,
+ 0,
+ 0,
+ (uint8_t *) status,
+ sizeof(usb_device_status_t));
+}
+
+
+/* *********************************************************************
+ * usb_complete_request(ur,status)
+ *
+ * Called when a usb request completes - pass status to
+ * caller and call the callback if there is one.
+ *
+ * Input parameters:
+ * ur - usbreq_t to complete
+ * status - completion status
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void usb_complete_request(usbreq_t *ur,int status)
+{
+ ur->ur_status = status;
+ ur->ur_inprogress = 0;
+ if (ur->ur_callback) (*(ur->ur_callback))(ur);
+}
+
+
+/* *********************************************************************
+ * usb_initroot(bus)
+ *
+ * Initialize the root hub for the bus - we need to do this
+ * each time a bus is configured.
+ *
+ * Input parameters:
+ * bus - bus to initialize
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void usb_initroot(usbbus_t *bus)
+{
+ usbdev_t *dev;
+ usb_driver_t *drv;
+ int addr;
+ int res;
+ uint8_t *buf;
+ int len;
+ usb_config_descr_t cfgdescr;
+
+ /*
+ * Create a device for the root hub.
+ */
+
+ dev = usb_create_device(bus,0);
+ bus->ub_roothub = dev;
+
+ /*
+ * Get the device descriptor. Make sure it's a hub.
+ */
+
+ res = usb_get_device_descriptor(dev,&(dev->ud_devdescr),TRUE);
+
+ if (dev->ud_devdescr.bDeviceClass != USB_DEVICE_CLASS_HUB) {
+ printf("Error! Root device is not a hub!\n");
+ return;
+ }
+
+ /*
+ * Set up the max packet size for the control endpoint,
+ * then get the rest of the descriptor.
+ */
+
+ usb_set_ep0mps(dev,dev->ud_devdescr.bMaxPacketSize0);
+ res = usb_get_device_descriptor(dev,&(dev->ud_devdescr),FALSE);
+
+ /*
+ * Obtain a new address and set the address of the
+ * root hub to this address.
+ */
+
+ addr = usb_new_address(dev->ud_bus);
+ res = usb_set_address(dev,addr);
+
+ /*
+ * Get the configuration descriptor and all the
+ * associated interface and endpoint descriptors.
+ */
+
+ res = usb_get_config_descriptor(dev,&cfgdescr,0,
+ sizeof(usb_config_descr_t));
+ if (res != sizeof(usb_config_descr_t)) {
+ printf("[a]usb_get_config_descriptor returns %d\n",res);
+ }
+
+ len = GETUSBFIELD(&cfgdescr,wTotalLength);
+ buf = KMALLOC(len,0);
+
+ res = usb_get_config_descriptor(dev,(usb_config_descr_t *)buf,0,len);
+ if (res != len) {
+ printf("[b]usb_get_config_descriptor returns %d\n",res);
+ }
+
+ dev->ud_cfgdescr = (usb_config_descr_t *) buf;
+
+ /*
+ * Select the configuration. Not really needed for our poor
+ * imitation root hub, but it's the right thing to do.
+ */
+
+ usb_set_configuration(dev,cfgdescr.bConfigurationValue);
+
+ /*
+ * Find the driver for this. It had better be the hub
+ * driver.
+ */
+
+ drv = usb_find_driver(dev);
+
+ /*
+ * Call the attach method.
+ */
+
+ (*(drv->udrv_attach))(dev,drv);
+
+ /*
+ * Hub should now be operational.
+ */
+
+}
+
+
+/* *********************************************************************
+ * usb_find_cfg_descr(dev,dtype,idx)
+ *
+ * Find a configuration descriptor - we retrieved all the config
+ * descriptors during discovery, this lets us dig out the one
+ * we want.
+ *
+ * Input parameters:
+ * dev - device we are talking to
+ * dtype - descriptor type to find
+ * idx - index of descriptor if there's more than one
+ *
+ * Return value:
+ * pointer to descriptor or NULL if not found
+ ********************************************************************* */
+
+void *usb_find_cfg_descr(usbdev_t *dev,int dtype,int idx)
+{
+ uint8_t *endptr;
+ uint8_t *ptr;
+ usb_config_descr_t *cfgdscr;
+
+ if (dev->ud_cfgdescr == NULL) return NULL;
+
+ ptr = (uint8_t *) dev->ud_cfgdescr;
+ endptr = ptr + GETUSBFIELD((dev->ud_cfgdescr),wTotalLength);
+
+ while (ptr < endptr) {
+
+ cfgdscr = (usb_config_descr_t *) ptr;
+
+ if (cfgdscr->bDescriptorType == dtype) {
+ if (idx == 0) return (void *) ptr;
+ else idx--;
+ }
+
+ ptr += cfgdscr->bLength;
+
+ }
+
+ return NULL;
+}
diff --git a/cfe/cfe/usb/usbd.h b/cfe/cfe/usb/usbd.h
new file mode 100644
index 0000000..73fde86
--- /dev/null
+++ b/cfe/cfe/usb/usbd.h
@@ -0,0 +1,308 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * USB Device Layer definitions File: usbd.h
+ *
+ * Definitions for the USB device layer.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#ifndef _PHYSADDR_T_DEFINED_
+#include "lib_physio.h"
+#endif
+
+#include "usbchap9.h"
+
+
+/* *********************************************************************
+ * Forward declarations and opaque types
+ ********************************************************************* */
+
+typedef struct usb_hc_s usb_hc_t;
+typedef struct usb_ept_s usb_ept_t;
+typedef struct usb_hcdrv_s usb_hcdrv_t;
+typedef struct usbdev_s usbdev_t;
+typedef struct usb_driver_s usb_driver_t;
+
+/* *********************************************************************
+ * USB Bus structure - one of these per host controller
+ ********************************************************************* */
+
+#define USB_MAX_DEVICES 128
+
+typedef struct usbbus_s {
+ struct usbbus_s *ub_next; /* link to other buses */
+ usb_hc_t *ub_hwsoftc; /* bus driver softc */
+ usb_hcdrv_t *ub_hwdisp; /* bus driver dispatch */
+ usbdev_t *ub_roothub; /* root hub device */
+ usbdev_t *ub_devices[USB_MAX_DEVICES]; /* pointers to each device, idx by address */
+ unsigned int ub_flags; /* flag bits */
+ int ub_num; /* bus number */
+} usbbus_t;
+
+#define UB_FLG_NEEDSCAN 1 /* some device on bus needs scanning */
+
+/* *********************************************************************
+ * USB Pipe structure - one of these per unidirectional channel
+ * to an endpoint on a USB device
+ ********************************************************************* */
+
+#define UP_TYPE_CONTROL 1
+#define UP_TYPE_BULK 2
+#define UP_TYPE_INTR 4
+#define UP_TYPE_ISOC 8
+
+#define UP_TYPE_IN 128
+#define UP_TYPE_OUT 256
+
+#define UP_TYPE_LOWSPEED 16
+
+typedef struct usbpipe_s {
+ usb_ept_t *up_hwendpoint; /* OHCI-specific endpoint pointer */
+ usbdev_t *up_dev; /* our device info */
+ int up_num; /* pipe number */
+ int up_mps; /* max packet size */
+ int up_flags;
+} usbpipe_t;
+
+/* *********************************************************************
+ * USB device structure - one per device attached to the USB
+ * This is the basic structure applications will use to
+ * refer to a device.
+ ********************************************************************* */
+
+#define UD_FLAG_HUB 0x0001 /* this is a hub device */
+#define UD_FLAG_ROOTHUB 0x0002 /* this is a root hub device */
+#define UD_FLAG_LOWSPEED 0x0008 /* this is a lowspeed device */
+
+#define UD_MAX_PIPES 32
+#define USB_EPADDR_TO_IDX(addr) ((((addr)&0x80) >> 3) | ((addr) & 0x0F))
+//#define USB_EPADDR_TO_IDX(addr) USB_ENDPOINT_ADDRESS(addr)
+//#define UD_MAX_PIPES 16
+
+struct usbdev_s {
+ usb_driver_t *ud_drv; /* Driver's methods */
+ usbbus_t *ud_bus; /* owning bus */
+ int ud_address; /* USB address */
+ usbpipe_t *ud_pipes[UD_MAX_PIPES]; /* pipes, 0 is the control pipe */
+ struct usbdev_s *ud_parent; /* used for hubs */
+ int ud_flags;
+ void *ud_private; /* private data for device driver */
+ usb_device_descr_t ud_devdescr; /* device descriptor */
+ usb_config_descr_t *ud_cfgdescr; /* config, interface, and ep descrs */
+};
+
+
+/* *********************************************************************
+ * USB Request - basic structure to describe an in-progress
+ * I/O request. It associates buses, pipes, and buffers
+ * together.
+ ********************************************************************* */
+
+
+#define UR_FLAG_SYNC 0x8000
+
+#define UR_FLAG_SETUP 0x0001
+#define UR_FLAG_IN 0x0002
+#define UR_FLAG_OUT 0x0004
+#define UR_FLAG_STATUS_IN 0x0008 /* status phase of a control WRITE */
+#define UR_FLAG_STATUS_OUT 0x0010 /* status phase of a control READ */
+#define UR_FLAG_SHORTOK 0x0020 /* short transfers are ok */
+
+
+typedef struct usbreq_s {
+ queue_t ur_qblock;
+
+ /*
+ * pointers to our device and pipe
+ */
+
+ usbdev_t *ur_dev;
+ usbpipe_t *ur_pipe;
+
+ /*
+ * stuff to keep track of the data we transfer
+ */
+
+ uint8_t *ur_buffer;
+ int ur_length;
+ int ur_xferred;
+ int ur_status;
+ int ur_flags;
+
+ /*
+ * Stuff needed for the callback
+ */
+ void *ur_ref;
+ int ur_inprogress;
+ int (*ur_callback)(struct usbreq_s *req);
+
+ /*
+ * For use inside the ohci driver
+ */
+ void *ur_tdqueue;
+ int ur_tdcount;
+} usbreq_t;
+
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+int usb_create_pipe(usbdev_t *dev,int pipenum,int mps,int flags);
+void usb_destroy_pipe(usbdev_t *dev,int pipenum);
+int usb_set_address(usbdev_t *dev,int addr);
+usbdev_t *usb_create_device(usbbus_t *bus,int lowspeed);
+void usb_destroy_device(usbdev_t *dev);
+usbreq_t *usb_make_request(usbdev_t *dev,int pipenum,uint8_t *buf,int length,int flags);
+void usb_poll(usbbus_t *bus);
+void usb_daemon(usbbus_t *bus);
+int usb_cancel_request(usbreq_t *ur);
+void usb_free_request(usbreq_t *ur);
+int usb_queue_request(usbreq_t *ur);
+int usb_wait_request(usbreq_t *ur);
+int usb_sync_request(usbreq_t *ur);
+int usb_get_descriptor(usbdev_t *dev,uint8_t reqtype,int dsctype,int dscidx,uint8_t *buffer,int buflen);
+int usb_get_config_descriptor(usbdev_t *dev,usb_config_descr_t *dscr,int idx,int maxlen);
+int usb_get_device_status(usbdev_t *dev,usb_device_status_t *status);
+int usb_set_configuration(usbdev_t *dev,int config);
+int usb_open_pipe(usbdev_t *dev,usb_endpoint_descr_t *epdesc);
+int usb_simple_request(usbdev_t *dev,uint8_t reqtype,int bRequest,int wValue,int wIndex);
+void usb_complete_request(usbreq_t *ur,int status);
+int usb_get_device_descriptor(usbdev_t *dev,usb_device_descr_t *dscr,int smallflg);
+int usb_set_ep0mps(usbdev_t *dev,int mps);
+int usb_new_address(usbbus_t *bus);
+int usb_get_string(usbdev_t *dev,int id,char *buf,int maxlen);
+int usb_std_request(usbdev_t *dev,uint8_t bmRequestType,
+ uint8_t bRequest,uint16_t wValue,
+ uint16_t wIndex,uint8_t *buffer,int length);
+void *usb_find_cfg_descr(usbdev_t *dev,int dtype,int idx);
+void usb_delay_ms(usbbus_t *bus,int ms);
+int usb_clear_stall(usbdev_t *dev,int pipe);
+
+void usb_scan(usbbus_t *bus);
+void usbhub_map_tree(usbbus_t *bus,int (*func)(usbdev_t *dev,void *arg),void *arg);
+void usbhub_dumpbus(usbbus_t *bus,uint32_t verbose);
+
+void usb_initroot(usbbus_t *bus);
+
+
+/* *********************************************************************
+ * Host Controller Driver
+ * Methods for abstracting the USB host controller from the
+ * rest of the goop.
+ ********************************************************************* */
+
+struct usb_hcdrv_s {
+ usbbus_t * (*hcdrv_create)(physaddr_t regaddr);
+ void (*hcdrv_delete)(usbbus_t *);
+ int (*hcdrv_start)(usbbus_t *);
+ void (*hcdrv_stop)(usbbus_t *);
+ int (*hcdrv_intr)(usbbus_t *);
+ usb_ept_t * (*hcdrv_ept_create)(usbbus_t *,int usbaddr,int eptnum,int mps,int flags);
+ void (*hcdrv_ept_delete)(usbbus_t *,usb_ept_t *);
+ void (*hcdrv_ept_setmps)(usbbus_t *,usb_ept_t *,int mps);
+ void (*hcdrv_ept_setaddr)(usbbus_t *,usb_ept_t *,int addr);
+ void (*hcdrv_ept_cleartoggle)(usbbus_t *,usb_ept_t *);
+ int (*hcdrv_xfer)(usbbus_t *,usb_ept_t *uept,usbreq_t *ur);
+};
+
+#define UBCREATE(driver,addr) (*((driver)->hcdrv_create))(addr)
+#define UBDELETE(bus) (*((bus)->ub_hwdisp->hcdrv_delete))(bus)
+#define UBSTART(bus) (*((bus)->ub_hwdisp->hcdrv_start))(bus)
+#define UBSTOP(bus) (*((bus)->ub_hwdisp->hcdrv_stop))(bus)
+#define UBINTR(bus) (*((bus)->ub_hwdisp->hcdrv_intr))(bus)
+#define UBEPTCREATE(bus,addr,num,mps,flags) (*((bus)->ub_hwdisp->hcdrv_ept_create))(bus,addr,num,mps,flags)
+#define UBEPTDELETE(bus,ept) (*((bus)->ub_hwdisp->hcdrv_ept_delete))(bus,ept)
+#define UBEPTSETMPS(bus,ept,mps) (*((bus)->ub_hwdisp->hcdrv_ept_setmps))(bus,ept,mps)
+#define UBEPTSETADDR(bus,ept,addr) (*((bus)->ub_hwdisp->hcdrv_ept_setaddr))(bus,ept,addr)
+#define UBEPTCLEARTOGGLE(bus,ept) (*((bus)->ub_hwdisp->hcdrv_ept_cleartoggle))(bus,ept)
+#define UBXFER(bus,ept,xfer) (*((bus)->ub_hwdisp->hcdrv_xfer))(bus,ept,xfer)
+
+/* *********************************************************************
+ * Devices - methods for abstracting things that _use_ USB
+ * (devices you can plug into the USB) - the entry points
+ * here are basically just for device discovery, since the top half
+ * of the actual driver will be device-specific.
+ ********************************************************************* */
+
+struct usb_driver_s {
+ char *udrv_name;
+ int (*udrv_attach)(usbdev_t *,usb_driver_t *);
+ int (*udrv_detach)(usbdev_t *);
+};
+
+typedef struct usb_drvlist_s {
+ int udl_class;
+ int udl_vendor;
+ int udl_product;
+ usb_driver_t *udl_disp;
+} usb_drvlist_t;
+
+extern usb_driver_t *usb_find_driver(usbdev_t *dev);
+
+#define CLASS_ANY -1
+#define VENDOR_ANY -1
+#define PRODUCT_ANY -1
+
+void mydelay(int x);
+
+#define IS_HUB(dev) ((dev)->ud_devdescr.bDeviceClass == USB_DEVICE_CLASS_HUB)
+
+/* *********************************************************************
+ * Error codes
+ ********************************************************************* */
+
+#define USBD_ERR_OK 0 /* Request ok */
+#define USBD_ERR_STALLED -1 /* Endpoint is stalled */
+#define USBD_ERR_IOERROR -2 /* I/O error */
+#define USBD_ERR_HWERROR -3 /* Hardware failure */
+#define USBD_ERR_CANCELED -4 /* Request canceled */
+#define USBD_ERR_NOMEM -5 /* Out of memory */
+#define USBD_ERR_TIMEOUT -6 /* Request timeout */
+
+/* *********************************************************************
+ * Debug routines
+ ********************************************************************* */
+
+void usb_dbg_dumpportstatus(int port,usb_port_status_t *portstatus,int level);
+void usb_dbg_dumpdescriptors(usbdev_t *dev,uint8_t *ptr,int len);
+void usb_dbg_dumpcfgdescr(usbdev_t *dev);
+void usb_dbg_dumpeptdescr(usb_endpoint_descr_t * epdscr);
diff --git a/cfe/cfe/usb/usbdebug.c b/cfe/cfe/usb/usbdebug.c
new file mode 100644
index 0000000..14ed866
--- /dev/null
+++ b/cfe/cfe/usb/usbdebug.c
@@ -0,0 +1,307 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * USB debugging code File: usbdebug.c
+ *
+ * This module contains debug code for USB.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#ifndef _CFE_
+#include <stdio.h>
+#include <time.h>
+#include <memory.h>
+#include <stdint.h>
+#include "usbhack.h"
+#else
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+#endif
+
+#include "lib_malloc.h"
+#include "lib_queue.h"
+#include "usbchap9.h"
+#include "usbd.h"
+
+
+void usb_dbg_dumpportstatus(int port,usb_port_status_t *portstatus,int level)
+{
+ int idx;
+ uint16_t x;
+
+ for (idx = 0; idx < level; idx++) printf(" ");
+ printf("PORT %d STATUS\n",port);
+
+ for (idx = 0; idx < level; idx++) printf(" ");
+ x = GETUSBFIELD((portstatus),wPortStatus);
+ printf("wPortStatus = %04X ",x);
+ if (x & 1) printf("DevicePresent ");
+ if (x & 2) printf("Enabled ");
+ if (x & 4) printf("Suspend ");
+ if (x & 8) printf("OverCurrent ");
+ if (x & 16) printf("InReset ");
+ if (x & 256) printf("Powered ");
+ if (x & 512) printf("LowSpeed ");
+ printf("\n");
+ for (idx = 0; idx < level; idx++) printf(" ");
+ x = GETUSBFIELD((portstatus),wPortChange);
+ printf("wPortChange = %04X ",x);
+ if (x & 1) printf("ConnectChange ");
+ if (x & 2) printf("EnableChange ");
+ if (x & 4) printf("SuspendChange ");
+ if (x & 8) printf("OverCurrentChange ");
+ if (x & 16) printf("ResetChange ");
+ printf("\n");
+}
+
+void usb_dbg_dumpeptdescr(usb_endpoint_descr_t * epdscr)
+{
+ printf("---------------------------------------------------\n");
+ printf("ENDPOINT DESCRIPTOR\n");
+
+ printf("bLength = %d\n",epdscr->bLength);
+ printf("bDescriptorType = %d\n",epdscr->bDescriptorType);
+ printf("bEndpointAddr = %02X\n",epdscr->bEndpointAddress);
+ printf("bmAttrbutes = %02X\n",epdscr->bmAttributes);
+ printf("wMaxPacketSize = %d\n",GETUSBFIELD(epdscr,wMaxPacketSize));
+ printf("bInterval = %d\n",epdscr->bInterval);
+}
+
+static char *getstringmaybe(usbdev_t *dev,int string)
+{
+ static char buf[256];
+
+ return "";
+
+ if (string == 0) {
+ strcpy(buf,"none");
+ return buf;
+ }
+
+ memset(buf,0,sizeof(buf));
+
+ usb_get_string(dev,string,buf,sizeof(buf));
+
+ return buf;
+}
+
+void usb_dbg_dumpdescriptors(usbdev_t *dev,uint8_t *ptr,int len)
+{
+ uint8_t *endptr;
+ usb_config_descr_t *cfgdscr;
+ usb_interface_descr_t *ifdscr;
+ usb_device_descr_t *devdscr;
+ usb_endpoint_descr_t *epdscr;
+ usb_hid_descr_t *hiddscr;
+ usb_hub_descr_t *hubdscr;
+ static char *eptattribs[4] = {"Control","Isoc","Bulk","Interrupt"};
+ int idx;
+
+ endptr = ptr + len;
+
+ while (ptr < endptr) {
+
+ cfgdscr = (usb_config_descr_t *) ptr;
+
+ switch (cfgdscr->bDescriptorType) {
+ case USB_DEVICE_DESCRIPTOR_TYPE:
+ devdscr = (usb_device_descr_t *) ptr;
+ printf("---------------------------------------------------\n");
+ printf("DEVICE DESCRIPTOR\n");
+ printf("bLength = %d\n",devdscr->bLength);
+ printf("bDescriptorType = %d\n",devdscr->bDescriptorType);
+ printf("bcdUSB = %04X\n",GETUSBFIELD(devdscr,bcdUSB));
+ printf("bDeviceClass = %d\n",devdscr->bDeviceClass);
+ printf("bDeviceSubClass = %d\n",devdscr->bDeviceSubClass);
+ printf("bDeviceProtocol = %d\n",devdscr->bDeviceProtocol);
+ printf("bMaxPktSize0 = %d\n",devdscr->bMaxPacketSize0);
+ if (endptr-ptr <= 8) break;
+ printf("idVendor = %04X (%d)\n",
+ GETUSBFIELD(devdscr,idVendor),
+ GETUSBFIELD(devdscr,idVendor));
+ printf("idProduct = %04X (%d)\n",
+ GETUSBFIELD(devdscr,idProduct),
+ GETUSBFIELD(devdscr,idProduct));
+ printf("bcdDevice = %04X\n",GETUSBFIELD(devdscr,bcdDevice));
+ printf("iManufacturer = %d (%s)\n",
+ devdscr->iManufacturer,
+ getstringmaybe(dev,devdscr->iManufacturer));
+ printf("iProduct = %d (%s)\n",
+ devdscr->iProduct,
+ getstringmaybe(dev,devdscr->iProduct));
+ printf("iSerialNumber = %d (%s)\n",
+ devdscr->iSerialNumber,
+ getstringmaybe(dev,devdscr->iSerialNumber));
+ printf("bNumConfigs = %d\n",devdscr->bNumConfigurations);
+ break;
+ case USB_CONFIGURATION_DESCRIPTOR_TYPE:
+
+ cfgdscr = (usb_config_descr_t *) ptr;
+ printf("---------------------------------------------------\n");
+ printf("CONFIG DESCRIPTOR\n");
+
+ printf("bLength = %d\n",cfgdscr->bLength);
+ printf("bDescriptorType = %d\n",cfgdscr->bDescriptorType);
+ printf("wTotalLength = %d\n",GETUSBFIELD(cfgdscr,wTotalLength));
+ printf("bNumInterfaces = %d\n",cfgdscr->bNumInterfaces);
+ printf("bConfigValue = %d\n",cfgdscr->bConfigurationValue);
+ printf("iConfiguration = %d (%s)\n",
+ cfgdscr->iConfiguration,
+ getstringmaybe(dev,cfgdscr->iConfiguration));
+ printf("bmAttributes = %02X\n",cfgdscr->bmAttributes);
+ printf("MaxPower = %d (%dma)\n",cfgdscr->MaxPower,cfgdscr->MaxPower*2);
+ break;
+
+ case USB_INTERFACE_DESCRIPTOR_TYPE:
+ printf("---------------------------------------------------\n");
+ printf("INTERFACE DESCRIPTOR\n");
+
+ ifdscr = (usb_interface_descr_t *) ptr;
+
+ printf("bLength = %d\n",ifdscr->bLength);
+ printf("bDescriptorType = %d\n",ifdscr->bDescriptorType);
+ printf("bInterfaceNum = %d\n",ifdscr->bInterfaceNumber);
+ printf("bAlternateSet = %d\n",ifdscr->bAlternateSetting);
+ printf("bNumEndpoints = %d\n",ifdscr->bNumEndpoints);
+ printf("bInterfaceClass = %d\n",ifdscr->bInterfaceClass);
+ printf("bInterSubClass = %d\n",ifdscr->bInterfaceSubClass);
+ printf("bInterfaceProto = %d\n",ifdscr->bInterfaceProtocol);
+ printf("iInterface = %d (%s)\n",
+ ifdscr->iInterface,
+ getstringmaybe(dev,ifdscr->iInterface));
+ break;
+
+ case USB_ENDPOINT_DESCRIPTOR_TYPE:
+ printf("---------------------------------------------------\n");
+ printf("ENDPOINT DESCRIPTOR\n");
+
+ epdscr = (usb_endpoint_descr_t *) ptr;
+
+ printf("bLength = %d\n",epdscr->bLength);
+ printf("bDescriptorType = %d\n",epdscr->bDescriptorType);
+ printf("bEndpointAddr = %02X (%d,%s)\n",
+ epdscr->bEndpointAddress,
+ epdscr->bEndpointAddress & 0x0F,
+ (epdscr->bEndpointAddress & USB_ENDPOINT_DIRECTION_IN) ? "IN" : "OUT"
+ );
+ printf("bmAttrbutes = %02X (%s)\n",
+ epdscr->bmAttributes,
+ eptattribs[epdscr->bmAttributes&3]);
+ printf("wMaxPacketSize = %d\n",GETUSBFIELD(epdscr,wMaxPacketSize));
+ printf("bInterval = %d\n",epdscr->bInterval);
+ break;
+
+ case USB_HID_DESCRIPTOR_TYPE:
+ printf("---------------------------------------------------\n");
+ printf("HID DESCRIPTOR\n");
+
+ hiddscr = (usb_hid_descr_t *) ptr;
+
+ printf("bLength = %d\n",hiddscr->bLength);
+ printf("bDescriptorType = %d\n",hiddscr->bDescriptorType);
+ printf("bcdHID = %04X\n",GETUSBFIELD(hiddscr,bcdHID));
+ printf("bCountryCode = %d\n",hiddscr->bCountryCode);
+ printf("bNumDescriptors = %d\n",hiddscr->bNumDescriptors);
+ printf("bClassDescrType = %d\n",hiddscr->bClassDescrType);
+ printf("wClassDescrLen = %d\n",GETUSBFIELD(hiddscr,wClassDescrLength));
+ break;
+
+ case USB_HUB_DESCRIPTOR_TYPE:
+ printf("---------------------------------------------------\n");
+ printf("HUB DESCRIPTOR\n");
+
+ hubdscr = (usb_hub_descr_t *) ptr;
+
+ printf("bLength = %d\n",hubdscr->bDescriptorLength);
+ printf("bDescriptorType = %d\n",hubdscr->bDescriptorType);
+ printf("bNumberOfPorts = %d\n",hubdscr->bNumberOfPorts);
+ printf("wHubCharacters = %04X\n",GETUSBFIELD(hubdscr,wHubCharacteristics));
+ printf("bPowerOnToPwrGd = %d\n",hubdscr->bPowerOnToPowerGood);
+ printf("bHubControlCurr = %d (ma)\n",hubdscr->bHubControlCurrent);
+ printf("bRemPwerMask[0] = %02X\n",hubdscr->bRemoveAndPowerMask[0]);
+
+ break;
+
+ default:
+ printf("---------------------------------------------------\n");
+ printf("UNKNOWN DESCRIPTOR\n");
+ printf("bLength = %d\n",cfgdscr->bLength);
+ printf("bDescriptorType = %d\n",cfgdscr->bDescriptorType);
+ printf("Data Bytes = ");
+ for (idx = 0; idx < cfgdscr->bLength; idx++) {
+ printf("%02X ",ptr[idx]);
+ }
+ printf("\n");
+
+ }
+
+ ptr += cfgdscr->bLength;
+
+ }
+}
+
+
+void usb_dbg_dumpcfgdescr(usbdev_t *dev)
+{
+ uint8_t buffer[512];
+ int res;
+ int len;
+ usb_config_descr_t *cfgdscr;
+
+ memset(buffer,0,sizeof(buffer));
+
+ cfgdscr = (usb_config_descr_t *) &buffer[0];
+
+ res = usb_get_config_descriptor(dev,cfgdscr,0,sizeof(usb_config_descr_t));
+ if (res != sizeof(usb_config_descr_t)) {
+ printf("[a]usb_get_config_descriptor returns %d\n",res);
+ }
+
+ len = GETUSBFIELD(cfgdscr,wTotalLength);
+
+ res = usb_get_config_descriptor(dev,cfgdscr,0,len);
+ if (res != len) {
+ printf("[b]usb_get_config_descriptor returns %d\n",res);
+ }
+
+ usb_dbg_dumpdescriptors(dev,&buffer[0],res);
+}
diff --git a/cfe/cfe/usb/usbdevs.c b/cfe/cfe/usb/usbdevs.c
new file mode 100644
index 0000000..53a0754
--- /dev/null
+++ b/cfe/cfe/usb/usbdevs.c
@@ -0,0 +1,168 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * USB Driver List File: usbdevs.c
+ *
+ * This module contains a table of supported USB devices and
+ * the routines to look up appropriate drivers given
+ * USB product, device, and class codes.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#ifndef _CFE_
+#include <stdio.h>
+#include <memory.h>
+#include <stdint.h>
+#include "usbhack.h"
+#else
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+#endif
+
+#include "lib_malloc.h"
+#include "lib_queue.h"
+#include "usbchap9.h"
+#include "usbd.h"
+
+/* *********************************************************************
+ * The list of drivers we support. If you add more drivers,
+ * list them here.
+ ********************************************************************* */
+
+extern usb_driver_t usbhub_driver;
+extern usb_driver_t usbhid_driver;
+extern usb_driver_t usbmass_driver;
+extern usb_driver_t usbserial_driver;
+extern usb_driver_t usbeth_driver;
+
+usb_drvlist_t usb_drivers[] = {
+
+ /*
+ * Hub driver
+ */
+
+ {USB_DEVICE_CLASS_HUB, VENDOR_ANY, PRODUCT_ANY, &usbhub_driver},
+
+ /*
+ * Keyboards and mice
+ */
+
+ {USB_DEVICE_CLASS_HUMAN_INTERFACE, VENDOR_ANY,PRODUCT_ANY, &usbhid_driver},
+
+ /*
+ * Mass storage devices
+ */
+
+ {USB_DEVICE_CLASS_STORAGE, VENDOR_ANY, PRODUCT_ANY, &usbmass_driver},
+
+ /*
+ * Serial ports
+ */
+
+ {USB_DEVICE_CLASS_VENDOR_SPECIFIC,0x557,0x2008,&usbserial_driver},
+
+ /*
+ * Ethernet Adapters
+ */
+
+ {USB_DEVICE_CLASS_VENDOR_SPECIFIC,0x506,0x4601,&usbeth_driver}, /* 3Com */
+ {USB_DEVICE_CLASS_VENDOR_SPECIFIC,0x66b,0x2202,&usbeth_driver}, /* Linksys */
+ {USB_DEVICE_CLASS_VENDOR_SPECIFIC,0x66b,0x2203,&usbeth_driver}, /* Linksys */
+ {USB_DEVICE_CLASS_VENDOR_SPECIFIC,0x66b,0x2204,&usbeth_driver}, /* Linksys */
+ {USB_DEVICE_CLASS_VENDOR_SPECIFIC,0x66b,0x2206,&usbeth_driver}, /* Linksys */
+ {USB_DEVICE_CLASS_VENDOR_SPECIFIC,0x66b,0x400b,&usbeth_driver}, /* Linksys */
+ {USB_DEVICE_CLASS_VENDOR_SPECIFIC,0x66b,0x200c,&usbeth_driver}, /* Linksys */
+ {USB_DEVICE_CLASS_RESERVED,0xbda,0x8150,&usbeth_driver}, /* Realtek */
+ {USB_DEVICE_CLASS_VENDOR_SPECIFIC,0x423,0x000a,&usbeth_driver}, /* CATC */
+ {USB_DEVICE_CLASS_VENDOR_SPECIFIC,0x423,0x000c,&usbeth_driver}, /* Belkin */
+
+ {0,0,0,NULL}
+};
+
+
+/* *********************************************************************
+ * usb_find_driver(class,vendor,product)
+ *
+ * Find a suitable device driver to handle the specified
+ * class, vendor, or product.
+ *
+ * Input parameters:
+ * devdescr - device descriptor
+ *
+ * Return value:
+ * pointer to device driver or NULL
+ ********************************************************************* */
+
+usb_driver_t *usb_find_driver(usbdev_t *dev)
+{
+ usb_device_descr_t *devdescr;
+ usb_interface_descr_t *ifdescr;
+ usb_drvlist_t *list;
+ int dclass,vendor,product;
+
+ devdescr = &(dev->ud_devdescr);
+
+ dclass = devdescr->bDeviceClass;
+ if (dclass == 0) {
+ ifdescr = usb_find_cfg_descr(dev,USB_INTERFACE_DESCRIPTOR_TYPE,0);
+ if (ifdescr) dclass = ifdescr->bInterfaceClass;
+ }
+
+ vendor = (int) GETUSBFIELD(devdescr,idVendor);
+ product = (int) GETUSBFIELD(devdescr,idProduct);
+
+ printf("USB: Locating Class %02X Vendor %04X Product %04X: ",dclass,vendor,product);
+
+ list = usb_drivers;
+ while (list->udl_disp) {
+ if (((list->udl_class == dclass) || (list->udl_class == CLASS_ANY)) &&
+ ((list->udl_vendor == vendor) || (list->udl_vendor == VENDOR_ANY)) &&
+ ((list->udl_product == product) || (list->udl_product == PRODUCT_ANY))) {
+ printf("%s\n",list->udl_disp->udrv_name);
+ return list->udl_disp;
+ }
+ list++;
+ }
+
+ printf("Not found.\n");
+
+ return NULL;
+}
diff --git a/cfe/cfe/usb/usbeth.c b/cfe/cfe/usb/usbeth.c
new file mode 100644
index 0000000..bc5aeb0
--- /dev/null
+++ b/cfe/cfe/usb/usbeth.c
@@ -0,0 +1,850 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * USB Ethernet File: usbeth.c
+ *
+ * Driver for USB Ethernet devices.
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+/* *********************************************************************
+ * USB-Ethernet driver - CFE Network Layer Interfaces
+ * NOTE: Some of the device setup for the Admtek & Realtek devices
+ * was derived from reverse engineering! So these interfaces
+ * assume proper device operation.
+ ********************************************************************* */
+
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_ioctl.h"
+#include "cfe_timer.h"
+#include "cfe_device.h"
+#include "cfe_devfuncs.h"
+#include "cfe_error.h"
+
+#include "usbd.h"
+#include "usbeth.h"
+
+#if 0
+#define USBETH_TRACE( x, y ... ) xprintf( x, ##y )
+#else
+#define USBETH_TRACE( x, y ... )
+#endif
+
+#define FAIL -1
+
+static int Dev_cnt = 0;
+
+
+/******************************************************************************
+ Debug functions
+******************************************************************************/
+
+//#define DATA_DUMP
+#ifdef DATA_DUMP
+static void hexdump( unsigned char * src, int srclen, int rowlen, int rows )
+{
+ unsigned char * rowptr;
+ unsigned char * srcstp;
+ unsigned char * byteptr;
+
+ srcstp = src + srclen;
+
+ for( rowptr = src; rowptr < src + rowlen * rows; rowptr += rowlen ) {
+ for( byteptr = rowptr; byteptr < rowptr + rowlen && byteptr < srcstp; byteptr++ ) {
+ xprintf( "%2X ", *byteptr );
+ }
+ xprintf( "\n" );
+ }
+ xprintf( "\n" );
+}
+#endif
+
+
+/* *********************************************************************
+ * Interface functions for USB-Ethernet adapters
+ ********************************************************************* */
+
+enum { PEGASUS, PEGASUS_II, NETMATE, REALTEK };
+enum { VEN_NONE, _3_COM, LINKSYS, LINKSYS_10, LINKSYS_100,
+ CATC_NM, BELKIN_CATC, LINKSYS_100M };
+static char * VENDOR_NAMES[] =
+{
+ "?", "3-COM", "LinkSys", "LinkSys-10TX", "LinkSys-100TX",
+ "CATC-Netmate", "Belkin/CATC", "Linksys-100M", "Yikes!"
+};
+
+typedef struct usbeth_softc_s
+{
+ usbdev_t *dev;
+ int bulk_inpipe;
+ int bulk_outpipe;
+ int dev_id;
+ int ven_code;
+ int embed_tx_len;
+ uint8_t mac_addr[6];
+ usbreq_t *rx_ur;
+ uint8_t rxbuf[1600]; //artbitrary but enough for ethernet packet
+} usbeth_softc_t;
+
+
+/* **************************************
+ * CATC I/F Functions
+ ************************************** */
+
+#if 0
+static int catc_get_reg( usbdev_t *dev, int16_t reg, uint8_t *val )
+{
+ return usb_std_request( dev, (USBREQ_TYPE_VENDOR | USBREQ_DIR_IN),
+ CATC_GET_REG, 0, reg, val, 1 );
+}
+#endif
+
+static int catc_set_reg( usbdev_t *dev, int16_t reg, int16_t val )
+{
+ return usb_std_request( dev, (USBREQ_TYPE_VENDOR | USBREQ_DIR_OUT),
+ CATC_SET_REG, val, reg, NULL, 0 );
+}
+
+static int catc_set_mem( usbdev_t *dev, int16_t addr,
+ uint8_t *data, int16_t len )
+{
+ return usb_std_request( dev, (USBREQ_TYPE_VENDOR | USBREQ_DIR_OUT),
+ CATC_SET_MEM, 0, addr, data, len );
+}
+
+static int catc_get_mac_addr( usbdev_t *dev, uint8_t *mac_addr )
+{
+ int status;
+
+ status = usb_std_request( dev, (USBREQ_TYPE_VENDOR | USBREQ_DIR_IN),
+ CATC_GET_MAC_ADDR, 0, 0, mac_addr, 6 );
+ return( status );
+}
+
+static void catc_init_device( usbeth_softc_t * softc )
+{
+ usbdev_t *dev = softc->dev;
+ unsigned char *mcast_tbl;
+
+ usb_std_request( dev, (USBREQ_TYPE_STD | USBREQ_REC_INTERFACE),
+ USB_REQUEST_SET_INTERFACE,
+ 1, //alt setting 1
+ 0, NULL, 0 );
+
+ catc_set_reg(dev, CATC_TX_BUF_CNT_REG, 0x04 );
+ catc_set_reg(dev, CATC_RX_BUF_CNT_REG, 0x10 );
+ catc_set_reg(dev, CATC_ADV_OP_MODES_REG, 0x01 );
+ catc_set_reg(dev, CATC_LED_CTRL_REG, 0x08 );
+
+ /* Enable broadcast rx via bit in mutlicast table */
+ mcast_tbl = KMALLOC(64, 0);
+ memset( mcast_tbl, 0, 64 );
+ mcast_tbl[31] = 0x80; //i.e. broadcast bit
+ catc_set_mem( dev, CATC_MCAST_TBL_ADDR, mcast_tbl, 64 );
+ KFREE(mcast_tbl);
+
+ //Read the adapter's MAC addr
+ catc_get_mac_addr( dev, softc->mac_addr );
+}
+
+static void catc_close_device( usbdev_t *dev )
+{
+ // Now disable adapter from receiving packets
+ catc_set_reg( dev, CATC_ETH_CTRL_REG, 0 );
+}
+
+static void catc_open_device( usbeth_softc_t * softc )
+{
+ int i;
+
+ for(i = 0; i < 6; ++i)
+ catc_set_reg( softc->dev, (CATC_ETH_ADDR_0_REG - i), softc->mac_addr[i] );
+
+ // Now enable adapter to receive packets
+ catc_set_reg( softc->dev, CATC_ETH_CTRL_REG, 0x09 );
+}
+
+/* **************************************
+ * PEGASUS I/F Functions
+ ************************************** */
+
+static int peg_get_reg( usbdev_t *dev, int16_t reg, uint8_t *val, int16_t len )
+{
+ return usb_std_request( dev, (USBREQ_TYPE_VENDOR | USBREQ_DIR_IN),
+ PEG_GET_REG, 0, reg, val, len );
+}
+
+static int peg_set_reg( usbdev_t *dev, int16_t reg, int16_t val )
+{
+ unsigned char data = (uint8_t) val & 0xff;
+
+ return usb_std_request( dev, (USBREQ_TYPE_VENDOR | USBREQ_DIR_OUT),
+ PEG_SET_REG, val, reg, &data, 1 );
+}
+
+static int peg_set_regs( usbdev_t *dev, int16_t reg, int8_t *vals, int16_t len )
+{
+ return usb_std_request( dev, (USBREQ_TYPE_VENDOR | USBREQ_DIR_OUT),
+ PEG_SET_REG, 0, reg, vals, len );
+}
+
+static int peg_get_eep_word( usbdev_t *dev, int16_t ofs, uint8_t *val )
+{
+ int status=0, tries=20;
+ uint8_t data[2];
+
+ if( peg_set_reg( dev, PEG_EEPROM_CTL_REG, 0 ) == FAIL )
+ return FAIL;
+ if( peg_set_reg( dev, PEG_EEPROM_OFS_REG, ofs ) == FAIL )
+ return FAIL;
+ if( peg_set_reg( dev, PEG_EEPROM_CTL_REG, 0x02 ) == FAIL ) //read
+ return FAIL;
+ while( --tries )
+ {
+ if( peg_get_reg( dev, PEG_EEPROM_CTL_REG, data, 1 ) == FAIL )
+ return FAIL;
+ if( data[0] & 0x04 )
+ break; //eeprom data ready
+ }
+ if( !tries )
+ {
+ xprintf( "Pegasus Eeprom read failed!\n" );
+ return FAIL;
+ }
+ if( peg_get_reg( dev, PEG_EEPROM_DATA_REG, data, 2 ) == FAIL )
+ return FAIL;
+ val[0] = data[0];
+ val[1] = data[1];
+
+ return( status );
+}
+
+static int peg_get_mac_addr( usbdev_t *dev, uint8_t *mac_addr )
+{
+ int i, status;
+
+ for( i = 0; i < 3; ++i )
+ {
+ status = peg_get_eep_word( dev, i, &mac_addr[i*2] );
+ }
+ return( status );
+}
+
+static void peg_init_phy( usbdev_t *dev )
+{ //needed for earlier versions (before Rev B) of the USB-100TX adapters
+ static uint8_t phy_magic_wr[] = { 0, 4, 0, 0x1b };
+ static uint8_t read_status[] = { 0, 0, 0, 1 };
+ uint8_t data[4];
+
+ //reset the MAC ans set up GPIOs
+ peg_set_reg( dev, PEG_ETH_CTL1_REG, 0x08 );
+ peg_get_reg( dev, PEG_ETH_CTL1_REG, data, 1 );
+
+ //do following steps to enable link activitiy LED
+ peg_set_reg( dev, PEG_GPIO1_REG, 0x26 );
+ peg_set_reg( dev, PEG_GPIO0_REG, 0x24 );
+ peg_set_reg( dev, PEG_GPIO0_REG, 0x26 );
+
+ //do following set of steps to enable LINK LED
+ memcpy( data, phy_magic_wr, 4 );
+ peg_set_regs( dev, PEG_PHY_ADDR_REG, data, 4); //set up for magic word
+ peg_set_reg( dev, PEG_PHY_CTRL_REG, (0x1b|PHY_WRITE) );
+ peg_get_reg( dev, PEG_PHY_CTRL_REG, data, 1 ); //read status of write
+ memcpy( data, read_status, 4 );
+ peg_set_regs( dev, PEG_PHY_ADDR_REG, data, 4); //set up for phy status reg
+ peg_set_reg( dev, PEG_PHY_CTRL_REG, (1|PHY_READ) );
+ peg_get_reg( dev, PEG_PHY_CTRL_REG, data, 1 ); //read status of read
+ peg_get_reg( dev, PEG_PHY_DATA_REG, data, 2 ); //read status regs
+}
+
+static void peg_init_device( usbeth_softc_t * softc )
+{
+ usbdev_t *dev = softc->dev;
+
+ if( softc->dev_id == PEGASUS_II )
+ peg_set_reg( dev, PEG_INT_PHY_REG, 0x02 ); //enable internal PHY
+ else
+ peg_init_phy( dev );
+
+ //Read the adapter's MAC addr
+ peg_get_mac_addr( dev, softc->mac_addr );
+}
+
+static void peg_close_device( usbdev_t *dev )
+{
+ //Now disable adapter from receiving or transmitting packets
+ peg_set_reg( dev, PEG_ETH_CTL1_REG, 0 );
+}
+
+static void peg_open_device( usbeth_softc_t * softc )
+{
+ usbdev_t *dev = softc->dev;
+
+ //Now setup adapter's receiver with MAC address
+ peg_set_regs( dev, PEG_MAC_ADDR_0_REG, softc->mac_addr, 6 );
+
+ //Now enable adapter to receive and transmit packets
+ peg_set_reg( dev, PEG_ETH_CTL0_REG, 0xc1 );
+ peg_set_reg( dev, PEG_ETH_CTL1_REG, 0x30 );
+}
+
+/* **************************************
+ * REALTEK I/F Functions
+ ************************************** */
+
+//
+// ********** NOT FULLY WORKING YET!!!!!!!!!! ***************
+//
+
+static int rtek_get_reg( usbdev_t *dev, int16_t reg, uint8_t *val, int16_t len )
+{
+ return usb_std_request( dev, (USBREQ_TYPE_VENDOR | USBREQ_DIR_IN),
+ RTEK_REG_ACCESS, reg, 0, val, len );
+}
+
+static int rtek_set_reg( usbdev_t *dev, int16_t reg, int16_t val )
+{
+ unsigned char data = (uint8_t) val & 0xff;
+
+ return usb_std_request( dev, (USBREQ_TYPE_VENDOR | USBREQ_DIR_OUT),
+ RTEK_REG_ACCESS, reg, 0, &data, 1 );
+}
+
+static int rtek_get_mac_addr( usbdev_t *dev, uint8_t *mac_addr )
+{
+ int status;
+
+ status = rtek_get_reg( dev, RTEK_MAC_REG, mac_addr, 6 );
+
+ return( status );
+}
+
+static void rtek_init_device( usbeth_softc_t * softc )
+{
+ int i;
+ usbdev_t *dev = softc->dev;
+ uint8_t val;
+
+ //Reset the adapter
+ rtek_set_reg( dev, RTEK_CMD_REG, RTEK_RESET );
+ for( i = 0; i < 10; ++i )
+ {
+ rtek_get_reg( dev, RTEK_CMD_REG, &val, 1 );
+ if( !(val & RTEK_RESET) )
+ break;
+ usb_delay_ms( NULL, 1 );
+ }
+
+ //autoload the internal registers
+ rtek_set_reg( dev, RTEK_CMD_REG, RTEK_AUTOLOAD );
+ for( i = 0; i < 50; ++i )
+ {
+ rtek_get_reg( dev, RTEK_CMD_REG, &val, 1 );
+ if( !(val & RTEK_AUTOLOAD) )
+ break;
+ usb_delay_ms( NULL, 1 );
+ }
+
+ //Read the adapter's MAC addr
+ rtek_get_mac_addr( dev, softc->mac_addr );
+}
+
+static void rtek_close_device( usbdev_t *dev )
+{
+ //Now disable adapter from receiving or transmitting packets
+ rtek_set_reg( dev, RTEK_CMD_REG, 0 );
+}
+
+static void rtek_open_device( usbeth_softc_t * softc )
+{
+ //accept broadcast & own packets
+ rtek_set_reg( softc->dev, RTEK_RXCFG_REG, 0x0c );
+
+ //Now enable adapter to receive and transmit packets
+ rtek_set_reg( softc->dev, RTEK_CMD_REG, 0x0c );
+}
+
+//*********************** USB-ETH I/F Functions ****************************
+
+static const int ID_TBL[] =
+{
+ 0x0506, 0x4601, PEGASUS_II, _3_COM, //3-Com
+ 0x066b, 0x2202, PEGASUS_II, LINKSYS_10, //LinkSys
+ 0x066b, 0x2203, PEGASUS, LINKSYS_100,
+ 0x066b, 0x2204, PEGASUS, LINKSYS_100,
+ 0x066b, 0x2206, PEGASUS, LINKSYS,
+ 0x066b, 0x400b, PEGASUS_II, LINKSYS_10,
+ 0x066b, 0x200c, PEGASUS_II, LINKSYS_10,
+ 0x0bda, 0x8150, REALTEK, LINKSYS_100M,
+ 0x0423, 0x000a, NETMATE, CATC_NM, //CATC (Netmate I)
+ 0x0423, 0x000c, NETMATE, BELKIN_CATC, //Belkin & CATC (Netmate II)
+ -1
+};
+
+static int usbeth_init_device( usbeth_softc_t * softc )
+{
+ int i;
+ usb_device_descr_t dev_desc;
+ uint16_t vendor_id, device_id;
+ const int *ptr=ID_TBL;
+
+ //find out which device is connected
+ usb_get_device_descriptor( softc->dev, &dev_desc, 0 );
+ vendor_id = (dev_desc.idVendorHigh << 8) + dev_desc.idVendorLow;
+ device_id = (dev_desc.idProductHigh << 8) + dev_desc.idProductLow;
+ xprintf( "USB device: vendor id %04x, device id %04x\n",
+ vendor_id, device_id );
+
+ while( *ptr != -1 )
+ {
+ if( (vendor_id == ptr[0]) && (device_id == ptr[1]) )
+ {
+ softc->dev_id = ptr[2];
+ softc->ven_code = ptr[3];
+ break;
+ }
+ ptr += 4;
+ }
+ if( *ptr == -1 )
+ {
+ xprintf( "Unrecognized USB-Ethernet device\n" );
+ return -1;
+ }
+
+ //init the adapter
+ if( softc->dev_id == NETMATE )
+ {
+ catc_init_device( softc );
+ softc->embed_tx_len = 1;
+ }
+ else
+ {
+ if( softc->dev_id == REALTEK )
+ {
+ rtek_init_device( softc );
+ softc->embed_tx_len = 0;
+ }
+ else
+ {
+ peg_init_device( softc );
+ softc->embed_tx_len = 1;
+ }
+ }
+
+ //display adapter info
+ xprintf( "%s USB-Ethernet Adapter (", VENDOR_NAMES[softc->ven_code] );
+ for( i = 0; i < 6; ++i )
+ xprintf( "%02x%s", softc->mac_addr[i], (i == 5) ? ")\n" : ":" );
+
+ return 0;
+}
+
+static int usbeth_get_dev_addr( usbeth_softc_t * softc, uint8_t *mac_addr )
+{
+ memcpy( mac_addr, softc->mac_addr, 6 );
+ return 0;
+}
+
+static void usbeth_queue_rx( usbeth_softc_t * softc )
+{
+ softc->rx_ur = usb_make_request(softc->dev, softc->bulk_inpipe,
+ softc->rxbuf, sizeof(softc->rxbuf),
+ (UR_FLAG_IN | UR_FLAG_SHORTOK));
+ usb_queue_request(softc->rx_ur);
+}
+
+static void usbeth_close_device( usbeth_softc_t * softc )
+{
+ if( softc->dev_id == NETMATE )
+ catc_close_device( softc->dev );
+ else if( softc->dev_id == REALTEK )
+ rtek_close_device( softc->dev );
+ else
+ peg_close_device( softc->dev );
+}
+
+static void usbeth_open_device( usbeth_softc_t * softc )
+{
+ if( softc->dev_id == NETMATE )
+ catc_open_device( softc );
+ else if( softc->dev_id == REALTEK )
+ rtek_open_device( softc );
+ else
+ peg_open_device( softc );
+
+ //kick start the receive
+ usbeth_queue_rx( softc );
+}
+
+static int usbeth_data_rx( usbeth_softc_t * softc )
+{
+ usb_poll(softc->dev->ud_bus);
+ return( !softc->rx_ur->ur_inprogress );
+}
+
+static int usbeth_get_eth_frame( usbeth_softc_t * softc, unsigned char * buf )
+{
+ int len = 0;
+
+ if( !softc->rx_ur->ur_inprogress )
+ {
+ len = softc->rx_ur->ur_xferred;
+ memcpy( buf, softc->rxbuf, len );
+ usb_free_request(softc->rx_ur);
+ usbeth_queue_rx( softc );
+ }
+ else
+ xprintf( "Bulk data is not available yet!\n" );
+
+ return( len );
+}
+
+static int usbeth_send_eth_frame( usbeth_softc_t * softc, unsigned char * buf, int len )
+{
+ usbreq_t *ur;
+ int txlen = len;
+ unsigned char * txbuf;
+
+ if(softc->embed_tx_len)
+ {
+ txbuf = KMALLOC((len+2), 0);
+ txbuf[0] = txlen & 0xff;
+ txbuf[1] = (txlen >> 8) & 0xff; //1st two bytes...little endian
+ memcpy( &txbuf[2], buf, txlen );
+ txlen += 2;
+ }
+ else
+ {
+ if( softc->dev_id == REALTEK )
+ {
+ //Now for some Realtek chip workarounds
+ if( txlen < 60 ) //some strange limitation
+ txlen = 60;
+ else if( !(txlen % 64) ) //to handle module 64 packets
+ ++txlen;
+ }
+ txbuf = KMALLOC(txlen, 0);
+ memcpy( txbuf, buf, txlen );
+ }
+ ur = usb_make_request(softc->dev, softc->bulk_outpipe,
+ txbuf, txlen, UR_FLAG_OUT);
+ usb_sync_request(ur);
+ usb_free_request(ur);
+ KFREE(txbuf);
+
+ return( len );
+}
+
+
+/* *********************************************************************
+ * CFE-USB interfaces
+ ********************************************************************* */
+
+/* *********************************************************************
+ * usbeth_attach(dev,drv)
+ *
+ * This routine is called when the bus scan stuff finds a usb-ethernet
+ * device. We finish up the initialization by configuring the
+ * device and allocating our softc here.
+ *
+ * Input parameters:
+ * dev - usb device, in the "addressed" state.
+ * drv - the driver table entry that matched
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+const cfe_driver_t usbethdrv; //forward declaration
+
+static int usbeth_attach(usbdev_t *dev,usb_driver_t *drv)
+{
+ usb_config_descr_t *cfgdscr = dev->ud_cfgdescr;
+ usb_endpoint_descr_t *epdscr;
+ usb_endpoint_descr_t *indscr = NULL;
+ usb_endpoint_descr_t *outdscr = NULL;
+ usb_interface_descr_t *ifdscr;
+ usbeth_softc_t *softc;
+ int idx;
+
+ dev->ud_drv = drv;
+
+ softc = (usbeth_softc_t *) KMALLOC( sizeof(usbeth_softc_t), 0 );
+ if( softc == NULL )
+ {
+ xprintf( "Failed to allocate softc memory.\n" );
+ return -1;
+ }
+ memset( softc, 0, sizeof(usbeth_softc_t) );
+ dev->ud_private = softc;
+ softc->dev = dev;
+
+ ifdscr = usb_find_cfg_descr(dev,USB_INTERFACE_DESCRIPTOR_TYPE,0);
+ if (ifdscr == NULL)
+ {
+ xprintf("USBETH: ERROR...no interace descriptor\n");
+ return -1;
+ }
+
+
+ for (idx = 0; idx < 2; idx++)
+ {
+ epdscr = usb_find_cfg_descr(dev,USB_ENDPOINT_DESCRIPTOR_TYPE,idx);
+ if (USB_ENDPOINT_DIR_OUT(epdscr->bEndpointAddress))
+ outdscr = epdscr;
+ else
+ indscr = epdscr;
+ }
+
+ if (!indscr || !outdscr)
+ {
+ /*
+ * Could not get descriptors, something is very wrong.
+ * Leave device addressed but not configured.
+ */
+ xprintf("USBETH: ERROR...no endpoint descriptors\n");
+ return -1;
+ }
+
+ /*
+ * Choose the standard configuration.
+ */
+
+ usb_set_configuration(dev,cfgdscr->bConfigurationValue);
+
+ // Quit if not able to initialize the device
+ if (usbeth_init_device(softc) < 0)
+ return -1;
+
+ /*
+ * Open the pipes.
+ */
+
+ softc->bulk_inpipe = usb_open_pipe(dev,indscr);
+ softc->bulk_outpipe = usb_open_pipe(dev,outdscr);
+
+ //Now attach this device as a CFE Ethernet device
+ cfe_attach( (cfe_driver_t *) &usbethdrv, softc, NULL,
+ usbethdrv.drv_description );
+
+ ++Dev_cnt;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * usbeth_detach(dev)
+ *
+ * This routine is called when the bus scanner notices that
+ * this device has been removed from the system. We should
+ * do any cleanup that is required. The pending requests
+ * will be cancelled automagically.
+ *
+ * Input parameters:
+ * dev - usb device
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+static int usbeth_detach(usbdev_t *dev)
+{
+ usbeth_softc_t *softc = (usbeth_softc_t *) dev->ud_private;
+
+ --Dev_cnt;
+ KFREE(softc);
+
+ //*** SHOULD DETACH THE ETHERNET DEVICE TOO...LATER
+
+ return 0;
+}
+
+// CFE USB device interface structure
+usb_driver_t usbeth_driver =
+{
+ "Ethernet Device",
+ usbeth_attach,
+ usbeth_detach
+};
+
+
+
+/* *********************************************************************
+ * CFE-Ethernet device interfaces
+ ********************************************************************* */
+
+
+static int usbeth_ether_open(cfe_devctx_t *ctx)
+{
+ if( !Dev_cnt )
+ return CFE_ERR_NOTREADY;
+
+ USBETH_TRACE( "%s called.\n", __FUNCTION__ );
+ usbeth_open_device( (usbeth_softc_t *) ctx->dev_softc );
+
+ return 0;
+}
+
+static int usbeth_ether_read( cfe_devctx_t * ctx, iocb_buffer_t * buffer )
+{
+ if( !Dev_cnt )
+ return CFE_ERR_NOTREADY;
+
+ buffer->buf_retlen = usbeth_get_eth_frame( (usbeth_softc_t *)ctx->dev_softc,
+ buffer->buf_ptr );
+
+#ifdef DATA_DUMP
+ xprintf( "Incoming packet :\n" );
+ hexdump( buffer->buf_ptr, buffer->buf_retlen, 16,
+ buffer->buf_retlen / 16 + 1 );
+#endif
+
+ return 0;
+}
+
+
+static int usbeth_ether_inpstat( cfe_devctx_t * ctx, iocb_inpstat_t * inpstat )
+{
+ if( !Dev_cnt )
+ return CFE_ERR_NOTREADY;
+
+ inpstat->inp_status = usbeth_data_rx( (usbeth_softc_t *) ctx->dev_softc );
+
+ return 0;
+}
+
+
+static int usbeth_ether_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ if( !Dev_cnt )
+ return CFE_ERR_NOTREADY;
+
+ // Block until hw notifies you data is sent.
+ usbeth_send_eth_frame( (usbeth_softc_t *) ctx->dev_softc, buffer->buf_ptr,
+ buffer->buf_length );
+
+ return 0;
+}
+
+
+static int usbeth_ether_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ int retval = 0;
+
+ if( !Dev_cnt )
+ return CFE_ERR_NOTREADY;
+
+ switch( (int)buffer->buf_ioctlcmd ) {
+ case IOCTL_ETHER_GETHWADDR:
+ USBETH_TRACE( "IOCTL_ETHER_GETHWADDR called.\n" );
+ usbeth_get_dev_addr( (usbeth_softc_t *) ctx->dev_softc,
+ buffer->buf_ptr );
+ break;
+ case IOCTL_ETHER_SETHWADDR:
+ xprintf( "IOCTL_ETHER_SETHWADDR not implemented.\n" );
+ break;
+#if 0
+ case IOCTL_ETHER_GETSPEED:
+ xprintf( "GETSPEED not implemented.\n" );
+ retval = -1;
+ break;
+ case IOCTL_ETHER_SETSPEED:
+ xprintf( "SETSPEED not implemented.\n" );
+ retval = -1;
+ break;
+ case IOCTL_ETHER_GETLINK:
+ xprintf( "GETLINK not implemented.\n" );
+ retval = -1;
+ break;
+ case IOCTL_ETHER_GETLOOPBACK:
+ xprintf( "GETLOOPBACK not implemented.\n" );
+ retval = -1;
+ break;
+ case IOCTL_ETHER_SETLOOPBACK:
+ xprintf( "SETLOOPBACK not implemented.\n" );
+ retval = -1;
+ break;
+#endif
+ default:
+ xprintf( "Invalid IOCTL to usbeth_ether_ioctl.\n" );
+ retval = -1;
+ }
+
+ return retval;
+}
+
+
+static int usbeth_ether_close(cfe_devctx_t *ctx)
+{
+ if( !Dev_cnt )
+ return CFE_ERR_NOTREADY;
+
+ USBETH_TRACE( "%s called.\n", __FUNCTION__ );
+ usbeth_close_device( (usbeth_softc_t *) ctx->dev_softc );
+
+ return 0;
+}
+
+
+// CFE ethernet device interface structures
+const static cfe_devdisp_t usbeth_ether_dispatch =
+{
+ usbeth_ether_open,
+ usbeth_ether_read,
+ usbeth_ether_inpstat,
+ usbeth_ether_write,
+ usbeth_ether_ioctl,
+ usbeth_ether_close,
+ NULL,
+ NULL
+};
+
+const cfe_driver_t usbethdrv =
+{
+ "USB-Ethernet Device",
+ "eth",
+ CFE_DEV_NETWORK,
+ &usbeth_ether_dispatch,
+ NULL, //probe...not needed
+};
+
diff --git a/cfe/cfe/usb/usbeth.h b/cfe/cfe/usb/usbeth.h
new file mode 100644
index 0000000..54f32ae
--- /dev/null
+++ b/cfe/cfe/usb/usbeth.h
@@ -0,0 +1,112 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * USB Ethernet File: usbeth.h
+ *
+ * Driver for USB Ethernet devices.
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+/* *********************************************************************
+ * USB-Ethernet adapter driver includes
+ ********************************************************************* */
+
+#ifndef __usbeth_h__
+#define __usbeth_h__
+
+/* **************************************
+ * CATC Netmate adapter
+ ************************************** */
+
+#define CATC_MCAST_TBL_ADDR 0xFA80 //in Netmate's SRAM
+#define CATC_GET_MAC_ADDR 0xF2
+#define CATC_SET_REG 0xFA
+#define CATC_GET_REG 0xFB
+#define CATC_SET_MEM 0xFC
+
+#define CATC_TX_BUF_CNT_REG 0x20
+#define CATC_RX_BUF_CNT_REG 0x21
+#define CATC_ADV_OP_MODES_REG 0x22
+#define CATC_RX_FRAME_CNT_REG 0x24
+
+#define CATC_ETH_CTRL_REG 0x60
+#define CATC_ENET_STATUS_REG 0x61
+#define CATC_ETH_ADDR_0_REG 0x67 // Byte #0 (leftmost)
+#define CATC_LED_CTRL_REG 0x81
+
+
+/* **************************************
+ * Admtek (PEGASUS II) adapter
+ ************************************** */
+
+#define PEG_SET_REG 0xF1
+#define PEG_GET_REG 0xF0
+
+#define PEG_MCAST_TBL_REG 0x08
+#define PEG_MAC_ADDR_0_REG 0x10
+#define PEG_EEPROM_OFS_REG 0x20
+#define PEG_EEPROM_DATA_REG 0x21
+#define PEG_EEPROM_CTL_REG 0x23
+#define PEG_PHY_ADDR_REG 0x25
+#define PEG_PHY_DATA_REG 0x26 //& 27 for 2 bytes
+#define PEG_PHY_CTRL_REG 0x28
+#define PEG_ETH_CTL0_REG 0x00
+#define PEG_ETH_CTL1_REG 0x01
+#define PEG_ETH_CTL2_REG 0x02
+#define PEG_GPIO0_REG 0x7e
+#define PEG_GPIO1_REG 0x7f
+#define PEG_INT_PHY_REG 0x7b
+
+#define PHY_WRITE 0x20
+#define PHY_READ 0x40
+
+
+/* **************************************
+ * Realtek adapter
+ ************************************** */
+
+#define RTEK_REG_ACCESS 0x05
+#define RTEK_MAC_REG 0x0120
+#define RTEK_CMD_REG 0x012E
+#define RTEK_RXCFG_REG 0x0130
+#define RTEK_RESET 0x10
+#define RTEK_AUTOLOAD 0x01
+
+
+
+#endif //__usbeth_h_
diff --git a/cfe/cfe/usb/usbhack.c b/cfe/cfe/usb/usbhack.c
new file mode 100644
index 0000000..647f213
--- /dev/null
+++ b/cfe/cfe/usb/usbhack.c
@@ -0,0 +1,528 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Main Module File: usbhack.c
+ *
+ * A crude test program to let us tinker with a USB controller
+ * installed in an X86 Linux PC. Eventually we'll clean up
+ * this stuff and incorporate it into CFE.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdarg.h>
+#include <sys/mman.h>
+#include <sys/fcntl.h>
+#include <signal.h>
+#include <memory.h>
+#include <time.h>
+
+#include "lib_malloc.h"
+#include "lib_queue.h"
+#include "usbchap9.h"
+#include "usbd.h"
+#include "ohci.h"
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#define OHCI_WRITECSR(softc,x,y) \
+ *((volatile uint32_t *) ((softc)->ohci_regs + ((x)/sizeof(uint32_t)))) = (y)
+#define OHCI_READCSR(softc,x) \
+ *((volatile uint32_t *) ((softc)->ohci_regs + ((x)/sizeof(uint32_t))))
+
+/* *********************************************************************
+ * Externs
+ ********************************************************************* */
+
+extern int usb_noisy;
+extern int ohcidebug;
+
+extern usbdev_t *usbmass_dev;
+extern int usbmass_read_sector(usbdev_t *dev,uint32_t sectornum,uint32_t seccnt,
+ uint8_t *buffer);
+
+
+/* *********************************************************************
+ * Play Area definitions
+ *
+ * We use /dev/mem to map two areas - the "play" area and the
+ * "device" area.
+ *
+ * The "play" area maps to the upper 1MB of physical memory.
+ * You need to calculate this address yourself based on your system
+ * setup. If you have 256MB of memory, in your lilo.conf file put
+ * the following line:
+ *
+ * append="mem=255M"
+ *
+ * where '255' is one less than your system memory size. this
+ * leaves 1MB out of Linux's physical memory map and therefore
+ * leaves it to you to play with. /dev/mem will map this
+ * uncached using the Pentium MTRR registers, but for playing
+ * around this will be fine.
+ *
+ * the second area is the "device area" - this is the address
+ * the PCI USB controller's BARs were mapped to. You can find
+ * this by looking through /proc/pci until you find:
+ *
+ * Bus 0, device 8, function 0:
+ * USB Controller: OPTi Unknown device (rev 16).
+ * Vendor id=1045. Device id=c861.
+ * Medium devsel. Fast back-to-back capable. IRQ 3.
+ * Master Capable. Latency=32.
+ * Non-prefetchable 32 bit memory at 0xd9100000 [0xd9100000].
+ *
+ * The 0xd9100000 will probably be different on your system.
+ *
+ * Of course, to make this work you'll need to rebuild the kernel
+ * without USB support, if you're running a recent kernel.
+ * Fortunately(?), I've been using RH 6.2, no USB support there
+ * in the old 2.2 kernels.
+ *
+ * Finally, you'll need to run this program as root. Even if
+ * you mess with the permissions on /dev/mem, there are additional
+ * checks in the kernel, so you will lose.
+ *
+ * But, the good news is that it works well - I've never crashed
+ * my Linux box, and I can use gdb to debug programs.
+ * You will NOT be able to use GDB to display things in the
+ * play area - I believe GDB doesn't know how to deal with
+ * the uncached nature of the memory there. You can see stuff
+ * in the area by tracing through instructions that read the play
+ * area, and viewing the register contents.
+ ********************************************************************* */
+
+#define PLAY_AREA_ADDR (255*1024*1024) /* EDIT ME */
+#define PLAY_AREA_SIZE (1024*1024)
+int play_fd = -1;
+uint8_t *play_area = MAP_FAILED;
+
+#define DEVICE_AREA_ADDR 0xd9100000 /* EDIT ME */
+#define DEVICE_AREA_SIZE 4096
+int dev_fd = -1;
+uint8_t *device_area = MAP_FAILED;
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+
+usbbus_t *bus = NULL;
+ohci_softc_t *ohci = NULL;
+int running = 1;
+
+/* *********************************************************************
+ * vtop(v)
+ *
+ * Given a virtual address in the play area, return its physical
+ * address.
+ *
+ * Input parameters:
+ * v - virtual address
+ *
+ * Return value:
+ * physical address
+ ********************************************************************* */
+
+
+uint32_t vtop(void *v)
+{
+ uint32_t p = (uint32_t) v;
+
+ if (v == 0) return 0;
+
+ p -= (uint32_t) play_area;
+ p += PLAY_AREA_ADDR;
+
+ return p;
+}
+
+/* *********************************************************************
+ * ptov(v)
+ *
+ * Given a phyiscal address in the play area, return the virtual
+ * address.
+ *
+ * Input parameters:
+ * p - physical address
+ *
+ *
+ * Return value:
+ * virtual address (void pointer)
+ ********************************************************************* */
+
+void *ptov(uint32_t p)
+{
+ if (p == 0) return 0;
+
+ p -= PLAY_AREA_ADDR;
+ p += (uint32_t) play_area;
+
+ return (void *) p;
+}
+
+/* *********************************************************************
+ * mydelay(x)
+ *
+ * delay for 'x' milliseconds.
+ *
+ * Input parameters:
+ * x - milliseconds
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void mydelay(int x)
+{
+ struct timespec ts;
+
+ ts.tv_sec = 0;
+ ts.tv_nsec = x * 1000000; /* milliseconds */
+ nanosleep(&ts,NULL);
+}
+
+/* *********************************************************************
+ * console_log(tmplt,...)
+ *
+ * Display a console log message - this is a CFE function
+ * transplanted here.
+ *
+ * Input parameters:
+ * tmplt - printf string args...
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void console_log(const char *tmplt,...)
+{
+ char buffer[256];
+ va_list marker;
+
+ va_start(marker,tmplt);
+ vsprintf(buffer,tmplt,marker);
+ va_end(marker);
+ printf("%s\n",buffer);
+}
+
+/* *********************************************************************
+ * init_devaccess()
+ *
+ * Open /dev/mem and create the play area
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * 0 if ok, else error
+ ********************************************************************* */
+
+int init_devaccess(void)
+{
+ int idx;
+
+ play_fd = open("/dev/mem",O_RDWR);
+
+ if (play_fd < 0) {
+ perror("open");
+ return -1;
+ }
+
+ dev_fd = open("/dev/mem",O_RDWR | O_SYNC);
+
+ if (dev_fd < 0) {
+ perror("open");
+ close(play_fd);
+ play_fd = -1;
+ return -1;
+ }
+
+ play_area = mmap(NULL,
+ PLAY_AREA_SIZE,
+ PROT_READ|PROT_WRITE,MAP_SHARED,
+ play_fd,
+ PLAY_AREA_ADDR);
+
+ if (play_area != MAP_FAILED) {
+ printf("Play area mapped ok at address %p to %p\n",play_area,play_area+PLAY_AREA_SIZE-1);
+ for (idx = 0; idx < PLAY_AREA_SIZE; idx++) {
+ play_area[idx] = 0x55;
+ if (play_area[idx] != 0x55) printf("Offset %x doesn't work\n",idx);
+ play_area[idx] = 0xaa;
+ if (play_area[idx] != 0xaa) printf("Offset %x doesn't work\n",idx);
+ play_area[idx] = 0x0;
+ if (play_area[idx] != 0x0) printf("Offset %x doesn't work\n",idx);
+ }
+ }
+ else {
+ perror("mmap");
+ close(play_fd);
+ close(dev_fd);
+ play_fd = -1;
+ dev_fd = -1;
+ return -1;
+ }
+
+ device_area = mmap(NULL,
+ DEVICE_AREA_SIZE,
+ PROT_READ|PROT_WRITE,MAP_SHARED,
+ dev_fd,
+ DEVICE_AREA_ADDR);
+
+ if (device_area != MAP_FAILED) {
+ printf("Device area mapped ok at address %p\n",device_area);
+ }
+ else {
+ perror("mmap");
+ munmap(play_area,PLAY_AREA_SIZE);
+ play_area = MAP_FAILED;
+ close(play_fd);
+ close(dev_fd);
+ play_fd = -1;
+ dev_fd = -1;
+ return -1;
+ }
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * uninit_devaccess()
+ *
+ * Turn off access to the /dev/mem area. this will also
+ * set the OHCI controller's state to reset if we were playing
+ * with it.
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void uninit_devaccess(void)
+{
+ if (ohci->ohci_regs) {
+ OHCI_WRITECSR(ohci,R_OHCI_CONTROL,V_OHCI_CONTROL_HCFS(K_OHCI_HCFS_RESET));
+ }
+
+ if (play_area != MAP_FAILED) munmap(play_area,PLAY_AREA_SIZE);
+ if (device_area != MAP_FAILED) munmap(device_area,DEVICE_AREA_SIZE);
+
+ if (play_fd > 0) close(play_fd);
+ if (dev_fd > 0) close(dev_fd);
+
+ device_area = MAP_FAILED;
+ play_area = MAP_FAILED;
+
+ dev_fd = -1;
+ play_fd = -1;
+}
+
+/* *********************************************************************
+ * sighandler()
+ *
+ * ^C handler - switch off OHCI controller
+ *
+ * Input parameters:
+ * sig - signal
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void sighandler(int sig)
+{
+ signal(SIGINT,SIG_DFL);
+ printf("Interrupted, controller reset\n");
+ if (ohci->ohci_regs) {
+ OHCI_WRITECSR(ohci,R_OHCI_CONTROL,V_OHCI_CONTROL_HCFS(K_OHCI_HCFS_RESET));
+ }
+ running = 0;
+}
+
+
+extern usb_hcdrv_t ohci_driver;
+
+/* *********************************************************************
+ * xprintf(str)
+ *
+ * Called by lib_malloc, we need to supply it.
+ *
+ * Input parameters:
+ * str - string
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+int xprintf(char *str)
+{
+ printf("%s",str);
+ return 0;
+}
+
+/* *********************************************************************
+ * main(argc,argv)
+ *
+ * Main test program
+ *
+ * Input parameters:
+ * argc,argv - guess.
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+
+int main(int argc,char *argv[])
+{
+ int res;
+ memstats_t stats;
+ uint8_t *buffer;
+
+ /*
+ * Parse command line args
+ */
+
+ for (res = 1; res < argc; res++) {
+ if (strcmp(argv[res],"-o") == 0) ohcidebug++;
+ if (strcmp(argv[res],"-u") == 0) usb_noisy++;
+ }
+
+ /*
+ * Open the play area.
+ */
+
+ if (init_devaccess() < 0) {
+ printf("Could not map USB controller\n");
+ }
+
+ /*
+ * Establish signal and exit handlers
+ */
+
+ signal(SIGINT,sighandler);
+ atexit(uninit_devaccess);
+
+ /*
+ * Initialize a buffer pool to point at the play area.
+ * the 'malloc' calls inside our driver will therefore
+ * allocate memory suitable for DMA, just like on real
+ * hardware.
+ */
+
+ KMEMINIT(play_area,PLAY_AREA_SIZE);
+
+ buffer = KMALLOC(512,32);
+
+ printf("-------------------------------------------\n\n");
+
+ /*
+ * Create the OHCI driver instance.
+ */
+
+
+ bus = UBCREATE(&ohci_driver,(void *) device_area);
+
+ /*
+ * Hack: retrieve copy of softc for our exception handler
+ */
+
+ ohci = (ohci_softc_t *) bus->ub_hwsoftc;
+
+ /*
+ * Start the controller.
+ */
+
+ res = UBSTART(bus);
+
+ if (res != 0) {
+ printf("Could not init hardware\n");
+ UBSTOP(bus);
+ exit(1);
+ }
+
+ /*
+ * Init the root hub
+ */
+
+ usb_initroot(bus);
+
+ /*
+ * Main loop - just call interrupt routine to poll
+ */
+
+ while (usbmass_dev== NULL) {
+ usb_poll(bus);
+ usb_daemon(bus);
+ }
+
+ for (res = 0; res < 1000; res++) {
+ usbmass_read_sector(usbmass_dev,0,1,buffer);
+ }
+
+ printf("----- finished reading all sectors ----\n");
+
+ while (running) {
+ usb_poll(bus);
+ usb_daemon(bus);
+ }
+
+ /*
+ * Clean up - get heap statistics to see if we
+ * screwed up.
+ */
+
+ res = KMEMSTATS(&stats);
+ if (res < 0) printf("Warning: heap is not consistent\n");
+ else printf("Heap is ok\n");
+
+ exit(0);
+
+}
diff --git a/cfe/cfe/usb/usbhack.h b/cfe/cfe/usb/usbhack.h
new file mode 100644
index 0000000..9f95840
--- /dev/null
+++ b/cfe/cfe/usb/usbhack.h
@@ -0,0 +1,66 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * usb test harness definitions File: usbhack.h
+ *
+ * Anything special required by the test harness is defined
+ * here.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+void console_log(const char *tmplt,...);
+
diff --git a/cfe/cfe/usb/usbhack.mk b/cfe/cfe/usb/usbhack.mk
new file mode 100644
index 0000000..361973e
--- /dev/null
+++ b/cfe/cfe/usb/usbhack.mk
@@ -0,0 +1,23 @@
+
+OBJS = usbhack.o lib_malloc.o lib_queue.o ohci.o usbd.o \
+ usbdevs.o usbhub.o usbdebug.o usbhid.o usbmass.o usbserial.o
+
+CFLAGS = -I../include -g -Wall
+VPATH = ../lib
+
+%.o : %.c
+ gcc $(CFLAGS) -c -o $@ $<
+
+all : usbhack
+ echo done
+
+usbhack : $(OBJS)
+ gcc -o usbhack $(OBJS)
+
+lib_malloc.o : lib_malloc.c
+
+usbhack.o : usbhack.c
+
+
+clean :
+ rm -f *.o usbhack
diff --git a/cfe/cfe/usb/usbhid.c b/cfe/cfe/usb/usbhid.c
new file mode 100644
index 0000000..df84f4e
--- /dev/null
+++ b/cfe/cfe/usb/usbhid.c
@@ -0,0 +1,664 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * USB Human Interface Driver File: usbhid.c
+ *
+ * This module deals with keyboards, mice, etc. It's very simple,
+ * and only the "boot protocol" is supported.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#ifndef _CFE_
+#include <stdio.h>
+#include <time.h>
+#include <memory.h>
+#include <stdint.h>
+#include "usbhack.h"
+#else
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+#include "cfe_console.h"
+#endif
+
+#include "lib_malloc.h"
+#include "lib_queue.h"
+#include "usbchap9.h"
+#include "usbd.h"
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define HID_BOOT_PROTOCOL 0
+#define HID_REPORT_PROTOCOL 1
+
+#define HID_DEVTYPE_UNKNOWN 0
+#define HID_DEVTYPE_KBD 1
+#define HID_DEVTYPE_MOUSE 2
+#define HID_DEVTYPE_MAX 2
+
+#define UBR_KBD_MODS 0
+#define UBR_KBD_RSVD 1
+#define UBR_KBD_KEYS 2
+#define UBR_KBD_NUMKEYS 6
+#define UBR_KBD_MAX 8
+
+#define KBD_MOD_LCTRL 0x01
+#define KBD_MOD_LSHIFT 0x02
+#define KBD_MOD_LALT 0x04
+#define KBD_MOD_LWIN 0x08
+
+#define KBD_MOD_RCTRL 0x10
+#define KBD_MOD_RSHIFT 0x20
+#define KBD_MOD_RALT 0x40
+#define KBD_MOD_RWIN 0x80
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#define usbhid_set_protocol(dev,protocol,ifc) \
+ usb_simple_request(dev,0x21,0x0B,0,ifc)
+
+
+/* *********************************************************************
+ * Forward Definitions
+ ********************************************************************* */
+
+static int usbhid_attach(usbdev_t *dev,usb_driver_t *drv);
+static int usbhid_detach(usbdev_t *dev);
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+typedef struct usbhid_softc_s {
+ int uhid_ipipe;
+ int uhid_ipipemps;
+ int uhid_devtype;
+ uint8_t uhid_imsg[UBR_KBD_MAX];
+ uint8_t uhid_lastmsg[UBR_KBD_MAX];
+ uint32_t uhid_shiftflags;
+} usbhid_softc_t;
+
+usb_driver_t usbhid_driver = {
+ "Human-Interface Device",
+ usbhid_attach,
+ usbhid_detach
+};
+
+static char *usbhid_devtypes[3] = {
+ "Unknown",
+ "Keyboard",
+ "Mouse"};
+
+#ifdef CFG_VGACONSOLE
+extern int pcconsole_enqueue(uint8_t ch);
+#endif
+
+
+/* *********************************************************************
+ * Constants for keyboard table
+ ********************************************************************* */
+
+#define FLG_NUM 0x0001 /* Toggles: same as bits for LEDs */
+#define FLG_CAPS 0x0002
+#define FLG_SCROLL 0x0004
+#define FLG_SHIFT 0x0008 /* Shifts */
+#define FLG_CTRL 0x0100
+#define FLG_ALT 0x0200
+#define FLG_FKEY 0x0400 /* function keys */
+#define FLG_NKPD 0x0800 /* numeric keypad */
+#define FLG_ASCII 0x1000 /* regular ASCII character */
+#define FLG_NONE 0x2000
+
+
+/* *********************************************************************
+ * Structures for keyboard table
+ ********************************************************************* */
+
+#define KC_RESPLEN 4
+typedef struct keycode_s {
+ int kc_type;
+ char kc_normal[KC_RESPLEN];
+ char kc_shifted[KC_RESPLEN];
+ char kc_ctrl[KC_RESPLEN];
+} keycode_t;
+
+
+/* *********************************************************************
+ * Scan code conversion table
+ ********************************************************************* */
+
+static keycode_t usbhid_scantable[] = {
+ { FLG_NONE, "", "", "" }, /* 0 */
+ { FLG_NONE, "", "", "" }, /* 1 */
+ { FLG_NONE, "", "", "" }, /* 2 */
+ { FLG_NONE, "", "", "" }, /* 3 */
+ { FLG_ASCII, "a", "A", "\001" }, /* 4 a */
+ { FLG_ASCII, "b", "B", "\002" }, /* 5 b */
+ { FLG_ASCII, "c", "C", "\003" }, /* 6 c */
+ { FLG_ASCII, "d", "D", "\004" }, /* 7 d */
+ { FLG_ASCII, "e", "E", "\005" }, /* 8 e */
+ { FLG_ASCII, "f", "F", "\006" }, /* 9 f */
+ { FLG_ASCII, "g", "G", "\007" }, /* 10 g */
+ { FLG_ASCII, "h", "H", "\010" }, /* 11 h */
+ { FLG_ASCII, "i", "I", "\011" }, /* 12 i */
+ { FLG_ASCII, "j", "J", "\n" }, /* 13 j */
+ { FLG_ASCII, "k", "K", "\013" }, /* 14 k */
+ { FLG_ASCII, "l", "L", "\014" }, /* 15 l */
+ { FLG_ASCII, "m", "M", "\r" }, /* 16 m */
+ { FLG_ASCII, "n", "N", "\016" }, /* 17 n */
+ { FLG_ASCII, "o", "O", "\017" }, /* 18 o */
+ { FLG_ASCII, "p", "P", "\020" }, /* 19 p */
+ { FLG_ASCII, "q", "Q", "\021" }, /* 20 q */
+ { FLG_ASCII, "r", "R", "\022" }, /* 21 r */
+ { FLG_ASCII, "s", "S", "\023" }, /* 22 s */
+ { FLG_ASCII, "t", "T", "\024" }, /* 23 t */
+ { FLG_ASCII, "u", "U", "\025" }, /* 24 u */
+ { FLG_ASCII, "v", "V", "\026" }, /* 25 v */
+ { FLG_ASCII, "w", "W", "\027" }, /* 26 w */
+ { FLG_ASCII, "x", "X", "\030" }, /* 27 x */
+ { FLG_ASCII, "y", "Y", "\031" }, /* 28 y */
+ { FLG_ASCII, "z", "Z", "\032" }, /* 29 z */
+
+ { FLG_ASCII, "1", "!", "!" }, /* 30 1 */
+ { FLG_ASCII, "2", "@", "\000" }, /* 31 2 */
+ { FLG_ASCII, "3", "#", "#" }, /* 32 3 */
+ { FLG_ASCII, "4", "$", "$" }, /* 33 4 */
+ { FLG_ASCII, "5", "%", "%" }, /* 34 5 */
+ { FLG_ASCII, "6", "^", "\036" }, /* 35 6 */
+ { FLG_ASCII, "7", "&", "&" }, /* 36 7 */
+ { FLG_ASCII, "8", "*", "\010" }, /* 37 8 */
+ { FLG_ASCII, "9", "(", "(" }, /* 38 9 */
+ { FLG_ASCII, "0", ")", ")" }, /* 39 0 */
+
+ { FLG_ASCII, "\r", "\r", "\n" }, /* 40 ENT */
+ { FLG_ASCII, "\033", "\033", "\033" }, /* 41 ESC */
+ { FLG_ASCII, "\177", "\177", "\010" }, /* 42 <- */
+ { FLG_ASCII, "\t", "\177\t", "\t" }, /* 43 ->| */
+ { FLG_ASCII, " ", " ", "\000" }, /* 44 SPC */
+
+ { FLG_ASCII, "-", "_", "\037" }, /* 45 - */
+ { FLG_ASCII, "=", "+", "+" }, /* 46 = */
+ { FLG_ASCII, "[", "{", "\033" }, /* 47 [ */
+ { FLG_ASCII, "]", "}", "\035" }, /* 48 ] */
+ { FLG_ASCII, "\\", "|", "\034" }, /* 49 \ */
+
+ { FLG_NONE, "", "", "" }, /* 50 pound */
+
+ { FLG_ASCII, ";", ":", ";" }, /* 51 ; */
+ { FLG_ASCII, "'", "\"", "'" }, /* 52 ' */
+ { FLG_ASCII, "`", "~", "`" }, /* 53 ` */
+ { FLG_ASCII, ",", "<", "<" }, /* 54 , */
+ { FLG_ASCII, ".", ">", ">" }, /* 55 . */
+ { FLG_ASCII, "/", "?", "\037" }, /* 56 / */
+ { FLG_CAPS, "", "", "" }, /* 57 CAPS */
+
+ { FLG_FKEY, "\033[M", "\033[Y", "\033[k" }, /* 58 f1 */
+ { FLG_FKEY, "\033[N", "\033[Z", "\033[l" }, /* 59 f2 */
+ { FLG_FKEY, "\033[O", "\033[a", "\033[m" }, /* 60 f3 */
+ { FLG_FKEY, "\033[P", "\033[b", "\033[n" }, /* 61 f4 */
+ { FLG_FKEY, "\033[Q", "\033[c", "\033[o" }, /* 62 f5 */
+ { FLG_FKEY, "\033[R", "\033[d", "\033[p" }, /* 63 f6 */
+ { FLG_FKEY, "\033[S", "\033[e", "\033[q" }, /* 64 f7 */
+ { FLG_FKEY, "\033[T", "\033[f", "\033[r" }, /* 65 f8 */
+ { FLG_FKEY, "\033[U", "\033[g", "\033[s" }, /* 66 f9 */
+ { FLG_FKEY, "\033[V", "\033[h", "\033[t" }, /* 67 f10 */
+ { FLG_FKEY, "\033[W", "\033[i", "\033[u" }, /* 68 f11 */
+ { FLG_FKEY, "\033[X", "\033[j", "\033[v" }, /* 69 f12 */
+
+ { FLG_NONE, "", "", "" }, /* 70 prtsc */
+ { FLG_SCROLL, "", "", "" }, /* 71 SCRLK */
+ { FLG_NONE, "", "", "" }, /* 72 pause */
+ { FLG_NONE, "", "", "" }, /* 73 KPins */
+ { FLG_NONE, "", "", "" }, /* 74 KPhome */
+ { FLG_NONE, "", "", "" }, /* 75 KPpgup */
+ { FLG_NONE, "", "", "" }, /* 76 KPdel */
+ { FLG_NONE, "", "", "" }, /* 77 KPend */
+ { FLG_NONE, "", "", "" }, /* 78 KPpgdn */
+
+ { FLG_FKEY, "\033[C", "", "" }, /* 79 KPright */
+ { FLG_FKEY, "\033[D", "", "" }, /* 80 KPleft */
+ { FLG_FKEY, "\033[B", "", "" }, /* 81 KPdown */
+ { FLG_FKEY, "\033[A", "", "" }, /* 82 KPup */
+
+ { FLG_NUM, "", "", "" }, /* 83 NUMLK */
+ { FLG_NKPD, "/", "/", "/" }, /* 84 KP/ */
+ { FLG_NKPD, "*", "*", "*" }, /* 85 KP* */
+ { FLG_NKPD, "-", "-", "-" }, /* 86 KP- */
+ { FLG_NKPD, "+", "+", "+" }, /* 87 KP+ */
+ { FLG_NKPD, "\r", "\r", "\n" }, /* 88 KPent */
+
+ { FLG_NKPD, "1", "\033[F", "1" }, /* 89 KP1 */
+ { FLG_NKPD, "2", "\033[B", "2" }, /* 90 KP2 */
+ { FLG_NKPD, "3", "\033[G", "3" }, /* 91 KP3 */
+ { FLG_NKPD, "4", "\033[D", "4" }, /* 92 KP4 */
+ { FLG_NKPD, "5", "\033[E", "5" }, /* 93 KP5 */
+ { FLG_NKPD, "6", "\033[C", "6" }, /* 94 KP6 */
+ { FLG_NKPD, "7", "\033[H", "7" }, /* 95 KP7 */
+ { FLG_NKPD, "8", "\033[A", "8" }, /* 96 KP8 */
+ { FLG_NKPD, "9", "\033[I", "9" }, /* 97 KP9 */
+ { FLG_NKPD, "0", "\033[L", "0" }, /* 98 KP0 */
+
+ { FLG_NKPD, ".", "\177", "." }, /* 99 KP. */
+
+ { FLG_NONE, "", "", "" }, /* 100 non\ */
+
+};
+
+#define usbhid_scantablesize (sizeof(usbhid_scantable)/sizeof(keycode_t))
+
+
+/* *********************************************************************
+ * usbhid_kbd_mod1(uhid)
+ *
+ * Process modifier key changes for the current USB event,
+ * which was stored in uhid_imsg. Basically all this does
+ * is update uhid_shiftflags, converting the bits into the ones
+ * we use in our keyboard table.
+ *
+ * Input parameters:
+ * uhid - the hid softc.
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void usbhid_kbd_mod1(usbhid_softc_t *uhid)
+{
+ uint8_t changed;
+ uint8_t mod;
+
+ /*
+ * See if anything changed.
+ */
+
+ changed = (uhid->uhid_imsg[UBR_KBD_MODS] ^ uhid->uhid_lastmsg[UBR_KBD_MODS]);
+ if (changed == 0) return;
+
+ /*
+ * Something changed. Reflect changes in our local copy of the
+ * shift state.
+ */
+
+ mod = uhid->uhid_imsg[UBR_KBD_MODS];
+
+ uhid->uhid_shiftflags &= ~(FLG_SHIFT|FLG_ALT|FLG_CTRL);
+
+ if (mod & (KBD_MOD_LCTRL|KBD_MOD_RCTRL)) uhid->uhid_shiftflags |= FLG_CTRL;
+ if (mod & (KBD_MOD_LSHIFT|KBD_MOD_RSHIFT)) uhid->uhid_shiftflags |= FLG_SHIFT;
+ if (mod & (KBD_MOD_LALT|KBD_MOD_RALT)) uhid->uhid_shiftflags |= FLG_ALT;
+}
+
+/* *********************************************************************
+ * usbhid_kbd_scan1(uhid,scan,breakflg)
+ *
+ * Handle a single keyboard event. Using the scan code, look up
+ * the key in the table and convert it to one or more characters
+ * for the keyboard event queue.
+ *
+ * Input parameters:
+ * uhid - the hid softc
+ * scan - scan code from keyboard report
+ * breakflg - true if key is being released, false if pressed
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void usbhid_kbd_scan1(usbhid_softc_t *uhid,uint8_t scan,int breakflg)
+{
+ keycode_t *code = 0;
+ char *str;
+
+ /*
+ * Check scan code for reality.
+ */
+
+ if (scan >= usbhid_scantablesize) return;
+ code = &usbhid_scantable[scan];
+
+ /*
+ * If the change is a toggle, handle the toggle. These
+ * keys also deal with the LEDs on the keyboard.
+ */
+
+ if (code->kc_type & (FLG_CAPS|FLG_SCROLL|FLG_NUM)) {
+ if (!breakflg) uhid->uhid_shiftflags ^= code->kc_type;
+// if (ks->ks_setleds) {
+// (*(ks->ks_setleds))(ks,ks->ks_shiftflags & (FLG_CAPS|FLG_SCROLL|FLG_NUM));
+// }
+ }
+
+ /*
+ * Regular keys - just look up in table and
+ * queue the characters to the upper layers.
+ */
+
+ if (code->kc_type & (FLG_ASCII | FLG_FKEY | FLG_NKPD)) {
+ if (uhid->uhid_shiftflags & (FLG_SHIFT|FLG_CAPS)) str = code->kc_shifted;
+ else if (uhid->uhid_shiftflags & FLG_CTRL) str = code->kc_ctrl;
+ else str = code->kc_normal;
+ if (!breakflg) {
+#if CFG_VGACONSOLE
+ while (*str) {
+ pcconsole_enqueue(*str++);
+ }
+#else
+ printf("%s",str);
+#endif
+#ifndef _CFE_
+ fflush(stdout);
+#endif
+ }
+ }
+
+}
+
+
+/* *********************************************************************
+ * usbhid_kbd_scan(uhid)
+ *
+ * Main processing routine for keyboard report messages. Once
+ * we've determined that it is a keyboard mesage, we end up
+ * here. The work involves seeing what new keys have arrived
+ * in the list (presses), and which ones are no longer there
+ * (releases). To do this, we us the current and previous
+ * report structure.
+ *
+ * Input parameters:
+ * uhid - the hid softc
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void usbhid_kbd_scan(usbhid_softc_t *uhid)
+{
+ int n,o;
+
+ /*
+ * Modifier keys (shift, alt, control)
+ */
+
+ if (uhid->uhid_imsg[UBR_KBD_MODS] ^ uhid->uhid_lastmsg[UBR_KBD_MODS]) {
+ usbhid_kbd_mod1(uhid);
+ }
+
+ /*
+ * "Make" codes (keys pressed down)
+ * Look for keys in 'uhid_imsg' that are not in 'uhid_lastmsg'
+ */
+
+ for (n = UBR_KBD_KEYS; n < (UBR_KBD_KEYS + UBR_KBD_NUMKEYS); n++) {
+ if (uhid->uhid_imsg[n] == 0) break; /* no more keys */
+ for (o = UBR_KBD_KEYS; o < (UBR_KBD_KEYS + UBR_KBD_NUMKEYS); o++) {
+ if (uhid->uhid_imsg[n] == uhid->uhid_lastmsg[o]) break;
+ }
+ if (o == (UBR_KBD_KEYS + UBR_KBD_NUMKEYS)) { /* key not found, must be pressed */
+ usbhid_kbd_scan1(uhid,uhid->uhid_imsg[n],0);
+ }
+ }
+
+ /*
+ * "Break" codes (keys released)
+ * Look for keys in 'uhid_lastmsg' that are not in 'uhid_imsg'
+ */
+
+
+ for (n = UBR_KBD_KEYS; n < (UBR_KBD_KEYS + UBR_KBD_NUMKEYS); n++) {
+ if (uhid->uhid_lastmsg[n] == 0) break; /* no more keys */
+ for (o = UBR_KBD_KEYS; o < (UBR_KBD_KEYS + UBR_KBD_NUMKEYS); o++) {
+ if (uhid->uhid_lastmsg[n] == uhid->uhid_imsg[o]) break;
+ }
+ if (o == (UBR_KBD_KEYS + UBR_KBD_NUMKEYS)) { /* key not found, must be released */
+ usbhid_kbd_scan1(uhid,uhid->uhid_lastmsg[n],1);
+ }
+ }
+}
+
+
+/* *********************************************************************
+ * usbhid_ireq_callback(ur)
+ *
+ * This routine is called when our interrupt transfer completes
+ * and there is report data to be processed.
+ *
+ * Input parameters:
+ * ur - usb request
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+static int usbhid_ireq_callback(usbreq_t *ur)
+{
+ usbhid_softc_t *uhid = (ur->ur_dev->ud_private);
+
+ /*
+ * If the driver is unloaded, the request will be cancelled.
+ */
+
+ if (ur->ur_status == 0xFF) {
+ usb_free_request(ur);
+ return 0;
+ }
+
+ /*
+ * What we do now depends on the type of device.
+ */
+
+ switch (uhid->uhid_devtype) {
+ case HID_DEVTYPE_KBD:
+ /*
+ * Handle keyboard event
+ */
+ usbhid_kbd_scan(uhid);
+
+ /*
+ * Save old event to compare for next time.
+ */
+ memcpy(uhid->uhid_lastmsg,uhid->uhid_imsg,8);
+ break;
+
+ case HID_DEVTYPE_MOUSE:
+#if 0
+ /*
+ * No need to handle mice, but here's the good stuff.
+ */
+ printf("Mouse: [%s %s %s] X:%d Y:%d Wheel:%d\n",
+ (ur->ur_buffer[0] & 1) ? "left" : "",
+ (ur->ur_buffer[0] & 4) ? "middle" : "",
+ (ur->ur_buffer[0] & 2) ? "right" : "",
+ (int)(signed char)ur->ur_buffer[1],
+ (int)(signed char)ur->ur_buffer[2],
+ (int)(signed char)ur->ur_buffer[3]);
+#endif
+ break;
+ }
+
+ /*
+ * Re-queue request to get next keyboard event.
+ */
+
+ usb_queue_request(ur);
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * usbhid_queue_intreq(dev,softc)
+ *
+ * Queue an interrupt request for this usb device. The
+ * driver will place this request on the queue that corresponds
+ * to the endpoint, and will call the callback routine when
+ * something happens.
+ *
+ * Input parameters:
+ * dev - usb device
+ * softc - the usb hid softc
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void usbhid_queue_intreq(usbdev_t *dev,usbhid_softc_t *softc)
+{
+ usbreq_t *ur;
+
+ ur = usb_make_request(dev,
+ softc->uhid_ipipe,
+ softc->uhid_imsg,softc->uhid_ipipemps,
+ UR_FLAG_IN);
+
+ ur->ur_callback = usbhid_ireq_callback;
+
+ usb_queue_request(ur);
+}
+
+
+/* *********************************************************************
+ * usbhid_attach(dev,drv)
+ *
+ * This routine is called when the bus scan stuff finds a HID
+ * device. We finish up the initialization by configuring the
+ * device and allocating our softc here.
+ *
+ * Input parameters:
+ * dev - usb device, in the "addressed" state.
+ * drv - the driver table entry that matched
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+static int usbhid_attach(usbdev_t *dev,usb_driver_t *drv)
+{
+ usb_config_descr_t *cfgdscr = dev->ud_cfgdescr;
+ usb_endpoint_descr_t *epdscr;
+ usb_interface_descr_t *ifdscr;
+ usbhid_softc_t *softc;
+
+ dev->ud_drv = drv;
+
+ softc = KMALLOC(sizeof(usbhid_softc_t),0);
+ memset(softc,0,sizeof(usbhid_softc_t));
+ dev->ud_private = softc;
+
+ epdscr = usb_find_cfg_descr(dev,USB_ENDPOINT_DESCRIPTOR_TYPE,0);
+ ifdscr = usb_find_cfg_descr(dev,USB_INTERFACE_DESCRIPTOR_TYPE,0);
+
+ if (!epdscr || !ifdscr) {
+ /*
+ * Could not get descriptors, something is very wrong.
+ * Leave device addressed but not configured.
+ */
+ return 0;
+ }
+
+ /*
+ * Choose the standard configuration.
+ */
+
+ usb_set_configuration(dev,cfgdscr->bConfigurationValue);
+
+ /*
+ * Set the protocol to the "boot" protocol, so we don't
+ * have to deal with fancy HID stuff.
+ */
+
+ usbhid_set_protocol(dev,HID_BOOT_PROTOCOL,ifdscr->bInterfaceNumber);
+
+ /*
+ * Open the interrupt pipe.
+ */
+
+ softc->uhid_ipipe = usb_open_pipe(dev,epdscr);
+ softc->uhid_ipipemps = GETUSBFIELD(epdscr,wMaxPacketSize);
+
+ /*
+ * Figure out the device type from the protocol. Keyboards,
+ * mice use this field to distinguish themselves.
+ */
+
+ softc->uhid_devtype = ifdscr->bInterfaceProtocol;
+ if (softc->uhid_devtype > HID_DEVTYPE_MAX) {
+ softc->uhid_devtype = HID_DEVTYPE_UNKNOWN;
+ }
+
+ console_log("USBHID: %s Configured.\n",
+ usbhid_devtypes[softc->uhid_devtype]);
+
+ /*
+ * Queue a transfer on the interrupt endpoint to catch
+ * our first characters.
+ */
+
+ usbhid_queue_intreq(dev,softc);
+
+ return 0;
+}
+
+/* *********************************************************************
+ * usbhid_detach(dev)
+ *
+ * This routine is called when the bus scanner notices that
+ * this device has been removed from the system. We should
+ * do any cleanup that is required. The pending requests
+ * will be cancelled automagically.
+ *
+ * Input parameters:
+ * dev - usb device
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+static int usbhid_detach(usbdev_t *dev)
+{
+ return 0;
+}
+
+
+
diff --git a/cfe/cfe/usb/usbhub.c b/cfe/cfe/usb/usbhub.c
new file mode 100644
index 0000000..1e571ed
--- /dev/null
+++ b/cfe/cfe/usb/usbhub.c
@@ -0,0 +1,912 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * USB Hub and device discovery code File: usbhub.c
+ *
+ * This module deals with hubs and device discovery.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#ifndef _CFE_
+#include <stdio.h>
+#include <time.h>
+#include <memory.h>
+#include <stdint.h>
+#include "usbhack.h"
+#else
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+#include "cfe_console.h"
+#endif
+
+#include "lib_malloc.h"
+#include "lib_queue.h"
+#include "usbchap9.h"
+#include "usbd.h"
+
+/* *********************************************************************
+ * Macros for common hub requests
+ ********************************************************************* */
+
+#define usbhub_set_port_feature(dev,port,feature) \
+ usb_simple_request(dev,0x23,USB_HUBREQ_SET_FEATURE,feature,port)
+
+#define usbhub_set_hub_feature(dev,feature) \
+ usb_simple_request(dev,0x20,USB_HUBREQ_SET_FEATURE,feature,0)
+
+#define usbhub_clear_port_feature(dev,port,feature) \
+ usb_simple_request(dev,0x23,USB_HUBREQ_CLEAR_FEATURE,feature,port)
+
+#define usbhub_clear_hub_feature(dev,feature) \
+ usb_simple_request(dev,0x20,USB_HUBREQ_CLEAR_FEATURE,feature,0)
+
+
+/* *********************************************************************
+ * Externs
+ ********************************************************************* */
+
+extern int usb_noisy;
+
+/* *********************************************************************
+ * Forward declarations
+ ********************************************************************* */
+
+static int usbhub_attach(usbdev_t *dev,usb_driver_t *drv);
+static int usbhub_detach(usbdev_t *dev);
+
+/* *********************************************************************
+ * Hub-specific data structures
+ ********************************************************************* */
+
+#define UHUB_MAX_DEVICES 8
+
+#define UHUB_FLG_NEEDSCAN 1
+
+typedef struct usbhub_softc_s {
+ usb_hub_descr_t uhub_descr;
+ usb_hub_status_t uhub_status;
+ int uhub_ipipe;
+ int uhub_ipipemps;
+ int uhub_nports;
+ unsigned int uhub_flags;
+ uint8_t uhub_imsg[8];
+ usbdev_t *uhub_devices[UHUB_MAX_DEVICES];
+} usbhub_softc_t;
+
+usb_driver_t usbhub_driver = {
+ "USB Hub",
+ usbhub_attach,
+ usbhub_detach
+};
+
+
+/* *********************************************************************
+ * usbhub_ireq_callback(ur)
+ *
+ * this routine is called when the transfer we queued to the
+ * interrupt endpoint on the hub completes. It means that
+ * *some* port on the hub needs attention. The data indicates
+ * which port, but for our purposes we don't really care - if
+ * we get this callback, we'll set a flag and re-probe the bus.
+ *
+ * Input parameters:
+ * ur - usbreq that completed
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+static int usbhub_ireq_callback(usbreq_t *ur)
+{
+ int idx;
+ usbhub_softc_t *uhub = (ur->ur_dev->ud_private);
+
+ /*
+ * Check to see if the request was cancelled by someone
+ * deleting our endpoint.
+ */
+
+ if (ur->ur_status == 0xFF) {
+ usb_free_request(ur);
+ return 0;
+ }
+
+ /*
+ * Check to see if any of our ports need attention
+ */
+
+ for (idx = 1; idx <= uhub->uhub_nports; idx++) {
+ if (ur->ur_buffer[0] & (1<<idx)) {
+
+ /*
+ * Mark the hub as needing a scan, and mark the bus as well
+ * so the top-level polling will notice.
+ */
+
+ uhub->uhub_flags |= UHUB_FLG_NEEDSCAN;
+ ur->ur_dev->ud_bus->ub_flags |= UB_FLG_NEEDSCAN;
+ }
+ }
+
+
+ /*
+ * Do NOT requeue the request here. We will do this
+ * during exploration.
+ */
+
+ usb_free_request(ur);
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * usbhub_get_hub_descriptor(dev,dscr,idx,maxlen)
+ *
+ * Obtain the hub descriptor (special for hubs) from the
+ * device.
+ *
+ * Input parameters:
+ * dev - usb device
+ * dscr - place to put hub descriptor
+ * idx - which hub descriptor to get (usually zero)
+ * maxlen - max # of bytes to return
+ *
+ * Return value:
+ * # of bytes returned
+ ********************************************************************* */
+
+static int usbhub_get_hub_descriptor(usbdev_t *dev,usb_hub_descr_t *dscr,int idx,int maxlen)
+{
+ return usb_std_request(dev,0xA0,
+ USB_HUBREQ_GET_DESCRIPTOR,
+ 0,0,
+ (uint8_t *) dscr,
+ maxlen);
+}
+
+
+/* *********************************************************************
+ * usbhub_get_hub_status(dev,status)
+ *
+ * Obtain the hub status (special for hubs) from the
+ * device.
+ *
+ * Input parameters:
+ * dev - usb device
+ * status - where to put hub status structure
+ *
+ * Return value:
+ * # of bytes returned
+ ********************************************************************* */
+
+#if 0
+static int usbhub_get_hub_status(usbdev_t *dev,usb_hub_status_t *status)
+{
+ return usb_std_request(dev,
+ 0xA0,
+ 0x00,
+ 0,
+ 0,
+ (uint8_t *) status,
+ sizeof(usbhub_status_t));
+}
+#endif
+
+
+/* *********************************************************************
+ * usbhub_get_port_status(dev,port,status)
+ *
+ * Obtain the port status for a particular port from
+ * device.
+ *
+ * Input parameters:
+ * dev - usb device
+ * port - 1-based port number
+ * status - where to put port status structure
+ *
+ * Return value:
+ * # of bytes returned
+ ********************************************************************* */
+
+static int usbhub_get_port_status(usbdev_t *dev,int port,usb_port_status_t *status)
+{
+ return usb_std_request(dev,
+ 0xA3,
+ 0,
+ 0,
+ port,
+ (uint8_t *) status,
+ sizeof(usb_port_status_t));
+}
+
+
+/* *********************************************************************
+ * usbhub_queue_intreq(dev,softc)
+ *
+ * Queue the transfer to the interrupt pipe that will catch
+ * the hub's port status changes
+ *
+ * Input parameters:
+ * dev - usb device
+ * softc - hub-specific data
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void usbhub_queue_intreq(usbdev_t *dev,usbhub_softc_t *softc)
+{
+ usbreq_t *ur;
+
+ ur = usb_make_request(dev,
+ softc->uhub_ipipe,
+ softc->uhub_imsg,softc->uhub_ipipemps,
+ UR_FLAG_IN | UR_FLAG_SHORTOK);
+
+ ur->ur_callback = usbhub_ireq_callback;
+
+ usb_queue_request(ur);
+}
+
+
+/* *********************************************************************
+ * usbhub_attach(dev,drv)
+ *
+ * This routine is called when the hub attaches to the system.
+ * We complete initialization for the hub and set things up so
+ * that an explore will happen soon.
+ *
+ * Input parameters:
+ * dev - usb device
+ * drv - driver structure
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+static int usbhub_attach(usbdev_t *dev,usb_driver_t *drv)
+{
+ usb_device_status_t devstatus;
+ usb_config_descr_t *cfgdscr;
+ usb_interface_descr_t *ifdscr;
+ usb_endpoint_descr_t *epdscr;
+ usbhub_softc_t *softc;
+
+ /*
+ * Remember the driver dispatch.
+ */
+
+ dev->ud_drv = drv;
+
+ softc = KMALLOC(sizeof(usbhub_softc_t),0);
+ memset(softc,0,sizeof(usbhub_softc_t));
+ dev->ud_private = softc;
+
+ /*
+ * Dig out the data from the configuration descriptor
+ * (we got this from the device before attach time)
+ */
+
+ cfgdscr = dev->ud_cfgdescr;
+ epdscr = usb_find_cfg_descr(dev,USB_ENDPOINT_DESCRIPTOR_TYPE,0);
+ ifdscr = usb_find_cfg_descr(dev,USB_INTERFACE_DESCRIPTOR_TYPE,0);
+
+ /*
+ * Get device status (is this really necessary?)
+ */
+
+ usb_get_device_status(dev,&devstatus);
+
+ /*
+ * Set us to configuration index 0
+ */
+
+ usb_set_configuration(dev,cfgdscr->bConfigurationValue);
+
+ /*
+ * Get the hub descriptor. Get the first 8 bytes first, then get the rest
+ * if there is more.
+ */
+
+ if (usbhub_get_hub_descriptor(dev,&(softc->uhub_descr),0,USB_HUB_DESCR_SIZE) > USB_HUB_DESCR_SIZE) {
+ usbhub_get_hub_descriptor(dev,&(softc->uhub_descr),0,softc->uhub_descr.bDescriptorLength);
+ }
+
+ /*
+ * remember stuff from the hub descriptor
+ */
+
+ softc->uhub_nports = softc->uhub_descr.bNumberOfPorts;
+
+ /*
+ * Open the interrupt pipe
+ */
+
+ softc->uhub_ipipe = usb_open_pipe(dev,epdscr);
+ softc->uhub_ipipemps = GETUSBFIELD(epdscr,wMaxPacketSize);
+
+ /*
+ * Mark the bus and the hub as needing service.
+ */
+
+ softc->uhub_flags |= UHUB_FLG_NEEDSCAN;
+ dev->ud_bus->ub_flags |= UB_FLG_NEEDSCAN;
+
+ /*
+ * Okay, that's it. The top-level USB daemon will notice
+ * that the bus needs service and will invoke the exploration code.
+ * This may in turn require additional explores until
+ * everything settles down.
+ */
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * usbhub_detach(dev)
+ *
+ * Called when a hub is removed from the system - we remove
+ * all subordinate devicees.
+ *
+ * Input parameters:
+ * dev - device (hub) that was removed
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+static int usbhub_detach(usbdev_t *dev)
+{
+ usbhub_softc_t *hub;
+ usbdev_t *deldev;
+ int idx;
+
+ if (!IS_HUB(dev)) return 0; /* should not happen */
+
+ hub = dev->ud_private;
+ for (idx = 0; idx < UHUB_MAX_DEVICES; idx++) {
+ deldev = hub->uhub_devices[idx];
+ if (deldev) {
+ console_log("USB: Removing device attached to bus %d hub %d port %d",
+ dev->ud_bus->ub_num,
+ dev->ud_address,idx+1);
+ if (deldev->ud_drv) {
+ (*(deldev->ud_drv->udrv_detach))(deldev);
+ }
+ else {
+ if (usb_noisy > 0) {
+ console_log("USB: Detached device on bus %d hub %d port %d "
+ "has no methods",
+ dev->ud_bus->ub_num,
+ dev->ud_address,idx+1);
+ }
+ }
+ if (deldev->ud_cfgdescr) KFREE(deldev->ud_cfgdescr);
+ usb_destroy_device(deldev);
+ }
+ }
+
+ KFREE(hub); /* remove softc */
+
+ return 0;
+}
+
+
+
+/* *********************************************************************
+ * usbhub_map_tree1(dev,level,func,arg)
+ *
+ * This routine is used in recursive device tree exploration.
+ * We call 'func' for each device at this tree, and descend
+ * when we run into hubs
+ *
+ * Input parameters:
+ * dev - current device pointer
+ * level - current nesting level
+ * func - function to call
+ * arg - argument to pass to function
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void usbhub_map_tree1(usbdev_t *dev,int level,
+ int (*func)(usbdev_t *dev,void *arg),void *arg)
+{
+ usbhub_softc_t *hub;
+ int idx;
+
+ (*func)(dev,arg);
+
+ if (IS_HUB(dev)) {
+ hub = dev->ud_private;
+ for (idx = 0; idx < UHUB_MAX_DEVICES; idx++) {
+ if (hub->uhub_devices[idx]) {
+ usbhub_map_tree1(hub->uhub_devices[idx],level+1,func,arg);
+ }
+ }
+ }
+}
+
+/* *********************************************************************
+ * usbhub_map_tree(bus,func,arg)
+ *
+ * Call a function for each device in the tree
+ *
+ * Input parameters:
+ * bus - bus to scan
+ * func - function to call
+ * arg - argument to pass to function
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void usbhub_map_tree(usbbus_t *bus,int (*func)(usbdev_t *dev,void *arg),void *arg)
+{
+ usbhub_map_tree1(bus->ub_roothub,0,func,arg);
+}
+
+
+/* *********************************************************************
+ * usbhub_dumpbus1(dev,arg)
+ *
+ * map function to dump devices in the device tree
+ *
+ * Input parameters:
+ * dev - device we're working on
+ * arg - argument from map_tree call
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+static int usbhub_dumpbus1(usbdev_t *dev,void *arg)
+{
+ uint32_t *verbose = (uint32_t *) arg;
+
+ if ((*verbose & 0x00FF) && (dev->ud_address != (*verbose & 0x00FF))) return 0;
+
+ if (*verbose & 0x100) {
+ printf("============================================================================\n");
+ }
+
+ printf("Bus %d Device %d Class %d Vendor %04X Product %04X ",
+ dev->ud_bus->ub_num,
+ dev->ud_address,
+ dev->ud_devdescr.bDeviceClass,
+ GETUSBFIELD(&(dev->ud_devdescr),idVendor),
+ GETUSBFIELD(&(dev->ud_devdescr),idProduct));
+
+
+ if (IS_HUB(dev)) {
+ printf("[HUB]\n");
+ }
+ else {
+ printf("[DEVICE]\n");
+ }
+
+ if (*verbose & 0x100) {
+ usb_dbg_dumpdescriptors(dev,(uint8_t *) &(dev->ud_devdescr),dev->ud_devdescr.bLength);
+ usb_dbg_dumpcfgdescr(dev);
+ }
+
+ return 0;
+}
+
+
+/* *********************************************************************
+ * usbhub_dumpbus(bus,verbose)
+ *
+ * Dump information about devices on the USB bus.
+ *
+ * Input parameters:
+ * bus - bus to dump
+ * verbose - nonzero to display more info, like descriptors
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void usbhub_dumpbus(usbbus_t *bus,uint32_t verbose)
+{
+ usbhub_map_tree(bus,usbhub_dumpbus1,&verbose);
+}
+
+
+
+/* *********************************************************************
+ * usbhub_reset_devicee(dev,port,status)
+ *
+ * Reset a device on a hub port. This routine does a
+ * USB_PORT_FEATURE_RESET on the specified port, waits for the
+ * bit to clear, and returns. It is used to get a device into the
+ * DEFAULT state according to the spec.
+ *
+ * Input parameters:
+ * dev - hub device
+ * port - port number(1-based)
+ * status - place to return port_status structure after
+ * reset completes
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void usbhub_reset_device(usbdev_t *dev,int port,usb_port_status_t *portstatus)
+{
+ console_log("USB: Resetting device on bus %d port %d",dev->ud_bus->ub_num,port);
+#ifndef _CFE_
+ fflush(stdout);
+#endif
+
+ usbhub_set_port_feature(dev,port,USB_PORT_FEATURE_RESET);
+
+ usbhub_get_port_status(dev,port,portstatus);
+
+ for (;;) {
+ usbhub_get_port_status(dev,port,portstatus);
+ if ((GETUSBFIELD((portstatus),wPortStatus) & USB_PORT_STATUS_RESET) == 0) break;
+ usb_delay_ms(dev->ud_bus,250);
+ }
+ usb_delay_ms(dev->ud_bus,250);
+
+ usbhub_clear_port_feature(dev,port,USB_PORT_FEATURE_C_PORT_RESET);
+}
+
+
+
+/* *********************************************************************
+ * usbhub_scan_ports(dev,arg)
+ *
+ * Scan the ports on this hub for new or removed devices.
+ *
+ * Input parameters:
+ * dev - hub device
+ * arg - passed from bus scan main routines
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void usbhub_scan_ports(usbdev_t *dev,void *arg)
+{
+ uint16_t current;
+ uint16_t changed;
+ usbhub_softc_t *softc;
+ int idx;
+ int res;
+ int len;
+ uint8_t *buf;
+ usbdev_t *newdev;
+ usb_driver_t *newdrv;
+ int addr;
+ usb_port_status_t portstatus;
+ usb_config_descr_t cfgdescr;
+ unsigned int powerondelay;
+
+ if (!IS_HUB(dev)) return; /* should not happen. */
+
+ /*
+ * We know this is a hub. Get the softc back.
+ */
+
+ softc = (usbhub_softc_t *) dev->ud_private;
+
+ powerondelay = ((unsigned int) softc->uhub_descr.bPowerOnToPowerGood)*2 + 20;
+
+ /*
+ * Turn on the power to the ports whose power is not yet on.
+ */
+
+ for (idx = 0; idx < softc->uhub_nports; idx++) {
+
+ usbhub_get_port_status(dev,idx+1,&portstatus);
+
+ current = GETUSBFIELD((&portstatus),wPortStatus);
+ changed = GETUSBFIELD((&portstatus),wPortChange);
+ if (usb_noisy > 1) {
+ printf("BeforePowerup: port %d status %04X changed %04X\n",idx+1,current,changed);
+ }
+
+ if (!(current & USB_PORT_STATUS_POWER)) {
+ if (usb_noisy > 1) console_log("USB: Powering up bus %d port %d",
+ dev->ud_bus->ub_num,idx+1);
+ usbhub_set_port_feature(dev,idx+1,USB_PORT_FEATURE_POWER);
+ usb_delay_ms(dev->ud_bus,powerondelay);
+ }
+ }
+
+ /*
+ * Begin exploration at this level.
+ */
+
+ for (idx = 0; idx < softc->uhub_nports; idx++) {
+
+ usbhub_get_port_status(dev,idx+1,&portstatus);
+
+ current = GETUSBFIELD((&portstatus),wPortStatus);
+ changed = GETUSBFIELD((&portstatus),wPortChange);
+
+ if (usb_noisy > 0) {
+ printf("USB: Explore: Bus %d Hub %d port %d status %04X changed %04X\n",
+ dev->ud_bus->ub_num,
+ dev->ud_address,idx+1,current,changed);
+ usb_dbg_dumpportstatus(idx+1,&portstatus,1);
+ }
+
+
+// if (changed & USB_PORT_STATUS_RESET) {
+// usbhub_clear_port_feature(dev,idx+1,USB_PORT_FEATURE_C_PORT_RESET);
+// }
+
+ if (changed & USB_PORT_STATUS_ENABLED) {
+ usbhub_clear_port_feature(dev,idx+1,USB_PORT_FEATURE_C_PORT_ENABLE);
+ }
+
+ if (changed & USB_PORT_STATUS_CONNECT) {
+ /*
+ * A device was either connected or disconnected.
+ * Clear the status change first.
+ */
+
+ usbhub_clear_port_feature(dev,idx+1,USB_PORT_FEATURE_C_PORT_CONNECTION);
+
+ if (current & USB_PORT_STATUS_CONNECT) {
+
+ /*
+ * The device has been CONNECTED.
+ */
+
+ console_log("USB: New device connected to bus %d hub %d port %d",
+ dev->ud_bus->ub_num,
+ dev->ud_address,idx+1);
+
+ /*
+ * Reset the device. Reuse our old port status structure
+ * so we get the latest status. Some devices do not report
+ * lowspeed until they are reset.
+ */
+
+ usbhub_reset_device(dev,idx+1,&portstatus);
+ current = GETUSBFIELD((&portstatus),wPortStatus);
+ changed = GETUSBFIELD((&portstatus),wPortChange);
+
+ /*
+ * Create a device for this port.
+ */
+
+ newdev = usb_create_device(dev->ud_bus,(current & USB_PORT_STATUS_LOWSPD) ? 1 : 0);
+
+ /*
+ * Get the device descriptor.
+ */
+
+ res = usb_get_device_descriptor(newdev,&(newdev->ud_devdescr),TRUE);
+
+ if (usb_noisy > 0) usb_dbg_dumpdescriptors(newdev,(uint8_t *) &(newdev->ud_devdescr),8);
+
+ /*
+ * Set up the max packet size for the control endpoint,
+ * then get the rest of the descriptor.
+ */
+
+ usb_set_ep0mps(newdev,newdev->ud_devdescr.bMaxPacketSize0);
+ res = usb_get_device_descriptor(newdev,&(newdev->ud_devdescr),FALSE);
+
+ /*
+ * Obtain a new address and set the address of the
+ * root hub to this address.
+ */
+
+ addr = usb_new_address(newdev->ud_bus);
+ res = usb_set_address(newdev,addr);
+
+ /*
+ * Get the configuration descriptor and all the
+ * associated interface and endpoint descriptors.
+ */
+
+ res = usb_get_config_descriptor(newdev,&cfgdescr,0,
+ sizeof(usb_config_descr_t));
+ if (res != sizeof(usb_config_descr_t)) {
+ printf("[a]usb_get_config_descriptor returns %d\n",res);
+ }
+
+ len = GETUSBFIELD(&cfgdescr,wTotalLength);
+ buf = KMALLOC(len,0);
+
+ res = usb_get_config_descriptor(newdev,(usb_config_descr_t *)buf,0,len);
+ if (res != len) {
+ printf("[b]usb_get_config_descriptor returns %d\n",res);
+ }
+
+ newdev->ud_cfgdescr = (usb_config_descr_t *) buf;
+
+ if (usb_noisy > 0) usb_dbg_dumpdescriptors(newdev,buf,len);
+
+ /*
+ * Point the hub at the devices it owns
+ */
+
+ softc->uhub_devices[idx] = newdev;
+
+ /*
+ * Find the driver for this. It had better be the hub
+ * driver.
+ */
+
+ newdrv = usb_find_driver(newdev);
+
+ /*
+ * Call the attach method.
+ */
+
+ if (newdrv) {
+ dev->ud_drv = newdrv; /* remember driver dispatch in device */
+ (*(newdrv->udrv_attach))(newdev,newdrv);
+ }
+ }
+
+ else {
+
+ /*
+ * The device has been DISCONNECTED.
+ */
+
+ console_log("USB: Device disconnected from bus %d hub %d port %d",
+ dev->ud_bus->ub_num,
+ dev->ud_address,idx+1);
+
+ /*
+ * Recover pointer to device below hub and clear
+ * this pointer.
+ */
+
+ newdev = softc->uhub_devices[idx]; /* Get device pointer */
+ softc->uhub_devices[idx] = NULL; /* remove device from hub */
+
+ /*
+ * Deassign the USB device's address and then
+ * call detach method to free resources. Devices that
+ * do not have drivers will not have any methods.
+ */
+
+ if (newdev) {
+ if (newdev->ud_drv) {
+ (*(newdev->ud_drv->udrv_detach))(newdev);
+ }
+ else {
+ if (usb_noisy > 0) {
+ console_log("USB: Detached device on bus %d hub %d port %d "
+ "has no methods",
+ dev->ud_bus->ub_num,
+ dev->ud_address,idx+1);
+ }
+ }
+
+ if (newdev->ud_cfgdescr) KFREE(newdev->ud_cfgdescr);
+
+ usb_destroy_device(newdev);
+ }
+
+ }
+ }
+
+ }
+
+
+ /*
+ * Queue up a request for the interrupt pipe. This will catch further
+ * changes at this port.
+ */
+
+ usbhub_queue_intreq(dev,softc);
+
+}
+
+/* *********************************************************************
+ * usbhub_scan1(dev,arg)
+ *
+ * Scan one device at this level, or descend if we run into a hub
+ * This is part of the device discovery code.
+ *
+ * Input parameters:
+ * dev - current device, maybe a hub
+ * arg - passed from main scan routine
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+
+static int usbhub_scan1(usbdev_t *dev,void *arg)
+{
+ usbhub_softc_t *hub;
+
+ /*
+ * If the device is not a hub, we've reached the leaves of the
+ * tree.
+ */
+
+ if (!IS_HUB(dev)) return 0;
+
+ /*
+ * Otherwise, scan the ports on this hub.
+ */
+
+ hub = dev->ud_private;
+
+ if (hub->uhub_flags & UHUB_FLG_NEEDSCAN) {
+ hub->uhub_flags &= ~UHUB_FLG_NEEDSCAN;
+ usbhub_scan_ports(dev,arg);
+ }
+
+ return 0;
+}
+
+/* *********************************************************************
+ * usb_scan(bus)
+ *
+ * Scan the bus looking for new or removed devices
+ *
+ * Input parameters:
+ * bus - bus to scan
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+void usb_scan(usbbus_t *bus)
+{
+ /*
+ * Call our tree walker with the scan function.
+ */
+
+ usbhub_map_tree(bus,usbhub_scan1,NULL);
+}
+
+
+
+
diff --git a/cfe/cfe/usb/usbmain.c b/cfe/cfe/usb/usbmain.c
new file mode 100644
index 0000000..c39a7f6
--- /dev/null
+++ b/cfe/cfe/usb/usbmain.c
@@ -0,0 +1,367 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Main Module File: usbmain.c
+ *
+ * Main module that invokes the top of the USB stack from CFE.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+#include "lib_queue.h"
+#include "lib_physio.h"
+
+#include "cfe_timer.h"
+#include "ui_command.h"
+
+#if CFG_PCI
+#include "pcireg.h"
+#include "pcivar.h"
+#endif
+
+#include "usbchap9.h"
+#include "usbd.h"
+
+#include "bsp_config.h"
+
+
+/* *********************************************************************
+ * Externs
+ ********************************************************************* */
+
+extern usb_hcdrv_t ohci_driver; /* OHCI Driver dispatch */
+
+extern int ohcidebug; /* OHCI debug control */
+extern int usb_noisy; /* USBD debug control */
+
+int usb_init(void); /* forward */
+int ui_init_usbcmds(void); /* forward */
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+/*
+ * We keep track of the pointers to USB buses in globals.
+ * One entry in this array per USB bus (the Opti controller
+ * on the SWARM has two functions, so it's two buses)
+ */
+
+#define USB_MAX_BUS 4
+int usb_buscnt = 0;
+usbbus_t *usb_buses[USB_MAX_BUS];
+
+
+/* *********************************************************************
+ * usb_cfe_timer(arg)
+ *
+ * This routine is called periodically by CFE's timer routines
+ * to give the USB subsystem some time. Basically we scan
+ * for work to do to manage configuration updates, and handle
+ * interrupts from the USB controllers.
+ *
+ * Input parameters:
+ * arg - value we passed when the timer was initialized
+ * (not used)
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void usb_cfe_timer(void *arg)
+{
+ int idx;
+ static int in_poll = 0;
+
+ /*
+ * We sometimes call the timer routines in here, which calls
+ * the polling loop. This code is not reentrant, so
+ * prevent us from running the interrupt routine or
+ * bus daemon while we are already in there.
+ */
+
+ if (in_poll) return;
+
+ /*
+ * Do not allow nested "interrupts."
+ */
+
+ in_poll = 1;
+
+ for (idx = 0; idx < usb_buscnt; idx++) {
+ if (usb_buses[idx]) {
+ usb_poll(usb_buses[idx]);
+ usb_daemon(usb_buses[idx]);
+ }
+ }
+
+ /*
+ * Okay to call polling again.
+ */
+
+ in_poll = 0;
+}
+
+
+/* *********************************************************************
+ * usb_init_one_ohci(addr)
+ *
+ * Initialize one USB controller.
+ *
+ * Input parameters:
+ * addr - physical address of OHCI registers
+ *
+ * Return value:
+ * 0 if ok
+ * else error
+ ********************************************************************* */
+static int usb_init_one_ohci(uint32_t addr)
+{
+ usbbus_t *bus;
+ int res;
+
+ bus = UBCREATE(&ohci_driver, addr);
+
+ if (bus == NULL) {
+ printf("USB: Could not create OHCI driver structure for controller at 0x%08X\n",addr);
+ return -1;
+ }
+
+ bus->ub_num = usb_buscnt;
+
+ res = UBSTART(bus);
+
+ if (res != 0) {
+ printf("USB: Could not init OHCI controller at 0x%08X\n",addr);
+ UBSTOP(bus);
+ return -1;
+ }
+ else {
+ usb_buses[usb_buscnt++] = bus;
+ usb_initroot(bus);
+ }
+
+ return 0;
+}
+
+#if CFG_PCI
+/* *********************************************************************
+ * usb_init_pci_ohci()
+ *
+ * Initialize all PCI-based OHCI controllers
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * 0 if ok
+ * else error
+ ********************************************************************* */
+static int usb_init_pci_ohci(void)
+{
+ int res;
+ pcitag_t tag;
+ uint32_t pciclass;
+ physaddr_t bar;
+ int idx;
+
+ idx = 0;
+
+ while (pci_find_class(PCI_CLASS_SERIALBUS,idx,&tag) == 0) {
+ pciclass = pci_conf_read(tag,PCI_CLASS_REG);
+ if ((PCI_SUBCLASS(pciclass) == PCI_SUBCLASS_SERIALBUS_USB) &&
+ (PCI_INTERFACE(pciclass) == 0x10)) {
+ bar = (physaddr_t) pci_conf_read(tag,PCI_MAPREG_START);
+ pci_tagprintf(tag,"OHCI USB controller found at %08X\n",(uint32_t) bar);
+
+ /* On the BCM1250, this sets the address to "match bits" mode,
+ which eliminates the need for byte swaps of data to/from the registers. */
+ bar |= 0x20000000;
+
+ res = usb_init_one_ohci(bar);
+ if (res < 0) break;
+ }
+ idx++;
+ }
+
+ return 0;
+}
+#endif
+
+
+
+/* *********************************************************************
+ * usb_init()
+ *
+ * Initialize the USB subsystem
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+int usb_init(void)
+{
+ static int initdone = 0;
+
+ if (initdone) {
+ printf("USB has already been initialized.\n");
+ return -1;
+ }
+
+ printf("Initializing USB.\n");
+
+ initdone = 1;
+
+ usb_buscnt = 0;
+
+#if CFG_PCI
+ usb_init_pci_ohci();
+#endif
+
+#if CFG_USB_OHCI_BASE
+ usb_init_one_ohci(CFG_USB_OHCI_BASE);
+#endif
+
+ cfe_bg_add(usb_cfe_timer,NULL);
+
+ return 0;
+}
+
+
+
+static int ui_cmd_usb_start(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int res = 0;
+
+ if (cmd_sw_isset(cmd,"-o")) ohcidebug++;
+ if (cmd_sw_isset(cmd,"-oo")) ohcidebug+=2;
+ if (cmd_sw_isset(cmd,"-u")) usb_noisy++;
+ if (cmd_sw_isset(cmd,"-uu")) usb_noisy+=2;
+
+ if (usb_buscnt == 0) {
+ res = usb_init();
+ }
+
+ return res;
+}
+
+
+static int ui_cmd_usb_show(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int busnum;
+ int devnum;
+ char *x;
+ int idx;
+ uint32_t arg;
+
+ x = cmd_getarg(cmd,1);
+ if (!x) devnum = 0;
+ else devnum = atoi(x);
+
+ x = cmd_getarg(cmd,0);
+ if (!x) x = "*";
+ busnum = atoi(x);
+
+ if (busnum >= usb_buscnt) {
+ printf("Invalid bus number, %d USB Buses currently configured.\n",usb_buscnt);
+ return -1;
+ }
+
+ arg = cmd_sw_isset(cmd,"-v") ? 0x100 : 0;
+ arg |= (devnum & 0xFF);
+
+ if (x[0] == '*') {
+ for (idx = 0; idx < usb_buscnt; idx++) {
+ usbhub_dumpbus(usb_buses[idx],arg);
+ }
+ }
+ else {
+ usbhub_dumpbus(usb_buses[busnum],arg);
+ }
+
+ return 0;
+
+}
+
+/* *********************************************************************
+ * ui_init_usbcmds(void)
+ *
+ * Initialize the USB commands
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+int ui_init_usbcmds(void)
+{
+ cmd_addcmd("usb init",
+ ui_cmd_usb_start,
+ NULL,
+ "Initialize the USB controller.",
+ "usb init",
+ "-o;OHCI debug messages|"
+ "-oo;more OHCI debug messages|"
+ "-u;USBD debug messages|"
+ "-uu;more USBD debug messages");
+
+
+ cmd_addcmd("show usb",
+ ui_cmd_usb_show,
+ NULL,
+ "Display devices connected to USB bus.",
+ "usb show [bus [device]]\n\n"
+ "Displays the configuration descriptors for devices connected to the USB\n"
+ "If you specify a bus, the entire bus is displayed. If you specify the\n"
+ "device number as well, only the specified device is displayed\n",
+ "-v;Display descriptors from the devices");
+
+ return 0;
+}
diff --git a/cfe/cfe/usb/usbmass.c b/cfe/cfe/usb/usbmass.c
new file mode 100644
index 0000000..ae3856d
--- /dev/null
+++ b/cfe/cfe/usb/usbmass.c
@@ -0,0 +1,1199 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * USB Mass-Storage driver File: usbmass.c
+ *
+ * This driver deals with mass-storage devices that support
+ * the SCSI Transparent command set and USB Bulk-Only protocol
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#ifndef _CFE_
+#include <stdio.h>
+#include <time.h>
+#include <memory.h>
+#include <stdint.h>
+#include "usbhack.h"
+#else
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+#include "cfe_timer.h"
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_ioctl.h"
+#include "cfe_error.h"
+#include "cfe_console.h"
+#endif
+
+#include "lib_malloc.h"
+#include "lib_queue.h"
+#include "usbchap9.h"
+#include "usbd.h"
+
+/* *********************************************************************
+ * USB Mass-Storage class Constants
+ ********************************************************************* */
+
+#define USBMASS_CBI_PROTOCOL 0
+#define USBMASS_CBI_NOCOMPLETE_PROTOCOL 1
+#define USBMASS_BULKONLY_PROTOCOL 0x50
+
+#define USBMASS_SUBCLASS_RBC 0x01
+#define USBMASS_SUBCLASS_SFF8020 0x02
+#define USBMASS_SUBCLASS_QIC157 0x03
+#define USBMASS_SUBCLASS_UFI 0x04
+#define USBMASS_SUBCLASS_SFF8070 0x05
+#define USBMASS_SUBCLASS_SCSI 0x06
+
+#define USBMASS_CSW_PASS 0x00
+#define USBMASS_CSW_FAILED 0x01
+#define USBMASS_CSW_PHASEERR 0x02
+
+#define USBMASS_CBW_SIGNATURE 0x43425355
+#define USBMASS_CSW_SIGNATURE 0x53425355
+
+/* *********************************************************************
+ * USB Mass-Storage class Structures
+ ********************************************************************* */
+
+typedef struct usbmass_cbw_s {
+ uint8_t dCBWSignature0,dCBWSignature1,dCBWSignature2,dCBWSignature3;
+ uint8_t dCBWTag0,dCBWTag1,dCBWTag2,dCBWTag3;
+ uint8_t dCBWDataTransferLength0,dCBWDataTransferLength1,
+ dCBWDataTransferLength2,dCBWDataTransferLength3;
+ uint8_t bmCBWFlags;
+ uint8_t bCBWLUN;
+ uint8_t bCBWCBLength;
+ uint8_t CBWCB[16];
+} usbmass_cbw_t;
+
+typedef struct usbmass_csw_s {
+ uint8_t dCSWSignature0,dCSWSignature1,dCSWSignature2,dCSWSignature3;
+ uint8_t dCSWTag0,dCSWTag1,dCSWTag2,dCSWTag3;
+ uint8_t dCSWDataResidue0,dCSWDataResidue1,dCSWDataResidue2,dCSWDataResidue3;
+ uint8_t bCSWStatus;
+} usbmass_csw_t;
+
+#define GETCBWFIELD(s,f) ((uint32_t)((s)->f##0) | ((uint32_t)((s)->f##1) << 8) | \
+ ((uint32_t)((s)->f##2) << 16) | ((uint32_t)((s)->f##3) << 24))
+#define PUTCBWFIELD(s,f,v) (s)->f##0 = (v & 0xFF); \
+ (s)->f##1 = ((v)>>8 & 0xFF); \
+ (s)->f##2 = ((v)>>16 & 0xFF); \
+ (s)->f##3 = ((v)>>24 & 0xFF);
+
+
+int usbmass_request_sense(usbdev_t *dev);
+
+/* *********************************************************************
+ * Linkage to CFE
+ ********************************************************************* */
+
+#ifdef _CFE_
+
+/*
+ * Softc for the CFE side of the disk driver.
+ */
+#define MAX_SECTORSIZE 2048
+typedef struct usbdisk_s {
+ uint32_t usbdisk_sectorsize;
+ uint32_t usbdisk_ttlsect;
+ uint32_t usbdisk_devtype;
+ int usbdisk_unit;
+} usbdisk_t;
+
+/*
+ * This table points at the currently configured USB disk
+ * devices. This lets us leave the CFE half of the driver lying
+ * around while the USB devices come and go. We use the unit number
+ * from the original CFE attach to index this table, and devices
+ * that are not present are "not ready."
+ */
+
+#define USBDISK_MAXUNITS 4
+static usbdev_t *usbdisk_units[USBDISK_MAXUNITS];
+
+/*
+ * CFE device driver routine forwards
+ */
+
+static void usbdisk_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+static int usbdisk_open(cfe_devctx_t *ctx);
+static int usbdisk_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int usbdisk_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat);
+static int usbdisk_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int usbdisk_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int usbdisk_close(cfe_devctx_t *ctx);
+
+/*
+ * CFE device driver descriptor
+ */
+
+const static cfe_devdisp_t usbdisk_dispatch = {
+ usbdisk_open,
+ usbdisk_read,
+ usbdisk_inpstat,
+ usbdisk_write,
+ usbdisk_ioctl,
+ usbdisk_close,
+ NULL,
+ NULL
+};
+
+const cfe_driver_t usb_disk = {
+ "USB Disk",
+ "usbdisk",
+ CFE_DEV_DISK,
+ &usbdisk_dispatch,
+ usbdisk_probe
+};
+
+
+#endif
+
+
+
+/* *********************************************************************
+ * Forward Definitions
+ ********************************************************************* */
+
+static int usbmass_attach(usbdev_t *dev,usb_driver_t *drv);
+static int usbmass_detach(usbdev_t *dev);
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+typedef struct usbmass_softc_s {
+ int umass_inpipe;
+ int umass_outpipe;
+ int umass_devtype;
+ uint32_t umass_curtag;
+ int umass_unit;
+} usbmass_softc_t;
+
+usb_driver_t usbmass_driver = {
+ "Mass-Storage Device",
+ usbmass_attach,
+ usbmass_detach
+};
+
+usbdev_t *usbmass_dev = NULL; /* XX hack for testing only */
+
+/* *********************************************************************
+ * usbmass_mass_storage_reset(dev,ifc)
+ *
+ * Do a bulk-only mass-storage reset.
+ *
+ * Input parameters:
+ * dev - device to reset
+ * ifc - interface number to reset (bInterfaceNum)
+ *
+ * Return value:
+ * status
+ ********************************************************************* */
+
+#define usbmass_mass_storage_reset(dev,ifc) \
+ usb_simple_request(dev,0x21,0xFF,ifc,0)
+
+#if 0
+/* *********************************************************************
+ * usbmass_get_max_lun(dev,lunp)
+ *
+ * Get maximum LUN from device
+ *
+ * Input parameters:
+ * dev - device to reset
+ * lunp - pointer to int to receive max lun
+ *
+ * Return value:
+ * status
+ ********************************************************************* */
+
+static int usbmass_get_max_lun(usbdev_t *dev,int *lunp)
+{
+ uint8_t buf = 0;
+ int res;
+
+ res = usb_std_request(dev,0xA1,0xFE,0,0,&buf,1);
+
+ if (res < 0) return res;
+
+ if (lunp) *lunp = (int) buf;
+ return 0;
+}
+
+#endif
+
+
+/* *********************************************************************
+ * usbmass_stall_recovery(dev)
+ *
+ * Do whatever it takes to unstick a stalled mass-storage device.
+ *
+ * Input parameters:
+ * dev - usb device
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void usbmass_stall_recovery(usbdev_t *dev)
+{
+ usbmass_softc_t *softc;
+
+ softc = (usbmass_softc_t *) dev->ud_private;
+
+ usb_clear_stall(dev,softc->umass_inpipe);
+
+ usbmass_request_sense(dev);
+}
+
+
+/* *********************************************************************
+ * usbmass_read_capacity(dev,sectornum,buffer)
+ *
+ * Reads a sector from the device.
+ *
+ * Input parameters:
+ * dev - usb device
+ * sectornum - sector number to read
+ * buffer - place to put sector we read
+ *
+ * Return value:
+ * status
+ ********************************************************************* */
+
+int usbmass_request_sense(usbdev_t *dev)
+{
+ uint8_t *cbwcsw;
+ uint8_t *sector;
+ usbmass_cbw_t *cbw;
+ usbmass_csw_t *csw;
+ usbreq_t *ur;
+ usbmass_softc_t *softc;
+ int res;
+
+ softc = (usbmass_softc_t *) dev->ud_private;
+
+ cbwcsw = KMALLOC(64,32);
+ sector = KMALLOC(64,32);
+
+ memset(sector,0,64);
+
+ cbw = (usbmass_cbw_t *) cbwcsw;
+ csw = (usbmass_csw_t *) cbwcsw;
+
+ /*
+ * Fill in the fields of the CBW
+ */
+
+ PUTCBWFIELD(cbw,dCBWSignature,USBMASS_CBW_SIGNATURE);
+ PUTCBWFIELD(cbw,dCBWTag,softc->umass_curtag);
+ PUTCBWFIELD(cbw,dCBWDataTransferLength,18);
+ cbw->bmCBWFlags = 0x80; /* IN */
+ cbw->bCBWLUN = 0;
+ cbw->bCBWCBLength = 12;
+ cbw->CBWCB[0] = 0x3; /* REQUEST SENSE */
+ cbw->CBWCB[1] = 0;
+ cbw->CBWCB[2] = 0;
+ cbw->CBWCB[3] = 0;
+ cbw->CBWCB[4] = 18; /* allocation length */
+ cbw->CBWCB[5] = 0;
+ cbw->CBWCB[6] = 0;
+ cbw->CBWCB[7] = 0;
+ cbw->CBWCB[8] = 0;
+ cbw->CBWCB[9] = 0;
+
+ softc->umass_curtag++;
+
+ /*
+ * Send the CBW
+ */
+
+ ur = usb_make_request(dev,softc->umass_outpipe,(uint8_t *) cbw,
+ sizeof(usbmass_cbw_t),UR_FLAG_OUT);
+ res = usb_sync_request(ur);
+ usb_free_request(ur);
+
+ /*
+ * Get the data
+ */
+
+ memset(sector,0,18);
+ ur = usb_make_request(dev,softc->umass_inpipe,sector,
+ 18,UR_FLAG_IN | UR_FLAG_SHORTOK);
+ res = usb_sync_request(ur);
+ usb_free_request(ur);
+
+ /*
+ * Get the Status
+ */
+
+ memset(csw,0,sizeof(usbmass_csw_t));
+ ur = usb_make_request(dev,softc->umass_inpipe,(uint8_t *) csw,
+ sizeof(usbmass_csw_t),UR_FLAG_IN);
+ res = usb_sync_request(ur);
+ usb_free_request(ur);
+
+ KFREE(cbwcsw);
+
+ KFREE(sector);
+
+ return 0;
+
+}
+
+/* *********************************************************************
+ * usbmass_read_sector(dev,sectornum,seccnt,buffer)
+ *
+ * Reads a sector from the device.
+ *
+ * Input parameters:
+ * dev - usb device
+ * sectornum - sector number to read
+ * seccnt - count of sectors to read
+ * buffer - place to put sector we read
+ *
+ * Return value:
+ * status
+ ********************************************************************* */
+
+int usbmass_read_sector(usbdev_t *dev,uint32_t sectornum,uint32_t seccnt,
+ uint8_t *buffer);
+int usbmass_read_sector(usbdev_t *dev,uint32_t sectornum,uint32_t seccnt,
+ uint8_t *buffer)
+{
+ uint8_t *cbwcsw;
+ uint8_t *sector;
+ usbmass_cbw_t *cbw;
+ usbmass_csw_t *csw;
+ usbreq_t *ur;
+ usbmass_softc_t *softc;
+ int res;
+
+ softc = (usbmass_softc_t *) dev->ud_private;
+
+ cbwcsw = KMALLOC(64,32);
+ sector = buffer;
+
+ cbw = (usbmass_cbw_t *) cbwcsw;
+ csw = (usbmass_csw_t *) cbwcsw;
+
+ /*
+ * Fill in the fields of the CBW
+ */
+
+ PUTCBWFIELD(cbw,dCBWSignature,USBMASS_CBW_SIGNATURE);
+ PUTCBWFIELD(cbw,dCBWTag,softc->umass_curtag);
+ PUTCBWFIELD(cbw,dCBWDataTransferLength,(512*seccnt));
+ cbw->bmCBWFlags = 0x80; /* IN */
+ cbw->bCBWLUN = 0;
+ cbw->bCBWCBLength = 10;
+ cbw->CBWCB[0] = 0x28; /* READ */
+ cbw->CBWCB[1] = 0;
+ cbw->CBWCB[2] = (sectornum >> 24) & 0xFF; /* LUN 0 & MSB's of sector */
+ cbw->CBWCB[3] = (sectornum >> 16) & 0xFF;
+ cbw->CBWCB[4] = (sectornum >> 8) & 0xFF;
+ cbw->CBWCB[5] = (sectornum >> 0) & 0xFF;
+ cbw->CBWCB[6] = 0;
+ cbw->CBWCB[7] = 0;
+ cbw->CBWCB[8] = seccnt;
+ cbw->CBWCB[9] = 0;
+
+ softc->umass_curtag++;
+
+ /*
+ * Send the CBW
+ */
+
+ ur = usb_make_request(dev,softc->umass_outpipe,(uint8_t *) cbw,
+ sizeof(usbmass_cbw_t),UR_FLAG_OUT);
+ res = usb_sync_request(ur);
+ usb_free_request(ur);
+ if (res == 4) {
+ usbmass_stall_recovery(dev);
+ KFREE(cbwcsw);
+ return -1;
+ }
+
+
+ /*
+ * Get the data
+ */
+
+ ur = usb_make_request(dev,softc->umass_inpipe,sector,
+ 512*seccnt,UR_FLAG_IN | UR_FLAG_SHORTOK);
+ res = usb_sync_request(ur);
+ usb_free_request(ur);
+ if (res == 4) {
+ usbmass_stall_recovery(dev);
+ KFREE(cbwcsw);
+ return -1;
+ }
+
+
+ /*
+ * Get the Status
+ */
+
+ memset(csw,0,sizeof(usbmass_csw_t));
+ ur = usb_make_request(dev,softc->umass_inpipe,(uint8_t *) csw,
+ sizeof(usbmass_csw_t),UR_FLAG_IN);
+ res = usb_sync_request(ur);
+ usb_free_request(ur);
+ if (res == 4) {
+ usbmass_stall_recovery(dev);
+ KFREE(cbwcsw);
+ return -1;
+ }
+
+
+#if 0
+ printf("CSW: Signature=%08X Tag=%08X Residue=%08X Status=%02X\n",
+ GETCBWFIELD(csw,dCSWSignature),
+ GETCBWFIELD(csw,dCSWTag),
+ GETCBWFIELD(csw,dCSWDataResidue),
+ csw->bCSWStatus);
+#endif
+
+ res = (csw->bCSWStatus == USBMASS_CSW_PASS) ? 0 : -1;
+
+ KFREE(cbwcsw);
+
+ return res;
+
+}
+
+/* *********************************************************************
+ * usbmass_write_sector(dev,sectornum,seccnt,buffer)
+ *
+ * Writes a sector to the device
+ *
+ * Input parameters:
+ * dev - usb device
+ * sectornum - sector number to write
+ * seccnt - count of sectors to write
+ * buffer - place to get sector to write
+ *
+ * Return value:
+ * status
+ ********************************************************************* */
+
+static int usbmass_write_sector(usbdev_t *dev,uint32_t sectornum,uint32_t seccnt,
+ uint8_t *buffer)
+{
+ uint8_t *cbwcsw;
+ uint8_t *sector;
+ usbmass_cbw_t *cbw;
+ usbmass_csw_t *csw;
+ usbreq_t *ur;
+ usbmass_softc_t *softc;
+ int res;
+
+ softc = (usbmass_softc_t *) dev->ud_private;
+
+ cbwcsw = KMALLOC(64,32);
+ sector = buffer;
+
+ cbw = (usbmass_cbw_t *) cbwcsw;
+ csw = (usbmass_csw_t *) cbwcsw;
+
+ /*
+ * Fill in the fields of the CBW
+ */
+
+ PUTCBWFIELD(cbw,dCBWSignature,USBMASS_CBW_SIGNATURE);
+ PUTCBWFIELD(cbw,dCBWTag,softc->umass_curtag);
+ PUTCBWFIELD(cbw,dCBWDataTransferLength,(512*seccnt));
+ cbw->bmCBWFlags = 0x00; /* OUT */
+ cbw->bCBWLUN = 0;
+ cbw->bCBWCBLength = 10;
+ cbw->CBWCB[0] = 0x2A; /* WRITE */
+ cbw->CBWCB[1] = 0;
+ cbw->CBWCB[2] = (sectornum >> 24) & 0xFF; /* LUN 0 & MSB's of sector */
+ cbw->CBWCB[3] = (sectornum >> 16) & 0xFF;
+ cbw->CBWCB[4] = (sectornum >> 8) & 0xFF;
+ cbw->CBWCB[5] = (sectornum >> 0) & 0xFF;
+ cbw->CBWCB[6] = 0;
+ cbw->CBWCB[7] = 0;
+ cbw->CBWCB[8] = seccnt;
+ cbw->CBWCB[9] = 0;
+
+ softc->umass_curtag++;
+
+ /*
+ * Send the CBW
+ */
+
+ ur = usb_make_request(dev,softc->umass_outpipe,(uint8_t *) cbw,
+ sizeof(usbmass_cbw_t),UR_FLAG_OUT);
+ res = usb_sync_request(ur);
+ usb_free_request(ur);
+
+ /*
+ * Send the data
+ */
+
+ ur = usb_make_request(dev,softc->umass_outpipe,sector,
+ 512*seccnt,UR_FLAG_OUT);
+ res = usb_sync_request(ur);
+ usb_free_request(ur);
+
+ /*
+ * Get the Status
+ */
+
+ memset(csw,0,sizeof(usbmass_csw_t));
+ ur = usb_make_request(dev,softc->umass_inpipe,(uint8_t *) csw,
+ sizeof(usbmass_csw_t),UR_FLAG_IN);
+ res = usb_sync_request(ur);
+ usb_free_request(ur);
+
+#if 0
+ printf("CSW: Signature=%08X Tag=%08X Residue=%08X Status=%02X\n",
+ GETCBWFIELD(csw,dCSWSignature),
+ GETCBWFIELD(csw,dCSWTag),
+ GETCBWFIELD(csw,dCSWDataResidue),
+ csw->bCSWStatus);
+#endif
+
+ res = (csw->bCSWStatus == USBMASS_CSW_PASS) ? 0 : -1;
+
+ KFREE(cbwcsw);
+
+ return res;
+}
+
+/* *********************************************************************
+ * usbmass_read_capacity(dev,sectornum,buffer)
+ *
+ * Reads a sector from the device.
+ *
+ * Input parameters:
+ * dev - usb device
+ * sectornum - sector number to read
+ * buffer - place to put sector we read
+ *
+ * Return value:
+ * status
+ ********************************************************************* */
+
+int usbmass_read_capacity(usbdev_t *dev,uint32_t *size);
+int usbmass_read_capacity(usbdev_t *dev,uint32_t *size)
+{
+ uint8_t *cbwcsw;
+ uint8_t *sector;
+ usbmass_cbw_t *cbw;
+ usbmass_csw_t *csw;
+ usbreq_t *ur;
+ usbmass_softc_t *softc;
+ int res;
+
+ softc = (usbmass_softc_t *) dev->ud_private;
+
+ cbwcsw = KMALLOC(64,32);
+ sector = KMALLOC(64,32);
+
+ memset(sector,0,64);
+
+ cbw = (usbmass_cbw_t *) cbwcsw;
+ csw = (usbmass_csw_t *) cbwcsw;
+
+ *size = 0;
+
+ /*
+ * Fill in the fields of the CBW
+ */
+
+ PUTCBWFIELD(cbw,dCBWSignature,USBMASS_CBW_SIGNATURE);
+ PUTCBWFIELD(cbw,dCBWTag,softc->umass_curtag);
+ PUTCBWFIELD(cbw,dCBWDataTransferLength,8);
+ cbw->bmCBWFlags = 0x80; /* IN */
+ cbw->bCBWLUN = 0;
+ cbw->bCBWCBLength = 10;
+ cbw->CBWCB[0] = 0x25; /* READ CAPACITY */
+ cbw->CBWCB[1] = 0;
+ cbw->CBWCB[2] = 0;
+ cbw->CBWCB[3] = 0;
+ cbw->CBWCB[4] = 0;
+ cbw->CBWCB[5] = 0;
+ cbw->CBWCB[6] = 0;
+ cbw->CBWCB[7] = 0;
+ cbw->CBWCB[8] = 0;
+ cbw->CBWCB[9] = 0;
+
+ softc->umass_curtag++;
+
+ /*
+ * Send the CBW
+ */
+
+ ur = usb_make_request(dev,softc->umass_outpipe,(uint8_t *) cbw,
+ sizeof(usbmass_cbw_t),UR_FLAG_OUT);
+ res = usb_sync_request(ur);
+ usb_free_request(ur);
+
+ if (res == 4) {
+ usbmass_stall_recovery(dev);
+ KFREE(cbwcsw);
+ KFREE(sector);
+ return -1;
+ }
+
+ /*
+ * Get the data
+ */
+
+ ur = usb_make_request(dev,softc->umass_inpipe,sector,
+ 8,UR_FLAG_IN | UR_FLAG_SHORTOK);
+ res = usb_sync_request(ur);
+ usb_free_request(ur);
+
+ if (res == 4) {
+ usbmass_stall_recovery(dev);
+ KFREE(cbwcsw);
+ KFREE(sector);
+ return -1;
+ }
+
+ /*
+ * Get the Status
+ */
+
+ memset(csw,0,sizeof(usbmass_csw_t));
+ ur = usb_make_request(dev,softc->umass_inpipe,(uint8_t *) csw,
+ sizeof(usbmass_csw_t),UR_FLAG_IN);
+ res = usb_sync_request(ur);
+ usb_free_request(ur);
+
+ KFREE(cbwcsw);
+
+ *size = (((uint32_t) sector[0]) << 24) |
+ (((uint32_t) sector[1]) << 16) |
+ (((uint32_t) sector[2]) << 8) |
+ (((uint32_t) sector[3]) << 0);
+
+ KFREE(sector);
+
+ return 0;
+
+}
+
+
+
+/* *********************************************************************
+ * usbmass_attach(dev,drv)
+ *
+ * This routine is called when the bus scan stuff finds a mass-storage
+ * device. We finish up the initialization by configuring the
+ * device and allocating our softc here.
+ *
+ * Input parameters:
+ * dev - usb device, in the "addressed" state.
+ * drv - the driver table entry that matched
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+static int usbmass_attach(usbdev_t *dev,usb_driver_t *drv)
+{
+ usb_config_descr_t *cfgdscr = dev->ud_cfgdescr;
+ usb_endpoint_descr_t *epdscr;
+ usb_endpoint_descr_t *indscr = NULL;
+ usb_endpoint_descr_t *outdscr = NULL;
+ usb_interface_descr_t *ifdscr;
+ usbmass_softc_t *softc;
+ int idx;
+
+ dev->ud_drv = drv;
+
+ softc = KMALLOC(sizeof(usbmass_softc_t),0);
+ memset(softc,0,sizeof(usbmass_softc_t));
+ dev->ud_private = softc;
+
+ ifdscr = usb_find_cfg_descr(dev,USB_INTERFACE_DESCRIPTOR_TYPE,0);
+ if (ifdscr == NULL) {
+ return -1;
+ }
+
+ if ((ifdscr->bInterfaceSubClass != USBMASS_SUBCLASS_SCSI) ||
+ (ifdscr->bInterfaceProtocol != USBMASS_BULKONLY_PROTOCOL)) {
+ console_log("USBMASS: Do not understand devices with SubClass 0x%02X, Protocol 0x%02X",
+ ifdscr->bInterfaceSubClass,
+ ifdscr->bInterfaceProtocol);
+ return -1;
+ }
+
+ for (idx = 0; idx < 2; idx++) {
+ epdscr = usb_find_cfg_descr(dev,USB_ENDPOINT_DESCRIPTOR_TYPE,idx);
+
+ if (USB_ENDPOINT_DIR_OUT(epdscr->bEndpointAddress)) {
+ outdscr = epdscr;
+ }
+ else {
+ indscr = epdscr;
+ }
+ }
+
+
+ if (!indscr || !outdscr) {
+ /*
+ * Could not get descriptors, something is very wrong.
+ * Leave device addressed but not configured.
+ */
+ return -1;
+ }
+
+ /*
+ * Choose the standard configuration.
+ */
+
+ usb_set_configuration(dev,cfgdscr->bConfigurationValue);
+
+ /*
+ * Open the pipes.
+ */
+
+ softc->umass_inpipe = usb_open_pipe(dev,indscr);
+ softc->umass_outpipe = usb_open_pipe(dev,outdscr);
+ softc->umass_curtag = 0x12345678;
+
+ /*
+ * Save pointer in global unit table so we can
+ * match CFE devices up with USB ones
+ */
+
+
+#ifdef _CFE_
+ softc->umass_unit = -1;
+ for (idx = 0; idx < USBDISK_MAXUNITS; idx++) {
+ if (usbdisk_units[idx] == NULL) {
+ softc->umass_unit = idx;
+ usbdisk_units[idx] = dev;
+ break;
+ }
+ }
+
+ console_log("USBMASS: Unit %d connected",softc->umass_unit);
+#endif
+
+ usbmass_dev = dev;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * usbmass_detach(dev)
+ *
+ * This routine is called when the bus scanner notices that
+ * this device has been removed from the system. We should
+ * do any cleanup that is required. The pending requests
+ * will be cancelled automagically.
+ *
+ * Input parameters:
+ * dev - usb device
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+static int usbmass_detach(usbdev_t *dev)
+{
+ usbmass_softc_t *softc;
+ softc = (usbmass_softc_t *) dev->ud_private;
+
+#ifdef _CFE_
+ console_log("USBMASS: USB unit %d disconnected",softc->umass_unit);
+ if (softc->umass_unit >= 0) usbdisk_units[softc->umass_unit] = NULL;
+#endif
+
+ KFREE(softc);
+ return 0;
+}
+
+
+
+#ifdef _CFE_
+
+
+/* *********************************************************************
+ * usbdisk_sectorshift(size)
+ *
+ * Given a sector size, return log2(size). We cheat; this is
+ * only needed for 2048 and 512-byte sectors.
+ * Explicitly using shifts and masks in sector number calculations
+ * helps on 32-bit-only platforms, since we probably won't need
+ * a helper library.
+ *
+ * Input parameters:
+ * size - sector size
+ *
+ * Return value:
+ * # of bits to shift
+ ********************************************************************* */
+
+#define usbdisk_sectorshift(size) (((size)==2048)?11:9)
+
+
+/* *********************************************************************
+ * usbdisk_probe(drv,probe_a,probe_b,probe_ptr)
+ *
+ * Our probe routine. Attach an empty USB disk device to the firmware.
+ *
+ * Input parameters:
+ * drv - driver structure
+ * probe_a - not used
+ * probe_b - not used
+ * probe_ptr - not used
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static void usbdisk_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr)
+{
+ usbdisk_t *softc;
+ char descr[128];
+
+ softc = (usbdisk_t *) KMALLOC(sizeof(usbdisk_t),0);
+
+ memset(softc,0,sizeof(usbdisk_t));
+
+ softc->usbdisk_sectorsize = 512;
+ softc->usbdisk_devtype = BLOCK_DEVTYPE_DISK;
+ softc->usbdisk_ttlsect = 0; /* not calculated yet */
+ softc->usbdisk_unit = (int)probe_a;
+
+ xsprintf(descr,"USB Disk unit %d",(int)probe_a);
+
+ cfe_attach(drv,softc,NULL,descr);
+}
+
+
+/* *********************************************************************
+ * usbdisk_open(ctx)
+ *
+ * Process the CFE OPEN call for this device. For IDE disks,
+ * the device is reset and identified, and the geometry is
+ * determined.
+ *
+ * Input parameters:
+ * ctx - device context
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+
+static int usbdisk_open(cfe_devctx_t *ctx)
+{
+ usbdisk_t *softc = ctx->dev_softc;
+ usbdev_t *dev = usbdisk_units[softc->usbdisk_unit];
+ uint32_t size;
+ int res;
+
+ if (!dev) return CFE_ERR_NOTREADY;
+
+ usbmass_request_sense(dev);
+
+ res = usbmass_read_capacity(dev,&size);
+ if (res < 0) return res;
+
+ softc->usbdisk_ttlsect = size;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * usbdisk_read(ctx,buffer)
+ *
+ * Process a CFE READ command for the IDE device. This is
+ * more complex than it looks, since CFE offsets are byte offsets
+ * and we may need to read partial sectors.
+ *
+ * Input parameters:
+ * ctx - device context
+ * buffer - buffer descriptor
+ *
+ * Return value:
+ * number of bytes read, or <0 if an error occured
+ ********************************************************************* */
+
+static int usbdisk_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ usbdisk_t *softc = ctx->dev_softc;
+ usbdev_t *dev = usbdisk_units[softc->usbdisk_unit];
+ unsigned char *bptr;
+ int blen;
+ int numsec;
+ int res = 0;
+ int amtcopy;
+ uint64_t lba;
+ uint64_t offset;
+ unsigned char sector[MAX_SECTORSIZE];
+ int sectorshift;
+
+ if (!dev) return CFE_ERR_NOTREADY;
+
+ sectorshift = usbdisk_sectorshift(softc->usbdisk_sectorsize);
+
+ bptr = buffer->buf_ptr;
+ blen = buffer->buf_length;
+ offset = buffer->buf_offset;
+ numsec = (blen + softc->usbdisk_sectorsize - 1) >> sectorshift;
+
+ if (offset & (softc->usbdisk_sectorsize-1)) {
+ lba = (offset >> sectorshift);
+ res = usbmass_read_sector(dev,lba,1,sector);
+ if (res < 0) goto out;
+ amtcopy = softc->usbdisk_sectorsize - (offset & (softc->usbdisk_sectorsize-1));
+ if (amtcopy > blen) amtcopy = blen;
+ memcpy(bptr,&sector[offset & (softc->usbdisk_sectorsize-1)],amtcopy);
+ bptr += amtcopy;
+ offset += amtcopy;
+ blen -= amtcopy;
+ }
+
+ if (blen >= softc->usbdisk_sectorsize) {
+ int seccnt;
+
+ lba = (offset >> sectorshift);
+ seccnt = (blen >> sectorshift);
+
+ res = usbmass_read_sector(dev,lba,seccnt,bptr);
+ if (res < 0) goto out;
+
+ amtcopy = seccnt << sectorshift;
+ bptr += amtcopy;
+ offset += amtcopy;
+ blen -= amtcopy;
+ }
+
+ if (blen) {
+ lba = (offset >> sectorshift);
+ res = usbmass_read_sector(dev,lba,1,sector);
+ if (res < 0) goto out;
+ amtcopy = blen;
+ memcpy(bptr,sector,amtcopy);
+ bptr += amtcopy;
+ offset += amtcopy;
+ blen -= amtcopy;
+ }
+
+out:
+ buffer->buf_retlen = bptr - buffer->buf_ptr;
+
+ return res;
+}
+
+/* *********************************************************************
+ * usbdisk_inpstat(ctx,inpstat)
+ *
+ * Test input status for the IDE disk. Disks are always ready
+ * to read.
+ *
+ * Input parameters:
+ * ctx - device context
+ * inpstat - input status structure
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+static int usbdisk_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat)
+{
+ /* usbdisk_t *softc = ctx->dev_softc; */
+
+ inpstat->inp_status = 1;
+ return 0;
+}
+
+/* *********************************************************************
+ * usbdisk_write(ctx,buffer)
+ *
+ * Process a CFE WRITE command for the IDE device. If the write
+ * involves partial sectors, the affected sectors are read first
+ * and the changes are merged in.
+ *
+ * Input parameters:
+ * ctx - device context
+ * buffer - buffer descriptor
+ *
+ * Return value:
+ * number of bytes write, or <0 if an error occured
+ ********************************************************************* */
+
+static int usbdisk_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ usbdisk_t *softc = ctx->dev_softc;
+ usbdev_t *dev = usbdisk_units[softc->usbdisk_unit];
+ unsigned char *bptr;
+ int blen;
+ int numsec;
+ int res = 0;
+ int amtcopy;
+ uint64_t offset;
+ uint64_t lba;
+ unsigned char sector[MAX_SECTORSIZE];
+ int sectorshift;
+
+ if (!dev) return CFE_ERR_NOTREADY;
+
+ sectorshift = usbdisk_sectorshift(softc->usbdisk_sectorsize);
+
+ bptr = buffer->buf_ptr;
+ blen = buffer->buf_length;
+ offset = buffer->buf_offset;
+ numsec = (blen + softc->usbdisk_sectorsize - 1) >> sectorshift;
+
+ if (offset & (softc->usbdisk_sectorsize-1)) {
+ lba = (offset >> sectorshift);
+ res = usbmass_read_sector(dev,lba,1,sector);
+ if (res < 0) goto out;
+ amtcopy = softc->usbdisk_sectorsize - (offset & (softc->usbdisk_sectorsize-1));
+ if (amtcopy > blen) amtcopy = blen;
+ memcpy(&sector[offset & (softc->usbdisk_sectorsize-1)],bptr,amtcopy);
+ res = usbmass_write_sector(dev,lba,1,sector);
+ if (res < 0) goto out;
+ bptr += amtcopy;
+ offset += amtcopy;
+ blen -= amtcopy;
+ }
+
+ while (blen >= softc->usbdisk_sectorsize) {
+ amtcopy = softc->usbdisk_sectorsize;
+ lba = (offset >> sectorshift);
+ res = usbmass_write_sector(dev,lba,1,bptr);
+ if (res < 0) goto out;
+ bptr += amtcopy;
+ offset += amtcopy;
+ blen -= amtcopy;
+ }
+
+ if (blen) {
+ lba = (offset >> sectorshift);
+ res = usbmass_read_sector(dev,lba,1,sector);
+ if (res < 0) goto out;
+ amtcopy = blen;
+ memcpy(sector,bptr,amtcopy);
+ res = usbmass_write_sector(dev,lba,1,sector);
+ if (res < 0) goto out;
+ bptr += amtcopy;
+ offset += amtcopy;
+ blen -= amtcopy;
+ }
+
+out:
+ buffer->buf_retlen = bptr - buffer->buf_ptr;
+
+ return res;
+}
+
+
+/* *********************************************************************
+ * usbdisk_ioctl(ctx,buffer)
+ *
+ * Process device I/O control requests for the IDE device.
+ *
+ * Input parameters:
+ * ctx - device context
+ * buffer - buffer descriptor
+ *
+ * Return value:
+ * 0 if ok
+ * else error code
+ ********************************************************************* */
+
+static int usbdisk_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
+{
+ usbdisk_t *softc = ctx->dev_softc;
+ unsigned int *info = (unsigned int *) buffer->buf_ptr;
+ unsigned long long *linfo = (unsigned long long *) buffer->buf_ptr;
+ blockdev_info_t *devinfo;
+
+ switch ((int)buffer->buf_ioctlcmd) {
+ case IOCTL_BLOCK_GETBLOCKSIZE:
+ *info = softc->usbdisk_sectorsize;
+ break;
+ case IOCTL_BLOCK_GETTOTALBLOCKS:
+ *linfo = softc->usbdisk_ttlsect;
+ break;
+ case IOCTL_BLOCK_GETDEVTYPE:
+ devinfo = (blockdev_info_t *) buffer->buf_ptr;
+ devinfo->blkdev_totalblocks = softc->usbdisk_ttlsect;
+ devinfo->blkdev_blocksize = softc->usbdisk_sectorsize;
+ devinfo->blkdev_devtype = softc->usbdisk_devtype;
+ break;
+ default:
+ return -1;
+ }
+
+ return 0;
+}
+
+/* *********************************************************************
+ * usbdisk_close(ctx)
+ *
+ * Close the I/O device.
+ *
+ * Input parameters:
+ * ctx - device context
+ *
+ * Return value:
+ * 0 if ok, else error code
+ ********************************************************************* */
+
+static int usbdisk_close(cfe_devctx_t *ctx)
+{
+ /* usbdisk_t *softc = ctx->dev_softc; */
+
+ return 0;
+}
+
+
+#endif
diff --git a/cfe/cfe/usb/usbserial.c b/cfe/cfe/usb/usbserial.c
new file mode 100644
index 0000000..737d8b4
--- /dev/null
+++ b/cfe/cfe/usb/usbserial.c
@@ -0,0 +1,713 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * USB Serial Port Driver File: usbserial.c
+ *
+ * This device can talk to a few of those usb->serial converters
+ * out there.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#ifndef _CFE_
+#include <stdio.h>
+#include <time.h>
+#include <memory.h>
+#include <stdint.h>
+#include "usbhack.h"
+#else
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_printf.h"
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_ioctl.h"
+#include "cfe_console.h"
+#include "bsp_config.h"
+#endif
+
+#include "lib_malloc.h"
+#include "lib_queue.h"
+#include "usbchap9.h"
+#include "usbd.h"
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define USER_FIFOSIZE 256
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+typedef struct usbser_linedata_s {
+ uint8_t dLineDataBaud0,dLineDataBaud1,dLineDataBaud2,dLineDataBaud3;
+ uint8_t bLineDataStopBits; /* 0=1, 1=1.5, 2=2 */
+ uint8_t bLineDataParity; /* 0=none, 1=odd, 2=even, 3=mark, 4=space */
+ uint8_t bLineDataBits; /* 5,6,7,8 */
+} usbser_linedata_t;
+
+
+/* *********************************************************************
+ * Macros
+ ********************************************************************* */
+
+#define GETDWFIELD(s,f) ((uint32_t)((s)->f##0) | ((uint32_t)((s)->f##1) << 8) | \
+ ((uint32_t)((s)->f##2) << 16) | ((uint32_t)((s)->f##3) << 24))
+#define PUTDWFIELD(s,f,v) (s)->f##0 = (v & 0xFF); \
+ (s)->f##1 = ((v)>>8 & 0xFF); \
+ (s)->f##2 = ((v)>>16 & 0xFF); \
+ (s)->f##3 = ((v)>>24 & 0xFF);
+
+
+
+/* *********************************************************************
+ * Forward Definitions
+ ********************************************************************* */
+
+static int usbserial_attach(usbdev_t *dev,usb_driver_t *drv);
+static int usbserial_detach(usbdev_t *dev);
+
+#ifdef _CFE_
+static void usb_uart_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr);
+
+static int usb_uart_open(cfe_devctx_t *ctx);
+static int usb_uart_read(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int usb_uart_inpstat(cfe_devctx_t *ctx,iocb_inpstat_t *inpstat);
+static int usb_uart_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int usb_uart_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer);
+static int usb_uart_close(cfe_devctx_t *ctx);
+
+const static cfe_devdisp_t usb_uart_dispatch = {
+ usb_uart_open,
+ usb_uart_read,
+ usb_uart_inpstat,
+ usb_uart_write,
+ usb_uart_ioctl,
+ usb_uart_close,
+ NULL,
+ NULL
+};
+
+const cfe_driver_t usb_uart = {
+ "USB UART",
+ "uart",
+ CFE_DEV_SERIAL,
+ &usb_uart_dispatch,
+ usb_uart_probe
+};
+
+typedef struct usb_uart_s {
+ int uart_unit;
+ int uart_speed;
+ int uart_flowcontrol;
+} usb_uart_t;
+
+#define USBUART_MAXUNITS 4
+static usbdev_t *usbuart_units[USBUART_MAXUNITS];
+#endif
+
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+typedef struct usbserial_softc_s {
+ int user_inpipe;
+ int user_outpipe;
+ int user_outmps;
+ int user_intpipe;
+ uint8_t user_inbuf[USER_FIFOSIZE];
+ int user_inbuf_in;
+ int user_inbuf_out;
+ uint8_t *user_devinbuf;
+ int user_devinbufsize;
+ int user_unit;
+ uint8_t *user_intbuf;
+ usbser_linedata_t user_linedata;
+} usbserial_softc_t;
+
+usb_driver_t usbserial_driver = {
+ "USB Serial Port",
+ usbserial_attach,
+ usbserial_detach
+};
+
+usbdev_t *usbserial_dev = NULL;
+
+
+#if 0
+/* *********************************************************************
+ * usbserial_get_linedata(dev,linedata)
+ *
+ * Request line data from the device.
+ *
+ * Input parameters:
+ * dev - USB device
+ * linedata - pointer to structure
+ *
+ * Return value:
+ * # of bytes returned
+ * <0 if error
+ ********************************************************************* */
+
+static int usbserial_get_linedata(usbdev_t *dev,usbser_linedata_t *ldata)
+{
+ uint8_t *respbuf;
+ int res;
+
+ respbuf = KMALLOC(32,0);
+
+ res = usb_std_request(dev,0xA1,0x21,0,0,respbuf,sizeof(usbser_linedata_t));
+
+ KFREE(respbuf);
+
+ if ((res >= 0) && ldata) memcpy(ldata,respbuf,sizeof(usbser_linedata_t));
+
+ return res;
+}
+#endif
+
+/* *********************************************************************
+ * usbserial_set_linedata(dev,linedata)
+ *
+ * Set line data to the device.
+ *
+ * Input parameters:
+ * dev - USB device
+ * linedata - pointer to structure
+ *
+ * Return value:
+ * # of bytes returned
+ * <0 if error
+ ********************************************************************* */
+
+static int usbserial_set_linedata(usbdev_t *dev,usbser_linedata_t *ldata)
+{
+ int res;
+
+ /*
+ * Send request to device.
+ */
+
+ res = usb_std_request(dev,0x21,0x20,0,0,(uint8_t *) ldata,sizeof(usbser_linedata_t));
+
+ return res;
+}
+
+#if 0
+/* *********************************************************************
+ * usbserial_song_and_dance(usbdev_t *dev)
+ *
+ * Magic incantations from using the CATC on this device.
+ *
+ * Input parameters:
+ * dev
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+static int usbserial_song_and_dance(usbdev_t *dev)
+{
+ int res;
+ char databuf[1];
+
+ res = usb_std_request(dev,0xc0,0x01,0x8484,0,databuf,1); /* READ */
+
+ res = usb_std_request(dev,0x40,0x01,0x0404,0,NULL,0); /* WRITE */
+
+ res = usb_std_request(dev,0xc0,0x01,0x8484,0,databuf,1); /* READ */
+ res = usb_std_request(dev,0xc0,0x01,0x8383,0,databuf,1); /* READ */
+ res = usb_std_request(dev,0xc0,0x01,0x8484,0,databuf,1); /* READ */
+
+ res = usb_std_request(dev,0x40,0x01,0x0404,1,NULL,0); /* WRITE */
+
+ res = usb_std_request(dev,0xc0,0x01,0x8484,0,databuf,1); /* READ */
+ res = usb_std_request(dev,0xc0,0x01,0x8383,0,databuf,1); /* READ */
+
+ res = usb_std_request(dev,0x40,0x01,0x0,1, NULL,0); /* WRITE */
+ res = usb_std_request(dev,0x40,0x01,0x1,0xC0,NULL,0); /* WRITE */
+ res = usb_std_request(dev,0x40,0x01,0x2,4, NULL,0); /* WRITE */
+
+ return 0;
+}
+#endif
+
+/* *********************************************************************
+ * usbserial_tx_data(dev,buffer,len)
+ *
+ * Synchronously transmit data via the USB.
+ *
+ * Input parameters:
+ * dev - device pointer
+ * buffer,len - data we want to send
+ *
+ * Return value:
+ * number of bytes sent.
+ ********************************************************************* */
+
+static int usbserial_tx_data(usbdev_t *dev,uint8_t *buffer,int len)
+{
+ uint8_t *bptr;
+ usbreq_t *ur;
+ usbserial_softc_t *softc = (dev->ud_private);
+ int res;
+
+ bptr = KMALLOC(len,0);
+
+ memcpy(bptr,buffer,len);
+
+ ur = usb_make_request(dev,softc->user_outpipe,bptr,len,UR_FLAG_OUT);
+ res = usb_sync_request(ur);
+
+// printf("Data sent, status=%d, xferred=%d\n",res,ur->ur_xferred);
+
+ res = ur->ur_xferred;
+
+ usb_free_request(ur);
+
+ KFREE(bptr);
+
+ return res;
+}
+
+/* *********************************************************************
+ * usbserial_int_callback(ur)
+ *
+ * Callback routine for the interrupt request, for devices
+ * that have an interrupt pipe. We ignore this.
+ *
+ * Input parameters:
+ * ur - usb request
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static int usbserial_int_callback(usbreq_t *ur)
+{
+// int idx;
+
+ /*
+ * Check to see if the request was cancelled by someone
+ * deleting our endpoint.
+ */
+
+ if (ur->ur_status == 0xFF) {
+ usb_free_request(ur);
+ return 0;
+ }
+
+// printf("serial int msg: ");
+// for (idx = 0; idx < ur->ur_xferred; idx++) printf("%02X ",ur->ur_buffer[idx]);
+// printf("\n");
+
+ usb_queue_request(ur);
+
+ return 0;
+
+}
+
+
+/* *********************************************************************
+ * usbserial_rx_callback(ur)
+ *
+ * Callback routine for the regular data pipe.
+ *
+ * Input parameters:
+ * ur - usb request
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+static int usbserial_rx_callback(usbreq_t *ur)
+{
+ int idx;
+ int iptr;
+ usbserial_softc_t *user = (ur->ur_dev->ud_private);
+
+ /*
+ * Check to see if the request was cancelled by someone
+ * deleting our endpoint.
+ */
+
+ if (ur->ur_status == 0xFF) {
+ usb_free_request(ur);
+ return 0;
+ }
+
+ /*
+ * Add characters to the receive fifo
+ */
+
+ for (idx = 0; idx < ur->ur_xferred; idx++) {
+ iptr = (user->user_inbuf_in + 1) & (USER_FIFOSIZE-1);
+ if (iptr == user->user_inbuf_out) break; /* overflow */
+ user->user_inbuf[user->user_inbuf_in] = ur->ur_buffer[idx];
+ user->user_inbuf_in = iptr;
+ }
+
+ /*
+ * Requeue the request
+ */
+
+ usb_queue_request(ur);
+
+ return 0;
+
+}
+
+
+/* *********************************************************************
+ * usbserial_attach(dev,drv)
+ *
+ * This routine is called when the bus scan stuff finds a mass-storage
+ * device. We finish up the initialization by configuring the
+ * device and allocating our softc here.
+ *
+ * Input parameters:
+ * dev - usb device, in the "addressed" state.
+ * drv - the driver table entry that matched
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+static int usbserial_attach(usbdev_t *dev,usb_driver_t *drv)
+{
+ usb_config_descr_t *cfgdscr = dev->ud_cfgdescr;
+ usb_endpoint_descr_t *epdscr;
+ usb_endpoint_descr_t *indscr = NULL;
+ usb_endpoint_descr_t *outdscr = NULL;
+ usb_endpoint_descr_t *intdscr = NULL;
+ usb_interface_descr_t *ifdscr;
+ usbser_linedata_t *ldata;
+ usbserial_softc_t *softc;
+ usbreq_t *ur;
+ int idx;
+
+ dev->ud_drv = drv;
+
+ softc = KMALLOC(sizeof(usbserial_softc_t),0);
+ memset(softc,0,sizeof(usbserial_softc_t));
+ dev->ud_private = softc;
+
+ ifdscr = usb_find_cfg_descr(dev,USB_INTERFACE_DESCRIPTOR_TYPE,0);
+ if (ifdscr == NULL) {
+ printf("Could not get interface descriptor\n");
+ return -1;
+ }
+
+ for (idx = 0; idx < ifdscr->bNumEndpoints; idx++) {
+ epdscr = usb_find_cfg_descr(dev,USB_ENDPOINT_DESCRIPTOR_TYPE,idx);
+
+ if ((epdscr->bmAttributes & USB_ENDPOINT_TYPE_MASK) ==
+ USB_ENDPOINT_TYPE_INTERRUPT) {
+ intdscr = epdscr;
+ }
+ else if (USB_ENDPOINT_DIR_OUT(epdscr->bEndpointAddress)) {
+ outdscr = epdscr;
+ }
+ else {
+ indscr = epdscr;
+ }
+ }
+
+
+ if (!indscr || !outdscr) {
+ printf("IN or OUT endpoint descriptors are missing\n");
+ /*
+ * Could not get descriptors, something is very wrong.
+ * Leave device addressed but not configured.
+ */
+ return 0;
+ }
+
+ /*
+ * Choose the standard configuration.
+ */
+
+ usb_set_configuration(dev,cfgdscr->bConfigurationValue);
+
+ /*
+ * Open the pipes.
+ */
+
+ softc->user_inpipe = usb_open_pipe(dev,indscr);
+ softc->user_devinbufsize = GETUSBFIELD(indscr,wMaxPacketSize);
+ softc->user_devinbuf = KMALLOC(softc->user_devinbufsize,0);
+ softc->user_outpipe = usb_open_pipe(dev,outdscr);
+ softc->user_outmps = GETUSBFIELD(outdscr,wMaxPacketSize);
+ if (intdscr) {
+ softc->user_intpipe = usb_open_pipe(dev,intdscr);
+ }
+ else {
+ softc->user_intpipe = -1;
+ }
+
+ ur = usb_make_request(dev,softc->user_inpipe,softc->user_devinbuf,
+ softc->user_devinbufsize,
+ UR_FLAG_IN | UR_FLAG_SHORTOK);
+ ur->ur_callback = usbserial_rx_callback;
+ usb_queue_request(ur);
+
+
+ if (softc->user_intpipe) {
+ softc->user_intbuf = KMALLOC(32,0);
+ ur = usb_make_request(dev,softc->user_intpipe,softc->user_intbuf,
+ GETUSBFIELD(intdscr,wMaxPacketSize),
+ UR_FLAG_IN | UR_FLAG_SHORTOK);
+ ur->ur_callback = usbserial_int_callback;
+ usb_queue_request(ur);
+ }
+
+#ifdef _CFE_
+ softc->user_unit = -1;
+ for (idx = 0; idx < USBUART_MAXUNITS; idx++) {
+ if (usbuart_units[idx] == NULL) {
+ softc->user_unit = idx;
+ usbuart_units[idx] = dev;
+ break;
+ }
+ }
+
+ console_log("USBSERIAL: Unit %d connected",softc->user_unit);
+#endif
+
+// usbserial_song_and_dance(dev);
+
+ ldata = &(softc->user_linedata);
+ PUTDWFIELD(ldata,dLineDataBaud,115200);
+ ldata->bLineDataStopBits = 0;
+ ldata->bLineDataParity = 2;
+ ldata->bLineDataBits = 8;
+
+ usbserial_set_linedata(dev,ldata);
+// usbserial_get_linedata(dev,NULL);
+
+ usbserial_dev = dev;
+
+ return 0;
+}
+
+/* *********************************************************************
+ * usbserial_detach(dev)
+ *
+ * This routine is called when the bus scanner notices that
+ * this device has been removed from the system. We should
+ * do any cleanup that is required. The pending requests
+ * will be cancelled automagically.
+ *
+ * Input parameters:
+ * dev - usb device
+ *
+ * Return value:
+ * 0
+ ********************************************************************* */
+
+static int usbserial_detach(usbdev_t *dev)
+{
+ usbserial_softc_t *softc;
+
+ softc = dev->ud_private;
+
+
+#ifdef _CFE_
+ console_log("USBSERIAL: USB unit %d disconnected",softc->user_unit);
+ if (softc->user_unit >= 0) usbuart_units[softc->user_unit] = NULL;
+#endif
+
+ if (softc) {
+ if (softc->user_devinbuf) KFREE(softc->user_devinbuf);
+ if (softc->user_intbuf) KFREE(softc->user_intbuf);
+ KFREE(softc);
+ }
+
+ return 0;
+}
+
+
+
+#ifdef _CFE_
+
+
+
+static void usb_uart_probe(cfe_driver_t *drv,
+ unsigned long probe_a, unsigned long probe_b,
+ void *probe_ptr)
+{
+ usb_uart_t *softc;
+ char descr[80];
+
+ softc = (usb_uart_t *) KMALLOC(sizeof(usb_uart_t),0);
+
+ memset(softc,0,sizeof(usb_uart_t));
+
+ softc->uart_unit = (int)probe_a;
+
+ xsprintf(descr,"USB UART unit %d",(int)probe_a);
+
+ cfe_attach(drv,softc,NULL,descr);
+}
+
+
+static int usb_uart_open(cfe_devctx_t *ctx)
+{
+// usb_uart_t *softc = ctx->dev_softc;
+// int baudrate = CFG_SERIAL_BAUD_RATE;
+// usbdev_t *dev = usbuart_units[softc->uart_unit];
+
+ /*
+ * XXX call the uart setup here
+ */
+
+ return 0;
+}
+
+static int usb_uart_read(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ usb_uart_t *softc = ctx->dev_softc;
+ usbdev_t *dev = usbuart_units[softc->uart_unit];
+ usbserial_softc_t *user = dev->ud_private;
+ unsigned char *bptr;
+ int blen;
+
+ if (!dev) return 0;
+
+ bptr = buffer->buf_ptr;
+ blen = buffer->buf_length;
+
+ while ((blen > 0) && (user->user_inbuf_out != user->user_inbuf_in)) {
+ *bptr++ = user->user_inbuf[user->user_inbuf_out];
+ user->user_inbuf_out = (user->user_inbuf_out + 1) & (USER_FIFOSIZE-1);
+ blen--;
+ }
+
+ buffer->buf_retlen = buffer->buf_length - blen;
+ return 0;
+}
+
+static int usb_uart_inpstat(cfe_devctx_t *ctx, iocb_inpstat_t *inpstat)
+{
+ usb_uart_t *softc = ctx->dev_softc;
+ usbdev_t *dev = usbuart_units[softc->uart_unit];
+ usbserial_softc_t *user = dev->ud_private;
+
+ inpstat->inp_status = 0;
+
+ if (!dev) return 0;
+
+ inpstat->inp_status = (user->user_inbuf_in != user->user_inbuf_out);
+
+ return 0;
+}
+
+static int usb_uart_write(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ usb_uart_t *softc = ctx->dev_softc;
+ unsigned char *bptr;
+ int blen;
+ usbdev_t *dev = usbuart_units[softc->uart_unit];
+ usbserial_softc_t *user = dev->ud_private;
+
+ bptr = buffer->buf_ptr;
+ blen = buffer->buf_length;
+
+ if (!dev) {
+ buffer->buf_retlen = blen;
+ return 0;
+ }
+
+ if (blen > user->user_outmps) blen = user->user_outmps;
+
+ usbserial_tx_data(dev,bptr,blen);
+
+ buffer->buf_retlen = blen;
+ return 0;
+}
+
+static int usb_uart_ioctl(cfe_devctx_t *ctx, iocb_buffer_t *buffer)
+{
+ usb_uart_t *softc = ctx->dev_softc;
+ usbdev_t *dev = usbuart_units[softc->uart_unit];
+// usbserial_softc_t *user = dev->ud_private;
+
+ if (!dev) return -1;
+
+ unsigned int *info = (unsigned int *) buffer->buf_ptr;
+
+ switch ((int)buffer->buf_ioctlcmd) {
+ case IOCTL_SERIAL_GETSPEED:
+ *info = softc->uart_speed;
+ break;
+ case IOCTL_SERIAL_SETSPEED:
+ softc->uart_speed = *info;
+ /* NYI */
+ break;
+ case IOCTL_SERIAL_GETFLOW:
+ *info = softc->uart_flowcontrol;
+ break;
+ case IOCTL_SERIAL_SETFLOW:
+ softc->uart_flowcontrol = *info;
+ /* NYI */
+ break;
+ default:
+ return -1;
+ }
+
+ return 0;
+}
+
+static int usb_uart_close(cfe_devctx_t *ctx)
+{
+// usb_uart_t *softc = ctx->dev_softc;
+
+ return 0;
+}
+
+
+
+#endif
+
diff --git a/cfe/cfe/vendor/Makefile b/cfe/cfe/vendor/Makefile
new file mode 100644
index 0000000..a9fb42c
--- /dev/null
+++ b/cfe/cfe/vendor/Makefile
@@ -0,0 +1,2 @@
+
+ALLOBJS += cfe_vendor_xreq.o cfe_vendor_iocb_dispatch.o cfe_vendor_cmds.o
diff --git a/cfe/cfe/vendor/cfe_vendor_cmds.c b/cfe/cfe/vendor/cfe_vendor_cmds.c
new file mode 100644
index 0000000..34a159d
--- /dev/null
+++ b/cfe/cfe/vendor/cfe_vendor_cmds.c
@@ -0,0 +1,27 @@
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "cfe_devfuncs.h"
+#include "cfe_timer.h"
+
+#include "cfe_error.h"
+
+#include "ui_command.h"
+#include "cfe.h"
+
+#include "bsp_config.h"
+
+int ui_init_vendorcmds(void);
+
+
+int ui_init_vendorcmds(void)
+{
+ return 0;
+}
diff --git a/cfe/cfe/vendor/cfe_vendor_iocb.h b/cfe/cfe/vendor/cfe_vendor_iocb.h
new file mode 100644
index 0000000..33581cb
--- /dev/null
+++ b/cfe/cfe/vendor/cfe_vendor_iocb.h
@@ -0,0 +1,87 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * IOCB definitions File: cfe_iocb.h
+ *
+ * This module describes CFE's IOCB structure, the main
+ * data structure used to communicate API requests with CFE.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#ifndef _CFE_VENDOR_IOCB_H
+#define _CFE_VENDOR_IOCB_H
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define CFE_CMD_VENDOR_SAMPLE (CFE_CMD_VENDOR_USE+0)
+
+#define CFE_CMD_VENDOR_MAX (CFE_CMD_VENDOR_USE+1)
+
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+/*
+ * Vendor note: The fields in this structure leading up to the
+ * union *must* match the ones in cfe_iocb.h
+ *
+ * You can declare your own parameter list members here, since
+ * only your functions will be using them.
+ */
+
+
+typedef struct cfe_vendor_iocb_s {
+ cfe_uint_t iocb_fcode; /* IOCB function code */
+ cfe_int_t iocb_status; /* return status */
+ cfe_int_t iocb_handle; /* file/device handle */
+ cfe_uint_t iocb_flags; /* flags for this IOCB */
+ cfe_uint_t iocb_psize; /* size of parameter list */
+ union {
+ /* add/replace parameter list here */
+ iocb_buffer_t iocb_buffer; /* buffer parameters */
+ } plist;
+} cfe_vendor_iocb_t;
+
+
+#endif
+
diff --git a/cfe/cfe/vendor/cfe_vendor_iocb_dispatch.c b/cfe/cfe/vendor/cfe_vendor_iocb_dispatch.c
new file mode 100644
index 0000000..fb00c03
--- /dev/null
+++ b/cfe/cfe/vendor/cfe_vendor_iocb_dispatch.c
@@ -0,0 +1,179 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * IOCB dispatcher File: cfe_vendor_iocb_dispatch.c
+ *
+ * This routine is the main API dispatch for CFE. User API
+ * calls, via the ROM entry point, get dispatched to routines
+ * in this module.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_queue.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "cfe_iocb.h"
+#include "cfe_vendor_iocb.h"
+#include "cfe_error.h"
+#include "cfe_device.h"
+#include "cfe_timer.h"
+#include "cfe_mem.h"
+#include "cfe_fileops.h"
+#include "cfe_boot.h"
+#include "env_subr.h"
+#include "cfe.h"
+#include "cfe_console.h"
+#include "bsp_config.h"
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define HV 1 /* handle valid */
+
+/* *********************************************************************
+ * Globals
+ ********************************************************************* */
+
+extern cfe_devctx_t *cfe_handle_table[CFE_MAX_HANDLE];
+
+/* *********************************************************************
+ * Prototypes
+ ********************************************************************* */
+
+int cfe_vendor_iocb_dispatch(cfe_iocb_t *iocb);
+
+/* *********************************************************************
+ * Dispatch table
+ ********************************************************************* */
+
+struct cfe_vendor_cmd_dispatch_s {
+ int plistsize;
+ int flags;
+ int (*func)(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+};
+
+
+static int cfe_cmd_vendor_sample(cfe_devctx_t *ctx,cfe_iocb_t *iocb);
+
+const static struct cfe_vendor_cmd_dispatch_s
+ cfe_vendor_cmd_dispatch_table[CFE_CMD_VENDOR_MAX - CFE_CMD_VENDOR_USE] = {
+ {sizeof(iocb_buffer_t), 0, cfe_cmd_vendor_sample}, /* 0 : CFE_CMD_VENDOR_SAMPLE */
+};
+
+/* *********************************************************************
+ * IOCB dispatch routines
+ ********************************************************************* */
+
+
+int cfe_vendor_iocb_dispatch(cfe_iocb_t *iocb)
+{
+ const struct cfe_vendor_cmd_dispatch_s *disp;
+ int res;
+ cfe_devctx_t *ctx;
+
+ /*
+ * Check for commands codes out of range
+ */
+
+ if ((iocb->iocb_fcode < CFE_CMD_VENDOR_USE) ||
+ (iocb->iocb_fcode >= CFE_CMD_VENDOR_MAX)) {
+ iocb->iocb_status = CFE_ERR_INV_COMMAND;
+ return iocb->iocb_status;
+ }
+
+ /*
+ * Check for command codes in range but invalid
+ */
+
+ disp = &cfe_vendor_cmd_dispatch_table[iocb->iocb_fcode - CFE_CMD_VENDOR_USE];
+
+ if (disp->plistsize < 0) {
+ iocb->iocb_status = CFE_ERR_INV_COMMAND;
+ return iocb->iocb_status;
+ }
+
+ /*
+ * Check for invalid parameter list size
+ */
+
+ if (disp->plistsize != iocb->iocb_psize) {
+ iocb->iocb_status = CFE_ERR_INV_PARAM;
+ return iocb->iocb_status;
+ }
+
+ /*
+ * Determine handle
+ */
+
+ ctx = NULL;
+ if (disp->flags & HV) {
+ if ((iocb->iocb_handle >= CFE_MAX_HANDLE) ||
+ (iocb->iocb_handle < 0) ||
+ (cfe_handle_table[iocb->iocb_handle] == NULL)){
+ iocb->iocb_status = CFE_ERR_INV_PARAM;
+ return iocb->iocb_status;
+ }
+ ctx = cfe_handle_table[iocb->iocb_handle];
+ }
+
+ /*
+ * Dispatch to handler routine
+ */
+
+ res = (*disp->func)(ctx,iocb);
+
+ iocb->iocb_status = res;
+ return res;
+}
+
+
+
+/* *********************************************************************
+ * Implementation routines for each IOCB function
+ ********************************************************************* */
+
+static int cfe_cmd_vendor_sample(cfe_devctx_t *ctx,cfe_iocb_t *iocb)
+{
+ return CFE_OK;
+}
diff --git a/cfe/cfe/vendor/cfe_vendor_xiocb.h b/cfe/cfe/vendor/cfe_vendor_xiocb.h
new file mode 100644
index 0000000..950ebcf
--- /dev/null
+++ b/cfe/cfe/vendor/cfe_vendor_xiocb.h
@@ -0,0 +1,91 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * IOCB definitions File: cfe_iocb.h
+ *
+ * This module describes CFE's IOCB structure, the main
+ * data structure used to communicate API requests with CFE.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+#ifndef _CFE_VENDOR_XIOCB_H
+#define _CFE_VENDOR_XIOCB_H
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define CFE_CMD_VENDOR_SAMPLE (CFE_CMD_VENDOR_USE+0)
+
+#define CFE_CMD_VENDOR_MAX (CFE_CMD_VENDOR_USE+1)
+
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+/*
+ * Vendor note: The fields in this structure leading up to the
+ * union *must* match the ones in cfe_xiocb.h
+ *
+ * You can declare your own parameter list members here, since
+ * only your functions will be using them.
+ *
+ * You can also use some of the parameter list members in
+ * the regular xiocb.h if they are appropriate for your
+ * extended function calls.
+ */
+
+
+typedef struct cfe_vendor_xiocb_s {
+ cfe_xuint_t xiocb_fcode; /* IOCB function code */
+ cfe_xint_t xiocb_status; /* return status */
+ cfe_xint_t xiocb_handle; /* file/device handle */
+ cfe_xuint_t xiocb_flags; /* flags for this IOCB */
+ cfe_xuint_t xiocb_psize; /* size of parameter list */
+ union {
+ /* add/replace parameter list here */
+ xiocb_buffer_t xiocb_buffer; /* buffer parameters */
+ } plist;
+} cfe_vendor_xiocb_t;
+
+
+#endif
+
diff --git a/cfe/cfe/vendor/cfe_vendor_xreq.c b/cfe/cfe/vendor/cfe_vendor_xreq.c
new file mode 100644
index 0000000..f2ad541
--- /dev/null
+++ b/cfe/cfe/vendor/cfe_vendor_xreq.c
@@ -0,0 +1,222 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * IOCB dispatcher File: cfe_vendor_xreq.c
+ *
+ * This routine is the main API dispatch for CFE. User API
+ * calls, via the ROM entry point, get dispatched to routines
+ * in this module.
+ *
+ * This version of cfe_xreq is used for vendor extensions to
+ * CFE.
+ *
+ * This module looks similar to cfe_iocb_dispatch - it is different
+ * in that the data structure used, cfe_xiocb_t, uses fixed
+ * size field members (specifically, all 64-bits) no matter how
+ * the firmware is compiled. This ensures a consistent API
+ * interface on any implementation. When you call CFE
+ * from another program, the entry vector comes here first.
+ *
+ * Should the normal cfe_iocb interface change, this one should
+ * be kept the same for backward compatibility reasons.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_malloc.h"
+#include "lib_queue.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "cfe_iocb.h"
+#include "cfe_vendor_iocb.h"
+#include "cfe_xiocb.h"
+#include "cfe_vendor_xiocb.h"
+#include "cfe_error.h"
+#include "cfe_device.h"
+#include "cfe_timer.h"
+#include "cfe_mem.h"
+#include "env_subr.h"
+#include "cfe.h"
+
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+/* enum values for various plist types */
+
+#define PLBUF 1 /* iocb_buffer_t */
+
+/* *********************************************************************
+ * Structures
+ ********************************************************************* */
+
+struct cfe_vendor_xcmd_dispatch_s {
+ int xplistsize;
+ int iplistsize;
+ int plisttype;
+};
+
+
+/* *********************************************************************
+ * Command conversion table
+ * This table contains useful information for converting
+ * iocbs to xiocbs.
+ ********************************************************************* */
+
+const static struct cfe_vendor_xcmd_dispatch_s
+ cfe_vendor_xcmd_dispatch_table[CFE_CMD_VENDOR_MAX-CFE_CMD_VENDOR_USE] = {
+ {sizeof(xiocb_buffer_t), sizeof(iocb_buffer_t), PLBUF}, /* 0 : CFE_CMD_VENDOR_SAMPLE */
+};
+
+
+/* *********************************************************************
+ * Externs
+ ********************************************************************* */
+
+extern int cfe_vendor_iocb_dispatch(cfe_vendor_iocb_t *iocb);
+extern cfe_int_t cfe_vendor_doxreq(cfe_vendor_xiocb_t *xiocb);
+
+/* *********************************************************************
+ * cfe_vendor_doxreq(xiocb)
+ *
+ * Process an xiocb request. This routine converts an xiocb
+ * into an iocb, calls the IOCB dispatcher, converts the results
+ * back into the xiocb, and returns.
+ *
+ * Input parameters:
+ * xiocb - pointer to user xiocb
+ *
+ * Return value:
+ * command status, <0 if error occured
+ ********************************************************************* */
+
+cfe_int_t cfe_vendor_doxreq(cfe_vendor_xiocb_t *xiocb)
+{
+ const struct cfe_vendor_xcmd_dispatch_s *disp;
+ cfe_vendor_iocb_t iiocb;
+ cfe_int_t res;
+
+ /*
+ * Check for commands codes out of range
+ */
+
+ if ((xiocb->xiocb_fcode < CFE_CMD_VENDOR_USE) ||
+ (xiocb->xiocb_fcode >= CFE_CMD_VENDOR_MAX)) {
+ xiocb->xiocb_status = CFE_ERR_INV_COMMAND;
+ return xiocb->xiocb_status;
+ }
+
+ /*
+ * Check for command codes in range but invalid
+ */
+
+ disp = &cfe_vendor_xcmd_dispatch_table[xiocb->xiocb_fcode - CFE_CMD_VENDOR_USE];
+
+ if (disp->xplistsize < 0) {
+ xiocb->xiocb_status = CFE_ERR_INV_COMMAND;
+ return xiocb->xiocb_status;
+ }
+
+ /*
+ * Check for invalid parameter list size
+ */
+
+ if (disp->xplistsize != xiocb->xiocb_psize) {
+ xiocb->xiocb_status = CFE_ERR_INV_PARAM;
+ return xiocb->xiocb_status;
+ }
+
+ /*
+ * Okay, copy parameters into the internal IOCB.
+ * First, the fixed header.
+ */
+
+ iiocb.iocb_fcode = (unsigned int) xiocb->xiocb_fcode;
+ iiocb.iocb_status = (int) xiocb->xiocb_status;
+ iiocb.iocb_handle = (int) xiocb->xiocb_handle;
+ iiocb.iocb_flags = (unsigned int) xiocb->xiocb_flags;
+ iiocb.iocb_psize = (unsigned int) disp->iplistsize;
+
+ /*
+ * Now the parameter list
+ */
+
+ switch (disp->plisttype) {
+ case PLBUF:
+ iiocb.plist.iocb_buffer.buf_offset = (cfe_offset_t) xiocb->plist.xiocb_buffer.buf_offset;
+ iiocb.plist.iocb_buffer.buf_ptr = (unsigned char *) (uintptr_t) xiocb->plist.xiocb_buffer.buf_ptr;
+ iiocb.plist.iocb_buffer.buf_length = (unsigned int) xiocb->plist.xiocb_buffer.buf_length;
+ iiocb.plist.iocb_buffer.buf_retlen = (unsigned int) xiocb->plist.xiocb_buffer.buf_retlen;
+ iiocb.plist.iocb_buffer.buf_ioctlcmd = (unsigned int) xiocb->plist.xiocb_buffer.buf_ioctlcmd;
+ break;
+ }
+
+ /*
+ * Do the internal function dispatch
+ */
+
+ res = (cfe_int_t) cfe_vendor_iocb_dispatch(&iiocb);
+
+ /*
+ * Now convert the parameter list members back
+ */
+
+ switch (disp->plisttype) {
+ case PLBUF:
+ xiocb->plist.xiocb_buffer.buf_offset = (cfe_uint_t) iiocb.plist.iocb_buffer.buf_offset;
+ xiocb->plist.xiocb_buffer.buf_ptr = (cfe_xptr_t) (uintptr_t) iiocb.plist.iocb_buffer.buf_ptr;
+ xiocb->plist.xiocb_buffer.buf_length = (cfe_uint_t) iiocb.plist.iocb_buffer.buf_length;
+ xiocb->plist.xiocb_buffer.buf_retlen = (cfe_uint_t) iiocb.plist.iocb_buffer.buf_retlen;
+ xiocb->plist.xiocb_buffer.buf_ioctlcmd = (cfe_uint_t) iiocb.plist.iocb_buffer.buf_ioctlcmd;
+ break;
+ }
+
+ /*
+ * And the fixed header
+ */
+
+ xiocb->xiocb_status = (cfe_int_t) iiocb.iocb_status;
+ xiocb->xiocb_handle = (cfe_int_t) iiocb.iocb_handle;
+ xiocb->xiocb_flags = (cfe_uint_t) iiocb.iocb_flags;
+
+ return xiocb->xiocb_status;
+}
diff --git a/cfe/cfe/verif/Makefile b/cfe/cfe/verif/Makefile
new file mode 100644
index 0000000..939b494
--- /dev/null
+++ b/cfe/cfe/verif/Makefile
@@ -0,0 +1,7 @@
+
+#
+# Object files needed by VAPI
+#
+
+CFLAGS += -DCFG_VAPI=1
+ALLOBJS += vapi.o vapisubr.o vapitest.o ui_vapi.o
diff --git a/cfe/cfe/verif/readme.txt b/cfe/cfe/verif/readme.txt
new file mode 100644
index 0000000..4a35dee
--- /dev/null
+++ b/cfe/cfe/verif/readme.txt
@@ -0,0 +1,342 @@
+CFE Diagnostic Entry Points
+---------------------------
+
+---------------------------------------------------------------------------
+
+The CFE diagnostic entry points are used when running verification
+programs under the control of the firmware. They are fixed (constant)
+addresses and have register-based calling sequences. These entry
+points are designed to be as minimal as possible so that as much of the
+verification code as possible can be reused.
+
+You can call the KSEG0 or KSEG1 version of the routine. It is
+recommended that you call the cached version from cached code and
+vice versa.
+
+The firmware will reserve the top megabyte of memory for itself. The
+diagnostic must not touch this memory.
+
+The firmware will be compiled to *NOT* use relocatable data and
+code segments.
+
+The firmware will need one general register that it is allowed to
+trash without saving - I'll be using this to generate the pointer to
+the save area.
+
+The diagnostics can generate records in a log buffer. This buffer
+is allocated in the diagnostic's memory space but is filled in
+by the firmware through the diagnostic entry points. At the end
+of the diagnostic run, user commands in the firmware may be used
+to look through accumulated log records.
+
+If you mess with the caches or with the console device, the
+VAPI functions that print messages to the console may not work.
+
+Log records follow this format:
+
+ +0 SIGNATURE, FORMAT, and ID-CODE
+ +8 Number of 64-bit words in 'Log Data' field.
+ Upper 32 bits are CP0 count register
+ +16 Return address of routine generating this record
+ +24 Log Data
+
+The "Log Record size" field is the number of bytes in the "log data"
+field. No log data would use a value of zero.
+
+The bytes in the SIGNATURE word are broken down as follows:
+
+ S1 S2 P1 F1 I1 I2 I3 I4
+ CF E1 pp xx ii ii ii ii
+
+The "F1" byte is the format code; it describes the type
+of log record being generated.
+
+ 0x00 - General register and CP0 dump
+ 0x01 - SOC state dump
+ 0x02 - Generic log data (multiple of 8 bytes)
+ 0x03 - trace RAM
+ 0x04 - Diagnostic termination status (8 bytes)
+ 0x05 - Floating point registers
+
+The "P1" byte is the processor number, 0 or 1.
+
+The "I1" through "I4" bytes are supplied by the diagnostic
+and can take on any value. You can use these bytes to identify
+what part of the program generated this particular log record.
+
+For example, if the diagnostic logs a single value of
+0x0123_4567_89ab_cdef the log entry might look like:
+
+ 0xCCFF_EE02_0000_0001
+ 0x0001_3F22_0000_0008
+ 0xFFFF_FFFF_8000_0120
+ 0x0123_4567_89AB_CDEF
+
+
+RETURN TO FIRMWARE
+------------------
+
+Description:
+
+ Returns control to the firmware and displays the test status.
+ The status result is in register A0.
+
+ The firmware will store a "diagnostic termination status"
+ record in the log with the A0 register value. The ID code
+ will be zero for this record.
+
+ CFE's log scanning commands can be used to display log
+ records accumulated by the test.
+
+
+Routine address: 0xBFC00510 (KSEG1)
+ 0x9FC00510 (KSEG0)
+
+On entry: A0 ($4) Exit status (9=ok, nonzero=fail)
+On return: Does not return
+Registers used: All
+
+
+DUMP GENERAL REGISTERS
+----------------------
+
+Description:
+
+ This routine causes CFE to display a register dump on the console
+ port. It is assumed that the console hardware state has not been
+ altered by the diagnostic.
+
+ The format of the register dump is: TBD [XXX should it look like the
+ one that the functional simulator uses?]
+
+ The firmware needs one scratch register.
+
+
+Routine address: 0xBFC00520 (KSEG1)
+ 0x9FC00520 (KSEG0)
+
+On Entry: RA ($31) Return Address
+On Return: nothing
+Registers used: K0 ($26) Scratch register for CFE
+
+
+SET LOG BUFFER
+--------------
+
+Description:
+
+ This routine sets the address of the log buffer. This
+ call must be made once at the beginning of the diagnostic
+ or else the "SAVE" functions will be considered as
+ NOPs.
+
+ The buffer addresses must be 64-bit aligned.
+
+Routine address: 0xBFC00530 (KSEG1)
+ 0x9FC00530 (KSEG0)
+
+On Entry: RA ($31) Return Address
+ A0 ($4) Address of start of buffer
+ A1 ($5) Address of end of buffer
+On Return: Nothing
+Registers Used: K0 ($26) Scratch register for CFE
+
+
+
+LOG SINGLE VALUE
+----------------
+
+Description:
+
+ This routine saves a single 64-bit value in the log.
+
+
+Routine address: 0xBFC00540 (KSEG1)
+ 0x9FC00540 (KSEG0)
+
+On Entry: RA ($31) Return Address
+ A0 ($4) Low 32 bits are ID code for value
+ A1 ($5) Value to log
+On Return: Nothing
+Registers Used: K0 ($26) Scratch register for CFE
+
+
+
+LOG MEMORY DATA
+---------------
+
+Description:
+
+ This routine saves a block of memory in the log. The source
+ buffer must be 64-bit aligned.
+
+
+Routine address: 0xBFC00550 (KSEG1)
+ 0x9FC00550 (KSEG0)
+
+On Entry: RA ($31) Return Address
+ A0 ($4) Low 32 bits are ID code for values
+ A1 ($5) Address of buffer containing values
+ A2 ($6) Number of 64-bit words to store
+On Return: Nothing
+Registers Used: K0 ($26) Scratch register for CFE
+
+
+
+
+
+SAVE SOC STATE
+--------------
+
+Description:
+
+ This routine saves the SOC state in a user-supplied buffer.
+ The buffer must be large enough to accomodate the SOC state.
+ The SOC state will be written as records with the following
+ format:
+
+ uint64_t phys_address
+ uint64_t value
+ uint64_t phys_address
+ uint64_t value
+ ...
+ uint64_t phys_address
+ uint64_t value
+
+ The table of SOC registers to dump will be maintained by
+ the firmware.
+
+ The firmware needs one scratch register.
+
+Routine address: 0xBFC00570 (KSEG1)
+ 0x9FC00570 (KSEG0)
+
+On entry: A0 ($4) Low 32 bits are ID code for values
+ A1 ($5) Bitmask of agents to store in log
+On return: nothing
+Registers used: K0 ($26) Scratch register for CFE
+
+
+SAVE CPU REGISTERS
+------------------
+
+Description:
+
+ This routine saves the CPU general registers and certain CP0
+ registers in a user-supplied buffer.
+
+ This buffer must be large enough to accomodate the data
+ that will be saved. The registers will be written in
+ the following format:
+
+ uint64_t general_registers[32]
+ uint64_t C0_INX
+ uint64_t C0_RAND
+ uint64_t C0_TLBLO0
+ uint64_t C0_TLBLO1
+ uint64_t C0_CTEXT
+ uint64_t C0_PGMASK
+ uint64_t C0_WIRED
+ uint64_t C0_BADVADDR
+ uint64_t C0_COUNT
+ uint64_t C0_TLBHI
+ uint64_t C0_COMPARE
+ uint64_t C0_SR
+ uint64_t C0_CAUSE
+ uint64_t C0_EPC
+ uint64_t C0_PRID
+ uint64_t C0_CONFIG
+ uint64_t C0_LLADDR
+ uint64_t C0_WATCHLO
+ uint64_t C0_WATCHHI
+ uint64_t C0_XCTEXT
+ uint64_t C0_ECC
+ uint64_t C0_CACHEERR
+ uint64_t C0_TAGLO
+ uint64_t C0_TAGHI
+ uint64_t C0_ERREPC
+
+ The firmware needs one scratch register.
+
+Routine address: 0xBFC00580 (KSEG1)
+ 0x9FC00580 (KSEG0)
+
+On entry: RA ($31) Return address
+ A0 ($4) Low 32 bits are ID code for values
+On return: nothing
+Registers used: K0 ($26) Scratch register for CFE
+
+
+SAVE FPU REGISTERS
+------------------
+
+Description:
+
+ This routine saves the floating point and floating point
+ control registers. The registers will be written in
+ the following format:
+
+ uint64_t fp_registers[32]
+ uint64_t fp_fir
+ uint64_t fp_status
+ uint64_t fp_condition_codes
+ uint64_t fp_exceptions
+ uint64_t fp_enables
+
+ The firmware needs one scratch register.
+
+Routine address: 0xBFC005B0 (KSEG1)
+ 0x9FC005B0 (KSEG0)
+
+On entry: RA ($31) Return address
+ A0 ($4) Low 32 bits are ID code for values
+On return: nothing
+Registers used: K0 ($26) Scratch register for CFE
+
+
+DUMP STRING
+-----------
+
+Description:
+
+ This routine displays a zero-terminated ASCII text string on the
+ console port.
+
+ The firmware needs one scratch register.
+
+
+Routine address: 0xBFC00590 (KSEG1)
+ 0x9FC00590 (KSEG0)
+
+On entry: RA ($31) Return address
+ A0 ($4) Pointer to null-terminated string
+On return: nothing
+Registers used: K0 ($26) Scratch register for CFE
+
+
+
+SHOW LED MESSAGE
+----------------
+
+Description:
+
+ This routine writes four characters onto the SWARM board LEDs.
+ Writing to the LEDs is very fast compared to writing to the
+ console and can be useful for providing progress feedback
+ during a run.
+
+ The characters are packed into the low 4 bytes of register A0.
+ The string ABCD would be hex 0x0000_0000_4142_4344
+
+ The firmware needs one scratch register
+
+Routine address: 0xBFC005A0 (KSEG1)
+ 0x9FC005A0 (KSEG0)
+
+On entry: RA ($31) Return Address
+ A0 ($4) Four characters
+On return: nothing
+Registers used: K0 ($26) Scratch register for CFE
+
+------------------------------------------------------------------------
+
diff --git a/cfe/cfe/verif/ui_vapi.c b/cfe/cfe/verif/ui_vapi.c
new file mode 100644
index 0000000..4575322
--- /dev/null
+++ b/cfe/cfe/verif/ui_vapi.c
@@ -0,0 +1,300 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * VAPI commands File: ui_vapi.c
+ *
+ * User interface for the verification API
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_string.h"
+#include "lib_queue.h"
+#include "lib_malloc.h"
+#include "lib_printf.h"
+#include "bsp_config.h"
+
+#include "cfe_iocb.h"
+#include "cfe_device.h"
+#include "cfe_console.h"
+#include "env_subr.h"
+#include "ui_command.h"
+#include "cfe.h"
+
+#if CFG_VAPI
+
+#include "vapi.h"
+
+int ui_init_vapicmds(void);
+
+extern void vapitest(void);
+
+extern void vapi_run(int);
+
+extern uint64_t vapi_logstart;
+extern uint64_t vapi_logend;
+extern uint64_t vapi_logptr;
+extern uint64_t vapi_status;
+
+int ui_cmd_vapirun(ui_cmdline_t *cmd,int argc,char *argv[]);
+int ui_cmd_vapitest(ui_cmdline_t *cmd,int argc,char *argv[]);
+int ui_cmd_vapishow(ui_cmdline_t *cmd,int argc,char *argv[]);
+int ui_cmd_vapidump(ui_cmdline_t *cmd,int argc,char *argv[]);
+int ui_cmd_vapistatus(ui_cmdline_t *cmd,int argc,char *argv[]);
+
+static char *rectypes[7] = {
+ "GPRS ",
+ "SOC ",
+ "DATA ",
+ "BUF ",
+ "TRC ",
+ "EXIT ",
+ "FPRS "
+};
+
+int ui_cmd_vapidump(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ uint64_t *ptr;
+ uint64_t *eptr;
+ int recnum = 0;
+
+ if (vapi_logptr == 0) {
+ xprintf("Diagnostic did not record any log records\n");
+ return -1;
+ }
+
+ ptr = (uint64_t *) (intptr_t) vapi_logstart;
+ eptr = (uint64_t *) (intptr_t) vapi_logptr;
+
+ xprintf("*** VAPI LOG START %s\n",
+#ifdef __MIPSEB
+ "big-endian"
+#else
+ "little-endian"
+#endif
+ );
+
+ while (ptr < eptr) {
+ xprintf("%6d %016llX %016llX %016llX %016llX\n",
+ recnum,
+ ptr[0],ptr[1],ptr[2],ptr[3]);
+ ptr += 4;
+ recnum++;
+ }
+
+ xprintf("*** VAPI LOG END\n");
+
+ return 0;
+
+
+}
+
+int ui_cmd_vapishow(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ uint64_t *ptr;
+ uint64_t *eptr;
+ uint32_t a,b;
+ uint32_t ts,len,fmt;
+ unsigned int idx;
+ int recnum = 0;
+
+ if (vapi_logptr == 0) {
+ xprintf("Diagnostic did not record any log records\n");
+ return -1;
+ }
+
+ ptr = (uint64_t *) (intptr_t) vapi_logstart;
+ eptr = (uint64_t *) (intptr_t) vapi_logptr;
+
+ while (ptr < eptr) {
+ a = (ptr[VAPI_IDX_SIGNATURE]) >> 32;
+ b = (ptr[VAPI_IDX_SIGNATURE]) & 0xFFFFFFFF;
+ if ((a & VAPI_SEAL_MASK) != VAPI_CFESEAL) {
+ xprintf("Incorrect record seal at %08X\n",ptr);
+ break;
+ }
+
+ fmt = (a & VAPI_FMT_MASK);
+
+ xprintf("%5d ID=%08X CPU%d %s RA=%08X ",
+ recnum,
+ b,
+ (a & VAPI_PRID_MASK) >> VAPI_PRNUM_SHIFT,
+ rectypes[fmt],
+ ptr[VAPI_IDX_RA]);
+
+ ts = (ptr[VAPI_IDX_SIZE]) >> 32;
+ len = ((ptr[VAPI_IDX_SIZE]) & 0xFFFFFFFF);
+
+ xprintf("TS=%08X ",ts);
+
+ switch (fmt) {
+ case VAPI_FMT_GPRS:
+ xprintf("Len=%d\n",len);
+ for (idx = 0; idx < len; idx += 2) {
+ xprintf(" %016llX %016llX\n",
+ ptr[VAPI_IDX_DATA+idx],
+ ptr[VAPI_IDX_DATA+idx+1]);
+ }
+ break;
+ case VAPI_FMT_SOC:
+ xprintf("Len=%d\n",len);
+ for (idx = 0; idx < len; idx += 2) {
+ xprintf(" Reg=%016llX Val=%016llX\n",
+ ptr[VAPI_IDX_DATA+idx],
+ ptr[VAPI_IDX_DATA+idx+1]);
+ }
+ break;
+ case VAPI_FMT_DATA:
+ xprintf("Data=%016llX\n",ptr[VAPI_IDX_DATA]);
+ break;
+ case VAPI_FMT_BUFFER:
+ xprintf("Addr=%08X\n",(intptr_t) ptr[VAPI_IDX_DATA]);
+ for (idx = 0; idx < len-1; idx += 2) {
+ xprintf(" %016llX %016llX\n",
+ ptr[VAPI_IDX_DATA+idx+1],
+ ptr[VAPI_IDX_DATA+idx+2]);
+ }
+ if (idx != (len-1)) {
+ xprintf(" %016llX\n",
+ ptr[VAPI_IDX_DATA+idx+1]);
+ }
+ break;
+ case VAPI_FMT_TRACE:
+ xprintf("\n");
+ break;
+ case VAPI_FMT_EXIT:
+ xprintf("Stat=%016llX\n",ptr[VAPI_IDX_DATA]);
+ break;
+ default:
+ xprintf("\n");
+ break;
+ }
+
+ ptr += 3 + len;
+ recnum++;
+ }
+
+ return 0;
+
+}
+
+int ui_cmd_vapitest(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+
+ vapitest();
+
+ xprintf("LogStart=%llX LogEnd=%llX LogPtr=%llX\n",
+ vapi_logstart,vapi_logend,vapi_logptr);
+
+ return 0;
+}
+
+int ui_cmd_vapistatus(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+
+ xprintf("VAPI Exit Status = <%016llX>\n", vapi_status);
+ return 0;
+}
+
+int ui_cmd_vapirun(ui_cmdline_t *cmd,int argc,char *argv[])
+{
+ int mode; /* 0 = cached, 1 = uncached, 2 = mc mode */
+
+ mode = 0;
+ if (cmd_sw_isset(cmd,"-uncached")) mode = 1;
+ if (cmd_sw_isset(cmd,"-mc")) mode = 2;
+
+ vapi_run(mode);
+ return -1;
+}
+
+
+int ui_init_vapicmds(void)
+{
+ cmd_addcmd("vapi run",
+ ui_cmd_vapirun,
+ NULL,
+ "Run a program using the VAPI reset vector.",
+ "vapi run\n"
+ "Executes a previously loaded VAPI program by resetting the\n"
+ "CPUs and jumping directly to user code. The program\n"
+ "must be located at absolute address 0x8002_0000\n",
+ "-uncached;Start execution at 0xA002_0000 (KSEG1)|"
+ "-mc;Start execution at 0xBFD0_0000");
+
+ cmd_addcmd("vapi test",
+ ui_cmd_vapitest,
+ NULL,
+ "Test VAPI interface.",
+ "vapi test\n\n"
+ "Do some basic calls to the VAPI interface, then return to CFE\n\n",
+ "");
+
+ cmd_addcmd("vapi dump",
+ ui_cmd_vapidump,
+ NULL,
+ "Show VAPI log in an easily processed format.",
+ "vapi dump\n\n"
+ "Display the VAPI log in a format that is more easily postprocessed\n"
+ "by external programs.\n\n",
+ "");
+
+ cmd_addcmd("vapi show",
+ ui_cmd_vapishow,
+ NULL,
+ "Show VAPI log.\n",
+ "vapi show\n\n"
+ "Display the VAPI log in a human readable form (sort of)\n\n",
+ "");
+
+ cmd_addcmd("vapi status",
+ ui_cmd_vapistatus,
+ NULL,
+ "Print last VAPI exit status.\n",
+ "vapi status\n\n"
+ "Display the exit status of the last VAPI program that was run\n",
+ "");
+
+ return 0;
+}
+
+#endif
diff --git a/cfe/cfe/verif/vapi.S b/cfe/cfe/verif/vapi.S
new file mode 100644
index 0000000..a65fb6d
--- /dev/null
+++ b/cfe/cfe/verif/vapi.S
@@ -0,0 +1,1150 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Verification Test APIs File: vapi.S
+ *
+ * This module contains special low-level routines for use
+ * by verification programs.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "sbmips.h"
+#include "bsp_config.h"
+#include "mipsmacros.h"
+
+#if CFG_VAPI
+
+#if (CFG_EMBEDDED_PIC)
+#error "CFG_VAPI is not compatible with relocatable code"
+#endif
+
+#include "cfe_devfuncs.h"
+
+#include "sb1250_defs.h"
+#include "sb1250_regs.h"
+#include "sb1250_scd.h"
+
+#include "vapi.h"
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+
+#define CALLKSEG1(x) \
+ la t0,x ; \
+ or t0,K1BASE ; \
+ jal t0
+
+#ifndef CFG_STACK_SIZE
+#define STACK_SIZE 8192
+#else
+#define STACK_SIZE ((CFG_STACK_SIZE+1023) & ~1023)
+#endif
+
+#define REGIDX(x) ((x)*8)
+
+#define SAVE_RA REGIDX(0)
+#define SAVE_GP REGIDX(1)
+#define SAVE_AT REGIDX(2)
+#define SAVE_T0 REGIDX(3)
+#define SAVE_T1 REGIDX(4)
+#define SAVE_T2 REGIDX(5)
+#define SAVE_T3 REGIDX(6)
+#define SAVE_A0 REGIDX(7)
+#define SAVE_A1 REGIDX(8)
+#define SAVE_A2 REGIDX(9)
+
+#define SAVE_SIZE REGIDX(10)
+
+#define SAVETEMPS(x) \
+ .set noat ; \
+ la k0,x ; \
+ sd ra,SAVE_RA(k0) ; \
+ sd gp,SAVE_GP(k0) ; \
+ sd AT,SAVE_AT(k0) ; \
+ sd t0,SAVE_T0(k0) ; \
+ sd t1,SAVE_T1(k0) ; \
+ sd t2,SAVE_T2(k0) ; \
+ sd t3,SAVE_T3(k0) ; \
+ sd a0,SAVE_A0(k0) ; \
+ sd a1,SAVE_A1(k0) ; \
+ sd a2,SAVE_A2(k0) ; \
+ .set at ; \
+ la gp,_gp
+
+
+#define RESTORETEMPS(x) \
+ .set noat ; \
+ la k0,x ; \
+ ld ra,SAVE_RA(k0) ; \
+ ld gp,SAVE_GP(k0) ; \
+ ld AT,SAVE_AT(k0) ; \
+ ld t0,SAVE_T0(k0) ; \
+ ld t1,SAVE_T1(k0) ; \
+ ld t2,SAVE_T2(k0) ; \
+ ld t3,SAVE_T3(k0) ; \
+ ld a0,SAVE_A0(k0) ; \
+ ld a1,SAVE_A1(k0) ; \
+ ld a2,SAVE_A2(k0) ; \
+ .set at
+
+#define RECPTR t3
+
+#define CHECKPTR(label) \
+ ld RECPTR,vapi_logptr ; \
+ ld t0,vapi_logend ; \
+ beq RECPTR,zero,label ; \
+ bge RECPTR,t0,label
+
+#define SETRECTYPE(x,id) \
+ ld RECPTR,vapi_logptr ; \
+ li t2,(VAPI_CFESEAL | (x)) ; \
+ mfc0 t0,C0_PRID ; \
+ srl t0,t0,25 ; \
+ and t0,t0,7 ; \
+ sll t0,t0,VAPI_PRNUM_SHIFT ; \
+ or t2,t2,t0 ; \
+ dsll t2,t2,32 ; \
+ or t2,id ; \
+ sd t2,VAPI_REC_SIGNATURE(RECPTR) ; \
+ mfc0 t2,C0_COUNT ; \
+ dsll t2,t2,32 ; \
+ sd t2,VAPI_REC_SIZE(RECPTR) ; \
+ sd ra,VAPI_REC_RA(RECPTR)
+
+
+
+#define SETRECLEN_CONST(len) \
+ ld t2,VAPI_REC_SIZE(RECPTR) ; \
+ or t2,len ; \
+ sd t2,VAPI_REC_SIZE(RECPTR)
+
+#define SETRECLEN_REG(r) \
+ ld t2,VAPI_REC_SIZE(RECPTR) ; \
+ or t2,r ; \
+ sd t2,VAPI_REC_SIZE(RECPTR)
+
+
+/* *********************************************************************
+ * Data
+ ********************************************************************* */
+
+ .sdata
+
+ .globl vapi_logstart
+ .globl vapi_logend
+ .globl vapi_logptr
+ .globl vapi_status
+ .globl vapi_logover
+
+vapi_logstart: .dword 0
+vapi_logend: .dword 0
+vapi_logptr: .dword 0
+vapi_status: .dword -1
+vapi_logover: .dword 0
+
+ .extern mem_heapstart
+
+ .bss
+
+ .comm vapi_regsave,REGIDX(64)
+
+ .text
+
+ .globl vapi_socregs
+vapi_socregs:
+
+#ifdef _P5064_
+ .word 0, 0
+#else
+#include "sb1250_socregs.inc"
+#endif
+
+ .text
+
+ .extern cfe_warmstart
+
+ .set reorder
+
+
+/* *********************************************************************
+ * VAPI_KSEG0_SWITCH
+ *
+ * Hack the return address so we will come back in KSEG0
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+LEAF(vapi_kseg0_switch)
+
+ and ra,(K0SIZE-1)
+ or ra,K0BASE
+ jr ra
+
+END(vapi_kseg0_switch)
+
+/* *********************************************************************
+ * VAPI_EXIT(status)
+ *
+ * Return from diagnostic to firmware
+ *
+ * Input parameters:
+ * a0 - exit status (0=ok, else error)
+ *
+ * Return value:
+ * does not return
+ ********************************************************************* */
+
+
+LEAF(vapi_exit)
+
+ move k1,a0
+
+
+/*
+ * Reinitialize the CPU and the caches
+ */
+
+ bal vapi_kseg1_switch
+ CALLKSEG1(sb1_cpu_init)
+/*
+ * Don't initialize the caches again. Some diags
+ * leave data in the caches and if we invalidate it
+ * now we won't be able to see what happened.
+ */
+/* CALLKSEG1(sb1250_l1cache_init) */
+/* CALLKSEG1(sb1250_l2cache_init) */
+
+#ifdef __long64
+/*
+ * Set back to 64-bit mode. Don't worry about the hazard
+ * here, it'll be eons before we need to use the KX space.
+ */
+ mfc0 t0,C0_SR
+ or t0,t0,M_SR_KX
+ mtc0 t0,C0_SR
+#endif
+
+ bal vapi_kseg0_switch
+
+ li a0,0x42424242 # 'BBBB'
+ jal board_setleds
+
+ move a0,k1
+
+ la gp,_gp
+ sd a0,vapi_status
+ LR sp,mem_heapstart
+ ADD sp,((CFG_HEAP_SIZE*1024)+STACK_SIZE - 8)
+
+/*
+ * Create a log record for the EXIT status.
+ */
+ ld t0,vapi_logptr
+ beq t0,zero,nolog
+
+ SETRECTYPE(VAPI_FMT_EXIT,0)
+ SETRECLEN_CONST(1)
+ sd a0,VAPI_REC_DATA(RECPTR)
+ add RECPTR,32
+ sd RECPTR,vapi_logptr
+nolog:
+ li a0,0x45454545 # 'EEEE'
+ jal board_setleds
+
+#if CFG_MULTI_CPUS
+
+ /*
+ * Restart the other CPU if it was left in RESET.
+ */
+
+ la t2,PHYS_TO_K1(A_SCD_SYSTEM_CFG)
+ ld t0,0(t2)
+ dli t1,M_SYS_CPU_RESET_1 # Reset mask
+ and t0,t1 # Test if CPU is in reset
+ beq t0,zero,1f # skip if not in reset
+
+ li a0,1 # Whack the CPU
+ jal altcpu_cmd_stop # and put it back in idle
+1:
+#endif
+
+ ld a0,vapi_status
+ j cfe_warmstart
+
+END(vapi_exit)
+
+
+
+/* *********************************************************************
+ * VAPI_DUMPGPRS()
+ *
+ * Dump the GPRs to the console
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ *
+ * Registers used:
+ * k0 - scratch register for CFE
+ ********************************************************************* */
+
+LEAF(vapi_dumpgprs)
+
+ .set noat
+ la k0,vapi_regsave
+ sd $0,REGIDX(0)(k0)
+ sd $1,REGIDX(1)(k0)
+ sd $2,REGIDX(2)(k0)
+ sd $3,REGIDX(3)(k0)
+ sd $4,REGIDX(4)(k0)
+ sd $5,REGIDX(5)(k0)
+ sd $6,REGIDX(6)(k0)
+ sd $7,REGIDX(7)(k0)
+ sd $8,REGIDX(8)(k0)
+ sd $9,REGIDX(9)(k0)
+ sd $10,REGIDX(10)(k0)
+ sd $11,REGIDX(11)(k0)
+ sd $12,REGIDX(12)(k0)
+ sd $13,REGIDX(13)(k0)
+ sd $14,REGIDX(14)(k0)
+ sd $15,REGIDX(15)(k0)
+ sd $16,REGIDX(16)(k0)
+ sd $17,REGIDX(17)(k0)
+ sd $18,REGIDX(18)(k0)
+ sd $19,REGIDX(19)(k0)
+ sd $20,REGIDX(20)(k0)
+ sd $21,REGIDX(21)(k0)
+ sd $22,REGIDX(22)(k0)
+ sd $23,REGIDX(23)(k0)
+ sd $24,REGIDX(24)(k0)
+ sd $25,REGIDX(25)(k0)
+ sd $26,REGIDX(26)(k0) /* k0 */
+ sd $27,REGIDX(27)(k0)
+ sd $28,REGIDX(28)(k0)
+ sd $29,REGIDX(29)(k0)
+ sd $30,REGIDX(30)(k0)
+ sd $31,REGIDX(31)(k0)
+ .set at
+
+# Save some CP0 registers here.
+#define LSAVECP0(cp0,idx) \
+ dmfc0 t0,cp0 ; \
+ sd t0,REGIDX(idx)(k0)
+
+ LSAVECP0(C0_INX,32)
+ LSAVECP0(C0_RAND,33)
+ LSAVECP0(C0_TLBLO0,34)
+ LSAVECP0(C0_TLBLO1,35)
+ LSAVECP0(C0_CTEXT,36)
+ LSAVECP0(C0_PGMASK,37)
+ LSAVECP0(C0_WIRED,38)
+ LSAVECP0(C0_BADVADDR,39)
+ LSAVECP0(C0_COUNT,40)
+ LSAVECP0(C0_TLBHI,41)
+ LSAVECP0(C0_COMPARE,42)
+ LSAVECP0(C0_SR,43)
+ LSAVECP0(C0_CAUSE,44)
+ LSAVECP0(C0_EPC,45)
+ LSAVECP0(C0_PRID,46)
+ LSAVECP0(C0_CONFIG,47)
+ LSAVECP0(C0_LLADDR,48)
+ LSAVECP0(C0_WATCHLO,49)
+ LSAVECP0(C0_WATCHHI,50)
+ LSAVECP0(C0_XCTEXT,51)
+ LSAVECP0(C0_ECC,52)
+ LSAVECP0(C0_CACHEERR,53)
+ LSAVECP0(C0_TAGLO,54)
+ LSAVECP0(C0_TAGHI,55)
+ LSAVECP0(C0_ERREPC,56)
+
+
+ move a0,k0 /* pass addr of regs */
+ la gp,_gp
+ LR sp,mem_heapstart
+ ADD sp,((CFG_HEAP_SIZE*1024)+STACK_SIZE - 8)
+ jal vapi_dodumpregs /* dump registers in 'C' */
+
+ .set noat
+ la k0,vapi_regsave
+ ld $1,REGIDX(1)(k0)
+ ld $2,REGIDX(2)(k0)
+ ld $3,REGIDX(3)(k0)
+ ld $4,REGIDX(4)(k0)
+ ld $5,REGIDX(5)(k0)
+ ld $6,REGIDX(6)(k0)
+ ld $7,REGIDX(7)(k0)
+ ld $8,REGIDX(8)(k0)
+ ld $9,REGIDX(9)(k0)
+ ld $10,REGIDX(10)(k0)
+ ld $11,REGIDX(11)(k0)
+ ld $12,REGIDX(12)(k0)
+ ld $13,REGIDX(13)(k0)
+ ld $14,REGIDX(14)(k0)
+ ld $15,REGIDX(15)(k0)
+ ld $16,REGIDX(16)(k0)
+ ld $17,REGIDX(17)(k0)
+ ld $18,REGIDX(18)(k0)
+ ld $19,REGIDX(19)(k0)
+ ld $20,REGIDX(20)(k0)
+ ld $21,REGIDX(21)(k0)
+ ld $22,REGIDX(22)(k0)
+ ld $23,REGIDX(23)(k0)
+ ld $24,REGIDX(24)(k0)
+ ld $25,REGIDX(25)(k0)
+ /*ld $26,REGIDX(26)(k0) don't restore k0 */
+ ld $27,REGIDX(27)(k0)
+ ld $28,REGIDX(28)(k0)
+ ld $29,REGIDX(29)(k0)
+ ld $30,REGIDX(30)(k0)
+ ld $31,REGIDX(31)(k0)
+ .set at
+
+ j ra
+
+END(vapi_dumpgprs)
+
+
+/* *********************************************************************
+ * VAPI_SETLOG(start,end)
+ *
+ * Set the address of the log buffer. This call is required
+ * before any data will be stored in the log.
+ *
+ * Input parameters:
+ * a0 - start of log buffer, 64-bit aligned
+ * a1 - end of log buffer, 64-bit aligned
+ *
+ * Return value:
+ * nothing
+ *
+ * Registers used:
+ * k0 - scratch register for CFE
+ ********************************************************************* */
+
+LEAF(vapi_setlog)
+
+ SAVETEMPS(vapi_regsave)
+
+ sd a0,vapi_logstart
+ sd a0,vapi_logptr
+ sd a1,vapi_logend
+ sd zero,vapi_logover
+
+ RESTORETEMPS(vapi_regsave)
+
+ j ra
+
+END(vapi_setlog)
+
+/* *********************************************************************
+ * VAPI_LOGTRACE(id)
+ *
+ * Store a the contents of the trace buffer to the log
+ *
+ * Input parameters:
+ * a0 - low 32 bits are the ID code to store with the entry
+ * in the log.
+ *
+ * Return value:
+ * nothing
+ *
+ * Registers used:
+ * k0 - scratch register for CFE
+ ********************************************************************* */
+
+LEAF(vapi_logtrace)
+
+ j ra
+
+END(vapi_logtrace)
+
+
+/* *********************************************************************
+ * VAPI_LOGSINGLE(id,value)
+ *
+ * Store a single value in the log.
+ *
+ * Input parameters:
+ * a0 - low 32 bits are the ID code to store with the entry
+ * in the log.
+ * a1 - value to store in the log
+ *
+ * Return value:
+ * nothing
+ *
+ * Registers used:
+ * k0 - scratch register for CFE
+ ********************************************************************* */
+
+LEAF(vapi_logsingle)
+
+
+ SAVETEMPS(vapi_regsave)
+
+ CHECKPTR(99f)
+
+ SETRECTYPE(VAPI_FMT_DATA,a0)
+ SETRECLEN_CONST(1)
+
+ sd a1,VAPI_REC_DATA(RECPTR)
+
+ add RECPTR,32 # one record
+ sd RECPTR,vapi_logptr
+
+99: RESTORETEMPS(vapi_regsave)
+
+ j ra
+
+END(vapi_logsingle)
+
+/* *********************************************************************
+ * VAPI_LOGDATA(id,addr,cnt)
+ *
+ * Store multiple values in the log
+ *
+ * Input parameters:
+ * a0 - low 32 bits are the ID code to store with the entry
+ * in the log.
+ * a1 - Address of values to store in the log
+ * a2 - number of 64-bit values to store in the log
+ *
+ * Return value:
+ * nothing
+ *
+ * Registers used:
+ * k0 - scratch register for CFE
+ ********************************************************************* */
+
+LEAF(vapi_logdata)
+
+ SAVETEMPS(vapi_regsave)
+
+ CHECKPTR(99f)
+
+ SETRECTYPE(VAPI_FMT_BUFFER,a0)
+
+ add t1,RECPTR,VAPI_REC_DATA # a1 = ptr to data ara
+
+ sd a1,0(t1)
+ add t1,8
+
+ move k0,a2 # counter for words
+
+1: beq k0,zero,2f
+ ld t0,0(a1)
+ sd t0,0(t1)
+ add a1,8
+ add t1,8
+ sub k0,1
+ b 1b
+
+2: add k0,a2,1 # total number of words
+ SETRECLEN_REG(k0)
+ sll k0,k0,3 # number of words we wrote
+ add k0,24 # size of header
+ add RECPTR,k0
+ sd RECPTR,vapi_logptr
+
+99: RESTORETEMPS(vapi_regsave)
+
+ j ra
+
+END(vapi_logdata)
+
+
+/* *********************************************************************
+ * VAPI_SAVESOC(id)
+ *
+ * Save the SOC registers in the log
+ *
+ * Input parameters:
+ * a0 - low 32 bits are the ID code to store with the entry
+ * in the log
+ * a1 - bitmask of SOC agents to save
+ *
+ * Return value:
+ * nothing
+ *
+ * Registers used:
+ * k0 - scratch register for CFE
+ ********************************************************************* */
+
+LEAF(vapi_savesoc)
+
+ SAVETEMPS(vapi_regsave)
+
+ CHECKPTR(99f)
+
+ li t0,VAPI_CFESEAL | VAPI_FMT_SOC
+ dsll t0,t0,32
+ or t0,a0
+ mfc0 t1,C0_PRID
+ srl t1,t1,25
+ and t1,t1,7
+ sll t1,t1,VAPI_PRNUM_SHIFT
+ or t0,t0,t1
+ ld t1,vapi_logptr
+
+ sd t0,VAPI_REC_SIGNATURE(t1)
+ mfc0 t0,C0_COUNT
+ dsll t0,t0,32
+ sd t0,VAPI_REC_SIZE(t1)
+ sd ra,VAPI_REC_RA(t1)
+
+ move a2,zero # Counts how many we write
+
+ la t2,vapi_socregs
+
+1: lw t0,0(t2) # get flags
+ beq t0,zero,2f
+ and t0,t0,a1 # test flags
+ beq t0,zero,3f # skip if no flags set
+
+ lw t0,4(t2) # get address of register
+
+ sd t0,VAPI_REC_DATA(t1) # store address of register
+ add t1,8 # next destination addr
+ add a2,1 # count the words written
+
+ or t0,K1BASE # Make K1seg
+ ld t0,0(t0) # Read SOC register
+
+ sd t0,VAPI_REC_DATA(t1) # Store in log
+ add t1,8 # next destination addr
+ add a2,1 # count the words written
+
+3: add t2,8 # next reg from table
+
+ b 1b
+
+2: ld t0,vapi_logptr # get original pointer
+ ld a1,VAPI_REC_SIZE(t0) # Get C0_COUNT value
+ or a1,a2 # OR in the record size
+ sd a1,VAPI_REC_SIZE(t0) # put the record size back
+
+ add t1,24 # Account for extra fields in record
+ sd t1,vapi_logptr # Update the pointer
+
+99: RESTORETEMPS(vapi_regsave)
+
+ j ra
+
+END(vapi_savesoc)
+
+/* *********************************************************************
+ * VAPI_LOGGPRS(id)
+ *
+ * Save the general purpose registers and certain CP0 values
+ * in the log.
+ *
+ * Input parameters:
+ * a0 - low 32 bits are the ID code to store with the entry
+ * in the log
+ *
+ * Return value:
+ * nothing
+ *
+ * Registers used:
+ * k0 - scratch register for CFE
+ ********************************************************************* */
+
+#define REGLOG(x) (VAPI_REC_DATA+REGIDX(x))
+#define MAXREGS 57
+#define REGLOGMAX REGLOG(MAXREGS)
+
+LEAF(vapi_loggprs)
+
+ SAVETEMPS(vapi_regsave)
+ CHECKPTR(99f)
+
+ .set noat
+ ld k0,vapi_logptr
+ sd $0,REGLOG(0)(k0)
+ sd $1,REGLOG(1)(k0)
+ sd $2,REGLOG(2)(k0)
+ sd $3,REGLOG(3)(k0)
+ sd $4,REGLOG(4)(k0)
+ sd $5,REGLOG(5)(k0)
+ sd $6,REGLOG(6)(k0)
+ sd $7,REGLOG(7)(k0)
+ sd $8,REGLOG(8)(k0)
+ sd $9,REGLOG(9)(k0)
+ sd $10,REGLOG(10)(k0)
+ sd $11,REGLOG(11)(k0)
+ sd $12,REGLOG(12)(k0)
+ sd $13,REGLOG(13)(k0)
+ sd $14,REGLOG(14)(k0)
+ sd $15,REGLOG(15)(k0)
+ sd $16,REGLOG(16)(k0)
+ sd $17,REGLOG(17)(k0)
+ sd $18,REGLOG(18)(k0)
+ sd $19,REGLOG(19)(k0)
+ sd $20,REGLOG(20)(k0)
+ sd $21,REGLOG(21)(k0)
+ sd $22,REGLOG(22)(k0)
+ sd $23,REGLOG(23)(k0)
+ sd $24,REGLOG(24)(k0)
+ sd $25,REGLOG(25)(k0)
+ sd $26,REGLOG(26)(k0)
+ sd $27,REGLOG(27)(k0)
+ sd $28,REGLOG(28)(k0)
+ sd $29,REGLOG(29)(k0)
+ sd $30,REGLOG(30)(k0)
+ sd $31,REGLOG(31)(k0)
+ .set at
+
+
+# Save some CP0 registers here.
+#define SAVECP0(cp0,idx) \
+ dmfc0 t0,cp0 ; \
+ sd t0,REGLOG(idx)(k0)
+
+ SAVECP0(C0_INX,32)
+ SAVECP0(C0_RAND,33)
+ SAVECP0(C0_TLBLO0,34)
+ SAVECP0(C0_TLBLO1,35)
+ SAVECP0(C0_CTEXT,36)
+ SAVECP0(C0_PGMASK,37)
+ SAVECP0(C0_WIRED,38)
+ SAVECP0(C0_BADVADDR,39)
+ SAVECP0(C0_COUNT,40)
+ SAVECP0(C0_TLBHI,41)
+ SAVECP0(C0_COMPARE,42)
+ SAVECP0(C0_SR,43)
+ SAVECP0(C0_CAUSE,44)
+ SAVECP0(C0_EPC,45)
+ SAVECP0(C0_PRID,46)
+ SAVECP0(C0_CONFIG,47)
+ SAVECP0(C0_LLADDR,48)
+ SAVECP0(C0_WATCHLO,49)
+ SAVECP0(C0_WATCHHI,50)
+ SAVECP0(C0_XCTEXT,51)
+ SAVECP0(C0_ECC,52)
+ SAVECP0(C0_CACHEERR,53)
+ SAVECP0(C0_TAGLO,54)
+ SAVECP0(C0_TAGHI,55)
+ SAVECP0(C0_ERREPC,56)
+
+ SETRECTYPE(VAPI_FMT_GPRS,a0)
+ SETRECLEN_CONST(MAXREGS)
+ add RECPTR,REGLOGMAX
+ sd RECPTR,vapi_logptr
+
+99: RESTORETEMPS(vapi_regsave)
+
+ j ra # go home
+
+END(vapi_loggprs)
+
+
+/* *********************************************************************
+ * VAPI_LOGFPRS(id)
+ *
+ * Save the floating point unit's registers
+ * in the log.
+ *
+ * Input parameters:
+ * a0 - low 32 bits are the ID code to store with the entry
+ * in the log
+ *
+ * Return value:
+ * nothing
+ *
+ * Registers used:
+ * k0 - scratch register for CFE
+ ********************************************************************* */
+
+
+#define SAVEFPR(cp1,idx) \
+ dmfc1 t0,cp1 ; \
+ sd t0,FPREGLOG(idx)(k0)
+#define SAVECP1(cp1,idx) \
+ cfc1 t0,cp1 ; \
+ sd t0,FPREGLOG(idx)(k0)
+
+#define FPREGLOG(x) (VAPI_REC_DATA+REGIDX(x))
+#define FPMAXREGS 37
+#define FPREGLOGMAX FPREGLOG(FPMAXREGS)
+
+LEAF(vapi_logfprs)
+
+ SAVETEMPS(vapi_regsave)
+ CHECKPTR(99f)
+
+ ld k0,vapi_logptr
+ SAVEFPR($0,0)
+ SAVEFPR($1,1)
+ SAVEFPR($2,2)
+ SAVEFPR($3,3)
+ SAVEFPR($4,4)
+ SAVEFPR($5,5)
+ SAVEFPR($6,6)
+ SAVEFPR($7,7)
+ SAVEFPR($8,8)
+ SAVEFPR($9,9)
+ SAVEFPR($10,10)
+ SAVEFPR($11,11)
+ SAVEFPR($12,12)
+ SAVEFPR($13,13)
+ SAVEFPR($14,14)
+ SAVEFPR($15,15)
+ SAVEFPR($16,16)
+ SAVEFPR($17,17)
+ SAVEFPR($18,18)
+ SAVEFPR($19,19)
+ SAVEFPR($20,20)
+ SAVEFPR($21,21)
+ SAVEFPR($22,22)
+ SAVEFPR($23,23)
+ SAVEFPR($24,24)
+ SAVEFPR($25,25)
+ SAVEFPR($26,26)
+ SAVEFPR($27,27)
+ SAVEFPR($28,28)
+ SAVEFPR($29,29)
+ SAVEFPR($30,30)
+ SAVEFPR($31,31)
+
+ SAVECP1($0,32) /* FIR */
+ SAVECP1($31,33) /* Status */
+ SAVECP1($25,34) /* condition codes */
+ SAVECP1($26,35) /* Exceptions */
+ SAVECP1($28,36) /* enables */
+
+ SETRECTYPE(VAPI_FMT_FPRS,a0)
+ SETRECLEN_CONST(FPMAXREGS)
+ add RECPTR,FPREGLOGMAX
+ sd RECPTR,vapi_logptr
+
+99: RESTORETEMPS(vapi_regsave)
+
+ j ra # go home
+
+END(vapi_logfprs)
+
+/* *********************************************************************
+ * VAPI_PUTS(string)
+ *
+ * Display a string on the console
+ *
+ * Input parameters:
+ * a0 - pointer to null-terminated string
+ *
+ * Return value:
+ * nothing
+ *
+ * Registers used:
+ * k0 - scratch register for CFE
+ ********************************************************************* */
+
+LEAF(vapi_puts)
+
+ .set noat
+ la k0,vapi_regsave
+ sd $0,REGIDX(0)(k0)
+ sd $1,REGIDX(1)(k0)
+ sd $2,REGIDX(2)(k0)
+ sd $3,REGIDX(3)(k0)
+ sd $4,REGIDX(4)(k0)
+ sd $5,REGIDX(5)(k0)
+ sd $6,REGIDX(6)(k0)
+ sd $7,REGIDX(7)(k0)
+ sd $8,REGIDX(8)(k0)
+ sd $9,REGIDX(9)(k0)
+ sd $10,REGIDX(10)(k0)
+ sd $11,REGIDX(11)(k0)
+ sd $12,REGIDX(12)(k0)
+ sd $13,REGIDX(13)(k0)
+ sd $14,REGIDX(14)(k0)
+ sd $15,REGIDX(15)(k0)
+ sd $16,REGIDX(16)(k0)
+ sd $17,REGIDX(17)(k0)
+ sd $18,REGIDX(18)(k0)
+ sd $19,REGIDX(19)(k0)
+ sd $20,REGIDX(20)(k0)
+ sd $21,REGIDX(21)(k0)
+ sd $22,REGIDX(22)(k0)
+ sd $23,REGIDX(23)(k0)
+ sd $24,REGIDX(24)(k0)
+ sd $25,REGIDX(25)(k0)
+ sd $26,REGIDX(26)(k0) /* k0 */
+ sd $27,REGIDX(27)(k0)
+ sd $28,REGIDX(28)(k0)
+ sd $29,REGIDX(29)(k0)
+ sd $30,REGIDX(30)(k0)
+ sd $31,REGIDX(31)(k0)
+ .set at
+
+ la gp,_gp
+ LR sp,mem_heapstart
+ ADD sp,((CFG_HEAP_SIZE*1024)+STACK_SIZE - 8)
+ jal vapi_doputs /* dump registers in 'C' */
+
+ .set noat
+ la k0,vapi_regsave
+ ld $1,REGIDX(1)(k0)
+ ld $2,REGIDX(2)(k0)
+ ld $3,REGIDX(3)(k0)
+ ld $4,REGIDX(4)(k0)
+ ld $5,REGIDX(5)(k0)
+ ld $6,REGIDX(6)(k0)
+ ld $7,REGIDX(7)(k0)
+ ld $8,REGIDX(8)(k0)
+ ld $9,REGIDX(9)(k0)
+ ld $10,REGIDX(10)(k0)
+ ld $11,REGIDX(11)(k0)
+ ld $12,REGIDX(12)(k0)
+ ld $13,REGIDX(13)(k0)
+ ld $14,REGIDX(14)(k0)
+ ld $15,REGIDX(15)(k0)
+ ld $16,REGIDX(16)(k0)
+ ld $17,REGIDX(17)(k0)
+ ld $18,REGIDX(18)(k0)
+ ld $19,REGIDX(19)(k0)
+ ld $20,REGIDX(20)(k0)
+ ld $21,REGIDX(21)(k0)
+ ld $22,REGIDX(22)(k0)
+ ld $23,REGIDX(23)(k0)
+ ld $24,REGIDX(24)(k0)
+ ld $25,REGIDX(25)(k0)
+ /*ld $26,REGIDX(26)(k0) don't restore k0 */
+ ld $27,REGIDX(27)(k0)
+ ld $28,REGIDX(28)(k0)
+ ld $29,REGIDX(29)(k0)
+ ld $30,REGIDX(30)(k0)
+ ld $31,REGIDX(31)(k0)
+ .set at
+
+ j ra
+
+END(vapi_puts)
+
+/* *********************************************************************
+ * VAPI_SETLEDS(leds)
+ *
+ * Set the onboard LEDS on the swarm board.
+ *
+ * Input parameters:
+ * a0 - LED value, "ABCD" is 0x41424344
+ *
+ * Return value:
+ * nothing
+ *
+ * Registers used:
+ * k0 - scratch register for CFE
+ ********************************************************************* */
+
+
+LEAF(vapi_setleds)
+
+ SAVETEMPS(vapi_regsave)
+
+ jal board_setleds
+
+ RESTORETEMPS(vapi_regsave)
+
+ j ra
+
+END(vapi_setleds)
+
+/* *********************************************************************
+ * VAPI_KSEG1_SWITCH
+ *
+ * Hack the return address so we will come back in KSEG1 (uncached)
+ *
+ * Input parameters:
+ * nothing
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+LEAF(vapi_kseg1_switch)
+
+ and ra,(K0SIZE-1)
+ or ra,K1BASE
+ jr ra
+
+END(vapi_kseg1_switch)
+
+
+/* *********************************************************************
+ * VAPI_RUN()
+ *
+ * Jump to the diagnostic program, which must be loaded at the
+ * special address (typically 8002_0000). First we flush the
+ * cache, then set magic #'s in the mailbox. Finally, the core
+ * is reset. On restart, we do minimal initialization and jump
+ * directly to the diagnostic.
+ *
+ * Input parameters:
+ * a0 - nonzero to restart uncached.
+ *
+ * Return value:
+ * nothing
+ ********************************************************************* */
+
+LEAF(vapi_run)
+
+ /*
+ * Run uncached
+ */
+
+ bal vapi_kseg1_switch # now running in KSEG1
+
+ /*
+ * Flush the caches
+ */
+
+ move s0,a0 # L2 flush trashes A0
+ CALLKSEG1(sb1250_l1cache_flush_d)
+ CALLKSEG1(sb1250_l1cache_inval_i)
+ CALLKSEG1(sb1250_l2cache_flush)
+ move a0,s0
+
+#ifdef _P5064_
+
+ /* In the case of the P5064, just jump directly to the entry point */
+
+ li t0,VAPI_DIAG_ENTRY
+ j t0
+
+#else
+
+ /*
+ * Set the magic code in the mailbox.
+ */
+
+ li t0,-1
+ la t1,PHYS_TO_K1(A_IMR_REGISTER(0,R_IMR_MAILBOX_CLR_CPU))
+ sd t0,0(t1)
+
+ dli t0,VAPI_MAGIC_NUMBER
+ beq a0,0,1f
+ dli t0,VAPI_MAGIC_NUMBER_UNC
+ beq a0,1,1f
+ dli t0,VAPI_MAGIC_NUMBER_MC
+1: la t1,PHYS_TO_K1(A_IMR_REGISTER(0,R_IMR_MAILBOX_SET_CPU))
+ sd t0,0(t1)
+
+ /*
+ * Whack the reset line.
+ */
+#if defined(_PTSWARM_)
+ li k0,PHYS_TO_K1(0x1B0A0000+32+8*3)
+#else
+ li k0,PHYS_TO_K1(0x100A0000+32+8*3)
+#endif
+ li k1,'!'
+
+ li t1,PHYS_TO_K1(A_SCD_SYSTEM_CFG)
+ ld t2,0(t1)
+ dli t0,M_SYS_CPU_RESET_0 | M_SYS_CPU_RESET_1
+ or t2,t2,t0
+ bal vapi_kseg0_switch
+ .align 5
+#if defined(_CSWARM_) || defined(_SWARM_) || defined(_PTSWARM_)
+ sb k1,0(k0)
+#else
+ nop
+#endif
+ sync /* flush the write buffer */
+ sd t2,0(t1)
+1: b 1b
+
+ /*
+ * And he never returned, no he never returned... and his fate
+ * is still unknown, he will ride forever 'neath the cycles of
+ * the SB1, he's the core that never returned!
+ */
+#endif
+
+
+
+END(vapi_run)
+
+
+LEAF(vapi_flushtest)
+
+ move s1,ra
+
+ /*
+ * Run uncached
+ */
+
+ bal vapi_kseg1_switch # now running in KSEG1
+
+ /*
+ * Flush the caches
+ */
+
+ move s0,a0 # L2 flush trashes A0
+ CALLKSEG1(sb1250_l1cache_flush_d)
+ CALLKSEG1(sb1250_l1cache_inval_i)
+ CALLKSEG1(sb1250_l2cache_flush)
+ move a0,s0
+
+ /*
+ * Back to cached
+ */
+
+ bal vapi_kseg0_switch # now running in KSEG1
+
+ move ra,s1
+ j ra
+
+END(vapi_flushtest)
+
+
+#endif /* CFG_VAPI */
+
+/* *********************************************************************
+ * End
+ ********************************************************************* */
+
+
diff --git a/cfe/cfe/verif/vapi.h b/cfe/cfe/verif/vapi.h
new file mode 100644
index 0000000..1deb8a5
--- /dev/null
+++ b/cfe/cfe/verif/vapi.h
@@ -0,0 +1,242 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Verification Test APIs File: vapi.h
+ *
+ * This module contains special low-level routines for use
+ * by verification programs.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#define VAPI_EPTSEAL 0x56415049
+#define VAPI_CFESEAL 0xCFE10000
+#define VAPI_SEAL_MASK 0xFFFF0000
+#define VAPI_FMT_MASK 0x000000FF
+#define VAPI_PRID_MASK 0x0000FF00
+
+#define VAPI_DIAG_ENTRY 0x80020000
+#define VAPI_DIAG_ENTRY_UNC 0xA0020000
+#define VAPI_DIAG_ENTRY_MC 0xBFD00000
+#define VAPI_MAGIC_NUMBER 0x1CFE2CFE3CFE4CFE
+#define VAPI_MAGIC_NUMBER_UNC 0x0CFE1CFE2CFE3CFE
+#define VAPI_MAGIC_NUMBER_MC 0xACFEBCFECCFEDCFE
+
+#define VAPI_FMT_GPRS 0
+#define VAPI_FMT_SOC 1
+#define VAPI_FMT_DATA 2
+#define VAPI_FMT_BUFFER 3
+#define VAPI_FMT_TRACE 4
+#define VAPI_FMT_EXIT 5
+#define VAPI_FMT_FPRS 6
+
+#define VAPI_PRNUM_SHIFT 8
+
+#define VAPI_REC_SIGNATURE 0
+#define VAPI_REC_SIZE 8
+#define VAPI_REC_RA 16
+#define VAPI_REC_DATA 24
+
+#define VAPI_IDX_SIGNATURE 0
+#define VAPI_IDX_SIZE 1
+#define VAPI_IDX_RA 2
+#define VAPI_IDX_DATA 3
+
+
+#define VAPI_FUNC_EXIT 0x9fc00510
+#define VAPI_FUNC_DUMPGPRS 0x9fc00520
+#define VAPI_FUNC_SETLOG 0x9fc00530
+#define VAPI_FUNC_LOGVALUE 0x9fc00540
+#define VAPI_FUNC_LOGDATA 0x9fc00550
+#define VAPI_FUNC_LOGTRACE 0x9fc00560
+#define VAPI_FUNC_LOGSOC 0x9fc00570
+#define VAPI_FUNC_LOGGPRS 0x9fc00580
+#define VAPI_FUNC_DUMPSTRING 0x9fc00590
+#define VAPI_FUNC_SETLEDS 0x9fc005a0
+#define VAPI_FUNC_LOGFPRS 0x9fc005b0
+
+
+#define VAPI_LOG_SETBUF(start,end) \
+ .set push ; \
+ .set reorder ; \
+ la a0, start ; \
+ la a1, end ; \
+ li k0, VAPI_FUNC_SETLOG ; \
+ jalr k0 ; \
+ .set pop
+
+#define VAPI_EXIT_CONST(val) \
+ .set push ; \
+ .set reorder ; \
+ li a0, val ; \
+ li k0, VAPI_FUNC_EXIT ; \
+ jr k0 ; \
+ .set pop
+
+#define VAPI_EXIT_REG(val) \
+ .set push ; \
+ .set reorder ; \
+ move a0, val ; \
+ li k0, VAPI_FUNC_EXIT ; \
+ jr k0 ; \
+ .set pop
+
+#define VAPI_LOG_CONST(id,value) \
+ .set push ; \
+ .set reorder ; \
+ li a0, id ; \
+ li a1, value ; \
+ li k0, VAPI_FUNC_LOGVALUE ; \
+ jalr k0 ; \
+ .set pop
+
+#define VAPI_LOG_REG(id,value) \
+ .set push ; \
+ .set reorder ; \
+ li a0, id ; \
+ move a1, value ; \
+ li k0, VAPI_FUNC_LOGVALUE ; \
+ jalr k0 ; \
+ .set pop
+
+#define VAPI_LOG_BUFFER(id,addr,nwords) \
+ .set push ; \
+ .set reorder ; \
+ li a0,id ; \
+ la a1,addr ; \
+ li a2,nwords ; \
+ li k0, VAPI_FUNC_LOGDATA ; \
+ jalr k0 ; \
+ .set pop
+
+#define VAPI_PUTS(text) \
+ .set push ; \
+ .set reorder ; \
+ b 1f ; \
+2: .asciz text ; \
+ .align 4 ; \
+1: la a0, 2b ; \
+ li k0, VAPI_FUNC_DUMPSTRING ; \
+ jalr k0 ; \
+ .set pop
+
+#define VAPI_PRINTGPRS() \
+ .set push ; \
+ .set reorder ; \
+ li k0, VAPI_FUNC_DUMPGPRS ; \
+ jalr k0 ; \
+ .set pop
+
+#define VAPI_LOG_GPRS(id) \
+ .set push ; \
+ .set reorder ; \
+ li a0, id ; \
+ li k0, VAPI_FUNC_LOGGPRS ; \
+ jalr k0 ; \
+ .set pop
+
+#define VAPI_LOG_FPRS(id) \
+ .set push ; \
+ .set reorder ; \
+ li a0, id ; \
+ li k0, VAPI_FUNC_LOGFPRS ; \
+ jalr k0 ; \
+ .set pop
+
+#define VAPI_LOG_TRACE(id) \
+ .set push ; \
+ .set reorder ; \
+ li a0, id ; \
+ li k0, VAPI_FUNC_LOGTRACE ; \
+ jalr k0 ; \
+ .set pop
+
+#define VAPI_LOG_SOCSTATE(id,bits) \
+ .set push ; \
+ .set reorder ; \
+ li a0, id ; \
+ li a1, bits ; \
+ li k0, VAPI_FUNC_LOGSOC ; \
+ jalr k0 ; \
+ .set pop
+
+#define VAPI_SETLEDS(a,b,c,d) \
+ .set push ; \
+ .set reorder ; \
+ li a0, ((a) << 24) | ((b) << 16) | ((c) << 8) | (d) ; \
+ li k0, VAPI_FUNC_SETLEDS ; \
+ jalr k0 ; \
+ .set pop
+
+#ifndef SOC_AGENT_MC0
+#define SOC_AGENT_MC0 0x00000001
+#define SOC_AGENT_MC1 0x00000002
+#define SOC_AGENT_MC 0x00000003
+#define SOC_AGENT_L2 0x00000004
+#define SOC_AGENT_MACDMA0 0x00000008
+#define SOC_AGENT_MACDMA1 0x00000010
+#define SOC_AGENT_MACDMA2 0x00000020
+#define SOC_AGENT_MACDMA 0x00000038
+#define SOC_AGENT_MACRMON0 0x00000040
+#define SOC_AGENT_MACRMON1 0x00000080
+#define SOC_AGENT_MACRMON2 0x00000100
+#define SOC_AGENT_MACRMON 0x000001C0
+#define SOC_AGENT_MAC0 0x00000200
+#define SOC_AGENT_MAC1 0x00000400
+#define SOC_AGENT_MAC2 0x00000800
+#define SOC_AGENT_MAC 0x00000E00
+#define SOC_AGENT_DUART 0x00001000
+#define SOC_AGENT_GENCS 0x00002000
+#define SOC_AGENT_GEN 0x00004000
+#define SOC_AGENT_GPIO 0x00008000
+#define SOC_AGENT_SMBUS0 0x00010000
+#define SOC_AGENT_SMBUS1 0x00020000
+#define SOC_AGENT_SMBUS 0x00030000
+#define SOC_AGENT_TIMER 0x00040000
+#define SOC_AGENT_SCD 0x00080000
+#define SOC_AGENT_BUSERR 0x00100000
+#define SOC_AGENT_DM 0x00200000
+#define SOC_AGENT_IMR0 0x00400000
+#define SOC_AGENT_IMR1 0x00800000
+#define SOC_AGENT_IMR 0x00C00000
+#endif
+
+
+
diff --git a/cfe/cfe/verif/vapisubr.c b/cfe/cfe/verif/vapisubr.c
new file mode 100644
index 0000000..1ec130a
--- /dev/null
+++ b/cfe/cfe/verif/vapisubr.c
@@ -0,0 +1,122 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Verification Test APIs File: vapisubr.c
+ *
+ * This module contains special low-level routines for use
+ * by verification programs. The routines here are the "C"
+ * routines for higher-level functions.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "sbmips.h"
+#include "bsp_config.h"
+#include "lib_types.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "cfe_console.h"
+
+#if CFG_VAPI
+
+void vapi_doputs(char *str);
+void vapi_dodumpregs(uint64_t *gprs);
+
+const static char * const gpregnames[] = {
+ "$0/zero","$1/AT","$2/v0","$3/v1","$4/a0","$5/a1","$6/a2","$7/a3",
+ "$8/t0","$9/t1","$10/t2","$11/t3","$12/t4","$13/t5","$14/t6","$15/t7",
+ "$16/s0","$17/s1","$18/s2","$19/s3","$20/s4","$21/s5","$22/s6","$23/s7",
+ "$24/t8","$25/t9","$26/k0","$27/k1","$28/gp","$29/sp","$30/fp","$31/ra",
+ "INX",
+ "RAND",
+ "TLBLO0",
+ "TLBLO1",
+ "CTEXT",
+ "PGMASK",
+ "WIRED",
+ "BADVADDR",
+ "COUNT",
+ "TLBHI",
+ "COMPARE",
+ "SR",
+ "CAUSE",
+ "EPC",
+ "PRID",
+ "CONFIG",
+ "LLADDR",
+ "WATCHLO",
+ "WATCHHI",
+ "XCTEXT",
+ "ECC",
+ "CACHEERR",
+ "TAGLO",
+ "TAGHI",
+ "ERREPC"};
+
+
+
+
+void vapi_doputs(char *str)
+{
+ xprintf("# %s\n",str);
+}
+
+void vapi_dodumpregs(uint64_t *gprs)
+{
+ int cnt = sizeof(gpregnames)/sizeof(char *);
+ int idx;
+
+ xprintf("# GPRS:\n");
+ for (idx = 0; idx < cnt; idx++) {
+ if ((idx & 1) == 0) xprintf("# ");
+ xprintf(" %8s=%016llX ",gpregnames[idx],gprs[idx]);
+ if ((idx & 1) == 1) xprintf("\n");
+ }
+ xprintf("\n");
+
+}
+
+#endif /* CFG_VAPI */
+
+/* *********************************************************************
+ * End
+ ********************************************************************* */
+
+
diff --git a/cfe/cfe/verif/vapitest.S b/cfe/cfe/verif/vapitest.S
new file mode 100644
index 0000000..4199f4e
--- /dev/null
+++ b/cfe/cfe/verif/vapitest.S
@@ -0,0 +1,108 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Verification Test APIs File: vapitest.S
+ *
+ * This module contains special low-level routines for use
+ * by verification programs.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "sbmips.h"
+#include "bsp_config.h"
+
+#if CFG_VAPI
+
+#if (CFG_EMBEDDED_PIC)
+#error "CFG_VAPI is not compatible with relocatable code"
+#endif
+
+
+#include "vapi.h"
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+ .text
+
+testbuf: .dword 0x123456789ABCDEF0
+ .dword 0xAABBCCDD
+ .dword 0xAABBCCDD
+ .dword 0xAABBCCDD
+ .dword 0xAABBCCDD
+ .dword 0xAABBCCDD
+ .dword 0xAABBCCDD
+ .dword 0xAABBCCDD
+ .dword 0xAABBCCDD
+ .dword 0xFEDCBA9876543210
+
+LEAF(vapitest)
+
+ sub sp,8
+ sd ra,0(sp)
+
+ VAPI_LOG_SETBUF(0x80200000,0x80300000)
+
+
+ VAPI_LOG_CONST(0x100,0xABCDEF)
+ VAPI_LOG_REG(0x101,sp)
+ VAPI_LOG_BUFFER(0x102,testbuf,10)
+ VAPI_PUTS("Hello world.\n")
+ VAPI_LOG_SOCSTATE(0x103,SOC_AGENT_DUART)
+ VAPI_PRINTGPRS();
+ VAPI_LOG_CONST(0x1EE,0xEEEEEEEE)
+ VAPI_LOG_GPRS(0x199)
+ VAPI_SETLEDS('V','A','P','I')
+
+ ld ra,0(sp)
+ add sp,8
+ j ra
+
+END(vapitest)
+
+
+#endif /* CFG_VAPI */
+
+/* *********************************************************************
+ * End
+ ********************************************************************* */
+
+
diff --git a/cfe/cfe/x86emu/LICENSE b/cfe/cfe/x86emu/LICENSE
new file mode 100644
index 0000000..a3ede4a
--- /dev/null
+++ b/cfe/cfe/x86emu/LICENSE
@@ -0,0 +1,17 @@
+ License information
+ -------------------
+
+The x86emu library is under a BSD style license, comaptible
+with the XFree86 and X licenses used by XFree86. The
+original x86emu libraries were under the GNU General Public
+License. Due to license incompatibilities between the GPL
+and the XFree86 license, the original authors of the code
+decided to allow a license change. If you have submitted
+code to the original x86emu project, and you don't agree
+with the license change, please contact us and let you
+know. Your code will be removed to comply with your wishes.
+
+If you have any questions about this, please send email to
+x86emu@linuxlabs.com or KendallB@scitechsoft.com for
+clarification.
+
diff --git a/cfe/cfe/x86emu/Makefile b/cfe/cfe/x86emu/Makefile
new file mode 100644
index 0000000..6b02c1a
--- /dev/null
+++ b/cfe/cfe/x86emu/Makefile
@@ -0,0 +1,2 @@
+
+ALLOBJS += debug.o decode.o fpu.o ops.o ops2.o prim_ops.o sys.o
diff --git a/cfe/cfe/x86emu/README b/cfe/cfe/x86emu/README
new file mode 100644
index 0000000..c7351ba
--- /dev/null
+++ b/cfe/cfe/x86emu/README
@@ -0,0 +1,12 @@
+
+This is a simple X86 emulator. The original source for this
+was taken from the XFree86 project. This code is used to
+interpret the X86 instructions in the ROM on the VGA
+adapter to initialize the card to text mode. Once initialized,
+this emulator is no longer needed.
+
+** Read the 'LICENSE' file before using this in production code **
+
+The XFree86 license is similar to the BSD license.
+
+
diff --git a/cfe/cfe/x86emu/debug.c b/cfe/cfe/x86emu/debug.c
new file mode 100644
index 0000000..3e26a50
--- /dev/null
+++ b/cfe/cfe/x86emu/debug.c
@@ -0,0 +1,462 @@
+/****************************************************************************
+*
+* Realmode X86 Emulator Library
+*
+* Copyright (C) 1996-1999 SciTech Software, Inc.
+* Copyright (C) David Mosberger-Tang
+* Copyright (C) 1999 Egbert Eich
+*
+* ========================================================================
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee,
+* provided that the above copyright notice appear in all copies and that
+* both that copyright notice and this permission notice appear in
+* supporting documentation, and that the name of the authors not be used
+* in advertising or publicity pertaining to distribution of the software
+* without specific, written prior permission. The authors makes no
+* representations about the suitability of this software for any purpose.
+* It is provided "as is" without express or implied warranty.
+*
+* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+* PERFORMANCE OF THIS SOFTWARE.
+*
+* ========================================================================
+*
+* Language: ANSI C
+* Environment: Any
+* Developer: Kendall Bennett
+*
+* Description: This file contains the code to handle debugging of the
+* emulator.
+*
+****************************************************************************/
+/* $XFree86: xc/extras/x86emu/src/x86emu/debug.c,v 1.4 2000/04/17 16:29:45 eich Exp $ */
+
+#include "x86emu/x86emui.h"
+#ifdef IN_MODULE
+#include "xf86_ansic.h"
+#else
+#include <stdarg.h>
+#ifndef _CFE_
+#include <stdlib.h>
+#endif
+#endif
+
+#ifdef _CFE_
+#include "cfe_console.h"
+#endif
+
+
+/*----------------------------- Implementation ----------------------------*/
+
+#ifdef DEBUG
+
+static void print_encoded_bytes (u16 s, u16 o);
+static void print_decoded_instruction (void);
+static int parse_line (char *s, int *ps, int *n);
+
+/* should look something like debug's output. */
+void X86EMU_trace_regs (void)
+{
+ if (DEBUG_TRACE()) {
+ x86emu_dump_regs();
+ }
+ if (DEBUG_DECODE() && ! DEBUG_DECODE_NOPRINT()) {
+ printk("%04x:%04x ",M.x86.saved_cs, M.x86.saved_ip);
+ print_encoded_bytes( M.x86.saved_cs, M.x86.saved_ip);
+ print_decoded_instruction();
+ }
+}
+
+void X86EMU_trace_xregs (void)
+{
+ if (DEBUG_TRACE()) {
+ x86emu_dump_xregs();
+ }
+}
+
+void x86emu_just_disassemble (void)
+{
+ /*
+ * This routine called if the flag DEBUG_DISASSEMBLE is set kind
+ * of a hack!
+ */
+ printk("%04x:%04x ",M.x86.saved_cs, M.x86.saved_ip);
+ print_encoded_bytes( M.x86.saved_cs, M.x86.saved_ip);
+ print_decoded_instruction();
+}
+
+static u16 disassemble_forward (u16 seg, u16 off, int n)
+{
+ X86EMU_sysEnv tregs;
+ int i;
+ u8 op1;
+ u16 finaloffset;
+ /*
+ * hack, hack, hack. What we do is use the exact machinery set up
+ * for execution, except that now there is an additional state
+ * flag associated with the "execution", and we are using a copy
+ * of the register struct. All the major opcodes, once fully
+ * decoded, have the following two steps: TRACE_REGS(r,m);
+ * SINGLE_STEP(r,m); which disappear if DEBUG is not defined to
+ * the preprocessor. The TRACE_REGS macro expands to:
+ *
+ * if (debug&DEBUG_DISASSEMBLE)
+ * {just_disassemble(); goto EndOfInstruction;}
+ * if (debug&DEBUG_TRACE) trace_regs(r,m);
+ *
+ * ...... and at the last line of the routine.
+ *
+ * EndOfInstruction: end_instr();
+ *
+ * Up to the point where TRACE_REG is expanded, NO modifications
+ * are done to any register EXCEPT the IP register, for fetch and
+ * decoding purposes.
+ *
+ * This was done for an entirely different reason, but makes a
+ * nice way to get the system to help debug codes.
+ */
+ tregs = M;
+ M.x86.R_IP = off;
+ M.x86.R_CS = seg;
+ M.x86.saved_ip = off;
+ M.x86.saved_cs = seg;
+
+ /* reset the decoding buffers */
+ M.x86.enc_str_pos = 0;
+ M.x86.enc_pos = 0;
+
+ /* turn on the "disassemble only, no execute" flag */
+ M.x86.debug |= DEBUG_DISASSEMBLE_F;
+
+ /* DUMP NEXT n instructions to screen in straight_line fashion */
+ /*
+ * This looks like the regular instruction fetch stream, except
+ * that when this occurs, each fetched opcode, upon seeing the
+ * DEBUG_DISASSEMBLE flag set, exits immediately after decoding
+ * the instruction. XXX --- CHECK THAT MEM IS NOT AFFECTED!!!
+ * Note the use of a copy of the register structure...
+ */
+ for (i=0; i<n; i++) {
+ op1 = (*sys_rdb)(((u32)M.x86.R_CS<<4) + (M.x86.R_IP++));
+ INC_DECODED_INST_LEN(1);
+ (x86emu_optab[op1])(op1);
+ M.x86.saved_ip = M.x86.R_IP;
+ }
+ finaloffset = M.x86.R_IP;
+ M = tregs;
+ /* end major hack mode. */
+ return finaloffset;
+}
+
+void x86emu_check_ip_access (void)
+{
+ /* NULL as of now */
+}
+
+void x86emu_check_sp_access (void)
+{
+}
+
+void x86emu_check_mem_access (u32 dummy)
+{
+ /* check bounds, etc */
+}
+
+void x86emu_check_data_access (uint dummy1, uint dummy2)
+{
+ /* check bounds, etc */
+}
+
+void x86emu_inc_decoded_inst_len (int x)
+{
+ M.x86.enc_pos += x;
+}
+
+void x86emu_decode_printf (char *x)
+{
+ sprintf(M.x86.decoded_buf+M.x86.enc_str_pos,"%s",x);
+ M.x86.enc_str_pos += strlen(x);
+}
+
+void x86emu_decode_printf2 (char *x, int y)
+{
+ char temp[100];
+ sprintf(temp,x,y);
+ sprintf(M.x86.decoded_buf+M.x86.enc_str_pos,"%s",temp);
+ M.x86.enc_str_pos += strlen(temp);
+}
+
+void x86emu_end_instr (void)
+{
+ M.x86.enc_str_pos = 0;
+ M.x86.enc_pos = 0;
+}
+
+static void print_encoded_bytes (u16 s, u16 o)
+{
+ int i;
+ char buf1[64];
+ buf1[0] = 0;
+ for (i=0; i< M.x86.enc_pos; i++) {
+ sprintf(buf1+2*i,"%02x", fetch_data_byte_abs(s,o+i));
+ }
+ printk("%-20s",buf1);
+}
+
+static void print_decoded_instruction (void)
+{
+ printk("%s", M.x86.decoded_buf);
+}
+
+void x86emu_print_int_vect (u16 iv)
+{
+ u16 seg,off;
+
+ if (iv > 256) return;
+ seg = fetch_data_word_abs(0,iv*4);
+ off = fetch_data_word_abs(0,iv*4+2);
+ printk("%04x:%04x ", seg, off);
+}
+
+void X86EMU_dump_memory (u16 seg, u16 off, u32 amt)
+{
+ u32 start = off & 0xfffffff0;
+ u32 end = (off+16) & 0xfffffff0;
+ u32 i;
+ u32 current;
+
+ current = start;
+ while (end <= off + amt) {
+ printk("%04x:%04x ", seg, start);
+ for (i=start; i< off; i++)
+ printk(" ");
+ for ( ; i< end; i++)
+ printk("%02x ", fetch_data_byte_abs(seg,i));
+ printk("\n");
+ start = end;
+ end = start + 16;
+ }
+}
+
+void x86emu_single_step (void)
+{
+ char s[1024];
+ int ps[10];
+ int ntok;
+ int cmd;
+ int done;
+ int segment;
+ int offset;
+ static int breakpoint;
+ static int noDecode = 1;
+
+ char *p;
+
+ if (DEBUG_BREAK()) {
+ if (M.x86.saved_ip != breakpoint) {
+ return;
+ }
+ else {
+ M.x86.debug &= ~DEBUG_DECODE_NOPRINT_F;
+ M.x86.debug |= DEBUG_TRACE_F;
+ M.x86.debug &= ~DEBUG_BREAK_F;
+ print_decoded_instruction ();
+ X86EMU_trace_regs();
+ }
+ }
+ done=0;
+ offset = M.x86.saved_ip;
+ while (!done) {
+#ifdef _CFE_
+ cmd = console_readline("-",s,1023);
+ if (cmd) { s[cmd] = '\n'; s[cmd+1] = 0;}
+ p = s;
+#else
+ printk("-");
+ p = fgets(s, 1023, stdin);
+#endif
+ cmd = parse_line(s, ps, &ntok);
+ switch(cmd) {
+ case 'u':
+ if (ntok == 2) { offset = ps[1]; }
+ offset = disassemble_forward(M.x86.saved_cs,(u16)offset,10);
+ break;
+ case 'd':
+ if (ntok == 2) {
+ segment = M.x86.saved_cs;
+ offset = ps[1];
+ X86EMU_dump_memory(segment,(u16)offset,16);
+ offset += 16;
+ } else if (ntok == 3) {
+ segment = ps[1];
+ offset = ps[2];
+ X86EMU_dump_memory(segment,(u16)offset,16);
+ offset += 16;
+ } else {
+ segment = M.x86.saved_cs;
+ X86EMU_dump_memory(segment,(u16)offset,16);
+ offset += 16;
+ }
+ break;
+ case 'c':
+ M.x86.debug ^= DEBUG_TRACECALL_F;
+ break;
+ case 's':
+ M.x86.debug ^= DEBUG_SVC_F | DEBUG_SYS_F | DEBUG_SYSINT_F;
+ break;
+ case 'r':
+ X86EMU_trace_regs();
+ break;
+ case 'x':
+ X86EMU_trace_xregs();
+ break;
+ case 'g':
+ if (ntok == 2) {
+ breakpoint = ps[1];
+ if (noDecode) {
+ M.x86.debug |= DEBUG_DECODE_NOPRINT_F;
+ } else {
+ M.x86.debug &= ~DEBUG_DECODE_NOPRINT_F;
+ }
+ M.x86.debug &= ~DEBUG_TRACE_F;
+ M.x86.debug |= DEBUG_BREAK_F;
+ done = 1;
+ }
+ break;
+ case 'q':
+ M.x86.debug &= ~DEBUG_TRACE_F;
+ M.x86.debug &= ~DEBUG_BREAK_F;
+ M.x86.debug &= ~DEBUG_STEP_F;
+ M.x86.debug &= ~DEBUG_DECODE_F;
+ done = 1;
+ break;
+ case 'P':
+ noDecode = (noDecode)?0:1;
+ printk("Toggled decoding to %s\n",(noDecode)?"FALSE":"TRUE");
+ break;
+ case 't':
+ case 0:
+ done = 1;
+ break;
+ }
+ }
+}
+
+int X86EMU_trace_on(void)
+{
+ return M.x86.debug |= DEBUG_STEP_F | DEBUG_DECODE_F | DEBUG_TRACE_F;
+}
+
+int X86EMU_trace_off(void)
+{
+ return M.x86.debug &= ~(DEBUG_STEP_F | DEBUG_DECODE_F | DEBUG_TRACE_F);
+}
+
+static int parse_line (char *s, int *ps, int *n)
+{
+ int cmd;
+
+ *n = 0;
+ while(*s == ' ' || *s == '\t') s++;
+ ps[*n] = *s;
+ switch (*s) {
+ case '\n':
+ *n += 1;
+ return 0;
+ default:
+ cmd = *s;
+ *n += 1;
+ }
+
+ while (1) {
+ while (*s != ' ' && *s != '\t' && *s != '\n') s++;
+
+ if (*s == '\n')
+ return cmd;
+
+ while(*s == ' ' || *s == '\t') s++;
+#ifdef _CFE_
+ ps[*n] = xtoi(s);
+#else
+ sscanf(s,"%x",&ps[*n]);
+#endif
+ *n += 1;
+ }
+}
+
+#endif /* DEBUG */
+
+void x86emu_dump_regs (void)
+{
+ printk("\tAX=%04x ", M.x86.R_AX );
+ printk("BX=%04x ", M.x86.R_BX );
+ printk("CX=%04x ", M.x86.R_CX );
+ printk("DX=%04x ", M.x86.R_DX );
+ printk("SP=%04x ", M.x86.R_SP );
+ printk("BP=%04x ", M.x86.R_BP );
+ printk("SI=%04x ", M.x86.R_SI );
+ printk("DI=%04x\n", M.x86.R_DI );
+ printk("\tDS=%04x ", M.x86.R_DS );
+ printk("ES=%04x ", M.x86.R_ES );
+ printk("SS=%04x ", M.x86.R_SS );
+ printk("CS=%04x ", M.x86.R_CS );
+ printk("IP=%04x ", M.x86.R_IP );
+ if (ACCESS_FLAG(F_OF)) printk("OV "); /* CHECKED... */
+ else printk("NV ");
+ if (ACCESS_FLAG(F_DF)) printk("DN ");
+ else printk("UP ");
+ if (ACCESS_FLAG(F_IF)) printk("EI ");
+ else printk("DI ");
+ if (ACCESS_FLAG(F_SF)) printk("NG ");
+ else printk("PL ");
+ if (ACCESS_FLAG(F_ZF)) printk("ZR ");
+ else printk("NZ ");
+ if (ACCESS_FLAG(F_AF)) printk("AC ");
+ else printk("NA ");
+ if (ACCESS_FLAG(F_PF)) printk("PE ");
+ else printk("PO ");
+ if (ACCESS_FLAG(F_CF)) printk("CY ");
+ else printk("NC ");
+ printk("\n");
+}
+
+void x86emu_dump_xregs (void)
+{
+ printk("\tEAX=%08x ", M.x86.R_EAX );
+ printk("EBX=%08x ", M.x86.R_EBX );
+ printk("ECX=%08x ", M.x86.R_ECX );
+ printk("EDX=%08x \n", M.x86.R_EDX );
+ printk("\tESP=%08x ", M.x86.R_ESP );
+ printk("EBP=%08x ", M.x86.R_EBP );
+ printk("ESI=%08x ", M.x86.R_ESI );
+ printk("EDI=%08x\n", M.x86.R_EDI );
+ printk("\tDS=%04x ", M.x86.R_DS );
+ printk("ES=%04x ", M.x86.R_ES );
+ printk("SS=%04x ", M.x86.R_SS );
+ printk("CS=%04x ", M.x86.R_CS );
+ printk("EIP=%08x\n\t", M.x86.R_EIP );
+ if (ACCESS_FLAG(F_OF)) printk("OV "); /* CHECKED... */
+ else printk("NV ");
+ if (ACCESS_FLAG(F_DF)) printk("DN ");
+ else printk("UP ");
+ if (ACCESS_FLAG(F_IF)) printk("EI ");
+ else printk("DI ");
+ if (ACCESS_FLAG(F_SF)) printk("NG ");
+ else printk("PL ");
+ if (ACCESS_FLAG(F_ZF)) printk("ZR ");
+ else printk("NZ ");
+ if (ACCESS_FLAG(F_AF)) printk("AC ");
+ else printk("NA ");
+ if (ACCESS_FLAG(F_PF)) printk("PE ");
+ else printk("PO ");
+ if (ACCESS_FLAG(F_CF)) printk("CY ");
+ else printk("NC ");
+ printk("\n");
+}
diff --git a/cfe/cfe/x86emu/decode.c b/cfe/cfe/x86emu/decode.c
new file mode 100644
index 0000000..10082eb
--- /dev/null
+++ b/cfe/cfe/x86emu/decode.c
@@ -0,0 +1,1000 @@
+/****************************************************************************
+*
+* Realmode X86 Emulator Library
+*
+* Copyright (C) 1996-1999 SciTech Software, Inc.
+* Copyright (C) David Mosberger-Tang
+* Copyright (C) 1999 Egbert Eich
+*
+* ========================================================================
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee,
+* provided that the above copyright notice appear in all copies and that
+* both that copyright notice and this permission notice appear in
+* supporting documentation, and that the name of the authors not be used
+* in advertising or publicity pertaining to distribution of the software
+* without specific, written prior permission. The authors makes no
+* representations about the suitability of this software for any purpose.
+* It is provided "as is" without express or implied warranty.
+*
+* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+* PERFORMANCE OF THIS SOFTWARE.
+*
+* ========================================================================
+*
+* Language: ANSI C
+* Environment: Any
+* Developer: Kendall Bennett
+*
+* Description: This file includes subroutines which are related to
+* instruction decoding and accessess of immediate data via IP. etc.
+*
+****************************************************************************/
+
+/* $XFree86: xc/extras/x86emu/src/x86emu/decode.c,v 1.8 2000/12/13 03:19:34 tsi Exp $ */
+
+#include "x86emu/x86emui.h"
+#include "cfe_console.h"
+
+/*----------------------------- Implementation ----------------------------*/
+
+/****************************************************************************
+REMARKS:
+Handles any pending asychronous interrupts.
+****************************************************************************/
+static void x86emu_intr_handle(void)
+{
+ u8 intno;
+
+ if (M.x86.intr & INTR_SYNCH) {
+ intno = M.x86.intno;
+ if (_X86EMU_intrTab[intno]) {
+ (*_X86EMU_intrTab[intno])(intno);
+ } else {
+ push_word((u16)M.x86.R_FLG);
+ CLEAR_FLAG(F_IF);
+ CLEAR_FLAG(F_TF);
+ push_word(M.x86.R_CS);
+ M.x86.R_CS = mem_access_word(intno * 4 + 2);
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = mem_access_word(intno * 4);
+ M.x86.intr = 0;
+ }
+ }
+}
+
+/****************************************************************************
+PARAMETERS:
+intrnum - Interrupt number to raise
+
+REMARKS:
+Raise the specified interrupt to be handled before the execution of the
+next instruction.
+****************************************************************************/
+void x86emu_intr_raise(
+ u8 intrnum)
+{
+ M.x86.intno = intrnum;
+ M.x86.intr |= INTR_SYNCH;
+}
+
+#ifdef DEBUG
+extern u8 inb(u32);
+#endif
+
+/****************************************************************************
+REMARKS:
+Main execution loop for the emulator. We return from here when the system
+halts, which is normally caused by a stack fault when we return from the
+original real mode call.
+****************************************************************************/
+void X86EMU_exec(void)
+{
+ u8 op1;
+
+ M.x86.intr = 0;
+ DB(x86emu_end_instr();)
+
+ for (;;) {
+DB( if (CHECK_IP_FETCH())
+ x86emu_check_ip_access();)
+ /* If debugging, save the IP and CS values. */
+ SAVE_IP_CS(M.x86.R_CS, M.x86.R_IP);
+ INC_DECODED_INST_LEN(1);
+ if (M.x86.intr) {
+ if (M.x86.intr & INTR_HALTED) {
+DB( printk("halted\n");
+ X86EMU_trace_regs();)
+ return;
+ }
+ if (((M.x86.intr & INTR_SYNCH) && (M.x86.intno == 0 || M.x86.intno == 2)) ||
+ !ACCESS_FLAG(F_IF)) {
+ x86emu_intr_handle();
+ }
+ }
+#ifdef DEBUG
+ if (inb(0x3f8 + 5) & 1) {
+ M.x86.debug |= DEBUG_STEP_F | DEBUG_DECODE_F | DEBUG_TRACE_F;
+ }
+#endif
+ op1 = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
+ (*x86emu_optab[op1])(op1);
+ }
+}
+
+/****************************************************************************
+REMARKS:
+Halts the system by setting the halted system flag.
+****************************************************************************/
+void X86EMU_halt_sys(void)
+{
+ M.x86.intr |= INTR_HALTED;
+}
+
+/****************************************************************************
+PARAMETERS:
+mod - Mod value from decoded byte
+regh - Reg h value from decoded byte
+regl - Reg l value from decoded byte
+
+REMARKS:
+Raise the specified interrupt to be handled before the execution of the
+next instruction.
+
+NOTE: Do not inline this function, as (*sys_rdb) is already inline!
+****************************************************************************/
+void fetch_decode_modrm(
+ int *mod,
+ int *regh,
+ int *regl)
+{
+ int fetched;
+
+DB( if (CHECK_IP_FETCH())
+ x86emu_check_ip_access();)
+ fetched = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
+ INC_DECODED_INST_LEN(1);
+ *mod = (fetched >> 6) & 0x03;
+ *regh = (fetched >> 3) & 0x07;
+ *regl = (fetched >> 0) & 0x07;
+}
+
+/****************************************************************************
+RETURNS:
+Immediate byte value read from instruction queue
+
+REMARKS:
+This function returns the immediate byte from the instruction queue, and
+moves the instruction pointer to the next value.
+
+NOTE: Do not inline this function, as (*sys_rdb) is already inline!
+****************************************************************************/
+u8 fetch_byte_imm(void)
+{
+ u8 fetched;
+
+DB( if (CHECK_IP_FETCH())
+ x86emu_check_ip_access();)
+ fetched = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
+ INC_DECODED_INST_LEN(1);
+ return fetched;
+}
+
+/****************************************************************************
+RETURNS:
+Immediate word value read from instruction queue
+
+REMARKS:
+This function returns the immediate byte from the instruction queue, and
+moves the instruction pointer to the next value.
+
+NOTE: Do not inline this function, as (*sys_rdw) is already inline!
+****************************************************************************/
+u16 fetch_word_imm(void)
+{
+ u16 fetched;
+
+DB( if (CHECK_IP_FETCH())
+ x86emu_check_ip_access();)
+ fetched = (*sys_rdw)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP));
+ M.x86.R_IP += 2;
+ INC_DECODED_INST_LEN(2);
+ return fetched;
+}
+
+/****************************************************************************
+RETURNS:
+Immediate lone value read from instruction queue
+
+REMARKS:
+This function returns the immediate byte from the instruction queue, and
+moves the instruction pointer to the next value.
+
+NOTE: Do not inline this function, as (*sys_rdw) is already inline!
+****************************************************************************/
+u32 fetch_long_imm(void)
+{
+ u32 fetched;
+
+DB( if (CHECK_IP_FETCH())
+ x86emu_check_ip_access();)
+ fetched = (*sys_rdl)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP));
+ M.x86.R_IP += 4;
+ INC_DECODED_INST_LEN(4);
+ return fetched;
+}
+
+/****************************************************************************
+RETURNS:
+Value of the default data segment
+
+REMARKS:
+Inline function that returns the default data segment for the current
+instruction.
+
+On the x86 processor, the default segment is not always DS if there is
+no segment override. Address modes such as -3[BP] or 10[BP+SI] all refer to
+addresses relative to SS (ie: on the stack). So, at the minimum, all
+decodings of addressing modes would have to set/clear a bit describing
+whether the access is relative to DS or SS. That is the function of the
+cpu-state-varible M.x86.mode. There are several potential states:
+
+ repe prefix seen (handled elsewhere)
+ repne prefix seen (ditto)
+
+ cs segment override
+ ds segment override
+ es segment override
+ fs segment override
+ gs segment override
+ ss segment override
+
+ ds/ss select (in absense of override)
+
+Each of the above 7 items are handled with a bit in the mode field.
+****************************************************************************/
+_INLINE u32 get_data_segment(void)
+{
+#define GET_SEGMENT(segment)
+ switch (M.x86.mode & SYSMODE_SEGMASK) {
+ case 0: /* default case: use ds register */
+ case SYSMODE_SEGOVR_DS:
+ case SYSMODE_SEGOVR_DS | SYSMODE_SEG_DS_SS:
+ return M.x86.R_DS;
+ case SYSMODE_SEG_DS_SS: /* non-overridden, use ss register */
+ return M.x86.R_SS;
+ case SYSMODE_SEGOVR_CS:
+ case SYSMODE_SEGOVR_CS | SYSMODE_SEG_DS_SS:
+ return M.x86.R_CS;
+ case SYSMODE_SEGOVR_ES:
+ case SYSMODE_SEGOVR_ES | SYSMODE_SEG_DS_SS:
+ return M.x86.R_ES;
+ case SYSMODE_SEGOVR_FS:
+ case SYSMODE_SEGOVR_FS | SYSMODE_SEG_DS_SS:
+ return M.x86.R_FS;
+ case SYSMODE_SEGOVR_GS:
+ case SYSMODE_SEGOVR_GS | SYSMODE_SEG_DS_SS:
+ return M.x86.R_GS;
+ case SYSMODE_SEGOVR_SS:
+ case SYSMODE_SEGOVR_SS | SYSMODE_SEG_DS_SS:
+ return M.x86.R_SS;
+ default:
+#ifdef DEBUG
+ printk("error: should not happen: multiple overrides.\n");
+#endif
+ HALT_SYS();
+ return 0;
+ }
+}
+
+/****************************************************************************
+PARAMETERS:
+offset - Offset to load data from
+
+RETURNS:
+Byte value read from the absolute memory location.
+
+NOTE: Do not inline this function as (*sys_rdX) is already inline!
+****************************************************************************/
+u8 fetch_data_byte(
+ uint offset)
+{
+#ifdef DEBUG
+ if (CHECK_DATA_ACCESS())
+ x86emu_check_data_access((u16)get_data_segment(), offset);
+#endif
+ return (*sys_rdb)((get_data_segment() << 4) + offset);
+}
+
+/****************************************************************************
+PARAMETERS:
+offset - Offset to load data from
+
+RETURNS:
+Word value read from the absolute memory location.
+
+NOTE: Do not inline this function as (*sys_rdX) is already inline!
+****************************************************************************/
+u16 fetch_data_word(
+ uint offset)
+{
+#ifdef DEBUG
+ if (CHECK_DATA_ACCESS())
+ x86emu_check_data_access((u16)get_data_segment(), offset);
+#endif
+ return (*sys_rdw)((get_data_segment() << 4) + offset);
+}
+
+/****************************************************************************
+PARAMETERS:
+offset - Offset to load data from
+
+RETURNS:
+Long value read from the absolute memory location.
+
+NOTE: Do not inline this function as (*sys_rdX) is already inline!
+****************************************************************************/
+u32 fetch_data_long(
+ uint offset)
+{
+#ifdef DEBUG
+ if (CHECK_DATA_ACCESS())
+ x86emu_check_data_access((u16)get_data_segment(), offset);
+#endif
+ return (*sys_rdl)((get_data_segment() << 4) + offset);
+}
+
+/****************************************************************************
+PARAMETERS:
+segment - Segment to load data from
+offset - Offset to load data from
+
+RETURNS:
+Byte value read from the absolute memory location.
+
+NOTE: Do not inline this function as (*sys_rdX) is already inline!
+****************************************************************************/
+u8 fetch_data_byte_abs(
+ uint segment,
+ uint offset)
+{
+#ifdef DEBUG
+ if (CHECK_DATA_ACCESS())
+ x86emu_check_data_access(segment, offset);
+#endif
+ return (*sys_rdb)(((u32)segment << 4) + offset);
+}
+
+/****************************************************************************
+PARAMETERS:
+segment - Segment to load data from
+offset - Offset to load data from
+
+RETURNS:
+Word value read from the absolute memory location.
+
+NOTE: Do not inline this function as (*sys_rdX) is already inline!
+****************************************************************************/
+u16 fetch_data_word_abs(
+ uint segment,
+ uint offset)
+{
+#ifdef DEBUG
+ if (CHECK_DATA_ACCESS())
+ x86emu_check_data_access(segment, offset);
+#endif
+ return (*sys_rdw)(((u32)segment << 4) + offset);
+}
+
+/****************************************************************************
+PARAMETERS:
+segment - Segment to load data from
+offset - Offset to load data from
+
+RETURNS:
+Long value read from the absolute memory location.
+
+NOTE: Do not inline this function as (*sys_rdX) is already inline!
+****************************************************************************/
+u32 fetch_data_long_abs(
+ uint segment,
+ uint offset)
+{
+#ifdef DEBUG
+ if (CHECK_DATA_ACCESS())
+ x86emu_check_data_access(segment, offset);
+#endif
+ return (*sys_rdl)(((u32)segment << 4) + offset);
+}
+
+/****************************************************************************
+PARAMETERS:
+offset - Offset to store data at
+val - Value to store
+
+REMARKS:
+Writes a word value to an segmented memory location. The segment used is
+the current 'default' segment, which may have been overridden.
+
+NOTE: Do not inline this function as (*sys_wrX) is already inline!
+****************************************************************************/
+void store_data_byte(
+ uint offset,
+ u8 val)
+{
+#ifdef DEBUG
+ if (CHECK_DATA_ACCESS())
+ x86emu_check_data_access((u16)get_data_segment(), offset);
+#endif
+ (*sys_wrb)((get_data_segment() << 4) + offset, val);
+}
+
+/****************************************************************************
+PARAMETERS:
+offset - Offset to store data at
+val - Value to store
+
+REMARKS:
+Writes a word value to an segmented memory location. The segment used is
+the current 'default' segment, which may have been overridden.
+
+NOTE: Do not inline this function as (*sys_wrX) is already inline!
+****************************************************************************/
+void store_data_word(
+ uint offset,
+ u16 val)
+{
+#ifdef DEBUG
+ if (CHECK_DATA_ACCESS())
+ x86emu_check_data_access((u16)get_data_segment(), offset);
+#endif
+ (*sys_wrw)((get_data_segment() << 4) + offset, val);
+}
+
+/****************************************************************************
+PARAMETERS:
+offset - Offset to store data at
+val - Value to store
+
+REMARKS:
+Writes a long value to an segmented memory location. The segment used is
+the current 'default' segment, which may have been overridden.
+
+NOTE: Do not inline this function as (*sys_wrX) is already inline!
+****************************************************************************/
+void store_data_long(
+ uint offset,
+ u32 val)
+{
+#ifdef DEBUG
+ if (CHECK_DATA_ACCESS())
+ x86emu_check_data_access((u16)get_data_segment(), offset);
+#endif
+ (*sys_wrl)((get_data_segment() << 4) + offset, val);
+}
+
+/****************************************************************************
+PARAMETERS:
+segment - Segment to store data at
+offset - Offset to store data at
+val - Value to store
+
+REMARKS:
+Writes a byte value to an absolute memory location.
+
+NOTE: Do not inline this function as (*sys_wrX) is already inline!
+****************************************************************************/
+void store_data_byte_abs(
+ uint segment,
+ uint offset,
+ u8 val)
+{
+#ifdef DEBUG
+ if (CHECK_DATA_ACCESS())
+ x86emu_check_data_access(segment, offset);
+#endif
+ (*sys_wrb)(((u32)segment << 4) + offset, val);
+}
+
+/****************************************************************************
+PARAMETERS:
+segment - Segment to store data at
+offset - Offset to store data at
+val - Value to store
+
+REMARKS:
+Writes a word value to an absolute memory location.
+
+NOTE: Do not inline this function as (*sys_wrX) is already inline!
+****************************************************************************/
+void store_data_word_abs(
+ uint segment,
+ uint offset,
+ u16 val)
+{
+#ifdef DEBUG
+ if (CHECK_DATA_ACCESS())
+ x86emu_check_data_access(segment, offset);
+#endif
+ (*sys_wrw)(((u32)segment << 4) + offset, val);
+}
+
+/****************************************************************************
+PARAMETERS:
+segment - Segment to store data at
+offset - Offset to store data at
+val - Value to store
+
+REMARKS:
+Writes a long value to an absolute memory location.
+
+NOTE: Do not inline this function as (*sys_wrX) is already inline!
+****************************************************************************/
+void store_data_long_abs(
+ uint segment,
+ uint offset,
+ u32 val)
+{
+#ifdef DEBUG
+ if (CHECK_DATA_ACCESS())
+ x86emu_check_data_access(segment, offset);
+#endif
+ (*sys_wrl)(((u32)segment << 4) + offset, val);
+}
+
+/****************************************************************************
+PARAMETERS:
+reg - Register to decode
+
+RETURNS:
+Pointer to the appropriate register
+
+REMARKS:
+Return a pointer to the register given by the R/RM field of the
+modrm byte, for byte operands. Also enables the decoding of instructions.
+****************************************************************************/
+u8* decode_rm_byte_register(
+ int reg)
+{
+ switch (reg) {
+ case 0:
+ DECODE_PRINTF("AL");
+ return &M.x86.R_AL;
+ case 1:
+ DECODE_PRINTF("CL");
+ return &M.x86.R_CL;
+ case 2:
+ DECODE_PRINTF("DL");
+ return &M.x86.R_DL;
+ case 3:
+ DECODE_PRINTF("BL");
+ return &M.x86.R_BL;
+ case 4:
+ DECODE_PRINTF("AH");
+ return &M.x86.R_AH;
+ case 5:
+ DECODE_PRINTF("CH");
+ return &M.x86.R_CH;
+ case 6:
+ DECODE_PRINTF("DH");
+ return &M.x86.R_DH;
+ case 7:
+ DECODE_PRINTF("BH");
+ return &M.x86.R_BH;
+ }
+ HALT_SYS();
+ return NULL; /* NOT REACHED OR REACHED ON ERROR */
+}
+
+/****************************************************************************
+PARAMETERS:
+reg - Register to decode
+
+RETURNS:
+Pointer to the appropriate register
+
+REMARKS:
+Return a pointer to the register given by the R/RM field of the
+modrm byte, for word operands. Also enables the decoding of instructions.
+****************************************************************************/
+u16* decode_rm_word_register(
+ int reg)
+{
+ switch (reg) {
+ case 0:
+ DECODE_PRINTF("AX");
+ return &M.x86.R_AX;
+ case 1:
+ DECODE_PRINTF("CX");
+ return &M.x86.R_CX;
+ case 2:
+ DECODE_PRINTF("DX");
+ return &M.x86.R_DX;
+ case 3:
+ DECODE_PRINTF("BX");
+ return &M.x86.R_BX;
+ case 4:
+ DECODE_PRINTF("SP");
+ return &M.x86.R_SP;
+ case 5:
+ DECODE_PRINTF("BP");
+ return &M.x86.R_BP;
+ case 6:
+ DECODE_PRINTF("SI");
+ return &M.x86.R_SI;
+ case 7:
+ DECODE_PRINTF("DI");
+ return &M.x86.R_DI;
+ }
+ HALT_SYS();
+ return NULL; /* NOTREACHED OR REACHED ON ERROR */
+}
+
+/****************************************************************************
+PARAMETERS:
+reg - Register to decode
+
+RETURNS:
+Pointer to the appropriate register
+
+REMARKS:
+Return a pointer to the register given by the R/RM field of the
+modrm byte, for dword operands. Also enables the decoding of instructions.
+****************************************************************************/
+u32* decode_rm_long_register(
+ int reg)
+{
+ switch (reg) {
+ case 0:
+ DECODE_PRINTF("EAX");
+ return &M.x86.R_EAX;
+ case 1:
+ DECODE_PRINTF("ECX");
+ return &M.x86.R_ECX;
+ case 2:
+ DECODE_PRINTF("EDX");
+ return &M.x86.R_EDX;
+ case 3:
+ DECODE_PRINTF("EBX");
+ return &M.x86.R_EBX;
+ case 4:
+ DECODE_PRINTF("ESP");
+ return &M.x86.R_ESP;
+ case 5:
+ DECODE_PRINTF("EBP");
+ return &M.x86.R_EBP;
+ case 6:
+ DECODE_PRINTF("ESI");
+ return &M.x86.R_ESI;
+ case 7:
+ DECODE_PRINTF("EDI");
+ return &M.x86.R_EDI;
+ }
+ HALT_SYS();
+ return NULL; /* NOTREACHED OR REACHED ON ERROR */
+}
+
+/****************************************************************************
+PARAMETERS:
+reg - Register to decode
+
+RETURNS:
+Pointer to the appropriate register
+
+REMARKS:
+Return a pointer to the register given by the R/RM field of the
+modrm byte, for word operands, modified from above for the weirdo
+special case of segreg operands. Also enables the decoding of instructions.
+****************************************************************************/
+u16* decode_rm_seg_register(
+ int reg)
+{
+ switch (reg) {
+ case 0:
+ DECODE_PRINTF("ES");
+ return &M.x86.R_ES;
+ case 1:
+ DECODE_PRINTF("CS");
+ return &M.x86.R_CS;
+ case 2:
+ DECODE_PRINTF("SS");
+ return &M.x86.R_SS;
+ case 3:
+ DECODE_PRINTF("DS");
+ return &M.x86.R_DS;
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ DECODE_PRINTF("ILLEGAL SEGREG");
+ break;
+ }
+ HALT_SYS();
+ return NULL; /* NOT REACHED OR REACHED ON ERROR */
+}
+
+
+/****************************************************************************
+PARAMETERS:
+sib - SIB value to decode
+
+RETURNS:
+Offset in memory for the address decoding
+
+REMARKS:
+Return the offset given by the specified SIB byte.
+
+NOTE: The code which specifies the corresponding segment (ds vs ss)
+ below in the case of [BP+..]. The assumption here is that at the
+ point that this subroutine is called, the bit corresponding to
+ SYSMODE_SEG_DS_SS will be zero. After every instruction
+ except the segment override instructions, this bit (as well
+ as any bits indicating segment overrides) will be clear. So
+ if a SS access is needed, set this bit. Otherwise, DS access
+ occurs (unless any of the segment override bits are set).
+****************************************************************************/
+static unsigned decode_sib_address(
+ int sib)
+{
+ unsigned ss,index,base;
+ unsigned addr = 0;
+
+ ss = (sib >> 6) & 3;
+ index = (sib >> 3) & 7;
+ base = (sib & 7);
+
+ switch (base) {
+ case 0:
+ DECODE_PRINTF("[EAX");
+ addr = M.x86.R_EAX;
+ break;
+ case 1:
+ DECODE_PRINTF("[ECX");
+ addr = M.x86.R_ECX;
+ break;
+ case 2:
+ DECODE_PRINTF("[EDX");
+ addr = M.x86.R_EDX;
+ break;
+ case 3:
+ DECODE_PRINTF("[EBX");
+ addr = M.x86.R_EBX;
+ break;
+ case 4:
+ DECODE_PRINTF("[ESP");
+ addr = M.x86.R_ESP;
+ break;
+ case 5:
+ DECODE_PRINTF("[invalid");
+ addr = M.x86.R_ESP;/* incorrect */
+ break;
+ case 6:
+ DECODE_PRINTF("[invalid");
+ addr = M.x86.R_ESP;/* incorrect */
+ break;
+ case 7:
+ DECODE_PRINTF("[invalid");
+ addr = M.x86.R_ESP; /* incorrect */
+ break;
+ }
+
+ switch (index) {
+ case 0:
+ DECODE_PRINTF("+EAX");
+ addr += M.x86.R_EAX*(1<<ss);
+ break;
+ case 1:
+ DECODE_PRINTF("+ECX");
+ addr += M.x86.R_ECX*(1<<ss);
+ break;
+ case 2:
+ DECODE_PRINTF("+EDX");
+ addr += M.x86.R_EDX*(1<<ss);
+ break;
+ case 3:
+ DECODE_PRINTF("+EBX");
+ addr += M.x86.R_EBX*(1<<ss);
+ break;
+ case 4:
+ break;
+ case 5:
+ DECODE_PRINTF("+EBP");
+ addr += M.x86.R_EBP*(1<<ss);
+ break;
+ case 6:
+ DECODE_PRINTF("+ESI");
+ addr += M.x86.R_ESI*(1<<ss);
+ break;
+ case 7:
+ DECODE_PRINTF("+EDI");
+ addr += M.x86.R_EDI*(1<<ss);
+ break;
+ }
+
+ switch (ss) {
+ case 0:
+ DECODE_PRINTF("]");
+ break;
+ case 1:
+ DECODE_PRINTF("*2]");
+ break;
+ case 2:
+ DECODE_PRINTF("*4]");
+ break;
+ case 3:
+ DECODE_PRINTF("*8]");
+ break;
+ }
+
+ return addr;
+
+}
+
+/****************************************************************************
+PARAMETERS:
+rm - RM value to decode
+
+RETURNS:
+Offset in memory for the address decoding
+
+REMARKS:
+Return the offset given by mod=00 addressing. Also enables the
+decoding of instructions.
+
+NOTE: The code which specifies the corresponding segment (ds vs ss)
+ below in the case of [BP+..]. The assumption here is that at the
+ point that this subroutine is called, the bit corresponding to
+ SYSMODE_SEG_DS_SS will be zero. After every instruction
+ except the segment override instructions, this bit (as well
+ as any bits indicating segment overrides) will be clear. So
+ if a SS access is needed, set this bit. Otherwise, DS access
+ occurs (unless any of the segment override bits are set).
+****************************************************************************/
+unsigned decode_rm00_address(
+ int rm)
+{
+ unsigned offset;
+
+ switch (rm) {
+ case 0:
+ DECODE_PRINTF("[BX+SI]");
+ return M.x86.R_BX + M.x86.R_SI;
+ case 1:
+ DECODE_PRINTF("[BX+DI]");
+ return M.x86.R_BX + M.x86.R_DI;
+ case 2:
+ DECODE_PRINTF("[BP+SI]");
+ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ return M.x86.R_BP + M.x86.R_SI;
+ case 3:
+ DECODE_PRINTF("[BP+DI]");
+ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ return M.x86.R_BP + M.x86.R_DI;
+ case 4:
+ /* If SYSMODE_PREFIX_ADDR is set, get the SIB byte */
+ if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+ unsigned sib;
+ sib = fetch_byte_imm();
+ return decode_sib_address(sib);
+ }
+ else {
+ DECODE_PRINTF("[SI]");
+ return M.x86.R_SI;
+ }
+ case 5:
+ DECODE_PRINTF("[DI]");
+ return M.x86.R_DI;
+ case 6:
+ offset = fetch_word_imm();
+ DECODE_PRINTF2("[%04x]", offset);
+ return offset;
+ case 7:
+ DECODE_PRINTF("[BX]");
+ return M.x86.R_BX;
+ }
+ HALT_SYS();
+ return 0;
+}
+
+/****************************************************************************
+PARAMETERS:
+rm - RM value to decode
+
+RETURNS:
+Offset in memory for the address decoding
+
+REMARKS:
+Return the offset given by mod=01 addressing. Also enables the
+decoding of instructions.
+****************************************************************************/
+unsigned decode_rm01_address(
+ int rm)
+{
+ int displacement = (s8)fetch_byte_imm();
+ switch (rm) {
+ case 0:
+ DECODE_PRINTF2("%d[BX+SI]", displacement);
+ return M.x86.R_BX + M.x86.R_SI + displacement;
+ case 1:
+ DECODE_PRINTF2("%d[BX+DI]", displacement);
+ return M.x86.R_BX + M.x86.R_DI + displacement;
+ case 2:
+ DECODE_PRINTF2("%d[BP+SI]", displacement);
+ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ return M.x86.R_BP + M.x86.R_SI + displacement;
+ case 3:
+ DECODE_PRINTF2("%d[BP+DI]", displacement);
+ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ return M.x86.R_BP + M.x86.R_DI + displacement;
+ case 4:
+ DECODE_PRINTF2("%d[SI]", displacement);
+ return M.x86.R_SI + displacement;
+ case 5:
+ DECODE_PRINTF2("%d[DI]", displacement);
+ return M.x86.R_DI + displacement;
+ case 6:
+ DECODE_PRINTF2("%d[BP]", displacement);
+ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ return M.x86.R_BP + displacement;
+ case 7:
+ DECODE_PRINTF2("%d[BX]", displacement);
+ return M.x86.R_BX + displacement;
+ }
+ HALT_SYS();
+ return 0; /* SHOULD NOT HAPPEN */
+}
+
+/****************************************************************************
+PARAMETERS:
+rm - RM value to decode
+
+RETURNS:
+Offset in memory for the address decoding
+
+REMARKS:
+Return the offset given by mod=10 addressing. Also enables the
+decoding of instructions.
+****************************************************************************/
+unsigned decode_rm10_address(
+ int rm)
+{
+ unsigned displacement = (u16)fetch_word_imm();
+ switch (rm) {
+ case 0:
+ DECODE_PRINTF2("%d[BX+SI]", displacement);
+ return M.x86.R_BX + M.x86.R_SI + displacement;
+ case 1:
+ DECODE_PRINTF2("%d[BX+DI]", displacement);
+ return M.x86.R_BX + M.x86.R_DI + displacement;
+ case 2:
+ DECODE_PRINTF2("%d[BP+SI]", displacement);
+ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ return M.x86.R_BP + M.x86.R_SI + displacement;
+ case 3:
+ DECODE_PRINTF2("%d[BP+DI]", displacement);
+ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ return M.x86.R_BP + M.x86.R_DI + displacement;
+ case 4:
+ DECODE_PRINTF2("%d[SI]", displacement);
+ return M.x86.R_SI + displacement;
+ case 5:
+ DECODE_PRINTF2("%d[DI]", displacement);
+ return M.x86.R_DI + displacement;
+ case 6:
+ DECODE_PRINTF2("%d[BP]", displacement);
+ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ return M.x86.R_BP + displacement;
+ case 7:
+ DECODE_PRINTF2("%d[BX]", displacement);
+ return M.x86.R_BX + displacement;
+ }
+ HALT_SYS();
+ return 0;
+ /*NOTREACHED */
+}
diff --git a/cfe/cfe/x86emu/fpu.c b/cfe/cfe/x86emu/fpu.c
new file mode 100644
index 0000000..08aea42
--- /dev/null
+++ b/cfe/cfe/x86emu/fpu.c
@@ -0,0 +1,945 @@
+/****************************************************************************
+*
+* Realmode X86 Emulator Library
+*
+* Copyright (C) 1996-1999 SciTech Software, Inc.
+* Copyright (C) David Mosberger-Tang
+* Copyright (C) 1999 Egbert Eich
+*
+* ========================================================================
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee,
+* provided that the above copyright notice appear in all copies and that
+* both that copyright notice and this permission notice appear in
+* supporting documentation, and that the name of the authors not be used
+* in advertising or publicity pertaining to distribution of the software
+* without specific, written prior permission. The authors makes no
+* representations about the suitability of this software for any purpose.
+* It is provided "as is" without express or implied warranty.
+*
+* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+* PERFORMANCE OF THIS SOFTWARE.
+*
+* ========================================================================
+*
+* Language: ANSI C
+* Environment: Any
+* Developer: Kendall Bennett
+*
+* Description: This file contains the code to implement the decoding and
+* emulation of the FPU instructions.
+*
+****************************************************************************/
+
+#include "x86emu/x86emui.h"
+
+/*----------------------------- Implementation ----------------------------*/
+
+/* opcode=0xd8 */
+void x86emuOp_esc_coprocess_d8(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("ESC D8\n");
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR_NO_TRACE();
+}
+
+#ifdef DEBUG
+
+static char *x86emu_fpu_op_d9_tab[] = {
+ "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ",
+ "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
+
+ "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ",
+ "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
+
+ "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ",
+ "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
+};
+
+static char *x86emu_fpu_op_d9_tab1[] = {
+ "FLD\t", "FLD\t", "FLD\t", "FLD\t",
+ "FLD\t", "FLD\t", "FLD\t", "FLD\t",
+
+ "FXCH\t", "FXCH\t", "FXCH\t", "FXCH\t",
+ "FXCH\t", "FXCH\t", "FXCH\t", "FXCH\t",
+
+ "FNOP", "ESC_D9", "ESC_D9", "ESC_D9",
+ "ESC_D9", "ESC_D9", "ESC_D9", "ESC_D9",
+
+ "FSTP\t", "FSTP\t", "FSTP\t", "FSTP\t",
+ "FSTP\t", "FSTP\t", "FSTP\t", "FSTP\t",
+
+ "FCHS", "FABS", "ESC_D9", "ESC_D9",
+ "FTST", "FXAM", "ESC_D9", "ESC_D9",
+
+ "FLD1", "FLDL2T", "FLDL2E", "FLDPI",
+ "FLDLG2", "FLDLN2", "FLDZ", "ESC_D9",
+
+ "F2XM1", "FYL2X", "FPTAN", "FPATAN",
+ "FXTRACT", "ESC_D9", "FDECSTP", "FINCSTP",
+
+ "FPREM", "FYL2XP1", "FSQRT", "ESC_D9",
+ "FRNDINT", "FSCALE", "ESC_D9", "ESC_D9",
+};
+
+#endif /* DEBUG */
+
+/* opcode=0xd9 */
+void x86emuOp_esc_coprocess_d9(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+ u8 stkelem;
+
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (mod != 3) {
+ DECODE_PRINTINSTR32(x86emu_fpu_op_d9_tab, mod, rh, rl);
+ } else {
+ DECODE_PRINTF(x86emu_fpu_op_d9_tab1[(rh << 3) + rl]);
+ }
+#endif
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+ case 3: /* register to register */
+ stkelem = (u8)rl;
+ if (rh < 4) {
+ DECODE_PRINTF2("ST(%d)\n", stkelem);
+ } else {
+ DECODE_PRINTF("\n");
+ }
+ break;
+ }
+#ifdef X86EMU_FPU_PRESENT
+ /* execute */
+ switch (mod) {
+ case 3:
+ switch (rh) {
+ case 0:
+ x86emu_fpu_R_fld(X86EMU_FPU_STKTOP, stkelem);
+ break;
+ case 1:
+ x86emu_fpu_R_fxch(X86EMU_FPU_STKTOP, stkelem);
+ break;
+ case 2:
+ switch (rl) {
+ case 0:
+ x86emu_fpu_R_nop();
+ break;
+ default:
+ x86emu_fpu_illegal();
+ break;
+ }
+ case 3:
+ x86emu_fpu_R_fstp(X86EMU_FPU_STKTOP, stkelem);
+ break;
+ case 4:
+ switch (rl) {
+ case 0:
+ x86emu_fpu_R_fchs(X86EMU_FPU_STKTOP);
+ break;
+ case 1:
+ x86emu_fpu_R_fabs(X86EMU_FPU_STKTOP);
+ break;
+ case 4:
+ x86emu_fpu_R_ftst(X86EMU_FPU_STKTOP);
+ break;
+ case 5:
+ x86emu_fpu_R_fxam(X86EMU_FPU_STKTOP);
+ break;
+ default:
+ /* 2,3,6,7 */
+ x86emu_fpu_illegal();
+ break;
+ }
+ break;
+
+ case 5:
+ switch (rl) {
+ case 0:
+ x86emu_fpu_R_fld1(X86EMU_FPU_STKTOP);
+ break;
+ case 1:
+ x86emu_fpu_R_fldl2t(X86EMU_FPU_STKTOP);
+ break;
+ case 2:
+ x86emu_fpu_R_fldl2e(X86EMU_FPU_STKTOP);
+ break;
+ case 3:
+ x86emu_fpu_R_fldpi(X86EMU_FPU_STKTOP);
+ break;
+ case 4:
+ x86emu_fpu_R_fldlg2(X86EMU_FPU_STKTOP);
+ break;
+ case 5:
+ x86emu_fpu_R_fldln2(X86EMU_FPU_STKTOP);
+ break;
+ case 6:
+ x86emu_fpu_R_fldz(X86EMU_FPU_STKTOP);
+ break;
+ default:
+ /* 7 */
+ x86emu_fpu_illegal();
+ break;
+ }
+ break;
+
+ case 6:
+ switch (rl) {
+ case 0:
+ x86emu_fpu_R_f2xm1(X86EMU_FPU_STKTOP);
+ break;
+ case 1:
+ x86emu_fpu_R_fyl2x(X86EMU_FPU_STKTOP);
+ break;
+ case 2:
+ x86emu_fpu_R_fptan(X86EMU_FPU_STKTOP);
+ break;
+ case 3:
+ x86emu_fpu_R_fpatan(X86EMU_FPU_STKTOP);
+ break;
+ case 4:
+ x86emu_fpu_R_fxtract(X86EMU_FPU_STKTOP);
+ break;
+ case 5:
+ x86emu_fpu_illegal();
+ break;
+ case 6:
+ x86emu_fpu_R_decstp();
+ break;
+ case 7:
+ x86emu_fpu_R_incstp();
+ break;
+ }
+ break;
+
+ case 7:
+ switch (rl) {
+ case 0:
+ x86emu_fpu_R_fprem(X86EMU_FPU_STKTOP);
+ break;
+ case 1:
+ x86emu_fpu_R_fyl2xp1(X86EMU_FPU_STKTOP);
+ break;
+ case 2:
+ x86emu_fpu_R_fsqrt(X86EMU_FPU_STKTOP);
+ break;
+ case 3:
+ x86emu_fpu_illegal();
+ break;
+ case 4:
+ x86emu_fpu_R_frndint(X86EMU_FPU_STKTOP);
+ break;
+ case 5:
+ x86emu_fpu_R_fscale(X86EMU_FPU_STKTOP);
+ break;
+ case 6:
+ case 7:
+ default:
+ x86emu_fpu_illegal();
+ break;
+ }
+ break;
+
+ default:
+ switch (rh) {
+ case 0:
+ x86emu_fpu_M_fld(X86EMU_FPU_FLOAT, destoffset);
+ break;
+ case 1:
+ x86emu_fpu_illegal();
+ break;
+ case 2:
+ x86emu_fpu_M_fst(X86EMU_FPU_FLOAT, destoffset);
+ break;
+ case 3:
+ x86emu_fpu_M_fstp(X86EMU_FPU_FLOAT, destoffset);
+ break;
+ case 4:
+ x86emu_fpu_M_fldenv(X86EMU_FPU_WORD, destoffset);
+ break;
+ case 5:
+ x86emu_fpu_M_fldcw(X86EMU_FPU_WORD, destoffset);
+ break;
+ case 6:
+ x86emu_fpu_M_fstenv(X86EMU_FPU_WORD, destoffset);
+ break;
+ case 7:
+ x86emu_fpu_M_fstcw(X86EMU_FPU_WORD, destoffset);
+ break;
+ }
+ }
+ }
+#endif /* X86EMU_FPU_PRESENT */
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR_NO_TRACE();
+}
+
+#ifdef DEBUG
+
+char *x86emu_fpu_op_da_tab[] = {
+ "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
+ "FICOMP\tDWORD PTR ",
+ "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
+ "FIDIVR\tDWORD PTR ",
+
+ "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
+ "FICOMP\tDWORD PTR ",
+ "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
+ "FIDIVR\tDWORD PTR ",
+
+ "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
+ "FICOMP\tDWORD PTR ",
+ "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
+ "FIDIVR\tDWORD PTR ",
+
+ "ESC_DA ", "ESC_DA ", "ESC_DA ", "ESC_DA ",
+ "ESC_DA ", "ESC_DA ", "ESC_DA ", "ESC_DA ",
+};
+
+#endif /* DEBUG */
+
+/* opcode=0xda */
+void x86emuOp_esc_coprocess_da(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+ u8 stkelem;
+
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ DECODE_PRINTINSTR32(x86emu_fpu_op_da_tab, mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+ case 3: /* register to register */
+ stkelem = (u8)rl;
+ DECODE_PRINTF2("\tST(%d),ST\n", stkelem);
+ break;
+ }
+#ifdef X86EMU_FPU_PRESENT
+ switch (mod) {
+ case 3:
+ x86emu_fpu_illegal();
+ break;
+ default:
+ switch (rh) {
+ case 0:
+ x86emu_fpu_M_iadd(X86EMU_FPU_SHORT, destoffset);
+ break;
+ case 1:
+ x86emu_fpu_M_imul(X86EMU_FPU_SHORT, destoffset);
+ break;
+ case 2:
+ x86emu_fpu_M_icom(X86EMU_FPU_SHORT, destoffset);
+ break;
+ case 3:
+ x86emu_fpu_M_icomp(X86EMU_FPU_SHORT, destoffset);
+ break;
+ case 4:
+ x86emu_fpu_M_isub(X86EMU_FPU_SHORT, destoffset);
+ break;
+ case 5:
+ x86emu_fpu_M_isubr(X86EMU_FPU_SHORT, destoffset);
+ break;
+ case 6:
+ x86emu_fpu_M_idiv(X86EMU_FPU_SHORT, destoffset);
+ break;
+ case 7:
+ x86emu_fpu_M_idivr(X86EMU_FPU_SHORT, destoffset);
+ break;
+ }
+ }
+#endif
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR_NO_TRACE();
+}
+
+#ifdef DEBUG
+
+char *x86emu_fpu_op_db_tab[] = {
+ "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ",
+ "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
+
+ "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ",
+ "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
+
+ "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ",
+ "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
+};
+
+#endif /* DEBUG */
+
+/* opcode=0xdb */
+void x86emuOp_esc_coprocess_db(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (mod != 3) {
+ DECODE_PRINTINSTR32(x86emu_fpu_op_db_tab, mod, rh, rl);
+ } else if (rh == 4) { /* === 11 10 0 nnn */
+ switch (rl) {
+ case 0:
+ DECODE_PRINTF("FENI\n");
+ break;
+ case 1:
+ DECODE_PRINTF("FDISI\n");
+ break;
+ case 2:
+ DECODE_PRINTF("FCLEX\n");
+ break;
+ case 3:
+ DECODE_PRINTF("FINIT\n");
+ break;
+ }
+ } else {
+ DECODE_PRINTF2("ESC_DB %0x\n", (mod << 6) + (rh << 3) + (rl));
+ }
+#endif /* DEBUG */
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ break;
+ case 3: /* register to register */
+ break;
+ }
+#ifdef X86EMU_FPU_PRESENT
+ /* execute */
+ switch (mod) {
+ case 3:
+ switch (rh) {
+ case 4:
+ switch (rl) {
+ case 0:
+ x86emu_fpu_R_feni();
+ break;
+ case 1:
+ x86emu_fpu_R_fdisi();
+ break;
+ case 2:
+ x86emu_fpu_R_fclex();
+ break;
+ case 3:
+ x86emu_fpu_R_finit();
+ break;
+ default:
+ x86emu_fpu_illegal();
+ break;
+ }
+ break;
+ default:
+ x86emu_fpu_illegal();
+ break;
+ }
+ break;
+ default:
+ switch (rh) {
+ case 0:
+ x86emu_fpu_M_fild(X86EMU_FPU_SHORT, destoffset);
+ break;
+ case 1:
+ x86emu_fpu_illegal();
+ break;
+ case 2:
+ x86emu_fpu_M_fist(X86EMU_FPU_SHORT, destoffset);
+ break;
+ case 3:
+ x86emu_fpu_M_fistp(X86EMU_FPU_SHORT, destoffset);
+ break;
+ case 4:
+ x86emu_fpu_illegal();
+ break;
+ case 5:
+ x86emu_fpu_M_fld(X86EMU_FPU_LDBL, destoffset);
+ break;
+ case 6:
+ x86emu_fpu_illegal();
+ break;
+ case 7:
+ x86emu_fpu_M_fstp(X86EMU_FPU_LDBL, destoffset);
+ break;
+ }
+ }
+#endif
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR_NO_TRACE();
+}
+
+#ifdef DEBUG
+char *x86emu_fpu_op_dc_tab[] = {
+ "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ",
+ "FCOMP\tQWORD PTR ",
+ "FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ",
+ "FDIVR\tQWORD PTR ",
+
+ "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ",
+ "FCOMP\tQWORD PTR ",
+ "FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ",
+ "FDIVR\tQWORD PTR ",
+
+ "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ",
+ "FCOMP\tQWORD PTR ",
+ "FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ",
+ "FDIVR\tQWORD PTR ",
+
+ "FADD\t", "FMUL\t", "FCOM\t", "FCOMP\t",
+ "FSUBR\t", "FSUB\t", "FDIVR\t", "FDIV\t",
+};
+#endif /* DEBUG */
+
+/* opcode=0xdc */
+void x86emuOp_esc_coprocess_dc(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+ u8 stkelem;
+
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ DECODE_PRINTINSTR32(x86emu_fpu_op_dc_tab, mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+ case 3: /* register to register */
+ stkelem = (u8)rl;
+ DECODE_PRINTF2("\tST(%d),ST\n", stkelem);
+ break;
+ }
+#ifdef X86EMU_FPU_PRESENT
+ /* execute */
+ switch (mod) {
+ case 3:
+ switch (rh) {
+ case 0:
+ x86emu_fpu_R_fadd(stkelem, X86EMU_FPU_STKTOP);
+ break;
+ case 1:
+ x86emu_fpu_R_fmul(stkelem, X86EMU_FPU_STKTOP);
+ break;
+ case 2:
+ x86emu_fpu_R_fcom(stkelem, X86EMU_FPU_STKTOP);
+ break;
+ case 3:
+ x86emu_fpu_R_fcomp(stkelem, X86EMU_FPU_STKTOP);
+ break;
+ case 4:
+ x86emu_fpu_R_fsubr(stkelem, X86EMU_FPU_STKTOP);
+ break;
+ case 5:
+ x86emu_fpu_R_fsub(stkelem, X86EMU_FPU_STKTOP);
+ break;
+ case 6:
+ x86emu_fpu_R_fdivr(stkelem, X86EMU_FPU_STKTOP);
+ break;
+ case 7:
+ x86emu_fpu_R_fdiv(stkelem, X86EMU_FPU_STKTOP);
+ break;
+ }
+ break;
+ default:
+ switch (rh) {
+ case 0:
+ x86emu_fpu_M_fadd(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+ case 1:
+ x86emu_fpu_M_fmul(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+ case 2:
+ x86emu_fpu_M_fcom(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+ case 3:
+ x86emu_fpu_M_fcomp(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+ case 4:
+ x86emu_fpu_M_fsub(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+ case 5:
+ x86emu_fpu_M_fsubr(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+ case 6:
+ x86emu_fpu_M_fdiv(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+ case 7:
+ x86emu_fpu_M_fdivr(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+ }
+ }
+#endif
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR_NO_TRACE();
+}
+
+#ifdef DEBUG
+
+static char *x86emu_fpu_op_dd_tab[] = {
+ "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ",
+ "FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t",
+
+ "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ",
+ "FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t",
+
+ "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ",
+ "FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t",
+
+ "FFREE\t", "FXCH\t", "FST\t", "FSTP\t",
+ "ESC_DD\t2C,", "ESC_DD\t2D,", "ESC_DD\t2E,", "ESC_DD\t2F,",
+};
+
+#endif /* DEBUG */
+
+/* opcode=0xdd */
+void x86emuOp_esc_coprocess_dd(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+ u8 stkelem;
+
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ DECODE_PRINTINSTR32(x86emu_fpu_op_dd_tab, mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+ case 3: /* register to register */
+ stkelem = (u8)rl;
+ DECODE_PRINTF2("\tST(%d),ST\n", stkelem);
+ break;
+ }
+#ifdef X86EMU_FPU_PRESENT
+ switch (mod) {
+ case 3:
+ switch (rh) {
+ case 0:
+ x86emu_fpu_R_ffree(stkelem);
+ break;
+ case 1:
+ x86emu_fpu_R_fxch(stkelem);
+ break;
+ case 2:
+ x86emu_fpu_R_fst(stkelem); /* register version */
+ break;
+ case 3:
+ x86emu_fpu_R_fstp(stkelem); /* register version */
+ break;
+ default:
+ x86emu_fpu_illegal();
+ break;
+ }
+ break;
+ default:
+ switch (rh) {
+ case 0:
+ x86emu_fpu_M_fld(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+ case 1:
+ x86emu_fpu_illegal();
+ break;
+ case 2:
+ x86emu_fpu_M_fst(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+ case 3:
+ x86emu_fpu_M_fstp(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+ case 4:
+ x86emu_fpu_M_frstor(X86EMU_FPU_WORD, destoffset);
+ break;
+ case 5:
+ x86emu_fpu_illegal();
+ break;
+ case 6:
+ x86emu_fpu_M_fsave(X86EMU_FPU_WORD, destoffset);
+ break;
+ case 7:
+ x86emu_fpu_M_fstsw(X86EMU_FPU_WORD, destoffset);
+ break;
+ }
+ }
+#endif
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR_NO_TRACE();
+}
+
+#ifdef DEBUG
+
+static char *x86emu_fpu_op_de_tab[] =
+{
+ "FIADD\tWORD PTR ", "FIMUL\tWORD PTR ", "FICOM\tWORD PTR ",
+ "FICOMP\tWORD PTR ",
+ "FISUB\tWORD PTR ", "FISUBR\tWORD PTR ", "FIDIV\tWORD PTR ",
+ "FIDIVR\tWORD PTR ",
+
+ "FIADD\tWORD PTR ", "FIMUL\tWORD PTR ", "FICOM\tWORD PTR ",
+ "FICOMP\tWORD PTR ",
+ "FISUB\tWORD PTR ", "FISUBR\tWORD PTR ", "FIDIV\tWORD PTR ",
+ "FIDIVR\tWORD PTR ",
+
+ "FIADD\tWORD PTR ", "FIMUL\tWORD PTR ", "FICOM\tWORD PTR ",
+ "FICOMP\tWORD PTR ",
+ "FISUB\tWORD PTR ", "FISUBR\tWORD PTR ", "FIDIV\tWORD PTR ",
+ "FIDIVR\tWORD PTR ",
+
+ "FADDP\t", "FMULP\t", "FCOMP\t", "FCOMPP\t",
+ "FSUBRP\t", "FSUBP\t", "FDIVRP\t", "FDIVP\t",
+};
+
+#endif /* DEBUG */
+
+/* opcode=0xde */
+void x86emuOp_esc_coprocess_de(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+ u8 stkelem;
+
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ DECODE_PRINTINSTR32(x86emu_fpu_op_de_tab, mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+ case 3: /* register to register */
+ stkelem = (u8)rl;
+ DECODE_PRINTF2("\tST(%d),ST\n", stkelem);
+ break;
+ }
+#ifdef X86EMU_FPU_PRESENT
+ switch (mod) {
+ case 3:
+ switch (rh) {
+ case 0:
+ x86emu_fpu_R_faddp(stkelem, X86EMU_FPU_STKTOP);
+ break;
+ case 1:
+ x86emu_fpu_R_fmulp(stkelem, X86EMU_FPU_STKTOP);
+ break;
+ case 2:
+ x86emu_fpu_R_fcomp(stkelem, X86EMU_FPU_STKTOP);
+ break;
+ case 3:
+ if (stkelem == 1)
+ x86emu_fpu_R_fcompp(stkelem, X86EMU_FPU_STKTOP);
+ else
+ x86emu_fpu_illegal();
+ break;
+ case 4:
+ x86emu_fpu_R_fsubrp(stkelem, X86EMU_FPU_STKTOP);
+ break;
+ case 5:
+ x86emu_fpu_R_fsubp(stkelem, X86EMU_FPU_STKTOP);
+ break;
+ case 6:
+ x86emu_fpu_R_fdivrp(stkelem, X86EMU_FPU_STKTOP);
+ break;
+ case 7:
+ x86emu_fpu_R_fdivp(stkelem, X86EMU_FPU_STKTOP);
+ break;
+ }
+ break;
+ default:
+ switch (rh) {
+ case 0:
+ x86emu_fpu_M_fiadd(X86EMU_FPU_WORD, destoffset);
+ break;
+ case 1:
+ x86emu_fpu_M_fimul(X86EMU_FPU_WORD, destoffset);
+ break;
+ case 2:
+ x86emu_fpu_M_ficom(X86EMU_FPU_WORD, destoffset);
+ break;
+ case 3:
+ x86emu_fpu_M_ficomp(X86EMU_FPU_WORD, destoffset);
+ break;
+ case 4:
+ x86emu_fpu_M_fisub(X86EMU_FPU_WORD, destoffset);
+ break;
+ case 5:
+ x86emu_fpu_M_fisubr(X86EMU_FPU_WORD, destoffset);
+ break;
+ case 6:
+ x86emu_fpu_M_fidiv(X86EMU_FPU_WORD, destoffset);
+ break;
+ case 7:
+ x86emu_fpu_M_fidivr(X86EMU_FPU_WORD, destoffset);
+ break;
+ }
+ }
+#endif
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR_NO_TRACE();
+}
+
+#ifdef DEBUG
+
+static char *x86emu_fpu_op_df_tab[] = {
+ /* mod == 00 */
+ "FILD\tWORD PTR ", "ESC_DF\t39\n", "FIST\tWORD PTR ", "FISTP\tWORD PTR ",
+ "FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ",
+ "FISTP\tQWORD PTR ",
+
+ /* mod == 01 */
+ "FILD\tWORD PTR ", "ESC_DF\t39 ", "FIST\tWORD PTR ", "FISTP\tWORD PTR ",
+ "FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ",
+ "FISTP\tQWORD PTR ",
+
+ /* mod == 10 */
+ "FILD\tWORD PTR ", "ESC_DF\t39 ", "FIST\tWORD PTR ", "FISTP\tWORD PTR ",
+ "FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ",
+ "FISTP\tQWORD PTR ",
+
+ /* mod == 11 */
+ "FFREE\t", "FXCH\t", "FST\t", "FSTP\t",
+ "ESC_DF\t3C,", "ESC_DF\t3D,", "ESC_DF\t3E,", "ESC_DF\t3F,"
+};
+
+#endif /* DEBUG */
+
+/* opcode=0xdf */
+void x86emuOp_esc_coprocess_df(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+ u8 stkelem;
+
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ DECODE_PRINTINSTR32(x86emu_fpu_op_df_tab, mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+ case 3: /* register to register */
+ stkelem = (u8)rl;
+ DECODE_PRINTF2("\tST(%d)\n", stkelem);
+ break;
+ }
+#ifdef X86EMU_FPU_PRESENT
+ switch (mod) {
+ case 3:
+ switch (rh) {
+ case 0:
+ x86emu_fpu_R_ffree(stkelem);
+ break;
+ case 1:
+ x86emu_fpu_R_fxch(stkelem);
+ break;
+ case 2:
+ x86emu_fpu_R_fst(stkelem); /* register version */
+ break;
+ case 3:
+ x86emu_fpu_R_fstp(stkelem); /* register version */
+ break;
+ default:
+ x86emu_fpu_illegal();
+ break;
+ }
+ break;
+ default:
+ switch (rh) {
+ case 0:
+ x86emu_fpu_M_fild(X86EMU_FPU_WORD, destoffset);
+ break;
+ case 1:
+ x86emu_fpu_illegal();
+ break;
+ case 2:
+ x86emu_fpu_M_fist(X86EMU_FPU_WORD, destoffset);
+ break;
+ case 3:
+ x86emu_fpu_M_fistp(X86EMU_FPU_WORD, destoffset);
+ break;
+ case 4:
+ x86emu_fpu_M_fbld(X86EMU_FPU_BSD, destoffset);
+ break;
+ case 5:
+ x86emu_fpu_M_fild(X86EMU_FPU_LONG, destoffset);
+ break;
+ case 6:
+ x86emu_fpu_M_fbstp(X86EMU_FPU_BSD, destoffset);
+ break;
+ case 7:
+ x86emu_fpu_M_fistp(X86EMU_FPU_LONG, destoffset);
+ break;
+ }
+ }
+#endif
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR_NO_TRACE();
+}
diff --git a/cfe/cfe/x86emu/ops.c b/cfe/cfe/x86emu/ops.c
new file mode 100644
index 0000000..46a20b2
--- /dev/null
+++ b/cfe/cfe/x86emu/ops.c
@@ -0,0 +1,11686 @@
+/****************************************************************************
+*
+* Realmode X86 Emulator Library
+*
+* Copyright (C) 1996-1999 SciTech Software, Inc.
+* Copyright (C) David Mosberger-Tang
+* Copyright (C) 1999 Egbert Eich
+*
+* ========================================================================
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee,
+* provided that the above copyright notice appear in all copies and that
+* both that copyright notice and this permission notice appear in
+* supporting documentation, and that the name of the authors not be used
+* in advertising or publicity pertaining to distribution of the software
+* without specific, written prior permission. The authors makes no
+* representations about the suitability of this software for any purpose.
+* It is provided "as is" without express or implied warranty.
+*
+* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+* PERFORMANCE OF THIS SOFTWARE.
+*
+* ========================================================================
+*
+* Language: ANSI C
+* Environment: Any
+* Developer: Kendall Bennett
+*
+* Description: This file includes subroutines to implement the decoding
+* and emulation of all the x86 processor instructions.
+*
+* There are approximately 250 subroutines in here, which correspond
+* to the 256 byte-"opcodes" found on the 8086. The table which
+* dispatches this is found in the files optab.[ch].
+*
+* Each opcode proc has a comment preceeding it which gives it's table
+* address. Several opcodes are missing (undefined) in the table.
+*
+* Each proc includes information for decoding (DECODE_PRINTF and
+* DECODE_PRINTF2), debugging (TRACE_REGS, SINGLE_STEP), and misc
+* functions (START_OF_INSTR, END_OF_INSTR).
+*
+* Many of the procedures are *VERY* similar in coding. This has
+* allowed for a very large amount of code to be generated in a fairly
+* short amount of time (i.e. cut, paste, and modify). The result is
+* that much of the code below could have been folded into subroutines
+* for a large reduction in size of this file. The downside would be
+* that there would be a penalty in execution speed. The file could
+* also have been *MUCH* larger by inlining certain functions which
+* were called. This could have resulted even faster execution. The
+* prime directive I used to decide whether to inline the code or to
+* modularize it, was basically: 1) no unnecessary subroutine calls,
+* 2) no routines more than about 200 lines in size, and 3) modularize
+* any code that I might not get right the first time. The fetch_*
+* subroutines fall into the latter category. The The decode_* fall
+* into the second category. The coding of the "switch(mod){ .... }"
+* in many of the subroutines below falls into the first category.
+* Especially, the coding of {add,and,or,sub,...}_{byte,word}
+* subroutines are an especially glaring case of the third guideline.
+* Since so much of the code is cloned from other modules (compare
+* opcode #00 to opcode #01), making the basic operations subroutine
+* calls is especially important; otherwise mistakes in coding an
+* "add" would represent a nightmare in maintenance.
+*
+****************************************************************************/
+
+/* $XFree86: xc/extras/x86emu/src/x86emu/ops.c,v 1.4 2000/04/17 16:29:45 eich Exp $ */
+
+#include "x86emu/x86emui.h"
+#include "x86emu/ops_protos.h"
+#include "lib_printf.h"
+
+/*----------------------------- Implementation ----------------------------*/
+
+/****************************************************************************
+PARAMETERS:
+op1 - Instruction op code
+
+REMARKS:
+Handles illegal opcodes.
+****************************************************************************/
+void x86emuOp_illegal_op(
+ u8 op1)
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("ILLEGAL X86 OPCODE\n");
+ TRACE_REGS();
+ printk("%04x:%04x: %02X ILLEGAL X86 OPCODE!\n",
+ M.x86.R_CS, M.x86.R_IP-1,op1);
+ HALT_SYS();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x00
+****************************************************************************/
+void x86emuOp_add_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+ u8 *destreg, *srcreg;
+ u8 destval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("ADD\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = add_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = add_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = add_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x01
+****************************************************************************/
+void x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("ADD\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = add_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = add_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = add_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = add_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = add_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = add_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x02
+****************************************************************************/
+void x86emuOp_add_byte_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint srcoffset;
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("ADD\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_byte(*destreg, srcval);
+ break;
+ case 1:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_byte(*destreg, srcval);
+ break;
+ case 2:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_byte(*destreg, srcval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x03
+****************************************************************************/
+void x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("ADD\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_word(*destreg, srcval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_word(*destreg, srcval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_word(*destreg, srcval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x04
+****************************************************************************/
+void x86emuOp_add_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("ADD\tAL,");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ M.x86.R_AL = add_byte(M.x86.R_AL, srcval);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x05
+****************************************************************************/
+void x86emuOp_add_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("ADD\tEAX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("ADD\tAX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = add_long(M.x86.R_EAX, srcval);
+ } else {
+ M.x86.R_AX = add_word(M.x86.R_AX, (u16)srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x06
+****************************************************************************/
+void x86emuOp_push_ES(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("PUSH\tES\n");
+ TRACE_AND_STEP();
+ push_word(M.x86.R_ES);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x07
+****************************************************************************/
+void x86emuOp_pop_ES(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("POP\tES\n");
+ TRACE_AND_STEP();
+ M.x86.R_ES = pop_word();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x08
+****************************************************************************/
+void x86emuOp_or_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint destoffset;
+ u8 destval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("OR\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = or_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = or_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = or_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x09
+****************************************************************************/
+void x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("OR\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = or_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = or_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = or_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = or_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = or_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = or_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0a
+****************************************************************************/
+void x86emuOp_or_byte_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint srcoffset;
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("OR\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_byte(*destreg, srcval);
+ break;
+ case 1:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_byte(*destreg, srcval);
+ break;
+ case 2:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_byte(*destreg, srcval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0b
+****************************************************************************/
+void x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("OR\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_word(*destreg, srcval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_word(*destreg, srcval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_word(*destreg, srcval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0c
+****************************************************************************/
+void x86emuOp_or_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("OR\tAL,");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ M.x86.R_AL = or_byte(M.x86.R_AL, srcval);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0d
+****************************************************************************/
+void x86emuOp_or_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("OR\tEAX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("OR\tAX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = or_long(M.x86.R_EAX, srcval);
+ } else {
+ M.x86.R_AX = or_word(M.x86.R_AX, (u16)srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0e
+****************************************************************************/
+void x86emuOp_push_CS(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("PUSH\tCS\n");
+ TRACE_AND_STEP();
+ push_word(M.x86.R_CS);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f. Escape for two-byte opcode (286 or better)
+****************************************************************************/
+void x86emuOp_two_byte(u8 X86EMU_UNUSED(op1))
+{
+ u8 op2 = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
+ INC_DECODED_INST_LEN(1);
+ (*x86emu_optab2[op2])(op2);
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x10
+****************************************************************************/
+void x86emuOp_adc_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint destoffset;
+ u8 destval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("ADC\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = adc_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = adc_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = adc_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x11
+****************************************************************************/
+void x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("ADC\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = adc_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = adc_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = adc_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = adc_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = adc_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = adc_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x12
+****************************************************************************/
+void x86emuOp_adc_byte_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint srcoffset;
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("ADC\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_byte(*destreg, srcval);
+ break;
+ case 1:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_byte(*destreg, srcval);
+ break;
+ case 2:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_byte(*destreg, srcval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x13
+****************************************************************************/
+void x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("ADC\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_word(*destreg, srcval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_word(*destreg, srcval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_word(*destreg, srcval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x14
+****************************************************************************/
+void x86emuOp_adc_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("ADC\tAL,");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ M.x86.R_AL = adc_byte(M.x86.R_AL, srcval);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x15
+****************************************************************************/
+void x86emuOp_adc_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("ADC\tEAX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("ADC\tAX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = adc_long(M.x86.R_EAX, srcval);
+ } else {
+ M.x86.R_AX = adc_word(M.x86.R_AX, (u16)srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x16
+****************************************************************************/
+void x86emuOp_push_SS(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("PUSH\tSS\n");
+ TRACE_AND_STEP();
+ push_word(M.x86.R_SS);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x17
+****************************************************************************/
+void x86emuOp_pop_SS(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("POP\tSS\n");
+ TRACE_AND_STEP();
+ M.x86.R_SS = pop_word();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x18
+****************************************************************************/
+void x86emuOp_sbb_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint destoffset;
+ u8 destval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SBB\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sbb_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sbb_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sbb_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x19
+****************************************************************************/
+void x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SBB\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sbb_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sbb_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sbb_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sbb_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sbb_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sbb_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x1a
+****************************************************************************/
+void x86emuOp_sbb_byte_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint srcoffset;
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SBB\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_byte(*destreg, srcval);
+ break;
+ case 1:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_byte(*destreg, srcval);
+ break;
+ case 2:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_byte(*destreg, srcval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x1b
+****************************************************************************/
+void x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SBB\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_word(*destreg, srcval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_word(*destreg, srcval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_word(*destreg, srcval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x1c
+****************************************************************************/
+void x86emuOp_sbb_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SBB\tAL,");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ M.x86.R_AL = sbb_byte(M.x86.R_AL, srcval);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x1d
+****************************************************************************/
+void x86emuOp_sbb_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("SBB\tEAX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("SBB\tAX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = sbb_long(M.x86.R_EAX, srcval);
+ } else {
+ M.x86.R_AX = sbb_word(M.x86.R_AX, (u16)srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x1e
+****************************************************************************/
+void x86emuOp_push_DS(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("PUSH\tDS\n");
+ TRACE_AND_STEP();
+ push_word(M.x86.R_DS);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x1f
+****************************************************************************/
+void x86emuOp_pop_DS(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("POP\tDS\n");
+ TRACE_AND_STEP();
+ M.x86.R_DS = pop_word();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x20
+****************************************************************************/
+void x86emuOp_and_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint destoffset;
+ u8 destval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("AND\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = and_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = and_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = and_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x21
+****************************************************************************/
+void x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("AND\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = and_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = and_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = and_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = and_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = and_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = and_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x22
+****************************************************************************/
+void x86emuOp_and_byte_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint srcoffset;
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("AND\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_byte(*destreg, srcval);
+ break;
+ case 1:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_byte(*destreg, srcval);
+ break;
+ case 2:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_byte(*destreg, srcval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x23
+****************************************************************************/
+void x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("AND\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_word(*destreg, srcval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_long(*destreg, srcval);
+ break;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_word(*destreg, srcval);
+ break;
+ }
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_word(*destreg, srcval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x24
+****************************************************************************/
+void x86emuOp_and_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("AND\tAL,");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ M.x86.R_AL = and_byte(M.x86.R_AL, srcval);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x25
+****************************************************************************/
+void x86emuOp_and_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("AND\tEAX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("AND\tAX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = and_long(M.x86.R_EAX, srcval);
+ } else {
+ M.x86.R_AX = and_word(M.x86.R_AX, (u16)srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x26
+****************************************************************************/
+void x86emuOp_segovr_ES(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("ES:\n");
+ TRACE_AND_STEP();
+ M.x86.mode |= SYSMODE_SEGOVR_ES;
+ /*
+ * note the lack of DECODE_CLEAR_SEGOVR(r) since, here is one of 4
+ * opcode subroutines we do not want to do this.
+ */
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x27
+****************************************************************************/
+void x86emuOp_daa(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("DAA\n");
+ TRACE_AND_STEP();
+ M.x86.R_AL = daa_byte(M.x86.R_AL);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x28
+****************************************************************************/
+void x86emuOp_sub_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint destoffset;
+ u8 destval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SUB\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sub_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sub_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sub_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x29
+****************************************************************************/
+void x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SUB\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sub_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sub_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sub_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sub_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sub_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sub_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x2a
+****************************************************************************/
+void x86emuOp_sub_byte_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint srcoffset;
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SUB\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_byte(*destreg, srcval);
+ break;
+ case 1:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_byte(*destreg, srcval);
+ break;
+ case 2:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_byte(*destreg, srcval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x2b
+****************************************************************************/
+void x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SUB\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_word(*destreg, srcval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_word(*destreg, srcval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_word(*destreg, srcval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x2c
+****************************************************************************/
+void x86emuOp_sub_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SUB\tAL,");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ M.x86.R_AL = sub_byte(M.x86.R_AL, srcval);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x2d
+****************************************************************************/
+void x86emuOp_sub_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("SUB\tEAX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("SUB\tAX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = sub_long(M.x86.R_EAX, srcval);
+ } else {
+ M.x86.R_AX = sub_word(M.x86.R_AX, (u16)srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x2e
+****************************************************************************/
+void x86emuOp_segovr_CS(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("CS:\n");
+ TRACE_AND_STEP();
+ M.x86.mode |= SYSMODE_SEGOVR_CS;
+ /* note no DECODE_CLEAR_SEGOVR here. */
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x2f
+****************************************************************************/
+void x86emuOp_das(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("DAS\n");
+ TRACE_AND_STEP();
+ M.x86.R_AL = das_byte(M.x86.R_AL);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x30
+****************************************************************************/
+void x86emuOp_xor_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint destoffset;
+ u8 destval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("XOR\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = xor_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = xor_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = xor_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x31
+****************************************************************************/
+void x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("XOR\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = xor_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = xor_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = xor_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = xor_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = xor_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = xor_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x32
+****************************************************************************/
+void x86emuOp_xor_byte_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint srcoffset;
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("XOR\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_byte(*destreg, srcval);
+ break;
+ case 1:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_byte(*destreg, srcval);
+ break;
+ case 2:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_byte(*destreg, srcval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x33
+****************************************************************************/
+void x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("XOR\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_word(*destreg, srcval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_word(*destreg, srcval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_word(*destreg, srcval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x34
+****************************************************************************/
+void x86emuOp_xor_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("XOR\tAL,");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ M.x86.R_AL = xor_byte(M.x86.R_AL, srcval);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x35
+****************************************************************************/
+void x86emuOp_xor_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XOR\tEAX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("XOR\tAX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = xor_long(M.x86.R_EAX, srcval);
+ } else {
+ M.x86.R_AX = xor_word(M.x86.R_AX, (u16)srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x36
+****************************************************************************/
+void x86emuOp_segovr_SS(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("SS:\n");
+ TRACE_AND_STEP();
+ M.x86.mode |= SYSMODE_SEGOVR_SS;
+ /* no DECODE_CLEAR_SEGOVR ! */
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x37
+****************************************************************************/
+void x86emuOp_aaa(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("AAA\n");
+ TRACE_AND_STEP();
+ M.x86.R_AX = aaa_word(M.x86.R_AX);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x38
+****************************************************************************/
+void x86emuOp_cmp_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+ u8 *destreg, *srcreg;
+ u8 destval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("CMP\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_byte(destval, *srcreg);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_byte(destval, *srcreg);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_byte(destval, *srcreg);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x39
+****************************************************************************/
+void x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("CMP\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(destval, *srcreg);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_word(destval, *srcreg);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(destval, *srcreg);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_word(destval, *srcreg);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(destval, *srcreg);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_word(destval, *srcreg);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x3a
+****************************************************************************/
+void x86emuOp_cmp_byte_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint srcoffset;
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("CMP\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_byte(*destreg, srcval);
+ break;
+ case 1:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_byte(*destreg, srcval);
+ break;
+ case 2:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_byte(*destreg, srcval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x3b
+****************************************************************************/
+void x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("CMP\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_word(*destreg, srcval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_word(*destreg, srcval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_word(*destreg, srcval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x3c
+****************************************************************************/
+void x86emuOp_cmp_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("CMP\tAL,");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ cmp_byte(M.x86.R_AL, srcval);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x3d
+****************************************************************************/
+void x86emuOp_cmp_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("CMP\tEAX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("CMP\tAX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ cmp_long(M.x86.R_EAX, srcval);
+ } else {
+ cmp_word(M.x86.R_AX, (u16)srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x3e
+****************************************************************************/
+void x86emuOp_segovr_DS(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("DS:\n");
+ TRACE_AND_STEP();
+ M.x86.mode |= SYSMODE_SEGOVR_DS;
+ /* NO DECODE_CLEAR_SEGOVR! */
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x3f
+****************************************************************************/
+void x86emuOp_aas(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("AAS\n");
+ TRACE_AND_STEP();
+ M.x86.R_AX = aas_word(M.x86.R_AX);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x40
+****************************************************************************/
+void x86emuOp_inc_AX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tEAX\n");
+ } else {
+ DECODE_PRINTF("INC\tAX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = inc_long(M.x86.R_EAX);
+ } else {
+ M.x86.R_AX = inc_word(M.x86.R_AX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x41
+****************************************************************************/
+void x86emuOp_inc_CX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tECX\n");
+ } else {
+ DECODE_PRINTF("INC\tCX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ECX = inc_long(M.x86.R_ECX);
+ } else {
+ M.x86.R_CX = inc_word(M.x86.R_CX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x42
+****************************************************************************/
+void x86emuOp_inc_DX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tEDX\n");
+ } else {
+ DECODE_PRINTF("INC\tDX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDX = inc_long(M.x86.R_EDX);
+ } else {
+ M.x86.R_DX = inc_word(M.x86.R_DX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x43
+****************************************************************************/
+void x86emuOp_inc_BX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tEBX\n");
+ } else {
+ DECODE_PRINTF("INC\tBX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBX = inc_long(M.x86.R_EBX);
+ } else {
+ M.x86.R_BX = inc_word(M.x86.R_BX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x44
+****************************************************************************/
+void x86emuOp_inc_SP(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tESP\n");
+ } else {
+ DECODE_PRINTF("INC\tSP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESP = inc_long(M.x86.R_ESP);
+ } else {
+ M.x86.R_SP = inc_word(M.x86.R_SP);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x45
+****************************************************************************/
+void x86emuOp_inc_BP(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tEBP\n");
+ } else {
+ DECODE_PRINTF("INC\tBP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBP = inc_long(M.x86.R_EBP);
+ } else {
+ M.x86.R_BP = inc_word(M.x86.R_BP);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x46
+****************************************************************************/
+void x86emuOp_inc_SI(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tESI\n");
+ } else {
+ DECODE_PRINTF("INC\tSI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESI = inc_long(M.x86.R_ESI);
+ } else {
+ M.x86.R_SI = inc_word(M.x86.R_SI);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x47
+****************************************************************************/
+void x86emuOp_inc_DI(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tEDI\n");
+ } else {
+ DECODE_PRINTF("INC\tDI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDI = inc_long(M.x86.R_EDI);
+ } else {
+ M.x86.R_DI = inc_word(M.x86.R_DI);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x48
+****************************************************************************/
+void x86emuOp_dec_AX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tEAX\n");
+ } else {
+ DECODE_PRINTF("DEC\tAX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = dec_long(M.x86.R_EAX);
+ } else {
+ M.x86.R_AX = dec_word(M.x86.R_AX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x49
+****************************************************************************/
+void x86emuOp_dec_CX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tECX\n");
+ } else {
+ DECODE_PRINTF("DEC\tCX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ECX = dec_long(M.x86.R_ECX);
+ } else {
+ M.x86.R_CX = dec_word(M.x86.R_CX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x4a
+****************************************************************************/
+void x86emuOp_dec_DX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tEDX\n");
+ } else {
+ DECODE_PRINTF("DEC\tDX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDX = dec_long(M.x86.R_EDX);
+ } else {
+ M.x86.R_DX = dec_word(M.x86.R_DX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x4b
+****************************************************************************/
+void x86emuOp_dec_BX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tEBX\n");
+ } else {
+ DECODE_PRINTF("DEC\tBX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBX = dec_long(M.x86.R_EBX);
+ } else {
+ M.x86.R_BX = dec_word(M.x86.R_BX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x4c
+****************************************************************************/
+void x86emuOp_dec_SP(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tESP\n");
+ } else {
+ DECODE_PRINTF("DEC\tSP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESP = dec_long(M.x86.R_ESP);
+ } else {
+ M.x86.R_SP = dec_word(M.x86.R_SP);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x4d
+****************************************************************************/
+void x86emuOp_dec_BP(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tEBP\n");
+ } else {
+ DECODE_PRINTF("DEC\tBP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBP = dec_long(M.x86.R_EBP);
+ } else {
+ M.x86.R_BP = dec_word(M.x86.R_BP);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x4e
+****************************************************************************/
+void x86emuOp_dec_SI(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tESI\n");
+ } else {
+ DECODE_PRINTF("DEC\tSI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESI = dec_long(M.x86.R_ESI);
+ } else {
+ M.x86.R_SI = dec_word(M.x86.R_SI);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x4f
+****************************************************************************/
+void x86emuOp_dec_DI(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tEDI\n");
+ } else {
+ DECODE_PRINTF("DEC\tDI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDI = dec_long(M.x86.R_EDI);
+ } else {
+ M.x86.R_DI = dec_word(M.x86.R_DI);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x50
+****************************************************************************/
+void x86emuOp_push_AX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tEAX\n");
+ } else {
+ DECODE_PRINTF("PUSH\tAX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_EAX);
+ } else {
+ push_word(M.x86.R_AX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x51
+****************************************************************************/
+void x86emuOp_push_CX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tECX\n");
+ } else {
+ DECODE_PRINTF("PUSH\tCX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_ECX);
+ } else {
+ push_word(M.x86.R_CX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x52
+****************************************************************************/
+void x86emuOp_push_DX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tEDX\n");
+ } else {
+ DECODE_PRINTF("PUSH\tDX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_EDX);
+ } else {
+ push_word(M.x86.R_DX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x53
+****************************************************************************/
+void x86emuOp_push_BX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tEBX\n");
+ } else {
+ DECODE_PRINTF("PUSH\tBX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_EBX);
+ } else {
+ push_word(M.x86.R_BX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x54
+****************************************************************************/
+void x86emuOp_push_SP(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tESP\n");
+ } else {
+ DECODE_PRINTF("PUSH\tSP\n");
+ }
+ TRACE_AND_STEP();
+ /* Always push (E)SP, since we are emulating an i386 and above
+ * processor. This is necessary as some BIOS'es use this to check
+ * what type of processor is in the system.
+ */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_ESP);
+ } else {
+ push_word((u16)(M.x86.R_SP));
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x55
+****************************************************************************/
+void x86emuOp_push_BP(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tEBP\n");
+ } else {
+ DECODE_PRINTF("PUSH\tBP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_EBP);
+ } else {
+ push_word(M.x86.R_BP);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x56
+****************************************************************************/
+void x86emuOp_push_SI(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tESI\n");
+ } else {
+ DECODE_PRINTF("PUSH\tSI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_ESI);
+ } else {
+ push_word(M.x86.R_SI);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x57
+****************************************************************************/
+void x86emuOp_push_DI(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tEDI\n");
+ } else {
+ DECODE_PRINTF("PUSH\tDI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_EDI);
+ } else {
+ push_word(M.x86.R_DI);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x58
+****************************************************************************/
+void x86emuOp_pop_AX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tEAX\n");
+ } else {
+ DECODE_PRINTF("POP\tAX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = pop_long();
+ } else {
+ M.x86.R_AX = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x59
+****************************************************************************/
+void x86emuOp_pop_CX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tECX\n");
+ } else {
+ DECODE_PRINTF("POP\tCX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ECX = pop_long();
+ } else {
+ M.x86.R_CX = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x5a
+****************************************************************************/
+void x86emuOp_pop_DX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tEDX\n");
+ } else {
+ DECODE_PRINTF("POP\tDX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDX = pop_long();
+ } else {
+ M.x86.R_DX = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x5b
+****************************************************************************/
+void x86emuOp_pop_BX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tEBX\n");
+ } else {
+ DECODE_PRINTF("POP\tBX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBX = pop_long();
+ } else {
+ M.x86.R_BX = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x5c
+****************************************************************************/
+void x86emuOp_pop_SP(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tESP\n");
+ } else {
+ DECODE_PRINTF("POP\tSP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESP = pop_long();
+ } else {
+ M.x86.R_SP = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x5d
+****************************************************************************/
+void x86emuOp_pop_BP(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tEBP\n");
+ } else {
+ DECODE_PRINTF("POP\tBP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBP = pop_long();
+ } else {
+ M.x86.R_BP = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x5e
+****************************************************************************/
+void x86emuOp_pop_SI(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tESI\n");
+ } else {
+ DECODE_PRINTF("POP\tSI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESI = pop_long();
+ } else {
+ M.x86.R_SI = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x5f
+****************************************************************************/
+void x86emuOp_pop_DI(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tEDI\n");
+ } else {
+ DECODE_PRINTF("POP\tDI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDI = pop_long();
+ } else {
+ M.x86.R_DI = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x60
+****************************************************************************/
+void x86emuOp_push_all(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSHAD\n");
+ } else {
+ DECODE_PRINTF("PUSHA\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 old_sp = M.x86.R_ESP;
+
+ push_long(M.x86.R_EAX);
+ push_long(M.x86.R_ECX);
+ push_long(M.x86.R_EDX);
+ push_long(M.x86.R_EBX);
+ push_long(old_sp);
+ push_long(M.x86.R_EBP);
+ push_long(M.x86.R_ESI);
+ push_long(M.x86.R_EDI);
+ } else {
+ u16 old_sp = M.x86.R_SP;
+
+ push_word(M.x86.R_AX);
+ push_word(M.x86.R_CX);
+ push_word(M.x86.R_DX);
+ push_word(M.x86.R_BX);
+ push_word(old_sp);
+ push_word(M.x86.R_BP);
+ push_word(M.x86.R_SI);
+ push_word(M.x86.R_DI);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x61
+****************************************************************************/
+void x86emuOp_pop_all(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POPAD\n");
+ } else {
+ DECODE_PRINTF("POPA\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDI = pop_long();
+ M.x86.R_ESI = pop_long();
+ M.x86.R_EBP = pop_long();
+ M.x86.R_ESP += 4; /* skip ESP */
+ M.x86.R_EBX = pop_long();
+ M.x86.R_EDX = pop_long();
+ M.x86.R_ECX = pop_long();
+ M.x86.R_EAX = pop_long();
+ } else {
+ M.x86.R_DI = pop_word();
+ M.x86.R_SI = pop_word();
+ M.x86.R_BP = pop_word();
+ M.x86.R_SP += 2; /* skip SP */
+ M.x86.R_BX = pop_word();
+ M.x86.R_DX = pop_word();
+ M.x86.R_CX = pop_word();
+ M.x86.R_AX = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/*opcode 0x62 ILLEGAL OP, calls x86emuOp_illegal_op() */
+/*opcode 0x63 ILLEGAL OP, calls x86emuOp_illegal_op() */
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x64
+****************************************************************************/
+void x86emuOp_segovr_FS(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("FS:\n");
+ TRACE_AND_STEP();
+ M.x86.mode |= SYSMODE_SEGOVR_FS;
+ /*
+ * note the lack of DECODE_CLEAR_SEGOVR(r) since, here is one of 4
+ * opcode subroutines we do not want to do this.
+ */
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x65
+****************************************************************************/
+void x86emuOp_segovr_GS(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("GS:\n");
+ TRACE_AND_STEP();
+ M.x86.mode |= SYSMODE_SEGOVR_GS;
+ /*
+ * note the lack of DECODE_CLEAR_SEGOVR(r) since, here is one of 4
+ * opcode subroutines we do not want to do this.
+ */
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x66 - prefix for 32-bit register
+****************************************************************************/
+void x86emuOp_prefix_data(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("DATA:\n");
+ TRACE_AND_STEP();
+ M.x86.mode |= SYSMODE_PREFIX_DATA;
+ /* note no DECODE_CLEAR_SEGOVR here. */
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x67 - prefix for 32-bit address
+****************************************************************************/
+void x86emuOp_prefix_addr(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("ADDR:\n");
+ TRACE_AND_STEP();
+ M.x86.mode |= SYSMODE_PREFIX_ADDR;
+ /* note no DECODE_CLEAR_SEGOVR here. */
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x68
+****************************************************************************/
+void x86emuOp_push_word_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 imm;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ imm = fetch_long_imm();
+ } else {
+ imm = fetch_word_imm();
+ }
+ DECODE_PRINTF2("PUSH\t%x\n", imm);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(imm);
+ } else {
+ push_word((u16)imm);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x69
+****************************************************************************/
+void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("IMUL\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+ u32 res_lo,res_hi;
+ s32 imm;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u32)res_lo;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+ s16 imm;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ res = (s16)srcval * (s16)imm;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u16)res;
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+ u32 res_lo,res_hi;
+ s32 imm;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u32)res_lo;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+ s16 imm;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ res = (s16)srcval * (s16)imm;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u16)res;
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+ u32 res_lo,res_hi;
+ s32 imm;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u32)res_lo;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+ s16 imm;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ res = (s16)srcval * (s16)imm;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u16)res;
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+ u32 res_lo,res_hi;
+ s32 imm;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ imul_long_direct(&res_lo,&res_hi,(s32)*srcreg,(s32)imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u32)res_lo;
+ } else {
+ u16 *destreg,*srcreg;
+ u32 res;
+ s16 imm;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ res = (s16)*srcreg * (s16)imm;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u16)res;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x6a
+****************************************************************************/
+void x86emuOp_push_byte_IMM(u8 X86EMU_UNUSED(op1))
+{
+ s16 imm;
+
+ START_OF_INSTR();
+ imm = (s8)fetch_byte_imm();
+ DECODE_PRINTF2("PUSH\t%d\n", imm);
+ TRACE_AND_STEP();
+ push_word(imm);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x6b
+****************************************************************************/
+void x86emuOp_imul_byte_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+ s8 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("IMUL\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+ u32 res_lo,res_hi;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u32)res_lo;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ res = (s16)srcval * (s16)imm;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u16)res;
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+ u32 res_lo,res_hi;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u32)res_lo;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ res = (s16)srcval * (s16)imm;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u16)res;
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+ u32 res_lo,res_hi;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u32)res_lo;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ res = (s16)srcval * (s16)imm;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u16)res;
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+ u32 res_lo,res_hi;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ imul_long_direct(&res_lo,&res_hi,(s32)*srcreg,(s32)imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u32)res_lo;
+ } else {
+ u16 *destreg,*srcreg;
+ u32 res;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ res = (s16)*srcreg * (s16)imm;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u16)res;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x6c
+****************************************************************************/
+void x86emuOp_ins_byte(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("INSB\n");
+ ins(1);
+ TRACE_AND_STEP();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x6d
+****************************************************************************/
+void x86emuOp_ins_word(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INSD\n");
+ ins(4);
+ } else {
+ DECODE_PRINTF("INSW\n");
+ ins(2);
+ }
+ TRACE_AND_STEP();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x6e
+****************************************************************************/
+void x86emuOp_outs_byte(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("OUTSB\n");
+ outs(1);
+ TRACE_AND_STEP();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x6f
+****************************************************************************/
+void x86emuOp_outs_word(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("OUTSD\n");
+ outs(4);
+ } else {
+ DECODE_PRINTF("OUTSW\n");
+ outs(2);
+ }
+ TRACE_AND_STEP();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x70
+****************************************************************************/
+void x86emuOp_jump_near_O(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if overflow flag is set */
+ START_OF_INSTR();
+ DECODE_PRINTF("JO\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_OF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x71
+****************************************************************************/
+void x86emuOp_jump_near_NO(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if overflow is not set */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNO\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (!ACCESS_FLAG(F_OF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x72
+****************************************************************************/
+void x86emuOp_jump_near_B(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if carry flag is set. */
+ START_OF_INSTR();
+ DECODE_PRINTF("JB\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_CF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x73
+****************************************************************************/
+void x86emuOp_jump_near_NB(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if carry flag is clear. */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNB\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (!ACCESS_FLAG(F_CF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x74
+****************************************************************************/
+void x86emuOp_jump_near_Z(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if zero flag is set. */
+ START_OF_INSTR();
+ DECODE_PRINTF("JZ\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_ZF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x75
+****************************************************************************/
+void x86emuOp_jump_near_NZ(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if zero flag is clear. */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNZ\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (!ACCESS_FLAG(F_ZF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x76
+****************************************************************************/
+void x86emuOp_jump_near_BE(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if carry flag is set or if the zero
+ flag is set. */
+ START_OF_INSTR();
+ DECODE_PRINTF("JBE\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x77
+****************************************************************************/
+void x86emuOp_jump_near_NBE(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if carry flag is clear and if the zero
+ flag is clear */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNBE\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (!(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF)))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x78
+****************************************************************************/
+void x86emuOp_jump_near_S(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if sign flag is set */
+ START_OF_INSTR();
+ DECODE_PRINTF("JS\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_SF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x79
+****************************************************************************/
+void x86emuOp_jump_near_NS(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if sign flag is clear */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNS\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (!ACCESS_FLAG(F_SF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x7a
+****************************************************************************/
+void x86emuOp_jump_near_P(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if parity flag is set (even parity) */
+ START_OF_INSTR();
+ DECODE_PRINTF("JP\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_PF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x7b
+****************************************************************************/
+void x86emuOp_jump_near_NP(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if parity flag is clear (odd parity) */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNP\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (!ACCESS_FLAG(F_PF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x7c
+****************************************************************************/
+void x86emuOp_jump_near_L(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+ int sf, of;
+
+ /* jump to byte offset if sign flag not equal to overflow flag. */
+ START_OF_INSTR();
+ DECODE_PRINTF("JL\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ sf = ACCESS_FLAG(F_SF) != 0;
+ of = ACCESS_FLAG(F_OF) != 0;
+ if (sf ^ of)
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x7d
+****************************************************************************/
+void x86emuOp_jump_near_NL(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+ int sf, of;
+
+ /* jump to byte offset if sign flag not equal to overflow flag. */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNL\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ sf = ACCESS_FLAG(F_SF) != 0;
+ of = ACCESS_FLAG(F_OF) != 0;
+ /* note: inverse of above, but using == instead of xor. */
+ if (sf == of)
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x7e
+****************************************************************************/
+void x86emuOp_jump_near_LE(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+ int sf, of;
+
+ /* jump to byte offset if sign flag not equal to overflow flag
+ or the zero flag is set */
+ START_OF_INSTR();
+ DECODE_PRINTF("JLE\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ sf = ACCESS_FLAG(F_SF) != 0;
+ of = ACCESS_FLAG(F_OF) != 0;
+ if ((sf ^ of) || ACCESS_FLAG(F_ZF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x7f
+****************************************************************************/
+void x86emuOp_jump_near_NLE(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+ int sf, of;
+
+ /* jump to byte offset if sign flag equal to overflow flag.
+ and the zero flag is clear */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNLE\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ sf = ACCESS_FLAG(F_SF) != 0;
+ of = ACCESS_FLAG(F_OF) != 0;
+ if ((sf == of) && !ACCESS_FLAG(F_ZF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+static u8 (*opc80_byte_operation[])(u8 d, u8 s) =
+{
+ add_byte, /* 00 */
+ or_byte, /* 01 */
+ adc_byte, /* 02 */
+ sbb_byte, /* 03 */
+ and_byte, /* 04 */
+ sub_byte, /* 05 */
+ xor_byte, /* 06 */
+ cmp_byte, /* 07 */
+};
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x80
+****************************************************************************/
+void x86emuOp_opc80_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg;
+ uint destoffset;
+ u8 imm;
+ u8 destval;
+
+ /*
+ * Weirdo special case instruction format. Part of the opcode
+ * held below in "RH". Doubly nested case would result, except
+ * that the decoded instruction
+ */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("ADD\t");
+ break;
+ case 1:
+ DECODE_PRINTF("OR\t");
+ break;
+ case 2:
+ DECODE_PRINTF("ADC\t");
+ break;
+ case 3:
+ DECODE_PRINTF("SBB\t");
+ break;
+ case 4:
+ DECODE_PRINTF("AND\t");
+ break;
+ case 5:
+ DECODE_PRINTF("SUB\t");
+ break;
+ case 6:
+ DECODE_PRINTF("XOR\t");
+ break;
+ case 7:
+ DECODE_PRINTF("CMP\t");
+ break;
+ }
+ }
+#endif
+ /* know operation, decode the mod byte to find the addressing
+ mode. */
+ switch (mod) {
+ case 0:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc80_byte_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc80_byte_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc80_byte_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc80_byte_operation[rh]) (*destreg, imm);
+ if (rh != 7)
+ *destreg = destval;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+static u16 (*opc81_word_operation[])(u16 d, u16 s) =
+{
+ add_word, /*00 */
+ or_word, /*01 */
+ adc_word, /*02 */
+ sbb_word, /*03 */
+ and_word, /*04 */
+ sub_word, /*05 */
+ xor_word, /*06 */
+ cmp_word, /*07 */
+};
+
+static u32 (*opc81_long_operation[])(u32 d, u32 s) =
+{
+ add_long, /*00 */
+ or_long, /*01 */
+ adc_long, /*02 */
+ sbb_long, /*03 */
+ and_long, /*04 */
+ sub_long, /*05 */
+ xor_long, /*06 */
+ cmp_long, /*07 */
+};
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x81
+****************************************************************************/
+void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ /*
+ * Weirdo special case instruction format. Part of the opcode
+ * held below in "RH". Doubly nested case would result, except
+ * that the decoded instruction
+ */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("ADD\t");
+ break;
+ case 1:
+ DECODE_PRINTF("OR\t");
+ break;
+ case 2:
+ DECODE_PRINTF("ADC\t");
+ break;
+ case 3:
+ DECODE_PRINTF("SBB\t");
+ break;
+ case 4:
+ DECODE_PRINTF("AND\t");
+ break;
+ case 5:
+ DECODE_PRINTF("SUB\t");
+ break;
+ case 6:
+ DECODE_PRINTF("XOR\t");
+ break;
+ case 7:
+ DECODE_PRINTF("CMP\t");
+ break;
+ }
+ }
+#endif
+ /*
+ * Know operation, decode the mod byte to find the addressing
+ * mode.
+ */
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval,imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc81_long_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval,imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc81_word_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval,imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc81_long_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval,imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc81_word_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval,imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc81_long_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval,imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc81_word_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 destval,imm;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ imm = fetch_long_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc81_long_operation[rh]) (*destreg, imm);
+ if (rh != 7)
+ *destreg = destval;
+ } else {
+ u16 *destreg;
+ u16 destval,imm;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ imm = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc81_word_operation[rh]) (*destreg, imm);
+ if (rh != 7)
+ *destreg = destval;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+static u8 (*opc82_byte_operation[])(u8 s, u8 d) =
+{
+ add_byte, /*00 */
+ or_byte, /*01 *//*YYY UNUSED ???? */
+ adc_byte, /*02 */
+ sbb_byte, /*03 */
+ and_byte, /*04 *//*YYY UNUSED ???? */
+ sub_byte, /*05 */
+ xor_byte, /*06 *//*YYY UNUSED ???? */
+ cmp_byte, /*07 */
+};
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x82
+****************************************************************************/
+void x86emuOp_opc82_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg;
+ uint destoffset;
+ u8 imm;
+ u8 destval;
+
+ /*
+ * Weirdo special case instruction format. Part of the opcode
+ * held below in "RH". Doubly nested case would result, except
+ * that the decoded instruction Similar to opcode 81, except that
+ * the immediate byte is sign extended to a word length.
+ */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("ADD\t");
+ break;
+ case 1:
+ DECODE_PRINTF("OR\t");
+ break;
+ case 2:
+ DECODE_PRINTF("ADC\t");
+ break;
+ case 3:
+ DECODE_PRINTF("SBB\t");
+ break;
+ case 4:
+ DECODE_PRINTF("AND\t");
+ break;
+ case 5:
+ DECODE_PRINTF("SUB\t");
+ break;
+ case 6:
+ DECODE_PRINTF("XOR\t");
+ break;
+ case 7:
+ DECODE_PRINTF("CMP\t");
+ break;
+ }
+ }
+#endif
+ /* know operation, decode the mod byte to find the addressing
+ mode. */
+ switch (mod) {
+ case 0:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ destval = fetch_data_byte(destoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc82_byte_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ destval = fetch_data_byte(destoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc82_byte_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ destval = fetch_data_byte(destoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc82_byte_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc82_byte_operation[rh]) (*destreg, imm);
+ if (rh != 7)
+ *destreg = destval;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+static u16 (*opc83_word_operation[])(u16 s, u16 d) =
+{
+ add_word, /*00 */
+ or_word, /*01 *//*YYY UNUSED ???? */
+ adc_word, /*02 */
+ sbb_word, /*03 */
+ and_word, /*04 *//*YYY UNUSED ???? */
+ sub_word, /*05 */
+ xor_word, /*06 *//*YYY UNUSED ???? */
+ cmp_word, /*07 */
+};
+
+static u32 (*opc83_long_operation[])(u32 s, u32 d) =
+{
+ add_long, /*00 */
+ or_long, /*01 *//*YYY UNUSED ???? */
+ adc_long, /*02 */
+ sbb_long, /*03 */
+ and_long, /*04 *//*YYY UNUSED ???? */
+ sub_long, /*05 */
+ xor_long, /*06 *//*YYY UNUSED ???? */
+ cmp_long, /*07 */
+};
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x83
+****************************************************************************/
+void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ /*
+ * Weirdo special case instruction format. Part of the opcode
+ * held below in "RH". Doubly nested case would result, except
+ * that the decoded instruction Similar to opcode 81, except that
+ * the immediate byte is sign extended to a word length.
+ */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("ADD\t");
+ break;
+ case 1:
+ DECODE_PRINTF("OR\t");
+ break;
+ case 2:
+ DECODE_PRINTF("ADC\t");
+ break;
+ case 3:
+ DECODE_PRINTF("SBB\t");
+ break;
+ case 4:
+ DECODE_PRINTF("AND\t");
+ break;
+ case 5:
+ DECODE_PRINTF("SUB\t");
+ break;
+ case 6:
+ DECODE_PRINTF("XOR\t");
+ break;
+ case 7:
+ DECODE_PRINTF("CMP\t");
+ break;
+ }
+ }
+#endif
+ /* know operation, decode the mod byte to find the addressing
+ mode. */
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval,imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ destval = fetch_data_long(destoffset);
+ imm = (s8) fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc83_long_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval,imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ destval = fetch_data_word(destoffset);
+ imm = (s8) fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc83_word_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval,imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ destval = fetch_data_long(destoffset);
+ imm = (s8) fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc83_long_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval,imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ destval = fetch_data_word(destoffset);
+ imm = (s8) fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc83_word_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval,imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ destval = fetch_data_long(destoffset);
+ imm = (s8) fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc83_long_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval,imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ destval = fetch_data_word(destoffset);
+ imm = (s8) fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc83_word_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 destval,imm;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ imm = (s8) fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc83_long_operation[rh]) (*destreg, imm);
+ if (rh != 7)
+ *destreg = destval;
+ } else {
+ u16 *destreg;
+ u16 destval,imm;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ imm = (s8) fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc83_word_operation[rh]) (*destreg, imm);
+ if (rh != 7)
+ *destreg = destval;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x84
+****************************************************************************/
+void x86emuOp_test_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint destoffset;
+ u8 destval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("TEST\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_byte(destval, *srcreg);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_byte(destval, *srcreg);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_byte(destval, *srcreg);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x85
+****************************************************************************/
+void x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("TEST\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_long(destval, *srcreg);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_word(destval, *srcreg);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_long(destval, *srcreg);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_word(destval, *srcreg);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_long(destval, *srcreg);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_word(destval, *srcreg);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x86
+****************************************************************************/
+void x86emuOp_xchg_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint destoffset;
+ u8 destval;
+ u8 tmp;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("XCHG\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = destval;
+ destval = tmp;
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = destval;
+ destval = tmp;
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = destval;
+ destval = tmp;
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = *destreg;
+ *destreg = tmp;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x87
+****************************************************************************/
+void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("XCHG\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg;
+ u32 destval,tmp;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = destval;
+ destval = tmp;
+ store_data_long(destoffset, destval);
+ } else {
+ u16 *srcreg;
+ u16 destval,tmp;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = destval;
+ destval = tmp;
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg;
+ u32 destval,tmp;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = destval;
+ destval = tmp;
+ store_data_long(destoffset, destval);
+ } else {
+ u16 *srcreg;
+ u16 destval,tmp;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = destval;
+ destval = tmp;
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg;
+ u32 destval,tmp;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = destval;
+ destval = tmp;
+ store_data_long(destoffset, destval);
+ } else {
+ u16 *srcreg;
+ u16 destval,tmp;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = destval;
+ destval = tmp;
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+ u32 tmp;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = *destreg;
+ *destreg = tmp;
+ } else {
+ u16 *destreg,*srcreg;
+ u16 tmp;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = *destreg;
+ *destreg = tmp;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x88
+****************************************************************************/
+void x86emuOp_mov_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ store_data_byte(destoffset, *srcreg);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ store_data_byte(destoffset, *srcreg);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ store_data_byte(destoffset, *srcreg);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x89
+****************************************************************************/
+void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ store_data_long(destoffset, *srcreg);
+ } else {
+ u16 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ store_data_word(destoffset, *srcreg);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ store_data_long(destoffset, *srcreg);
+ } else {
+ u16 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ store_data_word(destoffset, *srcreg);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ store_data_long(destoffset, *srcreg);
+ } else {
+ u16 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ store_data_word(destoffset, *srcreg);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x8a
+****************************************************************************/
+void x86emuOp_mov_byte_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint srcoffset;
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+ case 1:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+ case 2:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x8b
+****************************************************************************/
+void x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg, *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+ } else {
+ u16 *destreg, *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x8c
+****************************************************************************/
+void x86emuOp_mov_word_RM_SR(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u16 *destreg, *srcreg;
+ uint destoffset;
+ u16 destval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = decode_rm_seg_register(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = *srcreg;
+ store_data_word(destoffset, destval);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = decode_rm_seg_register(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = *srcreg;
+ store_data_word(destoffset, destval);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = decode_rm_seg_register(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = *srcreg;
+ store_data_word(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = decode_rm_seg_register(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x8d
+****************************************************************************/
+void x86emuOp_lea_word_R_M(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u16 *srcreg;
+ uint destoffset;
+
+/*
+ * TODO: Need to handle address size prefix!
+ *
+ * lea eax,[eax+ebx*2] ??
+ */
+
+ START_OF_INSTR();
+ DECODE_PRINTF("LEA\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *srcreg = (u16)destoffset;
+ break;
+ case 1:
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *srcreg = (u16)destoffset;
+ break;
+ case 2:
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *srcreg = (u16)destoffset;
+ break;
+ case 3: /* register to register */
+ /* undefined. Do nothing. */
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x8e
+****************************************************************************/
+void x86emuOp_mov_word_SR_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u16 *destreg, *srcreg;
+ uint srcoffset;
+ u16 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = decode_rm_seg_register(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+ case 1:
+ destreg = decode_rm_seg_register(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+ case 2:
+ destreg = decode_rm_seg_register(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+ case 3: /* register to register */
+ destreg = decode_rm_seg_register(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+ break;
+ }
+ /*
+ * Clean up, and reset all the R_xSP pointers to the correct
+ * locations. This is about 3x too much overhead (doing all the
+ * segreg ptrs when only one is needed, but this instruction
+ * *cannot* be that common, and this isn't too much work anyway.
+ */
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x8f
+****************************************************************************/
+void x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("POP\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ if (rh != 0) {
+ DECODE_PRINTF("ILLEGAL DECODE OF OPCODE 8F\n");
+ HALT_SYS();
+ }
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = pop_long();
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = pop_word();
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = pop_long();
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = pop_word();
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = pop_long();
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = pop_word();
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = pop_long();
+ } else {
+ u16 *destreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = pop_word();
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x90
+****************************************************************************/
+void x86emuOp_nop(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("NOP\n");
+ TRACE_AND_STEP();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x91
+****************************************************************************/
+void x86emuOp_xchg_word_AX_CX(u8 X86EMU_UNUSED(op1))
+{
+ u32 tmp;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XCHG\tEAX,ECX\n");
+ } else {
+ DECODE_PRINTF("XCHG\tAX,CX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ tmp = M.x86.R_EAX;
+ M.x86.R_EAX = M.x86.R_ECX;
+ M.x86.R_ECX = tmp;
+ } else {
+ tmp = M.x86.R_AX;
+ M.x86.R_AX = M.x86.R_CX;
+ M.x86.R_CX = (u16)tmp;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x92
+****************************************************************************/
+void x86emuOp_xchg_word_AX_DX(u8 X86EMU_UNUSED(op1))
+{
+ u32 tmp;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XCHG\tEAX,EDX\n");
+ } else {
+ DECODE_PRINTF("XCHG\tAX,DX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ tmp = M.x86.R_EAX;
+ M.x86.R_EAX = M.x86.R_EDX;
+ M.x86.R_EDX = tmp;
+ } else {
+ tmp = M.x86.R_AX;
+ M.x86.R_AX = M.x86.R_DX;
+ M.x86.R_DX = (u16)tmp;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x93
+****************************************************************************/
+void x86emuOp_xchg_word_AX_BX(u8 X86EMU_UNUSED(op1))
+{
+ u32 tmp;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XCHG\tEAX,EBX\n");
+ } else {
+ DECODE_PRINTF("XCHG\tAX,BX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ tmp = M.x86.R_EAX;
+ M.x86.R_EAX = M.x86.R_EBX;
+ M.x86.R_EBX = tmp;
+ } else {
+ tmp = M.x86.R_AX;
+ M.x86.R_AX = M.x86.R_BX;
+ M.x86.R_BX = (u16)tmp;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x94
+****************************************************************************/
+void x86emuOp_xchg_word_AX_SP(u8 X86EMU_UNUSED(op1))
+{
+ u32 tmp;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XCHG\tEAX,ESP\n");
+ } else {
+ DECODE_PRINTF("XCHG\tAX,SP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ tmp = M.x86.R_EAX;
+ M.x86.R_EAX = M.x86.R_ESP;
+ M.x86.R_ESP = tmp;
+ } else {
+ tmp = M.x86.R_AX;
+ M.x86.R_AX = M.x86.R_SP;
+ M.x86.R_SP = (u16)tmp;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x95
+****************************************************************************/
+void x86emuOp_xchg_word_AX_BP(u8 X86EMU_UNUSED(op1))
+{
+ u32 tmp;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XCHG\tEAX,EBP\n");
+ } else {
+ DECODE_PRINTF("XCHG\tAX,BP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ tmp = M.x86.R_EAX;
+ M.x86.R_EAX = M.x86.R_EBP;
+ M.x86.R_EBP = tmp;
+ } else {
+ tmp = M.x86.R_AX;
+ M.x86.R_AX = M.x86.R_BP;
+ M.x86.R_BP = (u16)tmp;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x96
+****************************************************************************/
+void x86emuOp_xchg_word_AX_SI(u8 X86EMU_UNUSED(op1))
+{
+ u32 tmp;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XCHG\tEAX,ESI\n");
+ } else {
+ DECODE_PRINTF("XCHG\tAX,SI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ tmp = M.x86.R_EAX;
+ M.x86.R_EAX = M.x86.R_ESI;
+ M.x86.R_ESI = tmp;
+ } else {
+ tmp = M.x86.R_AX;
+ M.x86.R_AX = M.x86.R_SI;
+ M.x86.R_SI = (u16)tmp;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x97
+****************************************************************************/
+void x86emuOp_xchg_word_AX_DI(u8 X86EMU_UNUSED(op1))
+{
+ u32 tmp;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XCHG\tEAX,EDI\n");
+ } else {
+ DECODE_PRINTF("XCHG\tAX,DI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ tmp = M.x86.R_EAX;
+ M.x86.R_EAX = M.x86.R_EDI;
+ M.x86.R_EDI = tmp;
+ } else {
+ tmp = M.x86.R_AX;
+ M.x86.R_AX = M.x86.R_DI;
+ M.x86.R_DI = (u16)tmp;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x98
+****************************************************************************/
+void x86emuOp_cbw(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("CWDE\n");
+ } else {
+ DECODE_PRINTF("CBW\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ if (M.x86.R_AX & 0x8000) {
+ M.x86.R_EAX |= 0xffff0000;
+ } else {
+ M.x86.R_EAX &= 0x0000ffff;
+ }
+ } else {
+ if (M.x86.R_AL & 0x80) {
+ M.x86.R_AH = 0xff;
+ } else {
+ M.x86.R_AH = 0x0;
+ }
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x99
+****************************************************************************/
+void x86emuOp_cwd(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("CDQ\n");
+ } else {
+ DECODE_PRINTF("CWD\n");
+ }
+ DECODE_PRINTF("CWD\n");
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ if (M.x86.R_EAX & 0x80000000) {
+ M.x86.R_EDX = 0xffffffff;
+ } else {
+ M.x86.R_EDX = 0x0;
+ }
+ } else {
+ if (M.x86.R_AX & 0x8000) {
+ M.x86.R_DX = 0xffff;
+ } else {
+ M.x86.R_DX = 0x0;
+ }
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x9a
+****************************************************************************/
+void x86emuOp_call_far_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u16 farseg, faroff;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("CALL\t");
+ faroff = fetch_word_imm();
+ farseg = fetch_word_imm();
+ DECODE_PRINTF2("%04x:", farseg);
+ DECODE_PRINTF2("%04x\n", faroff);
+ CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, farseg, faroff, "FAR ");
+
+ /* XXX
+ *
+ * Hooked interrupt vectors calling into our "BIOS" will cause
+ * problems unless all intersegment stuff is checked for BIOS
+ * access. Check needed here. For moment, let it alone.
+ */
+ TRACE_AND_STEP();
+ push_word(M.x86.R_CS);
+ M.x86.R_CS = farseg;
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = faroff;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x9b
+****************************************************************************/
+void x86emuOp_wait(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("WAIT");
+ TRACE_AND_STEP();
+ /* NADA. */
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x9c
+****************************************************************************/
+void x86emuOp_pushf_word(u8 X86EMU_UNUSED(op1))
+{
+ u32 flags;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSHFD\n");
+ } else {
+ DECODE_PRINTF("PUSHF\n");
+ }
+ TRACE_AND_STEP();
+
+ /* clear out *all* bits not representing flags, and turn on real bits */
+ flags = (M.x86.R_EFLG & F_MSK) | F_ALWAYS_ON;
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(flags);
+ } else {
+ push_word((u16)flags);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x9d
+****************************************************************************/
+void x86emuOp_popf_word(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POPFD\n");
+ } else {
+ DECODE_PRINTF("POPF\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EFLG = pop_long();
+ } else {
+ M.x86.R_FLG = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x9e
+****************************************************************************/
+void x86emuOp_sahf(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("SAHF\n");
+ TRACE_AND_STEP();
+ /* clear the lower bits of the flag register */
+ M.x86.R_FLG &= 0xffffff00;
+ /* or in the AH register into the flags register */
+ M.x86.R_FLG |= M.x86.R_AH;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x9f
+****************************************************************************/
+void x86emuOp_lahf(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("LAHF\n");
+ TRACE_AND_STEP();
+ M.x86.R_AH = (u8)(M.x86.R_FLG & 0xff);
+ /*undocumented TC++ behavior??? Nope. It's documented, but
+ you have too look real hard to notice it. */
+ M.x86.R_AH |= 0x2;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa0
+****************************************************************************/
+void x86emuOp_mov_AL_M_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u16 offset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\tAL,");
+ offset = fetch_word_imm();
+ DECODE_PRINTF2("[%04x]\n", offset);
+ TRACE_AND_STEP();
+ M.x86.R_AL = fetch_data_byte(offset);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa1
+****************************************************************************/
+void x86emuOp_mov_AX_M_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u16 offset;
+
+ START_OF_INSTR();
+ offset = fetch_word_imm();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF2("MOV\tEAX,[%04x]\n", offset);
+ } else {
+ DECODE_PRINTF2("MOV\tAX,[%04x]\n", offset);
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = fetch_data_long(offset);
+ } else {
+ M.x86.R_AX = fetch_data_word(offset);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa2
+****************************************************************************/
+void x86emuOp_mov_M_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u16 offset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\t");
+ offset = fetch_word_imm();
+ DECODE_PRINTF2("[%04x],AL\n", offset);
+ TRACE_AND_STEP();
+ store_data_byte(offset, M.x86.R_AL);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa3
+****************************************************************************/
+void x86emuOp_mov_M_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u16 offset;
+
+ START_OF_INSTR();
+ offset = fetch_word_imm();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF2("MOV\t[%04x],EAX\n", offset);
+ } else {
+ DECODE_PRINTF2("MOV\t[%04x],AX\n", offset);
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ store_data_long(offset, M.x86.R_EAX);
+ } else {
+ store_data_word(offset, M.x86.R_AX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa4
+****************************************************************************/
+void x86emuOp_movs_byte(u8 X86EMU_UNUSED(op1))
+{
+ u8 val;
+ u32 count;
+ int inc;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOVS\tBYTE\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -1;
+ else
+ inc = 1;
+ TRACE_AND_STEP();
+ count = 1;
+ if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+ /* dont care whether REPE or REPNE */
+ /* move them until CX is ZERO. */
+ count = M.x86.R_CX;
+ M.x86.R_CX = 0;
+ M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+ }
+ while (count--) {
+ val = fetch_data_byte(M.x86.R_SI);
+ store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, val);
+ M.x86.R_SI += inc;
+ M.x86.R_DI += inc;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa5
+****************************************************************************/
+void x86emuOp_movs_word(u8 X86EMU_UNUSED(op1))
+{
+ u32 val;
+ int inc;
+ u32 count;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOVS\tDWORD\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -4;
+ else
+ inc = 4;
+ } else {
+ DECODE_PRINTF("MOVS\tWORD\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -2;
+ else
+ inc = 2;
+ }
+ TRACE_AND_STEP();
+ count = 1;
+ if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+ /* dont care whether REPE or REPNE */
+ /* move them until CX is ZERO. */
+ count = M.x86.R_CX;
+ M.x86.R_CX = 0;
+ M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+ }
+ while (count--) {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ val = fetch_data_long(M.x86.R_SI);
+ store_data_long_abs(M.x86.R_ES, M.x86.R_DI, val);
+ } else {
+ val = fetch_data_word(M.x86.R_SI);
+ store_data_word_abs(M.x86.R_ES, M.x86.R_DI, (u16)val);
+ }
+ M.x86.R_SI += inc;
+ M.x86.R_DI += inc;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa6
+****************************************************************************/
+void x86emuOp_cmps_byte(u8 X86EMU_UNUSED(op1))
+{
+ s8 val1, val2;
+ int inc;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("CMPS\tBYTE\n");
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -1;
+ else
+ inc = 1;
+
+ if (M.x86.mode & SYSMODE_PREFIX_REPE) {
+ /* REPE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+ val1 = fetch_data_byte(M.x86.R_SI);
+ val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_byte(val1, val2);
+ M.x86.R_CX -= 1;
+ M.x86.R_SI += inc;
+ M.x86.R_DI += inc;
+ if (ACCESS_FLAG(F_ZF) == 0)
+ break;
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPE;
+ } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
+ /* REPNE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+ val1 = fetch_data_byte(M.x86.R_SI);
+ val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_byte(val1, val2);
+ M.x86.R_CX -= 1;
+ M.x86.R_SI += inc;
+ M.x86.R_DI += inc;
+ if (ACCESS_FLAG(F_ZF))
+ break; /* zero flag set means equal */
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
+ } else {
+ val1 = fetch_data_byte(M.x86.R_SI);
+ val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_byte(val1, val2);
+ M.x86.R_SI += inc;
+ M.x86.R_DI += inc;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa7
+****************************************************************************/
+void x86emuOp_cmps_word(u8 X86EMU_UNUSED(op1))
+{
+ u32 val1,val2;
+ int inc;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("CMPS\tDWORD\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -4;
+ else
+ inc = 4;
+ } else {
+ DECODE_PRINTF("CMPS\tWORD\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -2;
+ else
+ inc = 2;
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_REPE) {
+ /* REPE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ val1 = fetch_data_long(M.x86.R_SI);
+ val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_long(val1, val2);
+ } else {
+ val1 = fetch_data_word(M.x86.R_SI);
+ val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_word((u16)val1, (u16)val2);
+ }
+ M.x86.R_CX -= 1;
+ M.x86.R_SI += inc;
+ M.x86.R_DI += inc;
+ if (ACCESS_FLAG(F_ZF) == 0)
+ break;
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPE;
+ } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
+ /* REPNE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ val1 = fetch_data_long(M.x86.R_SI);
+ val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_long(val1, val2);
+ } else {
+ val1 = fetch_data_word(M.x86.R_SI);
+ val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_word((u16)val1, (u16)val2);
+ }
+ M.x86.R_CX -= 1;
+ M.x86.R_SI += inc;
+ M.x86.R_DI += inc;
+ if (ACCESS_FLAG(F_ZF))
+ break; /* zero flag set means equal */
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
+ } else {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ val1 = fetch_data_long(M.x86.R_SI);
+ val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_long(val1, val2);
+ } else {
+ val1 = fetch_data_word(M.x86.R_SI);
+ val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_word((u16)val1, (u16)val2);
+ }
+ M.x86.R_SI += inc;
+ M.x86.R_DI += inc;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa8
+****************************************************************************/
+void x86emuOp_test_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("TEST\tAL,");
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%04x\n", imm);
+ TRACE_AND_STEP();
+ test_byte(M.x86.R_AL, (u8)imm);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa9
+****************************************************************************/
+void x86emuOp_test_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("TEST\tEAX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("TEST\tAX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ test_long(M.x86.R_EAX, srcval);
+ } else {
+ test_word(M.x86.R_AX, (u16)srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xaa
+****************************************************************************/
+void x86emuOp_stos_byte(u8 X86EMU_UNUSED(op1))
+{
+ int inc;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("STOS\tBYTE\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -1;
+ else
+ inc = 1;
+ TRACE_AND_STEP();
+ if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+ /* dont care whether REPE or REPNE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+ store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AL);
+ M.x86.R_CX -= 1;
+ M.x86.R_DI += inc;
+ }
+ M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+ } else {
+ store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AL);
+ M.x86.R_DI += inc;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xab
+****************************************************************************/
+void x86emuOp_stos_word(u8 X86EMU_UNUSED(op1))
+{
+ int inc;
+ u32 count;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("STOS\tDWORD\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -4;
+ else
+ inc = 4;
+ } else {
+ DECODE_PRINTF("STOS\tWORD\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -2;
+ else
+ inc = 2;
+ }
+ TRACE_AND_STEP();
+ count = 1;
+ if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+ /* dont care whether REPE or REPNE */
+ /* move them until CX is ZERO. */
+ count = M.x86.R_CX;
+ M.x86.R_CX = 0;
+ M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+ }
+ while (count--) {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ store_data_long_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_EAX);
+ } else {
+ store_data_word_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AX);
+ }
+ M.x86.R_DI += inc;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xac
+****************************************************************************/
+void x86emuOp_lods_byte(u8 X86EMU_UNUSED(op1))
+{
+ int inc;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("LODS\tBYTE\n");
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -1;
+ else
+ inc = 1;
+ if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+ /* dont care whether REPE or REPNE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+ M.x86.R_AL = fetch_data_byte(M.x86.R_SI);
+ M.x86.R_CX -= 1;
+ M.x86.R_SI += inc;
+ }
+ M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+ } else {
+ M.x86.R_AL = fetch_data_byte(M.x86.R_SI);
+ M.x86.R_SI += inc;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xad
+****************************************************************************/
+void x86emuOp_lods_word(u8 X86EMU_UNUSED(op1))
+{
+ int inc;
+ u32 count;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("LODS\tDWORD\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -4;
+ else
+ inc = 4;
+ } else {
+ DECODE_PRINTF("LODS\tWORD\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -2;
+ else
+ inc = 2;
+ }
+ TRACE_AND_STEP();
+ count = 1;
+ if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+ /* dont care whether REPE or REPNE */
+ /* move them until CX is ZERO. */
+ count = M.x86.R_CX;
+ M.x86.R_CX = 0;
+ M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+ }
+ while (count--) {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = fetch_data_long(M.x86.R_SI);
+ } else {
+ M.x86.R_AX = fetch_data_word(M.x86.R_SI);
+ }
+ M.x86.R_SI += inc;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xae
+****************************************************************************/
+void x86emuOp_scas_byte(u8 X86EMU_UNUSED(op1))
+{
+ s8 val2;
+ int inc;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SCAS\tBYTE\n");
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -1;
+ else
+ inc = 1;
+ if (M.x86.mode & SYSMODE_PREFIX_REPE) {
+ /* REPE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+ val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_byte(M.x86.R_AL, val2);
+ M.x86.R_CX -= 1;
+ M.x86.R_DI += inc;
+ if (ACCESS_FLAG(F_ZF) == 0)
+ break;
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPE;
+ } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
+ /* REPNE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+ val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_byte(M.x86.R_AL, val2);
+ M.x86.R_CX -= 1;
+ M.x86.R_DI += inc;
+ if (ACCESS_FLAG(F_ZF))
+ break; /* zero flag set means equal */
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
+ } else {
+ val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_byte(M.x86.R_AL, val2);
+ M.x86.R_DI += inc;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xaf
+****************************************************************************/
+void x86emuOp_scas_word(u8 X86EMU_UNUSED(op1))
+{
+ int inc;
+ u32 val;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("SCAS\tDWORD\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -4;
+ else
+ inc = 4;
+ } else {
+ DECODE_PRINTF("SCAS\tWORD\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -2;
+ else
+ inc = 2;
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_REPE) {
+ /* REPE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_long(M.x86.R_EAX, val);
+ } else {
+ val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_word(M.x86.R_AX, (u16)val);
+ }
+ M.x86.R_CX -= 1;
+ M.x86.R_DI += inc;
+ if (ACCESS_FLAG(F_ZF) == 0)
+ break;
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPE;
+ } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
+ /* REPNE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_long(M.x86.R_EAX, val);
+ } else {
+ val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_word(M.x86.R_AX, (u16)val);
+ }
+ M.x86.R_CX -= 1;
+ M.x86.R_DI += inc;
+ if (ACCESS_FLAG(F_ZF))
+ break; /* zero flag set means equal */
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
+ } else {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_long(M.x86.R_EAX, val);
+ } else {
+ val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_word(M.x86.R_AX, (u16)val);
+ }
+ M.x86.R_DI += inc;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb0
+****************************************************************************/
+void x86emuOp_mov_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\tAL,");
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ M.x86.R_AL = imm;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb1
+****************************************************************************/
+void x86emuOp_mov_byte_CL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\tCL,");
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ M.x86.R_CL = imm;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb2
+****************************************************************************/
+void x86emuOp_mov_byte_DL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\tDL,");
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ M.x86.R_DL = imm;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb3
+****************************************************************************/
+void x86emuOp_mov_byte_BL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\tBL,");
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ M.x86.R_BL = imm;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb4
+****************************************************************************/
+void x86emuOp_mov_byte_AH_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\tAH,");
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ M.x86.R_AH = imm;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb5
+****************************************************************************/
+void x86emuOp_mov_byte_CH_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\tCH,");
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ M.x86.R_CH = imm;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb6
+****************************************************************************/
+void x86emuOp_mov_byte_DH_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\tDH,");
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ M.x86.R_DH = imm;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb7
+****************************************************************************/
+void x86emuOp_mov_byte_BH_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\tBH,");
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ M.x86.R_BH = imm;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb8
+****************************************************************************/
+void x86emuOp_mov_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tEAX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("MOV\tAX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = srcval;
+ } else {
+ M.x86.R_AX = (u16)srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb9
+****************************************************************************/
+void x86emuOp_mov_word_CX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tECX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("MOV\tCX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ECX = srcval;
+ } else {
+ M.x86.R_CX = (u16)srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xba
+****************************************************************************/
+void x86emuOp_mov_word_DX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tEDX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("MOV\tDX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDX = srcval;
+ } else {
+ M.x86.R_DX = (u16)srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xbb
+****************************************************************************/
+void x86emuOp_mov_word_BX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tEBX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("MOV\tBX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBX = srcval;
+ } else {
+ M.x86.R_BX = (u16)srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xbc
+****************************************************************************/
+void x86emuOp_mov_word_SP_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tESP,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("MOV\tSP,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESP = srcval;
+ } else {
+ M.x86.R_SP = (u16)srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xbd
+****************************************************************************/
+void x86emuOp_mov_word_BP_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tEBP,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("MOV\tBP,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBP = srcval;
+ } else {
+ M.x86.R_BP = (u16)srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xbe
+****************************************************************************/
+void x86emuOp_mov_word_SI_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tESI,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("MOV\tSI,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESI = srcval;
+ } else {
+ M.x86.R_SI = (u16)srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xbf
+****************************************************************************/
+void x86emuOp_mov_word_DI_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tEDI,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("MOV\tDI,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDI = srcval;
+ } else {
+ M.x86.R_DI = (u16)srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/* used by opcodes c0, d0, and d2. */
+static u8(*opcD0_byte_operation[])(u8 d, u8 s) =
+{
+ rol_byte,
+ ror_byte,
+ rcl_byte,
+ rcr_byte,
+ shl_byte,
+ shr_byte,
+ shl_byte, /* sal_byte === shl_byte by definition */
+ sar_byte,
+};
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc0
+****************************************************************************/
+void x86emuOp_opcC0_byte_RM_MEM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg;
+ uint destoffset;
+ u8 destval;
+ u8 amt;
+
+ /*
+ * Yet another weirdo special case instruction format. Part of
+ * the opcode held below in "RH". Doubly nested case would
+ * result, except that the decoded instruction
+ */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("ROL\t");
+ break;
+ case 1:
+ DECODE_PRINTF("ROR\t");
+ break;
+ case 2:
+ DECODE_PRINTF("RCL\t");
+ break;
+ case 3:
+ DECODE_PRINTF("RCR\t");
+ break;
+ case 4:
+ DECODE_PRINTF("SHL\t");
+ break;
+ case 5:
+ DECODE_PRINTF("SHR\t");
+ break;
+ case 6:
+ DECODE_PRINTF("SAL\t");
+ break;
+ case 7:
+ DECODE_PRINTF("SAR\t");
+ break;
+ }
+ }
+#endif
+ /* know operation, decode the mod byte to find the addressing
+ mode. */
+ switch (mod) {
+ case 0:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (destval, amt);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (destval, amt);
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (destval, amt);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (*destreg, amt);
+ *destreg = destval;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/* used by opcodes c1, d1, and d3. */
+static u16(*opcD1_word_operation[])(u16 s, u8 d) =
+{
+ rol_word,
+ ror_word,
+ rcl_word,
+ rcr_word,
+ shl_word,
+ shr_word,
+ shl_word, /* sal_byte === shl_byte by definition */
+ sar_word,
+};
+
+/* used by opcodes c1, d1, and d3. */
+static u32 (*opcD1_long_operation[])(u32 s, u8 d) =
+{
+ rol_long,
+ ror_long,
+ rcl_long,
+ rcr_long,
+ shl_long,
+ shr_long,
+ shl_long, /* sal_byte === shl_byte by definition */
+ sar_long,
+};
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc1
+****************************************************************************/
+void x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+ u8 amt;
+
+ /*
+ * Yet another weirdo special case instruction format. Part of
+ * the opcode held below in "RH". Doubly nested case would
+ * result, except that the decoded instruction
+ */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("ROL\t");
+ break;
+ case 1:
+ DECODE_PRINTF("ROR\t");
+ break;
+ case 2:
+ DECODE_PRINTF("RCL\t");
+ break;
+ case 3:
+ DECODE_PRINTF("RCR\t");
+ break;
+ case 4:
+ DECODE_PRINTF("SHL\t");
+ break;
+ case 5:
+ DECODE_PRINTF("SHR\t");
+ break;
+ case 6:
+ DECODE_PRINTF("SAL\t");
+ break;
+ case 7:
+ DECODE_PRINTF("SAR\t");
+ break;
+ }
+ }
+#endif
+ /* know operation, decode the mod byte to find the addressing
+ mode. */
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, amt);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_word_operation[rh]) (destval, amt);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, amt);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_word_operation[rh]) (destval, amt);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, amt);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_word_operation[rh]) (destval, amt);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ TRACE_AND_STEP();
+ *destreg = (*opcD1_long_operation[rh]) (*destreg, amt);
+ } else {
+ u16 *destreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ TRACE_AND_STEP();
+ *destreg = (*opcD1_word_operation[rh]) (*destreg, amt);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc2
+****************************************************************************/
+void x86emuOp_ret_near_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u16 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("RET\t");
+ imm = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ RETURN_TRACE("RET",M.x86.saved_cs,M.x86.saved_ip);
+ TRACE_AND_STEP();
+ M.x86.R_IP = pop_word();
+ M.x86.R_SP += imm;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc3
+****************************************************************************/
+void x86emuOp_ret_near(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("RET\n");
+ RETURN_TRACE("RET",M.x86.saved_cs,M.x86.saved_ip);
+ TRACE_AND_STEP();
+ M.x86.R_IP = pop_word();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc4
+****************************************************************************/
+void x86emuOp_les_R_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rh, rl;
+ u16 *dstreg;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("LES\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_ES = fetch_data_word(srcoffset + 2);
+ break;
+ case 1:
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_ES = fetch_data_word(srcoffset + 2);
+ break;
+ case 2:
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_ES = fetch_data_word(srcoffset + 2);
+ break;
+ case 3: /* register to register */
+ /* UNDEFINED! */
+ TRACE_AND_STEP();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc5
+****************************************************************************/
+void x86emuOp_lds_R_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rh, rl;
+ u16 *dstreg;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("LDS\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_DS = fetch_data_word(srcoffset + 2);
+ break;
+ case 1:
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_DS = fetch_data_word(srcoffset + 2);
+ break;
+ case 2:
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_DS = fetch_data_word(srcoffset + 2);
+ break;
+ case 3: /* register to register */
+ /* UNDEFINED! */
+ TRACE_AND_STEP();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc6
+****************************************************************************/
+void x86emuOp_mov_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg;
+ uint destoffset;
+ u8 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ if (rh != 0) {
+ DECODE_PRINTF("ILLEGAL DECODE OF OPCODE c6\n");
+ HALT_SYS();
+ }
+ switch (mod) {
+ case 0:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%2x\n", imm);
+ TRACE_AND_STEP();
+ store_data_byte(destoffset, imm);
+ break;
+ case 1:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%2x\n", imm);
+ TRACE_AND_STEP();
+ store_data_byte(destoffset, imm);
+ break;
+ case 2:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%2x\n", imm);
+ TRACE_AND_STEP();
+ store_data_byte(destoffset, imm);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%2x\n", imm);
+ TRACE_AND_STEP();
+ *destreg = imm;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc7
+****************************************************************************/
+void x86emuOp_mov_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ if (rh != 0) {
+ DECODE_PRINTF("ILLEGAL DECODE OF OPCODE 8F\n");
+ HALT_SYS();
+ }
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ store_data_long(destoffset, imm);
+ } else {
+ u16 imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ store_data_word(destoffset, imm);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ store_data_long(destoffset, imm);
+ } else {
+ u16 imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ store_data_word(destoffset, imm);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ store_data_long(destoffset, imm);
+ } else {
+ u16 imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ store_data_word(destoffset, imm);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 imm;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ *destreg = imm;
+ } else {
+ u16 *destreg;
+ u16 imm;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ *destreg = imm;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc8
+****************************************************************************/
+void x86emuOp_enter(u8 X86EMU_UNUSED(op1))
+{
+ u16 local,frame_pointer;
+ u8 nesting;
+ int i;
+
+ START_OF_INSTR();
+ local = fetch_word_imm();
+ nesting = fetch_byte_imm();
+ DECODE_PRINTF2("ENTER %x\n", local);
+ DECODE_PRINTF2(",%x\n", nesting);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_BP);
+ frame_pointer = M.x86.R_SP;
+ if (nesting > 0) {
+ for (i = 1; i < nesting; i++) {
+ M.x86.R_BP -= 2;
+ push_word(fetch_data_word_abs(M.x86.R_SS, M.x86.R_BP));
+ }
+ push_word(frame_pointer);
+ }
+ M.x86.R_BP = frame_pointer;
+ M.x86.R_SP = (u16)(M.x86.R_SP - local);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc9
+****************************************************************************/
+void x86emuOp_leave(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("LEAVE\n");
+ TRACE_AND_STEP();
+ M.x86.R_SP = M.x86.R_BP;
+ M.x86.R_BP = pop_word();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xca
+****************************************************************************/
+void x86emuOp_ret_far_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u16 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("RETF\t");
+ imm = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ RETURN_TRACE("RETF",M.x86.saved_cs,M.x86.saved_ip);
+ TRACE_AND_STEP();
+ M.x86.R_IP = pop_word();
+ M.x86.R_CS = pop_word();
+ M.x86.R_SP += imm;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xcb
+****************************************************************************/
+void x86emuOp_ret_far(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("RETF\n");
+ RETURN_TRACE("RETF",M.x86.saved_cs,M.x86.saved_ip);
+ TRACE_AND_STEP();
+ M.x86.R_IP = pop_word();
+ M.x86.R_CS = pop_word();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xcc
+****************************************************************************/
+void x86emuOp_int3(u8 X86EMU_UNUSED(op1))
+{
+ u16 tmp;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("INT 3\n");
+ tmp = (u16) mem_access_word(3 * 4 + 2);
+ /* access the segment register */
+ TRACE_AND_STEP();
+ if (_X86EMU_intrTab[3]) {
+ (*_X86EMU_intrTab[3])(3);
+ } else {
+ push_word((u16)M.x86.R_FLG);
+ CLEAR_FLAG(F_IF);
+ CLEAR_FLAG(F_TF);
+ push_word(M.x86.R_CS);
+ M.x86.R_CS = mem_access_word(3 * 4 + 2);
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = mem_access_word(3 * 4);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xcd
+****************************************************************************/
+void x86emuOp_int_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u16 tmp;
+ u8 intnum;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("INT\t");
+ intnum = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", intnum);
+ tmp = mem_access_word(intnum * 4 + 2);
+ TRACE_AND_STEP();
+ if (_X86EMU_intrTab[intnum]) {
+ (*_X86EMU_intrTab[intnum])(intnum);
+ } else {
+ push_word((u16)M.x86.R_FLG);
+ CLEAR_FLAG(F_IF);
+ CLEAR_FLAG(F_TF);
+ push_word(M.x86.R_CS);
+ M.x86.R_CS = mem_access_word(intnum * 4 + 2);
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = mem_access_word(intnum * 4);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xce
+****************************************************************************/
+void x86emuOp_into(u8 X86EMU_UNUSED(op1))
+{
+ u16 tmp;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("INTO\n");
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_OF)) {
+ tmp = mem_access_word(4 * 4 + 2);
+ if (_X86EMU_intrTab[4]) {
+ (*_X86EMU_intrTab[4])(4);
+ } else {
+ push_word((u16)M.x86.R_FLG);
+ CLEAR_FLAG(F_IF);
+ CLEAR_FLAG(F_TF);
+ push_word(M.x86.R_CS);
+ M.x86.R_CS = mem_access_word(4 * 4 + 2);
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = mem_access_word(4 * 4);
+ }
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xcf
+****************************************************************************/
+void x86emuOp_iret(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("IRET\n");
+
+ TRACE_AND_STEP();
+
+ M.x86.R_IP = pop_word();
+ M.x86.R_CS = pop_word();
+ M.x86.R_FLG = pop_word();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xd0
+****************************************************************************/
+void x86emuOp_opcD0_byte_RM_1(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg;
+ uint destoffset;
+ u8 destval;
+
+ /*
+ * Yet another weirdo special case instruction format. Part of
+ * the opcode held below in "RH". Doubly nested case would
+ * result, except that the decoded instruction
+ */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("ROL\t");
+ break;
+ case 1:
+ DECODE_PRINTF("ROR\t");
+ break;
+ case 2:
+ DECODE_PRINTF("RCL\t");
+ break;
+ case 3:
+ DECODE_PRINTF("RCR\t");
+ break;
+ case 4:
+ DECODE_PRINTF("SHL\t");
+ break;
+ case 5:
+ DECODE_PRINTF("SHR\t");
+ break;
+ case 6:
+ DECODE_PRINTF("SAL\t");
+ break;
+ case 7:
+ DECODE_PRINTF("SAR\t");
+ break;
+ }
+ }
+#endif
+ /* know operation, decode the mod byte to find the addressing
+ mode. */
+ switch (mod) {
+ case 0:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",1\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (destval, 1);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",1\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (destval, 1);
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",1\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (destval, 1);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",1\n");
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (*destreg, 1);
+ *destreg = destval;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xd1
+****************************************************************************/
+void x86emuOp_opcD1_word_RM_1(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ /*
+ * Yet another weirdo special case instruction format. Part of
+ * the opcode held below in "RH". Doubly nested case would
+ * result, except that the decoded instruction
+ */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("ROL\t");
+ break;
+ case 1:
+ DECODE_PRINTF("ROR\t");
+ break;
+ case 2:
+ DECODE_PRINTF("RCL\t");
+ break;
+ case 3:
+ DECODE_PRINTF("RCR\t");
+ break;
+ case 4:
+ DECODE_PRINTF("SHL\t");
+ break;
+ case 5:
+ DECODE_PRINTF("SHR\t");
+ break;
+ case 6:
+ DECODE_PRINTF("SAL\t");
+ break;
+ case 7:
+ DECODE_PRINTF("SAR\t");
+ break;
+ }
+ }
+#endif
+ /* know operation, decode the mod byte to find the addressing
+ mode. */
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",1\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, 1);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",1\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_word_operation[rh]) (destval, 1);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",1\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, 1);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",1\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_word_operation[rh]) (destval, 1);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",1\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, 1);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",1\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_word_operation[rh]) (destval, 1);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *destreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",1\n");
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (*destreg, 1);
+ *destreg = destval;
+ } else {
+ u16 destval;
+ u16 *destreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",1\n");
+ TRACE_AND_STEP();
+ destval = (*opcD1_word_operation[rh]) (*destreg, 1);
+ *destreg = destval;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xd2
+****************************************************************************/
+void x86emuOp_opcD2_byte_RM_CL(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg;
+ uint destoffset;
+ u8 destval;
+ u8 amt;
+
+ /*
+ * Yet another weirdo special case instruction format. Part of
+ * the opcode held below in "RH". Doubly nested case would
+ * result, except that the decoded instruction
+ */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("ROL\t");
+ break;
+ case 1:
+ DECODE_PRINTF("ROR\t");
+ break;
+ case 2:
+ DECODE_PRINTF("RCL\t");
+ break;
+ case 3:
+ DECODE_PRINTF("RCR\t");
+ break;
+ case 4:
+ DECODE_PRINTF("SHL\t");
+ break;
+ case 5:
+ DECODE_PRINTF("SHR\t");
+ break;
+ case 6:
+ DECODE_PRINTF("SAL\t");
+ break;
+ case 7:
+ DECODE_PRINTF("SAR\t");
+ break;
+ }
+ }
+#endif
+ /* know operation, decode the mod byte to find the addressing
+ mode. */
+ amt = M.x86.R_CL;
+ switch (mod) {
+ case 0:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",CL\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (destval, amt);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",CL\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (destval, amt);
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",CL\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (destval, amt);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (*destreg, amt);
+ *destreg = destval;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xd3
+****************************************************************************/
+void x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+ u8 amt;
+
+ /*
+ * Yet another weirdo special case instruction format. Part of
+ * the opcode held below in "RH". Doubly nested case would
+ * result, except that the decoded instruction
+ */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("ROL\t");
+ break;
+ case 1:
+ DECODE_PRINTF("ROR\t");
+ break;
+ case 2:
+ DECODE_PRINTF("RCL\t");
+ break;
+ case 3:
+ DECODE_PRINTF("RCR\t");
+ break;
+ case 4:
+ DECODE_PRINTF("SHL\t");
+ break;
+ case 5:
+ DECODE_PRINTF("SHR\t");
+ break;
+ case 6:
+ DECODE_PRINTF("SAL\t");
+ break;
+ case 7:
+ DECODE_PRINTF("SAR\t");
+ break;
+ }
+ }
+#endif
+ /* know operation, decode the mod byte to find the addressing
+ mode. */
+ amt = M.x86.R_CL;
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",CL\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, amt);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",CL\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_word_operation[rh]) (destval, amt);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",CL\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, amt);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",CL\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_word_operation[rh]) (destval, amt);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",CL\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, amt);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",CL\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_word_operation[rh]) (destval, amt);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ *destreg = (*opcD1_long_operation[rh]) (*destreg, amt);
+ } else {
+ u16 *destreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ *destreg = (*opcD1_word_operation[rh]) (*destreg, amt);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xd4
+****************************************************************************/
+void x86emuOp_aam(u8 X86EMU_UNUSED(op1))
+{
+ u8 a;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("AAM\n");
+ a = fetch_byte_imm(); /* this is a stupid encoding. */
+ if (a != 10) {
+ DECODE_PRINTF("ERROR DECODING AAM\n");
+ TRACE_REGS();
+ HALT_SYS();
+ }
+ TRACE_AND_STEP();
+ /* note the type change here --- returning AL and AH in AX. */
+ M.x86.R_AX = aam_word(M.x86.R_AL);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xd5
+****************************************************************************/
+void x86emuOp_aad(u8 X86EMU_UNUSED(op1))
+{
+ u8 a;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("AAD\n");
+ a = fetch_byte_imm();
+ TRACE_AND_STEP();
+ M.x86.R_AX = aad_word(M.x86.R_AX);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/* opcode 0xd6 ILLEGAL OPCODE */
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xd7
+****************************************************************************/
+void x86emuOp_xlat(u8 X86EMU_UNUSED(op1))
+{
+ u16 addr;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("XLAT\n");
+ TRACE_AND_STEP();
+ addr = (u16)(M.x86.R_BX + (u8)M.x86.R_AL);
+ M.x86.R_AL = fetch_data_byte(addr);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/* instuctions D8 .. DF are in i87_ops.c */
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe0
+****************************************************************************/
+void x86emuOp_loopne(u8 X86EMU_UNUSED(op1))
+{
+ s16 ip;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("LOOPNE\t");
+ ip = (s8) fetch_byte_imm();
+ ip += (s16) M.x86.R_IP;
+ DECODE_PRINTF2("%04x\n", ip);
+ TRACE_AND_STEP();
+ M.x86.R_CX -= 1;
+ if (M.x86.R_CX != 0 && !ACCESS_FLAG(F_ZF)) /* CX != 0 and !ZF */
+ M.x86.R_IP = ip;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe1
+****************************************************************************/
+void x86emuOp_loope(u8 X86EMU_UNUSED(op1))
+{
+ s16 ip;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("LOOPE\t");
+ ip = (s8) fetch_byte_imm();
+ ip += (s16) M.x86.R_IP;
+ DECODE_PRINTF2("%04x\n", ip);
+ TRACE_AND_STEP();
+ M.x86.R_CX -= 1;
+ if (M.x86.R_CX != 0 && ACCESS_FLAG(F_ZF)) /* CX != 0 and ZF */
+ M.x86.R_IP = ip;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe2
+****************************************************************************/
+void x86emuOp_loop(u8 X86EMU_UNUSED(op1))
+{
+ s16 ip;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("LOOP\t");
+ ip = (s8) fetch_byte_imm();
+ ip += (s16) M.x86.R_IP;
+ DECODE_PRINTF2("%04x\n", ip);
+ TRACE_AND_STEP();
+ M.x86.R_CX -= 1;
+ if (M.x86.R_CX != 0)
+ M.x86.R_IP = ip;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe3
+****************************************************************************/
+void x86emuOp_jcxz(u8 X86EMU_UNUSED(op1))
+{
+ u16 target;
+ s8 offset;
+
+ /* jump to byte offset if overflow flag is set */
+ START_OF_INSTR();
+ DECODE_PRINTF("JCXZ\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (M.x86.R_CX == 0)
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe4
+****************************************************************************/
+void x86emuOp_in_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 port;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("IN\t");
+ port = (u8) fetch_byte_imm();
+ DECODE_PRINTF2("%x,AL\n", port);
+ TRACE_AND_STEP();
+ M.x86.R_AL = (*sys_inb)(port);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe5
+****************************************************************************/
+void x86emuOp_in_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 port;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("IN\t");
+ port = (u8) fetch_byte_imm();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF2("EAX,%x\n", port);
+ } else {
+ DECODE_PRINTF2("AX,%x\n", port);
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = (*sys_inl)(port);
+ } else {
+ M.x86.R_AX = (*sys_inw)(port);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe6
+****************************************************************************/
+void x86emuOp_out_byte_IMM_AL(u8 X86EMU_UNUSED(op1))
+{
+ u8 port;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("OUT\t");
+ port = (u8) fetch_byte_imm();
+ DECODE_PRINTF2("%x,AL\n", port);
+ TRACE_AND_STEP();
+ (*sys_outb)(port, M.x86.R_AL);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe7
+****************************************************************************/
+void x86emuOp_out_word_IMM_AX(u8 X86EMU_UNUSED(op1))
+{
+ u8 port;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("OUT\t");
+ port = (u8) fetch_byte_imm();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF2("%x,EAX\n", port);
+ } else {
+ DECODE_PRINTF2("%x,AX\n", port);
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ (*sys_outl)(port, M.x86.R_EAX);
+ } else {
+ (*sys_outw)(port, M.x86.R_AX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe8
+****************************************************************************/
+void x86emuOp_call_near_IMM(u8 X86EMU_UNUSED(op1))
+{
+ s16 ip;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("CALL\t");
+ ip = (s16) fetch_word_imm();
+ ip += (s16) M.x86.R_IP; /* CHECK SIGN */
+ DECODE_PRINTF2("%04x\n", ip);
+ CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip, "");
+ TRACE_AND_STEP();
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = ip;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe9
+****************************************************************************/
+void x86emuOp_jump_near_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int ip;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("JMP\t");
+ ip = (s16)fetch_word_imm();
+ ip += (s16)M.x86.R_IP;
+ DECODE_PRINTF2("%04x\n", ip);
+ TRACE_AND_STEP();
+ M.x86.R_IP = (u16)ip;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xea
+****************************************************************************/
+void x86emuOp_jump_far_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u16 cs, ip;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("JMP\tFAR ");
+ ip = fetch_word_imm();
+ cs = fetch_word_imm();
+ DECODE_PRINTF2("%04x:", cs);
+ DECODE_PRINTF2("%04x\n", ip);
+ TRACE_AND_STEP();
+ M.x86.R_IP = ip;
+ M.x86.R_CS = cs;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xeb
+****************************************************************************/
+void x86emuOp_jump_byte_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u16 target;
+ s8 offset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("JMP\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xec
+****************************************************************************/
+void x86emuOp_in_byte_AL_DX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("IN\tAL,DX\n");
+ TRACE_AND_STEP();
+ M.x86.R_AL = (*sys_inb)(M.x86.R_DX);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xed
+****************************************************************************/
+void x86emuOp_in_word_AX_DX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("IN\tEAX,DX\n");
+ } else {
+ DECODE_PRINTF("IN\tAX,DX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = (*sys_inl)(M.x86.R_DX);
+ } else {
+ M.x86.R_AX = (*sys_inw)(M.x86.R_DX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xee
+****************************************************************************/
+void x86emuOp_out_byte_DX_AL(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("OUT\tDX,AL\n");
+ TRACE_AND_STEP();
+ (*sys_outb)(M.x86.R_DX, M.x86.R_AL);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xef
+****************************************************************************/
+void x86emuOp_out_word_DX_AX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("OUT\tDX,EAX\n");
+ } else {
+ DECODE_PRINTF("OUT\tDX,AX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ (*sys_outl)(M.x86.R_DX, M.x86.R_EAX);
+ } else {
+ (*sys_outw)(M.x86.R_DX, M.x86.R_AX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf0
+****************************************************************************/
+void x86emuOp_lock(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("LOCK:\n");
+ TRACE_AND_STEP();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/*opcode 0xf1 ILLEGAL OPERATION */
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf2
+****************************************************************************/
+void x86emuOp_repne(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("REPNE\n");
+ TRACE_AND_STEP();
+ M.x86.mode |= SYSMODE_PREFIX_REPNE;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf3
+****************************************************************************/
+void x86emuOp_repe(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("REPE\n");
+ TRACE_AND_STEP();
+ M.x86.mode |= SYSMODE_PREFIX_REPE;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf4
+****************************************************************************/
+void x86emuOp_halt(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("HALT\n");
+ TRACE_AND_STEP();
+ HALT_SYS();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf5
+****************************************************************************/
+void x86emuOp_cmc(u8 X86EMU_UNUSED(op1))
+{
+ /* complement the carry flag. */
+ START_OF_INSTR();
+ DECODE_PRINTF("CMC\n");
+ TRACE_AND_STEP();
+ TOGGLE_FLAG(F_CF);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf6
+****************************************************************************/
+void x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg;
+ uint destoffset;
+ u8 destval, srcval;
+
+ /* long, drawn out code follows. Double switch for a total
+ of 32 cases. */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0: /* mod=00 */
+ switch (rh) {
+ case 0: /* test byte imm */
+ DECODE_PRINTF("TEST\tBYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%02x\n", srcval);
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ test_byte(destval, srcval);
+ break;
+ case 1:
+ DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n");
+ HALT_SYS();
+ break;
+ case 2:
+ DECODE_PRINTF("NOT\tBYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = not_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3:
+ DECODE_PRINTF("NEG\tBYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = neg_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ case 4:
+ DECODE_PRINTF("MUL\tBYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ mul_byte(destval);
+ break;
+ case 5:
+ DECODE_PRINTF("IMUL\tBYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ imul_byte(destval);
+ break;
+ case 6:
+ DECODE_PRINTF("DIV\tBYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ div_byte(destval);
+ break;
+ case 7:
+ DECODE_PRINTF("IDIV\tBYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ idiv_byte(destval);
+ break;
+ }
+ break; /* end mod==00 */
+ case 1: /* mod=01 */
+ switch (rh) {
+ case 0: /* test byte imm */
+ DECODE_PRINTF("TEST\tBYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%02x\n", srcval);
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ test_byte(destval, srcval);
+ break;
+ case 1:
+ DECODE_PRINTF("ILLEGAL OP MOD=01 RH=01 OP=F6\n");
+ HALT_SYS();
+ break;
+ case 2:
+ DECODE_PRINTF("NOT\tBYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = not_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3:
+ DECODE_PRINTF("NEG\tBYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = neg_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ case 4:
+ DECODE_PRINTF("MUL\tBYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ mul_byte(destval);
+ break;
+ case 5:
+ DECODE_PRINTF("IMUL\tBYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ imul_byte(destval);
+ break;
+ case 6:
+ DECODE_PRINTF("DIV\tBYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ div_byte(destval);
+ break;
+ case 7:
+ DECODE_PRINTF("IDIV\tBYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ idiv_byte(destval);
+ break;
+ }
+ break; /* end mod==01 */
+ case 2: /* mod=10 */
+ switch (rh) {
+ case 0: /* test byte imm */
+ DECODE_PRINTF("TEST\tBYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%02x\n", srcval);
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ test_byte(destval, srcval);
+ break;
+ case 1:
+ DECODE_PRINTF("ILLEGAL OP MOD=10 RH=01 OP=F6\n");
+ HALT_SYS();
+ break;
+ case 2:
+ DECODE_PRINTF("NOT\tBYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = not_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3:
+ DECODE_PRINTF("NEG\tBYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = neg_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ case 4:
+ DECODE_PRINTF("MUL\tBYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ mul_byte(destval);
+ break;
+ case 5:
+ DECODE_PRINTF("IMUL\tBYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ imul_byte(destval);
+ break;
+ case 6:
+ DECODE_PRINTF("DIV\tBYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ div_byte(destval);
+ break;
+ case 7:
+ DECODE_PRINTF("IDIV\tBYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ idiv_byte(destval);
+ break;
+ }
+ break; /* end mod==10 */
+ case 3: /* mod=11 */
+ switch (rh) {
+ case 0: /* test byte imm */
+ DECODE_PRINTF("TEST\t");
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%02x\n", srcval);
+ TRACE_AND_STEP();
+ test_byte(*destreg, srcval);
+ break;
+ case 1:
+ DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n");
+ HALT_SYS();
+ break;
+ case 2:
+ DECODE_PRINTF("NOT\t");
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = not_byte(*destreg);
+ break;
+ case 3:
+ DECODE_PRINTF("NEG\t");
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = neg_byte(*destreg);
+ break;
+ case 4:
+ DECODE_PRINTF("MUL\t");
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ mul_byte(*destreg); /*!!! */
+ break;
+ case 5:
+ DECODE_PRINTF("IMUL\t");
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ imul_byte(*destreg);
+ break;
+ case 6:
+ DECODE_PRINTF("DIV\t");
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ div_byte(*destreg);
+ break;
+ case 7:
+ DECODE_PRINTF("IDIV\t");
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ idiv_byte(*destreg);
+ break;
+ }
+ break; /* end mod==11 */
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf7
+****************************************************************************/
+void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ /* long, drawn out code follows. Double switch for a total
+ of 32 cases. */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0: /* mod=00 */
+ switch (rh) {
+ case 0: /* test word imm */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval,srcval;
+
+ DECODE_PRINTF("TEST\tDWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_long_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ test_long(destval, srcval);
+ } else {
+ u16 destval,srcval;
+
+ DECODE_PRINTF("TEST\tWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ test_word(destval, srcval);
+ }
+ break;
+ case 1:
+ DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F7\n");
+ HALT_SYS();
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("NOT\tDWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = not_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("NOT\tWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = not_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("NEG\tDWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = neg_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("NEG\tWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = neg_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 4:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("MUL\tDWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ mul_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("MUL\tWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ mul_word(destval);
+ }
+ break;
+ case 5:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("IMUL\tDWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ imul_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("IMUL\tWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ imul_word(destval);
+ }
+ break;
+ case 6:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DIV\tDWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ div_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("DIV\tWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ div_word(destval);
+ }
+ break;
+ case 7:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("IDIV\tDWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ idiv_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("IDIV\tWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ idiv_word(destval);
+ }
+ break;
+ }
+ break; /* end mod==00 */
+ case 1: /* mod=01 */
+ switch (rh) {
+ case 0: /* test word imm */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval,srcval;
+
+ DECODE_PRINTF("TEST\tDWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_long_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ test_long(destval, srcval);
+ } else {
+ u16 destval,srcval;
+
+ DECODE_PRINTF("TEST\tWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ test_word(destval, srcval);
+ }
+ break;
+ case 1:
+ DECODE_PRINTF("ILLEGAL OP MOD=01 RH=01 OP=F6\n");
+ HALT_SYS();
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("NOT\tDWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = not_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("NOT\tWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = not_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("NEG\tDWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = neg_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("NEG\tWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = neg_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 4:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("MUL\tDWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ mul_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("MUL\tWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ mul_word(destval);
+ }
+ break;
+ case 5:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("IMUL\tDWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ imul_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("IMUL\tWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ imul_word(destval);
+ }
+ break;
+ case 6:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DIV\tDWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ div_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("DIV\tWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ div_word(destval);
+ }
+ break;
+ case 7:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("IDIV\tDWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ idiv_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("IDIV\tWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ idiv_word(destval);
+ }
+ break;
+ }
+ break; /* end mod==01 */
+ case 2: /* mod=10 */
+ switch (rh) {
+ case 0: /* test word imm */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval,srcval;
+
+ DECODE_PRINTF("TEST\tDWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_long_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ test_long(destval, srcval);
+ } else {
+ u16 destval,srcval;
+
+ DECODE_PRINTF("TEST\tWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ test_word(destval, srcval);
+ }
+ break;
+ case 1:
+ DECODE_PRINTF("ILLEGAL OP MOD=10 RH=01 OP=F6\n");
+ HALT_SYS();
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("NOT\tDWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = not_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("NOT\tWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = not_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("NEG\tDWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = neg_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("NEG\tWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = neg_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 4:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("MUL\tDWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ mul_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("MUL\tWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ mul_word(destval);
+ }
+ break;
+ case 5:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("IMUL\tDWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ imul_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("IMUL\tWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ imul_word(destval);
+ }
+ break;
+ case 6:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DIV\tDWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ div_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("DIV\tWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ div_word(destval);
+ }
+ break;
+ case 7:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("IDIV\tDWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ idiv_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("IDIV\tWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ idiv_word(destval);
+ }
+ break;
+ }
+ break; /* end mod==10 */
+ case 3: /* mod=11 */
+ switch (rh) {
+ case 0: /* test word imm */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ DECODE_PRINTF("TEST\t");
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_long_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ test_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ DECODE_PRINTF("TEST\t");
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ test_word(*destreg, srcval);
+ }
+ break;
+ case 1:
+ DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n");
+ HALT_SYS();
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ DECODE_PRINTF("NOT\t");
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = not_long(*destreg);
+ } else {
+ u16 *destreg;
+
+ DECODE_PRINTF("NOT\t");
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = not_word(*destreg);
+ }
+ break;
+ case 3:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ DECODE_PRINTF("NEG\t");
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = neg_long(*destreg);
+ } else {
+ u16 *destreg;
+
+ DECODE_PRINTF("NEG\t");
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = neg_word(*destreg);
+ }
+ break;
+ case 4:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ DECODE_PRINTF("MUL\t");
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ mul_long(*destreg); /*!!! */
+ } else {
+ u16 *destreg;
+
+ DECODE_PRINTF("MUL\t");
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ mul_word(*destreg); /*!!! */
+ }
+ break;
+ case 5:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ DECODE_PRINTF("IMUL\t");
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ imul_long(*destreg);
+ } else {
+ u16 *destreg;
+
+ DECODE_PRINTF("IMUL\t");
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ imul_word(*destreg);
+ }
+ break;
+ case 6:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ DECODE_PRINTF("DIV\t");
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ div_long(*destreg);
+ } else {
+ u16 *destreg;
+
+ DECODE_PRINTF("DIV\t");
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ div_word(*destreg);
+ }
+ break;
+ case 7:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ DECODE_PRINTF("IDIV\t");
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ idiv_long(*destreg);
+ } else {
+ u16 *destreg;
+
+ DECODE_PRINTF("IDIV\t");
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ idiv_word(*destreg);
+ }
+ break;
+ }
+ break; /* end mod==11 */
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf8
+****************************************************************************/
+void x86emuOp_clc(u8 X86EMU_UNUSED(op1))
+{
+ /* clear the carry flag. */
+ START_OF_INSTR();
+ DECODE_PRINTF("CLC\n");
+ TRACE_AND_STEP();
+ CLEAR_FLAG(F_CF);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf9
+****************************************************************************/
+void x86emuOp_stc(u8 X86EMU_UNUSED(op1))
+{
+ /* set the carry flag. */
+ START_OF_INSTR();
+ DECODE_PRINTF("STC\n");
+ TRACE_AND_STEP();
+ SET_FLAG(F_CF);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xfa
+****************************************************************************/
+void x86emuOp_cli(u8 X86EMU_UNUSED(op1))
+{
+ /* clear interrupts. */
+ START_OF_INSTR();
+ DECODE_PRINTF("CLI\n");
+ TRACE_AND_STEP();
+ CLEAR_FLAG(F_IF);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xfb
+****************************************************************************/
+void x86emuOp_sti(u8 X86EMU_UNUSED(op1))
+{
+ /* enable interrupts. */
+ START_OF_INSTR();
+ DECODE_PRINTF("STI\n");
+ TRACE_AND_STEP();
+ SET_FLAG(F_IF);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xfc
+****************************************************************************/
+void x86emuOp_cld(u8 X86EMU_UNUSED(op1))
+{
+ /* clear interrupts. */
+ START_OF_INSTR();
+ DECODE_PRINTF("CLD\n");
+ TRACE_AND_STEP();
+ CLEAR_FLAG(F_DF);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xfd
+****************************************************************************/
+void x86emuOp_std(u8 X86EMU_UNUSED(op1))
+{
+ /* clear interrupts. */
+ START_OF_INSTR();
+ DECODE_PRINTF("STD\n");
+ TRACE_AND_STEP();
+ SET_FLAG(F_DF);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xfe
+****************************************************************************/
+void x86emuOp_opcFE_byte_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rh, rl;
+ u8 destval;
+ uint destoffset;
+ u8 *destreg;
+
+ /* Yet another special case instruction. */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("INC\t");
+ break;
+ case 1:
+ DECODE_PRINTF("DEC\t");
+ break;
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ DECODE_PRINTF2("ILLEGAL OP MAJOR OP 0xFE MINOR OP %x \n", mod);
+ HALT_SYS();
+ break;
+ }
+ }
+#endif
+ switch (mod) {
+ case 0:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ switch (rh) {
+ case 0: /* inc word ptr ... */
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = inc_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1: /* dec word ptr ... */
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = dec_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ }
+ break;
+ case 1:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ switch (rh) {
+ case 0:
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = inc_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = dec_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ }
+ break;
+ case 2:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ switch (rh) {
+ case 0:
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = inc_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = dec_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ }
+ break;
+ case 3:
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ switch (rh) {
+ case 0:
+ TRACE_AND_STEP();
+ *destreg = inc_byte(*destreg);
+ break;
+ case 1:
+ TRACE_AND_STEP();
+ *destreg = dec_byte(*destreg);
+ break;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xff
+****************************************************************************/
+void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rh, rl;
+ uint destoffset = 0;
+ u16 *destreg;
+ u16 destval,destval2;
+
+ /* Yet another special case instruction. */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+
+ switch (rh) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tDWORD PTR ");
+ } else {
+ DECODE_PRINTF("INC\tWORD PTR ");
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tDWORD PTR ");
+ } else {
+ DECODE_PRINTF("DEC\tWORD PTR ");
+ }
+ break;
+ case 2:
+ DECODE_PRINTF("CALL\t ");
+ break;
+ case 3:
+ DECODE_PRINTF("CALL\tFAR ");
+ break;
+ case 4:
+ DECODE_PRINTF("JMP\t");
+ break;
+ case 5:
+ DECODE_PRINTF("JMP\tFAR ");
+ break;
+ case 6:
+ DECODE_PRINTF("PUSH\t");
+ break;
+ case 7:
+ DECODE_PRINTF("ILLEGAL DECODING OF OPCODE FF\t");
+ HALT_SYS();
+ break;
+ }
+ }
+#endif
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ switch (rh) {
+ case 0: /* inc word ptr ... */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = inc_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = inc_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1: /* dec word ptr ... */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = dec_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = dec_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2: /* call word ptr ... */
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ break;
+ case 3: /* call far ptr ... */
+ destval = fetch_data_word(destoffset);
+ destval2 = fetch_data_word(destoffset + 2);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_CS);
+ M.x86.R_CS = destval2;
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ break;
+ case 4: /* jmp word ptr ... */
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ M.x86.R_IP = destval;
+ break;
+ case 5: /* jmp far ptr ... */
+ destval = fetch_data_word(destoffset);
+ destval2 = fetch_data_word(destoffset + 2);
+ TRACE_AND_STEP();
+ M.x86.R_IP = destval;
+ M.x86.R_CS = destval2;
+ break;
+ case 6: /* push word ptr ... */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ push_long(destval);
+ } else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ push_word(destval);
+ }
+ break;
+ }
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ switch (rh) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = inc_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = inc_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = dec_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = dec_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2: /* call word ptr ... */
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ break;
+ case 3: /* call far ptr ... */
+ destval = fetch_data_word(destoffset);
+ destval2 = fetch_data_word(destoffset + 2);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_CS);
+ M.x86.R_CS = destval2;
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ break;
+ case 4: /* jmp word ptr ... */
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ M.x86.R_IP = destval;
+ break;
+ case 5: /* jmp far ptr ... */
+ destval = fetch_data_word(destoffset);
+ destval2 = fetch_data_word(destoffset + 2);
+ TRACE_AND_STEP();
+ M.x86.R_IP = destval;
+ M.x86.R_CS = destval2;
+ break;
+ case 6: /* push word ptr ... */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ push_long(destval);
+ } else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ push_word(destval);
+ }
+ break;
+ }
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ switch (rh) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = inc_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = inc_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = dec_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = dec_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2: /* call word ptr ... */
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ break;
+ case 3: /* call far ptr ... */
+ destval = fetch_data_word(destoffset);
+ destval2 = fetch_data_word(destoffset + 2);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_CS);
+ M.x86.R_CS = destval2;
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ break;
+ case 4: /* jmp word ptr ... */
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ M.x86.R_IP = destval;
+ break;
+ case 5: /* jmp far ptr ... */
+ destval = fetch_data_word(destoffset);
+ destval2 = fetch_data_word(destoffset + 2);
+ TRACE_AND_STEP();
+ M.x86.R_IP = destval;
+ M.x86.R_CS = destval2;
+ break;
+ case 6: /* push word ptr ... */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ push_long(destval);
+ } else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ push_word(destval);
+ }
+ break;
+ }
+ break;
+ case 3:
+ switch (rh) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = inc_long(*destreg);
+ } else {
+ u16 *destreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = inc_word(*destreg);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = dec_long(*destreg);
+ } else {
+ u16 *destreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = dec_word(*destreg);
+ }
+ break;
+ case 2: /* call word ptr ... */
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = *destreg;
+ break;
+ case 3: /* jmp far ptr ... */
+ DECODE_PRINTF("OPERATION UNDEFINED 0XFF \n");
+ TRACE_AND_STEP();
+ HALT_SYS();
+ break;
+
+ case 4: /* jmp ... */
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ M.x86.R_IP = (u16) (*destreg);
+ break;
+ case 5: /* jmp far ptr ... */
+ DECODE_PRINTF("OPERATION UNDEFINED 0XFF \n");
+ TRACE_AND_STEP();
+ HALT_SYS();
+ break;
+ case 6:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ push_long(*destreg);
+ } else {
+ u16 *destreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ push_word(*destreg);
+ }
+ break;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/***************************************************************************
+ * Single byte operation code table:
+ **************************************************************************/
+void (*x86emu_optab[256])(u8) =
+{
+/* 0x00 */ x86emuOp_add_byte_RM_R,
+/* 0x01 */ x86emuOp_add_word_RM_R,
+/* 0x02 */ x86emuOp_add_byte_R_RM,
+/* 0x03 */ x86emuOp_add_word_R_RM,
+/* 0x04 */ x86emuOp_add_byte_AL_IMM,
+/* 0x05 */ x86emuOp_add_word_AX_IMM,
+/* 0x06 */ x86emuOp_push_ES,
+/* 0x07 */ x86emuOp_pop_ES,
+
+/* 0x08 */ x86emuOp_or_byte_RM_R,
+/* 0x09 */ x86emuOp_or_word_RM_R,
+/* 0x0a */ x86emuOp_or_byte_R_RM,
+/* 0x0b */ x86emuOp_or_word_R_RM,
+/* 0x0c */ x86emuOp_or_byte_AL_IMM,
+/* 0x0d */ x86emuOp_or_word_AX_IMM,
+/* 0x0e */ x86emuOp_push_CS,
+/* 0x0f */ x86emuOp_two_byte,
+
+/* 0x10 */ x86emuOp_adc_byte_RM_R,
+/* 0x11 */ x86emuOp_adc_word_RM_R,
+/* 0x12 */ x86emuOp_adc_byte_R_RM,
+/* 0x13 */ x86emuOp_adc_word_R_RM,
+/* 0x14 */ x86emuOp_adc_byte_AL_IMM,
+/* 0x15 */ x86emuOp_adc_word_AX_IMM,
+/* 0x16 */ x86emuOp_push_SS,
+/* 0x17 */ x86emuOp_pop_SS,
+
+/* 0x18 */ x86emuOp_sbb_byte_RM_R,
+/* 0x19 */ x86emuOp_sbb_word_RM_R,
+/* 0x1a */ x86emuOp_sbb_byte_R_RM,
+/* 0x1b */ x86emuOp_sbb_word_R_RM,
+/* 0x1c */ x86emuOp_sbb_byte_AL_IMM,
+/* 0x1d */ x86emuOp_sbb_word_AX_IMM,
+/* 0x1e */ x86emuOp_push_DS,
+/* 0x1f */ x86emuOp_pop_DS,
+
+/* 0x20 */ x86emuOp_and_byte_RM_R,
+/* 0x21 */ x86emuOp_and_word_RM_R,
+/* 0x22 */ x86emuOp_and_byte_R_RM,
+/* 0x23 */ x86emuOp_and_word_R_RM,
+/* 0x24 */ x86emuOp_and_byte_AL_IMM,
+/* 0x25 */ x86emuOp_and_word_AX_IMM,
+/* 0x26 */ x86emuOp_segovr_ES,
+/* 0x27 */ x86emuOp_daa,
+
+/* 0x28 */ x86emuOp_sub_byte_RM_R,
+/* 0x29 */ x86emuOp_sub_word_RM_R,
+/* 0x2a */ x86emuOp_sub_byte_R_RM,
+/* 0x2b */ x86emuOp_sub_word_R_RM,
+/* 0x2c */ x86emuOp_sub_byte_AL_IMM,
+/* 0x2d */ x86emuOp_sub_word_AX_IMM,
+/* 0x2e */ x86emuOp_segovr_CS,
+/* 0x2f */ x86emuOp_das,
+
+/* 0x30 */ x86emuOp_xor_byte_RM_R,
+/* 0x31 */ x86emuOp_xor_word_RM_R,
+/* 0x32 */ x86emuOp_xor_byte_R_RM,
+/* 0x33 */ x86emuOp_xor_word_R_RM,
+/* 0x34 */ x86emuOp_xor_byte_AL_IMM,
+/* 0x35 */ x86emuOp_xor_word_AX_IMM,
+/* 0x36 */ x86emuOp_segovr_SS,
+/* 0x37 */ x86emuOp_aaa,
+
+/* 0x38 */ x86emuOp_cmp_byte_RM_R,
+/* 0x39 */ x86emuOp_cmp_word_RM_R,
+/* 0x3a */ x86emuOp_cmp_byte_R_RM,
+/* 0x3b */ x86emuOp_cmp_word_R_RM,
+/* 0x3c */ x86emuOp_cmp_byte_AL_IMM,
+/* 0x3d */ x86emuOp_cmp_word_AX_IMM,
+/* 0x3e */ x86emuOp_segovr_DS,
+/* 0x3f */ x86emuOp_aas,
+
+/* 0x40 */ x86emuOp_inc_AX,
+/* 0x41 */ x86emuOp_inc_CX,
+/* 0x42 */ x86emuOp_inc_DX,
+/* 0x43 */ x86emuOp_inc_BX,
+/* 0x44 */ x86emuOp_inc_SP,
+/* 0x45 */ x86emuOp_inc_BP,
+/* 0x46 */ x86emuOp_inc_SI,
+/* 0x47 */ x86emuOp_inc_DI,
+
+/* 0x48 */ x86emuOp_dec_AX,
+/* 0x49 */ x86emuOp_dec_CX,
+/* 0x4a */ x86emuOp_dec_DX,
+/* 0x4b */ x86emuOp_dec_BX,
+/* 0x4c */ x86emuOp_dec_SP,
+/* 0x4d */ x86emuOp_dec_BP,
+/* 0x4e */ x86emuOp_dec_SI,
+/* 0x4f */ x86emuOp_dec_DI,
+
+/* 0x50 */ x86emuOp_push_AX,
+/* 0x51 */ x86emuOp_push_CX,
+/* 0x52 */ x86emuOp_push_DX,
+/* 0x53 */ x86emuOp_push_BX,
+/* 0x54 */ x86emuOp_push_SP,
+/* 0x55 */ x86emuOp_push_BP,
+/* 0x56 */ x86emuOp_push_SI,
+/* 0x57 */ x86emuOp_push_DI,
+
+/* 0x58 */ x86emuOp_pop_AX,
+/* 0x59 */ x86emuOp_pop_CX,
+/* 0x5a */ x86emuOp_pop_DX,
+/* 0x5b */ x86emuOp_pop_BX,
+/* 0x5c */ x86emuOp_pop_SP,
+/* 0x5d */ x86emuOp_pop_BP,
+/* 0x5e */ x86emuOp_pop_SI,
+/* 0x5f */ x86emuOp_pop_DI,
+
+/* 0x60 */ x86emuOp_push_all,
+/* 0x61 */ x86emuOp_pop_all,
+/* 0x62 */ x86emuOp_illegal_op, /* bound */
+/* 0x63 */ x86emuOp_illegal_op, /* arpl */
+/* 0x64 */ x86emuOp_segovr_FS,
+/* 0x65 */ x86emuOp_segovr_GS,
+/* 0x66 */ x86emuOp_prefix_data,
+/* 0x67 */ x86emuOp_prefix_addr,
+
+/* 0x68 */ x86emuOp_push_word_IMM,
+/* 0x69 */ x86emuOp_imul_word_IMM,
+/* 0x6a */ x86emuOp_push_byte_IMM,
+/* 0x6b */ x86emuOp_imul_byte_IMM,
+/* 0x6c */ x86emuOp_ins_byte,
+/* 0x6d */ x86emuOp_ins_word,
+/* 0x6e */ x86emuOp_outs_byte,
+/* 0x6f */ x86emuOp_outs_word,
+
+/* 0x70 */ x86emuOp_jump_near_O,
+/* 0x71 */ x86emuOp_jump_near_NO,
+/* 0x72 */ x86emuOp_jump_near_B,
+/* 0x73 */ x86emuOp_jump_near_NB,
+/* 0x74 */ x86emuOp_jump_near_Z,
+/* 0x75 */ x86emuOp_jump_near_NZ,
+/* 0x76 */ x86emuOp_jump_near_BE,
+/* 0x77 */ x86emuOp_jump_near_NBE,
+
+/* 0x78 */ x86emuOp_jump_near_S,
+/* 0x79 */ x86emuOp_jump_near_NS,
+/* 0x7a */ x86emuOp_jump_near_P,
+/* 0x7b */ x86emuOp_jump_near_NP,
+/* 0x7c */ x86emuOp_jump_near_L,
+/* 0x7d */ x86emuOp_jump_near_NL,
+/* 0x7e */ x86emuOp_jump_near_LE,
+/* 0x7f */ x86emuOp_jump_near_NLE,
+
+/* 0x80 */ x86emuOp_opc80_byte_RM_IMM,
+/* 0x81 */ x86emuOp_opc81_word_RM_IMM,
+/* 0x82 */ x86emuOp_opc82_byte_RM_IMM,
+/* 0x83 */ x86emuOp_opc83_word_RM_IMM,
+/* 0x84 */ x86emuOp_test_byte_RM_R,
+/* 0x85 */ x86emuOp_test_word_RM_R,
+/* 0x86 */ x86emuOp_xchg_byte_RM_R,
+/* 0x87 */ x86emuOp_xchg_word_RM_R,
+
+/* 0x88 */ x86emuOp_mov_byte_RM_R,
+/* 0x89 */ x86emuOp_mov_word_RM_R,
+/* 0x8a */ x86emuOp_mov_byte_R_RM,
+/* 0x8b */ x86emuOp_mov_word_R_RM,
+/* 0x8c */ x86emuOp_mov_word_RM_SR,
+/* 0x8d */ x86emuOp_lea_word_R_M,
+/* 0x8e */ x86emuOp_mov_word_SR_RM,
+/* 0x8f */ x86emuOp_pop_RM,
+
+/* 0x90 */ x86emuOp_nop,
+/* 0x91 */ x86emuOp_xchg_word_AX_CX,
+/* 0x92 */ x86emuOp_xchg_word_AX_DX,
+/* 0x93 */ x86emuOp_xchg_word_AX_BX,
+/* 0x94 */ x86emuOp_xchg_word_AX_SP,
+/* 0x95 */ x86emuOp_xchg_word_AX_BP,
+/* 0x96 */ x86emuOp_xchg_word_AX_SI,
+/* 0x97 */ x86emuOp_xchg_word_AX_DI,
+
+/* 0x98 */ x86emuOp_cbw,
+/* 0x99 */ x86emuOp_cwd,
+/* 0x9a */ x86emuOp_call_far_IMM,
+/* 0x9b */ x86emuOp_wait,
+/* 0x9c */ x86emuOp_pushf_word,
+/* 0x9d */ x86emuOp_popf_word,
+/* 0x9e */ x86emuOp_sahf,
+/* 0x9f */ x86emuOp_lahf,
+
+/* 0xa0 */ x86emuOp_mov_AL_M_IMM,
+/* 0xa1 */ x86emuOp_mov_AX_M_IMM,
+/* 0xa2 */ x86emuOp_mov_M_AL_IMM,
+/* 0xa3 */ x86emuOp_mov_M_AX_IMM,
+/* 0xa4 */ x86emuOp_movs_byte,
+/* 0xa5 */ x86emuOp_movs_word,
+/* 0xa6 */ x86emuOp_cmps_byte,
+/* 0xa7 */ x86emuOp_cmps_word,
+/* 0xa8 */ x86emuOp_test_AL_IMM,
+/* 0xa9 */ x86emuOp_test_AX_IMM,
+/* 0xaa */ x86emuOp_stos_byte,
+/* 0xab */ x86emuOp_stos_word,
+/* 0xac */ x86emuOp_lods_byte,
+/* 0xad */ x86emuOp_lods_word,
+/* 0xac */ x86emuOp_scas_byte,
+/* 0xad */ x86emuOp_scas_word,
+
+
+/* 0xb0 */ x86emuOp_mov_byte_AL_IMM,
+/* 0xb1 */ x86emuOp_mov_byte_CL_IMM,
+/* 0xb2 */ x86emuOp_mov_byte_DL_IMM,
+/* 0xb3 */ x86emuOp_mov_byte_BL_IMM,
+/* 0xb4 */ x86emuOp_mov_byte_AH_IMM,
+/* 0xb5 */ x86emuOp_mov_byte_CH_IMM,
+/* 0xb6 */ x86emuOp_mov_byte_DH_IMM,
+/* 0xb7 */ x86emuOp_mov_byte_BH_IMM,
+
+/* 0xb8 */ x86emuOp_mov_word_AX_IMM,
+/* 0xb9 */ x86emuOp_mov_word_CX_IMM,
+/* 0xba */ x86emuOp_mov_word_DX_IMM,
+/* 0xbb */ x86emuOp_mov_word_BX_IMM,
+/* 0xbc */ x86emuOp_mov_word_SP_IMM,
+/* 0xbd */ x86emuOp_mov_word_BP_IMM,
+/* 0xbe */ x86emuOp_mov_word_SI_IMM,
+/* 0xbf */ x86emuOp_mov_word_DI_IMM,
+
+/* 0xc0 */ x86emuOp_opcC0_byte_RM_MEM,
+/* 0xc1 */ x86emuOp_opcC1_word_RM_MEM,
+/* 0xc2 */ x86emuOp_ret_near_IMM,
+/* 0xc3 */ x86emuOp_ret_near,
+/* 0xc4 */ x86emuOp_les_R_IMM,
+/* 0xc5 */ x86emuOp_lds_R_IMM,
+/* 0xc6 */ x86emuOp_mov_byte_RM_IMM,
+/* 0xc7 */ x86emuOp_mov_word_RM_IMM,
+/* 0xc8 */ x86emuOp_enter,
+/* 0xc9 */ x86emuOp_leave,
+/* 0xca */ x86emuOp_ret_far_IMM,
+/* 0xcb */ x86emuOp_ret_far,
+/* 0xcc */ x86emuOp_int3,
+/* 0xcd */ x86emuOp_int_IMM,
+/* 0xce */ x86emuOp_into,
+/* 0xcf */ x86emuOp_iret,
+
+/* 0xd0 */ x86emuOp_opcD0_byte_RM_1,
+/* 0xd1 */ x86emuOp_opcD1_word_RM_1,
+/* 0xd2 */ x86emuOp_opcD2_byte_RM_CL,
+/* 0xd3 */ x86emuOp_opcD3_word_RM_CL,
+/* 0xd4 */ x86emuOp_aam,
+/* 0xd5 */ x86emuOp_aad,
+/* 0xd6 */ x86emuOp_illegal_op, /* Undocumented SETALC instruction */
+/* 0xd7 */ x86emuOp_xlat,
+/* 0xd8 */ x86emuOp_esc_coprocess_d8,
+/* 0xd9 */ x86emuOp_esc_coprocess_d9,
+/* 0xda */ x86emuOp_esc_coprocess_da,
+/* 0xdb */ x86emuOp_esc_coprocess_db,
+/* 0xdc */ x86emuOp_esc_coprocess_dc,
+/* 0xdd */ x86emuOp_esc_coprocess_dd,
+/* 0xde */ x86emuOp_esc_coprocess_de,
+/* 0xdf */ x86emuOp_esc_coprocess_df,
+
+/* 0xe0 */ x86emuOp_loopne,
+/* 0xe1 */ x86emuOp_loope,
+/* 0xe2 */ x86emuOp_loop,
+/* 0xe3 */ x86emuOp_jcxz,
+/* 0xe4 */ x86emuOp_in_byte_AL_IMM,
+/* 0xe5 */ x86emuOp_in_word_AX_IMM,
+/* 0xe6 */ x86emuOp_out_byte_IMM_AL,
+/* 0xe7 */ x86emuOp_out_word_IMM_AX,
+
+/* 0xe8 */ x86emuOp_call_near_IMM,
+/* 0xe9 */ x86emuOp_jump_near_IMM,
+/* 0xea */ x86emuOp_jump_far_IMM,
+/* 0xeb */ x86emuOp_jump_byte_IMM,
+/* 0xec */ x86emuOp_in_byte_AL_DX,
+/* 0xed */ x86emuOp_in_word_AX_DX,
+/* 0xee */ x86emuOp_out_byte_DX_AL,
+/* 0xef */ x86emuOp_out_word_DX_AX,
+
+/* 0xf0 */ x86emuOp_lock,
+/* 0xf1 */ x86emuOp_illegal_op,
+/* 0xf2 */ x86emuOp_repne,
+/* 0xf3 */ x86emuOp_repe,
+/* 0xf4 */ x86emuOp_halt,
+/* 0xf5 */ x86emuOp_cmc,
+/* 0xf6 */ x86emuOp_opcF6_byte_RM,
+/* 0xf7 */ x86emuOp_opcF7_word_RM,
+
+/* 0xf8 */ x86emuOp_clc,
+/* 0xf9 */ x86emuOp_stc,
+/* 0xfa */ x86emuOp_cli,
+/* 0xfb */ x86emuOp_sti,
+/* 0xfc */ x86emuOp_cld,
+/* 0xfd */ x86emuOp_std,
+/* 0xfe */ x86emuOp_opcFE_byte_RM,
+/* 0xff */ x86emuOp_opcFF_word_RM,
+};
diff --git a/cfe/cfe/x86emu/ops2.c b/cfe/cfe/x86emu/ops2.c
new file mode 100644
index 0000000..c59c813
--- /dev/null
+++ b/cfe/cfe/x86emu/ops2.c
@@ -0,0 +1,2802 @@
+/****************************************************************************
+*
+* Realmode X86 Emulator Library
+*
+* Copyright (C) 1996-1999 SciTech Software, Inc.
+* Copyright (C) David Mosberger-Tang
+* Copyright (C) 1999 Egbert Eich
+*
+* ========================================================================
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee,
+* provided that the above copyright notice appear in all copies and that
+* both that copyright notice and this permission notice appear in
+* supporting documentation, and that the name of the authors not be used
+* in advertising or publicity pertaining to distribution of the software
+* without specific, written prior permission. The authors makes no
+* representations about the suitability of this software for any purpose.
+* It is provided "as is" without express or implied warranty.
+*
+* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+* PERFORMANCE OF THIS SOFTWARE.
+*
+* ========================================================================
+*
+* Language: ANSI C
+* Environment: Any
+* Developer: Kendall Bennett
+*
+* Description: This file includes subroutines to implement the decoding
+* and emulation of all the x86 extended two-byte processor
+* instructions.
+*
+****************************************************************************/
+/* $XFree86: xc/extras/x86emu/src/x86emu/ops2.c,v 1.4 2000/11/16 19:44:50 eich Exp $ */
+
+#include "x86emu/x86emui.h"
+#include "x86emu/ops_protos.h"
+
+/*----------------------------- Implementation ----------------------------*/
+
+/****************************************************************************
+PARAMETERS:
+op1 - Instruction op code
+
+REMARKS:
+Handles illegal opcodes.
+****************************************************************************/
+void x86emuOp2_illegal_op(
+ u8 op2)
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\n");
+ TRACE_REGS();
+ printk("%04x:%04x: %02X ILLEGAL EXTENDED X86 OPCODE!\n",
+ M.x86.R_CS, M.x86.R_IP-2,op2);
+ HALT_SYS();
+ END_OF_INSTR();
+}
+
+#define xorl(a,b) ((a) && !(b)) || (!(a) && (b))
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0x80-0x8F
+****************************************************************************/
+void x86emuOp2_long_jump(u8 op2)
+{
+ s32 target;
+ char *name = 0;
+ int cond = 0;
+
+ /* conditional jump to word offset. */
+ START_OF_INSTR();
+ switch (op2) {
+ case 0x80:
+ name = "JO\t";
+ cond = ACCESS_FLAG(F_OF);
+ break;
+ case 0x81:
+ name = "JNO\t";
+ cond = !ACCESS_FLAG(F_OF);
+ break;
+ case 0x82:
+ name = "JB\t";
+ cond = ACCESS_FLAG(F_CF);
+ break;
+ case 0x83:
+ name = "JNB\t";
+ cond = !ACCESS_FLAG(F_CF);
+ break;
+ case 0x84:
+ name = "JZ\t";
+ cond = ACCESS_FLAG(F_ZF);
+ break;
+ case 0x85:
+ name = "JNZ\t";
+ cond = !ACCESS_FLAG(F_ZF);
+ break;
+ case 0x86:
+ name = "JBE\t";
+ cond = ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF);
+ break;
+ case 0x87:
+ name = "JNBE\t";
+ cond = !(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF));
+ break;
+ case 0x88:
+ name = "JS\t";
+ cond = ACCESS_FLAG(F_SF);
+ break;
+ case 0x89:
+ name = "JNS\t";
+ cond = !ACCESS_FLAG(F_SF);
+ break;
+ case 0x8a:
+ name = "JP\t";
+ cond = ACCESS_FLAG(F_PF);
+ break;
+ case 0x8b:
+ name = "JNP\t";
+ cond = !ACCESS_FLAG(F_PF);
+ break;
+ case 0x8c:
+ name = "JL\t";
+ cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
+ break;
+ case 0x8d:
+ name = "JNL\t";
+ cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
+ break;
+ case 0x8e:
+ name = "JLE\t";
+ cond = (xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
+ ACCESS_FLAG(F_ZF));
+ break;
+ case 0x8f:
+ name = "JNLE\t";
+ cond = !(xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
+ ACCESS_FLAG(F_ZF));
+ break;
+ }
+ DECODE_PRINTF(name);
+ target = (s16) fetch_word_imm();
+ target += (s16) M.x86.R_IP;
+ DECODE_PRINTF2("%04x\n", target);
+ TRACE_AND_STEP();
+ if (cond)
+ M.x86.R_IP = (u16)target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0x90-0x9F
+****************************************************************************/
+void x86emuOp2_set_byte(u8 op2)
+{
+ int mod, rl, rh;
+ uint destoffset;
+ u8 *destreg;
+ char *name = 0;
+ int cond = 0;
+
+ START_OF_INSTR();
+ switch (op2) {
+ case 0x90:
+ name = "SETO\t";
+ cond = ACCESS_FLAG(F_OF);
+ break;
+ case 0x91:
+ name = "SETNO\t";
+ cond = !ACCESS_FLAG(F_OF);
+ break;
+ case 0x92:
+ name = "SETB\t";
+ cond = ACCESS_FLAG(F_CF);
+ break;
+ case 0x93:
+ name = "SETNB\t";
+ cond = !ACCESS_FLAG(F_CF);
+ break;
+ case 0x94:
+ name = "SETZ\t";
+ cond = ACCESS_FLAG(F_ZF);
+ break;
+ case 0x95:
+ name = "SETNZ\t";
+ cond = !ACCESS_FLAG(F_ZF);
+ break;
+ case 0x96:
+ name = "SETBE\t";
+ cond = ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF);
+ break;
+ case 0x97:
+ name = "SETNBE\t";
+ cond = !(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF));
+ break;
+ case 0x98:
+ name = "SETS\t";
+ cond = ACCESS_FLAG(F_SF);
+ break;
+ case 0x99:
+ name = "SETNS\t";
+ cond = !ACCESS_FLAG(F_SF);
+ break;
+ case 0x9a:
+ name = "SETP\t";
+ cond = ACCESS_FLAG(F_PF);
+ break;
+ case 0x9b:
+ name = "SETNP\t";
+ cond = !ACCESS_FLAG(F_PF);
+ break;
+ case 0x9c:
+ name = "SETL\t";
+ cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
+ break;
+ case 0x9d:
+ name = "SETNL\t";
+ cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
+ break;
+ case 0x9e:
+ name = "SETLE\t";
+ cond = (xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
+ ACCESS_FLAG(F_ZF));
+ break;
+ case 0x9f:
+ name = "SETNLE\t";
+ cond = !(xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
+ ACCESS_FLAG(F_ZF));
+ break;
+ }
+ DECODE_PRINTF(name);
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ TRACE_AND_STEP();
+ store_data_byte(destoffset, cond ? 0x01 : 0x00);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ TRACE_AND_STEP();
+ store_data_byte(destoffset, cond ? 0x01 : 0x00);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ TRACE_AND_STEP();
+ store_data_byte(destoffset, cond ? 0x01 : 0x00);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ TRACE_AND_STEP();
+ *destreg = cond ? 0x01 : 0x00;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xa0
+****************************************************************************/
+void x86emuOp2_push_FS(u8 X86EMU_UNUSED(op2))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("PUSH\tFS\n");
+ TRACE_AND_STEP();
+ push_word(M.x86.R_FS);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xa1
+****************************************************************************/
+void x86emuOp2_pop_FS(u8 X86EMU_UNUSED(op2))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("POP\tFS\n");
+ TRACE_AND_STEP();
+ M.x86.R_FS = pop_word();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xa3
+****************************************************************************/
+void x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+ int bit,disp;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("BT\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 srcval;
+ u32 *shiftreg;
+
+ srcoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+ disp = (s16)*shiftreg >> 5;
+ srcval = fetch_data_long(srcoffset+disp);
+ CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
+ } else {
+ u16 srcval;
+ u16 *shiftreg;
+
+ srcoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+ disp = (s16)*shiftreg >> 4;
+ srcval = fetch_data_word(srcoffset+disp);
+ CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 srcval;
+ u32 *shiftreg;
+
+ srcoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+ disp = (s16)*shiftreg >> 5;
+ srcval = fetch_data_long(srcoffset+disp);
+ CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
+ } else {
+ u16 srcval;
+ u16 *shiftreg;
+
+ srcoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+ disp = (s16)*shiftreg >> 4;
+ srcval = fetch_data_word(srcoffset+disp);
+ CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 srcval;
+ u32 *shiftreg;
+
+ srcoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+ disp = (s16)*shiftreg >> 5;
+ srcval = fetch_data_long(srcoffset+disp);
+ CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
+ } else {
+ u16 srcval;
+ u16 *shiftreg;
+
+ srcoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+ disp = (s16)*shiftreg >> 4;
+ srcval = fetch_data_word(srcoffset+disp);
+ CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg,*shiftreg;
+
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+ CONDITIONAL_SET_FLAG(*srcreg & (0x1 << bit),F_CF);
+ } else {
+ u16 *srcreg,*shiftreg;
+
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+ CONDITIONAL_SET_FLAG(*srcreg & (0x1 << bit),F_CF);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xa4
+****************************************************************************/
+void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+{
+ int mod, rl, rh;
+ uint destoffset;
+ u8 shift;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SHLD\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *shiftreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+ destval = shld_long(destval,*shiftreg,shift);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *shiftreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+ destval = shld_word(destval,*shiftreg,shift);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *shiftreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+ destval = shld_long(destval,*shiftreg,shift);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *shiftreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+ destval = shld_word(destval,*shiftreg,shift);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *shiftreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+ destval = shld_long(destval,*shiftreg,shift);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *shiftreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+ destval = shld_word(destval,*shiftreg,shift);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*shiftreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ *destreg = shld_long(*destreg,*shiftreg,shift);
+ } else {
+ u16 *destreg,*shiftreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ *destreg = shld_word(*destreg,*shiftreg,shift);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xa5
+****************************************************************************/
+void x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SHLD\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *shiftreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+ destval = shld_long(destval,*shiftreg,M.x86.R_CL);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *shiftreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+ destval = shld_word(destval,*shiftreg,M.x86.R_CL);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *shiftreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+ destval = shld_long(destval,*shiftreg,M.x86.R_CL);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *shiftreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+ destval = shld_word(destval,*shiftreg,M.x86.R_CL);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *shiftreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+ destval = shld_long(destval,*shiftreg,M.x86.R_CL);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *shiftreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+ destval = shld_word(destval,*shiftreg,M.x86.R_CL);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*shiftreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ *destreg = shld_long(*destreg,*shiftreg,M.x86.R_CL);
+ } else {
+ u16 *destreg,*shiftreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ *destreg = shld_word(*destreg,*shiftreg,M.x86.R_CL);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xa8
+****************************************************************************/
+void x86emuOp2_push_GS(u8 X86EMU_UNUSED(op2))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("PUSH\tGS\n");
+ TRACE_AND_STEP();
+ push_word(M.x86.R_GS);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xa9
+****************************************************************************/
+void x86emuOp2_pop_GS(u8 X86EMU_UNUSED(op2))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("POP\tGS\n");
+ TRACE_AND_STEP();
+ M.x86.R_GS = pop_word();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xaa
+****************************************************************************/
+void x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+ int bit,disp;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("BTS\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 srcval,mask;
+ u32 *shiftreg;
+
+ srcoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+ disp = (s16)*shiftreg >> 5;
+ srcval = fetch_data_long(srcoffset+disp);
+ mask = (0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ store_data_long(srcoffset+disp, srcval | mask);
+ } else {
+ u16 srcval,mask;
+ u16 *shiftreg;
+
+ srcoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+ disp = (s16)*shiftreg >> 4;
+ srcval = fetch_data_word(srcoffset+disp);
+ mask = (u16)(0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ store_data_word(srcoffset+disp, srcval | mask);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 srcval,mask;
+ u32 *shiftreg;
+
+ srcoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+ disp = (s16)*shiftreg >> 5;
+ srcval = fetch_data_long(srcoffset+disp);
+ mask = (0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ store_data_long(srcoffset+disp, srcval | mask);
+ } else {
+ u16 srcval,mask;
+ u16 *shiftreg;
+
+ srcoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+ disp = (s16)*shiftreg >> 4;
+ srcval = fetch_data_word(srcoffset+disp);
+ mask = (u16)(0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ store_data_word(srcoffset+disp, srcval | mask);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 srcval,mask;
+ u32 *shiftreg;
+
+ srcoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+ disp = (s16)*shiftreg >> 5;
+ srcval = fetch_data_long(srcoffset+disp);
+ mask = (0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ store_data_long(srcoffset+disp, srcval | mask);
+ } else {
+ u16 srcval,mask;
+ u16 *shiftreg;
+
+ srcoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+ disp = (s16)*shiftreg >> 4;
+ srcval = fetch_data_word(srcoffset+disp);
+ mask = (u16)(0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ store_data_word(srcoffset+disp, srcval | mask);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg,*shiftreg;
+ u32 mask;
+
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+ mask = (0x1 << bit);
+ CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+ *srcreg |= mask;
+ } else {
+ u16 *srcreg,*shiftreg;
+ u16 mask;
+
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+ mask = (u16)(0x1 << bit);
+ CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+ *srcreg |= mask;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xac
+****************************************************************************/
+void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+{
+ int mod, rl, rh;
+ uint destoffset;
+ u8 shift;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SHLD\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *shiftreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+ destval = shrd_long(destval,*shiftreg,shift);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *shiftreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+ destval = shrd_word(destval,*shiftreg,shift);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *shiftreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+ destval = shrd_long(destval,*shiftreg,shift);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *shiftreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+ destval = shrd_word(destval,*shiftreg,shift);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *shiftreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+ destval = shrd_long(destval,*shiftreg,shift);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *shiftreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+ destval = shrd_word(destval,*shiftreg,shift);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*shiftreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ *destreg = shrd_long(*destreg,*shiftreg,shift);
+ } else {
+ u16 *destreg,*shiftreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ *destreg = shrd_word(*destreg,*shiftreg,shift);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xad
+****************************************************************************/
+void x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SHLD\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *shiftreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+ destval = shrd_long(destval,*shiftreg,M.x86.R_CL);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *shiftreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+ destval = shrd_word(destval,*shiftreg,M.x86.R_CL);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *shiftreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+ destval = shrd_long(destval,*shiftreg,M.x86.R_CL);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *shiftreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+ destval = shrd_word(destval,*shiftreg,M.x86.R_CL);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *shiftreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+ destval = shrd_long(destval,*shiftreg,M.x86.R_CL);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *shiftreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+ destval = shrd_word(destval,*shiftreg,M.x86.R_CL);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*shiftreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ *destreg = shrd_long(*destreg,*shiftreg,M.x86.R_CL);
+ } else {
+ u16 *destreg,*shiftreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ *destreg = shrd_word(*destreg,*shiftreg,M.x86.R_CL);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xaf
+****************************************************************************/
+void x86emuOp2_imul_R_RM(u8 X86EMU_UNUSED(op2))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("IMUL\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+ u32 res_lo,res_hi;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ TRACE_AND_STEP();
+ imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)srcval);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u32)res_lo;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ TRACE_AND_STEP();
+ res = (s16)*destreg * (s16)srcval;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u16)res;
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+ u32 res_lo,res_hi;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ TRACE_AND_STEP();
+ imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)srcval);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u32)res_lo;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ TRACE_AND_STEP();
+ res = (s16)*destreg * (s16)srcval;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u16)res;
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+ u32 res_lo,res_hi;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ TRACE_AND_STEP();
+ imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)srcval);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u32)res_lo;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ TRACE_AND_STEP();
+ res = (s16)*destreg * (s16)srcval;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u16)res;
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+ u32 res_lo,res_hi;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ TRACE_AND_STEP();
+ imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)*srcreg);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u32)res_lo;
+ } else {
+ u16 *destreg,*srcreg;
+ u32 res;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ res = (s16)*destreg * (s16)*srcreg;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u16)res;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xb2
+****************************************************************************/
+void x86emuOp2_lss_R_IMM(u8 X86EMU_UNUSED(op2))
+{
+ int mod, rh, rl;
+ u16 *dstreg;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("LSS\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_SS = fetch_data_word(srcoffset + 2);
+ break;
+ case 1:
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_SS = fetch_data_word(srcoffset + 2);
+ break;
+ case 2:
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_SS = fetch_data_word(srcoffset + 2);
+ break;
+ case 3: /* register to register */
+ /* UNDEFINED! */
+ TRACE_AND_STEP();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xb3
+****************************************************************************/
+void x86emuOp2_btr_R(u8 X86EMU_UNUSED(op2))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+ int bit,disp;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("BTR\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 srcval,mask;
+ u32 *shiftreg;
+
+ srcoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+ disp = (s16)*shiftreg >> 5;
+ srcval = fetch_data_long(srcoffset+disp);
+ mask = (0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ store_data_long(srcoffset+disp, srcval & ~mask);
+ } else {
+ u16 srcval,mask;
+ u16 *shiftreg;
+
+ srcoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+ disp = (s16)*shiftreg >> 4;
+ srcval = fetch_data_word(srcoffset+disp);
+ mask = (u16)(0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ store_data_word(srcoffset+disp, (u16)(srcval & ~mask));
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 srcval,mask;
+ u32 *shiftreg;
+
+ srcoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+ disp = (s16)*shiftreg >> 5;
+ srcval = fetch_data_long(srcoffset+disp);
+ mask = (0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ store_data_long(srcoffset+disp, srcval & ~mask);
+ } else {
+ u16 srcval,mask;
+ u16 *shiftreg;
+
+ srcoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+ disp = (s16)*shiftreg >> 4;
+ srcval = fetch_data_word(srcoffset+disp);
+ mask = (u16)(0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ store_data_word(srcoffset+disp, (u16)(srcval & ~mask));
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 srcval,mask;
+ u32 *shiftreg;
+
+ srcoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+ disp = (s16)*shiftreg >> 5;
+ srcval = fetch_data_long(srcoffset+disp);
+ mask = (0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ store_data_long(srcoffset+disp, srcval & ~mask);
+ } else {
+ u16 srcval,mask;
+ u16 *shiftreg;
+
+ srcoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+ disp = (s16)*shiftreg >> 4;
+ srcval = fetch_data_word(srcoffset+disp);
+ mask = (u16)(0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ store_data_word(srcoffset+disp, (u16)(srcval & ~mask));
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg,*shiftreg;
+ u32 mask;
+
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+ mask = (0x1 << bit);
+ CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+ *srcreg &= ~mask;
+ } else {
+ u16 *srcreg,*shiftreg;
+ u16 mask;
+
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+ mask = (u16)(0x1 << bit);
+ CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+ *srcreg &= ~mask;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xb4
+****************************************************************************/
+void x86emuOp2_lfs_R_IMM(u8 X86EMU_UNUSED(op2))
+{
+ int mod, rh, rl;
+ u16 *dstreg;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("LFS\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_FS = fetch_data_word(srcoffset + 2);
+ break;
+ case 1:
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_FS = fetch_data_word(srcoffset + 2);
+ break;
+ case 2:
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_FS = fetch_data_word(srcoffset + 2);
+ break;
+ case 3: /* register to register */
+ /* UNDEFINED! */
+ TRACE_AND_STEP();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xb5
+****************************************************************************/
+void x86emuOp2_lgs_R_IMM(u8 X86EMU_UNUSED(op2))
+{
+ int mod, rh, rl;
+ u16 *dstreg;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("LGS\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_GS = fetch_data_word(srcoffset + 2);
+ break;
+ case 1:
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_GS = fetch_data_word(srcoffset + 2);
+ break;
+ case 2:
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_GS = fetch_data_word(srcoffset + 2);
+ break;
+ case 3: /* register to register */
+ /* UNDEFINED! */
+ TRACE_AND_STEP();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xb6
+****************************************************************************/
+void x86emuOp2_movzx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOVZX\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u8 *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+ } else {
+ u16 *destreg;
+ u8 *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xb7
+****************************************************************************/
+void x86emuOp2_movzx_word_R_RM(u8 X86EMU_UNUSED(op2))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+ u32 *destreg;
+ u32 srcval;
+ u16 *srcreg;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOVZX\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+ case 1:
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+ case 2:
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xba
+****************************************************************************/
+void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+ int bit;
+
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (rh) {
+ case 3:
+ DECODE_PRINTF("BT\t");
+ break;
+ case 4:
+ DECODE_PRINTF("BTS\t");
+ break;
+ case 5:
+ DECODE_PRINTF("BTR\t");
+ break;
+ case 6:
+ DECODE_PRINTF("BTC\t");
+ break;
+ default:
+ DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\n");
+ TRACE_REGS();
+ printk("%04x:%04x: %02X%02X ILLEGAL EXTENDED X86 OPCODE EXTENSION!\n",
+ M.x86.R_CS, M.x86.R_IP-3,op2, (mod<<6)|(rh<<3)|rl);
+ HALT_SYS();
+ }
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 srcval, mask;
+ u8 shift;
+
+ srcoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ TRACE_AND_STEP();
+ bit = shift & 0x1F;
+ srcval = fetch_data_long(srcoffset);
+ mask = (0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ switch (rh) {
+ case 4:
+ store_data_long(srcoffset, srcval | mask);
+ break;
+ case 5:
+ store_data_long(srcoffset, srcval & ~mask);
+ break;
+ case 6:
+ store_data_long(srcoffset, srcval ^ mask);
+ break;
+ default:
+ break;
+ }
+ } else {
+ u16 srcval, mask;
+ u8 shift;
+
+ srcoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ TRACE_AND_STEP();
+ bit = shift & 0xF;
+ srcval = fetch_data_word(srcoffset);
+ mask = (0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ switch (rh) {
+ case 4:
+ store_data_word(srcoffset, srcval | mask);
+ break;
+ case 5:
+ store_data_word(srcoffset, srcval & ~mask);
+ break;
+ case 6:
+ store_data_word(srcoffset, srcval ^ mask);
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 srcval, mask;
+ u8 shift;
+
+ srcoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ TRACE_AND_STEP();
+ bit = shift & 0x1F;
+ srcval = fetch_data_long(srcoffset);
+ mask = (0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ switch (rh) {
+ case 4:
+ store_data_long(srcoffset, srcval | mask);
+ break;
+ case 5:
+ store_data_long(srcoffset, srcval & ~mask);
+ break;
+ case 6:
+ store_data_long(srcoffset, srcval ^ mask);
+ break;
+ default:
+ break;
+ }
+ } else {
+ u16 srcval, mask;
+ u8 shift;
+
+ srcoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ TRACE_AND_STEP();
+ bit = shift & 0xF;
+ srcval = fetch_data_word(srcoffset);
+ mask = (0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ switch (rh) {
+ case 4:
+ store_data_word(srcoffset, srcval | mask);
+ break;
+ case 5:
+ store_data_word(srcoffset, srcval & ~mask);
+ break;
+ case 6:
+ store_data_word(srcoffset, srcval ^ mask);
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 srcval, mask;
+ u8 shift;
+
+ srcoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ TRACE_AND_STEP();
+ bit = shift & 0x1F;
+ srcval = fetch_data_long(srcoffset);
+ mask = (0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ switch (rh) {
+ case 4:
+ store_data_long(srcoffset, srcval | mask);
+ break;
+ case 5:
+ store_data_long(srcoffset, srcval & ~mask);
+ break;
+ case 6:
+ store_data_long(srcoffset, srcval ^ mask);
+ break;
+ default:
+ break;
+ }
+ } else {
+ u16 srcval, mask;
+ u8 shift;
+
+ srcoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ TRACE_AND_STEP();
+ bit = shift & 0xF;
+ srcval = fetch_data_word(srcoffset);
+ mask = (0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ switch (rh) {
+ case 4:
+ store_data_word(srcoffset, srcval | mask);
+ break;
+ case 5:
+ store_data_word(srcoffset, srcval & ~mask);
+ break;
+ case 6:
+ store_data_word(srcoffset, srcval ^ mask);
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg;
+ u32 mask;
+ u8 shift;
+
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ TRACE_AND_STEP();
+ bit = shift & 0x1F;
+ mask = (0x1 << bit);
+ CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+ switch (rh) {
+ case 4:
+ *srcreg |= mask;
+ break;
+ case 5:
+ *srcreg &= ~mask;
+ break;
+ case 6:
+ *srcreg ^= mask;
+ break;
+ default:
+ break;
+ }
+ } else {
+ u16 *srcreg;
+ u16 mask;
+ u8 shift;
+
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ TRACE_AND_STEP();
+ bit = shift & 0xF;
+ mask = (0x1 << bit);
+ CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+ switch (rh) {
+ case 4:
+ *srcreg |= mask;
+ break;
+ case 5:
+ *srcreg &= ~mask;
+ break;
+ case 6:
+ *srcreg ^= mask;
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xbb
+****************************************************************************/
+void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+ int bit,disp;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("BTC\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 srcval,mask;
+ u32 *shiftreg;
+
+ srcoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+ disp = (s16)*shiftreg >> 5;
+ srcval = fetch_data_long(srcoffset+disp);
+ mask = (0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ store_data_long(srcoffset+disp, srcval ^ mask);
+ } else {
+ u16 srcval,mask;
+ u16 *shiftreg;
+
+ srcoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+ disp = (s16)*shiftreg >> 4;
+ srcval = fetch_data_word(srcoffset+disp);
+ mask = (u16)(0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ store_data_word(srcoffset+disp, (u16)(srcval ^ mask));
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 srcval,mask;
+ u32 *shiftreg;
+
+ srcoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+ disp = (s16)*shiftreg >> 5;
+ srcval = fetch_data_long(srcoffset+disp);
+ mask = (0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ store_data_long(srcoffset+disp, srcval ^ mask);
+ } else {
+ u16 srcval,mask;
+ u16 *shiftreg;
+
+ srcoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+ disp = (s16)*shiftreg >> 4;
+ srcval = fetch_data_word(srcoffset+disp);
+ mask = (u16)(0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ store_data_word(srcoffset+disp, (u16)(srcval ^ mask));
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 srcval,mask;
+ u32 *shiftreg;
+
+ srcoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+ disp = (s16)*shiftreg >> 5;
+ srcval = fetch_data_long(srcoffset+disp);
+ mask = (0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ store_data_long(srcoffset+disp, srcval ^ mask);
+ } else {
+ u16 srcval,mask;
+ u16 *shiftreg;
+
+ srcoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+ disp = (s16)*shiftreg >> 4;
+ srcval = fetch_data_word(srcoffset+disp);
+ mask = (u16)(0x1 << bit);
+ CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+ store_data_word(srcoffset+disp, (u16)(srcval ^ mask));
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg,*shiftreg;
+ u32 mask;
+
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+ mask = (0x1 << bit);
+ CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+ *srcreg ^= mask;
+ } else {
+ u16 *srcreg,*shiftreg;
+ u16 mask;
+
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+ mask = (u16)(0x1 << bit);
+ CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+ *srcreg ^= mask;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xbc
+****************************************************************************/
+void x86emuOp2_bsf(u8 X86EMU_UNUSED(op2))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("BSF\n");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch(mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 srcval, *dstreg;
+
+ srcoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ dstreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ srcval = fetch_data_long(srcoffset);
+ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+ for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
+ if ((srcval >> *dstreg) & 1) break;
+ } else {
+ u16 srcval, *dstreg;
+
+ srcoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ srcval = fetch_data_word(srcoffset);
+ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+ for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
+ if ((srcval >> *dstreg) & 1) break;
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 srcval, *dstreg;
+
+ srcoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ dstreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ srcval = fetch_data_long(srcoffset);
+ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+ for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
+ if ((srcval >> *dstreg) & 1) break;
+ } else {
+ u16 srcval, *dstreg;
+
+ srcoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ srcval = fetch_data_word(srcoffset);
+ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+ for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
+ if ((srcval >> *dstreg) & 1) break;
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 srcval, *dstreg;
+
+ srcoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ dstreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ srcval = fetch_data_long(srcoffset);
+ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+ for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
+ if ((srcval >> *dstreg) & 1) break;
+ } else {
+ u16 srcval, *dstreg;
+
+ srcoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ srcval = fetch_data_word(srcoffset);
+ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+ for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
+ if ((srcval >> *dstreg) & 1) break;
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg, *dstreg;
+
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ dstreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ CONDITIONAL_SET_FLAG(*srcreg == 0, F_ZF);
+ for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
+ if ((*srcreg >> *dstreg) & 1) break;
+ } else {
+ u16 *srcreg, *dstreg;
+
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ CONDITIONAL_SET_FLAG(*srcreg == 0, F_ZF);
+ for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
+ if ((*srcreg >> *dstreg) & 1) break;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xbd
+****************************************************************************/
+void x86emuOp2_bsr(u8 X86EMU_UNUSED(op2))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("BSF\n");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch(mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 srcval, *dstreg;
+
+ srcoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ dstreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ srcval = fetch_data_long(srcoffset);
+ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+ for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
+ if ((srcval >> *dstreg) & 1) break;
+ } else {
+ u16 srcval, *dstreg;
+
+ srcoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ srcval = fetch_data_word(srcoffset);
+ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+ for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
+ if ((srcval >> *dstreg) & 1) break;
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 srcval, *dstreg;
+
+ srcoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ dstreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ srcval = fetch_data_long(srcoffset);
+ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+ for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
+ if ((srcval >> *dstreg) & 1) break;
+ } else {
+ u16 srcval, *dstreg;
+
+ srcoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ srcval = fetch_data_word(srcoffset);
+ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+ for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
+ if ((srcval >> *dstreg) & 1) break;
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 srcval, *dstreg;
+
+ srcoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ dstreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ srcval = fetch_data_long(srcoffset);
+ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+ for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
+ if ((srcval >> *dstreg) & 1) break;
+ } else {
+ u16 srcval, *dstreg;
+
+ srcoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ srcval = fetch_data_word(srcoffset);
+ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+ for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
+ if ((srcval >> *dstreg) & 1) break;
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg, *dstreg;
+
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ dstreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ CONDITIONAL_SET_FLAG(*srcreg == 0, F_ZF);
+ for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
+ if ((*srcreg >> *dstreg) & 1) break;
+ } else {
+ u16 *srcreg, *dstreg;
+
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ CONDITIONAL_SET_FLAG(*srcreg == 0, F_ZF);
+ for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
+ if ((*srcreg >> *dstreg) & 1) break;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xbe
+****************************************************************************/
+void x86emuOp2_movsx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOVSX\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = (s32)((s8)fetch_data_byte(srcoffset));
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = (s16)((s8)fetch_data_byte(srcoffset));
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = (s32)((s8)fetch_data_byte(srcoffset));
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = (s16)((s8)fetch_data_byte(srcoffset));
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = (s32)((s8)fetch_data_byte(srcoffset));
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = (s16)((s8)fetch_data_byte(srcoffset));
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u8 *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = (s32)((s8)*srcreg);
+ } else {
+ u16 *destreg;
+ u8 *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = (s16)((s8)*srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xbf
+****************************************************************************/
+void x86emuOp2_movsx_word_R_RM(u8 X86EMU_UNUSED(op2))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+ u32 *destreg;
+ u32 srcval;
+ u16 *srcreg;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOVSX\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = (s32)((s16)fetch_data_word(srcoffset));
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+ case 1:
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = (s32)((s16)fetch_data_word(srcoffset));
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+ case 2:
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = (s32)((s16)fetch_data_word(srcoffset));
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = (s32)((s16)*srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/***************************************************************************
+ * Double byte operation code table:
+ **************************************************************************/
+void (*x86emu_optab2[256])(u8) =
+{
+/* 0x00 */ x86emuOp2_illegal_op, /* Group F (ring 0 PM) */
+/* 0x01 */ x86emuOp2_illegal_op, /* Group G (ring 0 PM) */
+/* 0x02 */ x86emuOp2_illegal_op, /* lar (ring 0 PM) */
+/* 0x03 */ x86emuOp2_illegal_op, /* lsl (ring 0 PM) */
+/* 0x04 */ x86emuOp2_illegal_op,
+/* 0x05 */ x86emuOp2_illegal_op, /* loadall (undocumented) */
+/* 0x06 */ x86emuOp2_illegal_op, /* clts (ring 0 PM) */
+/* 0x07 */ x86emuOp2_illegal_op, /* loadall (undocumented) */
+/* 0x08 */ x86emuOp2_illegal_op, /* invd (ring 0 PM) */
+/* 0x09 */ x86emuOp2_illegal_op, /* wbinvd (ring 0 PM) */
+/* 0x0a */ x86emuOp2_illegal_op,
+/* 0x0b */ x86emuOp2_illegal_op,
+/* 0x0c */ x86emuOp2_illegal_op,
+/* 0x0d */ x86emuOp2_illegal_op,
+/* 0x0e */ x86emuOp2_illegal_op,
+/* 0x0f */ x86emuOp2_illegal_op,
+
+/* 0x10 */ x86emuOp2_illegal_op,
+/* 0x11 */ x86emuOp2_illegal_op,
+/* 0x12 */ x86emuOp2_illegal_op,
+/* 0x13 */ x86emuOp2_illegal_op,
+/* 0x14 */ x86emuOp2_illegal_op,
+/* 0x15 */ x86emuOp2_illegal_op,
+/* 0x16 */ x86emuOp2_illegal_op,
+/* 0x17 */ x86emuOp2_illegal_op,
+/* 0x18 */ x86emuOp2_illegal_op,
+/* 0x19 */ x86emuOp2_illegal_op,
+/* 0x1a */ x86emuOp2_illegal_op,
+/* 0x1b */ x86emuOp2_illegal_op,
+/* 0x1c */ x86emuOp2_illegal_op,
+/* 0x1d */ x86emuOp2_illegal_op,
+/* 0x1e */ x86emuOp2_illegal_op,
+/* 0x1f */ x86emuOp2_illegal_op,
+
+/* 0x20 */ x86emuOp2_illegal_op, /* mov reg32,creg (ring 0 PM) */
+/* 0x21 */ x86emuOp2_illegal_op, /* mov reg32,dreg (ring 0 PM) */
+/* 0x22 */ x86emuOp2_illegal_op, /* mov creg,reg32 (ring 0 PM) */
+/* 0x23 */ x86emuOp2_illegal_op, /* mov dreg,reg32 (ring 0 PM) */
+/* 0x24 */ x86emuOp2_illegal_op, /* mov reg32,treg (ring 0 PM) */
+/* 0x25 */ x86emuOp2_illegal_op,
+/* 0x26 */ x86emuOp2_illegal_op, /* mov treg,reg32 (ring 0 PM) */
+/* 0x27 */ x86emuOp2_illegal_op,
+/* 0x28 */ x86emuOp2_illegal_op,
+/* 0x29 */ x86emuOp2_illegal_op,
+/* 0x2a */ x86emuOp2_illegal_op,
+/* 0x2b */ x86emuOp2_illegal_op,
+/* 0x2c */ x86emuOp2_illegal_op,
+/* 0x2d */ x86emuOp2_illegal_op,
+/* 0x2e */ x86emuOp2_illegal_op,
+/* 0x2f */ x86emuOp2_illegal_op,
+
+/* 0x30 */ x86emuOp2_illegal_op,
+/* 0x31 */ x86emuOp2_illegal_op,
+/* 0x32 */ x86emuOp2_illegal_op,
+/* 0x33 */ x86emuOp2_illegal_op,
+/* 0x34 */ x86emuOp2_illegal_op,
+/* 0x35 */ x86emuOp2_illegal_op,
+/* 0x36 */ x86emuOp2_illegal_op,
+/* 0x37 */ x86emuOp2_illegal_op,
+/* 0x38 */ x86emuOp2_illegal_op,
+/* 0x39 */ x86emuOp2_illegal_op,
+/* 0x3a */ x86emuOp2_illegal_op,
+/* 0x3b */ x86emuOp2_illegal_op,
+/* 0x3c */ x86emuOp2_illegal_op,
+/* 0x3d */ x86emuOp2_illegal_op,
+/* 0x3e */ x86emuOp2_illegal_op,
+/* 0x3f */ x86emuOp2_illegal_op,
+
+/* 0x40 */ x86emuOp2_illegal_op,
+/* 0x41 */ x86emuOp2_illegal_op,
+/* 0x42 */ x86emuOp2_illegal_op,
+/* 0x43 */ x86emuOp2_illegal_op,
+/* 0x44 */ x86emuOp2_illegal_op,
+/* 0x45 */ x86emuOp2_illegal_op,
+/* 0x46 */ x86emuOp2_illegal_op,
+/* 0x47 */ x86emuOp2_illegal_op,
+/* 0x48 */ x86emuOp2_illegal_op,
+/* 0x49 */ x86emuOp2_illegal_op,
+/* 0x4a */ x86emuOp2_illegal_op,
+/* 0x4b */ x86emuOp2_illegal_op,
+/* 0x4c */ x86emuOp2_illegal_op,
+/* 0x4d */ x86emuOp2_illegal_op,
+/* 0x4e */ x86emuOp2_illegal_op,
+/* 0x4f */ x86emuOp2_illegal_op,
+
+/* 0x50 */ x86emuOp2_illegal_op,
+/* 0x51 */ x86emuOp2_illegal_op,
+/* 0x52 */ x86emuOp2_illegal_op,
+/* 0x53 */ x86emuOp2_illegal_op,
+/* 0x54 */ x86emuOp2_illegal_op,
+/* 0x55 */ x86emuOp2_illegal_op,
+/* 0x56 */ x86emuOp2_illegal_op,
+/* 0x57 */ x86emuOp2_illegal_op,
+/* 0x58 */ x86emuOp2_illegal_op,
+/* 0x59 */ x86emuOp2_illegal_op,
+/* 0x5a */ x86emuOp2_illegal_op,
+/* 0x5b */ x86emuOp2_illegal_op,
+/* 0x5c */ x86emuOp2_illegal_op,
+/* 0x5d */ x86emuOp2_illegal_op,
+/* 0x5e */ x86emuOp2_illegal_op,
+/* 0x5f */ x86emuOp2_illegal_op,
+
+/* 0x60 */ x86emuOp2_illegal_op,
+/* 0x61 */ x86emuOp2_illegal_op,
+/* 0x62 */ x86emuOp2_illegal_op,
+/* 0x63 */ x86emuOp2_illegal_op,
+/* 0x64 */ x86emuOp2_illegal_op,
+/* 0x65 */ x86emuOp2_illegal_op,
+/* 0x66 */ x86emuOp2_illegal_op,
+/* 0x67 */ x86emuOp2_illegal_op,
+/* 0x68 */ x86emuOp2_illegal_op,
+/* 0x69 */ x86emuOp2_illegal_op,
+/* 0x6a */ x86emuOp2_illegal_op,
+/* 0x6b */ x86emuOp2_illegal_op,
+/* 0x6c */ x86emuOp2_illegal_op,
+/* 0x6d */ x86emuOp2_illegal_op,
+/* 0x6e */ x86emuOp2_illegal_op,
+/* 0x6f */ x86emuOp2_illegal_op,
+
+/* 0x70 */ x86emuOp2_illegal_op,
+/* 0x71 */ x86emuOp2_illegal_op,
+/* 0x72 */ x86emuOp2_illegal_op,
+/* 0x73 */ x86emuOp2_illegal_op,
+/* 0x74 */ x86emuOp2_illegal_op,
+/* 0x75 */ x86emuOp2_illegal_op,
+/* 0x76 */ x86emuOp2_illegal_op,
+/* 0x77 */ x86emuOp2_illegal_op,
+/* 0x78 */ x86emuOp2_illegal_op,
+/* 0x79 */ x86emuOp2_illegal_op,
+/* 0x7a */ x86emuOp2_illegal_op,
+/* 0x7b */ x86emuOp2_illegal_op,
+/* 0x7c */ x86emuOp2_illegal_op,
+/* 0x7d */ x86emuOp2_illegal_op,
+/* 0x7e */ x86emuOp2_illegal_op,
+/* 0x7f */ x86emuOp2_illegal_op,
+
+/* 0x80 */ x86emuOp2_long_jump,
+/* 0x81 */ x86emuOp2_long_jump,
+/* 0x82 */ x86emuOp2_long_jump,
+/* 0x83 */ x86emuOp2_long_jump,
+/* 0x84 */ x86emuOp2_long_jump,
+/* 0x85 */ x86emuOp2_long_jump,
+/* 0x86 */ x86emuOp2_long_jump,
+/* 0x87 */ x86emuOp2_long_jump,
+/* 0x88 */ x86emuOp2_long_jump,
+/* 0x89 */ x86emuOp2_long_jump,
+/* 0x8a */ x86emuOp2_long_jump,
+/* 0x8b */ x86emuOp2_long_jump,
+/* 0x8c */ x86emuOp2_long_jump,
+/* 0x8d */ x86emuOp2_long_jump,
+/* 0x8e */ x86emuOp2_long_jump,
+/* 0x8f */ x86emuOp2_long_jump,
+
+/* 0x90 */ x86emuOp2_set_byte,
+/* 0x91 */ x86emuOp2_set_byte,
+/* 0x92 */ x86emuOp2_set_byte,
+/* 0x93 */ x86emuOp2_set_byte,
+/* 0x94 */ x86emuOp2_set_byte,
+/* 0x95 */ x86emuOp2_set_byte,
+/* 0x96 */ x86emuOp2_set_byte,
+/* 0x97 */ x86emuOp2_set_byte,
+/* 0x98 */ x86emuOp2_set_byte,
+/* 0x99 */ x86emuOp2_set_byte,
+/* 0x9a */ x86emuOp2_set_byte,
+/* 0x9b */ x86emuOp2_set_byte,
+/* 0x9c */ x86emuOp2_set_byte,
+/* 0x9d */ x86emuOp2_set_byte,
+/* 0x9e */ x86emuOp2_set_byte,
+/* 0x9f */ x86emuOp2_set_byte,
+
+/* 0xa0 */ x86emuOp2_push_FS,
+/* 0xa1 */ x86emuOp2_pop_FS,
+/* 0xa2 */ x86emuOp2_illegal_op,
+/* 0xa3 */ x86emuOp2_bt_R,
+/* 0xa4 */ x86emuOp2_shld_IMM,
+/* 0xa5 */ x86emuOp2_shld_CL,
+/* 0xa6 */ x86emuOp2_illegal_op,
+/* 0xa7 */ x86emuOp2_illegal_op,
+/* 0xa8 */ x86emuOp2_push_GS,
+/* 0xa9 */ x86emuOp2_pop_GS,
+/* 0xaa */ x86emuOp2_illegal_op,
+/* 0xab */ x86emuOp2_bt_R,
+/* 0xac */ x86emuOp2_shrd_IMM,
+/* 0xad */ x86emuOp2_shrd_CL,
+/* 0xae */ x86emuOp2_illegal_op,
+/* 0xaf */ x86emuOp2_imul_R_RM,
+
+/* 0xb0 */ x86emuOp2_illegal_op, /* TODO: cmpxchg */
+/* 0xb1 */ x86emuOp2_illegal_op, /* TODO: cmpxchg */
+/* 0xb2 */ x86emuOp2_lss_R_IMM,
+/* 0xb3 */ x86emuOp2_btr_R,
+/* 0xb4 */ x86emuOp2_lfs_R_IMM,
+/* 0xb5 */ x86emuOp2_lgs_R_IMM,
+/* 0xb6 */ x86emuOp2_movzx_byte_R_RM,
+/* 0xb7 */ x86emuOp2_movzx_word_R_RM,
+/* 0xb8 */ x86emuOp2_illegal_op,
+/* 0xb9 */ x86emuOp2_illegal_op,
+/* 0xba */ x86emuOp2_btX_I,
+/* 0xbb */ x86emuOp2_btc_R,
+/* 0xbc */ x86emuOp2_bsf,
+/* 0xbd */ x86emuOp2_bsr,
+/* 0xbe */ x86emuOp2_movsx_byte_R_RM,
+/* 0xbf */ x86emuOp2_movsx_word_R_RM,
+
+/* 0xc0 */ x86emuOp2_illegal_op, /* TODO: xadd */
+/* 0xc1 */ x86emuOp2_illegal_op, /* TODO: xadd */
+/* 0xc2 */ x86emuOp2_illegal_op,
+/* 0xc3 */ x86emuOp2_illegal_op,
+/* 0xc4 */ x86emuOp2_illegal_op,
+/* 0xc5 */ x86emuOp2_illegal_op,
+/* 0xc6 */ x86emuOp2_illegal_op,
+/* 0xc7 */ x86emuOp2_illegal_op,
+/* 0xc8 */ x86emuOp2_illegal_op, /* TODO: bswap */
+/* 0xc9 */ x86emuOp2_illegal_op, /* TODO: bswap */
+/* 0xca */ x86emuOp2_illegal_op, /* TODO: bswap */
+/* 0xcb */ x86emuOp2_illegal_op, /* TODO: bswap */
+/* 0xcc */ x86emuOp2_illegal_op, /* TODO: bswap */
+/* 0xcd */ x86emuOp2_illegal_op, /* TODO: bswap */
+/* 0xce */ x86emuOp2_illegal_op, /* TODO: bswap */
+/* 0xcf */ x86emuOp2_illegal_op, /* TODO: bswap */
+
+/* 0xd0 */ x86emuOp2_illegal_op,
+/* 0xd1 */ x86emuOp2_illegal_op,
+/* 0xd2 */ x86emuOp2_illegal_op,
+/* 0xd3 */ x86emuOp2_illegal_op,
+/* 0xd4 */ x86emuOp2_illegal_op,
+/* 0xd5 */ x86emuOp2_illegal_op,
+/* 0xd6 */ x86emuOp2_illegal_op,
+/* 0xd7 */ x86emuOp2_illegal_op,
+/* 0xd8 */ x86emuOp2_illegal_op,
+/* 0xd9 */ x86emuOp2_illegal_op,
+/* 0xda */ x86emuOp2_illegal_op,
+/* 0xdb */ x86emuOp2_illegal_op,
+/* 0xdc */ x86emuOp2_illegal_op,
+/* 0xdd */ x86emuOp2_illegal_op,
+/* 0xde */ x86emuOp2_illegal_op,
+/* 0xdf */ x86emuOp2_illegal_op,
+
+/* 0xe0 */ x86emuOp2_illegal_op,
+/* 0xe1 */ x86emuOp2_illegal_op,
+/* 0xe2 */ x86emuOp2_illegal_op,
+/* 0xe3 */ x86emuOp2_illegal_op,
+/* 0xe4 */ x86emuOp2_illegal_op,
+/* 0xe5 */ x86emuOp2_illegal_op,
+/* 0xe6 */ x86emuOp2_illegal_op,
+/* 0xe7 */ x86emuOp2_illegal_op,
+/* 0xe8 */ x86emuOp2_illegal_op,
+/* 0xe9 */ x86emuOp2_illegal_op,
+/* 0xea */ x86emuOp2_illegal_op,
+/* 0xeb */ x86emuOp2_illegal_op,
+/* 0xec */ x86emuOp2_illegal_op,
+/* 0xed */ x86emuOp2_illegal_op,
+/* 0xee */ x86emuOp2_illegal_op,
+/* 0xef */ x86emuOp2_illegal_op,
+
+/* 0xf0 */ x86emuOp2_illegal_op,
+/* 0xf1 */ x86emuOp2_illegal_op,
+/* 0xf2 */ x86emuOp2_illegal_op,
+/* 0xf3 */ x86emuOp2_illegal_op,
+/* 0xf4 */ x86emuOp2_illegal_op,
+/* 0xf5 */ x86emuOp2_illegal_op,
+/* 0xf6 */ x86emuOp2_illegal_op,
+/* 0xf7 */ x86emuOp2_illegal_op,
+/* 0xf8 */ x86emuOp2_illegal_op,
+/* 0xf9 */ x86emuOp2_illegal_op,
+/* 0xfa */ x86emuOp2_illegal_op,
+/* 0xfb */ x86emuOp2_illegal_op,
+/* 0xfc */ x86emuOp2_illegal_op,
+/* 0xfd */ x86emuOp2_illegal_op,
+/* 0xfe */ x86emuOp2_illegal_op,
+/* 0xff */ x86emuOp2_illegal_op,
+};
diff --git a/cfe/cfe/x86emu/prim_ops.c b/cfe/cfe/x86emu/prim_ops.c
new file mode 100644
index 0000000..dca16cd
--- /dev/null
+++ b/cfe/cfe/x86emu/prim_ops.c
@@ -0,0 +1,2915 @@
+/****************************************************************************
+*
+* Realmode X86 Emulator Library
+*
+* Copyright (C) 1996-1999 SciTech Software, Inc.
+* Copyright (C) David Mosberger-Tang
+* Copyright (C) 1999 Egbert Eich
+*
+* ========================================================================
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee,
+* provided that the above copyright notice appear in all copies and that
+* both that copyright notice and this permission notice appear in
+* supporting documentation, and that the name of the authors not be used
+* in advertising or publicity pertaining to distribution of the software
+* without specific, written prior permission. The authors makes no
+* representations about the suitability of this software for any purpose.
+* It is provided "as is" without express or implied warranty.
+*
+* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+* PERFORMANCE OF THIS SOFTWARE.
+*
+* ========================================================================
+*
+* Language: ANSI C
+* Environment: Any
+* Developer: Kendall Bennett
+*
+* Description: This file contains the code to implement the primitive
+* machine operations used by the emulation code in ops.c
+*
+* Carry Chain Calculation
+*
+* This represents a somewhat expensive calculation which is
+* apparently required to emulate the setting of the OF and AF flag.
+* The latter is not so important, but the former is. The overflow
+* flag is the XOR of the top two bits of the carry chain for an
+* addition (similar for subtraction). Since we do not want to
+* simulate the addition in a bitwise manner, we try to calculate the
+* carry chain given the two operands and the result.
+*
+* So, given the following table, which represents the addition of two
+* bits, we can derive a formula for the carry chain.
+*
+* a b cin r cout
+* 0 0 0 0 0
+* 0 0 1 1 0
+* 0 1 0 1 0
+* 0 1 1 0 1
+* 1 0 0 1 0
+* 1 0 1 0 1
+* 1 1 0 0 1
+* 1 1 1 1 1
+*
+* Construction of table for cout:
+*
+* ab
+* r \ 00 01 11 10
+* |------------------
+* 0 | 0 1 1 1
+* 1 | 0 0 1 0
+*
+* By inspection, one gets: cc = ab + r'(a + b)
+*
+* That represents alot of operations, but NO CHOICE....
+*
+* Borrow Chain Calculation.
+*
+* The following table represents the subtraction of two bits, from
+* which we can derive a formula for the borrow chain.
+*
+* a b bin r bout
+* 0 0 0 0 0
+* 0 0 1 1 1
+* 0 1 0 1 1
+* 0 1 1 0 1
+* 1 0 0 1 0
+* 1 0 1 0 0
+* 1 1 0 0 0
+* 1 1 1 1 1
+*
+* Construction of table for cout:
+*
+* ab
+* r \ 00 01 11 10
+* |------------------
+* 0 | 0 1 0 0
+* 1 | 1 1 1 0
+*
+* By inspection, one gets: bc = a'b + r(a' + b)
+*
+****************************************************************************/
+
+#define PRIM_OPS_NO_REDEFINE_ASM
+#include "x86emu/x86emui.h"
+
+/*------------------------- Global Variables ------------------------------*/
+
+#ifndef __HAVE_INLINE_ASSEMBLER__
+
+static u32 x86emu_parity_tab[8] =
+{
+ 0x96696996,
+ 0x69969669,
+ 0x69969669,
+ 0x96696996,
+ 0x69969669,
+ 0x96696996,
+ 0x96696996,
+ 0x69969669,
+};
+
+#endif
+
+#define PARITY(x) (((x86emu_parity_tab[(x) / 32] >> ((x) % 32)) & 1) == 0)
+#define XOR2(x) (((x) ^ ((x)>>1)) & 0x1)
+
+/*----------------------------- Implementation ----------------------------*/
+
+#ifndef __HAVE_INLINE_ASSEMBLER__
+
+/****************************************************************************
+REMARKS:
+Implements the AAA instruction and side effects.
+****************************************************************************/
+u16 aaa_word(u16 d)
+{
+ u16 res;
+ if ((d & 0xf) > 0x9 || ACCESS_FLAG(F_AF)) {
+ d += 0x6;
+ d += 0x100;
+ SET_FLAG(F_AF);
+ SET_FLAG(F_CF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_AF);
+ }
+ res = (u16)(d & 0xFF0F);
+ CLEAR_FLAG(F_SF);
+ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the AAA instruction and side effects.
+****************************************************************************/
+u16 aas_word(u16 d)
+{
+ u16 res;
+ if ((d & 0xf) > 0x9 || ACCESS_FLAG(F_AF)) {
+ d -= 0x6;
+ d -= 0x100;
+ SET_FLAG(F_AF);
+ SET_FLAG(F_CF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_AF);
+ }
+ res = (u16)(d & 0xFF0F);
+ CLEAR_FLAG(F_SF);
+ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the AAD instruction and side effects.
+****************************************************************************/
+u16 aad_word(u16 d)
+{
+ u16 l;
+ u8 hb, lb;
+
+ hb = (u8)((d >> 8) & 0xff);
+ lb = (u8)((d & 0xff));
+ l = (u16)((lb + 10 * hb) & 0xFF);
+
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_AF);
+ CLEAR_FLAG(F_OF);
+ CONDITIONAL_SET_FLAG(l & 0x80, F_SF);
+ CONDITIONAL_SET_FLAG(l == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(l & 0xff), F_PF);
+ return l;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the AAM instruction and side effects.
+****************************************************************************/
+u16 aam_word(u8 d)
+{
+ u16 h, l;
+
+ h = (u16)(d / 10);
+ l = (u16)(d % 10);
+ l |= (u16)(h << 8);
+
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_AF);
+ CLEAR_FLAG(F_OF);
+ CONDITIONAL_SET_FLAG(l & 0x80, F_SF);
+ CONDITIONAL_SET_FLAG(l == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(l & 0xff), F_PF);
+ return l;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ADC instruction and side effects.
+****************************************************************************/
+u8 adc_byte(u8 d, u8 s)
+{
+ register u32 res; /* all operands in native machine order */
+ register u32 cc;
+
+ if (ACCESS_FLAG(F_CF))
+ res = 1 + d + s;
+ else
+ res = d + s;
+
+ CONDITIONAL_SET_FLAG(res & 0x100, F_CF);
+ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the carry chain SEE NOTE AT TOP. */
+ cc = (s & d) | ((~res) & (s | d));
+ CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
+ CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+ return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ADC instruction and side effects.
+****************************************************************************/
+u16 adc_word(u16 d, u16 s)
+{
+ register u32 res; /* all operands in native machine order */
+ register u32 cc;
+
+ if (ACCESS_FLAG(F_CF))
+ res = 1 + d + s;
+ else
+ res = d + s;
+
+ CONDITIONAL_SET_FLAG(res & 0x10000, F_CF);
+ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the carry chain SEE NOTE AT TOP. */
+ cc = (s & d) | ((~res) & (s | d));
+ CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF);
+ CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+ return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ADC instruction and side effects.
+****************************************************************************/
+u32 adc_long(u32 d, u32 s)
+{
+ register u32 lo; /* all operands in native machine order */
+ register u32 hi;
+ register u32 res;
+ register u32 cc;
+
+ if (ACCESS_FLAG(F_CF)) {
+ lo = 1 + (d & 0xFFFF) + (s & 0xFFFF);
+ res = 1 + d + s;
+ }
+ else {
+ lo = (d & 0xFFFF) + (s & 0xFFFF);
+ res = d + s;
+ }
+ hi = (lo >> 16) + (d >> 16) + (s >> 16);
+
+ CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF);
+ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the carry chain SEE NOTE AT TOP. */
+ cc = (s & d) | ((~res) & (s | d));
+ CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF);
+ CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ADD instruction and side effects.
+****************************************************************************/
+u8 add_byte(u8 d, u8 s)
+{
+ register u32 res; /* all operands in native machine order */
+ register u32 cc;
+
+ res = d + s;
+ CONDITIONAL_SET_FLAG(res & 0x100, F_CF);
+ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the carry chain SEE NOTE AT TOP. */
+ cc = (s & d) | ((~res) & (s | d));
+ CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
+ CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+ return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ADD instruction and side effects.
+****************************************************************************/
+u16 add_word(u16 d, u16 s)
+{
+ register u32 res; /* all operands in native machine order */
+ register u32 cc;
+
+ res = d + s;
+ CONDITIONAL_SET_FLAG(res & 0x10000, F_CF);
+ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the carry chain SEE NOTE AT TOP. */
+ cc = (s & d) | ((~res) & (s | d));
+ CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF);
+ CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+ return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ADD instruction and side effects.
+****************************************************************************/
+u32 add_long(u32 d, u32 s)
+{
+ register u32 lo; /* all operands in native machine order */
+ register u32 hi;
+ register u32 res;
+ register u32 cc;
+
+ lo = (d & 0xFFFF) + (s & 0xFFFF);
+ res = d + s;
+ hi = (lo >> 16) + (d >> 16) + (s >> 16);
+
+ CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF);
+ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the carry chain SEE NOTE AT TOP. */
+ cc = (s & d) | ((~res) & (s | d));
+ CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF);
+ CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the AND instruction and side effects.
+****************************************************************************/
+u8 and_byte(u8 d, u8 s)
+{
+ register u8 res; /* all operands in native machine order */
+
+ res = d & s;
+
+ /* set the flags */
+ CLEAR_FLAG(F_OF);
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_AF);
+ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the AND instruction and side effects.
+****************************************************************************/
+u16 and_word(u16 d, u16 s)
+{
+ register u16 res; /* all operands in native machine order */
+
+ res = d & s;
+
+ /* set the flags */
+ CLEAR_FLAG(F_OF);
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_AF);
+ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the AND instruction and side effects.
+****************************************************************************/
+u32 and_long(u32 d, u32 s)
+{
+ register u32 res; /* all operands in native machine order */
+
+ res = d & s;
+
+ /* set the flags */
+ CLEAR_FLAG(F_OF);
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_AF);
+ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the CMP instruction and side effects.
+****************************************************************************/
+u8 cmp_byte(u8 d, u8 s)
+{
+ register u32 res; /* all operands in native machine order */
+ register u32 bc;
+
+ res = d - s;
+ CLEAR_FLAG(F_CF);
+ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the borrow chain. See note at top */
+ bc = (res & (~d | s)) | (~d & s);
+ CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
+ CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
+ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+ return d;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the CMP instruction and side effects.
+****************************************************************************/
+u16 cmp_word(u16 d, u16 s)
+{
+ register u32 res; /* all operands in native machine order */
+ register u32 bc;
+
+ res = d - s;
+ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the borrow chain. See note at top */
+ bc = (res & (~d | s)) | (~d & s);
+ CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
+ CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
+ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+ return d;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the CMP instruction and side effects.
+****************************************************************************/
+u32 cmp_long(u32 d, u32 s)
+{
+ register u32 res; /* all operands in native machine order */
+ register u32 bc;
+
+ res = d - s;
+ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the borrow chain. See note at top */
+ bc = (res & (~d | s)) | (~d & s);
+ CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
+ CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
+ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+ return d;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the DAA instruction and side effects.
+****************************************************************************/
+u8 daa_byte(u8 d)
+{
+ u32 res = d;
+ if ((d & 0xf) > 9 || ACCESS_FLAG(F_AF)) {
+ res += 6;
+ SET_FLAG(F_AF);
+ }
+ if (res > 0x9F || ACCESS_FLAG(F_CF)) {
+ res += 0x60;
+ SET_FLAG(F_CF);
+ }
+ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+ CONDITIONAL_SET_FLAG((res & 0xFF) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the DAS instruction and side effects.
+****************************************************************************/
+u8 das_byte(u8 d)
+{
+ if ((d & 0xf) > 9 || ACCESS_FLAG(F_AF)) {
+ d -= 6;
+ SET_FLAG(F_AF);
+ }
+ if (d > 0x9F || ACCESS_FLAG(F_CF)) {
+ d -= 0x60;
+ SET_FLAG(F_CF);
+ }
+ CONDITIONAL_SET_FLAG(d & 0x80, F_SF);
+ CONDITIONAL_SET_FLAG(d == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(d & 0xff), F_PF);
+ return d;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the DEC instruction and side effects.
+****************************************************************************/
+u8 dec_byte(u8 d)
+{
+ register u32 res; /* all operands in native machine order */
+ register u32 bc;
+
+ res = d - 1;
+ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the borrow chain. See note at top */
+ /* based on sub_byte, uses s==1. */
+ bc = (res & (~d | 1)) | (~d & 1);
+ /* carry flag unchanged */
+ CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
+ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+ return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the DEC instruction and side effects.
+****************************************************************************/
+u16 dec_word(u16 d)
+{
+ register u32 res; /* all operands in native machine order */
+ register u32 bc;
+
+ res = d - 1;
+ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the borrow chain. See note at top */
+ /* based on the sub_byte routine, with s==1 */
+ bc = (res & (~d | 1)) | (~d & 1);
+ /* carry flag unchanged */
+ CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
+ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+ return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the DEC instruction and side effects.
+****************************************************************************/
+u32 dec_long(u32 d)
+{
+ register u32 res; /* all operands in native machine order */
+ register u32 bc;
+
+ res = d - 1;
+
+ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the borrow chain. See note at top */
+ bc = (res & (~d | 1)) | (~d & 1);
+ /* carry flag unchanged */
+ CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
+ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the INC instruction and side effects.
+****************************************************************************/
+u8 inc_byte(u8 d)
+{
+ register u32 res; /* all operands in native machine order */
+ register u32 cc;
+
+ res = d + 1;
+ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the carry chain SEE NOTE AT TOP. */
+ cc = ((1 & d) | (~res)) & (1 | d);
+ CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
+ CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+ return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the INC instruction and side effects.
+****************************************************************************/
+u16 inc_word(u16 d)
+{
+ register u32 res; /* all operands in native machine order */
+ register u32 cc;
+
+ res = d + 1;
+ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the carry chain SEE NOTE AT TOP. */
+ cc = (1 & d) | ((~res) & (1 | d));
+ CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF);
+ CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+ return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the INC instruction and side effects.
+****************************************************************************/
+u32 inc_long(u32 d)
+{
+ register u32 res; /* all operands in native machine order */
+ register u32 cc;
+
+ res = d + 1;
+ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the carry chain SEE NOTE AT TOP. */
+ cc = (1 & d) | ((~res) & (1 | d));
+ CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF);
+ CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the OR instruction and side effects.
+****************************************************************************/
+u8 or_byte(u8 d, u8 s)
+{
+ register u8 res; /* all operands in native machine order */
+
+ res = d | s;
+ CLEAR_FLAG(F_OF);
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_AF);
+ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the OR instruction and side effects.
+****************************************************************************/
+u16 or_word(u16 d, u16 s)
+{
+ register u16 res; /* all operands in native machine order */
+
+ res = d | s;
+ /* set the carry flag to be bit 8 */
+ CLEAR_FLAG(F_OF);
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_AF);
+ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the OR instruction and side effects.
+****************************************************************************/
+u32 or_long(u32 d, u32 s)
+{
+ register u32 res; /* all operands in native machine order */
+
+ res = d | s;
+
+ /* set the carry flag to be bit 8 */
+ CLEAR_FLAG(F_OF);
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_AF);
+ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the OR instruction and side effects.
+****************************************************************************/
+u8 neg_byte(u8 s)
+{
+ register u8 res;
+ register u8 bc;
+
+ CONDITIONAL_SET_FLAG(s != 0, F_CF);
+ res = (u8)-s;
+ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
+ /* calculate the borrow chain --- modified such that d=0.
+ substitutiing d=0 into bc= res&(~d|s)|(~d&s);
+ (the one used for sub) and simplifying, since ~d=0xff...,
+ ~d|s == 0xffff..., and res&0xfff... == res. Similarly
+ ~d&s == s. So the simplified result is: */
+ bc = res | s;
+ CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
+ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the OR instruction and side effects.
+****************************************************************************/
+u16 neg_word(u16 s)
+{
+ register u16 res;
+ register u16 bc;
+
+ CONDITIONAL_SET_FLAG(s != 0, F_CF);
+ res = (u16)-s;
+ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the borrow chain --- modified such that d=0.
+ substitutiing d=0 into bc= res&(~d|s)|(~d&s);
+ (the one used for sub) and simplifying, since ~d=0xff...,
+ ~d|s == 0xffff..., and res&0xfff... == res. Similarly
+ ~d&s == s. So the simplified result is: */
+ bc = res | s;
+ CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
+ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the OR instruction and side effects.
+****************************************************************************/
+u32 neg_long(u32 s)
+{
+ register u32 res;
+ register u32 bc;
+
+ CONDITIONAL_SET_FLAG(s != 0, F_CF);
+ res = (u32)-s;
+ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the borrow chain --- modified such that d=0.
+ substitutiing d=0 into bc= res&(~d|s)|(~d&s);
+ (the one used for sub) and simplifying, since ~d=0xff...,
+ ~d|s == 0xffff..., and res&0xfff... == res. Similarly
+ ~d&s == s. So the simplified result is: */
+ bc = res | s;
+ CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
+ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the NOT instruction and side effects.
+****************************************************************************/
+u8 not_byte(u8 s)
+{
+ return ~s;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the NOT instruction and side effects.
+****************************************************************************/
+u16 not_word(u16 s)
+{
+ return ~s;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the NOT instruction and side effects.
+****************************************************************************/
+u32 not_long(u32 s)
+{
+ return ~s;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the RCL instruction and side effects.
+****************************************************************************/
+u8 rcl_byte(u8 d, u8 s)
+{
+ register unsigned int res, cnt, mask, cf;
+
+ /* s is the rotate distance. It varies from 0 - 8. */
+ /* have
+
+ CF B_7 B_6 B_5 B_4 B_3 B_2 B_1 B_0
+
+ want to rotate through the carry by "s" bits. We could
+ loop, but that's inefficient. So the width is 9,
+ and we split into three parts:
+
+ The new carry flag (was B_n)
+ the stuff in B_n-1 .. B_0
+ the stuff in B_7 .. B_n+1
+
+ The new rotate is done mod 9, and given this,
+ for a rotation of n bits (mod 9) the new carry flag is
+ then located n bits from the MSB. The low part is
+ then shifted up cnt bits, and the high part is or'd
+ in. Using CAPS for new values, and lowercase for the
+ original values, this can be expressed as:
+
+ IF n > 0
+ 1) CF <- b_(8-n)
+ 2) B_(7) .. B_(n) <- b_(8-(n+1)) .. b_0
+ 3) B_(n-1) <- cf
+ 4) B_(n-2) .. B_0 <- b_7 .. b_(8-(n-1))
+ */
+ res = d;
+ if ((cnt = s % 9) != 0) {
+ /* extract the new CARRY FLAG. */
+ /* CF <- b_(8-n) */
+ cf = (d >> (8 - cnt)) & 0x1;
+
+ /* get the low stuff which rotated
+ into the range B_7 .. B_cnt */
+ /* B_(7) .. B_(n) <- b_(8-(n+1)) .. b_0 */
+ /* note that the right hand side done by the mask */
+ res = (d << cnt) & 0xff;
+
+ /* now the high stuff which rotated around
+ into the positions B_cnt-2 .. B_0 */
+ /* B_(n-2) .. B_0 <- b_7 .. b_(8-(n-1)) */
+ /* shift it downward, 7-(n-2) = 9-n positions.
+ and mask off the result before or'ing in.
+ */
+ mask = (1 << (cnt - 1)) - 1;
+ res |= (d >> (9 - cnt)) & mask;
+
+ /* if the carry flag was set, or it in. */
+ if (ACCESS_FLAG(F_CF)) { /* carry flag is set */
+ /* B_(n-1) <- cf */
+ res |= 1 << (cnt - 1);
+ }
+ /* set the new carry flag, based on the variable "cf" */
+ CONDITIONAL_SET_FLAG(cf, F_CF);
+ /* OVERFLOW is set *IFF* cnt==1, then it is the
+ xor of CF and the most significant bit. Blecck. */
+ /* parenthesized this expression since it appears to
+ be causing OF to be misset */
+ CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 6) & 0x2)),
+ F_OF);
+
+ }
+ return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the RCL instruction and side effects.
+****************************************************************************/
+u16 rcl_word(u16 d, u8 s)
+{
+ register unsigned int res, cnt, mask, cf;
+
+ res = d;
+ if ((cnt = s % 17) != 0) {
+ cf = (d >> (16 - cnt)) & 0x1;
+ res = (d << cnt) & 0xffff;
+ mask = (1 << (cnt - 1)) - 1;
+ res |= (d >> (17 - cnt)) & mask;
+ if (ACCESS_FLAG(F_CF)) {
+ res |= 1 << (cnt - 1);
+ }
+ CONDITIONAL_SET_FLAG(cf, F_CF);
+ CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 14) & 0x2)),
+ F_OF);
+ }
+ return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the RCL instruction and side effects.
+****************************************************************************/
+u32 rcl_long(u32 d, u8 s)
+{
+ register u32 res, cnt, mask, cf;
+
+ res = d;
+ if ((cnt = s % 33) != 0) {
+ cf = (d >> (32 - cnt)) & 0x1;
+ res = (d << cnt) & 0xffffffff;
+ mask = (1 << (cnt - 1)) - 1;
+ res |= (d >> (33 - cnt)) & mask;
+ if (ACCESS_FLAG(F_CF)) { /* carry flag is set */
+ res |= 1 << (cnt - 1);
+ }
+ CONDITIONAL_SET_FLAG(cf, F_CF);
+ CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 30) & 0x2)),
+ F_OF);
+ }
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the RCR instruction and side effects.
+****************************************************************************/
+u8 rcr_byte(u8 d, u8 s)
+{
+ u32 res, cnt;
+ u32 mask, cf, ocf = 0;
+
+ /* rotate right through carry */
+ /*
+ s is the rotate distance. It varies from 0 - 8.
+ d is the byte object rotated.
+
+ have
+
+ CF B_7 B_6 B_5 B_4 B_3 B_2 B_1 B_0
+
+ The new rotate is done mod 9, and given this,
+ for a rotation of n bits (mod 9) the new carry flag is
+ then located n bits from the LSB. The low part is
+ then shifted up cnt bits, and the high part is or'd
+ in. Using CAPS for new values, and lowercase for the
+ original values, this can be expressed as:
+
+ IF n > 0
+ 1) CF <- b_(n-1)
+ 2) B_(8-(n+1)) .. B_(0) <- b_(7) .. b_(n)
+ 3) B_(8-n) <- cf
+ 4) B_(7) .. B_(8-(n-1)) <- b_(n-2) .. b_(0)
+ */
+ res = d;
+ if ((cnt = s % 9) != 0) {
+ /* extract the new CARRY FLAG. */
+ /* CF <- b_(n-1) */
+ if (cnt == 1) {
+ cf = d & 0x1;
+ /* note hackery here. Access_flag(..) evaluates to either
+ 0 if flag not set
+ non-zero if flag is set.
+ doing access_flag(..) != 0 casts that into either
+ 0..1 in any representation of the flags register
+ (i.e. packed bit array or unpacked.)
+ */
+ ocf = ACCESS_FLAG(F_CF) != 0;
+ } else
+ cf = (d >> (cnt - 1)) & 0x1;
+
+ /* B_(8-(n+1)) .. B_(0) <- b_(7) .. b_n */
+ /* note that the right hand side done by the mask
+ This is effectively done by shifting the
+ object to the right. The result must be masked,
+ in case the object came in and was treated
+ as a negative number. Needed??? */
+
+ mask = (1 << (8 - cnt)) - 1;
+ res = (d >> cnt) & mask;
+
+ /* now the high stuff which rotated around
+ into the positions B_cnt-2 .. B_0 */
+ /* B_(7) .. B_(8-(n-1)) <- b_(n-2) .. b_(0) */
+ /* shift it downward, 7-(n-2) = 9-n positions.
+ and mask off the result before or'ing in.
+ */
+ res |= (d << (9 - cnt));
+
+ /* if the carry flag was set, or it in. */
+ if (ACCESS_FLAG(F_CF)) { /* carry flag is set */
+ /* B_(8-n) <- cf */
+ res |= 1 << (8 - cnt);
+ }
+ /* set the new carry flag, based on the variable "cf" */
+ CONDITIONAL_SET_FLAG(cf, F_CF);
+ /* OVERFLOW is set *IFF* cnt==1, then it is the
+ xor of CF and the most significant bit. Blecck. */
+ /* parenthesized... */
+ if (cnt == 1) {
+ CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 6) & 0x2)),
+ F_OF);
+ }
+ }
+ return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the RCR instruction and side effects.
+****************************************************************************/
+u16 rcr_word(u16 d, u8 s)
+{
+ u32 res, cnt;
+ u32 mask, cf, ocf = 0;
+
+ /* rotate right through carry */
+ res = d;
+ if ((cnt = s % 17) != 0) {
+ if (cnt == 1) {
+ cf = d & 0x1;
+ ocf = ACCESS_FLAG(F_CF) != 0;
+ } else
+ cf = (d >> (cnt - 1)) & 0x1;
+ mask = (1 << (16 - cnt)) - 1;
+ res = (d >> cnt) & mask;
+ res |= (d << (17 - cnt));
+ if (ACCESS_FLAG(F_CF)) {
+ res |= 1 << (16 - cnt);
+ }
+ CONDITIONAL_SET_FLAG(cf, F_CF);
+ if (cnt == 1) {
+ CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 14) & 0x2)),
+ F_OF);
+ }
+ }
+ return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the RCR instruction and side effects.
+****************************************************************************/
+u32 rcr_long(u32 d, u8 s)
+{
+ u32 res, cnt;
+ u32 mask, cf, ocf = 0;
+
+ /* rotate right through carry */
+ res = d;
+ if ((cnt = s % 33) != 0) {
+ if (cnt == 1) {
+ cf = d & 0x1;
+ ocf = ACCESS_FLAG(F_CF) != 0;
+ } else
+ cf = (d >> (cnt - 1)) & 0x1;
+ mask = (1 << (32 - cnt)) - 1;
+ res = (d >> cnt) & mask;
+ if (cnt != 1)
+ res |= (d << (33 - cnt));
+ if (ACCESS_FLAG(F_CF)) { /* carry flag is set */
+ res |= 1 << (32 - cnt);
+ }
+ CONDITIONAL_SET_FLAG(cf, F_CF);
+ if (cnt == 1) {
+ CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 30) & 0x2)),
+ F_OF);
+ }
+ }
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ROL instruction and side effects.
+****************************************************************************/
+u8 rol_byte(u8 d, u8 s)
+{
+ register unsigned int res, cnt, mask;
+
+ /* rotate left */
+ /*
+ s is the rotate distance. It varies from 0 - 8.
+ d is the byte object rotated.
+
+ have
+
+ CF B_7 ... B_0
+
+ The new rotate is done mod 8.
+ Much simpler than the "rcl" or "rcr" operations.
+
+ IF n > 0
+ 1) B_(7) .. B_(n) <- b_(8-(n+1)) .. b_(0)
+ 2) B_(n-1) .. B_(0) <- b_(7) .. b_(8-n)
+ */
+ res = d;
+ if ((cnt = s % 8) != 0) {
+ /* B_(7) .. B_(n) <- b_(8-(n+1)) .. b_(0) */
+ res = (d << cnt);
+
+ /* B_(n-1) .. B_(0) <- b_(7) .. b_(8-n) */
+ mask = (1 << cnt) - 1;
+ res |= (d >> (8 - cnt)) & mask;
+
+ /* set the new carry flag, Note that it is the low order
+ bit of the result!!! */
+ CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+ /* OVERFLOW is set *IFF* s==1, then it is the
+ xor of CF and the most significant bit. Blecck. */
+ CONDITIONAL_SET_FLAG(s == 1 &&
+ XOR2((res & 0x1) + ((res >> 6) & 0x2)),
+ F_OF);
+ } if (s != 0) {
+ /* set the new carry flag, Note that it is the low order
+ bit of the result!!! */
+ CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+ }
+ return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ROL instruction and side effects.
+****************************************************************************/
+u16 rol_word(u16 d, u8 s)
+{
+ register unsigned int res, cnt, mask;
+
+ res = d;
+ if ((cnt = s % 16) != 0) {
+ res = (d << cnt);
+ mask = (1 << cnt) - 1;
+ res |= (d >> (16 - cnt)) & mask;
+ CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+ CONDITIONAL_SET_FLAG(s == 1 &&
+ XOR2((res & 0x1) + ((res >> 14) & 0x2)),
+ F_OF);
+ } if (s != 0) {
+ /* set the new carry flag, Note that it is the low order
+ bit of the result!!! */
+ CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+ }
+ return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ROL instruction and side effects.
+****************************************************************************/
+u32 rol_long(u32 d, u8 s)
+{
+ register u32 res, cnt, mask;
+
+ res = d;
+ if ((cnt = s % 32) != 0) {
+ res = (d << cnt);
+ mask = (1 << cnt) - 1;
+ res |= (d >> (32 - cnt)) & mask;
+ CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+ CONDITIONAL_SET_FLAG(s == 1 &&
+ XOR2((res & 0x1) + ((res >> 30) & 0x2)),
+ F_OF);
+ } if (s != 0) {
+ /* set the new carry flag, Note that it is the low order
+ bit of the result!!! */
+ CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+ }
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ROR instruction and side effects.
+****************************************************************************/
+u8 ror_byte(u8 d, u8 s)
+{
+ register unsigned int res, cnt, mask;
+
+ /* rotate right */
+ /*
+ s is the rotate distance. It varies from 0 - 8.
+ d is the byte object rotated.
+
+ have
+
+ B_7 ... B_0
+
+ The rotate is done mod 8.
+
+ IF n > 0
+ 1) B_(8-(n+1)) .. B_(0) <- b_(7) .. b_(n)
+ 2) B_(7) .. B_(8-n) <- b_(n-1) .. b_(0)
+ */
+ res = d;
+ if ((cnt = s % 8) != 0) { /* not a typo, do nada if cnt==0 */
+ /* B_(7) .. B_(8-n) <- b_(n-1) .. b_(0) */
+ res = (d << (8 - cnt));
+
+ /* B_(8-(n+1)) .. B_(0) <- b_(7) .. b_(n) */
+ mask = (1 << (8 - cnt)) - 1;
+ res |= (d >> (cnt)) & mask;
+
+ /* set the new carry flag, Note that it is the low order
+ bit of the result!!! */
+ CONDITIONAL_SET_FLAG(res & 0x80, F_CF);
+ /* OVERFLOW is set *IFF* s==1, then it is the
+ xor of the two most significant bits. Blecck. */
+ CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 6), F_OF);
+ } else if (s != 0) {
+ /* set the new carry flag, Note that it is the low order
+ bit of the result!!! */
+ CONDITIONAL_SET_FLAG(res & 0x80, F_CF);
+ }
+ return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ROR instruction and side effects.
+****************************************************************************/
+u16 ror_word(u16 d, u8 s)
+{
+ register unsigned int res, cnt, mask;
+
+ res = d;
+ if ((cnt = s % 16) != 0) {
+ res = (d << (16 - cnt));
+ mask = (1 << (16 - cnt)) - 1;
+ res |= (d >> (cnt)) & mask;
+ CONDITIONAL_SET_FLAG(res & 0x8000, F_CF);
+ CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 14), F_OF);
+ } else if (s != 0) {
+ /* set the new carry flag, Note that it is the low order
+ bit of the result!!! */
+ CONDITIONAL_SET_FLAG(res & 0x8000, F_CF);
+ }
+ return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the ROR instruction and side effects.
+****************************************************************************/
+u32 ror_long(u32 d, u8 s)
+{
+ register u32 res, cnt, mask;
+
+ res = d;
+ if ((cnt = s % 32) != 0) {
+ res = (d << (32 - cnt));
+ mask = (1 << (32 - cnt)) - 1;
+ res |= (d >> (cnt)) & mask;
+ CONDITIONAL_SET_FLAG(res & 0x80000000, F_CF);
+ CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 30), F_OF);
+ } else if (s != 0) {
+ /* set the new carry flag, Note that it is the low order
+ bit of the result!!! */
+ CONDITIONAL_SET_FLAG(res & 0x80000000, F_CF);
+ }
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SHL instruction and side effects.
+****************************************************************************/
+u8 shl_byte(u8 d, u8 s)
+{
+ unsigned int cnt, res, cf;
+
+ if (s < 8) {
+ cnt = s % 8;
+
+ /* last bit shifted out goes into carry flag */
+ if (cnt > 0) {
+ res = d << cnt;
+ cf = d & (1 << (8 - cnt));
+ CONDITIONAL_SET_FLAG(cf, F_CF);
+ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ } else {
+ res = (u8) d;
+ }
+
+ if (cnt == 1) {
+ /* Needs simplification. */
+ CONDITIONAL_SET_FLAG(
+ (((res & 0x80) == 0x80) ^
+ (ACCESS_FLAG(F_CF) != 0)),
+ /* was (M.x86.R_FLG&F_CF)==F_CF)), */
+ F_OF);
+ } else {
+ CLEAR_FLAG(F_OF);
+ }
+ } else {
+ res = 0;
+ CONDITIONAL_SET_FLAG((d << (s-1)) & 0x80, F_CF);
+ CLEAR_FLAG(F_OF);
+ CLEAR_FLAG(F_SF);
+ SET_FLAG(F_PF);
+ SET_FLAG(F_ZF);
+ }
+ return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SHL instruction and side effects.
+****************************************************************************/
+u16 shl_word(u16 d, u8 s)
+{
+ unsigned int cnt, res, cf;
+
+ if (s < 16) {
+ cnt = s % 16;
+ if (cnt > 0) {
+ res = d << cnt;
+ cf = d & (1 << (16 - cnt));
+ CONDITIONAL_SET_FLAG(cf, F_CF);
+ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ } else {
+ res = (u16) d;
+ }
+
+ if (cnt == 1) {
+ CONDITIONAL_SET_FLAG(
+ (((res & 0x8000) == 0x8000) ^
+ (ACCESS_FLAG(F_CF) != 0)),
+ F_OF);
+ } else {
+ CLEAR_FLAG(F_OF);
+ }
+ } else {
+ res = 0;
+ CONDITIONAL_SET_FLAG((d << (s-1)) & 0x8000, F_CF);
+ CLEAR_FLAG(F_OF);
+ CLEAR_FLAG(F_SF);
+ SET_FLAG(F_PF);
+ SET_FLAG(F_ZF);
+ }
+ return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SHL instruction and side effects.
+****************************************************************************/
+u32 shl_long(u32 d, u8 s)
+{
+ unsigned int cnt, res, cf;
+
+ if (s < 32) {
+ cnt = s % 32;
+ if (cnt > 0) {
+ res = d << cnt;
+ cf = d & (1 << (32 - cnt));
+ CONDITIONAL_SET_FLAG(cf, F_CF);
+ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ } else {
+ res = d;
+ }
+ if (cnt == 1) {
+ CONDITIONAL_SET_FLAG((((res & 0x80000000) == 0x80000000) ^
+ (ACCESS_FLAG(F_CF) != 0)), F_OF);
+ } else {
+ CLEAR_FLAG(F_OF);
+ }
+ } else {
+ res = 0;
+ CONDITIONAL_SET_FLAG((d << (s-1)) & 0x80000000, F_CF);
+ CLEAR_FLAG(F_OF);
+ CLEAR_FLAG(F_SF);
+ SET_FLAG(F_PF);
+ SET_FLAG(F_ZF);
+ }
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SHR instruction and side effects.
+****************************************************************************/
+u8 shr_byte(u8 d, u8 s)
+{
+ unsigned int cnt, res, cf;
+
+ if (s < 8) {
+ cnt = s % 8;
+ if (cnt > 0) {
+ cf = d & (1 << (cnt - 1));
+ res = d >> cnt;
+ CONDITIONAL_SET_FLAG(cf, F_CF);
+ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ } else {
+ res = (u8) d;
+ }
+
+ if (cnt == 1) {
+ CONDITIONAL_SET_FLAG(XOR2(res >> 6), F_OF);
+ } else {
+ CLEAR_FLAG(F_OF);
+ }
+ } else {
+ res = 0;
+ CONDITIONAL_SET_FLAG((d >> (s-1)) & 0x1, F_CF);
+ CLEAR_FLAG(F_OF);
+ CLEAR_FLAG(F_SF);
+ SET_FLAG(F_PF);
+ SET_FLAG(F_ZF);
+ }
+ return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SHR instruction and side effects.
+****************************************************************************/
+u16 shr_word(u16 d, u8 s)
+{
+ unsigned int cnt, res, cf;
+
+ if (s < 16) {
+ cnt = s % 16;
+ if (cnt > 0) {
+ cf = d & (1 << (cnt - 1));
+ res = d >> cnt;
+ CONDITIONAL_SET_FLAG(cf, F_CF);
+ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ } else {
+ res = d;
+ }
+
+ if (cnt == 1) {
+ CONDITIONAL_SET_FLAG(XOR2(res >> 14), F_OF);
+ } else {
+ CLEAR_FLAG(F_OF);
+ }
+ } else {
+ res = 0;
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ SET_FLAG(F_ZF);
+ CLEAR_FLAG(F_SF);
+ CLEAR_FLAG(F_PF);
+ }
+ return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SHR instruction and side effects.
+****************************************************************************/
+u32 shr_long(u32 d, u8 s)
+{
+ unsigned int cnt, res, cf;
+
+ if (s < 32) {
+ cnt = s % 32;
+ if (cnt > 0) {
+ cf = d & (1 << (cnt - 1));
+ res = d >> cnt;
+ CONDITIONAL_SET_FLAG(cf, F_CF);
+ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ } else {
+ res = d;
+ }
+ if (cnt == 1) {
+ CONDITIONAL_SET_FLAG(XOR2(res >> 30), F_OF);
+ } else {
+ CLEAR_FLAG(F_OF);
+ }
+ } else {
+ res = 0;
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ SET_FLAG(F_ZF);
+ CLEAR_FLAG(F_SF);
+ CLEAR_FLAG(F_PF);
+ }
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SAR instruction and side effects.
+****************************************************************************/
+u8 sar_byte(u8 d, u8 s)
+{
+ unsigned int cnt, res, cf, mask, sf;
+
+ res = d;
+ sf = d & 0x80;
+ cnt = s % 8;
+ if (cnt > 0 && cnt < 8) {
+ mask = (1 << (8 - cnt)) - 1;
+ cf = d & (1 << (cnt - 1));
+ res = (d >> cnt) & mask;
+ CONDITIONAL_SET_FLAG(cf, F_CF);
+ if (sf) {
+ res |= ~mask;
+ }
+ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+ } else if (cnt >= 8) {
+ if (sf) {
+ res = 0xff;
+ SET_FLAG(F_CF);
+ CLEAR_FLAG(F_ZF);
+ SET_FLAG(F_SF);
+ SET_FLAG(F_PF);
+ } else {
+ res = 0;
+ CLEAR_FLAG(F_CF);
+ SET_FLAG(F_ZF);
+ CLEAR_FLAG(F_SF);
+ CLEAR_FLAG(F_PF);
+ }
+ }
+ return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SAR instruction and side effects.
+****************************************************************************/
+u16 sar_word(u16 d, u8 s)
+{
+ unsigned int cnt, res, cf, mask, sf;
+
+ sf = d & 0x8000;
+ cnt = s % 16;
+ res = d;
+ if (cnt > 0 && cnt < 16) {
+ mask = (1 << (16 - cnt)) - 1;
+ cf = d & (1 << (cnt - 1));
+ res = (d >> cnt) & mask;
+ CONDITIONAL_SET_FLAG(cf, F_CF);
+ if (sf) {
+ res |= ~mask;
+ }
+ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ } else if (cnt >= 16) {
+ if (sf) {
+ res = 0xffff;
+ SET_FLAG(F_CF);
+ CLEAR_FLAG(F_ZF);
+ SET_FLAG(F_SF);
+ SET_FLAG(F_PF);
+ } else {
+ res = 0;
+ CLEAR_FLAG(F_CF);
+ SET_FLAG(F_ZF);
+ CLEAR_FLAG(F_SF);
+ CLEAR_FLAG(F_PF);
+ }
+ }
+ return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SAR instruction and side effects.
+****************************************************************************/
+u32 sar_long(u32 d, u8 s)
+{
+ u32 cnt, res, cf, mask, sf;
+
+ sf = d & 0x80000000;
+ cnt = s % 32;
+ res = d;
+ if (cnt > 0 && cnt < 32) {
+ mask = (1 << (32 - cnt)) - 1;
+ cf = d & (1 << (cnt - 1));
+ res = (d >> cnt) & mask;
+ CONDITIONAL_SET_FLAG(cf, F_CF);
+ if (sf) {
+ res |= ~mask;
+ }
+ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ } else if (cnt >= 32) {
+ if (sf) {
+ res = 0xffffffff;
+ SET_FLAG(F_CF);
+ CLEAR_FLAG(F_ZF);
+ SET_FLAG(F_SF);
+ SET_FLAG(F_PF);
+ } else {
+ res = 0;
+ CLEAR_FLAG(F_CF);
+ SET_FLAG(F_ZF);
+ CLEAR_FLAG(F_SF);
+ CLEAR_FLAG(F_PF);
+ }
+ }
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SHLD instruction and side effects.
+****************************************************************************/
+u16 shld_word (u16 d, u16 fill, u8 s)
+{
+ unsigned int cnt, res, cf;
+
+ if (s < 16) {
+ cnt = s % 16;
+ if (cnt > 0) {
+ res = (d << cnt) | (fill >> (16-cnt));
+ cf = d & (1 << (16 - cnt));
+ CONDITIONAL_SET_FLAG(cf, F_CF);
+ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ } else {
+ res = d;
+ }
+ if (cnt == 1) {
+ CONDITIONAL_SET_FLAG((((res & 0x8000) == 0x8000) ^
+ (ACCESS_FLAG(F_CF) != 0)), F_OF);
+ } else {
+ CLEAR_FLAG(F_OF);
+ }
+ } else {
+ res = 0;
+ CONDITIONAL_SET_FLAG((d << (s-1)) & 0x8000, F_CF);
+ CLEAR_FLAG(F_OF);
+ CLEAR_FLAG(F_SF);
+ SET_FLAG(F_PF);
+ SET_FLAG(F_ZF);
+ }
+ return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SHLD instruction and side effects.
+****************************************************************************/
+u32 shld_long (u32 d, u32 fill, u8 s)
+{
+ unsigned int cnt, res, cf;
+
+ if (s < 32) {
+ cnt = s % 32;
+ if (cnt > 0) {
+ res = (d << cnt) | (fill >> (32-cnt));
+ cf = d & (1 << (32 - cnt));
+ CONDITIONAL_SET_FLAG(cf, F_CF);
+ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ } else {
+ res = d;
+ }
+ if (cnt == 1) {
+ CONDITIONAL_SET_FLAG((((res & 0x80000000) == 0x80000000) ^
+ (ACCESS_FLAG(F_CF) != 0)), F_OF);
+ } else {
+ CLEAR_FLAG(F_OF);
+ }
+ } else {
+ res = 0;
+ CONDITIONAL_SET_FLAG((d << (s-1)) & 0x80000000, F_CF);
+ CLEAR_FLAG(F_OF);
+ CLEAR_FLAG(F_SF);
+ SET_FLAG(F_PF);
+ SET_FLAG(F_ZF);
+ }
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SHRD instruction and side effects.
+****************************************************************************/
+u16 shrd_word (u16 d, u16 fill, u8 s)
+{
+ unsigned int cnt, res, cf;
+
+ if (s < 16) {
+ cnt = s % 16;
+ if (cnt > 0) {
+ cf = d & (1 << (cnt - 1));
+ res = (d >> cnt) | (fill << (16 - cnt));
+ CONDITIONAL_SET_FLAG(cf, F_CF);
+ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ } else {
+ res = d;
+ }
+
+ if (cnt == 1) {
+ CONDITIONAL_SET_FLAG(XOR2(res >> 14), F_OF);
+ } else {
+ CLEAR_FLAG(F_OF);
+ }
+ } else {
+ res = 0;
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ SET_FLAG(F_ZF);
+ CLEAR_FLAG(F_SF);
+ CLEAR_FLAG(F_PF);
+ }
+ return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SHRD instruction and side effects.
+****************************************************************************/
+u32 shrd_long (u32 d, u32 fill, u8 s)
+{
+ unsigned int cnt, res, cf;
+
+ if (s < 32) {
+ cnt = s % 32;
+ if (cnt > 0) {
+ cf = d & (1 << (cnt - 1));
+ res = (d >> cnt) | (fill << (32 - cnt));
+ CONDITIONAL_SET_FLAG(cf, F_CF);
+ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ } else {
+ res = d;
+ }
+ if (cnt == 1) {
+ CONDITIONAL_SET_FLAG(XOR2(res >> 30), F_OF);
+ } else {
+ CLEAR_FLAG(F_OF);
+ }
+ } else {
+ res = 0;
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ SET_FLAG(F_ZF);
+ CLEAR_FLAG(F_SF);
+ CLEAR_FLAG(F_PF);
+ }
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SBB instruction and side effects.
+****************************************************************************/
+u8 sbb_byte(u8 d, u8 s)
+{
+ register u32 res; /* all operands in native machine order */
+ register u32 bc;
+
+ if (ACCESS_FLAG(F_CF))
+ res = d - s - 1;
+ else
+ res = d - s;
+ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the borrow chain. See note at top */
+ bc = (res & (~d | s)) | (~d & s);
+ CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
+ CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
+ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+ return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SBB instruction and side effects.
+****************************************************************************/
+u16 sbb_word(u16 d, u16 s)
+{
+ register u32 res; /* all operands in native machine order */
+ register u32 bc;
+
+ if (ACCESS_FLAG(F_CF))
+ res = d - s - 1;
+ else
+ res = d - s;
+ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the borrow chain. See note at top */
+ bc = (res & (~d | s)) | (~d & s);
+ CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
+ CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
+ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+ return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SBB instruction and side effects.
+****************************************************************************/
+u32 sbb_long(u32 d, u32 s)
+{
+ register u32 res; /* all operands in native machine order */
+ register u32 bc;
+
+ if (ACCESS_FLAG(F_CF))
+ res = d - s - 1;
+ else
+ res = d - s;
+ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the borrow chain. See note at top */
+ bc = (res & (~d | s)) | (~d & s);
+ CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
+ CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
+ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SUB instruction and side effects.
+****************************************************************************/
+u8 sub_byte(u8 d, u8 s)
+{
+ register u32 res; /* all operands in native machine order */
+ register u32 bc;
+
+ res = d - s;
+ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the borrow chain. See note at top */
+ bc = (res & (~d | s)) | (~d & s);
+ CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
+ CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
+ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+ return (u8)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SUB instruction and side effects.
+****************************************************************************/
+u16 sub_word(u16 d, u16 s)
+{
+ register u32 res; /* all operands in native machine order */
+ register u32 bc;
+
+ res = d - s;
+ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the borrow chain. See note at top */
+ bc = (res & (~d | s)) | (~d & s);
+ CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
+ CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
+ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+ return (u16)res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the SUB instruction and side effects.
+****************************************************************************/
+u32 sub_long(u32 d, u32 s)
+{
+ register u32 res; /* all operands in native machine order */
+ register u32 bc;
+
+ res = d - s;
+ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the borrow chain. See note at top */
+ bc = (res & (~d | s)) | (~d & s);
+ CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
+ CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
+ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the TEST instruction and side effects.
+****************************************************************************/
+void test_byte(u8 d, u8 s)
+{
+ register u32 res; /* all operands in native machine order */
+
+ res = d & s;
+
+ CLEAR_FLAG(F_OF);
+ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ /* AF == dont care */
+ CLEAR_FLAG(F_CF);
+}
+
+/****************************************************************************
+REMARKS:
+Implements the TEST instruction and side effects.
+****************************************************************************/
+void test_word(u16 d, u16 s)
+{
+ register u32 res; /* all operands in native machine order */
+
+ res = d & s;
+
+ CLEAR_FLAG(F_OF);
+ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ /* AF == dont care */
+ CLEAR_FLAG(F_CF);
+}
+
+/****************************************************************************
+REMARKS:
+Implements the TEST instruction and side effects.
+****************************************************************************/
+void test_long(u32 d, u32 s)
+{
+ register u32 res; /* all operands in native machine order */
+
+ res = d & s;
+
+ CLEAR_FLAG(F_OF);
+ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ /* AF == dont care */
+ CLEAR_FLAG(F_CF);
+}
+
+/****************************************************************************
+REMARKS:
+Implements the XOR instruction and side effects.
+****************************************************************************/
+u8 xor_byte(u8 d, u8 s)
+{
+ register u8 res; /* all operands in native machine order */
+
+ res = d ^ s;
+ CLEAR_FLAG(F_OF);
+ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_AF);
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the XOR instruction and side effects.
+****************************************************************************/
+u16 xor_word(u16 d, u16 s)
+{
+ register u16 res; /* all operands in native machine order */
+
+ res = d ^ s;
+ CLEAR_FLAG(F_OF);
+ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_AF);
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the XOR instruction and side effects.
+****************************************************************************/
+u32 xor_long(u32 d, u32 s)
+{
+ register u32 res; /* all operands in native machine order */
+
+ res = d ^ s;
+ CLEAR_FLAG(F_OF);
+ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_AF);
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the IMUL instruction and side effects.
+****************************************************************************/
+void imul_byte(u8 s)
+{
+ s16 res = (s16)((s8)M.x86.R_AL * (s8)s);
+
+ M.x86.R_AX = res;
+ if (((M.x86.R_AL & 0x80) == 0 && M.x86.R_AH == 0x00) ||
+ ((M.x86.R_AL & 0x80) != 0 && M.x86.R_AH == 0xFF)) {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ } else {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ }
+}
+
+/****************************************************************************
+REMARKS:
+Implements the IMUL instruction and side effects.
+****************************************************************************/
+void imul_word(u16 s)
+{
+ s32 res = (s16)M.x86.R_AX * (s16)s;
+
+ M.x86.R_AX = (u16)res;
+ M.x86.R_DX = (u16)(res >> 16);
+ if (((M.x86.R_AX & 0x8000) == 0 && M.x86.R_DX == 0x00) ||
+ ((M.x86.R_AX & 0x8000) != 0 && M.x86.R_DX == 0xFF)) {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ } else {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ }
+}
+
+/****************************************************************************
+REMARKS:
+Implements the IMUL instruction and side effects.
+****************************************************************************/
+void imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s)
+{
+#ifdef __HAS_LONG_LONG__
+ s64 res = (s32)d * (s32)s;
+
+ *res_lo = (u32)res;
+ *res_hi = (u32)(res >> 32);
+#else
+ u32 d_lo,d_hi,d_sign;
+ u32 s_lo,s_hi,s_sign;
+ u32 rlo_lo,rlo_hi,rhi_lo;
+
+ if ((d_sign = d & 0x80000000) != 0)
+ d = -d;
+ d_lo = d & 0xFFFF;
+ d_hi = d >> 16;
+ if ((s_sign = s & 0x80000000) != 0)
+ s = -s;
+ s_lo = s & 0xFFFF;
+ s_hi = s >> 16;
+ rlo_lo = d_lo * s_lo;
+ rlo_hi = (d_hi * s_lo + d_lo * s_hi) + (rlo_lo >> 16);
+ rhi_lo = d_hi * s_hi + (rlo_hi >> 16);
+ *res_lo = (rlo_hi << 16) | (rlo_lo & 0xFFFF);
+ *res_hi = rhi_lo;
+ if (d_sign != s_sign) {
+ d = ~*res_lo;
+ s = (((d & 0xFFFF) + 1) >> 16) + (d >> 16);
+ *res_lo = ~*res_lo+1;
+ *res_hi = ~*res_hi+(s >> 16);
+ }
+#endif
+}
+
+/****************************************************************************
+REMARKS:
+Implements the IMUL instruction and side effects.
+****************************************************************************/
+void imul_long(u32 s)
+{
+ imul_long_direct(&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s);
+ if (((M.x86.R_EAX & 0x80000000) == 0 && M.x86.R_EDX == 0x00) ||
+ ((M.x86.R_EAX & 0x80000000) != 0 && M.x86.R_EDX == 0xFF)) {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ } else {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ }
+}
+
+/****************************************************************************
+REMARKS:
+Implements the MUL instruction and side effects.
+****************************************************************************/
+void mul_byte(u8 s)
+{
+ u16 res = (u16)(M.x86.R_AL * s);
+
+ M.x86.R_AX = res;
+ if (M.x86.R_AH == 0) {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ } else {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ }
+}
+
+/****************************************************************************
+REMARKS:
+Implements the MUL instruction and side effects.
+****************************************************************************/
+void mul_word(u16 s)
+{
+ u32 res = M.x86.R_AX * s;
+
+ M.x86.R_AX = (u16)res;
+ M.x86.R_DX = (u16)(res >> 16);
+ if (M.x86.R_DX == 0) {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ } else {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ }
+}
+
+/****************************************************************************
+REMARKS:
+Implements the MUL instruction and side effects.
+****************************************************************************/
+void mul_long(u32 s)
+{
+#ifdef __HAS_LONG_LONG__
+ u64 res = (u32)M.x86.R_EAX * (u32)s;
+
+ M.x86.R_EAX = (u32)res;
+ M.x86.R_EDX = (u32)(res >> 32);
+#else
+ u32 a,a_lo,a_hi;
+ u32 s_lo,s_hi;
+ u32 rlo_lo,rlo_hi,rhi_lo;
+
+ a = M.x86.R_EAX;
+ a_lo = a & 0xFFFF;
+ a_hi = a >> 16;
+ s_lo = s & 0xFFFF;
+ s_hi = s >> 16;
+ rlo_lo = a_lo * s_lo;
+ rlo_hi = (a_hi * s_lo + a_lo * s_hi) + (rlo_lo >> 16);
+ rhi_lo = a_hi * s_hi + (rlo_hi >> 16);
+ M.x86.R_EAX = (rlo_hi << 16) | (rlo_lo & 0xFFFF);
+ M.x86.R_EDX = rhi_lo;
+#endif
+
+ if (M.x86.R_EDX == 0) {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ } else {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ }
+}
+
+/****************************************************************************
+REMARKS:
+Implements the IDIV instruction and side effects.
+****************************************************************************/
+#define abs(a) (((a) < 0) ? -(a) : (a))
+void idiv_byte(u8 s)
+{
+ s32 dvd, div, mod;
+
+ dvd = (s16)M.x86.R_AX;
+ if (s == 0) {
+ x86emu_intr_raise(0);
+ return;
+ }
+ div = dvd / (s8)s;
+ mod = dvd % (s8)s;
+ if (abs(div) > 0x7f) {
+ x86emu_intr_raise(0);
+ return;
+ }
+ M.x86.R_AL = (s8) div;
+ M.x86.R_AH = (s8) mod;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the IDIV instruction and side effects.
+****************************************************************************/
+void idiv_word(u16 s)
+{
+ s32 dvd, div, mod;
+
+ dvd = (((s32)M.x86.R_DX) << 16) | M.x86.R_AX;
+ if (s == 0) {
+ x86emu_intr_raise(0);
+ return;
+ }
+ div = dvd / (s16)s;
+ mod = dvd % (s16)s;
+ if (abs(div) > 0x7fff) {
+ x86emu_intr_raise(0);
+ return;
+ }
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_SF);
+ CONDITIONAL_SET_FLAG(div == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
+
+ M.x86.R_AX = (u16)div;
+ M.x86.R_DX = (u16)mod;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the IDIV instruction and side effects.
+****************************************************************************/
+void idiv_long(u32 s)
+{
+#ifdef __HAS_LONG_LONG__
+ s64 dvd, div, mod;
+
+ dvd = (((s64)M.x86.R_EDX) << 32) | M.x86.R_EAX;
+ if (s == 0) {
+ x86emu_intr_raise(0);
+ return;
+ }
+ div = dvd / (s32)s;
+ mod = dvd % (s32)s;
+ if (abs(div) > 0x7fffffff) {
+ x86emu_intr_raise(0);
+ return;
+ }
+#else
+ s32 div = 0, mod;
+ s32 h_dvd = M.x86.R_EDX;
+ u32 l_dvd = M.x86.R_EAX;
+ u32 abs_s = s & 0x7FFFFFFF;
+ u32 abs_h_dvd = h_dvd & 0x7FFFFFFF;
+ u32 h_s = abs_s >> 1;
+ u32 l_s = abs_s << 31;
+ int counter = 31;
+ int carry;
+
+ if (s == 0) {
+ x86emu_intr_raise(0);
+ return;
+ }
+ do {
+ div <<= 1;
+ carry = (l_dvd >= l_s) ? 0 : 1;
+
+ if (abs_h_dvd < (h_s + carry)) {
+ h_s >>= 1;
+ l_s = abs_s << (--counter);
+ continue;
+ } else {
+ abs_h_dvd -= (h_s + carry);
+ l_dvd = carry ? ((0xFFFFFFFF - l_s) + l_dvd + 1)
+ : (l_dvd - l_s);
+ h_s >>= 1;
+ l_s = abs_s << (--counter);
+ div |= 1;
+ continue;
+ }
+
+ } while (counter > -1);
+ /* overflow */
+ if (abs_h_dvd || (l_dvd > abs_s)) {
+ x86emu_intr_raise(0);
+ return;
+ }
+ /* sign */
+ div |= ((h_dvd & 0x10000000) ^ (s & 0x10000000));
+ mod = l_dvd;
+
+#endif
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_AF);
+ CLEAR_FLAG(F_SF);
+ SET_FLAG(F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
+
+ M.x86.R_EAX = (u32)div;
+ M.x86.R_EDX = (u32)mod;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the DIV instruction and side effects.
+****************************************************************************/
+void div_byte(u8 s)
+{
+ u32 dvd, div, mod;
+
+ dvd = M.x86.R_AX;
+ if (s == 0) {
+ x86emu_intr_raise(0);
+ return;
+ }
+ div = dvd / (u8)s;
+ mod = dvd % (u8)s;
+ if (abs(div) > 0xff) {
+ x86emu_intr_raise(0);
+ return;
+ }
+ M.x86.R_AL = (u8)div;
+ M.x86.R_AH = (u8)mod;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the DIV instruction and side effects.
+****************************************************************************/
+void div_word(u16 s)
+{
+ u32 dvd, div, mod;
+
+ dvd = (((u32)M.x86.R_DX) << 16) | M.x86.R_AX;
+ if (s == 0) {
+ x86emu_intr_raise(0);
+ return;
+ }
+ div = dvd / (u16)s;
+ mod = dvd % (u16)s;
+ if (abs(div) > 0xffff) {
+ x86emu_intr_raise(0);
+ return;
+ }
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_SF);
+ CONDITIONAL_SET_FLAG(div == 0, F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
+
+ M.x86.R_AX = (u16)div;
+ M.x86.R_DX = (u16)mod;
+}
+
+/****************************************************************************
+REMARKS:
+Implements the DIV instruction and side effects.
+****************************************************************************/
+void div_long(u32 s)
+{
+#ifdef __HAS_LONG_LONG__
+ u64 dvd, div, mod;
+
+ dvd = (((u64)M.x86.R_EDX) << 32) | M.x86.R_EAX;
+ if (s == 0) {
+ x86emu_intr_raise(0);
+ return;
+ }
+ div = dvd / (u32)s;
+ mod = dvd % (u32)s;
+ if (abs(div) > 0xffffffff) {
+ x86emu_intr_raise(0);
+ return;
+ }
+#else
+ s32 div = 0, mod;
+ s32 h_dvd = M.x86.R_EDX;
+ u32 l_dvd = M.x86.R_EAX;
+
+ u32 h_s = s;
+ u32 l_s = 0;
+ int counter = 32;
+ int carry;
+
+ if (s == 0) {
+ x86emu_intr_raise(0);
+ return;
+ }
+ do {
+ div <<= 1;
+ carry = (l_dvd >= l_s) ? 0 : 1;
+
+ if (h_dvd < (h_s + carry)) {
+ h_s >>= 1;
+ l_s = s << (--counter);
+ continue;
+ } else {
+ h_dvd -= (h_s + carry);
+ l_dvd = carry ? ((0xFFFFFFFF - l_s) + l_dvd + 1)
+ : (l_dvd - l_s);
+ h_s >>= 1;
+ l_s = s << (--counter);
+ div |= 1;
+ continue;
+ }
+
+ } while (counter > -1);
+ /* overflow */
+ if (h_dvd || (l_dvd > s)) {
+ x86emu_intr_raise(0);
+ return;
+ }
+ mod = l_dvd;
+#endif
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_AF);
+ CLEAR_FLAG(F_SF);
+ SET_FLAG(F_ZF);
+ CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
+
+ M.x86.R_EAX = (u32)div;
+ M.x86.R_EDX = (u32)mod;
+}
+
+#endif /* __HAVE_INLINE_ASSEMBLER__ */
+
+/****************************************************************************
+REMARKS:
+Implements the IN string instruction and side effects.
+****************************************************************************/
+void ins(int size)
+{
+ int inc = size;
+
+ if (ACCESS_FLAG(F_DF)) {
+ inc = -size;
+ }
+ if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+ /* dont care whether REPE or REPNE */
+ /* in until CX is ZERO. */
+ u32 count = ((M.x86.mode & SYSMODE_PREFIX_DATA) ?
+ M.x86.R_ECX : M.x86.R_CX);
+ switch (size) {
+ case 1:
+ while (count--) {
+ store_data_byte_abs(M.x86.R_ES, M.x86.R_DI,
+ (*sys_inb)(M.x86.R_DX));
+ M.x86.R_DI += inc;
+ }
+ break;
+
+ case 2:
+ while (count--) {
+ store_data_word_abs(M.x86.R_ES, M.x86.R_DI,
+ (*sys_inw)(M.x86.R_DX));
+ M.x86.R_DI += inc;
+ }
+ break;
+ case 4:
+ while (count--) {
+ store_data_long_abs(M.x86.R_ES, M.x86.R_DI,
+ (*sys_inl)(M.x86.R_DX));
+ M.x86.R_DI += inc;
+ break;
+ }
+ }
+ M.x86.R_CX = 0;
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ECX = 0;
+ }
+ M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+ } else {
+ switch (size) {
+ case 1:
+ store_data_byte_abs(M.x86.R_ES, M.x86.R_DI,
+ (*sys_inb)(M.x86.R_DX));
+ break;
+ case 2:
+ store_data_word_abs(M.x86.R_ES, M.x86.R_DI,
+ (*sys_inw)(M.x86.R_DX));
+ break;
+ case 4:
+ store_data_long_abs(M.x86.R_ES, M.x86.R_DI,
+ (*sys_inl)(M.x86.R_DX));
+ break;
+ }
+ M.x86.R_DI += inc;
+ }
+}
+
+/****************************************************************************
+REMARKS:
+Implements the OUT string instruction and side effects.
+****************************************************************************/
+void outs(int size)
+{
+ int inc = size;
+
+ if (ACCESS_FLAG(F_DF)) {
+ inc = -size;
+ }
+ if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+ /* dont care whether REPE or REPNE */
+ /* out until CX is ZERO. */
+ u32 count = ((M.x86.mode & SYSMODE_PREFIX_DATA) ?
+ M.x86.R_ECX : M.x86.R_CX);
+ switch (size) {
+ case 1:
+ while (count--) {
+ (*sys_outb)(M.x86.R_DX,
+ fetch_data_byte_abs(M.x86.R_ES, M.x86.R_SI));
+ M.x86.R_SI += inc;
+ }
+ break;
+
+ case 2:
+ while (count--) {
+ (*sys_outw)(M.x86.R_DX,
+ fetch_data_word_abs(M.x86.R_ES, M.x86.R_SI));
+ M.x86.R_SI += inc;
+ }
+ break;
+ case 4:
+ while (count--) {
+ (*sys_outl)(M.x86.R_DX,
+ fetch_data_long_abs(M.x86.R_ES, M.x86.R_SI));
+ M.x86.R_SI += inc;
+ break;
+ }
+ }
+ M.x86.R_CX = 0;
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ECX = 0;
+ }
+ M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+ } else {
+ switch (size) {
+ case 1:
+ (*sys_outb)(M.x86.R_DX,
+ fetch_data_byte_abs(M.x86.R_ES, M.x86.R_SI));
+ break;
+ case 2:
+ (*sys_outw)(M.x86.R_DX,
+ fetch_data_word_abs(M.x86.R_ES, M.x86.R_SI));
+ break;
+ case 4:
+ (*sys_outl)(M.x86.R_DX,
+ fetch_data_long_abs(M.x86.R_ES, M.x86.R_SI));
+ break;
+ }
+ M.x86.R_SI += inc;
+ }
+}
+
+/****************************************************************************
+PARAMETERS:
+addr - Address to fetch word from
+
+REMARKS:
+Fetches a word from emulator memory using an absolute address.
+****************************************************************************/
+u16 mem_access_word(int addr)
+{
+DB( if (CHECK_MEM_ACCESS())
+ x86emu_check_mem_access(addr);)
+ return (*sys_rdw)(addr);
+}
+
+/****************************************************************************
+REMARKS:
+Pushes a word onto the stack.
+
+NOTE: Do not inline this, as (*sys_wrX) is already inline!
+****************************************************************************/
+void push_word(u16 w)
+{
+DB( if (CHECK_SP_ACCESS())
+ x86emu_check_sp_access();)
+ M.x86.R_SP -= 2;
+ (*sys_wrw)(((u32)M.x86.R_SS << 4) + M.x86.R_SP, w);
+}
+
+/****************************************************************************
+REMARKS:
+Pushes a long onto the stack.
+
+NOTE: Do not inline this, as (*sys_wrX) is already inline!
+****************************************************************************/
+void push_long(u32 w)
+{
+DB( if (CHECK_SP_ACCESS())
+ x86emu_check_sp_access();)
+ M.x86.R_SP -= 4;
+ (*sys_wrl)(((u32)M.x86.R_SS << 4) + M.x86.R_SP, w);
+}
+
+/****************************************************************************
+REMARKS:
+Pops a word from the stack.
+
+NOTE: Do not inline this, as (*sys_rdX) is already inline!
+****************************************************************************/
+u16 pop_word(void)
+{
+ register u16 res;
+
+DB( if (CHECK_SP_ACCESS())
+ x86emu_check_sp_access();)
+ res = (*sys_rdw)(((u32)M.x86.R_SS << 4) + M.x86.R_SP);
+ M.x86.R_SP += 2;
+ return res;
+}
+
+/****************************************************************************
+REMARKS:
+Pops a long from the stack.
+
+NOTE: Do not inline this, as (*sys_rdX) is already inline!
+****************************************************************************/
+u32 pop_long(void)
+{
+ register u32 res;
+
+DB( if (CHECK_SP_ACCESS())
+ x86emu_check_sp_access();)
+ res = (*sys_rdl)(((u32)M.x86.R_SS << 4) + M.x86.R_SP);
+ M.x86.R_SP += 4;
+ return res;
+}
+
+#ifdef __HAVE_INLINE_ASSEMBLER__
+
+u16 aaa_word (u16 d)
+{ return aaa_word_asm(&M.x86.R_EFLG,d); }
+
+u16 aas_word (u16 d)
+{ return aas_word_asm(&M.x86.R_EFLG,d); }
+
+u16 aad_word (u16 d)
+{ return aad_word_asm(&M.x86.R_EFLG,d); }
+
+u16 aam_word (u8 d)
+{ return aam_word_asm(&M.x86.R_EFLG,d); }
+
+u8 adc_byte (u8 d, u8 s)
+{ return adc_byte_asm(&M.x86.R_EFLG,d,s); }
+
+u16 adc_word (u16 d, u16 s)
+{ return adc_word_asm(&M.x86.R_EFLG,d,s); }
+
+u32 adc_long (u32 d, u32 s)
+{ return adc_long_asm(&M.x86.R_EFLG,d,s); }
+
+u8 add_byte (u8 d, u8 s)
+{ return add_byte_asm(&M.x86.R_EFLG,d,s); }
+
+u16 add_word (u16 d, u16 s)
+{ return add_word_asm(&M.x86.R_EFLG,d,s); }
+
+u32 add_long (u32 d, u32 s)
+{ return add_long_asm(&M.x86.R_EFLG,d,s); }
+
+u8 and_byte (u8 d, u8 s)
+{ return and_byte_asm(&M.x86.R_EFLG,d,s); }
+
+u16 and_word (u16 d, u16 s)
+{ return and_word_asm(&M.x86.R_EFLG,d,s); }
+
+u32 and_long (u32 d, u32 s)
+{ return and_long_asm(&M.x86.R_EFLG,d,s); }
+
+u8 cmp_byte (u8 d, u8 s)
+{ return cmp_byte_asm(&M.x86.R_EFLG,d,s); }
+
+u16 cmp_word (u16 d, u16 s)
+{ return cmp_word_asm(&M.x86.R_EFLG,d,s); }
+
+u32 cmp_long (u32 d, u32 s)
+{ return cmp_long_asm(&M.x86.R_EFLG,d,s); }
+
+u8 daa_byte (u8 d)
+{ return daa_byte_asm(&M.x86.R_EFLG,d); }
+
+u8 das_byte (u8 d)
+{ return das_byte_asm(&M.x86.R_EFLG,d); }
+
+u8 dec_byte (u8 d)
+{ return dec_byte_asm(&M.x86.R_EFLG,d); }
+
+u16 dec_word (u16 d)
+{ return dec_word_asm(&M.x86.R_EFLG,d); }
+
+u32 dec_long (u32 d)
+{ return dec_long_asm(&M.x86.R_EFLG,d); }
+
+u8 inc_byte (u8 d)
+{ return inc_byte_asm(&M.x86.R_EFLG,d); }
+
+u16 inc_word (u16 d)
+{ return inc_word_asm(&M.x86.R_EFLG,d); }
+
+u32 inc_long (u32 d)
+{ return inc_long_asm(&M.x86.R_EFLG,d); }
+
+u8 or_byte (u8 d, u8 s)
+{ return or_byte_asm(&M.x86.R_EFLG,d,s); }
+
+u16 or_word (u16 d, u16 s)
+{ return or_word_asm(&M.x86.R_EFLG,d,s); }
+
+u32 or_long (u32 d, u32 s)
+{ return or_long_asm(&M.x86.R_EFLG,d,s); }
+
+u8 neg_byte (u8 s)
+{ return neg_byte_asm(&M.x86.R_EFLG,s); }
+
+u16 neg_word (u16 s)
+{ return neg_word_asm(&M.x86.R_EFLG,s); }
+
+u32 neg_long (u32 s)
+{ return neg_long_asm(&M.x86.R_EFLG,s); }
+
+u8 not_byte (u8 s)
+{ return not_byte_asm(&M.x86.R_EFLG,s); }
+
+u16 not_word (u16 s)
+{ return not_word_asm(&M.x86.R_EFLG,s); }
+
+u32 not_long (u32 s)
+{ return not_long_asm(&M.x86.R_EFLG,s); }
+
+u8 rcl_byte (u8 d, u8 s)
+{ return rcl_byte_asm(&M.x86.R_EFLG,d,s); }
+
+u16 rcl_word (u16 d, u8 s)
+{ return rcl_word_asm(&M.x86.R_EFLG,d,s); }
+
+u32 rcl_long (u32 d, u8 s)
+{ return rcl_long_asm(&M.x86.R_EFLG,d,s); }
+
+u8 rcr_byte (u8 d, u8 s)
+{ return rcr_byte_asm(&M.x86.R_EFLG,d,s); }
+
+u16 rcr_word (u16 d, u8 s)
+{ return rcr_word_asm(&M.x86.R_EFLG,d,s); }
+
+u32 rcr_long (u32 d, u8 s)
+{ return rcr_long_asm(&M.x86.R_EFLG,d,s); }
+
+u8 rol_byte (u8 d, u8 s)
+{ return rol_byte_asm(&M.x86.R_EFLG,d,s); }
+
+u16 rol_word (u16 d, u8 s)
+{ return rol_word_asm(&M.x86.R_EFLG,d,s); }
+
+u32 rol_long (u32 d, u8 s)
+{ return rol_long_asm(&M.x86.R_EFLG,d,s); }
+
+u8 ror_byte (u8 d, u8 s)
+{ return ror_byte_asm(&M.x86.R_EFLG,d,s); }
+
+u16 ror_word (u16 d, u8 s)
+{ return ror_word_asm(&M.x86.R_EFLG,d,s); }
+
+u32 ror_long (u32 d, u8 s)
+{ return ror_long_asm(&M.x86.R_EFLG,d,s); }
+
+u8 shl_byte (u8 d, u8 s)
+{ return shl_byte_asm(&M.x86.R_EFLG,d,s); }
+
+u16 shl_word (u16 d, u8 s)
+{ return shl_word_asm(&M.x86.R_EFLG,d,s); }
+
+u32 shl_long (u32 d, u8 s)
+{ return shl_long_asm(&M.x86.R_EFLG,d,s); }
+
+u8 shr_byte (u8 d, u8 s)
+{ return shr_byte_asm(&M.x86.R_EFLG,d,s); }
+
+u16 shr_word (u16 d, u8 s)
+{ return shr_word_asm(&M.x86.R_EFLG,d,s); }
+
+u32 shr_long (u32 d, u8 s)
+{ return shr_long_asm(&M.x86.R_EFLG,d,s); }
+
+u8 sar_byte (u8 d, u8 s)
+{ return sar_byte_asm(&M.x86.R_EFLG,d,s); }
+
+u16 sar_word (u16 d, u8 s)
+{ return sar_word_asm(&M.x86.R_EFLG,d,s); }
+
+u32 sar_long (u32 d, u8 s)
+{ return sar_long_asm(&M.x86.R_EFLG,d,s); }
+
+u16 shld_word (u16 d, u16 fill, u8 s)
+{ return shld_word_asm(&M.x86.R_EFLG,d,fill,s); }
+
+u32 shld_long (u32 d, u32 fill, u8 s)
+{ return shld_long_asm(&M.x86.R_EFLG,d,fill,s); }
+
+u16 shrd_word (u16 d, u16 fill, u8 s)
+{ return shrd_word_asm(&M.x86.R_EFLG,d,fill,s); }
+
+u32 shrd_long (u32 d, u32 fill, u8 s)
+{ return shrd_long_asm(&M.x86.R_EFLG,d,fill,s); }
+
+u8 sbb_byte (u8 d, u8 s)
+{ return sbb_byte_asm(&M.x86.R_EFLG,d,s); }
+
+u16 sbb_word (u16 d, u16 s)
+{ return sbb_word_asm(&M.x86.R_EFLG,d,s); }
+
+u32 sbb_long (u32 d, u32 s)
+{ return sbb_long_asm(&M.x86.R_EFLG,d,s); }
+
+u8 sub_byte (u8 d, u8 s)
+{ return sub_byte_asm(&M.x86.R_EFLG,d,s); }
+
+u16 sub_word (u16 d, u16 s)
+{ return sub_word_asm(&M.x86.R_EFLG,d,s); }
+
+u32 sub_long (u32 d, u32 s)
+{ return sub_long_asm(&M.x86.R_EFLG,d,s); }
+
+void test_byte (u8 d, u8 s)
+{ test_byte_asm(&M.x86.R_EFLG,d,s); }
+
+void test_word (u16 d, u16 s)
+{ test_word_asm(&M.x86.R_EFLG,d,s); }
+
+void test_long (u32 d, u32 s)
+{ test_long_asm(&M.x86.R_EFLG,d,s); }
+
+u8 xor_byte (u8 d, u8 s)
+{ return xor_byte_asm(&M.x86.R_EFLG,d,s); }
+
+u16 xor_word (u16 d, u16 s)
+{ return xor_word_asm(&M.x86.R_EFLG,d,s); }
+
+u32 xor_long (u32 d, u32 s)
+{ return xor_long_asm(&M.x86.R_EFLG,d,s); }
+
+void imul_byte (u8 s)
+{ imul_byte_asm(&M.x86.R_EFLG,&M.x86.R_AX,M.x86.R_AL,s); }
+
+void imul_word (u16 s)
+{ imul_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,s); }
+
+void imul_long (u32 s)
+{ imul_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s); }
+
+void imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s)
+{ imul_long_asm(&M.x86.R_EFLG,res_lo,res_hi,d,s); }
+
+void mul_byte (u8 s)
+{ mul_byte_asm(&M.x86.R_EFLG,&M.x86.R_AX,M.x86.R_AL,s); }
+
+void mul_word (u16 s)
+{ mul_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,s); }
+
+void mul_long (u32 s)
+{ mul_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s); }
+
+void idiv_byte (u8 s)
+{ idiv_byte_asm(&M.x86.R_EFLG,&M.x86.R_AL,&M.x86.R_AH,M.x86.R_AX,s); }
+
+void idiv_word (u16 s)
+{ idiv_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,M.x86.R_DX,s); }
+
+void idiv_long (u32 s)
+{ idiv_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,M.x86.R_EDX,s); }
+
+void div_byte (u8 s)
+{ div_byte_asm(&M.x86.R_EFLG,&M.x86.R_AL,&M.x86.R_AH,M.x86.R_AX,s); }
+
+void div_word (u16 s)
+{ div_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,M.x86.R_DX,s); }
+
+void div_long (u32 s)
+{ div_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,M.x86.R_EDX,s); }
+
+#endif
diff --git a/cfe/cfe/x86emu/sys.c b/cfe/cfe/x86emu/sys.c
new file mode 100644
index 0000000..f80d755
--- /dev/null
+++ b/cfe/cfe/x86emu/sys.c
@@ -0,0 +1,603 @@
+/****************************************************************************
+*
+* Realmode X86 Emulator Library
+*
+* Copyright (C) 1996-1999 SciTech Software, Inc.
+* Copyright (C) David Mosberger-Tang
+* Copyright (C) 1999 Egbert Eich
+*
+* ========================================================================
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee,
+* provided that the above copyright notice appear in all copies and that
+* both that copyright notice and this permission notice appear in
+* supporting documentation, and that the name of the authors not be used
+* in advertising or publicity pertaining to distribution of the software
+* without specific, written prior permission. The authors makes no
+* representations about the suitability of this software for any purpose.
+* It is provided "as is" without express or implied warranty.
+*
+* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+* PERFORMANCE OF THIS SOFTWARE.
+*
+* ========================================================================
+*
+* Language: ANSI C
+* Environment: Any
+* Developer: Kendall Bennett
+*
+* Description: This file includes subroutines which are related to
+* programmed I/O and memory access. Included in this module
+* are default functions with limited usefulness. For real
+* uses these functions will most likely be overriden by the
+* user library.
+*
+****************************************************************************/
+/* $XFree86: xc/extras/x86emu/src/x86emu/sys.c,v 1.5 2000/08/23 22:10:01 tsi Exp $ */
+
+#include "x86emu.h"
+#include "x86emu/regs.h"
+#include "x86emu/debug.h"
+#include "x86emu/prim_ops.h"
+#ifdef IN_MODULE
+#include "xf86_ansic.h"
+#else
+/*#include <string.h> */
+#define NULL 0
+#endif
+/*------------------------- Global Variables ------------------------------*/
+
+X86EMU_sysEnv _X86EMU_env; /* Global emulator machine state */
+X86EMU_intrFuncs _X86EMU_intrTab[256];
+
+/*----------------------------- Implementation ----------------------------*/
+#if defined(__alpha__) || defined(__alpha)
+/* to cope with broken egcs-1.1.2 :-(((( */
+
+/*
+ * inline functions to do unaligned accesses
+ * from linux/include/asm-alpha/unaligned.h
+ */
+
+/*
+ * EGCS 1.1 knows about arbitrary unaligned loads. Define some
+ * packed structures to talk about such things with.
+ */
+
+#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
+struct __una_u64 { unsigned long x __attribute__((packed)); };
+struct __una_u32 { unsigned int x __attribute__((packed)); };
+struct __una_u16 { unsigned short x __attribute__((packed)); };
+#endif
+
+static __inline__ unsigned long ldq_u(unsigned long * r11)
+{
+#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
+ const struct __una_u64 *ptr = (const struct __una_u64 *) r11;
+ return ptr->x;
+#else
+ unsigned long r1,r2;
+ __asm__("ldq_u %0,%3\n\t"
+ "ldq_u %1,%4\n\t"
+ "extql %0,%2,%0\n\t"
+ "extqh %1,%2,%1"
+ :"=&r" (r1), "=&r" (r2)
+ :"r" (r11),
+ "m" (*r11),
+ "m" (*(const unsigned long *)(7+(char *) r11)));
+ return r1 | r2;
+#endif
+}
+
+static __inline__ unsigned long ldl_u(unsigned int * r11)
+{
+#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
+ const struct __una_u32 *ptr = (const struct __una_u32 *) r11;
+ return ptr->x;
+#else
+ unsigned long r1,r2;
+ __asm__("ldq_u %0,%3\n\t"
+ "ldq_u %1,%4\n\t"
+ "extll %0,%2,%0\n\t"
+ "extlh %1,%2,%1"
+ :"=&r" (r1), "=&r" (r2)
+ :"r" (r11),
+ "m" (*r11),
+ "m" (*(const unsigned long *)(3+(char *) r11)));
+ return r1 | r2;
+#endif
+}
+
+static __inline__ unsigned long ldw_u(unsigned short * r11)
+{
+#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
+ const struct __una_u16 *ptr = (const struct __una_u16 *) r11;
+ return ptr->x;
+#else
+ unsigned long r1,r2;
+ __asm__("ldq_u %0,%3\n\t"
+ "ldq_u %1,%4\n\t"
+ "extwl %0,%2,%0\n\t"
+ "extwh %1,%2,%1"
+ :"=&r" (r1), "=&r" (r2)
+ :"r" (r11),
+ "m" (*r11),
+ "m" (*(const unsigned long *)(1+(char *) r11)));
+ return r1 | r2;
+#endif
+}
+
+/*
+ * Elemental unaligned stores
+ */
+
+static __inline__ void stq_u(unsigned long r5, unsigned long * r11)
+{
+#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
+ struct __una_u64 *ptr = (struct __una_u64 *) r11;
+ ptr->x = r5;
+#else
+ unsigned long r1,r2,r3,r4;
+
+ __asm__("ldq_u %3,%1\n\t"
+ "ldq_u %2,%0\n\t"
+ "insqh %6,%7,%5\n\t"
+ "insql %6,%7,%4\n\t"
+ "mskqh %3,%7,%3\n\t"
+ "mskql %2,%7,%2\n\t"
+ "bis %3,%5,%3\n\t"
+ "bis %2,%4,%2\n\t"
+ "stq_u %3,%1\n\t"
+ "stq_u %2,%0"
+ :"=m" (*r11),
+ "=m" (*(unsigned long *)(7+(char *) r11)),
+ "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
+ :"r" (r5), "r" (r11));
+#endif
+}
+
+static __inline__ void stl_u(unsigned long r5, unsigned int * r11)
+{
+#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
+ struct __una_u32 *ptr = (struct __una_u32 *) r11;
+ ptr->x = r5;
+#else
+ unsigned long r1,r2,r3,r4;
+
+ __asm__("ldq_u %3,%1\n\t"
+ "ldq_u %2,%0\n\t"
+ "inslh %6,%7,%5\n\t"
+ "insll %6,%7,%4\n\t"
+ "msklh %3,%7,%3\n\t"
+ "mskll %2,%7,%2\n\t"
+ "bis %3,%5,%3\n\t"
+ "bis %2,%4,%2\n\t"
+ "stq_u %3,%1\n\t"
+ "stq_u %2,%0"
+ :"=m" (*r11),
+ "=m" (*(unsigned long *)(3+(char *) r11)),
+ "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
+ :"r" (r5), "r" (r11));
+#endif
+}
+
+static __inline__ void stw_u(unsigned long r5, unsigned short * r11)
+{
+#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
+ struct __una_u16 *ptr = (struct __una_u16 *) r11;
+ ptr->x = r5;
+#else
+ unsigned long r1,r2,r3,r4;
+
+ __asm__("ldq_u %3,%1\n\t"
+ "ldq_u %2,%0\n\t"
+ "inswh %6,%7,%5\n\t"
+ "inswl %6,%7,%4\n\t"
+ "mskwh %3,%7,%3\n\t"
+ "mskwl %2,%7,%2\n\t"
+ "bis %3,%5,%3\n\t"
+ "bis %2,%4,%2\n\t"
+ "stq_u %3,%1\n\t"
+ "stq_u %2,%0"
+ :"=m" (*r11),
+ "=m" (*(unsigned long *)(1+(char *) r11)),
+ "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
+ :"r" (r5), "r" (r11));
+#endif
+}
+#endif
+
+/****************************************************************************
+PARAMETERS:
+addr - Emulator memory address to read
+
+RETURNS:
+Byte value read from emulator memory.
+
+REMARKS:
+Reads a byte value from the emulator memory.
+****************************************************************************/
+u8 X86API rdb(
+ u32 addr)
+{
+ u8 val;
+
+ if (addr > M.mem_size - 1) {
+ DB(printk("mem_read: address %#lx out of range!\n", addr);)
+ HALT_SYS();
+ }
+ val = *(u8*)(M.mem_base + addr);
+DB( if (DEBUG_MEM_TRACE())
+ printk("%#08x 1 -> %#x\n", addr, val);)
+ return val;
+}
+
+/****************************************************************************
+PARAMETERS:
+addr - Emulator memory address to read
+
+RETURNS:
+Word value read from emulator memory.
+
+REMARKS:
+Reads a word value from the emulator memory.
+****************************************************************************/
+u16 X86API rdw(
+ u32 addr)
+{
+ u16 val = 0;
+
+ if (addr > M.mem_size - 2) {
+ DB(printk("mem_read: address %#lx out of range!\n", addr);)
+ HALT_SYS();
+ }
+#ifdef __BIG_ENDIAN__
+ if (addr & 0x1) {
+ val = (*(u8*)(M.mem_base + addr) |
+ (*(u8*)(M.mem_base + addr + 1) << 8));
+ }
+ else
+#endif
+#if defined(__alpha__) || defined(__alpha)
+ val = ldw_u((u16*)(M.mem_base + addr));
+#else
+ val = *(u16*)(M.mem_base + addr);
+#endif
+ DB( if (DEBUG_MEM_TRACE())
+ printk("%#08x 2 -> %#x\n", addr, val);)
+ return val;
+}
+
+/****************************************************************************
+PARAMETERS:
+addr - Emulator memory address to read
+
+RETURNS:
+Long value read from emulator memory.
+REMARKS:
+Reads a long value from the emulator memory.
+****************************************************************************/
+u32 X86API rdl(
+ u32 addr)
+{
+ u32 val = 0;
+
+ if (addr > M.mem_size - 4) {
+ DB(printk("mem_read: address %#lx out of range!\n", addr);)
+ HALT_SYS();
+ }
+#ifdef __BIG_ENDIAN__
+ if (addr & 0x3) {
+ val = (*(u8*)(M.mem_base + addr + 0) |
+ (*(u8*)(M.mem_base + addr + 1) << 8) |
+ (*(u8*)(M.mem_base + addr + 2) << 16) |
+ (*(u8*)(M.mem_base + addr + 3) << 24));
+ }
+ else
+#endif
+#if defined(__alpha__) || defined(__alpha)
+ val = ldl_u((u32*)(M.mem_base + addr));
+#else
+ val = *(u32*)(M.mem_base + addr);
+#endif
+DB( if (DEBUG_MEM_TRACE())
+ printk("%#08x 4 -> %#x\n", addr, val);)
+ return val;
+}
+
+/****************************************************************************
+PARAMETERS:
+addr - Emulator memory address to read
+val - Value to store
+
+REMARKS:
+Writes a byte value to emulator memory.
+****************************************************************************/
+void X86API wrb(
+ u32 addr,
+ u8 val)
+{
+DB( if (DEBUG_MEM_TRACE())
+ printk("%#08x 1 <- %#x\n", addr, val);)
+ if (addr > M.mem_size - 1) {
+ DB(printk("mem_write: address %#lx out of range!\n", addr);)
+ HALT_SYS();
+ }
+ *(u8*)(M.mem_base + addr) = val;
+}
+
+/****************************************************************************
+PARAMETERS:
+addr - Emulator memory address to read
+val - Value to store
+
+REMARKS:
+Writes a word value to emulator memory.
+****************************************************************************/
+void X86API wrw(
+ u32 addr,
+ u16 val)
+{
+DB( if (DEBUG_MEM_TRACE())
+ printk("%#08x 2 <- %#x\n", addr, val);)
+ if (addr > M.mem_size - 2) {
+ DB(printk("mem_write: address %#lx out of range!\n", addr);)
+ HALT_SYS();
+ }
+#ifdef __BIG_ENDIAN__
+ if (addr & 0x1) {
+ *(u8*)(M.mem_base + addr + 0) = (val >> 0) & 0xff;
+ *(u8*)(M.mem_base + addr + 1) = (val >> 8) & 0xff;
+ }
+ else
+#endif
+#if defined(__alpha__) || defined(__alpha)
+ stw_u(val,(u16*)(M.mem_base + addr));
+#else
+ *(u16*)(M.mem_base + addr) = val;
+#endif
+}
+
+/****************************************************************************
+PARAMETERS:
+addr - Emulator memory address to read
+val - Value to store
+
+REMARKS:
+Writes a long value to emulator memory.
+****************************************************************************/
+void X86API wrl(
+ u32 addr,
+ u32 val)
+{
+DB( if (DEBUG_MEM_TRACE())
+ printk("%#08x 4 <- %#x\n", addr, val);)
+ if (addr > M.mem_size - 4) {
+ DB(printk("mem_write: address %#lx out of range!\n", addr);)
+ HALT_SYS();
+ }
+#ifdef __BIG_ENDIAN__
+ if (addr & 0x1) {
+ *(u8*)(M.mem_base + addr + 0) = (val >> 0) & 0xff;
+ *(u8*)(M.mem_base + addr + 1) = (val >> 8) & 0xff;
+ *(u8*)(M.mem_base + addr + 2) = (val >> 16) & 0xff;
+ *(u8*)(M.mem_base + addr + 3) = (val >> 24) & 0xff;
+ }
+ else
+#endif
+#if defined(__alpha__) || defined(__alpha)
+ stl_u(val,(u32*)(M.mem_base + addr));
+#else
+ *(u32*)(M.mem_base + addr) = val;
+#endif
+}
+
+/****************************************************************************
+PARAMETERS:
+addr - PIO address to read
+RETURN:
+0
+REMARKS:
+Default PIO byte read function. Doesn't perform real inb.
+****************************************************************************/
+static u8 X86API p_inb(
+ X86EMU_pioAddr addr)
+{
+DB( if (DEBUG_IO_TRACE())
+ printk("inb %#04x \n", addr);)
+ return 0;
+}
+
+/****************************************************************************
+PARAMETERS:
+addr - PIO address to read
+RETURN:
+0
+REMARKS:
+Default PIO word read function. Doesn't perform real inw.
+****************************************************************************/
+static u16 X86API p_inw(
+ X86EMU_pioAddr addr)
+{
+DB( if (DEBUG_IO_TRACE())
+ printk("inw %#04x \n", addr);)
+ return 0;
+}
+
+/****************************************************************************
+PARAMETERS:
+addr - PIO address to read
+RETURN:
+0
+REMARKS:
+Default PIO long read function. Doesn't perform real inl.
+****************************************************************************/
+static u32 X86API p_inl(
+ X86EMU_pioAddr addr)
+{
+DB( if (DEBUG_IO_TRACE())
+ printk("inl %#04x \n", addr);)
+ return 0;
+}
+
+/****************************************************************************
+PARAMETERS:
+addr - PIO address to write
+val - Value to store
+REMARKS:
+Default PIO byte write function. Doesn't perform real outb.
+****************************************************************************/
+static void X86API p_outb(
+ X86EMU_pioAddr addr,
+ u8 val)
+{
+DB( if (DEBUG_IO_TRACE())
+ printk("outb %#02x -> %#04x \n", val, addr);)
+ return;
+}
+
+/****************************************************************************
+PARAMETERS:
+addr - PIO address to write
+val - Value to store
+REMARKS:
+Default PIO word write function. Doesn't perform real outw.
+****************************************************************************/
+static void X86API p_outw(
+ X86EMU_pioAddr addr,
+ u16 val)
+{
+DB( if (DEBUG_IO_TRACE())
+ printk("outw %#04x -> %#04x \n", val, addr);)
+ return;
+}
+
+/****************************************************************************
+PARAMETERS:
+addr - PIO address to write
+val - Value to store
+REMARKS:
+Default PIO ;ong write function. Doesn't perform real outl.
+****************************************************************************/
+static void X86API p_outl(
+ X86EMU_pioAddr addr,
+ u32 val)
+{
+DB( if (DEBUG_IO_TRACE())
+ printk("outl %#08x -> %#04x \n", val, addr);)
+ return;
+}
+
+/*------------------------- Global Variables ------------------------------*/
+
+u8 (X86APIP sys_rdb)(u32 addr) = rdb;
+u16 (X86APIP sys_rdw)(u32 addr) = rdw;
+u32 (X86APIP sys_rdl)(u32 addr) = rdl;
+void (X86APIP sys_wrb)(u32 addr,u8 val) = wrb;
+void (X86APIP sys_wrw)(u32 addr,u16 val) = wrw;
+void (X86APIP sys_wrl)(u32 addr,u32 val) = wrl;
+u8 (X86APIP sys_inb)(X86EMU_pioAddr addr) = p_inb;
+u16 (X86APIP sys_inw)(X86EMU_pioAddr addr) = p_inw;
+u32 (X86APIP sys_inl)(X86EMU_pioAddr addr) = p_inl;
+void (X86APIP sys_outb)(X86EMU_pioAddr addr, u8 val) = p_outb;
+void (X86APIP sys_outw)(X86EMU_pioAddr addr, u16 val) = p_outw;
+void (X86APIP sys_outl)(X86EMU_pioAddr addr, u32 val) = p_outl;
+
+/*----------------------------- Setup -------------------------------------*/
+
+/****************************************************************************
+PARAMETERS:
+funcs - New memory function pointers to make active
+
+REMARKS:
+This function is used to set the pointers to functions which access
+memory space, allowing the user application to override these functions
+and hook them out as necessary for their application.
+****************************************************************************/
+void X86EMU_setupMemFuncs(
+ X86EMU_memFuncs *funcs)
+{
+ sys_rdb = funcs->rdb;
+ sys_rdw = funcs->rdw;
+ sys_rdl = funcs->rdl;
+ sys_wrb = funcs->wrb;
+ sys_wrw = funcs->wrw;
+ sys_wrl = funcs->wrl;
+}
+
+/****************************************************************************
+PARAMETERS:
+funcs - New programmed I/O function pointers to make active
+
+REMARKS:
+This function is used to set the pointers to functions which access
+I/O space, allowing the user application to override these functions
+and hook them out as necessary for their application.
+****************************************************************************/
+void X86EMU_setupPioFuncs(
+ X86EMU_pioFuncs *funcs)
+{
+ sys_inb = funcs->inb;
+ sys_inw = funcs->inw;
+ sys_inl = funcs->inl;
+ sys_outb = funcs->outb;
+ sys_outw = funcs->outw;
+ sys_outl = funcs->outl;
+}
+
+/****************************************************************************
+PARAMETERS:
+funcs - New interrupt vector table to make active
+
+REMARKS:
+This function is used to set the pointers to functions which handle
+interrupt processing in the emulator, allowing the user application to
+hook interrupts as necessary for their application. Any interrupts that
+are not hooked by the user application, and reflected and handled internally
+in the emulator via the interrupt vector table. This allows the application
+to get control when the code being emulated executes specific software
+interrupts.
+****************************************************************************/
+void X86EMU_setupIntrFuncs(
+ X86EMU_intrFuncs funcs[])
+{
+ int i;
+
+ for (i=0; i < 256; i++)
+ _X86EMU_intrTab[i] = NULL;
+ if (funcs) {
+ for (i = 0; i < 256; i++)
+ _X86EMU_intrTab[i] = funcs[i];
+ }
+}
+
+/****************************************************************************
+PARAMETERS:
+int - New software interrupt to prepare for
+
+REMARKS:
+This function is used to set up the emulator state to exceute a software
+interrupt. This can be used by the user application code to allow an
+interrupt to be hooked, examined and then reflected back to the emulator
+so that the code in the emulator will continue processing the software
+interrupt as per normal. This essentially allows system code to actively
+hook and handle certain software interrupts as necessary.
+****************************************************************************/
+void X86EMU_prepareForInt(
+ int num)
+{
+ push_word((u16)M.x86.R_FLG);
+ CLEAR_FLAG(F_IF);
+ CLEAR_FLAG(F_TF);
+ push_word(M.x86.R_CS);
+ M.x86.R_CS = mem_access_word(num * 4 + 2);
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = mem_access_word(num * 4);
+ M.x86.intr = 0;
+}
diff --git a/cfe/cfe/x86emu/validate.c b/cfe/cfe/x86emu/validate.c
new file mode 100644
index 0000000..239f6c1
--- /dev/null
+++ b/cfe/cfe/x86emu/validate.c
@@ -0,0 +1,765 @@
+/****************************************************************************
+*
+* Realmode X86 Emulator Library
+*
+* Copyright (C) 1996-1999 SciTech Software, Inc.
+* Copyright (C) David Mosberger-Tang
+* Copyright (C) 1999 Egbert Eich
+*
+* ========================================================================
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee,
+* provided that the above copyright notice appear in all copies and that
+* both that copyright notice and this permission notice appear in
+* supporting documentation, and that the name of the authors not be used
+* in advertising or publicity pertaining to distribution of the software
+* without specific, written prior permission. The authors makes no
+* representations about the suitability of this software for any purpose.
+* It is provided "as is" without express or implied warranty.
+*
+* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+* PERFORMANCE OF THIS SOFTWARE.
+*
+* ========================================================================
+*
+* Language: Watcom C 10.6 or later
+* Environment: 32-bit DOS
+* Developer: Kendall Bennett
+*
+* Description: Program to validate the x86 emulator library for
+* correctness. We run the emulator primitive operations
+* functions against the real x86 CPU, and compare the result
+* and flags to ensure correctness.
+*
+* We use inline assembler to compile and build this program.
+*
+****************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#include "x86emu.h"
+#include "x86emu/prim_asm.h"
+
+/*-------------------------- Implementation -------------------------------*/
+
+#define true 1
+#define false 0
+
+#define ALL_FLAGS (F_CF | F_PF | F_AF | F_ZF | F_SF | F_OF)
+
+#define VAL_START_BINARY(parm_type,res_type,dmax,smax,dincr,sincr) \
+{ \
+ parm_type d,s; \
+ res_type r,r_asm; \
+ ulong flags,inflags; \
+ int f,failed = false; \
+ char buf1[80],buf2[80]; \
+ for (d = 0; d < dmax; d += dincr) { \
+ for (s = 0; s < smax; s += sincr) { \
+ M.x86.R_EFLG = inflags = flags = def_flags; \
+ for (f = 0; f < 2; f++) {
+
+#define VAL_TEST_BINARY(name) \
+ r_asm = name##_asm(&flags,d,s); \
+ r = name(d,s); \
+ if (r != r_asm || M.x86.R_EFLG != flags) \
+ failed = true; \
+ if (failed || trace) {
+
+#define VAL_TEST_BINARY_VOID(name) \
+ name##_asm(&flags,d,s); \
+ name(d,s); \
+ r = r_asm = 0; \
+ if (M.x86.R_EFLG != flags) \
+ failed = true; \
+ if (failed || trace) {
+
+#define VAL_FAIL_BYTE_BYTE_BINARY(name) \
+ if (failed) \
+ printk("fail\n"); \
+ printk("0x%02X = %-15s(0x%02X,0x%02X), flags = %s -> %s\n", \
+ r, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
+ printk("0x%02X = %-15s(0x%02X,0x%02X), flags = %s -> %s\n", \
+ r_asm, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags));
+
+#define VAL_FAIL_WORD_WORD_BINARY(name) \
+ if (failed) \
+ printk("fail\n"); \
+ printk("0x%04X = %-15s(0x%04X,0x%04X), flags = %s -> %s\n", \
+ r, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
+ printk("0x%04X = %-15s(0x%04X,0x%04X), flags = %s -> %s\n", \
+ r_asm, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags));
+
+#define VAL_FAIL_LONG_LONG_BINARY(name) \
+ if (failed) \
+ printk("fail\n"); \
+ printk("0x%08X = %-15s(0x%08X,0x%08X), flags = %s -> %s\n", \
+ r, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
+ printk("0x%08X = %-15s(0x%08X,0x%08X), flags = %s -> %s\n", \
+ r_asm, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags));
+
+#define VAL_END_BINARY() \
+ } \
+ M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \
+ if (failed) \
+ break; \
+ } \
+ if (failed) \
+ break; \
+ } \
+ if (failed) \
+ break; \
+ } \
+ if (!failed) \
+ printk("passed\n"); \
+}
+
+#define VAL_BYTE_BYTE_BINARY(name) \
+ printk("Validating %s ... ", #name); \
+ VAL_START_BINARY(u8,u8,0xFF,0xFF,1,1) \
+ VAL_TEST_BINARY(name) \
+ VAL_FAIL_BYTE_BYTE_BINARY(name) \
+ VAL_END_BINARY()
+
+#define VAL_WORD_WORD_BINARY(name) \
+ printk("Validating %s ... ", #name); \
+ VAL_START_BINARY(u16,u16,0xFF00,0xFF00,0x100,0x100) \
+ VAL_TEST_BINARY(name) \
+ VAL_FAIL_WORD_WORD_BINARY(name) \
+ VAL_END_BINARY()
+
+#define VAL_LONG_LONG_BINARY(name) \
+ printk("Validating %s ... ", #name); \
+ VAL_START_BINARY(u32,u32,0xFF000000,0xFF000000,0x1000000,0x1000000) \
+ VAL_TEST_BINARY(name) \
+ VAL_FAIL_LONG_LONG_BINARY(name) \
+ VAL_END_BINARY()
+
+#define VAL_VOID_BYTE_BINARY(name) \
+ printk("Validating %s ... ", #name); \
+ VAL_START_BINARY(u8,u8,0xFF,0xFF,1,1) \
+ VAL_TEST_BINARY_VOID(name) \
+ VAL_FAIL_BYTE_BYTE_BINARY(name) \
+ VAL_END_BINARY()
+
+#define VAL_VOID_WORD_BINARY(name) \
+ printk("Validating %s ... ", #name); \
+ VAL_START_BINARY(u16,u16,0xFF00,0xFF00,0x100,0x100) \
+ VAL_TEST_BINARY_VOID(name) \
+ VAL_FAIL_WORD_WORD_BINARY(name) \
+ VAL_END_BINARY()
+
+#define VAL_VOID_LONG_BINARY(name) \
+ printk("Validating %s ... ", #name); \
+ VAL_START_BINARY(u32,u32,0xFF000000,0xFF000000,0x1000000,0x1000000) \
+ VAL_TEST_BINARY_VOID(name) \
+ VAL_FAIL_LONG_LONG_BINARY(name) \
+ VAL_END_BINARY()
+
+#define VAL_BYTE_ROTATE(name) \
+ printk("Validating %s ... ", #name); \
+ VAL_START_BINARY(u8,u8,0xFF,8,1,1) \
+ VAL_TEST_BINARY(name) \
+ VAL_FAIL_BYTE_BYTE_BINARY(name) \
+ VAL_END_BINARY()
+
+#define VAL_WORD_ROTATE(name) \
+ printk("Validating %s ... ", #name); \
+ VAL_START_BINARY(u16,u16,0xFF00,16,0x100,1) \
+ VAL_TEST_BINARY(name) \
+ VAL_FAIL_WORD_WORD_BINARY(name) \
+ VAL_END_BINARY()
+
+#define VAL_LONG_ROTATE(name) \
+ printk("Validating %s ... ", #name); \
+ VAL_START_BINARY(u32,u32,0xFF000000,32,0x1000000,1) \
+ VAL_TEST_BINARY(name) \
+ VAL_FAIL_LONG_LONG_BINARY(name) \
+ VAL_END_BINARY()
+
+#define VAL_START_TERNARY(parm_type,res_type,dmax,smax,dincr,sincr,maxshift)\
+{ \
+ parm_type d,s; \
+ res_type r,r_asm; \
+ u8 shift; \
+ u32 flags,inflags; \
+ int f,failed = false; \
+ char buf1[80],buf2[80]; \
+ for (d = 0; d < dmax; d += dincr) { \
+ for (s = 0; s < smax; s += sincr) { \
+ for (shift = 0; shift < maxshift; shift += 1) { \
+ M.x86.R_EFLG = inflags = flags = def_flags; \
+ for (f = 0; f < 2; f++) {
+
+#define VAL_TEST_TERNARY(name) \
+ r_asm = name##_asm(&flags,d,s,shift); \
+ r = name(d,s,shift); \
+ if (r != r_asm || M.x86.R_EFLG != flags) \
+ failed = true; \
+ if (failed || trace) {
+
+#define VAL_FAIL_WORD_WORD_TERNARY(name) \
+ if (failed) \
+ printk("fail\n"); \
+ printk("0x%04X = %-15s(0x%04X,0x%04X,%d), flags = %s -> %s\n", \
+ r, #name, d, s, shift, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
+ printk("0x%04X = %-15s(0x%04X,0x%04X,%d), flags = %s -> %s\n", \
+ r_asm, #name"_asm", d, s, shift, print_flags(buf1,inflags), print_flags(buf2,flags));
+
+#define VAL_FAIL_LONG_LONG_TERNARY(name) \
+ if (failed) \
+ printk("fail\n"); \
+ printk("0x%08X = %-15s(0x%08X,0x%08X,%d), flags = %s -> %s\n", \
+ r, #name, d, s, shift, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
+ printk("0x%08X = %-15s(0x%08X,0x%08X,%d), flags = %s -> %s\n", \
+ r_asm, #name"_asm", d, s, shift, print_flags(buf1,inflags), print_flags(buf2,flags));
+
+#define VAL_END_TERNARY() \
+ } \
+ M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \
+ if (failed) \
+ break; \
+ } \
+ if (failed) \
+ break; \
+ } \
+ if (failed) \
+ break; \
+ } \
+ if (failed) \
+ break; \
+ } \
+ if (!failed) \
+ printk("passed\n"); \
+}
+
+#define VAL_WORD_ROTATE_DBL(name) \
+ printk("Validating %s ... ", #name); \
+ VAL_START_TERNARY(u16,u16,0xFF00,0xFF00,0x100,0x100,16) \
+ VAL_TEST_TERNARY(name) \
+ VAL_FAIL_WORD_WORD_TERNARY(name) \
+ VAL_END_TERNARY()
+
+#define VAL_LONG_ROTATE_DBL(name) \
+ printk("Validating %s ... ", #name); \
+ VAL_START_TERNARY(u32,u32,0xFF000000,0xFF000000,0x1000000,0x1000000,32) \
+ VAL_TEST_TERNARY(name) \
+ VAL_FAIL_LONG_LONG_TERNARY(name) \
+ VAL_END_TERNARY()
+
+#define VAL_START_UNARY(parm_type,max,incr) \
+{ \
+ parm_type d,r,r_asm; \
+ u32 flags,inflags; \
+ int f,failed = false; \
+ char buf1[80],buf2[80]; \
+ for (d = 0; d < max; d += incr) { \
+ M.x86.R_EFLG = inflags = flags = def_flags; \
+ for (f = 0; f < 2; f++) {
+
+#define VAL_TEST_UNARY(name) \
+ r_asm = name##_asm(&flags,d); \
+ r = name(d); \
+ if (r != r_asm || M.x86.R_EFLG != flags) { \
+ failed = true;
+
+#define VAL_FAIL_BYTE_UNARY(name) \
+ printk("fail\n"); \
+ printk("0x%02X = %-15s(0x%02X), flags = %s -> %s\n", \
+ r, #name, d, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
+ printk("0x%02X = %-15s(0x%02X), flags = %s -> %s\n", \
+ r_asm, #name"_asm", d, print_flags(buf1,inflags), print_flags(buf2,flags));
+
+#define VAL_FAIL_WORD_UNARY(name) \
+ printk("fail\n"); \
+ printk("0x%04X = %-15s(0x%04X), flags = %s -> %s\n", \
+ r, #name, d, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
+ printk("0x%04X = %-15s(0x%04X), flags = %s -> %s\n", \
+ r_asm, #name"_asm", d, print_flags(buf1,inflags), print_flags(buf2,flags));
+
+#define VAL_FAIL_LONG_UNARY(name) \
+ printk("fail\n"); \
+ printk("0x%08X = %-15s(0x%08X), flags = %s -> %s\n", \
+ r, #name, d, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
+ printk("0x%08X = %-15s(0x%08X), flags = %s -> %s\n", \
+ r_asm, #name"_asm", d, print_flags(buf1,inflags), print_flags(buf2,flags));
+
+#define VAL_END_UNARY() \
+ } \
+ M.x86.R_EFLG = inflags = flags = def_flags | ALL_FLAGS; \
+ if (failed) \
+ break; \
+ } \
+ if (failed) \
+ break; \
+ } \
+ if (!failed) \
+ printk("passed\n"); \
+}
+
+#define VAL_BYTE_UNARY(name) \
+ printk("Validating %s ... ", #name); \
+ VAL_START_UNARY(u8,0xFF,0x1) \
+ VAL_TEST_UNARY(name) \
+ VAL_FAIL_BYTE_UNARY(name) \
+ VAL_END_UNARY()
+
+#define VAL_WORD_UNARY(name) \
+ printk("Validating %s ... ", #name); \
+ VAL_START_UNARY(u16,0xFF00,0x100) \
+ VAL_TEST_UNARY(name) \
+ VAL_FAIL_WORD_UNARY(name) \
+ VAL_END_UNARY()
+
+#define VAL_WORD_BYTE_UNARY(name) \
+ printk("Validating %s ... ", #name); \
+ VAL_START_UNARY(u16,0xFF,0x1) \
+ VAL_TEST_UNARY(name) \
+ VAL_FAIL_WORD_UNARY(name) \
+ VAL_END_UNARY()
+
+#define VAL_LONG_UNARY(name) \
+ printk("Validating %s ... ", #name); \
+ VAL_START_UNARY(u32,0xFF000000,0x1000000) \
+ VAL_TEST_UNARY(name) \
+ VAL_FAIL_LONG_UNARY(name) \
+ VAL_END_UNARY()
+
+#define VAL_BYTE_MUL(name) \
+ printk("Validating %s ... ", #name); \
+{ \
+ u8 d,s; \
+ u16 r,r_asm; \
+ u32 flags,inflags; \
+ int f,failed = false; \
+ char buf1[80],buf2[80]; \
+ for (d = 0; d < 0xFF; d += 1) { \
+ for (s = 0; s < 0xFF; s += 1) { \
+ M.x86.R_EFLG = inflags = flags = def_flags; \
+ for (f = 0; f < 2; f++) { \
+ name##_asm(&flags,&r_asm,d,s); \
+ M.x86.R_AL = d; \
+ name(s); \
+ r = M.x86.R_AX; \
+ if (r != r_asm || M.x86.R_EFLG != flags) \
+ failed = true; \
+ if (failed || trace) { \
+ if (failed) \
+ printk("fail\n"); \
+ printk("0x%04X = %-15s(0x%02X,0x%02X), flags = %s -> %s\n", \
+ r, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
+ printk("0x%04X = %-15s(0x%02X,0x%02X), flags = %s -> %s\n", \
+ r_asm, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags)); \
+ } \
+ M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \
+ if (failed) \
+ break; \
+ } \
+ if (failed) \
+ break; \
+ } \
+ if (failed) \
+ break; \
+ } \
+ if (!failed) \
+ printk("passed\n"); \
+}
+
+#define VAL_WORD_MUL(name) \
+ printk("Validating %s ... ", #name); \
+{ \
+ u16 d,s; \
+ u16 r_lo,r_asm_lo; \
+ u16 r_hi,r_asm_hi; \
+ u32 flags,inflags; \
+ int f,failed = false; \
+ char buf1[80],buf2[80]; \
+ for (d = 0; d < 0xFF00; d += 0x100) { \
+ for (s = 0; s < 0xFF00; s += 0x100) { \
+ M.x86.R_EFLG = inflags = flags = def_flags; \
+ for (f = 0; f < 2; f++) { \
+ name##_asm(&flags,&r_asm_lo,&r_asm_hi,d,s); \
+ M.x86.R_AX = d; \
+ name(s); \
+ r_lo = M.x86.R_AX; \
+ r_hi = M.x86.R_DX; \
+ if (r_lo != r_asm_lo || r_hi != r_asm_hi || M.x86.R_EFLG != flags)\
+ failed = true; \
+ if (failed || trace) { \
+ if (failed) \
+ printk("fail\n"); \
+ printk("0x%04X:0x%04X = %-15s(0x%04X,0x%04X), flags = %s -> %s\n", \
+ r_hi,r_lo, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
+ printk("0x%04X:0x%04X = %-15s(0x%04X,0x%04X), flags = %s -> %s\n", \
+ r_asm_hi,r_asm_lo, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags)); \
+ } \
+ M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \
+ if (failed) \
+ break; \
+ } \
+ if (failed) \
+ break; \
+ } \
+ if (failed) \
+ break; \
+ } \
+ if (!failed) \
+ printk("passed\n"); \
+}
+
+#define VAL_LONG_MUL(name) \
+ printk("Validating %s ... ", #name); \
+{ \
+ u32 d,s; \
+ u32 r_lo,r_asm_lo; \
+ u32 r_hi,r_asm_hi; \
+ u32 flags,inflags; \
+ int f,failed = false; \
+ char buf1[80],buf2[80]; \
+ for (d = 0; d < 0xFF000000; d += 0x1000000) { \
+ for (s = 0; s < 0xFF000000; s += 0x1000000) { \
+ M.x86.R_EFLG = inflags = flags = def_flags; \
+ for (f = 0; f < 2; f++) { \
+ name##_asm(&flags,&r_asm_lo,&r_asm_hi,d,s); \
+ M.x86.R_EAX = d; \
+ name(s); \
+ r_lo = M.x86.R_EAX; \
+ r_hi = M.x86.R_EDX; \
+ if (r_lo != r_asm_lo || r_hi != r_asm_hi || M.x86.R_EFLG != flags)\
+ failed = true; \
+ if (failed || trace) { \
+ if (failed) \
+ printk("fail\n"); \
+ printk("0x%08X:0x%08X = %-15s(0x%08X,0x%08X), flags = %s -> %s\n", \
+ r_hi,r_lo, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
+ printk("0x%08X:0x%08X = %-15s(0x%08X,0x%08X), flags = %s -> %s\n", \
+ r_asm_hi,r_asm_lo, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags)); \
+ } \
+ M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \
+ if (failed) \
+ break; \
+ } \
+ if (failed) \
+ break; \
+ } \
+ if (failed) \
+ break; \
+ } \
+ if (!failed) \
+ printk("passed\n"); \
+}
+
+#define VAL_BYTE_DIV(name) \
+ printk("Validating %s ... ", #name); \
+{ \
+ u16 d,s; \
+ u8 r_quot,r_rem,r_asm_quot,r_asm_rem; \
+ u32 flags,inflags; \
+ int f,failed = false; \
+ char buf1[80],buf2[80]; \
+ for (d = 0; d < 0xFF00; d += 0x100) { \
+ for (s = 1; s < 0xFF; s += 1) { \
+ M.x86.R_EFLG = inflags = flags = def_flags; \
+ for (f = 0; f < 2; f++) { \
+ M.x86.intr = 0; \
+ M.x86.R_AX = d; \
+ name(s); \
+ r_quot = M.x86.R_AL; \
+ r_rem = M.x86.R_AH; \
+ if (M.x86.intr & INTR_SYNCH) \
+ continue; \
+ name##_asm(&flags,&r_asm_quot,&r_asm_rem,d,s); \
+ if (r_quot != r_asm_quot || r_rem != r_asm_rem || M.x86.R_EFLG != flags) \
+ failed = true; \
+ if (failed || trace) { \
+ if (failed) \
+ printk("fail\n"); \
+ printk("0x%02X:0x%02X = %-15s(0x%04X,0x%02X), flags = %s -> %s\n", \
+ r_quot, r_rem, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
+ printk("0x%02X:0x%02X = %-15s(0x%04X,0x%02X), flags = %s -> %s\n", \
+ r_asm_quot, r_asm_rem, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags)); \
+ } \
+ M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \
+ if (failed) \
+ break; \
+ } \
+ if (failed) \
+ break; \
+ } \
+ if (failed) \
+ break; \
+ } \
+ if (!failed) \
+ printk("passed\n"); \
+}
+
+#define VAL_WORD_DIV(name) \
+ printk("Validating %s ... ", #name); \
+{ \
+ u32 d,s; \
+ u16 r_quot,r_rem,r_asm_quot,r_asm_rem; \
+ u32 flags,inflags; \
+ int f,failed = false; \
+ char buf1[80],buf2[80]; \
+ for (d = 0; d < 0xFF000000; d += 0x1000000) { \
+ for (s = 0x100; s < 0xFF00; s += 0x100) { \
+ M.x86.R_EFLG = inflags = flags = def_flags; \
+ for (f = 0; f < 2; f++) { \
+ M.x86.intr = 0; \
+ M.x86.R_AX = d & 0xFFFF; \
+ M.x86.R_DX = d >> 16; \
+ name(s); \
+ r_quot = M.x86.R_AX; \
+ r_rem = M.x86.R_DX; \
+ if (M.x86.intr & INTR_SYNCH) \
+ continue; \
+ name##_asm(&flags,&r_asm_quot,&r_asm_rem,d & 0xFFFF,d >> 16,s);\
+ if (r_quot != r_asm_quot || r_rem != r_asm_rem || M.x86.R_EFLG != flags) \
+ failed = true; \
+ if (failed || trace) { \
+ if (failed) \
+ printk("fail\n"); \
+ printk("0x%04X:0x%04X = %-15s(0x%08X,0x%04X), flags = %s -> %s\n", \
+ r_quot, r_rem, #name, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
+ printk("0x%04X:0x%04X = %-15s(0x%08X,0x%04X), flags = %s -> %s\n", \
+ r_asm_quot, r_asm_rem, #name"_asm", d, s, print_flags(buf1,inflags), print_flags(buf2,flags)); \
+ } \
+ M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \
+ if (failed) \
+ break; \
+ } \
+ if (failed) \
+ break; \
+ } \
+ if (failed) \
+ break; \
+ } \
+ if (!failed) \
+ printk("passed\n"); \
+}
+
+#define VAL_LONG_DIV(name) \
+ printk("Validating %s ... ", #name); \
+{ \
+ u32 d,s; \
+ u32 r_quot,r_rem,r_asm_quot,r_asm_rem; \
+ u32 flags,inflags; \
+ int f,failed = false; \
+ char buf1[80],buf2[80]; \
+ for (d = 0; d < 0xFF000000; d += 0x1000000) { \
+ for (s = 0x100; s < 0xFF00; s += 0x100) { \
+ M.x86.R_EFLG = inflags = flags = def_flags; \
+ for (f = 0; f < 2; f++) { \
+ M.x86.intr = 0; \
+ M.x86.R_EAX = d; \
+ M.x86.R_EDX = 0; \
+ name(s); \
+ r_quot = M.x86.R_EAX; \
+ r_rem = M.x86.R_EDX; \
+ if (M.x86.intr & INTR_SYNCH) \
+ continue; \
+ name##_asm(&flags,&r_asm_quot,&r_asm_rem,d,0,s); \
+ if (r_quot != r_asm_quot || r_rem != r_asm_rem || M.x86.R_EFLG != flags) \
+ failed = true; \
+ if (failed || trace) { \
+ if (failed) \
+ printk("fail\n"); \
+ printk("0x%08X:0x%08X = %-15s(0x%08X:0x%08X,0x%08X), flags = %s -> %s\n", \
+ r_quot, r_rem, #name, 0, d, s, print_flags(buf1,inflags), print_flags(buf2,M.x86.R_EFLG)); \
+ printk("0x%08X:0x%08X = %-15s(0x%08X:0x%08X,0x%08X), flags = %s -> %s\n", \
+ r_asm_quot, r_asm_rem, #name"_asm", 0, d, s, print_flags(buf1,inflags), print_flags(buf2,flags)); \
+ } \
+ M.x86.R_EFLG = inflags = flags = def_flags | (ALL_FLAGS & ~F_OF); \
+ if (failed) \
+ break; \
+ } \
+ if (failed) \
+ break; \
+ } \
+ if (failed) \
+ break; \
+ } \
+ if (!failed) \
+ printk("passed\n"); \
+}
+
+void printk(const char *fmt, ...)
+{
+ va_list argptr;
+ va_start(argptr, fmt);
+ vfprintf(stdout, fmt, argptr);
+ fflush(stdout);
+ va_end(argptr);
+}
+
+char * print_flags(char *buf,ulong flags)
+{
+ char *separator = "";
+
+ buf[0] = 0;
+ if (flags & F_CF) {
+ strcat(buf,separator);
+ strcat(buf,"CF");
+ separator = ",";
+ }
+ if (flags & F_PF) {
+ strcat(buf,separator);
+ strcat(buf,"PF");
+ separator = ",";
+ }
+ if (flags & F_AF) {
+ strcat(buf,separator);
+ strcat(buf,"AF");
+ separator = ",";
+ }
+ if (flags & F_ZF) {
+ strcat(buf,separator);
+ strcat(buf,"ZF");
+ separator = ",";
+ }
+ if (flags & F_SF) {
+ strcat(buf,separator);
+ strcat(buf,"SF");
+ separator = ",";
+ }
+ if (flags & F_OF) {
+ strcat(buf,separator);
+ strcat(buf,"OF");
+ separator = ",";
+ }
+ if (separator[0] == 0)
+ strcpy(buf,"None");
+ return buf;
+}
+
+int main(int argc)
+{
+ ulong def_flags;
+ int trace = false;
+
+ if (argc > 1)
+ trace = true;
+ memset(&M, 0, sizeof(M));
+ def_flags = get_flags_asm() & ~ALL_FLAGS;
+
+ VAL_WORD_UNARY(aaa_word);
+ VAL_WORD_UNARY(aas_word);
+
+ VAL_WORD_UNARY(aad_word);
+ VAL_WORD_UNARY(aam_word);
+
+ VAL_BYTE_BYTE_BINARY(adc_byte);
+ VAL_WORD_WORD_BINARY(adc_word);
+ VAL_LONG_LONG_BINARY(adc_long);
+
+ VAL_BYTE_BYTE_BINARY(add_byte);
+ VAL_WORD_WORD_BINARY(add_word);
+ VAL_LONG_LONG_BINARY(add_long);
+
+ VAL_BYTE_BYTE_BINARY(and_byte);
+ VAL_WORD_WORD_BINARY(and_word);
+ VAL_LONG_LONG_BINARY(and_long);
+
+ VAL_BYTE_BYTE_BINARY(cmp_byte);
+ VAL_WORD_WORD_BINARY(cmp_word);
+ VAL_LONG_LONG_BINARY(cmp_long);
+
+ VAL_BYTE_UNARY(daa_byte);
+ VAL_BYTE_UNARY(das_byte); // Fails for 0x9A (out of range anyway)
+
+ VAL_BYTE_UNARY(dec_byte);
+ VAL_WORD_UNARY(dec_word);
+ VAL_LONG_UNARY(dec_long);
+
+ VAL_BYTE_UNARY(inc_byte);
+ VAL_WORD_UNARY(inc_word);
+ VAL_LONG_UNARY(inc_long);
+
+ VAL_BYTE_BYTE_BINARY(or_byte);
+ VAL_WORD_WORD_BINARY(or_word);
+ VAL_LONG_LONG_BINARY(or_long);
+
+ VAL_BYTE_UNARY(neg_byte);
+ VAL_WORD_UNARY(neg_word);
+ VAL_LONG_UNARY(neg_long);
+
+ VAL_BYTE_UNARY(not_byte);
+ VAL_WORD_UNARY(not_word);
+ VAL_LONG_UNARY(not_long);
+
+ VAL_BYTE_ROTATE(rcl_byte);
+ VAL_WORD_ROTATE(rcl_word);
+ VAL_LONG_ROTATE(rcl_long);
+
+ VAL_BYTE_ROTATE(rcr_byte);
+ VAL_WORD_ROTATE(rcr_word);
+ VAL_LONG_ROTATE(rcr_long);
+
+ VAL_BYTE_ROTATE(rol_byte);
+ VAL_WORD_ROTATE(rol_word);
+ VAL_LONG_ROTATE(rol_long);
+
+ VAL_BYTE_ROTATE(ror_byte);
+ VAL_WORD_ROTATE(ror_word);
+ VAL_LONG_ROTATE(ror_long);
+
+ VAL_BYTE_ROTATE(shl_byte);
+ VAL_WORD_ROTATE(shl_word);
+ VAL_LONG_ROTATE(shl_long);
+
+ VAL_BYTE_ROTATE(shr_byte);
+ VAL_WORD_ROTATE(shr_word);
+ VAL_LONG_ROTATE(shr_long);
+
+ VAL_BYTE_ROTATE(sar_byte);
+ VAL_WORD_ROTATE(sar_word);
+ VAL_LONG_ROTATE(sar_long);
+
+ VAL_WORD_ROTATE_DBL(shld_word);
+ VAL_LONG_ROTATE_DBL(shld_long);
+
+ VAL_WORD_ROTATE_DBL(shrd_word);
+ VAL_LONG_ROTATE_DBL(shrd_long);
+
+ VAL_BYTE_BYTE_BINARY(sbb_byte);
+ VAL_WORD_WORD_BINARY(sbb_word);
+ VAL_LONG_LONG_BINARY(sbb_long);
+
+ VAL_BYTE_BYTE_BINARY(sub_byte);
+ VAL_WORD_WORD_BINARY(sub_word);
+ VAL_LONG_LONG_BINARY(sub_long);
+
+ VAL_BYTE_BYTE_BINARY(xor_byte);
+ VAL_WORD_WORD_BINARY(xor_word);
+ VAL_LONG_LONG_BINARY(xor_long);
+
+ VAL_VOID_BYTE_BINARY(test_byte);
+ VAL_VOID_WORD_BINARY(test_word);
+ VAL_VOID_LONG_BINARY(test_long);
+
+ VAL_BYTE_MUL(imul_byte);
+ VAL_WORD_MUL(imul_word);
+ VAL_LONG_MUL(imul_long);
+
+ VAL_BYTE_MUL(mul_byte);
+ VAL_WORD_MUL(mul_word);
+ VAL_LONG_MUL(mul_long);
+
+ VAL_BYTE_DIV(idiv_byte);
+ VAL_WORD_DIV(idiv_word);
+ VAL_LONG_DIV(idiv_long);
+
+ VAL_BYTE_DIV(div_byte);
+ VAL_WORD_DIV(div_word);
+ VAL_LONG_DIV(div_long);
+
+ return 0;
+}
diff --git a/cfe/cfe/x86emu/x86emu.h b/cfe/cfe/x86emu/x86emu.h
new file mode 100644
index 0000000..7c7d367
--- /dev/null
+++ b/cfe/cfe/x86emu/x86emu.h
@@ -0,0 +1,198 @@
+/****************************************************************************
+*
+* Realmode X86 Emulator Library
+*
+* Copyright (C) 1996-1999 SciTech Software, Inc.
+* Copyright (C) David Mosberger-Tang
+* Copyright (C) 1999 Egbert Eich
+*
+* ========================================================================
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee,
+* provided that the above copyright notice appear in all copies and that
+* both that copyright notice and this permission notice appear in
+* supporting documentation, and that the name of the authors not be used
+* in advertising or publicity pertaining to distribution of the software
+* without specific, written prior permission. The authors makes no
+* representations about the suitability of this software for any purpose.
+* It is provided "as is" without express or implied warranty.
+*
+* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+* PERFORMANCE OF THIS SOFTWARE.
+*
+* ========================================================================
+*
+* Language: ANSI C
+* Environment: Any
+* Developer: Kendall Bennett
+*
+* Description: Header file for public specific functions.
+* Any application linking against us should only
+* include this header
+*
+****************************************************************************/
+/* $XFree86: xc/extras/x86emu/include/x86emu.h,v 1.2 2000/11/21 23:10:25 tsi Exp $ */
+
+#ifndef __X86EMU_X86EMU_H
+#define __X86EMU_X86EMU_H
+
+#ifdef SCITECH
+#include "scitech.h"
+#define X86API _ASMAPI
+#define X86APIP _ASMAPIP
+typedef int X86EMU_pioAddr;
+#else
+#include "x86emu/types.h"
+#define X86API
+#define X86APIP *
+#endif
+#include "x86emu/regs.h"
+
+/*---------------------- Macros and type definitions ----------------------*/
+
+#ifndef __mips
+#pragma pack(1)
+#endif
+
+/****************************************************************************
+REMARKS:
+Data structure containing ponters to programmed I/O functions used by the
+emulator. This is used so that the user program can hook all programmed
+I/O for the emulator to handled as necessary by the user program. By
+default the emulator contains simple functions that do not do access the
+hardware in any way. To allow the emualtor access the hardware, you will
+need to override the programmed I/O functions using the X86EMU_setupPioFuncs
+function.
+
+HEADER:
+x86emu.h
+
+MEMBERS:
+inb - Function to read a byte from an I/O port
+inw - Function to read a word from an I/O port
+inl - Function to read a dword from an I/O port
+outb - Function to write a byte to an I/O port
+outw - Function to write a word to an I/O port
+outl - Function to write a dword to an I/O port
+****************************************************************************/
+typedef struct {
+ u8 (X86APIP inb)(X86EMU_pioAddr addr);
+ u16 (X86APIP inw)(X86EMU_pioAddr addr);
+ u32 (X86APIP inl)(X86EMU_pioAddr addr);
+ void (X86APIP outb)(X86EMU_pioAddr addr, u8 val);
+ void (X86APIP outw)(X86EMU_pioAddr addr, u16 val);
+ void (X86APIP outl)(X86EMU_pioAddr addr, u32 val);
+ } X86EMU_pioFuncs;
+
+/****************************************************************************
+REMARKS:
+Data structure containing ponters to memory access functions used by the
+emulator. This is used so that the user program can hook all memory
+access functions as necessary for the emulator. By default the emulator
+contains simple functions that only access the internal memory of the
+emulator. If you need specialised functions to handle access to different
+types of memory (ie: hardware framebuffer accesses and BIOS memory access
+etc), you will need to override this using the X86EMU_setupMemFuncs
+function.
+
+HEADER:
+x86emu.h
+
+MEMBERS:
+rdb - Function to read a byte from an address
+rdw - Function to read a word from an address
+rdl - Function to read a dword from an address
+wrb - Function to write a byte to an address
+wrw - Function to write a word to an address
+wrl - Function to write a dword to an address
+****************************************************************************/
+typedef struct {
+ u8 (X86APIP rdb)(u32 addr);
+ u16 (X86APIP rdw)(u32 addr);
+ u32 (X86APIP rdl)(u32 addr);
+ void (X86APIP wrb)(u32 addr, u8 val);
+ void (X86APIP wrw)(u32 addr, u16 val);
+ void (X86APIP wrl)(u32 addr, u32 val);
+ } X86EMU_memFuncs;
+
+/****************************************************************************
+ Here are the default memory read and write
+ function in case they are needed as fallbacks.
+***************************************************************************/
+extern u8 X86API rdb(u32 addr);
+extern u16 X86API rdw(u32 addr);
+extern u32 X86API rdl(u32 addr);
+extern void X86API wrb(u32 addr, u8 val);
+extern void X86API wrw(u32 addr, u16 val);
+extern void X86API wrl(u32 addr, u32 val);
+
+#ifndef __mips
+#pragma pack()
+#endif
+
+/*--------------------- type definitions -----------------------------------*/
+
+typedef void (X86APIP X86EMU_intrFuncs)(int num);
+extern X86EMU_intrFuncs _X86EMU_intrTab[256];
+
+/*-------------------------- Function Prototypes --------------------------*/
+
+#ifdef __cplusplus
+extern "C" { /* Use "C" linkage when in C++ mode */
+#endif
+
+void X86EMU_setupMemFuncs(X86EMU_memFuncs *funcs);
+void X86EMU_setupPioFuncs(X86EMU_pioFuncs *funcs);
+void X86EMU_setupIntrFuncs(X86EMU_intrFuncs funcs[]);
+void X86EMU_prepareForInt(int num);
+
+/* decode.c */
+
+void X86EMU_exec(void);
+void X86EMU_halt_sys(void);
+
+#ifdef DEBUG
+#define HALT_SYS() \
+ printk("halt_sys: file %s, line %d\n", __FILE__, __LINE__), \
+ X86EMU_halt_sys()
+#else
+#define HALT_SYS() X86EMU_halt_sys()
+#endif
+
+/* Debug options */
+
+#define DEBUG_DECODE_F 0x000001 /* print decoded instruction */
+#define DEBUG_TRACE_F 0x000002 /* dump regs before/after execution */
+#define DEBUG_STEP_F 0x000004
+#define DEBUG_DISASSEMBLE_F 0x000008
+#define DEBUG_BREAK_F 0x000010
+#define DEBUG_SVC_F 0x000020
+#define DEBUG_FS_F 0x000080
+#define DEBUG_PROC_F 0x000100
+#define DEBUG_SYSINT_F 0x000200 /* bios system interrupts. */
+#define DEBUG_TRACECALL_F 0x000400
+#define DEBUG_INSTRUMENT_F 0x000800
+#define DEBUG_MEM_TRACE_F 0x001000
+#define DEBUG_IO_TRACE_F 0x002000
+#define DEBUG_TRACECALL_REGS_F 0x004000
+#define DEBUG_DECODE_NOPRINT_F 0x008000
+#define DEBUG_SAVE_IP_CS_F 0x010000
+#define DEBUG_SYS_F (DEBUG_SVC_F|DEBUG_FS_F|DEBUG_PROC_F)
+
+void X86EMU_trace_regs(void);
+void X86EMU_trace_xregs(void);
+void X86EMU_dump_memory(u16 seg, u16 off, u32 amt);
+int X86EMU_trace_on(void);
+int X86EMU_trace_off(void);
+
+#ifdef __cplusplus
+} /* End of "C" linkage for C++ */
+#endif
+
+#endif /* __X86EMU_X86EMU_H */
diff --git a/cfe/cfe/x86emu/x86emu/debug.h b/cfe/cfe/x86emu/x86emu/debug.h
new file mode 100644
index 0000000..45271c9
--- /dev/null
+++ b/cfe/cfe/x86emu/x86emu/debug.h
@@ -0,0 +1,212 @@
+/****************************************************************************
+*
+* Realmode X86 Emulator Library
+*
+* Copyright (C) 1996-1999 SciTech Software, Inc.
+* Copyright (C) David Mosberger-Tang
+* Copyright (C) 1999 Egbert Eich
+*
+* ========================================================================
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee,
+* provided that the above copyright notice appear in all copies and that
+* both that copyright notice and this permission notice appear in
+* supporting documentation, and that the name of the authors not be used
+* in advertising or publicity pertaining to distribution of the software
+* without specific, written prior permission. The authors makes no
+* representations about the suitability of this software for any purpose.
+* It is provided "as is" without express or implied warranty.
+*
+* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+* PERFORMANCE OF THIS SOFTWARE.
+*
+* ========================================================================
+*
+* Language: ANSI C
+* Environment: Any
+* Developer: Kendall Bennett
+*
+* Description: Header file for debug definitions.
+*
+****************************************************************************/
+/* $XFree86: xc/extras/x86emu/src/x86emu/x86emu/debug.h,v 1.4 2000/11/21 23:10:27 tsi Exp $ */
+
+#ifndef __X86EMU_DEBUG_H
+#define __X86EMU_DEBUG_H
+
+/*---------------------- Macros and type definitions ----------------------*/
+
+/* checks to be enabled for "runtime" */
+
+#define CHECK_IP_FETCH_F 0x1
+#define CHECK_SP_ACCESS_F 0x2
+#define CHECK_MEM_ACCESS_F 0x4 /*using regular linear pointer */
+#define CHECK_DATA_ACCESS_F 0x8 /*using segment:offset*/
+
+#ifdef DEBUG
+# define CHECK_IP_FETCH() (M.x86.check & CHECK_IP_FETCH_F)
+# define CHECK_SP_ACCESS() (M.x86.check & CHECK_SP_ACCESS_F)
+# define CHECK_MEM_ACCESS() (M.x86.check & CHECK_MEM_ACCESS_F)
+# define CHECK_DATA_ACCESS() (M.x86.check & CHECK_DATA_ACCESS_F)
+#else
+# define CHECK_IP_FETCH()
+# define CHECK_SP_ACCESS()
+# define CHECK_MEM_ACCESS()
+# define CHECK_DATA_ACCESS()
+#endif
+
+#ifdef DEBUG
+# define DEBUG_INSTRUMENT() (M.x86.debug & DEBUG_INSTRUMENT_F)
+# define DEBUG_DECODE() (M.x86.debug & DEBUG_DECODE_F)
+# define DEBUG_TRACE() (M.x86.debug & DEBUG_TRACE_F)
+# define DEBUG_STEP() (M.x86.debug & DEBUG_STEP_F)
+# define DEBUG_DISASSEMBLE() (M.x86.debug & DEBUG_DISASSEMBLE_F)
+# define DEBUG_BREAK() (M.x86.debug & DEBUG_BREAK_F)
+# define DEBUG_SVC() (M.x86.debug & DEBUG_SVC_F)
+# define DEBUG_SAVE_IP_CS() (M.x86.debug & DEBUG_SAVE_IP_CS_F)
+
+# define DEBUG_FS() (M.x86.debug & DEBUG_FS_F)
+# define DEBUG_PROC() (M.x86.debug & DEBUG_PROC_F)
+# define DEBUG_SYSINT() (M.x86.debug & DEBUG_SYSINT_F)
+# define DEBUG_TRACECALL() (M.x86.debug & DEBUG_TRACECALL_F)
+# define DEBUG_TRACECALLREGS() (M.x86.debug & DEBUG_TRACECALL_REGS_F)
+# define DEBUG_SYS() (M.x86.debug & DEBUG_SYS_F)
+# define DEBUG_MEM_TRACE() (M.x86.debug & DEBUG_MEM_TRACE_F)
+# define DEBUG_IO_TRACE() (M.x86.debug & DEBUG_IO_TRACE_F)
+# define DEBUG_DECODE_NOPRINT() (M.x86.debug & DEBUG_DECODE_NOPRINT_F)
+#else
+# define DEBUG_INSTRUMENT() 0
+# define DEBUG_DECODE() 0
+# define DEBUG_TRACE() 0
+# define DEBUG_STEP() 0
+# define DEBUG_DISASSEMBLE() 0
+# define DEBUG_BREAK() 0
+# define DEBUG_SVC() 0
+# define DEBUG_SAVE_IP_CS() 0
+# define DEBUG_FS() 0
+# define DEBUG_PROC() 0
+# define DEBUG_SYSINT() 0
+# define DEBUG_TRACECALL() 0
+# define DEBUG_TRACECALLREGS() 0
+# define DEBUG_SYS() 0
+# define DEBUG_MEM_TRACE() 0
+# define DEBUG_IO_TRACE() 0
+# define DEBUG_DECODE_NOPRINT() 0
+#endif
+
+#ifdef DEBUG
+
+# define DECODE_PRINTF(x) if (DEBUG_DECODE()) \
+ x86emu_decode_printf(x)
+# define DECODE_PRINTF2(x,y) if (DEBUG_DECODE()) \
+ x86emu_decode_printf2(x,y)
+
+/*
+ * The following allow us to look at the bytes of an instruction. The
+ * first INCR_INSTRN_LEN, is called everytime bytes are consumed in
+ * the decoding process. The SAVE_IP_CS is called initially when the
+ * major opcode of the instruction is accessed.
+ */
+#define INC_DECODED_INST_LEN(x) \
+ if (DEBUG_DECODE()) \
+ x86emu_inc_decoded_inst_len(x)
+
+#define SAVE_IP_CS(x,y) \
+ if (DEBUG_DECODE() | DEBUG_TRACECALL() | DEBUG_BREAK() \
+ | DEBUG_IO_TRACE() | DEBUG_SAVE_IP_CS()) { \
+ M.x86.saved_cs = x; \
+ M.x86.saved_ip = y; \
+ }
+#else
+# define INC_DECODED_INST_LEN(x)
+# define DECODE_PRINTF(x)
+# define DECODE_PRINTF2(x,y)
+# define SAVE_IP_CS(x,y)
+#endif
+
+#ifdef DEBUG
+#define TRACE_REGS() \
+ if (DEBUG_DISASSEMBLE()) { \
+ x86emu_just_disassemble(); \
+ goto EndOfTheInstructionProcedure; \
+ } \
+ if (DEBUG_TRACE() || DEBUG_DECODE()) X86EMU_trace_regs()
+#else
+# define TRACE_REGS()
+#endif
+
+#ifdef DEBUG
+# define SINGLE_STEP() if (DEBUG_STEP()) x86emu_single_step()
+#else
+# define SINGLE_STEP()
+#endif
+
+#define TRACE_AND_STEP() \
+ TRACE_REGS(); \
+ SINGLE_STEP()
+
+#ifdef DEBUG
+# define START_OF_INSTR()
+# define END_OF_INSTR() EndOfTheInstructionProcedure: x86emu_end_instr();
+# define END_OF_INSTR_NO_TRACE() x86emu_end_instr();
+#else
+# define START_OF_INSTR()
+# define END_OF_INSTR()
+# define END_OF_INSTR_NO_TRACE()
+#endif
+
+#ifdef DEBUG
+# define CALL_TRACE(u,v,w,x,s) \
+ if (DEBUG_TRACECALLREGS()) \
+ x86emu_dump_regs(); \
+ if (DEBUG_TRACECALL()) \
+ printk("%04x:%04x: CALL %s%04x:%04x\n", u , v, s, w, x);
+# define RETURN_TRACE(n,u,v) \
+ if (DEBUG_TRACECALLREGS()) \
+ x86emu_dump_regs(); \
+ if (DEBUG_TRACECALL()) \
+ printk("%04x:%04x: %s\n",u,v,n);
+#else
+# define CALL_TRACE(u,v,w,x,s)
+# define RETURN_TRACE(n,u,v)
+#endif
+
+#ifdef DEBUG
+#define DB(x) x
+#else
+#define DB(x)
+#endif
+
+/*-------------------------- Function Prototypes --------------------------*/
+
+#ifdef __cplusplus
+extern "C" { /* Use "C" linkage when in C++ mode */
+#endif
+
+extern void x86emu_inc_decoded_inst_len (int x);
+extern void x86emu_decode_printf (char *x);
+extern void x86emu_decode_printf2 (char *x, int y);
+extern void x86emu_just_disassemble (void);
+extern void x86emu_single_step (void);
+extern void x86emu_end_instr (void);
+extern void x86emu_dump_regs (void);
+extern void x86emu_dump_xregs (void);
+extern void x86emu_print_int_vect (u16 iv);
+extern void x86emu_instrument_instruction (void);
+extern void x86emu_check_ip_access (void);
+extern void x86emu_check_sp_access (void);
+extern void x86emu_check_mem_access (u32 p);
+extern void x86emu_check_data_access (uint s, uint o);
+
+#ifdef __cplusplus
+} /* End of "C" linkage for C++ */
+#endif
+
+
+#endif /* __X86EMU_DEBUG_H */
diff --git a/cfe/cfe/x86emu/x86emu/decode.h b/cfe/cfe/x86emu/x86emu/decode.h
new file mode 100644
index 0000000..321a345
--- /dev/null
+++ b/cfe/cfe/x86emu/x86emu/decode.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+*
+* Realmode X86 Emulator Library
+*
+* Copyright (C) 1996-1999 SciTech Software, Inc.
+* Copyright (C) David Mosberger-Tang
+* Copyright (C) 1999 Egbert Eich
+*
+* ========================================================================
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee,
+* provided that the above copyright notice appear in all copies and that
+* both that copyright notice and this permission notice appear in
+* supporting documentation, and that the name of the authors not be used
+* in advertising or publicity pertaining to distribution of the software
+* without specific, written prior permission. The authors makes no
+* representations about the suitability of this software for any purpose.
+* It is provided "as is" without express or implied warranty.
+*
+* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+* PERFORMANCE OF THIS SOFTWARE.
+*
+* ========================================================================
+*
+* Language: ANSI C
+* Environment: Any
+* Developer: Kendall Bennett
+*
+* Description: Header file for instruction decoding logic.
+*
+****************************************************************************/
+
+#ifndef __X86EMU_DECODE_H
+#define __X86EMU_DECODE_H
+
+/*---------------------- Macros and type definitions ----------------------*/
+
+/* Instruction Decoding Stuff */
+
+#define FETCH_DECODE_MODRM(mod,rh,rl) fetch_decode_modrm(&mod,&rh,&rl)
+#define DECODE_RM_BYTE_REGISTER(r) decode_rm_byte_register(r)
+#define DECODE_RM_WORD_REGISTER(r) decode_rm_word_register(r)
+#define DECODE_RM_LONG_REGISTER(r) decode_rm_long_register(r)
+#define DECODE_CLEAR_SEGOVR() M.x86.mode &= ~SYSMODE_CLRMASK
+
+/*-------------------------- Function Prototypes --------------------------*/
+
+#ifdef __cplusplus
+extern "C" { /* Use "C" linkage when in C++ mode */
+#endif
+
+void x86emu_intr_raise (u8 type);
+void fetch_decode_modrm (int *mod,int *regh,int *regl);
+u8 fetch_byte_imm (void);
+u16 fetch_word_imm (void);
+u32 fetch_long_imm (void);
+u8 fetch_data_byte (uint offset);
+u8 fetch_data_byte_abs (uint segment, uint offset);
+u16 fetch_data_word (uint offset);
+u16 fetch_data_word_abs (uint segment, uint offset);
+u32 fetch_data_long (uint offset);
+u32 fetch_data_long_abs (uint segment, uint offset);
+void store_data_byte (uint offset, u8 val);
+void store_data_byte_abs (uint segment, uint offset, u8 val);
+void store_data_word (uint offset, u16 val);
+void store_data_word_abs (uint segment, uint offset, u16 val);
+void store_data_long (uint offset, u32 val);
+void store_data_long_abs (uint segment, uint offset, u32 val);
+u8* decode_rm_byte_register(int reg);
+u16* decode_rm_word_register(int reg);
+u32* decode_rm_long_register(int reg);
+u16* decode_rm_seg_register(int reg);
+unsigned decode_rm00_address(int rm);
+unsigned decode_rm01_address(int rm);
+unsigned decode_rm10_address(int rm);
+
+#ifdef __cplusplus
+} /* End of "C" linkage for C++ */
+#endif
+
+#endif /* __X86EMU_DECODE_H */
diff --git a/cfe/cfe/x86emu/x86emu/fpu.h b/cfe/cfe/x86emu/x86emu/fpu.h
new file mode 100644
index 0000000..5fb2714
--- /dev/null
+++ b/cfe/cfe/x86emu/x86emu/fpu.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+*
+* Realmode X86 Emulator Library
+*
+* Copyright (C) 1996-1999 SciTech Software, Inc.
+* Copyright (C) David Mosberger-Tang
+* Copyright (C) 1999 Egbert Eich
+*
+* ========================================================================
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee,
+* provided that the above copyright notice appear in all copies and that
+* both that copyright notice and this permission notice appear in
+* supporting documentation, and that the name of the authors not be used
+* in advertising or publicity pertaining to distribution of the software
+* without specific, written prior permission. The authors makes no
+* representations about the suitability of this software for any purpose.
+* It is provided "as is" without express or implied warranty.
+*
+* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+* PERFORMANCE OF THIS SOFTWARE.
+*
+* ========================================================================
+*
+* Language: ANSI C
+* Environment: Any
+* Developer: Kendall Bennett
+*
+* Description: Header file for FPU instruction decoding.
+*
+****************************************************************************/
+
+#ifndef __X86EMU_FPU_H
+#define __X86EMU_FPU_H
+
+#ifdef __cplusplus
+extern "C" { /* Use "C" linkage when in C++ mode */
+#endif
+
+/* these have to be defined, whether 8087 support compiled in or not. */
+
+extern void x86emuOp_esc_coprocess_d8 (u8 op1);
+extern void x86emuOp_esc_coprocess_d9 (u8 op1);
+extern void x86emuOp_esc_coprocess_da (u8 op1);
+extern void x86emuOp_esc_coprocess_db (u8 op1);
+extern void x86emuOp_esc_coprocess_dc (u8 op1);
+extern void x86emuOp_esc_coprocess_dd (u8 op1);
+extern void x86emuOp_esc_coprocess_de (u8 op1);
+extern void x86emuOp_esc_coprocess_df (u8 op1);
+
+#ifdef __cplusplus
+} /* End of "C" linkage for C++ */
+#endif
+
+#endif /* __X86EMU_FPU_H */
diff --git a/cfe/cfe/x86emu/x86emu/fpu_regs.h b/cfe/cfe/x86emu/x86emu/fpu_regs.h
new file mode 100644
index 0000000..56e9a04
--- /dev/null
+++ b/cfe/cfe/x86emu/x86emu/fpu_regs.h
@@ -0,0 +1,115 @@
+/****************************************************************************
+*
+* Realmode X86 Emulator Library
+*
+* Copyright (C) 1996-1999 SciTech Software, Inc.
+* Copyright (C) David Mosberger-Tang
+* Copyright (C) 1999 Egbert Eich
+*
+* ========================================================================
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee,
+* provided that the above copyright notice appear in all copies and that
+* both that copyright notice and this permission notice appear in
+* supporting documentation, and that the name of the authors not be used
+* in advertising or publicity pertaining to distribution of the software
+* without specific, written prior permission. The authors makes no
+* representations about the suitability of this software for any purpose.
+* It is provided "as is" without express or implied warranty.
+*
+* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+* PERFORMANCE OF THIS SOFTWARE.
+*
+* ========================================================================
+*
+* Language: ANSI C
+* Environment: Any
+* Developer: Kendall Bennett
+*
+* Description: Header file for FPU register definitions.
+*
+****************************************************************************/
+
+#ifndef __X86EMU_FPU_REGS_H
+#define __X86EMU_FPU_REGS_H
+
+#ifdef X86_FPU_SUPPORT
+
+#pragma pack(1)
+
+/* Basic 8087 register can hold any of the following values: */
+
+union x86_fpu_reg_u {
+ s8 tenbytes[10];
+ double dval;
+ float fval;
+ s16 sval;
+ s32 lval;
+ };
+
+struct x86_fpu_reg {
+ union x86_fpu_reg_u reg;
+ char tag;
+ };
+
+/*
+ * Since we are not going to worry about the problems of aliasing
+ * registers, every time a register is modified, its result type is
+ * set in the tag fields for that register. If some operation
+ * attempts to access the type in a way inconsistent with its current
+ * storage format, then we flag the operation. If common, we'll
+ * attempt the conversion.
+ */
+
+#define X86_FPU_VALID 0x80
+#define X86_FPU_REGTYP(r) ((r) & 0x7F)
+
+#define X86_FPU_WORD 0x0
+#define X86_FPU_SHORT 0x1
+#define X86_FPU_LONG 0x2
+#define X86_FPU_FLOAT 0x3
+#define X86_FPU_DOUBLE 0x4
+#define X86_FPU_LDBL 0x5
+#define X86_FPU_BSD 0x6
+
+#define X86_FPU_STKTOP 0
+
+struct x86_fpu_registers {
+ struct x86_fpu_reg x86_fpu_stack[8];
+ int x86_fpu_flags;
+ int x86_fpu_config; /* rounding modes, etc. */
+ short x86_fpu_tos, x86_fpu_bos;
+ };
+
+#pragma pack()
+
+/*
+ * There are two versions of the following macro.
+ *
+ * One version is for opcode D9, for which there are more than 32
+ * instructions encoded in the second byte of the opcode.
+ *
+ * The other version, deals with all the other 7 i87 opcodes, for
+ * which there are only 32 strings needed to describe the
+ * instructions.
+ */
+
+#endif /* X86_FPU_SUPPORT */
+
+#ifdef DEBUG
+# define DECODE_PRINTINSTR32(t,mod,rh,rl) \
+ DECODE_PRINTF(t[(mod<<3)+(rh)]);
+# define DECODE_PRINTINSTR256(t,mod,rh,rl) \
+ DECODE_PRINTF(t[(mod<<6)+(rh<<3)+(rl)]);
+#else
+# define DECODE_PRINTINSTR32(t,mod,rh,rl)
+# define DECODE_PRINTINSTR256(t,mod,rh,rl)
+#endif
+
+#endif /* __X86EMU_FPU_REGS_H */
diff --git a/cfe/cfe/x86emu/x86emu/ops.h b/cfe/cfe/x86emu/x86emu/ops.h
new file mode 100644
index 0000000..65ea676
--- /dev/null
+++ b/cfe/cfe/x86emu/x86emu/ops.h
@@ -0,0 +1,45 @@
+/****************************************************************************
+*
+* Realmode X86 Emulator Library
+*
+* Copyright (C) 1996-1999 SciTech Software, Inc.
+* Copyright (C) David Mosberger-Tang
+* Copyright (C) 1999 Egbert Eich
+*
+* ========================================================================
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee,
+* provided that the above copyright notice appear in all copies and that
+* both that copyright notice and this permission notice appear in
+* supporting documentation, and that the name of the authors not be used
+* in advertising or publicity pertaining to distribution of the software
+* without specific, written prior permission. The authors makes no
+* representations about the suitability of this software for any purpose.
+* It is provided "as is" without express or implied warranty.
+*
+* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+* PERFORMANCE OF THIS SOFTWARE.
+*
+* ========================================================================
+*
+* Language: ANSI C
+* Environment: Any
+* Developer: Kendall Bennett
+*
+* Description: Header file for operand decoding functions.
+*
+****************************************************************************/
+
+#ifndef __X86EMU_OPS_H
+#define __X86EMU_OPS_H
+
+extern void (*x86emu_optab[0x100])(u8 op1);
+extern void (*x86emu_optab2[0x100])(u8 op2);
+
+#endif /* __X86EMU_OPS_H */
diff --git a/cfe/cfe/x86emu/x86emu/ops_protos.h b/cfe/cfe/x86emu/x86emu/ops_protos.h
new file mode 100644
index 0000000..8787c5a
--- /dev/null
+++ b/cfe/cfe/x86emu/x86emu/ops_protos.h
@@ -0,0 +1,277 @@
+
+#define OPPROTO(x) void x(u8)
+
+OPPROTO(x86emuOp_illegal_op);
+OPPROTO(x86emuOp_add_byte_RM_R);
+OPPROTO(x86emuOp_add_word_RM_R);
+OPPROTO(x86emuOp_add_byte_R_RM);
+OPPROTO(x86emuOp_add_word_R_RM);
+OPPROTO(x86emuOp_add_byte_AL_IMM);
+OPPROTO(x86emuOp_add_word_AX_IMM);
+OPPROTO(x86emuOp_push_ES);
+OPPROTO(x86emuOp_pop_ES);
+OPPROTO(x86emuOp_or_byte_RM_R);
+OPPROTO(x86emuOp_or_word_RM_R);
+OPPROTO(x86emuOp_or_byte_R_RM);
+OPPROTO(x86emuOp_or_word_R_RM);
+OPPROTO(x86emuOp_or_byte_AL_IMM);
+OPPROTO(x86emuOp_or_word_AX_IMM);
+OPPROTO(x86emuOp_push_CS);
+OPPROTO(x86emuOp_two_byte);
+OPPROTO(x86emuOp_adc_byte_RM_R);
+OPPROTO(x86emuOp_adc_word_RM_R);
+OPPROTO(x86emuOp_adc_byte_R_RM);
+OPPROTO(x86emuOp_adc_word_R_RM);
+OPPROTO(x86emuOp_adc_byte_AL_IMM);
+OPPROTO(x86emuOp_adc_word_AX_IMM);
+OPPROTO(x86emuOp_push_SS);
+OPPROTO(x86emuOp_pop_SS);
+OPPROTO(x86emuOp_sbb_byte_RM_R);
+OPPROTO(x86emuOp_sbb_word_RM_R);
+OPPROTO(x86emuOp_sbb_byte_R_RM);
+OPPROTO(x86emuOp_sbb_word_R_RM);
+OPPROTO(x86emuOp_sbb_byte_AL_IMM);
+OPPROTO(x86emuOp_sbb_word_AX_IMM);
+OPPROTO(x86emuOp_push_DS);
+OPPROTO(x86emuOp_pop_DS);
+OPPROTO(x86emuOp_and_byte_RM_R);
+OPPROTO(x86emuOp_and_word_RM_R);
+OPPROTO(x86emuOp_and_byte_R_RM);
+OPPROTO(x86emuOp_and_word_R_RM);
+OPPROTO(x86emuOp_and_byte_AL_IMM);
+OPPROTO(x86emuOp_and_word_AX_IMM);
+OPPROTO(x86emuOp_segovr_ES);
+OPPROTO(x86emuOp_daa);
+OPPROTO(x86emuOp_sub_byte_RM_R);
+OPPROTO(x86emuOp_sub_word_RM_R);
+OPPROTO(x86emuOp_sub_byte_R_RM);
+OPPROTO(x86emuOp_sub_word_R_RM);
+OPPROTO(x86emuOp_sub_byte_AL_IMM);
+OPPROTO(x86emuOp_sub_word_AX_IMM);
+OPPROTO(x86emuOp_segovr_CS);
+OPPROTO(x86emuOp_das);
+OPPROTO(x86emuOp_xor_byte_RM_R);
+OPPROTO(x86emuOp_xor_word_RM_R);
+OPPROTO(x86emuOp_xor_byte_R_RM);
+OPPROTO(x86emuOp_xor_word_R_RM);
+OPPROTO(x86emuOp_xor_byte_AL_IMM);
+OPPROTO(x86emuOp_xor_word_AX_IMM);
+OPPROTO(x86emuOp_segovr_SS);
+OPPROTO(x86emuOp_aaa);
+OPPROTO(x86emuOp_cmp_byte_RM_R);
+OPPROTO(x86emuOp_cmp_word_RM_R);
+OPPROTO(x86emuOp_cmp_byte_R_RM);
+OPPROTO(x86emuOp_cmp_word_R_RM);
+OPPROTO(x86emuOp_cmp_byte_AL_IMM);
+OPPROTO(x86emuOp_cmp_word_AX_IMM);
+OPPROTO(x86emuOp_segovr_DS);
+OPPROTO(x86emuOp_aas);
+OPPROTO(x86emuOp_inc_AX);
+OPPROTO(x86emuOp_inc_CX);
+OPPROTO(x86emuOp_inc_DX);
+OPPROTO(x86emuOp_inc_BX);
+OPPROTO(x86emuOp_inc_SP);
+OPPROTO(x86emuOp_inc_BP);
+OPPROTO(x86emuOp_inc_SI);
+OPPROTO(x86emuOp_inc_DI);
+OPPROTO(x86emuOp_dec_AX);
+OPPROTO(x86emuOp_dec_CX);
+OPPROTO(x86emuOp_dec_DX);
+OPPROTO(x86emuOp_dec_BX);
+OPPROTO(x86emuOp_dec_SP);
+OPPROTO(x86emuOp_dec_BP);
+OPPROTO(x86emuOp_dec_SI);
+OPPROTO(x86emuOp_dec_DI);
+OPPROTO(x86emuOp_push_AX);
+OPPROTO(x86emuOp_push_CX);
+OPPROTO(x86emuOp_push_DX);
+OPPROTO(x86emuOp_push_BX);
+OPPROTO(x86emuOp_push_SP);
+OPPROTO(x86emuOp_push_BP);
+OPPROTO(x86emuOp_push_SI);
+OPPROTO(x86emuOp_push_DI);
+OPPROTO(x86emuOp_pop_AX);
+OPPROTO(x86emuOp_pop_CX);
+OPPROTO(x86emuOp_pop_DX);
+OPPROTO(x86emuOp_pop_BX);
+OPPROTO(x86emuOp_pop_SP);
+OPPROTO(x86emuOp_pop_BP);
+OPPROTO(x86emuOp_pop_SI);
+OPPROTO(x86emuOp_pop_DI);
+OPPROTO(x86emuOp_push_all);
+OPPROTO(x86emuOp_pop_all);
+OPPROTO(x86emuOp_segovr_FS);
+OPPROTO(x86emuOp_segovr_GS);
+OPPROTO(x86emuOp_prefix_data);
+OPPROTO(x86emuOp_prefix_addr);
+OPPROTO(x86emuOp_push_word_IMM);
+OPPROTO(x86emuOp_imul_word_IMM);
+OPPROTO(x86emuOp_push_byte_IMM);
+OPPROTO(x86emuOp_imul_byte_IMM);
+OPPROTO(x86emuOp_ins_byte);
+OPPROTO(x86emuOp_ins_word);
+OPPROTO(x86emuOp_outs_byte);
+OPPROTO(x86emuOp_outs_word);
+OPPROTO(x86emuOp_jump_near_O);
+OPPROTO(x86emuOp_jump_near_NO);
+OPPROTO(x86emuOp_jump_near_B);
+OPPROTO(x86emuOp_jump_near_NB);
+OPPROTO(x86emuOp_jump_near_Z);
+OPPROTO(x86emuOp_jump_near_NZ);
+OPPROTO(x86emuOp_jump_near_BE);
+OPPROTO(x86emuOp_jump_near_NBE);
+OPPROTO(x86emuOp_jump_near_S);
+OPPROTO(x86emuOp_jump_near_NS);
+OPPROTO(x86emuOp_jump_near_P);
+OPPROTO(x86emuOp_jump_near_NP);
+OPPROTO(x86emuOp_jump_near_L);
+OPPROTO(x86emuOp_jump_near_NL);
+OPPROTO(x86emuOp_jump_near_LE);
+OPPROTO(x86emuOp_jump_near_NLE);
+OPPROTO(x86emuOp_opc80_byte_RM_IMM);
+OPPROTO(x86emuOp_opc81_word_RM_IMM);
+OPPROTO(x86emuOp_opc82_byte_RM_IMM);
+OPPROTO(x86emuOp_opc83_word_RM_IMM);
+OPPROTO(x86emuOp_test_byte_RM_R);
+OPPROTO(x86emuOp_test_word_RM_R);
+OPPROTO(x86emuOp_xchg_byte_RM_R);
+OPPROTO(x86emuOp_xchg_word_RM_R);
+OPPROTO(x86emuOp_mov_byte_RM_R);
+OPPROTO(x86emuOp_mov_word_RM_R);
+OPPROTO(x86emuOp_mov_byte_R_RM);
+OPPROTO(x86emuOp_mov_word_R_RM);
+OPPROTO(x86emuOp_mov_word_RM_SR);
+OPPROTO(x86emuOp_lea_word_R_M);
+OPPROTO(x86emuOp_mov_word_SR_RM);
+OPPROTO(x86emuOp_pop_RM);
+OPPROTO(x86emuOp_nop);
+OPPROTO(x86emuOp_xchg_word_AX_CX);
+OPPROTO(x86emuOp_xchg_word_AX_DX);
+OPPROTO(x86emuOp_xchg_word_AX_BX);
+OPPROTO(x86emuOp_xchg_word_AX_SP);
+OPPROTO(x86emuOp_xchg_word_AX_BP);
+OPPROTO(x86emuOp_xchg_word_AX_SI);
+OPPROTO(x86emuOp_xchg_word_AX_DI);
+OPPROTO(x86emuOp_cbw);
+OPPROTO(x86emuOp_cwd);
+OPPROTO(x86emuOp_call_far_IMM);
+OPPROTO(x86emuOp_wait);
+OPPROTO(x86emuOp_pushf_word);
+OPPROTO(x86emuOp_popf_word);
+OPPROTO(x86emuOp_sahf);
+OPPROTO(x86emuOp_lahf);
+OPPROTO(x86emuOp_mov_AL_M_IMM);
+OPPROTO(x86emuOp_mov_AX_M_IMM);
+OPPROTO(x86emuOp_mov_M_AL_IMM);
+OPPROTO(x86emuOp_mov_M_AX_IMM);
+OPPROTO(x86emuOp_movs_byte);
+OPPROTO(x86emuOp_movs_word);
+OPPROTO(x86emuOp_cmps_byte);
+OPPROTO(x86emuOp_cmps_word);
+OPPROTO(x86emuOp_test_AL_IMM);
+OPPROTO(x86emuOp_test_AX_IMM);
+OPPROTO(x86emuOp_stos_byte);
+OPPROTO(x86emuOp_stos_word);
+OPPROTO(x86emuOp_lods_byte);
+OPPROTO(x86emuOp_lods_word);
+OPPROTO(x86emuOp_scas_byte);
+OPPROTO(x86emuOp_scas_word);
+OPPROTO(x86emuOp_mov_byte_AL_IMM);
+OPPROTO(x86emuOp_mov_byte_CL_IMM);
+OPPROTO(x86emuOp_mov_byte_DL_IMM);
+OPPROTO(x86emuOp_mov_byte_BL_IMM);
+OPPROTO(x86emuOp_mov_byte_AH_IMM);
+OPPROTO(x86emuOp_mov_byte_CH_IMM);
+OPPROTO(x86emuOp_mov_byte_DH_IMM);
+OPPROTO(x86emuOp_mov_byte_BH_IMM);
+OPPROTO(x86emuOp_mov_word_AX_IMM);
+OPPROTO(x86emuOp_mov_word_CX_IMM);
+OPPROTO(x86emuOp_mov_word_DX_IMM);
+OPPROTO(x86emuOp_mov_word_BX_IMM);
+OPPROTO(x86emuOp_mov_word_SP_IMM);
+OPPROTO(x86emuOp_mov_word_BP_IMM);
+OPPROTO(x86emuOp_mov_word_SI_IMM);
+OPPROTO(x86emuOp_mov_word_DI_IMM);
+OPPROTO(x86emuOp_opcC0_byte_RM_MEM);
+OPPROTO(x86emuOp_opcC1_word_RM_MEM);
+OPPROTO(x86emuOp_ret_near_IMM);
+OPPROTO(x86emuOp_ret_near);
+OPPROTO(x86emuOp_les_R_IMM);
+OPPROTO(x86emuOp_lds_R_IMM);
+OPPROTO(x86emuOp_mov_byte_RM_IMM);
+OPPROTO(x86emuOp_mov_word_RM_IMM);
+OPPROTO(x86emuOp_enter);
+OPPROTO(x86emuOp_leave);
+OPPROTO(x86emuOp_ret_far_IMM);
+OPPROTO(x86emuOp_ret_far);
+OPPROTO(x86emuOp_int3);
+OPPROTO(x86emuOp_int_IMM);
+OPPROTO(x86emuOp_into);
+OPPROTO(x86emuOp_iret);
+OPPROTO(x86emuOp_opcD0_byte_RM_1);
+OPPROTO(x86emuOp_opcD1_word_RM_1);
+OPPROTO(x86emuOp_opcD2_byte_RM_CL);
+OPPROTO(x86emuOp_opcD3_word_RM_CL);
+OPPROTO(x86emuOp_aam);
+OPPROTO(x86emuOp_aad);
+OPPROTO(x86emuOp_xlat);
+OPPROTO(x86emuOp_loopne);
+OPPROTO(x86emuOp_loope);
+OPPROTO(x86emuOp_loop);
+OPPROTO(x86emuOp_jcxz);
+OPPROTO(x86emuOp_in_byte_AL_IMM);
+OPPROTO(x86emuOp_in_word_AX_IMM);
+OPPROTO(x86emuOp_out_byte_IMM_AL);
+OPPROTO(x86emuOp_out_word_IMM_AX);
+OPPROTO(x86emuOp_call_near_IMM);
+OPPROTO(x86emuOp_jump_near_IMM);
+OPPROTO(x86emuOp_jump_far_IMM);
+OPPROTO(x86emuOp_jump_byte_IMM);
+OPPROTO(x86emuOp_in_byte_AL_DX);
+OPPROTO(x86emuOp_in_word_AX_DX);
+OPPROTO(x86emuOp_out_byte_DX_AL);
+OPPROTO(x86emuOp_out_word_DX_AX);
+OPPROTO(x86emuOp_lock);
+OPPROTO(x86emuOp_repne);
+OPPROTO(x86emuOp_repe);
+OPPROTO(x86emuOp_halt);
+OPPROTO(x86emuOp_cmc);
+OPPROTO(x86emuOp_opcF6_byte_RM);
+OPPROTO(x86emuOp_opcF7_word_RM);
+OPPROTO(x86emuOp_clc);
+OPPROTO(x86emuOp_stc);
+OPPROTO(x86emuOp_cli);
+OPPROTO(x86emuOp_sti);
+OPPROTO(x86emuOp_cld);
+OPPROTO(x86emuOp_std);
+OPPROTO(x86emuOp_opcFE_byte_RM);
+OPPROTO(x86emuOp_opcFF_word_RM);
+
+
+OPPROTO(x86emuOp2_illegal_op);
+OPPROTO(x86emuOp2_long_jump);
+OPPROTO(x86emuOp2_set_byte);
+OPPROTO(x86emuOp2_push_FS);
+OPPROTO(x86emuOp2_pop_FS);
+OPPROTO(x86emuOp2_bt_R);
+OPPROTO(x86emuOp2_shld_IMM);
+OPPROTO(x86emuOp2_shld_CL);
+OPPROTO(x86emuOp2_push_GS);
+OPPROTO(x86emuOp2_pop_GS);
+OPPROTO(x86emuOp2_bts_R);
+OPPROTO(x86emuOp2_shrd_IMM);
+OPPROTO(x86emuOp2_shrd_CL);
+OPPROTO(x86emuOp2_imul_R_RM);
+OPPROTO(x86emuOp2_lss_R_IMM);
+OPPROTO(x86emuOp2_btr_R);
+OPPROTO(x86emuOp2_lfs_R_IMM);
+OPPROTO(x86emuOp2_lgs_R_IMM);
+OPPROTO(x86emuOp2_movzx_byte_R_RM);
+OPPROTO(x86emuOp2_movzx_word_R_RM);
+OPPROTO(x86emuOp2_btX_I);
+OPPROTO(x86emuOp2_btc_R);
+OPPROTO(x86emuOp2_bsf);
+OPPROTO(x86emuOp2_bsr);
+OPPROTO(x86emuOp2_movsx_byte_R_RM);
+OPPROTO(x86emuOp2_movsx_word_R_R);
+OPPROTO(x86emuOp2_movsx_word_R_RM);
diff --git a/cfe/cfe/x86emu/x86emu/prim_asm.h b/cfe/cfe/x86emu/x86emu/prim_asm.h
new file mode 100644
index 0000000..4fa8d55
--- /dev/null
+++ b/cfe/cfe/x86emu/x86emu/prim_asm.h
@@ -0,0 +1,971 @@
+/****************************************************************************
+*
+* Realmode X86 Emulator Library
+*
+* Copyright (C) 1996-1999 SciTech Software, Inc.
+* Copyright (C) David Mosberger-Tang
+* Copyright (C) 1999 Egbert Eich
+*
+* ========================================================================
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee,
+* provided that the above copyright notice appear in all copies and that
+* both that copyright notice and this permission notice appear in
+* supporting documentation, and that the name of the authors not be used
+* in advertising or publicity pertaining to distribution of the software
+* without specific, written prior permission. The authors makes no
+* representations about the suitability of this software for any purpose.
+* It is provided "as is" without express or implied warranty.
+*
+* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+* PERFORMANCE OF THIS SOFTWARE.
+*
+* ========================================================================
+*
+* Language: Watcom C++ 10.6 or later
+* Environment: Any
+* Developer: Kendall Bennett
+*
+* Description: Inline assembler versions of the primitive operand
+* functions for faster performance. At the moment this is
+* x86 inline assembler, but these functions could be replaced
+* with native inline assembler for each supported processor
+* platform.
+*
+****************************************************************************/
+/* $XFree86: xc/extras/x86emu/src/x86emu/x86emu/prim_asm.h,v 1.3 2000/04/19 15:48:15 tsi Exp $ */
+
+#ifndef __X86EMU_PRIM_ASM_H
+#define __X86EMU_PRIM_ASM_H
+
+#ifdef __WATCOMC__
+
+#ifndef VALIDATE
+#define __HAVE_INLINE_ASSEMBLER__
+#endif
+
+u32 get_flags_asm(void);
+#pragma aux get_flags_asm = \
+ "pushf" \
+ "pop eax" \
+ value [eax] \
+ modify exact [eax];
+
+u16 aaa_word_asm(u32 *flags,u16 d);
+#pragma aux aaa_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "aaa" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] \
+ value [ax] \
+ modify exact [ax];
+
+u16 aas_word_asm(u32 *flags,u16 d);
+#pragma aux aas_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "aas" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] \
+ value [ax] \
+ modify exact [ax];
+
+u16 aad_word_asm(u32 *flags,u16 d);
+#pragma aux aad_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "aad" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] \
+ value [ax] \
+ modify exact [ax];
+
+u16 aam_word_asm(u32 *flags,u8 d);
+#pragma aux aam_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "aam" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] \
+ value [ax] \
+ modify exact [ax];
+
+u8 adc_byte_asm(u32 *flags,u8 d, u8 s);
+#pragma aux adc_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "adc al,bl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] [bl] \
+ value [al] \
+ modify exact [al bl];
+
+u16 adc_word_asm(u32 *flags,u16 d, u16 s);
+#pragma aux adc_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "adc ax,bx" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] [bx] \
+ value [ax] \
+ modify exact [ax bx];
+
+u32 adc_long_asm(u32 *flags,u32 d, u32 s);
+#pragma aux adc_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "adc eax,ebx" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] [ebx] \
+ value [eax] \
+ modify exact [eax ebx];
+
+u8 add_byte_asm(u32 *flags,u8 d, u8 s);
+#pragma aux add_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "add al,bl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] [bl] \
+ value [al] \
+ modify exact [al bl];
+
+u16 add_word_asm(u32 *flags,u16 d, u16 s);
+#pragma aux add_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "add ax,bx" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] [bx] \
+ value [ax] \
+ modify exact [ax bx];
+
+u32 add_long_asm(u32 *flags,u32 d, u32 s);
+#pragma aux add_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "add eax,ebx" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] [ebx] \
+ value [eax] \
+ modify exact [eax ebx];
+
+u8 and_byte_asm(u32 *flags,u8 d, u8 s);
+#pragma aux and_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "and al,bl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] [bl] \
+ value [al] \
+ modify exact [al bl];
+
+u16 and_word_asm(u32 *flags,u16 d, u16 s);
+#pragma aux and_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "and ax,bx" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] [bx] \
+ value [ax] \
+ modify exact [ax bx];
+
+u32 and_long_asm(u32 *flags,u32 d, u32 s);
+#pragma aux and_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "and eax,ebx" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] [ebx] \
+ value [eax] \
+ modify exact [eax ebx];
+
+u8 cmp_byte_asm(u32 *flags,u8 d, u8 s);
+#pragma aux cmp_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "cmp al,bl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] [bl] \
+ value [al] \
+ modify exact [al bl];
+
+u16 cmp_word_asm(u32 *flags,u16 d, u16 s);
+#pragma aux cmp_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "cmp ax,bx" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] [bx] \
+ value [ax] \
+ modify exact [ax bx];
+
+u32 cmp_long_asm(u32 *flags,u32 d, u32 s);
+#pragma aux cmp_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "cmp eax,ebx" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] [ebx] \
+ value [eax] \
+ modify exact [eax ebx];
+
+u8 daa_byte_asm(u32 *flags,u8 d);
+#pragma aux daa_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "daa" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] \
+ value [al] \
+ modify exact [al];
+
+u8 das_byte_asm(u32 *flags,u8 d);
+#pragma aux das_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "das" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] \
+ value [al] \
+ modify exact [al];
+
+u8 dec_byte_asm(u32 *flags,u8 d);
+#pragma aux dec_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "dec al" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] \
+ value [al] \
+ modify exact [al];
+
+u16 dec_word_asm(u32 *flags,u16 d);
+#pragma aux dec_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "dec ax" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] \
+ value [ax] \
+ modify exact [ax];
+
+u32 dec_long_asm(u32 *flags,u32 d);
+#pragma aux dec_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "dec eax" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] \
+ value [eax] \
+ modify exact [eax];
+
+u8 inc_byte_asm(u32 *flags,u8 d);
+#pragma aux inc_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "inc al" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] \
+ value [al] \
+ modify exact [al];
+
+u16 inc_word_asm(u32 *flags,u16 d);
+#pragma aux inc_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "inc ax" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] \
+ value [ax] \
+ modify exact [ax];
+
+u32 inc_long_asm(u32 *flags,u32 d);
+#pragma aux inc_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "inc eax" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] \
+ value [eax] \
+ modify exact [eax];
+
+u8 or_byte_asm(u32 *flags,u8 d, u8 s);
+#pragma aux or_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "or al,bl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] [bl] \
+ value [al] \
+ modify exact [al bl];
+
+u16 or_word_asm(u32 *flags,u16 d, u16 s);
+#pragma aux or_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "or ax,bx" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] [bx] \
+ value [ax] \
+ modify exact [ax bx];
+
+u32 or_long_asm(u32 *flags,u32 d, u32 s);
+#pragma aux or_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "or eax,ebx" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] [ebx] \
+ value [eax] \
+ modify exact [eax ebx];
+
+u8 neg_byte_asm(u32 *flags,u8 d);
+#pragma aux neg_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "neg al" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] \
+ value [al] \
+ modify exact [al];
+
+u16 neg_word_asm(u32 *flags,u16 d);
+#pragma aux neg_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "neg ax" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] \
+ value [ax] \
+ modify exact [ax];
+
+u32 neg_long_asm(u32 *flags,u32 d);
+#pragma aux neg_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "neg eax" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] \
+ value [eax] \
+ modify exact [eax];
+
+u8 not_byte_asm(u32 *flags,u8 d);
+#pragma aux not_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "not al" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] \
+ value [al] \
+ modify exact [al];
+
+u16 not_word_asm(u32 *flags,u16 d);
+#pragma aux not_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "not ax" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] \
+ value [ax] \
+ modify exact [ax];
+
+u32 not_long_asm(u32 *flags,u32 d);
+#pragma aux not_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "not eax" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] \
+ value [eax] \
+ modify exact [eax];
+
+u8 rcl_byte_asm(u32 *flags,u8 d, u8 s);
+#pragma aux rcl_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "rcl al,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] [cl] \
+ value [al] \
+ modify exact [al cl];
+
+u16 rcl_word_asm(u32 *flags,u16 d, u8 s);
+#pragma aux rcl_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "rcl ax,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] [cl] \
+ value [ax] \
+ modify exact [ax cl];
+
+u32 rcl_long_asm(u32 *flags,u32 d, u8 s);
+#pragma aux rcl_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "rcl eax,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] [cl] \
+ value [eax] \
+ modify exact [eax cl];
+
+u8 rcr_byte_asm(u32 *flags,u8 d, u8 s);
+#pragma aux rcr_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "rcr al,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] [cl] \
+ value [al] \
+ modify exact [al cl];
+
+u16 rcr_word_asm(u32 *flags,u16 d, u8 s);
+#pragma aux rcr_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "rcr ax,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] [cl] \
+ value [ax] \
+ modify exact [ax cl];
+
+u32 rcr_long_asm(u32 *flags,u32 d, u8 s);
+#pragma aux rcr_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "rcr eax,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] [cl] \
+ value [eax] \
+ modify exact [eax cl];
+
+u8 rol_byte_asm(u32 *flags,u8 d, u8 s);
+#pragma aux rol_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "rol al,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] [cl] \
+ value [al] \
+ modify exact [al cl];
+
+u16 rol_word_asm(u32 *flags,u16 d, u8 s);
+#pragma aux rol_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "rol ax,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] [cl] \
+ value [ax] \
+ modify exact [ax cl];
+
+u32 rol_long_asm(u32 *flags,u32 d, u8 s);
+#pragma aux rol_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "rol eax,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] [cl] \
+ value [eax] \
+ modify exact [eax cl];
+
+u8 ror_byte_asm(u32 *flags,u8 d, u8 s);
+#pragma aux ror_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "ror al,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] [cl] \
+ value [al] \
+ modify exact [al cl];
+
+u16 ror_word_asm(u32 *flags,u16 d, u8 s);
+#pragma aux ror_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "ror ax,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] [cl] \
+ value [ax] \
+ modify exact [ax cl];
+
+u32 ror_long_asm(u32 *flags,u32 d, u8 s);
+#pragma aux ror_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "ror eax,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] [cl] \
+ value [eax] \
+ modify exact [eax cl];
+
+u8 shl_byte_asm(u32 *flags,u8 d, u8 s);
+#pragma aux shl_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "shl al,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] [cl] \
+ value [al] \
+ modify exact [al cl];
+
+u16 shl_word_asm(u32 *flags,u16 d, u8 s);
+#pragma aux shl_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "shl ax,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] [cl] \
+ value [ax] \
+ modify exact [ax cl];
+
+u32 shl_long_asm(u32 *flags,u32 d, u8 s);
+#pragma aux shl_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "shl eax,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] [cl] \
+ value [eax] \
+ modify exact [eax cl];
+
+u8 shr_byte_asm(u32 *flags,u8 d, u8 s);
+#pragma aux shr_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "shr al,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] [cl] \
+ value [al] \
+ modify exact [al cl];
+
+u16 shr_word_asm(u32 *flags,u16 d, u8 s);
+#pragma aux shr_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "shr ax,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] [cl] \
+ value [ax] \
+ modify exact [ax cl];
+
+u32 shr_long_asm(u32 *flags,u32 d, u8 s);
+#pragma aux shr_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "shr eax,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] [cl] \
+ value [eax] \
+ modify exact [eax cl];
+
+u8 sar_byte_asm(u32 *flags,u8 d, u8 s);
+#pragma aux sar_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "sar al,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] [cl] \
+ value [al] \
+ modify exact [al cl];
+
+u16 sar_word_asm(u32 *flags,u16 d, u8 s);
+#pragma aux sar_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "sar ax,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] [cl] \
+ value [ax] \
+ modify exact [ax cl];
+
+u32 sar_long_asm(u32 *flags,u32 d, u8 s);
+#pragma aux sar_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "sar eax,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] [cl] \
+ value [eax] \
+ modify exact [eax cl];
+
+u16 shld_word_asm(u32 *flags,u16 d, u16 fill, u8 s);
+#pragma aux shld_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "shld ax,dx,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] [dx] [cl] \
+ value [ax] \
+ modify exact [ax dx cl];
+
+u32 shld_long_asm(u32 *flags,u32 d, u32 fill, u8 s);
+#pragma aux shld_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "shld eax,edx,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] [edx] [cl] \
+ value [eax] \
+ modify exact [eax edx cl];
+
+u16 shrd_word_asm(u32 *flags,u16 d, u16 fill, u8 s);
+#pragma aux shrd_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "shrd ax,dx,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] [dx] [cl] \
+ value [ax] \
+ modify exact [ax dx cl];
+
+u32 shrd_long_asm(u32 *flags,u32 d, u32 fill, u8 s);
+#pragma aux shrd_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "shrd eax,edx,cl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] [edx] [cl] \
+ value [eax] \
+ modify exact [eax edx cl];
+
+u8 sbb_byte_asm(u32 *flags,u8 d, u8 s);
+#pragma aux sbb_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "sbb al,bl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] [bl] \
+ value [al] \
+ modify exact [al bl];
+
+u16 sbb_word_asm(u32 *flags,u16 d, u16 s);
+#pragma aux sbb_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "sbb ax,bx" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] [bx] \
+ value [ax] \
+ modify exact [ax bx];
+
+u32 sbb_long_asm(u32 *flags,u32 d, u32 s);
+#pragma aux sbb_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "sbb eax,ebx" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] [ebx] \
+ value [eax] \
+ modify exact [eax ebx];
+
+u8 sub_byte_asm(u32 *flags,u8 d, u8 s);
+#pragma aux sub_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "sub al,bl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] [bl] \
+ value [al] \
+ modify exact [al bl];
+
+u16 sub_word_asm(u32 *flags,u16 d, u16 s);
+#pragma aux sub_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "sub ax,bx" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] [bx] \
+ value [ax] \
+ modify exact [ax bx];
+
+u32 sub_long_asm(u32 *flags,u32 d, u32 s);
+#pragma aux sub_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "sub eax,ebx" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] [ebx] \
+ value [eax] \
+ modify exact [eax ebx];
+
+void test_byte_asm(u32 *flags,u8 d, u8 s);
+#pragma aux test_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "test al,bl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] [bl] \
+ modify exact [al bl];
+
+void test_word_asm(u32 *flags,u16 d, u16 s);
+#pragma aux test_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "test ax,bx" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] [bx] \
+ modify exact [ax bx];
+
+void test_long_asm(u32 *flags,u32 d, u32 s);
+#pragma aux test_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "test eax,ebx" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] [ebx] \
+ modify exact [eax ebx];
+
+u8 xor_byte_asm(u32 *flags,u8 d, u8 s);
+#pragma aux xor_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "xor al,bl" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [al] [bl] \
+ value [al] \
+ modify exact [al bl];
+
+u16 xor_word_asm(u32 *flags,u16 d, u16 s);
+#pragma aux xor_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "xor ax,bx" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [ax] [bx] \
+ value [ax] \
+ modify exact [ax bx];
+
+u32 xor_long_asm(u32 *flags,u32 d, u32 s);
+#pragma aux xor_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "xor eax,ebx" \
+ "pushf" \
+ "pop [edi]" \
+ parm [edi] [eax] [ebx] \
+ value [eax] \
+ modify exact [eax ebx];
+
+void imul_byte_asm(u32 *flags,u16 *ax,u8 d,u8 s);
+#pragma aux imul_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "imul bl" \
+ "pushf" \
+ "pop [edi]" \
+ "mov [esi],ax" \
+ parm [edi] [esi] [al] [bl] \
+ modify exact [esi ax bl];
+
+void imul_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 d,u16 s);
+#pragma aux imul_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "imul bx" \
+ "pushf" \
+ "pop [edi]" \
+ "mov [esi],ax" \
+ "mov [ecx],dx" \
+ parm [edi] [esi] [ecx] [ax] [bx]\
+ modify exact [esi edi ax bx dx];
+
+void imul_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 d,u32 s);
+#pragma aux imul_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "imul ebx" \
+ "pushf" \
+ "pop [edi]" \
+ "mov [esi],eax" \
+ "mov [ecx],edx" \
+ parm [edi] [esi] [ecx] [eax] [ebx] \
+ modify exact [esi edi eax ebx edx];
+
+void mul_byte_asm(u32 *flags,u16 *ax,u8 d,u8 s);
+#pragma aux mul_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "mul bl" \
+ "pushf" \
+ "pop [edi]" \
+ "mov [esi],ax" \
+ parm [edi] [esi] [al] [bl] \
+ modify exact [esi ax bl];
+
+void mul_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 d,u16 s);
+#pragma aux mul_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "mul bx" \
+ "pushf" \
+ "pop [edi]" \
+ "mov [esi],ax" \
+ "mov [ecx],dx" \
+ parm [edi] [esi] [ecx] [ax] [bx]\
+ modify exact [esi edi ax bx dx];
+
+void mul_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 d,u32 s);
+#pragma aux mul_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "mul ebx" \
+ "pushf" \
+ "pop [edi]" \
+ "mov [esi],eax" \
+ "mov [ecx],edx" \
+ parm [edi] [esi] [ecx] [eax] [ebx] \
+ modify exact [esi edi eax ebx edx];
+
+void idiv_byte_asm(u32 *flags,u8 *al,u8 *ah,u16 d,u8 s);
+#pragma aux idiv_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "idiv bl" \
+ "pushf" \
+ "pop [edi]" \
+ "mov [esi],al" \
+ "mov [ecx],ah" \
+ parm [edi] [esi] [ecx] [ax] [bl]\
+ modify exact [esi edi ax bl];
+
+void idiv_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 dlo,u16 dhi,u16 s);
+#pragma aux idiv_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "idiv bx" \
+ "pushf" \
+ "pop [edi]" \
+ "mov [esi],ax" \
+ "mov [ecx],dx" \
+ parm [edi] [esi] [ecx] [ax] [dx] [bx]\
+ modify exact [esi edi ax dx bx];
+
+void idiv_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 dlo,u32 dhi,u32 s);
+#pragma aux idiv_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "idiv ebx" \
+ "pushf" \
+ "pop [edi]" \
+ "mov [esi],eax" \
+ "mov [ecx],edx" \
+ parm [edi] [esi] [ecx] [eax] [edx] [ebx]\
+ modify exact [esi edi eax edx ebx];
+
+void div_byte_asm(u32 *flags,u8 *al,u8 *ah,u16 d,u8 s);
+#pragma aux div_byte_asm = \
+ "push [edi]" \
+ "popf" \
+ "div bl" \
+ "pushf" \
+ "pop [edi]" \
+ "mov [esi],al" \
+ "mov [ecx],ah" \
+ parm [edi] [esi] [ecx] [ax] [bl]\
+ modify exact [esi edi ax bl];
+
+void div_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 dlo,u16 dhi,u16 s);
+#pragma aux div_word_asm = \
+ "push [edi]" \
+ "popf" \
+ "div bx" \
+ "pushf" \
+ "pop [edi]" \
+ "mov [esi],ax" \
+ "mov [ecx],dx" \
+ parm [edi] [esi] [ecx] [ax] [dx] [bx]\
+ modify exact [esi edi ax dx bx];
+
+void div_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 dlo,u32 dhi,u32 s);
+#pragma aux div_long_asm = \
+ "push [edi]" \
+ "popf" \
+ "div ebx" \
+ "pushf" \
+ "pop [edi]" \
+ "mov [esi],eax" \
+ "mov [ecx],edx" \
+ parm [edi] [esi] [ecx] [eax] [edx] [ebx]\
+ modify exact [esi edi eax edx ebx];
+
+#endif
+
+#endif /* __X86EMU_PRIM_ASM_H */
diff --git a/cfe/cfe/x86emu/x86emu/prim_ops.h b/cfe/cfe/x86emu/x86emu/prim_ops.h
new file mode 100644
index 0000000..1633fe1
--- /dev/null
+++ b/cfe/cfe/x86emu/x86emu/prim_ops.h
@@ -0,0 +1,231 @@
+/****************************************************************************
+*
+* Realmode X86 Emulator Library
+*
+* Copyright (C) 1996-1999 SciTech Software, Inc.
+* Copyright (C) David Mosberger-Tang
+* Copyright (C) 1999 Egbert Eich
+*
+* ========================================================================
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee,
+* provided that the above copyright notice appear in all copies and that
+* both that copyright notice and this permission notice appear in
+* supporting documentation, and that the name of the authors not be used
+* in advertising or publicity pertaining to distribution of the software
+* without specific, written prior permission. The authors makes no
+* representations about the suitability of this software for any purpose.
+* It is provided "as is" without express or implied warranty.
+*
+* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+* PERFORMANCE OF THIS SOFTWARE.
+*
+* ========================================================================
+*
+* Language: ANSI C
+* Environment: Any
+* Developer: Kendall Bennett
+*
+* Description: Header file for primitive operation functions.
+*
+****************************************************************************/
+
+#ifndef __X86EMU_PRIM_OPS_H
+#define __X86EMU_PRIM_OPS_H
+
+#include "x86emu/prim_asm.h"
+
+#ifdef __cplusplus
+extern "C" { /* Use "C" linkage when in C++ mode */
+#endif
+
+u16 aaa_word (u16 d);
+u16 aas_word (u16 d);
+u16 aad_word (u16 d);
+u16 aam_word (u8 d);
+u8 adc_byte (u8 d, u8 s);
+u16 adc_word (u16 d, u16 s);
+u32 adc_long (u32 d, u32 s);
+u8 add_byte (u8 d, u8 s);
+u16 add_word (u16 d, u16 s);
+u32 add_long (u32 d, u32 s);
+u8 and_byte (u8 d, u8 s);
+u16 and_word (u16 d, u16 s);
+u32 and_long (u32 d, u32 s);
+u8 cmp_byte (u8 d, u8 s);
+u16 cmp_word (u16 d, u16 s);
+u32 cmp_long (u32 d, u32 s);
+u8 daa_byte (u8 d);
+u8 das_byte (u8 d);
+u8 dec_byte (u8 d);
+u16 dec_word (u16 d);
+u32 dec_long (u32 d);
+u8 inc_byte (u8 d);
+u16 inc_word (u16 d);
+u32 inc_long (u32 d);
+u8 or_byte (u8 d, u8 s);
+u16 or_word (u16 d, u16 s);
+u32 or_long (u32 d, u32 s);
+u8 neg_byte (u8 s);
+u16 neg_word (u16 s);
+u32 neg_long (u32 s);
+u8 not_byte (u8 s);
+u16 not_word (u16 s);
+u32 not_long (u32 s);
+u8 rcl_byte (u8 d, u8 s);
+u16 rcl_word (u16 d, u8 s);
+u32 rcl_long (u32 d, u8 s);
+u8 rcr_byte (u8 d, u8 s);
+u16 rcr_word (u16 d, u8 s);
+u32 rcr_long (u32 d, u8 s);
+u8 rol_byte (u8 d, u8 s);
+u16 rol_word (u16 d, u8 s);
+u32 rol_long (u32 d, u8 s);
+u8 ror_byte (u8 d, u8 s);
+u16 ror_word (u16 d, u8 s);
+u32 ror_long (u32 d, u8 s);
+u8 shl_byte (u8 d, u8 s);
+u16 shl_word (u16 d, u8 s);
+u32 shl_long (u32 d, u8 s);
+u8 shr_byte (u8 d, u8 s);
+u16 shr_word (u16 d, u8 s);
+u32 shr_long (u32 d, u8 s);
+u8 sar_byte (u8 d, u8 s);
+u16 sar_word (u16 d, u8 s);
+u32 sar_long (u32 d, u8 s);
+u16 shld_word (u16 d, u16 fill, u8 s);
+u32 shld_long (u32 d, u32 fill, u8 s);
+u16 shrd_word (u16 d, u16 fill, u8 s);
+u32 shrd_long (u32 d, u32 fill, u8 s);
+u8 sbb_byte (u8 d, u8 s);
+u16 sbb_word (u16 d, u16 s);
+u32 sbb_long (u32 d, u32 s);
+u8 sub_byte (u8 d, u8 s);
+u16 sub_word (u16 d, u16 s);
+u32 sub_long (u32 d, u32 s);
+void test_byte (u8 d, u8 s);
+void test_word (u16 d, u16 s);
+void test_long (u32 d, u32 s);
+u8 xor_byte (u8 d, u8 s);
+u16 xor_word (u16 d, u16 s);
+u32 xor_long (u32 d, u32 s);
+void imul_byte (u8 s);
+void imul_word (u16 s);
+void imul_long (u32 s);
+void imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s);
+void mul_byte (u8 s);
+void mul_word (u16 s);
+void mul_long (u32 s);
+void idiv_byte (u8 s);
+void idiv_word (u16 s);
+void idiv_long (u32 s);
+void div_byte (u8 s);
+void div_word (u16 s);
+void div_long (u32 s);
+void ins (int size);
+void outs (int size);
+u16 mem_access_word (int addr);
+void push_word (u16 w);
+void push_long (u32 w);
+u16 pop_word (void);
+u32 pop_long (void);
+
+#if defined(__HAVE_INLINE_ASSEMBLER__) && !defined(PRIM_OPS_NO_REDEFINE_ASM)
+
+#define aaa_word(d) aaa_word_asm(&M.x86.R_EFLG,d)
+#define aas_word(d) aas_word_asm(&M.x86.R_EFLG,d)
+#define aad_word(d) aad_word_asm(&M.x86.R_EFLG,d)
+#define aam_word(d) aam_word_asm(&M.x86.R_EFLG,d)
+#define adc_byte(d,s) adc_byte_asm(&M.x86.R_EFLG,d,s)
+#define adc_word(d,s) adc_word_asm(&M.x86.R_EFLG,d,s)
+#define adc_long(d,s) adc_long_asm(&M.x86.R_EFLG,d,s)
+#define add_byte(d,s) add_byte_asm(&M.x86.R_EFLG,d,s)
+#define add_word(d,s) add_word_asm(&M.x86.R_EFLG,d,s)
+#define add_long(d,s) add_long_asm(&M.x86.R_EFLG,d,s)
+#define and_byte(d,s) and_byte_asm(&M.x86.R_EFLG,d,s)
+#define and_word(d,s) and_word_asm(&M.x86.R_EFLG,d,s)
+#define and_long(d,s) and_long_asm(&M.x86.R_EFLG,d,s)
+#define cmp_byte(d,s) cmp_byte_asm(&M.x86.R_EFLG,d,s)
+#define cmp_word(d,s) cmp_word_asm(&M.x86.R_EFLG,d,s)
+#define cmp_long(d,s) cmp_long_asm(&M.x86.R_EFLG,d,s)
+#define daa_byte(d) daa_byte_asm(&M.x86.R_EFLG,d)
+#define das_byte(d) das_byte_asm(&M.x86.R_EFLG,d)
+#define dec_byte(d) dec_byte_asm(&M.x86.R_EFLG,d)
+#define dec_word(d) dec_word_asm(&M.x86.R_EFLG,d)
+#define dec_long(d) dec_long_asm(&M.x86.R_EFLG,d)
+#define inc_byte(d) inc_byte_asm(&M.x86.R_EFLG,d)
+#define inc_word(d) inc_word_asm(&M.x86.R_EFLG,d)
+#define inc_long(d) inc_long_asm(&M.x86.R_EFLG,d)
+#define or_byte(d,s) or_byte_asm(&M.x86.R_EFLG,d,s)
+#define or_word(d,s) or_word_asm(&M.x86.R_EFLG,d,s)
+#define or_long(d,s) or_long_asm(&M.x86.R_EFLG,d,s)
+#define neg_byte(s) neg_byte_asm(&M.x86.R_EFLG,s)
+#define neg_word(s) neg_word_asm(&M.x86.R_EFLG,s)
+#define neg_long(s) neg_long_asm(&M.x86.R_EFLG,s)
+#define not_byte(s) not_byte_asm(&M.x86.R_EFLG,s)
+#define not_word(s) not_word_asm(&M.x86.R_EFLG,s)
+#define not_long(s) not_long_asm(&M.x86.R_EFLG,s)
+#define rcl_byte(d,s) rcl_byte_asm(&M.x86.R_EFLG,d,s)
+#define rcl_word(d,s) rcl_word_asm(&M.x86.R_EFLG,d,s)
+#define rcl_long(d,s) rcl_long_asm(&M.x86.R_EFLG,d,s)
+#define rcr_byte(d,s) rcr_byte_asm(&M.x86.R_EFLG,d,s)
+#define rcr_word(d,s) rcr_word_asm(&M.x86.R_EFLG,d,s)
+#define rcr_long(d,s) rcr_long_asm(&M.x86.R_EFLG,d,s)
+#define rol_byte(d,s) rol_byte_asm(&M.x86.R_EFLG,d,s)
+#define rol_word(d,s) rol_word_asm(&M.x86.R_EFLG,d,s)
+#define rol_long(d,s) rol_long_asm(&M.x86.R_EFLG,d,s)
+#define ror_byte(d,s) ror_byte_asm(&M.x86.R_EFLG,d,s)
+#define ror_word(d,s) ror_word_asm(&M.x86.R_EFLG,d,s)
+#define ror_long(d,s) ror_long_asm(&M.x86.R_EFLG,d,s)
+#define shl_byte(d,s) shl_byte_asm(&M.x86.R_EFLG,d,s)
+#define shl_word(d,s) shl_word_asm(&M.x86.R_EFLG,d,s)
+#define shl_long(d,s) shl_long_asm(&M.x86.R_EFLG,d,s)
+#define shr_byte(d,s) shr_byte_asm(&M.x86.R_EFLG,d,s)
+#define shr_word(d,s) shr_word_asm(&M.x86.R_EFLG,d,s)
+#define shr_long(d,s) shr_long_asm(&M.x86.R_EFLG,d,s)
+#define sar_byte(d,s) sar_byte_asm(&M.x86.R_EFLG,d,s)
+#define sar_word(d,s) sar_word_asm(&M.x86.R_EFLG,d,s)
+#define sar_long(d,s) sar_long_asm(&M.x86.R_EFLG,d,s)
+#define shld_word(d,fill,s) shld_word_asm(&M.x86.R_EFLG,d,fill,s)
+#define shld_long(d,fill,s) shld_long_asm(&M.x86.R_EFLG,d,fill,s)
+#define shrd_word(d,fill,s) shrd_word_asm(&M.x86.R_EFLG,d,fill,s)
+#define shrd_long(d,fill,s) shrd_long_asm(&M.x86.R_EFLG,d,fill,s)
+#define sbb_byte(d,s) sbb_byte_asm(&M.x86.R_EFLG,d,s)
+#define sbb_word(d,s) sbb_word_asm(&M.x86.R_EFLG,d,s)
+#define sbb_long(d,s) sbb_long_asm(&M.x86.R_EFLG,d,s)
+#define sub_byte(d,s) sub_byte_asm(&M.x86.R_EFLG,d,s)
+#define sub_word(d,s) sub_word_asm(&M.x86.R_EFLG,d,s)
+#define sub_long(d,s) sub_long_asm(&M.x86.R_EFLG,d,s)
+#define test_byte(d,s) test_byte_asm(&M.x86.R_EFLG,d,s)
+#define test_word(d,s) test_word_asm(&M.x86.R_EFLG,d,s)
+#define test_long(d,s) test_long_asm(&M.x86.R_EFLG,d,s)
+#define xor_byte(d,s) xor_byte_asm(&M.x86.R_EFLG,d,s)
+#define xor_word(d,s) xor_word_asm(&M.x86.R_EFLG,d,s)
+#define xor_long(d,s) xor_long_asm(&M.x86.R_EFLG,d,s)
+#define imul_byte(s) imul_byte_asm(&M.x86.R_EFLG,&M.x86.R_AX,M.x86.R_AL,s)
+#define imul_word(s) imul_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,s)
+#define imul_long(s) imul_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s)
+#define imul_long_direct(res_lo,res_hi,d,s) imul_long_asm(&M.x86.R_EFLG,res_lo,res_hi,d,s)
+#define mul_byte(s) mul_byte_asm(&M.x86.R_EFLG,&M.x86.R_AX,M.x86.R_AL,s)
+#define mul_word(s) mul_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,s)
+#define mul_long(s) mul_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s)
+#define idiv_byte(s) idiv_byte_asm(&M.x86.R_EFLG,&M.x86.R_AL,&M.x86.R_AH,M.x86.R_AX,s)
+#define idiv_word(s) idiv_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,M.x86.R_DX,s)
+#define idiv_long(s) idiv_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,M.x86.R_EDX,s)
+#define div_byte(s) div_byte_asm(&M.x86.R_EFLG,&M.x86.R_AL,&M.x86.R_AH,M.x86.R_AX,s)
+#define div_word(s) div_word_asm(&M.x86.R_EFLG,&M.x86.R_AX,&M.x86.R_DX,M.x86.R_AX,M.x86.R_DX,s)
+#define div_long(s) div_long_asm(&M.x86.R_EFLG,&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,M.x86.R_EDX,s)
+
+#endif
+
+#ifdef __cplusplus
+} /* End of "C" linkage for C++ */
+#endif
+
+#endif /* __X86EMU_PRIM_OPS_H */
diff --git a/cfe/cfe/x86emu/x86emu/regs.h b/cfe/cfe/x86emu/x86emu/regs.h
new file mode 100644
index 0000000..b0a6231
--- /dev/null
+++ b/cfe/cfe/x86emu/x86emu/regs.h
@@ -0,0 +1,351 @@
+/****************************************************************************
+*
+* Realmode X86 Emulator Library
+*
+* Copyright (C) 1996-1999 SciTech Software, Inc.
+* Copyright (C) David Mosberger-Tang
+* Copyright (C) 1999 Egbert Eich
+*
+* ========================================================================
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee,
+* provided that the above copyright notice appear in all copies and that
+* both that copyright notice and this permission notice appear in
+* supporting documentation, and that the name of the authors not be used
+* in advertising or publicity pertaining to distribution of the software
+* without specific, written prior permission. The authors makes no
+* representations about the suitability of this software for any purpose.
+* It is provided "as is" without express or implied warranty.
+*
+* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+* PERFORMANCE OF THIS SOFTWARE.
+*
+* ========================================================================
+*
+* Language: ANSI C
+* Environment: Any
+* Developer: Kendall Bennett
+*
+* Description: Header file for x86 register definitions.
+*
+****************************************************************************/
+
+#ifndef __X86EMU_REGS_H
+#define __X86EMU_REGS_H
+
+#ifdef __mips
+#if defined(__MIPSEB)
+#define __BIG_ENDIAN__
+#elif defined(__MIPSEL)
+#define __LITTLE_ENDIAN__
+#else
+#error "You must define either __MIPSEB or __MIPSEL"
+#endif
+#endif
+
+/*---------------------- Macros and type definitions ----------------------*/
+
+#ifndef __mips
+#pragma pack(1)
+#endif
+
+/*
+ * General EAX, EBX, ECX, EDX type registers. Note that for
+ * portability, and speed, the issue of byte swapping is not addressed
+ * in the registers. All registers are stored in the default format
+ * available on the host machine. The only critical issue is that the
+ * registers should line up EXACTLY in the same manner as they do in
+ * the 386. That is:
+ *
+ * EAX & 0xff === AL
+ * EAX & 0xffff == AX
+ *
+ * etc. The result is that alot of the calculations can then be
+ * done using the native instruction set fully.
+ */
+
+#ifdef __BIG_ENDIAN__
+
+typedef struct {
+ u32 e_reg;
+ } I32_reg_t;
+
+typedef struct {
+ u16 filler0, x_reg;
+ } I16_reg_t;
+
+typedef struct {
+ u8 filler0, filler1, h_reg, l_reg;
+ } I8_reg_t;
+
+#else /* !__BIG_ENDIAN__ */
+
+typedef struct {
+ u32 e_reg;
+ } I32_reg_t;
+
+typedef struct {
+ u16 x_reg;
+ } I16_reg_t;
+
+typedef struct {
+ u8 l_reg, h_reg;
+ } I8_reg_t;
+
+#endif /* BIG_ENDIAN */
+
+typedef union {
+ I32_reg_t I32_reg;
+ I16_reg_t I16_reg;
+ I8_reg_t I8_reg;
+ } i386_general_register;
+
+struct i386_general_regs {
+ i386_general_register A, B, C, D;
+ };
+
+typedef struct i386_general_regs Gen_reg_t;
+
+struct i386_special_regs {
+ i386_general_register SP, BP, SI, DI, IP;
+ u32 FLAGS;
+ };
+
+/*
+ * Segment registers here represent the 16 bit quantities
+ * CS, DS, ES, SS.
+ */
+
+struct i386_segment_regs {
+ u16 CS, DS, SS, ES, FS, GS;
+ };
+
+/* 8 bit registers */
+#define R_AH gen.A.I8_reg.h_reg
+#define R_AL gen.A.I8_reg.l_reg
+#define R_BH gen.B.I8_reg.h_reg
+#define R_BL gen.B.I8_reg.l_reg
+#define R_CH gen.C.I8_reg.h_reg
+#define R_CL gen.C.I8_reg.l_reg
+#define R_DH gen.D.I8_reg.h_reg
+#define R_DL gen.D.I8_reg.l_reg
+
+/* 16 bit registers */
+#define R_AX gen.A.I16_reg.x_reg
+#define R_BX gen.B.I16_reg.x_reg
+#define R_CX gen.C.I16_reg.x_reg
+#define R_DX gen.D.I16_reg.x_reg
+
+/* 32 bit extended registers */
+#define R_EAX gen.A.I32_reg.e_reg
+#define R_EBX gen.B.I32_reg.e_reg
+#define R_ECX gen.C.I32_reg.e_reg
+#define R_EDX gen.D.I32_reg.e_reg
+
+/* special registers */
+#define R_SP spc.SP.I16_reg.x_reg
+#define R_BP spc.BP.I16_reg.x_reg
+#define R_SI spc.SI.I16_reg.x_reg
+#define R_DI spc.DI.I16_reg.x_reg
+#define R_IP spc.IP.I16_reg.x_reg
+#define R_FLG spc.FLAGS
+
+/* special registers */
+#define R_SP spc.SP.I16_reg.x_reg
+#define R_BP spc.BP.I16_reg.x_reg
+#define R_SI spc.SI.I16_reg.x_reg
+#define R_DI spc.DI.I16_reg.x_reg
+#define R_IP spc.IP.I16_reg.x_reg
+#define R_FLG spc.FLAGS
+
+/* special registers */
+#define R_ESP spc.SP.I32_reg.e_reg
+#define R_EBP spc.BP.I32_reg.e_reg
+#define R_ESI spc.SI.I32_reg.e_reg
+#define R_EDI spc.DI.I32_reg.e_reg
+#define R_EIP spc.IP.I32_reg.e_reg
+#define R_EFLG spc.FLAGS
+
+/* segment registers */
+#define R_CS seg.CS
+#define R_DS seg.DS
+#define R_SS seg.SS
+#define R_ES seg.ES
+#define R_FS seg.FS
+#define R_GS seg.GS
+
+/* flag conditions */
+#define FB_CF 0x0001 /* CARRY flag */
+#define FB_PF 0x0004 /* PARITY flag */
+#define FB_AF 0x0010 /* AUX flag */
+#define FB_ZF 0x0040 /* ZERO flag */
+#define FB_SF 0x0080 /* SIGN flag */
+#define FB_TF 0x0100 /* TRAP flag */
+#define FB_IF 0x0200 /* INTERRUPT ENABLE flag */
+#define FB_DF 0x0400 /* DIR flag */
+#define FB_OF 0x0800 /* OVERFLOW flag */
+
+/* 80286 and above always have bit#1 set */
+#define F_ALWAYS_ON (0x0002) /* flag bits always on */
+
+/*
+ * Define a mask for only those flag bits we will ever pass back
+ * (via PUSHF)
+ */
+#define F_MSK (FB_CF|FB_PF|FB_AF|FB_ZF|FB_SF|FB_TF|FB_IF|FB_DF|FB_OF)
+
+/* following bits masked in to a 16bit quantity */
+
+#define F_CF 0x0001 /* CARRY flag */
+#define F_PF 0x0004 /* PARITY flag */
+#define F_AF 0x0010 /* AUX flag */
+#define F_ZF 0x0040 /* ZERO flag */
+#define F_SF 0x0080 /* SIGN flag */
+#define F_TF 0x0100 /* TRAP flag */
+#define F_IF 0x0200 /* INTERRUPT ENABLE flag */
+#define F_DF 0x0400 /* DIR flag */
+#define F_OF 0x0800 /* OVERFLOW flag */
+
+#define TOGGLE_FLAG(flag) (M.x86.R_FLG ^= (flag))
+#define SET_FLAG(flag) (M.x86.R_FLG |= (flag))
+#define CLEAR_FLAG(flag) (M.x86.R_FLG &= ~(flag))
+#define ACCESS_FLAG(flag) (M.x86.R_FLG & (flag))
+#define CLEARALL_FLAG(m) (M.x86.R_FLG = 0)
+
+#define CONDITIONAL_SET_FLAG(COND,FLAG) \
+ if (COND) SET_FLAG(FLAG); else CLEAR_FLAG(FLAG)
+
+#define F_PF_CALC 0x010000 /* PARITY flag has been calced */
+#define F_ZF_CALC 0x020000 /* ZERO flag has been calced */
+#define F_SF_CALC 0x040000 /* SIGN flag has been calced */
+
+#define F_ALL_CALC 0xff0000 /* All have been calced */
+
+/*
+ * Emulator machine state.
+ * Segment usage control.
+ */
+#define SYSMODE_SEG_DS_SS 0x00000001
+#define SYSMODE_SEGOVR_CS 0x00000002
+#define SYSMODE_SEGOVR_DS 0x00000004
+#define SYSMODE_SEGOVR_ES 0x00000008
+#define SYSMODE_SEGOVR_FS 0x00000010
+#define SYSMODE_SEGOVR_GS 0x00000020
+#define SYSMODE_SEGOVR_SS 0x00000040
+#define SYSMODE_PREFIX_REPE 0x00000080
+#define SYSMODE_PREFIX_REPNE 0x00000100
+#define SYSMODE_PREFIX_DATA 0x00000200
+#define SYSMODE_PREFIX_ADDR 0x00000400
+#define SYSMODE_INTR_PENDING 0x10000000
+#define SYSMODE_EXTRN_INTR 0x20000000
+#define SYSMODE_HALTED 0x40000000
+
+#define SYSMODE_SEGMASK (SYSMODE_SEG_DS_SS | \
+ SYSMODE_SEGOVR_CS | \
+ SYSMODE_SEGOVR_DS | \
+ SYSMODE_SEGOVR_ES | \
+ SYSMODE_SEGOVR_FS | \
+ SYSMODE_SEGOVR_GS | \
+ SYSMODE_SEGOVR_SS)
+#define SYSMODE_CLRMASK (SYSMODE_SEG_DS_SS | \
+ SYSMODE_SEGOVR_CS | \
+ SYSMODE_SEGOVR_DS | \
+ SYSMODE_SEGOVR_ES | \
+ SYSMODE_SEGOVR_FS | \
+ SYSMODE_SEGOVR_GS | \
+ SYSMODE_SEGOVR_SS | \
+ SYSMODE_PREFIX_DATA | \
+ SYSMODE_PREFIX_ADDR)
+
+#define INTR_SYNCH 0x1
+#define INTR_ASYNCH 0x2
+#define INTR_HALTED 0x4
+
+typedef struct {
+ struct i386_general_regs gen;
+ struct i386_special_regs spc;
+ struct i386_segment_regs seg;
+ /*
+ * MODE contains information on:
+ * REPE prefix 2 bits repe,repne
+ * SEGMENT overrides 5 bits normal,DS,SS,CS,ES
+ * Delayed flag set 3 bits (zero, signed, parity)
+ * reserved 6 bits
+ * interrupt # 8 bits instruction raised interrupt
+ * BIOS video segregs 4 bits
+ * Interrupt Pending 1 bits
+ * Extern interrupt 1 bits
+ * Halted 1 bits
+ */
+ long mode;
+ u8 intno;
+ volatile int intr; /* mask of pending interrupts */
+ int debug;
+#ifdef DEBUG
+ int check;
+ u16 saved_ip;
+ u16 saved_cs;
+ int enc_pos;
+ int enc_str_pos;
+ char decode_buf[32]; /* encoded byte stream */
+ char decoded_buf[256]; /* disassembled strings */
+#endif
+ } X86EMU_regs;
+
+/****************************************************************************
+REMARKS:
+Structure maintaining the emulator machine state.
+
+MEMBERS:
+x86 - X86 registers
+mem_base - Base real mode memory for the emulator
+mem_size - Size of the real mode memory block for the emulator
+****************************************************************************/
+typedef struct {
+ X86EMU_regs x86;
+ unsigned long mem_base;
+ unsigned long mem_size;
+ void* private;
+ } X86EMU_sysEnv;
+
+#ifndef __mips
+#pragma pack()
+#endif
+
+/*----------------------------- Global Variables --------------------------*/
+
+#ifdef __cplusplus
+extern "C" { /* Use "C" linkage when in C++ mode */
+#endif
+
+/* Global emulator machine state.
+ *
+ * We keep it global to avoid pointer dereferences in the code for speed.
+ */
+
+extern X86EMU_sysEnv _X86EMU_env;
+#define M _X86EMU_env
+
+/*-------------------------- Function Prototypes --------------------------*/
+
+/* Function to log information at runtime */
+
+#ifdef _CFE_
+#include "lib_printf.h"
+#define printk xprintf
+#define sprintf xsprintf
+#else
+void printk(const char *fmt, ...);
+#endif
+
+#ifdef __cplusplus
+} /* End of "C" linkage for C++ */
+#endif
+
+#endif /* __X86EMU_REGS_H */
diff --git a/cfe/cfe/x86emu/x86emu/types.h b/cfe/cfe/x86emu/x86emu/types.h
new file mode 100644
index 0000000..f3d3783
--- /dev/null
+++ b/cfe/cfe/x86emu/x86emu/types.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+*
+* Realmode X86 Emulator Library
+*
+* Copyright (C) 1996-1999 SciTech Software, Inc.
+* Copyright (C) David Mosberger-Tang
+* Copyright (C) 1999 Egbert Eich
+*
+* ========================================================================
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee,
+* provided that the above copyright notice appear in all copies and that
+* both that copyright notice and this permission notice appear in
+* supporting documentation, and that the name of the authors not be used
+* in advertising or publicity pertaining to distribution of the software
+* without specific, written prior permission. The authors makes no
+* representations about the suitability of this software for any purpose.
+* It is provided "as is" without express or implied warranty.
+*
+* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+* PERFORMANCE OF THIS SOFTWARE.
+*
+* ========================================================================
+*
+* Language: ANSI C
+* Environment: Any
+* Developer: Kendall Bennett
+*
+* Description: Header file for x86 emulator type definitions.
+*
+****************************************************************************/
+
+/* $XFree86: xc/extras/x86emu/include/x86emu/types.h,v 1.4 2000/09/26 15:56:44 tsi Exp $ */
+
+#ifndef __X86EMU_TYPES_H
+#define __X86EMU_TYPES_H
+
+#ifndef IN_MODULE
+//#include <sys/types.h>
+#endif
+
+/*
+ * The following kludge is an attempt to work around typedef conflicts with
+ * <sys/types.h>.
+ */
+#define u8 x86emuu8
+#define u16 x86emuu16
+#define u32 x86emuu32
+#define u64 x86emuu64
+#define s8 x86emus8
+#define s16 x86emus16
+#define s32 x86emus32
+#define s64 x86emus64
+#define uint x86emuuint
+#define sint x86emusint
+
+/*---------------------- Macros and type definitions ----------------------*/
+
+/* Currently only for Linux/32bit */
+#if defined(__GNUC__) && !defined(NO_LONG_LONG)
+#define __HAS_LONG_LONG__
+#endif
+
+typedef unsigned char u8;
+typedef unsigned short u16;
+typedef unsigned int u32;
+#ifdef __HAS_LONG_LONG__
+typedef unsigned long long u64;
+#endif
+
+typedef char s8;
+typedef short s16;
+typedef int s32;
+#ifdef __HAS_LONG_LONG__
+typedef long long s64;
+#endif
+
+typedef unsigned int uint;
+typedef int sint;
+
+typedef u16 X86EMU_pioAddr;
+
+#endif /* __X86EMU_TYPES_H */
diff --git a/cfe/cfe/x86emu/x86emu/x86emui.h b/cfe/cfe/x86emu/x86emu/x86emui.h
new file mode 100644
index 0000000..594b344
--- /dev/null
+++ b/cfe/cfe/x86emu/x86emu/x86emui.h
@@ -0,0 +1,109 @@
+/****************************************************************************
+*
+* Realmode X86 Emulator Library
+*
+* Copyright (C) 1996-1999 SciTech Software, Inc.
+* Copyright (C) David Mosberger-Tang
+* Copyright (C) 1999 Egbert Eich
+*
+* ========================================================================
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee,
+* provided that the above copyright notice appear in all copies and that
+* both that copyright notice and this permission notice appear in
+* supporting documentation, and that the name of the authors not be used
+* in advertising or publicity pertaining to distribution of the software
+* without specific, written prior permission. The authors makes no
+* representations about the suitability of this software for any purpose.
+* It is provided "as is" without express or implied warranty.
+*
+* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+* PERFORMANCE OF THIS SOFTWARE.
+*
+* ========================================================================
+*
+* Language: ANSI C
+* Environment: Any
+* Developer: Kendall Bennett
+*
+* Description: Header file for system specific functions. These functions
+* are always compiled and linked in the OS depedent libraries,
+* and never in a binary portable driver.
+*
+****************************************************************************/
+
+/* $XFree86: xc/extras/x86emu/src/x86emu/x86emu/x86emui.h,v 1.3 2000/04/17 16:29:47 eich Exp $ */
+
+#ifndef __X86EMU_X86EMUI_H
+#define __X86EMU_X86EMUI_H
+
+/* If we are compiling in C++ mode, we can compile some functions as
+ * inline to increase performance (however the code size increases quite
+ * dramatically in this case).
+ */
+
+#if defined(__cplusplus) && !defined(_NO_INLINE)
+#define _INLINE inline
+#else
+#define _INLINE static
+#endif
+
+/* Get rid of unused parameters in C++ compilation mode */
+
+#ifdef __cplusplus
+#define X86EMU_UNUSED(v)
+#else
+#define X86EMU_UNUSED(v) v
+#endif
+
+#include "x86emu.h"
+#include "x86emu/regs.h"
+#include "x86emu/debug.h"
+#include "x86emu/decode.h"
+#include "x86emu/ops.h"
+#include "x86emu/prim_ops.h"
+#include "x86emu/fpu.h"
+#include "x86emu/fpu_regs.h"
+
+#ifdef IN_MODULE
+#include <xf86_ansic.h>
+#else
+#ifdef _CFE_
+#include "lib_types.h"
+#include "lib_string.h"
+#else
+#include <stdio.h>
+#include <string.h>
+#endif
+#endif
+/*--------------------------- Inline Functions ----------------------------*/
+
+#ifdef __cplusplus
+extern "C" { /* Use "C" linkage when in C++ mode */
+#endif
+
+extern u8 (X86APIP sys_rdb)(u32 addr);
+extern u16 (X86APIP sys_rdw)(u32 addr);
+extern u32 (X86APIP sys_rdl)(u32 addr);
+extern void (X86APIP sys_wrb)(u32 addr,u8 val);
+extern void (X86APIP sys_wrw)(u32 addr,u16 val);
+extern void (X86APIP sys_wrl)(u32 addr,u32 val);
+
+extern u8 (X86APIP sys_inb)(X86EMU_pioAddr addr);
+extern u16 (X86APIP sys_inw)(X86EMU_pioAddr addr);
+extern u32 (X86APIP sys_inl)(X86EMU_pioAddr addr);
+extern void (X86APIP sys_outb)(X86EMU_pioAddr addr,u8 val);
+extern void (X86APIP sys_outw)(X86EMU_pioAddr addr,u16 val);
+extern void (X86APIP sys_outl)(X86EMU_pioAddr addr,u32 val);
+
+#ifdef __cplusplus
+} /* End of "C" linkage for C++ */
+#endif
+
+#endif /* __X86EMU_X86EMUI_H */
diff --git a/cfe/cfe/zlib/ChangeLog b/cfe/cfe/zlib/ChangeLog
new file mode 100644
index 0000000..567a500
--- /dev/null
+++ b/cfe/cfe/zlib/ChangeLog
@@ -0,0 +1,471 @@
+
+ ChangeLog file for zlib
+
+Changes in 1.1.3 (9 July 1998)
+- fix "an inflate input buffer bug that shows up on rare but persistent
+ occasions" (Mark)
+- fix gzread and gztell for concatenated .gz files (Didier Le Botlan)
+- fix gzseek(..., SEEK_SET) in write mode
+- fix crc check after a gzeek (Frank Faubert)
+- fix miniunzip when the last entry in a zip file is itself a zip file
+ (J Lillge)
+- add contrib/asm586 and contrib/asm686 (Brian Raiter)
+ See http://www.muppetlabs.com/~breadbox/software/assembly.html
+- add support for Delphi 3 in contrib/delphi (Bob Dellaca)
+- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti)
+- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren)
+- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks)
+- added a FAQ file
+
+- Support gzdopen on Mac with Metrowerks (Jason Linhart)
+- Do not redefine Byte on Mac (Brad Pettit & Jason Linhart)
+- define SEEK_END too if SEEK_SET is not defined (Albert Chin-A-Young)
+- avoid some warnings with Borland C (Tom Tanner)
+- fix a problem in contrib/minizip/zip.c for 16-bit MSDOS (Gilles Vollant)
+- emulate utime() for WIN32 in contrib/untgz (Gilles Vollant)
+- allow several arguments to configure (Tim Mooney, Frodo Looijaard)
+- use libdir and includedir in Makefile.in (Tim Mooney)
+- support shared libraries on OSF1 V4 (Tim Mooney)
+- remove so_locations in "make clean" (Tim Mooney)
+- fix maketree.c compilation error (Glenn, Mark)
+- Python interface to zlib now in Python 1.5 (Jeremy Hylton)
+- new Makefile.riscos (Rich Walker)
+- initialize static descriptors in trees.c for embedded targets (Nick Smith)
+- use "foo-gz" in example.c for RISCOS and VMS (Nick Smith)
+- add the OS/2 files in Makefile.in too (Andrew Zabolotny)
+- fix fdopen and halloc macros for Microsoft C 6.0 (Tom Lane)
+- fix maketree.c to allow clean compilation of inffixed.h (Mark)
+- fix parameter check in deflateCopy (Gunther Nikl)
+- cleanup trees.c, use compressed_len only in debug mode (Christian Spieler)
+- Many portability patches by Christian Spieler:
+ . zutil.c, zutil.h: added "const" for zmem*
+ . Make_vms.com: fixed some typos
+ . Make_vms.com: msdos/Makefile.*: removed zutil.h from some dependency lists
+ . msdos/Makefile.msc: remove "default rtl link library" info from obj files
+ . msdos/Makefile.*: use model-dependent name for the built zlib library
+ . msdos/Makefile.emx, nt/Makefile.emx, nt/Makefile.gcc:
+ new makefiles, for emx (DOS/OS2), emx&rsxnt and mingw32 (Windows 9x / NT)
+- use define instead of typedef for Bytef also for MSC small/medium (Tom Lane)
+- replace __far with _far for better portability (Christian Spieler, Tom Lane)
+- fix test for errno.h in configure (Tim Newsham)
+
+Changes in 1.1.2 (19 March 98)
+- added contrib/minzip, mini zip and unzip based on zlib (Gilles Vollant)
+ See http://www.winimage.com/zLibDll/unzip.html
+- preinitialize the inflate tables for fixed codes, to make the code
+ completely thread safe (Mark)
+- some simplifications and slight speed-up to the inflate code (Mark)
+- fix gzeof on non-compressed files (Allan Schrum)
+- add -std1 option in configure for OSF1 to fix gzprintf (Martin Mokrejs)
+- use default value of 4K for Z_BUFSIZE for 16-bit MSDOS (Tim Wegner + Glenn)
+- added os2/Makefile.def and os2/zlib.def (Andrew Zabolotny)
+- add shared lib support for UNIX_SV4.2MP (MATSUURA Takanori)
+- do not wrap extern "C" around system includes (Tom Lane)
+- mention zlib binding for TCL in README (Andreas Kupries)
+- added amiga/Makefile.pup for Amiga powerUP SAS/C PPC (Andreas Kleinert)
+- allow "make install prefix=..." even after configure (Glenn Randers-Pehrson)
+- allow "configure --prefix $HOME" (Tim Mooney)
+- remove warnings in example.c and gzio.c (Glenn Randers-Pehrson)
+- move Makefile.sas to amiga/Makefile.sas
+
+Changes in 1.1.1 (27 Feb 98)
+- fix macros _tr_tally_* in deflate.h for debug mode (Glenn Randers-Pehrson)
+- remove block truncation heuristic which had very marginal effect for zlib
+ (smaller lit_bufsize than in gzip 1.2.4) and degraded a little the
+ compression ratio on some files. This also allows inlining _tr_tally for
+ matches in deflate_slow.
+- added msdos/Makefile.w32 for WIN32 Microsoft Visual C++ (Bob Frazier)
+
+Changes in 1.1.0 (24 Feb 98)
+- do not return STREAM_END prematurely in inflate (John Bowler)
+- revert to the zlib 1.0.8 inflate to avoid the gcc 2.8.0 bug (Jeremy Buhler)
+- compile with -DFASTEST to get compression code optimized for speed only
+- in minigzip, try mmap'ing the input file first (Miguel Albrecht)
+- increase size of I/O buffers in minigzip.c and gzio.c (not a big gain
+ on Sun but significant on HP)
+
+- add a pointer to experimental unzip library in README (Gilles Vollant)
+- initialize variable gcc in configure (Chris Herborth)
+
+Changes in 1.0.9 (17 Feb 1998)
+- added gzputs and gzgets functions
+- do not clear eof flag in gzseek (Mark Diekhans)
+- fix gzseek for files in transparent mode (Mark Diekhans)
+- do not assume that vsprintf returns the number of bytes written (Jens Krinke)
+- replace EXPORT with ZEXPORT to avoid conflict with other programs
+- added compress2 in zconf.h, zlib.def, zlib.dnt
+- new asm code from Gilles Vollant in contrib/asm386
+- simplify the inflate code (Mark):
+ . Replace ZALLOC's in huft_build() with single ZALLOC in inflate_blocks_new()
+ . ZALLOC the length list in inflate_trees_fixed() instead of using stack
+ . ZALLOC the value area for huft_build() instead of using stack
+ . Simplify Z_FINISH check in inflate()
+
+- Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8
+- in inftrees.c, avoid cc -O bug on HP (Farshid Elahi)
+- in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with
+ the declaration of FAR (Gilles VOllant)
+- install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann)
+- read_buf buf parameter of type Bytef* instead of charf*
+- zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout)
+- do not redeclare unlink in minigzip.c for WIN32 (John Bowler)
+- fix check for presence of directories in "make install" (Ian Willis)
+
+Changes in 1.0.8 (27 Jan 1998)
+- fixed offsets in contrib/asm386/gvmat32.asm (Gilles Vollant)
+- fix gzgetc and gzputc for big endian systems (Markus Oberhumer)
+- added compress2() to allow setting the compression level
+- include sys/types.h to get off_t on some systems (Marc Lehmann & QingLong)
+- use constant arrays for the static trees in trees.c instead of computing
+ them at run time (thanks to Ken Raeburn for this suggestion). To create
+ trees.h, compile with GEN_TREES_H and run "make test".
+- check return code of example in "make test" and display result
+- pass minigzip command line options to file_compress
+- simplifying code of inflateSync to avoid gcc 2.8 bug
+
+- support CC="gcc -Wall" in configure -s (QingLong)
+- avoid a flush caused by ftell in gzopen for write mode (Ken Raeburn)
+- fix test for shared library support to avoid compiler warnings
+- zlib.lib -> zlib.dll in msdos/zlib.rc (Gilles Vollant)
+- check for TARGET_OS_MAC in addition to MACOS (Brad Pettit)
+- do not use fdopen for Metrowerks on Mac (Brad Pettit))
+- add checks for gzputc and gzputc in example.c
+- avoid warnings in gzio.c and deflate.c (Andreas Kleinert)
+- use const for the CRC table (Ken Raeburn)
+- fixed "make uninstall" for shared libraries
+- use Tracev instead of Trace in infblock.c
+- in example.c use correct compressed length for test_sync
+- suppress +vnocompatwarnings in configure for HPUX (not always supported)
+
+Changes in 1.0.7 (20 Jan 1998)
+- fix gzseek which was broken in write mode
+- return error for gzseek to negative absolute position
+- fix configure for Linux (Chun-Chung Chen)
+- increase stack space for MSC (Tim Wegner)
+- get_crc_table and inflateSyncPoint are EXPORTed (Gilles Vollant)
+- define EXPORTVA for gzprintf (Gilles Vollant)
+- added man page zlib.3 (Rick Rodgers)
+- for contrib/untgz, fix makedir() and improve Makefile
+
+- check gzseek in write mode in example.c
+- allocate extra buffer for seeks only if gzseek is actually called
+- avoid signed/unsigned comparisons (Tim Wegner, Gilles Vollant)
+- add inflateSyncPoint in zconf.h
+- fix list of exported functions in nt/zlib.dnt and mdsos/zlib.def
+
+Changes in 1.0.6 (19 Jan 1998)
+- add functions gzprintf, gzputc, gzgetc, gztell, gzeof, gzseek, gzrewind and
+ gzsetparams (thanks to Roland Giersig and Kevin Ruland for some of this code)
+- Fix a deflate bug occuring only with compression level 0 (thanks to
+ Andy Buckler for finding this one).
+- In minigzip, pass transparently also the first byte for .Z files.
+- return Z_BUF_ERROR instead of Z_OK if output buffer full in uncompress()
+- check Z_FINISH in inflate (thanks to Marc Schluper)
+- Implement deflateCopy (thanks to Adam Costello)
+- make static libraries by default in configure, add --shared option.
+- move MSDOS or Windows specific files to directory msdos
+- suppress the notion of partial flush to simplify the interface
+ (but the symbol Z_PARTIAL_FLUSH is kept for compatibility with 1.0.4)
+- suppress history buffer provided by application to simplify the interface
+ (this feature was not implemented anyway in 1.0.4)
+- next_in and avail_in must be initialized before calling inflateInit or
+ inflateInit2
+- add EXPORT in all exported functions (for Windows DLL)
+- added Makefile.nt (thanks to Stephen Williams)
+- added the unsupported "contrib" directory:
+ contrib/asm386/ by Gilles Vollant <info@winimage.com>
+ 386 asm code replacing longest_match().
+ contrib/iostream/ by Kevin Ruland <kevin@rodin.wustl.edu>
+ A C++ I/O streams interface to the zlib gz* functions
+ contrib/iostream2/ by Tyge Løvset <Tyge.Lovset@cmr.no>
+ Another C++ I/O streams interface
+ contrib/untgz/ by "Pedro A. Aranda Guti\irrez" <paag@tid.es>
+ A very simple tar.gz file extractor using zlib
+ contrib/visual-basic.txt by Carlos Rios <c_rios@sonda.cl>
+ How to use compress(), uncompress() and the gz* functions from VB.
+- pass params -f (filtered data), -h (huffman only), -1 to -9 (compression
+ level) in minigzip (thanks to Tom Lane)
+
+- use const for rommable constants in deflate
+- added test for gzseek and gztell in example.c
+- add undocumented function inflateSyncPoint() (hack for Paul Mackerras)
+- add undocumented function zError to convert error code to string
+ (for Tim Smithers)
+- Allow compilation of gzio with -DNO_DEFLATE to avoid the compression code.
+- Use default memcpy for Symantec MSDOS compiler.
+- Add EXPORT keyword for check_func (needed for Windows DLL)
+- add current directory to LD_LIBRARY_PATH for "make test"
+- create also a link for libz.so.1
+- added support for FUJITSU UXP/DS (thanks to Toshiaki Nomura)
+- use $(SHAREDLIB) instead of libz.so in Makefile.in (for HPUX)
+- added -soname for Linux in configure (Chun-Chung Chen,
+- assign numbers to the exported functions in zlib.def (for Windows DLL)
+- add advice in zlib.h for best usage of deflateSetDictionary
+- work around compiler bug on Atari (cast Z_NULL in call of s->checkfn)
+- allow compilation with ANSI keywords only enabled for TurboC in large model
+- avoid "versionString"[0] (Borland bug)
+- add NEED_DUMMY_RETURN for Borland
+- use variable z_verbose for tracing in debug mode (L. Peter Deutsch).
+- allow compilation with CC
+- defined STDC for OS/2 (David Charlap)
+- limit external names to 8 chars for MVS (Thomas Lund)
+- in minigzip.c, use static buffers only for 16-bit systems
+- fix suffix check for "minigzip -d foo.gz"
+- do not return an error for the 2nd of two consecutive gzflush() (Felix Lee)
+- use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau)
+- added makelcc.bat for lcc-win32 (Tom St Denis)
+- in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe)
+- Avoid expanded $Id: ChangeLog,v 1.1 2001/11/09 01:48:01 mpl Exp $. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion.
+- check for unistd.h in configure (for off_t)
+- remove useless check parameter in inflate_blocks_free
+- avoid useless assignment of s->check to itself in inflate_blocks_new
+- do not flush twice in gzclose (thanks to Ken Raeburn)
+- rename FOPEN as F_OPEN to avoid clash with /usr/include/sys/file.h
+- use NO_ERRNO_H instead of enumeration of operating systems with errno.h
+- work around buggy fclose on pipes for HP/UX
+- support zlib DLL with BORLAND C++ 5.0 (thanks to Glenn Randers-Pehrson)
+- fix configure if CC is already equal to gcc
+
+Changes in 1.0.5 (3 Jan 98)
+- Fix inflate to terminate gracefully when fed corrupted or invalid data
+- Use const for rommable constants in inflate
+- Eliminate memory leaks on error conditions in inflate
+- Removed some vestigial code in inflate
+- Update web address in README
+
+Changes in 1.0.4 (24 Jul 96)
+- In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF
+ bit, so the decompressor could decompress all the correct data but went
+ on to attempt decompressing extra garbage data. This affected minigzip too.
+- zlibVersion and gzerror return const char* (needed for DLL)
+- port to RISCOS (no fdopen, no multiple dots, no unlink, no fileno)
+- use z_error only for DEBUG (avoid problem with DLLs)
+
+Changes in 1.0.3 (2 Jul 96)
+- use z_streamp instead of z_stream *, which is now a far pointer in MSDOS
+ small and medium models; this makes the library incompatible with previous
+ versions for these models. (No effect in large model or on other systems.)
+- return OK instead of BUF_ERROR if previous deflate call returned with
+ avail_out as zero but there is nothing to do
+- added memcmp for non STDC compilers
+- define NO_DUMMY_DECL for more Mac compilers (.h files merged incorrectly)
+- define __32BIT__ if __386__ or i386 is defined (pb. with Watcom and SCO)
+- better check for 16-bit mode MSC (avoids problem with Symantec)
+
+Changes in 1.0.2 (23 May 96)
+- added Windows DLL support
+- added a function zlibVersion (for the DLL support)
+- fixed declarations using Bytef in infutil.c (pb with MSDOS medium model)
+- Bytef is define's instead of typedef'd only for Borland C
+- avoid reading uninitialized memory in example.c
+- mention in README that the zlib format is now RFC1950
+- updated Makefile.dj2
+- added algorithm.doc
+
+Changes in 1.0.1 (20 May 96) [1.0 skipped to avoid confusion]
+- fix array overlay in deflate.c which sometimes caused bad compressed data
+- fix inflate bug with empty stored block
+- fix MSDOS medium model which was broken in 0.99
+- fix deflateParams() which could generated bad compressed data.
+- Bytef is define'd instead of typedef'ed (work around Borland bug)
+- added an INDEX file
+- new makefiles for DJGPP (Makefile.dj2), 32-bit Borland (Makefile.b32),
+ Watcom (Makefile.wat), Amiga SAS/C (Makefile.sas)
+- speed up adler32 for modern machines without auto-increment
+- added -ansi for IRIX in configure
+- static_init_done in trees.c is an int
+- define unlink as delete for VMS
+- fix configure for QNX
+- add configure branch for SCO and HPUX
+- avoid many warnings (unused variables, dead assignments, etc...)
+- no fdopen for BeOS
+- fix the Watcom fix for 32 bit mode (define FAR as empty)
+- removed redefinition of Byte for MKWERKS
+- work around an MWKERKS bug (incorrect merge of all .h files)
+
+Changes in 0.99 (27 Jan 96)
+- allow preset dictionary shared between compressor and decompressor
+- allow compression level 0 (no compression)
+- add deflateParams in zlib.h: allow dynamic change of compression level
+ and compression strategy.
+- test large buffers and deflateParams in example.c
+- add optional "configure" to build zlib as a shared library
+- suppress Makefile.qnx, use configure instead
+- fixed deflate for 64-bit systems (detected on Cray)
+- fixed inflate_blocks for 64-bit systems (detected on Alpha)
+- declare Z_DEFLATED in zlib.h (possible parameter for deflateInit2)
+- always return Z_BUF_ERROR when deflate() has nothing to do
+- deflateInit and inflateInit are now macros to allow version checking
+- prefix all global functions and types with z_ with -DZ_PREFIX
+- make falloc completely reentrant (inftrees.c)
+- fixed very unlikely race condition in ct_static_init
+- free in reverse order of allocation to help memory manager
+- use zlib-1.0/* instead of zlib/* inside the tar.gz
+- make zlib warning-free with "gcc -O3 -Wall -Wwrite-strings -Wpointer-arith
+ -Wconversion -Wstrict-prototypes -Wmissing-prototypes"
+- allow gzread on concatenated .gz files
+- deflateEnd now returns Z_DATA_ERROR if it was premature
+- deflate is finally (?) fully deterministic (no matches beyond end of input)
+- Document Z_SYNC_FLUSH
+- add uninstall in Makefile
+- Check for __cpluplus in zlib.h
+- Better test in ct_align for partial flush
+- avoid harmless warnings for Borland C++
+- initialize hash_head in deflate.c
+- avoid warning on fdopen (gzio.c) for HP cc -Aa
+- include stdlib.h for STDC compilers
+- include errno.h for Cray
+- ignore error if ranlib doesn't exist
+- call ranlib twice for NeXTSTEP
+- use exec_prefix instead of prefix for libz.a
+- renamed ct_* as _tr_* to avoid conflict with applications
+- clear z->msg in inflateInit2 before any error return
+- initialize opaque in example.c, gzio.c, deflate.c and inflate.c
+- fixed typo in zconf.h (_GNUC__ => __GNUC__)
+- check for WIN32 in zconf.h and zutil.c (avoid farmalloc in 32-bit mode)
+- fix typo in Make_vms.com (f$trnlnm -> f$getsyi)
+- in fcalloc, normalize pointer if size > 65520 bytes
+- don't use special fcalloc for 32 bit Borland C++
+- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc...
+- use Z_BINARY instead of BINARY
+- document that gzclose after gzdopen will close the file
+- allow "a" as mode in gzopen.
+- fix error checking in gzread
+- allow skipping .gz extra-field on pipes
+- added reference to Perl interface in README
+- put the crc table in FAR data (I dislike more and more the medium model :)
+- added get_crc_table
+- added a dimension to all arrays (Borland C can't count).
+- workaround Borland C bug in declaration of inflate_codes_new & inflate_fast
+- guard against multiple inclusion of *.h (for precompiled header on Mac)
+- Watcom C pretends to be Microsoft C small model even in 32 bit mode.
+- don't use unsized arrays to avoid silly warnings by Visual C++:
+ warning C4746: 'inflate_mask' : unsized array treated as '__far'
+ (what's wrong with far data in far model?).
+- define enum out of inflate_blocks_state to allow compilation with C++
+
+Changes in 0.95 (16 Aug 95)
+- fix MSDOS small and medium model (now easier to adapt to any compiler)
+- inlined send_bits
+- fix the final (:-) bug for deflate with flush (output was correct but
+ not completely flushed in rare occasions).
+- default window size is same for compression and decompression
+ (it's now sufficient to set MAX_WBITS in zconf.h).
+- voidp -> voidpf and voidnp -> voidp (for consistency with other
+ typedefs and because voidnp was not near in large model).
+
+Changes in 0.94 (13 Aug 95)
+- support MSDOS medium model
+- fix deflate with flush (could sometimes generate bad output)
+- fix deflateReset (zlib header was incorrectly suppressed)
+- added support for VMS
+- allow a compression level in gzopen()
+- gzflush now calls fflush
+- For deflate with flush, flush even if no more input is provided.
+- rename libgz.a as libz.a
+- avoid complex expression in infcodes.c triggering Turbo C bug
+- work around a problem with gcc on Alpha (in INSERT_STRING)
+- don't use inline functions (problem with some gcc versions)
+- allow renaming of Byte, uInt, etc... with #define.
+- avoid warning about (unused) pointer before start of array in deflate.c
+- avoid various warnings in gzio.c, example.c, infblock.c, adler32.c, zutil.c
+- avoid reserved word 'new' in trees.c
+
+Changes in 0.93 (25 June 95)
+- temporarily disable inline functions
+- make deflate deterministic
+- give enough lookahead for PARTIAL_FLUSH
+- Set binary mode for stdin/stdout in minigzip.c for OS/2
+- don't even use signed char in inflate (not portable enough)
+- fix inflate memory leak for segmented architectures
+
+Changes in 0.92 (3 May 95)
+- don't assume that char is signed (problem on SGI)
+- Clear bit buffer when starting a stored block
+- no memcpy on Pyramid
+- suppressed inftest.c
+- optimized fill_window, put longest_match inline for gcc
+- optimized inflate on stored blocks.
+- untabify all sources to simplify patches
+
+Changes in 0.91 (2 May 95)
+- Default MEM_LEVEL is 8 (not 9 for Unix) as documented in zlib.h
+- Document the memory requirements in zconf.h
+- added "make install"
+- fix sync search logic in inflateSync
+- deflate(Z_FULL_FLUSH) now works even if output buffer too short
+- after inflateSync, don't scare people with just "lo world"
+- added support for DJGPP
+
+Changes in 0.9 (1 May 95)
+- don't assume that zalloc clears the allocated memory (the TurboC bug
+ was Mark's bug after all :)
+- let again gzread copy uncompressed data unchanged (was working in 0.71)
+- deflate(Z_FULL_FLUSH), inflateReset and inflateSync are now fully implemented
+- added a test of inflateSync in example.c
+- moved MAX_WBITS to zconf.h because users might want to change that.
+- document explicitly that zalloc(64K) on MSDOS must return a normalized
+ pointer (zero offset)
+- added Makefiles for Microsoft C, Turbo C, Borland C++
+- faster crc32()
+
+Changes in 0.8 (29 April 95)
+- added fast inflate (inffast.c)
+- deflate(Z_FINISH) now returns Z_STREAM_END when done. Warning: this
+ is incompatible with previous versions of zlib which returned Z_OK.
+- work around a TurboC compiler bug (bad code for b << 0, see infutil.h)
+ (actually that was not a compiler bug, see 0.81 above)
+- gzread no longer reads one extra byte in certain cases
+- In gzio destroy(), don't reference a freed structure
+- avoid many warnings for MSDOS
+- avoid the ERROR symbol which is used by MS Windows
+
+Changes in 0.71 (14 April 95)
+- Fixed more MSDOS compilation problems :( There is still a bug with
+ TurboC large model.
+
+Changes in 0.7 (14 April 95)
+- Added full inflate support.
+- Simplified the crc32() interface. The pre- and post-conditioning
+ (one's complement) is now done inside crc32(). WARNING: this is
+ incompatible with previous versions; see zlib.h for the new usage.
+
+Changes in 0.61 (12 April 95)
+- workaround for a bug in TurboC. example and minigzip now work on MSDOS.
+
+Changes in 0.6 (11 April 95)
+- added minigzip.c
+- added gzdopen to reopen a file descriptor as gzFile
+- added transparent reading of non-gziped files in gzread.
+- fixed bug in gzread (don't read crc as data)
+- fixed bug in destroy (gzio.c) (don't return Z_STREAM_END for gzclose).
+- don't allocate big arrays in the stack (for MSDOS)
+- fix some MSDOS compilation problems
+
+Changes in 0.5:
+- do real compression in deflate.c. Z_PARTIAL_FLUSH is supported but
+ not yet Z_FULL_FLUSH.
+- support decompression but only in a single step (forced Z_FINISH)
+- added opaque object for zalloc and zfree.
+- added deflateReset and inflateReset
+- added a variable zlib_version for consistency checking.
+- renamed the 'filter' parameter of deflateInit2 as 'strategy'.
+ Added Z_FILTERED and Z_HUFFMAN_ONLY constants.
+
+Changes in 0.4:
+- avoid "zip" everywhere, use zlib instead of ziplib.
+- suppress Z_BLOCK_FLUSH, interpret Z_PARTIAL_FLUSH as block flush
+ if compression method == 8.
+- added adler32 and crc32
+- renamed deflateOptions as deflateInit2, call one or the other but not both
+- added the method parameter for deflateInit2.
+- added inflateInit2
+- simplied considerably deflateInit and inflateInit by not supporting
+ user-provided history buffer. This is supported only in deflateInit2
+ and inflateInit2.
+
+Changes in 0.3:
+- prefix all macro names with Z_
+- use Z_FINISH instead of deflateEnd to finish compression.
+- added Z_HUFFMAN_ONLY
+- added gzerror()
diff --git a/cfe/cfe/zlib/FAQ b/cfe/cfe/zlib/FAQ
new file mode 100644
index 0000000..0feb6d3
--- /dev/null
+++ b/cfe/cfe/zlib/FAQ
@@ -0,0 +1,72 @@
+
+ Frequently Asked Questions about zlib
+
+
+If your question is not there, please check the zlib home page
+http://www.cdrom.com/pub/infozip/zlib/ which may have more recent information.
+
+
+1) I need a Windows DLL
+2) I need a Visual Basic interface to zlib
+3) compress() returns Z_BUF_ERROR
+4) deflate or inflate returns Z_BUF_ERROR
+5) Where is the zlib documentation (man pages, etc...)?
+6) Why don't you use GNU autoconf, libtool, etc...?
+7) There is a bug in zlib.
+8) I get "undefined reference to gzputc"
+
+
+
+1) I need a Windows DLL
+
+ The zlib sources can be compiled without change to produce a DLL.
+ If you want a precompiled DLL, see http://www.winimage.com/zLibDll
+
+
+2) I need a Visual Basic interface to zlib
+
+ See http://www.tcfb.com/dowseware/cmp-z-it.zip
+ http://web2.airmail.net/markn/articles/zlibtool/zlibtool.htm
+ and contrib/visual-basic.txt
+
+3) compress() returns Z_BUF_ERROR
+
+ Make sure that before the call of compress, the length of the
+ compressed buffer is equal to the total size of the compressed buffer
+ and not zero. For Visual Basic, check that this parameter is passed
+ by reference ("as any"), not by value ("as long").
+
+
+4) deflate or inflate returns Z_BUF_ERROR
+
+ Make sure that before the call avail_in and avail_out are not zero.
+
+
+5) Where is the zlib documentation (man pages, etc...)?
+
+ It's in zlib.h for the moment. Volunteers to transform this
+ to man pages, please contact jloup@gzip.org. Examples of zlib usage
+ are in the files example.c and minigzip.c.
+
+
+6) Why don't you use GNU autoconf, libtool, etc...?
+
+ Because we would like to keep zlib as a very small and simple package.
+ zlib is rather portable and doesn't need much configuration.
+
+
+7) There is a bug in zlib.
+
+ Most of the time, such problems are due to an incorrect usage
+ of zlib. Please try to reproduce the problem with a small
+ program and send us the corresponding source at zlib@quest.jpl.nasa.gov
+ Do not send multi-megabyte data files without prior agreement.
+
+
+8) I get "undefined reference to gzputc"
+
+ If "make test" produces something like
+ example.o(.text+0x174):
+ check that you don't have old files libz.* in /usr/lib, /usr/local/lib
+ or /usr/X11R6/lib. Remove old versions then do "make install".
+
diff --git a/cfe/cfe/zlib/INDEX b/cfe/cfe/zlib/INDEX
new file mode 100644
index 0000000..8a24576
--- /dev/null
+++ b/cfe/cfe/zlib/INDEX
@@ -0,0 +1,86 @@
+ChangeLog history of changes
+INDEX this file
+FAQ Frequently Asked Questions about zlib
+Make_vms.com script for Vax/VMS
+Makefile makefile for Unix (generated by configure)
+Makefile.in makefile for Unix (template for configure)
+Makefile.riscos makefile for RISCOS
+README guess what
+algorithm.txt description of the (de)compression algorithm
+configure configure script for Unix
+descrip.mms makefile for Vax/VMS
+zlib.3 mini man page for zlib (volunteers to write full
+ man pages from zlib.h welcome. write to jloup@gzip.org)
+
+amiga/Makefile.sas makefile for Amiga SAS/C
+amiga/Makefile.pup makefile for Amiga powerUP SAS/C PPC
+
+msdos/Makefile.w32 makefile for Microsoft Visual C++ 32-bit
+msdos/Makefile.b32 makefile for Borland C++ 32-bit
+msdos/Makefile.bor makefile for Borland C/C++ 16-bit
+msdos/Makefile.dj2 makefile for DJGPP 2.x
+msdos/Makefile.emx makefile for EMX 0.9c (32-bit DOS/OS2)
+msdos/Makefile.msc makefile for Microsoft C 16-bit
+msdos/Makefile.tc makefile for Turbo C
+msdos/Makefile.wat makefile for Watcom C
+msdos/zlib.def definition file for Windows DLL
+msdos/zlib.rc definition file for Windows DLL
+
+nt/Makefile.nt makefile for Windows NT
+nt/zlib.dnt definition file for Windows NT DLL
+nt/Makefile.emx makefile for EMX 0.9c/RSXNT 1.41 (Win32 Intel)
+nt/Makefile.gcc makefile for Windows NT using GCC (mingw32)
+
+
+ zlib public header files (must be kept):
+zconf.h
+zlib.h
+
+ private source files used to build the zlib library:
+adler32.c
+compress.c
+crc32.c
+deflate.c
+deflate.h
+gzio.c
+infblock.c
+infblock.h
+infcodes.c
+infcodes.h
+inffast.c
+inffast.h
+inflate.c
+inftrees.c
+inftrees.h
+infutil.c
+infutil.h
+maketree.c
+trees.c
+uncompr.c
+zutil.c
+zutil.h
+
+ source files for sample programs:
+example.c
+minigzip.c
+
+ unsupported contribution by third parties
+
+contrib/asm386/ by Gilles Vollant <info@winimage.com>
+ 386 asm code replacing longest_match().
+
+contrib/minizip/ by Gilles Vollant <info@winimage.com>
+ Mini zip and unzip based on zlib
+ See http://www.winimage.com/zLibDll/unzip.html
+
+contrib/iostream/ by Kevin Ruland <kevin@rodin.wustl.edu>
+ A C++ I/O streams interface to the zlib gz* functions
+
+contrib/iostream2/ by Tyge Løvset <Tyge.Lovset@cmr.no>
+ Another C++ I/O streams interface
+
+contrib/untgz/ by "Pedro A. Aranda Guti\irrez" <paag@tid.es>
+ A very simple tar.gz extractor using zlib
+
+contrib/visual-basic.txt by Carlos Rios <c_rios@sonda.cl>
+ How to use compress(), uncompress() and the gz* functions from VB.
diff --git a/cfe/cfe/zlib/Make_vms.com b/cfe/cfe/zlib/Make_vms.com
new file mode 100644
index 0000000..1c57e8f
--- /dev/null
+++ b/cfe/cfe/zlib/Make_vms.com
@@ -0,0 +1,115 @@
+$! make libz under VMS
+$! written by Martin P.J. Zinser <m.zinser@gsi.de>
+$!
+$! Look for the compiler used
+$!
+$ ccopt = ""
+$ if f$getsyi("HW_MODEL").ge.1024
+$ then
+$ ccopt = "/prefix=all"+ccopt
+$ comp = "__decc__=1"
+$ if f$trnlnm("SYS").eqs."" then define sys sys$library:
+$ else
+$ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
+$ then
+$ comp = "__vaxc__=1"
+$ if f$trnlnm("SYS").eqs."" then define sys sys$library:
+$ else
+$ if f$trnlnm("SYS").eqs."" then define sys decc$library_include:
+$ ccopt = "/decc/prefix=all"+ccopt
+$ comp = "__decc__=1"
+$ endif
+$ endif
+$!
+$! Build the thing plain or with mms
+$!
+$ write sys$output "Compiling Zlib sources ..."
+$ if f$search("SYS$SYSTEM:MMS.EXE").eqs.""
+$ then
+$ dele example.obj;*,minigzip.obj;*
+$ CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" -
+ adler32.c zlib.h zconf.h
+$ CALL MAKE compress.OBJ "CC ''CCOPT' compress" -
+ compress.c zlib.h zconf.h
+$ CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" -
+ crc32.c zlib.h zconf.h
+$ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" -
+ deflate.c deflate.h zutil.h zlib.h zconf.h
+$ CALL MAKE gzio.OBJ "CC ''CCOPT' gzio" -
+ gzio.c zutil.h zlib.h zconf.h
+$ CALL MAKE infblock.OBJ "CC ''CCOPT' infblock" -
+ infblock.c zutil.h zlib.h zconf.h infblock.h
+$ CALL MAKE infcodes.OBJ "CC ''CCOPT' infcodes" -
+ infcodes.c zutil.h zlib.h zconf.h inftrees.h
+$ CALL MAKE inffast.OBJ "CC ''CCOPT' inffast" -
+ inffast.c zutil.h zlib.h zconf.h inffast.h
+$ CALL MAKE inflate.OBJ "CC ''CCOPT' inflate" -
+ inflate.c zutil.h zlib.h zconf.h infblock.h
+$ CALL MAKE inftrees.OBJ "CC ''CCOPT' inftrees" -
+ inftrees.c zutil.h zlib.h zconf.h inftrees.h
+$ CALL MAKE infutil.OBJ "CC ''CCOPT' infutil" -
+ infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
+$ CALL MAKE trees.OBJ "CC ''CCOPT' trees" -
+ trees.c deflate.h zutil.h zlib.h zconf.h
+$ CALL MAKE uncompr.OBJ "CC ''CCOPT' uncompr" -
+ uncompr.c zlib.h zconf.h
+$ CALL MAKE zutil.OBJ "CC ''CCOPT' zutil" -
+ zutil.c zutil.h zlib.h zconf.h
+$ write sys$output "Building Zlib ..."
+$ CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ
+$ write sys$output "Building example..."
+$ CALL MAKE example.OBJ "CC ''CCOPT' example" -
+ example.c zlib.h zconf.h
+$ call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb
+$ write sys$output "Building minigzip..."
+$ CALL MAKE minigzip.OBJ "CC ''CCOPT' minigzip" -
+ minigzip.c zlib.h zconf.h
+$ call make minigzip.exe -
+ "LINK minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib" -
+ minigzip.obj libz.olb
+$ else
+$ mms/macro=('comp')
+$ endif
+$ write sys$output "Zlib build completed"
+$ exit
+$!
+$!
+$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES
+$ V = 'F$Verify(0)
+$! P1 = What we are trying to make
+$! P2 = Command to make it
+$! P3 - P8 What it depends on
+$
+$ If F$Search(P1) .Eqs. "" Then Goto Makeit
+$ Time = F$CvTime(F$File(P1,"RDT"))
+$arg=3
+$Loop:
+$ Argument = P'arg
+$ If Argument .Eqs. "" Then Goto Exit
+$ El=0
+$Loop2:
+$ File = F$Element(El," ",Argument)
+$ If File .Eqs. " " Then Goto Endl
+$ AFile = ""
+$Loop3:
+$ OFile = AFile
+$ AFile = F$Search(File)
+$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
+$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
+$ Goto Loop3
+$NextEL:
+$ El = El + 1
+$ Goto Loop2
+$EndL:
+$ arg=arg+1
+$ If arg .Le. 8 Then Goto Loop
+$ Goto Exit
+$
+$Makeit:
+$ VV=F$VERIFY(0)
+$ write sys$output P2
+$ 'P2
+$ VV='F$Verify(VV)
+$Exit:
+$ If V Then Set Verify
+$ENDSUBROUTINE
diff --git a/cfe/cfe/zlib/Makefile b/cfe/cfe/zlib/Makefile
new file mode 100644
index 0000000..e9224bb
--- /dev/null
+++ b/cfe/cfe/zlib/Makefile
@@ -0,0 +1,28 @@
+
+#ALLOBJS += adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
+# zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
+
+#ALLOBJS += adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
+# zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
+
+ALLOBJS += adler32.o uncompr.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o zutil.o
+CFLAGS += -DCFG_ZLIB=1 -DMY_ZCALLOC -DNO_MEMCPY
+
+adler32.o: zlib.h zconf.h
+compress.o: zlib.h zconf.h
+crc32.o: zlib.h zconf.h
+deflate.o: deflate.h zutil.h zlib.h zconf.h
+example.o: zlib.h zconf.h
+gzio.o: zutil.h zlib.h zconf.h
+infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
+infcodes.o: zutil.h zlib.h zconf.h
+infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
+inffast.o: zutil.h zlib.h zconf.h inftrees.h
+inffast.o: infblock.h infcodes.h infutil.h inffast.h
+inflate.o: zutil.h zlib.h zconf.h infblock.h
+inftrees.o: zutil.h zlib.h zconf.h inftrees.h
+infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
+minigzip.o: zlib.h zconf.h
+trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
+uncompr.o: zlib.h zconf.h
+zutil.o: zutil.h zlib.h zconf.h
diff --git a/cfe/cfe/zlib/Makefile.in b/cfe/cfe/zlib/Makefile.in
new file mode 100644
index 0000000..3a3b116
--- /dev/null
+++ b/cfe/cfe/zlib/Makefile.in
@@ -0,0 +1,174 @@
+# Makefile for zlib
+# Copyright (C) 1995-1998 Jean-loup Gailly.
+# For conditions of distribution and use, see copyright notice in zlib.h
+
+# To compile and test, type:
+# ./configure; make test
+# The call of configure is optional if you don't have special requirements
+# If you wish to build zlib as a shared library, use: ./configure -s
+
+# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
+# make install
+# To install in $HOME instead of /usr/local, use:
+# make install prefix=$HOME
+
+CC=cc
+
+CFLAGS=-O
+#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
+#CFLAGS=-g -DDEBUG
+#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
+# -Wstrict-prototypes -Wmissing-prototypes
+
+LDFLAGS=-L. -lz
+LDSHARED=$(CC)
+CPP=$(CC) -E
+
+VER=1.1.3
+LIBS=libz.a
+SHAREDLIB=libz.so
+
+AR=ar rc
+RANLIB=ranlib
+TAR=tar
+SHELL=/bin/sh
+
+prefix = /usr/local
+exec_prefix = ${prefix}
+libdir = ${exec_prefix}/lib
+includedir = ${prefix}/include
+
+OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
+ zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
+
+OBJA =
+# to use the asm code: make OBJA=match.o
+
+TEST_OBJS = example.o minigzip.o
+
+DISTFILES = README FAQ INDEX ChangeLog configure Make*[a-z0-9] *.[ch] *.mms \
+ algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
+ nt/Make*[a-z0-9] nt/zlib.dnt amiga/Make*.??? os2/M*.os2 os2/zlib.def \
+ contrib/RE*.contrib contrib/*.txt contrib/asm386/*.asm contrib/asm386/*.c \
+ contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/asm[56]86/*.?86 \
+ contrib/asm[56]86/*.S contrib/iostream/*.cpp \
+ contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \
+ contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 \
+ contrib/minizip/[CM]*[pe] contrib/minizip/*.[ch] contrib/minizip/*.[td]?? \
+ contrib/delphi*/*.???
+
+all: example minigzip
+
+test: all
+ @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
+ echo hello world | ./minigzip | ./minigzip -d || \
+ echo ' *** minigzip test FAILED ***' ; \
+ if ./example; then \
+ echo ' *** zlib test OK ***'; \
+ else \
+ echo ' *** zlib test FAILED ***'; \
+ fi
+
+libz.a: $(OBJS) $(OBJA)
+ $(AR) $@ $(OBJS) $(OBJA)
+ -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
+
+match.o: match.S
+ $(CPP) match.S > _match.s
+ $(CC) -c _match.s
+ mv _match.o match.o
+ rm -f _match.s
+
+$(SHAREDLIB).$(VER): $(OBJS)
+ $(LDSHARED) -o $@ $(OBJS)
+ rm -f $(SHAREDLIB) $(SHAREDLIB).1
+ ln -s $@ $(SHAREDLIB)
+ ln -s $@ $(SHAREDLIB).1
+
+example: example.o $(LIBS)
+ $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
+
+minigzip: minigzip.o $(LIBS)
+ $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
+
+install: $(LIBS)
+ -@if [ ! -d $(includedir) ]; then mkdir $(includedir); fi
+ -@if [ ! -d $(libdir) ]; then mkdir $(libdir); fi
+ cp zlib.h zconf.h $(includedir)
+ chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
+ cp $(LIBS) $(libdir)
+ cd $(libdir); chmod 755 $(LIBS)
+ -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
+ cd $(libdir); if test -f $(SHAREDLIB).$(VER); then \
+ rm -f $(SHAREDLIB) $(SHAREDLIB).1; \
+ ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB); \
+ ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB).1; \
+ (ldconfig || true) >/dev/null 2>&1; \
+ fi
+# The ranlib in install is needed on NeXTSTEP which checks file times
+# ldconfig is for Linux
+
+uninstall:
+ cd $(includedir); \
+ v=$(VER); \
+ if test -f zlib.h; then \
+ v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`; \
+ rm -f zlib.h zconf.h; \
+ fi; \
+ cd $(libdir); rm -f libz.a; \
+ if test -f $(SHAREDLIB).$$v; then \
+ rm -f $(SHAREDLIB).$$v $(SHAREDLIB) $(SHAREDLIB).1; \
+ fi
+
+clean:
+ rm -f *.o *~ example minigzip libz.a libz.so* foo.gz so_locations \
+ _match.s maketree
+
+distclean: clean
+
+zip:
+ mv Makefile Makefile~; cp -p Makefile.in Makefile
+ rm -f test.c ztest*.c contrib/minizip/test.zip
+ v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
+ zip -ul9 zlib$$v $(DISTFILES)
+ mv Makefile~ Makefile
+
+dist:
+ mv Makefile Makefile~; cp -p Makefile.in Makefile
+ rm -f test.c ztest*.c contrib/minizip/test.zip
+ d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
+ rm -f $$d.tar.gz; \
+ if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
+ files=""; \
+ for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
+ cd ..; \
+ GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
+ if test ! -d $$d; then rm -f $$d; fi
+ mv Makefile~ Makefile
+
+tags:
+ etags *.[ch]
+
+depend:
+ makedepend -- $(CFLAGS) -- *.[ch]
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+adler32.o: zlib.h zconf.h
+compress.o: zlib.h zconf.h
+crc32.o: zlib.h zconf.h
+deflate.o: deflate.h zutil.h zlib.h zconf.h
+example.o: zlib.h zconf.h
+gzio.o: zutil.h zlib.h zconf.h
+infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
+infcodes.o: zutil.h zlib.h zconf.h
+infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
+inffast.o: zutil.h zlib.h zconf.h inftrees.h
+inffast.o: infblock.h infcodes.h infutil.h inffast.h
+inflate.o: zutil.h zlib.h zconf.h infblock.h
+inftrees.o: zutil.h zlib.h zconf.h inftrees.h
+infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
+minigzip.o: zlib.h zconf.h
+trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
+uncompr.o: zlib.h zconf.h
+zutil.o: zutil.h zlib.h zconf.h
diff --git a/cfe/cfe/zlib/Makefile.orig b/cfe/cfe/zlib/Makefile.orig
new file mode 100644
index 0000000..3a3b116
--- /dev/null
+++ b/cfe/cfe/zlib/Makefile.orig
@@ -0,0 +1,174 @@
+# Makefile for zlib
+# Copyright (C) 1995-1998 Jean-loup Gailly.
+# For conditions of distribution and use, see copyright notice in zlib.h
+
+# To compile and test, type:
+# ./configure; make test
+# The call of configure is optional if you don't have special requirements
+# If you wish to build zlib as a shared library, use: ./configure -s
+
+# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
+# make install
+# To install in $HOME instead of /usr/local, use:
+# make install prefix=$HOME
+
+CC=cc
+
+CFLAGS=-O
+#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
+#CFLAGS=-g -DDEBUG
+#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
+# -Wstrict-prototypes -Wmissing-prototypes
+
+LDFLAGS=-L. -lz
+LDSHARED=$(CC)
+CPP=$(CC) -E
+
+VER=1.1.3
+LIBS=libz.a
+SHAREDLIB=libz.so
+
+AR=ar rc
+RANLIB=ranlib
+TAR=tar
+SHELL=/bin/sh
+
+prefix = /usr/local
+exec_prefix = ${prefix}
+libdir = ${exec_prefix}/lib
+includedir = ${prefix}/include
+
+OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
+ zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
+
+OBJA =
+# to use the asm code: make OBJA=match.o
+
+TEST_OBJS = example.o minigzip.o
+
+DISTFILES = README FAQ INDEX ChangeLog configure Make*[a-z0-9] *.[ch] *.mms \
+ algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
+ nt/Make*[a-z0-9] nt/zlib.dnt amiga/Make*.??? os2/M*.os2 os2/zlib.def \
+ contrib/RE*.contrib contrib/*.txt contrib/asm386/*.asm contrib/asm386/*.c \
+ contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/asm[56]86/*.?86 \
+ contrib/asm[56]86/*.S contrib/iostream/*.cpp \
+ contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \
+ contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 \
+ contrib/minizip/[CM]*[pe] contrib/minizip/*.[ch] contrib/minizip/*.[td]?? \
+ contrib/delphi*/*.???
+
+all: example minigzip
+
+test: all
+ @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
+ echo hello world | ./minigzip | ./minigzip -d || \
+ echo ' *** minigzip test FAILED ***' ; \
+ if ./example; then \
+ echo ' *** zlib test OK ***'; \
+ else \
+ echo ' *** zlib test FAILED ***'; \
+ fi
+
+libz.a: $(OBJS) $(OBJA)
+ $(AR) $@ $(OBJS) $(OBJA)
+ -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
+
+match.o: match.S
+ $(CPP) match.S > _match.s
+ $(CC) -c _match.s
+ mv _match.o match.o
+ rm -f _match.s
+
+$(SHAREDLIB).$(VER): $(OBJS)
+ $(LDSHARED) -o $@ $(OBJS)
+ rm -f $(SHAREDLIB) $(SHAREDLIB).1
+ ln -s $@ $(SHAREDLIB)
+ ln -s $@ $(SHAREDLIB).1
+
+example: example.o $(LIBS)
+ $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
+
+minigzip: minigzip.o $(LIBS)
+ $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
+
+install: $(LIBS)
+ -@if [ ! -d $(includedir) ]; then mkdir $(includedir); fi
+ -@if [ ! -d $(libdir) ]; then mkdir $(libdir); fi
+ cp zlib.h zconf.h $(includedir)
+ chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
+ cp $(LIBS) $(libdir)
+ cd $(libdir); chmod 755 $(LIBS)
+ -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
+ cd $(libdir); if test -f $(SHAREDLIB).$(VER); then \
+ rm -f $(SHAREDLIB) $(SHAREDLIB).1; \
+ ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB); \
+ ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB).1; \
+ (ldconfig || true) >/dev/null 2>&1; \
+ fi
+# The ranlib in install is needed on NeXTSTEP which checks file times
+# ldconfig is for Linux
+
+uninstall:
+ cd $(includedir); \
+ v=$(VER); \
+ if test -f zlib.h; then \
+ v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`; \
+ rm -f zlib.h zconf.h; \
+ fi; \
+ cd $(libdir); rm -f libz.a; \
+ if test -f $(SHAREDLIB).$$v; then \
+ rm -f $(SHAREDLIB).$$v $(SHAREDLIB) $(SHAREDLIB).1; \
+ fi
+
+clean:
+ rm -f *.o *~ example minigzip libz.a libz.so* foo.gz so_locations \
+ _match.s maketree
+
+distclean: clean
+
+zip:
+ mv Makefile Makefile~; cp -p Makefile.in Makefile
+ rm -f test.c ztest*.c contrib/minizip/test.zip
+ v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
+ zip -ul9 zlib$$v $(DISTFILES)
+ mv Makefile~ Makefile
+
+dist:
+ mv Makefile Makefile~; cp -p Makefile.in Makefile
+ rm -f test.c ztest*.c contrib/minizip/test.zip
+ d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
+ rm -f $$d.tar.gz; \
+ if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
+ files=""; \
+ for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
+ cd ..; \
+ GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
+ if test ! -d $$d; then rm -f $$d; fi
+ mv Makefile~ Makefile
+
+tags:
+ etags *.[ch]
+
+depend:
+ makedepend -- $(CFLAGS) -- *.[ch]
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+adler32.o: zlib.h zconf.h
+compress.o: zlib.h zconf.h
+crc32.o: zlib.h zconf.h
+deflate.o: deflate.h zutil.h zlib.h zconf.h
+example.o: zlib.h zconf.h
+gzio.o: zutil.h zlib.h zconf.h
+infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
+infcodes.o: zutil.h zlib.h zconf.h
+infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
+inffast.o: zutil.h zlib.h zconf.h inftrees.h
+inffast.o: infblock.h infcodes.h infutil.h inffast.h
+inflate.o: zutil.h zlib.h zconf.h infblock.h
+inftrees.o: zutil.h zlib.h zconf.h inftrees.h
+infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
+minigzip.o: zlib.h zconf.h
+trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
+uncompr.o: zlib.h zconf.h
+zutil.o: zutil.h zlib.h zconf.h
diff --git a/cfe/cfe/zlib/Makefile.riscos b/cfe/cfe/zlib/Makefile.riscos
new file mode 100644
index 0000000..d97f449
--- /dev/null
+++ b/cfe/cfe/zlib/Makefile.riscos
@@ -0,0 +1,151 @@
+# Project: zlib_1_03
+# Patched for zlib 1.1.2 rw@shadow.org.uk 19980430
+# test works out-of-the-box, installs `somewhere' on demand
+
+# Toolflags:
+CCflags = -c -depend !Depend -IC: -g -throwback -DRISCOS -fah
+C++flags = -c -depend !Depend -IC: -throwback
+Linkflags = -aif -c++ -o $@
+ObjAsmflags = -throwback -NoCache -depend !Depend
+CMHGflags =
+LibFileflags = -c -l -o $@
+Squeezeflags = -o $@
+
+# change the line below to where _you_ want the library installed.
+libdest = lib:zlib
+
+# Final targets:
+@.lib: @.o.adler32 @.o.compress @.o.crc32 @.o.deflate @.o.gzio \
+ @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil @.o.trees \
+ @.o.uncompr @.o.zutil
+ LibFile $(LibFileflags) @.o.adler32 @.o.compress @.o.crc32 @.o.deflate \
+ @.o.gzio @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil \
+ @.o.trees @.o.uncompr @.o.zutil
+test: @.minigzip @.example @.lib
+ @copy @.lib @.libc A~C~DF~L~N~P~Q~RS~TV
+ @echo running tests: hang on.
+ @/@.minigzip -f -9 libc
+ @/@.minigzip -d libc-gz
+ @/@.minigzip -f -1 libc
+ @/@.minigzip -d libc-gz
+ @/@.minigzip -h -9 libc
+ @/@.minigzip -d libc-gz
+ @/@.minigzip -h -1 libc
+ @/@.minigzip -d libc-gz
+ @/@.minigzip -9 libc
+ @/@.minigzip -d libc-gz
+ @/@.minigzip -1 libc
+ @/@.minigzip -d libc-gz
+ @diff @.lib @.libc
+ @echo that should have reported '@.lib and @.libc identical' if you have diff.
+ @/@.example @.fred @.fred
+ @echo that will have given lots of hello!'s.
+
+@.minigzip: @.o.minigzip @.lib C:o.Stubs
+ Link $(Linkflags) @.o.minigzip @.lib C:o.Stubs
+@.example: @.o.example @.lib C:o.Stubs
+ Link $(Linkflags) @.o.example @.lib C:o.Stubs
+
+install: @.lib
+ cdir $(libdest)
+ cdir $(libdest).h
+ @copy @.h.zlib $(libdest).h.zlib A~C~DF~L~N~P~Q~RS~TV
+ @copy @.h.zconf $(libdest).h.zconf A~C~DF~L~N~P~Q~RS~TV
+ @copy @.lib $(libdest).lib A~C~DF~L~N~P~Q~RS~TV
+ @echo okay, installed zlib in $(libdest)
+
+clean:; remove @.minigzip
+ remove @.example
+ remove @.libc
+ -wipe @.o.* F~r~cV
+ remove @.fred
+
+# User-editable dependencies:
+.c.o:
+ cc $(ccflags) -o $@ $<
+
+# Static dependencies:
+
+# Dynamic dependencies:
+o.example: c.example
+o.example: h.zlib
+o.example: h.zconf
+o.minigzip: c.minigzip
+o.minigzip: h.zlib
+o.minigzip: h.zconf
+o.adler32: c.adler32
+o.adler32: h.zlib
+o.adler32: h.zconf
+o.compress: c.compress
+o.compress: h.zlib
+o.compress: h.zconf
+o.crc32: c.crc32
+o.crc32: h.zlib
+o.crc32: h.zconf
+o.deflate: c.deflate
+o.deflate: h.deflate
+o.deflate: h.zutil
+o.deflate: h.zlib
+o.deflate: h.zconf
+o.gzio: c.gzio
+o.gzio: h.zutil
+o.gzio: h.zlib
+o.gzio: h.zconf
+o.infblock: c.infblock
+o.infblock: h.zutil
+o.infblock: h.zlib
+o.infblock: h.zconf
+o.infblock: h.infblock
+o.infblock: h.inftrees
+o.infblock: h.infcodes
+o.infblock: h.infutil
+o.infcodes: c.infcodes
+o.infcodes: h.zutil
+o.infcodes: h.zlib
+o.infcodes: h.zconf
+o.infcodes: h.inftrees
+o.infcodes: h.infblock
+o.infcodes: h.infcodes
+o.infcodes: h.infutil
+o.infcodes: h.inffast
+o.inffast: c.inffast
+o.inffast: h.zutil
+o.inffast: h.zlib
+o.inffast: h.zconf
+o.inffast: h.inftrees
+o.inffast: h.infblock
+o.inffast: h.infcodes
+o.inffast: h.infutil
+o.inffast: h.inffast
+o.inflate: c.inflate
+o.inflate: h.zutil
+o.inflate: h.zlib
+o.inflate: h.zconf
+o.inflate: h.infblock
+o.inftrees: c.inftrees
+o.inftrees: h.zutil
+o.inftrees: h.zlib
+o.inftrees: h.zconf
+o.inftrees: h.inftrees
+o.inftrees: h.inffixed
+o.infutil: c.infutil
+o.infutil: h.zutil
+o.infutil: h.zlib
+o.infutil: h.zconf
+o.infutil: h.infblock
+o.infutil: h.inftrees
+o.infutil: h.infcodes
+o.infutil: h.infutil
+o.trees: c.trees
+o.trees: h.deflate
+o.trees: h.zutil
+o.trees: h.zlib
+o.trees: h.zconf
+o.trees: h.trees
+o.uncompr: c.uncompr
+o.uncompr: h.zlib
+o.uncompr: h.zconf
+o.zutil: c.zutil
+o.zutil: h.zutil
+o.zutil: h.zlib
+o.zutil: h.zconf
diff --git a/cfe/cfe/zlib/README b/cfe/cfe/zlib/README
new file mode 100644
index 0000000..8ff4587
--- /dev/null
+++ b/cfe/cfe/zlib/README
@@ -0,0 +1,148 @@
+zlib 1.1.3 is a general purpose data compression library. All the code
+is thread safe. The data format used by the zlib library
+is described by RFCs (Request for Comments) 1950 to 1952 in the files
+ftp://ds.internic.net/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate
+format) and rfc1952.txt (gzip format). These documents are also available in
+other formats from ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html
+
+All functions of the compression library are documented in the file zlib.h
+(volunteer to write man pages welcome, contact jloup@gzip.org). A usage
+example of the library is given in the file example.c which also tests that
+the library is working correctly. Another example is given in the file
+minigzip.c. The compression library itself is composed of all source files
+except example.c and minigzip.c.
+
+To compile all files and run the test program, follow the instructions
+given at the top of Makefile. In short "make test; make install"
+should work for most machines. For Unix: "configure; make test; make install"
+For MSDOS, use one of the special makefiles such as Makefile.msc.
+For VMS, use Make_vms.com or descrip.mms.
+
+Questions about zlib should be sent to <zlib@quest.jpl.nasa.gov>, or to
+Gilles Vollant <info@winimage.com> for the Windows DLL version.
+The zlib home page is http://www.cdrom.com/pub/infozip/zlib/
+The official zlib ftp site is ftp://ftp.cdrom.com/pub/infozip/zlib/
+Before reporting a problem, please check those sites to verify that
+you have the latest version of zlib; otherwise get the latest version and
+check whether the problem still exists or not.
+
+Mark Nelson <markn@tiny.com> wrote an article about zlib for the Jan. 1997
+issue of Dr. Dobb's Journal; a copy of the article is available in
+http://web2.airmail.net/markn/articles/zlibtool/zlibtool.htm
+
+The changes made in version 1.1.3 are documented in the file ChangeLog.
+The main changes since 1.1.2 are:
+
+- fix "an inflate input buffer bug that shows up on rare but persistent
+ occasions" (Mark)
+- fix gzread and gztell for concatenated .gz files (Didier Le Botlan)
+- fix gzseek(..., SEEK_SET) in write mode
+- fix crc check after a gzeek (Frank Faubert)
+- fix miniunzip when the last entry in a zip file is itself a zip file
+ (J Lillge)
+- add contrib/asm586 and contrib/asm686 (Brian Raiter)
+ See http://www.muppetlabs.com/~breadbox/software/assembly.html
+- add support for Delphi 3 in contrib/delphi (Bob Dellaca)
+- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti)
+- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren)
+- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks)
+- added a FAQ file
+
+plus many changes for portability.
+
+Unsupported third party contributions are provided in directory "contrib".
+
+A Java implementation of zlib is available in the Java Development Kit 1.1
+http://www.javasoft.com/products/JDK/1.1/docs/api/Package-java.util.zip.html
+See the zlib home page http://www.cdrom.com/pub/infozip/zlib/ for details.
+
+A Perl interface to zlib written by Paul Marquess <pmarquess@bfsec.bt.co.uk>
+is in the CPAN (Comprehensive Perl Archive Network) sites, such as:
+ftp://ftp.cis.ufl.edu/pub/perl/CPAN/modules/by-module/Compress/Compress-Zlib*
+
+A Python interface to zlib written by A.M. Kuchling <amk@magnet.com>
+is available in Python 1.5 and later versions, see
+http://www.python.org/doc/lib/module-zlib.html
+
+A zlib binding for TCL written by Andreas Kupries <a.kupries@westend.com>
+is availlable at http://www.westend.com/~kupries/doc/trf/man/man.html
+
+An experimental package to read and write files in .zip format,
+written on top of zlib by Gilles Vollant <info@winimage.com>, is
+available at http://www.winimage.com/zLibDll/unzip.html
+and also in the contrib/minizip directory of zlib.
+
+
+Notes for some targets:
+
+- To build a Windows DLL version, include in a DLL project zlib.def, zlib.rc
+ and all .c files except example.c and minigzip.c; compile with -DZLIB_DLL
+ The zlib DLL support was initially done by Alessandro Iacopetti and is
+ now maintained by Gilles Vollant <info@winimage.com>. Check the zlib DLL
+ home page at http://www.winimage.com/zLibDll
+
+ From Visual Basic, you can call the DLL functions which do not take
+ a structure as argument: compress, uncompress and all gz* functions.
+ See contrib/visual-basic.txt for more information, or get
+ http://www.tcfb.com/dowseware/cmp-z-it.zip
+
+- For 64-bit Irix, deflate.c must be compiled without any optimization.
+ With -O, one libpng test fails. The test works in 32 bit mode (with
+ the -n32 compiler flag). The compiler bug has been reported to SGI.
+
+- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1
+ it works when compiled with cc.
+
+- on Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1
+ is necessary to get gzprintf working correctly. This is done by configure.
+
+- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works
+ with other compilers. Use "make test" to check your compiler.
+
+- gzdopen is not supported on RISCOS, BEOS and by some Mac compilers.
+
+- For Turbo C the small model is supported only with reduced performance to
+ avoid any far allocation; it was tested with -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
+
+- For PalmOs, see http://www.cs.uit.no/~perm/PASTA/pilot/software.html
+ Per Harald Myrvang <perm@stud.cs.uit.no>
+
+
+Acknowledgments:
+
+ The deflate format used by zlib was defined by Phil Katz. The deflate
+ and zlib specifications were written by L. Peter Deutsch. Thanks to all the
+ people who reported problems and suggested various improvements in zlib;
+ they are too numerous to cite here.
+
+Copyright notice:
+
+ (C) 1995-1998 Jean-loup Gailly and Mark Adler
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
+
+If you use the zlib library in a product, we would appreciate *not*
+receiving lengthy legal documents to sign. The sources are provided
+for free but without warranty of any kind. The library has been
+entirely written by Jean-loup Gailly and Mark Adler; it does not
+include third-party code.
+
+If you redistribute modified sources, we would appreciate that you include
+in the file ChangeLog history information documenting your changes.
diff --git a/cfe/cfe/zlib/adler32.c b/cfe/cfe/zlib/adler32.c
new file mode 100644
index 0000000..70d368e
--- /dev/null
+++ b/cfe/cfe/zlib/adler32.c
@@ -0,0 +1,48 @@
+/* adler32.c -- compute the Adler-32 checksum of a data stream
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: adler32.c,v 1.1 2001/11/09 01:48:01 mpl Exp $ */
+
+#include "zlib.h"
+
+#define BASE 65521L /* largest prime smaller than 65536 */
+#define NMAX 5552
+/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
+
+#define DO1(buf,i) {s1 += buf[i]; s2 += s1;}
+#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
+#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
+#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
+#define DO16(buf) DO8(buf,0); DO8(buf,8);
+
+/* ========================================================================= */
+uLong ZEXPORT adler32(adler, buf, len)
+ uLong adler;
+ const Bytef *buf;
+ uInt len;
+{
+ unsigned long s1 = adler & 0xffff;
+ unsigned long s2 = (adler >> 16) & 0xffff;
+ int k;
+
+ if (buf == Z_NULL) return 1L;
+
+ while (len > 0) {
+ k = len < NMAX ? len : NMAX;
+ len -= k;
+ while (k >= 16) {
+ DO16(buf);
+ buf += 16;
+ k -= 16;
+ }
+ if (k != 0) do {
+ s1 += *buf++;
+ s2 += s1;
+ } while (--k);
+ s1 %= BASE;
+ s2 %= BASE;
+ }
+ return (s2 << 16) | s1;
+}
diff --git a/cfe/cfe/zlib/algorithm.txt b/cfe/cfe/zlib/algorithm.txt
new file mode 100644
index 0000000..cdc830b
--- /dev/null
+++ b/cfe/cfe/zlib/algorithm.txt
@@ -0,0 +1,213 @@
+1. Compression algorithm (deflate)
+
+The deflation algorithm used by gzip (also zip and zlib) is a variation of
+LZ77 (Lempel-Ziv 1977, see reference below). It finds duplicated strings in
+the input data. The second occurrence of a string is replaced by a
+pointer to the previous string, in the form of a pair (distance,
+length). Distances are limited to 32K bytes, and lengths are limited
+to 258 bytes. When a string does not occur anywhere in the previous
+32K bytes, it is emitted as a sequence of literal bytes. (In this
+description, `string' must be taken as an arbitrary sequence of bytes,
+and is not restricted to printable characters.)
+
+Literals or match lengths are compressed with one Huffman tree, and
+match distances are compressed with another tree. The trees are stored
+in a compact form at the start of each block. The blocks can have any
+size (except that the compressed data for one block must fit in
+available memory). A block is terminated when deflate() determines that
+it would be useful to start another block with fresh trees. (This is
+somewhat similar to the behavior of LZW-based _compress_.)
+
+Duplicated strings are found using a hash table. All input strings of
+length 3 are inserted in the hash table. A hash index is computed for
+the next 3 bytes. If the hash chain for this index is not empty, all
+strings in the chain are compared with the current input string, and
+the longest match is selected.
+
+The hash chains are searched starting with the most recent strings, to
+favor small distances and thus take advantage of the Huffman encoding.
+The hash chains are singly linked. There are no deletions from the
+hash chains, the algorithm simply discards matches that are too old.
+
+To avoid a worst-case situation, very long hash chains are arbitrarily
+truncated at a certain length, determined by a runtime option (level
+parameter of deflateInit). So deflate() does not always find the longest
+possible match but generally finds a match which is long enough.
+
+deflate() also defers the selection of matches with a lazy evaluation
+mechanism. After a match of length N has been found, deflate() searches for
+a longer match at the next input byte. If a longer match is found, the
+previous match is truncated to a length of one (thus producing a single
+literal byte) and the process of lazy evaluation begins again. Otherwise,
+the original match is kept, and the next match search is attempted only N
+steps later.
+
+The lazy match evaluation is also subject to a runtime parameter. If
+the current match is long enough, deflate() reduces the search for a longer
+match, thus speeding up the whole process. If compression ratio is more
+important than speed, deflate() attempts a complete second search even if
+the first match is already long enough.
+
+The lazy match evaluation is not performed for the fastest compression
+modes (level parameter 1 to 3). For these fast modes, new strings
+are inserted in the hash table only when no match was found, or
+when the match is not too long. This degrades the compression ratio
+but saves time since there are both fewer insertions and fewer searches.
+
+
+2. Decompression algorithm (inflate)
+
+2.1 Introduction
+
+The real question is, given a Huffman tree, how to decode fast. The most
+important realization is that shorter codes are much more common than
+longer codes, so pay attention to decoding the short codes fast, and let
+the long codes take longer to decode.
+
+inflate() sets up a first level table that covers some number of bits of
+input less than the length of longest code. It gets that many bits from the
+stream, and looks it up in the table. The table will tell if the next
+code is that many bits or less and how many, and if it is, it will tell
+the value, else it will point to the next level table for which inflate()
+grabs more bits and tries to decode a longer code.
+
+How many bits to make the first lookup is a tradeoff between the time it
+takes to decode and the time it takes to build the table. If building the
+table took no time (and if you had infinite memory), then there would only
+be a first level table to cover all the way to the longest code. However,
+building the table ends up taking a lot longer for more bits since short
+codes are replicated many times in such a table. What inflate() does is
+simply to make the number of bits in the first table a variable, and set it
+for the maximum speed.
+
+inflate() sends new trees relatively often, so it is possibly set for a
+smaller first level table than an application that has only one tree for
+all the data. For inflate, which has 286 possible codes for the
+literal/length tree, the size of the first table is nine bits. Also the
+distance trees have 30 possible values, and the size of the first table is
+six bits. Note that for each of those cases, the table ended up one bit
+longer than the ``average'' code length, i.e. the code length of an
+approximately flat code which would be a little more than eight bits for
+286 symbols and a little less than five bits for 30 symbols. It would be
+interesting to see if optimizing the first level table for other
+applications gave values within a bit or two of the flat code size.
+
+
+2.2 More details on the inflate table lookup
+
+Ok, you want to know what this cleverly obfuscated inflate tree actually
+looks like. You are correct that it's not a Huffman tree. It is simply a
+lookup table for the first, let's say, nine bits of a Huffman symbol. The
+symbol could be as short as one bit or as long as 15 bits. If a particular
+symbol is shorter than nine bits, then that symbol's translation is duplicated
+in all those entries that start with that symbol's bits. For example, if the
+symbol is four bits, then it's duplicated 32 times in a nine-bit table. If a
+symbol is nine bits long, it appears in the table once.
+
+If the symbol is longer than nine bits, then that entry in the table points
+to another similar table for the remaining bits. Again, there are duplicated
+entries as needed. The idea is that most of the time the symbol will be short
+and there will only be one table look up. (That's whole idea behind data
+compression in the first place.) For the less frequent long symbols, there
+will be two lookups. If you had a compression method with really long
+symbols, you could have as many levels of lookups as is efficient. For
+inflate, two is enough.
+
+So a table entry either points to another table (in which case nine bits in
+the above example are gobbled), or it contains the translation for the symbol
+and the number of bits to gobble. Then you start again with the next
+ungobbled bit.
+
+You may wonder: why not just have one lookup table for how ever many bits the
+longest symbol is? The reason is that if you do that, you end up spending
+more time filling in duplicate symbol entries than you do actually decoding.
+At least for deflate's output that generates new trees every several 10's of
+kbytes. You can imagine that filling in a 2^15 entry table for a 15-bit code
+would take too long if you're only decoding several thousand symbols. At the
+other extreme, you could make a new table for every bit in the code. In fact,
+that's essentially a Huffman tree. But then you spend two much time
+traversing the tree while decoding, even for short symbols.
+
+So the number of bits for the first lookup table is a trade of the time to
+fill out the table vs. the time spent looking at the second level and above of
+the table.
+
+Here is an example, scaled down:
+
+The code being decoded, with 10 symbols, from 1 to 6 bits long:
+
+A: 0
+B: 10
+C: 1100
+D: 11010
+E: 11011
+F: 11100
+G: 11101
+H: 11110
+I: 111110
+J: 111111
+
+Let's make the first table three bits long (eight entries):
+
+000: A,1
+001: A,1
+010: A,1
+011: A,1
+100: B,2
+101: B,2
+110: -> table X (gobble 3 bits)
+111: -> table Y (gobble 3 bits)
+
+Each entry is what the bits decode to and how many bits that is, i.e. how
+many bits to gobble. Or the entry points to another table, with the number of
+bits to gobble implicit in the size of the table.
+
+Table X is two bits long since the longest code starting with 110 is five bits
+long:
+
+00: C,1
+01: C,1
+10: D,2
+11: E,2
+
+Table Y is three bits long since the longest code starting with 111 is six
+bits long:
+
+000: F,2
+001: F,2
+010: G,2
+011: G,2
+100: H,2
+101: H,2
+110: I,3
+111: J,3
+
+So what we have here are three tables with a total of 20 entries that had to
+be constructed. That's compared to 64 entries for a single table. Or
+compared to 16 entries for a Huffman tree (six two entry tables and one four
+entry table). Assuming that the code ideally represents the probability of
+the symbols, it takes on the average 1.25 lookups per symbol. That's compared
+to one lookup for the single table, or 1.66 lookups per symbol for the
+Huffman tree.
+
+There, I think that gives you a picture of what's going on. For inflate, the
+meaning of a particular symbol is often more than just a letter. It can be a
+byte (a "literal"), or it can be either a length or a distance which
+indicates a base value and a number of bits to fetch after the code that is
+added to the base value. Or it might be the special end-of-block code. The
+data structures created in inftrees.c try to encode all that information
+compactly in the tables.
+
+
+Jean-loup Gailly Mark Adler
+jloup@gzip.org madler@alumni.caltech.edu
+
+
+References:
+
+[LZ77] Ziv J., Lempel A., ``A Universal Algorithm for Sequential Data
+Compression,'' IEEE Transactions on Information Theory, Vol. 23, No. 3,
+pp. 337-343.
+
+``DEFLATE Compressed Data Format Specification'' available in
+ftp://ds.internic.net/rfc/rfc1951.txt
diff --git a/cfe/cfe/zlib/compress.c b/cfe/cfe/zlib/compress.c
new file mode 100644
index 0000000..4000959
--- /dev/null
+++ b/cfe/cfe/zlib/compress.c
@@ -0,0 +1,68 @@
+/* compress.c -- compress a memory buffer
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: compress.c,v 1.1 2001/11/09 01:48:01 mpl Exp $ */
+
+#include "zlib.h"
+
+/* ===========================================================================
+ Compresses the source buffer into the destination buffer. The level
+ parameter has the same meaning as in deflateInit. sourceLen is the byte
+ length of the source buffer. Upon entry, destLen is the total size of the
+ destination buffer, which must be at least 0.1% larger than sourceLen plus
+ 12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
+
+ compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+ Z_STREAM_ERROR if the level parameter is invalid.
+*/
+int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
+ Bytef *dest;
+ uLongf *destLen;
+ const Bytef *source;
+ uLong sourceLen;
+ int level;
+{
+ z_stream stream;
+ int err;
+
+ stream.next_in = (Bytef*)source;
+ stream.avail_in = (uInt)sourceLen;
+#ifdef MAXSEG_64K
+ /* Check for source > 64K on 16-bit machine: */
+ if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
+#endif
+ stream.next_out = dest;
+ stream.avail_out = (uInt)*destLen;
+ if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
+
+ stream.zalloc = (alloc_func)0;
+ stream.zfree = (free_func)0;
+ stream.opaque = (voidpf)0;
+
+ err = deflateInit(&stream, level);
+ if (err != Z_OK) return err;
+
+ err = deflate(&stream, Z_FINISH);
+ if (err != Z_STREAM_END) {
+ deflateEnd(&stream);
+ return err == Z_OK ? Z_BUF_ERROR : err;
+ }
+ *destLen = stream.total_out;
+
+ err = deflateEnd(&stream);
+ return err;
+}
+
+/* ===========================================================================
+ */
+int ZEXPORT compress (dest, destLen, source, sourceLen)
+ Bytef *dest;
+ uLongf *destLen;
+ const Bytef *source;
+ uLong sourceLen;
+{
+ return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
+}
diff --git a/cfe/cfe/zlib/configure b/cfe/cfe/zlib/configure
new file mode 100755
index 0000000..e894235
--- /dev/null
+++ b/cfe/cfe/zlib/configure
@@ -0,0 +1,212 @@
+#!/bin/sh
+# configure script for zlib. This script is needed only if
+# you wish to build a shared library and your system supports them,
+# of if you need special compiler, flags or install directory.
+# Otherwise, you can just use directly "make test; make install"
+#
+# To create a shared library, use "configure --shared"; by default a static
+# library is created. If the primitive shared library support provided here
+# does not work, use ftp://prep.ai.mit.edu/pub/gnu/libtool-*.tar.gz
+#
+# To impose specific compiler or flags or install directory, use for example:
+# prefix=$HOME CC=cc CFLAGS="-O4" ./configure
+# or for csh/tcsh users:
+# (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure)
+# LDSHARED is the command to be used to create a shared library
+
+# Incorrect settings of CC or CFLAGS may prevent creating a shared library.
+# If you have problems, try without defining CC and CFLAGS before reporting
+# an error.
+
+LIBS=libz.a
+SHAREDLIB=libz.so
+VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
+AR=${AR-"ar rc"}
+RANLIB=${RANLIB-"ranlib"}
+prefix=${prefix-/usr/local}
+exec_prefix=${exec_prefix-'${prefix}'}
+libdir=${libdir-'${exec_prefix}/lib'}
+includedir=${includedir-'${prefix}/include'}
+shared_ext='.so'
+shared=0
+gcc=0
+old_cc="$CC"
+old_cflags="$CFLAGS"
+
+while test $# -ge 1
+do
+case "$1" in
+ -h* | --h*)
+ echo 'usage:'
+ echo ' configure [--shared] [--prefix=PREFIX] [--exec_prefix=EXPREFIX]'
+ echo ' [--libdir=LIBDIR] [--includedir=INCLUDEDIR]'
+ exit 0;;
+ -p*=* | --p*=*) prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
+ -e*=* | --e*=*) exec_prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
+ -l*=* | --libdir=*) libdir=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
+ -i*=* | --includedir=*) includedir=`echo $1 | sed 's/[-a-z_]*=//'`;shift;;
+ -p* | --p*) prefix="$2"; shift; shift;;
+ -e* | --e*) exec_prefix="$2"; shift; shift;;
+ -l* | --l*) libdir="$2"; shift; shift;;
+ -i* | --i*) includedir="$2"; shift; shift;;
+ -s* | --s*) shared=1; shift;;
+ esac
+done
+
+test=ztest$$
+cat > $test.c <<EOF
+extern int getchar();
+int hello() {return getchar();}
+EOF
+
+test -z "$CC" && echo Checking for gcc...
+cc=${CC-gcc}
+cflags=${CFLAGS-"-O3"}
+# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
+case "$cc" in
+ *gcc*) gcc=1;;
+esac
+
+if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
+ CC="$cc"
+ SFLAGS=${CFLAGS-"-fPIC -O3"}
+ CFLAGS="$cflags"
+ case `(uname -s || echo unknown) 2>/dev/null` in
+ Linux | linux) LDSHARED=${LDSHARED-"gcc -shared -Wl,-soname,libz.so.1"};;
+ *) LDSHARED=${LDSHARED-"gcc -shared"};;
+ esac
+else
+ # find system name and corresponding cc options
+ CC=${CC-cc}
+ case `(uname -sr || echo unknown) 2>/dev/null` in
+ HP-UX*) SFLAGS=${CFLAGS-"-O +z"}
+ CFLAGS=${CFLAGS-"-O"}
+# LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"}
+ LDSHARED=${LDSHARED-"ld -b"}
+ shared_ext='.sl'
+ SHAREDLIB='libz.sl';;
+ IRIX*) SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."}
+ CFLAGS=${CFLAGS-"-ansi -O2"}
+ LDSHARED=${LDSHARED-"cc -shared"};;
+ OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"}
+ CFLAGS=${CFLAGS-"-O -std1"}
+ LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,$SHAREDLIB -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"};;
+ OSF1*) SFLAGS=${CFLAGS-"-O -std1"}
+ CFLAGS=${CFLAGS-"-O -std1"}
+ LDSHARED=${LDSHARED-"cc -shared"};;
+ QNX*) SFLAGS=${CFLAGS-"-4 -O"}
+ CFLAGS=${CFLAGS-"-4 -O"}
+ LDSHARED=${LDSHARED-"cc"}
+ RANLIB=${RANLIB-"true"}
+ AR="cc -A";;
+ SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "}
+ CFLAGS=${CFLAGS-"-O3"}
+ LDSHARED=${LDSHARED-"cc -dy -KPIC -G"};;
+ SunOS\ 5*) SFLAGS=${CFLAGS-"-fast -xcg89 -KPIC -R."}
+ CFLAGS=${CFLAGS-"-fast -xcg89"}
+ LDSHARED=${LDSHARED-"cc -G"};;
+ SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
+ CFLAGS=${CFLAGS-"-O2"}
+ LDSHARED=${LDSHARED-"ld"};;
+ UNIX_System_V\ 4.2.0)
+ SFLAGS=${CFLAGS-"-KPIC -O"}
+ CFLAGS=${CFLAGS-"-O"}
+ LDSHARED=${LDSHARED-"cc -G"};;
+ UNIX_SV\ 4.2MP)
+ SFLAGS=${CFLAGS-"-Kconform_pic -O"}
+ CFLAGS=${CFLAGS-"-O"}
+ LDSHARED=${LDSHARED-"cc -G"};;
+ # send working options for other systems to support@gzip.org
+ *) SFLAGS=${CFLAGS-"-O"}
+ CFLAGS=${CFLAGS-"-O"}
+ LDSHARED=${LDSHARED-"cc -shared"};;
+ esac
+fi
+
+if test $shared -eq 1; then
+ echo Checking for shared library support...
+ # we must test in two steps (cc then ld), required at least on SunOS 4.x
+ if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" &&
+ test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then
+ CFLAGS="$SFLAGS"
+ LIBS="$SHAREDLIB.$VER"
+ echo Building shared library $SHAREDLIB.$VER with $CC.
+ elif test -z "$old_cc" -a -z "$old_cflags"; then
+ echo No shared library suppport.
+ shared=0;
+ else
+ echo 'No shared library suppport; try without defining CC and CFLAGS'
+ shared=0;
+ fi
+fi
+if test $shared -eq 0; then
+ LDSHARED="$CC"
+ echo Building static library $LIBS version $VER with $CC.
+fi
+
+cat > $test.c <<EOF
+#include <unistd.h>
+int main() { return 0; }
+EOF
+if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+ CFLAGS="$CFLAGS -DHAVE_UNISTD_H"
+ echo "Checking for unistd.h... Yes."
+else
+ echo "Checking for unistd.h... No."
+fi
+
+cat > $test.c <<EOF
+#include <errno.h>
+int main() { return 0; }
+EOF
+if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+ echo "Checking for errno.h... Yes."
+else
+ echo "Checking for errno.h... No."
+ CFLAGS="$CFLAGS -DNO_ERRNO_H"
+fi
+
+cat > $test.c <<EOF
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+caddr_t hello() {
+ return mmap((caddr_t)0, (off_t)0, PROT_READ, MAP_SHARED, 0, (off_t)0);
+}
+EOF
+if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+ CFLAGS="$CFLAGS -DUSE_MMAP"
+ echo Checking for mmap support... Yes.
+else
+ echo Checking for mmap support... No.
+fi
+
+CPP=${CPP-"$CC -E"}
+case $CFLAGS in
+ *ASMV*)
+ if test "`nm $test.o | grep _hello`" = ""; then
+ CPP="$CPP -DNO_UNDERLINE"
+ echo Checking for underline in external names... No.
+ else
+ echo Checking for underline in external names... Yes.
+ fi;;
+esac
+
+rm -f $test.[co] $test$shared_ext
+
+# udpate Makefile
+sed < Makefile.in "
+/^CC *=/s%=.*%=$CC%
+/^CFLAGS *=/s%=.*%=$CFLAGS%
+/^CPP *=/s%=.*%=$CPP%
+/^LDSHARED *=/s%=.*%=$LDSHARED%
+/^LIBS *=/s%=.*%=$LIBS%
+/^SHAREDLIB *=/s%=.*%=$SHAREDLIB%
+/^AR *=/s%=.*%=$AR%
+/^RANLIB *=/s%=.*%=$RANLIB%
+/^VER *=/s%=.*%=$VER%
+/^prefix *=/s%=.*%=$prefix%
+/^exec_prefix *=/s%=.*%=$exec_prefix%
+/^libdir *=/s%=.*%=$libdir%
+/^includedir *=/s%=.*%=$includedir%
+" > Makefile
diff --git a/cfe/cfe/zlib/crc32.c b/cfe/cfe/zlib/crc32.c
new file mode 100644
index 0000000..0402f67
--- /dev/null
+++ b/cfe/cfe/zlib/crc32.c
@@ -0,0 +1,162 @@
+/* crc32.c -- compute the CRC-32 of a data stream
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: crc32.c,v 1.1 2001/11/09 01:48:01 mpl Exp $ */
+
+#include "zlib.h"
+
+#define local static
+
+#ifdef DYNAMIC_CRC_TABLE
+
+local int crc_table_empty = 1;
+local uLongf crc_table[256];
+local void make_crc_table OF((void));
+
+/*
+ Generate a table for a byte-wise 32-bit CRC calculation on the polynomial:
+ x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
+
+ Polynomials over GF(2) are represented in binary, one bit per coefficient,
+ with the lowest powers in the most significant bit. Then adding polynomials
+ is just exclusive-or, and multiplying a polynomial by x is a right shift by
+ one. If we call the above polynomial p, and represent a byte as the
+ polynomial q, also with the lowest power in the most significant bit (so the
+ byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
+ where a mod b means the remainder after dividing a by b.
+
+ This calculation is done using the shift-register method of multiplying and
+ taking the remainder. The register is initialized to zero, and for each
+ incoming bit, x^32 is added mod p to the register if the bit is a one (where
+ x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
+ x (which is shifting right by one and adding x^32 mod p if the bit shifted
+ out is a one). We start with the highest power (least significant bit) of
+ q and repeat for all eight bits of q.
+
+ The table is simply the CRC of all possible eight bit values. This is all
+ the information needed to generate CRC's on data a byte at a time for all
+ combinations of CRC register values and incoming bytes.
+*/
+local void make_crc_table()
+{
+ uLong c;
+ int n, k;
+ uLong poly; /* polynomial exclusive-or pattern */
+ /* terms of polynomial defining this crc (except x^32): */
+ static const Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
+
+ /* make exclusive-or pattern from polynomial (0xedb88320L) */
+ poly = 0L;
+ for (n = 0; n < sizeof(p)/sizeof(Byte); n++)
+ poly |= 1L << (31 - p[n]);
+
+ for (n = 0; n < 256; n++)
+ {
+ c = (uLong)n;
+ for (k = 0; k < 8; k++)
+ c = c & 1 ? poly ^ (c >> 1) : c >> 1;
+ crc_table[n] = c;
+ }
+ crc_table_empty = 0;
+}
+#else
+/* ========================================================================
+ * Table of CRC-32's of all single-byte values (made by make_crc_table)
+ */
+local const uLongf crc_table[256] = {
+ 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
+ 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
+ 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
+ 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL,
+ 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L,
+ 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L,
+ 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L,
+ 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,
+ 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L,
+ 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL,
+ 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L,
+ 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L,
+ 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L,
+ 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL,
+ 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL,
+ 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L,
+ 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL,
+ 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L,
+ 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L,
+ 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L,
+ 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL,
+ 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L,
+ 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L,
+ 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL,
+ 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L,
+ 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L,
+ 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L,
+ 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L,
+ 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L,
+ 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL,
+ 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL,
+ 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L,
+ 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L,
+ 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL,
+ 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL,
+ 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L,
+ 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL,
+ 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L,
+ 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL,
+ 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
+ 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL,
+ 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L,
+ 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L,
+ 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL,
+ 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L,
+ 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L,
+ 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L,
+ 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L,
+ 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L,
+ 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L,
+ 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL,
+ 0x2d02ef8dL
+};
+#endif
+
+/* =========================================================================
+ * This function can be used by asm versions of crc32()
+ */
+const uLongf * ZEXPORT get_crc_table()
+{
+#ifdef DYNAMIC_CRC_TABLE
+ if (crc_table_empty) make_crc_table();
+#endif
+ return (const uLongf *)crc_table;
+}
+
+/* ========================================================================= */
+#define DO1(buf) crc = crc_table[((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8);
+#define DO2(buf) DO1(buf); DO1(buf);
+#define DO4(buf) DO2(buf); DO2(buf);
+#define DO8(buf) DO4(buf); DO4(buf);
+
+/* ========================================================================= */
+uLong ZEXPORT crc32(crc, buf, len)
+ uLong crc;
+ const Bytef *buf;
+ uInt len;
+{
+ if (buf == Z_NULL) return 0L;
+#ifdef DYNAMIC_CRC_TABLE
+ if (crc_table_empty)
+ make_crc_table();
+#endif
+ crc = crc ^ 0xffffffffL;
+ while (len >= 8)
+ {
+ DO8(buf);
+ len -= 8;
+ }
+ if (len) do {
+ DO1(buf);
+ } while (--len);
+ return crc ^ 0xffffffffL;
+}
diff --git a/cfe/cfe/zlib/deflate.c b/cfe/cfe/zlib/deflate.c
new file mode 100644
index 0000000..be87d40
--- /dev/null
+++ b/cfe/cfe/zlib/deflate.c
@@ -0,0 +1,1350 @@
+/* deflate.c -- compress data using the deflation algorithm
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+ * ALGORITHM
+ *
+ * The "deflation" process depends on being able to identify portions
+ * of the input text which are identical to earlier input (within a
+ * sliding window trailing behind the input currently being processed).
+ *
+ * The most straightforward technique turns out to be the fastest for
+ * most input files: try all possible matches and select the longest.
+ * The key feature of this algorithm is that insertions into the string
+ * dictionary are very simple and thus fast, and deletions are avoided
+ * completely. Insertions are performed at each input character, whereas
+ * string matches are performed only when the previous match ends. So it
+ * is preferable to spend more time in matches to allow very fast string
+ * insertions and avoid deletions. The matching algorithm for small
+ * strings is inspired from that of Rabin & Karp. A brute force approach
+ * is used to find longer strings when a small match has been found.
+ * A similar algorithm is used in comic (by Jan-Mark Wams) and freeze
+ * (by Leonid Broukhis).
+ * A previous version of this file used a more sophisticated algorithm
+ * (by Fiala and Greene) which is guaranteed to run in linear amortized
+ * time, but has a larger average cost, uses more memory and is patented.
+ * However the F&G algorithm may be faster for some highly redundant
+ * files if the parameter max_chain_length (described below) is too large.
+ *
+ * ACKNOWLEDGEMENTS
+ *
+ * The idea of lazy evaluation of matches is due to Jan-Mark Wams, and
+ * I found it in 'freeze' written by Leonid Broukhis.
+ * Thanks to many people for bug reports and testing.
+ *
+ * REFERENCES
+ *
+ * Deutsch, L.P.,"DEFLATE Compressed Data Format Specification".
+ * Available in ftp://ds.internic.net/rfc/rfc1951.txt
+ *
+ * A description of the Rabin and Karp algorithm is given in the book
+ * "Algorithms" by R. Sedgewick, Addison-Wesley, p252.
+ *
+ * Fiala,E.R., and Greene,D.H.
+ * Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595
+ *
+ */
+
+/* @(#) $Id: deflate.c,v 1.1 2001/11/09 01:48:02 mpl Exp $ */
+
+#include "deflate.h"
+
+const char deflate_copyright[] =
+ " deflate 1.1.3 Copyright 1995-1998 Jean-loup Gailly ";
+/*
+ If you use the zlib library in a product, an acknowledgment is welcome
+ in the documentation of your product. If for some reason you cannot
+ include such an acknowledgment, I would appreciate that you keep this
+ copyright string in the executable of your product.
+ */
+
+/* ===========================================================================
+ * Function prototypes.
+ */
+typedef enum {
+ need_more, /* block not completed, need more input or more output */
+ block_done, /* block flush performed */
+ finish_started, /* finish started, need only more output at next deflate */
+ finish_done /* finish done, accept no more input or output */
+} block_state;
+
+typedef block_state (*compress_func) OF((deflate_state *s, int flush));
+/* Compression function. Returns the block state after the call. */
+
+local void fill_window OF((deflate_state *s));
+local block_state deflate_stored OF((deflate_state *s, int flush));
+local block_state deflate_fast OF((deflate_state *s, int flush));
+local block_state deflate_slow OF((deflate_state *s, int flush));
+local void lm_init OF((deflate_state *s));
+local void putShortMSB OF((deflate_state *s, uInt b));
+local void flush_pending OF((z_streamp strm));
+local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size));
+#ifdef ASMV
+ void match_init OF((void)); /* asm code initialization */
+ uInt longest_match OF((deflate_state *s, IPos cur_match));
+#else
+local uInt longest_match OF((deflate_state *s, IPos cur_match));
+#endif
+
+#ifdef DEBUG
+local void check_match OF((deflate_state *s, IPos start, IPos match,
+ int length));
+#endif
+
+/* ===========================================================================
+ * Local data
+ */
+
+#define NIL 0
+/* Tail of hash chains */
+
+#ifndef TOO_FAR
+# define TOO_FAR 4096
+#endif
+/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */
+
+#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
+/* Minimum amount of lookahead, except at the end of the input file.
+ * See deflate.c for comments about the MIN_MATCH+1.
+ */
+
+/* Values for max_lazy_match, good_match and max_chain_length, depending on
+ * the desired pack level (0..9). The values given below have been tuned to
+ * exclude worst case performance for pathological files. Better values may be
+ * found for specific files.
+ */
+typedef struct config_s {
+ ush good_length; /* reduce lazy search above this match length */
+ ush max_lazy; /* do not perform lazy search above this match length */
+ ush nice_length; /* quit search above this match length */
+ ush max_chain;
+ compress_func func;
+} config;
+
+local const config configuration_table[10] = {
+/* good lazy nice chain */
+/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */
+/* 1 */ {4, 4, 8, 4, deflate_fast}, /* maximum speed, no lazy matches */
+/* 2 */ {4, 5, 16, 8, deflate_fast},
+/* 3 */ {4, 6, 32, 32, deflate_fast},
+
+/* 4 */ {4, 4, 16, 16, deflate_slow}, /* lazy matches */
+/* 5 */ {8, 16, 32, 32, deflate_slow},
+/* 6 */ {8, 16, 128, 128, deflate_slow},
+/* 7 */ {8, 32, 128, 256, deflate_slow},
+/* 8 */ {32, 128, 258, 1024, deflate_slow},
+/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* maximum compression */
+
+/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4
+ * For deflate_fast() (levels <= 3) good is ignored and lazy has a different
+ * meaning.
+ */
+
+#define EQUAL 0
+/* result of memcmp for equal strings */
+
+struct static_tree_desc_s {int dummy;}; /* for buggy compilers */
+
+/* ===========================================================================
+ * Update a hash value with the given input byte
+ * IN assertion: all calls to to UPDATE_HASH are made with consecutive
+ * input characters, so that a running hash key can be computed from the
+ * previous key instead of complete recalculation each time.
+ */
+#define UPDATE_HASH(s,h,c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)
+
+
+/* ===========================================================================
+ * Insert string str in the dictionary and set match_head to the previous head
+ * of the hash chain (the most recent string with same hash key). Return
+ * the previous length of the hash chain.
+ * If this file is compiled with -DFASTEST, the compression level is forced
+ * to 1, and no hash chains are maintained.
+ * IN assertion: all calls to to INSERT_STRING are made with consecutive
+ * input characters and the first MIN_MATCH bytes of str are valid
+ * (except for the last MIN_MATCH-1 bytes of the input file).
+ */
+#ifdef FASTEST
+#define INSERT_STRING(s, str, match_head) \
+ (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
+ match_head = s->head[s->ins_h], \
+ s->head[s->ins_h] = (Pos)(str))
+#else
+#define INSERT_STRING(s, str, match_head) \
+ (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
+ s->prev[(str) & s->w_mask] = match_head = s->head[s->ins_h], \
+ s->head[s->ins_h] = (Pos)(str))
+#endif
+
+/* ===========================================================================
+ * Initialize the hash table (avoiding 64K overflow for 16 bit systems).
+ * prev[] will be initialized on the fly.
+ */
+#define CLEAR_HASH(s) \
+ s->head[s->hash_size-1] = NIL; \
+ zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
+
+/* ========================================================================= */
+int ZEXPORT deflateInit_(strm, level, version, stream_size)
+ z_streamp strm;
+ int level;
+ const char *version;
+ int stream_size;
+{
+ return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
+ Z_DEFAULT_STRATEGY, version, stream_size);
+ /* To do: ignore strm->next_in if we use it as window */
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
+ version, stream_size)
+ z_streamp strm;
+ int level;
+ int method;
+ int windowBits;
+ int memLevel;
+ int strategy;
+ const char *version;
+ int stream_size;
+{
+ deflate_state *s;
+ int noheader = 0;
+ static const char* my_version = ZLIB_VERSION;
+
+ ushf *overlay;
+ /* We overlay pending_buf and d_buf+l_buf. This works since the average
+ * output size for (length,distance) codes is <= 24 bits.
+ */
+
+ if (version == Z_NULL || version[0] != my_version[0] ||
+ stream_size != sizeof(z_stream)) {
+ return Z_VERSION_ERROR;
+ }
+ if (strm == Z_NULL) return Z_STREAM_ERROR;
+
+ strm->msg = Z_NULL;
+ if (strm->zalloc == Z_NULL) {
+ strm->zalloc = zcalloc;
+ strm->opaque = (voidpf)0;
+ }
+ if (strm->zfree == Z_NULL) strm->zfree = zcfree;
+
+ if (level == Z_DEFAULT_COMPRESSION) level = 6;
+#ifdef FASTEST
+ level = 1;
+#endif
+
+ if (windowBits < 0) { /* undocumented feature: suppress zlib header */
+ noheader = 1;
+ windowBits = -windowBits;
+ }
+ if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
+ windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
+ strategy < 0 || strategy > Z_HUFFMAN_ONLY) {
+ return Z_STREAM_ERROR;
+ }
+ s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
+ if (s == Z_NULL) return Z_MEM_ERROR;
+ strm->state = (struct internal_state FAR *)s;
+ s->strm = strm;
+
+ s->noheader = noheader;
+ s->w_bits = windowBits;
+ s->w_size = 1 << s->w_bits;
+ s->w_mask = s->w_size - 1;
+
+ s->hash_bits = memLevel + 7;
+ s->hash_size = 1 << s->hash_bits;
+ s->hash_mask = s->hash_size - 1;
+ s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);
+
+ s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
+ s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos));
+ s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos));
+
+ s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
+
+ overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
+ s->pending_buf = (uchf *) overlay;
+ s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
+
+ if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
+ s->pending_buf == Z_NULL) {
+ strm->msg = (char*)ERR_MSG(Z_MEM_ERROR);
+ deflateEnd (strm);
+ return Z_MEM_ERROR;
+ }
+ s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
+ s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
+
+ s->level = level;
+ s->strategy = strategy;
+ s->method = (Byte)method;
+
+ return deflateReset(strm);
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
+ z_streamp strm;
+ const Bytef *dictionary;
+ uInt dictLength;
+{
+ deflate_state *s;
+ uInt length = dictLength;
+ uInt n;
+ IPos hash_head = 0;
+
+ if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL ||
+ strm->state->status != INIT_STATE) return Z_STREAM_ERROR;
+
+ s = strm->state;
+ strm->adler = adler32(strm->adler, dictionary, dictLength);
+
+ if (length < MIN_MATCH) return Z_OK;
+ if (length > MAX_DIST(s)) {
+ length = MAX_DIST(s);
+#ifndef USE_DICT_HEAD
+ dictionary += dictLength - length; /* use the tail of the dictionary */
+#endif
+ }
+ zmemcpy(s->window, dictionary, length);
+ s->strstart = length;
+ s->block_start = (long)length;
+
+ /* Insert all strings in the hash table (except for the last two bytes).
+ * s->lookahead stays null, so s->ins_h will be recomputed at the next
+ * call of fill_window.
+ */
+ s->ins_h = s->window[0];
+ UPDATE_HASH(s, s->ins_h, s->window[1]);
+ for (n = 0; n <= length - MIN_MATCH; n++) {
+ INSERT_STRING(s, n, hash_head);
+ }
+ if (hash_head) hash_head = 0; /* to make compiler happy */
+ return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateReset (strm)
+ z_streamp strm;
+{
+ deflate_state *s;
+
+ if (strm == Z_NULL || strm->state == Z_NULL ||
+ strm->zalloc == Z_NULL || strm->zfree == Z_NULL) return Z_STREAM_ERROR;
+
+ strm->total_in = strm->total_out = 0;
+ strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */
+ strm->data_type = Z_UNKNOWN;
+
+ s = (deflate_state *)strm->state;
+ s->pending = 0;
+ s->pending_out = s->pending_buf;
+
+ if (s->noheader < 0) {
+ s->noheader = 0; /* was set to -1 by deflate(..., Z_FINISH); */
+ }
+ s->status = s->noheader ? BUSY_STATE : INIT_STATE;
+ strm->adler = 1;
+ s->last_flush = Z_NO_FLUSH;
+
+ _tr_init(s);
+ lm_init(s);
+
+ return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateParams(strm, level, strategy)
+ z_streamp strm;
+ int level;
+ int strategy;
+{
+ deflate_state *s;
+ compress_func func;
+ int err = Z_OK;
+
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ s = strm->state;
+
+ if (level == Z_DEFAULT_COMPRESSION) {
+ level = 6;
+ }
+ if (level < 0 || level > 9 || strategy < 0 || strategy > Z_HUFFMAN_ONLY) {
+ return Z_STREAM_ERROR;
+ }
+ func = configuration_table[s->level].func;
+
+ if (func != configuration_table[level].func && strm->total_in != 0) {
+ /* Flush the last buffer: */
+ err = deflate(strm, Z_PARTIAL_FLUSH);
+ }
+ if (s->level != level) {
+ s->level = level;
+ s->max_lazy_match = configuration_table[level].max_lazy;
+ s->good_match = configuration_table[level].good_length;
+ s->nice_match = configuration_table[level].nice_length;
+ s->max_chain_length = configuration_table[level].max_chain;
+ }
+ s->strategy = strategy;
+ return err;
+}
+
+/* =========================================================================
+ * Put a short in the pending buffer. The 16-bit value is put in MSB order.
+ * IN assertion: the stream state is correct and there is enough room in
+ * pending_buf.
+ */
+local void putShortMSB (s, b)
+ deflate_state *s;
+ uInt b;
+{
+ put_byte(s, (Byte)(b >> 8));
+ put_byte(s, (Byte)(b & 0xff));
+}
+
+/* =========================================================================
+ * Flush as much pending output as possible. All deflate() output goes
+ * through this function so some applications may wish to modify it
+ * to avoid allocating a large strm->next_out buffer and copying into it.
+ * (See also read_buf()).
+ */
+local void flush_pending(strm)
+ z_streamp strm;
+{
+ unsigned len = strm->state->pending;
+
+ if (len > strm->avail_out) len = strm->avail_out;
+ if (len == 0) return;
+
+ zmemcpy(strm->next_out, strm->state->pending_out, len);
+ strm->next_out += len;
+ strm->state->pending_out += len;
+ strm->total_out += len;
+ strm->avail_out -= len;
+ strm->state->pending -= len;
+ if (strm->state->pending == 0) {
+ strm->state->pending_out = strm->state->pending_buf;
+ }
+}
+
+/* ========================================================================= */
+int ZEXPORT deflate (strm, flush)
+ z_streamp strm;
+ int flush;
+{
+ int old_flush; /* value of flush param for previous deflate call */
+ deflate_state *s;
+
+ if (strm == Z_NULL || strm->state == Z_NULL ||
+ flush > Z_FINISH || flush < 0) {
+ return Z_STREAM_ERROR;
+ }
+ s = strm->state;
+
+ if (strm->next_out == Z_NULL ||
+ (strm->next_in == Z_NULL && strm->avail_in != 0) ||
+ (s->status == FINISH_STATE && flush != Z_FINISH)) {
+ ERR_RETURN(strm, Z_STREAM_ERROR);
+ }
+ if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);
+
+ s->strm = strm; /* just in case */
+ old_flush = s->last_flush;
+ s->last_flush = flush;
+
+ /* Write the zlib header */
+ if (s->status == INIT_STATE) {
+
+ uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8;
+ uInt level_flags = (s->level-1) >> 1;
+
+ if (level_flags > 3) level_flags = 3;
+ header |= (level_flags << 6);
+ if (s->strstart != 0) header |= PRESET_DICT;
+ header += 31 - (header % 31);
+
+ s->status = BUSY_STATE;
+ putShortMSB(s, header);
+
+ /* Save the adler32 of the preset dictionary: */
+ if (s->strstart != 0) {
+ putShortMSB(s, (uInt)(strm->adler >> 16));
+ putShortMSB(s, (uInt)(strm->adler & 0xffff));
+ }
+ strm->adler = 1L;
+ }
+
+ /* Flush as much pending output as possible */
+ if (s->pending != 0) {
+ flush_pending(strm);
+ if (strm->avail_out == 0) {
+ /* Since avail_out is 0, deflate will be called again with
+ * more output space, but possibly with both pending and
+ * avail_in equal to zero. There won't be anything to do,
+ * but this is not an error situation so make sure we
+ * return OK instead of BUF_ERROR at next call of deflate:
+ */
+ s->last_flush = -1;
+ return Z_OK;
+ }
+
+ /* Make sure there is something to do and avoid duplicate consecutive
+ * flushes. For repeated and useless calls with Z_FINISH, we keep
+ * returning Z_STREAM_END instead of Z_BUFF_ERROR.
+ */
+ } else if (strm->avail_in == 0 && flush <= old_flush &&
+ flush != Z_FINISH) {
+ ERR_RETURN(strm, Z_BUF_ERROR);
+ }
+
+ /* User must not provide more input after the first FINISH: */
+ if (s->status == FINISH_STATE && strm->avail_in != 0) {
+ ERR_RETURN(strm, Z_BUF_ERROR);
+ }
+
+ /* Start a new block or continue the current one.
+ */
+ if (strm->avail_in != 0 || s->lookahead != 0 ||
+ (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
+ block_state bstate;
+
+ bstate = (*(configuration_table[s->level].func))(s, flush);
+
+ if (bstate == finish_started || bstate == finish_done) {
+ s->status = FINISH_STATE;
+ }
+ if (bstate == need_more || bstate == finish_started) {
+ if (strm->avail_out == 0) {
+ s->last_flush = -1; /* avoid BUF_ERROR next call, see above */
+ }
+ return Z_OK;
+ /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
+ * of deflate should use the same flush parameter to make sure
+ * that the flush is complete. So we don't have to output an
+ * empty block here, this will be done at next call. This also
+ * ensures that for a very small output buffer, we emit at most
+ * one empty block.
+ */
+ }
+ if (bstate == block_done) {
+ if (flush == Z_PARTIAL_FLUSH) {
+ _tr_align(s);
+ } else { /* FULL_FLUSH or SYNC_FLUSH */
+ _tr_stored_block(s, (char*)0, 0L, 0);
+ /* For a full flush, this empty block will be recognized
+ * as a special marker by inflate_sync().
+ */
+ if (flush == Z_FULL_FLUSH) {
+ CLEAR_HASH(s); /* forget history */
+ }
+ }
+ flush_pending(strm);
+ if (strm->avail_out == 0) {
+ s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
+ return Z_OK;
+ }
+ }
+ }
+ Assert(strm->avail_out > 0, "bug2");
+
+ if (flush != Z_FINISH) return Z_OK;
+ if (s->noheader) return Z_STREAM_END;
+
+ /* Write the zlib trailer (adler32) */
+ putShortMSB(s, (uInt)(strm->adler >> 16));
+ putShortMSB(s, (uInt)(strm->adler & 0xffff));
+ flush_pending(strm);
+ /* If avail_out is zero, the application will call deflate again
+ * to flush the rest.
+ */
+ s->noheader = -1; /* write the trailer only once! */
+ return s->pending != 0 ? Z_OK : Z_STREAM_END;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateEnd (strm)
+ z_streamp strm;
+{
+ int status;
+
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ status = strm->state->status;
+ if (status != INIT_STATE && status != BUSY_STATE &&
+ status != FINISH_STATE) {
+ return Z_STREAM_ERROR;
+ }
+
+ /* Deallocate in reverse order of allocations: */
+ TRY_FREE(strm, strm->state->pending_buf);
+ TRY_FREE(strm, strm->state->head);
+ TRY_FREE(strm, strm->state->prev);
+ TRY_FREE(strm, strm->state->window);
+
+ ZFREE(strm, strm->state);
+ strm->state = Z_NULL;
+
+ return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
+}
+
+/* =========================================================================
+ * Copy the source state to the destination state.
+ * To simplify the source, this is not supported for 16-bit MSDOS (which
+ * doesn't have enough memory anyway to duplicate compression states).
+ */
+int ZEXPORT deflateCopy (dest, source)
+ z_streamp dest;
+ z_streamp source;
+{
+#ifdef MAXSEG_64K
+ return Z_STREAM_ERROR;
+#else
+ deflate_state *ds;
+ deflate_state *ss;
+ ushf *overlay;
+
+
+ if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) {
+ return Z_STREAM_ERROR;
+ }
+
+ ss = source->state;
+
+ *dest = *source;
+
+ ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));
+ if (ds == Z_NULL) return Z_MEM_ERROR;
+ dest->state = (struct internal_state FAR *) ds;
+ *ds = *ss;
+ ds->strm = dest;
+
+ ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
+ ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos));
+ ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos));
+ overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2);
+ ds->pending_buf = (uchf *) overlay;
+
+ if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
+ ds->pending_buf == Z_NULL) {
+ deflateEnd (dest);
+ return Z_MEM_ERROR;
+ }
+ /* following zmemcpy do not work for 16-bit MSDOS */
+ zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
+ zmemcpy((Bytef *) ds->prev, (const Bytef *) ss->prev, ds->w_size * sizeof(Pos));
+ zmemcpy((Bytef *) ds->head, (const Bytef *) ss->head, ds->hash_size * sizeof(Pos));
+ zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
+
+ ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
+ ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush);
+ ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize;
+
+ ds->l_desc.dyn_tree = ds->dyn_ltree;
+ ds->d_desc.dyn_tree = ds->dyn_dtree;
+ ds->bl_desc.dyn_tree = ds->bl_tree;
+
+ return Z_OK;
+#endif
+}
+
+/* ===========================================================================
+ * Read a new buffer from the current input stream, update the adler32
+ * and total number of bytes read. All deflate() input goes through
+ * this function so some applications may wish to modify it to avoid
+ * allocating a large strm->next_in buffer and copying from it.
+ * (See also flush_pending()).
+ */
+local int read_buf(strm, buf, size)
+ z_streamp strm;
+ Bytef *buf;
+ unsigned size;
+{
+ unsigned len = strm->avail_in;
+
+ if (len > size) len = size;
+ if (len == 0) return 0;
+
+ strm->avail_in -= len;
+
+ if (!strm->state->noheader) {
+ strm->adler = adler32(strm->adler, strm->next_in, len);
+ }
+ zmemcpy(buf, strm->next_in, len);
+ strm->next_in += len;
+ strm->total_in += len;
+
+ return (int)len;
+}
+
+/* ===========================================================================
+ * Initialize the "longest match" routines for a new zlib stream
+ */
+local void lm_init (s)
+ deflate_state *s;
+{
+ s->window_size = (ulg)2L*s->w_size;
+
+ CLEAR_HASH(s);
+
+ /* Set the default configuration parameters:
+ */
+ s->max_lazy_match = configuration_table[s->level].max_lazy;
+ s->good_match = configuration_table[s->level].good_length;
+ s->nice_match = configuration_table[s->level].nice_length;
+ s->max_chain_length = configuration_table[s->level].max_chain;
+
+ s->strstart = 0;
+ s->block_start = 0L;
+ s->lookahead = 0;
+ s->match_length = s->prev_length = MIN_MATCH-1;
+ s->match_available = 0;
+ s->ins_h = 0;
+#ifdef ASMV
+ match_init(); /* initialize the asm code */
+#endif
+}
+
+/* ===========================================================================
+ * Set match_start to the longest match starting at the given string and
+ * return its length. Matches shorter or equal to prev_length are discarded,
+ * in which case the result is equal to prev_length and match_start is
+ * garbage.
+ * IN assertions: cur_match is the head of the hash chain for the current
+ * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
+ * OUT assertion: the match length is not greater than s->lookahead.
+ */
+#ifndef ASMV
+/* For 80x86 and 680x0, an optimized version will be provided in match.asm or
+ * match.S. The code will be functionally equivalent.
+ */
+#ifndef FASTEST
+local uInt longest_match(s, cur_match)
+ deflate_state *s;
+ IPos cur_match; /* current match */
+{
+ unsigned chain_length = s->max_chain_length;/* max hash chain length */
+ register Bytef *scan = s->window + s->strstart; /* current string */
+ register Bytef *match; /* matched string */
+ register int len; /* length of current match */
+ int best_len = s->prev_length; /* best match length so far */
+ int nice_match = s->nice_match; /* stop if match long enough */
+ IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
+ s->strstart - (IPos)MAX_DIST(s) : NIL;
+ /* Stop when cur_match becomes <= limit. To simplify the code,
+ * we prevent matches with the string of window index 0.
+ */
+ Posf *prev = s->prev;
+ uInt wmask = s->w_mask;
+
+#ifdef UNALIGNED_OK
+ /* Compare two bytes at a time. Note: this is not always beneficial.
+ * Try with and without -DUNALIGNED_OK to check.
+ */
+ register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
+ register ush scan_start = *(ushf*)scan;
+ register ush scan_end = *(ushf*)(scan+best_len-1);
+#else
+ register Bytef *strend = s->window + s->strstart + MAX_MATCH;
+ register Byte scan_end1 = scan[best_len-1];
+ register Byte scan_end = scan[best_len];
+#endif
+
+ /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
+ * It is easy to get rid of this optimization if necessary.
+ */
+ Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
+
+ /* Do not waste too much time if we already have a good match: */
+ if (s->prev_length >= s->good_match) {
+ chain_length >>= 2;
+ }
+ /* Do not look for matches beyond the end of the input. This is necessary
+ * to make deflate deterministic.
+ */
+ if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
+
+ Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
+
+ do {
+ Assert(cur_match < s->strstart, "no future");
+ match = s->window + cur_match;
+
+ /* Skip to next match if the match length cannot increase
+ * or if the match length is less than 2:
+ */
+#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
+ /* This code assumes sizeof(unsigned short) == 2. Do not use
+ * UNALIGNED_OK if your compiler uses a different size.
+ */
+ if (*(ushf*)(match+best_len-1) != scan_end ||
+ *(ushf*)match != scan_start) continue;
+
+ /* It is not necessary to compare scan[2] and match[2] since they are
+ * always equal when the other bytes match, given that the hash keys
+ * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
+ * strstart+3, +5, ... up to strstart+257. We check for insufficient
+ * lookahead only every 4th comparison; the 128th check will be made
+ * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is
+ * necessary to put more guard bytes at the end of the window, or
+ * to check more often for insufficient lookahead.
+ */
+ Assert(scan[2] == match[2], "scan[2]?");
+ scan++, match++;
+ do {
+ } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ scan < strend);
+ /* The funny "do {}" generates better code on most compilers */
+
+ /* Here, scan <= window+strstart+257 */
+ Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+ if (*scan == *match) scan++;
+
+ len = (MAX_MATCH - 1) - (int)(strend-scan);
+ scan = strend - (MAX_MATCH-1);
+
+#else /* UNALIGNED_OK */
+
+ if (match[best_len] != scan_end ||
+ match[best_len-1] != scan_end1 ||
+ *match != *scan ||
+ *++match != scan[1]) continue;
+
+ /* The check at best_len-1 can be removed because it will be made
+ * again later. (This heuristic is not always a win.)
+ * It is not necessary to compare scan[2] and match[2] since they
+ * are always equal when the other bytes match, given that
+ * the hash keys are equal and that HASH_BITS >= 8.
+ */
+ scan += 2, match++;
+ Assert(*scan == *match, "match[2]?");
+
+ /* We check for insufficient lookahead only every 8th comparison;
+ * the 256th check will be made at strstart+258.
+ */
+ do {
+ } while (*++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ scan < strend);
+
+ Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+
+ len = MAX_MATCH - (int)(strend - scan);
+ scan = strend - MAX_MATCH;
+
+#endif /* UNALIGNED_OK */
+
+ if (len > best_len) {
+ s->match_start = cur_match;
+ best_len = len;
+ if (len >= nice_match) break;
+#ifdef UNALIGNED_OK
+ scan_end = *(ushf*)(scan+best_len-1);
+#else
+ scan_end1 = scan[best_len-1];
+ scan_end = scan[best_len];
+#endif
+ }
+ } while ((cur_match = prev[cur_match & wmask]) > limit
+ && --chain_length != 0);
+
+ if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
+ return s->lookahead;
+}
+
+#else /* FASTEST */
+/* ---------------------------------------------------------------------------
+ * Optimized version for level == 1 only
+ */
+local uInt longest_match(s, cur_match)
+ deflate_state *s;
+ IPos cur_match; /* current match */
+{
+ register Bytef *scan = s->window + s->strstart; /* current string */
+ register Bytef *match; /* matched string */
+ register int len; /* length of current match */
+ register Bytef *strend = s->window + s->strstart + MAX_MATCH;
+
+ /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
+ * It is easy to get rid of this optimization if necessary.
+ */
+ Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
+
+ Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
+
+ Assert(cur_match < s->strstart, "no future");
+
+ match = s->window + cur_match;
+
+ /* Return failure if the match length is less than 2:
+ */
+ if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
+
+ /* The check at best_len-1 can be removed because it will be made
+ * again later. (This heuristic is not always a win.)
+ * It is not necessary to compare scan[2] and match[2] since they
+ * are always equal when the other bytes match, given that
+ * the hash keys are equal and that HASH_BITS >= 8.
+ */
+ scan += 2, match += 2;
+ Assert(*scan == *match, "match[2]?");
+
+ /* We check for insufficient lookahead only every 8th comparison;
+ * the 256th check will be made at strstart+258.
+ */
+ do {
+ } while (*++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ scan < strend);
+
+ Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+
+ len = MAX_MATCH - (int)(strend - scan);
+
+ if (len < MIN_MATCH) return MIN_MATCH - 1;
+
+ s->match_start = cur_match;
+ return len <= s->lookahead ? len : s->lookahead;
+}
+#endif /* FASTEST */
+#endif /* ASMV */
+
+#ifdef DEBUG
+/* ===========================================================================
+ * Check that the match at match_start is indeed a match.
+ */
+local void check_match(s, start, match, length)
+ deflate_state *s;
+ IPos start, match;
+ int length;
+{
+ /* check that the match is indeed a match */
+ if (zmemcmp(s->window + match,
+ s->window + start, length) != EQUAL) {
+ fprintf(stderr, " start %u, match %u, length %d\n",
+ start, match, length);
+ do {
+ fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
+ } while (--length != 0);
+ z_error("invalid match");
+ }
+ if (z_verbose > 1) {
+ fprintf(stderr,"\\[%d,%d]", start-match, length);
+ do { putc(s->window[start++], stderr); } while (--length != 0);
+ }
+}
+#else
+# define check_match(s, start, match, length)
+#endif
+
+/* ===========================================================================
+ * Fill the window when the lookahead becomes insufficient.
+ * Updates strstart and lookahead.
+ *
+ * IN assertion: lookahead < MIN_LOOKAHEAD
+ * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
+ * At least one byte has been read, or avail_in == 0; reads are
+ * performed for at least two bytes (required for the zip translate_eol
+ * option -- not supported here).
+ */
+local void fill_window(s)
+ deflate_state *s;
+{
+ register unsigned n, m;
+ register Posf *p;
+ unsigned more; /* Amount of free space at the end of the window. */
+ uInt wsize = s->w_size;
+
+ do {
+ more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
+
+ /* Deal with !@#$% 64K limit: */
+ if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
+ more = wsize;
+
+ } else if (more == (unsigned)(-1)) {
+ /* Very unlikely, but possible on 16 bit machine if strstart == 0
+ * and lookahead == 1 (input done one byte at time)
+ */
+ more--;
+
+ /* If the window is almost full and there is insufficient lookahead,
+ * move the upper half to the lower one to make room in the upper half.
+ */
+ } else if (s->strstart >= wsize+MAX_DIST(s)) {
+
+ zmemcpy(s->window, s->window+wsize, (unsigned)wsize);
+ s->match_start -= wsize;
+ s->strstart -= wsize; /* we now have strstart >= MAX_DIST */
+ s->block_start -= (long) wsize;
+
+ /* Slide the hash table (could be avoided with 32 bit values
+ at the expense of memory usage). We slide even when level == 0
+ to keep the hash table consistent if we switch back to level > 0
+ later. (Using level 0 permanently is not an optimal usage of
+ zlib, so we don't care about this pathological case.)
+ */
+ n = s->hash_size;
+ p = &s->head[n];
+ do {
+ m = *--p;
+ *p = (Pos)(m >= wsize ? m-wsize : NIL);
+ } while (--n);
+
+ n = wsize;
+#ifndef FASTEST
+ p = &s->prev[n];
+ do {
+ m = *--p;
+ *p = (Pos)(m >= wsize ? m-wsize : NIL);
+ /* If n is not on any hash chain, prev[n] is garbage but
+ * its value will never be used.
+ */
+ } while (--n);
+#endif
+ more += wsize;
+ }
+ if (s->strm->avail_in == 0) return;
+
+ /* If there was no sliding:
+ * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
+ * more == window_size - lookahead - strstart
+ * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
+ * => more >= window_size - 2*WSIZE + 2
+ * In the BIG_MEM or MMAP case (not yet supported),
+ * window_size == input_size + MIN_LOOKAHEAD &&
+ * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
+ * Otherwise, window_size == 2*WSIZE so more >= 2.
+ * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
+ */
+ Assert(more >= 2, "more < 2");
+
+ n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
+ s->lookahead += n;
+
+ /* Initialize the hash value now that we have some input: */
+ if (s->lookahead >= MIN_MATCH) {
+ s->ins_h = s->window[s->strstart];
+ UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
+#if MIN_MATCH != 3
+ Call UPDATE_HASH() MIN_MATCH-3 more times
+#endif
+ }
+ /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
+ * but this is not important since only literal bytes will be emitted.
+ */
+
+ } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
+}
+
+/* ===========================================================================
+ * Flush the current block, with given end-of-file flag.
+ * IN assertion: strstart is set to the end of the current match.
+ */
+#define FLUSH_BLOCK_ONLY(s, eof) { \
+ _tr_flush_block(s, (s->block_start >= 0L ? \
+ (charf *)&s->window[(unsigned)s->block_start] : \
+ (charf *)Z_NULL), \
+ (ulg)((long)s->strstart - s->block_start), \
+ (eof)); \
+ s->block_start = s->strstart; \
+ flush_pending(s->strm); \
+ Tracev((stderr,"[FLUSH]")); \
+}
+
+/* Same but force premature exit if necessary. */
+#define FLUSH_BLOCK(s, eof) { \
+ FLUSH_BLOCK_ONLY(s, eof); \
+ if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \
+}
+
+/* ===========================================================================
+ * Copy without compression as much as possible from the input stream, return
+ * the current block state.
+ * This function does not insert new strings in the dictionary since
+ * uncompressible data is probably not useful. This function is used
+ * only for the level=0 compression option.
+ * NOTE: this function should be optimized to avoid extra copying from
+ * window to pending_buf.
+ */
+local block_state deflate_stored(s, flush)
+ deflate_state *s;
+ int flush;
+{
+ /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
+ * to pending_buf_size, and each stored block has a 5 byte header:
+ */
+ ulg max_block_size = 0xffff;
+ ulg max_start;
+
+ if (max_block_size > s->pending_buf_size - 5) {
+ max_block_size = s->pending_buf_size - 5;
+ }
+
+ /* Copy as much as possible from input to output: */
+ for (;;) {
+ /* Fill the window as much as possible: */
+ if (s->lookahead <= 1) {
+
+ Assert(s->strstart < s->w_size+MAX_DIST(s) ||
+ s->block_start >= (long)s->w_size, "slide too late");
+
+ fill_window(s);
+ if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more;
+
+ if (s->lookahead == 0) break; /* flush the current block */
+ }
+ Assert(s->block_start >= 0L, "block gone");
+
+ s->strstart += s->lookahead;
+ s->lookahead = 0;
+
+ /* Emit a stored block if pending_buf will be full: */
+ max_start = s->block_start + max_block_size;
+ if (s->strstart == 0 || (ulg)s->strstart >= max_start) {
+ /* strstart == 0 is possible when wraparound on 16-bit machine */
+ s->lookahead = (uInt)(s->strstart - max_start);
+ s->strstart = (uInt)max_start;
+ FLUSH_BLOCK(s, 0);
+ }
+ /* Flush if we may have to slide, otherwise block_start may become
+ * negative and the data will be gone:
+ */
+ if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) {
+ FLUSH_BLOCK(s, 0);
+ }
+ }
+ FLUSH_BLOCK(s, flush == Z_FINISH);
+ return flush == Z_FINISH ? finish_done : block_done;
+}
+
+/* ===========================================================================
+ * Compress as much as possible from the input stream, return the current
+ * block state.
+ * This function does not perform lazy evaluation of matches and inserts
+ * new strings in the dictionary only for unmatched strings or for short
+ * matches. It is used only for the fast compression options.
+ */
+local block_state deflate_fast(s, flush)
+ deflate_state *s;
+ int flush;
+{
+ IPos hash_head = NIL; /* head of the hash chain */
+ int bflush; /* set if current block must be flushed */
+
+ for (;;) {
+ /* Make sure that we always have enough lookahead, except
+ * at the end of the input file. We need MAX_MATCH bytes
+ * for the next match, plus MIN_MATCH bytes to insert the
+ * string following the next match.
+ */
+ if (s->lookahead < MIN_LOOKAHEAD) {
+ fill_window(s);
+ if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
+ return need_more;
+ }
+ if (s->lookahead == 0) break; /* flush the current block */
+ }
+
+ /* Insert the string window[strstart .. strstart+2] in the
+ * dictionary, and set hash_head to the head of the hash chain:
+ */
+ if (s->lookahead >= MIN_MATCH) {
+ INSERT_STRING(s, s->strstart, hash_head);
+ }
+
+ /* Find the longest match, discarding those <= prev_length.
+ * At this point we have always match_length < MIN_MATCH
+ */
+ if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) {
+ /* To simplify the code, we prevent matches with the string
+ * of window index 0 (in particular we have to avoid a match
+ * of the string with itself at the start of the input file).
+ */
+ if (s->strategy != Z_HUFFMAN_ONLY) {
+ s->match_length = longest_match (s, hash_head);
+ }
+ /* longest_match() sets match_start */
+ }
+ if (s->match_length >= MIN_MATCH) {
+ check_match(s, s->strstart, s->match_start, s->match_length);
+
+ _tr_tally_dist(s, s->strstart - s->match_start,
+ s->match_length - MIN_MATCH, bflush);
+
+ s->lookahead -= s->match_length;
+
+ /* Insert new strings in the hash table only if the match length
+ * is not too large. This saves time but degrades compression.
+ */
+#ifndef FASTEST
+ if (s->match_length <= s->max_insert_length &&
+ s->lookahead >= MIN_MATCH) {
+ s->match_length--; /* string at strstart already in hash table */
+ do {
+ s->strstart++;
+ INSERT_STRING(s, s->strstart, hash_head);
+ /* strstart never exceeds WSIZE-MAX_MATCH, so there are
+ * always MIN_MATCH bytes ahead.
+ */
+ } while (--s->match_length != 0);
+ s->strstart++;
+ } else
+#endif
+ {
+ s->strstart += s->match_length;
+ s->match_length = 0;
+ s->ins_h = s->window[s->strstart];
+ UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
+#if MIN_MATCH != 3
+ Call UPDATE_HASH() MIN_MATCH-3 more times
+#endif
+ /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
+ * matter since it will be recomputed at next deflate call.
+ */
+ }
+ } else {
+ /* No match, output a literal byte */
+ Tracevv((stderr,"%c", s->window[s->strstart]));
+ _tr_tally_lit (s, s->window[s->strstart], bflush);
+ s->lookahead--;
+ s->strstart++;
+ }
+ if (bflush) FLUSH_BLOCK(s, 0);
+ }
+ FLUSH_BLOCK(s, flush == Z_FINISH);
+ return flush == Z_FINISH ? finish_done : block_done;
+}
+
+/* ===========================================================================
+ * Same as above, but achieves better compression. We use a lazy
+ * evaluation for matches: a match is finally adopted only if there is
+ * no better match at the next window position.
+ */
+local block_state deflate_slow(s, flush)
+ deflate_state *s;
+ int flush;
+{
+ IPos hash_head = NIL; /* head of hash chain */
+ int bflush; /* set if current block must be flushed */
+
+ /* Process the input block. */
+ for (;;) {
+ /* Make sure that we always have enough lookahead, except
+ * at the end of the input file. We need MAX_MATCH bytes
+ * for the next match, plus MIN_MATCH bytes to insert the
+ * string following the next match.
+ */
+ if (s->lookahead < MIN_LOOKAHEAD) {
+ fill_window(s);
+ if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
+ return need_more;
+ }
+ if (s->lookahead == 0) break; /* flush the current block */
+ }
+
+ /* Insert the string window[strstart .. strstart+2] in the
+ * dictionary, and set hash_head to the head of the hash chain:
+ */
+ if (s->lookahead >= MIN_MATCH) {
+ INSERT_STRING(s, s->strstart, hash_head);
+ }
+
+ /* Find the longest match, discarding those <= prev_length.
+ */
+ s->prev_length = s->match_length, s->prev_match = s->match_start;
+ s->match_length = MIN_MATCH-1;
+
+ if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
+ s->strstart - hash_head <= MAX_DIST(s)) {
+ /* To simplify the code, we prevent matches with the string
+ * of window index 0 (in particular we have to avoid a match
+ * of the string with itself at the start of the input file).
+ */
+ if (s->strategy != Z_HUFFMAN_ONLY) {
+ s->match_length = longest_match (s, hash_head);
+ }
+ /* longest_match() sets match_start */
+
+ if (s->match_length <= 5 && (s->strategy == Z_FILTERED ||
+ (s->match_length == MIN_MATCH &&
+ s->strstart - s->match_start > TOO_FAR))) {
+
+ /* If prev_match is also MIN_MATCH, match_start is garbage
+ * but we will ignore the current match anyway.
+ */
+ s->match_length = MIN_MATCH-1;
+ }
+ }
+ /* If there was a match at the previous step and the current
+ * match is not better, output the previous match:
+ */
+ if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {
+ uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
+ /* Do not insert strings in hash table beyond this. */
+
+ check_match(s, s->strstart-1, s->prev_match, s->prev_length);
+
+ _tr_tally_dist(s, s->strstart -1 - s->prev_match,
+ s->prev_length - MIN_MATCH, bflush);
+
+ /* Insert in hash table all strings up to the end of the match.
+ * strstart-1 and strstart are already inserted. If there is not
+ * enough lookahead, the last two strings are not inserted in
+ * the hash table.
+ */
+ s->lookahead -= s->prev_length-1;
+ s->prev_length -= 2;
+ do {
+ if (++s->strstart <= max_insert) {
+ INSERT_STRING(s, s->strstart, hash_head);
+ }
+ } while (--s->prev_length != 0);
+ s->match_available = 0;
+ s->match_length = MIN_MATCH-1;
+ s->strstart++;
+
+ if (bflush) FLUSH_BLOCK(s, 0);
+
+ } else if (s->match_available) {
+ /* If there was no match at the previous position, output a
+ * single literal. If there was a match but the current match
+ * is longer, truncate the previous match to a single literal.
+ */
+ Tracevv((stderr,"%c", s->window[s->strstart-1]));
+ _tr_tally_lit(s, s->window[s->strstart-1], bflush);
+ if (bflush) {
+ FLUSH_BLOCK_ONLY(s, 0);
+ }
+ s->strstart++;
+ s->lookahead--;
+ if (s->strm->avail_out == 0) return need_more;
+ } else {
+ /* There is no previous match to compare with, wait for
+ * the next step to decide.
+ */
+ s->match_available = 1;
+ s->strstart++;
+ s->lookahead--;
+ }
+ }
+ Assert (flush != Z_NO_FLUSH, "no flush?");
+ if (s->match_available) {
+ Tracevv((stderr,"%c", s->window[s->strstart-1]));
+ _tr_tally_lit(s, s->window[s->strstart-1], bflush);
+ s->match_available = 0;
+ }
+ FLUSH_BLOCK(s, flush == Z_FINISH);
+ return flush == Z_FINISH ? finish_done : block_done;
+}
diff --git a/cfe/cfe/zlib/deflate.h b/cfe/cfe/zlib/deflate.h
new file mode 100644
index 0000000..e91a4f2
--- /dev/null
+++ b/cfe/cfe/zlib/deflate.h
@@ -0,0 +1,318 @@
+/* deflate.h -- internal compression state
+ * Copyright (C) 1995-1998 Jean-loup Gailly
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+/* @(#) $Id: deflate.h,v 1.1 2001/11/09 01:48:02 mpl Exp $ */
+
+#ifndef _DEFLATE_H
+#define _DEFLATE_H
+
+#include "zutil.h"
+
+/* ===========================================================================
+ * Internal compression state.
+ */
+
+#define LENGTH_CODES 29
+/* number of length codes, not counting the special END_BLOCK code */
+
+#define LITERALS 256
+/* number of literal bytes 0..255 */
+
+#define L_CODES (LITERALS+1+LENGTH_CODES)
+/* number of Literal or Length codes, including the END_BLOCK code */
+
+#define D_CODES 30
+/* number of distance codes */
+
+#define BL_CODES 19
+/* number of codes used to transfer the bit lengths */
+
+#define HEAP_SIZE (2*L_CODES+1)
+/* maximum heap size */
+
+#define MAX_BITS 15
+/* All codes must not exceed MAX_BITS bits */
+
+#define INIT_STATE 42
+#define BUSY_STATE 113
+#define FINISH_STATE 666
+/* Stream status */
+
+
+/* Data structure describing a single value and its code string. */
+typedef struct ct_data_s {
+ union {
+ ush freq; /* frequency count */
+ ush code; /* bit string */
+ } fc;
+ union {
+ ush dad; /* father node in Huffman tree */
+ ush len; /* length of bit string */
+ } dl;
+} FAR ct_data;
+
+#define Freq fc.freq
+#define Code fc.code
+#define Dad dl.dad
+#define Len dl.len
+
+typedef struct static_tree_desc_s static_tree_desc;
+
+typedef struct tree_desc_s {
+ ct_data *dyn_tree; /* the dynamic tree */
+ int max_code; /* largest code with non zero frequency */
+ static_tree_desc *stat_desc; /* the corresponding static tree */
+} FAR tree_desc;
+
+typedef ush Pos;
+typedef Pos FAR Posf;
+typedef unsigned IPos;
+
+/* A Pos is an index in the character window. We use short instead of int to
+ * save space in the various tables. IPos is used only for parameter passing.
+ */
+
+typedef struct internal_state {
+ z_streamp strm; /* pointer back to this zlib stream */
+ int status; /* as the name implies */
+ Bytef *pending_buf; /* output still pending */
+ ulg pending_buf_size; /* size of pending_buf */
+ Bytef *pending_out; /* next pending byte to output to the stream */
+ int pending; /* nb of bytes in the pending buffer */
+ int noheader; /* suppress zlib header and adler32 */
+ Byte data_type; /* UNKNOWN, BINARY or ASCII */
+ Byte method; /* STORED (for zip only) or DEFLATED */
+ int last_flush; /* value of flush param for previous deflate call */
+
+ /* used by deflate.c: */
+
+ uInt w_size; /* LZ77 window size (32K by default) */
+ uInt w_bits; /* log2(w_size) (8..16) */
+ uInt w_mask; /* w_size - 1 */
+
+ Bytef *window;
+ /* Sliding window. Input bytes are read into the second half of the window,
+ * and move to the first half later to keep a dictionary of at least wSize
+ * bytes. With this organization, matches are limited to a distance of
+ * wSize-MAX_MATCH bytes, but this ensures that IO is always
+ * performed with a length multiple of the block size. Also, it limits
+ * the window size to 64K, which is quite useful on MSDOS.
+ * To do: use the user input buffer as sliding window.
+ */
+
+ ulg window_size;
+ /* Actual size of window: 2*wSize, except when the user input buffer
+ * is directly used as sliding window.
+ */
+
+ Posf *prev;
+ /* Link to older string with same hash index. To limit the size of this
+ * array to 64K, this link is maintained only for the last 32K strings.
+ * An index in this array is thus a window index modulo 32K.
+ */
+
+ Posf *head; /* Heads of the hash chains or NIL. */
+
+ uInt ins_h; /* hash index of string to be inserted */
+ uInt hash_size; /* number of elements in hash table */
+ uInt hash_bits; /* log2(hash_size) */
+ uInt hash_mask; /* hash_size-1 */
+
+ uInt hash_shift;
+ /* Number of bits by which ins_h must be shifted at each input
+ * step. It must be such that after MIN_MATCH steps, the oldest
+ * byte no longer takes part in the hash key, that is:
+ * hash_shift * MIN_MATCH >= hash_bits
+ */
+
+ long block_start;
+ /* Window position at the beginning of the current output block. Gets
+ * negative when the window is moved backwards.
+ */
+
+ uInt match_length; /* length of best match */
+ IPos prev_match; /* previous match */
+ int match_available; /* set if previous match exists */
+ uInt strstart; /* start of string to insert */
+ uInt match_start; /* start of matching string */
+ uInt lookahead; /* number of valid bytes ahead in window */
+
+ uInt prev_length;
+ /* Length of the best match at previous step. Matches not greater than this
+ * are discarded. This is used in the lazy match evaluation.
+ */
+
+ uInt max_chain_length;
+ /* To speed up deflation, hash chains are never searched beyond this
+ * length. A higher limit improves compression ratio but degrades the
+ * speed.
+ */
+
+ uInt max_lazy_match;
+ /* Attempt to find a better match only when the current match is strictly
+ * smaller than this value. This mechanism is used only for compression
+ * levels >= 4.
+ */
+# define max_insert_length max_lazy_match
+ /* Insert new strings in the hash table only if the match length is not
+ * greater than this length. This saves time but degrades compression.
+ * max_insert_length is used only for compression levels <= 3.
+ */
+
+ int level; /* compression level (1..9) */
+ int strategy; /* favor or force Huffman coding*/
+
+ uInt good_match;
+ /* Use a faster search when the previous match is longer than this */
+
+ int nice_match; /* Stop searching when current match exceeds this */
+
+ /* used by trees.c: */
+ /* Didn't use ct_data typedef below to supress compiler warning */
+ struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
+ struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
+ struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
+
+ struct tree_desc_s l_desc; /* desc. for literal tree */
+ struct tree_desc_s d_desc; /* desc. for distance tree */
+ struct tree_desc_s bl_desc; /* desc. for bit length tree */
+
+ ush bl_count[MAX_BITS+1];
+ /* number of codes at each bit length for an optimal tree */
+
+ int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
+ int heap_len; /* number of elements in the heap */
+ int heap_max; /* element of largest frequency */
+ /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
+ * The same heap array is used to build all trees.
+ */
+
+ uch depth[2*L_CODES+1];
+ /* Depth of each subtree used as tie breaker for trees of equal frequency
+ */
+
+ uchf *l_buf; /* buffer for literals or lengths */
+
+ uInt lit_bufsize;
+ /* Size of match buffer for literals/lengths. There are 4 reasons for
+ * limiting lit_bufsize to 64K:
+ * - frequencies can be kept in 16 bit counters
+ * - if compression is not successful for the first block, all input
+ * data is still in the window so we can still emit a stored block even
+ * when input comes from standard input. (This can also be done for
+ * all blocks if lit_bufsize is not greater than 32K.)
+ * - if compression is not successful for a file smaller than 64K, we can
+ * even emit a stored file instead of a stored block (saving 5 bytes).
+ * This is applicable only for zip (not gzip or zlib).
+ * - creating new Huffman trees less frequently may not provide fast
+ * adaptation to changes in the input data statistics. (Take for
+ * example a binary file with poorly compressible code followed by
+ * a highly compressible string table.) Smaller buffer sizes give
+ * fast adaptation but have of course the overhead of transmitting
+ * trees more frequently.
+ * - I can't count above 4
+ */
+
+ uInt last_lit; /* running index in l_buf */
+
+ ushf *d_buf;
+ /* Buffer for distances. To simplify the code, d_buf and l_buf have
+ * the same number of elements. To use different lengths, an extra flag
+ * array would be necessary.
+ */
+
+ ulg opt_len; /* bit length of current block with optimal trees */
+ ulg static_len; /* bit length of current block with static trees */
+ uInt matches; /* number of string matches in current block */
+ int last_eob_len; /* bit length of EOB code for last block */
+
+#ifdef DEBUG
+ ulg compressed_len; /* total bit length of compressed file mod 2^32 */
+ ulg bits_sent; /* bit length of compressed data sent mod 2^32 */
+#endif
+
+ ush bi_buf;
+ /* Output buffer. bits are inserted starting at the bottom (least
+ * significant bits).
+ */
+ int bi_valid;
+ /* Number of valid bits in bi_buf. All bits above the last valid bit
+ * are always zero.
+ */
+
+} FAR deflate_state;
+
+/* Output a byte on the stream.
+ * IN assertion: there is enough room in pending_buf.
+ */
+#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);}
+
+
+#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
+/* Minimum amount of lookahead, except at the end of the input file.
+ * See deflate.c for comments about the MIN_MATCH+1.
+ */
+
+#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD)
+/* In order to simplify the code, particularly on 16 bit machines, match
+ * distances are limited to MAX_DIST instead of WSIZE.
+ */
+
+ /* in trees.c */
+void _tr_init OF((deflate_state *s));
+int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
+void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len,
+ int eof));
+void _tr_align OF((deflate_state *s));
+void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
+ int eof));
+
+#define d_code(dist) \
+ ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
+/* Mapping from a distance to a distance code. dist is the distance - 1 and
+ * must not have side effects. _dist_code[256] and _dist_code[257] are never
+ * used.
+ */
+
+#ifndef DEBUG
+/* Inline versions of _tr_tally for speed: */
+
+#if defined(GEN_TREES_H) || !defined(STDC)
+ extern uch _length_code[];
+ extern uch _dist_code[];
+#else
+ extern const uch _length_code[];
+ extern const uch _dist_code[];
+#endif
+
+# define _tr_tally_lit(s, c, flush) \
+ { uch cc = (c); \
+ s->d_buf[s->last_lit] = 0; \
+ s->l_buf[s->last_lit++] = cc; \
+ s->dyn_ltree[cc].Freq++; \
+ flush = (s->last_lit == s->lit_bufsize-1); \
+ }
+# define _tr_tally_dist(s, distance, length, flush) \
+ { uch len = (length); \
+ ush dist = (distance); \
+ s->d_buf[s->last_lit] = dist; \
+ s->l_buf[s->last_lit++] = len; \
+ dist--; \
+ s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
+ s->dyn_dtree[d_code(dist)].Freq++; \
+ flush = (s->last_lit == s->lit_bufsize-1); \
+ }
+#else
+# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
+# define _tr_tally_dist(s, distance, length, flush) \
+ flush = _tr_tally(s, distance, length)
+#endif
+
+#endif
diff --git a/cfe/cfe/zlib/descrip.mms b/cfe/cfe/zlib/descrip.mms
new file mode 100644
index 0000000..9d36459
--- /dev/null
+++ b/cfe/cfe/zlib/descrip.mms
@@ -0,0 +1,48 @@
+# descrip.mms: MMS description file for building zlib on VMS
+# written by Martin P.J. Zinser <m.zinser@gsi.de>
+
+cc_defs =
+c_deb =
+
+.ifdef __DECC__
+pref = /prefix=all
+.endif
+
+OBJS = adler32.obj, compress.obj, crc32.obj, gzio.obj, uncompr.obj,\
+ deflate.obj, trees.obj, zutil.obj, inflate.obj, infblock.obj,\
+ inftrees.obj, infcodes.obj, infutil.obj, inffast.obj
+
+CFLAGS= $(C_DEB) $(CC_DEFS) $(PREF)
+
+all : example.exe minigzip.exe
+ @ write sys$output " Example applications available"
+libz.olb : libz.olb($(OBJS))
+ @ write sys$output " libz available"
+
+example.exe : example.obj libz.olb
+ link example,libz.olb/lib
+
+minigzip.exe : minigzip.obj libz.olb
+ link minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib
+
+clean :
+ delete *.obj;*,libz.olb;*
+
+
+# Other dependencies.
+adler32.obj : zutil.h zlib.h zconf.h
+compress.obj : zlib.h zconf.h
+crc32.obj : zutil.h zlib.h zconf.h
+deflate.obj : deflate.h zutil.h zlib.h zconf.h
+example.obj : zlib.h zconf.h
+gzio.obj : zutil.h zlib.h zconf.h
+infblock.obj : zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
+infcodes.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h
+inffast.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
+inflate.obj : zutil.h zlib.h zconf.h infblock.h
+inftrees.obj : zutil.h zlib.h zconf.h inftrees.h
+infutil.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h
+minigzip.obj : zlib.h zconf.h
+trees.obj : deflate.h zutil.h zlib.h zconf.h
+uncompr.obj : zlib.h zconf.h
+zutil.obj : zutil.h zlib.h zconf.h
diff --git a/cfe/cfe/zlib/example.c b/cfe/cfe/zlib/example.c
new file mode 100644
index 0000000..63a1b1e
--- /dev/null
+++ b/cfe/cfe/zlib/example.c
@@ -0,0 +1,556 @@
+/* example.c -- usage example of the zlib compression library
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: example.c,v 1.1 2001/11/09 01:48:02 mpl Exp $ */
+
+#include <stdio.h>
+#include "zlib.h"
+
+#ifdef STDC
+# include <string.h>
+# include <stdlib.h>
+#else
+ extern void exit OF((int));
+#endif
+
+#if defined(VMS) || defined(RISCOS)
+# define TESTFILE "foo-gz"
+#else
+# define TESTFILE "foo.gz"
+#endif
+
+#define CHECK_ERR(err, msg) { \
+ if (err != Z_OK) { \
+ fprintf(stderr, "%s error: %d\n", msg, err); \
+ exit(1); \
+ } \
+}
+
+const char hello[] = "hello, hello!";
+/* "hello world" would be more standard, but the repeated "hello"
+ * stresses the compression code better, sorry...
+ */
+
+const char dictionary[] = "hello";
+uLong dictId; /* Adler32 value of the dictionary */
+
+void test_compress OF((Byte *compr, uLong comprLen,
+ Byte *uncompr, uLong uncomprLen));
+void test_gzio OF((const char *out, const char *in,
+ Byte *uncompr, int uncomprLen));
+void test_deflate OF((Byte *compr, uLong comprLen));
+void test_inflate OF((Byte *compr, uLong comprLen,
+ Byte *uncompr, uLong uncomprLen));
+void test_large_deflate OF((Byte *compr, uLong comprLen,
+ Byte *uncompr, uLong uncomprLen));
+void test_large_inflate OF((Byte *compr, uLong comprLen,
+ Byte *uncompr, uLong uncomprLen));
+void test_flush OF((Byte *compr, uLong *comprLen));
+void test_sync OF((Byte *compr, uLong comprLen,
+ Byte *uncompr, uLong uncomprLen));
+void test_dict_deflate OF((Byte *compr, uLong comprLen));
+void test_dict_inflate OF((Byte *compr, uLong comprLen,
+ Byte *uncompr, uLong uncomprLen));
+int main OF((int argc, char *argv[]));
+
+/* ===========================================================================
+ * Test compress() and uncompress()
+ */
+void test_compress(compr, comprLen, uncompr, uncomprLen)
+ Byte *compr, *uncompr;
+ uLong comprLen, uncomprLen;
+{
+ int err;
+ uLong len = strlen(hello)+1;
+
+ err = compress(compr, &comprLen, (const Bytef*)hello, len);
+ CHECK_ERR(err, "compress");
+
+ strcpy((char*)uncompr, "garbage");
+
+ err = uncompress(uncompr, &uncomprLen, compr, comprLen);
+ CHECK_ERR(err, "uncompress");
+
+ if (strcmp((char*)uncompr, hello)) {
+ fprintf(stderr, "bad uncompress\n");
+ exit(1);
+ } else {
+ printf("uncompress(): %s\n", (char *)uncompr);
+ }
+}
+
+/* ===========================================================================
+ * Test read/write of .gz files
+ */
+void test_gzio(out, in, uncompr, uncomprLen)
+ const char *out; /* compressed output file */
+ const char *in; /* compressed input file */
+ Byte *uncompr;
+ int uncomprLen;
+{
+ int err;
+ int len = strlen(hello)+1;
+ gzFile file;
+ z_off_t pos;
+
+ file = gzopen(out, "wb");
+ if (file == NULL) {
+ fprintf(stderr, "gzopen error\n");
+ exit(1);
+ }
+ gzputc(file, 'h');
+ if (gzputs(file, "ello") != 4) {
+ fprintf(stderr, "gzputs err: %s\n", gzerror(file, &err));
+ exit(1);
+ }
+ if (gzprintf(file, ", %s!", "hello") != 8) {
+ fprintf(stderr, "gzprintf err: %s\n", gzerror(file, &err));
+ exit(1);
+ }
+ gzseek(file, 1L, SEEK_CUR); /* add one zero byte */
+ gzclose(file);
+
+ file = gzopen(in, "rb");
+ if (file == NULL) {
+ fprintf(stderr, "gzopen error\n");
+ }
+ strcpy((char*)uncompr, "garbage");
+
+ uncomprLen = gzread(file, uncompr, (unsigned)uncomprLen);
+ if (uncomprLen != len) {
+ fprintf(stderr, "gzread err: %s\n", gzerror(file, &err));
+ exit(1);
+ }
+ if (strcmp((char*)uncompr, hello)) {
+ fprintf(stderr, "bad gzread: %s\n", (char*)uncompr);
+ exit(1);
+ } else {
+ printf("gzread(): %s\n", (char *)uncompr);
+ }
+
+ pos = gzseek(file, -8L, SEEK_CUR);
+ if (pos != 6 || gztell(file) != pos) {
+ fprintf(stderr, "gzseek error, pos=%ld, gztell=%ld\n",
+ (long)pos, (long)gztell(file));
+ exit(1);
+ }
+
+ if (gzgetc(file) != ' ') {
+ fprintf(stderr, "gzgetc error\n");
+ exit(1);
+ }
+
+ gzgets(file, (char*)uncompr, uncomprLen);
+ uncomprLen = strlen((char*)uncompr);
+ if (uncomprLen != 6) { /* "hello!" */
+ fprintf(stderr, "gzgets err after gzseek: %s\n", gzerror(file, &err));
+ exit(1);
+ }
+ if (strcmp((char*)uncompr, hello+7)) {
+ fprintf(stderr, "bad gzgets after gzseek\n");
+ exit(1);
+ } else {
+ printf("gzgets() after gzseek: %s\n", (char *)uncompr);
+ }
+
+ gzclose(file);
+}
+
+/* ===========================================================================
+ * Test deflate() with small buffers
+ */
+void test_deflate(compr, comprLen)
+ Byte *compr;
+ uLong comprLen;
+{
+ z_stream c_stream; /* compression stream */
+ int err;
+ int len = strlen(hello)+1;
+
+ c_stream.zalloc = (alloc_func)0;
+ c_stream.zfree = (free_func)0;
+ c_stream.opaque = (voidpf)0;
+
+ err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION);
+ CHECK_ERR(err, "deflateInit");
+
+ c_stream.next_in = (Bytef*)hello;
+ c_stream.next_out = compr;
+
+ while (c_stream.total_in != (uLong)len && c_stream.total_out < comprLen) {
+ c_stream.avail_in = c_stream.avail_out = 1; /* force small buffers */
+ err = deflate(&c_stream, Z_NO_FLUSH);
+ CHECK_ERR(err, "deflate");
+ }
+ /* Finish the stream, still forcing small buffers: */
+ for (;;) {
+ c_stream.avail_out = 1;
+ err = deflate(&c_stream, Z_FINISH);
+ if (err == Z_STREAM_END) break;
+ CHECK_ERR(err, "deflate");
+ }
+
+ err = deflateEnd(&c_stream);
+ CHECK_ERR(err, "deflateEnd");
+}
+
+/* ===========================================================================
+ * Test inflate() with small buffers
+ */
+void test_inflate(compr, comprLen, uncompr, uncomprLen)
+ Byte *compr, *uncompr;
+ uLong comprLen, uncomprLen;
+{
+ int err;
+ z_stream d_stream; /* decompression stream */
+
+ strcpy((char*)uncompr, "garbage");
+
+ d_stream.zalloc = (alloc_func)0;
+ d_stream.zfree = (free_func)0;
+ d_stream.opaque = (voidpf)0;
+
+ d_stream.next_in = compr;
+ d_stream.avail_in = 0;
+ d_stream.next_out = uncompr;
+
+ err = inflateInit(&d_stream);
+ CHECK_ERR(err, "inflateInit");
+
+ while (d_stream.total_out < uncomprLen && d_stream.total_in < comprLen) {
+ d_stream.avail_in = d_stream.avail_out = 1; /* force small buffers */
+ err = inflate(&d_stream, Z_NO_FLUSH);
+ if (err == Z_STREAM_END) break;
+ CHECK_ERR(err, "inflate");
+ }
+
+ err = inflateEnd(&d_stream);
+ CHECK_ERR(err, "inflateEnd");
+
+ if (strcmp((char*)uncompr, hello)) {
+ fprintf(stderr, "bad inflate\n");
+ exit(1);
+ } else {
+ printf("inflate(): %s\n", (char *)uncompr);
+ }
+}
+
+/* ===========================================================================
+ * Test deflate() with large buffers and dynamic change of compression level
+ */
+void test_large_deflate(compr, comprLen, uncompr, uncomprLen)
+ Byte *compr, *uncompr;
+ uLong comprLen, uncomprLen;
+{
+ z_stream c_stream; /* compression stream */
+ int err;
+
+ c_stream.zalloc = (alloc_func)0;
+ c_stream.zfree = (free_func)0;
+ c_stream.opaque = (voidpf)0;
+
+ err = deflateInit(&c_stream, Z_BEST_SPEED);
+ CHECK_ERR(err, "deflateInit");
+
+ c_stream.next_out = compr;
+ c_stream.avail_out = (uInt)comprLen;
+
+ /* At this point, uncompr is still mostly zeroes, so it should compress
+ * very well:
+ */
+ c_stream.next_in = uncompr;
+ c_stream.avail_in = (uInt)uncomprLen;
+ err = deflate(&c_stream, Z_NO_FLUSH);
+ CHECK_ERR(err, "deflate");
+ if (c_stream.avail_in != 0) {
+ fprintf(stderr, "deflate not greedy\n");
+ exit(1);
+ }
+
+ /* Feed in already compressed data and switch to no compression: */
+ deflateParams(&c_stream, Z_NO_COMPRESSION, Z_DEFAULT_STRATEGY);
+ c_stream.next_in = compr;
+ c_stream.avail_in = (uInt)comprLen/2;
+ err = deflate(&c_stream, Z_NO_FLUSH);
+ CHECK_ERR(err, "deflate");
+
+ /* Switch back to compressing mode: */
+ deflateParams(&c_stream, Z_BEST_COMPRESSION, Z_FILTERED);
+ c_stream.next_in = uncompr;
+ c_stream.avail_in = (uInt)uncomprLen;
+ err = deflate(&c_stream, Z_NO_FLUSH);
+ CHECK_ERR(err, "deflate");
+
+ err = deflate(&c_stream, Z_FINISH);
+ if (err != Z_STREAM_END) {
+ fprintf(stderr, "deflate should report Z_STREAM_END\n");
+ exit(1);
+ }
+ err = deflateEnd(&c_stream);
+ CHECK_ERR(err, "deflateEnd");
+}
+
+/* ===========================================================================
+ * Test inflate() with large buffers
+ */
+void test_large_inflate(compr, comprLen, uncompr, uncomprLen)
+ Byte *compr, *uncompr;
+ uLong comprLen, uncomprLen;
+{
+ int err;
+ z_stream d_stream; /* decompression stream */
+
+ strcpy((char*)uncompr, "garbage");
+
+ d_stream.zalloc = (alloc_func)0;
+ d_stream.zfree = (free_func)0;
+ d_stream.opaque = (voidpf)0;
+
+ d_stream.next_in = compr;
+ d_stream.avail_in = (uInt)comprLen;
+
+ err = inflateInit(&d_stream);
+ CHECK_ERR(err, "inflateInit");
+
+ for (;;) {
+ d_stream.next_out = uncompr; /* discard the output */
+ d_stream.avail_out = (uInt)uncomprLen;
+ err = inflate(&d_stream, Z_NO_FLUSH);
+ if (err == Z_STREAM_END) break;
+ CHECK_ERR(err, "large inflate");
+ }
+
+ err = inflateEnd(&d_stream);
+ CHECK_ERR(err, "inflateEnd");
+
+ if (d_stream.total_out != 2*uncomprLen + comprLen/2) {
+ fprintf(stderr, "bad large inflate: %ld\n", d_stream.total_out);
+ exit(1);
+ } else {
+ printf("large_inflate(): OK\n");
+ }
+}
+
+/* ===========================================================================
+ * Test deflate() with full flush
+ */
+void test_flush(compr, comprLen)
+ Byte *compr;
+ uLong *comprLen;
+{
+ z_stream c_stream; /* compression stream */
+ int err;
+ int len = strlen(hello)+1;
+
+ c_stream.zalloc = (alloc_func)0;
+ c_stream.zfree = (free_func)0;
+ c_stream.opaque = (voidpf)0;
+
+ err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION);
+ CHECK_ERR(err, "deflateInit");
+
+ c_stream.next_in = (Bytef*)hello;
+ c_stream.next_out = compr;
+ c_stream.avail_in = 3;
+ c_stream.avail_out = (uInt)*comprLen;
+ err = deflate(&c_stream, Z_FULL_FLUSH);
+ CHECK_ERR(err, "deflate");
+
+ compr[3]++; /* force an error in first compressed block */
+ c_stream.avail_in = len - 3;
+
+ err = deflate(&c_stream, Z_FINISH);
+ if (err != Z_STREAM_END) {
+ CHECK_ERR(err, "deflate");
+ }
+ err = deflateEnd(&c_stream);
+ CHECK_ERR(err, "deflateEnd");
+
+ *comprLen = c_stream.total_out;
+}
+
+/* ===========================================================================
+ * Test inflateSync()
+ */
+void test_sync(compr, comprLen, uncompr, uncomprLen)
+ Byte *compr, *uncompr;
+ uLong comprLen, uncomprLen;
+{
+ int err;
+ z_stream d_stream; /* decompression stream */
+
+ strcpy((char*)uncompr, "garbage");
+
+ d_stream.zalloc = (alloc_func)0;
+ d_stream.zfree = (free_func)0;
+ d_stream.opaque = (voidpf)0;
+
+ d_stream.next_in = compr;
+ d_stream.avail_in = 2; /* just read the zlib header */
+
+ err = inflateInit(&d_stream);
+ CHECK_ERR(err, "inflateInit");
+
+ d_stream.next_out = uncompr;
+ d_stream.avail_out = (uInt)uncomprLen;
+
+ inflate(&d_stream, Z_NO_FLUSH);
+ CHECK_ERR(err, "inflate");
+
+ d_stream.avail_in = (uInt)comprLen-2; /* read all compressed data */
+ err = inflateSync(&d_stream); /* but skip the damaged part */
+ CHECK_ERR(err, "inflateSync");
+
+ err = inflate(&d_stream, Z_FINISH);
+ if (err != Z_DATA_ERROR) {
+ fprintf(stderr, "inflate should report DATA_ERROR\n");
+ /* Because of incorrect adler32 */
+ exit(1);
+ }
+ err = inflateEnd(&d_stream);
+ CHECK_ERR(err, "inflateEnd");
+
+ printf("after inflateSync(): hel%s\n", (char *)uncompr);
+}
+
+/* ===========================================================================
+ * Test deflate() with preset dictionary
+ */
+void test_dict_deflate(compr, comprLen)
+ Byte *compr;
+ uLong comprLen;
+{
+ z_stream c_stream; /* compression stream */
+ int err;
+
+ c_stream.zalloc = (alloc_func)0;
+ c_stream.zfree = (free_func)0;
+ c_stream.opaque = (voidpf)0;
+
+ err = deflateInit(&c_stream, Z_BEST_COMPRESSION);
+ CHECK_ERR(err, "deflateInit");
+
+ err = deflateSetDictionary(&c_stream,
+ (const Bytef*)dictionary, sizeof(dictionary));
+ CHECK_ERR(err, "deflateSetDictionary");
+
+ dictId = c_stream.adler;
+ c_stream.next_out = compr;
+ c_stream.avail_out = (uInt)comprLen;
+
+ c_stream.next_in = (Bytef*)hello;
+ c_stream.avail_in = (uInt)strlen(hello)+1;
+
+ err = deflate(&c_stream, Z_FINISH);
+ if (err != Z_STREAM_END) {
+ fprintf(stderr, "deflate should report Z_STREAM_END\n");
+ exit(1);
+ }
+ err = deflateEnd(&c_stream);
+ CHECK_ERR(err, "deflateEnd");
+}
+
+/* ===========================================================================
+ * Test inflate() with a preset dictionary
+ */
+void test_dict_inflate(compr, comprLen, uncompr, uncomprLen)
+ Byte *compr, *uncompr;
+ uLong comprLen, uncomprLen;
+{
+ int err;
+ z_stream d_stream; /* decompression stream */
+
+ strcpy((char*)uncompr, "garbage");
+
+ d_stream.zalloc = (alloc_func)0;
+ d_stream.zfree = (free_func)0;
+ d_stream.opaque = (voidpf)0;
+
+ d_stream.next_in = compr;
+ d_stream.avail_in = (uInt)comprLen;
+
+ err = inflateInit(&d_stream);
+ CHECK_ERR(err, "inflateInit");
+
+ d_stream.next_out = uncompr;
+ d_stream.avail_out = (uInt)uncomprLen;
+
+ for (;;) {
+ err = inflate(&d_stream, Z_NO_FLUSH);
+ if (err == Z_STREAM_END) break;
+ if (err == Z_NEED_DICT) {
+ if (d_stream.adler != dictId) {
+ fprintf(stderr, "unexpected dictionary");
+ exit(1);
+ }
+ err = inflateSetDictionary(&d_stream, (const Bytef*)dictionary,
+ sizeof(dictionary));
+ }
+ CHECK_ERR(err, "inflate with dict");
+ }
+
+ err = inflateEnd(&d_stream);
+ CHECK_ERR(err, "inflateEnd");
+
+ if (strcmp((char*)uncompr, hello)) {
+ fprintf(stderr, "bad inflate with dict\n");
+ exit(1);
+ } else {
+ printf("inflate with dictionary: %s\n", (char *)uncompr);
+ }
+}
+
+/* ===========================================================================
+ * Usage: example [output.gz [input.gz]]
+ */
+
+int main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ Byte *compr, *uncompr;
+ uLong comprLen = 10000*sizeof(int); /* don't overflow on MSDOS */
+ uLong uncomprLen = comprLen;
+ static const char* myVersion = ZLIB_VERSION;
+
+ if (zlibVersion()[0] != myVersion[0]) {
+ fprintf(stderr, "incompatible zlib version\n");
+ exit(1);
+
+ } else if (strcmp(zlibVersion(), ZLIB_VERSION) != 0) {
+ fprintf(stderr, "warning: different zlib version\n");
+ }
+
+ compr = (Byte*)calloc((uInt)comprLen, 1);
+ uncompr = (Byte*)calloc((uInt)uncomprLen, 1);
+ /* compr and uncompr are cleared to avoid reading uninitialized
+ * data and to ensure that uncompr compresses well.
+ */
+ if (compr == Z_NULL || uncompr == Z_NULL) {
+ printf("out of memory\n");
+ exit(1);
+ }
+ test_compress(compr, comprLen, uncompr, uncomprLen);
+
+ test_gzio((argc > 1 ? argv[1] : TESTFILE),
+ (argc > 2 ? argv[2] : TESTFILE),
+ uncompr, (int)uncomprLen);
+
+ test_deflate(compr, comprLen);
+ test_inflate(compr, comprLen, uncompr, uncomprLen);
+
+ test_large_deflate(compr, comprLen, uncompr, uncomprLen);
+ test_large_inflate(compr, comprLen, uncompr, uncomprLen);
+
+ test_flush(compr, &comprLen);
+ test_sync(compr, comprLen, uncompr, uncomprLen);
+ comprLen = uncomprLen;
+
+ test_dict_deflate(compr, comprLen);
+ test_dict_inflate(compr, comprLen, uncompr, uncomprLen);
+
+ exit(0);
+ return 0; /* to avoid warning */
+}
diff --git a/cfe/cfe/zlib/gzio.c b/cfe/cfe/zlib/gzio.c
new file mode 100644
index 0000000..6dfd489
--- /dev/null
+++ b/cfe/cfe/zlib/gzio.c
@@ -0,0 +1,875 @@
+/* gzio.c -- IO on .gz files
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ *
+ * Compile this file with -DNO_DEFLATE to avoid the compression code.
+ */
+
+/* @(#) $Id: gzio.c,v 1.1 2001/11/09 01:48:02 mpl Exp $ */
+
+#include <stdio.h>
+
+#include "zutil.h"
+
+struct internal_state {int dummy;}; /* for buggy compilers */
+
+#ifndef Z_BUFSIZE
+# ifdef MAXSEG_64K
+# define Z_BUFSIZE 4096 /* minimize memory usage for 16-bit DOS */
+# else
+# define Z_BUFSIZE 16384
+# endif
+#endif
+#ifndef Z_PRINTF_BUFSIZE
+# define Z_PRINTF_BUFSIZE 4096
+#endif
+
+#define ALLOC(size) malloc(size)
+#define TRYFREE(p) {if (p) free(p);}
+
+static int gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
+
+/* gzip flag byte */
+#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */
+#define HEAD_CRC 0x02 /* bit 1 set: header CRC present */
+#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
+#define ORIG_NAME 0x08 /* bit 3 set: original file name present */
+#define COMMENT 0x10 /* bit 4 set: file comment present */
+#define RESERVED 0xE0 /* bits 5..7: reserved */
+
+typedef struct gz_stream {
+ z_stream stream;
+ int z_err; /* error code for last stream operation */
+ int z_eof; /* set if end of input file */
+ FILE *file; /* .gz file */
+ Byte *inbuf; /* input buffer */
+ Byte *outbuf; /* output buffer */
+ uLong crc; /* crc32 of uncompressed data */
+ char *msg; /* error message */
+ char *path; /* path name for debugging only */
+ int transparent; /* 1 if input file is not a .gz file */
+ char mode; /* 'w' or 'r' */
+ long startpos; /* start of compressed data in file (header skipped) */
+} gz_stream;
+
+
+local gzFile gz_open OF((const char *path, const char *mode, int fd));
+local int do_flush OF((gzFile file, int flush));
+local int get_byte OF((gz_stream *s));
+local void check_header OF((gz_stream *s));
+local int destroy OF((gz_stream *s));
+local void putLong OF((FILE *file, uLong x));
+local uLong getLong OF((gz_stream *s));
+
+/* ===========================================================================
+ Opens a gzip (.gz) file for reading or writing. The mode parameter
+ is as in fopen ("rb" or "wb"). The file is given either by file descriptor
+ or path name (if fd == -1).
+ gz_open return NULL if the file could not be opened or if there was
+ insufficient memory to allocate the (de)compression state; errno
+ can be checked to distinguish the two cases (if errno is zero, the
+ zlib error is Z_MEM_ERROR).
+*/
+local gzFile gz_open (path, mode, fd)
+ const char *path;
+ const char *mode;
+ int fd;
+{
+ int err;
+ int level = Z_DEFAULT_COMPRESSION; /* compression level */
+ int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */
+ char *p = (char*)mode;
+ gz_stream *s;
+ char fmode[80]; /* copy of mode, without the compression level */
+ char *m = fmode;
+
+ if (!path || !mode) return Z_NULL;
+
+ s = (gz_stream *)ALLOC(sizeof(gz_stream));
+ if (!s) return Z_NULL;
+
+ s->stream.zalloc = (alloc_func)0;
+ s->stream.zfree = (free_func)0;
+ s->stream.opaque = (voidpf)0;
+ s->stream.next_in = s->inbuf = Z_NULL;
+ s->stream.next_out = s->outbuf = Z_NULL;
+ s->stream.avail_in = s->stream.avail_out = 0;
+ s->file = NULL;
+ s->z_err = Z_OK;
+ s->z_eof = 0;
+ s->crc = crc32(0L, Z_NULL, 0);
+ s->msg = NULL;
+ s->transparent = 0;
+
+ s->path = (char*)ALLOC(strlen(path)+1);
+ if (s->path == NULL) {
+ return destroy(s), (gzFile)Z_NULL;
+ }
+ strcpy(s->path, path); /* do this early for debugging */
+
+ s->mode = '\0';
+ do {
+ if (*p == 'r') s->mode = 'r';
+ if (*p == 'w' || *p == 'a') s->mode = 'w';
+ if (*p >= '0' && *p <= '9') {
+ level = *p - '0';
+ } else if (*p == 'f') {
+ strategy = Z_FILTERED;
+ } else if (*p == 'h') {
+ strategy = Z_HUFFMAN_ONLY;
+ } else {
+ *m++ = *p; /* copy the mode */
+ }
+ } while (*p++ && m != fmode + sizeof(fmode));
+ if (s->mode == '\0') return destroy(s), (gzFile)Z_NULL;
+
+ if (s->mode == 'w') {
+#ifdef NO_DEFLATE
+ err = Z_STREAM_ERROR;
+#else
+ err = deflateInit2(&(s->stream), level,
+ Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy);
+ /* windowBits is passed < 0 to suppress zlib header */
+
+ s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
+#endif
+ if (err != Z_OK || s->outbuf == Z_NULL) {
+ return destroy(s), (gzFile)Z_NULL;
+ }
+ } else {
+ s->stream.next_in = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE);
+
+ err = inflateInit2(&(s->stream), -MAX_WBITS);
+ /* windowBits is passed < 0 to tell that there is no zlib header.
+ * Note that in this case inflate *requires* an extra "dummy" byte
+ * after the compressed stream in order to complete decompression and
+ * return Z_STREAM_END. Here the gzip CRC32 ensures that 4 bytes are
+ * present after the compressed stream.
+ */
+ if (err != Z_OK || s->inbuf == Z_NULL) {
+ return destroy(s), (gzFile)Z_NULL;
+ }
+ }
+ s->stream.avail_out = Z_BUFSIZE;
+
+ errno = 0;
+ s->file = fd < 0 ? F_OPEN(path, fmode) : (FILE*)fdopen(fd, fmode);
+
+ if (s->file == NULL) {
+ return destroy(s), (gzFile)Z_NULL;
+ }
+ if (s->mode == 'w') {
+ /* Write a very simple .gz header:
+ */
+ fprintf(s->file, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1],
+ Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/, OS_CODE);
+ s->startpos = 10L;
+ /* We use 10L instead of ftell(s->file) to because ftell causes an
+ * fflush on some systems. This version of the library doesn't use
+ * startpos anyway in write mode, so this initialization is not
+ * necessary.
+ */
+ } else {
+ check_header(s); /* skip the .gz header */
+ s->startpos = (ftell(s->file) - s->stream.avail_in);
+ }
+
+ return (gzFile)s;
+}
+
+/* ===========================================================================
+ Opens a gzip (.gz) file for reading or writing.
+*/
+gzFile ZEXPORT gzopen (path, mode)
+ const char *path;
+ const char *mode;
+{
+ return gz_open (path, mode, -1);
+}
+
+/* ===========================================================================
+ Associate a gzFile with the file descriptor fd. fd is not dup'ed here
+ to mimic the behavio(u)r of fdopen.
+*/
+gzFile ZEXPORT gzdopen (fd, mode)
+ int fd;
+ const char *mode;
+{
+ char name[20];
+
+ if (fd < 0) return (gzFile)Z_NULL;
+ sprintf(name, "<fd:%d>", fd); /* for debugging */
+
+ return gz_open (name, mode, fd);
+}
+
+/* ===========================================================================
+ * Update the compression level and strategy
+ */
+int ZEXPORT gzsetparams (file, level, strategy)
+ gzFile file;
+ int level;
+ int strategy;
+{
+ gz_stream *s = (gz_stream*)file;
+
+ if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
+
+ /* Make room to allow flushing */
+ if (s->stream.avail_out == 0) {
+
+ s->stream.next_out = s->outbuf;
+ if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {
+ s->z_err = Z_ERRNO;
+ }
+ s->stream.avail_out = Z_BUFSIZE;
+ }
+
+ return deflateParams (&(s->stream), level, strategy);
+}
+
+/* ===========================================================================
+ Read a byte from a gz_stream; update next_in and avail_in. Return EOF
+ for end of file.
+ IN assertion: the stream s has been sucessfully opened for reading.
+*/
+local int get_byte(s)
+ gz_stream *s;
+{
+ if (s->z_eof) return EOF;
+ if (s->stream.avail_in == 0) {
+ errno = 0;
+ s->stream.avail_in = fread(s->inbuf, 1, Z_BUFSIZE, s->file);
+ if (s->stream.avail_in == 0) {
+ s->z_eof = 1;
+ if (ferror(s->file)) s->z_err = Z_ERRNO;
+ return EOF;
+ }
+ s->stream.next_in = s->inbuf;
+ }
+ s->stream.avail_in--;
+ return *(s->stream.next_in)++;
+}
+
+/* ===========================================================================
+ Check the gzip header of a gz_stream opened for reading. Set the stream
+ mode to transparent if the gzip magic header is not present; set s->err
+ to Z_DATA_ERROR if the magic header is present but the rest of the header
+ is incorrect.
+ IN assertion: the stream s has already been created sucessfully;
+ s->stream.avail_in is zero for the first time, but may be non-zero
+ for concatenated .gz files.
+*/
+local void check_header(s)
+ gz_stream *s;
+{
+ int method; /* method byte */
+ int flags; /* flags byte */
+ uInt len;
+ int c;
+
+ /* Check the gzip magic header */
+ for (len = 0; len < 2; len++) {
+ c = get_byte(s);
+ if (c != gz_magic[len]) {
+ if (len != 0) s->stream.avail_in++, s->stream.next_in--;
+ if (c != EOF) {
+ s->stream.avail_in++, s->stream.next_in--;
+ s->transparent = 1;
+ }
+ s->z_err = s->stream.avail_in != 0 ? Z_OK : Z_STREAM_END;
+ return;
+ }
+ }
+ method = get_byte(s);
+ flags = get_byte(s);
+ if (method != Z_DEFLATED || (flags & RESERVED) != 0) {
+ s->z_err = Z_DATA_ERROR;
+ return;
+ }
+
+ /* Discard time, xflags and OS code: */
+ for (len = 0; len < 6; len++) (void)get_byte(s);
+
+ if ((flags & EXTRA_FIELD) != 0) { /* skip the extra field */
+ len = (uInt)get_byte(s);
+ len += ((uInt)get_byte(s))<<8;
+ /* len is garbage if EOF but the loop below will quit anyway */
+ while (len-- != 0 && get_byte(s) != EOF) ;
+ }
+ if ((flags & ORIG_NAME) != 0) { /* skip the original file name */
+ while ((c = get_byte(s)) != 0 && c != EOF) ;
+ }
+ if ((flags & COMMENT) != 0) { /* skip the .gz file comment */
+ while ((c = get_byte(s)) != 0 && c != EOF) ;
+ }
+ if ((flags & HEAD_CRC) != 0) { /* skip the header crc */
+ for (len = 0; len < 2; len++) (void)get_byte(s);
+ }
+ s->z_err = s->z_eof ? Z_DATA_ERROR : Z_OK;
+}
+
+ /* ===========================================================================
+ * Cleanup then free the given gz_stream. Return a zlib error code.
+ Try freeing in the reverse order of allocations.
+ */
+local int destroy (s)
+ gz_stream *s;
+{
+ int err = Z_OK;
+
+ if (!s) return Z_STREAM_ERROR;
+
+ TRYFREE(s->msg);
+
+ if (s->stream.state != NULL) {
+ if (s->mode == 'w') {
+#ifdef NO_DEFLATE
+ err = Z_STREAM_ERROR;
+#else
+ err = deflateEnd(&(s->stream));
+#endif
+ } else if (s->mode == 'r') {
+ err = inflateEnd(&(s->stream));
+ }
+ }
+ if (s->file != NULL && fclose(s->file)) {
+#ifdef ESPIPE
+ if (errno != ESPIPE) /* fclose is broken for pipes in HP/UX */
+#endif
+ err = Z_ERRNO;
+ }
+ if (s->z_err < 0) err = s->z_err;
+
+ TRYFREE(s->inbuf);
+ TRYFREE(s->outbuf);
+ TRYFREE(s->path);
+ TRYFREE(s);
+ return err;
+}
+
+/* ===========================================================================
+ Reads the given number of uncompressed bytes from the compressed file.
+ gzread returns the number of bytes actually read (0 for end of file).
+*/
+int ZEXPORT gzread (file, buf, len)
+ gzFile file;
+ voidp buf;
+ unsigned len;
+{
+ gz_stream *s = (gz_stream*)file;
+ Bytef *start = (Bytef*)buf; /* starting point for crc computation */
+ Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */
+
+ if (s == NULL || s->mode != 'r') return Z_STREAM_ERROR;
+
+ if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO) return -1;
+ if (s->z_err == Z_STREAM_END) return 0; /* EOF */
+
+ next_out = (Byte*)buf;
+ s->stream.next_out = (Bytef*)buf;
+ s->stream.avail_out = len;
+
+ while (s->stream.avail_out != 0) {
+
+ if (s->transparent) {
+ /* Copy first the lookahead bytes: */
+ uInt n = s->stream.avail_in;
+ if (n > s->stream.avail_out) n = s->stream.avail_out;
+ if (n > 0) {
+ zmemcpy(s->stream.next_out, s->stream.next_in, n);
+ next_out += n;
+ s->stream.next_out = next_out;
+ s->stream.next_in += n;
+ s->stream.avail_out -= n;
+ s->stream.avail_in -= n;
+ }
+ if (s->stream.avail_out > 0) {
+ s->stream.avail_out -= fread(next_out, 1, s->stream.avail_out,
+ s->file);
+ }
+ len -= s->stream.avail_out;
+ s->stream.total_in += (uLong)len;
+ s->stream.total_out += (uLong)len;
+ if (len == 0) s->z_eof = 1;
+ return (int)len;
+ }
+ if (s->stream.avail_in == 0 && !s->z_eof) {
+
+ errno = 0;
+ s->stream.avail_in = fread(s->inbuf, 1, Z_BUFSIZE, s->file);
+ if (s->stream.avail_in == 0) {
+ s->z_eof = 1;
+ if (ferror(s->file)) {
+ s->z_err = Z_ERRNO;
+ break;
+ }
+ }
+ s->stream.next_in = s->inbuf;
+ }
+ s->z_err = inflate(&(s->stream), Z_NO_FLUSH);
+
+ if (s->z_err == Z_STREAM_END) {
+ /* Check CRC and original size */
+ s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
+ start = s->stream.next_out;
+
+ if (getLong(s) != s->crc) {
+ s->z_err = Z_DATA_ERROR;
+ } else {
+ (void)getLong(s);
+ /* The uncompressed length returned by above getlong() may
+ * be different from s->stream.total_out) in case of
+ * concatenated .gz files. Check for such files:
+ */
+ check_header(s);
+ if (s->z_err == Z_OK) {
+ uLong total_in = s->stream.total_in;
+ uLong total_out = s->stream.total_out;
+
+ inflateReset(&(s->stream));
+ s->stream.total_in = total_in;
+ s->stream.total_out = total_out;
+ s->crc = crc32(0L, Z_NULL, 0);
+ }
+ }
+ }
+ if (s->z_err != Z_OK || s->z_eof) break;
+ }
+ s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
+
+ return (int)(len - s->stream.avail_out);
+}
+
+
+/* ===========================================================================
+ Reads one byte from the compressed file. gzgetc returns this byte
+ or -1 in case of end of file or error.
+*/
+int ZEXPORT gzgetc(file)
+ gzFile file;
+{
+ unsigned char c;
+
+ return gzread(file, &c, 1) == 1 ? c : -1;
+}
+
+
+/* ===========================================================================
+ Reads bytes from the compressed file until len-1 characters are
+ read, or a newline character is read and transferred to buf, or an
+ end-of-file condition is encountered. The string is then terminated
+ with a null character.
+ gzgets returns buf, or Z_NULL in case of error.
+
+ The current implementation is not optimized at all.
+*/
+char * ZEXPORT gzgets(file, buf, len)
+ gzFile file;
+ char *buf;
+ int len;
+{
+ char *b = buf;
+ if (buf == Z_NULL || len <= 0) return Z_NULL;
+
+ while (--len > 0 && gzread(file, buf, 1) == 1 && *buf++ != '\n') ;
+ *buf = '\0';
+ return b == buf && len > 0 ? Z_NULL : b;
+}
+
+
+#ifndef NO_DEFLATE
+/* ===========================================================================
+ Writes the given number of uncompressed bytes into the compressed file.
+ gzwrite returns the number of bytes actually written (0 in case of error).
+*/
+int ZEXPORT gzwrite (file, buf, len)
+ gzFile file;
+ const voidp buf;
+ unsigned len;
+{
+ gz_stream *s = (gz_stream*)file;
+
+ if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
+
+ s->stream.next_in = (Bytef*)buf;
+ s->stream.avail_in = len;
+
+ while (s->stream.avail_in != 0) {
+
+ if (s->stream.avail_out == 0) {
+
+ s->stream.next_out = s->outbuf;
+ if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {
+ s->z_err = Z_ERRNO;
+ break;
+ }
+ s->stream.avail_out = Z_BUFSIZE;
+ }
+ s->z_err = deflate(&(s->stream), Z_NO_FLUSH);
+ if (s->z_err != Z_OK) break;
+ }
+ s->crc = crc32(s->crc, (const Bytef *)buf, len);
+
+ return (int)(len - s->stream.avail_in);
+}
+
+/* ===========================================================================
+ Converts, formats, and writes the args to the compressed file under
+ control of the format string, as in fprintf. gzprintf returns the number of
+ uncompressed bytes actually written (0 in case of error).
+*/
+#ifdef STDC
+#include <stdarg.h>
+
+int ZEXPORTVA gzprintf (gzFile file, const char *format, /* args */ ...)
+{
+ char buf[Z_PRINTF_BUFSIZE];
+ va_list va;
+ int len;
+
+ va_start(va, format);
+#ifdef HAS_vsnprintf
+ (void)vsnprintf(buf, sizeof(buf), format, va);
+#else
+ (void)vsprintf(buf, format, va);
+#endif
+ va_end(va);
+ len = strlen(buf); /* some *sprintf don't return the nb of bytes written */
+ if (len <= 0) return 0;
+
+ return gzwrite(file, buf, (unsigned)len);
+}
+#else /* not ANSI C */
+
+int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
+ a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
+ gzFile file;
+ const char *format;
+ int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
+ a11, a12, a13, a14, a15, a16, a17, a18, a19, a20;
+{
+ char buf[Z_PRINTF_BUFSIZE];
+ int len;
+
+#ifdef HAS_snprintf
+ snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8,
+ a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
+#else
+ sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8,
+ a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
+#endif
+ len = strlen(buf); /* old sprintf doesn't return the nb of bytes written */
+ if (len <= 0) return 0;
+
+ return gzwrite(file, buf, len);
+}
+#endif
+
+/* ===========================================================================
+ Writes c, converted to an unsigned char, into the compressed file.
+ gzputc returns the value that was written, or -1 in case of error.
+*/
+int ZEXPORT gzputc(file, c)
+ gzFile file;
+ int c;
+{
+ unsigned char cc = (unsigned char) c; /* required for big endian systems */
+
+ return gzwrite(file, &cc, 1) == 1 ? (int)cc : -1;
+}
+
+
+/* ===========================================================================
+ Writes the given null-terminated string to the compressed file, excluding
+ the terminating null character.
+ gzputs returns the number of characters written, or -1 in case of error.
+*/
+int ZEXPORT gzputs(file, s)
+ gzFile file;
+ const char *s;
+{
+ return gzwrite(file, (char*)s, (unsigned)strlen(s));
+}
+
+
+/* ===========================================================================
+ Flushes all pending output into the compressed file. The parameter
+ flush is as in the deflate() function.
+*/
+local int do_flush (file, flush)
+ gzFile file;
+ int flush;
+{
+ uInt len;
+ int done = 0;
+ gz_stream *s = (gz_stream*)file;
+
+ if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
+
+ s->stream.avail_in = 0; /* should be zero already anyway */
+
+ for (;;) {
+ len = Z_BUFSIZE - s->stream.avail_out;
+
+ if (len != 0) {
+ if ((uInt)fwrite(s->outbuf, 1, len, s->file) != len) {
+ s->z_err = Z_ERRNO;
+ return Z_ERRNO;
+ }
+ s->stream.next_out = s->outbuf;
+ s->stream.avail_out = Z_BUFSIZE;
+ }
+ if (done) break;
+ s->z_err = deflate(&(s->stream), flush);
+
+ /* Ignore the second of two consecutive flushes: */
+ if (len == 0 && s->z_err == Z_BUF_ERROR) s->z_err = Z_OK;
+
+ /* deflate has finished flushing only when it hasn't used up
+ * all the available space in the output buffer:
+ */
+ done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END);
+
+ if (s->z_err != Z_OK && s->z_err != Z_STREAM_END) break;
+ }
+ return s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
+}
+
+int ZEXPORT gzflush (file, flush)
+ gzFile file;
+ int flush;
+{
+ gz_stream *s = (gz_stream*)file;
+ int err = do_flush (file, flush);
+
+ if (err) return err;
+ fflush(s->file);
+ return s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
+}
+#endif /* NO_DEFLATE */
+
+/* ===========================================================================
+ Sets the starting position for the next gzread or gzwrite on the given
+ compressed file. The offset represents a number of bytes in the
+ gzseek returns the resulting offset location as measured in bytes from
+ the beginning of the uncompressed stream, or -1 in case of error.
+ SEEK_END is not implemented, returns error.
+ In this version of the library, gzseek can be extremely slow.
+*/
+z_off_t ZEXPORT gzseek (file, offset, whence)
+ gzFile file;
+ z_off_t offset;
+ int whence;
+{
+ gz_stream *s = (gz_stream*)file;
+
+ if (s == NULL || whence == SEEK_END ||
+ s->z_err == Z_ERRNO || s->z_err == Z_DATA_ERROR) {
+ return -1L;
+ }
+
+ if (s->mode == 'w') {
+#ifdef NO_DEFLATE
+ return -1L;
+#else
+ if (whence == SEEK_SET) {
+ offset -= s->stream.total_in;
+ }
+ if (offset < 0) return -1L;
+
+ /* At this point, offset is the number of zero bytes to write. */
+ if (s->inbuf == Z_NULL) {
+ s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); /* for seeking */
+ zmemzero(s->inbuf, Z_BUFSIZE);
+ }
+ while (offset > 0) {
+ uInt size = Z_BUFSIZE;
+ if (offset < Z_BUFSIZE) size = (uInt)offset;
+
+ size = gzwrite(file, s->inbuf, size);
+ if (size == 0) return -1L;
+
+ offset -= size;
+ }
+ return (z_off_t)s->stream.total_in;
+#endif
+ }
+ /* Rest of function is for reading only */
+
+ /* compute absolute position */
+ if (whence == SEEK_CUR) {
+ offset += s->stream.total_out;
+ }
+ if (offset < 0) return -1L;
+
+ if (s->transparent) {
+ /* map to fseek */
+ s->stream.avail_in = 0;
+ s->stream.next_in = s->inbuf;
+ if (fseek(s->file, offset, SEEK_SET) < 0) return -1L;
+
+ s->stream.total_in = s->stream.total_out = (uLong)offset;
+ return offset;
+ }
+
+ /* For a negative seek, rewind and use positive seek */
+ if ((uLong)offset >= s->stream.total_out) {
+ offset -= s->stream.total_out;
+ } else if (gzrewind(file) < 0) {
+ return -1L;
+ }
+ /* offset is now the number of bytes to skip. */
+
+ if (offset != 0 && s->outbuf == Z_NULL) {
+ s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
+ }
+ while (offset > 0) {
+ int size = Z_BUFSIZE;
+ if (offset < Z_BUFSIZE) size = (int)offset;
+
+ size = gzread(file, s->outbuf, (uInt)size);
+ if (size <= 0) return -1L;
+ offset -= size;
+ }
+ return (z_off_t)s->stream.total_out;
+}
+
+/* ===========================================================================
+ Rewinds input file.
+*/
+int ZEXPORT gzrewind (file)
+ gzFile file;
+{
+ gz_stream *s = (gz_stream*)file;
+
+ if (s == NULL || s->mode != 'r') return -1;
+
+ s->z_err = Z_OK;
+ s->z_eof = 0;
+ s->stream.avail_in = 0;
+ s->stream.next_in = s->inbuf;
+ s->crc = crc32(0L, Z_NULL, 0);
+
+ if (s->startpos == 0) { /* not a compressed file */
+ rewind(s->file);
+ return 0;
+ }
+
+ (void) inflateReset(&s->stream);
+ return fseek(s->file, s->startpos, SEEK_SET);
+}
+
+/* ===========================================================================
+ Returns the starting position for the next gzread or gzwrite on the
+ given compressed file. This position represents a number of bytes in the
+ uncompressed data stream.
+*/
+z_off_t ZEXPORT gztell (file)
+ gzFile file;
+{
+ return gzseek(file, 0L, SEEK_CUR);
+}
+
+/* ===========================================================================
+ Returns 1 when EOF has previously been detected reading the given
+ input stream, otherwise zero.
+*/
+int ZEXPORT gzeof (file)
+ gzFile file;
+{
+ gz_stream *s = (gz_stream*)file;
+
+ return (s == NULL || s->mode != 'r') ? 0 : s->z_eof;
+}
+
+/* ===========================================================================
+ Outputs a long in LSB order to the given file
+*/
+local void putLong (file, x)
+ FILE *file;
+ uLong x;
+{
+ int n;
+ for (n = 0; n < 4; n++) {
+ fputc((int)(x & 0xff), file);
+ x >>= 8;
+ }
+}
+
+/* ===========================================================================
+ Reads a long in LSB order from the given gz_stream. Sets z_err in case
+ of error.
+*/
+local uLong getLong (s)
+ gz_stream *s;
+{
+ uLong x = (uLong)get_byte(s);
+ int c;
+
+ x += ((uLong)get_byte(s))<<8;
+ x += ((uLong)get_byte(s))<<16;
+ c = get_byte(s);
+ if (c == EOF) s->z_err = Z_DATA_ERROR;
+ x += ((uLong)c)<<24;
+ return x;
+}
+
+/* ===========================================================================
+ Flushes all pending output if necessary, closes the compressed file
+ and deallocates all the (de)compression state.
+*/
+int ZEXPORT gzclose (file)
+ gzFile file;
+{
+ int err;
+ gz_stream *s = (gz_stream*)file;
+
+ if (s == NULL) return Z_STREAM_ERROR;
+
+ if (s->mode == 'w') {
+#ifdef NO_DEFLATE
+ return Z_STREAM_ERROR;
+#else
+ err = do_flush (file, Z_FINISH);
+ if (err != Z_OK) return destroy((gz_stream*)file);
+
+ putLong (s->file, s->crc);
+ putLong (s->file, s->stream.total_in);
+#endif
+ }
+ return destroy((gz_stream*)file);
+}
+
+/* ===========================================================================
+ Returns the error message for the last error which occured on the
+ given compressed file. errnum is set to zlib error number. If an
+ error occured in the file system and not in the compression library,
+ errnum is set to Z_ERRNO and the application may consult errno
+ to get the exact error code.
+*/
+const char* ZEXPORT gzerror (file, errnum)
+ gzFile file;
+ int *errnum;
+{
+ char *m;
+ gz_stream *s = (gz_stream*)file;
+
+ if (s == NULL) {
+ *errnum = Z_STREAM_ERROR;
+ return (const char*)ERR_MSG(Z_STREAM_ERROR);
+ }
+ *errnum = s->z_err;
+ if (*errnum == Z_OK) return (const char*)"";
+
+ m = (char*)(*errnum == Z_ERRNO ? zstrerror(errno) : s->stream.msg);
+
+ if (m == NULL || *m == '\0') m = (char*)ERR_MSG(s->z_err);
+
+ TRYFREE(s->msg);
+ s->msg = (char*)ALLOC(strlen(s->path) + strlen(m) + 3);
+ strcpy(s->msg, s->path);
+ strcat(s->msg, ": ");
+ strcat(s->msg, m);
+ return (const char*)s->msg;
+}
diff --git a/cfe/cfe/zlib/infblock.c b/cfe/cfe/zlib/infblock.c
new file mode 100644
index 0000000..f4920fa
--- /dev/null
+++ b/cfe/cfe/zlib/infblock.c
@@ -0,0 +1,398 @@
+/* infblock.c -- interpret and process block types to last block
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "infblock.h"
+#include "inftrees.h"
+#include "infcodes.h"
+#include "infutil.h"
+
+struct inflate_codes_state {int dummy;}; /* for buggy compilers */
+
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+/* Table for deflate from PKZIP's appnote.txt. */
+local const uInt border[] = { /* Order of the bit length code lengths */
+ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+
+/*
+ Notes beyond the 1.93a appnote.txt:
+
+ 1. Distance pointers never point before the beginning of the output
+ stream.
+ 2. Distance pointers can point back across blocks, up to 32k away.
+ 3. There is an implied maximum of 7 bits for the bit length table and
+ 15 bits for the actual data.
+ 4. If only one code exists, then it is encoded using one bit. (Zero
+ would be more efficient, but perhaps a little confusing.) If two
+ codes exist, they are coded using one bit each (0 and 1).
+ 5. There is no way of sending zero distance codes--a dummy must be
+ sent if there are none. (History: a pre 2.0 version of PKZIP would
+ store blocks with no distance codes, but this was discovered to be
+ too harsh a criterion.) Valid only for 1.93a. 2.04c does allow
+ zero distance codes, which is sent as one code of zero bits in
+ length.
+ 6. There are up to 286 literal/length codes. Code 256 represents the
+ end-of-block. Note however that the static length tree defines
+ 288 codes just to fill out the Huffman codes. Codes 286 and 287
+ cannot be used though, since there is no length base or extra bits
+ defined for them. Similarily, there are up to 30 distance codes.
+ However, static trees define 32 codes (all 5 bits) to fill out the
+ Huffman codes, but the last two had better not show up in the data.
+ 7. Unzip can check dynamic Huffman blocks for complete code sets.
+ The exception is that a single code would not be complete (see #4).
+ 8. The five bits following the block type is really the number of
+ literal codes sent minus 257.
+ 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits
+ (1+6+6). Therefore, to output three times the length, you output
+ three codes (1+1+1), whereas to output four times the same length,
+ you only need two codes (1+3). Hmm.
+ 10. In the tree reconstruction algorithm, Code = Code + Increment
+ only if BitLength(i) is not zero. (Pretty obvious.)
+ 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19)
+ 12. Note: length code 284 can represent 227-258, but length code 285
+ really is 258. The last length deserves its own, short code
+ since it gets used a lot in very redundant files. The length
+ 258 is special since 258 - 3 (the min match length) is 255.
+ 13. The literal/length and distance code bit lengths are read as a
+ single stream of lengths. It is possible (and advantageous) for
+ a repeat code (16, 17, or 18) to go across the boundary between
+ the two sets of lengths.
+ */
+
+
+void inflate_blocks_reset(s, z, c)
+inflate_blocks_statef *s;
+z_streamp z;
+uLongf *c;
+{
+ if (c != Z_NULL)
+ *c = s->check;
+ if (s->mode == BTREE || s->mode == DTREE)
+ ZFREE(z, s->sub.trees.blens);
+ if (s->mode == CODES)
+ inflate_codes_free(s->sub.decode.codes, z);
+ s->mode = TYPE;
+ s->bitk = 0;
+ s->bitb = 0;
+ s->read = s->write = s->window;
+ if (s->checkfn != Z_NULL)
+ z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0);
+ Tracev((stderr, "inflate: blocks reset\n"));
+}
+
+
+inflate_blocks_statef *inflate_blocks_new(z, c, w)
+z_streamp z;
+check_func c;
+uInt w;
+{
+ inflate_blocks_statef *s;
+
+ if ((s = (inflate_blocks_statef *)ZALLOC
+ (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL)
+ return s;
+ if ((s->hufts =
+ (inflate_huft *)ZALLOC(z, sizeof(inflate_huft), MANY)) == Z_NULL)
+ {
+ ZFREE(z, s);
+ return Z_NULL;
+ }
+ if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL)
+ {
+ ZFREE(z, s->hufts);
+ ZFREE(z, s);
+ return Z_NULL;
+ }
+ s->end = s->window + w;
+ s->checkfn = c;
+ s->mode = TYPE;
+ Tracev((stderr, "inflate: blocks allocated\n"));
+ inflate_blocks_reset(s, z, Z_NULL);
+ return s;
+}
+
+
+int inflate_blocks(s, z, r)
+inflate_blocks_statef *s;
+z_streamp z;
+int r;
+{
+ uInt t; /* temporary storage */
+ uLong b; /* bit buffer */
+ uInt k; /* bits in bit buffer */
+ Bytef *p; /* input data pointer */
+ uInt n; /* bytes available there */
+ Bytef *q; /* output window write pointer */
+ uInt m; /* bytes to end of window or read pointer */
+
+ /* copy input/output information to locals (UPDATE macro restores) */
+ LOAD
+
+ /* process input based on current state */
+ while (1) switch (s->mode)
+ {
+ case TYPE:
+ NEEDBITS(3)
+ t = (uInt)b & 7;
+ s->last = t & 1;
+ switch (t >> 1)
+ {
+ case 0: /* stored */
+ Tracev((stderr, "inflate: stored block%s\n",
+ s->last ? " (last)" : ""));
+ DUMPBITS(3)
+ t = k & 7; /* go to byte boundary */
+ DUMPBITS(t)
+ s->mode = LENS; /* get length of stored block */
+ break;
+ case 1: /* fixed */
+ Tracev((stderr, "inflate: fixed codes block%s\n",
+ s->last ? " (last)" : ""));
+ {
+ uInt bl, bd;
+ inflate_huft *tl, *td;
+
+ inflate_trees_fixed(&bl, &bd, &tl, &td, z);
+ s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z);
+ if (s->sub.decode.codes == Z_NULL)
+ {
+ r = Z_MEM_ERROR;
+ LEAVE
+ }
+ }
+ DUMPBITS(3)
+ s->mode = CODES;
+ break;
+ case 2: /* dynamic */
+ Tracev((stderr, "inflate: dynamic codes block%s\n",
+ s->last ? " (last)" : ""));
+ DUMPBITS(3)
+ s->mode = TABLE;
+ break;
+ case 3: /* illegal */
+ DUMPBITS(3)
+ s->mode = BAD;
+ z->msg = (char*)"invalid block type";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+ break;
+ case LENS:
+ NEEDBITS(32)
+ if ((((~b) >> 16) & 0xffff) != (b & 0xffff))
+ {
+ s->mode = BAD;
+ z->msg = (char*)"invalid stored block lengths";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+ s->sub.left = (uInt)b & 0xffff;
+ b = k = 0; /* dump bits */
+ Tracev((stderr, "inflate: stored length %u\n", s->sub.left));
+ s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE);
+ break;
+ case STORED:
+ if (n == 0)
+ LEAVE
+ NEEDOUT
+ t = s->sub.left;
+ if (t > n) t = n;
+ if (t > m) t = m;
+ zmemcpy(q, p, t);
+ p += t; n -= t;
+ q += t; m -= t;
+ if ((s->sub.left -= t) != 0)
+ break;
+ Tracev((stderr, "inflate: stored end, %lu total out\n",
+ z->total_out + (q >= s->read ? q - s->read :
+ (s->end - s->read) + (q - s->window))));
+ s->mode = s->last ? DRY : TYPE;
+ break;
+ case TABLE:
+ NEEDBITS(14)
+ s->sub.trees.table = t = (uInt)b & 0x3fff;
+#ifndef PKZIP_BUG_WORKAROUND
+ if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29)
+ {
+ s->mode = BAD;
+ z->msg = (char*)"too many length or distance symbols";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+#endif
+ t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);
+ if ((s->sub.trees.blens = (uIntf*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL)
+ {
+ r = Z_MEM_ERROR;
+ LEAVE
+ }
+ DUMPBITS(14)
+ s->sub.trees.index = 0;
+ Tracev((stderr, "inflate: table sizes ok\n"));
+ s->mode = BTREE;
+ case BTREE:
+ while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10))
+ {
+ NEEDBITS(3)
+ s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7;
+ DUMPBITS(3)
+ }
+ while (s->sub.trees.index < 19)
+ s->sub.trees.blens[border[s->sub.trees.index++]] = 0;
+ s->sub.trees.bb = 7;
+ t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb,
+ &s->sub.trees.tb, s->hufts, z);
+ if (t != Z_OK)
+ {
+ ZFREE(z, s->sub.trees.blens);
+ r = t;
+ if (r == Z_DATA_ERROR)
+ s->mode = BAD;
+ LEAVE
+ }
+ s->sub.trees.index = 0;
+ Tracev((stderr, "inflate: bits tree ok\n"));
+ s->mode = DTREE;
+ case DTREE:
+ while (t = s->sub.trees.table,
+ s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))
+ {
+ inflate_huft *h;
+ uInt i, j, c;
+
+ t = s->sub.trees.bb;
+ NEEDBITS(t)
+ h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]);
+ t = h->bits;
+ c = h->base;
+ if (c < 16)
+ {
+ DUMPBITS(t)
+ s->sub.trees.blens[s->sub.trees.index++] = c;
+ }
+ else /* c == 16..18 */
+ {
+ i = c == 18 ? 7 : c - 14;
+ j = c == 18 ? 11 : 3;
+ NEEDBITS(t + i)
+ DUMPBITS(t)
+ j += (uInt)b & inflate_mask[i];
+ DUMPBITS(i)
+ i = s->sub.trees.index;
+ t = s->sub.trees.table;
+ if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) ||
+ (c == 16 && i < 1))
+ {
+ ZFREE(z, s->sub.trees.blens);
+ s->mode = BAD;
+ z->msg = (char*)"invalid bit length repeat";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+ c = c == 16 ? s->sub.trees.blens[i - 1] : 0;
+ do {
+ s->sub.trees.blens[i++] = c;
+ } while (--j);
+ s->sub.trees.index = i;
+ }
+ }
+ s->sub.trees.tb = Z_NULL;
+ {
+ uInt bl, bd;
+ inflate_huft *tl, *td;
+ inflate_codes_statef *c;
+
+ bl = 9; /* must be <= 9 for lookahead assumptions */
+ bd = 6; /* must be <= 9 for lookahead assumptions */
+ t = s->sub.trees.table;
+ t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
+ s->sub.trees.blens, &bl, &bd, &tl, &td,
+ s->hufts, z);
+ ZFREE(z, s->sub.trees.blens);
+ if (t != Z_OK)
+ {
+ if (t == (uInt)Z_DATA_ERROR)
+ s->mode = BAD;
+ r = t;
+ LEAVE
+ }
+ Tracev((stderr, "inflate: trees ok\n"));
+ if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)
+ {
+ r = Z_MEM_ERROR;
+ LEAVE
+ }
+ s->sub.decode.codes = c;
+ }
+ s->mode = CODES;
+ case CODES:
+ UPDATE
+ if ((r = inflate_codes(s, z, r)) != Z_STREAM_END)
+ return inflate_flush(s, z, r);
+ r = Z_OK;
+ inflate_codes_free(s->sub.decode.codes, z);
+ LOAD
+ Tracev((stderr, "inflate: codes end, %lu total out\n",
+ z->total_out + (q >= s->read ? q - s->read :
+ (s->end - s->read) + (q - s->window))));
+ if (!s->last)
+ {
+ s->mode = TYPE;
+ break;
+ }
+ s->mode = DRY;
+ case DRY:
+ FLUSH
+ if (s->read != s->write)
+ LEAVE
+ s->mode = DONE;
+ case DONE:
+ r = Z_STREAM_END;
+ LEAVE
+ case BAD:
+ r = Z_DATA_ERROR;
+ LEAVE
+ default:
+ r = Z_STREAM_ERROR;
+ LEAVE
+ }
+}
+
+
+int inflate_blocks_free(s, z)
+inflate_blocks_statef *s;
+z_streamp z;
+{
+ inflate_blocks_reset(s, z, Z_NULL);
+ ZFREE(z, s->window);
+ ZFREE(z, s->hufts);
+ ZFREE(z, s);
+ Tracev((stderr, "inflate: blocks freed\n"));
+ return Z_OK;
+}
+
+
+void inflate_set_dictionary(s, d, n)
+inflate_blocks_statef *s;
+const Bytef *d;
+uInt n;
+{
+ zmemcpy(s->window, d, n);
+ s->read = s->write = s->window + n;
+}
+
+
+/* Returns true if inflate is currently at the end of a block generated
+ * by Z_SYNC_FLUSH or Z_FULL_FLUSH.
+ * IN assertion: s != Z_NULL
+ */
+int inflate_blocks_sync_point(s)
+inflate_blocks_statef *s;
+{
+ return s->mode == LENS;
+}
diff --git a/cfe/cfe/zlib/infblock.h b/cfe/cfe/zlib/infblock.h
new file mode 100644
index 0000000..bd25c80
--- /dev/null
+++ b/cfe/cfe/zlib/infblock.h
@@ -0,0 +1,39 @@
+/* infblock.h -- header to use infblock.c
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+struct inflate_blocks_state;
+typedef struct inflate_blocks_state FAR inflate_blocks_statef;
+
+extern inflate_blocks_statef * inflate_blocks_new OF((
+ z_streamp z,
+ check_func c, /* check function */
+ uInt w)); /* window size */
+
+extern int inflate_blocks OF((
+ inflate_blocks_statef *,
+ z_streamp ,
+ int)); /* initial return code */
+
+extern void inflate_blocks_reset OF((
+ inflate_blocks_statef *,
+ z_streamp ,
+ uLongf *)); /* check value on output */
+
+extern int inflate_blocks_free OF((
+ inflate_blocks_statef *,
+ z_streamp));
+
+extern void inflate_set_dictionary OF((
+ inflate_blocks_statef *s,
+ const Bytef *d, /* dictionary */
+ uInt n)); /* dictionary length */
+
+extern int inflate_blocks_sync_point OF((
+ inflate_blocks_statef *s));
diff --git a/cfe/cfe/zlib/infcodes.c b/cfe/cfe/zlib/infcodes.c
new file mode 100644
index 0000000..d4e5ee9
--- /dev/null
+++ b/cfe/cfe/zlib/infcodes.c
@@ -0,0 +1,257 @@
+/* infcodes.c -- process literals and length/distance pairs
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "infblock.h"
+#include "infcodes.h"
+#include "infutil.h"
+#include "inffast.h"
+
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+typedef enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
+ START, /* x: set up for LEN */
+ LEN, /* i: get length/literal/eob next */
+ LENEXT, /* i: getting length extra (have base) */
+ DIST, /* i: get distance next */
+ DISTEXT, /* i: getting distance extra */
+ COPY, /* o: copying bytes in window, waiting for space */
+ LIT, /* o: got literal, waiting for output space */
+ WASH, /* o: got eob, possibly still output waiting */
+ END, /* x: got eob and all data flushed */
+ BADCODE} /* x: got error */
+inflate_codes_mode;
+
+/* inflate codes private state */
+struct inflate_codes_state {
+
+ /* mode */
+ inflate_codes_mode mode; /* current inflate_codes mode */
+
+ /* mode dependent information */
+ uInt len;
+ union {
+ struct {
+ inflate_huft *tree; /* pointer into tree */
+ uInt need; /* bits needed */
+ } code; /* if LEN or DIST, where in tree */
+ uInt lit; /* if LIT, literal */
+ struct {
+ uInt get; /* bits to get for extra */
+ uInt dist; /* distance back to copy from */
+ } copy; /* if EXT or COPY, where and how much */
+ } sub; /* submode */
+
+ /* mode independent information */
+ Byte lbits; /* ltree bits decoded per branch */
+ Byte dbits; /* dtree bits decoder per branch */
+ inflate_huft *ltree; /* literal/length/eob tree */
+ inflate_huft *dtree; /* distance tree */
+
+};
+
+
+inflate_codes_statef *inflate_codes_new(bl, bd, tl, td, z)
+uInt bl, bd;
+inflate_huft *tl;
+inflate_huft *td; /* need separate declaration for Borland C++ */
+z_streamp z;
+{
+ inflate_codes_statef *c;
+
+ if ((c = (inflate_codes_statef *)
+ ZALLOC(z,1,sizeof(struct inflate_codes_state))) != Z_NULL)
+ {
+ c->mode = START;
+ c->lbits = (Byte)bl;
+ c->dbits = (Byte)bd;
+ c->ltree = tl;
+ c->dtree = td;
+ Tracev((stderr, "inflate: codes new\n"));
+ }
+ return c;
+}
+
+
+int inflate_codes(s, z, r)
+inflate_blocks_statef *s;
+z_streamp z;
+int r;
+{
+ uInt j; /* temporary storage */
+ inflate_huft *t; /* temporary pointer */
+ uInt e; /* extra bits or operation */
+ uLong b; /* bit buffer */
+ uInt k; /* bits in bit buffer */
+ Bytef *p; /* input data pointer */
+ uInt n; /* bytes available there */
+ Bytef *q; /* output window write pointer */
+ uInt m; /* bytes to end of window or read pointer */
+ Bytef *f; /* pointer to copy strings from */
+ inflate_codes_statef *c = s->sub.decode.codes; /* codes state */
+
+ /* copy input/output information to locals (UPDATE macro restores) */
+ LOAD
+
+ /* process input and output based on current state */
+ while (1) switch (c->mode)
+ { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
+ case START: /* x: set up for LEN */
+#ifndef SLOW
+ if (m >= 258 && n >= 10)
+ {
+ UPDATE
+ r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z);
+ LOAD
+ if (r != Z_OK)
+ {
+ c->mode = r == Z_STREAM_END ? WASH : BADCODE;
+ break;
+ }
+ }
+#endif /* !SLOW */
+ c->sub.code.need = c->lbits;
+ c->sub.code.tree = c->ltree;
+ c->mode = LEN;
+ case LEN: /* i: get length/literal/eob next */
+ j = c->sub.code.need;
+ NEEDBITS(j)
+ t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
+ DUMPBITS(t->bits)
+ e = (uInt)(t->exop);
+ if (e == 0) /* literal */
+ {
+ c->sub.lit = t->base;
+ Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
+ "inflate: literal '%c'\n" :
+ "inflate: literal 0x%02x\n", t->base));
+ c->mode = LIT;
+ break;
+ }
+ if (e & 16) /* length */
+ {
+ c->sub.copy.get = e & 15;
+ c->len = t->base;
+ c->mode = LENEXT;
+ break;
+ }
+ if ((e & 64) == 0) /* next table */
+ {
+ c->sub.code.need = e;
+ c->sub.code.tree = t + t->base;
+ break;
+ }
+ if (e & 32) /* end of block */
+ {
+ Tracevv((stderr, "inflate: end of block\n"));
+ c->mode = WASH;
+ break;
+ }
+ c->mode = BADCODE; /* invalid code */
+ z->msg = (char*)"invalid literal/length code";
+ r = Z_DATA_ERROR;
+ LEAVE
+ case LENEXT: /* i: getting length extra (have base) */
+ j = c->sub.copy.get;
+ NEEDBITS(j)
+ c->len += (uInt)b & inflate_mask[j];
+ DUMPBITS(j)
+ c->sub.code.need = c->dbits;
+ c->sub.code.tree = c->dtree;
+ Tracevv((stderr, "inflate: length %u\n", c->len));
+ c->mode = DIST;
+ case DIST: /* i: get distance next */
+ j = c->sub.code.need;
+ NEEDBITS(j)
+ t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
+ DUMPBITS(t->bits)
+ e = (uInt)(t->exop);
+ if (e & 16) /* distance */
+ {
+ c->sub.copy.get = e & 15;
+ c->sub.copy.dist = t->base;
+ c->mode = DISTEXT;
+ break;
+ }
+ if ((e & 64) == 0) /* next table */
+ {
+ c->sub.code.need = e;
+ c->sub.code.tree = t + t->base;
+ break;
+ }
+ c->mode = BADCODE; /* invalid code */
+ z->msg = (char*)"invalid distance code";
+ r = Z_DATA_ERROR;
+ LEAVE
+ case DISTEXT: /* i: getting distance extra */
+ j = c->sub.copy.get;
+ NEEDBITS(j)
+ c->sub.copy.dist += (uInt)b & inflate_mask[j];
+ DUMPBITS(j)
+ Tracevv((stderr, "inflate: distance %u\n", c->sub.copy.dist));
+ c->mode = COPY;
+ case COPY: /* o: copying bytes in window, waiting for space */
+#ifndef __TURBOC__ /* Turbo C bug for following expression */
+ f = (uInt)(q - s->window) < c->sub.copy.dist ?
+ s->end - (c->sub.copy.dist - (q - s->window)) :
+ q - c->sub.copy.dist;
+#else
+ f = q - c->sub.copy.dist;
+ if ((uInt)(q - s->window) < c->sub.copy.dist)
+ f = s->end - (c->sub.copy.dist - (uInt)(q - s->window));
+#endif
+ while (c->len)
+ {
+ NEEDOUT
+ OUTBYTE(*f++)
+ if (f == s->end)
+ f = s->window;
+ c->len--;
+ }
+ c->mode = START;
+ break;
+ case LIT: /* o: got literal, waiting for output space */
+ NEEDOUT
+ OUTBYTE(c->sub.lit)
+ c->mode = START;
+ break;
+ case WASH: /* o: got eob, possibly more output */
+ if (k > 7) /* return unused byte, if any */
+ {
+ Assert(k < 16, "inflate_codes grabbed too many bytes")
+ k -= 8;
+ n++;
+ p--; /* can always return one */
+ }
+ FLUSH
+ if (s->read != s->write)
+ LEAVE
+ c->mode = END;
+ case END:
+ r = Z_STREAM_END;
+ LEAVE
+ case BADCODE: /* x: got error */
+ r = Z_DATA_ERROR;
+ LEAVE
+ default:
+ r = Z_STREAM_ERROR;
+ LEAVE
+ }
+#ifdef NEED_DUMMY_RETURN
+ return Z_STREAM_ERROR; /* Some dumb compilers complain without this */
+#endif
+}
+
+
+void inflate_codes_free(c, z)
+inflate_codes_statef *c;
+z_streamp z;
+{
+ ZFREE(z, c);
+ Tracev((stderr, "inflate: codes free\n"));
+}
diff --git a/cfe/cfe/zlib/infcodes.h b/cfe/cfe/zlib/infcodes.h
new file mode 100644
index 0000000..6c750d8
--- /dev/null
+++ b/cfe/cfe/zlib/infcodes.h
@@ -0,0 +1,27 @@
+/* infcodes.h -- header to use infcodes.c
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+struct inflate_codes_state;
+typedef struct inflate_codes_state FAR inflate_codes_statef;
+
+extern inflate_codes_statef *inflate_codes_new OF((
+ uInt, uInt,
+ inflate_huft *, inflate_huft *,
+ z_streamp ));
+
+extern int inflate_codes OF((
+ inflate_blocks_statef *,
+ z_streamp ,
+ int));
+
+extern void inflate_codes_free OF((
+ inflate_codes_statef *,
+ z_streamp ));
+
diff --git a/cfe/cfe/zlib/inffast.c b/cfe/cfe/zlib/inffast.c
new file mode 100644
index 0000000..61a78ee
--- /dev/null
+++ b/cfe/cfe/zlib/inffast.c
@@ -0,0 +1,170 @@
+/* inffast.c -- process literals and length/distance pairs fast
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "infblock.h"
+#include "infcodes.h"
+#include "infutil.h"
+#include "inffast.h"
+
+struct inflate_codes_state {int dummy;}; /* for buggy compilers */
+
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+/* macros for bit input with no checking and for returning unused bytes */
+#define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}}
+#define UNGRAB {c=z->avail_in-n;c=(k>>3)<c?k>>3:c;n+=c;p-=c;k-=c<<3;}
+
+/* Called with number of bytes left to write in window at least 258
+ (the maximum string length) and number of input bytes available
+ at least ten. The ten bytes are six bytes for the longest length/
+ distance pair plus four bytes for overloading the bit buffer. */
+
+int inflate_fast(bl, bd, tl, td, s, z)
+uInt bl, bd;
+inflate_huft *tl;
+inflate_huft *td; /* need separate declaration for Borland C++ */
+inflate_blocks_statef *s;
+z_streamp z;
+{
+ inflate_huft *t; /* temporary pointer */
+ uInt e; /* extra bits or operation */
+ uLong b; /* bit buffer */
+ uInt k; /* bits in bit buffer */
+ Bytef *p; /* input data pointer */
+ uInt n; /* bytes available there */
+ Bytef *q; /* output window write pointer */
+ uInt m; /* bytes to end of window or read pointer */
+ uInt ml; /* mask for literal/length tree */
+ uInt md; /* mask for distance tree */
+ uInt c; /* bytes to copy */
+ uInt d; /* distance back to copy from */
+ Bytef *r; /* copy source pointer */
+
+ /* load input, output, bit values */
+ LOAD
+
+ /* initialize masks */
+ ml = inflate_mask[bl];
+ md = inflate_mask[bd];
+
+ /* do until not enough input or output space for fast loop */
+ do { /* assume called with m >= 258 && n >= 10 */
+ /* get literal/length code */
+ GRABBITS(20) /* max bits for literal/length code */
+ if ((e = (t = tl + ((uInt)b & ml))->exop) == 0)
+ {
+ DUMPBITS(t->bits)
+ Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
+ "inflate: * literal '%c'\n" :
+ "inflate: * literal 0x%02x\n", t->base));
+ *q++ = (Byte)t->base;
+ m--;
+ continue;
+ }
+ do {
+ DUMPBITS(t->bits)
+ if (e & 16)
+ {
+ /* get extra bits for length */
+ e &= 15;
+ c = t->base + ((uInt)b & inflate_mask[e]);
+ DUMPBITS(e)
+ Tracevv((stderr, "inflate: * length %u\n", c));
+
+ /* decode distance base of block to copy */
+ GRABBITS(15); /* max bits for distance code */
+ e = (t = td + ((uInt)b & md))->exop;
+ do {
+ DUMPBITS(t->bits)
+ if (e & 16)
+ {
+ /* get extra bits to add to distance base */
+ e &= 15;
+ GRABBITS(e) /* get extra bits (up to 13) */
+ d = t->base + ((uInt)b & inflate_mask[e]);
+ DUMPBITS(e)
+ Tracevv((stderr, "inflate: * distance %u\n", d));
+
+ /* do the copy */
+ m -= c;
+ if ((uInt)(q - s->window) >= d) /* offset before dest */
+ { /* just copy */
+ r = q - d;
+ *q++ = *r++; c--; /* minimum count is three, */
+ *q++ = *r++; c--; /* so unroll loop a little */
+ }
+ else /* else offset after destination */
+ {
+ e = d - (uInt)(q - s->window); /* bytes from offset to end */
+ r = s->end - e; /* pointer to offset */
+ if (c > e) /* if source crosses, */
+ {
+ c -= e; /* copy to end of window */
+ do {
+ *q++ = *r++;
+ } while (--e);
+ r = s->window; /* copy rest from start of window */
+ }
+ }
+ do { /* copy all or what's left */
+ *q++ = *r++;
+ } while (--c);
+ break;
+ }
+ else if ((e & 64) == 0)
+ {
+ t += t->base;
+ e = (t += ((uInt)b & inflate_mask[e]))->exop;
+ }
+ else
+ {
+ z->msg = (char*)"invalid distance code";
+ UNGRAB
+ UPDATE
+ return Z_DATA_ERROR;
+ }
+ } while (1);
+ break;
+ }
+ if ((e & 64) == 0)
+ {
+ t += t->base;
+ if ((e = (t += ((uInt)b & inflate_mask[e]))->exop) == 0)
+ {
+ DUMPBITS(t->bits)
+ Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
+ "inflate: * literal '%c'\n" :
+ "inflate: * literal 0x%02x\n", t->base));
+ *q++ = (Byte)t->base;
+ m--;
+ break;
+ }
+ }
+ else if (e & 32)
+ {
+ Tracevv((stderr, "inflate: * end of block\n"));
+ UNGRAB
+ UPDATE
+ return Z_STREAM_END;
+ }
+ else
+ {
+ z->msg = (char*)"invalid literal/length code";
+ UNGRAB
+ UPDATE
+ return Z_DATA_ERROR;
+ }
+ } while (1);
+ } while (m >= 258 && n >= 10);
+
+ /* not enough input or output--restore pointers and return */
+ UNGRAB
+ UPDATE
+ return Z_OK;
+}
diff --git a/cfe/cfe/zlib/inffast.h b/cfe/cfe/zlib/inffast.h
new file mode 100644
index 0000000..8facec5
--- /dev/null
+++ b/cfe/cfe/zlib/inffast.h
@@ -0,0 +1,17 @@
+/* inffast.h -- header to use inffast.c
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+extern int inflate_fast OF((
+ uInt,
+ uInt,
+ inflate_huft *,
+ inflate_huft *,
+ inflate_blocks_statef *,
+ z_streamp ));
diff --git a/cfe/cfe/zlib/inffixed.h b/cfe/cfe/zlib/inffixed.h
new file mode 100644
index 0000000..77f7e76
--- /dev/null
+++ b/cfe/cfe/zlib/inffixed.h
@@ -0,0 +1,151 @@
+/* inffixed.h -- table for decoding fixed codes
+ * Generated automatically by the maketree.c program
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+local uInt fixed_bl = 9;
+local uInt fixed_bd = 5;
+local inflate_huft fixed_tl[] = {
+ {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
+ {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192},
+ {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160},
+ {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},224},
+ {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},144},
+ {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},208},
+ {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},176},
+ {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},240},
+ {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
+ {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},200},
+ {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},168},
+ {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},232},
+ {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},152},
+ {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},216},
+ {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},184},
+ {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},248},
+ {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
+ {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},196},
+ {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},164},
+ {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},228},
+ {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},148},
+ {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},212},
+ {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},180},
+ {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},244},
+ {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},204},
+ {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},172},
+ {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},236},
+ {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},156},
+ {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},220},
+ {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},188},
+ {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},252},
+ {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
+ {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},194},
+ {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},162},
+ {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},226},
+ {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},146},
+ {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},210},
+ {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},178},
+ {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},242},
+ {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},
+ {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},202},
+ {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},170},
+ {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},234},
+ {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},154},
+ {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},218},
+ {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},186},
+ {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},250},
+ {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},
+ {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},198},
+ {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},166},
+ {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},230},
+ {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},150},
+ {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},214},
+ {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},182},
+ {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},246},
+ {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},206},
+ {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},174},
+ {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},238},
+ {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},158},
+ {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},222},
+ {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},190},
+ {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},254},
+ {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
+ {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},193},
+ {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},161},
+ {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},225},
+ {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},145},
+ {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},209},
+ {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},177},
+ {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},241},
+ {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
+ {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},201},
+ {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},169},
+ {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},233},
+ {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},153},
+ {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},217},
+ {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},185},
+ {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},249},
+ {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
+ {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},197},
+ {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},165},
+ {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},229},
+ {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},149},
+ {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},213},
+ {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},181},
+ {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},245},
+ {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},205},
+ {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},173},
+ {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},237},
+ {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},157},
+ {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},221},
+ {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},189},
+ {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},253},
+ {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
+ {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},195},
+ {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},163},
+ {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},227},
+ {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},147},
+ {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},211},
+ {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},179},
+ {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},243},
+ {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},
+ {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},203},
+ {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},171},
+ {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},235},
+ {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},155},
+ {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},219},
+ {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},187},
+ {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},251},
+ {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},
+ {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},199},
+ {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},167},
+ {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},231},
+ {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},151},
+ {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},215},
+ {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},183},
+ {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},247},
+ {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},207},
+ {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},175},
+ {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},239},
+ {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},159},
+ {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},223},
+ {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191},
+ {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255}
+ };
+local inflate_huft fixed_td[] = {
+ {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097},
+ {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385},
+ {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193},
+ {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577},
+ {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145},
+ {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577},
+ {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289},
+ {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577}
+ };
diff --git a/cfe/cfe/zlib/inflate.c b/cfe/cfe/zlib/inflate.c
new file mode 100644
index 0000000..32e9b8d
--- /dev/null
+++ b/cfe/cfe/zlib/inflate.c
@@ -0,0 +1,366 @@
+/* inflate.c -- zlib interface to inflate modules
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "infblock.h"
+
+struct inflate_blocks_state {int dummy;}; /* for buggy compilers */
+
+typedef enum {
+ METHOD, /* waiting for method byte */
+ FLAG, /* waiting for flag byte */
+ DICT4, /* four dictionary check bytes to go */
+ DICT3, /* three dictionary check bytes to go */
+ DICT2, /* two dictionary check bytes to go */
+ DICT1, /* one dictionary check byte to go */
+ DICT0, /* waiting for inflateSetDictionary */
+ BLOCKS, /* decompressing blocks */
+ CHECK4, /* four check bytes to go */
+ CHECK3, /* three check bytes to go */
+ CHECK2, /* two check bytes to go */
+ CHECK1, /* one check byte to go */
+ DONE, /* finished check, done */
+ BAD} /* got an error--stay here */
+inflate_mode;
+
+/* inflate private state */
+struct internal_state {
+
+ /* mode */
+ inflate_mode mode; /* current inflate mode */
+
+ /* mode dependent information */
+ union {
+ uInt method; /* if FLAGS, method byte */
+ struct {
+ uLong was; /* computed check value */
+ uLong need; /* stream check value */
+ } check; /* if CHECK, check values to compare */
+ uInt marker; /* if BAD, inflateSync's marker bytes count */
+ } sub; /* submode */
+
+ /* mode independent information */
+ int nowrap; /* flag for no wrapper */
+ uInt wbits; /* log2(window size) (8..15, defaults to 15) */
+ inflate_blocks_statef
+ *blocks; /* current inflate_blocks state */
+
+};
+
+
+int ZEXPORT inflateReset(z)
+z_streamp z;
+{
+ if (z == Z_NULL || z->state == Z_NULL)
+ return Z_STREAM_ERROR;
+ z->total_in = z->total_out = 0;
+ z->msg = Z_NULL;
+ z->state->mode = z->state->nowrap ? BLOCKS : METHOD;
+ inflate_blocks_reset(z->state->blocks, z, Z_NULL);
+ Tracev((stderr, "inflate: reset\n"));
+ return Z_OK;
+}
+
+
+int ZEXPORT inflateEnd(z)
+z_streamp z;
+{
+ if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL)
+ return Z_STREAM_ERROR;
+ if (z->state->blocks != Z_NULL)
+ inflate_blocks_free(z->state->blocks, z);
+ ZFREE(z, z->state);
+ z->state = Z_NULL;
+ Tracev((stderr, "inflate: end\n"));
+ return Z_OK;
+}
+
+
+int ZEXPORT inflateInit2_(z, w, version, stream_size)
+z_streamp z;
+int w;
+const char *version;
+int stream_size;
+{
+ if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
+ stream_size != sizeof(z_stream))
+ return Z_VERSION_ERROR;
+
+ /* initialize state */
+ if (z == Z_NULL)
+ return Z_STREAM_ERROR;
+ z->msg = Z_NULL;
+ if (z->zalloc == Z_NULL)
+ {
+ z->zalloc = zcalloc;
+ z->opaque = (voidpf)0;
+ }
+ if (z->zfree == Z_NULL) z->zfree = zcfree;
+ if ((z->state = (struct internal_state FAR *)
+ ZALLOC(z,1,sizeof(struct internal_state))) == Z_NULL)
+ return Z_MEM_ERROR;
+ z->state->blocks = Z_NULL;
+
+ /* handle undocumented nowrap option (no zlib header or check) */
+ z->state->nowrap = 0;
+ if (w < 0)
+ {
+ w = - w;
+ z->state->nowrap = 1;
+ }
+
+ /* set window size */
+ if (w < 8 || w > 15)
+ {
+ inflateEnd(z);
+ return Z_STREAM_ERROR;
+ }
+ z->state->wbits = (uInt)w;
+
+ /* create inflate_blocks state */
+ if ((z->state->blocks =
+ inflate_blocks_new(z, z->state->nowrap ? Z_NULL : adler32, (uInt)1 << w))
+ == Z_NULL)
+ {
+ inflateEnd(z);
+ return Z_MEM_ERROR;
+ }
+ Tracev((stderr, "inflate: allocated\n"));
+
+ /* reset state */
+ inflateReset(z);
+ return Z_OK;
+}
+
+
+int ZEXPORT inflateInit_(z, version, stream_size)
+z_streamp z;
+const char *version;
+int stream_size;
+{
+ return inflateInit2_(z, DEF_WBITS, version, stream_size);
+}
+
+
+#define NEEDBYTE {if(z->avail_in==0)return r;r=f;}
+#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++)
+
+int ZEXPORT inflate(z, f)
+z_streamp z;
+int f;
+{
+ int r;
+ uInt b;
+
+ if (z == Z_NULL || z->state == Z_NULL || z->next_in == Z_NULL)
+ return Z_STREAM_ERROR;
+ f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK;
+ r = Z_BUF_ERROR;
+ while (1) switch (z->state->mode)
+ {
+ case METHOD:
+ NEEDBYTE
+ if (((z->state->sub.method = NEXTBYTE) & 0xf) != Z_DEFLATED)
+ {
+ z->state->mode = BAD;
+ z->msg = (char*)"unknown compression method";
+ z->state->sub.marker = 5; /* can't try inflateSync */
+ break;
+ }
+ if ((z->state->sub.method >> 4) + 8 > z->state->wbits)
+ {
+ z->state->mode = BAD;
+ z->msg = (char*)"invalid window size";
+ z->state->sub.marker = 5; /* can't try inflateSync */
+ break;
+ }
+ z->state->mode = FLAG;
+ case FLAG:
+ NEEDBYTE
+ b = NEXTBYTE;
+ if (((z->state->sub.method << 8) + b) % 31)
+ {
+ z->state->mode = BAD;
+ z->msg = (char*)"incorrect header check";
+ z->state->sub.marker = 5; /* can't try inflateSync */
+ break;
+ }
+ Tracev((stderr, "inflate: zlib header ok\n"));
+ if (!(b & PRESET_DICT))
+ {
+ z->state->mode = BLOCKS;
+ break;
+ }
+ z->state->mode = DICT4;
+ case DICT4:
+ NEEDBYTE
+ z->state->sub.check.need = (uLong)NEXTBYTE << 24;
+ z->state->mode = DICT3;
+ case DICT3:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE << 16;
+ z->state->mode = DICT2;
+ case DICT2:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE << 8;
+ z->state->mode = DICT1;
+ case DICT1:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE;
+ z->adler = z->state->sub.check.need;
+ z->state->mode = DICT0;
+ return Z_NEED_DICT;
+ case DICT0:
+ z->state->mode = BAD;
+ z->msg = (char*)"need dictionary";
+ z->state->sub.marker = 0; /* can try inflateSync */
+ return Z_STREAM_ERROR;
+ case BLOCKS:
+ r = inflate_blocks(z->state->blocks, z, r);
+ if (r == Z_DATA_ERROR)
+ {
+ z->state->mode = BAD;
+ z->state->sub.marker = 0; /* can try inflateSync */
+ break;
+ }
+ if (r == Z_OK)
+ r = f;
+ if (r != Z_STREAM_END)
+ return r;
+ r = f;
+ inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was);
+ if (z->state->nowrap)
+ {
+ z->state->mode = DONE;
+ break;
+ }
+ z->state->mode = CHECK4;
+ case CHECK4:
+ NEEDBYTE
+ z->state->sub.check.need = (uLong)NEXTBYTE << 24;
+ z->state->mode = CHECK3;
+ case CHECK3:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE << 16;
+ z->state->mode = CHECK2;
+ case CHECK2:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE << 8;
+ z->state->mode = CHECK1;
+ case CHECK1:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE;
+
+ if (z->state->sub.check.was != z->state->sub.check.need)
+ {
+ z->state->mode = BAD;
+ z->msg = (char*)"incorrect data check";
+ z->state->sub.marker = 5; /* can't try inflateSync */
+ break;
+ }
+ Tracev((stderr, "inflate: zlib check ok\n"));
+ z->state->mode = DONE;
+ case DONE:
+ return Z_STREAM_END;
+ case BAD:
+ return Z_DATA_ERROR;
+ default:
+ return Z_STREAM_ERROR;
+ }
+#ifdef NEED_DUMMY_RETURN
+ return Z_STREAM_ERROR; /* Some dumb compilers complain without this */
+#endif
+}
+
+
+int ZEXPORT inflateSetDictionary(z, dictionary, dictLength)
+z_streamp z;
+const Bytef *dictionary;
+uInt dictLength;
+{
+ uInt length = dictLength;
+
+ if (z == Z_NULL || z->state == Z_NULL || z->state->mode != DICT0)
+ return Z_STREAM_ERROR;
+
+ if (adler32(1L, dictionary, dictLength) != z->adler) return Z_DATA_ERROR;
+ z->adler = 1L;
+
+ if (length >= ((uInt)1<<z->state->wbits))
+ {
+ length = (1<<z->state->wbits)-1;
+ dictionary += dictLength - length;
+ }
+ inflate_set_dictionary(z->state->blocks, dictionary, length);
+ z->state->mode = BLOCKS;
+ return Z_OK;
+}
+
+
+int ZEXPORT inflateSync(z)
+z_streamp z;
+{
+ uInt n; /* number of bytes to look at */
+ Bytef *p; /* pointer to bytes */
+ uInt m; /* number of marker bytes found in a row */
+ uLong r, w; /* temporaries to save total_in and total_out */
+
+ /* set up */
+ if (z == Z_NULL || z->state == Z_NULL)
+ return Z_STREAM_ERROR;
+ if (z->state->mode != BAD)
+ {
+ z->state->mode = BAD;
+ z->state->sub.marker = 0;
+ }
+ if ((n = z->avail_in) == 0)
+ return Z_BUF_ERROR;
+ p = z->next_in;
+ m = z->state->sub.marker;
+
+ /* search */
+ while (n && m < 4)
+ {
+ static const Byte mark[4] = {0, 0, 0xff, 0xff};
+ if (*p == mark[m])
+ m++;
+ else if (*p)
+ m = 0;
+ else
+ m = 4 - m;
+ p++, n--;
+ }
+
+ /* restore */
+ z->total_in += p - z->next_in;
+ z->next_in = p;
+ z->avail_in = n;
+ z->state->sub.marker = m;
+
+ /* return no joy or set up to restart on a new block */
+ if (m != 4)
+ return Z_DATA_ERROR;
+ r = z->total_in; w = z->total_out;
+ inflateReset(z);
+ z->total_in = r; z->total_out = w;
+ z->state->mode = BLOCKS;
+ return Z_OK;
+}
+
+
+/* Returns true if inflate is currently at the end of a block generated
+ * by Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
+ * implementation to provide an additional safety check. PPP uses Z_SYNC_FLUSH
+ * but removes the length bytes of the resulting empty stored block. When
+ * decompressing, PPP checks that at the end of input packet, inflate is
+ * waiting for these length bytes.
+ */
+int ZEXPORT inflateSyncPoint(z)
+z_streamp z;
+{
+ if (z == Z_NULL || z->state == Z_NULL || z->state->blocks == Z_NULL)
+ return Z_STREAM_ERROR;
+ return inflate_blocks_sync_point(z->state->blocks);
+}
diff --git a/cfe/cfe/zlib/inftrees.c b/cfe/cfe/zlib/inftrees.c
new file mode 100644
index 0000000..ef1e0b6
--- /dev/null
+++ b/cfe/cfe/zlib/inftrees.c
@@ -0,0 +1,455 @@
+/* inftrees.c -- generate Huffman trees for efficient decoding
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+
+#if !defined(BUILDFIXED) && !defined(STDC)
+# define BUILDFIXED /* non ANSI compilers may not accept inffixed.h */
+#endif
+
+const char inflate_copyright[] =
+ " inflate 1.1.3 Copyright 1995-1998 Mark Adler ";
+/*
+ If you use the zlib library in a product, an acknowledgment is welcome
+ in the documentation of your product. If for some reason you cannot
+ include such an acknowledgment, I would appreciate that you keep this
+ copyright string in the executable of your product.
+ */
+struct internal_state {int dummy;}; /* for buggy compilers */
+
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+
+local int huft_build OF((
+ uIntf *, /* code lengths in bits */
+ uInt, /* number of codes */
+ uInt, /* number of "simple" codes */
+ const uIntf *, /* list of base values for non-simple codes */
+ const uIntf *, /* list of extra bits for non-simple codes */
+ inflate_huft * FAR*,/* result: starting table */
+ uIntf *, /* maximum lookup bits (returns actual) */
+ inflate_huft *, /* space for trees */
+ uInt *, /* hufts used in space */
+ uIntf * )); /* space for values */
+
+/* Tables for deflate from PKZIP's appnote.txt. */
+local const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */
+ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
+ 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
+ /* see note #13 above about 258 */
+local const uInt cplext[31] = { /* Extra bits for literal codes 257..285 */
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
+ 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; /* 112==invalid */
+local const uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */
+ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
+ 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
+ 8193, 12289, 16385, 24577};
+local const uInt cpdext[30] = { /* Extra bits for distance codes */
+ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
+ 7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
+ 12, 12, 13, 13};
+
+/*
+ Huffman code decoding is performed using a multi-level table lookup.
+ The fastest way to decode is to simply build a lookup table whose
+ size is determined by the longest code. However, the time it takes
+ to build this table can also be a factor if the data being decoded
+ is not very long. The most common codes are necessarily the
+ shortest codes, so those codes dominate the decoding time, and hence
+ the speed. The idea is you can have a shorter table that decodes the
+ shorter, more probable codes, and then point to subsidiary tables for
+ the longer codes. The time it costs to decode the longer codes is
+ then traded against the time it takes to make longer tables.
+
+ This results of this trade are in the variables lbits and dbits
+ below. lbits is the number of bits the first level table for literal/
+ length codes can decode in one step, and dbits is the same thing for
+ the distance codes. Subsequent tables are also less than or equal to
+ those sizes. These values may be adjusted either when all of the
+ codes are shorter than that, in which case the longest code length in
+ bits is used, or when the shortest code is *longer* than the requested
+ table size, in which case the length of the shortest code in bits is
+ used.
+
+ There are two different values for the two tables, since they code a
+ different number of possibilities each. The literal/length table
+ codes 286 possible values, or in a flat code, a little over eight
+ bits. The distance table codes 30 possible values, or a little less
+ than five bits, flat. The optimum values for speed end up being
+ about one bit more than those, so lbits is 8+1 and dbits is 5+1.
+ The optimum values may differ though from machine to machine, and
+ possibly even between compilers. Your mileage may vary.
+ */
+
+
+/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */
+#define BMAX 15 /* maximum bit length of any code */
+
+local int huft_build(b, n, s, d, e, t, m, hp, hn, v)
+uIntf *b; /* code lengths in bits (all assumed <= BMAX) */
+uInt n; /* number of codes (assumed <= 288) */
+uInt s; /* number of simple-valued codes (0..s-1) */
+const uIntf *d; /* list of base values for non-simple codes */
+const uIntf *e; /* list of extra bits for non-simple codes */
+inflate_huft * FAR *t; /* result: starting table */
+uIntf *m; /* maximum lookup bits, returns actual */
+inflate_huft *hp; /* space for trees */
+uInt *hn; /* hufts used in space */
+uIntf *v; /* working area: values in order of bit length */
+/* Given a list of code lengths and a maximum table size, make a set of
+ tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR
+ if the given code set is incomplete (the tables are still built in this
+ case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of
+ lengths), or Z_MEM_ERROR if not enough memory. */
+{
+
+ uInt a; /* counter for codes of length k */
+ uInt c[BMAX+1]; /* bit length count table */
+ uInt f; /* i repeats in table every f entries */
+ int g; /* maximum code length */
+ int h; /* table level */
+ register uInt i; /* counter, current code */
+ register uInt j; /* counter */
+ register int k; /* number of bits in current code */
+ int l; /* bits per table (returned in m) */
+ uInt mask; /* (1 << w) - 1, to avoid cc -O bug on HP */
+ register uIntf *p; /* pointer into c[], b[], or v[] */
+ inflate_huft *q; /* points to current table */
+ struct inflate_huft_s r; /* table entry for structure assignment */
+ inflate_huft *u[BMAX]; /* table stack */
+ register int w; /* bits before this table == (l * h) */
+ uInt x[BMAX+1]; /* bit offsets, then code stack */
+ uIntf *xp; /* pointer into x */
+ int y; /* number of dummy codes added */
+ uInt z; /* number of entries in current table */
+
+
+ /* Generate counts for each bit length */
+ p = c;
+#define C0 *p++ = 0;
+#define C2 C0 C0 C0 C0
+#define C4 C2 C2 C2 C2
+ C4 /* clear c[]--assume BMAX+1 is 16 */
+ p = b; i = n;
+ do {
+ c[*p++]++; /* assume all entries <= BMAX */
+ } while (--i);
+ if (c[0] == n) /* null input--all zero length codes */
+ {
+ *t = (inflate_huft *)Z_NULL;
+ *m = 0;
+ return Z_OK;
+ }
+
+
+ /* Find minimum and maximum length, bound *m by those */
+ l = *m;
+ for (j = 1; j <= BMAX; j++)
+ if (c[j])
+ break;
+ k = j; /* minimum code length */
+ if ((uInt)l < j)
+ l = j;
+ for (i = BMAX; i; i--)
+ if (c[i])
+ break;
+ g = i; /* maximum code length */
+ if ((uInt)l > i)
+ l = i;
+ *m = l;
+
+
+ /* Adjust last length count to fill out codes, if needed */
+ for (y = 1 << j; j < i; j++, y <<= 1)
+ if ((y -= c[j]) < 0)
+ return Z_DATA_ERROR;
+ if ((y -= c[i]) < 0)
+ return Z_DATA_ERROR;
+ c[i] += y;
+
+
+ /* Generate starting offsets into the value table for each length */
+ x[1] = j = 0;
+ p = c + 1; xp = x + 2;
+ while (--i) { /* note that i == g from above */
+ *xp++ = (j += *p++);
+ }
+
+
+ /* Make a table of values in order of bit lengths */
+ p = b; i = 0;
+ do {
+ if ((j = *p++) != 0)
+ v[x[j]++] = i;
+ } while (++i < n);
+ n = x[g]; /* set n to length of v */
+
+
+ /* Generate the Huffman codes and for each, make the table entries */
+ x[0] = i = 0; /* first Huffman code is zero */
+ p = v; /* grab values in bit order */
+ h = -1; /* no tables yet--level -1 */
+ w = -l; /* bits decoded == (l * h) */
+ u[0] = (inflate_huft *)Z_NULL; /* just to keep compilers happy */
+ q = (inflate_huft *)Z_NULL; /* ditto */
+ z = 0; /* ditto */
+
+ /* go through the bit lengths (k already is bits in shortest code) */
+ for (; k <= g; k++)
+ {
+ a = c[k];
+ while (a--)
+ {
+ /* here i is the Huffman code of length k bits for value *p */
+ /* make tables up to required level */
+ while (k > w + l)
+ {
+ h++;
+ w += l; /* previous table always l bits */
+
+ /* compute minimum size table less than or equal to l bits */
+ z = g - w;
+ z = z > (uInt)l ? l : z; /* table size upper limit */
+ if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */
+ { /* too few codes for k-w bit table */
+ f -= a + 1; /* deduct codes from patterns left */
+ xp = c + k;
+ if (j < z)
+ while (++j < z) /* try smaller tables up to z bits */
+ {
+ if ((f <<= 1) <= *++xp)
+ break; /* enough codes to use up j bits */
+ f -= *xp; /* else deduct codes from patterns */
+ }
+ }
+ z = 1 << j; /* table entries for j-bit table */
+
+ /* allocate new table */
+ if (*hn + z > MANY) /* (note: doesn't matter for fixed) */
+ return Z_MEM_ERROR; /* not enough memory */
+ u[h] = q = hp + *hn;
+ *hn += z;
+
+ /* connect to last table, if there is one */
+ if (h)
+ {
+ x[h] = i; /* save pattern for backing up */
+ r.bits = (Byte)l; /* bits to dump before this table */
+ r.exop = (Byte)j; /* bits in this table */
+ j = i >> (w - l);
+ r.base = (uInt)(q - u[h-1] - j); /* offset to this table */
+ u[h-1][j] = r; /* connect to last table */
+ }
+ else
+ *t = q; /* first table is returned result */
+ }
+
+ /* set up table entry in r */
+ r.bits = (Byte)(k - w);
+ if (p >= v + n)
+ r.exop = 128 + 64; /* out of values--invalid code */
+ else if (*p < s)
+ {
+ r.exop = (Byte)(*p < 256 ? 0 : 32 + 64); /* 256 is end-of-block */
+ r.base = *p++; /* simple code is just the value */
+ }
+ else
+ {
+ r.exop = (Byte)(e[*p - s] + 16 + 64);/* non-simple--look up in lists */
+ r.base = d[*p++ - s];
+ }
+
+ /* fill code-like entries with r */
+ f = 1 << (k - w);
+ for (j = i >> w; j < z; j += f)
+ q[j] = r;
+
+ /* backwards increment the k-bit code i */
+ for (j = 1 << (k - 1); i & j; j >>= 1)
+ i ^= j;
+ i ^= j;
+
+ /* backup over finished tables */
+ mask = (1 << w) - 1; /* needed on HP, cc -O bug */
+ while ((i & mask) != x[h])
+ {
+ h--; /* don't need to update q */
+ w -= l;
+ mask = (1 << w) - 1;
+ }
+ }
+ }
+
+
+ /* Return Z_BUF_ERROR if we were given an incomplete table */
+ return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK;
+}
+
+
+int inflate_trees_bits(c, bb, tb, hp, z)
+uIntf *c; /* 19 code lengths */
+uIntf *bb; /* bits tree desired/actual depth */
+inflate_huft * FAR *tb; /* bits tree result */
+inflate_huft *hp; /* space for trees */
+z_streamp z; /* for messages */
+{
+ int r;
+ uInt hn = 0; /* hufts used in space */
+ uIntf *v; /* work area for huft_build */
+
+ if ((v = (uIntf*)ZALLOC(z, 19, sizeof(uInt))) == Z_NULL)
+ return Z_MEM_ERROR;
+ r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL,
+ tb, bb, hp, &hn, v);
+ if (r == Z_DATA_ERROR)
+ z->msg = (char*)"oversubscribed dynamic bit lengths tree";
+ else if (r == Z_BUF_ERROR || *bb == 0)
+ {
+ z->msg = (char*)"incomplete dynamic bit lengths tree";
+ r = Z_DATA_ERROR;
+ }
+ ZFREE(z, v);
+ return r;
+}
+
+
+int inflate_trees_dynamic(nl, nd, c, bl, bd, tl, td, hp, z)
+uInt nl; /* number of literal/length codes */
+uInt nd; /* number of distance codes */
+uIntf *c; /* that many (total) code lengths */
+uIntf *bl; /* literal desired/actual bit depth */
+uIntf *bd; /* distance desired/actual bit depth */
+inflate_huft * FAR *tl; /* literal/length tree result */
+inflate_huft * FAR *td; /* distance tree result */
+inflate_huft *hp; /* space for trees */
+z_streamp z; /* for messages */
+{
+ int r;
+ uInt hn = 0; /* hufts used in space */
+ uIntf *v; /* work area for huft_build */
+
+ /* allocate work area */
+ if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
+ return Z_MEM_ERROR;
+
+ /* build literal/length tree */
+ r = huft_build(c, nl, 257, cplens, cplext, tl, bl, hp, &hn, v);
+ if (r != Z_OK || *bl == 0)
+ {
+ if (r == Z_DATA_ERROR)
+ z->msg = (char*)"oversubscribed literal/length tree";
+ else if (r != Z_MEM_ERROR)
+ {
+ z->msg = (char*)"incomplete literal/length tree";
+ r = Z_DATA_ERROR;
+ }
+ ZFREE(z, v);
+ return r;
+ }
+
+ /* build distance tree */
+ r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, hp, &hn, v);
+ if (r != Z_OK || (*bd == 0 && nl > 257))
+ {
+ if (r == Z_DATA_ERROR)
+ z->msg = (char*)"oversubscribed distance tree";
+ else if (r == Z_BUF_ERROR) {
+#ifdef PKZIP_BUG_WORKAROUND
+ r = Z_OK;
+ }
+#else
+ z->msg = (char*)"incomplete distance tree";
+ r = Z_DATA_ERROR;
+ }
+ else if (r != Z_MEM_ERROR)
+ {
+ z->msg = (char*)"empty distance tree with lengths";
+ r = Z_DATA_ERROR;
+ }
+ ZFREE(z, v);
+ return r;
+#endif
+ }
+
+ /* done */
+ ZFREE(z, v);
+ return Z_OK;
+}
+
+
+/* build fixed tables only once--keep them here */
+#ifdef BUILDFIXED
+local int fixed_built = 0;
+#define FIXEDH 544 /* number of hufts used by fixed tables */
+local inflate_huft fixed_mem[FIXEDH];
+local uInt fixed_bl;
+local uInt fixed_bd;
+local inflate_huft *fixed_tl;
+local inflate_huft *fixed_td;
+#else
+#include "inffixed.h"
+#endif
+
+
+int inflate_trees_fixed(bl, bd, tl, td, z)
+uIntf *bl; /* literal desired/actual bit depth */
+uIntf *bd; /* distance desired/actual bit depth */
+inflate_huft * FAR *tl; /* literal/length tree result */
+inflate_huft * FAR *td; /* distance tree result */
+z_streamp z; /* for memory allocation */
+{
+#ifdef BUILDFIXED
+ /* build fixed tables if not already */
+ if (!fixed_built)
+ {
+ int k; /* temporary variable */
+ uInt f = 0; /* number of hufts used in fixed_mem */
+ uIntf *c; /* length list for huft_build */
+ uIntf *v; /* work area for huft_build */
+
+ /* allocate memory */
+ if ((c = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
+ return Z_MEM_ERROR;
+ if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
+ {
+ ZFREE(z, c);
+ return Z_MEM_ERROR;
+ }
+
+ /* literal table */
+ for (k = 0; k < 144; k++)
+ c[k] = 8;
+ for (; k < 256; k++)
+ c[k] = 9;
+ for (; k < 280; k++)
+ c[k] = 7;
+ for (; k < 288; k++)
+ c[k] = 8;
+ fixed_bl = 9;
+ huft_build(c, 288, 257, cplens, cplext, &fixed_tl, &fixed_bl,
+ fixed_mem, &f, v);
+
+ /* distance table */
+ for (k = 0; k < 30; k++)
+ c[k] = 5;
+ fixed_bd = 5;
+ huft_build(c, 30, 0, cpdist, cpdext, &fixed_td, &fixed_bd,
+ fixed_mem, &f, v);
+
+ /* done */
+ ZFREE(z, v);
+ ZFREE(z, c);
+ fixed_built = 1;
+ }
+#endif
+ *bl = fixed_bl;
+ *bd = fixed_bd;
+ *tl = fixed_tl;
+ *td = fixed_td;
+ return Z_OK;
+}
diff --git a/cfe/cfe/zlib/inftrees.h b/cfe/cfe/zlib/inftrees.h
new file mode 100644
index 0000000..85853e0
--- /dev/null
+++ b/cfe/cfe/zlib/inftrees.h
@@ -0,0 +1,58 @@
+/* inftrees.h -- header to use inftrees.c
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+/* Huffman code lookup table entry--this entry is four bytes for machines
+ that have 16-bit pointers (e.g. PC's in the small or medium model). */
+
+typedef struct inflate_huft_s FAR inflate_huft;
+
+struct inflate_huft_s {
+ union {
+ struct {
+ Byte Exop; /* number of extra bits or operation */
+ Byte Bits; /* number of bits in this code or subcode */
+ } what;
+ uInt pad; /* pad structure to a power of 2 (4 bytes for */
+ } word; /* 16-bit, 8 bytes for 32-bit int's) */
+ uInt base; /* literal, length base, distance base,
+ or table offset */
+};
+
+/* Maximum size of dynamic tree. The maximum found in a long but non-
+ exhaustive search was 1004 huft structures (850 for length/literals
+ and 154 for distances, the latter actually the result of an
+ exhaustive search). The actual maximum is not known, but the
+ value below is more than safe. */
+#define MANY 1440
+
+extern int inflate_trees_bits OF((
+ uIntf *, /* 19 code lengths */
+ uIntf *, /* bits tree desired/actual depth */
+ inflate_huft * FAR *, /* bits tree result */
+ inflate_huft *, /* space for trees */
+ z_streamp)); /* for messages */
+
+extern int inflate_trees_dynamic OF((
+ uInt, /* number of literal/length codes */
+ uInt, /* number of distance codes */
+ uIntf *, /* that many (total) code lengths */
+ uIntf *, /* literal desired/actual bit depth */
+ uIntf *, /* distance desired/actual bit depth */
+ inflate_huft * FAR *, /* literal/length tree result */
+ inflate_huft * FAR *, /* distance tree result */
+ inflate_huft *, /* space for trees */
+ z_streamp)); /* for messages */
+
+extern int inflate_trees_fixed OF((
+ uIntf *, /* literal desired/actual bit depth */
+ uIntf *, /* distance desired/actual bit depth */
+ inflate_huft * FAR *, /* literal/length tree result */
+ inflate_huft * FAR *, /* distance tree result */
+ z_streamp)); /* for memory allocation */
diff --git a/cfe/cfe/zlib/infutil.c b/cfe/cfe/zlib/infutil.c
new file mode 100644
index 0000000..824dab5
--- /dev/null
+++ b/cfe/cfe/zlib/infutil.c
@@ -0,0 +1,87 @@
+/* inflate_util.c -- data and routines common to blocks and codes
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "infblock.h"
+#include "inftrees.h"
+#include "infcodes.h"
+#include "infutil.h"
+
+struct inflate_codes_state {int dummy;}; /* for buggy compilers */
+
+/* And'ing with mask[n] masks the lower n bits */
+uInt inflate_mask[17] = {
+ 0x0000,
+ 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
+ 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
+};
+
+
+/* copy as much as possible from the sliding window to the output area */
+int inflate_flush(s, z, r)
+inflate_blocks_statef *s;
+z_streamp z;
+int r;
+{
+ uInt n;
+ Bytef *p;
+ Bytef *q;
+
+ /* local copies of source and destination pointers */
+ p = z->next_out;
+ q = s->read;
+
+ /* compute number of bytes to copy as far as end of window */
+ n = (uInt)((q <= s->write ? s->write : s->end) - q);
+ if (n > z->avail_out) n = z->avail_out;
+ if (n && r == Z_BUF_ERROR) r = Z_OK;
+
+ /* update counters */
+ z->avail_out -= n;
+ z->total_out += n;
+
+ /* update check information */
+ if (s->checkfn != Z_NULL)
+ z->adler = s->check = (*s->checkfn)(s->check, q, n);
+
+ /* copy as far as end of window */
+ zmemcpy(p, q, n);
+ p += n;
+ q += n;
+
+ /* see if more to copy at beginning of window */
+ if (q == s->end)
+ {
+ /* wrap pointers */
+ q = s->window;
+ if (s->write == s->end)
+ s->write = s->window;
+
+ /* compute bytes to copy */
+ n = (uInt)(s->write - q);
+ if (n > z->avail_out) n = z->avail_out;
+ if (n && r == Z_BUF_ERROR) r = Z_OK;
+
+ /* update counters */
+ z->avail_out -= n;
+ z->total_out += n;
+
+ /* update check information */
+ if (s->checkfn != Z_NULL)
+ z->adler = s->check = (*s->checkfn)(s->check, q, n);
+
+ /* copy */
+ zmemcpy(p, q, n);
+ p += n;
+ q += n;
+ }
+
+ /* update pointers */
+ z->next_out = p;
+ s->read = q;
+
+ /* done */
+ return r;
+}
diff --git a/cfe/cfe/zlib/infutil.h b/cfe/cfe/zlib/infutil.h
new file mode 100644
index 0000000..99d1135
--- /dev/null
+++ b/cfe/cfe/zlib/infutil.h
@@ -0,0 +1,98 @@
+/* infutil.h -- types and macros common to blocks and codes
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+#ifndef _INFUTIL_H
+#define _INFUTIL_H
+
+typedef enum {
+ TYPE, /* get type bits (3, including end bit) */
+ LENS, /* get lengths for stored */
+ STORED, /* processing stored block */
+ TABLE, /* get table lengths */
+ BTREE, /* get bit lengths tree for a dynamic block */
+ DTREE, /* get length, distance trees for a dynamic block */
+ CODES, /* processing fixed or dynamic block */
+ DRY, /* output remaining window bytes */
+ DONE, /* finished last block, done */
+ BAD} /* got a data error--stuck here */
+inflate_block_mode;
+
+/* inflate blocks semi-private state */
+struct inflate_blocks_state {
+
+ /* mode */
+ inflate_block_mode mode; /* current inflate_block mode */
+
+ /* mode dependent information */
+ union {
+ uInt left; /* if STORED, bytes left to copy */
+ struct {
+ uInt table; /* table lengths (14 bits) */
+ uInt index; /* index into blens (or border) */
+ uIntf *blens; /* bit lengths of codes */
+ uInt bb; /* bit length tree depth */
+ inflate_huft *tb; /* bit length decoding tree */
+ } trees; /* if DTREE, decoding info for trees */
+ struct {
+ inflate_codes_statef
+ *codes;
+ } decode; /* if CODES, current state */
+ } sub; /* submode */
+ uInt last; /* true if this block is the last block */
+
+ /* mode independent information */
+ uInt bitk; /* bits in bit buffer */
+ uLong bitb; /* bit buffer */
+ inflate_huft *hufts; /* single malloc for tree space */
+ Bytef *window; /* sliding window */
+ Bytef *end; /* one byte after sliding window */
+ Bytef *read; /* window read pointer */
+ Bytef *write; /* window write pointer */
+ check_func checkfn; /* check function */
+ uLong check; /* check on output */
+
+};
+
+
+/* defines for inflate input/output */
+/* update pointers and return */
+#define UPDBITS {s->bitb=b;s->bitk=k;}
+#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;}
+#define UPDOUT {s->write=q;}
+#define UPDATE {UPDBITS UPDIN UPDOUT}
+#define LEAVE {UPDATE return inflate_flush(s,z,r);}
+/* get bytes and bits */
+#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;}
+#define NEEDBYTE {if(n)r=Z_OK;else LEAVE}
+#define NEXTBYTE (n--,*p++)
+#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<<k;k+=8;}}
+#define DUMPBITS(j) {b>>=(j);k-=(j);}
+/* output bytes */
+#define WAVAIL (uInt)(q<s->read?s->read-q-1:s->end-q)
+#define LOADOUT {q=s->write;m=(uInt)WAVAIL;}
+#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}}
+#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT}
+#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;}
+#define OUTBYTE(a) {*q++=(Byte)(a);m--;}
+/* load local pointers */
+#define LOAD {LOADIN LOADOUT}
+
+/* masks for lower bits (size given to avoid silly warnings with Visual C++) */
+extern uInt inflate_mask[17];
+
+/* copy as much as possible from the sliding window to the output area */
+extern int inflate_flush OF((
+ inflate_blocks_statef *,
+ z_streamp ,
+ int));
+
+struct internal_state {int dummy;}; /* for buggy compilers */
+
+#endif
diff --git a/cfe/cfe/zlib/maketree.c b/cfe/cfe/zlib/maketree.c
new file mode 100644
index 0000000..949d786
--- /dev/null
+++ b/cfe/cfe/zlib/maketree.c
@@ -0,0 +1,85 @@
+/* maketree.c -- make inffixed.h table for decoding fixed codes
+ * Copyright (C) 1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+/* This program is included in the distribution for completeness.
+ You do not need to compile or run this program since inffixed.h
+ is already included in the distribution. To use this program
+ you need to compile zlib with BUILDFIXED defined and then compile
+ and link this program with the zlib library. Then the output of
+ this program can be piped to inffixed.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "zutil.h"
+#include "inftrees.h"
+
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+/* generate initialization table for an inflate_huft structure array */
+void maketree(uInt b, inflate_huft *t)
+{
+ int i, e;
+
+ i = 0;
+ while (1)
+ {
+ e = t[i].exop;
+ if (e && (e & (16+64)) == 0) /* table pointer */
+ {
+ fprintf(stderr, "maketree: cannot initialize sub-tables!\n");
+ exit(1);
+ }
+ if (i % 4 == 0)
+ printf("\n ");
+ printf(" {{{%u,%u}},%u}", t[i].exop, t[i].bits, t[i].base);
+ if (++i == (1<<b))
+ break;
+ putchar(',');
+ }
+ puts("");
+}
+
+/* create the fixed tables in C initialization syntax */
+void main(void)
+{
+ int r;
+ uInt bl, bd;
+ inflate_huft *tl, *td;
+ z_stream z;
+
+ z.zalloc = zcalloc;
+ z.opaque = (voidpf)0;
+ z.zfree = zcfree;
+ r = inflate_trees_fixed(&bl, &bd, &tl, &td, &z);
+ if (r)
+ {
+ fprintf(stderr, "inflate_trees_fixed error %d\n", r);
+ return;
+ }
+ puts("/* inffixed.h -- table for decoding fixed codes");
+ puts(" * Generated automatically by the maketree.c program");
+ puts(" */");
+ puts("");
+ puts("/* WARNING: this file should *not* be used by applications. It is");
+ puts(" part of the implementation of the compression library and is");
+ puts(" subject to change. Applications should only use zlib.h.");
+ puts(" */");
+ puts("");
+ printf("local uInt fixed_bl = %d;\n", bl);
+ printf("local uInt fixed_bd = %d;\n", bd);
+ printf("local inflate_huft fixed_tl[] = {");
+ maketree(bl, tl);
+ puts(" };");
+ printf("local inflate_huft fixed_td[] = {");
+ maketree(bd, td);
+ puts(" };");
+}
diff --git a/cfe/cfe/zlib/minigzip.c b/cfe/cfe/zlib/minigzip.c
new file mode 100644
index 0000000..f28ad8d
--- /dev/null
+++ b/cfe/cfe/zlib/minigzip.c
@@ -0,0 +1,320 @@
+/* minigzip.c -- simulate gzip using the zlib compression library
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+ * minigzip is a minimal implementation of the gzip utility. This is
+ * only an example of using zlib and isn't meant to replace the
+ * full-featured gzip. No attempt is made to deal with file systems
+ * limiting names to 14 or 8+3 characters, etc... Error checking is
+ * very limited. So use minigzip only for testing; use gzip for the
+ * real thing. On MSDOS, use only on file names without extension
+ * or in pipe mode.
+ */
+
+/* @(#) $Id: minigzip.c,v 1.1 2001/11/09 01:48:02 mpl Exp $ */
+
+#include <stdio.h>
+#include "zlib.h"
+
+#ifdef STDC
+# include <string.h>
+# include <stdlib.h>
+#else
+ extern void exit OF((int));
+#endif
+
+#ifdef USE_MMAP
+# include <sys/types.h>
+# include <sys/mman.h>
+# include <sys/stat.h>
+#endif
+
+#if defined(MSDOS) || defined(OS2) || defined(WIN32)
+# include <fcntl.h>
+# include <io.h>
+# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
+#else
+# define SET_BINARY_MODE(file)
+#endif
+
+#ifdef VMS
+# define unlink delete
+# define GZ_SUFFIX "-gz"
+#endif
+#ifdef RISCOS
+# define unlink remove
+# define GZ_SUFFIX "-gz"
+# define fileno(file) file->__file
+#endif
+#if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
+# include <unix.h> /* for fileno */
+#endif
+
+#ifndef WIN32 /* unlink already in stdio.h for WIN32 */
+ extern int unlink OF((const char *));
+#endif
+
+#ifndef GZ_SUFFIX
+# define GZ_SUFFIX ".gz"
+#endif
+#define SUFFIX_LEN (sizeof(GZ_SUFFIX)-1)
+
+#define BUFLEN 16384
+#define MAX_NAME_LEN 1024
+
+#ifdef MAXSEG_64K
+# define local static
+ /* Needed for systems with limitation on stack size. */
+#else
+# define local
+#endif
+
+char *prog;
+
+void error OF((const char *msg));
+void gz_compress OF((FILE *in, gzFile out));
+#ifdef USE_MMAP
+int gz_compress_mmap OF((FILE *in, gzFile out));
+#endif
+void gz_uncompress OF((gzFile in, FILE *out));
+void file_compress OF((char *file, char *mode));
+void file_uncompress OF((char *file));
+int main OF((int argc, char *argv[]));
+
+/* ===========================================================================
+ * Display error message and exit
+ */
+void error(msg)
+ const char *msg;
+{
+ fprintf(stderr, "%s: %s\n", prog, msg);
+ exit(1);
+}
+
+/* ===========================================================================
+ * Compress input to output then close both files.
+ */
+
+void gz_compress(in, out)
+ FILE *in;
+ gzFile out;
+{
+ local char buf[BUFLEN];
+ int len;
+ int err;
+
+#ifdef USE_MMAP
+ /* Try first compressing with mmap. If mmap fails (minigzip used in a
+ * pipe), use the normal fread loop.
+ */
+ if (gz_compress_mmap(in, out) == Z_OK) return;
+#endif
+ for (;;) {
+ len = fread(buf, 1, sizeof(buf), in);
+ if (ferror(in)) {
+ perror("fread");
+ exit(1);
+ }
+ if (len == 0) break;
+
+ if (gzwrite(out, buf, (unsigned)len) != len) error(gzerror(out, &err));
+ }
+ fclose(in);
+ if (gzclose(out) != Z_OK) error("failed gzclose");
+}
+
+#ifdef USE_MMAP /* MMAP version, Miguel Albrecht <malbrech@eso.org> */
+
+/* Try compressing the input file at once using mmap. Return Z_OK if
+ * if success, Z_ERRNO otherwise.
+ */
+int gz_compress_mmap(in, out)
+ FILE *in;
+ gzFile out;
+{
+ int len;
+ int err;
+ int ifd = fileno(in);
+ caddr_t buf; /* mmap'ed buffer for the entire input file */
+ off_t buf_len; /* length of the input file */
+ struct stat sb;
+
+ /* Determine the size of the file, needed for mmap: */
+ if (fstat(ifd, &sb) < 0) return Z_ERRNO;
+ buf_len = sb.st_size;
+ if (buf_len <= 0) return Z_ERRNO;
+
+ /* Now do the actual mmap: */
+ buf = mmap((caddr_t) 0, buf_len, PROT_READ, MAP_SHARED, ifd, (off_t)0);
+ if (buf == (caddr_t)(-1)) return Z_ERRNO;
+
+ /* Compress the whole file at once: */
+ len = gzwrite(out, (char *)buf, (unsigned)buf_len);
+
+ if (len != (int)buf_len) error(gzerror(out, &err));
+
+ munmap(buf, buf_len);
+ fclose(in);
+ if (gzclose(out) != Z_OK) error("failed gzclose");
+ return Z_OK;
+}
+#endif /* USE_MMAP */
+
+/* ===========================================================================
+ * Uncompress input to output then close both files.
+ */
+void gz_uncompress(in, out)
+ gzFile in;
+ FILE *out;
+{
+ local char buf[BUFLEN];
+ int len;
+ int err;
+
+ for (;;) {
+ len = gzread(in, buf, sizeof(buf));
+ if (len < 0) error (gzerror(in, &err));
+ if (len == 0) break;
+
+ if ((int)fwrite(buf, 1, (unsigned)len, out) != len) {
+ error("failed fwrite");
+ }
+ }
+ if (fclose(out)) error("failed fclose");
+
+ if (gzclose(in) != Z_OK) error("failed gzclose");
+}
+
+
+/* ===========================================================================
+ * Compress the given file: create a corresponding .gz file and remove the
+ * original.
+ */
+void file_compress(file, mode)
+ char *file;
+ char *mode;
+{
+ local char outfile[MAX_NAME_LEN];
+ FILE *in;
+ gzFile out;
+
+ strcpy(outfile, file);
+ strcat(outfile, GZ_SUFFIX);
+
+ in = fopen(file, "rb");
+ if (in == NULL) {
+ perror(file);
+ exit(1);
+ }
+ out = gzopen(outfile, mode);
+ if (out == NULL) {
+ fprintf(stderr, "%s: can't gzopen %s\n", prog, outfile);
+ exit(1);
+ }
+ gz_compress(in, out);
+
+ unlink(file);
+}
+
+
+/* ===========================================================================
+ * Uncompress the given file and remove the original.
+ */
+void file_uncompress(file)
+ char *file;
+{
+ local char buf[MAX_NAME_LEN];
+ char *infile, *outfile;
+ FILE *out;
+ gzFile in;
+ int len = strlen(file);
+
+ strcpy(buf, file);
+
+ if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) {
+ infile = file;
+ outfile = buf;
+ outfile[len-3] = '\0';
+ } else {
+ outfile = file;
+ infile = buf;
+ strcat(infile, GZ_SUFFIX);
+ }
+ in = gzopen(infile, "rb");
+ if (in == NULL) {
+ fprintf(stderr, "%s: can't gzopen %s\n", prog, infile);
+ exit(1);
+ }
+ out = fopen(outfile, "wb");
+ if (out == NULL) {
+ perror(file);
+ exit(1);
+ }
+
+ gz_uncompress(in, out);
+
+ unlink(infile);
+}
+
+
+/* ===========================================================================
+ * Usage: minigzip [-d] [-f] [-h] [-1 to -9] [files...]
+ * -d : decompress
+ * -f : compress with Z_FILTERED
+ * -h : compress with Z_HUFFMAN_ONLY
+ * -1 to -9 : compression level
+ */
+
+int main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int uncompr = 0;
+ gzFile file;
+ char outmode[20];
+
+ strcpy(outmode, "wb6 ");
+
+ prog = argv[0];
+ argc--, argv++;
+
+ while (argc > 0) {
+ if (strcmp(*argv, "-d") == 0)
+ uncompr = 1;
+ else if (strcmp(*argv, "-f") == 0)
+ outmode[3] = 'f';
+ else if (strcmp(*argv, "-h") == 0)
+ outmode[3] = 'h';
+ else if ((*argv)[0] == '-' && (*argv)[1] >= '1' && (*argv)[1] <= '9' &&
+ (*argv)[2] == 0)
+ outmode[2] = (*argv)[1];
+ else
+ break;
+ argc--, argv++;
+ }
+ if (argc == 0) {
+ SET_BINARY_MODE(stdin);
+ SET_BINARY_MODE(stdout);
+ if (uncompr) {
+ file = gzdopen(fileno(stdin), "rb");
+ if (file == NULL) error("can't gzdopen stdin");
+ gz_uncompress(file, stdout);
+ } else {
+ file = gzdopen(fileno(stdout), outmode);
+ if (file == NULL) error("can't gzdopen stdout");
+ gz_compress(stdin, file);
+ }
+ } else {
+ do {
+ if (uncompr) {
+ file_uncompress(*argv);
+ } else {
+ file_compress(*argv, outmode);
+ }
+ } while (argv++, --argc);
+ }
+ exit(0);
+ return 0; /* to avoid warning */
+}
diff --git a/cfe/cfe/zlib/trees.c b/cfe/cfe/zlib/trees.c
new file mode 100644
index 0000000..b37335b
--- /dev/null
+++ b/cfe/cfe/zlib/trees.c
@@ -0,0 +1,1214 @@
+/* trees.c -- output deflated data using Huffman coding
+ * Copyright (C) 1995-1998 Jean-loup Gailly
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+ * ALGORITHM
+ *
+ * The "deflation" process uses several Huffman trees. The more
+ * common source values are represented by shorter bit sequences.
+ *
+ * Each code tree is stored in a compressed form which is itself
+ * a Huffman encoding of the lengths of all the code strings (in
+ * ascending order by source values). The actual code strings are
+ * reconstructed from the lengths in the inflate process, as described
+ * in the deflate specification.
+ *
+ * REFERENCES
+ *
+ * Deutsch, L.P.,"'Deflate' Compressed Data Format Specification".
+ * Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc
+ *
+ * Storer, James A.
+ * Data Compression: Methods and Theory, pp. 49-50.
+ * Computer Science Press, 1988. ISBN 0-7167-8156-5.
+ *
+ * Sedgewick, R.
+ * Algorithms, p290.
+ * Addison-Wesley, 1983. ISBN 0-201-06672-6.
+ */
+
+/* @(#) $Id: trees.c,v 1.1 2001/11/09 01:48:02 mpl Exp $ */
+
+/* #define GEN_TREES_H */
+
+#include "deflate.h"
+
+#ifdef DEBUG
+# include <ctype.h>
+#endif
+
+/* ===========================================================================
+ * Constants
+ */
+
+#define MAX_BL_BITS 7
+/* Bit length codes must not exceed MAX_BL_BITS bits */
+
+#define END_BLOCK 256
+/* end of block literal code */
+
+#define REP_3_6 16
+/* repeat previous bit length 3-6 times (2 bits of repeat count) */
+
+#define REPZ_3_10 17
+/* repeat a zero length 3-10 times (3 bits of repeat count) */
+
+#define REPZ_11_138 18
+/* repeat a zero length 11-138 times (7 bits of repeat count) */
+
+local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */
+ = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};
+
+local const int extra_dbits[D_CODES] /* extra bits for each distance code */
+ = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
+
+local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */
+ = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};
+
+local const uch bl_order[BL_CODES]
+ = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
+/* The lengths of the bit length codes are sent in order of decreasing
+ * probability, to avoid transmitting the lengths for unused bit length codes.
+ */
+
+#define Buf_size (8 * 2*sizeof(char))
+/* Number of bits used within bi_buf. (bi_buf might be implemented on
+ * more than 16 bits on some systems.)
+ */
+
+/* ===========================================================================
+ * Local data. These are initialized only once.
+ */
+
+#define DIST_CODE_LEN 512 /* see definition of array dist_code below */
+
+#if defined(GEN_TREES_H) || !defined(STDC)
+/* non ANSI compilers may not accept trees.h */
+
+local ct_data static_ltree[L_CODES+2];
+/* The static literal tree. Since the bit lengths are imposed, there is no
+ * need for the L_CODES extra codes used during heap construction. However
+ * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
+ * below).
+ */
+
+local ct_data static_dtree[D_CODES];
+/* The static distance tree. (Actually a trivial tree since all codes use
+ * 5 bits.)
+ */
+
+uch _dist_code[DIST_CODE_LEN];
+/* Distance codes. The first 256 values correspond to the distances
+ * 3 .. 258, the last 256 values correspond to the top 8 bits of
+ * the 15 bit distances.
+ */
+
+uch _length_code[MAX_MATCH-MIN_MATCH+1];
+/* length code for each normalized match length (0 == MIN_MATCH) */
+
+local int base_length[LENGTH_CODES];
+/* First normalized length for each code (0 = MIN_MATCH) */
+
+local int base_dist[D_CODES];
+/* First normalized distance for each code (0 = distance of 1) */
+
+#else
+# include "trees.h"
+#endif /* GEN_TREES_H */
+
+struct static_tree_desc_s {
+ const ct_data *static_tree; /* static tree or NULL */
+ const intf *extra_bits; /* extra bits for each code or NULL */
+ int extra_base; /* base index for extra_bits */
+ int elems; /* max number of elements in the tree */
+ int max_length; /* max bit length for the codes */
+};
+
+local static_tree_desc static_l_desc =
+{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS};
+
+local static_tree_desc static_d_desc =
+{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS};
+
+local static_tree_desc static_bl_desc =
+{(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS};
+
+/* ===========================================================================
+ * Local (static) routines in this file.
+ */
+
+local void tr_static_init OF((void));
+local void init_block OF((deflate_state *s));
+local void pqdownheap OF((deflate_state *s, ct_data *tree, int k));
+local void gen_bitlen OF((deflate_state *s, tree_desc *desc));
+local void gen_codes OF((ct_data *tree, int max_code, ushf *bl_count));
+local void build_tree OF((deflate_state *s, tree_desc *desc));
+local void scan_tree OF((deflate_state *s, ct_data *tree, int max_code));
+local void send_tree OF((deflate_state *s, ct_data *tree, int max_code));
+local int build_bl_tree OF((deflate_state *s));
+local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes,
+ int blcodes));
+local void compress_block OF((deflate_state *s, ct_data *ltree,
+ ct_data *dtree));
+local void set_data_type OF((deflate_state *s));
+local unsigned bi_reverse OF((unsigned value, int length));
+local void bi_windup OF((deflate_state *s));
+local void bi_flush OF((deflate_state *s));
+local void copy_block OF((deflate_state *s, charf *buf, unsigned len,
+ int header));
+
+#ifdef GEN_TREES_H
+local void gen_trees_header OF((void));
+#endif
+
+#ifndef DEBUG
+# define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
+ /* Send a code of the given tree. c and tree must not have side effects */
+
+#else /* DEBUG */
+# define send_code(s, c, tree) \
+ { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \
+ send_bits(s, tree[c].Code, tree[c].Len); }
+#endif
+
+/* ===========================================================================
+ * Output a short LSB first on the stream.
+ * IN assertion: there is enough room in pendingBuf.
+ */
+#define put_short(s, w) { \
+ put_byte(s, (uch)((w) & 0xff)); \
+ put_byte(s, (uch)((ush)(w) >> 8)); \
+}
+
+/* ===========================================================================
+ * Send a value on a given number of bits.
+ * IN assertion: length <= 16 and value fits in length bits.
+ */
+#ifdef DEBUG
+local void send_bits OF((deflate_state *s, int value, int length));
+
+local void send_bits(s, value, length)
+ deflate_state *s;
+ int value; /* value to send */
+ int length; /* number of bits */
+{
+ Tracevv((stderr," l %2d v %4x ", length, value));
+ Assert(length > 0 && length <= 15, "invalid length");
+ s->bits_sent += (ulg)length;
+
+ /* If not enough room in bi_buf, use (valid) bits from bi_buf and
+ * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))
+ * unused bits in value.
+ */
+ if (s->bi_valid > (int)Buf_size - length) {
+ s->bi_buf |= (value << s->bi_valid);
+ put_short(s, s->bi_buf);
+ s->bi_buf = (ush)value >> (Buf_size - s->bi_valid);
+ s->bi_valid += length - Buf_size;
+ } else {
+ s->bi_buf |= value << s->bi_valid;
+ s->bi_valid += length;
+ }
+}
+#else /* !DEBUG */
+
+#define send_bits(s, value, length) \
+{ int len = length;\
+ if (s->bi_valid > (int)Buf_size - len) {\
+ int val = value;\
+ s->bi_buf |= (val << s->bi_valid);\
+ put_short(s, s->bi_buf);\
+ s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
+ s->bi_valid += len - Buf_size;\
+ } else {\
+ s->bi_buf |= (value) << s->bi_valid;\
+ s->bi_valid += len;\
+ }\
+}
+#endif /* DEBUG */
+
+
+#define MAX(a,b) (a >= b ? a : b)
+/* the arguments must not have side effects */
+
+/* ===========================================================================
+ * Initialize the various 'constant' tables.
+ */
+local void tr_static_init()
+{
+#if defined(GEN_TREES_H) || !defined(STDC)
+ static int static_init_done = 0;
+ int n; /* iterates over tree elements */
+ int bits; /* bit counter */
+ int length; /* length value */
+ int code; /* code value */
+ int dist; /* distance index */
+ ush bl_count[MAX_BITS+1];
+ /* number of codes at each bit length for an optimal tree */
+
+ if (static_init_done) return;
+
+ /* For some embedded targets, global variables are not initialized: */
+ static_l_desc.static_tree = static_ltree;
+ static_l_desc.extra_bits = extra_lbits;
+ static_d_desc.static_tree = static_dtree;
+ static_d_desc.extra_bits = extra_dbits;
+ static_bl_desc.extra_bits = extra_blbits;
+
+ /* Initialize the mapping length (0..255) -> length code (0..28) */
+ length = 0;
+ for (code = 0; code < LENGTH_CODES-1; code++) {
+ base_length[code] = length;
+ for (n = 0; n < (1<<extra_lbits[code]); n++) {
+ _length_code[length++] = (uch)code;
+ }
+ }
+ Assert (length == 256, "tr_static_init: length != 256");
+ /* Note that the length 255 (match length 258) can be represented
+ * in two different ways: code 284 + 5 bits or code 285, so we
+ * overwrite length_code[255] to use the best encoding:
+ */
+ _length_code[length-1] = (uch)code;
+
+ /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
+ dist = 0;
+ for (code = 0 ; code < 16; code++) {
+ base_dist[code] = dist;
+ for (n = 0; n < (1<<extra_dbits[code]); n++) {
+ _dist_code[dist++] = (uch)code;
+ }
+ }
+ Assert (dist == 256, "tr_static_init: dist != 256");
+ dist >>= 7; /* from now on, all distances are divided by 128 */
+ for ( ; code < D_CODES; code++) {
+ base_dist[code] = dist << 7;
+ for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
+ _dist_code[256 + dist++] = (uch)code;
+ }
+ }
+ Assert (dist == 256, "tr_static_init: 256+dist != 512");
+
+ /* Construct the codes of the static literal tree */
+ for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
+ n = 0;
+ while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++;
+ while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++;
+ while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++;
+ while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++;
+ /* Codes 286 and 287 do not exist, but we must include them in the
+ * tree construction to get a canonical Huffman tree (longest code
+ * all ones)
+ */
+ gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count);
+
+ /* The static distance tree is trivial: */
+ for (n = 0; n < D_CODES; n++) {
+ static_dtree[n].Len = 5;
+ static_dtree[n].Code = bi_reverse((unsigned)n, 5);
+ }
+ static_init_done = 1;
+
+# ifdef GEN_TREES_H
+ gen_trees_header();
+# endif
+#endif /* defined(GEN_TREES_H) || !defined(STDC) */
+}
+
+/* ===========================================================================
+ * Genererate the file trees.h describing the static trees.
+ */
+#ifdef GEN_TREES_H
+# ifndef DEBUG
+# include <stdio.h>
+# endif
+
+# define SEPARATOR(i, last, width) \
+ ((i) == (last)? "\n};\n\n" : \
+ ((i) % (width) == (width)-1 ? ",\n" : ", "))
+
+void gen_trees_header()
+{
+ FILE *header = fopen("trees.h", "w");
+ int i;
+
+ Assert (header != NULL, "Can't open trees.h");
+ fprintf(header,
+ "/* header created automatically with -DGEN_TREES_H */\n\n");
+
+ fprintf(header, "local const ct_data static_ltree[L_CODES+2] = {\n");
+ for (i = 0; i < L_CODES+2; i++) {
+ fprintf(header, "{{%3u},{%3u}}%s", static_ltree[i].Code,
+ static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5));
+ }
+
+ fprintf(header, "local const ct_data static_dtree[D_CODES] = {\n");
+ for (i = 0; i < D_CODES; i++) {
+ fprintf(header, "{{%2u},{%2u}}%s", static_dtree[i].Code,
+ static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5));
+ }
+
+ fprintf(header, "const uch _dist_code[DIST_CODE_LEN] = {\n");
+ for (i = 0; i < DIST_CODE_LEN; i++) {
+ fprintf(header, "%2u%s", _dist_code[i],
+ SEPARATOR(i, DIST_CODE_LEN-1, 20));
+ }
+
+ fprintf(header, "const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
+ for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) {
+ fprintf(header, "%2u%s", _length_code[i],
+ SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20));
+ }
+
+ fprintf(header, "local const int base_length[LENGTH_CODES] = {\n");
+ for (i = 0; i < LENGTH_CODES; i++) {
+ fprintf(header, "%1u%s", base_length[i],
+ SEPARATOR(i, LENGTH_CODES-1, 20));
+ }
+
+ fprintf(header, "local const int base_dist[D_CODES] = {\n");
+ for (i = 0; i < D_CODES; i++) {
+ fprintf(header, "%5u%s", base_dist[i],
+ SEPARATOR(i, D_CODES-1, 10));
+ }
+
+ fclose(header);
+}
+#endif /* GEN_TREES_H */
+
+/* ===========================================================================
+ * Initialize the tree data structures for a new zlib stream.
+ */
+void _tr_init(s)
+ deflate_state *s;
+{
+ tr_static_init();
+
+ s->l_desc.dyn_tree = s->dyn_ltree;
+ s->l_desc.stat_desc = &static_l_desc;
+
+ s->d_desc.dyn_tree = s->dyn_dtree;
+ s->d_desc.stat_desc = &static_d_desc;
+
+ s->bl_desc.dyn_tree = s->bl_tree;
+ s->bl_desc.stat_desc = &static_bl_desc;
+
+ s->bi_buf = 0;
+ s->bi_valid = 0;
+ s->last_eob_len = 8; /* enough lookahead for inflate */
+#ifdef DEBUG
+ s->compressed_len = 0L;
+ s->bits_sent = 0L;
+#endif
+
+ /* Initialize the first block of the first file: */
+ init_block(s);
+}
+
+/* ===========================================================================
+ * Initialize a new block.
+ */
+local void init_block(s)
+ deflate_state *s;
+{
+ int n; /* iterates over tree elements */
+
+ /* Initialize the trees. */
+ for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0;
+ for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0;
+ for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
+
+ s->dyn_ltree[END_BLOCK].Freq = 1;
+ s->opt_len = s->static_len = 0L;
+ s->last_lit = s->matches = 0;
+}
+
+#define SMALLEST 1
+/* Index within the heap array of least frequent node in the Huffman tree */
+
+
+/* ===========================================================================
+ * Remove the smallest element from the heap and recreate the heap with
+ * one less element. Updates heap and heap_len.
+ */
+#define pqremove(s, tree, top) \
+{\
+ top = s->heap[SMALLEST]; \
+ s->heap[SMALLEST] = s->heap[s->heap_len--]; \
+ pqdownheap(s, tree, SMALLEST); \
+}
+
+/* ===========================================================================
+ * Compares to subtrees, using the tree depth as tie breaker when
+ * the subtrees have equal frequency. This minimizes the worst case length.
+ */
+#define smaller(tree, n, m, depth) \
+ (tree[n].Freq < tree[m].Freq || \
+ (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
+
+/* ===========================================================================
+ * Restore the heap property by moving down the tree starting at node k,
+ * exchanging a node with the smallest of its two sons if necessary, stopping
+ * when the heap property is re-established (each father smaller than its
+ * two sons).
+ */
+local void pqdownheap(s, tree, k)
+ deflate_state *s;
+ ct_data *tree; /* the tree to restore */
+ int k; /* node to move down */
+{
+ int v = s->heap[k];
+ int j = k << 1; /* left son of k */
+ while (j <= s->heap_len) {
+ /* Set j to the smallest of the two sons: */
+ if (j < s->heap_len &&
+ smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
+ j++;
+ }
+ /* Exit if v is smaller than both sons */
+ if (smaller(tree, v, s->heap[j], s->depth)) break;
+
+ /* Exchange v with the smallest son */
+ s->heap[k] = s->heap[j]; k = j;
+
+ /* And continue down the tree, setting j to the left son of k */
+ j <<= 1;
+ }
+ s->heap[k] = v;
+}
+
+/* ===========================================================================
+ * Compute the optimal bit lengths for a tree and update the total bit length
+ * for the current block.
+ * IN assertion: the fields freq and dad are set, heap[heap_max] and
+ * above are the tree nodes sorted by increasing frequency.
+ * OUT assertions: the field len is set to the optimal bit length, the
+ * array bl_count contains the frequencies for each bit length.
+ * The length opt_len is updated; static_len is also updated if stree is
+ * not null.
+ */
+local void gen_bitlen(s, desc)
+ deflate_state *s;
+ tree_desc *desc; /* the tree descriptor */
+{
+ ct_data *tree = desc->dyn_tree;
+ int max_code = desc->max_code;
+ const ct_data *stree = desc->stat_desc->static_tree;
+ const intf *extra = desc->stat_desc->extra_bits;
+ int base = desc->stat_desc->extra_base;
+ int max_length = desc->stat_desc->max_length;
+ int h; /* heap index */
+ int n, m; /* iterate over the tree elements */
+ int bits; /* bit length */
+ int xbits; /* extra bits */
+ ush f; /* frequency */
+ int overflow = 0; /* number of elements with bit length too large */
+
+ for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
+
+ /* In a first pass, compute the optimal bit lengths (which may
+ * overflow in the case of the bit length tree).
+ */
+ tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
+
+ for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
+ n = s->heap[h];
+ bits = tree[tree[n].Dad].Len + 1;
+ if (bits > max_length) bits = max_length, overflow++;
+ tree[n].Len = (ush)bits;
+ /* We overwrite tree[n].Dad which is no longer needed */
+
+ if (n > max_code) continue; /* not a leaf node */
+
+ s->bl_count[bits]++;
+ xbits = 0;
+ if (n >= base) xbits = extra[n-base];
+ f = tree[n].Freq;
+ s->opt_len += (ulg)f * (bits + xbits);
+ if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits);
+ }
+ if (overflow == 0) return;
+
+ Trace((stderr,"\nbit length overflow\n"));
+ /* This happens for example on obj2 and pic of the Calgary corpus */
+
+ /* Find the first bit length which could increase: */
+ do {
+ bits = max_length-1;
+ while (s->bl_count[bits] == 0) bits--;
+ s->bl_count[bits]--; /* move one leaf down the tree */
+ s->bl_count[bits+1] += 2; /* move one overflow item as its brother */
+ s->bl_count[max_length]--;
+ /* The brother of the overflow item also moves one step up,
+ * but this does not affect bl_count[max_length]
+ */
+ overflow -= 2;
+ } while (overflow > 0);
+
+ /* Now recompute all bit lengths, scanning in increasing frequency.
+ * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
+ * lengths instead of fixing only the wrong ones. This idea is taken
+ * from 'ar' written by Haruhiko Okumura.)
+ */
+ for (bits = max_length; bits != 0; bits--) {
+ n = s->bl_count[bits];
+ while (n != 0) {
+ m = s->heap[--h];
+ if (m > max_code) continue;
+ if (tree[m].Len != (unsigned) bits) {
+ Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
+ s->opt_len += ((long)bits - (long)tree[m].Len)
+ *(long)tree[m].Freq;
+ tree[m].Len = (ush)bits;
+ }
+ n--;
+ }
+ }
+}
+
+/* ===========================================================================
+ * Generate the codes for a given tree and bit counts (which need not be
+ * optimal).
+ * IN assertion: the array bl_count contains the bit length statistics for
+ * the given tree and the field len is set for all tree elements.
+ * OUT assertion: the field code is set for all tree elements of non
+ * zero code length.
+ */
+local void gen_codes (tree, max_code, bl_count)
+ ct_data *tree; /* the tree to decorate */
+ int max_code; /* largest code with non zero frequency */
+ ushf *bl_count; /* number of codes at each bit length */
+{
+ ush next_code[MAX_BITS+1]; /* next code value for each bit length */
+ ush code = 0; /* running code value */
+ int bits; /* bit index */
+ int n; /* code index */
+
+ /* The distribution counts are first used to generate the code values
+ * without bit reversal.
+ */
+ for (bits = 1; bits <= MAX_BITS; bits++) {
+ next_code[bits] = code = (code + bl_count[bits-1]) << 1;
+ }
+ /* Check that the bit counts in bl_count are consistent. The last code
+ * must be all ones.
+ */
+ Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
+ "inconsistent bit counts");
+ Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
+
+ for (n = 0; n <= max_code; n++) {
+ int len = tree[n].Len;
+ if (len == 0) continue;
+ /* Now reverse the bits */
+ tree[n].Code = bi_reverse(next_code[len]++, len);
+
+ Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
+ n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
+ }
+}
+
+/* ===========================================================================
+ * Construct one Huffman tree and assigns the code bit strings and lengths.
+ * Update the total bit length for the current block.
+ * IN assertion: the field freq is set for all tree elements.
+ * OUT assertions: the fields len and code are set to the optimal bit length
+ * and corresponding code. The length opt_len is updated; static_len is
+ * also updated if stree is not null. The field max_code is set.
+ */
+local void build_tree(s, desc)
+ deflate_state *s;
+ tree_desc *desc; /* the tree descriptor */
+{
+ ct_data *tree = desc->dyn_tree;
+ const ct_data *stree = desc->stat_desc->static_tree;
+ int elems = desc->stat_desc->elems;
+ int n, m; /* iterate over heap elements */
+ int max_code = -1; /* largest code with non zero frequency */
+ int node; /* new node being created */
+
+ /* Construct the initial heap, with least frequent element in
+ * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
+ * heap[0] is not used.
+ */
+ s->heap_len = 0, s->heap_max = HEAP_SIZE;
+
+ for (n = 0; n < elems; n++) {
+ if (tree[n].Freq != 0) {
+ s->heap[++(s->heap_len)] = max_code = n;
+ s->depth[n] = 0;
+ } else {
+ tree[n].Len = 0;
+ }
+ }
+
+ /* The pkzip format requires that at least one distance code exists,
+ * and that at least one bit should be sent even if there is only one
+ * possible code. So to avoid special checks later on we force at least
+ * two codes of non zero frequency.
+ */
+ while (s->heap_len < 2) {
+ node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
+ tree[node].Freq = 1;
+ s->depth[node] = 0;
+ s->opt_len--; if (stree) s->static_len -= stree[node].Len;
+ /* node is 0 or 1 so it does not have extra bits */
+ }
+ desc->max_code = max_code;
+
+ /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
+ * establish sub-heaps of increasing lengths:
+ */
+ for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
+
+ /* Construct the Huffman tree by repeatedly combining the least two
+ * frequent nodes.
+ */
+ node = elems; /* next internal node of the tree */
+ do {
+ pqremove(s, tree, n); /* n = node of least frequency */
+ m = s->heap[SMALLEST]; /* m = node of next least frequency */
+
+ s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
+ s->heap[--(s->heap_max)] = m;
+
+ /* Create a new node father of n and m */
+ tree[node].Freq = tree[n].Freq + tree[m].Freq;
+ s->depth[node] = (uch) (MAX(s->depth[n], s->depth[m]) + 1);
+ tree[n].Dad = tree[m].Dad = (ush)node;
+#ifdef DUMP_BL_TREE
+ if (tree == s->bl_tree) {
+ fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)",
+ node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq);
+ }
+#endif
+ /* and insert the new node in the heap */
+ s->heap[SMALLEST] = node++;
+ pqdownheap(s, tree, SMALLEST);
+
+ } while (s->heap_len >= 2);
+
+ s->heap[--(s->heap_max)] = s->heap[SMALLEST];
+
+ /* At this point, the fields freq and dad are set. We can now
+ * generate the bit lengths.
+ */
+ gen_bitlen(s, (tree_desc *)desc);
+
+ /* The field len is now set, we can generate the bit codes */
+ gen_codes ((ct_data *)tree, max_code, s->bl_count);
+}
+
+/* ===========================================================================
+ * Scan a literal or distance tree to determine the frequencies of the codes
+ * in the bit length tree.
+ */
+local void scan_tree (s, tree, max_code)
+ deflate_state *s;
+ ct_data *tree; /* the tree to be scanned */
+ int max_code; /* and its largest code of non zero frequency */
+{
+ int n; /* iterates over all tree elements */
+ int prevlen = -1; /* last emitted length */
+ int curlen; /* length of current code */
+ int nextlen = tree[0].Len; /* length of next code */
+ int count = 0; /* repeat count of the current code */
+ int max_count = 7; /* max repeat count */
+ int min_count = 4; /* min repeat count */
+
+ if (nextlen == 0) max_count = 138, min_count = 3;
+ tree[max_code+1].Len = (ush)0xffff; /* guard */
+
+ for (n = 0; n <= max_code; n++) {
+ curlen = nextlen; nextlen = tree[n+1].Len;
+ if (++count < max_count && curlen == nextlen) {
+ continue;
+ } else if (count < min_count) {
+ s->bl_tree[curlen].Freq += count;
+ } else if (curlen != 0) {
+ if (curlen != prevlen) s->bl_tree[curlen].Freq++;
+ s->bl_tree[REP_3_6].Freq++;
+ } else if (count <= 10) {
+ s->bl_tree[REPZ_3_10].Freq++;
+ } else {
+ s->bl_tree[REPZ_11_138].Freq++;
+ }
+ count = 0; prevlen = curlen;
+ if (nextlen == 0) {
+ max_count = 138, min_count = 3;
+ } else if (curlen == nextlen) {
+ max_count = 6, min_count = 3;
+ } else {
+ max_count = 7, min_count = 4;
+ }
+ }
+}
+
+/* ===========================================================================
+ * Send a literal or distance tree in compressed form, using the codes in
+ * bl_tree.
+ */
+local void send_tree (s, tree, max_code)
+ deflate_state *s;
+ ct_data *tree; /* the tree to be scanned */
+ int max_code; /* and its largest code of non zero frequency */
+{
+ int n; /* iterates over all tree elements */
+ int prevlen = -1; /* last emitted length */
+ int curlen; /* length of current code */
+ int nextlen = tree[0].Len; /* length of next code */
+ int count = 0; /* repeat count of the current code */
+ int max_count = 7; /* max repeat count */
+ int min_count = 4; /* min repeat count */
+
+ /* tree[max_code+1].Len = -1; */ /* guard already set */
+ if (nextlen == 0) max_count = 138, min_count = 3;
+
+ for (n = 0; n <= max_code; n++) {
+ curlen = nextlen; nextlen = tree[n+1].Len;
+ if (++count < max_count && curlen == nextlen) {
+ continue;
+ } else if (count < min_count) {
+ do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
+
+ } else if (curlen != 0) {
+ if (curlen != prevlen) {
+ send_code(s, curlen, s->bl_tree); count--;
+ }
+ Assert(count >= 3 && count <= 6, " 3_6?");
+ send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2);
+
+ } else if (count <= 10) {
+ send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3);
+
+ } else {
+ send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7);
+ }
+ count = 0; prevlen = curlen;
+ if (nextlen == 0) {
+ max_count = 138, min_count = 3;
+ } else if (curlen == nextlen) {
+ max_count = 6, min_count = 3;
+ } else {
+ max_count = 7, min_count = 4;
+ }
+ }
+}
+
+/* ===========================================================================
+ * Construct the Huffman tree for the bit lengths and return the index in
+ * bl_order of the last bit length code to send.
+ */
+local int build_bl_tree(s)
+ deflate_state *s;
+{
+ int max_blindex; /* index of last bit length code of non zero freq */
+
+ /* Determine the bit length frequencies for literal and distance trees */
+ scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);
+ scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);
+
+ /* Build the bit length tree: */
+ build_tree(s, (tree_desc *)(&(s->bl_desc)));
+ /* opt_len now includes the length of the tree representations, except
+ * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
+ */
+
+ /* Determine the number of bit length codes to send. The pkzip format
+ * requires that at least 4 bit length codes be sent. (appnote.txt says
+ * 3 but the actual value used is 4.)
+ */
+ for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
+ if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
+ }
+ /* Update opt_len to include the bit length tree and counts */
+ s->opt_len += 3*(max_blindex+1) + 5+5+4;
+ Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
+ s->opt_len, s->static_len));
+
+ return max_blindex;
+}
+
+/* ===========================================================================
+ * Send the header for a block using dynamic Huffman trees: the counts, the
+ * lengths of the bit length codes, the literal tree and the distance tree.
+ * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
+ */
+local void send_all_trees(s, lcodes, dcodes, blcodes)
+ deflate_state *s;
+ int lcodes, dcodes, blcodes; /* number of codes for each tree */
+{
+ int rank; /* index in bl_order */
+
+ Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
+ Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
+ "too many codes");
+ Tracev((stderr, "\nbl counts: "));
+ send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */
+ send_bits(s, dcodes-1, 5);
+ send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */
+ for (rank = 0; rank < blcodes; rank++) {
+ Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
+ send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
+ }
+ Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
+
+ send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */
+ Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
+
+ send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */
+ Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
+}
+
+/* ===========================================================================
+ * Send a stored block
+ */
+void _tr_stored_block(s, buf, stored_len, eof)
+ deflate_state *s;
+ charf *buf; /* input block */
+ ulg stored_len; /* length of input block */
+ int eof; /* true if this is the last block for a file */
+{
+ send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */
+#ifdef DEBUG
+ s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
+ s->compressed_len += (stored_len + 4) << 3;
+#endif
+ copy_block(s, buf, (unsigned)stored_len, 1); /* with header */
+}
+
+/* ===========================================================================
+ * Send one empty static block to give enough lookahead for inflate.
+ * This takes 10 bits, of which 7 may remain in the bit buffer.
+ * The current inflate code requires 9 bits of lookahead. If the
+ * last two codes for the previous block (real code plus EOB) were coded
+ * on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode
+ * the last real code. In this case we send two empty static blocks instead
+ * of one. (There are no problems if the previous block is stored or fixed.)
+ * To simplify the code, we assume the worst case of last real code encoded
+ * on one bit only.
+ */
+void _tr_align(s)
+ deflate_state *s;
+{
+ send_bits(s, STATIC_TREES<<1, 3);
+ send_code(s, END_BLOCK, static_ltree);
+#ifdef DEBUG
+ s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
+#endif
+ bi_flush(s);
+ /* Of the 10 bits for the empty block, we have already sent
+ * (10 - bi_valid) bits. The lookahead for the last real code (before
+ * the EOB of the previous block) was thus at least one plus the length
+ * of the EOB plus what we have just sent of the empty static block.
+ */
+ if (1 + s->last_eob_len + 10 - s->bi_valid < 9) {
+ send_bits(s, STATIC_TREES<<1, 3);
+ send_code(s, END_BLOCK, static_ltree);
+#ifdef DEBUG
+ s->compressed_len += 10L;
+#endif
+ bi_flush(s);
+ }
+ s->last_eob_len = 7;
+}
+
+/* ===========================================================================
+ * Determine the best encoding for the current block: dynamic trees, static
+ * trees or store, and output the encoded block to the zip file.
+ */
+void _tr_flush_block(s, buf, stored_len, eof)
+ deflate_state *s;
+ charf *buf; /* input block, or NULL if too old */
+ ulg stored_len; /* length of input block */
+ int eof; /* true if this is the last block for a file */
+{
+ ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
+ int max_blindex = 0; /* index of last bit length code of non zero freq */
+
+ /* Build the Huffman trees unless a stored block is forced */
+ if (s->level > 0) {
+
+ /* Check if the file is ascii or binary */
+ if (s->data_type == Z_UNKNOWN) set_data_type(s);
+
+ /* Construct the literal and distance trees */
+ build_tree(s, (tree_desc *)(&(s->l_desc)));
+ Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
+ s->static_len));
+
+ build_tree(s, (tree_desc *)(&(s->d_desc)));
+ Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
+ s->static_len));
+ /* At this point, opt_len and static_len are the total bit lengths of
+ * the compressed block data, excluding the tree representations.
+ */
+
+ /* Build the bit length tree for the above two trees, and get the index
+ * in bl_order of the last bit length code to send.
+ */
+ max_blindex = build_bl_tree(s);
+
+ /* Determine the best encoding. Compute first the block length in bytes*/
+ opt_lenb = (s->opt_len+3+7)>>3;
+ static_lenb = (s->static_len+3+7)>>3;
+
+ Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
+ opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
+ s->last_lit));
+
+ if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
+
+ } else {
+ Assert(buf != (char*)0, "lost buf");
+ opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
+ }
+
+#ifdef FORCE_STORED
+ if (buf != (char*)0) { /* force stored block */
+#else
+ if (stored_len+4 <= opt_lenb && buf != (char*)0) {
+ /* 4: two words for the lengths */
+#endif
+ /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
+ * Otherwise we can't have processed more than WSIZE input bytes since
+ * the last block flush, because compression would have been
+ * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
+ * transform a block into a stored block.
+ */
+ _tr_stored_block(s, buf, stored_len, eof);
+
+#ifdef FORCE_STATIC
+ } else if (static_lenb >= 0) { /* force static trees */
+#else
+ } else if (static_lenb == opt_lenb) {
+#endif
+ send_bits(s, (STATIC_TREES<<1)+eof, 3);
+ compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree);
+#ifdef DEBUG
+ s->compressed_len += 3 + s->static_len;
+#endif
+ } else {
+ send_bits(s, (DYN_TREES<<1)+eof, 3);
+ send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
+ max_blindex+1);
+ compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree);
+#ifdef DEBUG
+ s->compressed_len += 3 + s->opt_len;
+#endif
+ }
+ Assert (s->compressed_len == s->bits_sent, "bad compressed size");
+ /* The above check is made mod 2^32, for files larger than 512 MB
+ * and uLong implemented on 32 bits.
+ */
+ init_block(s);
+
+ if (eof) {
+ bi_windup(s);
+#ifdef DEBUG
+ s->compressed_len += 7; /* align on byte boundary */
+#endif
+ }
+ Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
+ s->compressed_len-7*eof));
+}
+
+/* ===========================================================================
+ * Save the match info and tally the frequency counts. Return true if
+ * the current block must be flushed.
+ */
+int _tr_tally (s, dist, lc)
+ deflate_state *s;
+ unsigned dist; /* distance of matched string */
+ unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
+{
+ s->d_buf[s->last_lit] = (ush)dist;
+ s->l_buf[s->last_lit++] = (uch)lc;
+ if (dist == 0) {
+ /* lc is the unmatched char */
+ s->dyn_ltree[lc].Freq++;
+ } else {
+ s->matches++;
+ /* Here, lc is the match length - MIN_MATCH */
+ dist--; /* dist = match distance - 1 */
+ Assert((ush)dist < (ush)MAX_DIST(s) &&
+ (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
+ (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
+
+ s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++;
+ s->dyn_dtree[d_code(dist)].Freq++;
+ }
+
+#ifdef TRUNCATE_BLOCK
+ /* Try to guess if it is profitable to stop the current block here */
+ if ((s->last_lit & 0x1fff) == 0 && s->level > 2) {
+ /* Compute an upper bound for the compressed length */
+ ulg out_length = (ulg)s->last_lit*8L;
+ ulg in_length = (ulg)((long)s->strstart - s->block_start);
+ int dcode;
+ for (dcode = 0; dcode < D_CODES; dcode++) {
+ out_length += (ulg)s->dyn_dtree[dcode].Freq *
+ (5L+extra_dbits[dcode]);
+ }
+ out_length >>= 3;
+ Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
+ s->last_lit, in_length, out_length,
+ 100L - out_length*100L/in_length));
+ if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1;
+ }
+#endif
+ return (s->last_lit == s->lit_bufsize-1);
+ /* We avoid equality with lit_bufsize because of wraparound at 64K
+ * on 16 bit machines and because stored blocks are restricted to
+ * 64K-1 bytes.
+ */
+}
+
+/* ===========================================================================
+ * Send the block data compressed using the given Huffman trees
+ */
+local void compress_block(s, ltree, dtree)
+ deflate_state *s;
+ ct_data *ltree; /* literal tree */
+ ct_data *dtree; /* distance tree */
+{
+ unsigned dist; /* distance of matched string */
+ int lc; /* match length or unmatched char (if dist == 0) */
+ unsigned lx = 0; /* running index in l_buf */
+ unsigned code; /* the code to send */
+ int extra; /* number of extra bits to send */
+
+ if (s->last_lit != 0) do {
+ dist = s->d_buf[lx];
+ lc = s->l_buf[lx++];
+ if (dist == 0) {
+ send_code(s, lc, ltree); /* send a literal byte */
+ Tracecv(isgraph(lc), (stderr," '%c' ", lc));
+ } else {
+ /* Here, lc is the match length - MIN_MATCH */
+ code = _length_code[lc];
+ send_code(s, code+LITERALS+1, ltree); /* send the length code */
+ extra = extra_lbits[code];
+ if (extra != 0) {
+ lc -= base_length[code];
+ send_bits(s, lc, extra); /* send the extra length bits */
+ }
+ dist--; /* dist is now the match distance - 1 */
+ code = d_code(dist);
+ Assert (code < D_CODES, "bad d_code");
+
+ send_code(s, code, dtree); /* send the distance code */
+ extra = extra_dbits[code];
+ if (extra != 0) {
+ dist -= base_dist[code];
+ send_bits(s, dist, extra); /* send the extra distance bits */
+ }
+ } /* literal or match pair ? */
+
+ /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
+ Assert(s->pending < s->lit_bufsize + 2*lx, "pendingBuf overflow");
+
+ } while (lx < s->last_lit);
+
+ send_code(s, END_BLOCK, ltree);
+ s->last_eob_len = ltree[END_BLOCK].Len;
+}
+
+/* ===========================================================================
+ * Set the data type to ASCII or BINARY, using a crude approximation:
+ * binary if more than 20% of the bytes are <= 6 or >= 128, ascii otherwise.
+ * IN assertion: the fields freq of dyn_ltree are set and the total of all
+ * frequencies does not exceed 64K (to fit in an int on 16 bit machines).
+ */
+local void set_data_type(s)
+ deflate_state *s;
+{
+ int n = 0;
+ unsigned ascii_freq = 0;
+ unsigned bin_freq = 0;
+ while (n < 7) bin_freq += s->dyn_ltree[n++].Freq;
+ while (n < 128) ascii_freq += s->dyn_ltree[n++].Freq;
+ while (n < LITERALS) bin_freq += s->dyn_ltree[n++].Freq;
+ s->data_type = (Byte)(bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII);
+}
+
+/* ===========================================================================
+ * Reverse the first len bits of a code, using straightforward code (a faster
+ * method would use a table)
+ * IN assertion: 1 <= len <= 15
+ */
+local unsigned bi_reverse(code, len)
+ unsigned code; /* the value to invert */
+ int len; /* its bit length */
+{
+ register unsigned res = 0;
+ do {
+ res |= code & 1;
+ code >>= 1, res <<= 1;
+ } while (--len > 0);
+ return res >> 1;
+}
+
+/* ===========================================================================
+ * Flush the bit buffer, keeping at most 7 bits in it.
+ */
+local void bi_flush(s)
+ deflate_state *s;
+{
+ if (s->bi_valid == 16) {
+ put_short(s, s->bi_buf);
+ s->bi_buf = 0;
+ s->bi_valid = 0;
+ } else if (s->bi_valid >= 8) {
+ put_byte(s, (Byte)s->bi_buf);
+ s->bi_buf >>= 8;
+ s->bi_valid -= 8;
+ }
+}
+
+/* ===========================================================================
+ * Flush the bit buffer and align the output on a byte boundary
+ */
+local void bi_windup(s)
+ deflate_state *s;
+{
+ if (s->bi_valid > 8) {
+ put_short(s, s->bi_buf);
+ } else if (s->bi_valid > 0) {
+ put_byte(s, (Byte)s->bi_buf);
+ }
+ s->bi_buf = 0;
+ s->bi_valid = 0;
+#ifdef DEBUG
+ s->bits_sent = (s->bits_sent+7) & ~7;
+#endif
+}
+
+/* ===========================================================================
+ * Copy a stored block, storing first the length and its
+ * one's complement if requested.
+ */
+local void copy_block(s, buf, len, header)
+ deflate_state *s;
+ charf *buf; /* the input data */
+ unsigned len; /* its length */
+ int header; /* true if block header must be written */
+{
+ bi_windup(s); /* align on byte boundary */
+ s->last_eob_len = 8; /* enough lookahead for inflate */
+
+ if (header) {
+ put_short(s, (ush)len);
+ put_short(s, (ush)~len);
+#ifdef DEBUG
+ s->bits_sent += 2*16;
+#endif
+ }
+#ifdef DEBUG
+ s->bits_sent += (ulg)len<<3;
+#endif
+ while (len--) {
+ put_byte(s, *buf++);
+ }
+}
diff --git a/cfe/cfe/zlib/trees.h b/cfe/cfe/zlib/trees.h
new file mode 100644
index 0000000..72facf9
--- /dev/null
+++ b/cfe/cfe/zlib/trees.h
@@ -0,0 +1,128 @@
+/* header created automatically with -DGEN_TREES_H */
+
+local const ct_data static_ltree[L_CODES+2] = {
+{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}},
+{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}},
+{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}},
+{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}},
+{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}},
+{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}},
+{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}},
+{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}},
+{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}},
+{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}},
+{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}},
+{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}},
+{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}},
+{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}},
+{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}},
+{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}},
+{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}},
+{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}},
+{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}},
+{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}},
+{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}},
+{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}},
+{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}},
+{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}},
+{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}},
+{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}},
+{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}},
+{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}},
+{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}},
+{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}},
+{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}},
+{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}},
+{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}},
+{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}},
+{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}},
+{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}},
+{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}},
+{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}},
+{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}},
+{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}},
+{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}},
+{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}},
+{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}},
+{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}},
+{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}},
+{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}},
+{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}},
+{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}},
+{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}},
+{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}},
+{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}},
+{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}},
+{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}},
+{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}},
+{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}},
+{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}},
+{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}},
+{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}}
+};
+
+local const ct_data static_dtree[D_CODES] = {
+{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}},
+{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}},
+{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}},
+{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}},
+{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}},
+{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
+};
+
+const uch _dist_code[DIST_CODE_LEN] = {
+ 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8,
+ 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10,
+10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,
+13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
+15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17,
+18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
+23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
+27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
+};
+
+const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12,
+13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
+17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
+19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,
+22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
+23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,
+26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28
+};
+
+local const int base_length[LENGTH_CODES] = {
+0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,
+64, 80, 96, 112, 128, 160, 192, 224, 0
+};
+
+local const int base_dist[D_CODES] = {
+ 0, 1, 2, 3, 4, 6, 8, 12, 16, 24,
+ 32, 48, 64, 96, 128, 192, 256, 384, 512, 768,
+ 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576
+};
+
diff --git a/cfe/cfe/zlib/uncompr.c b/cfe/cfe/zlib/uncompr.c
new file mode 100644
index 0000000..eab3f5b
--- /dev/null
+++ b/cfe/cfe/zlib/uncompr.c
@@ -0,0 +1,58 @@
+/* uncompr.c -- decompress a memory buffer
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: uncompr.c,v 1.1 2001/11/09 01:48:02 mpl Exp $ */
+
+#include "zlib.h"
+
+/* ===========================================================================
+ Decompresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total
+ size of the destination buffer, which must be large enough to hold the
+ entire uncompressed data. (The size of the uncompressed data must have
+ been saved previously by the compressor and transmitted to the decompressor
+ by some mechanism outside the scope of this compression library.)
+ Upon exit, destLen is the actual size of the compressed buffer.
+ This function can be used to decompress a whole file at once if the
+ input file is mmap'ed.
+
+ uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer, or Z_DATA_ERROR if the input data was corrupted.
+*/
+int ZEXPORT uncompress (dest, destLen, source, sourceLen)
+ Bytef *dest;
+ uLongf *destLen;
+ const Bytef *source;
+ uLong sourceLen;
+{
+ z_stream stream;
+ int err;
+
+ stream.next_in = (Bytef*)source;
+ stream.avail_in = (uInt)sourceLen;
+ /* Check for source > 64K on 16-bit machine: */
+ if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
+
+ stream.next_out = dest;
+ stream.avail_out = (uInt)*destLen;
+ if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
+
+ stream.zalloc = (alloc_func)0;
+ stream.zfree = (free_func)0;
+
+ err = inflateInit(&stream);
+ if (err != Z_OK) return err;
+
+ err = inflate(&stream, Z_FINISH);
+ if (err != Z_STREAM_END) {
+ inflateEnd(&stream);
+ return err == Z_OK ? Z_BUF_ERROR : err;
+ }
+ *destLen = stream.total_out;
+
+ err = inflateEnd(&stream);
+ return err;
+}
diff --git a/cfe/cfe/zlib/zconf.h b/cfe/cfe/zlib/zconf.h
new file mode 100644
index 0000000..23a52b3
--- /dev/null
+++ b/cfe/cfe/zlib/zconf.h
@@ -0,0 +1,279 @@
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: zconf.h,v 1.1 2001/11/09 01:48:02 mpl Exp $ */
+
+#ifndef _ZCONF_H
+#define _ZCONF_H
+
+/*
+ * If you *really* need a unique prefix for all types and library functions,
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ */
+#ifdef Z_PREFIX
+# define deflateInit_ z_deflateInit_
+# define deflate z_deflate
+# define deflateEnd z_deflateEnd
+# define inflateInit_ z_inflateInit_
+# define inflate z_inflate
+# define inflateEnd z_inflateEnd
+# define deflateInit2_ z_deflateInit2_
+# define deflateSetDictionary z_deflateSetDictionary
+# define deflateCopy z_deflateCopy
+# define deflateReset z_deflateReset
+# define deflateParams z_deflateParams
+# define inflateInit2_ z_inflateInit2_
+# define inflateSetDictionary z_inflateSetDictionary
+# define inflateSync z_inflateSync
+# define inflateSyncPoint z_inflateSyncPoint
+# define inflateReset z_inflateReset
+# define compress z_compress
+# define compress2 z_compress2
+# define uncompress z_uncompress
+# define adler32 z_adler32
+# define crc32 z_crc32
+# define get_crc_table z_get_crc_table
+
+# define Byte z_Byte
+# define uInt z_uInt
+# define uLong z_uLong
+# define Bytef z_Bytef
+# define charf z_charf
+# define intf z_intf
+# define uIntf z_uIntf
+# define uLongf z_uLongf
+# define voidpf z_voidpf
+# define voidp z_voidp
+#endif
+
+#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
+# define WIN32
+#endif
+#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
+# ifndef __32BIT__
+# define __32BIT__
+# endif
+#endif
+#if defined(__MSDOS__) && !defined(MSDOS)
+# define MSDOS
+#endif
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
+#if defined(MSDOS) && !defined(__32BIT__)
+# define MAXSEG_64K
+#endif
+#ifdef MSDOS
+# define UNALIGNED_OK
+#endif
+
+#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
+# define STDC
+#endif
+#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
+# ifndef STDC
+# define STDC
+# endif
+#endif
+
+#ifndef STDC
+# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+# define const
+# endif
+#endif
+
+/* Some Mac compilers merge all .h files incorrectly: */
+#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
+# define NO_DUMMY_DECL
+#endif
+
+/* Old Borland C incorrectly complains about missing returns: */
+#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
+# define NEED_DUMMY_RETURN
+#endif
+
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+# ifdef MAXSEG_64K
+# define MAX_MEM_LEVEL 8
+# else
+# define MAX_MEM_LEVEL 9
+# endif
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+# define MAX_WBITS 15 /* 32K LZ77 window */
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+ (1 << (windowBits+2)) + (1 << (memLevel+9))
+ that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+ make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+ The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ for small objects.
+*/
+
+ /* Type declarations */
+
+#ifndef OF /* function prototypes */
+# if defined(STDC) || defined(_CFE_)
+# define OF(args) args
+# else
+# define OF(args) ()
+# endif
+#endif
+
+/* The following definitions for FAR are needed only for MSDOS mixed
+ * model programming (small or medium model with some far allocations).
+ * This was tested only with MSC; for other MSDOS compilers you may have
+ * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
+ * just define FAR to be empty.
+ */
+#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
+ /* MSC small or medium model */
+# define SMALL_MEDIUM
+# ifdef _MSC_VER
+# define FAR _far
+# else
+# define FAR far
+# endif
+#endif
+#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
+# ifndef __32BIT__
+# define SMALL_MEDIUM
+# define FAR _far
+# endif
+#endif
+
+/* Compile with -DZLIB_DLL for Windows DLL support */
+#if defined(ZLIB_DLL)
+# if defined(_WINDOWS) || defined(WINDOWS)
+# ifdef FAR
+# undef FAR
+# endif
+# include <windows.h>
+# define ZEXPORT WINAPI
+# ifdef WIN32
+# define ZEXPORTVA WINAPIV
+# else
+# define ZEXPORTVA FAR _cdecl _export
+# endif
+# endif
+# if defined (__BORLANDC__)
+# if (__BORLANDC__ >= 0x0500) && defined (WIN32)
+# include <windows.h>
+# define ZEXPORT __declspec(dllexport) WINAPI
+# define ZEXPORTRVA __declspec(dllexport) WINAPIV
+# else
+# if defined (_Windows) && defined (__DLL__)
+# define ZEXPORT _export
+# define ZEXPORTVA _export
+# endif
+# endif
+# endif
+#endif
+
+#if defined (__BEOS__)
+# if defined (ZLIB_DLL)
+# define ZEXTERN extern __declspec(dllexport)
+# else
+# define ZEXTERN extern __declspec(dllimport)
+# endif
+#endif
+
+#ifndef ZEXPORT
+# define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+# define ZEXPORTVA
+#endif
+#ifndef ZEXTERN
+# define ZEXTERN extern
+#endif
+
+#ifndef FAR
+# define FAR
+#endif
+
+#if !defined(MACOS) && !defined(TARGET_OS_MAC)
+typedef unsigned char Byte; /* 8 bits */
+#endif
+typedef unsigned int uInt; /* 16 bits or more */
+typedef unsigned long uLong; /* 32 bits or more */
+
+#ifdef SMALL_MEDIUM
+ /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+# define Bytef Byte FAR
+#else
+ typedef Byte FAR Bytef;
+#endif
+typedef char FAR charf;
+typedef int FAR intf;
+typedef uInt FAR uIntf;
+typedef uLong FAR uLongf;
+
+#ifdef STDC
+ typedef void FAR *voidpf;
+ typedef void *voidp;
+#else
+ typedef Byte FAR *voidpf;
+ typedef Byte *voidp;
+#endif
+
+#ifdef HAVE_UNISTD_H
+# include <sys/types.h> /* for off_t */
+# include <unistd.h> /* for SEEK_* and off_t */
+# define z_off_t off_t
+#endif
+#ifndef SEEK_SET
+# define SEEK_SET 0 /* Seek from beginning of file. */
+# define SEEK_CUR 1 /* Seek from current position. */
+# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
+#endif
+#ifndef z_off_t
+# define z_off_t long
+#endif
+
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+# pragma map(deflateInit_,"DEIN")
+# pragma map(deflateInit2_,"DEIN2")
+# pragma map(deflateEnd,"DEEND")
+# pragma map(inflateInit_,"ININ")
+# pragma map(inflateInit2_,"ININ2")
+# pragma map(inflateEnd,"INEND")
+# pragma map(inflateSync,"INSY")
+# pragma map(inflateSetDictionary,"INSEDI")
+# pragma map(inflate_blocks,"INBL")
+# pragma map(inflate_blocks_new,"INBLNE")
+# pragma map(inflate_blocks_free,"INBLFR")
+# pragma map(inflate_blocks_reset,"INBLRE")
+# pragma map(inflate_codes_free,"INCOFR")
+# pragma map(inflate_codes,"INCO")
+# pragma map(inflate_fast,"INFA")
+# pragma map(inflate_flush,"INFLU")
+# pragma map(inflate_mask,"INMA")
+# pragma map(inflate_set_dictionary,"INSEDI2")
+# pragma map(inflate_copyright,"INCOPY")
+# pragma map(inflate_trees_bits,"INTRBI")
+# pragma map(inflate_trees_dynamic,"INTRDY")
+# pragma map(inflate_trees_fixed,"INTRFI")
+# pragma map(inflate_trees_free,"INTRFR")
+#endif
+
+#endif /* _ZCONF_H */
diff --git a/cfe/cfe/zlib/zlib.3 b/cfe/cfe/zlib/zlib.3
new file mode 100644
index 0000000..25c8495
--- /dev/null
+++ b/cfe/cfe/zlib/zlib.3
@@ -0,0 +1,107 @@
+.TH ZLIB 3 "9 July 1998"
+.SH NAME
+zlib \- compression/decompression library
+.SH SYNOPSIS
+[see
+.I zlib.h
+for full description]
+.SH DESCRIPTION
+The
+.I zlib
+library is a general purpose data compression library.
+The code is thread safe.
+It provides in-memory compression and decompression functions,
+including integrity checks of the uncompressed data.
+This version of the library supports only one compression method (deflation)
+but other algorithms will be added later and will have the same stream interface.
+.LP
+Compression can be done in a single step if the buffers are large enough
+(for example if an input file is mmap'ed),
+or can be done by repeated calls of the compression function.
+In the latter case,
+the application must provide more input and/or consume the output
+(providing more output space) before each call.
+.LP
+The library also supports reading and writing files in
+.I gzip
+(.gz) format
+with an interface similar to that of stdio.
+.LP
+The library does not install any signal handler. The decoder checks
+the consistency of the compressed data, so the library should never
+crash even in case of corrupted input.
+.LP
+All functions of the compression library are documented in the file
+.IR zlib.h.
+The distribution source includes examples of use of the library
+the files
+.I example.c
+and
+.IR minigzip.c .
+.LP
+A Java implementation of
+.IR zlib
+is available in the Java Development Kit 1.1
+.IP
+http://www.javasoft.com/products/JDK/1.1/docs/api/Package-java.util.zip.html
+.LP
+A Perl interface to
+.IR zlib ,
+written by Paul Marquess (pmarquess@bfsec.bt.co.uk)
+is available at CPAN (Comprehensive Perl Archive Network) sites,
+such as:
+.IP
+ftp://ftp.cis.ufl.edu/pub/perl/CPAN/modules/by-module/Compress/Compress-Zlib*
+.LP
+A Python interface to
+.IR zlib
+written by A.M. Kuchling <amk@magnet.com>
+is available from the Python Software Association sites, such as:
+.IP
+ftp://ftp.python.org/pub/python/contrib/Encoding/zlib*.tar.gz
+.SH "SEE ALSO"
+Questions about zlib should be sent to:
+.IP
+zlib@quest.jpl.nasa.gov
+or, if this fails, to the author addresses given below.
+The zlib home page is:
+.IP
+http://www.cdrom.com/pub/infozip/zlib/
+.LP
+The data format used by the zlib library is described by RFC
+(Request for Comments) 1950 to 1952 in the files:
+.IP
+ftp://ds.internic.net/rfc/rfc1950.txt (zlib format)
+.br
+rfc1951.txt (deflate format)
+.br
+rfc1952.txt (gzip format)
+.LP
+These documents are also available in other formats from:
+.IP
+ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html
+.SH AUTHORS
+Version 1.1.3
+Copyright (C) 1995-1998 Jean-loup Gailly (jloup@gzip.org)
+and Mark Adler (madler@alumni.caltech.edu).
+.LP
+This software is provided "as-is,"
+without any express or implied warranty.
+In no event will the authors be held liable for any damages
+arising from the use of this software.
+See the distribution directory with respect to requirements
+governing redistribution.
+The deflate format used by
+.I zlib
+was defined by Phil Katz.
+The deflate and
+.I zlib
+specifications were written by L. Peter Deutsch.
+Thanks to all the people who reported problems and suggested various
+improvements in
+.IR zlib ;
+who are too numerous to cite here.
+.LP
+UNIX manual page by R. P. C. Rodgers,
+U.S. National Library of Medicine (rodgers@nlm.nih.gov).
+.\" end of man page
diff --git a/cfe/cfe/zlib/zlib.h b/cfe/cfe/zlib/zlib.h
new file mode 100644
index 0000000..49f56b4
--- /dev/null
+++ b/cfe/cfe/zlib/zlib.h
@@ -0,0 +1,893 @@
+/* zlib.h -- interface of the 'zlib' general purpose compression library
+ version 1.1.3, July 9th, 1998
+
+ Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
+
+
+ The data format used by the zlib library is described by RFCs (Request for
+ Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt
+ (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
+*/
+
+#ifndef _ZLIB_H
+#define _ZLIB_H
+
+#include "zconf.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ZLIB_VERSION "1.1.3"
+
+/*
+ The 'zlib' compression library provides in-memory compression and
+ decompression functions, including integrity checks of the uncompressed
+ data. This version of the library supports only one compression method
+ (deflation) but other algorithms will be added later and will have the same
+ stream interface.
+
+ Compression can be done in a single step if the buffers are large
+ enough (for example if an input file is mmap'ed), or can be done by
+ repeated calls of the compression function. In the latter case, the
+ application must provide more input and/or consume the output
+ (providing more output space) before each call.
+
+ The library also supports reading and writing files in gzip (.gz) format
+ with an interface similar to that of stdio.
+
+ The library does not install any signal handler. The decoder checks
+ the consistency of the compressed data, so the library should never
+ crash even in case of corrupted input.
+*/
+
+typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
+typedef void (*free_func) OF((voidpf opaque, voidpf address));
+
+struct internal_state;
+
+typedef struct z_stream_s {
+ Bytef *next_in; /* next input byte */
+ uInt avail_in; /* number of bytes available at next_in */
+ uLong total_in; /* total nb of input bytes read so far */
+
+ Bytef *next_out; /* next output byte should be put there */
+ uInt avail_out; /* remaining free space at next_out */
+ uLong total_out; /* total nb of bytes output so far */
+
+ char *msg; /* last error message, NULL if no error */
+ struct internal_state FAR *state; /* not visible by applications */
+
+ alloc_func zalloc; /* used to allocate the internal state */
+ free_func zfree; /* used to free the internal state */
+ voidpf opaque; /* private data object passed to zalloc and zfree */
+
+ int data_type; /* best guess about the data type: ascii or binary */
+ uLong adler; /* adler32 value of the uncompressed data */
+ uLong reserved; /* reserved for future use */
+} z_stream;
+
+typedef z_stream FAR *z_streamp;
+
+/*
+ The application must update next_in and avail_in when avail_in has
+ dropped to zero. It must update next_out and avail_out when avail_out
+ has dropped to zero. The application must initialize zalloc, zfree and
+ opaque before calling the init function. All other fields are set by the
+ compression library and must not be updated by the application.
+
+ The opaque value provided by the application will be passed as the first
+ parameter for calls of zalloc and zfree. This can be useful for custom
+ memory management. The compression library attaches no meaning to the
+ opaque value.
+
+ zalloc must return Z_NULL if there is not enough memory for the object.
+ If zlib is used in a multi-threaded application, zalloc and zfree must be
+ thread safe.
+
+ On 16-bit systems, the functions zalloc and zfree must be able to allocate
+ exactly 65536 bytes, but will not be required to allocate more than this
+ if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
+ pointers returned by zalloc for objects of exactly 65536 bytes *must*
+ have their offset normalized to zero. The default allocation function
+ provided by this library ensures this (see zutil.c). To reduce memory
+ requirements and avoid any allocation of 64K objects, at the expense of
+ compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
+
+ The fields total_in and total_out can be used for statistics or
+ progress reports. After compression, total_in holds the total size of
+ the uncompressed data and may be saved for use in the decompressor
+ (particularly if the decompressor wants to decompress everything in
+ a single step).
+*/
+
+ /* constants */
+
+#define Z_NO_FLUSH 0
+#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
+#define Z_SYNC_FLUSH 2
+#define Z_FULL_FLUSH 3
+#define Z_FINISH 4
+/* Allowed flush values; see deflate() below for details */
+
+#define Z_OK 0
+#define Z_STREAM_END 1
+#define Z_NEED_DICT 2
+#define Z_ERRNO (-1)
+#define Z_STREAM_ERROR (-2)
+#define Z_DATA_ERROR (-3)
+#define Z_MEM_ERROR (-4)
+#define Z_BUF_ERROR (-5)
+#define Z_VERSION_ERROR (-6)
+/* Return codes for the compression/decompression functions. Negative
+ * values are errors, positive values are used for special but normal events.
+ */
+
+#define Z_NO_COMPRESSION 0
+#define Z_BEST_SPEED 1
+#define Z_BEST_COMPRESSION 9
+#define Z_DEFAULT_COMPRESSION (-1)
+/* compression levels */
+
+#define Z_FILTERED 1
+#define Z_HUFFMAN_ONLY 2
+#define Z_DEFAULT_STRATEGY 0
+/* compression strategy; see deflateInit2() below for details */
+
+#define Z_BINARY 0
+#define Z_ASCII 1
+#define Z_UNKNOWN 2
+/* Possible values of the data_type field */
+
+#define Z_DEFLATED 8
+/* The deflate compression method (the only one supported in this version) */
+
+#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
+
+#define zlib_version zlibVersion()
+/* for compatibility with versions < 1.0.2 */
+
+ /* basic functions */
+
+ZEXTERN const char * ZEXPORT zlibVersion OF((void));
+/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
+ If the first character differs, the library code actually used is
+ not compatible with the zlib.h header file used by the application.
+ This check is automatically made by deflateInit and inflateInit.
+ */
+
+/*
+ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
+
+ Initializes the internal stream state for compression. The fields
+ zalloc, zfree and opaque must be initialized before by the caller.
+ If zalloc and zfree are set to Z_NULL, deflateInit updates them to
+ use default allocation functions.
+
+ The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
+ 1 gives best speed, 9 gives best compression, 0 gives no compression at
+ all (the input data is simply copied a block at a time).
+ Z_DEFAULT_COMPRESSION requests a default compromise between speed and
+ compression (currently equivalent to level 6).
+
+ deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if level is not a valid compression level,
+ Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
+ with the version assumed by the caller (ZLIB_VERSION).
+ msg is set to null if there is no error message. deflateInit does not
+ perform any compression: this will be done by deflate().
+*/
+
+
+ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
+/*
+ deflate compresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may introduce some
+ output latency (reading input without producing any output) except when
+ forced to flush.
+
+ The detailed semantics are as follows. deflate performs one or both of the
+ following actions:
+
+ - Compress more input starting at next_in and update next_in and avail_in
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), next_in and avail_in are updated and
+ processing will resume at this point for the next call of deflate().
+
+ - Provide more output starting at next_out and update next_out and avail_out
+ accordingly. This action is forced if the parameter flush is non zero.
+ Forcing flush frequently degrades the compression ratio, so this parameter
+ should be set only when necessary (in interactive applications).
+ Some output may be provided even if flush is not set.
+
+ Before the call of deflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming
+ more output, and updating avail_in or avail_out accordingly; avail_out
+ should never be zero before the call. The application can consume the
+ compressed output when it wants, for example when the output buffer is full
+ (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
+ and with zero avail_out, it must be called again after making room in the
+ output buffer because there might be more output pending.
+
+ If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
+ flushed to the output buffer and the output is aligned on a byte boundary, so
+ that the decompressor can get all input data available so far. (In particular
+ avail_in is zero after the call if enough output space has been provided
+ before the call.) Flushing may degrade compression for some compression
+ algorithms and so it should be used only when necessary.
+
+ If flush is set to Z_FULL_FLUSH, all output is flushed as with
+ Z_SYNC_FLUSH, and the compression state is reset so that decompression can
+ restart from this point if previous compressed data has been damaged or if
+ random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
+ the compression.
+
+ If deflate returns with avail_out == 0, this function must be called again
+ with the same value of the flush parameter and more output space (updated
+ avail_out), until the flush is complete (deflate returns with non-zero
+ avail_out).
+
+ If the parameter flush is set to Z_FINISH, pending input is processed,
+ pending output is flushed and deflate returns with Z_STREAM_END if there
+ was enough output space; if deflate returns with Z_OK, this function must be
+ called again with Z_FINISH and more output space (updated avail_out) but no
+ more input data, until it returns with Z_STREAM_END or an error. After
+ deflate has returned Z_STREAM_END, the only possible operations on the
+ stream are deflateReset or deflateEnd.
+
+ Z_FINISH can be used immediately after deflateInit if all the compression
+ is to be done in a single step. In this case, avail_out must be at least
+ 0.1% larger than avail_in plus 12 bytes. If deflate does not return
+ Z_STREAM_END, then it must be called again as described above.
+
+ deflate() sets strm->adler to the adler32 checksum of all input read
+ so far (that is, total_in bytes).
+
+ deflate() may update data_type if it can make a good guess about
+ the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered
+ binary. This field is only for information purposes and does not affect
+ the compression algorithm in any manner.
+
+ deflate() returns Z_OK if some progress has been made (more input
+ processed or more output produced), Z_STREAM_END if all input has been
+ consumed and all output has been produced (only when flush is set to
+ Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
+ if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
+ (for example avail_in or avail_out was zero).
+*/
+
+
+ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
+/*
+ All dynamically allocated data structures for this stream are freed.
+ This function discards any unprocessed input and does not flush any
+ pending output.
+
+ deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
+ stream state was inconsistent, Z_DATA_ERROR if the stream was freed
+ prematurely (some input or output was discarded). In the error case,
+ msg may be set but then points to a static string (which must not be
+ deallocated).
+*/
+
+
+/*
+ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
+
+ Initializes the internal stream state for decompression. The fields
+ next_in, avail_in, zalloc, zfree and opaque must be initialized before by
+ the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
+ value depends on the compression method), inflateInit determines the
+ compression method from the zlib header and allocates all data structures
+ accordingly; otherwise the allocation will be deferred to the first call of
+ inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
+ use default allocation functions.
+
+ inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+ version assumed by the caller. msg is set to null if there is no error
+ message. inflateInit does not perform any decompression apart from reading
+ the zlib header if present: this will be done by inflate(). (So next_in and
+ avail_in may be modified, but next_out and avail_out are unchanged.)
+*/
+
+
+ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
+/*
+ inflate decompresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may some
+ introduce some output latency (reading input without producing any output)
+ except when forced to flush.
+
+ The detailed semantics are as follows. inflate performs one or both of the
+ following actions:
+
+ - Decompress more input starting at next_in and update next_in and avail_in
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), next_in is updated and processing
+ will resume at this point for the next call of inflate().
+
+ - Provide more output starting at next_out and update next_out and avail_out
+ accordingly. inflate() provides as much output as possible, until there
+ is no more input data or no more space in the output buffer (see below
+ about the flush parameter).
+
+ Before the call of inflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming
+ more output, and updating the next_* and avail_* values accordingly.
+ The application can consume the uncompressed output when it wants, for
+ example when the output buffer is full (avail_out == 0), or after each
+ call of inflate(). If inflate returns Z_OK and with zero avail_out, it
+ must be called again after making room in the output buffer because there
+ might be more output pending.
+
+ If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much
+ output as possible to the output buffer. The flushing behavior of inflate is
+ not specified for values of the flush parameter other than Z_SYNC_FLUSH
+ and Z_FINISH, but the current implementation actually flushes as much output
+ as possible anyway.
+
+ inflate() should normally be called until it returns Z_STREAM_END or an
+ error. However if all decompression is to be performed in a single step
+ (a single call of inflate), the parameter flush should be set to
+ Z_FINISH. In this case all pending input is processed and all pending
+ output is flushed; avail_out must be large enough to hold all the
+ uncompressed data. (The size of the uncompressed data may have been saved
+ by the compressor for this purpose.) The next operation on this stream must
+ be inflateEnd to deallocate the decompression state. The use of Z_FINISH
+ is never required, but can be used to inform inflate that a faster routine
+ may be used for the single inflate() call.
+
+ If a preset dictionary is needed at this point (see inflateSetDictionary
+ below), inflate sets strm-adler to the adler32 checksum of the
+ dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise
+ it sets strm->adler to the adler32 checksum of all output produced
+ so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or
+ an error code as described below. At the end of the stream, inflate()
+ checks that its computed adler32 checksum is equal to that saved by the
+ compressor and returns Z_STREAM_END only if the checksum is correct.
+
+ inflate() returns Z_OK if some progress has been made (more input processed
+ or more output produced), Z_STREAM_END if the end of the compressed data has
+ been reached and all uncompressed output has been produced, Z_NEED_DICT if a
+ preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
+ corrupted (input stream not conforming to the zlib format or incorrect
+ adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent
+ (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if no progress is possible or if there was not
+ enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR
+ case, the application may then call inflateSync to look for a good
+ compression block.
+*/
+
+
+ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
+/*
+ All dynamically allocated data structures for this stream are freed.
+ This function discards any unprocessed input and does not flush any
+ pending output.
+
+ inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
+ was inconsistent. In the error case, msg may be set but then points to a
+ static string (which must not be deallocated).
+*/
+
+ /* Advanced functions */
+
+/*
+ The following functions are needed only in some special applications.
+*/
+
+/*
+ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
+ int level,
+ int method,
+ int windowBits,
+ int memLevel,
+ int strategy));
+
+ This is another version of deflateInit with more compression options. The
+ fields next_in, zalloc, zfree and opaque must be initialized before by
+ the caller.
+
+ The method parameter is the compression method. It must be Z_DEFLATED in
+ this version of the library.
+
+ The windowBits parameter is the base two logarithm of the window size
+ (the size of the history buffer). It should be in the range 8..15 for this
+ version of the library. Larger values of this parameter result in better
+ compression at the expense of memory usage. The default value is 15 if
+ deflateInit is used instead.
+
+ The memLevel parameter specifies how much memory should be allocated
+ for the internal compression state. memLevel=1 uses minimum memory but
+ is slow and reduces compression ratio; memLevel=9 uses maximum memory
+ for optimal speed. The default value is 8. See zconf.h for total memory
+ usage as a function of windowBits and memLevel.
+
+ The strategy parameter is used to tune the compression algorithm. Use the
+ value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
+ filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no
+ string match). Filtered data consists mostly of small values with a
+ somewhat random distribution. In this case, the compression algorithm is
+ tuned to compress them better. The effect of Z_FILTERED is to force more
+ Huffman coding and less string matching; it is somewhat intermediate
+ between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects
+ the compression ratio but not the correctness of the compressed output even
+ if it is not set appropriately.
+
+ deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
+ method). msg is set to null if there is no error message. deflateInit2 does
+ not perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
+/*
+ Initializes the compression dictionary from the given byte sequence
+ without producing any compressed output. This function must be called
+ immediately after deflateInit, deflateInit2 or deflateReset, before any
+ call of deflate. The compressor and decompressor must use exactly the same
+ dictionary (see inflateSetDictionary).
+
+ The dictionary should consist of strings (byte sequences) that are likely
+ to be encountered later in the data to be compressed, with the most commonly
+ used strings preferably put towards the end of the dictionary. Using a
+ dictionary is most useful when the data to be compressed is short and can be
+ predicted with good accuracy; the data can then be compressed better than
+ with the default empty dictionary.
+
+ Depending on the size of the compression data structures selected by
+ deflateInit or deflateInit2, a part of the dictionary may in effect be
+ discarded, for example if the dictionary is larger than the window size in
+ deflate or deflate2. Thus the strings most likely to be useful should be
+ put at the end of the dictionary, not at the front.
+
+ Upon return of this function, strm->adler is set to the Adler32 value
+ of the dictionary; the decompressor may later use this value to determine
+ which dictionary has been used by the compressor. (The Adler32 value
+ applies to the whole dictionary even if only a subset of the dictionary is
+ actually used by the compressor.)
+
+ deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
+ parameter is invalid (such as NULL dictionary) or the stream state is
+ inconsistent (for example if deflate has already been called for this stream
+ or if the compression method is bsort). deflateSetDictionary does not
+ perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
+ z_streamp source));
+/*
+ Sets the destination stream as a complete copy of the source stream.
+
+ This function can be useful when several compression strategies will be
+ tried, for example when there are several ways of pre-processing the input
+ data with a filter. The streams that will be discarded should then be freed
+ by calling deflateEnd. Note that deflateCopy duplicates the internal
+ compression state which can be quite large, so this strategy is slow and
+ can consume lots of memory.
+
+ deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+ (such as zalloc being NULL). msg is left unchanged in both source and
+ destination.
+*/
+
+ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
+/*
+ This function is equivalent to deflateEnd followed by deflateInit,
+ but does not free and reallocate all the internal compression state.
+ The stream will keep the same compression level and any other attributes
+ that may have been set by deflateInit2.
+
+ deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
+ int level,
+ int strategy));
+/*
+ Dynamically update the compression level and compression strategy. The
+ interpretation of level and strategy is as in deflateInit2. This can be
+ used to switch between compression and straight copy of the input data, or
+ to switch to a different kind of input data requiring a different
+ strategy. If the compression level is changed, the input available so far
+ is compressed with the old level (and may be flushed); the new level will
+ take effect only at the next call of deflate().
+
+ Before the call of deflateParams, the stream state must be set as for
+ a call of deflate(), since the currently available input may have to
+ be compressed and flushed. In particular, strm->avail_out must be non-zero.
+
+ deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
+ stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
+ if strm->avail_out was zero.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
+ int windowBits));
+
+ This is another version of inflateInit with an extra parameter. The
+ fields next_in, avail_in, zalloc, zfree and opaque must be initialized
+ before by the caller.
+
+ The windowBits parameter is the base two logarithm of the maximum window
+ size (the size of the history buffer). It should be in the range 8..15 for
+ this version of the library. The default value is 15 if inflateInit is used
+ instead. If a compressed stream with a larger window size is given as
+ input, inflate() will return with the error code Z_DATA_ERROR instead of
+ trying to allocate a larger window.
+
+ inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative
+ memLevel). msg is set to null if there is no error message. inflateInit2
+ does not perform any decompression apart from reading the zlib header if
+ present: this will be done by inflate(). (So next_in and avail_in may be
+ modified, but next_out and avail_out are unchanged.)
+*/
+
+ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
+/*
+ Initializes the decompression dictionary from the given uncompressed byte
+ sequence. This function must be called immediately after a call of inflate
+ if this call returned Z_NEED_DICT. The dictionary chosen by the compressor
+ can be determined from the Adler32 value returned by this call of
+ inflate. The compressor and decompressor must use exactly the same
+ dictionary (see deflateSetDictionary).
+
+ inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
+ parameter is invalid (such as NULL dictionary) or the stream state is
+ inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
+ expected one (incorrect Adler32 value). inflateSetDictionary does not
+ perform any decompression: this will be done by subsequent calls of
+ inflate().
+*/
+
+ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
+/*
+ Skips invalid compressed data until a full flush point (see above the
+ description of deflate with Z_FULL_FLUSH) can be found, or until all
+ available input is skipped. No output is provided.
+
+ inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
+ if no more input was provided, Z_DATA_ERROR if no flush point has been found,
+ or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
+ case, the application may save the current current value of total_in which
+ indicates where valid compressed data was found. In the error case, the
+ application may repeatedly call inflateSync, providing more input each time,
+ until success or end of the input data.
+*/
+
+ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
+/*
+ This function is equivalent to inflateEnd followed by inflateInit,
+ but does not free and reallocate all the internal decompression state.
+ The stream will keep attributes that may have been set by inflateInit2.
+
+ inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+
+ /* utility functions */
+
+/*
+ The following utility functions are implemented on top of the
+ basic stream-oriented functions. To simplify the interface, some
+ default options are assumed (compression level and memory usage,
+ standard memory allocation functions). The source code of these
+ utility functions can easily be modified if you need special options.
+*/
+
+ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
+/*
+ Compresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total
+ size of the destination buffer, which must be at least 0.1% larger than
+ sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the
+ compressed buffer.
+ This function can be used to compress a whole file at once if the
+ input file is mmap'ed.
+ compress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer.
+*/
+
+ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen,
+ int level));
+/*
+ Compresses the source buffer into the destination buffer. The level
+ parameter has the same meaning as in deflateInit. sourceLen is the byte
+ length of the source buffer. Upon entry, destLen is the total size of the
+ destination buffer, which must be at least 0.1% larger than sourceLen plus
+ 12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
+
+ compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+ Z_STREAM_ERROR if the level parameter is invalid.
+*/
+
+ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
+/*
+ Decompresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total
+ size of the destination buffer, which must be large enough to hold the
+ entire uncompressed data. (The size of the uncompressed data must have
+ been saved previously by the compressor and transmitted to the decompressor
+ by some mechanism outside the scope of this compression library.)
+ Upon exit, destLen is the actual size of the compressed buffer.
+ This function can be used to decompress a whole file at once if the
+ input file is mmap'ed.
+
+ uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer, or Z_DATA_ERROR if the input data was corrupted.
+*/
+
+
+typedef voidp gzFile;
+
+ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
+/*
+ Opens a gzip (.gz) file for reading or writing. The mode parameter
+ is as in fopen ("rb" or "wb") but can also include a compression level
+ ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
+ Huffman only compression as in "wb1h". (See the description
+ of deflateInit2 for more information about the strategy parameter.)
+
+ gzopen can be used to read a file which is not in gzip format; in this
+ case gzread will directly read from the file without decompression.
+
+ gzopen returns NULL if the file could not be opened or if there was
+ insufficient memory to allocate the (de)compression state; errno
+ can be checked to distinguish the two cases (if errno is zero, the
+ zlib error is Z_MEM_ERROR). */
+
+ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
+/*
+ gzdopen() associates a gzFile with the file descriptor fd. File
+ descriptors are obtained from calls like open, dup, creat, pipe or
+ fileno (in the file has been previously opened with fopen).
+ The mode parameter is as in gzopen.
+ The next call of gzclose on the returned gzFile will also close the
+ file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
+ descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
+ gzdopen returns NULL if there was insufficient memory to allocate
+ the (de)compression state.
+*/
+
+ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
+/*
+ Dynamically update the compression level or strategy. See the description
+ of deflateInit2 for the meaning of these parameters.
+ gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
+ opened for writing.
+*/
+
+ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
+/*
+ Reads the given number of uncompressed bytes from the compressed file.
+ If the input file was not in gzip format, gzread copies the given number
+ of bytes into the buffer.
+ gzread returns the number of uncompressed bytes actually read (0 for
+ end of file, -1 for error). */
+
+ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
+ const voidp buf, unsigned len));
+/*
+ Writes the given number of uncompressed bytes into the compressed file.
+ gzwrite returns the number of uncompressed bytes actually written
+ (0 in case of error).
+*/
+
+ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
+/*
+ Converts, formats, and writes the args to the compressed file under
+ control of the format string, as in fprintf. gzprintf returns the number of
+ uncompressed bytes actually written (0 in case of error).
+*/
+
+ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
+/*
+ Writes the given null-terminated string to the compressed file, excluding
+ the terminating null character.
+ gzputs returns the number of characters written, or -1 in case of error.
+*/
+
+ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
+/*
+ Reads bytes from the compressed file until len-1 characters are read, or
+ a newline character is read and transferred to buf, or an end-of-file
+ condition is encountered. The string is then terminated with a null
+ character.
+ gzgets returns buf, or Z_NULL in case of error.
+*/
+
+ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
+/*
+ Writes c, converted to an unsigned char, into the compressed file.
+ gzputc returns the value that was written, or -1 in case of error.
+*/
+
+ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
+/*
+ Reads one byte from the compressed file. gzgetc returns this byte
+ or -1 in case of end of file or error.
+*/
+
+ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
+/*
+ Flushes all pending output into the compressed file. The parameter
+ flush is as in the deflate() function. The return value is the zlib
+ error number (see function gzerror below). gzflush returns Z_OK if
+ the flush parameter is Z_FINISH and all output could be flushed.
+ gzflush should be called only when strictly necessary because it can
+ degrade compression.
+*/
+
+ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
+ z_off_t offset, int whence));
+/*
+ Sets the starting position for the next gzread or gzwrite on the
+ given compressed file. The offset represents a number of bytes in the
+ uncompressed data stream. The whence parameter is defined as in lseek(2);
+ the value SEEK_END is not supported.
+ If the file is opened for reading, this function is emulated but can be
+ extremely slow. If the file is opened for writing, only forward seeks are
+ supported; gzseek then compresses a sequence of zeroes up to the new
+ starting position.
+
+ gzseek returns the resulting offset location as measured in bytes from
+ the beginning of the uncompressed stream, or -1 in case of error, in
+ particular if the file is opened for writing and the new starting position
+ would be before the current position.
+*/
+
+ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
+/*
+ Rewinds the given file. This function is supported only for reading.
+
+ gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
+*/
+
+ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
+/*
+ Returns the starting position for the next gzread or gzwrite on the
+ given compressed file. This position represents a number of bytes in the
+ uncompressed data stream.
+
+ gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+*/
+
+ZEXTERN int ZEXPORT gzeof OF((gzFile file));
+/*
+ Returns 1 when EOF has previously been detected reading the given
+ input stream, otherwise zero.
+*/
+
+ZEXTERN int ZEXPORT gzclose OF((gzFile file));
+/*
+ Flushes all pending output if necessary, closes the compressed file
+ and deallocates all the (de)compression state. The return value is the zlib
+ error number (see function gzerror below).
+*/
+
+ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
+/*
+ Returns the error message for the last error which occurred on the
+ given compressed file. errnum is set to zlib error number. If an
+ error occurred in the file system and not in the compression library,
+ errnum is set to Z_ERRNO and the application may consult errno
+ to get the exact error code.
+*/
+
+ /* checksum functions */
+
+/*
+ These functions are not related to compression but are exported
+ anyway because they might be useful in applications using the
+ compression library.
+*/
+
+ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
+
+/*
+ Update a running Adler-32 checksum with the bytes buf[0..len-1] and
+ return the updated checksum. If buf is NULL, this function returns
+ the required initial value for the checksum.
+ An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
+ much faster. Usage example:
+
+ uLong adler = adler32(0L, Z_NULL, 0);
+
+ while (read_buffer(buffer, length) != EOF) {
+ adler = adler32(adler, buffer, length);
+ }
+ if (adler != original_adler) error();
+*/
+
+ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
+/*
+ Update a running crc with the bytes buf[0..len-1] and return the updated
+ crc. If buf is NULL, this function returns the required initial value
+ for the crc. Pre- and post-conditioning (one's complement) is performed
+ within this function so it shouldn't be done by the application.
+ Usage example:
+
+ uLong crc = crc32(0L, Z_NULL, 0);
+
+ while (read_buffer(buffer, length) != EOF) {
+ crc = crc32(crc, buffer, length);
+ }
+ if (crc != original_crc) error();
+*/
+
+
+ /* various hacks, don't look :) */
+
+/* deflateInit and inflateInit are macros to allow checking the zlib version
+ * and the compiler's view of z_stream:
+ */
+ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
+ int windowBits, int memLevel,
+ int strategy, const char *version,
+ int stream_size));
+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
+ const char *version, int stream_size));
+#define deflateInit(strm, level) \
+ deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit(strm) \
+ inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
+#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
+ (strategy), ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit2(strm, windowBits) \
+ inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
+
+
+#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL)
+ struct internal_state {int dummy;}; /* hack for buggy compilers */
+#endif
+
+ZEXTERN const char * ZEXPORT zError OF((int err));
+ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z));
+ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ZLIB_H */
diff --git a/cfe/cfe/zlib/zutil.c b/cfe/cfe/zlib/zutil.c
new file mode 100644
index 0000000..52a8197
--- /dev/null
+++ b/cfe/cfe/zlib/zutil.c
@@ -0,0 +1,225 @@
+/* zutil.c -- target dependent utility functions for the compression library
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: zutil.c,v 1.1 2001/11/09 01:48:02 mpl Exp $ */
+
+#include "zutil.h"
+
+struct internal_state {int dummy;}; /* for buggy compilers */
+
+#ifndef STDC
+extern void exit OF((int));
+#endif
+
+const char *z_errmsg[10] = {
+"need dictionary", /* Z_NEED_DICT 2 */
+"stream end", /* Z_STREAM_END 1 */
+"", /* Z_OK 0 */
+"file error", /* Z_ERRNO (-1) */
+"stream error", /* Z_STREAM_ERROR (-2) */
+"data error", /* Z_DATA_ERROR (-3) */
+"insufficient memory", /* Z_MEM_ERROR (-4) */
+"buffer error", /* Z_BUF_ERROR (-5) */
+"incompatible version",/* Z_VERSION_ERROR (-6) */
+""};
+
+
+const char * ZEXPORT zlibVersion()
+{
+ return ZLIB_VERSION;
+}
+
+#ifdef DEBUG
+
+# ifndef verbose
+# define verbose 0
+# endif
+int z_verbose = verbose;
+
+void z_error (m)
+ char *m;
+{
+ fprintf(stderr, "%s\n", m);
+ exit(1);
+}
+#endif
+
+/* exported to allow conversion of error code to string for compress() and
+ * uncompress()
+ */
+const char * ZEXPORT zError(err)
+ int err;
+{
+ return ERR_MSG(err);
+}
+
+
+#ifndef HAVE_MEMCPY
+
+void zmemcpy(dest, source, len)
+ Bytef* dest;
+ const Bytef* source;
+ uInt len;
+{
+ if (len == 0) return;
+ do {
+ *dest++ = *source++; /* ??? to be unrolled */
+ } while (--len != 0);
+}
+
+int zmemcmp(s1, s2, len)
+ const Bytef* s1;
+ const Bytef* s2;
+ uInt len;
+{
+ uInt j;
+
+ for (j = 0; j < len; j++) {
+ if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
+ }
+ return 0;
+}
+
+void zmemzero(dest, len)
+ Bytef* dest;
+ uInt len;
+{
+ if (len == 0) return;
+ do {
+ *dest++ = 0; /* ??? to be unrolled */
+ } while (--len != 0);
+}
+#endif
+
+#ifdef __TURBOC__
+#if (defined( __BORLANDC__) || !defined(SMALL_MEDIUM)) && !defined(__32BIT__)
+/* Small and medium model in Turbo C are for now limited to near allocation
+ * with reduced MAX_WBITS and MAX_MEM_LEVEL
+ */
+# define MY_ZCALLOC
+
+/* Turbo C malloc() does not allow dynamic allocation of 64K bytes
+ * and farmalloc(64K) returns a pointer with an offset of 8, so we
+ * must fix the pointer. Warning: the pointer must be put back to its
+ * original form in order to free it, use zcfree().
+ */
+
+#define MAX_PTR 10
+/* 10*64K = 640K */
+
+local int next_ptr = 0;
+
+typedef struct ptr_table_s {
+ voidpf org_ptr;
+ voidpf new_ptr;
+} ptr_table;
+
+local ptr_table table[MAX_PTR];
+/* This table is used to remember the original form of pointers
+ * to large buffers (64K). Such pointers are normalized with a zero offset.
+ * Since MSDOS is not a preemptive multitasking OS, this table is not
+ * protected from concurrent access. This hack doesn't work anyway on
+ * a protected system like OS/2. Use Microsoft C instead.
+ */
+
+voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
+{
+ voidpf buf = opaque; /* just to make some compilers happy */
+ ulg bsize = (ulg)items*size;
+
+ /* If we allocate less than 65520 bytes, we assume that farmalloc
+ * will return a usable pointer which doesn't have to be normalized.
+ */
+ if (bsize < 65520L) {
+ buf = farmalloc(bsize);
+ if (*(ush*)&buf != 0) return buf;
+ } else {
+ buf = farmalloc(bsize + 16L);
+ }
+ if (buf == NULL || next_ptr >= MAX_PTR) return NULL;
+ table[next_ptr].org_ptr = buf;
+
+ /* Normalize the pointer to seg:0 */
+ *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4;
+ *(ush*)&buf = 0;
+ table[next_ptr++].new_ptr = buf;
+ return buf;
+}
+
+void zcfree (voidpf opaque, voidpf ptr)
+{
+ int n;
+ if (*(ush*)&ptr != 0) { /* object < 64K */
+ farfree(ptr);
+ return;
+ }
+ /* Find the original pointer */
+ for (n = 0; n < next_ptr; n++) {
+ if (ptr != table[n].new_ptr) continue;
+
+ farfree(table[n].org_ptr);
+ while (++n < next_ptr) {
+ table[n-1] = table[n];
+ }
+ next_ptr--;
+ return;
+ }
+ ptr = opaque; /* just to make some compilers happy */
+ Assert(0, "zcfree: ptr not found");
+}
+#endif
+#endif /* __TURBOC__ */
+
+
+#if defined(M_I86) && !defined(__32BIT__)
+/* Microsoft C in 16-bit mode */
+
+# define MY_ZCALLOC
+
+#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
+# define _halloc halloc
+# define _hfree hfree
+#endif
+
+voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
+{
+ if (opaque) opaque = 0; /* to make compiler happy */
+ return _halloc((long)items, size);
+}
+
+void zcfree (voidpf opaque, voidpf ptr)
+{
+ if (opaque) opaque = 0; /* to make compiler happy */
+ _hfree(ptr);
+}
+
+#endif /* MSC */
+
+
+#ifndef MY_ZCALLOC /* Any system without a special alloc function */
+
+#ifndef STDC
+extern voidp calloc OF((uInt items, uInt size));
+extern void free OF((voidpf ptr));
+#endif
+
+voidpf zcalloc (opaque, items, size)
+ voidpf opaque;
+ unsigned items;
+ unsigned size;
+{
+ if (opaque) items += size - size; /* make compiler happy */
+ return (voidpf)calloc(items, size);
+}
+
+void zcfree (opaque, ptr)
+ voidpf opaque;
+ voidpf ptr;
+{
+ free(ptr);
+ if (opaque) return; /* make compiler happy */
+}
+
+#endif /* MY_ZCALLOC */
diff --git a/cfe/cfe/zlib/zutil.h b/cfe/cfe/zlib/zutil.h
new file mode 100644
index 0000000..6dc18e1
--- /dev/null
+++ b/cfe/cfe/zlib/zutil.h
@@ -0,0 +1,220 @@
+/* zutil.h -- internal interface and configuration of the compression library
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+/* @(#) $Id: zutil.h,v 1.1 2001/11/09 01:48:02 mpl Exp $ */
+
+#ifndef _Z_UTIL_H
+#define _Z_UTIL_H
+
+#include "zlib.h"
+
+#ifdef STDC
+# include <stddef.h>
+# include <string.h>
+# include <stdlib.h>
+#endif
+#ifdef NO_ERRNO_H
+ extern int errno;
+#else
+# include <errno.h>
+#endif
+
+#ifndef local
+# define local static
+#endif
+/* compile with -Dlocal if your debugger can't find static symbols */
+
+typedef unsigned char uch;
+typedef uch FAR uchf;
+typedef unsigned short ush;
+typedef ush FAR ushf;
+typedef unsigned long ulg;
+
+extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
+/* (size given to avoid silly warnings with Visual C++) */
+
+#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
+
+#define ERR_RETURN(strm,err) \
+ return (strm->msg = (char*)ERR_MSG(err), (err))
+/* To be used only when the state is known to be valid */
+
+ /* common constants */
+
+#ifndef DEF_WBITS
+# define DEF_WBITS MAX_WBITS
+#endif
+/* default windowBits for decompression. MAX_WBITS is for compression only */
+
+#if MAX_MEM_LEVEL >= 8
+# define DEF_MEM_LEVEL 8
+#else
+# define DEF_MEM_LEVEL MAX_MEM_LEVEL
+#endif
+/* default memLevel */
+
+#define STORED_BLOCK 0
+#define STATIC_TREES 1
+#define DYN_TREES 2
+/* The three kinds of block type */
+
+#define MIN_MATCH 3
+#define MAX_MATCH 258
+/* The minimum and maximum match lengths */
+
+#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
+
+ /* target dependencies */
+
+#ifdef MSDOS
+# define OS_CODE 0x00
+# if defined(__TURBOC__) || defined(__BORLANDC__)
+# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
+ /* Allow compilation with ANSI keywords only enabled */
+ void _Cdecl farfree( void *block );
+ void *_Cdecl farmalloc( unsigned long nbytes );
+# else
+# include <alloc.h>
+# endif
+# else /* MSC or DJGPP */
+# include <malloc.h>
+# endif
+#endif
+
+#ifdef OS2
+# define OS_CODE 0x06
+#endif
+
+#ifdef WIN32 /* Window 95 & Windows NT */
+# define OS_CODE 0x0b
+#endif
+
+#if defined(VAXC) || defined(VMS)
+# define OS_CODE 0x02
+# define F_OPEN(name, mode) \
+ fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
+#endif
+
+#ifdef AMIGA
+# define OS_CODE 0x01
+#endif
+
+#if defined(ATARI) || defined(atarist)
+# define OS_CODE 0x05
+#endif
+
+#if defined(MACOS) || defined(TARGET_OS_MAC)
+# define OS_CODE 0x07
+# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
+# include <unix.h> /* for fdopen */
+# else
+# ifndef fdopen
+# define fdopen(fd,mode) NULL /* No fdopen() */
+# endif
+# endif
+#endif
+
+#ifdef __50SERIES /* Prime/PRIMOS */
+# define OS_CODE 0x0F
+#endif
+
+#ifdef TOPS20
+# define OS_CODE 0x0a
+#endif
+
+#if defined(_BEOS_) || defined(RISCOS)
+# define fdopen(fd,mode) NULL /* No fdopen() */
+#endif
+
+#if (defined(_MSC_VER) && (_MSC_VER > 600))
+# define fdopen(fd,type) _fdopen(fd,type)
+#endif
+
+
+ /* Common defaults */
+
+#ifndef OS_CODE
+# define OS_CODE 0x03 /* assume Unix */
+#endif
+
+#ifndef F_OPEN
+# define F_OPEN(name, mode) fopen((name), (mode))
+#endif
+
+ /* functions */
+
+#ifdef HAVE_STRERROR
+ extern char *strerror OF((int));
+# define zstrerror(errnum) strerror(errnum)
+#else
+# define zstrerror(errnum) ""
+#endif
+
+#if defined(pyr)
+# define NO_MEMCPY
+#endif
+#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
+ /* Use our own functions for small and medium model with MSC <= 5.0.
+ * You may have to use the same strategy for Borland C (untested).
+ * The __SC__ check is for Symantec.
+ */
+# define NO_MEMCPY
+#endif
+#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
+# define HAVE_MEMCPY
+#endif
+#ifdef HAVE_MEMCPY
+# ifdef SMALL_MEDIUM /* MSDOS small or medium model */
+# define zmemcpy _fmemcpy
+# define zmemcmp _fmemcmp
+# define zmemzero(dest, len) _fmemset(dest, 0, len)
+# else
+# define zmemcpy memcpy
+# define zmemcmp memcmp
+# define zmemzero(dest, len) memset(dest, 0, len)
+# endif
+#else
+ extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
+ extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
+ extern void zmemzero OF((Bytef* dest, uInt len));
+#endif
+
+/* Diagnostic functions */
+#ifdef DEBUG
+# include <stdio.h>
+ extern int z_verbose;
+ extern void z_error OF((char *m));
+# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
+# define Trace(x) {if (z_verbose>=0) fprintf x ;}
+# define Tracev(x) {if (z_verbose>0) fprintf x ;}
+# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
+# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
+# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
+#else
+# define Assert(cond,msg)
+# define Trace(x)
+# define Tracev(x)
+# define Tracevv(x)
+# define Tracec(c,x)
+# define Tracecv(c,x)
+#endif
+
+
+typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf,
+ uInt len));
+voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
+void zcfree OF((voidpf opaque, voidpf ptr));
+
+#define ZALLOC(strm, items, size) \
+ (*((strm)->zalloc))((strm)->opaque, (items), (size))
+#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
+#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
+
+#endif /* _Z_UTIL_H */
diff --git a/cfe/docs/cfe.pdf b/cfe/docs/cfe.pdf
new file mode 100755
index 0000000..ae668a1
--- /dev/null
+++ b/cfe/docs/cfe.pdf
Binary files differ
diff --git a/shared/broadcom/include/bcm963xx/6328_common.h b/shared/broadcom/include/bcm963xx/6328_common.h
new file mode 100755
index 0000000..4d36942
--- /dev/null
+++ b/shared/broadcom/include/bcm963xx/6328_common.h
@@ -0,0 +1,299 @@
+/*
+<:copyright-broadcom
+
+ Copyright (c) 2007 Broadcom Corporation
+ All Rights Reserved
+ No portions of this material may be reproduced in any form without the
+ written permission of:
+ Broadcom Corporation
+ 16215 Alton Parkway
+ Irvine, California 92619
+ All information contained in this document is Broadcom Corporation
+ company private, proprietary, and trade secret.
+
+:>
+*/
+/***********************************************************************/
+/* */
+/* MODULE: 6328_common.h */
+/* DATE: 02/01/08 */
+/* PURPOSE: Define addresses of major hardware components of */
+/* BCM6328 */
+/* */
+/***********************************************************************/
+#ifndef __BCM6328_MAP_COMMON_H
+#define __BCM6328_MAP_COMMON_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define PERF_BASE 0xb0000000 /* chip control registers */
+#define TIMR_BASE 0xb0000040 /* timer registers */
+#define NAND_INTR_BASE 0xb0000070 /* nand interrupt control registers */
+#define GPIO_BASE 0xb0000080 /* gpio registers */
+#define UART_BASE 0xb0000100 /* uart registers */
+#define UART1_BASE 0xb0000120 /* uart registers */
+#define NAND_REG_BASE 0xb0000200
+#define NAND_CACHE_BASE 0xb0000400
+#define OTP_BASE 0xb0000600
+#define LED_BASE 0xb0000800 /* LED control registers */
+#define HSSPIM_BASE 0xb0001000 /* High-Speed SPI registers */
+#define MISC_BASE 0xb0001800 /* Miscellaneous Registers */
+#define ADSL_CTRL_BASE 0xb0001900
+#define USB_CTL_BASE 0xb0002400 /* USB 2.0 device control registers */
+#define USB_EHCI_BASE 0x10002500 /* USB host registers */
+#define USB_OHCI_BASE 0x10002600 /* USB host registers */
+#define USBH_CFG_BASE 0xb0002700
+#define DDR_BASE 0xb0003000 /* Memory control registers */
+#define PCM_BASE 0xb000a000
+#define PCM_DMA_BASE 0xb000a800 /* PCM UIDMA register base */
+#define SAR_DMA_BASE 0xb000b800 /* ATM SAR DMA control registers */
+#define USB_DMA_BASE 0xb000c000 /* USB 2.0 device DMA regiseters */
+#define SWITCH_DMA_BASE 0xb000d800
+#define SWITCH_BASE 0xb0e00000
+#define PCIE_BASE 0xb0e40000
+
+
+/*
+#####################################################################
+# System PLL Control Register
+#####################################################################
+*/
+
+/*
+#####################################################################
+# GPIO Control Registers
+#####################################################################
+*/
+
+/*
+#####################################################################
+# Miscellaneous Registers
+#####################################################################
+*/
+#define MISC_MEMC_CONTROL 0x0c
+#define MISC_STRAP_BUS 0x240
+#define MISC_STRAP_BUS_MIPS_PLL_FVCO_SHIFT 7
+
+/*
+#####################################################################
+# OTP Registers
+#####################################################################
+*/
+#define OTP_USER_BITS 0x20
+#define OTP_TP1_DISABLE_BIT 9
+
+/*
+#####################################################################
+# Memory Control Registers
+#####################################################################
+*/
+#define DDR_CTL_CNFG 0x000
+#define DDR_CTL_CSST 0x004
+#define DDR_CTL_CSEND 0x008
+#define DDR_CTL_ROW00_0 0x010
+#define DDR_CTL_ROW00_1 0x014
+#define DDR_CTL_ROW01_0 0x018
+#define DDR_CTL_ROW01_1 0x01c
+#define DDR_CTL_ROW20_0 0x030
+#define DDR_CTL_ROW20_1 0x034
+#define DDR_CTL_ROW21_0 0x038
+#define DDR_CTL_ROW21_1 0x03c
+#define DDR_CTL_COL00_0 0x050
+#define DDR_CTL_COL00_1 0x054
+#define DDR_CTL_COL01_0 0x058
+#define DDR_CTL_COL01_1 0x05c
+#define DDR_CTL_COL20_0 0x070
+#define DDR_CTL_COL20_1 0x074
+#define DDR_CTL_COL21_0 0x078
+#define DDR_CTL_COL21_1 0x07c
+#define DDR_CTL_BNK10 0x090
+#define DDR_CTL_BNK32 0x094
+#define DDR_CTL_DCMD 0x100
+#define DDR_CTL_DMODE_0 0x104
+#define DDR_CTL_DMODE_1 0x108
+#define DDR_CTL_CLKS 0x10c
+#define DDR_CTL_ODT 0x110
+#define DDR_CTL_TIM1_0 0x114
+#define DDR_CTL_TIM1_1 0x118
+#define DDR_CTL_TIM2 0x11c
+#define DDR_CTL_CTL_CRC 0x120
+#define DDR_CTL_DOUT_CRC 0x124
+#define DDR_CTL_DIN_CRC 0x128
+#define PHY_CONTROL_REGS_REVISION 0x200
+#define PHY_CONTROL_REGS_CLK_PM_CTRL 0x204
+#define PHY_CONTROL_REGS_PLL_STATUS 0x210
+#define PHY_CONTROL_REGS_PLL_CONFIG 0x214
+#define PHY_CONTROL_REGS_PLL_PRE_DIVIDER 0x218
+#define PHY_CONTROL_REGS_PLL_DIVIDER 0x21c
+#define PHY_CONTROL_REGS_PLL_CONTROL1 0x220
+#define PHY_CONTROL_REGS_PLL_CONTROL2 0x224
+#define PHY_CONTROL_REGS_PLL_SS_EN 0x228
+#define PHY_CONTROL_REGS_PLL_SS_CFG 0x22c
+#define PHY_CONTROL_REGS_STATIC_VDL_OVERRIDE 0x230
+#define PHY_CONTROL_REGS_DYNAMIC_VDL_OVERRIDE 0x234
+#define PHY_CONTROL_REGS_IDLE_PAD_CONTROL 0x238
+#define PHY_CONTROL_REGS_ZQ_PVT_COMP_CTL 0x23c
+#define PHY_CONTROL_REGS_DRIVE_PAD_CTL 0x240
+#define PHY_CONTROL_REGS_CLOCK_REG_CONTROL 0x244
+
+#define PHY_BYTE_LANE_0_REVISION 0x300
+#define PHY_BYTE_LANE_0_VDL_CALIBRATE 0x304
+#define PHY_BYTE_LANE_0_VDL_STATUS 0x308
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_0 0x310
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_1 0x314
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_2 0x318
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_3 0x31c
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_4 0x320
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_5 0x324
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_6 0x328
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_7 0x32c
+#define PHY_BYTE_LANE_0_READ_CONTROL 0x330
+#define PHY_BYTE_LANE_0_READ_FIFO_STATUS 0x334
+#define PHY_BYTE_LANE_0_READ_FIFO_CLEAR 0x338
+#define PHY_BYTE_LANE_0_IDLE_PAD_CONTROL 0x33c
+#define PHY_BYTE_LANE_0_DRIVE_PAD_CTL 0x340
+#define PHY_BYTE_LANE_0_CLOCK_PAD_DISABLE 0x344
+#define PHY_BYTE_LANE_0_WR_PREAMBLE_MODE 0x348
+#define PHY_BYTE_LANE_0_CLOCK_REG_CONTROL 0x34c
+
+#define PHY_BYTE_LANE_1_REVISION 0x400
+#define PHY_BYTE_LANE_1_VDL_CALIBRATE 0x404
+#define PHY_BYTE_LANE_1_VDL_STATUS 0x408
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_0 0x410
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_1 0x414
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_2 0x418
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_3 0x41c
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_4 0x420
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_5 0x424
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_6 0x428
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_7 0x42c
+#define PHY_BYTE_LANE_1_READ_CONTROL 0x430
+#define PHY_BYTE_LANE_1_READ_FIFO_STATUS 0x434
+#define PHY_BYTE_LANE_1_READ_FIFO_CLEAR 0x438
+#define PHY_BYTE_LANE_1_IDLE_PAD_CONTROL 0x43c
+#define PHY_BYTE_LANE_1_DRIVE_PAD_CTL 0x440
+#define PHY_BYTE_LANE_1_CLOCK_PAD_DISABLE 0x444
+#define PHY_BYTE_LANE_1_WR_PREAMBLE_MODE 0x448
+#define PHY_BYTE_LANE_1_CLOCK_REG_CONTROL 0x44c
+
+#define PHY_BYTE_LANE_2_REVISION 0x500
+#define PHY_BYTE_LANE_2_VDL_CALIBRATE 0x504
+#define PHY_BYTE_LANE_2_VDL_STATUS 0x508
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_0 0x510
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_1 0x514
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_2 0x518
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_3 0x51c
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_4 0x520
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_5 0x524
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_6 0x528
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_7 0x52c
+#define PHY_BYTE_LANE_2_READ_CONTROL 0x530
+#define PHY_BYTE_LANE_2_READ_FIFO_STATUS 0x534
+#define PHY_BYTE_LANE_2_READ_FIFO_CLEAR 0x538
+#define PHY_BYTE_LANE_2_IDLE_PAD_CONTROL 0x53c
+#define PHY_BYTE_LANE_2_DRIVE_PAD_CTL 0x540
+#define PHY_BYTE_LANE_2_CLOCK_PAD_DISABLE 0x544
+#define PHY_BYTE_LANE_2_WR_PREAMBLE_MODE 0x548
+#define PHY_BYTE_LANE_2_CLOCK_REG_CONTROL 0x54c
+
+#define PHY_BYTE_LANE_3_REVISION 0x600
+#define PHY_BYTE_LANE_3_VDL_CALIBRATE 0x604
+#define PHY_BYTE_LANE_3_VDL_STATUS 0x608
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_0 0x610
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_1 0x614
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_2 0x618
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_3 0x61c
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_4 0x620
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_5 0x624
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_6 0x628
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_7 0x62c
+#define PHY_BYTE_LANE_3_READ_CONTROL 0x630
+#define PHY_BYTE_LANE_3_READ_FIFO_STATUS 0x634
+#define PHY_BYTE_LANE_3_READ_FIFO_CLEAR 0x638
+#define PHY_BYTE_LANE_3_IDLE_PAD_CONTROL 0x63c
+#define PHY_BYTE_LANE_3_DRIVE_PAD_CTL 0x640
+#define PHY_BYTE_LANE_3_CLOCK_PAD_DISABLE 0x644
+#define PHY_BYTE_LANE_3_WR_PREAMBLE_MODE 0x648
+#define PHY_BYTE_LANE_3_CLOCK_REG_CONTROL 0x64c
+
+#define DDR_CTL_GCFG 0x800
+#define DDR_CTL_LBIST_CFG 0x804
+#define DDR_CTL_LBIST_SEED 0x808
+#define DDR_CTL_ARB 0x80c
+#define DDR_CTL_PI_GCF 0x810
+#define DDR_CTL_PI_UBUS_CTL 0x814
+#define DDR_CTL_PI_MIPS_CTL 0x818
+#define DDR_CTL_PI_DSL_MIPS_CTL 0x81c
+#define DDR_CTL_PI_DSL_PHY_CTL 0x820
+#define DDR_CTL_PI_UBUS_ST 0x824
+#define DDR_CTL_PI_MIPS_ST 0x828
+#define DDR_CTL_PI_DSL_MIPS_ST 0x82c
+#define DDR_CTL_PI_DSL_PHY_ST 0x830
+#define DDR_CTL_PI_UBUS_SMPL 0x834
+#define DDR_CTL_TESTMODE 0x838
+#define DDR_CTL_TEST_CFG1 0x83c
+#define DDR_CTL_TEST_PAT 0x840
+#define DDR_CTL_TEST_COUNT 0x844
+#define DDR_CTL_TEST_CURR_COUNT 0x848
+#define DDR_CTL_TEST_ADDR_UPDT 0x84c
+#define DDR_CTL_TEST_ADDR 0x850
+#define DDR_CTL_TEST_DATA0 0x854
+#define DDR_CTL_TEST_DATA1 0x858
+#define DDR_CTL_TEST_DATA2 0x85c
+#define DDR_CTL_TEST_DATA3 0x860
+
+
+/*
+#####################################################################
+# UART Control Registers
+#####################################################################
+*/
+#define UART0CONTROL 0x01
+#define UART0CONFIG 0x02
+#define UART0RXTIMEOUT 0x03
+#define UART0BAUD 0x04
+#define UART0FIFOCFG 0x0a
+#define UART0INTMASK 0x10
+#define UART0INTSTAT 0x12
+#define UART0DATA 0x17
+
+#define BRGEN 0x80 /* Control register bit defs */
+#define TXEN 0x40
+#define RXEN 0x20
+#define LOOPBK 0x10
+#define TXPARITYEN 0x08
+#define TXPARITYEVEN 0x04
+#define RXPARITYEN 0x02
+#define RXPARITYEVEN 0x01
+
+#define XMITBREAK 0x40 /* Config register */
+#define BITS5SYM 0x00
+#define BITS6SYM 0x10
+#define BITS7SYM 0x20
+#define BITS8SYM 0x30
+#define ONESTOP 0x07
+#define TWOSTOP 0x0f
+
+#define DELTAIP 0x0001
+#define TXUNDERR 0x0002
+#define TXOVFERR 0x0004
+#define TXFIFOTHOLD 0x0008
+#define TXREADLATCH 0x0010
+#define TXFIFOEMT 0x0020
+#define RXUNDERR 0x0040
+#define RXOVFERR 0x0080
+#define RXTIMEOUT 0x0100
+#define RXFIFOFULL 0x0200
+#define RXFIFOTHOLD 0x0400
+#define RXFIFONE 0x0800
+#define RXFRAMERR 0x1000
+#define RXPARERR 0x2000
+#define RXBRK 0x4000
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/shared/broadcom/include/bcm963xx/6328_map.h b/shared/broadcom/include/bcm963xx/6328_map.h
new file mode 100755
index 0000000..246d211
--- /dev/null
+++ b/shared/broadcom/include/bcm963xx/6328_map.h
@@ -0,0 +1,1886 @@
+/*
+<:copyright-broadcom
+
+ Copyright (c) 2007 Broadcom Corporation
+ All Rights Reserved
+ No portions of this material may be reproduced in any form without the
+ written permission of:
+ Broadcom Corporation
+ 16215 Alton Parkway
+ Irvine, California 92619
+ All information contained in this document is Broadcom Corporation
+ company private, proprietary, and trade secret.
+
+:>
+*/
+/***********************************************************************/
+/* */
+/* MODULE: 6328_map.h */
+/* DATE: 05/30/08 */
+/* PURPOSE: Define addresses of major hardware components of */
+/* BCM6328 */
+/* */
+/***********************************************************************/
+#ifndef __BCM6328_MAP_H
+#define __BCM6328_MAP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "bcmtypes.h"
+#include "6328_common.h"
+#include "6328_intr.h"
+
+/* macro to convert logical data addresses to physical */
+/* DMA hardware must see physical address */
+#define LtoP( x ) ( (uint32)x & 0x1fffffff )
+#define PtoL( x ) ( LtoP(x) | 0xa0000000 )
+
+typedef struct DDRPhyControl {
+ uint32 REVISION; /* 0x00 */
+ uint32 CLK_PM_CTRL; /* 0x04 */
+ uint32 unused0[2]; /* 0x08-0x10 */
+ uint32 PLL_STATUS; /* 0x10 */
+ uint32 PLL_CONFIG; /* 0x14 */
+ uint32 PLL_PRE_DIVIDER; /* 0x18 */
+ uint32 PLL_DIVIDER; /* 0x1c */
+ uint32 PLL_CONTROL1; /* 0x20 */
+ uint32 PLL_CONTROL2; /* 0x24 */
+ uint32 PLL_SS_EN; /* 0x28 */
+ uint32 PLL_SS_CFG; /* 0x2c */
+ uint32 STATIC_VDL_OVERRIDE; /* 0x30 */
+ uint32 DYNAMIC_VDL_OVERRIDE; /* 0x34 */
+ uint32 IDLE_PAD_CONTROL; /* 0x38 */
+ uint32 ZQ_PVT_COMP_CTL; /* 0x3c */
+ uint32 DRIVE_PAD_CTL; /* 0x40 */
+ uint32 CLOCK_REG_CONTROL; /* 0x44 */
+ uint32 unused1[46];
+} DDRPhyControl;
+
+typedef struct DDRPhyByteLaneControl {
+ uint32 REVISION; /* 0x00 */
+ uint32 VDL_CALIBRATE; /* 0x04 */
+ uint32 VDL_STATUS; /* 0x08 */
+ uint32 unused; /* 0x0c */
+ uint32 VDL_OVERRIDE_0; /* 0x10 */
+ uint32 VDL_OVERRIDE_1; /* 0x14 */
+ uint32 VDL_OVERRIDE_2; /* 0x18 */
+ uint32 VDL_OVERRIDE_3; /* 0x1c */
+ uint32 VDL_OVERRIDE_4; /* 0x20 */
+ uint32 VDL_OVERRIDE_5; /* 0x24 */
+ uint32 VDL_OVERRIDE_6; /* 0x28 */
+ uint32 VDL_OVERRIDE_7; /* 0x2c */
+ uint32 READ_CONTROL; /* 0x30 */
+ uint32 READ_FIFO_STATUS; /* 0x34 */
+ uint32 READ_FIFO_CLEAR; /* 0x38 */
+ uint32 IDLE_PAD_CONTROL; /* 0x3c */
+ uint32 DRIVE_PAD_CTL; /* 0x40 */
+ uint32 CLOCK_PAD_DISABLE; /* 0x44 */
+ uint32 WR_PREAMBLE_MODE; /* 0x48 */
+ uint32 CLOCK_REG_CONTROL; /* 0x4C */
+ uint32 unused0[44];
+} DDRPhyByteLaneControl;
+
+typedef struct DDRControl {
+ uint32 CNFG; /* 0x000 */
+ uint32 CSST; /* 0x004 */
+ uint32 CSEND; /* 0x008 */
+ uint32 unused; /* 0x00c */
+ uint32 ROW00_0; /* 0x010 */
+ uint32 ROW00_1; /* 0x014 */
+ uint32 ROW01_0; /* 0x018 */
+ uint32 ROW01_1; /* 0x01c */
+ uint32 unused0[4];
+ uint32 ROW20_0; /* 0x030 */
+ uint32 ROW20_1; /* 0x034 */
+ uint32 ROW21_0; /* 0x038 */
+ uint32 ROW21_1; /* 0x03c */
+ uint32 unused1[4];
+ uint32 COL00_0; /* 0x050 */
+ uint32 COL00_1; /* 0x054 */
+ uint32 COL01_0; /* 0x058 */
+ uint32 COL01_1; /* 0x05c */
+ uint32 unused2[4];
+ uint32 COL20_0; /* 0x070 */
+ uint32 COL20_1; /* 0x074 */
+ uint32 COL21_0; /* 0x078 */
+ uint32 COL21_1; /* 0x07c */
+ uint32 unused3[4];
+ uint32 BNK10; /* 0x090 */
+ uint32 BNK32; /* 0x094 */
+ uint32 unused4[26];
+ uint32 DCMD; /* 0x100 */
+#define DCMD_CS1 (1 << 5)
+#define DCMD_CS0 (1 << 4)
+#define DCMD_SET_SREF 4
+ uint32 DMODE_0; /* 0x104 */
+ uint32 DMODE_1; /* 0x108 */
+#define DMODE_1_DRAMSLEEP (1 << 11)
+ uint32 CLKS; /* 0x10c */
+ uint32 ODT; /* 0x110 */
+ uint32 TIM1_0; /* 0x114 */
+ uint32 TIM1_1; /* 0x118 */
+ uint32 TIM2; /* 0x11c */
+ uint32 CTL_CRC; /* 0x120 */
+ uint32 DOUT_CRC; /* 0x124 */
+ uint32 DIN_CRC; /* 0x128 */
+ uint32 unused5[53];
+
+ DDRPhyControl PhyControl; /* 0x200 */
+ DDRPhyByteLaneControl PhyByteLane0Control; /* 0x300 */
+ DDRPhyByteLaneControl PhyByteLane1Control; /* 0x400 */
+ DDRPhyByteLaneControl PhyByteLane2Control; /* 0x500 */
+ DDRPhyByteLaneControl PhyByteLane3Control; /* 0x600 */
+ uint32 unused6[64];
+
+ uint32 GCFG; /* 0x800 */
+ uint32 LBIST_CFG; /* 0x804 */
+ uint32 LBIST_SEED; /* 0x808 */
+ uint32 ARB; /* 0x80c */
+ uint32 PI_GCF; /* 0x810 */
+ uint32 PI_UBUS_CTL; /* 0x814 */
+ uint32 PI_MIPS_CTL; /* 0x818 */
+ uint32 PI_DSL_MIPS_CTL; /* 0x81c */
+ uint32 PI_DSL_PHY_CTL; /* 0x820 */
+ uint32 PI_UBUS_ST; /* 0x824 */
+ uint32 PI_MIPS_ST; /* 0x828 */
+ uint32 PI_DSL_MIPS_ST; /* 0x82c */
+ uint32 PI_DSL_PHY_ST; /* 0x830 */
+ uint32 PI_UBUS_SMPL; /* 0x834 */
+ uint32 TESTMODE; /* 0x838 */
+ uint32 TEST_CFG1; /* 0x83c */
+ uint32 TEST_PAT; /* 0x840 */
+ uint32 TEST_COUNT; /* 0x844 */
+ uint32 TEST_CURR_COUNT; /* 0x848 */
+ uint32 TEST_ADDR_UPDT; /* 0x84c */
+ uint32 TEST_ADDR; /* 0x850 */
+ uint32 TEST_DATA0; /* 0x854 */
+ uint32 TEST_DATA1; /* 0x858 */
+ uint32 TEST_DATA2; /* 0x85c */
+ uint32 TEST_DATA3; /* 0x860 */
+} DDRControl;
+
+#define DDR ((volatile DDRControl * const) DDR_BASE)
+
+/*
+** Peripheral Controller
+*/
+
+#define IRQ_BITS 64
+typedef struct {
+ uint64 IrqMask;
+ uint64 IrqStatus;
+} IrqControl_t;
+
+typedef struct PerfControl {
+ uint32 RevID; /* (00) word 0 */
+ uint32 blkEnables; /* (04) word 1 */
+#define ROBOSW_CLK_EN (1 << 11)
+#define PCIE_CLK_EN (1 << 10)
+#define HS_SPI_CLK_EN (1 << 9)
+#define USBH_CLK_EN (1 << 8)
+#define USBD_CLK_EN (1 << 7)
+#define PCM_CLK_EN (1 << 6)
+#define SAR_CLK_EN (1 << 5)
+#define MIPS_CLK_EN (1 << 4)
+#define ADSL_CLK_EN (1 << 3)
+#define ADSL_AFE_EN (1 << 2)
+#define ADSL_QPROC_EN (1 << 1)
+#define PHYMIPS_CLK_EN (1 << 0)
+
+ uint32 unused0; /* (08) word 2 */
+ uint32 deviceTimeoutEn; /* (0c) word 3 */
+ uint32 softResetB; /* (10) word 4 */
+#define SOFT_RST_PCIE_HARD (1 << 10)
+#define SOFT_RST_PCIE_EXT (1 << 9)
+#define SOFT_RST_PCIE (1 << 8)
+#define SOFT_RST_PCIE_CORE (1 << 7)
+#define SOFT_RST_PCM (1 << 6)
+#define SOFT_RST_USBH (1 << 5)
+#define SOFT_RST_USBD (1 << 4)
+#define SOFT_RST_SWITCH (1 << 3)
+#define SOFT_RST_SAR (1 << 2)
+#define SOFT_RST_EPHY (1 << 1)
+#define SOFT_RST_SPI (1 << 0)
+
+ uint32 diagControl; /* (14) word 5 */
+ uint32 ExtIrqCfg; /* (18) word 6*/
+ uint32 unused1; /* (1c) word 7 */
+#define EI_SENSE_SHFT 0
+#define EI_STATUS_SHFT 4
+#define EI_CLEAR_SHFT 8
+#define EI_MASK_SHFT 12
+#define EI_INSENS_SHFT 16
+#define EI_LEVEL_SHFT 20
+
+ IrqControl_t IrqControl[2];
+} PerfControl;
+
+#define PERF ((volatile PerfControl * const) PERF_BASE)
+
+/*
+** Timer
+*/
+typedef struct Timer {
+ uint16 unused0;
+ byte TimerMask;
+#define TIMER0EN 0x01
+#define TIMER1EN 0x02
+#define TIMER2EN 0x04
+ byte TimerInts;
+#define TIMER0 0x01
+#define TIMER1 0x02
+#define TIMER2 0x04
+#define WATCHDOG 0x08
+ uint32 TimerCtl0;
+ uint32 TimerCtl1;
+ uint32 TimerCtl2;
+#define TIMERENABLE 0x80000000
+#define RSTCNTCLR 0x40000000
+ uint32 TimerCnt0;
+ uint32 TimerCnt1;
+ uint32 TimerCnt2;
+ uint32 WatchDogDefCount;
+
+ /* Write 0xff00 0x00ff to Start timer
+ * Write 0xee00 0x00ee to Stop and re-load default count
+ * Read from this register returns current watch dog count
+ */
+ uint32 WatchDogCtl;
+
+ /* Number of 50-MHz ticks for WD Reset pulse to last */
+ uint32 WDResetCount;
+
+ uint32 SoftRst;
+#define SOFT_RESET 0x00000001 // 0
+} Timer;
+
+#define TIMER ((volatile Timer * const) TIMR_BASE)
+
+/*
+** UART
+*/
+typedef struct UartChannel {
+ byte unused0;
+ byte control;
+#define BRGEN 0x80 /* Control register bit defs */
+#define TXEN 0x40
+#define RXEN 0x20
+#define LOOPBK 0x10
+#define TXPARITYEN 0x08
+#define TXPARITYEVEN 0x04
+#define RXPARITYEN 0x02
+#define RXPARITYEVEN 0x01
+
+ byte config;
+#define XMITBREAK 0x40
+#define BITS5SYM 0x00
+#define BITS6SYM 0x10
+#define BITS7SYM 0x20
+#define BITS8SYM 0x30
+#define ONESTOP 0x07
+#define TWOSTOP 0x0f
+ /* 4-LSBS represent STOP bits/char
+ * in 1/8 bit-time intervals. Zero
+ * represents 1/8 stop bit interval.
+ * Fifteen represents 2 stop bits.
+ */
+ byte fifoctl;
+#define RSTTXFIFOS 0x80
+#define RSTRXFIFOS 0x40
+ /* 5-bit TimeoutCnt is in low bits of this register.
+ * This count represents the number of characters
+ * idle times before setting receive Irq when below threshold
+ */
+ uint32 baudword;
+ /* When divide SysClk/2/(1+baudword) we should get 32*bit-rate
+ */
+
+ byte txf_levl; /* Read-only fifo depth */
+ byte rxf_levl; /* Read-only fifo depth */
+ byte fifocfg; /* Upper 4-bits are TxThresh, Lower are
+ * RxThreshold. Irq can be asserted
+ * when rx fifo> thresh, txfifo<thresh
+ */
+ byte prog_out; /* Set value of DTR (Bit0), RTS (Bit1)
+ * if these bits are also enabled to GPIO_o
+ */
+#define DTREN 0x01
+#define RTSEN 0x02
+
+ byte unused1;
+ byte DeltaIPEdgeNoSense; /* Low 4-bits, set corr bit to 1 to
+ * detect irq on rising AND falling
+ * edges for corresponding GPIO_i
+ * if enabled (edge insensitive)
+ */
+ byte DeltaIPConfig_Mask; /* Upper 4 bits: 1 for posedge sense
+ * 0 for negedge sense if
+ * not configured for edge
+ * insensitive (see above)
+ * Lower 4 bits: Mask to enable change
+ * detection IRQ for corresponding
+ * GPIO_i
+ */
+ byte DeltaIP_SyncIP; /* Upper 4 bits show which bits
+ * have changed (may set IRQ).
+ * read automatically clears bit
+ * Lower 4 bits are actual status
+ */
+
+ uint16 intMask; /* Same Bit defs for Mask and status */
+ uint16 intStatus;
+#define DELTAIP 0x0001
+#define TXUNDERR 0x0002
+#define TXOVFERR 0x0004
+#define TXFIFOTHOLD 0x0008
+#define TXREADLATCH 0x0010
+#define TXFIFOEMT 0x0020
+#define RXUNDERR 0x0040
+#define RXOVFERR 0x0080
+#define RXTIMEOUT 0x0100
+#define RXFIFOFULL 0x0200
+#define RXFIFOTHOLD 0x0400
+#define RXFIFONE 0x0800
+#define RXFRAMERR 0x1000
+#define RXPARERR 0x2000
+#define RXBRK 0x4000
+
+ uint16 unused2;
+ uint16 Data; /* Write to TX, Read from RX */
+ /* bits 11:8 are BRK,PAR,FRM errors */
+
+ uint32 unused3;
+ uint32 unused4;
+} Uart;
+
+#define UART ((volatile Uart * const) UART_BASE)
+
+/*
+** Gpio Controller
+*/
+
+#pragma pack(push, 4)
+typedef struct GpioControl {
+ uint32 GPIODirHi; /* 0 */
+ uint32 GPIODir; /* 4 */
+ uint32 GPIOioHi; /* 8 */
+ uint32 GPIOio; /* C */
+ uint32 unused0; /* 10 */
+ uint32 SpiSlaveCfg; /* 14 */
+ uint32 GPIOMode; /* 18 */
+ uint64 PinMuxSel; /* 1C */
+#define SERIAL_LED_DATA 6
+#define SERIAL_LED_CLK 7
+#define INET_ACT_LED 11
+#define EPHY0_SPD_LED 17
+#define EPHY1_SPD_LED 18
+#define EPHY2_SPD_LED 19
+#define EPHY3_SPD_LED 20
+#define EPHY0_ACT_LED 25
+#define EPHY1_ACT_LED 26
+#define EPHY2_ACT_LED 27
+#define EPHY3_ACT_LED 28
+
+#define PINMUX_SERIAL_LED_DATA ((uint64)2 << (SERIAL_LED_DATA << 1))
+#define PINMUX_SERIAL_LED_CLK ((uint64)2 << (SERIAL_LED_CLK << 1))
+#define PINMUX_INET_ACT_LED ((uint64)1 << (INET_ACT_LED << 1))
+#define PINMUX_EPHY0_ACT_LED ((uint64)1 << (EPHY0_ACT_LED << 1))
+#define PINMUX_EPHY1_ACT_LED ((uint64)1 << (EPHY1_ACT_LED << 1))
+#define PINMUX_EPHY2_ACT_LED ((uint64)1 << (EPHY2_ACT_LED << 1))
+#define PINMUX_EPHY3_ACT_LED ((uint64)1 << (EPHY3_ACT_LED << 1))
+
+ uint32 PinMuxSelOther; /* 24 */
+#define SEL_USB 12
+#define PINMUX_SEL_USB_MASK (3 << SEL_USB)
+#define PINMUX_SEL_USB_HOST (1 << SEL_USB)
+#define PINMUX_SEL_USB_DEV (2 << SEL_USB)
+
+ uint32 TestControl; /* 28 */
+ uint32 unused2; /* 2C */
+ uint32 RoboSWLEDControl; /* 30 */
+ uint32 RoboSWLEDLSR; /* 34 */
+ uint32 unused3; /* 38 */
+ uint32 RoboswEphyCtrl; /* 3C */
+#define EPHY_AUTO_PWR_DOWN_EN (1<<29)
+#define EPHY_IDDQ_FROM_PHY (1<<28)
+#define EPHY_PLL_LOCK (1<<27)
+#define EPHY_ATEST_25MHZ_EN (1<<26)
+#define EPHY_PWR_DOWN_DLL (1<<25)
+#define EPHY_PWR_DOWN_BIAS (1<<24)
+#define EPHY_PWR_DOWN_TX_4 (1<<23)
+#define EPHY_PWR_DOWN_TX_3 (1<<22)
+#define EPHY_PWR_DOWN_TX_2 (1<<21)
+#define EPHY_PWR_DOWN_TX_1 (1<<20)
+#define EPHY_PWR_DOWN_RX_4 (1<<19)
+#define EPHY_PWR_DOWN_RX_3 (1<<18)
+#define EPHY_PWR_DOWN_RX_2 (1<<17)
+#define EPHY_PWR_DOWN_RX_1 (1<<16)
+#define EPHY_PWR_DOWN_SD_4 (1<<15)
+#define EPHY_PWR_DOWN_SD_3 (1<<14)
+#define EPHY_PWR_DOWN_SD_2 (1<<13)
+#define EPHY_PWR_DOWN_SD_1 (1<<12)
+#define EPHY_PWR_DOWN_RD_4 (1<<11)
+#define EPHY_PWR_DOWN_RD_3 (1<<10)
+#define EPHY_PWR_DOWN_RD_2 (1<<9)
+#define EPHY_PWR_DOWN_RD_1 (1<<8)
+#define EPHY_PWR_DOWN_4 (1<<7)
+#define EPHY_PWR_DOWN_3 (1<<6)
+#define EPHY_PWR_DOWN_2 (1<<5)
+#define EPHY_PWR_DOWN_1 (1<<4)
+#define EPHY_RST_4 (1<<3)
+#define EPHY_RST_3 (1<<2)
+#define EPHY_RST_2 (1<<1)
+#define EPHY_RST_1 (1<<0)
+ uint32 RoboswSwitchCtrl; /* 40 */
+#define RSW_SPI_MODE (1<<11)
+#define RSW_BC_SUPP_EN (1<<10)
+#define RSW_CLK_FREQ_MASK (3<<8)
+#define RSW_ENF_DFX_FLOW (1<<7)
+#define RSW_ENH_DFX_FLOW (1<<6)
+#define RSW_GRX_0_SETUP (1<<5)
+#define RSW_GTX_0_SETUP (1<<4)
+#define RSW_HW_FWDG_EN (1<<3)
+#define RSW_QOS_EN (1<<2)
+#define RSW_WD_CLR_EN (1<<1)
+#define RSW_MII_DUMB_FWDG_EN (1<<0)
+
+ uint32 RegFileTmCtl; /* 44 */
+
+ uint32 RingOscCtrl0; /* 48 */
+#define RING_OSC_256_CYCLES 8
+#define RING_OSC_512_CYCLES 9
+#define RING_OSC_1024_CYCLES 10
+
+ uint32 RingOscCtrl1; /* 4C */
+#define RING_OSC_ENABLE_MASK (0x0f<<24)
+#define RING_OSC_ENABLE_SHIFT 24
+#define RING_OSC_MAX 4
+#define RING_OSC_COUNT_RESET (0x1<<23)
+#define RING_OSC_SELECT_MASK (0x7<<20)
+#define RING_OSC_SELECT_SHIFT 20
+#define RING_OSC_IRQ (0x1<<18)
+#define RING_OSC_COUNTER_OVERFLOW (0x1<<17)
+#define RING_OSC_COUNTER_BUSY (0x1<<16)
+#define RING_OSC_COUNT_MASK 0x0000ffff
+
+ uint32 unused4[6]; /* 50 - 64 */
+ uint32 DieRevID; /* 68 */
+ uint32 unused5; /* 6c */
+ uint32 DiagSelControl; /* 70 */
+ uint32 DiagReadBack; /* 74 */
+ uint32 DiagReadBackHi; /* 78 */
+ uint32 DiagMiscControl; /* 7c */
+} GpioControl;
+#pragma pack(pop)
+
+#define GPIO ((volatile GpioControl * const) GPIO_BASE)
+
+/* Number to mask conversion macro used for GPIODir and GPIOio */
+#define GPIO_NUM_MAX 32
+#define GPIO_NUM_TO_MASK(X) ( (((X) & BP_GPIO_NUM_MASK) < GPIO_NUM_MAX) ? (1 << ((X) & BP_GPIO_NUM_MASK)) : (0) )
+
+/*
+** High-Speed SPI Controller
+*/
+
+#define __mask(end, start) (((1 << ((end - start) + 1)) - 1) << start)
+typedef struct HsSpiControl {
+
+ uint32 hs_spiGlobalCtrl; // 0x0000
+#define HS_SPI_MOSI_IDLE (1 << 18)
+#define HS_SPI_CLK_POLARITY (1 << 17)
+#define HS_SPI_CLK_GATE_SSOFF (1 << 16)
+#define HS_SPI_PLL_CLK_CTRL (8)
+#define HS_SPI_PLL_CLK_CTRL_MASK __mask(15, HS_SPI_PLL_CLK_CTRL)
+#define HS_SPI_SS_POLARITY (0)
+#define HS_SPI_SS_POLARITY_MASK __mask(7, HS_SPI_SS_POLARITY)
+
+ uint32 hs_spiExtTrigCtrl; // 0x0004
+#define HS_SPI_TRIG_RAW_STATE (24)
+#define HS_SPI_TRIG_RAW_STATE_MASK __mask(31, HS_SPI_TRIG_RAW_STATE)
+#define HS_SPI_TRIG_LATCHED (16)
+#define HS_SPI_TRIG_LATCHED_MASK __mask(23, HS_SPI_TRIG_LATCHED)
+#define HS_SPI_TRIG_SENSE (8)
+#define HS_SPI_TRIG_SENSE_MASK __mask(15, HS_SPI_TRIG_SENSE)
+#define HS_SPI_TRIG_TYPE (0)
+#define HS_SPI_TRIG_TYPE_MASK __mask(7, HS_SPI_TRIG_TYPE)
+#define HS_SPI_TRIG_TYPE_EDGE (0)
+#define HS_SPI_TRIG_TYPE_LEVEL (1)
+
+ uint32 hs_spiIntStatus; // 0x0008
+#define HS_SPI_IRQ_PING1_USER (28)
+#define HS_SPI_IRQ_PING1_USER_MASK __mask(31, HS_SPI_IRQ_PING1_USER)
+#define HS_SPI_IRQ_PING0_USER (24)
+#define HS_SPI_IRQ_PING0_USER_MASK __mask(27, HS_SPI_IRQ_PING0_USER)
+
+#define HS_SPI_IRQ_PING1_CTRL_INV (1 << 12)
+#define HS_SPI_IRQ_PING1_POLL_TOUT (1 << 11)
+#define HS_SPI_IRQ_PING1_TX_UNDER (1 << 10)
+#define HS_SPI_IRQ_PING1_RX_OVER (1 << 9)
+#define HS_SPI_IRQ_PING1_CMD_DONE (1 << 8)
+
+#define HS_SPI_IRQ_PING0_CTRL_INV (1 << 4)
+#define HS_SPI_IRQ_PING0_POLL_TOUT (1 << 3)
+#define HS_SPI_IRQ_PING0_TX_UNDER (1 << 2)
+#define HS_SPI_IRQ_PING0_RX_OVER (1 << 1)
+#define HS_SPI_IRQ_PING0_CMD_DONE (1 << 0)
+
+ uint32 hs_spiIntStatusMasked; // 0x000C
+#define HS_SPI_IRQSM__PING1_USER (28)
+#define HS_SPI_IRQSM__PING1_USER_MASK __mask(31, HS_SPI_IRQSM__PING1_USER)
+#define HS_SPI_IRQSM__PING0_USER (24)
+#define HS_SPI_IRQSM__PING0_USER_MASK __mask(27, HS_SPI_IRQSM__PING0_USER)
+
+#define HS_SPI_IRQSM__PING1_CTRL_INV (1 << 12)
+#define HS_SPI_IRQSM__PING1_POLL_TOUT (1 << 11)
+#define HS_SPI_IRQSM__PING1_TX_UNDER (1 << 10)
+#define HS_SPI_IRQSM__PING1_RX_OVER (1 << 9)
+#define HS_SPI_IRQSM__PING1_CMD_DONE (1 << 8)
+
+#define HS_SPI_IRQSM__PING0_CTRL_INV (1 << 4)
+#define HS_SPI_IRQSM__PING0_POLL_TOUT (1 << 3)
+#define HS_SPI_IRQSM__PING0_TX_UNDER (1 << 2)
+#define HS_SPI_IRQSM__PING0_RX_OVER (1 << 1)
+#define HS_SPI_IRQSM__PING0_CMD_DONE (1 << 0)
+
+ uint32 hs_spiIntMask; // 0x0010
+#define HS_SPI_IRQM_PING1_USER (28)
+#define HS_SPI_IRQM_PING1_USER_MASK __mask(31, HS_SPI_IRQM_PING1_USER)
+#define HS_SPI_IRQM_PING0_USER (24)
+#define HS_SPI_IRQM_PING0_USER_MASK __mask(27, HS_SPI_IRQM_PING0_USER)
+
+#define HS_SPI_IRQM_PING1_CTRL_INV (1 << 12)
+#define HS_SPI_IRQM_PING1_POLL_TOUT (1 << 11)
+#define HS_SPI_IRQM_PING1_TX_UNDER (1 << 10)
+#define HS_SPI_IRQM_PING1_RX_OVER (1 << 9)
+#define HS_SPI_IRQM_PING1_CMD_DONE (1 << 8)
+
+#define HS_SPI_IRQM_PING0_CTRL_INV (1 << 4)
+#define HS_SPI_IRQM_PING0_POLL_TOUT (1 << 3)
+#define HS_SPI_IRQM_PING0_TX_UNDER (1 << 2)
+#define HS_SPI_IRQM_PING0_RX_OVER (1 << 1)
+#define HS_SPI_IRQM_PING0_CMD_DONE (1 << 0)
+
+#define HS_SPI_INTR_CLEAR_ALL (0xFF001F1F)
+
+ uint32 hs_spiFlashCtrl; // 0x0014
+#define HS_SPI_FCTRL_MB_ENABLE (1 << 23)
+#define HS_SPI_FCTRL_SS_NUM (20)
+#define HS_SPI_FCTRL_SS_NUM_MASK __mask(22, HS_SPI_FCTRL_SS_NUM)
+#define HS_SPI_FCTRL_PROFILE_NUM (16)
+#define HS_SPI_FCTRL_PROFILE_NUM_MASK __mask(18, HS_SPI_FCTRL_PROFILE_NUM)
+#define HS_SPI_FCTRL_DUMMY_BYTES (10)
+#define HS_SPI_FCTRL_DUMMY_BYTES_MASK __mask(11, HS_SPI_FCTRL_DUMMY_BYTES)
+#define HS_SPI_FCTRL_ADDR_BYTES (8)
+#define HS_SPI_FCTRL_ADDR_BYTES_MASK __mask(9, HS_SPI_FCTRL_ADDR_BYTES)
+#define HS_SPI_FCTRL_ADDR_BYTES_2 (0)
+#define HS_SPI_FCTRL_ADDR_BYTES_3 (1)
+#define HS_SPI_FCTRL_ADDR_BYTES_4 (2)
+#define HS_SPI_FCTRL_READ_OPCODE (0)
+#define HS_SPI_FCTRL_READ_OPCODE_MASK __mask(7, HS_SPI_FCTRL_READ_OPCODE)
+
+ uint32 hs_spiFlashAddrBase; // 0x0018
+
+ char fill0[0x80 - 0x18];
+
+ uint32 hs_spiPP_0_Cmd; // 0x0080
+#define HS_SPI_PP_SS_NUM (12)
+#define HS_SPI_PP_SS_NUM_MASK __mask(14, HS_SPI_PP_SS_NUM)
+#define HS_SPI_PP_PROFILE_NUM (8)
+#define HS_SPI_PP_PROFILE_NUM_MASK __mask(10, HS_SPI_PP_PROFILE_NUM)
+
+} HsSpiControl;
+
+typedef struct HsSpiPingPong {
+
+ uint32 command;
+#define HS_SPI_SS_NUM (12)
+#define HS_SPI_PROFILE_NUM (8)
+#define HS_SPI_TRIGGER_NUM (4)
+#define HS_SPI_COMMAND_VALUE (0)
+ #define HS_SPI_COMMAND_NOOP (0)
+ #define HS_SPI_COMMAND_START_NOW (1)
+ #define HS_SPI_COMMAND_START_TRIGGER (2)
+ #define HS_SPI_COMMAND_HALT (3)
+ #define HS_SPI_COMMAND_FLUSH (4)
+
+ uint32 status;
+#define HS_SPI_ERROR_BYTE_OFFSET (16)
+#define HS_SPI_WAIT_FOR_TRIGGER (2)
+#define HS_SPI_SOURCE_BUSY (1)
+#define HS_SPI_SOURCE_GNT (0)
+
+ uint32 fifo_status;
+ uint32 control;
+
+} HsSpiPingPong;
+
+typedef struct HsSpiProfile {
+
+ uint32 clk_ctrl;
+#define HS_SPI_ACCUM_RST_ON_LOOP (15)
+#define HS_SPI_SPI_CLK_2X_SEL (14)
+#define HS_SPI_FREQ_CTRL_WORD (0)
+
+ uint32 signal_ctrl;
+#define HS_SPI_ASYNC_INPUT_PATH (1 << 16)
+#define HS_SPI_LAUNCH_RISING (1 << 13)
+#define HS_SPI_LATCH_RISING (1 << 12)
+
+ uint32 mode_ctrl;
+#define HS_SPI_PREPENDBYTE_CNT (24)
+#define HS_SPI_MODE_ONE_WIRE (20)
+#define HS_SPI_MULTIDATA_WR_SIZE (18)
+#define HS_SPI_MULTIDATA_RD_SIZE (16)
+#define HS_SPI_MULTIDATA_WR_STRT (12)
+#define HS_SPI_MULTIDATA_RD_STRT (8)
+#define HS_SPI_FILLBYTE (0)
+
+ uint32 polling_config;
+ uint32 polling_and_mask;
+ uint32 polling_compare;
+ uint32 polling_timeout;
+ uint32 reserved;
+
+} HsSpiProfile;
+
+#define HS_SPI_OP_CODE 13
+ #define HS_SPI_OP_SLEEP (0)
+ #define HS_SPI_OP_READ_WRITE (1)
+ #define HS_SPI_OP_WRITE (2)
+ #define HS_SPI_OP_READ (3)
+ #define HS_SPI_OP_SETIRQ (4)
+
+#define HS_SPI ((volatile HsSpiControl * const) HSSPIM_BASE)
+#define HS_SPI_PINGPONG0 ((volatile HsSpiPingPong * const) (HSSPIM_BASE+0x80))
+#define HS_SPI_PINGPONG1 ((volatile HsSpiPingPong * const) (HSSPIM_BASE+0xc0))
+#define HS_SPI_PROFILES ((volatile HsSpiProfile * const) (HSSPIM_BASE+0x100))
+#define HS_SPI_FIFO0 ((volatile uint8 * const) (HSSPIM_BASE+0x200))
+#define HS_SPI_FIFO1 ((volatile uint8 * const) (HSSPIM_BASE+0x400))
+
+
+/*
+** Misc Register Set Definitions.
+*/
+
+typedef struct Misc {
+ uint32 miscSerdesCtrl; /* 0x0000 */
+#define SERDES_PCIE_ENABLE 0x00000001
+#define SERDES_PCIE_EXD_ENABLE (1<<15)
+
+ uint32 miscSerdesSts; /* 0x0004 */
+ uint32 miscIrqOutMask; /* 0x0008 */
+#define MISC_PCIE_EP_IRQ_MASK0 (1<<0)
+#define MISC_PCIE_EP_IRQ_MASK1 (1<<1)
+
+ uint32 miscMemcControl; /* 0x000c */
+#define MISC_MEMC_CONTROL_MC_UBUS_ASYNC_MODE (1<<3)
+#define MISC_MEMC_CONTROL_MC_LMB_ASYNC_MODE (1<<2)
+#define MISC_MEMC_CONTROL_DDR_TEST_DONE (1<<1)
+#define MISC_MEMC_CONTROL_DDR_TEST_DISABLE (1<<0)
+
+ uint32 unused0[2]; /* 0x0010 */
+
+ uint32 miscVregCtrl0; /* 0x0018 */
+#define VREG_VSEL1P2_SHIFT 0
+#define VREG_VSEL1P2_MASK 0x1f
+#define VREG_VSEL1P2_MIDDLE 0x0f
+
+ uint32 miscVregCtrl1; /* 0x001c */
+ uint32 miscVregCtrl2; /* 0x0020 */
+ uint32 miscLedXorReg; /* 0x0024 */
+ uint32 miscExtra2ChipIrqMask; /* 0x0028 */
+ uint32 miscExtra2ChipIrqStatus; /* 0x002c */
+ uint32 miscExtra2ChipIrqMask1; /* 0x0030 */
+ uint32 miscExtra2ChipIrqStatus1; /* 0x0034 */
+ uint32 miscDdrPllTestCtrl; /* 0x0038 */
+ uint32 miscPadCtrlLow; /* 0x003c */
+ uint32 miscPadCtrlHigh; /* 0x0040 */
+#define MISC_MII_SEL_SHIFT 30
+#define MISC_MII_SEL_3P3V 0
+#define MISC_MII_SEL_2P5V 1
+#define MISC_MII_SEL_1P5V 2
+ uint32 miscPeriphEcoReg; /* 0x0044 */
+
+ uint32 miscIddqCtrl; /* 0x0048 */
+#define MISC_IDDQ_CONTROL_USBH (1<<6)
+#define MISC_IDDQ_CONTROL_USBD (1<<5)
+
+ uint32 miscAdslClkSample; /* 0x004c */
+
+ uint32 unused3[(0x0100 - 0x0050) / 4]; /* 0x0050 */
+ uint32 miscAdslCtrl; /* 0x0100 */
+ uint32 unused4[(0x0180 - 0x0104) / 4]; /* 0x0104 */
+ uint32 miscMipsTestCtrl; /* 0x0180 */
+ uint32 miscMipsTestStatus; /* 0x0184 */
+ uint32 unused5[(0x0200 - 0x0188) / 4]; /* 0x0188 */
+ uint32 miscPllCtrlSysPll0; /* 0x0200 */
+ uint32 miscPllCtrlSysPll1; /* 0x0204 */
+ uint32 miscPllCtrlSysPll2; /* 0x0208 */
+ uint32 miscPllCtrlSysPll3; /* 0x020c */
+ uint32 miscPllCtrlDdrPll; /* 0x0210 */
+ uint32 miscPllCtrlXtalEcoReg; /* 0x0214 */
+ uint32 unused6[(0x0240 - 0x0218) / 4]; /* 0x0218 */
+ uint32 miscStrapBus; /* 0x0240 */
+#define MISC_STRAP_BUS_BOOT_SEL_SHIFT 18
+#define MISC_STRAP_BUS_BOOT_SEL_MASK (0x1<<MISC_STRAP_BUS_BOOT_SEL_SHIFT)
+#define MISC_STRAP_BUS_BOOT_SERIAL 0x01
+#define MISC_STRAP_BUS_BOOT_NAND 0x00
+#define MISC_STRAP_BUS_MIPS_PLL_FVCO_SHIFT 7
+#define MISC_STRAP_BUS_MIPS_PLL_FVCO_MASK (0x1F<<MISC_STRAP_BUS_MIPS_PLL_FVCO_SHIFT)
+
+ uint32 miscStrapOverride; /* 0x0244 */
+ uint32 unused7[(0x0280 - 0x0248) / 4]; /* 0x0248 */
+ uint32 miscRtcSleepModeEn; /* 0x0280 */
+ uint32 miscRtcSleepRtcEn; /* 0x0284 */
+ uint32 miscRtcSleepRtcCountLow; /* 0x0288 */
+ uint32 miscRtcSleepRtcCountHigh; /* 0x028c */
+ uint32 miscRtcSleepRtcEvent; /* 0x0290 */
+ uint32 miscRtcSleepWakeupMask; /* 0x0294 */
+ uint32 miscRtcSleepWakeupStatus; /* 0x0298 */
+ uint32 miscRtcSleepDebounceCtrl; /* 0x029c */
+ uint32 miscRtcSleepCpuScratchPad; /* 0x02a0 */
+} Misc;
+
+#define MISC ((volatile Misc * const) MISC_BASE)
+
+/*
+** LedControl Register Set Definitions.
+*/
+
+#pragma pack(push, 4)
+typedef struct LedControl {
+ uint32 ledInit;
+#define LED_LED_TEST (1 << 31)
+#define LED_SHIFT_TEST (1 << 30)
+#define LED_SERIAL_LED_SHIFT_DIR (1 << 16)
+#define LED_SERIAL_LED_DATA_PPOL (1 << 15)
+#define LEDSERIAL_LED_CLK_NPOL (1 << 14)
+#define LED_SERIAL_LED_MUX_SEL (1 << 13)
+#define LED_SERIAL_LED_EN (1 << 12)
+#define LED_FAST_INTV_SHIFT 6
+#define LED_FAST_INTV_MASK (0x3F<<LED_FAST_INTV_SHIFT)
+#define LED_SLOW_INTV_SHIFT 0
+#define LED_SLOW_INTV_MASK (0x3F<<LED_SLOW_INTV_SHIFT)
+#define LED_INTERVAL_20MS 1
+
+ uint64 ledMode;
+#define LED_MODE_MASK (uint64)0x3
+#define LED_MODE_OFF (uint64)0x0
+#define LED_MODE_FLASH (uint64)0x1
+#define LED_MODE_BLINK (uint64)0x2
+#define LED_MODE_ON (uint64)0x3
+
+ uint32 ledHWDis;
+ uint32 ledStrobe;
+ uint32 ledLinkActSelHigh;
+#define LED_ENET0 4
+#define LED_ENET1 5
+#define LED_ENET2 6
+#define LED_ENET3 7
+#define LED_4_ACT_SHIFT 0
+#define LED_5_ACT_SHIFT 4
+#define LED_6_ACT_SHIFT 8
+#define LED_7_ACT_SHIFT 12
+#define LED_4_LINK_SHIFT 16
+#define LED_5_LINK_SHIFT 20
+#define LED_6_LINK_SHIFT 24
+#define LED_7_LINK_SHIFT 28
+ uint32 ledLinkActSelLow;
+#define LED_INET 0
+#define LED_0_ACT_SHIFT 0
+#define LED_1_ACT_SHIFT 4
+#define LED_2_ACT_SHIFT 8
+#define LED_3_ACT_SHIFT 12
+#define LED_0_LINK_SHIFT 16
+#define LED_1_LINK_SHIFT 20
+#define LED_2_LINK_SHIFT 24
+#define LED_3_LINK_SHIFT 28
+
+ uint32 ledReadback;
+ uint32 ledSerialMuxSelect;
+} LedControl;
+#pragma pack(pop)
+
+#define LED ((volatile LedControl * const) LED_BASE)
+
+#define GPIO_NUM_TO_LED_MODE_SHIFT(X) \
+ ((((X) & BP_GPIO_NUM_MASK) < 8) ? (32 + (((X) & BP_GPIO_NUM_MASK) << 1)) : \
+ ((((X) & BP_GPIO_NUM_MASK) - 8) << 1))
+
+/*
+** Pcm Controller
+*/
+
+typedef struct PcmControlRegisters
+{
+ uint32 pcm_ctrl; // 00 offset from PCM_BASE
+#define PCM_ENABLE 0x80000000 // PCM block master enable
+#define PCM_ENABLE_SHIFT 31
+#define PCM_SLAVE_SEL 0x40000000 // PCM TDM slave mode select (1 - TDM slave, 0 - TDM master)
+#define PCM_SLAVE_SEL_SHIFT 30
+#define PCM_CLOCK_INV 0x20000000 // PCM SCLK invert select (1 - invert, 0 - normal)
+#define PCM_CLOCK_INV_SHIFT 29
+#define PCM_FS_INVERT 0x10000000 // PCM FS invert select (1 - invert, 0 - normal)
+#define PCM_FS_INVERT_SHIFT 28
+#define PCM_FS_FREQ_16_8 0x08000000 // PCM FS 16/8 Khz select (1 - 16Khz, 0 - 8Khz)
+#define PCM_FS_FREQ_16_8_SHIFT 27
+#define PCM_FS_LONG 0x04000000 // PCM FS long/short select (1 - long FS, 0 - short FS)
+#define PCM_FS_LONG_SHIFT 26
+#define PCM_FS_TRIG 0x02000000 // PCM FS trigger (1 - falling edge, 0 - rising edge trigger)
+#define PCM_FS_TRIG_SHIFT 25
+#define PCM_DATA_OFF 0x01000000 // PCM data offset from FS (1 - one clock from FS, 0 - no offset)
+#define PCM_DATA_OFF_SHIFT 24
+#define PCM_DATA_16_8 0x00800000 // PCM data word length (1 - 16 bits, 0 - 8 bits)
+#define PCM_DATA_16_8_SHIFT 23
+#define PCM_CLOCK_SEL 0x00700000 // PCM SCLK freq select
+#define PCM_CLOCK_SEL_SHIFT 20
+ // 000 - 8192 Khz
+ // 001 - 4096 Khz
+ // 010 - 2048 Khz
+ // 011 - 1024 Khz
+ // 100 - 512 Khz
+ // 101 - 256 Khz
+ // 110 - 128 Khz
+ // 111 - reserved
+#define PCM_LSB_FIRST 0x00040000 // PCM shift direction (1 - LSBit first, 0 - MSBit first)
+#define PCM_LSB_FIRST_SHIFT 18
+#define PCM_LOOPBACK 0x00020000 // PCM diagnostic loobback enable
+#define PCM_LOOPBACK_SHIFT 17
+#define PCM_EXTCLK_SEL 0x00010000 // PCM external timing clock select -- Maybe removed in 6328
+#define PCM_EXTCLK_SEL_SHIFT 16
+#define PCM_NTR_ENABLE 0x00008000 // PCM NTR counter enable -- Nayve removed in 6328
+#define PCM_NTR_ENABLE_SHIFT 15
+#define PCM_BITS_PER_FRAME_1024 0x00000400 // 1024 - Max
+#define PCM_BITS_PER_FRAME_256 0x00000100 // 256
+#define PCM_BITS_PER_FRAME_8 0x00000008 // 8 - Min
+
+ uint32 pcm_chan_ctrl; // 04
+#define PCM_TX0_EN 0x00000001 // PCM transmit channel 0 enable
+#define PCM_TX1_EN 0x00000002 // PCM transmit channel 1 enable
+#define PCM_TX2_EN 0x00000004 // PCM transmit channel 2 enable
+#define PCM_TX3_EN 0x00000008 // PCM transmit channel 3 enable
+#define PCM_TX4_EN 0x00000010 // PCM transmit channel 4 enable
+#define PCM_TX5_EN 0x00000020 // PCM transmit channel 5 enable
+#define PCM_TX6_EN 0x00000040 // PCM transmit channel 6 enable
+#define PCM_TX7_EN 0x00000080 // PCM transmit channel 7 enable
+#define PCM_RX0_EN 0x00000100 // PCM receive channel 0 enable
+#define PCM_RX1_EN 0x00000200 // PCM receive channel 1 enable
+#define PCM_RX2_EN 0x00000400 // PCM receive channel 2 enable
+#define PCM_RX3_EN 0x00000800 // PCM receive channel 3 enable
+#define PCM_RX4_EN 0x00001000 // PCM receive channel 4 enable
+#define PCM_RX5_EN 0x00002000 // PCM receive channel 5 enable
+#define PCM_RX6_EN 0x00004000 // PCM receive channel 6 enable
+#define PCM_RX7_EN 0x00008000 // PCM receive channel 7 enable
+#define PCM_RX_PACKET_SIZE 0x00ff0000 // PCM Rx DMA quasi-packet size
+#define PCM_RX_PACKET_SIZE_SHIFT 16
+
+ uint32 pcm_int_pending; // 08
+ uint32 pcm_int_mask; // 0c
+#define PCM_TX_UNDERFLOW 0x00000001 // PCM DMA receive overflow
+#define PCM_RX_OVERFLOW 0x00000002 // PCM DMA transmit underflow
+#define PCM_TDM_FRAME 0x00000004 // PCM frame boundary
+#define PCM_RX_IRQ 0x00000008 // IUDMA interrupts
+#define PCM_TX_IRQ 0x00000010
+
+ uint32 pcm_pll_ctrl1; // 10
+#define PCM_PLL_PWRDN 0x80000000 // PLL PWRDN
+#define PCM_PLL_PWRDN_CH1 0x40000000 // PLL CH PWRDN
+#define PCM_PLL_REFCMP_PWRDN 0x20000000 // PLL REFCMP PWRDN
+#define PCM_CLK16_RESET 0x10000000 // 16.382 MHz PCM interface circuitry reset.
+#define PCM_PLL_ARESET 0x08000000 // PLL Analog Reset
+#define PCM_PLL_DRESET 0x04000000 // PLL Digital Reset
+
+ uint32 pcm_pll_ctrl2; // 14
+ uint32 pcm_pll_ctrl3; // 18
+ uint32 pcm_pll_ctrl4; // 1c
+
+ uint32 pcm_pll_stat; // 20
+#define PCM_PLL_LOCK 0x00000001 // Asserted when PLL is locked to programmed frequency
+
+ uint32 pcm_ntr_counter; // 24
+
+ uint32 unused[6];
+#define PCM_MAX_TIMESLOT_REGS 16 // Number of PCM time slot registers in the table.
+ // Each register provides the settings for 8 timeslots (4 bits per timeslot)
+ uint32 pcm_slot_alloc_tbl[PCM_MAX_TIMESLOT_REGS];
+#define PCM_TS_VALID 0x8 // valid marker for TS alloc ram entry
+
+ uint32 pcm_pll_ch2_ctrl; // +0xa080
+ uint32 pcm_msif_intf; // +0xa084
+} PcmControlRegisters;
+
+#define PCM ((volatile PcmControlRegisters * const) PCM_BASE)
+
+
+typedef struct PcmIudmaRegisters
+{
+ uint16 reserved0;
+ uint16 ctrlConfig;
+#define BCM6328_IUDMA_REGS_CTRLCONFIG_MASTER_EN 0x0001
+#define BCM6328_IUDMA_REGS_CTRLCONFIG_FLOWC_CH1_EN 0x0002
+#define BCM6328_IUDMA_REGS_CTRLCONFIG_FLOWC_CH3_EN 0x0004
+#define BCM6328_IUDMA_REGS_CTRLCONFIG_FLOWC_CH5_EN 0x0008
+#define BCM6328_IUDMA_REGS_CTRLCONFIG_FLOWC_CH7_EN 0x0010
+
+ // Flow control Ch1
+ uint16 reserved1;
+ uint16 ch1_FC_Low_Thr;
+
+ uint16 reserved2;
+ uint16 ch1_FC_High_Thr;
+
+ uint16 reserved3;
+ uint16 ch1_Buff_Alloc;
+
+ // Flow control Ch3
+ uint16 reserved4;
+ uint16 ch3_FC_Low_Thr;
+
+ uint16 reserved5;
+ uint16 ch3_FC_High_Thr;
+
+ uint16 reserved6;
+ uint16 ch3_Buff_Alloc;
+
+ // Flow control Ch5
+ uint16 reserved7;
+ uint16 ch5_FC_Low_Thr;
+
+ uint16 reserved8;
+ uint16 ch5_FC_High_Thr;
+
+ uint16 reserved9;
+ uint16 ch5_Buff_Alloc;
+
+ // Flow control Ch7
+ uint16 reserved10;
+ uint16 ch7_FC_Low_Thr;
+
+ uint16 reserved11;
+ uint16 ch7_FC_High_Thr;
+
+ uint16 reserved12;
+ uint16 ch7_Buff_Alloc;
+
+ // Channel resets
+ uint16 reserved13;
+ uint16 channel_reset;
+
+ uint16 reserved14;
+ uint16 channel_debug;
+
+ // Spare register
+ uint32 dummy1;
+
+ // Interrupt status registers
+ uint16 reserved15;
+ uint16 gbl_int_stat;
+
+ // Interrupt mask registers
+ uint16 reserved16;
+ uint16 gbl_int_mask;
+} PcmIudmaRegisters;
+
+
+typedef struct PcmIudmaChannelCtrl
+{
+ uint16 reserved1;
+ uint16 config;
+#define BCM6328_IUDMA_CONFIG_ENDMA 0x0001
+#define BCM6328_IUDMA_CONFIG_PKTHALT 0x0002
+#define BCM6328_IUDMA_CONFIG_BURSTHALT 0x0004
+
+ uint16 reserved2;
+ uint16 intStat;
+#define BCM6328_IUDMA_INTSTAT_BDONE 0x0001
+#define BCM6328_IUDMA_INTSTAT_PDONE 0x0002
+#define BCM6328_IUDMA_INTSTAT_NOTVLD 0x0004
+#define BCM6328_IUDMA_INTSTAT_MASK 0x0007
+#define BCM6328_IUDMA_INTSTAT_ALL BCM6328_IUDMA_INTSTAT_MASK
+
+ uint16 reserved3;
+ uint16 intMask;
+#define BCM6328_IUDMA_INTMASK_BDONE 0x0001
+#define BCM6328_IUDMA_INTMASK_PDONE 0x0002
+#define BCM6328_IUDMA_INTMASK_NOTVLD 0x0004
+
+ uint32 maxBurst;
+#define BCM6328_IUDMA_MAXBURST_SIZE 16 /* 32-bit words */
+
+} PcmIudmaChannelCtrl;
+
+
+typedef struct PcmIudmaStateRam
+{
+ uint32 baseDescPointer; /* pointer to first buffer descriptor */
+
+ uint32 stateBytesDoneRingOffset; /* state info: how manu bytes done and the offset of the
+ current descritor in process */
+#define BCM6328_IUDMA_STRAM_DESC_RING_OFFSET 0x3fff
+
+
+ uint32 flagsLengthStatus; /* Length and status field of the current descriptor */
+
+ uint32 currentBufferPointer; /* pointer to the current descriptor */
+
+} PcmIudmaStateRam;
+
+#define BCM6328_MAX_PCM_DMA_CHANNELS 2
+
+typedef struct PcmIudma
+{
+ PcmIudmaRegisters regs; //
+ uint32 reserved1[110]; //
+ PcmIudmaChannelCtrl ctrl[BCM6328_MAX_PCM_DMA_CHANNELS]; //
+ uint32 reserved2[120]; //
+ PcmIudmaStateRam stram[BCM6328_MAX_PCM_DMA_CHANNELS]; //
+
+} PcmIudma;
+
+#define PCM_IUDMA ((volatile PcmIudma * const) PCM_DMA_BASE)
+
+
+#define IUDMA_MAX_CHANNELS 32
+
+/*
+** DMA Channel Configuration (1 .. 32)
+*/
+typedef struct DmaChannelCfg {
+ uint32 cfg; /* (00) assorted configuration */
+#define DMA_ENABLE 0x00000001 /* set to enable channel */
+#define DMA_PKT_HALT 0x00000002 /* idle after an EOP flag is detected */
+#define DMA_BURST_HALT 0x00000004 /* idle after finish current memory burst */
+ uint32 intStat; /* (04) interrupts control and status */
+ uint32 intMask; /* (08) interrupts mask */
+#define DMA_BUFF_DONE 0x00000001 /* buffer done */
+#define DMA_DONE 0x00000002 /* packet xfer complete */
+#define DMA_NO_DESC 0x00000004 /* no valid descriptors */
+ uint32 maxBurst; /* (0C) max burst length permitted */
+#define DMA_DESCSIZE_SEL 0x00040000 /* DMA Descriptor Size Selection */
+} DmaChannelCfg;
+
+/*
+** DMA State RAM (1 .. 16)
+*/
+typedef struct DmaStateRam {
+ uint32 baseDescPtr; /* (00) descriptor ring start address */
+ uint32 state_data; /* (04) state/bytes done/ring offset */
+ uint32 desc_len_status; /* (08) buffer descriptor status and len */
+ uint32 desc_base_bufptr; /* (0C) buffer descrpitor current processing */
+} DmaStateRam;
+
+
+/*
+** DMA Registers
+*/
+typedef struct DmaRegs {
+ uint32 controller_cfg; /* (00) controller configuration */
+#define DMA_MASTER_EN 0x00000001
+#define DMA_FLOWC_CH1_EN 0x00000002
+#define DMA_FLOWC_CH3_EN 0x00000004
+
+ // Flow control Ch1
+ uint32 flowctl_ch1_thresh_lo; /* 004 */
+ uint32 flowctl_ch1_thresh_hi; /* 008 */
+ uint32 flowctl_ch1_alloc; /* 00c */
+#define DMA_BUF_ALLOC_FORCE 0x80000000
+
+ // Flow control Ch3
+ uint32 flowctl_ch3_thresh_lo; /* 010 */
+ uint32 flowctl_ch3_thresh_hi; /* 014 */
+ uint32 flowctl_ch3_alloc; /* 018 */
+
+ // Flow control Ch5
+ uint32 flowctl_ch5_thresh_lo; /* 01C */
+ uint32 flowctl_ch5_thresh_hi; /* 020 */
+ uint32 flowctl_ch5_alloc; /* 024 */
+
+ // Flow control Ch7
+ uint32 flowctl_ch7_thresh_lo; /* 028 */
+ uint32 flowctl_ch7_thresh_hi; /* 02C */
+ uint32 flowctl_ch7_alloc; /* 030 */
+
+ uint32 ctrl_channel_reset; /* 034 */
+ uint32 ctrl_channel_debug; /* 038 */
+ uint32 reserved1; /* 03C */
+ uint32 ctrl_global_interrupt_status; /* 040 */
+ uint32 ctrl_global_interrupt_mask; /* 044 */
+
+ // Unused words
+ uint8 reserved2[0x200-0x48];
+
+ // Per channel registers/state ram
+ DmaChannelCfg chcfg[IUDMA_MAX_CHANNELS];/* (200-3FF) Channel configuration */
+ union {
+ DmaStateRam s[IUDMA_MAX_CHANNELS];
+ uint32 u32[4 * IUDMA_MAX_CHANNELS];
+ } stram; /* (400-5FF) state ram */
+} DmaRegs;
+
+#define SW_DMA ((volatile DmaRegs * const) SWITCH_DMA_BASE)
+
+/*
+** DMA Buffer
+*/
+typedef struct DmaDesc {
+ union {
+ struct {
+ uint16 length; /* in bytes of data in buffer */
+#define DMA_DESC_USEFPM 0x8000
+#define DMA_DESC_MULTICAST 0x4000
+#define DMA_DESC_BUFLENGTH 0x0fff
+ uint16 status; /* buffer status */
+#define DMA_OWN 0x8000 /* cleared by DMA, set by SW */
+#define DMA_EOP 0x4000 /* last buffer in packet */
+#define DMA_SOP 0x2000 /* first buffer in packet */
+#define DMA_WRAP 0x1000 /* */
+#define DMA_PRIO 0x0C00 /* Prio for Tx */
+#define DMA_APPEND_BRCM_TAG 0x0200
+#define DMA_APPEND_CRC 0x0100
+#define USB_ZERO_PKT (1<< 0) // Set to send zero length packet
+ };
+ uint32 word0;
+ };
+
+ uint32 address; /* address of data */
+} DmaDesc;
+
+/*
+** 16 Byte DMA Buffer
+*/
+typedef struct {
+ union {
+ struct {
+ uint16 length; /* in bytes of data in buffer */
+#define DMA_DESC_USEFPM 0x8000
+#define DMA_DESC_MULTICAST 0x4000
+#define DMA_DESC_BUFLENGTH 0x0fff
+ uint16 status; /* buffer status */
+#define DMA_OWN 0x8000 /* cleared by DMA, set by SW */
+#define DMA_EOP 0x4000 /* last buffer in packet */
+#define DMA_SOP 0x2000 /* first buffer in packet */
+#define DMA_WRAP 0x1000 /* */
+#define DMA_PRIO 0x0C00 /* Prio for Tx */
+#define DMA_APPEND_BRCM_TAG 0x0200
+#define DMA_APPEND_CRC 0x0100
+#define USB_ZERO_PKT (1<< 0) // Set to send zero length packet
+ };
+ uint32 word0;
+ };
+
+ uint32 address; /* address of data */
+ uint32 control;
+#define GEM_ID_MASK 0x001F
+ uint32 reserved;
+} DmaDesc16;
+
+
+/*
+** USB 2.0 Device Registers
+*/
+typedef struct UsbRegisters {
+#define USBD_CONTROL_APP_DONECSR 0x0001
+#define USBD_CONTROL_APP_RESUME 0x0002
+#define USBD_CONTROL_APP_RXFIFIO_INIT 0x0040
+#define USBD_CONTROL_APP_TXFIFIO_INIT 0x0080
+#define USBD_CONTROL_APP_FIFO_SEL_SHIFT 0x8
+#define USBD_CONTROL_APP_FIFO_INIT_SEL(x) (((x)&0x0f)<<USBD_CONTROL_APP_FIFO_SEL_SHIFT)
+#define USBD_CONTROL_APP_AUTO_CSRS 0x2000
+#define USBD_CONTROL_APP_AUTO_INS_ZERO_LEN_PKT 0x4000
+#define EN_TXZLENINS (1<<14)
+#define EN_RXZSCFG (1<<12)
+#define APPSETUPERRLOCK (1<<5)
+ uint32 usbd_control ;
+#define USBD_STRAPS_APP_SELF_PWR 0x0400
+#define USBD_STRAPS_APP_DEV_DISCON 0x0200
+#define USBD_STRAPS_APP_CSRPRG_SUP 0x0100
+#define USBD_STRAPS_APP_RAM_IF 0x0080
+#define USBD_STRAPS_APP_DEV_RMTWKUP 0x0040
+#define USBD_STRAPS_APP_PHYIF_8BIT 0x0004
+#define USBD_STRAPS_FULL_SPEED 0x0003
+#define USBD_STRAPS_LOW_SPEED 0x0002
+#define USBD_STRAPS_HIGH_SPEED 0x0000
+#define APPUTMIDIR(x) ((x&1)<<3)
+#define UNIDIR 0
+ uint32 usbd_straps;
+#define USB_ENDPOINT_0 0x01
+ uint32 usbd_stall;
+#define USBD_ENUM_SPEED_SHIFT 12
+#define USBD_ENUM_SPEED 0x3000
+#define UDC20_ALTINTF(x) ((x>>8)&0xf)
+#define UDC20_INTF(x) ((x>>4)&0xf)
+#define UDC20_CFG(x) ((x>>0)&0xf)
+ uint32 usbd_status;
+#define USBD_LINK (0x1<<10)
+#define USBD_SET_CSRS 0x40
+#define USBD_SUSPEND 0x20
+#define USBD_EARLY_SUSPEND 0x10
+#define USBD_SOF 0x08
+#define USBD_ENUMON 0x04
+#define USBD_SETUP 0x02
+#define USBD_USBRESET 0x01
+ uint32 usbd_events;
+ uint32 usbd_events_irq;
+#define UPPER(x) (16+x)
+#define ENABLE(x) (1<<x)
+#define SWP_TXBSY (15)
+#define SWP_RXBSY (14)
+#define SETUP_ERR (13)
+#define APPUDCSTALLCHG (12)
+#define BUS_ERR (11)
+#define USB_LINK (10)
+#define HST_SETCFG (9)
+#define HST_SETINTF (8)
+#define ERRATIC_ERR (7)
+#define SET_CSRS (6)
+#define SUSPEND (5)
+#define ERLY_SUSPEND (4)
+#define SOF (3)
+#define ENUM_ON (2)
+#define SETUP (1)
+#define USB_RESET (0)
+#define RISING(x) (0x0<<2*x)
+#define FALLING(x) (0x1<<2*x)
+#define USBD_IRQCFG_ENUM_ON_FALLING_EDGE 0x00000010
+ uint32 usbd_irqcfg_hi ;
+ uint32 usbd_irqcfg_lo ;
+#define USBD_USB_RESET_IRQ 0x00000001
+#define USBD_USB_SETUP_IRQ 0x00000002 // non-standard setup cmd rcvd
+#define USBD_USB_ENUM_ON_IRQ 0x00000004
+#define USBD_USB_SOF_IRQ 0x00000008
+#define USBD_USB_EARLY_SUSPEND_IRQ 0x00000010
+#define USBD_USB_SUSPEND_IRQ 0x00000020 // non-standard setup cmd rcvd
+#define USBD_USB_SET_CSRS_IRQ 0x00000040
+#define USBD_USB_ERRATIC_ERR_IRQ 0x00000080
+#define USBD_USB_SETCFG_IRQ 0x00000200
+#define USBD_USB_LINK_IRQ 0x00000400
+ uint32 usbd_events_irq_mask;
+ uint32 usbd_swcfg;
+ uint32 usbd_swtxctl;
+ uint32 usbd_swrxctl;
+ uint32 usbd_txfifo_rwptr;
+ uint32 usbd_rxfifo_rwptr;
+ uint32 usbd_txfifo_st_rwptr;
+ uint32 usbd_rxfifo_st_rwptr;
+ uint32 usbd_txfifo_config ;
+ uint32 usbd_rxfifo_config ;
+ uint32 usbd_txfifo_epsize ;
+ uint32 usbd_rxfifo_epsize ;
+#define USBD_EPNUM_CTRL 0x0
+#define USBD_EPNUM_ISO 0x1
+#define USBD_EPNUM_BULK 0x2
+#define USBD_EPNUM_IRQ 0x3
+#define USBD_EPNUM_EPTYPE(x) (((x)&0x3)<<8)
+#define USBD_EPNUM_EPDMACHMAP(x) (((x)&0xf)<<0)
+ uint32 usbd_epnum_typemap ;
+ uint32 usbd_reserved [0xB] ;
+ uint32 usbd_csr_setupaddr ;
+#define USBD_EPNUM_MASK 0xf
+#define USBD_EPNUM(x) ((x&USBD_EPNUM_MASK)<<0)
+#define USBD_EPDIR_IN (1<<4)
+#define USBD_EPDIR_OUT (0<<4)
+#define USBD_EPTYP_CTRL (USBD_EPNUM_CTRL<<5)
+#define USBD_EPTYP_ISO (USBD_EPNUM_ISO<<5)
+#define USBD_EPTYP_BULK (USBD_EPNUM_BULK<<5)
+#define USBD_EPTYP_IRQ (USBD_EPNUM_IRQ<<5)
+#define USBD_EPCFG_MASK 0xf
+#define USBD_EPCFG(x) ((x&USBD_EPCFG_MASK)<<7)
+#define USBD_EPINTF_MASK 0xf
+#define USBD_EPINTF(x) ((x&USBD_EPINTF_MASK)<<11)
+#define USBD_EPAINTF_MASK 0xf
+#define USBD_EPAINTF(x) ((x&USBD_EPAINTF_MASK)<<15)
+#define USBD_EPMAXPKT_MSK 0x7ff
+#define USBD_EPMAXPKT(x) ((x&USBD_EPMAXPKT_MSK)<<19)
+#define USBD_EPISOPID_MASK 0x3
+#define USBD_EPISOPID(x) ((x&USBD_ISOPID_MASK)<<30)
+ uint32 usbd_csr_ep [5] ;
+} UsbRegisters;
+
+#define USB ((volatile UsbRegisters * const) USB_CTL_BASE)
+
+typedef struct USBControl {
+ uint32 BrtControl1;
+ uint32 BrtControl2;
+ uint32 BrtStatus1;
+ uint32 BrtStatus2;
+ uint32 UTMIControl1;
+#define USB_DEVICE_MODE_SEL (1<<0)
+ uint32 TestPortControl;
+ uint32 PllControl1;
+ uint32 SwapControl;
+#define USB_DEVICE_SEL (1<<6)
+#define EHCI_LOGICAL_ADDRESS_EN (1<<5)
+#define EHCI_ENDIAN_SWAP (1<<4)
+#define EHCI_DATA_SWAP (1<<3)
+#define OHCI_LOGICAL_ADDRESS_EN (1<<2)
+#define OHCI_ENDIAN_SWAP (1<<1)
+#define OHCI_DATA_SWAP (1<<0)
+ uint32 GenericControl;
+#define PLL_SUSPEND_EN (1<<1)
+ uint32 FrameAdjustValue;
+ uint32 Setup;
+#define USBH_IOC (1<<4)
+ uint32 MDIO;
+ uint32 MDIO32;
+ uint32 USBSimControl;
+} USBControl;
+
+#define USBH ((volatile USBControl * const) USBH_CFG_BASE)
+
+typedef struct EthSwRegs{
+ byte port_traffic_ctrl[9]; /* 0x00 - 0x08 */
+ byte reserved1[2]; /* 0x09 - 0x0a */
+ byte switch_mode; /* 0x0b */
+ unsigned short pause_quanta; /*0x0c */
+ byte imp_port_state; /*0x0e */
+ byte led_refresh; /* 0x0f */
+ unsigned short led_function[2]; /* 0x10 */
+ unsigned short led_function_map; /* 0x14 */
+ unsigned short led_enable_map; /* 0x16 */
+ unsigned short led_mode_map0; /* 0x18 */
+ unsigned short led_function_map1; /* 0x1a */
+ byte reserved2[5]; /* 0x1b - 0x20 */
+ byte port_forward_ctrl; /* 0x21 */
+ byte reserved3[2]; /* 0x22 - 0x23 */
+ unsigned short protected_port_selection; /* 0x24 */
+ unsigned short wan_port_select; /* 0x26 */
+ unsigned int pause_capability; /* 0x28 */
+ byte reserved4[3]; /* 0x2c - 0x2e */
+ byte reserved_multicast_control; /* 0x2f */
+ byte reserved5; /* 0x30 */
+ byte txq_flush_mode_control; /* 0x31 */
+ unsigned short ulf_forward_map; /* 0x32 */
+ unsigned short mlf_forward_map; /* 0x34 */
+ unsigned short mlf_impc_forward_map; /* 0x36 */
+ unsigned short pause_pass_through_for_rx; /* 0x38 */
+ unsigned short pause_pass_through_for_tx; /* 0x3a */
+ unsigned short disable_learning; /* 0x3c */
+ byte reserved6[26]; /* 0x3e - 0x57 */
+ byte port_state_override[8]; /* 0x58 - 0x5f */
+ byte reserved7[4]; /* 0x60 - 0x63 */
+ byte imp_rgmii_ctrl_p4; /* 0x64 */
+ byte imp_rgmii_ctrl_p5; /* 0x65 */
+ byte reserved8[6]; /* 0x66 - 0x6b */
+ byte rgmii_timing_delay_p4; /* 0x6c */
+ byte gmii_timing_delay_p5; /* 0x6d */
+ byte reserved9[11]; /* 0x6e - 0x78 */
+ byte software_reset; /* 0x79 */
+ byte reserved13[6]; /* 0x7a - 0x7f */
+ byte pause_frame_detection; /* 0x80 */
+ byte reserved10[7]; /* 0x81 - 0x87 */
+ byte fast_aging_ctrl; /* 0x88 */
+ byte fast_aging_port; /* 0x89 */
+ byte fast_aging_vid; /* 0x8a */
+ byte reserved11[21]; /* 0x8b - 0x9f */
+ unsigned int swpkt_ctrl_sar; /*0xa0 */
+ unsigned int swpkt_ctrl_usb; /*0xa4 */
+ unsigned int iudma_ctrl; /*0xa8 */
+ unsigned int rxfilt_ctrl; /*0xac */
+ unsigned int mdio_ctrl; /*0xb0 */
+ unsigned int mdio_data; /*0xb4 */
+ byte reserved12[42]; /* 0xb6 - 0xdf */
+ unsigned int sw_mem_test; /*0xe0 */
+} EthSwRegs;
+
+#define ETHSWREG ((volatile EthSwRegs * const) SWITCH_BASE)
+
+typedef struct EthSwMIBRegs {
+ unsigned int TxOctetsLo;
+ unsigned int TxOctetsHi;
+ unsigned int TxDropPkts;
+ unsigned int TxQoSPkts;
+ unsigned int TxBroadcastPkts;
+ unsigned int TxMulticastPkts;
+ unsigned int TxUnicastPkts;
+ unsigned int TxCol;
+ unsigned int TxSingleCol;
+ unsigned int TxMultipleCol;
+ unsigned int TxDeferredTx;
+ unsigned int TxLateCol;
+ unsigned int TxExcessiveCol;
+ unsigned int TxFrameInDisc;
+ unsigned int TxPausePkts;
+ unsigned int TxQoSOctetsLo;
+ unsigned int TxQoSOctetsHi;
+ unsigned int RxOctetsLo;
+ unsigned int RxOctetsHi;
+ unsigned int RxUndersizePkts;
+ unsigned int RxPausePkts;
+ unsigned int Pkts64Octets;
+ unsigned int Pkts65to127Octets;
+ unsigned int Pkts128to255Octets;
+ unsigned int Pkts256to511Octets;
+ unsigned int Pkts512to1023Octets;
+ unsigned int Pkts1024to1522Octets;
+ unsigned int RxOversizePkts;
+ unsigned int RxJabbers;
+ unsigned int RxAlignErrs;
+ unsigned int RxFCSErrs;
+ unsigned int RxGoodOctetsLo;
+ unsigned int RxGoodOctetsHi;
+ unsigned int RxDropPkts;
+ unsigned int RxUnicastPkts;
+ unsigned int RxMulticastPkts;
+ unsigned int RxBroadcastPkts;
+ unsigned int RxSAChanges;
+ unsigned int RxFragments;
+ unsigned int RxExcessSizeDisc;
+ unsigned int RxSymbolError;
+ unsigned int RxQoSPkts;
+ unsigned int RxQoSOctetsLo;
+ unsigned int RxQoSOctetsHi;
+ unsigned int Pkts1523to2047;
+ unsigned int Pkts2048to4095;
+ unsigned int Pkts4096to8191;
+ unsigned int Pkts8192to9728;
+} EthSwMIBRegs;
+
+#define ETHSWMIBREG ((volatile EthSwMIBRegs * const) (SWITCH_BASE + 0x2000))
+
+/*
+** NAND Interrupt Controller Registers
+*/
+typedef struct NandIntrCtrlRegs {
+ uint32 NandInterrupt;
+#define NINT_ENABLE_MASK 0xffff0000
+#define NINT_STS_MASK 0x00000fff
+#define NINT_ECC_ERROR_CORR 0x00000080
+#define NINT_ECC_ERROR_UNC 0x00000040
+#define NINT_DEV_RBPIN 0x00000020
+#define NINT_CTRL_READY 0x00000010
+#define NINT_PAGE_PGM 0x00000008
+#define NINT_COPY_BACK 0x00000004
+#define NINT_BLOCK_ERASE 0x00000002
+#define NINT_NP_READ 0x00000001
+
+ uint32 NandBaseAddr0; /* Default address when booting from NAND flash */
+ uint32 reserved;
+ uint32 NandBaseAddr1; /* Secondary base address for NAND flash */
+} NandIntrCtrlRegs;
+
+#define NAND_INTR ((volatile NandIntrCtrlRegs * const) NAND_INTR_BASE)
+
+/*
+** NAND Controller Registers
+*/
+typedef struct NandCtrlRegs {
+ uint32 NandRevision; /* NAND Revision */
+ uint32 NandCmdStart; /* Nand Flash Command Start */
+#define NCMD_MASK 0x0f000000
+#define NCMD_BLK_LOCK_STS 0x0d000000
+#define NCMD_BLK_UNLOCK 0x0c000000
+#define NCMD_BLK_LOCK_DOWN 0x0b000000
+#define NCMD_BLK_LOCK 0x0a000000
+#define NCMD_FLASH_RESET 0x09000000
+#define NCMD_BLOCK_ERASE 0x08000000
+#define NCMD_DEV_ID_READ 0x07000000
+#define NCMD_COPY_BACK 0x06000000
+#define NCMD_PROGRAM_SPARE 0x05000000
+#define NCMD_PROGRAM_PAGE 0x04000000
+#define NCMD_STS_READ 0x03000000
+#define NCMD_SPARE_READ 0x02000000
+#define NCMD_PAGE_READ 0x01000000
+
+ uint32 NandCmdExtAddr; /* Nand Flash Command Extended Address */
+ uint32 NandCmdAddr; /* Nand Flash Command Address */
+ uint32 NandCmdEndAddr; /* Nand Flash Command End Address */
+ uint32 NandNandBootConfig; /* Nand Flash Boot Config */
+#define NBC_CS_LOCK 0x80000000
+#define NBC_AUTO_DEV_ID_CFG 0x40000000
+#define NBC_WR_PROT_BLK0 0x10000000
+
+ uint32 NandCsNandXor; /* Nand Flash EBI CS Address XOR with */
+ /* 1FC0 Control */
+ uint32 NandReserved;
+ uint32 NandSpareAreaReadOfs0; /* Nand Flash Spare Area Read Bytes 0-3 */
+ uint32 NandSpareAreaReadOfs4; /* Nand Flash Spare Area Read Bytes 4-7 */
+ uint32 NandSpareAreaReadOfs8; /* Nand Flash Spare Area Read Bytes 8-11 */
+ uint32 NandSpareAreaReadOfsC; /* Nand Flash Spare Area Read Bytes 12-15*/
+ uint32 NandSpareAreaWriteOfs0; /* Nand Flash Spare Area Write Bytes 0-3 */
+ uint32 NandSpareAreaWriteOfs4; /* Nand Flash Spare Area Write Bytes 4-7 */
+ uint32 NandSpareAreaWriteOfs8; /* Nand Flash Spare Area Write Bytes 8-11*/
+ uint32 NandSpareAreaWriteOfsC; /* Nand Flash Spare Area Write Bytes12-15*/
+ uint32 NandAccControl; /* Nand Flash Access Control */
+ uint32 NandConfig; /* Nand Flash Config */
+#define NC_CONFIG_LOCK 0x80000000
+#define NC_PG_SIZE_MASK 0x00300000
+#define NC_PG_SIZE_2K 0x00100000
+#define NC_PG_SIZE_512B 0x00000000
+#define NC_BLK_SIZE_MASK 0x30000000
+#define NC_BLK_SIZE_512K 0x30000000
+#define NC_BLK_SIZE_128K 0x10000000
+#define NC_BLK_SIZE_16K 0x00000000
+#define NC_BLK_SIZE_8K 0x20000000
+#define NC_DEV_SIZE_MASK 0x0f000000
+#define NC_DEV_SIZE_SHIFT 24
+#define NC_DEV_WIDTH_MASK 0x00800000
+#define NC_DEV_WIDTH_16 0x00800000
+#define NC_DEV_WIDTH_8 0x00000000
+#define NC_FUL_ADDR_MASK 0x00070000
+#define NC_FUL_ADDR_SHIFT 16
+#define NC_BLK_ADDR_MASK 0x00000700
+#define NC_BLK_ADDR_SHIFT 8
+
+ uint32 NandTiming1; /* Nand Flash Timing Parameters 1 */
+ uint32 NandTiming2; /* Nand Flash Timing Parameters 2 */
+ uint32 NandSemaphore; /* Semaphore */
+ uint32 NandFlashDeviceId; /* Nand Flash Device ID */
+ uint32 NandBlockLockStatus; /* Nand Flash Block Lock Status */
+ uint32 NandIntfcStatus; /* Nand Flash Interface Status */
+#define NIS_CTLR_READY 0x80000000
+#define NIS_FLASH_READY 0x40000000
+#define NIS_CACHE_VALID 0x20000000
+#define NIS_SPARE_VALID 0x10000000
+#define NIS_FLASH_STS_MASK 0x000000ff
+#define NIS_WRITE_PROTECT 0x00000080
+#define NIS_DEV_READY 0x00000040
+#define NIS_PGM_ERASE_ERROR 0x00000001
+
+ uint32 NandEccCorrExtAddr; /* ECC Correctable Error Extended Address*/
+ uint32 NandEccCorrAddr; /* ECC Correctable Error Address */
+ uint32 NandEccUncExtAddr; /* ECC Uncorrectable Error Extended Addr */
+ uint32 NandEccUncAddr; /* ECC Uncorrectable Error Address */
+ uint32 NandFlashReadExtAddr; /* Flash Read Data Extended Address */
+ uint32 NandFlashReadAddr; /* Flash Read Data Address */
+ uint32 NandProgramPageExtAddr; /* Page Program Extended Address */
+ uint32 NandProgramPageAddr; /* Page Program Address */
+ uint32 NandCopyBackExtAddr; /* Copy Back Extended Address */
+ uint32 NandCopyBackAddr; /* Copy Back Address */
+ uint32 NandBlockEraseExtAddr; /* Block Erase Extended Address */
+ uint32 NandBlockEraseAddr; /* Block Erase Address */
+ uint32 NandInvReadExtAddr; /* Flash Invalid Data Extended Address */
+ uint32 NandInvReadAddr; /* Flash Invalid Data Address */
+ uint32 NandBlkWrProtect; /* Block Write Protect Enable and Size */
+ /* for EBI_CS0b */
+} NandCtrlRegs;
+
+#define NAND ((volatile NandCtrlRegs * const) NAND_REG_BASE)
+
+#define NAND_CACHE ((volatile uint8 * const) NAND_CACHE_BASE)
+
+/*
+** PCI-E
+*/
+typedef struct PcieRegs{
+ uint32 devVenID;
+ uint16 command;
+ uint16 status;
+ uint32 revIdClassCode;
+ uint32 headerTypeLatCacheLineSize;
+ uint32 bar1;
+ uint32 bar2;
+ uint32 priSecBusNo;
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SUB_BUS_NO_MASK 0x00ff0000
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SUB_BUS_NO_SHIFT 16
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SEC_BUS_NO_MASK 0x0000ff00
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SEC_BUS_NO_SHIFT 8
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_PRI_BUS_NO_MASK 0x000000ff
+
+ uint32 ioBaseLimit;
+ uint32 secStatus;
+ uint32 rcMemBaseLimit;
+ uint32 rcPrefBaseLimit;
+ uint32 rcPrefBaseHi;
+ uint32 rcPrefLimitHi;
+ uint32 rcIoBaseLimit;
+ uint32 capPointer;
+ uint32 expRomBase;
+ uint32 brdigeCtrlIntPinIntLine;
+ uint32 bridgeCtrl;
+ uint32 unused1[27];
+
+ /* PcieExpressCtrlRegs */
+ uint16 pciExpressCap;
+ uint16 pcieCapabilitiy;
+ uint32 deviceCapability;
+ uint16 deviceControl;
+ uint16 deviceStatus;
+ uint32 linkCapability;
+ uint16 linkControl;
+ uint16 linkStatus;
+ uint32 slotCapability;
+ uint16 slotControl;
+ uint16 slotStatus;
+ uint16 rootControl;
+ uint16 rootCap;
+ uint32 rootStatus;
+ uint32 deviceCapability2;
+ uint16 deviceControl2;
+ uint16 deviceStatus2;
+ uint32 linkCapability2;
+ uint16 linkControl2;
+ uint16 linkStatus2;
+ uint32 slotCapability2;
+ uint16 slotControl2;
+ uint16 slotStatus2;
+ uint32 unused2[6];
+
+ /* PcieErrorRegs */
+ uint16 advErrCapId;
+ uint16 advErrCapOff;
+ uint32 ucErrStatus;
+ uint32 ucorrErrMask;
+ uint32 ucorrErrSevr;
+ uint32 corrErrStatus;
+ uint32 corrErrMask;
+ uint32 advErrCapControl;
+ uint32 headerLog1;
+ uint32 headerLog2;
+ uint32 headerLog3;
+ uint32 headerLog4;
+ uint32 rootErrorCommand;
+ uint32 rootErrorStatus;
+ uint32 rcCorrId;
+ uint32 rcFatalNonfatalId;
+ uint32 unused3[10];
+
+ /* PcieVcRegs */
+ uint16 vcCapId;
+ uint16 vcCapOffset;
+ uint32 prtVcCapability;
+ uint32 portVcCapability2;
+ uint16 portVcControl;
+ uint16 portVcCtatus;
+ uint32 portArbStatus;
+ uint32 vcRsrcControl;
+ uint32 vcRsrcStatus;
+ uint32 unused4[1];
+
+ /* PcieVendor */
+ uint32 vendorCapability;
+ uint32 vendorSpecificHdr;
+} PcieRegs;
+
+typedef struct PcieBlk404Regs{
+ uint32 unused; /* 0x404 */
+ uint32 config2; /* 0x408 */
+#define PCIE_IP_BLK404_CONFIG_2_BAR1_SIZE_MASK 0x0000000f
+#define PCIE_IP_BLK404_CONFIG_2_BAR1_DISABLE 0
+ uint32 config3; /* 0x40c */
+ uint32 pmDataA; /* 0x410 */
+ uint32 pmDataB; /* 0x414 */
+} PcieBlk404Regs;
+
+typedef struct PcieBlk428Regs{
+ uint32 vpdIntf; /* 0x428 */
+ uint16 unused_g; /* 0x42c */
+ uint16 vpdAddrFlag; /* 0x42e */
+ uint32 vpdData; /* 0x430 */
+ uint32 idVal1; /* 0x434 */
+ uint32 idVal2; /* 0x438 */
+ uint32 idVal3; /* 0x43c */
+#define PCIE_IP_BLK428_ID_VAL3_REVISION_ID_MASK 0xff000000
+#define PCIE_IP_BLK428_ID_VAL3_REVISION_ID_SHIFT 24
+#define PCIE_IP_BLK428_ID_VAL3_CLASS_CODE_MASK 0x00ffffff
+#define PCIE_IP_BLK428_ID_VAL3_CLASS_CODE_SHIFT 16
+#define PCIE_IP_BLK428_ID_VAL3_SUB_CLASS_CODE_SHIFT 8
+
+ uint32 idVal4;
+ uint32 idVal5;
+ uint32 unused_h;
+ uint32 idVal6;
+ uint32 msiData;
+ uint32 msiAddr_h;
+ uint32 msiAddr_l;
+ uint32 msiMask;
+ uint32 msiPend;
+ uint32 pmData_c;
+ uint32 msixControl;
+ uint32 msixTblOffBir;
+ uint32 msixPbaOffBit;
+ uint32 unused_k;
+ uint32 pcieCapability;
+ uint32 deviceCapability;
+ uint32 unused_l;
+ uint32 linkCapability;
+ uint32 bar2Config;
+ uint32 pcieDeviceCapability2;
+ uint32 pcieLinkCapability2;
+ uint32 pcieLinkControl;
+ uint32 pcieLinkCapabilityRc;
+ uint32 bar3Config;
+ uint32 rootCap;
+ uint32 devSerNumCapId;
+ uint32 lowerSerNum;
+ uint32 upperSerNum;
+ uint32 advErrCap;
+ uint32 pwrBdgtData0;
+ uint32 pwrBdgtData1;
+ uint32 pwrBdgtData2;
+ uint32 pwdBdgtData3;
+ uint32 pwrBdgtData4;
+ uint32 pwrBdgtData5;
+ uint32 pwrBdgtData6;
+ uint32 pwrBdgtData7;
+ uint32 pwrBdgtCapability;
+ uint32 vsecHdr;
+ uint32 rcUserMemLo1;
+ uint32 rcUserMemHi1;
+ uint32 rcUserMemLo2;
+ uint32 rcUserMemHi2;
+}PcieBlk428Regs;
+
+typedef struct PcieBlk800Regs{
+#define NUM_PCIE_BLK_800_CTRL_REGS 6
+ uint32 tlControl[NUM_PCIE_BLK_800_CTRL_REGS];
+ uint32 tlCtlStat0;
+ uint32 pmStatus0;
+ uint32 pmStatus1;
+
+#define NUM_PCIE_BLK_800_TAGS 32
+ uint32 tlStatus[NUM_PCIE_BLK_800_TAGS];
+ uint32 tlHdrFcStatus;
+ uint32 tlDataFcStatus;
+ uint32 tlHdrFcconStatus;
+ uint32 tlDataFcconStatus;
+ uint32 tlTargetCreditStatus;
+ uint32 tlCreditAllocStatus;
+ uint32 tlSmlogicStatus;
+} PcieBlk800Regs;
+
+
+typedef struct PcieBlk1000Regs{
+#define NUM_PCIE_BLK_1000_PDL_CTRL_REGS 16
+ uint32 pdlControl[NUM_PCIE_BLK_1000_PDL_CTRL_REGS];
+ uint32 dlattnVec;
+ uint32 dlAttnMask;
+ uint32 dlStatus; /* 0x1048 */
+#define PCIE_IP_BLK1000_DL_STATUS_PHYLINKUP_MASK 0x00002000
+#define PCIE_IP_BLK1000_DL_STATUS_PHYLINKUP_SHIFT 13
+ uint32 dlTxChecksum;
+ uint32 dlForcedUpdateGen1;
+ uint32 mdioAddr;
+ uint32 mdioWrData;
+ uint32 mdioRdData;
+ uint32 dlRxPFcCl;
+ uint32 dlRxCFcCl;
+ uint32 dlRxAckNack;
+ uint32 dlTxRxSeqnb;
+ uint32 dlTxPFcAl;
+ uint32 dlTxNpFcAl;
+ uint32 regDlSpare;
+ uint32 dlRegSpare;
+ uint32 dlTxRxSeq;
+ uint32 dlRxNpFcCl;
+}PcieBlk1000Regs;
+
+typedef struct PcieBlk1800Regs{
+#define NUM_PCIE_BLK_1800_PHY_CTRL_REGS 5
+ uint32 phyCtrl[NUM_PCIE_BLK_1800_PHY_CTRL_REGS];
+#define REG_POWERDOWN_P1PLL_ENA (1<<12)
+ uint32 phyErrorAttnVec;
+ uint32 phyErrorAttnMask;
+ uint32 phyReceivedMcpErrors;
+ uint32 phyTransmittedMcpErrors;
+ uint32 phyGenDebug;
+ uint32 phyRecoveryHist;
+#define NUM_PCIE_BLK_1800_PHY_LTSSM_HIST_REGS 3
+ uint32 phyltssmHist[NUM_PCIE_BLK_1800_PHY_LTSSM_HIST_REGS];
+#define NUM_PCIE_BLK_1800_PHY_DBG_REGS 11
+ uint32 phyDbg[NUM_PCIE_BLK_1800_PHY_DBG_REGS];
+} PcieBlk1800Regs;
+
+typedef struct PcieBridgeRegs{
+ uint32 bar1Remap; /* 0x0818*/
+#define PCIE_BRIDGE_BAR1_REMAP_addr_MASK 0xffff0000
+#define PCIE_BRIDGE_BAR1_REMAP_addr_MASK_SHIFT 16
+#define PCIE_BRIDGE_BAR1_REMAP_remap_enable (1<<1)
+#define PCIE_BRIDGE_BAR1_REMAP_swap_enable 1
+
+ uint32 bar2Remap; /* 0x081c*/
+#define PCIE_BRIDGE_BAR2_REMAP_addr_MASK 0xffff0000
+#define PCIE_BRIDGE_BAR2_REMAP_addr_MASK_SHIFT 16
+#define PCIE_BRIDGE_BAR2_REMAP_remap_enable (1<<1)
+#define PCIE_BRIDGE_BAR2_REMAP_swap_enable 1
+
+ uint32 bridgeOptReg1; /* 0x0820*/
+#define PCIE_BRIDGE_OPT_REG1_en_l1_int_status_mask_polarity (1<<12)
+#define PCIE_BRIDGE_OPT_REG1_en_pcie_bridge_hole_detection (1<<11)
+#define PCIE_BRIDGE_OPT_REG1_en_rd_reply_be_fix (1<<9)
+#define PCIE_BRIDGE_OPT_REG1_enable_rd_be_opt (1<<7)
+
+ uint32 bridgeOptReg2; /* 0x0824*/
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_func_no_MASK 0xe0000000
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_func_no_SHIFT 29
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_dev_no_MASK 0x1f000000
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_dev_no_SHIFT 24
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bus_no_MASK 0x00ff0000
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bus_no_SHIFT 16
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bd_sel_MASK 0x00000080
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bd_sel_SHIFT 7
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_timeout_MASK 0x00000040
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_timeout_SHIFT 6
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_abort_MASK 0x00000020
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_abort_SHIFT 5
+#define PCIE_BRIDGE_OPT_REG2_enable_tx_crd_chk_MASK 0x00000010
+#define PCIE_BRIDGE_OPT_REG2_enable_tx_crd_chk_SHIFT 4
+#define PCIE_BRIDGE_OPT_REG2_dis_ubus_ur_decode_MASK 0x00000004
+#define PCIE_BRIDGE_OPT_REG2_dis_ubus_ur_decode_SHIFT 2
+#define PCIE_BRIDGE_OPT_REG2_cfg_reserved_MASK 0x0000ff0b
+
+ uint32 Ubus2PcieBar0BaseMask; /* 0x0828 */
+#define PCIE_BRIDGE_BAR0_BASE_base_MASK 0xfff00000
+#define PCIE_BRIDGE_BAR0_BASE_base_MASK_SHIFT 20
+#define PCIE_BRIDGE_BAR0_BASE_mask_MASK 0x0000fff0
+#define PCIE_BRIDGE_BAR0_BASE_mask_MASK_SHIFT 4
+#define PCIE_BRIDGE_BAR0_BASE_swap_enable (1<<1)
+#define PCIE_BRIDGE_BAR0_BASE_remap_enable 1
+
+ uint32 Ubus2PcieBar0RemapAdd; /* 0x082c */
+#define PCIE_BRIDGE_BAR0_REMAP_ADDR_addr_MASK 0xfff00000
+#define PCIE_BRIDGE_BAR0_REMAP_ADDR_addr_SHIFT 20
+
+ uint32 Ubus2PcieBar1BaseMask; /* 0x0830 */
+#define PCIE_BRIDGE_BAR1_BASE_base_MASK 0xfff00000
+#define PCIE_BRIDGE_BAR1_BASE_base_MASK_SHIFT 20
+#define PCIE_BRIDGE_BAR1_BASE_mask_MASK 0x0000fff0
+#define PCIE_BRIDGE_BAR1_BASE_mask_MASK_SHIFT 4
+#define PCIE_BRIDGE_BAR1_BASE_swap_enable (1<<1)
+#define PCIE_BRIDGE_BAR1_BASE_remap_enable 1
+
+ uint32 Ubus2PcieBar1RemapAdd; /* 0x0834 */
+#define PCIE_BRIDGE_BAR1_REMAP_ADDR_addr_MASK 0xfff00000
+#define PCIE_BRIDGE_BAR1_REMAP_ADDR_addr_SHIFT 20
+
+ uint32 bridgeErrStatus; /* 0x0838 */
+ uint32 bridgeErrMask; /* 0x083c */
+ uint32 coreErrStatus2; /* 0x0840 */
+ uint32 coreErrMask2; /* 0x0844 */
+ uint32 coreErrStatus1; /* 0x0848 */
+ uint32 coreErrMask1; /* 0x084c */
+ uint32 rcInterruptStatus; /* 0x0850 */
+ uint32 rcInterruptMask; /* 0x0854 */
+#define PCIE_BRIDGE_INTERRUPT_MASK_int_a_MASK (1<<0)
+#define PCIE_BRIDGE_INTERRUPT_MASK_int_b_MASK (1<<1)
+#define PCIE_BRIDGE_INTERRUPT_MASK_int_c_MASK (1<<2)
+#define PCIE_BRIDGE_INTERRUPT_MASK_int_d_MASK (1<<3)
+
+}PcieBridgeRegs;
+
+#define PCIEH_DEV_OFFSET 0x8000
+#define PCIEH ((volatile uint32 * const) PCIE_BASE)
+#define PCIEH_REGS ((volatile PcieRegs * const) PCIE_BASE)
+
+#define PCIEH_BLK_404_REGS ((volatile PcieBlk404Regs * const) \
+ (PCIE_BASE+0x404))
+#define PCIEH_BLK_428_REGS ((volatile PcieBlk428Regs * const) \
+ (PCIE_BASE+0x428))
+#define PCIEH_BLK_800_REGS ((volatile PcieBlk800Regs * const) \
+ (PCIE_BASE+0x800))
+#define PCIEH_BLK_1000_REGS ((volatile PcieBlk1000Regs * const) \
+ (PCIE_BASE+0x1000))
+#define PCIEH_BLK_1800_REGS ((volatile PcieBlk1800Regs * const) \
+ (PCIE_BASE+0x1800))
+#define PCIEH_BRIDGE_REGS ((volatile PcieBridgeRegs * const) \
+ (PCIE_BASE+0x2818))
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/shared/broadcom/include/bcm963xx/6362_common.h b/shared/broadcom/include/bcm963xx/6362_common.h
new file mode 100755
index 0000000..843355a
--- /dev/null
+++ b/shared/broadcom/include/bcm963xx/6362_common.h
@@ -0,0 +1,326 @@
+/*
+<:copyright-broadcom
+
+ Copyright (c) 2007 Broadcom Corporation
+ All Rights Reserved
+ No portions of this material may be reproduced in any form without the
+ written permission of:
+ Broadcom Corporation
+ 16215 Alton Parkway
+ Irvine, California 92619
+ All information contained in this document is Broadcom Corporation
+ company private, proprietary, and trade secret.
+
+:>
+*/
+/***********************************************************************/
+/* */
+/* MODULE: 6362_common.h */
+/* DATE: 02/01/08 */
+/* PURPOSE: Define addresses of major hardware components of */
+/* BCM6362 */
+/* */
+/***********************************************************************/
+#ifndef __BCM6362_MAP_COMMON_H
+#define __BCM6362_MAP_COMMON_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define PERF_BASE 0xb0000000 /* chip control registers */
+#define TIMR_BASE 0xb0000040 /* timer registers */
+#define NAND_INTR_BASE 0xb0000070 /* nand interrupt control registers */
+#define GPIO_BASE 0xb0000080 /* gpio registers */
+#define UART_BASE 0xb0000100 /* uart registers */
+#define UART1_BASE 0xb0000120 /* uart registers */
+#define NAND_REG_BASE 0xb0000200
+#define OTP_BASE 0xb0000400
+#define UBUS_STAT_BASE 0xb0000500
+#define NAND_CACHE_BASE 0xb0000600
+#define SPI_BASE 0xb0000800 /* SPI master controller registers */
+#define HSSPIM_BASE 0xb0001000 /* High-Speed SPI registers */
+#define ADSL_CTRL_BASE 0xb0001800
+#define MISC_BASE 0xb0001800 /* Miscellaneous Registers */
+#define LED_BASE 0xb0001900 /* LED control registers */
+#define USB_CTL_BASE 0xb0002400 /* USB 2.0 device control registers */
+#define USB_EHCI_BASE 0x10002500 /* USB host registers */
+#define USB_OHCI_BASE 0x10002600 /* USB host registers */
+#define USBH_CFG_BASE 0xb0002700
+#define IPSEC_BASE 0xb0002800
+#define DDR_BASE 0xb0003000 /* Memory control registers */
+#define WLAN_CHIPC_BASE 0x10004000 /* WLAN ChipCommon registers, use 1xxx for ioremap */
+#define WLAN_MAC_BASE 0x10005000 /* WLAN d11mac registers */
+#define WLAN_SHIM_BASE 0xb0007000 /* shim interface to WLAN */
+#define PCM_BASE 0xb000a000
+#define PCM_DMA_BASE 0xb000a800 /* PCM UIDMA register base */
+#define SAR_DMA_BASE 0xb000b800 /* ATM SAR DMA control registers */
+#define USB_DMA_BASE 0xb000c000 /* USB 2.0 device DMA regiseters */
+#define IPSEC_DMA_BASE 0xb000d000
+#define SWITCH_DMA_BASE 0xb000d800
+#define SWITCH_BASE 0xb0e00000
+#define PCIE_BASE 0xb0e40000
+#define DECT_SHIM_CTRL_BASE 0xb000b000
+#define DECT_SHIM_DMA_CTRL_BASE 0xb000b050
+#define DECT_SHIM_TEST_BASE 0xb000b0f0
+#define DECT_APB_REG_BASE 0xb000e000
+#define DECT_AHB_SHARED_RAM_BASE 0xb0e50000
+#define DECT_AHB_REG_BASE 0xb0e57f80
+
+
+/*
+#####################################################################
+# System PLL Control Register
+#####################################################################
+*/
+
+/*
+#####################################################################
+# GPIO Control Registers
+#####################################################################
+*/
+/*
+#####################################################################
+# Miscellaneous Registers
+#####################################################################
+*/
+#define MISC_MEMC_CONTROL 0x10
+#define MISC_STRAP_BUS 0x14
+#define MISC_STRAP_BUS_MIPS_PLL_FVCO_SHIFT 1
+
+#define MISC_VREG_CONTROL0 0x1C
+#define MISC_VREG_CONTROL0_VREG_ADJ_SHIFT 8
+#define MISC_VREG_CONTROL0_VREG_OSC1P2_SHIFT 20
+#define MISC_VREG_CONTROL0_VREG_OSC1P8_SHIFT 22
+#define MISC_VREG_CONTROL0_VREG_RAMP1P2_SHIFT 26
+#define MISC_VREG_CONTROL0_VREG_RAMP1P8_SHIFT 29
+
+#define MISC_VREG_CONTROL1 0x20
+#define MISC_VREG_CONTROL1_VREG_ISEL2P5_SHIFT 13
+#define MISC_VREG_CONTROL1_VREG_ISEL2P5_MASK 0x0001e000
+#define MISC_VREG_LDO_2P61 1
+
+#define MISC_VREG_CONTROL2 0x24
+
+/*
+#####################################################################
+# Memory Control Registers
+#####################################################################
+*/
+#define DDR_CTL_CNFG 0x000
+#define DDR_CTL_CSST 0x004
+#define DDR_CTL_CSEND 0x008
+#define DDR_CTL_ROW00_0 0x010
+#define DDR_CTL_ROW00_1 0x014
+#define DDR_CTL_ROW01_0 0x018
+#define DDR_CTL_ROW01_1 0x01c
+#define DDR_CTL_ROW20_0 0x030
+#define DDR_CTL_ROW20_1 0x034
+#define DDR_CTL_ROW21_0 0x038
+#define DDR_CTL_ROW21_1 0x03c
+#define DDR_CTL_COL00_0 0x050
+#define DDR_CTL_COL00_1 0x054
+#define DDR_CTL_COL01_0 0x058
+#define DDR_CTL_COL01_1 0x05c
+#define DDR_CTL_COL20_0 0x070
+#define DDR_CTL_COL20_1 0x074
+#define DDR_CTL_COL21_0 0x078
+#define DDR_CTL_COL21_1 0x07c
+#define DDR_CTL_BNK10 0x090
+#define DDR_CTL_BNK32 0x094
+#define DDR_CTL_DCMD 0x100
+#define DDR_CTL_DMODE_0 0x104
+#define DDR_CTL_DMODE_1 0x108
+#define DDR_CTL_CLKS 0x10c
+#define DDR_CTL_ODT 0x110
+#define DDR_CTL_TIM1_0 0x114
+#define DDR_CTL_TIM1_1 0x118
+#define DDR_CTL_TIM2 0x11c
+#define DDR_CTL_CTL_CRC 0x120
+#define DDR_CTL_DOUT_CRC 0x124
+#define DDR_CTL_DIN_CRC 0x128
+#define PHY_CONTROL_REGS_REVISION 0x200
+#define PHY_CONTROL_REGS_CLK_PM_CTRL 0x204
+#define PHY_CONTROL_REGS_PLL_STATUS 0x210
+#define PHY_CONTROL_REGS_PLL_CONFIG 0x214
+#define PHY_CONTROL_REGS_PLL_PRE_DIVIDER 0x218
+#define PHY_CONTROL_REGS_PLL_DIVIDER 0x21c
+#define PHY_CONTROL_REGS_PLL_CONTROL1 0x220
+#define PHY_CONTROL_REGS_PLL_CONTROL2 0x224
+#define PHY_CONTROL_REGS_PLL_SS_EN 0x228
+#define PHY_CONTROL_REGS_PLL_SS_CFG 0x22c
+#define PHY_CONTROL_REGS_STATIC_VDL_OVERRIDE 0x230
+#define PHY_CONTROL_REGS_DYNAMIC_VDL_OVERRIDE 0x234
+#define PHY_CONTROL_REGS_IDLE_PAD_CONTROL 0x238
+#define PHY_CONTROL_REGS_ZQ_PVT_COMP_CTL 0x23c
+#define PHY_CONTROL_REGS_DRIVE_PAD_CTL 0x240
+#define PHY_BYTE_LANE_0_REVISION 0x300
+#define PHY_BYTE_LANE_0_VDL_CALIBRATE 0x304
+#define PHY_BYTE_LANE_0_VDL_STATUS 0x308
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_0 0x310
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_1 0x314
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_2 0x318
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_3 0x31c
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_4 0x320
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_5 0x324
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_6 0x328
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_7 0x32c
+#define PHY_BYTE_LANE_0_READ_CONTROL 0x330
+#define PHY_BYTE_LANE_0_READ_FIFO_STATUS 0x334
+#define PHY_BYTE_LANE_0_READ_FIFO_CLEAR 0x338
+#define PHY_BYTE_LANE_0_IDLE_PAD_CONTROL 0x33c
+#define PHY_BYTE_LANE_0_DRIVE_PAD_CTL 0x340
+#define PHY_BYTE_LANE_0_CLOCK_PAD_DISABLE 0x344
+#define PHY_BYTE_LANE_0_WR_PREAMBLE_MODE 0x348
+#define PHY_BYTE_LANE_1_REVISION 0x400
+#define PHY_BYTE_LANE_1_VDL_CALIBRATE 0x404
+#define PHY_BYTE_LANE_1_VDL_STATUS 0x408
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_0 0x410
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_1 0x414
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_2 0x418
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_3 0x41c
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_4 0x420
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_5 0x424
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_6 0x428
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_7 0x42c
+#define PHY_BYTE_LANE_1_READ_CONTROL 0x430
+#define PHY_BYTE_LANE_1_READ_FIFO_STATUS 0x434
+#define PHY_BYTE_LANE_1_READ_FIFO_CLEAR 0x438
+#define PHY_BYTE_LANE_1_IDLE_PAD_CONTROL 0x43c
+#define PHY_BYTE_LANE_1_DRIVE_PAD_CTL 0x440
+#define PHY_BYTE_LANE_1_CLOCK_PAD_DISABLE 0x444
+#define PHY_BYTE_LANE_1_WR_PREAMBLE_MODE 0x448
+#define PHY_BYTE_LANE_2_REVISION 0x500
+#define PHY_BYTE_LANE_2_VDL_CALIBRATE 0x504
+#define PHY_BYTE_LANE_2_VDL_STATUS 0x508
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_0 0x510
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_1 0x514
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_2 0x518
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_3 0x51c
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_4 0x520
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_5 0x524
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_6 0x528
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_7 0x52c
+#define PHY_BYTE_LANE_2_READ_CONTROL 0x530
+#define PHY_BYTE_LANE_2_READ_FIFO_STATUS 0x534
+#define PHY_BYTE_LANE_2_READ_FIFO_CLEAR 0x538
+#define PHY_BYTE_LANE_2_IDLE_PAD_CONTROL 0x53c
+#define PHY_BYTE_LANE_2_DRIVE_PAD_CTL 0x540
+#define PHY_BYTE_LANE_2_CLOCK_PAD_DISABLE 0x544
+#define PHY_BYTE_LANE_2_WR_PREAMBLE_MODE 0x548
+#define PHY_BYTE_LANE_3_REVISION 0x600
+#define PHY_BYTE_LANE_3_VDL_CALIBRATE 0x604
+#define PHY_BYTE_LANE_3_VDL_STATUS 0x608
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_0 0x610
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_1 0x614
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_2 0x618
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_3 0x61c
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_4 0x620
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_5 0x624
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_6 0x628
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_7 0x62c
+#define PHY_BYTE_LANE_3_READ_CONTROL 0x630
+#define PHY_BYTE_LANE_3_READ_FIFO_STATUS 0x634
+#define PHY_BYTE_LANE_3_READ_FIFO_CLEAR 0x638
+#define PHY_BYTE_LANE_3_IDLE_PAD_CONTROL 0x63c
+#define PHY_BYTE_LANE_3_DRIVE_PAD_CTL 0x640
+#define PHY_BYTE_LANE_3_CLOCK_PAD_DISABLE 0x644
+#define PHY_BYTE_LANE_3_WR_PREAMBLE_MODE 0x648
+#define DDR_CTL_GCFG 0x800
+#define DDR_CTL_LBIST_CFG 0x804
+#define DDR_CTL_LBIST_SEED 0x808
+#define DDR_CTL_ARB 0x80c
+#define DDR_CTL_PI_GCF 0x810
+#define DDR_CTL_PI_UBUS_CTL 0x814
+#define DDR_CTL_PI_MIPS_CTL 0x818
+#define DDR_CTL_PI_DSL_MIPS_CTL 0x81c
+#define DDR_CTL_PI_DSL_PHY_CTL 0x820
+#define DDR_CTL_PI_UBUS_ST 0x824
+#define DDR_CTL_PI_MIPS_ST 0x828
+#define DDR_CTL_PI_DSL_MIPS_ST 0x82c
+#define DDR_CTL_PI_DSL_PHY_ST 0x830
+#define DDR_CTL_PI_UBUS_SMPL 0x834
+#define DDR_CTL_TESTMODE 0x838
+#define DDR_CTL_TEST_CFG1 0x83c
+#define DDR_CTL_TEST_PAT 0x840
+#define DDR_CTL_TEST_COUNT 0x844
+#define DDR_CTL_TEST_CURR_COUNT 0x848
+#define DDR_CTL_TEST_ADDR_UPDT 0x84c
+#define DDR_CTL_TEST_ADDR 0x850
+#define DDR_CTL_TEST_DATA0 0x854
+#define DDR_CTL_TEST_DATA1 0x858
+#define DDR_CTL_TEST_DATA2 0x85c
+#define DDR_CTL_TEST_DATA3 0x860
+
+
+/*
+#####################################################################
+# UART Control Registers
+#####################################################################
+*/
+#define UART0CONTROL 0x01
+#define UART0CONFIG 0x02
+#define UART0RXTIMEOUT 0x03
+#define UART0BAUD 0x04
+#define UART0FIFOCFG 0x0a
+#define UART0INTMASK 0x10
+#define UART0INTSTAT 0x12
+#define UART0DATA 0x17
+
+#define BRGEN 0x80 /* Control register bit defs */
+#define TXEN 0x40
+#define RXEN 0x20
+#define LOOPBK 0x10
+#define TXPARITYEN 0x08
+#define TXPARITYEVEN 0x04
+#define RXPARITYEN 0x02
+#define RXPARITYEVEN 0x01
+
+#define XMITBREAK 0x40 /* Config register */
+#define BITS5SYM 0x00
+#define BITS6SYM 0x10
+#define BITS7SYM 0x20
+#define BITS8SYM 0x30
+#define ONESTOP 0x07
+#define TWOSTOP 0x0f
+
+#define DELTAIP 0x0001
+#define TXUNDERR 0x0002
+#define TXOVFERR 0x0004
+#define TXFIFOTHOLD 0x0008
+#define TXREADLATCH 0x0010
+#define TXFIFOEMT 0x0020
+#define RXUNDERR 0x0040
+#define RXOVFERR 0x0080
+#define RXTIMEOUT 0x0100
+#define RXFIFOFULL 0x0200
+#define RXFIFOTHOLD 0x0400
+#define RXFIFONE 0x0800
+#define RXFRAMERR 0x1000
+#define RXPARERR 0x2000
+#define RXBRK 0x4000
+
+
+/*
+#####################################################################
+# DECT IP Control Registers
+#####################################################################
+*/
+#define DECT_STARTCTL 0xb0e50818
+#define PCM_BUFF_CTL3 0xb0e5082c
+#define PCM_BUFF_CTL7 0xb0e5083c
+#define DECT_AHB_CHAN0_RX 0xb0e50a20
+#define DECT_AHB_CHAN1_RX 0xb0e50de0
+#define DECT_AHB_CHAN2_RX 0xb0e511a0
+#define DECT_AHB_CHAN3_RX 0xb0e51560
+#define DECT_AHB_CHAN0_TX 0xb0e50840
+#define DECT_AHB_CHAN1_TX 0xb0e50c00
+#define DECT_AHB_CHAN2_TX 0xb0e50fc0
+#define DECT_AHB_CHAN3_TX 0xb0e51380
+#define DECT_CLKEN 0x00000040
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/shared/broadcom/include/bcm963xx/6362_map.h b/shared/broadcom/include/bcm963xx/6362_map.h
new file mode 100755
index 0000000..d0fa38f
--- /dev/null
+++ b/shared/broadcom/include/bcm963xx/6362_map.h
@@ -0,0 +1,2251 @@
+/*
+<:copyright-broadcom
+
+ Copyright (c) 2007 Broadcom Corporation
+ All Rights Reserved
+ No portions of this material may be reproduced in any form without the
+ written permission of:
+ Broadcom Corporation
+ 16215 Alton Parkway
+ Irvine, California 92619
+ All information contained in this document is Broadcom Corporation
+ company private, proprietary, and trade secret.
+
+:>
+*/
+/***********************************************************************/
+/* */
+/* MODULE: 6362_map.h */
+/* DATE: 05/30/08 */
+/* PURPOSE: Define addresses of major hardware components of */
+/* BCM6362 */
+/* */
+/***********************************************************************/
+#ifndef __BCM6362_MAP_H
+#define __BCM6362_MAP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "bcmtypes.h"
+#include "6362_common.h"
+#include "6362_intr.h"
+
+/* macro to convert logical data addresses to physical */
+/* DMA hardware must see physical address */
+#define LtoP( x ) ( (uint32)x & 0x1fffffff )
+#define PtoL( x ) ( LtoP(x) | 0xa0000000 )
+
+typedef struct DDRPhyControl {
+ uint32 REVISION; /* 0x00 */
+ uint32 CLK_PM_CTRL; /* 0x04 */
+ uint32 unused0[2]; /* 0x08-0x10 */
+ uint32 PLL_STATUS; /* 0x10 */
+ uint32 PLL_CONFIG; /* 0x14 */
+ uint32 PLL_PRE_DIVIDER; /* 0x18 */
+ uint32 PLL_DIVIDER; /* 0x1c */
+ uint32 PLL_CONTROL1; /* 0x20 */
+ uint32 PLL_CONTROL2; /* 0x24 */
+ uint32 PLL_SS_EN; /* 0x28 */
+ uint32 PLL_SS_CFG; /* 0x2c */
+ uint32 STATIC_VDL_OVERRIDE; /* 0x30 */
+ uint32 DYNAMIC_VDL_OVERRIDE; /* 0x34 */
+ uint32 IDLE_PAD_CONTROL; /* 0x38 */
+ uint32 ZQ_PVT_COMP_CTL; /* 0x3c */
+ uint32 DRIVE_PAD_CTL; /* 0x40 */
+ uint32 CLOCK_REG_CONTROL; /* 0x44 */
+ uint32 unused1[46];
+} DDRPhyControl;
+
+typedef struct DDRPhyByteLaneControl {
+ uint32 REVISION; /* 0x00 */
+ uint32 VDL_CALIBRATE; /* 0x04 */
+ uint32 VDL_STATUS; /* 0x08 */
+ uint32 unused; /* 0x0c */
+ uint32 VDL_OVERRIDE_0; /* 0x10 */
+ uint32 VDL_OVERRIDE_1; /* 0x14 */
+ uint32 VDL_OVERRIDE_2; /* 0x18 */
+ uint32 VDL_OVERRIDE_3; /* 0x1c */
+ uint32 VDL_OVERRIDE_4; /* 0x20 */
+ uint32 VDL_OVERRIDE_5; /* 0x24 */
+ uint32 VDL_OVERRIDE_6; /* 0x28 */
+ uint32 VDL_OVERRIDE_7; /* 0x2c */
+ uint32 READ_CONTROL; /* 0x30 */
+ uint32 READ_FIFO_STATUS; /* 0x34 */
+ uint32 READ_FIFO_CLEAR; /* 0x38 */
+ uint32 IDLE_PAD_CONTROL; /* 0x3c */
+ uint32 DRIVE_PAD_CTL; /* 0x40 */
+ uint32 CLOCK_PAD_DISABLE; /* 0x44 */
+ uint32 WR_PREAMBLE_MODE; /* 0x48 */
+ uint32 CLOCK_REG_CONTROL; /* 0x4C */
+ uint32 unused0[44];
+} DDRPhyByteLaneControl;
+
+typedef struct DDRControl {
+ uint32 CNFG; /* 0x000 */
+ uint32 CSST; /* 0x004 */
+ uint32 CSEND; /* 0x008 */
+ uint32 unused; /* 0x00c */
+ uint32 ROW00_0; /* 0x010 */
+ uint32 ROW00_1; /* 0x014 */
+ uint32 ROW01_0; /* 0x018 */
+ uint32 ROW01_1; /* 0x01c */
+ uint32 unused0[4];
+ uint32 ROW20_0; /* 0x030 */
+ uint32 ROW20_1; /* 0x034 */
+ uint32 ROW21_0; /* 0x038 */
+ uint32 ROW21_1; /* 0x03c */
+ uint32 unused1[4];
+ uint32 COL00_0; /* 0x050 */
+ uint32 COL00_1; /* 0x054 */
+ uint32 COL01_0; /* 0x058 */
+ uint32 COL01_1; /* 0x05c */
+ uint32 unused2[4];
+ uint32 COL20_0; /* 0x070 */
+ uint32 COL20_1; /* 0x074 */
+ uint32 COL21_0; /* 0x078 */
+ uint32 COL21_1; /* 0x07c */
+ uint32 unused3[4];
+ uint32 BNK10; /* 0x090 */
+ uint32 BNK32; /* 0x094 */
+ uint32 unused4[26];
+ uint32 DCMD; /* 0x100 */
+#define DCMD_CS1 (1 << 5)
+#define DCMD_CS0 (1 << 4)
+#define DCMD_SET_SREF 4
+ uint32 DMODE_0; /* 0x104 */
+ uint32 DMODE_1; /* 0x108 */
+#define DMODE_1_DRAMSLEEP (1 << 11)
+ uint32 CLKS; /* 0x10c */
+ uint32 ODT; /* 0x110 */
+ uint32 TIM1_0; /* 0x114 */
+ uint32 TIM1_1; /* 0x118 */
+ uint32 TIM2; /* 0x11c */
+ uint32 CTL_CRC; /* 0x120 */
+ uint32 DOUT_CRC; /* 0x124 */
+ uint32 DIN_CRC; /* 0x128 */
+ uint32 unused5[53];
+
+ DDRPhyControl PhyControl; /* 0x200 */
+ DDRPhyByteLaneControl PhyByteLane0Control; /* 0x300 */
+ DDRPhyByteLaneControl PhyByteLane1Control; /* 0x400 */
+ DDRPhyByteLaneControl PhyByteLane2Control; /* 0x500 */
+ DDRPhyByteLaneControl PhyByteLane3Control; /* 0x600 */
+ uint32 unused6[64];
+
+ uint32 GCFG; /* 0x800 */
+ uint32 LBIST_CFG; /* 0x804 */
+ uint32 LBIST_SEED; /* 0x808 */
+ uint32 ARB; /* 0x80c */
+ uint32 PI_GCF; /* 0x810 */
+ uint32 PI_UBUS_CTL; /* 0x814 */
+ uint32 PI_MIPS_CTL; /* 0x818 */
+ uint32 PI_DSL_MIPS_CTL; /* 0x81c */
+ uint32 PI_DSL_PHY_CTL; /* 0x820 */
+ uint32 PI_UBUS_ST; /* 0x824 */
+ uint32 PI_MIPS_ST; /* 0x828 */
+ uint32 PI_DSL_MIPS_ST; /* 0x82c */
+ uint32 PI_DSL_PHY_ST; /* 0x830 */
+ uint32 PI_UBUS_SMPL; /* 0x834 */
+ uint32 TESTMODE; /* 0x838 */
+ uint32 TEST_CFG1; /* 0x83c */
+ uint32 TEST_PAT; /* 0x840 */
+ uint32 TEST_COUNT; /* 0x844 */
+ uint32 TEST_CURR_COUNT; /* 0x848 */
+ uint32 TEST_ADDR_UPDT; /* 0x84c */
+ uint32 TEST_ADDR; /* 0x850 */
+ uint32 TEST_DATA0; /* 0x854 */
+ uint32 TEST_DATA1; /* 0x858 */
+ uint32 TEST_DATA2; /* 0x85c */
+ uint32 TEST_DATA3; /* 0x860 */
+} DDRControl;
+
+#define DDR ((volatile DDRControl * const) DDR_BASE)
+
+/*
+** Peripheral Controller
+*/
+
+#define IRQ_BITS 64
+typedef struct {
+ uint64 IrqMask;
+ uint64 IrqStatus;
+} IrqControl_t;
+
+typedef struct PerfControl {
+ uint32 RevID; /* (00) word 0 */
+ uint32 blkEnables; /* (04) word 1 */
+#define NAND_CLK_EN (1 << 20)
+#define PHYMIPS_CLK_EN (1 << 19)
+#define FAP_CLK_EN (1 << 18)
+#define PCIE_CLK_EN (1 << 17)
+#define HS_SPI_CLK_EN (1 << 16)
+#define SPI_CLK_EN (1 << 15)
+#define IPSEC_CLK_EN (1 << 14)
+#define USBH_CLK_EN (1 << 13)
+#define USBD_CLK_EN (1 << 12)
+#define PCM_CLK_EN (1 << 11)
+#define ROBOSW_CLK_EN (1 << 10)
+#define SAR_CLK_EN (1 << 9)
+#define SWPKT_SAR_CLK_EN (1 << 8)
+#define SWPKT_USB_CLK_EN (1 << 7)
+#define WLAN_OCP_CLK_EN (1 << 5)
+#define MIPS_CLK_EN (1 << 4)
+#define ADSL_CLK_EN (1 << 3)
+#define ADSL_AFE_EN (1 << 2)
+#define ADSL_QPROC_EN (1 << 1)
+#define DISABLE_GLESS (1 << 0)
+
+ uint32 pll_control; /* (08) word 2 */
+#define SOFT_RESET 0x00000001 // 0
+
+ uint32 deviceTimeoutEn; /* (0c) word 3 */
+ uint32 softResetB; /* (10) word 4 */
+#define SOFT_RST_WLAN_SHIM_UBUS (1 << 14)
+#define SOFT_RST_FAP (1 << 13)
+#define SOFT_RST_DDR_PHY (1 << 12)
+#define SOFT_RST_WLAN_SHIM (1 << 11)
+#define SOFT_RST_PCIE_EXT (1 << 10)
+#define SOFT_RST_PCIE (1 << 9)
+#define SOFT_RST_PCIE_CORE (1 << 8)
+#define SOFT_RST_PCM (1 << 7)
+#define SOFT_RST_USBH (1 << 6)
+#define SOFT_RST_USBD (1 << 5)
+#define SOFT_RST_SWITCH (1 << 4)
+#define SOFT_RST_SAR (1 << 3)
+#define SOFT_RST_EPHY (1 << 2)
+#define SOFT_RST_IPSEC (1 << 1)
+#define SOFT_RST_SPI (1 << 0)
+
+ uint32 diagControl; /* (14) word 5 */
+ uint32 ExtIrqCfg; /* (18) word 6*/
+ uint32 unused1; /* (1c) word 7 */
+#define EI_SENSE_SHFT 0
+#define EI_STATUS_SHFT 4
+#define EI_CLEAR_SHFT 8
+#define EI_MASK_SHFT 12
+#define EI_INSENS_SHFT 16
+#define EI_LEVEL_SHFT 20
+
+ IrqControl_t IrqControl[2];
+} PerfControl;
+
+#define PERF ((volatile PerfControl * const) PERF_BASE)
+
+/*
+** Timer
+*/
+typedef struct Timer {
+ uint16 unused0;
+ byte TimerMask;
+#define TIMER0EN 0x01
+#define TIMER1EN 0x02
+#define TIMER2EN 0x04
+ byte TimerInts;
+#define TIMER0 0x01
+#define TIMER1 0x02
+#define TIMER2 0x04
+#define WATCHDOG 0x08
+ uint32 TimerCtl0;
+ uint32 TimerCtl1;
+ uint32 TimerCtl2;
+#define TIMERENABLE 0x80000000
+#define RSTCNTCLR 0x40000000
+ uint32 TimerCnt0;
+ uint32 TimerCnt1;
+ uint32 TimerCnt2;
+ uint32 WatchDogDefCount;
+
+ /* Write 0xff00 0x00ff to Start timer
+ * Write 0xee00 0x00ee to Stop and re-load default count
+ * Read from this register returns current watch dog count
+ */
+ uint32 WatchDogCtl;
+
+ /* Number of 50-MHz ticks for WD Reset pulse to last */
+ uint32 WDResetCount;
+} Timer;
+
+#define TIMER ((volatile Timer * const) TIMR_BASE)
+
+/*
+** UART
+*/
+typedef struct UartChannel {
+ byte unused0;
+ byte control;
+#define BRGEN 0x80 /* Control register bit defs */
+#define TXEN 0x40
+#define RXEN 0x20
+#define LOOPBK 0x10
+#define TXPARITYEN 0x08
+#define TXPARITYEVEN 0x04
+#define RXPARITYEN 0x02
+#define RXPARITYEVEN 0x01
+
+ byte config;
+#define XMITBREAK 0x40
+#define BITS5SYM 0x00
+#define BITS6SYM 0x10
+#define BITS7SYM 0x20
+#define BITS8SYM 0x30
+#define ONESTOP 0x07
+#define TWOSTOP 0x0f
+ /* 4-LSBS represent STOP bits/char
+ * in 1/8 bit-time intervals. Zero
+ * represents 1/8 stop bit interval.
+ * Fifteen represents 2 stop bits.
+ */
+ byte fifoctl;
+#define RSTTXFIFOS 0x80
+#define RSTRXFIFOS 0x40
+ /* 5-bit TimeoutCnt is in low bits of this register.
+ * This count represents the number of characters
+ * idle times before setting receive Irq when below threshold
+ */
+ uint32 baudword;
+ /* When divide SysClk/2/(1+baudword) we should get 32*bit-rate
+ */
+
+ byte txf_levl; /* Read-only fifo depth */
+ byte rxf_levl; /* Read-only fifo depth */
+ byte fifocfg; /* Upper 4-bits are TxThresh, Lower are
+ * RxThreshold. Irq can be asserted
+ * when rx fifo> thresh, txfifo<thresh
+ */
+ byte prog_out; /* Set value of DTR (Bit0), RTS (Bit1)
+ * if these bits are also enabled to GPIO_o
+ */
+#define DTREN 0x01
+#define RTSEN 0x02
+
+ byte unused1;
+ byte DeltaIPEdgeNoSense; /* Low 4-bits, set corr bit to 1 to
+ * detect irq on rising AND falling
+ * edges for corresponding GPIO_i
+ * if enabled (edge insensitive)
+ */
+ byte DeltaIPConfig_Mask; /* Upper 4 bits: 1 for posedge sense
+ * 0 for negedge sense if
+ * not configured for edge
+ * insensitive (see above)
+ * Lower 4 bits: Mask to enable change
+ * detection IRQ for corresponding
+ * GPIO_i
+ */
+ byte DeltaIP_SyncIP; /* Upper 4 bits show which bits
+ * have changed (may set IRQ).
+ * read automatically clears bit
+ * Lower 4 bits are actual status
+ */
+
+ uint16 intMask; /* Same Bit defs for Mask and status */
+ uint16 intStatus;
+#define DELTAIP 0x0001
+#define TXUNDERR 0x0002
+#define TXOVFERR 0x0004
+#define TXFIFOTHOLD 0x0008
+#define TXREADLATCH 0x0010
+#define TXFIFOEMT 0x0020
+#define RXUNDERR 0x0040
+#define RXOVFERR 0x0080
+#define RXTIMEOUT 0x0100
+#define RXFIFOFULL 0x0200
+#define RXFIFOTHOLD 0x0400
+#define RXFIFONE 0x0800
+#define RXFRAMERR 0x1000
+#define RXPARERR 0x2000
+#define RXBRK 0x4000
+
+ uint16 unused2;
+ uint16 Data; /* Write to TX, Read from RX */
+ /* bits 11:8 are BRK,PAR,FRM errors */
+
+ uint32 unused3;
+ uint32 unused4;
+} Uart;
+
+#define UART ((volatile Uart * const) UART_BASE)
+
+/*
+** Gpio Controller
+*/
+
+typedef struct GpioControl {
+ uint64 GPIODir; /* 0 */
+ uint64 GPIOio; /* 8 */
+ uint32 LEDCtrl; /* 10 */
+ uint32 SpiSlaveCfg; /* 14 */
+ uint32 GPIOMode; /* 18 */
+#define GPIO_MODE_EXT_IRQ3 (1<<27)
+#define GPIO_MODE_EXT_IRQ2 (1<<26)
+#define GPIO_MODE_EXT_IRQ1 (1<<25)
+#define GPIO_MODE_EXT_IRQ0 (1<<24)
+#define GPIO_MODE_EPHY3_LED (1<<23)
+#define GPIO_MODE_EPHY2_LED (1<<22)
+#define GPIO_MODE_EPHY1_LED (1<<21)
+#define GPIO_MODE_EPHY0_LED (1<<20)
+#define GPIO_MODE_ADSL_SPI_SSB (1<<19)
+#define GPIO_MODE_ADSL_SPI_CLK (1<<18)
+#define GPIO_MODE_ADSL_SPI_MOSI (1<<17)
+#define GPIO_MODE_ADSL_SPI_MISO (1<<16)
+#define GPIO_MODE_UART2_SDOUT (1<<15)
+#define GPIO_MODE_UART2_SDIN (1<<14)
+#define GPIO_MODE_UART2_SRTS (1<<13)
+#define GPIO_MODE_UART2_SCTS (1<<12)
+#define GPIO_MODE_NTR_PULSE (1<<11)
+#define GPIO_MODE_LS_SPIM_SSB3 (1<<10)
+#define GPIO_MODE_LS_SPIM_SSB2 (1<<9)
+#define GPIO_MODE_INET_LED (1<<8)
+#define GPIO_MODE_ROBOSW_LED1 (1<<7)
+#define GPIO_MODE_ROBOSW_LED0 (1<<6)
+#define GPIO_MODE_ROBOSW_LED_CLK (1<<5)
+#define GPIO_MODE_ROBOSW_LED_DATA (1<<4)
+#define GPIO_MODE_SERIAL_LED_DATA (1<<3)
+#define GPIO_MODE_SERIAL_LED_CLK (1<<2)
+#define GPIO_MODE_SYS_IRQ (1<<1)
+#define GPIO_MODE_USBD_LED (1<<0)
+
+ uint32 GPIOCtrl; /* 1C */
+ uint32 unused3[2]; /* 20 - 24*/
+ uint32 TestControl; /* 28 */
+ uint32 OscControl; /* 2C */
+ uint32 RoboSWLEDControl; /* 30 */
+ uint32 RoboSWLEDLSR; /* 34 */
+ uint32 GPIOBaseMode; /* 38 */
+#define NAND_GPIO_OVERRIDE (1<<2)
+ uint32 RoboswEphyCtrl; /* 3C */
+#define EPHY_PLL_LOCK (1<<27)
+#define EPHY_ATEST_25MHZ_EN (1<<26)
+#define EPHY_PWR_DOWN_DLL (1<<25)
+#define EPHY_PWR_DOWN_BIAS (1<<24)
+#define EPHY_PWR_DOWN_TX_4 (1<<23)
+#define EPHY_PWR_DOWN_TX_3 (1<<22)
+#define EPHY_PWR_DOWN_TX_2 (1<<21)
+#define EPHY_PWR_DOWN_TX_1 (1<<20)
+#define EPHY_PWR_DOWN_RX_4 (1<<19)
+#define EPHY_PWR_DOWN_RX_3 (1<<18)
+#define EPHY_PWR_DOWN_RX_2 (1<<17)
+#define EPHY_PWR_DOWN_RX_1 (1<<16)
+#define EPHY_PWR_DOWN_SD_4 (1<<15)
+#define EPHY_PWR_DOWN_SD_3 (1<<14)
+#define EPHY_PWR_DOWN_SD_2 (1<<13)
+#define EPHY_PWR_DOWN_SD_1 (1<<12)
+#define EPHY_PWR_DOWN_RD_4 (1<<11)
+#define EPHY_PWR_DOWN_RD_3 (1<<10)
+#define EPHY_PWR_DOWN_RD_2 (1<<9)
+#define EPHY_PWR_DOWN_RD_1 (1<<8)
+#define EPHY_PWR_DOWN_4 (1<<7)
+#define EPHY_PWR_DOWN_3 (1<<6)
+#define EPHY_PWR_DOWN_2 (1<<5)
+#define EPHY_PWR_DOWN_1 (1<<4)
+#define EPHY_RST_4 (1<<3)
+#define EPHY_RST_3 (1<<2)
+#define EPHY_RST_2 (1<<1)
+#define EPHY_RST_1 (1<<0)
+ uint32 RoboswSwitchCtrl; /* 40 */
+#define RSW_MII_2_IFC_EN (1<<23)
+#define RSW_MII_2_AMP_EN (1<<22)
+#define RSW_MII_2_SEL_SHIFT 20
+#define RSW_MII_SEL_3P3V 0
+#define RSW_MII_SEL_2P5V 1
+#define RSW_MII_SEL_1P5V 2
+#define RSW_MII_AMP_EN (1<<18)
+#define RSW_MII_SEL_SHIFT 16
+#define RSW_SPI_MODE (1<<11)
+#define RSW_BC_SUPP_EN (1<<10)
+#define RSW_CLK_FREQ_MASK (3<<8)
+#define RSW_ENF_DFX_FLOW (1<<7)
+#define RSW_ENH_DFX_FLOW (1<<6)
+#define RSW_GRX_0_SETUP (1<<5)
+#define RSW_GTX_0_SETUP (1<<4)
+#define RSW_HW_FWDG_EN (1<<3)
+#define RSW_QOS_EN (1<<2)
+#define RSW_WD_CLR_EN (1<<1)
+#define RSW_MII_DUMB_FWDG_EN (1<<0)
+
+ uint32 RegFileTmCtl; /* 44 */
+
+ uint32 RingOscCtrl0; /* 48 */
+#define RING_OSC_256_CYCLES 8
+#define RING_OSC_512_CYCLES 9
+#define RING_OSC_1024_CYCLES 10
+
+ uint32 RingOscCtrl1; /* 4C */
+#define RING_OSC_ENABLE_MASK (0x0f<<24)
+#define RING_OSC_ENABLE_SHIFT 24
+#define RING_OSC_MAX 4
+#define RING_OSC_COUNT_RESET (0x1<<23)
+#define RING_OSC_SELECT_MASK (0x7<<20)
+#define RING_OSC_SELECT_SHIFT 20
+#define RING_OSC_IRQ (0x1<<18)
+#define RING_OSC_COUNTER_OVERFLOW (0x1<<17)
+#define RING_OSC_COUNTER_BUSY (0x1<<16)
+#define RING_OSC_COUNT_MASK 0x0000ffff
+
+ uint32 unused4[6]; /* 50 - 64 */
+ uint32 DieRevID; /* 68 */
+ uint32 unused5; /* 6c */
+ uint32 DiagSelControl; /* 70 */
+ uint32 DiagReadBack; /* 74 */
+ uint32 DiagReadBackHi; /* 78 */
+ uint32 DiagMiscControl; /* 7c */
+} GpioControl;
+
+#define GPIO ((volatile GpioControl * const) GPIO_BASE)
+
+/* Number to mask conversion macro used for GPIODir and GPIOio */
+#define GPIO_NUM_MAX 48
+#define GPIO_NUM_TO_MASK(X) ( (((X) & BP_GPIO_NUM_MASK) < GPIO_NUM_MAX) ? ((uint64)1 << ((X) & BP_GPIO_NUM_MASK)) : (0) )
+
+/*
+** OTP
+*/
+typedef struct Otp {
+ uint32 Config; /* 0x0 */
+ uint32 Control; /* 0x4 */
+ uint32 Addr; /* 0x8 */
+ uint32 WriteData; /* 0xc */
+ uint32 Status; /* 0x10 */
+ uint32 DOut; /* 0x14 */
+ uint32 UserBits[8]; /* 0x18 - 0x34 */
+#define OTP_WLAN_DISABLE 34
+#define OTP_DECT_DISABLE 38
+#define OTP_IPSED_DISABLE 39
+ uint32 unused[2]; /* 0x38 - 0x3c */
+ uint32 RAMRepair[16]; /* 0x40 - 0x7c */
+} Otp;
+
+#define OTP ((volatile Otp * const) OTP_BASE)
+
+/* Word order is reversed for User OTP bits */
+#define OTP_GET_USER_BIT(x) ((OTP->UserBits[((sizeof(OTP->UserBits)/4) - (x)/32 - 1)] >> ((x) % 32)) & 1)
+
+/*
+** Spi Controller
+*/
+
+typedef struct SpiControl {
+ uint16 spiMsgCtl; /* (0x0) control byte */
+#define FULL_DUPLEX_RW 0
+#define HALF_DUPLEX_W 1
+#define HALF_DUPLEX_R 2
+#define SPI_MSG_TYPE_SHIFT 14
+#define SPI_BYTE_CNT_SHIFT 0
+ byte spiMsgData[0x21e]; /* (0x02 - 0x21f) msg data */
+ byte unused0[0x1e0];
+ byte spiRxDataFifo[0x220]; /* (0x400 - 0x61f) rx data */
+ byte unused1[0xe0];
+
+ uint16 spiCmd; /* (0x700): SPI command */
+#define SPI_CMD_NOOP 0
+#define SPI_CMD_SOFT_RESET 1
+#define SPI_CMD_HARD_RESET 2
+#define SPI_CMD_START_IMMEDIATE 3
+
+#define SPI_CMD_COMMAND_SHIFT 0
+#define SPI_CMD_COMMAND_MASK 0x000f
+
+#define SPI_CMD_DEVICE_ID_SHIFT 4
+#define SPI_CMD_PREPEND_BYTE_CNT_SHIFT 8
+#define SPI_CMD_ONE_BYTE_SHIFT 11
+#define SPI_CMD_ONE_WIRE_SHIFT 12
+#define SPI_DEV_ID_0 0
+#define SPI_DEV_ID_1 1
+#define SPI_DEV_ID_2 2
+#define SPI_DEV_ID_3 3
+
+ byte spiIntStatus; /* (0x702): SPI interrupt status */
+ byte spiMaskIntStatus; /* (0x703): SPI masked interrupt status */
+
+ byte spiIntMask; /* (0x704): SPI interrupt mask */
+#define SPI_INTR_CMD_DONE 0x01
+#define SPI_INTR_RX_OVERFLOW 0x02
+#define SPI_INTR_INTR_TX_UNDERFLOW 0x04
+#define SPI_INTR_TX_OVERFLOW 0x08
+#define SPI_INTR_RX_UNDERFLOW 0x10
+#define SPI_INTR_CLEAR_ALL 0x1f
+
+ byte spiStatus; /* (0x705): SPI status */
+#define SPI_RX_EMPTY 0x02
+#define SPI_CMD_BUSY 0x04
+#define SPI_SERIAL_BUSY 0x08
+
+ byte spiClkCfg; /* (0x706): SPI clock configuration */
+#define SPI_CLK_0_391MHZ 1
+#define SPI_CLK_0_781MHZ 2 /* default */
+#define SPI_CLK_1_563MHZ 3
+#define SPI_CLK_3_125MHZ 4
+#define SPI_CLK_6_250MHZ 5
+#define SPI_CLK_12_50MHZ 6
+#define SPI_CLK_MASK 0x07
+#define SPI_SSOFFTIME_MASK 0x38
+#define SPI_SSOFFTIME_SHIFT 3
+#define SPI_BYTE_SWAP 0x80
+
+ byte spiFillByte; /* (0x707): SPI fill byte */
+ byte unused2;
+ byte spiMsgTail; /* (0x709): msgtail */
+ byte unused3;
+ byte spiRxTail; /* (0x70B): rxtail */
+} SpiControl;
+
+#define SPI ((volatile SpiControl * const) SPI_BASE)
+
+
+/*
+** High-Speed SPI Controller
+*/
+
+#define __mask(end, start) (((1 << ((end - start) + 1)) - 1) << start)
+typedef struct HsSpiControl {
+
+ uint32 hs_spiGlobalCtrl; // 0x0000
+#define HS_SPI_MOSI_IDLE (1 << 18)
+#define HS_SPI_CLK_POLARITY (1 << 17)
+#define HS_SPI_CLK_GATE_SSOFF (1 << 16)
+#define HS_SPI_PLL_CLK_CTRL (8)
+#define HS_SPI_PLL_CLK_CTRL_MASK __mask(15, HS_SPI_PLL_CLK_CTRL)
+#define HS_SPI_SS_POLARITY (0)
+#define HS_SPI_SS_POLARITY_MASK __mask(7, HS_SPI_SS_POLARITY)
+
+ uint32 hs_spiExtTrigCtrl; // 0x0004
+#define HS_SPI_TRIG_RAW_STATE (24)
+#define HS_SPI_TRIG_RAW_STATE_MASK __mask(31, HS_SPI_TRIG_RAW_STATE)
+#define HS_SPI_TRIG_LATCHED (16)
+#define HS_SPI_TRIG_LATCHED_MASK __mask(23, HS_SPI_TRIG_LATCHED)
+#define HS_SPI_TRIG_SENSE (8)
+#define HS_SPI_TRIG_SENSE_MASK __mask(15, HS_SPI_TRIG_SENSE)
+#define HS_SPI_TRIG_TYPE (0)
+#define HS_SPI_TRIG_TYPE_MASK __mask(7, HS_SPI_TRIG_TYPE)
+#define HS_SPI_TRIG_TYPE_EDGE (0)
+#define HS_SPI_TRIG_TYPE_LEVEL (1)
+
+ uint32 hs_spiIntStatus; // 0x0008
+#define HS_SPI_IRQ_PING1_USER (28)
+#define HS_SPI_IRQ_PING1_USER_MASK __mask(31, HS_SPI_IRQ_PING1_USER)
+#define HS_SPI_IRQ_PING0_USER (24)
+#define HS_SPI_IRQ_PING0_USER_MASK __mask(27, HS_SPI_IRQ_PING0_USER)
+
+#define HS_SPI_IRQ_PING1_CTRL_INV (1 << 12)
+#define HS_SPI_IRQ_PING1_POLL_TOUT (1 << 11)
+#define HS_SPI_IRQ_PING1_TX_UNDER (1 << 10)
+#define HS_SPI_IRQ_PING1_RX_OVER (1 << 9)
+#define HS_SPI_IRQ_PING1_CMD_DONE (1 << 8)
+
+#define HS_SPI_IRQ_PING0_CTRL_INV (1 << 4)
+#define HS_SPI_IRQ_PING0_POLL_TOUT (1 << 3)
+#define HS_SPI_IRQ_PING0_TX_UNDER (1 << 2)
+#define HS_SPI_IRQ_PING0_RX_OVER (1 << 1)
+#define HS_SPI_IRQ_PING0_CMD_DONE (1 << 0)
+
+ uint32 hs_spiIntStatusMasked; // 0x000C
+#define HS_SPI_IRQSM__PING1_USER (28)
+#define HS_SPI_IRQSM__PING1_USER_MASK __mask(31, HS_SPI_IRQSM__PING1_USER)
+#define HS_SPI_IRQSM__PING0_USER (24)
+#define HS_SPI_IRQSM__PING0_USER_MASK __mask(27, HS_SPI_IRQSM__PING0_USER)
+
+#define HS_SPI_IRQSM__PING1_CTRL_INV (1 << 12)
+#define HS_SPI_IRQSM__PING1_POLL_TOUT (1 << 11)
+#define HS_SPI_IRQSM__PING1_TX_UNDER (1 << 10)
+#define HS_SPI_IRQSM__PING1_RX_OVER (1 << 9)
+#define HS_SPI_IRQSM__PING1_CMD_DONE (1 << 8)
+
+#define HS_SPI_IRQSM__PING0_CTRL_INV (1 << 4)
+#define HS_SPI_IRQSM__PING0_POLL_TOUT (1 << 3)
+#define HS_SPI_IRQSM__PING0_TX_UNDER (1 << 2)
+#define HS_SPI_IRQSM__PING0_RX_OVER (1 << 1)
+#define HS_SPI_IRQSM__PING0_CMD_DONE (1 << 0)
+
+ uint32 hs_spiIntMask; // 0x0010
+#define HS_SPI_IRQM_PING1_USER (28)
+#define HS_SPI_IRQM_PING1_USER_MASK __mask(31, HS_SPI_IRQM_PING1_USER)
+#define HS_SPI_IRQM_PING0_USER (24)
+#define HS_SPI_IRQM_PING0_USER_MASK __mask(27, HS_SPI_IRQM_PING0_USER)
+
+#define HS_SPI_IRQM_PING1_CTRL_INV (1 << 12)
+#define HS_SPI_IRQM_PING1_POLL_TOUT (1 << 11)
+#define HS_SPI_IRQM_PING1_TX_UNDER (1 << 10)
+#define HS_SPI_IRQM_PING1_RX_OVER (1 << 9)
+#define HS_SPI_IRQM_PING1_CMD_DONE (1 << 8)
+
+#define HS_SPI_IRQM_PING0_CTRL_INV (1 << 4)
+#define HS_SPI_IRQM_PING0_POLL_TOUT (1 << 3)
+#define HS_SPI_IRQM_PING0_TX_UNDER (1 << 2)
+#define HS_SPI_IRQM_PING0_RX_OVER (1 << 1)
+#define HS_SPI_IRQM_PING0_CMD_DONE (1 << 0)
+
+#define HS_SPI_INTR_CLEAR_ALL (0xFF001F1F)
+
+ uint32 hs_spiFlashCtrl; // 0x0014
+#define HS_SPI_FCTRL_MB_ENABLE (1 << 23)
+#define HS_SPI_FCTRL_SS_NUM (20)
+#define HS_SPI_FCTRL_SS_NUM_MASK __mask(22, HS_SPI_FCTRL_SS_NUM)
+#define HS_SPI_FCTRL_PROFILE_NUM (16)
+#define HS_SPI_FCTRL_PROFILE_NUM_MASK __mask(18, HS_SPI_FCTRL_PROFILE_NUM)
+#define HS_SPI_FCTRL_DUMMY_BYTES (10)
+#define HS_SPI_FCTRL_DUMMY_BYTES_MASK __mask(11, HS_SPI_FCTRL_DUMMY_BYTES)
+#define HS_SPI_FCTRL_ADDR_BYTES (8)
+#define HS_SPI_FCTRL_ADDR_BYTES_MASK __mask(9, HS_SPI_FCTRL_ADDR_BYTES)
+#define HS_SPI_FCTRL_ADDR_BYTES_2 (0)
+#define HS_SPI_FCTRL_ADDR_BYTES_3 (1)
+#define HS_SPI_FCTRL_ADDR_BYTES_4 (2)
+#define HS_SPI_FCTRL_READ_OPCODE (0)
+#define HS_SPI_FCTRL_READ_OPCODE_MASK __mask(7, HS_SPI_FCTRL_READ_OPCODE)
+
+ uint32 hs_spiFlashAddrBase; // 0x0018
+
+ char fill0[0x80 - 0x18];
+
+ uint32 hs_spiPP_0_Cmd; // 0x0080
+#define HS_SPI_PP_SS_NUM (12)
+#define HS_SPI_PP_SS_NUM_MASK __mask(14, HS_SPI_PP_SS_NUM)
+#define HS_SPI_PP_PROFILE_NUM (8)
+#define HS_SPI_PP_PROFILE_NUM_MASK __mask(10, HS_SPI_PP_PROFILE_NUM)
+
+} HsSpiControl;
+
+typedef struct HsSpiPingPong {
+
+ uint32 command;
+#define HS_SPI_SS_NUM (12)
+#define HS_SPI_PROFILE_NUM (8)
+#define HS_SPI_TRIGGER_NUM (4)
+#define HS_SPI_COMMAND_VALUE (0)
+ #define HS_SPI_COMMAND_NOOP (0)
+ #define HS_SPI_COMMAND_START_NOW (1)
+ #define HS_SPI_COMMAND_START_TRIGGER (2)
+ #define HS_SPI_COMMAND_HALT (3)
+ #define HS_SPI_COMMAND_FLUSH (4)
+
+ uint32 status;
+#define HS_SPI_ERROR_BYTE_OFFSET (16)
+#define HS_SPI_WAIT_FOR_TRIGGER (2)
+#define HS_SPI_SOURCE_BUSY (1)
+#define HS_SPI_SOURCE_GNT (0)
+
+ uint32 fifo_status;
+ uint32 control;
+
+} HsSpiPingPong;
+
+typedef struct HsSpiProfile {
+
+ uint32 clk_ctrl;
+#define HS_SPI_ACCUM_RST_ON_LOOP (15)
+#define HS_SPI_SPI_CLK_2X_SEL (14)
+#define HS_SPI_FREQ_CTRL_WORD (0)
+
+ uint32 signal_ctrl;
+#define HS_SPI_ASYNC_INPUT_PATH (1 << 16)
+#define HS_SPI_LAUNCH_RISING (1 << 13)
+#define HS_SPI_LATCH_RISING (1 << 12)
+
+ uint32 mode_ctrl;
+#define HS_SPI_PREPENDBYTE_CNT (24)
+#define HS_SPI_MODE_ONE_WIRE (20)
+#define HS_SPI_MULTIDATA_WR_SIZE (18)
+#define HS_SPI_MULTIDATA_RD_SIZE (16)
+#define HS_SPI_MULTIDATA_WR_STRT (12)
+#define HS_SPI_MULTIDATA_RD_STRT (8)
+#define HS_SPI_FILLBYTE (0)
+
+ uint32 polling_config;
+ uint32 polling_and_mask;
+ uint32 polling_compare;
+ uint32 polling_timeout;
+ uint32 reserved;
+
+} HsSpiProfile;
+
+#define HS_SPI_OP_CODE 13
+ #define HS_SPI_OP_SLEEP (0)
+ #define HS_SPI_OP_READ_WRITE (1)
+ #define HS_SPI_OP_WRITE (2)
+ #define HS_SPI_OP_READ (3)
+ #define HS_SPI_OP_SETIRQ (4)
+
+#define HS_SPI ((volatile HsSpiControl * const) HSSPIM_BASE)
+#define HS_SPI_PINGPONG0 ((volatile HsSpiPingPong * const) (HSSPIM_BASE+0x80))
+#define HS_SPI_PINGPONG1 ((volatile HsSpiPingPong * const) (HSSPIM_BASE+0xc0))
+#define HS_SPI_PROFILES ((volatile HsSpiProfile * const) (HSSPIM_BASE+0x100))
+#define HS_SPI_FIFO0 ((volatile uint8 * const) (HSSPIM_BASE+0x200))
+#define HS_SPI_FIFO1 ((volatile uint8 * const) (HSSPIM_BASE+0x400))
+
+
+/*
+** Misc Register Set Definitions.
+*/
+
+typedef struct Misc {
+ uint32 unused1; /* 0x00 */
+ uint32 miscSerdesCtrl; /* 0x04 */
+#define SERDES_PCIE_ENABLE 0x00000001
+#define SERDES_PCIE_EXD_ENABLE (1<<15)
+
+ uint32 miscSerdesSts; /* 0x08 */
+ uint32 miscIrqOutMask; /* 0x0C */
+#define MISC_PCIE_EP_IRQ_MASK0 (1<<0)
+#define MISC_PCIE_EP_IRQ_MASK1 (1<<1)
+
+ uint32 miscMemcControl; /* 0x10 */
+#define MISC_MEMC_CONTROL_MC_UBUS_ASYNC_MODE (1<<3)
+#define MISC_MEMC_CONTROL_MC_LMB_ASYNC_MODE (1<<2)
+#define MISC_MEMC_CONTROL_DDR_TEST_DONE (1<<1)
+#define MISC_MEMC_CONTROL_DDR_TEST_DISABLE (1<<0)
+
+ uint32 miscStrapBus; /* 0x14 */
+#define MISC_STRAP_BUS_RESET_CFG_DELAY (1<<18)
+#define MISC_STRAP_BUS_RESET_OUT_SHIFT 16
+#define MISC_STRAP_BUS_RESET_OUT_MASK (3<<MISC_STRAP_BUS_RESET_OUT_SHIFT)
+#define MISC_STRAP_BUS_BOOT_SEL_SHIFT 15
+#define MISC_STRAP_BUS_BOOT_SEL_MASK (0x1<<MISC_STRAP_BUS_BOOT_SEL_SHIFT)
+#define MISC_STRAP_BUS_BOOT_SERIAL 0x01
+#define MISC_STRAP_BUS_BOOT_NAND 0x00
+#define MISC_STRAP_BUS_HS_SPIM_24B_N_32B_ADDR (1<<14)
+#define MISC_STRAP_BUS_HS_SPIM_24B_N_32B_ADDR (1<<14)
+#define MISC_STRAP_BUS_HS_SPIM_CLK_SLOW_N_FAST (1<<13)
+#define MISC_STRAP_BUS_LS_SPIM_CLK_FAST_N_SLOW (1<<12)
+#define MISC_STRAP_BUS_LS_SPI_MASTER_N_SLAVE (1<<11)
+#define MISC_STRAP_BUS_PLL_USE_LOCK (1<<10)
+#define MISC_STRAP_BUS_PLL_MIPS_WAIT_FAST_N (1<<9)
+#define MISC_STRAP_BUS_ROBOSW_P4_MODE_SHIFT 7
+#define MISC_STRAP_BUS_ROBOSW_P4_MODE_MASK (3<<MISC_STRAP_BUS_ROBOSW_P4_MODE_SHIFT)
+#define MISC_STRAP_BUS_HARD_RESET_DELAY (1<<6)
+#define MISC_STRAP_BUS_MIPS_PLL_FVCO_SHIFT 1
+#define MISC_STRAP_BUS_MIPS_PLL_FVCO_MASK (0x1F<<MISC_STRAP_BUS_MIPS_PLL_FVCO_SHIFT)
+#define MISC_STRAP_BUS_PCIE_ROOT_COMPLEX (1<<0)
+
+ uint32 miscStrapOverride; /* 0x18 */
+ uint32 miscVregCtrl0; /* 0x1C */
+
+ uint32 miscVregCtrl1; /* 0x20 */
+#define VREG_VSEL1P2_SHIFT 0
+#define VREG_VSEL1P2_MASK 0x1f
+#define VREG_VSEL1P2_MIDDLE 0x0f
+
+ uint32 miscVregCtrl2; /* 0x24 */
+ uint32 miscExtra2ChipsIrqMask; /* 0x28 */
+ uint32 miscExtra2ChipsIrqSts; /* 0x2C */
+ uint32 miscExtra2ChipsIrqMask1; /* 0x30 */
+ uint32 miscExtra2ChipsIrqSts1; /* 0x34 */
+ uint32 miscFapIrqMask; /* 0x38 */
+ uint32 miscExtraFapIrqMask; /* 0x3C */
+ uint32 miscExtra2FapIrqMask; /* 0x40 */
+ uint32 miscAdsl_clock_sample; /* 0x44 */
+
+ uint32 miscIddqCtrl; /* 0x48 */
+#define MISC_IDDQ_CONTROL_USBD (1<<5)
+#define MISC_IDDQ_CONTROL_USBH (1<<4)
+
+ uint32 miscSleep; /* 0x4C */
+ uint32 miscRtc_enable; /* 0x50 */
+ uint32 miscRtc_count_L; /* 0x54 */
+ uint32 miscRtc_count_H; /* 0x58 */
+ uint32 miscRtc_event; /* 0x5C */
+ uint32 miscWakeup_mask; /* 0x60 */
+ uint32 miscWakeup_status; /* 0x64 */
+} Misc;
+
+#define MISC ((volatile Misc * const) MISC_BASE)
+
+/*
+** LedControl Register Set Definitions.
+*/
+
+#pragma pack(push, 4)
+typedef struct LedControl {
+ uint32 ledInit;
+#define LED_LED_TEST (1 << 31)
+#define LED_SHIFT_TEST (1 << 30)
+#define LED_SERIAL_LED_SHIFT_DIR (1 << 16)
+#define LED_SERIAL_LED_DATA_PPOL (1 << 15)
+#define LEDSERIAL_LED_CLK_NPOL (1 << 14)
+#define LED_SERIAL_LED_MUX_SEL (1 << 13)
+#define LED_SERIAL_LED_EN (1 << 12)
+#define LED_FAST_INTV_SHIFT 6
+#define LED_FAST_INTV_MASK (0x3F<<LED_FAST_INTV_SHIFT)
+#define LED_SLOW_INTV_SHIFT 0
+#define LED_SLOW_INTV_MASK (0x3F<<LED_SLOW_INTV_SHIFT)
+#define LED_INTERVAL_20MS 1
+
+ uint64 ledMode;
+#define LED_MODE_MASK (uint64)0x3
+#define LED_MODE_OFF (uint64)0x0
+#define LED_MODE_FLASH (uint64)0x1
+#define LED_MODE_BLINK (uint64)0x2
+#define LED_MODE_ON (uint64)0x3
+
+ uint32 ledHWDis;
+ uint32 ledStrobe;
+ uint32 ledLinkActSelHigh;
+#define LED_ENET0 4
+#define LED_ENET1 5
+#define LED_ENET2 6
+#define LED_ENET3 7
+#define LED_4_ACT_SHIFT 0
+#define LED_5_ACT_SHIFT 4
+#define LED_6_ACT_SHIFT 8
+#define LED_7_ACT_SHIFT 12
+#define LED_4_LINK_SHIFT 16
+#define LED_5_LINK_SHIFT 20
+#define LED_6_LINK_SHIFT 24
+#define LED_7_LINK_SHIFT 28
+ uint32 ledLinkActSelLow;
+#define LED_USB 0
+#define LED_INET 1
+#define LED_0_ACT_SHIFT 0
+#define LED_1_ACT_SHIFT 4
+#define LED_2_ACT_SHIFT 8
+#define LED_3_ACT_SHIFT 12
+#define LED_0_LINK_SHIFT 16
+#define LED_1_LINK_SHIFT 20
+#define LED_2_LINK_SHIFT 24
+#define LED_3_LINK_SHIFT 28
+
+ uint32 ledReadback;
+ uint32 ledSerialMuxSelect;
+} LedControl;
+#pragma pack(pop)
+
+#define LED ((volatile LedControl * const) LED_BASE)
+
+#define GPIO_NUM_TO_LED_MODE_SHIFT(X) \
+ ((((X) & BP_GPIO_NUM_MASK) < 8) ? (32 + (((X) & BP_GPIO_NUM_MASK) << 1)) : \
+ (((X) & BP_GPIO_SERIAL) ? ((((X) & BP_GPIO_NUM_MASK) - 8) << 1) : \
+ (((X) & BP_GPIO_NUM_MASK) < 16) ? (32 + ((((X) & BP_GPIO_NUM_MASK) - 8) << 1)) : \
+ ((((X) & BP_GPIO_NUM_MASK) - 16) << 1)))
+
+/*
+** Pcm Controller
+*/
+
+typedef struct PcmControlRegisters
+{
+ uint32 pcm_ctrl; // 00 offset from PCM_BASE
+#define PCM_ENABLE 0x80000000 // PCM block master enable
+#define PCM_ENABLE_SHIFT 31
+#define PCM_SLAVE_SEL 0x40000000 // PCM TDM slave mode select (1 - TDM slave, 0 - TDM master)
+#define PCM_SLAVE_SEL_SHIFT 30
+#define PCM_CLOCK_INV 0x20000000 // PCM SCLK invert select (1 - invert, 0 - normal)
+#define PCM_CLOCK_INV_SHIFT 29
+#define PCM_FS_INVERT 0x10000000 // PCM FS invert select (1 - invert, 0 - normal)
+#define PCM_FS_INVERT_SHIFT 28
+#define PCM_FS_FREQ_16_8 0x08000000 // PCM FS 16/8 Khz select (1 - 16Khz, 0 - 8Khz)
+#define PCM_FS_FREQ_16_8_SHIFT 27
+#define PCM_FS_LONG 0x04000000 // PCM FS long/short select (1 - long FS, 0 - short FS)
+#define PCM_FS_LONG_SHIFT 26
+#define PCM_FS_TRIG 0x02000000 // PCM FS trigger (1 - falling edge, 0 - rising edge trigger)
+#define PCM_FS_TRIG_SHIFT 25
+#define PCM_DATA_OFF 0x01000000 // PCM data offset from FS (1 - one clock from FS, 0 - no offset)
+#define PCM_DATA_OFF_SHIFT 24
+#define PCM_DATA_16_8 0x00800000 // PCM data word length (1 - 16 bits, 0 - 8 bits)
+#define PCM_DATA_16_8_SHIFT 23
+#define PCM_CLOCK_SEL 0x00700000 // PCM SCLK freq select
+#define PCM_CLOCK_SEL_SHIFT 20
+ // 000 - 8192 Khz
+ // 001 - 4096 Khz
+ // 010 - 2048 Khz
+ // 011 - 1024 Khz
+ // 100 - 512 Khz
+ // 101 - 256 Khz
+ // 110 - 128 Khz
+ // 111 - reserved
+#define PCM_LSB_FIRST 0x00040000 // PCM shift direction (1 - LSBit first, 0 - MSBit first)
+#define PCM_LSB_FIRST_SHIFT 18
+#define PCM_LOOPBACK 0x00020000 // PCM diagnostic loobback enable
+#define PCM_LOOPBACK_SHIFT 17
+#define PCM_EXTCLK_SEL 0x00010000 // PCM external timing clock select -- Maybe removed in 6362
+#define PCM_EXTCLK_SEL_SHIFT 16
+#define PCM_NTR_ENABLE 0x00008000 // PCM NTR counter enable -- Nayve removed in 6362
+#define PCM_NTR_ENABLE_SHIFT 15
+#define PCM_BITS_PER_FRAME_1024 0x00000400 // 1024 - Max
+#define PCM_BITS_PER_FRAME_256 0x00000100 // 256
+#define PCM_BITS_PER_FRAME_8 0x00000008 // 8 - Min
+
+ uint32 pcm_chan_ctrl; // 04
+#define PCM_TX0_EN 0x00000001 // PCM transmit channel 0 enable
+#define PCM_TX1_EN 0x00000002 // PCM transmit channel 1 enable
+#define PCM_TX2_EN 0x00000004 // PCM transmit channel 2 enable
+#define PCM_TX3_EN 0x00000008 // PCM transmit channel 3 enable
+#define PCM_TX4_EN 0x00000010 // PCM transmit channel 4 enable
+#define PCM_TX5_EN 0x00000020 // PCM transmit channel 5 enable
+#define PCM_TX6_EN 0x00000040 // PCM transmit channel 6 enable
+#define PCM_TX7_EN 0x00000080 // PCM transmit channel 7 enable
+#define PCM_RX0_EN 0x00000100 // PCM receive channel 0 enable
+#define PCM_RX1_EN 0x00000200 // PCM receive channel 1 enable
+#define PCM_RX2_EN 0x00000400 // PCM receive channel 2 enable
+#define PCM_RX3_EN 0x00000800 // PCM receive channel 3 enable
+#define PCM_RX4_EN 0x00001000 // PCM receive channel 4 enable
+#define PCM_RX5_EN 0x00002000 // PCM receive channel 5 enable
+#define PCM_RX6_EN 0x00004000 // PCM receive channel 6 enable
+#define PCM_RX7_EN 0x00008000 // PCM receive channel 7 enable
+#define PCM_RX_PACKET_SIZE 0x00ff0000 // PCM Rx DMA quasi-packet size
+#define PCM_RX_PACKET_SIZE_SHIFT 16
+
+ uint32 pcm_int_pending; // 08
+ uint32 pcm_int_mask; // 0c
+#define PCM_TX_UNDERFLOW 0x00000001 // PCM DMA receive overflow
+#define PCM_RX_OVERFLOW 0x00000002 // PCM DMA transmit underflow
+#define PCM_TDM_FRAME 0x00000004 // PCM frame boundary
+#define PCM_RX_IRQ 0x00000008 // IUDMA interrupts
+#define PCM_TX_IRQ 0x00000010
+
+ uint32 pcm_pll_ctrl1; // 10
+#define PCM_PLL_PWRDN 0x80000000 // PLL PWRDN
+#define PCM_PLL_PWRDN_CH1 0x40000000 // PLL CH PWRDN
+#define PCM_PLL_REFCMP_PWRDN 0x20000000 // PLL REFCMP PWRDN
+#define PCM_CLK16_RESET 0x10000000 // 16.382 MHz PCM interface circuitry reset.
+#define PCM_PLL_ARESET 0x08000000 // PLL Analog Reset
+#define PCM_PLL_DRESET 0x04000000 // PLL Digital Reset
+
+ uint32 pcm_pll_ctrl2; // 14
+ uint32 pcm_pll_ctrl3; // 18
+ uint32 pcm_pll_ctrl4; // 1c
+
+ uint32 pcm_pll_stat; // 20
+#define PCM_PLL_LOCK 0x00000001 // Asserted when PLL is locked to programmed frequency
+
+ uint32 pcm_ntr_counter; // 24
+
+ uint32 unused[6];
+#define PCM_MAX_TIMESLOT_REGS 16 // Number of PCM time slot registers in the table.
+ // Each register provides the settings for 8 timeslots (4 bits per timeslot)
+ uint32 pcm_slot_alloc_tbl[PCM_MAX_TIMESLOT_REGS];
+#define PCM_TS_VALID 0x8 // valid marker for TS alloc ram entry
+
+ uint32 pcm_pll_ch2_ctrl; // +0xa080
+ uint32 pcm_msif_intf; // +0xa084
+} PcmControlRegisters;
+
+#define PCM ((volatile PcmControlRegisters * const) PCM_BASE)
+
+
+typedef struct PcmIudmaRegisters
+{
+ uint16 reserved0;
+ uint16 ctrlConfig;
+#define BCM6362_IUDMA_REGS_CTRLCONFIG_MASTER_EN 0x0001
+#define BCM6362_IUDMA_REGS_CTRLCONFIG_FLOWC_CH1_EN 0x0002
+#define BCM6362_IUDMA_REGS_CTRLCONFIG_FLOWC_CH3_EN 0x0004
+#define BCM6362_IUDMA_REGS_CTRLCONFIG_FLOWC_CH5_EN 0x0008
+#define BCM6362_IUDMA_REGS_CTRLCONFIG_FLOWC_CH7_EN 0x0010
+
+ // Flow control Ch1
+ uint16 reserved1;
+ uint16 ch1_FC_Low_Thr;
+
+ uint16 reserved2;
+ uint16 ch1_FC_High_Thr;
+
+ uint16 reserved3;
+ uint16 ch1_Buff_Alloc;
+
+ // Flow control Ch3
+ uint16 reserved4;
+ uint16 ch3_FC_Low_Thr;
+
+ uint16 reserved5;
+ uint16 ch3_FC_High_Thr;
+
+ uint16 reserved6;
+ uint16 ch3_Buff_Alloc;
+
+ // Flow control Ch5
+ uint16 reserved7;
+ uint16 ch5_FC_Low_Thr;
+
+ uint16 reserved8;
+ uint16 ch5_FC_High_Thr;
+
+ uint16 reserved9;
+ uint16 ch5_Buff_Alloc;
+
+ // Flow control Ch7
+ uint16 reserved10;
+ uint16 ch7_FC_Low_Thr;
+
+ uint16 reserved11;
+ uint16 ch7_FC_High_Thr;
+
+ uint16 reserved12;
+ uint16 ch7_Buff_Alloc;
+
+ // Channel resets
+ uint16 reserved13;
+ uint16 channel_reset;
+
+ uint16 reserved14;
+ uint16 channel_debug;
+
+ // Spare register
+ uint32 dummy1;
+
+ // Interrupt status registers
+ uint16 reserved15;
+ uint16 gbl_int_stat;
+
+ // Interrupt mask registers
+ uint16 reserved16;
+ uint16 gbl_int_mask;
+} PcmIudmaRegisters;
+
+
+typedef struct PcmIudmaChannelCtrl
+{
+ uint16 reserved1;
+ uint16 config;
+#define BCM6362_IUDMA_CONFIG_ENDMA 0x0001
+#define BCM6362_IUDMA_CONFIG_PKTHALT 0x0002
+#define BCM6362_IUDMA_CONFIG_BURSTHALT 0x0004
+
+ uint16 reserved2;
+ uint16 intStat;
+#define BCM6362_IUDMA_INTSTAT_BDONE 0x0001
+#define BCM6362_IUDMA_INTSTAT_PDONE 0x0002
+#define BCM6362_IUDMA_INTSTAT_NOTVLD 0x0004
+#define BCM6362_IUDMA_INTSTAT_MASK 0x0007
+#define BCM6362_IUDMA_INTSTAT_ALL BCM6362_IUDMA_INTSTAT_MASK
+
+ uint16 reserved3;
+ uint16 intMask;
+#define BCM6362_IUDMA_INTMASK_BDONE 0x0001
+#define BCM6362_IUDMA_INTMASK_PDONE 0x0002
+#define BCM6362_IUDMA_INTMASK_NOTVLD 0x0004
+
+ uint32 maxBurst;
+#define BCM6362_IUDMA_MAXBURST_SIZE 16 /* 32-bit words */
+
+} PcmIudmaChannelCtrl;
+
+
+typedef struct PcmIudmaStateRam
+{
+ uint32 baseDescPointer; /* pointer to first buffer descriptor */
+
+ uint32 stateBytesDoneRingOffset; /* state info: how manu bytes done and the offset of the
+ current descritor in process */
+#define BCM6362_IUDMA_STRAM_DESC_RING_OFFSET 0x3fff
+
+
+ uint32 flagsLengthStatus; /* Length and status field of the current descriptor */
+
+ uint32 currentBufferPointer; /* pointer to the current descriptor */
+
+} PcmIudmaStateRam;
+
+#define BCM6362_MAX_PCM_DMA_CHANNELS 2
+
+typedef struct PcmIudma
+{
+ PcmIudmaRegisters regs; //
+ uint32 reserved1[110]; //
+ PcmIudmaChannelCtrl ctrl[BCM6362_MAX_PCM_DMA_CHANNELS]; //
+ uint32 reserved2[120]; //
+ PcmIudmaStateRam stram[BCM6362_MAX_PCM_DMA_CHANNELS]; //
+
+} PcmIudma;
+
+#define PCM_IUDMA ((volatile PcmIudma * const) PCM_DMA_BASE)
+
+
+#define IUDMA_MAX_CHANNELS 32
+
+/*
+** DMA Channel Configuration (1 .. 32)
+*/
+typedef struct DmaChannelCfg {
+ uint32 cfg; /* (00) assorted configuration */
+#define DMA_ENABLE 0x00000001 /* set to enable channel */
+#define DMA_PKT_HALT 0x00000002 /* idle after an EOP flag is detected */
+#define DMA_BURST_HALT 0x00000004 /* idle after finish current memory burst */
+ uint32 intStat; /* (04) interrupts control and status */
+ uint32 intMask; /* (08) interrupts mask */
+#define DMA_BUFF_DONE 0x00000001 /* buffer done */
+#define DMA_DONE 0x00000002 /* packet xfer complete */
+#define DMA_NO_DESC 0x00000004 /* no valid descriptors */
+ uint32 maxBurst; /* (0C) max burst length permitted */
+#define DMA_DESCSIZE_SEL 0x00040000 /* DMA Descriptor Size Selection */
+} DmaChannelCfg;
+
+/*
+** DMA State RAM (1 .. 16)
+*/
+typedef struct DmaStateRam {
+ uint32 baseDescPtr; /* (00) descriptor ring start address */
+ uint32 state_data; /* (04) state/bytes done/ring offset */
+ uint32 desc_len_status; /* (08) buffer descriptor status and len */
+ uint32 desc_base_bufptr; /* (0C) buffer descrpitor current processing */
+} DmaStateRam;
+
+
+/*
+** DMA Registers
+*/
+typedef struct DmaRegs {
+ uint32 controller_cfg; /* (00) controller configuration */
+#define DMA_MASTER_EN 0x00000001
+#define DMA_FLOWC_CH1_EN 0x00000002
+#define DMA_FLOWC_CH3_EN 0x00000004
+
+ // Flow control Ch1
+ uint32 flowctl_ch1_thresh_lo; /* 004 */
+ uint32 flowctl_ch1_thresh_hi; /* 008 */
+ uint32 flowctl_ch1_alloc; /* 00c */
+#define DMA_BUF_ALLOC_FORCE 0x80000000
+
+ // Flow control Ch3
+ uint32 flowctl_ch3_thresh_lo; /* 010 */
+ uint32 flowctl_ch3_thresh_hi; /* 014 */
+ uint32 flowctl_ch3_alloc; /* 018 */
+
+ // Flow control Ch5
+ uint32 flowctl_ch5_thresh_lo; /* 01C */
+ uint32 flowctl_ch5_thresh_hi; /* 020 */
+ uint32 flowctl_ch5_alloc; /* 024 */
+
+ // Flow control Ch7
+ uint32 flowctl_ch7_thresh_lo; /* 028 */
+ uint32 flowctl_ch7_thresh_hi; /* 02C */
+ uint32 flowctl_ch7_alloc; /* 030 */
+
+ uint32 ctrl_channel_reset; /* 034 */
+ uint32 ctrl_channel_debug; /* 038 */
+ uint32 reserved1; /* 03C */
+ uint32 ctrl_global_interrupt_status; /* 040 */
+ uint32 ctrl_global_interrupt_mask; /* 044 */
+
+ // Unused words
+ uint8 reserved2[0x200-0x48];
+
+ // Per channel registers/state ram
+ DmaChannelCfg chcfg[IUDMA_MAX_CHANNELS];/* (200-3FF) Channel configuration */
+ union {
+ DmaStateRam s[IUDMA_MAX_CHANNELS];
+ uint32 u32[4 * IUDMA_MAX_CHANNELS];
+ } stram; /* (400-5FF) state ram */
+} DmaRegs;
+
+#define SW_DMA ((volatile DmaRegs * const) SWITCH_DMA_BASE)
+
+/*
+** DMA Buffer
+*/
+typedef struct DmaDesc {
+ union {
+ struct {
+ uint16 length; /* in bytes of data in buffer */
+#define DMA_DESC_USEFPM 0x8000
+#define DMA_DESC_MULTICAST 0x4000
+#define DMA_DESC_BUFLENGTH 0x0fff
+ uint16 status; /* buffer status */
+#define DMA_OWN 0x8000 /* cleared by DMA, set by SW */
+#define DMA_EOP 0x4000 /* last buffer in packet */
+#define DMA_SOP 0x2000 /* first buffer in packet */
+#define DMA_WRAP 0x1000 /* */
+#define DMA_PRIO 0x0C00 /* Prio for Tx */
+#define DMA_APPEND_BRCM_TAG 0x0200
+#define DMA_APPEND_CRC 0x0100
+#define USB_ZERO_PKT (1<< 0) // Set to send zero length packet
+ };
+ uint32 word0;
+ };
+
+ uint32 address; /* address of data */
+} DmaDesc;
+
+/*
+** 16 Byte DMA Buffer
+*/
+typedef struct {
+ union {
+ struct {
+ uint16 length; /* in bytes of data in buffer */
+#define DMA_DESC_USEFPM 0x8000
+#define DMA_DESC_MULTICAST 0x4000
+#define DMA_DESC_BUFLENGTH 0x0fff
+ uint16 status; /* buffer status */
+#define DMA_OWN 0x8000 /* cleared by DMA, set by SW */
+#define DMA_EOP 0x4000 /* last buffer in packet */
+#define DMA_SOP 0x2000 /* first buffer in packet */
+#define DMA_WRAP 0x1000 /* */
+#define DMA_PRIO 0x0C00 /* Prio for Tx */
+#define DMA_APPEND_BRCM_TAG 0x0200
+#define DMA_APPEND_CRC 0x0100
+#define USB_ZERO_PKT (1<< 0) // Set to send zero length packet
+ };
+ uint32 word0;
+ };
+
+ uint32 address; /* address of data */
+ uint32 control;
+#define GEM_ID_MASK 0x001F
+ uint32 reserved;
+} DmaDesc16;
+
+
+/*
+** USB 2.0 Device Registers
+*/
+typedef struct UsbRegisters {
+#define USBD_CONTROL_APP_DONECSR 0x0001
+#define USBD_CONTROL_APP_RESUME 0x0002
+#define USBD_CONTROL_APP_RXFIFIO_INIT 0x0040
+#define USBD_CONTROL_APP_TXFIFIO_INIT 0x0080
+#define USBD_CONTROL_APP_FIFO_SEL_SHIFT 0x8
+#define USBD_CONTROL_APP_FIFO_INIT_SEL(x) (((x)&0x0f)<<USBD_CONTROL_APP_FIFO_SEL_SHIFT)
+#define USBD_CONTROL_APP_AUTO_CSRS 0x2000
+#define USBD_CONTROL_APP_AUTO_INS_ZERO_LEN_PKT 0x4000
+#define EN_TXZLENINS (1<<14)
+#define EN_RXZSCFG (1<<12)
+#define APPSETUPERRLOCK (1<<5)
+ uint32 usbd_control ;
+#define USBD_STRAPS_APP_SELF_PWR 0x0400
+#define USBD_STRAPS_APP_DEV_DISCON 0x0200
+#define USBD_STRAPS_APP_CSRPRG_SUP 0x0100
+#define USBD_STRAPS_APP_RAM_IF 0x0080
+#define USBD_STRAPS_APP_DEV_RMTWKUP 0x0040
+#define USBD_STRAPS_APP_PHYIF_8BIT 0x0004
+#define USBD_STRAPS_FULL_SPEED 0x0003
+#define USBD_STRAPS_LOW_SPEED 0x0002
+#define USBD_STRAPS_HIGH_SPEED 0x0000
+#define APPUTMIDIR(x) ((x&1)<<3)
+#define UNIDIR 0
+ uint32 usbd_straps;
+#define USB_ENDPOINT_0 0x01
+ uint32 usbd_stall;
+#define USBD_ENUM_SPEED_SHIFT 12
+#define USBD_ENUM_SPEED 0x3000
+#define UDC20_ALTINTF(x) ((x>>8)&0xf)
+#define UDC20_INTF(x) ((x>>4)&0xf)
+#define UDC20_CFG(x) ((x>>0)&0xf)
+ uint32 usbd_status;
+#define USBD_LINK (0x1<<10)
+#define USBD_SET_CSRS 0x40
+#define USBD_SUSPEND 0x20
+#define USBD_EARLY_SUSPEND 0x10
+#define USBD_SOF 0x08
+#define USBD_ENUMON 0x04
+#define USBD_SETUP 0x02
+#define USBD_USBRESET 0x01
+ uint32 usbd_events;
+ uint32 usbd_events_irq;
+#define UPPER(x) (16+x)
+#define ENABLE(x) (1<<x)
+#define SWP_TXBSY (15)
+#define SWP_RXBSY (14)
+#define SETUP_ERR (13)
+#define APPUDCSTALLCHG (12)
+#define BUS_ERR (11)
+#define USB_LINK (10)
+#define HST_SETCFG (9)
+#define HST_SETINTF (8)
+#define ERRATIC_ERR (7)
+#define SET_CSRS (6)
+#define SUSPEND (5)
+#define ERLY_SUSPEND (4)
+#define SOF (3)
+#define ENUM_ON (2)
+#define SETUP (1)
+#define USB_RESET (0)
+#define RISING(x) (0x0<<2*x)
+#define FALLING(x) (0x1<<2*x)
+#define USBD_IRQCFG_ENUM_ON_FALLING_EDGE 0x00000010
+ uint32 usbd_irqcfg_hi ;
+ uint32 usbd_irqcfg_lo ;
+#define USBD_USB_RESET_IRQ 0x00000001
+#define USBD_USB_SETUP_IRQ 0x00000002 // non-standard setup cmd rcvd
+#define USBD_USB_ENUM_ON_IRQ 0x00000004
+#define USBD_USB_SOF_IRQ 0x00000008
+#define USBD_USB_EARLY_SUSPEND_IRQ 0x00000010
+#define USBD_USB_SUSPEND_IRQ 0x00000020 // non-standard setup cmd rcvd
+#define USBD_USB_SET_CSRS_IRQ 0x00000040
+#define USBD_USB_ERRATIC_ERR_IRQ 0x00000080
+#define USBD_USB_SETCFG_IRQ 0x00000200
+#define USBD_USB_LINK_IRQ 0x00000400
+ uint32 usbd_events_irq_mask;
+ uint32 usbd_swcfg;
+ uint32 usbd_swtxctl;
+ uint32 usbd_swrxctl;
+ uint32 usbd_txfifo_rwptr;
+ uint32 usbd_rxfifo_rwptr;
+ uint32 usbd_txfifo_st_rwptr;
+ uint32 usbd_rxfifo_st_rwptr;
+ uint32 usbd_txfifo_config ;
+ uint32 usbd_rxfifo_config ;
+ uint32 usbd_txfifo_epsize ;
+ uint32 usbd_rxfifo_epsize ;
+#define USBD_EPNUM_CTRL 0x0
+#define USBD_EPNUM_ISO 0x1
+#define USBD_EPNUM_BULK 0x2
+#define USBD_EPNUM_IRQ 0x3
+#define USBD_EPNUM_EPTYPE(x) (((x)&0x3)<<8)
+#define USBD_EPNUM_EPDMACHMAP(x) (((x)&0xf)<<0)
+ uint32 usbd_epnum_typemap ;
+ uint32 usbd_reserved [0xB] ;
+ uint32 usbd_csr_setupaddr ;
+#define USBD_EPNUM_MASK 0xf
+#define USBD_EPNUM(x) ((x&USBD_EPNUM_MASK)<<0)
+#define USBD_EPDIR_IN (1<<4)
+#define USBD_EPDIR_OUT (0<<4)
+#define USBD_EPTYP_CTRL (USBD_EPNUM_CTRL<<5)
+#define USBD_EPTYP_ISO (USBD_EPNUM_ISO<<5)
+#define USBD_EPTYP_BULK (USBD_EPNUM_BULK<<5)
+#define USBD_EPTYP_IRQ (USBD_EPNUM_IRQ<<5)
+#define USBD_EPCFG_MASK 0xf
+#define USBD_EPCFG(x) ((x&USBD_EPCFG_MASK)<<7)
+#define USBD_EPINTF_MASK 0xf
+#define USBD_EPINTF(x) ((x&USBD_EPINTF_MASK)<<11)
+#define USBD_EPAINTF_MASK 0xf
+#define USBD_EPAINTF(x) ((x&USBD_EPAINTF_MASK)<<15)
+#define USBD_EPMAXPKT_MSK 0x7ff
+#define USBD_EPMAXPKT(x) ((x&USBD_EPMAXPKT_MSK)<<19)
+#define USBD_EPISOPID_MASK 0x3
+#define USBD_EPISOPID(x) ((x&USBD_ISOPID_MASK)<<30)
+ uint32 usbd_csr_ep [5] ;
+} UsbRegisters;
+
+#define USB ((volatile UsbRegisters * const) USB_CTL_BASE)
+
+typedef struct USBControl {
+ uint32 BrtControl1;
+ uint32 BrtControl2;
+ uint32 BrtStatus1;
+ uint32 BrtStatus2;
+ uint32 UTMIControl1;
+ uint32 TestPortControl;
+ uint32 PllControl1;
+ uint32 SwapControl;
+#define USB_DEVICE_SEL (1<<6)
+#define EHCI_LOGICAL_ADDRESS_EN (1<<5)
+#define EHCI_ENDIAN_SWAP (1<<4)
+#define EHCI_DATA_SWAP (1<<3)
+#define OHCI_LOGICAL_ADDRESS_EN (1<<2)
+#define OHCI_ENDIAN_SWAP (1<<1)
+#define OHCI_DATA_SWAP (1<<0)
+ uint32 unused1;
+ uint32 FrameAdjustValue;
+ uint32 Setup;
+#define USBH_IOC (1<<4)
+ uint32 MDIO;
+ uint32 MDIO32;
+ uint32 USBSimControl;
+} USBControl;
+
+#define USBH ((volatile USBControl * const) USBH_CFG_BASE)
+
+typedef struct EthSwRegs{
+ byte port_traffic_ctrl[9]; /* 0x00 - 0x08 */
+ byte reserved1[2]; /* 0x09 - 0x0a */
+ byte switch_mode; /* 0x0b */
+ unsigned short pause_quanta; /*0x0c */
+ byte imp_port_state; /*0x0e */
+ byte led_refresh; /* 0x0f */
+ unsigned short led_function[2]; /* 0x10 */
+ unsigned short led_function_map; /* 0x14 */
+ unsigned short led_enable_map; /* 0x16 */
+ unsigned short led_mode_map0; /* 0x18 */
+ unsigned short led_function_map1; /* 0x1a */
+ byte reserved2[5]; /* 0x1b - 0x20 */
+ byte port_forward_ctrl; /* 0x21 */
+ byte reserved3[2]; /* 0x22 - 0x23 */
+ unsigned short protected_port_selection; /* 0x24 */
+ unsigned short wan_port_select; /* 0x26 */
+ unsigned int pause_capability; /* 0x28 */
+ byte reserved4[3]; /* 0x2c - 0x2e */
+ byte reserved_multicast_control; /* 0x2f */
+ byte reserved5; /* 0x30 */
+ byte txq_flush_mode_control; /* 0x31 */
+ unsigned short ulf_forward_map; /* 0x32 */
+ unsigned short mlf_forward_map; /* 0x34 */
+ unsigned short mlf_impc_forward_map; /* 0x36 */
+ unsigned short pause_pass_through_for_rx; /* 0x38 */
+ unsigned short pause_pass_through_for_tx; /* 0x3a */
+ unsigned short disable_learning; /* 0x3c */
+ byte reserved6[26]; /* 0x3e - 0x57 */
+ byte port_state_override[8]; /* 0x58 - 0x5f */
+ byte reserved7[4]; /* 0x60 - 0x63 */
+ byte imp_rgmii_ctrl_p4; /* 0x64 */
+ byte imp_rgmii_ctrl_p5; /* 0x65 */
+ byte reserved8[6]; /* 0x66 - 0x6b */
+ byte rgmii_timing_delay_p4; /* 0x6c */
+ byte gmii_timing_delay_p5; /* 0x6d */
+ byte reserved9[11]; /* 0x6e - 0x78 */
+ byte software_reset; /* 0x79 */
+ byte reserved13[6]; /* 0x7a - 0x7f */
+ byte pause_frame_detection; /* 0x80 */
+ byte reserved10[7]; /* 0x81 - 0x87 */
+ byte fast_aging_ctrl; /* 0x88 */
+ byte fast_aging_port; /* 0x89 */
+ byte fast_aging_vid; /* 0x8a */
+ byte reserved11[21]; /* 0x8b - 0x9f */
+ unsigned int swpkt_ctrl_sar; /*0xa0 */
+ unsigned int swpkt_ctrl_usb; /*0xa4 */
+ unsigned int iudma_ctrl; /*0xa8 */
+ unsigned int rxfilt_ctrl; /*0xac */
+ unsigned int mdio_ctrl; /*0xb0 */
+ unsigned int mdio_data; /*0xb4 */
+ byte reserved12[42]; /* 0xb6 - 0xdf */
+ unsigned int sw_mem_test; /*0xe0 */
+} EthSwRegs;
+
+#define ETHSWREG ((volatile EthSwRegs * const) SWITCH_BASE)
+
+typedef struct EthSwMIBRegs {
+ unsigned int TxOctetsLo;
+ unsigned int TxOctetsHi;
+ unsigned int TxDropPkts;
+ unsigned int TxQoSPkts;
+ unsigned int TxBroadcastPkts;
+ unsigned int TxMulticastPkts;
+ unsigned int TxUnicastPkts;
+ unsigned int TxCol;
+ unsigned int TxSingleCol;
+ unsigned int TxMultipleCol;
+ unsigned int TxDeferredTx;
+ unsigned int TxLateCol;
+ unsigned int TxExcessiveCol;
+ unsigned int TxFrameInDisc;
+ unsigned int TxPausePkts;
+ unsigned int TxQoSOctetsLo;
+ unsigned int TxQoSOctetsHi;
+ unsigned int RxOctetsLo;
+ unsigned int RxOctetsHi;
+ unsigned int RxUndersizePkts;
+ unsigned int RxPausePkts;
+ unsigned int Pkts64Octets;
+ unsigned int Pkts65to127Octets;
+ unsigned int Pkts128to255Octets;
+ unsigned int Pkts256to511Octets;
+ unsigned int Pkts512to1023Octets;
+ unsigned int Pkts1024to1522Octets;
+ unsigned int RxOversizePkts;
+ unsigned int RxJabbers;
+ unsigned int RxAlignErrs;
+ unsigned int RxFCSErrs;
+ unsigned int RxGoodOctetsLo;
+ unsigned int RxGoodOctetsHi;
+ unsigned int RxDropPkts;
+ unsigned int RxUnicastPkts;
+ unsigned int RxMulticastPkts;
+ unsigned int RxBroadcastPkts;
+ unsigned int RxSAChanges;
+ unsigned int RxFragments;
+ unsigned int RxExcessSizeDisc;
+ unsigned int RxSymbolError;
+ unsigned int RxQoSPkts;
+ unsigned int RxQoSOctetsLo;
+ unsigned int RxQoSOctetsHi;
+ unsigned int Pkts1523to2047;
+ unsigned int Pkts2048to4095;
+ unsigned int Pkts4096to8191;
+ unsigned int Pkts8192to9728;
+} EthSwMIBRegs;
+
+#define ETHSWMIBREG ((volatile EthSwMIBRegs * const) (SWITCH_BASE + 0x2000))
+
+/*
+** NAND Interrupt Controller Registers
+*/
+typedef struct NandIntrCtrlRegs {
+ uint32 NandInterrupt;
+#define NINT_ENABLE_MASK 0xffff0000
+#define NINT_STS_MASK 0x00000fff
+#define NINT_ECC_ERROR_CORR 0x00000080
+#define NINT_ECC_ERROR_UNC 0x00000040
+#define NINT_DEV_RBPIN 0x00000020
+#define NINT_CTRL_READY 0x00000010
+#define NINT_PAGE_PGM 0x00000008
+#define NINT_COPY_BACK 0x00000004
+#define NINT_BLOCK_ERASE 0x00000002
+#define NINT_NP_READ 0x00000001
+
+ uint32 NandBaseAddr0; /* Default address when booting from NAND flash */
+ uint32 reserved;
+ uint32 NandBaseAddr1; /* Secondary base address for NAND flash */
+} NandIntrCtrlRegs;
+
+#define NAND_INTR ((volatile NandIntrCtrlRegs * const) NAND_INTR_BASE)
+
+/*
+** NAND Controller Registers
+*/
+typedef struct NandCtrlRegs {
+ uint32 NandRevision; /* NAND Revision */
+ uint32 NandCmdStart; /* Nand Flash Command Start */
+#define NCMD_MASK 0x0f000000
+#define NCMD_BLK_LOCK_STS 0x0d000000
+#define NCMD_BLK_UNLOCK 0x0c000000
+#define NCMD_BLK_LOCK_DOWN 0x0b000000
+#define NCMD_BLK_LOCK 0x0a000000
+#define NCMD_FLASH_RESET 0x09000000
+#define NCMD_BLOCK_ERASE 0x08000000
+#define NCMD_DEV_ID_READ 0x07000000
+#define NCMD_COPY_BACK 0x06000000
+#define NCMD_PROGRAM_SPARE 0x05000000
+#define NCMD_PROGRAM_PAGE 0x04000000
+#define NCMD_STS_READ 0x03000000
+#define NCMD_SPARE_READ 0x02000000
+#define NCMD_PAGE_READ 0x01000000
+
+ uint32 NandCmdExtAddr; /* Nand Flash Command Extended Address */
+ uint32 NandCmdAddr; /* Nand Flash Command Address */
+ uint32 NandCmdEndAddr; /* Nand Flash Command End Address */
+ uint32 NandNandBootConfig; /* Nand Flash Boot Config */
+#define NBC_CS_LOCK 0x80000000
+#define NBC_AUTO_DEV_ID_CFG 0x40000000
+#define NBC_WR_PROT_BLK0 0x10000000
+
+ uint32 NandCsNandXor; /* Nand Flash EBI CS Address XOR with */
+ /* 1FC0 Control */
+ uint32 NandReserved;
+ uint32 NandSpareAreaReadOfs0; /* Nand Flash Spare Area Read Bytes 0-3 */
+ uint32 NandSpareAreaReadOfs4; /* Nand Flash Spare Area Read Bytes 4-7 */
+ uint32 NandSpareAreaReadOfs8; /* Nand Flash Spare Area Read Bytes 8-11 */
+ uint32 NandSpareAreaReadOfsC; /* Nand Flash Spare Area Read Bytes 12-15*/
+ uint32 NandSpareAreaWriteOfs0; /* Nand Flash Spare Area Write Bytes 0-3 */
+ uint32 NandSpareAreaWriteOfs4; /* Nand Flash Spare Area Write Bytes 4-7 */
+ uint32 NandSpareAreaWriteOfs8; /* Nand Flash Spare Area Write Bytes 8-11*/
+ uint32 NandSpareAreaWriteOfsC; /* Nand Flash Spare Area Write Bytes12-15*/
+ uint32 NandAccControl; /* Nand Flash Access Control */
+ uint32 NandConfig; /* Nand Flash Config */
+#define NC_CONFIG_LOCK 0x80000000
+#define NC_PG_SIZE_MASK 0x00300000
+#define NC_PG_SIZE_2K 0x00100000
+#define NC_PG_SIZE_512B 0x00000000
+#define NC_BLK_SIZE_MASK 0x30000000
+#define NC_BLK_SIZE_512K 0x30000000
+#define NC_BLK_SIZE_128K 0x10000000
+#define NC_BLK_SIZE_16K 0x00000000
+#define NC_BLK_SIZE_8K 0x20000000
+#define NC_DEV_SIZE_MASK 0x0f000000
+#define NC_DEV_SIZE_SHIFT 24
+#define NC_DEV_WIDTH_MASK 0x00800000
+#define NC_DEV_WIDTH_16 0x00800000
+#define NC_DEV_WIDTH_8 0x00000000
+#define NC_FUL_ADDR_MASK 0x00070000
+#define NC_FUL_ADDR_SHIFT 16
+#define NC_BLK_ADDR_MASK 0x00000700
+#define NC_BLK_ADDR_SHIFT 8
+
+ uint32 NandTiming1; /* Nand Flash Timing Parameters 1 */
+ uint32 NandTiming2; /* Nand Flash Timing Parameters 2 */
+ uint32 NandSemaphore; /* Semaphore */
+ uint32 NandFlashDeviceId; /* Nand Flash Device ID */
+ uint32 NandBlockLockStatus; /* Nand Flash Block Lock Status */
+ uint32 NandIntfcStatus; /* Nand Flash Interface Status */
+#define NIS_CTLR_READY 0x80000000
+#define NIS_FLASH_READY 0x40000000
+#define NIS_CACHE_VALID 0x20000000
+#define NIS_SPARE_VALID 0x10000000
+#define NIS_FLASH_STS_MASK 0x000000ff
+#define NIS_WRITE_PROTECT 0x00000080
+#define NIS_DEV_READY 0x00000040
+#define NIS_PGM_ERASE_ERROR 0x00000001
+
+ uint32 NandEccCorrExtAddr; /* ECC Correctable Error Extended Address*/
+ uint32 NandEccCorrAddr; /* ECC Correctable Error Address */
+ uint32 NandEccUncExtAddr; /* ECC Uncorrectable Error Extended Addr */
+ uint32 NandEccUncAddr; /* ECC Uncorrectable Error Address */
+ uint32 NandFlashReadExtAddr; /* Flash Read Data Extended Address */
+ uint32 NandFlashReadAddr; /* Flash Read Data Address */
+ uint32 NandProgramPageExtAddr; /* Page Program Extended Address */
+ uint32 NandProgramPageAddr; /* Page Program Address */
+ uint32 NandCopyBackExtAddr; /* Copy Back Extended Address */
+ uint32 NandCopyBackAddr; /* Copy Back Address */
+ uint32 NandBlockEraseExtAddr; /* Block Erase Extended Address */
+ uint32 NandBlockEraseAddr; /* Block Erase Address */
+ uint32 NandInvReadExtAddr; /* Flash Invalid Data Extended Address */
+ uint32 NandInvReadAddr; /* Flash Invalid Data Address */
+ uint32 NandBlkWrProtect; /* Block Write Protect Enable and Size */
+ /* for EBI_CS0b */
+} NandCtrlRegs;
+
+#define NAND ((volatile NandCtrlRegs * const) NAND_REG_BASE)
+
+#define NAND_CACHE ((volatile uint8 * const) NAND_CACHE_BASE)
+
+/*
+** PCI-E
+*/
+typedef struct PcieRegs{
+ uint32 devVenID;
+ uint16 command;
+ uint16 status;
+ uint32 revIdClassCode;
+ uint32 headerTypeLatCacheLineSize;
+ uint32 bar1;
+ uint32 bar2;
+ uint32 priSecBusNo;
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SUB_BUS_NO_MASK 0x00ff0000
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SUB_BUS_NO_SHIFT 16
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SEC_BUS_NO_MASK 0x0000ff00
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SEC_BUS_NO_SHIFT 8
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_PRI_BUS_NO_MASK 0x000000ff
+
+ uint32 ioBaseLimit;
+ uint32 secStatus;
+ uint32 rcMemBaseLimit;
+ uint32 rcPrefBaseLimit;
+ uint32 rcPrefBaseHi;
+ uint32 rcPrefLimitHi;
+ uint32 rcIoBaseLimit;
+ uint32 capPointer;
+ uint32 expRomBase;
+ uint32 brdigeCtrlIntPinIntLine;
+ uint32 bridgeCtrl;
+ uint32 unused1[27];
+
+ /* PcieExpressCtrlRegs */
+ uint16 pciExpressCap;
+ uint16 pcieCapabilitiy;
+ uint32 deviceCapability;
+ uint16 deviceControl;
+ uint16 deviceStatus;
+ uint32 linkCapability;
+ uint16 linkControl;
+ uint16 linkStatus;
+ uint32 slotCapability;
+ uint16 slotControl;
+ uint16 slotStatus;
+ uint16 rootControl;
+ uint16 rootCap;
+ uint32 rootStatus;
+ uint32 deviceCapability2;
+ uint16 deviceControl2;
+ uint16 deviceStatus2;
+ uint32 linkCapability2;
+ uint16 linkControl2;
+ uint16 linkStatus2;
+ uint32 slotCapability2;
+ uint16 slotControl2;
+ uint16 slotStatus2;
+ uint32 unused2[6];
+
+ /* PcieErrorRegs */
+ uint16 advErrCapId;
+ uint16 advErrCapOff;
+ uint32 ucErrStatus;
+ uint32 ucorrErrMask;
+ uint32 ucorrErrSevr;
+ uint32 corrErrStatus;
+ uint32 corrErrMask;
+ uint32 advErrCapControl;
+ uint32 headerLog1;
+ uint32 headerLog2;
+ uint32 headerLog3;
+ uint32 headerLog4;
+ uint32 rootErrorCommand;
+ uint32 rootErrorStatus;
+ uint32 rcCorrId;
+ uint32 rcFatalNonfatalId;
+ uint32 unused3[10];
+
+ /* PcieVcRegs */
+ uint16 vcCapId;
+ uint16 vcCapOffset;
+ uint32 prtVcCapability;
+ uint32 portVcCapability2;
+ uint16 portVcControl;
+ uint16 portVcCtatus;
+ uint32 portArbStatus;
+ uint32 vcRsrcControl;
+ uint32 vcRsrcStatus;
+ uint32 unused4[1];
+
+ /* PcieVendor */
+ uint32 vendorCapability;
+ uint32 vendorSpecificHdr;
+} PcieRegs;
+
+typedef struct PcieBlk404Regs{
+ uint32 unused; /* 0x404 */
+ uint32 config2; /* 0x408 */
+#define PCIE_IP_BLK404_CONFIG_2_BAR1_SIZE_MASK 0x0000000f
+#define PCIE_IP_BLK404_CONFIG_2_BAR1_DISABLE 0
+ uint32 config3; /* 0x40c */
+ uint32 pmDataA; /* 0x410 */
+ uint32 pmDataB; /* 0x414 */
+} PcieBlk404Regs;
+
+typedef struct PcieBlk428Regs{
+ uint32 vpdIntf; /* 0x428 */
+ uint16 unused_g; /* 0x42c */
+ uint16 vpdAddrFlag; /* 0x42e */
+ uint32 vpdData; /* 0x430 */
+ uint32 idVal1; /* 0x434 */
+ uint32 idVal2; /* 0x438 */
+ uint32 idVal3; /* 0x43c */
+#define PCIE_IP_BLK428_ID_VAL3_REVISION_ID_MASK 0xff000000
+#define PCIE_IP_BLK428_ID_VAL3_REVISION_ID_SHIFT 24
+#define PCIE_IP_BLK428_ID_VAL3_CLASS_CODE_MASK 0x00ffffff
+#define PCIE_IP_BLK428_ID_VAL3_CLASS_CODE_SHIFT 16
+#define PCIE_IP_BLK428_ID_VAL3_SUB_CLASS_CODE_SHIFT 8
+
+ uint32 idVal4;
+ uint32 idVal5;
+ uint32 unused_h;
+ uint32 idVal6;
+ uint32 msiData;
+ uint32 msiAddr_h;
+ uint32 msiAddr_l;
+ uint32 msiMask;
+ uint32 msiPend;
+ uint32 pmData_c;
+ uint32 msixControl;
+ uint32 msixTblOffBir;
+ uint32 msixPbaOffBit;
+ uint32 unused_k;
+ uint32 pcieCapability;
+ uint32 deviceCapability;
+ uint32 unused_l;
+ uint32 linkCapability;
+ uint32 bar2Config;
+ uint32 pcieDeviceCapability2;
+ uint32 pcieLinkCapability2;
+ uint32 pcieLinkControl;
+ uint32 pcieLinkCapabilityRc;
+ uint32 bar3Config;
+ uint32 rootCap;
+ uint32 devSerNumCapId;
+ uint32 lowerSerNum;
+ uint32 upperSerNum;
+ uint32 advErrCap;
+ uint32 pwrBdgtData0;
+ uint32 pwrBdgtData1;
+ uint32 pwrBdgtData2;
+ uint32 pwdBdgtData3;
+ uint32 pwrBdgtData4;
+ uint32 pwrBdgtData5;
+ uint32 pwrBdgtData6;
+ uint32 pwrBdgtData7;
+ uint32 pwrBdgtCapability;
+ uint32 vsecHdr;
+ uint32 rcUserMemLo1;
+ uint32 rcUserMemHi1;
+ uint32 rcUserMemLo2;
+ uint32 rcUserMemHi2;
+}PcieBlk428Regs;
+
+typedef struct PcieBlk800Regs{
+#define NUM_PCIE_BLK_800_CTRL_REGS 6
+ uint32 tlControl[NUM_PCIE_BLK_800_CTRL_REGS];
+ uint32 tlCtlStat0;
+ uint32 pmStatus0;
+ uint32 pmStatus1;
+
+#define NUM_PCIE_BLK_800_TAGS 32
+ uint32 tlStatus[NUM_PCIE_BLK_800_TAGS];
+ uint32 tlHdrFcStatus;
+ uint32 tlDataFcStatus;
+ uint32 tlHdrFcconStatus;
+ uint32 tlDataFcconStatus;
+ uint32 tlTargetCreditStatus;
+ uint32 tlCreditAllocStatus;
+ uint32 tlSmlogicStatus;
+} PcieBlk800Regs;
+
+
+typedef struct PcieBlk1000Regs{
+#define NUM_PCIE_BLK_1000_PDL_CTRL_REGS 16
+ uint32 pdlControl[NUM_PCIE_BLK_1000_PDL_CTRL_REGS];
+ uint32 dlattnVec;
+ uint32 dlAttnMask;
+ uint32 dlStatus; /* 0x1048 */
+#define PCIE_IP_BLK1000_DL_STATUS_PHYLINKUP_MASK 0x00002000
+#define PCIE_IP_BLK1000_DL_STATUS_PHYLINKUP_SHIFT 13
+ uint32 dlTxChecksum;
+ uint32 dlForcedUpdateGen1;
+ uint32 mdioAddr;
+ uint32 mdioWrData;
+ uint32 mdioRdData;
+ uint32 dlRxPFcCl;
+ uint32 dlRxCFcCl;
+ uint32 dlRxAckNack;
+ uint32 dlTxRxSeqnb;
+ uint32 dlTxPFcAl;
+ uint32 dlTxNpFcAl;
+ uint32 regDlSpare;
+ uint32 dlRegSpare;
+ uint32 dlTxRxSeq;
+ uint32 dlRxNpFcCl;
+}PcieBlk1000Regs;
+
+typedef struct PcieBlk1800Regs{
+#define NUM_PCIE_BLK_1800_PHY_CTRL_REGS 5
+ uint32 phyCtrl[NUM_PCIE_BLK_1800_PHY_CTRL_REGS];
+#define REG_POWERDOWN_P1PLL_ENA (1<<12)
+ uint32 phyErrorAttnVec;
+ uint32 phyErrorAttnMask;
+ uint32 phyReceivedMcpErrors;
+ uint32 phyTransmittedMcpErrors;
+ uint32 phyGenDebug;
+ uint32 phyRecoveryHist;
+#define NUM_PCIE_BLK_1800_PHY_LTSSM_HIST_REGS 3
+ uint32 phyltssmHist[NUM_PCIE_BLK_1800_PHY_LTSSM_HIST_REGS];
+#define NUM_PCIE_BLK_1800_PHY_DBG_REGS 11
+ uint32 phyDbg[NUM_PCIE_BLK_1800_PHY_DBG_REGS];
+} PcieBlk1800Regs;
+
+typedef struct PcieBridgeRegs{
+ uint32 bar1Remap; /* 0x0818*/
+#define PCIE_BRIDGE_BAR1_REMAP_addr_MASK 0xffff0000
+#define PCIE_BRIDGE_BAR1_REMAP_addr_MASK_SHIFT 16
+#define PCIE_BRIDGE_BAR1_REMAP_remap_enable (1<<1)
+#define PCIE_BRIDGE_BAR1_REMAP_swap_enable 1
+
+ uint32 bar2Remap; /* 0x081c*/
+#define PCIE_BRIDGE_BAR2_REMAP_addr_MASK 0xffff0000
+#define PCIE_BRIDGE_BAR2_REMAP_addr_MASK_SHIFT 16
+#define PCIE_BRIDGE_BAR2_REMAP_remap_enable (1<<1)
+#define PCIE_BRIDGE_BAR2_REMAP_swap_enable 1
+
+ uint32 bridgeOptReg1; /* 0x0820*/
+#define PCIE_BRIDGE_OPT_REG1_en_l1_int_status_mask_polarity (1<<12)
+#define PCIE_BRIDGE_OPT_REG1_en_pcie_bridge_hole_detection (1<<11)
+#define PCIE_BRIDGE_OPT_REG1_en_rd_reply_be_fix (1<<9)
+#define PCIE_BRIDGE_OPT_REG1_enable_rd_be_opt (1<<7)
+
+ uint32 bridgeOptReg2; /* 0x0824*/
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_func_no_MASK 0xe0000000
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_func_no_SHIFT 29
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_dev_no_MASK 0x1f000000
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_dev_no_SHIFT 24
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bus_no_MASK 0x00ff0000
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bus_no_SHIFT 16
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bd_sel_MASK 0x00000080
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bd_sel_SHIFT 7
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_timeout_MASK 0x00000040
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_timeout_SHIFT 6
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_abort_MASK 0x00000020
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_abort_SHIFT 5
+#define PCIE_BRIDGE_OPT_REG2_enable_tx_crd_chk_MASK 0x00000010
+#define PCIE_BRIDGE_OPT_REG2_enable_tx_crd_chk_SHIFT 4
+#define PCIE_BRIDGE_OPT_REG2_dis_ubus_ur_decode_MASK 0x00000004
+#define PCIE_BRIDGE_OPT_REG2_dis_ubus_ur_decode_SHIFT 2
+#define PCIE_BRIDGE_OPT_REG2_cfg_reserved_MASK 0x0000ff0b
+
+ uint32 Ubus2PcieBar0BaseMask; /* 0x0828 */
+#define PCIE_BRIDGE_BAR0_BASE_base_MASK 0xfff00000
+#define PCIE_BRIDGE_BAR0_BASE_base_MASK_SHIFT 20
+#define PCIE_BRIDGE_BAR0_BASE_mask_MASK 0x0000fff0
+#define PCIE_BRIDGE_BAR0_BASE_mask_MASK_SHIFT 4
+#define PCIE_BRIDGE_BAR0_BASE_swap_enable (1<<1)
+#define PCIE_BRIDGE_BAR0_BASE_remap_enable 1
+
+ uint32 Ubus2PcieBar0RemapAdd; /* 0x082c */
+#define PCIE_BRIDGE_BAR0_REMAP_ADDR_addr_MASK 0xfff00000
+#define PCIE_BRIDGE_BAR0_REMAP_ADDR_addr_SHIFT 20
+
+ uint32 Ubus2PcieBar1BaseMask; /* 0x0830 */
+#define PCIE_BRIDGE_BAR1_BASE_base_MASK 0xfff00000
+#define PCIE_BRIDGE_BAR1_BASE_base_MASK_SHIFT 20
+#define PCIE_BRIDGE_BAR1_BASE_mask_MASK 0x0000fff0
+#define PCIE_BRIDGE_BAR1_BASE_mask_MASK_SHIFT 4
+#define PCIE_BRIDGE_BAR1_BASE_swap_enable (1<<1)
+#define PCIE_BRIDGE_BAR1_BASE_remap_enable 1
+
+ uint32 Ubus2PcieBar1RemapAdd; /* 0x0834 */
+#define PCIE_BRIDGE_BAR1_REMAP_ADDR_addr_MASK 0xfff00000
+#define PCIE_BRIDGE_BAR1_REMAP_ADDR_addr_SHIFT 20
+
+ uint32 bridgeErrStatus; /* 0x0838 */
+ uint32 bridgeErrMask; /* 0x083c */
+ uint32 coreErrStatus2; /* 0x0840 */
+ uint32 coreErrMask2; /* 0x0844 */
+ uint32 coreErrStatus1; /* 0x0848 */
+ uint32 coreErrMask1; /* 0x084c */
+ uint32 rcInterruptStatus; /* 0x0850 */
+ uint32 rcInterruptMask; /* 0x0854 */
+#define PCIE_BRIDGE_INTERRUPT_MASK_int_a_MASK (1<<0)
+#define PCIE_BRIDGE_INTERRUPT_MASK_int_b_MASK (1<<1)
+#define PCIE_BRIDGE_INTERRUPT_MASK_int_c_MASK (1<<2)
+#define PCIE_BRIDGE_INTERRUPT_MASK_int_d_MASK (1<<3)
+
+}PcieBridgeRegs;
+
+#define PCIEH_DEV_OFFSET 0x8000
+#define PCIEH ((volatile uint32 * const) PCIE_BASE)
+#define PCIEH_REGS ((volatile PcieRegs * const) PCIE_BASE)
+
+#define PCIEH_BLK_404_REGS ((volatile PcieBlk404Regs * const) \
+ (PCIE_BASE+0x404))
+#define PCIEH_BLK_428_REGS ((volatile PcieBlk428Regs * const) \
+ (PCIE_BASE+0x428))
+#define PCIEH_BLK_800_REGS ((volatile PcieBlk800Regs * const) \
+ (PCIE_BASE+0x800))
+#define PCIEH_BLK_1000_REGS ((volatile PcieBlk1000Regs * const) \
+ (PCIE_BASE+0x1000))
+#define PCIEH_BLK_1800_REGS ((volatile PcieBlk1800Regs * const) \
+ (PCIE_BASE+0x1800))
+#define PCIEH_BRIDGE_REGS ((volatile PcieBridgeRegs * const) \
+ (PCIE_BASE+0x2818))
+
+typedef struct WlanShimRegs_a0 {
+ uint32 CcIdA; /* CC desc A */
+ uint32 CcIdB; /* CC desc B */
+ uint32 CcAddr; /* CC base addr */
+ uint32 MacIdA; /* MAC desc A */
+ uint32 MacIdB; /* MAC desc B */
+ uint32 MacAddr; /* MAC base addr */
+ uint32 ShimIdA; /* SHIM desc A */
+ uint32 ShimIdB; /* SHIM desc B */
+ uint32 ShimAddr; /* SHIM addr */
+ uint32 ShimEot; /* EOT */
+ uint32 CcControl; /* CC control */
+ uint32 CcStatus; /* CC status */
+ uint32 MacControl; /* MAC control */
+ uint32 MacStatus; /* MAC status */
+ uint32 ShimMisc; /* SHIM control registers */
+ uint32 ShimStatus; /* SHIM status */
+}WlanShimRegs_a0;
+
+typedef struct WlanShimRegs_b0 {
+ uint32 ShimMisc; /* SHIM control registers */
+#define WLAN_SHIM_FORCE_CLOCKS_ON (1 << 2)
+#define WLAN_SHIM_MACRO_DISABLE (1 << 1)
+#define WLAN_SHIM_MACRO_SOFT_RESET (1 << 0)
+
+ uint32 ShimStatus; /* SHIM status */
+
+ uint32 CcControl; /* CC control */
+#define SICF_WOC_CORE_RESET 0x10000
+#define SICF_BIST_EN 0x8000
+#define SICF_PME_EN 0x4000
+#define SICF_CORE_BITS 0x3ffc
+#define SICF_FGC 0x0002
+#define SICF_CLOCK_EN 0x0001
+
+ uint32 CcStatus; /* CC status */
+#define SISF_BIST_DONE 0x8000
+#define SISF_BIST_ERROR 0x4000
+#define SISF_GATED_CLK 0x2000
+#define SISF_DMA64 0x1000
+#define SISF_CORE_BITS 0x0fff
+
+ uint32 MacControl; /* MAC control */
+ uint32 MacStatus; /* MAC status */
+
+ uint32 CcIdA; /* CC desc A */
+ uint32 CcIdB; /* CC desc B */
+ uint32 CcAddr; /* CC base addr */
+ uint32 MacIdA; /* MAC desc A */
+ uint32 MacIdB; /* MAC desc B */
+ uint32 MacAddr; /* MAC base addr */
+ uint32 ShimIdA; /* SHIM desc A */
+ uint32 ShimIdB; /* SHIM desc B */
+ uint32 ShimAddr; /* SHIM addr */
+ uint32 ShimEot; /* EOT */
+}WlanShimRegs_b0;
+
+typedef union WlanShimRegs {
+ WlanShimRegs_a0 a0;
+ WlanShimRegs_b0 b0; /* SHIM control registers */
+}WlanShimRegs;
+
+#define WLAN_SHIM ((volatile WlanShimRegs * const)WLAN_SHIM_BASE)
+
+/*
+** DECT IP Device Registers
+*/
+typedef enum DECT_SHM_ENABLE_BITS
+{
+ DECT_SHM_IRQ_DSP_INT,
+ DECT_SHM_IRQ_DSP_IRQ_OUT,
+ DECT_SHM_IRQ_DIP_INT,
+ DECT_SHM_H2D_BUS_ERR,
+ DECT_SHM_IRQ_TX_DMA_DONE,
+ DECT_SHM_IRQ_RX_DMA_DONE,
+ DECT_SHM_IRQ_PLL_PHASE_LOCK = DECT_SHM_IRQ_RX_DMA_DONE + 2, /* Skip reserved bit */
+ DECT_SHM_REG_DSP_BREAK,
+ DECT_SHM_REG_DIP_BREAK,
+ DECT_SHM_REG_IRQ_TO_IP = DECT_SHM_REG_DIP_BREAK + 2, /* Skip reserved bit */
+ DECT_SHM_TX_DMA_DONE_TO_IP,
+ DECT_SHM_RX_DMA_DONE_TO_IP,
+} DECT_SHM_ENABLE_BITS;
+
+typedef struct DECTShimControl
+{
+ uint32 dect_shm_ctrl; /* 0xb000b000 DECT shim control registers */
+#define APB_SWAP_MASK 0x0000C000
+#define APB_SWAP_16_BIT 0x00000000
+#define APB_SWAP_8_BIT 0x00004000
+#define AHB_SWAP_MASK 0x00003000
+#define AHB_SWAP_16_BIT 0x00003000
+#define AHB_SWAP_8_BIT 0x00002000
+#define AHB_SWAP_ACCESS 0x00001000
+#define AHB_SWAP_NONE 0x00000000
+#define DECT_PULSE_COUNT_ENABLE 0x00000200
+#define PCM_PULSE_COUNT_ENABLE 0x00000100
+#define DECT_SOFT_RESET 0x00000010
+#define PHCNT_CLK_SRC_PLL 0x00000008
+#define PHCNT_CLK_SRC_XTAL 0x00000000
+#define DECT_CLK_OUT_PLL 0x00000004
+#define DECT_CLK_OUT_XTAL 0x00000000
+#define DECT_CLK_CORE_PCM 0x00000002
+#define DECT_CLK_CORE_DECT 0x00000000
+#define DECT_PLL_REF_PCM 0x00000001
+#define DECT_PLL_REF_DECT 0x00000000
+
+ uint32 dect_shm_pcm_clk_cntr; /* 0xb000b004 PCM clock counter */
+ uint32 dect_shm_dect_clk_cntr; /* 0xb000b008 DECT clock counter */
+ uint32 dect_shm_dect_clk_cntr_sh; /* 0xb000b00c DECT clock counter snapshot */
+ uint32 dect_shm_irq_enable; /* 0xb000b010 DECT interrupt enable register */
+ uint32 dect_shm_irq_status; /* 0xb000b014 DECT Interrupt status register */
+ uint32 dect_shm_irq_trig; /* 0xb000b018 DECT DSP ext IRQ trigger and IRQ test register */
+ uint32 dect_shm_dma_status; /* 0xb000b01c DECT DMA STATUS register */
+ uint32 dect_shm_xtal_ctrl; /* 0xb000b020 DECT analog tunable XTAL control register */
+ uint32 dect_shm_bandgap_ctrl; /* 0xb000b024 DECT analog bandgap control register */
+ uint32 dect_shm_afe_tx_ctrl; /* 0xb000b028 DECT analog TX DAC control register */
+ uint32 dect_shm_afe_test_ctrl; /* 0xb000b02c DECT analog test control register */
+ uint32 dect_shm_pll_reg_0; /* 0xb000b030 DECT PLL configuration register 0 */
+ uint32 dect_shm_pll_reg_1; /* 0xb000b034 DECT PLL configuration register 1 */
+#define PLL_PWRDWN 0x01000000
+#define PLL_REFCOMP_PWRDOWN 0x02000000
+#define PLL_NDIV_PWRDOWN 0x04000000
+#define PLL_CH1_PWRDOWN 0x08000000
+#define PLL_CH2_PWRDOWN 0x10000000
+#define PLL_CH3_PWRDOWN 0x20000000
+#define PLL_DRESET 0x40000000
+#define PLL_ARESET 0x80000000
+
+ uint32 dect_shm_pll_reg_2; /* 0xb000b038 DECT PLL Ndiv configuration register */
+ uint32 dect_shm_pll_reg_3; /* 0xb000b03c DECT PLL Pdiv and Mdiv configuration register */
+} DECTShimControl;
+
+#define DECT_CTRL ((volatile DECTShimControl * const) DECT_SHIM_CTRL_BASE)
+
+typedef struct DECTShimDmaControl
+{
+ uint32 dect_shm_dma_ctrl; /* 0xb000b050 DECT DMA control register */
+#define DMA_CLEAR 0x80000000
+#define DMA_SWAP_16_BIT 0x03000000
+#define DMA_SWAP_8_BIT 0x02000000
+#define DMA_SWAP_NONE 0x01000000
+#define DMA_SUBWORD_SWAP_MASK 0x03000000
+#define TRIG_CNT_CLK_SEL_PCM 0x00800000
+#define TRIG_CNT_IRQ_EN 0x00400000
+#define RX_CNT_TRIG_EN 0x00200000
+#define TX_CNT_TRIG_EN 0x00100000
+#define RX_INT_TRIG_EN 0x00080000
+#define TX_INT_TRIG_EN 0x00040000
+#define RX_REG_TRIG_EN 0x00020000
+#define TX_REG_TRIG_EN 0x00010000
+#define RX_TRIG_FIRST 0x00008000
+#define MAX_BURST_CYCLE_MASK 0x00001F00
+#define MAX_BURST_CYCLE_SHIFT 8
+#define RX_EN_3 0x00000080
+#define RX_EN_2 0x00000040
+#define RX_EN_1 0x00000020
+#define RX_EN_0 0x00000010
+#define TX_EN_3 0x00000008
+#define TX_EN_2 0x00000004
+#define TX_EN_1 0x00000002
+#define TX_EN_0 0x00000001
+
+ uint32 dect_shm_dma_trig_cnt_preset; /* 0xb000b054 DECT DMA trigger counter preset value */
+ uint32 dect_shm_dma_ddr_saddr_tx_s0; /* 0xb000b058 DECT DMA DDR buffer starting address for TX slot 0 */
+ uint32 dect_shm_dma_ddr_saddr_tx_s1; /* 0xb000b05c DECT DMA DDR buffer starting address for TX slot 1 */
+ uint32 dect_shm_dma_ddr_saddr_tx_s2; /* 0xb000b060 DECT DMA DDR buffer starting address for TX slot 2 */
+ uint32 dect_shm_dma_ddr_saddr_tx_s3; /* 0xb000b064 DECT DMA DDR buffer starting address for TX slot 3 */
+ uint32 dect_shm_dma_ddr_saddr_rx_s0; /* 0xb000b068 DECT DMA DDR buffer starting address for RX slot 0 */
+ uint32 dect_shm_dma_ddr_saddr_rx_s1; /* 0xb000b06c DECT DMA DDR buffer starting address for RX slot 1 */
+ uint32 dect_shm_dma_ddr_saddr_rx_s2; /* 0xb000b070 DECT DMA DDR buffer starting address for RX slot 2 */
+ uint32 dect_shm_dma_ddr_saddr_rx_s3; /* 0xb000b074 DECT DMA DDR buffer starting address for RX slot 3 */
+ uint32 dect_shm_dma_ahb_saddr_tx_s01; /* 0xb000b078 DECT DMA AHB shared memory buffer starting address for TX slots 0 and 1 */
+ uint32 dect_shm_dma_ahb_saddr_tx_s23; /* 0xb000b07c DECT DMA AHB shared memory buffer starting address for TX slots 2 and 3 */
+ uint32 dect_shm_dma_ahb_saddr_rx_s01; /* 0xb000b080 DECT DMA AHB shared memory buffer starting address for RX slots 0 and 1 */
+ uint32 dect_shm_dma_ahb_saddr_rx_s23; /* 0xb000b084 DECT DMA AHB shared memory buffer starting address for RX slots 2 and 3 */
+ uint32 dect_shm_dma_xfer_size_tx; /* 0xb000b088 DECT DMA TX slots transfer size of each trigger */
+ uint32 dect_shm_dma_xfer_size_rx; /* 0xb000b08c DECT DMA RX slots transfer size of each trigger */
+ uint32 dect_shm_dma_buf_size_tx; /* 0xb000b090 DECT DMA TX slots memory buffer size */
+ uint32 dect_shm_dma_buf_size_rx; /* 0xb000b094 DECT DMA RX slots memory buffer size */
+ uint32 dect_shm_dma_offset_addr_tx_s01; /* 0xb000b098 DECT DMA access offset address for TX slots 0 and 1 */
+ uint32 dect_shm_dma_offset_addr_tx_s23; /* 0xb000b09c DECT DMA access offset address for TX slots 2 and 3 */
+ uint32 dect_shm_dma_offset_addr_rx_s01; /* 0xb000b0a0 DECT DMA access offset address for RX slots 0 and 1 */
+ uint32 dect_shm_dma_offset_addr_rx_s23; /* 0xb000b0a4 DECT DMA access offset address for RX slots 2 and 3 */
+ uint32 dect_shm_dma_xfer_cntr_tx; /* 0xb000b0a8 DECT DMA transfer count per slot in number of DMA transfer size */
+ uint32 dect_shm_dma_xfer_cntr_rx; /* 0xb000b0a8 DECT DMA transfer count per slot in number of DMA transfer size */
+} DECTShimDmaControl;
+
+#define DECT_DMA_CTRL ((volatile DECTShimDmaControl * const) DECT_SHIM_DMA_CTRL_BASE)
+
+
+typedef struct ahbRegisters
+{
+ uint16 dsp_main_sync0; /* 0xb0e57f80 DSP main counter outputs sel reg 0 */
+ uint16 dsp_main_sync1; /* 0xb0e57f82 DSP main counter outputs sel reg 1 */
+ uint16 dsp_main_cnt; /* 0xb0e57f84 DSP main counter reg */
+ uint16 reserved1; /* 0xb0e57f86 Reserved */
+ uint16 reserved2; /* 0xb0e57f88 Reserved */
+ uint16 reserved3; /* 0xb0e57f8a Reserved */
+ uint16 reserved4; /* 0xb0e57f8c Reserved */
+ uint16 reserved5; /* 0xb0e57f8e Reserved */
+ uint16 reserved6; /* 0xb0e57f90 Reserved */
+ uint16 dsp_ram_out0; /* 0xb0e57f92 DSP RAM output register 0 */
+ uint16 dsp_ram_out1; /* 0xb0e57f94 DSP RAM output register 1 */
+ uint16 dsp_ram_out2; /* 0xb0e57f96 DSP RAM output register 2 */
+ uint16 dsp_ram_out3; /* 0xb0e57f98 DSP RAM output register 3 */
+ uint16 dsp_ram_in0; /* 0xb0e57f9a DSP RAM input register 0 */
+ uint16 dsp_ram_in1; /* 0xb0e57f9c DSP RAM input register 1 */
+ uint16 dsp_ram_in2; /* 0xb0e57f9e DSP RAM input register 2 */
+ uint16 dsp_ram_in3; /* 0xb0e57fa0 DSP RAM input register 3 */
+ uint16 dsp_zcross1_out; /* 0xb0e57fa2 DSP RAM zero crossing 1 output reg */
+ uint16 dsp_zcross2_out; /* 0xb0e57fa4 DSP RAM zero crossing 2 output reg */
+ uint16 reserved7; /* 0xb0e57fa6 Reserved */
+ uint16 reserved8; /* 0xb0e57fa8 Reserved */
+ uint16 reserved9; /* 0xb0e57faa Reserved */
+ uint16 reserved10; /* 0xb0e57fac Reserved */
+ uint16 reserved11; /* 0xb0e57fae Reserved */
+ uint16 reserved12; /* 0xb0e57fb0 Reserved */
+ uint16 reserved13; /* 0xb0e57fb2 Reserved */
+ uint16 reserved14; /* 0xb0e57fb4 Reserved */
+ uint16 reserved15; /* 0xb0e57fb6 Reserved */
+ uint16 reserved16; /* 0xb0e57fb8 Reserved */
+ uint16 reserved17; /* 0xb0e57fba Reserved */
+ uint16 dsp_main_ctrl; /* 0xb0e57fbc DSP main counter control and preset reg */
+ uint16 reserved18; /* 0xb0e57fbe Reserved */
+ uint16 reserved19; /* 0xb0e57fc0 Reserved */
+ uint16 reserved20; /* 0xb0e57fc2 Reserved */
+ uint16 reserved21; /* 0xb0e57fc4 Reserved */
+ uint16 reserved22; /* 0xb0e57fc6 Reserved */
+ uint16 reserved23; /* 0xb0e57fc8 Reserved */
+ uint16 reserved24; /* 0xb0e57fca Reserved */
+ uint16 reserved25; /* 0xb0e57fce Reserved */
+ uint16 dsp_ctrl; /* 0xb0e57fd0 DSP control reg */
+ uint16 dsp_pc; /* 0xb0e57fd2 DSP program counter */
+ uint16 dsp_pc_start; /* 0xb0e57fd4 DSP program counter start */
+ uint16 dsp_irq_start; /* 0xb0e57fd6 DSP interrupt vector start */
+ uint16 dsp_int; /* 0xb0e57fd8 DSP to system bus interrupt vector */
+ uint16 dsp_int_mask; /* 0xb0e57fda DSP to system bus interrupt vector mask */
+ uint16 dsp_int_prio1; /* 0xb0e57fdc DSP interrupt mux 1 */
+ uint16 dsp_int_prio2; /* 0xb0e57fde DSP interrupt mux 2 */
+ uint16 dsp_overflow; /* 0xb0e57fe0 DSP to system bus interrupt overflow reg */
+ uint16 dsp_jtbl_start; /* 0xb0e57fe2 DSP jump table start address */
+ uint16 reserved26; /* 0xb0e57fe4 Reserved */
+ uint16 reserved27; /* 0xb0e57fe6 Reserved */
+ uint16 reserved28; /* 0xb0e57fe8 Reserved */
+ uint16 reserved29; /* 0xb0e57fea Reserved */
+ uint16 reserved30; /* 0xb0e57fec Reserved */
+ uint16 reserved31; /* 0xb0e57fee Reserved */
+ uint16 dsp_debug_inst; /* 0xb0e57ff0 DSP debug instruction register */
+ uint16 reserved32; /* 0xb0e57ff2 Reserved */
+ uint16 dsp_debug_inout_l; /* 0xb0e57ff4 DSP debug data (LSW) */
+ uint16 dsp_debug_inout_h; /* 0xb0e57ff6 DSP debug data (MSW) */
+ uint16 reserved33; /* 0xb0e57ff8 Reserved */
+ uint16 reserved34; /* 0xb0e57ffa Reserved */
+ uint16 reserved35; /* 0xb0e57ffc Reserved */
+ uint16 reserved36; /* 0xb0e57ffe Reserved */
+} ahbRegisters;
+
+#define AHB_REGISTERS ((volatile ahbRegisters * const) DECT_AHB_REG_BASE)
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/shared/broadcom/include/bcm963xx/6368_common.h b/shared/broadcom/include/bcm963xx/6368_common.h
new file mode 100755
index 0000000..1df5be5
--- /dev/null
+++ b/shared/broadcom/include/bcm963xx/6368_common.h
@@ -0,0 +1,270 @@
+/*
+<:copyright-broadcom
+
+ Copyright (c) 2007 Broadcom Corporation
+ All Rights Reserved
+ No portions of this material may be reproduced in any form without the
+ written permission of:
+ Broadcom Corporation
+ 16215 Alton Parkway
+ Irvine, California 92619
+ All information contained in this document is Broadcom Corporation
+ company private, proprietary, and trade secret.
+
+:>
+*/
+/***********************************************************************/
+/* */
+/* MODULE: 6368_common.h */
+/* DATE: 02/06/07 */
+/* PURPOSE: Define addresses of major hardware components of */
+/* BCM6368 */
+/* */
+/***********************************************************************/
+#ifndef __BCM6368_MAP_COMMON_H
+#define __BCM6368_MAP_COMMON_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define PERF_BASE 0xb0000000 /* chip control registers */
+#define TIMR_BASE 0xb0000040 /* timer registers */
+#define NAND_INTR_BASE 0xb0000070 /* nand interrupt control registers */
+#define GPIO_BASE 0xb0000080 /* gpio registers */
+#define UART_BASE 0xb0000100 /* uart registers */
+#define UART1_BASE 0xb0000120 /* uart registers */
+#define NAND_REG_BASE 0xb0000200
+#define NAND_SEC_BASE 0xb0000300
+#define OTP_BASE 0xb0000400
+#define UBUS_STAT_BASE 0xb0000500
+#define NAND_CACHE_BASE 0xb0000600
+#define SPI_BASE 0xb0000800 /* SPI master controller registers */
+#define MPI_BASE 0xb0001000 /* MPI control registers */
+#define MEMC_BASE 0xb0001200 /* Memory control registers */
+#define DDR_BASE 0xb0001280 /* DDR IO Buf Control registers */
+#define USB_CTL_BASE 0xb0001400 /* USB 2.0 device control registers */
+#define USB_EHCI_BASE 0x10001500 /* USB host registers */
+#define USB_OHCI_BASE 0x10001600 /* USB host registers */
+#define USBH_CFG_BASE 0xb0001700
+#define SAR_BASE 0xb0001800 /* ATM SAR control registers */
+#define SAR_CMF_BASE 0xb0002000 /* ATM SAR CMF control registers */
+#define PCM_BASE 0xb0004000 /* PCM control registers */
+#define IPSEC_BASE 0xb0004100
+#define USB_DMA_BASE 0xb0004800 /* USB 2.0 device DMA regiseters */
+#define SAR_DMA_BASE 0xb0005000 /* ATM SAR DMA control registers */
+#define PCM_DMA_BASE 0xb0005800 /* PCM UIDMA register base */
+#define IPSEC_DMA_BASE 0xb0006000
+#define SWITCH_DMA_BASE 0xb0006800
+#define SWITCH_BASE 0xb0f00000
+#define SWITCH_CMF_BASE 0xb0f0a000 /* Switch CMF register base */
+
+#define ADSL_PHY_BASE 0xb0f40000
+#define ADSL_ENUM_BASE 0xb0f56000
+#define ADSL_LMEM_BASE 0xb0f80000
+
+/*
+#####################################################################
+# System PLL Control Register
+#####################################################################
+*/
+
+
+/*
+#####################################################################
+# GPIO Control Registers
+#####################################################################
+*/
+
+
+/*
+#####################################################################
+# Memory Control Registers
+#####################################################################
+*/
+#define MEMC_CONTROL 0x0
+#define MEMC_CONFIG 0x4
+#define MEMC_REF_PD_CONTROL 0x8
+#define MEMC_BIST_STATUS 0xc
+#define MEMC_M_EM_BUF 0x10
+#define MEMC_BANK_CLS_TIM 0x14
+#define MEMC_PRIOR_INV_TIM 0x18
+#define MEMC_DRAM_TIM 0x1c
+#define MEMC_INT_STATUS 0x20
+#define MEMC_INT_MASK 0x24
+#define MEMC_INT_INFO 0x28
+#define MEMC_BARRIER 0x50
+#define MEMC_CORE_ID 0x54
+
+#define DDR_REV_ID 0x0
+#define DDR_PAD_SSTL_MODE 0x4
+#define DDR_CMD_PAD_CNTL 0x8
+#define DDR_DQ_PAD_CNTL 0xc
+#define DDR_DQS_PAD_CNTL 0x10
+#define DDR_CLK_PAD_CNTL 0x14
+#define DDR_PLL_CNTL0 0x18
+#define DDR_PLL_CNTL1 0x1c
+#define DDR_MIPSDDR_PLL_CONFIG 0x20
+#define DDR_MIPSDDR_PLL_MDIV 0x24
+#define DDR_DSL_PHY_PHASE_CNTL 0x28
+#define DDR_DSL_CPU_PHASE_CNTL 0x2c
+#define DDR_MIPS_PHASE_CNTL 0x30
+#define DDR_DDR1_2_PHASE_CNTL 0x34
+#define DDR_DDR3_4_PHASE_CNTL 0x38
+#define DDR_VCDL_PHASE_CNTL0 0x3c
+#define DDR_VCDL_PHASE_CNTL1 0x40
+#define DDR_BSLICE_CNTL 0x44
+#define DDR_DESKEW_DLL_CNTL 0x48
+#define DDR_DESKEW_DLL_RESET 0x4c
+#define DDR_DESKEW_DLL_PHASE 0x50
+#define DDR_ANALOG_TEST_CNTL 0x54
+#define DDR_RD_DQS_GATE_CNTL 0x58
+#define DDR_MISC 0x5c
+#define DDR_SPARE0 0x60
+#define DDR_SPARE1 0x64
+#define DDR_SPARE2 0x68
+#define DDR_CLBIST 0x6c
+#define DDR_LBIST_CRC 0x70
+#define DDR_UBUS_PHASE_CNTR 0x74
+#define DDR_UBUS_PI_DSK0 0x78
+#define DDR_UBUS_PI_DSK1 0x7c
+
+// Some bit/field definitions for the MEMC_CONFIG register.
+#define MEMC_EARLY_HDR_CNT_SHFT 25
+#define MEMC_EARLY_HDR_CNT_MASK (0x7<<MEMC_EARLYHDRCNT_SHFT)
+#define MEMC_USE_HDR_CNT (1<<24)
+#define MEMC_EN_FAST_REPLY (1<<23)
+#define MEMC_RR_ARB (1<<22)
+#define MEMC_SFX_NO_MRS2 (1<<21)
+#define MEMC_SFX_NO_DLL_RST (1<<20)
+#define MEMC_LLMB_ONE_REQ (1<<19)
+#define MEMC_SYS_PORT_CMD_MODE (1<<18)
+#define MEMC_PAD_OP_MODE (1<<17)
+#define MEMC_DQS_GATE_EN (1<<16)
+#define MEMC_PRED_RD_STROBE_EN (1<<15)
+#define MEMC_PRED_RD_LATENCY_SEL (1<<14)
+#define MEMC_UBUS_CLF_EN (1<<8)
+
+#define MEMC_ROW_SHFT 6
+#define MEMC_ROW_MASK (0x3<<MEMC_ROW_SHFT)
+#define MEMC_11BIT_ROW 0
+#define MEMC_12BIT_ROW 1
+#define MEMC_13BIT_ROW 2
+#define MEMC_14BIT_ROW 3
+
+#define MEMC_COL_SHFT 3
+#define MEMC_COL_MASK (0x7<<MEMC_COL_SHFT)
+#define MEMC_8BIT_COL 0
+#define MEMC_9BIT_COL 1
+#define MEMC_10BIT_COL 2
+#define MEMC_11BIT_COL 3
+
+#define MEMC_SEL_PRIORITY (1<<2)
+
+#define MEMC_WIDTH_SHFT 1
+#define MEMC_WIDTH_MASK (0x1<<MEMC_WIDTH_SHFT)
+#define MEMC_32BIT_BUS 0
+#define MEMC_16BIT_BUS 1
+
+#define MEMC_MEMTYPE_SDR (0<<0)
+#define MEMC_MEMTYPE_DDR (1<<0)
+
+/*
+#####################################################################
+# MPI Control Registers
+#####################################################################
+*/
+#define CS0BASE 0x00
+#define CS0CNTL 0x04
+
+/*
+# CSxBASE settings
+# Size in low 4 bits
+# Base Address for match in upper 24 bits
+*/
+#define EBI_SIZE_8K 0
+#define EBI_SIZE_16K 1
+#define EBI_SIZE_32K 2
+#define EBI_SIZE_64K 3
+#define EBI_SIZE_128K 4
+#define EBI_SIZE_256K 5
+#define EBI_SIZE_512K 6
+#define EBI_SIZE_1M 7
+#define EBI_SIZE_2M 8
+#define EBI_SIZE_4M 9
+#define EBI_SIZE_8M 10
+#define EBI_SIZE_16M 11
+#define EBI_SIZE_32M 12
+#define EBI_SIZE_64M 13
+#define EBI_SIZE_128M 14
+#define EBI_SIZE_256M 15
+
+/* CSxCNTL settings */
+#define EBI_ENABLE 0x00000001 /* .. enable this range */
+#define EBI_WAIT_STATES 0x0000000e /* .. mask for wait states */
+#define ZEROWT 0x00000000 /* .. 0 WS */
+#define ONEWT 0x00000002 /* .. 1 WS */
+#define TWOWT 0x00000004 /* .. 2 WS */
+#define THREEWT 0x00000006 /* .. 3 WS */
+#define FOURWT 0x00000008 /* .. 4 WS */
+#define FIVEWT 0x0000000a /* .. 5 WS */
+#define SIXWT 0x0000000c /* .. 6 WS */
+#define SEVENWT 0x0000000e /* .. 7 WS */
+#define EBI_WORD_WIDE 0x00000010 /* .. 16-bit peripheral, else 8 */
+#define EBI_TS_TA_MODE 0x00000080 /* .. use TS/TA mode */
+#define EBI_TS_SEL 0x00000100 /* .. drive tsize, not bs_b */
+#define EBI_FIFO 0x00000200 /* .. enable fifo */
+#define EBI_RE 0x00000400 /* .. Reverse Endian */
+
+/*
+#####################################################################
+# UART Control Registers
+#####################################################################
+*/
+#define UART0CONTROL 0x01
+#define UART0CONFIG 0x02
+#define UART0RXTIMEOUT 0x03
+#define UART0BAUD 0x04
+#define UART0FIFOCFG 0x0a
+#define UART0INTMASK 0x10
+#define UART0INTSTAT 0x12
+#define UART0DATA 0x17
+
+#define BRGEN 0x80 /* Control register bit defs */
+#define TXEN 0x40
+#define RXEN 0x20
+#define LOOPBK 0x10
+#define TXPARITYEN 0x08
+#define TXPARITYEVEN 0x04
+#define RXPARITYEN 0x02
+#define RXPARITYEVEN 0x01
+
+#define XMITBREAK 0x40 /* Config register */
+#define BITS5SYM 0x00
+#define BITS6SYM 0x10
+#define BITS7SYM 0x20
+#define BITS8SYM 0x30
+#define ONESTOP 0x07
+#define TWOSTOP 0x0f
+
+#define DELTAIP 0x0001
+#define TXUNDERR 0x0002
+#define TXOVFERR 0x0004
+#define TXFIFOTHOLD 0x0008
+#define TXREADLATCH 0x0010
+#define TXFIFOEMT 0x0020
+#define RXUNDERR 0x0040
+#define RXOVFERR 0x0080
+#define RXTIMEOUT 0x0100
+#define RXFIFOFULL 0x0200
+#define RXFIFOTHOLD 0x0400
+#define RXFIFONE 0x0800
+#define RXFRAMERR 0x1000
+#define RXPARERR 0x2000
+#define RXBRK 0x4000
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/shared/broadcom/include/bcm963xx/6368_map.h b/shared/broadcom/include/bcm963xx/6368_map.h
new file mode 100755
index 0000000..590e06d
--- /dev/null
+++ b/shared/broadcom/include/bcm963xx/6368_map.h
@@ -0,0 +1,1592 @@
+/*
+<:copyright-broadcom
+
+ Copyright (c) 2007 Broadcom Corporation
+ All Rights Reserved
+ No portions of this material may be reproduced in any form without the
+ written permission of:
+ Broadcom Corporation
+ 16215 Alton Parkway
+ Irvine, California 92619
+ All information contained in this document is Broadcom Corporation
+ company private, proprietary, and trade secret.
+
+:>
+*/
+/***********************************************************************/
+/* */
+/* MODULE: 6368_map.h */
+/* DATE: 02/06/07 */
+/* PURPOSE: Define addresses of major hardware components of */
+/* BCM6368 */
+/* */
+/***********************************************************************/
+#ifndef __BCM6368_MAP_H
+#define __BCM6368_MAP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "bcmtypes.h"
+#include "6368_common.h"
+#include "6368_intr.h"
+
+/* macro to convert logical data addresses to physical */
+/* DMA hardware must see physical address */
+#define LtoP( x ) ( (uint32)x & 0x1fffffff )
+#define PtoL( x ) ( LtoP(x) | 0xa0000000 )
+
+typedef struct MemoryControl
+{
+ uint32 Control; /* (00) */
+#define MEMC_SELF_REFRESH (1<<6) // enable self refresh mode
+#define MEMC_MRS (1<<4) // generate a mode register select cycle
+#define MEMC_PRECHARGE (1<<3) // generate a precharge cycle
+#define MEMC_REFRESH (1<<2) // generate an auto refresh cycle
+#define MEMC_SEQUENCE_ENABLE (1<<1) // enable memory controller sequencer
+#define MEMC_MASTER_ENABLE (1<<0) // enable accesses to external sdram
+
+ uint32 Config; /* (04) */
+#define MEMC_EARLY_HDR_CNT_SHFT 25
+#define MEMC_EARLY_HDR_CNT_MASK (0x7<<MEMC_EARLYHDRCNT_SHFT)
+#define MEMC_USE_HDR_CNT (1<<24)
+#define MEMC_EN_FAST_REPLY (1<<23)
+#define MEMC_RR_ARB (1<<22)
+#define MEMC_SFX_NO_MRS2 (1<<21)
+#define MEMC_SFX_NO_DLL_RST (1<<20)
+#define MEMC_LLMB_ONE_REQ (1<<19)
+#define MEMC_SYS_PORT_CMD_MODE (1<<18)
+#define MEMC_PAD_OP_MODE (1<<17)
+#define MEMC_DQS_GATE_EN (1<<16)
+#define MEMC_PRED_RD_STROBE_EN (1<<15)
+#define MEMC_PRED_RD_LATENCY_SEL (1<<14)
+#define MEMC_UBUS_CLF_EN (1<<8)
+
+#define MEMC_ROW_SHFT 6
+#define MEMC_ROW_MASK (0x3<<MEMC_ROW_SHFT)
+#define MEMC_11BIT_ROW 0
+#define MEMC_12BIT_ROW 1
+#define MEMC_13BIT_ROW 2
+#define MEMC_14BIT_ROW 3
+
+#define MEMC_COL_SHFT 3
+#define MEMC_COL_MASK (0x7<<MEMC_COL_SHFT)
+#define MEMC_8BIT_COL 0
+#define MEMC_9BIT_COL 1
+#define MEMC_10BIT_COL 2
+#define MEMC_11BIT_COL 3
+
+#define MEMC_SEL_PRIORITY (1<<2)
+
+#define MEMC_WIDTH_SHFT 1
+#define MEMC_WIDTH_MASK (0x1<<MEMC_WIDTH_SHFT)
+#define MEMC_32BIT_BUS 0
+#define MEMC_16BIT_BUS 1
+
+#define MEMC_MEMTYPE_SDR (0<<0)
+#define MEMC_MEMTYPE_DDR (1<<0)
+
+ uint32 RefreshPdControl; /* (08) */
+#define MEMC_REFRESH_ENABLE (1<<15)
+
+ uint32 BistStatus; /* (0C) */
+ uint32 ExtendedModeBuffer; /* (10) */
+ uint32 BankClosingTimer; /* (14) */
+ uint32 PriorityInversionTimer; /* (18) */
+
+ uint32 DramTiming; /* (1c) */
+#define MEMC_WR_NOP_RD (1<<23)
+#define MEMC_WR_NOP_WR (1<<22)
+#define MEMC_RD_NOP_WR (1<<21)
+#define MEMC_RD_NOP_RD (1<<20)
+#define MEMC_CAS_LATENCY_2 (0)
+#define MEMC_CAS_LATENCY_2_5 (1)
+#define MEMC_CAS_LATENCY_3 (2)
+
+ uint32 IntStatus; /* (20) */
+ uint32 IntMask; /* (24) */
+#define MEMC_INT3 (1<<3)
+#define MEMC_INT2 (2<<3)
+#define MEMC_INT1 (1<<3)
+#define MEMC_INT0 (0<<3)
+
+ uint32 IntInfo; /* (28) */
+ uint8 unused5[0x50-0x2c]; /* (2c) */
+ uint32 Barrier; /* (50) */
+ uint32 CoreId; /* (54) */
+} MemoryControl;
+
+#define MEMC ((volatile MemoryControl * const) MEMC_BASE)
+
+typedef struct DDRControl {
+ uint32 RevID; /* 00 */
+ uint32 PadSSTLMode; /* 04 */
+ uint32 CmdPadCntl; /* 08 */
+ uint32 DQPadCntl; /* 0c */
+ uint32 DQSPadCntl; /* 10 */
+ uint32 ClkPadCntl0; /* 14 */
+ uint32 MIPSDDRPLLCntl0; /* 18 */
+ uint32 MIPSDDRPLLCntl1; /* 1c */
+ uint32 MIPSDDRPLLConfig; /* 20 */
+#define MIPSDDR_NDIV_SHFT 16
+#define MIPSDDR_NDIV_MASK (0x1ff<<MIPSDDR_NDIV_SHFT)
+#define REF_MDIV_SHFT 8
+#define REF_MDIV_MASK (0xff<<REF_MDIV_SHFT)
+#define MIPSDDR_P2_SHFT 4
+#define MIPSDDR_P2_MASK (0xf<<MIPSDDR_P2_SHFT)
+#define MIPSDDR_P1_SHFT 0
+#define MIPSDDR_P1_MASK (0xf<<MIPSDDR_P1_SHFT)
+ uint32 MIPSDDRPLLMDiv; /* 24 */
+#define DDR_MDIV_SHFT 8
+#define DDR_MDIV_MASK (0xff<<DDR_MDIV_SHFT)
+#define MIPS_MDIV_SHFT 0
+#define MIPS_MDIV_MASK (0xff<<MIPS_MDIV_SHFT)
+ uint32 DSLCorePhaseCntl; /* 28 */
+ uint32 DSLCpuPhaseCntr; /* 2c */
+#define DSL_PHY_AFE_PI_CNTR_CYCLES_SHIFT 28
+#define DSL_PHY_AFE_PI_CNTR_CYCLES_MASK (0xF << DSL_PHY_AFE_PI_CNTR_CYCLES_SHIFT)
+#define DSL_PHY_PI_CNTR_CYCLES_SHIFT 24
+#define DSL_PHY_PI_CNTR_CYCLES_MASK (0xF << DSL_PHY_PI_CNTR_CYCLES_SHIFT)
+#define DSL_PHY_AFE_PI_CNTR_EN (1 << 22)
+#define DSL_PHY_PI_CNTR_EN (1 << 21)
+#define DSL_CPU_PI_CNTR_EN (1 << 20)
+#define DSL_CPU_PI_CNTR_CYCLES_SHIFT 16
+#define DSL_CPU_PI_CNTR_CYCLES_MASK (0xF << DSL_CPU_PI_CNTR_CYCLES_SHIFT)
+ uint32 MIPSPhaseCntl; /* 30 */
+#define PH_CNTR_EN (1 << 20)
+ uint32 DDR1_2PhaseCntl0; /* 34 */
+ uint32 DDR3_4PhaseCntl0; /* 38 */
+ uint32 VCDLPhaseCntl0; /* 3c */
+ uint32 VCDLPhaseCntl1; /* 40 */
+ uint32 WSliceCntl; /* 44 */
+ uint32 DeskewDLLCntl; /* 48 */
+ uint32 DeskewDLLReset; /* 4c */
+ uint32 DeskewDLLPhase; /* 50 */
+ uint32 AnalogTestCntl; /* 54 */
+ uint32 RdDQSGateCntl; /* 58 */
+ uint32 PLLTestReg; /* 5c */
+ uint32 Spare0; /* 60 */
+ uint32 Spare1; /* 64 */
+ uint32 Spare2; /* 68 */
+ uint32 CLBist; /* 6c */
+ uint32 LBistCRC; /* 70 */
+ uint32 UBUSPhaseCntl; /* 74 */
+ uint32 UBUSPIDeskewLLMB0; /* 78 */
+ uint32 UBUSPIDeskewLLMB1; /* 7C */
+
+} DDRControl;
+
+#define DDR ((volatile DDRControl * const) DDR_BASE)
+
+/*
+** Peripheral Controller
+*/
+
+#define IRQ_BITS 64
+typedef struct {
+ uint64 IrqMask;
+ uint64 IrqStatus;
+} IrqControl_t;
+
+typedef struct PerfControl {
+ uint32 RevID; /* (00) word 0 */
+ uint32 blkEnables; /* (04) word 1 */
+#define USBH_IDDQ_EN (1 << 19)
+#define IPSEC_CLK_EN (1 << 18)
+#define NAND_CLK_EN (1 << 17)
+#define DISABLE_GLESS (1 << 16)
+#define USBH_CLK_EN (1 << 15)
+#define PCM_CLK_EN (1 << 14)
+#define UTOPIA_CLK_EN (1 << 13)
+#define ROBOSW_CLK_EN (1 << 12)
+#define SAR_CLK_EN (1 << 11)
+#define USBD_CLK_EN (1 << 10)
+#define SPI_CLK_EN (1 << 9)
+#define SWPKT_SAR_CLK_EN (1 << 8)
+#define SWPKT_USB_CLK_EN (1 << 7)
+#define PHYMIPS_CLK_EN (1 << 6)
+#define VDSL_CLK_EN (1 << 5)
+#define VDSL_BONDING_EN (1 << 4)
+#define VDSL_AFE_EN (1 << 3)
+#define VDSL_QPROC_EN (1 << 2)
+
+ uint32 pll_control; /* (08) word 2 */
+#define SOFT_RESET 0x00000001 // 0
+
+ uint32 deviceTimeoutEn; /* (0c) word 3 */
+ uint32 softResetB; /* (10) word 4 */
+#define SOFT_RST_PCM (1 << 13)
+#define SOFT_RST_USBH (1 << 12)
+#define SOFT_RST_USBD (1 << 11)
+#define SOFT_RST_SWITCH (1 << 10)
+#define SOFT_RST_SAR (1 << 7)
+#define SOFT_RST_EPHY (1 << 6)
+#define SOFT_RST_IPSEC (1 << 4)
+#define SOFT_RST_MPI (1 << 3)
+#define SOFT_RST_SPI (1 << 0)
+
+ uint32 unused1; /* (14) word 5 */
+ uint32 ExtIrqCfg; /* (18) word 6*/
+ uint32 ExtIrqCfg1; /* (1c) word 7 */
+#define EI_SENSE_SHFT 0
+#define EI_STATUS_SHFT 4
+#define EI_CLEAR_SHFT 8
+#define EI_MASK_SHFT 12
+#define EI_INSENS_SHFT 16
+#define EI_LEVEL_SHFT 20
+
+ IrqControl_t IrqControl[2];
+} PerfControl;
+
+#define PERF ((volatile PerfControl * const) PERF_BASE)
+
+/*
+** Timer
+*/
+typedef struct Timer {
+ uint16 unused0;
+ byte TimerMask;
+#define TIMER0EN 0x01
+#define TIMER1EN 0x02
+#define TIMER2EN 0x04
+ byte TimerInts;
+#define TIMER0 0x01
+#define TIMER1 0x02
+#define TIMER2 0x04
+#define WATCHDOG 0x08
+ uint32 TimerCtl0;
+ uint32 TimerCtl1;
+ uint32 TimerCtl2;
+#define TIMERENABLE 0x80000000
+#define RSTCNTCLR 0x40000000
+ uint32 TimerCnt0;
+ uint32 TimerCnt1;
+ uint32 TimerCnt2;
+ uint32 WatchDogDefCount;
+
+ /* Write 0xff00 0x00ff to Start timer
+ * Write 0xee00 0x00ee to Stop and re-load default count
+ * Read from this register returns current watch dog count
+ */
+ uint32 WatchDogCtl;
+
+ /* Number of 50-MHz ticks for WD Reset pulse to last */
+ uint32 WDResetCount;
+} Timer;
+
+#define TIMER ((volatile Timer * const) TIMR_BASE)
+
+/*
+** UART
+*/
+typedef struct UartChannel {
+ byte unused0;
+ byte control;
+#define BRGEN 0x80 /* Control register bit defs */
+#define TXEN 0x40
+#define RXEN 0x20
+#define LOOPBK 0x10
+#define TXPARITYEN 0x08
+#define TXPARITYEVEN 0x04
+#define RXPARITYEN 0x02
+#define RXPARITYEVEN 0x01
+
+ byte config;
+#define XMITBREAK 0x40
+#define BITS5SYM 0x00
+#define BITS6SYM 0x10
+#define BITS7SYM 0x20
+#define BITS8SYM 0x30
+#define ONESTOP 0x07
+#define TWOSTOP 0x0f
+ /* 4-LSBS represent STOP bits/char
+ * in 1/8 bit-time intervals. Zero
+ * represents 1/8 stop bit interval.
+ * Fifteen represents 2 stop bits.
+ */
+ byte fifoctl;
+#define RSTTXFIFOS 0x80
+#define RSTRXFIFOS 0x40
+ /* 5-bit TimeoutCnt is in low bits of this register.
+ * This count represents the number of characters
+ * idle times before setting receive Irq when below threshold
+ */
+ uint32 baudword;
+ /* When divide SysClk/2/(1+baudword) we should get 32*bit-rate
+ */
+
+ byte txf_levl; /* Read-only fifo depth */
+ byte rxf_levl; /* Read-only fifo depth */
+ byte fifocfg; /* Upper 4-bits are TxThresh, Lower are
+ * RxThreshold. Irq can be asserted
+ * when rx fifo> thresh, txfifo<thresh
+ */
+ byte prog_out; /* Set value of DTR (Bit0), RTS (Bit1)
+ * if these bits are also enabled to GPIO_o
+ */
+#define DTREN 0x01
+#define RTSEN 0x02
+
+ byte unused1;
+ byte DeltaIPEdgeNoSense; /* Low 4-bits, set corr bit to 1 to
+ * detect irq on rising AND falling
+ * edges for corresponding GPIO_i
+ * if enabled (edge insensitive)
+ */
+ byte DeltaIPConfig_Mask; /* Upper 4 bits: 1 for posedge sense
+ * 0 for negedge sense if
+ * not configured for edge
+ * insensitive (see above)
+ * Lower 4 bits: Mask to enable change
+ * detection IRQ for corresponding
+ * GPIO_i
+ */
+ byte DeltaIP_SyncIP; /* Upper 4 bits show which bits
+ * have changed (may set IRQ).
+ * read automatically clears bit
+ * Lower 4 bits are actual status
+ */
+
+ uint16 intMask; /* Same Bit defs for Mask and status */
+ uint16 intStatus;
+#define DELTAIP 0x0001
+#define TXUNDERR 0x0002
+#define TXOVFERR 0x0004
+#define TXFIFOTHOLD 0x0008
+#define TXREADLATCH 0x0010
+#define TXFIFOEMT 0x0020
+#define RXUNDERR 0x0040
+#define RXOVFERR 0x0080
+#define RXTIMEOUT 0x0100
+#define RXFIFOFULL 0x0200
+#define RXFIFOTHOLD 0x0400
+#define RXFIFONE 0x0800
+#define RXFRAMERR 0x1000
+#define RXPARERR 0x2000
+#define RXBRK 0x4000
+
+ uint16 unused2;
+ uint16 Data; /* Write to TX, Read from RX */
+ /* bits 11:8 are BRK,PAR,FRM errors */
+
+ uint32 unused3;
+ uint32 unused4;
+} Uart;
+
+#define UART ((volatile Uart * const) UART_BASE)
+
+/*
+** Gpio Controller
+*/
+
+typedef struct GpioControl {
+ uint64 GPIODir; /* 0 */
+ uint64 GPIOio; /* 8 */
+ uint32 LEDCtrl;
+#define LED_ALL_STROBE 0x0f000000
+#define LED3_STROBE 0x08000000
+#define LED2_STROBE 0x04000000
+#define LED1_STROBE 0x02000000
+#define LED0_STROBE 0x01000000
+#define LED_TEST 0x00010000
+#define DISABLE_LINK_ACT_ALL 0x0000f000
+#define DISABLE_LINK_ACT_3 0x00008000
+#define DISABLE_LINK_ACT_2 0x00004000
+#define DISABLE_LINK_ACT_1 0x00002000
+#define DISABLE_LINK_ACT_0 0x00001000
+#define LED_INTERVAL_SET_MASK 0x00000f00
+#define LED_INTERVAL_SET_1280MS 0x00000700
+#define LED_INTERVAL_SET_640MS 0x00000600
+#define LED_INTERVAL_SET_320MS 0x00000500
+#define LED_INTERVAL_SET_160MS 0x00000400
+#define LED_INTERVAL_SET_80MS 0x00000300
+#define LED_INTERVAL_SET_40MS 0x00000200
+#define LED_INTERVAL_SET_20MS 0x00000100
+#define LED_ON_ALL 0x000000f0
+#define LED_ON_3 0x00000080
+#define LED_ON_2 0x00000040
+#define LED_ON_1 0x00000020
+#define LED_ON_0 0x00000010
+#define LED_ENABLE_ALL 0x0000000f
+#define LED_ENABLE_3 0x00000008
+#define LED_ENABLE_2 0x00000004
+#define LED_ENABLE_1 0x00000002
+#define LED_ENABLE_0 0x00000001
+ uint32 SpiSlaveCfg; /* 14 */
+ uint32 GPIOMode; /* 18 */
+#define GPIO_MODE_SPI_SSN5 (1<<31)
+#define GPIO_MODE_SPI_SSN4 (1<<30)
+#define GPIO_MODE_SPI_SSN3 (1<<29)
+#define GPIO_MODE_SPI_SSN2 (1<<28)
+#define GPIO_MODE_EBI_CS3 (1<<27)
+#define GPIO_MODE_EBI_CS2 (1<<26)
+#define GPIO_MODE_PCMCIA_VS2 (1<<25)
+#define GPIO_MODE_PCMCIA_VS1 (1<<24)
+#define GPIO_MODE_PCMCIA_CD2 (1<<23)
+#define GPIO_MODE_PCMCIA_CD1 (1<<22)
+#define GPIO_MODE_PCI_GNT0 (1<<20)
+#define GPIO_MODE_PCI_REQ0 (1<<19)
+#define GPIO_MODE_PCI_INTB (1<<18)
+#define GPIO_MODE_PCI_GNT1 (1<<17)
+#define GPIO_MODE_PCI_REQ1 (1<<16)
+#define GPIO_MODE_USBD_LED (1<<14)
+#define GPIO_MODE_ROBOSW_LED1 (1<<13)
+#define GPIO_MODE_ROBOSW_LED0 (1<<12)
+#define GPIO_MODE_ROBOSW_LED_CLK (1<<11)
+#define GPIO_MODE_ROBOSW_LED_DATA (1<<10)
+#define GPIO_MODE_EPHY3_LED (1<<9)
+#define GPIO_MODE_EPHY2_LED (1<<8)
+#define GPIO_MODE_EPHY1_LED (1<<7)
+#define GPIO_MODE_EPHY0_LED (1<<6)
+#define GPIO_MODE_INET_LED (1<<5)
+#define GPIO_MODE_SERIAL_LED_CLK (1<<4)
+#define GPIO_MODE_SERIAL_LED_DATA (1<<3)
+#define GPIO_MODE_SYS_IRQ (1<<2)
+#define GPIO_MODE_ANALOG_AFE_1 (1<<1)
+#define GPIO_MODE_ANALOG_AFE_0 (1<<0)
+
+ uint32 VregConfig; /* 1C */
+#define VREG_VSEL1P2_SHIFT 8
+#define VREG_VSEL1P2_MASK (0x0f<<8)
+#define VREG_VSEL1P2_MIDDLE 9
+
+ uint32 AuxLedInterval; /* 20 */
+#define AUX_LED_IN_7 0x80000000
+#define AUX_LED_IN_6 0x40000000
+#define AUX_LED_IN_5 0x20000000
+#define AUX_LED_IN_4 0x10000000
+#define AUX_LED_IN_MASK 0xf0000000
+#define LED_IN_3 0x08000000
+#define LED_IN_2 0x04000000
+#define LED_IN_1 0x02000000
+#define LED_IN_0 0x01000000
+#define AUX_LED_TEST 0x00400000
+#define USE_NEW_INTV 0x00200000
+#define LED7_LNK_ORAND 0x00100000
+#define LED7_LNK_MASK 0x000f0000
+#define LED7_LNK_MASK_SHFT 16
+#define LED7_ACT_MASK 0x0000f000
+#define LED7_ACT_MASK_SHFT 12
+#define AUX_FLASH_INTV 0x00000fc0
+#define AUX_FLASH_INTV_SHFT 6
+#define AUX_BLINK_INTV 0x0000003f
+ uint32 AuxLedCtrl; /* 24 */
+#define AUX_HW_DISAB_7 0x80000000
+#define AUX_STROBE_7 0x40000000
+#define AUX_MODE_7 0x30000000
+#define AUX_MODE_SHFT_7 28
+#define AUX_HW_DISAB_6 0x08000000
+#define AUX_STROBE_6 0x04000000
+#define AUX_MODE_6 0x03000000
+#define AUX_MODE_SHFT_6 24
+#define AUX_HW_DISAB_5 0x00800000
+#define AUX_STROBE_5 0x00400000
+#define AUX_MODE_5 0x00300000
+#define AUX_MODE_SHFT_5 20
+#define AUX_HW_DISAB_4 0x00080000
+#define AUX_STROBE_4 0x00040000
+#define AUX_MODE_4 0x00030000
+#define AUX_MODE_SHFT_4 16
+#define AUX_HW_DISAB_3 0x00008000
+#define AUX_STROBE_3 0x00004000
+#define AUX_MODE_3 0x00003000
+#define AUX_MODE_SHFT_3 12
+#define AUX_HW_DISAB_2 0x00000800
+#define AUX_STROBE_2 0x00000400
+#define AUX_MODE_2 0x00000300
+#define AUX_MODE_SHFT_2 8
+#define AUX_HW_DISAB_1 0x00000080
+#define AUX_STROBE_1 0x00000040
+#define AUX_MODE_1 0x00000030
+#define AUX_MODE_SHFT_1 4
+#define AUX_HW_DISAB_0 0x00000008
+#define AUX_STROBE_0 0x00000004
+#define AUX_MODE_0 0x00000003
+#define AUX_MODE_SHFT_0 0
+
+#define LED_STEADY_OFF 0x0
+#define LED_FLASH 0x1
+#define LED_BLINK 0x2
+#define LED_STEADY_ON 0x3
+
+ uint32 TestControl; /* 28 */
+
+ uint32 VDSLControl; /* 2C */
+#define VDSL_CORE_RESET (1<<2)
+#define VDSL_MIPS_RESET (1<<1)
+#define VDSL_MIPS_POR_RESET (1<<0)
+#define VDSL_CLK_RATIO_SHIFT 8
+#define VDSL_CLK_RATIO_MSK (0x1F << VDSL_CLK_RATIO_SHIFT)
+ uint32 RoboSWLEDControl; /* 30 */
+ uint32 RoboSWLEDLSR; /* 34 */
+ uint32 GPIOBaseMode; /* 38 */
+#define EN_PCI_CLK_66 (1<<20)
+#define EN_UTO_CLK_FAST (1<<19)
+#define EN_UTO (1<<18)
+#define EN_GMII2 (1<<17)
+#define EN_GMII1 (1<<16)
+ uint32 RoboswEphyCtrl; /* 3C */
+#define RSW_HW_FWDG_EN (1<<19)
+#define RSW_MII_DUMB_FWDG_EN (1<<16)
+#define EPHY_RST_4 (1<<9)
+#define EPHY_RST_3 (1<<8)
+#define EPHY_RST_2 (1<<7)
+#define EPHY_RST_1 (1<<6)
+#define EPHY_PWR_DOWN_4 (1<<5)
+#define EPHY_PWR_DOWN_3 (1<<4)
+#define EPHY_PWR_DOWN_2 (1<<3)
+#define EPHY_PWR_DOWN_1 (1<<2)
+#define EPHY_PWR_DOWN_DLL (1<<1)
+#define EPHY_PWR_DOWN_BIAS (1<<0)
+ uint32 StrapBus; /* 40 */
+#define UTOPIA_MASTER_ON (1<<14)
+#define MISC_STRAP_BUS_BOOT_SEL_MASK 0x3
+#define MISC_STRAP_BUS_BOOT_SEL_SHIFT 0
+#define MISC_STRAP_BUS_BOOT_PARALLEL 0x03
+#define MISC_STRAP_BUS_BOOT_SERIAL 0x01
+#define MISC_STRAP_BUS_BOOT_NAND 0x00
+ uint32 StrapOverride; /* 44 */
+
+ uint32 RingOscCtrl0; /* 48 */
+#define RING_OSC_256_CYCLES 8
+#define RING_OSC_512_CYCLES 9
+#define RING_OSC_1024_CYCLES 10
+
+ uint32 RingOscCtrl1; /* 4C */
+#define RING_OSC_ENABLE_MASK (0x7f<<24)
+#define RING_OSC_ENABLE_SHIFT 24
+#define RING_OSC_MAX 7
+#define RING_OSC_COUNT_RESET (0x1<<23)
+#define RING_OSC_SELECT_MASK (0x7<<20)
+#define RING_OSC_SELECT_SHIFT 20
+#define RING_OSC_IRQ (0x1<<18)
+#define RING_OSC_COUNTER_OVERFLOW (0x1<<17)
+#define RING_OSC_COUNTER_BUSY (0x1<<16)
+#define RING_OSC_COUNT_MASK 0x0000ffff
+
+ uint32 SerialLed; /* 50 */
+ uint32 SerialLedCtrl; /* 54 */
+#define SER_LED_BUSY (1<<3)
+#define SER_LED_POLARITY (1<<2)
+#define SER_LED_DIV_1 0
+#define SER_LED_DIV_2 1
+#define SER_LED_DIV_4 2
+#define SER_LED_DIV_8 3
+#define SER_LED_DIV_MASK 0x3
+#define SER_LED_DIV_SHIFT 0
+ uint32 unused2[4]; /* 58 */
+ uint32 DieRevID; /* 68 */
+ uint32 DiagMemStatus; /* 6c */
+ uint32 DiagSelControl; /* 70 */
+ uint32 DiagReadBack; /* 74 */
+ uint32 DiagReadBackHi; /* 78 */
+ uint32 DiagMiscControl; /* 7c */
+#define EPHY_SA_RESET_N 0x00000300
+#define EPHY_SA_TESTEN 0x00000500
+#define EPHY_SA_CLOCK_RESET 0x0000d900
+} GpioControl;
+
+#define GPIO ((volatile GpioControl * const) GPIO_BASE)
+
+/* Number to mask conversion macro used for GPIODir and GPIOio */
+#define GPIO_NUM_MAX 40
+#define GPIO_NUM_TO_MASK(X) ( (((X) & BP_GPIO_NUM_MASK) < GPIO_NUM_MAX) ? ((uint64)1 << ((X) & BP_GPIO_NUM_MASK)) : (0) )
+
+/*
+** Spi Controller
+*/
+
+typedef struct SpiControl {
+ uint16 spiMsgCtl; /* (0x0) control byte */
+#define FULL_DUPLEX_RW 0
+#define HALF_DUPLEX_W 1
+#define HALF_DUPLEX_R 2
+#define SPI_MSG_TYPE_SHIFT 14
+#define SPI_BYTE_CNT_SHIFT 0
+ byte spiMsgData[0x21e]; /* (0x02 - 0x21f) msg data */
+ byte unused0[0x1e0];
+ byte spiRxDataFifo[0x220]; /* (0x400 - 0x61f) rx data */
+ byte unused1[0xe0];
+
+ uint16 spiCmd; /* (0x700): SPI command */
+#define SPI_CMD_NOOP 0
+#define SPI_CMD_SOFT_RESET 1
+#define SPI_CMD_HARD_RESET 2
+#define SPI_CMD_START_IMMEDIATE 3
+
+#define SPI_CMD_COMMAND_SHIFT 0
+#define SPI_CMD_COMMAND_MASK 0x000f
+
+#define SPI_CMD_DEVICE_ID_SHIFT 4
+#define SPI_CMD_PREPEND_BYTE_CNT_SHIFT 8
+#define SPI_CMD_ONE_BYTE_SHIFT 11
+#define SPI_CMD_ONE_WIRE_SHIFT 12
+#define SPI_DEV_ID_0 0
+#define SPI_DEV_ID_1 1
+#define SPI_DEV_ID_2 2
+#define SPI_DEV_ID_3 3
+
+ byte spiIntStatus; /* (0x702): SPI interrupt status */
+ byte spiMaskIntStatus; /* (0x703): SPI masked interrupt status */
+
+ byte spiIntMask; /* (0x704): SPI interrupt mask */
+#define SPI_INTR_CMD_DONE 0x01
+#define SPI_INTR_RX_OVERFLOW 0x02
+#define SPI_INTR_INTR_TX_UNDERFLOW 0x04
+#define SPI_INTR_TX_OVERFLOW 0x08
+#define SPI_INTR_RX_UNDERFLOW 0x10
+#define SPI_INTR_CLEAR_ALL 0x1f
+
+ byte spiStatus; /* (0x705): SPI status */
+#define SPI_RX_EMPTY 0x02
+#define SPI_CMD_BUSY 0x04
+#define SPI_SERIAL_BUSY 0x08
+
+ byte spiClkCfg; /* (0x706): SPI clock configuration */
+#define SPI_CLK_0_391MHZ 1
+#define SPI_CLK_0_781MHZ 2 /* default */
+#define SPI_CLK_1_563MHZ 3
+#define SPI_CLK_3_125MHZ 4
+#define SPI_CLK_6_250MHZ 5
+#define SPI_CLK_12_50MHZ 6
+#define SPI_CLK_MASK 0x07
+#define SPI_SSOFFTIME_MASK 0x38
+#define SPI_SSOFFTIME_SHIFT 3
+#define SPI_BYTE_SWAP 0x80
+
+ byte spiFillByte; /* (0x707): SPI fill byte */
+ byte unused2;
+ byte spiMsgTail; /* (0x709): msgtail */
+ byte unused3;
+ byte spiRxTail; /* (0x70B): rxtail */
+} SpiControl;
+
+#define SPI ((volatile SpiControl * const) SPI_BASE)
+
+
+/*
+** Pcm Controller
+*/
+
+typedef struct PcmControlRegisters
+{
+ uint32 pcm_ctrl; // 00 offset from PCM_BASE
+#define PCM_ENABLE 0x80000000 // PCM block master enable
+#define PCM_ENABLE_SHIFT 31
+#define PCM_SLAVE_SEL 0x40000000 // PCM TDM slave mode select (1 - TDM slave, 0 - TDM master)
+#define PCM_SLAVE_SEL_SHIFT 30
+#define PCM_CLOCK_INV 0x20000000 // PCM SCLK invert select (1 - invert, 0 - normal)
+#define PCM_CLOCK_INV_SHIFT 29
+#define PCM_FS_INVERT 0x10000000 // PCM FS invert select (1 - invert, 0 - normal)
+#define PCM_FS_INVERT_SHIFT 28
+#define PCM_FS_FREQ_16_8 0x08000000 // PCM FS 16/8 Khz select (1 - 16Khz, 0 - 8Khz)
+#define PCM_FS_FREQ_16_8_SHIFT 27
+#define PCM_FS_LONG 0x04000000 // PCM FS long/short select (1 - long FS, 0 - short FS)
+#define PCM_FS_LONG_SHIFT 26
+#define PCM_FS_TRIG 0x02000000 // PCM FS trigger (1 - falling edge, 0 - rising edge trigger)
+#define PCM_FS_TRIG_SHIFT 25
+#define PCM_DATA_OFF 0x01000000 // PCM data offset from FS (1 - one clock from FS, 0 - no offset)
+#define PCM_DATA_OFF_SHIFT 24
+#define PCM_DATA_16_8 0x00800000 // PCM data word length (1 - 16 bits, 0 - 8 bits)
+#define PCM_DATA_16_8_SHIFT 23
+#define PCM_CLOCK_SEL 0x00700000 // PCM SCLK freq select
+#define PCM_CLOCK_SEL_SHIFT 20
+ // 000 - 8192 Khz
+ // 001 - 4096 Khz
+ // 010 - 2048 Khz
+ // 011 - 1024 Khz
+ // 100 - 512 Khz
+ // 101 - 256 Khz
+ // 110 - 128 Khz
+ // 111 - reserved
+#define PCM_LSB_FIRST 0x00040000 // PCM shift direction (1 - LSBit first, 0 - MSBit first)
+#define PCM_LSB_FIRST_SHIFT 18
+#define PCM_LOOPBACK 0x00020000 // PCM diagnostic loobback enable
+#define PCM_LOOPBACK_SHIFT 17
+#define PCM_EXTCLK_SEL 0x00010000 // PCM external timing clock select -- Maybe removed in 6368
+#define PCM_EXTCLK_SEL_SHIFT 16
+#define PCM_NTR_ENABLE 0x00008000 // PCM NTR counter enable -- Nayve removed in 6368
+#define PCM_NTR_ENABLE_SHIFT 15
+#define PCM_BITS_PER_FRAME_1024 0x00000400 // 1024 - Max
+#define PCM_BITS_PER_FRAME_256 0x00000100 // 256
+#define PCM_BITS_PER_FRAME_8 0x00000008 // 8 - Min
+
+ uint32 pcm_chan_ctrl; // 04
+#define PCM_TX0_EN 0x00000001 // PCM transmit channel 0 enable
+#define PCM_TX1_EN 0x00000002 // PCM transmit channel 1 enable
+#define PCM_TX2_EN 0x00000004 // PCM transmit channel 2 enable
+#define PCM_TX3_EN 0x00000008 // PCM transmit channel 3 enable
+#define PCM_TX4_EN 0x00000010 // PCM transmit channel 4 enable
+#define PCM_TX5_EN 0x00000020 // PCM transmit channel 5 enable
+#define PCM_TX6_EN 0x00000040 // PCM transmit channel 6 enable
+#define PCM_TX7_EN 0x00000080 // PCM transmit channel 7 enable
+#define PCM_RX0_EN 0x00000100 // PCM receive channel 0 enable
+#define PCM_RX1_EN 0x00000200 // PCM receive channel 1 enable
+#define PCM_RX2_EN 0x00000400 // PCM receive channel 2 enable
+#define PCM_RX3_EN 0x00000800 // PCM receive channel 3 enable
+#define PCM_RX4_EN 0x00001000 // PCM receive channel 4 enable
+#define PCM_RX5_EN 0x00002000 // PCM receive channel 5 enable
+#define PCM_RX6_EN 0x00004000 // PCM receive channel 6 enable
+#define PCM_RX7_EN 0x00008000 // PCM receive channel 7 enable
+#define PCM_RX_PACKET_SIZE 0x00ff0000 // PCM Rx DMA quasi-packet size
+#define PCM_RX_PACKET_SIZE_SHIFT 16
+
+ uint32 pcm_int_pending; // 08
+ uint32 pcm_int_mask; // 0c
+#define PCM_TX_UNDERFLOW 0x00000001 // PCM DMA receive overflow
+#define PCM_RX_OVERFLOW 0x00000002 // PCM DMA transmit underflow
+#define PCM_TDM_FRAME 0x00000004 // PCM frame boundary
+#define PCM_RX_IRQ 0x00000008 // IUDMA interrupts
+#define PCM_TX_IRQ 0x00000010
+
+ uint32 pcm_pll_ctrl1; // 10
+#define PCM_PLL_PWRDN 0x80000000 // PLL PWRDN
+#define PCM_PLL_PWRDN_CH1 0x40000000 // PLL CH PWRDN
+#define PCM_PLL_REFCMP_PWRDN 0x20000000 // PLL REFCMP PWRDN
+#define PCM_CLK16_RESET 0x10000000 // 16.382 MHz PCM interface circuitry reset.
+#define PCM_PLL_ARESET 0x08000000 // PLL Analog Reset
+#define PCM_PLL_DRESET 0x04000000 // PLL Digital Reset
+
+ uint32 pcm_pll_ctrl2; // 14
+ uint32 pcm_pll_ctrl3; // 18
+ uint32 pcm_pll_ctrl4; // 1c
+
+ uint32 pcm_pll_stat; // 20
+#define PCM_PLL_LOCK 0x00000001 // Asserted when PLL is locked to programmed frequency
+
+ uint32 pcm_ntr_counter; // 24
+
+ uint32 unused[6];
+
+#define PCM_MAX_TIMESLOT_REGS 16 // Number of PCM time slot registers in the table.
+ // Each register provides the settings for 8 timeslots (4 bits per timeslot)
+ uint32 pcm_slot_alloc_tbl[PCM_MAX_TIMESLOT_REGS];
+#define PCM_TS_VALID 0x8 // valid marker for TS alloc ram entry
+} PcmControlRegisters;
+
+#define PCM ((volatile PcmControlRegisters * const) PCM_BASE)
+
+typedef struct PcmIudmaRegisters
+{
+ uint16 reserved0;
+ uint16 ctrlConfig;
+#define BCM6368_IUDMA_REGS_CTRLCONFIG_MASTER_EN 0x0001
+#define BCM6368_IUDMA_REGS_CTRLCONFIG_FLOWC_CH1_EN 0x0002
+#define BCM6368_IUDMA_REGS_CTRLCONFIG_FLOWC_CH3_EN 0x0004
+#define BCM6368_IUDMA_REGS_CTRLCONFIG_FLOWC_CH5_EN 0x0008
+#define BCM6368_IUDMA_REGS_CTRLCONFIG_FLOWC_CH7_EN 0x0010
+
+ // Flow control Ch1
+ uint16 reserved1;
+ uint16 ch1_FC_Low_Thr;
+
+ uint16 reserved2;
+ uint16 ch1_FC_High_Thr;
+
+ uint16 reserved3;
+ uint16 ch1_Buff_Alloc;
+
+ // Flow control Ch3
+ uint16 reserved4;
+ uint16 ch3_FC_Low_Thr;
+
+ uint16 reserved5;
+ uint16 ch3_FC_High_Thr;
+
+ uint16 reserved6;
+ uint16 ch3_Buff_Alloc;
+
+ // Flow control Ch5
+ uint16 reserved7;
+ uint16 ch5_FC_Low_Thr;
+
+ uint16 reserved8;
+ uint16 ch5_FC_High_Thr;
+
+ uint16 reserved9;
+ uint16 ch5_Buff_Alloc;
+
+ // Flow control Ch7
+ uint16 reserved10;
+ uint16 ch7_FC_Low_Thr;
+
+ uint16 reserved11;
+ uint16 ch7_FC_High_Thr;
+
+ uint16 reserved12;
+ uint16 ch7_Buff_Alloc;
+
+ // Channel resets
+ uint16 reserved13;
+ uint16 channel_reset;
+
+ uint16 reserved14;
+ uint16 channel_debug;
+
+ // Spare register
+ uint32 dummy1;
+
+ // Interrupt status registers
+ uint16 reserved15;
+ uint16 gbl_int_stat;
+
+ // Interrupt mask registers
+ uint16 reserved16;
+ uint16 gbl_int_mask;
+} PcmIudmaRegisters;
+
+typedef struct PcmIudmaChannelCtrl
+{
+ uint16 reserved1;
+ uint16 config;
+#define BCM6368_IUDMA_CONFIG_ENDMA 0x0001
+#define BCM6368_IUDMA_CONFIG_PKTHALT 0x0002
+#define BCM6368_IUDMA_CONFIG_BURSTHALT 0x0004
+
+ uint16 reserved2;
+ uint16 intStat;
+#define BCM6368_IUDMA_INTSTAT_BDONE 0x0001
+#define BCM6368_IUDMA_INTSTAT_PDONE 0x0002
+#define BCM6368_IUDMA_INTSTAT_NOTVLD 0x0004
+#define BCM6368_IUDMA_INTSTAT_MASK 0x0007
+#define BCM6368_IUDMA_INTSTAT_ALL BCM6368_IUDMA_INTSTAT_MASK
+
+ uint16 reserved3;
+ uint16 intMask;
+#define BCM6368_IUDMA_INTMASK_BDONE 0x0001
+#define BCM6368_IUDMA_INTMASK_PDONE 0x0002
+#define BCM6368_IUDMA_INTMASK_NOTVLD 0x0004
+
+ uint32 maxBurst;
+#define BCM6368_IUDMA_MAXBURST_SIZE 16 /* 32-bit words */
+
+} PcmIudmaChannelCtrl;
+
+
+typedef struct PcmIudmaStateRam
+{
+ uint32 baseDescPointer; /* pointer to first buffer descriptor */
+
+ uint32 stateBytesDoneRingOffset; /* state info: how manu bytes done and the offset of the
+ current descritor in process */
+#define BCM6368_IUDMA_STRAM_DESC_RING_OFFSET 0x3fff
+
+
+ uint32 flagsLengthStatus; /* Length and status field of the current descriptor */
+
+ uint32 currentBufferPointer; /* pointer to the current descriptor */
+
+} PcmIudmaStateRam;
+
+#define BCM6368_MAX_PCM_DMA_CHANNELS 2
+
+typedef struct PcmIudma
+{
+ PcmIudmaRegisters regs; //
+ uint32 reserved1[110]; //
+ PcmIudmaChannelCtrl ctrl[BCM6368_MAX_PCM_DMA_CHANNELS]; //
+ uint32 reserved2[120]; //
+ PcmIudmaStateRam stram[BCM6368_MAX_PCM_DMA_CHANNELS]; //
+
+} PcmIudma;
+
+#define PCM_IUDMA ((volatile PcmIudma * const) PCM_DMA_BASE)
+
+
+#define IUDMA_MAX_CHANNELS 32
+
+/*
+** DMA Channel Configuration (1 .. 32)
+*/
+typedef struct DmaChannelCfg {
+ uint32 cfg; /* (00) assorted configuration */
+#define DMA_ENABLE 0x00000001 /* set to enable channel */
+#define DMA_PKT_HALT 0x00000002 /* idle after an EOP flag is detected */
+#define DMA_BURST_HALT 0x00000004 /* idle after finish current memory burst */
+ uint32 intStat; /* (04) interrupts control and status */
+ uint32 intMask; /* (08) interrupts mask */
+#define DMA_BUFF_DONE 0x00000001 /* buffer done */
+#define DMA_DONE 0x00000002 /* packet xfer complete */
+#define DMA_NO_DESC 0x00000004 /* no valid descriptors */
+ uint32 maxBurst; /* (0C) max burst length permitted */
+} DmaChannelCfg;
+
+/*
+** DMA State RAM (1 .. 16)
+*/
+typedef struct DmaStateRam {
+ uint32 baseDescPtr; /* (00) descriptor ring start address */
+ uint32 state_data; /* (04) state/bytes done/ring offset */
+ uint32 desc_len_status; /* (08) buffer descriptor status and len */
+ uint32 desc_base_bufptr; /* (0C) buffer descrpitor current processing */
+} DmaStateRam;
+
+
+/*
+** DMA Registers
+*/
+typedef struct DmaRegs {
+ uint32 controller_cfg; /* (00) controller configuration */
+#define DMA_MASTER_EN 0x00000001
+#define DMA_FLOWC_CH1_EN 0x00000002
+#define DMA_FLOWC_CH3_EN 0x00000004
+
+ // Flow control Ch1
+ uint32 flowctl_ch1_thresh_lo; /* 004 */
+ uint32 flowctl_ch1_thresh_hi; /* 008 */
+ uint32 flowctl_ch1_alloc; /* 00c */
+#define DMA_BUF_ALLOC_FORCE 0x80000000
+
+ // Flow control Ch3
+ uint32 flowctl_ch3_thresh_lo; /* 010 */
+ uint32 flowctl_ch3_thresh_hi; /* 014 */
+ uint32 flowctl_ch3_alloc; /* 018 */
+
+ // Flow control Ch5
+ uint32 flowctl_ch5_thresh_lo; /* 01C */
+ uint32 flowctl_ch5_thresh_hi; /* 020 */
+ uint32 flowctl_ch5_alloc; /* 024 */
+
+ // Flow control Ch7
+ uint32 flowctl_ch7_thresh_lo; /* 028 */
+ uint32 flowctl_ch7_thresh_hi; /* 02C */
+ uint32 flowctl_ch7_alloc; /* 030 */
+
+ uint32 ctrl_channel_reset; /* 034 */
+ uint32 ctrl_channel_debug; /* 038 */
+ uint32 reserved1; /* 03C */
+ uint32 ctrl_global_interrupt_status; /* 040 */
+ uint32 ctrl_global_interrupt_mask; /* 044 */
+
+ // Unused words
+ uint8 reserved2[0x200-0x48];
+
+ // Per channel registers/state ram
+ DmaChannelCfg chcfg[IUDMA_MAX_CHANNELS];/* (200-3FF) Channel configuration */
+ union {
+ DmaStateRam s[IUDMA_MAX_CHANNELS];
+ uint32 u32[4 * IUDMA_MAX_CHANNELS];
+ } stram; /* (400-5FF) state ram */
+} DmaRegs;
+
+/*
+** DMA Buffer
+*/
+typedef struct DmaDesc {
+ union {
+ struct {
+ uint16 length; /* in bytes of data in buffer */
+#define DMA_DESC_USEFPM 0x8000
+#define DMA_DESC_MULTICAST 0x4000
+#define DMA_DESC_BUFLENGTH 0x0fff
+ uint16 status; /* buffer status */
+#define DMA_OWN 0x8000 /* cleared by DMA, set by SW */
+#define DMA_EOP 0x4000 /* last buffer in packet */
+#define DMA_SOP 0x2000 /* first buffer in packet */
+#define DMA_WRAP 0x1000 /* */
+#define DMA_PRIO 0x0C00 /* Prio for Tx */
+#define DMA_APPEND_BRCM_TAG 0x0200
+#define DMA_APPEND_CRC 0x0100
+#define USB_ZERO_PKT (1<< 0) // Set to send zero length packet
+ };
+ uint32 word0;
+ };
+
+ uint32 address; /* address of data */
+} DmaDesc;
+
+/*
+** External Bus Interface
+*/
+typedef struct EbiChipSelect {
+ uint32 base; /* base address in upper 24 bits */
+#define EBI_SIZE_8K 0
+#define EBI_SIZE_16K 1
+#define EBI_SIZE_32K 2
+#define EBI_SIZE_64K 3
+#define EBI_SIZE_128K 4
+#define EBI_SIZE_256K 5
+#define EBI_SIZE_512K 6
+#define EBI_SIZE_1M 7
+#define EBI_SIZE_2M 8
+#define EBI_SIZE_4M 9
+#define EBI_SIZE_8M 10
+#define EBI_SIZE_16M 11
+#define EBI_SIZE_32M 12
+#define EBI_SIZE_64M 13
+#define EBI_SIZE_128M 14
+#define EBI_SIZE_256M 15
+ uint32 config;
+#define EBI_ENABLE 0x00000001 /* .. enable this range */
+#define EBI_WAIT_STATES 0x0000000e /* .. mask for wait states */
+#define EBI_WTST_SHIFT 1 /* .. for shifting wait states */
+#define EBI_WORD_WIDE 0x00000010 /* .. 16-bit peripheral, else 8 */
+#define EBI_WREN 0x00000020 /* enable posted writes */
+#define EBI_POLARITY 0x00000040 /* .. set to invert something,
+ ** don't know what yet */
+#define EBI_TS_TA_MODE 0x00000080 /* .. use TS/TA mode */
+#define EBI_TS_SEL 0x00000100 /* .. drive tsize, not bs_b */
+#define EBI_FIFO 0x00000200 /* .. use fifo */
+#define EBI_RE 0x00000400 /* .. Reverse Endian */
+#define EBI_SETUP_SHIFT 16
+#define EBI_HOLD_SHIFT 20
+#define EBI_SETUP_STATES 0x0f0000
+#define EBI_HOLD_STATES 0xf00000
+} EbiChipSelect;
+
+typedef struct MpiRegisters {
+ EbiChipSelect cs[7]; /* size chip select configuration */
+#define EBI_CS0_BASE 0
+#define EBI_CS1_BASE 1
+#define EBI_CS2_BASE 2
+#define EBI_CS3_BASE 3
+#define PCMCIA_COMMON_BASE 4
+#define PCMCIA_ATTRIBUTE_BASE 5
+#define PCMCIA_IO_BASE 6
+ uint32 unused0[2]; /* reserved */
+ uint32 ebi_control; /* ebi control */
+ uint32 unused1[4]; /* reserved */
+#define EBI_ACCESS_TIMEOUT 0x000007FF
+ uint32 pcmcia_cntl1; /* pcmcia control 1 */
+#define PCCARD_CARD_RESET 0x00040000
+#define CARDBUS_ENABLE 0x00008000
+#define PCMCIA_ENABLE 0x00004000
+#define PCMCIA_GPIO_ENABLE 0x00002000
+#define CARDBUS_IDSEL 0x00001F00
+#define VS2_OEN 0x00000080
+#define VS1_OEN 0x00000040
+#define VS2_OUT 0x00000020
+#define VS1_OUT 0x00000010
+#define VS2_IN 0x00000008
+#define VS1_IN 0x00000004
+#define CD2_IN 0x00000002
+#define CD1_IN 0x00000001
+#define VS_MASK 0x0000000C
+#define CD_MASK 0x00000003
+ uint32 unused2; /* reserved */
+ uint32 pcmcia_cntl2; /* pcmcia control 2 */
+#define PCMCIA_BYTESWAP_DIS 0x00000002
+#define PCMCIA_HALFWORD_EN 0x00000001
+#define RW_ACTIVE_CNT_BIT 2
+#define INACTIVE_CNT_BIT 8
+#define CE_SETUP_CNT_BIT 16
+#define CE_HOLD_CNT_BIT 24
+ uint32 unused3[40]; /* reserved */
+
+ uint32 sp0range; /* PCI to internal system bus address space */
+#define ADDR_SPACE_MASK 0xFFFF0000
+ uint32 sp0remap;
+ uint32 sp0cfg;
+ uint32 sp1range;
+ uint32 sp1remap;
+ uint32 sp1cfg;
+
+ uint32 EndianCfg;
+
+ uint32 l2pcfgctl; /* internal system bus to PCI IO/Cfg control */
+#define DIR_CFG_SEL 0x80000000 /* change from PCI I/O access to PCI config access */
+#define DIR_CFG_USEREG 0x40000000 /* use this register info for PCI configuration access */
+#define DEVICE_NUMBER 0x00007C00 /* device number for the PCI configuration access */
+#define FUNC_NUMBER 0x00000300 /* function number for the PCI configuration access */
+#define REG_NUMBER 0x000000FC /* register number for the PCI configuration access */
+#define CONFIG_TYPE 0x00000003 /* configuration type for the PCI configuration access */
+
+ uint32 l2pmrange1; /* internal system bus to PCI memory space */
+#define PCI_SIZE_64K 0xFFFF0000
+#define PCI_SIZE_128K 0xFFFE0000
+#define PCI_SIZE_256K 0xFFFC0000
+#define PCI_SIZE_512K 0xFFF80000
+#define PCI_SIZE_1M 0xFFF00000
+#define PCI_SIZE_2M 0xFFE00000
+#define PCI_SIZE_4M 0xFFC00000
+#define PCI_SIZE_8M 0xFF800000
+#define PCI_SIZE_16M 0xFF000000
+#define PCI_SIZE_32M 0xFE000000
+ uint32 l2pmbase1; /* kseg0 or kseg1 address & 0x1FFFFFFF */
+ uint32 l2pmremap1;
+#define CARDBUS_MEM 0x00000004
+#define MEM_WINDOW_EN 0x00000001
+ uint32 l2pmrange2;
+ uint32 l2pmbase2;
+ uint32 l2pmremap2;
+ uint32 l2piorange; /* internal system bus to PCI I/O space */
+ uint32 l2piobase;
+ uint32 l2pioremap;
+
+ uint32 pcimodesel;
+#define PCI_INT_BUS_RD_PREFETCH 0x000001F0
+#define PCI_BAR2_NOSWAP 0x00000002 /* BAR at offset 0x20 */
+#define PCI_BAR1_NOSWAP 0x00000001 /* BAR at affset 0x1c */
+
+ uint32 pciintstat; /* PCI interrupt mask/status */
+#define MAILBOX1_SENT 0x08
+#define MAILBOX0_SENT 0x04
+#define MAILBOX1_MSG_RCV 0x02
+#define MAILBOX0_MSG_RCV 0x01
+ uint32 locbuscntrl; /* internal system bus control */
+#define DIR_U2P_NOSWAP 0x00000002
+#define EN_PCI_GPIO 0x00000001
+ uint32 locintstat; /* internal system bus interrupt mask/status */
+#define CSERR 0x0200
+#define SERR 0x0100
+#define EXT_PCI_INT 0x0080
+#define DIR_FAILED 0x0040
+#define DIR_COMPLETE 0x0020
+#define PCI_CFG 0x0010
+ uint32 unused4[7];
+
+ uint32 mailbox0;
+ uint32 mailbox1;
+
+ uint32 pcicfgcntrl; /* internal system bus PCI configuration control */
+#define PCI_CFG_REG_WRITE_EN 0x00000080
+#define PCI_CFG_ADDR 0x0000003C
+ uint32 pcicfgdata; /* internal system bus PCI configuration data */
+
+ uint32 locch2ctl; /* PCI to interrnal system bus DMA (downstream) local control */
+#define MPI_DMA_HALT 0x00000008 /* idle after finish current memory burst */
+#define MPI_DMA_PKT_HALT 0x00000004 /* idle after an EOP flag is detected */
+#define MPI_DMA_STALL 0x00000002 /* idle after an EOP flag is detected */
+#define MPI_DMA_ENABLE 0x00000001 /* set to enable channel */
+ uint32 locch2intStat;
+#define MPI_DMA_NO_DESC 0x00000004 /* no valid descriptors */
+#define MPI_DMA_DONE 0x00000002 /* packet xfer complete */
+#define MPI_DMA_BUFF_DONE 0x00000001 /* buffer done */
+ uint32 locch2intMask;
+ uint32 unused5;
+ uint32 locch2descaddr;
+ uint32 locch2status1;
+#define LOCAL_DESC_STATE 0xE0000000
+#define PCI_DESC_STATE 0x1C000000
+#define BYTE_DONE 0x03FFC000
+#define RING_ADDR 0x00003FFF
+ uint32 locch2status2;
+#define BUFPTR_OFFSET 0x1FFF0000
+#define PCI_MASTER_STATE 0x000000C0
+#define LOC_MASTER_STATE 0x00000038
+#define CONTROL_STATE 0x00000007
+ uint32 unused6;
+
+ uint32 locch1Ctl; /*internal system bus to PCI DMA (upstream) local control */
+#define DMA_U2P_LE 0x00000200 /* local bus is little endian */
+#define DMA_U2P_NOSWAP 0x00000100 /* lccal bus is little endian but no data swapped */
+ uint32 locch1intstat;
+ uint32 locch1intmask;
+ uint32 unused7;
+ uint32 locch1descaddr;
+ uint32 locch1status1;
+ uint32 locch1status2;
+ uint32 unused8;
+
+ uint32 pcich1ctl; /* internal system bus to PCI DMA PCI control */
+ uint32 pcich1intstat;
+ uint32 pcich1intmask;
+ uint32 pcich1descaddr;
+ uint32 pcich1status1;
+ uint32 pcich1status2;
+
+ uint32 pcich2Ctl; /* PCI to internal system bus DMA PCI control */
+ uint32 pcich2intstat;
+ uint32 pcich2intmask;
+ uint32 pcich2descaddr;
+ uint32 pcich2status1;
+ uint32 pcich2status2;
+
+ uint32 perm_id; /* permanent device and vendor id */
+ uint32 perm_rev; /* permanent revision id */
+} MpiRegisters;
+
+#define MPI ((volatile MpiRegisters * const) MPI_BASE)
+
+/* PCI configuration address space start offset 0x40 */
+#define BRCM_PCI_CONFIG_TIMER 0x40
+#define BRCM_PCI_CONFIG_TIMER_RETRY_MASK 0x0000FF00
+#define BRCM_PCI_CONFIG_TIMER_TRDY_MASK 0x000000FF
+/*
+** USB 2.0 Device Registers
+*/
+typedef struct UsbRegisters {
+#define USBD_CONTROL_APP_DONECSR 0x0001
+#define USBD_CONTROL_APP_RESUME 0x0002
+#define USBD_CONTROL_APP_RXFIFIO_INIT 0x0040
+#define USBD_CONTROL_APP_TXFIFIO_INIT 0x0080
+#define USBD_CONTROL_APP_FIFO_SEL_SHIFT 0x8
+#define USBD_CONTROL_APP_FIFO_INIT_SEL(x) (((x)&0x0f)<<USBD_CONTROL_APP_FIFO_SEL_SHIFT)
+#define USBD_CONTROL_APP_AUTO_CSRS 0x2000
+#define USBD_CONTROL_APP_AUTO_INS_ZERO_LEN_PKT 0x4000
+#define EN_TXZLENINS (1<<14)
+#define EN_RXZSCFG (1<<12)
+#define APPSETUPERRLOCK (1<<5)
+ uint32 usbd_control ;
+#define USBD_STRAPS_APP_SELF_PWR 0x0400
+#define USBD_STRAPS_APP_DEV_DISCON 0x0200
+#define USBD_STRAPS_APP_CSRPRG_SUP 0x0100
+#define USBD_STRAPS_APP_RAM_IF 0x0080
+#define USBD_STRAPS_APP_DEV_RMTWKUP 0x0040
+#define USBD_STRAPS_APP_PHYIF_8BIT 0x0004
+#define USBD_STRAPS_FULL_SPEED 0x0003
+#define USBD_STRAPS_LOW_SPEED 0x0002
+#define USBD_STRAPS_HIGH_SPEED 0x0000
+#define APPUTMIDIR(x) ((x&1)<<3)
+#define UNIDIR 0
+ uint32 usbd_straps;
+#define USB_ENDPOINT_0 0x01
+ uint32 usbd_stall;
+#define USBD_ENUM_SPEED_SHIFT 12
+#define USBD_ENUM_SPEED 0x3000
+#define UDC20_ALTINTF(x) ((x>>8)&0xf)
+#define UDC20_INTF(x) ((x>>4)&0xf)
+#define UDC20_CFG(x) ((x>>0)&0xf)
+ uint32 usbd_status;
+#define USBD_LINK (0x1<<10)
+#define USBD_SET_CSRS 0x40
+#define USBD_SUSPEND 0x20
+#define USBD_EARLY_SUSPEND 0x10
+#define USBD_SOF 0x08
+#define USBD_ENUMON 0x04
+#define USBD_SETUP 0x02
+#define USBD_USBRESET 0x01
+ uint32 usbd_events;
+ uint32 usbd_events_irq;
+#define UPPER(x) (16+x)
+#define ENABLE(x) (1<<x)
+#define SWP_TXBSY (15)
+#define SWP_RXBSY (14)
+#define SETUP_ERR (13)
+#define APPUDCSTALLCHG (12)
+#define BUS_ERR (11)
+#define USB_LINK (10)
+#define HST_SETCFG (9)
+#define HST_SETINTF (8)
+#define ERRATIC_ERR (7)
+#define SET_CSRS (6)
+#define SUSPEND (5)
+#define ERLY_SUSPEND (4)
+#define SOF (3)
+#define ENUM_ON (2)
+#define SETUP (1)
+#define USB_RESET (0)
+#define RISING(x) (0x0<<2*x)
+#define FALLING(x) (0x1<<2*x)
+#define USBD_IRQCFG_ENUM_ON_FALLING_EDGE 0x00000010
+ uint32 usbd_irqcfg_hi ;
+ uint32 usbd_irqcfg_lo ;
+#define USBD_USB_RESET_IRQ 0x00000001
+#define USBD_USB_SETUP_IRQ 0x00000002 // non-standard setup cmd rcvd
+#define USBD_USB_ENUM_ON_IRQ 0x00000004
+#define USBD_USB_SOF_IRQ 0x00000008
+#define USBD_USB_EARLY_SUSPEND_IRQ 0x00000010
+#define USBD_USB_SUSPEND_IRQ 0x00000020 // non-standard setup cmd rcvd
+#define USBD_USB_SET_CSRS_IRQ 0x00000040
+#define USBD_USB_ERRATIC_ERR_IRQ 0x00000080
+#define USBD_USB_SETCFG_IRQ 0x00000200
+#define USBD_USB_LINK_IRQ 0x00000400
+ uint32 usbd_events_irq_mask;
+ uint32 usbd_swcfg;
+ uint32 usbd_swtxctl;
+ uint32 usbd_swrxctl;
+ uint32 usbd_txfifo_rwptr;
+ uint32 usbd_rxfifo_rwptr;
+ uint32 usbd_txfifo_st_rwptr;
+ uint32 usbd_rxfifo_st_rwptr;
+ uint32 usbd_txfifo_config ;
+ uint32 usbd_rxfifo_config ;
+ uint32 usbd_txfifo_epsize ;
+ uint32 usbd_rxfifo_epsize ;
+#define USBD_EPNUM_CTRL 0x0
+#define USBD_EPNUM_ISO 0x1
+#define USBD_EPNUM_BULK 0x2
+#define USBD_EPNUM_IRQ 0x3
+#define USBD_EPNUM_EPTYPE(x) (((x)&0x3)<<8)
+#define USBD_EPNUM_EPDMACHMAP(x) (((x)&0xf)<<0)
+ uint32 usbd_epnum_typemap ;
+ uint32 usbd_reserved [0xB] ;
+ uint32 usbd_csr_setupaddr ;
+#define USBD_EPNUM_MASK 0xf
+#define USBD_EPNUM(x) ((x&USBD_EPNUM_MASK)<<0)
+#define USBD_EPDIR_IN (1<<4)
+#define USBD_EPDIR_OUT (0<<4)
+#define USBD_EPTYP_CTRL (USBD_EPNUM_CTRL<<5)
+#define USBD_EPTYP_ISO (USBD_EPNUM_ISO<<5)
+#define USBD_EPTYP_BULK (USBD_EPNUM_BULK<<5)
+#define USBD_EPTYP_IRQ (USBD_EPNUM_IRQ<<5)
+#define USBD_EPCFG_MASK 0xf
+#define USBD_EPCFG(x) ((x&USBD_EPCFG_MASK)<<7)
+#define USBD_EPINTF_MASK 0xf
+#define USBD_EPINTF(x) ((x&USBD_EPINTF_MASK)<<11)
+#define USBD_EPAINTF_MASK 0xf
+#define USBD_EPAINTF(x) ((x&USBD_EPAINTF_MASK)<<15)
+#define USBD_EPMAXPKT_MSK 0x7ff
+#define USBD_EPMAXPKT(x) ((x&USBD_EPMAXPKT_MSK)<<19)
+#define USBD_EPISOPID_MASK 0x3
+#define USBD_EPISOPID(x) ((x&USBD_ISOPID_MASK)<<30)
+ uint32 usbd_csr_ep [5] ;
+} UsbRegisters;
+
+#define USB ((volatile UsbRegisters * const) USB_CTL_BASE)
+
+typedef struct USBControl {
+ uint32 BrtControl1;
+ uint32 BrtControl2;
+ uint32 BrtStatus1;
+ uint32 BrtStatus2;
+ uint32 UTMIControl1;
+ uint32 TestPortControl;
+ uint32 PllControl1;
+ uint32 SwapControl;
+#define USB_DEVICE_SEL (1<<6)
+#define EHCI_LOGICAL_ADDRESS_EN (1<<5)
+#define EHCI_ENDIAN_SWAP (1<<4)
+#define EHCI_DATA_SWAP (1<<3)
+#define OHCI_LOGICAL_ADDRESS_EN (1<<2)
+#define OHCI_ENDIAN_SWAP (1<<1)
+#define OHCI_DATA_SWAP (1<<0)
+ uint32 unused1;
+ uint32 FrameAdjustValue;
+ uint32 Setup;
+#define USBH_IOC (1<<4)
+ uint32 MDIO;
+ uint32 MDIO32;
+ uint32 USBSimControl;
+} USBControl;
+
+#define USBH ((volatile USBControl * const) USBH_CFG_BASE)
+
+typedef struct EthSwRegs{
+ byte port_traffic_ctrl[9]; /* 0x00 - 0x08 */
+ byte reserved1[2]; /* 0x09 - 0x0a */
+ byte switch_mode; /* 0x0b */
+ unsigned short pause_quanta; /*0x0c */
+ byte imp_port_state; /*0x0e */
+ byte led_refresh; /* 0x0f */
+ unsigned short led_function[2]; /* 0x10 */
+ unsigned short led_function_map; /* 0x14 */
+ unsigned short led_enable_map; /* 0x16 */
+ unsigned short led_mode_map0; /* 0x18 */
+ unsigned short led_function_map1; /* 0x1a */
+ byte reserved2[5]; /* 0x1b - 0x20 */
+ byte port_forward_ctrl; /* 0x21 */
+ byte reserved3[2]; /* 0x22 - 0x23 */
+ unsigned short protected_port_selection; /* 0x24 */
+ unsigned short wan_port_select; /* 0x26 */
+ unsigned int pause_capability; /* 0x28 */
+ byte reserved4[3]; /* 0x2c - 0x2e */
+ byte reserved_multicast_control; /* 0x2f */
+ byte reserved5; /* 0x30 */
+ byte txq_flush_mode_control; /* 0x31 */
+ unsigned short ulf_forward_map; /* 0x32 */
+ unsigned short mlf_forward_map; /* 0x34 */
+ unsigned short mlf_impc_forward_map; /* 0x36 */
+ unsigned short pause_pass_through_for_rx; /* 0x38 */
+ unsigned short pause_pass_through_for_tx; /* 0x3a */
+ unsigned short disable_learning; /* 0x3c */
+ byte reserved6[26]; /* 0x3e - 0x57 */
+ byte port_state_override[8]; /* 0x58 - 0x5f */
+ byte reserved7[4]; /* 0x60 - 0x63 */
+ byte imp_rgmii_ctrl_p4; /* 0x64 */
+ byte imp_rgmii_ctrl_p5; /* 0x65 */
+ byte reserved8[6]; /* 0x66 - 0x6b */
+ byte rgmii_timing_delay_p4; /* 0x6c */
+ byte gmii_timing_delay_p5; /* 0x6d */
+ byte reserved9[11]; /* 0x6e - 0x78 */
+ byte software_reset; /* 0x79 */
+ byte reserved13[6]; /* 0x7a - 0x7f */
+ byte pause_frame_detection; /* 0x80 */
+ byte reserved10[7]; /* 0x81 - 0x87 */
+ byte fast_aging_ctrl; /* 0x88 */
+ byte fast_aging_port; /* 0x89 */
+ byte fast_aging_vid; /* 0x8a */
+ byte reserved11[21]; /* 0x8b - 0x9f */
+ unsigned int swpkt_ctrl_sar; /*0xa0 */
+ unsigned int swpkt_ctrl_usb; /*0xa4 */
+ unsigned int iudma_ctrl; /*0xa8 */
+ unsigned int rxfilt_ctrl; /*0xac */
+ unsigned int mdio_ctrl; /*0xb0 */
+ unsigned int mdio_data; /*0xb4 */
+ byte reserved12[42]; /* 0xb6 - 0xdf */
+ unsigned int sw_mem_test; /*0xe0 */
+} EthSwRegs;
+
+#define ETHSWREG ((volatile EthSwRegs * const) SWITCH_BASE)
+
+typedef struct EthSwMIBRegs {
+ unsigned int TxOctetsLo;
+ unsigned int TxOctetsHi;
+ unsigned int TxDropPkts;
+ unsigned int TxQoSPkts;
+ unsigned int TxBroadcastPkts;
+ unsigned int TxMulticastPkts;
+ unsigned int TxUnicastPkts;
+ unsigned int TxCol;
+ unsigned int TxSingleCol;
+ unsigned int TxMultipleCol;
+ unsigned int TxDeferredTx;
+ unsigned int TxLateCol;
+ unsigned int TxExcessiveCol;
+ unsigned int TxFrameInDisc;
+ unsigned int TxPausePkts;
+ unsigned int TxQoSOctetsLo;
+ unsigned int TxQoSOctetsHi;
+ unsigned int RxOctetsLo;
+ unsigned int RxOctetsHi;
+ unsigned int RxUndersizePkts;
+ unsigned int RxPausePkts;
+ unsigned int Pkts64Octets;
+ unsigned int Pkts65to127Octets;
+ unsigned int Pkts128to255Octets;
+ unsigned int Pkts256to511Octets;
+ unsigned int Pkts512to1023Octets;
+ unsigned int Pkts1024to1522Octets;
+ unsigned int RxOversizePkts;
+ unsigned int RxJabbers;
+ unsigned int RxAlignErrs;
+ unsigned int RxFCSErrs;
+ unsigned int RxGoodOctetsLo;
+ unsigned int RxGoodOctetsHi;
+ unsigned int RxDropPkts;
+ unsigned int RxUnicastPkts;
+ unsigned int RxMulticastPkts;
+ unsigned int RxBroadcastPkts;
+ unsigned int RxSAChanges;
+ unsigned int RxFragments;
+ unsigned int RxExcessSizeDisc;
+ unsigned int RxSymbolError;
+ unsigned int RxQoSPkts;
+ unsigned int RxQoSOctetsLo;
+ unsigned int RxQoSOctetsHi;
+ unsigned int Pkts1523to2047;
+ unsigned int Pkts2048to4095;
+ unsigned int Pkts4096to8191;
+ unsigned int Pkts8192to9728;
+} EthSwMIBRegs;
+
+#define ETHSWMIBREG ((volatile EthSwMIBRegs * const) (SWITCH_BASE + 0x2000))
+
+/*
+** NAND Interrupt Controller Registers
+*/
+typedef struct NandIntrCtrlRegs {
+ uint32 NandInterrupt;
+#define NINT_ENABLE_MASK 0xffff0000
+#define NINT_STS_MASK 0x00000fff
+#define NINT_ECC_ERROR_CORR 0x00000080
+#define NINT_ECC_ERROR_UNC 0x00000040
+#define NINT_DEV_RBPIN 0x00000020
+#define NINT_CTRL_READY 0x00000010
+#define NINT_PAGE_PGM 0x00000008
+#define NINT_COPY_BACK 0x00000004
+#define NINT_BLOCK_ERASE 0x00000002
+#define NINT_NP_READ 0x00000001
+
+ uint32 NandBaseAddr0; /* Default address when booting from NAND flash */
+ uint32 reserved;
+ uint32 NandBaseAddr1; /* Secondary base address for NAND flash */
+} NandIntrCtrlRegs;
+
+#define NAND_INTR ((volatile NandIntrCtrlRegs * const) NAND_INTR_BASE)
+
+/*
+** NAND Controller Registers
+*/
+typedef struct NandCtrlRegs {
+ uint32 NandRevision; /* NAND Revision */
+ uint32 NandCmdStart; /* Nand Flash Command Start */
+#define NCMD_MASK 0x0f000000
+#define NCMD_BLK_LOCK_STS 0x0d000000
+#define NCMD_BLK_UNLOCK 0x0c000000
+#define NCMD_BLK_LOCK_DOWN 0x0b000000
+#define NCMD_BLK_LOCK 0x0a000000
+#define NCMD_FLASH_RESET 0x09000000
+#define NCMD_BLOCK_ERASE 0x08000000
+#define NCMD_DEV_ID_READ 0x07000000
+#define NCMD_COPY_BACK 0x06000000
+#define NCMD_PROGRAM_SPARE 0x05000000
+#define NCMD_PROGRAM_PAGE 0x04000000
+#define NCMD_STS_READ 0x03000000
+#define NCMD_SPARE_READ 0x02000000
+#define NCMD_PAGE_READ 0x01000000
+
+ uint32 NandCmdExtAddr; /* Nand Flash Command Extended Address */
+ uint32 NandCmdAddr; /* Nand Flash Command Address */
+ uint32 NandCmdEndAddr; /* Nand Flash Command End Address */
+ uint32 NandNandBootConfig; /* Nand Flash Boot Config */
+#define NBC_CS_LOCK 0x80000000
+#define NBC_AUTO_DEV_ID_CFG 0x40000000
+#define NBC_WR_PROT_BLK0 0x10000000
+
+ uint32 NandCsNandXor; /* Nand Flash EBI CS Address XOR with */
+ /* 1FC0 Control */
+ uint32 NandReserved;
+ uint32 NandSpareAreaReadOfs0; /* Nand Flash Spare Area Read Bytes 0-3 */
+ uint32 NandSpareAreaReadOfs4; /* Nand Flash Spare Area Read Bytes 4-7 */
+ uint32 NandSpareAreaReadOfs8; /* Nand Flash Spare Area Read Bytes 8-11 */
+ uint32 NandSpareAreaReadOfsC; /* Nand Flash Spare Area Read Bytes 12-15*/
+ uint32 NandSpareAreaWriteOfs0; /* Nand Flash Spare Area Write Bytes 0-3 */
+ uint32 NandSpareAreaWriteOfs4; /* Nand Flash Spare Area Write Bytes 4-7 */
+ uint32 NandSpareAreaWriteOfs8; /* Nand Flash Spare Area Write Bytes 8-11*/
+ uint32 NandSpareAreaWriteOfsC; /* Nand Flash Spare Area Write Bytes12-15*/
+ uint32 NandAccControl; /* Nand Flash Access Control */
+ uint32 NandConfig; /* Nand Flash Config */
+#define NC_CONFIG_LOCK 0x80000000
+#define NC_PG_SIZE_MASK 0x40000000
+#define NC_PG_SIZE_2K 0x40000000
+#define NC_PG_SIZE_512B 0x00000000
+#define NC_BLK_SIZE_MASK 0x30000000
+#define NC_BLK_SIZE_512K 0x30000000
+#define NC_BLK_SIZE_128K 0x10000000
+#define NC_BLK_SIZE_16K 0x00000000
+#define NC_BLK_SIZE_8K 0x20000000
+#define NC_DEV_SIZE_MASK 0x0f000000
+#define NC_DEV_SIZE_SHIFT 24
+#define NC_DEV_WIDTH_MASK 0x00800000
+#define NC_DEV_WIDTH_16 0x00800000
+#define NC_DEV_WIDTH_8 0x00000000
+#define NC_FUL_ADDR_MASK 0x00070000
+#define NC_FUL_ADDR_SHIFT 16
+#define NC_BLK_ADDR_MASK 0x00000700
+#define NC_BLK_ADDR_SHIFT 8
+
+ uint32 NandTiming1; /* Nand Flash Timing Parameters 1 */
+ uint32 NandTiming2; /* Nand Flash Timing Parameters 2 */
+ uint32 NandSemaphore; /* Semaphore */
+ uint32 NandFlashDeviceId; /* Nand Flash Device ID */
+ uint32 NandBlockLockStatus; /* Nand Flash Block Lock Status */
+ uint32 NandIntfcStatus; /* Nand Flash Interface Status */
+#define NIS_CTLR_READY 0x80000000
+#define NIS_FLASH_READY 0x40000000
+#define NIS_CACHE_VALID 0x20000000
+#define NIS_SPARE_VALID 0x10000000
+#define NIS_FLASH_STS_MASK 0x000000ff
+#define NIS_WRITE_PROTECT 0x00000080
+#define NIS_DEV_READY 0x00000040
+#define NIS_PGM_ERASE_ERROR 0x00000001
+
+ uint32 NandEccCorrExtAddr; /* ECC Correctable Error Extended Address*/
+ uint32 NandEccCorrAddr; /* ECC Correctable Error Address */
+ uint32 NandEccUncExtAddr; /* ECC Uncorrectable Error Extended Addr */
+ uint32 NandEccUncAddr; /* ECC Uncorrectable Error Address */
+ uint32 NandFlashReadExtAddr; /* Flash Read Data Extended Address */
+ uint32 NandFlashReadAddr; /* Flash Read Data Address */
+ uint32 NandProgramPageExtAddr; /* Page Program Extended Address */
+ uint32 NandProgramPageAddr; /* Page Program Address */
+ uint32 NandCopyBackExtAddr; /* Copy Back Extended Address */
+ uint32 NandCopyBackAddr; /* Copy Back Address */
+ uint32 NandBlockEraseExtAddr; /* Block Erase Extended Address */
+ uint32 NandBlockEraseAddr; /* Block Erase Address */
+ uint32 NandInvReadExtAddr; /* Flash Invalid Data Extended Address */
+ uint32 NandInvReadAddr; /* Flash Invalid Data Address */
+ uint32 NandBlkWrProtect; /* Block Write Protect Enable and Size */
+ /* for EBI_CS0b */
+} NandCtrlRegs;
+
+#define NAND ((volatile NandCtrlRegs * const) NAND_REG_BASE)
+
+#define NAND_CACHE ((volatile uint8 * const) NAND_CACHE_BASE)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/shared/broadcom/include/bcm963xx/6816_common.h b/shared/broadcom/include/bcm963xx/6816_common.h
new file mode 100755
index 0000000..8c8c2ff
--- /dev/null
+++ b/shared/broadcom/include/bcm963xx/6816_common.h
@@ -0,0 +1,351 @@
+/*
+<:copyright-broadcom
+
+ Copyright (c) 2007 Broadcom Corporation
+ All Rights Reserved
+ No portions of this material may be reproduced in any form without the
+ written permission of:
+ Broadcom Corporation
+ 16215 Alton Parkway
+ Irvine, California 92619
+ All information contained in this document is Broadcom Corporation
+ company private, proprietary, and trade secret.
+
+:>
+*/
+/***********************************************************************/
+/* */
+/* MODULE: 6816_common.h */
+/* DATE: 02/01/08 */
+/* PURPOSE: Define addresses of major hardware components of */
+/* BCM6816 */
+/* */
+/***********************************************************************/
+#ifndef __BCM6816_MAP_COMMON_H
+#define __BCM6816_MAP_COMMON_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define PERF_BASE 0xb0000000 /* chip control registers */
+#define TIMR_BASE 0xb0000040 /* timer registers */
+#define NAND_INTR_BASE 0xb0000070
+#define GPIO_BASE 0xb0000080 /* gpio registers */
+#define UART_BASE 0xb0000100 /* uart registers */
+#define UART1_BASE 0xb0000120 /* uart registers */
+#define I2C_BASE 0xb0000180
+#define OTP_BASE 0xb0000400
+#define UBUS_STAT_BASE 0xb0000500
+#define SPI_BASE 0xb0000800 /* SPI master controller registers */
+#define HSSPIM_BASE 0xb0001000
+#define MISC_BASE 0xb0001800
+#define NAND_REG_BASE 0xb0002000 /* NAND control registers */
+#define MPI_BASE 0xb00020A0 /* MPI control registers */
+#define PCI_BASE 0xb0002100 /* PCI control registers */
+#define NAND_CACHE_BASE 0xb0002200
+#define USB_CTL_BASE 0xb0002400 /* USB 2.0 device control registers */
+#define USB_EHCI_BASE 0x10002500 /* USB host registers */
+#define USB_OHCI_BASE 0x10002600 /* USB host registers */
+#define USBH_CFG_BASE 0xb0002700
+#define IPSEC_BASE 0xb0002800
+#define DDR_BASE 0xb0003000 /* Memory control registers */
+#define GPON_BASE 0xb0004000
+#define APM_BASE 0xb0008000
+#define PCM_BASE 0xb0008200
+#define APM_HVG_BASE 0xb0008300
+#define APM_IUDMA_BASE 0xb0008800
+#define BMU_BASE 0xb0009000 /* fff9D000-fff9Dfff */
+#define USB_DMA_BASE 0xb000c000 /* USB 2.0 device DMA regiseters */
+#define GPON_DMA_BASE 0xb000c800
+#define IPSEC_DMA_BASE 0xb000d000
+#define SWITCH_DMA_BASE 0xb000d800
+#define SWITCH_DMA_CONFIG 0xb000da00
+#define SWITCH_DMA_STATE 0xb000dc00
+#define APM_MEM_BASE 0xb0010000
+#define MOCA_MEM_BASE 0xb0d00000
+#define MOCA_IO_BASE 0xb0d80000
+#define SWITCH_BASE 0xb0e00000
+#define PCIE_MEM65K_BASE 0xb0e40000
+#define PCIE_MEM1M_BASE 0xb0f00000
+
+/*
+#####################################################################
+# System PLL Control Register
+#####################################################################
+*/
+
+/*
+#####################################################################
+# GPIO Control Registers
+#####################################################################
+*/
+#define GPIO_SWREG_CONFIG 0x1c
+#define GPIO_LIN_VREG_ADJ_SHIFT 0x0
+#define GPIO_LIN_VREG_ADJ_MASK (0xf<<GPIO_LIN_VREG_ADJ_SHIFT)
+#define GPIO_SW_VREG_SEL_SHIFT 0x8
+#define GPIO_SW_VREG_SEL_MASK (0xf<<GPIO_SW_VREG_SEL_SHIFT)
+
+/*
+#####################################################################
+# Miscellaneous Registers
+#####################################################################
+*/
+#define MISC_MEMC_CONTROL 0x10
+#define MISC_STRAP_BUS 0x14
+#define MISC_STRAP_BUS_MIPS_PLL_FVCO_SHIFT 27
+
+/*
+#####################################################################
+# Memory Control Registers
+#####################################################################
+*/
+#define DDR_CTL_CNFG 0x000
+#define DDR_CTL_CSST 0x004
+#define DDR_CTL_CSEND 0x008
+#define DDR_CTL_ROW00_0 0x010
+#define DDR_CTL_ROW00_1 0x014
+#define DDR_CTL_ROW01_0 0x018
+#define DDR_CTL_ROW01_1 0x01c
+#define DDR_CTL_ROW20_0 0x030
+#define DDR_CTL_ROW20_1 0x034
+#define DDR_CTL_ROW21_0 0x038
+#define DDR_CTL_ROW21_1 0x03c
+#define DDR_CTL_COL00_0 0x050
+#define DDR_CTL_COL00_1 0x054
+#define DDR_CTL_COL01_0 0x058
+#define DDR_CTL_COL01_1 0x05c
+#define DDR_CTL_COL20_0 0x070
+#define DDR_CTL_COL20_1 0x074
+#define DDR_CTL_COL21_0 0x078
+#define DDR_CTL_COL21_1 0x07c
+#define DDR_CTL_BNK10 0x090
+#define DDR_CTL_BNK32 0x094
+#define DDR_CTL_DCMD 0x100
+#define DDR_CTL_DMODE_0 0x104
+#define DDR_CTL_DMODE_1 0x108
+#define DDR_CTL_CLKS 0x10c
+#define DDR_CTL_ODT 0x110
+#define DDR_CTL_TIM1_0 0x114
+#define DDR_CTL_TIM1_1 0x118
+#define DDR_CTL_TIM2 0x11c
+#define DDR_CTL_CTL_CRC 0x120
+#define DDR_CTL_DOUT_CRC 0x124
+#define DDR_CTL_DIN_CRC 0x128
+#define PHY_CONTROL_REGS_REVISION 0x200
+#define PHY_CONTROL_REGS_CLK_PM_CTRL 0x204
+#define PHY_CONTROL_REGS_PLL_STATUS 0x210
+#define PHY_CONTROL_REGS_PLL_CONFIG 0x214
+#define PHY_CONTROL_REGS_PLL_PRE_DIVIDER 0x218
+#define PHY_CONTROL_REGS_PLL_DIVIDER 0x21c
+#define PHY_CONTROL_REGS_PLL_CONTROL1 0x220
+#define PHY_CONTROL_REGS_PLL_CONTROL2 0x224
+#define PHY_CONTROL_REGS_PLL_SS_EN 0x228
+#define PHY_CONTROL_REGS_PLL_SS_CFG 0x22c
+#define PHY_CONTROL_REGS_STATIC_VDL_OVERRIDE 0x230
+#define PHY_CONTROL_REGS_DYNAMIC_VDL_OVERRIDE 0x234
+#define PHY_CONTROL_REGS_IDLE_PAD_CONTROL 0x238
+#define PHY_CONTROL_REGS_ZQ_PVT_COMP_CTL 0x23c
+#define PHY_CONTROL_REGS_DRIVE_PAD_CTL 0x240
+#define PHY_BYTE_LANE_0_REVISION 0x300
+#define PHY_BYTE_LANE_0_VDL_CALIBRATE 0x304
+#define PHY_BYTE_LANE_0_VDL_STATUS 0x308
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_0 0x310
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_1 0x314
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_2 0x318
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_3 0x31c
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_4 0x320
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_5 0x324
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_6 0x328
+#define PHY_BYTE_LANE_0_VDL_OVERRIDE_7 0x32c
+#define PHY_BYTE_LANE_0_READ_CONTROL 0x330
+#define PHY_BYTE_LANE_0_READ_FIFO_STATUS 0x334
+#define PHY_BYTE_LANE_0_READ_FIFO_CLEAR 0x338
+#define PHY_BYTE_LANE_0_IDLE_PAD_CONTROL 0x33c
+#define PHY_BYTE_LANE_0_DRIVE_PAD_CTL 0x340
+#define PHY_BYTE_LANE_0_CLOCK_PAD_DISABLE 0x344
+#define PHY_BYTE_LANE_0_WR_PREAMBLE_MODE 0x348
+#define PHY_BYTE_LANE_1_REVISION 0x400
+#define PHY_BYTE_LANE_1_VDL_CALIBRATE 0x404
+#define PHY_BYTE_LANE_1_VDL_STATUS 0x408
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_0 0x410
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_1 0x414
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_2 0x418
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_3 0x41c
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_4 0x420
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_5 0x424
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_6 0x428
+#define PHY_BYTE_LANE_1_VDL_OVERRIDE_7 0x42c
+#define PHY_BYTE_LANE_1_READ_CONTROL 0x430
+#define PHY_BYTE_LANE_1_READ_FIFO_STATUS 0x434
+#define PHY_BYTE_LANE_1_READ_FIFO_CLEAR 0x438
+#define PHY_BYTE_LANE_1_IDLE_PAD_CONTROL 0x43c
+#define PHY_BYTE_LANE_1_DRIVE_PAD_CTL 0x440
+#define PHY_BYTE_LANE_1_CLOCK_PAD_DISABLE 0x444
+#define PHY_BYTE_LANE_1_WR_PREAMBLE_MODE 0x448
+#define PHY_BYTE_LANE_2_REVISION 0x500
+#define PHY_BYTE_LANE_2_VDL_CALIBRATE 0x504
+#define PHY_BYTE_LANE_2_VDL_STATUS 0x508
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_0 0x510
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_1 0x514
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_2 0x518
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_3 0x51c
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_4 0x520
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_5 0x524
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_6 0x528
+#define PHY_BYTE_LANE_2_VDL_OVERRIDE_7 0x52c
+#define PHY_BYTE_LANE_2_READ_CONTROL 0x530
+#define PHY_BYTE_LANE_2_READ_FIFO_STATUS 0x534
+#define PHY_BYTE_LANE_2_READ_FIFO_CLEAR 0x538
+#define PHY_BYTE_LANE_2_IDLE_PAD_CONTROL 0x53c
+#define PHY_BYTE_LANE_2_DRIVE_PAD_CTL 0x540
+#define PHY_BYTE_LANE_2_CLOCK_PAD_DISABLE 0x544
+#define PHY_BYTE_LANE_2_WR_PREAMBLE_MODE 0x548
+#define PHY_BYTE_LANE_3_REVISION 0x600
+#define PHY_BYTE_LANE_3_VDL_CALIBRATE 0x604
+#define PHY_BYTE_LANE_3_VDL_STATUS 0x608
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_0 0x610
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_1 0x614
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_2 0x618
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_3 0x61c
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_4 0x620
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_5 0x624
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_6 0x628
+#define PHY_BYTE_LANE_3_VDL_OVERRIDE_7 0x62c
+#define PHY_BYTE_LANE_3_READ_CONTROL 0x630
+#define PHY_BYTE_LANE_3_READ_FIFO_STATUS 0x634
+#define PHY_BYTE_LANE_3_READ_FIFO_CLEAR 0x638
+#define PHY_BYTE_LANE_3_IDLE_PAD_CONTROL 0x63c
+#define PHY_BYTE_LANE_3_DRIVE_PAD_CTL 0x640
+#define PHY_BYTE_LANE_3_CLOCK_PAD_DISABLE 0x644
+#define PHY_BYTE_LANE_3_WR_PREAMBLE_MODE 0x648
+#define DDR_CTL_GCFG 0x800
+#define DDR_CTL_LBIST_CFG 0x804
+#define DDR_CTL_LBIST_SEED 0x808
+#define DDR_CTL_ARB 0x80c
+#define DDR_CTL_PI_GCF 0x810
+#define DDR_CTL_PI_UBUS_CTL 0x814
+#define DDR_CTL_PI_MIPS_CTL 0x818
+#define DDR_CTL_PI_DSL_MIPS_CTL 0x81c
+#define DDR_CTL_PI_DSL_PHY_CTL 0x820
+#define DDR_CTL_PI_UBUS_ST 0x824
+#define DDR_CTL_PI_MIPS_ST 0x828
+#define DDR_CTL_PI_DSL_MIPS_ST 0x82c
+#define DDR_CTL_PI_DSL_PHY_ST 0x830
+#define DDR_CTL_PI_UBUS_SMPL 0x834
+#define DDR_CTL_TESTMODE 0x838
+#define DDR_CTL_TEST_CFG1 0x83c
+#define DDR_CTL_TEST_PAT 0x840
+#define DDR_CTL_TEST_COUNT 0x844
+#define DDR_CTL_TEST_CURR_COUNT 0x848
+#define DDR_CTL_TEST_ADDR_UPDT 0x84c
+#define DDR_CTL_TEST_ADDR 0x850
+#define DDR_CTL_TEST_DATA0 0x854
+#define DDR_CTL_TEST_DATA1 0x858
+#define DDR_CTL_TEST_DATA2 0x85c
+#define DDR_CTL_TEST_DATA3 0x860
+
+/*
+#####################################################################
+# MPI Control Registers
+#####################################################################
+*/
+#define CS0BASE 0x00
+#define CS0CNTL 0x04
+
+/*
+# CSxBASE settings
+# Size in low 4 bits
+# Base Address for match in upper 24 bits
+#
+# TBD - Is it 8K to 256M or 4K to 128M?
+#
+*/
+#define EBI_SIZE_8K 0
+#define EBI_SIZE_16K 1
+#define EBI_SIZE_32K 2
+#define EBI_SIZE_64K 3
+#define EBI_SIZE_128K 4
+#define EBI_SIZE_256K 5
+#define EBI_SIZE_512K 6
+#define EBI_SIZE_1M 7
+#define EBI_SIZE_2M 8
+#define EBI_SIZE_4M 9
+#define EBI_SIZE_8M 10
+#define EBI_SIZE_16M 11
+#define EBI_SIZE_32M 12
+#define EBI_SIZE_64M 13
+#define EBI_SIZE_128M 14
+#define EBI_SIZE_256M 15
+
+/* CSxCNTL settings */
+/* TBD. Verify these definitions on BCM6816 */
+#define EBI_ENABLE 0x00000001 /* .. enable this range */
+#define EBI_WAIT_STATES 0x0000000e /* .. mask for wait states */
+#define ZEROWT 0x00000000 /* .. 0 WS */
+#define ONEWT 0x00000002 /* .. 1 WS */
+#define TWOWT 0x00000004 /* .. 2 WS */
+#define THREEWT 0x00000006 /* .. 3 WS */
+#define FOURWT 0x00000008 /* .. 4 WS */
+#define FIVEWT 0x0000000a /* .. 5 WS */
+#define SIXWT 0x0000000c /* .. 6 WS */
+#define SEVENWT 0x0000000e /* .. 7 WS */
+#define EBI_WORD_WIDE 0x00000010 /* .. 16-bit peripheral, else 8 */
+#define EBI_TS_TA_MODE 0x00000080 /* .. use TS/TA mode */
+#define EBI_TS_SEL 0x00000100 /* .. drive tsize, not bs_b */
+#define EBI_FIFO 0x00000200 /* .. enable fifo */
+#define EBI_RE 0x00000400 /* .. Reverse Endian */
+
+/*
+#####################################################################
+# UART Control Registers
+#####################################################################
+*/
+/* TBD. Verify these definitions on BCM6816 */
+#define UART0CONTROL 0x01
+#define UART0CONFIG 0x02
+#define UART0RXTIMEOUT 0x03
+#define UART0BAUD 0x04
+#define UART0FIFOCFG 0x0a
+#define UART0INTMASK 0x10
+#define UART0INTSTAT 0x12
+#define UART0DATA 0x17
+
+#define BRGEN 0x80 /* Control register bit defs */
+#define TXEN 0x40
+#define RXEN 0x20
+#define LOOPBK 0x10
+#define TXPARITYEN 0x08
+#define TXPARITYEVEN 0x04
+#define RXPARITYEN 0x02
+#define RXPARITYEVEN 0x01
+
+#define XMITBREAK 0x40 /* Config register */
+#define BITS5SYM 0x00
+#define BITS6SYM 0x10
+#define BITS7SYM 0x20
+#define BITS8SYM 0x30
+#define ONESTOP 0x07
+#define TWOSTOP 0x0f
+
+#define DELTAIP 0x0001
+#define TXUNDERR 0x0002
+#define TXOVFERR 0x0004
+#define TXFIFOTHOLD 0x0008
+#define TXREADLATCH 0x0010
+#define TXFIFOEMT 0x0020
+#define RXUNDERR 0x0040
+#define RXOVFERR 0x0080
+#define RXTIMEOUT 0x0100
+#define RXFIFOFULL 0x0200
+#define RXFIFOTHOLD 0x0400
+#define RXFIFONE 0x0800
+#define RXFRAMERR 0x1000
+#define RXPARERR 0x2000
+#define RXBRK 0x4000
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/shared/broadcom/include/bcm963xx/6816_map.h b/shared/broadcom/include/bcm963xx/6816_map.h
new file mode 100755
index 0000000..6b93307
--- /dev/null
+++ b/shared/broadcom/include/bcm963xx/6816_map.h
@@ -0,0 +1,2322 @@
+/*
+<:copyright-broadcom
+
+ Copyright (c) 2007 Broadcom Corporation
+ All Rights Reserved
+ No portions of this material may be reproduced in any form without the
+ written permission of:
+ Broadcom Corporation
+ 16215 Alton Parkway
+ Irvine, California 92619
+ All information contained in this document is Broadcom Corporation
+ company private, proprietary, and trade secret.
+
+:>
+*/
+/***********************************************************************/
+/* */
+/* MODULE: 6816_map.h */
+/* DATE: 05/30/08 */
+/* PURPOSE: Define addresses of major hardware components of */
+/* BCM6816 */
+/* */
+/***********************************************************************/
+#ifndef __BCM6816_MAP_H
+#define __BCM6816_MAP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "bcmtypes.h"
+#include "6816_common.h"
+#include "6816_intr.h"
+
+/* macro to convert logical data addresses to physical */
+/* DMA hardware must see physical address */
+#define LtoP( x ) ( (uint32)x & 0x1fffffff )
+#define PtoL( x ) ( LtoP(x) | 0xa0000000 )
+
+typedef struct DDRPhyControl {
+ uint32 REVISION; /* 0x00 */
+ uint32 CLK_PM_CTRL; /* 0x04 */
+ uint32 unused0[2]; /* 0x08-0x10 */
+ uint32 PLL_STATUS; /* 0x10 */
+ uint32 PLL_CONFIG; /* 0x14 */
+ uint32 PLL_PRE_DIVIDER; /* 0x18 */
+ uint32 PLL_DIVIDER; /* 0x1c */
+ uint32 PLL_CONTROL1; /* 0x20 */
+ uint32 PLL_CONTROL2; /* 0x24 */
+ uint32 PLL_SS_EN; /* 0x28 */
+ uint32 PLL_SS_CFG; /* 0x2c */
+ uint32 STATIC_VDL_OVERRIDE; /* 0x30 */
+ uint32 DYNAMIC_VDL_OVERRIDE; /* 0x34 */
+ uint32 IDLE_PAD_CONTROL; /* 0x38 */
+ uint32 ZQ_PVT_COMP_CTL; /* 0x3c */
+ uint32 DRIVE_PAD_CTL; /* 0x40 */
+ uint32 CLOCK_REG_CONTROL; /* 0x44 */
+ uint32 unused1[46];
+} DDRPhyControl;
+
+typedef struct DDRPhyByteLaneControl {
+ uint32 REVISION; /* 0x00 */
+ uint32 VDL_CALIBRATE; /* 0x04 */
+ uint32 VDL_STATUS; /* 0x08 */
+ uint32 unused; /* 0x0c */
+ uint32 VDL_OVERRIDE_0; /* 0x10 */
+ uint32 VDL_OVERRIDE_1; /* 0x14 */
+ uint32 VDL_OVERRIDE_2; /* 0x18 */
+ uint32 VDL_OVERRIDE_3; /* 0x1c */
+ uint32 VDL_OVERRIDE_4; /* 0x20 */
+ uint32 VDL_OVERRIDE_5; /* 0x24 */
+ uint32 VDL_OVERRIDE_6; /* 0x28 */
+ uint32 VDL_OVERRIDE_7; /* 0x2c */
+ uint32 READ_CONTROL; /* 0x30 */
+ uint32 READ_FIFO_STATUS; /* 0x34 */
+ uint32 READ_FIFO_CLEAR; /* 0x38 */
+ uint32 IDLE_PAD_CONTROL; /* 0x3c */
+ uint32 DRIVE_PAD_CTL; /* 0x40 */
+ uint32 CLOCK_PAD_DISABLE; /* 0x44 */
+ uint32 WR_PREAMBLE_MODE; /* 0x48 */
+ uint32 CLOCK_REG_CONTROL; /* 0x4C */
+ uint32 unused0[44];
+} DDRPhyByteLaneControl;
+
+typedef struct DDRControl {
+ uint32 CNFG; /* 0x000 */
+ uint32 CSST; /* 0x004 */
+ uint32 CSEND; /* 0x008 */
+ uint32 unused; /* 0x00c */
+ uint32 ROW00_0; /* 0x010 */
+ uint32 ROW00_1; /* 0x014 */
+ uint32 ROW01_0; /* 0x018 */
+ uint32 ROW01_1; /* 0x01c */
+ uint32 unused0[4];
+ uint32 ROW20_0; /* 0x030 */
+ uint32 ROW20_1; /* 0x034 */
+ uint32 ROW21_0; /* 0x038 */
+ uint32 ROW21_1; /* 0x03c */
+ uint32 unused1[4];
+ uint32 COL00_0; /* 0x050 */
+ uint32 COL00_1; /* 0x054 */
+ uint32 COL01_0; /* 0x058 */
+ uint32 COL01_1; /* 0x05c */
+ uint32 unused2[4];
+ uint32 COL20_0; /* 0x070 */
+ uint32 COL20_1; /* 0x074 */
+ uint32 COL21_0; /* 0x078 */
+ uint32 COL21_1; /* 0x07c */
+ uint32 unused3[4];
+ uint32 BNK10; /* 0x090 */
+ uint32 BNK32; /* 0x094 */
+ uint32 unused4[26];
+ uint32 DCMD; /* 0x100 */
+#define DCMD_CS1 (1 << 5)
+#define DCMD_CS0 (1 << 4)
+#define DCMD_SET_SREF 4
+ uint32 DMODE_0; /* 0x104 */
+ uint32 DMODE_1; /* 0x108 */
+#define DMODE_1_DRAMSLEEP (1 << 11)
+ uint32 CLKS; /* 0x10c */
+ uint32 ODT; /* 0x110 */
+ uint32 TIM1_0; /* 0x114 */
+ uint32 TIM1_1; /* 0x118 */
+ uint32 TIM2; /* 0x11c */
+ uint32 CTL_CRC; /* 0x120 */
+ uint32 DOUT_CRC; /* 0x124 */
+ uint32 DIN_CRC; /* 0x128 */
+ uint32 unused5[53];
+
+ DDRPhyControl PhyControl; /* 0x200 */
+ DDRPhyByteLaneControl PhyByteLane0Control; /* 0x300 */
+ DDRPhyByteLaneControl PhyByteLane1Control; /* 0x400 */
+ DDRPhyByteLaneControl PhyByteLane2Control; /* 0x500 */
+ DDRPhyByteLaneControl PhyByteLane3Control; /* 0x600 */
+ uint32 unused6[64];
+
+ uint32 GCFG; /* 0x800 */
+ uint32 LBIST_CFG; /* 0x804 */
+ uint32 LBIST_SEED; /* 0x808 */
+ uint32 ARB; /* 0x80c */
+ uint32 PI_GCF; /* 0x810 */
+ uint32 PI_UBUS_CTL; /* 0x814 */
+ uint32 PI_MIPS_CTL; /* 0x818 */
+ uint32 PI_DSL_MIPS_CTL; /* 0x81c */
+ uint32 PI_DSL_PHY_CTL; /* 0x820 */
+ uint32 PI_UBUS_ST; /* 0x824 */
+ uint32 PI_MIPS_ST; /* 0x828 */
+ uint32 PI_DSL_MIPS_ST; /* 0x82c */
+ uint32 PI_DSL_PHY_ST; /* 0x830 */
+ uint32 PI_UBUS_SMPL; /* 0x834 */
+ uint32 TESTMODE; /* 0x838 */
+ uint32 TEST_CFG1; /* 0x83c */
+ uint32 TEST_PAT; /* 0x840 */
+ uint32 TEST_COUNT; /* 0x844 */
+ uint32 TEST_CURR_COUNT; /* 0x848 */
+ uint32 TEST_ADDR_UPDT; /* 0x84c */
+ uint32 TEST_ADDR; /* 0x850 */
+ uint32 TEST_DATA0; /* 0x854 */
+ uint32 TEST_DATA1; /* 0x858 */
+ uint32 TEST_DATA2; /* 0x85c */
+ uint32 TEST_DATA3; /* 0x860 */
+} DDRControl;
+
+#define DDR ((volatile DDRControl * const) DDR_BASE)
+
+/*
+** Peripheral Controller
+*/
+
+#define IRQ_BITS 64
+typedef struct {
+ uint64 IrqMask;
+ uint64 IrqStatus;
+} IrqControl_t;
+
+typedef struct PerfControl {
+ uint32 RevID; /* (00) word 0 */
+ uint32 blkEnables; /* (04) word 1 */
+#define ACP_A_CLK_EN (1 << 25)
+#define ACP_B_CLK_EN (1 << 24)
+#define NTP_CLK_EN (1 << 23)
+#define PCM_CLK_EN (1 << 22)
+#define BMU_CLK_EN (1 << 21)
+#define PCIE_CLK_EN (1 << 20)
+#define GPON_SER_CLK_EN (1 << 19)
+#define IPSEC_CLK_EN (1 << 18)
+#define NAND_CLK_EN (1 << 17)
+#define DISABLE_GLESS (1 << 16)
+#define USBH_CLK_EN (1 << 15)
+#define APM_CLK_EN (1 << 14)
+#define ROBOSW_CLK_EN (1 << 12)
+#define USBD_CLK_EN (1 << 10)
+#define SPI_CLK_EN (1 << 9)
+#define SWPKT_GPON_CLK_EN (1 << 8)
+#define SWPKT_USB_CLK_EN (1 << 7)
+#define GPON_CLK_EN (1 << 6)
+
+ uint32 pll_control; /* (08) word 2 */
+#define SOFT_RESET 0x00000001 // 0
+
+ uint32 deviceTimeoutEn; /* (0c) word 3 */
+ uint32 softResetB; /* (10) word 4 */
+#define SOFT_RST_SERDES_DIG (1 << 23)
+#define SOFT_RST_SERDES (1 << 22)
+#define SOFT_RST_SERDES_MDIO (1 << 21)
+#define SOFT_RST_SERDES_PLL (1 << 20)
+#define SOFT_RST_SERDES_HW (1 << 19)
+#define SOFT_RST_GPON (1 << 18)
+#define SOFT_RST_BMU (1 << 17)
+#define SOFT_RST_HVG (1 << 16)
+#define SOFT_RST_APM (1 << 15)
+#define SOFT_RST_ACP (1 << 14)
+#define SOFT_RST_PCM (1 << 13)
+#define SOFT_RST_USBH (1 << 12)
+#define SOFT_RST_USBD (1 << 11)
+#define SOFT_RST_SWITCH (1 << 10)
+#define SOFT_RST_MOCA_CPU (1 << 9)
+#define SOFT_RST_MOCA_SYS (1 << 8)
+#define SOFT_RST_MOCA (1 << 7)
+#define SOFT_RST_EPHY (1 << 6)
+#define SOFT_RST_PCIE (1 << 5)
+#define SOFT_RST_IPSEC (1 << 4)
+#define SOFT_RST_MPI (1 << 3)
+#define SOFT_RST_PCIE_EXT (1 << 2)
+#define SOFT_RST_PCIE_CORE (1 << 1)
+#define SOFT_RST_SPI (1 << 0)
+
+ uint32 diagControl; /* (14) word 5 */
+ uint32 ExtIrqCfg; /* (18) word 6*/
+ uint32 ExtIrqCfg1; /* (1c) word 7 */
+#define EI_SENSE_SHFT 0
+#define EI_STATUS_SHFT 4
+#define EI_CLEAR_SHFT 8
+#define EI_MASK_SHFT 12
+#define EI_INSENS_SHFT 16
+#define EI_LEVEL_SHFT 20
+
+ IrqControl_t IrqControl[2];
+} PerfControl;
+
+#define PERF ((volatile PerfControl * const) PERF_BASE)
+
+/*
+** Timer
+*/
+typedef struct Timer {
+ uint16 unused0;
+ byte TimerMask;
+#define TIMER0EN 0x01
+#define TIMER1EN 0x02
+#define TIMER2EN 0x04
+ byte TimerInts;
+#define TIMER0 0x01
+#define TIMER1 0x02
+#define TIMER2 0x04
+#define WATCHDOG 0x08
+ uint32 TimerCtl0;
+ uint32 TimerCtl1;
+ uint32 TimerCtl2;
+#define TIMERENABLE 0x80000000
+#define RSTCNTCLR 0x40000000
+ uint32 TimerCnt0;
+ uint32 TimerCnt1;
+ uint32 TimerCnt2;
+ uint32 WatchDogDefCount;
+
+ /* Write 0xff00 0x00ff to Start timer
+ * Write 0xee00 0x00ee to Stop and re-load default count
+ * Read from this register returns current watch dog count
+ */
+ uint32 WatchDogCtl;
+
+ /* Number of 50-MHz ticks for WD Reset pulse to last */
+ uint32 WDResetCount;
+} Timer;
+
+#define TIMER ((volatile Timer * const) TIMR_BASE)
+
+/*
+** UART
+*/
+typedef struct UartChannel {
+ byte unused0;
+ byte control;
+#define BRGEN 0x80 /* Control register bit defs */
+#define TXEN 0x40
+#define RXEN 0x20
+#define LOOPBK 0x10
+#define TXPARITYEN 0x08
+#define TXPARITYEVEN 0x04
+#define RXPARITYEN 0x02
+#define RXPARITYEVEN 0x01
+
+ byte config;
+#define XMITBREAK 0x40
+#define BITS5SYM 0x00
+#define BITS6SYM 0x10
+#define BITS7SYM 0x20
+#define BITS8SYM 0x30
+#define ONESTOP 0x07
+#define TWOSTOP 0x0f
+ /* 4-LSBS represent STOP bits/char
+ * in 1/8 bit-time intervals. Zero
+ * represents 1/8 stop bit interval.
+ * Fifteen represents 2 stop bits.
+ */
+ byte fifoctl;
+#define RSTTXFIFOS 0x80
+#define RSTRXFIFOS 0x40
+ /* 5-bit TimeoutCnt is in low bits of this register.
+ * This count represents the number of characters
+ * idle times before setting receive Irq when below threshold
+ */
+ uint32 baudword;
+ /* When divide SysClk/2/(1+baudword) we should get 32*bit-rate
+ */
+
+ byte txf_levl; /* Read-only fifo depth */
+ byte rxf_levl; /* Read-only fifo depth */
+ byte fifocfg; /* Upper 4-bits are TxThresh, Lower are
+ * RxThreshold. Irq can be asserted
+ * when rx fifo> thresh, txfifo<thresh
+ */
+ byte prog_out; /* Set value of DTR (Bit0), RTS (Bit1)
+ * if these bits are also enabled to GPIO_o
+ */
+#define DTREN 0x01
+#define RTSEN 0x02
+
+ byte unused1;
+ byte DeltaIPEdgeNoSense; /* Low 4-bits, set corr bit to 1 to
+ * detect irq on rising AND falling
+ * edges for corresponding GPIO_i
+ * if enabled (edge insensitive)
+ */
+ byte DeltaIPConfig_Mask; /* Upper 4 bits: 1 for posedge sense
+ * 0 for negedge sense if
+ * not configured for edge
+ * insensitive (see above)
+ * Lower 4 bits: Mask to enable change
+ * detection IRQ for corresponding
+ * GPIO_i
+ */
+ byte DeltaIP_SyncIP; /* Upper 4 bits show which bits
+ * have changed (may set IRQ).
+ * read automatically clears bit
+ * Lower 4 bits are actual status
+ */
+
+ uint16 intMask; /* Same Bit defs for Mask and status */
+ uint16 intStatus;
+#define DELTAIP 0x0001
+#define TXUNDERR 0x0002
+#define TXOVFERR 0x0004
+#define TXFIFOTHOLD 0x0008
+#define TXREADLATCH 0x0010
+#define TXFIFOEMT 0x0020
+#define RXUNDERR 0x0040
+#define RXOVFERR 0x0080
+#define RXTIMEOUT 0x0100
+#define RXFIFOFULL 0x0200
+#define RXFIFOTHOLD 0x0400
+#define RXFIFONE 0x0800
+#define RXFRAMERR 0x1000
+#define RXPARERR 0x2000
+#define RXBRK 0x4000
+
+ uint16 unused2;
+ uint16 Data; /* Write to TX, Read from RX */
+ /* bits 11:8 are BRK,PAR,FRM errors */
+
+ uint32 unused3;
+ uint32 unused4;
+} Uart;
+
+#define UART ((volatile Uart * const) UART_BASE)
+
+/*
+** Gpio Controller
+*/
+
+typedef struct GpioControl {
+ uint64 GPIODir; /* 0 */
+ uint64 GPIOio; /* 8 */
+#define GPIO_MoCA_OVERLAY_UART_WRITE 39
+#define GPIO_MoCA_OVERLAY_UART_READ 38
+ uint32 LEDCtrl;
+#define LED_ALL_STROBE 0x0f000000
+#define LED3_STROBE 0x08000000
+#define LED2_STROBE 0x04000000
+#define LED1_STROBE 0x02000000
+#define LED0_STROBE 0x01000000
+#define LED_TEST 0x00010000
+#define DISABLE_LINK_ACT_ALL 0x0000f000
+#define DISABLE_LINK_ACT_3 0x00008000
+#define DISABLE_LINK_ACT_2 0x00004000
+#define DISABLE_LINK_ACT_1 0x00002000
+#define DISABLE_LINK_ACT_0 0x00001000
+#define LED_INTERVAL_SET_MASK 0x00000f00
+#define LED_INTERVAL_SET_1280MS 0x00000700
+#define LED_INTERVAL_SET_640MS 0x00000600
+#define LED_INTERVAL_SET_320MS 0x00000500
+#define LED_INTERVAL_SET_160MS 0x00000400
+#define LED_INTERVAL_SET_80MS 0x00000300
+#define LED_INTERVAL_SET_40MS 0x00000200
+#define LED_INTERVAL_SET_20MS 0x00000100
+#define LED_ON_ALL 0x000000f0
+#define LED_ON_3 0x00000080
+#define LED_ON_2 0x00000040
+#define LED_ON_1 0x00000020
+#define LED_ON_0 0x00000010
+#define LED_ENABLE_ALL 0x0000000f
+#define LED_ENABLE_3 0x00000008
+#define LED_ENABLE_2 0x00000004
+#define LED_ENABLE_1 0x00000002
+#define LED_ENABLE_0 0x00000001
+ uint32 SpiSlaveCfg; /* 14 */
+ uint32 GPIOMode; /* 18 */
+#define GPIO_MODE_SPI_SSN5 (1<<31)
+#define GPIO_MODE_SPI_SSN4 (1<<30)
+#define GPIO_MODE_SPI_SSN3 (1<<29)
+#define GPIO_MODE_SPI_SSN2 (1<<28)
+#define GPIO_MODE_EBI_CS3 (1<<27)
+#define GPIO_MODE_EBI_CS2 (1<<26)
+#define GPIO_MODE_APM_CLK (1<<25)
+#define GPIO_MODE_APM_SDIN (1<<24)
+#define GPIO_MODE_APM_SDOUT (1<<23)
+#define GPIO_MODE_APM_FRAME_SYNC (1<<22)
+#define GPIO_MODE_PCI_GNT0 (1<<20)
+#define GPIO_MODE_PCI_REQ0 (1<<19)
+#define GPIO_MODE_PCI_INTB (1<<18)
+#define GPIO_MODE_PCI_GNT1 (1<<17)
+#define GPIO_MODE_PCI_REQ1 (1<<16)
+#define GPIO_MODE_NTR_PULSE (1<<15)
+#define GPIO_MODE_USBD_LED (1<<14)
+#define GPIO_MODE_ROBOSW_LED1 (1<<13)
+#define GPIO_MODE_ROBOSW_LED0 (1<<12)
+#define GPIO_MODE_ROBOSW_LED_CLK (1<<11)
+#define GPIO_MODE_ROBOSW_LED_DATA (1<<10)
+#define GPIO_MODE_GPON_LED (1<<8)
+#define GPIO_MODE_GPHY1_LED (1<<7)
+#define GPIO_MODE_GPHY0_LED (1<<6)
+#define GPIO_MODE_MOCA_LED (1<<5)
+#define GPIO_MODE_SERIAL_LED_CLK (1<<4)
+#define GPIO_MODE_SERIAL_LED_DATA (1<<3)
+#define GPIO_MODE_SYS_IRQ (1<<2)
+#define GPIO_MODE_GPON_TX_APC_FAIL (1<<1) /*Anticipating B0*/
+#define GPIO_MODE_GPON_TX_EN_L (1<<0)
+
+ uint32 VregConfig; /* 1C */
+#define VREG_VSEL1P2_SHIFT 8
+#define VREG_VSEL1P2_MASK (0x0f<<8)
+#define VREG_VSEL1P2_MIDDLE 9
+
+ uint32 AuxLedInterval; /* 20 */
+#define AUX_LED_IN_7 0x80000000
+#define AUX_LED_IN_6 0x40000000
+#define AUX_LED_IN_5 0x20000000
+#define AUX_LED_IN_4 0x10000000
+#define AUX_LED_IN_MASK 0xf0000000
+#define LED_IN_3 0x08000000
+#define LED_IN_2 0x04000000
+#define LED_IN_1 0x02000000
+#define LED_IN_0 0x01000000
+#define AUX_LED_TEST 0x00400000
+#define USE_NEW_INTV 0x00200000
+#define LED7_LNK_ORAND 0x00100000
+#define LED7_LNK_MASK 0x000f0000
+#define LED7_LNK_MASK_SHFT 16
+#define LED7_ACT_MASK 0x0000f000
+#define LED7_ACT_MASK_SHFT 12
+#define AUX_FLASH_INTV 0x00000fc0
+#define AUX_FLASH_INTV_100MS 0x00000140
+#define AUX_FLASH_INTV_SHFT 6
+#define AUX_BLINK_INTV 0x0000003f
+#define AUX_BLINK_INTV_60MS 0x00000003
+ uint32 AuxLedCtrl; /* 24 */
+#define AUX_HW_DISAB_7 0x80000000
+#define AUX_STROBE_7 0x40000000
+#define AUX_MODE_7 0x30000000
+#define AUX_MODE_SHFT_7 28
+#define AUX_HW_DISAB_6 0x08000000
+#define AUX_STROBE_6 0x04000000
+#define AUX_MODE_6 0x03000000
+#define AUX_MODE_SHFT_6 24
+#define AUX_HW_DISAB_5 0x00800000
+#define AUX_STROBE_5 0x00400000
+#define AUX_MODE_5 0x00300000
+#define AUX_MODE_SHFT_5 20
+#define AUX_HW_DISAB_4 0x00080000
+#define AUX_STROBE_4 0x00040000
+#define AUX_MODE_4 0x00030000
+#define AUX_MODE_SHFT_4 16
+#define AUX_HW_DISAB_3 0x00008000
+#define AUX_STROBE_3 0x00004000
+#define AUX_MODE_3 0x00003000
+#define AUX_MODE_SHFT_3 12
+#define AUX_HW_DISAB_2 0x00000800
+#define AUX_STROBE_2 0x00000400
+#define AUX_MODE_2 0x00000300
+#define AUX_MODE_SHFT_2 8
+#define AUX_HW_DISAB_1 0x00000080
+#define AUX_STROBE_1 0x00000040
+#define AUX_MODE_1 0x00000030
+#define AUX_MODE_SHFT_1 4
+#define AUX_HW_DISAB_0 0x00000008
+#define AUX_STROBE_0 0x00000004
+#define AUX_MODE_0 0x00000003
+#define AUX_MODE_SHFT_0 0
+
+#define LED_STEADY_OFF 0x0
+#define LED_FLASH 0x1
+#define LED_BLINK 0x2
+#define LED_STEADY_ON 0x3
+
+ uint32 TestControl; /* 28 */
+
+ uint32 OscControl; /* 2C */
+ uint32 RoboSWLEDControl; /* 30 */
+ uint32 RoboSWLEDLSR; /* 34 */
+ uint32 GPIOBaseMode; /* 38 */
+#define EN_GMII2 (1<<17)
+#define EN_GMII1 (1<<16)
+ uint32 RoboswEphyCtrl; /* 3C */
+#define RSW_HW_FWDG_EN (1<<19)
+#define RSW_MII_DUMB_FWDG_EN (1<<16)
+#define EPHY_RST_4 (1<<9)
+#define EPHY_RST_3 (1<<8)
+#define EPHY_RST_2 (1<<7)
+#define EPHY_RST_1 (1<<6)
+#define EPHY_PWR_DOWN_4 (1<<5)
+#define EPHY_PWR_DOWN_3 (1<<4)
+#define EPHY_PWR_DOWN_2 (1<<3)
+#define EPHY_PWR_DOWN_1 (1<<2)
+ uint32 unused1[2]; /* 40 */
+
+ uint32 RingOscCtrl0; /* 48 */
+#define RING_OSC_256_CYCLES 8
+#define RING_OSC_512_CYCLES 9
+#define RING_OSC_1024_CYCLES 10
+
+ uint32 RingOscCtrl1; /* 4C */
+#define RING_OSC_ENABLE_MASK (0x57<<24)
+#define RING_OSC_ENABLE_SHIFT 24
+#define RING_OSC_MAX 7
+#define RING_OSC_COUNT_RESET (0x1<<23)
+#define RING_OSC_SELECT_MASK (0x7<<20)
+#define RING_OSC_SELECT_SHIFT 20
+#define RING_OSC_IRQ (0x1<<18)
+#define RING_OSC_COUNTER_OVERFLOW (0x1<<17)
+#define RING_OSC_COUNTER_BUSY (0x1<<16)
+#define RING_OSC_COUNT_MASK 0x0000ffff
+
+ uint32 SerialLed; /* 50 */
+ uint32 SerialLedCtrl; /* 54 */
+#define SER_LED_BUSY (1<<3)
+#define SER_LED_POLARITY (1<<2)
+#define SER_LED_DIV_1 0
+#define SER_LED_DIV_2 1
+#define SER_LED_DIV_4 2
+#define SER_LED_DIV_8 3
+#define SER_LED_DIV_MASK 0x3
+#define SER_LED_DIV_SHIFT 0
+ uint32 SerialLedBlink; /* 58 */
+ uint32 SerdesCtl; /* 5c */
+#define SERDES_PCIE_ENABLE 0x00000001
+#define SERDES_PCIE_EXD_ENABLE (1<<15)
+ uint32 SerdesStatus; /* 60 */
+ uint32 unused2; /* 64 */
+ uint32 DieRevID; /* 68 */
+ uint32 DiagMemStatus; /* 6c */
+ uint32 DiagSelControl; /* 70 */
+ uint32 DiagReadBack; /* 74 */
+ uint32 DiagReadBackHi; /* 78 */
+ uint32 DiagMiscControl; /* 7c */
+#define EPHY_SA_RESET_N 0x00000300
+#define EPHY_SA_TESTEN 0x00000500
+#define EPHY_SA_CLOCK_RESET 0x0000d900
+} GpioControl;
+
+#define GPIO ((volatile GpioControl * const) GPIO_BASE)
+
+/* Number to mask conversion macro used for GPIODir and GPIOio */
+#define GPIO_NUM_MAX 40
+#define GPIO_NUM_TO_MASK(X) ( (((X) & BP_GPIO_NUM_MASK) < GPIO_NUM_MAX) ? ((uint64)1 << ((X) & BP_GPIO_NUM_MASK)) : (0) )
+
+/*
+ * I2C Controller.
+ */
+
+typedef struct I2CControl {
+ uint32 ChipAddress; /* 0x0 */
+#define I2C_CHIP_ADDRESS_MASK 0x000000f7
+#define I2C_CHIP_ADDRESS_SHIFT 0x1
+ uint32 DataIn0; /* 0x4 */
+ uint32 DataIn1; /* 0x8 */
+ uint32 DataIn2; /* 0xc */
+ uint32 DataIn3; /* 0x10 */
+ uint32 DataIn4; /* 0x14 */
+ uint32 DataIn5; /* 0x18 */
+ uint32 DataIn6; /* 0x1c */
+ uint32 DataIn7; /* 0x20 */
+ uint32 CntReg; /* 0x24 */
+#define I2C_CNT_REG1_SHIFT 0x0
+#define I2C_CNT_REG2_SHIFT 0x6
+ uint32 CtlReg; /* 0x28 */
+#define I2C_CTL_REG_DTF_MASK 0x00000003
+#define I2C_CTL_REG_DTF_WRITE 0x0
+#define I2C_CTL_REG_DTF_READ 0x1
+#define I2C_CTL_REG_DTF_READ_AND_WRITE 0x2
+#define I2C_CTL_REG_DTF_WRITE_AND_READ 0x3
+#define I2C_CTL_REG_DEGLITCH_DISABLE 0x00000004
+#define I2C_CTL_REG_DELAY_DISABLE 0x00000008
+#define I2C_CTL_REG_SCL_SEL_MASK 0x00000030
+#define I2C_CTL_REG_SCL_CLK_375KHZ 0x00000000
+#define I2C_CTL_REG_SCL_CLK_390KHZ 0x00000010
+#define I2C_CTL_REG_SCL_CLK_187_5KHZ 0x00000020
+#define I2C_CTL_REG_SCL_CLK_200KHZ 0x00000030
+#define I2C_CTL_REG_INT_ENABLE 0x00000040
+#define I2C_CTL_REG_DIV_CLK 0x00000080
+ uint32 IICEnable; /* 0x2c */
+#define I2C_IIC_ENABLE 0x00000001
+#define I2C_IIC_INTRP 0x00000002
+#define I2C_IIC_NO_ACK 0x00000004
+#define I2C_IIC_NO_STOP 0x00000010
+#define I2C_IIC_NO_START 0x00000020
+ uint32 DataOut0; /* 0x30 */
+ uint32 DataOut1; /* 0x34 */
+ uint32 DataOut2; /* 0x38 */
+ uint32 DataOut3; /* 0x3c */
+ uint32 DataOut4; /* 0x40 */
+ uint32 DataOut5; /* 0x44 */
+ uint32 DataOut6; /* 0x48 */
+ uint32 DataOut7; /* 0x4c */
+ uint32 CtlHiReg; /* 0x50 */
+#define I2C_CTLHI_REG_WAIT_DISABLE 0x00000001
+#define I2C_CTLHI_REG_IGNORE_ACK 0x00000002
+#define I2C_CTLHI_REG_DATA_REG_SIZE 0x00000040
+ uint32 SclParam; /* 0x54 */
+} I2CControl;
+
+#define I2C ((volatile I2CControl * const) I2C_BASE)
+
+/*
+** Spi Controller
+*/
+
+typedef struct SpiControl {
+ uint16 spiMsgCtl; /* (0x0) control byte */
+#define FULL_DUPLEX_RW 0
+#define HALF_DUPLEX_W 1
+#define HALF_DUPLEX_R 2
+#define SPI_MSG_TYPE_SHIFT 14
+#define SPI_BYTE_CNT_SHIFT 0
+ byte spiMsgData[0x21e]; /* (0x02 - 0x21f) msg data */
+ byte unused0[0x1e0];
+ byte spiRxDataFifo[0x220]; /* (0x400 - 0x61f) rx data */
+ byte unused1[0xe0];
+
+ uint16 spiCmd; /* (0x700): SPI command */
+#define SPI_CMD_NOOP 0
+#define SPI_CMD_SOFT_RESET 1
+#define SPI_CMD_HARD_RESET 2
+#define SPI_CMD_START_IMMEDIATE 3
+
+#define SPI_CMD_COMMAND_SHIFT 0
+#define SPI_CMD_COMMAND_MASK 0x000f
+
+#define SPI_CMD_DEVICE_ID_SHIFT 4
+#define SPI_CMD_PREPEND_BYTE_CNT_SHIFT 8
+#define SPI_CMD_ONE_BYTE_SHIFT 11
+#define SPI_CMD_ONE_WIRE_SHIFT 12
+#define SPI_DEV_ID_0 0
+#define SPI_DEV_ID_1 1
+#define SPI_DEV_ID_2 2
+#define SPI_DEV_ID_3 3
+
+ byte spiIntStatus; /* (0x702): SPI interrupt status */
+ byte spiMaskIntStatus; /* (0x703): SPI masked interrupt status */
+
+ byte spiIntMask; /* (0x704): SPI interrupt mask */
+#define SPI_INTR_CMD_DONE 0x01
+#define SPI_INTR_RX_OVERFLOW 0x02
+#define SPI_INTR_INTR_TX_UNDERFLOW 0x04
+#define SPI_INTR_TX_OVERFLOW 0x08
+#define SPI_INTR_RX_UNDERFLOW 0x10
+#define SPI_INTR_CLEAR_ALL 0x1f
+
+ byte spiStatus; /* (0x705): SPI status */
+#define SPI_RX_EMPTY 0x02
+#define SPI_CMD_BUSY 0x04
+#define SPI_SERIAL_BUSY 0x08
+
+ byte spiClkCfg; /* (0x706): SPI clock configuration */
+#define SPI_CLK_0_391MHZ 1
+#define SPI_CLK_0_781MHZ 2 /* default */
+#define SPI_CLK_1_563MHZ 3
+#define SPI_CLK_3_125MHZ 4
+#define SPI_CLK_6_250MHZ 5
+#define SPI_CLK_12_50MHZ 6
+#define SPI_CLK_MASK 0x07
+#define SPI_SSOFFTIME_MASK 0x38
+#define SPI_SSOFFTIME_SHIFT 3
+#define SPI_BYTE_SWAP 0x80
+
+ byte spiFillByte; /* (0x707): SPI fill byte */
+ byte unused2;
+ byte spiMsgTail; /* (0x709): msgtail */
+ byte unused3;
+ byte spiRxTail; /* (0x70B): rxtail */
+} SpiControl;
+
+
+#define SPI ((volatile SpiControl * const) SPI_BASE)
+
+
+/*
+** High-Speed SPI Controller
+*/
+
+#define __mask(end, start) (((1 << ((end - start) + 1)) - 1) << start)
+typedef struct HsSpiControl {
+
+ uint32 hs_spiGlobalCtrl; // 0x0000
+#define HS_SPI_MOSI_IDLE (1 << 18)
+#define HS_SPI_CLK_STATE_GATED (1 << 17)
+#define HS_SPI_CLK_GATE_SSOFF (1 << 16)
+#define HS_SPI_PLL_CLK_CTRL (8)
+#define HS_SPI_PLL_CLK_CTRL_MASK __mask(15, HS_SPI_PLL_CLK_CTRL)
+#define HS_SPI_SS_POLARITY (0)
+#define HS_SPI_SS_POLARITY_MASK __mask(7, HS_SPI_SS_POLARITY)
+
+ uint32 hs_spiExtTrigCtrl; // 0x0004
+#define HS_SPI_TRIG_RAW_STATE (24)
+#define HS_SPI_TRIG_RAW_STATE_MASK __mask(31, HS_SPI_TRIG_RAW_STATE)
+#define HS_SPI_TRIG_LATCHED (16)
+#define HS_SPI_TRIG_LATCHED_MASK __mask(23, HS_SPI_TRIG_LATCHED)
+#define HS_SPI_TRIG_SENSE (8)
+#define HS_SPI_TRIG_SENSE_MASK __mask(15, HS_SPI_TRIG_SENSE)
+#define HS_SPI_TRIG_TYPE (0)
+#define HS_SPI_TRIG_TYPE_MASK __mask(7, HS_SPI_TRIG_TYPE)
+#define HS_SPI_TRIG_TYPE_EDGE (0)
+#define HS_SPI_TRIG_TYPE_LEVEL (1)
+
+ uint32 hs_spiIntStatus; // 0x0008
+#define HS_SPI_IRQ_PING1_USER (28)
+#define HS_SPI_IRQ_PING1_USER_MASK __mask(31, HS_SPI_IRQ_PING1_USER)
+#define HS_SPI_IRQ_PING0_USER (24)
+#define HS_SPI_IRQ_PING0_USER_MASK __mask(27, HS_SPI_IRQ_PING0_USER)
+
+#define HS_SPI_IRQ_PING1_CTRL_INV (1 << 12)
+#define HS_SPI_IRQ_PING1_POLL_TOUT (1 << 11)
+#define HS_SPI_IRQ_PING1_TX_UNDER (1 << 10)
+#define HS_SPI_IRQ_PING1_RX_OVER (1 << 9)
+#define HS_SPI_IRQ_PING1_CMD_DONE (1 << 8)
+
+#define HS_SPI_IRQ_PING0_CTRL_INV (1 << 4)
+#define HS_SPI_IRQ_PING0_POLL_TOUT (1 << 3)
+#define HS_SPI_IRQ_PING0_TX_UNDER (1 << 2)
+#define HS_SPI_IRQ_PING0_RX_OVER (1 << 1)
+#define HS_SPI_IRQ_PING0_CMD_DONE (1 << 0)
+
+ uint32 hs_spiIntStatusMasked; // 0x000C
+#define HS_SPI_IRQSM__PING1_USER (28)
+#define HS_SPI_IRQSM__PING1_USER_MASK __mask(31, HS_SPI_IRQSM__PING1_USER)
+#define HS_SPI_IRQSM__PING0_USER (24)
+#define HS_SPI_IRQSM__PING0_USER_MASK __mask(27, HS_SPI_IRQSM__PING0_USER)
+
+#define HS_SPI_IRQSM__PING1_CTRL_INV (1 << 12)
+#define HS_SPI_IRQSM__PING1_POLL_TOUT (1 << 11)
+#define HS_SPI_IRQSM__PING1_TX_UNDER (1 << 10)
+#define HS_SPI_IRQSM__PING1_RX_OVER (1 << 9)
+#define HS_SPI_IRQSM__PING1_CMD_DONE (1 << 8)
+
+#define HS_SPI_IRQSM__PING0_CTRL_INV (1 << 4)
+#define HS_SPI_IRQSM__PING0_POLL_TOUT (1 << 3)
+#define HS_SPI_IRQSM__PING0_TX_UNDER (1 << 2)
+#define HS_SPI_IRQSM__PING0_RX_OVER (1 << 1)
+#define HS_SPI_IRQSM__PING0_CMD_DONE (1 << 0)
+
+ uint32 hs_spiIntMask; // 0x0010
+#define HS_SPI_IRQM_PING1_USER (28)
+#define HS_SPI_IRQM_PING1_USER_MASK __mask(31, HS_SPI_IRQM_PING1_USER)
+#define HS_SPI_IRQM_PING0_USER (24)
+#define HS_SPI_IRQM_PING0_USER_MASK __mask(27, HS_SPI_IRQM_PING0_USER)
+
+#define HS_SPI_IRQM_PING1_CTRL_INV (1 << 12)
+#define HS_SPI_IRQM_PING1_POLL_TOUT (1 << 11)
+#define HS_SPI_IRQM_PING1_TX_UNDER (1 << 10)
+#define HS_SPI_IRQM_PING1_RX_OVER (1 << 9)
+#define HS_SPI_IRQM_PING1_CMD_DONE (1 << 8)
+
+#define HS_SPI_IRQM_PING0_CTRL_INV (1 << 4)
+#define HS_SPI_IRQM_PING0_POLL_TOUT (1 << 3)
+#define HS_SPI_IRQM_PING0_TX_UNDER (1 << 2)
+#define HS_SPI_IRQM_PING0_RX_OVER (1 << 1)
+#define HS_SPI_IRQM_PING0_CMD_DONE (1 << 0)
+
+#define HS_SPI_INTR_CLEAR_ALL (0xFF001F1F)
+
+ uint32 hs_spiFlashCtrl; // 0x0014
+#define HS_SPI_FCTRL_MB_ENABLE (1 << 23)
+#define HS_SPI_FCTRL_SS_NUM (20)
+#define HS_SPI_FCTRL_SS_NUM_MASK __mask(22, HS_SPI_FCTRL_SS_NUM)
+#define HS_SPI_FCTRL_PROFILE_NUM (16)
+#define HS_SPI_FCTRL_PROFILE_NUM_MASK __mask(18, HS_SPI_FCTRL_PROFILE_NUM)
+#define HS_SPI_FCTRL_DUMMY_BYTES (10)
+#define HS_SPI_FCTRL_DUMMY_BYTES_MASK __mask(11, HS_SPI_FCTRL_DUMMY_BYTES)
+#define HS_SPI_FCTRL_ADDR_BYTES (8)
+#define HS_SPI_FCTRL_ADDR_BYTES_MASK __mask(9, HS_SPI_FCTRL_ADDR_BYTES)
+#define HS_SPI_FCTRL_ADDR_BYTES_2 (0)
+#define HS_SPI_FCTRL_ADDR_BYTES_3 (1)
+#define HS_SPI_FCTRL_ADDR_BYTES_4 (2)
+#define HS_SPI_FCTRL_READ_OPCODE (0)
+#define HS_SPI_FCTRL_READ_OPCODE_MASK __mask(7, HS_SPI_FCTRL_READ_OPCODE)
+
+ uint32 hs_spiFlashAddrBase; // 0x0018
+
+ char fill0[0x80 - 0x18];
+
+ uint32 hs_spiPP_0_Cmd; // 0x0080
+#define HS_SPI_PP_SS_NUM (12)
+#define HS_SPI_PP_SS_NUM_MASK __mask(14, HS_SPI_PP_SS_NUM)
+#define HS_SPI_PP_PROFILE_NUM (8)
+#define HS_SPI_PP_PROFILE_NUM_MASK __mask(10, HS_SPI_PP_PROFILE_NUM)
+
+} HsSpiControl;
+
+typedef struct HsSpiPingPong {
+
+ uint32 command;
+#define HS_SPI_SS_NUM (12)
+#define HS_SPI_PROFILE_NUM (8)
+#define HS_SPI_TRIGGER_NUM (4)
+#define HS_SPI_COMMAND_VALUE (0)
+ #define HS_SPI_COMMAND_NOOP (0)
+ #define HS_SPI_COMMAND_START_NOW (1)
+ #define HS_SPI_COMMAND_START_TRIGGER (2)
+ #define HS_SPI_COMMAND_HALT (3)
+ #define HS_SPI_COMMAND_FLUSH (4)
+
+ uint32 status;
+#define HS_SPI_ERROR_BYTE_OFFSET (16)
+#define HS_SPI_WAIT_FOR_TRIGGER (2)
+#define HS_SPI_SOURCE_BUSY (1)
+#define HS_SPI_SOURCE_GNT (0)
+
+ uint32 fifo_status;
+ uint32 control;
+
+} HsSpiPingPong;
+
+typedef struct HsSpiProfile {
+
+ uint32 clk_ctrl;
+#define HS_SPI_ACCUM_RST_ON_LOOP (15)
+#define HS_SPI_SPI_CLK_2X_SEL (14)
+#define HS_SPI_FREQ_CTRL_WORD (0)
+
+ uint32 signal_ctrl;
+#define HS_SPI_LAUNCH_RISING (1 << 13)
+#define HS_SPI_LATCH_RISING (1 << 12)
+
+ uint32 mode_ctrl;
+#define HS_SPI_PREPENDBYTE_CNT (24)
+#define HS_SPI_MODE_ONE_WIRE (20)
+#define HS_SPI_MULTIDATA_WR_SIZE (18)
+#define HS_SPI_MULTIDATA_RD_SIZE (16)
+#define HS_SPI_MULTIDATA_WR_STRT (12)
+#define HS_SPI_MULTIDATA_RD_STRT (8)
+#define HS_SPI_FILLBYTE (0)
+
+ uint32 polling_config;
+ uint32 polling_and_mask;
+ uint32 polling_compare;
+ uint32 polling_timeout;
+ uint32 reserved;
+
+} HsSpiProfile;
+
+#define HS_SPI_OP_CODE 13
+ #define HS_SPI_OP_SLEEP (0)
+ #define HS_SPI_OP_READ_WRITE (1)
+ #define HS_SPI_OP_WRITE (2)
+ #define HS_SPI_OP_READ (3)
+ #define HS_SPI_OP_SETIRQ (4)
+
+#define HS_SPI ((volatile HsSpiControl * const) HSSPIM_BASE)
+#define HS_SPI_PINGPONG0 ((volatile HsSpiPingPong * const) (HSSPIM_BASE+0x80))
+#define HS_SPI_PINGPONG1 ((volatile HsSpiPingPong * const) (HSSPIM_BASE+0xc0))
+#define HS_SPI_PROFILES ((volatile HsSpiProfile * const) (HSSPIM_BASE+0x100))
+#define HS_SPI_FIFO0 ((volatile uint8 * const) (HSSPIM_BASE+0x200))
+#define HS_SPI_FIFO1 ((volatile uint8 * const) (HSSPIM_BASE+0x400))
+
+
+/*
+** Periph - Misc Register Set Definitions.
+*/
+
+typedef struct Misc {
+ uint32 miscMoCADiv ; /* (0x0) MoCA Ref PLL Div */
+#define MISC_MOCA_DIV_REF_DIV_FB_MASK 0xFF000000
+#define MISC_MOCA_DIV_REF_DIV_FB_SHIFT 24
+#define MISC_MOCA_DIV_REF_OUTDIV_M1_MASK 0x00FF0000
+#define MISC_MOCA_DIV_REF_OUTDIV_M1_SHIFT 16
+#define MISC_MOCA_DIV_REF_OUTDIV_M4_MASK 0x0000FF00
+#define MISC_MOCA_DIV_REF_OUTDIV_M4_SHIFT 8
+#define MISC_MOCA_DIV_REF_OUTDIV_M5_MASK 0x000000FF
+#define MISC_MOCA_DIV_REF_OUTDIV_M5_SHIFT 0
+ uint32 miscMoCACtl ; /* (0x4) MoCA Ref PLL Ctl */
+#define MISC_MOCA_CTL_REF_OUTCML_LOWCUR_MASK 0x001FC000
+#define MISC_MOCA_CTL_REF_OUTCML_LOWCUR_SHIFT 14
+#define MISC_MOCA_CTL_REF_CLFCNT_MASK 0x00003000
+#define MISC_MOCA_CTL_REF_CLFCNT_SHIFT 12
+#define MISC_MOCA_CTL_REF_QP_ICTRL_MASK 0x00000E00
+#define MISC_MOCA_CTL_REF_QP_ICTRL_SHIFT 9
+#define MISC_MOCA_CTL_REF_VCOBUF_LATCH_ON 0x00000100
+#define MISC_MOCA_CTL_REF_LF_RCNTL_MASK 0x000000E0
+#define MISC_MOCA_CTL_REF_LF_RCNTL_SHIFT 5
+#define MISC_MOCA_CTL_REF_MUX_FBOFF 0x00000010
+#define MISC_MOCA_CTL_REF_MUX_SEL_MASK 0x0000000C
+#define MISC_MOCA_CTL_REF_MUX_SEL_SHIFT 2
+#define MISC_MOCA_CTL_REF_REF_CMLBIAS_MASK 0x00000003
+#define MISC_MOCA_CTL_REF_REF_CMLBIAS_SHIFT 0
+ uint32 miscMoCAPwr ; /* (0x8) MoCA Ref PLL Pwr */
+#define MISC_MOCA_PWR_REF_DEEP_PWRDN 0x01000000
+#define MISC_MOCA_PWR_REF_OUTDIV_PWRDN_M_MASK 0x00FE0000
+#define MISC_MOCA_PWR_REF_OUTDIV_PWRDN_M_SHIFT 17
+#define MISC_MOCA_PWR_REF_OUTCML_PWRDN_M_MASK 0x0001FC00
+#define MISC_MOCA_PWR_REF_OUTCML_PWRDN_M_SHIFT 10
+#define MISC_MOCA_PWR_REF_OUTCMOS_PWRDN_M_MASK 0x000003F8
+#define MISC_MOCA_PWR_REF_OUTCMOS_PWRDN_M_SHIFT 3
+#define MISC_MOCA_PWR_REF_UGB_PWRDN 0x00000004
+#define MISC_MOCA_PWR_REF_MUX_PWRDN 0x00000002
+#define MISC_MOCA_PWR_REF_VCO_PWRDN 0x00000001
+ uint32 miscMoCARst ; /* (0xC) MoCA Ref PLL Rst */
+#define MISC_MOCA_RST_REF_OUTDIV_RESET_M_MASK 0x00000FE0
+#define MISC_MOCA_RST_REF_OUTDIV_RESET_M_SHIFT 5
+#define MISC_MOCA_RST_REF_DIV2RST 0x00000010
+#define MISC_MOCA_RST_REF_MDIV2RST 0x00000008
+#define MISC_MOCA_RST_REF_FBDIVRST 0x00000004
+#define MISC_MOCA_RST_REF_LD_RESET_STRT 0x00000002
+#define MISC_MOCA_RST_REF_VCRST 0x00000001
+ uint32 miscMemcControl ; /* (0x10) MEMC Control */
+#define MISC_MEMC_CONTROL_MC_UBUS_ASYNC_MODE 0x00000008
+#define MISC_MEMC_CONTROL_MC_LMB_ASYNC_MODE 0x00000004
+#define MISC_MEMC_CONTROL_DDR_TEST_DONE 0x00000002
+#define MISC_MEMC_CONTROL_DDR_TEST_DISABLE 0x00000001
+ uint32 miscStrapBus ; /* (0x14) Strap Register */
+#define MISC_STRAP_BUS_MIPS_PLL_FVCO_MASK 0xF8000000
+#define MISC_STRAP_BUS_MIPS_PLL_FVCO_SHIFT 27
+#define MISC_STRAP_BUS_HRD_RST_DELAY 0x04000000
+#define MISC_STRAP_BUS_ALT_BFC_EN 0x02000000
+#define MISC_STRAP_BUS_MOCA_STANDALONE_B 0x01000000
+#define MISC_STRAP_BUS_MOCA_CONFIG_RATIO 0x00800000
+#define MISC_STRAP_BUS_IXTAL_ADJ_MASK 0x00600000
+#define MISC_STRAP_BUS_IXTAL_ADJ_SHIFT 21
+#define MISC_STRAP_BUS_BYPASS_XTAL 0x00100000
+#define MISC_STRAP_BUS_TS 0x00080000
+#define MISC_STRAP_BUS_APM_PICO_BOOT_ROM 0x00040000
+#define MISC_STRAP_BUS_TA 0x00020000
+#define MISC_STRAP_BUS_ROBOSW_2_MODE_MASK 0x00018000
+#define MISC_STRAP_BUS_ROBOSW_2_MODE_SHIFT 15
+#define MISC_STRAP_BUS_ROBOSW_1_MODE_MASK 0x00006000
+#define MISC_STRAP_BUS_ROBOSW_1_MODE_SHIFT 13
+#define MISC_STRAP_BUS_BIST_CLRMEM_N 0x00001000
+#define MISC_STRAP_BUS_PLL_MIPS_WAIT_FAST_N 0x00000200
+#define MISC_STRAP_BUS_PLL_USE_LOCK 0x00000100
+#define MISC_STRAP_BUS_PCIE_ROOT_COMPLEX 0x00000080
+#define MISC_STRAP_BUS_LS_SPIM_ENABLED 0x00000040
+#define MISC_STRAP_BUS_USE_SPI_MASTER 0x00000020
+#define MISC_STRAP_BUS_SPI_CLK_FAST 0x00000010
+#define MISC_STRAP_BUS_SPI_BOOT_DELAY 0x00000008
+#define MISC_STRAP_BUS_MIPS_BOOT16 0x00000004
+#define MISC_STRAP_BUS_BOOT_SEL_MASK 0x00000003
+#define MISC_STRAP_BUS_BOOT_SEL_SHIFT 0
+#define MISC_STRAP_BUS_BOOT_PARALLEL 0x03
+#define MISC_STRAP_BUS_BOOT_SERIAL 0x01
+#define MISC_STRAP_BUS_BOOT_NAND 0x02
+ uint32 miscStrapOverride ; /* (0x18) Strap Override Reg */
+#define MISC_STRAP_OVERRIDE_INT_MPI_ARB 0x00000008
+#define MISC_STRAP_OVERRIDE_INT_MPI_CLK 0x00000004
+#define MISC_STRAP_OVERRIDE_INT_HOST 0x00000002
+#define MISC_STRAP_OVERRIDE_STRAP_OVERRIDE 0x00000001
+ uint32 miscMoCAClkStrapBus ; /* (0x1C) MoCA Clock Strap Reg */
+#define MISC_MOCA_CLK_STRAP_BUS_MDIV_10_OVERRIDE_MASK 0x0000FF00
+#define MISC_MOCA_CLK_STRAP_BUS_MDIV_10_OVERRIDE_SHIFT 8
+#define MISC_MOCA_CLK_STRAP_BUS_MDIV_9_OVERRIDE_MASK 0x000000FF
+#define MISC_MOCA_CLK_STRAP_BUS_MDIV_9_OVERRIDE_SHIFT 0
+ uint32 miscMoCAClkStrapOverride ; /* (0x20) MoCA Clock Strap Overdide Reg */
+#define MISC_MOCA_CLK_STRAP_OVERRIDE_MOCA_CLK_STRAP_OVERRIDE_CTL 0x00000001
+ uint32 miscMoCAGpioOverlayLo ; /* (0x24) MoCA GPIO Overlay bus lo Reg */
+ uint32 miscMoCAGpioOverlayHi ; /* (0x28) MoCA GPIO Overlay bus hi Reg */
+#define MISC_MOCA_GPIO_UART 0x000000C0
+ uint32 miscDdrPllOutEnCh ; /* (0x2C) DDR PLL Out En Ch Number */
+#define MISC_DDR_PLL_OUTEN_CH_DDR_PLL_OUTEN_CH_MASK 0x000001FF
+#define MISC_DDR_PLL_OUTEN_CH_DDR_PLL_OUTEN_CH_SHIFT 0
+#define MISC_DDR_PLL_OUTEN_CH_MOCA_CPU_CLK 0x00000080
+#define MISC_DDR_PLL_OUTEN_CH_MOCA_PHY_CLK 0x00000100
+ uint32 miscGpioDiagOverlay ; /* (0x30) GPIO Diag Overlay Control Reg */
+#define MISC_GPIO_DIAG_OVERLAY_DIAG_OVERLAY_EN 0x00000020
+#define MISC_GPIO_DIAG_OVERLAY_DIAG_OVERLAY_MASK 0x0000001F
+#define MISC_GPIO_DIAG_OVERLAY_DIAG_OVERLAY_PORT_39_32 0x00000010
+#define MISC_GPIO_DIAG_OVERLAY_DIAG_OVERLAY_PORT_31_24 0x00000008
+#define MISC_GPIO_DIAG_OVERLAY_DIAG_OVERLAY_PORT_23_16 0x00000004
+#define MISC_GPIO_DIAG_OVERLAY_DIAG_OVERLAY_PORT_15_8 0x00000002
+#define MISC_GPIO_DIAG_OVERLAY_DIAG_OVERLAY_PORT_7_0 0x00000001
+ uint32 miscGpioModeCtrlHi ; /* (0x34) GPIO Pin Mode Control Reg Hi */
+} Misc ;
+
+#define MISC ((volatile Misc * const) MISC_BASE)
+
+/*
+** Pcm Controller
+*/
+
+typedef struct PcmControlRegisters
+{
+ uint32 pcm_ctrl; // 00 offset from PCM_BASE
+#define PCM_ENABLE 0x80000000 // PCM block master enable
+#define PCM_ENABLE_SHIFT 31
+#define PCM_SLAVE_SEL 0x40000000 // PCM TDM slave mode select (1 - TDM slave, 0 - TDM master)
+#define PCM_SLAVE_SEL_SHIFT 30
+#define PCM_CLOCK_INV 0x20000000 // PCM SCLK invert select (1 - invert, 0 - normal)
+#define PCM_CLOCK_INV_SHIFT 29
+#define PCM_FS_INVERT 0x10000000 // PCM FS invert select (1 - invert, 0 - normal)
+#define PCM_FS_INVERT_SHIFT 28
+#define PCM_FS_FREQ_16_8 0x08000000 // PCM FS 16/8 Khz select (1 - 16Khz, 0 - 8Khz)
+#define PCM_FS_FREQ_16_8_SHIFT 27
+#define PCM_FS_LONG 0x04000000 // PCM FS long/short select (1 - long FS, 0 - short FS)
+#define PCM_FS_LONG_SHIFT 26
+#define PCM_FS_TRIG 0x02000000 // PCM FS trigger (1 - falling edge, 0 - rising edge trigger)
+#define PCM_FS_TRIG_SHIFT 25
+#define PCM_DATA_OFF 0x01000000 // PCM data offset from FS (1 - one clock from FS, 0 - no offset)
+#define PCM_DATA_OFF_SHIFT 24
+#define PCM_DATA_16_8 0x00800000 // PCM data word length (1 - 16 bits, 0 - 8 bits)
+#define PCM_DATA_16_8_SHIFT 23
+#define PCM_CLOCK_SEL 0x00700000 // PCM SCLK freq select
+#define PCM_CLOCK_SEL_SHIFT 20
+ // 000 - 8192 Khz
+ // 001 - 4096 Khz
+ // 010 - 2048 Khz
+ // 011 - 1024 Khz
+ // 100 - 512 Khz
+ // 101 - 256 Khz
+ // 110 - 128 Khz
+ // 111 - reserved
+#define PCM_LSB_FIRST 0x00040000 // PCM shift direction (1 - LSBit first, 0 - MSBit first)
+#define PCM_LSB_FIRST_SHIFT 18
+#define PCM_LOOPBACK 0x00020000 // PCM diagnostic loobback enable
+#define PCM_LOOPBACK_SHIFT 17
+#define PCM_EXTCLK_SEL 0x00010000 // PCM external timing clock select -- Maybe removed in 6816
+#define PCM_EXTCLK_SEL_SHIFT 16
+#define PCM_NTR_ENABLE 0x00008000 // PCM NTR counter enable -- Nayve removed in 6816
+#define PCM_NTR_ENABLE_SHIFT 15
+#define PCM_BITS_PER_FRAME_1024 0x00000400 // 1024 - Max
+#define PCM_BITS_PER_FRAME_256 0x00000100 // 256
+#define PCM_BITS_PER_FRAME_8 0x00000008 // 8 - Min
+
+ uint32 pcm_chan_ctrl; // 04
+#define PCM_TX0_EN 0x00000001 // PCM transmit channel 0 enable
+#define PCM_TX1_EN 0x00000002 // PCM transmit channel 1 enable
+#define PCM_TX2_EN 0x00000004 // PCM transmit channel 2 enable
+#define PCM_TX3_EN 0x00000008 // PCM transmit channel 3 enable
+#define PCM_TX4_EN 0x00000010 // PCM transmit channel 4 enable
+#define PCM_TX5_EN 0x00000020 // PCM transmit channel 5 enable
+#define PCM_TX6_EN 0x00000040 // PCM transmit channel 6 enable
+#define PCM_TX7_EN 0x00000080 // PCM transmit channel 7 enable
+#define PCM_RX0_EN 0x00000100 // PCM receive channel 0 enable
+#define PCM_RX1_EN 0x00000200 // PCM receive channel 1 enable
+#define PCM_RX2_EN 0x00000400 // PCM receive channel 2 enable
+#define PCM_RX3_EN 0x00000800 // PCM receive channel 3 enable
+#define PCM_RX4_EN 0x00001000 // PCM receive channel 4 enable
+#define PCM_RX5_EN 0x00002000 // PCM receive channel 5 enable
+#define PCM_RX6_EN 0x00004000 // PCM receive channel 6 enable
+#define PCM_RX7_EN 0x00008000 // PCM receive channel 7 enable
+#define PCM_RX_PACKET_SIZE 0x00ff0000 // PCM Rx DMA quasi-packet size
+#define PCM_RX_PACKET_SIZE_SHIFT 16
+
+ uint32 pcm_int_pending; // 08
+ uint32 pcm_int_mask; // 0c
+#define PCM_TX_UNDERFLOW 0x00000001 // PCM DMA receive overflow
+#define PCM_RX_OVERFLOW 0x00000002 // PCM DMA transmit underflow
+#define PCM_TDM_FRAME 0x00000004 // PCM frame boundary
+#define PCM_RX_IRQ 0x00000008 // IUDMA interrupts
+#define PCM_TX_IRQ 0x00000010
+
+// From apm_core.h in Irvine
+ uint32 reg_pcm_clk_cntl_0; // (0x210) PCM Clock Control 0 (NCO_FCW_MISC)
+ uint32 reg_pcm_clk_cntl_1; // (0x214) PCM Clock Control 1 (NCO_SCALE)
+ uint32 reg_pcm_clk_cntl_2; // (0x218) PCM Clock Control 2
+#define PCM_NCO_SHIFT 0x0000000f
+#define PCM_NCO_MUX_CNTL 0x00000030
+#define PCM_NCO_LOAD_MISC 0x00000040
+#define PCM_NCO_SOFT_INIT 0x00000080
+#if 0 // Incorrect for 6816
+ uint32 pcm_pll_ctrl1; // 10
+#define PCM_PLL_PWRDN 0x80000000 // PLL PWRDN
+#define PCM_PLL_PWRDN_CH1 0x40000000 // PLL CH PWRDN
+#define PCM_PLL_REFCMP_PWRDN 0x20000000 // PLL REFCMP PWRDN
+#define PCM_CLK16_RESET 0x10000000 // 16.382 MHz PCM interface circuitry reset.
+#define PCM_PLL_ARESET 0x08000000 // PLL Analog Reset
+#define PCM_PLL_DRESET 0x04000000 // PLL Digital Reset
+
+ uint32 pcm_pll_ctrl2; // 14
+ uint32 pcm_pll_ctrl3; // 18
+ uint32 pcm_pll_ctrl4; // 1c
+
+ uint32 pcm_pll_stat; // 20
+#define PCM_PLL_LOCK 0x00000001 // Asserted when PLL is locked to programmed frequency
+
+ uint32 pcm_ntr_counter; // 24
+#endif
+
+ uint32 unused[9];
+#define PCM_MAX_TIMESLOT_REGS 16 // Number of PCM time slot registers in the table.
+ // Each register provides the settings for 8 timeslots (4 bits per timeslot)
+ uint32 pcm_slot_alloc_tbl[PCM_MAX_TIMESLOT_REGS];
+#define PCM_TS_VALID 0x8 // valid marker for TS alloc ram entry
+} PcmControlRegisters;
+
+#define PCM ((volatile PcmControlRegisters * const) PCM_BASE)
+
+typedef struct HvgControlRegisters
+{
+ uint16 reg_hvg_scale_vtip;
+ uint16 reg_hvg_scale_vhvg;
+
+ uint16 reg_hvg_scale_vloop;
+ uint16 reg_hvg_scale_vring;
+
+ uint16 reg_hvg_scale_vcal;
+ uint16 reg_hvg_scale_vinput;
+
+ uint16 reg_hvg_offset_vtip;
+ uint16 reg_hvg_offset_vhvg;
+
+ uint16 reg_hvg_offset_vloop;
+ uint16 reg_hvg_offset_vring;
+
+ uint16 reg_hvg_offset_vcal;
+ uint16 reg_hvg_offset_vinput;
+
+ uint32 reg_hvg_shift;
+#define COND_SHIFT_V_HVG 0x0000000f
+#define COND_SHIFT_V_TIP 0x000000f0
+#define COND_SHIFT_V_RING 0x00000f00
+#define COND_SHIFT_V_LOOP 0x0000f000
+#define COND_SHIFT_V_INPUT 0x000f0000
+#define COND_SHIFT_CAL 0x00f00000
+#define DIODE_DROP 0x0f000000
+#define HVG_IGNORE_RESET 0x10000000
+#define BG_TRIM_SOURCE 0x20000000
+#define HVG_SOFT_INIT 0x40000000
+
+ uint32 reg_hvg_turns_ratio;
+#define TURNS_RATIO 0x00000ffc
+#define RING_RECT_LINE 0xffff0000
+
+ uint32 reg_hvg_duty_cycle;
+#define MAX_DUTY_CYCLE 0x000000ff
+#define MIN_DUTY_CYCLE 0x0000ff00
+#define MIN_ON_TIME 0x00ff0000
+#define SHORT_CIRCUIT_THSHLD 0xff000000
+
+ uint32 reg_hvg_ring;
+#define RING_GAIN 0x00000fff
+#define RING_OVHD 0x0fff0000
+#define HVG_COMMON_RING_REF 0x80000000
+#define RING_GAIN_SHIFT 0
+#define RING_OVHD_SHIFT 16
+#define HVG_COMMON_RING_REF_SHIFT 31
+
+ uint32 reg_hvg_off_hook;
+#define OFF_HOOK_OVHD 0x000001ff
+#define OFF_HOOK_MIN 0x0003fe00
+#define PULSE_START_PHASE 0xff000000
+
+ uint32 reg_hvg_bg;
+#define BG_CTAT 0x0000003f
+#define BG_PTAT 0x00003f00
+#define BG_PTAT_SHIFT 8
+#define RING_DELAY 0x001f0000
+#define HVG_SER_TST_INJECT 0x00200000
+
+ uint32 reg_hvg_reg_3;
+#define SCALE_V_BAT 0x00007fff
+#define OFFSET_V_BAT 0x0fff8000
+#define SHIFT_V_BAT 0xf0000000
+
+ uint32 reg_hvg_status1;
+#define HVG_OOB_B 0x40000000
+#define HVG_INST_VALID_B 0x20000000
+#define HVG_INST_B 0x1fff0000
+#define HVG_OOB_A 0x00004000
+#define HVG_INST_VALID_A 0x00002000
+#define HVG_INST_A 0x00001fff
+
+ uint32 reg_hvg_status2;
+#define TIP_OOB_B 0x40000000
+#define TIP_INST_VALID_B 0x20000000
+#define TIP_INST_B 0x1fff0000
+#define TIP_OOB_A 0x00004000
+#define TIP_INST_VALID_A 0x00002000
+#define TIP_INST_A 0x00001fff
+
+ uint32 reg_hvg_status3;
+#define RING_OOB_B 0x40000000
+#define RING_INST_VALID_B 0x20000000
+#define RING_INST_B 0x1fff0000
+#define RING_OOB_A 0x00004000
+#define RING_INST_VALID_A 0x00002000
+#define RING_INST_A 0x00001fff
+
+ uint32 reg_hvg_status4;
+#define LOOP_OOB_B 0x40000000
+#define LOOP_INST_VALID_B 0x20000000
+#define LOOP_INST_B 0x1fff0000
+#define LOOP_OOB_A 0x00004000
+#define LOOP_INST_VALID_A 0x00002000
+#define LOOP_INST_A 0x00001fff
+
+ uint32 reg_hvg_status5;
+#define INPUT_OOB_B 0x40000000
+#define INPUT_INST_VALID_B 0x20000000
+#define INPUT_INST_B 0x1fff0000
+#define INPUT_OOB_A 0x00004000
+#define INPUT_INST_VALID_A 0x00002000
+#define INPUT_INST_A 0x00001fff
+
+ uint32 reg_hvg_status6;
+#define CAL_OOB_B 0x40000000
+#define CAL_OOB_INST_VALID_B 0x20000000
+#define CAL_INST_B 0x1fff0000
+#define CAL_OOB_A 0x00004000
+#define CAL_OOB_INST_VALID_A 0x00002000
+#define CAL_INST_A 0x00001fff
+
+ uint32 reg_hvg_status7;
+#define HVG_DUTY_CYCLE_B 0xff000000
+#define HVG_DUTY_CYCLE_A 0x00ff0000
+#define HVG_SHORT_FLAG_B 0x00000800
+#define HVG_SHORT_FLAG_A 0x00000400
+#define HVG_DUTY_CYCLE_LIMITED_B 0x00000200
+#define HVG_DUTY_CYCLE_LIMITED_A 0x00000100
+#define MAX_DIV_OOB_B 0x00000080
+#define MAX_DIV_OOB_A 0x00000040
+#define MAX_MULT_OOB_B 0x00000020
+#define MAX_MULT_OOB_A 0x00000010
+#define ARBITER_ERR_B 0x00000008
+#define ARBITER_ERR_A 0x00000004
+#define AVG_BLOCK_DONE_B 0x00000002
+#define AVG_BLOCK_DONE_A 0x00000001
+
+ uint32 reg_hvg_status8;
+#define HVG_AVG_VALID 0x20000000
+#define HVG_SAT 0x10000000
+#define HVG_WINDOW_SLEW 0x0f000000
+#define HVG_MEAN 0x001fffff
+
+ uint32 reg_hvg_status9;
+ uint32 reg_hvg_status10;
+#define TIP_AVG_VALID 0x20000000
+#define TIP_SAT 0x10000000
+#define TIP_WINDOW_SLEW 0x0f000000
+#define TIP_MEAN 0x001fffff
+
+ uint32 reg_hvg_status11;
+ uint32 reg_hvg_status12;
+#define RING_AVG_VALID 0x20000000
+#define RING_SAT 0x10000000
+#define RING_WINDOW_SLEW 0x0f000000
+#define RING_MEAN 0x001fffff
+
+ uint32 reg_hvg_status13;
+ uint32 reg_hvg_status14;
+#define TP_RG_AVG_VALID 0x20000000
+#define TP_RG_SAT 0x10000000
+#define TP_RG_WINDOW_SLEW 0x0f000000
+#define TP_RG_MEAN 0x001fffff
+
+ uint32 reg_hvg_status15;
+ uint32 reg_hvg_status16;
+#define I_LOOP_AVG_VALID 0x20000000
+#define I_LOOP_SAT 0x10000000
+#define I_LOOP_WINDOW_SLEW 0x0f000000
+#define I_LOOP_MEAN 0x001fffff
+
+ uint32 reg_hvg_status17;
+ uint32 reg_hvg_status18;
+#define INPUT_AVG_VALID 0x20000000
+#define INPUT_SAT 0x10000000
+#define INPUT_WINDOW_SLEW 0x0f000000
+#define INPUT_MEAN 0x001fffff
+
+ uint32 reg_hvg_status19;
+ uint32 reg_hvg_status20;
+#define CAL_AVG_VALID 0x20000000
+#define CAL_SAT 0x10000000
+#define CAL_WINDOW_SLEW 0x0f000000
+#define CAL_MEAN 0x001fffff
+
+ uint32 reg_hvg_status21;
+ uint32 reg_hvg_status22;
+ uint32 reg_hvg_status23;
+ uint32 reg_hvg_status24;
+ uint32 reg_hvg_status25;
+ uint32 reg_hvg_status26;
+ uint32 reg_hvg_status27;
+ uint32 reg_hvg_status28;
+ uint32 reg_hvg_status29;
+ uint32 reg_hvg_status30;
+ uint32 reg_hvg_status31;
+ uint32 reg_hvg_status32;
+ uint32 reg_hvg_status33;
+ uint32 reg_hvg_status34;
+ uint32 reg_hvg_status35;
+
+ uint32 hvg_spacer1[16];
+
+ uint32 reg_hvg_cha_window_ctrl;
+#define HVG_WINDOW_SIZE 0x0000000f
+#define TIP_WINDOW_SIZE 0x000000f0
+#define RING_WINDOW_SIZE 0x00000f00
+#define LOOP_WINDOW_SIZE 0x0000f000
+#define INPUT_WINDOW_SIZE 0x000f0000
+#define TP_RG_WINDOW_SIZE 0x00f00000
+#define CAL_WINDOW_SIZE 0x0f000000
+#define SLEW_WINDOW_SIZES 0x10000000
+#define NEW_BLK_RQST 0x20000000
+
+ uint16 reg_hvg_cha_max_hvg_slic;
+ uint16 reg_hvg_cha_const_volt_goal;
+
+ uint32 reg_hvg_cha_misc;
+#define K_PROP 0x0000000f
+#define K_INTEG 0x000000f0
+#define SER_TST_OUTPUT_SEL 0x00000700
+#define CONT_OR_BLOCK 0x00000800
+#define HVG_MODE 0x00003000
+#define HVG_MODE_OFFHOOK_TRACKING 0x00001000
+#define HVG_MODE_ONHOOK_FIXED 0x00002000
+#define HVG_SOFT_INIT_0 0x00004000
+#define HVG_RR_SINGLE 0x00008000
+
+ uint32 reg_hvg_cha_spare;
+ uint32 hvg_spacer2[28];
+
+ uint32 reg_hvg_chb_window_ctrl;
+
+ uint16 reg_hvg_chb_max_hvg_slic;
+ uint16 reg_hvg_chb_const_volt_goal;
+
+ uint32 reg_hvg_chb_misc;
+ uint32 reg_hvg_chb_spare;
+
+} HvgControlRegisters;
+
+#define HVG ((volatile HvgControlRegisters * const) APM_HVG_BASE)
+
+/***** TBD. This is the BCM6368 definition. Need BCM6816 definition. *****/
+typedef struct PcmIudmaRegisters
+{
+ uint16 reserved0;
+ uint16 ctrlConfig;
+#define BCM6816_IUDMA_REGS_CTRLCONFIG_MASTER_EN 0x0001
+#define BCM6816_IUDMA_REGS_CTRLCONFIG_FLOWC_CH1_EN 0x0002
+#define BCM6816_IUDMA_REGS_CTRLCONFIG_FLOWC_CH3_EN 0x0004
+#define BCM6816_IUDMA_REGS_CTRLCONFIG_FLOWC_CH5_EN 0x0008
+#define BCM6816_IUDMA_REGS_CTRLCONFIG_FLOWC_CH7_EN 0x0010
+
+ // Flow control Ch1
+ uint16 reserved1;
+ uint16 ch1_FC_Low_Thr;
+
+ uint16 reserved2;
+ uint16 ch1_FC_High_Thr;
+
+ uint16 reserved3;
+ uint16 ch1_Buff_Alloc;
+
+ // Flow control Ch3
+ uint16 reserved4;
+ uint16 ch3_FC_Low_Thr;
+
+ uint16 reserved5;
+ uint16 ch3_FC_High_Thr;
+
+ uint16 reserved6;
+ uint16 ch3_Buff_Alloc;
+
+ // Flow control Ch5
+ uint16 reserved7;
+ uint16 ch5_FC_Low_Thr;
+
+ uint16 reserved8;
+ uint16 ch5_FC_High_Thr;
+
+ uint16 reserved9;
+ uint16 ch5_Buff_Alloc;
+
+ // Flow control Ch7
+ uint16 reserved10;
+ uint16 ch7_FC_Low_Thr;
+
+ uint16 reserved11;
+ uint16 ch7_FC_High_Thr;
+
+ uint16 reserved12;
+ uint16 ch7_Buff_Alloc;
+
+ // Channel resets
+ uint16 reserved13;
+ uint16 channel_reset;
+
+ uint16 reserved14;
+ uint16 channel_debug;
+
+ // Spare register
+ uint32 dummy1;
+
+ // Interrupt status registers
+ uint16 reserved15;
+ uint16 gbl_int_stat;
+
+ // Interrupt mask registers
+ uint16 reserved16;
+ uint16 gbl_int_mask;
+} PcmIudmaRegisters;
+
+/***** TBD. This is the BCM6368 definition. Need BCM6816 definition. *****/
+typedef struct PcmIudmaChannelCtrl
+{
+ uint16 reserved1;
+ uint16 config;
+#define BCM6816_IUDMA_CONFIG_ENDMA 0x0001
+#define BCM6816_IUDMA_CONFIG_PKTHALT 0x0002
+#define BCM6816_IUDMA_CONFIG_BURSTHALT 0x0004
+
+ uint16 reserved2;
+ uint16 intStat;
+#define BCM6816_IUDMA_INTSTAT_BDONE 0x0001
+#define BCM6816_IUDMA_INTSTAT_PDONE 0x0002
+#define BCM6816_IUDMA_INTSTAT_NOTVLD 0x0004
+#define BCM6816_IUDMA_INTSTAT_MASK 0x0007
+#define BCM6816_IUDMA_INTSTAT_ALL BCM6816_IUDMA_INTSTAT_MASK
+
+ uint16 reserved3;
+ uint16 intMask;
+#define BCM6816_IUDMA_INTMASK_BDONE 0x0001
+#define BCM6816_IUDMA_INTMASK_PDONE 0x0002
+#define BCM6816_IUDMA_INTMASK_NOTVLD 0x0004
+
+ uint32 maxBurst;
+#define BCM6816_IUDMA_MAXBURST_SIZE 16 /* 32-bit words */
+
+} PcmIudmaChannelCtrl;
+
+
+typedef struct PcmIudmaStateRam
+{
+ uint32 baseDescPointer; /* pointer to first buffer descriptor */
+
+ uint32 stateBytesDoneRingOffset; /* state info: how manu bytes done and the offset of the
+ current descritor in process */
+#define BCM6816_IUDMA_STRAM_DESC_RING_OFFSET 0x3fff
+
+
+ uint32 flagsLengthStatus; /* Length and status field of the current descriptor */
+
+ uint32 currentBufferPointer; /* pointer to the current descriptor */
+
+} PcmIudmaStateRam;
+
+#define BCM6816_MAX_PCM_DMA_CHANNELS 2
+
+typedef struct PcmIudma
+{
+ PcmIudmaRegisters regs; //
+ uint32 reserved1[110]; //
+ PcmIudmaChannelCtrl ctrl[BCM6816_MAX_PCM_DMA_CHANNELS]; //
+ uint32 reserved2[120]; //
+ PcmIudmaStateRam stram[BCM6816_MAX_PCM_DMA_CHANNELS]; //
+
+} PcmIudma;
+
+#define PCM_IUDMA ((volatile PcmIudma * const) PCM_DMA_BASE)
+
+
+#define IUDMA_MAX_CHANNELS 32
+
+/*
+** DMA Channel Configuration (1 .. 32)
+*/
+typedef struct DmaChannelCfg {
+ uint32 cfg; /* (00) assorted configuration */
+#define DMA_ENABLE 0x00000001 /* set to enable channel */
+#define DMA_PKT_HALT 0x00000002 /* idle after an EOP flag is detected */
+#define DMA_BURST_HALT 0x00000004 /* idle after finish current memory burst */
+ uint32 intStat; /* (04) interrupts control and status */
+ uint32 intMask; /* (08) interrupts mask */
+#define DMA_BUFF_DONE 0x00000001 /* buffer done */
+#define DMA_DONE 0x00000002 /* packet xfer complete */
+#define DMA_NO_DESC 0x00000004 /* no valid descriptors */
+ uint32 maxBurst; /* (0C) max burst length permitted */
+#define DMA_DESCSIZE_SEL 0x00040000 /* DMA Descriptor Size Selection */
+} DmaChannelCfg;
+
+/*
+** DMA State RAM (1 .. 16)
+*/
+typedef struct DmaStateRam {
+ uint32 baseDescPtr; /* (00) descriptor ring start address */
+ uint32 state_data; /* (04) state/bytes done/ring offset */
+ uint32 desc_len_status; /* (08) buffer descriptor status and len */
+ uint32 desc_base_bufptr; /* (0C) buffer descrpitor current processing */
+} DmaStateRam;
+
+
+/*
+** DMA Registers
+*/
+typedef struct DmaRegs {
+ uint32 controller_cfg; /* (00) controller configuration */
+#define DMA_MASTER_EN 0x00000001
+#define DMA_FLOWC_CH1_EN 0x00000002
+#define DMA_FLOWC_CH3_EN 0x00000004
+
+ // Flow control Ch1
+ uint32 flowctl_ch1_thresh_lo; /* 004 */
+ uint32 flowctl_ch1_thresh_hi; /* 008 */
+ uint32 flowctl_ch1_alloc; /* 00c */
+#define DMA_BUF_ALLOC_FORCE 0x80000000
+
+ // Flow control Ch3
+ uint32 flowctl_ch3_thresh_lo; /* 010 */
+ uint32 flowctl_ch3_thresh_hi; /* 014 */
+ uint32 flowctl_ch3_alloc; /* 018 */
+
+ // Flow control Ch5
+ uint32 flowctl_ch5_thresh_lo; /* 01C */
+ uint32 flowctl_ch5_thresh_hi; /* 020 */
+ uint32 flowctl_ch5_alloc; /* 024 */
+
+ // Flow control Ch7
+ uint32 flowctl_ch7_thresh_lo; /* 028 */
+ uint32 flowctl_ch7_thresh_hi; /* 02C */
+ uint32 flowctl_ch7_alloc; /* 030 */
+
+ uint32 ctrl_channel_reset; /* 034 */
+ uint32 ctrl_channel_debug; /* 038 */
+ uint32 reserved1; /* 03C */
+ uint32 ctrl_global_interrupt_status; /* 040 */
+ uint32 ctrl_global_interrupt_mask; /* 044 */
+
+ // Unused words
+ uint8 reserved2[0x200-0x48];
+
+ // Per channel registers/state ram
+ DmaChannelCfg chcfg[IUDMA_MAX_CHANNELS];/* (200-3FF) Channel configuration */
+ union {
+ DmaStateRam s[IUDMA_MAX_CHANNELS];
+ uint32 u32[4 * IUDMA_MAX_CHANNELS];
+ } stram; /* (400-5FF) state ram */
+} DmaRegs;
+
+#define SW_DMA ((volatile DmaRegs * const) SWITCH_DMA_BASE)
+
+/*
+** DMA Buffer
+*/
+typedef struct DmaDesc {
+ union {
+ struct {
+ uint16 length; /* in bytes of data in buffer */
+#define DMA_DESC_USEFPM 0x8000
+#define DMA_DESC_MULTICAST 0x4000
+#define DMA_DESC_BUFLENGTH 0x0fff
+ uint16 status; /* buffer status */
+#define DMA_OWN 0x8000 /* cleared by DMA, set by SW */
+#define DMA_EOP 0x4000 /* last buffer in packet */
+#define DMA_SOP 0x2000 /* first buffer in packet */
+#define DMA_WRAP 0x1000 /* */
+#define DMA_PRIO 0x0C00 /* Prio for Tx */
+#define DMA_APPEND_BRCM_TAG 0x0200
+#define DMA_APPEND_CRC 0x0100
+#define USB_ZERO_PKT (1<< 0) // Set to send zero length packet
+ };
+ uint32 word0;
+ };
+
+ uint32 address; /* address of data */
+} DmaDesc;
+
+/*
+** 16 Byte DMA Buffer
+*/
+typedef struct {
+ union {
+ struct {
+ uint16 length; /* in bytes of data in buffer */
+#define DMA_DESC_USEFPM 0x8000
+#define DMA_DESC_MULTICAST 0x4000
+#define DMA_DESC_BUFLENGTH 0x0fff
+ uint16 status; /* buffer status */
+#define DMA_OWN 0x8000 /* cleared by DMA, set by SW */
+#define DMA_EOP 0x4000 /* last buffer in packet */
+#define DMA_SOP 0x2000 /* first buffer in packet */
+#define DMA_WRAP 0x1000 /* */
+#define DMA_PRIO 0x0C00 /* Prio for Tx */
+#define DMA_APPEND_BRCM_TAG 0x0200
+#define DMA_APPEND_CRC 0x0100
+#define USB_ZERO_PKT (1<< 0) // Set to send zero length packet
+ };
+ uint32 word0;
+ };
+
+ uint32 address; /* address of data */
+ uint32 control;
+#define GEM_ID_MASK 0x001F
+ uint32 reserved;
+} DmaDesc16;
+
+/*
+** External Bus Interface
+*/
+typedef struct EbiChipSelect {
+ uint32 base; /* base address in upper 24 bits */
+#define EBI_SIZE_8K 0
+#define EBI_SIZE_16K 1
+#define EBI_SIZE_32K 2
+#define EBI_SIZE_64K 3
+#define EBI_SIZE_128K 4
+#define EBI_SIZE_256K 5
+#define EBI_SIZE_512K 6
+#define EBI_SIZE_1M 7
+#define EBI_SIZE_2M 8
+#define EBI_SIZE_4M 9
+#define EBI_SIZE_8M 10
+#define EBI_SIZE_16M 11
+#define EBI_SIZE_32M 12
+#define EBI_SIZE_64M 13
+#define EBI_SIZE_128M 14
+#define EBI_SIZE_256M 15
+ uint32 config;
+#define EBI_ENABLE 0x00000001 /* .. enable this range */
+#define EBI_WAIT_STATES 0x0000000e /* .. mask for wait states */
+#define EBI_WTST_SHIFT 1 /* .. for shifting wait states */
+#define EBI_WORD_WIDE 0x00000010 /* .. 16-bit peripheral, else 8 */
+#define EBI_WREN 0x00000020 /* enable posted writes */
+#define EBI_POLARITY 0x00000040 /* .. set to invert something,
+ ** don't know what yet */
+#define EBI_TS_TA_MODE 0x00000080 /* .. use TS/TA mode */
+#define EBI_TS_SEL 0x00000100 /* .. drive tsize, not bs_b */
+#define EBI_FIFO 0x00000200 /* .. use fifo */
+#define EBI_RE 0x00000400 /* .. Reverse Endian */
+#define EBI_SETUP_SHIFT 16
+#define EBI_HOLD_SHIFT 20
+#define EBI_SETUP_STATES 0x0f0000
+#define EBI_HOLD_STATES 0xf00000
+} EbiChipSelect;
+
+typedef struct MpiRegisters {
+ EbiChipSelect cs[7]; /* size chip select configuration */
+#define EBI_CS0_BASE 0
+#define EBI_CS1_BASE 1
+#define EBI_CS2_BASE 2
+#define EBI_CS3_BASE 3
+#define EBI_CS4_BASE 4
+#define EBI_CS5_BASE 5
+#define EBI_CS6_BASE 6
+ uint32 unused0[2]; /* reserved */
+ uint32 ebi_control; /* ebi control */
+#define EBI_ACCESS_TIMEOUT 0x000007FF
+ uint32 unused1[7]; /* reserved */
+
+ uint32 sp0range; /* PCI to internal system bus address space */
+#define ADDR_SPACE_MASK 0xFFFF0000
+ uint32 sp0remap;
+ uint32 sp0cfg;
+ uint32 sp1range;
+ uint32 sp1remap;
+ uint32 sp1cfg;
+
+ uint32 EndianCfg;
+
+ uint32 l2pcfgctl; /* internal system bus to PCI IO/Cfg control */
+#define DIR_CFG_SEL 0x80000000 /* change from PCI I/O access to PCI config access */
+#define DIR_CFG_USEREG 0x40000000 /* use this register info for PCI configuration access */
+#define DEVICE_NUMBER 0x00007C00 /* device number for the PCI configuration access */
+#define FUNC_NUMBER 0x00000300 /* function number for the PCI configuration access */
+#define REG_NUMBER 0x000000FC /* register number for the PCI configuration access */
+#define CONFIG_TYPE 0x00000003 /* configuration type for the PCI configuration access */
+
+ uint32 l2pmrange1; /* internal system bus to PCI memory space */
+#define PCI_SIZE_64K 0xFFFF0000
+#define PCI_SIZE_128K 0xFFFE0000
+#define PCI_SIZE_256K 0xFFFC0000
+#define PCI_SIZE_512K 0xFFF80000
+#define PCI_SIZE_1M 0xFFF00000
+#define PCI_SIZE_2M 0xFFE00000
+#define PCI_SIZE_4M 0xFFC00000
+#define PCI_SIZE_8M 0xFF800000
+#define PCI_SIZE_16M 0xFF000000
+#define PCI_SIZE_32M 0xFE000000
+ uint32 l2pmbase1; /* kseg0 or kseg1 address & 0x1FFFFFFF */
+ uint32 l2pmremap1;
+#define CARDBUS_MEM 0x00000004
+#define MEM_WINDOW_EN 0x00000001
+ uint32 l2pmrange2;
+ uint32 l2pmbase2;
+ uint32 l2pmremap2;
+ uint32 l2piorange; /* internal system bus to PCI I/O space */
+ uint32 l2piobase;
+ uint32 l2pioremap;
+
+ uint32 pcimodesel;
+#define PCI_INT_BUS_RD_PREFETCH 0x000001F0
+#define PCI_BAR2_NOSWAP 0x00000002 /* BAR at offset 0x20 */
+#define PCI_BAR1_NOSWAP 0x00000001 /* BAR at affset 0x1c */
+
+ uint32 pciintstat; /* PCI interrupt mask/status */
+#define MAILBOX1_SENT 0x08
+#define MAILBOX0_SENT 0x04
+#define MAILBOX1_MSG_RCV 0x02
+#define MAILBOX0_MSG_RCV 0x01
+ uint32 locbuscntrl; /* internal system bus control */
+#define DIR_U2P_NOSWAP 0x00000002
+#define EN_PCI_GPIO 0x00000001
+ uint32 locintstat; /* internal system bus interrupt mask/status */
+#define CSERR 0x0200
+#define SERR 0x0100
+#define EXT_PCI_INT 0x0080
+#define DIR_FAILED 0x0040
+#define DIR_COMPLETE 0x0020
+#define PCI_CFG 0x0010
+ uint32 unused4[7];
+
+ uint32 mailbox0;
+ uint32 mailbox1;
+
+ uint32 pcicfgcntrl; /* internal system bus PCI configuration control */
+#define PCI_CFG_REG_WRITE_EN 0x00000080
+#define PCI_CFG_ADDR 0x0000003C
+ uint32 pcicfgdata; /* internal system bus PCI configuration data */
+
+ uint32 locch2ctl; /* PCI to interrnal system bus DMA (downstream) local control */
+#define MPI_DMA_HALT 0x00000008 /* idle after finish current memory burst */
+#define MPI_DMA_PKT_HALT 0x00000004 /* idle after an EOP flag is detected */
+#define MPI_DMA_STALL 0x00000002 /* idle after an EOP flag is detected */
+#define MPI_DMA_ENABLE 0x00000001 /* set to enable channel */
+ uint32 locch2intStat;
+#define MPI_DMA_NO_DESC 0x00000004 /* no valid descriptors */
+#define MPI_DMA_DONE 0x00000002 /* packet xfer complete */
+#define MPI_DMA_BUFF_DONE 0x00000001 /* buffer done */
+ uint32 locch2intMask;
+ uint32 unused5;
+ uint32 locch2descaddr;
+ uint32 locch2status1;
+#define LOCAL_DESC_STATE 0xE0000000
+#define PCI_DESC_STATE 0x1C000000
+#define BYTE_DONE 0x03FFC000
+#define RING_ADDR 0x00003FFF
+ uint32 locch2status2;
+#define BUFPTR_OFFSET 0x1FFF0000
+#define PCI_MASTER_STATE 0x000000C0
+#define LOC_MASTER_STATE 0x00000038
+#define CONTROL_STATE 0x00000007
+ uint32 unused6;
+
+ uint32 locch1Ctl; /*internal system bus to PCI DMA (upstream) local control */
+#define DMA_U2P_LE 0x00000200 /* local bus is little endian */
+#define DMA_U2P_NOSWAP 0x00000100 /* lccal bus is little endian but no data swapped */
+ uint32 locch1intstat;
+ uint32 locch1intmask;
+ uint32 unused7;
+ uint32 locch1descaddr;
+ uint32 locch1status1;
+ uint32 locch1status2;
+ uint32 unused8;
+
+ uint32 pcich1ctl; /* internal system bus to PCI DMA PCI control */
+ uint32 pcich1intstat;
+ uint32 pcich1intmask;
+ uint32 pcich1descaddr;
+ uint32 pcich1status1;
+ uint32 pcich1status2;
+
+ uint32 pcich2Ctl; /* PCI to internal system bus DMA PCI control */
+ uint32 pcich2intstat;
+ uint32 pcich2intmask;
+ uint32 pcich2descaddr;
+ uint32 pcich2status1;
+ uint32 pcich2status2;
+
+ uint32 perm_id; /* permanent device and vendor id */
+ uint32 perm_rev; /* permanent revision id */
+} MpiRegisters;
+
+#define MPI ((volatile MpiRegisters * const) MPI_BASE)
+
+/* PCI configuration address space start offset 0x40 */
+#define BRCM_PCI_CONFIG_TIMER 0x40
+#define BRCM_PCI_CONFIG_TIMER_RETRY_MASK 0x0000FF00
+#define BRCM_PCI_CONFIG_TIMER_TRDY_MASK 0x000000FF
+
+/*
+** USB 2.0 Device Registers
+*/
+typedef struct UsbRegisters {
+#define USBD_CONTROL_APP_DONECSR 0x0001
+#define USBD_CONTROL_APP_RESUME 0x0002
+#define USBD_CONTROL_APP_RXFIFIO_INIT 0x0040
+#define USBD_CONTROL_APP_TXFIFIO_INIT 0x0080
+#define USBD_CONTROL_APP_FIFO_SEL_SHIFT 0x8
+#define USBD_CONTROL_APP_FIFO_INIT_SEL(x) (((x)&0x0f)<<USBD_CONTROL_APP_FIFO_SEL_SHIFT)
+#define USBD_CONTROL_APP_AUTO_CSRS 0x2000
+#define USBD_CONTROL_APP_AUTO_INS_ZERO_LEN_PKT 0x4000
+#define EN_TXZLENINS (1<<14)
+#define EN_RXZSCFG (1<<12)
+#define APPSETUPERRLOCK (1<<5)
+ uint32 usbd_control ;
+#define USBD_STRAPS_APP_SELF_PWR 0x0400
+#define USBD_STRAPS_APP_DEV_DISCON 0x0200
+#define USBD_STRAPS_APP_CSRPRG_SUP 0x0100
+#define USBD_STRAPS_APP_RAM_IF 0x0080
+#define USBD_STRAPS_APP_DEV_RMTWKUP 0x0040
+#define USBD_STRAPS_APP_PHYIF_8BIT 0x0004
+#define USBD_STRAPS_FULL_SPEED 0x0003
+#define USBD_STRAPS_LOW_SPEED 0x0002
+#define USBD_STRAPS_HIGH_SPEED 0x0000
+#define APPUTMIDIR(x) ((x&1)<<3)
+#define UNIDIR 0
+ uint32 usbd_straps;
+#define USB_ENDPOINT_0 0x01
+ uint32 usbd_stall;
+#define USBD_ENUM_SPEED_SHIFT 12
+#define USBD_ENUM_SPEED 0x3000
+#define UDC20_ALTINTF(x) ((x>>8)&0xf)
+#define UDC20_INTF(x) ((x>>4)&0xf)
+#define UDC20_CFG(x) ((x>>0)&0xf)
+ uint32 usbd_status;
+#define USBD_LINK (0x1<<10)
+#define USBD_SET_CSRS 0x40
+#define USBD_SUSPEND 0x20
+#define USBD_EARLY_SUSPEND 0x10
+#define USBD_SOF 0x08
+#define USBD_ENUMON 0x04
+#define USBD_SETUP 0x02
+#define USBD_USBRESET 0x01
+ uint32 usbd_events;
+ uint32 usbd_events_irq;
+#define UPPER(x) (16+x)
+#define ENABLE(x) (1<<x)
+#define SWP_TXBSY (15)
+#define SWP_RXBSY (14)
+#define SETUP_ERR (13)
+#define APPUDCSTALLCHG (12)
+#define BUS_ERR (11)
+#define USB_LINK (10)
+#define HST_SETCFG (9)
+#define HST_SETINTF (8)
+#define ERRATIC_ERR (7)
+#define SET_CSRS (6)
+#define SUSPEND (5)
+#define ERLY_SUSPEND (4)
+#define SOF (3)
+#define ENUM_ON (2)
+#define SETUP (1)
+#define USB_RESET (0)
+#define RISING(x) (0x0<<2*x)
+#define FALLING(x) (0x1<<2*x)
+#define USBD_IRQCFG_ENUM_ON_FALLING_EDGE 0x00000010
+ uint32 usbd_irqcfg_hi ;
+ uint32 usbd_irqcfg_lo ;
+#define USBD_USB_RESET_IRQ 0x00000001
+#define USBD_USB_SETUP_IRQ 0x00000002 // non-standard setup cmd rcvd
+#define USBD_USB_ENUM_ON_IRQ 0x00000004
+#define USBD_USB_SOF_IRQ 0x00000008
+#define USBD_USB_EARLY_SUSPEND_IRQ 0x00000010
+#define USBD_USB_SUSPEND_IRQ 0x00000020 // non-standard setup cmd rcvd
+#define USBD_USB_SET_CSRS_IRQ 0x00000040
+#define USBD_USB_ERRATIC_ERR_IRQ 0x00000080
+#define USBD_USB_SETCFG_IRQ 0x00000200
+#define USBD_USB_LINK_IRQ 0x00000400
+ uint32 usbd_events_irq_mask;
+ uint32 usbd_swcfg;
+ uint32 usbd_swtxctl;
+ uint32 usbd_swrxctl;
+ uint32 usbd_txfifo_rwptr;
+ uint32 usbd_rxfifo_rwptr;
+ uint32 usbd_txfifo_st_rwptr;
+ uint32 usbd_rxfifo_st_rwptr;
+ uint32 usbd_txfifo_config ;
+ uint32 usbd_rxfifo_config ;
+ uint32 usbd_txfifo_epsize ;
+ uint32 usbd_rxfifo_epsize ;
+#define USBD_EPNUM_CTRL 0x0
+#define USBD_EPNUM_ISO 0x1
+#define USBD_EPNUM_BULK 0x2
+#define USBD_EPNUM_IRQ 0x3
+#define USBD_EPNUM_EPTYPE(x) (((x)&0x3)<<8)
+#define USBD_EPNUM_EPDMACHMAP(x) (((x)&0xf)<<0)
+ uint32 usbd_epnum_typemap ;
+ uint32 usbd_reserved [0xB] ;
+ uint32 usbd_csr_setupaddr ;
+#define USBD_EPNUM_MASK 0xf
+#define USBD_EPNUM(x) ((x&USBD_EPNUM_MASK)<<0)
+#define USBD_EPDIR_IN (1<<4)
+#define USBD_EPDIR_OUT (0<<4)
+#define USBD_EPTYP_CTRL (USBD_EPNUM_CTRL<<5)
+#define USBD_EPTYP_ISO (USBD_EPNUM_ISO<<5)
+#define USBD_EPTYP_BULK (USBD_EPNUM_BULK<<5)
+#define USBD_EPTYP_IRQ (USBD_EPNUM_IRQ<<5)
+#define USBD_EPCFG_MASK 0xf
+#define USBD_EPCFG(x) ((x&USBD_EPCFG_MASK)<<7)
+#define USBD_EPINTF_MASK 0xf
+#define USBD_EPINTF(x) ((x&USBD_EPINTF_MASK)<<11)
+#define USBD_EPAINTF_MASK 0xf
+#define USBD_EPAINTF(x) ((x&USBD_EPAINTF_MASK)<<15)
+#define USBD_EPMAXPKT_MSK 0x7ff
+#define USBD_EPMAXPKT(x) ((x&USBD_EPMAXPKT_MSK)<<19)
+#define USBD_EPISOPID_MASK 0x3
+#define USBD_EPISOPID(x) ((x&USBD_ISOPID_MASK)<<30)
+ uint32 usbd_csr_ep [5] ;
+} UsbRegisters;
+
+#define USB ((volatile UsbRegisters * const) USB_CTL_BASE)
+
+typedef struct USBControl {
+ uint32 BrtControl1;
+ uint32 BrtControl2;
+ uint32 BrtStatus1;
+ uint32 BrtStatus2;
+ uint32 UTMIControl1;
+ uint32 TestPortControl;
+ uint32 PllControl1;
+ uint32 SwapControl;
+#define USB_DEVICE_SEL (1<<6)
+#define EHCI_LOGICAL_ADDRESS_EN (1<<5)
+#define EHCI_ENDIAN_SWAP (1<<4)
+#define EHCI_DATA_SWAP (1<<3)
+#define OHCI_LOGICAL_ADDRESS_EN (1<<2)
+#define OHCI_ENDIAN_SWAP (1<<1)
+#define OHCI_DATA_SWAP (1<<0)
+ uint32 unused1;
+ uint32 FrameAdjustValue;
+ uint32 Setup;
+#define USBH_IOC (1<<4)
+ uint32 MDIO;
+ uint32 MDIO32;
+ uint32 USBSimControl;
+} USBControl;
+
+#define USBH ((volatile USBControl * const) USBH_CFG_BASE)
+
+/*
+** GPON SERDES Registers
+*/
+typedef struct GponSerdesRegs {
+ uint32 topCfg;
+ uint32 swReset;
+ uint32 aeCfg;
+ uint32 aeStatus;
+ uint32 phyCfg;
+ uint32 phyStatus;
+ uint32 mdioWr;
+ uint32 mdioRd;
+ uint32 reserved[2];
+ uint32 fifoCfg;
+ uint32 fifoStatus;
+ uint32 patternCfg[4];
+ uint32 patternStatus[2];
+ uint32 laserCfg;
+#define GPON_SERDES_LASERMODE_MASK (3<<30)
+#define GPON_SERDES_LASERMODE_NORMAL (0<<30)
+#define GPON_SERDES_LASERMODE_FORCE_OFF (1<<30)
+#define GPON_SERDES_LASERMODE_FORCE_ON (2<<30)
+ uint32 laserStatus;
+ uint32 miscCfg;
+ uint32 miscStatus;
+ uint32 phDet[5];
+} GponSerdesRegs;
+
+#define GPON_SERDES ((volatile GponSerdesRegs * const) GPON_SERDES_BASE)
+
+
+/*
+** PCI-E
+*/
+typedef struct PcieRegs{
+ uint32 devVenID;
+ uint16 command;
+ uint16 status;
+ uint32 revIdClassCode;
+ uint32 headerTypeLatCacheLineSize;
+ uint32 bar1;
+ uint32 bar2;
+ uint32 priSecBusNo;
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SUB_BUS_NO_MASK 0x00ff0000
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SUB_BUS_NO_SHIFT 16
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SEC_BUS_NO_MASK 0x0000ff00
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SEC_BUS_NO_SHIFT 8
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_PRI_BUS_NO_MASK 0x000000ff
+} PcieRegs;
+
+typedef struct PcieBlk404Regs{
+ uint32 unused; /* 0x404 */
+ uint32 config2; /* 0x408 */
+#define PCIE_IP_BLK404_CONFIG_2_BAR1_SIZE_MASK 0x0000000f
+#define PCIE_IP_BLK404_CONFIG_2_BAR1_DISABLE 0
+ uint32 config3; /* 0x40c */
+ uint32 pmDataA; /* 0x410 */
+ uint32 pmDataB; /* 0x414 */
+} PcieBlk404Regs;
+
+typedef struct PcieBlk428Regs{
+ uint32 vpdIntf; /* 0x428 */
+ uint16 unused_g; /* 0x42c */
+ uint16 vpdAddrFlag; /* 0x42e */
+ uint32 vpdData; /* 0x430 */
+ uint32 idVal1; /* 0x434 */
+ uint32 idVal2; /* 0x438 */
+ uint32 idVal3; /* 0x43c */
+#define PCIE_IP_BLK428_ID_VAL3_REVISION_ID_MASK 0xff000000
+#define PCIE_IP_BLK428_ID_VAL3_REVISION_ID_SHIFT 24
+#define PCIE_IP_BLK428_ID_VAL3_CLASS_CODE_MASK 0x00ffffff
+#define PCIE_IP_BLK428_ID_VAL3_CLASS_CODE_SHIFT 16
+#define PCIE_IP_BLK428_ID_VAL3_SUB_CLASS_CODE_SHIFT 8
+}PcieBlk428Regs;
+
+typedef struct PcieBridgeRegs{
+ uint32 bar1Remap; /* 0x0818*/
+ uint32 bar2Remap; /* 0x081c*/
+ uint32 bridgeOptReg1; /* 0x0820*/
+#define PCIE_BRIDGE_OPT_REG1_EN_RD_BE (1 << 4)
+#define PCIE_BRIDGE_OPT_REG1_EN_RD_BE_NOSWAP (1 << 5)
+ uint32 bridgeOptReg2; /* 0x0824*/
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_func_no_MASK 0xe0000000
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_func_no_SHIFT 29
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_dev_no_MASK 0x1f000000
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_dev_no_SHIFT 24
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bus_no_MASK 0x00ff0000
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bus_no_SHIFT 16
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bd_sel_MASK 0x00000080
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bd_sel_SHIFT 7
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_timeout_MASK 0x00000040
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_timeout_SHIFT 6
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_abort_MASK 0x00000020
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_abort_SHIFT 5
+#define PCIE_BRIDGE_OPT_REG2_enable_tx_crd_chk_MASK 0x00000010
+#define PCIE_BRIDGE_OPT_REG2_enable_tx_crd_chk_SHIFT 4
+#define PCIE_BRIDGE_OPT_REG2_dis_ubus_ur_decode_MASK 0x00000004
+#define PCIE_BRIDGE_OPT_REG2_dis_ubus_ur_decode_SHIFT 2
+#define PCIE_BRIDGE_OPT_REG2_cfg_reserved_MASK 0x0000ff0b
+}PcieBridgeRegs;
+
+typedef struct PcieBlk1000Regs{
+ uint32 undisclosed[18]; /*0x1000 - 0x1044*/
+ uint32 dlStatus; /* 0x1048 */
+#define PCIE_IP_BLK1000_DL_STATUS_PHYLINKUP_MASK 0x00002000
+#define PCIE_IP_BLK1000_DL_STATUS_PHYLINKUP_SHIFT 13
+}PcieBlk1000Regs;
+
+typedef struct PcieBlk1800Regs{
+#define NUM_PCIE_BLK_1800_PHY_CTRL_REGS 4
+ uint32 phyCtrl[NUM_PCIE_BLK_1800_PHY_CTRL_REGS];
+#define REG_POWERDOWN_P1PLL_ENA (1<<12)
+ uint32 phyErrorAttnVec;
+ uint32 phyErrorAttnMask;
+#define NUM_PCIE_BLK_1800_PHY_LTSSM_HIST_REGS 3
+ uint32 phyltssmHist[NUM_PCIE_BLK_1800_PHY_LTSSM_HIST_REGS];
+#define NUM_PCIE_BLK_1800_PHY_DBG_REGS 11
+ uint32 phyDbg[NUM_PCIE_BLK_1800_PHY_DBG_REGS];
+} PcieBlk1800Regs;
+
+#define PCIEH_DEV_OFFSET 0x8000
+#define PCIEH ((volatile uint32 * const) PCIE_BASE)
+#define PCIEH_REGS ((volatile PcieCfeType1Regs * const) PCIE_BASE)
+#define PCIEH_BLK_404_REGS ((volatile PcieBlk404Regs * const)(PCIE_BASE+0x404))
+#define PCIEH_BLK_428_REGS ((volatile PcieBlk428Regs * const)(PCIE_BASE+0x428))
+#define PCIEH_BRIDGE_REGS ((volatile PcieBridgeRegs * const) (PCIE_BASE+0x818))
+#define PCIEH_BLK_1000_REGS ((volatile PcieBlk1000Regs * const) (PCIE_BASE+0x1000))
+#define PCIEH_BLK_1800_REGS ((volatile PcieBlk1800Regs * const) (PCIE_BASE+0x1800))
+
+typedef struct EthSwRegs{
+ byte port_traffic_ctrl[9]; /* 0x00 - 0x08 */
+ byte reserved1[2]; /* 0x09 - 0x0a */
+ byte switch_mode; /* 0x0b */
+ unsigned short pause_quanta; /*0x0c */
+ byte imp_port_state; /*0x0e */
+ byte led_refresh; /* 0x0f */
+ unsigned short led_function[2]; /* 0x10 */
+ unsigned short led_function_map; /* 0x14 */
+ unsigned short led_enable_map; /* 0x16 */
+ unsigned short led_mode_map0; /* 0x18 */
+ unsigned short led_function_map1; /* 0x1a */
+ byte reserved2[5]; /* 0x1b - 0x20 */
+ byte port_forward_ctrl; /* 0x21 */
+ byte reserved3[2]; /* 0x22 - 0x23 */
+ unsigned short protected_port_selection; /* 0x24 */
+ unsigned short wan_port_select; /* 0x26 */
+ unsigned int pause_capability; /* 0x28 */
+ byte reserved4[3]; /* 0x2c - 0x2e */
+ byte reserved_multicast_control; /* 0x2f */
+ byte reserved5; /* 0x30 */
+ byte txq_flush_mode_control; /* 0x31 */
+ unsigned short ulf_forward_map; /* 0x32 */
+ unsigned short mlf_forward_map; /* 0x34 */
+ unsigned short mlf_impc_forward_map; /* 0x36 */
+ unsigned short pause_pass_through_for_rx; /* 0x38 */
+ unsigned short pause_pass_through_for_tx; /* 0x3a */
+ unsigned short disable_learning; /* 0x3c */
+ byte reserved6[26]; /* 0x3e - 0x57 */
+ byte port_state_override[8]; /* 0x58 - 0x5f */
+ byte reserved7[4]; /* 0x60 - 0x63 */
+ byte imp_rgmii_ctrl_p4; /* 0x64 */
+ byte imp_rgmii_ctrl_p5; /* 0x65 */
+ byte reserved8[6]; /* 0x66 - 0x6b */
+ byte rgmii_timing_delay_p4; /* 0x6c */
+ byte gmii_timing_delay_p5; /* 0x6d */
+ byte reserved9[11]; /* 0x6e - 0x78 */
+ byte software_reset; /* 0x79 */
+ byte reserved13[6]; /* 0x7a - 0x7f */
+ byte pause_frame_detection; /* 0x80 */
+ byte reserved10[7]; /* 0x81 - 0x87 */
+ byte fast_aging_ctrl; /* 0x88 */
+ byte fast_aging_port; /* 0x89 */
+ byte fast_aging_vid; /* 0x8a */
+ byte reserved11[21]; /* 0x8b - 0x9f */
+ unsigned int swpkt_ctrl_sar; /*0xa0 */
+ unsigned int swpkt_ctrl_usb; /*0xa4 */
+ unsigned int iudma_ctrl; /*0xa8 */
+ unsigned int rxfilt_ctrl; /*0xac */
+ unsigned int mdio_ctrl; /*0xb0 */
+ unsigned int mdio_data; /*0xb4 */
+ byte reserved12[42]; /* 0xb6 - 0xdf */
+ unsigned int sw_mem_test; /*0xe0 */
+} EthSwRegs;
+
+#define ETHSWREG ((volatile EthSwRegs * const) SWITCH_BASE)
+
+typedef struct EthSwMIBRegs {
+ unsigned int TxOctetsLo;
+ unsigned int TxOctetsHi;
+ unsigned int TxDropPkts;
+ unsigned int TxQoSPkts;
+ unsigned int TxBroadcastPkts;
+ unsigned int TxMulticastPkts;
+ unsigned int TxUnicastPkts;
+ unsigned int TxCol;
+ unsigned int TxSingleCol;
+ unsigned int TxMultipleCol;
+ unsigned int TxDeferredTx;
+ unsigned int TxLateCol;
+ unsigned int TxExcessiveCol;
+ unsigned int TxFrameInDisc;
+ unsigned int TxPausePkts;
+ unsigned int TxQoSOctetsLo;
+ unsigned int TxQoSOctetsHi;
+ unsigned int RxOctetsLo;
+ unsigned int RxOctetsHi;
+ unsigned int RxUndersizePkts;
+ unsigned int RxPausePkts;
+ unsigned int Pkts64Octets;
+ unsigned int Pkts65to127Octets;
+ unsigned int Pkts128to255Octets;
+ unsigned int Pkts256to511Octets;
+ unsigned int Pkts512to1023Octets;
+ unsigned int Pkts1024to1522Octets;
+ unsigned int RxOversizePkts;
+ unsigned int RxJabbers;
+ unsigned int RxAlignErrs;
+ unsigned int RxFCSErrs;
+ unsigned int RxGoodOctetsLo;
+ unsigned int RxGoodOctetsHi;
+ unsigned int RxDropPkts;
+ unsigned int RxUnicastPkts;
+ unsigned int RxMulticastPkts;
+ unsigned int RxBroadcastPkts;
+ unsigned int RxSAChanges;
+ unsigned int RxFragments;
+ unsigned int RxExcessSizeDisc;
+ unsigned int RxSymbolError;
+ unsigned int RxQoSPkts;
+ unsigned int RxQoSOctetsLo;
+ unsigned int RxQoSOctetsHi;
+ unsigned int Pkts1523to2047;
+ unsigned int Pkts2048to4095;
+ unsigned int Pkts4096to8191;
+ unsigned int Pkts8192to9728;
+} EthSwMIBRegs;
+
+#define ETHSWMIBREG ((volatile EthSwMIBRegs * const) (SWITCH_BASE + 0x2000))
+
+/*
+** NAND Interrupt Controller Registers
+*/
+typedef struct NandIntrCtrlRegs {
+ uint32 NandInterrupt;
+#define NINT_ENABLE_MASK 0xffff0000
+#define NINT_STS_MASK 0x00000fff
+#define NINT_ECC_ERROR_CORR 0x00000080
+#define NINT_ECC_ERROR_UNC 0x00000040
+#define NINT_DEV_RBPIN 0x00000020
+#define NINT_CTRL_READY 0x00000010
+#define NINT_PAGE_PGM 0x00000008
+#define NINT_COPY_BACK 0x00000004
+#define NINT_BLOCK_ERASE 0x00000002
+#define NINT_NP_READ 0x00000001
+
+ uint32 NandBaseAddr0; /* Default address when booting from NAND flash */
+ uint32 reserved;
+ uint32 NandBaseAddr1; /* Secondary base address for NAND flash */
+} NandIntrCtrlRegs;
+
+#define NAND_INTR ((volatile NandIntrCtrlRegs * const) NAND_INTR_BASE)
+
+/*
+** NAND Controller Registers
+*/
+typedef struct NandCtrlRegs {
+ uint32 NandRevision; /* NAND Revision */
+ uint32 NandCmdStart; /* Nand Flash Command Start */
+#define NCMD_MASK 0x0f000000
+#define NCMD_BLK_LOCK_STS 0x0d000000
+#define NCMD_BLK_UNLOCK 0x0c000000
+#define NCMD_BLK_LOCK_DOWN 0x0b000000
+#define NCMD_BLK_LOCK 0x0a000000
+#define NCMD_FLASH_RESET 0x09000000
+#define NCMD_BLOCK_ERASE 0x08000000
+#define NCMD_DEV_ID_READ 0x07000000
+#define NCMD_COPY_BACK 0x06000000
+#define NCMD_PROGRAM_SPARE 0x05000000
+#define NCMD_PROGRAM_PAGE 0x04000000
+#define NCMD_STS_READ 0x03000000
+#define NCMD_SPARE_READ 0x02000000
+#define NCMD_PAGE_READ 0x01000000
+
+ uint32 NandCmdExtAddr; /* Nand Flash Command Extended Address */
+ uint32 NandCmdAddr; /* Nand Flash Command Address */
+ uint32 NandCmdEndAddr; /* Nand Flash Command End Address */
+ uint32 NandNandBootConfig; /* Nand Flash Boot Config */
+#define NBC_CS_LOCK 0x80000000
+#define NBC_AUTO_DEV_ID_CFG 0x40000000
+#define NBC_WR_PROT_BLK0 0x10000000
+
+ uint32 NandCsNandXor; /* Nand Flash EBI CS Address XOR with */
+ /* 1FC0 Control */
+ uint32 NandReserved;
+ uint32 NandSpareAreaReadOfs0; /* Nand Flash Spare Area Read Bytes 0-3 */
+ uint32 NandSpareAreaReadOfs4; /* Nand Flash Spare Area Read Bytes 4-7 */
+ uint32 NandSpareAreaReadOfs8; /* Nand Flash Spare Area Read Bytes 8-11 */
+ uint32 NandSpareAreaReadOfsC; /* Nand Flash Spare Area Read Bytes 12-15*/
+ uint32 NandSpareAreaWriteOfs0; /* Nand Flash Spare Area Write Bytes 0-3 */
+ uint32 NandSpareAreaWriteOfs4; /* Nand Flash Spare Area Write Bytes 4-7 */
+ uint32 NandSpareAreaWriteOfs8; /* Nand Flash Spare Area Write Bytes 8-11*/
+ uint32 NandSpareAreaWriteOfsC; /* Nand Flash Spare Area Write Bytes12-15*/
+ uint32 NandAccControl; /* Nand Flash Access Control */
+ uint32 NandConfig; /* Nand Flash Config */
+#define NC_CONFIG_LOCK 0x80000000
+#define NC_PG_SIZE_MASK 0x40000000
+#define NC_PG_SIZE_2K 0x40000000
+#define NC_PG_SIZE_512B 0x00000000
+#define NC_BLK_SIZE_MASK 0x30000000
+#define NC_BLK_SIZE_512K 0x30000000
+#define NC_BLK_SIZE_128K 0x10000000
+#define NC_BLK_SIZE_16K 0x00000000
+#define NC_BLK_SIZE_8K 0x20000000
+#define NC_DEV_SIZE_MASK 0x0f000000
+#define NC_DEV_SIZE_SHIFT 24
+#define NC_DEV_WIDTH_MASK 0x00800000
+#define NC_DEV_WIDTH_16 0x00800000
+#define NC_DEV_WIDTH_8 0x00000000
+#define NC_FUL_ADDR_MASK 0x00070000
+#define NC_FUL_ADDR_SHIFT 16
+#define NC_BLK_ADDR_MASK 0x00000700
+#define NC_BLK_ADDR_SHIFT 8
+
+ uint32 NandTiming1; /* Nand Flash Timing Parameters 1 */
+ uint32 NandTiming2; /* Nand Flash Timing Parameters 2 */
+ uint32 NandSemaphore; /* Semaphore */
+ uint32 NandFlashDeviceId; /* Nand Flash Device ID */
+ uint32 NandBlockLockStatus; /* Nand Flash Block Lock Status */
+ uint32 NandIntfcStatus; /* Nand Flash Interface Status */
+#define NIS_CTLR_READY 0x80000000
+#define NIS_FLASH_READY 0x40000000
+#define NIS_CACHE_VALID 0x20000000
+#define NIS_SPARE_VALID 0x10000000
+#define NIS_FLASH_STS_MASK 0x000000ff
+#define NIS_WRITE_PROTECT 0x00000080
+#define NIS_DEV_READY 0x00000040
+#define NIS_PGM_ERASE_ERROR 0x00000001
+
+ uint32 NandEccCorrExtAddr; /* ECC Correctable Error Extended Address*/
+ uint32 NandEccCorrAddr; /* ECC Correctable Error Address */
+ uint32 NandEccUncExtAddr; /* ECC Uncorrectable Error Extended Addr */
+ uint32 NandEccUncAddr; /* ECC Uncorrectable Error Address */
+ uint32 NandFlashReadExtAddr; /* Flash Read Data Extended Address */
+ uint32 NandFlashReadAddr; /* Flash Read Data Address */
+ uint32 NandProgramPageExtAddr; /* Page Program Extended Address */
+ uint32 NandProgramPageAddr; /* Page Program Address */
+ uint32 NandCopyBackExtAddr; /* Copy Back Extended Address */
+ uint32 NandCopyBackAddr; /* Copy Back Address */
+ uint32 NandBlockEraseExtAddr; /* Block Erase Extended Address */
+ uint32 NandBlockEraseAddr; /* Block Erase Address */
+ uint32 NandInvReadExtAddr; /* Flash Invalid Data Extended Address */
+ uint32 NandInvReadAddr; /* Flash Invalid Data Address */
+ uint32 NandBlkWrProtect; /* Block Write Protect Enable and Size */
+ /* for EBI_CS0b */
+} NandCtrlRegs;
+
+#define NAND ((volatile NandCtrlRegs * const) NAND_REG_BASE)
+
+#define NAND_CACHE ((volatile uint8 * const) NAND_CACHE_BASE)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/shared/broadcom/include/bcm963xx/mocablock.h b/shared/broadcom/include/bcm963xx/mocablock.h
new file mode 100755
index 0000000..bccb24b
--- /dev/null
+++ b/shared/broadcom/include/bcm963xx/mocablock.h
@@ -0,0 +1,144 @@
+/*
+<:copyright-broadcom
+
+ Copyright (c) 2007 Broadcom Corporation
+ All Rights Reserved
+ No portions of this material may be reproduced in any form without the
+ written permission of:
+ Broadcom Corporation
+ 5300 California Avenue
+ Irvine, California 92617
+ All information contained in this document is Broadcom Corporation
+ company private, proprietary, and trade secret.
+
+:>
+*/
+/***************************************************************************
+ * File Name : MoCABlock.h
+ *
+ * Description: This file contains definitions for the MoCA Block for the
+ * BCM6816 and the BCM3450 chipset(s).
+ ***************************************************************************/
+
+#if !defined(_MoCABLOCK_H_)
+#define _MoCABLOCK_H_
+
+/* BCM 96816 related definitions . */
+#define MoCA_INTERRUPT_DISABLE 0x0
+#define MoCA_INTERRUPT_ENABLE 0x1
+
+/* Definitions for coreInterrupts from host */
+#define MoCA_HOST_RESP_TO_CORE 0x1
+#define MoCA_HOST_REQ_TO_CORE 0x2
+
+/* Definitions for hostInterrupts from core */
+#define MoCA_CORE_RESP_TO_HOST 0x1
+#define MoCA_CORE_REQ_TO_HOST 0x2
+#define MoCA_CORE_ASSERT_TO_HOST 0x4
+#define MoCA_CORE_UNUSED 0xFC
+#define MoCA_CORE_DDR_START 0x100
+#define MoCA_CORE_DDR_END 0x200
+
+#define MoCA_LED_LINK_ON_ACTIVE_OFF 0x0
+#define MoCA_LED_LINK_OFF_ACTIVE_OFF 0x1
+#define MoCA_LED_LINK_ON_ACTIVE_ON 0x2
+#define MoCA_LED_LINK_OFF_ACTIVE_ON 0x3 /* NW Search and New Node Admission */
+typedef struct _MoCAExtras {
+ UINT32 host2MoCAIntEn ;
+ UINT32 host2MoCAIntTrig ;
+ UINT32 host2MoCAIntStatus ;
+ UINT32 MoCA2HostIntEn ;
+ UINT32 MoCA2HostIntTrig ;
+ UINT32 MoCA2HostIntStatus ;
+ UINT32 genPurpose0 ;
+ UINT32 genPurpose1 ;
+ UINT32 sideBandGmiiFC ;
+ UINT32 leds ;
+ UINT32 MoCAStatus ;
+ UINT32 testMuxSel ;
+ UINT32 mdCtrl ;
+ UINT32 mdcDivider ;
+ UINT32 outRefIntR01 ;
+ UINT32 outRefIntR02 ;
+ UINT32 outRefIntR03 ;
+ UINT32 outRefIntR04 ;
+ UINT32 outRefIntR05 ;
+ UINT32 outRefIntSel ;
+} MoCAExtras ;
+
+
+typedef struct _MoCAMACRegs {
+ UINT32 macCtrl ; // 0x00
+#define MoCA_MAC_REGS_MAC_CTRL_MAC_ENABLE 0x00000001
+ UINT32 resv1 [7] ;
+ UINT32 frmHdr ; // 0x20
+ UINT32 msduHdr ; // 0x24
+ UINT32 resv2 [2] ;
+ UINT32 macStatus ; // 0x30
+ UINT32 macStatusEn ; // 0x34
+ UINT32 resv3 [2] ;
+ UINT32 netTimer ; // 0x40
+ UINT32 maxNetTimerCorr ; // 0x44
+ UINT32 timerCorrCtrl ; // 0x48
+ UINT32 bitParams ; // 0x4c
+ UINT32 fineCorr ; // 0x50
+ UINT32 coarseCorr ; // 0x54
+ UINT32 loadTimer1 ; // 0x58
+ UINT32 loadTimer2 ; // 0x5c
+ UINT32 mpiConfigCtrl ; // 0x60
+#define MoCA_MAC_REGS_MPI_CONFIG_CTRL_READ 0x00000001
+#define MoCA_MAC_REGS_MPI_CONFIG_CTRL_WRITE 0x00000002
+ UINT32 mpiConfigAddr ; // 0x64
+ UINT32 mpiConfigDataW ; // 0x68
+ UINT32 mpiConfigDataR ; // 0x6c
+} MoCA_MAC_REGST, *PMoCA_MAC_REGST ;
+
+#define MoCA_BLOCK_BASE MOCA_MEM_BASE
+typedef struct MoCABlockT {
+
+ UINT8 dataMem [0x3FFFC] ;
+ UINT8 resvd [0x61403] ;
+ MoCAExtras extras ; // 0xb0da1400.
+ //MoCAHostM2M follows.
+ //MoCAMoCAM2M follows.
+} MoCA_BLOCKT, *PMoCA_BLOCKT ;
+
+#define MoCA_PHYS_IO_BASE NONCACHE_TO_PHYS(MOCA_IO_BASE)
+#define MoCA_BLOCK_MAC_REGS_START (MOCA_IO_BASE+0x400)
+#define MoCA_BLOCK_PHY_START MoCA_PHYS_IO_BASE+0x8000
+#define MoCA_BLOCK_PHY_END MoCA_PHYS_IO_BASE+0xA3FF
+#define MoCA_BLOCK ((volatile PMoCA_BLOCKT const) MoCA_BLOCK_BASE)
+#define MoCA_MAC_REGS ((volatile PMoCA_MAC_REGST const) MoCA_BLOCK_MAC_REGS_START)
+#define MoCA_CORE_MEM_BASE MoCA_BLOCK->dataMem
+#define MoCA_MAIL_BOX_ADDR_REG MoCA_BLOCK->extras.genPurpose0
+#define MoCA_IQ_SNR_ADDR_REG MoCA_BLOCK->extras.genPurpose1
+
+/* BCM 93450 related definitions . */
+
+#define BCM3450_I2C_CHIP_ADDRESS 0x70
+typedef struct _Bcm3450Reg {
+ UINT32 ChipId; /* 0x0 */
+ UINT32 ChipRev; /* 0x4 */
+ UINT32 Test; /* 0x8 */
+ UINT32 SerialCtl; /* 0xc */
+ UINT32 StatusRead; /* 0x10 */
+ UINT32 LnaCntl; /* 0x14 */
+ UINT32 PaCntl; /* 0x18 */
+#define BCM3450_PACNTL_PA_RDEG_SHIFT 11
+#define BCM3450_PACNTL_PA_RDEG_MASK 0x00007800
+#define BCM3450_PACNTL_PA_CURR_CONT_SHIFT 5
+#define BCM3450_PACNTL_PA_CURR_CONT_MASK 0x000007E0
+#define BCM3450_PACNTL_PA_CURR_FOLLOWER_SHIFT 2
+#define BCM3450_PACNTL_PA_CURR_FOLLOWER_MASK 0x0000001C
+#define BCM3450_PACNTL_PA_PWRDWN_SHIFT 0
+#define BCM3450_PACNTL_PA_PWRDWN_MASK 0x00000001
+#define BCM3450_PACNTL_OFFSET 0x18
+ UINT32 Misc; /* 0x1c */
+#define BCM3452_MISC_BG_PWRDWN_SHIFT 15
+#define BCM3452_MISC_BG_PWRDWN_MASK 0x00008000
+#define BCM3450_MISC_IIC_RESET 0x1
+#define BCM3450_MISC_SERIAL_RESET 0x2
+#define BCM3450_MISC_OFFSET 0x1c
+} Bcm3450Reg ;
+
+#endif /* _MoCABLOCK_H_ */
diff --git a/shared/broadcom/include/bcm963xx/robosw_reg.h b/shared/broadcom/include/bcm963xx/robosw_reg.h
new file mode 100755
index 0000000..4fcc0ac
--- /dev/null
+++ b/shared/broadcom/include/bcm963xx/robosw_reg.h
@@ -0,0 +1,169 @@
+/*
+<:copyright-broadcom
+
+ Copyright (c) 2007 Broadcom Corporation
+ All Rights Reserved
+ No portions of this material may be reproduced in any form without the
+ written permission of:
+ Broadcom Corporation
+ 16215 Alton Parkway
+ Irvine, California 92619
+ All information contained in this document is Broadcom Corporation
+ company private, proprietary, and trade secret.
+
+:>
+*/
+
+#ifndef __ROBOSW_REG_H
+#define __ROBOSW_REG_H
+
+void robosw_init(void);
+void robosw_configure_ports(void);
+void robosw_check_ports(void);
+
+// These macros make offset validation vs. data sheet easier.
+
+#define group(type, name, start_offset, next) type name[(next - start_offset) / sizeof(type)]
+#define entry(type, name, start_offset, next) type name
+
+typedef struct RoboSwitch {
+ group(byte, PortCtrl, 0x0000, 0x0009);
+ group(byte, Reserved0009, 0x0009, 0x000b);
+ entry(byte, SwitchMode, 0x000b, 0x000c);
+ entry(uint16, PauseQuanta, 0x000c, 0x000e);
+ entry(byte, ImpOverride, 0x000e, 0x000f);
+ entry(byte, LedRefresh, 0x000f, 0x0010);
+ entry(uint16, LedFunc0, 0x0010, 0x0012);
+ entry(uint16, LedFunc1, 0x0012, 0x0014);
+ entry(uint16, LedFuncMap, 0x0014, 0x0016);
+ entry(uint16, LedEnableMap, 0x0016, 0x0018);
+ entry(uint16, LedMap0, 0x0018, 0x001a);
+ entry(uint16, LedMap1, 0x001a, 0x001c);
+ group(byte, Reserved001c, 0x001c, 0x0020);
+ group(byte, Reserved0020, 0x0020, 0x0021);
+ entry(byte, ForwardCtrl, 0x0021, 0x0022);
+ group(byte, Reserved0022, 0x0022, 0x0024);
+ entry(uint16, ProtSelect, 0x0024, 0x0026);
+ entry(uint16, WanSelect, 0x0026, 0x0028);
+ entry(uint32, PauseCap, 0x0028, 0x002c);
+ group(byte, Reserved002c, 0x002c, 0x002f);
+ entry(byte, MultiCtrl, 0x002f, 0x0030);
+ group(byte, Reserved0030, 0x0030, 0x0031);
+ entry(byte, TxqFlush, 0x0031, 0x0032);
+ entry(uint16, UniFail, 0x0032, 0x0034);
+ entry(uint16, MultiFail, 0x0034, 0x0036);
+ entry(uint16, MlfIpmc, 0x0036, 0x0038);
+ entry(uint16, PausePassRx, 0x0038, 0x003a);
+ entry(uint16, PausePassTx, 0x003a, 0x003c);
+ entry(uint16, DisableLearn, 0x003c, 0x003e);
+ group(byte, Reserved003e, 0x003e, 0x004a);
+ entry(uint16, PllTest, 0x004a, 0x004c);
+ group(byte, Reserved004c, 0x004c, 0x0058);
+ group(byte, PortOverride, 0x0058, 0x0060);
+ group(byte, Reserved0061, 0x0060, 0x0064);
+ entry(byte, ImpRgmiiCtrlP4, 0x0064, 0x0065);
+ entry(byte, ImpRgmiiCtrlP5, 0x0065, 0x0066);
+ group(byte, Reserved0066, 0x0066, 0x006c);
+ entry(byte, ImpRgmiiTimingDelayP4, 0x006c, 0x006d);
+ entry(byte, ImpRgmiiTimingDelayP5, 0x006d, 0x006e);
+ group(byte, Reserved006e, 0x006e, 0x0079);
+ entry(byte, SWResetCtrl, 0x0079, 0x007a);
+ group(byte, Reserved007a, 0x007a, 0x0090);
+ entry(uint32, Rxfilt_Ctl, 0x0090, 0x0094);
+ entry(uint32, Cmf_En_Ctl, 0x0094, 0x0098);
+ group(byte, Reserved0098, 0x0098, 0x00a0);
+ entry(uint32, SwpktCtrl0, 0x00a0, 0x00a4);
+ entry(uint32, SwpktCtrl1, 0x00a4, 0x00a8);
+ group(byte, Reserved00a8, 0x00a8, 0x00b0);
+ entry(uint32, MdioCtrl, 0x00b0, 0x00b4);
+ entry(uint16, MdioData, 0x00b4, 0x00b6);
+ group(byte, Reserved00b4, 0x00b6, 0x0200);
+ entry(byte, GlbMgmt, 0x0200, 0x0201);
+ entry(byte, ChpBoxID, 0x0201, 0x0202);
+ entry(byte, MngPID, 0x0202, 0x0203);
+ group(byte, Reserved0203, 0x0203, 0x1100);
+ entry(uint16, MIICtrl0, 0x1100, 0x1101);
+
+} RoboSwitch;
+
+#define SWITCH ((volatile RoboSwitch * const)SWITCH_BASE)
+#define PBVLAN_OFFSET 0x3100
+#define PBMAP_MIPS 0x100
+#define SWITCH_PBVLAN ((volatile uint16 * const)(SWITCH_BASE + PBVLAN_OFFSET))
+
+#define PortCtrl_Forwarding 0xa0
+#define PortCtrl_Learning 0x80
+#define PortCtrl_Listening 0x60
+#define PortCtrl_Blocking 0x40
+#define PortCtrl_Disable 0x20
+#define PortCtrl_RxUcstEn 0x10
+#define PortCtrl_RxMcstEn 0x08
+#define PortCtrl_RxBcstEn 0x04
+#define PortCtrl_DisableTx 0x02
+#define PortCtrl_DisableRx 0x01
+
+#define SwitchMode_FwdgEn 0x02
+#define SwitchMode_ManageMode 0x01
+
+#define ImpOverride_Force 0x80
+#define ImpOverride_TxFlow 0x20
+#define ImpOverrode_RxFlow 0x10
+#define ImpOverride_1000Mbs 0x08
+#define ImpOverride_100Mbs 0x04
+#define ImpOverride_10Mbs 0x00
+#define ImpOverride_Fdx 0x02
+#define ImpOverride_Linkup 0x01
+
+#define PortOverride_Enable 0x40
+#define PortOverride_TxFlow 0x20
+#define PortOverride_RxFlow 0x10
+#define PortOverride_1000Mbs 0x08
+#define PortOverride_100Mbs 0x04
+#define PortOverride_10Mbs 0x00
+#define PortOverride_Fdx 0x02
+#define PortOverride_Linkup 0x01
+
+#define GlbMgmt_EnableImp 0x80
+#define GlbMgmt_IgmpSnooping 0x08
+#define GlbMgmt_ReceiveBpdu 0x02
+#define GlbMgmt_ResetMib 0x01
+
+#define MdioCtrl_Write (1 << 31)
+#define MdioCtrl_Read (1 << 30)
+#define MdioCtrl_Ext (1 << 16)
+#define MdioCtrl_ID_Shift 25
+#define MdioCtrl_ID_Mask (0x1f << MdioCtrl_ID_Shift)
+#define MdioCtrl_Addr_Shift 20
+#define MdioCtrl_Addr_Mask (0x1f << MdioCtrl_Addr_Shift)
+
+#define ImpRgmiiCtrl_GMII_En 0x80
+#define ImpRgmiiCtrl_DLL_IQQD 0x04
+#define ImpRgmiiCtrl_DLL_RXC_Bypass 0x02
+#define ImpRgmiiCtrl_Timing_Sel 0x01
+
+#define ImpRgmiiTimingDelayDefault 0xF9
+
+#if defined (_BCM96328_)
+#define EPHY_PORTS 5
+#define PORT_6_PORT_ID 6
+#define PORT_7_PORT_ID 7
+#endif
+#if defined (_BCM96362_)
+#define EPHY_PORTS 6
+#define PORT_6_PORT_ID 6
+#define PORT_7_PORT_ID 7
+#endif
+#if defined (_BCM96368_)
+#define EPHY_PORTS 6
+#define USB_PORT_ID 6
+#define SAR_PORT_ID 7
+#endif
+#if defined (_BCM96816_)
+#define EPHY_PORTS 4
+#define SERDES_PORT_ID 4
+#define MOCA_PORT_ID 5
+#define USB_PORT_ID 6
+#define GPON_PORT_ID 7
+#endif
+
+#endif
diff --git a/shared/broadcom/include/bcm963xx/xtmprocregs.h b/shared/broadcom/include/bcm963xx/xtmprocregs.h
new file mode 100755
index 0000000..307ed79
--- /dev/null
+++ b/shared/broadcom/include/bcm963xx/xtmprocregs.h
@@ -0,0 +1,602 @@
+/*
+<:copyright-broadcom
+
+ Copyright (c) 2007 Broadcom Corporation
+ All Rights Reserved
+ No portions of this material may be reproduced in any form without the
+ written permission of:
+ Broadcom Corporation
+ 5300 California Avenue
+ Irvine, California 92617
+ All information contained in this document is Broadcom Corporation
+ company private, proprietary, and trade secret.
+
+:>
+*/
+/***************************************************************************
+ * File Name : XtmProcRegs.h
+ *
+ * Description: This file contains definitions for the ATM/PTM processor
+ * registers.
+ ***************************************************************************/
+
+#if !defined(_XTMPROCREGS_H_)
+#define _XTMPROCREGS_H_
+
+/* Miscellaneous values. */
+#define XP_MAX_PORTS 4
+#define XP_MAX_CONNS 16
+#define XP_MAX_RX_QUEUES 4
+#define XP_MAX_TX_HDRS 8
+#define XP_TX_HDR_WORDS (16 / sizeof(UINT32))
+#define XP_RX_MIB_MATCH_ENTRIES 128
+
+/* Circuit types. */
+#define XCT_TRANSPARENT 0x00000001
+#define XCT_AAL0_PKT 0x00000002
+#define XCT_AAL0_CELL 0x00000003
+#define XCT_OAM_F5_SEG 0x00000004
+#define XCT_OAM_F5_E2E 0x00000005
+#define XCT_RM 0x00000006
+#define XCT_AAL5 0x00000007
+#define XCT_ASM_P0 0x00000008
+#define XCT_ASM_P1 0x00000009
+#define XCT_ASM_P2 0x0000000a
+#define XCT_ASM_P3 0x0000000b
+#define XCT_OAM_F4_SEG 0x0000000c
+#define XCT_OAM_F4_E2E 0x0000000d
+#define XCT_TEQ 0x0000000e
+#define XCT_PTM 0x0000000f
+
+/* Definitions for ATM ulTxChannelCfg. */
+#define TXCHA_VCID_MASK 0x0000000f
+#define TXCHA_VCID_SHIFT 0
+#define TXCHA_CT_MASK 0x000000f0
+#define TXCHA_CT_SHIFT 4
+#define TXCHA_CT_TRANSPARENT (XCT_TRANSPARENT << TXCHA_CT_SHIFT)
+#define TXCHA_CT_AAL0_PKT (XCT_AAL0_PKT << TXCHA_CT_SHIFT)
+#define TXCHA_CT_AAL0_CELL (XCT_AAL0_CELL << TXCHA_CT_SHIFT)
+#define TXCHA_CT_OAM_F5_SEG (XCT_OAM_F5_SEG << TXCHA_CT_SHIFT)
+#define TXCHA_CT_OAM_F5_E2E (XCT_OAM_F5_E2E << TXCHA_CT_SHIFT)
+#define TXCHA_CT_RM (XCT_RM << TXCHA_CT_SHIFT)
+#define TXCHA_CT_AAL5 (XCT_AAL5 << TXCHA_CT_SHIFT)
+#define TXCHA_CT_ASM_P0 (XCT_ASM_P0 << TXCHA_CT_SHIFT)
+#define TXCHA_CT_ASM_P1 (XCT_ASM_P1 << TXCHA_CT_SHIFT)
+#define TXCHA_CT_ASM_P2 (XCT_ASM_P2 << TXCHA_CT_SHIFT)
+#define TXCHA_CT_ASM_P3 (XCT_ASM_P3 << TXCHA_CT_SHIFT)
+#define TXCHA_CT_OAM_F4_SEG (XCT_OAM_F4_SEG << TXCHA_CT_SHIFT)
+#define TXCHA_CT_OAM_F4_E2E (XCT_OAM_F4_E2E << TXCHA_CT_SHIFT)
+#define TXCHA_CT_TEQ (XCT_TEQ << TXCHA_CT_SHIFT)
+#define TXCHA_CT_PTM (XCT_PTM << TXCHA_CT_SHIFT)
+#define TXCHA_CI 0x00000100
+#define TXCHA_CLP 0x00000200
+#define TXCHA_USE_ALT_GFC 0x00000400
+#define TXCHA_ALT_GFC_MASK 0x00007800
+#define TXCHA_ALT_GFC_SHIFT 11
+#define TXCHA_HDR_EN 0x00008000
+#define TXCHA_HDR_IDX_MASK 0x00070000
+#define TXCHA_HDR_IDX_SHIFT 16
+#define TXCHA_FCS_STRIP 0x00080000
+
+/* Definitions for PTM ulTxChannelCfg. */
+#define TXCHP_FCS_EN 0x00000001
+#define TXCHP_CRC_EN 0x00000002
+#define TXCHP_HDR_EN 0x00008000
+#define TXCHP_HDR_IDX_MASK 0x00070000
+#define TXCHP_HDR_IDX_SHIFT 16
+
+/* Definitions for ulSwitchPktCfg. */
+#define SWP_MAX_PKT_COUNT_MASK 0x00000003
+#define SWP_MAX_PKT_COUNT_SHIFT 0
+#define SWP_MAX_PKT_SIZE_MASK 0x0000007c
+#define SWP_MAX_PKT_SIZE_SHIFT 2
+#define SWP_SRC_ID_MASK 0x00000380
+#define SWP_SRC_ID_SHIFT 7
+#define SWP_RX_CHAN_MASK 0x00000c00
+#define SWP_RX_CHAN_SHIFT 10
+#define SWP_TX_CHAN_MASK 0x0000f000
+#define SWP_TX_CHAN_SHIFT 12
+#define SWP_TX_EN 0x00010000
+#define SWP_RX_EN 0x00020000
+
+/* Definitions for ulSwitchPktTxCtrl. */
+#define SWP_VCID_VALUE_MASK 0x0000000f
+#define SWP_VCID_VALUE_SHIFT 0
+#define SWP_CT_VALUE_MASK 0x000000f0
+#define SWP_CT_VALUE_SHIFT 4
+#define SWP_FSTAT_CFG_VALUE_MASK 0x00000700
+#define SWP_FSTAT_CFG_VALUE_SHIFT 8
+#define SWP_MUX_MODE_VALUE 0x00000800
+#define SWP_VCID_MASK_MASK 0x000f0000
+#define SWP_VCID_MASK_SHIFT 16
+#define SWP_CT_MASK_MASK 0x00f00000
+#define SWP_CT_MASK_SHIFT 20
+#define SWP_FSTAT_CFG_MASK_MASK 0x07000000
+#define SWP_FSTAT_CFG_MASK_SHIFT 24
+#define SWP_MUX_MODE_MASK 0x08000000
+
+/* Definitions for ulSwitchPktRxCtrl. */
+#define SWP_MATCH_MASK 0x0000007f
+#define SWP_MASK_SHIFT 0
+#define SWP_CRC32 0x00000080
+#define SWP_DEST_PORT_MASK 0x0000ff00
+#define SWP_DEST_PORT_SHIFT 8
+#define SWP_MUX_MATCH_MASK 0x007f0000
+#define SWP_MUX_MATCH_SHIFT 16
+#define SWP_MUX_CRC32 0x00800000
+#define SWP_MUX_DESTPORT_MASK 0xff000000
+#define SWP_MUX_DESTPORT_SHIFT 24
+
+/* Definitions for ulPktModCtrl. */
+#define PKTM_RXQ_EN_MASK 0x0000000f
+#define PKTM_RXQ_EN_SHIFT 0
+#define PKTM_EN 0x80000000
+
+/* Definitions for ulIrqStatus and ulIrqMask. */
+#define INTR_RX_BUF_EMPTY 0x00000001
+#define INTR_TX_BUF_EMPTY 0x00000002
+#define INTR_RX_DMA_NO_DESC_MASK 0x0000003c
+#define INTR_RX_DMA_NO_DESC_SHIFT 2
+#define INTR_PTM_FRAG_ERROR 0x00000040
+#define INTR_PKT_BUF_UNDERFLOW 0x00000080
+#define INTR_TX_DMA_UNDERFLOW 0x00000100
+#define INTR_TX_ATM_DC 0x00000200
+#define INTR_BOND_BUF_FULL 0x00000400
+#define INTR_RX_ATM_DC 0x00000800
+#define INTR_MULT_MATCH_ERROR 0x00001000
+#define INTR_PKT_BUF_IRQ_MASK 0x0000e000
+#define INTR_PKT_BUF_IRQ_SHIFT 13
+
+/* Definitions for ulTxSarCfg. */
+#define TXSAR_MODE_ATM 0x00000000
+#define TXSAR_MODE_PTM 0x00000001
+#define TXSARA_BOND_EN 0x00000002
+#define TXSARA_SID12_EN 0x00000004
+#define TXSARA_CRC10_INIT 0x00000008
+#define TXSARA_CRC10_EN_MASK 0x000000f0
+#define TXSARA_CRC10_EN_SHIFT 4
+#define TXSARA_BOND_DUAL_LATENCY 0x00000100
+#define TXSAR_USE_ALT_FSTAT 0x00000200
+#define TXSARP_ENET_FCS_INSERT 0x00000400
+#define TXSARP_CRC16_EN 0x00000800
+#define TXSARP_SOF_WHILE_TX 0x00001000
+#define TXSARP_PREEMPT 0x00002000
+#define TXSAR_HDR_INS_OFFSET_MASK 0x0007c000
+#define TXSAR_HDR_INS_OFFSET_SHIFT 14
+#define TXSARP_NUM_Z_BYTES_MASK 0x00780000
+#define TXSARP_NUM_Z_BYTES_SHIFT 19
+#define TXSAR_SW_EN 0x00800000
+#define TXSAR_USE_THRESH 0x01000000
+#define TXSAR_PKT_THRESH_MASK 0x06000000
+#define TXSAR_PKT_THRESH_SHIFT 25
+#define TXSARA_BOND_PORT_DIS_MASK 0x78000000
+#define TXSARA_BOND_PORT_DIS_SHIFT 27
+#define TXSARA_ASM_CRC_DIS 0x80000000
+
+/* Definitions for ulTxSchedCfg. */
+#define TXSCH_PORT_EN_MASK 0x0000000f
+#define TXSCH_PORT_EN_SHIFT 0
+#define TXSCHA_ALT_SHAPER_MODE 0x00000010
+#define TXSCHP_FAST_SCHED 0x00000020
+#define TXSCH_SHAPER_RESET 0x00000040
+#define TXSCH_SIT_COUNT_EN 0x00000080
+#define TXSCH_SIT_COUNT_VALUE_MASK 0x00ffff00
+#define TXSCH_SIT_COUNT_VALUE_SHIFT 8
+#define TXSCH_SIT_MAX_VALUE (TXSCH_SIT_COUNT_VALUE_MASK >> \
+ TXSCH_SIT_COUNT_VALUE_SHIFT)
+#define TXSCH_SOFWT_PRIORITY_EN 0x01000000
+#define TXSCH_BASE_COUNT_EN 0x02000000
+#define TXSCH_BASE_COUNT_VALUE_MASK 0x3c000000
+#define TXSCH_BASE_COUNT_VALUE_SHIFT 26
+#define TXSCHP_USE_BIT4_SOF 0x40000000
+#define TXSCH_ALT_MCR_MODE 0x80000000
+
+/* Definitions for ulTxOamCfg. */
+#define TXOAM_F4_SEG_VPI_MASK 0x000000ff
+#define TXOAM_F4_SEG_VPI_SHIFT 0
+#define TXOAM_F4_E2E_VPI_MASK 0x0000ff00
+#define TXOAM_F4_E2E_VPI_SHIFT 8
+#define TXASM_VCI_MASK 0xffff0000
+#define TXASM_VCI_SHIFT 16
+
+/* Definitions for ulTxMpAalCfg. */
+#define TXMP_NUM_GROUPS 4
+#define TXMP_GROUP_SIZE 5
+#define TXMP_GROUP_EN 0x00000001
+#define TXMP_GROUP_SHAPER_MASK 0x0000001e
+#define TXMP_GROUP_SHAPER_SHIFT 1
+#define TXSOPWT_COUNT_EN 0x00100000
+#define TXSOPWT_COUNT_VALUE_MASK 0x07e00000
+#define TXSOPWT_COUNT_VALUE_SHIFT 21
+
+/* Definitions for ulTxUtopiaCfg. */
+#define TXUTO_PORT_EN_MASK 0x0000000f
+#define TXUTO_PORT_EN_SHIFT 0
+#define TXUTO_MODE_INT_EXT_MASK 0x00000030
+#define TXUTO_MODE_ALL_INT 0x00000000
+#define TXUTO_MODE_ALL_EXT 0x00000010
+#define TXUTO_MODE_INT_EXT 0x00000020
+#define TXUTO_CELL_FIFO_DEPTH_2 0x00000000
+#define TXUTO_CELL_FIFO_DEPTH_1 0x00000040
+#define TXUTO_NEG_EDGE 0x00000080
+#define TXUTO_LEVEL_1 0x00000100
+
+/* Definitions for ulTxLineRateTimer. */
+#define TXLRT_EN 0x00000001
+#define TXLRT_COUNT_VALUE_MASK 0x0001fffe
+#define TXLRT_COUNT_VALUE_SHIFT 1
+#define TXLRT_MAX_VALUE (TXLRT_COUNT_VALUE_MASK >> \
+ TXLRT_COUNT_VALUE_SHIFT)
+#define TXLRT_IDLE_CELL_INS_MASK 0xf0000000
+#define TXLRT_IDLE_CELL_INS_SHIFT 28
+
+/* Definitions for ulRxAtmCfg. */
+#define RX_PORT_EN 0x00000001
+#define RX_DOE_MASK 0x000001fe
+#define RX_DOE_SHIFT 1
+#define RX_DOE_GFC_ERROR 0x00000002
+#define RX_DOE_CRC_ERROR 0x00000004
+#define RX_DOE_CT_ERROR 0x00000008
+#define RX_DOE_CAM_LOOKUP_ERROR 0x00000010
+#define RX_DOE_IDLE_CELL 0x00000020
+#define RX_DOE_PTI_ERROR 0x00000040
+#define RX_DOE_HEC_ERROR 0x00000080
+#define RX_DOE_PORT_NOT_ENABLED_ERROR 0x00000100
+#define RXA_HEC_CRC_IGNORE 0x00000200
+#define RXA_GFC_ERROR_IGNORE 0x00000400
+#define RX_PORT_MASK 0x00001800
+#define RX_PORT_MASK_SHIFT 11
+#define RXP_RX_FLOW_DISABLED 0x00004000
+#define RXA_VCI_MASK 0x00008000
+#define RXA_VC_BIT_MASK 0xffff0000
+#define RXA_BONDING_VP_MASK 0x00ff0000
+
+/* Definitions for ulRxSarCfg. */
+#define RXSAR_MODE_ATM 0x00000000
+#define RXSAR_MODE_PTM 0x00000001
+#define RXSAR_MODE_MASK 0x00000001
+#define RXSARA_BOND_EN 0x00000002
+#define RXSARA_SID12_EN 0x00000004
+#define RXSARA_CRC10_INIT 0x00000008
+#define RXSARA_CRC10_EN_MASK 0x000000f0
+#define RXSARA_CRC10_EN_SHIFT 4
+#define RXSARA_BOND_DUAL_LATENCY 0x00000100
+#define RXSARA_BOND_CELL_COUNT_MASK 0x07ff0000
+#define RXSARA_BOND_CELL_COUNT_SHIFT 16
+#define RXSARA_BOND_TIMER_MODE 0x08000000
+#define RXSARA_BOND_BUF_MODE_MASK 0x70000000
+#define RXSARA_BOND_BUF_MODE_SHIFT 29
+#define RXSARA_BOND_BUF_MODE_MASK 0x70000000
+#define RXSARA_ASM_CRC_DIS 0x80000000
+
+/* Definitions for ulRxOamCfg. */
+#define RXOAM_F4_SEG_VPI_MASK 0x000000ff
+#define RXOAM_F4_SEG_VPI_SHIFT 0
+#define RXOAM_F4_E2E_VPI_MASK 0x0000ff00
+#define RXOAM_F4_E2E_VPI_SHIFT 8
+#define RXASM_VCI_MASK 0xffff0000
+#define RXASM_VCI_SHIFT 16
+
+/* Definitions for ulRxUtopiaCfg. */
+#define RXUTO_PORT_EN_MASK 0x0000000f
+#define RXUTO_PORT_EN_SHIFT 0
+#define RXUTO_TEQ_PORT_MASK 0x00000070
+#define RXUTO_TEQ_PORT_SHIFT 4
+#define RXUTO_NEG_EDGE 0x00000080
+#define RXUTO_LEVEL_1 0x00000100
+#define RXUTO_INTERNAL_BUF0_EN 0x00000200
+#define RXUTO_EXTERNAL_BUF1_EN 0x00000400
+
+/* Definitions for ulRxAalCfg. */
+#define RXAALA_AAL5_SW_TRAILER_EN 0x00000001
+#define RXAALA_AAL0_CRC_CHECK 0x00000002
+#define RXAALP_CRC32_EN 0x00000004
+#define RXAALP_CELL_LENGTH_MASK 0x000000f0
+#define RXAALP_CELL_LENGTH_SHIFT 4
+
+/* Definitions for ulLedCtrl. */
+#define SAR_LED_EN 0x00000001
+#define SAR_LED_MODE_MASK 0x00000006
+#define SAR_LED_MODE_SHIFT 1
+#define SAR_LED_MODE_LINK_ONLY 0x00000000
+#define SAR_LED_MODE_CELL_ACTIVITY 0x00000002
+#define SAR_LED_MODE_MELODY_LINK 0x00000004
+#define SAR_LED_MODE_LINK_CELL_ACTIVITY 0x00000006
+#define SAR_LED_LINK 0x00000010
+#define SAR_LED_SPEED_MASK 0x00000060
+#define SAR_LED_SPEED_SHIFT 5
+#define SAR_LED_SPEED_30MS 0x00000000
+#define SAR_LED_SPEED_50MS 0x00000020
+#define SAR_LED_SPEED_125MS 0x00000040
+#define SAR_LED_SPEED_250MS 0x00000060
+#define SAR_LED_INTERNAL 0x00000080
+
+/* Definitions for ulTxVpiVciTable. */
+#define TXTBL_VCI_MASK 0x0000ffff
+#define TXTBL_VCI_SHIFT 0
+#define TXTBL_VPI_MASK 0x00ff0000
+#define TXTBL_VPI_SHIFT 16
+
+/* Definitions for ulRxVpiVciCam - CAM side. */
+#define RXCAM_PORT_MASK 0x00000003
+#define RXCAM_PORT_SHIFT 0
+#define RXCAMP_PTM_PRI_LOW 0x00000000
+#define RXCAMP_PTM_PRI_HIGH 0x00000004
+#define RXCAM_TEQ_CELL 0x00000008
+#define RXCAMA_VCI_MASK 0x000ffff0
+#define RXCAMA_VCI_SHIFT 4
+#define RXCAMA_VPI_MASK 0x0ff00000
+#define RXCAMA_VPI_SHIFT 20
+#define RXCAM_VALID 0x10000000
+
+/* Definitions for ulRxVpiVciCam - RAM side. */
+#define RXCAM_CT_MASK 0x0000000f
+#define RXCAM_CT_SHIFT 0
+#define RXCAM_CT_TRANSPARENT (XCT_TRANSPARENT << RXCAM_CT_SHIFT)
+#define RXCAM_CT_AAL0_PKT (XCT_AAL0_PKT << RXCAM_CT_SHIFT)
+#define RXCAM_CT_AAL0_CELL (XCT_AAL0_CELL << RXCAM_CT_SHIFT)
+#define RXCAM_CT_AAL5 (XCT_AAL5 << RXCAM_CT_SHIFT)
+#define RXCAM_CT_TEQ (XCT_TEQ << RXCAM_CT_SHIFT)
+#define RXCAM_CT_PTM (XCT_PTM << RXCAM_CT_SHIFT)
+#define RXCAM_VCID_MASK 0x000001f0
+#define RXCAM_VCID_SHIFT 4
+#define RXCAM_STRIP_BYTE_MASK 0x00003e00
+#define RXCAM_STRIP_BYTE_SHIFT 9
+#define RXCAM_STRIP_EN 0x00004000
+#define RXCAMA_ASM_CELL 0x00080000
+#define RXCAMA_CRC10_EN 0x00100000
+
+/* Definitions for ulSstCtrl. */
+#define SST_EN 0x00000001
+#define SST_MP_GROUP_MASK 0x00000006
+#define SST_MP_GROUP_SHIFT 1
+#define SST_PTM_PREEMPT 0x00000010
+#define SST_PORT_MASK 0x00000060
+#define SST_PORT_SHIFT 5
+#define SST_ALG_MASK 0x00000380
+#define SST_ALG_SHIFT 7
+#define SST_ALG_UBR_NO_PCR 0x00000000
+#define SST_ALG_UBR_PCR 0x00000080
+#define SST_ALG_MBR 0x00000100
+#define SST_ALG_VBR_1 0x00000180
+#define SST_ALG_CBR 0x00000200
+#define SST_SUB_PRIORITY_MASK 0x00001c00
+#define SST_SUB_PRIORITY_SHIFT 10
+#define SST_SUPER_PRIORITY 0x00002000
+#define SST_MP_EN 0x00004000
+#define SST_MCR_EN 0x00008000
+#define SST_RATE_MCR_MASK 0xffff0000
+#define SST_RATE_MCR_SHIFT 16
+
+/* Definitions for ulSstPcrScr. */
+#define SST_RATE_PCR_MASK 0x0000ffff
+#define SST_RATE_PCR_SHIFT 0
+#define SST_RATE_SCR_MASK 0xffff0000
+#define SST_RATE_SCR_SHIFT 16
+
+/* Definitions for ulSstBt. */
+#define SST_RATE_BT_MASK 0x00ffffff
+#define SST_RATE_BT_SHIFT 0
+#define SST_ALG_WEIGHT_MASK 0x03000000
+#define SST_ALG_WEIGHT_SHIFT 24
+#define SST_ALG_DISABLED 0x00000000
+#define SST_ALG_CWRR 0x01000000
+#define SST_ALG_PWRR 0x02000000
+#define SST_ALG_WFQ 0x03000000
+#define SST_WEIGHT_VALUE_MASK 0xfc000000
+#define SST_WEIGHT_VALUE_SHIFT 26
+
+/* Definitions for ulSstBucketCnt. */
+#define SST_BP_PCR_MASK 0x0000ffff
+#define SST_BP_PCR_SHIFT 0
+#define SST_BM_MCR_MASK 0xffff0000
+#define SST_BM_MCR_SHIFT 16
+
+/* Definitions for ulRxPktBufCfg. */
+#define PBCFG_LENGTH_MASK 0x0000ffff
+#define PBCFG_LENGTH_SHIFT 0
+#define PBCFG_FPM_EMPTY 0x02000000
+#define PBCFG_LD_PTRS 0x04000000
+#define PBCFG_ALLOCATE_LAST 0x08000000
+#define PBCFG_KEEP_ERROR_PKTS 0x10000000
+#define PBCFG_FPM_ENABLE 0x20000000
+#define PBCFG_INIT_REQ 0x40000000
+#define PBCFG_S_RESET 0x80000000
+
+/* Definitions for ulRxPktBufThreshold. */
+#define PBTHRESH_MAX_COUNT_MASK 0x000000ff
+#define PBTHRESH_MAX_COUNT_SHIFT 0
+#define PBTHRESH_NO_BUF_DELAY_MASK 0xffff0000
+#define PBTHRESH_NO_BUF_DELAY_SHIFT 16
+
+/* Definitions for ulRxPktBufVcid. */
+#define PBVCID_WAIT_EN_MASK 0x0000ffff
+#define PBVCID_WAIT_EN_SHIFT 0
+
+/* Definitions for ulRxPktBufMem. */
+#define PBMEM_ADDR_MASK 0x0000ffff
+#define PBMEM_ADDR_SHIFT 0
+#define PBMEM_BS_B_MASK 0x00ff0000
+#define PBMEM_BS_B_SHIFT 16
+#define PBMEM_READ_WRITE_B 0x40000000
+#define PBMEM_GO_BUSY 0x80000000
+
+/* Definitions for ulRxPktBufPtr. */
+#define PBPTR_BUF_STOP_MASK 0x0000ffff
+#define PBPTR_BUF_STOP_SHIFT 0
+#define PBPTR_BUF_START_MASK 0xffff0000
+#define PBPTR_BUF_START_SHIFT 16
+
+/* Definitions for ulRxPktBufSize. */
+#define PBSIZE_THRESHOLD_MASK 0x0000ffff
+#define PBSIZE_THRESHOLD_SHIFT 0
+#define PBSIZE_MASK 0xffff0000
+#define PBSIZE_SHIFT 16
+
+/* Definitions for ulRxPktBufFifoStart[2]. */
+#define PBSTART_0_MASK 0x0000ffff
+#define PBSTART_0_SHIFT 0
+#define PBSTART_1_MASK 0xffff0000
+#define PBSTART_1_SHIFT 16
+
+/* Definitions for ulRxPktBufFifoStop[2]. */
+#define PBSTOP_0_MASK 0x0000ffff
+#define PBSTOP_0_SHIFT 0
+#define PBSTOP_1_MASK 0xffff0000
+#define PBSTOP_1_SHIFT 16
+
+/* Definitions for ulRxPktBufFifoDelay[2]. */
+#define PBDELAY_0_MASK 0x0000ffff
+#define PBDELAY_0_SHIFT 0
+#define PBDELAY_1_MASK 0xffff0000
+#define PBDELAY_1_SHIFT 16
+
+/* Definitions for ulRxPktBufQueueStatus. */
+#define PBQS_NUM_NO_BUFS_MASK 0x0000ffff
+#define PBQS_NUM_NO_BUFS_SHIFT 0
+#define PBQS_NUM_QUEUE_FULL_MASK 0xffff0000
+#define PBQS_NUM_QUEUE_FULL_SHIFT 16
+
+/* Definitions for ulRxPktBufErrorStatus. */
+#define PBERR_NUM_ERROR_FRAGS_MASK 0x0000ffff
+#define PBERR_NUM_ERROR_FRAGS_SHIFT 0
+#define PBERR_NUM_ERROR_PKTS_MASK 0xffff0000
+#define PBERR_NUM_ERROR_PKTS_SHIFT 16
+
+/* Definitions for ulRxPktBufTR. */
+#define PBTR_LD_T_PTR_MASK 0x0000ffff
+#define PBTR_LD_T_PTR_SHIFT 0
+#define PBTR_LD_H_PTR_MASK 0xffff0000
+#define PBTR_LD_H_PTR_SHIFT 16
+
+/* Definitions for ulRxPktBufFPM. */
+#define PBFPM_FRAME_BUF_MASK 0x0000ffff
+#define PBFPM_FRAME_BUF_SHIFT 0
+#define PBFPM_LOAD_COUNT_MASK 0xffff0000
+#define PBFPM_LOAD_COUNT_SHIFT 16
+
+/* Definitions for ulRxPktBufMibCtrl. */
+#define PBMIB_TOGGLE 0x40000000
+#define PBMIB_CLEAR 0x80000000
+
+/* Definitions for ulRxPktBufMibMatch. */
+#define PBMIB_MATCH_MASK 0x0000007f
+
+/* Definitions for ulTxHdrInsert. */
+#define TXHDR_COUNT_MASK 0x0000001f
+#define TXHDR_COUNT_SHIFT 0
+#define TXHDR_OFFSET_MASK 0x00ff0000
+#define TXHDR_OFFSET_SHIFT 16
+
+/* Definitions for ulTxRxPortOamCellCnt. */
+#define OAM_TX_CELL_COUNT_MASK 0x0000ffff
+#define OAM_TX_CELL_COUNT_SHIFT 0
+#define OAM_RX_CELL_COUNT_MASK 0xffff0000
+#define OAM_RX_CELL_COUNT_SHIFT 16
+
+/* Definitions for ulTxRxPortAsmCellCnt. */
+#define ASM_TX_CELL_COUNT_MASK 0x0000ffff
+#define ASM_TX_CELL_COUNT_SHIFT 0
+#define ASM_RX_CELL_COUNT_MASK 0xffff0000
+#define ASM_RX_CELL_COUNT_SHIFT 16
+
+/* Definitions for ulRxPortErrorPktCellCnt. */
+#define ERROR_RX_CELL_COUNT_MASK 0x0000ffff
+#define ERROR_RX_CELL_COUNT_SHIFT 0
+#define ERROR_RX_PKT_COUNT_MASK 0xffff0000
+#define ERROR_RX_PKT_COUNT_SHIFT 16
+
+
+#if defined(CONFIG_BCM96368)
+#define XTM_PROCESSOR_BASE 0xb0001800
+#elif defined(CONFIG_BCM96328) || defined(CONFIG_BCM96362)
+#define XTM_PROCESSOR_BASE 0xb0007800
+#endif
+typedef struct XtmProcessorRegisters
+{
+ UINT32 ulTxChannelCfg[XP_MAX_CONNS]; /* 0000 */
+ UINT32 ulSwitchPktCfg; /* 0040 */
+ UINT32 ulSwitchPktTxCtrl; /* 0044 */
+ UINT32 ulSwitchPktRxCtrl; /* 0048 */
+ UINT32 ulPktModCtrl; /* 004c */
+ UINT32 ulIrqStatus; /* 0050 */
+ UINT32 ulIrqMask; /* 0054 */
+ UINT32 ulReserved1[2]; /* 0058 */
+ UINT32 ulTxSarCfg; /* 0060 */
+ UINT32 ulTxSchedCfg; /* 0064 */
+ UINT32 ulTxOamCfg; /* 0068 */
+ UINT32 ulTxAtmStatus; /* 006c */
+ UINT32 ulTxAalStatus; /* 0070 */
+ UINT32 ulTxMpAalCfg; /* 0074 */
+ UINT32 ulTxUtopiaCfg; /* 0078 */
+ UINT32 ulTxLineRateTimer; /* 007c */
+ UINT32 ulRxAtmCfg[XP_MAX_PORTS]; /* 0080 */
+ UINT32 ulRxSarCfg; /* 0090 */
+ UINT32 ulRxOamCfg; /* 0094 */
+ UINT32 ulRxAtmStatus; /* 0098 */
+ UINT32 ulRxUtopiaCfg; /* 009c */
+ UINT32 ulRxAalCfg; /* 00a0 */
+ UINT32 ulRxAalMaxSdu; /* 00a4 */
+ UINT32 ulRxAalStatus; /* 00a8 */
+ UINT32 ulLedCtrl; /* 00ac */
+ UINT32 ulReserved2[20]; /* 00b0 */
+ UINT32 ulTxVpiVciTable[XP_MAX_CONNS]; /* 0100 */
+ UINT32 ulRxVpiVciCam[XP_MAX_CONNS * 2]; /* 0140 */
+ UINT32 ulReserved3[16]; /* 01c0 */
+ UINT32 ulSstCtrl[XP_MAX_CONNS]; /* 0200 */
+ UINT32 ulSstPcrScr[XP_MAX_CONNS]; /* 0240 */
+ UINT32 ulSstBt[XP_MAX_CONNS]; /* 0280 */
+ UINT32 ulSstBucketCnt[XP_MAX_CONNS]; /* 02c0 */
+ UINT32 ulRxPktBufCfg; /* 0300 */
+ UINT32 ulRxPktBufThreshold; /* 0304 */
+ UINT32 ulRxPktBufVcid; /* 0308 */
+ UINT32 ulRxPktBufMem; /* 030c */
+ UINT32 ulRxPktBufData[2]; /* 0310 */
+ UINT32 ulRxPktBufPtr; /* 0318 */
+ UINT32 ulRxPktBufSize; /* 031c */
+ UINT32 ulRxPktBufFifoStart[2]; /* 0320 */
+ UINT32 ulRxPktBufFifoStop[2]; /* 0328 */
+ UINT32 ulRxPktBufFifoDelay[2]; /* 0330 */
+ UINT32 ulRxPktBufQueueStatus; /* 0338 */
+ UINT32 ulRxPktBufErrorStatus; /* 033c */
+ UINT32 ulRxPktBufTR; /* 0340 */
+ UINT32 ulRxPktBufFPM; /* 0344 */
+ UINT32 ulRxPktBufMibCtrl; /* 0348 */
+ UINT32 ulRxPktBufMibMatch; /* 034c */
+ UINT32 ulRxPktBufMibRxOctet; /* 0350 */
+ UINT32 ulRxPktBufMibRxPkt; /* 0354 */
+ UINT32 ulReserved4[106]; /* 0358 */
+ UINT32 ulTxHdrInsert[XP_MAX_TX_HDRS]; /* 0500 */
+ UINT32 ulReserved5[24]; /* 0520 */
+ UINT32 ulTxHdrValues[XP_MAX_TX_HDRS][XP_TX_HDR_WORDS]; /* 0580 */
+ UINT32 ulTxPortPktOctCnt[XP_MAX_PORTS]; /* 0600 */
+ UINT32 ulRxPortPktOctCnt[XP_MAX_PORTS]; /* 0610 */
+ UINT32 ulTxPortPktCnt[XP_MAX_PORTS]; /* 0620 */
+ UINT32 ulRxPortPktCnt[XP_MAX_PORTS]; /* 0630 */
+ UINT32 ulTxRxPortOamCellCnt[XP_MAX_PORTS]; /* 0640 */
+ UINT32 ulTxRxPortAsmCellCnt[XP_MAX_PORTS]; /* 0650 */
+ UINT32 ulRxPortErrorPktCellCnt[XP_MAX_PORTS]; /* 0660 */
+ UINT32 ulBondInputCellCnt; /* 0670 */
+ UINT32 ulBondOutputCellCnt; /* 0674 */
+ UINT32 ulReserved6[1]; /* 0678 */
+ UINT32 ulMibCtrl; /* 067c */
+ UINT32 ulTxVcPktOctCnt[XP_MAX_CONNS]; /* 0680 */
+} XTM_PROCESSOR_REGISTERS, *PXTM_PROCESSOR_REGISTERS;
+
+#define XP_REGS ((volatile PXTM_PROCESSOR_REGISTERS const) XTM_PROCESSOR_BASE)
+
+/* Definitions from pktCmfHw.h. TBD. Use commoon header file. */
+#ifndef PKTCMF_OFFSET_ENGINE_SAR
+#define PKTCMF_OFFSET_ENGINE_SAR 0xB0002000
+#endif
+#define PKTCMF_OFFSET_RXFILT 0x00001B00
+#define RXFILT_REG_MATCH0_DEF_ID 0x0000000C /* 7b/VCID 03..00 */
+#define RXFILT_REG_MATCH1_DEF_ID 0x00000010 /* 7b/VCID 07..04 */
+#define RXFILT_REG_MATCH2_DEF_ID 0x00000014 /* 7b/VCID 11..08 */
+#define RXFILT_REG_MATCH3_DEF_ID 0x00000018 /* 7b/VCID 15..12 */
+
+#define RXFILT_REG_VCID0_QID 0x00000004 /* 2b/VCID 15..00 */
+#define RXFILT_REG_VCID1_QID 0x00000008 /* 2b VCID= 16 */
+
+#endif /* _XTMPROCREGS_H_ */
+
diff --git a/shared/opensource/boardparms/bcm963xx/Makefile b/shared/opensource/boardparms/bcm963xx/Makefile
new file mode 100755
index 0000000..8d2573c
--- /dev/null
+++ b/shared/opensource/boardparms/bcm963xx/Makefile
@@ -0,0 +1,16 @@
+
+ifeq ($(CONFIG_MIPS_BRCM),y)
+
+# Linux
+obj-y += boardparms.o
+
+ifneq ($(strip $(VOXXXLOAD)),)
+obj-y += boardparms_voice.o
+endif
+
+EXTRA_CFLAGS += -DCONFIG_BCM9$(BRCM_CHIP) -I$(INC_BRCMSHARED_PUB_PATH)/$(BRCM_BOARD)
+-include $(TOPDIR)/Rules.make
+
+endif
+
+
diff --git a/shared/opensource/boardparms/bcm963xx/boardparms.c b/shared/opensource/boardparms/bcm963xx/boardparms.c
new file mode 100755
index 0000000..23ab3ef
--- /dev/null
+++ b/shared/opensource/boardparms/bcm963xx/boardparms.c
@@ -0,0 +1,3712 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+/**************************************************************************
+* File Name : boardparms.c
+*
+* Description: This file contains the implementation for the BCM63xx board
+* parameter access functions.
+*
+* Updates : 07/14/2003 Created.
+***************************************************************************/
+
+/* Includes. */
+#include "boardparms.h"
+#include "boardparms_voice.h"
+
+/* Typedefs */
+typedef struct boardparameters
+{
+ char szBoardId[BP_BOARD_ID_LEN]; /* board id string */
+ unsigned short usGPIOOverlay; /* enabled interfaces */
+
+ unsigned short usGpioRj11InnerPair; /* GPIO pin or not defined */
+ unsigned short usGpioRj11OuterPair; /* GPIO pin or not defined */
+ unsigned short usGpioUartRts; /* GPIO pin or not defined */
+ unsigned short usGpioUartCts; /* GPIO pin or not defined */
+
+ unsigned short usGpioLedAdsl; /* GPIO pin or not defined */
+ unsigned short usGpioLedAdslFail; /* GPIO pin or not defined */
+ unsigned short usGpioSecLedAdsl; /* GPIO pin or not defined */
+ unsigned short usGpioSecLedAdslFail; /* GPIO pin or not defined */
+ unsigned short usGpioLedSesWireless; /* GPIO pin or not defined */
+ unsigned short usGpioLedHpna; /* GPIO pin or not defined */
+ unsigned short usGpioLedWanData; /* GPIO pin or not defined */
+ unsigned short usGpioLedWanError; /* GPIO pin or not defined */
+ unsigned short usGpioLedBlPowerOn; /* GPIO pin or not defined */
+ unsigned short usGpioLedBlStop; /* GPIO pin or not defined */
+ unsigned short usGpioFpgaReset; /* GPIO pin or not defined */
+ unsigned short usGpioLedGpon; /* GPIO pin or not defined */
+ unsigned short usGpioLedGponFail; /* GPIO pin or not defined */
+
+ unsigned short usGpioLedMoCA; /* GPIO pin or not defined */
+ unsigned short usGpioLedMoCAFail; /* GPIO pin or not defined */
+
+ unsigned short usExtIntrResetToDefault; /* ext intr or not defined */
+ unsigned short usExtIntrSesBtnWireless; /* ext intr or not defined */
+ unsigned short usExtIntrHpna; /* ext intr or not defined */
+
+ unsigned short usCsHpna; /* HPNA chip select or not defined */
+
+ unsigned short usAntInUseWireless; /* antenna in use or not defined */
+ unsigned short usWirelessFlags; /* WLAN flags */
+
+ ETHERNET_MAC_INFO EnetMacInfos[BP_MAX_ENET_MACS];
+ VOIP_DSP_INFO VoIPDspInfo[BP_MAX_VOIP_DSP];
+ unsigned short usGpioWirelessPowerDown; /* WLAN_PD control or not defined */
+ unsigned long ulAfeIds[2]; /* DSL AFE Ids */
+ unsigned short usGpioExtAFEReset; /* GPIO pin or not defined */
+ unsigned short usGpioExtAFELDPwr; /* GPIO pin or not defined */
+ unsigned short usGpioExtAFELDMode; /* GPIO pin or not defined */
+} BOARD_PARAMETERS, *PBOARD_PARAMETERS;
+
+#define SW_INFO_DEFAULT(n) { \
+ (0x00000001 << (n)) - 1, /* port_map */ \
+{0, 0, 0, 0, 0, 0, 0, 0} /* phy_id */ \
+}
+
+/* Variables */
+#if defined(_BCM96362_) || defined(CONFIG_BCM96362)
+
+static BOARD_PARAMETERS g_bcm96362advnx =
+{
+ "96362ADVNX", /* szBoardId */
+ (BP_OVERLAY_USB_LED |
+ BP_OVERLAY_EPHY_LED_0 |
+ BP_OVERLAY_EPHY_LED_1 |
+ BP_OVERLAY_EPHY_LED_2 |
+ BP_OVERLAY_EPHY_LED_3 |
+ BP_OVERLAY_SERIAL_LEDS |
+ BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_SERIAL_GPIO_14_AL, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_SERIAL_GPIO_15_AL, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_GPIO_1_AL, /* usGpioLedWanData */
+ BP_SERIAL_GPIO_10_AL, /* usGpioLedWanError */
+ BP_SERIAL_GPIO_12_AL, /* usGpioLedBlPowerOn */
+ BP_SERIAL_GPIO_13_AL, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_EXT_INTR_0, /* usExtIntrResetToDefault */
+ BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_NOT_DEFINED, /* usAntInUseWireless */
+ BP_WLAN_EXCLUDE_ONBOARD, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x1f, {0x01, 0x02, 0x03, 0x04, 0x18, 0x00, 0x00, 0x00}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_MIPS, /* ucDspType */
+ 0, /* ucDspAddress */
+ BP_NOT_DEFINED, /* usGpioLedVoip */
+ BP_SERIAL_GPIO_8_AL, /* usGpioVoip1Led */
+ BP_NOT_DEFINED, /* usGpioVoip1LedFail */
+ BP_SERIAL_GPIO_9_AL, /* usGpioVoip2Led */
+ BP_NOT_DEFINED, /* usGpioVoip2LedFail */
+ BP_NOT_DEFINED, /* usGpioPotsLed */
+ BP_NOT_DEFINED}, /* usGpioDectLed */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_CHIP_INT | BP_AFE_LD_6301 | BP_AFE_FE_ANNEXA | BP_AFE_FE_AVMODE_ADSL | BP_AFE_FE_REV_6301_REV_5_1_1, /* ulAfeIds */
+ BP_AFE_DEFAULT},
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96362advngr =
+{
+ "96362ADVNgr", /* szBoardId */
+ (BP_OVERLAY_USB_LED |
+ BP_OVERLAY_SPI_EXT_CS |
+ BP_OVERLAY_EPHY_LED_0 |
+ BP_OVERLAY_EPHY_LED_1 |
+ BP_OVERLAY_EPHY_LED_2 |
+ BP_OVERLAY_EPHY_LED_3 |
+ BP_OVERLAY_SERIAL_LEDS |
+ BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_SERIAL_GPIO_14_AL, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_SERIAL_GPIO_15_AL, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_GPIO_1_AL, /* usGpioLedWanData */
+ BP_SERIAL_GPIO_10_AL, /* usGpioLedWanError */
+ BP_SERIAL_GPIO_12_AL, /* usGpioLedBlPowerOn */
+ BP_SERIAL_GPIO_13_AL, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_EXT_INTR_0, /* usExtIntrResetToDefault */
+ BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_NOT_DEFINED, /* usAntInUseWireless */
+ BP_WLAN_EXCLUDE_ONBOARD, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x3f, {0x01, 0x02, 0x03, 0x04, 0x18, 0x19, 0x00, 0x00}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_MIPS, /* ucDspType */
+ 0, /* ucDspAddress */
+ BP_NOT_DEFINED, /* usGpioLedVoip */
+ BP_SERIAL_GPIO_8_AL, /* usGpioVoip1Led */
+ BP_NOT_DEFINED, /* usGpioVoip1LedFail */
+ BP_SERIAL_GPIO_9_AL, /* usGpioVoip2Led */
+ BP_NOT_DEFINED, /* usGpioVoip2LedFail */
+ BP_NOT_DEFINED, /* usGpioPotsLed */
+ BP_NOT_DEFINED}, /* usGpioDectLed */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_CHIP_INT | BP_AFE_LD_6301 | BP_AFE_FE_ANNEXA | BP_AFE_FE_AVMODE_ADSL | BP_AFE_FE_REV_6301_REV_5_1_1, /* ulAfeIds */
+ BP_AFE_DEFAULT},
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96362advngr2 =
+{
+ "96362ADVNgr2", /* szBoardId */
+ (BP_OVERLAY_USB_LED |
+ BP_OVERLAY_EPHY_LED_0 |
+ BP_OVERLAY_EPHY_LED_1 |
+ BP_OVERLAY_EPHY_LED_2 |
+ BP_OVERLAY_EPHY_LED_3 |
+ BP_OVERLAY_SERIAL_LEDS |
+ BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_SERIAL_GPIO_14_AL, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_SERIAL_GPIO_15_AL, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_GPIO_1_AL, /* usGpioLedWanData */
+ BP_SERIAL_GPIO_10_AL, /* usGpioLedWanError */
+ BP_SERIAL_GPIO_12_AL, /* usGpioLedBlPowerOn */
+ BP_SERIAL_GPIO_13_AL, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_EXT_INTR_0, /* usExtIntrResetToDefault */
+ BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_NOT_DEFINED, /* usAntInUseWireless */
+ BP_WLAN_EXCLUDE_ONBOARD, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x1f, {0x01, 0x02, 0x03, 0x04, 0x18, 0x00, 0x00, 0x00}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_MIPS, /* ucDspType */
+ 0, /* ucDspAddress */
+ BP_NOT_DEFINED, /* usGpioLedVoip */
+ BP_SERIAL_GPIO_8_AL, /* usGpioVoip1Led */
+ BP_NOT_DEFINED, /* usGpioVoip1LedFail */
+ BP_SERIAL_GPIO_9_AL, /* usGpioVoip2Led */
+ BP_NOT_DEFINED, /* usGpioVoip2LedFail */
+ BP_SERIAL_GPIO_11_AL, /* usGpioPotsLed */
+ BP_NOT_DEFINED}, /* usGpioDectLed */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_CHIP_INT | BP_AFE_LD_6302 | BP_AFE_FE_ANNEXA | BP_AFE_FE_AVMODE_ADSL | BP_AFE_FE_REV_6302_REV_5_2_2, /* ulAfeIds */
+ BP_AFE_DEFAULT},
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static PBOARD_PARAMETERS g_BoardParms[] = {&g_bcm96362advnx, &g_bcm96362advngr, &g_bcm96362advngr2, 0};
+#endif
+
+#if defined(_BCM96368_) || defined(CONFIG_BCM96368)
+
+static BOARD_PARAMETERS g_bcm96368vvw =
+{
+ "96368VVW", /* szBoardId */
+ (BP_OVERLAY_PCI |
+ BP_OVERLAY_EPHY_LED_0 |
+ BP_OVERLAY_EPHY_LED_1 |
+ BP_OVERLAY_EPHY_LED_2 |
+ BP_OVERLAY_EPHY_LED_3 |
+ BP_OVERLAY_INET_LED |
+ BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_GPIO_2_AL, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_GPIO_24_AL, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_GPIO_5_AH, /* usGpioLedWanData */
+ BP_GPIO_33_AH, /* usGpioLedWanError */
+ BP_GPIO_0_AH, /* usGpioLedBlPowerOn */
+ BP_GPIO_1_AH, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_EXT_INTR_0, /* usExtIntrResetToDefault */
+ BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
+ 0, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x0f, {0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_MIPS, /* ucDspType */
+ 0, /* ucDspAddress */
+ BP_NOT_DEFINED, /* usGpioLedVoip */
+ BP_GPIO_25_AL, /* usGpioVoip1Led */
+ BP_NOT_DEFINED, /* usGpioVoip1LedFail */
+ BP_GPIO_26_AL, /* usGpioVoip2Led */
+ BP_NOT_DEFINED, /* usGpioVoip2LedFail */
+ BP_GPIO_27_AL, /* usGpioPotsLed */
+ BP_NOT_DEFINED}, /* usGpioDectLed */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_CHIP_INT | BP_AFE_LD_ISIL1556 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_ISIL_REV1,
+ BP_AFE_DEFAULT}, /* ulAfeIds */
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96368vvwb =
+{
+ "96368VVWB", /* szBoardId */
+ (BP_OVERLAY_PCI |
+ BP_OVERLAY_EPHY_LED_0 |
+ BP_OVERLAY_EPHY_LED_1 |
+ BP_OVERLAY_EPHY_LED_2 |
+ BP_OVERLAY_EPHY_LED_3 |
+ BP_OVERLAY_INET_LED |
+ BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_GPIO_2_AL, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_GPIO_24_AL, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_GPIO_5_AH, /* usGpioLedWanData */
+ BP_GPIO_33_AH, /* usGpioLedWanError */
+ BP_GPIO_0_AH, /* usGpioLedBlPowerOn */
+ BP_GPIO_1_AH, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_EXT_INTR_0, /* usExtIntrResetToDefault */
+ BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
+ 0, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x0f, {0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_MIPS, /* ucDspType */
+ 0, /* ucDspAddress */
+ BP_NOT_DEFINED, /* usGpioLedVoip */
+ BP_GPIO_25_AL, /* usGpioVoip1Led */
+ BP_NOT_DEFINED, /* usGpioVoip1LedFail */
+ BP_GPIO_26_AL, /* usGpioVoip2Led */
+ BP_NOT_DEFINED, /* usGpioVoip2LedFail */
+ BP_GPIO_27_AL, /* usGpioPotsLed */
+ BP_NOT_DEFINED}, /* usGpioDectLed */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_CHIP_INT | BP_AFE_LD_ISIL1556 | BP_AFE_FE_ANNEXB| BP_AFE_FE_REV_ISIL_REV1,
+ BP_AFE_DEFAULT}, /* ulAfeIds */
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96368ntr =
+{
+ "96368NTR", /* szBoardId */
+ (BP_OVERLAY_PCI |
+ BP_OVERLAY_EPHY_LED_0 |
+ BP_OVERLAY_EPHY_LED_1 |
+ BP_OVERLAY_EPHY_LED_2 |
+ BP_OVERLAY_EPHY_LED_3 |
+ BP_OVERLAY_INET_LED |
+ BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_GPIO_2_AL, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_GPIO_5_AH, /* usGpioLedWanData */
+ BP_GPIO_33_AH, /* usGpioLedWanError */
+ BP_GPIO_0_AH, /* usGpioLedBlPowerOn */
+ BP_GPIO_1_AH, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_EXT_INTR_0, /* usExtIntrResetToDefault */
+ BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
+ BP_NOT_DEFINED, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x0f, {0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_MIPS, /* ucDspType */
+ 0, /* ucDspAddress */
+ BP_NOT_DEFINED, /* usGpioLedVoip */
+ BP_GPIO_25_AL, /* usGpioVoip1Led */
+ BP_NOT_DEFINED, /* usGpioVoip1LedFail */
+ BP_GPIO_26_AL, /* usGpioVoip2Led */
+ BP_NOT_DEFINED, /* usGpioVoip2LedFail */
+ BP_GPIO_27_AL, /* usGpioPotsLed */
+ BP_NOT_DEFINED}, /* usGpioDectLed */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_DEFAULT, /* ulAfeIds */
+ BP_AFE_DEFAULT},
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96368sv2 =
+{
+ "96368SV2", /* szBoardId */
+ (BP_OVERLAY_PCI |
+ BP_OVERLAY_PHY |
+ BP_OVERLAY_EPHY_LED_0 |
+ BP_OVERLAY_EPHY_LED_1 |
+ BP_OVERLAY_EPHY_LED_2 |
+ BP_OVERLAY_EPHY_LED_3 |
+ BP_OVERLAY_INET_LED |
+ BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_GPIO_2_AL, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_GPIO_5_AH, /* usGpioLedWanData */
+ BP_GPIO_33_AH, /* usGpioLedWanError */
+ BP_GPIO_30_AH, /* usGpioLedBlPowerOn */
+ BP_GPIO_31_AH, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_NOT_DEFINED, /* usExtIntrResetToDefault */
+ BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
+ 0, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x3f, {0x01, 0x02, 0x03, 0x04, 0x12, 0x11, 0x00, 0x00}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_MIPS, /* ucDspType */
+ 0, /* ucDspAddress */
+ BP_NOT_DEFINED, /* usGpioLedVoip */
+ BP_GPIO_25_AL, /* usGpioVoip1Led */
+ BP_NOT_DEFINED, /* usGpioVoip1LedFail */
+ BP_GPIO_26_AL, /* usGpioVoip2Led */
+ BP_NOT_DEFINED, /* usGpioVoip2LedFail */
+ BP_GPIO_27_AL, /* usGpioPotsLed */
+ BP_NOT_DEFINED}, /* usGpioDectLed */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_CHIP_INT | BP_AFE_LD_ISIL1556 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_ISIL_REV1,
+ BP_AFE_DEFAULT}, /* ulAfeIds */
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96368mvwg =
+{
+ "96368MVWG", /* szBoardId */
+ (BP_OVERLAY_PCI |
+ BP_OVERLAY_PHY |
+ BP_OVERLAY_EPHY_LED_0 |
+ BP_OVERLAY_EPHY_LED_1 |
+ BP_OVERLAY_EPHY_LED_2 |
+ BP_OVERLAY_EPHY_LED_3 |
+ BP_OVERLAY_INET_LED |
+ BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_GPIO_2_AL, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_GPIO_22_AL, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_GPIO_5_AH, /* usGpioLedWanData */
+ BP_GPIO_31_AH, /* usGpioLedWanError */
+ BP_GPIO_22_AH, /* usGpioLedBlPowerOn */
+ BP_GPIO_24_AH, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_EXT_INTR_0, /* usExtIntrResetToDefault */
+ BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
+ 0, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x36, {0x00, 0x02, 0x03, 0x00, 0x12, 0x11, 0x00, 0x00}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_MIPS, /* ucDspType */
+ 0, /* ucDspAddress */
+ BP_NOT_DEFINED, /* usGpioLedVoip */
+ BP_NOT_DEFINED, /* usGpioVoip1Led */
+ BP_NOT_DEFINED, /* usGpioVoip1LedFail */
+ BP_NOT_DEFINED, /* usGpioVoip2Led */
+ BP_NOT_DEFINED, /* usGpioVoip2LedFail */
+ BP_NOT_DEFINED, /* usGpioPotsLed */
+ BP_NOT_DEFINED}, /* usGpioDectLed */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_CHIP_INT | BP_AFE_LD_6302 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_6302_REV1,
+ BP_AFE_DEFAULT}, /* ulAfeIds */
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96368mvwgb =
+{
+ "96368MVWGB", /* szBoardId */
+ (BP_OVERLAY_PCI |
+ BP_OVERLAY_PHY |
+ BP_OVERLAY_EPHY_LED_0 |
+ BP_OVERLAY_EPHY_LED_1 |
+ BP_OVERLAY_EPHY_LED_2 |
+ BP_OVERLAY_EPHY_LED_3 |
+ BP_OVERLAY_INET_LED |
+ BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_GPIO_2_AL, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_GPIO_22_AL, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_GPIO_5_AH, /* usGpioLedWanData */
+ BP_GPIO_31_AH, /* usGpioLedWanError */
+ BP_GPIO_22_AH, /* usGpioLedBlPowerOn */
+ BP_GPIO_24_AH, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_EXT_INTR_0, /* usExtIntrResetToDefault */
+ BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
+ 0, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x36, {0x00, 0x02, 0x03, 0x00, 0x12, 0x11, 0x00, 0x00}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_MIPS, /* ucDspType */
+ 0, /* ucDspAddress */
+ BP_NOT_DEFINED, /* usGpioLedVoip */
+ BP_NOT_DEFINED, /* usGpioVoip1Led */
+ BP_NOT_DEFINED, /* usGpioVoip1LedFail */
+ BP_NOT_DEFINED, /* usGpioVoip2Led */
+ BP_NOT_DEFINED, /* usGpioVoip2LedFail */
+ BP_NOT_DEFINED, /* usGpioPotsLed */
+ BP_NOT_DEFINED}, /* usGpioDectLed */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_CHIP_INT | BP_AFE_LD_6302 | BP_AFE_FE_ANNEXB| BP_AFE_FE_REV_6302_REV1,
+ BP_AFE_DEFAULT}, /* ulAfeIds */
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96368mvwgj =
+{
+ "96368MVWGJ", /* szBoardId */
+ (BP_OVERLAY_PCI |
+ BP_OVERLAY_PHY |
+ BP_OVERLAY_EPHY_LED_0 |
+ BP_OVERLAY_EPHY_LED_1 |
+ BP_OVERLAY_EPHY_LED_2 |
+ BP_OVERLAY_EPHY_LED_3 |
+ BP_OVERLAY_INET_LED |
+ BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_GPIO_2_AL, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_GPIO_22_AL, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_GPIO_5_AH, /* usGpioLedWanData */
+ BP_GPIO_31_AH, /* usGpioLedWanError */
+ BP_GPIO_22_AH, /* usGpioLedBlPowerOn */
+ BP_GPIO_24_AH, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_EXT_INTR_0, /* usExtIntrResetToDefault */
+ BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
+ 0, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x36, {0x00, 0x02, 0x03, 0x00, 0x12, 0x11, 0x00, 0x00}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_MIPS, /* ucDspType */
+ 0, /* ucDspAddress */
+ BP_NOT_DEFINED, /* usGpioLedVoip */
+ BP_NOT_DEFINED, /* usGpioVoip1Led */
+ BP_NOT_DEFINED, /* usGpioVoip1LedFail */
+ BP_NOT_DEFINED, /* usGpioVoip2Led */
+ BP_NOT_DEFINED, /* usGpioVoip2LedFail */
+ BP_NOT_DEFINED, /* usGpioPotsLed */
+ BP_NOT_DEFINED}, /* usGpioDectLed */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_CHIP_INT | BP_AFE_LD_6302 | BP_AFE_FE_ANNEXJ | BP_AFE_FE_REV_6302_REV1,
+ BP_AFE_DEFAULT}, /* ulAfeIds */
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96368mbg =
+{
+ "96368MBG", /* szBoardId */
+ (BP_OVERLAY_PCI |
+ BP_OVERLAY_PHY |
+ BP_OVERLAY_EPHY_LED_0 |
+ BP_OVERLAY_EPHY_LED_1 |
+ BP_OVERLAY_EPHY_LED_2 |
+ BP_OVERLAY_EPHY_LED_3 |
+ BP_OVERLAY_INET_LED |
+ BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_GPIO_2_AL, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_GPIO_5_AH, /* usGpioLedWanData */
+ BP_GPIO_31_AH, /* usGpioLedWanError */
+ BP_GPIO_22_AH, /* usGpioLedBlPowerOn */
+ BP_GPIO_24_AH, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_EXT_INTR_0, /* usExtIntrResetToDefault */
+ BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_NOT_DEFINED, /* usAntInUseWireless */
+ BP_NOT_DEFINED, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x0f, {0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_MIPS, /* ucDspType */
+ 0, /* ucDspAddress */
+ BP_NOT_DEFINED, /* usGpioLedVoip */
+ BP_NOT_DEFINED, /* usGpioVoip1Led */
+ BP_NOT_DEFINED, /* usGpioVoip1LedFail */
+ BP_NOT_DEFINED, /* usGpioVoip2Led */
+ BP_NOT_DEFINED, /* usGpioVoip2LedFail */
+ BP_NOT_DEFINED, /* usGpioPotsLed */
+ BP_NOT_DEFINED}, /* usGpioDectLed */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_CHIP_INT | BP_AFE_LD_6302 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_6302_REV1,
+ BP_AFE_CHIP_6306 | BP_AFE_LD_ISIL1556 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_ISIL_REV1}, /* ulAfeIds */
+ BP_GPIO_35_AL, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96368mbg6b =
+{
+ "96368MBG6b", /* szBoardId */
+ (BP_OVERLAY_PCI |
+ BP_OVERLAY_PHY |
+ BP_OVERLAY_EPHY_LED_0 |
+ BP_OVERLAY_EPHY_LED_1 |
+ BP_OVERLAY_EPHY_LED_2 |
+ BP_OVERLAY_EPHY_LED_3 |
+ BP_OVERLAY_INET_LED |
+ BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_GPIO_2_AL, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_GPIO_5_AH, /* usGpioLedWanData */
+ BP_GPIO_31_AH, /* usGpioLedWanError */
+ BP_GPIO_22_AH, /* usGpioLedBlPowerOn */
+ BP_GPIO_24_AH, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_EXT_INTR_0, /* usExtIntrResetToDefault */
+ BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_NOT_DEFINED, /* usAntInUseWireless */
+ BP_NOT_DEFINED, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x0f, {0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_MIPS, /* ucDspType */
+ 0, /* ucDspAddress */
+ BP_NOT_DEFINED, /* usGpioLedVoip */
+ BP_NOT_DEFINED, /* usGpioVoip1Led */
+ BP_NOT_DEFINED, /* usGpioVoip1LedFail */
+ BP_NOT_DEFINED, /* usGpioVoip2Led */
+ BP_NOT_DEFINED, /* usGpioVoip2LedFail */
+ BP_NOT_DEFINED, /* usGpioPotsLed */
+ BP_NOT_DEFINED}, /* usGpioDectLed */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_CHIP_6306 | BP_AFE_LD_ISIL1556 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_ISIL_REV1, /* ulAfeIds */
+ BP_AFE_DEFAULT},
+ BP_GPIO_35_AL, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96368mbg6302 =
+{
+ "96368MBG6302", /* szBoardId */
+ (BP_OVERLAY_PCI |
+ BP_OVERLAY_PHY |
+ BP_OVERLAY_EPHY_LED_0 |
+ BP_OVERLAY_EPHY_LED_1 |
+ BP_OVERLAY_EPHY_LED_2 |
+ BP_OVERLAY_EPHY_LED_3 |
+ BP_OVERLAY_INET_LED |
+ BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_GPIO_2_AL, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_GPIO_5_AH, /* usGpioLedWanData */
+ BP_GPIO_31_AH, /* usGpioLedWanError */
+ BP_GPIO_22_AH, /* usGpioLedBlPowerOn */
+ BP_GPIO_24_AH, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_EXT_INTR_0, /* usExtIntrResetToDefault */
+ BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_NOT_DEFINED, /* usAntInUseWireless */
+ BP_NOT_DEFINED, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x0f, {0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_MIPS, /* ucDspType */
+ 0, /* ucDspAddress */
+ BP_NOT_DEFINED, /* usGpioLedVoip */
+ BP_NOT_DEFINED, /* usGpioVoip1Led */
+ BP_NOT_DEFINED, /* usGpioVoip1LedFail */
+ BP_NOT_DEFINED, /* usGpioVoip2Led */
+ BP_NOT_DEFINED, /* usGpioVoip2LedFail */
+ BP_NOT_DEFINED, /* usGpioPotsLed */
+ BP_NOT_DEFINED}, /* usGpioDectLed */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_CHIP_INT | BP_AFE_LD_6302 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_6302_REV1,
+ BP_AFE_CHIP_6306 | BP_AFE_LD_6302 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_6302_REV1}, /* ulAfeIds */
+ BP_GPIO_35_AL, /* usGpioExtAFEReset */
+ BP_GPIO_37_AH, /* usGpioExtAFELDPwr */
+ BP_GPIO_36_AH /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96368mng =
+{
+ "96368MNG", /* szBoardId */
+ (BP_OVERLAY_PCI |
+ BP_OVERLAY_PHY |
+ BP_OVERLAY_EPHY_LED_0 |
+ BP_OVERLAY_EPHY_LED_1 |
+ BP_OVERLAY_EPHY_LED_2 |
+ BP_OVERLAY_EPHY_LED_3 |
+ BP_OVERLAY_INET_LED), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_GPIO_2_AL, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_GPIO_5_AH, /* usGpioLedWanData */
+ BP_GPIO_31_AH, /* usGpioLedWanError */
+ BP_GPIO_22_AH, /* usGpioLedBlPowerOn */
+ BP_GPIO_24_AH, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_EXT_INTR_0, /* usExtIntrResetToDefault */
+ BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_NOT_DEFINED, /* usAntInUseWireless */
+ BP_NOT_DEFINED, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x20, {0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00}}}, /* sw */
+ {BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_SPI_SSB_1, /* usConfigType */
+ {0x0f, {0x00, 0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00}}}}, /* sw */
+ {{BP_VOIP_MIPS, /* ucDspType */
+ 0, /* ucDspAddress */
+ BP_NOT_DEFINED, /* usGpioLedVoip */
+ BP_NOT_DEFINED, /* usGpioVoip1Led */
+ BP_NOT_DEFINED, /* usGpioVoip1LedFail */
+ BP_NOT_DEFINED, /* usGpioVoip2Led */
+ BP_NOT_DEFINED, /* usGpioVoip2LedFail */
+ BP_NOT_DEFINED, /* usGpioPotsLed */
+ BP_NOT_DEFINED}, /* usGpioDectLed */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_CHIP_6306 | BP_AFE_LD_ISIL1556 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_ISIL_REV1,
+ BP_AFE_DEFAULT}, /* ulAfeIds */
+ BP_GPIO_37_AL, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96367avng =
+{
+ "96367AVNG", /* szBoardId */
+ (BP_OVERLAY_PCI |
+ BP_OVERLAY_PHY |
+ BP_OVERLAY_EPHY_LED_0 |
+ BP_OVERLAY_EPHY_LED_1 |
+ BP_OVERLAY_EPHY_LED_2 |
+ BP_OVERLAY_EPHY_LED_3 |
+ BP_OVERLAY_INET_LED |
+ BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_GPIO_2_AL, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_GPIO_23_AL, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_NOT_DEFINED, /* usGpioLedWanData */
+ BP_GPIO_31_AH, /* usGpioLedWanError */
+ BP_GPIO_22_AH, /* usGpioLedBlPowerOn */
+ BP_GPIO_24_AH, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_EXT_INTR_0, /* usExtIntrResetToDefault */
+ BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
+ 0, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x2f, {0x01, 0x02, 0x03, 0x04, 0x00, 0x11, 0x00, 0x00}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_MIPS, /* ucDspType */
+ 0, /* ucDspAddress */
+ BP_NOT_DEFINED, /* usGpioLedVoip */
+ BP_NOT_DEFINED, /* usGpioVoip1Led */
+ BP_NOT_DEFINED, /* usGpioVoip1LedFail */
+ BP_NOT_DEFINED, /* usGpioVoip2Led */
+ BP_NOT_DEFINED, /* usGpioVoip2LedFail */
+ BP_NOT_DEFINED, /* usGpioPotsLed */
+ BP_NOT_DEFINED}, /* usGpioDectLed */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_CHIP_INT | BP_AFE_LD_6302 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_6302_REV1,
+ BP_AFE_DEFAULT}, /* ulAfeIds */
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96368mvngr =
+{
+ "96368MVNgr", /* szBoardId */
+ (BP_OVERLAY_PCI |
+ BP_OVERLAY_SPI_EXT_CS |
+ BP_OVERLAY_PHY |
+ BP_OVERLAY_EPHY_LED_0 |
+ BP_OVERLAY_EPHY_LED_1 |
+ BP_OVERLAY_EPHY_LED_2 |
+ BP_OVERLAY_EPHY_LED_3 |
+ BP_OVERLAY_INET_LED |
+ BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_GPIO_2_AL, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_GPIO_23_AL, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_GPIO_5_AH, /* usGpioLedWanData */
+ BP_GPIO_3_AH, /* usGpioLedWanError */
+ BP_GPIO_22_AH, /* usGpioLedBlPowerOn */
+ BP_GPIO_24_AH, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_EXT_INTR_0, /* usExtIntrResetToDefault */
+ BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
+ 0, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x0f, {0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_MIPS, /* ucDspType */
+ 0, /* ucDspAddress */
+ BP_NOT_DEFINED, /* usGpioLedVoip */
+ BP_NOT_DEFINED, /* usGpioVoip1Led */
+ BP_NOT_DEFINED, /* usGpioVoip1LedFail */
+ BP_NOT_DEFINED, /* usGpioVoip2Led */
+ BP_NOT_DEFINED, /* usGpioVoip2LedFail */
+ BP_NOT_DEFINED, /* usGpioPotsLed */
+ BP_NOT_DEFINED}, /* usGpioDectLed */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_CHIP_INT | BP_AFE_LD_6302 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_6302_REV1,
+ BP_AFE_DEFAULT}, /* ulAfeIds */
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96368mvngrP2 =
+{
+ "96368MVNgrP2", /* szBoardId */
+ (BP_OVERLAY_PCI |
+ BP_OVERLAY_PHY |
+ BP_OVERLAY_EPHY_LED_0 |
+ BP_OVERLAY_EPHY_LED_1 |
+ BP_OVERLAY_EPHY_LED_2 |
+ BP_OVERLAY_EPHY_LED_3 |
+ BP_OVERLAY_INET_LED |
+ BP_OVERLAY_USB_DEVICE), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_GPIO_2_AL, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_GPIO_23_AL, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_GPIO_5_AL, /* usGpioLedWanData */
+ BP_GPIO_3_AL, /* usGpioLedWanError */
+ BP_GPIO_22_AL, /* usGpioLedBlPowerOn */
+ BP_GPIO_24_AL, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_EXT_INTR_0, /* usExtIntrResetToDefault */
+ BP_EXT_INTR_1, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
+ 0, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x0f, {0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_MIPS, /* ucDspType */
+ 0, /* ucDspAddress */
+ BP_NOT_DEFINED, /* usGpioLedVoip */
+ BP_NOT_DEFINED, /* usGpioVoip1Led */
+ BP_NOT_DEFINED, /* usGpioVoip1LedFail */
+ BP_NOT_DEFINED, /* usGpioVoip2Led */
+ BP_NOT_DEFINED, /* usGpioVoip2LedFail */
+ BP_NOT_DEFINED, /* usGpioPotsLed */
+ BP_NOT_DEFINED}, /* usGpioDectLed */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_CHIP_INT | BP_AFE_LD_6302 | BP_AFE_FE_ANNEXA | BP_AFE_FE_REV_6302_REV1,
+ BP_AFE_DEFAULT}, /* ulAfeIds */
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static PBOARD_PARAMETERS g_BoardParms[] =
+{&g_bcm96368vvw, &g_bcm96368mvwg, &g_bcm96368sv2, &g_bcm96368mbg,
+&g_bcm96368ntr, &g_bcm96368mbg6b, &g_bcm96368vvwb, &g_bcm96368mvwgb,
+&g_bcm96368mng, &g_bcm96368mbg6302, &g_bcm96368mvwgj, &g_bcm96367avng,
+&g_bcm96368mvngr, &g_bcm96368mvngrP2, 0};
+#endif
+
+#if defined(_BCM96816_) || defined(CONFIG_BCM96816)
+
+static BOARD_PARAMETERS g_bcm96816sv =
+{
+ "96816SV", /* szBoardId */
+ (BP_OVERLAY_PCI |
+ BP_OVERLAY_GPHY_LED_0 |
+ BP_OVERLAY_GPHY_LED_1 |
+ BP_OVERLAY_MOCA_LED ), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_NOT_DEFINED, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_NOT_DEFINED, /* usGpioLedWanData */
+ BP_NOT_DEFINED, /* usGpioLedWanError */
+ BP_GPIO_3_AH, /* usGpioLedBlPowerOn */
+ BP_GPIO_4_AH, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_GPIO_8_AH, /* usGpioLedGpon */
+ BP_GPIO_16_AH, /* usGpioLedGponFail */
+ BP_GPIO_5_AH, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_NOT_DEFINED, /* usExtIntrResetToDefault */
+ BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_NOT_DEFINED, /* usAntInUseWireless */
+ 0, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0xbf, {0x00, 0x01, 0x14, 0x12, 0x18, 0xff, 0x00, 0xff}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_NO_DSP}, /* ucDspType */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_DEFAULT, BP_AFE_DEFAULT}, /* ulAfeIds */
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96816pvwm =
+{
+ "96816PVWM", /* szBoardId */
+ (BP_OVERLAY_GPHY_LED_0 |
+ BP_OVERLAY_GPHY_LED_1 |
+ BP_OVERLAY_MOCA_LED), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_NOT_DEFINED, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_NOT_DEFINED, /* usGpioLedWanData */
+ BP_NOT_DEFINED, /* usGpioLedWanError */
+ BP_GPIO_3_AH, /* usGpioLedBlPowerOn */
+ BP_GPIO_4_AH, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_GPIO_8_AH, /* usGpioLedGpon */
+ BP_GPIO_2_AH, /* usGpioLedGponFail */
+ BP_GPIO_5_AH, /* usGpioLedMoCA */
+ BP_GPIO_37_AH, /* usGpioLedMoCAFail */
+
+ BP_NOT_DEFINED, /* usExtIntrResetToDefault */
+ BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_NOT_DEFINED, /* usAntInUseWireless */
+ 0, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0xaf, {0x00, 0x01, 0x11, 0x12, 0x00, 0xff, 0x00, 0xff}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_MIPS, /* ucDspType */
+ 0, /* ucDspAddress */
+ BP_NOT_DEFINED, /* usGpioLedVoip */
+ BP_NOT_DEFINED, /* usGpioVoip1Led */
+ BP_NOT_DEFINED, /* usGpioVoip1LedFail */
+ BP_NOT_DEFINED, /* usGpioVoip2Led */
+ BP_NOT_DEFINED, /* usGpioVoip2LedFail */
+ BP_NOT_DEFINED, /* usGpioPotsLed */
+ BP_NOT_DEFINED}, /* usGpioDectLed */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_DEFAULT, /* ulAfeIds */
+ BP_AFE_DEFAULT},
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96829rg =
+{
+ "96829RG", /* szBoardId */
+ (BP_OVERLAY_GPHY_LED_0 |
+ BP_OVERLAY_GPHY_LED_1 |
+ BP_OVERLAY_MOCA_LED), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_NOT_DEFINED, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_NOT_DEFINED, /* usGpioLedWanData */
+ BP_NOT_DEFINED, /* usGpioLedWanError */
+ BP_GPIO_3_AH, /* usGpioLedBlPowerOn */
+ BP_GPIO_4_AH, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_GPIO_5_AL, /* usGpioLedMoCA */
+ BP_GPIO_37_AH, /* usGpioLedMoCAFail */
+
+ BP_NOT_DEFINED, /* usExtIntrResetToDefault */
+ BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_NOT_DEFINED, /* usAntInUseWireless */
+ 0, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0xaf, {0x00, 0x01, 0x11, 0x12, 0x00, 0xff, 0x00, 0xff}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_NO_DSP}, /* ucDspType */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_DEFAULT, BP_AFE_DEFAULT}, /* ulAfeIds */
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96816p2og =
+{
+ "96816P2OG", /* szBoardId */
+ (BP_OVERLAY_GPHY_LED_0 |
+ BP_OVERLAY_GPHY_LED_1 |
+ BP_OVERLAY_PCI |
+ BP_OVERLAY_MOCA_LED), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_NOT_DEFINED, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_NOT_DEFINED, /* usGpioLedWanData */
+ BP_NOT_DEFINED, /* usGpioLedWanError */
+ BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
+ BP_NOT_DEFINED, /* usGpioLedBlStop */
+ BP_GPIO_2_AH, /* usGpioFpgaReset */
+ BP_GPIO_8_AH, /* usGpioLedGpon */
+ BP_GPIO_16_AH, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_NOT_DEFINED, /* usExtIntrResetToDefault */
+ BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_NOT_DEFINED, /* usAntInUseWireless */
+ 0, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0xaf, {0x00, 0x01, 0x11, 0xff, 0x00, 0xff, 0x00, 0xff}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_NO_DSP}, /* ucDspType */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_DEFAULT, BP_AFE_DEFAULT}, /* ulAfeIds */
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96812pg =
+{
+ "96812PG" , /* szBoardId */
+ (BP_OVERLAY_GPHY_LED_0 |
+ BP_OVERLAY_GPHY_LED_1), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_NOT_DEFINED, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_NOT_DEFINED, /* usGpioLedWanData */
+ BP_NOT_DEFINED, /* usGpioLedWanError */
+ BP_GPIO_3_AH, /* usGpioLedBlPowerOn */
+ BP_GPIO_4_AH, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_GPIO_8_AH, /* usGpioLedGpon */
+ BP_GPIO_2_AH, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_NOT_DEFINED, /* usExtIntrResetToDefault */
+ BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_NOT_DEFINED, /* usAntInUseWireless */
+ 0, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0xaf, {0x00, 0x01, 0x11, 0x12, 0x00, 0xff, 0x00, 0xff}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_NO_DSP}, /* ucDspType */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_DEFAULT, BP_AFE_DEFAULT}, /* ulAfeIds */
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96819bhr =
+{
+ "96819BHR", /* szBoardId */
+ (BP_OVERLAY_GPHY_LED_0 |
+ BP_OVERLAY_GPHY_LED_1 |
+ BP_OVERLAY_MOCA_LED), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_NOT_DEFINED, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_NOT_DEFINED, /* usGpioLedWanData */
+ BP_NOT_DEFINED, /* usGpioLedWanError */
+ BP_GPIO_3_AH, /* usGpioLedBlPowerOn */
+ BP_GPIO_4_AH, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_GPIO_5_AL, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_EXT_INTR_3, /* usExtIntrResetToDefault */
+ BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_NOT_DEFINED, /* usAntInUseWireless */
+ 0, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x3f, {0x00, 0x01, 0x14, 0x12, 0xA1, 0xff, 0x00, 0xff}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_NO_DSP}, /* ucDspType */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_DEFAULT, BP_AFE_DEFAULT}, /* ulAfeIds */
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED, /* usGpioExtAFELDMode */
+};
+
+static PBOARD_PARAMETERS g_BoardParms[] = {&g_bcm96816sv, &g_bcm96816pvwm, &g_bcm96829rg, &g_bcm96816p2og, &g_bcm96812pg, &g_bcm96819bhr, 0};
+#endif
+
+#if defined(_BCM96328_) || defined(CONFIG_BCM96328)
+static BOARD_PARAMETERS g_bcm96328avng =
+{
+ "96328avng", /* szBoardId */
+ (BP_OVERLAY_EPHY_LED_0 |
+ BP_OVERLAY_EPHY_LED_1 |
+ BP_OVERLAY_EPHY_LED_2 |
+ BP_OVERLAY_EPHY_LED_3), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_GPIO_3_AL, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_GPIO_9_AL, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ // **** Set to BP_GPIO_0_AL when WanData LED is connected to GPIO11
+ BP_GPIO_0_AL, /* usGpioLedWanData */
+ BP_GPIO_2_AL, /* usGpioLedWanError */
+ BP_GPIO_4_AL, /* usGpioLedBlPowerOn */
+ BP_GPIO_8_AL, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_NOT_DEFINED, /* usExtIntrResetToDefault */
+ BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
+ 0, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x1f, {0x01, 0x02, 0x03, 0x04, 0x18, 0x00, 0x00, 0x00}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_MIPS, /* ucDspType */
+ 0, /* ucDspAddress */
+ BP_NOT_DEFINED, /* usGpioLedVoip */
+ BP_GPIO_6_AL, /* usGpioVoip1Led */
+ BP_NOT_DEFINED, /* usGpioVoip1LedFail */
+ BP_GPIO_7_AL, /* usGpioVoip2Led */
+ BP_NOT_DEFINED, /* usGpioVoip2LedFail */
+ BP_GPIO_5_AL, /* usGpioPotsLed */
+ BP_NOT_DEFINED}, /* usGpioDectLed */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_CHIP_INT | BP_AFE_LD_6301 | BP_AFE_FE_ANNEXA | BP_AFE_FE_AVMODE_ADSL | BP_AFE_FE_REV_6301_REV_5_1_1, /* ulAfeIds */
+ BP_AFE_DEFAULT},
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96328avngrP1 =
+{
+ "96328avngrP1", /* szBoardId */
+ (BP_OVERLAY_EPHY_LED_0 |
+ BP_OVERLAY_EPHY_LED_1 |
+ BP_OVERLAY_EPHY_LED_2 |
+ BP_OVERLAY_EPHY_LED_3 |
+ BP_OVERLAY_SERIAL_LEDS), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_SERIAL_GPIO_10_AL, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_SERIAL_GPIO_11_AL, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_SERIAL_GPIO_1_AL, /* usGpioLedWanData */
+ BP_SERIAL_GPIO_13_AL, /* usGpioLedWanError */
+ BP_SERIAL_GPIO_8_AL, /* usGpioLedBlPowerOn */
+ BP_SERIAL_GPIO_15_AL, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_NOT_DEFINED, /* usExtIntrResetToDefault */
+ BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
+ 0, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x1f, {0x01, 0x02, 0x03, 0x04, 0x18, 0x00, 0x00, 0x00}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_MIPS, /* ucDspType */
+ 0, /* ucDspAddress */
+ BP_NOT_DEFINED, /* usGpioLedVoip */
+ BP_SERIAL_GPIO_12_AL, /* usGpioVoip1Led */
+ BP_NOT_DEFINED, /* usGpioVoip1LedFail */
+ BP_SERIAL_GPIO_14_AL, /* usGpioVoip2Led */
+ BP_NOT_DEFINED, /* usGpioVoip2LedFail */
+ BP_NOT_DEFINED, /* usGpioPotsLed */
+ BP_NOT_DEFINED}, /* usGpioDectLed */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_CHIP_INT | BP_AFE_LD_6301 | BP_AFE_FE_ANNEXA | BP_AFE_FE_AVMODE_ADSL | BP_AFE_FE_REV_6301_REV_5_1_1, /* ulAfeIds */
+ BP_AFE_DEFAULT},
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm96328avngr =
+{
+ "96328avngr", /* szBoardId */
+ (BP_OVERLAY_EPHY_LED_0 |
+ BP_OVERLAY_EPHY_LED_1 |
+ BP_OVERLAY_EPHY_LED_2 |
+ BP_OVERLAY_EPHY_LED_3 |
+ BP_OVERLAY_SERIAL_LEDS), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_SERIAL_GPIO_10_AL, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_SERIAL_GPIO_11_AL, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_GPIO_1_AL, /* usGpioLedWanData */
+ BP_SERIAL_GPIO_13_AL, /* usGpioLedWanError */
+ BP_SERIAL_GPIO_8_AL, /* usGpioLedBlPowerOn */
+ BP_SERIAL_GPIO_15_AL, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_NOT_DEFINED, /* usExtIntrResetToDefault */
+ BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
+ 0, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x1f, {0x01, 0x02, 0x03, 0x04, 0x18, 0x00, 0x00, 0x00}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_MIPS, /* ucDspType */
+ 0, /* ucDspAddress */
+ BP_NOT_DEFINED, /* usGpioLedVoip */
+ BP_SERIAL_GPIO_12_AL, /* usGpioVoip1Led */
+ BP_NOT_DEFINED, /* usGpioVoip1LedFail */
+ BP_SERIAL_GPIO_14_AL, /* usGpioVoip2Led */
+ BP_NOT_DEFINED, /* usGpioVoip2LedFail */
+ BP_NOT_DEFINED, /* usGpioPotsLed */
+ BP_NOT_DEFINED}, /* usGpioDectLed */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_CHIP_INT | BP_AFE_LD_6301 | BP_AFE_FE_ANNEXA | BP_AFE_FE_AVMODE_ADSL | BP_AFE_FE_REV_6301_REV_5_1_1, /* ulAfeIds */
+ BP_AFE_DEFAULT},
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static BOARD_PARAMETERS g_bcm963281TAN =
+{
+ "963281TAN", /* szBoardId */
+
+ (BP_OVERLAY_EPHY_LED_0 |
+ BP_OVERLAY_EPHY_LED_1 |
+ BP_OVERLAY_EPHY_LED_2 |
+ BP_OVERLAY_EPHY_LED_3 ), /* usGPIOOverlay */
+
+ BP_NOT_DEFINED, /* usGpioRj11InnerPair */
+ BP_NOT_DEFINED, /* usGpioRj11OuterPair */
+ BP_NOT_DEFINED, /* usGpioUartRts */
+ BP_NOT_DEFINED, /* usGpioUartCts */
+
+ BP_GPIO_20_AL, /* usGpioLedAdsl */
+ BP_NOT_DEFINED, /* usGpioLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioSecLedAdsl */
+ BP_NOT_DEFINED, /* usGpioSecLedAdslFail */
+ BP_NOT_DEFINED, /* usGpioLedSesWireless */
+ BP_NOT_DEFINED, /* usGpioLedHpna */
+ BP_NOT_DEFINED, /* usGpioLedWanData */
+ BP_NOT_DEFINED, /* usGpioLedWanError */
+ BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
+ BP_NOT_DEFINED, /* usGpioLedBlStop */
+ BP_NOT_DEFINED, /* usGpioFpgaReset */
+ BP_NOT_DEFINED, /* usGpioLedGpon */
+ BP_NOT_DEFINED, /* usGpioLedGponFail */
+ BP_NOT_DEFINED, /* usGpioLedMoCA */
+ BP_NOT_DEFINED, /* usGpioLedMoCAFail */
+
+ BP_NOT_DEFINED, /* usExtIntrResetToDefault */
+ BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
+ BP_NOT_DEFINED, /* usExtIntrHpna */
+
+ BP_NOT_DEFINED, /* usCsHpna */
+
+ BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
+ 0, /* WLAN flags */
+
+ {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
+ 0x0, /* ucPhyAddress */
+ BP_NOT_DEFINED, /* usGpioLedPhyLinkSpeed */
+ BP_ENET_CONFIG_MMAP, /* usConfigType */
+ {0x0f, {0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00}}}, /* sw */
+ {BP_ENET_NO_PHY}}, /* ucPhyType */
+ {{BP_VOIP_NO_DSP}, /* ucDspType */
+ {BP_VOIP_NO_DSP}}, /* ucDspType */
+ BP_NOT_DEFINED, /* usGpioWirelessPowerDown */
+ {BP_AFE_CHIP_INT | BP_AFE_LD_6301 | BP_AFE_FE_ANNEXA | BP_AFE_FE_AVMODE_ADSL | BP_AFE_FE_REV_6301_REV_5_1_1, /* ulAfeIds */
+ BP_AFE_DEFAULT},
+ BP_NOT_DEFINED, /* usGpioExtAFEReset */
+ BP_NOT_DEFINED, /* usGpioExtAFELDPwr */
+ BP_NOT_DEFINED /* usGpioExtAFELDMode */
+};
+
+static PBOARD_PARAMETERS g_BoardParms[] = {&g_bcm96328avng, &g_bcm96328avngrP1, &g_bcm96328avngr, &g_bcm963281TAN, 0};
+#endif
+
+static PBOARD_PARAMETERS g_pCurrentBp = 0;
+
+/**************************************************************************
+* Name : bpstrcmp
+*
+* Description: String compare for this file so it does not depend on an OS.
+* (Linux kernel and CFE share this source file.)
+*
+* Parameters : [IN] dest - destination string
+* [IN] src - source string
+*
+* Returns : -1 - dest < src, 1 - dest > src, 0 dest == src
+***************************************************************************/
+int bpstrcmp(const char *dest,const char *src)
+{
+ while (*src && *dest)
+ {
+ if (*dest < *src) return -1;
+ if (*dest > *src) return 1;
+ dest++;
+ src++;
+ }
+
+ if (*dest && !*src) return 1;
+ if (!*dest && *src) return -1;
+ return 0;
+} /* bpstrcmp */
+
+/**************************************************************************
+* Name : BpGetVoipDspConfig
+*
+* Description: Gets the DSP configuration from the board parameter
+* structure for a given DSP index.
+*
+* Parameters : [IN] dspNum - DSP index (number)
+*
+* Returns : Pointer to DSP configuration block if found/valid, NULL
+* otherwise.
+***************************************************************************/
+VOIP_DSP_INFO *BpGetVoipDspConfig( unsigned char dspNum )
+{
+ VOIP_DSP_INFO *pDspConfig = 0;
+ int i;
+
+ if( g_pCurrentBp )
+ {
+ for( i = 0 ; i < BP_MAX_VOIP_DSP ; i++ )
+ {
+ if( g_pCurrentBp->VoIPDspInfo[i].ucDspType != BP_VOIP_NO_DSP &&
+ g_pCurrentBp->VoIPDspInfo[i].ucDspAddress == dspNum )
+ {
+ pDspConfig = &g_pCurrentBp->VoIPDspInfo[i];
+ break;
+ }
+ }
+ }
+
+ return pDspConfig;
+}
+
+
+/**************************************************************************
+* Name : BpSetBoardId
+*
+* Description: This function find the BOARD_PARAMETERS structure for the
+* specified board id string and assigns it to a global, static
+* variable.
+*
+* Parameters : [IN] pszBoardId - Board id string that is saved into NVRAM.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_FOUND - Error, board id input string does not
+* have a board parameters configuration record.
+***************************************************************************/
+int BpSetBoardId( char *pszBoardId )
+{
+ int nRet = BP_BOARD_ID_NOT_FOUND;
+ PBOARD_PARAMETERS *ppBp;
+
+ for( ppBp = g_BoardParms; *ppBp; ppBp++ )
+ {
+ if( !bpstrcmp((*ppBp)->szBoardId, pszBoardId) )
+ {
+ g_pCurrentBp = *ppBp;
+ nRet = BP_SUCCESS;
+ break;
+ }
+ }
+
+ return( nRet );
+} /* BpSetBoardId */
+
+/**************************************************************************
+* Name : BpGetBoardId
+*
+* Description: This function returns the current board id strings.
+*
+* Parameters : [OUT] pszBoardIds - Address of a buffer that the board id
+* string is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+***************************************************************************/
+
+int BpGetBoardId( char *pszBoardId )
+{
+ int i;
+
+ if (g_pCurrentBp == 0)
+ return -1;
+
+ for (i = 0; i < BP_BOARD_ID_LEN; i++)
+ pszBoardId[i] = g_pCurrentBp->szBoardId[i];
+
+ return 0;
+}
+
+/**************************************************************************
+* Name : BpGetBoardIds
+*
+* Description: This function returns all of the supported board id strings.
+*
+* Parameters : [OUT] pszBoardIds - Address of a buffer that the board id
+* strings are returned in. Each id starts at BP_BOARD_ID_LEN
+* boundary.
+* [IN] nBoardIdsSize - Number of BP_BOARD_ID_LEN elements that
+* were allocated in pszBoardIds.
+*
+* Returns : Number of board id strings returned.
+***************************************************************************/
+int BpGetBoardIds( char *pszBoardIds, int nBoardIdsSize )
+{
+ PBOARD_PARAMETERS *ppBp;
+ int i;
+ char *src;
+ char *dest;
+
+ for( i = 0, ppBp = g_BoardParms; *ppBp && nBoardIdsSize;
+ i++, ppBp++, nBoardIdsSize--, pszBoardIds += BP_BOARD_ID_LEN )
+ {
+ dest = pszBoardIds;
+ src = (*ppBp)->szBoardId;
+ while( *src )
+ *dest++ = *src++;
+ *dest = '\0';
+ }
+
+ return( i );
+} /* BpGetBoardIds */
+
+/**************************************************************************
+* Name : BpGetGPIOverlays
+*
+* Description: This function GPIO overlay configuration
+*
+* Parameters : [OUT] pusValue - Address of short word that interfaces in use.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetGPIOverlays( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usGPIOOverlay;
+
+ if( g_pCurrentBp->usGPIOOverlay != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetGPIOverlays */
+
+/**************************************************************************
+* Name : BpGetEthernetMacInfo
+*
+* Description: This function returns all of the supported board id strings.
+*
+* Parameters : [OUT] pEnetInfos - Address of an array of ETHERNET_MAC_INFO
+* buffers.
+* [IN] nNumEnetInfos - Number of ETHERNET_MAC_INFO elements that
+* are pointed to by pEnetInfos.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+***************************************************************************/
+int BpGetEthernetMacInfo( PETHERNET_MAC_INFO pEnetInfos, int nNumEnetInfos )
+{
+ int i, nRet;
+
+ if( g_pCurrentBp )
+ {
+ for( i = 0; i < nNumEnetInfos; i++, pEnetInfos++ )
+ {
+ if( i < BP_MAX_ENET_MACS )
+ {
+ unsigned char *src = (unsigned char *)
+ &g_pCurrentBp->EnetMacInfos[i];
+ unsigned char *dest = (unsigned char *) pEnetInfos;
+ int len = sizeof(ETHERNET_MAC_INFO);
+ while( len-- )
+ *dest++ = *src++;
+ }
+ else
+ pEnetInfos->ucPhyType = BP_ENET_NO_PHY;
+ }
+
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ for( i = 0; i < nNumEnetInfos; i++, pEnetInfos++ )
+ pEnetInfos->ucPhyType = BP_ENET_NO_PHY;
+
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetEthernetMacInfo */
+
+/**************************************************************************
+* Name : BpGetRj11InnerOuterPairGpios
+*
+* Description: This function returns the GPIO pin assignments for changing
+* between the RJ11 inner pair and RJ11 outer pair.
+*
+* Parameters : [OUT] pusInner - Address of short word that the RJ11 inner pair
+* GPIO pin is returned in.
+* [OUT] pusOuter - Address of short word that the RJ11 outer pair
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, values are returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetRj11InnerOuterPairGpios( unsigned short *pusInner,
+ unsigned short *pusOuter )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusInner = g_pCurrentBp->usGpioRj11InnerPair;
+ *pusOuter = g_pCurrentBp->usGpioRj11OuterPair;
+
+ if( g_pCurrentBp->usGpioRj11InnerPair != BP_NOT_DEFINED &&
+ g_pCurrentBp->usGpioRj11OuterPair != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusInner = *pusOuter = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetRj11InnerOuterPairGpios */
+
+/**************************************************************************
+* Name : BpGetUartRtsCtsGpios
+*
+* Description: This function returns the GPIO pin assignments for RTS and CTS
+* UART signals.
+*
+* Parameters : [OUT] pusRts - Address of short word that the UART RTS GPIO
+* pin is returned in.
+* [OUT] pusCts - Address of short word that the UART CTS GPIO
+* pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, values are returned.
+* BP_BOARD_ID_NOT_SET - Error, board id input string does not
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetRtsCtsUartGpios( unsigned short *pusRts, unsigned short *pusCts )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusRts = g_pCurrentBp->usGpioUartRts;
+ *pusCts = g_pCurrentBp->usGpioUartCts;
+
+ if( g_pCurrentBp->usGpioUartRts != BP_NOT_DEFINED &&
+ g_pCurrentBp->usGpioUartCts != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusRts = *pusCts = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetUartRtsCtsGpios */
+
+/**************************************************************************
+* Name : BpGetAdslLedGpio
+*
+* Description: This function returns the GPIO pin assignment for the ADSL
+* LED.
+*
+* Parameters : [OUT] pusValue - Address of short word that the ADSL LED
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetAdslLedGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usGpioLedAdsl;
+
+ if( g_pCurrentBp->usGpioLedAdsl != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetAdslLedGpio */
+
+/**************************************************************************
+* Name : BpGetAdslFailLedGpio
+*
+* Description: This function returns the GPIO pin assignment for the ADSL
+* LED that is used when there is a DSL connection failure.
+*
+* Parameters : [OUT] pusValue - Address of short word that the ADSL LED
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetAdslFailLedGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usGpioLedAdslFail;
+
+ if( g_pCurrentBp->usGpioLedAdslFail != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetAdslFailLedGpio */
+
+/**************************************************************************
+* Name : BpGetSecAdslLedGpio
+*
+* Description: This function returns the GPIO pin assignment for the ADSL
+* LED of the Secondary line, applicable more for bonding.
+*
+* Parameters : [OUT] pusValue - Address of short word that the ADSL LED
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetSecAdslLedGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usGpioSecLedAdsl;
+
+ if( g_pCurrentBp->usGpioSecLedAdsl != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetSecAdslLedGpio */
+
+/**************************************************************************
+* Name : BpGetSecAdslFailLedGpio
+*
+* Description: This function returns the GPIO pin assignment for the ADSL
+* LED of the Secondary ADSL line, that is used when there is
+* a DSL connection failure.
+*
+* Parameters : [OUT] pusValue - Address of short word that the ADSL LED
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetSecAdslFailLedGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usGpioSecLedAdslFail;
+
+ if( g_pCurrentBp->usGpioSecLedAdslFail != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetSecAdslFailLedGpio */
+
+/**************************************************************************
+* Name : BpGetWirelessAntInUse
+*
+* Description: This function returns the antennas in use for wireless
+*
+* Parameters : [OUT] pusValue - Address of short word that the Wireless Antenna
+* is in use.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetWirelessAntInUse( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usAntInUseWireless;
+
+ if( g_pCurrentBp->usAntInUseWireless != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetWirelessAntInUse */
+
+/**************************************************************************
+* Name : BpGetWirelessFlags
+*
+* Description: This function returns optional control flags for wireless
+*
+* Parameters : [OUT] pusValue - Address of short word control flags
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetWirelessFlags( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usWirelessFlags;
+
+ if( g_pCurrentBp->usWirelessFlags != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetWirelessAntInUse */
+
+/**************************************************************************
+* Name : BpGetWirelessSesExtIntr
+*
+* Description: This function returns the external interrupt number for the
+* Wireless Ses Button.
+*
+* Parameters : [OUT] pusValue - Address of short word that the Wireless Ses
+* external interrup is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetWirelessSesExtIntr( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usExtIntrSesBtnWireless;
+
+ if( g_pCurrentBp->usExtIntrSesBtnWireless != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+
+} /* BpGetWirelessSesExtIntr */
+
+/**************************************************************************
+* Name : BpGetWirelessSesLedGpio
+*
+* Description: This function returns the GPIO pin assignment for the Wireless
+* Ses Led.
+*
+* Parameters : [OUT] pusValue - Address of short word that the Wireless Ses
+* Led GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetWirelessSesLedGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usGpioLedSesWireless;
+
+ if( g_pCurrentBp->usGpioLedSesWireless != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+
+} /* BpGetWirelessSesLedGpio */
+
+/* this data structure could be moved to boardparams structure in the future */
+/* does not require to rebuild cfe here if more srom entries are needed */
+static WLAN_SROM_PATCH_INFO wlanPaInfo[]={
+#if defined(_BCM96362_) || defined(CONFIG_BCM96362)
+ /* this is the patch to srom map for 96362ADVNX */
+ {"96362ADVNX", 0x6362, 220,
+ {{"boardrev", 65, 0x1100},
+ {"fem2g", 87, 0x0319},
+ {"ittmaxp2ga0", 96, 0x2058},
+ {"pa2gw0a0", 97, 0xfe6f},
+ {"pa2gw1a0", 98, 0x1785},
+ {"pa2gw2a0", 99, 0xfa21},
+ {"ittmaxp2ga1", 112, 0x2058},
+ {"pa2gw0a0", 113, 0xfe77},
+ {"pa2gw1a0", 114, 0x17e0},
+ {"pa2gw2a0", 115, 0xfa16},
+ {"ofdm2gpo0", 161, 0x5555},
+ {"ofdm2gpo1", 162, 0x5555},
+ {"mcs2gpo0", 169, 0x5555},
+ {"mcs2gpo1", 170, 0x5555},
+ {"mcs2gpo2", 171, 0x5555},
+ {"mcs2gpo3", 172, 0x5555},
+ {"mcs2gpo4", 173, 0x3333},
+ {"mcs2gpo5", 174, 0x3333},
+ {"mcs2gpo6", 175, 0x3333},
+ {"mcs2gpo7", 176, 0x3333},
+ {"", 0, 0}}},
+ /* this is the patch to srom map for 6362SDVNgr2 */
+ {"96362ADVNgr2", 0x6362, 220,
+ {{"ittmaxp2ga0", 96, 0x2048},
+ {"pa2gw0a0", 97, 0xfeff},
+ {"pa2gw1a0", 98, 0x160e},
+ {"pa2gw2a0", 99, 0xfabf},
+ {"ittmaxp2ga1", 112, 0x2048},
+ {"pa2gw0a0", 113, 0xff13},
+ {"pa2gw1a0", 114, 0x161e},
+ {"pa2gw2a0", 115, 0xfacc},
+ {"mcs2gpo0", 169, 0x2222},
+ {"mcs2gpo1", 170, 0x2222},
+ {"mcs2gpo2", 171, 0x2222},
+ {"mcs2gpo3", 172, 0x2222},
+ {"mcs2gpo4", 173, 0x4444},
+ {"mcs2gpo5", 174, 0x4444},
+ {"mcs2gpo6", 175, 0x4444},
+ {"mcs2gpo7", 176, 0x4444},
+ {"", 0, 0}}},
+#endif
+#if 0 //defined(_BCM96328_) || defined(CONFIG_BCM96328)
+ {"963281TAN", 0xa8d9, 220,
+ {{"pa2gw0a0", 97, 0xfed9},
+ {"pa2gw1a0", 98, 0x15c7},
+ {"pa2gw2a0", 99, 0xfaee},
+ {"pa2gw0a0", 113, 0xfed7},
+ {"pa2gw1a0", 114, 0x1540},
+ {"pa2gw2a0", 115, 0xfafc},
+ {"", 0, 0}}},
+#endif
+ {"", 0, 0, {{"", 0, 0}}}, /* last entry*/
+};
+
+/**************************************************************************
+* Name : BpUpdateWirelessSromMap
+*
+* Description: This function patch wireless PA values
+*
+* Parameters : [IN] unsigned short chipID
+* [IN/OUT] unsigned short* pBase - base of srom map
+* [IN/OUT] int size - size of srom map
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpUpdateWirelessSromMap(unsigned short chipID, unsigned short* pBase, int sizeInWords)
+{
+ int nRet = BP_BOARD_ID_NOT_FOUND;
+ int i = 0;
+ int j = 0;
+
+ if(chipID == 0 || pBase == 0 || sizeInWords <= 0 )
+ return nRet;
+
+ i = 0;
+ while ( wlanPaInfo[i].szboardId[0] != 0 ) {
+ /* check boardId */
+ if ( !bpstrcmp(g_pCurrentBp->szBoardId, wlanPaInfo[i].szboardId) ) {
+ /* check chipId */
+ if ( (wlanPaInfo[i].usWirelessChipId == chipID) && (wlanPaInfo[i].usNeededSize <= sizeInWords) ){
+ /* valid , patch entry */
+ while ( wlanPaInfo[i].entries[j].name[0] ) {
+ pBase[wlanPaInfo[i].entries[j].wordOffset] = wlanPaInfo[i].entries[j].value;
+ j++;
+ }
+ nRet = BP_SUCCESS;
+ goto srom_update_done;
+ }
+ }
+ i++;
+ }
+
+srom_update_done:
+
+ return( nRet );
+
+} /* BpUpdateWirelessSromMap */
+
+
+static WLAN_PCI_PATCH_INFO wlanPciInfo[]={
+#if defined(_BCM96362_) || defined(CONFIG_BCM96362)
+ /* this is the patch to boardtype(boardid) for internal PA */
+ {"96362ADVNX", 0x435f14e4, 64,
+ {{"subpciids", 11, 0x53614e4},
+ {"", 0, 0}}},
+#endif
+ {"", 0, 0, {{"", 0, 0}}}, /* last entry*/
+};
+
+/**************************************************************************
+* Name : BpUpdateWirelessPciConfig
+*
+* Description: This function patch wireless PCI Config Header
+* This is not functional critial/necessary but for dvt database maintenance
+*
+* Parameters : [IN] unsigned int pciID
+* [IN/OUT] unsigned int* pBase - base of pci config header
+* [IN/OUT] int sizeInDWords - size of pci config header
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpUpdateWirelessPciConfig (unsigned long pciID, unsigned long* pBase, int sizeInDWords)
+{
+ int nRet = BP_BOARD_ID_NOT_FOUND;
+ int i = 0;
+ int j = 0;
+
+ if(pciID == 0 || pBase == 0 || sizeInDWords <= 0 )
+ return nRet;
+
+ i = 0;
+ while ( wlanPciInfo[i].szboardId[0] != 0 ) {
+ /* check boardId */
+ if ( !bpstrcmp(g_pCurrentBp->szBoardId, wlanPciInfo[i].szboardId) ) {
+ /* check pciId */
+ if ( (wlanPciInfo[i].usWirelessPciId == pciID) && (wlanPciInfo[i].usNeededSize <= sizeInDWords) ){
+ /* valid , patch entry */
+ while ( wlanPciInfo[i].entries[j].name[0] ) {
+ pBase[wlanPciInfo[i].entries[j].dwordOffset] = wlanPciInfo[i].entries[j].value;
+ j++;
+ }
+ nRet = BP_SUCCESS;
+ goto pciconfig_update_done;
+ }
+ }
+ i++;
+ }
+
+pciconfig_update_done:
+
+ return( nRet );
+
+}
+
+/**************************************************************************
+* Name : BpGetHpnaLedGpio
+*
+* Description: This function returns the GPIO pin assignment for the HPNA
+* LED.
+*
+* Parameters : [OUT] pusValue - Address of short word that the HPNA LED
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetHpnaLedGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usGpioLedHpna;
+
+ if( g_pCurrentBp->usGpioLedHpna != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetHpnaLedGpio */
+
+/**************************************************************************
+* Name : BpGetWanDataLedGpio
+*
+* Description: This function returns the GPIO pin assignment for the WAN Data
+* LED.
+*
+* Parameters : [OUT] pusValue - Address of short word that the WAN Data LED
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetWanDataLedGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usGpioLedWanData;
+
+ if( g_pCurrentBp->usGpioLedWanData != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetWanDataLedGpio */
+
+/**************************************************************************
+* Name : BpGetWanErrorLedGpio
+*
+* Description: This function returns the GPIO pin assignment for the WAN
+* LED that is used when there is a WAN connection failure.
+*
+* Parameters : [OUT] pusValue - Address of short word that the WAN LED
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetWanErrorLedGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usGpioLedWanError;
+
+ if( g_pCurrentBp->usGpioLedWanError != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetWanErrorLedGpio */
+
+/**************************************************************************
+* Name : BpGetBootloaderPowerOnLedGpio
+*
+* Description: This function returns the GPIO pin assignment for the power
+* on LED that is set by the bootloader.
+*
+* Parameters : [OUT] pusValue - Address of short word that the alarm LED
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetBootloaderPowerOnLedGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usGpioLedBlPowerOn;
+
+ if( g_pCurrentBp->usGpioLedBlPowerOn != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetBootloaderPowerOn */
+
+/**************************************************************************
+* Name : BpGetBootloaderStopLedGpio
+*
+* Description: This function returns the GPIO pin assignment for the break
+* into bootloader LED that is set by the bootloader.
+*
+* Parameters : [OUT] pusValue - Address of short word that the break into
+* bootloader LED GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetBootloaderStopLedGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usGpioLedBlStop;
+
+ if( g_pCurrentBp->usGpioLedBlStop != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetBootloaderStopLedGpio */
+
+/**************************************************************************
+* Name : BpGetVoipLedGpio
+*
+* Description: This function returns the GPIO pin assignment for the VOIP
+* LED.
+*
+* Parameters : [OUT] pusValue - Address of short word that the VOIP LED
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+*
+* Note : The VoIP structure would allow for having one LED per DSP
+* however, the board initialization function assumes only one
+* LED per functionality (ie one LED for VoIP). Therefore in
+* order to keep this tidy and simple we do not make usage of the
+* one-LED-per-DSP function. Instead, we assume that the LED for
+* VoIP is unique and associated with DSP 0 (always present on
+* any VoIP platform). If changing this to a LED-per-DSP function
+* then one need to update the board initialization driver in
+* bcmdrivers\opensource\char\board\bcm963xx\impl1
+***************************************************************************/
+int BpGetVoipLedGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( 0 );
+
+ if( pDspInfo )
+ {
+ *pusValue = pDspInfo->usGpioLedVoip;
+
+ if( *pusValue != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_FOUND;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetVoipLedGpio */
+
+/**************************************************************************
+* Name : BpGetVoip1LedGpio
+*
+* Description: This function returns the GPIO pin assignment for the VoIP1.
+* LED which is used when FXS0 is active
+* Parameters : [OUT] pusValue - Address of short word that the VoIP1
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetVoip1LedGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ VOIP_DSP_INFO *pDspInfo = &g_pCurrentBp->VoIPDspInfo[0];
+
+ if( pDspInfo->ucDspType != BP_VOIP_NO_DSP)
+ {
+ *pusValue = pDspInfo->usGpioVoip1Led;
+
+ if( pDspInfo->usGpioVoip1Led != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetVoip1LedGpio */
+
+/**************************************************************************
+* Name : BpGetVoip1FailLedGpio
+*
+* Description: This function returns the GPIO pin assignment for the VoIP1
+* Fail LED which is used when there's an error with FXS0
+* Parameters : [OUT] pusValue - Address of short word that the VoIP1
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetVoip1FailLedGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ VOIP_DSP_INFO *pDspInfo = &g_pCurrentBp->VoIPDspInfo[0];
+
+ if( pDspInfo->ucDspType != BP_VOIP_NO_DSP)
+ {
+ *pusValue = pDspInfo->usGpioVoip1LedFail;
+
+ if( pDspInfo->usGpioVoip1LedFail != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetVoip1FailLedGpio */
+
+/**************************************************************************
+* Name : BpGetVoip2LedGpio
+*
+* Description: This function returns the GPIO pin assignment for the VoIP2.
+* LED which is used when FXS1 is active
+* Parameters : [OUT] pusValue - Address of short word that the VoIP2
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetVoip2LedGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ VOIP_DSP_INFO *pDspInfo = &g_pCurrentBp->VoIPDspInfo[0];
+
+ if( pDspInfo->ucDspType != BP_VOIP_NO_DSP)
+ {
+ *pusValue = pDspInfo->usGpioVoip2Led;
+
+ if( pDspInfo->usGpioVoip2Led != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetVoip2LedGpio */
+
+/**************************************************************************
+* Name : BpGetVoip2FailLedGpio
+*
+* Description: This function returns the GPIO pin assignment for the VoIP2
+* Fail LED which is used when there's an error with FXS1
+* Parameters : [OUT] pusValue - Address of short word that the VoIP2
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetVoip2FailLedGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ VOIP_DSP_INFO *pDspInfo = &g_pCurrentBp->VoIPDspInfo[0];
+
+ if( pDspInfo->ucDspType != BP_VOIP_NO_DSP)
+ {
+ *pusValue = pDspInfo->usGpioVoip2LedFail;
+
+ if( pDspInfo->usGpioVoip2LedFail != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetVoip2FailLedGpio */
+
+/**************************************************************************
+* Name : BpGetPotsLedGpio
+*
+* Description: This function returns the GPIO pin assignment for the POTS1.
+* LED which is used when DAA is active
+* Parameters : [OUT] pusValue - Address of short word that the POTS11
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetPotsLedGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ VOIP_DSP_INFO *pDspInfo = &g_pCurrentBp->VoIPDspInfo[0];
+
+ if( pDspInfo->ucDspType != BP_VOIP_NO_DSP)
+ {
+ *pusValue = pDspInfo->usGpioPotsLed;
+
+ if( pDspInfo->usGpioPotsLed != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetPotsLedGpio */
+
+/**************************************************************************
+* Name : BpGetDectLedGpio
+*
+* Description: This function returns the GPIO pin assignment for the DECT.
+* LED which is used when DECT is active
+* Parameters : [OUT] pusValue - Address of short word that the DECT
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetDectLedGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ VOIP_DSP_INFO *pDspInfo = &g_pCurrentBp->VoIPDspInfo[0];
+
+ if( pDspInfo->ucDspType != BP_VOIP_NO_DSP)
+ {
+ *pusValue = pDspInfo->usGpioDectLed;
+
+ if( pDspInfo->usGpioDectLed != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetDectLedGpio */
+
+/**************************************************************************
+* Name : BpGetFpgaResetGpio
+*
+* Description: This function returns the GPIO pin assignment for the FPGA
+* Reset signal.
+*
+* Parameters : [OUT] pusValue - Address of short word that the FPGA Reset
+* signal GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetFpgaResetGpio( unsigned short *pusValue ) {
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usGpioFpgaReset;
+
+ if( g_pCurrentBp->usGpioFpgaReset != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+
+} /*BpGetFpgaResetGpio*/
+
+/**************************************************************************
+* Name : BpGetGponLedGpio
+*
+* Description: This function returns the GPIO pin assignment for the GPON
+* LED.
+*
+* Parameters : [OUT] pusValue - Address of short word that the GPON LED
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetGponLedGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usGpioLedGpon;
+
+ if( g_pCurrentBp->usGpioLedGpon != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetGponLedGpio */
+
+/**************************************************************************
+* Name : BpGetGponFailLedGpio
+*
+* Description: This function returns the GPIO pin assignment for the GPON
+* LED that is used when there is a GPON connection failure.
+*
+* Parameters : [OUT] pusValue - Address of short word that the GPON LED
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetGponFailLedGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usGpioLedGponFail;
+
+ if( g_pCurrentBp->usGpioLedGponFail != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetGponFailLedGpio */
+
+
+/**************************************************************************
+* Name : BpGetMoCALedGpio
+*
+* Description: This function returns the GPIO pin assignment for the MoCA
+* LED.
+*
+* Parameters : [OUT] pusValue - Address of short word that the MoCA LED
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetMoCALedGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usGpioLedMoCA;
+
+ if( g_pCurrentBp->usGpioLedMoCA != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetMoCALedGpio */
+
+/**************************************************************************
+* Name : BpGetMoCAFailLedGpio
+*
+* Description: This function returns the GPIO pin assignment for the MoCA
+* LED that is used when there is a MoCA connection failure.
+*
+* Parameters : [OUT] pusValue - Address of short word that the MoCA LED
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetMoCAFailLedGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usGpioLedMoCAFail;
+
+ if( g_pCurrentBp->usGpioLedMoCAFail != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetMoCAFailLedGpio */
+
+/**************************************************************************
+* Name : BpGetHpnaExtIntr
+*
+* Description: This function returns the HPNA external interrupt number.
+*
+* Parameters : [OUT] pulValue - Address of short word that the HPNA
+* external interrupt number is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetHpnaExtIntr( unsigned long *pulValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pulValue = g_pCurrentBp->usExtIntrHpna;
+
+ if( g_pCurrentBp->usExtIntrHpna != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pulValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetHpnaExtIntr */
+
+/**************************************************************************
+* Name : BpGetHpnaChipSelect
+*
+* Description: This function returns the HPNA chip select number.
+*
+* Parameters : [OUT] pulValue - Address of short word that the HPNA
+* chip select number is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetHpnaChipSelect( unsigned long *pulValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pulValue = g_pCurrentBp->usCsHpna;
+
+ if( g_pCurrentBp->usCsHpna != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pulValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetHpnaChipSelect */
+
+/**************************************************************************
+* Name : BpGetResetToDefaultExtIntr
+*
+* Description: This function returns the external interrupt number for the
+* reset to default button.
+*
+* Parameters : [OUT] pusValue - Address of short word that reset to default
+* external interrupt is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetResetToDefaultExtIntr( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usExtIntrResetToDefault;
+
+ if( g_pCurrentBp->usExtIntrResetToDefault != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+
+} /* BpGetResetToDefaultExtIntr */
+
+/**************************************************************************
+* Name : BpGetWirelessPowerDownGpio
+*
+* Description: This function returns the GPIO pin assignment for WLAN_PD
+*
+*
+* Parameters : [OUT] pusValue - Address of short word that the WLAN_PD
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - At least one return value is not defined
+* for the board.
+***************************************************************************/
+int BpGetWirelessPowerDownGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usGpioWirelessPowerDown;
+
+ if( g_pCurrentBp->usGpioWirelessPowerDown != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* usGpioWirelessPowerDown */
+
+/**************************************************************************
+* Name : BpGetDslPhyAfeIds
+*
+* Description: This function returns the DSL PHY AFE ids for primary and
+* secondary PHYs.
+*
+* Parameters : [OUT] pulValues-Address of an array of two long words where
+* AFE Id for the primary and secondary PHYs are returned.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET-Error, BpSetBoardId hasn't been called.
+* BP_VALUE_NOT_DEFINED - No defined AFE Ids.
+**************************************************************************/
+int BpGetDslPhyAfeIds( unsigned long *pulValues )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ pulValues[0] = g_pCurrentBp->ulAfeIds[0];
+ pulValues[1] = g_pCurrentBp->ulAfeIds[1];
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ pulValues[0] = BP_AFE_DEFAULT;
+ pulValues[1] = BP_AFE_DEFAULT;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetDslPhyAfeIds */
+
+/**************************************************************************
+* Name : BpGetExtAFEResetGpio
+*
+* Description: This function returns the GPIO pin assignment for resetting the external AFE chip
+*
+*
+* Parameters : [OUT] pusValue - Address of short word that the ExtAFEReset
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - Not defined
+***************************************************************************/
+int BpGetExtAFEResetGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usGpioExtAFEReset;
+
+ if( g_pCurrentBp->usGpioExtAFEReset != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetExtAFEResetGpio */
+
+/**************************************************************************
+* Name : BpGetExtAFELDModeGpio
+*
+* Description: This function returns the GPIO pin assignment for setting LD Mode to ADSL/VDSL
+*
+*
+* Parameters : [OUT] pusValue - Address of short word that the usGpioExtAFELDMode
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - Not defined
+***************************************************************************/
+int BpGetExtAFELDModeGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usGpioExtAFELDMode;
+
+ if( g_pCurrentBp->usGpioExtAFELDMode != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetExtAFELDModeGpio */
+
+/**************************************************************************
+* Name : BpGetExtAFELDPwrGpio
+*
+* Description: This function returns the GPIO pin assignment for turning on/off the external AFE LD
+*
+*
+* Parameters : [OUT] pusValue - Address of short word that the usGpioExtAFELDPwr
+* GPIO pin is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - Not defined
+***************************************************************************/
+int BpGetExtAFELDPwrGpio( unsigned short *pusValue )
+{
+ int nRet;
+
+ if( g_pCurrentBp )
+ {
+ *pusValue = g_pCurrentBp->usGpioExtAFELDPwr;
+
+ if( g_pCurrentBp->usGpioExtAFELDPwr != BP_NOT_DEFINED )
+ {
+ nRet = BP_SUCCESS;
+ }
+ else
+ {
+ nRet = BP_VALUE_NOT_DEFINED;
+ }
+ }
+ else
+ {
+ *pusValue = BP_NOT_DEFINED;
+ nRet = BP_BOARD_ID_NOT_SET;
+ }
+
+ return( nRet );
+} /* BpGetExtAFELDPwrGpio */
+
+
+/**************************************************************************
+* Name : BpGet6829PortInfo
+*
+* Description: This function checks the ENET MAC info to see if a 6829
+* is connected
+*
+* Parameters : [OUT] portInfo6829 - 0 if 6829 is not present
+* - 6829 port information otherwise
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
+* BP_VALUE_NOT_DEFINED - Not defined
+***************************************************************************/
+int BpGet6829PortInfo( unsigned char *portInfo6829 )
+{
+ ETHERNET_MAC_INFO enetMacInfo;
+ ETHERNET_SW_INFO *pSwInfo;
+ int retVal;
+ int i;
+
+ *portInfo6829 = 0;
+ retVal = BpGetEthernetMacInfo( &enetMacInfo, 1 );
+ if ( BP_SUCCESS == retVal )
+ {
+ pSwInfo = &enetMacInfo.sw;
+ for (i = 0; i < BP_MAX_SWITCH_PORTS; i++)
+ {
+ if ( (pSwInfo->phy_id[i] != 0xFF) &&
+ (pSwInfo->phy_id[i] & 0x80) )
+ {
+ *portInfo6829 = pSwInfo->phy_id[i];
+ retVal = BP_SUCCESS;
+ break;
+ }
+ }
+ }
+
+ return retVal;
+
+}
+
diff --git a/shared/opensource/boardparms/bcm963xx/boardparms_voice.c b/shared/opensource/boardparms/bcm963xx/boardparms_voice.c
new file mode 100755
index 0000000..72161cd
--- /dev/null
+++ b/shared/opensource/boardparms/bcm963xx/boardparms_voice.c
@@ -0,0 +1,8804 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+/**************************************************************************
+* File Name : boardparms_voice.c
+*
+* Description: This file contains the implementation for the BCM63xx board
+* parameter voice access functions.
+*
+***************************************************************************/
+
+/* ---- Include Files ---------------------------------------------------- */
+
+#include "boardparms_voice.h"
+
+/* ---- Public Variables ------------------------------------------------- */
+
+/* ---- Private Constants and Types -------------------------------------- */
+
+/* Always end the device list in VOICE_BOARD_PARMS with this macro */
+#define BP_NULL_DEVICE_MACRO \
+{ \
+ BP_VD_NONE, \
+ { 0, BP_NOT_DEFINED }, \
+ 0, \
+ BP_NOT_DEFINED, \
+ { \
+ { BP_VOICE_CHANNEL_INACTIVE, BP_VCTYPE_NONE, BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, BP_VOICE_CHANNEL_NARROWBAND, BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, BP_VOICE_CHANNEL_ENDIAN_BIG, BP_TIMESLOT_INVALID, BP_TIMESLOT_INVALID }, \
+ { BP_VOICE_CHANNEL_INACTIVE, BP_VCTYPE_NONE, BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW, BP_VOICE_CHANNEL_NARROWBAND, BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, BP_VOICE_CHANNEL_ENDIAN_BIG, BP_TIMESLOT_INVALID, BP_TIMESLOT_INVALID }, \
+ } \
+}
+
+#define BP_NULL_CHANNEL_MACRO \
+{ BP_VOICE_CHANNEL_INACTIVE, \
+ BP_VCTYPE_NONE, \
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE, \
+ BP_VOICE_CHANNEL_NARROWBAND, \
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS, \
+ BP_VOICE_CHANNEL_ENDIAN_BIG, \
+ BP_TIMESLOT_INVALID, \
+ BP_TIMESLOT_INVALID \
+},
+
+
+#if defined(_BCM96328_) || defined(CONFIG_BCM96328)
+
+VOICE_BOARD_PARMS voiceBoard_96328AVNG_LE88276 =
+{
+ VOICECFG_LE88276_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_88276,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_14_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_31_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+
+VOICE_BOARD_PARMS voiceBoard_96328AVNG_SI3226 =
+{
+ VOICECFG_SI3226_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_3226,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_14_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_31_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+
+VOICE_BOARD_PARMS voiceBoard_96328AVNG_VE890 =
+{
+ VOICECFG_VE890_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 1, /* numFxoLines */
+ 0, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89116,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_14_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89316,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_30_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 2,
+ 2
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_31_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+
+VOICE_BOARD_PARMS voiceBoard_96328AVNG_SI3217X =
+{
+ VOICECFG_SI3217X_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 1, /* numFxoLines */
+ 0, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32176,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_14_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32178,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_30_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 2,
+ 2
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_31_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+
+VOICE_BOARD_PARMS voiceBoard_96328AVNG_LE88506 =
+{
+ VOICECFG_LE88506_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_88506,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_14_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_31_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96328AVNG_SI32267 =
+{
+ VOICECFG_6328AVNG_SI32267_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32267,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 6,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_14_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_31_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( BP_FLAG_ISI_SUPPORT )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96328AVNG_LE88276_NTR =
+{
+ VOICECFG_6328AVNG_LE88276_NTR_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_88276,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_14_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96328AVNG_VE890HV_Partial =
+{
+ VOICECFG_6328AVNG_VE890HV_PARTIAL_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 1, /* numFxoLines */
+ 0, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89116,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_14_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89336,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 0, /* This setting is specific to Zarlink reference card Le71HR8923G for shared 1 reset line. */
+
+ /* Reset pin */
+ BP_GPIO_30_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 2,
+ 2
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_31_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96328AVNG_VE890HV =
+{
+ VOICECFG_6328AVNG_VE890HV_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 1, /* numFxoLines */
+ 0, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89136,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_14_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89336,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 0, /* This setting is specific to Zarlink reference card Le71HR8923G for shared 1 reset line. */
+
+ /* Reset pin */
+ BP_GPIO_30_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 2,
+ 2
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_31_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96328AVNGR_SI32176 =
+{
+ VOICECFG_6328AVNGR_SI32176_STR, /* szBoardId */
+ 1, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32176,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96328AVNGR_LE89116 =
+{
+ VOICECFG_6328AVNGR_LE89116_STR, /* szBoardId */
+ 1, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89116,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96328AVNGR_SI3217X =
+{
+ VOICECFG_6328AVNGR_SI3217X_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 1, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32176,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32178,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 0, /* Reset line shared to one line only for AVNGR board */
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 2,
+ 2
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+static PVOICE_BOARD_PARMS g_VoiceBoardParms[] =
+{
+ &voiceBoard_96328AVNG_LE88276,
+ &voiceBoard_96328AVNG_SI3226,
+ &voiceBoard_96328AVNG_VE890,
+ &voiceBoard_96328AVNG_SI3217X,
+ &voiceBoard_96328AVNG_LE88506,
+#ifdef SI32267ENABLE
+ &voiceBoard_96328AVNG_SI32267,
+#endif
+ &voiceBoard_96328AVNG_LE88276_NTR,
+ &voiceBoard_96328AVNG_VE890HV_Partial,
+ &voiceBoard_96328AVNG_VE890HV,
+
+ &voiceBoard_96328AVNGR_SI32176,
+ &voiceBoard_96328AVNGR_LE89116,
+ &voiceBoard_96328AVNGR_SI3217X,
+ 0
+};
+
+
+#endif
+
+#if defined(_BCM96362_) || defined(CONFIG_BCM96362)
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_NOSLIC =
+{
+ VOICECFG_6362ADVNGP5_NOSLIC_STR, /* szBoardId */
+ 0, /* numFxsLines */
+ 0, /* numFxoLines */
+ 4, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_6_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_6_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_VE890 =
+{
+ VOICECFG_6362ADVNGP5_VE890_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 1, /* numFxoLines */
+ 4, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_6_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_6_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89116,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_0_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice3 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89316,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_31_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 2,
+ 2
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_10_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_LE89116 =
+{
+ VOICECFG_6362ADVNGP5_LE89116_STR, /* szBoardId */
+ 1, /* numFxsLines */
+ 0, /* numFxoLines */
+ 4, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_6_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_6_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89116,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_0_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_10_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_LE89316 =
+{
+ VOICECFG_6362ADVNGP5_LE89316_STR, /* szBoardId */
+ 1, /* numFxsLines */
+ 1, /* numFxoLines */
+ 4, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_6_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_6_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89316,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_31_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_10_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_SI3217X =
+{
+ VOICECFG_6362ADVNGP5_SI3217X_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 1, /* numFxoLines */
+ 4, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_6_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_6_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32176,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_0_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 32176 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice3 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32178,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_31_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 2,
+ 2
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_10_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_SI32176 =
+{
+ VOICECFG_6362ADVNGP5_SI32176_STR, /* szBoardId */
+ 1, /* numFxsLines */
+ 0, /* numFxoLines */
+ 4, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_6_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_6_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32176,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_0_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_10_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_SI32178 =
+{
+ VOICECFG_6362ADVNGP5_SI32178_STR, /* szBoardId */
+ 1, /* numFxsLines */
+ 1, /* numFxoLines */
+ 4, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_6_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_6_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32178,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_31_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_10_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_LE88276 =
+{
+ VOICECFG_6362ADVNGP5_LE88276_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 4, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_6_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_6_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_88276,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_0_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_10_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_SI3226 =
+{
+ VOICECFG_6362ADVNGP5_SI3226_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 4, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_6_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_6_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_3226,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_0_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_10_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_LE88506 =
+{
+ VOICECFG_6362ADVNGP5_LE88506_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 4, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_6_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_6_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_88506,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_0_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_10_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI3217X =
+{
+ VOICECFG_6362ADVNGR_SI3217X_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 1, /* numFxoLines */
+ 4, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32176,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_28_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice3 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32178,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_31_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 2,
+ 2
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI32176 =
+{
+ VOICECFG_6362ADVNGR_SI32176_STR, /* szBoardId */
+ 1, /* numFxsLines */
+ 0, /* numFxoLines */
+ 4, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32176,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_28_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI32178 =
+{
+ VOICECFG_6362ADVNGR_SI32178_STR, /* szBoardId */
+ 1, /* numFxsLines */
+ 1, /* numFxoLines */
+ 4, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32178,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_31_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI3217X_NOFXO =
+{
+ VOICECFG_6362ADVNGR_SI3217X_NOFXO_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 4, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32176,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_28_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 32176 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice3 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32178,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_31_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 2,
+ 2
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_VE890 =
+{
+ VOICECFG_6362ADVNGR_VE890_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 1, /* numFxoLines */
+ 4, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89116,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_28_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 4,
+ 4
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice3 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89316,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_31_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 5,
+ 5
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 6,
+ 6
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_LE89116 =
+{
+ VOICECFG_6362ADVNGR_LE89116_STR, /* szBoardId */
+ 1, /* numFxsLines */
+ 0, /* numFxoLines */
+ 4, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89116,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_28_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 4,
+ 4
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_LE89316 =
+{
+ VOICECFG_6362ADVNGR_LE89316_STR, /* szBoardId */
+ 1, /* numFxsLines */
+ 1, /* numFxoLines */
+ 4, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89316,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_31_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 4,
+ 4
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 5,
+ 5
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_LE88506 =
+{
+ VOICECFG_6362ADVNGR_LE88506_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 4, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_88506,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_28_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_LE88276 =
+{
+ VOICECFG_6362ADVNGR_LE88276_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 4, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_88276,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_28_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI3226 =
+{
+ VOICECFG_6362ADVNGR_SI3226_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 4, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_3226,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_28_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI32261 =
+{
+ VOICECFG_6362ADVNGR_SI32261_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 4, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32261,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_28_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI32267 =
+{
+ VOICECFG_6362ADVNGR_SI32267_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 4, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32267,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 3,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_28_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( BP_FLAG_ISI_SUPPORT )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_VE890HVP =
+{
+ VOICECFG_6362ADVNGR_VE890HV_PARTIAL_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 1, /* numFxoLines */
+ 4, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89116,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_28_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 4,
+ 4
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice3 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89336,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 0, /* This setting is specific to Zarlink reference card Le71HR8923G for shared 1 reset line. */
+
+ /* Reset pin */
+ BP_GPIO_28_AL, /* This setting is specific to Zarlink reference card Le71HR8923G for shared 1 reset line. */
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 5,
+ 5
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 6,
+ 6
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_VE890HV =
+{
+ VOICECFG_6362ADVNGR_VE890HV_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 1, /* numFxoLines */
+ 4, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89136,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_28_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 4,
+ 4
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice3 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89336,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_31_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 5,
+ 5
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 6,
+ 6
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNGR2_SI3217X =
+{
+ VOICECFG_6362ADVNGR2_SI3217X_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 1, /* numFxoLines */
+ 4, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32176,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_28_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice3 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32178,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_31_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 2,
+ 2
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_44_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNGR2_VE890 =
+{
+ VOICECFG_6362ADVNGR2_VE890_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 1, /* numFxoLines */
+ 4, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89116,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_28_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 4,
+ 4
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice3 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89316,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_31_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 5,
+ 5
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 6,
+ 6
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_44_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNGR2_LE88506 =
+{
+ VOICECFG_6362ADVNGR2_LE88506_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 4, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_88506,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_28_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_44_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNGR2_LE88276 =
+{
+ VOICECFG_6362ADVNGR2_LE88276_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 4, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_88276,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_28_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_44_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96362ADVNGR2_SI3226 =
+{
+ VOICECFG_6362ADVNGR2_SI3226_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 4, /* numDectLines */
+ 1, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_29_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_3226,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_28_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_44_AH, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+static PVOICE_BOARD_PARMS g_VoiceBoardParms[] =
+{
+ &voiceBoard_96362ADVNGP5_NOSLIC,
+// &voiceBoard_96362ADVNGP5_VE890,
+// &voiceBoard_96362ADVNGP5_LE89116,
+// &voiceBoard_96362ADVNGP5_LE89316,
+// &voiceBoard_96362ADVNGP5_SI3217X,
+// &voiceBoard_96362ADVNGP5_SI32176,
+// &voiceBoard_96362ADVNGP5_SI32178,
+// &voiceBoard_96362ADVNGP5_LE88276,
+// &voiceBoard_96362ADVNGP5_SI3226,
+// &voiceBoard_96362ADVNGP5_LE88506,
+ &voiceBoard_96362ADVNgr_SI3217X,
+ &voiceBoard_96362ADVNgr_SI32176,
+ &voiceBoard_96362ADVNgr_SI32178,
+ &voiceBoard_96362ADVNgr_SI3217X_NOFXO,
+ &voiceBoard_96362ADVNgr_VE890,
+ &voiceBoard_96362ADVNgr_LE89116,
+ &voiceBoard_96362ADVNgr_LE89316,
+ &voiceBoard_96362ADVNgr_LE88506,
+ &voiceBoard_96362ADVNgr_LE88276,
+ &voiceBoard_96362ADVNgr_SI3226,
+#ifdef SI32261ENABLE
+ &voiceBoard_96362ADVNgr_SI32261,
+#endif
+#ifdef SI32267ENABLE
+ &voiceBoard_96362ADVNgr_SI32267,
+#endif
+ &voiceBoard_96362ADVNgr_VE890HVP,
+ &voiceBoard_96362ADVNgr_VE890HV,
+ &voiceBoard_96362ADVNGR2_SI3217X,
+ &voiceBoard_96362ADVNGR2_VE890,
+ &voiceBoard_96362ADVNGR2_LE88506,
+ &voiceBoard_96362ADVNGR2_LE88276,
+ &voiceBoard_96362ADVNGR2_SI3226,
+ 0
+};
+
+#endif
+
+#if defined(_BCM96368_) || defined(CONFIG_BCM96368)
+
+VOICE_BOARD_PARMS voiceBoard_96368MVWG =
+{
+ VOICECFG_6368MVWG_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 1, /* numFxoLines */
+ 0, /* numDectLines */
+ 2, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89116,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_GPIO_28_AL,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_10_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 4,
+ 4
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89316,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 3,
+ /* SPI GPIO */
+ BP_GPIO_29_AL,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 0,
+
+ /* Reset pin */
+ BP_GPIO_10_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 5,
+ 5
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 6,
+ 6
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_GPIO_3_AH, BP_GPIO_13_AH } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96368MBG_VE890 =
+{
+ VOICECFG_6368MBG_VE890_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 1, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+{
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89116,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_3_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89316,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_GPIO_28_AL,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_16_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 2,
+ 2
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96368MBG_LE89116 =
+{
+ VOICECFG_6368MBG_LE89116_STR, /* szBoardId */
+ 1, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89116,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_3_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96368MBG_LE89316 =
+{
+ VOICECFG_6368MBG_LE89316_STR, /* szBoardId */
+ 1, /* numFxsLines */
+ 1, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89316,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_GPIO_28_AL,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_16_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96368MBG_SI3217X =
+{
+ VOICECFG_6368MBG_SI3217X_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 1, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32176,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_3_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32178,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_GPIO_28_AL,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_16_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 2,
+ 2
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96368MBG_SI32176 =
+{
+ VOICECFG_6368MBG_SI32176_STR, /* szBoardId */
+ 1, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32176,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_3_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96368MBG_SI32178 =
+{
+ VOICECFG_6368MBG_SI32178_STR, /* szBoardId */
+ 1, /* numFxsLines */
+ 1, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32178,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_GPIO_28_AL,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_16_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1},
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96368MBG_LE88276 =
+{
+ VOICECFG_6368MBG_LE88276_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_88276,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_GPIO_28_AL,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_3_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96368MBG_LE88506 =
+{
+ VOICECFG_6368MBG_LE88506_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_88506,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_3_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96368MBG_SI3226 =
+{
+ VOICECFG_6368MBG_SI3226_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_3226,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_GPIO_28_AL,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_3_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96368MVNgr_SI3217X =
+{
+ VOICECFG_6368MVNGR_SI3217X_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 1, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_NOT_DEFINED,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32176,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_16_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32178,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_GPIO_28_AL,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_17_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 2,
+ 2
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96368MVNgr_SI32176 =
+{
+ VOICECFG_6368MVNGR_SI32176_STR, /* szBoardId */
+ 1, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_NOT_DEFINED,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32176,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_16_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96368MVNgr_SI32178 =
+{
+ VOICECFG_6368MVNGR_SI32178_STR, /* szBoardId */
+ 1, /* numFxsLines */
+ 1, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_NOT_DEFINED,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32178,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_GPIO_28_AL,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_17_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96368MVNgr_SI3217X_NOFXO =
+{
+ VOICECFG_6368MVNGR_SI3217X_NOFXO_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_NOT_DEFINED,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32176,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_16_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_32178,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_GPIO_28_AL,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_17_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 2,
+ 2
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96368MVNgr_VE890 =
+{
+ VOICECFG_6368MVNGR_VE890_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 1, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_NOT_DEFINED,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89116,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_16_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89316,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_GPIO_28_AL,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_17_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 2,
+ 2
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96368MVNgr_LE89116 =
+{
+ VOICECFG_6368MVNGR_LE89116_STR, /* szBoardId */
+ 1, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_NOT_DEFINED,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89116,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_16_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96368MVNgr_LE89316 =
+{
+ VOICECFG_6368MVNGR_LE89316_STR, /* szBoardId */
+ 1, /* numFxsLines */
+ 1, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_NOT_DEFINED,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89316,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_GPIO_28_AL,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_17_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96368MVNgr_LE88506 =
+{
+ VOICECFG_6368MVNGR_LE88506_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_NOT_DEFINED,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_88506,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_16_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96368MVNgr_LE88276 =
+{
+ VOICECFG_6368MVNGR_LE88276_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_NOT_DEFINED,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_88276,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_GPIO_28_AL,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_16_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96368MVNgr_SI3226 =
+{
+ VOICECFG_6368MVNGR_SI3226_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_NOT_DEFINED,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_3226,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_GPIO_28_AL,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_16_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96368MVNgr_VE890HV_Partial =
+{
+ VOICECFG_6368MVNGR_VE890HV_PARTIAL_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 1, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_NOT_DEFINED,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89116,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_16_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89336,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_GPIO_28_AL,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 0, /* This setting is specific to Zarlink reference card Le71HR8923G for shared 1 reset line. */
+
+ /* Reset pin */
+ BP_GPIO_16_AL, /* This setting is specific to Zarlink reference card Le71HR8923G for shared 1 reset line. */
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 2,
+ 2
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+VOICE_BOARD_PARMS voiceBoard_96368MVNgr_VE890HV =
+{
+ VOICECFG_6368MVNGR_VE890HV_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 1, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_IDECT1,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_NOT_DEFINED,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID
+ },
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_DECT,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_WIDEBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice1 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89136,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_16_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* There is no second channel on 89116 so mark it as inactive */
+ { BP_VOICE_CHANNEL_INACTIVE,
+ BP_VCTYPE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_TIMESLOT_INVALID,
+ BP_TIMESLOT_INVALID},
+ }
+ },
+
+ /* voiceDevice2 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_89336,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_GPIO_28_AL,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_17_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device 0 */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_DAA,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 2,
+ 2
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+static PVOICE_BOARD_PARMS g_VoiceBoardParms[] =
+{
+ &voiceBoard_96368MVWG,
+ &voiceBoard_96368MBG_LE88276,
+ &voiceBoard_96368MBG_LE88506,
+ &voiceBoard_96368MBG_VE890,
+ &voiceBoard_96368MBG_LE89116,
+ &voiceBoard_96368MBG_LE89316,
+ &voiceBoard_96368MBG_SI3217X,
+ &voiceBoard_96368MBG_SI32176,
+ &voiceBoard_96368MBG_SI32178,
+ &voiceBoard_96368MBG_SI3226,
+ &voiceBoard_96368MVNgr_SI3217X,
+ &voiceBoard_96368MVNgr_SI32176,
+ &voiceBoard_96368MVNgr_SI32178,
+ &voiceBoard_96368MVNgr_SI3217X_NOFXO,
+ &voiceBoard_96368MVNgr_VE890,
+// &voiceBoard_96368MVNgr_LE89116, /* Temporarily remove */
+// &voiceBoard_96368MVNgr_LE89316, /* Temporarily remove */
+ &voiceBoard_96368MVNgr_VE890HV_Partial,
+ &voiceBoard_96368MVNgr_VE890HV,
+ &voiceBoard_96368MVNgr_LE88506,
+ &voiceBoard_96368MVNgr_LE88276,
+ &voiceBoard_96368MVNgr_SI3226,
+ 0
+};
+
+#endif
+
+#if defined(_BCM96816_) || defined(CONFIG_BCM96816)
+
+VOICE_BOARD_PARMS voiceBoard_96816PVWM_LE9530 =
+{
+ VOICECFG_LE9530_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_9530,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 0,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 0,
+
+ /* Reset pin */
+ BP_NOT_DEFINED,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( BP_FLAG_DSP_APMHAL_ENABLE )
+
+};
+
+
+VOICE_BOARD_PARMS voiceBoard_96816PVWM_LE88276 =
+{
+ VOICECFG_LE88276_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_88276,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_GPIO_28_AL,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_14_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+
+VOICE_BOARD_PARMS voiceBoard_96816PVWM_SI3226 =
+{
+ VOICECFG_SI3226_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_SILABS_3226,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 2,
+ /* SPI GPIO */
+ BP_GPIO_28_AL,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_14_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+
+VOICE_BOARD_PARMS voiceBoard_96816PVWM_LE88506 =
+{
+ VOICECFG_LE88506_STR, /* szBoardId */
+ 2, /* numFxsLines */
+ 0, /* numFxoLines */
+ 0, /* numDectLines */
+ 0, /* numFailoverRelayPins */
+
+ {
+ /* voiceDevice0 parameters */
+ {
+ /* Device type */
+ BP_VD_ZARLINK_88506,
+
+ /* SPI control */
+ {
+ /* SPI dev id */
+ 1,
+ /* SPI GPIO */
+ BP_NOT_DEFINED,
+ },
+
+ /* Reset required (1 for yes, 0 for no) */
+ 1,
+
+ /* Reset pin */
+ BP_GPIO_14_AL,
+
+ /* Channel description */
+ {
+ /* Channel 0 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 0,
+ 0
+ },
+ /* Channel 1 on device */
+ { BP_VOICE_CHANNEL_ACTIVE,
+ BP_VCTYPE_SLIC,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ 1,
+ 1
+ },
+ }
+ },
+
+ /* Always end the device list with BP_NULL_DEVICE_MACRO */
+ BP_NULL_DEVICE_MACRO,
+ },
+
+ /* Relay control pins */
+ { { BP_NOT_DEFINED, BP_NOT_DEFINED } },
+
+ /* DECT UART control pins */
+ { BP_NOT_DEFINED, BP_NOT_DEFINED },
+
+ /* General-purpose flags */
+ ( 0 )
+
+};
+
+
+
+static PVOICE_BOARD_PARMS g_VoiceBoardParms[] =
+{ &voiceBoard_96816PVWM_LE88276,
+ &voiceBoard_96816PVWM_SI3226,
+ &voiceBoard_96816PVWM_LE88506,
+ &voiceBoard_96816PVWM_LE9530,
+ 0
+};
+
+#endif
+
+
+static PVOICE_BOARD_PARMS g_pCurrentVoiceBp = 0;
+
+static void bpmemcpy( void* dstptr, const void* srcptr, int size );
+static void bpmemcpy( void* dstptr, const void* srcptr, int size )
+{
+ char* dstp = dstptr;
+ const char* srcp = srcptr;
+ int i;
+ for( i=0; i < size; i++ )
+ {
+ *dstp++ = *srcp++;
+ }
+}
+
+int BpGetVoiceParms( char* pszBoardId, VOICE_BOARD_PARMS* voiceParms )
+{
+ int nRet = BP_BOARD_ID_NOT_FOUND;
+ PVOICE_BOARD_PARMS *ppBp;
+
+ for( ppBp = g_VoiceBoardParms; *ppBp; ppBp++ )
+ {
+ if( !bpstrcmp((*ppBp)->szBoardId, pszBoardId) )
+ {
+ g_pCurrentVoiceBp = *ppBp;
+ bpmemcpy( voiceParms, g_pCurrentVoiceBp, sizeof(VOICE_BOARD_PARMS) );
+ nRet = BP_SUCCESS;
+ break;
+ }
+ }
+
+ return( nRet );
+}
+
+
+/**************************************************************************
+* Name : BpSetVoiceBoardId
+*
+* Description: This function find the BOARD_PARAMETERS structure for the
+* specified board id string and assigns it to a global, static
+* variable.
+*
+* Parameters : [IN] pszBoardId - Board id string that is saved into NVRAM.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+* BP_BOARD_ID_NOT_FOUND - Error, board id input string does not
+* have a board parameters configuration record.
+***************************************************************************/
+int BpSetVoiceBoardId( char *pszBoardId )
+{
+ int nRet = BP_BOARD_ID_NOT_FOUND;
+ PVOICE_BOARD_PARMS *ppBp;
+
+ for( ppBp = g_VoiceBoardParms; *ppBp; ppBp++ )
+ {
+ if( !bpstrcmp((*ppBp)->szBoardId, pszBoardId) )
+ {
+ g_pCurrentVoiceBp = *ppBp;
+ nRet = BP_SUCCESS;
+ break;
+ }
+ }
+
+ return( nRet );
+} /* BpSetVoiceBoardId */
+
+
+/**************************************************************************
+* Name : BpGetVoiceBoardId
+*
+* Description: This function returns the current board id strings.
+*
+* Parameters : [OUT] pszBoardIds - Address of a buffer that the board id
+* string is returned in.
+*
+* Returns : BP_SUCCESS - Success, value is returned.
+***************************************************************************/
+
+int BpGetVoiceBoardId( char *pszBoardId )
+{
+ int i;
+
+ if (g_pCurrentVoiceBp == 0)
+ return -1;
+
+ for (i = 0; i < BP_BOARD_ID_LEN; i++)
+ pszBoardId[i] = g_pCurrentVoiceBp->szBoardId[i];
+
+ return 0;
+}
+
+
+/**************************************************************************
+* Name : BpGetVoiceBoardIds
+*
+* Description: This function returns all of the supported voice board id strings.
+*
+* Parameters : [OUT] pszBoardIds - Address of a buffer that the board id
+* strings are returned in. Each id starts at BP_BOARD_ID_LEN
+* boundary.
+* [IN] nBoardIdsSize - Number of BP_BOARD_ID_LEN elements that
+* were allocated in pszBoardIds.
+*
+* Returns : Number of board id strings returned.
+***************************************************************************/
+int BpGetVoiceBoardIds( char *pszBoardIds, int nBoardIdsSize )
+{
+ PVOICE_BOARD_PARMS *ppBp;
+ int i;
+ char *src;
+ char *dest;
+
+ for( i = 0, ppBp = g_VoiceBoardParms; *ppBp && nBoardIdsSize;
+ i++, ppBp++, nBoardIdsSize--, pszBoardIds += BP_BOARD_ID_LEN )
+ {
+ dest = pszBoardIds;
+ src = (*ppBp)->szBoardId;
+ while( *src )
+ *dest++ = *src++;
+ *dest = '\0';
+ }
+
+ return( i );
+} /* BpGetVoiceBoardIds */
diff --git a/shared/opensource/flash/Makefile b/shared/opensource/flash/Makefile
new file mode 100755
index 0000000..b7a9812
--- /dev/null
+++ b/shared/opensource/flash/Makefile
@@ -0,0 +1,41 @@
+
+ifeq ($(CONFIG_MIPS_BRCM),y)
+
+# Linux
+
+obj-y += flash_api.o flash_common.o
+
+ifeq ($(strip $(BRCM_CHIP)),6368)
+INC_CFI_FLASH_DRIVER=1
+INC_SPI_FLASH_DRIVER=1
+endif
+ifeq ($(strip $(BRCM_CHIP)),6816)
+INC_CFI_FLASH_DRIVER=1
+INC_SPI_FLASH_DRIVER=1
+endif
+ifeq ($(strip $(BRCM_CHIP)),6362)
+INC_CFI_FLASH_DRIVER=0
+INC_SPI_FLASH_DRIVER=1
+endif
+ifeq ($(strip $(BRCM_CHIP)),6328)
+INC_CFI_FLASH_DRIVER=0
+INC_SPI_FLASH_DRIVER=1
+endif
+
+ifeq ($(strip $(INC_CFI_FLASH_DRIVER)),1)
+obj-y += cfiflash.o
+endif
+ifeq ($(strip $(INC_SPI_FLASH_DRIVER)),1)
+obj-y += spiflash.o
+endif
+
+EXTRA_CFLAGS += -DCONFIG_BCM9$(BRCM_CHIP) -I$(INC_BRCMDRIVER_PUB_PATH)/$(BRCM_BOARD) -I$(INC_BRCMSHARED_PUB_PATH)/$(BRCM_BOARD) -DINC_CFI_FLASH_DRIVER=$(INC_CFI_FLASH_DRIVER) -DINC_SPI_FLASH_DRIVER=$(INC_SPI_FLASH_DRIVER)
+
+endif
+
+
+
+
+
+
+
diff --git a/shared/opensource/flash/cfiflash.c b/shared/opensource/flash/cfiflash.c
new file mode 100755
index 0000000..efd08de
--- /dev/null
+++ b/shared/opensource/flash/cfiflash.c
@@ -0,0 +1,1112 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the “GPL?, available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+/** Includes. */
+#ifdef _CFE_
+#include "lib_types.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "cfe_timer.h"
+#include "bcm_map.h"
+#define CFI_USLEEP(x) cfe_usleep(x)
+#define printk printf
+#else // linux
+#include <linux/version.h>
+#include <linux/init.h>
+#include <linux/param.h>
+#include <linux/sched.h>
+#include <linux/timer.h>
+#include <linux/interrupt.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)
+#include <linux/semaphore.h>
+#else
+#include <asm/semaphore.h>
+#endif
+#include <asm/delay.h>
+#include <bcm_map_part.h>
+#define CFI_USLEEP(x) udelay(x)
+#endif
+
+#include "bcmtypes.h"
+#include "bcm_hwdefs.h"
+#include "flash_api.h"
+
+/** Defines. **/
+#ifndef NULL
+#define NULL 0
+#endif
+
+#ifndef _CFE_
+static DECLARE_MUTEX(cfi_flash_lock);
+#define CF_FLASH_SCHED_BYTES 512
+static int cfi_flash_sched = 0; /* voluntary schedule() disabled by default */
+#endif
+
+#define MAXSECTORS 1024 /* maximum number of sectors supported */
+
+/* Standard Boolean declarations */
+#define TRUE 1
+#define FALSE 0
+
+/* Define different type of flash */
+#define FLASH_UNDEFINED 0
+#define FLASH_AMD 1
+#define FLASH_INTEL 2
+#define FLASH_SST 3
+
+/* Command codes for the flash_command routine */
+#define FLASH_RESET 0 /* reset to read mode */
+#define FLASH_READ_ID 1 /* read device ID */
+#define FLASH_CFIQUERY 2 /* CFI query */
+#define FLASH_UB 3 /* go into unlock bypass mode */
+#define FLASH_PROG 4 /* program a unsigned short */
+#define FLASH_UBRESET 5 /* reset to read mode from unlock bypass mode */
+#define FLASH_SERASE 6 /* sector erase */
+#define FLASH_WRITE_BUF 7 /* write to buffer */
+
+/* Return codes from flash_status */
+#define STATUS_READY 0 /* ready for action */
+#define STATUS_TIMEOUT 1 /* operation timed out */
+
+/* A list of AMD compatible device ID's - add others as needed */
+#define ID_AM29DL800T 0x224A
+#define ID_AM29DL800B 0x22CB
+#define ID_AM29LV800T 0x22DA
+#define ID_AM29LV800B 0x225B
+#define ID_AM29LV400B 0x22BA
+#define ID_AM29LV200BT 0x223B
+
+#define ID_AM29LV160B 0x2249
+#define ID_AM29LV160T 0x22C4
+
+#define ID_AM29LV320T 0x22F6
+#define ID_MX29LV320AT 0x22A7
+#define ID_AM29LV320B 0x22F9
+#define ID_MX29LV320AB 0x22A8
+#define ID_MX29LV640BT 0x22C9
+
+#define ID_AM29LV320M 0x227E
+#define ID_AM29LV320MB 0x2200
+#define ID_AM29LV320MT 0x2201
+
+#define ID_SST39VF200A 0x2789
+#define ID_SST39VF400A 0x2780
+#define ID_SST39VF800A 0x2781
+#define ID_SST39VF1601 0x234B
+#define ID_SST39VF3201 0x235B
+#define ID_SST39VF6401 0x236B
+
+/* A list of Intel compatible device ID's - add others as needed */
+#define ID_I28F160C3T 0x88C2
+#define ID_I28F160C3B 0x88C3
+#define ID_I28F320C3T 0x88C4
+#define ID_I28F320C3B 0x88C5
+#define ID_I28F640J3 0x8916
+
+#define ID_M29W640FB 0x22FD
+
+#define CFI_FLASH_DEVICES \
+ {{ID_AM29DL800T, "AM29DL800T"}, \
+ {ID_AM29DL800B, "AM29DL800B"}, \
+ {ID_AM29LV800T, "AM29LV800T"}, \
+ {ID_AM29LV800B, "AM29LV800B"}, \
+ {ID_AM29LV400B, "AM29LV400B"}, \
+ {ID_AM29LV200BT, "AM29LV200BT"}, \
+ {ID_AM29LV160B, "AM29LV160B"}, \
+ {ID_AM29LV160T, "AM29LV160T"}, \
+ {ID_AM29LV320T, "AM29LV320T"}, \
+ {ID_MX29LV320AT, "MX29LV320AT"}, \
+ {ID_AM29LV320B, "AM29LV320B"}, \
+ {ID_MX29LV320AB, "MX29LV320AB"}, \
+ {ID_AM29LV320M, "AM29LV320M"}, \
+ {ID_AM29LV320MB, "AM29LV320MB"}, \
+ {ID_AM29LV320MT, "AM29LV320MT"}, \
+ {ID_MX29LV640BT, "MX29LV640BT"}, \
+ {ID_SST39VF200A, "SST39VF200A"}, \
+ {ID_SST39VF400A, "SST39VF400A"}, \
+ {ID_SST39VF800A, "SST39VF800A"}, \
+ {ID_SST39VF1601, "SST39VF1601"}, \
+ {ID_SST39VF3201, "SST39VF3201"}, \
+ {ID_SST39VF6401, "SST39VF6401"}, \
+ {ID_I28F160C3T, "I28F160C3T"}, \
+ {ID_I28F160C3B, "I28F160C3B"}, \
+ {ID_I28F320C3T, "I28F320C3T"}, \
+ {ID_I28F320C3B, "I28F320C3B"}, \
+ {ID_I28F640J3, "I28F640J3"}, \
+ {ID_M29W640FB, "STM29W640FB"}, \
+ {0, ""} \
+ }
+
+/** Structs. **/
+/* A structure for identifying a flash part. There is one for each
+ * of the flash part definitions. We need to keep track of the
+ * sector organization, the address register used, and the size
+ * of the sectors.
+ */
+struct flashinfo {
+ char *name; /* "Am29DL800T", etc. */
+ unsigned long addr; /* physical address, once translated */
+ int areg; /* Can be set to zero for all parts */
+ int nsect; /* # of sectors -- 19 in LV, 22 in DL */
+ int bank1start; /* first sector # in bank 1 */
+ int bank2start; /* first sector # in bank 2, if DL part */
+ struct {
+ long size; /* # of bytes in this sector */
+ long base; /* offset from beginning of device */
+ int bank; /* 1 or 2 for DL; 1 for LV */
+ } sec[MAXSECTORS]; /* per-sector info */
+ int write_buffer_size; /* max size of multi byte write */
+};
+
+/*
+ * This structure holds all CFI query information as defined
+ * in the JEDEC standard. All information up to
+ * primary_extended_query is standard among all manufactures
+ * with CFI enabled devices.
+ */
+
+struct cfi_query {
+ int num_erase_blocks; /* Number of sector defs. */
+ long device_size; /* Device size in bytes */
+ struct {
+ unsigned long sector_size; /* byte size of sector */
+ int num_sectors; /* Num sectors of this size */
+ } erase_block[8]; /* Max of 256, but 8 is good */
+ int write_buffer_size; /* max size of multi byte write */
+};
+
+struct flash_name_from_id {
+ unsigned short fnfi_id;
+ char fnfi_name[30];
+};
+
+
+/** Prototypes. **/
+int cfi_flash_init(flash_device_info_t **flash_info);
+static int cfi_flash_sector_erase_int(unsigned short sector);
+static int cfi_flash_read_buf(unsigned short sector, int offset,
+ unsigned char *buffer, int numbytes);
+static int cfi_flash_write_buf(unsigned short sector, int offset,
+ unsigned char *buffer, int numbytes);
+static int cfi_flash_get_numsectors(void);
+static int cfi_flash_get_sector_size(unsigned short sector);
+static unsigned char *cfi_flash_get_memptr(unsigned short sector);
+static int cfi_flash_get_blk(int addr);
+static int cfi_flash_get_total_size(void);
+static void cfi_flash_command(int command, unsigned short sector, int offset,
+ unsigned short data, unsigned short *);
+static int cfi_flash_write(unsigned short sector, int offset, unsigned char *buf,
+ int nbytes);
+static int cfi_flash_write_to_buffer(unsigned short sector, unsigned char *buf);
+static int cfi_flash_wait(unsigned short sector, int offset,unsigned short data);
+static unsigned short cfi_flash_get_device_id(void);
+static int cfi_flash_get_cfi(struct cfi_query *query, unsigned short *cfi_struct,
+ int flashFamily);
+static int cfi_memcmp_sched(unsigned char *s1, unsigned char *s2, int nbytes);
+
+/** Variables. **/
+static flash_device_info_t flash_cfi_dev =
+ {
+ 0xffff,
+ FLASH_IFC_PARALLEL,
+ "",
+ cfi_flash_sector_erase_int,
+ cfi_flash_read_buf,
+ cfi_flash_write_buf,
+ cfi_flash_get_numsectors,
+ cfi_flash_get_sector_size,
+ cfi_flash_get_memptr,
+ cfi_flash_get_blk,
+ cfi_flash_get_total_size
+ };
+
+/*********************************************************************/
+/* 'meminfo' should be a pointer, but most C compilers will not */
+/* allocate static storage for a pointer without calling */
+/* non-portable functions such as 'new'. We also want to avoid */
+/* the overhead of passing this pointer for every driver call. */
+/* Systems with limited heap space will need to do this. */
+/*********************************************************************/
+static struct flashinfo meminfo; /* Flash information structure */
+static int flashFamily = FLASH_UNDEFINED;
+static int totalSize = 0;
+static struct cfi_query query;
+
+static unsigned short cfi_data_struct_29W160[] = {
+ 0x0020, 0x0049, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+ 0x0051, 0x0052, 0x0059, 0x0002, 0x0000, 0x0040, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0027, 0x0036, 0x0000, 0x0000, 0x0004,
+ 0x0000, 0x000a, 0x0000, 0x0004, 0x0000, 0x0003, 0x0000, 0x0015,
+ 0x0002, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, 0x0000, 0x0040,
+ 0x0000, 0x0001, 0x0000, 0x0020, 0x0000, 0x0000, 0x0000, 0x0080,
+ 0x0000, 0x001e, 0x0000, 0x0000, 0x0001, 0xffff, 0xffff, 0xffff,
+ 0x0050, 0x0052, 0x0049, 0x0031, 0x0030, 0x0000, 0x0002, 0x0001,
+ 0x0001, 0x0004, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0x0002,
+ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+ 0xffff, 0x0888, 0x252b, 0x8c84, 0x7dbc, 0xffff, 0xffff, 0xffff,
+ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff
+};
+
+static UINT16 cfi_data_struct_29W200[] = {
+ 0x0020, 0x0049, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+ 0x0051, 0x0052, 0x0059, 0x0002, 0x0000, 0x0040, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0027, 0x0036, 0x0000, 0x0000, 0x0004,
+ 0x0000, 0x000a, 0x0000, 0x0004, 0x0000, 0x0003, 0x0000, 0x0015,
+ 0x0002, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, 0x0000, 0x0040,
+ 0x0000, 0x0001, 0x0000, 0x0020, 0x0000, 0x0000, 0x0000, 0x0080,
+ 0x0000, 0x0002, 0x0000, 0x0000, 0x0001, 0xffff, 0xffff, 0xffff,
+ 0x0050, 0x0052, 0x0049, 0x0031, 0x0030, 0x0000, 0x0002, 0x0001,
+ 0x0001, 0x0004, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0x0002,
+ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+ 0xffff, 0x0888, 0x252b, 0x8c84, 0x7dbc, 0xffff, 0xffff, 0xffff,
+ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff
+};
+
+static UINT16 cfi_data_struct_26LV800B[] = {
+ 0x0020, 0x0049, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+ 0x0051, 0x0052, 0x0059, 0x0002, 0x0000, 0x0040, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0027, 0x0036, 0x0000, 0x0000, 0x0004,
+ 0x0000, 0x000a, 0x0000, 0x0004, 0x0000, 0x0003, 0x0000, 0x0015,
+ 0x0002, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, 0x0000, 0x0040,
+ 0x0000, 0x0001, 0x0000, 0x0020, 0x0000, 0x0000, 0x0000, 0x0080,
+ 0x0000, 0x000e, 0x0000, 0x0000, 0x0001, 0xffff, 0xffff, 0xffff,
+ 0x0050, 0x0052, 0x0049, 0x0031, 0x0030, 0x0000, 0x0002, 0x0001,
+ 0x0001, 0x0004, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0x0002,
+ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+ 0xffff, 0x0888, 0x252b, 0x8c84, 0x7dbc, 0xffff, 0xffff, 0xffff,
+ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff
+};
+
+static struct flash_name_from_id fnfi[] = CFI_FLASH_DEVICES;
+
+/*********************************************************************/
+/* Init_flash is used to build a sector table from the information */
+/* provided through the CFI query. This information is translated */
+/* from erase_block information to base:offset information for each */
+/* individual sector. This information is then stored in the meminfo */
+/* structure, and used throughout the driver to access sector */
+/* information. */
+/* */
+/* This is more efficient than deriving the sector base:offset */
+/* information every time the memory map switches (since on the */
+/* development platform can only map 64k at a time). If the entire */
+/* flash memory array can be mapped in, then the addition static */
+/* allocation for the meminfo structure can be eliminated, but the */
+/* drivers will have to be re-written. */
+/* */
+/* The meminfo struct occupies 653 bytes of heap space, depending */
+/* on the value of the define MAXSECTORS. Adjust to suit */
+/* application */
+/*********************************************************************/
+int cfi_flash_init(flash_device_info_t **flash_info)
+{
+ struct flash_name_from_id *fnfi_ptr;
+ int i=0, j=0, count=0;
+ int basecount=0L;
+ unsigned short device_id;
+ int flipCFIGeometry = FALSE;
+
+ *flash_info = &flash_cfi_dev;
+
+ /* First, assume
+ * a single 8k sector for sector 0. This is to allow
+ * the system to perform memory mapping to the device,
+ * even though the actual physical layout is unknown.
+ * Once mapped in, the CFI query will produce all
+ * relevant information.
+ */
+ meminfo.addr = 0L;
+ meminfo.areg = 0;
+ meminfo.nsect = 1;
+ meminfo.bank1start = 0;
+ meminfo.bank2start = 0;
+
+ meminfo.sec[0].size = 8192;
+ meminfo.sec[0].base = 0x00000;
+ meminfo.sec[0].bank = 1;
+
+ cfi_flash_command(FLASH_RESET, 0, 0, 0, NULL);
+
+ flash_cfi_dev.flash_device_id = device_id = cfi_flash_get_device_id();
+ flash_cfi_dev.flash_device_name[0] = '\0';
+ switch (device_id) {
+ case ID_I28F160C3B:
+ case ID_I28F320C3B:
+ case ID_I28F160C3T:
+ case ID_I28F320C3T:
+ case ID_I28F640J3:
+ flashFamily = FLASH_INTEL;
+ break;
+ case ID_AM29DL800B:
+ case ID_AM29LV800B:
+ case ID_AM29LV400B:
+ case ID_AM29LV160B:
+ case ID_AM29LV320B:
+ case ID_MX29LV320AB:
+ case ID_AM29LV320MB:
+ case ID_AM29DL800T:
+ case ID_AM29LV800T:
+ case ID_AM29LV160T:
+ case ID_AM29LV320T:
+ case ID_MX29LV320AT:
+ case ID_AM29LV320MT:
+ case ID_AM29LV200BT:
+ case ID_MX29LV640BT:
+ case ID_M29W640FB:
+ flashFamily = FLASH_AMD;
+ break;
+ case ID_SST39VF200A:
+ case ID_SST39VF400A:
+ case ID_SST39VF800A:
+ case ID_SST39VF1601:
+ case ID_SST39VF3201:
+ case ID_SST39VF6401:
+ flashFamily = FLASH_SST;
+ break;
+ default:
+ return FLASH_API_ERROR;
+ }
+
+ if (cfi_flash_get_cfi(&query, 0, flashFamily) == -1) {
+ switch(device_id) {
+ case ID_AM29LV160T:
+ case ID_AM29LV160B:
+ cfi_flash_get_cfi(&query, cfi_data_struct_29W160, flashFamily);
+ break;
+ case ID_AM29LV200BT:
+ cfi_flash_get_cfi(&query, cfi_data_struct_29W200, flashFamily);
+ break;
+ case ID_AM29LV800B:
+ cfi_flash_get_cfi(&query, cfi_data_struct_26LV800B, flashFamily);
+ strcpy( flash_cfi_dev.flash_device_name, "MX26LV800B" );
+ break;
+ default:
+ return FLASH_API_ERROR;
+ }
+ }
+
+ // need to determine if it top or bottom boot here
+ switch (device_id)
+ {
+ case ID_AM29DL800B:
+ case ID_AM29LV800B:
+ case ID_AM29LV400B:
+ case ID_AM29LV160B:
+ case ID_AM29LV320B:
+ case ID_MX29LV320AB:
+ case ID_AM29LV320MB:
+ case ID_I28F160C3B:
+ case ID_I28F320C3B:
+ case ID_I28F640J3:
+ case ID_I28F160C3T:
+ case ID_I28F320C3T:
+ case ID_SST39VF3201:
+ case ID_SST39VF6401:
+ case ID_SST39VF200A:
+ case ID_SST39VF400A:
+ case ID_SST39VF800A:
+ case ID_M29W640FB:
+ flipCFIGeometry = FALSE;
+ break;
+ case ID_AM29DL800T:
+ case ID_AM29LV800T:
+ case ID_AM29LV160T:
+ case ID_AM29LV320T:
+ case ID_MX29LV320AT:
+ case ID_AM29LV320MT:
+ case ID_AM29LV200BT:
+ case ID_SST39VF1601:
+ case ID_MX29LV640BT:
+ flipCFIGeometry = TRUE;
+ break;
+ default:
+ return FLASH_API_ERROR;
+ }
+
+ count=0;basecount=0L;
+
+ if (!flipCFIGeometry)
+ {
+
+ for (i=0; i<query.num_erase_blocks && basecount < query.device_size; i++) {
+ for(j=0; j<query.erase_block[i].num_sectors; j++) {
+ meminfo.sec[count].size = (int) query.erase_block[i].sector_size;
+ meminfo.sec[count].base = (int) basecount;
+ basecount += (int) query.erase_block[i].sector_size;
+ count++;
+ }
+ }
+ }
+ else
+ {
+ for (i = (query.num_erase_blocks - 1); i >= 0 && basecount < query.device_size; i--) {
+ for(j=0; j<query.erase_block[i].num_sectors; j++) {
+ meminfo.sec[count].size = (int) query.erase_block[i].sector_size;
+ meminfo.sec[count].base = (int) basecount;
+ basecount += (int) query.erase_block[i].sector_size;
+ count++;
+ }
+ }
+ }
+
+ meminfo.nsect = count;
+ totalSize = meminfo.sec[count-1].base + meminfo.sec[count-1].size;
+
+ if( flash_cfi_dev.flash_device_name[0] == '\0' ) {
+ for( fnfi_ptr = fnfi; fnfi_ptr->fnfi_id != 0; fnfi_ptr++ ) {
+ if( fnfi_ptr->fnfi_id == device_id ) {
+ strcpy( flash_cfi_dev.flash_device_name, fnfi_ptr->fnfi_name );
+ break;
+ }
+ }
+ }
+
+ meminfo.write_buffer_size = query.write_buffer_size;
+
+ return (FLASH_API_OK);
+}
+
+/*********************************************************************/
+/* Flash_sector_erase_int() is identical to flash_sector_erase(), */
+/* except it will wait until the erase is completed before returning */
+/* control to the calling function. This can be used in cases which */
+/* require the program to hold until a sector is erased, without */
+/* adding the wait check external to this function. */
+/*********************************************************************/
+static int cfi_flash_sector_erase_int(unsigned short sector)
+{
+ int i;
+
+#ifndef _CFE_
+ down(&cfi_flash_lock);
+#endif
+
+ for( i = 0; i < 3; i++ ) {
+ cfi_flash_command(FLASH_SERASE, sector, 0, 0, NULL);
+ if (cfi_flash_wait(sector, 0, 0xffff) == STATUS_READY)
+ break;
+ }
+
+#ifndef _CFE_
+ up(&cfi_flash_lock);
+#endif
+
+ return(FLASH_API_OK);
+}
+
+/*********************************************************************/
+/* flash_read_buf() reads buffer of data from the specified */
+/* offset from the sector parameter. */
+/*********************************************************************/
+static int cfi_flash_read_buf(unsigned short sector, int offset,
+ unsigned char *buffer, int numbytes)
+{
+ unsigned char *fwp;
+#ifndef _CFE_
+ unsigned int bytes_read = CF_FLASH_SCHED_BYTES;
+
+ down(&cfi_flash_lock);
+#endif
+
+ fwp = (unsigned char *) cfi_flash_get_memptr(sector);
+
+ while (numbytes) {
+ *buffer++ = *(fwp + offset);
+ numbytes--;
+ fwp++;
+#ifndef _CFE_
+ if (!in_interrupt()) {
+ /* Voluntary schedule() if task tagged as need_sched or 512 bytes read */
+ /* Must force need_resched or else schedule() is in-effective */
+ if ( cfi_flash_sched ) {
+ if ( (need_resched()) || (bytes_read >= CF_FLASH_SCHED_BYTES) ) {
+ bytes_read=0;
+ set_tsk_need_resched(current); /* fake need_resched() to force schedule() */
+ schedule();
+ }
+ else
+ bytes_read++;
+ }
+ }
+#endif
+ }
+
+#ifndef _CFE_
+ up(&cfi_flash_lock);
+#endif
+
+ return (FLASH_API_OK);
+}
+
+/*********************************************************************/
+/* cfi_memcmp_sched: invokes memcmp with schedule() invocations */
+/*********************************************************************/
+static int cfi_memcmp_sched(unsigned char *s1, unsigned char *s2, int nb)
+{
+#ifndef _CFE_
+ const unsigned int sched_chunk = 4 * 1024;
+ size_t nbytes;
+ int ret = 0;
+
+ while ( nb > 0 )
+ {
+ if (!in_interrupt()) {
+ set_tsk_need_resched(current);
+ schedule();
+ }
+
+ nbytes = (nb > sched_chunk) ? sched_chunk : nb;
+
+ if ( (ret = memcmp( s1, s2, nbytes )) != 0 )
+ break;
+
+ s1 += sched_chunk;
+ s2 += sched_chunk;
+ nb -= sched_chunk;
+ }
+
+ return ret;
+#else
+ return memcmp( s1, s2, nb );
+#endif
+}
+
+/*********************************************************************/
+/* flash_write_buf() utilizes */
+/* the unlock bypass mode of the flash device. This can remove */
+/* significant overhead from the bulk programming operation, and */
+/* when programming bulk data a sizeable performance increase can be */
+/* observed. */
+/*********************************************************************/
+static int cfi_flash_write_buf(unsigned short sector, int offset,
+ unsigned char *buffer, int numbytes)
+{
+ int ret = FLASH_API_ERROR;
+ int i;
+ unsigned char *p = cfi_flash_get_memptr(sector) + offset;
+ int write_buf_method = 0;
+
+ if( meminfo.write_buffer_size != 0 && offset == 0 &&
+ (ID_M29W640FB != cfi_flash_get_device_id()) &&
+ numbytes == cfi_flash_get_sector_size(sector) )
+ {
+ write_buf_method = 1;
+ }
+
+ /* After writing the flash block, compare the contents to the source
+ * buffer. Try to write the sector successfully up to three times.
+ */
+ for( i = 0; i < 3; i++ ) {
+ if( write_buf_method )
+ ret = cfi_flash_write_to_buffer(sector, buffer);
+ else
+ ret = cfi_flash_write(sector, offset, buffer, numbytes);
+ if( !cfi_memcmp_sched( p, buffer, numbytes ) )
+ break;
+ /* Erase and try again */
+ cfi_flash_sector_erase_int(sector);
+ ret = FLASH_API_ERROR;
+ }
+
+ if( ret == FLASH_API_ERROR )
+ printk( "Flash write error. Verify failed\n" );
+
+ return( ret );
+}
+
+/*********************************************************************/
+/* Usefull funtion to return the number of sectors in the device. */
+/* Can be used for functions which need to loop among all the */
+/* sectors, or wish to know the number of the last sector. */
+/*********************************************************************/
+static int cfi_flash_get_numsectors(void)
+{
+ return meminfo.nsect;
+}
+
+/*********************************************************************/
+/* flash_get_sector_size() is provided for cases in which the size */
+/* of a sector is required by a host application. The sector size */
+/* (in bytes) is returned in the data location pointed to by the */
+/* 'size' parameter. */
+/*********************************************************************/
+static int cfi_flash_get_sector_size(unsigned short sector)
+{
+ return meminfo.sec[sector].size;
+}
+
+/*********************************************************************/
+/* The purpose of flash_get_memptr() is to return a memory pointer */
+/* which points to the beginning of memory space allocated for the */
+/* flash. All function pointers are then referenced from this */
+/* pointer. */
+/* */
+/* Different systems will implement this in different ways: */
+/* possibilities include: */
+/* - A direct memory pointer */
+/* - A pointer to a memory map */
+/* - A pointer to a hardware port from which the linear */
+/* address is translated */
+/* - Output of an MMU function / service */
+/* */
+/* Also note that this function expects the pointer to a specific */
+/* sector of the device. This can be provided by dereferencing */
+/* the pointer from a translated offset of the sector from a */
+/* global base pointer (e.g. flashptr = base_pointer + sector_offset)*/
+/* */
+/* Important: Many AMD flash devices need both bank and or sector */
+/* address bits to be correctly set (bank address bits are A18-A16, */
+/* and sector address bits are A18-A12, or A12-A15). Flash parts */
+/* which do not need these bits will ignore them, so it is safe to */
+/* assume that every part will require these bits to be set. */
+/*********************************************************************/
+static unsigned char *cfi_flash_get_memptr(unsigned short sector)
+{
+ unsigned char *memptr = (unsigned char*)
+ (FLASH_BASE + meminfo.sec[sector].base);
+
+ return (memptr);
+}
+
+/*********************************************************************/
+/* The purpose of flash_get_blk() is to return a the block number */
+/* for a given memory address. */
+/*********************************************************************/
+static int cfi_flash_get_blk(int addr)
+{
+ int blk_start, i;
+ int last_blk = cfi_flash_get_numsectors();
+ int relative_addr = addr - (int) FLASH_BASE;
+
+ for(blk_start=0, i=0; i < relative_addr && blk_start < last_blk; blk_start++)
+ i += cfi_flash_get_sector_size(blk_start);
+
+ if( i > relative_addr )
+ {
+ blk_start--; // last blk, dec by 1
+ }
+ else
+ if( blk_start == last_blk )
+ {
+ printk("Address is too big.\n");
+ blk_start = -1;
+ }
+
+ return( blk_start );
+}
+
+/************************************************************************/
+/* The purpose of flash_get_total_size() is to return the total size of */
+/* the flash */
+/************************************************************************/
+static int cfi_flash_get_total_size(void)
+{
+ return totalSize;
+}
+
+/*********************************************************************/
+/* Flash_command() is the main driver function. It performs */
+/* every possible command available to AMD B revision */
+/* flash parts. Note that this command is not used directly, but */
+/* rather called through the API wrapper functions provided below. */
+/*********************************************************************/
+static void cfi_flash_command(int command, unsigned short sector, int offset,
+ unsigned short data, unsigned short *dataptr)
+{
+ volatile unsigned short *flashptr;
+ volatile unsigned short *flashbase;
+ unsigned short i, len;
+
+ flashptr = (unsigned short *) cfi_flash_get_memptr(sector);
+ flashbase = (unsigned short *) cfi_flash_get_memptr(0);
+
+ switch (flashFamily) {
+ case FLASH_UNDEFINED:
+ /* These commands should work for AMD, Intel and SST flashes */
+ switch (command) {
+ case FLASH_RESET:
+ flashptr[0] = 0xF0;
+ flashptr[0] = 0xFF;
+ break;
+ case FLASH_READ_ID:
+ flashptr[0x5555] = 0xAA; /* unlock 1 */
+ flashptr[0x2AAA] = 0x55; /* unlock 2 */
+ flashptr[0x5555] = 0x90;
+ break;
+ case FLASH_CFIQUERY:
+ flashbase[0x5555] = 0xAA; /* unlock 1 */
+ flashbase[0x2AAA] = 0x55; /* unlock 2 */
+ flashbase[0x5555] = 0x90;
+ break;
+ default:
+ break;
+ }
+ break;
+ case FLASH_AMD:
+ switch (command) {
+ case FLASH_RESET:
+ flashptr[0] = 0xF0;
+ break;
+ case FLASH_READ_ID:
+ flashptr[0x555] = 0xAA; /* unlock 1 */
+ flashptr[0x2AA] = 0x55; /* unlock 2 */
+ flashptr[0x555] = 0x90;
+ break;
+ case FLASH_CFIQUERY:
+ flashptr[0x55] = 0x98;
+ break;
+ case FLASH_UB:
+ flashptr[0x555] = 0xAA; /* unlock 1 */
+ flashptr[0x2AA] = 0x55; /* unlock 2 */
+ flashptr[0x555] = 0x20;
+ break;
+ case FLASH_PROG:
+ flashptr[0] = 0xA0;
+ flashptr[offset/2] = data;
+ break;
+ case FLASH_UBRESET:
+ flashptr[0] = 0x90;
+ flashptr[0] = 0x00;
+ break;
+ case FLASH_SERASE:
+ flashptr[0x555] = 0xAA; /* unlock 1 */
+ flashptr[0x2AA] = 0x55; /* unlock 2 */
+ flashptr[0x555] = 0x80;
+ flashptr[0x555] = 0xAA;
+ flashptr[0x2AA] = 0x55;
+ flashptr[0] = 0x30;
+ break;
+ case FLASH_WRITE_BUF:
+ flashptr[0x555] = 0xAA; /* unlock 1 */
+ flashptr[0x2AA] = 0x55; /* unlock 2 */
+ flashptr[0] = 0x25;
+ offset /= 2;
+ len = data / 2; /* data is bytes to program */
+ flashptr[0] = len - 1;
+ for( i = 0; i < len; i++ )
+ flashptr[offset + i] = *dataptr++;
+ flashptr[0] = 0x29;
+ break;
+ default:
+ break;
+ }
+ break;
+ case FLASH_INTEL:
+ switch (command) {
+ case FLASH_RESET:
+ flashptr[0] = 0xFF;
+ break;
+ case FLASH_READ_ID:
+ flashptr[0] = 0x90;
+ break;
+ case FLASH_CFIQUERY:
+ flashptr[0] = 0x98;
+ break;
+ case FLASH_PROG:
+ flashptr[0] = 0x40;
+ flashptr[offset/2] = data;
+ break;
+ case FLASH_SERASE:
+ flashptr[0] = 0x60;
+ flashptr[0] = 0xD0;
+ flashptr[0] = 0x20;
+ flashptr[0] = 0xD0;
+ break;
+ default:
+ break;
+ }
+ break;
+ case FLASH_SST:
+ switch (command) {
+ case FLASH_RESET:
+ flashbase[0x5555] = 0xAA; /* unlock 1 */
+ flashbase[0x2AAA] = 0x55; /* unlock 2 */
+ flashbase[0x5555] = 0xf0;
+ break;
+ case FLASH_READ_ID:
+ flashbase[0x5555] = 0xAA; /* unlock 1 */
+ flashbase[0x2AAA] = 0x55; /* unlock 2 */
+ flashbase[0x5555] = 0x90;
+ break;
+ case FLASH_CFIQUERY:
+ flashbase[0x5555] = 0xAA; /* unlock 1 */
+ flashbase[0x2AAA] = 0x55; /* unlock 2 */
+ flashbase[0x5555] = 0x98;
+ break;
+ case FLASH_UB:
+ break;
+ case FLASH_PROG:
+ flashbase[0x5555] = 0xAA; /* unlock 1 */
+ flashbase[0x2AAA] = 0x55; /* unlock 2 */
+ flashbase[0x5555] = 0xa0;
+ flashptr[offset/2] = data;
+ break;
+ case FLASH_UBRESET:
+ break;
+ case FLASH_SERASE:
+ flashbase[0x5555] = 0xAA; /* unlock 1 */
+ flashbase[0x2AAA] = 0x55; /* unlock 2 */
+ flashbase[0x5555] = 0x80;
+ flashbase[0x5555] = 0xAA;
+ flashbase[0x2AAA] = 0x55;
+ flashptr[0] = 0x30;
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+/*********************************************************************/
+/* flash_write extends the functionality of flash_program() by */
+/* providing an faster way to program multiple data words, without */
+/* needing the function overhead of looping algorithms which */
+/* program word by word. This function utilizes fast pointers */
+/* to quickly loop through bulk data. */
+/*********************************************************************/
+static int cfi_flash_write(unsigned short sector, int offset, unsigned char *buf,
+ int nbytes)
+{
+ unsigned short *src;
+ src = (unsigned short *)buf;
+
+#ifndef _CFE_
+ down(&cfi_flash_lock);
+#endif
+
+ if ((nbytes | offset) & 1) {
+#ifndef _CFE_
+ up(&cfi_flash_lock);
+#endif
+ return FLASH_API_ERROR;
+ }
+
+ cfi_flash_command(FLASH_UB, 0, 0, 0, NULL);
+ while (nbytes > 0) {
+ cfi_flash_command(FLASH_PROG, sector, offset, *src, NULL);
+ if (cfi_flash_wait(sector, offset, *src) != STATUS_READY)
+ break;
+ offset +=2;
+ nbytes -=2;
+ src++;
+ }
+ cfi_flash_command(FLASH_UBRESET, 0, 0, 0, NULL);
+
+#ifndef _CFE_
+ up(&cfi_flash_lock);
+#endif
+
+ return (unsigned char*)src - buf;
+}
+
+/*********************************************************************/
+/* flash_write_to_buffer */
+/*********************************************************************/
+static int cfi_flash_write_to_buffer(unsigned short sector, unsigned char *buf)
+{
+ int nbytes = cfi_flash_get_sector_size(sector);
+ int offset;
+
+#ifndef _CFE_
+ down(&cfi_flash_lock);
+#endif
+
+ for( offset = 0; offset < nbytes; offset += meminfo.write_buffer_size ) {
+ cfi_flash_command(FLASH_WRITE_BUF, sector, offset, (unsigned short)
+ meminfo.write_buffer_size, (unsigned short *) &buf[offset]);
+ if (cfi_flash_wait(sector, 0, 0) != STATUS_READY)
+ break;
+ }
+
+#ifndef _CFE_
+ up(&cfi_flash_lock);
+#endif
+
+ return offset;
+}
+
+/*********************************************************************/
+/* flash_wait utilizes the DQ6, DQ5, and DQ2 polling algorithms */
+/* described in the flash data book. It can quickly ascertain the */
+/* operational status of the flash device, and return an */
+/* appropriate status code (defined in flash.h) */
+/*********************************************************************/
+static int cfi_flash_wait(unsigned short sector, int offset, unsigned short data)
+{
+ volatile unsigned short *flashptr; /* flash window */
+ unsigned short d1;
+
+ flashptr = (unsigned short *) cfi_flash_get_memptr(sector);
+
+ if (flashFamily == FLASH_AMD || flashFamily == FLASH_SST) {
+ do {
+#ifndef _CFE_
+ if (!in_interrupt()) {
+ set_tsk_need_resched(current); /* fake need_resched() to force schedule() */
+ schedule();
+ }
+#endif
+ d1 = *flashptr; /* read data */
+ d1 ^= *flashptr; /* read it again and see what toggled */
+ if (d1 == 0) /* no toggles, nothing's happening */
+ return STATUS_READY;
+ } while (!(d1 & 0x20));
+
+ d1 = *flashptr; /* read data */
+ d1 ^= *flashptr; /* read it again and see what toggled */
+
+ if (d1 != 0) {
+ cfi_flash_command(FLASH_RESET, 0, 0, 0, NULL);
+ return STATUS_TIMEOUT;
+ }
+ } else if (flashFamily == FLASH_INTEL) {
+ flashptr[0] = 0x70;
+ /* Wait for completion */
+
+ do {
+#ifndef _CFE_
+ if (!in_interrupt()) {
+ set_tsk_need_resched(current); /* fake need_resched() to force schedule() */
+ schedule();
+ }
+#endif
+ } while (!(*flashptr & 0x80));
+ if (*flashptr & 0x30) {
+ flashptr[0] = 0x50;
+ cfi_flash_command(FLASH_RESET, 0, 0, 0, NULL);
+ return STATUS_TIMEOUT;
+ }
+ flashptr[0] = 0x50;
+ cfi_flash_command(FLASH_RESET, 0, 0, 0, NULL);
+ }
+
+ return STATUS_READY;
+}
+
+/*********************************************************************/
+/* flash_get_device_id() will perform an autoselect sequence on the */
+/* flash device, and return the device id of the component. */
+/* This function automatically resets to read mode. */
+/*********************************************************************/
+static unsigned short cfi_flash_get_device_id(void)
+{
+ volatile unsigned short *fwp; /* flash window */
+ unsigned short answer;
+
+ fwp = (unsigned short *) cfi_flash_get_memptr(0);
+
+ cfi_flash_command(FLASH_READ_ID, 0, 0, 0, NULL);
+ answer = *(fwp + 1);
+ if (answer == ID_AM29LV320M) {
+ answer = *(fwp + 0xe);
+ answer = *(fwp + 0xf);
+ }
+
+ cfi_flash_command(FLASH_RESET, 0, 0, 0, NULL);
+ return( (unsigned short) answer );
+}
+
+/*********************************************************************/
+/* flash_get_cfi() is the main CFI workhorse function. Due to it's */
+/* complexity and size it need only be called once upon */
+/* initializing the flash system. Once it is called, all operations */
+/* are performed by looking at the meminfo structure. */
+/* All possible care was made to make this algorithm as efficient as */
+/* possible. 90% of all operations are memory reads, and all */
+/* calculations are done using bit-shifts when possible */
+/*********************************************************************/
+static int cfi_flash_get_cfi(struct cfi_query *query, unsigned short *cfi_struct,
+ int flashFamily)
+{
+ volatile unsigned short *fwp; /* flash window */
+ int i=0, temp=0;
+
+ cfi_flash_command(FLASH_CFIQUERY, 0, 0, 0, NULL);
+
+ if (cfi_struct == 0)
+ fwp = (unsigned short *) cfi_flash_get_memptr(0);
+ else
+ fwp = cfi_struct;
+
+ /* Initial house-cleaning */
+ for(i=0; i < 8; i++) {
+ query->erase_block[i].sector_size = 0;
+ query->erase_block[i].num_sectors = 0;
+ }
+
+ /* If not 'QRY', then we dont have a CFI enabled device in the socket */
+ if( fwp[0x10] != 'Q' &&
+ fwp[0x11] != 'R' &&
+ fwp[0x12] != 'Y') {
+ cfi_flash_command(FLASH_RESET, 0, 0, 0, NULL);
+ return(FLASH_API_ERROR);
+ }
+
+ temp = fwp[0x27];
+ query->device_size = (int) (((int)1) << temp);
+
+ query->num_erase_blocks = fwp[0x2C];
+ if(flashFamily == FLASH_SST)
+ query->num_erase_blocks = 1;
+
+ for(i=0; i < query->num_erase_blocks; i++) {
+ query->erase_block[i].num_sectors =
+ fwp[(0x2D+(4*i))] + (fwp[0x2E + (4*i)] << 8);
+ query->erase_block[i].num_sectors++;
+ query->erase_block[i].sector_size =
+ 256 * (256 * fwp[(0x30+(4*i))] + fwp[(0x2F+(4*i))]);
+ }
+
+ /* TBD. Add support for other flash families. */
+ if(flashFamily == FLASH_AMD)
+ query->write_buffer_size = (1 << fwp[0x2a]);
+ else
+ query->write_buffer_size = 0;
+
+ cfi_flash_command(FLASH_RESET, 0, 0, 0, NULL);
+ return(FLASH_API_OK);
+}
+
+#ifndef _CFE_
+static int __init cfi_flash_sched_init(void) {
+ cfi_flash_sched = 1; /* voluntary schedule() enabled */
+ return 0;
+}
+late_initcall(cfi_flash_sched_init);
+#endif
diff --git a/shared/opensource/flash/flash_api.c b/shared/opensource/flash/flash_api.c
new file mode 100755
index 0000000..5b0ca76
--- /dev/null
+++ b/shared/opensource/flash/flash_api.c
@@ -0,0 +1,350 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the “GPL?, available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+/***************************************************************************
+ * File Name : flash_api.c
+ *
+ * Description: This file contains the implementation of the wrapper functions
+ * for the flash device interface.
+ ***************************************************************************/
+
+/** Includes. */
+#ifdef _CFE_
+#include "lib_types.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "bcm_map.h"
+#define printk printf
+#else // Linux
+#include <linux/kernel.h>
+#include "bcm_map_part.h"
+#endif
+
+#include "bcmtypes.h"
+#include "bcm_hwdefs.h"
+#include "flash_api.h"
+
+/** Externs. **/
+#if !defined(INC_CFI_FLASH_DRIVER)
+#define INC_CFI_FLASH_DRIVER 0
+#endif
+
+#if !defined(INC_SPI_FLASH_DRIVER)
+#define INC_SPI_FLASH_DRIVER 0
+#endif
+
+#if !defined(INC_NAND_FLASH_DRIVER)
+#define INC_NAND_FLASH_DRIVER 0
+#endif
+
+#if !defined(INC_SPI_PROG_NAND)
+#define INC_SPI_PROG_NAND 0
+#endif
+
+#if (INC_CFI_FLASH_DRIVER==1)
+extern int cfi_flash_init(flash_device_info_t **flash_info);
+#else
+#define cfi_flash_init(x) FLASH_API_ERROR
+#endif
+
+#if (INC_SPI_FLASH_DRIVER==1)
+extern int spi_flash_init(flash_device_info_t **flash_info);
+#else
+#define spi_flash_init(x) FLASH_API_ERROR
+#endif
+
+#if (INC_NAND_FLASH_DRIVER==1) || (INC_SPI_PROG_NAND==1)
+extern int nand_flash_init(flash_device_info_t **flash_info);
+#else
+#define nand_flash_init(x) FLASH_API_ERROR
+#endif
+
+/** Variables. **/
+static flash_device_info_t *g_flash_info = NULL;
+#if (INC_SPI_PROG_NAND==1)
+static flash_device_info_t *g_nand_flash_info = NULL;
+static flash_device_info_t *g_spi_flash_info = NULL;
+#endif
+
+/***************************************************************************
+ * Function Name: display_flash_info
+ * Description : Displays information about the flash part.
+ * Returns : None.
+ ***************************************************************************/
+static void display_flash_info(int ret, flash_device_info_t *flash_info)
+{
+ switch (flash_info->flash_type) {
+ case FLASH_IFC_PARALLEL:
+ printk( "Parallel flash device");
+ break;
+
+ case FLASH_IFC_SPI:
+ printk( "Serial flash device");
+ break;
+
+ case FLASH_IFC_HS_SPI:
+ printk( "HS Serial flash device");
+ break;
+
+ case FLASH_IFC_NAND:
+ printk( "NAND flash device");
+ break;
+ }
+
+ if( ret == FLASH_API_OK ) {
+ printk(": name %s, id 0x%4.4x",
+ flash_info->flash_device_name, flash_info->flash_device_id);
+#if (INC_SPI_PROG_NAND==1)
+ printk(" block %dKB", flash_info->fn_flash_get_sector_size(0) / 1024);
+ printk(" size %dKB", (*flash_info->fn_flash_get_total_size) () / 1024);
+#else
+ if (flash_info->flash_type == FLASH_IFC_NAND)
+ printk(" block %dKB", flash_get_sector_size(0) / 1024);
+ printk(" size %dKB", flash_get_total_size() / 1024);
+#endif
+ printk("\n");
+ }
+ else {
+ printk( " id %4.4x is not supported.\n", flash_info->flash_device_id );
+ }
+} /* display_flash_info */
+
+/***************************************************************************
+ * Function Name: flash_init
+ * Description : Initialize flash part.
+ * Returns : FLASH_API_OK or FLASH_API_ERROR
+ ***************************************************************************/
+int flash_init(void)
+{
+ int type = FLASH_IFC_UNKNOWN;
+ int ret = FLASH_API_ERROR;
+#if (INC_SPI_PROG_NAND==1)
+ int ret_nand = FLASH_API_ERROR;
+#endif
+
+ /* If available, use bootstrap to decide which flash to use */
+#if defined(_BCM96816_) || defined(CONFIG_BCM96816) || defined(_BCM96368_) || defined(CONFIG_BCM96368)
+ unsigned int bootsel;
+#if defined(_BCM96816_) || defined(CONFIG_BCM96816)
+ bootsel = MISC->miscStrapBus;
+#elif defined(_BCM96368_) || defined(CONFIG_BCM96368)
+ bootsel = GPIO->StrapBus;
+#endif
+ switch ((bootsel & MISC_STRAP_BUS_BOOT_SEL_MASK)>>MISC_STRAP_BUS_BOOT_SEL_SHIFT) {
+ case MISC_STRAP_BUS_BOOT_PARALLEL:
+ type = FLASH_IFC_PARALLEL;
+ break;
+
+ case MISC_STRAP_BUS_BOOT_SERIAL:
+ type = FLASH_IFC_SPI;
+ break;
+
+ case MISC_STRAP_BUS_BOOT_NAND:
+ type = FLASH_IFC_NAND;
+ break;
+
+ }
+#elif defined(_BCM96362_) || defined(CONFIG_BCM96362) || defined(_BCM96328_) || defined(CONFIG_BCM96328)
+ if( ((MISC->miscStrapBus & MISC_STRAP_BUS_BOOT_SEL_MASK) >>
+ MISC_STRAP_BUS_BOOT_SEL_SHIFT) == MISC_STRAP_BUS_BOOT_SERIAL )
+ type = FLASH_IFC_SPI;
+ else
+ type = FLASH_IFC_NAND;
+#endif
+
+ switch (type) {
+ case FLASH_IFC_PARALLEL:
+ ret = cfi_flash_init( &g_flash_info );
+ break;
+
+ case FLASH_IFC_SPI:
+ ret = spi_flash_init( &g_flash_info );
+#if (INC_SPI_PROG_NAND==1)
+ ret_nand = nand_flash_init( &g_nand_flash_info );
+#endif
+
+ break;
+
+ case FLASH_IFC_NAND:
+ ret = nand_flash_init( &g_flash_info );
+ break;
+
+ case FLASH_IFC_UNKNOWN:
+ /* Try to detect flash chips, give priority to parallel flash */
+ /* Our reference design has both, and we usually use parallel. */
+ ret = cfi_flash_init( &g_flash_info );
+ if (ret != FLASH_API_OK) {
+ ret = spi_flash_init( &g_flash_info );
+ }
+ break;
+ }
+
+ if (g_flash_info != NULL) {
+ display_flash_info(ret, g_flash_info);
+#if (INC_SPI_PROG_NAND==1)
+ display_flash_info(ret_nand, g_nand_flash_info );
+#endif
+ }
+ else {
+ printk( "BCM Flash API. Flash device is not found.\n" );
+ }
+
+ return( ret );
+} /* flash_init */
+
+/***************************************************************************
+ * Function Name: flash_sector_erase_int
+ * Description : Erase the specfied flash sector.
+ * Returns : FLASH_API_OK or FLASH_API_ERROR
+ ***************************************************************************/
+int flash_sector_erase_int(unsigned short sector)
+{
+ return( (g_flash_info)
+ ? (*g_flash_info->fn_flash_sector_erase_int) (sector)
+ : FLASH_API_ERROR );
+} /* flash_sector_erase_int */
+
+/***************************************************************************
+ * Function Name: flash_read_buf
+ * Description : Reads from flash memory.
+ * Returns : number of bytes read or FLASH_API_ERROR
+ ***************************************************************************/
+int flash_read_buf(unsigned short sector, int offset, unsigned char *buffer,
+ int numbytes)
+{
+ return( (g_flash_info)
+ ? (*g_flash_info->fn_flash_read_buf) (sector, offset, buffer, numbytes)
+ : FLASH_API_ERROR );
+} /* flash_read_buf */
+
+/***************************************************************************
+ * Function Name: flash_write_buf
+ * Description : Writes to flash memory.
+ * Returns : number of bytes written or FLASH_API_ERROR
+ ***************************************************************************/
+int flash_write_buf(unsigned short sector, int offset, unsigned char *buffer,
+ int numbytes)
+{
+ return( (g_flash_info)
+ ? (*g_flash_info->fn_flash_write_buf) (sector, offset, buffer, numbytes)
+ : FLASH_API_ERROR );
+} /* flash_write_buf */
+
+/***************************************************************************
+ * Function Name: flash_get_numsectors
+ * Description : Returns the number of sectors in the flash device.
+ * Returns : Number of sectors in the flash device.
+ ***************************************************************************/
+int flash_get_numsectors(void)
+{
+ return( (g_flash_info)
+ ? (*g_flash_info->fn_flash_get_numsectors) ()
+ : FLASH_API_ERROR );
+} /* flash_get_numsectors */
+
+/***************************************************************************
+ * Function Name: flash_get_sector_size
+ * Description : Returns the number of bytes in the specfied flash sector.
+ * Returns : Number of bytes in the specfied flash sector.
+ ***************************************************************************/
+int flash_get_sector_size(unsigned short sector)
+{
+ return( (g_flash_info)
+ ? (*g_flash_info->fn_flash_get_sector_size) (sector)
+ : FLASH_API_ERROR );
+} /* flash_get_sector_size */
+
+/***************************************************************************
+ * Function Name: flash_get_memptr
+ * Description : Returns the base MIPS memory address for the specfied flash
+ * sector.
+ * Returns : Base MIPS memory address for the specfied flash sector.
+ ***************************************************************************/
+unsigned char *flash_get_memptr(unsigned short sector)
+{
+ return( (g_flash_info)
+ ? (*g_flash_info->fn_flash_get_memptr) (sector)
+ : NULL );
+} /* flash_get_memptr */
+
+/***************************************************************************
+ * Function Name: flash_get_blk
+ * Description : Returns the flash sector for the specfied MIPS address.
+ * Returns : Flash sector for the specfied MIPS address.
+ ***************************************************************************/
+int flash_get_blk(int addr)
+{
+ return( (g_flash_info)
+ ? (*g_flash_info->fn_flash_get_blk) (addr)
+ : FLASH_API_ERROR );
+} /* flash_get_blk */
+
+/***************************************************************************
+ * Function Name: flash_get_total_size
+ * Description : Returns the number of bytes in the flash device.
+ * Returns : Number of bytes in the flash device.
+ ***************************************************************************/
+int flash_get_total_size(void)
+{
+ return( (g_flash_info)
+ ? (*g_flash_info->fn_flash_get_total_size) ()
+ : FLASH_API_ERROR );
+} /* flash_get_total_size */
+
+/***************************************************************************
+ * Function Name: flash_get_flash_type
+ * Description : Returns type of the flash memory.
+ * Returns : Type of the flash memory.
+ ***************************************************************************/
+int flash_get_flash_type(void)
+{
+ return( (g_flash_info)
+ ? (g_flash_info->flash_type)
+ : FLASH_API_ERROR );
+} /* flash_get_flash_type */
+
+#if (INC_SPI_PROG_NAND==1)
+/***************************************************************************
+ * Function Name: flash_change_flash_type
+ * Description : change type of the flash memory.
+ * Returns : none
+ ***************************************************************************/
+void flash_change_flash_type(int type)
+{
+
+ if (type == FLASH_IFC_NAND)
+ {
+ if (g_spi_flash_info == NULL)
+ g_spi_flash_info = g_flash_info;
+ g_flash_info = g_nand_flash_info;
+ }
+ else
+ {
+ if (g_spi_flash_info != NULL)
+ g_flash_info = g_spi_flash_info;
+ }
+} /* flash_change_flash_type */
+
+#endif
+
diff --git a/shared/opensource/flash/flash_common.c b/shared/opensource/flash/flash_common.c
new file mode 100755
index 0000000..0d4a75d
--- /dev/null
+++ b/shared/opensource/flash/flash_common.c
@@ -0,0 +1,280 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+/*!\file flash_common.c
+ * \brief This file contains NOR flash related functions used by both
+ * CFE and kernel.
+ *
+ */
+
+/** Includes. */
+#ifdef _CFE_
+#include "lib_types.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "bcm_map.h"
+#define printk printf
+#else // Linux
+#include <linux/kernel.h>
+#include "bcm_map_part.h"
+#endif
+
+#include "bcmtypes.h"
+#include "bcm_hwdefs.h"
+#include "flash_api.h"
+#include "flash_common.h"
+
+// #define DEBUG_FLASH
+
+void flash_init_info(const NVRAM_DATA *nvRam, FLASH_ADDR_INFO *fInfo)
+{
+ int i = 0;
+ int totalBlks = 0;
+ int totalSize = 0;
+ int psiStartAddr = 0;
+ int spStartAddr = 0;
+ int usedBlkSize = 0;
+ int needBytes = 0;
+
+ if (flash_get_flash_type() == FLASH_IFC_NAND)
+ {
+ /* When using NAND flash disable Bcm_flash */
+ totalSize = 0;
+ }
+ else {
+ totalBlks = flash_get_numsectors();
+ totalSize = flash_get_total_size();
+ printk("Total Flash size: %dK with %d sectors\n", totalSize/1024, totalBlks);
+ }
+
+ if (totalSize <= FLASH_LENGTH_BOOT_ROM) {
+ /* NAND flash settings. NAND flash does not use raw flash partitioins
+ * to store psi, backup psi, scratch pad and syslog. These data items
+ * are stored as files on a JFFS2 file system.
+ */
+ if ((nvRam->ulPsiSize != -1) && (nvRam->ulPsiSize != 0))
+ fInfo->flash_persistent_length = nvRam->ulPsiSize * ONEK;
+ else
+ fInfo->flash_persistent_length = DEFAULT_PSI_SIZE * ONEK;
+
+ fInfo->flash_persistent_start_blk = 0;
+ fInfo->flash_rootfs_start_offset = 0;
+ fInfo->flash_scratch_pad_length = SP_MAX_LEN;
+ fInfo->flash_syslog_length = nvRam->ulSyslogSize * 1024;
+
+ /* This is a boolean field for NAND flash. */
+ fInfo->flash_backup_psi_number_blk = nvRam->backupPsi;
+ return;
+ }
+
+ /*
+ * calculate mandatory primary PSI size and set its fInfo parameters.
+ */
+ if ((nvRam->ulPsiSize != -1) && (nvRam->ulPsiSize != 0))
+ fInfo->flash_persistent_length = nvRam->ulPsiSize * ONEK;
+ else
+ fInfo->flash_persistent_length = DEFAULT_PSI_SIZE * ONEK;
+
+ psiStartAddr = totalSize - fInfo->flash_persistent_length;
+ fInfo->flash_persistent_start_blk = flash_get_blk(FLASH_BASE+psiStartAddr);
+ fInfo->flash_persistent_number_blk = totalBlks - fInfo->flash_persistent_start_blk;
+
+ usedBlkSize = 0;
+ for (i = fInfo->flash_persistent_start_blk;
+ i < (fInfo->flash_persistent_start_blk + fInfo->flash_persistent_number_blk); i++)
+ {
+ usedBlkSize += flash_get_sector_size((unsigned short) i);
+ }
+ fInfo->flash_persistent_blk_offset = usedBlkSize - fInfo->flash_persistent_length;
+ fInfo->flash_meta_start_blk = fInfo->flash_persistent_start_blk;
+
+ /*
+ * Next is the optional scratch pad, which is on top of the primary PSI.
+ * Old code allowed scratch pad to share a sector with primary PSI.
+ * That is retained for backward compatibility. (Although depending on your
+ * NOR flash sector sizes, they may still be in different sectors.)
+ * If you have a new deployment, consider forcing separate sectors.
+ */
+ if ((fInfo->flash_persistent_blk_offset > 0) &&
+ (fInfo->flash_persistent_blk_offset < SP_MAX_LEN))
+ {
+ /*
+ * there is some room left in the first persistent sector, but it is
+ * not big enough for the scratch pad. (Use this line unconditionally
+ * if you want to guarentee scratch pad and primary PSI are on different
+ * sectors.)
+ */
+ spStartAddr = psiStartAddr - fInfo->flash_persistent_blk_offset - SP_MAX_LEN;
+ }
+ else
+ {
+ /* either the primary PSI starts on a sector boundary, or there is
+ * enough room at the top of the first sector for the scratch pad. */
+ spStartAddr = psiStartAddr - SP_MAX_LEN ;
+ }
+
+ fInfo->flash_scratch_pad_start_blk = flash_get_blk(FLASH_BASE+spStartAddr);
+ fInfo->flash_scratch_pad_length = SP_MAX_LEN;
+
+ if (fInfo->flash_persistent_start_blk == fInfo->flash_scratch_pad_start_blk) // share blk
+ {
+#if 0 /* do not used scratch pad unless it's in its own sector */
+ printk("Scratch pad is not used for this flash part.\n");
+ fInfo->flash_scratch_pad_length = 0; // no sp
+#else /* allow scratch pad to share a sector with another section such as PSI */
+ fInfo->flash_scratch_pad_number_blk = 1;
+ fInfo->flash_scratch_pad_blk_offset = fInfo->flash_persistent_blk_offset - fInfo->flash_scratch_pad_length;
+#endif
+ }
+ else // on different blk
+ {
+ fInfo->flash_scratch_pad_number_blk = fInfo->flash_persistent_start_blk - fInfo->flash_scratch_pad_start_blk;
+ // find out the offset in the start_blk
+ usedBlkSize = 0;
+ for (i = fInfo->flash_scratch_pad_start_blk;
+ i < (fInfo->flash_scratch_pad_start_blk + fInfo->flash_scratch_pad_number_blk); i++)
+ usedBlkSize += flash_get_sector_size((unsigned short) i);
+ fInfo->flash_scratch_pad_blk_offset = usedBlkSize - fInfo->flash_scratch_pad_length;
+ }
+
+ if (fInfo->flash_scratch_pad_length > 0) {
+
+ fInfo->flash_meta_start_blk = fInfo->flash_scratch_pad_start_blk;
+ }
+
+ /*
+ * Next is the optional backup PSI.
+ */
+ if (nvRam->backupPsi == 0x01)
+ {
+ needBytes = fInfo->flash_persistent_length;
+ i = fInfo->flash_meta_start_blk;
+ while (needBytes > 0)
+ {
+ i--;
+ needBytes -= flash_get_sector_size((unsigned short) i);
+ }
+ fInfo->flash_backup_psi_start_blk = i;
+ /* calclate how many blocks we actually consumed */
+ needBytes = fInfo->flash_persistent_length;
+ fInfo->flash_backup_psi_number_blk = 0;
+ while (needBytes > 0)
+ {
+ needBytes -= flash_get_sector_size((unsigned short) i);
+ i++;
+ fInfo->flash_backup_psi_number_blk++;
+ }
+
+ fInfo->flash_meta_start_blk = fInfo->flash_backup_psi_start_blk;
+ }
+ else
+ {
+ fInfo->flash_backup_psi_number_blk = 0;
+ }
+
+ /*
+ * Next is the optional persistent syslog.
+ */
+ if (nvRam->ulSyslogSize != 0 && nvRam->ulSyslogSize != -1)
+ {
+ fInfo->flash_syslog_length = nvRam->ulSyslogSize * 1024;
+ needBytes = fInfo->flash_syslog_length;
+ i = fInfo->flash_meta_start_blk;
+ while (needBytes > 0)
+ {
+ i--;
+ needBytes -= flash_get_sector_size((unsigned short) i);
+ }
+ fInfo->flash_syslog_start_blk = i;
+ /* calclate how many blocks we actually consumed */
+ needBytes = fInfo->flash_syslog_length;
+ fInfo->flash_syslog_number_blk = 0;
+ while (needBytes > 0)
+ {
+ needBytes -= flash_get_sector_size((unsigned short) i);
+ i++;
+ fInfo->flash_syslog_number_blk++;
+ }
+
+ fInfo->flash_meta_start_blk = fInfo->flash_syslog_start_blk;
+ }
+ else
+ {
+ fInfo->flash_syslog_length = 0;
+ fInfo->flash_syslog_number_blk = 0;
+ }
+
+#ifdef DEBUG_FLASH_TOO_MUCH
+ /* dump sizes of all sectors in flash */
+ for (i=0; i<totalBlks; i++)
+ printk("blk %03d: %d\n", i, flash_get_sector_size((unsigned short) i));
+#endif
+
+#if defined(DEBUG_FLASH)
+ printk("FLASH_BASE =0x%08x\n\n", (unsigned int)FLASH_BASE);
+
+ printk("fInfo->flash_rootfs_start_offset =0x%08x\n\n", (unsigned int)fInfo->flash_rootfs_start_offset);
+
+ printk("fInfo->flash_meta_start_blk = %d\n\n", fInfo->flash_meta_start_blk);
+
+ printk("fInfo->flash_syslog_start_blk = %d\n", fInfo->flash_syslog_start_blk);
+ printk("fInfo->flash_syslog_number_blk = %d\n", fInfo->flash_syslog_number_blk);
+ printk("fInfo->flash_syslog_length=0x%x\n\n", (unsigned int)fInfo->flash_syslog_length);
+
+ printk("fInfo->flash_backup_psi_start_blk = %d\n", fInfo->flash_backup_psi_start_blk);
+ printk("fInfo->flash_backup_psi_number_blk = %d\n\n", fInfo->flash_backup_psi_number_blk);
+
+ printk("sp startAddr = %x\n", (unsigned int) (FLASH_BASE+spStartAddr));
+ printk("fInfo->flash_scratch_pad_start_blk = %d\n", fInfo->flash_scratch_pad_start_blk);
+ printk("fInfo->flash_scratch_pad_number_blk = %d\n", fInfo->flash_scratch_pad_number_blk);
+ printk("fInfo->flash_scratch_pad_length = 0x%x\n", fInfo->flash_scratch_pad_length);
+ printk("fInfo->flash_scratch_pad_blk_offset = 0x%x\n\n", (unsigned int)fInfo->flash_scratch_pad_blk_offset);
+
+ printk("psi startAddr = %x\n", (unsigned int) (FLASH_BASE+psiStartAddr));
+ printk("fInfo->flash_persistent_start_blk = %d\n", fInfo->flash_persistent_start_blk);
+ printk("fInfo->flash_persistent_number_blk = %d\n", fInfo->flash_persistent_number_blk);
+ printk("fInfo->flash_persistent_length=0x%x\n", (unsigned int)fInfo->flash_persistent_length);
+ printk("fInfo->flash_persistent_blk_offset = 0x%x\n\n", (unsigned int)fInfo->flash_persistent_blk_offset);
+#endif
+}
+
+unsigned int flash_get_reserved_bytes_at_end(const FLASH_ADDR_INFO *fInfo)
+{
+ unsigned int reserved=0;
+ int i = fInfo->flash_meta_start_blk;
+ int totalBlks = flash_get_numsectors();
+
+ while (i < totalBlks)
+ {
+ reserved += flash_get_sector_size((unsigned short) i);
+ i++;
+ }
+
+#if defined(DEBUG_FLASH)
+ printk("reserved at bottom=%dKB\n", reserved/1024);
+#endif
+
+ return reserved;
+}
+
diff --git a/shared/opensource/flash/nandflash.c b/shared/opensource/flash/nandflash.c
new file mode 100755
index 0000000..b90ad7b
--- /dev/null
+++ b/shared/opensource/flash/nandflash.c
@@ -0,0 +1,1260 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the “GPL?, available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+/***************************************************************************
+ * File Name : nandflash.c
+ *
+ * Description: This file implements the Broadcom DSL defined flash api for
+ * for NAND flash parts.
+ ***************************************************************************/
+
+/** Includes. **/
+
+#include "lib_types.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "lib_malloc.h"
+#include "bcm_map.h"
+#include "bcmtypes.h"
+#include "bcm_hwdefs.h"
+#include "flash_api.h"
+#include "jffs2.h"
+#if defined(CFG_RAMAPP) && (INC_SPI_FLASH_DRIVER==1)
+#include "cfe_timer.h"
+#endif
+
+/* for debugging in jtag */
+#if !defined(CFG_RAMAPP)
+#define static
+#endif
+
+
+/** Defines. **/
+
+#define NR_OOB_SCAN_PAGES 4
+#define SPARE_MAX_SIZE 64
+#define PAGE_MAX_SIZE 2048
+#define CTRLR_SPARE_SIZE 16
+#define CTRLR_CACHE_SIZE 512
+
+/* Flash manufacturers. */
+#define FLASHTYPE_SAMSUNG 0xec
+#define FLASHTYPE_ST 0x20
+#define FLASHTYPE_MICRON 0x2c
+
+/* Samsung flash parts. */
+#define SAMSUNG_K9F5608U0A 0x55
+
+/* ST flash parts. */
+#define ST_NAND512W3A2CN6 0x76
+#define ST_NAND01GW3B2CN6 0xf1
+
+/* Micron flash parts. */
+#define MICRON_MT29F1G08AAC 0xf1
+
+/* Flash id to name mapping. */
+#define NAND_MAKE_ID(A,B) \
+ (((unsigned short) (A) << 8) | ((unsigned short) B & 0xff))
+
+#define NAND_FLASH_DEVICES \
+ {{NAND_MAKE_ID(FLASHTYPE_SAMSUNG,SAMSUNG_K9F5608U0A),"Samsung K9F5608U0"}, \
+ {NAND_MAKE_ID(FLASHTYPE_ST,ST_NAND512W3A2CN6),"ST NAND512W3A2CN6"}, \
+ {NAND_MAKE_ID(FLASHTYPE_ST,ST_NAND01GW3B2CN6),"ST NAND01GW3B2CN6"}, \
+ {NAND_MAKE_ID(FLASHTYPE_MICRON,MICRON_MT29F1G08AAC),"Micron MT29F1G08AAC"},\
+ {0,""} \
+ }
+
+/* One byte for small page NAND flash parts. */
+#define SPARE_SP_BI_INDEX_1 5
+#define SPARE_SP_BI_INDEX_2 5
+
+/* Two bytes for small page NAND flash parts. */
+#define SPARE_LP_BI_INDEX_1 0
+#define SPARE_LP_BI_INDEX_2 1
+
+#define SPARE_BI_MARKER 0
+#define SPARE_BI_ECC_MASK \
+ {0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, \
+ 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, \
+ 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, \
+ 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}
+
+#define JFFS2_CLEANMARKER {JFFS2_MAGIC_BITMASK, \
+ JFFS2_NODETYPE_CLEANMARKER, 0x0000, 0x0008}
+
+#undef DEBUG_NAND
+#if defined(DEBUG_NAND) && defined(CFG_RAMAPP)
+#define DBG_PRINTF printf
+#else
+#define DBG_PRINTF(...)
+#endif
+
+
+/** Externs. **/
+
+extern void board_setleds(unsigned long);
+
+
+/** Structs. **/
+
+typedef struct CfeNandChip
+{
+ char *chip_name;
+ unsigned long chip_device_id;
+ unsigned long chip_base;
+ unsigned long chip_total_size;
+ unsigned long chip_block_size;
+ unsigned long chip_page_size;
+ unsigned long chip_spare_size;
+ unsigned char *chip_spare_mask;
+ unsigned long chip_bi_index_1;
+ unsigned long chip_bi_index_2;
+} CFE_NAND_CHIP, *PCFE_NAND_CHIP;
+
+struct flash_name_from_id
+{
+ unsigned short fnfi_id;
+ char fnfi_name[30];
+};
+
+
+#if defined(CFG_RAMAPP)
+/** Prototypes for CFE RAM. **/
+int nand_flash_init(flash_device_info_t **flash_info);
+int mpinand_flash_init(flash_device_info_t **flash_info);
+static void nand_init_cleanmarker(PCFE_NAND_CHIP pchip);
+static void nand_read_cfg(PCFE_NAND_CHIP pchip);
+static int nand_is_blk_cleanmarker(PCFE_NAND_CHIP pchip,
+ unsigned long start_addr, int write_if_not);
+static int nand_initialize_spare_area(PCFE_NAND_CHIP pchip);
+static void nand_mark_bad_blk(PCFE_NAND_CHIP pchip, unsigned long page_addr);
+static int nand_flash_sector_erase_int(unsigned short blk);
+static int nand_flash_read_buf(unsigned short blk, int offset,
+ unsigned char *buffer, int len);
+static int nand_flash_write_buf(unsigned short blk, int offset,
+ unsigned char *buffer, int numbytes);
+static int nand_flash_get_numsectors(void);
+static int nand_flash_get_sector_size(unsigned short sector);
+static unsigned char *nand_flash_get_memptr(unsigned short sector);
+static int nand_flash_get_blk(int addr);
+static int nand_flash_get_total_size(void);
+static int nandflash_wait_status(unsigned long status_mask);
+static int nandflash_read_spare_area(PCFE_NAND_CHIP pchip,
+ unsigned long page_addr, unsigned char *buffer, int len);
+static int nandflash_write_spare_area(PCFE_NAND_CHIP pchip,
+ unsigned long page_addr, unsigned char *buffer, int len);
+static int nandflash_read_page(PCFE_NAND_CHIP pchip,
+ unsigned long start_addr, unsigned char *buffer, int len);
+static int nandflash_write_page(PCFE_NAND_CHIP pchip, unsigned long start_addr,
+ unsigned char *buffer, int len);
+static int nandflash_block_erase(PCFE_NAND_CHIP pchip, unsigned long blk_addr);
+#else
+/** Prototypes for CFE ROM. **/
+void rom_nand_flash_init(void);
+static int nand_is_blk_cleanmarker(PCFE_NAND_CHIP pchip,
+ unsigned long start_addr, int write_if_not);
+static void nand_read_cfg(PCFE_NAND_CHIP pchip);
+int nand_flash_get_sector_size(unsigned short sector);
+int nand_flash_get_numsectors(void);
+static int nandflash_wait_status(unsigned long status_mask);
+static int nandflash_read_spare_area(PCFE_NAND_CHIP pchip,
+ unsigned long page_addr, unsigned char *buffer, int len);
+static int nandflash_read_page(PCFE_NAND_CHIP pchip, unsigned long start_addr,
+ unsigned char *buffer, int len);
+int nand_flash_read_buf(unsigned short blk, int offset,
+ unsigned char *buffer, int len);
+static inline void nandflash_copy_from_cache(unsigned char *buffer,
+ int offset, int numbytes);
+static inline void nandflash_copy_from_spare(unsigned char *buffer,
+ int numbytes);
+static int nandflash_wait_status(unsigned long status_mask);
+static inline int nandflash_wait_cmd(void);
+static inline int nandflash_wait_device(void);
+static inline int nandflash_wait_cache(void);
+static inline int nandflash_wait_spare(void);
+static int nandflash_check_ecc(void);
+#endif
+
+
+#if defined(CFG_RAMAPP)
+/** Variables for CFE RAM. **/
+CFE_NAND_CHIP g_chip = {NULL,0,0,0,0,0,0};
+static unsigned char g_spare_mask[] = SPARE_BI_ECC_MASK;
+static unsigned char g_spare_cleanmarker[SPARE_MAX_SIZE];
+
+static flash_device_info_t flash_nand_dev =
+ {
+ 0xffff,
+ FLASH_IFC_NAND,
+ "",
+ nand_flash_sector_erase_int,
+ nand_flash_read_buf,
+ nand_flash_write_buf,
+ nand_flash_get_numsectors,
+ nand_flash_get_sector_size,
+ nand_flash_get_memptr,
+ nand_flash_get_blk,
+ nand_flash_get_total_size
+ };
+
+#else
+/** Variables for CFE ROM. **/
+CFE_NAND_CHIP g_chip;
+static unsigned char g_spare_mask[] = SPARE_BI_ECC_MASK;
+#endif
+
+
+#if defined(CFG_RAMAPP)
+/***************************************************************************
+ * Function Name: nand_flash_init
+ * Description : Initialize flash part.
+ * Returns : FLASH_API_OK or FLASH_API_ERROR
+ ***************************************************************************/
+int nand_flash_init(flash_device_info_t **flash_info)
+{
+ static int initialized = 0;
+ int ret = FLASH_API_OK;
+
+ if( initialized == 0 )
+ {
+ PCFE_NAND_CHIP pchip = &g_chip;
+ static struct flash_name_from_id fnfi[] = NAND_FLASH_DEVICES;
+ struct flash_name_from_id *fnfi_ptr;
+
+ DBG_PRINTF(">> nand_flash_init - entry\n");
+
+ /* Enable NAND data on MII ports. */
+#if !defined(_BCM96328_)
+ PERF->blkEnables |= NAND_CLK_EN;
+#endif
+#if defined(_BCM96362_) && (INC_SPI_FLASH_DRIVER==1)
+ GPIO->GPIOBaseMode |= NAND_GPIO_OVERRIDE;
+#endif
+ NAND->NandNandBootConfig = NBC_AUTO_DEV_ID_CFG | 2;
+#if (INC_SPI_FLASH_DRIVER==1)
+ cfe_usleep(1000);
+#endif
+ /* Read the NAND flash chip id. Only use the most signficant 16 bits.*/
+ pchip->chip_device_id = NAND->NandFlashDeviceId >> 16;
+ flash_nand_dev.flash_device_id = pchip->chip_device_id;
+
+ for( fnfi_ptr = fnfi; fnfi_ptr->fnfi_id != 0; fnfi_ptr++ )
+ {
+ if( fnfi_ptr->fnfi_id == pchip->chip_device_id )
+ {
+ strcpy(flash_nand_dev.flash_device_name, fnfi_ptr->fnfi_name);
+ break;
+ }
+ }
+
+ /* If NAND chip is not in the list of NAND chips, the correct
+ * configuration maybe still have been set by the NAND controller.
+ */
+ if( flash_nand_dev.flash_device_name[0] == '\0' )
+ strcpy(flash_nand_dev.flash_device_name, "<not identified>");
+
+ *flash_info = &flash_nand_dev;
+
+ NAND->NandCsNandXor = 0;
+ pchip->chip_base = 0;
+ nand_read_cfg(pchip);
+ nand_init_cleanmarker(pchip);
+
+ /* If the first block's spare area is not a JFFS2 cleanmarker,
+ * initialize all block's spare area to a cleanmarker.
+ */
+ if( !nand_is_blk_cleanmarker(pchip, 0, 0) )
+ ret = nand_initialize_spare_area(pchip);
+
+ DBG_PRINTF(">> nand_flash_init - return %d\n", ret);
+
+ initialized = 1;
+ }
+ else
+ *flash_info = &flash_nand_dev;
+
+ return( ret );
+} /* nand_flash_init */
+
+/***************************************************************************
+ * Function Name: nand_init_cleanmarker
+ * Description : Initializes the JFFS2 clean marker buffer.
+ * Returns : None.
+ ***************************************************************************/
+static void nand_init_cleanmarker(PCFE_NAND_CHIP pchip)
+{
+ unsigned short cleanmarker[] = JFFS2_CLEANMARKER;
+ unsigned char *pcm = (unsigned char *) cleanmarker;
+ int i, j;
+
+ /* Skip spare area offsets reserved for ECC bytes. */
+ for( i = 0, j = 0; i < pchip->chip_spare_size; i++ )
+ {
+ if( pchip->chip_spare_mask[i] == 0 && j < sizeof(cleanmarker))
+ g_spare_cleanmarker[i] = pcm[j++];
+ else
+ g_spare_cleanmarker[i] = 0xff;
+ }
+} /* nand_init_cleanmarker */
+
+#else
+/***************************************************************************
+ * Function Name: rom_nand_flash_init
+ * Description : Initialize flash part just enough to read blocks.
+ * Returns : FLASH_API_OK or FLASH_API_ERROR
+ ***************************************************************************/
+void rom_nand_flash_init(void)
+{
+ PCFE_NAND_CHIP pchip = &g_chip;
+
+ /* Enable NAND data on MII ports. */
+#if !defined(_BCM96328_)
+ PERF->blkEnables |= NAND_CLK_EN;
+#endif
+ NAND->NandNandBootConfig = NBC_AUTO_DEV_ID_CFG | 2;
+
+ pchip->chip_base = 0;
+
+ /* Read the chip id. Only use the most signficant 16 bits. */
+ pchip->chip_device_id = NAND->NandFlashDeviceId >> 16;
+
+ if( pchip->chip_device_id > 0 && pchip->chip_device_id < 0xffff )
+ nand_read_cfg(pchip);
+ else
+ board_setleds(0x4d494532);
+} /* nand_flash_init */
+#endif
+
+/***************************************************************************
+ * Function Name: nand_read_cfg
+ * Description : Reads and stores the chip configuration.
+ * Returns : None.
+ ***************************************************************************/
+static void nand_read_cfg(PCFE_NAND_CHIP pchip)
+{
+ /* Read chip configuration. */
+ unsigned long cfg = NAND->NandConfig;
+
+ pchip->chip_total_size =
+ (4 * (1 << ((cfg & NC_DEV_SIZE_MASK) >> NC_DEV_SIZE_SHIFT))) << 20;
+
+ switch( (cfg & NC_BLK_SIZE_MASK) )
+ {
+ case NC_BLK_SIZE_512K:
+ pchip->chip_block_size = 512 * 1024;
+ break;
+
+ case NC_BLK_SIZE_128K:
+ pchip->chip_block_size = 128 * 1024;
+ break;
+
+ case NC_BLK_SIZE_16K:
+ pchip->chip_block_size = 16 * 1024;
+ break;
+
+ case NC_BLK_SIZE_8K:
+ pchip->chip_block_size = 8 * 1024;
+ break;
+ }
+
+ if( (cfg & NC_PG_SIZE_MASK) == NC_PG_SIZE_512B )
+ {
+ pchip->chip_page_size = 512;
+ pchip->chip_bi_index_1 = SPARE_SP_BI_INDEX_1;
+ pchip->chip_bi_index_2 = SPARE_SP_BI_INDEX_2;
+ }
+ else
+ {
+ pchip->chip_page_size = 2048;
+ pchip->chip_bi_index_1 = SPARE_LP_BI_INDEX_1;
+ pchip->chip_bi_index_2 = SPARE_LP_BI_INDEX_2;
+ }
+
+ pchip->chip_spare_mask = g_spare_mask;
+ pchip->chip_spare_mask[pchip->chip_bi_index_1] = 1;
+ pchip->chip_spare_mask[pchip->chip_bi_index_2] = 1;
+
+ pchip->chip_spare_size = pchip->chip_page_size >> 5;
+
+ DBG_PRINTF(">> nand_read_cfg - size=%luMB, block=%luKB, page=%luB, "
+ "spare=%lu\n", pchip->chip_total_size / (1024 * 1024),
+ pchip->chip_block_size / 1024, pchip->chip_page_size,
+ pchip->chip_spare_size);
+} /* nand_read_cfg */
+
+/***************************************************************************
+ * Function Name: nand_is_blk_cleanmarker
+ * Description : Compares a buffer to see if it a JFFS2 cleanmarker.
+ * Returns : 1 - is cleanmarker, 0 - is not cleanmarker
+ ***************************************************************************/
+static int nand_is_blk_cleanmarker(PCFE_NAND_CHIP pchip,
+ unsigned long start_addr, int write_if_not)
+{
+ unsigned short cleanmarker[] = JFFS2_CLEANMARKER;
+ unsigned char *pcm = (unsigned char *) cleanmarker;
+ unsigned char spare[SPARE_MAX_SIZE], comparebuf[SPARE_MAX_SIZE];
+ unsigned long i, j;
+ int ret = 0;
+
+ if( nandflash_read_spare_area( pchip, start_addr, spare,
+ pchip->chip_spare_size) == FLASH_API_OK )
+ {
+ /* Skip spare offsets that are reserved for the ECC. Make spare data
+ * bytes contiguous in the spare buffer.
+ */
+ for( i = 0, j = 0; i < pchip->chip_spare_size; i++ )
+ if( pchip->chip_spare_mask[i] == 0 )
+ comparebuf[j++] = spare[i];
+
+ /* Compare spare area data to the JFFS2 cleanmarker. */
+ for( i = 0, ret = 1; i < sizeof(cleanmarker) && ret == 1; i++ )
+ if( comparebuf[i] != pcm[i])
+ ret = 0;
+ }
+
+#if defined(CFG_RAMAPP)
+ if( ret == 0 && spare[pchip->chip_bi_index_1] != SPARE_BI_MARKER &&
+ spare[pchip->chip_bi_index_2] != SPARE_BI_MARKER && write_if_not )
+ {
+ /* The spare area is not a clean marker but the block is not bad.
+ * Write a clean marker to this block. (Assumes the block is erased.)
+ */
+ if( nandflash_write_spare_area(pchip, start_addr, (unsigned char *)
+ g_spare_cleanmarker, pchip->chip_spare_size) == FLASH_API_OK )
+ {
+ ret = nand_is_blk_cleanmarker(pchip, start_addr, 0);
+ }
+ }
+#endif
+
+ return( ret );
+} /* nand_is_blk_cleanmarker */
+
+#if defined(CFG_RAMAPP)
+/***************************************************************************
+ * Function Name: nand_initialize_spare_area
+ * Description : Initializes the spare area of the first page of each block
+ * to a cleanmarker.
+ * Returns : FLASH_API_OK or FLASH_API_ERROR
+ ***************************************************************************/
+static int nand_initialize_spare_area(PCFE_NAND_CHIP pchip)
+{
+ unsigned char spare[SPARE_MAX_SIZE];
+ unsigned long i;
+ int ret;
+
+ DBG_PRINTF(">> nand_initialize_spare_area - entry\n");
+
+ for( i = 0; i < pchip->chip_total_size; i += pchip->chip_block_size )
+ {
+ /* Read the current spare area. */
+ ret = nandflash_read_spare_area(pchip,0,spare,pchip->chip_spare_size);
+ if(ret == FLASH_API_OK
+ /*&& spare[pchip->chip_bi_index_1] != SPARE_BI_MARKER*/
+ /*&& spare[pchip->chip_bi_index_2] != SPARE_BI_MARKER*/)
+ {
+ if( nandflash_block_erase(pchip, i) == FLASH_API_OK )
+ {
+ nandflash_write_spare_area(pchip, i, (unsigned char *)
+ g_spare_cleanmarker, pchip->chip_spare_size);
+ }
+ }
+ }
+
+ return( FLASH_API_OK );
+} /* nand_initialize_spare_area */
+
+
+/***************************************************************************
+ * Function Name: nand_mark_bad_blk
+ * Description : Marks the specified block as bad by writing 0xFFs to the
+ * spare area and updating the in memory bad block table.
+ * Returns : None.
+ ***************************************************************************/
+static void nand_mark_bad_blk(PCFE_NAND_CHIP pchip, unsigned long page_addr)
+{
+ static int marking_bad_blk = 0;
+
+ unsigned char spare[SPARE_MAX_SIZE];
+
+ if( marking_bad_blk == 0 )
+ {
+ marking_bad_blk = 1;
+ DBG_PRINTF(">> nand_mark_bad_blk - addr=0x%8.8lx, block=0x%8.8lx\n",
+ page_addr, page_addr / pchip->chip_block_size);
+
+ nandflash_block_erase(pchip, page_addr);
+ memset(spare, 0xff, pchip->chip_spare_size);
+ spare[pchip->chip_bi_index_1] = SPARE_BI_MARKER;
+ spare[pchip->chip_bi_index_2] = SPARE_BI_MARKER;
+ nandflash_write_spare_area(pchip,page_addr,spare,pchip->chip_spare_size);
+ marking_bad_blk = 0;
+ }
+} /* nand_mark_bad_blk */
+
+
+/***************************************************************************
+ * Function Name: nand_flash_sector_erase_int
+ * Description : Erase the specfied flash sector.
+ * Returns : FLASH_API_OK or FLASH_API_ERROR
+ ***************************************************************************/
+static int nand_flash_sector_erase_int(unsigned short blk)
+{
+ int ret = FLASH_API_OK;
+ PCFE_NAND_CHIP pchip = &g_chip;
+
+ if( blk == NAND_REINIT_FLASH )
+ nand_initialize_spare_area(pchip);
+ else
+ {
+ unsigned long page_addr = blk * pchip->chip_block_size;
+
+ /* Only erase the block if the spare area is a JFFS2 cleanmarker.
+ * Assume that the only the CFE boot loader only touches JFFS2 blocks.
+ * This check prevents the Linux NAND MTD driver bad block block table
+ * from being erased. The NAND_REINIT_FLASH option unconditionally
+ * erases all NAND flash blocks.
+ */
+ if( nand_is_blk_cleanmarker(pchip, page_addr, 0) )
+ {
+ ret = nandflash_block_erase(pchip, page_addr);
+ nandflash_write_spare_area(pchip, page_addr, g_spare_cleanmarker,
+ pchip->chip_spare_size);
+ }
+
+ DBG_PRINTF(">> nand_flash_sector_erase_int - blk=0x%8.8lx, ret=%d\n",
+ blk, ret);
+ }
+
+ return( ret );
+} /* nand_flash_sector_erase_int */
+#endif
+
+/***************************************************************************
+ * Function Name: nand_flash_read_buf
+ * Description : Reads from flash memory.
+ * Returns : number of bytes read or FLASH_API_ERROR
+ ***************************************************************************/
+#if defined(CFG_RAMAPP)
+static
+#endif
+int nand_flash_read_buf(unsigned short blk, int offset, unsigned char *buffer,
+ int len)
+{
+ int ret = len;
+ PCFE_NAND_CHIP pchip = &g_chip;
+ UINT32 start_addr;
+ UINT32 blk_addr;
+ UINT32 blk_offset;
+ UINT32 size;
+
+ DBG_PRINTF(">> nand_flash_read_buf - 1 blk=0x%8.8lx, offset=%d, len=%lu\n",
+ blk, offset, len);
+
+ start_addr = (blk * pchip->chip_block_size) + offset;
+ blk_addr = start_addr & ~(pchip->chip_block_size - 1);
+ blk_offset = start_addr - blk_addr;
+ size = pchip->chip_block_size - blk_offset;
+
+ if(size > len)
+ size = len;
+
+ do
+ {
+ if(nandflash_read_page(pchip,start_addr,buffer,size) != FLASH_API_OK)
+ {
+ ret = FLASH_API_ERROR;
+ break;
+ }
+
+ len -= size;
+ if( len )
+ {
+ blk++;
+
+ DBG_PRINTF(">> nand_flash_read_buf - 2 blk=0x%8.8lx, len=%lu\n",
+ blk, len);
+
+ start_addr = blk * pchip->chip_block_size;
+ buffer += size;
+ if(len > pchip->chip_block_size)
+ size = pchip->chip_block_size;
+ else
+ size = len;
+ }
+ } while(len);
+
+ DBG_PRINTF(">> nand_flash_read_buf - ret=%d\n", ret);
+
+ return( ret ) ;
+} /* nand_flash_read_buf */
+
+#if defined(CFG_RAMAPP)
+/***************************************************************************
+ * Function Name: nand_flash_write_buf
+ * Description : Writes to flash memory.
+ * Returns : number of bytes written or FLASH_API_ERROR
+ ***************************************************************************/
+static int nand_flash_write_buf(unsigned short blk, int offset,
+ unsigned char *buffer, int len)
+{
+ int ret = len;
+ PCFE_NAND_CHIP pchip = &g_chip;
+ UINT32 start_addr;
+ UINT32 blk_addr;
+ UINT32 blk_offset;
+ UINT32 size;
+
+ DBG_PRINTF(">> nand_flash_write_buf - 1 blk=0x%8.8lx, offset=%d, len=%d\n",
+ blk, offset, len);
+
+ start_addr = (blk * pchip->chip_block_size) + offset;
+ blk_addr = start_addr & ~(pchip->chip_block_size - 1);
+ blk_offset = start_addr - blk_addr;
+ size = pchip->chip_block_size - blk_offset;
+
+ if(size > len)
+ size = len;
+
+ do
+ {
+ if(nandflash_write_page(pchip,start_addr,buffer,size) != FLASH_API_OK)
+ {
+ ret = ret - len;
+ break;
+ }
+ else
+ {
+ len -= size;
+ if( len )
+ {
+ blk++;
+
+ DBG_PRINTF(">> nand_flash_write_buf- 2 blk=0x%8.8lx, len=%d\n",
+ blk, len);
+
+ offset = 0;
+ start_addr = blk * pchip->chip_block_size;
+ buffer += size;
+ if(len > pchip->chip_block_size)
+ size = pchip->chip_block_size;
+ else
+ size = len;
+ }
+ }
+ } while(len);
+
+ DBG_PRINTF(">> nand_flash_write_buf - ret=%d\n", ret);
+
+ return( ret ) ;
+} /* nand_flash_write_buf */
+
+/***************************************************************************
+ * Function Name: nand_flash_get_memptr
+ * Description : Returns the base MIPS memory address for the specfied flash
+ * sector.
+ * Returns : Base MIPS memory address for the specfied flash sector.
+ ***************************************************************************/
+static unsigned char *nand_flash_get_memptr(unsigned short sector)
+{
+ /* Bad things will happen if this pointer is referenced. But it can
+ * be used for pointer arithmetic to deterine sizes.
+ */
+ return((unsigned char *) (FLASH_BASE + (sector * g_chip.chip_block_size)));
+} /* nand_flash_get_memptr */
+
+/***************************************************************************
+ * Function Name: nand_flash_get_blk
+ * Description : Returns the flash sector for the specfied MIPS address.
+ * Returns : Flash sector for the specfied MIPS address.
+ ***************************************************************************/
+static int nand_flash_get_blk(int addr)
+{
+ return( (addr - FLASH_BASE) / g_chip.chip_block_size );
+} /* nand_flash_get_blk */
+
+/***************************************************************************
+ * Function Name: nand_flash_get_total_size
+ * Description : Returns the number of bytes in the "CFE Linux code"
+ * partition.
+ * Returns : Number of bytes
+ ***************************************************************************/
+static int nand_flash_get_total_size(void)
+{
+ return(g_chip.chip_total_size);
+} /* nand_flash_get_total_size */
+#endif
+
+/***************************************************************************
+ * Function Name: nand_flash_get_sector_size
+ * Description : Returns the number of bytes in the specfied flash sector.
+ * Returns : Number of bytes in the specfied flash sector.
+ ***************************************************************************/
+#if defined(CFG_RAMAPP)
+static
+#endif
+int nand_flash_get_sector_size(unsigned short sector)
+{
+ return(g_chip.chip_block_size);
+} /* nand_flash_get_sector_size */
+
+/***************************************************************************
+ * Function Name: nand_flash_get_numsectors
+ * Description : Returns the number of blocks in the "CFE Linux code"
+ * partition.
+ * Returns : Number of blocks
+ ***************************************************************************/
+#if defined(CFG_RAMAPP)
+static
+#endif
+int nand_flash_get_numsectors(void)
+{
+ return(g_chip.chip_total_size / g_chip.chip_block_size);
+} /* nand_flash_get_numsectors */
+
+
+/***************************************************************************
+ * NAND Flash Implementation Functions
+ ***************************************************************************/
+
+/***************************************************************************
+ * Function Name: nandflash_copy_from_cache
+ * Description : Copies data from the chip NAND cache to a local memory
+ * buffer.
+ * Returns : None.
+ ***************************************************************************/
+static inline void nandflash_copy_from_cache(unsigned char *buffer,
+ int offset, int numbytes)
+{
+ unsigned char *cache = (unsigned char *) NAND_CACHE;
+
+ /* XXX memcpy will only work for 32-bit aligned data */
+ memcpy(buffer, &cache[offset], numbytes);
+} /* nandflash_copy_from_cache */
+
+/***************************************************************************
+ * Function Name: nandflash_copy_from_spare
+ * Description : Copies data from the chip NAND spare registers to a local
+ * memory buffer.
+ * Returns : None.
+ ***************************************************************************/
+static inline void nandflash_copy_from_spare(unsigned char *buffer,
+ int numbytes)
+{
+ unsigned long *spare_area = (unsigned long *) &NAND->NandSpareAreaReadOfs0;
+
+ /* XXX memcpy will only work for 32-bit aligned data */
+ memcpy(buffer, spare_area, numbytes);
+} /* nandflash_copy_from_spare */
+
+#if defined(CFG_RAMAPP)
+/***************************************************************************
+ * Function Name: nandflash_copy_to_cache
+ * Description : Copies data from a local memory buffer to the the chip NAND
+ * cache.
+ * Returns : None.
+ ***************************************************************************/
+static inline void nandflash_copy_to_cache(unsigned char *buffer, int offset,
+ int numbytes)
+{
+ unsigned char *cache = (unsigned char *) NAND_CACHE;
+ unsigned long i;
+
+ for( i = 0; i < numbytes; i += sizeof(long) )
+ *(unsigned long *) &cache[i] =
+ ((unsigned long) buffer[i + 0] << 24) |
+ ((unsigned long) buffer[i + 1] << 16) |
+ ((unsigned long) buffer[i + 2] << 8) |
+ ((unsigned long) buffer[i + 3] << 0);
+} /* nandflash_copy_to_cache */
+
+/***************************************************************************
+ * Function Name: nandflash_copy_to_spare
+ * Description : Copies data from a local memory buffer to the the chip NAND
+ * spare registers.
+ * Returns : None.
+ ***************************************************************************/
+static inline void nandflash_copy_to_spare(unsigned char *buffer,int numbytes)
+{
+ unsigned long *spare_area = (unsigned long *) &NAND->NandSpareAreaWriteOfs0;
+ unsigned long *pbuff = (unsigned long *)buffer;
+ int i;
+
+ for(i=0; i< numbytes / sizeof(unsigned long); ++i)
+ spare_area[i] = pbuff[i];
+} /* nandflash_copy_to_spare */
+#endif
+
+/***************************************************************************
+ * Function Name: nandflash_wait_status
+ * Description : Polls the NAND status register waiting for a condition.
+ * Returns : FLASH_API_OK or FLASH_API_ERROR
+ ***************************************************************************/
+static int nandflash_wait_status(unsigned long status_mask)
+{
+
+ const unsigned long nand_poll_max = 1000000;
+ unsigned long data;
+ unsigned long poll_count = 0;
+ int ret = FLASH_API_OK;
+
+ do
+ {
+ data = NAND->NandIntfcStatus;
+ } while(!(status_mask & data) && (++poll_count < nand_poll_max));
+
+ if(poll_count >= nand_poll_max)
+ {
+ printf("Status wait timeout: nandsts=0x%8.8lx mask=0x%8.8lx, count="
+ "%lu\n", NAND->NandIntfcStatus, status_mask, poll_count);
+ ret = FLASH_API_ERROR;
+ }
+
+ return( ret );
+} /* nandflash_wait_status */
+
+static inline int nandflash_wait_cmd(void)
+{
+ return nandflash_wait_status(NIS_CTLR_READY);
+} /* nandflash_wait_cmd */
+
+static inline int nandflash_wait_device(void)
+{
+ return nandflash_wait_status(NIS_FLASH_READY);
+} /* nandflash_wait_device */
+
+static inline int nandflash_wait_cache(void)
+{
+ return nandflash_wait_status(NIS_CACHE_VALID);
+} /* nandflash_wait_cache */
+
+static inline int nandflash_wait_spare(void)
+{
+ return nandflash_wait_status(NIS_SPARE_VALID);
+} /* nandflash_wait_spare */
+
+#if defined(CFG_RAMAPP)
+/***************************************************************************
+ * Function Name: nandflash_check_ecc
+ * Description : Reads ECC status.
+ * Returns : FLASH_API_OK or FLASH_API_ERROR
+ ***************************************************************************/
+static int nandflash_check_ecc(void)
+{
+ int ret = FLASH_API_OK;
+ UINT32 intrCtrl;
+ UINT32 accessCtrl;
+
+ /* read interrupt status */
+ intrCtrl = NAND_INTR->NandInterrupt;
+ accessCtrl = NAND->NandAccControl;
+
+
+ if( (intrCtrl & NINT_ECC_ERROR_UNC) != 0 )
+ {
+ printf("Uncorrectable ECC Error detected: addr=0x%8.8lx, intrCtrl=0x"
+ "%08X, accessCtrl=0x%08X\n", NAND->NandEccUncAddr, (UINT)intrCtrl,
+ (UINT)accessCtrl);
+ ret = FLASH_API_ERROR;
+ }
+
+ if( (intrCtrl & NINT_ECC_ERROR_CORR) != 0 )
+ {
+ printf("Correctable ECC Error detected: addr=0x%8.8lx, intrCtrl=0x"
+ "%08X, accessCtrl=0x%08X\n", NAND->NandEccCorrAddr, (UINT)intrCtrl,
+ (UINT)accessCtrl);
+ }
+
+ return( ret );
+}
+#else
+static int nandflash_check_ecc(void)
+{
+ return( FLASH_API_OK );
+}
+#endif
+
+/***************************************************************************
+ * Function Name: nandflash_read_spare_area
+ * Description : Reads the spare area for the specified page.
+ * Returns : FLASH_API_OK or FLASH_API_ERROR
+ ***************************************************************************/
+static int nandflash_read_spare_area(PCFE_NAND_CHIP pchip,
+ unsigned long page_addr, unsigned char *buffer, int len)
+{
+ int ret = FLASH_API_ERROR;
+
+ if( len >= pchip->chip_spare_size )
+ {
+ UINT32 steps = pchip->chip_spare_size / CTRLR_SPARE_SIZE;
+ UINT32 i;
+
+ for( i = 0; i < steps; i++ )
+ {
+ NAND->NandCmdAddr = pchip->chip_base + page_addr +
+ (i * CTRLR_CACHE_SIZE);
+ NAND->NandCmdExtAddr = 0;
+ NAND->NandCmdStart = NCMD_SPARE_READ;
+
+ if( (ret = nandflash_wait_cmd()) == FLASH_API_OK )
+ {
+ /* wait until data is available in the spare area registers */
+ if( (ret = nandflash_wait_spare()) == FLASH_API_OK )
+ nandflash_copy_from_spare(buffer + (i * CTRLR_SPARE_SIZE),
+ CTRLR_SPARE_SIZE);
+ else
+ break;
+ }
+ else
+ break;
+ }
+ }
+
+ return ret;
+} /* nandflash_read_spare_area */
+
+#if defined(CFG_RAMAPP)
+/***************************************************************************
+ * Function Name: nandflash_write_spare_area
+ * Description : Reads the spare area for the specified page.
+ * Returns : FLASH_API_OK or FLASH_API_ERROR
+ ***************************************************************************/
+static int nandflash_write_spare_area(PCFE_NAND_CHIP pchip,
+ unsigned long page_addr, unsigned char *buffer, int len)
+{
+ int ret = FLASH_API_OK;
+ unsigned char spare[SPARE_MAX_SIZE];
+
+ if( len <= pchip->chip_spare_size )
+ {
+ UINT32 steps = pchip->chip_spare_size / CTRLR_SPARE_SIZE;
+ UINT32 i;
+
+ memset(spare, 0xff, pchip->chip_spare_size);
+ memcpy(spare, buffer, len);
+
+ for( i = 0; i < steps; i++ )
+ {
+ NAND->NandCmdAddr = pchip->chip_base + page_addr +
+ (i * CTRLR_CACHE_SIZE);
+ NAND->NandCmdExtAddr = 0;
+
+ nandflash_copy_to_spare(spare + (i * CTRLR_SPARE_SIZE),
+ CTRLR_SPARE_SIZE);
+
+ NAND->NandCmdStart = NCMD_PROGRAM_SPARE;
+ if( (ret = nandflash_wait_cmd()) == FLASH_API_OK )
+ {
+ unsigned long sts = NAND->NandIntfcStatus;
+
+ if( (sts & NIS_PGM_ERASE_ERROR) != 0 )
+ {
+ printf("Error writing to spare area, sts=0x%8.8lx\n", sts);
+ nand_mark_bad_blk(pchip, page_addr);
+ ret = FLASH_API_ERROR;
+ }
+ }
+ }
+ }
+ else
+ ret = FLASH_API_ERROR;
+
+ /* Reset spare area to default value. */
+ memset(spare, 0xff, CTRLR_SPARE_SIZE);
+ nandflash_copy_to_spare(spare, CTRLR_SPARE_SIZE);
+
+ return( ret );
+} /* nandflash_write_spare_area */
+#endif
+
+/***************************************************************************
+ * Function Name: nandflash_read_page
+ * Description : Reads up to a NAND block of pages into the specified buffer.
+ * Returns : FLASH_API_OK or FLASH_API_ERROR
+ ***************************************************************************/
+static int nandflash_read_page(PCFE_NAND_CHIP pchip, unsigned long start_addr,
+ unsigned char *buffer, int len)
+{
+ int ret = FLASH_API_ERROR;
+
+ if( len <= pchip->chip_block_size )
+ {
+ UINT32 page_addr = start_addr & ~(pchip->chip_page_size - 1);
+ UINT32 page_offset = start_addr - page_addr;
+ UINT32 size = pchip->chip_page_size - page_offset;
+ UINT32 index = 0;
+
+ /* Verify that the spare area contains a JFFS2 cleanmarker. */
+ if( nand_is_blk_cleanmarker(pchip, page_addr, 0) )
+ {
+ UINT32 i;
+
+ if(size > len)
+ size = len;
+
+ do
+ {
+ for( i = 0, ret = FLASH_API_OK; i < pchip->chip_page_size &&
+ ret == FLASH_API_OK; i += CTRLR_CACHE_SIZE)
+ {
+ /* clear interrupts, so we can check later for ECC errors */
+ NAND_INTR->NandInterrupt = NINT_STS_MASK;
+
+ /* send command */
+ NAND->NandCmdAddr = pchip->chip_base + page_addr + i;
+ NAND->NandCmdExtAddr = 0;
+ NAND->NandCmdStart = NCMD_PAGE_READ;
+
+ if( (ret = nandflash_wait_cmd()) == FLASH_API_OK )
+ {
+ /* wait until data is available in the cache */
+ if( (ret = nandflash_wait_cache()) == FLASH_API_OK )
+ {
+ /* TBD. get return status for ECC errors and
+ * process them.
+ */
+ nandflash_check_ecc(); /* check for ECC errors */
+ }
+
+ if( ret == FLASH_API_OK )
+ {
+ if( i < size )
+ {
+ UINT32 copy_size =
+ (i + CTRLR_CACHE_SIZE <= size)
+ ? CTRLR_CACHE_SIZE : size - i;
+
+ nandflash_copy_from_cache(&buffer[index + i],
+ page_offset, copy_size);
+ }
+ }
+ else
+ {
+ /* TBD. Do something. */
+ }
+ }
+ }
+
+ if(ret != FLASH_API_OK)
+ break;
+
+ page_offset = 0;
+ page_addr += pchip->chip_page_size;
+ index += size;
+ len -= size;
+ if(len > pchip->chip_page_size)
+ size = pchip->chip_page_size;
+ else
+ size = len;
+ } while(len);
+ }
+ else
+ {
+ DBG_PRINTF("nandflash_read_page: cleanmarker not found at 0x%8.8lx\n",
+ page_addr);
+ }
+ }
+
+ return( ret ) ;
+} /* nandflash_read_page */
+
+#if defined(CFG_RAMAPP)
+/***************************************************************************
+ * Function Name: nandflash_write_page
+ * Description : Writes up to a NAND block of pages from the specified buffer.
+ * Returns : FLASH_API_OK or FLASH_API_ERROR
+ ***************************************************************************/
+static int nandflash_write_page(PCFE_NAND_CHIP pchip, unsigned long start_addr,
+ unsigned char *buffer, int len)
+{
+ int ret = FLASH_API_ERROR;
+
+ if( len <= pchip->chip_block_size )
+ {
+ unsigned char xfer_buf[CTRLR_CACHE_SIZE];
+ UINT32 page_addr = start_addr & ~(pchip->chip_page_size - 1);
+ UINT32 page_offset = start_addr - page_addr;
+ UINT32 size = pchip->chip_page_size - page_offset;
+ UINT32 index = 0;
+
+ /* Verify that the spare area contains a JFFS2 cleanmarker. */
+ if( nand_is_blk_cleanmarker(pchip, page_addr, 1) )
+ {
+ UINT32 steps = pchip->chip_page_size / CTRLR_CACHE_SIZE;
+ UINT32 i, xfer_ofs, xfer_size;
+
+ if(size > len)
+ size = len;
+
+ do
+ {
+ for( i = 0, xfer_ofs = 0, xfer_size = 0, ret = FLASH_API_OK;
+ i < steps && ret==FLASH_API_OK; i++)
+ {
+ memset(xfer_buf, 0xff, sizeof(xfer_buf));
+
+ if(size - xfer_ofs > CTRLR_CACHE_SIZE)
+ xfer_size = CTRLR_CACHE_SIZE;
+ else
+ xfer_size = size - xfer_ofs;
+
+ if( xfer_size )
+ memcpy(xfer_buf + page_offset, buffer + index +
+ xfer_ofs, xfer_size);
+
+ xfer_ofs += xfer_size;
+
+ NAND->NandCmdAddr = pchip->chip_base + page_addr +
+ (i * CTRLR_CACHE_SIZE);
+ NAND->NandCmdExtAddr = 0;
+
+ nandflash_copy_to_cache(xfer_buf, 0, CTRLR_CACHE_SIZE);
+
+ NAND->NandCmdStart = NCMD_PROGRAM_PAGE;
+ if( (ret = nandflash_wait_cmd()) == FLASH_API_OK )
+ {
+ unsigned long sts = NAND->NandIntfcStatus;
+
+ if( (sts & NIS_PGM_ERASE_ERROR) != 0 )
+ {
+ printf("Error writing to block, sts=0x%8.8lx\n", sts);
+ nand_mark_bad_blk(pchip,
+ start_addr & ~(pchip->chip_page_size - 1));
+ ret = FLASH_API_ERROR;
+ }
+ }
+ }
+
+ if(ret != FLASH_API_OK)
+ break;
+
+ page_offset = 0;
+ page_addr += pchip->chip_page_size;
+ index += size;
+ len -= size;
+ if(len > pchip->chip_page_size)
+ size = pchip->chip_page_size;
+ else
+ size = len;
+ } while(len);
+ }
+ else
+ DBG_PRINTF("nandflash_write_page: cleanmarker not found at 0x%8.8lx\n",
+ page_addr);
+ }
+
+ return( ret );
+} /* nandflash_write_page */
+
+/***************************************************************************
+ * Function Name: nandflash_block_erase
+ * Description : Erases a block.
+ * Returns : FLASH_API_OK or FLASH_API_ERROR
+ ***************************************************************************/
+static int nandflash_block_erase(PCFE_NAND_CHIP pchip, unsigned long blk_addr )
+{
+
+ int ret = FLASH_API_OK;
+
+ /* send command */
+ NAND->NandCmdAddr = pchip->chip_base + blk_addr;
+ NAND->NandCmdExtAddr = 0;
+ NAND->NandCmdStart = NCMD_BLOCK_ERASE;
+ if( (ret = nandflash_wait_cmd()) == FLASH_API_OK )
+ {
+ unsigned long sts = NAND->NandIntfcStatus;
+
+ if( (sts & NIS_PGM_ERASE_ERROR) != 0 )
+ {
+ printf("Error erasing block 0x%8.8lx, sts=0x%8.8lx\n",
+ blk_addr, sts);
+ nand_mark_bad_blk(pchip, blk_addr);
+ ret = FLASH_API_ERROR;
+ }
+ }
+
+ DBG_PRINTF(">> nandflash_block_erase - addr=0x%8.8lx, ret=%d\n", blk_addr,
+ ret);
+
+ return( ret );
+} /* nandflash_block_erase */
+
+void dump_spare(void);
+void dump_spare(void)
+{
+ PCFE_NAND_CHIP pchip = &g_chip;
+ unsigned char spare[SPARE_MAX_SIZE];
+ unsigned long i;
+
+ for( i = 0; i < pchip->chip_total_size; i += pchip->chip_block_size )
+ {
+ if( nandflash_read_spare_area(pchip, i, spare,
+ pchip->chip_spare_size) == FLASH_API_OK )
+ {
+ printf("%8.8lx: %8.8lx %8.8lx %8.8lx %8.8lx\n", i,
+ *(unsigned long *) &spare[0], *(unsigned long *) &spare[4],
+ *(unsigned long *) &spare[8], *(unsigned long *) &spare[12]);
+ if( pchip->chip_spare_size == SPARE_MAX_SIZE )
+ {
+ printf("%8.8lx: %8.8lx %8.8lx %8.8lx %8.8lx\n", i,
+ *(unsigned long *)&spare[16],*(unsigned long *)&spare[20],
+ *(unsigned long *)&spare[24],*(unsigned long *)&spare[28]);
+ printf("%8.8lx: %8.8lx %8.8lx %8.8lx %8.8lx\n", i,
+ *(unsigned long *)&spare[32],*(unsigned long *)&spare[36],
+ *(unsigned long *)&spare[40],*(unsigned long *)&spare[44]);
+ printf("%8.8lx: %8.8lx %8.8lx %8.8lx %8.8lx\n", i,
+ *(unsigned long *)&spare[48],*(unsigned long *)&spare[52],
+ *(unsigned long *)&spare[56],*(unsigned long *)&spare[60]);
+ }
+ }
+ else
+ printf("Error reading spare 0x%8.8lx\n", i);
+ }
+}
+
+int read_spare_data(int blk, unsigned char *buf, int bufsize);
+int read_spare_data(int blk, unsigned char *buf, int bufsize)
+{
+ PCFE_NAND_CHIP pchip = &g_chip;
+ unsigned char spare[SPARE_MAX_SIZE];
+ unsigned long page_addr = blk * pchip->chip_block_size;
+ unsigned long i, j;
+ int ret;
+
+ if( (ret = nandflash_read_spare_area( pchip, page_addr, spare,
+ pchip->chip_spare_size)) == FLASH_API_OK )
+ {
+ /* Skip spare offsets that are reserved for the ECC. Make spare data
+ * bytes contiguous in the spare buffer.
+ */
+ for( i = 0, j = 0; i < pchip->chip_spare_size; i++ )
+ if( pchip->chip_spare_mask[i] == 0 && j < bufsize )
+ buf[j++] = spare[i];
+ }
+
+ return(ret);
+}
+
+#endif
+
diff --git a/shared/opensource/flash/spiflash.c b/shared/opensource/flash/spiflash.c
new file mode 100755
index 0000000..38f4648
--- /dev/null
+++ b/shared/opensource/flash/spiflash.c
@@ -0,0 +1,969 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the “GPL?, available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+/** Includes. **/
+#ifdef _CFE_
+#include "lib_types.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "bcm_map.h"
+#define printk printf
+#else // linux
+#include <linux/version.h>
+#include <linux/param.h>
+#include <linux/sched.h>
+#include <linux/timer.h>
+#include <linux/kernel.h>
+#include <linux/interrupt.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)
+#include <linux/semaphore.h>
+#endif
+#include <linux/hardirq.h>
+
+#include <bcm_map_part.h>
+#endif
+
+#include "bcmtypes.h"
+#include "bcm_hwdefs.h"
+#include "flash_api.h"
+#include "bcmSpiRes.h"
+
+
+/** Defines. **/
+#define OSL_DELAY(X) \
+ do { { int i; for( i = 0; i < (X) * 500; i++ ) ; } } while(0)
+
+#define MAX_RETRY 3
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#define MAXSECTORS 8192 /* maximum number of sectors supported */
+
+#define FLASH_PAGE_256 256
+#define SECTOR_SIZE_4K (4 * 1024)
+#define SECTOR_SIZE_64K (64 * 1024)
+
+/* Standard Boolean declarations */
+#define TRUE 1
+#define FALSE 0
+
+/* Command codes for the flash_command routine */
+#define FLASH_WRST 0x01 /* write status register */
+#define FLASH_PROG 0x02 /* program data into memory array */
+#define FLASH_READ 0x03 /* read data from memory array */
+#define FLASH_WRDI 0x04 /* reset write enable latch */
+#define FLASH_RDSR 0x05 /* read status register */
+#define FLASH_WREN 0x06 /* set write enable latch */
+#define FLASH_READ_FAST 0x0B /* read data from memory array */
+#define FLASH_SERASE 0x20 /* erase one sector in memory array */
+#define FLASH_BERASE 0xD8 /* erase one block in memory array */
+#define FLASH_RDID 0x9F /* read manufacturer and product id */
+#define FLASH_EN4B 0xB7 /* Enable 4 byte address mode */
+
+/* RDSR return status bit definition */
+#define SR_WPEN 0x80
+#define SR_BP3 0x20
+#define SR_BP2 0x10
+#define SR_BP1 0x08
+#define SR_BP0 0x04
+#define SR_WEN 0x02
+#define SR_RDY 0x01
+
+/* Return codes from flash_status */
+#define STATUS_READY 0 /* ready for action */
+#define STATUS_BUSY 1 /* operation in progress */
+#define STATUS_TIMEOUT 2 /* operation timed out */
+#define STATUS_ERROR 3 /* unclassified but unhappy status */
+
+/* Define different type of flash */
+#define FLASH_UNDEFINED 0
+#define FLASH_SPAN 2
+
+/* SST's manufacturer ID */
+#define SSTPART 0xBF
+/* A list of SST device IDs */
+#define ID_SST25VF016 0x41
+#define ID_SST25VF032 0x4A
+#define ID_SST25VF064 0x4B
+
+/* SPANSION manufacturer IDs */
+#define SPANPART 0x01
+/* SPANSION device ID's */
+#define ID_SPAN25FL016 0x14
+#define ID_SPAN25FL032 0x15
+#define ID_SPAN25FL064 0x16
+#define ID_SPAN25FL128 0x18
+
+/* EON manufacturer ID */
+#define EONPART 0x1C
+/* NUMONYX manufacturer ID */
+#define NUMONYXPART 0x20
+/* AMIC manufacturer ID */
+#define AMICPART 0x37
+/* Macronix manufacturer ID */
+#define MACRONIXPART 0xC2
+/* Winbond's manufacturer ID */
+#define WBPART 0xEF
+
+/* JEDEC device IDs */
+#define ID_M25P16 0x15
+#define ID_M25P32 0x16
+#define ID_M25P64 0x17
+#define ID_M25P128 0x18
+#define ID_M25P256 0x19
+
+#define SPI_MAKE_ID(A,B) \
+ (((unsigned short) (A) << 8) | ((unsigned short) B & 0xff))
+
+#define SPI_FLASH_DEVICES \
+ {{SPI_MAKE_ID(SSTPART, ID_SST25VF016), "SST25VF016"}, \
+ {SPI_MAKE_ID(SSTPART, ID_SST25VF032), "SST25VF032"}, \
+ {SPI_MAKE_ID(SSTPART, ID_SST25VF064), "SST25VF064"}, \
+ {SPI_MAKE_ID(SPANPART, ID_SPAN25FL016), "S25FL016"}, \
+ {SPI_MAKE_ID(SPANPART, ID_SPAN25FL032), "S25FL032"}, \
+ {SPI_MAKE_ID(SPANPART, ID_SPAN25FL064), "S25FL064"}, \
+ {SPI_MAKE_ID(SPANPART, ID_SPAN25FL128), "S25FL128"}, \
+ {SPI_MAKE_ID(WBPART, ID_M25P16), "ID_W25X16"}, \
+ {SPI_MAKE_ID(WBPART, ID_M25P32), "ID_W25X32"}, \
+ {SPI_MAKE_ID(WBPART, ID_M25P64), "ID_W25X64"}, \
+ {SPI_MAKE_ID(WBPART, ID_M25P128), "ID_W25X128"}, \
+ {SPI_MAKE_ID(EONPART, ID_M25P16), "EN25P16"}, \
+ {SPI_MAKE_ID(EONPART, ID_M25P32), "EN25P32"}, \
+ {SPI_MAKE_ID(EONPART, ID_M25P64), "EN25P64"}, \
+ {SPI_MAKE_ID(EONPART, ID_M25P128), "EN25P128"}, \
+ {SPI_MAKE_ID(AMICPART, ID_M25P16), "A25L016"}, \
+ {SPI_MAKE_ID(AMICPART, ID_M25P32), "A25L032"}, \
+ {SPI_MAKE_ID(NUMONYXPART, ID_M25P16), "NMNXM25P16"}, \
+ {SPI_MAKE_ID(NUMONYXPART, ID_M25P32), "NMNXM25P32"}, \
+ {SPI_MAKE_ID(NUMONYXPART, ID_M25P64), "NMNXM25P64"}, \
+ {SPI_MAKE_ID(NUMONYXPART, ID_M25P128), "NMNXM25P128"}, \
+ {SPI_MAKE_ID(MACRONIXPART, ID_M25P16), "MX25L16"}, \
+ {SPI_MAKE_ID(MACRONIXPART, ID_M25P32), "MX25L32"}, \
+ {SPI_MAKE_ID(MACRONIXPART, ID_M25P64), "MX25L64"}, \
+ {SPI_MAKE_ID(MACRONIXPART, ID_M25P128), "MX25L128"}, \
+ {SPI_MAKE_ID(MACRONIXPART, ID_M25P256), "MX25L256"}, \
+ {0,""} \
+ }
+
+/** Structs. **/
+/* A structure for identifying a flash part. There is one for each
+ * of the flash part definitions. We need to keep track of the
+ * sector organization, the address register used, and the size
+ * of the sectors.
+ */
+struct flashinfo {
+ char *name; /* "AT25F512", etc. */
+ unsigned long addr; /* physical address, once translated */
+ int nsect; /* # of sectors */
+ struct {
+ long size; /* # of bytes in this sector */
+ long base; /* offset from beginning of device */
+ } sec[MAXSECTORS]; /* per-sector info */
+};
+
+struct flash_name_from_id {
+ unsigned short fnfi_id;
+ char fnfi_name[30];
+};
+
+
+/** Prototypes. **/
+static int my_spi_read( unsigned char *msg_buf, int prependcnt, int nbytes );
+static int my_spi_write( unsigned char *msg_buf, int nbytes );
+
+int spi_flash_init(flash_device_info_t **flash_info);
+static int spi_flash_sector_erase_int(unsigned short sector);
+static int spi_flash_reset(void);
+static int spi_flash_read_buf(unsigned short sector, int offset,
+ unsigned char *buffer, int nbytes);
+static int spi_flash_ub(unsigned short sector);
+static int spi_flash_write(unsigned short sector, int offset,
+ unsigned char *buffer, int nbytes);
+static int spi_flash_write_buf(unsigned short sector, int offset,
+ unsigned char *buffer, int nbytes);
+static int spi_flash_get_numsectors(void);
+static int spi_flash_get_sector_size(unsigned short sector);
+static unsigned char *spi_get_flash_memptr(unsigned short sector);
+static unsigned char *spi_flash_get_memptr(unsigned short sector);
+static int spi_flash_status(void);
+static unsigned short spi_flash_get_device_id(unsigned short sector);
+static int spi_flash_get_blk(int addr);
+static int spi_flash_get_total_size(void);
+static int spi_flash_en4b(void);
+
+/** Variables. **/
+static flash_device_info_t flash_spi_dev =
+ {
+ 0xffff,
+ FLASH_IFC_SPI,
+ "",
+ spi_flash_sector_erase_int,
+ spi_flash_read_buf,
+ spi_flash_write_buf,
+ spi_flash_get_numsectors,
+ spi_flash_get_sector_size,
+ spi_flash_get_memptr,
+ spi_flash_get_blk,
+ spi_flash_get_total_size
+ };
+
+static struct flash_name_from_id fnfi[] = SPI_FLASH_DEVICES;
+
+/* the controller will handle operati0ns that are greater than the FIFO size
+ code that relies on READ_BUF_LEN_MAX, READ_BUF_LEN_MIN or spi_max_op_len
+ could be changed */
+#define READ_BUF_LEN_MAX 544 /* largest of the maximum transaction sizes for SPI */
+#define READ_BUF_LEN_MIN 60 /* smallest of the maximum transaction sizes for SPI */
+/* this is the slave ID of the SPI flash for use with the SPI controller */
+#define SPI_FLASH_SLAVE_DEV_ID 0
+/* clock defines for the flash */
+#define SPI_FLASH_DEF_CLOCK 781000
+
+/* default to smallest transaction size - updated later */
+static int spi_max_op_len = READ_BUF_LEN_MIN;
+static int fastRead = TRUE;
+static int flash_page_size = FLASH_PAGE_256;
+
+/* default to legacy controller - updated later */
+static int spi_flash_clock = SPI_FLASH_DEF_CLOCK;
+static int spi_flash_busnum = LEG_SPI_BUS_NUM;
+
+#ifndef _CFE_
+static DECLARE_MUTEX(spi_flash_lock);
+static bool bSpiFlashSlaveRes = FALSE;
+#endif
+
+static struct flashinfo meminfo; /* Flash information structure */
+static int totalSize = 0;
+static int addr32 = FALSE;
+
+static int my_spi_read(unsigned char *msg_buf, int prependcnt, int nbytes)
+{
+ int status;
+
+#ifndef _CFE_
+ if ( FALSE == bSpiFlashSlaveRes )
+#endif
+ {
+ status = BcmSpi_Read(msg_buf, prependcnt, nbytes, spi_flash_busnum, SPI_FLASH_SLAVE_DEV_ID, spi_flash_clock);
+ }
+#ifndef _CFE_
+ else
+ {
+ /* the Linux SPI framework provides a non blocking mechanism for SPI transfers. While waiting for a spi
+ transaction to complete the kernel will look to see if another process can run. This scheduling
+ can only occur if kernel preemption is active. The SPI flash interfaces can be run when kernel
+ preemption is enabled or disabled. When kernel preemption is disabled we cannot use the framework */
+ if ( in_atomic() )
+ status = BcmSpi_Read(msg_buf, prependcnt, nbytes, spi_flash_busnum, SPI_FLASH_SLAVE_DEV_ID, spi_flash_clock);
+ else
+ status = BcmSpiSyncTrans(NULL, msg_buf, prependcnt, nbytes, spi_flash_busnum, SPI_FLASH_SLAVE_DEV_ID);
+ }
+#endif
+
+ return status;
+}
+
+static int my_spi_write(unsigned char *msg_buf, int nbytes)
+{
+ int status;
+
+#ifndef _CFE_
+ if ( FALSE == bSpiFlashSlaveRes )
+#endif
+ {
+ status = BcmSpi_Write(msg_buf, nbytes, spi_flash_busnum, SPI_FLASH_SLAVE_DEV_ID, spi_flash_clock);
+ }
+#ifndef _CFE_
+ else
+ {
+ /* the Linux SPI framework provides a non blocking mechanism for SPI transfers. While waiting for a spi
+ transaction to complete the kernel will look to see if another process can run. This scheduling
+ can only occur if kernel preemtion is active. The SPI flash interfaces can be run when kernel
+ preemption is enabled or disabled. When kernel preemption is disabled we cannot use the framework */
+ if ( in_atomic() )
+ status = BcmSpi_Write(msg_buf, nbytes, spi_flash_busnum, SPI_FLASH_SLAVE_DEV_ID, spi_flash_clock);
+ else
+ status = BcmSpiSyncTrans(msg_buf, NULL, 0, nbytes, spi_flash_busnum, SPI_FLASH_SLAVE_DEV_ID);
+ }
+#endif
+ return status;
+}
+
+
+/*********************************************************************/
+/* Init_flash is used to build a sector table. This information is */
+/* translated from erase_block information to base:offset information*/
+/* for each individual sector. This information is then stored */
+/* in the meminfo structure, and used throughout the driver to access*/
+/* sector information. */
+/* */
+/* This is more efficient than deriving the sector base:offset */
+/* information every time the memory map switches (since on the */
+/* development platform can only map 64k at a time). If the entire */
+/* flash memory array can be mapped in, then the addition static */
+/* allocation for the meminfo structure can be eliminated, but the */
+/* drivers will have to be re-written. */
+/* */
+/* The meminfo struct occupies 44 bytes of heap space, depending */
+/* on the value of the define MAXSECTORS. Adjust to suit */
+/* application */
+/*********************************************************************/
+
+int spi_flash_init(flash_device_info_t **flash_info)
+{
+ struct flash_name_from_id *fnfi_ptr;
+ int i=0, count=0;
+ int basecount=0L;
+ unsigned short device_id;
+ int sectorsize = 0;
+ int numsector = 0;
+
+#if defined(_BCM96816_) || defined(CONFIG_BCM96816)
+ uint32 miscStrapBus = MISC->miscStrapBus;
+
+ if ( miscStrapBus & MISC_STRAP_BUS_LS_SPIM_ENABLED )
+ {
+ spi_flash_busnum = LEG_SPI_BUS_NUM;
+ if ( miscStrapBus & MISC_STRAP_BUS_SPI_CLK_FAST )
+ {
+ spi_flash_clock = 20000000;
+ }
+ else
+ {
+ spi_flash_clock = 781000;
+ }
+ }
+ else
+ {
+ spi_flash_busnum = HS_SPI_BUS_NUM;
+ if ( miscStrapBus & MISC_STRAP_BUS_SPI_CLK_FAST )
+ {
+ spi_flash_clock = 40000000;
+ }
+ else
+ {
+ spi_flash_clock = 20000000;
+ }
+ }
+#endif
+#if defined(_BCM96328_) || defined(CONFIG_BCM96328) || defined(_BCM96362_) || defined(CONFIG_BCM96362)
+ spi_flash_busnum = HS_SPI_BUS_NUM;
+ spi_flash_clock = 40000000;
+#endif
+#if defined(_BCM96368_) || defined(CONFIG_BCM96368)
+ uint32 miscStrapBus = GPIO->StrapBus;
+
+ if ( miscStrapBus & (1 << 6) )
+ spi_flash_clock = 20000000;
+ else
+ spi_flash_clock = 781000;
+#endif
+
+ /* retrieve the maximum read/write transaction length from the SPI controller */
+ spi_max_op_len = BcmSpi_GetMaxRWSize( spi_flash_busnum );
+
+ if (HS_SPI_BUS_NUM == spi_flash_busnum)
+ flash_spi_dev.flash_type = FLASH_IFC_HS_SPI;
+
+ *flash_info = &flash_spi_dev;
+
+#if 0
+ /*
+ * in case of flash corrupt, the following steps can erase the flash
+ * 1. jumper USE_SPI_SLAVE to make SPI in slave mode
+ * 2. start up JTAG debuger and remove the USE_SPI_SLAVE jumper
+ * 3. run the following code to erase the flash
+ */
+ flash_sector_erase_int(0);
+ flash_sector_erase_int(1);
+ printk("flash_init: erase all sectors\n");
+ return FLASH_API_OK;
+#endif
+
+ flash_spi_dev.flash_device_id = device_id = spi_flash_get_device_id(0);
+
+ switch( device_id >> 8 ) {
+ case SSTPART:
+ sectorsize = SECTOR_SIZE_4K;
+ switch ((unsigned char)(device_id & 0x00ff)) {
+ case ID_SST25VF016:
+ numsector = 512;
+ break;
+ case ID_SST25VF032:
+ numsector = 1024;
+ break;
+ case ID_SST25VF064:
+ numsector = 2048;
+ break;
+ }
+ break;
+
+ case SPANPART:
+ sectorsize = SECTOR_SIZE_64K;
+ switch ((unsigned short)(device_id & 0x00ff)) {
+ case ID_SPAN25FL016:
+ numsector = 32;
+ break;
+ case ID_SPAN25FL032:
+ numsector = 64;
+ break;
+ case ID_SPAN25FL064:
+ numsector = 128;
+ break;
+ case ID_SPAN25FL128:
+ numsector = 256;
+ break;
+ }
+ break;
+
+ case EONPART:
+ sectorsize = SECTOR_SIZE_64K;
+ switch ((unsigned short)(device_id & 0x00ff)) {
+ case ID_M25P16:
+ numsector = 32;
+ break;
+ case ID_M25P32:
+ numsector = 64;
+ break;
+ case ID_M25P64:
+ numsector = 128;
+ break;
+ case ID_M25P128:
+ numsector = 256;
+ break;
+ }
+ break;
+
+ case NUMONYXPART:
+ case MACRONIXPART:
+ case WBPART:
+ case AMICPART:
+ sectorsize = SECTOR_SIZE_4K;
+ switch ((unsigned short)(device_id & 0x00ff)) {
+ case ID_M25P16:
+ numsector = 512;
+ break;
+ case ID_M25P32:
+ numsector = 1024;
+ break;
+ case ID_M25P64:
+ numsector = 2048;
+ break;
+ case ID_M25P128:
+ numsector = 4096;
+ break;
+ case ID_M25P256:
+ addr32 = TRUE;
+ numsector = 8192;
+ break;
+ }
+ break;
+
+ default:
+ meminfo.addr = 0L;
+ meminfo.nsect = 1;
+ meminfo.sec[0].size = SECTOR_SIZE_4K;
+ meminfo.sec[0].base = 0x00000;
+ return FLASH_API_ERROR;
+ }
+
+ if ( addr32 ) {
+ /* Enable 4 byte mode */
+ spi_flash_en4b();
+ }
+
+ meminfo.addr = 0L;
+ meminfo.nsect = numsector;
+ for (i = 0; i < numsector; i++) {
+ meminfo.sec[i].size = sectorsize;
+ meminfo.sec[i].base = basecount;
+ basecount += meminfo.sec[i].size;
+ count++;
+ }
+ totalSize = meminfo.sec[count-1].base + meminfo.sec[count-1].size;
+
+ for( fnfi_ptr = fnfi; fnfi_ptr->fnfi_id != 0; fnfi_ptr++ ) {
+ if( fnfi_ptr->fnfi_id == device_id ) {
+ strcpy( flash_spi_dev.flash_device_name, fnfi_ptr->fnfi_name );
+ break;
+ }
+ }
+
+ if ( fastRead )
+ BcmSpi_SetFlashCtrl(FLASH_READ_FAST, 1, 1, spi_flash_busnum, SPI_FLASH_SLAVE_DEV_ID);
+ else
+ BcmSpi_SetFlashCtrl(FLASH_READ, 1, 0, spi_flash_busnum, SPI_FLASH_SLAVE_DEV_ID);
+
+ return (FLASH_API_OK);
+}
+
+/*********************************************************************/
+/* Flash_sector_erase_int() wait until the erase is completed before */
+/* returning control to the calling function. This can be used in */
+/* cases which require the program to hold until a sector is erased, */
+/* without adding the wait check external to this function. */
+/*********************************************************************/
+
+static int spi_flash_sector_erase_int(unsigned short sector)
+{
+ unsigned char buf[6];
+ unsigned int cmd_length;
+ unsigned int addr;
+
+#ifndef _CFE_
+ down(&spi_flash_lock);
+#endif
+
+ /* set device to write enabled */
+ spi_flash_ub(sector);
+
+ /* erase the sector */
+ addr = (unsigned int) spi_get_flash_memptr(sector);
+
+ cmd_length = 0;
+ if (meminfo.sec[sector].size == SECTOR_SIZE_4K)
+ buf[cmd_length++] = FLASH_SERASE;
+ else
+ buf[cmd_length++] = FLASH_BERASE;
+
+ if ( addr32 )
+ buf[cmd_length++] = (unsigned char)((addr & 0xff000000) >> 24);
+ buf[cmd_length++] = (unsigned char)((addr & 0x00ff0000) >> 16);
+ buf[cmd_length++] = (unsigned char)((addr & 0x0000ff00) >> 8);
+ buf[cmd_length++] = (unsigned char)(addr & 0x000000ff);
+
+ /* check device is ready */
+ if (my_spi_write(buf, cmd_length) == SPI_STATUS_OK) {
+ while (spi_flash_status() != STATUS_READY);
+ }
+
+ spi_flash_reset();
+
+#ifndef _CFE_
+ up(&spi_flash_lock);
+#endif
+
+ return(FLASH_API_OK);
+}
+
+/*********************************************************************/
+/* flash_reset() will reset the flash device to reading array data. */
+/* It is good practice to call this function after autoselect */
+/* sequences had been performed. */
+/*********************************************************************/
+
+static int spi_flash_en4b(void)
+{
+ unsigned char buf[4];
+
+ /* set device to write disabled */
+ buf[0] = FLASH_EN4B;
+ my_spi_write(buf, 1);
+ while (spi_flash_status() != STATUS_READY);
+
+ return(FLASH_API_OK);
+}
+
+/*********************************************************************/
+/* flash_reset() will reset the flash device to reading array data. */
+/* It is good practice to call this function after autoselect */
+/* sequences had been performed. */
+/*********************************************************************/
+
+static int spi_flash_reset(void)
+{
+ unsigned char buf[4];
+
+ /* set device to write disabled */
+ buf[0] = FLASH_WRDI;
+ my_spi_write(buf, 1);
+ while (spi_flash_status() != STATUS_READY);
+
+ return(FLASH_API_OK);
+}
+
+/*********************************************************************/
+/* flash_read_buf() reads buffer of data from the specified */
+/* offset from the sector parameter. */
+/*********************************************************************/
+
+static int spi_flash_read_buf(unsigned short sector, int offset,
+ unsigned char *buffer, int nbytes)
+{
+ unsigned char buf[READ_BUF_LEN_MAX];
+ unsigned int cmd_length;
+ unsigned int addr;
+ int maxread;
+
+#ifndef _CFE_
+ down(&spi_flash_lock);
+#endif
+
+ addr = (unsigned int) spi_get_flash_memptr(sector);
+ addr += offset;
+
+ while (nbytes > 0) {
+ maxread = (nbytes < spi_max_op_len) ? nbytes : spi_max_op_len;
+
+ cmd_length = 0;
+ if ( fastRead )
+ buf[cmd_length++] = FLASH_READ_FAST;
+ else
+ buf[cmd_length++] = FLASH_READ;
+ if ( addr32 )
+ buf[cmd_length++] = (unsigned char)((addr & 0xff000000) >> 24);
+ buf[cmd_length++] = (unsigned char)((addr & 0x00ff0000) >> 16);
+ buf[cmd_length++] = (unsigned char)((addr & 0x0000ff00) >> 8);
+ buf[cmd_length++] = (unsigned char)(addr & 0x000000ff);
+
+ /* Send dummy byte for Fast Read */
+ if ( fastRead )
+ buf[cmd_length++] = (unsigned char)0xff;
+
+ my_spi_read(buf, cmd_length, maxread);
+
+ while (spi_flash_status() != STATUS_READY);
+
+ memcpy(buffer, buf, maxread);
+ buffer += maxread;
+ nbytes -= maxread;
+ addr += maxread;
+ }
+
+#ifndef _CFE_
+ up(&spi_flash_lock);
+#endif
+
+ return (FLASH_API_OK);
+}
+
+/*********************************************************************/
+/* flash_ub() places the flash into unlock bypass mode. This */
+/* is REQUIRED to be called before any of the other unlock bypass */
+/* commands will become valid (most will be ignored without first */
+/* calling this function. */
+/*********************************************************************/
+
+static int spi_flash_ub(unsigned short sector)
+{
+ unsigned char buf[4];
+
+ do {
+ buf[0] = FLASH_RDSR;
+ if (my_spi_read(buf, 1, 1) == SPI_STATUS_OK) {
+ while (spi_flash_status() != STATUS_READY);
+ if (buf[0] & (SR_BP3|SR_BP2|SR_BP1|SR_BP0)) {
+ /* Sector is write protected. Unprotect it */
+ buf[0] = FLASH_WREN;
+ if (my_spi_write(buf, 1) == SPI_STATUS_OK) {
+ buf[0] = FLASH_WRST;
+ buf[1] = 0;
+ if (my_spi_write(buf, 2) == SPI_STATUS_OK)
+ while (spi_flash_status() != STATUS_READY);
+ }
+ }
+ else {
+ break;
+ }
+ }
+ else {
+ break;
+ }
+ } while (1);
+
+ /* set device to write enabled */
+ buf[0] = FLASH_WREN;
+
+ /* check device is ready */
+ if (my_spi_write(buf, 1) == SPI_STATUS_OK) {
+ while (spi_flash_status() != STATUS_READY);
+ do {
+ buf[0] = FLASH_RDSR;
+ if (my_spi_read(buf, 1, 1) == SPI_STATUS_OK) {
+ while (spi_flash_status() != STATUS_READY);
+ if (buf[0] & SR_WEN) {
+ break;
+ }
+ }
+ else {
+ break;
+ }
+ } while (1);
+ }
+
+ return(FLASH_API_OK);
+}
+
+/*********************************************************************/
+/* flash_write_buf() utilizes */
+/* the unlock bypass mode of the flash device. This can remove */
+/* significant overhead from the bulk programming operation, and */
+/* when programming bulk data a sizeable performance increase can be */
+/* observed. */
+/*********************************************************************/
+
+static int spi_flash_write(unsigned short sector, int offset,
+ unsigned char *buffer, int nbytes)
+{
+ unsigned char buf[FLASH_PAGE_256 + 6];
+ unsigned int cmd_length;
+ unsigned int addr;
+ int maxwrite;
+ int pagelimit;
+ int bytes_written = 0;
+
+#ifndef _CFE_
+ down(&spi_flash_lock);
+#endif
+
+ addr = (unsigned int) spi_get_flash_memptr(sector);
+ addr += offset;
+
+ while (nbytes > 0) {
+ spi_flash_ub(sector); /* enable write */
+
+ cmd_length = 0;
+ buf[cmd_length++] = FLASH_PROG;
+ if ( addr32 )
+ buf[cmd_length++] = (unsigned char)((addr & 0xff000000) >> 24);
+ buf[cmd_length++] = (unsigned char)((addr & 0x00ff0000) >> 16);
+ buf[cmd_length++] = (unsigned char)((addr & 0x0000ff00) >> 8);
+ buf[cmd_length++] = (unsigned char)(addr & 0x000000ff);
+
+ /* set length to the smaller of controller limit (spi_max_op_len) or nbytes
+ spi_max_op_len considers both controllers */
+ maxwrite = (nbytes < (spi_max_op_len - cmd_length)) ? nbytes : (spi_max_op_len - cmd_length);
+ /* maxwrite is limit to page boundary */
+ pagelimit = flash_page_size - (addr & (flash_page_size - 1));
+ maxwrite = (maxwrite < pagelimit) ? maxwrite : pagelimit;
+
+ memcpy(&buf[cmd_length], buffer, maxwrite);
+ my_spi_write(buf, maxwrite + cmd_length);
+
+ while (spi_flash_status() != STATUS_READY);
+
+ buffer += maxwrite;
+ nbytes -= maxwrite;
+ addr += maxwrite;
+ bytes_written += maxwrite;
+ }
+
+ spi_flash_reset();
+
+#ifndef _CFE_
+ up(&spi_flash_lock);
+#endif
+
+ return( bytes_written );
+}
+
+/*********************************************************************/
+/* flash_write_buf() utilizes */
+/* the unlock bypass mode of the flash device. This can remove */
+/* significant overhead from the bulk programming operation, and */
+/* when programming bulk data a sizeable performance increase can be */
+/* observed. */
+/*********************************************************************/
+static int spi_flash_write_buf(unsigned short sector, int offset,
+ unsigned char *buffer, int nbytes)
+{
+ int ret;
+
+ ret = spi_flash_write(sector, offset, buffer, nbytes);
+
+ if( ret == FLASH_API_ERROR )
+ printk( "Flash write error. Verify failed\n" );
+
+ return( ret );
+}
+
+/*********************************************************************/
+/* Usefull funtion to return the number of sectors in the device. */
+/* Can be used for functions which need to loop among all the */
+/* sectors, or wish to know the number of the last sector. */
+/*********************************************************************/
+
+static int spi_flash_get_numsectors(void)
+{
+ return meminfo.nsect;
+}
+
+/*********************************************************************/
+/* flash_get_sector_size() is provided for cases in which the size */
+/* of a sector is required by a host application. The sector size */
+/* (in bytes) is returned in the data location pointed to by the */
+/* 'size' parameter. */
+/*********************************************************************/
+
+static int spi_flash_get_sector_size(unsigned short sector)
+{
+ return meminfo.sec[sector].size;
+}
+
+/*********************************************************************/
+/* The purpose of get_flash_memptr() is to return a memory pointer */
+/* which points to the beginning of memory space allocated for the */
+/* flash. All function pointers are then referenced from this */
+/* pointer. */
+/* */
+/* Different systems will implement this in different ways: */
+/* possibilities include: */
+/* - A direct memory pointer */
+/* - A pointer to a memory map */
+/* - A pointer to a hardware port from which the linear */
+/* address is translated */
+/* - Output of an MMU function / service */
+/* */
+/* Also note that this function expects the pointer to a specific */
+/* sector of the device. This can be provided by dereferencing */
+/* the pointer from a translated offset of the sector from a */
+/* global base pointer (e.g. flashptr = base_pointer + sector_offset)*/
+/* */
+/* Important: Many AMD flash devices need both bank and or sector */
+/* address bits to be correctly set (bank address bits are A18-A16, */
+/* and sector address bits are A18-A12, or A12-A15). Flash parts */
+/* which do not need these bits will ignore them, so it is safe to */
+/* assume that every part will require these bits to be set. */
+/*********************************************************************/
+
+static unsigned char *spi_get_flash_memptr(unsigned short sector)
+{
+ unsigned char *memptr = (unsigned char*)
+ (FLASH_BASE + meminfo.sec[sector].base);
+
+ return (memptr);
+}
+
+static unsigned char *spi_flash_get_memptr(unsigned short sector)
+{
+ return( spi_get_flash_memptr(sector) );
+}
+
+/*********************************************************************/
+/* Flash_status return an appropriate status code */
+/*********************************************************************/
+
+static int spi_flash_status(void)
+{
+ unsigned char buf[4];
+ int retry = 10;
+
+ /* check device is ready */
+ do {
+ buf[0] = FLASH_RDSR;
+ if (my_spi_read(buf, 1, 1) == SPI_STATUS_OK) {
+ if (!(buf[0] & SR_RDY)) {
+ return STATUS_READY;
+ }
+ } else {
+ return STATUS_ERROR;
+ }
+ OSL_DELAY(10);
+ } while (retry--);
+
+ return STATUS_TIMEOUT;
+}
+
+/*********************************************************************/
+/* flash_get_device_id() return the device id of the component. */
+/*********************************************************************/
+
+static unsigned short spi_flash_get_device_id(unsigned short sector)
+{
+ unsigned char buf[4];
+
+ buf[0] = FLASH_RDID;
+ my_spi_read(buf, 1, 3);
+ while (spi_flash_status() != STATUS_READY);
+ buf[1] = buf[2];
+
+ /* return manufacturer code and device code */
+ return( *(unsigned short *)&buf[0] );
+}
+
+/*********************************************************************/
+/* The purpose of flash_get_blk() is to return a the block number */
+/* for a given memory address. */
+/*********************************************************************/
+
+static int spi_flash_get_blk(int addr)
+{
+ int blk_start, i;
+ int last_blk = spi_flash_get_numsectors();
+ int relative_addr = addr - (int) FLASH_BASE;
+
+ for(blk_start=0, i=0; i < relative_addr && blk_start < last_blk; blk_start++)
+ i += spi_flash_get_sector_size(blk_start);
+
+ if( (unsigned int)i > (unsigned int)relative_addr ) {
+ blk_start--; // last blk, dec by 1
+ } else {
+ if( blk_start == last_blk )
+ {
+ printk("Address is too big.\n");
+ blk_start = -1;
+ }
+ }
+
+ return( blk_start );
+}
+
+/************************************************************************/
+/* The purpose of flash_get_total_size() is to return the total size of */
+/* the flash */
+/************************************************************************/
+static int spi_flash_get_total_size(void)
+{
+ return totalSize;
+}
+
+
+#ifndef _CFE_
+static int __init BcmSpiflash_init(void)
+{
+ int flashType;
+
+ /* If serial flash is present then register the device. Otherwise do nothing */
+ flashType = flash_get_flash_type();
+ if ((FLASH_IFC_SPI == flashType) || (FLASH_IFC_HS_SPI == flashType))
+ {
+ /* register the device */
+ BcmSpiReserveSlave(spi_flash_busnum, SPI_FLASH_SLAVE_DEV_ID, spi_flash_clock);
+ bSpiFlashSlaveRes = TRUE;
+ }
+
+ return 0;
+}
+module_init(BcmSpiflash_init);
+
+static void __exit BcmSpiflash_exit(void)
+{
+ bSpiFlashSlaveRes = FALSE;
+}
+module_exit(BcmSpiflash_exit);
+#endif
+
diff --git a/shared/opensource/include/bcm963xx/6328_cpu.h b/shared/opensource/include/bcm963xx/6328_cpu.h
new file mode 100755
index 0000000..8dfef4c
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/6328_cpu.h
@@ -0,0 +1,150 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+#ifndef __BCM6328_CPU_H
+#define __BCM6328_CPU_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+#************************************************************************
+#* Coprocessor 0 Register Names
+#************************************************************************
+*/
+#define C0_BCM_CONFIG $22
+
+/*
+# Select 1
+# Bit 31: unused
+# Bits 30:25 MMU Size (Num TLB entries-1)
+# Bits 24:22 ICache sets/way (2^n * 64)
+# Bits 21:19 ICache Line size (2^(n+1) bytes) 0=No Icache
+# Bits 18:16 ICache Associativity (n+1) way
+# Bits 15:13 DCache sets/way (2^n * 64)
+# Bits 12:10 DCache Line size (2^(n+1) bytes) 0=No Dcache
+# Bits 9:7 DCache Associativity (n+1) way
+# Bits 6:4 unused
+# Bit 3: 1=At least 1 watch register
+# Bit 2: 1=MIPS16 code compression implemented
+# Bit 1: 1=EJTAG implemented
+# Bit 0: 1=FPU implemented
+*/
+#define CP0_CFG_ISMSK (0x7 << 22)
+#define CP0_CFG_ISSHF 22
+#define CP0_CFG_ILMSK (0x7 << 19)
+#define CP0_CFG_ILSHF 19
+#define CP0_CFG_IAMSK (0x7 << 16)
+#define CP0_CFG_IASHF 16
+#define CP0_CFG_DSMSK (0x7 << 13)
+#define CP0_CFG_DSSHF 13
+#define CP0_CFG_DLMSK (0x7 << 10)
+#define CP0_CFG_DLSHF 10
+#define CP0_CFG_DAMSK (0x7 << 7)
+#define CP0_CFG_DASHF 7
+
+/*
+#************************************************************************
+#* Coprocessor 0 Broadcom Config Register Bits
+#************************************************************************
+*/
+#define CP0_BCM_CFG_ICSHEN (0x1 << 31)
+#define CP0_BCM_CFG_DCSHEN (0x1 << 30)
+#define CP0_BCM_CFG_BTHD (0x1 << 21)
+#define CP0_BCM_CFG_CLF (0x1 << 20)
+#define CP0_BCM_CFG_NBK (0x1 << 17)
+
+/*
+#************************************************************************
+#* Coprocessor 0 CMT Interrupt Register
+#************************************************************************
+*/
+#define CP0_CMT_XIR_4 (0x1 << 31)
+#define CP0_CMT_XIR_3 (0x1 << 30)
+#define CP0_CMT_XIR_2 (0x1 << 29)
+#define CP0_CMT_XIR_1 (0x1 << 28)
+#define CP0_CMT_XIR_0 (0x1 << 27)
+#define CP0_CMT_SIR_1 (0x1 << 16)
+#define CP0_CMT_SIR_0 (0x1 << 15)
+#define CP0_CMT_NMIR_TP1 (0x1 << 1)
+#define CP0_CMT_NMIR_TP0 (0x1 << 0)
+
+/*
+#************************************************************************
+#* Coprocessor 0 CMT Control Register
+#************************************************************************
+*/
+#define CP0_CMT_DSU_TP1 (0x1 << 30)
+#define CP0_CMT_TPS_SHFT 16
+#define CP0_CMT_TPS_MASK (0xF << CP0_CMT_TPS_SHFT)
+#define CP0_CMT_PRIO_TP1 (0x1 << 5)
+#define CP0_CMT_PRIO_TP0 (0x1 << 4)
+#define CP0_CMT_RSTSE (0x1 << 0)
+
+/*
+#************************************************************************
+#* Coprocessor 0 CMT Local Register
+#************************************************************************
+*/
+#define CP0_CMT_TPID (0x1 << 31)
+
+/*
+#************************************************************************
+#* MIPS Registers
+#************************************************************************
+*/
+
+#define MIPS_BASE_BOOT 0xbfa00000
+#define MIPS_BASE 0xff400000
+
+#define MIPS_RAC_CR0 0x00 // RAC Configuration Register
+#define MIPS_RAC_CR1 0x08 // RAC Configuration Register 1
+#define RAC_FLH (1 << 8)
+#define RAC_DPF (1 << 6)
+#define RAC_NCH (1 << 5)
+#define RAC_C_INV (1 << 4)
+#define RAC_PF_D (1 << 3)
+#define RAC_PF_I (1 << 2)
+#define RAC_D (1 << 1)
+#define RAC_I (1 << 0)
+
+#define MIPS_RAC_ARR 0x04 // RAC Address Range Register
+#define RAC_UPB_SHFT 16
+#define RAC_LWB_SHFT 0
+
+#define MIPS_LMB_CR 0x1C // LMB Control Register
+#define LMB_EN (1 << 0)
+
+#define MIPS_SBR 0x20 // System Base Register
+
+#define MIPS_TP0_ALT_BV 0x30000
+#define MIPS_TP1_ALT_BV 0x38000
+#define ENABLE_ALT_BV (1 << 19)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/shared/opensource/include/bcm963xx/6328_intr.h b/shared/opensource/include/bcm963xx/6328_intr.h
new file mode 100755
index 0000000..e4197d1
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/6328_intr.h
@@ -0,0 +1,120 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+#ifndef __6328_INTR_H
+#define __6328_INTR_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#define INTERRUPT_ID_SOFTWARE_0 0
+#define INTERRUPT_ID_SOFTWARE_1 1
+
+/*=====================================================================*/
+/* BCM6328 Timer Interrupt Level Assignments */
+/*=====================================================================*/
+#define MIPS_TIMER_INT 7
+
+/*=====================================================================*/
+/* Peripheral ISR Table Offset */
+/*=====================================================================*/
+#define INTERNAL_ISR_TABLE_OFFSET 8
+#define INTERNAL_HIGH_ISR_TABLE_OFFSET (INTERNAL_ISR_TABLE_OFFSET + 32)
+
+/*=====================================================================*/
+/* Logical Peripheral Interrupt IDs */
+/*=====================================================================*/
+
+#define INTERRUPT_ID_NAND (INTERNAL_ISR_TABLE_OFFSET + 0)
+#define INTERRUPT_ID_PCM (INTERNAL_ISR_TABLE_OFFSET + 1)
+#define INTERRUPT_ID_PCM_DMA_0 (INTERNAL_ISR_TABLE_OFFSET + 2)
+#define INTERRUPT_ID_PCM_DMA_1 (INTERNAL_ISR_TABLE_OFFSET + 3)
+#define INTERRUPT_ID_USBS (INTERNAL_ISR_TABLE_OFFSET + 4)
+#define INTERRUPT_ID_USB_CNTL_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 5)
+#define INTERRUPT_ID_USB_CNTL_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 6)
+#define INTERRUPT_ID_USB_BULK_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 7)
+#define INTERRUPT_ID_USB_BULK_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 8)
+#define INTERRUPT_ID_USB_ISO_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 9)
+#define INTERRUPT_ID_USB_ISO_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 10)
+#define INTERRUPT_ID_DG (INTERNAL_ISR_TABLE_OFFSET + 11)
+#define INTERRUPT_ID_EPHY (INTERNAL_ISR_TABLE_OFFSET + 12)
+#define INTERRUPT_ID_EPHY_ENERGY_0_N (INTERNAL_ISR_TABLE_OFFSET + 13)
+#define INTERRUPT_ID_EPHY_ENERGY_1_N (INTERNAL_ISR_TABLE_OFFSET + 14)
+#define INTERRUPT_ID_EPHY_ENERGY_2_N (INTERNAL_ISR_TABLE_OFFSET + 15)
+#define INTERRUPT_ID_EPHY_ENERGY_3_N (INTERNAL_ISR_TABLE_OFFSET + 16)
+#define INTERRUPT_ID_EPHY_ENERGY_0 (INTERNAL_ISR_TABLE_OFFSET + 17)
+#define INTERRUPT_ID_EPHY_ENERGY_1 (INTERNAL_ISR_TABLE_OFFSET + 18)
+#define INTERRUPT_ID_EPHY_ENERGY_2 (INTERNAL_ISR_TABLE_OFFSET + 19)
+#define INTERRUPT_ID_EPHY_ENERGY_3 (INTERNAL_ISR_TABLE_OFFSET + 20)
+#define INTERRUPT_ID_XDSL (INTERNAL_ISR_TABLE_OFFSET + 21)
+#define INTERRUPT_ID_PCIE_EP (INTERNAL_ISR_TABLE_OFFSET + 22)
+#define INTERRUPT_ID_PCIE_RC (INTERNAL_ISR_TABLE_OFFSET + 23)
+#define INTERRUPT_ID_EXTERNAL_0 (INTERNAL_ISR_TABLE_OFFSET + 24)
+#define INTERRUPT_ID_EXTERNAL_1 (INTERNAL_ISR_TABLE_OFFSET + 25)
+#define INTERRUPT_ID_EXTERNAL_2 (INTERNAL_ISR_TABLE_OFFSET + 26)
+#define INTERRUPT_ID_EXTERNAL_3 (INTERNAL_ISR_TABLE_OFFSET + 27)
+#define INTERRUPT_ID_UART (INTERNAL_ISR_TABLE_OFFSET + 28)
+#define INTERRUPT_ID_HS_SPIM (INTERNAL_ISR_TABLE_OFFSET + 29)
+#define INTERRUPT_ID_WAKE_ON_IRQ (INTERNAL_ISR_TABLE_OFFSET + 30)
+#define INTERRUPT_ID_TIMER (INTERNAL_ISR_TABLE_OFFSET + 31)
+#define INTERRUPT_ID_ENETSW_RX_DMA_0 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 0)
+#define INTERRUPT_ID_ENETSW_RX_DMA_1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 1)
+#define INTERRUPT_ID_ENETSW_RX_DMA_2 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 2)
+#define INTERRUPT_ID_ENETSW_RX_DMA_3 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 3)
+#define INTERRUPT_ID_UART1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 7)
+#define INTERRUPT_ID_ENETSW_SYS (INTERNAL_HIGH_ISR_TABLE_OFFSET + 8)
+#define INTERRUPT_ID_USBH (INTERNAL_HIGH_ISR_TABLE_OFFSET + 9)
+#define INTERRUPT_ID_USBH20 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 10)
+#define INTERRUPT_ID_ATM_DMA_0 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 11)
+#define INTERRUPT_ID_ATM_DMA_1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 12)
+#define INTERRUPT_ID_ATM_DMA_2 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 13)
+#define INTERRUPT_ID_ATM_DMA_3 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 14)
+#define INTERRUPT_ID_ATM_DMA_4 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 15)
+#define INTERRUPT_ID_ATM_DMA_5 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 16)
+#define INTERRUPT_ID_ATM_DMA_6 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 17)
+#define INTERRUPT_ID_ATM_DMA_7 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 18)
+#define INTERRUPT_ID_ATM_DMA_8 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 19)
+#define INTERRUPT_ID_ATM_DMA_9 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 20)
+#define INTERRUPT_ID_ATM_DMA_10 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 21)
+#define INTERRUPT_ID_ATM_DMA_11 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 22)
+#define INTERRUPT_ID_ATM_DMA_12 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 23)
+#define INTERRUPT_ID_ATM_DMA_13 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 24)
+#define INTERRUPT_ID_ATM_DMA_14 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 25)
+#define INTERRUPT_ID_ATM_DMA_15 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 26)
+#define INTERRUPT_ID_ATM_DMA_16 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 27)
+#define INTERRUPT_ID_ATM_DMA_17 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 28)
+#define INTERRUPT_ID_ATM_DMA_18 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 29)
+#define INTERRUPT_ID_ATM_DMA_19 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 30)
+#define INTERRUPT_ID_SAR (INTERNAL_HIGH_ISR_TABLE_OFFSET + 31)
+
+#define INTERRUPT_ID_LAST INTERRUPT_ID_SAR
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* __BCM6328_H */
+
+
diff --git a/shared/opensource/include/bcm963xx/6328_map_part.h b/shared/opensource/include/bcm963xx/6328_map_part.h
new file mode 100755
index 0000000..be199a5
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/6328_map_part.h
@@ -0,0 +1,1325 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+#ifndef __BCM6328_MAP_H
+#define __BCM6328_MAP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "bcmtypes.h"
+
+#define PERF_BASE 0xb0000000 /* chip control registers */
+#define TIMR_BASE 0xb0000040 /* timer registers */
+#define GPIO_BASE 0xb0000080 /* gpio registers */
+#define UART_BASE 0xb0000100 /* uart registers */
+#define UART1_BASE 0xb0000120 /* uart registers */
+#define NAND_REG_BASE 0xb0000200 /* NAND registers */
+#define NAND_CACHE_BASE 0xb0000400
+#define LED_BASE 0xb0000800 /* LED control registers */
+#define HSSPIM_BASE 0xb0001000 /* High-Speed SPI registers */
+#define MISC_BASE 0xb0001800 /* Miscellaneous Registers */
+#define USB_CTL_BASE 0xb0002400 /* USB 2.0 device control registers */
+#define USB_EHCI_BASE 0x10002500 /* USB host registers */
+#define USB_OHCI_BASE 0x10002600 /* USB host registers */
+#define USBH_CFG_BASE 0xb0002700
+#define DDR_BASE 0xb0003000 /* Memory control registers */
+#define SAR_DMA_BASE 0xb000b800 /* ATM SAR DMA control registers */
+#define PCIE_BASE 0xb0e40000
+
+typedef struct DDRPhyControl {
+ uint32 REVISION; /* 0x00 */
+ uint32 CLK_PM_CTRL; /* 0x04 */
+ uint32 unused0[2]; /* 0x08-0x10 */
+ uint32 PLL_STATUS; /* 0x10 */
+ uint32 PLL_CONFIG; /* 0x14 */
+ uint32 PLL_PRE_DIVIDER; /* 0x18 */
+ uint32 PLL_DIVIDER; /* 0x1c */
+ uint32 PLL_CONTROL1; /* 0x20 */
+ uint32 PLL_CONTROL2; /* 0x24 */
+ uint32 PLL_SS_EN; /* 0x28 */
+ uint32 PLL_SS_CFG; /* 0x2c */
+ uint32 STATIC_VDL_OVERRIDE; /* 0x30 */
+ uint32 DYNAMIC_VDL_OVERRIDE; /* 0x34 */
+ uint32 IDLE_PAD_CONTROL; /* 0x38 */
+ uint32 ZQ_PVT_COMP_CTL; /* 0x3c */
+ uint32 DRIVE_PAD_CTL; /* 0x40 */
+ uint32 CLOCK_REG_CONTROL; /* 0x44 */
+ uint32 unused1[46];
+} DDRPhyControl;
+
+typedef struct DDRPhyByteLaneControl {
+ uint32 REVISION; /* 0x00 */
+ uint32 VDL_CALIBRATE; /* 0x04 */
+ uint32 VDL_STATUS; /* 0x08 */
+ uint32 unused; /* 0x0c */
+ uint32 VDL_OVERRIDE_0; /* 0x10 */
+ uint32 VDL_OVERRIDE_1; /* 0x14 */
+ uint32 VDL_OVERRIDE_2; /* 0x18 */
+ uint32 VDL_OVERRIDE_3; /* 0x1c */
+ uint32 VDL_OVERRIDE_4; /* 0x20 */
+ uint32 VDL_OVERRIDE_5; /* 0x24 */
+ uint32 VDL_OVERRIDE_6; /* 0x28 */
+ uint32 VDL_OVERRIDE_7; /* 0x2c */
+ uint32 READ_CONTROL; /* 0x30 */
+ uint32 READ_FIFO_STATUS; /* 0x34 */
+ uint32 READ_FIFO_CLEAR; /* 0x38 */
+ uint32 IDLE_PAD_CONTROL; /* 0x3c */
+ uint32 DRIVE_PAD_CTL; /* 0x40 */
+ uint32 CLOCK_PAD_DISABLE; /* 0x44 */
+ uint32 WR_PREAMBLE_MODE; /* 0x48 */
+ uint32 CLOCK_REG_CONTROL; /* 0x4C */
+ uint32 unused0[44];
+} DDRPhyByteLaneControl;
+
+typedef struct DDRControl {
+ uint32 CNFG; /* 0x000 */
+ uint32 CSST; /* 0x004 */
+ uint32 CSEND; /* 0x008 */
+ uint32 unused; /* 0x00c */
+ uint32 ROW00_0; /* 0x010 */
+ uint32 ROW00_1; /* 0x014 */
+ uint32 ROW01_0; /* 0x018 */
+ uint32 ROW01_1; /* 0x01c */
+ uint32 unused0[4];
+ uint32 ROW20_0; /* 0x030 */
+ uint32 ROW20_1; /* 0x034 */
+ uint32 ROW21_0; /* 0x038 */
+ uint32 ROW21_1; /* 0x03c */
+ uint32 unused1[4];
+ uint32 COL00_0; /* 0x050 */
+ uint32 COL00_1; /* 0x054 */
+ uint32 COL01_0; /* 0x058 */
+ uint32 COL01_1; /* 0x05c */
+ uint32 unused2[4];
+ uint32 COL20_0; /* 0x070 */
+ uint32 COL20_1; /* 0x074 */
+ uint32 COL21_0; /* 0x078 */
+ uint32 COL21_1; /* 0x07c */
+ uint32 unused3[4];
+ uint32 BNK10; /* 0x090 */
+ uint32 BNK32; /* 0x094 */
+ uint32 unused4[26];
+ uint32 DCMD; /* 0x100 */
+#define DCMD_CS1 (1 << 5)
+#define DCMD_CS0 (1 << 4)
+#define DCMD_SET_SREF 4
+ uint32 DMODE_0; /* 0x104 */
+ uint32 DMODE_1; /* 0x108 */
+#define DMODE_1_DRAMSLEEP (1 << 11)
+ uint32 CLKS; /* 0x10c */
+ uint32 ODT; /* 0x110 */
+ uint32 TIM1_0; /* 0x114 */
+ uint32 TIM1_1; /* 0x118 */
+ uint32 TIM2; /* 0x11c */
+ uint32 CTL_CRC; /* 0x120 */
+ uint32 DOUT_CRC; /* 0x124 */
+ uint32 DIN_CRC; /* 0x128 */
+ uint32 unused5[53];
+
+ DDRPhyControl PhyControl; /* 0x200 */
+ DDRPhyByteLaneControl PhyByteLane0Control; /* 0x300 */
+ DDRPhyByteLaneControl PhyByteLane1Control; /* 0x400 */
+ DDRPhyByteLaneControl PhyByteLane2Control; /* 0x500 */
+ DDRPhyByteLaneControl PhyByteLane3Control; /* 0x600 */
+ uint32 unused6[64];
+
+ uint32 GCFG; /* 0x800 */
+ uint32 LBIST_CFG; /* 0x804 */
+ uint32 LBIST_SEED; /* 0x808 */
+ uint32 ARB; /* 0x80c */
+ uint32 PI_GCF; /* 0x810 */
+ uint32 PI_UBUS_CTL; /* 0x814 */
+ uint32 PI_MIPS_CTL; /* 0x818 */
+ uint32 PI_DSL_MIPS_CTL; /* 0x81c */
+ uint32 PI_DSL_PHY_CTL; /* 0x820 */
+ uint32 PI_UBUS_ST; /* 0x824 */
+ uint32 PI_MIPS_ST; /* 0x828 */
+ uint32 PI_DSL_MIPS_ST; /* 0x82c */
+ uint32 PI_DSL_PHY_ST; /* 0x830 */
+ uint32 PI_UBUS_SMPL; /* 0x834 */
+ uint32 TESTMODE; /* 0x838 */
+ uint32 TEST_CFG1; /* 0x83c */
+ uint32 TEST_PAT; /* 0x840 */
+ uint32 TEST_COUNT; /* 0x844 */
+ uint32 TEST_CURR_COUNT; /* 0x848 */
+ uint32 TEST_ADDR_UPDT; /* 0x84c */
+ uint32 TEST_ADDR; /* 0x850 */
+ uint32 TEST_DATA0; /* 0x854 */
+ uint32 TEST_DATA1; /* 0x858 */
+ uint32 TEST_DATA2; /* 0x85c */
+ uint32 TEST_DATA3; /* 0x860 */
+} DDRControl;
+
+#define DDR ((volatile DDRControl * const) DDR_BASE)
+
+/*
+** Peripheral Controller
+*/
+
+#define IRQ_BITS 64
+typedef struct {
+ uint64 IrqMask;
+ uint64 IrqStatus;
+} IrqControl_t;
+
+typedef struct PerfControl {
+ uint32 RevID; /* (00) word 0 */
+ uint32 blkEnables; /* (04) word 1 */
+#define ROBOSW_CLK_EN (1 << 11)
+#define PCIE_CLK_EN (1 << 10)
+#define HS_SPI_CLK_EN (1 << 9)
+#define USBH_CLK_EN (1 << 8)
+#define USBD_CLK_EN (1 << 7)
+#define PCM_CLK_EN (1 << 6)
+#define SAR_CLK_EN (1 << 5)
+#define MIPS_CLK_EN (1 << 4)
+#define ADSL_CLK_EN (1 << 3)
+#define ADSL_AFE_EN (1 << 2)
+#define ADSL_QPROC_EN (1 << 1)
+#define PHYMIPS_CLK_EN (1 << 0)
+
+ uint32 unused0; /* (08) word 2 */
+ uint32 deviceTimeoutEn; /* (0c) word 3 */
+ uint32 softResetB; /* (10) word 4 */
+#define SOFT_RST_PCIE_HARD (1 << 10)
+#define SOFT_RST_PCIE_EXT (1 << 9)
+#define SOFT_RST_PCIE (1 << 8)
+#define SOFT_RST_PCIE_CORE (1 << 7)
+#define SOFT_RST_PCM (1 << 6)
+#define SOFT_RST_USBH (1 << 5)
+#define SOFT_RST_USBD (1 << 4)
+#define SOFT_RST_SWITCH (1 << 3)
+#define SOFT_RST_SAR (1 << 2)
+#define SOFT_RST_EPHY (1 << 1)
+#define SOFT_RST_SPI (1 << 0)
+
+ uint32 diagControl; /* (14) word 5 */
+ uint32 ExtIrqCfg; /* (18) word 6*/
+ uint32 unused1; /* (1c) word 7 */
+#define EI_SENSE_SHFT 0
+#define EI_STATUS_SHFT 4
+#define EI_CLEAR_SHFT 8
+#define EI_MASK_SHFT 12
+#define EI_INSENS_SHFT 16
+#define EI_LEVEL_SHFT 20
+
+ IrqControl_t IrqControl[2];
+} PerfControl;
+
+#define PERF ((volatile PerfControl * const) PERF_BASE)
+
+/*
+** Timer
+*/
+typedef struct Timer {
+ uint16 unused0;
+ byte TimerMask;
+#define TIMER0EN 0x01
+#define TIMER1EN 0x02
+#define TIMER2EN 0x04
+ byte TimerInts;
+#define TIMER0 0x01
+#define TIMER1 0x02
+#define TIMER2 0x04
+#define WATCHDOG 0x08
+ uint32 TimerCtl0;
+ uint32 TimerCtl1;
+ uint32 TimerCtl2;
+#define TIMERENABLE 0x80000000
+#define RSTCNTCLR 0x40000000
+ uint32 TimerCnt0;
+ uint32 TimerCnt1;
+ uint32 TimerCnt2;
+ uint32 WatchDogDefCount;
+
+ /* Write 0xff00 0x00ff to Start timer
+ * Write 0xee00 0x00ee to Stop and re-load default count
+ * Read from this register returns current watch dog count
+ */
+ uint32 WatchDogCtl;
+
+ /* Number of 50-MHz ticks for WD Reset pulse to last */
+ uint32 WDResetCount;
+
+ uint32 SoftRst;
+#define SOFT_RESET 0x00000001 // 0
+} Timer;
+
+#define TIMER ((volatile Timer * const) TIMR_BASE)
+
+/*
+** UART
+*/
+typedef struct UartChannel {
+ byte unused0;
+ byte control;
+#define BRGEN 0x80 /* Control register bit defs */
+#define TXEN 0x40
+#define RXEN 0x20
+#define LOOPBK 0x10
+#define TXPARITYEN 0x08
+#define TXPARITYEVEN 0x04
+#define RXPARITYEN 0x02
+#define RXPARITYEVEN 0x01
+
+ byte config;
+#define XMITBREAK 0x40
+#define BITS5SYM 0x00
+#define BITS6SYM 0x10
+#define BITS7SYM 0x20
+#define BITS8SYM 0x30
+#define ONESTOP 0x07
+#define TWOSTOP 0x0f
+ /* 4-LSBS represent STOP bits/char
+ * in 1/8 bit-time intervals. Zero
+ * represents 1/8 stop bit interval.
+ * Fifteen represents 2 stop bits.
+ */
+ byte fifoctl;
+#define RSTTXFIFOS 0x80
+#define RSTRXFIFOS 0x40
+ /* 5-bit TimeoutCnt is in low bits of this register.
+ * This count represents the number of characters
+ * idle times before setting receive Irq when below threshold
+ */
+ uint32 baudword;
+ /* When divide SysClk/2/(1+baudword) we should get 32*bit-rate
+ */
+
+ byte txf_levl; /* Read-only fifo depth */
+ byte rxf_levl; /* Read-only fifo depth */
+ byte fifocfg; /* Upper 4-bits are TxThresh, Lower are
+ * RxThreshold. Irq can be asserted
+ * when rx fifo> thresh, txfifo<thresh
+ */
+ byte prog_out; /* Set value of DTR (Bit0), RTS (Bit1)
+ * if these bits are also enabled to GPIO_o
+ */
+#define DTREN 0x01
+#define RTSEN 0x02
+
+ byte unused1;
+ byte DeltaIPEdgeNoSense; /* Low 4-bits, set corr bit to 1 to
+ * detect irq on rising AND falling
+ * edges for corresponding GPIO_i
+ * if enabled (edge insensitive)
+ */
+ byte DeltaIPConfig_Mask; /* Upper 4 bits: 1 for posedge sense
+ * 0 for negedge sense if
+ * not configured for edge
+ * insensitive (see above)
+ * Lower 4 bits: Mask to enable change
+ * detection IRQ for corresponding
+ * GPIO_i
+ */
+ byte DeltaIP_SyncIP; /* Upper 4 bits show which bits
+ * have changed (may set IRQ).
+ * read automatically clears bit
+ * Lower 4 bits are actual status
+ */
+
+ uint16 intMask; /* Same Bit defs for Mask and status */
+ uint16 intStatus;
+#define DELTAIP 0x0001
+#define TXUNDERR 0x0002
+#define TXOVFERR 0x0004
+#define TXFIFOTHOLD 0x0008
+#define TXREADLATCH 0x0010
+#define TXFIFOEMT 0x0020
+#define RXUNDERR 0x0040
+#define RXOVFERR 0x0080
+#define RXTIMEOUT 0x0100
+#define RXFIFOFULL 0x0200
+#define RXFIFOTHOLD 0x0400
+#define RXFIFONE 0x0800
+#define RXFRAMERR 0x1000
+#define RXPARERR 0x2000
+#define RXBRK 0x4000
+
+ uint16 unused2;
+ uint16 Data; /* Write to TX, Read from RX */
+ /* bits 11:8 are BRK,PAR,FRM errors */
+
+ uint32 unused3;
+ uint32 unused4;
+} Uart;
+
+#define UART ((volatile Uart * const) UART_BASE)
+
+/*
+** Gpio Controller
+*/
+
+#pragma pack(push, 4)
+typedef struct GpioControl {
+ uint32 GPIODirHi; /* 0 */
+ uint32 GPIODir; /* 4 */
+ uint32 GPIOioHi; /* 8 */
+ uint32 GPIOio; /* C */
+ uint32 unused0; /* 10 */
+ uint32 SpiSlaveCfg; /* 14 */
+ uint32 GPIOMode; /* 18 */
+ uint64 PinMuxSel; /* 1C */
+#define SERIAL_LED_DATA 6
+#define SERIAL_LED_CLK 7
+#define INET_ACT_LED 11
+#define EPHY0_SPD_LED 17
+#define EPHY1_SPD_LED 18
+#define EPHY2_SPD_LED 19
+#define EPHY3_SPD_LED 20
+#define EPHY0_ACT_LED 25
+#define EPHY1_ACT_LED 26
+#define EPHY2_ACT_LED 27
+#define EPHY3_ACT_LED 28
+
+#define PINMUX_SERIAL_LED_DATA ((uint64)2 << (SERIAL_LED_DATA << 1))
+#define PINMUX_SERIAL_LED_CLK ((uint64)2 << (SERIAL_LED_CLK << 1))
+#define PINMUX_INET_ACT_LED ((uint64)1 << (INET_ACT_LED << 1))
+#define PINMUX_EPHY0_ACT_LED ((uint64)1 << (EPHY0_ACT_LED << 1))
+#define PINMUX_EPHY1_ACT_LED ((uint64)1 << (EPHY1_ACT_LED << 1))
+#define PINMUX_EPHY2_ACT_LED ((uint64)1 << (EPHY2_ACT_LED << 1))
+#define PINMUX_EPHY3_ACT_LED ((uint64)1 << (EPHY3_ACT_LED << 1))
+
+ uint32 PinMuxSelOther; /* 24 */
+#define SEL_USB 12
+#define PINMUX_SEL_USB_MASK (3 << SEL_USB)
+#define PINMUX_SEL_USB_HOST (1 << SEL_USB)
+#define PINMUX_SEL_USB_DEV (2 << SEL_USB)
+
+ uint32 TestControl; /* 28 */
+ uint32 unused2; /* 2C */
+ uint32 RoboSWLEDControl; /* 30 */
+ uint32 RoboSWLEDLSR; /* 34 */
+ uint32 unused3; /* 38 */
+ uint32 RoboswEphyCtrl; /* 3C */
+#define EPHY_AUTO_PWR_DOWN_EN (1<<29)
+#define EPHY_IDDQ_FROM_PHY (1<<28)
+#define EPHY_PLL_LOCK (1<<27)
+#define EPHY_ATEST_25MHZ_EN (1<<26)
+#define EPHY_PWR_DOWN_DLL (1<<25)
+#define EPHY_PWR_DOWN_BIAS (1<<24)
+#define EPHY_PWR_DOWN_TX_4 (1<<23)
+#define EPHY_PWR_DOWN_TX_3 (1<<22)
+#define EPHY_PWR_DOWN_TX_2 (1<<21)
+#define EPHY_PWR_DOWN_TX_1 (1<<20)
+#define EPHY_PWR_DOWN_RX_4 (1<<19)
+#define EPHY_PWR_DOWN_RX_3 (1<<18)
+#define EPHY_PWR_DOWN_RX_2 (1<<17)
+#define EPHY_PWR_DOWN_RX_1 (1<<16)
+#define EPHY_PWR_DOWN_SD_4 (1<<15)
+#define EPHY_PWR_DOWN_SD_3 (1<<14)
+#define EPHY_PWR_DOWN_SD_2 (1<<13)
+#define EPHY_PWR_DOWN_SD_1 (1<<12)
+#define EPHY_PWR_DOWN_RD_4 (1<<11)
+#define EPHY_PWR_DOWN_RD_3 (1<<10)
+#define EPHY_PWR_DOWN_RD_2 (1<<9)
+#define EPHY_PWR_DOWN_RD_1 (1<<8)
+#define EPHY_PWR_DOWN_4 (1<<7)
+#define EPHY_PWR_DOWN_3 (1<<6)
+#define EPHY_PWR_DOWN_2 (1<<5)
+#define EPHY_PWR_DOWN_1 (1<<4)
+#define EPHY_RST_4 (1<<3)
+#define EPHY_RST_3 (1<<2)
+#define EPHY_RST_2 (1<<1)
+#define EPHY_RST_1 (1<<0)
+ uint32 RoboswSwitchCtrl; /* 40 */
+#define RSW_SPI_MODE (1<<11)
+#define RSW_BC_SUPP_EN (1<<10)
+#define RSW_CLK_FREQ_MASK (3<<8)
+#define RSW_ENF_DFX_FLOW (1<<7)
+#define RSW_ENH_DFX_FLOW (1<<6)
+#define RSW_GRX_0_SETUP (1<<5)
+#define RSW_GTX_0_SETUP (1<<4)
+#define RSW_HW_FWDG_EN (1<<3)
+#define RSW_QOS_EN (1<<2)
+#define RSW_WD_CLR_EN (1<<1)
+#define RSW_MII_DUMB_FWDG_EN (1<<0)
+
+ uint32 RegFileTmCtl; /* 44 */
+
+ uint32 RingOscCtrl0; /* 48 */
+#define RING_OSC_256_CYCLES 8
+#define RING_OSC_512_CYCLES 9
+#define RING_OSC_1024_CYCLES 10
+
+ uint32 RingOscCtrl1; /* 4C */
+#define RING_OSC_ENABLE_MASK (0x0f<<24)
+#define RING_OSC_ENABLE_SHIFT 24
+#define RING_OSC_MAX 4
+#define RING_OSC_COUNT_RESET (0x1<<23)
+#define RING_OSC_SELECT_MASK (0x7<<20)
+#define RING_OSC_SELECT_SHIFT 20
+#define RING_OSC_IRQ (0x1<<18)
+#define RING_OSC_COUNTER_OVERFLOW (0x1<<17)
+#define RING_OSC_COUNTER_BUSY (0x1<<16)
+#define RING_OSC_COUNT_MASK 0x0000ffff
+
+ uint32 unused4[6]; /* 50 - 64 */
+ uint32 DieRevID; /* 68 */
+ uint32 unused5; /* 6c */
+ uint32 DiagSelControl; /* 70 */
+ uint32 DiagReadBack; /* 74 */
+ uint32 DiagReadBackHi; /* 78 */
+ uint32 DiagMiscControl; /* 7c */
+} GpioControl;
+#pragma pack(pop)
+
+#define GPIO ((volatile GpioControl * const) GPIO_BASE)
+
+/* Number to mask conversion macro used for GPIODir and GPIOio */
+#define GPIO_NUM_MAX 32
+#define GPIO_NUM_TO_MASK(X) ( (((X) & BP_GPIO_NUM_MASK) < GPIO_NUM_MAX) ? (1 << ((X) & BP_GPIO_NUM_MASK)) : (0) )
+
+/*
+** High-Speed SPI Controller
+*/
+
+#define __mask(end, start) (((1 << ((end - start) + 1)) - 1) << start)
+typedef struct HsSpiControl {
+
+ uint32 hs_spiGlobalCtrl; // 0x0000
+#define HS_SPI_MOSI_IDLE (1 << 18)
+#define HS_SPI_CLK_POLARITY (1 << 17)
+#define HS_SPI_CLK_GATE_SSOFF (1 << 16)
+#define HS_SPI_PLL_CLK_CTRL (8)
+#define HS_SPI_PLL_CLK_CTRL_MASK __mask(15, HS_SPI_PLL_CLK_CTRL)
+#define HS_SPI_SS_POLARITY (0)
+#define HS_SPI_SS_POLARITY_MASK __mask(7, HS_SPI_SS_POLARITY)
+
+ uint32 hs_spiExtTrigCtrl; // 0x0004
+#define HS_SPI_TRIG_RAW_STATE (24)
+#define HS_SPI_TRIG_RAW_STATE_MASK __mask(31, HS_SPI_TRIG_RAW_STATE)
+#define HS_SPI_TRIG_LATCHED (16)
+#define HS_SPI_TRIG_LATCHED_MASK __mask(23, HS_SPI_TRIG_LATCHED)
+#define HS_SPI_TRIG_SENSE (8)
+#define HS_SPI_TRIG_SENSE_MASK __mask(15, HS_SPI_TRIG_SENSE)
+#define HS_SPI_TRIG_TYPE (0)
+#define HS_SPI_TRIG_TYPE_MASK __mask(7, HS_SPI_TRIG_TYPE)
+#define HS_SPI_TRIG_TYPE_EDGE (0)
+#define HS_SPI_TRIG_TYPE_LEVEL (1)
+
+ uint32 hs_spiIntStatus; // 0x0008
+#define HS_SPI_IRQ_PING1_USER (28)
+#define HS_SPI_IRQ_PING1_USER_MASK __mask(31, HS_SPI_IRQ_PING1_USER)
+#define HS_SPI_IRQ_PING0_USER (24)
+#define HS_SPI_IRQ_PING0_USER_MASK __mask(27, HS_SPI_IRQ_PING0_USER)
+
+#define HS_SPI_IRQ_PING1_CTRL_INV (1 << 12)
+#define HS_SPI_IRQ_PING1_POLL_TOUT (1 << 11)
+#define HS_SPI_IRQ_PING1_TX_UNDER (1 << 10)
+#define HS_SPI_IRQ_PING1_RX_OVER (1 << 9)
+#define HS_SPI_IRQ_PING1_CMD_DONE (1 << 8)
+
+#define HS_SPI_IRQ_PING0_CTRL_INV (1 << 4)
+#define HS_SPI_IRQ_PING0_POLL_TOUT (1 << 3)
+#define HS_SPI_IRQ_PING0_TX_UNDER (1 << 2)
+#define HS_SPI_IRQ_PING0_RX_OVER (1 << 1)
+#define HS_SPI_IRQ_PING0_CMD_DONE (1 << 0)
+
+ uint32 hs_spiIntStatusMasked; // 0x000C
+#define HS_SPI_IRQSM__PING1_USER (28)
+#define HS_SPI_IRQSM__PING1_USER_MASK __mask(31, HS_SPI_IRQSM__PING1_USER)
+#define HS_SPI_IRQSM__PING0_USER (24)
+#define HS_SPI_IRQSM__PING0_USER_MASK __mask(27, HS_SPI_IRQSM__PING0_USER)
+
+#define HS_SPI_IRQSM__PING1_CTRL_INV (1 << 12)
+#define HS_SPI_IRQSM__PING1_POLL_TOUT (1 << 11)
+#define HS_SPI_IRQSM__PING1_TX_UNDER (1 << 10)
+#define HS_SPI_IRQSM__PING1_RX_OVER (1 << 9)
+#define HS_SPI_IRQSM__PING1_CMD_DONE (1 << 8)
+
+#define HS_SPI_IRQSM__PING0_CTRL_INV (1 << 4)
+#define HS_SPI_IRQSM__PING0_POLL_TOUT (1 << 3)
+#define HS_SPI_IRQSM__PING0_TX_UNDER (1 << 2)
+#define HS_SPI_IRQSM__PING0_RX_OVER (1 << 1)
+#define HS_SPI_IRQSM__PING0_CMD_DONE (1 << 0)
+
+ uint32 hs_spiIntMask; // 0x0010
+#define HS_SPI_IRQM_PING1_USER (28)
+#define HS_SPI_IRQM_PING1_USER_MASK __mask(31, HS_SPI_IRQM_PING1_USER)
+#define HS_SPI_IRQM_PING0_USER (24)
+#define HS_SPI_IRQM_PING0_USER_MASK __mask(27, HS_SPI_IRQM_PING0_USER)
+
+#define HS_SPI_IRQM_PING1_CTRL_INV (1 << 12)
+#define HS_SPI_IRQM_PING1_POLL_TOUT (1 << 11)
+#define HS_SPI_IRQM_PING1_TX_UNDER (1 << 10)
+#define HS_SPI_IRQM_PING1_RX_OVER (1 << 9)
+#define HS_SPI_IRQM_PING1_CMD_DONE (1 << 8)
+
+#define HS_SPI_IRQM_PING0_CTRL_INV (1 << 4)
+#define HS_SPI_IRQM_PING0_POLL_TOUT (1 << 3)
+#define HS_SPI_IRQM_PING0_TX_UNDER (1 << 2)
+#define HS_SPI_IRQM_PING0_RX_OVER (1 << 1)
+#define HS_SPI_IRQM_PING0_CMD_DONE (1 << 0)
+
+#define HS_SPI_INTR_CLEAR_ALL (0xFF001F1F)
+
+ uint32 hs_spiFlashCtrl; // 0x0014
+#define HS_SPI_FCTRL_MB_ENABLE (1 << 23)
+#define HS_SPI_FCTRL_SS_NUM (20)
+#define HS_SPI_FCTRL_SS_NUM_MASK __mask(22, HS_SPI_FCTRL_SS_NUM)
+#define HS_SPI_FCTRL_PROFILE_NUM (16)
+#define HS_SPI_FCTRL_PROFILE_NUM_MASK __mask(18, HS_SPI_FCTRL_PROFILE_NUM)
+#define HS_SPI_FCTRL_DUMMY_BYTES (10)
+#define HS_SPI_FCTRL_DUMMY_BYTES_MASK __mask(11, HS_SPI_FCTRL_DUMMY_BYTES)
+#define HS_SPI_FCTRL_ADDR_BYTES (8)
+#define HS_SPI_FCTRL_ADDR_BYTES_MASK __mask(9, HS_SPI_FCTRL_ADDR_BYTES)
+#define HS_SPI_FCTRL_ADDR_BYTES_2 (0)
+#define HS_SPI_FCTRL_ADDR_BYTES_3 (1)
+#define HS_SPI_FCTRL_ADDR_BYTES_4 (2)
+#define HS_SPI_FCTRL_READ_OPCODE (0)
+#define HS_SPI_FCTRL_READ_OPCODE_MASK __mask(7, HS_SPI_FCTRL_READ_OPCODE)
+
+ uint32 hs_spiFlashAddrBase; // 0x0018
+
+ char fill0[0x80 - 0x18];
+
+ uint32 hs_spiPP_0_Cmd; // 0x0080
+#define HS_SPI_PP_SS_NUM (12)
+#define HS_SPI_PP_SS_NUM_MASK __mask(14, HS_SPI_PP_SS_NUM)
+#define HS_SPI_PP_PROFILE_NUM (8)
+#define HS_SPI_PP_PROFILE_NUM_MASK __mask(10, HS_SPI_PP_PROFILE_NUM)
+
+} HsSpiControl;
+
+typedef struct HsSpiPingPong {
+
+ uint32 command;
+#define HS_SPI_SS_NUM (12)
+#define HS_SPI_PROFILE_NUM (8)
+#define HS_SPI_TRIGGER_NUM (4)
+#define HS_SPI_COMMAND_VALUE (0)
+ #define HS_SPI_COMMAND_NOOP (0)
+ #define HS_SPI_COMMAND_START_NOW (1)
+ #define HS_SPI_COMMAND_START_TRIGGER (2)
+ #define HS_SPI_COMMAND_HALT (3)
+ #define HS_SPI_COMMAND_FLUSH (4)
+
+ uint32 status;
+#define HS_SPI_ERROR_BYTE_OFFSET (16)
+#define HS_SPI_WAIT_FOR_TRIGGER (2)
+#define HS_SPI_SOURCE_BUSY (1)
+#define HS_SPI_SOURCE_GNT (0)
+
+ uint32 fifo_status;
+ uint32 control;
+
+} HsSpiPingPong;
+
+typedef struct HsSpiProfile {
+
+ uint32 clk_ctrl;
+#define HS_SPI_ACCUM_RST_ON_LOOP (15)
+#define HS_SPI_SPI_CLK_2X_SEL (14)
+#define HS_SPI_FREQ_CTRL_WORD (0)
+
+ uint32 signal_ctrl;
+#define HS_SPI_ASYNC_INPUT_PATH (1 << 16)
+#define HS_SPI_LAUNCH_RISING (1 << 13)
+#define HS_SPI_LATCH_RISING (1 << 12)
+
+ uint32 mode_ctrl;
+#define HS_SPI_PREPENDBYTE_CNT (24)
+#define HS_SPI_MODE_ONE_WIRE (20)
+#define HS_SPI_MULTIDATA_WR_SIZE (18)
+#define HS_SPI_MULTIDATA_RD_SIZE (16)
+#define HS_SPI_MULTIDATA_WR_STRT (12)
+#define HS_SPI_MULTIDATA_RD_STRT (8)
+#define HS_SPI_FILLBYTE (0)
+
+ uint32 polling_config;
+ uint32 polling_and_mask;
+ uint32 polling_compare;
+ uint32 polling_timeout;
+ uint32 reserved;
+
+} HsSpiProfile;
+
+#define HS_SPI_OP_CODE 13
+ #define HS_SPI_OP_SLEEP (0)
+ #define HS_SPI_OP_READ_WRITE (1)
+ #define HS_SPI_OP_WRITE (2)
+ #define HS_SPI_OP_READ (3)
+ #define HS_SPI_OP_SETIRQ (4)
+
+#define HS_SPI ((volatile HsSpiControl * const) HSSPIM_BASE)
+#define HS_SPI_PINGPONG0 ((volatile HsSpiPingPong * const) (HSSPIM_BASE+0x80))
+#define HS_SPI_PINGPONG1 ((volatile HsSpiPingPong * const) (HSSPIM_BASE+0xc0))
+#define HS_SPI_PROFILES ((volatile HsSpiProfile * const) (HSSPIM_BASE+0x100))
+#define HS_SPI_FIFO0 ((volatile uint8 * const) (HSSPIM_BASE+0x200))
+#define HS_SPI_FIFO1 ((volatile uint8 * const) (HSSPIM_BASE+0x400))
+
+
+/*
+** Misc Register Set Definitions.
+*/
+
+typedef struct Misc {
+ uint32 miscSerdesCtrl; /* 0x0000 */
+#define SERDES_PCIE_ENABLE 0x00000001
+#define SERDES_PCIE_EXD_ENABLE (1<<15)
+
+ uint32 miscSerdesSts; /* 0x0004 */
+ uint32 miscIrqOutMask; /* 0x0008 */
+#define MISC_PCIE_EP_IRQ_MASK0 (1<<0)
+#define MISC_PCIE_EP_IRQ_MASK1 (1<<1)
+
+ uint32 miscMemcControl; /* 0x000c */
+#define MISC_MEMC_CONTROL_MC_UBUS_ASYNC_MODE (1<<3)
+#define MISC_MEMC_CONTROL_MC_LMB_ASYNC_MODE (1<<2)
+#define MISC_MEMC_CONTROL_DDR_TEST_DONE (1<<1)
+#define MISC_MEMC_CONTROL_DDR_TEST_DISABLE (1<<0)
+
+ uint32 unused0[2]; /* 0x0010 */
+
+ uint32 miscVregCtrl0; /* 0x0018 */
+#define VREG_VSEL1P2_SHIFT 0
+#define VREG_VSEL1P2_MASK 0x1f
+#define VREG_VSEL1P2_MIDDLE 0x0f
+
+ uint32 miscVregCtrl1; /* 0x001c */
+ uint32 miscVregCtrl2; /* 0x0020 */
+ uint32 miscLedXorReg; /* 0x0024 */
+ uint32 miscExtra2ChipIrqMask; /* 0x0028 */
+ uint32 miscExtra2ChipIrqStatus; /* 0x002c */
+ uint32 miscExtra2ChipIrqMask1; /* 0x0030 */
+ uint32 miscExtra2ChipIrqStatus1; /* 0x0034 */
+ uint32 miscDdrPllTestCtrl; /* 0x0038 */
+ uint32 miscPadCtrlLow; /* 0x003c */
+ uint32 miscPadCtrlHigh; /* 0x0040 */
+#define MISC_MII_SEL_SHIFT 30
+#define MISC_MII_SEL_3P3V 0
+#define MISC_MII_SEL_2P5V 1
+#define MISC_MII_SEL_1P5V 2
+ uint32 miscPeriphEcoReg; /* 0x0044 */
+
+ uint32 miscIddqCtrl; /* 0x0048 */
+#define MISC_IDDQ_CONTROL_USBH (1<<6)
+#define MISC_IDDQ_CONTROL_USBD (1<<5)
+
+ uint32 miscAdslClkSample; /* 0x004c */
+
+ uint32 unused3[(0x0100 - 0x0050) / 4]; /* 0x0050 */
+ uint32 miscAdslCtrl; /* 0x0100 */
+ uint32 unused4[(0x0180 - 0x0104) / 4]; /* 0x0104 */
+ uint32 miscMipsTestCtrl; /* 0x0180 */
+ uint32 miscMipsTestStatus; /* 0x0184 */
+ uint32 unused5[(0x0200 - 0x0188) / 4]; /* 0x0188 */
+ uint32 miscPllCtrlSysPll0; /* 0x0200 */
+ uint32 miscPllCtrlSysPll1; /* 0x0204 */
+ uint32 miscPllCtrlSysPll2; /* 0x0208 */
+ uint32 miscPllCtrlSysPll3; /* 0x020c */
+ uint32 miscPllCtrlDdrPll; /* 0x0210 */
+ uint32 miscPllCtrlXtalEcoReg; /* 0x0214 */
+ uint32 unused6[(0x0240 - 0x0218) / 4]; /* 0x0218 */
+ uint32 miscStrapBus; /* 0x0240 */
+#define MISC_STRAP_BUS_BOOT_SEL_SHIFT 18
+#define MISC_STRAP_BUS_BOOT_SEL_MASK (0x1<<MISC_STRAP_BUS_BOOT_SEL_SHIFT)
+#define MISC_STRAP_BUS_BOOT_SERIAL 0x01
+#define MISC_STRAP_BUS_BOOT_NAND 0x00
+#define MISC_STRAP_BUS_MIPS_PLL_FVCO_SHIFT 7
+#define MISC_STRAP_BUS_MIPS_PLL_FVCO_MASK (0x1F<<MISC_STRAP_BUS_MIPS_PLL_FVCO_SHIFT)
+
+ uint32 miscStrapOverride; /* 0x0244 */
+ uint32 unused7[(0x0280 - 0x0248) / 4]; /* 0x0248 */
+ uint32 miscRtcSleepModeEn; /* 0x0280 */
+ uint32 miscRtcSleepRtcEn; /* 0x0284 */
+ uint32 miscRtcSleepRtcCountLow; /* 0x0288 */
+ uint32 miscRtcSleepRtcCountHigh; /* 0x028c */
+ uint32 miscRtcSleepRtcEvent; /* 0x0290 */
+ uint32 miscRtcSleepWakeupMask; /* 0x0294 */
+ uint32 miscRtcSleepWakeupStatus; /* 0x0298 */
+ uint32 miscRtcSleepDebounceCtrl; /* 0x029c */
+ uint32 miscRtcSleepCpuScratchPad; /* 0x02a0 */
+} Misc;
+
+#define MISC ((volatile Misc * const) MISC_BASE)
+
+/*
+** LedControl Register Set Definitions.
+*/
+
+#pragma pack(push, 4)
+typedef struct LedControl {
+ uint32 ledInit;
+#define LED_LED_TEST (1 << 31)
+#define LED_SHIFT_TEST (1 << 30)
+#define LED_SERIAL_LED_SHIFT_DIR (1 << 16)
+#define LED_SERIAL_LED_DATA_PPOL (1 << 15)
+#define LEDSERIAL_LED_CLK_NPOL (1 << 14)
+#define LED_SERIAL_LED_MUX_SEL (1 << 13)
+#define LED_SERIAL_LED_EN (1 << 12)
+#define LED_FAST_INTV_SHIFT 6
+#define LED_FAST_INTV_MASK (0x3F<<LED_FAST_INTV_SHIFT)
+#define LED_SLOW_INTV_SHIFT 0
+#define LED_SLOW_INTV_MASK (0x3F<<LED_SLOW_INTV_SHIFT)
+#define LED_INTERVAL_20MS 1
+
+ uint64 ledMode;
+#define LED_MODE_MASK (uint64)0x3
+#define LED_MODE_OFF (uint64)0x0
+#define LED_MODE_FLASH (uint64)0x1
+#define LED_MODE_BLINK (uint64)0x2
+#define LED_MODE_ON (uint64)0x3
+
+ uint32 ledHWDis;
+ uint32 ledStrobe;
+ uint32 ledLinkActSelHigh;
+#define LED_ENET0 4
+#define LED_ENET1 5
+#define LED_ENET2 6
+#define LED_ENET3 7
+#define LED_4_ACT_SHIFT 0
+#define LED_5_ACT_SHIFT 4
+#define LED_6_ACT_SHIFT 8
+#define LED_7_ACT_SHIFT 12
+#define LED_4_LINK_SHIFT 16
+#define LED_5_LINK_SHIFT 20
+#define LED_6_LINK_SHIFT 24
+#define LED_7_LINK_SHIFT 28
+ uint32 ledLinkActSelLow;
+#define LED_INET 0
+#define LED_0_ACT_SHIFT 0
+#define LED_1_ACT_SHIFT 4
+#define LED_2_ACT_SHIFT 8
+#define LED_3_ACT_SHIFT 12
+#define LED_0_LINK_SHIFT 16
+#define LED_1_LINK_SHIFT 20
+#define LED_2_LINK_SHIFT 24
+#define LED_3_LINK_SHIFT 28
+
+ uint32 ledReadback;
+ uint32 ledSerialMuxSelect;
+} LedControl;
+#pragma pack(pop)
+
+#define LED ((volatile LedControl * const) LED_BASE)
+
+#define GPIO_NUM_TO_LED_MODE_SHIFT(X) \
+ ((((X) & BP_GPIO_NUM_MASK) < 8) ? (32 + (((X) & BP_GPIO_NUM_MASK) << 1)) : \
+ ((((X) & BP_GPIO_NUM_MASK) - 8) << 1))
+
+#define IUDMA_MAX_CHANNELS 32
+
+/*
+** DMA Channel Configuration (1 .. 32)
+*/
+typedef struct DmaChannelCfg {
+ uint32 cfg; /* (00) assorted configuration */
+#define DMA_ENABLE 0x00000001 /* set to enable channel */
+#define DMA_PKT_HALT 0x00000002 /* idle after an EOP flag is detected */
+#define DMA_BURST_HALT 0x00000004 /* idle after finish current memory burst */
+ uint32 intStat; /* (04) interrupts control and status */
+ uint32 intMask; /* (08) interrupts mask */
+#define DMA_BUFF_DONE 0x00000001 /* buffer done */
+#define DMA_DONE 0x00000002 /* packet xfer complete */
+#define DMA_NO_DESC 0x00000004 /* no valid descriptors */
+ uint32 maxBurst; /* (0C) max burst length permitted */
+#define DMA_DESCSIZE_SEL 0x00040000 /* DMA Descriptor Size Selection */
+} DmaChannelCfg;
+
+/*
+** DMA State RAM (1 .. 16)
+*/
+typedef struct DmaStateRam {
+ uint32 baseDescPtr; /* (00) descriptor ring start address */
+ uint32 state_data; /* (04) state/bytes done/ring offset */
+ uint32 desc_len_status; /* (08) buffer descriptor status and len */
+ uint32 desc_base_bufptr; /* (0C) buffer descrpitor current processing */
+} DmaStateRam;
+
+
+/*
+** DMA Registers
+*/
+typedef struct DmaRegs {
+ uint32 controller_cfg; /* (00) controller configuration */
+#define DMA_MASTER_EN 0x00000001
+#define DMA_FLOWC_CH1_EN 0x00000002
+#define DMA_FLOWC_CH3_EN 0x00000004
+
+ // Flow control Ch1
+ uint32 flowctl_ch1_thresh_lo; /* 004 */
+ uint32 flowctl_ch1_thresh_hi; /* 008 */
+ uint32 flowctl_ch1_alloc; /* 00c */
+#define DMA_BUF_ALLOC_FORCE 0x80000000
+
+ // Flow control Ch3
+ uint32 flowctl_ch3_thresh_lo; /* 010 */
+ uint32 flowctl_ch3_thresh_hi; /* 014 */
+ uint32 flowctl_ch3_alloc; /* 018 */
+
+ // Flow control Ch5
+ uint32 flowctl_ch5_thresh_lo; /* 01C */
+ uint32 flowctl_ch5_thresh_hi; /* 020 */
+ uint32 flowctl_ch5_alloc; /* 024 */
+
+ // Flow control Ch7
+ uint32 flowctl_ch7_thresh_lo; /* 028 */
+ uint32 flowctl_ch7_thresh_hi; /* 02C */
+ uint32 flowctl_ch7_alloc; /* 030 */
+
+ uint32 ctrl_channel_reset; /* 034 */
+ uint32 ctrl_channel_debug; /* 038 */
+ uint32 reserved1; /* 03C */
+ uint32 ctrl_global_interrupt_status; /* 040 */
+ uint32 ctrl_global_interrupt_mask; /* 044 */
+
+ // Unused words
+ uint8 reserved2[0x200-0x48];
+
+ // Per channel registers/state ram
+ DmaChannelCfg chcfg[IUDMA_MAX_CHANNELS];/* (200-3FF) Channel configuration */
+ union {
+ DmaStateRam s[IUDMA_MAX_CHANNELS];
+ uint32 u32[4 * IUDMA_MAX_CHANNELS];
+ } stram; /* (400-5FF) state ram */
+} DmaRegs;
+
+#define SW_DMA ((volatile DmaRegs * const) SWITCH_DMA_BASE)
+
+/*
+** DMA Buffer
+*/
+typedef struct DmaDesc {
+ union {
+ struct {
+ uint16 length; /* in bytes of data in buffer */
+#define DMA_DESC_USEFPM 0x8000
+#define DMA_DESC_MULTICAST 0x4000
+#define DMA_DESC_BUFLENGTH 0x0fff
+ uint16 status; /* buffer status */
+#define DMA_OWN 0x8000 /* cleared by DMA, set by SW */
+#define DMA_EOP 0x4000 /* last buffer in packet */
+#define DMA_SOP 0x2000 /* first buffer in packet */
+#define DMA_WRAP 0x1000 /* */
+#define DMA_PRIO 0x0C00 /* Prio for Tx */
+#define DMA_APPEND_BRCM_TAG 0x0200
+#define DMA_APPEND_CRC 0x0100
+#define USB_ZERO_PKT (1<< 0) // Set to send zero length packet
+ };
+ uint32 word0;
+ };
+
+ uint32 address; /* address of data */
+} DmaDesc;
+
+/*
+** 16 Byte DMA Buffer
+*/
+typedef struct {
+ union {
+ struct {
+ uint16 length; /* in bytes of data in buffer */
+#define DMA_DESC_USEFPM 0x8000
+#define DMA_DESC_MULTICAST 0x4000
+#define DMA_DESC_BUFLENGTH 0x0fff
+ uint16 status; /* buffer status */
+#define DMA_OWN 0x8000 /* cleared by DMA, set by SW */
+#define DMA_EOP 0x4000 /* last buffer in packet */
+#define DMA_SOP 0x2000 /* first buffer in packet */
+#define DMA_WRAP 0x1000 /* */
+#define DMA_PRIO 0x0C00 /* Prio for Tx */
+#define DMA_APPEND_BRCM_TAG 0x0200
+#define DMA_APPEND_CRC 0x0100
+#define USB_ZERO_PKT (1<< 0) // Set to send zero length packet
+ };
+ uint32 word0;
+ };
+
+ uint32 address; /* address of data */
+ uint32 control;
+#define GEM_ID_MASK 0x001F
+ uint32 reserved;
+} DmaDesc16;
+
+
+typedef struct USBControl {
+ uint32 BrtControl1;
+ uint32 BrtControl2;
+ uint32 BrtStatus1;
+ uint32 BrtStatus2;
+ uint32 UTMIControl1;
+#define USB_DEVICE_MODE_SEL (1<<0)
+ uint32 TestPortControl;
+ uint32 PllControl1;
+ uint32 SwapControl;
+#define USB_DEVICE_SEL (1<<6)
+#define EHCI_LOGICAL_ADDRESS_EN (1<<5)
+#define EHCI_ENDIAN_SWAP (1<<4)
+#define EHCI_DATA_SWAP (1<<3)
+#define OHCI_LOGICAL_ADDRESS_EN (1<<2)
+#define OHCI_ENDIAN_SWAP (1<<1)
+#define OHCI_DATA_SWAP (1<<0)
+ uint32 GenericControl;
+#define PLL_SUSPEND_EN (1<<1)
+ uint32 FrameAdjustValue;
+ uint32 Setup;
+#define USBH_IOC (1<<4)
+ uint32 MDIO;
+ uint32 MDIO32;
+ uint32 USBSimControl;
+} USBControl;
+
+#define USBH ((volatile USBControl * const) USBH_CFG_BASE)
+
+/*
+** PCI-E
+*/
+typedef struct PcieRegs{
+ uint32 devVenID;
+ uint16 command;
+ uint16 status;
+ uint32 revIdClassCode;
+ uint32 headerTypeLatCacheLineSize;
+ uint32 bar1;
+ uint32 bar2;
+ uint32 priSecBusNo;
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SUB_BUS_NO_MASK 0x00ff0000
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SUB_BUS_NO_SHIFT 16
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SEC_BUS_NO_MASK 0x0000ff00
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SEC_BUS_NO_SHIFT 8
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_PRI_BUS_NO_MASK 0x000000ff
+
+ uint32 ioBaseLimit;
+ uint32 secStatus;
+ uint32 rcMemBaseLimit;
+ uint32 rcPrefBaseLimit;
+ uint32 rcPrefBaseHi;
+ uint32 rcPrefLimitHi;
+ uint32 rcIoBaseLimit;
+ uint32 capPointer;
+ uint32 expRomBase;
+ uint32 brdigeCtrlIntPinIntLine;
+ uint32 bridgeCtrl;
+ uint32 unused1[27];
+
+ /* PcieExpressCtrlRegs */
+ uint16 pciExpressCap;
+ uint16 pcieCapabilitiy;
+ uint32 deviceCapability;
+ uint16 deviceControl;
+ uint16 deviceStatus;
+ uint32 linkCapability;
+ uint16 linkControl;
+ uint16 linkStatus;
+ uint32 slotCapability;
+ uint16 slotControl;
+ uint16 slotStatus;
+ uint16 rootControl;
+ uint16 rootCap;
+ uint32 rootStatus;
+ uint32 deviceCapability2;
+ uint16 deviceControl2;
+ uint16 deviceStatus2;
+ uint32 linkCapability2;
+ uint16 linkControl2;
+ uint16 linkStatus2;
+ uint32 slotCapability2;
+ uint16 slotControl2;
+ uint16 slotStatus2;
+ uint32 unused2[6];
+
+ /* PcieErrorRegs */
+ uint16 advErrCapId;
+ uint16 advErrCapOff;
+ uint32 ucErrStatus;
+ uint32 ucorrErrMask;
+ uint32 ucorrErrSevr;
+ uint32 corrErrStatus;
+ uint32 corrErrMask;
+ uint32 advErrCapControl;
+ uint32 headerLog1;
+ uint32 headerLog2;
+ uint32 headerLog3;
+ uint32 headerLog4;
+ uint32 rootErrorCommand;
+ uint32 rootErrorStatus;
+ uint32 rcCorrId;
+ uint32 rcFatalNonfatalId;
+ uint32 unused3[10];
+
+ /* PcieVcRegs */
+ uint16 vcCapId;
+ uint16 vcCapOffset;
+ uint32 prtVcCapability;
+ uint32 portVcCapability2;
+ uint16 portVcControl;
+ uint16 portVcCtatus;
+ uint32 portArbStatus;
+ uint32 vcRsrcControl;
+ uint32 vcRsrcStatus;
+ uint32 unused4[1];
+
+ /* PcieVendor */
+ uint32 vendorCapability;
+ uint32 vendorSpecificHdr;
+} PcieRegs;
+
+typedef struct PcieBlk404Regs{
+ uint32 unused; /* 0x404 */
+ uint32 config2; /* 0x408 */
+#define PCIE_IP_BLK404_CONFIG_2_BAR1_SIZE_MASK 0x0000000f
+#define PCIE_IP_BLK404_CONFIG_2_BAR1_DISABLE 0
+ uint32 config3; /* 0x40c */
+ uint32 pmDataA; /* 0x410 */
+ uint32 pmDataB; /* 0x414 */
+} PcieBlk404Regs;
+
+typedef struct PcieBlk428Regs{
+ uint32 vpdIntf; /* 0x428 */
+ uint16 unused_g; /* 0x42c */
+ uint16 vpdAddrFlag; /* 0x42e */
+ uint32 vpdData; /* 0x430 */
+ uint32 idVal1; /* 0x434 */
+ uint32 idVal2; /* 0x438 */
+ uint32 idVal3; /* 0x43c */
+#define PCIE_IP_BLK428_ID_VAL3_REVISION_ID_MASK 0xff000000
+#define PCIE_IP_BLK428_ID_VAL3_REVISION_ID_SHIFT 24
+#define PCIE_IP_BLK428_ID_VAL3_CLASS_CODE_MASK 0x00ffffff
+#define PCIE_IP_BLK428_ID_VAL3_CLASS_CODE_SHIFT 16
+#define PCIE_IP_BLK428_ID_VAL3_SUB_CLASS_CODE_SHIFT 8
+
+ uint32 idVal4;
+ uint32 idVal5;
+ uint32 unused_h;
+ uint32 idVal6;
+ uint32 msiData;
+ uint32 msiAddr_h;
+ uint32 msiAddr_l;
+ uint32 msiMask;
+ uint32 msiPend;
+ uint32 pmData_c;
+ uint32 msixControl;
+ uint32 msixTblOffBir;
+ uint32 msixPbaOffBit;
+ uint32 unused_k;
+ uint32 pcieCapability;
+ uint32 deviceCapability;
+ uint32 unused_l;
+ uint32 linkCapability;
+ uint32 bar2Config;
+ uint32 pcieDeviceCapability2;
+ uint32 pcieLinkCapability2;
+ uint32 pcieLinkControl;
+ uint32 pcieLinkCapabilityRc;
+ uint32 bar3Config;
+ uint32 rootCap;
+ uint32 devSerNumCapId;
+ uint32 lowerSerNum;
+ uint32 upperSerNum;
+ uint32 advErrCap;
+ uint32 pwrBdgtData0;
+ uint32 pwrBdgtData1;
+ uint32 pwrBdgtData2;
+ uint32 pwdBdgtData3;
+ uint32 pwrBdgtData4;
+ uint32 pwrBdgtData5;
+ uint32 pwrBdgtData6;
+ uint32 pwrBdgtData7;
+ uint32 pwrBdgtCapability;
+ uint32 vsecHdr;
+ uint32 rcUserMemLo1;
+ uint32 rcUserMemHi1;
+ uint32 rcUserMemLo2;
+ uint32 rcUserMemHi2;
+}PcieBlk428Regs;
+
+typedef struct PcieBlk800Regs{
+#define NUM_PCIE_BLK_800_CTRL_REGS 6
+ uint32 tlControl[NUM_PCIE_BLK_800_CTRL_REGS];
+ uint32 tlCtlStat0;
+ uint32 pmStatus0;
+ uint32 pmStatus1;
+
+#define NUM_PCIE_BLK_800_TAGS 32
+ uint32 tlStatus[NUM_PCIE_BLK_800_TAGS];
+ uint32 tlHdrFcStatus;
+ uint32 tlDataFcStatus;
+ uint32 tlHdrFcconStatus;
+ uint32 tlDataFcconStatus;
+ uint32 tlTargetCreditStatus;
+ uint32 tlCreditAllocStatus;
+ uint32 tlSmlogicStatus;
+} PcieBlk800Regs;
+
+
+typedef struct PcieBlk1000Regs{
+#define NUM_PCIE_BLK_1000_PDL_CTRL_REGS 16
+ uint32 pdlControl[NUM_PCIE_BLK_1000_PDL_CTRL_REGS];
+ uint32 dlattnVec;
+ uint32 dlAttnMask;
+ uint32 dlStatus; /* 0x1048 */
+#define PCIE_IP_BLK1000_DL_STATUS_PHYLINKUP_MASK 0x00002000
+#define PCIE_IP_BLK1000_DL_STATUS_PHYLINKUP_SHIFT 13
+ uint32 dlTxChecksum;
+ uint32 dlForcedUpdateGen1;
+ uint32 mdioAddr;
+ uint32 mdioWrData;
+ uint32 mdioRdData;
+ uint32 dlRxPFcCl;
+ uint32 dlRxCFcCl;
+ uint32 dlRxAckNack;
+ uint32 dlTxRxSeqnb;
+ uint32 dlTxPFcAl;
+ uint32 dlTxNpFcAl;
+ uint32 regDlSpare;
+ uint32 dlRegSpare;
+ uint32 dlTxRxSeq;
+ uint32 dlRxNpFcCl;
+}PcieBlk1000Regs;
+
+typedef struct PcieBlk1800Regs{
+#define NUM_PCIE_BLK_1800_PHY_CTRL_REGS 5
+ uint32 phyCtrl[NUM_PCIE_BLK_1800_PHY_CTRL_REGS];
+#define REG_POWERDOWN_P1PLL_ENA (1<<12)
+ uint32 phyErrorAttnVec;
+ uint32 phyErrorAttnMask;
+ uint32 phyReceivedMcpErrors;
+ uint32 phyTransmittedMcpErrors;
+ uint32 phyGenDebug;
+ uint32 phyRecoveryHist;
+#define NUM_PCIE_BLK_1800_PHY_LTSSM_HIST_REGS 3
+ uint32 phyltssmHist[NUM_PCIE_BLK_1800_PHY_LTSSM_HIST_REGS];
+#define NUM_PCIE_BLK_1800_PHY_DBG_REGS 11
+ uint32 phyDbg[NUM_PCIE_BLK_1800_PHY_DBG_REGS];
+} PcieBlk1800Regs;
+
+typedef struct PcieBridgeRegs{
+ uint32 bar1Remap; /* 0x0818*/
+#define PCIE_BRIDGE_BAR1_REMAP_addr_MASK 0xffff0000
+#define PCIE_BRIDGE_BAR1_REMAP_addr_MASK_SHIFT 16
+#define PCIE_BRIDGE_BAR1_REMAP_remap_enable (1<<1)
+#define PCIE_BRIDGE_BAR1_REMAP_swap_enable 1
+
+ uint32 bar2Remap; /* 0x081c*/
+#define PCIE_BRIDGE_BAR2_REMAP_addr_MASK 0xffff0000
+#define PCIE_BRIDGE_BAR2_REMAP_addr_MASK_SHIFT 16
+#define PCIE_BRIDGE_BAR2_REMAP_remap_enable (1<<1)
+#define PCIE_BRIDGE_BAR2_REMAP_swap_enable 1
+
+ uint32 bridgeOptReg1; /* 0x0820*/
+#define PCIE_BRIDGE_OPT_REG1_en_l1_int_status_mask_polarity (1<<12)
+#define PCIE_BRIDGE_OPT_REG1_en_pcie_bridge_hole_detection (1<<11)
+#define PCIE_BRIDGE_OPT_REG1_en_rd_reply_be_fix (1<<9)
+#define PCIE_BRIDGE_OPT_REG1_enable_rd_be_opt (1<<7)
+
+ uint32 bridgeOptReg2; /* 0x0824*/
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_func_no_MASK 0xe0000000
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_func_no_SHIFT 29
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_dev_no_MASK 0x1f000000
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_dev_no_SHIFT 24
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bus_no_MASK 0x00ff0000
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bus_no_SHIFT 16
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bd_sel_MASK 0x00000080
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bd_sel_SHIFT 7
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_timeout_MASK 0x00000040
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_timeout_SHIFT 6
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_abort_MASK 0x00000020
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_abort_SHIFT 5
+#define PCIE_BRIDGE_OPT_REG2_enable_tx_crd_chk_MASK 0x00000010
+#define PCIE_BRIDGE_OPT_REG2_enable_tx_crd_chk_SHIFT 4
+#define PCIE_BRIDGE_OPT_REG2_dis_ubus_ur_decode_MASK 0x00000004
+#define PCIE_BRIDGE_OPT_REG2_dis_ubus_ur_decode_SHIFT 2
+#define PCIE_BRIDGE_OPT_REG2_cfg_reserved_MASK 0x0000ff0b
+
+ uint32 Ubus2PcieBar0BaseMask; /* 0x0828 */
+#define PCIE_BRIDGE_BAR0_BASE_base_MASK 0xfff00000
+#define PCIE_BRIDGE_BAR0_BASE_base_MASK_SHIFT 20
+#define PCIE_BRIDGE_BAR0_BASE_mask_MASK 0x0000fff0
+#define PCIE_BRIDGE_BAR0_BASE_mask_MASK_SHIFT 4
+#define PCIE_BRIDGE_BAR0_BASE_swap_enable (1<<1)
+#define PCIE_BRIDGE_BAR0_BASE_remap_enable 1
+
+ uint32 Ubus2PcieBar0RemapAdd; /* 0x082c */
+#define PCIE_BRIDGE_BAR0_REMAP_ADDR_addr_MASK 0xfff00000
+#define PCIE_BRIDGE_BAR0_REMAP_ADDR_addr_SHIFT 20
+
+ uint32 Ubus2PcieBar1BaseMask; /* 0x0830 */
+#define PCIE_BRIDGE_BAR1_BASE_base_MASK 0xfff00000
+#define PCIE_BRIDGE_BAR1_BASE_base_MASK_SHIFT 20
+#define PCIE_BRIDGE_BAR1_BASE_mask_MASK 0x0000fff0
+#define PCIE_BRIDGE_BAR1_BASE_mask_MASK_SHIFT 4
+#define PCIE_BRIDGE_BAR1_BASE_swap_enable (1<<1)
+#define PCIE_BRIDGE_BAR1_BASE_remap_enable 1
+
+ uint32 Ubus2PcieBar1RemapAdd; /* 0x0834 */
+#define PCIE_BRIDGE_BAR1_REMAP_ADDR_addr_MASK 0xfff00000
+#define PCIE_BRIDGE_BAR1_REMAP_ADDR_addr_SHIFT 20
+
+ uint32 bridgeErrStatus; /* 0x0838 */
+ uint32 bridgeErrMask; /* 0x083c */
+ uint32 coreErrStatus2; /* 0x0840 */
+ uint32 coreErrMask2; /* 0x0844 */
+ uint32 coreErrStatus1; /* 0x0848 */
+ uint32 coreErrMask1; /* 0x084c */
+ uint32 rcInterruptStatus; /* 0x0850 */
+ uint32 rcInterruptMask; /* 0x0854 */
+#define PCIE_BRIDGE_INTERRUPT_MASK_int_a_MASK (1<<0)
+#define PCIE_BRIDGE_INTERRUPT_MASK_int_b_MASK (1<<1)
+#define PCIE_BRIDGE_INTERRUPT_MASK_int_c_MASK (1<<2)
+#define PCIE_BRIDGE_INTERRUPT_MASK_int_d_MASK (1<<3)
+
+}PcieBridgeRegs;
+
+#define PCIEH_DEV_OFFSET 0x8000
+#define PCIEH ((volatile uint32 * const) PCIE_BASE)
+#define PCIEH_REGS ((volatile PcieRegs * const) PCIE_BASE)
+
+#define PCIEH_BLK_404_REGS ((volatile PcieBlk404Regs * const) \
+ (PCIE_BASE+0x404))
+#define PCIEH_BLK_428_REGS ((volatile PcieBlk428Regs * const) \
+ (PCIE_BASE+0x428))
+#define PCIEH_BLK_800_REGS ((volatile PcieBlk800Regs * const) \
+ (PCIE_BASE+0x800))
+#define PCIEH_BLK_1000_REGS ((volatile PcieBlk1000Regs * const) \
+ (PCIE_BASE+0x1000))
+#define PCIEH_BLK_1800_REGS ((volatile PcieBlk1800Regs * const) \
+ (PCIE_BASE+0x1800))
+#define PCIEH_BRIDGE_REGS ((volatile PcieBridgeRegs * const) \
+ (PCIE_BASE+0x2818))
+/*
+** NAND Controller Registers
+*/
+typedef struct NandCtrlRegs {
+ uint32 NandRevision; /* NAND Revision */
+ uint32 NandCmdStart; /* Nand Flash Command Start */
+ uint32 NandCmdExtAddr; /* Nand Flash Command Extended Address */
+ uint32 NandCmdAddr; /* Nand Flash Command Address */
+ uint32 NandCmdEndAddr; /* Nand Flash Command End Address */
+ uint32 NandNandBootConfig; /* Nand Flash Boot Config */
+#define NBC_AUTO_DEV_ID_CFG 0x40000000
+ uint32 NandCsNandXor; /* Nand Flash EBI CS Address XOR with */
+} NandCtrlRegs;
+
+#define NAND ((volatile NandCtrlRegs * const) NAND_REG_BASE)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/shared/opensource/include/bcm963xx/6362_cpu.h b/shared/opensource/include/bcm963xx/6362_cpu.h
new file mode 100755
index 0000000..f49a6ac
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/6362_cpu.h
@@ -0,0 +1,150 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+#ifndef __BCM6362_CPU_H
+#define __BCM6362_CPU_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+#************************************************************************
+#* Coprocessor 0 Register Names
+#************************************************************************
+*/
+#define C0_BCM_CONFIG $22
+
+/*
+# Select 1
+# Bit 31: unused
+# Bits 30:25 MMU Size (Num TLB entries-1)
+# Bits 24:22 ICache sets/way (2^n * 64)
+# Bits 21:19 ICache Line size (2^(n+1) bytes) 0=No Icache
+# Bits 18:16 ICache Associativity (n+1) way
+# Bits 15:13 DCache sets/way (2^n * 64)
+# Bits 12:10 DCache Line size (2^(n+1) bytes) 0=No Dcache
+# Bits 9:7 DCache Associativity (n+1) way
+# Bits 6:4 unused
+# Bit 3: 1=At least 1 watch register
+# Bit 2: 1=MIPS16 code compression implemented
+# Bit 1: 1=EJTAG implemented
+# Bit 0: 1=FPU implemented
+*/
+#define CP0_CFG_ISMSK (0x7 << 22)
+#define CP0_CFG_ISSHF 22
+#define CP0_CFG_ILMSK (0x7 << 19)
+#define CP0_CFG_ILSHF 19
+#define CP0_CFG_IAMSK (0x7 << 16)
+#define CP0_CFG_IASHF 16
+#define CP0_CFG_DSMSK (0x7 << 13)
+#define CP0_CFG_DSSHF 13
+#define CP0_CFG_DLMSK (0x7 << 10)
+#define CP0_CFG_DLSHF 10
+#define CP0_CFG_DAMSK (0x7 << 7)
+#define CP0_CFG_DASHF 7
+
+/*
+#************************************************************************
+#* Coprocessor 0 Broadcom Config Register Bits
+#************************************************************************
+*/
+#define CP0_BCM_CFG_ICSHEN (0x1 << 31)
+#define CP0_BCM_CFG_DCSHEN (0x1 << 30)
+#define CP0_BCM_CFG_BTHD (0x1 << 21)
+#define CP0_BCM_CFG_CLF (0x1 << 20)
+#define CP0_BCM_CFG_NBK (0x1 << 17)
+
+/*
+#************************************************************************
+#* Coprocessor 0 CMT Interrupt Register
+#************************************************************************
+*/
+#define CP0_CMT_XIR_4 (0x1 << 31)
+#define CP0_CMT_XIR_3 (0x1 << 30)
+#define CP0_CMT_XIR_2 (0x1 << 29)
+#define CP0_CMT_XIR_1 (0x1 << 28)
+#define CP0_CMT_XIR_0 (0x1 << 27)
+#define CP0_CMT_SIR_1 (0x1 << 16)
+#define CP0_CMT_SIR_0 (0x1 << 15)
+#define CP0_CMT_NMIR_TP1 (0x1 << 1)
+#define CP0_CMT_NMIR_TP0 (0x1 << 0)
+
+/*
+#************************************************************************
+#* Coprocessor 0 CMT Control Register
+#************************************************************************
+*/
+#define CP0_CMT_DSU_TP1 (0x1 << 30)
+#define CP0_CMT_TPS_SHFT 16
+#define CP0_CMT_TPS_MASK (0xF << CP0_CMT_TPS_SHFT)
+#define CP0_CMT_PRIO_TP1 (0x1 << 5)
+#define CP0_CMT_PRIO_TP0 (0x1 << 4)
+#define CP0_CMT_RSTSE (0x1 << 0)
+
+/*
+#************************************************************************
+#* Coprocessor 0 CMT Local Register
+#************************************************************************
+*/
+#define CP0_CMT_TPID (0x1 << 31)
+
+/*
+#************************************************************************
+#* MIPS Registers
+#************************************************************************
+*/
+
+#define MIPS_BASE_BOOT 0xbfa00000
+#define MIPS_BASE 0xff400000
+
+#define MIPS_RAC_CR0 0x00 // RAC Configuration Register
+#define MIPS_RAC_CR1 0x08 // RAC Configuration Register 1
+#define RAC_FLH (1 << 8)
+#define RAC_DPF (1 << 6)
+#define RAC_NCH (1 << 5)
+#define RAC_C_INV (1 << 4)
+#define RAC_PF_D (1 << 3)
+#define RAC_PF_I (1 << 2)
+#define RAC_D (1 << 1)
+#define RAC_I (1 << 0)
+
+#define MIPS_RAC_ARR 0x04 // RAC Address Range Register
+#define RAC_UPB_SHFT 16
+#define RAC_LWB_SHFT 0
+
+#define MIPS_LMB_CR 0x1C // LMB Control Register
+#define LMB_EN (1 << 0)
+
+#define MIPS_SBR 0x20 // System Base Register
+
+#define MIPS_TP0_ALT_BV 0x30000
+#define MIPS_TP1_ALT_BV 0x38000
+#define ENABLE_ALT_BV (1 << 19)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/shared/opensource/include/bcm963xx/6362_intr.h b/shared/opensource/include/bcm963xx/6362_intr.h
new file mode 100755
index 0000000..b8e6a35
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/6362_intr.h
@@ -0,0 +1,123 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+#ifndef __6362_INTR_H
+#define __6362_INTR_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#define INTERRUPT_ID_SOFTWARE_0 0
+#define INTERRUPT_ID_SOFTWARE_1 1
+
+/*=====================================================================*/
+/* BCM6362 Timer Interrupt Level Assignments */
+/*=====================================================================*/
+#define MIPS_TIMER_INT 7
+
+/*=====================================================================*/
+/* Peripheral ISR Table Offset */
+/*=====================================================================*/
+#define INTERNAL_ISR_TABLE_OFFSET 8
+#define INTERNAL_HIGH_ISR_TABLE_OFFSET (INTERNAL_ISR_TABLE_OFFSET + 32)
+
+/*=====================================================================*/
+/* Logical Peripheral Interrupt IDs */
+/*=====================================================================*/
+
+#define INTERRUPT_ID_TIMER (INTERNAL_ISR_TABLE_OFFSET + 0)
+#define INTERRUPT_ID_RING_OSC (INTERNAL_ISR_TABLE_OFFSET + 1)
+#define INTERRUPT_ID_LS_SPIM (INTERNAL_ISR_TABLE_OFFSET + 2)
+#define INTERRUPT_ID_UART (INTERNAL_ISR_TABLE_OFFSET + 3)
+#define INTERRUPT_ID_UART1 (INTERNAL_ISR_TABLE_OFFSET + 4)
+#define INTERRUPT_ID_HS_SPIM (INTERNAL_ISR_TABLE_OFFSET + 5)
+#define INTERRUPT_ID_WLAN_GPIO (INTERNAL_ISR_TABLE_OFFSET + 6)
+#define INTERRUPT_ID_WLAN (INTERNAL_ISR_TABLE_OFFSET + 7)
+#define INTERRUPT_ID_IPSEC (INTERNAL_ISR_TABLE_OFFSET + 8)
+#define INTERRUPT_ID_USBH (INTERNAL_ISR_TABLE_OFFSET + 9)
+#define INTERRUPT_ID_USBH20 (INTERNAL_ISR_TABLE_OFFSET + 10)
+#define INTERRUPT_ID_USBS (INTERNAL_ISR_TABLE_OFFSET + 11)
+#define INTERRUPT_ID_NAND_FLASH (INTERNAL_ISR_TABLE_OFFSET + 12)
+#define INTERRUPT_ID_PCM (INTERNAL_ISR_TABLE_OFFSET + 13)
+#define INTERRUPT_ID_EPHY (INTERNAL_ISR_TABLE_OFFSET + 14)
+#define INTERRUPT_ID_DG (INTERNAL_ISR_TABLE_OFFSET + 15)
+#define INTERRUPT_ID_EPHY_ENERGY_0 (INTERNAL_ISR_TABLE_OFFSET + 16)
+#define INTERRUPT_ID_EPHY_ENERGY_1 (INTERNAL_ISR_TABLE_OFFSET + 17)
+#define INTERRUPT_ID_EPHY_ENERGY_2 (INTERNAL_ISR_TABLE_OFFSET + 18)
+#define INTERRUPT_ID_EPHY_ENERGY_3 (INTERNAL_ISR_TABLE_OFFSET + 19)
+#define INTERRUPT_ID_USB_CNTL_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 20)
+#define INTERRUPT_ID_USB_CNTL_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 21)
+#define INTERRUPT_ID_USB_BULK_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 22)
+#define INTERRUPT_ID_USB_BULK_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 23)
+#define INTERRUPT_ID_USB_ISO_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 24)
+#define INTERRUPT_ID_USB_ISO_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 25)
+#define INTERRUPT_ID_IPSEC_DMA_0 (INTERNAL_ISR_TABLE_OFFSET + 26)
+#define INTERRUPT_ID_IPSEC_DMA_1 (INTERNAL_ISR_TABLE_OFFSET + 27)
+#define INTERRUPT_ID_XDSL (INTERNAL_ISR_TABLE_OFFSET + 28)
+#define INTERRUPT_ID_FAP (INTERNAL_ISR_TABLE_OFFSET + 29)
+#define INTERRUPT_ID_PCIE_RC (INTERNAL_ISR_TABLE_OFFSET + 30)
+#define INTERRUPT_ID_PCIE_EP (INTERNAL_ISR_TABLE_OFFSET + 31)
+#define INTERRUPT_ID_ENETSW_RX_DMA_0 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 0)
+#define INTERRUPT_ID_ENETSW_RX_DMA_1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 1)
+#define INTERRUPT_ID_ENETSW_RX_DMA_2 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 2)
+#define INTERRUPT_ID_ENETSW_RX_DMA_3 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 3)
+#define INTERRUPT_ID_PCM_DMA_0 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 4)
+#define INTERRUPT_ID_PCM_DMA_1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 5)
+#define INTERRUPT_ID_DECT_0 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 6)
+#define INTERRUPT_ID_DECT_1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 7)
+#define INTERRUPT_ID_EXTERNAL_0 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 8)
+#define INTERRUPT_ID_EXTERNAL_1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 9)
+#define INTERRUPT_ID_EXTERNAL_2 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 10)
+#define INTERRUPT_ID_EXTERNAL_3 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 11)
+#define INTERRUPT_ID_ATM_DMA_0 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 12)
+#define INTERRUPT_ID_ATM_DMA_1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 13)
+#define INTERRUPT_ID_ATM_DMA_2 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 14)
+#define INTERRUPT_ID_ATM_DMA_3 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 15)
+#define INTERRUPT_ID_ATM_DMA_4 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 16)
+#define INTERRUPT_ID_ATM_DMA_5 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 17)
+#define INTERRUPT_ID_ATM_DMA_6 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 18)
+#define INTERRUPT_ID_ATM_DMA_7 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 19)
+#define INTERRUPT_ID_ATM_DMA_8 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 20)
+#define INTERRUPT_ID_ATM_DMA_9 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 21)
+#define INTERRUPT_ID_ATM_DMA_10 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 22)
+#define INTERRUPT_ID_ATM_DMA_11 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 23)
+#define INTERRUPT_ID_ATM_DMA_12 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 24)
+#define INTERRUPT_ID_ATM_DMA_13 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 25)
+#define INTERRUPT_ID_ATM_DMA_14 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 26)
+#define INTERRUPT_ID_ATM_DMA_15 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 27)
+#define INTERRUPT_ID_ATM_DMA_16 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 28)
+#define INTERRUPT_ID_ATM_DMA_17 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 29)
+#define INTERRUPT_ID_ATM_DMA_18 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 30)
+#define INTERRUPT_ID_ATM_DMA_19 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 31)
+
+#define INTERRUPT_ID_LAST INTERRUPT_ID_ATM_DMA_19
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* __BCM6362_H */
+
+
diff --git a/shared/opensource/include/bcm963xx/6362_map_part.h b/shared/opensource/include/bcm963xx/6362_map_part.h
new file mode 100755
index 0000000..86d56e9
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/6362_map_part.h
@@ -0,0 +1,1478 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+#ifndef __BCM6362_MAP_H
+#define __BCM6362_MAP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "bcmtypes.h"
+
+#define PERF_BASE 0xb0000000 /* chip control registers */
+#define TIMR_BASE 0xb0000040 /* timer registers */
+#define GPIO_BASE 0xb0000080 /* gpio registers */
+#define UART_BASE 0xb0000100 /* uart registers */
+#define UART1_BASE 0xb0000120 /* uart registers */
+#define NAND_REG_BASE 0xb0000200 /* NAND registers */
+#define NAND_CACHE_BASE 0xb0000600
+#define SPI_BASE 0xb0000800 /* SPI master controller registers */
+#define HSSPIM_BASE 0xb0001000 /* High-Speed SPI registers */
+#define MISC_BASE 0xb0001800 /* Miscellaneous Registers */
+#define LED_BASE 0xb0001900 /* LED control registers */
+#define USB_CTL_BASE 0xb0002400 /* USB 2.0 device control registers */
+#define USB_EHCI_BASE 0x10002500 /* USB host registers */
+#define USB_OHCI_BASE 0x10002600 /* USB host registers */
+#define USBH_CFG_BASE 0xb0002700
+#define IPSEC_BASE 0xb0002800
+#define DDR_BASE 0xb0003000 /* Memory control registers */
+#define WLAN_CHIPC_BASE 0x10004000 /* WLAN ChipCommon registers, use 1xxx for ioremap */
+#define WLAN_MAC_BASE 0x10005000 /* WLAN d11mac registers */
+#define WLAN_SHIM_BASE 0xb0007000 /* shim interface to WLAN */
+#define SAR_DMA_BASE 0xb000b800 /* ATM SAR DMA control registers */
+#define PCIE_BASE 0xb0e40000
+
+typedef struct DDRPhyControl {
+ uint32 REVISION; /* 0x00 */
+ uint32 CLK_PM_CTRL; /* 0x04 */
+ uint32 unused0[2]; /* 0x08-0x10 */
+ uint32 PLL_STATUS; /* 0x10 */
+ uint32 PLL_CONFIG; /* 0x14 */
+ uint32 PLL_PRE_DIVIDER; /* 0x18 */
+ uint32 PLL_DIVIDER; /* 0x1c */
+ uint32 PLL_CONTROL1; /* 0x20 */
+ uint32 PLL_CONTROL2; /* 0x24 */
+ uint32 PLL_SS_EN; /* 0x28 */
+ uint32 PLL_SS_CFG; /* 0x2c */
+ uint32 STATIC_VDL_OVERRIDE; /* 0x30 */
+ uint32 DYNAMIC_VDL_OVERRIDE; /* 0x34 */
+ uint32 IDLE_PAD_CONTROL; /* 0x38 */
+ uint32 ZQ_PVT_COMP_CTL; /* 0x3c */
+ uint32 DRIVE_PAD_CTL; /* 0x40 */
+ uint32 CLOCK_REG_CONTROL; /* 0x44 */
+ uint32 unused1[46];
+} DDRPhyControl;
+
+typedef struct DDRPhyByteLaneControl {
+ uint32 REVISION; /* 0x00 */
+ uint32 VDL_CALIBRATE; /* 0x04 */
+ uint32 VDL_STATUS; /* 0x08 */
+ uint32 unused; /* 0x0c */
+ uint32 VDL_OVERRIDE_0; /* 0x10 */
+ uint32 VDL_OVERRIDE_1; /* 0x14 */
+ uint32 VDL_OVERRIDE_2; /* 0x18 */
+ uint32 VDL_OVERRIDE_3; /* 0x1c */
+ uint32 VDL_OVERRIDE_4; /* 0x20 */
+ uint32 VDL_OVERRIDE_5; /* 0x24 */
+ uint32 VDL_OVERRIDE_6; /* 0x28 */
+ uint32 VDL_OVERRIDE_7; /* 0x2c */
+ uint32 READ_CONTROL; /* 0x30 */
+ uint32 READ_FIFO_STATUS; /* 0x34 */
+ uint32 READ_FIFO_CLEAR; /* 0x38 */
+ uint32 IDLE_PAD_CONTROL; /* 0x3c */
+ uint32 DRIVE_PAD_CTL; /* 0x40 */
+ uint32 CLOCK_PAD_DISABLE; /* 0x44 */
+ uint32 WR_PREAMBLE_MODE; /* 0x48 */
+ uint32 CLOCK_REG_CONTROL; /* 0x4C */
+ uint32 unused0[44];
+} DDRPhyByteLaneControl;
+
+typedef struct DDRControl {
+ uint32 CNFG; /* 0x000 */
+ uint32 CSST; /* 0x004 */
+ uint32 CSEND; /* 0x008 */
+ uint32 unused; /* 0x00c */
+ uint32 ROW00_0; /* 0x010 */
+ uint32 ROW00_1; /* 0x014 */
+ uint32 ROW01_0; /* 0x018 */
+ uint32 ROW01_1; /* 0x01c */
+ uint32 unused0[4];
+ uint32 ROW20_0; /* 0x030 */
+ uint32 ROW20_1; /* 0x034 */
+ uint32 ROW21_0; /* 0x038 */
+ uint32 ROW21_1; /* 0x03c */
+ uint32 unused1[4];
+ uint32 COL00_0; /* 0x050 */
+ uint32 COL00_1; /* 0x054 */
+ uint32 COL01_0; /* 0x058 */
+ uint32 COL01_1; /* 0x05c */
+ uint32 unused2[4];
+ uint32 COL20_0; /* 0x070 */
+ uint32 COL20_1; /* 0x074 */
+ uint32 COL21_0; /* 0x078 */
+ uint32 COL21_1; /* 0x07c */
+ uint32 unused3[4];
+ uint32 BNK10; /* 0x090 */
+ uint32 BNK32; /* 0x094 */
+ uint32 unused4[26];
+ uint32 DCMD; /* 0x100 */
+#define DCMD_CS1 (1 << 5)
+#define DCMD_CS0 (1 << 4)
+#define DCMD_SET_SREF 4
+ uint32 DMODE_0; /* 0x104 */
+ uint32 DMODE_1; /* 0x108 */
+#define DMODE_1_DRAMSLEEP (1 << 11)
+ uint32 CLKS; /* 0x10c */
+ uint32 ODT; /* 0x110 */
+ uint32 TIM1_0; /* 0x114 */
+ uint32 TIM1_1; /* 0x118 */
+ uint32 TIM2; /* 0x11c */
+ uint32 CTL_CRC; /* 0x120 */
+ uint32 DOUT_CRC; /* 0x124 */
+ uint32 DIN_CRC; /* 0x128 */
+ uint32 unused5[53];
+
+ DDRPhyControl PhyControl; /* 0x200 */
+ DDRPhyByteLaneControl PhyByteLane0Control; /* 0x300 */
+ DDRPhyByteLaneControl PhyByteLane1Control; /* 0x400 */
+ DDRPhyByteLaneControl PhyByteLane2Control; /* 0x500 */
+ DDRPhyByteLaneControl PhyByteLane3Control; /* 0x600 */
+ uint32 unused6[64];
+
+ uint32 GCFG; /* 0x800 */
+ uint32 LBIST_CFG; /* 0x804 */
+ uint32 LBIST_SEED; /* 0x808 */
+ uint32 ARB; /* 0x80c */
+ uint32 PI_GCF; /* 0x810 */
+ uint32 PI_UBUS_CTL; /* 0x814 */
+ uint32 PI_MIPS_CTL; /* 0x818 */
+ uint32 PI_DSL_MIPS_CTL; /* 0x81c */
+ uint32 PI_DSL_PHY_CTL; /* 0x820 */
+ uint32 PI_UBUS_ST; /* 0x824 */
+ uint32 PI_MIPS_ST; /* 0x828 */
+ uint32 PI_DSL_MIPS_ST; /* 0x82c */
+ uint32 PI_DSL_PHY_ST; /* 0x830 */
+ uint32 PI_UBUS_SMPL; /* 0x834 */
+ uint32 TESTMODE; /* 0x838 */
+ uint32 TEST_CFG1; /* 0x83c */
+ uint32 TEST_PAT; /* 0x840 */
+ uint32 TEST_COUNT; /* 0x844 */
+ uint32 TEST_CURR_COUNT; /* 0x848 */
+ uint32 TEST_ADDR_UPDT; /* 0x84c */
+ uint32 TEST_ADDR; /* 0x850 */
+ uint32 TEST_DATA0; /* 0x854 */
+ uint32 TEST_DATA1; /* 0x858 */
+ uint32 TEST_DATA2; /* 0x85c */
+ uint32 TEST_DATA3; /* 0x860 */
+} DDRControl;
+
+#define DDR ((volatile DDRControl * const) DDR_BASE)
+
+/*
+** Peripheral Controller
+*/
+
+#define IRQ_BITS 64
+typedef struct {
+ uint64 IrqMask;
+ uint64 IrqStatus;
+} IrqControl_t;
+
+typedef struct PerfControl {
+ uint32 RevID; /* (00) word 0 */
+ uint32 blkEnables; /* (04) word 1 */
+#define NAND_CLK_EN (1 << 20)
+#define PHYMIPS_CLK_EN (1 << 19)
+#define FAP_CLK_EN (1 << 18)
+#define PCIE_CLK_EN (1 << 17)
+#define HS_SPI_CLK_EN (1 << 16)
+#define SPI_CLK_EN (1 << 15)
+#define IPSEC_CLK_EN (1 << 14)
+#define USBH_CLK_EN (1 << 13)
+#define USBD_CLK_EN (1 << 12)
+#define PCM_CLK_EN (1 << 11)
+#define ROBOSW_CLK_EN (1 << 10)
+#define SAR_CLK_EN (1 << 9)
+#define SWPKT_SAR_CLK_EN (1 << 8)
+#define SWPKT_USB_CLK_EN (1 << 7)
+#define WLAN_OCP_CLK_EN (1 << 5)
+#define MIPS_CLK_EN (1 << 4)
+#define ADSL_CLK_EN (1 << 3)
+#define ADSL_AFE_EN (1 << 2)
+#define ADSL_QPROC_EN (1 << 1)
+#define DISABLE_GLESS (1 << 0)
+
+ uint32 pll_control; /* (08) word 2 */
+#define SOFT_RESET 0x00000001 // 0
+
+ uint32 deviceTimeoutEn; /* (0c) word 3 */
+ uint32 softResetB; /* (10) word 4 */
+#define SOFT_RST_WLAN_SHIM_UBUS (1 << 14)
+#define SOFT_RST_FAP (1 << 13)
+#define SOFT_RST_DDR_PHY (1 << 12)
+#define SOFT_RST_WLAN_SHIM (1 << 11)
+#define SOFT_RST_PCIE_EXT (1 << 10)
+#define SOFT_RST_PCIE (1 << 9)
+#define SOFT_RST_PCIE_CORE (1 << 8)
+#define SOFT_RST_PCM (1 << 7)
+#define SOFT_RST_USBH (1 << 6)
+#define SOFT_RST_USBD (1 << 5)
+#define SOFT_RST_SWITCH (1 << 4)
+#define SOFT_RST_SAR (1 << 3)
+#define SOFT_RST_EPHY (1 << 2)
+#define SOFT_RST_IPSEC (1 << 1)
+#define SOFT_RST_SPI (1 << 0)
+
+ uint32 diagControl; /* (14) word 5 */
+ uint32 ExtIrqCfg; /* (18) word 6*/
+ uint32 unused1; /* (1c) word 7 */
+#define EI_SENSE_SHFT 0
+#define EI_STATUS_SHFT 4
+#define EI_CLEAR_SHFT 8
+#define EI_MASK_SHFT 12
+#define EI_INSENS_SHFT 16
+#define EI_LEVEL_SHFT 20
+
+ IrqControl_t IrqControl[2];
+} PerfControl;
+
+#define PERF ((volatile PerfControl * const) PERF_BASE)
+
+/*
+** Timer
+*/
+typedef struct Timer {
+ uint16 unused0;
+ byte TimerMask;
+#define TIMER0EN 0x01
+#define TIMER1EN 0x02
+#define TIMER2EN 0x04
+ byte TimerInts;
+#define TIMER0 0x01
+#define TIMER1 0x02
+#define TIMER2 0x04
+#define WATCHDOG 0x08
+ uint32 TimerCtl0;
+ uint32 TimerCtl1;
+ uint32 TimerCtl2;
+#define TIMERENABLE 0x80000000
+#define RSTCNTCLR 0x40000000
+ uint32 TimerCnt0;
+ uint32 TimerCnt1;
+ uint32 TimerCnt2;
+ uint32 WatchDogDefCount;
+
+ /* Write 0xff00 0x00ff to Start timer
+ * Write 0xee00 0x00ee to Stop and re-load default count
+ * Read from this register returns current watch dog count
+ */
+ uint32 WatchDogCtl;
+
+ /* Number of 50-MHz ticks for WD Reset pulse to last */
+ uint32 WDResetCount;
+} Timer;
+
+#define TIMER ((volatile Timer * const) TIMR_BASE)
+
+/*
+** UART
+*/
+typedef struct UartChannel {
+ byte unused0;
+ byte control;
+#define BRGEN 0x80 /* Control register bit defs */
+#define TXEN 0x40
+#define RXEN 0x20
+#define LOOPBK 0x10
+#define TXPARITYEN 0x08
+#define TXPARITYEVEN 0x04
+#define RXPARITYEN 0x02
+#define RXPARITYEVEN 0x01
+
+ byte config;
+#define XMITBREAK 0x40
+#define BITS5SYM 0x00
+#define BITS6SYM 0x10
+#define BITS7SYM 0x20
+#define BITS8SYM 0x30
+#define ONESTOP 0x07
+#define TWOSTOP 0x0f
+ /* 4-LSBS represent STOP bits/char
+ * in 1/8 bit-time intervals. Zero
+ * represents 1/8 stop bit interval.
+ * Fifteen represents 2 stop bits.
+ */
+ byte fifoctl;
+#define RSTTXFIFOS 0x80
+#define RSTRXFIFOS 0x40
+ /* 5-bit TimeoutCnt is in low bits of this register.
+ * This count represents the number of characters
+ * idle times before setting receive Irq when below threshold
+ */
+ uint32 baudword;
+ /* When divide SysClk/2/(1+baudword) we should get 32*bit-rate
+ */
+
+ byte txf_levl; /* Read-only fifo depth */
+ byte rxf_levl; /* Read-only fifo depth */
+ byte fifocfg; /* Upper 4-bits are TxThresh, Lower are
+ * RxThreshold. Irq can be asserted
+ * when rx fifo> thresh, txfifo<thresh
+ */
+ byte prog_out; /* Set value of DTR (Bit0), RTS (Bit1)
+ * if these bits are also enabled to GPIO_o
+ */
+#define DTREN 0x01
+#define RTSEN 0x02
+
+ byte unused1;
+ byte DeltaIPEdgeNoSense; /* Low 4-bits, set corr bit to 1 to
+ * detect irq on rising AND falling
+ * edges for corresponding GPIO_i
+ * if enabled (edge insensitive)
+ */
+ byte DeltaIPConfig_Mask; /* Upper 4 bits: 1 for posedge sense
+ * 0 for negedge sense if
+ * not configured for edge
+ * insensitive (see above)
+ * Lower 4 bits: Mask to enable change
+ * detection IRQ for corresponding
+ * GPIO_i
+ */
+ byte DeltaIP_SyncIP; /* Upper 4 bits show which bits
+ * have changed (may set IRQ).
+ * read automatically clears bit
+ * Lower 4 bits are actual status
+ */
+
+ uint16 intMask; /* Same Bit defs for Mask and status */
+ uint16 intStatus;
+#define DELTAIP 0x0001
+#define TXUNDERR 0x0002
+#define TXOVFERR 0x0004
+#define TXFIFOTHOLD 0x0008
+#define TXREADLATCH 0x0010
+#define TXFIFOEMT 0x0020
+#define RXUNDERR 0x0040
+#define RXOVFERR 0x0080
+#define RXTIMEOUT 0x0100
+#define RXFIFOFULL 0x0200
+#define RXFIFOTHOLD 0x0400
+#define RXFIFONE 0x0800
+#define RXFRAMERR 0x1000
+#define RXPARERR 0x2000
+#define RXBRK 0x4000
+
+ uint16 unused2;
+ uint16 Data; /* Write to TX, Read from RX */
+ /* bits 11:8 are BRK,PAR,FRM errors */
+
+ uint32 unused3;
+ uint32 unused4;
+} Uart;
+
+#define UART ((volatile Uart * const) UART_BASE)
+
+/*
+** Gpio Controller
+*/
+
+typedef struct GpioControl {
+ uint64 GPIODir; /* 0 */
+ uint64 GPIOio; /* 8 */
+ uint32 LEDCtrl; /* 10 */
+ uint32 SpiSlaveCfg; /* 14 */
+ uint32 GPIOMode; /* 18 */
+#define GPIO_MODE_EXT_IRQ3 (1<<27)
+#define GPIO_MODE_EXT_IRQ2 (1<<26)
+#define GPIO_MODE_EXT_IRQ1 (1<<25)
+#define GPIO_MODE_EXT_IRQ0 (1<<24)
+#define GPIO_MODE_EPHY3_LED (1<<23)
+#define GPIO_MODE_EPHY2_LED (1<<22)
+#define GPIO_MODE_EPHY1_LED (1<<21)
+#define GPIO_MODE_EPHY0_LED (1<<20)
+#define GPIO_MODE_ADSL_SPI_SSB (1<<19)
+#define GPIO_MODE_ADSL_SPI_CLK (1<<18)
+#define GPIO_MODE_ADSL_SPI_MOSI (1<<17)
+#define GPIO_MODE_ADSL_SPI_MISO (1<<16)
+#define GPIO_MODE_UART2_SDOUT (1<<15)
+#define GPIO_MODE_UART2_SDIN (1<<14)
+#define GPIO_MODE_UART2_SRTS (1<<13)
+#define GPIO_MODE_UART2_SCTS (1<<12)
+#define GPIO_MODE_NTR_PULSE (1<<11)
+#define GPIO_MODE_LS_SPIM_SSB3 (1<<10)
+#define GPIO_MODE_LS_SPIM_SSB2 (1<<9)
+#define GPIO_MODE_INET_LED (1<<8)
+#define GPIO_MODE_ROBOSW_LED1 (1<<7)
+#define GPIO_MODE_ROBOSW_LED0 (1<<6)
+#define GPIO_MODE_ROBOSW_LED_CLK (1<<5)
+#define GPIO_MODE_ROBOSW_LED_DATA (1<<4)
+#define GPIO_MODE_SERIAL_LED_DATA (1<<3)
+#define GPIO_MODE_SERIAL_LED_CLK (1<<2)
+#define GPIO_MODE_SYS_IRQ (1<<1)
+#define GPIO_MODE_USBD_LED (1<<0)
+
+ uint32 GPIOCtrl; /* 1C */
+ uint32 unused3[2]; /* 20 - 24*/
+ uint32 TestControl; /* 28 */
+ uint32 OscControl; /* 2C */
+ uint32 RoboSWLEDControl; /* 30 */
+ uint32 RoboSWLEDLSR; /* 34 */
+ uint32 GPIOBaseMode; /* 38 */
+#define NAND_GPIO_OVERRIDE (1<<2)
+ uint32 RoboswEphyCtrl; /* 3C */
+#define EPHY_PLL_LOCK (1<<27)
+#define EPHY_ATEST_25MHZ_EN (1<<26)
+#define EPHY_PWR_DOWN_DLL (1<<25)
+#define EPHY_PWR_DOWN_BIAS (1<<24)
+#define EPHY_PWR_DOWN_TX_4 (1<<23)
+#define EPHY_PWR_DOWN_TX_3 (1<<22)
+#define EPHY_PWR_DOWN_TX_2 (1<<21)
+#define EPHY_PWR_DOWN_TX_1 (1<<20)
+#define EPHY_PWR_DOWN_RX_4 (1<<19)
+#define EPHY_PWR_DOWN_RX_3 (1<<18)
+#define EPHY_PWR_DOWN_RX_2 (1<<17)
+#define EPHY_PWR_DOWN_RX_1 (1<<16)
+#define EPHY_PWR_DOWN_SD_4 (1<<15)
+#define EPHY_PWR_DOWN_SD_3 (1<<14)
+#define EPHY_PWR_DOWN_SD_2 (1<<13)
+#define EPHY_PWR_DOWN_SD_1 (1<<12)
+#define EPHY_PWR_DOWN_RD_4 (1<<11)
+#define EPHY_PWR_DOWN_RD_3 (1<<10)
+#define EPHY_PWR_DOWN_RD_2 (1<<9)
+#define EPHY_PWR_DOWN_RD_1 (1<<8)
+#define EPHY_PWR_DOWN_4 (1<<7)
+#define EPHY_PWR_DOWN_3 (1<<6)
+#define EPHY_PWR_DOWN_2 (1<<5)
+#define EPHY_PWR_DOWN_1 (1<<4)
+#define EPHY_RST_4 (1<<3)
+#define EPHY_RST_3 (1<<2)
+#define EPHY_RST_2 (1<<1)
+#define EPHY_RST_1 (1<<0)
+ uint32 RoboswSwitchCtrl; /* 40 */
+#define RSW_MII_2_IFC_EN (1<<23)
+#define RSW_MII_2_AMP_EN (1<<22)
+#define RSW_MII_2_SEL_SHIFT 20
+#define RSW_MII_SEL_3P3V 0
+#define RSW_MII_SEL_2P5V 1
+#define RSW_MII_SEL_1P5V 2
+#define RSW_MII_AMP_EN (1<<18)
+#define RSW_MII_SEL_SHIFT 16
+#define RSW_SPI_MODE (1<<11)
+#define RSW_BC_SUPP_EN (1<<10)
+#define RSW_CLK_FREQ_MASK (3<<8)
+#define RSW_ENF_DFX_FLOW (1<<7)
+#define RSW_ENH_DFX_FLOW (1<<6)
+#define RSW_GRX_0_SETUP (1<<5)
+#define RSW_GTX_0_SETUP (1<<4)
+#define RSW_HW_FWDG_EN (1<<3)
+#define RSW_QOS_EN (1<<2)
+#define RSW_WD_CLR_EN (1<<1)
+#define RSW_MII_DUMB_FWDG_EN (1<<0)
+
+ uint32 RegFileTmCtl; /* 44 */
+
+ uint32 RingOscCtrl0; /* 48 */
+#define RING_OSC_256_CYCLES 8
+#define RING_OSC_512_CYCLES 9
+#define RING_OSC_1024_CYCLES 10
+
+ uint32 RingOscCtrl1; /* 4C */
+#define RING_OSC_ENABLE_MASK (0x0f<<24)
+#define RING_OSC_ENABLE_SHIFT 24
+#define RING_OSC_MAX 4
+#define RING_OSC_COUNT_RESET (0x1<<23)
+#define RING_OSC_SELECT_MASK (0x7<<20)
+#define RING_OSC_SELECT_SHIFT 20
+#define RING_OSC_IRQ (0x1<<18)
+#define RING_OSC_COUNTER_OVERFLOW (0x1<<17)
+#define RING_OSC_COUNTER_BUSY (0x1<<16)
+#define RING_OSC_COUNT_MASK 0x0000ffff
+
+ uint32 unused4[6]; /* 50 - 64 */
+ uint32 DieRevID; /* 68 */
+ uint32 unused5; /* 6c */
+ uint32 DiagSelControl; /* 70 */
+ uint32 DiagReadBack; /* 74 */
+ uint32 DiagReadBackHi; /* 78 */
+ uint32 DiagMiscControl; /* 7c */
+} GpioControl;
+
+#define GPIO ((volatile GpioControl * const) GPIO_BASE)
+
+/* Number to mask conversion macro used for GPIODir and GPIOio */
+#define GPIO_NUM_MAX 48
+#define GPIO_NUM_TO_MASK(X) ( (((X) & BP_GPIO_NUM_MASK) < GPIO_NUM_MAX) ? ((uint64)1 << ((X) & BP_GPIO_NUM_MASK)) : (0) )
+
+/*
+** Spi Controller
+*/
+
+typedef struct SpiControl {
+ uint16 spiMsgCtl; /* (0x0) control byte */
+#define FULL_DUPLEX_RW 0
+#define HALF_DUPLEX_W 1
+#define HALF_DUPLEX_R 2
+#define SPI_MSG_TYPE_SHIFT 14
+#define SPI_BYTE_CNT_SHIFT 0
+ byte spiMsgData[0x21e]; /* (0x02 - 0x21f) msg data */
+ byte unused0[0x1e0];
+ byte spiRxDataFifo[0x220]; /* (0x400 - 0x61f) rx data */
+ byte unused1[0xe0];
+
+ uint16 spiCmd; /* (0x700): SPI command */
+#define SPI_CMD_NOOP 0
+#define SPI_CMD_SOFT_RESET 1
+#define SPI_CMD_HARD_RESET 2
+#define SPI_CMD_START_IMMEDIATE 3
+
+#define SPI_CMD_COMMAND_SHIFT 0
+#define SPI_CMD_COMMAND_MASK 0x000f
+
+#define SPI_CMD_DEVICE_ID_SHIFT 4
+#define SPI_CMD_PREPEND_BYTE_CNT_SHIFT 8
+#define SPI_CMD_ONE_BYTE_SHIFT 11
+#define SPI_CMD_ONE_WIRE_SHIFT 12
+#define SPI_DEV_ID_0 0
+#define SPI_DEV_ID_1 1
+#define SPI_DEV_ID_2 2
+#define SPI_DEV_ID_3 3
+
+ byte spiIntStatus; /* (0x702): SPI interrupt status */
+ byte spiMaskIntStatus; /* (0x703): SPI masked interrupt status */
+
+ byte spiIntMask; /* (0x704): SPI interrupt mask */
+#define SPI_INTR_CMD_DONE 0x01
+#define SPI_INTR_RX_OVERFLOW 0x02
+#define SPI_INTR_INTR_TX_UNDERFLOW 0x04
+#define SPI_INTR_TX_OVERFLOW 0x08
+#define SPI_INTR_RX_UNDERFLOW 0x10
+#define SPI_INTR_CLEAR_ALL 0x1f
+
+ byte spiStatus; /* (0x705): SPI status */
+#define SPI_RX_EMPTY 0x02
+#define SPI_CMD_BUSY 0x04
+#define SPI_SERIAL_BUSY 0x08
+
+ byte spiClkCfg; /* (0x706): SPI clock configuration */
+#define SPI_CLK_0_391MHZ 1
+#define SPI_CLK_0_781MHZ 2 /* default */
+#define SPI_CLK_1_563MHZ 3
+#define SPI_CLK_3_125MHZ 4
+#define SPI_CLK_6_250MHZ 5
+#define SPI_CLK_12_50MHZ 6
+#define SPI_CLK_MASK 0x07
+#define SPI_SSOFFTIME_MASK 0x38
+#define SPI_SSOFFTIME_SHIFT 3
+#define SPI_BYTE_SWAP 0x80
+
+ byte spiFillByte; /* (0x707): SPI fill byte */
+ byte unused2;
+ byte spiMsgTail; /* (0x709): msgtail */
+ byte unused3;
+ byte spiRxTail; /* (0x70B): rxtail */
+} SpiControl;
+
+#define SPI ((volatile SpiControl * const) SPI_BASE)
+
+
+/*
+** High-Speed SPI Controller
+*/
+
+#define __mask(end, start) (((1 << ((end - start) + 1)) - 1) << start)
+typedef struct HsSpiControl {
+
+ uint32 hs_spiGlobalCtrl; // 0x0000
+#define HS_SPI_MOSI_IDLE (1 << 18)
+#define HS_SPI_CLK_POLARITY (1 << 17)
+#define HS_SPI_CLK_GATE_SSOFF (1 << 16)
+#define HS_SPI_PLL_CLK_CTRL (8)
+#define HS_SPI_PLL_CLK_CTRL_MASK __mask(15, HS_SPI_PLL_CLK_CTRL)
+#define HS_SPI_SS_POLARITY (0)
+#define HS_SPI_SS_POLARITY_MASK __mask(7, HS_SPI_SS_POLARITY)
+
+ uint32 hs_spiExtTrigCtrl; // 0x0004
+#define HS_SPI_TRIG_RAW_STATE (24)
+#define HS_SPI_TRIG_RAW_STATE_MASK __mask(31, HS_SPI_TRIG_RAW_STATE)
+#define HS_SPI_TRIG_LATCHED (16)
+#define HS_SPI_TRIG_LATCHED_MASK __mask(23, HS_SPI_TRIG_LATCHED)
+#define HS_SPI_TRIG_SENSE (8)
+#define HS_SPI_TRIG_SENSE_MASK __mask(15, HS_SPI_TRIG_SENSE)
+#define HS_SPI_TRIG_TYPE (0)
+#define HS_SPI_TRIG_TYPE_MASK __mask(7, HS_SPI_TRIG_TYPE)
+#define HS_SPI_TRIG_TYPE_EDGE (0)
+#define HS_SPI_TRIG_TYPE_LEVEL (1)
+
+ uint32 hs_spiIntStatus; // 0x0008
+#define HS_SPI_IRQ_PING1_USER (28)
+#define HS_SPI_IRQ_PING1_USER_MASK __mask(31, HS_SPI_IRQ_PING1_USER)
+#define HS_SPI_IRQ_PING0_USER (24)
+#define HS_SPI_IRQ_PING0_USER_MASK __mask(27, HS_SPI_IRQ_PING0_USER)
+
+#define HS_SPI_IRQ_PING1_CTRL_INV (1 << 12)
+#define HS_SPI_IRQ_PING1_POLL_TOUT (1 << 11)
+#define HS_SPI_IRQ_PING1_TX_UNDER (1 << 10)
+#define HS_SPI_IRQ_PING1_RX_OVER (1 << 9)
+#define HS_SPI_IRQ_PING1_CMD_DONE (1 << 8)
+
+#define HS_SPI_IRQ_PING0_CTRL_INV (1 << 4)
+#define HS_SPI_IRQ_PING0_POLL_TOUT (1 << 3)
+#define HS_SPI_IRQ_PING0_TX_UNDER (1 << 2)
+#define HS_SPI_IRQ_PING0_RX_OVER (1 << 1)
+#define HS_SPI_IRQ_PING0_CMD_DONE (1 << 0)
+
+ uint32 hs_spiIntStatusMasked; // 0x000C
+#define HS_SPI_IRQSM__PING1_USER (28)
+#define HS_SPI_IRQSM__PING1_USER_MASK __mask(31, HS_SPI_IRQSM__PING1_USER)
+#define HS_SPI_IRQSM__PING0_USER (24)
+#define HS_SPI_IRQSM__PING0_USER_MASK __mask(27, HS_SPI_IRQSM__PING0_USER)
+
+#define HS_SPI_IRQSM__PING1_CTRL_INV (1 << 12)
+#define HS_SPI_IRQSM__PING1_POLL_TOUT (1 << 11)
+#define HS_SPI_IRQSM__PING1_TX_UNDER (1 << 10)
+#define HS_SPI_IRQSM__PING1_RX_OVER (1 << 9)
+#define HS_SPI_IRQSM__PING1_CMD_DONE (1 << 8)
+
+#define HS_SPI_IRQSM__PING0_CTRL_INV (1 << 4)
+#define HS_SPI_IRQSM__PING0_POLL_TOUT (1 << 3)
+#define HS_SPI_IRQSM__PING0_TX_UNDER (1 << 2)
+#define HS_SPI_IRQSM__PING0_RX_OVER (1 << 1)
+#define HS_SPI_IRQSM__PING0_CMD_DONE (1 << 0)
+
+ uint32 hs_spiIntMask; // 0x0010
+#define HS_SPI_IRQM_PING1_USER (28)
+#define HS_SPI_IRQM_PING1_USER_MASK __mask(31, HS_SPI_IRQM_PING1_USER)
+#define HS_SPI_IRQM_PING0_USER (24)
+#define HS_SPI_IRQM_PING0_USER_MASK __mask(27, HS_SPI_IRQM_PING0_USER)
+
+#define HS_SPI_IRQM_PING1_CTRL_INV (1 << 12)
+#define HS_SPI_IRQM_PING1_POLL_TOUT (1 << 11)
+#define HS_SPI_IRQM_PING1_TX_UNDER (1 << 10)
+#define HS_SPI_IRQM_PING1_RX_OVER (1 << 9)
+#define HS_SPI_IRQM_PING1_CMD_DONE (1 << 8)
+
+#define HS_SPI_IRQM_PING0_CTRL_INV (1 << 4)
+#define HS_SPI_IRQM_PING0_POLL_TOUT (1 << 3)
+#define HS_SPI_IRQM_PING0_TX_UNDER (1 << 2)
+#define HS_SPI_IRQM_PING0_RX_OVER (1 << 1)
+#define HS_SPI_IRQM_PING0_CMD_DONE (1 << 0)
+
+#define HS_SPI_INTR_CLEAR_ALL (0xFF001F1F)
+
+ uint32 hs_spiFlashCtrl; // 0x0014
+#define HS_SPI_FCTRL_MB_ENABLE (1 << 23)
+#define HS_SPI_FCTRL_SS_NUM (20)
+#define HS_SPI_FCTRL_SS_NUM_MASK __mask(22, HS_SPI_FCTRL_SS_NUM)
+#define HS_SPI_FCTRL_PROFILE_NUM (16)
+#define HS_SPI_FCTRL_PROFILE_NUM_MASK __mask(18, HS_SPI_FCTRL_PROFILE_NUM)
+#define HS_SPI_FCTRL_DUMMY_BYTES (10)
+#define HS_SPI_FCTRL_DUMMY_BYTES_MASK __mask(11, HS_SPI_FCTRL_DUMMY_BYTES)
+#define HS_SPI_FCTRL_ADDR_BYTES (8)
+#define HS_SPI_FCTRL_ADDR_BYTES_MASK __mask(9, HS_SPI_FCTRL_ADDR_BYTES)
+#define HS_SPI_FCTRL_ADDR_BYTES_2 (0)
+#define HS_SPI_FCTRL_ADDR_BYTES_3 (1)
+#define HS_SPI_FCTRL_ADDR_BYTES_4 (2)
+#define HS_SPI_FCTRL_READ_OPCODE (0)
+#define HS_SPI_FCTRL_READ_OPCODE_MASK __mask(7, HS_SPI_FCTRL_READ_OPCODE)
+
+ uint32 hs_spiFlashAddrBase; // 0x0018
+
+ char fill0[0x80 - 0x18];
+
+ uint32 hs_spiPP_0_Cmd; // 0x0080
+#define HS_SPI_PP_SS_NUM (12)
+#define HS_SPI_PP_SS_NUM_MASK __mask(14, HS_SPI_PP_SS_NUM)
+#define HS_SPI_PP_PROFILE_NUM (8)
+#define HS_SPI_PP_PROFILE_NUM_MASK __mask(10, HS_SPI_PP_PROFILE_NUM)
+
+} HsSpiControl;
+
+typedef struct HsSpiPingPong {
+
+ uint32 command;
+#define HS_SPI_SS_NUM (12)
+#define HS_SPI_PROFILE_NUM (8)
+#define HS_SPI_TRIGGER_NUM (4)
+#define HS_SPI_COMMAND_VALUE (0)
+ #define HS_SPI_COMMAND_NOOP (0)
+ #define HS_SPI_COMMAND_START_NOW (1)
+ #define HS_SPI_COMMAND_START_TRIGGER (2)
+ #define HS_SPI_COMMAND_HALT (3)
+ #define HS_SPI_COMMAND_FLUSH (4)
+
+ uint32 status;
+#define HS_SPI_ERROR_BYTE_OFFSET (16)
+#define HS_SPI_WAIT_FOR_TRIGGER (2)
+#define HS_SPI_SOURCE_BUSY (1)
+#define HS_SPI_SOURCE_GNT (0)
+
+ uint32 fifo_status;
+ uint32 control;
+
+} HsSpiPingPong;
+
+typedef struct HsSpiProfile {
+
+ uint32 clk_ctrl;
+#define HS_SPI_ACCUM_RST_ON_LOOP (15)
+#define HS_SPI_SPI_CLK_2X_SEL (14)
+#define HS_SPI_FREQ_CTRL_WORD (0)
+
+ uint32 signal_ctrl;
+#define HS_SPI_ASYNC_INPUT_PATH (1 << 16)
+#define HS_SPI_LAUNCH_RISING (1 << 13)
+#define HS_SPI_LATCH_RISING (1 << 12)
+
+ uint32 mode_ctrl;
+#define HS_SPI_PREPENDBYTE_CNT (24)
+#define HS_SPI_MODE_ONE_WIRE (20)
+#define HS_SPI_MULTIDATA_WR_SIZE (18)
+#define HS_SPI_MULTIDATA_RD_SIZE (16)
+#define HS_SPI_MULTIDATA_WR_STRT (12)
+#define HS_SPI_MULTIDATA_RD_STRT (8)
+#define HS_SPI_FILLBYTE (0)
+
+ uint32 polling_config;
+ uint32 polling_and_mask;
+ uint32 polling_compare;
+ uint32 polling_timeout;
+ uint32 reserved;
+
+} HsSpiProfile;
+
+#define HS_SPI_OP_CODE 13
+ #define HS_SPI_OP_SLEEP (0)
+ #define HS_SPI_OP_READ_WRITE (1)
+ #define HS_SPI_OP_WRITE (2)
+ #define HS_SPI_OP_READ (3)
+ #define HS_SPI_OP_SETIRQ (4)
+
+#define HS_SPI ((volatile HsSpiControl * const) HSSPIM_BASE)
+#define HS_SPI_PINGPONG0 ((volatile HsSpiPingPong * const) (HSSPIM_BASE+0x80))
+#define HS_SPI_PINGPONG1 ((volatile HsSpiPingPong * const) (HSSPIM_BASE+0xc0))
+#define HS_SPI_PROFILES ((volatile HsSpiProfile * const) (HSSPIM_BASE+0x100))
+#define HS_SPI_FIFO0 ((volatile uint8 * const) (HSSPIM_BASE+0x200))
+#define HS_SPI_FIFO1 ((volatile uint8 * const) (HSSPIM_BASE+0x400))
+
+
+/*
+** Misc Register Set Definitions.
+*/
+
+typedef struct Misc {
+ uint32 unused1; /* 0x00 */
+ uint32 miscSerdesCtrl; /* 0x04 */
+#define SERDES_PCIE_ENABLE 0x00000001
+#define SERDES_PCIE_EXD_ENABLE (1<<15)
+
+ uint32 miscSerdesSts; /* 0x08 */
+ uint32 miscIrqOutMask; /* 0x0C */
+#define MISC_PCIE_EP_IRQ_MASK0 (1<<0)
+#define MISC_PCIE_EP_IRQ_MASK1 (1<<1)
+
+ uint32 miscMemcControl; /* 0x10 */
+#define MISC_MEMC_CONTROL_MC_UBUS_ASYNC_MODE (1<<3)
+#define MISC_MEMC_CONTROL_MC_LMB_ASYNC_MODE (1<<2)
+#define MISC_MEMC_CONTROL_DDR_TEST_DONE (1<<1)
+#define MISC_MEMC_CONTROL_DDR_TEST_DISABLE (1<<0)
+
+ uint32 miscStrapBus; /* 0x14 */
+#define MISC_STRAP_BUS_RESET_CFG_DELAY (1<<18)
+#define MISC_STRAP_BUS_RESET_OUT_SHIFT 16
+#define MISC_STRAP_BUS_RESET_OUT_MASK (3<<MISC_STRAP_BUS_RESET_OUT_SHIFT)
+#define MISC_STRAP_BUS_BOOT_SEL_SHIFT 15
+#define MISC_STRAP_BUS_BOOT_SEL_MASK (0x1<<MISC_STRAP_BUS_BOOT_SEL_SHIFT)
+#define MISC_STRAP_BUS_BOOT_SERIAL 0x01
+#define MISC_STRAP_BUS_BOOT_NAND 0x00
+#define MISC_STRAP_BUS_HS_SPIM_24B_N_32B_ADDR (1<<14)
+#define MISC_STRAP_BUS_HS_SPIM_24B_N_32B_ADDR (1<<14)
+#define MISC_STRAP_BUS_HS_SPIM_CLK_SLOW_N_FAST (1<<13)
+#define MISC_STRAP_BUS_LS_SPIM_CLK_FAST_N_SLOW (1<<12)
+#define MISC_STRAP_BUS_LS_SPI_MASTER_N_SLAVE (1<<11)
+#define MISC_STRAP_BUS_PLL_USE_LOCK (1<<10)
+#define MISC_STRAP_BUS_PLL_MIPS_WAIT_FAST_N (1<<9)
+#define MISC_STRAP_BUS_ROBOSW_P4_MODE_SHIFT 7
+#define MISC_STRAP_BUS_ROBOSW_P4_MODE_MASK (3<<MISC_STRAP_BUS_ROBOSW_P4_MODE_SHIFT)
+#define MISC_STRAP_BUS_HARD_RESET_DELAY (1<<6)
+#define MISC_STRAP_BUS_MIPS_PLL_FVCO_SHIFT 1
+#define MISC_STRAP_BUS_MIPS_PLL_FVCO_MASK (0x1F<<MISC_STRAP_BUS_MIPS_PLL_FVCO_SHIFT)
+#define MISC_STRAP_BUS_PCIE_ROOT_COMPLEX (1<<0)
+
+ uint32 miscStrapOverride; /* 0x18 */
+ uint32 miscVregCtrl0; /* 0x1C */
+
+ uint32 miscVregCtrl1; /* 0x20 */
+#define VREG_VSEL1P2_SHIFT 0
+#define VREG_VSEL1P2_MASK 0x1f
+#define VREG_VSEL1P2_MIDDLE 0x0f
+
+ uint32 miscVregCtrl2; /* 0x24 */
+ uint32 miscExtra2ChipsIrqMask; /* 0x28 */
+ uint32 miscExtra2ChipsIrqSts; /* 0x2C */
+ uint32 miscExtra2ChipsIrqMask1; /* 0x30 */
+ uint32 miscExtra2ChipsIrqSts1; /* 0x34 */
+ uint32 miscFapIrqMask; /* 0x38 */
+ uint32 miscExtraFapIrqMask; /* 0x3C */
+ uint32 miscExtra2FapIrqMask; /* 0x40 */
+ uint32 miscAdsl_clock_sample; /* 0x44 */
+
+ uint32 miscIddqCtrl; /* 0x48 */
+#define MISC_IDDQ_CONTROL_USBD (1<<5)
+#define MISC_IDDQ_CONTROL_USBH (1<<4)
+
+ uint32 miscSleep; /* 0x4C */
+ uint32 miscRtc_enable; /* 0x50 */
+ uint32 miscRtc_count_L; /* 0x54 */
+ uint32 miscRtc_count_H; /* 0x58 */
+ uint32 miscRtc_event; /* 0x5C */
+ uint32 miscWakeup_mask; /* 0x60 */
+ uint32 miscWakeup_status; /* 0x64 */
+} Misc;
+
+#define MISC ((volatile Misc * const) MISC_BASE)
+
+/*
+** LedControl Register Set Definitions.
+*/
+
+#pragma pack(push, 4)
+typedef struct LedControl {
+ uint32 ledInit;
+#define LED_LED_TEST (1 << 31)
+#define LED_SHIFT_TEST (1 << 30)
+#define LED_SERIAL_LED_SHIFT_DIR (1 << 16)
+#define LED_SERIAL_LED_DATA_PPOL (1 << 15)
+#define LEDSERIAL_LED_CLK_NPOL (1 << 14)
+#define LED_SERIAL_LED_MUX_SEL (1 << 13)
+#define LED_SERIAL_LED_EN (1 << 12)
+#define LED_FAST_INTV_SHIFT 6
+#define LED_FAST_INTV_MASK (0x3F<<LED_FAST_INTV_SHIFT)
+#define LED_SLOW_INTV_SHIFT 0
+#define LED_SLOW_INTV_MASK (0x3F<<LED_SLOW_INTV_SHIFT)
+#define LED_INTERVAL_20MS 1
+
+ uint64 ledMode;
+#define LED_MODE_MASK (uint64)0x3
+#define LED_MODE_OFF (uint64)0x0
+#define LED_MODE_FLASH (uint64)0x1
+#define LED_MODE_BLINK (uint64)0x2
+#define LED_MODE_ON (uint64)0x3
+
+ uint32 ledHWDis;
+ uint32 ledStrobe;
+ uint32 ledLinkActSelHigh;
+#define LED_ENET0 4
+#define LED_ENET1 5
+#define LED_ENET2 6
+#define LED_ENET3 7
+#define LED_4_ACT_SHIFT 0
+#define LED_5_ACT_SHIFT 4
+#define LED_6_ACT_SHIFT 8
+#define LED_7_ACT_SHIFT 12
+#define LED_4_LINK_SHIFT 16
+#define LED_5_LINK_SHIFT 20
+#define LED_6_LINK_SHIFT 24
+#define LED_7_LINK_SHIFT 28
+ uint32 ledLinkActSelLow;
+#define LED_USB 0
+#define LED_INET 1
+#define LED_0_ACT_SHIFT 0
+#define LED_1_ACT_SHIFT 4
+#define LED_2_ACT_SHIFT 8
+#define LED_3_ACT_SHIFT 12
+#define LED_0_LINK_SHIFT 16
+#define LED_1_LINK_SHIFT 20
+#define LED_2_LINK_SHIFT 24
+#define LED_3_LINK_SHIFT 28
+
+ uint32 ledReadback;
+ uint32 ledSerialMuxSelect;
+} LedControl;
+#pragma pack(pop)
+
+#define LED ((volatile LedControl * const) LED_BASE)
+
+#define GPIO_NUM_TO_LED_MODE_SHIFT(X) \
+ ((((X) & BP_GPIO_NUM_MASK) < 8) ? (32 + (((X) & BP_GPIO_NUM_MASK) << 1)) : \
+ (((X) & BP_GPIO_SERIAL) ? ((((X) & BP_GPIO_NUM_MASK) - 8) << 1) : \
+ (((X) & BP_GPIO_NUM_MASK) < 16) ? (32 + ((((X) & BP_GPIO_NUM_MASK) - 8) << 1)) : \
+ ((((X) & BP_GPIO_NUM_MASK) - 16) << 1)))
+
+#define IUDMA_MAX_CHANNELS 32
+
+/*
+** DMA Channel Configuration (1 .. 32)
+*/
+typedef struct DmaChannelCfg {
+ uint32 cfg; /* (00) assorted configuration */
+#define DMA_ENABLE 0x00000001 /* set to enable channel */
+#define DMA_PKT_HALT 0x00000002 /* idle after an EOP flag is detected */
+#define DMA_BURST_HALT 0x00000004 /* idle after finish current memory burst */
+ uint32 intStat; /* (04) interrupts control and status */
+ uint32 intMask; /* (08) interrupts mask */
+#define DMA_BUFF_DONE 0x00000001 /* buffer done */
+#define DMA_DONE 0x00000002 /* packet xfer complete */
+#define DMA_NO_DESC 0x00000004 /* no valid descriptors */
+ uint32 maxBurst; /* (0C) max burst length permitted */
+#define DMA_DESCSIZE_SEL 0x00040000 /* DMA Descriptor Size Selection */
+} DmaChannelCfg;
+
+/*
+** DMA State RAM (1 .. 16)
+*/
+typedef struct DmaStateRam {
+ uint32 baseDescPtr; /* (00) descriptor ring start address */
+ uint32 state_data; /* (04) state/bytes done/ring offset */
+ uint32 desc_len_status; /* (08) buffer descriptor status and len */
+ uint32 desc_base_bufptr; /* (0C) buffer descrpitor current processing */
+} DmaStateRam;
+
+
+/*
+** DMA Registers
+*/
+typedef struct DmaRegs {
+ uint32 controller_cfg; /* (00) controller configuration */
+#define DMA_MASTER_EN 0x00000001
+#define DMA_FLOWC_CH1_EN 0x00000002
+#define DMA_FLOWC_CH3_EN 0x00000004
+
+ // Flow control Ch1
+ uint32 flowctl_ch1_thresh_lo; /* 004 */
+ uint32 flowctl_ch1_thresh_hi; /* 008 */
+ uint32 flowctl_ch1_alloc; /* 00c */
+#define DMA_BUF_ALLOC_FORCE 0x80000000
+
+ // Flow control Ch3
+ uint32 flowctl_ch3_thresh_lo; /* 010 */
+ uint32 flowctl_ch3_thresh_hi; /* 014 */
+ uint32 flowctl_ch3_alloc; /* 018 */
+
+ // Flow control Ch5
+ uint32 flowctl_ch5_thresh_lo; /* 01C */
+ uint32 flowctl_ch5_thresh_hi; /* 020 */
+ uint32 flowctl_ch5_alloc; /* 024 */
+
+ // Flow control Ch7
+ uint32 flowctl_ch7_thresh_lo; /* 028 */
+ uint32 flowctl_ch7_thresh_hi; /* 02C */
+ uint32 flowctl_ch7_alloc; /* 030 */
+
+ uint32 ctrl_channel_reset; /* 034 */
+ uint32 ctrl_channel_debug; /* 038 */
+ uint32 reserved1; /* 03C */
+ uint32 ctrl_global_interrupt_status; /* 040 */
+ uint32 ctrl_global_interrupt_mask; /* 044 */
+
+ // Unused words
+ uint8 reserved2[0x200-0x48];
+
+ // Per channel registers/state ram
+ DmaChannelCfg chcfg[IUDMA_MAX_CHANNELS];/* (200-3FF) Channel configuration */
+ union {
+ DmaStateRam s[IUDMA_MAX_CHANNELS];
+ uint32 u32[4 * IUDMA_MAX_CHANNELS];
+ } stram; /* (400-5FF) state ram */
+} DmaRegs;
+
+#define SW_DMA ((volatile DmaRegs * const) SWITCH_DMA_BASE)
+
+/*
+** DMA Buffer
+*/
+typedef struct DmaDesc {
+ union {
+ struct {
+ uint16 length; /* in bytes of data in buffer */
+#define DMA_DESC_USEFPM 0x8000
+#define DMA_DESC_MULTICAST 0x4000
+#define DMA_DESC_BUFLENGTH 0x0fff
+ uint16 status; /* buffer status */
+#define DMA_OWN 0x8000 /* cleared by DMA, set by SW */
+#define DMA_EOP 0x4000 /* last buffer in packet */
+#define DMA_SOP 0x2000 /* first buffer in packet */
+#define DMA_WRAP 0x1000 /* */
+#define DMA_PRIO 0x0C00 /* Prio for Tx */
+#define DMA_APPEND_BRCM_TAG 0x0200
+#define DMA_APPEND_CRC 0x0100
+#define USB_ZERO_PKT (1<< 0) // Set to send zero length packet
+ };
+ uint32 word0;
+ };
+
+ uint32 address; /* address of data */
+} DmaDesc;
+
+/*
+** 16 Byte DMA Buffer
+*/
+typedef struct {
+ union {
+ struct {
+ uint16 length; /* in bytes of data in buffer */
+#define DMA_DESC_USEFPM 0x8000
+#define DMA_DESC_MULTICAST 0x4000
+#define DMA_DESC_BUFLENGTH 0x0fff
+ uint16 status; /* buffer status */
+#define DMA_OWN 0x8000 /* cleared by DMA, set by SW */
+#define DMA_EOP 0x4000 /* last buffer in packet */
+#define DMA_SOP 0x2000 /* first buffer in packet */
+#define DMA_WRAP 0x1000 /* */
+#define DMA_PRIO 0x0C00 /* Prio for Tx */
+#define DMA_APPEND_BRCM_TAG 0x0200
+#define DMA_APPEND_CRC 0x0100
+#define USB_ZERO_PKT (1<< 0) // Set to send zero length packet
+ };
+ uint32 word0;
+ };
+
+ uint32 address; /* address of data */
+ uint32 control;
+#define GEM_ID_MASK 0x001F
+ uint32 reserved;
+} DmaDesc16;
+
+
+typedef struct USBControl {
+ uint32 BrtControl1;
+ uint32 BrtControl2;
+ uint32 BrtStatus1;
+ uint32 BrtStatus2;
+ uint32 UTMIControl1;
+ uint32 TestPortControl;
+ uint32 PllControl1;
+ uint32 SwapControl;
+#define USB_DEVICE_SEL (1<<6)
+#define EHCI_LOGICAL_ADDRESS_EN (1<<5)
+#define EHCI_ENDIAN_SWAP (1<<4)
+#define EHCI_DATA_SWAP (1<<3)
+#define OHCI_LOGICAL_ADDRESS_EN (1<<2)
+#define OHCI_ENDIAN_SWAP (1<<1)
+#define OHCI_DATA_SWAP (1<<0)
+ uint32 unused1;
+ uint32 FrameAdjustValue;
+ uint32 Setup;
+#define USBH_IOC (1<<4)
+ uint32 MDIO;
+ uint32 MDIO32;
+ uint32 USBSimControl;
+} USBControl;
+
+#define USBH ((volatile USBControl * const) USBH_CFG_BASE)
+
+/*
+** PCI-E
+*/
+typedef struct PcieRegs{
+ uint32 devVenID;
+ uint16 command;
+ uint16 status;
+ uint32 revIdClassCode;
+ uint32 headerTypeLatCacheLineSize;
+ uint32 bar1;
+ uint32 bar2;
+ uint32 priSecBusNo;
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SUB_BUS_NO_MASK 0x00ff0000
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SUB_BUS_NO_SHIFT 16
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SEC_BUS_NO_MASK 0x0000ff00
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SEC_BUS_NO_SHIFT 8
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_PRI_BUS_NO_MASK 0x000000ff
+
+ uint32 ioBaseLimit;
+ uint32 secStatus;
+ uint32 rcMemBaseLimit;
+ uint32 rcPrefBaseLimit;
+ uint32 rcPrefBaseHi;
+ uint32 rcPrefLimitHi;
+ uint32 rcIoBaseLimit;
+ uint32 capPointer;
+ uint32 expRomBase;
+ uint32 brdigeCtrlIntPinIntLine;
+ uint32 bridgeCtrl;
+ uint32 unused1[27];
+
+ /* PcieExpressCtrlRegs */
+ uint16 pciExpressCap;
+ uint16 pcieCapabilitiy;
+ uint32 deviceCapability;
+ uint16 deviceControl;
+ uint16 deviceStatus;
+ uint32 linkCapability;
+ uint16 linkControl;
+ uint16 linkStatus;
+ uint32 slotCapability;
+ uint16 slotControl;
+ uint16 slotStatus;
+ uint16 rootControl;
+ uint16 rootCap;
+ uint32 rootStatus;
+ uint32 deviceCapability2;
+ uint16 deviceControl2;
+ uint16 deviceStatus2;
+ uint32 linkCapability2;
+ uint16 linkControl2;
+ uint16 linkStatus2;
+ uint32 slotCapability2;
+ uint16 slotControl2;
+ uint16 slotStatus2;
+ uint32 unused2[6];
+
+ /* PcieErrorRegs */
+ uint16 advErrCapId;
+ uint16 advErrCapOff;
+ uint32 ucErrStatus;
+ uint32 ucorrErrMask;
+ uint32 ucorrErrSevr;
+ uint32 corrErrStatus;
+ uint32 corrErrMask;
+ uint32 advErrCapControl;
+ uint32 headerLog1;
+ uint32 headerLog2;
+ uint32 headerLog3;
+ uint32 headerLog4;
+ uint32 rootErrorCommand;
+ uint32 rootErrorStatus;
+ uint32 rcCorrId;
+ uint32 rcFatalNonfatalId;
+ uint32 unused3[10];
+
+ /* PcieVcRegs */
+ uint16 vcCapId;
+ uint16 vcCapOffset;
+ uint32 prtVcCapability;
+ uint32 portVcCapability2;
+ uint16 portVcControl;
+ uint16 portVcCtatus;
+ uint32 portArbStatus;
+ uint32 vcRsrcControl;
+ uint32 vcRsrcStatus;
+ uint32 unused4[1];
+
+ /* PcieVendor */
+ uint32 vendorCapability;
+ uint32 vendorSpecificHdr;
+} PcieRegs;
+
+typedef struct PcieBlk404Regs{
+ uint32 unused; /* 0x404 */
+ uint32 config2; /* 0x408 */
+#define PCIE_IP_BLK404_CONFIG_2_BAR1_SIZE_MASK 0x0000000f
+#define PCIE_IP_BLK404_CONFIG_2_BAR1_DISABLE 0
+ uint32 config3; /* 0x40c */
+ uint32 pmDataA; /* 0x410 */
+ uint32 pmDataB; /* 0x414 */
+} PcieBlk404Regs;
+
+typedef struct PcieBlk428Regs{
+ uint32 vpdIntf; /* 0x428 */
+ uint16 unused_g; /* 0x42c */
+ uint16 vpdAddrFlag; /* 0x42e */
+ uint32 vpdData; /* 0x430 */
+ uint32 idVal1; /* 0x434 */
+ uint32 idVal2; /* 0x438 */
+ uint32 idVal3; /* 0x43c */
+#define PCIE_IP_BLK428_ID_VAL3_REVISION_ID_MASK 0xff000000
+#define PCIE_IP_BLK428_ID_VAL3_REVISION_ID_SHIFT 24
+#define PCIE_IP_BLK428_ID_VAL3_CLASS_CODE_MASK 0x00ffffff
+#define PCIE_IP_BLK428_ID_VAL3_CLASS_CODE_SHIFT 16
+#define PCIE_IP_BLK428_ID_VAL3_SUB_CLASS_CODE_SHIFT 8
+
+ uint32 idVal4;
+ uint32 idVal5;
+ uint32 unused_h;
+ uint32 idVal6;
+ uint32 msiData;
+ uint32 msiAddr_h;
+ uint32 msiAddr_l;
+ uint32 msiMask;
+ uint32 msiPend;
+ uint32 pmData_c;
+ uint32 msixControl;
+ uint32 msixTblOffBir;
+ uint32 msixPbaOffBit;
+ uint32 unused_k;
+ uint32 pcieCapability;
+ uint32 deviceCapability;
+ uint32 unused_l;
+ uint32 linkCapability;
+ uint32 bar2Config;
+ uint32 pcieDeviceCapability2;
+ uint32 pcieLinkCapability2;
+ uint32 pcieLinkControl;
+ uint32 pcieLinkCapabilityRc;
+ uint32 bar3Config;
+ uint32 rootCap;
+ uint32 devSerNumCapId;
+ uint32 lowerSerNum;
+ uint32 upperSerNum;
+ uint32 advErrCap;
+ uint32 pwrBdgtData0;
+ uint32 pwrBdgtData1;
+ uint32 pwrBdgtData2;
+ uint32 pwdBdgtData3;
+ uint32 pwrBdgtData4;
+ uint32 pwrBdgtData5;
+ uint32 pwrBdgtData6;
+ uint32 pwrBdgtData7;
+ uint32 pwrBdgtCapability;
+ uint32 vsecHdr;
+ uint32 rcUserMemLo1;
+ uint32 rcUserMemHi1;
+ uint32 rcUserMemLo2;
+ uint32 rcUserMemHi2;
+}PcieBlk428Regs;
+
+typedef struct PcieBlk800Regs{
+#define NUM_PCIE_BLK_800_CTRL_REGS 6
+ uint32 tlControl[NUM_PCIE_BLK_800_CTRL_REGS];
+ uint32 tlCtlStat0;
+ uint32 pmStatus0;
+ uint32 pmStatus1;
+
+#define NUM_PCIE_BLK_800_TAGS 32
+ uint32 tlStatus[NUM_PCIE_BLK_800_TAGS];
+ uint32 tlHdrFcStatus;
+ uint32 tlDataFcStatus;
+ uint32 tlHdrFcconStatus;
+ uint32 tlDataFcconStatus;
+ uint32 tlTargetCreditStatus;
+ uint32 tlCreditAllocStatus;
+ uint32 tlSmlogicStatus;
+} PcieBlk800Regs;
+
+
+typedef struct PcieBlk1000Regs{
+#define NUM_PCIE_BLK_1000_PDL_CTRL_REGS 16
+ uint32 pdlControl[NUM_PCIE_BLK_1000_PDL_CTRL_REGS];
+ uint32 dlattnVec;
+ uint32 dlAttnMask;
+ uint32 dlStatus; /* 0x1048 */
+#define PCIE_IP_BLK1000_DL_STATUS_PHYLINKUP_MASK 0x00002000
+#define PCIE_IP_BLK1000_DL_STATUS_PHYLINKUP_SHIFT 13
+ uint32 dlTxChecksum;
+ uint32 dlForcedUpdateGen1;
+ uint32 mdioAddr;
+ uint32 mdioWrData;
+ uint32 mdioRdData;
+ uint32 dlRxPFcCl;
+ uint32 dlRxCFcCl;
+ uint32 dlRxAckNack;
+ uint32 dlTxRxSeqnb;
+ uint32 dlTxPFcAl;
+ uint32 dlTxNpFcAl;
+ uint32 regDlSpare;
+ uint32 dlRegSpare;
+ uint32 dlTxRxSeq;
+ uint32 dlRxNpFcCl;
+}PcieBlk1000Regs;
+
+typedef struct PcieBlk1800Regs{
+#define NUM_PCIE_BLK_1800_PHY_CTRL_REGS 5
+ uint32 phyCtrl[NUM_PCIE_BLK_1800_PHY_CTRL_REGS];
+#define REG_POWERDOWN_P1PLL_ENA (1<<12)
+ uint32 phyErrorAttnVec;
+ uint32 phyErrorAttnMask;
+ uint32 phyReceivedMcpErrors;
+ uint32 phyTransmittedMcpErrors;
+ uint32 phyGenDebug;
+ uint32 phyRecoveryHist;
+#define NUM_PCIE_BLK_1800_PHY_LTSSM_HIST_REGS 3
+ uint32 phyltssmHist[NUM_PCIE_BLK_1800_PHY_LTSSM_HIST_REGS];
+#define NUM_PCIE_BLK_1800_PHY_DBG_REGS 11
+ uint32 phyDbg[NUM_PCIE_BLK_1800_PHY_DBG_REGS];
+} PcieBlk1800Regs;
+
+typedef struct PcieBridgeRegs{
+ uint32 bar1Remap; /* 0x0818*/
+#define PCIE_BRIDGE_BAR1_REMAP_addr_MASK 0xffff0000
+#define PCIE_BRIDGE_BAR1_REMAP_addr_MASK_SHIFT 16
+#define PCIE_BRIDGE_BAR1_REMAP_remap_enable (1<<1)
+#define PCIE_BRIDGE_BAR1_REMAP_swap_enable 1
+
+ uint32 bar2Remap; /* 0x081c*/
+#define PCIE_BRIDGE_BAR2_REMAP_addr_MASK 0xffff0000
+#define PCIE_BRIDGE_BAR2_REMAP_addr_MASK_SHIFT 16
+#define PCIE_BRIDGE_BAR2_REMAP_remap_enable (1<<1)
+#define PCIE_BRIDGE_BAR2_REMAP_swap_enable 1
+
+ uint32 bridgeOptReg1; /* 0x0820*/
+#define PCIE_BRIDGE_OPT_REG1_en_l1_int_status_mask_polarity (1<<12)
+#define PCIE_BRIDGE_OPT_REG1_en_pcie_bridge_hole_detection (1<<11)
+#define PCIE_BRIDGE_OPT_REG1_en_rd_reply_be_fix (1<<9)
+#define PCIE_BRIDGE_OPT_REG1_enable_rd_be_opt (1<<7)
+
+ uint32 bridgeOptReg2; /* 0x0824*/
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_func_no_MASK 0xe0000000
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_func_no_SHIFT 29
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_dev_no_MASK 0x1f000000
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_dev_no_SHIFT 24
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bus_no_MASK 0x00ff0000
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bus_no_SHIFT 16
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bd_sel_MASK 0x00000080
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bd_sel_SHIFT 7
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_timeout_MASK 0x00000040
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_timeout_SHIFT 6
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_abort_MASK 0x00000020
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_abort_SHIFT 5
+#define PCIE_BRIDGE_OPT_REG2_enable_tx_crd_chk_MASK 0x00000010
+#define PCIE_BRIDGE_OPT_REG2_enable_tx_crd_chk_SHIFT 4
+#define PCIE_BRIDGE_OPT_REG2_dis_ubus_ur_decode_MASK 0x00000004
+#define PCIE_BRIDGE_OPT_REG2_dis_ubus_ur_decode_SHIFT 2
+#define PCIE_BRIDGE_OPT_REG2_cfg_reserved_MASK 0x0000ff0b
+
+ uint32 Ubus2PcieBar0BaseMask; /* 0x0828 */
+#define PCIE_BRIDGE_BAR0_BASE_base_MASK 0xfff00000
+#define PCIE_BRIDGE_BAR0_BASE_base_MASK_SHIFT 20
+#define PCIE_BRIDGE_BAR0_BASE_mask_MASK 0x0000fff0
+#define PCIE_BRIDGE_BAR0_BASE_mask_MASK_SHIFT 4
+#define PCIE_BRIDGE_BAR0_BASE_swap_enable (1<<1)
+#define PCIE_BRIDGE_BAR0_BASE_remap_enable 1
+
+ uint32 Ubus2PcieBar0RemapAdd; /* 0x082c */
+#define PCIE_BRIDGE_BAR0_REMAP_ADDR_addr_MASK 0xfff00000
+#define PCIE_BRIDGE_BAR0_REMAP_ADDR_addr_SHIFT 20
+
+ uint32 Ubus2PcieBar1BaseMask; /* 0x0830 */
+#define PCIE_BRIDGE_BAR1_BASE_base_MASK 0xfff00000
+#define PCIE_BRIDGE_BAR1_BASE_base_MASK_SHIFT 20
+#define PCIE_BRIDGE_BAR1_BASE_mask_MASK 0x0000fff0
+#define PCIE_BRIDGE_BAR1_BASE_mask_MASK_SHIFT 4
+#define PCIE_BRIDGE_BAR1_BASE_swap_enable (1<<1)
+#define PCIE_BRIDGE_BAR1_BASE_remap_enable 1
+
+ uint32 Ubus2PcieBar1RemapAdd; /* 0x0834 */
+#define PCIE_BRIDGE_BAR1_REMAP_ADDR_addr_MASK 0xfff00000
+#define PCIE_BRIDGE_BAR1_REMAP_ADDR_addr_SHIFT 20
+
+ uint32 bridgeErrStatus; /* 0x0838 */
+ uint32 bridgeErrMask; /* 0x083c */
+ uint32 coreErrStatus2; /* 0x0840 */
+ uint32 coreErrMask2; /* 0x0844 */
+ uint32 coreErrStatus1; /* 0x0848 */
+ uint32 coreErrMask1; /* 0x084c */
+ uint32 rcInterruptStatus; /* 0x0850 */
+ uint32 rcInterruptMask; /* 0x0854 */
+#define PCIE_BRIDGE_INTERRUPT_MASK_int_a_MASK (1<<0)
+#define PCIE_BRIDGE_INTERRUPT_MASK_int_b_MASK (1<<1)
+#define PCIE_BRIDGE_INTERRUPT_MASK_int_c_MASK (1<<2)
+#define PCIE_BRIDGE_INTERRUPT_MASK_int_d_MASK (1<<3)
+
+}PcieBridgeRegs;
+
+#define PCIEH_DEV_OFFSET 0x8000
+#define PCIEH ((volatile uint32 * const) PCIE_BASE)
+#define PCIEH_REGS ((volatile PcieRegs * const) PCIE_BASE)
+
+#define PCIEH_BLK_404_REGS ((volatile PcieBlk404Regs * const) \
+ (PCIE_BASE+0x404))
+#define PCIEH_BLK_428_REGS ((volatile PcieBlk428Regs * const) \
+ (PCIE_BASE+0x428))
+#define PCIEH_BLK_800_REGS ((volatile PcieBlk800Regs * const) \
+ (PCIE_BASE+0x800))
+#define PCIEH_BLK_1000_REGS ((volatile PcieBlk1000Regs * const) \
+ (PCIE_BASE+0x1000))
+#define PCIEH_BLK_1800_REGS ((volatile PcieBlk1800Regs * const) \
+ (PCIE_BASE+0x1800))
+#define PCIEH_BRIDGE_REGS ((volatile PcieBridgeRegs * const) \
+ (PCIE_BASE+0x2818))
+
+typedef struct WlanShimRegs_a0 {
+ uint32 CcIdA; /* CC desc A */
+ uint32 CcIdB; /* CC desc B */
+ uint32 CcAddr; /* CC base addr */
+ uint32 MacIdA; /* MAC desc A */
+ uint32 MacIdB; /* MAC desc B */
+ uint32 MacAddr; /* MAC base addr */
+ uint32 ShimIdA; /* SHIM desc A */
+ uint32 ShimIdB; /* SHIM desc B */
+ uint32 ShimAddr; /* SHIM addr */
+ uint32 ShimEot; /* EOT */
+ uint32 CcControl; /* CC control */
+ uint32 CcStatus; /* CC status */
+ uint32 MacControl; /* MAC control */
+ uint32 MacStatus; /* MAC status */
+ uint32 ShimMisc; /* SHIM control registers */
+ uint32 ShimStatus; /* SHIM status */
+}WlanShimRegs_a0;
+
+typedef struct WlanShimRegs_b0 {
+ uint32 ShimMisc; /* SHIM control registers */
+#define WLAN_SHIM_FORCE_CLOCKS_ON (1 << 2)
+#define WLAN_SHIM_MACRO_DISABLE (1 << 1)
+#define WLAN_SHIM_MACRO_SOFT_RESET (1 << 0)
+
+ uint32 ShimStatus; /* SHIM status */
+
+ uint32 CcControl; /* CC control */
+#define SICF_WOC_CORE_RESET 0x10000
+#define SICF_BIST_EN 0x8000
+#define SICF_PME_EN 0x4000
+#define SICF_CORE_BITS 0x3ffc
+#define SICF_FGC 0x0002
+#define SICF_CLOCK_EN 0x0001
+
+ uint32 CcStatus; /* CC status */
+#define SISF_BIST_DONE 0x8000
+#define SISF_BIST_ERROR 0x4000
+#define SISF_GATED_CLK 0x2000
+#define SISF_DMA64 0x1000
+#define SISF_CORE_BITS 0x0fff
+
+ uint32 MacControl; /* MAC control */
+ uint32 MacStatus; /* MAC status */
+
+ uint32 CcIdA; /* CC desc A */
+ uint32 CcIdB; /* CC desc B */
+ uint32 CcAddr; /* CC base addr */
+ uint32 MacIdA; /* MAC desc A */
+ uint32 MacIdB; /* MAC desc B */
+ uint32 MacAddr; /* MAC base addr */
+ uint32 ShimIdA; /* SHIM desc A */
+ uint32 ShimIdB; /* SHIM desc B */
+ uint32 ShimAddr; /* SHIM addr */
+ uint32 ShimEot; /* EOT */
+}WlanShimRegs_b0;
+
+typedef union WlanShimRegs {
+ WlanShimRegs_a0 a0;
+ WlanShimRegs_b0 b0; /* SHIM control registers */
+}WlanShimRegs;
+
+#define WLAN_SHIM ((volatile WlanShimRegs * const)WLAN_SHIM_BASE)
+
+/*
+** NAND Controller Registers
+*/
+typedef struct NandCtrlRegs {
+ uint32 NandRevision; /* NAND Revision */
+ uint32 NandCmdStart; /* Nand Flash Command Start */
+ uint32 NandCmdExtAddr; /* Nand Flash Command Extended Address */
+ uint32 NandCmdAddr; /* Nand Flash Command Address */
+ uint32 NandCmdEndAddr; /* Nand Flash Command End Address */
+ uint32 NandNandBootConfig; /* Nand Flash Boot Config */
+#define NBC_AUTO_DEV_ID_CFG 0x40000000
+ uint32 NandCsNandXor; /* Nand Flash EBI CS Address XOR with */
+} NandCtrlRegs;
+
+#define NAND ((volatile NandCtrlRegs * const) NAND_REG_BASE)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/shared/opensource/include/bcm963xx/6368_cpu.h b/shared/opensource/include/bcm963xx/6368_cpu.h
new file mode 100755
index 0000000..75cdde2
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/6368_cpu.h
@@ -0,0 +1,150 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+#ifndef __BCM6368_CPU_H
+#define __BCM6368_CPU_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+#************************************************************************
+#* Coprocessor 0 Register Names
+#************************************************************************
+*/
+#define C0_BCM_CONFIG $22
+
+/*
+# Select 1
+# Bit 31: unused
+# Bits 30:25 MMU Size (Num TLB entries-1)
+# Bits 24:22 ICache sets/way (2^n * 64)
+# Bits 21:19 ICache Line size (2^(n+1) bytes) 0=No Icache
+# Bits 18:16 ICache Associativity (n+1) way
+# Bits 15:13 DCache sets/way (2^n * 64)
+# Bits 12:10 DCache Line size (2^(n+1) bytes) 0=No Dcache
+# Bits 9:7 DCache Associativity (n+1) way
+# Bits 6:4 unused
+# Bit 3: 1=At least 1 watch register
+# Bit 2: 1=MIPS16 code compression implemented
+# Bit 1: 1=EJTAG implemented
+# Bit 0: 1=FPU implemented
+*/
+#define CP0_CFG_ISMSK (0x7 << 22)
+#define CP0_CFG_ISSHF 22
+#define CP0_CFG_ILMSK (0x7 << 19)
+#define CP0_CFG_ILSHF 19
+#define CP0_CFG_IAMSK (0x7 << 16)
+#define CP0_CFG_IASHF 16
+#define CP0_CFG_DSMSK (0x7 << 13)
+#define CP0_CFG_DSSHF 13
+#define CP0_CFG_DLMSK (0x7 << 10)
+#define CP0_CFG_DLSHF 10
+#define CP0_CFG_DAMSK (0x7 << 7)
+#define CP0_CFG_DASHF 7
+
+/*
+#************************************************************************
+#* Coprocessor 0 Broadcom Config Register Bits
+#************************************************************************
+*/
+#define CP0_BCM_CFG_ICSHEN (0x1 << 31)
+#define CP0_BCM_CFG_DCSHEN (0x1 << 30)
+#define CP0_BCM_CFG_BTHD (0x1 << 21)
+#define CP0_BCM_CFG_CLF (0x1 << 20)
+#define CP0_BCM_CFG_NBK (0x1 << 17)
+
+/*
+#************************************************************************
+#* Coprocessor 0 CMT Interrupt Register
+#************************************************************************
+*/
+#define CP0_CMT_XIR_4 (0x1 << 31)
+#define CP0_CMT_XIR_3 (0x1 << 30)
+#define CP0_CMT_XIR_2 (0x1 << 29)
+#define CP0_CMT_XIR_1 (0x1 << 28)
+#define CP0_CMT_XIR_0 (0x1 << 27)
+#define CP0_CMT_SIR_1 (0x1 << 16)
+#define CP0_CMT_SIR_0 (0x1 << 15)
+#define CP0_CMT_NMIR_TP1 (0x1 << 1)
+#define CP0_CMT_NMIR_TP0 (0x1 << 0)
+
+/*
+#************************************************************************
+#* Coprocessor 0 CMT Control Register
+#************************************************************************
+*/
+#define CP0_CMT_DSU_TP1 (0x1 << 30)
+#define CP0_CMT_TPS_SHFT 16
+#define CP0_CMT_TPS_MASK (0xF << CP0_CMT_TPS_SHFT)
+#define CP0_CMT_PRIO_TP1 (0x1 << 5)
+#define CP0_CMT_PRIO_TP0 (0x1 << 4)
+#define CP0_CMT_RSTSE (0x1 << 0)
+
+/*
+#************************************************************************
+#* Coprocessor 0 CMT Local Register
+#************************************************************************
+*/
+#define CP0_CMT_TPID (0x1 << 31)
+
+/*
+#************************************************************************
+#* MIPS Registers
+#************************************************************************
+*/
+
+#define MIPS_BASE_BOOT 0xbfa00000
+#define MIPS_BASE 0xff400000
+
+#define MIPS_RAC_CR0 0x00 // RAC Configuration Register
+#define MIPS_RAC_CR1 0x08 // RAC Configuration Register 1
+#define RAC_FLH (1 << 8)
+#define RAC_DPF (1 << 6)
+#define RAC_NCH (1 << 5)
+#define RAC_C_INV (1 << 4)
+#define RAC_PF_D (1 << 3)
+#define RAC_PF_I (1 << 2)
+#define RAC_D (1 << 1)
+#define RAC_I (1 << 0)
+
+#define MIPS_RAC_ARR 0x04 // RAC Address Range Register
+#define RAC_UPB_SHFT 16
+#define RAC_LWB_SHFT 0
+
+#define MIPS_LMB_CR 0x1C // LMB Control Register
+#define LMB_EN (1 << 0)
+
+#define MIPS_SBR 0x20 // System Base Register
+
+#define MIPS_TP0_ALT_BV 0x30000
+#define MIPS_TP1_ALT_BV 0x38000
+#define ENABLE_ALT_BV (1 << 19)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/shared/opensource/include/bcm963xx/6368_intr.h b/shared/opensource/include/bcm963xx/6368_intr.h
new file mode 100755
index 0000000..afbca5f
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/6368_intr.h
@@ -0,0 +1,123 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+#ifndef __6368_INTR_H
+#define __6368_INTR_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#define INTERRUPT_ID_SOFTWARE_0 0
+#define INTERRUPT_ID_SOFTWARE_1 1
+
+/*=====================================================================*/
+/* BCM6368 Timer Interrupt Level Assignments */
+/*=====================================================================*/
+#define MIPS_TIMER_INT 7
+
+/*=====================================================================*/
+/* Peripheral ISR Table Offset */
+/*=====================================================================*/
+#define INTERNAL_ISR_TABLE_OFFSET 8
+#define INTERNAL_HIGH_ISR_TABLE_OFFSET (INTERNAL_ISR_TABLE_OFFSET + 32)
+
+/*=====================================================================*/
+/* Logical Peripheral Interrupt IDs */
+/*=====================================================================*/
+
+#define INTERRUPT_ID_TIMER (INTERNAL_ISR_TABLE_OFFSET + 0)
+#define INTERRUPT_ID_SPI (INTERNAL_ISR_TABLE_OFFSET + 1)
+#define INTERRUPT_ID_UART (INTERNAL_ISR_TABLE_OFFSET + 2)
+#define INTERRUPT_ID_UART1 (INTERNAL_ISR_TABLE_OFFSET + 3)
+#define INTERRUPT_ID_XDSL (INTERNAL_ISR_TABLE_OFFSET + 4)
+#define INTERRUPT_ID_USBH (INTERNAL_ISR_TABLE_OFFSET + 5)
+#define INTERRUPT_ID_IPSEC (INTERNAL_ISR_TABLE_OFFSET + 6)
+#define INTERRUPT_ID_USBH20 (INTERNAL_ISR_TABLE_OFFSET + 7)
+#define INTERRUPT_ID_USBS (INTERNAL_ISR_TABLE_OFFSET + 8)
+#define INTERRUPT_ID_RING_OSC (INTERNAL_ISR_TABLE_OFFSET + 9)
+#define INTERRUPT_ID_NAND_FLASH (INTERNAL_ISR_TABLE_OFFSET + 10)
+#define INTERRUPT_ID_ATM (INTERNAL_ISR_TABLE_OFFSET + 11)
+#define INTERRUPT_ID_PCM (INTERNAL_ISR_TABLE_OFFSET + 12)
+#define INTERRUPT_ID_MPI (INTERNAL_ISR_TABLE_OFFSET + 13)
+#define INTERRUPT_ID_DG (INTERNAL_ISR_TABLE_OFFSET + 14)
+#define INTERRUPT_ID_EPHY (INTERNAL_ISR_TABLE_OFFSET + 15)
+#define INTERRUPT_ID_EPHY_ENERGY_0 (INTERNAL_ISR_TABLE_OFFSET + 16)
+#define INTERRUPT_ID_EPHY_ENERGY_1 (INTERNAL_ISR_TABLE_OFFSET + 17)
+#define INTERRUPT_ID_EPHY_ENERGY_2 (INTERNAL_ISR_TABLE_OFFSET + 18)
+#define INTERRUPT_ID_EPHY_ENERGY_3 (INTERNAL_ISR_TABLE_OFFSET + 19)
+#define INTERRUPT_ID_EXTERNAL_0 (INTERNAL_ISR_TABLE_OFFSET + 20)
+#define INTERRUPT_ID_EXTERNAL_1 (INTERNAL_ISR_TABLE_OFFSET + 21)
+#define INTERRUPT_ID_EXTERNAL_2 (INTERNAL_ISR_TABLE_OFFSET + 22)
+#define INTERRUPT_ID_EXTERNAL_3 (INTERNAL_ISR_TABLE_OFFSET + 23)
+#define INTERRUPT_ID_EXTERNAL_4 (INTERNAL_ISR_TABLE_OFFSET + 24)
+#define INTERRUPT_ID_EXTERNAL_5 (INTERNAL_ISR_TABLE_OFFSET + 25)
+#define INTERRUPT_ID_USB_CNTL_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 26)
+#define INTERRUPT_ID_USB_CNTL_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 27)
+#define INTERRUPT_ID_USB_BULK_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 28)
+#define INTERRUPT_ID_USB_BULK_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 29)
+#define INTERRUPT_ID_USB_ISO_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 30)
+#define INTERRUPT_ID_USB_ISO_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 31)
+#define INTERRUPT_ID_ENETSW_RX_DMA_0 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 0)
+#define INTERRUPT_ID_ENETSW_RX_DMA_1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 1)
+#define INTERRUPT_ID_ENETSW_RX_DMA_2 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 2)
+#define INTERRUPT_ID_ENETSW_RX_DMA_3 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 3)
+#define INTERRUPT_ID_ENETSW_TX_DMA_0 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 4)
+#define INTERRUPT_ID_ENETSW_TX_DMA_1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 5)
+#define INTERRUPT_ID_ENETSW_TX_DMA_2 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 6)
+#define INTERRUPT_ID_ENETSW_TX_DMA_3 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 7)
+#define INTERRUPT_ID_ATM_DMA_0 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 8)
+#define INTERRUPT_ID_ATM_DMA_1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 9)
+#define INTERRUPT_ID_ATM_DMA_2 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 10)
+#define INTERRUPT_ID_ATM_DMA_3 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 11)
+#define INTERRUPT_ID_ATM_DMA_4 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 12)
+#define INTERRUPT_ID_ATM_DMA_5 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 13)
+#define INTERRUPT_ID_ATM_DMA_6 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 14)
+#define INTERRUPT_ID_ATM_DMA_7 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 15)
+#define INTERRUPT_ID_ATM_DMA_8 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 16)
+#define INTERRUPT_ID_ATM_DMA_9 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 17)
+#define INTERRUPT_ID_ATM_DMA_10 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 18)
+#define INTERRUPT_ID_ATM_DMA_11 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 19)
+#define INTERRUPT_ID_ATM_DMA_12 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 20)
+#define INTERRUPT_ID_ATM_DMA_13 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 21)
+#define INTERRUPT_ID_ATM_DMA_14 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 22)
+#define INTERRUPT_ID_ATM_DMA_15 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 23)
+#define INTERRUPT_ID_ATM_DMA_16 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 24)
+#define INTERRUPT_ID_ATM_DMA_17 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 25)
+#define INTERRUPT_ID_ATM_DMA_18 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 26)
+#define INTERRUPT_ID_ATM_DMA_19 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 27)
+#define INTERRUPT_ID_IPSEC_DMA_0 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 28)
+#define INTERRUPT_ID_IPSEC_DMA_1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 29)
+#define INTERRUPT_ID_PCM_DMA_0 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 30)
+#define INTERRUPT_ID_PCM_DMA_1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 31)
+
+#define INTERRUPT_ID_LAST INTERRUPT_ID_PCM_DMA_1
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* __BCM6368_H */
+
+
diff --git a/shared/opensource/include/bcm963xx/6368_map_part.h b/shared/opensource/include/bcm963xx/6368_map_part.h
new file mode 100755
index 0000000..165adc2
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/6368_map_part.h
@@ -0,0 +1,1035 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+#ifndef __BCM6368_MAP_H
+#define __BCM6368_MAP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "bcmtypes.h"
+
+#define PERF_BASE 0xb0000000 /* chip control registers */
+#define TIMR_BASE 0xb0000040 /* timer registers */
+#define GPIO_BASE 0xb0000080 /* gpio registers */
+#define UART_BASE 0xb0000100 /* uart registers */
+#define UART1_BASE 0xb0000120 /* uart registers */
+#define NAND_REG_BASE 0xb0000200 /* NAND registers */
+#define NAND_CACHE_BASE 0xb0000600
+#define SPI_BASE 0xb0000800 /* SPI master controller registers */
+#define MPI_BASE 0xb0001000 /* MPI control registers */
+#define MEMC_BASE 0xb0001200 /* Memory control registers */
+#define DDR_BASE 0xb0001280 /* DDR IO Buf Control registers */
+#define USB_EHCI_BASE 0x10001500 /* USB host registers */
+#define USB_OHCI_BASE 0x10001600 /* USB host registers */
+#define USBH_CFG_BASE 0xb0001700
+#define SAR_DMA_BASE 0xb0005000 /* ATM SAR DMA control registers */
+
+
+typedef struct MemoryControl
+{
+ uint32 Control; /* (00) */
+#define MEMC_SELF_REFRESH (1<<6) // enable self refresh mode
+#define MEMC_MRS (1<<4) // generate a mode register select cycle
+#define MEMC_PRECHARGE (1<<3) // generate a precharge cycle
+#define MEMC_REFRESH (1<<2) // generate an auto refresh cycle
+#define MEMC_SEQUENCE_ENABLE (1<<1) // enable memory controller sequencer
+#define MEMC_MASTER_ENABLE (1<<0) // enable accesses to external sdram
+
+ uint32 Config; /* (04) */
+#define MEMC_EARLY_HDR_CNT_SHFT 25
+#define MEMC_EARLY_HDR_CNT_MASK (0x7<<MEMC_EARLYHDRCNT_SHFT)
+#define MEMC_USE_HDR_CNT (1<<24)
+#define MEMC_EN_FAST_REPLY (1<<23)
+#define MEMC_RR_ARB (1<<22)
+#define MEMC_SFX_NO_MRS2 (1<<21)
+#define MEMC_SFX_NO_DLL_RST (1<<20)
+#define MEMC_LLMB_ONE_REQ (1<<19)
+#define MEMC_SYS_PORT_CMD_MODE (1<<18)
+#define MEMC_PAD_OP_MODE (1<<17)
+#define MEMC_DQS_GATE_EN (1<<16)
+#define MEMC_PRED_RD_STROBE_EN (1<<15)
+#define MEMC_PRED_RD_LATENCY_SEL (1<<14)
+#define MEMC_UBUS_CLF_EN (1<<8)
+
+#define MEMC_ROW_SHFT 6
+#define MEMC_ROW_MASK (0x3<<MEMC_ROW_SHFT)
+#define MEMC_11BIT_ROW 0
+#define MEMC_12BIT_ROW 1
+#define MEMC_13BIT_ROW 2
+#define MEMC_14BIT_ROW 3
+
+#define MEMC_COL_SHFT 3
+#define MEMC_COL_MASK (0x7<<MEMC_COL_SHFT)
+#define MEMC_8BIT_COL 0
+#define MEMC_9BIT_COL 1
+#define MEMC_10BIT_COL 2
+#define MEMC_11BIT_COL 3
+
+#define MEMC_SEL_PRIORITY (1<<2)
+
+#define MEMC_WIDTH_SHFT 1
+#define MEMC_WIDTH_MASK (0x1<<MEMC_WIDTH_SHFT)
+#define MEMC_32BIT_BUS 0
+#define MEMC_16BIT_BUS 1
+
+#define MEMC_MEMTYPE_SDR (0<<0)
+#define MEMC_MEMTYPE_DDR (1<<0)
+
+ uint32 RefreshPdControl; /* (08) */
+#define MEMC_REFRESH_ENABLE (1<<15)
+
+ uint32 BistStatus; /* (0C) */
+ uint32 ExtendedModeBuffer; /* (10) */
+ uint32 BankClosingTimer; /* (14) */
+ uint32 PriorityInversionTimer; /* (18) */
+
+ uint32 DramTiming; /* (1c) */
+#define MEMC_WR_NOP_RD (1<<23)
+#define MEMC_WR_NOP_WR (1<<22)
+#define MEMC_RD_NOP_WR (1<<21)
+#define MEMC_RD_NOP_RD (1<<20)
+#define MEMC_CAS_LATENCY_2 (0)
+#define MEMC_CAS_LATENCY_2_5 (1)
+#define MEMC_CAS_LATENCY_3 (2)
+
+ uint32 IntStatus; /* (20) */
+ uint32 IntMask; /* (24) */
+#define MEMC_INT3 (1<<3)
+#define MEMC_INT2 (2<<3)
+#define MEMC_INT1 (1<<3)
+#define MEMC_INT0 (0<<3)
+
+ uint32 IntInfo; /* (28) */
+ uint8 unused5[0x50-0x2c]; /* (2c) */
+ uint32 Barrier; /* (50) */
+ uint32 CoreId; /* (54) */
+} MemoryControl;
+
+#define MEMC ((volatile MemoryControl * const) MEMC_BASE)
+
+typedef struct DDRControl {
+ uint32 RevID; /* 00 */
+ uint32 PadSSTLMode; /* 04 */
+ uint32 CmdPadCntl; /* 08 */
+ uint32 DQPadCntl; /* 0c */
+ uint32 DQSPadCntl; /* 10 */
+ uint32 ClkPadCntl0; /* 14 */
+ uint32 MIPSDDRPLLCntl0; /* 18 */
+ uint32 MIPSDDRPLLCntl1; /* 1c */
+ uint32 MIPSDDRPLLConfig; /* 20 */
+#define MIPSDDR_NDIV_SHFT 16
+#define MIPSDDR_NDIV_MASK (0x1ff<<MIPSDDR_NDIV_SHFT)
+#define REF_MDIV_SHFT 8
+#define REF_MDIV_MASK (0xff<<REF_MDIV_SHFT)
+#define MIPSDDR_P2_SHFT 4
+#define MIPSDDR_P2_MASK (0xf<<MIPSDDR_P2_SHFT)
+#define MIPSDDR_P1_SHFT 0
+#define MIPSDDR_P1_MASK (0xf<<MIPSDDR_P1_SHFT)
+ uint32 MIPSDDRPLLMDiv; /* 24 */
+#define DDR_MDIV_SHFT 8
+#define DDR_MDIV_MASK (0xff<<DDR_MDIV_SHFT)
+#define MIPS_MDIV_SHFT 0
+#define MIPS_MDIV_MASK (0xff<<MIPS_MDIV_SHFT)
+ uint32 DSLCorePhaseCntl; /* 28 */
+ uint32 DSLCpuPhaseCntr; /* 2c */
+#define DSL_PHY_AFE_PI_CNTR_CYCLES_SHIFT 28
+#define DSL_PHY_AFE_PI_CNTR_CYCLES_MASK (0xF << DSL_PHY_AFE_PI_CNTR_CYCLES_SHIFT)
+#define DSL_PHY_PI_CNTR_CYCLES_SHIFT 24
+#define DSL_PHY_PI_CNTR_CYCLES_MASK (0xF << DSL_PHY_PI_CNTR_CYCLES_SHIFT)
+#define DSL_PHY_AFE_PI_CNTR_EN (1 << 22)
+#define DSL_PHY_PI_CNTR_EN (1 << 21)
+#define DSL_CPU_PI_CNTR_EN (1 << 20)
+#define DSL_CPU_PI_CNTR_CYCLES_SHIFT 16
+#define DSL_CPU_PI_CNTR_CYCLES_MASK (0xF << DSL_CPU_PI_CNTR_CYCLES_SHIFT)
+ uint32 MIPSPhaseCntl; /* 30 */
+#define PH_CNTR_EN (1 << 20)
+ uint32 DDR1_2PhaseCntl0; /* 34 */
+ uint32 DDR3_4PhaseCntl0; /* 38 */
+ uint32 VCDLPhaseCntl0; /* 3c */
+ uint32 VCDLPhaseCntl1; /* 40 */
+ uint32 WSliceCntl; /* 44 */
+ uint32 DeskewDLLCntl; /* 48 */
+ uint32 DeskewDLLReset; /* 4c */
+ uint32 DeskewDLLPhase; /* 50 */
+ uint32 AnalogTestCntl; /* 54 */
+ uint32 RdDQSGateCntl; /* 58 */
+ uint32 PLLTestReg; /* 5c */
+ uint32 Spare0; /* 60 */
+ uint32 Spare1; /* 64 */
+ uint32 Spare2; /* 68 */
+ uint32 CLBist; /* 6c */
+ uint32 LBistCRC; /* 70 */
+ uint32 UBUSPhaseCntl; /* 74 */
+ uint32 UBUSPIDeskewLLMB0; /* 78 */
+ uint32 UBUSPIDeskewLLMB1; /* 7C */
+
+} DDRControl;
+
+#define DDR ((volatile DDRControl * const) DDR_BASE)
+
+/*
+** Peripheral Controller
+*/
+
+#define IRQ_BITS 64
+typedef struct {
+ uint64 IrqMask;
+ uint64 IrqStatus;
+} IrqControl_t;
+
+typedef struct PerfControl {
+ uint32 RevID; /* (00) word 0 */
+ uint32 blkEnables; /* (04) word 1 */
+#define USBH_IDDQ_EN (1 << 19)
+#define IPSEC_CLK_EN (1 << 18)
+#define NAND_CLK_EN (1 << 17)
+#define DISABLE_GLESS (1 << 16)
+#define USBH_CLK_EN (1 << 15)
+#define PCM_CLK_EN (1 << 14)
+#define UTOPIA_CLK_EN (1 << 13)
+#define ROBOSW_CLK_EN (1 << 12)
+#define SAR_CLK_EN (1 << 11)
+#define USBD_CLK_EN (1 << 10)
+#define SPI_CLK_EN (1 << 9)
+#define SWPKT_SAR_CLK_EN (1 << 8)
+#define SWPKT_USB_CLK_EN (1 << 7)
+#define PHYMIPS_CLK_EN (1 << 6)
+#define VDSL_CLK_EN (1 << 5)
+#define VDSL_BONDING_EN (1 << 4)
+#define VDSL_AFE_EN (1 << 3)
+#define VDSL_QPROC_EN (1 << 2)
+
+ uint32 pll_control; /* (08) word 2 */
+#define SOFT_RESET 0x00000001 // 0
+
+ uint32 deviceTimeoutEn; /* (0c) word 3 */
+ uint32 softResetB; /* (10) word 4 */
+#define SOFT_RST_PCM (1 << 13)
+#define SOFT_RST_USBH (1 << 12)
+#define SOFT_RST_USBD (1 << 11)
+#define SOFT_RST_SWITCH (1 << 10)
+#define SOFT_RST_SAR (1 << 7)
+#define SOFT_RST_EPHY (1 << 6)
+#define SOFT_RST_IPSEC (1 << 4)
+#define SOFT_RST_MPI (1 << 3)
+#define SOFT_RST_SPI (1 << 0)
+
+ uint32 unused1; /* (14) word 5 */
+ uint32 ExtIrqCfg; /* (18) word 6*/
+ uint32 ExtIrqCfg1; /* (1c) word 7 */
+#define EI_SENSE_SHFT 0
+#define EI_STATUS_SHFT 4
+#define EI_CLEAR_SHFT 8
+#define EI_MASK_SHFT 12
+#define EI_INSENS_SHFT 16
+#define EI_LEVEL_SHFT 20
+
+ IrqControl_t IrqControl[2];
+} PerfControl;
+
+#define PERF ((volatile PerfControl * const) PERF_BASE)
+
+/*
+** Timer
+*/
+typedef struct Timer {
+ uint16 unused0;
+ byte TimerMask;
+#define TIMER0EN 0x01
+#define TIMER1EN 0x02
+#define TIMER2EN 0x04
+ byte TimerInts;
+#define TIMER0 0x01
+#define TIMER1 0x02
+#define TIMER2 0x04
+#define WATCHDOG 0x08
+ uint32 TimerCtl0;
+ uint32 TimerCtl1;
+ uint32 TimerCtl2;
+#define TIMERENABLE 0x80000000
+#define RSTCNTCLR 0x40000000
+ uint32 TimerCnt0;
+ uint32 TimerCnt1;
+ uint32 TimerCnt2;
+ uint32 WatchDogDefCount;
+
+ /* Write 0xff00 0x00ff to Start timer
+ * Write 0xee00 0x00ee to Stop and re-load default count
+ * Read from this register returns current watch dog count
+ */
+ uint32 WatchDogCtl;
+
+ /* Number of 50-MHz ticks for WD Reset pulse to last */
+ uint32 WDResetCount;
+} Timer;
+
+#define TIMER ((volatile Timer * const) TIMR_BASE)
+
+/*
+** UART
+*/
+typedef struct UartChannel {
+ byte unused0;
+ byte control;
+#define BRGEN 0x80 /* Control register bit defs */
+#define TXEN 0x40
+#define RXEN 0x20
+#define LOOPBK 0x10
+#define TXPARITYEN 0x08
+#define TXPARITYEVEN 0x04
+#define RXPARITYEN 0x02
+#define RXPARITYEVEN 0x01
+
+ byte config;
+#define XMITBREAK 0x40
+#define BITS5SYM 0x00
+#define BITS6SYM 0x10
+#define BITS7SYM 0x20
+#define BITS8SYM 0x30
+#define ONESTOP 0x07
+#define TWOSTOP 0x0f
+ /* 4-LSBS represent STOP bits/char
+ * in 1/8 bit-time intervals. Zero
+ * represents 1/8 stop bit interval.
+ * Fifteen represents 2 stop bits.
+ */
+ byte fifoctl;
+#define RSTTXFIFOS 0x80
+#define RSTRXFIFOS 0x40
+ /* 5-bit TimeoutCnt is in low bits of this register.
+ * This count represents the number of characters
+ * idle times before setting receive Irq when below threshold
+ */
+ uint32 baudword;
+ /* When divide SysClk/2/(1+baudword) we should get 32*bit-rate
+ */
+
+ byte txf_levl; /* Read-only fifo depth */
+ byte rxf_levl; /* Read-only fifo depth */
+ byte fifocfg; /* Upper 4-bits are TxThresh, Lower are
+ * RxThreshold. Irq can be asserted
+ * when rx fifo> thresh, txfifo<thresh
+ */
+ byte prog_out; /* Set value of DTR (Bit0), RTS (Bit1)
+ * if these bits are also enabled to GPIO_o
+ */
+#define DTREN 0x01
+#define RTSEN 0x02
+
+ byte unused1;
+ byte DeltaIPEdgeNoSense; /* Low 4-bits, set corr bit to 1 to
+ * detect irq on rising AND falling
+ * edges for corresponding GPIO_i
+ * if enabled (edge insensitive)
+ */
+ byte DeltaIPConfig_Mask; /* Upper 4 bits: 1 for posedge sense
+ * 0 for negedge sense if
+ * not configured for edge
+ * insensitive (see above)
+ * Lower 4 bits: Mask to enable change
+ * detection IRQ for corresponding
+ * GPIO_i
+ */
+ byte DeltaIP_SyncIP; /* Upper 4 bits show which bits
+ * have changed (may set IRQ).
+ * read automatically clears bit
+ * Lower 4 bits are actual status
+ */
+
+ uint16 intMask; /* Same Bit defs for Mask and status */
+ uint16 intStatus;
+#define DELTAIP 0x0001
+#define TXUNDERR 0x0002
+#define TXOVFERR 0x0004
+#define TXFIFOTHOLD 0x0008
+#define TXREADLATCH 0x0010
+#define TXFIFOEMT 0x0020
+#define RXUNDERR 0x0040
+#define RXOVFERR 0x0080
+#define RXTIMEOUT 0x0100
+#define RXFIFOFULL 0x0200
+#define RXFIFOTHOLD 0x0400
+#define RXFIFONE 0x0800
+#define RXFRAMERR 0x1000
+#define RXPARERR 0x2000
+#define RXBRK 0x4000
+
+ uint16 unused2;
+ uint16 Data; /* Write to TX, Read from RX */
+ /* bits 11:8 are BRK,PAR,FRM errors */
+
+ uint32 unused3;
+ uint32 unused4;
+} Uart;
+
+#define UART ((volatile Uart * const) UART_BASE)
+
+/*
+** Gpio Controller
+*/
+
+typedef struct GpioControl {
+ uint64 GPIODir; /* 0 */
+ uint64 GPIOio; /* 8 */
+ uint32 LEDCtrl;
+#define LED_ALL_STROBE 0x0f000000
+#define LED3_STROBE 0x08000000
+#define LED2_STROBE 0x04000000
+#define LED1_STROBE 0x02000000
+#define LED0_STROBE 0x01000000
+#define LED_TEST 0x00010000
+#define DISABLE_LINK_ACT_ALL 0x0000f000
+#define DISABLE_LINK_ACT_3 0x00008000
+#define DISABLE_LINK_ACT_2 0x00004000
+#define DISABLE_LINK_ACT_1 0x00002000
+#define DISABLE_LINK_ACT_0 0x00001000
+#define LED_INTERVAL_SET_MASK 0x00000f00
+#define LED_INTERVAL_SET_1280MS 0x00000700
+#define LED_INTERVAL_SET_640MS 0x00000600
+#define LED_INTERVAL_SET_320MS 0x00000500
+#define LED_INTERVAL_SET_160MS 0x00000400
+#define LED_INTERVAL_SET_80MS 0x00000300
+#define LED_INTERVAL_SET_40MS 0x00000200
+#define LED_INTERVAL_SET_20MS 0x00000100
+#define LED_ON_ALL 0x000000f0
+#define LED_ON_3 0x00000080
+#define LED_ON_2 0x00000040
+#define LED_ON_1 0x00000020
+#define LED_ON_0 0x00000010
+#define LED_ENABLE_ALL 0x0000000f
+#define LED_ENABLE_3 0x00000008
+#define LED_ENABLE_2 0x00000004
+#define LED_ENABLE_1 0x00000002
+#define LED_ENABLE_0 0x00000001
+ uint32 SpiSlaveCfg; /* 14 */
+ uint32 GPIOMode; /* 18 */
+#define GPIO_MODE_SPI_SSN5 (1<<31)
+#define GPIO_MODE_SPI_SSN4 (1<<30)
+#define GPIO_MODE_SPI_SSN3 (1<<29)
+#define GPIO_MODE_SPI_SSN2 (1<<28)
+#define GPIO_MODE_EBI_CS3 (1<<27)
+#define GPIO_MODE_EBI_CS2 (1<<26)
+#define GPIO_MODE_PCMCIA_VS2 (1<<25)
+#define GPIO_MODE_PCMCIA_VS1 (1<<24)
+#define GPIO_MODE_PCMCIA_CD2 (1<<23)
+#define GPIO_MODE_PCMCIA_CD1 (1<<22)
+#define GPIO_MODE_PCI_GNT0 (1<<20)
+#define GPIO_MODE_PCI_REQ0 (1<<19)
+#define GPIO_MODE_PCI_INTB (1<<18)
+#define GPIO_MODE_PCI_GNT1 (1<<17)
+#define GPIO_MODE_PCI_REQ1 (1<<16)
+#define GPIO_MODE_USBD_LED (1<<14)
+#define GPIO_MODE_ROBOSW_LED1 (1<<13)
+#define GPIO_MODE_ROBOSW_LED0 (1<<12)
+#define GPIO_MODE_ROBOSW_LED_CLK (1<<11)
+#define GPIO_MODE_ROBOSW_LED_DATA (1<<10)
+#define GPIO_MODE_EPHY3_LED (1<<9)
+#define GPIO_MODE_EPHY2_LED (1<<8)
+#define GPIO_MODE_EPHY1_LED (1<<7)
+#define GPIO_MODE_EPHY0_LED (1<<6)
+#define GPIO_MODE_INET_LED (1<<5)
+#define GPIO_MODE_SERIAL_LED_CLK (1<<4)
+#define GPIO_MODE_SERIAL_LED_DATA (1<<3)
+#define GPIO_MODE_SYS_IRQ (1<<2)
+#define GPIO_MODE_ANALOG_AFE_1 (1<<1)
+#define GPIO_MODE_ANALOG_AFE_0 (1<<0)
+
+ uint32 VregConfig; /* 1C */
+#define VREG_VSEL1P2_SHIFT 8
+#define VREG_VSEL1P2_MASK (0x0f<<8)
+#define VREG_VSEL1P2_MIDDLE 9
+
+ uint32 AuxLedInterval; /* 20 */
+#define AUX_LED_IN_7 0x80000000
+#define AUX_LED_IN_6 0x40000000
+#define AUX_LED_IN_5 0x20000000
+#define AUX_LED_IN_4 0x10000000
+#define AUX_LED_IN_MASK 0xf0000000
+#define LED_IN_3 0x08000000
+#define LED_IN_2 0x04000000
+#define LED_IN_1 0x02000000
+#define LED_IN_0 0x01000000
+#define AUX_LED_TEST 0x00400000
+#define USE_NEW_INTV 0x00200000
+#define LED7_LNK_ORAND 0x00100000
+#define LED7_LNK_MASK 0x000f0000
+#define LED7_LNK_MASK_SHFT 16
+#define LED7_ACT_MASK 0x0000f000
+#define LED7_ACT_MASK_SHFT 12
+#define AUX_FLASH_INTV 0x00000fc0
+#define AUX_FLASH_INTV_SHFT 6
+#define AUX_BLINK_INTV 0x0000003f
+ uint32 AuxLedCtrl; /* 24 */
+#define AUX_HW_DISAB_7 0x80000000
+#define AUX_STROBE_7 0x40000000
+#define AUX_MODE_7 0x30000000
+#define AUX_MODE_SHFT_7 28
+#define AUX_HW_DISAB_6 0x08000000
+#define AUX_STROBE_6 0x04000000
+#define AUX_MODE_6 0x03000000
+#define AUX_MODE_SHFT_6 24
+#define AUX_HW_DISAB_5 0x00800000
+#define AUX_STROBE_5 0x00400000
+#define AUX_MODE_5 0x00300000
+#define AUX_MODE_SHFT_5 20
+#define AUX_HW_DISAB_4 0x00080000
+#define AUX_STROBE_4 0x00040000
+#define AUX_MODE_4 0x00030000
+#define AUX_MODE_SHFT_4 16
+#define AUX_HW_DISAB_3 0x00008000
+#define AUX_STROBE_3 0x00004000
+#define AUX_MODE_3 0x00003000
+#define AUX_MODE_SHFT_3 12
+#define AUX_HW_DISAB_2 0x00000800
+#define AUX_STROBE_2 0x00000400
+#define AUX_MODE_2 0x00000300
+#define AUX_MODE_SHFT_2 8
+#define AUX_HW_DISAB_1 0x00000080
+#define AUX_STROBE_1 0x00000040
+#define AUX_MODE_1 0x00000030
+#define AUX_MODE_SHFT_1 4
+#define AUX_HW_DISAB_0 0x00000008
+#define AUX_STROBE_0 0x00000004
+#define AUX_MODE_0 0x00000003
+#define AUX_MODE_SHFT_0 0
+
+#define LED_STEADY_OFF 0x0
+#define LED_FLASH 0x1
+#define LED_BLINK 0x2
+#define LED_STEADY_ON 0x3
+
+ uint32 TestControl; /* 28 */
+
+ uint32 VDSLControl; /* 2C */
+#define VDSL_CORE_RESET (1<<2)
+#define VDSL_MIPS_RESET (1<<1)
+#define VDSL_MIPS_POR_RESET (1<<0)
+#define VDSL_CLK_RATIO_SHIFT 8
+#define VDSL_CLK_RATIO_MSK (0x1F << VDSL_CLK_RATIO_SHIFT)
+ uint32 RoboSWLEDControl; /* 30 */
+ uint32 RoboSWLEDLSR; /* 34 */
+ uint32 GPIOBaseMode; /* 38 */
+#define EN_PCI_CLK_66 (1<<20)
+#define EN_UTO_CLK_FAST (1<<19)
+#define EN_UTO (1<<18)
+#define EN_GMII2 (1<<17)
+#define EN_GMII1 (1<<16)
+ uint32 RoboswEphyCtrl; /* 3C */
+#define RSW_HW_FWDG_EN (1<<19)
+#define RSW_MII_DUMB_FWDG_EN (1<<16)
+#define EPHY_RST_4 (1<<9)
+#define EPHY_RST_3 (1<<8)
+#define EPHY_RST_2 (1<<7)
+#define EPHY_RST_1 (1<<6)
+#define EPHY_PWR_DOWN_4 (1<<5)
+#define EPHY_PWR_DOWN_3 (1<<4)
+#define EPHY_PWR_DOWN_2 (1<<3)
+#define EPHY_PWR_DOWN_1 (1<<2)
+#define EPHY_PWR_DOWN_DLL (1<<1)
+#define EPHY_PWR_DOWN_BIAS (1<<0)
+ uint32 StrapBus; /* 40 */
+#define UTOPIA_MASTER_ON (1<<14)
+#define MISC_STRAP_BUS_BOOT_SEL_MASK 0x3
+#define MISC_STRAP_BUS_BOOT_SEL_SHIFT 0
+#define MISC_STRAP_BUS_BOOT_PARALLEL 0x03
+#define MISC_STRAP_BUS_BOOT_SERIAL 0x01
+#define MISC_STRAP_BUS_BOOT_NAND 0x00
+ uint32 StrapOverride; /* 44 */
+
+ uint32 RingOscCtrl0; /* 48 */
+#define RING_OSC_256_CYCLES 8
+#define RING_OSC_512_CYCLES 9
+#define RING_OSC_1024_CYCLES 10
+
+ uint32 RingOscCtrl1; /* 4C */
+#define RING_OSC_ENABLE_MASK (0x7f<<24)
+#define RING_OSC_ENABLE_SHIFT 24
+#define RING_OSC_MAX 7
+#define RING_OSC_COUNT_RESET (0x1<<23)
+#define RING_OSC_SELECT_MASK (0x7<<20)
+#define RING_OSC_SELECT_SHIFT 20
+#define RING_OSC_IRQ (0x1<<18)
+#define RING_OSC_COUNTER_OVERFLOW (0x1<<17)
+#define RING_OSC_COUNTER_BUSY (0x1<<16)
+#define RING_OSC_COUNT_MASK 0x0000ffff
+
+ uint32 SerialLed; /* 50 */
+ uint32 SerialLedCtrl; /* 54 */
+#define SER_LED_BUSY (1<<3)
+#define SER_LED_POLARITY (1<<2)
+#define SER_LED_DIV_1 0
+#define SER_LED_DIV_2 1
+#define SER_LED_DIV_4 2
+#define SER_LED_DIV_8 3
+#define SER_LED_DIV_MASK 0x3
+#define SER_LED_DIV_SHIFT 0
+ uint32 unused2[4]; /* 58 */
+ uint32 DieRevID; /* 68 */
+ uint32 DiagMemStatus; /* 6c */
+ uint32 DiagSelControl; /* 70 */
+ uint32 DiagReadBack; /* 74 */
+ uint32 DiagReadBackHi; /* 78 */
+ uint32 DiagMiscControl; /* 7c */
+#define EPHY_SA_RESET_N 0x00000300
+#define EPHY_SA_TESTEN 0x00000500
+#define EPHY_SA_CLOCK_RESET 0x0000d900
+} GpioControl;
+
+#define GPIO ((volatile GpioControl * const) GPIO_BASE)
+
+/* Number to mask conversion macro used for GPIODir and GPIOio */
+#define GPIO_NUM_MAX 40
+#define GPIO_NUM_TO_MASK(X) ( (((X) & BP_GPIO_NUM_MASK) < GPIO_NUM_MAX) ? ((uint64)1 << ((X) & BP_GPIO_NUM_MASK)) : (0) )
+
+/*
+** Spi Controller
+*/
+
+typedef struct SpiControl {
+ uint16 spiMsgCtl; /* (0x0) control byte */
+#define FULL_DUPLEX_RW 0
+#define HALF_DUPLEX_W 1
+#define HALF_DUPLEX_R 2
+#define SPI_MSG_TYPE_SHIFT 14
+#define SPI_BYTE_CNT_SHIFT 0
+ byte spiMsgData[0x21e]; /* (0x02 - 0x21f) msg data */
+ byte unused0[0x1e0];
+ byte spiRxDataFifo[0x220]; /* (0x400 - 0x61f) rx data */
+ byte unused1[0xe0];
+
+ uint16 spiCmd; /* (0x700): SPI command */
+#define SPI_CMD_NOOP 0
+#define SPI_CMD_SOFT_RESET 1
+#define SPI_CMD_HARD_RESET 2
+#define SPI_CMD_START_IMMEDIATE 3
+
+#define SPI_CMD_COMMAND_SHIFT 0
+#define SPI_CMD_COMMAND_MASK 0x000f
+
+#define SPI_CMD_DEVICE_ID_SHIFT 4
+#define SPI_CMD_PREPEND_BYTE_CNT_SHIFT 8
+#define SPI_CMD_ONE_BYTE_SHIFT 11
+#define SPI_CMD_ONE_WIRE_SHIFT 12
+#define SPI_DEV_ID_0 0
+#define SPI_DEV_ID_1 1
+#define SPI_DEV_ID_2 2
+#define SPI_DEV_ID_3 3
+
+ byte spiIntStatus; /* (0x702): SPI interrupt status */
+ byte spiMaskIntStatus; /* (0x703): SPI masked interrupt status */
+
+ byte spiIntMask; /* (0x704): SPI interrupt mask */
+#define SPI_INTR_CMD_DONE 0x01
+#define SPI_INTR_RX_OVERFLOW 0x02
+#define SPI_INTR_INTR_TX_UNDERFLOW 0x04
+#define SPI_INTR_TX_OVERFLOW 0x08
+#define SPI_INTR_RX_UNDERFLOW 0x10
+#define SPI_INTR_CLEAR_ALL 0x1f
+
+ byte spiStatus; /* (0x705): SPI status */
+#define SPI_RX_EMPTY 0x02
+#define SPI_CMD_BUSY 0x04
+#define SPI_SERIAL_BUSY 0x08
+
+ byte spiClkCfg; /* (0x706): SPI clock configuration */
+#define SPI_CLK_0_391MHZ 1
+#define SPI_CLK_0_781MHZ 2 /* default */
+#define SPI_CLK_1_563MHZ 3
+#define SPI_CLK_3_125MHZ 4
+#define SPI_CLK_6_250MHZ 5
+#define SPI_CLK_12_50MHZ 6
+#define SPI_CLK_MASK 0x07
+#define SPI_SSOFFTIME_MASK 0x38
+#define SPI_SSOFFTIME_SHIFT 3
+#define SPI_BYTE_SWAP 0x80
+
+ byte spiFillByte; /* (0x707): SPI fill byte */
+ byte unused2;
+ byte spiMsgTail; /* (0x709): msgtail */
+ byte unused3;
+ byte spiRxTail; /* (0x70B): rxtail */
+} SpiControl;
+
+#define SPI ((volatile SpiControl * const) SPI_BASE)
+
+#define IUDMA_MAX_CHANNELS 32
+
+/*
+** DMA Channel Configuration (1 .. 32)
+*/
+typedef struct DmaChannelCfg {
+ uint32 cfg; /* (00) assorted configuration */
+#define DMA_ENABLE 0x00000001 /* set to enable channel */
+#define DMA_PKT_HALT 0x00000002 /* idle after an EOP flag is detected */
+#define DMA_BURST_HALT 0x00000004 /* idle after finish current memory burst */
+ uint32 intStat; /* (04) interrupts control and status */
+ uint32 intMask; /* (08) interrupts mask */
+#define DMA_BUFF_DONE 0x00000001 /* buffer done */
+#define DMA_DONE 0x00000002 /* packet xfer complete */
+#define DMA_NO_DESC 0x00000004 /* no valid descriptors */
+ uint32 maxBurst; /* (0C) max burst length permitted */
+} DmaChannelCfg;
+
+/*
+** DMA State RAM (1 .. 16)
+*/
+typedef struct DmaStateRam {
+ uint32 baseDescPtr; /* (00) descriptor ring start address */
+ uint32 state_data; /* (04) state/bytes done/ring offset */
+ uint32 desc_len_status; /* (08) buffer descriptor status and len */
+ uint32 desc_base_bufptr; /* (0C) buffer descrpitor current processing */
+} DmaStateRam;
+
+
+/*
+** DMA Registers
+*/
+typedef struct DmaRegs {
+ uint32 controller_cfg; /* (00) controller configuration */
+#define DMA_MASTER_EN 0x00000001
+#define DMA_FLOWC_CH1_EN 0x00000002
+#define DMA_FLOWC_CH3_EN 0x00000004
+
+ // Flow control Ch1
+ uint32 flowctl_ch1_thresh_lo; /* 004 */
+ uint32 flowctl_ch1_thresh_hi; /* 008 */
+ uint32 flowctl_ch1_alloc; /* 00c */
+#define DMA_BUF_ALLOC_FORCE 0x80000000
+
+ // Flow control Ch3
+ uint32 flowctl_ch3_thresh_lo; /* 010 */
+ uint32 flowctl_ch3_thresh_hi; /* 014 */
+ uint32 flowctl_ch3_alloc; /* 018 */
+
+ // Flow control Ch5
+ uint32 flowctl_ch5_thresh_lo; /* 01C */
+ uint32 flowctl_ch5_thresh_hi; /* 020 */
+ uint32 flowctl_ch5_alloc; /* 024 */
+
+ // Flow control Ch7
+ uint32 flowctl_ch7_thresh_lo; /* 028 */
+ uint32 flowctl_ch7_thresh_hi; /* 02C */
+ uint32 flowctl_ch7_alloc; /* 030 */
+
+ uint32 ctrl_channel_reset; /* 034 */
+ uint32 ctrl_channel_debug; /* 038 */
+ uint32 reserved1; /* 03C */
+ uint32 ctrl_global_interrupt_status; /* 040 */
+ uint32 ctrl_global_interrupt_mask; /* 044 */
+
+ // Unused words
+ uint8 reserved2[0x200-0x48];
+
+ // Per channel registers/state ram
+ DmaChannelCfg chcfg[IUDMA_MAX_CHANNELS];/* (200-3FF) Channel configuration */
+ union {
+ DmaStateRam s[IUDMA_MAX_CHANNELS];
+ uint32 u32[4 * IUDMA_MAX_CHANNELS];
+ } stram; /* (400-5FF) state ram */
+} DmaRegs;
+
+/*
+** DMA Buffer
+*/
+typedef struct DmaDesc {
+ union {
+ struct {
+ uint16 length; /* in bytes of data in buffer */
+#define DMA_DESC_USEFPM 0x8000
+#define DMA_DESC_MULTICAST 0x4000
+#define DMA_DESC_BUFLENGTH 0x0fff
+ uint16 status; /* buffer status */
+#define DMA_OWN 0x8000 /* cleared by DMA, set by SW */
+#define DMA_EOP 0x4000 /* last buffer in packet */
+#define DMA_SOP 0x2000 /* first buffer in packet */
+#define DMA_WRAP 0x1000 /* */
+#define DMA_PRIO 0x0C00 /* Prio for Tx */
+#define DMA_APPEND_BRCM_TAG 0x0200
+#define DMA_APPEND_CRC 0x0100
+#define USB_ZERO_PKT (1<< 0) // Set to send zero length packet
+ };
+ uint32 word0;
+ };
+
+ uint32 address; /* address of data */
+} DmaDesc;
+
+/*
+** External Bus Interface
+*/
+typedef struct EbiChipSelect {
+ uint32 base; /* base address in upper 24 bits */
+#define EBI_SIZE_8K 0
+#define EBI_SIZE_16K 1
+#define EBI_SIZE_32K 2
+#define EBI_SIZE_64K 3
+#define EBI_SIZE_128K 4
+#define EBI_SIZE_256K 5
+#define EBI_SIZE_512K 6
+#define EBI_SIZE_1M 7
+#define EBI_SIZE_2M 8
+#define EBI_SIZE_4M 9
+#define EBI_SIZE_8M 10
+#define EBI_SIZE_16M 11
+#define EBI_SIZE_32M 12
+#define EBI_SIZE_64M 13
+#define EBI_SIZE_128M 14
+#define EBI_SIZE_256M 15
+ uint32 config;
+#define EBI_ENABLE 0x00000001 /* .. enable this range */
+#define EBI_WAIT_STATES 0x0000000e /* .. mask for wait states */
+#define EBI_WTST_SHIFT 1 /* .. for shifting wait states */
+#define EBI_WORD_WIDE 0x00000010 /* .. 16-bit peripheral, else 8 */
+#define EBI_WREN 0x00000020 /* enable posted writes */
+#define EBI_POLARITY 0x00000040 /* .. set to invert something,
+ ** don't know what yet */
+#define EBI_TS_TA_MODE 0x00000080 /* .. use TS/TA mode */
+#define EBI_TS_SEL 0x00000100 /* .. drive tsize, not bs_b */
+#define EBI_FIFO 0x00000200 /* .. use fifo */
+#define EBI_RE 0x00000400 /* .. Reverse Endian */
+#define EBI_SETUP_SHIFT 16
+#define EBI_HOLD_SHIFT 20
+#define EBI_SETUP_STATES 0x0f0000
+#define EBI_HOLD_STATES 0xf00000
+} EbiChipSelect;
+
+typedef struct MpiRegisters {
+ EbiChipSelect cs[7]; /* size chip select configuration */
+#define EBI_CS0_BASE 0
+#define EBI_CS1_BASE 1
+#define EBI_CS2_BASE 2
+#define EBI_CS3_BASE 3
+#define PCMCIA_COMMON_BASE 4
+#define PCMCIA_ATTRIBUTE_BASE 5
+#define PCMCIA_IO_BASE 6
+ uint32 unused0[2]; /* reserved */
+ uint32 ebi_control; /* ebi control */
+ uint32 unused1[4]; /* reserved */
+#define EBI_ACCESS_TIMEOUT 0x000007FF
+ uint32 pcmcia_cntl1; /* pcmcia control 1 */
+#define PCCARD_CARD_RESET 0x00040000
+#define CARDBUS_ENABLE 0x00008000
+#define PCMCIA_ENABLE 0x00004000
+#define PCMCIA_GPIO_ENABLE 0x00002000
+#define CARDBUS_IDSEL 0x00001F00
+#define VS2_OEN 0x00000080
+#define VS1_OEN 0x00000040
+#define VS2_OUT 0x00000020
+#define VS1_OUT 0x00000010
+#define VS2_IN 0x00000008
+#define VS1_IN 0x00000004
+#define CD2_IN 0x00000002
+#define CD1_IN 0x00000001
+#define VS_MASK 0x0000000C
+#define CD_MASK 0x00000003
+ uint32 unused2; /* reserved */
+ uint32 pcmcia_cntl2; /* pcmcia control 2 */
+#define PCMCIA_BYTESWAP_DIS 0x00000002
+#define PCMCIA_HALFWORD_EN 0x00000001
+#define RW_ACTIVE_CNT_BIT 2
+#define INACTIVE_CNT_BIT 8
+#define CE_SETUP_CNT_BIT 16
+#define CE_HOLD_CNT_BIT 24
+ uint32 unused3[40]; /* reserved */
+
+ uint32 sp0range; /* PCI to internal system bus address space */
+#define ADDR_SPACE_MASK 0xFFFF0000
+ uint32 sp0remap;
+ uint32 sp0cfg;
+ uint32 sp1range;
+ uint32 sp1remap;
+ uint32 sp1cfg;
+
+ uint32 EndianCfg;
+
+ uint32 l2pcfgctl; /* internal system bus to PCI IO/Cfg control */
+#define DIR_CFG_SEL 0x80000000 /* change from PCI I/O access to PCI config access */
+#define DIR_CFG_USEREG 0x40000000 /* use this register info for PCI configuration access */
+#define DEVICE_NUMBER 0x00007C00 /* device number for the PCI configuration access */
+#define FUNC_NUMBER 0x00000300 /* function number for the PCI configuration access */
+#define REG_NUMBER 0x000000FC /* register number for the PCI configuration access */
+#define CONFIG_TYPE 0x00000003 /* configuration type for the PCI configuration access */
+
+ uint32 l2pmrange1; /* internal system bus to PCI memory space */
+#define PCI_SIZE_64K 0xFFFF0000
+#define PCI_SIZE_128K 0xFFFE0000
+#define PCI_SIZE_256K 0xFFFC0000
+#define PCI_SIZE_512K 0xFFF80000
+#define PCI_SIZE_1M 0xFFF00000
+#define PCI_SIZE_2M 0xFFE00000
+#define PCI_SIZE_4M 0xFFC00000
+#define PCI_SIZE_8M 0xFF800000
+#define PCI_SIZE_16M 0xFF000000
+#define PCI_SIZE_32M 0xFE000000
+ uint32 l2pmbase1; /* kseg0 or kseg1 address & 0x1FFFFFFF */
+ uint32 l2pmremap1;
+#define CARDBUS_MEM 0x00000004
+#define MEM_WINDOW_EN 0x00000001
+ uint32 l2pmrange2;
+ uint32 l2pmbase2;
+ uint32 l2pmremap2;
+ uint32 l2piorange; /* internal system bus to PCI I/O space */
+ uint32 l2piobase;
+ uint32 l2pioremap;
+
+ uint32 pcimodesel;
+#define PCI_INT_BUS_RD_PREFETCH 0x000001F0
+#define PCI_BAR2_NOSWAP 0x00000002 /* BAR at offset 0x20 */
+#define PCI_BAR1_NOSWAP 0x00000001 /* BAR at affset 0x1c */
+
+ uint32 pciintstat; /* PCI interrupt mask/status */
+#define MAILBOX1_SENT 0x08
+#define MAILBOX0_SENT 0x04
+#define MAILBOX1_MSG_RCV 0x02
+#define MAILBOX0_MSG_RCV 0x01
+ uint32 locbuscntrl; /* internal system bus control */
+#define DIR_U2P_NOSWAP 0x00000002
+#define EN_PCI_GPIO 0x00000001
+ uint32 locintstat; /* internal system bus interrupt mask/status */
+#define CSERR 0x0200
+#define SERR 0x0100
+#define EXT_PCI_INT 0x0080
+#define DIR_FAILED 0x0040
+#define DIR_COMPLETE 0x0020
+#define PCI_CFG 0x0010
+ uint32 unused4[7];
+
+ uint32 mailbox0;
+ uint32 mailbox1;
+
+ uint32 pcicfgcntrl; /* internal system bus PCI configuration control */
+#define PCI_CFG_REG_WRITE_EN 0x00000080
+#define PCI_CFG_ADDR 0x0000003C
+ uint32 pcicfgdata; /* internal system bus PCI configuration data */
+
+ uint32 locch2ctl; /* PCI to interrnal system bus DMA (downstream) local control */
+#define MPI_DMA_HALT 0x00000008 /* idle after finish current memory burst */
+#define MPI_DMA_PKT_HALT 0x00000004 /* idle after an EOP flag is detected */
+#define MPI_DMA_STALL 0x00000002 /* idle after an EOP flag is detected */
+#define MPI_DMA_ENABLE 0x00000001 /* set to enable channel */
+ uint32 locch2intStat;
+#define MPI_DMA_NO_DESC 0x00000004 /* no valid descriptors */
+#define MPI_DMA_DONE 0x00000002 /* packet xfer complete */
+#define MPI_DMA_BUFF_DONE 0x00000001 /* buffer done */
+ uint32 locch2intMask;
+ uint32 unused5;
+ uint32 locch2descaddr;
+ uint32 locch2status1;
+#define LOCAL_DESC_STATE 0xE0000000
+#define PCI_DESC_STATE 0x1C000000
+#define BYTE_DONE 0x03FFC000
+#define RING_ADDR 0x00003FFF
+ uint32 locch2status2;
+#define BUFPTR_OFFSET 0x1FFF0000
+#define PCI_MASTER_STATE 0x000000C0
+#define LOC_MASTER_STATE 0x00000038
+#define CONTROL_STATE 0x00000007
+ uint32 unused6;
+
+ uint32 locch1Ctl; /*internal system bus to PCI DMA (upstream) local control */
+#define DMA_U2P_LE 0x00000200 /* local bus is little endian */
+#define DMA_U2P_NOSWAP 0x00000100 /* lccal bus is little endian but no data swapped */
+ uint32 locch1intstat;
+ uint32 locch1intmask;
+ uint32 unused7;
+ uint32 locch1descaddr;
+ uint32 locch1status1;
+ uint32 locch1status2;
+ uint32 unused8;
+
+ uint32 pcich1ctl; /* internal system bus to PCI DMA PCI control */
+ uint32 pcich1intstat;
+ uint32 pcich1intmask;
+ uint32 pcich1descaddr;
+ uint32 pcich1status1;
+ uint32 pcich1status2;
+
+ uint32 pcich2Ctl; /* PCI to internal system bus DMA PCI control */
+ uint32 pcich2intstat;
+ uint32 pcich2intmask;
+ uint32 pcich2descaddr;
+ uint32 pcich2status1;
+ uint32 pcich2status2;
+
+ uint32 perm_id; /* permanent device and vendor id */
+ uint32 perm_rev; /* permanent revision id */
+} MpiRegisters;
+
+#define MPI ((volatile MpiRegisters * const) MPI_BASE)
+
+/* PCI configuration address space start offset 0x40 */
+#define BRCM_PCI_CONFIG_TIMER 0x40
+#define BRCM_PCI_CONFIG_TIMER_RETRY_MASK 0x0000FF00
+#define BRCM_PCI_CONFIG_TIMER_TRDY_MASK 0x000000FF
+
+typedef struct USBControl {
+ uint32 BrtControl1;
+ uint32 BrtControl2;
+ uint32 BrtStatus1;
+ uint32 BrtStatus2;
+ uint32 UTMIControl1;
+ uint32 TestPortControl;
+ uint32 PllControl1;
+ uint32 SwapControl;
+#define USB_DEVICE_SEL (1<<6)
+#define EHCI_LOGICAL_ADDRESS_EN (1<<5)
+#define EHCI_ENDIAN_SWAP (1<<4)
+#define EHCI_DATA_SWAP (1<<3)
+#define OHCI_LOGICAL_ADDRESS_EN (1<<2)
+#define OHCI_ENDIAN_SWAP (1<<1)
+#define OHCI_DATA_SWAP (1<<0)
+ uint32 unused1;
+ uint32 FrameAdjustValue;
+ uint32 Setup;
+#define USBH_IOC (1<<4)
+ uint32 MDIO;
+ uint32 MDIO32;
+ uint32 USBSimControl;
+} USBControl;
+
+#define USBH ((volatile USBControl * const) USBH_CFG_BASE)
+
+/*
+** NAND Controller Registers
+*/
+typedef struct NandCtrlRegs {
+ uint32 NandRevision; /* NAND Revision */
+ uint32 NandCmdStart; /* Nand Flash Command Start */
+ uint32 NandCmdExtAddr; /* Nand Flash Command Extended Address */
+ uint32 NandCmdAddr; /* Nand Flash Command Address */
+ uint32 NandCmdEndAddr; /* Nand Flash Command End Address */
+ uint32 NandNandBootConfig; /* Nand Flash Boot Config */
+#define NBC_AUTO_DEV_ID_CFG 0x40000000
+ uint32 NandCsNandXor; /* Nand Flash EBI CS Address XOR with */
+} NandCtrlRegs;
+
+#define NAND ((volatile NandCtrlRegs * const) NAND_REG_BASE)
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/shared/opensource/include/bcm963xx/6816_cpu.h b/shared/opensource/include/bcm963xx/6816_cpu.h
new file mode 100755
index 0000000..56afce7
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/6816_cpu.h
@@ -0,0 +1,150 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+#ifndef __BCM6816_CPU_H
+#define __BCM6816_CPU_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+#************************************************************************
+#* Coprocessor 0 Register Names
+#************************************************************************
+*/
+#define C0_BCM_CONFIG $22
+
+/*
+# Select 1
+# Bit 31: unused
+# Bits 30:25 MMU Size (Num TLB entries-1)
+# Bits 24:22 ICache sets/way (2^n * 64)
+# Bits 21:19 ICache Line size (2^(n+1) bytes) 0=No Icache
+# Bits 18:16 ICache Associativity (n+1) way
+# Bits 15:13 DCache sets/way (2^n * 64)
+# Bits 12:10 DCache Line size (2^(n+1) bytes) 0=No Dcache
+# Bits 9:7 DCache Associativity (n+1) way
+# Bits 6:4 unused
+# Bit 3: 1=At least 1 watch register
+# Bit 2: 1=MIPS16 code compression implemented
+# Bit 1: 1=EJTAG implemented
+# Bit 0: 1=FPU implemented
+*/
+#define CP0_CFG_ISMSK (0x7 << 22)
+#define CP0_CFG_ISSHF 22
+#define CP0_CFG_ILMSK (0x7 << 19)
+#define CP0_CFG_ILSHF 19
+#define CP0_CFG_IAMSK (0x7 << 16)
+#define CP0_CFG_IASHF 16
+#define CP0_CFG_DSMSK (0x7 << 13)
+#define CP0_CFG_DSSHF 13
+#define CP0_CFG_DLMSK (0x7 << 10)
+#define CP0_CFG_DLSHF 10
+#define CP0_CFG_DAMSK (0x7 << 7)
+#define CP0_CFG_DASHF 7
+
+/*
+#************************************************************************
+#* Coprocessor 0 Broadcom Config Register Bits
+#************************************************************************
+*/
+#define CP0_BCM_CFG_ICSHEN (0x1 << 31)
+#define CP0_BCM_CFG_DCSHEN (0x1 << 30)
+#define CP0_BCM_CFG_BTHD (0x1 << 21)
+#define CP0_BCM_CFG_CLF (0x1 << 20)
+#define CP0_BCM_CFG_NBK (0x1 << 17)
+
+/*
+#************************************************************************
+#* Coprocessor 0 CMT Interrupt Register
+#************************************************************************
+*/
+#define CP0_CMT_XIR_4 (0x1 << 31)
+#define CP0_CMT_XIR_3 (0x1 << 30)
+#define CP0_CMT_XIR_2 (0x1 << 29)
+#define CP0_CMT_XIR_1 (0x1 << 28)
+#define CP0_CMT_XIR_0 (0x1 << 27)
+#define CP0_CMT_SIR_1 (0x1 << 16)
+#define CP0_CMT_SIR_0 (0x1 << 15)
+#define CP0_CMT_NMIR_TP1 (0x1 << 1)
+#define CP0_CMT_NMIR_TP0 (0x1 << 0)
+
+/*
+#************************************************************************
+#* Coprocessor 0 CMT Control Register
+#************************************************************************
+*/
+#define CP0_CMT_DSU_TP1 (0x1 << 30)
+#define CP0_CMT_TPS_SHFT 16
+#define CP0_CMT_TPS_MASK (0xF << CP0_CMT_TPS_SHFT)
+#define CP0_CMT_PRIO_TP1 (0x1 << 5)
+#define CP0_CMT_PRIO_TP0 (0x1 << 4)
+#define CP0_CMT_RSTSE (0x1 << 0)
+
+/*
+#************************************************************************
+#* Coprocessor 0 CMT Local Register
+#************************************************************************
+*/
+#define CP0_CMT_TPID (0x1 << 31)
+
+/*
+#************************************************************************
+#* MIPS Registers
+#************************************************************************
+*/
+
+#define MIPS_BASE_BOOT 0xbfa00000
+#define MIPS_BASE 0xff400000
+
+#define MIPS_RAC_CR0 0x00 // RAC Configuration Register
+#define MIPS_RAC_CR1 0x08 // RAC Configuration Register 1
+#define RAC_FLH (1 << 8)
+#define RAC_DPF (1 << 6)
+#define RAC_NCH (1 << 5)
+#define RAC_C_INV (1 << 4)
+#define RAC_PF_D (1 << 3)
+#define RAC_PF_I (1 << 2)
+#define RAC_D (1 << 1)
+#define RAC_I (1 << 0)
+
+#define MIPS_RAC_ARR 0x04 // RAC Address Range Register
+#define RAC_UPB_SHFT 16
+#define RAC_LWB_SHFT 0
+
+#define MIPS_LMB_CR 0x1C // LMB Control Register
+#define LMB_EN (1 << 0)
+
+#define MIPS_SBR 0x20 // System Base Register
+
+#define MIPS_TP0_ALT_BV 0x30000
+#define MIPS_TP1_ALT_BV 0x38000
+#define ENABLE_ALT_BV (1 << 19)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/shared/opensource/include/bcm963xx/6816_intr.h b/shared/opensource/include/bcm963xx/6816_intr.h
new file mode 100755
index 0000000..6a8d9e8
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/6816_intr.h
@@ -0,0 +1,116 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+#ifndef __6816_INTR_H
+#define __6816_INTR_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#define INTERRUPT_ID_SOFTWARE_0 0
+#define INTERRUPT_ID_SOFTWARE_1 1
+
+/*=====================================================================*/
+/* BCM6816 Timer Interrupt Level Assignments */
+/*=====================================================================*/
+#define MIPS_TIMER_INT 7
+
+/*=====================================================================*/
+/* Peripheral ISR Table Offset */
+/*=====================================================================*/
+#define INTERNAL_ISR_TABLE_OFFSET 8
+#define INTERNAL_HIGH_ISR_TABLE_OFFSET (INTERNAL_ISR_TABLE_OFFSET + 32)
+
+/*=====================================================================*/
+/* Logical Peripheral Interrupt IDs */
+/*=====================================================================*/
+
+#define INTERRUPT_ID_TIMER (INTERNAL_ISR_TABLE_OFFSET + 0)
+#define INTERRUPT_ID_SPI (INTERNAL_ISR_TABLE_OFFSET + 1)
+#define INTERRUPT_ID_UART (INTERNAL_ISR_TABLE_OFFSET + 2)
+#define INTERRUPT_ID_UART1 (INTERNAL_ISR_TABLE_OFFSET + 3)
+#define INTERRUPT_ID_DG (INTERNAL_ISR_TABLE_OFFSET + 4)
+#define INTERRUPT_ID_USBH (INTERNAL_ISR_TABLE_OFFSET + 5)
+#define INTERRUPT_ID_IPSEC (INTERNAL_ISR_TABLE_OFFSET + 6)
+#define INTERRUPT_ID_USBH20 (INTERNAL_ISR_TABLE_OFFSET + 7)
+#define INTERRUPT_ID_USBS (INTERNAL_ISR_TABLE_OFFSET + 8)
+#define INTERRUPT_ID_RING_OSC (INTERNAL_ISR_TABLE_OFFSET + 9)
+#define INTERRUPT_ID_NAND_FLASH (INTERNAL_ISR_TABLE_OFFSET + 10)
+#define INTERRUPT_ID_GPON (INTERNAL_ISR_TABLE_OFFSET + 11)
+#define INTERRUPT_ID_APM (INTERNAL_ISR_TABLE_OFFSET + 12)
+#define INTERRUPT_ID_MPI (INTERNAL_ISR_TABLE_OFFSET + 13)
+#define INTERRUPT_ID_EPHY (INTERNAL_ISR_TABLE_OFFSET + 14)
+#define INTERRUPT_ID_PCIE_NMI (INTERNAL_ISR_TABLE_OFFSET + 15)
+#define INTERRUPT_ID_PCIE_A (INTERNAL_ISR_TABLE_OFFSET + 16)
+#define INTERRUPT_ID_PCIE_B (INTERNAL_ISR_TABLE_OFFSET + 17)
+#define INTERRUPT_ID_PCIE_C (INTERNAL_ISR_TABLE_OFFSET + 18)
+#define INTERRUPT_ID_PCIE_D (INTERNAL_ISR_TABLE_OFFSET + 19)
+#define INTERRUPT_ID_EXTERNAL_0 (INTERNAL_ISR_TABLE_OFFSET + 20)
+#define INTERRUPT_ID_EXTERNAL_1 (INTERNAL_ISR_TABLE_OFFSET + 21)
+#define INTERRUPT_ID_EXTERNAL_2 (INTERNAL_ISR_TABLE_OFFSET + 22)
+#define INTERRUPT_ID_EXTERNAL_3 (INTERNAL_ISR_TABLE_OFFSET + 23)
+#define INTERRUPT_ID_EXTERNAL_4 (INTERNAL_ISR_TABLE_OFFSET + 24)
+#define INTERRUPT_ID_EXTERNAL_5 (INTERNAL_ISR_TABLE_OFFSET + 25)
+#define INTERRUPT_ID_USB_CNTL_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 26)
+#define INTERRUPT_ID_USB_CNTL_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 27)
+#define INTERRUPT_ID_USB_BULK_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 28)
+#define INTERRUPT_ID_USB_BULK_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 29)
+#define INTERRUPT_ID_USB_ISO_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 30)
+#define INTERRUPT_ID_USB_ISO_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 31)
+#define INTERRUPT_ID_ENETSW_RX_DMA_0 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 0)
+#define INTERRUPT_ID_ENETSW_RX_DMA_1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 1)
+#define INTERRUPT_ID_ENETSW_RX_DMA_2 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 2)
+#define INTERRUPT_ID_ENETSW_RX_DMA_3 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 3)
+#define INTERRUPT_ID_ENETSW_TX_DMA_0 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 4)
+#define INTERRUPT_ID_ENETSW_TX_DMA_1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 5)
+#define INTERRUPT_ID_ENETSW_TX_DMA_2 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 6)
+#define INTERRUPT_ID_ENETSW_TX_DMA_3 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 7)
+#define INTERRUPT_ID_MOCA_STOP (INTERNAL_HIGH_ISR_TABLE_OFFSET + 8)
+#define INTERRUPT_ID_MOCA_START (INTERNAL_HIGH_ISR_TABLE_OFFSET + 9)
+#define INTERRUPT_ID_MOCA_GEN (INTERNAL_HIGH_ISR_TABLE_OFFSET + 10)
+#define INTERRUPT_ID_MOCA_WDG (INTERNAL_HIGH_ISR_TABLE_OFFSET + 11)
+#define INTERRUPT_ID_EPHY_ENERGY_0 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 12)
+#define INTERRUPT_ID_EPHY_ENERGY_1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 13)
+#define INTERRUPT_ID_GPON_DMA_0 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 14)
+#define INTERRUPT_ID_GPON_DMA_1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 15)
+#define INTERRUPT_ID_APM_DMA_0 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 16)
+#define INTERRUPT_ID_APM_DMA_1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 17)
+#define INTERRUPT_ID_APM_DMA_2 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 18)
+#define INTERRUPT_ID_APM_DMA_3 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 19)
+#define INTERRUPT_ID_APM_DMA_4 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 20)
+#define INTERRUPT_ID_APM_DMA_5 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 21)
+#define INTERRUPT_ID_IPSEC_DMA_0 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 28)
+#define INTERRUPT_ID_IPSEC_DMA_1 (INTERNAL_HIGH_ISR_TABLE_OFFSET + 29)
+#define INTERRUPT_ID_I2C (INTERNAL_HIGH_ISR_TABLE_OFFSET + 31)
+
+#define INTERRUPT_ID_LAST INTERRUPT_ID_I2C
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* __BCM6816_H */
+
+
diff --git a/shared/opensource/include/bcm963xx/6816_map_part.h b/shared/opensource/include/bcm963xx/6816_map_part.h
new file mode 100755
index 0000000..f7aa541
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/6816_map_part.h
@@ -0,0 +1,1487 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+#ifndef __BCM6816_MAP_H
+#define __BCM6816_MAP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "bcmtypes.h"
+
+#define PERF_BASE 0xb0000000 /* chip control registers */
+#define TIMR_BASE 0xb0000040 /* timer registers */
+#define GPIO_BASE 0xb0000080 /* gpio registers */
+#define UART_BASE 0xb0000100 /* uart registers */
+#define UART1_BASE 0xb0000120 /* uart registers */
+#define SPI_BASE 0xb0000800 /* SPI master controller registers */
+#define HSSPIM_BASE 0xb0001000 /* High-Speed SPI registers */
+#define MISC_BASE 0xb0001800 /* Miscellaneous Registers */
+#define NAND_REG_BASE 0xb0002000 /* NAND registers */
+#define MPI_BASE 0xb00020A0 /* MPI control registers */
+#define NAND_CACHE_BASE 0xb0002200
+#define USB_CTL_BASE 0xb0002400 /* USB 2.0 device control registers */
+#define USB_EHCI_BASE 0x10002500 /* USB host registers */
+#define USB_OHCI_BASE 0x10002600 /* USB host registers */
+#define USBH_CFG_BASE 0xb0002700
+#define DDR_BASE 0xb0003000 /* Memory control registers */
+#define GPON_SERDES_BASE 0xb0004800 /* GPON SERDES Interface Registers */
+#define APM_HVG_BASE 0xb0008300 /* High-Voltage Generation */
+#define APM_HVG_BASE_REG_15 0xb0008408 /* High-Voltage Generation Register 15 */
+#define APM_HVG_BASE_REG_19 0xb0008488 /* High-Voltage Generation Register 19 */
+#define PCIE_BASE 0xb0e40000 /* PCIE registers */
+
+typedef struct DDRPhyControl {
+ uint32 REVISION; /* 0x00 */
+ uint32 CLK_PM_CTRL; /* 0x04 */
+ uint32 unused0[2]; /* 0x08-0x10 */
+ uint32 PLL_STATUS; /* 0x10 */
+ uint32 PLL_CONFIG; /* 0x14 */
+ uint32 PLL_PRE_DIVIDER; /* 0x18 */
+ uint32 PLL_DIVIDER; /* 0x1c */
+ uint32 PLL_CONTROL1; /* 0x20 */
+ uint32 PLL_CONTROL2; /* 0x24 */
+ uint32 PLL_SS_EN; /* 0x28 */
+ uint32 PLL_SS_CFG; /* 0x2c */
+ uint32 STATIC_VDL_OVERRIDE; /* 0x30 */
+ uint32 DYNAMIC_VDL_OVERRIDE; /* 0x34 */
+ uint32 IDLE_PAD_CONTROL; /* 0x38 */
+ uint32 ZQ_PVT_COMP_CTL; /* 0x3c */
+ uint32 DRIVE_PAD_CTL; /* 0x40 */
+ uint32 CLOCK_REG_CONTROL; /* 0x44 */
+ uint32 unused1[46];
+} DDRPhyControl;
+
+typedef struct DDRPhyByteLaneControl {
+ uint32 REVISION; /* 0x00 */
+ uint32 VDL_CALIBRATE; /* 0x04 */
+ uint32 VDL_STATUS; /* 0x08 */
+ uint32 unused; /* 0x0c */
+ uint32 VDL_OVERRIDE_0; /* 0x10 */
+ uint32 VDL_OVERRIDE_1; /* 0x14 */
+ uint32 VDL_OVERRIDE_2; /* 0x18 */
+ uint32 VDL_OVERRIDE_3; /* 0x1c */
+ uint32 VDL_OVERRIDE_4; /* 0x20 */
+ uint32 VDL_OVERRIDE_5; /* 0x24 */
+ uint32 VDL_OVERRIDE_6; /* 0x28 */
+ uint32 VDL_OVERRIDE_7; /* 0x2c */
+ uint32 READ_CONTROL; /* 0x30 */
+ uint32 READ_FIFO_STATUS; /* 0x34 */
+ uint32 READ_FIFO_CLEAR; /* 0x38 */
+ uint32 IDLE_PAD_CONTROL; /* 0x3c */
+ uint32 DRIVE_PAD_CTL; /* 0x40 */
+ uint32 CLOCK_PAD_DISABLE; /* 0x44 */
+ uint32 WR_PREAMBLE_MODE; /* 0x48 */
+ uint32 CLOCK_REG_CONTROL; /* 0x4C */
+ uint32 unused0[44];
+} DDRPhyByteLaneControl;
+
+typedef struct DDRControl {
+ uint32 CNFG; /* 0x000 */
+ uint32 CSST; /* 0x004 */
+ uint32 CSEND; /* 0x008 */
+ uint32 unused; /* 0x00c */
+ uint32 ROW00_0; /* 0x010 */
+ uint32 ROW00_1; /* 0x014 */
+ uint32 ROW01_0; /* 0x018 */
+ uint32 ROW01_1; /* 0x01c */
+ uint32 unused0[4];
+ uint32 ROW20_0; /* 0x030 */
+ uint32 ROW20_1; /* 0x034 */
+ uint32 ROW21_0; /* 0x038 */
+ uint32 ROW21_1; /* 0x03c */
+ uint32 unused1[4];
+ uint32 COL00_0; /* 0x050 */
+ uint32 COL00_1; /* 0x054 */
+ uint32 COL01_0; /* 0x058 */
+ uint32 COL01_1; /* 0x05c */
+ uint32 unused2[4];
+ uint32 COL20_0; /* 0x070 */
+ uint32 COL20_1; /* 0x074 */
+ uint32 COL21_0; /* 0x078 */
+ uint32 COL21_1; /* 0x07c */
+ uint32 unused3[4];
+ uint32 BNK10; /* 0x090 */
+ uint32 BNK32; /* 0x094 */
+ uint32 unused4[26];
+ uint32 DCMD; /* 0x100 */
+#define DCMD_CS1 (1 << 5)
+#define DCMD_CS0 (1 << 4)
+#define DCMD_SET_SREF 4
+ uint32 DMODE_0; /* 0x104 */
+ uint32 DMODE_1; /* 0x108 */
+#define DMODE_1_DRAMSLEEP (1 << 11)
+ uint32 CLKS; /* 0x10c */
+ uint32 ODT; /* 0x110 */
+ uint32 TIM1_0; /* 0x114 */
+ uint32 TIM1_1; /* 0x118 */
+ uint32 TIM2; /* 0x11c */
+ uint32 CTL_CRC; /* 0x120 */
+ uint32 DOUT_CRC; /* 0x124 */
+ uint32 DIN_CRC; /* 0x128 */
+ uint32 unused5[53];
+
+ DDRPhyControl PhyControl; /* 0x200 */
+ DDRPhyByteLaneControl PhyByteLane0Control; /* 0x300 */
+ DDRPhyByteLaneControl PhyByteLane1Control; /* 0x400 */
+ DDRPhyByteLaneControl PhyByteLane2Control; /* 0x500 */
+ DDRPhyByteLaneControl PhyByteLane3Control; /* 0x600 */
+ uint32 unused6[64];
+
+ uint32 GCFG; /* 0x800 */
+ uint32 LBIST_CFG; /* 0x804 */
+ uint32 LBIST_SEED; /* 0x808 */
+ uint32 ARB; /* 0x80c */
+ uint32 PI_GCF; /* 0x810 */
+ uint32 PI_UBUS_CTL; /* 0x814 */
+ uint32 PI_MIPS_CTL; /* 0x818 */
+ uint32 PI_DSL_MIPS_CTL; /* 0x81c */
+ uint32 PI_DSL_PHY_CTL; /* 0x820 */
+ uint32 PI_UBUS_ST; /* 0x824 */
+ uint32 PI_MIPS_ST; /* 0x828 */
+ uint32 PI_DSL_MIPS_ST; /* 0x82c */
+ uint32 PI_DSL_PHY_ST; /* 0x830 */
+ uint32 PI_UBUS_SMPL; /* 0x834 */
+ uint32 TESTMODE; /* 0x838 */
+ uint32 TEST_CFG1; /* 0x83c */
+ uint32 TEST_PAT; /* 0x840 */
+ uint32 TEST_COUNT; /* 0x844 */
+ uint32 TEST_CURR_COUNT; /* 0x848 */
+ uint32 TEST_ADDR_UPDT; /* 0x84c */
+ uint32 TEST_ADDR; /* 0x850 */
+ uint32 TEST_DATA0; /* 0x854 */
+ uint32 TEST_DATA1; /* 0x858 */
+ uint32 TEST_DATA2; /* 0x85c */
+ uint32 TEST_DATA3; /* 0x860 */
+} DDRControl;
+
+#define DDR ((volatile DDRControl * const) DDR_BASE)
+
+/*
+** Peripheral Controller
+*/
+
+#define IRQ_BITS 64
+typedef struct {
+ uint64 IrqMask;
+ uint64 IrqStatus;
+} IrqControl_t;
+
+typedef struct PerfControl {
+ uint32 RevID; /* (00) word 0 */
+ uint32 blkEnables; /* (04) word 1 */
+#define ACP_A_CLK_EN (1 << 25)
+#define ACP_B_CLK_EN (1 << 24)
+#define NTP_CLK_EN (1 << 23)
+#define PCM_CLK_EN (1 << 22)
+#define BMU_CLK_EN (1 << 21)
+#define PCIE_CLK_EN (1 << 20)
+#define GPON_SER_CLK_EN (1 << 19)
+#define IPSEC_CLK_EN (1 << 18)
+#define NAND_CLK_EN (1 << 17)
+#define DISABLE_GLESS (1 << 16)
+#define USBH_CLK_EN (1 << 15)
+#define APM_CLK_EN (1 << 14)
+#define ROBOSW_CLK_EN (1 << 12)
+#define USBD_CLK_EN (1 << 10)
+#define SPI_CLK_EN (1 << 9)
+#define SWPKT_GPON_CLK_EN (1 << 8)
+#define SWPKT_USB_CLK_EN (1 << 7)
+#define GPON_CLK_EN (1 << 6)
+
+ uint32 pll_control; /* (08) word 2 */
+#define SOFT_RESET 0x00000001 // 0
+
+ uint32 deviceTimeoutEn; /* (0c) word 3 */
+ uint32 softResetB; /* (10) word 4 */
+#define SOFT_RST_SERDES_DIG (1 << 23)
+#define SOFT_RST_SERDES (1 << 22)
+#define SOFT_RST_SERDES_MDIO (1 << 21)
+#define SOFT_RST_SERDES_PLL (1 << 20)
+#define SOFT_RST_SERDES_HW (1 << 19)
+#define SOFT_RST_GPON (1 << 18)
+#define SOFT_RST_BMU (1 << 17)
+#define SOFT_RST_HVG (1 << 16)
+#define SOFT_RST_APM (1 << 15)
+#define SOFT_RST_ACP (1 << 14)
+#define SOFT_RST_PCM (1 << 13)
+#define SOFT_RST_USBH (1 << 12)
+#define SOFT_RST_USBD (1 << 11)
+#define SOFT_RST_SWITCH (1 << 10)
+#define SOFT_RST_MOCA_CPU (1 << 9)
+#define SOFT_RST_MOCA_SYS (1 << 8)
+#define SOFT_RST_MOCA (1 << 7)
+#define SOFT_RST_EPHY (1 << 6)
+#define SOFT_RST_PCIE (1 << 5)
+#define SOFT_RST_IPSEC (1 << 4)
+#define SOFT_RST_MPI (1 << 3)
+#define SOFT_RST_PCIE_EXT (1 << 2)
+#define SOFT_RST_PCIE_CORE (1 << 1)
+#define SOFT_RST_SPI (1 << 0)
+
+ uint32 diagControl; /* (14) word 5 */
+ uint32 ExtIrqCfg; /* (18) word 6*/
+ uint32 ExtIrqCfg1; /* (1c) word 7 */
+#define EI_SENSE_SHFT 0
+#define EI_STATUS_SHFT 4
+#define EI_CLEAR_SHFT 8
+#define EI_MASK_SHFT 12
+#define EI_INSENS_SHFT 16
+#define EI_LEVEL_SHFT 20
+
+ IrqControl_t IrqControl[2];
+} PerfControl;
+
+#define PERF ((volatile PerfControl * const) PERF_BASE)
+
+/*
+** Timer
+*/
+typedef struct Timer {
+ uint16 unused0;
+ byte TimerMask;
+#define TIMER0EN 0x01
+#define TIMER1EN 0x02
+#define TIMER2EN 0x04
+ byte TimerInts;
+#define TIMER0 0x01
+#define TIMER1 0x02
+#define TIMER2 0x04
+#define WATCHDOG 0x08
+ uint32 TimerCtl0;
+ uint32 TimerCtl1;
+ uint32 TimerCtl2;
+#define TIMERENABLE 0x80000000
+#define RSTCNTCLR 0x40000000
+ uint32 TimerCnt0;
+ uint32 TimerCnt1;
+ uint32 TimerCnt2;
+ uint32 WatchDogDefCount;
+
+ /* Write 0xff00 0x00ff to Start timer
+ * Write 0xee00 0x00ee to Stop and re-load default count
+ * Read from this register returns current watch dog count
+ */
+ uint32 WatchDogCtl;
+
+ /* Number of 50-MHz ticks for WD Reset pulse to last */
+ uint32 WDResetCount;
+} Timer;
+
+#define TIMER ((volatile Timer * const) TIMR_BASE)
+
+/*
+** UART
+*/
+typedef struct UartChannel {
+ byte unused0;
+ byte control;
+#define BRGEN 0x80 /* Control register bit defs */
+#define TXEN 0x40
+#define RXEN 0x20
+#define LOOPBK 0x10
+#define TXPARITYEN 0x08
+#define TXPARITYEVEN 0x04
+#define RXPARITYEN 0x02
+#define RXPARITYEVEN 0x01
+
+ byte config;
+#define XMITBREAK 0x40
+#define BITS5SYM 0x00
+#define BITS6SYM 0x10
+#define BITS7SYM 0x20
+#define BITS8SYM 0x30
+#define ONESTOP 0x07
+#define TWOSTOP 0x0f
+ /* 4-LSBS represent STOP bits/char
+ * in 1/8 bit-time intervals. Zero
+ * represents 1/8 stop bit interval.
+ * Fifteen represents 2 stop bits.
+ */
+ byte fifoctl;
+#define RSTTXFIFOS 0x80
+#define RSTRXFIFOS 0x40
+ /* 5-bit TimeoutCnt is in low bits of this register.
+ * This count represents the number of characters
+ * idle times before setting receive Irq when below threshold
+ */
+ uint32 baudword;
+ /* When divide SysClk/2/(1+baudword) we should get 32*bit-rate
+ */
+
+ byte txf_levl; /* Read-only fifo depth */
+ byte rxf_levl; /* Read-only fifo depth */
+ byte fifocfg; /* Upper 4-bits are TxThresh, Lower are
+ * RxThreshold. Irq can be asserted
+ * when rx fifo> thresh, txfifo<thresh
+ */
+ byte prog_out; /* Set value of DTR (Bit0), RTS (Bit1)
+ * if these bits are also enabled to GPIO_o
+ */
+#define DTREN 0x01
+#define RTSEN 0x02
+
+ byte unused1;
+ byte DeltaIPEdgeNoSense; /* Low 4-bits, set corr bit to 1 to
+ * detect irq on rising AND falling
+ * edges for corresponding GPIO_i
+ * if enabled (edge insensitive)
+ */
+ byte DeltaIPConfig_Mask; /* Upper 4 bits: 1 for posedge sense
+ * 0 for negedge sense if
+ * not configured for edge
+ * insensitive (see above)
+ * Lower 4 bits: Mask to enable change
+ * detection IRQ for corresponding
+ * GPIO_i
+ */
+ byte DeltaIP_SyncIP; /* Upper 4 bits show which bits
+ * have changed (may set IRQ).
+ * read automatically clears bit
+ * Lower 4 bits are actual status
+ */
+
+ uint16 intMask; /* Same Bit defs for Mask and status */
+ uint16 intStatus;
+#define DELTAIP 0x0001
+#define TXUNDERR 0x0002
+#define TXOVFERR 0x0004
+#define TXFIFOTHOLD 0x0008
+#define TXREADLATCH 0x0010
+#define TXFIFOEMT 0x0020
+#define RXUNDERR 0x0040
+#define RXOVFERR 0x0080
+#define RXTIMEOUT 0x0100
+#define RXFIFOFULL 0x0200
+#define RXFIFOTHOLD 0x0400
+#define RXFIFONE 0x0800
+#define RXFRAMERR 0x1000
+#define RXPARERR 0x2000
+#define RXBRK 0x4000
+
+ uint16 unused2;
+ uint16 Data; /* Write to TX, Read from RX */
+ /* bits 11:8 are BRK,PAR,FRM errors */
+
+ uint32 unused3;
+ uint32 unused4;
+} Uart;
+
+#define UART ((volatile Uart * const) UART_BASE)
+
+/*
+** Gpio Controller
+*/
+
+typedef struct GpioControl {
+ uint64 GPIODir; /* 0 */
+ uint64 GPIOio; /* 8 */
+#define GPIO_MoCA_OVERLAY_UART_WRITE 39
+#define GPIO_MoCA_OVERLAY_UART_READ 38
+ uint32 LEDCtrl;
+#define LED_ALL_STROBE 0x0f000000
+#define LED3_STROBE 0x08000000
+#define LED2_STROBE 0x04000000
+#define LED1_STROBE 0x02000000
+#define LED0_STROBE 0x01000000
+#define LED_TEST 0x00010000
+#define DISABLE_LINK_ACT_ALL 0x0000f000
+#define DISABLE_LINK_ACT_3 0x00008000
+#define DISABLE_LINK_ACT_2 0x00004000
+#define DISABLE_LINK_ACT_1 0x00002000
+#define DISABLE_LINK_ACT_0 0x00001000
+#define LED_INTERVAL_SET_MASK 0x00000f00
+#define LED_INTERVAL_SET_1280MS 0x00000700
+#define LED_INTERVAL_SET_640MS 0x00000600
+#define LED_INTERVAL_SET_320MS 0x00000500
+#define LED_INTERVAL_SET_160MS 0x00000400
+#define LED_INTERVAL_SET_80MS 0x00000300
+#define LED_INTERVAL_SET_40MS 0x00000200
+#define LED_INTERVAL_SET_20MS 0x00000100
+#define LED_ON_ALL 0x000000f0
+#define LED_ON_3 0x00000080
+#define LED_ON_2 0x00000040
+#define LED_ON_1 0x00000020
+#define LED_ON_0 0x00000010
+#define LED_ENABLE_ALL 0x0000000f
+#define LED_ENABLE_3 0x00000008
+#define LED_ENABLE_2 0x00000004
+#define LED_ENABLE_1 0x00000002
+#define LED_ENABLE_0 0x00000001
+ uint32 SpiSlaveCfg; /* 14 */
+ uint32 GPIOMode; /* 18 */
+#define GPIO_MODE_SPI_SSN5 (1<<31)
+#define GPIO_MODE_SPI_SSN4 (1<<30)
+#define GPIO_MODE_SPI_SSN3 (1<<29)
+#define GPIO_MODE_SPI_SSN2 (1<<28)
+#define GPIO_MODE_EBI_CS3 (1<<27)
+#define GPIO_MODE_EBI_CS2 (1<<26)
+#define GPIO_MODE_APM_CLK (1<<25)
+#define GPIO_MODE_APM_SDIN (1<<24)
+#define GPIO_MODE_APM_SDOUT (1<<23)
+#define GPIO_MODE_APM_FRAME_SYNC (1<<22)
+#define GPIO_MODE_PCI_GNT0 (1<<20)
+#define GPIO_MODE_PCI_REQ0 (1<<19)
+#define GPIO_MODE_PCI_INTB (1<<18)
+#define GPIO_MODE_PCI_GNT1 (1<<17)
+#define GPIO_MODE_PCI_REQ1 (1<<16)
+#define GPIO_MODE_NTR_PULSE (1<<15)
+#define GPIO_MODE_USBD_LED (1<<14)
+#define GPIO_MODE_ROBOSW_LED1 (1<<13)
+#define GPIO_MODE_ROBOSW_LED0 (1<<12)
+#define GPIO_MODE_ROBOSW_LED_CLK (1<<11)
+#define GPIO_MODE_ROBOSW_LED_DATA (1<<10)
+#define GPIO_MODE_GPON_LED (1<<8)
+#define GPIO_MODE_GPHY1_LED (1<<7)
+#define GPIO_MODE_GPHY0_LED (1<<6)
+#define GPIO_MODE_MOCA_LED (1<<5)
+#define GPIO_MODE_SERIAL_LED_CLK (1<<4)
+#define GPIO_MODE_SERIAL_LED_DATA (1<<3)
+#define GPIO_MODE_SYS_IRQ (1<<2)
+#define GPIO_MODE_GPON_TX_APC_FAIL (1<<1) /*Anticipating B0*/
+#define GPIO_MODE_GPON_TX_EN_L (1<<0)
+
+ uint32 VregConfig; /* 1C */
+#define VREG_VSEL1P2_SHIFT 8
+#define VREG_VSEL1P2_MASK (0x0f<<8)
+#define VREG_VSEL1P2_MIDDLE 9
+
+ uint32 AuxLedInterval; /* 20 */
+#define AUX_LED_IN_7 0x80000000
+#define AUX_LED_IN_6 0x40000000
+#define AUX_LED_IN_5 0x20000000
+#define AUX_LED_IN_4 0x10000000
+#define AUX_LED_IN_MASK 0xf0000000
+#define LED_IN_3 0x08000000
+#define LED_IN_2 0x04000000
+#define LED_IN_1 0x02000000
+#define LED_IN_0 0x01000000
+#define AUX_LED_TEST 0x00400000
+#define USE_NEW_INTV 0x00200000
+#define LED7_LNK_ORAND 0x00100000
+#define LED7_LNK_MASK 0x000f0000
+#define LED7_LNK_MASK_SHFT 16
+#define LED7_ACT_MASK 0x0000f000
+#define LED7_ACT_MASK_SHFT 12
+#define AUX_FLASH_INTV 0x00000fc0
+#define AUX_FLASH_INTV_100MS 0x00000140
+#define AUX_FLASH_INTV_SHFT 6
+#define AUX_BLINK_INTV 0x0000003f
+#define AUX_BLINK_INTV_60MS 0x00000003
+ uint32 AuxLedCtrl; /* 24 */
+#define AUX_HW_DISAB_7 0x80000000
+#define AUX_STROBE_7 0x40000000
+#define AUX_MODE_7 0x30000000
+#define AUX_MODE_SHFT_7 28
+#define AUX_HW_DISAB_6 0x08000000
+#define AUX_STROBE_6 0x04000000
+#define AUX_MODE_6 0x03000000
+#define AUX_MODE_SHFT_6 24
+#define AUX_HW_DISAB_5 0x00800000
+#define AUX_STROBE_5 0x00400000
+#define AUX_MODE_5 0x00300000
+#define AUX_MODE_SHFT_5 20
+#define AUX_HW_DISAB_4 0x00080000
+#define AUX_STROBE_4 0x00040000
+#define AUX_MODE_4 0x00030000
+#define AUX_MODE_SHFT_4 16
+#define AUX_HW_DISAB_3 0x00008000
+#define AUX_STROBE_3 0x00004000
+#define AUX_MODE_3 0x00003000
+#define AUX_MODE_SHFT_3 12
+#define AUX_HW_DISAB_2 0x00000800
+#define AUX_STROBE_2 0x00000400
+#define AUX_MODE_2 0x00000300
+#define AUX_MODE_SHFT_2 8
+#define AUX_HW_DISAB_1 0x00000080
+#define AUX_STROBE_1 0x00000040
+#define AUX_MODE_1 0x00000030
+#define AUX_MODE_SHFT_1 4
+#define AUX_HW_DISAB_0 0x00000008
+#define AUX_STROBE_0 0x00000004
+#define AUX_MODE_0 0x00000003
+#define AUX_MODE_SHFT_0 0
+
+#define LED_STEADY_OFF 0x0
+#define LED_FLASH 0x1
+#define LED_BLINK 0x2
+#define LED_STEADY_ON 0x3
+
+ uint32 TestControl; /* 28 */
+
+ uint32 OscControl; /* 2C */
+ uint32 RoboSWLEDControl; /* 30 */
+ uint32 RoboSWLEDLSR; /* 34 */
+ uint32 GPIOBaseMode; /* 38 */
+#define EN_GMII2 (1<<17)
+#define EN_GMII1 (1<<16)
+ uint32 RoboswEphyCtrl; /* 3C */
+#define RSW_HW_FWDG_EN (1<<19)
+#define RSW_MII_DUMB_FWDG_EN (1<<16)
+#define EPHY_RST_4 (1<<9)
+#define EPHY_RST_3 (1<<8)
+#define EPHY_RST_2 (1<<7)
+#define EPHY_RST_1 (1<<6)
+#define EPHY_PWR_DOWN_4 (1<<5)
+#define EPHY_PWR_DOWN_3 (1<<4)
+#define EPHY_PWR_DOWN_2 (1<<3)
+#define EPHY_PWR_DOWN_1 (1<<2)
+ uint32 unused1[2]; /* 40 */
+
+ uint32 RingOscCtrl0; /* 48 */
+#define RING_OSC_256_CYCLES 8
+#define RING_OSC_512_CYCLES 9
+#define RING_OSC_1024_CYCLES 10
+
+ uint32 RingOscCtrl1; /* 4C */
+#define RING_OSC_ENABLE_MASK (0x57<<24)
+#define RING_OSC_ENABLE_SHIFT 24
+#define RING_OSC_MAX 7
+#define RING_OSC_COUNT_RESET (0x1<<23)
+#define RING_OSC_SELECT_MASK (0x7<<20)
+#define RING_OSC_SELECT_SHIFT 20
+#define RING_OSC_IRQ (0x1<<18)
+#define RING_OSC_COUNTER_OVERFLOW (0x1<<17)
+#define RING_OSC_COUNTER_BUSY (0x1<<16)
+#define RING_OSC_COUNT_MASK 0x0000ffff
+
+ uint32 SerialLed; /* 50 */
+ uint32 SerialLedCtrl; /* 54 */
+#define SER_LED_BUSY (1<<3)
+#define SER_LED_POLARITY (1<<2)
+#define SER_LED_DIV_1 0
+#define SER_LED_DIV_2 1
+#define SER_LED_DIV_4 2
+#define SER_LED_DIV_8 3
+#define SER_LED_DIV_MASK 0x3
+#define SER_LED_DIV_SHIFT 0
+ uint32 SerialLedBlink; /* 58 */
+ uint32 SerdesCtl; /* 5c */
+#define SERDES_PCIE_ENABLE 0x00000001
+#define SERDES_PCIE_EXD_ENABLE (1<<15)
+ uint32 SerdesStatus; /* 60 */
+ uint32 unused2; /* 64 */
+ uint32 DieRevID; /* 68 */
+ uint32 DiagMemStatus; /* 6c */
+ uint32 DiagSelControl; /* 70 */
+ uint32 DiagReadBack; /* 74 */
+ uint32 DiagReadBackHi; /* 78 */
+ uint32 DiagMiscControl; /* 7c */
+#define EPHY_SA_RESET_N 0x00000300
+#define EPHY_SA_TESTEN 0x00000500
+#define EPHY_SA_CLOCK_RESET 0x0000d900
+} GpioControl;
+
+#define GPIO ((volatile GpioControl * const) GPIO_BASE)
+
+/* Number to mask conversion macro used for GPIODir and GPIOio */
+#define GPIO_NUM_MAX 40
+#define GPIO_NUM_TO_MASK(X) ( (((X) & BP_GPIO_NUM_MASK) < GPIO_NUM_MAX) ? ((uint64)1 << ((X) & BP_GPIO_NUM_MASK)) : (0) )
+
+/*
+** Spi Controller
+*/
+
+typedef struct SpiControl {
+ uint16 spiMsgCtl; /* (0x0) control byte */
+#define FULL_DUPLEX_RW 0
+#define HALF_DUPLEX_W 1
+#define HALF_DUPLEX_R 2
+#define SPI_MSG_TYPE_SHIFT 14
+#define SPI_BYTE_CNT_SHIFT 0
+ byte spiMsgData[0x21e]; /* (0x02 - 0x21f) msg data */
+ byte unused0[0x1e0];
+ byte spiRxDataFifo[0x220]; /* (0x400 - 0x61f) rx data */
+ byte unused1[0xe0];
+
+ uint16 spiCmd; /* (0x700): SPI command */
+#define SPI_CMD_NOOP 0
+#define SPI_CMD_SOFT_RESET 1
+#define SPI_CMD_HARD_RESET 2
+#define SPI_CMD_START_IMMEDIATE 3
+
+#define SPI_CMD_COMMAND_SHIFT 0
+#define SPI_CMD_COMMAND_MASK 0x000f
+
+#define SPI_CMD_DEVICE_ID_SHIFT 4
+#define SPI_CMD_PREPEND_BYTE_CNT_SHIFT 8
+#define SPI_CMD_ONE_BYTE_SHIFT 11
+#define SPI_CMD_ONE_WIRE_SHIFT 12
+#define SPI_DEV_ID_0 0
+#define SPI_DEV_ID_1 1
+#define SPI_DEV_ID_2 2
+#define SPI_DEV_ID_3 3
+
+ byte spiIntStatus; /* (0x702): SPI interrupt status */
+ byte spiMaskIntStatus; /* (0x703): SPI masked interrupt status */
+
+ byte spiIntMask; /* (0x704): SPI interrupt mask */
+#define SPI_INTR_CMD_DONE 0x01
+#define SPI_INTR_RX_OVERFLOW 0x02
+#define SPI_INTR_INTR_TX_UNDERFLOW 0x04
+#define SPI_INTR_TX_OVERFLOW 0x08
+#define SPI_INTR_RX_UNDERFLOW 0x10
+#define SPI_INTR_CLEAR_ALL 0x1f
+
+ byte spiStatus; /* (0x705): SPI status */
+#define SPI_RX_EMPTY 0x02
+#define SPI_CMD_BUSY 0x04
+#define SPI_SERIAL_BUSY 0x08
+
+ byte spiClkCfg; /* (0x706): SPI clock configuration */
+#define SPI_CLK_0_391MHZ 1
+#define SPI_CLK_0_781MHZ 2 /* default */
+#define SPI_CLK_1_563MHZ 3
+#define SPI_CLK_3_125MHZ 4
+#define SPI_CLK_6_250MHZ 5
+#define SPI_CLK_12_50MHZ 6
+#define SPI_CLK_MASK 0x07
+#define SPI_SSOFFTIME_MASK 0x38
+#define SPI_SSOFFTIME_SHIFT 3
+#define SPI_BYTE_SWAP 0x80
+
+ byte spiFillByte; /* (0x707): SPI fill byte */
+ byte unused2;
+ byte spiMsgTail; /* (0x709): msgtail */
+ byte unused3;
+ byte spiRxTail; /* (0x70B): rxtail */
+} SpiControl;
+
+
+#define SPI ((volatile SpiControl * const) SPI_BASE)
+
+
+/*
+** High-Speed SPI Controller
+*/
+
+#define __mask(end, start) (((1 << ((end - start) + 1)) - 1) << start)
+typedef struct HsSpiControl {
+
+ uint32 hs_spiGlobalCtrl; // 0x0000
+#define HS_SPI_MOSI_IDLE (1 << 18)
+#define HS_SPI_CLK_STATE_GATED (1 << 17)
+#define HS_SPI_CLK_GATE_SSOFF (1 << 16)
+#define HS_SPI_PLL_CLK_CTRL (8)
+#define HS_SPI_PLL_CLK_CTRL_MASK __mask(15, HS_SPI_PLL_CLK_CTRL)
+#define HS_SPI_SS_POLARITY (0)
+#define HS_SPI_SS_POLARITY_MASK __mask(7, HS_SPI_SS_POLARITY)
+
+ uint32 hs_spiExtTrigCtrl; // 0x0004
+#define HS_SPI_TRIG_RAW_STATE (24)
+#define HS_SPI_TRIG_RAW_STATE_MASK __mask(31, HS_SPI_TRIG_RAW_STATE)
+#define HS_SPI_TRIG_LATCHED (16)
+#define HS_SPI_TRIG_LATCHED_MASK __mask(23, HS_SPI_TRIG_LATCHED)
+#define HS_SPI_TRIG_SENSE (8)
+#define HS_SPI_TRIG_SENSE_MASK __mask(15, HS_SPI_TRIG_SENSE)
+#define HS_SPI_TRIG_TYPE (0)
+#define HS_SPI_TRIG_TYPE_MASK __mask(7, HS_SPI_TRIG_TYPE)
+#define HS_SPI_TRIG_TYPE_EDGE (0)
+#define HS_SPI_TRIG_TYPE_LEVEL (1)
+
+ uint32 hs_spiIntStatus; // 0x0008
+#define HS_SPI_IRQ_PING1_USER (28)
+#define HS_SPI_IRQ_PING1_USER_MASK __mask(31, HS_SPI_IRQ_PING1_USER)
+#define HS_SPI_IRQ_PING0_USER (24)
+#define HS_SPI_IRQ_PING0_USER_MASK __mask(27, HS_SPI_IRQ_PING0_USER)
+
+#define HS_SPI_IRQ_PING1_CTRL_INV (1 << 12)
+#define HS_SPI_IRQ_PING1_POLL_TOUT (1 << 11)
+#define HS_SPI_IRQ_PING1_TX_UNDER (1 << 10)
+#define HS_SPI_IRQ_PING1_RX_OVER (1 << 9)
+#define HS_SPI_IRQ_PING1_CMD_DONE (1 << 8)
+
+#define HS_SPI_IRQ_PING0_CTRL_INV (1 << 4)
+#define HS_SPI_IRQ_PING0_POLL_TOUT (1 << 3)
+#define HS_SPI_IRQ_PING0_TX_UNDER (1 << 2)
+#define HS_SPI_IRQ_PING0_RX_OVER (1 << 1)
+#define HS_SPI_IRQ_PING0_CMD_DONE (1 << 0)
+
+ uint32 hs_spiIntStatusMasked; // 0x000C
+#define HS_SPI_IRQSM__PING1_USER (28)
+#define HS_SPI_IRQSM__PING1_USER_MASK __mask(31, HS_SPI_IRQSM__PING1_USER)
+#define HS_SPI_IRQSM__PING0_USER (24)
+#define HS_SPI_IRQSM__PING0_USER_MASK __mask(27, HS_SPI_IRQSM__PING0_USER)
+
+#define HS_SPI_IRQSM__PING1_CTRL_INV (1 << 12)
+#define HS_SPI_IRQSM__PING1_POLL_TOUT (1 << 11)
+#define HS_SPI_IRQSM__PING1_TX_UNDER (1 << 10)
+#define HS_SPI_IRQSM__PING1_RX_OVER (1 << 9)
+#define HS_SPI_IRQSM__PING1_CMD_DONE (1 << 8)
+
+#define HS_SPI_IRQSM__PING0_CTRL_INV (1 << 4)
+#define HS_SPI_IRQSM__PING0_POLL_TOUT (1 << 3)
+#define HS_SPI_IRQSM__PING0_TX_UNDER (1 << 2)
+#define HS_SPI_IRQSM__PING0_RX_OVER (1 << 1)
+#define HS_SPI_IRQSM__PING0_CMD_DONE (1 << 0)
+
+ uint32 hs_spiIntMask; // 0x0010
+#define HS_SPI_IRQM_PING1_USER (28)
+#define HS_SPI_IRQM_PING1_USER_MASK __mask(31, HS_SPI_IRQM_PING1_USER)
+#define HS_SPI_IRQM_PING0_USER (24)
+#define HS_SPI_IRQM_PING0_USER_MASK __mask(27, HS_SPI_IRQM_PING0_USER)
+
+#define HS_SPI_IRQM_PING1_CTRL_INV (1 << 12)
+#define HS_SPI_IRQM_PING1_POLL_TOUT (1 << 11)
+#define HS_SPI_IRQM_PING1_TX_UNDER (1 << 10)
+#define HS_SPI_IRQM_PING1_RX_OVER (1 << 9)
+#define HS_SPI_IRQM_PING1_CMD_DONE (1 << 8)
+
+#define HS_SPI_IRQM_PING0_CTRL_INV (1 << 4)
+#define HS_SPI_IRQM_PING0_POLL_TOUT (1 << 3)
+#define HS_SPI_IRQM_PING0_TX_UNDER (1 << 2)
+#define HS_SPI_IRQM_PING0_RX_OVER (1 << 1)
+#define HS_SPI_IRQM_PING0_CMD_DONE (1 << 0)
+
+#define HS_SPI_INTR_CLEAR_ALL (0xFF001F1F)
+
+ uint32 hs_spiFlashCtrl; // 0x0014
+#define HS_SPI_FCTRL_MB_ENABLE (1 << 23)
+#define HS_SPI_FCTRL_SS_NUM (20)
+#define HS_SPI_FCTRL_SS_NUM_MASK __mask(22, HS_SPI_FCTRL_SS_NUM)
+#define HS_SPI_FCTRL_PROFILE_NUM (16)
+#define HS_SPI_FCTRL_PROFILE_NUM_MASK __mask(18, HS_SPI_FCTRL_PROFILE_NUM)
+#define HS_SPI_FCTRL_DUMMY_BYTES (10)
+#define HS_SPI_FCTRL_DUMMY_BYTES_MASK __mask(11, HS_SPI_FCTRL_DUMMY_BYTES)
+#define HS_SPI_FCTRL_ADDR_BYTES (8)
+#define HS_SPI_FCTRL_ADDR_BYTES_MASK __mask(9, HS_SPI_FCTRL_ADDR_BYTES)
+#define HS_SPI_FCTRL_ADDR_BYTES_2 (0)
+#define HS_SPI_FCTRL_ADDR_BYTES_3 (1)
+#define HS_SPI_FCTRL_ADDR_BYTES_4 (2)
+#define HS_SPI_FCTRL_READ_OPCODE (0)
+#define HS_SPI_FCTRL_READ_OPCODE_MASK __mask(7, HS_SPI_FCTRL_READ_OPCODE)
+
+ uint32 hs_spiFlashAddrBase; // 0x0018
+
+ char fill0[0x80 - 0x18];
+
+ uint32 hs_spiPP_0_Cmd; // 0x0080
+#define HS_SPI_PP_SS_NUM (12)
+#define HS_SPI_PP_SS_NUM_MASK __mask(14, HS_SPI_PP_SS_NUM)
+#define HS_SPI_PP_PROFILE_NUM (8)
+#define HS_SPI_PP_PROFILE_NUM_MASK __mask(10, HS_SPI_PP_PROFILE_NUM)
+
+} HsSpiControl;
+
+typedef struct HsSpiPingPong {
+
+ uint32 command;
+#define HS_SPI_SS_NUM (12)
+#define HS_SPI_PROFILE_NUM (8)
+#define HS_SPI_TRIGGER_NUM (4)
+#define HS_SPI_COMMAND_VALUE (0)
+ #define HS_SPI_COMMAND_NOOP (0)
+ #define HS_SPI_COMMAND_START_NOW (1)
+ #define HS_SPI_COMMAND_START_TRIGGER (2)
+ #define HS_SPI_COMMAND_HALT (3)
+ #define HS_SPI_COMMAND_FLUSH (4)
+
+ uint32 status;
+#define HS_SPI_ERROR_BYTE_OFFSET (16)
+#define HS_SPI_WAIT_FOR_TRIGGER (2)
+#define HS_SPI_SOURCE_BUSY (1)
+#define HS_SPI_SOURCE_GNT (0)
+
+ uint32 fifo_status;
+ uint32 control;
+
+} HsSpiPingPong;
+
+typedef struct HsSpiProfile {
+
+ uint32 clk_ctrl;
+#define HS_SPI_ACCUM_RST_ON_LOOP (15)
+#define HS_SPI_SPI_CLK_2X_SEL (14)
+#define HS_SPI_FREQ_CTRL_WORD (0)
+
+ uint32 signal_ctrl;
+#define HS_SPI_LAUNCH_RISING (1 << 13)
+#define HS_SPI_LATCH_RISING (1 << 12)
+
+ uint32 mode_ctrl;
+#define HS_SPI_PREPENDBYTE_CNT (24)
+#define HS_SPI_MODE_ONE_WIRE (20)
+#define HS_SPI_MULTIDATA_WR_SIZE (18)
+#define HS_SPI_MULTIDATA_RD_SIZE (16)
+#define HS_SPI_MULTIDATA_WR_STRT (12)
+#define HS_SPI_MULTIDATA_RD_STRT (8)
+#define HS_SPI_FILLBYTE (0)
+
+ uint32 polling_config;
+ uint32 polling_and_mask;
+ uint32 polling_compare;
+ uint32 polling_timeout;
+ uint32 reserved;
+
+} HsSpiProfile;
+
+#define HS_SPI_OP_CODE 13
+ #define HS_SPI_OP_SLEEP (0)
+ #define HS_SPI_OP_READ_WRITE (1)
+ #define HS_SPI_OP_WRITE (2)
+ #define HS_SPI_OP_READ (3)
+ #define HS_SPI_OP_SETIRQ (4)
+
+#define HS_SPI ((volatile HsSpiControl * const) HSSPIM_BASE)
+#define HS_SPI_PINGPONG0 ((volatile HsSpiPingPong * const) (HSSPIM_BASE+0x80))
+#define HS_SPI_PINGPONG1 ((volatile HsSpiPingPong * const) (HSSPIM_BASE+0xc0))
+#define HS_SPI_PROFILES ((volatile HsSpiProfile * const) (HSSPIM_BASE+0x100))
+#define HS_SPI_FIFO0 ((volatile uint8 * const) (HSSPIM_BASE+0x200))
+#define HS_SPI_FIFO1 ((volatile uint8 * const) (HSSPIM_BASE+0x400))
+
+
+/*
+** Periph - Misc Register Set Definitions.
+*/
+
+typedef struct Misc {
+ uint32 miscMoCADiv ; /* (0x0) MoCA Ref PLL Div */
+#define MISC_MOCA_DIV_REF_DIV_FB_MASK 0xFF000000
+#define MISC_MOCA_DIV_REF_DIV_FB_SHIFT 24
+#define MISC_MOCA_DIV_REF_OUTDIV_M1_MASK 0x00FF0000
+#define MISC_MOCA_DIV_REF_OUTDIV_M1_SHIFT 16
+#define MISC_MOCA_DIV_REF_OUTDIV_M4_MASK 0x0000FF00
+#define MISC_MOCA_DIV_REF_OUTDIV_M4_SHIFT 8
+#define MISC_MOCA_DIV_REF_OUTDIV_M5_MASK 0x000000FF
+#define MISC_MOCA_DIV_REF_OUTDIV_M5_SHIFT 0
+ uint32 miscMoCACtl ; /* (0x4) MoCA Ref PLL Ctl */
+#define MISC_MOCA_CTL_REF_OUTCML_LOWCUR_MASK 0x001FC000
+#define MISC_MOCA_CTL_REF_OUTCML_LOWCUR_SHIFT 14
+#define MISC_MOCA_CTL_REF_CLFCNT_MASK 0x00003000
+#define MISC_MOCA_CTL_REF_CLFCNT_SHIFT 12
+#define MISC_MOCA_CTL_REF_QP_ICTRL_MASK 0x00000E00
+#define MISC_MOCA_CTL_REF_QP_ICTRL_SHIFT 9
+#define MISC_MOCA_CTL_REF_VCOBUF_LATCH_ON 0x00000100
+#define MISC_MOCA_CTL_REF_LF_RCNTL_MASK 0x000000E0
+#define MISC_MOCA_CTL_REF_LF_RCNTL_SHIFT 5
+#define MISC_MOCA_CTL_REF_MUX_FBOFF 0x00000010
+#define MISC_MOCA_CTL_REF_MUX_SEL_MASK 0x0000000C
+#define MISC_MOCA_CTL_REF_MUX_SEL_SHIFT 2
+#define MISC_MOCA_CTL_REF_REF_CMLBIAS_MASK 0x00000003
+#define MISC_MOCA_CTL_REF_REF_CMLBIAS_SHIFT 0
+ uint32 miscMoCAPwr ; /* (0x8) MoCA Ref PLL Pwr */
+#define MISC_MOCA_PWR_REF_DEEP_PWRDN 0x01000000
+#define MISC_MOCA_PWR_REF_OUTDIV_PWRDN_M_MASK 0x00FE0000
+#define MISC_MOCA_PWR_REF_OUTDIV_PWRDN_M_SHIFT 17
+#define MISC_MOCA_PWR_REF_OUTCML_PWRDN_M_MASK 0x0001FC00
+#define MISC_MOCA_PWR_REF_OUTCML_PWRDN_M_SHIFT 10
+#define MISC_MOCA_PWR_REF_OUTCMOS_PWRDN_M_MASK 0x000003F8
+#define MISC_MOCA_PWR_REF_OUTCMOS_PWRDN_M_SHIFT 3
+#define MISC_MOCA_PWR_REF_UGB_PWRDN 0x00000004
+#define MISC_MOCA_PWR_REF_MUX_PWRDN 0x00000002
+#define MISC_MOCA_PWR_REF_VCO_PWRDN 0x00000001
+ uint32 miscMoCARst ; /* (0xC) MoCA Ref PLL Rst */
+#define MISC_MOCA_RST_REF_OUTDIV_RESET_M_MASK 0x00000FE0
+#define MISC_MOCA_RST_REF_OUTDIV_RESET_M_SHIFT 5
+#define MISC_MOCA_RST_REF_DIV2RST 0x00000010
+#define MISC_MOCA_RST_REF_MDIV2RST 0x00000008
+#define MISC_MOCA_RST_REF_FBDIVRST 0x00000004
+#define MISC_MOCA_RST_REF_LD_RESET_STRT 0x00000002
+#define MISC_MOCA_RST_REF_VCRST 0x00000001
+ uint32 miscMemcControl ; /* (0x10) MEMC Control */
+#define MISC_MEMC_CONTROL_MC_UBUS_ASYNC_MODE 0x00000008
+#define MISC_MEMC_CONTROL_MC_LMB_ASYNC_MODE 0x00000004
+#define MISC_MEMC_CONTROL_DDR_TEST_DONE 0x00000002
+#define MISC_MEMC_CONTROL_DDR_TEST_DISABLE 0x00000001
+ uint32 miscStrapBus ; /* (0x14) Strap Register */
+#define MISC_STRAP_BUS_MIPS_PLL_FVCO_MASK 0xF8000000
+#define MISC_STRAP_BUS_MIPS_PLL_FVCO_SHIFT 27
+#define MISC_STRAP_BUS_HRD_RST_DELAY 0x04000000
+#define MISC_STRAP_BUS_ALT_BFC_EN 0x02000000
+#define MISC_STRAP_BUS_MOCA_STANDALONE_B 0x01000000
+#define MISC_STRAP_BUS_MOCA_CONFIG_RATIO 0x00800000
+#define MISC_STRAP_BUS_IXTAL_ADJ_MASK 0x00600000
+#define MISC_STRAP_BUS_IXTAL_ADJ_SHIFT 21
+#define MISC_STRAP_BUS_BYPASS_XTAL 0x00100000
+#define MISC_STRAP_BUS_TS 0x00080000
+#define MISC_STRAP_BUS_APM_PICO_BOOT_ROM 0x00040000
+#define MISC_STRAP_BUS_TA 0x00020000
+#define MISC_STRAP_BUS_ROBOSW_2_MODE_MASK 0x00018000
+#define MISC_STRAP_BUS_ROBOSW_2_MODE_SHIFT 15
+#define MISC_STRAP_BUS_ROBOSW_1_MODE_MASK 0x00006000
+#define MISC_STRAP_BUS_ROBOSW_1_MODE_SHIFT 13
+#define MISC_STRAP_BUS_BIST_CLRMEM_N 0x00001000
+#define MISC_STRAP_BUS_PLL_MIPS_WAIT_FAST_N 0x00000200
+#define MISC_STRAP_BUS_PLL_USE_LOCK 0x00000100
+#define MISC_STRAP_BUS_PCIE_ROOT_COMPLEX 0x00000080
+#define MISC_STRAP_BUS_LS_SPIM_ENABLED 0x00000040
+#define MISC_STRAP_BUS_USE_SPI_MASTER 0x00000020
+#define MISC_STRAP_BUS_SPI_CLK_FAST 0x00000010
+#define MISC_STRAP_BUS_SPI_BOOT_DELAY 0x00000008
+#define MISC_STRAP_BUS_MIPS_BOOT16 0x00000004
+#define MISC_STRAP_BUS_BOOT_SEL_MASK 0x00000003
+#define MISC_STRAP_BUS_BOOT_SEL_SHIFT 0
+#define MISC_STRAP_BUS_BOOT_PARALLEL 0x03
+#define MISC_STRAP_BUS_BOOT_SERIAL 0x01
+#define MISC_STRAP_BUS_BOOT_NAND 0x02
+ uint32 miscStrapOverride ; /* (0x18) Strap Override Reg */
+#define MISC_STRAP_OVERRIDE_INT_MPI_ARB 0x00000008
+#define MISC_STRAP_OVERRIDE_INT_MPI_CLK 0x00000004
+#define MISC_STRAP_OVERRIDE_INT_HOST 0x00000002
+#define MISC_STRAP_OVERRIDE_STRAP_OVERRIDE 0x00000001
+ uint32 miscMoCAClkStrapBus ; /* (0x1C) MoCA Clock Strap Reg */
+#define MISC_MOCA_CLK_STRAP_BUS_MDIV_10_OVERRIDE_MASK 0x0000FF00
+#define MISC_MOCA_CLK_STRAP_BUS_MDIV_10_OVERRIDE_SHIFT 8
+#define MISC_MOCA_CLK_STRAP_BUS_MDIV_9_OVERRIDE_MASK 0x000000FF
+#define MISC_MOCA_CLK_STRAP_BUS_MDIV_9_OVERRIDE_SHIFT 0
+ uint32 miscMoCAClkStrapOverride ; /* (0x20) MoCA Clock Strap Overdide Reg */
+#define MISC_MOCA_CLK_STRAP_OVERRIDE_MOCA_CLK_STRAP_OVERRIDE_CTL 0x00000001
+ uint32 miscMoCAGpioOverlayLo ; /* (0x24) MoCA GPIO Overlay bus lo Reg */
+ uint32 miscMoCAGpioOverlayHi ; /* (0x28) MoCA GPIO Overlay bus hi Reg */
+#define MISC_MOCA_GPIO_UART 0x000000C0
+ uint32 miscDdrPllOutEnCh ; /* (0x2C) DDR PLL Out En Ch Number */
+#define MISC_DDR_PLL_OUTEN_CH_DDR_PLL_OUTEN_CH_MASK 0x000001FF
+#define MISC_DDR_PLL_OUTEN_CH_DDR_PLL_OUTEN_CH_SHIFT 0
+#define MISC_DDR_PLL_OUTEN_CH_MOCA_CPU_CLK 0x00000080
+#define MISC_DDR_PLL_OUTEN_CH_MOCA_PHY_CLK 0x00000100
+ uint32 miscGpioDiagOverlay ; /* (0x30) GPIO Diag Overlay Control Reg */
+#define MISC_GPIO_DIAG_OVERLAY_DIAG_OVERLAY_EN 0x00000020
+#define MISC_GPIO_DIAG_OVERLAY_DIAG_OVERLAY_MASK 0x0000001F
+#define MISC_GPIO_DIAG_OVERLAY_DIAG_OVERLAY_PORT_39_32 0x00000010
+#define MISC_GPIO_DIAG_OVERLAY_DIAG_OVERLAY_PORT_31_24 0x00000008
+#define MISC_GPIO_DIAG_OVERLAY_DIAG_OVERLAY_PORT_23_16 0x00000004
+#define MISC_GPIO_DIAG_OVERLAY_DIAG_OVERLAY_PORT_15_8 0x00000002
+#define MISC_GPIO_DIAG_OVERLAY_DIAG_OVERLAY_PORT_7_0 0x00000001
+ uint32 miscGpioModeCtrlHi ; /* (0x34) GPIO Pin Mode Control Reg Hi */
+} Misc ;
+
+#define MISC ((volatile Misc * const) MISC_BASE)
+
+typedef struct HvgMiscRegisterChannelA {
+ uint32 mask;
+#define K_PROP 0x0000000f
+#define K_INTEG 0x000000f0
+#define SER_TST_OUTPUT_SEL 0x00000700
+#define CONT_OR_BLOCK 0x00000800
+#define HVG_MODE 0x00003000
+#define HVG_MODE_OFFHOOK_TRACKING 0x00001000
+#define HVG_MODE_ONHOOK_FIXED 0x00002000
+#define HVG_SOFT_INIT_0 0x00004000
+#define HVG_RR_SINGLE 0x00008000
+} HvgMiscRegisterChannelA;
+
+#define HVG_MISC_REG_CHANNEL_A ((volatile HvgMiscRegisterChannelA * const) APM_HVG_BASE_REG_15)
+
+typedef struct HvgMiscRegisterChannelB {
+ uint32 mask;
+} HvgMiscRegisterChannelB;
+
+#define HVG_MISC_REG_CHANNEL_B ((volatile HvgMiscRegisterChannelB * const) APM_HVG_BASE_REG_19)
+
+#define IUDMA_MAX_CHANNELS 32
+
+/*
+** DMA Channel Configuration (1 .. 32)
+*/
+typedef struct DmaChannelCfg {
+ uint32 cfg; /* (00) assorted configuration */
+#define DMA_ENABLE 0x00000001 /* set to enable channel */
+#define DMA_PKT_HALT 0x00000002 /* idle after an EOP flag is detected */
+#define DMA_BURST_HALT 0x00000004 /* idle after finish current memory burst */
+ uint32 intStat; /* (04) interrupts control and status */
+ uint32 intMask; /* (08) interrupts mask */
+#define DMA_BUFF_DONE 0x00000001 /* buffer done */
+#define DMA_DONE 0x00000002 /* packet xfer complete */
+#define DMA_NO_DESC 0x00000004 /* no valid descriptors */
+ uint32 maxBurst; /* (0C) max burst length permitted */
+#define DMA_DESCSIZE_SEL 0x00040000 /* DMA Descriptor Size Selection */
+} DmaChannelCfg;
+
+/*
+** DMA State RAM (1 .. 16)
+*/
+typedef struct DmaStateRam {
+ uint32 baseDescPtr; /* (00) descriptor ring start address */
+ uint32 state_data; /* (04) state/bytes done/ring offset */
+ uint32 desc_len_status; /* (08) buffer descriptor status and len */
+ uint32 desc_base_bufptr; /* (0C) buffer descrpitor current processing */
+} DmaStateRam;
+
+
+/*
+** DMA Registers
+*/
+typedef struct DmaRegs {
+ uint32 controller_cfg; /* (00) controller configuration */
+#define DMA_MASTER_EN 0x00000001
+#define DMA_FLOWC_CH1_EN 0x00000002
+#define DMA_FLOWC_CH3_EN 0x00000004
+
+ // Flow control Ch1
+ uint32 flowctl_ch1_thresh_lo; /* 004 */
+ uint32 flowctl_ch1_thresh_hi; /* 008 */
+ uint32 flowctl_ch1_alloc; /* 00c */
+#define DMA_BUF_ALLOC_FORCE 0x80000000
+
+ // Flow control Ch3
+ uint32 flowctl_ch3_thresh_lo; /* 010 */
+ uint32 flowctl_ch3_thresh_hi; /* 014 */
+ uint32 flowctl_ch3_alloc; /* 018 */
+
+ // Flow control Ch5
+ uint32 flowctl_ch5_thresh_lo; /* 01C */
+ uint32 flowctl_ch5_thresh_hi; /* 020 */
+ uint32 flowctl_ch5_alloc; /* 024 */
+
+ // Flow control Ch7
+ uint32 flowctl_ch7_thresh_lo; /* 028 */
+ uint32 flowctl_ch7_thresh_hi; /* 02C */
+ uint32 flowctl_ch7_alloc; /* 030 */
+
+ uint32 ctrl_channel_reset; /* 034 */
+ uint32 ctrl_channel_debug; /* 038 */
+ uint32 reserved1; /* 03C */
+ uint32 ctrl_global_interrupt_status; /* 040 */
+ uint32 ctrl_global_interrupt_mask; /* 044 */
+
+ // Unused words
+ uint8 reserved2[0x200-0x48];
+
+ // Per channel registers/state ram
+ DmaChannelCfg chcfg[IUDMA_MAX_CHANNELS];/* (200-3FF) Channel configuration */
+ union {
+ DmaStateRam s[IUDMA_MAX_CHANNELS];
+ uint32 u32[4 * IUDMA_MAX_CHANNELS];
+ } stram; /* (400-5FF) state ram */
+} DmaRegs;
+
+#define SW_DMA ((volatile DmaRegs * const) SWITCH_DMA_BASE)
+
+/*
+** DMA Buffer
+*/
+typedef struct DmaDesc {
+ union {
+ struct {
+ uint16 length; /* in bytes of data in buffer */
+#define DMA_DESC_USEFPM 0x8000
+#define DMA_DESC_MULTICAST 0x4000
+#define DMA_DESC_BUFLENGTH 0x0fff
+ uint16 status; /* buffer status */
+#define DMA_OWN 0x8000 /* cleared by DMA, set by SW */
+#define DMA_EOP 0x4000 /* last buffer in packet */
+#define DMA_SOP 0x2000 /* first buffer in packet */
+#define DMA_WRAP 0x1000 /* */
+#define DMA_PRIO 0x0C00 /* Prio for Tx */
+#define DMA_APPEND_BRCM_TAG 0x0200
+#define DMA_APPEND_CRC 0x0100
+#define USB_ZERO_PKT (1<< 0) // Set to send zero length packet
+ };
+ uint32 word0;
+ };
+
+ uint32 address; /* address of data */
+} DmaDesc;
+
+/*
+** 16 Byte DMA Buffer
+*/
+typedef struct {
+ union {
+ struct {
+ uint16 length; /* in bytes of data in buffer */
+#define DMA_DESC_USEFPM 0x8000
+#define DMA_DESC_MULTICAST 0x4000
+#define DMA_DESC_BUFLENGTH 0x0fff
+ uint16 status; /* buffer status */
+#define DMA_OWN 0x8000 /* cleared by DMA, set by SW */
+#define DMA_EOP 0x4000 /* last buffer in packet */
+#define DMA_SOP 0x2000 /* first buffer in packet */
+#define DMA_WRAP 0x1000 /* */
+#define DMA_PRIO 0x0C00 /* Prio for Tx */
+#define DMA_APPEND_BRCM_TAG 0x0200
+#define DMA_APPEND_CRC 0x0100
+#define USB_ZERO_PKT (1<< 0) // Set to send zero length packet
+ };
+ uint32 word0;
+ };
+
+ uint32 address; /* address of data */
+ uint32 control;
+#define GEM_ID_MASK 0x001F
+ uint32 reserved;
+} DmaDesc16;
+
+/*
+** External Bus Interface
+*/
+typedef struct EbiChipSelect {
+ uint32 base; /* base address in upper 24 bits */
+#define EBI_SIZE_8K 0
+#define EBI_SIZE_16K 1
+#define EBI_SIZE_32K 2
+#define EBI_SIZE_64K 3
+#define EBI_SIZE_128K 4
+#define EBI_SIZE_256K 5
+#define EBI_SIZE_512K 6
+#define EBI_SIZE_1M 7
+#define EBI_SIZE_2M 8
+#define EBI_SIZE_4M 9
+#define EBI_SIZE_8M 10
+#define EBI_SIZE_16M 11
+#define EBI_SIZE_32M 12
+#define EBI_SIZE_64M 13
+#define EBI_SIZE_128M 14
+#define EBI_SIZE_256M 15
+ uint32 config;
+#define EBI_ENABLE 0x00000001 /* .. enable this range */
+#define EBI_WAIT_STATES 0x0000000e /* .. mask for wait states */
+#define EBI_WTST_SHIFT 1 /* .. for shifting wait states */
+#define EBI_WORD_WIDE 0x00000010 /* .. 16-bit peripheral, else 8 */
+#define EBI_WREN 0x00000020 /* enable posted writes */
+#define EBI_POLARITY 0x00000040 /* .. set to invert something,
+ ** don't know what yet */
+#define EBI_TS_TA_MODE 0x00000080 /* .. use TS/TA mode */
+#define EBI_TS_SEL 0x00000100 /* .. drive tsize, not bs_b */
+#define EBI_FIFO 0x00000200 /* .. use fifo */
+#define EBI_RE 0x00000400 /* .. Reverse Endian */
+#define EBI_SETUP_SHIFT 16
+#define EBI_HOLD_SHIFT 20
+#define EBI_SETUP_STATES 0x0f0000
+#define EBI_HOLD_STATES 0xf00000
+} EbiChipSelect;
+
+typedef struct MpiRegisters {
+ EbiChipSelect cs[7]; /* size chip select configuration */
+#define EBI_CS0_BASE 0
+#define EBI_CS1_BASE 1
+#define EBI_CS2_BASE 2
+#define EBI_CS3_BASE 3
+#define EBI_CS4_BASE 4
+#define EBI_CS5_BASE 5
+#define EBI_CS6_BASE 6
+ uint32 unused0[2]; /* reserved */
+ uint32 ebi_control; /* ebi control */
+#define EBI_ACCESS_TIMEOUT 0x000007FF
+ uint32 unused1[7]; /* reserved */
+
+ uint32 sp0range; /* PCI to internal system bus address space */
+#define ADDR_SPACE_MASK 0xFFFF0000
+ uint32 sp0remap;
+ uint32 sp0cfg;
+ uint32 sp1range;
+ uint32 sp1remap;
+ uint32 sp1cfg;
+
+ uint32 EndianCfg;
+
+ uint32 l2pcfgctl; /* internal system bus to PCI IO/Cfg control */
+#define DIR_CFG_SEL 0x80000000 /* change from PCI I/O access to PCI config access */
+#define DIR_CFG_USEREG 0x40000000 /* use this register info for PCI configuration access */
+#define DEVICE_NUMBER 0x00007C00 /* device number for the PCI configuration access */
+#define FUNC_NUMBER 0x00000300 /* function number for the PCI configuration access */
+#define REG_NUMBER 0x000000FC /* register number for the PCI configuration access */
+#define CONFIG_TYPE 0x00000003 /* configuration type for the PCI configuration access */
+
+ uint32 l2pmrange1; /* internal system bus to PCI memory space */
+#define PCI_SIZE_64K 0xFFFF0000
+#define PCI_SIZE_128K 0xFFFE0000
+#define PCI_SIZE_256K 0xFFFC0000
+#define PCI_SIZE_512K 0xFFF80000
+#define PCI_SIZE_1M 0xFFF00000
+#define PCI_SIZE_2M 0xFFE00000
+#define PCI_SIZE_4M 0xFFC00000
+#define PCI_SIZE_8M 0xFF800000
+#define PCI_SIZE_16M 0xFF000000
+#define PCI_SIZE_32M 0xFE000000
+ uint32 l2pmbase1; /* kseg0 or kseg1 address & 0x1FFFFFFF */
+ uint32 l2pmremap1;
+#define CARDBUS_MEM 0x00000004
+#define MEM_WINDOW_EN 0x00000001
+ uint32 l2pmrange2;
+ uint32 l2pmbase2;
+ uint32 l2pmremap2;
+ uint32 l2piorange; /* internal system bus to PCI I/O space */
+ uint32 l2piobase;
+ uint32 l2pioremap;
+
+ uint32 pcimodesel;
+#define PCI_INT_BUS_RD_PREFETCH 0x000001F0
+#define PCI_BAR2_NOSWAP 0x00000002 /* BAR at offset 0x20 */
+#define PCI_BAR1_NOSWAP 0x00000001 /* BAR at affset 0x1c */
+
+ uint32 pciintstat; /* PCI interrupt mask/status */
+#define MAILBOX1_SENT 0x08
+#define MAILBOX0_SENT 0x04
+#define MAILBOX1_MSG_RCV 0x02
+#define MAILBOX0_MSG_RCV 0x01
+ uint32 locbuscntrl; /* internal system bus control */
+#define DIR_U2P_NOSWAP 0x00000002
+#define EN_PCI_GPIO 0x00000001
+ uint32 locintstat; /* internal system bus interrupt mask/status */
+#define CSERR 0x0200
+#define SERR 0x0100
+#define EXT_PCI_INT 0x0080
+#define DIR_FAILED 0x0040
+#define DIR_COMPLETE 0x0020
+#define PCI_CFG 0x0010
+ uint32 unused4[7];
+
+ uint32 mailbox0;
+ uint32 mailbox1;
+
+ uint32 pcicfgcntrl; /* internal system bus PCI configuration control */
+#define PCI_CFG_REG_WRITE_EN 0x00000080
+#define PCI_CFG_ADDR 0x0000003C
+ uint32 pcicfgdata; /* internal system bus PCI configuration data */
+
+ uint32 locch2ctl; /* PCI to interrnal system bus DMA (downstream) local control */
+#define MPI_DMA_HALT 0x00000008 /* idle after finish current memory burst */
+#define MPI_DMA_PKT_HALT 0x00000004 /* idle after an EOP flag is detected */
+#define MPI_DMA_STALL 0x00000002 /* idle after an EOP flag is detected */
+#define MPI_DMA_ENABLE 0x00000001 /* set to enable channel */
+ uint32 locch2intStat;
+#define MPI_DMA_NO_DESC 0x00000004 /* no valid descriptors */
+#define MPI_DMA_DONE 0x00000002 /* packet xfer complete */
+#define MPI_DMA_BUFF_DONE 0x00000001 /* buffer done */
+ uint32 locch2intMask;
+ uint32 unused5;
+ uint32 locch2descaddr;
+ uint32 locch2status1;
+#define LOCAL_DESC_STATE 0xE0000000
+#define PCI_DESC_STATE 0x1C000000
+#define BYTE_DONE 0x03FFC000
+#define RING_ADDR 0x00003FFF
+ uint32 locch2status2;
+#define BUFPTR_OFFSET 0x1FFF0000
+#define PCI_MASTER_STATE 0x000000C0
+#define LOC_MASTER_STATE 0x00000038
+#define CONTROL_STATE 0x00000007
+ uint32 unused6;
+
+ uint32 locch1Ctl; /*internal system bus to PCI DMA (upstream) local control */
+#define DMA_U2P_LE 0x00000200 /* local bus is little endian */
+#define DMA_U2P_NOSWAP 0x00000100 /* lccal bus is little endian but no data swapped */
+ uint32 locch1intstat;
+ uint32 locch1intmask;
+ uint32 unused7;
+ uint32 locch1descaddr;
+ uint32 locch1status1;
+ uint32 locch1status2;
+ uint32 unused8;
+
+ uint32 pcich1ctl; /* internal system bus to PCI DMA PCI control */
+ uint32 pcich1intstat;
+ uint32 pcich1intmask;
+ uint32 pcich1descaddr;
+ uint32 pcich1status1;
+ uint32 pcich1status2;
+
+ uint32 pcich2Ctl; /* PCI to internal system bus DMA PCI control */
+ uint32 pcich2intstat;
+ uint32 pcich2intmask;
+ uint32 pcich2descaddr;
+ uint32 pcich2status1;
+ uint32 pcich2status2;
+
+ uint32 perm_id; /* permanent device and vendor id */
+ uint32 perm_rev; /* permanent revision id */
+} MpiRegisters;
+
+#define MPI ((volatile MpiRegisters * const) MPI_BASE)
+
+/* PCI configuration address space start offset 0x40 */
+#define BRCM_PCI_CONFIG_TIMER 0x40
+#define BRCM_PCI_CONFIG_TIMER_RETRY_MASK 0x0000FF00
+#define BRCM_PCI_CONFIG_TIMER_TRDY_MASK 0x000000FF
+
+typedef struct USBControl {
+ uint32 BrtControl1;
+ uint32 BrtControl2;
+ uint32 BrtStatus1;
+ uint32 BrtStatus2;
+ uint32 UTMIControl1;
+ uint32 TestPortControl;
+ uint32 PllControl1;
+ uint32 SwapControl;
+#define USB_DEVICE_SEL (1<<6)
+#define EHCI_LOGICAL_ADDRESS_EN (1<<5)
+#define EHCI_ENDIAN_SWAP (1<<4)
+#define EHCI_DATA_SWAP (1<<3)
+#define OHCI_LOGICAL_ADDRESS_EN (1<<2)
+#define OHCI_ENDIAN_SWAP (1<<1)
+#define OHCI_DATA_SWAP (1<<0)
+ uint32 unused1;
+ uint32 FrameAdjustValue;
+ uint32 Setup;
+#define USBH_IOC (1<<4)
+ uint32 MDIO;
+ uint32 MDIO32;
+ uint32 USBSimControl;
+} USBControl;
+
+#define USBH ((volatile USBControl * const) USBH_CFG_BASE)
+
+/*
+** GPON SERDES Registers
+*/
+typedef struct GponSerdesRegs {
+ uint32 topCfg;
+ uint32 swReset;
+ uint32 aeCfg;
+ uint32 aeStatus;
+ uint32 phyCfg;
+ uint32 phyStatus;
+ uint32 mdioWr;
+ uint32 mdioRd;
+ uint32 reserved[2];
+ uint32 fifoCfg;
+ uint32 fifoStatus;
+ uint32 patternCfg[4];
+ uint32 patternStatus[2];
+ uint32 laserCfg;
+#define GPON_SERDES_LASERMODE_MASK (3<<30)
+#define GPON_SERDES_LASERMODE_NORMAL (0<<30)
+#define GPON_SERDES_LASERMODE_FORCE_OFF (1<<30)
+#define GPON_SERDES_LASERMODE_FORCE_ON (2<<30)
+ uint32 laserStatus;
+ uint32 miscCfg;
+ uint32 miscStatus;
+ uint32 phDet[5];
+} GponSerdesRegs;
+
+#define GPON_SERDES ((volatile GponSerdesRegs * const) GPON_SERDES_BASE)
+
+
+/*
+** PCI-E
+*/
+typedef struct PcieRegs{
+ uint32 devVenID;
+ uint16 command;
+ uint16 status;
+ uint32 revIdClassCode;
+ uint32 headerTypeLatCacheLineSize;
+ uint32 bar1;
+ uint32 bar2;
+ uint32 priSecBusNo;
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SUB_BUS_NO_MASK 0x00ff0000
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SUB_BUS_NO_SHIFT 16
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SEC_BUS_NO_MASK 0x0000ff00
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_SEC_BUS_NO_SHIFT 8
+#define PCIE_CFG_TYPE1_PRI_SEC_BUS_NO_PRI_BUS_NO_MASK 0x000000ff
+} PcieRegs;
+
+typedef struct PcieBlk404Regs{
+ uint32 unused; /* 0x404 */
+ uint32 config2; /* 0x408 */
+#define PCIE_IP_BLK404_CONFIG_2_BAR1_SIZE_MASK 0x0000000f
+#define PCIE_IP_BLK404_CONFIG_2_BAR1_DISABLE 0
+ uint32 config3; /* 0x40c */
+ uint32 pmDataA; /* 0x410 */
+ uint32 pmDataB; /* 0x414 */
+} PcieBlk404Regs;
+
+typedef struct PcieBlk428Regs{
+ uint32 vpdIntf; /* 0x428 */
+ uint16 unused_g; /* 0x42c */
+ uint16 vpdAddrFlag; /* 0x42e */
+ uint32 vpdData; /* 0x430 */
+ uint32 idVal1; /* 0x434 */
+ uint32 idVal2; /* 0x438 */
+ uint32 idVal3; /* 0x43c */
+#define PCIE_IP_BLK428_ID_VAL3_REVISION_ID_MASK 0xff000000
+#define PCIE_IP_BLK428_ID_VAL3_REVISION_ID_SHIFT 24
+#define PCIE_IP_BLK428_ID_VAL3_CLASS_CODE_MASK 0x00ffffff
+#define PCIE_IP_BLK428_ID_VAL3_CLASS_CODE_SHIFT 16
+#define PCIE_IP_BLK428_ID_VAL3_SUB_CLASS_CODE_SHIFT 8
+}PcieBlk428Regs;
+
+typedef struct PcieBridgeRegs{
+ uint32 bar1Remap; /* 0x0818*/
+ uint32 bar2Remap; /* 0x081c*/
+ uint32 bridgeOptReg1; /* 0x0820*/
+#define PCIE_BRIDGE_OPT_REG1_EN_RD_BE (1 << 4)
+#define PCIE_BRIDGE_OPT_REG1_EN_RD_BE_NOSWAP (1 << 5)
+ uint32 bridgeOptReg2; /* 0x0824*/
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_func_no_MASK 0xe0000000
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_func_no_SHIFT 29
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_dev_no_MASK 0x1f000000
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_dev_no_SHIFT 24
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bus_no_MASK 0x00ff0000
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bus_no_SHIFT 16
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bd_sel_MASK 0x00000080
+#define PCIE_BRIDGE_OPT_REG2_cfg_type1_bd_sel_SHIFT 7
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_timeout_MASK 0x00000040
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_timeout_SHIFT 6
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_abort_MASK 0x00000020
+#define PCIE_BRIDGE_OPT_REG2_dis_pcie_abort_SHIFT 5
+#define PCIE_BRIDGE_OPT_REG2_enable_tx_crd_chk_MASK 0x00000010
+#define PCIE_BRIDGE_OPT_REG2_enable_tx_crd_chk_SHIFT 4
+#define PCIE_BRIDGE_OPT_REG2_dis_ubus_ur_decode_MASK 0x00000004
+#define PCIE_BRIDGE_OPT_REG2_dis_ubus_ur_decode_SHIFT 2
+#define PCIE_BRIDGE_OPT_REG2_cfg_reserved_MASK 0x0000ff0b
+}PcieBridgeRegs;
+
+typedef struct PcieBlk1000Regs{
+ uint32 undisclosed[18]; /*0x1000 - 0x1044*/
+ uint32 dlStatus; /* 0x1048 */
+#define PCIE_IP_BLK1000_DL_STATUS_PHYLINKUP_MASK 0x00002000
+#define PCIE_IP_BLK1000_DL_STATUS_PHYLINKUP_SHIFT 13
+}PcieBlk1000Regs;
+
+typedef struct PcieBlk1800Regs{
+#define NUM_PCIE_BLK_1800_PHY_CTRL_REGS 4
+ uint32 phyCtrl[NUM_PCIE_BLK_1800_PHY_CTRL_REGS];
+#define REG_POWERDOWN_P1PLL_ENA (1<<12)
+ uint32 phyErrorAttnVec;
+ uint32 phyErrorAttnMask;
+#define NUM_PCIE_BLK_1800_PHY_LTSSM_HIST_REGS 3
+ uint32 phyltssmHist[NUM_PCIE_BLK_1800_PHY_LTSSM_HIST_REGS];
+#define NUM_PCIE_BLK_1800_PHY_DBG_REGS 11
+ uint32 phyDbg[NUM_PCIE_BLK_1800_PHY_DBG_REGS];
+} PcieBlk1800Regs;
+
+#define PCIEH_DEV_OFFSET 0x8000
+#define PCIEH ((volatile uint32 * const) PCIE_BASE)
+#define PCIEH_REGS ((volatile PcieCfeType1Regs * const) PCIE_BASE)
+#define PCIEH_BLK_404_REGS ((volatile PcieBlk404Regs * const)(PCIE_BASE+0x404))
+#define PCIEH_BLK_428_REGS ((volatile PcieBlk428Regs * const)(PCIE_BASE+0x428))
+#define PCIEH_BRIDGE_REGS ((volatile PcieBridgeRegs * const) (PCIE_BASE+0x818))
+#define PCIEH_BLK_1000_REGS ((volatile PcieBlk1000Regs * const) (PCIE_BASE+0x1000))
+#define PCIEH_BLK_1800_REGS ((volatile PcieBlk1800Regs * const) (PCIE_BASE+0x1800))
+
+/*
+** NAND Controller Registers
+*/
+typedef struct NandCtrlRegs {
+ uint32 NandRevision; /* NAND Revision */
+ uint32 NandCmdStart; /* Nand Flash Command Start */
+ uint32 NandCmdExtAddr; /* Nand Flash Command Extended Address */
+ uint32 NandCmdAddr; /* Nand Flash Command Address */
+ uint32 NandCmdEndAddr; /* Nand Flash Command End Address */
+ uint32 NandNandBootConfig; /* Nand Flash Boot Config */
+#define NBC_AUTO_DEV_ID_CFG 0x40000000
+ uint32 NandCsNandXor; /* Nand Flash EBI CS Address XOR with */
+} NandCtrlRegs;
+
+#define NAND ((volatile NandCtrlRegs * const) NAND_REG_BASE)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/shared/opensource/include/bcm963xx/bcmSpi.h b/shared/opensource/include/bcm963xx/bcmSpi.h
new file mode 100755
index 0000000..dfbfb4f
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/bcmSpi.h
@@ -0,0 +1,55 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+#ifndef __BCM_SPI_H__
+#define __BCM_SPI_H__
+
+#ifndef _CFE_
+#include <linux/autoconf.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/spi/spi.h>
+
+struct bcmspi
+{
+ spinlock_t lock;
+ char * devName;
+ int irq;
+ unsigned bus_num;
+ unsigned num_chipselect;
+ u8 stopping;
+ struct list_head queue;
+ struct platform_device *pdev;
+ struct spi_transfer *curTrans;
+};
+#endif
+
+#define BCM_SPI_READ 0
+#define BCM_SPI_WRITE 1
+#define BCM_SPI_FULL 2
+
+#endif /* __BCM_SPI_H__ */
+
diff --git a/shared/opensource/include/bcm963xx/bcmSpiRes.h b/shared/opensource/include/bcm963xx/bcmSpiRes.h
new file mode 100755
index 0000000..cb39756
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/bcmSpiRes.h
@@ -0,0 +1,101 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+#ifndef __BCMSPIRES_H__
+#define __BCMSPIRES_H__
+
+#ifndef _CFE_
+#include <linux/spi/spi.h>
+#endif
+
+#define SPI_STATUS_OK (0)
+#define SPI_STATUS_INVALID_LEN (-1)
+#define SPI_STATUS_ERR (-2)
+
+/* legacy and HS controllers can coexist - use bus num to differentiate */
+#define LEG_SPI_BUS_NUM 0
+#define HS_SPI_BUS_NUM 1
+
+#define LEG_SPI_CLOCK_DEF 2
+
+#if defined(_BCM96816_) || defined(CONFIG_BCM96816) || defined(_BCM96362_) || defined(CONFIG_BCM96362)
+#define HS_SPI_PLL_FREQ 400000000
+#else
+#define HS_SPI_PLL_FREQ 133333333
+#endif
+#define HS_SPI_CLOCK_DEF 40000000
+#define HS_SPI_BUFFER_LEN 512
+
+/* used to specify ctrlState for the interface BcmSpiReserveSlave2
+ SPI_CONTROLLER_STATE_SET is used to differentiate a value of 0 which results in
+ the controller using default values and the case where CPHA_EXT, GATE_CLK_SSOFF,
+ CLK_POLARITY, and ASYNC_CLOCK all need to be 0
+
+ SPI MODE sets the values for CPOL and CPHA
+ SPI_CONTROLLER_STATE_CPHA_EXT will extend these modes
+CPOL = 0 -> base value of clock is 0
+CPHA = 0, CPHA_EXT = 0 -> latch data on rising edge, launch data on falling edge
+CPHA = 1, CPHA_EXT = 0 -> latch data on falling edge, launch data on rising edge
+CPHA = 0, CPHA_EXT = 1 -> latch data on rising edge, launch data on rising edge
+CPHA = 1, CPHA_EXT = 1 -> latch data on falling edge, launch data on falling edge
+
+CPOL = 1 -> base value of clock is 1
+CPHA = 0, CPHA_EXT = 0 -> latch data on falling edge, launch data on rising edge
+CPHA = 1, CPHA_EXT = 0 -> latch data on rising edge, launch data on falling edge
+CPHA = 0, CPHA_EXT = 1 -> latch data on falling edge, launch data on falling edge
+CPHA = 1, CPHA_EXT = 1 -> latch data on rising edge, launch data on rising edge
+*/
+#define SPI_CONTROLLER_STATE_SET (1 << 31)
+#define SPI_CONTROLLER_STATE_CPHA_EXT (1 << 30)
+#define SPI_CONTROLLER_STATE_GATE_CLK_SSOFF (1 << 29)
+#define SPI_CONTROLLER_STATE_CLK_POLARITY (1 << 28)
+#define SPI_CONTROLLER_STATE_ASYNC_CLOCK (1 << 27)
+
+/* set mode and controller state based on CHIP defaults
+ these values do not matter for the legacy controller */
+#if defined(CONFIG_BCM96816)
+#define SPI_MODE_DEFAULT SPI_MODE_1
+#define SPI_CONTROLLER_STATE_DEFAULT (SPI_CONTROLLER_STATE_GATE_CLK_SSOFF | SPI_CONTROLLER_STATE_CPHA_EXT)
+#elif (defined(CONFIG_BCM96362) || defined(CONFIG_BCM96328))
+#define SPI_MODE_DEFAULT SPI_MODE_0
+#define SPI_CONTROLLER_STATE_DEFAULT (SPI_CONTROLLER_STATE_GATE_CLK_SSOFF)
+#else
+#define SPI_MODE_DEFAULT SPI_MODE_3
+#define SPI_CONTROLLER_STATE_DEFAULT (0)
+#endif
+
+#ifndef _CFE_
+int BcmSpiReserveSlave(int busNum, int slaveId, int maxFreq);
+int BcmSpiReserveSlave2(int busNum, int slaveId, int maxFreq, int mode, int ctrlState);
+int BcmSpiReleaseSlave(int busNum, int slaveId);
+int BcmSpiSyncTrans(unsigned char *txBuf, unsigned char *rxBuf, int prependcnt, int nbytes, int busNum, int slaveId);
+#endif
+
+int BcmSpi_SetFlashCtrl( int, int, int, int, int );
+int BcmSpi_GetMaxRWSize( int );
+int BcmSpi_Read(unsigned char *, int, int, int, int, int);
+int BcmSpi_Write(unsigned char *, int, int, int, int);
+
+#endif /* __BCMSPIRES_H__ */
+
diff --git a/shared/opensource/include/bcm963xx/bcmTag.h b/shared/opensource/include/bcm963xx/bcmTag.h
new file mode 100755
index 0000000..8a1ca24
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/bcmTag.h
@@ -0,0 +1,175 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+//**************************************************************************************
+// File Name : bcmTag.h
+//
+// Description: add tag with validation system to the firmware image file to be uploaded
+// via http
+//
+// Created : 02/28/2002 seanl
+//**************************************************************************************
+
+#ifndef _BCMTAG_H_
+#define _BCMTAG_H_
+
+
+#define BCM_SIG_1 "Broadcom Corporation"
+#define BCM_SIG_2 "ver. 2.0" // was "firmware version 2.0" now it is split 6 char out for chip id.
+
+#define BCM_TAG_VER "6"
+
+// file tag (head) structure all is in clear text except validationTokens (crc, md5, sha1, etc). Total: 128 unsigned chars
+#define TAG_LEN 256
+#define TAG_VER_LEN 4
+#define SIG_LEN 20
+#define SIG_LEN_2 14 // Original second SIG = 20 is now devided into 14 for SIG_LEN_2 and 6 for CHIP_ID
+#define CHIP_ID_LEN 6
+#define IMAGE_LEN 10
+#define ADDRESS_LEN 12
+#define FLAG_LEN 2
+#define TOKEN_LEN 20
+#define BOARD_ID_LEN 16
+#define RESERVED_LEN (TAG_LEN - TAG_VER_LEN - SIG_LEN - SIG_LEN_2 - CHIP_ID_LEN - BOARD_ID_LEN - \
+ (4*IMAGE_LEN) - (3*ADDRESS_LEN) - (3*FLAG_LEN) - (2*TOKEN_LEN))
+
+
+// TAG for downloadable image (kernel plus file system)
+typedef struct _FILE_TAG
+{
+ char tagVersion[TAG_VER_LEN]; // tag version. Will be 2 here.
+ char signiture_1[SIG_LEN]; // text line for company info
+ char signiture_2[SIG_LEN_2]; // additional info (can be version number)
+ char chipId[CHIP_ID_LEN]; // chip id
+ char boardId[BOARD_ID_LEN]; // board id
+ char bigEndian[FLAG_LEN]; // if = 1 - big, = 0 - little endia of the host
+ char totalImageLen[IMAGE_LEN]; // the sum of all the following length
+ char cfeAddress[ADDRESS_LEN]; // if non zero, cfe starting address
+ char cfeLen[IMAGE_LEN]; // if non zero, cfe size in clear ASCII text.
+ char rootfsAddress[ADDRESS_LEN]; // if non zero, filesystem starting address
+ char rootfsLen[IMAGE_LEN]; // if non zero, filesystem size in clear ASCII text.
+ char kernelAddress[ADDRESS_LEN]; // if non zero, kernel starting address
+ char kernelLen[IMAGE_LEN]; // if non zero, kernel size in clear ASCII text.
+ char imageSequence[FLAG_LEN * 2]; // incrments everytime an image is flashed
+ char reserved[RESERVED_LEN]; // reserved for later use
+ char imageValidationToken[TOKEN_LEN];// image validation token - can be crc, md5, sha; for
+ // now will be 4 unsigned char crc
+ char tagValidationToken[TOKEN_LEN]; // validation token for tag(from signiture_1 to end of // mageValidationToken)
+} FILE_TAG, *PFILE_TAG;
+
+/* Whole flash image TAG definitions. */
+#define WFI_VERSION 0x00005731
+#define WFI_ANY_VERS_MASK 0x0000ff00
+#define WFI_ANY_VERS 0x00005700
+#define WFI_NOR_FLASH 1
+#define WFI_NAND16_FLASH 2
+#define WFI_NAND128_FLASH 3
+
+/* TAG at end of whole flash ".w" image. Size must be TOKEN_LEN. */
+typedef struct _WFI_TAG
+{
+ unsigned long wfiCrc;
+ unsigned long wfiVersion;
+ unsigned long wfiChipId;
+ unsigned long wfiFlashType;
+ unsigned long wfiReserved;
+} WFI_TAG, *PWFI_TAG;
+
+#define CRC32_INIT_VALUE 0xffffffff /* Initial CRC32 checksum value */
+#define CRC_LEN 4
+
+// only included if for bcmTag.exe program
+#ifdef BCMTAG_EXE_USE
+
+static unsigned long Crc32_table[256] = {
+ 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
+ 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
+ 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
+ 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
+ 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
+ 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
+ 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
+ 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
+ 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
+ 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
+ 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,
+ 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
+ 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,
+ 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
+ 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
+ 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
+ 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,
+ 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
+ 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,
+ 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
+ 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
+ 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
+ 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,
+ 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
+ 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
+ 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
+ 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
+ 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
+ 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,
+ 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
+ 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,
+ 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
+ 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
+ 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
+ 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
+ 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
+ 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,
+ 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
+ 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
+ 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
+ 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,
+ 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
+ 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,
+ 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
+ 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
+ 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
+ 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,
+ 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
+ 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
+ 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
+ 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
+ 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
+ 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,
+ 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
+ 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
+ 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
+ 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
+ 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
+ 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,
+ 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
+ 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,
+ 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
+ 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
+ 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
+};
+#endif // BCMTAG_USE
+
+
+#endif // _BCMTAG_H_
+
diff --git a/shared/opensource/include/bcm963xx/bcm_hwdefs.h b/shared/opensource/include/bcm963xx/bcm_hwdefs.h
new file mode 100755
index 0000000..07ecc29
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/bcm_hwdefs.h
@@ -0,0 +1,193 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the “GPL?, available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+/***********************************************************************/
+/* */
+/* MODULE: bcm_hwdefs.h */
+/* PURPOSE: Define all base device addresses and HW specific macros. */
+/* */
+/***********************************************************************/
+#ifndef _BCM_HWDEFS_H
+#define _BCM_HWDEFS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define DYING_GASP_API
+
+/*****************************************************************************/
+/* Physical Memory Map */
+/*****************************************************************************/
+
+#define PHYS_DRAM_BASE 0x00000000 /* Dynamic RAM Base */
+#if defined(CONFIG_BRCM_IKOS)
+#define PHYS_FLASH_BASE 0x18000000 /* Flash Memory */
+#else
+#define PHYS_FLASH_BASE 0x1FC00000 /* Flash Memory */
+#endif
+
+/*****************************************************************************/
+/* Note that the addresses above are physical addresses and that programs */
+/* have to use converted addresses defined below: */
+/*****************************************************************************/
+#define DRAM_BASE (0x80000000 | PHYS_DRAM_BASE) /* cached DRAM */
+#define DRAM_BASE_NOCACHE (0xA0000000 | PHYS_DRAM_BASE) /* uncached DRAM */
+
+/* Binary images are always built for a standard MIPS boot address */
+#define IMAGE_BASE (0xA0000000 | PHYS_FLASH_BASE)
+
+/* Some chips don't support alternative boot vector */
+#if defined(CONFIG_BRCM_IKOS)
+#define FLASH_BASE (0xA0000000 | PHYS_FLASH_BASE) /* uncached Flash */
+#define BOOT_OFFSET 0
+#else
+#if defined(_BCM96328_) || defined(CONFIG_BCM96328) || defined(_BCM96362_) || defined(CONFIG_BCM96362)
+#define FLASH_BASE 0xB8000000
+#else
+#define FLASH_BASE (0xA0000000 | (MPI->cs[0].base & 0xFFFFFF00))
+#endif
+#define BOOT_OFFSET (FLASH_BASE - IMAGE_BASE)
+#endif
+
+/*****************************************************************************/
+/* Select the PLL value to get the desired CPU clock frequency. */
+/*****************************************************************************/
+#define FPERIPH 50000000
+
+/*****************************************************************************/
+/* Board memory type offset */
+/*****************************************************************************/
+#define ONEK 1024
+#define FLASH_LENGTH_BOOT_ROM (64*ONEK)
+
+#define PROJECT_ID_LEN 7 /* Foxconn added by zacker, 02/29/2008, strlen("U12H094") */
+#ifdef _CFE_
+#define FLASH_SIZE 32 * 1024 * 1024
+#endif
+#define BOARD_DATA_ADDR (FLASH_BASE + FLASH_SIZE - 0x20000)
+#define BOARD_FOXNVRAM_ADDR (FLASH_BASE + FLASH_SIZE - 0x10000)
+#define FOX_BOARD_ID_MAX_LEN 64
+#define BOARD_ID "U12L161"
+/*****************************************************************************/
+/* NVRAM Offset and definition */
+/*****************************************************************************/
+#define NVRAM_SECTOR 0
+#define NVRAM_DATA_OFFSET 0x0580
+#define NVRAM_DATA_ID 0x0f1e2d3c // This is only for backwards compatability
+
+#define NVRAM_LENGTH ONEK // 1k nvram
+#define NVRAM_VERSION_NUMBER 6
+#define NVRAM_FULL_LEN_VERSION_NUMBER 5 /* version in which the checksum was
+ placed at the end of the NVRAM
+ structure */
+
+#define NVRAM_BOOTLINE_LEN 256
+#define NVRAM_BOARD_ID_STRING_LEN 16
+#define NVRAM_MAC_ADDRESS_LEN 6
+
+#define NVRAM_GPON_SERIAL_NUMBER_LEN 13
+#define NVRAM_GPON_PASSWORD_LEN 11
+
+#define NVRAM_WLAN_PARAMS_LEN 256
+#define NVRAM_WPS_DEVICE_PIN_LEN 8
+
+#define THREAD_NUM_ADDRESS_OFFSET (NVRAM_DATA_OFFSET + 4 + NVRAM_BOOTLINE_LEN + NVRAM_BOARD_ID_STRING_LEN)
+#define THREAD_NUM_ADDRESS (0x80000000 + THREAD_NUM_ADDRESS_OFFSET)
+
+#define DEFAULT_BOOTLINE "e=192.168.1.1:ffffff00 h=192.168.1.100 g= r=f f=vmlinux i=bcm963xx_fs_kernel d=1 p=0 "
+#define DEFAULT_BOARD_IP "192.168.1.1"
+#define DEFAULT_MAC_NUM 10
+#define DEFAULT_BOARD_MAC "00:10:18:00:00:00"
+#define DEFAULT_TP_NUM 0
+#define DEFAULT_PSI_SIZE 24
+#define DEFAULT_GPON_SN "BRCM12345678"
+#define DEFAULT_GPON_PW " "
+
+#define DEFAULT_WPS_DEVICE_PIN "12345670"
+
+#define DEFAULT_VOICE_BOARD_ID "NONE"
+
+#define NVRAM_MAC_COUNT_MAX 32
+#define NVRAM_MAX_PSI_SIZE 64
+#define NVRAM_MAX_SYSLOG_SIZE 256
+
+#define NP_BOOT 0
+#define NP_ROOTFS_1 1
+#define NP_ROOTFS_2 2
+#define NP_DATA 3
+#define NP_BBT 4
+#define NP_TOTAL 5
+
+#define NAND_DATA_SIZE_KB 1024
+#define NAND_BBT_THRESHOLD_KB (512 * 1024)
+#define NAND_BBT_SMALL_SIZE_KB 1024
+#define NAND_BBT_BIG_SIZE_KB 4096
+
+#define NAND_CFE_RAM_NAME "cferam.000"
+
+#ifndef _LANGUAGE_ASSEMBLY
+typedef struct
+{
+ unsigned long ulVersion;
+ char szBootline[NVRAM_BOOTLINE_LEN];
+ char szBoardId[NVRAM_BOARD_ID_STRING_LEN];
+ unsigned long ulMainTpNum;
+ unsigned long ulPsiSize;
+ unsigned long ulNumMacAddrs;
+ unsigned char ucaBaseMacAddr[NVRAM_MAC_ADDRESS_LEN];
+ char pad;
+ char backupPsi; /**< if 0x01, allocate space for a backup PSI */
+ unsigned long ulCheckSumV4;
+ char gponSerialNumber[NVRAM_GPON_SERIAL_NUMBER_LEN];
+ char gponPassword[NVRAM_GPON_PASSWORD_LEN];
+ char wpsDevicePin[NVRAM_WPS_DEVICE_PIN_LEN];
+ char wlanParams[NVRAM_WLAN_PARAMS_LEN];
+ unsigned long ulSyslogSize; /**< number of KB to allocate for persistent syslog */
+ unsigned long ulNandPartOfsKb[NP_TOTAL];
+ unsigned long ulNandPartSizeKb[NP_TOTAL];
+ char szVoiceBoardId[NVRAM_BOARD_ID_STRING_LEN];
+ unsigned long afeId[2];
+ char szFirmwareUpgradeBoardId[32]; /* foxconn added Bob, 07/12/2010, for TFTP firmware upgrade */
+ char chUnused[332]; /* reduce array size from 364 to 332, total size of NVRAM_DATA is unchanged, Bob, 07/12/2010 */
+ unsigned long ulCheckSum;
+} NVRAM_DATA, *PNVRAM_DATA;
+#endif
+
+#define BOOT_LATEST_IMAGE '0'
+#define BOOT_PREVIOUS_IMAGE '1'
+
+/*****************************************************************************/
+/* Misc Offsets */
+/*****************************************************************************/
+#define CFE_VERSION_OFFSET 0x0570
+#define CFE_VERSION_MARK_SIZE 5
+#define CFE_VERSION_SIZE 5
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _BCM_HWDEFS_H */
+
diff --git a/shared/opensource/include/bcm963xx/bcmnetlink.h b/shared/opensource/include/bcm963xx/bcmnetlink.h
new file mode 100755
index 0000000..e5fc77f
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/bcmnetlink.h
@@ -0,0 +1,47 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+/**************************************************************************
+ * File Name : bcmnetlink.h
+ *
+ * Description: This file defines broadcom specific netlink message types
+ ***************************************************************************/
+#ifndef _BCMNETLINK_H
+#define _BCMNETLINK_H
+
+#include<linux/netlink.h>
+
+#ifndef NETLINK_BRCM_MONITOR
+#define NETLINK_BRCM_MONITOR 25
+#endif
+
+/* message types exchanged using NETLINK_BRCM_MONITOR */
+#define MSG_NETLINK_BRCM_WAKEUP_MONITOR_TASK 0X1000
+
+#define MSG_NETLINK_BRCM_LINK_STATUS_CHANGED 0X2000
+
+
+extern void kerSysSendtoMonitorTask(int msgType, char *msgData, int msgDataLen);
+
+#endif /*_BCMNETLINK_H */
diff --git a/shared/opensource/include/bcm963xx/boardparms.h b/shared/opensource/include/bcm963xx/boardparms.h
new file mode 100755
index 0000000..7fec91c
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/boardparms.h
@@ -0,0 +1,453 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+/**************************************************************************
+ * File Name : boardparms.h
+ *
+ * Description: This file contains definitions and function prototypes for
+ * the BCM63xx board parameter access functions.
+ *
+ * Updates : 07/14/2003 Created.
+ ***************************************************************************/
+
+#if !defined(_BOARDPARMS_H)
+#define _BOARDPARMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Return codes. */
+#define BP_SUCCESS 0
+#define BP_BOARD_ID_NOT_FOUND 1
+#define BP_VALUE_NOT_DEFINED 2
+#define BP_BOARD_ID_NOT_SET 3
+
+/* Values for EthernetMacInfo PhyType. */
+#define BP_ENET_NO_PHY 0
+#define BP_ENET_INTERNAL_PHY 1
+#define BP_ENET_EXTERNAL_SWITCH 2
+#define BP_ENET_SWITCH_VIA_INTERNAL_PHY 3 /* it is for cpu internal phy connects to port 4 of 5325e */
+
+/* Values for EthernetMacInfo Configuration type. */
+#define BP_ENET_CONFIG_MDIO 0 /* Internal PHY, External PHY, Switch+(no GPIO, no SPI, no MDIO Pseudo phy */
+#define BP_ENET_CONFIG_MDIO_PSEUDO_PHY 1
+#define BP_ENET_CONFIG_SPI_SSB_0 2
+#define BP_ENET_CONFIG_SPI_SSB_1 3
+#define BP_ENET_CONFIG_SPI_SSB_2 4
+#define BP_ENET_CONFIG_SPI_SSB_3 5
+#define BP_ENET_CONFIG_MMAP 6
+#define BP_ENET_CONFIG_GPIO_MDIO 7 /* use GPIO to simulate MDC/MDIO */
+
+/* Values for VoIPDSPInfo DSPType. */
+#define BP_VOIP_NO_DSP 0
+#define BP_VOIP_DSP 1
+#define BP_VOIP_MIPS 2
+
+/* Values for GPIO pin assignments (AH = Active High, AL = Active Low). */
+#define BP_GPIO_NUM_MASK 0x00FF
+#define BP_ACTIVE_MASK 0x8000
+#define BP_ACTIVE_HIGH 0x0000
+#define BP_ACTIVE_LOW 0x8000
+#define BP_GPIO_SERIAL 0x4000
+
+#define BP_GPIO_0_AH (0)
+#define BP_GPIO_0_AL (0 | BP_ACTIVE_LOW)
+#define BP_GPIO_1_AH (1)
+#define BP_GPIO_1_AL (1 | BP_ACTIVE_LOW)
+#define BP_GPIO_2_AH (2)
+#define BP_GPIO_2_AL (2 | BP_ACTIVE_LOW)
+#define BP_GPIO_3_AH (3)
+#define BP_GPIO_3_AL (3 | BP_ACTIVE_LOW)
+#define BP_GPIO_4_AH (4)
+#define BP_GPIO_4_AL (4 | BP_ACTIVE_LOW)
+#define BP_GPIO_5_AH (5)
+#define BP_GPIO_5_AL (5 | BP_ACTIVE_LOW)
+#define BP_GPIO_6_AH (6)
+#define BP_GPIO_6_AL (6 | BP_ACTIVE_LOW)
+#define BP_GPIO_7_AH (7)
+#define BP_GPIO_7_AL (7 | BP_ACTIVE_LOW)
+#define BP_GPIO_8_AH (8)
+#define BP_GPIO_8_AL (8 | BP_ACTIVE_LOW)
+#define BP_GPIO_9_AH (9)
+#define BP_GPIO_9_AL (9 | BP_ACTIVE_LOW)
+#define BP_GPIO_10_AH (10)
+#define BP_GPIO_10_AL (10 | BP_ACTIVE_LOW)
+#define BP_GPIO_11_AH (11)
+#define BP_GPIO_11_AL (11 | BP_ACTIVE_LOW)
+#define BP_GPIO_12_AH (12)
+#define BP_GPIO_12_AL (12 | BP_ACTIVE_LOW)
+#define BP_GPIO_13_AH (13)
+#define BP_GPIO_13_AL (13 | BP_ACTIVE_LOW)
+#define BP_GPIO_14_AH (14)
+#define BP_GPIO_14_AL (14 | BP_ACTIVE_LOW)
+#define BP_GPIO_15_AH (15)
+#define BP_GPIO_15_AL (15 | BP_ACTIVE_LOW)
+#define BP_GPIO_16_AH (16)
+#define BP_GPIO_16_AL (16 | BP_ACTIVE_LOW)
+#define BP_GPIO_17_AH (17)
+#define BP_GPIO_17_AL (17 | BP_ACTIVE_LOW)
+#define BP_GPIO_18_AH (18)
+#define BP_GPIO_18_AL (18 | BP_ACTIVE_LOW)
+#define BP_GPIO_19_AH (19)
+#define BP_GPIO_19_AL (19 | BP_ACTIVE_LOW)
+#define BP_GPIO_20_AH (20)
+#define BP_GPIO_20_AL (20 | BP_ACTIVE_LOW)
+#define BP_GPIO_21_AH (21)
+#define BP_GPIO_21_AL (21 | BP_ACTIVE_LOW)
+#define BP_GPIO_22_AH (22)
+#define BP_GPIO_22_AL (22 | BP_ACTIVE_LOW)
+#define BP_GPIO_23_AH (23)
+#define BP_GPIO_23_AL (23 | BP_ACTIVE_LOW)
+#define BP_GPIO_24_AH (24)
+#define BP_GPIO_24_AL (24 | BP_ACTIVE_LOW)
+#define BP_GPIO_25_AH (25)
+#define BP_GPIO_25_AL (25 | BP_ACTIVE_LOW)
+#define BP_GPIO_26_AH (26)
+#define BP_GPIO_26_AL (26 | BP_ACTIVE_LOW)
+#define BP_GPIO_27_AH (27)
+#define BP_GPIO_27_AL (27 | BP_ACTIVE_LOW)
+#define BP_GPIO_28_AH (28)
+#define BP_GPIO_28_AL (28 | BP_ACTIVE_LOW)
+#define BP_GPIO_29_AH (29)
+#define BP_GPIO_29_AL (29 | BP_ACTIVE_LOW)
+#define BP_GPIO_30_AH (30)
+#define BP_GPIO_30_AL (30 | BP_ACTIVE_LOW)
+#define BP_GPIO_31_AH (31)
+#define BP_GPIO_31_AL (31 | BP_ACTIVE_LOW)
+#define BP_GPIO_32_AH (32)
+#define BP_GPIO_32_AL (32 | BP_ACTIVE_LOW)
+#define BP_GPIO_33_AH (33)
+#define BP_GPIO_33_AL (33 | BP_ACTIVE_LOW)
+#define BP_GPIO_34_AH (34)
+#define BP_GPIO_34_AL (34 | BP_ACTIVE_LOW)
+#define BP_GPIO_35_AH (35)
+#define BP_GPIO_35_AL (35 | BP_ACTIVE_LOW)
+#define BP_GPIO_36_AH (36)
+#define BP_GPIO_36_AL (36 | BP_ACTIVE_LOW)
+#define BP_GPIO_37_AH (37)
+#define BP_GPIO_37_AL (37 | BP_ACTIVE_LOW)
+#define BP_GPIO_38_AH (38)
+#define BP_GPIO_38_AL (38 | BP_ACTIVE_LOW)
+#define BP_GPIO_39_AH (39)
+#define BP_GPIO_39_AL (39 | BP_ACTIVE_LOW)
+#define BP_GPIO_40_AH (40)
+#define BP_GPIO_40_AL (40 | BP_ACTIVE_LOW)
+#define BP_GPIO_41_AH (41)
+#define BP_GPIO_41_AL (41 | BP_ACTIVE_LOW)
+#define BP_GPIO_42_AH (42)
+#define BP_GPIO_42_AL (42 | BP_ACTIVE_LOW)
+#define BP_GPIO_43_AH (43)
+#define BP_GPIO_43_AL (43 | BP_ACTIVE_LOW)
+#define BP_GPIO_44_AH (44)
+#define BP_GPIO_44_AL (44 | BP_ACTIVE_LOW)
+#define BP_GPIO_45_AH (45)
+#define BP_GPIO_45_AL (45 | BP_ACTIVE_LOW)
+#define BP_GPIO_46_AH (46)
+#define BP_GPIO_46_AL (46 | BP_ACTIVE_LOW)
+#define BP_GPIO_47_AH (47)
+#define BP_GPIO_47_AL (47 | BP_ACTIVE_LOW)
+
+#define BP_SERIAL_GPIO_0_AH (0 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_0_AL (0 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_1_AH (1 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_1_AL (1 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_2_AH (2 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_2_AL (2 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_3_AH (3 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_3_AL (3 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_4_AH (4 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_4_AL (4 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_5_AH (5 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_5_AL (5 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_6_AH (6 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_6_AL (6 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_7_AH (7 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_7_AL (7 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_8_AH (8 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_8_AL (8 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_9_AH (9 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_9_AL (9 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_10_AH (10 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_10_AL (10 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_11_AH (11 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_11_AL (11 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_12_AH (12 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_12_AL (12 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_13_AH (13 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_13_AL (13 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_14_AH (14 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_14_AL (14 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_15_AH (15 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_15_AL (15 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_16_AH (16 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_16_AL (16 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_17_AH (17 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_17_AL (17 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_18_AH (18 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_18_AL (18 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_19_AH (19 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_19_AL (19 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_20_AH (20 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_20_AL (20 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_21_AH (21 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_21_AL (21 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_22_AH (22 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_22_AL (22 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+#define BP_SERIAL_GPIO_23_AH (23 | BP_GPIO_SERIAL)
+#define BP_SERIAL_GPIO_23_AL (23 | BP_GPIO_SERIAL | BP_ACTIVE_LOW)
+
+/* Values for external interrupt assignments. */
+#define BP_EXT_INTR_0 0
+#define BP_EXT_INTR_1 1
+#define BP_EXT_INTR_2 2
+#define BP_EXT_INTR_3 3
+#define BP_EXT_INTR_4 4
+#define BP_EXT_INTR_5 5
+
+/* Values for chip select assignments. */
+#define BP_CS_0 0
+#define BP_CS_1 1
+#define BP_CS_2 2
+#define BP_CS_3 3
+
+#define BP_OVERLAY_GPON_TX_EN_L (1<<0)
+#define BP_OVERLAY_PCI (1<<0)
+#define BP_OVERLAY_CB (1<<1)
+#define BP_OVERLAY_SPI_EXT_CS (1<<2)
+#define BP_OVERLAY_UART1 (1<<3)
+#define BP_OVERLAY_PHY (1<<4)
+#define BP_OVERLAY_SERIAL_LEDS (1<<5)
+#define BP_OVERLAY_EPHY_LED_0 (1<<6)
+#define BP_OVERLAY_EPHY_LED_1 (1<<7)
+#define BP_OVERLAY_GPHY_LED_0 (1<<6)
+#define BP_OVERLAY_GPHY_LED_1 (1<<7)
+#define BP_OVERLAY_EPHY_LED_2 (1<<8)
+#define BP_OVERLAY_EPHY_LED_3 (1<<9)
+#define BP_OVERLAY_INET_LED (1<<10)
+#define BP_OVERLAY_MOCA_LED (1<<11)
+#define BP_OVERLAY_USB_LED (1<<12)
+#define BP_OVERLAY_USB_DEVICE (1<<13)
+
+/* Value for GPIO and external interrupt fields that are not used. */
+#define BP_NOT_DEFINED 0xffff
+
+/* Maximum size of the board id string. */
+#define BP_BOARD_ID_LEN 16
+
+/* Maximum number of Ethernet MACs. */
+#define BP_MAX_ENET_MACS 2
+#define BP_MAX_SWITCH_PORTS 8
+/* Maximum number of VoIP DSPs. */
+#define BP_MAX_VOIP_DSP 2
+
+/* Wireless Antenna Settings. */
+#define BP_WLAN_ANT_MAIN 0
+#define BP_WLAN_ANT_AUX 1
+#define BP_WLAN_ANT_BOTH 3
+
+/* Wireless FLAGS */
+#define BP_WLAN_MAC_ADDR_OVERRIDE 0x0001 /* use kerSysGetMacAddress for mac address */
+#define BP_WLAN_EXCLUDE_ONBOARD 0x0002 /* exclude onboard wireless */
+#define BP_WLAN_EXCLUDE_ONBOARD_FORCE 0x0004 /* force exclude onboard wireless even without addon card*/
+#define BP_WLAN_USE_OTP 0x0008 /* don't use sw srom map, may fall to OTP or uninitialzed */
+
+#define BP_WLAN_NVRAM_NAME_LEN 16
+#define BP_WLAN_MAX_PATCH_ENTRY 32
+
+/* AFE IDs */
+#define BP_AFE_DEFAULT 0
+
+#define BP_AFE_CHIP_INT (1 << 28)
+#define BP_AFE_CHIP_6505 (2 << 28)
+#define BP_AFE_CHIP_6306 (3 << 28)
+
+#define BP_AFE_LD_ISIL1556 (1 << 21)
+#define BP_AFE_LD_6301 (2 << 21)
+#define BP_AFE_LD_6302 (3 << 21)
+
+#define BP_AFE_FE_ANNEXA (1 << 15)
+#define BP_AFE_FE_ANNEXB (2 << 15)
+#define BP_AFE_FE_ANNEXJ (3 << 15)
+
+#define BP_AFE_FE_AVMODE_COMBO (0 << 13)
+#define BP_AFE_FE_AVMODE_ADSL (1 << 13)
+#define BP_AFE_FE_AVMODE_VDSL (2 << 13)
+
+/* VDSL only */
+#define BP_AFE_FE_REV_ISIL_REV1 (1 << 8)
+/* Combo */
+#define BP_AFE_FE_REV_6302_REV1 (1 << 8)
+#define BP_AFE_FE_REV_6302_REV_7_12 (1 << 8)
+#define BP_AFE_FE_REV_6302_REV_7_4 (2 << 8)
+
+#define BP_AFE_FE_REV_6302_REV_7_2_1 (3 << 8)
+#define BP_AFE_FE_REV_6302_REV_7_2 (4 << 8)
+#define BP_AFE_FE_REV_6302_REV_7_2_UR2 (5 << 8)
+#define BP_AFE_FE_REV_6302_REV_7_2_2 (6 << 8)
+/* ADSL only*/
+#define BP_AFE_FE_REV_6302_REV_5_2_1 (1 << 8)
+#define BP_AFE_FE_REV_6302_REV_5_2_2 (2 << 8)
+#define BP_AFE_FE_REV_6301_REV_5_1_1 (1 << 8)
+
+#define BP_GET_EXT_AFE_DEFINED
+
+#if !defined(__ASSEMBLER__)
+
+/* Information about Ethernet switch */
+typedef struct {
+ int port_map;
+ int phy_id[BP_MAX_SWITCH_PORTS];
+} ETHERNET_SW_INFO;
+
+/* WAN port flag in the phy_id of ETHERNET_SW_INFO */
+#define BCM_WAN_PORT 0x40
+#define IsWanPort(id) (((id) & BCM_WAN_PORT) && ((id) != 0xFF))
+
+#define c0(n) (((n) & 0x55555555) + (((n) >> 1) & 0x55555555))
+#define c1(n) (((n) & 0x33333333) + (((n) >> 2) & 0x33333333))
+#define c2(n) (((n) & 0x0f0f0f0f) + (((n) >> 4) & 0x0f0f0f0f))
+#define bitcount(r, n) {r = n; r = c0(r); r = c1(r); r = c2(r); r %= 255;}
+
+/* Information about an Ethernet MAC. If ucPhyType is BP_ENET_NO_PHY,
+ * then the other fields are not valid.
+ */
+typedef struct EthernetMacInfo
+{
+ unsigned char ucPhyType; /* BP_ENET_xxx */
+ unsigned char ucPhyAddress; /* 0 to 31 */
+ unsigned short usGpioLedPhyLinkSpeed; /* GPIO pin or not defined */
+ unsigned short usConfigType; /* Configuration type */
+ ETHERNET_SW_INFO sw; /* switch information */
+ unsigned short usGpioMDC; /* GPIO pin to simulate MDC */
+ unsigned short usGpioMDIO; /* GPIO pin to simulate MDIO */
+} ETHERNET_MAC_INFO, *PETHERNET_MAC_INFO;
+
+typedef struct WlanSromEntry {
+ char name[BP_WLAN_NVRAM_NAME_LEN];
+ unsigned short wordOffset;
+ unsigned short value;
+} WLAN_SROM_ENTRY;
+
+typedef struct WlanSromPatchInfo {
+ char szboardId[BP_BOARD_ID_LEN];
+ unsigned short usWirelessChipId;
+ unsigned short usNeededSize;
+ WLAN_SROM_ENTRY entries[BP_WLAN_MAX_PATCH_ENTRY];
+} WLAN_SROM_PATCH_INFO, *PWLAN_SROM_PATCH_INFO;
+
+typedef struct WlanPciEntry {
+ char name[BP_WLAN_NVRAM_NAME_LEN];
+ unsigned int dwordOffset;
+ unsigned int value;
+} WLAN_PCI_ENTRY;
+
+typedef struct WlanPciPatchInfo {
+ char szboardId[BP_BOARD_ID_LEN];
+ unsigned int usWirelessPciId;
+ int usNeededSize;
+ WLAN_PCI_ENTRY entries[BP_WLAN_MAX_PATCH_ENTRY];
+} WLAN_PCI_PATCH_INFO, *PWLAN_PCI_PATCH_INFO;
+
+/* Information about VoIP DSPs. If ucDspType is BP_VOIP_NO_DSP,
+ * then the other fields are not valid.
+ */
+typedef struct VoIPDspInfo
+{
+ unsigned char ucDspType;
+ unsigned char ucDspAddress;
+ unsigned short usGpioLedVoip;
+ unsigned short usGpioVoip1Led;
+ unsigned short usGpioVoip1LedFail;
+ unsigned short usGpioVoip2Led;
+ unsigned short usGpioVoip2LedFail;
+ unsigned short usGpioPotsLed;
+ unsigned short usGpioDectLed;
+
+} VOIP_DSP_INFO;
+
+int BpSetBoardId( char *pszBoardId );
+int BpGetBoardId( char *pszBoardId);
+int BpGetBoardIds( char *pszBoardIds, int nBoardIdsSize );
+
+int BpGetGPIOverlays( unsigned short *pusValue );
+
+int BpGetRj11InnerOuterPairGpios( unsigned short *pusInner, unsigned short *pusOuter );
+int BpGetRtsCtsUartGpios( unsigned short *pusRts, unsigned short *pusCts );
+
+int BpGetAdslLedGpio( unsigned short *pusValue );
+int BpGetAdslFailLedGpio( unsigned short *pusValue );
+int BpGetSecAdslLedGpio( unsigned short *pusValue );
+int BpGetSecAdslFailLedGpio( unsigned short *pusValue );
+int BpGetWirelessSesLedGpio( unsigned short *pusValue );
+int BpGetHpnaLedGpio( unsigned short *pusValue );
+int BpGetWanDataLedGpio( unsigned short *pusValue );
+int BpGetWanErrorLedGpio( unsigned short *pusValue );
+int BpGetBootloaderPowerOnLedGpio( unsigned short *pusValue );
+int BpGetBootloaderStopLedGpio( unsigned short *pusValue );
+int BpGetFpgaResetGpio( unsigned short *pusValue );
+int BpGetGponLedGpio( unsigned short *pusValue );
+int BpGetGponFailLedGpio( unsigned short *pusValue );
+int BpGetMoCALedGpio( unsigned short *pusValue );
+int BpGetMoCAFailLedGpio( unsigned short *pusValue );
+
+int BpGetResetToDefaultExtIntr( unsigned short *pusValue );
+int BpGetWirelessSesExtIntr( unsigned short *pusValue );
+int BpGetHpnaExtIntr( unsigned long *pulValue );
+
+int BpGetHpnaChipSelect( unsigned long *pulValue );
+
+int BpGetWirelessAntInUse( unsigned short *pusValue );
+int BpGetWirelessFlags( unsigned short *pusValue );
+int BpGetWirelessPowerDownGpio( unsigned short *pusValue );
+int BpUpdateWirelessSromMap(unsigned short chipID, unsigned short* pBase, int sizeInWords);
+int BpUpdateWirelessPciConfig (unsigned long pciID, unsigned long* pBase, int sizeInDWords);
+
+int BpGetEthernetMacInfo( PETHERNET_MAC_INFO pEnetInfos, int nNumEnetInfos );
+int BpGet6829PortInfo( unsigned char *portInfo6829 );
+int BpGetDslPhyAfeIds( unsigned long *pulValues );
+int BpGetExtAFEResetGpio( unsigned short *pulValues );
+int BpGetExtAFELDPwrGpio( unsigned short *pulValues );
+int BpGetExtAFELDModeGpio( unsigned short *pulValues );
+
+VOIP_DSP_INFO *BpGetVoipDspConfig( unsigned char dspNum );
+int BpGetVoipLedGpio( unsigned short *pusValue );
+int BpGetVoip1LedGpio( unsigned short *pusValue );
+int BpGetVoip1FailLedGpio( unsigned short *pusValue );
+int BpGetVoip2LedGpio( unsigned short *pusValue );
+int BpGetVoip2FailLedGpio( unsigned short *pusValue );
+int BpGetPotsLedGpio( unsigned short *pusValue );
+int BpGetDectLedGpio( unsigned short *pusValue );
+
+int bpstrcmp(const char *dest,const char *src);
+
+
+#endif /* __ASSEMBLER__ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _BOARDPARMS_H */
+
diff --git a/shared/opensource/include/bcm963xx/boardparms_voice.h b/shared/opensource/include/bcm963xx/boardparms_voice.h
new file mode 100755
index 0000000..5d3c7e5
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/boardparms_voice.h
@@ -0,0 +1,392 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+/**************************************************************************
+ * File Name : boardparms_voice.h
+ *
+ * Description: This file contains definitions and function prototypes for
+ * the BCM63xx voice board parameter access functions.
+ *
+ ***************************************************************************/
+
+#if !defined(_BOARDPARMS_VOICE_H)
+#define _BOARDPARMS_VOICE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <boardparms.h>
+
+#define SI32261ENABLE /* Temporary #def until fully supported */
+#define SI32267ENABLE /* Temporary #def until fully supported */
+
+/* Board string defines */
+
+#define VOICECFG_NOSLIC_STR "NOSLIC"
+#define VOICECFG_LE88276_STR "LE88276"
+#define VOICECFG_LE88506_STR "LE88506"
+#define VOICECFG_LE9530_STR "LE9530"
+#define VOICECFG_VE890_STR "VE890"
+#define VOICECFG_SI32178_STR "SI32178"
+#define VOICECFG_SI3217X_STR "SI3217X"
+#define VOICECFG_SI3226_STR "SI3226"
+#define VOICECFG_6328AVNG_LE88276_NTR_STR "LE88276-NTR"
+#define VOICECFG_6328AVNG_SI32267_STR "AVNG_SI32267"
+#define VOICECFG_6328AVNG_VE890HV_PARTIAL_STR "AVNG_VE890HVP"
+#define VOICECFG_6328AVNG_VE890HV_STR "AVNG_VE890HV"
+
+#define VOICECFG_6328AVNGR_SI32176_STR "AVNGR_SI32176"
+#define VOICECFG_6328AVNGR_LE89116_STR "AVNGR_LE89116"
+#define VOICECFG_6328AVNGR_SI3217X_STR "AVNGR_SI3217X"
+
+#define VOICECFG_6368MVWG_STR "MVWG"
+#define VOICECFG_6368MBG_LE88276_STR "MBG_LE88276"
+#define VOICECFG_6368MBG_LE88506_STR "MBG_LE88506"
+#define VOICECFG_6368MBG_VE890_STR "MBG_VE890"
+#define VOICECFG_6368MBG_LE89116_STR "MBG_LE89116"
+#define VOICECFG_6368MBG_LE89316_STR "MBG_LE89316"
+#define VOICECFG_6368MBG_SI3217X_STR "MBG_SI3217X"
+#define VOICECFG_6368MBG_SI32176_STR "MBG_SI32176"
+#define VOICECFG_6368MBG_SI32178_STR "MBG_SI32178"
+#define VOICECFG_6368MBG_SI3226_STR "MBG_SI3226"
+
+#define VOICECFG_6362ADVNGP5_NOSLIC_STR "ADVNGP5_NOSLIC"
+#define VOICECFG_6362ADVNGP5_SI3217X_STR "ADVNGP5_SI3217X"
+#define VOICECFG_6362ADVNGP5_SI32176_STR "ADVNGP5_SI32176"
+#define VOICECFG_6362ADVNGP5_SI32178_STR "ADVNGP5_SI32178"
+#define VOICECFG_6362ADVNGP5_VE890_STR "ADVNGP5_VE890"
+#define VOICECFG_6362ADVNGP5_LE89116_STR "ADVNGP5_LE89116"
+#define VOICECFG_6362ADVNGP5_LE89316_STR "ADVNGP5_LE89316"
+#define VOICECFG_6362ADVNGP5_LE88506_STR "ADVNGP5_LE88506"
+#define VOICECFG_6362ADVNGP5_LE88276_STR "ADVNGP5_LE88276"
+#define VOICECFG_6362ADVNGP5_SI3226_STR "ADVNGP5_SI3226"
+
+#define VOICECFG_6362ADVNGR_SI3217X_STR "ADVNGR_SI3217X"
+#define VOICECFG_6362ADVNGR_SI32176_STR "ADVNGR_SI32176"
+#define VOICECFG_6362ADVNGR_SI32178_STR "ADVNGR_SI32178"
+#define VOICECFG_6362ADVNGR_SI3217X_NOFXO_STR "ADVNGR_SI3217XN"
+#define VOICECFG_6362ADVNGR_VE890_STR "ADVNGR_VE890"
+#define VOICECFG_6362ADVNGR_LE89116_STR "ADVNGR_LE89116"
+#define VOICECFG_6362ADVNGR_LE89316_STR "ADVNGR_LE89316"
+#define VOICECFG_6362ADVNGR_LE88506_STR "ADVNGR_LE88506"
+#define VOICECFG_6362ADVNGR_LE88276_STR "ADVNGR_LE88276"
+#define VOICECFG_6362ADVNGR_SI3226_STR "ADVNGR_SI3226"
+#define VOICECFG_6362ADVNGR_SI32261_STR "ADVNGR_SI32261"
+#define VOICECFG_6362ADVNGR_SI32267_STR "ADVNGR_SI32267"
+#define VOICECFG_6362ADVNGR_VE890HV_PARTIAL_STR "ADVNGR_VE890HVP"
+#define VOICECFG_6362ADVNGR_VE890HV_STR "ADVNGR_VE890HV"
+
+#define VOICECFG_6362ADVNGR2_SI3217X_STR "ADVNGR2_SI3217X"
+#define VOICECFG_6362ADVNGR2_VE890_STR "ADVNGR2_VE890"
+#define VOICECFG_6362ADVNGR2_LE88506_STR "ADVNGR2_LE88506"
+#define VOICECFG_6362ADVNGR2_LE88276_STR "ADVNGR2_LE88276"
+#define VOICECFG_6362ADVNGR2_SI3226_STR "ADVNGR2_SI3226"
+
+#define VOICECFG_6368MVNGR_SI3217X_STR "MVNGR_SI3217X"
+#define VOICECFG_6368MVNGR_SI32176_STR "MVNGR_SI32176"
+#define VOICECFG_6368MVNGR_SI32178_STR "MVNGR_SI32178"
+#define VOICECFG_6368MVNGR_SI3217X_NOFXO_STR "MVNGR_SI3217XN"
+#define VOICECFG_6368MVNGR_VE890_STR "MVNGR_VE890"
+#define VOICECFG_6368MVNGR_LE89116_STR "MVNGR_LE89116"
+#define VOICECFG_6368MVNGR_LE89316_STR "MVNGR_LE89316"
+#define VOICECFG_6368MVNGR_LE88506_STR "MVNGR_LE88506"
+#define VOICECFG_6368MVNGR_LE88276_STR "MVNGR_LE88276"
+#define VOICECFG_6368MVNGR_SI3226_STR "MVNGR_SI3226"
+#define VOICECFG_6368MVNGR_VE890HV_PARTIAL_STR "MVNGR_VE890HVP"
+#define VOICECFG_6368MVNGR_VE890HV_STR "MVNGR_VE890HV"
+
+
+/* Maximum number of devices in the system (on the board).
+** Devices can refer to DECT, SLAC/SLIC, or SLAC/DAA combo. */
+#define BP_MAX_VOICE_DEVICES 5
+
+/* Maximum numbers of channels per SLAC. */
+#define BP_MAX_CHANNELS_PER_DEVICE 2
+
+/* Maximum number of voice channels in the system.
+** This represents the sum of all channels available on the devices in the system */
+#define BP_MAX_VOICE_CHAN (BP_MAX_VOICE_DEVICES * BP_MAX_CHANNELS_PER_DEVICE)
+
+/* Max number of GPIO pins used for controling PSTN failover relays
+** Note: the number of PSTN failover relays can be larger if multiple
+** relays are controlled by single GPIO */
+#define BP_MAX_RELAY_PINS 2
+
+#define BP_TIMESLOT_INVALID 0xFF
+
+/* General-purpose flag definitions (rename as appropriate) */
+#define BP_FLAG_DSP_APMHAL_ENABLE (1 << 0)
+#define BP_FLAG_ISI_SUPPORT (1 << 1)
+#define BP_FLAG_MODNAME_TESTNAME2 (1 << 2)
+#define BP_FLAG_MODNAME_TESTNAME3 (1 << 3)
+#define BP_FLAG_MODNAME_TESTNAME4 (1 << 4)
+#define BP_FLAG_MODNAME_TESTNAME5 (1 << 5)
+#define BP_FLAG_MODNAME_TESTNAME6 (1 << 6)
+#define BP_FLAG_MODNAME_TESTNAME7 (1 << 7)
+#define BP_FLAG_MODNAME_TESTNAME8 (1 << 8)
+
+/*
+** Device-specific definitions
+*/
+typedef enum
+{
+ BP_VD_NONE = -1,
+ BP_VD_IDECT1, /* Do not move this around, otherwise rebuild dect_driver.bin */
+ BP_VD_EDECT1,
+ BP_VD_SILABS_3050,
+ BP_VD_SILABS_3215,
+ BP_VD_SILABS_3216,
+ BP_VD_SILABS_3217,
+ BP_VD_SILABS_32176,
+ BP_VD_SILABS_32178,
+ BP_VD_SILABS_3226,
+ BP_VD_SILABS_32261,
+ BP_VD_SILABS_32267,
+ BP_VD_ZARLINK_88010,
+ BP_VD_ZARLINK_88221,
+ BP_VD_ZARLINK_88276,
+ BP_VD_ZARLINK_88506,
+ BP_VD_ZARLINK_89010,
+ BP_VD_ZARLINK_89116,
+ BP_VD_ZARLINK_89316,
+ BP_VD_ZARLINK_9530,
+ BP_VD_ZARLINK_89136,
+ BP_VD_ZARLINK_89336,
+ BP_VD_MAX,
+} BP_VOICE_DEVICE_TYPE;
+
+
+/*
+** Channel-specific definitions
+*/
+
+typedef enum
+{
+ BP_VOICE_CHANNEL_ACTIVE,
+ BP_VOICE_CHANNEL_INACTIVE,
+} BP_VOICE_CHANNEL_STATUS;
+
+typedef enum
+{
+ BP_VCTYPE_NONE = -1,
+ BP_VCTYPE_SLIC,
+ BP_VCTYPE_DAA,
+ BP_VCTYPE_DECT
+} BP_VOICE_CHANNEL_TYPE;
+
+typedef enum
+{
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_16BITS,
+ BP_VOICE_CHANNEL_SAMPLE_SIZE_8BITS,
+} BP_VOICE_CHANNEL_SAMPLE_SIZE;
+
+typedef enum
+{
+ BP_VOICE_CHANNEL_NARROWBAND,
+ BP_VOICE_CHANNEL_WIDEBAND,
+} BP_VOICE_CHANNEL_FREQRANGE;
+
+
+typedef enum
+{
+ BP_VOICE_CHANNEL_ENDIAN_BIG,
+ BP_VOICE_CHANNEL_ENDIAN_LITTLE,
+} BP_VOICE_CHANNEL_ENDIAN_MODE;
+
+typedef enum
+{
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_NONE,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ALAW,
+ BP_VOICE_CHANNEL_PCMCOMP_MODE_ULAW,
+} BP_VOICE_CHANNEL_PCMCOMP_MODE;
+
+
+typedef struct
+{
+ unsigned int status; /* active/inactive */
+ unsigned int type; /* SLIC/DAA/DECT */
+ unsigned int pcmCompMode; /* u-law/a-law (applicable for 8-bit samples) */
+ unsigned int freqRange; /* narrowband/wideband */
+ unsigned int sampleSize; /* 8-bit / 16-bit */
+ unsigned int endianMode; /* big/little */
+ unsigned int rxTimeslot; /* Receive timeslot for the channel */
+ unsigned int txTimeslot; /* Sending timeslot for the channel */
+
+} BP_VOICE_CHANNEL;
+
+/* TODO: This structure could possibly be turned into union if needed */
+typedef struct
+{
+ int spiDevId; /* SPI device id */
+ unsigned short spiGpio; /* SPI GPIO (if used for SPI control) */
+} BP_VOICE_SPI_CONTROL;
+
+typedef struct
+{
+ unsigned short relayGpio[BP_MAX_RELAY_PINS];
+} BP_PSTN_RELAY_CONTROL;
+
+typedef struct
+{
+ unsigned short dectUartGpioTx;
+ unsigned short dectUartGpioRx;
+} BP_DECT_UART_CONTROL;
+
+typedef struct
+{
+ unsigned int voiceDeviceType; /* Specific type of device (Le88276, Si32176, etc.) */
+ BP_VOICE_SPI_CONTROL spiCtrl; /* SPI control through dedicated SPI pin or GPIO */
+ int requiresReset; /* Does the device requires reset (through GPIO) */
+ unsigned short resetGpio; /* Reset GPIO */
+ BP_VOICE_CHANNEL channel[BP_MAX_CHANNELS_PER_DEVICE]; /* Device channels */
+
+} BP_VOICE_DEVICE;
+
+
+/*
+** Main structure for defining the board parameters and used by boardHal
+** for proper initialization of the DSP and devices (SLACs, DECT, etc.)
+*/
+typedef struct VOICE_BOARD_PARMS
+{
+ char szBoardId[BP_BOARD_ID_LEN]; /* board id string */
+ unsigned int numFxsLines; /* Number of FXS lines in the system */
+ unsigned int numFxoLines; /* Number of FXO lines in the system */
+ unsigned int numDectLines; /* Number of DECT lines in the system */
+ unsigned int numFailoverRelayPins; /* Number of GPIO pins controling PSTN failover relays */
+ BP_VOICE_DEVICE voiceDevice[BP_MAX_VOICE_DEVICES]; /* Voice devices in the system */
+ BP_PSTN_RELAY_CONTROL pstnRelayCtrl; /* Control for PSTN failover relays */
+ BP_DECT_UART_CONTROL dectUartControl; /* Control for external DECT UART */
+ unsigned int flags; /* General-purpose flags */
+} VOICE_BOARD_PARMS, *PVOICE_BOARD_PARMS;
+
+/* --- End of voice-specific structures and enums --- */
+
+int BpGetVoiceParms( char* pszBoardId, VOICE_BOARD_PARMS* voiceParms );
+int BpSetVoiceBoardId( char *pszBoardId );
+int BpGetVoiceBoardId( char *pszBoardId );
+int BpGetVoiceBoardIds( char *pszBoardIds, int nBoardIdsSize );
+
+/* Variable externs */
+
+#if defined(_BCM96328_) || defined(CONFIG_BCM96328)
+
+extern VOICE_BOARD_PARMS voiceBoard_96328AVNG_LE88276;
+extern VOICE_BOARD_PARMS voiceBoard_96328AVNG_SI3226;
+extern VOICE_BOARD_PARMS voiceBoard_96328AVNG_VE890;
+extern VOICE_BOARD_PARMS voiceBoard_96328AVNG_SI3217X;
+extern VOICE_BOARD_PARMS voiceBoard_96328AVNG_LE88506;
+extern VOICE_BOARD_PARMS voiceBoard_96328AVNG_SI32267;
+extern VOICE_BOARD_PARMS voiceBoard_96328AVNG_LE88276_NTR;
+extern VOICE_BOARD_PARMS voiceBoard_96328AVNG_VE890HV_Partial;
+extern VOICE_BOARD_PARMS voiceBoard_96328AVNG_VE890HV;
+
+extern VOICE_BOARD_PARMS voiceBoard_96328AVNGR_SI32176;
+extern VOICE_BOARD_PARMS voiceBoard_96328AVNGR_LE89116;
+extern VOICE_BOARD_PARMS voiceBoard_96328AVNGR_SI3217X;
+
+#endif
+
+#if defined(_BCM96362_) || defined(CONFIG_BCM96362)
+
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_NOSLIC;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_VE890;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_LE89116;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_LE89316;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_SI3217X;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_SI32176;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_SI32178;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_LE88276;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_SI3226;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGP5_LE88506;
+
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI3217X;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI32176;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI32178;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI3217X_NOFXO;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_VE890;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_LE89116;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_LE89316;
+
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_LE88506;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_LE88276;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI3226;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI32261;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_SI32267;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_VE890HVP;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNgr_VE890HV;
+
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGR2_SI3217X;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGR2_VE890;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGR2_LE88506;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGR2_LE88276;
+extern VOICE_BOARD_PARMS voiceBoard_96362ADVNGR2_SI3226;
+
+#endif
+
+#if defined(_BCM96368_) || defined(CONFIG_BCM96368)
+
+extern VOICE_BOARD_PARMS voiceBoard_96368MVWG;
+extern VOICE_BOARD_PARMS voiceBoard_96368MBG_LE88276;
+extern VOICE_BOARD_PARMS voiceBoard_96368MBG_LE88506;
+extern VOICE_BOARD_PARMS voiceBoard_96368MBG_VE890;
+extern VOICE_BOARD_PARMS voiceBoard_96368MBG_LE89116;
+extern VOICE_BOARD_PARMS voiceBoard_96368MBG_LE89316;
+extern VOICE_BOARD_PARMS voiceBoard_96368MBG_SI3217X;
+extern VOICE_BOARD_PARMS voiceBoard_96368MBG_SI32176;
+extern VOICE_BOARD_PARMS voiceBoard_96368MBG_SI32178;
+extern VOICE_BOARD_PARMS voiceBoard_96368MBG_SI3226;
+
+extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_SI3217X;
+extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_SI32176;
+extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_SI32178;
+extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_SI3217X_NOFXO;
+extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_VE890;
+extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_LE89116;
+extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_LE89316;
+extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_LE88506;
+extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_LE88276;
+extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_SI3226;
+extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_VE890HV_Partial;
+extern VOICE_BOARD_PARMS voiceBoard_96368MVNgr_VE890HV;
+
+#endif
+
+
+#if defined(_BCM96816_) || defined(CONFIG_BCM96816)
+
+extern VOICE_BOARD_PARMS voiceBoard_96816PVWM_LE88276;
+extern VOICE_BOARD_PARMS voiceBoard_96816PVWM_SI3226;
+extern VOICE_BOARD_PARMS voiceBoard_96816PVWM_LE88506;
+extern VOICE_BOARD_PARMS voiceBoard_96816PVWM_LE9530;
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _BOARDPARMS_VOICE_H */
+
diff --git a/shared/opensource/include/bcm963xx/fap_mod_size.h b/shared/opensource/include/bcm963xx/fap_mod_size.h
new file mode 100644
index 0000000..03bb799
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/fap_mod_size.h
@@ -0,0 +1,2 @@
+#define FAP_CORE_SIZE 0
+#define FAP_INIT_SIZE 0
diff --git a/shared/opensource/include/bcm963xx/flash_api.h b/shared/opensource/include/bcm963xx/flash_api.h
new file mode 100755
index 0000000..7ac8022
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/flash_api.h
@@ -0,0 +1,90 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the “GPL?, available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+/***************************************************************************
+ * File Name : flash_api.h
+ *
+ * Description: This file contains definitions and prototypes for a public
+ * flash device interface and an internal flash device interface.
+ ***************************************************************************/
+
+#if !defined(_FLASH_API_H)
+#define _FLASH_API_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Flash definitions. */
+#define FLASH_API_OK 1
+#define FLASH_API_ERROR -1
+
+#define FLASH_IFC_UNKNOWN 0
+#define FLASH_IFC_PARALLEL 1
+#define FLASH_IFC_SPI 2
+#define FLASH_IFC_HS_SPI 3
+#define FLASH_IFC_NAND 4
+
+#define NAND_REINIT_FLASH 0xffff
+
+/* Public Interface Prototypes. */
+int flash_init(void);
+int flash_sector_erase_int(unsigned short sector);
+int flash_read_buf(unsigned short sector, int offset, unsigned char *buffer,
+ int numbytes);
+int flash_write_buf(unsigned short sector, int offset, unsigned char *buffer,
+ int numbytes);
+int flash_get_numsectors(void);
+int flash_get_sector_size(unsigned short sector);
+unsigned char *flash_get_memptr(unsigned short sector);
+int flash_get_blk(int addr);
+int flash_get_total_size(void);
+int flash_get_flash_type(void);
+void flash_change_flash_type(int type);
+
+/* Internal Flash Device Driver Information. */
+typedef struct flash_device_info_s
+{
+ unsigned short flash_device_id;
+ unsigned short flash_type;
+ char flash_device_name[30];
+
+ int (*fn_flash_sector_erase_int) (unsigned short sector);
+ int (*fn_flash_read_buf) (unsigned short sector, int offset,
+ unsigned char *buffer, int numbytes);
+ int (*fn_flash_write_buf) (unsigned short sector, int offset,
+ unsigned char *buffer, int numbytes);
+ int (*fn_flash_get_numsectors) (void);
+ int (*fn_flash_get_sector_size) (unsigned short sector);
+ unsigned char * (*fn_flash_get_memptr) (unsigned short sector);
+ int (*fn_flash_get_blk) (int addr);
+ int (*fn_flash_get_total_size) (void);
+} flash_device_info_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _FLASH_API_H */
+
diff --git a/shared/opensource/include/bcm963xx/flash_common.h b/shared/opensource/include/bcm963xx/flash_common.h
new file mode 100755
index 0000000..4fcceca
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/flash_common.h
@@ -0,0 +1,103 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the “GPL”), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+/*!\file flash_common.h
+ * \brief This file contains definitions and prototypes used by both
+ * CFE and kernel.
+ *
+ */
+
+#if !defined(_FLASH_COMMON_H)
+#define _FLASH_COMMON_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** default scratch pad length */
+#define SP_MAX_LEN (8 * 1024)
+
+
+/** Flash storage address information that is determined by the flash driver.
+ *
+ * This structure is used by CFE and kernel.
+ */
+typedef struct flashaddrinfo
+{
+ int flash_persistent_start_blk; /**< primary psi, for config file */
+ int flash_persistent_number_blk;
+ int flash_persistent_length; /**< in bytes */
+ unsigned long flash_persistent_blk_offset;
+ int flash_scratch_pad_start_blk; /**< start of scratch pad */
+ int flash_scratch_pad_number_blk;
+ int flash_scratch_pad_length; /**< in bytes */
+ unsigned long flash_scratch_pad_blk_offset;
+ unsigned long flash_rootfs_start_offset; /**< offset from start of flash to fs+kernel image */
+ int flash_backup_psi_start_blk; /**< starting block of backup psi. Length is
+ the same as primary psi.
+ Start at begining of sector, so offset is always 0.
+ No sharing sectors with anybody else. */
+ int flash_backup_psi_number_blk; /**< The number of sectors for primary and backup
+ * psi may be different due to the irregular
+ * sector sizes at the end of the flash. */
+ int flash_syslog_start_blk; /**< starting block of persistent syslog. */
+ int flash_syslog_number_blk; /**< number of blocks */
+ int flash_syslog_length; /**< in bytes, set from CFE, note busybox syslogd uses 16KB buffer.
+ Like backup_psi, always start at beginning of sector,
+ so offset is 0, and no sharing of sectors. */
+ int flash_meta_start_blk; /**< The first block which is used for meta info such
+ as the psi, scratch pad, syslog, backup psi.
+ The kernel can use everything above this sector. */
+} FLASH_ADDR_INFO, *PFLASH_ADDR_INFO;
+
+
+/** Fill in the fInfo structure with primary PSI, scratch pad, syslog, secondary PSI info.
+ *
+ * @param nvRam (IN) nvram info.
+ * @param fInfo (OUT) flash addr info that will be filled out by this function.
+ */
+void flash_init_info(const NVRAM_DATA *nvRam, FLASH_ADDR_INFO *fInfo);
+
+
+/** Get the total number of bytes at the bottom of the flash used for PSI, scratch pad, etc.
+ *
+ * Even though this function is returning the number of bytes, it it guaranteed to
+ * return the number of bytes of whole sectors at the end which are in use.
+ * If customer enables backup PSI and persistent syslog, the number of bytes
+ * may go above 64KB. This function replaces the old FLASH_RESERVED_AT_END define.
+ *
+ * @param fInfo (IN) Pointer to flash_addr_info struct.
+ *
+ * @return number of bytes reserved at the end.
+ */
+unsigned int flash_get_reserved_bytes_at_end(const FLASH_ADDR_INFO *fInfo);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _FLASH_COMMON_H */
+
diff --git a/shared/opensource/include/bcm963xx/gpio_drv.h b/shared/opensource/include/bcm963xx/gpio_drv.h
new file mode 100755
index 0000000..8131153
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/gpio_drv.h
@@ -0,0 +1,40 @@
+/***************************************************************************
+***
+*** Copyright 2008 Hon Hai Precision Ind. Co. Ltd.
+*** All Rights Reserved.
+*** No portions of this material shall be reproduced in any form without the
+*** written permission of Hon Hai Precision Ind. Co. Ltd.
+***
+*** All information contained in this document is Hon Hai Precision Ind.
+*** Co. Ltd. company private, proprietary, and trade secret property and
+*** are protected by international intellectual property laws and treaties.
+***
+****************************************************************************/
+
+#ifndef __GPIO_DRV_H__
+#define __GPIO_DRV_H__
+
+#define DEV_GPIO_DRV "gpio_drv"
+
+#define GPIO_IOCTL_NUM 'W'
+
+#define IOCTL_LAN_LED_STATE _IOWR(GPIO_IOCTL_NUM, 0, int *)
+#define IOCTL_USB_LED_STATE _IOWR(GPIO_IOCTL_NUM, 1, int *)
+#define IOCTL_WPS_LED_STATE _IOWR(GPIO_IOCTL_NUM, 2, int *)
+#define IOCTL_VOIP_LED_OFF _IOWR(GPIO_IOCTL_NUM, 3, int *)
+#define IOCTL_VOIP_LED_ON _IOWR(GPIO_IOCTL_NUM, 4, int *)
+#define IOCTL_VOIP_LED_BS _IOWR(GPIO_IOCTL_NUM, 5, int *)
+#define IOCTL_VOIP_LED_BF _IOWR(GPIO_IOCTL_NUM, 6, int *)
+#define IOCTL_VOIP_LED_BN _IOWR(GPIO_IOCTL_NUM, 7, int *)
+#define IOCTL_WAN_LED_STATE _IOWR(GPIO_IOCTL_NUM, 8, int *)
+#define IOCTL_LAN_VLAN_ID _IOWR(GPIO_IOCTL_NUM, 9, int *)
+#define IOCTL_WAN_VLAN_ID _IOWR(GPIO_IOCTL_NUM, 10, int *)
+#define IOCTL_3G_LED_STATE _IOWR(GPIO_IOCTL_NUM, 11, int *) //Foxconn added, Neil Chen, 2009/11/2
+/* Foxconn added start Bob, 01/28/2010, for wan detection */
+#define IOCTL_PVC_DET_START _IOWR(GPIO_IOCTL_NUM, 12, int *)
+#define IOCTL_PVC_DET_STOP _IOWR(GPIO_IOCTL_NUM, 13, int *)
+#define IOCTL_PVC_DET_RESULT _IOWR(GPIO_IOCTL_NUM, 14, int *)
+/* Foxconn added end Bob, 01/28/2010, for wan detection */
+#define IOCTL_LAN_UNTAGGED_VLAN_ID _IOWR(GPIO_IOCTL_NUM, 15, int *) /* Foxconn added Bob, 10/25/2010, for tag based vlan */
+
+#endif /* __GPIO_DRV_H__ */
diff --git a/shared/opensource/include/bcm963xx/wan_det.h b/shared/opensource/include/bcm963xx/wan_det.h
new file mode 100755
index 0000000..d8a5645
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/wan_det.h
@@ -0,0 +1,245 @@
+/***************************************************************************
+***
+*** Copyright 2008 Hon Hai Precision Ind. Co. Ltd.
+*** All Rights Reserved.
+*** No portions of this material shall be reproduced in any form without the
+*** written permission of Hon Hai Precision Ind. Co. Ltd.
+***
+*** All information contained in this document is Hon Hai Precision Ind.
+*** Co. Ltd. company private, proprietary, and trade secret property and
+*** are protected by international intellectual property laws and treaties.
+***
+****************************************************************************/
+
+#ifndef __WAN_DET_H__
+#define __WAN_DET_H__
+
+/* Foxconn added start Bob, 01/22/2010 */
+
+#define MAX_SCAN_SERVICE 8
+
+typedef struct _vpivcitable
+{
+ int portId;
+ int vpi;
+ int vci;
+}_VpiVciTable;
+
+
+typedef struct scanResult
+{
+ _VpiVciTable service[MAX_SCAN_SERVICE];
+ _VpiVciTable oam;
+ _VpiVciTable BPDU;
+}SCAN_RESULT;
+/* Foxconn added end Bob, 01/22/2010 */
+
+typedef unsigned short U16;
+typedef unsigned int U32;
+typedef unsigned char U8;
+
+#define PATTERN_ROUTED 0
+#define PATTERN_BRIDGED 1
+
+#define ETHER_TYPE_OFFSET 12
+#define ETHERTYPE_IP 0x0800
+#define ETHERTYPE_ARP 0x0806
+#define ETHERTYPE_PPPOE_DISCOVERY 0x8863
+#define ETHERHEADER_LEN 14
+
+typedef struct _PacketContent
+{
+ U32 length;
+ U8 *data;
+}PacketContent;
+
+typedef struct _Pattern
+{
+ const char *name;
+ const PacketContent *payload;
+ int protoType;
+ U16 ethertype;
+ const PacketContent *header;
+ const PacketContent *expected_payload;
+
+}Pattern;
+
+
+static U8 dhcp_request_bytes[] = {
+
+ // IP header
+ 0x45, 0x00, 0x01, 0x48, // version, IHL, TOS, Total Length
+ 0x00, 0x04, 0x00, 0x00, // ident, flags, frag off
+ 0x9b, 0x11, 0x1e, 0xa2, // TTL, proto, hdr checksum
+ 0x00, 0x00, 0x00, 0x00, // source addr
+ 0xff, 0xff, 0xff, 0xff, // destination addr
+
+ // UDP header
+ 0x00, 0x44, 0x00, 0x43, 0x01, 0x34, 0xe6, 0x9a, 0x01, 0x01, 0x06, 0x00,
+ 0xb3, 0x05, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x2b, 0x00, 0x74, 0xb1, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, 0x53, 0x63, 0x35, 0x01, 0x01, 0x33,
+ 0x04, 0x00, 0x00, 0x1c, 0x20, 0x37, 0x07, 0x01, 0x1c, 0x02, 0x03, 0x0f, 0x06, 0x0c, 0xff, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+
+};
+
+static PacketContent dhcp_request = { sizeof(dhcp_request_bytes), dhcp_request_bytes
+};
+
+static U8 pppoe_padi_bytes[] = {
+ 0x11, 0x09, 0x00, 0x00, 0x00, 0x04, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+static PacketContent pppoe_padi = { sizeof(pppoe_padi_bytes), pppoe_padi_bytes };
+
+/** Sequence of bytes for a PPP LCP Configure-Request (RFC1661). */
+static U8 ppp_lcp_confreq_bytes[] = {
+ 0xc0, 0x21, // LCP
+ 0x01, // Configure Request
+ 0x99, // randomish identifier
+ 0x00, 0x04, // length
+};
+static PacketContent ppp_lcp_confreq = { sizeof(ppp_lcp_confreq_bytes), ppp_lcp_confreq_bytes };
+
+/** Expected response from NULL (aka VcMux) encapsulated PPP/LCP */
+static U8 ppp_lcp_response_bytes[] = { 0xc0, 0x21 };
+static PacketContent ppp_lcp_response = { sizeof(ppp_lcp_response_bytes), ppp_lcp_response_bytes };
+
+/** SNAP/LLC routed */
+static U8 snap_llc_routed_bytes[] = { 0xaa, 0xaa, 3, 0, 0, 0, 8, 0 };
+static PacketContent snap_llc_routed = { sizeof(snap_llc_routed_bytes), snap_llc_routed_bytes };
+
+/** SNAP/LLC bridged, no fcs */
+static U8 snap_llc_bridged_bytes[] = {
+ 0xaa, 0xaa, 0x3, // LLC
+ 0x0, 0x80, 0xc2, // OUI
+ 0x00, 0x07, // PID
+ 0x00, 0x00 // PAD
+ };
+static PacketContent snap_llc_bridged = { sizeof(snap_llc_bridged_bytes), snap_llc_bridged_bytes };
+
+/* foxconn added start Bob, 12/07/2009, ignore BPDU frame */
+/** SNAP/LLC bridged BPDU */
+static U8 snap_llc_bridged_BPDU_bytes[] = {
+ 0xaa, 0xaa, 0x3, // LLC
+ 0x0, 0x80, 0xc2, // OUI
+ 0x00, 0x0e, // PID
+ };
+ /* foxconn added end Bob, 12/07/2009, ignore BPDU frame */
+
+/** LLC for PPPoA. See RFC2364 section 6. */
+static U8 llc_pppoa_bytes[] = { 0xfe, 0xfe, 0x03, 0xcf };
+static PacketContent llc_pppoa = {
+ sizeof(llc_pppoa_bytes), llc_pppoa_bytes
+};
+
+static U8 vcmux_bridged_bytes[] = { 0, 0 };
+static PacketContent vcmux_bridged = { sizeof(vcmux_bridged_bytes), vcmux_bridged_bytes };
+
+/**
+Patterns to be sent to CO side
+1. PPPoE LLC Bridged
+2. VcMux encapsulated PPPoA
+3. LLC encapsulated PPPoA
+4. RFC1483 SNAP/LLC Routed
+5. RFC1483 VcMux Bridged
+6. PPPoE VCMux Bridged
+7. RFC1483 SNAP/LLC Bridged
+8. RFC1483 VcMux Routed
+*/
+static Pattern patterns[] =
+{
+ {
+ "PPPoE LLC Bridged",
+ &pppoe_padi,
+ PATTERN_BRIDGED,
+ ETHERTYPE_PPPOE_DISCOVERY,
+ &snap_llc_bridged,
+ NULL
+ },
+ {
+ "VcMux encapsulated PPPoA",
+ &ppp_lcp_confreq,
+ PATTERN_ROUTED,
+ 0, // no need for etherheader!
+ NULL,
+ &ppp_lcp_response
+ },
+
+ {
+ "LLC encapsulated PPPoA",
+ &ppp_lcp_confreq,
+ PATTERN_ROUTED,
+ 0, // no need for etherheader!
+ &llc_pppoa, // encapsulated with PPPoA LLC header
+ NULL
+ },
+
+ /* RFC1483 SNAP/LLC routed */
+ {
+ "RFC1483 SNAP/LLC Routed",
+ &dhcp_request,
+ PATTERN_ROUTED,
+ 0,
+ &snap_llc_routed,
+ NULL
+ },
+
+ /* RFC1483 VC mux bridged */
+ {
+ "RFC1483 VcMux Bridged",
+ &dhcp_request,
+ PATTERN_BRIDGED,
+ ETHERTYPE_IP,
+ &vcmux_bridged,
+ NULL
+ },
+
+ /* PPPOE VCMux Bridged*/
+ {
+ "PPPoE VCMux Bridged",
+ &pppoe_padi,
+ PATTERN_BRIDGED,
+ ETHERTYPE_PPPOE_DISCOVERY,
+ &vcmux_bridged,
+ NULL
+ },
+
+ /* RFC1483 SNAP/LLC bridged */
+ {
+ "RFC1483 SNAP/LLC Bridged",
+ &dhcp_request,
+ PATTERN_BRIDGED,
+ ETHERTYPE_IP,
+ &snap_llc_bridged,
+ NULL
+ },
+
+ /* RFC1483 VC mux routed */
+ {
+ "RFC1483 VcMux Routed",
+ &dhcp_request,
+ PATTERN_ROUTED,
+ 0,
+ NULL,
+ NULL
+ },
+};
+
+#endif /* __WAN_DET_H__ */
diff --git a/shared/opensource/include/bcm963xx/wps_led.h b/shared/opensource/include/bcm963xx/wps_led.h
new file mode 100755
index 0000000..69f8682
--- /dev/null
+++ b/shared/opensource/include/bcm963xx/wps_led.h
@@ -0,0 +1,28 @@
+/***************************************************************************
+***
+*** Copyright 2007 Hon Hai Precision Ind. Co. Ltd.
+*** All Rights Reserved.
+*** No portions of this material shall be reproduced in any form without the
+*** written permission of Hon Hai Precision Ind. Co. Ltd.
+***
+*** All information contained in this document is Hon Hai Precision Ind.
+*** Co. Ltd. company private, proprietary, and trade secret property and
+*** are protected by international intellectual property laws and treaties.
+***
+****************************************************************************/
+
+#ifndef __WPS_LED_H__
+#define __WPS_LED_H__
+
+#define DEV_GPIO_DRV "wps_led"
+
+#define WPS_LED_IOCTL_NUM 'W'
+
+#define WPS_LED_BLINK_NORMAL _IOWR(WPS_LED_IOCTL_NUM, 0, int *)
+#define WPS_LED_BLINK_QUICK _IOWR(WPS_LED_IOCTL_NUM, 1, int *)
+#define WPS_LED_BLINK_OFF _IOWR(WPS_LED_IOCTL_NUM, 2, int *)
+#define WPS_LED_CHANGE_GREEN _IOWR(WPS_LED_IOCTL_NUM, 3, int *)
+#define WPS_LED_CHANGE_AMBER _IOWR(WPS_LED_IOCTL_NUM, 4, int *)
+#define WPS_LED_BLINK_QUICK2 _IOWR(WPS_LED_IOCTL_NUM, 5, int *)
+
+#endif
diff --git a/shared/opensource/spi/Makefile b/shared/opensource/spi/Makefile
new file mode 100755
index 0000000..b3eb2b1
--- /dev/null
+++ b/shared/opensource/spi/Makefile
@@ -0,0 +1,30 @@
+
+ifeq ($(CONFIG_MIPS_BRCM),y)
+
+ifeq ($(strip $(BRCM_CHIP)),6362)
+obj-y += \
+ bcmHsSpi.o
+else
+ifeq ($(strip $(BRCM_CHIP)),6816)
+obj-y += \
+ bcmHsSpi.o
+else
+ifeq ($(strip $(BRCM_CHIP)),6328)
+obj-y += \
+ bcmHsSpi.o
+endif
+endif
+endif
+
+ifneq ($(strip $(BRCM_CHIP)),6328)
+obj-y += \
+ bcmLegSpi.o
+endif
+
+obj-y += \
+ bcmSpiRes.o
+
+EXTRA_CFLAGS += -DCONFIG_BCM9$(BRCM_CHIP) -I$(INC_BRCMDRIVER_PUB_PATH)/$(BRCM_BOARD) -I$(INC_BRCMSHARED_PUB_PATH)/$(BRCM_BOARD)
+
+endif
+
diff --git a/shared/opensource/spi/bcmHsSpi.c b/shared/opensource/spi/bcmHsSpi.c
new file mode 100755
index 0000000..b32e9fc
--- /dev/null
+++ b/shared/opensource/spi/bcmHsSpi.c
@@ -0,0 +1,898 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+#ifdef _CFE_
+#include "lib_types.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "bcm_map.h"
+#define printk printf
+#else
+#include <linux/autoconf.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/clk.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/delay.h>
+#include <linux/dma-mapping.h>
+#include <linux/err.h>
+#include <linux/interrupt.h>
+#include <linux/spi/spi.h>
+
+#include <bcm_map_part.h>
+#include <bcm_intr.h>
+#endif
+
+/* if HS_SPI is defined then the HS SPI controller is available, otherwise do not compile this code */
+
+#ifdef HS_SPI
+
+#include "bcmSpiRes.h"
+#include "bcmSpi.h"
+
+int BcmHsSpiRead(unsigned char * msg_buf, int prependcnt, int nbytes, int devId, int freqHz);
+int BcmHsSpiWrite(unsigned char * msg_buf, int nbytes, int devId, int freqHz);
+
+#define HS_SPI_STATE_CLOCK_POLARITY (1 << 31)
+#define HS_SPI_STATE_GATE_CLOCK_SSOFF (1 << 30)
+#define HS_SPI_STATE_LAUNCH_RISING (1 << 29)
+#define HS_SPI_STATE_LATCH_RISING (1 << 28)
+#define HS_SPI_STATE_ASYNC_CLOCK (1 << 27)
+#if defined(_BCM96816_) || defined(CONFIG_BCM96816)
+#define HS_SPI_CONTROLLER_STATE_DEF (HS_SPI_STATE_GATE_CLOCK_SSOFF)
+#endif
+#if defined(_BCM96328_) || defined(CONFIG_BCM96328)
+#define HS_SPI_CONTROLLER_STATE_DEF (HS_SPI_STATE_GATE_CLOCK_SSOFF | HS_SPI_STATE_LATCH_RISING)
+#endif
+#if defined(_BCM96362_) || defined(CONFIG_BCM96362)
+#define HS_SPI_CONTROLLER_STATE_DEF (HS_SPI_STATE_GATE_CLOCK_SSOFF | HS_SPI_STATE_LATCH_RISING | HS_SPI_STATE_ASYNC_CLOCK)
+#endif
+
+
+#ifndef _CFE_
+//#define HS_SPI_USE_INTERRUPTS /* define this to use interrupts instead of polling */
+static struct bcmspi BcmHsSpi = { SPIN_LOCK_UNLOCKED,
+ "bcmHsSpiDev",
+ };
+#else
+#define udelay(X) \
+ do { { int i; for( i = 0; i < (X) * 500; i++ ) ; } } while(0)
+#endif
+
+static int hsSpiRead( unsigned char *pRxBuf, int prependcnt, int nbytes, int devId )
+{
+ uint16 msgCtrl;
+
+ HS_SPI_PROFILES[devId].mode_ctrl = prependcnt<<HS_SPI_PREPENDBYTE_CNT | 0<<HS_SPI_MODE_ONE_WIRE |
+ 0<<HS_SPI_MULTIDATA_WR_SIZE | 0<<HS_SPI_MULTIDATA_RD_SIZE | 2<<HS_SPI_MULTIDATA_WR_STRT |
+ 2<<HS_SPI_MULTIDATA_RD_STRT | 0xff<<HS_SPI_FILLBYTE;
+
+ msgCtrl = (HS_SPI_OP_READ<<HS_SPI_OP_CODE) | nbytes;
+ memcpy((char *)HS_SPI_FIFO0, (void *)(&msgCtrl), 2);
+
+ if ( 0 != prependcnt )
+ {
+ memcpy((char *)(HS_SPI_FIFO0+2), (char *)pRxBuf, prependcnt);
+ }
+
+ HS_SPI_PINGPONG0->command = devId<<HS_SPI_SS_NUM | devId<<HS_SPI_PROFILE_NUM | 0<<HS_SPI_TRIGGER_NUM |
+ HS_SPI_COMMAND_START_NOW<<HS_SPI_COMMAND_VALUE;
+
+ return SPI_STATUS_OK;
+
+}
+
+static int hsSpiWriteFull( unsigned char *pTxBuf, int nbytes, int devId, int opcode )
+{
+ uint16 msgCtrl;
+
+ HS_SPI_PROFILES[devId].mode_ctrl = 0<<HS_SPI_PREPENDBYTE_CNT | 0<<HS_SPI_MODE_ONE_WIRE |
+ 0<<HS_SPI_MULTIDATA_WR_SIZE | 0<<HS_SPI_MULTIDATA_RD_SIZE | 2<<HS_SPI_MULTIDATA_WR_STRT |
+ 2<<HS_SPI_MULTIDATA_RD_STRT | 0xff<<HS_SPI_FILLBYTE;
+
+ if (BCM_SPI_FULL == opcode)
+ {
+ msgCtrl = (HS_SPI_OP_READ_WRITE<<HS_SPI_OP_CODE) | nbytes;
+ }
+ else
+ {
+ msgCtrl = (HS_SPI_OP_WRITE<<HS_SPI_OP_CODE) | nbytes;
+ }
+ memcpy((char *)HS_SPI_FIFO0, (void *)(&msgCtrl), 2);
+ memcpy((char *)(HS_SPI_FIFO0+2), (void *)pTxBuf, nbytes);
+
+ HS_SPI_PINGPONG0->command = devId<<HS_SPI_SS_NUM | devId<<HS_SPI_PROFILE_NUM | 0<<HS_SPI_TRIGGER_NUM |
+ HS_SPI_COMMAND_START_NOW<<HS_SPI_COMMAND_VALUE;
+
+ return SPI_STATUS_OK;
+
+}
+
+static int hsSpiTransEnd( unsigned char *rxBuf, int nbytes )
+{
+ if ( NULL != rxBuf )
+ {
+ memcpy((char *)rxBuf, (void *)HS_SPI_FIFO0, nbytes);
+ }
+
+ return SPI_STATUS_OK;
+
+}
+
+static int hsSpiTransPoll(void)
+{
+ unsigned int wait;
+
+ for (wait = (100*1000); wait>0; wait--)
+ {
+ if (!(HS_SPI_PINGPONG0->status & 1<<HS_SPI_SOURCE_BUSY ))
+ {
+ break;
+ }
+ udelay(1);
+ }
+
+ if (wait == 0)
+ {
+ return SPI_STATUS_ERR;
+ }
+
+ return SPI_STATUS_OK;
+}
+
+
+static void hsSpiClearIntStatus(void)
+{
+ HS_SPI->hs_spiIntStatus = HS_SPI_INTR_CLEAR_ALL;
+}
+
+#ifdef HS_SPI_USE_INTERRUPTS
+static void hsSpiEnableInt(bool bEnable)
+{
+ if ( bEnable )
+ {
+ HS_SPI->hs_spiIntMask = HS_SPI_IRQ_PING0_CMD_DONE;
+ }
+ else
+ {
+ HS_SPI->hs_spiIntMask = 0;
+ }
+}
+#endif
+
+#ifndef _CFE_
+static int hsSpiSetClock( int clockHz, int profile )
+{
+ int clock;
+
+ clock = HS_SPI_PLL_FREQ/clockHz;
+ if (HS_SPI_PLL_FREQ%HS_SPI_CLOCK_DEF)
+ clock++;
+
+ clock = 2048/clock;
+ if (2048%(clock))
+ clock++;
+
+ HS_SPI_PROFILES[profile].clk_ctrl = 1<<HS_SPI_ACCUM_RST_ON_LOOP | 0<<HS_SPI_SPI_CLK_2X_SEL | clock<<HS_SPI_FREQ_CTRL_WORD;
+
+ return SPI_STATUS_OK;
+}
+
+static void hsSpiSetControllerState(unsigned int ctrlState, unsigned char devId)
+{
+ unsigned int temp32;
+
+ temp32 = HS_SPI->hs_spiGlobalCtrl;
+ if ( 0 == (ctrlState & HS_SPI_STATE_GATE_CLOCK_SSOFF) )
+ {
+ temp32 &= ~HS_SPI_CLK_GATE_SSOFF;
+ }
+ else
+ {
+ temp32 |= HS_SPI_CLK_GATE_SSOFF;
+ }
+#if defined(_BCM96328_) || defined(CONFIG_BCM96328) || defined(_BCM96362_) || defined(CONFIG_BCM96362)
+ if ( 0 == (ctrlState & HS_SPI_STATE_CLOCK_POLARITY) )
+ {
+ temp32 &= ~HS_SPI_CLK_POLARITY;
+ }
+ else
+ {
+ temp32 |= HS_SPI_CLK_POLARITY;
+ }
+#endif
+ /* write value if required */
+ if ( temp32 != HS_SPI->hs_spiGlobalCtrl )
+ {
+ HS_SPI->hs_spiGlobalCtrl = temp32;
+ }
+
+ temp32 = HS_SPI_PROFILES[devId].signal_ctrl;
+ if ( 0 == (ctrlState & HS_SPI_STATE_LATCH_RISING) )
+ {
+ temp32 &= ~HS_SPI_LATCH_RISING;
+ }
+ else
+ {
+ temp32 |= HS_SPI_LATCH_RISING;
+ }
+ if ( 0 == (ctrlState & HS_SPI_STATE_LAUNCH_RISING) )
+ {
+ temp32 &= ~HS_SPI_LAUNCH_RISING;
+ }
+ else
+ {
+ temp32 |= HS_SPI_LAUNCH_RISING;
+ }
+
+#if defined(_BCM96328_) || defined(CONFIG_BCM96328) || defined(_BCM96362_) || defined(CONFIG_BCM96362)
+ if ( 0 == (ctrlState & HS_SPI_STATE_ASYNC_CLOCK) )
+ {
+ temp32 &= ~HS_SPI_ASYNC_INPUT_PATH;
+ }
+ else
+ {
+ temp32 |= HS_SPI_ASYNC_INPUT_PATH;
+ }
+#endif
+
+ /* write value if required */
+ if ( temp32 != HS_SPI_PROFILES[devId].signal_ctrl )
+ {
+ HS_SPI_PROFILES[devId].signal_ctrl = temp32;
+ }
+
+}
+#endif
+
+/* these interfaces are availble for the CFE and spi flash driver only
+ all modules must use the linux kernel framework
+ if this is called by a module and interrupts are being used there will
+ be a problem */
+int BcmHsSpiRead( unsigned char *msg_buf, int prependcnt, int nbytes, int devId, int freqHz )
+{
+#ifndef _CFE_
+ struct bcmspi *pBcmSpi = &BcmHsSpi;
+
+ if ( pBcmSpi->irq )
+ {
+ printk("BcmHsSpiRead error - Interrupts are enabled\n");
+ return( SPI_STATUS_ERR );
+ }
+
+ spin_lock(&pBcmSpi->lock);
+ hsSpiSetControllerState(HS_SPI_CONTROLLER_STATE_DEF, devId);
+ hsSpiSetClock(freqHz, devId);
+#endif
+ hsSpiClearIntStatus();
+ hsSpiRead(msg_buf, prependcnt, nbytes, devId);
+ hsSpiTransPoll();
+ hsSpiTransEnd(msg_buf, nbytes);
+ hsSpiClearIntStatus();
+#ifndef _CFE_
+ spin_unlock(&pBcmSpi->lock);
+#endif
+
+ return( SPI_STATUS_OK );
+}
+
+int BcmHsSpiWrite( unsigned char *msg_buf, int nbytes, int devId, int freqHz )
+{
+#ifndef _CFE_
+ struct bcmspi *pBcmSpi = &BcmHsSpi;
+
+ if ( pBcmSpi->irq )
+ {
+ printk("BcmHsSpiWrite error - Interrupts are enabled\n");
+ return( SPI_STATUS_ERR );
+ }
+
+ spin_lock(&pBcmSpi->lock);
+ hsSpiSetControllerState(HS_SPI_CONTROLLER_STATE_DEF, devId);
+ hsSpiSetClock(freqHz, devId);
+#endif
+ hsSpiClearIntStatus();
+ hsSpiWriteFull(msg_buf, nbytes, devId, BCM_SPI_WRITE);
+ hsSpiTransPoll();
+ hsSpiTransEnd(msg_buf, nbytes);
+ hsSpiClearIntStatus();
+#ifndef _CFE_
+ spin_unlock(&pBcmSpi->lock);
+#endif
+
+ return( SPI_STATUS_OK );
+}
+
+
+#ifndef _CFE_
+static void hsSpiNextMessage(struct bcmspi *pBcmSpi);
+
+static void hsSpiMsgDone(struct bcmspi *pBcmSpi, struct spi_message *msg, int status)
+{
+ list_del(&msg->queue);
+ msg->status = status;
+
+ spin_unlock(&pBcmSpi->lock);
+ msg->complete(msg->context);
+ spin_lock(&pBcmSpi->lock);
+
+ pBcmSpi->curTrans = NULL;
+
+ /* continue if needed */
+ if (list_empty(&pBcmSpi->queue) || pBcmSpi->stopping)
+ {
+ // disable controler ...
+ }
+ else
+ {
+ hsSpiNextMessage(pBcmSpi);
+ }
+}
+
+#ifdef HS_SPI_USE_INTERRUPTS
+static void hsSpiIntXfer(struct bcmspi *pBcmSpi, struct spi_message *msg)
+{
+ struct spi_transfer *xfer;
+ struct spi_transfer *nextXfer;
+ int length;
+ int prependCnt;
+ char *pTxBuf;
+ char *pRxBuf;
+ int opCode;
+
+ xfer = pBcmSpi->curTrans;
+ if ( NULL == xfer)
+ {
+ xfer = list_entry(msg->transfers.next, struct spi_transfer, transfer_list);
+ }
+ else
+ {
+ xfer = list_entry(xfer->transfer_list.next, struct spi_transfer, transfer_list);
+ }
+ pBcmSpi->curTrans = xfer;
+
+ length = xfer->len;
+ prependCnt = 0;
+ pRxBuf = xfer->rx_buf;
+ pTxBuf = (unsigned char *)xfer->tx_buf;
+
+ if ( (NULL != pRxBuf) && (NULL != pTxBuf) )
+ {
+ opCode = BCM_SPI_FULL;
+ }
+ else if ( NULL != pRxBuf )
+ {
+ opCode = BCM_SPI_READ;
+ }
+ else
+ {
+ opCode = BCM_SPI_WRITE;
+ }
+
+ if ( msg->state )
+ {
+ /* this controller does not support keeping the chip select active for all transfers
+ non NULL state indicates that we need to combine the transfers */
+ nextXfer = list_entry(xfer->transfer_list.next, struct spi_transfer, transfer_list);
+ prependCnt = length;
+ length = nextXfer->len;
+ pRxBuf = nextXfer->rx_buf;
+ opCode = BCM_SPI_READ;
+ pBcmSpi->curTrans = nextXfer;
+ }
+
+ hsSpiSetClock(xfer->speed_hz, msg->spi->chip_select);
+
+ hsSpiClearIntStatus();
+ hsSpiEnableInt(TRUE);
+ if ( BCM_SPI_READ == opCode )
+ {
+ hsSpiRead(pTxBuf, prependCnt, length, msg->spi->chip_select);
+ }
+ else
+ {
+ hsSpiWriteFull(pTxBuf, length, msg->spi->chip_select, opCode);
+ }
+
+ return;
+
+}
+#endif
+
+static void hsSpiPollXfer(struct bcmspi *pBcmSpi, struct spi_message *msg)
+{
+ struct spi_transfer *xfer;
+ struct spi_transfer *nextXfer;
+ int length;
+ int prependCnt;
+ char *pTxBuf;
+ char *pRxBuf;
+ int opCode;
+
+ list_for_each_entry(xfer, &msg->transfers, transfer_list)
+ {
+ pBcmSpi->curTrans = xfer;
+ length = xfer->len;
+ prependCnt = 0;
+ pRxBuf = xfer->rx_buf;
+ pTxBuf = (unsigned char *)xfer->tx_buf;
+
+ if ( (NULL != pRxBuf) && (NULL != pTxBuf) )
+ {
+ opCode = BCM_SPI_FULL;
+ }
+ else if ( NULL != pRxBuf )
+ {
+ opCode = BCM_SPI_READ;
+ }
+ else
+ {
+ opCode = BCM_SPI_WRITE;
+ }
+
+ if ( msg->state )
+ {
+ /* this controller does not support keeping the chip select active for all transfers
+ non NULL state indicates that we need to combine the transfers */
+ nextXfer = list_entry(xfer->transfer_list.next, struct spi_transfer, transfer_list);
+ prependCnt = length;
+ length = nextXfer->len;
+ pRxBuf = nextXfer->rx_buf;
+ opCode = BCM_SPI_READ;
+ xfer = nextXfer;
+ }
+
+ hsSpiSetClock(xfer->speed_hz, msg->spi->chip_select);
+
+ hsSpiClearIntStatus();
+ if ( BCM_SPI_READ == opCode )
+ {
+ hsSpiRead(pTxBuf, prependCnt, length, msg->spi->chip_select);
+ }
+ else
+ {
+ hsSpiWriteFull(pTxBuf, length, msg->spi->chip_select, opCode);
+ }
+
+ hsSpiTransPoll();
+ hsSpiTransEnd(pRxBuf, length);
+ hsSpiClearIntStatus();
+
+ if (xfer->delay_usecs)
+ {
+ udelay(xfer->delay_usecs);
+ }
+
+ msg->actual_length += length;
+ }
+
+ hsSpiMsgDone(pBcmSpi, msg, SPI_STATUS_OK);
+
+}
+
+
+static void hsSpiNextXfer(struct bcmspi *pBcmSpi, struct spi_message *msg)
+{
+#ifdef HS_SPI_USE_INTERRUPTS
+ if (pBcmSpi->irq)
+ hsSpiIntXfer(pBcmSpi, msg);
+ else
+#endif
+ hsSpiPollXfer(pBcmSpi, msg);
+}
+
+static void hsSpiNextMessage(struct bcmspi *pBcmSpi)
+{
+ struct spi_message *msg;
+ unsigned int ctrlState;
+
+ BUG_ON(pBcmSpi->curTrans);
+
+ msg = list_entry(pBcmSpi->queue.next, struct spi_message, queue);
+
+ /* set the controller state for this message */
+ ctrlState = (unsigned int)spi_get_ctldata(msg->spi);
+ hsSpiSetControllerState(ctrlState, msg->spi->chip_select);
+
+ /* there will always be one transfer in a given message */
+ hsSpiNextXfer(pBcmSpi, msg);
+
+}
+
+
+static int hsSpiSetup(struct spi_device *spi)
+{
+ struct bcmspi *pBcmSpi;
+ unsigned int spiCtrlData;
+ unsigned int spiCtrlState = 0;
+
+ pBcmSpi = spi_master_get_devdata(spi->master);
+
+ if (pBcmSpi->stopping)
+ return -ESHUTDOWN;
+
+ spiCtrlData = (unsigned int)spi->controller_data;
+ if ( 0 == spiCtrlData )
+ {
+ spiCtrlState = HS_SPI_CONTROLLER_STATE_DEF;
+ }
+ else
+ {
+ spiCtrlState = 0;
+ /* note that in HW, the meaning of latch and launch bits changes when CPOl = 1 */
+ if ( (0 == (spi->mode & SPI_CPHA)) &&
+ (0 == (spiCtrlData & SPI_CONTROLLER_STATE_CPHA_EXT)) )
+ {
+ /* latch rising, launch falling */
+ spiCtrlState = HS_SPI_STATE_LATCH_RISING;
+ }
+ else if ( (0 == (spi->mode & SPI_CPHA)) &&
+ (0 != (spiCtrlData & SPI_CONTROLLER_STATE_CPHA_EXT)) )
+ {
+ /* latch rising, launch rising */
+ spiCtrlState = HS_SPI_STATE_LATCH_RISING | HS_SPI_STATE_LAUNCH_RISING;
+ }
+ else if ( (0 != (spi->mode & SPI_CPHA)) &&
+ (0 == (spiCtrlData & SPI_CONTROLLER_STATE_CPHA_EXT)) )
+ {
+ /* latch falling, launch rising */
+ spiCtrlState = HS_SPI_STATE_LAUNCH_RISING;
+ }
+ // else - both set to 0, latch falling, launch falling
+
+ if ( 0 != (spi->mode & SPI_CPOL) )
+ {
+ spiCtrlState |= HS_SPI_STATE_CLOCK_POLARITY;
+ }
+
+ if ( spiCtrlData & SPI_CONTROLLER_STATE_GATE_CLK_SSOFF )
+ {
+ spiCtrlState |= HS_SPI_STATE_GATE_CLOCK_SSOFF;
+ }
+
+ if ( spiCtrlData & SPI_CONTROLLER_STATE_ASYNC_CLOCK )
+ {
+ spiCtrlState |= HS_SPI_STATE_ASYNC_CLOCK;
+ }
+ }
+
+ spi_set_ctldata(spi, (void *)spiCtrlState);
+
+ return 0;
+}
+
+
+static int hsSpiTransfer(struct spi_device *spi, struct spi_message *msg)
+{
+ struct bcmspi *pBcmSpi = &BcmHsSpi;
+ struct spi_transfer *xfer;
+ struct spi_transfer *nextXfer;
+ int xferCnt;
+ int bCsChange;
+ int xferLen;
+
+ if (unlikely(list_empty(&msg->transfers)))
+ return -EINVAL;
+
+ if (pBcmSpi->stopping)
+ return -ESHUTDOWN;
+
+ /* make sure a completion callback is set */
+ if ( NULL == msg->complete )
+ {
+ return -EINVAL;
+ }
+
+ xferCnt = 0;
+ bCsChange = 0;
+ xferLen = 0;
+ list_for_each_entry(xfer, &msg->transfers, transfer_list)
+ {
+ /* check transfer parameters */
+ if (!(xfer->tx_buf || xfer->rx_buf))
+ {
+ return -EINVAL;
+ }
+
+ /* check the clock setting - if it is 0 then set to max clock of the device */
+ if ( 0 == xfer->speed_hz )
+ {
+ if ( 0 == spi->max_speed_hz )
+ {
+ return -EINVAL;
+ }
+ xfer->speed_hz = spi->max_speed_hz;
+ }
+
+ xferCnt++;
+ xferLen += xfer->len;
+ bCsChange |= xfer->cs_change;
+
+ if ( xfer->len > HS_SPI_BUFFER_LEN )
+ {
+ return -EINVAL;
+ }
+ }
+
+ /* this controller does not support keeping the chip select active between
+ transfers. If a message is detected with a write transfer followed by a
+ read transfer and cs_change is set to 0 then the two transfers need to be
+ combined. The message state is used to indicate that the transfers
+ need to be combined */
+ msg->state = NULL;
+ if ( (2 == xferCnt) && (0 == bCsChange) )
+ {
+ xfer = list_entry(msg->transfers.next, struct spi_transfer, transfer_list);
+ if ( (NULL != xfer->tx_buf) && (NULL == xfer->rx_buf))
+ {
+ nextXfer = list_entry(xfer->transfer_list.next, struct spi_transfer, transfer_list);;
+ if ( (NULL == nextXfer->tx_buf) && (NULL != nextXfer->rx_buf))
+ {
+ msg->state = (void *)1;
+ }
+ }
+ }
+
+ msg->status = -EINPROGRESS;
+ msg->actual_length = 0;
+
+#ifdef HS_SPI_USE_INTERRUPTS
+ /* disable interrupts for the SPI controller
+ using spin_lock_irqsave would disable all interrupts */
+ if ( pBcmSpi->irq )
+ hsSpiEnableInt(FALSE);
+#endif
+ spin_lock(&pBcmSpi->lock);
+
+ list_add_tail(&msg->queue, &pBcmSpi->queue);
+ if (NULL == pBcmSpi->curTrans)
+ {
+ hsSpiNextMessage(pBcmSpi);
+ }
+
+ spin_unlock(&pBcmSpi->lock);
+#ifdef HS_SPI_USE_INTERRUPTS
+ if ( pBcmSpi->irq )
+ hsSpiEnableInt(TRUE);
+#endif
+
+ return 0;
+}
+
+
+#ifdef HS_SPI_USE_INTERRUPTS
+static irqreturn_t hsSpiIntHandler(int irq, void *dev_id)
+{
+ struct bcmspi *pBcmSpi = dev_id;
+ struct spi_message *msg;
+ struct spi_transfer *xfer;
+
+ if ( 0 == HS_SPI->hs_spiIntStatusMasked )
+ {
+ return ( IRQ_NONE );
+ }
+
+ hsSpiClearIntStatus();
+ hsSpiEnableInt(FALSE);
+
+ spin_lock(&pBcmSpi->lock);
+ if ( NULL == pBcmSpi->curTrans )
+ {
+ spin_unlock(&pBcmSpi->lock);
+ return IRQ_HANDLED;
+ }
+
+ xfer = pBcmSpi->curTrans;
+ msg = list_entry(pBcmSpi->queue.next, struct spi_message, queue);
+
+ hsSpiTransEnd(xfer->rx_buf, xfer->len);
+
+ /* xfer can specify a delay before the next transfer is started
+ this delay would be processed here normally. However, delay in the
+ interrupt handler is bad so it is ignored. It is used for polling
+ mode */
+
+ /* check to see if this is the last transfer in the message */
+ if (msg->transfers.prev == &xfer->transfer_list)
+ {
+ /* report completed message */
+ hsSpiMsgDone(pBcmSpi, msg, SPI_STATUS_OK);
+ }
+ else
+ {
+ /* Submit the next transfer */
+ hsSpiNextXfer(pBcmSpi, msg);
+ }
+
+ spin_unlock(&pBcmSpi->lock);
+
+ return IRQ_HANDLED;
+
+}
+
+int __init hsSpiIntrInit( void )
+{
+ int ret = 0;
+ struct bcmspi *pBcmSpi = &BcmHsSpi;
+
+ hsSpiEnableInt(FALSE);
+ ret = request_irq(INTERRUPT_ID_SPI, hsSpiIntHandler, (IRQF_DISABLED | IRQF_SAMPLE_RANDOM | IRQF_SHARED), pBcmSpi->devName, pBcmSpi);
+
+ spin_lock(&pBcmSpi->lock);
+ pBcmSpi->irq = INTERRUPT_ID_SPI;
+ spin_unlock(&pBcmSpi->lock);
+
+ BcmHalInterruptEnable(pBcmSpi->irq);
+
+ return( 0 );
+
+}
+/* we cannot initialize interrupts early
+ The flash module is intialized before an interrupt handler can be installed
+ and before the Linux framework can be used. This means it needs direct access
+ to the controller initially. This conflicts with the interrupt handling so we
+ need to wait for all modules to intialize */
+late_initcall(hsSpiIntrInit);
+#endif
+
+static void hsSpiCleanup(struct spi_device *spi)
+{
+ /* would free spi_controller memory here if any was allocated */
+
+}
+
+static int __init hsSpiProbe(struct platform_device *pdev)
+{
+ int ret;
+ struct spi_master *master;
+ struct bcmspi *pBcmSpi;
+
+ ret = -ENOMEM;
+ master = spi_alloc_master(&pdev->dev, 0);
+ if (!master)
+ goto out_free;
+
+ master->bus_num = pdev->id;
+ master->num_chipselect = 8;
+ master->setup = hsSpiSetup;
+ master->transfer = hsSpiTransfer;
+ master->cleanup = hsSpiCleanup;
+ platform_set_drvdata(pdev, master);
+
+ spi_master_set_devdata(master, (void *)&BcmHsSpi);
+ pBcmSpi = spi_master_get_devdata(master);
+
+ INIT_LIST_HEAD(&pBcmSpi->queue);
+
+ pBcmSpi->pdev = pdev;
+ pBcmSpi->bus_num = HS_SPI_BUS_NUM;
+ pBcmSpi->num_chipselect = 8;
+ pBcmSpi->curTrans = NULL;
+
+ /* make sure irq is 0 here
+ since this is used to identify when interrupts are enabled
+ the IRQ is initialized in hsSpiIntrInit */
+ pBcmSpi->irq = 0;
+
+ /* Initialize the hardware */
+
+ /* register and we are done */
+ ret = spi_register_master(master);
+ if (ret)
+ goto out_free;
+
+ return 0;
+
+out_free:
+ spi_master_put(master);
+
+ return ret;
+}
+
+
+static int __exit hsSpiRemove(struct platform_device *pdev)
+{
+ struct spi_master *master = platform_get_drvdata(pdev);
+ struct bcmspi *pBcmSpi = spi_master_get_devdata(master);
+ struct spi_message *msg;
+
+ /* reset the hardware and block queue progress */
+#ifdef HS_SPI_USE_INTERRUPTS
+ hsSpiEnableInt(FALSE);
+#endif
+ spin_lock(&pBcmSpi->lock);
+ pBcmSpi->stopping = 1;
+
+ /* HW shutdown */
+
+ spin_unlock(&pBcmSpi->lock);
+
+ /* Terminate remaining queued transfers */
+ list_for_each_entry(msg, &pBcmSpi->queue, queue)
+ {
+ msg->status = -ESHUTDOWN;
+ msg->complete(msg->context);
+ }
+
+#ifdef HS_SPI_USE_INTERRUPTS
+ if ( pBcmSpi->irq )
+ {
+ free_irq(pBcmSpi->irq, master);
+ }
+#endif
+ spi_unregister_master(master);
+
+ return 0;
+}
+
+//#ifdef CONFIG_PM
+#if 0
+static int hsSpiSuspend(struct platform_device *pdev, pm_message_t mesg)
+{
+ struct spi_master *master = platform_get_drvdata(pdev);
+ struct bcmspi *pBcmSpi = spi_master_get_devdata(master);
+
+ return 0;
+}
+
+static int hsSpiResume(struct platform_device *pdev)
+{
+ struct spi_master *master = platform_get_drvdata(pdev);
+ struct bcmspi *pBcmSpi = spi_master_get_devdata(master);
+
+ return 0;
+}
+#else
+#define hsSpiSuspend NULL
+#define hsSpiResume NULL
+#endif
+
+static struct platform_device bcm_hsspi_device = {
+ .name = "bcmhs_spi",
+ .id = HS_SPI_BUS_NUM,
+};
+
+static struct platform_driver bcm_hsspi_driver = {
+ .driver =
+ {
+ .name = "bcmhs_spi",
+ .owner = THIS_MODULE,
+ },
+ .suspend = hsSpiSuspend,
+ .resume = hsSpiResume,
+ .remove = __exit_p(hsSpiRemove),
+};
+
+int __init hsSpiModInit( void )
+{
+ platform_device_register(&bcm_hsspi_device);
+ return platform_driver_probe(&bcm_hsspi_driver, hsSpiProbe);
+
+}
+subsys_initcall(hsSpiModInit);
+#endif
+
+#endif /* HS_SPI */
+
diff --git a/shared/opensource/spi/bcmLegSpi.c b/shared/opensource/spi/bcmLegSpi.c
new file mode 100755
index 0000000..6d1a391
--- /dev/null
+++ b/shared/opensource/spi/bcmLegSpi.c
@@ -0,0 +1,774 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+#ifdef _CFE_
+#include "lib_types.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "bcm_map.h"
+#define printk printf
+#else
+#include <linux/autoconf.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/clk.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/delay.h>
+#include <linux/dma-mapping.h>
+#include <linux/err.h>
+#include <linux/interrupt.h>
+#include <linux/spi/spi.h>
+
+#include <bcm_map_part.h>
+#include <bcm_intr.h>
+#endif
+
+/* if SPI is defined then the legacy SPI controller is available, otherwise do not compile this code */
+#ifdef SPI
+
+#include "bcmSpiRes.h"
+#include "bcmSpi.h"
+
+int BcmLegSpiRead(unsigned char * msg_buf, int prependcnt, int nbytes, int devId, int freqHz);
+int BcmLegSpiWrite(unsigned char * msg_buf, int nbytes, int devId, int freqHz);
+
+#ifndef _CFE_
+//#define LEG_SPI_USE_INTERRUPTS /* define this to use interrupts instead of polling */
+static struct bcmspi BcmLegSpi = { SPIN_LOCK_UNLOCKED,
+ "bcmLegSpiDev",
+ };
+#endif
+
+/* following are the frequency tables for the SPI controllers
+ they are ordered by frequency in descending order with column
+ 2 represetning the register value */
+#define LEG_SPI_FREQ_TABLE_SIZE 7
+int legSpiClockFreq[LEG_SPI_FREQ_TABLE_SIZE][2] = {
+ { 20000000, 0},
+ { 12500000, 6},
+ { 6250000, 5},
+ { 3125000, 4},
+ { 1563000, 3},
+ { 781000, 2},
+ { 391000, 1} };
+
+static int legSpiRead( unsigned char *pRxBuf, int prependcnt, int nbytes, int devId )
+{
+ int i;
+
+ SPI->spiMsgCtl = (HALF_DUPLEX_R << SPI_MSG_TYPE_SHIFT) | (nbytes << SPI_BYTE_CNT_SHIFT);
+
+ for (i = 0; i < prependcnt; i++)
+ {
+ SPI->spiMsgData[i] = pRxBuf[i];
+ }
+
+ SPI->spiCmd = (SPI_CMD_START_IMMEDIATE << SPI_CMD_COMMAND_SHIFT |
+ devId << SPI_CMD_DEVICE_ID_SHIFT |
+ prependcnt << SPI_CMD_PREPEND_BYTE_CNT_SHIFT |
+ 0 << SPI_CMD_ONE_BYTE_SHIFT);
+
+ return SPI_STATUS_OK;
+
+}
+
+static int legSpiWriteFull( unsigned char *pTxBuf, int nbytes, int devId, int opcode )
+{
+ int i;
+
+ if ( opcode == BCM_SPI_FULL )
+ {
+ SPI->spiMsgCtl = (FULL_DUPLEX_RW << SPI_MSG_TYPE_SHIFT) | (nbytes << SPI_BYTE_CNT_SHIFT);
+ }
+ else
+ {
+ SPI->spiMsgCtl = (HALF_DUPLEX_W << SPI_MSG_TYPE_SHIFT) | (nbytes << SPI_BYTE_CNT_SHIFT);
+ }
+
+ for (i = 0; i < nbytes; i++)
+ {
+ SPI->spiMsgData[i] = pTxBuf[i];
+ }
+
+ SPI->spiCmd = (SPI_CMD_START_IMMEDIATE << SPI_CMD_COMMAND_SHIFT |
+ devId << SPI_CMD_DEVICE_ID_SHIFT |
+ 0 << SPI_CMD_PREPEND_BYTE_CNT_SHIFT |
+ 0 << SPI_CMD_ONE_BYTE_SHIFT);
+
+ return SPI_STATUS_OK;
+
+}
+
+
+static int legSpiTransEnd( unsigned char *rxBuf, int nbytes )
+{
+ int i;
+ if ( NULL != rxBuf )
+ {
+ for (i = 0; i < nbytes; i++)
+ {
+ rxBuf[i] = SPI->spiRxDataFifo[i];
+ }
+ }
+
+ return SPI_STATUS_OK;
+
+}
+
+static int legSpiTransPoll(void)
+{
+ while ( 1 )
+ {
+ if ( SPI->spiIntStatus & SPI_INTR_CMD_DONE )
+ {
+ break;
+ }
+ }
+
+ return SPI_STATUS_OK;
+}
+
+static void legSpiClearIntStatus(void)
+{
+ SPI->spiIntStatus = SPI_INTR_CLEAR_ALL;
+}
+
+#ifdef LEG_SPI_USE_INTERRUPTS
+static void legSpiEnableInt(bool bEnable)
+{
+ if ( bEnable )
+ {
+ SPI->spiIntMask = SPI_INTR_CMD_DONE;
+ }
+ else
+ {
+ SPI->spiIntMask = 0;
+ }
+}
+#endif
+
+#ifndef _CFE_
+static int legSpiSetClock( int clockHz )
+{
+ int i;
+ int clock = -1;
+
+ for( i = 0; i < LEG_SPI_FREQ_TABLE_SIZE; i++ )
+ {
+ /* look for the closest frequency that is less than the frequency passed in */
+ if ( legSpiClockFreq[i][0] <= clockHz )
+ {
+ clock = legSpiClockFreq[i][1];
+ break;
+ }
+ }
+ /* if no clock was found set to default */
+ if ( -1 == clock )
+ {
+ clock = LEG_SPI_CLOCK_DEF;
+ }
+ SPI->spiClkCfg = (SPI->spiClkCfg & ~SPI_CLK_MASK) | clock;
+
+ return SPI_STATUS_OK;
+}
+#endif
+
+/* these interfaces are availble for the CFE and spi flash driver only
+ all modules must use the linux kernel framework
+ if this is called by a module and interrupts are being used there will
+ be a problem */
+int BcmLegSpiRead( unsigned char *msg_buf, int prependcnt, int nbytes, int devId, int freqHz )
+{
+#ifndef _CFE_
+ struct bcmspi *pBcmSpi = &BcmLegSpi;
+
+ if ( pBcmSpi->irq )
+ {
+ printk("BcmLegSpiRead error - SPI Interrupts are enabled\n");
+ return( SPI_STATUS_ERR );
+ }
+
+ spin_lock(&pBcmSpi->lock);
+ legSpiSetClock(freqHz);
+#endif
+ legSpiClearIntStatus();
+ legSpiRead(msg_buf, prependcnt, nbytes, devId);
+ legSpiTransPoll();
+ legSpiTransEnd(msg_buf, nbytes);
+ legSpiClearIntStatus();
+#ifndef _CFE_
+ spin_unlock(&pBcmSpi->lock);
+#endif
+
+ return( SPI_STATUS_OK );
+}
+
+int BcmLegSpiWrite( unsigned char *msg_buf, int nbytes, int devId, int freqHz )
+{
+#ifndef _CFE_
+ struct bcmspi *pBcmSpi = &BcmLegSpi;
+
+ if ( pBcmSpi->irq )
+ {
+ printk("BcmLegSpiWrite error - SPI Interrupts are enabled\n");
+ return( SPI_STATUS_ERR );
+ }
+
+ spin_lock(&pBcmSpi->lock);
+ legSpiSetClock(freqHz);
+#endif
+ legSpiClearIntStatus();
+ legSpiWriteFull(msg_buf, nbytes, devId, BCM_SPI_WRITE);
+ legSpiTransPoll();
+ legSpiTransEnd(msg_buf, nbytes);
+ legSpiClearIntStatus();
+#ifndef _CFE_
+ spin_unlock(&pBcmSpi->lock);
+#endif
+
+ return( SPI_STATUS_OK );
+}
+
+
+#ifndef _CFE_
+static void legSpiNextMessage(struct bcmspi *pBcmSpi);
+
+static void legSpiMsgDone(struct bcmspi *pBcmSpi, struct spi_message *msg, int status)
+{
+ list_del(&msg->queue);
+ msg->status = status;
+
+ spin_unlock(&pBcmSpi->lock);
+ msg->complete(msg->context);
+ spin_lock(&pBcmSpi->lock);
+
+ pBcmSpi->curTrans = NULL;
+
+ /* continue if needed */
+ if (list_empty(&pBcmSpi->queue) || pBcmSpi->stopping)
+ {
+ // disable controler ...
+ }
+ else
+ {
+ legSpiNextMessage(pBcmSpi);
+ }
+}
+
+#ifdef LEG_SPI_USE_INTERRUPTS
+static void legSpiIntXfer(struct bcmspi *pBcmSpi, struct spi_message *msg)
+{
+ struct spi_transfer *xfer;
+ struct spi_transfer *nextXfer;
+ int length;
+ int prependCnt;
+ char *pTxBuf;
+ char *pRxBuf;
+ int opCode;
+
+ xfer = pBcmSpi->curTrans;
+ if ( NULL == xfer)
+ {
+ xfer = list_entry(msg->transfers.next, struct spi_transfer, transfer_list);
+ }
+ else
+ {
+ xfer = list_entry(xfer->transfer_list.next, struct spi_transfer, transfer_list);
+ }
+ pBcmSpi->curTrans = xfer;
+
+ length = xfer->len;
+ prependCnt = 0;
+ pRxBuf = xfer->rx_buf;
+ pTxBuf = (unsigned char *)xfer->tx_buf;
+
+ if ( (NULL != pRxBuf) && (NULL != pTxBuf) )
+ {
+ opCode = BCM_SPI_FULL;
+ }
+ else if ( NULL != pRxBuf )
+ {
+ opCode = BCM_SPI_READ;
+ }
+ else
+ {
+ opCode = BCM_SPI_WRITE;
+ }
+
+ if ( msg->state )
+ {
+ /* this controller does not support keeping the chip select active for all transfers
+ non NULL state indicates that we need to combine the transfers */
+ nextXfer = list_entry(xfer->transfer_list.next, struct spi_transfer, transfer_list);
+ prependCnt = length;
+ length = nextXfer->len;
+ pRxBuf = nextXfer->rx_buf;
+ opCode = BCM_SPI_READ;
+ pBcmSpi->curTrans = nextXfer;
+ }
+
+ legSpiSetClock(xfer->speed_hz);
+
+ legSpiClearIntStatus();
+ legSpiEnableInt(TRUE);
+ if ( BCM_SPI_READ == opCode )
+ {
+ legSpiRead(pTxBuf, prependCnt, length, msg->spi->chip_select);
+ }
+ else
+ {
+ legSpiWriteFull(pTxBuf, length, msg->spi->chip_select, opCode);
+ }
+
+ return;
+
+}
+#endif
+
+static void legSpiPollXfer(struct bcmspi *pBcmSpi, struct spi_message *msg)
+{
+ struct spi_transfer *xfer;
+ struct spi_transfer *nextXfer;
+ int length;
+ int prependCnt;
+ char *pTxBuf;
+ char *pRxBuf;
+ int opCode;
+
+ list_for_each_entry(xfer, &msg->transfers, transfer_list)
+ {
+ pBcmSpi->curTrans = xfer;
+ length = xfer->len;
+ prependCnt = 0;
+ pRxBuf = xfer->rx_buf;
+ pTxBuf = (unsigned char *)xfer->tx_buf;
+
+ if ( (NULL != pRxBuf) && (NULL != pTxBuf) )
+ {
+ opCode = BCM_SPI_FULL;
+ }
+ else if ( NULL != pRxBuf )
+ {
+ opCode = BCM_SPI_READ;
+ }
+ else
+ {
+ opCode = BCM_SPI_WRITE;
+ }
+
+ if ( msg->state )
+ {
+ /* this controller does not support keeping the chip select active for all transfers
+ non NULL state indicates that we need to combine the transfers */
+ nextXfer = list_entry(xfer->transfer_list.next, struct spi_transfer, transfer_list);
+ prependCnt = length;
+ length = nextXfer->len;
+ pRxBuf = nextXfer->rx_buf;
+ opCode = BCM_SPI_READ;
+ xfer = nextXfer;
+ }
+
+ legSpiSetClock(xfer->speed_hz);
+
+ legSpiClearIntStatus();
+ if ( BCM_SPI_READ == opCode )
+ {
+ legSpiRead(pTxBuf, prependCnt, length, msg->spi->chip_select);
+ }
+ else
+ {
+ legSpiWriteFull(pTxBuf, length, msg->spi->chip_select, opCode);
+ }
+
+ legSpiTransPoll();
+ legSpiTransEnd(pRxBuf, length);
+ legSpiClearIntStatus();
+
+ if (xfer->delay_usecs)
+ {
+ udelay(xfer->delay_usecs);
+ }
+
+ msg->actual_length += length;
+ }
+
+ legSpiMsgDone(pBcmSpi, msg, SPI_STATUS_OK);
+
+}
+
+
+static void legSpiNextXfer(struct bcmspi *pBcmSpi, struct spi_message *msg)
+{
+#ifdef LEG_SPI_USE_INTERRUPTS
+ if (pBcmSpi->irq)
+ legSpiIntXfer(pBcmSpi, msg);
+ else
+#endif
+ legSpiPollXfer(pBcmSpi, msg);
+
+}
+
+
+static void legSpiNextMessage(struct bcmspi *pBcmSpi)
+{
+ struct spi_message *msg;
+
+ BUG_ON(pBcmSpi->curTrans);
+
+ msg = list_entry(pBcmSpi->queue.next, struct spi_message, queue);
+
+ /* there will always be one transfer in a given message */
+ legSpiNextXfer(pBcmSpi, msg);
+
+}
+
+
+static int legSpiSetup(struct spi_device *spi)
+{
+ struct bcmspi *pBcmSpi;
+
+ pBcmSpi = spi_master_get_devdata(spi->master);
+
+ if (pBcmSpi->stopping)
+ return -ESHUTDOWN;
+
+ /* there is nothing to setup */
+
+ return 0;
+}
+
+
+int legSpiTransfer(struct spi_device *spi, struct spi_message *msg)
+{
+ struct bcmspi *pBcmSpi = &BcmLegSpi;
+ struct spi_transfer *xfer;
+ struct spi_transfer *nextXfer;
+ int xferCnt;
+ int bCsChange;
+ int xferLen;
+
+ if (unlikely(list_empty(&msg->transfers)))
+ return -EINVAL;
+
+ if (pBcmSpi->stopping)
+ return -ESHUTDOWN;
+
+ /* make sure a completion callback is set */
+ if ( NULL == msg->complete )
+ {
+ return -EINVAL;
+ }
+
+ xferCnt = 0;
+ bCsChange = 0;
+ xferLen = 0;
+ list_for_each_entry(xfer, &msg->transfers, transfer_list)
+ {
+ /* check transfer parameters */
+ if (!(xfer->tx_buf || xfer->rx_buf))
+ {
+ return -EINVAL;
+ }
+
+ /* check the clock setting - if it is 0 then set to max clock of the device */
+ if ( 0 == xfer->speed_hz )
+ {
+ if ( 0 == spi->max_speed_hz )
+ {
+ return -EINVAL;
+ }
+ xfer->speed_hz = spi->max_speed_hz;
+ }
+
+ xferCnt++;
+ xferLen += xfer->len;
+ bCsChange |= xfer->cs_change;
+
+ if ( xfer->len > (sizeof(SPI->spiMsgData) & ~0x3) )
+ {
+ return -EINVAL;
+ }
+ }
+
+ /* this controller does not support keeping the chip select active between
+ transfers. If a message is detected with a write transfer followed by a
+ read transfer and cs_change is set to 0 then the two transfers need to be
+ combined. The message state is used to indicate that the transfers
+ need to be combined */
+ msg->state = NULL;
+ if ( (2 == xferCnt) && (0 == bCsChange) )
+ {
+ xfer = list_entry(msg->transfers.next, struct spi_transfer, transfer_list);
+ if ( (NULL != xfer->tx_buf) && (NULL == xfer->rx_buf))
+ {
+ nextXfer = list_entry(xfer->transfer_list.next, struct spi_transfer, transfer_list);;
+ if ( (NULL == nextXfer->tx_buf) && (NULL != nextXfer->rx_buf))
+ {
+ msg->state = (void *)1;
+ }
+ }
+ }
+
+ msg->status = -EINPROGRESS;
+ msg->actual_length = 0;
+
+#ifdef LEG_SPI_USE_INTERRUPTS
+ /* disable interrupts for the SPI controller
+ using spin_lock_irqsave would disable all interrupts */
+ if ( pBcmSpi->irq )
+ legSpiEnableInt(FALSE);
+#endif
+ spin_lock(&pBcmSpi->lock);
+
+ list_add_tail(&msg->queue, &pBcmSpi->queue);
+ if (NULL == pBcmSpi->curTrans)
+ {
+ legSpiNextMessage(pBcmSpi);
+ }
+
+ spin_unlock(&pBcmSpi->lock);
+#ifdef LEG_SPI_USE_INTERRUPTS
+ if ( pBcmSpi->irq )
+ legSpiEnableInt(TRUE);
+#endif
+
+ return 0;
+}
+
+
+#ifdef LEG_SPI_USE_INTERRUPTS
+static irqreturn_t legSpiIntHandler(int irq, void *dev_id)
+{
+ struct bcmspi *pBcmSpi = dev_id;
+ struct spi_message *msg;
+ struct spi_transfer *xfer;
+
+ if ( 0 == SPI->spiMaskIntStatus )
+ {
+ return ( IRQ_NONE );
+ }
+
+ legSpiClearIntStatus();
+ legSpiEnableInt(FALSE);
+
+ spin_lock(&pBcmSpi->lock);
+ if ( NULL == pBcmSpi->curTrans )
+ {
+ spin_unlock(&pBcmSpi->lock);
+ return IRQ_HANDLED;
+ }
+
+ xfer = pBcmSpi->curTrans;
+ msg = list_entry(pBcmSpi->queue.next, struct spi_message, queue);
+
+ legSpiTransEnd(xfer->rx_buf, xfer->len);
+
+ /* xfer can specify a delay before the next transfer is started
+ this is only used for polling mode */
+
+ /* check to see if this is the last transfer in the message */
+ if (msg->transfers.prev == &xfer->transfer_list)
+ {
+ /* report completed message */
+ legSpiMsgDone(pBcmSpi, msg, SPI_STATUS_OK);
+ }
+ else
+ {
+ /* Submit the next transfer */
+ legSpiNextXfer(pBcmSpi, msg);
+ }
+
+ spin_unlock(&pBcmSpi->lock);
+
+ return IRQ_HANDLED;
+
+}
+
+int __init legSpiIntrInit( void )
+{
+ int ret = 0;
+ struct bcmspi *pBcmSpi = &BcmLegSpi;
+
+ legSpiEnableInt(FALSE);
+ ret = request_irq(INTERRUPT_ID_SPI, legSpiIntHandler, (IRQF_DISABLED | IRQF_SAMPLE_RANDOM | IRQF_SHARED), pBcmSpi->devName, pBcmSpi);
+
+ spin_lock(&pBcmSpi->lock);
+ pBcmSpi->irq = INTERRUPT_ID_SPI;
+ spin_unlock(&pBcmSpi->lock);
+
+ BcmHalInterruptEnable(pBcmSpi->irq);
+
+ return( 0 );
+
+}
+/* we cannot initialize interrupts early
+ The flash module is intialized before an interrupt handler can be installed
+ and before the Linux framework can be used. This means it needs direct access
+ to the controller initially. This conflicts with the interrupt handling so we
+ need to wait for all modules to intialize */
+late_initcall(legSpiIntrInit);
+#endif
+
+static void legSpiCleanup(struct spi_device *spi)
+{
+ /* would free spi_controller memory here if any was allocated */
+
+}
+
+static int __init legSpiProbe(struct platform_device *pdev)
+{
+ int ret;
+ struct spi_master *master;
+ struct bcmspi *pBcmSpi;
+
+ ret = -ENOMEM;
+ master = spi_alloc_master(&pdev->dev, 0);
+ if (!master)
+ goto out_free;
+
+ master->bus_num = pdev->id;
+ master->num_chipselect = 8;
+ master->setup = legSpiSetup;
+ master->transfer = legSpiTransfer;
+ master->cleanup = legSpiCleanup;
+ platform_set_drvdata(pdev, master);
+
+ spi_master_set_devdata(master, (void *)&BcmLegSpi);
+ pBcmSpi = spi_master_get_devdata(master);
+
+ INIT_LIST_HEAD(&pBcmSpi->queue);
+
+ pBcmSpi->pdev = pdev;
+ pBcmSpi->bus_num = LEG_SPI_BUS_NUM;
+ pBcmSpi->num_chipselect = 8;
+ pBcmSpi->curTrans = NULL;
+
+ /* make sure irq is 0 here
+ since this is used to identify when interrupts are enabled
+ the IRQ is initialized in legSpiIntrInit */
+ pBcmSpi->irq = 0;
+
+ /* Initialize the hardware */
+
+ /* register and we are done */
+ ret = spi_register_master(master);
+ if (ret)
+ goto out_free;
+
+ return 0;
+
+out_free:
+ spi_master_put(master);
+
+ return ret;
+}
+
+
+static int __exit legSpiRemove(struct platform_device *pdev)
+{
+ struct spi_master *master = platform_get_drvdata(pdev);
+ struct bcmspi *pBcmSpi = spi_master_get_devdata(master);
+ struct spi_message *msg;
+
+ /* reset the hardware and block queue progress */
+#ifdef LEG_SPI_USE_INTERRUPTS
+ legSpiEnableInt(FALSE);
+#endif
+ spin_lock(&pBcmSpi->lock);
+ pBcmSpi->stopping = 1;
+
+ /* HW shutdown */
+
+ spin_unlock(&pBcmSpi->lock);
+
+ /* Terminate remaining queued transfers */
+ list_for_each_entry(msg, &pBcmSpi->queue, queue)
+ {
+ msg->status = -ESHUTDOWN;
+ msg->complete(msg->context);
+ }
+
+#ifdef LEG_SPI_USE_INTERRUPTS
+ if ( pBcmSpi->irq )
+ {
+ free_irq(pBcmSpi->irq, master);
+ }
+#endif
+ spi_unregister_master(master);
+
+ return 0;
+}
+
+//#ifdef CONFIG_PM
+#if 0
+static int legSpiSuspend(struct platform_device *pdev, pm_message_t mesg)
+{
+ struct spi_master *master = platform_get_drvdata(pdev);
+ struct bcmspi *pBcmSpi = spi_master_get_devdata(master);
+
+ return 0;
+}
+
+static int legSpiResume(struct platform_device *pdev)
+{
+ struct spi_master *master = platform_get_drvdata(pdev);
+ struct bcmspi *pBcmSpi = spi_master_get_devdata(master);
+
+ return 0;
+}
+#else
+#define legSpiSuspend NULL
+#define legSpiResume NULL
+#endif
+
+
+static struct platform_device bcm_legacyspi_device = {
+ .name = "bcmleg_spi",
+ .id = LEG_SPI_BUS_NUM,
+};
+
+static struct platform_driver bcm_legspi_driver = {
+ .driver =
+ {
+ .name = "bcmleg_spi",
+ .owner = THIS_MODULE,
+ },
+ .suspend = legSpiSuspend,
+ .resume = legSpiResume,
+ .remove = __exit_p(legSpiRemove),
+};
+
+
+int __init legSpiModInit( void )
+{
+ platform_device_register(&bcm_legacyspi_device);
+ return platform_driver_probe(&bcm_legspi_driver, legSpiProbe);
+
+}
+subsys_initcall(legSpiModInit);
+#endif
+
+#endif /* SPI */
+
diff --git a/shared/opensource/spi/bcmSpiRes.c b/shared/opensource/spi/bcmSpiRes.c
new file mode 100755
index 0000000..ed16575
--- /dev/null
+++ b/shared/opensource/spi/bcmSpiRes.c
@@ -0,0 +1,660 @@
+/*
+ Copyright 2000-2010 Broadcom Corporation
+
+ Unless you and Broadcom execute a separate written software license
+ agreement governing use of this software, this software is licensed
+ to you under the terms of the GNU General Public License version 2
+ (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
+ with the following added to such license:
+
+ As a special exception, the copyright holders of this software give
+ you permission to link this software with independent modules, and to
+ copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent
+ module, the terms and conditions of the license of that module.
+ An independent module is a module which is not derived from this
+ software. The special exception does not apply to any modifications
+ of the software.
+
+ Notwithstanding the above, under no circumstances may you combine this
+ software in any way with any other Broadcom software provided under a
+ license other than the GPL, without Broadcom's express prior written
+ consent.
+*/
+
+#ifdef _CFE_
+#include "lib_types.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "bcm_map.h"
+#define printk printf
+#else
+#include <linux/version.h>
+#include <linux/autoconf.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/delay.h>
+#include <linux/err.h>
+#include <linux/interrupt.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)
+#include <linux/semaphore.h>
+#endif
+#include <linux/spi/spi.h>
+#include <linux/autoconf.h>
+
+#include <bcm_map_part.h>
+#endif
+#include "bcmSpiRes.h"
+
+extern int BcmLegSpiRead(unsigned char * msg_buf, int prependcnt, int nbytes, int devId, int freqHz);
+extern int BcmLegSpiWrite(unsigned char * msg_buf, int nbytes, int devId, int freqHz);
+extern int BcmHsSpiRead(unsigned char * msg_buf, int prependcnt, int nbytes, int devId, int freqHz);
+extern int BcmHsSpiWrite(unsigned char * msg_buf, int nbytes, int devId, int freqHz);
+
+#ifndef _CFE_
+#ifdef SPI
+/* the BCM legacy controller supports up to 8 devices */
+static struct spi_board_info bcmLegSpiDevInfo[8] =
+{
+ {
+ .modalias = "bcm_LegSpiDev0",
+ .chip_select = 0,
+ .max_speed_hz = 781000,
+ .bus_num = LEG_SPI_BUS_NUM,
+ .mode = SPI_MODE_3,
+ },
+ {
+ .modalias = "bcm_LegSpiDev1",
+ .chip_select = 1,
+ .max_speed_hz = 781000,
+ .bus_num = LEG_SPI_BUS_NUM,
+ .mode = SPI_MODE_3,
+ },
+ {
+ .modalias = "bcm_LegSpiDev2",
+ .chip_select = 2,
+ .max_speed_hz = 781000,
+ .bus_num = LEG_SPI_BUS_NUM,
+ .mode = SPI_MODE_3,
+ },
+ {
+ .modalias = "bcm_LegSpiDev3",
+ .chip_select = 3,
+ .max_speed_hz = 781000,
+ .bus_num = LEG_SPI_BUS_NUM,
+ .mode = SPI_MODE_3,
+ },
+ {
+ .modalias = "bcm_LegSpiDev4",
+ .chip_select = 4,
+ .max_speed_hz = 781000,
+ .bus_num = LEG_SPI_BUS_NUM,
+ .mode = SPI_MODE_3,
+ },
+ {
+ .modalias = "bcm_LegSpiDev5",
+ .chip_select = 5,
+ .max_speed_hz = 781000,
+ .bus_num = LEG_SPI_BUS_NUM,
+ .mode = SPI_MODE_3,
+ },
+ {
+ .modalias = "bcm_LegSpiDev6",
+ .chip_select = 6,
+ .max_speed_hz = 781000,
+ .bus_num = LEG_SPI_BUS_NUM,
+ .mode = SPI_MODE_3,
+ },
+ {
+ .modalias = "bcm_LegSpiDev7",
+ .chip_select = 7,
+ .max_speed_hz = 781000,
+ .bus_num = LEG_SPI_BUS_NUM,
+ .mode = SPI_MODE_3,
+ },
+};
+
+static struct spi_driver bcmLegSpiDevDrv[8] =
+{
+ {
+ .driver =
+ {
+ .name = "bcm_LegSpiDev0",
+ .bus = &spi_bus_type,
+ .owner = THIS_MODULE,
+ },
+ },
+ {
+ .driver =
+ {
+ .name = "bcm_LegSpiDev1",
+ .bus = &spi_bus_type,
+ .owner = THIS_MODULE,
+ },
+ },
+ {
+ .driver =
+ {
+ .name = "bcm_LegSpiDev2",
+ .bus = &spi_bus_type,
+ .owner = THIS_MODULE,
+ },
+ },
+ {
+ .driver =
+ {
+ .name = "bcm_LegSpiDev3",
+ .bus = &spi_bus_type,
+ .owner = THIS_MODULE,
+ },
+ },
+ {
+ .driver =
+ {
+ .name = "bcm_LegSpiDev4",
+ .bus = &spi_bus_type,
+ .owner = THIS_MODULE,
+ },
+ },
+ {
+ .driver =
+ {
+ .name = "bcm_LegSpiDev5",
+ .bus = &spi_bus_type,
+ .owner = THIS_MODULE,
+ },
+ },
+ {
+ .driver =
+ {
+ .name = "bcm_LegSpiDev6",
+ .bus = &spi_bus_type,
+ .owner = THIS_MODULE,
+ },
+ },
+ {
+ .driver =
+ {
+ .name = "bcm_LegSpiDev7",
+ .bus = &spi_bus_type,
+ .owner = THIS_MODULE,
+ },
+ },
+};
+
+static struct spi_device * bcmLegSpiDevices[8];
+#endif
+
+#ifdef HS_SPI
+/* the BCM HS controller supports up to 8 devices */
+static struct spi_board_info bcmHSSpiDevInfo[8] =
+{
+ {
+ .modalias = "bcm_HSSpiDev0",
+ .controller_data = (void *)SPI_CONTROLLER_STATE_DEFAULT,
+ .chip_select = 0,
+ .max_speed_hz = 781000,
+ .bus_num = HS_SPI_BUS_NUM,
+ .mode = SPI_MODE_DEFAULT,
+ },
+ {
+ .modalias = "bcm_HSSpiDev1",
+ .controller_data = (void *)SPI_CONTROLLER_STATE_DEFAULT,
+ .chip_select = 1,
+ .max_speed_hz = 781000,
+ .bus_num = HS_SPI_BUS_NUM,
+ .mode = SPI_MODE_DEFAULT,
+ },
+ {
+ .modalias = "bcm_HSSpiDev2",
+ .controller_data = (void *)SPI_CONTROLLER_STATE_DEFAULT,
+ .chip_select = 2,
+ .max_speed_hz = 781000,
+ .bus_num = HS_SPI_BUS_NUM,
+ .mode = SPI_MODE_DEFAULT,
+ },
+ {
+ .modalias = "bcm_HSSpiDev3",
+ .controller_data = (void *)SPI_CONTROLLER_STATE_DEFAULT,
+ .chip_select = 3,
+ .max_speed_hz = 781000,
+ .bus_num = HS_SPI_BUS_NUM,
+ .mode = SPI_MODE_DEFAULT,
+ },
+ {
+ .modalias = "bcm_HSSpiDev4",
+ .controller_data = (void *)SPI_CONTROLLER_STATE_DEFAULT,
+ .chip_select = 4,
+ .max_speed_hz = 781000,
+ .bus_num = HS_SPI_BUS_NUM,
+ .mode = SPI_MODE_DEFAULT,
+ },
+ {
+ .modalias = "bcm_HSSpiDev5",
+ .controller_data = (void *)SPI_CONTROLLER_STATE_DEFAULT,
+ .chip_select = 5,
+ .max_speed_hz = 781000,
+ .bus_num = HS_SPI_BUS_NUM,
+ .mode = SPI_MODE_DEFAULT,
+ },
+ {
+ .modalias = "bcm_HSSpiDev6",
+ .controller_data = (void *)SPI_CONTROLLER_STATE_DEFAULT,
+ .chip_select = 6,
+ .max_speed_hz = 781000,
+ .bus_num = HS_SPI_BUS_NUM,
+ .mode = SPI_MODE_DEFAULT,
+ },
+ {
+ .modalias = "bcm_HSSpiDev7",
+ .controller_data = (void *)SPI_CONTROLLER_STATE_DEFAULT,
+ .chip_select = 7,
+ .max_speed_hz = 781000,
+ .bus_num = HS_SPI_BUS_NUM,
+ .mode = SPI_MODE_DEFAULT,
+ },
+};
+
+static struct spi_driver bcmHSSpiDevDrv[8] =
+{
+ {
+ .driver =
+ {
+ .name = "bcm_HSSpiDev0",
+ .bus = &spi_bus_type,
+ .owner = THIS_MODULE,
+ },
+ },
+ {
+ .driver =
+ {
+ .name = "bcm_HSSpiDev1",
+ .bus = &spi_bus_type,
+ .owner = THIS_MODULE,
+ },
+ },
+ {
+ .driver =
+ {
+ .name = "bcm_HSSpiDev2",
+ .bus = &spi_bus_type,
+ .owner = THIS_MODULE,
+ },
+ },
+ {
+ .driver =
+ {
+ .name = "bcm_HSSpiDev3",
+ .bus = &spi_bus_type,
+ .owner = THIS_MODULE,
+ },
+ },
+ {
+ .driver =
+ {
+ .name = "bcm_HSSpiDev4",
+ .bus = &spi_bus_type,
+ .owner = THIS_MODULE,
+ },
+ },
+ {
+ .driver =
+ {
+ .name = "bcm_HSSpiDev5",
+ .bus = &spi_bus_type,
+ .owner = THIS_MODULE,
+ },
+ },
+ {
+ .driver =
+ {
+ .name = "bcm_HSSpiDev6",
+ .bus = &spi_bus_type,
+ .owner = THIS_MODULE,
+ },
+ },
+ {
+ .driver =
+ {
+ .name = "bcm_HSSpiDev7",
+ .bus = &spi_bus_type,
+ .owner = THIS_MODULE,
+ },
+ },
+};
+
+static struct spi_device * bcmHSSpiDevices[8];
+#endif
+
+
+int BcmSpiReserveSlave2(int busNum, int slaveId, int maxFreq, int spiMode, int ctrlState)
+{
+ struct spi_master * pSpiMaster;
+ struct spi_driver * pSpiDriver;
+
+ if ( slaveId > 7 )
+ {
+ return SPI_STATUS_ERR;
+ }
+
+ if ( LEG_SPI_BUS_NUM == busNum )
+ {
+#ifndef SPI
+ return( SPI_STATUS_ERR );
+#else
+ if ( NULL != bcmLegSpiDevices[slaveId] )
+ {
+ printk(KERN_ERR "BcmSpiReserveSlave - slaveId %d, already registerd\n", slaveId);
+ return( SPI_STATUS_ERR );
+ }
+
+ bcmLegSpiDevInfo[slaveId].max_speed_hz = maxFreq;
+ bcmLegSpiDevInfo[slaveId].controller_data = (void *)ctrlState;
+ bcmLegSpiDevInfo[slaveId].mode = spiMode;
+
+ pSpiMaster = spi_busnum_to_master( busNum );
+ bcmLegSpiDevices[slaveId] = spi_new_device(pSpiMaster, &bcmLegSpiDevInfo[slaveId]);
+ pSpiDriver = &bcmLegSpiDevDrv[slaveId];
+#endif
+ }
+ else if ( HS_SPI_BUS_NUM == busNum )
+ {
+#ifndef HS_SPI
+ return( SPI_STATUS_ERR );
+#else
+ if ( NULL != bcmHSSpiDevices[slaveId] )
+ {
+ printk(KERN_ERR "BcmSpiReserveSlave - slaveId %d, already registerd\n", slaveId);
+ return( SPI_STATUS_ERR );
+ }
+
+ bcmHSSpiDevInfo[slaveId].max_speed_hz = maxFreq;
+ bcmHSSpiDevInfo[slaveId].controller_data = (void *)ctrlState;
+ bcmHSSpiDevInfo[slaveId].mode = spiMode;
+
+ pSpiMaster = spi_busnum_to_master( busNum );
+ bcmHSSpiDevices[slaveId] = spi_new_device(pSpiMaster, &bcmHSSpiDevInfo[slaveId]);
+ pSpiDriver = &bcmHSSpiDevDrv[slaveId];
+#endif
+ }
+ else
+ return( SPI_STATUS_ERR );
+
+ /* register the SPI driver */
+ spi_register_driver(pSpiDriver);
+
+ return 0;
+
+}
+EXPORT_SYMBOL(BcmSpiReserveSlave2);
+
+int BcmSpiReserveSlave(int busNum, int slaveId, int maxFreq)
+{
+ return( BcmSpiReserveSlave2(busNum, slaveId, maxFreq, SPI_MODE_DEFAULT, SPI_CONTROLLER_STATE_DEFAULT) );
+}
+EXPORT_SYMBOL(BcmSpiReserveSlave);
+
+int BcmSpiReleaseSlave(int busNum, int slaveId)
+{
+ if ( slaveId > 7 )
+ {
+ return SPI_STATUS_ERR;
+ }
+
+ if ( LEG_SPI_BUS_NUM == busNum )
+ {
+#ifndef SPI
+ return( SPI_STATUS_ERR );
+#else
+ if ( NULL == bcmLegSpiDevices[slaveId] )
+ {
+ printk(KERN_ERR "BcmSpiReleaseSlave - slaveId %d, already released\n", slaveId);
+ return( SPI_STATUS_ERR );
+ }
+
+ bcmLegSpiDevInfo[slaveId].max_speed_hz = 781000;
+ spi_unregister_driver(&bcmLegSpiDevDrv[slaveId]);
+ spi_unregister_device(bcmLegSpiDevices[slaveId]);
+ bcmLegSpiDevices[slaveId] = 0;
+#endif
+ }
+ else if ( HS_SPI_BUS_NUM == busNum )
+ {
+#ifndef HS_SPI
+ return( SPI_STATUS_ERR );
+#else
+ if ( NULL == bcmHSSpiDevices[slaveId] )
+ {
+ printk(KERN_ERR "BcmSpiReleaseSlave - slaveId %d, already released\n", slaveId);
+ return( SPI_STATUS_ERR );
+ }
+
+ bcmHSSpiDevInfo[slaveId].max_speed_hz = 781000;
+ spi_unregister_driver(&bcmHSSpiDevDrv[slaveId]);
+ spi_unregister_device(bcmHSSpiDevices[slaveId]);
+ bcmHSSpiDevices[slaveId] = 0;
+#endif
+ }
+ else
+ return( SPI_STATUS_ERR );
+
+ return 0;
+
+}
+EXPORT_SYMBOL(BcmSpiReleaseSlave);
+
+
+int BcmSpiSyncTrans(unsigned char *txBuf, unsigned char *rxBuf, int prependcnt, int nbytes, int busNum, int slaveId)
+{
+ struct spi_message msg;
+ struct spi_transfer xfer[2];
+ int status;
+ int maxLength;
+ struct spi_device *pSpiDevice;
+
+ maxLength = BcmSpi_GetMaxRWSize(busNum);
+ if ( (nbytes > maxLength) || (prependcnt > maxLength) )
+ {
+ printk(KERN_ERR "ERROR BcmSpiSyncTrans: invalid length len %d, pre %d, max %d\n", nbytes, prependcnt, maxLength);
+ return SPI_STATUS_ERR;
+ }
+
+ if ( slaveId > 7 )
+ {
+ printk(KERN_ERR "ERROR BcmSpiSyncTrans: invalid slave id %d\n", slaveId);
+ return SPI_STATUS_ERR;
+ }
+
+ if ( LEG_SPI_BUS_NUM == busNum )
+ {
+#ifndef SPI
+ return( SPI_STATUS_ERR );
+#else
+ if ( NULL == bcmLegSpiDevices[slaveId] )
+ {
+ printk(KERN_ERR "ERROR BcmSpiSyncTrans: device not registered\n");
+ return SPI_STATUS_ERR;
+ }
+ pSpiDevice = bcmLegSpiDevices[slaveId];
+#endif
+ }
+ else if ( HS_SPI_BUS_NUM == busNum )
+ {
+#ifndef HS_SPI
+ return( SPI_STATUS_ERR );
+#else
+ if ( NULL == bcmHSSpiDevices[slaveId] )
+ {
+ printk(KERN_ERR "ERROR BcmSpiSyncTrans: device not registered\n");
+ return SPI_STATUS_ERR;
+ }
+ pSpiDevice = bcmHSSpiDevices[slaveId];
+#endif
+ }
+ else
+ return( SPI_STATUS_ERR );
+
+ spi_message_init(&msg);
+ memset(xfer, 0, (sizeof xfer));
+
+ if ( prependcnt )
+ {
+ xfer[0].len = prependcnt;
+ xfer[0].speed_hz = pSpiDevice->max_speed_hz;
+ if ( txBuf )
+ {
+ xfer[0].tx_buf = txBuf;
+ }
+ else
+ {
+ xfer[0].tx_buf = rxBuf;
+ }
+ spi_message_add_tail(&xfer[0], &msg);
+ }
+
+ xfer[1].len = nbytes;
+ xfer[1].speed_hz = pSpiDevice->max_speed_hz;
+ xfer[1].rx_buf = rxBuf;
+
+ /* for the controller to use the prepend count correctly the first operation must be a read and the second a write
+ make sure tx is NULL for second transaction */
+ if ( 0 == prependcnt )
+ {
+ xfer[1].tx_buf = txBuf;
+ }
+ spi_message_add_tail(&xfer[1], &msg);
+
+ status = spi_sync(pSpiDevice, &msg);
+ if (status >= 0)
+ {
+ status = SPI_STATUS_OK;
+ }
+ else
+ {
+ status = SPI_STATUS_ERR;
+ }
+
+ return( status );
+
+}
+EXPORT_SYMBOL(BcmSpiSyncTrans);
+#endif
+
+int BcmSpi_SetFlashCtrl( int opCode, int addrBytes, int dummyBytes, int busNum, int devId )
+{
+ if ( HS_SPI_BUS_NUM == busNum )
+ {
+#ifndef HS_SPI
+ return SPI_STATUS_ERR;
+#else
+ int clock;
+
+ clock = HS_SPI_PLL_FREQ/HS_SPI_CLOCK_DEF;
+ if (HS_SPI_PLL_FREQ%HS_SPI_CLOCK_DEF)
+ clock++;
+
+ clock = 2048/clock;
+ if (2048%(clock))
+ clock++;
+
+ HS_SPI_PROFILES[0].clk_ctrl = 1<<HS_SPI_ACCUM_RST_ON_LOOP | 0<<HS_SPI_SPI_CLK_2X_SEL | clock<<HS_SPI_FREQ_CTRL_WORD;
+ HS_SPI->hs_spiFlashCtrl = devId<<HS_SPI_FCTRL_SS_NUM | 0<<HS_SPI_FCTRL_PROFILE_NUM | dummyBytes<<HS_SPI_FCTRL_DUMMY_BYTES |
+ addrBytes<<HS_SPI_FCTRL_ADDR_BYTES | opCode<<HS_SPI_FCTRL_READ_OPCODE;
+#endif
+ }
+ else if ( LEG_SPI_BUS_NUM == busNum )
+ {
+#ifndef SPI
+ return SPI_STATUS_ERR;
+#endif
+ }
+ else
+ return SPI_STATUS_ERR;
+
+ return SPI_STATUS_OK;
+
+}
+
+
+int BcmSpi_GetMaxRWSize( int busNum )
+{
+ int maxRWSize = 0;
+
+ if ( HS_SPI_BUS_NUM == busNum )
+ {
+#ifdef HS_SPI
+ maxRWSize = HS_SPI_BUFFER_LEN;
+#endif
+ }
+ else if ( LEG_SPI_BUS_NUM == busNum )
+ {
+#ifdef SPI
+ maxRWSize = sizeof(SPI->spiMsgData);
+#endif
+ }
+
+ maxRWSize &= ~0x3;
+
+ return(maxRWSize);
+
+}
+
+
+/* The interface bcmSpi_Read and bcmSpi_Write provide direct access to the SPI controller.
+ these interfaces should only be called by CFE and early spi flash code */
+int BcmSpi_Read( unsigned char *msg_buf, int prependcnt, int nbytes, int busNum, int devId, int freqHz )
+{
+ if ( LEG_SPI_BUS_NUM == busNum )
+ {
+#ifndef SPI
+ return SPI_STATUS_ERR;
+#else
+ return BcmLegSpiRead( msg_buf, prependcnt, nbytes, devId, freqHz );
+#endif
+ }
+ else if ( HS_SPI_BUS_NUM == busNum )
+ {
+#ifndef HS_SPI
+ return SPI_STATUS_ERR;
+#else
+ return BcmHsSpiRead( msg_buf, prependcnt, nbytes, devId, freqHz );
+#endif
+ }
+ else
+ {
+ return SPI_STATUS_ERR;
+ }
+
+}
+
+int BcmSpi_Write( unsigned char *msg_buf, int nbytes, int busNum, int devId, int freqHz )
+{
+ if ( LEG_SPI_BUS_NUM == busNum )
+ {
+#ifndef SPI
+ return SPI_STATUS_ERR;
+#else
+ return BcmLegSpiWrite( msg_buf, nbytes, devId, freqHz );
+#endif
+ }
+ else if ( HS_SPI_BUS_NUM == busNum )
+ {
+#ifndef HS_SPI
+ return SPI_STATUS_ERR;
+#else
+ return BcmHsSpiWrite( msg_buf, nbytes, devId, freqHz );
+#endif
+ }
+ else
+ {
+ return SPI_STATUS_ERR;
+ }
+}
+
+#ifndef _CFE_
+EXPORT_SYMBOL(BcmSpi_SetFlashCtrl);
+EXPORT_SYMBOL(BcmSpi_GetMaxRWSize);
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/.fakeroot.00000 b/uclibc-crosstools-gcc-4.4.2-1/.fakeroot.00000
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/.fakeroot.00000
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/ld-uClibc-0.9.29.so b/uclibc-crosstools-gcc-4.4.2-1/lib/ld-uClibc-0.9.29.so
new file mode 100755
index 0000000..f154f97
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/ld-uClibc-0.9.29.so
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/ld-uClibc.so.0 b/uclibc-crosstools-gcc-4.4.2-1/lib/ld-uClibc.so.0
new file mode 120000
index 0000000..7105e39
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/ld-uClibc.so.0
@@ -0,0 +1 @@
+ld-uClibc-0.9.29.so \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/libc.so.0 b/uclibc-crosstools-gcc-4.4.2-1/lib/libc.so.0
new file mode 120000
index 0000000..274f668
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/libc.so.0
@@ -0,0 +1 @@
+libuClibc-0.9.29.so \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/libcrypt-0.9.29.so b/uclibc-crosstools-gcc-4.4.2-1/lib/libcrypt-0.9.29.so
new file mode 100644
index 0000000..70d2354
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/libcrypt-0.9.29.so
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/libcrypt.so.0 b/uclibc-crosstools-gcc-4.4.2-1/lib/libcrypt.so.0
new file mode 120000
index 0000000..774ba43
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/libcrypt.so.0
@@ -0,0 +1 @@
+libcrypt-0.9.29.so \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/libdl-0.9.29.so b/uclibc-crosstools-gcc-4.4.2-1/lib/libdl-0.9.29.so
new file mode 100644
index 0000000..f23cf44
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/libdl-0.9.29.so
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/libdl.so.0 b/uclibc-crosstools-gcc-4.4.2-1/lib/libdl.so.0
new file mode 120000
index 0000000..0c55086
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/libdl.so.0
@@ -0,0 +1 @@
+libdl-0.9.29.so \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/libm-0.9.29.so b/uclibc-crosstools-gcc-4.4.2-1/lib/libm-0.9.29.so
new file mode 100644
index 0000000..3a8d58e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/libm-0.9.29.so
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/libm.so.0 b/uclibc-crosstools-gcc-4.4.2-1/lib/libm.so.0
new file mode 120000
index 0000000..2f114fd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/libm.so.0
@@ -0,0 +1 @@
+libm-0.9.29.so \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/libnsl-0.9.29.so b/uclibc-crosstools-gcc-4.4.2-1/lib/libnsl-0.9.29.so
new file mode 100644
index 0000000..928ec8b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/libnsl-0.9.29.so
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/libnsl.so.0 b/uclibc-crosstools-gcc-4.4.2-1/lib/libnsl.so.0
new file mode 120000
index 0000000..47d519f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/libnsl.so.0
@@ -0,0 +1 @@
+libnsl-0.9.29.so \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/libpthread-0.9.29.so b/uclibc-crosstools-gcc-4.4.2-1/lib/libpthread-0.9.29.so
new file mode 100644
index 0000000..ba9ff40
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/libpthread-0.9.29.so
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/libpthread.so.0 b/uclibc-crosstools-gcc-4.4.2-1/lib/libpthread.so.0
new file mode 120000
index 0000000..1f4d525
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/libpthread.so.0
@@ -0,0 +1 @@
+libpthread-0.9.29.so \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/libresolv-0.9.29.so b/uclibc-crosstools-gcc-4.4.2-1/lib/libresolv-0.9.29.so
new file mode 100644
index 0000000..386ac9c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/libresolv-0.9.29.so
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/libresolv.so.0 b/uclibc-crosstools-gcc-4.4.2-1/lib/libresolv.so.0
new file mode 120000
index 0000000..99ed44f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/libresolv.so.0
@@ -0,0 +1 @@
+libresolv-0.9.29.so \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/librt-0.9.29.so b/uclibc-crosstools-gcc-4.4.2-1/lib/librt-0.9.29.so
new file mode 100644
index 0000000..8725647
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/librt-0.9.29.so
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/librt.so.0 b/uclibc-crosstools-gcc-4.4.2-1/lib/librt.so.0
new file mode 120000
index 0000000..00aeee7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/librt.so.0
@@ -0,0 +1 @@
+librt-0.9.29.so \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/libthread_db-0.9.29.so b/uclibc-crosstools-gcc-4.4.2-1/lib/libthread_db-0.9.29.so
new file mode 100644
index 0000000..34a2951
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/libthread_db-0.9.29.so
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/libthread_db.so.1 b/uclibc-crosstools-gcc-4.4.2-1/lib/libthread_db.so.1
new file mode 120000
index 0000000..afe8c3e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/libthread_db.so.1
@@ -0,0 +1 @@
+libthread_db-0.9.29.so \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/libuClibc-0.9.29.so b/uclibc-crosstools-gcc-4.4.2-1/lib/libuClibc-0.9.29.so
new file mode 100644
index 0000000..71c153a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/libuClibc-0.9.29.so
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/libutil-0.9.29.so b/uclibc-crosstools-gcc-4.4.2-1/lib/libutil-0.9.29.so
new file mode 100644
index 0000000..c4c2e7e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/libutil-0.9.29.so
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/lib/libutil.so.0 b/uclibc-crosstools-gcc-4.4.2-1/lib/libutil.so.0
new file mode 120000
index 0000000..421f18e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/lib/libutil.so.0
@@ -0,0 +1 @@
+libutil-0.9.29.so \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/ldconfig b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/ldconfig
new file mode 100755
index 0000000..4b7e177
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/ldconfig
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/ldd b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/ldd
new file mode 100755
index 0000000..f52633c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/ldd
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-addr2line b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-addr2line
new file mode 120000
index 0000000..f54ce47
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-addr2line
@@ -0,0 +1 @@
+mips-linux-uclibc-addr2line \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-ar b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-ar
new file mode 120000
index 0000000..d2f2ef0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-ar
@@ -0,0 +1 @@
+mips-linux-uclibc-ar \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-as b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-as
new file mode 120000
index 0000000..0f34e85
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-as
@@ -0,0 +1 @@
+mips-linux-uclibc-as \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-c++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-c++
new file mode 120000
index 0000000..133d9b5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-c++
@@ -0,0 +1 @@
+mips-linux-uclibc-c++ \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-c++filt b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-c++filt
new file mode 120000
index 0000000..bdbc87a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-c++filt
@@ -0,0 +1 @@
+mips-linux-uclibc-c++filt \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-cc b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-cc
new file mode 120000
index 0000000..de030d6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-cc
@@ -0,0 +1 @@
+mips-linux-uclibc-cc \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-cpp b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-cpp
new file mode 120000
index 0000000..c56f03e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-cpp
@@ -0,0 +1 @@
+mips-linux-uclibc-cpp \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-g++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-g++
new file mode 120000
index 0000000..c574e81
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-g++
@@ -0,0 +1 @@
+mips-linux-uclibc-g++ \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gcc b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gcc
new file mode 120000
index 0000000..5245279
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gcc
@@ -0,0 +1 @@
+mips-linux-uclibc-gcc \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gcc-4.4.2 b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gcc-4.4.2
new file mode 120000
index 0000000..cb6ee1c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gcc-4.4.2
@@ -0,0 +1 @@
+mips-linux-uclibc-gcc-4.4.2 \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gccbug b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gccbug
new file mode 120000
index 0000000..0164c17
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gccbug
@@ -0,0 +1 @@
+mips-linux-uclibc-gccbug \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gcov b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gcov
new file mode 120000
index 0000000..43a68a1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gcov
@@ -0,0 +1 @@
+mips-linux-uclibc-gcov \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gdb b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gdb
new file mode 120000
index 0000000..9b53072
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gdb
@@ -0,0 +1 @@
+mips-linux-uclibc-gdb \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gprof b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gprof
new file mode 120000
index 0000000..460338e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-gprof
@@ -0,0 +1 @@
+mips-linux-uclibc-gprof \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-ld b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-ld
new file mode 120000
index 0000000..0882ad2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-ld
@@ -0,0 +1 @@
+mips-linux-uclibc-ld \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-ldconfig b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-ldconfig
new file mode 120000
index 0000000..bb24844
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-ldconfig
@@ -0,0 +1 @@
+mips-linux-uclibc-ldconfig \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-ldd b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-ldd
new file mode 120000
index 0000000..e823f3e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-ldd
@@ -0,0 +1 @@
+mips-linux-uclibc-ldd \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-nm b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-nm
new file mode 120000
index 0000000..fe1bd0a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-nm
@@ -0,0 +1 @@
+mips-linux-uclibc-nm \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-objcopy b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-objcopy
new file mode 120000
index 0000000..5481d5e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-objcopy
@@ -0,0 +1 @@
+mips-linux-uclibc-objcopy \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-objdump b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-objdump
new file mode 120000
index 0000000..cb32686
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-objdump
@@ -0,0 +1 @@
+mips-linux-uclibc-objdump \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-ranlib b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-ranlib
new file mode 120000
index 0000000..703fee7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-ranlib
@@ -0,0 +1 @@
+mips-linux-uclibc-ranlib \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-readelf b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-readelf
new file mode 120000
index 0000000..4cab6c2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-readelf
@@ -0,0 +1 @@
+mips-linux-uclibc-readelf \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-size b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-size
new file mode 120000
index 0000000..0558ed1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-size
@@ -0,0 +1 @@
+mips-linux-uclibc-size \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-sstrip b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-sstrip
new file mode 120000
index 0000000..1331008
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-sstrip
@@ -0,0 +1 @@
+mips-linux-uclibc-sstrip \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-strings b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-strings
new file mode 120000
index 0000000..694acb5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-strings
@@ -0,0 +1 @@
+mips-linux-uclibc-strings \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-strip b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-strip
new file mode 120000
index 0000000..9bda32a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-strip
@@ -0,0 +1 @@
+mips-linux-uclibc-strip \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-addr2line b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-addr2line
new file mode 100755
index 0000000..d945aae
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-addr2line
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-ar b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-ar
new file mode 100755
index 0000000..928c841
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-ar
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-as b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-as
new file mode 100755
index 0000000..79591da
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-as
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-c++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-c++
new file mode 100755
index 0000000..1c9e54e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-c++
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-c++filt b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-c++filt
new file mode 100755
index 0000000..5248cee
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-c++filt
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-cc b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-cc
new file mode 120000
index 0000000..5245279
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-cc
@@ -0,0 +1 @@
+mips-linux-uclibc-gcc \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-cpp b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-cpp
new file mode 100755
index 0000000..814acf7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-cpp
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-g++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-g++
new file mode 100755
index 0000000..1c9e54e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-g++
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gcc b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gcc
new file mode 100755
index 0000000..c8a2dd3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gcc
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gcc-4.4.2 b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gcc-4.4.2
new file mode 100755
index 0000000..c8a2dd3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gcc-4.4.2
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gccbug b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gccbug
new file mode 100755
index 0000000..f9276ee
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gccbug
@@ -0,0 +1,558 @@
+#!/bin/sh
+# Submit a problem report to a GNATS site.
+# Copyright (C) 1993, 2000, 2001, 2002, 2003, 2007 Free Software Foundation, Inc.
+# Contributed by Brendan Kehoe (brendan@cygnus.com), based on a
+# version written by Heinz G. Seidl (hgs@cygnus.com).
+#
+# This file is part of GNU GNATS.
+#
+# GNU GNATS is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU GNATS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU GNATS; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# The version of this send-pr.
+VERSION=3.113
+
+# The submitter-id for your site.
+SUBMITTER=net
+
+# The default mail address for PR submissions.
+GNATS_ADDR=gcc-gnats@gcc.gnu.org
+
+# The default release for this host.
+# We have to guess at what program_transform_name might have done.
+# "sed 1q" because neither "head -1" nor "head -n 1" is universal, argh.
+
+DEFAULT_GCC="`echo $0 | sed -e 's/bug//'`"
+DEFAULT_RELEASE="`$DEFAULT_GCC --version | sed 1q`"
+
+# The default organization.
+DEFAULT_ORGANIZATION=
+
+# What mailer to use. This must come after the config file, since it is
+# host-dependent.
+# Copied from cvsbug
+if [ -f /usr/sbin/sendmail ]; then
+ MAIL_AGENT="/usr/sbin/sendmail -oi -t"
+else
+ MAIL_AGENT="/usr/lib/sendmail -oi -t"
+fi
+MAILER=`echo $MAIL_AGENT | sed -e 's, .*,,'`
+if [ ! -f "$MAILER" ] ; then
+ echo "$COMMAND: Cannot file mail program \"$MAILER\"."
+ echo "$COMMAND: Please fix the MAIL_AGENT entry in the $COMMAND file."
+ exit 1
+fi
+
+
+# How to read the passwd database.
+PASSWD="cat /etc/passwd"
+
+ECHON=bsd
+
+if [ $ECHON = bsd ] ; then
+ ECHON1="echo -n"
+ ECHON2=
+elif [ $ECHON = sysv ] ; then
+ ECHON1=echo
+ ECHON2='\c'
+else
+ ECHON1=echo
+ ECHON2=
+fi
+
+#
+
+if [ -z "$TMPDIR" ]; then
+ TMPDIR=/tmp
+else
+ if [ "`echo $TMPDIR | grep '/$'`" != "" ]; then
+ TMPDIR="`echo $TMPDIR | sed -e 's,/$,,'`"
+ fi
+fi
+
+if [ yes = yes ]; then
+ TEMP0=`mktemp $TMPDIR/poXXXXXX` || exit 1
+ TEMP=`mktemp $TMPDIR/pXXXXXX` || exit 1
+ BAD=`mktemp $TMPDIR/pbadXXXXXX` || exit 1
+ REF=`mktemp $TMPDIR/pfXXXXXX` || exit 1
+ REMOVE_TEMP="rm -f $TEMP0 $TEMP $BAD $REF"
+else
+ TEMPD=$TMPDIR/pd$$
+ TEMP0=$TEMPD/po$$
+ TEMP=$TEMPD/p$$
+ BAD=$TEMPD/pbad$$
+ REF=$TEMPD/pf$$
+ mkdir $TEMPD || exit 1
+ REMOVE_TEMP="rm -rf $TEMPD"
+fi
+
+# find a user name
+if [ "$LOGNAME" = "" ]; then
+ if [ "$USER" != "" ]; then
+ LOGNAME="$USER"
+ else
+ LOGNAME="UNKNOWN"
+ fi
+fi
+
+FROM="$LOGNAME"
+REPLY_TO="${REPLY_TO:-${REPLYTO:-$LOGNAME}}"
+
+# Find out the name of the originator of this PR.
+if [ -n "$NAME" ]; then
+ ORIGINATOR="$NAME"
+elif [ -f $HOME/.fullname ]; then
+ ORIGINATOR="`sed -e '1q' $HOME/.fullname`"
+else
+ # Must use temp file due to incompatibilities in quoting behavior
+ # and to protect shell metacharacters in the expansion of $LOGNAME
+ $PASSWD | grep "^$LOGNAME:" | awk -F: '{print $5}' | sed -e 's/,.*//' > $TEMP0
+ ORIGINATOR="`cat $TEMP0`"
+ rm -f $TEMP0
+fi
+
+if [ -n "$ORGANIZATION" ]; then
+ if [ -f "$ORGANIZATION" ]; then
+ ORGANIZATION="`cat $ORGANIZATION`"
+ fi
+else
+ if [ -n "$DEFAULT_ORGANIZATION" ]; then
+ ORGANIZATION="$DEFAULT_ORGANIZATION"
+ elif [ -f $HOME/.organization ]; then
+ ORGANIZATION="`cat $HOME/.organization`"
+ fi
+fi
+
+# If they don't have a preferred editor set, then use
+if [ -z "$VISUAL" ]; then
+ if [ -z "$EDITOR" ]; then
+ EDIT=vi
+ else
+ EDIT="$EDITOR"
+ fi
+else
+ EDIT="$VISUAL"
+fi
+
+# Find out some information.
+SYSTEM=`( [ -f /bin/uname ] && /bin/uname -a ) || \
+ ( [ -f /usr/bin/uname ] && /usr/bin/uname -a ) || echo ""`
+ARCH=`[ -f /bin/arch ] && /bin/arch`
+MACHINE=`[ -f /bin/machine ] && /bin/machine`
+
+COMMAND=`echo $0 | sed -e 's,.*/,,'`
+USAGE="Usage: $COMMAND [-PVL] [-t address] [-f filename] [-s severity]
+ [-c address] [--request-id] [--version]"
+REMOVE=
+BATCH=
+CC=
+SEVERITY_C=
+
+while [ $# -gt 0 ]; do
+ case "$1" in
+ -r) ;; # Ignore for backward compat.
+ -t | --to) if [ $# -eq 1 ]; then echo "$USAGE"; $REMOVE_TEMP; exit 1; fi
+ shift ; GNATS_ADDR="$1"
+ EXPLICIT_GNATS_ADDR=true
+ ;;
+ -f | --file) if [ $# -eq 1 ]; then echo "$USAGE"; $REMOVE_TEMP; exit 1; fi
+ shift ; IN_FILE="$1"
+ if [ "$IN_FILE" != "-" -a ! -r "$IN_FILE" ]; then
+ echo "$COMMAND: cannot read $IN_FILE"
+ $REMOVE_TEMP
+ exit 1
+ fi
+ ;;
+ -b | --batch) BATCH=true ;;
+ -c | --cc) if [ $# -eq 1 ]; then echo "$USAGE"; $REMOVE_TEMP; exit 1; fi
+ shift ; CC="$1"
+ ;;
+ -s | --severity) if [ $# -eq 1 ]; then echo "$USAGE"; $REMOVE_TEMP; exit 1; fi
+ shift ; SEVERITY_C="$1"
+ ;;
+ -p | -P | --print) PRINT=true ;;
+ -L | --list) FORMAT=norm ;;
+ -l | -CL | --lisp) FORMAT=lisp ;;
+ --request-id) REQUEST_ID=true ;;
+ -h | --help) echo "$USAGE"; $REMOVE_TEMP; exit 0 ;;
+ -V | --version) cat <<EOF
+gccbug (GCC) $DEFAULT_RELEASE
+Copyright (C) 2002 Free Software Foundation, Inc.
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+EOF
+ $REMOVE_TEMP; exit 0 ;;
+ -*) echo "$USAGE" ; $REMOVE_TEMP; exit 1 ;;
+ *) echo "$USAGE" ; $REMOVE_TEMP; exit 1
+ esac
+ shift
+done
+
+# spam does not need to be listed here
+CATEGORIES="ada bootstrap c++ c debug driver fortran inline-asm java libgcj libobjc libstdc++ middle-end objc other pch preprocessor rtl-optimization target tree-optimization web"
+
+case "$FORMAT" in
+ lisp) echo "$CATEGORIES" | \
+ awk 'BEGIN {printf "( "} {printf "(\"%s\") ",$0} END {printf ")\n"}'
+ $REMOVE_TEMP
+ exit 0
+ ;;
+ norm) l=`echo "$CATEGORIES" | \
+ awk 'BEGIN {max = 0; } { if (length($0) > max) { max = length($0); } }
+ END {print max + 1;}'`
+ c=`expr 70 / $l`
+ if [ $c -eq 0 ]; then c=1; fi
+ echo "$CATEGORIES" | \
+ awk 'BEGIN {print "Known categories:"; i = 0 }
+ { printf ("%-'$l'.'$l's", $0); if ((++i % '$c') == 0) { print "" } }
+ END { print ""; }'
+ $REMOVE_TEMP
+ exit 0
+ ;;
+esac
+
+ORIGINATOR_C='<name of the PR author (one line)>'
+ORGANIZATION_C='<organization of PR author (multiple lines)>'
+SYNOPSIS_C='<synopsis of the problem (one line)>'
+if [ -z "$SEVERITY_C" ]; then
+ SEVERITY_C='<[ non-critical | serious | critical ] (one line)>'
+fi
+PRIORITY_C='<[ low | medium ] (one line)>'
+CATEGORY_C='<choose from the top of this file (one line)>'
+RELEASE_C='<release number or tag (one line)>'
+ENVIRONMENT_C='<machine, os, target, libraries (multiple lines)>'
+DESCRIPTION_C='<precise description of the problem (multiple lines)>'
+HOW_TO_REPEAT_C='<When reporting a compiler error, preprocessor output must be included>'
+FIX_C='<how to correct or work around the problem, if known (multiple lines)>'
+
+# Catch some signals. ($xs kludge needed by Sun /bin/sh)
+xs=0
+trap '$REMOVE_TEMP; exit $xs' 0
+trap 'echo "$COMMAND: Aborting ..."; $REMOVE_TEMP; xs=1; exit' 1 3 13 15
+
+# If they told us to use a specific file, then do so.
+if [ -n "$IN_FILE" ]; then
+ if [ "$IN_FILE" = "-" ]; then
+ # The PR is coming from the standard input.
+ if [ -n "$EXPLICIT_GNATS_ADDR" ]; then
+ sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" > $TEMP
+ else
+ cat > $TEMP
+ fi
+ else
+ # Use the file they named.
+ if [ -n "$EXPLICIT_GNATS_ADDR" ]; then
+ sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" $IN_FILE > $TEMP
+ else
+ cat $IN_FILE > $TEMP
+ fi
+ fi
+else
+
+ if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then
+ # If their PR_FORM points to a bogus entry, then bail.
+ if [ ! -f "$PR_FORM" -o ! -r "$PR_FORM" -o ! -s "$PR_FORM" ]; then
+ echo "$COMMAND: can't seem to read your template file (\`$PR_FORM'), ignoring PR_FORM"
+ sleep 1
+ PRINT_INTERN=bad_prform
+ fi
+ fi
+
+ if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then
+ cp $PR_FORM $TEMP ||
+ ( echo "$COMMAND: could not copy $PR_FORM" ; xs=1; exit )
+ else
+ for file in $TEMP $REF ; do
+ cat > $file << '__EOF__'
+SEND-PR: -*- send-pr -*-
+SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as
+SEND-PR: will all comments (text enclosed in `<' and `>').
+SEND-PR:
+SEND-PR: Please consult the GCC manual if you are not sure how to
+SEND-PR: fill out a problem report.
+SEND-PR: Note that the Synopsis field is mandatory. The Subject (for
+SEND-PR: the mail) will be made the same as Synopsis unless explicitly
+SEND-PR: changed.
+SEND-PR:
+SEND-PR: Choose from the following categories:
+SEND-PR:
+__EOF__
+
+ # Format the categories so they fit onto lines.
+ l=`echo "$CATEGORIES" | \
+ awk 'BEGIN {max = 0; } { if (length($0) > max) { max = length($0); } }
+ END {print max + 1;}'`
+ c=`expr 61 / $l`
+ if [ $c -eq 0 ]; then c=1; fi
+ echo "$CATEGORIES" | \
+ awk 'BEGIN {printf "SEND-PR: "; i = 0 }
+ { printf ("%-'$l'.'$l's", $0);
+ if ((++i % '$c') == 0) { printf "\nSEND-PR: " } }
+ END { printf "\nSEND-PR:\n"; }' >> $file
+
+ cat >> $file << __EOF__
+To: $GNATS_ADDR
+Subject:
+From: $FROM
+Reply-To: $REPLYTO
+Cc: $CC
+X-send-pr-version: $VERSION
+X-GNATS-Notify:
+
+
+>Submitter-Id: $SUBMITTER
+>Originator: $ORIGINATOR
+>Organization: ${ORGANIZATION-$ORGANIZATION_C}
+>Confidential: no
+SEND-PR: Leave "Confidential" as "no"; all GCC PRs are public.
+>Synopsis: $SYNOPSIS_C
+>Severity: $SEVERITY_C
+SEND-PR: critical GCC is completely not operational; no work-around known.
+SEND-PR: serious GCC is not working properly; a work-around is possible.
+SEND-PR: non-critical Report indicates minor problem.
+>Priority: $PRIORITY_C
+SEND-PR: medium The problem should be solved in the next release.
+SEND-PR: low The problem should be solve in a future release.
+>Category: $CATEGORY_C
+>Class: <[ doc-bug | accepts-illegal | rejects-legal | wrong-code | ice-on-legal-code| ice-on-illegal-code | pessimizes-code | sw-bug | change-request | support ] (one line)>
+SEND-PR: doc-bug The documentation is incorrect.
+SEND-PR: accepts-illegal GCC fails to reject erroneous code.
+SEND-PR: rejects-legal GCC gives an error message for correct code.
+SEND-PR: wrong-code The machine code generated by gcc is incorrect.
+SEND-PR: ice-on-legal-code GCC gives an Internal Compiler Error (ICE)
+SEND-PR: for correct code
+SEND-PR: ice-on-illegal-code GCC gives an ICE instead of reporting an error
+SEND-PR: pessimizes-code GCC misses an important optimization opportunity
+SEND-PR: sw-bug Software bug of some other class than above
+SEND-PR: change-request A feature in GCC is missing.
+SEND-PR: support I need help with gcc.
+>Release: ${DEFAULT_RELEASE-$RELEASE_C}
+>Environment:
+`[ -n "$SYSTEM" ] && echo System: $SYSTEM`
+`[ -n "$ARCH" ] && echo Architecture: $ARCH`
+`[ -n "$MACHINE" ] && echo Machine: $MACHINE`
+ $ENVIRONMENT_C
+host: i386-pc-linux-gnu
+build: i386-pc-linux-gnu
+target: mips-unknown-linux-uclibc
+__EOF__
+ cat >> $file << \__EOF__
+configured with: /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/gcc-4.4.2/configure --prefix=/usr --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=mips-linux-uclibc --enable-languages=c,c++ --with-sysroot=/opt/toolchains/uclibc-crosstools-gcc-4.4.2-1 --with-build-time-tools=/opt/toolchains/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --disable-libssp --disable-tls --enable-shared --with-gmp=/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/gmp --with-mpfr=/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/mpfr --disable-nls --enable-threads --disable-multilib --disable-decimal-float --with-float=soft --with-abi=32 --with-tune=mips32 --with-arch=mips32 --with-pkgversion='Buildroot 2010.02-git' --with-bugurl=http://bugs.buildroot.net/
+__EOF__
+ cat >> $file << __EOF__
+>Description:
+ $DESCRIPTION_C
+>How-To-Repeat:
+ $HOW_TO_REPEAT_C
+>Fix:
+ $FIX_C
+__EOF__
+ done
+ fi
+
+ if [ "$PRINT" = true -o "$PRINT_INTERN" = true ]; then
+ cat $TEMP
+ xs=0; exit
+ fi
+
+ chmod u+w $TEMP
+ if [ -z "$REQUEST_ID" ]; then
+ eval $EDIT $TEMP
+ else
+ ed -s $TEMP << '__EOF__'
+/^Subject/s/^Subject:.*/Subject: request for a customer id/
+/^>Category/s/^>Category:.*/>Category: send-pr/
+w
+q
+__EOF__
+ fi
+
+ if cmp -s $REF $TEMP ; then
+ echo "$COMMAND: problem report not filled out, therefore not sent"
+ xs=1; exit
+ fi
+fi
+
+#
+# Check the enumeration fields
+
+# This is a "sed-subroutine" with one keyword parameter
+# (with workaround for Sun sed bug)
+#
+SED_CMD='
+/$PATTERN/{
+s|||
+s|<.*>||
+s|^[ ]*||
+s|[ ]*$||
+p
+q
+}'
+
+
+while [ -z "$REQUEST_ID" ]; do
+ CNT=0
+
+ # 1) Confidential
+ #
+ PATTERN=">Confidential:"
+ CONFIDENTIAL=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
+ case "$CONFIDENTIAL" in
+ no) CNT=`expr $CNT + 1` ;;
+ *) echo "$COMMAND: \`$CONFIDENTIAL' is not a valid value for \`Confidential'." ;;
+ esac
+ #
+ # 2) Severity
+ #
+ PATTERN=">Severity:"
+ SEVERITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
+ case "$SEVERITY" in
+ ""|non-critical|serious|critical) CNT=`expr $CNT + 1` ;;
+ *) echo "$COMMAND: \`$SEVERITY' is not a valid value for \`Severity'."
+ esac
+ #
+ # 3) Priority
+ #
+ PATTERN=">Priority:"
+ PRIORITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
+ case "$PRIORITY" in
+ ""|low|medium) CNT=`expr $CNT + 1` ;;
+ high) echo "$COMMAND: \`Priority: high' is reserved for GCC maintainers." ;;
+ *) echo "$COMMAND: \`$PRIORITY' is not a valid value for \`Priority'."
+ esac
+ #
+ # 4) Category
+ #
+ PATTERN=">Category:"
+ CATEGORY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
+ FOUND=
+ for C in $CATEGORIES
+ do
+ if [ "$C" = "$CATEGORY" ]; then FOUND=true ; break ; fi
+ done
+ if [ -n "$FOUND" ]; then
+ CNT=`expr $CNT + 1`
+ else
+ if [ -z "$CATEGORY" ]; then
+ echo "$COMMAND: you must include a Category: field in your report."
+ else
+ echo "$COMMAND: \`$CATEGORY' is not a known category."
+ fi
+ fi
+ #
+ # 5) Class
+ #
+ PATTERN=">Class:"
+ CLASS=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
+ case "$CLASS" in
+ ""|doc-bug|accepts-illegal|rejects-legal|wrong-code|ice-on-legal-code|ice-on-illegal-code|pessimizes-code|sw-bug|change-request|support) CNT=`expr $CNT + 1` ;;
+ *) echo "$COMMAND: \`$CLASS' is not a valid value for \`Class'."
+ esac
+ #
+ # 6) Check that synopsis is not empty
+ #
+ if grep "^>Synopsis:[ ]*${SYNOPSIS_C}\$" $TEMP > /dev/null
+ then
+ echo "$COMMAND: Synopsis must not be empty."
+ else
+ CNT=`expr $CNT + 1`
+ fi
+
+ [ $CNT -lt 6 -a -z "$BATCH" ] &&
+ echo "Errors were found with the problem report."
+
+ while true; do
+ if [ -z "$BATCH" ]; then
+ $ECHON1 "a)bort, e)dit or s)end? $ECHON2"
+ read input
+ else
+ if [ $CNT -eq 6 ]; then
+ input=s
+ else
+ input=a
+ fi
+ fi
+ case "$input" in
+ a*)
+ if [ -z "$BATCH" ]; then
+ echo "$COMMAND: the problem report remains in $BAD and is not sent."
+ REMOVE_TEMP="rm -f $TEMP0 $TEMP $REF"
+ mv $TEMP $BAD
+ else
+ echo "$COMMAND: the problem report is not sent."
+ fi
+ xs=1; exit
+ ;;
+ e*)
+ eval $EDIT $TEMP
+ continue 2
+ ;;
+ s*)
+ break 2
+ ;;
+ esac
+ done
+done
+
+#
+# Make sure the mail has got a Subject. If not, use the same as
+# in Synopsis.
+#
+
+if grep '^Subject:[ ]*$' $TEMP > /dev/null
+then
+ SYNOPSIS=`grep '^>Synopsis:' $TEMP | sed -e 's/^>Synopsis:[ ]*//'`
+ ed -s $TEMP << __EOF__
+/^Subject:/s/:.*\$/: $SYNOPSIS/
+w
+q
+__EOF__
+fi
+
+#
+# Remove comments and send the problem report
+# (we have to use patterns, where the comment contains regex chars)
+#
+# /^>Originator:/s;$ORIGINATOR;;
+sed -e "
+/^SEND-PR:/d
+/^>Organization:/,/^>[A-Za-z-]*:/s;$ORGANIZATION_C;;
+/^>Confidential:/s;<.*>;;
+/^>Synopsis:/s;$SYNOPSIS_C;;
+/^>Severity:/s;<.*>;;
+/^>Priority:/s;<.*>;;
+/^>Category:/s;$CATEGORY_C;;
+/^>Class:/s;<.*>;;
+/^>Release:/,/^>[A-Za-z-]*:/s;$RELEASE_C;;
+/^>Environment:/,/^>[A-Za-z-]*:/s;$ENVIRONMENT_C;;
+/^>Description:/,/^>[A-Za-z-]*:/s;$DESCRIPTION_C;;
+/^>How-To-Repeat:/,/^>[A-Za-z-]*:/s;$HOW_TO_REPEAT_C;;
+/^>Fix:/,/^>[A-Za-z-]*:/s;$FIX_C;;
+" $TEMP > $REF
+
+if $MAIL_AGENT < $REF; then
+ echo "$COMMAND: problem report sent"
+ xs=0; exit
+else
+ echo "$COMMAND: mysterious mail failure."
+ if [ -z "$BATCH" ]; then
+ echo "$COMMAND: the problem report remains in $BAD and is not sent."
+ REMOVE_TEMP="rm -f $TEMP0 $TEMP $REF"
+ mv $REF $BAD
+ else
+ echo "$COMMAND: the problem report is not sent."
+ fi
+ xs=1; exit
+fi
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gcov b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gcov
new file mode 100755
index 0000000..6c0bb37
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gcov
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gdb b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gdb
new file mode 100755
index 0000000..4f4c9c8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gdb
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gprof b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gprof
new file mode 100755
index 0000000..13140ad
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-gprof
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-ld b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-ld
new file mode 100755
index 0000000..268e1f0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-ld
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-ldconfig b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-ldconfig
new file mode 120000
index 0000000..aea3041
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-ldconfig
@@ -0,0 +1 @@
+ldconfig \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-ldd b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-ldd
new file mode 120000
index 0000000..033f9e7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-ldd
@@ -0,0 +1 @@
+ldd \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-nm b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-nm
new file mode 100755
index 0000000..d08ce3e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-nm
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-objcopy b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-objcopy
new file mode 100755
index 0000000..72a06f0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-objcopy
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-objdump b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-objdump
new file mode 100755
index 0000000..40fe1e7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-objdump
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-ranlib b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-ranlib
new file mode 100755
index 0000000..a4cf0e4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-ranlib
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-readelf b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-readelf
new file mode 100755
index 0000000..6859bf3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-readelf
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-size b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-size
new file mode 100755
index 0000000..2318b46
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-size
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-sstrip b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-sstrip
new file mode 100755
index 0000000..bd5ab1c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-sstrip
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-strings b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-strings
new file mode 100755
index 0000000..6d93416
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-strings
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-strip b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-strip
new file mode 100755
index 0000000..72fb4aa
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-strip
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/a.out.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/a.out.h
new file mode 100644
index 0000000..d963de7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/a.out.h
@@ -0,0 +1,5 @@
+#ifdef _LIBC
+# include_next <linux/a.out.h>
+#else
+# include <linux/a.out.h>
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/alloca.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/alloca.h
new file mode 100644
index 0000000..b4fc317
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/alloca.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 1992, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ALLOCA_H
+#define _ALLOCA_H 1
+
+#include <features.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+__BEGIN_DECLS
+
+/* Remove any previous definitions. */
+#undef alloca
+
+/* Allocate a block that will be freed when the calling function exits. */
+extern void *alloca (size_t __size) __THROW;
+
+#ifdef __GNUC__
+# define alloca(size) __builtin_alloca (size)
+#endif /* GCC. */
+
+#define __MAX_ALLOCA_CUTOFF 65536
+
+__END_DECLS
+
+#endif /* alloca.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/ar.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/ar.h
new file mode 100644
index 0000000..5d157ec
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/ar.h
@@ -0,0 +1,48 @@
+/* Header describing `ar' archive file format.
+ Copyright (C) 1996 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _AR_H
+#define _AR_H 1
+
+#include <sys/cdefs.h>
+
+/* Archive files start with the ARMAG identifying string. Then follows a
+ `struct ar_hdr', and as many bytes of member file data as its `ar_size'
+ member indicates, for each member file. */
+
+#define ARMAG "!<arch>\n" /* String that begins an archive file. */
+#define SARMAG 8 /* Size of that string. */
+
+#define ARFMAG "`\n" /* String in ar_fmag at end of each header. */
+
+__BEGIN_DECLS
+
+struct ar_hdr
+ {
+ char ar_name[16]; /* Member file name, sometimes / terminated. */
+ char ar_date[12]; /* File date, decimal seconds since Epoch. */
+ char ar_uid[6], ar_gid[6]; /* User and group IDs, in ASCII decimal. */
+ char ar_mode[8]; /* File mode, in ASCII octal. */
+ char ar_size[10]; /* File size, in ASCII decimal. */
+ char ar_fmag[2]; /* Always contains ARFMAG. */
+ };
+
+__END_DECLS
+
+#endif /* ar.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/ftp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/ftp.h
new file mode 100644
index 0000000..e5b340d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/ftp.h
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 1983, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ftp.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _ARPA_FTP_H
+#define _ARPA_FTP_H 1
+
+/* Definitions for FTP; see RFC-765. */
+
+/*
+ * Reply codes.
+ */
+#define PRELIM 1 /* positive preliminary */
+#define COMPLETE 2 /* positive completion */
+#define CONTINUE 3 /* positive intermediate */
+#define TRANSIENT 4 /* transient negative completion */
+#define ERROR 5 /* permanent negative completion */
+
+/*
+ * Type codes
+ */
+#define TYPE_A 1 /* ASCII */
+#define TYPE_E 2 /* EBCDIC */
+#define TYPE_I 3 /* image */
+#define TYPE_L 4 /* local byte size */
+
+#ifdef FTP_NAMES
+char *typenames[] = {"0", "ASCII", "EBCDIC", "Image", "Local" };
+#endif
+
+/*
+ * Form codes
+ */
+#define FORM_N 1 /* non-print */
+#define FORM_T 2 /* telnet format effectors */
+#define FORM_C 3 /* carriage control (ASA) */
+#ifdef FTP_NAMES
+char *formnames[] = {"0", "Nonprint", "Telnet", "Carriage-control" };
+#endif
+
+/*
+ * Structure codes
+ */
+#define STRU_F 1 /* file (no record structure) */
+#define STRU_R 2 /* record structure */
+#define STRU_P 3 /* page structure */
+#ifdef FTP_NAMES
+char *strunames[] = {"0", "File", "Record", "Page" };
+#endif
+
+/*
+ * Mode types
+ */
+#define MODE_S 1 /* stream */
+#define MODE_B 2 /* block */
+#define MODE_C 3 /* compressed */
+#ifdef FTP_NAMES
+char *modenames[] = {"0", "Stream", "Block", "Compressed" };
+#endif
+
+/*
+ * Record Tokens
+ */
+#define REC_ESC '\377' /* Record-mode Escape */
+#define REC_EOR '\001' /* Record-mode End-of-Record */
+#define REC_EOF '\002' /* Record-mode End-of-File */
+
+/*
+ * Block Header
+ */
+#define BLK_EOR 0x80 /* Block is End-of-Record */
+#define BLK_EOF 0x40 /* Block is End-of-File */
+#define BLK_ERRORS 0x20 /* Block is suspected of containing errors */
+#define BLK_RESTART 0x10 /* Block is Restart Marker */
+
+#define BLK_BYTECOUNT 2 /* Bytes in this block */
+
+#endif /* arpa/ftp.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/inet.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/inet.h
new file mode 100644
index 0000000..fe3373b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/inet.h
@@ -0,0 +1,106 @@
+/* Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ARPA_INET_H
+#define _ARPA_INET_H 1
+
+#include <features.h>
+#include <netinet/in.h> /* To define `struct in_addr'. */
+
+/* Type for length arguments in socket calls. */
+#ifndef __socklen_t_defined
+typedef __socklen_t socklen_t;
+# define __socklen_t_defined
+#endif
+
+__BEGIN_DECLS
+
+/* Convert Internet host address from numbers-and-dots notation in CP
+ into binary data in network byte order. */
+extern in_addr_t inet_addr (__const char *__cp) __THROW;
+
+/* Return the local host address part of the Internet address in IN. */
+extern in_addr_t inet_lnaof (struct in_addr __in) __THROW;
+
+/* Make Internet host address in network byte order by combining the
+ network number NET with the local address HOST. */
+extern struct in_addr inet_makeaddr (in_addr_t __net, in_addr_t __host)
+ __THROW;
+
+/* Return network number part of the Internet address IN. */
+extern in_addr_t inet_netof (struct in_addr __in) __THROW;
+
+/* Extract the network number in network byte order from the address
+ in numbers-and-dots natation starting at CP. */
+extern in_addr_t inet_network (__const char *__cp) __THROW;
+
+/* Convert Internet number in IN to ASCII representation. The return value
+ is a pointer to an internal array containing the string. */
+extern char *inet_ntoa (struct in_addr __in) __THROW;
+
+/* Convert from presentation format of an Internet number in buffer
+ starting at CP to the binary network format and store result for
+ interface type AF in buffer starting at BUF. */
+extern int inet_pton (int __af, __const char *__restrict __cp,
+ void *__restrict __buf) __THROW;
+
+/* Convert a Internet address in binary network format for interface
+ type AF in buffer starting at CP to presentation form and place
+ result in buffer of length LEN astarting at BUF. */
+extern __const char *inet_ntop (int __af, __const void *__restrict __cp,
+ char *__restrict __buf, socklen_t __len)
+ __THROW;
+
+
+/* The following functions are not part of XNS 5.2. */
+#ifdef __USE_MISC
+/* Convert Internet host address from numbers-and-dots notation in CP
+ into binary data and store the result in the structure INP. */
+extern int inet_aton (__const char *__cp, struct in_addr *__inp) __THROW;
+
+/* Format a network number NET into presentation format and place result
+ in buffer starting at BUF with length of LEN bytes. */
+extern char *inet_neta (in_addr_t __net, char *__buf, size_t __len) __THROW;
+
+/* Convert network number for interface type AF in buffer starting at
+ CP to presentation format. The result will specifiy BITS bits of
+ the number. */
+extern char *inet_net_ntop (int __af, __const void *__cp, int __bits,
+ char *__buf, size_t __len) __THROW;
+
+/* Convert network number for interface type AF from presentation in
+ buffer starting at CP to network format and store result int
+ buffer starting at BUF of size LEN. */
+extern int inet_net_pton (int __af, __const char *__cp,
+ void *__buf, size_t __len) __THROW;
+
+/* Convert ASCII representation in hexadecimal form of the Internet
+ address to binary form and place result in buffer of length LEN
+ starting at BUF. */
+extern unsigned int inet_nsap_addr (__const char *__cp,
+ unsigned char *__buf, int __len) __THROW;
+
+/* Convert internet address in binary form in LEN bytes starting at CP
+ a presentation form and place result in BUF. */
+extern char *inet_nsap_ntoa (int __len, __const unsigned char *__cp,
+ char *__buf) __THROW;
+#endif
+
+__END_DECLS
+
+#endif /* arpa/inet.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/nameser.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/nameser.h
new file mode 100644
index 0000000..496c8db
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/nameser.h
@@ -0,0 +1,557 @@
+/*
+ * Copyright (c) 1983, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+/*
+ * $BINDId: nameser.h,v 8.37 2000/03/30 21:16:49 vixie Exp $
+ */
+
+#ifndef _ARPA_NAMESER_H_
+#define _ARPA_NAMESER_H_
+
+#define BIND_4_COMPAT
+
+#include <sys/param.h>
+#if (!defined(BSD)) || (BSD < 199306)
+# include <sys/bitypes.h>
+#else
+# include <sys/types.h>
+#endif
+#include <sys/cdefs.h>
+
+/*
+ * Revision information. This is the release date in YYYYMMDD format.
+ * It can change every day so the right thing to do with it is use it
+ * in preprocessor commands such as "#if (__NAMESER > 19931104)". Do not
+ * compare for equality; rather, use it to determine whether your libbind.a
+ * contains a new enough lib/nameser/ to support the feature you need.
+ */
+
+#define __NAMESER 19991006 /* New interface version stamp. */
+
+/*
+ * Define constants based on RFC 883, RFC 1034, RFC 1035
+ */
+#define NS_PACKETSZ 512 /* maximum packet size */
+#define NS_MAXDNAME 1025 /* maximum domain name */
+#define NS_MAXCDNAME 255 /* maximum compressed domain name */
+#define NS_MAXLABEL 63 /* maximum length of domain label */
+#define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */
+#define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */
+#define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */
+#define NS_INT32SZ 4 /* #/bytes of data in a u_int32_t */
+#define NS_INT16SZ 2 /* #/bytes of data in a u_int16_t */
+#define NS_INT8SZ 1 /* #/bytes of data in a u_int8_t */
+#define NS_INADDRSZ 4 /* IPv4 T_A */
+#define NS_IN6ADDRSZ 16 /* IPv6 T_AAAA */
+#define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */
+#define NS_DEFAULTPORT 53 /* For both TCP and UDP. */
+
+/*
+ * These can be expanded with synonyms, just keep ns_parse.c:ns_parserecord()
+ * in synch with it.
+ */
+typedef enum __ns_sect {
+ ns_s_qd = 0, /* Query: Question. */
+ ns_s_zn = 0, /* Update: Zone. */
+ ns_s_an = 1, /* Query: Answer. */
+ ns_s_pr = 1, /* Update: Prerequisites. */
+ ns_s_ns = 2, /* Query: Name servers. */
+ ns_s_ud = 2, /* Update: Update. */
+ ns_s_ar = 3, /* Query|Update: Additional records. */
+ ns_s_max = 4
+} ns_sect;
+
+/*
+ * This is a message handle. It is caller allocated and has no dynamic data.
+ * This structure is intended to be opaque to all but ns_parse.c, thus the
+ * leading _'s on the member names. Use the accessor functions, not the _'s.
+ */
+typedef struct __ns_msg {
+ const u_char *_msg, *_eom;
+ u_int16_t _id, _flags, _counts[ns_s_max];
+ const u_char *_sections[ns_s_max];
+ ns_sect _sect;
+ int _rrnum;
+ const u_char *_ptr;
+} ns_msg;
+
+/* Private data structure - do not use from outside library. */
+struct _ns_flagdata { int mask, shift; };
+extern struct _ns_flagdata _ns_flagdata[];
+
+/* Accessor macros - this is part of the public interface. */
+#define ns_msg_getflag(handle, flag) ( \
+ ((handle)._flags & _ns_flagdata[flag].mask) \
+ >> _ns_flagdata[flag].shift \
+ )
+#define ns_msg_id(handle) ((handle)._id + 0)
+#define ns_msg_base(handle) ((handle)._msg + 0)
+#define ns_msg_end(handle) ((handle)._eom + 0)
+#define ns_msg_size(handle) ((handle)._eom - (handle)._msg)
+#define ns_msg_count(handle, section) ((handle)._counts[section] + 0)
+
+/*
+ * This is a parsed record. It is caller allocated and has no dynamic data.
+ */
+typedef struct __ns_rr {
+ char name[NS_MAXDNAME];
+ u_int16_t type;
+ u_int16_t rr_class;
+ u_int32_t ttl;
+ u_int16_t rdlength;
+ const u_char * rdata;
+} ns_rr;
+
+/* Accessor macros - this is part of the public interface. */
+#define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".")
+#define ns_rr_type(rr) ((ns_type)((rr).type + 0))
+#define ns_rr_class(rr) ((ns_class)((rr).rr_class + 0))
+#define ns_rr_ttl(rr) ((rr).ttl + 0)
+#define ns_rr_rdlen(rr) ((rr).rdlength + 0)
+#define ns_rr_rdata(rr) ((rr).rdata + 0)
+
+/*
+ * These don't have to be in the same order as in the packet flags word,
+ * and they can even overlap in some cases, but they will need to be kept
+ * in synch with ns_parse.c:ns_flagdata[].
+ */
+typedef enum __ns_flag {
+ ns_f_qr, /* Question/Response. */
+ ns_f_opcode, /* Operation code. */
+ ns_f_aa, /* Authoritative Answer. */
+ ns_f_tc, /* Truncation occurred. */
+ ns_f_rd, /* Recursion Desired. */
+ ns_f_ra, /* Recursion Available. */
+ ns_f_z, /* MBZ. */
+ ns_f_ad, /* Authentic Data (DNSSEC). */
+ ns_f_cd, /* Checking Disabled (DNSSEC). */
+ ns_f_rcode, /* Response code. */
+ ns_f_max
+} ns_flag;
+
+/*
+ * Currently defined opcodes.
+ */
+typedef enum __ns_opcode {
+ ns_o_query = 0, /* Standard query. */
+ ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */
+ ns_o_status = 2, /* Name server status query (unsupported). */
+ /* Opcode 3 is undefined/reserved. */
+ ns_o_notify = 4, /* Zone change notification. */
+ ns_o_update = 5, /* Zone update message. */
+ ns_o_max = 6
+} ns_opcode;
+
+/*
+ * Currently defined response codes.
+ */
+typedef enum __ns_rcode {
+ ns_r_noerror = 0, /* No error occurred. */
+ ns_r_formerr = 1, /* Format error. */
+ ns_r_servfail = 2, /* Server failure. */
+ ns_r_nxdomain = 3, /* Name error. */
+ ns_r_notimpl = 4, /* Unimplemented. */
+ ns_r_refused = 5, /* Operation refused. */
+ /* these are for BIND_UPDATE */
+ ns_r_yxdomain = 6, /* Name exists */
+ ns_r_yxrrset = 7, /* RRset exists */
+ ns_r_nxrrset = 8, /* RRset does not exist */
+ ns_r_notauth = 9, /* Not authoritative for zone */
+ ns_r_notzone = 10, /* Zone of record different from zone section */
+ ns_r_max = 11,
+ /* The following are TSIG extended errors */
+ ns_r_badsig = 16,
+ ns_r_badkey = 17,
+ ns_r_badtime = 18
+} ns_rcode;
+
+/* BIND_UPDATE */
+typedef enum __ns_update_operation {
+ ns_uop_delete = 0,
+ ns_uop_add = 1,
+ ns_uop_max = 2
+} ns_update_operation;
+
+/*
+ * This structure is used for TSIG authenticated messages
+ */
+struct ns_tsig_key {
+ char name[NS_MAXDNAME], alg[NS_MAXDNAME];
+ unsigned char *data;
+ int len;
+};
+typedef struct ns_tsig_key ns_tsig_key;
+
+/*
+ * This structure is used for TSIG authenticated TCP messages
+ */
+struct ns_tcp_tsig_state {
+ int counter;
+ struct dst_key *key;
+ void *ctx;
+ unsigned char sig[NS_PACKETSZ];
+ int siglen;
+};
+typedef struct ns_tcp_tsig_state ns_tcp_tsig_state;
+
+#define NS_TSIG_FUDGE 300
+#define NS_TSIG_TCP_COUNT 100
+#define NS_TSIG_ALG_HMAC_MD5 "HMAC-MD5.SIG-ALG.REG.INT"
+
+#define NS_TSIG_ERROR_NO_TSIG -10
+#define NS_TSIG_ERROR_NO_SPACE -11
+#define NS_TSIG_ERROR_FORMERR -12
+
+/*
+ * Currently defined type values for resources and queries.
+ */
+typedef enum __ns_type {
+ ns_t_invalid = 0, /* Cookie. */
+ ns_t_a = 1, /* Host address. */
+ ns_t_ns = 2, /* Authoritative server. */
+ ns_t_md = 3, /* Mail destination. */
+ ns_t_mf = 4, /* Mail forwarder. */
+ ns_t_cname = 5, /* Canonical name. */
+ ns_t_soa = 6, /* Start of authority zone. */
+ ns_t_mb = 7, /* Mailbox domain name. */
+ ns_t_mg = 8, /* Mail group member. */
+ ns_t_mr = 9, /* Mail rename name. */
+ ns_t_null = 10, /* Null resource record. */
+ ns_t_wks = 11, /* Well known service. */
+ ns_t_ptr = 12, /* Domain name pointer. */
+ ns_t_hinfo = 13, /* Host information. */
+ ns_t_minfo = 14, /* Mailbox information. */
+ ns_t_mx = 15, /* Mail routing information. */
+ ns_t_txt = 16, /* Text strings. */
+ ns_t_rp = 17, /* Responsible person. */
+ ns_t_afsdb = 18, /* AFS cell database. */
+ ns_t_x25 = 19, /* X_25 calling address. */
+ ns_t_isdn = 20, /* ISDN calling address. */
+ ns_t_rt = 21, /* Router. */
+ ns_t_nsap = 22, /* NSAP address. */
+ ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */
+ ns_t_sig = 24, /* Security signature. */
+ ns_t_key = 25, /* Security key. */
+ ns_t_px = 26, /* X.400 mail mapping. */
+ ns_t_gpos = 27, /* Geographical position (withdrawn). */
+ ns_t_aaaa = 28, /* Ip6 Address. */
+ ns_t_loc = 29, /* Location Information. */
+ ns_t_nxt = 30, /* Next domain (security). */
+ ns_t_eid = 31, /* Endpoint identifier. */
+ ns_t_nimloc = 32, /* Nimrod Locator. */
+ ns_t_srv = 33, /* Server Selection. */
+ ns_t_atma = 34, /* ATM Address */
+ ns_t_naptr = 35, /* Naming Authority PoinTeR */
+ ns_t_kx = 36, /* Key Exchange */
+ ns_t_cert = 37, /* Certification record */
+ ns_t_a6 = 38, /* IPv6 address (deprecates AAAA) */
+ ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */
+ ns_t_sink = 40, /* Kitchen sink (experimentatl) */
+ ns_t_opt = 41, /* EDNS0 option (meta-RR) */
+ ns_t_tsig = 250, /* Transaction signature. */
+ ns_t_ixfr = 251, /* Incremental zone transfer. */
+ ns_t_axfr = 252, /* Transfer zone of authority. */
+ ns_t_mailb = 253, /* Transfer mailbox records. */
+ ns_t_maila = 254, /* Transfer mail agent records. */
+ ns_t_any = 255, /* Wildcard match. */
+ ns_t_zxfr = 256, /* BIND-specific, nonstandard. */
+ ns_t_max = 65536
+} ns_type;
+
+/* Exclusively a QTYPE? (not also an RTYPE) */
+#define ns_t_qt_p(t) (ns_t_xfr_p(t) || (t) == ns_t_any || \
+ (t) == ns_t_mailb || (t) == ns_t_maila)
+/* Some kind of meta-RR? (not a QTYPE, but also not an RTYPE) */
+#define ns_t_mrr_p(t) ((t) == ns_t_tsig || (t) == ns_t_opt)
+/* Exclusively an RTYPE? (not also a QTYPE or a meta-RR) */
+#define ns_t_rr_p(t) (!ns_t_qt_p(t) && !ns_t_mrr_p(t))
+#define ns_t_udp_p(t) ((t) != ns_t_axfr && (t) != ns_t_zxfr)
+#define ns_t_xfr_p(t) ((t) == ns_t_axfr || (t) == ns_t_ixfr || \
+ (t) == ns_t_zxfr)
+
+/*
+ * Values for class field
+ */
+typedef enum __ns_class {
+ ns_c_invalid = 0, /* Cookie. */
+ ns_c_in = 1, /* Internet. */
+ ns_c_2 = 2, /* unallocated/unsupported. */
+ ns_c_chaos = 3, /* MIT Chaos-net. */
+ ns_c_hs = 4, /* MIT Hesiod. */
+ /* Query class values which do not appear in resource records */
+ ns_c_none = 254, /* for prereq. sections in update requests */
+ ns_c_any = 255, /* Wildcard match. */
+ ns_c_max = 65536
+} ns_class;
+
+/* DNSSEC constants. */
+
+typedef enum __ns_key_types {
+ ns_kt_rsa = 1, /* key type RSA/MD5 */
+ ns_kt_dh = 2, /* Diffie Hellman */
+ ns_kt_dsa = 3, /* Digital Signature Standard (MANDATORY) */
+ ns_kt_private = 254 /* Private key type starts with OID */
+} ns_key_types;
+
+typedef enum __ns_cert_types {
+ cert_t_pkix = 1, /* PKIX (X.509v3) */
+ cert_t_spki = 2, /* SPKI */
+ cert_t_pgp = 3, /* PGP */
+ cert_t_url = 253, /* URL private type */
+ cert_t_oid = 254 /* OID private type */
+} ns_cert_types;
+
+/* Flags field of the KEY RR rdata. */
+#define NS_KEY_TYPEMASK 0xC000 /* Mask for "type" bits */
+#define NS_KEY_TYPE_AUTH_CONF 0x0000 /* Key usable for both */
+#define NS_KEY_TYPE_CONF_ONLY 0x8000 /* Key usable for confidentiality */
+#define NS_KEY_TYPE_AUTH_ONLY 0x4000 /* Key usable for authentication */
+#define NS_KEY_TYPE_NO_KEY 0xC000 /* No key usable for either; no key */
+/* The type bits can also be interpreted independently, as single bits: */
+#define NS_KEY_NO_AUTH 0x8000 /* Key unusable for authentication */
+#define NS_KEY_NO_CONF 0x4000 /* Key unusable for confidentiality */
+#define NS_KEY_RESERVED2 0x2000 /* Security is *mandatory* if bit=0 */
+#define NS_KEY_EXTENDED_FLAGS 0x1000 /* reserved - must be zero */
+#define NS_KEY_RESERVED4 0x0800 /* reserved - must be zero */
+#define NS_KEY_RESERVED5 0x0400 /* reserved - must be zero */
+#define NS_KEY_NAME_TYPE 0x0300 /* these bits determine the type */
+#define NS_KEY_NAME_USER 0x0000 /* key is assoc. with user */
+#define NS_KEY_NAME_ENTITY 0x0200 /* key is assoc. with entity eg host */
+#define NS_KEY_NAME_ZONE 0x0100 /* key is zone key */
+#define NS_KEY_NAME_RESERVED 0x0300 /* reserved meaning */
+#define NS_KEY_RESERVED8 0x0080 /* reserved - must be zero */
+#define NS_KEY_RESERVED9 0x0040 /* reserved - must be zero */
+#define NS_KEY_RESERVED10 0x0020 /* reserved - must be zero */
+#define NS_KEY_RESERVED11 0x0010 /* reserved - must be zero */
+#define NS_KEY_SIGNATORYMASK 0x000F /* key can sign RR's of same name */
+#define NS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED2 | \
+ NS_KEY_RESERVED4 | \
+ NS_KEY_RESERVED5 | \
+ NS_KEY_RESERVED8 | \
+ NS_KEY_RESERVED9 | \
+ NS_KEY_RESERVED10 | \
+ NS_KEY_RESERVED11 )
+#define NS_KEY_RESERVED_BITMASK2 0xFFFF /* no bits defined here */
+
+/* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */
+#define NS_ALG_MD5RSA 1 /* MD5 with RSA */
+#define NS_ALG_DH 2 /* Diffie Hellman KEY */
+#define NS_ALG_DSA 3 /* DSA KEY */
+#define NS_ALG_DSS NS_ALG_DSA
+#define NS_ALG_EXPIRE_ONLY 253 /* No alg, no security */
+#define NS_ALG_PRIVATE_OID 254 /* Key begins with OID giving alg */
+
+/* Protocol values */
+/* value 0 is reserved */
+#define NS_KEY_PROT_TLS 1
+#define NS_KEY_PROT_EMAIL 2
+#define NS_KEY_PROT_DNSSEC 3
+#define NS_KEY_PROT_IPSEC 4
+#define NS_KEY_PROT_ANY 255
+
+/* Signatures */
+#define NS_MD5RSA_MIN_BITS 512 /* Size of a mod or exp in bits */
+#define NS_MD5RSA_MAX_BITS 2552
+ /* Total of binary mod and exp */
+#define NS_MD5RSA_MAX_BYTES ((NS_MD5RSA_MAX_BITS+7/8)*2+3)
+ /* Max length of text sig block */
+#define NS_MD5RSA_MAX_BASE64 (((NS_MD5RSA_MAX_BYTES+2)/3)*4)
+#define NS_MD5RSA_MIN_SIZE ((NS_MD5RSA_MIN_BITS+7)/8)
+#define NS_MD5RSA_MAX_SIZE ((NS_MD5RSA_MAX_BITS+7)/8)
+
+#define NS_DSA_SIG_SIZE 41
+#define NS_DSA_MIN_SIZE 213
+#define NS_DSA_MAX_BYTES 405
+
+/* Offsets into SIG record rdata to find various values */
+#define NS_SIG_TYPE 0 /* Type flags */
+#define NS_SIG_ALG 2 /* Algorithm */
+#define NS_SIG_LABELS 3 /* How many labels in name */
+#define NS_SIG_OTTL 4 /* Original TTL */
+#define NS_SIG_EXPIR 8 /* Expiration time */
+#define NS_SIG_SIGNED 12 /* Signature time */
+#define NS_SIG_FOOT 16 /* Key footprint */
+#define NS_SIG_SIGNER 18 /* Domain name of who signed it */
+
+/* How RR types are represented as bit-flags in NXT records */
+#define NS_NXT_BITS 8
+#define NS_NXT_BIT_SET( n,p) (p[(n)/NS_NXT_BITS] |= (0x80>>((n)%NS_NXT_BITS)))
+#define NS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS)))
+#define NS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] & (0x80>>((n)%NS_NXT_BITS)))
+#define NS_NXT_MAX 127
+
+/*
+ * Inline versions of get/put short/long. Pointer is advanced.
+ */
+#define NS_GET16(s, cp) do { \
+ register u_char *t_cp = (u_char *)(cp); \
+ (s) = ((u_int16_t)t_cp[0] << 8) \
+ | ((u_int16_t)t_cp[1]) \
+ ; \
+ (cp) += NS_INT16SZ; \
+} while (0)
+
+#define NS_GET32(l, cp) do { \
+ register u_char *t_cp = (u_char *)(cp); \
+ (l) = ((u_int32_t)t_cp[0] << 24) \
+ | ((u_int32_t)t_cp[1] << 16) \
+ | ((u_int32_t)t_cp[2] << 8) \
+ | ((u_int32_t)t_cp[3]) \
+ ; \
+ (cp) += NS_INT32SZ; \
+} while (0)
+
+#define NS_PUT16(s, cp) do { \
+ register u_int16_t t_s = (u_int16_t)(s); \
+ register u_char *t_cp = (u_char *)(cp); \
+ *t_cp++ = t_s >> 8; \
+ *t_cp = t_s; \
+ (cp) += NS_INT16SZ; \
+} while (0)
+
+#define NS_PUT32(l, cp) do { \
+ register u_int32_t t_l = (u_int32_t)(l); \
+ register u_char *t_cp = (u_char *)(cp); \
+ *t_cp++ = t_l >> 24; \
+ *t_cp++ = t_l >> 16; \
+ *t_cp++ = t_l >> 8; \
+ *t_cp = t_l; \
+ (cp) += NS_INT32SZ; \
+} while (0)
+
+/*
+ * ANSI C identifier hiding for bind's lib/nameser.
+ */
+#define ns_get16 __ns_get16
+#define ns_get32 __ns_get32
+#define ns_put16 __ns_put16
+#define ns_put32 __ns_put32
+#define ns_initparse __ns_initparse
+#define ns_skiprr __ns_skiprr
+#define ns_parserr __ns_parserr
+#define ns_sprintrr __ns_sprintrr
+#define ns_sprintrrf __ns_sprintrrf
+#define ns_format_ttl __ns_format_ttl
+#define ns_parse_ttl __ns_parse_ttl
+#define ns_datetosecs __ns_datetosecs
+#define ns_name_ntol __ns_name_ntol
+#define ns_name_ntop __ns_name_ntop
+#define ns_name_pton __ns_name_pton
+#define ns_name_unpack __ns_name_unpack
+#define ns_name_pack __ns_name_pack
+#define ns_name_compress __ns_name_compress
+#define ns_name_uncompress __ns_name_uncompress
+#define ns_name_skip __ns_name_skip
+#define ns_name_rollback __ns_name_rollback
+#define ns_sign __ns_sign
+#define ns_sign_tcp __ns_sign_tcp
+#define ns_sign_tcp_init __ns_sign_tcp_init
+#define ns_find_tsig __ns_find_tsig
+#define ns_verify __ns_verify
+#define ns_verify_tcp __ns_verify_tcp
+#define ns_verify_tcp_init __ns_verify_tcp_init
+#define ns_samedomain __ns_samedomain
+#define ns_subdomain __ns_subdomain
+#define ns_makecanon __ns_makecanon
+#define ns_samename __ns_samename
+
+__BEGIN_DECLS
+u_int ns_get16 (const u_char *) __THROW;
+u_long ns_get32 (const u_char *) __THROW;
+void ns_put16 (u_int, u_char *) __THROW;
+void ns_put32 (u_long, u_char *) __THROW;
+int ns_initparse (const u_char *, int, ns_msg *) __THROW;
+int ns_skiprr (const u_char *, const u_char *, ns_sect, int)
+ __THROW;
+int ns_parserr (ns_msg *, ns_sect, int, ns_rr *) __THROW;
+int ns_sprintrr (const ns_msg *, const ns_rr *,
+ const char *, const char *, char *, size_t)
+ __THROW;
+int ns_sprintrrf (const u_char *, size_t, const char *,
+ ns_class, ns_type, u_long, const u_char *,
+ size_t, const char *, const char *,
+ char *, size_t) __THROW;
+int ns_format_ttl (u_long, char *, size_t) __THROW;
+int ns_parse_ttl (const char *, u_long *) __THROW;
+u_int32_t ns_datetosecs (const char *cp, int *errp) __THROW;
+int ns_name_ntol (const u_char *, u_char *, size_t) __THROW;
+int ns_name_ntop (const u_char *, char *, size_t) __THROW;
+int ns_name_pton (const char *, u_char *, size_t) __THROW;
+int ns_name_unpack (const u_char *, const u_char *,
+ const u_char *, u_char *, size_t) __THROW;
+int ns_name_pack (const u_char *, u_char *, int,
+ const u_char **, const u_char **) __THROW;
+int ns_name_uncompress (const u_char *, const u_char *,
+ const u_char *, char *, size_t) __THROW;
+int ns_name_compress (const char *, u_char *, size_t,
+ const u_char **, const u_char **) __THROW;
+int ns_name_skip (const u_char **, const u_char *) __THROW;
+void ns_name_rollback (const u_char *, const u_char **,
+ const u_char **) __THROW;
+int ns_sign (u_char *, int *, int, int, void *,
+ const u_char *, int, u_char *, int *, time_t) __THROW;
+int ns_sign_tcp (u_char *, int *, int, int,
+ ns_tcp_tsig_state *, int) __THROW;
+int ns_sign_tcp_init (void *, const u_char *, int,
+ ns_tcp_tsig_state *) __THROW;
+u_char *ns_find_tsig (u_char *, u_char *) __THROW;
+int ns_verify (u_char *, int *, void *, const u_char *, int,
+ u_char *, int *, time_t *, int) __THROW;
+int ns_verify_tcp (u_char *, int *, ns_tcp_tsig_state *, int)
+ __THROW;
+int ns_verify_tcp_init (void *, const u_char *, int,
+ ns_tcp_tsig_state *) __THROW;
+int ns_samedomain (const char *, const char *) __THROW;
+int ns_subdomain (const char *, const char *) __THROW;
+int ns_makecanon (const char *, char *, size_t) __THROW;
+int ns_samename (const char *, const char *) __THROW;
+__END_DECLS
+
+#ifdef BIND_4_COMPAT
+#include <arpa/nameser_compat.h>
+#endif
+
+#endif /* !_ARPA_NAMESER_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/nameser_compat.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/nameser_compat.h
new file mode 100644
index 0000000..43bcd3a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/nameser_compat.h
@@ -0,0 +1,183 @@
+/* Copyright (c) 1983, 1989
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * from nameser.h 8.1 (Berkeley) 6/2/93
+ * $BINDId: nameser_compat.h,v 8.11 1999/01/02 08:00:58 vixie Exp $
+ */
+
+#ifndef _ARPA_NAMESER_COMPAT_
+#define _ARPA_NAMESER_COMPAT_
+
+#define __BIND 19950621 /* (DEAD) interface version stamp. */
+
+#include <endian.h>
+
+/*
+ * Structure for query header. The order of the fields is machine- and
+ * compiler-dependent, depending on the byte/bit order and the layout
+ * of bit fields. We use bit fields only in int variables, as this
+ * is all ANSI requires. This requires a somewhat confusing rearrangement.
+ */
+
+typedef struct {
+ unsigned id :16; /* query identification number */
+#if BYTE_ORDER == BIG_ENDIAN
+ /* fields in third byte */
+ unsigned qr: 1; /* response flag */
+ unsigned opcode: 4; /* purpose of message */
+ unsigned aa: 1; /* authoritive answer */
+ unsigned tc: 1; /* truncated message */
+ unsigned rd: 1; /* recursion desired */
+ /* fields in fourth byte */
+ unsigned ra: 1; /* recursion available */
+ unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
+ unsigned ad: 1; /* authentic data from named */
+ unsigned cd: 1; /* checking disabled by resolver */
+ unsigned rcode :4; /* response code */
+#endif
+#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
+ /* fields in third byte */
+ unsigned rd :1; /* recursion desired */
+ unsigned tc :1; /* truncated message */
+ unsigned aa :1; /* authoritive answer */
+ unsigned opcode :4; /* purpose of message */
+ unsigned qr :1; /* response flag */
+ /* fields in fourth byte */
+ unsigned rcode :4; /* response code */
+ unsigned cd: 1; /* checking disabled by resolver */
+ unsigned ad: 1; /* authentic data from named */
+ unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
+ unsigned ra :1; /* recursion available */
+#endif
+ /* remaining bytes */
+ unsigned qdcount :16; /* number of question entries */
+ unsigned ancount :16; /* number of answer entries */
+ unsigned nscount :16; /* number of authority entries */
+ unsigned arcount :16; /* number of resource entries */
+} HEADER;
+
+#define PACKETSZ NS_PACKETSZ
+#define MAXDNAME NS_MAXDNAME
+#define MAXCDNAME NS_MAXCDNAME
+#define MAXLABEL NS_MAXLABEL
+#define HFIXEDSZ NS_HFIXEDSZ
+#define QFIXEDSZ NS_QFIXEDSZ
+#define RRFIXEDSZ NS_RRFIXEDSZ
+#define INT32SZ NS_INT32SZ
+#define INT16SZ NS_INT16SZ
+#define INADDRSZ NS_INADDRSZ
+#define IN6ADDRSZ NS_IN6ADDRSZ
+#define INDIR_MASK NS_CMPRSFLGS
+#define NAMESERVER_PORT NS_DEFAULTPORT
+
+#define S_ZONE ns_s_zn
+#define S_PREREQ ns_s_pr
+#define S_UPDATE ns_s_ud
+#define S_ADDT ns_s_ar
+
+#define QUERY ns_o_query
+#define IQUERY ns_o_iquery
+#define STATUS ns_o_status
+#define NS_NOTIFY_OP ns_o_notify
+#define NS_UPDATE_OP ns_o_update
+
+#define NOERROR ns_r_noerror
+#define FORMERR ns_r_formerr
+#define SERVFAIL ns_r_servfail
+#define NXDOMAIN ns_r_nxdomain
+#define NOTIMP ns_r_notimpl
+#define REFUSED ns_r_refused
+#define YXDOMAIN ns_r_yxdomain
+#define YXRRSET ns_r_yxrrset
+#define NXRRSET ns_r_nxrrset
+#define NOTAUTH ns_r_notauth
+#define NOTZONE ns_r_notzone
+/*#define BADSIG ns_r_badsig*/
+/*#define BADKEY ns_r_badkey*/
+/*#define BADTIME ns_r_badtime*/
+
+
+#define DELETE ns_uop_delete
+#define ADD ns_uop_add
+
+#define T_A ns_t_a
+#define T_NS ns_t_ns
+#define T_MD ns_t_md
+#define T_MF ns_t_mf
+#define T_CNAME ns_t_cname
+#define T_SOA ns_t_soa
+#define T_MB ns_t_mb
+#define T_MG ns_t_mg
+#define T_MR ns_t_mr
+#define T_NULL ns_t_null
+#define T_WKS ns_t_wks
+#define T_PTR ns_t_ptr
+#define T_HINFO ns_t_hinfo
+#define T_MINFO ns_t_minfo
+#define T_MX ns_t_mx
+#define T_TXT ns_t_txt
+#define T_RP ns_t_rp
+#define T_AFSDB ns_t_afsdb
+#define T_X25 ns_t_x25
+#define T_ISDN ns_t_isdn
+#define T_RT ns_t_rt
+#define T_NSAP ns_t_nsap
+#define T_NSAP_PTR ns_t_nsap_ptr
+#define T_SIG ns_t_sig
+#define T_KEY ns_t_key
+#define T_PX ns_t_px
+#define T_GPOS ns_t_gpos
+#define T_AAAA ns_t_aaaa
+#define T_LOC ns_t_loc
+#define T_NXT ns_t_nxt
+#define T_EID ns_t_eid
+#define T_NIMLOC ns_t_nimloc
+#define T_SRV ns_t_srv
+#define T_ATMA ns_t_atma
+#define T_NAPTR ns_t_naptr
+#define T_TSIG ns_t_tsig
+#define T_IXFR ns_t_ixfr
+#define T_AXFR ns_t_axfr
+#define T_MAILB ns_t_mailb
+#define T_MAILA ns_t_maila
+#define T_ANY ns_t_any
+
+#define C_IN ns_c_in
+#define C_CHAOS ns_c_chaos
+#define C_HS ns_c_hs
+/* BIND_UPDATE */
+#define C_NONE ns_c_none
+#define C_ANY ns_c_any
+
+#define GETSHORT NS_GET16
+#define GETLONG NS_GET32
+#define PUTSHORT NS_PUT16
+#define PUTLONG NS_PUT32
+
+#endif /* _ARPA_NAMESER_COMPAT_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/telnet.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/telnet.h
new file mode 100644
index 0000000..3774c89
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/telnet.h
@@ -0,0 +1,316 @@
+/*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)telnet.h 8.2 (Berkeley) 12/15/93
+ */
+
+#ifndef _ARPA_TELNET_H
+#define _ARPA_TELNET_H 1
+
+/*
+ * Definitions for the TELNET protocol.
+ */
+#define IAC 255 /* interpret as command: */
+#define DONT 254 /* you are not to use option */
+#define DO 253 /* please, you use option */
+#define WONT 252 /* I won't use option */
+#define WILL 251 /* I will use option */
+#define SB 250 /* interpret as subnegotiation */
+#define GA 249 /* you may reverse the line */
+#define EL 248 /* erase the current line */
+#define EC 247 /* erase the current character */
+#define AYT 246 /* are you there */
+#define AO 245 /* abort output--but let prog finish */
+#define IP 244 /* interrupt process--permanently */
+#define BREAK 243 /* break */
+#define DM 242 /* data mark--for connect. cleaning */
+#define NOP 241 /* nop */
+#define SE 240 /* end sub negotiation */
+#define EOR 239 /* end of record (transparent mode) */
+#define ABORT 238 /* Abort process */
+#define SUSP 237 /* Suspend process */
+#define xEOF 236 /* End of file: EOF is already used... */
+
+#define SYNCH 242 /* for telfunc calls */
+
+#ifdef TELCMDS
+char *telcmds[] = {
+ "EOF", "SUSP", "ABORT", "EOR",
+ "SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
+ "EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0,
+};
+#else
+extern char *telcmds[];
+#endif
+
+#define TELCMD_FIRST xEOF
+#define TELCMD_LAST IAC
+#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && \
+ (unsigned int)(x) >= TELCMD_FIRST)
+#define TELCMD(x) telcmds[(x)-TELCMD_FIRST]
+
+/* telnet options */
+#define TELOPT_BINARY 0 /* 8-bit data path */
+#define TELOPT_ECHO 1 /* echo */
+#define TELOPT_RCP 2 /* prepare to reconnect */
+#define TELOPT_SGA 3 /* suppress go ahead */
+#define TELOPT_NAMS 4 /* approximate message size */
+#define TELOPT_STATUS 5 /* give status */
+#define TELOPT_TM 6 /* timing mark */
+#define TELOPT_RCTE 7 /* remote controlled transmission and echo */
+#define TELOPT_NAOL 8 /* negotiate about output line width */
+#define TELOPT_NAOP 9 /* negotiate about output page size */
+#define TELOPT_NAOCRD 10 /* negotiate about CR disposition */
+#define TELOPT_NAOHTS 11 /* negotiate about horizontal tabstops */
+#define TELOPT_NAOHTD 12 /* negotiate about horizontal tab disposition */
+#define TELOPT_NAOFFD 13 /* negotiate about formfeed disposition */
+#define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */
+#define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */
+#define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */
+#define TELOPT_XASCII 17 /* extended ascii character set */
+#define TELOPT_LOGOUT 18 /* force logout */
+#define TELOPT_BM 19 /* byte macro */
+#define TELOPT_DET 20 /* data entry terminal */
+#define TELOPT_SUPDUP 21 /* supdup protocol */
+#define TELOPT_SUPDUPOUTPUT 22 /* supdup output */
+#define TELOPT_SNDLOC 23 /* send location */
+#define TELOPT_TTYPE 24 /* terminal type */
+#define TELOPT_EOR 25 /* end or record */
+#define TELOPT_TUID 26 /* TACACS user identification */
+#define TELOPT_OUTMRK 27 /* output marking */
+#define TELOPT_TTYLOC 28 /* terminal location number */
+#define TELOPT_3270REGIME 29 /* 3270 regime */
+#define TELOPT_X3PAD 30 /* X.3 PAD */
+#define TELOPT_NAWS 31 /* window size */
+#define TELOPT_TSPEED 32 /* terminal speed */
+#define TELOPT_LFLOW 33 /* remote flow control */
+#define TELOPT_LINEMODE 34 /* Linemode option */
+#define TELOPT_XDISPLOC 35 /* X Display Location */
+#define TELOPT_OLD_ENVIRON 36 /* Old - Environment variables */
+#define TELOPT_AUTHENTICATION 37/* Authenticate */
+#define TELOPT_ENCRYPT 38 /* Encryption option */
+#define TELOPT_NEW_ENVIRON 39 /* New - Environment variables */
+#define TELOPT_EXOPL 255 /* extended-options-list */
+
+
+#define NTELOPTS (1+TELOPT_NEW_ENVIRON)
+#ifdef TELOPTS
+char *telopts[NTELOPTS+1] = {
+ "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
+ "STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
+ "NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
+ "NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
+ "DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT",
+ "SEND LOCATION", "TERMINAL TYPE", "END OF RECORD",
+ "TACACS UID", "OUTPUT MARKING", "TTYLOC",
+ "3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
+ "LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
+ "ENCRYPT", "NEW-ENVIRON",
+ 0,
+};
+#define TELOPT_FIRST TELOPT_BINARY
+#define TELOPT_LAST TELOPT_NEW_ENVIRON
+#define TELOPT_OK(x) ((unsigned int)(x) <= TELOPT_LAST)
+#define TELOPT(x) telopts[(x)-TELOPT_FIRST]
+#endif
+
+/* sub-option qualifiers */
+#define TELQUAL_IS 0 /* option is... */
+#define TELQUAL_SEND 1 /* send option */
+#define TELQUAL_INFO 2 /* ENVIRON: informational version of IS */
+#define TELQUAL_REPLY 2 /* AUTHENTICATION: client version of IS */
+#define TELQUAL_NAME 3 /* AUTHENTICATION: client version of IS */
+
+#define LFLOW_OFF 0 /* Disable remote flow control */
+#define LFLOW_ON 1 /* Enable remote flow control */
+#define LFLOW_RESTART_ANY 2 /* Restart output on any char */
+#define LFLOW_RESTART_XON 3 /* Restart output only on XON */
+
+/*
+ * LINEMODE suboptions
+ */
+
+#define LM_MODE 1
+#define LM_FORWARDMASK 2
+#define LM_SLC 3
+
+#define MODE_EDIT 0x01
+#define MODE_TRAPSIG 0x02
+#define MODE_ACK 0x04
+#define MODE_SOFT_TAB 0x08
+#define MODE_LIT_ECHO 0x10
+
+#define MODE_MASK 0x1f
+
+/* Not part of protocol, but needed to simplify things... */
+#define MODE_FLOW 0x0100
+#define MODE_ECHO 0x0200
+#define MODE_INBIN 0x0400
+#define MODE_OUTBIN 0x0800
+#define MODE_FORCE 0x1000
+
+#define SLC_SYNCH 1
+#define SLC_BRK 2
+#define SLC_IP 3
+#define SLC_AO 4
+#define SLC_AYT 5
+#define SLC_EOR 6
+#define SLC_ABORT 7
+#define SLC_EOF 8
+#define SLC_SUSP 9
+#define SLC_EC 10
+#define SLC_EL 11
+#define SLC_EW 12
+#define SLC_RP 13
+#define SLC_LNEXT 14
+#define SLC_XON 15
+#define SLC_XOFF 16
+#define SLC_FORW1 17
+#define SLC_FORW2 18
+
+#define NSLC 18
+
+/*
+ * For backwards compatibility, we define SLC_NAMES to be the
+ * list of names if SLC_NAMES is not defined.
+ */
+#define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
+ "ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \
+ "LNEXT", "XON", "XOFF", "FORW1", "FORW2", 0,
+#ifdef SLC_NAMES
+char *slc_names[] = {
+ SLC_NAMELIST
+};
+#else
+extern char *slc_names[];
+#define SLC_NAMES SLC_NAMELIST
+#endif
+
+#define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC)
+#define SLC_NAME(x) slc_names[x]
+
+#define SLC_NOSUPPORT 0
+#define SLC_CANTCHANGE 1
+#define SLC_VARIABLE 2
+#define SLC_DEFAULT 3
+#define SLC_LEVELBITS 0x03
+
+#define SLC_FUNC 0
+#define SLC_FLAGS 1
+#define SLC_VALUE 2
+
+#define SLC_ACK 0x80
+#define SLC_FLUSHIN 0x40
+#define SLC_FLUSHOUT 0x20
+
+#define OLD_ENV_VAR 1
+#define OLD_ENV_VALUE 0
+#define NEW_ENV_VAR 0
+#define NEW_ENV_VALUE 1
+#define ENV_ESC 2
+#define ENV_USERVAR 3
+
+/*
+ * AUTHENTICATION suboptions
+ */
+
+/*
+ * Who is authenticating who ...
+ */
+#define AUTH_WHO_CLIENT 0 /* Client authenticating server */
+#define AUTH_WHO_SERVER 1 /* Server authenticating client */
+#define AUTH_WHO_MASK 1
+
+/*
+ * amount of authentication done
+ */
+#define AUTH_HOW_ONE_WAY 0
+#define AUTH_HOW_MUTUAL 2
+#define AUTH_HOW_MASK 2
+
+#define AUTHTYPE_NULL 0
+#define AUTHTYPE_KERBEROS_V4 1
+#define AUTHTYPE_KERBEROS_V5 2
+#define AUTHTYPE_SPX 3
+#define AUTHTYPE_MINK 4
+#define AUTHTYPE_CNT 5
+
+#define AUTHTYPE_TEST 99
+
+#ifdef AUTH_NAMES
+char *authtype_names[] = {
+ "NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK", 0,
+};
+#else
+extern char *authtype_names[];
+#endif
+
+#define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT)
+#define AUTHTYPE_NAME(x) authtype_names[x]
+
+/*
+ * ENCRYPTion suboptions
+ */
+#define ENCRYPT_IS 0 /* I pick encryption type ... */
+#define ENCRYPT_SUPPORT 1 /* I support encryption types ... */
+#define ENCRYPT_REPLY 2 /* Initial setup response */
+#define ENCRYPT_START 3 /* Am starting to send encrypted */
+#define ENCRYPT_END 4 /* Am ending encrypted */
+#define ENCRYPT_REQSTART 5 /* Request you start encrypting */
+#define ENCRYPT_REQEND 6 /* Request you send encrypting */
+#define ENCRYPT_ENC_KEYID 7
+#define ENCRYPT_DEC_KEYID 8
+#define ENCRYPT_CNT 9
+
+#define ENCTYPE_ANY 0
+#define ENCTYPE_DES_CFB64 1
+#define ENCTYPE_DES_OFB64 2
+#define ENCTYPE_CNT 3
+
+#ifdef ENCRYPT_NAMES
+char *encrypt_names[] = {
+ "IS", "SUPPORT", "REPLY", "START", "END",
+ "REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID",
+ 0,
+};
+char *enctype_names[] = {
+ "ANY", "DES_CFB64", "DES_OFB64", 0,
+};
+#else
+extern char *encrypt_names[];
+extern char *enctype_names[];
+#endif
+
+
+#define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT)
+#define ENCRYPT_NAME(x) encrypt_names[x]
+
+#define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT)
+#define ENCTYPE_NAME(x) enctype_names[x]
+
+#endif /* arpa/telnet.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/tftp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/tftp.h
new file mode 100644
index 0000000..21b0559
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/arpa/tftp.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)tftp.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _ARPA_TFTP_H
+#define _ARPA_TFTP_H 1
+
+/*
+ * Trivial File Transfer Protocol (IEN-133)
+ */
+#define SEGSIZE 512 /* data segment size */
+
+/*
+ * Packet types.
+ */
+#define RRQ 01 /* read request */
+#define WRQ 02 /* write request */
+#define DATA 03 /* data packet */
+#define ACK 04 /* acknowledgement */
+#define ERROR 05 /* error code */
+
+struct tftphdr {
+ short th_opcode; /* packet type */
+ union {
+ unsigned short tu_block; /* block # */
+ short tu_code; /* error code */
+ char tu_stuff[1]; /* request packet stuff */
+ } __attribute__ ((__packed__)) th_u;
+ char th_data[1]; /* data or error string */
+} __attribute__ ((__packed__));
+
+#define th_block th_u.tu_block
+#define th_code th_u.tu_code
+#define th_stuff th_u.tu_stuff
+#define th_msg th_data
+
+/*
+ * Error codes.
+ */
+#define EUNDEF 0 /* not defined */
+#define ENOTFOUND 1 /* file not found */
+#define EACCESS 2 /* access violation */
+#define ENOSPACE 3 /* disk full or allocation exceeded */
+#define EBADOP 4 /* illegal TFTP operation */
+#define EBADID 5 /* unknown transfer ID */
+#define EEXISTS 6 /* file already exists */
+#define ENOUSER 7 /* no such user */
+
+#endif /* arpa/tftp.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/..install.cmd
new file mode 100644
index 0000000..3cc39f6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/asm-generic/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/asm-generic /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/asm-generic mips errno-base.h errno.h fcntl.h int-l64.h int-ll64.h ioctl.h mman.h poll.h resource.h siginfo.h signal.h statfs.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/asm-generic /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/asm-generic mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/asm-generic/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/errno-base.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/errno-base.h
new file mode 100644
index 0000000..6511597
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/errno-base.h
@@ -0,0 +1,39 @@
+#ifndef _ASM_GENERIC_ERRNO_BASE_H
+#define _ASM_GENERIC_ERRNO_BASE_H
+
+#define EPERM 1 /* Operation not permitted */
+#define ENOENT 2 /* No such file or directory */
+#define ESRCH 3 /* No such process */
+#define EINTR 4 /* Interrupted system call */
+#define EIO 5 /* I/O error */
+#define ENXIO 6 /* No such device or address */
+#define E2BIG 7 /* Argument list too long */
+#define ENOEXEC 8 /* Exec format error */
+#define EBADF 9 /* Bad file number */
+#define ECHILD 10 /* No child processes */
+#define EAGAIN 11 /* Try again */
+#define ENOMEM 12 /* Out of memory */
+#define EACCES 13 /* Permission denied */
+#define EFAULT 14 /* Bad address */
+#define ENOTBLK 15 /* Block device required */
+#define EBUSY 16 /* Device or resource busy */
+#define EEXIST 17 /* File exists */
+#define EXDEV 18 /* Cross-device link */
+#define ENODEV 19 /* No such device */
+#define ENOTDIR 20 /* Not a directory */
+#define EISDIR 21 /* Is a directory */
+#define EINVAL 22 /* Invalid argument */
+#define ENFILE 23 /* File table overflow */
+#define EMFILE 24 /* Too many open files */
+#define ENOTTY 25 /* Not a typewriter */
+#define ETXTBSY 26 /* Text file busy */
+#define EFBIG 27 /* File too large */
+#define ENOSPC 28 /* No space left on device */
+#define ESPIPE 29 /* Illegal seek */
+#define EROFS 30 /* Read-only file system */
+#define EMLINK 31 /* Too many links */
+#define EPIPE 32 /* Broken pipe */
+#define EDOM 33 /* Math argument out of domain of func */
+#define ERANGE 34 /* Math result not representable */
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/errno.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/errno.h
new file mode 100644
index 0000000..e8852c0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/errno.h
@@ -0,0 +1,109 @@
+#ifndef _ASM_GENERIC_ERRNO_H
+#define _ASM_GENERIC_ERRNO_H
+
+#include <asm-generic/errno-base.h>
+
+#define EDEADLK 35 /* Resource deadlock would occur */
+#define ENAMETOOLONG 36 /* File name too long */
+#define ENOLCK 37 /* No record locks available */
+#define ENOSYS 38 /* Function not implemented */
+#define ENOTEMPTY 39 /* Directory not empty */
+#define ELOOP 40 /* Too many symbolic links encountered */
+#define EWOULDBLOCK EAGAIN /* Operation would block */
+#define ENOMSG 42 /* No message of desired type */
+#define EIDRM 43 /* Identifier removed */
+#define ECHRNG 44 /* Channel number out of range */
+#define EL2NSYNC 45 /* Level 2 not synchronized */
+#define EL3HLT 46 /* Level 3 halted */
+#define EL3RST 47 /* Level 3 reset */
+#define ELNRNG 48 /* Link number out of range */
+#define EUNATCH 49 /* Protocol driver not attached */
+#define ENOCSI 50 /* No CSI structure available */
+#define EL2HLT 51 /* Level 2 halted */
+#define EBADE 52 /* Invalid exchange */
+#define EBADR 53 /* Invalid request descriptor */
+#define EXFULL 54 /* Exchange full */
+#define ENOANO 55 /* No anode */
+#define EBADRQC 56 /* Invalid request code */
+#define EBADSLT 57 /* Invalid slot */
+
+#define EDEADLOCK EDEADLK
+
+#define EBFONT 59 /* Bad font file format */
+#define ENOSTR 60 /* Device not a stream */
+#define ENODATA 61 /* No data available */
+#define ETIME 62 /* Timer expired */
+#define ENOSR 63 /* Out of streams resources */
+#define ENONET 64 /* Machine is not on the network */
+#define ENOPKG 65 /* Package not installed */
+#define EREMOTE 66 /* Object is remote */
+#define ENOLINK 67 /* Link has been severed */
+#define EADV 68 /* Advertise error */
+#define ESRMNT 69 /* Srmount error */
+#define ECOMM 70 /* Communication error on send */
+#define EPROTO 71 /* Protocol error */
+#define EMULTIHOP 72 /* Multihop attempted */
+#define EDOTDOT 73 /* RFS specific error */
+#define EBADMSG 74 /* Not a data message */
+#define EOVERFLOW 75 /* Value too large for defined data type */
+#define ENOTUNIQ 76 /* Name not unique on network */
+#define EBADFD 77 /* File descriptor in bad state */
+#define EREMCHG 78 /* Remote address changed */
+#define ELIBACC 79 /* Can not access a needed shared library */
+#define ELIBBAD 80 /* Accessing a corrupted shared library */
+#define ELIBSCN 81 /* .lib section in a.out corrupted */
+#define ELIBMAX 82 /* Attempting to link in too many shared libraries */
+#define ELIBEXEC 83 /* Cannot exec a shared library directly */
+#define EILSEQ 84 /* Illegal byte sequence */
+#define ERESTART 85 /* Interrupted system call should be restarted */
+#define ESTRPIPE 86 /* Streams pipe error */
+#define EUSERS 87 /* Too many users */
+#define ENOTSOCK 88 /* Socket operation on non-socket */
+#define EDESTADDRREQ 89 /* Destination address required */
+#define EMSGSIZE 90 /* Message too long */
+#define EPROTOTYPE 91 /* Protocol wrong type for socket */
+#define ENOPROTOOPT 92 /* Protocol not available */
+#define EPROTONOSUPPORT 93 /* Protocol not supported */
+#define ESOCKTNOSUPPORT 94 /* Socket type not supported */
+#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
+#define EPFNOSUPPORT 96 /* Protocol family not supported */
+#define EAFNOSUPPORT 97 /* Address family not supported by protocol */
+#define EADDRINUSE 98 /* Address already in use */
+#define EADDRNOTAVAIL 99 /* Cannot assign requested address */
+#define ENETDOWN 100 /* Network is down */
+#define ENETUNREACH 101 /* Network is unreachable */
+#define ENETRESET 102 /* Network dropped connection because of reset */
+#define ECONNABORTED 103 /* Software caused connection abort */
+#define ECONNRESET 104 /* Connection reset by peer */
+#define ENOBUFS 105 /* No buffer space available */
+#define EISCONN 106 /* Transport endpoint is already connected */
+#define ENOTCONN 107 /* Transport endpoint is not connected */
+#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */
+#define ETOOMANYREFS 109 /* Too many references: cannot splice */
+#define ETIMEDOUT 110 /* Connection timed out */
+#define ECONNREFUSED 111 /* Connection refused */
+#define EHOSTDOWN 112 /* Host is down */
+#define EHOSTUNREACH 113 /* No route to host */
+#define EALREADY 114 /* Operation already in progress */
+#define EINPROGRESS 115 /* Operation now in progress */
+#define ESTALE 116 /* Stale NFS file handle */
+#define EUCLEAN 117 /* Structure needs cleaning */
+#define ENOTNAM 118 /* Not a XENIX named type file */
+#define ENAVAIL 119 /* No XENIX semaphores available */
+#define EISNAM 120 /* Is a named type file */
+#define EREMOTEIO 121 /* Remote I/O error */
+#define EDQUOT 122 /* Quota exceeded */
+
+#define ENOMEDIUM 123 /* No medium found */
+#define EMEDIUMTYPE 124 /* Wrong medium type */
+#define ECANCELED 125 /* Operation Canceled */
+#define ENOKEY 126 /* Required key not available */
+#define EKEYEXPIRED 127 /* Key has expired */
+#define EKEYREVOKED 128 /* Key has been revoked */
+#define EKEYREJECTED 129 /* Key was rejected by service */
+
+/* for robust mutexes */
+#define EOWNERDEAD 130 /* Owner died */
+#define ENOTRECOVERABLE 131 /* State not recoverable */
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/fcntl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/fcntl.h
new file mode 100644
index 0000000..4d3e483
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/fcntl.h
@@ -0,0 +1,151 @@
+#ifndef _ASM_GENERIC_FCNTL_H
+#define _ASM_GENERIC_FCNTL_H
+
+#include <linux/types.h>
+
+/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
+ located on an ext2 file system */
+#define O_ACCMODE 00000003
+#define O_RDONLY 00000000
+#define O_WRONLY 00000001
+#define O_RDWR 00000002
+#ifndef O_CREAT
+#define O_CREAT 00000100 /* not fcntl */
+#endif
+#ifndef O_EXCL
+#define O_EXCL 00000200 /* not fcntl */
+#endif
+#ifndef O_NOCTTY
+#define O_NOCTTY 00000400 /* not fcntl */
+#endif
+#ifndef O_TRUNC
+#define O_TRUNC 00001000 /* not fcntl */
+#endif
+#ifndef O_APPEND
+#define O_APPEND 00002000
+#endif
+#ifndef O_NONBLOCK
+#define O_NONBLOCK 00004000
+#endif
+#ifndef O_SYNC
+#define O_SYNC 00010000
+#endif
+#ifndef FASYNC
+#define FASYNC 00020000 /* fcntl, for BSD compatibility */
+#endif
+#ifndef O_DIRECT
+#define O_DIRECT 00040000 /* direct disk access hint */
+#endif
+#ifndef O_LARGEFILE
+#define O_LARGEFILE 00100000
+#endif
+#ifndef O_DIRECTORY
+#define O_DIRECTORY 00200000 /* must be a directory */
+#endif
+#ifndef O_NOFOLLOW
+#define O_NOFOLLOW 00400000 /* don't follow links */
+#endif
+#ifndef O_NOATIME
+#define O_NOATIME 01000000
+#endif
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 02000000 /* set close_on_exec */
+#endif
+#ifndef O_NDELAY
+#define O_NDELAY O_NONBLOCK
+#endif
+
+#define F_DUPFD 0 /* dup */
+#define F_GETFD 1 /* get close_on_exec */
+#define F_SETFD 2 /* set/clear close_on_exec */
+#define F_GETFL 3 /* get file->f_flags */
+#define F_SETFL 4 /* set file->f_flags */
+#ifndef F_GETLK
+#define F_GETLK 5
+#define F_SETLK 6
+#define F_SETLKW 7
+#endif
+#ifndef F_SETOWN
+#define F_SETOWN 8 /* for sockets. */
+#define F_GETOWN 9 /* for sockets. */
+#endif
+#ifndef F_SETSIG
+#define F_SETSIG 10 /* for sockets. */
+#define F_GETSIG 11 /* for sockets. */
+#endif
+
+/* for F_[GET|SET]FL */
+#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
+
+/* for posix fcntl() and lockf() */
+#ifndef F_RDLCK
+#define F_RDLCK 0
+#define F_WRLCK 1
+#define F_UNLCK 2
+#endif
+
+/* for old implementation of bsd flock () */
+#ifndef F_EXLCK
+#define F_EXLCK 4 /* or 3 */
+#define F_SHLCK 8 /* or 4 */
+#endif
+
+/* for leases */
+#ifndef F_INPROGRESS
+#define F_INPROGRESS 16
+#endif
+
+/* operations for bsd flock(), also used by the kernel implementation */
+#define LOCK_SH 1 /* shared lock */
+#define LOCK_EX 2 /* exclusive lock */
+#define LOCK_NB 4 /* or'd with one of the above to prevent
+ blocking */
+#define LOCK_UN 8 /* remove lock */
+
+#define LOCK_MAND 32 /* This is a mandatory flock ... */
+#define LOCK_READ 64 /* which allows concurrent read operations */
+#define LOCK_WRITE 128 /* which allows concurrent write operations */
+#define LOCK_RW 192 /* which allows concurrent read & write ops */
+
+#define F_LINUX_SPECIFIC_BASE 1024
+
+#ifndef HAVE_ARCH_STRUCT_FLOCK
+#ifndef __ARCH_FLOCK_PAD
+#define __ARCH_FLOCK_PAD
+#endif
+
+struct flock {
+ short l_type;
+ short l_whence;
+ __kernel_off_t l_start;
+ __kernel_off_t l_len;
+ __kernel_pid_t l_pid;
+ __ARCH_FLOCK_PAD
+};
+#endif
+
+#ifndef CONFIG_64BIT
+
+#ifndef F_GETLK64
+#define F_GETLK64 12 /* using 'struct flock64' */
+#define F_SETLK64 13
+#define F_SETLKW64 14
+#endif
+
+#ifndef HAVE_ARCH_STRUCT_FLOCK64
+#ifndef __ARCH_FLOCK64_PAD
+#define __ARCH_FLOCK64_PAD
+#endif
+
+struct flock64 {
+ short l_type;
+ short l_whence;
+ __kernel_loff_t l_start;
+ __kernel_loff_t l_len;
+ __kernel_pid_t l_pid;
+ __ARCH_FLOCK64_PAD
+};
+#endif
+#endif /* !CONFIG_64BIT */
+
+#endif /* _ASM_GENERIC_FCNTL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/int-l64.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/int-l64.h
new file mode 100644
index 0000000..2a3239e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/int-l64.h
@@ -0,0 +1,32 @@
+/*
+ * asm-generic/int-l64.h
+ *
+ * Integer declarations for architectures which use "long"
+ * for 64-bit types.
+ */
+
+#ifndef _ASM_GENERIC_INT_L64_H
+#define _ASM_GENERIC_INT_L64_H
+
+#ifndef __ASSEMBLY__
+/*
+ * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
+ * header files exported to user space
+ */
+
+typedef __signed__ char __s8;
+typedef unsigned char __u8;
+
+typedef __signed__ short __s16;
+typedef unsigned short __u16;
+
+typedef __signed__ int __s32;
+typedef unsigned int __u32;
+
+typedef __signed__ long __s64;
+typedef unsigned long __u64;
+
+#endif /* __ASSEMBLY__ */
+
+
+#endif /* _ASM_GENERIC_INT_L64_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/int-ll64.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/int-ll64.h
new file mode 100644
index 0000000..d797333
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/int-ll64.h
@@ -0,0 +1,37 @@
+/*
+ * asm-generic/int-ll64.h
+ *
+ * Integer declarations for architectures which use "long long"
+ * for 64-bit types.
+ */
+
+#ifndef _ASM_GENERIC_INT_LL64_H
+#define _ASM_GENERIC_INT_LL64_H
+
+#ifndef __ASSEMBLY__
+/*
+ * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
+ * header files exported to user space
+ */
+
+typedef __signed__ char __s8;
+typedef unsigned char __u8;
+
+typedef __signed__ short __s16;
+typedef unsigned short __u16;
+
+typedef __signed__ int __s32;
+typedef unsigned int __u32;
+
+#ifdef __GNUC__
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
+#else
+typedef __signed__ long long __s64;
+typedef unsigned long long __u64;
+#endif
+
+#endif /* __ASSEMBLY__ */
+
+
+#endif /* _ASM_GENERIC_INT_LL64_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/ioctl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/ioctl.h
new file mode 100644
index 0000000..0da2c7d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/ioctl.h
@@ -0,0 +1,96 @@
+#ifndef _ASM_GENERIC_IOCTL_H
+#define _ASM_GENERIC_IOCTL_H
+
+/* ioctl command encoding: 32 bits total, command in lower 16 bits,
+ * size of the parameter structure in the lower 14 bits of the
+ * upper 16 bits.
+ * Encoding the size of the parameter structure in the ioctl request
+ * is useful for catching programs compiled with old versions
+ * and to avoid overwriting user space outside the user buffer area.
+ * The highest 2 bits are reserved for indicating the ``access mode''.
+ * NOTE: This limits the max parameter size to 16kB -1 !
+ */
+
+/*
+ * The following is for compatibility across the various Linux
+ * platforms. The generic ioctl numbering scheme doesn't really enforce
+ * a type field. De facto, however, the top 8 bits of the lower 16
+ * bits are indeed used as a type field, so we might just as well make
+ * this explicit here. Please be sure to use the decoding macros
+ * below from now on.
+ */
+#define _IOC_NRBITS 8
+#define _IOC_TYPEBITS 8
+
+/*
+ * Let any architecture override either of the following before
+ * including this file.
+ */
+
+#ifndef _IOC_SIZEBITS
+# define _IOC_SIZEBITS 14
+#endif
+
+#ifndef _IOC_DIRBITS
+# define _IOC_DIRBITS 2
+#endif
+
+#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
+#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
+#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
+#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
+
+#define _IOC_NRSHIFT 0
+#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
+#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
+#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
+
+/*
+ * Direction bits, which any architecture can choose to override
+ * before including this file.
+ */
+
+#ifndef _IOC_NONE
+# define _IOC_NONE 0U
+#endif
+
+#ifndef _IOC_WRITE
+# define _IOC_WRITE 1U
+#endif
+
+#ifndef _IOC_READ
+# define _IOC_READ 2U
+#endif
+
+#define _IOC(dir,type,nr,size) \
+ (((dir) << _IOC_DIRSHIFT) | \
+ ((type) << _IOC_TYPESHIFT) | \
+ ((nr) << _IOC_NRSHIFT) | \
+ ((size) << _IOC_SIZESHIFT))
+
+#define _IOC_TYPECHECK(t) (sizeof(t))
+
+/* used to create numbers */
+#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
+#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size)))
+#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
+#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
+#define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
+#define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
+#define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
+
+/* used to decode ioctl numbers.. */
+#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
+#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
+#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
+#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
+
+/* ...and for the drivers/sound files... */
+
+#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
+#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
+#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
+#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
+#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
+
+#endif /* _ASM_GENERIC_IOCTL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/mman.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/mman.h
new file mode 100644
index 0000000..5e3dde2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/mman.h
@@ -0,0 +1,41 @@
+#ifndef _ASM_GENERIC_MMAN_H
+#define _ASM_GENERIC_MMAN_H
+
+/*
+ Author: Michael S. Tsirkin <mst@mellanox.co.il>, Mellanox Technologies Ltd.
+ Based on: asm-xxx/mman.h
+*/
+
+#define PROT_READ 0x1 /* page can be read */
+#define PROT_WRITE 0x2 /* page can be written */
+#define PROT_EXEC 0x4 /* page can be executed */
+#define PROT_SEM 0x8 /* page may be used for atomic ops */
+#define PROT_NONE 0x0 /* page can not be accessed */
+#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
+#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
+
+#define MAP_SHARED 0x01 /* Share changes */
+#define MAP_PRIVATE 0x02 /* Changes are private */
+#define MAP_TYPE 0x0f /* Mask for type of mapping */
+#define MAP_FIXED 0x10 /* Interpret addr exactly */
+#define MAP_ANONYMOUS 0x20 /* don't use a file */
+
+#define MS_ASYNC 1 /* sync memory asynchronously */
+#define MS_INVALIDATE 2 /* invalidate the caches */
+#define MS_SYNC 4 /* synchronous memory sync */
+
+#define MADV_NORMAL 0 /* no further special treatment */
+#define MADV_RANDOM 1 /* expect random page references */
+#define MADV_SEQUENTIAL 2 /* expect sequential page references */
+#define MADV_WILLNEED 3 /* will need these pages */
+#define MADV_DONTNEED 4 /* don't need these pages */
+
+/* common parameters: try to keep these consistent across architectures */
+#define MADV_REMOVE 9 /* remove these pages & resources */
+#define MADV_DONTFORK 10 /* don't inherit across fork */
+#define MADV_DOFORK 11 /* do inherit across fork */
+
+/* compatibility flags */
+#define MAP_FILE 0
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/poll.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/poll.h
new file mode 100644
index 0000000..44bce83
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/poll.h
@@ -0,0 +1,37 @@
+#ifndef __ASM_GENERIC_POLL_H
+#define __ASM_GENERIC_POLL_H
+
+/* These are specified by iBCS2 */
+#define POLLIN 0x0001
+#define POLLPRI 0x0002
+#define POLLOUT 0x0004
+#define POLLERR 0x0008
+#define POLLHUP 0x0010
+#define POLLNVAL 0x0020
+
+/* The rest seem to be more-or-less nonstandard. Check them! */
+#define POLLRDNORM 0x0040
+#define POLLRDBAND 0x0080
+#ifndef POLLWRNORM
+#define POLLWRNORM 0x0100
+#endif
+#ifndef POLLWRBAND
+#define POLLWRBAND 0x0200
+#endif
+#ifndef POLLMSG
+#define POLLMSG 0x0400
+#endif
+#ifndef POLLREMOVE
+#define POLLREMOVE 0x1000
+#endif
+#ifndef POLLRDHUP
+#define POLLRDHUP 0x2000
+#endif
+
+struct pollfd {
+ int fd;
+ short events;
+ short revents;
+};
+
+#endif /* __ASM_GENERIC_POLL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/resource.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/resource.h
new file mode 100644
index 0000000..a36da84
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/resource.h
@@ -0,0 +1,68 @@
+#ifndef _ASM_GENERIC_RESOURCE_H
+#define _ASM_GENERIC_RESOURCE_H
+
+/*
+ * Resource limit IDs
+ *
+ * ( Compatibility detail: there are architectures that have
+ * a different rlimit ID order in the 5-9 range and want
+ * to keep that order for binary compatibility. The reasons
+ * are historic and all new rlimits are identical across all
+ * arches. If an arch has such special order for some rlimits
+ * then it defines them prior including asm-generic/resource.h. )
+ */
+
+#define RLIMIT_CPU 0 /* CPU time in sec */
+#define RLIMIT_FSIZE 1 /* Maximum filesize */
+#define RLIMIT_DATA 2 /* max data size */
+#define RLIMIT_STACK 3 /* max stack size */
+#define RLIMIT_CORE 4 /* max core file size */
+
+#ifndef RLIMIT_RSS
+# define RLIMIT_RSS 5 /* max resident set size */
+#endif
+
+#ifndef RLIMIT_NPROC
+# define RLIMIT_NPROC 6 /* max number of processes */
+#endif
+
+#ifndef RLIMIT_NOFILE
+# define RLIMIT_NOFILE 7 /* max number of open files */
+#endif
+
+#ifndef RLIMIT_MEMLOCK
+# define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */
+#endif
+
+#ifndef RLIMIT_AS
+# define RLIMIT_AS 9 /* address space limit */
+#endif
+
+#define RLIMIT_LOCKS 10 /* maximum file locks held */
+#define RLIMIT_SIGPENDING 11 /* max number of pending signals */
+#define RLIMIT_MSGQUEUE 12 /* maximum bytes in POSIX mqueues */
+#define RLIMIT_NICE 13 /* max nice prio allowed to raise to
+ 0-39 for nice level 19 .. -20 */
+#define RLIMIT_RTPRIO 14 /* maximum realtime priority */
+#define RLIMIT_RTTIME 15 /* timeout for RT tasks in us */
+#define RLIM_NLIMITS 16
+
+/*
+ * SuS says limits have to be unsigned.
+ * Which makes a ton more sense anyway.
+ *
+ * Some architectures override this (for compatibility reasons):
+ */
+#ifndef RLIM_INFINITY
+# define RLIM_INFINITY (~0UL)
+#endif
+
+/*
+ * RLIMIT_STACK default maximum - some architectures override it:
+ */
+#ifndef _STK_LIM_MAX
+# define _STK_LIM_MAX RLIM_INFINITY
+#endif
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/siginfo.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/siginfo.h
new file mode 100644
index 0000000..f6d812f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/siginfo.h
@@ -0,0 +1,261 @@
+#ifndef _ASM_GENERIC_SIGINFO_H
+#define _ASM_GENERIC_SIGINFO_H
+
+
+#include <linux/types.h>
+
+typedef union sigval {
+ int sival_int;
+ void *sival_ptr;
+} sigval_t;
+
+/*
+ * This is the size (including padding) of the part of the
+ * struct siginfo that is before the union.
+ */
+#ifndef __ARCH_SI_PREAMBLE_SIZE
+#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
+#endif
+
+#define SI_MAX_SIZE 128
+#ifndef SI_PAD_SIZE
+#define SI_PAD_SIZE ((SI_MAX_SIZE - __ARCH_SI_PREAMBLE_SIZE) / sizeof(int))
+#endif
+
+#ifndef __ARCH_SI_UID_T
+#define __ARCH_SI_UID_T __kernel_uid32_t
+#endif
+
+/*
+ * The default "si_band" type is "long", as specified by POSIX.
+ * However, some architectures want to override this to "int"
+ * for historical compatibility reasons, so we allow that.
+ */
+#ifndef __ARCH_SI_BAND_T
+#define __ARCH_SI_BAND_T long
+#endif
+
+#ifndef HAVE_ARCH_SIGINFO_T
+
+typedef struct siginfo {
+ int si_signo;
+ int si_errno;
+ int si_code;
+
+ union {
+ int _pad[SI_PAD_SIZE];
+
+ /* kill() */
+ struct {
+ __kernel_pid_t _pid; /* sender's pid */
+ __ARCH_SI_UID_T _uid; /* sender's uid */
+ } _kill;
+
+ /* POSIX.1b timers */
+ struct {
+ __kernel_timer_t _tid; /* timer id */
+ int _overrun; /* overrun count */
+ char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
+ sigval_t _sigval; /* same as below */
+ int _sys_private; /* not to be passed to user */
+ } _timer;
+
+ /* POSIX.1b signals */
+ struct {
+ __kernel_pid_t _pid; /* sender's pid */
+ __ARCH_SI_UID_T _uid; /* sender's uid */
+ sigval_t _sigval;
+ } _rt;
+
+ /* SIGCHLD */
+ struct {
+ __kernel_pid_t _pid; /* which child */
+ __ARCH_SI_UID_T _uid; /* sender's uid */
+ int _status; /* exit code */
+ __kernel_clock_t _utime;
+ __kernel_clock_t _stime;
+ } _sigchld;
+
+ /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
+ struct {
+ void *_addr; /* faulting insn/memory ref. */
+#ifdef __ARCH_SI_TRAPNO
+ int _trapno; /* TRAP # which caused the signal */
+#endif
+ } _sigfault;
+
+ /* SIGPOLL */
+ struct {
+ __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */
+ int _fd;
+ } _sigpoll;
+ } _sifields;
+} siginfo_t;
+
+#endif
+
+/*
+ * How these fields are to be accessed.
+ */
+#define si_pid _sifields._kill._pid
+#define si_uid _sifields._kill._uid
+#define si_tid _sifields._timer._tid
+#define si_overrun _sifields._timer._overrun
+#define si_sys_private _sifields._timer._sys_private
+#define si_status _sifields._sigchld._status
+#define si_utime _sifields._sigchld._utime
+#define si_stime _sifields._sigchld._stime
+#define si_value _sifields._rt._sigval
+#define si_int _sifields._rt._sigval.sival_int
+#define si_ptr _sifields._rt._sigval.sival_ptr
+#define si_addr _sifields._sigfault._addr
+#ifdef __ARCH_SI_TRAPNO
+#define si_trapno _sifields._sigfault._trapno
+#endif
+#define si_band _sifields._sigpoll._band
+#define si_fd _sifields._sigpoll._fd
+
+#define __SI_KILL 0
+#define __SI_TIMER 0
+#define __SI_POLL 0
+#define __SI_FAULT 0
+#define __SI_CHLD 0
+#define __SI_RT 0
+#define __SI_MESGQ 0
+#define __SI_CODE(T,N) (N)
+
+/*
+ * si_code values
+ * Digital reserves positive values for kernel-generated signals.
+ */
+#define SI_USER 0 /* sent by kill, sigsend, raise */
+#define SI_KERNEL 0x80 /* sent by the kernel from somewhere */
+#define SI_QUEUE -1 /* sent by sigqueue */
+#define SI_TIMER __SI_CODE(__SI_TIMER,-2) /* sent by timer expiration */
+#define SI_MESGQ __SI_CODE(__SI_MESGQ,-3) /* sent by real time mesq state change */
+#define SI_ASYNCIO -4 /* sent by AIO completion */
+#define SI_SIGIO -5 /* sent by queued SIGIO */
+#define SI_TKILL -6 /* sent by tkill system call */
+#define SI_DETHREAD -7 /* sent by execve() killing subsidiary threads */
+
+#define SI_FROMUSER(siptr) ((siptr)->si_code <= 0)
+#define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0)
+
+/*
+ * SIGILL si_codes
+ */
+#define ILL_ILLOPC (__SI_FAULT|1) /* illegal opcode */
+#define ILL_ILLOPN (__SI_FAULT|2) /* illegal operand */
+#define ILL_ILLADR (__SI_FAULT|3) /* illegal addressing mode */
+#define ILL_ILLTRP (__SI_FAULT|4) /* illegal trap */
+#define ILL_PRVOPC (__SI_FAULT|5) /* privileged opcode */
+#define ILL_PRVREG (__SI_FAULT|6) /* privileged register */
+#define ILL_COPROC (__SI_FAULT|7) /* coprocessor error */
+#define ILL_BADSTK (__SI_FAULT|8) /* internal stack error */
+#define NSIGILL 8
+
+/*
+ * SIGFPE si_codes
+ */
+#define FPE_INTDIV (__SI_FAULT|1) /* integer divide by zero */
+#define FPE_INTOVF (__SI_FAULT|2) /* integer overflow */
+#define FPE_FLTDIV (__SI_FAULT|3) /* floating point divide by zero */
+#define FPE_FLTOVF (__SI_FAULT|4) /* floating point overflow */
+#define FPE_FLTUND (__SI_FAULT|5) /* floating point underflow */
+#define FPE_FLTRES (__SI_FAULT|6) /* floating point inexact result */
+#define FPE_FLTINV (__SI_FAULT|7) /* floating point invalid operation */
+#define FPE_FLTSUB (__SI_FAULT|8) /* subscript out of range */
+#define NSIGFPE 8
+
+/*
+ * SIGSEGV si_codes
+ */
+#define SEGV_MAPERR (__SI_FAULT|1) /* address not mapped to object */
+#define SEGV_ACCERR (__SI_FAULT|2) /* invalid permissions for mapped object */
+#define NSIGSEGV 2
+
+/*
+ * SIGBUS si_codes
+ */
+#define BUS_ADRALN (__SI_FAULT|1) /* invalid address alignment */
+#define BUS_ADRERR (__SI_FAULT|2) /* non-existant physical address */
+#define BUS_OBJERR (__SI_FAULT|3) /* object specific hardware error */
+#define NSIGBUS 3
+
+/*
+ * SIGTRAP si_codes
+ */
+#define TRAP_BRKPT (__SI_FAULT|1) /* process breakpoint */
+#define TRAP_TRACE (__SI_FAULT|2) /* process trace trap */
+#define TRAP_BRANCH (__SI_FAULT|3) /* process taken branch trap */
+#define TRAP_HWBKPT (__SI_FAULT|4) /* hardware breakpoint/watchpoint */
+#define NSIGTRAP 4
+
+/*
+ * SIGCHLD si_codes
+ */
+#define CLD_EXITED (__SI_CHLD|1) /* child has exited */
+#define CLD_KILLED (__SI_CHLD|2) /* child was killed */
+#define CLD_DUMPED (__SI_CHLD|3) /* child terminated abnormally */
+#define CLD_TRAPPED (__SI_CHLD|4) /* traced child has trapped */
+#define CLD_STOPPED (__SI_CHLD|5) /* child has stopped */
+#define CLD_CONTINUED (__SI_CHLD|6) /* stopped child has continued */
+#define NSIGCHLD 6
+
+/*
+ * SIGPOLL si_codes
+ */
+#define POLL_IN (__SI_POLL|1) /* data input available */
+#define POLL_OUT (__SI_POLL|2) /* output buffers available */
+#define POLL_MSG (__SI_POLL|3) /* input message available */
+#define POLL_ERR (__SI_POLL|4) /* i/o error */
+#define POLL_PRI (__SI_POLL|5) /* high priority input available */
+#define POLL_HUP (__SI_POLL|6) /* device disconnected */
+#define NSIGPOLL 6
+
+/*
+ * sigevent definitions
+ *
+ * It seems likely that SIGEV_THREAD will have to be handled from
+ * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the
+ * thread manager then catches and does the appropriate nonsense.
+ * However, everything is written out here so as to not get lost.
+ */
+#define SIGEV_SIGNAL 0 /* notify via signal */
+#define SIGEV_NONE 1 /* other notification: meaningless */
+#define SIGEV_THREAD 2 /* deliver via thread creation */
+#define SIGEV_THREAD_ID 4 /* deliver to thread */
+
+/*
+ * This works because the alignment is ok on all current architectures
+ * but we leave open this being overridden in the future
+ */
+#ifndef __ARCH_SIGEV_PREAMBLE_SIZE
+#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(int) * 2 + sizeof(sigval_t))
+#endif
+
+#define SIGEV_MAX_SIZE 64
+#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE - __ARCH_SIGEV_PREAMBLE_SIZE) \
+ / sizeof(int))
+
+typedef struct sigevent {
+ sigval_t sigev_value;
+ int sigev_signo;
+ int sigev_notify;
+ union {
+ int _pad[SIGEV_PAD_SIZE];
+ int _tid;
+
+ struct {
+ void (*_function)(sigval_t);
+ void *_attribute; /* really pthread_attr_t */
+ } _sigev_thread;
+ } _sigev_un;
+} sigevent_t;
+
+#define sigev_notify_function _sigev_un._sigev_thread._function
+#define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+#define sigev_notify_thread_id _sigev_un._tid
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/signal.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/signal.h
new file mode 100644
index 0000000..91adad3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/signal.h
@@ -0,0 +1,28 @@
+#ifndef __ASM_GENERIC_SIGNAL_H
+#define __ASM_GENERIC_SIGNAL_H
+
+
+
+#ifndef SIG_BLOCK
+#define SIG_BLOCK 0 /* for blocking signals */
+#endif
+#ifndef SIG_UNBLOCK
+#define SIG_UNBLOCK 1 /* for unblocking signals */
+#endif
+#ifndef SIG_SETMASK
+#define SIG_SETMASK 2 /* for setting the signal mask */
+#endif
+
+#ifndef __ASSEMBLY__
+typedef void __signalfn_t(int);
+typedef __signalfn_t *__sighandler_t;
+
+typedef void __restorefn_t(void);
+typedef __restorefn_t *__sigrestore_t;
+
+#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
+#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
+#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
+#endif
+
+#endif /* __ASM_GENERIC_SIGNAL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/statfs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/statfs.h
new file mode 100644
index 0000000..86798cc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm-generic/statfs.h
@@ -0,0 +1,80 @@
+#ifndef _GENERIC_STATFS_H
+#define _GENERIC_STATFS_H
+
+#include <linux/types.h>
+
+
+/*
+ * Most 64-bit platforms use 'long', while most 32-bit platforms use '__u32'.
+ * Yes, they differ in signedness as well as size.
+ * Special cases can override it for themselves -- except for S390x, which
+ * is just a little too special for us. And MIPS, which I'm not touching
+ * with a 10' pole.
+ */
+#ifndef __statfs_word
+#if BITS_PER_LONG == 64
+#define __statfs_word long
+#else
+#define __statfs_word __u32
+#endif
+#endif
+
+struct statfs {
+ __statfs_word f_type;
+ __statfs_word f_bsize;
+ __statfs_word f_blocks;
+ __statfs_word f_bfree;
+ __statfs_word f_bavail;
+ __statfs_word f_files;
+ __statfs_word f_ffree;
+ __kernel_fsid_t f_fsid;
+ __statfs_word f_namelen;
+ __statfs_word f_frsize;
+ __statfs_word f_spare[5];
+};
+
+/*
+ * ARM needs to avoid the 32-bit padding at the end, for consistency
+ * between EABI and OABI
+ */
+#ifndef ARCH_PACK_STATFS64
+#define ARCH_PACK_STATFS64
+#endif
+
+struct statfs64 {
+ __statfs_word f_type;
+ __statfs_word f_bsize;
+ __u64 f_blocks;
+ __u64 f_bfree;
+ __u64 f_bavail;
+ __u64 f_files;
+ __u64 f_ffree;
+ __kernel_fsid_t f_fsid;
+ __statfs_word f_namelen;
+ __statfs_word f_frsize;
+ __statfs_word f_spare[5];
+} ARCH_PACK_STATFS64;
+
+/*
+ * IA64 and x86_64 need to avoid the 32-bit padding at the end,
+ * to be compatible with the i386 ABI
+ */
+#ifndef ARCH_PACK_COMPAT_STATFS64
+#define ARCH_PACK_COMPAT_STATFS64
+#endif
+
+struct compat_statfs64 {
+ __u32 f_type;
+ __u32 f_bsize;
+ __u64 f_blocks;
+ __u64 f_bfree;
+ __u64 f_bavail;
+ __u64 f_files;
+ __u64 f_ffree;
+ __kernel_fsid_t f_fsid;
+ __u32 f_namelen;
+ __u32 f_frsize;
+ __u32 f_spare[5];
+} ARCH_PACK_COMPAT_STATFS64;
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/..install.cmd
new file mode 100644
index 0000000..030c1df
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/asm/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/arch/mips/include/asm /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/asm mips auxvec.h byteorder.h cachectl.h errno.h fcntl.h ioctl.h ioctls.h ipcbuf.h mman.h msgbuf.h param.h poll.h posix_types.h ptrace.h resource.h sembuf.h setup.h sgidefs.h shmbuf.h sigcontext.h siginfo.h signal.h socket.h sockios.h stat.h statfs.h swab.h sysmips.h termbits.h termios.h types.h unistd.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/arch/mips/include/asm /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/asm mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/asm/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/auxvec.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/auxvec.h
new file mode 100644
index 0000000..7cf7f2d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/auxvec.h
@@ -0,0 +1,4 @@
+#ifndef _ASM_AUXVEC_H
+#define _ASM_AUXVEC_H
+
+#endif /* _ASM_AUXVEC_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/byteorder.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/byteorder.h
new file mode 100644
index 0000000..9579051
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/byteorder.h
@@ -0,0 +1,19 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1996, 99, 2003 by Ralf Baechle
+ */
+#ifndef _ASM_BYTEORDER_H
+#define _ASM_BYTEORDER_H
+
+#if defined(__MIPSEB__)
+#include <linux/byteorder/big_endian.h>
+#elif defined(__MIPSEL__)
+#include <linux/byteorder/little_endian.h>
+#else
+# error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???"
+#endif
+
+#endif /* _ASM_BYTEORDER_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/cachectl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/cachectl.h
new file mode 100644
index 0000000..f3ce721
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/cachectl.h
@@ -0,0 +1,26 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1994, 1995, 1996 by Ralf Baechle
+ */
+#ifndef _ASM_CACHECTL
+#define _ASM_CACHECTL
+
+/*
+ * Options for cacheflush system call
+ */
+#define ICACHE (1<<0) /* flush instruction cache */
+#define DCACHE (1<<1) /* writeback and flush data cache */
+#define BCACHE (ICACHE|DCACHE) /* flush both caches */
+
+/*
+ * Caching modes for the cachectl(2) call
+ *
+ * cachectl(2) is currently not supported and returns ENOSYS.
+ */
+#define CACHEABLE 0 /* make pages cacheable */
+#define UNCACHEABLE 1 /* make pages uncacheable */
+
+#endif /* _ASM_CACHECTL */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/errno.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/errno.h
new file mode 100644
index 0000000..3d4ff02
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/errno.h
@@ -0,0 +1,125 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 1999, 2001, 2002 by Ralf Baechle
+ */
+#ifndef _ASM_ERRNO_H
+#define _ASM_ERRNO_H
+
+/*
+ * These error numbers are intended to be MIPS ABI compatible
+ */
+
+#include <asm-generic/errno-base.h>
+
+#define ENOMSG 35 /* No message of desired type */
+#define EIDRM 36 /* Identifier removed */
+#define ECHRNG 37 /* Channel number out of range */
+#define EL2NSYNC 38 /* Level 2 not synchronized */
+#define EL3HLT 39 /* Level 3 halted */
+#define EL3RST 40 /* Level 3 reset */
+#define ELNRNG 41 /* Link number out of range */
+#define EUNATCH 42 /* Protocol driver not attached */
+#define ENOCSI 43 /* No CSI structure available */
+#define EL2HLT 44 /* Level 2 halted */
+#define EDEADLK 45 /* Resource deadlock would occur */
+#define ENOLCK 46 /* No record locks available */
+#define EBADE 50 /* Invalid exchange */
+#define EBADR 51 /* Invalid request descriptor */
+#define EXFULL 52 /* Exchange full */
+#define ENOANO 53 /* No anode */
+#define EBADRQC 54 /* Invalid request code */
+#define EBADSLT 55 /* Invalid slot */
+#define EDEADLOCK 56 /* File locking deadlock error */
+#define EBFONT 59 /* Bad font file format */
+#define ENOSTR 60 /* Device not a stream */
+#define ENODATA 61 /* No data available */
+#define ETIME 62 /* Timer expired */
+#define ENOSR 63 /* Out of streams resources */
+#define ENONET 64 /* Machine is not on the network */
+#define ENOPKG 65 /* Package not installed */
+#define EREMOTE 66 /* Object is remote */
+#define ENOLINK 67 /* Link has been severed */
+#define EADV 68 /* Advertise error */
+#define ESRMNT 69 /* Srmount error */
+#define ECOMM 70 /* Communication error on send */
+#define EPROTO 71 /* Protocol error */
+#define EDOTDOT 73 /* RFS specific error */
+#define EMULTIHOP 74 /* Multihop attempted */
+#define EBADMSG 77 /* Not a data message */
+#define ENAMETOOLONG 78 /* File name too long */
+#define EOVERFLOW 79 /* Value too large for defined data type */
+#define ENOTUNIQ 80 /* Name not unique on network */
+#define EBADFD 81 /* File descriptor in bad state */
+#define EREMCHG 82 /* Remote address changed */
+#define ELIBACC 83 /* Can not access a needed shared library */
+#define ELIBBAD 84 /* Accessing a corrupted shared library */
+#define ELIBSCN 85 /* .lib section in a.out corrupted */
+#define ELIBMAX 86 /* Attempting to link in too many shared libraries */
+#define ELIBEXEC 87 /* Cannot exec a shared library directly */
+#define EILSEQ 88 /* Illegal byte sequence */
+#define ENOSYS 89 /* Function not implemented */
+#define ELOOP 90 /* Too many symbolic links encountered */
+#define ERESTART 91 /* Interrupted system call should be restarted */
+#define ESTRPIPE 92 /* Streams pipe error */
+#define ENOTEMPTY 93 /* Directory not empty */
+#define EUSERS 94 /* Too many users */
+#define ENOTSOCK 95 /* Socket operation on non-socket */
+#define EDESTADDRREQ 96 /* Destination address required */
+#define EMSGSIZE 97 /* Message too long */
+#define EPROTOTYPE 98 /* Protocol wrong type for socket */
+#define ENOPROTOOPT 99 /* Protocol not available */
+#define EPROTONOSUPPORT 120 /* Protocol not supported */
+#define ESOCKTNOSUPPORT 121 /* Socket type not supported */
+#define EOPNOTSUPP 122 /* Operation not supported on transport endpoint */
+#define EPFNOSUPPORT 123 /* Protocol family not supported */
+#define EAFNOSUPPORT 124 /* Address family not supported by protocol */
+#define EADDRINUSE 125 /* Address already in use */
+#define EADDRNOTAVAIL 126 /* Cannot assign requested address */
+#define ENETDOWN 127 /* Network is down */
+#define ENETUNREACH 128 /* Network is unreachable */
+#define ENETRESET 129 /* Network dropped connection because of reset */
+#define ECONNABORTED 130 /* Software caused connection abort */
+#define ECONNRESET 131 /* Connection reset by peer */
+#define ENOBUFS 132 /* No buffer space available */
+#define EISCONN 133 /* Transport endpoint is already connected */
+#define ENOTCONN 134 /* Transport endpoint is not connected */
+#define EUCLEAN 135 /* Structure needs cleaning */
+#define ENOTNAM 137 /* Not a XENIX named type file */
+#define ENAVAIL 138 /* No XENIX semaphores available */
+#define EISNAM 139 /* Is a named type file */
+#define EREMOTEIO 140 /* Remote I/O error */
+#define EINIT 141 /* Reserved */
+#define EREMDEV 142 /* Error 142 */
+#define ESHUTDOWN 143 /* Cannot send after transport endpoint shutdown */
+#define ETOOMANYREFS 144 /* Too many references: cannot splice */
+#define ETIMEDOUT 145 /* Connection timed out */
+#define ECONNREFUSED 146 /* Connection refused */
+#define EHOSTDOWN 147 /* Host is down */
+#define EHOSTUNREACH 148 /* No route to host */
+#define EWOULDBLOCK EAGAIN /* Operation would block */
+#define EALREADY 149 /* Operation already in progress */
+#define EINPROGRESS 150 /* Operation now in progress */
+#define ESTALE 151 /* Stale NFS file handle */
+#define ECANCELED 158 /* AIO operation canceled */
+
+/*
+ * These error are Linux extensions.
+ */
+#define ENOMEDIUM 159 /* No medium found */
+#define EMEDIUMTYPE 160 /* Wrong medium type */
+#define ENOKEY 161 /* Required key not available */
+#define EKEYEXPIRED 162 /* Key has expired */
+#define EKEYREVOKED 163 /* Key has been revoked */
+#define EKEYREJECTED 164 /* Key was rejected by service */
+
+/* for robust mutexes */
+#define EOWNERDEAD 165 /* Owner died */
+#define ENOTRECOVERABLE 166 /* State not recoverable */
+
+#define EDQUOT 1133 /* Quota exceeded */
+
+
+#endif /* _ASM_ERRNO_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/fcntl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/fcntl.h
new file mode 100644
index 0000000..2a52333
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/fcntl.h
@@ -0,0 +1,61 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 96, 97, 98, 99, 2003, 05 Ralf Baechle
+ */
+#ifndef _ASM_FCNTL_H
+#define _ASM_FCNTL_H
+
+
+#define O_APPEND 0x0008
+#define O_SYNC 0x0010
+#define O_NONBLOCK 0x0080
+#define O_CREAT 0x0100 /* not fcntl */
+#define O_TRUNC 0x0200 /* not fcntl */
+#define O_EXCL 0x0400 /* not fcntl */
+#define O_NOCTTY 0x0800 /* not fcntl */
+#define FASYNC 0x1000 /* fcntl, for BSD compatibility */
+#define O_LARGEFILE 0x2000 /* allow large file opens */
+#define O_DIRECT 0x8000 /* direct disk access hint */
+
+#define F_GETLK 14
+#define F_SETLK 6
+#define F_SETLKW 7
+
+#define F_SETOWN 24 /* for sockets. */
+#define F_GETOWN 23 /* for sockets. */
+
+#ifndef __mips64
+#define F_GETLK64 33 /* using 'struct flock64' */
+#define F_SETLK64 34
+#define F_SETLKW64 35
+#endif
+
+/*
+ * The flavours of struct flock. "struct flock" is the ABI compliant
+ * variant. Finally struct flock64 is the LFS variant of struct flock. As
+ * a historic accident and inconsistence with the ABI definition it doesn't
+ * contain all the same fields as struct flock.
+ */
+
+#ifdef CONFIG_32BIT
+
+struct flock {
+ short l_type;
+ short l_whence;
+ off_t l_start;
+ off_t l_len;
+ long l_sysid;
+ __kernel_pid_t l_pid;
+ long pad[4];
+};
+
+#define HAVE_ARCH_STRUCT_FLOCK
+
+#endif /* CONFIG_32BIT */
+
+#include <asm-generic/fcntl.h>
+
+#endif /* _ASM_FCNTL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/ioctl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/ioctl.h
new file mode 100644
index 0000000..94ca66c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/ioctl.h
@@ -0,0 +1,89 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 96, 99, 2001 Ralf Baechle
+ */
+#ifndef _ASM_IOCTL_H
+#define _ASM_IOCTL_H
+
+/*
+ * The original linux ioctl numbering scheme was just a general
+ * "anything goes" setup, where more or less random numbers were
+ * assigned. Sorry, I was clueless when I started out on this.
+ *
+ * On the alpha, we'll try to clean it up a bit, using a more sane
+ * ioctl numbering, and also trying to be compatible with OSF/1 in
+ * the process. I'd like to clean it up for the i386 as well, but
+ * it's so painful recognizing both the new and the old numbers..
+ *
+ * The same applies for for the MIPS ABI; in fact even the macros
+ * from Linux/Alpha fit almost perfectly.
+ */
+
+#define _IOC_NRBITS 8
+#define _IOC_TYPEBITS 8
+#define _IOC_SIZEBITS 13
+#define _IOC_DIRBITS 3
+
+#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
+#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
+#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
+#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
+
+#define _IOC_NRSHIFT 0
+#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
+#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
+#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
+
+/*
+ * Direction bits _IOC_NONE could be 0, but OSF/1 gives it a bit.
+ * And this turns out useful to catch old ioctl numbers in header
+ * files for us.
+ */
+#define _IOC_NONE 1U
+#define _IOC_READ 2U
+#define _IOC_WRITE 4U
+
+/*
+ * The following are included for compatibility
+ */
+#define _IOC_VOID 0x20000000
+#define _IOC_OUT 0x40000000
+#define _IOC_IN 0x80000000
+#define _IOC_INOUT (IOC_IN|IOC_OUT)
+
+#define _IOC(dir, type, nr, size) \
+ (((dir) << _IOC_DIRSHIFT) | \
+ ((type) << _IOC_TYPESHIFT) | \
+ ((nr) << _IOC_NRSHIFT) | \
+ ((size) << _IOC_SIZESHIFT))
+
+#define _IOC_TYPECHECK(t) (sizeof(t))
+
+/* used to create numbers */
+#define _IO(type, nr) _IOC(_IOC_NONE, (type), (nr), 0)
+#define _IOR(type, nr, size) _IOC(_IOC_READ, (type), (nr), (_IOC_TYPECHECK(size)))
+#define _IOW(type, nr, size) _IOC(_IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
+#define _IOWR(type, nr, size) _IOC(_IOC_READ|_IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
+#define _IOR_BAD(type, nr, size) _IOC(_IOC_READ, (type), (nr), sizeof(size))
+#define _IOW_BAD(type, nr, size) _IOC(_IOC_WRITE, (type), (nr), sizeof(size))
+#define _IOWR_BAD(type, nr, size) _IOC(_IOC_READ|_IOC_WRITE, (type), (nr), sizeof(size))
+
+
+/* used to decode them.. */
+#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
+#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
+#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
+#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
+
+/* ...and for the drivers/sound files... */
+
+#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
+#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
+#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
+#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
+#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
+
+#endif /* _ASM_IOCTL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/ioctls.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/ioctls.h
new file mode 100644
index 0000000..a8fed70
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/ioctls.h
@@ -0,0 +1,109 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 1996, 2001 Ralf Baechle
+ * Copyright (C) 2001 MIPS Technologies, Inc.
+ */
+#ifndef __ASM_IOCTLS_H
+#define __ASM_IOCTLS_H
+
+#include <asm/ioctl.h>
+
+#define TCGETA 0x5401
+#define TCSETA 0x5402 /* Clashes with SNDCTL_TMR_START sound ioctl */
+#define TCSETAW 0x5403
+#define TCSETAF 0x5404
+
+#define TCSBRK 0x5405
+#define TCXONC 0x5406
+#define TCFLSH 0x5407
+
+#define TCGETS 0x540d
+#define TCSETS 0x540e
+#define TCSETSW 0x540f
+#define TCSETSF 0x5410
+
+#define TIOCEXCL 0x740d /* set exclusive use of tty */
+#define TIOCNXCL 0x740e /* reset exclusive use of tty */
+#define TIOCOUTQ 0x7472 /* output queue size */
+#define TIOCSTI 0x5472 /* simulate terminal input */
+#define TIOCMGET 0x741d /* get all modem bits */
+#define TIOCMBIS 0x741b /* bis modem bits */
+#define TIOCMBIC 0x741c /* bic modem bits */
+#define TIOCMSET 0x741a /* set all modem bits */
+#define TIOCPKT 0x5470 /* pty: set/clear packet mode */
+#define TIOCPKT_DATA 0x00 /* data packet */
+#define TIOCPKT_FLUSHREAD 0x01 /* flush packet */
+#define TIOCPKT_FLUSHWRITE 0x02 /* flush packet */
+#define TIOCPKT_STOP 0x04 /* stop output */
+#define TIOCPKT_START 0x08 /* start output */
+#define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */
+#define TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */
+/* #define TIOCPKT_IOCTL 0x40 state change of pty driver */
+#define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */
+#define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */
+#define TIOCNOTTY 0x5471 /* void tty association */
+#define TIOCSETD 0x7401
+#define TIOCGETD 0x7400
+
+#define FIOCLEX 0x6601
+#define FIONCLEX 0x6602
+#define FIOASYNC 0x667d
+#define FIONBIO 0x667e
+#define FIOQSIZE 0x667f
+
+#define TIOCGLTC 0x7474 /* get special local chars */
+#define TIOCSLTC 0x7475 /* set special local chars */
+#define TIOCSPGRP _IOW('t', 118, int) /* set pgrp of tty */
+#define TIOCGPGRP _IOR('t', 119, int) /* get pgrp of tty */
+#define TIOCCONS _IOW('t', 120, int) /* become virtual console */
+
+#define FIONREAD 0x467f
+#define TIOCINQ FIONREAD
+
+#define TIOCGETP 0x7408
+#define TIOCSETP 0x7409
+#define TIOCSETN 0x740a /* TIOCSETP wo flush */
+
+/* #define TIOCSETA _IOW('t', 20, struct termios) set termios struct */
+/* #define TIOCSETAW _IOW('t', 21, struct termios) drain output, set */
+/* #define TIOCSETAF _IOW('t', 22, struct termios) drn out, fls in, set */
+/* #define TIOCGETD _IOR('t', 26, int) get line discipline */
+/* #define TIOCSETD _IOW('t', 27, int) set line discipline */
+ /* 127-124 compat */
+
+#define TIOCSBRK 0x5427 /* BSD compatibility */
+#define TIOCCBRK 0x5428 /* BSD compatibility */
+#define TIOCGSID 0x7416 /* Return the session ID of FD */
+#define TCGETS2 _IOR('T', 0x2A, struct termios2)
+#define TCSETS2 _IOW('T', 0x2B, struct termios2)
+#define TCSETSW2 _IOW('T', 0x2C, struct termios2)
+#define TCSETSF2 _IOW('T', 0x2D, struct termios2)
+#define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+#define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */
+
+/* I hope the range from 0x5480 on is free ... */
+#define TIOCSCTTY 0x5480 /* become controlling tty */
+#define TIOCGSOFTCAR 0x5481
+#define TIOCSSOFTCAR 0x5482
+#define TIOCLINUX 0x5483
+#define TIOCGSERIAL 0x5484
+#define TIOCSSERIAL 0x5485
+#define TCSBRKP 0x5486 /* Needed for POSIX tcsendbreak() */
+#define TIOCSERCONFIG 0x5488
+#define TIOCSERGWILD 0x5489
+#define TIOCSERSWILD 0x548a
+#define TIOCGLCKTRMIOS 0x548b
+#define TIOCSLCKTRMIOS 0x548c
+#define TIOCSERGSTRUCT 0x548d /* For debugging only */
+#define TIOCSERGETLSR 0x548e /* Get line status register */
+#define TIOCSERGETMULTI 0x548f /* Get multiport config */
+#define TIOCSERSETMULTI 0x5490 /* Set multiport config */
+#define TIOCMIWAIT 0x5491 /* wait for a change on serial input line(s) */
+#define TIOCGICOUNT 0x5492 /* read serial port __inline__ interrupt counts */
+#define TIOCGHAYESESP 0x5493 /* Get Hayes ESP configuration */
+#define TIOCSHAYESESP 0x5494 /* Set Hayes ESP configuration */
+
+#endif /* __ASM_IOCTLS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/ipcbuf.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/ipcbuf.h
new file mode 100644
index 0000000..d47d08f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/ipcbuf.h
@@ -0,0 +1,28 @@
+#ifndef _ASM_IPCBUF_H
+#define _ASM_IPCBUF_H
+
+/*
+ * The ipc64_perm structure for alpha architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 32-bit seq
+ * - 2 miscellaneous 64-bit values
+ */
+
+struct ipc64_perm
+{
+ __kernel_key_t key;
+ __kernel_uid_t uid;
+ __kernel_gid_t gid;
+ __kernel_uid_t cuid;
+ __kernel_gid_t cgid;
+ __kernel_mode_t mode;
+ unsigned short seq;
+ unsigned short __pad1;
+ unsigned long __unused1;
+ unsigned long __unused2;
+};
+
+#endif /* _ASM_IPCBUF_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/mman.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/mman.h
new file mode 100644
index 0000000..e4d6f1f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/mman.h
@@ -0,0 +1,77 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 1999, 2002 by Ralf Baechle
+ */
+#ifndef _ASM_MMAN_H
+#define _ASM_MMAN_H
+
+/*
+ * Protections are chosen from these bits, OR'd together. The
+ * implementation does not necessarily support PROT_EXEC or PROT_WRITE
+ * without PROT_READ. The only guarantees are that no writing will be
+ * allowed without PROT_WRITE and no access will be allowed for PROT_NONE.
+ */
+#define PROT_NONE 0x00 /* page can not be accessed */
+#define PROT_READ 0x01 /* page can be read */
+#define PROT_WRITE 0x02 /* page can be written */
+#define PROT_EXEC 0x04 /* page can be executed */
+/* 0x08 reserved for PROT_EXEC_NOFLUSH */
+#define PROT_SEM 0x10 /* page may be used for atomic ops */
+#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
+#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
+
+/*
+ * Flags for mmap
+ */
+#define MAP_SHARED 0x001 /* Share changes */
+#define MAP_PRIVATE 0x002 /* Changes are private */
+#define MAP_TYPE 0x00f /* Mask for type of mapping */
+#define MAP_FIXED 0x010 /* Interpret addr exactly */
+
+/* not used by linux, but here to make sure we don't clash with ABI defines */
+#define MAP_RENAME 0x020 /* Assign page to file */
+#define MAP_AUTOGROW 0x040 /* File may grow by writing */
+#define MAP_LOCAL 0x080 /* Copy on fork/sproc */
+#define MAP_AUTORSRV 0x100 /* Logical swap reserved on demand */
+
+/* These are linux-specific */
+#define MAP_NORESERVE 0x0400 /* don't check for reservations */
+#define MAP_ANONYMOUS 0x0800 /* don't use a file */
+#define MAP_GROWSDOWN 0x1000 /* stack-like segment */
+#define MAP_DENYWRITE 0x2000 /* ETXTBSY */
+#define MAP_EXECUTABLE 0x4000 /* mark it as an executable */
+#define MAP_LOCKED 0x8000 /* pages are locked */
+#define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */
+#define MAP_NONBLOCK 0x20000 /* do not block on IO */
+
+/*
+ * Flags for msync
+ */
+#define MS_ASYNC 0x0001 /* sync memory asynchronously */
+#define MS_INVALIDATE 0x0002 /* invalidate mappings & caches */
+#define MS_SYNC 0x0004 /* synchronous memory sync */
+
+/*
+ * Flags for mlockall
+ */
+#define MCL_CURRENT 1 /* lock all current mappings */
+#define MCL_FUTURE 2 /* lock all future mappings */
+
+#define MADV_NORMAL 0 /* no further special treatment */
+#define MADV_RANDOM 1 /* expect random page references */
+#define MADV_SEQUENTIAL 2 /* expect sequential page references */
+#define MADV_WILLNEED 3 /* will need these pages */
+#define MADV_DONTNEED 4 /* don't need these pages */
+
+/* common parameters: try to keep these consistent across architectures */
+#define MADV_REMOVE 9 /* remove these pages & resources */
+#define MADV_DONTFORK 10 /* don't inherit across fork */
+#define MADV_DOFORK 11 /* do inherit across fork */
+
+/* compatibility flags */
+#define MAP_FILE 0
+
+#endif /* _ASM_MMAN_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/msgbuf.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/msgbuf.h
new file mode 100644
index 0000000..0d6c7f1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/msgbuf.h
@@ -0,0 +1,47 @@
+#ifndef _ASM_MSGBUF_H
+#define _ASM_MSGBUF_H
+
+
+/*
+ * The msqid64_ds structure for the MIPS architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - extension of time_t to 64-bit on 32-bitsystem to solve the y2038 problem
+ * - 2 miscellaneous unsigned long values
+ */
+
+struct msqid64_ds {
+ struct ipc64_perm msg_perm;
+#if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
+ unsigned long __unused1;
+#endif
+ __kernel_time_t msg_stime; /* last msgsnd time */
+#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_LITTLE_ENDIAN)
+ unsigned long __unused1;
+#endif
+#if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
+ unsigned long __unused2;
+#endif
+ __kernel_time_t msg_rtime; /* last msgrcv time */
+#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_LITTLE_ENDIAN)
+ unsigned long __unused2;
+#endif
+#if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
+ unsigned long __unused3;
+#endif
+ __kernel_time_t msg_ctime; /* last change time */
+#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_LITTLE_ENDIAN)
+ unsigned long __unused3;
+#endif
+ unsigned long msg_cbytes; /* current number of bytes on queue */
+ unsigned long msg_qnum; /* number of messages in queue */
+ unsigned long msg_qbytes; /* max number of bytes on queue */
+ __kernel_pid_t msg_lspid; /* pid of last msgsnd */
+ __kernel_pid_t msg_lrpid; /* last receive pid */
+ unsigned long __unused4;
+ unsigned long __unused5;
+};
+
+#endif /* _ASM_MSGBUF_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/param.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/param.h
new file mode 100644
index 0000000..b5b7262
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/param.h
@@ -0,0 +1,25 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright 1994 - 2000, 2002 Ralf Baechle (ralf@gnu.org)
+ * Copyright 2000 Silicon Graphics, Inc.
+ */
+#ifndef _ASM_PARAM_H
+#define _ASM_PARAM_H
+
+
+#ifndef HZ
+#define HZ 100
+#endif
+
+#define EXEC_PAGESIZE 65536
+
+#ifndef NOGROUP
+#define NOGROUP (-1)
+#endif
+
+#define MAXHOSTNAMELEN 64 /* max length of hostname */
+
+#endif /* _ASM_PARAM_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/poll.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/poll.h
new file mode 100644
index 0000000..47b9520
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/poll.h
@@ -0,0 +1,9 @@
+#ifndef __ASM_POLL_H
+#define __ASM_POLL_H
+
+#define POLLWRNORM POLLOUT
+#define POLLWRBAND 0x0100
+
+#include <asm-generic/poll.h>
+
+#endif /* __ASM_POLL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/posix_types.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/posix_types.h
new file mode 100644
index 0000000..9a35f18
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/posix_types.h
@@ -0,0 +1,73 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1996, 97, 98, 99, 2000 by Ralf Baechle
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+ */
+#ifndef _ASM_POSIX_TYPES_H
+#define _ASM_POSIX_TYPES_H
+
+#include <asm/sgidefs.h>
+
+/*
+ * This file is generally used by user-level software, so you need to
+ * be a little careful about namespace pollution etc. Also, we cannot
+ * assume GCC is being used.
+ */
+
+typedef unsigned long __kernel_ino_t;
+typedef unsigned int __kernel_mode_t;
+#if (_MIPS_SZLONG == 32)
+typedef unsigned long __kernel_nlink_t;
+#endif
+#if (_MIPS_SZLONG == 64)
+typedef unsigned int __kernel_nlink_t;
+#endif
+typedef long __kernel_off_t;
+typedef int __kernel_pid_t;
+typedef int __kernel_ipc_pid_t;
+typedef unsigned int __kernel_uid_t;
+typedef unsigned int __kernel_gid_t;
+#if (_MIPS_SZLONG == 32)
+typedef unsigned int __kernel_size_t;
+typedef int __kernel_ssize_t;
+typedef int __kernel_ptrdiff_t;
+#endif
+#if (_MIPS_SZLONG == 64)
+typedef unsigned long __kernel_size_t;
+typedef long __kernel_ssize_t;
+typedef long __kernel_ptrdiff_t;
+#endif
+typedef long __kernel_time_t;
+typedef long __kernel_suseconds_t;
+typedef long __kernel_clock_t;
+typedef int __kernel_timer_t;
+typedef int __kernel_clockid_t;
+typedef long __kernel_daddr_t;
+typedef char * __kernel_caddr_t;
+
+typedef unsigned short __kernel_uid16_t;
+typedef unsigned short __kernel_gid16_t;
+typedef unsigned int __kernel_uid32_t;
+typedef unsigned int __kernel_gid32_t;
+typedef __kernel_uid_t __kernel_old_uid_t;
+typedef __kernel_gid_t __kernel_old_gid_t;
+typedef unsigned int __kernel_old_dev_t;
+
+#ifdef __GNUC__
+typedef long long __kernel_loff_t;
+#endif
+
+typedef struct {
+#if (_MIPS_SZLONG == 32)
+ long val[2];
+#endif
+#if (_MIPS_SZLONG == 64)
+ int val[2];
+#endif
+} __kernel_fsid_t;
+
+
+#endif /* _ASM_POSIX_TYPES_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/ptrace.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/ptrace.h
new file mode 100644
index 0000000..257dbfe
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/ptrace.h
@@ -0,0 +1,116 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 by Ralf Baechle
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+ */
+#ifndef _ASM_PTRACE_H
+#define _ASM_PTRACE_H
+
+/* 0 - 31 are integer registers, 32 - 63 are fp registers. */
+#define FPR_BASE 32
+#define PC 64
+#define CAUSE 65
+#define BADVADDR 66
+#define MMHI 67
+#define MMLO 68
+#define FPC_CSR 69
+#define FPC_EIR 70
+#define DSP_BASE 71 /* 3 more hi / lo register pairs */
+#define DSP_CONTROL 77
+#define ACX 78
+
+/*
+ * This struct defines the way the registers are stored on the stack during a
+ * system call/exception. As usual the registers k0/k1 aren't being saved.
+ */
+struct pt_regs {
+#ifdef CONFIG_32BIT
+ /* Pad bytes for argument save space on the stack. */
+ unsigned long pad0[6];
+#endif
+
+ /* Saved main processor registers. */
+ unsigned long regs[32];
+
+ /* Saved special registers. */
+ unsigned long cp0_status;
+ unsigned long hi;
+ unsigned long lo;
+#ifdef CONFIG_CPU_HAS_SMARTMIPS
+ unsigned long acx;
+#endif
+ unsigned long cp0_badvaddr;
+ unsigned long cp0_cause;
+ unsigned long cp0_epc;
+#ifdef CONFIG_MIPS_MT_SMTC
+ unsigned long cp0_tcstatus;
+#endif /* CONFIG_MIPS_MT_SMTC */
+#ifdef CONFIG_CPU_CAVIUM_OCTEON
+ unsigned long long mpl[3]; /* MTM{0,1,2} */
+ unsigned long long mtp[3]; /* MTP{0,1,2} */
+#endif
+} __attribute__ ((aligned (8)));
+
+/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
+#define PTRACE_GETREGS 12
+#define PTRACE_SETREGS 13
+#define PTRACE_GETFPREGS 14
+#define PTRACE_SETFPREGS 15
+/* #define PTRACE_GETFPXREGS 18 */
+/* #define PTRACE_SETFPXREGS 19 */
+
+#define PTRACE_OLDSETOPTIONS 21
+
+#define PTRACE_GET_THREAD_AREA 25
+#define PTRACE_SET_THREAD_AREA 26
+
+/* Calls to trace a 64bit program from a 32bit program. */
+#define PTRACE_PEEKTEXT_3264 0xc0
+#define PTRACE_PEEKDATA_3264 0xc1
+#define PTRACE_POKETEXT_3264 0xc2
+#define PTRACE_POKEDATA_3264 0xc3
+#define PTRACE_GET_THREAD_AREA_3264 0xc4
+
+/* Read and write watchpoint registers. */
+enum pt_watch_style {
+ pt_watch_style_mips32,
+ pt_watch_style_mips64
+};
+struct mips32_watch_regs {
+ unsigned int watchlo[8];
+ /* Lower 16 bits of watchhi. */
+ unsigned short watchhi[8];
+ /* Valid mask and I R W bits.
+ * bit 0 -- 1 if W bit is usable.
+ * bit 1 -- 1 if R bit is usable.
+ * bit 2 -- 1 if I bit is usable.
+ * bits 3 - 11 -- Valid watchhi mask bits.
+ */
+ unsigned short watch_masks[8];
+ /* The number of valid watch register pairs. */
+ unsigned int num_valid;
+} __attribute__((aligned(8)));
+
+struct mips64_watch_regs {
+ unsigned long long watchlo[8];
+ unsigned short watchhi[8];
+ unsigned short watch_masks[8];
+ unsigned int num_valid;
+} __attribute__((aligned(8)));
+
+struct pt_watch_regs {
+ enum pt_watch_style style;
+ union {
+ struct mips32_watch_regs mips32;
+ struct mips64_watch_regs mips64;
+ };
+};
+
+#define PTRACE_GET_WATCH_REGS 0xd0
+#define PTRACE_SET_WATCH_REGS 0xd1
+
+
+#endif /* _ASM_PTRACE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/resource.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/resource.h
new file mode 100644
index 0000000..87cb308
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/resource.h
@@ -0,0 +1,35 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 96, 98, 99, 2000 by Ralf Baechle
+ * Copyright (C) 1999 Silicon Graphics, Inc.
+ */
+#ifndef _ASM_RESOURCE_H
+#define _ASM_RESOURCE_H
+
+
+/*
+ * These five resource limit IDs have a MIPS/Linux-specific ordering,
+ * the rest comes from the generic header:
+ */
+#define RLIMIT_NOFILE 5 /* max number of open files */
+#define RLIMIT_AS 6 /* address space limit */
+#define RLIMIT_RSS 7 /* max resident set size */
+#define RLIMIT_NPROC 8 /* max number of processes */
+#define RLIMIT_MEMLOCK 9 /* max locked-in-memory address space */
+
+/*
+ * SuS says limits have to be unsigned.
+ * Which makes a ton more sense anyway,
+ * but we keep the old value on MIPS32,
+ * for compatibility:
+ */
+#ifdef CONFIG_32BIT
+# define RLIM_INFINITY 0x7fffffffUL
+#endif
+
+#include <asm-generic/resource.h>
+
+#endif /* _ASM_RESOURCE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/sembuf.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/sembuf.h
new file mode 100644
index 0000000..7281a4d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/sembuf.h
@@ -0,0 +1,22 @@
+#ifndef _ASM_SEMBUF_H
+#define _ASM_SEMBUF_H
+
+/*
+ * The semid64_ds structure for the MIPS architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 2 miscellaneous 64-bit values
+ */
+
+struct semid64_ds {
+ struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
+ __kernel_time_t sem_otime; /* last semop time */
+ __kernel_time_t sem_ctime; /* last change time */
+ unsigned long sem_nsems; /* no. of semaphores in array */
+ unsigned long __unused1;
+ unsigned long __unused2;
+};
+
+#endif /* _ASM_SEMBUF_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/setup.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/setup.h
new file mode 100644
index 0000000..7c12a41
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/setup.h
@@ -0,0 +1,7 @@
+#ifndef _MIPS_SETUP_H
+#define _MIPS_SETUP_H
+
+#define COMMAND_LINE_SIZE 256
+
+
+#endif /* __SETUP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/sgidefs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/sgidefs.h
new file mode 100644
index 0000000..876442f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/sgidefs.h
@@ -0,0 +1,44 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1996, 1999, 2001 Ralf Baechle
+ * Copyright (C) 1999 Silicon Graphics, Inc.
+ * Copyright (C) 2001 MIPS Technologies, Inc.
+ */
+#ifndef __ASM_SGIDEFS_H
+#define __ASM_SGIDEFS_H
+
+/*
+ * Using a Linux compiler for building Linux seems logic but not to
+ * everybody.
+ */
+#ifndef __linux__
+#error Use a Linux compiler or give up.
+#endif
+
+/*
+ * Definitions for the ISA levels
+ *
+ * With the introduction of MIPS32 / MIPS64 instruction sets definitions
+ * MIPS ISAs are no longer subsets of each other. Therefore comparisons
+ * on these symbols except with == may result in unexpected results and
+ * are forbidden!
+ */
+#define _MIPS_ISA_MIPS1 1
+#define _MIPS_ISA_MIPS2 2
+#define _MIPS_ISA_MIPS3 3
+#define _MIPS_ISA_MIPS4 4
+#define _MIPS_ISA_MIPS5 5
+#define _MIPS_ISA_MIPS32 6
+#define _MIPS_ISA_MIPS64 7
+
+/*
+ * Subprogram calling convention
+ */
+#define _MIPS_SIM_ABI32 1
+#define _MIPS_SIM_NABI32 2
+#define _MIPS_SIM_ABI64 3
+
+#endif /* __ASM_SGIDEFS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/shmbuf.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/shmbuf.h
new file mode 100644
index 0000000..f994438
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/shmbuf.h
@@ -0,0 +1,38 @@
+#ifndef _ASM_SHMBUF_H
+#define _ASM_SHMBUF_H
+
+/*
+ * The shmid64_ds structure for the MIPS architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 2 miscellaneous 32-bit rsp. 64-bit values
+ */
+
+struct shmid64_ds {
+ struct ipc64_perm shm_perm; /* operation perms */
+ size_t shm_segsz; /* size of segment (bytes) */
+ __kernel_time_t shm_atime; /* last attach time */
+ __kernel_time_t shm_dtime; /* last detach time */
+ __kernel_time_t shm_ctime; /* last change time */
+ __kernel_pid_t shm_cpid; /* pid of creator */
+ __kernel_pid_t shm_lpid; /* pid of last operator */
+ unsigned long shm_nattch; /* no. of current attaches */
+ unsigned long __unused1;
+ unsigned long __unused2;
+};
+
+struct shminfo64 {
+ unsigned long shmmax;
+ unsigned long shmmin;
+ unsigned long shmmni;
+ unsigned long shmseg;
+ unsigned long shmall;
+ unsigned long __unused1;
+ unsigned long __unused2;
+ unsigned long __unused3;
+ unsigned long __unused4;
+};
+
+#endif /* _ASM_SHMBUF_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/sigcontext.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/sigcontext.h
new file mode 100644
index 0000000..0f64a70
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/sigcontext.h
@@ -0,0 +1,78 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1996, 1997, 1999 by Ralf Baechle
+ * Copyright (C) 1999 Silicon Graphics, Inc.
+ */
+#ifndef _ASM_SIGCONTEXT_H
+#define _ASM_SIGCONTEXT_H
+
+#include <linux/types.h>
+#include <asm/sgidefs.h>
+
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+
+/*
+ * Keep this struct definition in sync with the sigcontext fragment
+ * in arch/mips/tools/offset.c
+ */
+struct sigcontext {
+ unsigned int sc_regmask; /* Unused */
+ unsigned int sc_status; /* Unused */
+ unsigned long long sc_pc;
+ unsigned long long sc_regs[32];
+ unsigned long long sc_fpregs[32];
+ unsigned int sc_acx; /* Was sc_ownedfp */
+ unsigned int sc_fpc_csr;
+ unsigned int sc_fpc_eir; /* Unused */
+ unsigned int sc_used_math;
+ unsigned int sc_dsp; /* dsp status, was sc_ssflags */
+ unsigned long long sc_mdhi;
+ unsigned long long sc_mdlo;
+ unsigned long sc_hi1; /* Was sc_cause */
+ unsigned long sc_lo1; /* Was sc_badvaddr */
+ unsigned long sc_hi2; /* Was sc_sigset[4] */
+ unsigned long sc_lo2;
+ unsigned long sc_hi3;
+ unsigned long sc_lo3;
+};
+
+#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
+
+#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32
+
+#include <linux/posix_types.h>
+/*
+ * Keep this struct definition in sync with the sigcontext fragment
+ * in arch/mips/tools/offset.c
+ *
+ * Warning: this structure illdefined with sc_badvaddr being just an unsigned
+ * int so it was changed to unsigned long in 2.6.0-test1. This may break
+ * binary compatibility - no prisoners.
+ * DSP ASE in 2.6.12-rc4. Turn sc_mdhi and sc_mdlo into an array of four
+ * entries, add sc_dsp and sc_reserved for padding. No prisoners.
+ */
+struct sigcontext {
+ __u64 sc_regs[32];
+ __u64 sc_fpregs[32];
+ __u64 sc_mdhi;
+ __u64 sc_hi1;
+ __u64 sc_hi2;
+ __u64 sc_hi3;
+ __u64 sc_mdlo;
+ __u64 sc_lo1;
+ __u64 sc_lo2;
+ __u64 sc_lo3;
+ __u64 sc_pc;
+ __u32 sc_fpc_csr;
+ __u32 sc_used_math;
+ __u32 sc_dsp;
+ __u32 sc_reserved;
+};
+
+
+#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */
+
+#endif /* _ASM_SIGCONTEXT_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/siginfo.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/siginfo.h
new file mode 100644
index 0000000..f6828f2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/siginfo.h
@@ -0,0 +1,113 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1998, 1999, 2001, 2003 Ralf Baechle
+ * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
+ */
+#ifndef _ASM_SIGINFO_H
+#define _ASM_SIGINFO_H
+
+
+#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int))
+#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */
+
+#define HAVE_ARCH_SIGINFO_T
+
+/*
+ * We duplicate the generic versions - <asm-generic/siginfo.h> is just borked
+ * by design ...
+ */
+#define HAVE_ARCH_COPY_SIGINFO
+struct siginfo;
+
+/*
+ * Careful to keep union _sifields from shifting ...
+ */
+#ifdef CONFIG_32BIT
+#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
+#endif
+#ifdef CONFIG_64BIT
+#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
+#endif
+
+#include <asm-generic/siginfo.h>
+
+typedef struct siginfo {
+ int si_signo;
+ int si_code;
+ int si_errno;
+ int __pad0[SI_MAX_SIZE / sizeof(int) - SI_PAD_SIZE - 3];
+
+ union {
+ int _pad[SI_PAD_SIZE];
+
+ /* kill() */
+ struct {
+ pid_t _pid; /* sender's pid */
+ __ARCH_SI_UID_T _uid; /* sender's uid */
+ } _kill;
+
+ /* POSIX.1b timers */
+ struct {
+ timer_t _tid; /* timer id */
+ int _overrun; /* overrun count */
+ char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
+ sigval_t _sigval; /* same as below */
+ int _sys_private; /* not to be passed to user */
+ } _timer;
+
+ /* POSIX.1b signals */
+ struct {
+ pid_t _pid; /* sender's pid */
+ __ARCH_SI_UID_T _uid; /* sender's uid */
+ sigval_t _sigval;
+ } _rt;
+
+ /* SIGCHLD */
+ struct {
+ pid_t _pid; /* which child */
+ __ARCH_SI_UID_T _uid; /* sender's uid */
+ int _status; /* exit code */
+ clock_t _utime;
+ clock_t _stime;
+ } _sigchld;
+
+ /* IRIX SIGCHLD */
+ struct {
+ pid_t _pid; /* which child */
+ clock_t _utime;
+ int _status; /* exit code */
+ clock_t _stime;
+ } _irix_sigchld;
+
+ /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
+ struct {
+ void *_addr; /* faulting insn/memory ref. */
+#ifdef __ARCH_SI_TRAPNO
+ int _trapno; /* TRAP # which caused the signal */
+#endif
+ } _sigfault;
+
+ /* SIGPOLL, SIGXFSZ (To do ...) */
+ struct {
+ __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */
+ int _fd;
+ } _sigpoll;
+ } _sifields;
+} siginfo_t;
+
+/*
+ * si_code values
+ * Again these have been choosen to be IRIX compatible.
+ */
+#undef SI_ASYNCIO
+#undef SI_TIMER
+#undef SI_MESGQ
+#define SI_ASYNCIO -2 /* sent by AIO completion */
+#define SI_TIMER __SI_CODE(__SI_TIMER, -3) /* sent by timer expiration */
+#define SI_MESGQ __SI_CODE(__SI_MESGQ, -4) /* sent by real time mesq state change */
+
+
+#endif /* _ASM_SIGINFO_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/signal.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/signal.h
new file mode 100644
index 0000000..ca628e1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/signal.h
@@ -0,0 +1,123 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 96, 97, 98, 99, 2003 by Ralf Baechle
+ * Copyright (C) 1999 Silicon Graphics, Inc.
+ */
+#ifndef _ASM_SIGNAL_H
+#define _ASM_SIGNAL_H
+
+#include <linux/types.h>
+
+#define _NSIG 128
+#define _NSIG_BPW (sizeof(unsigned long) * 8)
+#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
+
+typedef struct {
+ unsigned long sig[_NSIG_WORDS];
+} sigset_t;
+
+typedef unsigned long old_sigset_t; /* at least 32 bits */
+
+#define SIGHUP 1 /* Hangup (POSIX). */
+#define SIGINT 2 /* Interrupt (ANSI). */
+#define SIGQUIT 3 /* Quit (POSIX). */
+#define SIGILL 4 /* Illegal instruction (ANSI). */
+#define SIGTRAP 5 /* Trace trap (POSIX). */
+#define SIGIOT 6 /* IOT trap (4.2 BSD). */
+#define SIGABRT SIGIOT /* Abort (ANSI). */
+#define SIGEMT 7
+#define SIGFPE 8 /* Floating-point exception (ANSI). */
+#define SIGKILL 9 /* Kill, unblockable (POSIX). */
+#define SIGBUS 10 /* BUS error (4.2 BSD). */
+#define SIGSEGV 11 /* Segmentation violation (ANSI). */
+#define SIGSYS 12
+#define SIGPIPE 13 /* Broken pipe (POSIX). */
+#define SIGALRM 14 /* Alarm clock (POSIX). */
+#define SIGTERM 15 /* Termination (ANSI). */
+#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */
+#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */
+#define SIGCHLD 18 /* Child status has changed (POSIX). */
+#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */
+#define SIGPWR 19 /* Power failure restart (System V). */
+#define SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */
+#define SIGURG 21 /* Urgent condition on socket (4.2 BSD). */
+#define SIGIO 22 /* I/O now possible (4.2 BSD). */
+#define SIGPOLL SIGIO /* Pollable event occurred (System V). */
+#define SIGSTOP 23 /* Stop, unblockable (POSIX). */
+#define SIGTSTP 24 /* Keyboard stop (POSIX). */
+#define SIGCONT 25 /* Continue (POSIX). */
+#define SIGTTIN 26 /* Background read from tty (POSIX). */
+#define SIGTTOU 27 /* Background write to tty (POSIX). */
+#define SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */
+#define SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */
+#define SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */
+#define SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */
+
+/* These should not be considered constants from userland. */
+#define SIGRTMIN 32
+#define SIGRTMAX _NSIG
+
+/*
+ * SA_FLAGS values:
+ *
+ * SA_ONSTACK indicates that a registered stack_t will be used.
+ * SA_RESTART flag to get restarting signals (which were the default long ago)
+ * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
+ * SA_RESETHAND clears the handler when the signal is delivered.
+ * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
+ * SA_NODEFER prevents the current signal from being masked in the handler.
+ *
+ * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
+ * Unix names RESETHAND and NODEFER respectively.
+ */
+#define SA_ONSTACK 0x08000000
+#define SA_RESETHAND 0x80000000
+#define SA_RESTART 0x10000000
+#define SA_SIGINFO 0x00000008
+#define SA_NODEFER 0x40000000
+#define SA_NOCLDWAIT 0x00010000
+#define SA_NOCLDSTOP 0x00000001
+
+#define SA_NOMASK SA_NODEFER
+#define SA_ONESHOT SA_RESETHAND
+
+#define SA_RESTORER 0x04000000 /* Only for o32 */
+
+/*
+ * sigaltstack controls
+ */
+#define SS_ONSTACK 1
+#define SS_DISABLE 2
+
+#define MINSIGSTKSZ 2048
+#define SIGSTKSZ 8192
+
+
+#define SIG_BLOCK 1 /* for blocking signals */
+#define SIG_UNBLOCK 2 /* for unblocking signals */
+#define SIG_SETMASK 3 /* for setting the signal mask */
+
+#include <asm-generic/signal.h>
+
+struct sigaction {
+ unsigned int sa_flags;
+ __sighandler_t sa_handler;
+ sigset_t sa_mask;
+};
+
+struct k_sigaction {
+ struct sigaction sa;
+};
+
+/* IRIX compatible stack_t */
+typedef struct sigaltstack {
+ void *ss_sp;
+ size_t ss_size;
+ int ss_flags;
+} stack_t;
+
+
+#endif /* _ASM_SIGNAL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/socket.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/socket.h
new file mode 100644
index 0000000..73a5b70
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/socket.h
@@ -0,0 +1,82 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1997, 1999, 2000, 2001 Ralf Baechle
+ * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
+ */
+#ifndef _ASM_SOCKET_H
+#define _ASM_SOCKET_H
+
+#include <asm/sockios.h>
+
+/*
+ * For setsockopt(2)
+ *
+ * This defines are ABI conformant as far as Linux supports these ...
+ */
+#define SOL_SOCKET 0xffff
+
+#define SO_DEBUG 0x0001 /* Record debugging information. */
+#define SO_REUSEADDR 0x0004 /* Allow reuse of local addresses. */
+#define SO_KEEPALIVE 0x0008 /* Keep connections alive and send
+ SIGPIPE when they die. */
+#define SO_DONTROUTE 0x0010 /* Don't do local routing. */
+#define SO_BROADCAST 0x0020 /* Allow transmission of
+ broadcast messages. */
+#define SO_LINGER 0x0080 /* Block on close of a reliable
+ socket to transmit pending data. */
+#define SO_OOBINLINE 0x0100 /* Receive out-of-band data in-band. */
+#if 0
+To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
+#endif
+
+#define SO_TYPE 0x1008 /* Compatible name for SO_STYLE. */
+#define SO_STYLE SO_TYPE /* Synonym */
+#define SO_ERROR 0x1007 /* get error status and clear */
+#define SO_SNDBUF 0x1001 /* Send buffer size. */
+#define SO_RCVBUF 0x1002 /* Receive buffer. */
+#define SO_SNDLOWAT 0x1003 /* send low-water mark */
+#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
+#define SO_SNDTIMEO 0x1005 /* send timeout */
+#define SO_RCVTIMEO 0x1006 /* receive timeout */
+#define SO_ACCEPTCONN 0x1009
+
+/* linux-specific, might as well be the same as on i386 */
+#define SO_NO_CHECK 11
+#define SO_PRIORITY 12
+#define SO_BSDCOMPAT 14
+
+#define SO_PASSCRED 17
+#define SO_PEERCRED 18
+
+/* Security levels - as per NRL IPv6 - don't actually do anything */
+#define SO_SECURITY_AUTHENTICATION 22
+#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
+#define SO_SECURITY_ENCRYPTION_NETWORK 24
+
+#define SO_BINDTODEVICE 25
+
+/* Socket filtering */
+#define SO_ATTACH_FILTER 26
+#define SO_DETACH_FILTER 27
+
+#define SO_PEERNAME 28
+#define SO_TIMESTAMP 29
+#define SCM_TIMESTAMP SO_TIMESTAMP
+
+#define SO_PEERSEC 30
+#define SO_SNDBUFFORCE 31
+#define SO_RCVBUFFORCE 33
+#define SO_PASSSEC 34
+#define SO_TIMESTAMPNS 35
+#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
+
+#define SO_MARK 36
+
+#define SO_TIMESTAMPING 37
+#define SCM_TIMESTAMPING SO_TIMESTAMPING
+
+
+#endif /* _ASM_SOCKET_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/sockios.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/sockios.h
new file mode 100644
index 0000000..ed1a5f7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/sockios.h
@@ -0,0 +1,26 @@
+/*
+ * Socket-level I/O control calls.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995 by Ralf Baechle
+ */
+#ifndef _ASM_SOCKIOS_H
+#define _ASM_SOCKIOS_H
+
+#include <asm/ioctl.h>
+
+/* Socket-level I/O control calls. */
+#define FIOGETOWN _IOR('f', 123, int)
+#define FIOSETOWN _IOW('f', 124, int)
+
+#define SIOCATMARK _IOR('s', 7, int)
+#define SIOCSPGRP _IOW('s', 8, pid_t)
+#define SIOCGPGRP _IOR('s', 9, pid_t)
+
+#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
+#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
+
+#endif /* _ASM_SOCKIOS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/stat.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/stat.h
new file mode 100644
index 0000000..6e00f75
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/stat.h
@@ -0,0 +1,132 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 1999, 2000 Ralf Baechle
+ * Copyright (C) 2000 Silicon Graphics, Inc.
+ */
+#ifndef _ASM_STAT_H
+#define _ASM_STAT_H
+
+#include <linux/types.h>
+
+#include <asm/sgidefs.h>
+
+#if (_MIPS_SIM == _MIPS_SIM_ABI32) || (_MIPS_SIM == _MIPS_SIM_NABI32)
+
+struct stat {
+ unsigned st_dev;
+ long st_pad1[3]; /* Reserved for network id */
+ ino_t st_ino;
+ mode_t st_mode;
+ nlink_t st_nlink;
+ uid_t st_uid;
+ gid_t st_gid;
+ unsigned st_rdev;
+ long st_pad2[2];
+ off_t st_size;
+ long st_pad3;
+ /*
+ * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
+ * but we don't have it under Linux.
+ */
+ time_t st_atime;
+ long st_atime_nsec;
+ time_t st_mtime;
+ long st_mtime_nsec;
+ time_t st_ctime;
+ long st_ctime_nsec;
+ long st_blksize;
+ long st_blocks;
+ long st_pad4[14];
+};
+
+/*
+ * This matches struct stat64 in glibc2.1, hence the absolutely insane
+ * amounts of padding around dev_t's. The memory layout is the same as of
+ * struct stat of the 64-bit kernel.
+ */
+
+struct stat64 {
+ unsigned long st_dev;
+ unsigned long st_pad0[3]; /* Reserved for st_dev expansion */
+
+ unsigned long long st_ino;
+
+ mode_t st_mode;
+ nlink_t st_nlink;
+
+ uid_t st_uid;
+ gid_t st_gid;
+
+ unsigned long st_rdev;
+ unsigned long st_pad1[3]; /* Reserved for st_rdev expansion */
+
+ long long st_size;
+
+ /*
+ * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
+ * but we don't have it under Linux.
+ */
+ time_t st_atime;
+ unsigned long st_atime_nsec; /* Reserved for st_atime expansion */
+
+ time_t st_mtime;
+ unsigned long st_mtime_nsec; /* Reserved for st_mtime expansion */
+
+ time_t st_ctime;
+ unsigned long st_ctime_nsec; /* Reserved for st_ctime expansion */
+
+ unsigned long st_blksize;
+ unsigned long st_pad2;
+
+ long long st_blocks;
+};
+
+#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
+
+#if _MIPS_SIM == _MIPS_SIM_ABI64
+
+/* The memory layout is the same as of struct stat64 of the 32-bit kernel. */
+struct stat {
+ unsigned int st_dev;
+ unsigned int st_pad0[3]; /* Reserved for st_dev expansion */
+
+ unsigned long st_ino;
+
+ mode_t st_mode;
+ nlink_t st_nlink;
+
+ uid_t st_uid;
+ gid_t st_gid;
+
+ unsigned int st_rdev;
+ unsigned int st_pad1[3]; /* Reserved for st_rdev expansion */
+
+ off_t st_size;
+
+ /*
+ * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
+ * but we don't have it under Linux.
+ */
+ unsigned int st_atime;
+ unsigned int st_atime_nsec;
+
+ unsigned int st_mtime;
+ unsigned int st_mtime_nsec;
+
+ unsigned int st_ctime;
+ unsigned int st_ctime_nsec;
+
+ unsigned int st_blksize;
+ unsigned int st_pad2;
+
+ unsigned long st_blocks;
+};
+
+#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
+
+#define STAT_HAVE_NSEC 1
+
+#endif /* _ASM_STAT_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/statfs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/statfs.h
new file mode 100644
index 0000000..c3ddf97
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/statfs.h
@@ -0,0 +1,96 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 1999 by Ralf Baechle
+ */
+#ifndef _ASM_STATFS_H
+#define _ASM_STATFS_H
+
+#include <linux/posix_types.h>
+#include <asm/sgidefs.h>
+
+#ifndef __KERNEL_STRICT_NAMES
+
+#include <linux/types.h>
+
+typedef __kernel_fsid_t fsid_t;
+
+#endif
+
+struct statfs {
+ long f_type;
+#define f_fstyp f_type
+ long f_bsize;
+ long f_frsize; /* Fragment size - unsupported */
+ long f_blocks;
+ long f_bfree;
+ long f_files;
+ long f_ffree;
+ long f_bavail;
+
+ /* Linux specials */
+ __kernel_fsid_t f_fsid;
+ long f_namelen;
+ long f_spare[6];
+};
+
+#if (_MIPS_SIM == _MIPS_SIM_ABI32) || (_MIPS_SIM == _MIPS_SIM_NABI32)
+
+/*
+ * Unlike the traditional version the LFAPI version has none of the ABI junk
+ */
+struct statfs64 {
+ __u32 f_type;
+ __u32 f_bsize;
+ __u32 f_frsize; /* Fragment size - unsupported */
+ __u32 __pad;
+ __u64 f_blocks;
+ __u64 f_bfree;
+ __u64 f_files;
+ __u64 f_ffree;
+ __u64 f_bavail;
+ __kernel_fsid_t f_fsid;
+ __u32 f_namelen;
+ __u32 f_spare[6];
+};
+
+#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
+
+#if _MIPS_SIM == _MIPS_SIM_ABI64
+
+struct statfs64 { /* Same as struct statfs */
+ long f_type;
+ long f_bsize;
+ long f_frsize; /* Fragment size - unsupported */
+ long f_blocks;
+ long f_bfree;
+ long f_files;
+ long f_ffree;
+ long f_bavail;
+
+ /* Linux specials */
+ __kernel_fsid_t f_fsid;
+ long f_namelen;
+ long f_spare[6];
+};
+
+struct compat_statfs64 {
+ __u32 f_type;
+ __u32 f_bsize;
+ __u32 f_frsize; /* Fragment size - unsupported */
+ __u32 __pad;
+ __u64 f_blocks;
+ __u64 f_bfree;
+ __u64 f_files;
+ __u64 f_ffree;
+ __u64 f_bavail;
+ __kernel_fsid_t f_fsid;
+ __u32 f_namelen;
+ __u32 f_spare[6];
+};
+
+#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
+
+#endif /* _ASM_STATFS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/swab.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/swab.h
new file mode 100644
index 0000000..44db6ae
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/swab.h
@@ -0,0 +1,55 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1996, 99, 2003 by Ralf Baechle
+ */
+#ifndef _ASM_SWAB_H
+#define _ASM_SWAB_H
+
+
+#include <linux/types.h>
+
+#define __SWAB_64_THRU_32__
+
+#ifdef CONFIG_CPU_MIPSR2
+
+static __inline__ __u16 __arch_swab16(__u16 x)
+{
+ __asm__(
+ " wsbh %0, %1 \n"
+ : "=r" (x)
+ : "r" (x));
+
+ return x;
+}
+#define __arch_swab16 __arch_swab16
+
+static __inline__ __u32 __arch_swab32(__u32 x)
+{
+ __asm__(
+ " wsbh %0, %1 \n"
+ " rotr %0, %0, 16 \n"
+ : "=r" (x)
+ : "r" (x));
+
+ return x;
+}
+#define __arch_swab32 __arch_swab32
+
+#ifdef CONFIG_CPU_MIPS64_R2
+static __inline__ __u64 __arch_swab64(__u64 x)
+{
+ __asm__(
+ " dsbh %0, %1\n"
+ " dshd %0, %0"
+ : "=r" (x)
+ : "r" (x));
+
+ return x;
+}
+#define __arch_swab64 __arch_swab64
+#endif /* CONFIG_CPU_MIPS64_R2 */
+#endif /* CONFIG_CPU_MIPSR2 */
+#endif /* _ASM_SWAB_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/sysmips.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/sysmips.h
new file mode 100644
index 0000000..4f47b7d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/sysmips.h
@@ -0,0 +1,25 @@
+/*
+ * Definitions for the MIPS sysmips(2) call
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995 by Ralf Baechle
+ */
+#ifndef _ASM_SYSMIPS_H
+#define _ASM_SYSMIPS_H
+
+/*
+ * Commands for the sysmips(2) call
+ *
+ * sysmips(2) is deprecated - though some existing software uses it.
+ * We only support the following commands.
+ */
+#define SETNAME 1 /* set hostname */
+#define FLUSH_CACHE 3 /* writeback and invalidate caches */
+#define MIPS_FIXADE 7 /* control address error fixing */
+#define MIPS_RDNVRAM 10 /* read NVRAM */
+#define MIPS_ATOMIC_SET 2001 /* atomically set variable */
+
+#endif /* _ASM_SYSMIPS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/termbits.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/termbits.h
new file mode 100644
index 0000000..c83c684
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/termbits.h
@@ -0,0 +1,226 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 96, 99, 2001, 06 Ralf Baechle
+ * Copyright (C) 1999 Silicon Graphics, Inc.
+ * Copyright (C) 2001 MIPS Technologies, Inc.
+ */
+#ifndef _ASM_TERMBITS_H
+#define _ASM_TERMBITS_H
+
+#include <linux/posix_types.h>
+
+typedef unsigned char cc_t;
+typedef unsigned int speed_t;
+typedef unsigned int tcflag_t;
+
+/*
+ * The ABI says nothing about NCC but seems to use NCCS as
+ * replacement for it in struct termio
+ */
+#define NCCS 23
+struct termios {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+};
+
+struct termios2 {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+};
+
+struct ktermios {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+};
+
+/* c_cc characters */
+#define VINTR 0 /* Interrupt character [ISIG]. */
+#define VQUIT 1 /* Quit character [ISIG]. */
+#define VERASE 2 /* Erase character [ICANON]. */
+#define VKILL 3 /* Kill-line character [ICANON]. */
+#define VMIN 4 /* Minimum number of bytes read at once [!ICANON]. */
+#define VTIME 5 /* Time-out value (tenths of a second) [!ICANON]. */
+#define VEOL2 6 /* Second EOL character [ICANON]. */
+#define VSWTC 7 /* ??? */
+#define VSWTCH VSWTC
+#define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */
+#define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */
+#define VSUSP 10 /* Suspend character [ISIG]. */
+#if 0
+/*
+ * VDSUSP is not supported
+ */
+#define VDSUSP 11 /* Delayed suspend character [ISIG]. */
+#endif
+#define VREPRINT 12 /* Reprint-line character [ICANON]. */
+#define VDISCARD 13 /* Discard character [IEXTEN]. */
+#define VWERASE 14 /* Word-erase character [ICANON]. */
+#define VLNEXT 15 /* Literal-next character [IEXTEN]. */
+#define VEOF 16 /* End-of-file character [ICANON]. */
+#define VEOL 17 /* End-of-line character [ICANON]. */
+
+/* c_iflag bits */
+#define IGNBRK 0000001 /* Ignore break condition. */
+#define BRKINT 0000002 /* Signal interrupt on break. */
+#define IGNPAR 0000004 /* Ignore characters with parity errors. */
+#define PARMRK 0000010 /* Mark parity and framing errors. */
+#define INPCK 0000020 /* Enable input parity check. */
+#define ISTRIP 0000040 /* Strip 8th bit off characters. */
+#define INLCR 0000100 /* Map NL to CR on input. */
+#define IGNCR 0000200 /* Ignore CR. */
+#define ICRNL 0000400 /* Map CR to NL on input. */
+#define IUCLC 0001000 /* Map upper case to lower case on input. */
+#define IXON 0002000 /* Enable start/stop output control. */
+#define IXANY 0004000 /* Any character will restart after stop. */
+#define IXOFF 0010000 /* Enable start/stop input control. */
+#define IMAXBEL 0020000 /* Ring bell when input queue is full. */
+#define IUTF8 0040000 /* Input is UTF-8 */
+
+/* c_oflag bits */
+#define OPOST 0000001 /* Perform output processing. */
+#define OLCUC 0000002 /* Map lower case to upper case on output. */
+#define ONLCR 0000004 /* Map NL to CR-NL on output. */
+#define OCRNL 0000010
+#define ONOCR 0000020
+#define ONLRET 0000040
+#define OFILL 0000100
+#define OFDEL 0000200
+#define NLDLY 0000400
+#define NL0 0000000
+#define NL1 0000400
+#define CRDLY 0003000
+#define CR0 0000000
+#define CR1 0001000
+#define CR2 0002000
+#define CR3 0003000
+#define TABDLY 0014000
+#define TAB0 0000000
+#define TAB1 0004000
+#define TAB2 0010000
+#define TAB3 0014000
+#define XTABS 0014000
+#define BSDLY 0020000
+#define BS0 0000000
+#define BS1 0020000
+#define VTDLY 0040000
+#define VT0 0000000
+#define VT1 0040000
+#define FFDLY 0100000
+#define FF0 0000000
+#define FF1 0100000
+/*
+#define PAGEOUT ???
+#define WRAP ???
+ */
+
+/* c_cflag bit meaning */
+#define CBAUD 0010017
+#define B0 0000000 /* hang up */
+#define B50 0000001
+#define B75 0000002
+#define B110 0000003
+#define B134 0000004
+#define B150 0000005
+#define B200 0000006
+#define B300 0000007
+#define B600 0000010
+#define B1200 0000011
+#define B1800 0000012
+#define B2400 0000013
+#define B4800 0000014
+#define B9600 0000015
+#define B19200 0000016
+#define B38400 0000017
+#define EXTA B19200
+#define EXTB B38400
+#define CSIZE 0000060 /* Number of bits per byte (mask). */
+#define CS5 0000000 /* 5 bits per byte. */
+#define CS6 0000020 /* 6 bits per byte. */
+#define CS7 0000040 /* 7 bits per byte. */
+#define CS8 0000060 /* 8 bits per byte. */
+#define CSTOPB 0000100 /* Two stop bits instead of one. */
+#define CREAD 0000200 /* Enable receiver. */
+#define PARENB 0000400 /* Parity enable. */
+#define PARODD 0001000 /* Odd parity instead of even. */
+#define HUPCL 0002000 /* Hang up on last close. */
+#define CLOCAL 0004000 /* Ignore modem status lines. */
+#define CBAUDEX 0010000
+#define BOTHER 0010000
+#define B57600 0010001
+#define B115200 0010002
+#define B230400 0010003
+#define B460800 0010004
+#define B500000 0010005
+#define B576000 0010006
+#define B921600 0010007
+#define B1000000 0010010
+#define B1152000 0010011
+#define B1500000 0010012
+#define B2000000 0010013
+#define B2500000 0010014
+#define B3000000 0010015
+#define B3500000 0010016
+#define B4000000 0010017
+#define CIBAUD 002003600000 /* input baud rate */
+#define CMSPAR 010000000000 /* mark or space (stick) parity */
+#define CRTSCTS 020000000000 /* flow control */
+
+#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
+
+/* c_lflag bits */
+#define ISIG 0000001 /* Enable signals. */
+#define ICANON 0000002 /* Do erase and kill processing. */
+#define XCASE 0000004
+#define ECHO 0000010 /* Enable echo. */
+#define ECHOE 0000020 /* Visual erase for ERASE. */
+#define ECHOK 0000040 /* Echo NL after KILL. */
+#define ECHONL 0000100 /* Echo NL even if ECHO is off. */
+#define NOFLSH 0000200 /* Disable flush after interrupt. */
+#define IEXTEN 0000400 /* Enable DISCARD and LNEXT. */
+#define ECHOCTL 0001000 /* Echo control characters as ^X. */
+#define ECHOPRT 0002000 /* Hardcopy visual erase. */
+#define ECHOKE 0004000 /* Visual erase for KILL. */
+#define FLUSHO 0020000
+#define PENDIN 0040000 /* Retype pending input (state). */
+#define TOSTOP 0100000 /* Send SIGTTOU for background output. */
+#define ITOSTOP TOSTOP
+
+/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
+
+/* tcflow() and TCXONC use these */
+#define TCOOFF 0 /* Suspend output. */
+#define TCOON 1 /* Restart suspended output. */
+#define TCIOFF 2 /* Send a STOP character. */
+#define TCION 3 /* Send a START character. */
+
+/* tcflush() and TCFLSH use these */
+#define TCIFLUSH 0 /* Discard data received but not yet read. */
+#define TCOFLUSH 1 /* Discard data written but not yet sent. */
+#define TCIOFLUSH 2 /* Discard all pending data. */
+
+/* tcsetattr uses these */
+#define TCSANOW TCSETS /* Change immediately. */
+#define TCSADRAIN TCSETSW /* Change when pending output is written. */
+#define TCSAFLUSH TCSETSF /* Flush pending input before changing. */
+
+#endif /* _ASM_TERMBITS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/termios.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/termios.h
new file mode 100644
index 0000000..70416cc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/termios.h
@@ -0,0 +1,80 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 1996, 2000, 2001 by Ralf Baechle
+ * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
+ */
+#ifndef _ASM_TERMIOS_H
+#define _ASM_TERMIOS_H
+
+#include <linux/errno.h>
+#include <asm/termbits.h>
+#include <asm/ioctls.h>
+
+struct sgttyb {
+ char sg_ispeed;
+ char sg_ospeed;
+ char sg_erase;
+ char sg_kill;
+ int sg_flags; /* SGI special - int, not short */
+};
+
+struct tchars {
+ char t_intrc;
+ char t_quitc;
+ char t_startc;
+ char t_stopc;
+ char t_eofc;
+ char t_brkc;
+};
+
+struct ltchars {
+ char t_suspc; /* stop process signal */
+ char t_dsuspc; /* delayed stop process signal */
+ char t_rprntc; /* reprint line */
+ char t_flushc; /* flush output (toggles) */
+ char t_werasc; /* word erase */
+ char t_lnextc; /* literal next character */
+};
+
+/* TIOCGSIZE, TIOCSSIZE not defined yet. Only needed for SunOS source
+ compatibility anyway ... */
+
+struct winsize {
+ unsigned short ws_row;
+ unsigned short ws_col;
+ unsigned short ws_xpixel;
+ unsigned short ws_ypixel;
+};
+
+#define NCC 8
+struct termio {
+ unsigned short c_iflag; /* input mode flags */
+ unsigned short c_oflag; /* output mode flags */
+ unsigned short c_cflag; /* control mode flags */
+ unsigned short c_lflag; /* local mode flags */
+ char c_line; /* line discipline */
+ unsigned char c_cc[NCCS]; /* control characters */
+};
+
+
+/* modem lines */
+#define TIOCM_LE 0x001 /* line enable */
+#define TIOCM_DTR 0x002 /* data terminal ready */
+#define TIOCM_RTS 0x004 /* request to send */
+#define TIOCM_ST 0x010 /* secondary transmit */
+#define TIOCM_SR 0x020 /* secondary receive */
+#define TIOCM_CTS 0x040 /* clear to send */
+#define TIOCM_CAR 0x100 /* carrier detect */
+#define TIOCM_CD TIOCM_CAR
+#define TIOCM_RNG 0x200 /* ring */
+#define TIOCM_RI TIOCM_RNG
+#define TIOCM_DSR 0x400 /* data set ready */
+#define TIOCM_OUT1 0x2000
+#define TIOCM_OUT2 0x4000
+#define TIOCM_LOOP 0x8000
+
+
+#endif /* _ASM_TERMIOS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/types.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/types.h
new file mode 100644
index 0000000..6e0e3e7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/types.h
@@ -0,0 +1,34 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle
+ * Copyright (C) 2008 Wind River Systems,
+ * written by Ralf Baechle
+ * Copyright (C) 1999 Silicon Graphics, Inc.
+ */
+#ifndef _ASM_TYPES_H
+#define _ASM_TYPES_H
+
+/*
+ * We don't use int-l64.h for the kernel anymore but still use it for
+ * userspace to avoid code changes.
+ */
+#if (_MIPS_SZLONG == 64) && !defined(__KERNEL__)
+# include <asm-generic/int-l64.h>
+#else
+# include <asm-generic/int-ll64.h>
+#endif
+
+#ifndef __ASSEMBLY__
+
+typedef unsigned short umode_t;
+
+#endif /* __ASSEMBLY__ */
+
+/*
+ * These aren't exported outside the kernel to avoid name space clashes
+ */
+
+#endif /* _ASM_TYPES_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/unistd.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/unistd.h
new file mode 100644
index 0000000..b8f906f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/asm/unistd.h
@@ -0,0 +1,986 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 96, 97, 98, 99, 2000 by Ralf Baechle
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+ *
+ * Changed system calls macros _syscall5 - _syscall7 to push args 5 to 7 onto
+ * the stack. Robin Farine for ACN S.A, Copyright (C) 1996 by ACN S.A
+ */
+#ifndef _ASM_UNISTD_H
+#define _ASM_UNISTD_H
+
+#include <asm/sgidefs.h>
+
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+
+/*
+ * Linux o32 style syscalls are in the range from 4000 to 4999.
+ */
+#define __NR_Linux 4000
+#define __NR_syscall (__NR_Linux + 0)
+#define __NR_exit (__NR_Linux + 1)
+#define __NR_fork (__NR_Linux + 2)
+#define __NR_read (__NR_Linux + 3)
+#define __NR_write (__NR_Linux + 4)
+#define __NR_open (__NR_Linux + 5)
+#define __NR_close (__NR_Linux + 6)
+#define __NR_waitpid (__NR_Linux + 7)
+#define __NR_creat (__NR_Linux + 8)
+#define __NR_link (__NR_Linux + 9)
+#define __NR_unlink (__NR_Linux + 10)
+#define __NR_execve (__NR_Linux + 11)
+#define __NR_chdir (__NR_Linux + 12)
+#define __NR_time (__NR_Linux + 13)
+#define __NR_mknod (__NR_Linux + 14)
+#define __NR_chmod (__NR_Linux + 15)
+#define __NR_lchown (__NR_Linux + 16)
+#define __NR_break (__NR_Linux + 17)
+#define __NR_unused18 (__NR_Linux + 18)
+#define __NR_lseek (__NR_Linux + 19)
+#define __NR_getpid (__NR_Linux + 20)
+#define __NR_mount (__NR_Linux + 21)
+#define __NR_umount (__NR_Linux + 22)
+#define __NR_setuid (__NR_Linux + 23)
+#define __NR_getuid (__NR_Linux + 24)
+#define __NR_stime (__NR_Linux + 25)
+#define __NR_ptrace (__NR_Linux + 26)
+#define __NR_alarm (__NR_Linux + 27)
+#define __NR_unused28 (__NR_Linux + 28)
+#define __NR_pause (__NR_Linux + 29)
+#define __NR_utime (__NR_Linux + 30)
+#define __NR_stty (__NR_Linux + 31)
+#define __NR_gtty (__NR_Linux + 32)
+#define __NR_access (__NR_Linux + 33)
+#define __NR_nice (__NR_Linux + 34)
+#define __NR_ftime (__NR_Linux + 35)
+#define __NR_sync (__NR_Linux + 36)
+#define __NR_kill (__NR_Linux + 37)
+#define __NR_rename (__NR_Linux + 38)
+#define __NR_mkdir (__NR_Linux + 39)
+#define __NR_rmdir (__NR_Linux + 40)
+#define __NR_dup (__NR_Linux + 41)
+#define __NR_pipe (__NR_Linux + 42)
+#define __NR_times (__NR_Linux + 43)
+#define __NR_prof (__NR_Linux + 44)
+#define __NR_brk (__NR_Linux + 45)
+#define __NR_setgid (__NR_Linux + 46)
+#define __NR_getgid (__NR_Linux + 47)
+#define __NR_signal (__NR_Linux + 48)
+#define __NR_geteuid (__NR_Linux + 49)
+#define __NR_getegid (__NR_Linux + 50)
+#define __NR_acct (__NR_Linux + 51)
+#define __NR_umount2 (__NR_Linux + 52)
+#define __NR_lock (__NR_Linux + 53)
+#define __NR_ioctl (__NR_Linux + 54)
+#define __NR_fcntl (__NR_Linux + 55)
+#define __NR_mpx (__NR_Linux + 56)
+#define __NR_setpgid (__NR_Linux + 57)
+#define __NR_ulimit (__NR_Linux + 58)
+#define __NR_unused59 (__NR_Linux + 59)
+#define __NR_umask (__NR_Linux + 60)
+#define __NR_chroot (__NR_Linux + 61)
+#define __NR_ustat (__NR_Linux + 62)
+#define __NR_dup2 (__NR_Linux + 63)
+#define __NR_getppid (__NR_Linux + 64)
+#define __NR_getpgrp (__NR_Linux + 65)
+#define __NR_setsid (__NR_Linux + 66)
+#define __NR_sigaction (__NR_Linux + 67)
+#define __NR_sgetmask (__NR_Linux + 68)
+#define __NR_ssetmask (__NR_Linux + 69)
+#define __NR_setreuid (__NR_Linux + 70)
+#define __NR_setregid (__NR_Linux + 71)
+#define __NR_sigsuspend (__NR_Linux + 72)
+#define __NR_sigpending (__NR_Linux + 73)
+#define __NR_sethostname (__NR_Linux + 74)
+#define __NR_setrlimit (__NR_Linux + 75)
+#define __NR_getrlimit (__NR_Linux + 76)
+#define __NR_getrusage (__NR_Linux + 77)
+#define __NR_gettimeofday (__NR_Linux + 78)
+#define __NR_settimeofday (__NR_Linux + 79)
+#define __NR_getgroups (__NR_Linux + 80)
+#define __NR_setgroups (__NR_Linux + 81)
+#define __NR_reserved82 (__NR_Linux + 82)
+#define __NR_symlink (__NR_Linux + 83)
+#define __NR_unused84 (__NR_Linux + 84)
+#define __NR_readlink (__NR_Linux + 85)
+#define __NR_uselib (__NR_Linux + 86)
+#define __NR_swapon (__NR_Linux + 87)
+#define __NR_reboot (__NR_Linux + 88)
+#define __NR_readdir (__NR_Linux + 89)
+#define __NR_mmap (__NR_Linux + 90)
+#define __NR_munmap (__NR_Linux + 91)
+#define __NR_truncate (__NR_Linux + 92)
+#define __NR_ftruncate (__NR_Linux + 93)
+#define __NR_fchmod (__NR_Linux + 94)
+#define __NR_fchown (__NR_Linux + 95)
+#define __NR_getpriority (__NR_Linux + 96)
+#define __NR_setpriority (__NR_Linux + 97)
+#define __NR_profil (__NR_Linux + 98)
+#define __NR_statfs (__NR_Linux + 99)
+#define __NR_fstatfs (__NR_Linux + 100)
+#define __NR_ioperm (__NR_Linux + 101)
+#define __NR_socketcall (__NR_Linux + 102)
+#define __NR_syslog (__NR_Linux + 103)
+#define __NR_setitimer (__NR_Linux + 104)
+#define __NR_getitimer (__NR_Linux + 105)
+#define __NR_stat (__NR_Linux + 106)
+#define __NR_lstat (__NR_Linux + 107)
+#define __NR_fstat (__NR_Linux + 108)
+#define __NR_unused109 (__NR_Linux + 109)
+#define __NR_iopl (__NR_Linux + 110)
+#define __NR_vhangup (__NR_Linux + 111)
+#define __NR_idle (__NR_Linux + 112)
+#define __NR_vm86 (__NR_Linux + 113)
+#define __NR_wait4 (__NR_Linux + 114)
+#define __NR_swapoff (__NR_Linux + 115)
+#define __NR_sysinfo (__NR_Linux + 116)
+#define __NR_ipc (__NR_Linux + 117)
+#define __NR_fsync (__NR_Linux + 118)
+#define __NR_sigreturn (__NR_Linux + 119)
+#define __NR_clone (__NR_Linux + 120)
+#define __NR_setdomainname (__NR_Linux + 121)
+#define __NR_uname (__NR_Linux + 122)
+#define __NR_modify_ldt (__NR_Linux + 123)
+#define __NR_adjtimex (__NR_Linux + 124)
+#define __NR_mprotect (__NR_Linux + 125)
+#define __NR_sigprocmask (__NR_Linux + 126)
+#define __NR_create_module (__NR_Linux + 127)
+#define __NR_init_module (__NR_Linux + 128)
+#define __NR_delete_module (__NR_Linux + 129)
+#define __NR_get_kernel_syms (__NR_Linux + 130)
+#define __NR_quotactl (__NR_Linux + 131)
+#define __NR_getpgid (__NR_Linux + 132)
+#define __NR_fchdir (__NR_Linux + 133)
+#define __NR_bdflush (__NR_Linux + 134)
+#define __NR_sysfs (__NR_Linux + 135)
+#define __NR_personality (__NR_Linux + 136)
+#define __NR_afs_syscall (__NR_Linux + 137) /* Syscall for Andrew File System */
+#define __NR_setfsuid (__NR_Linux + 138)
+#define __NR_setfsgid (__NR_Linux + 139)
+#define __NR__llseek (__NR_Linux + 140)
+#define __NR_getdents (__NR_Linux + 141)
+#define __NR__newselect (__NR_Linux + 142)
+#define __NR_flock (__NR_Linux + 143)
+#define __NR_msync (__NR_Linux + 144)
+#define __NR_readv (__NR_Linux + 145)
+#define __NR_writev (__NR_Linux + 146)
+#define __NR_cacheflush (__NR_Linux + 147)
+#define __NR_cachectl (__NR_Linux + 148)
+#define __NR_sysmips (__NR_Linux + 149)
+#define __NR_unused150 (__NR_Linux + 150)
+#define __NR_getsid (__NR_Linux + 151)
+#define __NR_fdatasync (__NR_Linux + 152)
+#define __NR__sysctl (__NR_Linux + 153)
+#define __NR_mlock (__NR_Linux + 154)
+#define __NR_munlock (__NR_Linux + 155)
+#define __NR_mlockall (__NR_Linux + 156)
+#define __NR_munlockall (__NR_Linux + 157)
+#define __NR_sched_setparam (__NR_Linux + 158)
+#define __NR_sched_getparam (__NR_Linux + 159)
+#define __NR_sched_setscheduler (__NR_Linux + 160)
+#define __NR_sched_getscheduler (__NR_Linux + 161)
+#define __NR_sched_yield (__NR_Linux + 162)
+#define __NR_sched_get_priority_max (__NR_Linux + 163)
+#define __NR_sched_get_priority_min (__NR_Linux + 164)
+#define __NR_sched_rr_get_interval (__NR_Linux + 165)
+#define __NR_nanosleep (__NR_Linux + 166)
+#define __NR_mremap (__NR_Linux + 167)
+#define __NR_accept (__NR_Linux + 168)
+#define __NR_bind (__NR_Linux + 169)
+#define __NR_connect (__NR_Linux + 170)
+#define __NR_getpeername (__NR_Linux + 171)
+#define __NR_getsockname (__NR_Linux + 172)
+#define __NR_getsockopt (__NR_Linux + 173)
+#define __NR_listen (__NR_Linux + 174)
+#define __NR_recv (__NR_Linux + 175)
+#define __NR_recvfrom (__NR_Linux + 176)
+#define __NR_recvmsg (__NR_Linux + 177)
+#define __NR_send (__NR_Linux + 178)
+#define __NR_sendmsg (__NR_Linux + 179)
+#define __NR_sendto (__NR_Linux + 180)
+#define __NR_setsockopt (__NR_Linux + 181)
+#define __NR_shutdown (__NR_Linux + 182)
+#define __NR_socket (__NR_Linux + 183)
+#define __NR_socketpair (__NR_Linux + 184)
+#define __NR_setresuid (__NR_Linux + 185)
+#define __NR_getresuid (__NR_Linux + 186)
+#define __NR_query_module (__NR_Linux + 187)
+#define __NR_poll (__NR_Linux + 188)
+#define __NR_nfsservctl (__NR_Linux + 189)
+#define __NR_setresgid (__NR_Linux + 190)
+#define __NR_getresgid (__NR_Linux + 191)
+#define __NR_prctl (__NR_Linux + 192)
+#define __NR_rt_sigreturn (__NR_Linux + 193)
+#define __NR_rt_sigaction (__NR_Linux + 194)
+#define __NR_rt_sigprocmask (__NR_Linux + 195)
+#define __NR_rt_sigpending (__NR_Linux + 196)
+#define __NR_rt_sigtimedwait (__NR_Linux + 197)
+#define __NR_rt_sigqueueinfo (__NR_Linux + 198)
+#define __NR_rt_sigsuspend (__NR_Linux + 199)
+#define __NR_pread64 (__NR_Linux + 200)
+#define __NR_pwrite64 (__NR_Linux + 201)
+#define __NR_chown (__NR_Linux + 202)
+#define __NR_getcwd (__NR_Linux + 203)
+#define __NR_capget (__NR_Linux + 204)
+#define __NR_capset (__NR_Linux + 205)
+#define __NR_sigaltstack (__NR_Linux + 206)
+#define __NR_sendfile (__NR_Linux + 207)
+#define __NR_getpmsg (__NR_Linux + 208)
+#define __NR_putpmsg (__NR_Linux + 209)
+#define __NR_mmap2 (__NR_Linux + 210)
+#define __NR_truncate64 (__NR_Linux + 211)
+#define __NR_ftruncate64 (__NR_Linux + 212)
+#define __NR_stat64 (__NR_Linux + 213)
+#define __NR_lstat64 (__NR_Linux + 214)
+#define __NR_fstat64 (__NR_Linux + 215)
+#define __NR_pivot_root (__NR_Linux + 216)
+#define __NR_mincore (__NR_Linux + 217)
+#define __NR_madvise (__NR_Linux + 218)
+#define __NR_getdents64 (__NR_Linux + 219)
+#define __NR_fcntl64 (__NR_Linux + 220)
+#define __NR_reserved221 (__NR_Linux + 221)
+#define __NR_gettid (__NR_Linux + 222)
+#define __NR_readahead (__NR_Linux + 223)
+#define __NR_setxattr (__NR_Linux + 224)
+#define __NR_lsetxattr (__NR_Linux + 225)
+#define __NR_fsetxattr (__NR_Linux + 226)
+#define __NR_getxattr (__NR_Linux + 227)
+#define __NR_lgetxattr (__NR_Linux + 228)
+#define __NR_fgetxattr (__NR_Linux + 229)
+#define __NR_listxattr (__NR_Linux + 230)
+#define __NR_llistxattr (__NR_Linux + 231)
+#define __NR_flistxattr (__NR_Linux + 232)
+#define __NR_removexattr (__NR_Linux + 233)
+#define __NR_lremovexattr (__NR_Linux + 234)
+#define __NR_fremovexattr (__NR_Linux + 235)
+#define __NR_tkill (__NR_Linux + 236)
+#define __NR_sendfile64 (__NR_Linux + 237)
+#define __NR_futex (__NR_Linux + 238)
+#define __NR_sched_setaffinity (__NR_Linux + 239)
+#define __NR_sched_getaffinity (__NR_Linux + 240)
+#define __NR_io_setup (__NR_Linux + 241)
+#define __NR_io_destroy (__NR_Linux + 242)
+#define __NR_io_getevents (__NR_Linux + 243)
+#define __NR_io_submit (__NR_Linux + 244)
+#define __NR_io_cancel (__NR_Linux + 245)
+#define __NR_exit_group (__NR_Linux + 246)
+#define __NR_lookup_dcookie (__NR_Linux + 247)
+#define __NR_epoll_create (__NR_Linux + 248)
+#define __NR_epoll_ctl (__NR_Linux + 249)
+#define __NR_epoll_wait (__NR_Linux + 250)
+#define __NR_remap_file_pages (__NR_Linux + 251)
+#define __NR_set_tid_address (__NR_Linux + 252)
+#define __NR_restart_syscall (__NR_Linux + 253)
+#define __NR_fadvise64 (__NR_Linux + 254)
+#define __NR_statfs64 (__NR_Linux + 255)
+#define __NR_fstatfs64 (__NR_Linux + 256)
+#define __NR_timer_create (__NR_Linux + 257)
+#define __NR_timer_settime (__NR_Linux + 258)
+#define __NR_timer_gettime (__NR_Linux + 259)
+#define __NR_timer_getoverrun (__NR_Linux + 260)
+#define __NR_timer_delete (__NR_Linux + 261)
+#define __NR_clock_settime (__NR_Linux + 262)
+#define __NR_clock_gettime (__NR_Linux + 263)
+#define __NR_clock_getres (__NR_Linux + 264)
+#define __NR_clock_nanosleep (__NR_Linux + 265)
+#define __NR_tgkill (__NR_Linux + 266)
+#define __NR_utimes (__NR_Linux + 267)
+#define __NR_mbind (__NR_Linux + 268)
+#define __NR_get_mempolicy (__NR_Linux + 269)
+#define __NR_set_mempolicy (__NR_Linux + 270)
+#define __NR_mq_open (__NR_Linux + 271)
+#define __NR_mq_unlink (__NR_Linux + 272)
+#define __NR_mq_timedsend (__NR_Linux + 273)
+#define __NR_mq_timedreceive (__NR_Linux + 274)
+#define __NR_mq_notify (__NR_Linux + 275)
+#define __NR_mq_getsetattr (__NR_Linux + 276)
+#define __NR_vserver (__NR_Linux + 277)
+#define __NR_waitid (__NR_Linux + 278)
+/* #define __NR_sys_setaltroot (__NR_Linux + 279) */
+#define __NR_add_key (__NR_Linux + 280)
+#define __NR_request_key (__NR_Linux + 281)
+#define __NR_keyctl (__NR_Linux + 282)
+#define __NR_set_thread_area (__NR_Linux + 283)
+#define __NR_inotify_init (__NR_Linux + 284)
+#define __NR_inotify_add_watch (__NR_Linux + 285)
+#define __NR_inotify_rm_watch (__NR_Linux + 286)
+#define __NR_migrate_pages (__NR_Linux + 287)
+#define __NR_openat (__NR_Linux + 288)
+#define __NR_mkdirat (__NR_Linux + 289)
+#define __NR_mknodat (__NR_Linux + 290)
+#define __NR_fchownat (__NR_Linux + 291)
+#define __NR_futimesat (__NR_Linux + 292)
+#define __NR_fstatat64 (__NR_Linux + 293)
+#define __NR_unlinkat (__NR_Linux + 294)
+#define __NR_renameat (__NR_Linux + 295)
+#define __NR_linkat (__NR_Linux + 296)
+#define __NR_symlinkat (__NR_Linux + 297)
+#define __NR_readlinkat (__NR_Linux + 298)
+#define __NR_fchmodat (__NR_Linux + 299)
+#define __NR_faccessat (__NR_Linux + 300)
+#define __NR_pselect6 (__NR_Linux + 301)
+#define __NR_ppoll (__NR_Linux + 302)
+#define __NR_unshare (__NR_Linux + 303)
+#define __NR_splice (__NR_Linux + 304)
+#define __NR_sync_file_range (__NR_Linux + 305)
+#define __NR_tee (__NR_Linux + 306)
+#define __NR_vmsplice (__NR_Linux + 307)
+#define __NR_move_pages (__NR_Linux + 308)
+#define __NR_set_robust_list (__NR_Linux + 309)
+#define __NR_get_robust_list (__NR_Linux + 310)
+#define __NR_kexec_load (__NR_Linux + 311)
+#define __NR_getcpu (__NR_Linux + 312)
+#define __NR_epoll_pwait (__NR_Linux + 313)
+#define __NR_ioprio_set (__NR_Linux + 314)
+#define __NR_ioprio_get (__NR_Linux + 315)
+#define __NR_utimensat (__NR_Linux + 316)
+#define __NR_signalfd (__NR_Linux + 317)
+#define __NR_timerfd (__NR_Linux + 318)
+#define __NR_eventfd (__NR_Linux + 319)
+#define __NR_fallocate (__NR_Linux + 320)
+#define __NR_timerfd_create (__NR_Linux + 321)
+#define __NR_timerfd_gettime (__NR_Linux + 322)
+#define __NR_timerfd_settime (__NR_Linux + 323)
+#define __NR_signalfd4 (__NR_Linux + 324)
+#define __NR_eventfd2 (__NR_Linux + 325)
+#define __NR_epoll_create1 (__NR_Linux + 326)
+#define __NR_dup3 (__NR_Linux + 327)
+#define __NR_pipe2 (__NR_Linux + 328)
+#define __NR_inotify_init1 (__NR_Linux + 329)
+#define __NR_preadv (__NR_Linux + 330)
+#define __NR_pwritev (__NR_Linux + 331)
+
+/*
+ * Offset of the last Linux o32 flavoured syscall
+ */
+#define __NR_Linux_syscalls 331
+
+#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
+
+#define __NR_O32_Linux 4000
+#define __NR_O32_Linux_syscalls 331
+
+#if _MIPS_SIM == _MIPS_SIM_ABI64
+
+/*
+ * Linux 64-bit syscalls are in the range from 5000 to 5999.
+ */
+#define __NR_Linux 5000
+#define __NR_read (__NR_Linux + 0)
+#define __NR_write (__NR_Linux + 1)
+#define __NR_open (__NR_Linux + 2)
+#define __NR_close (__NR_Linux + 3)
+#define __NR_stat (__NR_Linux + 4)
+#define __NR_fstat (__NR_Linux + 5)
+#define __NR_lstat (__NR_Linux + 6)
+#define __NR_poll (__NR_Linux + 7)
+#define __NR_lseek (__NR_Linux + 8)
+#define __NR_mmap (__NR_Linux + 9)
+#define __NR_mprotect (__NR_Linux + 10)
+#define __NR_munmap (__NR_Linux + 11)
+#define __NR_brk (__NR_Linux + 12)
+#define __NR_rt_sigaction (__NR_Linux + 13)
+#define __NR_rt_sigprocmask (__NR_Linux + 14)
+#define __NR_ioctl (__NR_Linux + 15)
+#define __NR_pread64 (__NR_Linux + 16)
+#define __NR_pwrite64 (__NR_Linux + 17)
+#define __NR_readv (__NR_Linux + 18)
+#define __NR_writev (__NR_Linux + 19)
+#define __NR_access (__NR_Linux + 20)
+#define __NR_pipe (__NR_Linux + 21)
+#define __NR__newselect (__NR_Linux + 22)
+#define __NR_sched_yield (__NR_Linux + 23)
+#define __NR_mremap (__NR_Linux + 24)
+#define __NR_msync (__NR_Linux + 25)
+#define __NR_mincore (__NR_Linux + 26)
+#define __NR_madvise (__NR_Linux + 27)
+#define __NR_shmget (__NR_Linux + 28)
+#define __NR_shmat (__NR_Linux + 29)
+#define __NR_shmctl (__NR_Linux + 30)
+#define __NR_dup (__NR_Linux + 31)
+#define __NR_dup2 (__NR_Linux + 32)
+#define __NR_pause (__NR_Linux + 33)
+#define __NR_nanosleep (__NR_Linux + 34)
+#define __NR_getitimer (__NR_Linux + 35)
+#define __NR_setitimer (__NR_Linux + 36)
+#define __NR_alarm (__NR_Linux + 37)
+#define __NR_getpid (__NR_Linux + 38)
+#define __NR_sendfile (__NR_Linux + 39)
+#define __NR_socket (__NR_Linux + 40)
+#define __NR_connect (__NR_Linux + 41)
+#define __NR_accept (__NR_Linux + 42)
+#define __NR_sendto (__NR_Linux + 43)
+#define __NR_recvfrom (__NR_Linux + 44)
+#define __NR_sendmsg (__NR_Linux + 45)
+#define __NR_recvmsg (__NR_Linux + 46)
+#define __NR_shutdown (__NR_Linux + 47)
+#define __NR_bind (__NR_Linux + 48)
+#define __NR_listen (__NR_Linux + 49)
+#define __NR_getsockname (__NR_Linux + 50)
+#define __NR_getpeername (__NR_Linux + 51)
+#define __NR_socketpair (__NR_Linux + 52)
+#define __NR_setsockopt (__NR_Linux + 53)
+#define __NR_getsockopt (__NR_Linux + 54)
+#define __NR_clone (__NR_Linux + 55)
+#define __NR_fork (__NR_Linux + 56)
+#define __NR_execve (__NR_Linux + 57)
+#define __NR_exit (__NR_Linux + 58)
+#define __NR_wait4 (__NR_Linux + 59)
+#define __NR_kill (__NR_Linux + 60)
+#define __NR_uname (__NR_Linux + 61)
+#define __NR_semget (__NR_Linux + 62)
+#define __NR_semop (__NR_Linux + 63)
+#define __NR_semctl (__NR_Linux + 64)
+#define __NR_shmdt (__NR_Linux + 65)
+#define __NR_msgget (__NR_Linux + 66)
+#define __NR_msgsnd (__NR_Linux + 67)
+#define __NR_msgrcv (__NR_Linux + 68)
+#define __NR_msgctl (__NR_Linux + 69)
+#define __NR_fcntl (__NR_Linux + 70)
+#define __NR_flock (__NR_Linux + 71)
+#define __NR_fsync (__NR_Linux + 72)
+#define __NR_fdatasync (__NR_Linux + 73)
+#define __NR_truncate (__NR_Linux + 74)
+#define __NR_ftruncate (__NR_Linux + 75)
+#define __NR_getdents (__NR_Linux + 76)
+#define __NR_getcwd (__NR_Linux + 77)
+#define __NR_chdir (__NR_Linux + 78)
+#define __NR_fchdir (__NR_Linux + 79)
+#define __NR_rename (__NR_Linux + 80)
+#define __NR_mkdir (__NR_Linux + 81)
+#define __NR_rmdir (__NR_Linux + 82)
+#define __NR_creat (__NR_Linux + 83)
+#define __NR_link (__NR_Linux + 84)
+#define __NR_unlink (__NR_Linux + 85)
+#define __NR_symlink (__NR_Linux + 86)
+#define __NR_readlink (__NR_Linux + 87)
+#define __NR_chmod (__NR_Linux + 88)
+#define __NR_fchmod (__NR_Linux + 89)
+#define __NR_chown (__NR_Linux + 90)
+#define __NR_fchown (__NR_Linux + 91)
+#define __NR_lchown (__NR_Linux + 92)
+#define __NR_umask (__NR_Linux + 93)
+#define __NR_gettimeofday (__NR_Linux + 94)
+#define __NR_getrlimit (__NR_Linux + 95)
+#define __NR_getrusage (__NR_Linux + 96)
+#define __NR_sysinfo (__NR_Linux + 97)
+#define __NR_times (__NR_Linux + 98)
+#define __NR_ptrace (__NR_Linux + 99)
+#define __NR_getuid (__NR_Linux + 100)
+#define __NR_syslog (__NR_Linux + 101)
+#define __NR_getgid (__NR_Linux + 102)
+#define __NR_setuid (__NR_Linux + 103)
+#define __NR_setgid (__NR_Linux + 104)
+#define __NR_geteuid (__NR_Linux + 105)
+#define __NR_getegid (__NR_Linux + 106)
+#define __NR_setpgid (__NR_Linux + 107)
+#define __NR_getppid (__NR_Linux + 108)
+#define __NR_getpgrp (__NR_Linux + 109)
+#define __NR_setsid (__NR_Linux + 110)
+#define __NR_setreuid (__NR_Linux + 111)
+#define __NR_setregid (__NR_Linux + 112)
+#define __NR_getgroups (__NR_Linux + 113)
+#define __NR_setgroups (__NR_Linux + 114)
+#define __NR_setresuid (__NR_Linux + 115)
+#define __NR_getresuid (__NR_Linux + 116)
+#define __NR_setresgid (__NR_Linux + 117)
+#define __NR_getresgid (__NR_Linux + 118)
+#define __NR_getpgid (__NR_Linux + 119)
+#define __NR_setfsuid (__NR_Linux + 120)
+#define __NR_setfsgid (__NR_Linux + 121)
+#define __NR_getsid (__NR_Linux + 122)
+#define __NR_capget (__NR_Linux + 123)
+#define __NR_capset (__NR_Linux + 124)
+#define __NR_rt_sigpending (__NR_Linux + 125)
+#define __NR_rt_sigtimedwait (__NR_Linux + 126)
+#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
+#define __NR_rt_sigsuspend (__NR_Linux + 128)
+#define __NR_sigaltstack (__NR_Linux + 129)
+#define __NR_utime (__NR_Linux + 130)
+#define __NR_mknod (__NR_Linux + 131)
+#define __NR_personality (__NR_Linux + 132)
+#define __NR_ustat (__NR_Linux + 133)
+#define __NR_statfs (__NR_Linux + 134)
+#define __NR_fstatfs (__NR_Linux + 135)
+#define __NR_sysfs (__NR_Linux + 136)
+#define __NR_getpriority (__NR_Linux + 137)
+#define __NR_setpriority (__NR_Linux + 138)
+#define __NR_sched_setparam (__NR_Linux + 139)
+#define __NR_sched_getparam (__NR_Linux + 140)
+#define __NR_sched_setscheduler (__NR_Linux + 141)
+#define __NR_sched_getscheduler (__NR_Linux + 142)
+#define __NR_sched_get_priority_max (__NR_Linux + 143)
+#define __NR_sched_get_priority_min (__NR_Linux + 144)
+#define __NR_sched_rr_get_interval (__NR_Linux + 145)
+#define __NR_mlock (__NR_Linux + 146)
+#define __NR_munlock (__NR_Linux + 147)
+#define __NR_mlockall (__NR_Linux + 148)
+#define __NR_munlockall (__NR_Linux + 149)
+#define __NR_vhangup (__NR_Linux + 150)
+#define __NR_pivot_root (__NR_Linux + 151)
+#define __NR__sysctl (__NR_Linux + 152)
+#define __NR_prctl (__NR_Linux + 153)
+#define __NR_adjtimex (__NR_Linux + 154)
+#define __NR_setrlimit (__NR_Linux + 155)
+#define __NR_chroot (__NR_Linux + 156)
+#define __NR_sync (__NR_Linux + 157)
+#define __NR_acct (__NR_Linux + 158)
+#define __NR_settimeofday (__NR_Linux + 159)
+#define __NR_mount (__NR_Linux + 160)
+#define __NR_umount2 (__NR_Linux + 161)
+#define __NR_swapon (__NR_Linux + 162)
+#define __NR_swapoff (__NR_Linux + 163)
+#define __NR_reboot (__NR_Linux + 164)
+#define __NR_sethostname (__NR_Linux + 165)
+#define __NR_setdomainname (__NR_Linux + 166)
+#define __NR_create_module (__NR_Linux + 167)
+#define __NR_init_module (__NR_Linux + 168)
+#define __NR_delete_module (__NR_Linux + 169)
+#define __NR_get_kernel_syms (__NR_Linux + 170)
+#define __NR_query_module (__NR_Linux + 171)
+#define __NR_quotactl (__NR_Linux + 172)
+#define __NR_nfsservctl (__NR_Linux + 173)
+#define __NR_getpmsg (__NR_Linux + 174)
+#define __NR_putpmsg (__NR_Linux + 175)
+#define __NR_afs_syscall (__NR_Linux + 176)
+#define __NR_reserved177 (__NR_Linux + 177)
+#define __NR_gettid (__NR_Linux + 178)
+#define __NR_readahead (__NR_Linux + 179)
+#define __NR_setxattr (__NR_Linux + 180)
+#define __NR_lsetxattr (__NR_Linux + 181)
+#define __NR_fsetxattr (__NR_Linux + 182)
+#define __NR_getxattr (__NR_Linux + 183)
+#define __NR_lgetxattr (__NR_Linux + 184)
+#define __NR_fgetxattr (__NR_Linux + 185)
+#define __NR_listxattr (__NR_Linux + 186)
+#define __NR_llistxattr (__NR_Linux + 187)
+#define __NR_flistxattr (__NR_Linux + 188)
+#define __NR_removexattr (__NR_Linux + 189)
+#define __NR_lremovexattr (__NR_Linux + 190)
+#define __NR_fremovexattr (__NR_Linux + 191)
+#define __NR_tkill (__NR_Linux + 192)
+#define __NR_reserved193 (__NR_Linux + 193)
+#define __NR_futex (__NR_Linux + 194)
+#define __NR_sched_setaffinity (__NR_Linux + 195)
+#define __NR_sched_getaffinity (__NR_Linux + 196)
+#define __NR_cacheflush (__NR_Linux + 197)
+#define __NR_cachectl (__NR_Linux + 198)
+#define __NR_sysmips (__NR_Linux + 199)
+#define __NR_io_setup (__NR_Linux + 200)
+#define __NR_io_destroy (__NR_Linux + 201)
+#define __NR_io_getevents (__NR_Linux + 202)
+#define __NR_io_submit (__NR_Linux + 203)
+#define __NR_io_cancel (__NR_Linux + 204)
+#define __NR_exit_group (__NR_Linux + 205)
+#define __NR_lookup_dcookie (__NR_Linux + 206)
+#define __NR_epoll_create (__NR_Linux + 207)
+#define __NR_epoll_ctl (__NR_Linux + 208)
+#define __NR_epoll_wait (__NR_Linux + 209)
+#define __NR_remap_file_pages (__NR_Linux + 210)
+#define __NR_rt_sigreturn (__NR_Linux + 211)
+#define __NR_set_tid_address (__NR_Linux + 212)
+#define __NR_restart_syscall (__NR_Linux + 213)
+#define __NR_semtimedop (__NR_Linux + 214)
+#define __NR_fadvise64 (__NR_Linux + 215)
+#define __NR_timer_create (__NR_Linux + 216)
+#define __NR_timer_settime (__NR_Linux + 217)
+#define __NR_timer_gettime (__NR_Linux + 218)
+#define __NR_timer_getoverrun (__NR_Linux + 219)
+#define __NR_timer_delete (__NR_Linux + 220)
+#define __NR_clock_settime (__NR_Linux + 221)
+#define __NR_clock_gettime (__NR_Linux + 222)
+#define __NR_clock_getres (__NR_Linux + 223)
+#define __NR_clock_nanosleep (__NR_Linux + 224)
+#define __NR_tgkill (__NR_Linux + 225)
+#define __NR_utimes (__NR_Linux + 226)
+#define __NR_mbind (__NR_Linux + 227)
+#define __NR_get_mempolicy (__NR_Linux + 228)
+#define __NR_set_mempolicy (__NR_Linux + 229)
+#define __NR_mq_open (__NR_Linux + 230)
+#define __NR_mq_unlink (__NR_Linux + 231)
+#define __NR_mq_timedsend (__NR_Linux + 232)
+#define __NR_mq_timedreceive (__NR_Linux + 233)
+#define __NR_mq_notify (__NR_Linux + 234)
+#define __NR_mq_getsetattr (__NR_Linux + 235)
+#define __NR_vserver (__NR_Linux + 236)
+#define __NR_waitid (__NR_Linux + 237)
+/* #define __NR_sys_setaltroot (__NR_Linux + 238) */
+#define __NR_add_key (__NR_Linux + 239)
+#define __NR_request_key (__NR_Linux + 240)
+#define __NR_keyctl (__NR_Linux + 241)
+#define __NR_set_thread_area (__NR_Linux + 242)
+#define __NR_inotify_init (__NR_Linux + 243)
+#define __NR_inotify_add_watch (__NR_Linux + 244)
+#define __NR_inotify_rm_watch (__NR_Linux + 245)
+#define __NR_migrate_pages (__NR_Linux + 246)
+#define __NR_openat (__NR_Linux + 247)
+#define __NR_mkdirat (__NR_Linux + 248)
+#define __NR_mknodat (__NR_Linux + 249)
+#define __NR_fchownat (__NR_Linux + 250)
+#define __NR_futimesat (__NR_Linux + 251)
+#define __NR_newfstatat (__NR_Linux + 252)
+#define __NR_unlinkat (__NR_Linux + 253)
+#define __NR_renameat (__NR_Linux + 254)
+#define __NR_linkat (__NR_Linux + 255)
+#define __NR_symlinkat (__NR_Linux + 256)
+#define __NR_readlinkat (__NR_Linux + 257)
+#define __NR_fchmodat (__NR_Linux + 258)
+#define __NR_faccessat (__NR_Linux + 259)
+#define __NR_pselect6 (__NR_Linux + 260)
+#define __NR_ppoll (__NR_Linux + 261)
+#define __NR_unshare (__NR_Linux + 262)
+#define __NR_splice (__NR_Linux + 263)
+#define __NR_sync_file_range (__NR_Linux + 264)
+#define __NR_tee (__NR_Linux + 265)
+#define __NR_vmsplice (__NR_Linux + 266)
+#define __NR_move_pages (__NR_Linux + 267)
+#define __NR_set_robust_list (__NR_Linux + 268)
+#define __NR_get_robust_list (__NR_Linux + 269)
+#define __NR_kexec_load (__NR_Linux + 270)
+#define __NR_getcpu (__NR_Linux + 271)
+#define __NR_epoll_pwait (__NR_Linux + 272)
+#define __NR_ioprio_set (__NR_Linux + 273)
+#define __NR_ioprio_get (__NR_Linux + 274)
+#define __NR_utimensat (__NR_Linux + 275)
+#define __NR_signalfd (__NR_Linux + 276)
+#define __NR_timerfd (__NR_Linux + 277)
+#define __NR_eventfd (__NR_Linux + 278)
+#define __NR_fallocate (__NR_Linux + 279)
+#define __NR_timerfd_create (__NR_Linux + 280)
+#define __NR_timerfd_gettime (__NR_Linux + 281)
+#define __NR_timerfd_settime (__NR_Linux + 282)
+#define __NR_signalfd4 (__NR_Linux + 283)
+#define __NR_eventfd2 (__NR_Linux + 284)
+#define __NR_epoll_create1 (__NR_Linux + 285)
+#define __NR_dup3 (__NR_Linux + 286)
+#define __NR_pipe2 (__NR_Linux + 287)
+#define __NR_inotify_init1 (__NR_Linux + 288)
+#define __NR_preadv (__NR_Linux + 289)
+#define __NR_pwritev (__NR_Linux + 290)
+
+/*
+ * Offset of the last Linux 64-bit flavoured syscall
+ */
+#define __NR_Linux_syscalls 290
+
+#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
+
+#define __NR_64_Linux 5000
+#define __NR_64_Linux_syscalls 290
+
+#if _MIPS_SIM == _MIPS_SIM_NABI32
+
+/*
+ * Linux N32 syscalls are in the range from 6000 to 6999.
+ */
+#define __NR_Linux 6000
+#define __NR_read (__NR_Linux + 0)
+#define __NR_write (__NR_Linux + 1)
+#define __NR_open (__NR_Linux + 2)
+#define __NR_close (__NR_Linux + 3)
+#define __NR_stat (__NR_Linux + 4)
+#define __NR_fstat (__NR_Linux + 5)
+#define __NR_lstat (__NR_Linux + 6)
+#define __NR_poll (__NR_Linux + 7)
+#define __NR_lseek (__NR_Linux + 8)
+#define __NR_mmap (__NR_Linux + 9)
+#define __NR_mprotect (__NR_Linux + 10)
+#define __NR_munmap (__NR_Linux + 11)
+#define __NR_brk (__NR_Linux + 12)
+#define __NR_rt_sigaction (__NR_Linux + 13)
+#define __NR_rt_sigprocmask (__NR_Linux + 14)
+#define __NR_ioctl (__NR_Linux + 15)
+#define __NR_pread64 (__NR_Linux + 16)
+#define __NR_pwrite64 (__NR_Linux + 17)
+#define __NR_readv (__NR_Linux + 18)
+#define __NR_writev (__NR_Linux + 19)
+#define __NR_access (__NR_Linux + 20)
+#define __NR_pipe (__NR_Linux + 21)
+#define __NR__newselect (__NR_Linux + 22)
+#define __NR_sched_yield (__NR_Linux + 23)
+#define __NR_mremap (__NR_Linux + 24)
+#define __NR_msync (__NR_Linux + 25)
+#define __NR_mincore (__NR_Linux + 26)
+#define __NR_madvise (__NR_Linux + 27)
+#define __NR_shmget (__NR_Linux + 28)
+#define __NR_shmat (__NR_Linux + 29)
+#define __NR_shmctl (__NR_Linux + 30)
+#define __NR_dup (__NR_Linux + 31)
+#define __NR_dup2 (__NR_Linux + 32)
+#define __NR_pause (__NR_Linux + 33)
+#define __NR_nanosleep (__NR_Linux + 34)
+#define __NR_getitimer (__NR_Linux + 35)
+#define __NR_setitimer (__NR_Linux + 36)
+#define __NR_alarm (__NR_Linux + 37)
+#define __NR_getpid (__NR_Linux + 38)
+#define __NR_sendfile (__NR_Linux + 39)
+#define __NR_socket (__NR_Linux + 40)
+#define __NR_connect (__NR_Linux + 41)
+#define __NR_accept (__NR_Linux + 42)
+#define __NR_sendto (__NR_Linux + 43)
+#define __NR_recvfrom (__NR_Linux + 44)
+#define __NR_sendmsg (__NR_Linux + 45)
+#define __NR_recvmsg (__NR_Linux + 46)
+#define __NR_shutdown (__NR_Linux + 47)
+#define __NR_bind (__NR_Linux + 48)
+#define __NR_listen (__NR_Linux + 49)
+#define __NR_getsockname (__NR_Linux + 50)
+#define __NR_getpeername (__NR_Linux + 51)
+#define __NR_socketpair (__NR_Linux + 52)
+#define __NR_setsockopt (__NR_Linux + 53)
+#define __NR_getsockopt (__NR_Linux + 54)
+#define __NR_clone (__NR_Linux + 55)
+#define __NR_fork (__NR_Linux + 56)
+#define __NR_execve (__NR_Linux + 57)
+#define __NR_exit (__NR_Linux + 58)
+#define __NR_wait4 (__NR_Linux + 59)
+#define __NR_kill (__NR_Linux + 60)
+#define __NR_uname (__NR_Linux + 61)
+#define __NR_semget (__NR_Linux + 62)
+#define __NR_semop (__NR_Linux + 63)
+#define __NR_semctl (__NR_Linux + 64)
+#define __NR_shmdt (__NR_Linux + 65)
+#define __NR_msgget (__NR_Linux + 66)
+#define __NR_msgsnd (__NR_Linux + 67)
+#define __NR_msgrcv (__NR_Linux + 68)
+#define __NR_msgctl (__NR_Linux + 69)
+#define __NR_fcntl (__NR_Linux + 70)
+#define __NR_flock (__NR_Linux + 71)
+#define __NR_fsync (__NR_Linux + 72)
+#define __NR_fdatasync (__NR_Linux + 73)
+#define __NR_truncate (__NR_Linux + 74)
+#define __NR_ftruncate (__NR_Linux + 75)
+#define __NR_getdents (__NR_Linux + 76)
+#define __NR_getcwd (__NR_Linux + 77)
+#define __NR_chdir (__NR_Linux + 78)
+#define __NR_fchdir (__NR_Linux + 79)
+#define __NR_rename (__NR_Linux + 80)
+#define __NR_mkdir (__NR_Linux + 81)
+#define __NR_rmdir (__NR_Linux + 82)
+#define __NR_creat (__NR_Linux + 83)
+#define __NR_link (__NR_Linux + 84)
+#define __NR_unlink (__NR_Linux + 85)
+#define __NR_symlink (__NR_Linux + 86)
+#define __NR_readlink (__NR_Linux + 87)
+#define __NR_chmod (__NR_Linux + 88)
+#define __NR_fchmod (__NR_Linux + 89)
+#define __NR_chown (__NR_Linux + 90)
+#define __NR_fchown (__NR_Linux + 91)
+#define __NR_lchown (__NR_Linux + 92)
+#define __NR_umask (__NR_Linux + 93)
+#define __NR_gettimeofday (__NR_Linux + 94)
+#define __NR_getrlimit (__NR_Linux + 95)
+#define __NR_getrusage (__NR_Linux + 96)
+#define __NR_sysinfo (__NR_Linux + 97)
+#define __NR_times (__NR_Linux + 98)
+#define __NR_ptrace (__NR_Linux + 99)
+#define __NR_getuid (__NR_Linux + 100)
+#define __NR_syslog (__NR_Linux + 101)
+#define __NR_getgid (__NR_Linux + 102)
+#define __NR_setuid (__NR_Linux + 103)
+#define __NR_setgid (__NR_Linux + 104)
+#define __NR_geteuid (__NR_Linux + 105)
+#define __NR_getegid (__NR_Linux + 106)
+#define __NR_setpgid (__NR_Linux + 107)
+#define __NR_getppid (__NR_Linux + 108)
+#define __NR_getpgrp (__NR_Linux + 109)
+#define __NR_setsid (__NR_Linux + 110)
+#define __NR_setreuid (__NR_Linux + 111)
+#define __NR_setregid (__NR_Linux + 112)
+#define __NR_getgroups (__NR_Linux + 113)
+#define __NR_setgroups (__NR_Linux + 114)
+#define __NR_setresuid (__NR_Linux + 115)
+#define __NR_getresuid (__NR_Linux + 116)
+#define __NR_setresgid (__NR_Linux + 117)
+#define __NR_getresgid (__NR_Linux + 118)
+#define __NR_getpgid (__NR_Linux + 119)
+#define __NR_setfsuid (__NR_Linux + 120)
+#define __NR_setfsgid (__NR_Linux + 121)
+#define __NR_getsid (__NR_Linux + 122)
+#define __NR_capget (__NR_Linux + 123)
+#define __NR_capset (__NR_Linux + 124)
+#define __NR_rt_sigpending (__NR_Linux + 125)
+#define __NR_rt_sigtimedwait (__NR_Linux + 126)
+#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
+#define __NR_rt_sigsuspend (__NR_Linux + 128)
+#define __NR_sigaltstack (__NR_Linux + 129)
+#define __NR_utime (__NR_Linux + 130)
+#define __NR_mknod (__NR_Linux + 131)
+#define __NR_personality (__NR_Linux + 132)
+#define __NR_ustat (__NR_Linux + 133)
+#define __NR_statfs (__NR_Linux + 134)
+#define __NR_fstatfs (__NR_Linux + 135)
+#define __NR_sysfs (__NR_Linux + 136)
+#define __NR_getpriority (__NR_Linux + 137)
+#define __NR_setpriority (__NR_Linux + 138)
+#define __NR_sched_setparam (__NR_Linux + 139)
+#define __NR_sched_getparam (__NR_Linux + 140)
+#define __NR_sched_setscheduler (__NR_Linux + 141)
+#define __NR_sched_getscheduler (__NR_Linux + 142)
+#define __NR_sched_get_priority_max (__NR_Linux + 143)
+#define __NR_sched_get_priority_min (__NR_Linux + 144)
+#define __NR_sched_rr_get_interval (__NR_Linux + 145)
+#define __NR_mlock (__NR_Linux + 146)
+#define __NR_munlock (__NR_Linux + 147)
+#define __NR_mlockall (__NR_Linux + 148)
+#define __NR_munlockall (__NR_Linux + 149)
+#define __NR_vhangup (__NR_Linux + 150)
+#define __NR_pivot_root (__NR_Linux + 151)
+#define __NR__sysctl (__NR_Linux + 152)
+#define __NR_prctl (__NR_Linux + 153)
+#define __NR_adjtimex (__NR_Linux + 154)
+#define __NR_setrlimit (__NR_Linux + 155)
+#define __NR_chroot (__NR_Linux + 156)
+#define __NR_sync (__NR_Linux + 157)
+#define __NR_acct (__NR_Linux + 158)
+#define __NR_settimeofday (__NR_Linux + 159)
+#define __NR_mount (__NR_Linux + 160)
+#define __NR_umount2 (__NR_Linux + 161)
+#define __NR_swapon (__NR_Linux + 162)
+#define __NR_swapoff (__NR_Linux + 163)
+#define __NR_reboot (__NR_Linux + 164)
+#define __NR_sethostname (__NR_Linux + 165)
+#define __NR_setdomainname (__NR_Linux + 166)
+#define __NR_create_module (__NR_Linux + 167)
+#define __NR_init_module (__NR_Linux + 168)
+#define __NR_delete_module (__NR_Linux + 169)
+#define __NR_get_kernel_syms (__NR_Linux + 170)
+#define __NR_query_module (__NR_Linux + 171)
+#define __NR_quotactl (__NR_Linux + 172)
+#define __NR_nfsservctl (__NR_Linux + 173)
+#define __NR_getpmsg (__NR_Linux + 174)
+#define __NR_putpmsg (__NR_Linux + 175)
+#define __NR_afs_syscall (__NR_Linux + 176)
+#define __NR_reserved177 (__NR_Linux + 177)
+#define __NR_gettid (__NR_Linux + 178)
+#define __NR_readahead (__NR_Linux + 179)
+#define __NR_setxattr (__NR_Linux + 180)
+#define __NR_lsetxattr (__NR_Linux + 181)
+#define __NR_fsetxattr (__NR_Linux + 182)
+#define __NR_getxattr (__NR_Linux + 183)
+#define __NR_lgetxattr (__NR_Linux + 184)
+#define __NR_fgetxattr (__NR_Linux + 185)
+#define __NR_listxattr (__NR_Linux + 186)
+#define __NR_llistxattr (__NR_Linux + 187)
+#define __NR_flistxattr (__NR_Linux + 188)
+#define __NR_removexattr (__NR_Linux + 189)
+#define __NR_lremovexattr (__NR_Linux + 190)
+#define __NR_fremovexattr (__NR_Linux + 191)
+#define __NR_tkill (__NR_Linux + 192)
+#define __NR_reserved193 (__NR_Linux + 193)
+#define __NR_futex (__NR_Linux + 194)
+#define __NR_sched_setaffinity (__NR_Linux + 195)
+#define __NR_sched_getaffinity (__NR_Linux + 196)
+#define __NR_cacheflush (__NR_Linux + 197)
+#define __NR_cachectl (__NR_Linux + 198)
+#define __NR_sysmips (__NR_Linux + 199)
+#define __NR_io_setup (__NR_Linux + 200)
+#define __NR_io_destroy (__NR_Linux + 201)
+#define __NR_io_getevents (__NR_Linux + 202)
+#define __NR_io_submit (__NR_Linux + 203)
+#define __NR_io_cancel (__NR_Linux + 204)
+#define __NR_exit_group (__NR_Linux + 205)
+#define __NR_lookup_dcookie (__NR_Linux + 206)
+#define __NR_epoll_create (__NR_Linux + 207)
+#define __NR_epoll_ctl (__NR_Linux + 208)
+#define __NR_epoll_wait (__NR_Linux + 209)
+#define __NR_remap_file_pages (__NR_Linux + 210)
+#define __NR_rt_sigreturn (__NR_Linux + 211)
+#define __NR_fcntl64 (__NR_Linux + 212)
+#define __NR_set_tid_address (__NR_Linux + 213)
+#define __NR_restart_syscall (__NR_Linux + 214)
+#define __NR_semtimedop (__NR_Linux + 215)
+#define __NR_fadvise64 (__NR_Linux + 216)
+#define __NR_statfs64 (__NR_Linux + 217)
+#define __NR_fstatfs64 (__NR_Linux + 218)
+#define __NR_sendfile64 (__NR_Linux + 219)
+#define __NR_timer_create (__NR_Linux + 220)
+#define __NR_timer_settime (__NR_Linux + 221)
+#define __NR_timer_gettime (__NR_Linux + 222)
+#define __NR_timer_getoverrun (__NR_Linux + 223)
+#define __NR_timer_delete (__NR_Linux + 224)
+#define __NR_clock_settime (__NR_Linux + 225)
+#define __NR_clock_gettime (__NR_Linux + 226)
+#define __NR_clock_getres (__NR_Linux + 227)
+#define __NR_clock_nanosleep (__NR_Linux + 228)
+#define __NR_tgkill (__NR_Linux + 229)
+#define __NR_utimes (__NR_Linux + 230)
+#define __NR_mbind (__NR_Linux + 231)
+#define __NR_get_mempolicy (__NR_Linux + 232)
+#define __NR_set_mempolicy (__NR_Linux + 233)
+#define __NR_mq_open (__NR_Linux + 234)
+#define __NR_mq_unlink (__NR_Linux + 235)
+#define __NR_mq_timedsend (__NR_Linux + 236)
+#define __NR_mq_timedreceive (__NR_Linux + 237)
+#define __NR_mq_notify (__NR_Linux + 238)
+#define __NR_mq_getsetattr (__NR_Linux + 239)
+#define __NR_vserver (__NR_Linux + 240)
+#define __NR_waitid (__NR_Linux + 241)
+/* #define __NR_sys_setaltroot (__NR_Linux + 242) */
+#define __NR_add_key (__NR_Linux + 243)
+#define __NR_request_key (__NR_Linux + 244)
+#define __NR_keyctl (__NR_Linux + 245)
+#define __NR_set_thread_area (__NR_Linux + 246)
+#define __NR_inotify_init (__NR_Linux + 247)
+#define __NR_inotify_add_watch (__NR_Linux + 248)
+#define __NR_inotify_rm_watch (__NR_Linux + 249)
+#define __NR_migrate_pages (__NR_Linux + 250)
+#define __NR_openat (__NR_Linux + 251)
+#define __NR_mkdirat (__NR_Linux + 252)
+#define __NR_mknodat (__NR_Linux + 253)
+#define __NR_fchownat (__NR_Linux + 254)
+#define __NR_futimesat (__NR_Linux + 255)
+#define __NR_newfstatat (__NR_Linux + 256)
+#define __NR_unlinkat (__NR_Linux + 257)
+#define __NR_renameat (__NR_Linux + 258)
+#define __NR_linkat (__NR_Linux + 259)
+#define __NR_symlinkat (__NR_Linux + 260)
+#define __NR_readlinkat (__NR_Linux + 261)
+#define __NR_fchmodat (__NR_Linux + 262)
+#define __NR_faccessat (__NR_Linux + 263)
+#define __NR_pselect6 (__NR_Linux + 264)
+#define __NR_ppoll (__NR_Linux + 265)
+#define __NR_unshare (__NR_Linux + 266)
+#define __NR_splice (__NR_Linux + 267)
+#define __NR_sync_file_range (__NR_Linux + 268)
+#define __NR_tee (__NR_Linux + 269)
+#define __NR_vmsplice (__NR_Linux + 270)
+#define __NR_move_pages (__NR_Linux + 271)
+#define __NR_set_robust_list (__NR_Linux + 272)
+#define __NR_get_robust_list (__NR_Linux + 273)
+#define __NR_kexec_load (__NR_Linux + 274)
+#define __NR_getcpu (__NR_Linux + 275)
+#define __NR_epoll_pwait (__NR_Linux + 276)
+#define __NR_ioprio_set (__NR_Linux + 277)
+#define __NR_ioprio_get (__NR_Linux + 278)
+#define __NR_utimensat (__NR_Linux + 279)
+#define __NR_signalfd (__NR_Linux + 280)
+#define __NR_timerfd (__NR_Linux + 281)
+#define __NR_eventfd (__NR_Linux + 282)
+#define __NR_fallocate (__NR_Linux + 283)
+#define __NR_timerfd_create (__NR_Linux + 284)
+#define __NR_timerfd_gettime (__NR_Linux + 285)
+#define __NR_timerfd_settime (__NR_Linux + 286)
+#define __NR_signalfd4 (__NR_Linux + 287)
+#define __NR_eventfd2 (__NR_Linux + 288)
+#define __NR_epoll_create1 (__NR_Linux + 289)
+#define __NR_dup3 (__NR_Linux + 290)
+#define __NR_pipe2 (__NR_Linux + 291)
+#define __NR_inotify_init1 (__NR_Linux + 292)
+#define __NR_preadv (__NR_Linux + 293)
+#define __NR_pwritev (__NR_Linux + 294)
+
+/*
+ * Offset of the last N32 flavoured syscall
+ */
+#define __NR_Linux_syscalls 294
+
+#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
+
+#define __NR_N32_Linux 6000
+#define __NR_N32_Linux_syscalls 294
+
+#endif /* _ASM_UNISTD_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/assert.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/assert.h
new file mode 100644
index 0000000..a67dd43
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/assert.h
@@ -0,0 +1,82 @@
+/* Copyright (C) 1991,1992,1994-2001,2003,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.2 Diagnostics <assert.h>
+ */
+
+#ifdef _ASSERT_H
+
+# undef _ASSERT_H
+# undef assert
+# undef __ASSERT_VOID_CAST
+
+#endif /* assert.h */
+
+#define _ASSERT_H 1
+#include <features.h>
+
+#if defined __cplusplus && __GNUC_PREREQ(2,95)
+# define __ASSERT_VOID_CAST static_cast<void>
+#else
+# define __ASSERT_VOID_CAST (void)
+#endif
+
+/* void assert (int expression);
+
+ If NDEBUG is defined, do nothing.
+ If not, and EXPRESSION is zero, print an error message and abort. */
+
+#ifdef NDEBUG
+
+# define assert(expr) (__ASSERT_VOID_CAST (0))
+
+#else /* Not NDEBUG. */
+
+__BEGIN_DECLS
+
+/* This prints an "Assertion failed" message and aborts. */
+extern void __assert __P((const char *, const char *, int, const char *));
+
+__END_DECLS
+
+# define assert(expr) \
+ (__ASSERT_VOID_CAST ((expr) ? 0 : \
+ (__assert (__STRING(expr), __FILE__, __LINE__, \
+ __ASSERT_FUNCTION), 0)))
+
+/* Define some temporaries to workaround tinyx makedepend bug */
+#define __GNUC_PREREQ_2_6 __GNUC_PREREQ(2, 6)
+#define __GNUC_PREREQ_2_4 __GNUC_PREREQ(2, 4)
+/* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
+ which contains the name of the function currently being defined.
+ This is broken in G++ before version 2.6.
+ C9x has a similar variable called __func__, but prefer the GCC one since
+ it demangles C++ function names. */
+
+# if defined __cplusplus ? __GNUC_PREREQ_2_6 : __GNUC_PREREQ_2_4
+# define __ASSERT_FUNCTION __PRETTY_FUNCTION__
+# else
+# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+# define __ASSERT_FUNCTION __func__
+# else
+# define __ASSERT_FUNCTION ((__const char *) 0)
+# endif
+# endif
+
+#endif /* NDEBUG. */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/atomic.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/atomic.h
new file mode 100644
index 0000000..8a23f6e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/atomic.h
@@ -0,0 +1,261 @@
+/* Internal macros for atomic operations for GNU C Library.
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ATOMIC_H
+#define _ATOMIC_H 1
+
+#include <stdlib.h>
+
+#include <bits/atomic.h>
+
+/* Wrapper macros to call pre_NN_post (mem, ...) where NN is the
+ bit width of *MEM. The calling macro puts parens around MEM
+ and following args. */
+#define __atomic_val_bysize(pre, post, mem, ...) \
+ ({ \
+ __typeof (*mem) __result; \
+ if (sizeof (*mem) == 1) \
+ __result = pre##_8_##post (mem, __VA_ARGS__); \
+ else if (sizeof (*mem) == 2) \
+ __result = pre##_16_##post (mem, __VA_ARGS__); \
+ else if (sizeof (*mem) == 4) \
+ __result = pre##_32_##post (mem, __VA_ARGS__); \
+ else if (sizeof (*mem) == 8) \
+ __result = pre##_64_##post (mem, __VA_ARGS__); \
+ else \
+ abort (); \
+ __result; \
+ })
+#define __atomic_bool_bysize(pre, post, mem, ...) \
+ ({ \
+ int __result; \
+ if (sizeof (*mem) == 1) \
+ __result = pre##_8_##post (mem, __VA_ARGS__); \
+ else if (sizeof (*mem) == 2) \
+ __result = pre##_16_##post (mem, __VA_ARGS__); \
+ else if (sizeof (*mem) == 4) \
+ __result = pre##_32_##post (mem, __VA_ARGS__); \
+ else if (sizeof (*mem) == 8) \
+ __result = pre##_64_##post (mem, __VA_ARGS__); \
+ else \
+ abort (); \
+ __result; \
+ })
+
+
+/* Atomically store NEWVAL in *MEM if *MEM is equal to OLDVAL.
+ Return the old *MEM value. */
+#if !defined atomic_compare_and_exchange_val_acq \
+ && defined __arch_compare_and_exchange_val_32_acq
+# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
+ __atomic_val_bysize (__arch_compare_and_exchange_val,acq, \
+ mem, newval, oldval)
+#endif
+
+
+#ifndef atomic_compare_and_exchange_val_rel
+# define atomic_compare_and_exchange_val_rel(mem, newval, oldval) \
+ atomic_compare_and_exchange_val_acq (mem, newval, oldval)
+#endif
+
+
+/* Atomically store NEWVAL in *MEM if *MEM is equal to OLDVAL.
+ Return zero if *MEM was changed or non-zero if no exchange happened. */
+#ifndef atomic_compare_and_exchange_bool_acq
+# ifdef __arch_compare_and_exchange_bool_32_acq
+# define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
+ __atomic_bool_bysize (__arch_compare_and_exchange_bool,acq, \
+ mem, newval, oldval)
+# else
+# define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
+ ({ /* Cannot use __oldval here, because macros later in this file might \
+ call this macro with __oldval argument. */ \
+ __typeof (oldval) __old = (oldval); \
+ atomic_compare_and_exchange_val_acq (mem, newval, __old) != __old; \
+ })
+# endif
+#endif
+
+
+#ifndef atomic_compare_and_exchange_bool_rel
+# define atomic_compare_and_exchange_bool_rel(mem, newval, oldval) \
+ atomic_compare_and_exchange_bool_acq (mem, newval, oldval)
+#endif
+
+
+/* Store NEWVALUE in *MEM and return the old value. */
+#ifndef atomic_exchange_acq
+# define atomic_exchange_acq(mem, newvalue) \
+ ({ __typeof (*(mem)) __oldval; \
+ __typeof (mem) __memp = (mem); \
+ __typeof (*(mem)) __value = (newvalue); \
+ \
+ do \
+ __oldval = (*__memp); \
+ while (__builtin_expect (atomic_compare_and_exchange_bool_acq (__memp, \
+ __value, \
+ __oldval),\
+ 0)); \
+ \
+ __oldval; })
+#endif
+
+#ifndef atomic_exchange_rel
+# define atomic_exchange_rel(mem, newvalue) atomic_exchange_acq (mem, newvalue)
+#endif
+
+
+/* Add VALUE to *MEM and return the old value of *MEM. */
+#ifndef atomic_exchange_and_add
+# define atomic_exchange_and_add(mem, value) \
+ ({ __typeof (*(mem)) __oldval; \
+ __typeof (mem) __memp = (mem); \
+ __typeof (*(mem)) __value = (value); \
+ \
+ do \
+ __oldval = (*__memp); \
+ while (__builtin_expect (atomic_compare_and_exchange_bool_acq (__memp, \
+ __oldval \
+ + __value,\
+ __oldval),\
+ 0)); \
+ \
+ __oldval; })
+#endif
+
+
+#ifndef atomic_add
+# define atomic_add(mem, value) (void) atomic_exchange_and_add ((mem), (value))
+#endif
+
+
+#ifndef atomic_increment
+# define atomic_increment(mem) atomic_add ((mem), 1)
+#endif
+
+
+#ifndef atomic_increment_val
+# define atomic_increment_val(mem) (atomic_exchange_and_add ((mem), 1) + 1)
+#endif
+
+
+/* Add one to *MEM and return true iff it's now zero. */
+#ifndef atomic_increment_and_test
+# define atomic_increment_and_test(mem) \
+ (atomic_exchange_and_add ((mem), 1) + 1 == 0)
+#endif
+
+
+#ifndef atomic_decrement
+# define atomic_decrement(mem) atomic_add ((mem), -1)
+#endif
+
+
+#ifndef atomic_decrement_val
+# define atomic_decrement_val(mem) (atomic_exchange_and_add ((mem), -1) - 1)
+#endif
+
+
+/* Subtract 1 from *MEM and return true iff it's now zero. */
+#ifndef atomic_decrement_and_test
+# define atomic_decrement_and_test(mem) \
+ (atomic_exchange_and_add ((mem), -1) == 1)
+#endif
+
+
+/* Decrement *MEM if it is > 0, and return the old value. */
+#ifndef atomic_decrement_if_positive
+# define atomic_decrement_if_positive(mem) \
+ ({ __typeof (*(mem)) __oldval; \
+ __typeof (mem) __memp = (mem); \
+ \
+ do \
+ { \
+ __oldval = *__memp; \
+ if (__builtin_expect (__oldval <= 0, 0)) \
+ break; \
+ } \
+ while (__builtin_expect (atomic_compare_and_exchange_bool_acq (__memp, \
+ __oldval \
+ - 1, \
+ __oldval),\
+ 0));\
+ __oldval; })
+#endif
+
+
+#ifndef atomic_add_negative
+# define atomic_add_negative(mem, value) \
+ ({ __typeof (value) __aan_value = (value); \
+ atomic_exchange_and_add (mem, __aan_value) < -__aan_value; })
+#endif
+
+
+#ifndef atomic_add_zero
+# define atomic_add_zero(mem, value) \
+ ({ __typeof (value) __aaz_value = (value); \
+ atomic_exchange_and_add (mem, __aaz_value) == -__aaz_value; })
+#endif
+
+
+#ifndef atomic_bit_set
+# define atomic_bit_set(mem, bit) \
+ (void) atomic_bit_test_set(mem, bit)
+#endif
+
+
+#ifndef atomic_bit_test_set
+# define atomic_bit_test_set(mem, bit) \
+ ({ __typeof (*(mem)) __oldval; \
+ __typeof (mem) __memp = (mem); \
+ __typeof (*(mem)) __mask = ((__typeof (*(mem))) 1 << (bit)); \
+ \
+ do \
+ __oldval = (*__memp); \
+ while (__builtin_expect (atomic_compare_and_exchange_bool_acq (__memp, \
+ __oldval \
+ | __mask, \
+ __oldval),\
+ 0)); \
+ \
+ __oldval & __mask; })
+#endif
+
+
+#ifndef atomic_full_barrier
+# define atomic_full_barrier() __asm ("" ::: "memory")
+#endif
+
+
+#ifndef atomic_read_barrier
+# define atomic_read_barrier() atomic_full_barrier ()
+#endif
+
+
+#ifndef atomic_write_barrier
+# define atomic_write_barrier() atomic_full_barrier ()
+#endif
+
+
+#ifndef atomic_delay
+# define atomic_delay() do { /* nothing */ } while (0)
+#endif
+
+#endif /* atomic.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/atomic.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/atomic.h
new file mode 100644
index 0000000..167d9a5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/atomic.h
@@ -0,0 +1,303 @@
+/* Low-level functions for atomic operations. Mips version.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MIPS_BITS_ATOMIC_H
+#define _MIPS_BITS_ATOMIC_H 1
+
+#include <inttypes.h>
+#include <sgidefs.h>
+
+typedef int32_t atomic32_t;
+typedef uint32_t uatomic32_t;
+typedef int_fast32_t atomic_fast32_t;
+typedef uint_fast32_t uatomic_fast32_t;
+
+typedef int64_t atomic64_t;
+typedef uint64_t uatomic64_t;
+typedef int_fast64_t atomic_fast64_t;
+typedef uint_fast64_t uatomic_fast64_t;
+
+typedef intptr_t atomicptr_t;
+typedef uintptr_t uatomicptr_t;
+typedef intmax_t atomic_max_t;
+typedef uintmax_t uatomic_max_t;
+
+#if _MIPS_SIM == _ABIO32
+#define MIPS_PUSH_MIPS2 ".set mips2\n\t"
+#else
+#define MIPS_PUSH_MIPS2
+#endif
+
+/* See the comments in <sys/asm.h> about the use of the sync instruction. */
+#ifndef MIPS_SYNC
+# define MIPS_SYNC sync
+#endif
+
+#define MIPS_SYNC_STR_2(X) #X
+#define MIPS_SYNC_STR_1(X) MIPS_SYNC_STR_2(X)
+#define MIPS_SYNC_STR MIPS_SYNC_STR_1(MIPS_SYNC)
+
+/* Compare and exchange. For all of the "xxx" routines, we expect a
+ "__prev" and a "__cmp" variable to be provided by the enclosing scope,
+ in which values are returned. */
+
+#define __arch_compare_and_exchange_xxx_8_int(mem, newval, oldval, rel, acq) \
+ (abort (), __prev = __cmp = 0)
+
+#define __arch_compare_and_exchange_xxx_16_int(mem, newval, oldval, rel, acq) \
+ (abort (), __prev = __cmp = 0)
+
+#define __arch_compare_and_exchange_xxx_32_int(mem, newval, oldval, rel, acq) \
+ __asm__ __volatile__ ( \
+ ".set push\n\t" \
+ MIPS_PUSH_MIPS2 \
+ rel "\n" \
+ "1:\t" \
+ "ll %0,%4\n\t" \
+ "move %1,$0\n\t" \
+ "bne %0,%2,2f\n\t" \
+ "move %1,%3\n\t" \
+ "sc %1,%4\n\t" \
+ "beqz %1,1b\n" \
+ acq "\n\t" \
+ ".set pop\n" \
+ "2:\n\t" \
+ : "=&r" (__prev), "=&r" (__cmp) \
+ : "r" (oldval), "r" (newval), "m" (*mem) \
+ : "memory")
+
+#if _MIPS_SIM == _ABIO32
+/* We can't do an atomic 64-bit operation in O32. */
+#define __arch_compare_and_exchange_xxx_64_int(mem, newval, oldval, rel, acq) \
+ (abort (), __prev = __cmp = 0)
+#else
+#define __arch_compare_and_exchange_xxx_64_int(mem, newval, oldval, rel, acq) \
+ __asm__ __volatile__ ("\n" \
+ ".set push\n\t" \
+ MIPS_PUSH_MIPS2 \
+ rel "\n" \
+ "1:\t" \
+ "lld %0,%4\n\t" \
+ "move %1,$0\n\t" \
+ "bne %0,%2,2f\n\t" \
+ "move %1,%3\n\t" \
+ "scd %1,%4\n\t" \
+ "beqz %1,1b\n" \
+ acq "\n\t" \
+ ".set pop\n" \
+ "2:\n\t" \
+ : "=&r" (__prev), "=&r" (__cmp) \
+ : "r" (oldval), "r" (newval), "m" (*mem) \
+ : "memory")
+#endif
+
+/* For all "bool" routines, we return FALSE if exchange succesful. */
+
+#define __arch_compare_and_exchange_bool_8_int(mem, new, old, rel, acq) \
+({ typeof (*mem) __prev; int __cmp; \
+ __arch_compare_and_exchange_xxx_8_int(mem, new, old, rel, acq); \
+ !__cmp; })
+
+#define __arch_compare_and_exchange_bool_16_int(mem, new, old, rel, acq) \
+({ typeof (*mem) __prev; int __cmp; \
+ __arch_compare_and_exchange_xxx_16_int(mem, new, old, rel, acq); \
+ !__cmp; })
+
+#define __arch_compare_and_exchange_bool_32_int(mem, new, old, rel, acq) \
+({ typeof (*mem) __prev; int __cmp; \
+ __arch_compare_and_exchange_xxx_32_int(mem, new, old, rel, acq); \
+ !__cmp; })
+
+#define __arch_compare_and_exchange_bool_64_int(mem, new, old, rel, acq) \
+({ typeof (*mem) __prev; int __cmp; \
+ __arch_compare_and_exchange_xxx_64_int(mem, new, old, rel, acq); \
+ !__cmp; })
+
+/* For all "val" routines, return the old value whether exchange
+ successful or not. */
+
+#define __arch_compare_and_exchange_val_8_int(mem, new, old, rel, acq) \
+({ typeof (*mem) __prev; int __cmp; \
+ __arch_compare_and_exchange_xxx_8_int(mem, new, old, rel, acq); \
+ (typeof (*mem))__prev; })
+
+#define __arch_compare_and_exchange_val_16_int(mem, new, old, rel, acq) \
+({ typeof (*mem) __prev; int __cmp; \
+ __arch_compare_and_exchange_xxx_16_int(mem, new, old, rel, acq); \
+ (typeof (*mem))__prev; })
+
+#define __arch_compare_and_exchange_val_32_int(mem, new, old, rel, acq) \
+({ typeof (*mem) __prev; int __cmp; \
+ __arch_compare_and_exchange_xxx_32_int(mem, new, old, rel, acq); \
+ (typeof (*mem))__prev; })
+
+#define __arch_compare_and_exchange_val_64_int(mem, new, old, rel, acq) \
+({ typeof (*mem) __prev; int __cmp; \
+ __arch_compare_and_exchange_xxx_64_int(mem, new, old, rel, acq); \
+ (typeof (*mem))__prev; })
+
+/* Compare and exchange with "acquire" semantics, ie barrier after. */
+
+#define atomic_compare_and_exchange_bool_acq(mem, new, old) \
+ __atomic_bool_bysize (__arch_compare_and_exchange_bool, int, \
+ mem, new, old, "", MIPS_SYNC_STR)
+
+#define atomic_compare_and_exchange_val_acq(mem, new, old) \
+ __atomic_val_bysize (__arch_compare_and_exchange_val, int, \
+ mem, new, old, "", MIPS_SYNC_STR)
+
+/* Compare and exchange with "release" semantics, ie barrier before. */
+
+#define atomic_compare_and_exchange_bool_rel(mem, new, old) \
+ __atomic_bool_bysize (__arch_compare_and_exchange_bool, int, \
+ mem, new, old, MIPS_SYNC_STR, "")
+
+#define atomic_compare_and_exchange_val_rel(mem, new, old) \
+ __atomic_val_bysize (__arch_compare_and_exchange_val, int, \
+ mem, new, old, MIPS_SYNC_STR, "")
+
+
+
+/* Atomic exchange (without compare). */
+
+#define __arch_exchange_xxx_8_int(mem, newval, rel, acq) \
+ (abort (), 0)
+
+#define __arch_exchange_xxx_16_int(mem, newval, rel, acq) \
+ (abort (), 0)
+
+#define __arch_exchange_xxx_32_int(mem, newval, rel, acq) \
+({ typeof (*mem) __prev; int __cmp; \
+ __asm__ __volatile__ ("\n" \
+ ".set push\n\t" \
+ MIPS_PUSH_MIPS2 \
+ rel "\n" \
+ "1:\t" \
+ "ll %0,%3\n\t" \
+ "move %1,%2\n\t" \
+ "sc %1,%3\n\t" \
+ "beqz %1,1b\n" \
+ acq "\n\t" \
+ ".set pop\n" \
+ "2:\n\t" \
+ : "=&r" (__prev), "=&r" (__cmp) \
+ : "r" (newval), "m" (*mem) \
+ : "memory"); \
+ __prev; })
+
+#if _MIPS_SIM == _ABIO32
+/* We can't do an atomic 64-bit operation in O32. */
+#define __arch_exchange_xxx_64_int(mem, newval, rel, acq) \
+ (abort (), 0)
+#else
+#define __arch_exchange_xxx_64_int(mem, newval, rel, acq) \
+({ typeof (*mem) __prev; int __cmp; \
+ __asm__ __volatile__ ("\n" \
+ ".set push\n\t" \
+ MIPS_PUSH_MIPS2 \
+ rel "\n" \
+ "1:\n" \
+ "lld %0,%3\n\t" \
+ "move %1,%2\n\t" \
+ "scd %1,%3\n\t" \
+ "beqz %1,1b\n" \
+ acq "\n\t" \
+ ".set pop\n" \
+ "2:\n\t" \
+ : "=&r" (__prev), "=&r" (__cmp) \
+ : "r" (newval), "m" (*mem) \
+ : "memory"); \
+ __prev; })
+#endif
+
+#define atomic_exchange_acq(mem, value) \
+ __atomic_val_bysize (__arch_exchange_xxx, int, mem, value, "", MIPS_SYNC_STR)
+
+#define atomic_exchange_rel(mem, value) \
+ __atomic_val_bysize (__arch_exchange_xxx, int, mem, value, MIPS_SYNC_STR, "")
+
+
+/* Atomically add value and return the previous (unincremented) value. */
+
+#define __arch_exchange_and_add_8_int(mem, newval, rel, acq) \
+ (abort (), (typeof(*mem)) 0)
+
+#define __arch_exchange_and_add_16_int(mem, newval, rel, acq) \
+ (abort (), (typeof(*mem)) 0)
+
+#define __arch_exchange_and_add_32_int(mem, value, rel, acq) \
+({ typeof (*mem) __prev; int __cmp; \
+ __asm__ __volatile__ ("\n" \
+ ".set push\n\t" \
+ MIPS_PUSH_MIPS2 \
+ rel "\n" \
+ "1:\t" \
+ "ll %0,%3\n\t" \
+ "addu %1,%0,%2\n\t" \
+ "sc %1,%3\n\t" \
+ "beqz %1,1b\n" \
+ acq "\n\t" \
+ ".set pop\n" \
+ "2:\n\t" \
+ : "=&r" (__prev), "=&r" (__cmp) \
+ : "r" (value), "m" (*mem) \
+ : "memory"); \
+ __prev; })
+
+#if _MIPS_SIM == _ABIO32
+/* We can't do an atomic 64-bit operation in O32. */
+#define __arch_exchange_and_add_64_int(mem, value, rel, acq) \
+ (abort (), (typeof(*mem)) 0)
+#else
+#define __arch_exchange_and_add_64_int(mem, value, rel, acq) \
+({ typeof (*mem) __prev; int __cmp; \
+ __asm__ __volatile__ ( \
+ ".set push\n\t" \
+ MIPS_PUSH_MIPS2 \
+ rel "\n" \
+ "1:\t" \
+ "lld %0,%3\n\t" \
+ "daddu %1,%0,%2\n\t" \
+ "scd %1,%3\n\t" \
+ "beqz %1,1b\n" \
+ acq "\n\t" \
+ ".set pop\n" \
+ "2:\n\t" \
+ : "=&r" (__prev), "=&r" (__cmp) \
+ : "r" (value), "m" (*mem) \
+ : "memory"); \
+ __prev; })
+#endif
+
+/* ??? Barrier semantics for atomic_exchange_and_add appear to be
+ undefined. Use full barrier for now, as that's safe. */
+#define atomic_exchange_and_add(mem, value) \
+ __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \
+ MIPS_SYNC_STR, MIPS_SYNC_STR)
+
+/* TODO: More atomic operations could be implemented efficiently; only the
+ basic requirements are done. */
+
+#define atomic_full_barrier() \
+ __asm__ __volatile__ (".set push\n\t" \
+ MIPS_PUSH_MIPS2 \
+ MIPS_SYNC_STR "\n\t" \
+ ".set pop" : : : "memory")
+
+#endif /* bits/atomic.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/byteswap.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/byteswap.h
new file mode 100644
index 0000000..949ed0b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/byteswap.h
@@ -0,0 +1,87 @@
+/* Macros to swap the order of bytes in integer values.
+ Copyright (C) 1997,1998,2000,2001,2002,2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if !defined _BYTESWAP_H && !defined _NETINET_IN_H
+# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
+#endif
+
+#ifndef _BITS_BYTESWAP_H
+#define _BITS_BYTESWAP_H 1
+
+/* Swap bytes in 16 bit value. */
+#define __bswap_constant_16(x) \
+ ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))
+
+#ifdef __GNUC__
+# define __bswap_16(x) \
+ (__extension__ \
+ ({ unsigned short int __bsx = (x); __bswap_constant_16 (__bsx); }))
+#else
+static __inline unsigned short int
+__bswap_16 (unsigned short int __bsx)
+{
+ return __bswap_constant_16 (__bsx);
+}
+#endif
+
+/* Swap bytes in 32 bit value. */
+#define __bswap_constant_32(x) \
+ ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) | \
+ (((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24))
+
+#ifdef __GNUC__
+# define __bswap_32(x) \
+ (__extension__ \
+ ({ register unsigned int __bsx = (x); __bswap_constant_32 (__bsx); }))
+#else
+static __inline unsigned int
+__bswap_32 (unsigned int __bsx)
+{
+ return __bswap_constant_32 (__bsx);
+}
+#endif
+
+#if defined __GNUC__ && __GNUC__ >= 2
+/* Swap bytes in 64 bit value. */
+# define __bswap_constant_64(x) \
+ ((((x) & 0xff00000000000000ull) >> 56) \
+ | (((x) & 0x00ff000000000000ull) >> 40) \
+ | (((x) & 0x0000ff0000000000ull) >> 24) \
+ | (((x) & 0x000000ff00000000ull) >> 8) \
+ | (((x) & 0x00000000ff000000ull) << 8) \
+ | (((x) & 0x0000000000ff0000ull) << 24) \
+ | (((x) & 0x000000000000ff00ull) << 40) \
+ | (((x) & 0x00000000000000ffull) << 56))
+
+# define __bswap_64(x) \
+ (__extension__ \
+ ({ union { __extension__ unsigned long long int __ll; \
+ unsigned int __l[2]; } __w, __r; \
+ if (__builtin_constant_p (x)) \
+ __r.__ll = __bswap_constant_64 (x); \
+ else \
+ { \
+ __w.__ll = (x); \
+ __r.__l[0] = __bswap_32 (__w.__l[1]); \
+ __r.__l[1] = __bswap_32 (__w.__l[0]); \
+ } \
+ __r.__ll; }))
+#endif
+
+#endif /* _BITS_BYTESWAP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/cmathcalls.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/cmathcalls.h
new file mode 100644
index 0000000..c680c6d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/cmathcalls.h
@@ -0,0 +1,158 @@
+/* Prototype declarations for complex math functions;
+ helper file for <complex.h>.
+ Copyright (C) 1997, 1998, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* NOTE: Because of the special way this file is used by <complex.h>, this
+ file must NOT be protected from multiple inclusion as header files
+ usually are.
+
+ This file provides prototype declarations for the math functions.
+ Most functions are declared using the macro:
+
+ __MATHCALL (NAME, (ARGS...));
+
+ This means there is a function `NAME' returning `double' and a function
+ `NAMEf' returning `float'. Each place `_Mdouble_' appears in the
+ prototype, that is actually `double' in the prototype for `NAME' and
+ `float' in the prototype for `NAMEf'. Reentrant variant functions are
+ called `NAME_r' and `NAMEf_r'.
+
+ Functions returning other types like `int' are declared using the macro:
+
+ __MATHDECL (TYPE, NAME, (ARGS...));
+
+ This is just like __MATHCALL but for a function returning `TYPE'
+ instead of `_Mdouble_'. In all of these cases, there is still
+ both a `NAME' and a `NAMEf' that takes `float' arguments. */
+
+#ifndef _COMPLEX_H
+#error "Never use <bits/cmathcalls.h> directly; include <complex.h> instead."
+#endif
+
+#define _Mdouble_complex_ _Mdouble_ _Complex
+
+
+/* Trigonometric functions. */
+
+/* Arc cosine of Z. */
+__MATHCALL (cacos, (_Mdouble_complex_ __z));
+/* Arc sine of Z. */
+__MATHCALL (casin, (_Mdouble_complex_ __z));
+/* Arc tangent of Z. */
+__MATHCALL (catan, (_Mdouble_complex_ __z));
+
+/* Cosine of Z. */
+__MATHCALL (ccos, (_Mdouble_complex_ __z));
+/* Sine of Z. */
+__MATHCALL (csin, (_Mdouble_complex_ __z));
+/* Tangent of Z. */
+__MATHCALL (ctan, (_Mdouble_complex_ __z));
+
+
+/* Hyperbolic functions. */
+
+/* Hyperbolic arc cosine of Z. */
+__MATHCALL (cacosh, (_Mdouble_complex_ __z));
+/* Hyperbolic arc sine of Z. */
+__MATHCALL (casinh, (_Mdouble_complex_ __z));
+/* Hyperbolic arc tangent of Z. */
+__MATHCALL (catanh, (_Mdouble_complex_ __z));
+
+/* Hyperbolic cosine of Z. */
+__MATHCALL (ccosh, (_Mdouble_complex_ __z));
+/* Hyperbolic sine of Z. */
+__MATHCALL (csinh, (_Mdouble_complex_ __z));
+/* Hyperbolic tangent of Z. */
+__MATHCALL (ctanh, (_Mdouble_complex_ __z));
+
+
+/* Exponential and logarithmic functions. */
+
+/* Exponential function of Z. */
+__MATHCALL (cexp, (_Mdouble_complex_ __z));
+
+/* Natural logarithm of Z. */
+__MATHCALL (clog, (_Mdouble_complex_ __z));
+
+#ifdef __USE_GNU
+/* The base 10 logarithm is not defined by the standard but to implement
+ the standard C++ library it is handy. */
+__MATHCALL (clog10, (_Mdouble_complex_ __z));
+#endif
+
+/* Power functions. */
+
+/* Return X to the Y power. */
+__MATHCALL (cpow, (_Mdouble_complex_ __x, _Mdouble_complex_ __y));
+
+/* Return the square root of Z. */
+__MATHCALL (csqrt, (_Mdouble_complex_ __z));
+
+
+/* Absolute value, conjugates, and projection. */
+
+/* Absolute value of Z. */
+__MATHDECL (_Mdouble_,cabs, (_Mdouble_complex_ __z));
+
+/* Argument value of Z. */
+__MATHDECL (_Mdouble_,carg, (_Mdouble_complex_ __z));
+
+/* Complex conjugate of Z. */
+__MATHCALL (conj, (_Mdouble_complex_ __z));
+
+/* Projection of Z onto the Riemann sphere. */
+__MATHCALL (cproj, (_Mdouble_complex_ __z));
+
+
+/* Decomposing complex values. */
+
+/* Imaginary part of Z. */
+__MATHDECL (_Mdouble_,cimag, (_Mdouble_complex_ __z));
+
+/* Real part of Z. */
+__MATHDECL (_Mdouble_,creal, (_Mdouble_complex_ __z));
+
+
+/* Now some optimized versions. GCC has handy notations for these
+ functions. Recent GCC handles these as builtin functions so does
+ not need inlines. */
+#if defined __GNUC__ && !__GNUC_PREREQ (2, 97) && defined __OPTIMIZE__
+
+/* Imaginary part of Z. */
+extern __inline _Mdouble_
+__MATH_PRECNAME(cimag) (_Mdouble_complex_ __z) __THROW
+{
+ return __imag__ __z;
+}
+
+/* Real part of Z. */
+extern __inline _Mdouble_
+__MATH_PRECNAME(creal) (_Mdouble_complex_ __z) __THROW
+{
+ return __real__ __z;
+}
+
+/* Complex conjugate of Z. */
+extern __inline _Mdouble_complex_
+__MATH_PRECNAME(conj) (_Mdouble_complex_ __z) __THROW
+{
+ return __extension__ ~__z;
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/confname.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/confname.h
new file mode 100644
index 0000000..ab7fdee
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/confname.h
@@ -0,0 +1,606 @@
+/* `sysconf', `pathconf', and `confstr' NAME values. Generic version.
+ Copyright (C) 1993,1995-1998,2000,2001,2003,2004
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _UNISTD_H
+# error "Never use <bits/confname.h> directly; include <unistd.h> instead."
+#endif
+
+/* Values for the NAME argument to `pathconf' and `fpathconf'. */
+enum
+ {
+ _PC_LINK_MAX,
+#define _PC_LINK_MAX _PC_LINK_MAX
+ _PC_MAX_CANON,
+#define _PC_MAX_CANON _PC_MAX_CANON
+ _PC_MAX_INPUT,
+#define _PC_MAX_INPUT _PC_MAX_INPUT
+ _PC_NAME_MAX,
+#define _PC_NAME_MAX _PC_NAME_MAX
+ _PC_PATH_MAX,
+#define _PC_PATH_MAX _PC_PATH_MAX
+ _PC_PIPE_BUF,
+#define _PC_PIPE_BUF _PC_PIPE_BUF
+ _PC_CHOWN_RESTRICTED,
+#define _PC_CHOWN_RESTRICTED _PC_CHOWN_RESTRICTED
+ _PC_NO_TRUNC,
+#define _PC_NO_TRUNC _PC_NO_TRUNC
+ _PC_VDISABLE,
+#define _PC_VDISABLE _PC_VDISABLE
+ _PC_SYNC_IO,
+#define _PC_SYNC_IO _PC_SYNC_IO
+ _PC_ASYNC_IO,
+#define _PC_ASYNC_IO _PC_ASYNC_IO
+ _PC_PRIO_IO,
+#define _PC_PRIO_IO _PC_PRIO_IO
+ _PC_SOCK_MAXBUF,
+#define _PC_SOCK_MAXBUF _PC_SOCK_MAXBUF
+ _PC_FILESIZEBITS,
+#define _PC_FILESIZEBITS _PC_FILESIZEBITS
+ _PC_REC_INCR_XFER_SIZE,
+#define _PC_REC_INCR_XFER_SIZE _PC_REC_INCR_XFER_SIZE
+ _PC_REC_MAX_XFER_SIZE,
+#define _PC_REC_MAX_XFER_SIZE _PC_REC_MAX_XFER_SIZE
+ _PC_REC_MIN_XFER_SIZE,
+#define _PC_REC_MIN_XFER_SIZE _PC_REC_MIN_XFER_SIZE
+ _PC_REC_XFER_ALIGN,
+#define _PC_REC_XFER_ALIGN _PC_REC_XFER_ALIGN
+ _PC_ALLOC_SIZE_MIN,
+#define _PC_ALLOC_SIZE_MIN _PC_ALLOC_SIZE_MIN
+ _PC_SYMLINK_MAX,
+#define _PC_SYMLINK_MAX _PC_SYMLINK_MAX
+ _PC_2_SYMLINKS
+#define _PC_2_SYMLINKS _PC_2_SYMLINKS
+ };
+
+/* Values for the argument to `sysconf'. */
+enum
+ {
+ _SC_ARG_MAX,
+#define _SC_ARG_MAX _SC_ARG_MAX
+ _SC_CHILD_MAX,
+#define _SC_CHILD_MAX _SC_CHILD_MAX
+ _SC_CLK_TCK,
+#define _SC_CLK_TCK _SC_CLK_TCK
+ _SC_NGROUPS_MAX,
+#define _SC_NGROUPS_MAX _SC_NGROUPS_MAX
+ _SC_OPEN_MAX,
+#define _SC_OPEN_MAX _SC_OPEN_MAX
+ _SC_STREAM_MAX,
+#define _SC_STREAM_MAX _SC_STREAM_MAX
+ _SC_TZNAME_MAX,
+#define _SC_TZNAME_MAX _SC_TZNAME_MAX
+ _SC_JOB_CONTROL,
+#define _SC_JOB_CONTROL _SC_JOB_CONTROL
+ _SC_SAVED_IDS,
+#define _SC_SAVED_IDS _SC_SAVED_IDS
+ _SC_REALTIME_SIGNALS,
+#define _SC_REALTIME_SIGNALS _SC_REALTIME_SIGNALS
+ _SC_PRIORITY_SCHEDULING,
+#define _SC_PRIORITY_SCHEDULING _SC_PRIORITY_SCHEDULING
+ _SC_TIMERS,
+#define _SC_TIMERS _SC_TIMERS
+ _SC_ASYNCHRONOUS_IO,
+#define _SC_ASYNCHRONOUS_IO _SC_ASYNCHRONOUS_IO
+ _SC_PRIORITIZED_IO,
+#define _SC_PRIORITIZED_IO _SC_PRIORITIZED_IO
+ _SC_SYNCHRONIZED_IO,
+#define _SC_SYNCHRONIZED_IO _SC_SYNCHRONIZED_IO
+ _SC_FSYNC,
+#define _SC_FSYNC _SC_FSYNC
+ _SC_MAPPED_FILES,
+#define _SC_MAPPED_FILES _SC_MAPPED_FILES
+ _SC_MEMLOCK,
+#define _SC_MEMLOCK _SC_MEMLOCK
+ _SC_MEMLOCK_RANGE,
+#define _SC_MEMLOCK_RANGE _SC_MEMLOCK_RANGE
+ _SC_MEMORY_PROTECTION,
+#define _SC_MEMORY_PROTECTION _SC_MEMORY_PROTECTION
+ _SC_MESSAGE_PASSING,
+#define _SC_MESSAGE_PASSING _SC_MESSAGE_PASSING
+ _SC_SEMAPHORES,
+#define _SC_SEMAPHORES _SC_SEMAPHORES
+ _SC_SHARED_MEMORY_OBJECTS,
+#define _SC_SHARED_MEMORY_OBJECTS _SC_SHARED_MEMORY_OBJECTS
+ _SC_AIO_LISTIO_MAX,
+#define _SC_AIO_LISTIO_MAX _SC_AIO_LISTIO_MAX
+ _SC_AIO_MAX,
+#define _SC_AIO_MAX _SC_AIO_MAX
+ _SC_AIO_PRIO_DELTA_MAX,
+#define _SC_AIO_PRIO_DELTA_MAX _SC_AIO_PRIO_DELTA_MAX
+ _SC_DELAYTIMER_MAX,
+#define _SC_DELAYTIMER_MAX _SC_DELAYTIMER_MAX
+ _SC_MQ_OPEN_MAX,
+#define _SC_MQ_OPEN_MAX _SC_MQ_OPEN_MAX
+ _SC_MQ_PRIO_MAX,
+#define _SC_MQ_PRIO_MAX _SC_MQ_PRIO_MAX
+ _SC_VERSION,
+#define _SC_VERSION _SC_VERSION
+ _SC_PAGESIZE,
+#define _SC_PAGESIZE _SC_PAGESIZE
+#define _SC_PAGE_SIZE _SC_PAGESIZE
+ _SC_RTSIG_MAX,
+#define _SC_RTSIG_MAX _SC_RTSIG_MAX
+ _SC_SEM_NSEMS_MAX,
+#define _SC_SEM_NSEMS_MAX _SC_SEM_NSEMS_MAX
+ _SC_SEM_VALUE_MAX,
+#define _SC_SEM_VALUE_MAX _SC_SEM_VALUE_MAX
+ _SC_SIGQUEUE_MAX,
+#define _SC_SIGQUEUE_MAX _SC_SIGQUEUE_MAX
+ _SC_TIMER_MAX,
+#define _SC_TIMER_MAX _SC_TIMER_MAX
+
+ /* Values for the argument to `sysconf'
+ corresponding to _POSIX2_* symbols. */
+ _SC_BC_BASE_MAX,
+#define _SC_BC_BASE_MAX _SC_BC_BASE_MAX
+ _SC_BC_DIM_MAX,
+#define _SC_BC_DIM_MAX _SC_BC_DIM_MAX
+ _SC_BC_SCALE_MAX,
+#define _SC_BC_SCALE_MAX _SC_BC_SCALE_MAX
+ _SC_BC_STRING_MAX,
+#define _SC_BC_STRING_MAX _SC_BC_STRING_MAX
+ _SC_COLL_WEIGHTS_MAX,
+#define _SC_COLL_WEIGHTS_MAX _SC_COLL_WEIGHTS_MAX
+ _SC_EQUIV_CLASS_MAX,
+#define _SC_EQUIV_CLASS_MAX _SC_EQUIV_CLASS_MAX
+ _SC_EXPR_NEST_MAX,
+#define _SC_EXPR_NEST_MAX _SC_EXPR_NEST_MAX
+ _SC_LINE_MAX,
+#define _SC_LINE_MAX _SC_LINE_MAX
+ _SC_RE_DUP_MAX,
+#define _SC_RE_DUP_MAX _SC_RE_DUP_MAX
+ _SC_CHARCLASS_NAME_MAX,
+#define _SC_CHARCLASS_NAME_MAX _SC_CHARCLASS_NAME_MAX
+
+ _SC_2_VERSION,
+#define _SC_2_VERSION _SC_2_VERSION
+ _SC_2_C_BIND,
+#define _SC_2_C_BIND _SC_2_C_BIND
+ _SC_2_C_DEV,
+#define _SC_2_C_DEV _SC_2_C_DEV
+ _SC_2_FORT_DEV,
+#define _SC_2_FORT_DEV _SC_2_FORT_DEV
+ _SC_2_FORT_RUN,
+#define _SC_2_FORT_RUN _SC_2_FORT_RUN
+ _SC_2_SW_DEV,
+#define _SC_2_SW_DEV _SC_2_SW_DEV
+ _SC_2_LOCALEDEF,
+#define _SC_2_LOCALEDEF _SC_2_LOCALEDEF
+
+ _SC_PII,
+#define _SC_PII _SC_PII
+ _SC_PII_XTI,
+#define _SC_PII_XTI _SC_PII_XTI
+ _SC_PII_SOCKET,
+#define _SC_PII_SOCKET _SC_PII_SOCKET
+ _SC_PII_INTERNET,
+#define _SC_PII_INTERNET _SC_PII_INTERNET
+ _SC_PII_OSI,
+#define _SC_PII_OSI _SC_PII_OSI
+ _SC_POLL,
+#define _SC_POLL _SC_POLL
+ _SC_SELECT,
+#define _SC_SELECT _SC_SELECT
+ _SC_UIO_MAXIOV,
+#define _SC_UIO_MAXIOV _SC_UIO_MAXIOV
+ _SC_IOV_MAX = _SC_UIO_MAXIOV,
+#define _SC_IOV_MAX _SC_IOV_MAX
+ _SC_PII_INTERNET_STREAM,
+#define _SC_PII_INTERNET_STREAM _SC_PII_INTERNET_STREAM
+ _SC_PII_INTERNET_DGRAM,
+#define _SC_PII_INTERNET_DGRAM _SC_PII_INTERNET_DGRAM
+ _SC_PII_OSI_COTS,
+#define _SC_PII_OSI_COTS _SC_PII_OSI_COTS
+ _SC_PII_OSI_CLTS,
+#define _SC_PII_OSI_CLTS _SC_PII_OSI_CLTS
+ _SC_PII_OSI_M,
+#define _SC_PII_OSI_M _SC_PII_OSI_M
+ _SC_T_IOV_MAX,
+#define _SC_T_IOV_MAX _SC_T_IOV_MAX
+
+ /* Values according to POSIX 1003.1c (POSIX threads). */
+ _SC_THREADS,
+#define _SC_THREADS _SC_THREADS
+ _SC_THREAD_SAFE_FUNCTIONS,
+#define _SC_THREAD_SAFE_FUNCTIONS _SC_THREAD_SAFE_FUNCTIONS
+ _SC_GETGR_R_SIZE_MAX,
+#define _SC_GETGR_R_SIZE_MAX _SC_GETGR_R_SIZE_MAX
+ _SC_GETPW_R_SIZE_MAX,
+#define _SC_GETPW_R_SIZE_MAX _SC_GETPW_R_SIZE_MAX
+ _SC_LOGIN_NAME_MAX,
+#define _SC_LOGIN_NAME_MAX _SC_LOGIN_NAME_MAX
+ _SC_TTY_NAME_MAX,
+#define _SC_TTY_NAME_MAX _SC_TTY_NAME_MAX
+ _SC_THREAD_DESTRUCTOR_ITERATIONS,
+#define _SC_THREAD_DESTRUCTOR_ITERATIONS _SC_THREAD_DESTRUCTOR_ITERATIONS
+ _SC_THREAD_KEYS_MAX,
+#define _SC_THREAD_KEYS_MAX _SC_THREAD_KEYS_MAX
+ _SC_THREAD_STACK_MIN,
+#define _SC_THREAD_STACK_MIN _SC_THREAD_STACK_MIN
+ _SC_THREAD_THREADS_MAX,
+#define _SC_THREAD_THREADS_MAX _SC_THREAD_THREADS_MAX
+ _SC_THREAD_ATTR_STACKADDR,
+#define _SC_THREAD_ATTR_STACKADDR _SC_THREAD_ATTR_STACKADDR
+ _SC_THREAD_ATTR_STACKSIZE,
+#define _SC_THREAD_ATTR_STACKSIZE _SC_THREAD_ATTR_STACKSIZE
+ _SC_THREAD_PRIORITY_SCHEDULING,
+#define _SC_THREAD_PRIORITY_SCHEDULING _SC_THREAD_PRIORITY_SCHEDULING
+ _SC_THREAD_PRIO_INHERIT,
+#define _SC_THREAD_PRIO_INHERIT _SC_THREAD_PRIO_INHERIT
+ _SC_THREAD_PRIO_PROTECT,
+#define _SC_THREAD_PRIO_PROTECT _SC_THREAD_PRIO_PROTECT
+ _SC_THREAD_PROCESS_SHARED,
+#define _SC_THREAD_PROCESS_SHARED _SC_THREAD_PROCESS_SHARED
+
+ _SC_NPROCESSORS_CONF,
+#define _SC_NPROCESSORS_CONF _SC_NPROCESSORS_CONF
+ _SC_NPROCESSORS_ONLN,
+#define _SC_NPROCESSORS_ONLN _SC_NPROCESSORS_ONLN
+ _SC_PHYS_PAGES,
+#define _SC_PHYS_PAGES _SC_PHYS_PAGES
+ _SC_AVPHYS_PAGES,
+#define _SC_AVPHYS_PAGES _SC_AVPHYS_PAGES
+ _SC_ATEXIT_MAX,
+#define _SC_ATEXIT_MAX _SC_ATEXIT_MAX
+ _SC_PASS_MAX,
+#define _SC_PASS_MAX _SC_PASS_MAX
+
+ _SC_XOPEN_VERSION,
+#define _SC_XOPEN_VERSION _SC_XOPEN_VERSION
+ _SC_XOPEN_XCU_VERSION,
+#define _SC_XOPEN_XCU_VERSION _SC_XOPEN_XCU_VERSION
+ _SC_XOPEN_UNIX,
+#define _SC_XOPEN_UNIX _SC_XOPEN_UNIX
+ _SC_XOPEN_CRYPT,
+#define _SC_XOPEN_CRYPT _SC_XOPEN_CRYPT
+ _SC_XOPEN_ENH_I18N,
+#define _SC_XOPEN_ENH_I18N _SC_XOPEN_ENH_I18N
+ _SC_XOPEN_SHM,
+#define _SC_XOPEN_SHM _SC_XOPEN_SHM
+
+ _SC_2_CHAR_TERM,
+#define _SC_2_CHAR_TERM _SC_2_CHAR_TERM
+ _SC_2_C_VERSION,
+#define _SC_2_C_VERSION _SC_2_C_VERSION
+ _SC_2_UPE,
+#define _SC_2_UPE _SC_2_UPE
+
+ _SC_XOPEN_XPG2,
+#define _SC_XOPEN_XPG2 _SC_XOPEN_XPG2
+ _SC_XOPEN_XPG3,
+#define _SC_XOPEN_XPG3 _SC_XOPEN_XPG3
+ _SC_XOPEN_XPG4,
+#define _SC_XOPEN_XPG4 _SC_XOPEN_XPG4
+
+ _SC_CHAR_BIT,
+#define _SC_CHAR_BIT _SC_CHAR_BIT
+ _SC_CHAR_MAX,
+#define _SC_CHAR_MAX _SC_CHAR_MAX
+ _SC_CHAR_MIN,
+#define _SC_CHAR_MIN _SC_CHAR_MIN
+ _SC_INT_MAX,
+#define _SC_INT_MAX _SC_INT_MAX
+ _SC_INT_MIN,
+#define _SC_INT_MIN _SC_INT_MIN
+ _SC_LONG_BIT,
+#define _SC_LONG_BIT _SC_LONG_BIT
+ _SC_WORD_BIT,
+#define _SC_WORD_BIT _SC_WORD_BIT
+ _SC_MB_LEN_MAX,
+#define _SC_MB_LEN_MAX _SC_MB_LEN_MAX
+ _SC_NZERO,
+#define _SC_NZERO _SC_NZERO
+ _SC_SSIZE_MAX,
+#define _SC_SSIZE_MAX _SC_SSIZE_MAX
+ _SC_SCHAR_MAX,
+#define _SC_SCHAR_MAX _SC_SCHAR_MAX
+ _SC_SCHAR_MIN,
+#define _SC_SCHAR_MIN _SC_SCHAR_MIN
+ _SC_SHRT_MAX,
+#define _SC_SHRT_MAX _SC_SHRT_MAX
+ _SC_SHRT_MIN,
+#define _SC_SHRT_MIN _SC_SHRT_MIN
+ _SC_UCHAR_MAX,
+#define _SC_UCHAR_MAX _SC_UCHAR_MAX
+ _SC_UINT_MAX,
+#define _SC_UINT_MAX _SC_UINT_MAX
+ _SC_ULONG_MAX,
+#define _SC_ULONG_MAX _SC_ULONG_MAX
+ _SC_USHRT_MAX,
+#define _SC_USHRT_MAX _SC_USHRT_MAX
+
+ _SC_NL_ARGMAX,
+#define _SC_NL_ARGMAX _SC_NL_ARGMAX
+ _SC_NL_LANGMAX,
+#define _SC_NL_LANGMAX _SC_NL_LANGMAX
+ _SC_NL_MSGMAX,
+#define _SC_NL_MSGMAX _SC_NL_MSGMAX
+ _SC_NL_NMAX,
+#define _SC_NL_NMAX _SC_NL_NMAX
+ _SC_NL_SETMAX,
+#define _SC_NL_SETMAX _SC_NL_SETMAX
+ _SC_NL_TEXTMAX,
+#define _SC_NL_TEXTMAX _SC_NL_TEXTMAX
+
+ _SC_XBS5_ILP32_OFF32,
+#define _SC_XBS5_ILP32_OFF32 _SC_XBS5_ILP32_OFF32
+ _SC_XBS5_ILP32_OFFBIG,
+#define _SC_XBS5_ILP32_OFFBIG _SC_XBS5_ILP32_OFFBIG
+ _SC_XBS5_LP64_OFF64,
+#define _SC_XBS5_LP64_OFF64 _SC_XBS5_LP64_OFF64
+ _SC_XBS5_LPBIG_OFFBIG,
+#define _SC_XBS5_LPBIG_OFFBIG _SC_XBS5_LPBIG_OFFBIG
+
+ _SC_XOPEN_LEGACY,
+#define _SC_XOPEN_LEGACY _SC_XOPEN_LEGACY
+ _SC_XOPEN_REALTIME,
+#define _SC_XOPEN_REALTIME _SC_XOPEN_REALTIME
+ _SC_XOPEN_REALTIME_THREADS,
+#define _SC_XOPEN_REALTIME_THREADS _SC_XOPEN_REALTIME_THREADS
+
+ _SC_ADVISORY_INFO,
+#define _SC_ADVISORY_INFO _SC_ADVISORY_INFO
+ _SC_BARRIERS,
+#define _SC_BARRIERS _SC_BARRIERS
+ _SC_BASE,
+#define _SC_BASE _SC_BASE
+ _SC_C_LANG_SUPPORT,
+#define _SC_C_LANG_SUPPORT _SC_C_LANG_SUPPORT
+ _SC_C_LANG_SUPPORT_R,
+#define _SC_C_LANG_SUPPORT_R _SC_C_LANG_SUPPORT_R
+ _SC_CLOCK_SELECTION,
+#define _SC_CLOCK_SELECTION _SC_CLOCK_SELECTION
+ _SC_CPUTIME,
+#define _SC_CPUTIME _SC_CPUTIME
+ _SC_THREAD_CPUTIME,
+#define _SC_THREAD_CPUTIME _SC_THREAD_CPUTIME
+ _SC_DEVICE_IO,
+#define _SC_DEVICE_IO _SC_DEVICE_IO
+ _SC_DEVICE_SPECIFIC,
+#define _SC_DEVICE_SPECIFIC _SC_DEVICE_SPECIFIC
+ _SC_DEVICE_SPECIFIC_R,
+#define _SC_DEVICE_SPECIFIC_R _SC_DEVICE_SPECIFIC_R
+ _SC_FD_MGMT,
+#define _SC_FD_MGMT _SC_FD_MGMT
+ _SC_FIFO,
+#define _SC_FIFO _SC_FIFO
+ _SC_PIPE,
+#define _SC_PIPE _SC_PIPE
+ _SC_FILE_ATTRIBUTES,
+#define _SC_FILE_ATTRIBUTES _SC_FILE_ATTRIBUTES
+ _SC_FILE_LOCKING,
+#define _SC_FILE_LOCKING _SC_FILE_LOCKING
+ _SC_FILE_SYSTEM,
+#define _SC_FILE_SYSTEM _SC_FILE_SYSTEM
+ _SC_MONOTONIC_CLOCK,
+#define _SC_MONOTONIC_CLOCK _SC_MONOTONIC_CLOCK
+ _SC_MULTI_PROCESS,
+#define _SC_MULTI_PROCESS _SC_MULTI_PROCESS
+ _SC_SINGLE_PROCESS,
+#define _SC_SINGLE_PROCESS _SC_SINGLE_PROCESS
+ _SC_NETWORKING,
+#define _SC_NETWORKING _SC_NETWORKING
+ _SC_READER_WRITER_LOCKS,
+#define _SC_READER_WRITER_LOCKS _SC_READER_WRITER_LOCKS
+ _SC_SPIN_LOCKS,
+#define _SC_SPIN_LOCKS _SC_SPIN_LOCKS
+ _SC_REGEXP,
+#define _SC_REGEXP _SC_REGEXP
+ _SC_REGEX_VERSION,
+#define _SC_REGEX_VERSION _SC_REGEX_VERSION
+ _SC_SHELL,
+#define _SC_SHELL _SC_SHELL
+ _SC_SIGNALS,
+#define _SC_SIGNALS _SC_SIGNALS
+ _SC_SPAWN,
+#define _SC_SPAWN _SC_SPAWN
+ _SC_SPORADIC_SERVER,
+#define _SC_SPORADIC_SERVER _SC_SPORADIC_SERVER
+ _SC_THREAD_SPORADIC_SERVER,
+#define _SC_THREAD_SPORADIC_SERVER _SC_THREAD_SPORADIC_SERVER
+ _SC_SYSTEM_DATABASE,
+#define _SC_SYSTEM_DATABASE _SC_SYSTEM_DATABASE
+ _SC_SYSTEM_DATABASE_R,
+#define _SC_SYSTEM_DATABASE_R _SC_SYSTEM_DATABASE_R
+ _SC_TIMEOUTS,
+#define _SC_TIMEOUTS _SC_TIMEOUTS
+ _SC_TYPED_MEMORY_OBJECTS,
+#define _SC_TYPED_MEMORY_OBJECTS _SC_TYPED_MEMORY_OBJECTS
+ _SC_USER_GROUPS,
+#define _SC_USER_GROUPS _SC_USER_GROUPS
+ _SC_USER_GROUPS_R,
+#define _SC_USER_GROUPS_R _SC_USER_GROUPS_R
+ _SC_2_PBS,
+#define _SC_2_PBS _SC_2_PBS
+ _SC_2_PBS_ACCOUNTING,
+#define _SC_2_PBS_ACCOUNTING _SC_2_PBS_ACCOUNTING
+ _SC_2_PBS_LOCATE,
+#define _SC_2_PBS_LOCATE _SC_2_PBS_LOCATE
+ _SC_2_PBS_MESSAGE,
+#define _SC_2_PBS_MESSAGE _SC_2_PBS_MESSAGE
+ _SC_2_PBS_TRACK,
+#define _SC_2_PBS_TRACK _SC_2_PBS_TRACK
+ _SC_SYMLOOP_MAX,
+#define _SC_SYMLOOP_MAX _SC_SYMLOOP_MAX
+ _SC_STREAMS,
+#define _SC_STREAMS _SC_STREAMS
+ _SC_2_PBS_CHECKPOINT,
+#define _SC_2_PBS_CHECKPOINT _SC_2_PBS_CHECKPOINT
+
+ _SC_V6_ILP32_OFF32,
+#define _SC_V6_ILP32_OFF32 _SC_V6_ILP32_OFF32
+ _SC_V6_ILP32_OFFBIG,
+#define _SC_V6_ILP32_OFFBIG _SC_V6_ILP32_OFFBIG
+ _SC_V6_LP64_OFF64,
+#define _SC_V6_LP64_OFF64 _SC_V6_LP64_OFF64
+ _SC_V6_LPBIG_OFFBIG,
+#define _SC_V6_LPBIG_OFFBIG _SC_V6_LPBIG_OFFBIG
+
+ _SC_HOST_NAME_MAX,
+#define _SC_HOST_NAME_MAX _SC_HOST_NAME_MAX
+ _SC_TRACE,
+#define _SC_TRACE _SC_TRACE
+ _SC_TRACE_EVENT_FILTER,
+#define _SC_TRACE_EVENT_FILTER _SC_TRACE_EVENT_FILTER
+ _SC_TRACE_INHERIT,
+#define _SC_TRACE_INHERIT _SC_TRACE_INHERIT
+ _SC_TRACE_LOG,
+#define _SC_TRACE_LOG _SC_TRACE_LOG
+
+ _SC_LEVEL1_ICACHE_SIZE,
+#define _SC_LEVEL1_ICACHE_SIZE _SC_LEVEL1_ICACHE_SIZE
+ _SC_LEVEL1_ICACHE_ASSOC,
+#define _SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_ASSOC
+ _SC_LEVEL1_ICACHE_LINESIZE,
+#define _SC_LEVEL1_ICACHE_LINESIZE _SC_LEVEL1_ICACHE_LINESIZE
+ _SC_LEVEL1_DCACHE_SIZE,
+#define _SC_LEVEL1_DCACHE_SIZE _SC_LEVEL1_DCACHE_SIZE
+ _SC_LEVEL1_DCACHE_ASSOC,
+#define _SC_LEVEL1_DCACHE_ASSOC _SC_LEVEL1_DCACHE_ASSOC
+ _SC_LEVEL1_DCACHE_LINESIZE,
+#define _SC_LEVEL1_DCACHE_LINESIZE _SC_LEVEL1_DCACHE_LINESIZE
+ _SC_LEVEL2_CACHE_SIZE,
+#define _SC_LEVEL2_CACHE_SIZE _SC_LEVEL2_CACHE_SIZE
+ _SC_LEVEL2_CACHE_ASSOC,
+#define _SC_LEVEL2_CACHE_ASSOC _SC_LEVEL2_CACHE_ASSOC
+ _SC_LEVEL2_CACHE_LINESIZE,
+#define _SC_LEVEL2_CACHE_LINESIZE _SC_LEVEL2_CACHE_LINESIZE
+ _SC_LEVEL3_CACHE_SIZE,
+#define _SC_LEVEL3_CACHE_SIZE _SC_LEVEL3_CACHE_SIZE
+ _SC_LEVEL3_CACHE_ASSOC,
+#define _SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_ASSOC
+ _SC_LEVEL3_CACHE_LINESIZE,
+#define _SC_LEVEL3_CACHE_LINESIZE _SC_LEVEL3_CACHE_LINESIZE
+ _SC_LEVEL4_CACHE_SIZE,
+#define _SC_LEVEL4_CACHE_SIZE _SC_LEVEL4_CACHE_SIZE
+ _SC_LEVEL4_CACHE_ASSOC,
+#define _SC_LEVEL4_CACHE_ASSOC _SC_LEVEL4_CACHE_ASSOC
+ _SC_LEVEL4_CACHE_LINESIZE,
+#define _SC_LEVEL4_CACHE_LINESIZE _SC_LEVEL4_CACHE_LINESIZE
+ /* Leave room here, maybe we need a few more cache levels some day. */
+
+ _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,
+#define _SC_IPV6 _SC_IPV6
+ _SC_RAW_SOCKETS
+#define _SC_RAW_SOCKETS _SC_RAW_SOCKETS
+ };
+
+#if (defined __USE_POSIX2 || defined __USE_UNIX98 \
+ || defined __USE_FILE_OFFSET64 || defined __USE_LARGEFILE64 \
+ || defined __USE_LARGEFILE)
+/* Values for the NAME argument to `confstr'. */
+enum
+ {
+ _CS_PATH, /* The default search path. */
+#define _CS_PATH _CS_PATH
+
+ _CS_V6_WIDTH_RESTRICTED_ENVS,
+# define _CS_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS
+
+# if (defined __USE_FILE_OFFSET64 || defined __USE_LARGEFILE64 \
+ || defined __USE_LARGEFILE)
+ _CS_LFS_CFLAGS = 1000,
+#define _CS_LFS_CFLAGS _CS_LFS_CFLAGS
+ _CS_LFS_LDFLAGS,
+#define _CS_LFS_LDFLAGS _CS_LFS_LDFLAGS
+ _CS_LFS_LIBS,
+#define _CS_LFS_LIBS _CS_LFS_LIBS
+ _CS_LFS_LINTFLAGS,
+#define _CS_LFS_LINTFLAGS _CS_LFS_LINTFLAGS
+ _CS_LFS64_CFLAGS,
+#define _CS_LFS64_CFLAGS _CS_LFS64_CFLAGS
+ _CS_LFS64_LDFLAGS,
+#define _CS_LFS64_LDFLAGS _CS_LFS64_LDFLAGS
+ _CS_LFS64_LIBS,
+#define _CS_LFS64_LIBS _CS_LFS64_LIBS
+ _CS_LFS64_LINTFLAGS,
+#define _CS_LFS64_LINTFLAGS _CS_LFS64_LINTFLAGS
+# endif
+
+# ifdef __USE_UNIX98
+ _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
+#define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS
+ _CS_XBS5_ILP32_OFF32_LDFLAGS,
+#define _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS
+ _CS_XBS5_ILP32_OFF32_LIBS,
+#define _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LIBS
+ _CS_XBS5_ILP32_OFF32_LINTFLAGS,
+#define _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFF32_LINTFLAGS
+ _CS_XBS5_ILP32_OFFBIG_CFLAGS,
+#define _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS
+ _CS_XBS5_ILP32_OFFBIG_LDFLAGS,
+#define _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS
+ _CS_XBS5_ILP32_OFFBIG_LIBS,
+#define _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LIBS
+ _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
+#define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
+ _CS_XBS5_LP64_OFF64_CFLAGS,
+#define _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_CFLAGS
+ _CS_XBS5_LP64_OFF64_LDFLAGS,
+#define _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS
+ _CS_XBS5_LP64_OFF64_LIBS,
+#define _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LIBS
+ _CS_XBS5_LP64_OFF64_LINTFLAGS,
+#define _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LP64_OFF64_LINTFLAGS
+ _CS_XBS5_LPBIG_OFFBIG_CFLAGS,
+#define _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS
+ _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
+#define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
+ _CS_XBS5_LPBIG_OFFBIG_LIBS,
+#define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LIBS
+ _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
+#define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
+# endif
+# ifdef __USE_XOPEN2K
+ _CS_POSIX_V6_ILP32_OFF32_CFLAGS,
+#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS
+ _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,
+#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
+ _CS_POSIX_V6_ILP32_OFF32_LIBS,
+#define _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LIBS
+ _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,
+#define _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
+ _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,
+#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
+ _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,
+#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
+ _CS_POSIX_V6_ILP32_OFFBIG_LIBS,
+#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LIBS
+ _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,
+#define _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
+ _CS_POSIX_V6_LP64_OFF64_CFLAGS,
+#define _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS
+ _CS_POSIX_V6_LP64_OFF64_LDFLAGS,
+#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS
+ _CS_POSIX_V6_LP64_OFF64_LIBS,
+#define _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LIBS
+ _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,
+#define _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
+ _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,
+#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
+ _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,
+#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
+ _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,
+#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
+ _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
+#define _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
+# endif
+ };
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/dirent.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/dirent.h
new file mode 100644
index 0000000..014e011
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/dirent.h
@@ -0,0 +1,61 @@
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _DIRENT_H
+# error "Never use <bits/dirent.h> directly; include <dirent.h> instead."
+#endif
+#include <errno.h>
+#include <sys/syscall.h>
+
+struct dirent
+ {
+#if defined(__USE_FILE_OFFSET64) && defined(__NR_getdents64)
+ __ino64_t d_ino;
+ __off64_t d_off;
+#else
+ __ino_t d_ino;
+ __off_t d_off;
+#endif
+ unsigned short int d_reclen;
+ unsigned char d_type;
+ char d_name[256]; /* We must not include limits.h! */
+ };
+
+#ifdef __USE_LARGEFILE64
+struct dirent64
+ {
+#ifdef __NR_getdents64
+ __ino64_t d_ino;
+ __off64_t d_off;
+#else
+ /* dirent64 is the same as dirent. */
+ __ino_t d_ino;
+ __off_t d_off;
+#endif
+ unsigned short int d_reclen;
+ unsigned char d_type;
+ char d_name[256]; /* We must not include limits.h! */
+ };
+#endif
+
+#define d_fileno d_ino /* Backwards compatibility. */
+
+#undef _DIRENT_HAVE_D_NAMLEN
+#define _DIRENT_HAVE_D_RECLEN
+#define _DIRENT_HAVE_D_OFF
+#define _DIRENT_HAVE_D_TYPE
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/dlfcn.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/dlfcn.h
new file mode 100644
index 0000000..1f054f9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/dlfcn.h
@@ -0,0 +1,66 @@
+/* System dependent definitions for run-time dynamic loading.
+ Copyright (C) 1996, 1997, 1999, 2000, 2001, 2004
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _DLFCN_H
+# error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead."
+#endif
+
+/* The MODE argument to `dlopen' contains one of the following: */
+#define RTLD_LAZY 0x0001 /* Lazy function call binding. */
+#define RTLD_NOW 0x0002 /* Immediate function call binding. */
+#define RTLD_BINDING_MASK 0x3 /* Mask of binding time value. */
+#define RTLD_NOLOAD 0x00008 /* Do not load the object. */
+#define RTLD_DEEPBIND 0x00010 /* Use deep binding. */
+
+/* If the following bit is set in the MODE argument to `dlopen',
+ the symbols of the loaded object and its dependencies are made
+ visible as if the object were linked directly into the program. */
+#define RTLD_GLOBAL 0x0004
+
+/* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL.
+ The implementation does this by default and so we can define the
+ value to zero. */
+#define RTLD_LOCAL 0
+
+/* Do not delete object when closed. */
+#define RTLD_NODELETE 0x01000
+
+#if 0 /*def __USE_GNU*/
+/* To support profiling of shared objects it is a good idea to call
+ the function found using `dlsym' using the following macro since
+ these calls do not use the PLT. But this would mean the dynamic
+ loader has no chance to find out when the function is called. The
+ macro applies the necessary magic so that profiling is possible.
+ Rewrite
+ foo = (*fctp) (arg1, arg2);
+ into
+ foo = DL_CALL_FCT (fctp, (arg1, arg2));
+*/
+# define DL_CALL_FCT(fctp, args) \
+ (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args)
+
+__BEGIN_DECLS
+
+/* This function calls the profiling functions. */
+extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW;
+
+__END_DECLS
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/elfclass.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/elfclass.h
new file mode 100644
index 0000000..180227d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/elfclass.h
@@ -0,0 +1,14 @@
+/* This file specifies the native word size of the machine, which indicates
+ the ELF file class used for executables and shared objects on this
+ machine. */
+
+#ifndef _LINK_H
+# error "Never use <bits/elfclass.h> directly; include <link.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+#define __ELF_NATIVE_CLASS __WORDSIZE
+
+/* The entries in the .hash table always have a size of 32 bits. */
+typedef uint32_t Elf_Symndx;
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/endian.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/endian.h
new file mode 100644
index 0000000..0a3d2fa
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/endian.h
@@ -0,0 +1,16 @@
+/* The MIPS architecture has selectable endianness.
+ Linux/MIPS exists in two both little and big endian flavours and we
+ want to be able to share the installed headerfiles between both,
+ so we define __BYTE_ORDER based on GCC's predefines. */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#ifdef __MIPSEB__
+# define __BYTE_ORDER __BIG_ENDIAN
+#else
+# ifdef __MIPSEL__
+# define __BYTE_ORDER __LITTLE_ENDIAN
+# endif
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/environments.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/environments.h
new file mode 100644
index 0000000..4617dc4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/environments.h
@@ -0,0 +1,78 @@
+/* Copyright (C) 1999, 2001, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _UNISTD_H
+# error "Never include this file directly. Use <unistd.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+
+/* This header should define the following symbols under the described
+ situations. A value `1' means that the model is always supported,
+ `-1' means it is never supported. Undefined means it cannot be
+ statically decided.
+
+ _POSIX_V6_ILP32_OFF32 32bit int, long, pointers, and off_t type
+ _POSIX_V6_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type
+
+ _POSIX_V6_LP64_OFF32 64bit long and pointers and 32bit off_t type
+ _POSIX_V6_LPBIG_OFFBIG 64bit long and pointers and large off_t type
+
+ The macros _XBS5_ILP32_OFF32, _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and
+ _XBS5_LPBIG_OFFBIG were used in previous versions of the Unix standard
+ and are available only for compatibility.
+*/
+
+#if __WORDSIZE == 64
+
+/* We can never provide environments with 32-bit wide pointers. */
+# define _POSIX_V6_ILP32_OFF32 -1
+# define _POSIX_V6_ILP32_OFFBIG -1
+# define _XBS5_ILP32_OFF32 -1
+# define _XBS5_ILP32_OFFBIG -1
+/* We also have no use (for now) for an environment with bigger pointers
+ and offsets. */
+# define _POSIX_V6_LPBIG_OFFBIG -1
+# define _XBS5_LPBIG_OFFBIG -1
+
+/* By default we have 64-bit wide `long int', pointers and `off_t'. */
+# define _POSIX_V6_LP64_OFF64 1
+# define _XBS5_LP64_OFF64 1
+
+#else /* __WORDSIZE == 32 */
+
+/* By default we have 32-bit wide `int', `long int', pointers and `off_t'
+ and all platforms support LFS. */
+# define _POSIX_V6_ILP32_OFF32 1
+# define _POSIX_V6_ILP32_OFFBIG 1
+# define _XBS5_ILP32_OFF32 1
+# define _XBS5_ILP32_OFFBIG 1
+
+/* We optionally provide an environment with the above size but an 64-bit
+ side `off_t'. Therefore we don't define _XBS5_ILP32_OFFBIG. */
+
+/* We can never provide environments with 64-bit wide pointers. */
+# define _POSIX_V6_LP64_OFF64 -1
+# define _POSIX_V6_LPBIG_OFFBIG -1
+# define _XBS5_LP64_OFF64 -1
+# define _XBS5_LPBIG_OFFBIG -1
+
+/* CFLAGS. */
+#define __ILP32_OFFBIG_CFLAGS "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
+
+#endif /* __WORDSIZE == 32 */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/errno.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/errno.h
new file mode 100644
index 0000000..78e8c69
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/errno.h
@@ -0,0 +1,59 @@
+/* Error constants. Linux specific version.
+ Copyright (C) 1996, 1997, 1998, 1999, 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifdef _ERRNO_H
+
+# undef EDOM
+# undef EILSEQ
+# undef ERANGE
+# include <bits/errno_values.h>
+
+/* Linux has no ENOTSUP error code. */
+# define ENOTSUP EOPNOTSUPP
+
+/* Older Linux versions also had no ECANCELED error code. */
+# ifndef ECANCELED
+# define ECANCELED 125
+# endif
+
+/* Support for error codes to support robust mutexes was added later, too. */
+# ifndef EOWNERDEAD
+# define EOWNERDEAD 130
+# define ENOTRECOVERABLE 131
+# endif
+
+# ifndef __ASSEMBLER__
+/* Function to get address of global `errno' variable. */
+extern int *__errno_location (void) __THROW __attribute__ ((__const__));
+
+# ifdef __UCLIBC_HAS_THREADS__
+/* When using threads, errno is a per-thread value. */
+# define errno (*__errno_location ())
+# endif
+# endif /* !__ASSEMBLER__ */
+#endif /* _ERRNO_H */
+
+#if !defined _ERRNO_H && defined __need_Emath
+/* This is ugly but the kernel header is not clean enough. We must
+ define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is
+ defined. */
+# define EDOM 33 /* Math argument out of domain of function. */
+# define EILSEQ 84 /* Illegal byte sequence. */
+# define ERANGE 34 /* Math result not representable. */
+#endif /* !_ERRNO_H && __need_Emath */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/errno_values.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/errno_values.h
new file mode 100644
index 0000000..4d6efdf
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/errno_values.h
@@ -0,0 +1,135 @@
+#ifndef _BITS_ERRNO_VALUES_H
+#define _BITS_ERRNO_VALUES_H
+
+/* These error numbers are intended to be MIPS ABI compatible */
+
+#define EPERM 1 /* Operation not permitted */
+#define ENOENT 2 /* No such file or directory */
+#define ESRCH 3 /* No such process */
+#define EINTR 4 /* Interrupted system call */
+#define EIO 5 /* I/O error */
+#define ENXIO 6 /* No such device or address */
+#define E2BIG 7 /* Argument list too long */
+#define ENOEXEC 8 /* Exec format error */
+#define EBADF 9 /* Bad file number */
+#define ECHILD 10 /* No child processes */
+#define EAGAIN 11 /* Try again */
+#define ENOMEM 12 /* Out of memory */
+#define EACCES 13 /* Permission denied */
+#define EFAULT 14 /* Bad address */
+#define ENOTBLK 15 /* Block device required */
+#define EBUSY 16 /* Device or resource busy */
+#define EEXIST 17 /* File exists */
+#define EXDEV 18 /* Cross-device link */
+#define ENODEV 19 /* No such device */
+#define ENOTDIR 20 /* Not a directory */
+#define EISDIR 21 /* Is a directory */
+#define EINVAL 22 /* Invalid argument */
+#define ENFILE 23 /* File table overflow */
+#define EMFILE 24 /* Too many open files */
+#define ENOTTY 25 /* Not a typewriter */
+#define ETXTBSY 26 /* Text file busy */
+#define EFBIG 27 /* File too large */
+#define ENOSPC 28 /* No space left on device */
+#define ESPIPE 29 /* Illegal seek */
+#define EROFS 30 /* Read-only file system */
+#define EMLINK 31 /* Too many links */
+#define EPIPE 32 /* Broken pipe */
+#define EDOM 33 /* Math argument out of domain of func */
+#define ERANGE 34 /* Math result not representable */
+#define ENOMSG 35 /* No message of desired type */
+#define EIDRM 36 /* Identifier removed */
+#define ECHRNG 37 /* Channel number out of range */
+#define EL2NSYNC 38 /* Level 2 not synchronized */
+#define EL3HLT 39 /* Level 3 halted */
+#define EL3RST 40 /* Level 3 reset */
+#define ELNRNG 41 /* Link number out of range */
+#define EUNATCH 42 /* Protocol driver not attached */
+#define ENOCSI 43 /* No CSI structure available */
+#define EL2HLT 44 /* Level 2 halted */
+#define EDEADLK 45 /* Resource deadlock would occur */
+#define ENOLCK 46 /* No record locks available */
+#define EBADE 50 /* Invalid exchange */
+#define EBADR 51 /* Invalid request descriptor */
+#define EXFULL 52 /* Exchange full */
+#define ENOANO 53 /* No anode */
+#define EBADRQC 54 /* Invalid request code */
+#define EBADSLT 55 /* Invalid slot */
+#define EDEADLOCK 56 /* File locking deadlock error */
+#define EBFONT 59 /* Bad font file format */
+#define ENOSTR 60 /* Device not a stream */
+#define ENODATA 61 /* No data available */
+#define ETIME 62 /* Timer expired */
+#define ENOSR 63 /* Out of streams resources */
+#define ENONET 64 /* Machine is not on the network */
+#define ENOPKG 65 /* Package not installed */
+#define EREMOTE 66 /* Object is remote */
+#define ENOLINK 67 /* Link has been severed */
+#define EADV 68 /* Advertise error */
+#define ESRMNT 69 /* Srmount error */
+#define ECOMM 70 /* Communication error on send */
+#define EPROTO 71 /* Protocol error */
+#define EDOTDOT 73 /* RFS specific error */
+#define EMULTIHOP 74 /* Multihop attempted */
+#define EBADMSG 77 /* Not a data message */
+#define ENAMETOOLONG 78 /* File name too long */
+#define EOVERFLOW 79 /* Value too large for defined data type */
+#define ENOTUNIQ 80 /* Name not unique on network */
+#define EBADFD 81 /* File descriptor in bad state */
+#define EREMCHG 82 /* Remote address changed */
+#define ELIBACC 83 /* Can not access a needed shared library */
+#define ELIBBAD 84 /* Accessing a corrupted shared library */
+#define ELIBSCN 85 /* .lib section in a.out corrupted */
+#define ELIBMAX 86 /* Attempting to link in too many shared libraries */
+#define ELIBEXEC 87 /* Cannot exec a shared library directly */
+#define EILSEQ 88 /* Illegal byte sequence */
+#define ENOSYS 89 /* Function not implemented */
+#define ELOOP 90 /* Too many symbolic links encountered */
+#define ERESTART 91 /* Interrupted system call should be restarted */
+#define ESTRPIPE 92 /* Streams pipe error */
+#define ENOTEMPTY 93 /* Directory not empty */
+#define EUSERS 94 /* Too many users */
+#define ENOTSOCK 95 /* Socket operation on non-socket */
+#define EDESTADDRREQ 96 /* Destination address required */
+#define EMSGSIZE 97 /* Message too long */
+#define EPROTOTYPE 98 /* Protocol wrong type for socket */
+#define ENOPROTOOPT 99 /* Protocol not available */
+#define EPROTONOSUPPORT 120 /* Protocol not supported */
+#define ESOCKTNOSUPPORT 121 /* Socket type not supported */
+#define EOPNOTSUPP 122 /* Operation not supported on transport endpoint */
+#define EPFNOSUPPORT 123 /* Protocol family not supported */
+#define EAFNOSUPPORT 124 /* Address family not supported by protocol */
+#define EADDRINUSE 125 /* Address already in use */
+#define EADDRNOTAVAIL 126 /* Cannot assign requested address */
+#define ENETDOWN 127 /* Network is down */
+#define ENETUNREACH 128 /* Network is unreachable */
+#define ENETRESET 129 /* Network dropped connection because of reset */
+#define ECONNABORTED 130 /* Software caused connection abort */
+#define ECONNRESET 131 /* Connection reset by peer */
+#define ENOBUFS 132 /* No buffer space available */
+#define EISCONN 133 /* Transport endpoint is already connected */
+#define ENOTCONN 134 /* Transport endpoint is not connected */
+#define EUCLEAN 135 /* Structure needs cleaning */
+#define ENOTNAM 137 /* Not a XENIX named type file */
+#define ENAVAIL 138 /* No XENIX semaphores available */
+#define EISNAM 139 /* Is a named type file */
+#define EREMOTEIO 140 /* Remote I/O error */
+#define EINIT 141 /* Reserved */
+#define EREMDEV 142 /* Error 142 */
+#define ESHUTDOWN 143 /* Cannot send after transport endpoint shutdown */
+#define ETOOMANYREFS 144 /* Too many references: cannot splice */
+#define ETIMEDOUT 145 /* Connection timed out */
+#define ECONNREFUSED 146 /* Connection refused */
+#define EHOSTDOWN 147 /* Host is down */
+#define EHOSTUNREACH 148 /* No route to host */
+#define EWOULDBLOCK EAGAIN /* Operation would block */
+#define EALREADY 149 /* Operation already in progress */
+#define EINPROGRESS 150 /* Operation now in progress */
+#define ESTALE 151 /* Stale NFS file handle */
+#define ECANCELED 158 /* AIO operation canceled */
+/* These errors are Linux extensions. */
+#define ENOMEDIUM 159 /* No medium found */
+#define EMEDIUMTYPE 160 /* Wrong medium type */
+#define EDQUOT 1133 /* Quota exceeded */
+
+#endif /* _BITS_ERRNO_VALUES_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/fcntl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/fcntl.h
new file mode 100644
index 0000000..08c8686
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/fcntl.h
@@ -0,0 +1,261 @@
+/* O_*, F_*, FD_* bit values for Linux.
+ Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2003, 2004, 2006
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+#include <sgidefs.h>
+#include <sys/types.h>
+#ifdef __USE_GNU
+# include <bits/uio.h>
+#endif
+
+
+/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
+ located on an ext2 file system */
+#define O_ACCMODE 0003
+#define O_RDONLY 00
+#define O_WRONLY 01
+#define O_RDWR 02
+#define O_APPEND 0x0008
+#define O_SYNC 0x0010
+#define O_NONBLOCK 0x0080
+#define O_NDELAY O_NONBLOCK
+#define O_CREAT 0x0100 /* not fcntl */
+#define O_TRUNC 0x0200 /* not fcntl */
+#define O_EXCL 0x0400 /* not fcntl */
+#define O_NOCTTY 0x0800 /* not fcntl */
+#define O_FSYNC O_SYNC
+#define O_ASYNC 0x1000
+
+#ifdef __USE_GNU
+# define O_NOFOLLOW 0x20000 /* Do not follow links. */
+# define O_DIRECT 0x8000 /* Direct disk access hint. */
+# define O_DIRECTORY 0x10000 /* Must be a directory. */
+# define O_NOATIME 0x40000 /* Do not set atime. */
+#endif
+
+/* For now Linux has no synchronisity options for data and read operations.
+ We define the symbols here but let them do the same as O_SYNC since
+ this is a superset. */
+#if defined __USE_POSIX199309 || defined __USE_UNIX98
+# define O_DSYNC O_SYNC /* Synchronize data. */
+# define O_RSYNC O_SYNC /* Synchronize read operations. */
+#endif
+
+#ifdef __USE_LARGEFILE64
+# if __WORDSIZE == 64
+# define O_LARGEFILE 0
+# else
+# define O_LARGEFILE 0x2000 /* Allow large file opens. */
+# endif
+#endif
+
+/* Values for the second argument to `fcntl'. */
+#define F_DUPFD 0 /* Duplicate file descriptor. */
+#define F_GETFD 1 /* Get file descriptor flags. */
+#define F_SETFD 2 /* Set file descriptor flags. */
+#define F_GETFL 3 /* Get file status flags. */
+#define F_SETFL 4 /* Set file status flags. */
+#ifndef __USE_FILE_OFFSET64
+# define F_GETLK 14 /* Get record locking info. */
+# define F_SETLK 6 /* Set record locking info (non-blocking). */
+# define F_SETLKW 7 /* Set record locking info (blocking). */
+#else
+# define F_GETLK F_GETLK64 /* Get record locking info. */
+# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/
+# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */
+#endif
+
+#if __WORDSIZE == 64
+# define F_GETLK64 14 /* Get record locking info. */
+# define F_SETLK64 6 /* Set record locking info (non-blocking). */
+# define F_SETLKW64 7 /* Set record locking info (blocking). */
+#else
+# define F_GETLK64 33 /* Get record locking info. */
+# define F_SETLK64 34 /* Set record locking info (non-blocking). */
+# define F_SETLKW64 35 /* Set record locking info (blocking). */
+#endif
+
+#if defined __USE_BSD || defined __USE_UNIX98
+# define F_SETOWN 24 /* Get owner of socket (receiver of SIGIO). */
+# define F_GETOWN 23 /* Set owner of socket (receiver of SIGIO). */
+#endif
+
+#ifdef __USE_GNU
+# define F_SETSIG 10 /* Set number of signal to be sent. */
+# define F_GETSIG 11 /* Get number of signal to be sent. */
+#endif
+
+#ifdef __USE_GNU
+# define F_SETLEASE 1024 /* Set a lease. */
+# define F_GETLEASE 1025 /* Enquire what lease is active. */
+# define F_NOTIFY 1026 /* Request notfications on a directory. */
+#endif
+
+/* For F_[GET|SET]FL. */
+#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
+
+/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
+#define F_RDLCK 0 /* Read lock. */
+#define F_WRLCK 1 /* Write lock. */
+#define F_UNLCK 2 /* Remove lock. */
+
+/* For old implementation of bsd flock(). */
+#define F_EXLCK 4 /* or 3 */
+#define F_SHLCK 8 /* or 4 */
+
+#ifdef __USE_BSD
+/* Operations for bsd flock(), also used by the kernel implementation. */
+# define LOCK_SH 1 /* shared lock */
+# define LOCK_EX 2 /* exclusive lock */
+# define LOCK_NB 4 /* or'd with one of the above to prevent
+ blocking */
+# define LOCK_UN 8 /* remove lock */
+#endif
+
+#ifdef __USE_GNU
+# define LOCK_MAND 32 /* This is a mandatory flock: */
+# define LOCK_READ 64 /* ... which allows concurrent read operations. */
+# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */
+# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */
+#endif
+
+#ifdef __USE_GNU
+/* Types of directory notifications that may be requested with F_NOTIFY. */
+# define DN_ACCESS 0x00000001 /* File accessed. */
+# define DN_MODIFY 0x00000002 /* File modified. */
+# define DN_CREATE 0x00000004 /* File created. */
+# define DN_DELETE 0x00000008 /* File removed. */
+# define DN_RENAME 0x00000010 /* File renamed. */
+# define DN_ATTRIB 0x00000020 /* File changed attibutes. */
+# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */
+#endif
+
+struct flock
+ {
+ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
+ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
+#ifndef __USE_FILE_OFFSET64
+ __off_t l_start; /* Offset where the lock begins. */
+ __off_t l_len; /* Size of the locked area; zero means until EOF. */
+#if _MIPS_SIM != _ABI64
+ /* The 64-bit flock structure, used by the n64 ABI, and for 64-bit
+ fcntls in o32 and n32, never has this field. */
+ long int l_sysid;
+#endif
+#else
+ __off64_t l_start; /* Offset where the lock begins. */
+ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
+#endif
+ __pid_t l_pid; /* Process holding the lock. */
+#if ! defined __USE_FILE_OFFSET64 && _MIPS_SIM != _ABI64
+ /* The 64-bit flock structure, used by the n64 ABI, and for 64-bit
+ flock in o32 and n32, never has this field. */
+ long int pad[4];
+#endif
+ };
+typedef struct flock flock_t;
+
+#ifdef __USE_LARGEFILE64
+struct flock64
+ {
+ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
+ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
+ __off64_t l_start; /* Offset where the lock begins. */
+ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
+ __pid_t l_pid; /* Process holding the lock. */
+ };
+#endif
+
+/* Define some more compatibility macros to be backward compatible with
+ BSD systems which did not managed to hide these kernel macros. */
+#ifdef __USE_BSD
+# define FAPPEND O_APPEND
+# define FFSYNC O_FSYNC
+# define FASYNC O_ASYNC
+# define FNONBLOCK O_NONBLOCK
+# define FNDELAY O_NDELAY
+#endif /* Use BSD. */
+
+/* Advise to `posix_fadvise'. */
+#ifdef __USE_XOPEN2K
+# define POSIX_FADV_NORMAL 0 /* No further special treatment. */
+# define POSIX_FADV_RANDOM 1 /* Expect random page references. */
+# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */
+# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
+# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
+#endif
+
+
+#ifdef __USE_GNU
+/* Flags for SYNC_FILE_RANGE. */
+# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
+ in the range before performing the
+ write. */
+# define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those
+ dirty pages in the range which are
+ not presently under writeback. */
+# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
+ the range after performing the
+ write. */
+
+/* Flags for SPLICE and VMSPLICE. */
+# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
+# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing
+ (but we may still block on the fd
+ we splice from/to). */
+# define SPLICE_F_MORE 4 /* Expect more data. */
+# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */
+#endif
+
+__BEGIN_DECLS
+
+#ifdef __USE_GNU
+
+/* Provide kernel hint to read ahead. */
+extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
+ __THROW;
+
+
+#if 0
+/* Selective file content synch'ing. */
+extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
+ unsigned int __flags);
+
+
+/* Splice address range into a pipe. */
+extern int vmsplice (int __fdout, const struct iovec *__iov, size_t __count,
+ unsigned int __flags);
+
+/* Splice two files together. */
+extern int splice (int __fdin, int __fdout, size_t __len, unsigned int __flags)
+ __THROW;
+
+/* In-kernel implementation of tee for pipe buffers. */
+extern int tee (int __fdin, int __fdout, size_t __len, unsigned int __flags)
+ __THROW;
+#endif
+
+#endif
+
+__END_DECLS
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/fenv.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/fenv.h
new file mode 100644
index 0000000..24e0694
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/fenv.h
@@ -0,0 +1,77 @@
+/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _FENV_H
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+
+/* Define bits representing the exception. We use the bit positions
+ of the appropriate bits in the FPU control word. */
+enum
+ {
+ FE_INEXACT = 0x04,
+#define FE_INEXACT FE_INEXACT
+ FE_UNDERFLOW = 0x08,
+#define FE_UNDERFLOW FE_UNDERFLOW
+ FE_OVERFLOW = 0x10,
+#define FE_OVERFLOW FE_OVERFLOW
+ FE_DIVBYZERO = 0x20,
+#define FE_DIVBYZERO FE_DIVBYZERO
+ FE_INVALID = 0x40,
+#define FE_INVALID FE_INVALID
+ };
+
+#define FE_ALL_EXCEPT \
+ (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+
+/* The MIPS FPU supports all of the four defined rounding modes. We
+ use again the bit positions in the FPU control word as the values
+ for the appropriate macros. */
+enum
+ {
+ FE_TONEAREST = 0x0,
+#define FE_TONEAREST FE_TONEAREST
+ FE_TOWARDZERO = 0x1,
+#define FE_TOWARDZERO FE_TOWARDZERO
+ FE_UPWARD = 0x2,
+#define FE_UPWARD FE_UPWARD
+ FE_DOWNWARD = 0x3
+#define FE_DOWNWARD FE_DOWNWARD
+ };
+
+
+/* Type representing exception flags. */
+typedef unsigned short int fexcept_t;
+
+
+/* Type representing floating-point environment. This function corresponds
+ to the layout of the block written by the `fstenv'. */
+typedef struct
+ {
+ unsigned int __fp_control_register;
+ }
+fenv_t;
+
+/* If the default argument is used we use this value. */
+#define FE_DFL_ENV ((__const fenv_t *) -1)
+
+#ifdef __USE_GNU
+/* Floating-point environment where none of the exception is masked. */
+# define FE_NOMASK_ENV ((__const fenv_t *) -2)
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/fenvinline.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/fenvinline.h
new file mode 100644
index 0000000..42f77b5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/fenvinline.h
@@ -0,0 +1,8 @@
+/* This file provides inline versions of floating-pint environment
+ handling functions. If there were any. */
+
+#ifndef __NO_MATH_INLINES
+
+/* Here is where the code would go. */
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/getopt.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/getopt.h
new file mode 100644
index 0000000..a28d0a4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/getopt.h
@@ -0,0 +1,181 @@
+/* Declarations for getopt.
+ Copyright (C) 1989-1994,1996-1999,2001,2003,2004
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _GETOPT_H
+
+#include <features.h>
+
+#ifndef __need_getopt
+# define _GETOPT_H 1
+#endif
+
+/* If __GNU_LIBRARY__ is not already defined, either we are being used
+ standalone, or this is the first header included in the source file.
+ If we are being used with glibc, we need to include <features.h>, but
+ that does not exist if we are standalone. So: if __GNU_LIBRARY__ is
+ not defined, include <ctype.h>, which will pull in <features.h> for us
+ if it's from glibc. (Why ctype.h? It's guaranteed to exist and it
+ doesn't flood the namespace with stuff the way some other headers do.) */
+#if !defined __GNU_LIBRARY__
+# include <ctype.h>
+#endif
+
+#ifndef __THROW
+# ifndef __GNUC_PREREQ
+# define __GNUC_PREREQ(maj, min) (0)
+# endif
+# if defined __cplusplus && __GNUC_PREREQ (2,8)
+# define __THROW throw ()
+# else
+# define __THROW
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* For communication from `getopt' to the caller.
+ When `getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when `ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+extern char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to `getopt'.
+
+ On entry to `getopt', zero means this is the first call; initialize.
+
+ When `getopt' returns -1, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, `optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+extern int optind;
+
+/* Callers store zero here to inhibit the error message `getopt' prints
+ for unrecognized options. */
+
+extern int opterr;
+
+/* Set to an option character which was unrecognized. */
+
+extern int optopt;
+
+#ifndef __need_getopt
+/* Describe the long-named options requested by the application.
+ The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+ of `struct option' terminated by an element containing a name which is
+ zero.
+
+ The field `has_arg' is:
+ no_argument (or 0) if the option does not take an argument,
+ required_argument (or 1) if the option requires an argument,
+ optional_argument (or 2) if the option takes an optional argument.
+
+ If the field `flag' is not NULL, it points to a variable that is set
+ to the value given in the field `val' when the option is found, but
+ left unchanged if the option is not found.
+
+ To have a long-named option do something other than set an `int' to
+ a compiled-in constant, such as set a value from `optarg', set the
+ option's `flag' field to zero and its `val' field to a nonzero
+ value (the equivalent single-letter option character, if there is
+ one). For long options that have a zero `flag' field, `getopt'
+ returns the contents of the `val' field. */
+
+struct option
+{
+ const char *name;
+ /* has_arg can't be an enum because some compilers complain about
+ type mismatches in all the code that assumes it is an int. */
+ int has_arg;
+ int *flag;
+ int val;
+};
+
+/* Names for the values of the `has_arg' field of `struct option'. */
+
+# define no_argument 0
+# define required_argument 1
+# define optional_argument 2
+#endif /* need getopt */
+
+
+/* Get definitions and prototypes for functions to process the
+ arguments in ARGV (ARGC of them, minus the program name) for
+ options given in OPTS.
+
+ Return the option character from OPTS just read. Return -1 when
+ there are no more options. For unrecognized options, or options
+ missing arguments, `optopt' is set to the option letter, and '?' is
+ returned.
+
+ The OPTS string is a list of characters which are recognized option
+ letters, optionally followed by colons, specifying that that letter
+ takes an argument, to be placed in `optarg'.
+
+ If a letter in OPTS is followed by two colons, its argument is
+ optional. This behavior is specific to the GNU `getopt'.
+
+ The argument `--' causes premature termination of argument
+ scanning, explicitly telling `getopt' that there are no more
+ options.
+
+ If OPTS begins with `--', then non-option arguments are treated as
+ arguments to the option '\0'. This behavior is specific to the GNU
+ `getopt'. */
+
+#if defined __GNU_LIBRARY__ || defined __UCLIBC__
+/* Many other libraries have conflicting prototypes for getopt, with
+ differences in the consts, in stdlib.h. To avoid compilation
+ errors, only prototype getopt for the GNU C library. */
+extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
+ __THROW;
+#else /* not __GNU_LIBRARY__ */
+extern int getopt ();
+#endif /* __GNU_LIBRARY__ */
+
+#if defined __UCLIBC_HAS_GNU_GETOPT__ || defined __UCLIBC_HAS_GETOPT_LONG__
+#ifndef __need_getopt
+extern int getopt_long (int ___argc, char *const *___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind)
+ __THROW;
+extern int getopt_long_only (int ___argc, char *const *___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind)
+ __THROW;
+
+#endif
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Make sure we later can get all the definitions and declarations. */
+#undef __need_getopt
+
+#endif /* getopt.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/huge_val.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/huge_val.h
new file mode 100644
index 0000000..11ca11f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/huge_val.h
@@ -0,0 +1,55 @@
+/* `HUGE_VAL' constant for IEEE 754 machines (where it is infinity).
+ Used by <stdlib.h> and <math.h> functions for overflow.
+ Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000, 2004
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MATH_H
+# error "Never use <bits/huge_val.h> directly; include <math.h> instead."
+#endif
+
+/* IEEE positive infinity (-HUGE_VAL is negative infinity). */
+
+#if __GNUC_PREREQ(3,3)
+# define HUGE_VAL (__builtin_huge_val())
+#elif __GNUC_PREREQ(2,96)
+# define HUGE_VAL (__extension__ 0x1.0p2047)
+#elif defined __GNUC__
+
+# define HUGE_VAL \
+ (__extension__ \
+ ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \
+ { __l: 0x7ff0000000000000ULL }).__d)
+
+#else /* not GCC */
+
+# include <endian.h>
+
+typedef union { unsigned char __c[8]; double __d; } __huge_val_t;
+
+# if __BYTE_ORDER == __BIG_ENDIAN
+# define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
+# endif
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+# define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
+# endif
+
+static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
+# define HUGE_VAL (__huge_val.__d)
+
+#endif /* GCC. */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/huge_valf.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/huge_valf.h
new file mode 100644
index 0000000..1785342
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/huge_valf.h
@@ -0,0 +1,53 @@
+/* `HUGE_VALF' constant for IEEE 754 machines (where it is infinity).
+ Used by <stdlib.h> and <math.h> functions for overflow.
+ Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000, 2004
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MATH_H
+# error "Never use <bits/huge_valf.h> directly; include <math.h> instead."
+#endif
+
+/* IEEE positive infinity (-HUGE_VAL is negative infinity). */
+
+#if __GNUC_PREREQ(3,3)
+# define HUGE_VALF (__builtin_huge_valf())
+#elif __GNUC_PREREQ(2,96)
+# define HUGE_VALF (__extension__ 0x1.0p255f)
+#elif defined __GNUC__
+
+# define HUGE_VALF \
+ (__extension__ \
+ ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \
+ { __l: 0x7f800000UL }).__d)
+
+#else /* not GCC */
+
+typedef union { unsigned char __c[4]; float __f; } __huge_valf_t;
+
+# if __BYTE_ORDER == __BIG_ENDIAN
+# define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 }
+# endif
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+# define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f }
+# endif
+
+static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes };
+# define HUGE_VALF (__huge_valf.__f)
+
+#endif /* GCC. */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/huge_vall.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/huge_vall.h
new file mode 100644
index 0000000..d5e8e22
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/huge_vall.h
@@ -0,0 +1,29 @@
+/* Default `HUGE_VALL' constant.
+ Used by <stdlib.h> and <math.h> functions for overflow.
+ Copyright (C) 1992, 1996, 1997, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MATH_H
+# error "Never use <bits/huge_vall.h> directly; include <math.h> instead."
+#endif
+
+#if __GNUC_PREREQ(3,3)
+# define HUGE_VALL (__builtin_huge_vall())
+#else
+# define HUGE_VALL ((long double) HUGE_VAL)
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/in.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/in.h
new file mode 100644
index 0000000..6880a2e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/in.h
@@ -0,0 +1,170 @@
+/* Copyright (C) 1991-1999, 2000, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Linux version. */
+
+#ifndef _NETINET_IN_H
+# error "Never use <bits/in.h> directly; include <netinet/in.h> instead."
+#endif
+
+/* Options for use with `getsockopt' and `setsockopt' at the IP level.
+ The first word in the comment at the right is the data type used;
+ "bool" means a boolean value stored in an `int'. */
+#define IP_OPTIONS 4 /* ip_opts; IP per-packet options. */
+#define IP_HDRINCL 3 /* int; Header is included with data. */
+#define IP_TOS 1 /* int; IP type of service and precedence. */
+#define IP_TTL 2 /* int; IP time to live. */
+#define IP_RECVOPTS 6 /* bool; Receive all IP options w/datagram. */
+/* For BSD compatibility. */
+#define IP_RECVRETOPTS IP_RETOPTS /* bool; Receive IP options for response. */
+#define IP_RETOPTS 7 /* ip_opts; Set/get IP per-packet options. */
+#define IP_MULTICAST_IF 32 /* in_addr; set/get IP multicast i/f */
+#define IP_MULTICAST_TTL 33 /* u_char; set/get IP multicast ttl */
+#define IP_MULTICAST_LOOP 34 /* i_char; set/get IP multicast loopback */
+#define IP_ADD_MEMBERSHIP 35 /* ip_mreq; add an IP group membership */
+#define IP_DROP_MEMBERSHIP 36 /* ip_mreq; drop an IP group membership */
+#define IP_UNBLOCK_SOURCE 37 /* ip_mreq_source: unblock data from source */
+#define IP_BLOCK_SOURCE 38 /* ip_mreq_source: block data from source */
+#define IP_ADD_SOURCE_MEMBERSHIP 39 /* ip_mreq_source: join source group */
+#define IP_DROP_SOURCE_MEMBERSHIP 40 /* ip_mreq_source: leave source group */
+#define IP_MSFILTER 41
+#define MCAST_JOIN_GROUP 42 /* group_req: join any-source group */
+#define MCAST_BLOCK_SOURCE 43 /* group_source_req: block from given group */
+#define MCAST_UNBLOCK_SOURCE 44 /* group_source_req: unblock from given group*/
+#define MCAST_LEAVE_GROUP 45 /* group_req: leave any-source group */
+#define MCAST_JOIN_SOURCE_GROUP 46 /* group_source_req: join source-spec gr */
+#define MCAST_LEAVE_SOURCE_GROUP 47 /* group_source_req: leave source-spec gr*/
+#define MCAST_MSFILTER 48
+
+#define MCAST_EXCLUDE 0
+#define MCAST_INCLUDE 1
+
+#define IP_ROUTER_ALERT 5 /* bool */
+#define IP_PKTINFO 8 /* bool */
+#define IP_PKTOPTIONS 9
+#define IP_PMTUDISC 10 /* obsolete name? */
+#define IP_MTU_DISCOVER 10 /* int; see below */
+#define IP_RECVERR 11 /* bool */
+#define IP_RECVTTL 12 /* bool */
+#define IP_RECVTOS 13 /* bool */
+
+
+/* IP_MTU_DISCOVER arguments. */
+#define IP_PMTUDISC_DONT 0 /* Never send DF frames. */
+#define IP_PMTUDISC_WANT 1 /* Use per route hints. */
+#define IP_PMTUDISC_DO 2 /* Always DF. */
+
+/* To select the IP level. */
+#define SOL_IP 0
+
+#define IP_DEFAULT_MULTICAST_TTL 1
+#define IP_DEFAULT_MULTICAST_LOOP 1
+#define IP_MAX_MEMBERSHIPS 20
+
+/* Structure used to describe IP options for IP_OPTIONS and IP_RETOPTS.
+ The `ip_dst' field is used for the first-hop gateway when using a
+ source route (this gets put into the header proper). */
+struct ip_opts
+ {
+ struct in_addr ip_dst; /* First hop; zero without source route. */
+ char ip_opts[40]; /* Actually variable in size. */
+ };
+
+/* Like `struct ip_mreq' but including interface specification by index. */
+struct ip_mreqn
+ {
+ struct in_addr imr_multiaddr; /* IP multicast address of group */
+ struct in_addr imr_address; /* local IP address of interface */
+ int imr_ifindex; /* Interface index */
+ };
+
+/* Structure used for IP_PKTINFO. */
+struct in_pktinfo
+ {
+ int ipi_ifindex; /* Interface index */
+ struct in_addr ipi_spec_dst; /* Routing destination address */
+ struct in_addr ipi_addr; /* Header destination address */
+ };
+
+/* Options for use with `getsockopt' and `setsockopt' at the IPv6 level.
+ The first word in the comment at the right is the data type used;
+ "bool" means a boolean value stored in an `int'. */
+#define IPV6_ADDRFORM 1
+#define IPV6_2292PKTINFO 2
+#define IPV6_2292HOPOPTS 3
+#define IPV6_2292DSTOPTS 4
+#define IPV6_2292RTHDR 5
+#define IPV6_2292PKTOPTIONS 6
+#define IPV6_CHECKSUM 7
+#define IPV6_2292HOPLIMIT 8
+
+#define SCM_SRCRT IPV6_RXSRCRT
+
+#define IPV6_NEXTHOP 9
+#define IPV6_AUTHHDR 10
+#define IPV6_UNICAST_HOPS 16
+#define IPV6_MULTICAST_IF 17
+#define IPV6_MULTICAST_HOPS 18
+#define IPV6_MULTICAST_LOOP 19
+#define IPV6_JOIN_GROUP 20
+#define IPV6_LEAVE_GROUP 21
+#define IPV6_ROUTER_ALERT 22
+#define IPV6_MTU_DISCOVER 23
+#define IPV6_MTU 24
+#define IPV6_RECVERR 25
+#define IPV6_V6ONLY 26
+#define IPV6_JOIN_ANYCAST 27
+#define IPV6_LEAVE_ANYCAST 28
+#define IPV6_IPSEC_POLICY 34
+#define IPV6_XFRM_POLICY 35
+
+#define IPV6_RECVPKTINFO 49
+#define IPV6_PKTINFO 50
+#define IPV6_RECVHOPLIMIT 51
+#define IPV6_HOPLIMIT 52
+#define IPV6_RECVHOPOPTS 53
+#define IPV6_HOPOPTS 54
+#define IPV6_RTHDRDSTOPTS 55
+#define IPV6_RECVRTHDR 56
+#define IPV6_RTHDR 57
+#define IPV6_RECVDSTOPTS 58
+#define IPV6_DSTOPTS 59
+
+#define IPV6_RECVTCLASS 66
+#define IPV6_TCLASS 67
+
+/* Obsolete synonyms for the above. */
+#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
+#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
+#define IPV6_RXHOPOPTS IPV6_HOPOPTS
+#define IPV6_RXDSTOPTS IPV6_DSTOPTS
+
+/* IPV6_MTU_DISCOVER values. */
+#define IPV6_PMTUDISC_DONT 0 /* Never send DF frames. */
+#define IPV6_PMTUDISC_WANT 1 /* Use per route hints. */
+#define IPV6_PMTUDISC_DO 2 /* Always DF. */
+
+/* Socket level values for IPv6. */
+#define SOL_IPV6 41
+#define SOL_ICMPV6 58
+
+/* Routing header options for IPv6. */
+#define IPV6_RTHDR_LOOSE 0 /* Hop doesn't need to be neighbour. */
+#define IPV6_RTHDR_STRICT 1 /* Hop must be a neighbour. */
+
+#define IPV6_RTHDR_TYPE_0 0 /* IPv6 Routing header type 0. */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/inf.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/inf.h
new file mode 100644
index 0000000..1619f75
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/inf.h
@@ -0,0 +1,30 @@
+/* `INFINITY' constant for IEEE 754 machines.
+ Copyright (C) 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MATH_H
+# error "Never use <bits/inf.h> directly; include <math.h> instead."
+#endif
+
+/* IEEE positive infinity. */
+
+#if __GNUC_PREREQ(3,3)
+# define INFINITY (__builtin_inff())
+#else
+# define INFINITY HUGE_VALF
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/initspin.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/initspin.h
new file mode 100644
index 0000000..a19ec07
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/initspin.h
@@ -0,0 +1,28 @@
+/* Generic definitions for spinlock initializers.
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* Initial value of a spinlock. Most platforms should use zero,
+ unless they only implement a "test and clear" operation instead of
+ the usual "test and set". */
+#define __LT_SPINLOCK_INIT 0
+
+/* Macros for lock initializers, using the above definition. */
+#define __LOCK_INITIALIZER { 0, __LT_SPINLOCK_INIT }
+#define __ALT_LOCK_INITIALIZER { 0, __LT_SPINLOCK_INIT }
+#define __ATOMIC_INITIALIZER { 0, __LT_SPINLOCK_INIT }
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/ioctl-types.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/ioctl-types.h
new file mode 100644
index 0000000..a8dcf24
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/ioctl-types.h
@@ -0,0 +1,76 @@
+/* Structure types for pre-termios terminal ioctls. Linux/MIPS version.
+ Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_IOCTL_H
+# error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead."
+#endif
+
+/* Get definition of constants for use with `ioctl'. */
+#include <asm/ioctls.h>
+
+struct winsize
+ {
+ unsigned short int ws_row;
+ unsigned short int ws_col;
+ unsigned short int ws_xpixel;
+ unsigned short int ws_ypixel;
+ };
+
+#define NCC 8
+struct termio
+ {
+ unsigned short int c_iflag; /* input mode flags */
+ unsigned short int c_oflag; /* output mode flags */
+ unsigned short int c_cflag; /* control mode flags */
+ unsigned short int c_lflag; /* local mode flags */
+ char c_line; /* line discipline */
+ /* Yes, this is really NCCS. */
+ unsigned char c_cc[32 /* NCCS */]; /* control characters */
+ };
+
+/* modem lines */
+#define TIOCM_LE 0x001 /* line enable */
+#define TIOCM_DTR 0x002 /* data terminal ready */
+#define TIOCM_RTS 0x004 /* request to send */
+#define TIOCM_ST 0x010 /* secondary transmit */
+#define TIOCM_SR 0x020 /* secondary receive */
+#define TIOCM_CTS 0x040 /* clear to send */
+#define TIOCM_CAR 0x100 /* carrier detect */
+#define TIOCM_CD TIOCM_CAR
+#define TIOCM_RNG 0x200 /* ring */
+#define TIOCM_RI TIOCM_RNG
+#define TIOCM_DSR 0x400 /* data set ready */
+
+/* line disciplines */
+#define N_TTY 0
+#define N_SLIP 1
+#define N_MOUSE 2
+#define N_PPP 3
+#define N_STRIP 4
+#define N_AX25 5
+#define N_X25 6 /* X.25 async */
+#define N_6PACK 7
+#define N_MASC 8 /* Mobitex module */
+#define N_R3964 9 /* Simatic R3964 module */
+#define N_PROFIBUS_FDL 10 /* Profibus */
+#define N_IRDA 11 /* Linux IR */
+#define N_SMSBLOCK 12 /* SMS block mode */
+#define N_HDLC 13 /* synchronous HDLC */
+#define N_SYNC_PPP 14 /* synchronous PPP */
+#define N_HCI 15 /* Bluetooth HCI UART */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/ioctls.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/ioctls.h
new file mode 100644
index 0000000..11bb4c4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/ioctls.h
@@ -0,0 +1,109 @@
+/* Copyright (C) 1996, 1997, 1998, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_IOCTL_H
+# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."
+#endif
+
+/* Use the definitions from the kernel header files. */
+#include <asm/ioctls.h>
+
+/* Routing table calls. */
+#define SIOCADDRT 0x890B /* add routing table entry */
+#define SIOCDELRT 0x890C /* delete routing table entry */
+#define SIOCRTMSG 0x890D /* call to routing system */
+
+/* Socket configuration controls. */
+#define SIOCGIFNAME 0x8910 /* get iface name */
+#define SIOCSIFLINK 0x8911 /* set iface channel */
+#define SIOCGIFCONF 0x8912 /* get iface list */
+#define SIOCGIFFLAGS 0x8913 /* get flags */
+#define SIOCSIFFLAGS 0x8914 /* set flags */
+#define SIOCGIFADDR 0x8915 /* get PA address */
+#define SIOCSIFADDR 0x8916 /* set PA address */
+#define SIOCGIFDSTADDR 0x8917 /* get remote PA address */
+#define SIOCSIFDSTADDR 0x8918 /* set remote PA address */
+#define SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */
+#define SIOCSIFBRDADDR 0x891a /* set broadcast PA address */
+#define SIOCGIFNETMASK 0x891b /* get network PA mask */
+#define SIOCSIFNETMASK 0x891c /* set network PA mask */
+#define SIOCGIFMETRIC 0x891d /* get metric */
+#define SIOCSIFMETRIC 0x891e /* set metric */
+#define SIOCGIFMEM 0x891f /* get memory address (BSD) */
+#define SIOCSIFMEM 0x8920 /* set memory address (BSD) */
+#define SIOCGIFMTU 0x8921 /* get MTU size */
+#define SIOCSIFMTU 0x8922 /* set MTU size */
+#define SIOCSIFNAME 0x8923 /* set interface name */
+#define SIOCSIFHWADDR 0x8924 /* set hardware address */
+#define SIOCGIFENCAP 0x8925 /* get/set encapsulations */
+#define SIOCSIFENCAP 0x8926
+#define SIOCGIFHWADDR 0x8927 /* Get hardware address */
+#define SIOCGIFSLAVE 0x8929 /* Driver slaving support */
+#define SIOCSIFSLAVE 0x8930
+#define SIOCADDMULTI 0x8931 /* Multicast address lists */
+#define SIOCDELMULTI 0x8932
+#define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */
+#define SIOGIFINDEX SIOCGIFINDEX /* misprint compatibility :-) */
+#define SIOCSIFPFLAGS 0x8934 /* set/get extended flags set */
+#define SIOCGIFPFLAGS 0x8935
+#define SIOCDIFADDR 0x8936 /* delete PA address */
+#define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */
+#define SIOCGIFCOUNT 0x8938 /* get number of devices */
+
+#define SIOCGIFBR 0x8940 /* Bridging support */
+#define SIOCSIFBR 0x8941 /* Set bridging options */
+
+#define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */
+#define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */
+
+
+/* ARP cache control calls. */
+ /* 0x8950 - 0x8952 * obsolete calls, don't re-use */
+#define SIOCDARP 0x8953 /* delete ARP table entry */
+#define SIOCGARP 0x8954 /* get ARP table entry */
+#define SIOCSARP 0x8955 /* set ARP table entry */
+
+/* RARP cache control calls. */
+#define SIOCDRARP 0x8960 /* delete RARP table entry */
+#define SIOCGRARP 0x8961 /* get RARP table entry */
+#define SIOCSRARP 0x8962 /* set RARP table entry */
+
+/* Driver configuration calls */
+
+#define SIOCGIFMAP 0x8970 /* Get device parameters */
+#define SIOCSIFMAP 0x8971 /* Set device parameters */
+
+/* DLCI configuration calls */
+
+#define SIOCADDDLCI 0x8980 /* Create new DLCI device */
+#define SIOCDELDLCI 0x8981 /* Delete DLCI device */
+
+/* Device private ioctl calls. */
+
+/* These 16 ioctls are available to devices via the do_ioctl() device
+ vector. Each device should include this file and redefine these
+ names as their own. Because these are device dependent it is a good
+ idea _NOT_ to issue them to random objects and hope. */
+
+#define SIOCDEVPRIVATE 0x89F0 /* to 89FF */
+
+/*
+ * These 16 ioctl calls are protocol private
+ */
+
+#define SIOCPROTOPRIVATE 0x89E0 /* to 89EF */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/ipc.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/ipc.h
new file mode 100644
index 0000000..1f629ce
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/ipc.h
@@ -0,0 +1,55 @@
+/* Copyright (C) 1995, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_IPC_H
+# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Mode bits for `msgget', `semget', and `shmget'. */
+#define IPC_CREAT 01000 /* Create key if key does not exist. */
+#define IPC_EXCL 02000 /* Fail if key exists. */
+#define IPC_NOWAIT 04000 /* Return error on wait. */
+
+/* Control commands for `msgctl', `semctl', and `shmctl'. */
+#define IPC_RMID 0 /* Remove identifier. */
+#define IPC_SET 1 /* Set `ipc_perm' options. */
+#define IPC_STAT 2 /* Get `ipc_perm' options. */
+#ifdef __USE_GNU
+# define IPC_INFO 3 /* See ipcs. */
+#endif
+
+/* Special key values. */
+#define IPC_PRIVATE ((__key_t) 0) /* Private key. */
+
+
+/* Data structure used to pass permission information to IPC operations. */
+struct ipc_perm
+ {
+ __key_t __key; /* Key. */
+ unsigned int uid; /* Owner's user ID. */
+ unsigned int gid; /* Owner's group ID. */
+ unsigned int cuid; /* Creator's user ID. */
+ unsigned int cgid; /* Creator's group ID. */
+ unsigned int mode; /* Read/write permission. */
+ unsigned short int __seq; /* Sequence number. */
+ unsigned short int __pad1;
+ unsigned long int __unused1;
+ unsigned long int __unused2;
+};
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/kernel_types.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/kernel_types.h
new file mode 100644
index 0000000..b7e61bd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/kernel_types.h
@@ -0,0 +1,79 @@
+/* Note that we use the exact same include guard #define names
+ * as asm/posix_types.h. This will avoid gratuitous conflicts
+ * with the posix_types.h kernel header, and will ensure that
+ * our private content, and not the kernel header, will win.
+ * -Erik
+ */
+#ifndef _ASM_POSIX_TYPES_H
+#define _ASM_POSIX_TYPES_H
+
+# if __WORDSIZE == 64
+typedef unsigned int __kernel_dev_t;
+typedef unsigned long __kernel_ino_t;
+typedef unsigned int __kernel_mode_t;
+typedef unsigned int __kernel_nlink_t;
+typedef long __kernel_off_t;
+typedef int __kernel_pid_t;
+typedef long int __kernel_ipc_pid_t;
+typedef int __kernel_uid_t;
+typedef int __kernel_gid_t;
+typedef unsigned long __kernel_size_t;
+typedef long __kernel_ssize_t;
+typedef long __kernel_ptrdiff_t;
+typedef long __kernel_time_t;
+typedef long __kernel_suseconds_t;
+typedef long __kernel_clock_t;
+typedef long __kernel_daddr_t;
+typedef char * __kernel_caddr_t;
+typedef unsigned short __kernel_uid16_t;
+typedef unsigned short __kernel_gid16_t;
+typedef int __kernel_uid32_t;
+typedef int __kernel_gid32_t;
+typedef __kernel_uid_t __kernel_old_uid_t;
+typedef __kernel_gid_t __kernel_old_gid_t;
+typedef __kernel_dev_t __kernel_old_dev_t;
+typedef long long __kernel_loff_t;
+#else
+typedef unsigned int __kernel_dev_t;
+typedef unsigned long __kernel_ino_t;
+typedef unsigned int __kernel_mode_t;
+
+/* Linux 2.4.20 include/asm-mips/posix_types.h has this:
+but apparently that is an error?!?!?
+*/
+#if 0
+typedef int __kernel_nlink_t;
+#else
+/* So use this instead */
+typedef unsigned long __kernel_nlink_t;
+#endif
+
+typedef long __kernel_off_t;
+typedef int __kernel_pid_t;
+typedef long int __kernel_ipc_pid_t;
+typedef int __kernel_uid_t;
+typedef int __kernel_gid_t;
+typedef unsigned int __kernel_size_t;
+typedef int __kernel_ssize_t;
+typedef int __kernel_ptrdiff_t;
+typedef long __kernel_time_t;
+typedef long __kernel_suseconds_t;
+typedef long __kernel_clock_t;
+typedef long __kernel_daddr_t;
+typedef char * __kernel_caddr_t;
+typedef unsigned short __kernel_uid16_t;
+typedef unsigned short __kernel_gid16_t;
+typedef int __kernel_uid32_t;
+typedef int __kernel_gid32_t;
+typedef __kernel_uid_t __kernel_old_uid_t;
+typedef __kernel_gid_t __kernel_old_gid_t;
+typedef __kernel_dev_t __kernel_old_dev_t;
+typedef long long __kernel_loff_t;
+#endif
+
+
+typedef struct {
+ long val[2];
+} __kernel_fsid_t;
+
+#endif /* _ASM_POSIX_TYPES_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/local_lim.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/local_lim.h
new file mode 100644
index 0000000..023ebf3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/local_lim.h
@@ -0,0 +1,87 @@
+/* Minimum guaranteed maximum values for system limits. Linux version.
+ Copyright (C) 1993-1998,2000,2002,2003,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* The kernel header pollutes the namespace with the NR_OPEN symbol
+ and defines LINK_MAX although filesystems have different maxima. A
+ similar thing is true for OPEN_MAX: the limit can be changed at
+ runtime and therefore the macro must not be defined. Remove this
+ after including the header if necessary. */
+#ifndef NR_OPEN
+# define __undef_NR_OPEN
+#endif
+#ifndef LINK_MAX
+# define __undef_LINK_MAX
+#endif
+#ifndef OPEN_MAX
+# define __undef_OPEN_MAX
+#endif
+
+/* The kernel sources contain a file with all the needed information. */
+#include <linux/limits.h>
+
+/* Have to remove NR_OPEN? */
+#ifdef __undef_NR_OPEN
+# undef NR_OPEN
+# undef __undef_NR_OPEN
+#endif
+/* Have to remove LINK_MAX? */
+#ifdef __undef_LINK_MAX
+# undef LINK_MAX
+# undef __undef_LINK_MAX
+#endif
+/* Have to remove OPEN_MAX? */
+#ifdef __undef_OPEN_MAX
+# undef OPEN_MAX
+# undef __undef_OPEN_MAX
+#endif
+
+/* The number of data keys per process. */
+#define _POSIX_THREAD_KEYS_MAX 128
+/* This is the value this implementation supports. */
+#define PTHREAD_KEYS_MAX 1024
+
+/* Controlling the iterations of destructors for thread-specific data. */
+#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
+/* Number of iterations this implementation does. */
+#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
+
+/* The number of threads per process. */
+#define _POSIX_THREAD_THREADS_MAX 64
+
+/* Maximum amount by which a process can descrease its asynchronous I/O
+ priority level. */
+#define AIO_PRIO_DELTA_MAX 20
+
+/* Minimum size for a thread. We are free to choose a reasonable value. */
+#define PTHREAD_STACK_MIN 16384
+
+/* Maximum number of timer expiration overruns. */
+#define DELAYTIMER_MAX 2147483647
+
+/* Maximum tty name length. */
+#define TTY_NAME_MAX 32
+
+/* Maximum login name length. This is arbitrary. */
+#define LOGIN_NAME_MAX 256
+
+/* Maximum host name length. */
+#define HOST_NAME_MAX 64
+
+/* Maximum message queue priority level. */
+#define MQ_PRIO_MAX 32768
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/locale.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/locale.h
new file mode 100644
index 0000000..5d51783
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/locale.h
@@ -0,0 +1,46 @@
+/* Definition of locale category symbol values.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if !defined _LOCALE_H && !defined _LANGINFO_H
+# error "Never use <bits/locale.h> directly; include <locale.h> instead."
+#endif
+
+#ifndef _BITS_LOCALE_H
+#define _BITS_LOCALE_H 1
+
+enum
+{
+ __LC_CTYPE = 0,
+ __LC_NUMERIC = 1,
+ __LC_TIME = 2,
+ __LC_COLLATE = 3,
+ __LC_MONETARY = 4,
+ __LC_MESSAGES = 5,
+ __LC_ALL = 6,
+#if 0
+ __LC_PAPER = 7,
+ __LC_NAME = 8,
+ __LC_ADDRESS = 9,
+ __LC_TELEPHONE = 10,
+ __LC_MEASUREMENT = 11,
+ __LC_IDENTIFICATION = 12
+#endif
+};
+
+#endif /* bits/locale.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/mathcalls.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/mathcalls.h
new file mode 100644
index 0000000..c020072
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/mathcalls.h
@@ -0,0 +1,365 @@
+/* Prototype declarations for math functions; helper file for <math.h>.
+ Copyright (C) 1996-2002, 2003, 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* NOTE: Because of the special way this file is used by <math.h>, this
+ file must NOT be protected from multiple inclusion as header files
+ usually are.
+
+ This file provides prototype declarations for the math functions.
+ Most functions are declared using the macro:
+
+ __MATHCALL (NAME,[_r], (ARGS...));
+
+ This means there is a function `NAME' returning `double' and a function
+ `NAMEf' returning `float'. Each place `_Mdouble_' appears in the
+ prototype, that is actually `double' in the prototype for `NAME' and
+ `float' in the prototype for `NAMEf'. Reentrant variant functions are
+ called `NAME_r' and `NAMEf_r'.
+
+ Functions returning other types like `int' are declared using the macro:
+
+ __MATHDECL (TYPE, NAME,[_r], (ARGS...));
+
+ This is just like __MATHCALL but for a function returning `TYPE'
+ instead of `_Mdouble_'. In all of these cases, there is still
+ both a `NAME' and a `NAMEf' that takes `float' arguments.
+
+ Note that there must be no whitespace before the argument passed for
+ NAME, to make token pasting work with -traditional. */
+
+#ifndef _MATH_H
+# error "Never include <bits/mathcalls.h> directly; include <math.h> instead."
+#endif
+
+
+/* Trigonometric functions. */
+
+_Mdouble_BEGIN_NAMESPACE
+/* Arc cosine of X. */
+__MATHCALL (acos,, (_Mdouble_ __x));
+/* Arc sine of X. */
+__MATHCALL (asin,, (_Mdouble_ __x));
+/* Arc tangent of X. */
+__MATHCALL (atan,, (_Mdouble_ __x));
+/* Arc tangent of Y/X. */
+__MATHCALL (atan2,, (_Mdouble_ __y, _Mdouble_ __x));
+
+/* Cosine of X. */
+__MATHCALL (cos,, (_Mdouble_ __x));
+/* Sine of X. */
+__MATHCALL (sin,, (_Mdouble_ __x));
+/* Tangent of X. */
+__MATHCALL (tan,, (_Mdouble_ __x));
+
+/* Hyperbolic functions. */
+
+/* Hyperbolic cosine of X. */
+__MATHCALL (cosh,, (_Mdouble_ __x));
+/* Hyperbolic sine of X. */
+__MATHCALL (sinh,, (_Mdouble_ __x));
+/* Hyperbolic tangent of X. */
+__MATHCALL (tanh,, (_Mdouble_ __x));
+_Mdouble_END_NAMESPACE
+
+#if 0 /*def __USE_GNU*/
+/* Cosine and sine of X. */
+__MATHDECL (void,sincos,,
+ (_Mdouble_ __x, _Mdouble_ *__sinx, _Mdouble_ *__cosx));
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Hyperbolic arc cosine of X. */
+__MATHCALL (acosh,, (_Mdouble_ __x));
+/* Hyperbolic arc sine of X. */
+__MATHCALL (asinh,, (_Mdouble_ __x));
+/* Hyperbolic arc tangent of X. */
+__MATHCALL (atanh,, (_Mdouble_ __x));
+__END_NAMESPACE_C99
+#endif
+
+/* Exponential and logarithmic functions. */
+
+_Mdouble_BEGIN_NAMESPACE
+/* Exponential function of X. */
+__MATHCALL (exp,, (_Mdouble_ __x));
+
+/* Break VALUE into a normalized fraction and an integral power of 2. */
+__MATHCALL (frexp,, (_Mdouble_ __x, int *__exponent));
+
+/* X times (two to the EXP power). */
+__MATHCALL (ldexp,, (_Mdouble_ __x, int __exponent));
+
+/* Natural logarithm of X. */
+__MATHCALL (log,, (_Mdouble_ __x));
+
+/* Base-ten logarithm of X. */
+__MATHCALL (log10,, (_Mdouble_ __x));
+
+/* Break VALUE into integral and fractional parts. */
+__MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr));
+_Mdouble_END_NAMESPACE
+
+#if 0 /*def __USE_GNU*/
+/* A function missing in all standards: compute exponent to base ten. */
+__MATHCALL (exp10,, (_Mdouble_ __x));
+/* Another name occasionally used. */
+__MATHCALL (pow10,, (_Mdouble_ __x));
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return exp(X) - 1. */
+__MATHCALL (expm1,, (_Mdouble_ __x));
+
+/* Return log(1 + X). */
+__MATHCALL (log1p,, (_Mdouble_ __x));
+
+/* Return the base 2 signed integral exponent of X. */
+__MATHCALL (logb,, (_Mdouble_ __x));
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Compute base-2 exponential of X. */
+__MATHCALL (exp2,, (_Mdouble_ __x));
+
+/* Compute base-2 logarithm of X. */
+__MATHCALL (log2,, (_Mdouble_ __x));
+__END_NAMESPACE_C99
+#endif
+
+
+/* Power functions. */
+
+_Mdouble_BEGIN_NAMESPACE
+/* Return X to the Y power. */
+__MATHCALL (pow,, (_Mdouble_ __x, _Mdouble_ __y));
+
+/* Return the square root of X. */
+__MATHCALL (sqrt,, (_Mdouble_ __x));
+_Mdouble_END_NAMESPACE
+
+#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return `sqrt(X*X + Y*Y)'. */
+__MATHCALL (hypot,, (_Mdouble_ __x, _Mdouble_ __y));
+__END_NAMESPACE_C99
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return the cube root of X. */
+__MATHCALL (cbrt,, (_Mdouble_ __x));
+__END_NAMESPACE_C99
+#endif
+
+
+/* Nearest integer, absolute value, and remainder functions. */
+
+_Mdouble_BEGIN_NAMESPACE
+/* Smallest integral value not less than X. */
+__MATHCALLX (ceil,, (_Mdouble_ __x), (__const__));
+
+/* Absolute value of X. */
+__MATHCALLX (fabs,, (_Mdouble_ __x), (__const__));
+
+/* Largest integer not greater than X. */
+__MATHCALLX (floor,, (_Mdouble_ __x), (__const__));
+
+/* Floating-point modulo remainder of X/Y. */
+__MATHCALL (fmod,, (_Mdouble_ __x, _Mdouble_ __y));
+
+
+/* Return 0 if VALUE is finite or NaN, +1 if it
+ is +Infinity, -1 if it is -Infinity. */
+__MATHDECL_1 (int,__isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
+
+/* Return nonzero if VALUE is finite and not NaN. */
+__MATHDECL_1 (int,__finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
+_Mdouble_END_NAMESPACE
+
+#ifdef __USE_MISC
+/* Return 0 if VALUE is finite or NaN, +1 if it
+ is +Infinity, -1 if it is -Infinity. */
+__MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
+
+/* Return nonzero if VALUE is finite and not NaN. */
+__MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
+
+/* Return the remainder of X/Y. */
+__MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y));
+
+
+/* Return the fractional part of X after dividing out `ilogb (X)'. */
+__MATHCALL (significand,, (_Mdouble_ __x));
+#endif /* Use misc. */
+
+#if defined __USE_MISC || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return X with its signed changed to Y's. */
+__MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return representation of NaN for double type. */
+__MATHCALLX (nan,, (__const char *__tagb), (__const__));
+__END_NAMESPACE_C99
+#endif
+
+
+/* Return nonzero if VALUE is not a number. */
+__MATHDECL_1 (int,__isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));
+
+#if defined __USE_MISC || defined __USE_XOPEN
+/* Return nonzero if VALUE is not a number. */
+__MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));
+
+/* Bessel functions. */
+__MATHCALL (j0,, (_Mdouble_));
+__MATHCALL (j1,, (_Mdouble_));
+__MATHCALL (jn,, (int, _Mdouble_));
+__MATHCALL (y0,, (_Mdouble_));
+__MATHCALL (y1,, (_Mdouble_));
+__MATHCALL (yn,, (int, _Mdouble_));
+#endif
+
+
+#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Error and gamma functions. */
+__MATHCALL (erf,, (_Mdouble_));
+__MATHCALL (erfc,, (_Mdouble_));
+__MATHCALL (lgamma,, (_Mdouble_));
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* True gamma function. */
+__MATHCALL (tgamma,, (_Mdouble_));
+__END_NAMESPACE_C99
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN
+/* Obsolete alias for `lgamma'. */
+__MATHCALL (gamma,, (_Mdouble_));
+#endif
+
+#ifdef __USE_MISC
+/* Reentrant version of lgamma. This function uses the global variable
+ `signgam'. The reentrant version instead takes a pointer and stores
+ the value through it. */
+__MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp));
+#endif
+
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return the integer nearest X in the direction of the
+ prevailing rounding mode. */
+__MATHCALL (rint,, (_Mdouble_ __x));
+
+/* Return X + epsilon if X < Y, X - epsilon if X > Y. */
+__MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
+# if defined __USE_ISOC99 && !defined __LDBL_COMPAT
+__MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__));
+# endif
+
+/* Return the remainder of integer divison X / Y with infinite precision. */
+__MATHCALL (remainder,, (_Mdouble_ __x, _Mdouble_ __y));
+
+# if defined __USE_MISC || defined __USE_ISOC99
+/* Return X times (2 to the Nth power). */
+__MATHCALL (scalbn,, (_Mdouble_ __x, int __n));
+# endif
+
+/* Return the binary exponent of X, which must be nonzero. */
+__MATHDECL (int,ilogb,, (_Mdouble_ __x));
+#endif
+
+#ifdef __USE_ISOC99
+/* Return X times (2 to the Nth power). */
+__MATHCALL (scalbln,, (_Mdouble_ __x, long int __n));
+
+/* Round X to integral value in floating-point format using current
+ rounding direction, but do not raise inexact exception. */
+__MATHCALL (nearbyint,, (_Mdouble_ __x));
+
+/* Round X to nearest integral value, rounding halfway cases away from
+ zero. */
+__MATHCALLX (round,, (_Mdouble_ __x), (__const__));
+
+/* Round X to the integral value in floating-point format nearest but
+ not larger in magnitude. */
+__MATHCALLX (trunc,, (_Mdouble_ __x), (__const__));
+
+/* Compute remainder of X and Y and put in *QUO a value with sign of x/y
+ and magnitude congruent `mod 2^n' to the magnitude of the integral
+ quotient x/y, with n >= 3. */
+__MATHCALL (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo));
+
+
+/* Conversion functions. */
+
+/* Round X to nearest integral value according to current rounding
+ direction. */
+__MATHDECL (long int,lrint,, (_Mdouble_ __x));
+__MATHDECL (long long int,llrint,, (_Mdouble_ __x));
+
+/* Round X to nearest integral value, rounding halfway cases away from
+ zero. */
+__MATHDECL (long int,lround,, (_Mdouble_ __x));
+__MATHDECL (long long int,llround,, (_Mdouble_ __x));
+
+
+/* Return positive difference between X and Y. */
+__MATHCALL (fdim,, (_Mdouble_ __x, _Mdouble_ __y));
+
+/* Return maximum numeric value from X and Y. */
+__MATHCALL (fmax,, (_Mdouble_ __x, _Mdouble_ __y));
+
+/* Return minimum numeric value from X and Y. */
+__MATHCALL (fmin,, (_Mdouble_ __x, _Mdouble_ __y));
+
+
+/* Classify given number. */
+__MATHDECL_1 (int, __fpclassify,, (_Mdouble_ __value))
+ __attribute__ ((__const__));
+
+/* Test for negative number. */
+__MATHDECL_1 (int, __signbit,, (_Mdouble_ __value))
+ __attribute__ ((__const__));
+
+
+/* Multiply-add function computed as a ternary operation. */
+__MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z));
+#endif /* Use ISO C99. */
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__END_NAMESPACE_C99
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
+/* Return X times (2 to the Nth power). */
+__MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n));
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/mathdef.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/mathdef.h
new file mode 100644
index 0000000..331da13
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/mathdef.h
@@ -0,0 +1,48 @@
+/* Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if !defined _MATH_H && !defined _COMPLEX_H
+# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
+#endif
+
+#include <sgidefs.h>
+
+#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
+# define _MATH_H_MATHDEF 1
+
+/* Normally, there is no long double type and the `float' and `double'
+ expressions are evaluated as `double'. */
+typedef double float_t; /* `float' expressions are evaluated as
+ `double'. */
+typedef double double_t; /* `double' expressions are evaluated as
+ `double'. */
+
+/* The values returned by `ilogb' for 0 and NaN respectively. */
+# define FP_ILOGB0 (-2147483647)
+# define FP_ILOGBNAN 2147483647
+
+#endif /* ISO C99 */
+
+#if ! defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32
+/* Signal that we do not really have a `long double'. This disables the
+ declaration of all the `long double' function variants. */
+# define __NO_LONG_DOUBLE_MATH 1
+#elif !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
+# define __NO_LONG_DOUBLE_MATH 1
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/mathinline.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/mathinline.h
new file mode 100644
index 0000000..5498af6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/mathinline.h
@@ -0,0 +1,12 @@
+/* This file should provide inline versions of math functions.
+
+ Surround GCC-specific parts with #ifdef __GNUC__, and use `extern __inline'.
+
+ This file should define __MATH_INLINES if functions are actually defined as
+ inlines. */
+
+#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
+
+/* Here goes the real code. */
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/mman.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/mman.h
new file mode 100644
index 0000000..47d3393
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/mman.h
@@ -0,0 +1,106 @@
+/* Definitions for POSIX memory map interface. Linux/MIPS version.
+ Copyright (C) 1997, 2000, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_MMAN_H
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
+#endif
+
+/* The following definitions basically come from the kernel headers.
+ But the kernel header is not namespace clean. */
+
+
+/* Protections are chosen from these bits, OR'd together. The
+ implementation does not necessarily support PROT_EXEC or PROT_WRITE
+ without PROT_READ. The only guarantees are that no writing will be
+ allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
+
+#define PROT_READ 0x1 /* Page can be read. */
+#define PROT_WRITE 0x2 /* Page can be written. */
+#define PROT_EXEC 0x4 /* Page can be executed. */
+#define PROT_NONE 0x0 /* Page can not be accessed. */
+#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
+ growsdown vma (mprotect only). */
+#define PROT_GROWSUP 0x02000000 /* Extend change to start of
+ growsup vma (mprotect only). */
+
+/* Sharing types (must choose one and only one of these). */
+#define MAP_SHARED 0x01 /* Share changes. */
+#define MAP_PRIVATE 0x02 /* Changes are private. */
+#ifdef __USE_MISC
+# define MAP_TYPE 0x0f /* Mask for type of mapping. */
+#endif
+
+/* Other flags. */
+#define MAP_FIXED 0x10 /* Interpret addr exactly. */
+#ifdef __USE_MISC
+# define MAP_FILE 0
+# define MAP_ANONYMOUS 0x0800 /* Don't use a file. */
+# define MAP_ANON MAP_ANONYMOUS
+# define MAP_RENAME MAP_ANONYMOUS
+#endif
+
+/* These are Linux-specific. */
+#ifdef __USE_MISC
+# define MAP_NORESERVE 0x0400 /* don't check for reservations */
+# define MAP_ANONYMOUS 0x0800 /* don't use a file */
+# define MAP_GROWSDOWN 0x1000 /* stack-like segment */
+# define MAP_DENYWRITE 0x2000 /* ETXTBSY */
+# define MAP_EXECUTABLE 0x4000 /* mark it as an executable */
+# define MAP_LOCKED 0x8000 /* pages are locked */
+# define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */
+# define MAP_NONBLOCK 0x20000 /* do not block on IO */
+#endif
+
+/* Flags to `msync'. */
+#define MS_ASYNC 1 /* Sync memory asynchronously. */
+#define MS_SYNC 4 /* Synchronous memory sync. */
+#define MS_INVALIDATE 2 /* Invalidate the caches. */
+
+/* Flags for `mlockall'. */
+#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
+#define MCL_FUTURE 2 /* Lock all additions to address
+ space. */
+
+/* Flags for `mremap'. */
+#ifdef __USE_GNU
+# define MREMAP_MAYMOVE 1
+# define MREMAP_FIXED 2
+#endif
+
+/* Advice to `madvise'. */
+#ifdef __USE_BSD
+# define MADV_NORMAL 0 /* No further special treatment. */
+# define MADV_RANDOM 1 /* Expect random page references. */
+# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define MADV_WILLNEED 3 /* Will need these pages. */
+# define MADV_DONTNEED 4 /* Don't need these pages. */
+# define MADV_REMOVE 9 /* Remove these pages and resources. */
+# define MADV_DONTFORK 10 /* Do not inherit across fork. */
+# define MADV_DOFORK 11 /* Do inherit across fork. */
+#endif
+
+/* The POSIX people had to invent similar names for the same things. */
+#ifdef __USE_XOPEN2K
+# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
+# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
+# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
+# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/mqueue.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/mqueue.h
new file mode 100644
index 0000000..df528f8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/mqueue.h
@@ -0,0 +1,32 @@
+/* Copyright (C) 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MQUEUE_H
+# error "Never use <bits/mqueue.h> directly; include <mqueue.h> instead."
+#endif
+
+typedef int mqd_t;
+
+struct mq_attr
+{
+ long int mq_flags; /* Message queue flags. */
+ long int mq_maxmsg; /* Maximum number of messages. */
+ long int mq_msgsize; /* Maximum message size. */
+ long int mq_curmsgs; /* Number of messages currently queued. */
+ long int __pad[4];
+};
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/msq.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/msq.h
new file mode 100644
index 0000000..2b0d38e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/msq.h
@@ -0,0 +1,93 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_MSG_H
+# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
+#endif
+
+#include <bits/types.h>
+#include <bits/wordsize.h>
+
+/* Define options for message queue functions. */
+#define MSG_NOERROR 010000 /* no error if message is too big */
+#ifdef __USE_GNU
+# define MSG_EXCEPT 020000 /* recv any msg except of specified type */
+#endif
+
+/* Types used in the structure definition. */
+typedef unsigned long int msgqnum_t;
+typedef unsigned long int msglen_t;
+
+
+/* Structure of record for one message inside the kernel.
+ The type `struct msg' is opaque. */
+struct msqid_ds
+{
+ struct ipc_perm msg_perm; /* structure describing operation permission */
+#if (__WORDSIZE == 32) && !defined(__MIPSEL__)
+ unsigned long __unused1;
+#endif
+ __time_t msg_stime; /* time of last msgsnd command */
+#if (__WORDSIZE == 32) && defined(__MIPSEL__)
+ unsigned long __unused1;
+#endif
+#if (__WORDSIZE == 32) && !defined(__MIPSEL__)
+ unsigned long __unused2;
+#endif
+ __time_t msg_rtime; /* time of last msgrcv command */
+#if (__WORDSIZE == 32) && defined(__MIPSEL__)
+ unsigned long __unused2;
+#endif
+#if (__WORDSIZE == 32) && !defined(__MIPSEL__)
+ unsigned long __unused3;
+#endif
+ __time_t msg_ctime; /* time of last change */
+#if (__WORDSIZE == 32) && defined(__MIPSEL__)
+ unsigned long __unused3;
+#endif
+ unsigned long int __msg_cbytes; /* current number of bytes on queue */
+ msgqnum_t msg_qnum; /* number of messages currently on queue */
+ msglen_t msg_qbytes; /* max number of bytes allowed on queue */
+ __pid_t msg_lspid; /* pid of last msgsnd() */
+ __pid_t msg_lrpid; /* pid of last msgrcv() */
+ unsigned long int __unused4;
+ unsigned long int __unused5;
+};
+
+#ifdef __USE_MISC
+
+# define msg_cbytes __msg_cbytes
+
+/* ipcs ctl commands */
+# define MSG_STAT 11
+# define MSG_INFO 12
+
+/* buffer for msgctl calls IPC_INFO, MSG_INFO */
+struct msginfo
+ {
+ int msgpool;
+ int msgmap;
+ int msgmax;
+ int msgmnb;
+ int msgmni;
+ int msgssz;
+ int msgtql;
+ unsigned short int msgseg;
+ };
+
+#endif /* __USE_MISC */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/nan.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/nan.h
new file mode 100644
index 0000000..bae97f2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/nan.h
@@ -0,0 +1,53 @@
+/* `NAN' constant for IEEE 754 machines.
+ Copyright (C) 1992,1996,1997,1999,2004,2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MATH_H
+# error "Never use <bits/nan.h> directly; include <math.h> instead."
+#endif
+
+
+/* IEEE Not A Number. */
+
+#if __GNUC_PREREQ(3,3)
+
+# define NAN (__builtin_nanf (""))
+
+#elif defined __GNUC__
+
+# define NAN \
+ (__extension__ \
+ ((union { unsigned __l __attribute__ ((__mode__ (__SI__))); float __d; }) \
+ { __l: 0x7fc00000UL }).__d)
+
+#else
+
+# include <endian.h>
+
+# if __BYTE_ORDER == __BIG_ENDIAN
+# define __nan_bytes { 0x7f, 0xc0, 0, 0 }
+# endif
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+# define __nan_bytes { 0, 0, 0xc0, 0x7f }
+# endif
+
+static union { unsigned char __c[4]; float __d; } __nan_union
+ __attribute_used__ = { __nan_bytes };
+# define NAN (__nan_union.__d)
+
+#endif /* GCC. */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/netdb.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/netdb.h
new file mode 100644
index 0000000..41dc731
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/netdb.h
@@ -0,0 +1,33 @@
+/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETDB_H
+# error "Never include <bits/netdb.h> directly; use <netdb.h> instead."
+#endif
+
+
+/* Description of data base entry for a single network. NOTE: here a
+ poor assumption is made. The network number is expected to fit
+ into an unsigned long int variable. */
+struct netent
+{
+ char *n_name; /* Official name of network. */
+ char **n_aliases; /* Alias list. */
+ int n_addrtype; /* Net address type. */
+ uint32_t n_net; /* Network number. */
+};
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/poll.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/poll.h
new file mode 100644
index 0000000..eee4ea2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/poll.h
@@ -0,0 +1,50 @@
+/* Copyright (C) 1997, 2001, 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_POLL_H
+# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#endif
+
+/* Event types that can be polled for. These bits may be set in `events'
+ to indicate the interesting event types; they will appear in `revents'
+ to indicate the status of the file descriptor. */
+#define POLLIN 0x001 /* There is data to read. */
+#define POLLPRI 0x002 /* There is urgent data to read. */
+#define POLLOUT 0x004 /* Writing now will not block. */
+
+#ifdef __USE_XOPEN
+/* These values are defined in XPG4.2. */
+# define POLLRDNORM 0x040 /* Normal data may be read. */
+# define POLLRDBAND 0x080 /* Priority data may be read. */
+# define POLLWRNORM POLLOUT /* Writing now will not block. */
+# define POLLWRBAND 0x100 /* Priority data may be written. */
+#endif
+
+#ifdef __USE_GNU
+/* These are extensions for Linux. */
+# define POLLMSG 0x400
+# define POLLREMOVE 0x1000
+# define POLLRDHUP 0x2000
+#endif
+
+/* Event types always implicitly polled for. These bits need not be set in
+ `events', but they will appear in `revents' to indicate the status of
+ the file descriptor. */
+#define POLLERR 0x008 /* Error condition. */
+#define POLLHUP 0x010 /* Hung up. */
+#define POLLNVAL 0x020 /* Invalid polling request. */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/posix1_lim.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/posix1_lim.h
new file mode 100644
index 0000000..3c86dce
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/posix1_lim.h
@@ -0,0 +1,169 @@
+/* Copyright (C) 1991-1993,96,98,2000-2003,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 2.9.2 Minimum Values Added to <limits.h>
+ *
+ * Never include this file directly; use <limits.h> instead.
+ */
+
+#ifndef _BITS_POSIX1_LIM_H
+#define _BITS_POSIX1_LIM_H 1
+
+
+/* These are the standard-mandated minimum values. */
+
+/* Minimum number of operations in one list I/O call. */
+#define _POSIX_AIO_LISTIO_MAX 2
+
+/* Minimal number of outstanding asynchronous I/O operations. */
+#define _POSIX_AIO_MAX 1
+
+/* Maximum length of arguments to `execve', including environment. */
+#define _POSIX_ARG_MAX 4096
+
+/* Maximum simultaneous processes per real user ID. */
+#ifdef __USE_XOPEN2K
+# define _POSIX_CHILD_MAX 25
+#else
+# define _POSIX_CHILD_MAX 6
+#endif
+
+/* Minimal number of timer expiration overruns. */
+#define _POSIX_DELAYTIMER_MAX 32
+
+/* Maximum length of a host name (not including the terminating null)
+ as returned from the GETHOSTNAME function. */
+#define _POSIX_HOST_NAME_MAX 255
+
+/* Maximum link count of a file. */
+#define _POSIX_LINK_MAX 8
+
+/* Maximum length of login name. */
+#define _POSIX_LOGIN_NAME_MAX 9
+
+/* Number of bytes in a terminal canonical input queue. */
+#define _POSIX_MAX_CANON 255
+
+/* Number of bytes for which space will be
+ available in a terminal input queue. */
+#define _POSIX_MAX_INPUT 255
+
+/* Maximum number of message queues open for a process. */
+#define _POSIX_MQ_OPEN_MAX 8
+
+/* Maximum number of supported message priorities. */
+#define _POSIX_MQ_PRIO_MAX 32
+
+/* Number of bytes in a filename. */
+#define _POSIX_NAME_MAX 14
+
+/* Number of simultaneous supplementary group IDs per process. */
+#ifdef __USE_XOPEN2K
+# define _POSIX_NGROUPS_MAX 8
+#else
+# define _POSIX_NGROUPS_MAX 0
+#endif
+
+/* Number of files one process can have open at once. */
+#ifdef __USE_XOPEN2K
+# define _POSIX_OPEN_MAX 20
+#else
+# define _POSIX_OPEN_MAX 16
+#endif
+
+/* Number of descriptors that a process may examine with `pselect' or
+ `select'. */
+#define _POSIX_FD_SETSIZE _POSIX_OPEN_MAX
+
+/* Number of bytes in a pathname. */
+#define _POSIX_PATH_MAX 256
+
+/* Number of bytes than can be written atomically to a pipe. */
+#define _POSIX_PIPE_BUF 512
+
+/* The number of repeated occurrences of a BRE permitted by the
+ REGEXEC and REGCOMP functions when using the interval notation. */
+#define _POSIX_RE_DUP_MAX 255
+
+/* Minimal number of realtime signals reserved for the application. */
+#define _POSIX_RTSIG_MAX 8
+
+/* Number of semaphores a process can have. */
+#define _POSIX_SEM_NSEMS_MAX 256
+
+/* Maximal value of a semaphore. */
+#define _POSIX_SEM_VALUE_MAX 32767
+
+/* Number of pending realtime signals. */
+#define _POSIX_SIGQUEUE_MAX 32
+
+/* Largest value of a `ssize_t'. */
+#define _POSIX_SSIZE_MAX 32767
+
+/* Number of streams a process can have open at once. */
+#define _POSIX_STREAM_MAX 8
+
+/* The number of bytes in a symbolic link. */
+#define _POSIX_SYMLINK_MAX 255
+
+/* The number of symbolic links that can be traversed in the
+ resolution of a pathname in the absence of a loop. */
+#define _POSIX_SYMLOOP_MAX 8
+
+/* Number of timer for a process. */
+#define _POSIX_TIMER_MAX 32
+
+/* Maximum number of characters in a tty name. */
+#define _POSIX_TTY_NAME_MAX 9
+
+/* Maximum length of a timezone name (element of `tzname'). */
+#define _POSIX_TZNAME_MAX 6
+
+/* Maximum number of connections that can be queued on a socket. */
+#define _POSIX_QLIMIT 1
+
+/* Maximum number of bytes that can be buffered on a socket for send
+ or receive. */
+#define _POSIX_HIWAT _POSIX_PIPE_BUF
+
+/* Maximum number of elements in an `iovec' array. */
+#define _POSIX_UIO_MAXIOV 16
+
+/* Maximum clock resolution in nanoseconds. */
+#define _POSIX_CLOCKRES_MIN 20000000
+
+
+/* Get the implementation-specific values for the above. */
+#include <bits/local_lim.h>
+#include <bits/uClibc_local_lim.h>
+
+
+#ifndef SSIZE_MAX
+# define SSIZE_MAX LONG_MAX
+#endif
+
+
+/* This value is a guaranteed minimum maximum.
+ The current maximum can be got from `sysconf'. */
+
+#ifndef NGROUPS_MAX
+# define NGROUPS_MAX 8
+#endif
+
+#endif /* bits/posix1_lim.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/posix2_lim.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/posix2_lim.h
new file mode 100644
index 0000000..24483a0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/posix2_lim.h
@@ -0,0 +1,91 @@
+/* Copyright (C) 1991, 1996, 1999, 2000, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * Never include this file directly; include <limits.h> instead.
+ */
+
+#ifndef _BITS_POSIX2_LIM_H
+#define _BITS_POSIX2_LIM_H 1
+
+
+/* The maximum `ibase' and `obase' values allowed by the `bc' utility. */
+#define _POSIX2_BC_BASE_MAX 99
+
+/* The maximum number of elements allowed in an array by the `bc' utility. */
+#define _POSIX2_BC_DIM_MAX 2048
+
+/* The maximum `scale' value allowed by the `bc' utility. */
+#define _POSIX2_BC_SCALE_MAX 99
+
+/* The maximum length of a string constant accepted by the `bc' utility. */
+#define _POSIX2_BC_STRING_MAX 1000
+
+/* The maximum number of weights that can be assigned to an entry of
+ the LC_COLLATE `order' keyword in the locale definition file. */
+#define _POSIX2_COLL_WEIGHTS_MAX 2
+
+/* The maximum number of expressions that can be nested
+ within parentheses by the `expr' utility. */
+#define _POSIX2_EXPR_NEST_MAX 32
+
+/* The maximum length, in bytes, of an input line. */
+#define _POSIX2_LINE_MAX 2048
+
+/* The maximum number of repeated occurrences of a regular expression
+ permitted when using the interval notation `\{M,N\}'. */
+#define _POSIX2_RE_DUP_MAX 255
+
+/* The maximum number of bytes in a character class name. We have no
+ fixed limit, 2048 is a high number. */
+#define _POSIX2_CHARCLASS_NAME_MAX 14
+
+
+/* These values are implementation-specific,
+ and may vary within the implementation.
+ Their precise values can be obtained from sysconf. */
+
+#ifndef BC_BASE_MAX
+#define BC_BASE_MAX _POSIX2_BC_BASE_MAX
+#endif
+#ifndef BC_DIM_MAX
+#define BC_DIM_MAX _POSIX2_BC_DIM_MAX
+#endif
+#ifndef BC_SCALE_MAX
+#define BC_SCALE_MAX _POSIX2_BC_SCALE_MAX
+#endif
+#ifndef BC_STRING_MAX
+#define BC_STRING_MAX _POSIX2_BC_STRING_MAX
+#endif
+#ifndef COLL_WEIGHTS_MAX
+#define COLL_WEIGHTS_MAX 255
+#endif
+#ifndef EXPR_NEST_MAX
+#define EXPR_NEST_MAX _POSIX2_EXPR_NEST_MAX
+#endif
+#ifndef LINE_MAX
+#define LINE_MAX _POSIX2_LINE_MAX
+#endif
+#ifndef CHARCLASS_NAME_MAX
+#define CHARCLASS_NAME_MAX 2048
+#endif
+
+/* This value is defined like this in regex.h. */
+#define RE_DUP_MAX (0x7fff)
+
+#endif /* bits/posix2_lim.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/posix_opt.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/posix_opt.h
new file mode 100644
index 0000000..dfe259b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/posix_opt.h
@@ -0,0 +1,180 @@
+/* Define POSIX options for Linux.
+ Copyright (C) 1996-2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef _POSIX_OPT_H
+#define _POSIX_OPT_H 1
+
+/* Job control is supported. */
+#define _POSIX_JOB_CONTROL 1
+
+/* Processes have a saved set-user-ID and a saved set-group-ID. */
+#define _POSIX_SAVED_IDS 1
+
+/* Priority scheduling is supported. */
+#define _POSIX_PRIORITY_SCHEDULING 200112L
+
+/* Synchronizing file data is supported. */
+#define _POSIX_SYNCHRONIZED_IO 200112L
+
+/* The fsync function is present. */
+#define _POSIX_FSYNC 200112L
+
+/* Mapping of files to memory is supported. */
+#define _POSIX_MAPPED_FILES 200112L
+
+/* Locking of all memory is supported. */
+#define _POSIX_MEMLOCK 200112L
+
+/* Locking of ranges of memory is supported. */
+#define _POSIX_MEMLOCK_RANGE 200112L
+
+/* Setting of memory protections is supported. */
+#define _POSIX_MEMORY_PROTECTION 200112L
+
+/* Only root can change owner of file. */
+#define _POSIX_CHOWN_RESTRICTED 1
+
+/* `c_cc' member of 'struct termios' structure can be disabled by
+ using the value _POSIX_VDISABLE. */
+#define _POSIX_VDISABLE '\0'
+
+/* Filenames are not silently truncated. */
+#define _POSIX_NO_TRUNC 1
+
+/* X/Open realtime support is available. */
+#define _XOPEN_REALTIME 1
+
+/* XPG4.2 shared memory is supported. */
+#define _XOPEN_SHM 1
+
+/* Tell we have POSIX threads. */
+#define _POSIX_THREADS 200112L
+
+/* We have the reentrant functions described in POSIX. */
+#define _POSIX_REENTRANT_FUNCTIONS 1
+#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
+
+/* We provide priority scheduling for threads. */
+#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L
+
+/* We support user-defined stack sizes. */
+#define _POSIX_THREAD_ATTR_STACKSIZE 200112L
+
+/* We support user-defined stacks. */
+#define _POSIX_THREAD_ATTR_STACKADDR 200112L
+
+/* We support POSIX.1b semaphores. */
+#define _POSIX_SEMAPHORES 200112L
+
+/* Real-time signals are supported. */
+#define _POSIX_REALTIME_SIGNALS 200112L
+
+/* We support asynchronous I/O. */
+#define _POSIX_ASYNCHRONOUS_IO 200112L
+#define _POSIX_ASYNC_IO 1
+/* Alternative name for Unix98. */
+#define _LFS_ASYNCHRONOUS_IO 1
+/* Support for prioritization is also available. */
+#define _POSIX_PRIORITIZED_IO 200112L
+
+/* The LFS support in asynchronous I/O is also available. */
+#define _LFS64_ASYNCHRONOUS_IO 1
+
+#ifdef __UCLIBC_HAS_LFS__
+/* The rest of the LFS is also available. */
+#define _LFS_LARGEFILE 1
+#define _LFS64_LARGEFILE 1
+#define _LFS64_STDIO 1
+#endif
+
+/* POSIX shared memory objects are implemented. */
+#define _POSIX_SHARED_MEMORY_OBJECTS 200112L
+
+/* CPU-time clocks support needs to be checked at runtime. */
+#define _POSIX_CPUTIME 0
+
+/* Clock support in threads must be also checked at runtime. */
+#define _POSIX_THREAD_CPUTIME 0
+
+/* GNU libc provides regular expression handling. */
+#define _POSIX_REGEXP 1
+
+/* Reader/Writer locks are available. */
+#define _POSIX_READER_WRITER_LOCKS 200112L
+
+/* We have a POSIX shell. */
+#define _POSIX_SHELL 1
+
+/* We support the Timeouts option. */
+#define _POSIX_TIMEOUTS 200112L
+
+/* We support spinlocks. */
+#define _POSIX_SPIN_LOCKS 200112L
+
+/* The `spawn' function family is supported. */
+#define _POSIX_SPAWN 200112L
+
+/* We have POSIX timers. */
+#define _POSIX_TIMERS 200112L
+
+/* The barrier functions are available. */
+#define _POSIX_BARRIERS 200112L
+
+/* POSIX message queues are available. */
+#define _POSIX_MESSAGE_PASSING 200112L
+
+/* Thread process-shared synchronization is supported. */
+#define _POSIX_THREAD_PROCESS_SHARED 200112L
+
+/* The monotonic clock might be available. */
+#define _POSIX_MONOTONIC_CLOCK 0
+
+/* The clock selection interfaces are available. */
+#define _POSIX_CLOCK_SELECTION 200112L
+
+/* Advisory information interfaces are available. */
+#define _POSIX_ADVISORY_INFO 200112L
+
+/* IPv6 support is available. */
+#define _POSIX_IPV6 200112L
+
+/* Raw socket support is available. */
+#define _POSIX_RAW_SOCKETS 200112L
+
+/* We have at least one terminal. */
+#define _POSIX2_CHAR_TERM 200112L
+
+/* Neither process nor thread sporadic server interfaces is available. */
+#define _POSIX_SPORADIC_SERVER -1
+#define _POSIX_THREAD_SPORADIC_SERVER -1
+
+/* trace.h is not available. */
+#define _POSIX_TRACE -1
+#define _POSIX_TRACE_EVENT_FILTER -1
+#define _POSIX_TRACE_INHERIT -1
+#define _POSIX_TRACE_LOG -1
+
+/* Typed memory objects are not available. */
+#define _POSIX_TYPED_MEMORY_OBJECTS -1
+
+/* No support for priority inheritance or protection so far. */
+#define _POSIX_THREAD_PRIO_INHERIT -1
+#define _POSIX_THREAD_PRIO_PROTECT -1
+
+#endif /* posix_opt.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/pthreadtypes.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/pthreadtypes.h
new file mode 100644
index 0000000..faec63b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/pthreadtypes.h
@@ -0,0 +1,142 @@
+/* Linuxthreads - a simple clone()-based implementation of Posix */
+/* threads for Linux. */
+/* Copyright (C) 1996 Xavier Leroy (Xavier.Leroy@inria.fr) */
+/* */
+/* This program is free software; you can redistribute it and/or */
+/* modify it under the terms of the GNU Library General Public License */
+/* as published by the Free Software Foundation; either version 2 */
+/* of the License, or (at your option) any later version. */
+/* */
+/* This program is distributed in the hope that it will be useful, */
+/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
+/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
+/* GNU Library General Public License for more details. */
+
+#if !defined _BITS_TYPES_H && !defined _PTHREAD_H
+# error "Never include <bits/pthreadtypes.h> directly; use <sys/types.h> instead."
+#endif
+
+#ifndef _BITS_PTHREADTYPES_H
+#define _BITS_PTHREADTYPES_H 1
+
+#define __need_schedparam
+#include <bits/sched.h>
+
+/* Fast locks (not abstract because mutexes and conditions aren't abstract). */
+struct _pthread_fastlock
+{
+ long int __status; /* "Free" or "taken" or head of waiting list */
+ int __spinlock; /* Used by compare_and_swap emulation. Also,
+ adaptive SMP lock stores spin count here. */
+};
+
+#ifndef _PTHREAD_DESCR_DEFINED
+/* Thread descriptors */
+typedef struct _pthread_descr_struct *_pthread_descr;
+# define _PTHREAD_DESCR_DEFINED
+#endif
+
+
+/* Attributes for threads. */
+typedef struct __pthread_attr_s
+{
+ int __detachstate;
+ int __schedpolicy;
+ struct __sched_param __schedparam;
+ int __inheritsched;
+ int __scope;
+ size_t __guardsize;
+ int __stackaddr_set;
+ void *__stackaddr;
+ size_t __stacksize;
+} pthread_attr_t;
+
+
+/* Conditions (not abstract because of PTHREAD_COND_INITIALIZER */
+typedef struct
+{
+ struct _pthread_fastlock __c_lock; /* Protect against concurrent access */
+ _pthread_descr __c_waiting; /* Threads waiting on this condition */
+} pthread_cond_t;
+
+
+/* Attribute for conditionally variables. */
+typedef struct
+{
+ int __dummy;
+} pthread_condattr_t;
+
+/* Keys for thread-specific data */
+typedef unsigned int pthread_key_t;
+
+
+/* Mutexes (not abstract because of PTHREAD_MUTEX_INITIALIZER). */
+/* (The layout is unnatural to maintain binary compatibility
+ with earlier releases of LinuxThreads.) */
+typedef struct
+{
+ int __m_reserved; /* Reserved for future use */
+ int __m_count; /* Depth of recursive locking */
+ _pthread_descr __m_owner; /* Owner thread (if recursive or errcheck) */
+ int __m_kind; /* Mutex kind: fast, recursive or errcheck */
+ struct _pthread_fastlock __m_lock; /* Underlying fast lock */
+} pthread_mutex_t;
+
+
+/* Attribute for mutex. */
+typedef struct
+{
+ int __mutexkind;
+} pthread_mutexattr_t;
+
+
+/* Once-only execution */
+typedef int pthread_once_t;
+
+
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
+/* Read-write locks. */
+typedef struct _pthread_rwlock_t
+{
+ struct _pthread_fastlock __rw_lock; /* Lock to guarantee mutual exclusion */
+ int __rw_readers; /* Number of readers */
+ _pthread_descr __rw_writer; /* Identity of writer, or NULL if none */
+ _pthread_descr __rw_read_waiting; /* Threads waiting for reading */
+ _pthread_descr __rw_write_waiting; /* Threads waiting for writing */
+ int __rw_kind; /* Reader/Writer preference selection */
+ int __rw_pshared; /* Shared between processes or not */
+} pthread_rwlock_t;
+
+
+/* Attribute for read-write locks. */
+typedef struct
+{
+ int __lockkind;
+ int __pshared;
+} pthread_rwlockattr_t;
+#endif
+
+#ifdef __USE_XOPEN2K
+/* POSIX spinlock data type. */
+typedef volatile int pthread_spinlock_t;
+
+/* POSIX barrier. */
+typedef struct {
+ struct _pthread_fastlock __ba_lock; /* Lock to guarantee mutual exclusion */
+ int __ba_required; /* Threads needed for completion */
+ int __ba_present; /* Threads waiting */
+ _pthread_descr __ba_waiting; /* Queue of waiting threads */
+} pthread_barrier_t;
+
+/* barrier attribute */
+typedef struct {
+ int __pshared;
+} pthread_barrierattr_t;
+
+#endif
+
+
+/* Thread identifiers */
+typedef unsigned long int pthread_t;
+
+#endif /* bits/pthreadtypes.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/resource.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/resource.h
new file mode 100644
index 0000000..1c8b99a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/resource.h
@@ -0,0 +1,233 @@
+/* Bit values & structures for resource limits. Linux/MIPS version.
+ Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005, 2006
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_RESOURCE_H
+# error "Never use <bits/resource.h> directly; include <sys/resource.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Transmute defines to enumerations. The macro re-definitions are
+ necessary because some programs want to test for operating system
+ features with #ifdef RUSAGE_SELF. In ISO C the reflexive
+ definition is a no-op. */
+
+/* Kinds of resource limit. */
+enum __rlimit_resource
+{
+ /* Per-process CPU limit, in seconds. */
+ RLIMIT_CPU = 0,
+#define RLIMIT_CPU RLIMIT_CPU
+
+ /* Largest file that can be created, in bytes. */
+ RLIMIT_FSIZE = 1,
+#define RLIMIT_FSIZE RLIMIT_FSIZE
+
+ /* Maximum size of data segment, in bytes. */
+ RLIMIT_DATA = 2,
+#define RLIMIT_DATA RLIMIT_DATA
+
+ /* Maximum size of stack segment, in bytes. */
+ RLIMIT_STACK = 3,
+#define RLIMIT_STACK RLIMIT_STACK
+
+ /* Largest core file that can be created, in bytes. */
+ RLIMIT_CORE = 4,
+#define RLIMIT_CORE RLIMIT_CORE
+
+ /* Largest resident set size, in bytes.
+ This affects swapping; processes that are exceeding their
+ resident set size will be more likely to have physical memory
+ taken from them. */
+ __RLIMIT_RSS = 7,
+#define RLIMIT_RSS __RLIMIT_RSS
+
+ /* Number of open files. */
+ RLIMIT_NOFILE = 5,
+ __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */
+#define RLIMIT_NOFILE RLIMIT_NOFILE
+#define RLIMIT_OFILE __RLIMIT_OFILE
+
+ /* Address space limit (?) */
+ RLIMIT_AS = 6,
+#define RLIMIT_AS RLIMIT_AS
+
+ /* Number of processes. */
+ __RLIMIT_NPROC = 8,
+#define RLIMIT_NPROC __RLIMIT_NPROC
+
+ /* Locked-in-memory address space. */
+ __RLIMIT_MEMLOCK = 9,
+#define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK
+
+ /* Maximum number of file locks. */
+ __RLIMIT_LOCKS = 10,
+#define RLIMIT_LOCKS __RLIMIT_LOCKS
+
+ /* Maximum number of pending signals. */
+ __RLIMIT_SIGPENDING = 11,
+#define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING
+
+ /* Maximum bytes in POSIX message queues. */
+ __RLIMIT_MSGQUEUE = 12,
+#define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE
+
+ /* Maximum nice priority allowed to raise to.
+ Nice levels 19 .. -20 correspond to 0 .. 39
+ values of this resource limit. */
+ __RLIMIT_NICE = 13,
+#define RLIMIT_NICE __RLIMIT_NICE
+
+ /* Maximum realtime priority allowed for non-priviledged
+ processes. */
+ __RLIMIT_RTPRIO = 14,
+#define RLIMIT_RTPRIO __RLIMIT_RTPRIO
+
+ __RLIMIT_NLIMITS = 15,
+ __RLIM_NLIMITS = __RLIMIT_NLIMITS
+#define RLIMIT_NLIMITS __RLIMIT_NLIMITS
+#define RLIM_NLIMITS __RLIM_NLIMITS
+};
+
+/* Value to indicate that there is no limit. */
+#if _MIPS_SIM == _ABI64
+/* The N64 syscall uses this value. */
+# define RLIM_INFINITY 0xffffffffffffffffUL
+# ifdef __USE_LARGEFILE64
+# define RLIM64_INFINITY 0xffffffffffffffffUL
+# endif
+#else
+/* The O32 and N32 syscalls use 0x7fffffff. */
+# ifndef __USE_FILE_OFFSET64
+# define RLIM_INFINITY ((long int)(~0UL >> 1))
+# else
+# define RLIM_INFINITY 0x7fffffffffffffffULL
+# endif
+# ifdef __USE_LARGEFILE64
+# define RLIM64_INFINITY 0x7fffffffffffffffULL
+# endif
+#endif
+
+/* We can represent all limits. */
+#define RLIM_SAVED_MAX RLIM_INFINITY
+#define RLIM_SAVED_CUR RLIM_INFINITY
+
+
+/* Type for resource quantity measurement. */
+#ifndef __USE_FILE_OFFSET64
+typedef __rlim_t rlim_t;
+#else
+typedef __rlim64_t rlim_t;
+#endif
+#ifdef __USE_LARGEFILE64
+typedef __rlim64_t rlim64_t;
+#endif
+
+struct rlimit
+ {
+ /* The current (soft) limit. */
+ rlim_t rlim_cur;
+ /* The hard limit. */
+ rlim_t rlim_max;
+ };
+
+#ifdef __USE_LARGEFILE64
+struct rlimit64
+ {
+ /* The current (soft) limit. */
+ rlim64_t rlim_cur;
+ /* The hard limit. */
+ rlim64_t rlim_max;
+ };
+#endif
+
+/* Whose usage statistics do you want? */
+enum __rusage_who
+{
+ /* The calling process. */
+ RUSAGE_SELF = 0,
+#define RUSAGE_SELF RUSAGE_SELF
+
+ /* All of its terminated child processes. */
+ RUSAGE_CHILDREN = -1
+#define RUSAGE_CHILDREN RUSAGE_CHILDREN
+};
+
+#define __need_timeval
+#include <bits/time.h> /* For `struct timeval'. */
+
+/* Structure which says how much of each resource has been used. */
+struct rusage
+ {
+ /* Total amount of user time used. */
+ struct timeval ru_utime;
+ /* Total amount of system time used. */
+ struct timeval ru_stime;
+ /* Maximum resident set size (in kilobytes). */
+ long int ru_maxrss;
+ /* Amount of sharing of text segment memory
+ with other processes (kilobyte-seconds). */
+ long int ru_ixrss;
+ /* Amount of data segment memory used (kilobyte-seconds). */
+ long int ru_idrss;
+ /* Amount of stack memory used (kilobyte-seconds). */
+ long int ru_isrss;
+ /* Number of soft page faults (i.e. those serviced by reclaiming
+ a page from the list of pages awaiting reallocation. */
+ long int ru_minflt;
+ /* Number of hard page faults (i.e. those that required I/O). */
+ long int ru_majflt;
+ /* Number of times a process was swapped out of physical memory. */
+ long int ru_nswap;
+ /* Number of input operations via the file system. Note: This
+ and `ru_oublock' do not include operations with the cache. */
+ long int ru_inblock;
+ /* Number of output operations via the file system. */
+ long int ru_oublock;
+ /* Number of IPC messages sent. */
+ long int ru_msgsnd;
+ /* Number of IPC messages received. */
+ long int ru_msgrcv;
+ /* Number of signals delivered. */
+ long int ru_nsignals;
+ /* Number of voluntary context switches, i.e. because the process
+ gave up the process before it had to (usually to wait for some
+ resource to be available). */
+ long int ru_nvcsw;
+ /* Number of involuntary context switches, i.e. a higher priority process
+ became runnable or the current process used up its time slice. */
+ long int ru_nivcsw;
+ };
+
+/* Priority limits. */
+#define PRIO_MIN -20 /* Minimum priority a process can have. */
+#define PRIO_MAX 20 /* Maximum priority a process can have. */
+
+/* The type of the WHICH argument to `getpriority' and `setpriority',
+ indicating what flavor of entity the WHO argument specifies. */
+enum __priority_which
+{
+ PRIO_PROCESS = 0, /* WHO is a process ID. */
+#define PRIO_PROCESS PRIO_PROCESS
+ PRIO_PGRP = 1, /* WHO is a process group ID. */
+#define PRIO_PGRP PRIO_PGRP
+ PRIO_USER = 2 /* WHO is a user ID. */
+#define PRIO_USER PRIO_USER
+};
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sched.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sched.h
new file mode 100644
index 0000000..b48a0c8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sched.h
@@ -0,0 +1,132 @@
+/* Definitions of constants and data structure for POSIX 1003.1b-1993
+ scheduling interface.
+ Copyright (C) 1996-1999,2001-2003,2005,2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef __need_schedparam
+
+#ifndef _SCHED_H
+# error "Never include <bits/sched.h> directly; use <sched.h> instead."
+#endif
+
+
+/* Scheduling algorithms. */
+#define SCHED_OTHER 0
+#define SCHED_FIFO 1
+#define SCHED_RR 2
+#ifdef __USE_GNU
+# define SCHED_BATCH 3
+#endif
+
+#ifdef __USE_MISC
+/* Cloning flags. */
+# define CSIGNAL 0x000000ff /* Signal mask to be sent at exit. */
+# define CLONE_VM 0x00000100 /* Set if VM shared between processes. */
+# define CLONE_FS 0x00000200 /* Set if fs info shared between processes. */
+# define CLONE_FILES 0x00000400 /* Set if open files shared between processes. */
+# define CLONE_SIGHAND 0x00000800 /* Set if signal handlers shared. */
+# define CLONE_PTRACE 0x00002000 /* Set if tracing continues on the child. */
+# define CLONE_VFORK 0x00004000 /* Set if the parent wants the child to
+ wake it up on mm_release. */
+# define CLONE_PARENT 0x00008000 /* Set if we want to have the same
+ parent as the cloner. */
+# define CLONE_THREAD 0x00010000 /* Set to add to same thread group. */
+# define CLONE_NEWNS 0x00020000 /* Set to create new namespace. */
+# define CLONE_SYSVSEM 0x00040000 /* Set to shared SVID SEM_UNDO semantics. */
+# define CLONE_SETTLS 0x00080000 /* Set TLS info. */
+# define CLONE_PARENT_SETTID 0x00100000 /* Store TID in userlevel buffer
+ before MM copy. */
+# define CLONE_CHILD_CLEARTID 0x00200000 /* Register exit futex and memory
+ location to clear. */
+# define CLONE_DETACHED 0x00400000 /* Create clone detached. */
+# define CLONE_UNTRACED 0x00800000 /* Set if the tracing process can't
+ force CLONE_PTRACE on this clone. */
+# define CLONE_CHILD_SETTID 0x01000000 /* Store TID in userlevel buffer in
+ the child. */
+# define CLONE_STOPPED 0x02000000 /* Start in stopped state. */
+#endif
+
+/* The official definition. */
+struct sched_param
+ {
+ int __sched_priority;
+ };
+
+__BEGIN_DECLS
+
+#ifdef __USE_MISC
+/* Clone current process. */
+extern int clone (int (*__fn) (void *__arg), void *__child_stack,
+ int __flags, void *__arg, ...) __THROW;
+
+#if 0
+/* Unshare the specified resources. */
+extern int unshare (int __flags) __THROW;
+#endif
+#endif
+
+__END_DECLS
+
+#endif /* need schedparam */
+
+#if !defined __defined_schedparam \
+ && (defined __need_schedparam || defined _SCHED_H)
+# define __defined_schedparam 1
+/* Data structure to describe a process' schedulability. */
+struct __sched_param
+ {
+ int __sched_priority;
+ };
+# undef __need_schedparam
+#endif
+
+
+#if defined _SCHED_H && !defined __cpu_set_t_defined
+# define __cpu_set_t_defined
+/* Size definition for CPU sets. */
+# define __CPU_SETSIZE 1024
+# define __NCPUBITS (8 * sizeof (__cpu_mask))
+
+/* Type for array elements in 'cpu_set'. */
+typedef unsigned long int __cpu_mask;
+
+/* Basic access functions. */
+# define __CPUELT(cpu) ((cpu) / __NCPUBITS)
+# define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS))
+
+/* Data structure to describe CPU mask. */
+typedef struct
+{
+ __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS];
+} cpu_set_t;
+
+/* Access functions for CPU masks. */
+# define __CPU_ZERO(cpusetp) \
+ do { \
+ unsigned int __i; \
+ cpu_set_t *__arr = (cpusetp); \
+ for (__i = 0; __i < sizeof (cpu_set_t) / sizeof (__cpu_mask); ++__i) \
+ __arr->__bits[__i] = 0; \
+ } while (0)
+# define __CPU_SET(cpu, cpusetp) \
+ ((cpusetp)->__bits[__CPUELT (cpu)] |= __CPUMASK (cpu))
+# define __CPU_CLR(cpu, cpusetp) \
+ ((cpusetp)->__bits[__CPUELT (cpu)] &= ~__CPUMASK (cpu))
+# define __CPU_ISSET(cpu, cpusetp) \
+ (((cpusetp)->__bits[__CPUELT (cpu)] & __CPUMASK (cpu)) != 0)
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/select.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/select.h
new file mode 100644
index 0000000..47e7ded
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/select.h
@@ -0,0 +1,35 @@
+/* Copyright (C) 1997, 1998, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SELECT_H
+# error "Never use <bits/select.h> directly; include <sys/select.h> instead."
+#endif
+
+
+/* We don't use `memset' because this would require a prototype and
+ the array isn't too big. */
+#define __FD_ZERO(s) \
+ do { \
+ unsigned int __i; \
+ fd_set *__arr = (s); \
+ for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \
+ __FDS_BITS (__arr)[__i] = 0; \
+ } while (0)
+#define __FD_SET(d, s) (__FDS_BITS (s)[__FDELT(d)] |= __FDMASK(d))
+#define __FD_CLR(d, s) (__FDS_BITS (s)[__FDELT(d)] &= ~__FDMASK(d))
+#define __FD_ISSET(d, s) ((__FDS_BITS (s)[__FDELT(d)] & __FDMASK(d)) != 0)
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sem.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sem.h
new file mode 100644
index 0000000..6282de9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sem.h
@@ -0,0 +1,85 @@
+/* Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SEM_H
+# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
+#endif
+
+#include <sys/types.h>
+
+/* Flags for `semop'. */
+#define SEM_UNDO 0x1000 /* undo the operation on exit */
+
+/* Commands for `semctl'. */
+#define GETPID 11 /* get sempid */
+#define GETVAL 12 /* get semval */
+#define GETALL 13 /* get all semval's */
+#define GETNCNT 14 /* get semncnt */
+#define GETZCNT 15 /* get semzcnt */
+#define SETVAL 16 /* set semval */
+#define SETALL 17 /* set all semval's */
+
+
+/* Data structure describing a set of semaphores. */
+struct semid_ds
+{
+ struct ipc_perm sem_perm; /* operation permission struct */
+ __time_t sem_otime; /* last semop() time */
+ __time_t sem_ctime; /* last time changed by semctl() */
+ unsigned long int sem_nsems; /* number of semaphores in set */
+ unsigned long int __unused1;
+ unsigned long int __unused2;
+};
+
+/* The user should define a union like the following to use it for arguments
+ for `semctl'.
+
+ union semun
+ {
+ int val; <= value for SETVAL
+ struct semid_ds *buf; <= buffer for IPC_STAT & IPC_SET
+ unsigned short int *array; <= array for GETALL & SETALL
+ struct seminfo *__buf; <= buffer for IPC_INFO
+ };
+
+ Previous versions of this file used to define this union but this is
+ incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether
+ one must define the union or not. */
+#define _SEM_SEMUN_UNDEFINED 1
+
+#ifdef __USE_MISC
+
+/* ipcs ctl cmds */
+# define SEM_STAT 18
+# define SEM_INFO 19
+
+struct seminfo
+{
+ int semmap;
+ int semmni;
+ int semmns;
+ int semmnu;
+ int semmsl;
+ int semopm;
+ int semume;
+ int semusz;
+ int semvmx;
+ int semaem;
+};
+
+#endif /* __USE_MISC */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/setjmp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/setjmp.h
new file mode 100644
index 0000000..08e74fe
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/setjmp.h
@@ -0,0 +1,72 @@
+/* Define the machine-dependent type `jmp_buf'. MIPS version.
+ Copyright (C) 1992,93,95,97,2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _BITS_SETJMP_H
+#define _BITS_SETJMP_H 1
+
+#if !defined _SETJMP_H && !defined _PTHREAD_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
+#include <sgidefs.h>
+
+typedef struct
+ {
+ /* Program counter. */
+ void * __pc;
+
+ /* Stack pointer. */
+ void * __sp;
+
+ /* Callee-saved registers s0 through s7. */
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+ int __regs[8];
+#else
+ long long __regs[8];
+#endif
+
+ /* The frame pointer. */
+ void * __fp;
+
+ /* The global pointer. */
+ void * __gp;
+
+ /* Floating point status register. */
+ int __fpc_csr;
+
+ /* Callee-saved floating point registers. */
+#if _MIPS_SIM == _MIPS_SIM_ABI64
+ double __fpregs[8];
+#else /* N32 || O32 */
+ double __fpregs[6];
+#endif /* N32 || O32 */
+ } __jmp_buf[1];
+
+#ifdef __USE_MISC
+/* Offset to the program counter in `jmp_buf'. */
+# define JB_PC 0
+#endif
+
+
+/* Test if longjmp to JMPBUF would unwind the frame
+ containing a local variable at ADDRESS. */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+ ((void *) (address) < (void *) (jmpbuf)[0].__sp)
+
+#endif /* bits/setjmp.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/shm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/shm.h
new file mode 100644
index 0000000..b308334
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/shm.h
@@ -0,0 +1,94 @@
+/* Copyright (C) 1995,1996,1997,2000,2001,2002,2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SHM_H
+# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Permission flag for shmget. */
+#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */
+#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */
+
+/* Flags for `shmat'. */
+#define SHM_RDONLY 010000 /* attach read-only else read-write */
+#define SHM_RND 020000 /* round attach address to SHMLBA */
+#define SHM_REMAP 040000 /* take-over region on attach */
+
+/* Commands for `shmctl'. */
+#define SHM_LOCK 11 /* lock segment (root only) */
+#define SHM_UNLOCK 12 /* unlock segment (root only) */
+
+/* Segment low boundary address multiple. */
+#define SHMLBA 0x40000
+
+
+/* Type to count number of attaches. */
+typedef unsigned long int shmatt_t;
+
+/* Data structure describing a set of semaphores. */
+struct shmid_ds
+ {
+ struct ipc_perm shm_perm; /* operation permission struct */
+ size_t shm_segsz; /* size of segment in bytes */
+ __time_t shm_atime; /* time of last shmat() */
+ __time_t shm_dtime; /* time of last shmdt() */
+ __time_t shm_ctime; /* time of last change by shmctl() */
+ __pid_t shm_cpid; /* pid of creator */
+ __pid_t shm_lpid; /* pid of last shmop */
+ shmatt_t shm_nattch; /* number of current attaches */
+ unsigned long int __unused1;
+ unsigned long int __unused2;
+ };
+
+#ifdef __USE_MISC
+
+/* ipcs ctl commands */
+# define SHM_STAT 13
+# define SHM_INFO 14
+
+/* shm_mode upper byte flags */
+# define SHM_DEST 01000 /* segment will be destroyed on last detach */
+# define SHM_LOCKED 02000 /* segment will not be swapped */
+# define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */
+
+struct shminfo
+ {
+ unsigned long int shmmax;
+ unsigned long int shmmin;
+ unsigned long int shmmni;
+ unsigned long int shmseg;
+ unsigned long int shmall;
+ unsigned long int __unused1;
+ unsigned long int __unused2;
+ unsigned long int __unused3;
+ unsigned long int __unused4;
+ };
+
+struct shm_info
+ {
+ int used_ids;
+ unsigned long int shm_tot; /* total allocated shm */
+ unsigned long int shm_rss; /* total resident shm */
+ unsigned long int shm_swp; /* total swapped shm */
+ unsigned long int swap_attempts;
+ unsigned long int swap_successes;
+ };
+
+#endif /* __USE_MISC */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigaction.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigaction.h
new file mode 100644
index 0000000..d04e25f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigaction.h
@@ -0,0 +1,89 @@
+/* The proper definitions for Linux/MIPS's sigaction.
+ Copyright (C) 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2003
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
+/* Structure describing the action to be taken when a signal arrives. */
+struct sigaction
+ {
+ /* Special flags. */
+ unsigned int sa_flags;
+
+ /* Signal handler. */
+#ifdef __USE_POSIX199309
+ union
+ {
+ /* Used if SA_SIGINFO is not set. */
+ __sighandler_t sa_handler;
+ /* Used if SA_SIGINFO is set. */
+ void (*sa_sigaction) (int, siginfo_t *, void *);
+ }
+ __sigaction_handler;
+# define sa_handler __sigaction_handler.sa_handler
+# define sa_sigaction __sigaction_handler.sa_sigaction
+#else
+ __sighandler_t sa_handler;
+#endif
+ /* Additional set of signals to be blocked. */
+ __sigset_t sa_mask;
+
+ /* The ABI says here are two unused ints following. */
+ /* Restore handler. */
+ void (*sa_restorer) (void);
+
+#if _MIPS_SZPTR < 64
+ int sa_resv[1];
+#endif
+ };
+
+/* Bits in `sa_flags'. */
+/* Please note that some Linux kernels versions use different values for these
+ flags which is a bug in those kernel versions. */
+#define SA_NOCLDSTOP 0x00000001 /* Don't send SIGCHLD when children stop. */
+#define SA_NOCLDWAIT 0x00010000 /* Don't create zombie on child death. */
+#define SA_SIGINFO 0x00000008 /* Invoke signal-catching function with
+ three arguments instead of one. */
+#if defined __USE_UNIX98 || defined __USE_MISC
+# define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */
+# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */
+# define SA_RESTART 0x10000000 /* Restart syscall on signal return. */
+# define SA_NODEFER 0x40000000 /* Don't automatically block the signal when
+ its handler is being executed. */
+#endif
+#ifdef __USE_MISC
+# define SA_INTERRUPT 0x20000000 /* Historical no-op. */
+
+/* Some aliases for the SA_ constants. */
+# define SA_NOMASK SA_NODEFER
+# define SA_ONESHOT SA_RESETHAND
+# define SA_STACK SA_ONSTACK
+#endif
+
+/* Values for the HOW argument to `sigprocmask'. */
+#define SIG_NOP 0 /* 0 is unused to catch errors */
+#define SIG_BLOCK 1 /* Block signals. */
+#define SIG_UNBLOCK 2 /* Unblock signals. */
+#define SIG_SETMASK 3 /* Set the set of blocked signals. */
+#ifdef __USE_MISC
+# define SIG_SETMASK32 256 /* Goodie from SGI for BSD compatibility:
+ set only the low 32 bit of the sigset. */
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigcontext.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigcontext.h
new file mode 100644
index 0000000..99faeed
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigcontext.h
@@ -0,0 +1,84 @@
+/* Copyright (C) 1996, 1997, 1998, 2003, 2004, 2006 Free Software
+ Foundation, Inc. This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _BITS_SIGCONTEXT_H
+#define _BITS_SIGCONTEXT_H 1
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
+#include <sgidefs.h>
+
+#if _MIPS_SIM == _ABIO32
+
+/* Certain unused fields were replaced with new ones in 2.6.12-rc4.
+ The changes were as follows:
+
+ sc_cause -> sc_hi1
+ sc_badvaddr -> sc_lo1
+ sc_sigset[0] -> sc_hi2
+ sc_sigset[1] -> sc_lo2
+ sc_sigset[2] -> sc_hi3
+ sc_sigset[3] -> sc_lo3
+
+ sc_regmask, sc_ownedfp and sc_fpc_eir are not used. */
+struct sigcontext {
+ unsigned int sc_regmask;
+ unsigned int sc_status;
+ unsigned long long sc_pc;
+ unsigned long long sc_regs[32];
+ unsigned long long sc_fpregs[32];
+ unsigned int sc_ownedfp;
+ unsigned int sc_fpc_csr;
+ unsigned int sc_fpc_eir;
+ unsigned int sc_used_math;
+ unsigned int sc_dsp;
+ unsigned long long sc_mdhi;
+ unsigned long long sc_mdlo;
+ unsigned long sc_hi1;
+ unsigned long sc_lo1;
+ unsigned long sc_hi2;
+ unsigned long sc_lo2;
+ unsigned long sc_hi3;
+ unsigned long sc_lo3;
+};
+
+#else
+
+/* This structure changed in 2.6.12-rc4 when DSP support was added. */
+struct sigcontext {
+ unsigned long long sc_regs[32];
+ unsigned long long sc_fpregs[32];
+ unsigned long long sc_mdhi;
+ unsigned long long sc_hi1;
+ unsigned long long sc_hi2;
+ unsigned long long sc_hi3;
+ unsigned long long sc_mdlo;
+ unsigned long long sc_lo1;
+ unsigned long long sc_lo2;
+ unsigned long long sc_lo3;
+ unsigned long long sc_pc;
+ unsigned int sc_fpc_csr;
+ unsigned int sc_used_math;
+ unsigned int sc_dsp;
+ unsigned int sc_reserved;
+};
+
+#endif /* _MIPS_SIM != _ABIO32 */
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigcontextinfo.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigcontextinfo.h
new file mode 100644
index 0000000..f453c8d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigcontextinfo.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Andreas Jaeger <aj@suse.de>, 2000.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+
+#include <sgidefs.h>
+
+#if _MIPS_SIM == _ABIO32
+
+#define SIGCONTEXT unsigned long _code, struct sigcontext *
+#define SIGCONTEXT_EXTRA_ARGS _code,
+#define GET_PC(ctx) ((void *) ctx->sc_pc)
+#define GET_FRAME(ctx) ((void *) ctx->sc_regs[30])
+#define GET_STACK(ctx) ((void *) ctx->sc_regs[29])
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+ (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
+
+#else
+
+#define SIGCONTEXT unsigned long _code, ucontext_t *
+#define SIGCONTEXT_EXTRA_ARGS _code,
+#define GET_PC(ctx) ((void *) ctx->uc_mcontext.pc)
+#define GET_FRAME(ctx) ((void *) ctx->uc_mcontext.gregs[30])
+#define GET_STACK(ctx) ((void *) ctx->uc_mcontext.gregs[29])
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+ (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/siginfo.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/siginfo.h
new file mode 100644
index 0000000..ba3e1f6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/siginfo.h
@@ -0,0 +1,311 @@
+/* siginfo_t, sigevent and constants. Linux/MIPS version.
+ Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if !defined _SIGNAL_H && !defined __need_siginfo_t \
+ && !defined __need_sigevent_t
+# error "Never include this file directly. Use <signal.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+
+#if (!defined __have_sigval_t \
+ && (defined _SIGNAL_H || defined __need_siginfo_t \
+ || defined __need_sigevent_t))
+# define __have_sigval_t 1
+
+/* Type for data associated with a signal. */
+typedef union sigval
+ {
+ int sival_int;
+ void *sival_ptr;
+ } sigval_t;
+#endif
+
+#if (!defined __have_siginfo_t \
+ && (defined _SIGNAL_H || defined __need_siginfo_t))
+# define __have_siginfo_t 1
+
+# define __SI_MAX_SIZE 128
+# if __WORDSIZE == 64
+# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4)
+# else
+# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3)
+# endif
+
+
+typedef struct siginfo
+ {
+ int si_signo; /* Signal number. */
+ int si_code; /* Signal code. */
+ int si_errno; /* If non-zero, an errno value associated with
+ this signal, as defined in <errno.h>. */
+ int __pad0[__SI_MAX_SIZE / sizeof (int) - __SI_PAD_SIZE - 3];
+ /* Explicit padding. */
+
+ union
+ {
+ int _pad[__SI_PAD_SIZE];
+
+ /* kill(). */
+ struct
+ {
+ __pid_t si_pid; /* Sending process ID. */
+ __uid_t si_uid; /* Real user ID of sending process. */
+ } _kill;
+
+ /* SIGCHLD. */
+ struct
+ {
+ __pid_t si_pid; /* Which child. */
+ __uid_t si_uid; /* Real user ID of sending process. */
+ int si_status; /* Exit value or signal. */
+ __clock_t si_utime;
+ __clock_t si_stime;
+ } _sigchld;
+
+ /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */
+ struct
+ {
+ void *si_addr; /* Faulting insn/memory ref. */
+ } _sigfault;
+
+ /* SIGPOLL. */
+ struct
+ {
+ int si_band; /* Band event for SIGPOLL. */
+ int si_fd;
+ } _sigpoll;
+
+ /* POSIX.1b timers. */
+ struct
+ {
+ unsigned int _timer1;
+ unsigned int _timer2;
+ } _timer;
+
+ /* POSIX.1b signals. */
+ struct
+ {
+ __pid_t si_pid; /* Sending process ID. */
+ __uid_t si_uid; /* Real user ID of sending process. */
+ sigval_t si_sigval; /* Signal value. */
+ } _rt;
+ } _sifields;
+ } siginfo_t;
+
+
+/* X/Open requires some more fields with fixed names. */
+# define si_pid _sifields._kill.si_pid
+# define si_uid _sifields._kill.si_uid
+# define si_status _sifields._sigchld.si_status
+# define si_utime _sifields._sigchld.si_utime
+# define si_stime _sifields._sigchld.si_stime
+# define si_value _sifields._rt.si_sigval
+# define si_int _sifields._rt.si_sigval.sival_int
+# define si_ptr _sifields._rt.si_sigval.sival_ptr
+# define si_addr _sifields._sigfault.si_addr
+# define si_band _sifields._sigpoll.si_band
+# define si_fd _sifields._sigpoll.si_fd
+
+
+/* Values for `si_code'. Positive values are reserved for kernel-generated
+ signals. */
+enum
+{
+ SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */
+# define SI_ASYNCNL SI_ASYNCNL
+ SI_TKILL = -6, /* Sent by tkill. */
+# define SI_TKILL SI_TKILL
+ SI_SIGIO, /* Sent by queued SIGIO. */
+# define SI_SIGIO SI_SIGIO
+ SI_MESGQ, /* Sent by real time mesq state change. */
+# define SI_MESGQ SI_MESGQ
+ SI_TIMER, /* Sent by real time mesq state change. */
+# define SI_TIMER SI_TIMER
+ SI_ASYNCIO, /* Sent by AIO completion. */
+# define SI_ASYNCIO SI_ASYNCIO
+ SI_QUEUE, /* Sent by sigqueue. */
+# define SI_QUEUE SI_QUEUE
+ SI_USER, /* Sent by kill, sigsend, raise. */
+# define SI_USER SI_USER
+ SI_KERNEL = 0x80 /* Send by kernel. */
+#define SI_KERNEL SI_KERNEL
+};
+
+
+/* `si_code' values for SIGILL signal. */
+enum
+{
+ ILL_ILLOPC = 1, /* Illegal opcode. */
+# define ILL_ILLOPC ILL_ILLOPC
+ ILL_ILLOPN, /* Illegal operand. */
+# define ILL_ILLOPN ILL_ILLOPN
+ ILL_ILLADR, /* Illegal addressing mode. */
+# define ILL_ILLADR ILL_ILLADR
+ ILL_ILLTRP, /* Illegal trap. */
+# define ILL_ILLTRP ILL_ILLTRP
+ ILL_PRVOPC, /* Privileged opcode. */
+# define ILL_PRVOPC ILL_PRVOPC
+ ILL_PRVREG, /* Privileged register. */
+# define ILL_PRVREG ILL_PRVREG
+ ILL_COPROC, /* Coprocessor error. */
+# define ILL_COPROC ILL_COPROC
+ ILL_BADSTK /* Internal stack error. */
+# define ILL_BADSTK ILL_BADSTK
+};
+
+/* `si_code' values for SIGFPE signal. */
+enum
+{
+ FPE_INTDIV = 1, /* Integer divide by zero. */
+# define FPE_INTDIV FPE_INTDIV
+ FPE_INTOVF, /* Integer overflow. */
+# define FPE_INTOVF FPE_INTOVF
+ FPE_FLTDIV, /* Floating point divide by zero. */
+# define FPE_FLTDIV FPE_FLTDIV
+ FPE_FLTOVF, /* Floating point overflow. */
+# define FPE_FLTOVF FPE_FLTOVF
+ FPE_FLTUND, /* Floating point underflow. */
+# define FPE_FLTUND FPE_FLTUND
+ FPE_FLTRES, /* Floating point inexact result. */
+# define FPE_FLTRES FPE_FLTRES
+ FPE_FLTINV, /* Floating point invalid operation. */
+# define FPE_FLTINV FPE_FLTINV
+ FPE_FLTSUB /* Subscript out of range. */
+# define FPE_FLTSUB FPE_FLTSUB
+};
+
+/* `si_code' values for SIGSEGV signal. */
+enum
+{
+ SEGV_MAPERR = 1, /* Address not mapped to object. */
+# define SEGV_MAPERR SEGV_MAPERR
+ SEGV_ACCERR /* Invalid permissions for mapped object. */
+# define SEGV_ACCERR SEGV_ACCERR
+};
+
+/* `si_code' values for SIGBUS signal. */
+enum
+{
+ BUS_ADRALN = 1, /* Invalid address alignment. */
+# define BUS_ADRALN BUS_ADRALN
+ BUS_ADRERR, /* Non-existant physical address. */
+# define BUS_ADRERR BUS_ADRERR
+ BUS_OBJERR /* Object specific hardware error. */
+# define BUS_OBJERR BUS_OBJERR
+};
+
+/* `si_code' values for SIGTRAP signal. */
+enum
+{
+ TRAP_BRKPT = 1, /* Process breakpoint. */
+# define TRAP_BRKPT TRAP_BRKPT
+ TRAP_TRACE /* Process trace trap. */
+# define TRAP_TRACE TRAP_TRACE
+};
+
+/* `si_code' values for SIGCHLD signal. */
+enum
+{
+ CLD_EXITED = 1, /* Child has exited. */
+# define CLD_EXITED CLD_EXITED
+ CLD_KILLED, /* Child was killed. */
+# define CLD_KILLED CLD_KILLED
+ CLD_DUMPED, /* Child terminated abnormally. */
+# define CLD_DUMPED CLD_DUMPED
+ CLD_TRAPPED, /* Traced child has trapped. */
+# define CLD_TRAPPED CLD_TRAPPED
+ CLD_STOPPED, /* Child has stopped. */
+# define CLD_STOPPED CLD_STOPPED
+ CLD_CONTINUED /* Stopped child has continued. */
+# define CLD_CONTINUED CLD_CONTINUED
+};
+
+/* `si_code' values for SIGPOLL signal. */
+enum
+{
+ POLL_IN = 1, /* Data input available. */
+# define POLL_IN POLL_IN
+ POLL_OUT, /* Output buffers available. */
+# define POLL_OUT POLL_OUT
+ POLL_MSG, /* Input message available. */
+# define POLL_MSG POLL_MSG
+ POLL_ERR, /* I/O error. */
+# define POLL_ERR POLL_ERR
+ POLL_PRI, /* High priority input available. */
+# define POLL_PRI POLL_PRI
+ POLL_HUP /* Device disconnected. */
+# define POLL_HUP POLL_HUP
+};
+
+# undef __need_siginfo_t
+#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */
+
+
+#if (defined _SIGNAL_H || defined __need_sigevent_t) \
+ && !defined __have_sigevent_t
+# define __have_sigevent_t 1
+
+/* Structure to transport application-defined values with signals. */
+# define __SIGEV_MAX_SIZE 64
+# define __SIGEV_HEAD_SIZE (sizeof(long) + 2*sizeof(int))
+# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE - __SIGEV_HEAD_SIZE) / sizeof (int))
+
+/* Forward declaration of the `pthread_attr_t' type. */
+struct __pthread_attr_s;
+
+/* XXX This one might need to change!!! */
+typedef struct sigevent
+ {
+ sigval_t sigev_value;
+ int sigev_signo;
+ int sigev_notify;
+
+ union
+ {
+ int _pad[__SIGEV_PAD_SIZE];
+
+ struct
+ {
+ void (*_function) (sigval_t); /* Function to start. */
+ void *_attribute; /* Really pthread_attr_t. */
+ } _sigev_thread;
+ } _sigev_un;
+ } sigevent_t;
+
+/* POSIX names to access some of the members. */
+# define sigev_notify_function _sigev_un._sigev_thread._function
+# define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+
+/* `sigev_notify' values. */
+enum
+{
+ SIGEV_SIGNAL = 0, /* Notify via signal. */
+# define SIGEV_SIGNAL SIGEV_SIGNAL
+ SIGEV_NONE, /* Other notification: meaningless. */
+# define SIGEV_NONE SIGEV_NONE
+ SIGEV_THREAD, /* Deliver via thread creation. */
+# define SIGEV_THREAD SIGEV_THREAD
+
+ SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */
+#define SIGEV_THREAD_ID SIGEV_THREAD_ID
+};
+
+#endif /* have _SIGNAL_H. */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/signum.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/signum.h
new file mode 100644
index 0000000..a9b6848
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/signum.h
@@ -0,0 +1,79 @@
+/* Signal number definitions. Linux version.
+ Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifdef _SIGNAL_H
+
+/* Fake signal functions. */
+#define SIG_ERR ((__sighandler_t) -1) /* Error return. */
+#define SIG_DFL ((__sighandler_t) 0) /* Default action. */
+#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */
+
+#ifdef __USE_UNIX98
+# define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */
+#endif
+
+
+#define SIGHUP 1 /* Hangup (POSIX). */
+#define SIGINT 2 /* Interrupt (ANSI). */
+#define SIGQUIT 3 /* Quit (POSIX). */
+#define SIGILL 4 /* Illegal instruction (ANSI). */
+#define SIGTRAP 5 /* Trace trap (POSIX). */
+#define SIGIOT 6 /* IOT trap (4.2 BSD). */
+#define SIGABRT SIGIOT /* Abort (ANSI). */
+#define SIGEMT 7
+#define SIGFPE 8 /* Floating-point exception (ANSI). */
+#define SIGKILL 9 /* Kill, unblockable (POSIX). */
+#define SIGBUS 10 /* BUS error (4.2 BSD). */
+#define SIGSEGV 11 /* Segmentation violation (ANSI). */
+#define SIGSYS 12
+#define SIGPIPE 13 /* Broken pipe (POSIX). */
+#define SIGALRM 14 /* Alarm clock (POSIX). */
+#define SIGTERM 15 /* Termination (ANSI). */
+#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */
+#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */
+#define SIGCHLD 18 /* Child status has changed (POSIX). */
+#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */
+#define SIGPWR 19 /* Power failure restart (System V). */
+#define SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */
+#define SIGURG 21 /* Urgent condition on socket (4.2 BSD). */
+#define SIGIO 22 /* I/O now possible (4.2 BSD). */
+#define SIGPOLL SIGIO /* Pollable event occurred (System V). */
+#define SIGSTOP 23 /* Stop, unblockable (POSIX). */
+#define SIGTSTP 24 /* Keyboard stop (POSIX). */
+#define SIGCONT 25 /* Continue (POSIX). */
+#define SIGTTIN 26 /* Background read from tty (POSIX). */
+#define SIGTTOU 27 /* Background write to tty (POSIX). */
+#define SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */
+#define SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */
+#define SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */
+#define SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */
+
+
+#define _NSIG 128 /* Biggest signal number + 1
+ (including real-time signals). */
+
+#define SIGRTMIN (__libc_current_sigrtmin ())
+#define SIGRTMAX (__libc_current_sigrtmax ())
+
+/* These are the hard limits of the kernel. These values should not be
+ used directly at user level. */
+#define __SIGRTMIN 32
+#define __SIGRTMAX (_NSIG - 1)
+
+#endif /* <signal.h> included. */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigset.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigset.h
new file mode 100644
index 0000000..7ccadda
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigset.h
@@ -0,0 +1,125 @@
+/* __sig_atomic_t, __sigset_t, and related definitions. Linux version.
+ Copyright (C) 1991, 1992, 1994, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SIGSET_H_types
+# define _SIGSET_H_types 1
+
+typedef int __sig_atomic_t;
+
+/* A `sigset_t' has a bit for each signal. */
+
+# define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int)))
+typedef struct
+ {
+ unsigned long int __val[_SIGSET_NWORDS];
+ } __sigset_t;
+
+#endif
+
+
+/* We only want to define these functions if <signal.h> was actually
+ included; otherwise we were included just to define the types. Since we
+ are namespace-clean, it wouldn't hurt to define extra macros. But
+ trouble can be caused by functions being defined (e.g., any global
+ register vars declared later will cause compilation errors). */
+
+#if !defined _SIGSET_H_fns && defined _SIGNAL_H
+# define _SIGSET_H_fns 1
+
+# ifndef _EXTERN_INLINE
+# define _EXTERN_INLINE extern __inline
+# endif
+
+/* Return a mask that includes the bit for SIG only. */
+# define __sigmask(sig) \
+ (((unsigned long int) 1) << (((sig) - 1) % (8 * sizeof (unsigned long int))))
+
+/* Return the word index for SIG. */
+# define __sigword(sig) (((sig) - 1) / (8 * sizeof (unsigned long int)))
+
+# if defined __GNUC__ && __GNUC__ >= 2
+# define __sigemptyset(set) \
+ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
+ sigset_t *__set = (set); \
+ while (--__cnt >= 0) __set->__val[__cnt] = 0; \
+ 0; }))
+# define __sigfillset(set) \
+ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
+ sigset_t *__set = (set); \
+ while (--__cnt >= 0) __set->__val[__cnt] = ~0UL; \
+ 0; }))
+
+# ifdef __USE_GNU
+/* The POSIX does not specify for handling the whole signal set in one
+ command. This is often wanted and so we define three more functions
+ here. */
+# define __sigisemptyset(set) \
+ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
+ const sigset_t *__set = (set); \
+ int __ret = __set->__val[--__cnt]; \
+ while (!__ret && --__cnt >= 0) \
+ __ret = __set->__val[__cnt]; \
+ __ret == 0; }))
+# define __sigandset(dest, left, right) \
+ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
+ sigset_t *__dest = (dest); \
+ const sigset_t *__left = (left); \
+ const sigset_t *__right = (right); \
+ while (--__cnt >= 0) \
+ __dest->__val[__cnt] = (__left->__val[__cnt] \
+ & __right->__val[__cnt]); \
+ 0; }))
+# define __sigorset(dest, left, right) \
+ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
+ sigset_t *__dest = (dest); \
+ const sigset_t *__left = (left); \
+ const sigset_t *__right = (right); \
+ while (--__cnt >= 0) \
+ __dest->__val[__cnt] = (__left->__val[__cnt] \
+ | __right->__val[__cnt]); \
+ 0; }))
+# endif
+# endif
+
+/* These functions needn't check for a bogus signal number -- error
+ checking is done in the non __ versions. */
+
+extern int __sigismember (__const __sigset_t *, int);
+extern int __sigaddset (__sigset_t *, int);
+extern int __sigdelset (__sigset_t *, int);
+
+# ifdef __USE_EXTERN_INLINES
+# define __SIGSETFN(NAME, BODY, CONST) \
+ _EXTERN_INLINE int \
+ NAME (CONST __sigset_t *__set, int __sig) \
+ { \
+ unsigned long int __mask = __sigmask (__sig); \
+ unsigned long int __word = __sigword (__sig); \
+ return BODY; \
+ }
+
+__SIGSETFN (__sigismember, (__set->__val[__word] & __mask) ? 1 : 0, __const)
+__SIGSETFN (__sigaddset, ((__set->__val[__word] |= __mask), 0), )
+__SIGSETFN (__sigdelset, ((__set->__val[__word] &= ~__mask), 0), )
+
+# undef __SIGSETFN
+# endif
+
+
+#endif /* ! _SIGSET_H_fns. */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigstack.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigstack.h
new file mode 100644
index 0000000..d2c8552
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigstack.h
@@ -0,0 +1,55 @@
+/* sigstack, sigaltstack definitions.
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SIGNAL_H
+# error "Never include this file directly. Use <signal.h> instead"
+#endif
+
+
+/* Structure describing a signal stack (obsolete). */
+struct sigstack
+ {
+ void *ss_sp; /* Signal stack pointer. */
+ int ss_onstack; /* Nonzero if executing on this stack. */
+ };
+
+
+/* Possible values for `ss_flags.'. */
+enum
+{
+ SS_ONSTACK = 1,
+#define SS_ONSTACK SS_ONSTACK
+ SS_DISABLE
+#define SS_DISABLE SS_DISABLE
+};
+
+/* Minimum stack size for a signal handler. */
+#define MINSIGSTKSZ 2048
+
+/* System default stack size. */
+#define SIGSTKSZ 8192
+
+
+/* Alternate, preferred interface. */
+typedef struct sigaltstack
+ {
+ void *ss_sp;
+ size_t ss_size;
+ int ss_flags;
+ } stack_t;
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigthread.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigthread.h
new file mode 100644
index 0000000..960bde1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sigthread.h
@@ -0,0 +1,38 @@
+/* Signal handling function for threaded programs.
+ Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef _BITS_SIGTHREAD_H
+#define _BITS_SIGTHREAD_H 1
+
+#if !defined _SIGNAL_H && !defined _PTHREAD_H
+# error "Never include this file directly. Use <pthread.h> instead"
+#endif
+
+/* Functions for handling signals. */
+
+/* Modify the signal mask for the calling thread. The arguments have
+ the same meaning as for sigprocmask(2). */
+extern int pthread_sigmask (int __how,
+ __const __sigset_t *__restrict __newmask,
+ __sigset_t *__restrict __oldmask)__THROW;
+
+/* Send signal SIGNO to the given thread. */
+extern int pthread_kill (pthread_t __threadid, int __signo) __THROW;
+
+#endif /* bits/sigthread.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sockaddr.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sockaddr.h
new file mode 100644
index 0000000..3e1d131
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sockaddr.h
@@ -0,0 +1,40 @@
+/* Definition of `struct sockaddr_*' common members. Generic/4.2 BSD version.
+ Copyright (C) 1995,1996,1997,1998,2000,2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * Never include this file directly; use <sys/socket.h> instead.
+ */
+
+#ifndef _BITS_SOCKADDR_H
+#define _BITS_SOCKADDR_H 1
+
+
+/* POSIX.1g specifies this type name for the `sa_family' member. */
+typedef unsigned short int sa_family_t;
+
+/* This macro is used to declare the initial common members
+ of the data types used for socket addresses, `struct sockaddr',
+ `struct sockaddr_in', `struct sockaddr_un', etc. */
+
+#define __SOCKADDR_COMMON(sa_prefix) \
+ sa_family_t sa_prefix##family
+
+#define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int))
+
+#endif /* bits/sockaddr.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/socket.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/socket.h
new file mode 100644
index 0000000..414d0e8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/socket.h
@@ -0,0 +1,328 @@
+/* System-specific socket constants and types. Linux/MIPS version.
+ Copyright (C) 1991, 92, 1994-1999, 2000, 2001, 2004, 2005, 2006
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef __BITS_SOCKET_H
+#define __BITS_SOCKET_H
+
+#if !defined _SYS_SOCKET_H && !defined _NETINET_IN_H
+# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
+#endif
+
+#define __need_size_t
+#define __need_NULL
+#include <stddef.h>
+
+#include <limits.h>
+#include <sys/types.h>
+
+/* Type for length arguments in socket calls. */
+#ifndef __socklen_t_defined
+typedef __socklen_t socklen_t;
+# define __socklen_t_defined
+#endif
+
+/* Types of sockets. */
+enum __socket_type
+{
+ SOCK_DGRAM = 1, /* Connectionless, unreliable datagrams
+ of fixed maximum length. */
+#define SOCK_DGRAM SOCK_DGRAM
+ SOCK_STREAM = 2, /* Sequenced, reliable, connection-based
+ byte streams. */
+#define SOCK_STREAM SOCK_STREAM
+ SOCK_RAW = 3, /* Raw protocol interface. */
+#define SOCK_RAW SOCK_RAW
+ SOCK_RDM = 4, /* Reliably-delivered messages. */
+#define SOCK_RDM SOCK_RDM
+ SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
+ datagrams of fixed maximum length. */
+#define SOCK_SEQPACKET SOCK_SEQPACKET
+ SOCK_PACKET = 10 /* Linux specific way of getting packets
+ at the dev level. For writing rarp and
+ other similar things on the user level. */
+#define SOCK_PACKET SOCK_PACKET
+};
+
+/* Protocol families. */
+#define PF_UNSPEC 0 /* Unspecified. */
+#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */
+#define PF_UNIX PF_LOCAL /* Old BSD name for PF_LOCAL. */
+#define PF_FILE PF_LOCAL /* Another non-standard name for PF_LOCAL. */
+#define PF_INET 2 /* IP protocol family. */
+#define PF_AX25 3 /* Amateur Radio AX.25. */
+#define PF_IPX 4 /* Novell Internet Protocol. */
+#define PF_APPLETALK 5 /* Appletalk DDP. */
+#define PF_NETROM 6 /* Amateur radio NetROM. */
+#define PF_BRIDGE 7 /* Multiprotocol bridge. */
+#define PF_ATMPVC 8 /* ATM PVCs. */
+#define PF_X25 9 /* Reserved for X.25 project. */
+#define PF_INET6 10 /* IP version 6. */
+#define PF_ROSE 11 /* Amateur Radio X.25 PLP. */
+#define PF_DECnet 12 /* Reserved for DECnet project. */
+#define PF_NETBEUI 13 /* Reserved for 802.2LLC project. */
+#define PF_SECURITY 14 /* Security callback pseudo AF. */
+#define PF_KEY 15 /* PF_KEY key management API. */
+#define PF_NETLINK 16
+#define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD. */
+#define PF_PACKET 17 /* Packet family. */
+#define PF_ASH 18 /* Ash. */
+#define PF_ECONET 19 /* Acorn Econet. */
+#define PF_ATMSVC 20 /* ATM SVCs. */
+#define PF_SNA 22 /* Linux SNA Project */
+#define PF_IRDA 23 /* IRDA sockets. */
+#define PF_PPPOX 24 /* PPPoX sockets. */
+#define PF_WANPIPE 25 /* Wanpipe API sockets. */
+#define PF_BLUETOOTH 31 /* Bluetooth sockets. */
+#define PF_MAX 32 /* For now.. */
+
+/* Address families. */
+#define AF_UNSPEC PF_UNSPEC
+#define AF_LOCAL PF_LOCAL
+#define AF_UNIX PF_UNIX
+#define AF_FILE PF_FILE
+#define AF_INET PF_INET
+#define AF_AX25 PF_AX25
+#define AF_IPX PF_IPX
+#define AF_APPLETALK PF_APPLETALK
+#define AF_NETROM PF_NETROM
+#define AF_BRIDGE PF_BRIDGE
+#define AF_ATMPVC PF_ATMPVC
+#define AF_X25 PF_X25
+#define AF_INET6 PF_INET6
+#define AF_ROSE PF_ROSE
+#define AF_DECnet PF_DECnet
+#define AF_NETBEUI PF_NETBEUI
+#define AF_SECURITY PF_SECURITY
+#define AF_KEY PF_KEY
+#define AF_NETLINK PF_NETLINK
+#define AF_ROUTE PF_ROUTE
+#define AF_PACKET PF_PACKET
+#define AF_ASH PF_ASH
+#define AF_ECONET PF_ECONET
+#define AF_ATMSVC PF_ATMSVC
+#define AF_SNA PF_SNA
+#define AF_IRDA PF_IRDA
+#define AF_PPPOX PF_PPPOX
+#define AF_WANPIPE PF_WANPIPE
+#define AF_BLUETOOTH PF_BLUETOOTH
+#define AF_MAX PF_MAX
+
+/* Socket level values. Others are defined in the appropriate headers.
+
+ XXX These definitions also should go into the appropriate headers as
+ far as they are available. */
+#define SOL_RAW 255
+#define SOL_DECNET 261
+#define SOL_X25 262
+#define SOL_PACKET 263
+#define SOL_ATM 264 /* ATM layer (cell level). */
+#define SOL_AAL 265 /* ATM Adaption Layer (packet level). */
+#define SOL_IRDA 266
+
+/* Maximum queue length specifiable by listen. */
+#define SOMAXCONN 128
+
+/* Get the definition of the macro to define the common sockaddr members. */
+#include <bits/sockaddr.h>
+
+/* Structure describing a generic socket address. */
+struct sockaddr
+ {
+ __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
+ char sa_data[14]; /* Address data. */
+ };
+
+
+/* Structure large enough to hold any socket address (with the historical
+ exception of AF_UNIX). We reserve 128 bytes. */
+#if ULONG_MAX > 0xffffffff
+# define __ss_aligntype __uint64_t
+#else
+# define __ss_aligntype __uint32_t
+#endif
+#define _SS_SIZE 128
+#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype)))
+
+struct sockaddr_storage
+ {
+ __SOCKADDR_COMMON (ss_); /* Address family, etc. */
+ __ss_aligntype __ss_align; /* Force desired alignment. */
+ char __ss_padding[_SS_PADSIZE];
+ };
+
+
+/* Bits in the FLAGS argument to `send', `recv', et al. */
+enum
+ {
+ MSG_OOB = 0x01, /* Process out-of-band data. */
+#define MSG_OOB MSG_OOB
+ MSG_PEEK = 0x02, /* Peek at incoming messages. */
+#define MSG_PEEK MSG_PEEK
+ MSG_DONTROUTE = 0x04, /* Don't use local routing. */
+#define MSG_DONTROUTE MSG_DONTROUTE
+#ifdef __USE_GNU
+ /* DECnet uses a different name. */
+ MSG_TRYHARD = MSG_DONTROUTE,
+# define MSG_TRYHARD MSG_DONTROUTE
+#endif
+ MSG_CTRUNC = 0x08, /* Control data lost before delivery. */
+#define MSG_CTRUNC MSG_CTRUNC
+ MSG_PROXY = 0x10, /* Supply or ask second address. */
+#define MSG_PROXY MSG_PROXY
+ MSG_TRUNC = 0x20,
+#define MSG_TRUNC MSG_TRUNC
+ MSG_DONTWAIT = 0x40, /* Nonblocking IO. */
+#define MSG_DONTWAIT MSG_DONTWAIT
+ MSG_EOR = 0x80, /* End of record. */
+#define MSG_EOR MSG_EOR
+ MSG_WAITALL = 0x100, /* Wait for a full request. */
+#define MSG_WAITALL MSG_WAITALL
+ MSG_FIN = 0x200,
+#define MSG_FIN MSG_FIN
+ MSG_SYN = 0x400,
+#define MSG_SYN MSG_SYN
+ MSG_CONFIRM = 0x800, /* Confirm path validity. */
+#define MSG_CONFIRM MSG_CONFIRM
+ MSG_RST = 0x1000,
+#define MSG_RST MSG_RST
+ MSG_ERRQUEUE = 0x2000, /* Fetch message from error queue. */
+#define MSG_ERRQUEUE MSG_ERRQUEUE
+ MSG_NOSIGNAL = 0x4000, /* Do not generate SIGPIPE. */
+#define MSG_NOSIGNAL MSG_NOSIGNAL
+ MSG_MORE = 0x8000 /* Sender will send more. */
+#define MSG_MORE MSG_MORE
+ };
+
+
+/* Structure describing messages sent by
+ `sendmsg' and received by `recvmsg'. */
+/* Note: do not change these members to match glibc; these match the
+ SuSv3 spec already (e.g. msg_iovlen/msg_controllen).
+ http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/socket.h.html */
+/* Note: linux kernel uses __kernel_size_t (which is 8bytes on 64bit
+ platforms, and 4bytes on 32bit platforms) for msg_iovlen/msg_controllen */
+struct msghdr
+ {
+ void *msg_name; /* Address to send to/receive from. */
+ socklen_t msg_namelen; /* Length of address data. */
+
+ struct iovec *msg_iov; /* Vector of data to send/receive into. */
+#if __WORDSIZE == 32
+ int msg_iovlen; /* Number of elements in the vector. */
+#else
+ size_t msg_iovlen; /* Number of elements in the vector. */
+#endif
+
+ void *msg_control; /* Ancillary data (eg BSD filedesc passing). */
+#if __WORDSIZE == 32
+ socklen_t msg_controllen; /* Ancillary data buffer length. */
+#else
+ size_t msg_controllen; /* Ancillary data buffer length. */
+#endif
+
+ int msg_flags; /* Flags on received message. */
+ };
+
+/* Structure used for storage of ancillary data object information. */
+struct cmsghdr
+ {
+ size_t cmsg_len; /* Length of data in cmsg_data plus length
+ of cmsghdr structure. */
+ int cmsg_level; /* Originating protocol. */
+ int cmsg_type; /* Protocol specific type. */
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+ __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */
+#endif
+ };
+
+/* Ancillary data object manipulation macros. */
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
+#else
+# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
+#endif
+#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
+#define CMSG_FIRSTHDR(mhdr) \
+ ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
+ ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
+#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
+ & (size_t) ~(sizeof (size_t) - 1))
+#define CMSG_SPACE(len) (CMSG_ALIGN (len) \
+ + CMSG_ALIGN (sizeof (struct cmsghdr)))
+#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+
+extern struct cmsghdr * __NTH (__cmsg_nxthdr (struct msghdr *__mhdr,
+ struct cmsghdr *__cmsg));
+#ifdef __USE_EXTERN_INLINES
+# ifndef _EXTERN_INLINE
+# define _EXTERN_INLINE extern __inline
+# endif
+_EXTERN_INLINE struct cmsghdr *
+__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+{
+ if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+ /* The kernel header does this so there may be a reason. */
+ return 0;
+
+ __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ + CMSG_ALIGN (__cmsg->cmsg_len));
+ if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+ + __mhdr->msg_controllen)
+ || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+ > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+ /* No more entries. */
+ return 0;
+ return __cmsg;
+}
+#endif /* Use `extern inline'. */
+
+/* Socket level message types. This must match the definitions in
+ <linux/socket.h>. */
+enum
+ {
+ SCM_RIGHTS = 0x01 /* Transfer file descriptors. */
+#define SCM_RIGHTS SCM_RIGHTS
+#ifdef __USE_BSD
+ , SCM_CREDENTIALS = 0x02 /* Credentials passing. */
+# define SCM_CREDENTIALS SCM_CREDENTIALS
+#endif
+ };
+
+/* User visible structure for SCM_CREDENTIALS message */
+
+struct ucred
+{
+ pid_t pid; /* PID of sending process. */
+ uid_t uid; /* UID of sending process. */
+ gid_t gid; /* GID of sending process. */
+};
+
+/* Get socket manipulation related informations from kernel headers. */
+#include <asm/socket.h>
+
+
+/* Structure used to manipulate the SO_LINGER option. */
+struct linger
+ {
+ int l_onoff; /* Nonzero to linger on close. */
+ int l_linger; /* Time to linger. */
+ };
+
+#endif /* bits/socket.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/stackinfo.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/stackinfo.h
new file mode 100644
index 0000000..86e3d62
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/stackinfo.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* This file contains a bit of information about the stack allocation
+ of the processor. */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H 1
+
+/* On MIPS the stack grows down. */
+#define _STACK_GROWS_DOWN 1
+
+#endif /* stackinfo.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/stat.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/stat.h
new file mode 100644
index 0000000..e35d649
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/stat.h
@@ -0,0 +1,203 @@
+/* Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
+
+#include <sgidefs.h>
+
+/* Versions of the `struct stat' data structure. */
+#define _STAT_VER_LINUX_OLD 1
+#define _STAT_VER_KERNEL 1
+#define _STAT_VER_SVR4 2
+#define _STAT_VER_LINUX 3
+#define _STAT_VER _STAT_VER_LINUX /* The one defined below. */
+
+/* Versions of the `xmknod' interface. */
+#define _MKNOD_VER_LINUX 1
+#define _MKNOD_VER_SVR4 2
+#define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */
+
+
+#if _MIPS_SIM == _ABIO32
+/* Structure describing file characteristics. */
+struct stat
+ {
+ __dev_t st_dev;
+ long int st_pad1[2];
+#ifndef __USE_FILE_OFFSET64
+ __ino_t st_ino; /* File serial number. */
+#else
+ __ino64_t st_ino; /* File serial number. */
+#endif
+ __mode_t st_mode; /* File mode. */
+ __nlink_t st_nlink; /* Link count. */
+ __uid_t st_uid; /* User ID of the file's owner. */
+ __gid_t st_gid; /* Group ID of the file's group.*/
+ __dev_t st_rdev; /* Device number, if device. */
+#ifndef __USE_FILE_OFFSET64
+ long int st_pad2[1];
+ __off_t st_size; /* Size of file, in bytes. */
+ /* SVR4 added this extra long to allow for expansion of off_t. */
+ long int st_pad3;
+#else
+ long int st_pad2[2];
+ __off64_t st_size; /* Size of file, in bytes. */
+#endif
+ /*
+ * Actually this should be timestruc_t st_atime, st_mtime and
+ * st_ctime but we don't have it under Linux.
+ */
+ __time_t st_atime; /* Time of last access. */
+ unsigned long int st_atimensec; /* Nscecs of last access. */
+ __time_t st_mtime; /* Time of last modification. */
+ unsigned long int st_mtimensec; /* Nsecs of last modification. */
+ __time_t st_ctime; /* Time of last status change. */
+ unsigned long int st_ctimensec; /* Nsecs of last status change. */
+ __blksize_t st_blksize; /* Optimal block size for I/O. */
+#ifndef __USE_FILE_OFFSET64
+ __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */
+#else
+ long int st_pad4;
+ __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */
+#endif
+ long int st_pad5[14];
+ };
+#else /* N32 || N64 */
+/* The memory layout is the same as of struct stat64 of the 32-bit kernel. */
+struct stat {
+ unsigned int st_dev;
+ int st_pad1[3];
+ __ino_t st_ino; /* File serial number. */
+ __mode_t st_mode; /* File mode. */
+ __nlink_t st_nlink; /* Link count. */
+ __uid_t st_uid; /* User ID of the file's owner. */
+ __gid_t st_gid; /* Group ID of the file's group.*/
+ unsigned int st_rdev; /* Device number, if device. */
+ int st_pad2[3];
+ __off_t st_size; /* Size of file, in bytes. */
+ /*
+ * Actually this should be timestruc_t st_atime, st_mtime and
+ * st_ctime but we don't have it under Linux.
+ */
+ int st_atime;
+ int st_atimensec;
+ int st_mtime;
+ int st_mtimensec;
+ int st_ctime;
+ int st_ctimensec;
+ int st_blksize; /* Optimal block size for I/O. */
+ int st_pad3;
+ __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */
+ int st_pad4[14];
+};
+#endif /* N32 || N64 */
+
+#ifdef __USE_LARGEFILE64
+#if _MIPS_SIM == _ABIO32
+struct stat64
+ {
+ __dev_t st_dev;
+ long int st_pad1[2];
+ __ino64_t st_ino; /* File serial number. */
+ __mode_t st_mode; /* File mode. */
+ __nlink_t st_nlink; /* Link count. */
+ __uid_t st_uid; /* User ID of the file's owner. */
+ __gid_t st_gid; /* Group ID of the file's group.*/
+ __dev_t st_rdev; /* Device number, if device. */
+ long int st_pad2[2];
+ __off64_t st_size; /* Size of file, in bytes. */
+ /*
+ * Actually this should be timestruc_t st_atime, st_mtime and
+ * st_ctime but we don't have it under Linux.
+ */
+ __time_t st_atime; /* Time of last access. */
+ unsigned long int st_atimensec; /* Nscecs of last access. */
+ __time_t st_mtime; /* Time of last modification. */
+ unsigned long int st_mtimensec; /* Nsecs of last modification. */
+ __time_t st_ctime; /* Time of last status change. */
+ unsigned long int st_ctimensec; /* Nsecs of last status change. */
+ __blksize_t st_blksize; /* Optimal block size for I/O. */
+ long int st_pad3;
+ __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */
+ long int st_pad4[14];
+ };
+#else /* N32 || N64 */
+/* stat64 of N32/N64 is just an alias of stat syscall. */
+struct stat64 {
+ unsigned int st_dev;
+ int st_pad1[3];
+ __ino_t st_ino; /* File serial number. */
+ __mode_t st_mode; /* File mode. */
+ __nlink_t st_nlink; /* Link count. */
+ __uid_t st_uid; /* User ID of the file's owner. */
+ __gid_t st_gid; /* Group ID of the file's group.*/
+ unsigned int st_rdev; /* Device number, if device. */
+ int st_pad2[3];
+ __off_t st_size; /* Size of file, in bytes. */
+ /*
+ * Actually this should be timestruc_t st_atime, st_mtime and
+ * st_ctime but we don't have it under Linux.
+ */
+ int st_atime;
+ int st_atimensec;
+ int st_mtime;
+ int st_mtimensec;
+ int st_ctime;
+ int st_ctimensec;
+ int st_blksize; /* Optimal block size for I/O. */
+ int st_pad3;
+ __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */
+ int st_pad4[14];
+};
+#endif /* N32 || N64 */
+#endif
+
+/* Tell code we have these members. */
+#define _STATBUF_ST_BLKSIZE
+#define _STATBUF_ST_RDEV
+
+/* Encoding of the file mode. */
+
+#define __S_IFMT 0170000 /* These bits determine file type. */
+
+/* File types. */
+#define __S_IFDIR 0040000 /* Directory. */
+#define __S_IFCHR 0020000 /* Character device. */
+#define __S_IFBLK 0060000 /* Block device. */
+#define __S_IFREG 0100000 /* Regular file. */
+#define __S_IFIFO 0010000 /* FIFO. */
+#define __S_IFLNK 0120000 /* Symbolic link. */
+#define __S_IFSOCK 0140000 /* Socket. */
+
+/* POSIX.1b objects. Note that these macros always evaluate to zero. But
+ they do it by enforcing the correct use of the macros. */
+#define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
+
+/* Protection bits. */
+
+#define __S_ISUID 04000 /* Set user ID on execution. */
+#define __S_ISGID 02000 /* Set group ID on execution. */
+#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */
+#define __S_IREAD 0400 /* Read by owner. */
+#define __S_IWRITE 0200 /* Write by owner. */
+#define __S_IEXEC 0100 /* Execute by owner. */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/statfs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/statfs.h
new file mode 100644
index 0000000..2f9bd54
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/statfs.h
@@ -0,0 +1,72 @@
+/* Copyright (C) 1997, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_STATFS_H
+# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
+#endif
+
+#include <bits/types.h> /* for __fsid_t and __fsblkcnt_t*/
+
+struct statfs
+ {
+ long int f_type;
+#define f_fstyp f_type
+ long int f_bsize;
+ long int f_frsize; /* Fragment size - unsupported */
+#ifndef __USE_FILE_OFFSET64
+ __fsblkcnt_t f_blocks;
+ __fsblkcnt_t f_bfree;
+ __fsblkcnt_t f_files;
+ __fsblkcnt_t f_ffree;
+ __fsblkcnt_t f_bavail;
+#else
+ __fsblkcnt64_t f_blocks;
+ __fsblkcnt64_t f_bfree;
+ __fsblkcnt64_t f_files;
+ __fsblkcnt64_t f_ffree;
+ __fsblkcnt64_t f_bavail;
+#endif
+
+ /* Linux specials */
+ __fsid_t f_fsid;
+ long int f_namelen;
+ long int f_spare[6];
+ };
+
+#ifdef __USE_LARGEFILE64
+struct statfs64
+ {
+ long int f_type;
+#define f_fstyp f_type
+ long int f_bsize;
+ long int f_frsize; /* Fragment size - unsupported */
+ __fsblkcnt64_t f_blocks;
+ __fsblkcnt64_t f_bfree;
+ __fsblkcnt64_t f_files;
+ __fsblkcnt64_t f_ffree;
+ __fsblkcnt64_t f_bavail;
+
+ /* Linux specials */
+ __fsid_t f_fsid;
+ long int f_namelen;
+ long int f_spare[6];
+ };
+#endif
+
+/* Tell code we have these members. */
+#define _STATFS_F_NAMELEN
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/statvfs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/statvfs.h
new file mode 100644
index 0000000..cca0871
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/statvfs.h
@@ -0,0 +1,107 @@
+/* Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_STATVFS_H
+# error "Never include <bits/statvfs.h> directly; use <sys/statvfs.h> instead."
+#endif
+
+#include <bits/types.h> /* For __fsblkcnt_t and __fsfilcnt_t. */
+
+#if __WORDSIZE == 32
+#define _STATVFSBUF_F_UNUSED
+#endif
+
+struct statvfs
+ {
+ unsigned long int f_bsize;
+ unsigned long int f_frsize;
+#ifndef __USE_FILE_OFFSET64
+ __fsblkcnt_t f_blocks;
+ __fsblkcnt_t f_bfree;
+ __fsblkcnt_t f_bavail;
+ __fsfilcnt_t f_files;
+ __fsfilcnt_t f_ffree;
+ __fsfilcnt_t f_favail;
+#else
+ __fsblkcnt64_t f_blocks;
+ __fsblkcnt64_t f_bfree;
+ __fsblkcnt64_t f_bavail;
+ __fsfilcnt64_t f_files;
+ __fsfilcnt64_t f_ffree;
+ __fsfilcnt64_t f_favail;
+#endif
+ unsigned long int f_fsid;
+#ifdef _STATVFSBUF_F_UNUSED
+ int __f_unused;
+#endif
+ unsigned long int f_flag;
+ unsigned long int f_namemax;
+ int __f_spare[6];
+ };
+
+#ifdef __USE_LARGEFILE64
+struct statvfs64
+ {
+ unsigned long int f_bsize;
+ unsigned long int f_frsize;
+ __fsblkcnt64_t f_blocks;
+ __fsblkcnt64_t f_bfree;
+ __fsblkcnt64_t f_bavail;
+ __fsfilcnt64_t f_files;
+ __fsfilcnt64_t f_ffree;
+ __fsfilcnt64_t f_favail;
+ unsigned long int f_fsid;
+#ifdef _STATVFSBUF_F_UNUSED
+ int __f_unused;
+#endif
+ unsigned long int f_flag;
+ unsigned long int f_namemax;
+ int __f_spare[6];
+ };
+#endif
+
+/* Definitions for the flag in `f_flag'. These definitions should be
+ kept in sync with the definitions in <sys/mount.h>. */
+enum
+{
+ ST_RDONLY = 1, /* Mount read-only. */
+#define ST_RDONLY ST_RDONLY
+ ST_NOSUID = 2 /* Ignore suid and sgid bits. */
+#define ST_NOSUID ST_NOSUID
+#ifdef __USE_GNU
+ ,
+ ST_NODEV = 4, /* Disallow access to device special files. */
+# define ST_NODEV ST_NODEV
+ ST_NOEXEC = 8, /* Disallow program execution. */
+# define ST_NOEXEC ST_NOEXEC
+ ST_SYNCHRONOUS = 16, /* Writes are synced at once. */
+# define ST_SYNCHRONOUS ST_SYNCHRONOUS
+ ST_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
+# define ST_MANDLOCK ST_MANDLOCK
+ ST_WRITE = 128, /* Write on file/directory/symlink. */
+# define ST_WRITE ST_WRITE
+ ST_APPEND = 256, /* Append-only file. */
+# define ST_APPEND ST_APPEND
+ ST_IMMUTABLE = 512, /* Immutable file. */
+# define ST_IMMUTABLE ST_IMMUTABLE
+ ST_NOATIME = 1024, /* Do not update access times. */
+# define ST_NOATIME ST_NOATIME
+ ST_NODIRATIME = 2048 /* Do not update directory access times. */
+# define ST_NODIRATIME ST_NODIRATIME
+#endif /* Use GNU. */
+};
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/stdio.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/stdio.h
new file mode 100644
index 0000000..d0ba463
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/stdio.h
@@ -0,0 +1,23 @@
+/* Optimizing macros and inline functions for stdio functions.
+ Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _STDIO_H
+# error "Never include <bits/stdio.h> directly; use <stdio.h> instead."
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/stdio_lim.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/stdio_lim.h
new file mode 100644
index 0000000..ea6d693
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/stdio_lim.h
@@ -0,0 +1,41 @@
+/* Copyright (C) 1994, 1997, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if !defined _STDIO_H && !defined __need_FOPEN_MAX && !defined __need_IOV_MAX
+# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
+#endif
+
+#ifdef _STDIO_H
+# define L_tmpnam 20
+# define TMP_MAX 238328
+# define FILENAME_MAX 4095
+
+# ifdef __USE_POSIX
+# define L_ctermid 9
+# define L_cuserid 9
+# endif
+#endif
+
+#if defined __need_FOPEN_MAX || defined _STDIO_H
+# undef FOPEN_MAX
+# define FOPEN_MAX 16
+#endif
+
+#if defined __need_IOV_MAX && !defined IOV_MAX
+# define IOV_MAX 1024
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/syscalls.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/syscalls.h
new file mode 100644
index 0000000..8c87d6d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/syscalls.h
@@ -0,0 +1 @@
+/* Dont use _syscall#() macros; use the syscall() function */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sysnum.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sysnum.h
new file mode 100644
index 0000000..bccf8b8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/sysnum.h
@@ -0,0 +1,1028 @@
+/* WARNING!!! AUTO-GENERATED FILE!!! DO NOT EDIT!!! */
+
+#ifndef _BITS_SYSNUM_H
+#define _BITS_SYSNUM_H
+
+#ifndef _SYSCALL_H
+# error "Never use <bits/sysnum.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#undef __NR_Linux
+#define __NR_Linux 4000
+#define SYS_Linux __NR_Linux
+#undef __NR_syscall
+#define __NR_syscall (4000 + 0)
+#define SYS_syscall __NR_syscall
+#undef __NR_exit
+#define __NR_exit (4000 + 1)
+#define SYS_exit __NR_exit
+#undef __NR_fork
+#define __NR_fork (4000 + 2)
+#define SYS_fork __NR_fork
+#undef __NR_read
+#define __NR_read (4000 + 3)
+#define SYS_read __NR_read
+#undef __NR_write
+#define __NR_write (4000 + 4)
+#define SYS_write __NR_write
+#undef __NR_open
+#define __NR_open (4000 + 5)
+#define SYS_open __NR_open
+#undef __NR_close
+#define __NR_close (4000 + 6)
+#define SYS_close __NR_close
+#undef __NR_waitpid
+#define __NR_waitpid (4000 + 7)
+#define SYS_waitpid __NR_waitpid
+#undef __NR_creat
+#define __NR_creat (4000 + 8)
+#define SYS_creat __NR_creat
+#undef __NR_link
+#define __NR_link (4000 + 9)
+#define SYS_link __NR_link
+#undef __NR_unlink
+#define __NR_unlink (4000 + 10)
+#define SYS_unlink __NR_unlink
+#undef __NR_execve
+#define __NR_execve (4000 + 11)
+#define SYS_execve __NR_execve
+#undef __NR_chdir
+#define __NR_chdir (4000 + 12)
+#define SYS_chdir __NR_chdir
+#undef __NR_time
+#define __NR_time (4000 + 13)
+#define SYS_time __NR_time
+#undef __NR_mknod
+#define __NR_mknod (4000 + 14)
+#define SYS_mknod __NR_mknod
+#undef __NR_chmod
+#define __NR_chmod (4000 + 15)
+#define SYS_chmod __NR_chmod
+#undef __NR_lchown
+#define __NR_lchown (4000 + 16)
+#define SYS_lchown __NR_lchown
+#undef __NR_break
+#define __NR_break (4000 + 17)
+#define SYS_break __NR_break
+#undef __NR_unused18
+#define __NR_unused18 (4000 + 18)
+#define SYS_unused18 __NR_unused18
+#undef __NR_lseek
+#define __NR_lseek (4000 + 19)
+#define SYS_lseek __NR_lseek
+#undef __NR_getpid
+#define __NR_getpid (4000 + 20)
+#define SYS_getpid __NR_getpid
+#undef __NR_mount
+#define __NR_mount (4000 + 21)
+#define SYS_mount __NR_mount
+#undef __NR_umount
+#define __NR_umount (4000 + 22)
+#define SYS_umount __NR_umount
+#undef __NR_setuid
+#define __NR_setuid (4000 + 23)
+#define SYS_setuid __NR_setuid
+#undef __NR_getuid
+#define __NR_getuid (4000 + 24)
+#define SYS_getuid __NR_getuid
+#undef __NR_stime
+#define __NR_stime (4000 + 25)
+#define SYS_stime __NR_stime
+#undef __NR_ptrace
+#define __NR_ptrace (4000 + 26)
+#define SYS_ptrace __NR_ptrace
+#undef __NR_alarm
+#define __NR_alarm (4000 + 27)
+#define SYS_alarm __NR_alarm
+#undef __NR_unused28
+#define __NR_unused28 (4000 + 28)
+#define SYS_unused28 __NR_unused28
+#undef __NR_pause
+#define __NR_pause (4000 + 29)
+#define SYS_pause __NR_pause
+#undef __NR_utime
+#define __NR_utime (4000 + 30)
+#define SYS_utime __NR_utime
+#undef __NR_stty
+#define __NR_stty (4000 + 31)
+#define SYS_stty __NR_stty
+#undef __NR_gtty
+#define __NR_gtty (4000 + 32)
+#define SYS_gtty __NR_gtty
+#undef __NR_access
+#define __NR_access (4000 + 33)
+#define SYS_access __NR_access
+#undef __NR_nice
+#define __NR_nice (4000 + 34)
+#define SYS_nice __NR_nice
+#undef __NR_ftime
+#define __NR_ftime (4000 + 35)
+#define SYS_ftime __NR_ftime
+#undef __NR_sync
+#define __NR_sync (4000 + 36)
+#define SYS_sync __NR_sync
+#undef __NR_kill
+#define __NR_kill (4000 + 37)
+#define SYS_kill __NR_kill
+#undef __NR_rename
+#define __NR_rename (4000 + 38)
+#define SYS_rename __NR_rename
+#undef __NR_mkdir
+#define __NR_mkdir (4000 + 39)
+#define SYS_mkdir __NR_mkdir
+#undef __NR_rmdir
+#define __NR_rmdir (4000 + 40)
+#define SYS_rmdir __NR_rmdir
+#undef __NR_dup
+#define __NR_dup (4000 + 41)
+#define SYS_dup __NR_dup
+#undef __NR_pipe
+#define __NR_pipe (4000 + 42)
+#define SYS_pipe __NR_pipe
+#undef __NR_times
+#define __NR_times (4000 + 43)
+#define SYS_times __NR_times
+#undef __NR_prof
+#define __NR_prof (4000 + 44)
+#define SYS_prof __NR_prof
+#undef __NR_brk
+#define __NR_brk (4000 + 45)
+#define SYS_brk __NR_brk
+#undef __NR_setgid
+#define __NR_setgid (4000 + 46)
+#define SYS_setgid __NR_setgid
+#undef __NR_getgid
+#define __NR_getgid (4000 + 47)
+#define SYS_getgid __NR_getgid
+#undef __NR_signal
+#define __NR_signal (4000 + 48)
+#define SYS_signal __NR_signal
+#undef __NR_geteuid
+#define __NR_geteuid (4000 + 49)
+#define SYS_geteuid __NR_geteuid
+#undef __NR_getegid
+#define __NR_getegid (4000 + 50)
+#define SYS_getegid __NR_getegid
+#undef __NR_acct
+#define __NR_acct (4000 + 51)
+#define SYS_acct __NR_acct
+#undef __NR_umount2
+#define __NR_umount2 (4000 + 52)
+#define SYS_umount2 __NR_umount2
+#undef __NR_lock
+#define __NR_lock (4000 + 53)
+#define SYS_lock __NR_lock
+#undef __NR_ioctl
+#define __NR_ioctl (4000 + 54)
+#define SYS_ioctl __NR_ioctl
+#undef __NR_fcntl
+#define __NR_fcntl (4000 + 55)
+#define SYS_fcntl __NR_fcntl
+#undef __NR_mpx
+#define __NR_mpx (4000 + 56)
+#define SYS_mpx __NR_mpx
+#undef __NR_setpgid
+#define __NR_setpgid (4000 + 57)
+#define SYS_setpgid __NR_setpgid
+#undef __NR_ulimit
+#define __NR_ulimit (4000 + 58)
+#define SYS_ulimit __NR_ulimit
+#undef __NR_unused59
+#define __NR_unused59 (4000 + 59)
+#define SYS_unused59 __NR_unused59
+#undef __NR_umask
+#define __NR_umask (4000 + 60)
+#define SYS_umask __NR_umask
+#undef __NR_chroot
+#define __NR_chroot (4000 + 61)
+#define SYS_chroot __NR_chroot
+#undef __NR_ustat
+#define __NR_ustat (4000 + 62)
+#define SYS_ustat __NR_ustat
+#undef __NR_dup2
+#define __NR_dup2 (4000 + 63)
+#define SYS_dup2 __NR_dup2
+#undef __NR_getppid
+#define __NR_getppid (4000 + 64)
+#define SYS_getppid __NR_getppid
+#undef __NR_getpgrp
+#define __NR_getpgrp (4000 + 65)
+#define SYS_getpgrp __NR_getpgrp
+#undef __NR_setsid
+#define __NR_setsid (4000 + 66)
+#define SYS_setsid __NR_setsid
+#undef __NR_sigaction
+#define __NR_sigaction (4000 + 67)
+#define SYS_sigaction __NR_sigaction
+#undef __NR_sgetmask
+#define __NR_sgetmask (4000 + 68)
+#define SYS_sgetmask __NR_sgetmask
+#undef __NR_ssetmask
+#define __NR_ssetmask (4000 + 69)
+#define SYS_ssetmask __NR_ssetmask
+#undef __NR_setreuid
+#define __NR_setreuid (4000 + 70)
+#define SYS_setreuid __NR_setreuid
+#undef __NR_setregid
+#define __NR_setregid (4000 + 71)
+#define SYS_setregid __NR_setregid
+#undef __NR_sigsuspend
+#define __NR_sigsuspend (4000 + 72)
+#define SYS_sigsuspend __NR_sigsuspend
+#undef __NR_sigpending
+#define __NR_sigpending (4000 + 73)
+#define SYS_sigpending __NR_sigpending
+#undef __NR_sethostname
+#define __NR_sethostname (4000 + 74)
+#define SYS_sethostname __NR_sethostname
+#undef __NR_setrlimit
+#define __NR_setrlimit (4000 + 75)
+#define SYS_setrlimit __NR_setrlimit
+#undef __NR_getrlimit
+#define __NR_getrlimit (4000 + 76)
+#define SYS_getrlimit __NR_getrlimit
+#undef __NR_getrusage
+#define __NR_getrusage (4000 + 77)
+#define SYS_getrusage __NR_getrusage
+#undef __NR_gettimeofday
+#define __NR_gettimeofday (4000 + 78)
+#define SYS_gettimeofday __NR_gettimeofday
+#undef __NR_settimeofday
+#define __NR_settimeofday (4000 + 79)
+#define SYS_settimeofday __NR_settimeofday
+#undef __NR_getgroups
+#define __NR_getgroups (4000 + 80)
+#define SYS_getgroups __NR_getgroups
+#undef __NR_setgroups
+#define __NR_setgroups (4000 + 81)
+#define SYS_setgroups __NR_setgroups
+#undef __NR_reserved82
+#define __NR_reserved82 (4000 + 82)
+#define SYS_reserved82 __NR_reserved82
+#undef __NR_symlink
+#define __NR_symlink (4000 + 83)
+#define SYS_symlink __NR_symlink
+#undef __NR_unused84
+#define __NR_unused84 (4000 + 84)
+#define SYS_unused84 __NR_unused84
+#undef __NR_readlink
+#define __NR_readlink (4000 + 85)
+#define SYS_readlink __NR_readlink
+#undef __NR_uselib
+#define __NR_uselib (4000 + 86)
+#define SYS_uselib __NR_uselib
+#undef __NR_swapon
+#define __NR_swapon (4000 + 87)
+#define SYS_swapon __NR_swapon
+#undef __NR_reboot
+#define __NR_reboot (4000 + 88)
+#define SYS_reboot __NR_reboot
+#undef __NR_readdir
+#define __NR_readdir (4000 + 89)
+#define SYS_readdir __NR_readdir
+#undef __NR_mmap
+#define __NR_mmap (4000 + 90)
+#define SYS_mmap __NR_mmap
+#undef __NR_munmap
+#define __NR_munmap (4000 + 91)
+#define SYS_munmap __NR_munmap
+#undef __NR_truncate
+#define __NR_truncate (4000 + 92)
+#define SYS_truncate __NR_truncate
+#undef __NR_ftruncate
+#define __NR_ftruncate (4000 + 93)
+#define SYS_ftruncate __NR_ftruncate
+#undef __NR_fchmod
+#define __NR_fchmod (4000 + 94)
+#define SYS_fchmod __NR_fchmod
+#undef __NR_fchown
+#define __NR_fchown (4000 + 95)
+#define SYS_fchown __NR_fchown
+#undef __NR_getpriority
+#define __NR_getpriority (4000 + 96)
+#define SYS_getpriority __NR_getpriority
+#undef __NR_setpriority
+#define __NR_setpriority (4000 + 97)
+#define SYS_setpriority __NR_setpriority
+#undef __NR_profil
+#define __NR_profil (4000 + 98)
+#define SYS_profil __NR_profil
+#undef __NR_statfs
+#define __NR_statfs (4000 + 99)
+#define SYS_statfs __NR_statfs
+#undef __NR_fstatfs
+#define __NR_fstatfs (4000 + 100)
+#define SYS_fstatfs __NR_fstatfs
+#undef __NR_ioperm
+#define __NR_ioperm (4000 + 101)
+#define SYS_ioperm __NR_ioperm
+#undef __NR_socketcall
+#define __NR_socketcall (4000 + 102)
+#define SYS_socketcall __NR_socketcall
+#undef __NR_syslog
+#define __NR_syslog (4000 + 103)
+#define SYS_syslog __NR_syslog
+#undef __NR_setitimer
+#define __NR_setitimer (4000 + 104)
+#define SYS_setitimer __NR_setitimer
+#undef __NR_getitimer
+#define __NR_getitimer (4000 + 105)
+#define SYS_getitimer __NR_getitimer
+#undef __NR_stat
+#define __NR_stat (4000 + 106)
+#define SYS_stat __NR_stat
+#undef __NR_lstat
+#define __NR_lstat (4000 + 107)
+#define SYS_lstat __NR_lstat
+#undef __NR_fstat
+#define __NR_fstat (4000 + 108)
+#define SYS_fstat __NR_fstat
+#undef __NR_unused109
+#define __NR_unused109 (4000 + 109)
+#define SYS_unused109 __NR_unused109
+#undef __NR_iopl
+#define __NR_iopl (4000 + 110)
+#define SYS_iopl __NR_iopl
+#undef __NR_vhangup
+#define __NR_vhangup (4000 + 111)
+#define SYS_vhangup __NR_vhangup
+#undef __NR_idle
+#define __NR_idle (4000 + 112)
+#define SYS_idle __NR_idle
+#undef __NR_vm86
+#define __NR_vm86 (4000 + 113)
+#define SYS_vm86 __NR_vm86
+#undef __NR_wait4
+#define __NR_wait4 (4000 + 114)
+#define SYS_wait4 __NR_wait4
+#undef __NR_swapoff
+#define __NR_swapoff (4000 + 115)
+#define SYS_swapoff __NR_swapoff
+#undef __NR_sysinfo
+#define __NR_sysinfo (4000 + 116)
+#define SYS_sysinfo __NR_sysinfo
+#undef __NR_ipc
+#define __NR_ipc (4000 + 117)
+#define SYS_ipc __NR_ipc
+#undef __NR_fsync
+#define __NR_fsync (4000 + 118)
+#define SYS_fsync __NR_fsync
+#undef __NR_sigreturn
+#define __NR_sigreturn (4000 + 119)
+#define SYS_sigreturn __NR_sigreturn
+#undef __NR_clone
+#define __NR_clone (4000 + 120)
+#define SYS_clone __NR_clone
+#undef __NR_setdomainname
+#define __NR_setdomainname (4000 + 121)
+#define SYS_setdomainname __NR_setdomainname
+#undef __NR_uname
+#define __NR_uname (4000 + 122)
+#define SYS_uname __NR_uname
+#undef __NR_modify_ldt
+#define __NR_modify_ldt (4000 + 123)
+#define SYS_modify_ldt __NR_modify_ldt
+#undef __NR_adjtimex
+#define __NR_adjtimex (4000 + 124)
+#define SYS_adjtimex __NR_adjtimex
+#undef __NR_mprotect
+#define __NR_mprotect (4000 + 125)
+#define SYS_mprotect __NR_mprotect
+#undef __NR_sigprocmask
+#define __NR_sigprocmask (4000 + 126)
+#define SYS_sigprocmask __NR_sigprocmask
+#undef __NR_create_module
+#define __NR_create_module (4000 + 127)
+#define SYS_create_module __NR_create_module
+#undef __NR_init_module
+#define __NR_init_module (4000 + 128)
+#define SYS_init_module __NR_init_module
+#undef __NR_delete_module
+#define __NR_delete_module (4000 + 129)
+#define SYS_delete_module __NR_delete_module
+#undef __NR_get_kernel_syms
+#define __NR_get_kernel_syms (4000 + 130)
+#define SYS_get_kernel_syms __NR_get_kernel_syms
+#undef __NR_quotactl
+#define __NR_quotactl (4000 + 131)
+#define SYS_quotactl __NR_quotactl
+#undef __NR_getpgid
+#define __NR_getpgid (4000 + 132)
+#define SYS_getpgid __NR_getpgid
+#undef __NR_fchdir
+#define __NR_fchdir (4000 + 133)
+#define SYS_fchdir __NR_fchdir
+#undef __NR_bdflush
+#define __NR_bdflush (4000 + 134)
+#define SYS_bdflush __NR_bdflush
+#undef __NR_sysfs
+#define __NR_sysfs (4000 + 135)
+#define SYS_sysfs __NR_sysfs
+#undef __NR_personality
+#define __NR_personality (4000 + 136)
+#define SYS_personality __NR_personality
+#undef __NR_afs_syscall
+#define __NR_afs_syscall (4000 + 137)
+#define SYS_afs_syscall __NR_afs_syscall
+#undef __NR_setfsuid
+#define __NR_setfsuid (4000 + 138)
+#define SYS_setfsuid __NR_setfsuid
+#undef __NR_setfsgid
+#define __NR_setfsgid (4000 + 139)
+#define SYS_setfsgid __NR_setfsgid
+#undef __NR__llseek
+#define __NR__llseek (4000 + 140)
+#define SYS__llseek __NR__llseek
+#undef __NR_getdents
+#define __NR_getdents (4000 + 141)
+#define SYS_getdents __NR_getdents
+#undef __NR__newselect
+#define __NR__newselect (4000 + 142)
+#define SYS__newselect __NR__newselect
+#undef __NR_flock
+#define __NR_flock (4000 + 143)
+#define SYS_flock __NR_flock
+#undef __NR_msync
+#define __NR_msync (4000 + 144)
+#define SYS_msync __NR_msync
+#undef __NR_readv
+#define __NR_readv (4000 + 145)
+#define SYS_readv __NR_readv
+#undef __NR_writev
+#define __NR_writev (4000 + 146)
+#define SYS_writev __NR_writev
+#undef __NR_cacheflush
+#define __NR_cacheflush (4000 + 147)
+#define SYS_cacheflush __NR_cacheflush
+#undef __NR_cachectl
+#define __NR_cachectl (4000 + 148)
+#define SYS_cachectl __NR_cachectl
+#undef __NR_sysmips
+#define __NR_sysmips (4000 + 149)
+#define SYS_sysmips __NR_sysmips
+#undef __NR_unused150
+#define __NR_unused150 (4000 + 150)
+#define SYS_unused150 __NR_unused150
+#undef __NR_getsid
+#define __NR_getsid (4000 + 151)
+#define SYS_getsid __NR_getsid
+#undef __NR_fdatasync
+#define __NR_fdatasync (4000 + 152)
+#define SYS_fdatasync __NR_fdatasync
+#undef __NR__sysctl
+#define __NR__sysctl (4000 + 153)
+#define SYS__sysctl __NR__sysctl
+#undef __NR_mlock
+#define __NR_mlock (4000 + 154)
+#define SYS_mlock __NR_mlock
+#undef __NR_munlock
+#define __NR_munlock (4000 + 155)
+#define SYS_munlock __NR_munlock
+#undef __NR_mlockall
+#define __NR_mlockall (4000 + 156)
+#define SYS_mlockall __NR_mlockall
+#undef __NR_munlockall
+#define __NR_munlockall (4000 + 157)
+#define SYS_munlockall __NR_munlockall
+#undef __NR_sched_setparam
+#define __NR_sched_setparam (4000 + 158)
+#define SYS_sched_setparam __NR_sched_setparam
+#undef __NR_sched_getparam
+#define __NR_sched_getparam (4000 + 159)
+#define SYS_sched_getparam __NR_sched_getparam
+#undef __NR_sched_setscheduler
+#define __NR_sched_setscheduler (4000 + 160)
+#define SYS_sched_setscheduler __NR_sched_setscheduler
+#undef __NR_sched_getscheduler
+#define __NR_sched_getscheduler (4000 + 161)
+#define SYS_sched_getscheduler __NR_sched_getscheduler
+#undef __NR_sched_yield
+#define __NR_sched_yield (4000 + 162)
+#define SYS_sched_yield __NR_sched_yield
+#undef __NR_sched_get_priority_max
+#define __NR_sched_get_priority_max (4000 + 163)
+#define SYS_sched_get_priority_max __NR_sched_get_priority_max
+#undef __NR_sched_get_priority_min
+#define __NR_sched_get_priority_min (4000 + 164)
+#define SYS_sched_get_priority_min __NR_sched_get_priority_min
+#undef __NR_sched_rr_get_interval
+#define __NR_sched_rr_get_interval (4000 + 165)
+#define SYS_sched_rr_get_interval __NR_sched_rr_get_interval
+#undef __NR_nanosleep
+#define __NR_nanosleep (4000 + 166)
+#define SYS_nanosleep __NR_nanosleep
+#undef __NR_mremap
+#define __NR_mremap (4000 + 167)
+#define SYS_mremap __NR_mremap
+#undef __NR_accept
+#define __NR_accept (4000 + 168)
+#define SYS_accept __NR_accept
+#undef __NR_bind
+#define __NR_bind (4000 + 169)
+#define SYS_bind __NR_bind
+#undef __NR_connect
+#define __NR_connect (4000 + 170)
+#define SYS_connect __NR_connect
+#undef __NR_getpeername
+#define __NR_getpeername (4000 + 171)
+#define SYS_getpeername __NR_getpeername
+#undef __NR_getsockname
+#define __NR_getsockname (4000 + 172)
+#define SYS_getsockname __NR_getsockname
+#undef __NR_getsockopt
+#define __NR_getsockopt (4000 + 173)
+#define SYS_getsockopt __NR_getsockopt
+#undef __NR_listen
+#define __NR_listen (4000 + 174)
+#define SYS_listen __NR_listen
+#undef __NR_recv
+#define __NR_recv (4000 + 175)
+#define SYS_recv __NR_recv
+#undef __NR_recvfrom
+#define __NR_recvfrom (4000 + 176)
+#define SYS_recvfrom __NR_recvfrom
+#undef __NR_recvmsg
+#define __NR_recvmsg (4000 + 177)
+#define SYS_recvmsg __NR_recvmsg
+#undef __NR_send
+#define __NR_send (4000 + 178)
+#define SYS_send __NR_send
+#undef __NR_sendmsg
+#define __NR_sendmsg (4000 + 179)
+#define SYS_sendmsg __NR_sendmsg
+#undef __NR_sendto
+#define __NR_sendto (4000 + 180)
+#define SYS_sendto __NR_sendto
+#undef __NR_setsockopt
+#define __NR_setsockopt (4000 + 181)
+#define SYS_setsockopt __NR_setsockopt
+#undef __NR_shutdown
+#define __NR_shutdown (4000 + 182)
+#define SYS_shutdown __NR_shutdown
+#undef __NR_socket
+#define __NR_socket (4000 + 183)
+#define SYS_socket __NR_socket
+#undef __NR_socketpair
+#define __NR_socketpair (4000 + 184)
+#define SYS_socketpair __NR_socketpair
+#undef __NR_setresuid
+#define __NR_setresuid (4000 + 185)
+#define SYS_setresuid __NR_setresuid
+#undef __NR_getresuid
+#define __NR_getresuid (4000 + 186)
+#define SYS_getresuid __NR_getresuid
+#undef __NR_query_module
+#define __NR_query_module (4000 + 187)
+#define SYS_query_module __NR_query_module
+#undef __NR_poll
+#define __NR_poll (4000 + 188)
+#define SYS_poll __NR_poll
+#undef __NR_nfsservctl
+#define __NR_nfsservctl (4000 + 189)
+#define SYS_nfsservctl __NR_nfsservctl
+#undef __NR_setresgid
+#define __NR_setresgid (4000 + 190)
+#define SYS_setresgid __NR_setresgid
+#undef __NR_getresgid
+#define __NR_getresgid (4000 + 191)
+#define SYS_getresgid __NR_getresgid
+#undef __NR_prctl
+#define __NR_prctl (4000 + 192)
+#define SYS_prctl __NR_prctl
+#undef __NR_rt_sigreturn
+#define __NR_rt_sigreturn (4000 + 193)
+#define SYS_rt_sigreturn __NR_rt_sigreturn
+#undef __NR_rt_sigaction
+#define __NR_rt_sigaction (4000 + 194)
+#define SYS_rt_sigaction __NR_rt_sigaction
+#undef __NR_rt_sigprocmask
+#define __NR_rt_sigprocmask (4000 + 195)
+#define SYS_rt_sigprocmask __NR_rt_sigprocmask
+#undef __NR_rt_sigpending
+#define __NR_rt_sigpending (4000 + 196)
+#define SYS_rt_sigpending __NR_rt_sigpending
+#undef __NR_rt_sigtimedwait
+#define __NR_rt_sigtimedwait (4000 + 197)
+#define SYS_rt_sigtimedwait __NR_rt_sigtimedwait
+#undef __NR_rt_sigqueueinfo
+#define __NR_rt_sigqueueinfo (4000 + 198)
+#define SYS_rt_sigqueueinfo __NR_rt_sigqueueinfo
+#undef __NR_rt_sigsuspend
+#define __NR_rt_sigsuspend (4000 + 199)
+#define SYS_rt_sigsuspend __NR_rt_sigsuspend
+#undef __NR_pread64
+#define __NR_pread64 (4000 + 200)
+#define SYS_pread64 __NR_pread64
+#undef __NR_pwrite64
+#define __NR_pwrite64 (4000 + 201)
+#define SYS_pwrite64 __NR_pwrite64
+#undef __NR_chown
+#define __NR_chown (4000 + 202)
+#define SYS_chown __NR_chown
+#undef __NR_getcwd
+#define __NR_getcwd (4000 + 203)
+#define SYS_getcwd __NR_getcwd
+#undef __NR_capget
+#define __NR_capget (4000 + 204)
+#define SYS_capget __NR_capget
+#undef __NR_capset
+#define __NR_capset (4000 + 205)
+#define SYS_capset __NR_capset
+#undef __NR_sigaltstack
+#define __NR_sigaltstack (4000 + 206)
+#define SYS_sigaltstack __NR_sigaltstack
+#undef __NR_sendfile
+#define __NR_sendfile (4000 + 207)
+#define SYS_sendfile __NR_sendfile
+#undef __NR_getpmsg
+#define __NR_getpmsg (4000 + 208)
+#define SYS_getpmsg __NR_getpmsg
+#undef __NR_putpmsg
+#define __NR_putpmsg (4000 + 209)
+#define SYS_putpmsg __NR_putpmsg
+#undef __NR_mmap2
+#define __NR_mmap2 (4000 + 210)
+#define SYS_mmap2 __NR_mmap2
+#undef __NR_truncate64
+#define __NR_truncate64 (4000 + 211)
+#define SYS_truncate64 __NR_truncate64
+#undef __NR_ftruncate64
+#define __NR_ftruncate64 (4000 + 212)
+#define SYS_ftruncate64 __NR_ftruncate64
+#undef __NR_stat64
+#define __NR_stat64 (4000 + 213)
+#define SYS_stat64 __NR_stat64
+#undef __NR_lstat64
+#define __NR_lstat64 (4000 + 214)
+#define SYS_lstat64 __NR_lstat64
+#undef __NR_fstat64
+#define __NR_fstat64 (4000 + 215)
+#define SYS_fstat64 __NR_fstat64
+#undef __NR_pivot_root
+#define __NR_pivot_root (4000 + 216)
+#define SYS_pivot_root __NR_pivot_root
+#undef __NR_mincore
+#define __NR_mincore (4000 + 217)
+#define SYS_mincore __NR_mincore
+#undef __NR_madvise
+#define __NR_madvise (4000 + 218)
+#define SYS_madvise __NR_madvise
+#undef __NR_getdents64
+#define __NR_getdents64 (4000 + 219)
+#define SYS_getdents64 __NR_getdents64
+#undef __NR_fcntl64
+#define __NR_fcntl64 (4000 + 220)
+#define SYS_fcntl64 __NR_fcntl64
+#undef __NR_reserved221
+#define __NR_reserved221 (4000 + 221)
+#define SYS_reserved221 __NR_reserved221
+#undef __NR_gettid
+#define __NR_gettid (4000 + 222)
+#define SYS_gettid __NR_gettid
+#undef __NR_readahead
+#define __NR_readahead (4000 + 223)
+#define SYS_readahead __NR_readahead
+#undef __NR_setxattr
+#define __NR_setxattr (4000 + 224)
+#define SYS_setxattr __NR_setxattr
+#undef __NR_lsetxattr
+#define __NR_lsetxattr (4000 + 225)
+#define SYS_lsetxattr __NR_lsetxattr
+#undef __NR_fsetxattr
+#define __NR_fsetxattr (4000 + 226)
+#define SYS_fsetxattr __NR_fsetxattr
+#undef __NR_getxattr
+#define __NR_getxattr (4000 + 227)
+#define SYS_getxattr __NR_getxattr
+#undef __NR_lgetxattr
+#define __NR_lgetxattr (4000 + 228)
+#define SYS_lgetxattr __NR_lgetxattr
+#undef __NR_fgetxattr
+#define __NR_fgetxattr (4000 + 229)
+#define SYS_fgetxattr __NR_fgetxattr
+#undef __NR_listxattr
+#define __NR_listxattr (4000 + 230)
+#define SYS_listxattr __NR_listxattr
+#undef __NR_llistxattr
+#define __NR_llistxattr (4000 + 231)
+#define SYS_llistxattr __NR_llistxattr
+#undef __NR_flistxattr
+#define __NR_flistxattr (4000 + 232)
+#define SYS_flistxattr __NR_flistxattr
+#undef __NR_removexattr
+#define __NR_removexattr (4000 + 233)
+#define SYS_removexattr __NR_removexattr
+#undef __NR_lremovexattr
+#define __NR_lremovexattr (4000 + 234)
+#define SYS_lremovexattr __NR_lremovexattr
+#undef __NR_fremovexattr
+#define __NR_fremovexattr (4000 + 235)
+#define SYS_fremovexattr __NR_fremovexattr
+#undef __NR_tkill
+#define __NR_tkill (4000 + 236)
+#define SYS_tkill __NR_tkill
+#undef __NR_sendfile64
+#define __NR_sendfile64 (4000 + 237)
+#define SYS_sendfile64 __NR_sendfile64
+#undef __NR_futex
+#define __NR_futex (4000 + 238)
+#define SYS_futex __NR_futex
+#undef __NR_sched_setaffinity
+#define __NR_sched_setaffinity (4000 + 239)
+#define SYS_sched_setaffinity __NR_sched_setaffinity
+#undef __NR_sched_getaffinity
+#define __NR_sched_getaffinity (4000 + 240)
+#define SYS_sched_getaffinity __NR_sched_getaffinity
+#undef __NR_io_setup
+#define __NR_io_setup (4000 + 241)
+#define SYS_io_setup __NR_io_setup
+#undef __NR_io_destroy
+#define __NR_io_destroy (4000 + 242)
+#define SYS_io_destroy __NR_io_destroy
+#undef __NR_io_getevents
+#define __NR_io_getevents (4000 + 243)
+#define SYS_io_getevents __NR_io_getevents
+#undef __NR_io_submit
+#define __NR_io_submit (4000 + 244)
+#define SYS_io_submit __NR_io_submit
+#undef __NR_io_cancel
+#define __NR_io_cancel (4000 + 245)
+#define SYS_io_cancel __NR_io_cancel
+#undef __NR_exit_group
+#define __NR_exit_group (4000 + 246)
+#define SYS_exit_group __NR_exit_group
+#undef __NR_lookup_dcookie
+#define __NR_lookup_dcookie (4000 + 247)
+#define SYS_lookup_dcookie __NR_lookup_dcookie
+#undef __NR_epoll_create
+#define __NR_epoll_create (4000 + 248)
+#define SYS_epoll_create __NR_epoll_create
+#undef __NR_epoll_ctl
+#define __NR_epoll_ctl (4000 + 249)
+#define SYS_epoll_ctl __NR_epoll_ctl
+#undef __NR_epoll_wait
+#define __NR_epoll_wait (4000 + 250)
+#define SYS_epoll_wait __NR_epoll_wait
+#undef __NR_remap_file_pages
+#define __NR_remap_file_pages (4000 + 251)
+#define SYS_remap_file_pages __NR_remap_file_pages
+#undef __NR_set_tid_address
+#define __NR_set_tid_address (4000 + 252)
+#define SYS_set_tid_address __NR_set_tid_address
+#undef __NR_restart_syscall
+#define __NR_restart_syscall (4000 + 253)
+#define SYS_restart_syscall __NR_restart_syscall
+#undef __NR_fadvise64
+#define __NR_fadvise64 (4000 + 254)
+#define SYS_fadvise64 __NR_fadvise64
+#undef __NR_statfs64
+#define __NR_statfs64 (4000 + 255)
+#define SYS_statfs64 __NR_statfs64
+#undef __NR_fstatfs64
+#define __NR_fstatfs64 (4000 + 256)
+#define SYS_fstatfs64 __NR_fstatfs64
+#undef __NR_timer_create
+#define __NR_timer_create (4000 + 257)
+#define SYS_timer_create __NR_timer_create
+#undef __NR_timer_settime
+#define __NR_timer_settime (4000 + 258)
+#define SYS_timer_settime __NR_timer_settime
+#undef __NR_timer_gettime
+#define __NR_timer_gettime (4000 + 259)
+#define SYS_timer_gettime __NR_timer_gettime
+#undef __NR_timer_getoverrun
+#define __NR_timer_getoverrun (4000 + 260)
+#define SYS_timer_getoverrun __NR_timer_getoverrun
+#undef __NR_timer_delete
+#define __NR_timer_delete (4000 + 261)
+#define SYS_timer_delete __NR_timer_delete
+#undef __NR_clock_settime
+#define __NR_clock_settime (4000 + 262)
+#define SYS_clock_settime __NR_clock_settime
+#undef __NR_clock_gettime
+#define __NR_clock_gettime (4000 + 263)
+#define SYS_clock_gettime __NR_clock_gettime
+#undef __NR_clock_getres
+#define __NR_clock_getres (4000 + 264)
+#define SYS_clock_getres __NR_clock_getres
+#undef __NR_clock_nanosleep
+#define __NR_clock_nanosleep (4000 + 265)
+#define SYS_clock_nanosleep __NR_clock_nanosleep
+#undef __NR_tgkill
+#define __NR_tgkill (4000 + 266)
+#define SYS_tgkill __NR_tgkill
+#undef __NR_utimes
+#define __NR_utimes (4000 + 267)
+#define SYS_utimes __NR_utimes
+#undef __NR_mbind
+#define __NR_mbind (4000 + 268)
+#define SYS_mbind __NR_mbind
+#undef __NR_get_mempolicy
+#define __NR_get_mempolicy (4000 + 269)
+#define SYS_get_mempolicy __NR_get_mempolicy
+#undef __NR_set_mempolicy
+#define __NR_set_mempolicy (4000 + 270)
+#define SYS_set_mempolicy __NR_set_mempolicy
+#undef __NR_mq_open
+#define __NR_mq_open (4000 + 271)
+#define SYS_mq_open __NR_mq_open
+#undef __NR_mq_unlink
+#define __NR_mq_unlink (4000 + 272)
+#define SYS_mq_unlink __NR_mq_unlink
+#undef __NR_mq_timedsend
+#define __NR_mq_timedsend (4000 + 273)
+#define SYS_mq_timedsend __NR_mq_timedsend
+#undef __NR_mq_timedreceive
+#define __NR_mq_timedreceive (4000 + 274)
+#define SYS_mq_timedreceive __NR_mq_timedreceive
+#undef __NR_mq_notify
+#define __NR_mq_notify (4000 + 275)
+#define SYS_mq_notify __NR_mq_notify
+#undef __NR_mq_getsetattr
+#define __NR_mq_getsetattr (4000 + 276)
+#define SYS_mq_getsetattr __NR_mq_getsetattr
+#undef __NR_vserver
+#define __NR_vserver (4000 + 277)
+#define SYS_vserver __NR_vserver
+#undef __NR_waitid
+#define __NR_waitid (4000 + 278)
+#define SYS_waitid __NR_waitid
+#undef __NR_add_key
+#define __NR_add_key (4000 + 280)
+#define SYS_add_key __NR_add_key
+#undef __NR_request_key
+#define __NR_request_key (4000 + 281)
+#define SYS_request_key __NR_request_key
+#undef __NR_keyctl
+#define __NR_keyctl (4000 + 282)
+#define SYS_keyctl __NR_keyctl
+#undef __NR_set_thread_area
+#define __NR_set_thread_area (4000 + 283)
+#define SYS_set_thread_area __NR_set_thread_area
+#undef __NR_inotify_init
+#define __NR_inotify_init (4000 + 284)
+#define SYS_inotify_init __NR_inotify_init
+#undef __NR_inotify_add_watch
+#define __NR_inotify_add_watch (4000 + 285)
+#define SYS_inotify_add_watch __NR_inotify_add_watch
+#undef __NR_inotify_rm_watch
+#define __NR_inotify_rm_watch (4000 + 286)
+#define SYS_inotify_rm_watch __NR_inotify_rm_watch
+#undef __NR_migrate_pages
+#define __NR_migrate_pages (4000 + 287)
+#define SYS_migrate_pages __NR_migrate_pages
+#undef __NR_openat
+#define __NR_openat (4000 + 288)
+#define SYS_openat __NR_openat
+#undef __NR_mkdirat
+#define __NR_mkdirat (4000 + 289)
+#define SYS_mkdirat __NR_mkdirat
+#undef __NR_mknodat
+#define __NR_mknodat (4000 + 290)
+#define SYS_mknodat __NR_mknodat
+#undef __NR_fchownat
+#define __NR_fchownat (4000 + 291)
+#define SYS_fchownat __NR_fchownat
+#undef __NR_futimesat
+#define __NR_futimesat (4000 + 292)
+#define SYS_futimesat __NR_futimesat
+#undef __NR_fstatat64
+#define __NR_fstatat64 (4000 + 293)
+#define SYS_fstatat64 __NR_fstatat64
+#undef __NR_unlinkat
+#define __NR_unlinkat (4000 + 294)
+#define SYS_unlinkat __NR_unlinkat
+#undef __NR_renameat
+#define __NR_renameat (4000 + 295)
+#define SYS_renameat __NR_renameat
+#undef __NR_linkat
+#define __NR_linkat (4000 + 296)
+#define SYS_linkat __NR_linkat
+#undef __NR_symlinkat
+#define __NR_symlinkat (4000 + 297)
+#define SYS_symlinkat __NR_symlinkat
+#undef __NR_readlinkat
+#define __NR_readlinkat (4000 + 298)
+#define SYS_readlinkat __NR_readlinkat
+#undef __NR_fchmodat
+#define __NR_fchmodat (4000 + 299)
+#define SYS_fchmodat __NR_fchmodat
+#undef __NR_faccessat
+#define __NR_faccessat (4000 + 300)
+#define SYS_faccessat __NR_faccessat
+#undef __NR_pselect6
+#define __NR_pselect6 (4000 + 301)
+#define SYS_pselect6 __NR_pselect6
+#undef __NR_ppoll
+#define __NR_ppoll (4000 + 302)
+#define SYS_ppoll __NR_ppoll
+#undef __NR_unshare
+#define __NR_unshare (4000 + 303)
+#define SYS_unshare __NR_unshare
+#undef __NR_splice
+#define __NR_splice (4000 + 304)
+#define SYS_splice __NR_splice
+#undef __NR_sync_file_range
+#define __NR_sync_file_range (4000 + 305)
+#define SYS_sync_file_range __NR_sync_file_range
+#undef __NR_tee
+#define __NR_tee (4000 + 306)
+#define SYS_tee __NR_tee
+#undef __NR_vmsplice
+#define __NR_vmsplice (4000 + 307)
+#define SYS_vmsplice __NR_vmsplice
+#undef __NR_move_pages
+#define __NR_move_pages (4000 + 308)
+#define SYS_move_pages __NR_move_pages
+#undef __NR_set_robust_list
+#define __NR_set_robust_list (4000 + 309)
+#define SYS_set_robust_list __NR_set_robust_list
+#undef __NR_get_robust_list
+#define __NR_get_robust_list (4000 + 310)
+#define SYS_get_robust_list __NR_get_robust_list
+#undef __NR_kexec_load
+#define __NR_kexec_load (4000 + 311)
+#define SYS_kexec_load __NR_kexec_load
+#undef __NR_getcpu
+#define __NR_getcpu (4000 + 312)
+#define SYS_getcpu __NR_getcpu
+#undef __NR_epoll_pwait
+#define __NR_epoll_pwait (4000 + 313)
+#define SYS_epoll_pwait __NR_epoll_pwait
+#undef __NR_ioprio_set
+#define __NR_ioprio_set (4000 + 314)
+#define SYS_ioprio_set __NR_ioprio_set
+#undef __NR_ioprio_get
+#define __NR_ioprio_get (4000 + 315)
+#define SYS_ioprio_get __NR_ioprio_get
+#undef __NR_utimensat
+#define __NR_utimensat (4000 + 316)
+#define SYS_utimensat __NR_utimensat
+#undef __NR_signalfd
+#define __NR_signalfd (4000 + 317)
+#define SYS_signalfd __NR_signalfd
+#undef __NR_timerfd
+#define __NR_timerfd (4000 + 318)
+#define SYS_timerfd __NR_timerfd
+#undef __NR_eventfd
+#define __NR_eventfd (4000 + 319)
+#define SYS_eventfd __NR_eventfd
+#undef __NR_fallocate
+#define __NR_fallocate (4000 + 320)
+#define SYS_fallocate __NR_fallocate
+#undef __NR_timerfd_create
+#define __NR_timerfd_create (4000 + 321)
+#define SYS_timerfd_create __NR_timerfd_create
+#undef __NR_timerfd_gettime
+#define __NR_timerfd_gettime (4000 + 322)
+#define SYS_timerfd_gettime __NR_timerfd_gettime
+#undef __NR_timerfd_settime
+#define __NR_timerfd_settime (4000 + 323)
+#define SYS_timerfd_settime __NR_timerfd_settime
+#undef __NR_signalfd4
+#define __NR_signalfd4 (4000 + 324)
+#define SYS_signalfd4 __NR_signalfd4
+#undef __NR_eventfd2
+#define __NR_eventfd2 (4000 + 325)
+#define SYS_eventfd2 __NR_eventfd2
+#undef __NR_epoll_create1
+#define __NR_epoll_create1 (4000 + 326)
+#define SYS_epoll_create1 __NR_epoll_create1
+#undef __NR_dup3
+#define __NR_dup3 (4000 + 327)
+#define SYS_dup3 __NR_dup3
+#undef __NR_pipe2
+#define __NR_pipe2 (4000 + 328)
+#define SYS_pipe2 __NR_pipe2
+#undef __NR_inotify_init1
+#define __NR_inotify_init1 (4000 + 329)
+#define SYS_inotify_init1 __NR_inotify_init1
+#undef __NR_preadv
+#define __NR_preadv (4000 + 330)
+#define SYS_preadv __NR_preadv
+#undef __NR_pwritev
+#define __NR_pwritev (4000 + 331)
+#define SYS_pwritev __NR_pwritev
+#undef __NR_Linux_syscalls
+#define __NR_Linux_syscalls 331
+#define SYS_Linux_syscalls __NR_Linux_syscalls
+#undef __NR_O32_Linux
+#define __NR_O32_Linux 4000
+#define SYS_O32_Linux __NR_O32_Linux
+#undef __NR_O32_Linux_syscalls
+#define __NR_O32_Linux_syscalls 331
+#define SYS_O32_Linux_syscalls __NR_O32_Linux_syscalls
+#undef __NR_64_Linux
+#define __NR_64_Linux 5000
+#define SYS_64_Linux __NR_64_Linux
+#undef __NR_64_Linux_syscalls
+#define __NR_64_Linux_syscalls 290
+#define SYS_64_Linux_syscalls __NR_64_Linux_syscalls
+#undef __NR_N32_Linux
+#define __NR_N32_Linux 6000
+#define SYS_N32_Linux __NR_N32_Linux
+#undef __NR_N32_Linux_syscalls
+#define __NR_N32_Linux_syscalls 294
+#define SYS_N32_Linux_syscalls __NR_N32_Linux_syscalls
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/termios.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/termios.h
new file mode 100644
index 0000000..546faa0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/termios.h
@@ -0,0 +1,217 @@
+/* termios type and macro definitions. Linux/MIPS version.
+ Copyright (C) 1993, 94, 95, 96, 97, 99 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios.h> directly; use <termios.h> instead."
+#endif
+
+typedef unsigned char cc_t;
+typedef unsigned int speed_t;
+typedef unsigned int tcflag_t;
+
+#define NCCS 32
+struct termios
+ {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ };
+
+/* c_cc characters */
+#define VINTR 0 /* Interrupt character [ISIG]. */
+#define VQUIT 1 /* Quit character [ISIG]. */
+#define VERASE 2 /* Erase character [ICANON]. */
+#define VKILL 3 /* Kill-line character [ICANON]. */
+#define VMIN 4 /* Minimum number of bytes read at once [!ICANON]. */
+#define VTIME 5 /* Time-out value (tenths of a second) [!ICANON]. */
+#define VEOL2 6 /* Second EOL character [ICANON]. */
+#define VSWTC 7
+#define VSWTCH VSWTC
+#define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */
+#define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */
+#define VSUSP 10 /* Suspend character [ISIG]. */
+ /* VDSUSP is not supported on Linux. */
+/* #define VDSUSP 11 / * Delayed suspend character [ISIG]. */
+#define VREPRINT 12 /* Reprint-line character [ICANON]. */
+#define VDISCARD 13 /* Discard character [IEXTEN]. */
+#define VWERASE 14 /* Word-erase character [ICANON]. */
+#define VLNEXT 15 /* Literal-next character [IEXTEN]. */
+#define VEOF 16 /* End-of-file character [ICANON]. */
+#define VEOL 17 /* End-of-line character [ICANON]. */
+
+/* c_iflag bits */
+#define IGNBRK 0000001 /* Ignore break condition. */
+#define BRKINT 0000002 /* Signal interrupt on break. */
+#define IGNPAR 0000004 /* Ignore characters with parity errors. */
+#define PARMRK 0000010 /* Mark parity and framing errors. */
+#define INPCK 0000020 /* Enable input parity check. */
+#define ISTRIP 0000040 /* Strip 8th bit off characters. */
+#define INLCR 0000100 /* Map NL to CR on input. */
+#define IGNCR 0000200 /* Ignore CR. */
+#define ICRNL 0000400 /* Map CR to NL on input. */
+#define IUCLC 0001000 /* Map upper case to lower case on input. */
+#define IXON 0002000 /* Enable start/stop output control. */
+#define IXANY 0004000 /* Any character will restart after stop. */
+#define IXOFF 0010000 /* Enable start/stop input control. */
+#define IMAXBEL 0020000 /* Ring bell when input queue is full. */
+
+/* c_oflag bits */
+#define OPOST 0000001 /* Perform output processing. */
+#define OLCUC 0000002 /* Map lower case to upper case on output. */
+#define ONLCR 0000004 /* Map NL to CR-NL on output. */
+#define OCRNL 0000010
+#define ONOCR 0000020
+#define ONLRET 0000040
+#define OFILL 0000100
+#define OFDEL 0000200
+#if defined __USE_MISC || defined __USE_XOPEN
+# define NLDLY 0000400
+# define NL0 0000000
+# define NL1 0000400
+# define CRDLY 0003000
+# define CR0 0000000
+# define CR1 0001000
+# define CR2 0002000
+# define CR3 0003000
+# define TABDLY 0014000
+# define TAB0 0000000
+# define TAB1 0004000
+# define TAB2 0010000
+# define TAB3 0014000
+# define BSDLY 0020000
+# define BS0 0000000
+# define BS1 0020000
+# define FFDLY 0100000
+# define FF0 0000000
+# define FF1 0100000
+#endif
+
+#define VTDLY 0040000
+#define VT0 0000000
+#define VT1 0040000
+
+#ifdef __USE_MISC
+# define XTABS 0014000
+#endif
+
+/* c_cflag bit meaning */
+#ifdef __USE_MISC
+# define CBAUD 0010017
+#endif
+#define B0 0000000 /* hang up */
+#define B50 0000001
+#define B75 0000002
+#define B110 0000003
+#define B134 0000004
+#define B150 0000005
+#define B200 0000006
+#define B300 0000007
+#define B600 0000010
+#define B1200 0000011
+#define B1800 0000012
+#define B2400 0000013
+#define B4800 0000014
+#define B9600 0000015
+#define B19200 0000016
+#define B38400 0000017
+#ifdef __USE_MISC
+# define EXTA B19200
+# define EXTB B38400
+#endif
+#define CSIZE 0000060 /* Number of bits per byte (mask). */
+#define CS5 0000000 /* 5 bits per byte. */
+#define CS6 0000020 /* 6 bits per byte. */
+#define CS7 0000040 /* 7 bits per byte. */
+#define CS8 0000060 /* 8 bits per byte. */
+#define CSTOPB 0000100 /* Two stop bits instead of one. */
+#define CREAD 0000200 /* Enable receiver. */
+#define PARENB 0000400 /* Parity enable. */
+#define PARODD 0001000 /* Odd parity instead of even. */
+#define HUPCL 0002000 /* Hang up on last close. */
+#define CLOCAL 0004000 /* Ignore modem status lines. */
+#ifdef __USE_MISC
+# define CBAUDEX 0010000
+#endif
+#define B57600 0010001
+#define B115200 0010002
+#define B230400 0010003
+#define B460800 0010004
+#define B500000 0010005
+#define B576000 0010006
+#define B921600 0010007
+#define B1000000 0010010
+#define B1152000 0010011
+#define B1500000 0010012
+#define B2000000 0010013
+#define B2500000 0010014
+#define B3000000 0010015
+#define B3500000 0010016
+#define B4000000 0010017
+#define __MAX_BAUD B4000000
+#ifdef __USE_MISC
+# define CIBAUD 002003600000 /* input baud rate (not used) */
+# define CRTSCTS 020000000000 /* flow control */
+#endif
+
+/* c_lflag bits */
+#define ISIG 0000001 /* Enable signals. */
+#define ICANON 0000002 /* Do erase and kill processing. */
+#if defined __USE_MISC || defined __USE_XOPEN
+# define XCASE 0000004
+#endif
+#define ECHO 0000010 /* Enable echo. */
+#define ECHOE 0000020 /* Visual erase for ERASE. */
+#define ECHOK 0000040 /* Echo NL after KILL. */
+#define ECHONL 0000100 /* Echo NL even if ECHO is off. */
+#define NOFLSH 0000200 /* Disable flush after interrupt. */
+#define IEXTEN 0000400 /* Enable DISCARD and LNEXT. */
+#ifdef __USE_MISC
+# define ECHOCTL 0001000 /* Echo control characters as ^X. */
+# define ECHOPRT 0002000 /* Hardcopy visual erase. */
+# define ECHOKE 0004000 /* Visual erase for KILL. */
+# define FLUSHO 0020000
+# define PENDIN 0040000 /* Retype pending input (state). */
+#endif
+#define TOSTOP 0100000 /* Send SIGTTOU for background output. */
+#define ITOSTOP TOSTOP
+
+/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
+
+/* tcflow() and TCXONC use these */
+#define TCOOFF 0 /* Suspend output. */
+#define TCOON 1 /* Restart suspended output. */
+#define TCIOFF 2 /* Send a STOP character. */
+#define TCION 3 /* Send a START character. */
+
+/* tcflush() and TCFLSH use these */
+#define TCIFLUSH 0 /* Discard data received but not yet read. */
+#define TCOFLUSH 1 /* Discard data written but not yet sent. */
+#define TCIOFLUSH 2 /* Discard all pending data. */
+
+/* tcsetattr uses these */
+#define TCSANOW 0x540e /* Same as TCSETS; change immediately. */
+#define TCSADRAIN 0x540f /* Same as TCSETSW; change when pending output is written. */
+#define TCSAFLUSH 0x5410 /* Same as TCSETSF; flush pending input before changing. */
+
+#define _IOT_termios /* Hurd ioctl type field. */ \
+ _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/time.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/time.h
new file mode 100644
index 0000000..7ed54bf
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/time.h
@@ -0,0 +1,79 @@
+/* System-dependent timing definitions. Generic version.
+ Copyright (C) 1996,1997,1999-2002,2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * Never include this file directly; use <time.h> instead.
+ */
+
+#ifndef __need_timeval
+# ifndef _BITS_TIME_H
+# define _BITS_TIME_H 1
+
+/* ISO/IEC 9899:1990 7.12.1: <time.h>
+ The macro `CLOCKS_PER_SEC' is the number per second of the value
+ returned by the `clock' function. */
+/* CAE XSH, Issue 4, Version 2: <time.h>
+ The value of CLOCKS_PER_SEC is required to be 1 million on all
+ XSI-conformant systems. */
+# define CLOCKS_PER_SEC 1000000l
+
+/* Get the arch-specific value of __UCLIBC_CLK_TCK_CONST used for CLK_TCK
+ * in sysconf() and clock(). */
+#include <bits/uClibc_clk_tck.h>
+
+# if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K
+/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
+ presents the real value for clock ticks per second for the system. */
+# include <bits/types.h>
+/* Note (uClibc): glibc #defines CLK_TCK as a sysconf() call. */
+# define CLK_TCK ((__clock_t) __UCLIBC_CLK_TCK_CONST)
+# endif
+
+# ifdef __USE_POSIX199309
+/* Identifier for system-wide realtime clock. */
+# define CLOCK_REALTIME 0
+/* Monotonic system-wide clock. */
+# define CLOCK_MONOTONIC 1
+/* High-resolution timer from the CPU. */
+# define CLOCK_PROCESS_CPUTIME_ID 2
+/* Thread-specific CPU-time clock. */
+# define CLOCK_THREAD_CPUTIME_ID 3
+
+/* Flag to indicate time is absolute. */
+# define TIMER_ABSTIME 1
+# endif
+
+# endif /* bits/time.h */
+#endif
+
+#ifdef __need_timeval
+# undef __need_timeval
+# ifndef _STRUCT_TIMEVAL
+# define _STRUCT_TIMEVAL 1
+# include <bits/types.h>
+
+/* A time value that is accurate to the nearest
+ microsecond but also has a range of years. */
+struct timeval
+ {
+ __time_t tv_sec; /* Seconds. */
+ __suseconds_t tv_usec; /* Microseconds. */
+ };
+# endif /* struct timeval */
+#endif /* need timeval */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/types.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/types.h
new file mode 100644
index 0000000..755af2e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/types.h
@@ -0,0 +1,209 @@
+/* bits/types.h -- definitions of __*_t types underlying *_t types.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * Never include this file directly; use <sys/types.h> instead.
+ */
+
+#ifndef _BITS_TYPES_H
+#define _BITS_TYPES_H 1
+
+#include <features.h>
+#include <bits/wordsize.h>
+
+#define __need_size_t
+#include <stddef.h>
+#include <bits/kernel_types.h>
+
+/* Convenience types. */
+typedef unsigned char __u_char;
+typedef unsigned short int __u_short;
+typedef unsigned int __u_int;
+typedef unsigned long int __u_long;
+
+/* Fixed-size types, underlying types depend on word size and compiler. */
+typedef signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef signed short int __int16_t;
+typedef unsigned short int __uint16_t;
+typedef signed int __int32_t;
+typedef unsigned int __uint32_t;
+#if __WORDSIZE == 64
+typedef signed long int __int64_t;
+typedef unsigned long int __uint64_t;
+#elif defined(__GNUC__)
+__extension__ typedef signed long long int __int64_t;
+__extension__ typedef unsigned long long int __uint64_t;
+#endif
+
+/* quad_t is also 64 bits. */
+#if __WORDSIZE == 64
+typedef long int __quad_t;
+typedef unsigned long int __u_quad_t;
+#elif defined(__GNUC__)
+__extension__ typedef long long int __quad_t;
+__extension__ typedef unsigned long long int __u_quad_t;
+#else
+typedef struct
+{
+ long __val[2];
+} __quad_t;
+typedef struct
+{
+ __u_long __val[2];
+} __u_quad_t;
+#endif
+
+
+/* The machine-dependent file <bits/typesizes.h> defines __*_T_TYPE
+ macros for each of the OS types we define below. The definitions
+ of those macros must use the following macros for underlying types.
+ We define __S<SIZE>_TYPE and __U<SIZE>_TYPE for the signed and unsigned
+ variants of each of the following integer types on this machine.
+
+ 16 -- "natural" 16-bit type (always short)
+ 32 -- "natural" 32-bit type (always int)
+ 64 -- "natural" 64-bit type (long or long long)
+ LONG32 -- 32-bit type, traditionally long
+ QUAD -- 64-bit type, always long long
+ WORD -- natural type of __WORDSIZE bits (int or long)
+ LONGWORD -- type of __WORDSIZE bits, traditionally long
+
+ We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the
+ conventional uses of `long' or `long long' type modifiers match the
+ types we define, even when a less-adorned type would be the same size.
+ This matters for (somewhat) portably writing printf/scanf formats for
+ these types, where using the appropriate l or ll format modifiers can
+ make the typedefs and the formats match up across all GNU platforms. If
+ we used `long' when it's 64 bits where `long long' is expected, then the
+ compiler would warn about the formats not matching the argument types,
+ and the programmer changing them to shut up the compiler would break the
+ program's portability.
+
+ Here we assume what is presently the case in all the GCC configurations
+ we support: long long is always 64 bits, long is always word/address size,
+ and int is always 32 bits. */
+
+#define __S16_TYPE short int
+#define __U16_TYPE unsigned short int
+#define __S32_TYPE int
+#define __U32_TYPE unsigned int
+#define __SLONGWORD_TYPE long int
+#define __ULONGWORD_TYPE unsigned long int
+#if __WORDSIZE == 32
+# define __SQUAD_TYPE __quad_t
+# define __UQUAD_TYPE __u_quad_t
+# define __SWORD_TYPE int
+# define __UWORD_TYPE unsigned int
+# define __SLONG32_TYPE long int
+# define __ULONG32_TYPE unsigned long int
+# define __S64_TYPE __quad_t
+# define __U64_TYPE __u_quad_t
+/* We want __extension__ before typedef's that use nonstandard base types
+ such as `long long' in C89 mode. */
+# define __STD_TYPE __extension__ typedef
+#elif __WORDSIZE == 64
+# define __SQUAD_TYPE long int
+# define __UQUAD_TYPE unsigned long int
+# define __SWORD_TYPE long int
+# define __UWORD_TYPE unsigned long int
+# define __SLONG32_TYPE int
+# define __ULONG32_TYPE unsigned int
+# define __S64_TYPE long int
+# define __U64_TYPE unsigned long int
+/* No need to mark the typedef with __extension__. */
+# define __STD_TYPE typedef
+#else
+# error
+#endif
+#include <bits/typesizes.h> /* Defines __*_T_TYPE macros. */
+
+
+__STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers. */
+__STD_TYPE __UID_T_TYPE __uid_t; /* Type of user identifications. */
+__STD_TYPE __GID_T_TYPE __gid_t; /* Type of group identifications. */
+__STD_TYPE __INO_T_TYPE __ino_t; /* Type of file serial numbers. */
+__STD_TYPE __INO64_T_TYPE __ino64_t; /* Type of file serial numbers (LFS).*/
+__STD_TYPE __MODE_T_TYPE __mode_t; /* Type of file attribute bitmasks. */
+__STD_TYPE __NLINK_T_TYPE __nlink_t; /* Type of file link counts. */
+__STD_TYPE __OFF_T_TYPE __off_t; /* Type of file sizes and offsets. */
+__STD_TYPE __OFF64_T_TYPE __off64_t; /* Type of file sizes and offsets (LFS). */
+__STD_TYPE __PID_T_TYPE __pid_t; /* Type of process identifications. */
+__STD_TYPE __FSID_T_TYPE __fsid_t; /* Type of file system IDs. */
+__STD_TYPE __CLOCK_T_TYPE __clock_t; /* Type of CPU usage counts. */
+__STD_TYPE __RLIM_T_TYPE __rlim_t; /* Type for resource measurement. */
+__STD_TYPE __RLIM64_T_TYPE __rlim64_t; /* Type for resource measurement (LFS). */
+__STD_TYPE __ID_T_TYPE __id_t; /* General type for IDs. */
+__STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */
+__STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */
+__STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */
+
+__STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */
+__STD_TYPE __SWBLK_T_TYPE __swblk_t; /* Type of a swap block maybe? */
+__STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */
+
+/* Clock ID used in clock and timer functions. */
+__STD_TYPE __CLOCKID_T_TYPE __clockid_t;
+
+/* Timer ID returned by `timer_create'. */
+__STD_TYPE __TIMER_T_TYPE __timer_t;
+
+/* Type to represent block size. */
+__STD_TYPE __BLKSIZE_T_TYPE __blksize_t;
+
+/* Types from the Large File Support interface. */
+
+/* Type to count number of disk blocks. */
+__STD_TYPE __BLKCNT_T_TYPE __blkcnt_t;
+__STD_TYPE __BLKCNT64_T_TYPE __blkcnt64_t;
+
+/* Type to count file system blocks. */
+__STD_TYPE __FSBLKCNT_T_TYPE __fsblkcnt_t;
+__STD_TYPE __FSBLKCNT64_T_TYPE __fsblkcnt64_t;
+
+/* Type to count file system nodes. */
+__STD_TYPE __FSFILCNT_T_TYPE __fsfilcnt_t;
+__STD_TYPE __FSFILCNT64_T_TYPE __fsfilcnt64_t;
+
+__STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error. */
+
+/* These few don't really vary by system, they always correspond
+ to one of the other defined types. */
+typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */
+typedef __quad_t *__qaddr_t;
+typedef char *__caddr_t;
+
+/* Duplicates info from stdint.h but this is used in unistd.h. */
+__STD_TYPE __SWORD_TYPE __intptr_t;
+
+/* Duplicate info from sys/socket.h. */
+__STD_TYPE __U32_TYPE __socklen_t;
+
+
+#undef __STD_TYPE
+
+/* Used in `struct shmid_ds'. */
+typedef __kernel_ipc_pid_t __ipc_pid_t;
+
+/* Now add the thread types. */
+#if defined __UCLIBC_HAS_THREADS__ && (defined __USE_POSIX199506 || defined __USE_UNIX98)
+# include <bits/pthreadtypes.h>
+#endif
+
+#endif /* bits/types.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/typesizes.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/typesizes.h
new file mode 100644
index 0000000..e9226c4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/typesizes.h
@@ -0,0 +1,66 @@
+/* bits/typesizes.h -- underlying types for *_t. Generic version.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _BITS_TYPES_H
+# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
+#endif
+
+#ifndef _BITS_TYPESIZES_H
+#define _BITS_TYPESIZES_H 1
+
+/* See <bits/types.h> for the meaning of these macros. This file exists so
+ that <bits/types.h> need not vary across different GNU platforms. */
+
+#define __DEV_T_TYPE __UQUAD_TYPE
+#define __UID_T_TYPE __U32_TYPE
+#define __GID_T_TYPE __U32_TYPE
+#define __INO_T_TYPE __ULONGWORD_TYPE
+#define __INO64_T_TYPE __UQUAD_TYPE
+#define __MODE_T_TYPE __U32_TYPE
+#define __NLINK_T_TYPE __UWORD_TYPE
+#define __OFF_T_TYPE __SLONGWORD_TYPE
+#define __OFF64_T_TYPE __SQUAD_TYPE
+#define __PID_T_TYPE __S32_TYPE
+#define __RLIM_T_TYPE __ULONGWORD_TYPE
+#define __RLIM64_T_TYPE __UQUAD_TYPE
+#define __BLKCNT_T_TYPE __SLONGWORD_TYPE
+#define __BLKCNT64_T_TYPE __SQUAD_TYPE
+#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE
+#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
+#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
+#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
+#define __ID_T_TYPE __U32_TYPE
+#define __CLOCK_T_TYPE __SLONGWORD_TYPE
+#define __TIME_T_TYPE __SLONGWORD_TYPE
+#define __USECONDS_T_TYPE __U32_TYPE
+#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
+#define __DADDR_T_TYPE __S32_TYPE
+#define __SWBLK_T_TYPE __SLONGWORD_TYPE
+#define __KEY_T_TYPE __S32_TYPE
+#define __CLOCKID_T_TYPE __S32_TYPE
+#define __TIMER_T_TYPE void *
+#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE
+#define __FSID_T_TYPE struct { int __val[2]; }
+#define __SSIZE_T_TYPE __SWORD_TYPE
+
+/* Number of descriptors that can fit in an `fd_set'. */
+#define __FD_SETSIZE 1024
+
+
+#endif /* bits/typesizes.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_arch_features.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..f8d954e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_arch_features.h
@@ -0,0 +1,41 @@
+/*
+ * Track misc arch-specific features that aren't config options
+ */
+
+#ifndef _BITS_UCLIBC_ARCH_FEATURES_H
+#define _BITS_UCLIBC_ARCH_FEATURES_H
+
+/* instruction used when calling abort() to kill yourself */
+#define __UCLIBC_ABORT_INSTRUCTION__ "break 255"
+
+/* can your target use syscall6() for mmap ? */
+#define __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#define __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __UCLIBC_BROKEN_CREATE_MODULE__
+
+/* does your target prefix all symbols with an _ ? */
+#define __UCLIBC_NO_UNDERSCORES__
+
+/* does your target have an asm .set ? */
+#undef __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
+
+/* define if target doesn't like .global */
+#undef __UCLIBC_ASM_GLOBAL_DIRECTIVE__
+
+/* define if target supports .weak */
+#define __UCLIBC_HAVE_ASM_WEAK_DIRECTIVE__
+
+/* define if target supports .weakext */
+#undef __UCLIBC_HAVE_ASM_WEAKEXT_DIRECTIVE__
+
+/* needed probably only for ppc64 */
+#undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
+
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
+#endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_clk_tck.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_clk_tck.h
new file mode 100644
index 0000000..00b77bf
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_clk_tck.h
@@ -0,0 +1,8 @@
+/* Use a default of 100 for CLK_TCK to implement sysconf() and clock().
+ * Override this by supplying an arch-specific version of this header file.
+ *
+ * WARNING: It is assumed that this is a constant integer value usable in
+ * preprocessor conditionals!!!
+ */
+
+#define __UCLIBC_CLK_TCK_CONST 100
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_config.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_config.h
new file mode 100644
index 0000000..05c39d7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_config.h
@@ -0,0 +1,189 @@
+#if !defined __FEATURES_H && !defined __need_uClibc_config_h
+# error Never include <bits/uClibc_config.h> directly; use <features.h> instead
+#endif
+
+#define __UCLIBC_MAJOR__ 0
+#define __UCLIBC_MINOR__ 9
+#define __UCLIBC_SUBLEVEL__ 29
+/* Automatically generated make config: don't edit */
+/* Fri Jan 29 15:20:51 2010 */
+#undef __TARGET_alpha__
+#undef __TARGET_arm__
+#undef __TARGET_bfin__
+#undef __TARGET_cris__
+#undef __TARGET_e1__
+#undef __TARGET_frv__
+#undef __TARGET_h8300__
+#undef __TARGET_hppa__
+#undef __TARGET_i386__
+#undef __TARGET_i960__
+#undef __TARGET_ia64__
+#undef __TARGET_m68k__
+#undef __TARGET_microblaze__
+#define __TARGET_mips__ 1
+#undef __TARGET_nios__
+#undef __TARGET_nios2__
+#undef __TARGET_powerpc__
+#undef __TARGET_sh__
+#undef __TARGET_sh64__
+#undef __TARGET_sparc__
+#undef __TARGET_v850__
+#undef __TARGET_vax__
+#undef __TARGET_x86_64__
+
+/* Target Architecture Features and Options */
+#define __TARGET_ARCH__ "mips"
+#define __FORCE_OPTIONS_FOR_ARCH__ 1
+#define __ARCH_CFLAGS__ "-mno-split-addresses"
+#define __CONFIG_MIPS_O32_ABI__ 1
+#undef __CONFIG_MIPS_N32_ABI__
+#undef __CONFIG_MIPS_N64_ABI__
+#undef __CONFIG_MIPS_ISA_1__
+#undef __CONFIG_MIPS_ISA_2__
+#undef __CONFIG_MIPS_ISA_3__
+#undef __CONFIG_MIPS_ISA_4__
+#define __CONFIG_MIPS_ISA_MIPS32__ 1
+#undef __CONFIG_MIPS_ISA_MIPS64__
+#define __TARGET_SUBARCH__ ""
+
+/* Using ELF file format */
+#define __ARCH_ANY_ENDIAN__ 1
+#define __ARCH_BIG_ENDIAN__ 1
+#define __ARCH_WANTS_BIG_ENDIAN__ 1
+#undef __ARCH_WANTS_LITTLE_ENDIAN__
+#define __ARCH_HAS_MMU__ 1
+#define __ARCH_USE_MMU__ 1
+#define __UCLIBC_HAS_FLOATS__ 1
+#undef __UCLIBC_HAS_FPU__
+#define __UCLIBC_HAS_SOFT_FLOAT__ 1
+#define __DO_C99_MATH__ 1
+#define __KERNEL_HEADERS__ "/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include"
+#define __HAVE_DOT_CONFIG__ 1
+
+/* General Library Settings */
+#undef __HAVE_NO_PIC__
+#define __DOPIC__ 1
+#undef __HAVE_NO_SHARED__
+#undef __ARCH_HAS_NO_LDSO__
+#define __HAVE_SHARED__ 1
+#define __FORCE_SHAREABLE_TEXT_SEGMENTS__ 1
+#define __LDSO_LDD_SUPPORT__ 1
+#define __LDSO_CACHE_SUPPORT__ 1
+#undef __LDSO_PRELOAD_FILE_SUPPORT__
+#define __LDSO_BASE_FILENAME__ "ld.so"
+#undef __UCLIBC_STATIC_LDCONFIG__
+#undef __LDSO_RUNPATH__
+#define __UCLIBC_CTOR_DTOR__ 1
+#undef __HAS_NO_THREADS__
+#define __UCLIBC_HAS_THREADS__ 1
+#define __PTHREADS_DEBUG_SUPPORT__ 1
+#define __LINUXTHREADS_OLD__ 1
+#define __UCLIBC_HAS_LFS__ 1
+#undef __MALLOC__
+#undef __MALLOC_SIMPLE__
+#define __MALLOC_STANDARD__ 1
+#define __MALLOC_GLIBC_COMPAT__ 1
+#define __UCLIBC_DYNAMIC_ATEXIT__ 1
+#undef __COMPAT_ATEXIT__
+#define __UCLIBC_SUSV3_LEGACY__ 1
+#define __UCLIBC_SUSV3_LEGACY_MACROS__ 1
+#define __UCLIBC_HAS_SHADOW__ 1
+#undef __UCLIBC_HAS_PROGRAM_INVOCATION_NAME__
+#define __UCLIBC_HAS___PROGNAME__ 1
+#undef __UNIX98PTY_ONLY__
+#define __ASSUME_DEVPTS__ 1
+#define __UCLIBC_HAS_TM_EXTENSIONS__ 1
+#define __UCLIBC_HAS_TZ_CACHING__ 1
+#define __UCLIBC_HAS_TZ_FILE__ 1
+#define __UCLIBC_HAS_TZ_FILE_READ_MANY__ 1
+#define __UCLIBC_TZ_FILE_PATH__ "/etc/TZ"
+
+/* Advanced Library Settings */
+#define __UCLIBC_PWD_BUFFER_SIZE__ 256
+#define __UCLIBC_GRP_BUFFER_SIZE__ 256
+
+/* Networking Support */
+#define __UCLIBC_HAS_IPV6__ 1
+#define __UCLIBC_HAS_RPC__ 1
+#define __UCLIBC_HAS_FULL_RPC__ 1
+#define __UCLIBC_HAS_REENTRANT_RPC__ 1
+#define __UCLIBC_USE_NETLINK__ 1
+#undef __UCLIBC_HAS_BSD_RES_CLOSE__
+
+/* String and Stdio Support */
+#define __UCLIBC_HAS_STRING_GENERIC_OPT__ 1
+#define __UCLIBC_HAS_STRING_ARCH_OPT__ 1
+#define __UCLIBC_HAS_CTYPE_TABLES__ 1
+#define __UCLIBC_HAS_CTYPE_SIGNED__ 1
+#undef __UCLIBC_HAS_CTYPE_UNSAFE__
+#define __UCLIBC_HAS_CTYPE_CHECKED__ 1
+#undef __UCLIBC_HAS_CTYPE_ENFORCED__
+#define __UCLIBC_HAS_WCHAR__ 1
+#undef __UCLIBC_HAS_LOCALE__
+#undef __UCLIBC_HAS_HEXADECIMAL_FLOATS__
+#undef __UCLIBC_HAS_GLIBC_CUSTOM_PRINTF__
+#define __UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS__ 9
+#undef __UCLIBC_HAS_SCANF_GLIBC_A_FLAG__
+#undef __UCLIBC_HAS_STDIO_BUFSIZ_NONE__
+#undef __UCLIBC_HAS_STDIO_BUFSIZ_256__
+#undef __UCLIBC_HAS_STDIO_BUFSIZ_512__
+#undef __UCLIBC_HAS_STDIO_BUFSIZ_1024__
+#undef __UCLIBC_HAS_STDIO_BUFSIZ_2048__
+#define __UCLIBC_HAS_STDIO_BUFSIZ_4096__ 1
+#undef __UCLIBC_HAS_STDIO_BUFSIZ_8192__
+#define __UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE__ 1
+#undef __UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4__
+#undef __UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8__
+#undef __UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT__
+#define __UCLIBC_HAS_STDIO_GETC_MACRO__ 1
+#define __UCLIBC_HAS_STDIO_PUTC_MACRO__ 1
+#define __UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION__ 1
+#define __UCLIBC_HAS_FOPEN_LARGEFILE_MODE__ 1
+#define __UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE__ 1
+#define __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__ 1
+#define __UCLIBC_HAS_PRINTF_M_SPEC__ 1
+#define __UCLIBC_HAS_ERRNO_MESSAGES__ 1
+#undef __UCLIBC_HAS_SYS_ERRLIST__
+#define __UCLIBC_HAS_SIGNUM_MESSAGES__ 1
+#undef __UCLIBC_HAS_SYS_SIGLIST__
+#define __UCLIBC_HAS_GNU_GETOPT__ 1
+#define __UCLIBC_HAS_GNU_GETSUBOPT__ 1
+
+/* Big and Tall */
+#define __UCLIBC_HAS_REGEX__ 1
+#define __UCLIBC_HAS_REGEX_OLD__ 1
+#define __UCLIBC_HAS_FNMATCH__ 1
+#define __UCLIBC_HAS_FNMATCH_OLD__ 1
+#undef __UCLIBC_HAS_WORDEXP__
+#undef __UCLIBC_HAS_FTW__
+#define __UCLIBC_HAS_GLOB__ 1
+#undef __UCLIBC_HAS_GNU_GLOB__
+
+/* Library Installation Options */
+#define __SHARED_LIB_LOADER_PREFIX__ "/lib"
+#define __RUNTIME_PREFIX__ "/"
+#define __DEVEL_PREFIX__ "/usr/"
+
+/* Security options */
+#undef __UCLIBC_BUILD_PIE__
+#undef __UCLIBC_HAS_ARC4RANDOM__
+#undef __HAVE_NO_SSP__
+#undef __UCLIBC_HAS_SSP__
+#define __UCLIBC_BUILD_RELRO__ 1
+#define __UCLIBC_BUILD_NOW__ 1
+#undef __UCLIBC_BUILD_NOEXECSTACK__
+
+/* uClibc development/debugging options */
+#define __CROSS_COMPILER_PREFIX__ "/opt/toolchains/uclibc-crosstools-gcc-4.4.2-1/usr/bin/mips-linux-uclibc-"
+#define __UCLIBC_EXTRA_CFLAGS__ ""
+#undef __DODEBUG__
+#undef __DODEBUG_PT__
+#define __DOSTRIP__ 1
+#undef __DOASSERTS__
+#undef __SUPPORT_LD_DEBUG__
+#undef __SUPPORT_LD_DEBUG_EARLY__
+#undef __UCLIBC_MALLOC_DEBUGGING__
+#define __WARNINGS__ "-Wall"
+#undef __EXTRA_WARNINGS__
+#undef __DOMULTI__
+#undef __UCLIBC_MJN3_ONLY__
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_ctype.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_ctype.h
new file mode 100644
index 0000000..dd723c7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_ctype.h
@@ -0,0 +1,279 @@
+/* Copyright (C) 2002 Manuel Novoa III
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * The GNU C Library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the GNU C Library; if not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307 USA.
+ */
+
+/* ATTENTION! ATTENTION! ATTENTION! ATTENTION! ATTENTION!
+ *
+ * Besides uClibc, I'm using this code in my libc for elks, which is
+ * a 16-bit environment with a fairly limited compiler. It would make
+ * things much easier for me if this file isn't modified unnecessarily.
+ * In particular, please put any new or replacement functions somewhere
+ * else, and modify the makefile to use your version instead.
+ * Thanks. Manuel
+ *
+ * ATTENTION! ATTENTION! ATTENTION! ATTENTION! ATTENTION! */
+
+#if !defined(_CTYPE_H) && !defined(_WCTYPE_H)
+#error Always include <{w}ctype.h> rather than <bits/uClibc_ctype.h>
+#endif
+
+#ifndef _BITS_CTYPE_H
+#define _BITS_CTYPE_H
+
+#ifdef __UCLIBC_GEN_LOCALE
+
+/* Taking advantage of the C99 mutual-exclusion guarantees for the various
+ * (w)ctype classes, including the descriptions of printing and control
+ * (w)chars, we can place each in one of the following mutually-exlusive
+ * subsets. Since there are less than 16, we can store the data for
+ * each (w)chars in a nibble. In contrast, glibc uses an unsigned int
+ * per (w)char, with one bit flag for each is* type. While this allows
+ * a simple '&' operation to determine the type vs. a range test and a
+ * little special handling for the "blank" and "xdigit" types in my
+ * approach, it also uses 8 times the space for the tables on the typical
+ * 32-bit archs we supported.*/
+enum {
+ __CTYPE_unclassified = 0,
+ __CTYPE_alpha_nonupper_nonlower,
+ __CTYPE_alpha_lower,
+ __CTYPE_alpha_upper_lower,
+ __CTYPE_alpha_upper,
+ __CTYPE_digit,
+ __CTYPE_punct,
+ __CTYPE_graph,
+ __CTYPE_print_space_nonblank,
+ __CTYPE_print_space_blank,
+ __CTYPE_space_nonblank_noncntrl,
+ __CTYPE_space_blank_noncntrl,
+ __CTYPE_cntrl_space_nonblank,
+ __CTYPE_cntrl_space_blank,
+ __CTYPE_cntrl_nonspace
+};
+
+/* Some macros that test for various (w)ctype classes when passed one of the
+ * designator values enumerated above. */
+#define __CTYPE_isalnum(D) ((unsigned int)(D-1) <= (__CTYPE_digit-1))
+#define __CTYPE_isalpha(D) ((unsigned int)(D-1) <= (__CTYPE_alpha_upper-1))
+#define __CTYPE_isblank(D) \
+ ((((unsigned int)(D - __CTYPE_print_space_nonblank)) <= 5) && (D & 1))
+#define __CTYPE_iscntrl(D) (((unsigned int)(D - __CTYPE_cntrl_space_nonblank)) <= 2)
+#define __CTYPE_isdigit(D) (D == __CTYPE_digit)
+#define __CTYPE_isgraph(D) ((unsigned int)(D-1) <= (__CTYPE_graph-1))
+#define __CTYPE_islower(D) (((unsigned int)(D - __CTYPE_alpha_lower)) <= 1)
+#define __CTYPE_isprint(D) ((unsigned int)(D-1) <= (__CTYPE_print_space_blank-1))
+#define __CTYPE_ispunct(D) (D == __CTYPE_punct)
+#define __CTYPE_isspace(D) (((unsigned int)(D - __CTYPE_print_space_nonblank)) <= 5)
+#define __CTYPE_isupper(D) (((unsigned int)(D - __CTYPE_alpha_upper_lower)) <= 1)
+/* #define __CTYPE_isxdigit(D) -- isxdigit is untestable this way.
+ * But that's ok as isxdigit() (and isdigit() too) are locale-invariant. */
+
+#else /* __UCLIBC_GEN_LOCALE *****************************************/
+
+/* Define some ctype macros valid for the C/POSIX locale. */
+
+/* ASCII ords of \t, \f, \n, \r, and \v are 9, 12, 10, 13, 11 respectively. */
+#define __C_isspace(c) \
+ ((sizeof(c) == sizeof(char)) \
+ ? ((((c) == ' ') || (((unsigned char)((c) - 9)) <= (13 - 9)))) \
+ : ((((c) == ' ') || (((unsigned int)((c) - 9)) <= (13 - 9)))))
+#define __C_isblank(c) (((c) == ' ') || ((c) == '\t'))
+#define __C_isdigit(c) \
+ ((sizeof(c) == sizeof(char)) \
+ ? (((unsigned char)((c) - '0')) < 10) \
+ : (((unsigned int)((c) - '0')) < 10))
+#define __C_isxdigit(c) \
+ (__C_isdigit(c) \
+ || ((sizeof(c) == sizeof(char)) \
+ ? (((unsigned char)((((c)) | 0x20) - 'a')) < 6) \
+ : (((unsigned int)((((c)) | 0x20) - 'a')) < 6)))
+#define __C_iscntrl(c) \
+ ((sizeof(c) == sizeof(char)) \
+ ? ((((unsigned char)(c)) < 0x20) || ((c) == 0x7f)) \
+ : ((((unsigned int)(c)) < 0x20) || ((c) == 0x7f)))
+#define __C_isalpha(c) \
+ ((sizeof(c) == sizeof(char)) \
+ ? (((unsigned char)(((c) | 0x20) - 'a')) < 26) \
+ : (((unsigned int)(((c) | 0x20) - 'a')) < 26))
+#define __C_isalnum(c) (__C_isalpha(c) || __C_isdigit(c))
+#define __C_isprint(c) \
+ ((sizeof(c) == sizeof(char)) \
+ ? (((unsigned char)((c) - 0x20)) <= (0x7e - 0x20)) \
+ : (((unsigned int)((c) - 0x20)) <= (0x7e - 0x20)))
+#define __C_islower(c) \
+ ((sizeof(c) == sizeof(char)) \
+ ? (((unsigned char)((c) - 'a')) < 26) \
+ : (((unsigned int)((c) - 'a')) < 26))
+#define __C_isupper(c) \
+ ((sizeof(c) == sizeof(char)) \
+ ? (((unsigned char)((c) - 'A')) < 26) \
+ : (((unsigned int)((c) - 'A')) < 26))
+#define __C_ispunct(c) \
+ ((!__C_isalnum(c)) \
+ && ((sizeof(c) == sizeof(char)) \
+ ? (((unsigned char)((c) - 0x21)) <= (0x7e - 0x21)) \
+ : (((unsigned int)((c) - 0x21)) <= (0x7e - 0x21))))
+#define __C_isgraph(c) \
+ ((sizeof(c) == sizeof(char)) \
+ ? (((unsigned int)((c) - 0x21)) <= (0x7e - 0x21)) \
+ : (((unsigned int)((c) - 0x21)) <= (0x7e - 0x21)))
+
+#define __C_tolower(c) (__C_isupper(c) ? ((c) | 0x20) : (c))
+#define __C_toupper(c) (__C_islower(c) ? ((c) ^ 0x20) : (c))
+
+/**********************************************************************/
+__BEGIN_DECLS
+
+extern int isalnum(int c) __THROW;
+extern int isalpha(int c) __THROW;
+#ifdef __USE_ISOC99
+extern int isblank(int c) __THROW;
+#endif
+extern int iscntrl(int c) __THROW;
+extern int isdigit(int c) __THROW;
+extern int isgraph(int c) __THROW;
+extern int islower(int c) __THROW;
+extern int isprint(int c) __THROW;
+extern int ispunct(int c) __THROW;
+extern int isspace(int c) __THROW;
+extern int isupper(int c) __THROW;
+extern int isxdigit(int c) __THROW;
+
+extern int tolower(int c) __THROW;
+extern int toupper(int c) __THROW;
+
+#if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
+extern int isascii(int c) __THROW;
+extern int toascii(int c) __THROW;
+#endif
+
+#if defined _LIBC && (defined NOT_IN_libc || defined IS_IN_libc)
+/* isdigit() is really locale-invariant, so provide some small fast macros.
+ * These are uClibc-specific. */
+#define __isdigit_char(C) (((unsigned char)((C) - '0')) <= 9)
+#define __isdigit_int(C) (((unsigned int)((C) - '0')) <= 9)
+#endif
+
+/* Next, some ctype macros which are valid for all supported locales. */
+/* WARNING: isspace and isblank need to be reverified if more 8-bit codesets
+ * are added!!! But isdigit and isxdigit are always valid. */
+
+/* #define __isspace(c) __C_isspace(c) */
+/* #define __isblank(c) __C_isblank(c) */
+
+/* #define __isdigit(c) __C_isdigit(c) */
+/* #define __isxdigit(c) __C_isxdigit(c) */
+
+/* Now some non-ansi/iso c99 macros. */
+
+#define __isascii(c) (((c) & ~0x7f) == 0)
+#define __toascii(c) ((c) & 0x7f)
+#define _toupper(c) ((c) ^ 0x20)
+#define _tolower(c) ((c) | 0x20)
+
+__END_DECLS
+
+/**********************************************************************/
+#ifdef __GNUC__
+
+#define __isbody_C_macro(f,args) __C_ ## f args
+
+#define __isbody(f,c) \
+ (__extension__ ({ \
+ int __res; \
+ if (sizeof(c) > sizeof(char)) { \
+ int __c = (c); \
+ __res = __isbody_C_macro(f,(__c)); \
+ } else { \
+ unsigned char __c = (c); \
+ __res = __isbody_C_macro(f,(__c)); \
+ } \
+ __res; \
+ }))
+
+#define __body_C_macro(f,args) __C_ ## f args
+
+#define __body(f,c) \
+ (__extension__ ({ \
+ int __res; \
+ if (sizeof(c) > sizeof(char)) { \
+ int __c = (c); \
+ __res = __body_C_macro(f,(__c)); \
+ } else { \
+ unsigned char __c = (c); \
+ __res = __body_C_macro(f,(__c)); \
+ } \
+ __res; \
+ }))
+
+#define __isspace(c) __body(isspace,c)
+#define __isblank(c) __body(isblank,c)
+#define __isdigit(c) __body(isdigit,c)
+#define __isxdigit(c) __body(isxdigit,c)
+#define __iscntrl(c) __body(iscntrl,c)
+#define __isalpha(c) __body(isalpha,c)
+#define __isalnum(c) __body(isalnum,c)
+#define __isprint(c) __body(isprint,c)
+#define __islower(c) __body(islower,c)
+#define __isupper(c) __body(isupper,c)
+#define __ispunct(c) __body(ispunct,c)
+#define __isgraph(c) __body(isgraph,c)
+
+#define __tolower(c) __body(tolower,c)
+#define __toupper(c) __body(toupper,c)
+
+#if !defined __NO_CTYPE && !defined __cplusplus
+
+#define isspace(c) __isspace(c)
+#define isblank(c) __isblank(c)
+#define isdigit(c) __isdigit(c)
+#define isxdigit(c) __isxdigit(c)
+#define iscntrl(c) __iscntrl(c)
+#define isalpha(c) __isalpha(c)
+#define isalnum(c) __isalnum(c)
+#define isprint(c) __isprint(c)
+#define islower(c) __islower(c)
+#define isupper(c) __isupper(c)
+#define ispunct(c) __ispunct(c)
+#define isgraph(c) __isgraph(c)
+
+#define tolower(c) __tolower(c)
+#define toupper(c) __toupper(c)
+
+
+#endif
+
+#else /* _GNUC__ ***************************************************/
+
+#if !defined __NO_CTYPE && !defined __cplusplus
+
+/* These macros should be safe from side effects. */
+
+#define isdigit(c) __C_isdigit(c)
+#define isalpha(c) __C_isalpha(c)
+#define isprint(c) __C_isprint(c)
+#define islower(c) __C_islower(c)
+#define isupper(c) __C_isupper(c)
+#define isgraph(c) __C_isgraph(c)
+
+#endif
+
+#endif /* __GNUC__ */
+/**********************************************************************/
+
+#endif /* __UCLIBC_GEN_LOCALE */
+
+#endif /* _BITS_CTYPE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_errno.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_errno.h
new file mode 100644
index 0000000..b16de32
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_errno.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+#ifndef _BITS_UCLIBC_ERRNO_H
+#define _BITS_UCLIBC_ERRNO_H 1
+
+#ifdef IS_IN_rtld
+# undef errno
+# define errno _dl_errno
+extern int _dl_errno; // attribute_hidden;
+#elif defined __UCLIBC_HAS_THREADS__
+# include <tls.h>
+# if defined USE___THREAD && USE___THREAD
+# undef errno
+# ifndef NOT_IN_libc
+# define errno __libc_errno
+# else
+# define errno errno
+# endif
+extern __thread int errno __attribute_tls_model_ie;
+# endif /* USE___THREAD */
+#endif /* IS_IN_rtld */
+
+#define __set_errno(val) (errno = (val))
+
+#ifndef __ASSEMBLER__
+extern int *__errno_location (void) __THROW __attribute__ ((__const__))
+# ifdef IS_IN_rtld
+ attribute_hidden
+# endif
+;
+# if defined __UCLIBC_HAS_THREADS__
+# include <tls.h>
+# if defined USE___THREAD && USE___THREAD
+libc_hidden_proto(__errno_location)
+# endif
+# endif
+
+#endif /* !__ASSEMBLER__ */
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_fpmax.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_fpmax.h
new file mode 100644
index 0000000..e1721bf
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_fpmax.h
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2003-2006 Manuel Novoa III
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Define a maximal floating point type, and the associated constants
+ * that are defined for the floating point types in float.h.
+ *
+ * This is to support archs that are missing long double, or even double.
+ */
+
+#ifndef _UCLIBC_FPMAX_H
+#define _UCLIBC_FPMAX_H
+
+#ifndef _ISOC99_SOURCE
+#define _ISOC99_SOURCE 1
+#endif
+
+#include <features.h>
+#include <float.h>
+
+#ifdef __UCLIBC_HAS_FLOATS__
+
+#if defined(LDBL_MANT_DIG)
+
+typedef long double __fpmax_t;
+#define FPMAX_TYPE 3
+
+#define FPMAX_MANT_DIG LDBL_MANT_DIG
+#define FPMAX_DIG LDBL_DIG
+#define FPMAX_EPSILON LDBL_EPSILON
+#define FPMAX_MIN_EXP LDBL_MIN_EXP
+#define FPMAX_MIN LDBL_MIN
+#define FPMAX_MIN_10_EXP LDBL_MIN_10_EXP
+#define FPMAX_MAX_EXP LDBL_MAX_EXP
+#define FPMAX_MAX LDBL_MAX
+#define FPMAX_MAX_10_EXP LDBL_MAX_10_EXP
+
+#elif defined(DBL_MANT_DIG)
+
+typedef double __fpmax_t;
+#define FPMAX_TYPE 2
+
+#define FPMAX_MANT_DIG DBL_MANT_DIG
+#define FPMAX_DIG DBL_DIG
+#define FPMAX_EPSILON DBL_EPSILON
+#define FPMAX_MIN_EXP DBL_MIN_EXP
+#define FPMAX_MIN DBL_MIN
+#define FPMAX_MIN_10_EXP DBL_MIN_10_EXP
+#define FPMAX_MAX_EXP DBL_MAX_EXP
+#define FPMAX_MAX DBL_MAX
+#define FPMAX_MAX_10_EXP DBL_MAX_10_EXP
+
+#elif defined(FLT_MANT_DIG)
+
+typedef float __fpmax_t;
+#define FPMAX_TYPE 1
+
+#define FPMAX_MANT_DIG FLT_MANT_DIG
+#define FPMAX_DIG FLT_DIG
+#define FPMAX_EPSILON FLT_EPSILON
+#define FPMAX_MIN_EXP FLT_MIN_EXP
+#define FPMAX_MIN FLT_MIN
+#define FPMAX_MIN_10_EXP FLT_MIN_10_EXP
+#define FPMAX_MAX_EXP FLT_MAX_EXP
+#define FPMAX_MAX FLT_MAX
+#define FPMAX_MAX_10_EXP FLT_MAX_10_EXP
+
+#else
+#error unable to determine appropriate type for __fpmax_t!
+#endif
+
+#ifndef DECIMAL_DIG
+
+#ifdef L___strtofpmax
+/* Emit warning only once. */
+#warning DECIMAL_DIG is not defined! If you are using gcc, it may not be defining __STDC_VERSION__ as it should.
+#endif
+#if !defined(FLT_RADIX) || (FLT_RADIX != 2)
+#error unable to compensate for missing DECIMAL_DIG!
+#endif
+
+/* ceil (1 + #mantissa * log10 (FLT_RADIX)) */
+#define DECIMAL_DIG (1 + (((FPMAX_MANT_DIG * 100) + 331) / 332))
+
+#endif /* DECIMAL_DIG */
+
+#if defined _LIBC && defined IS_IN_libc
+extern __fpmax_t __strtofpmax(const char *str, char **endptr, int exp_adjust) attribute_hidden;
+
+#ifdef __UCLIBC_HAS_XLOCALE__
+extern __fpmax_t __strtofpmax_l(const char *str, char **endptr, int exp_adjust,
+ __locale_t locale_arg) attribute_hidden;
+#endif
+
+#ifdef __UCLIBC_HAS_WCHAR__
+extern __fpmax_t __wcstofpmax(const wchar_t *wcs, wchar_t **endptr,
+ int exp_adjust) attribute_hidden;
+
+#ifdef __UCLIBC_HAS_XLOCALE__
+extern __fpmax_t __wcstofpmax_l(const wchar_t *wcs, wchar_t **endptr,
+ int exp_adjust, __locale_t locale_arg) attribute_hidden;
+#endif
+#endif /* __UCLIBC_HAS_WCHAR__ */
+#endif /* _LIBC */
+
+/* The following checks in an __fpmax_t is either 0 or +/- infinity.
+ *
+ * WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!!
+ *
+ * This only works if __fpmax_t is the actual maximal floating point type used
+ * in intermediate calculations. Otherwise, excess precision in the
+ * intermediate values can cause the test to fail.
+ *
+ * WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!!
+ */
+
+#define __FPMAX_ZERO_OR_INF_CHECK(x) ((x) == ((x)/4) )
+
+#endif /* __UCLIBC_HAS_FLOATS__ */
+
+#endif /* _UCLIBC_FPMAX_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_local_lim.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_local_lim.h
new file mode 100644
index 0000000..6c23f39
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_local_lim.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/*
+ * Never include this file directly; use <unistd.h> instead.
+ */
+
+#ifndef _BITS_UCLIBC_LOCAL_LIM_H
+#define _BITS_UCLIBC_LOCAL_LIM_H 1
+
+/* This file works correctly only if local_lim.h is the NPTL version */
+#if !defined PTHREAD_KEYS_MAX || defined TIMER_MAX
+# error local_lim.h was incorrectly updated, use the NPTL version from glibc
+#endif
+
+/* This should really be moved to thread specific directories */
+#if defined __UCLIBC_HAS_THREADS__
+# define PTHREAD_THREADS_MAX 1024
+# define TIMER_MAX 256
+#endif
+
+#ifndef __UCLIBC_HAS_THREADS__
+# undef _POSIX_THREAD_KEYS_MAX
+# undef PTHREAD_KEYS_MAX
+# undef _POSIX_THREAD_DESTRUCTOR_ITERATIONS
+# undef PTHREAD_DESTRUCTOR_ITERATIONS
+# undef PTHREAD_STACK_MIN
+# undef DELAYTIMER_MAX
+#endif
+
+#endif /* bits/uClibc_local_lim.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_locale.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_locale.h
new file mode 100644
index 0000000..1de735a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_locale.h
@@ -0,0 +1,380 @@
+/* Copyright (C) 2002, 2003 Manuel Novoa III
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * The GNU C Library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the GNU C Library; if not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307 USA.
+ */
+
+/* ATTENTION! ATTENTION! ATTENTION! ATTENTION! ATTENTION!
+ *
+ * Besides uClibc, I'm using this code in my libc for elks, which is
+ * a 16-bit environment with a fairly limited compiler. It would make
+ * things much easier for me if this file isn't modified unnecessarily.
+ * In particular, please put any new or replacement functions somewhere
+ * else, and modify the makefile to use your version instead.
+ * Thanks. Manuel
+ *
+ * ATTENTION! ATTENTION! ATTENTION! ATTENTION! ATTENTION! */
+
+#ifndef _UCLIBC_LOCALE_H
+#define _UCLIBC_LOCALE_H
+
+/**********************************************************************/
+/* uClibc compatibilty stuff */
+
+#ifdef __UCLIBC_HAS_LOCALE__
+
+#undef __LOCALE_C_ONLY
+
+#else /* __UCLIBC_HAS_LOCALE__ */
+
+#define __LOCALE_C_ONLY
+
+#define __XL_NPP(N) N
+#define __LOCALE_PARAM
+#define __LOCALE_ARG
+
+#endif /* __UCLIBC_HAS_LOCALE__ */
+
+/**********************************************************************/
+
+#define __NL_ITEM_CATEGORY_SHIFT (8)
+#define __NL_ITEM_INDEX_MASK (0xff)
+
+/* TODO: Make sure these agree with the locale mmap file gererator! */
+
+#define __LC_CTYPE 0
+#define __LC_NUMERIC 1
+#define __LC_MONETARY 2
+#define __LC_TIME 3
+#define __LC_COLLATE 4
+#define __LC_MESSAGES 5
+#define __LC_ALL 6
+
+/**********************************************************************/
+#ifndef __LOCALE_C_ONLY
+
+#if defined _LIBC /* && (defined IS_IN_libc || defined NOT_IN_libc) */
+#include <stddef.h>
+#include <stdint.h>
+#include <bits/uClibc_touplow.h>
+
+#ifndef __UCLIBC_GEN_LOCALE
+#include <bits/uClibc_locale_data.h>
+#endif
+#endif
+
+/* extern void _locale_set(const unsigned char *p); */
+/* extern void _locale_init(void); */
+
+enum {
+ __ctype_encoding_7_bit, /* C/POSIX */
+ __ctype_encoding_utf8, /* UTF-8 */
+ __ctype_encoding_8_bit /* for 8-bit codeset locales */
+};
+
+#define LOCALE_STRING_SIZE (2 * __LC_ALL + 2)
+
+ /*
+ * '#' + 2_per_category + '\0'
+ * {locale row # : 0 = C|POSIX} + 0x8001
+ * encoded in two chars as (((N+1) >> 8) | 0x80) and ((N+1) & 0xff)
+ * so decode is ((((uint16_t)(*s & 0x7f)) << 8) + s[1]) - 1
+ *
+ * Note: 0s are not used as they are nul-terminators for strings.
+ * Note: 0xff, 0xff is the encoding for a non-selected locale.
+ * (see setlocale() below).
+ * In particular, C/POSIX locale is '#' + "\x80\x01"}*LC_ALL + nul.
+ */
+
+#if defined _LIBC && !defined __UCLIBC_GEN_LOCALE /* && (defined IS_IN_libc || defined NOT_IN_libc) */
+typedef struct {
+ uint16_t num_weights;
+ uint16_t num_starters;
+ uint16_t ii_shift;
+ uint16_t ti_shift;
+ uint16_t ii_len;
+ uint16_t ti_len;
+ uint16_t max_weight;
+ uint16_t num_col_base;
+ uint16_t max_col_index;
+ uint16_t undefined_idx;
+ uint16_t range_low;
+ uint16_t range_count;
+ uint16_t range_base_weight;
+ uint16_t range_rule_offset; /* change name to index? */
+
+ uint16_t ii_mask;
+ uint16_t ti_mask;
+
+ const uint16_t *index2weight_tbl;
+ const uint16_t *index2ruleidx_tbl;
+ const uint16_t *multistart_tbl;
+ /* uint16_t wcs2colidt_offset_low; */
+ /* uint16_t wcs2colidt_offset_hi; */
+ const uint16_t *wcs2colidt_tbl;
+
+ /* uint16_t undefined_idx; */
+ const uint16_t *overrides_tbl;
+ /* uint16_t *multistart_tbl; */
+
+ const uint16_t *weightstr;
+ const uint16_t *ruletable;
+
+
+ uint16_t *index2weight;
+ uint16_t *index2ruleidx;
+
+ uint16_t MAX_WEIGHTS;
+} __collate_t;
+
+
+/* static unsigned char cur_locale[LOCALE_STRING_SIZE]; */
+
+typedef struct __uclibc_locale_struct {
+#ifdef __UCLIBC_HAS_XLOCALE__
+ const __ctype_mask_t *__ctype_b;
+ const __ctype_touplow_t *__ctype_tolower;
+ const __ctype_touplow_t *__ctype_toupper;
+#endif
+
+ /* For now, just embed this in the structure. */
+ __ctype_mask_t __ctype_b_data[256 + __UCLIBC_CTYPE_B_TBL_OFFSET];
+ __ctype_touplow_t __ctype_tolower_data[256 + __UCLIBC_CTYPE_TO_TBL_OFFSET];
+ __ctype_touplow_t __ctype_toupper_data[256 + __UCLIBC_CTYPE_TO_TBL_OFFSET];
+
+/* int tables_loaded; */
+/* unsigned char lctypes[LOCALE_STRING_SIZE]; */
+ unsigned char cur_locale[LOCALE_STRING_SIZE];
+
+ /* NL_LANGINFO stuff. BEWARE ORDERING!!! must agree with NL_* constants! */
+ /* Also, numeric must be followed by monetary and the items must be in
+ * the "struct lconv" order. */
+
+ uint16_t category_offsets[__LC_ALL]; /* TODO -- fix? */
+ unsigned char category_item_count[__LC_ALL]; /* TODO - fix */
+
+ /* ctype */
+ unsigned char encoding; /* C/POSIX, 8-bit, UTF-8 */
+ unsigned char mb_cur_max; /* determined by encoding _AND_ translit!!! */
+ const unsigned char outdigit_length[10];
+
+#ifdef __CTYPE_HAS_8_BIT_LOCALES
+ const unsigned char *idx8ctype;
+ const unsigned char *tbl8ctype;
+ const unsigned char *idx8uplow;
+ const unsigned char *tbl8uplow;
+#ifdef __UCLIBC_HAS_WCHAR__
+ const unsigned char *idx8c2wc;
+ const uint16_t *tbl8c2wc; /* char > 0x7f to wide char */
+ const unsigned char *idx8wc2c;
+ const unsigned char *tbl8wc2c;
+ /* translit */
+#endif /* __UCLIBC_HAS_WCHAR__ */
+#endif /* __CTYPE_HAS_8_BIT_LOCALES */
+#ifdef __UCLIBC_HAS_WCHAR__
+
+ const uint16_t *code2flag;
+
+ const unsigned char *tblwctype;
+ const unsigned char *tblwuplow;
+/* const unsigned char *tblwcomb; */
+ const int16_t *tblwuplow_diff; /* yes... signed */
+ /* width?? */
+
+ wchar_t decimal_point_wc;
+ wchar_t thousands_sep_wc;
+ int decimal_point_len;
+ int thousands_sep_len;
+
+#endif /* __UCLIBC_HAS_WCHAR__ */
+
+ /* ctype */
+ const char *outdigit0_mb;
+ const char *outdigit1_mb;
+ const char *outdigit2_mb;
+ const char *outdigit3_mb;
+ const char *outdigit4_mb;
+ const char *outdigit5_mb;
+ const char *outdigit6_mb;
+ const char *outdigit7_mb;
+ const char *outdigit8_mb;
+ const char *outdigit9_mb;
+ const char *codeset; /* MUST BE LAST!!! */
+
+ /* numeric */
+ const char *decimal_point;
+ const char *thousands_sep;
+ const char *grouping;
+
+ /* monetary */
+ const char *int_curr_symbol;
+ const char *currency_symbol;
+ const char *mon_decimal_point;
+ const char *mon_thousands_sep;
+ const char *mon_grouping;
+ const char *positive_sign;
+ const char *negative_sign;
+ const char *int_frac_digits;
+ const char *frac_digits;
+ const char *p_cs_precedes;
+ const char *p_sep_by_space;
+ const char *n_cs_precedes;
+ const char *n_sep_by_space;
+ const char *p_sign_posn;
+ const char *n_sign_posn;
+ const char *int_p_cs_precedes;
+ const char *int_p_sep_by_space;
+ const char *int_n_cs_precedes;
+ const char *int_n_sep_by_space;
+ const char *int_p_sign_posn;
+ const char *int_n_sign_posn;
+
+ const char *crncystr; /* not returned by localeconv */
+
+ /* time */
+ const char *abday_1;
+ const char *abday_2;
+ const char *abday_3;
+ const char *abday_4;
+ const char *abday_5;
+ const char *abday_6;
+ const char *abday_7;
+
+ const char *day_1;
+ const char *day_2;
+ const char *day_3;
+ const char *day_4;
+ const char *day_5;
+ const char *day_6;
+ const char *day_7;
+
+ const char *abmon_1;
+ const char *abmon_2;
+ const char *abmon_3;
+ const char *abmon_4;
+ const char *abmon_5;
+ const char *abmon_6;
+ const char *abmon_7;
+ const char *abmon_8;
+ const char *abmon_9;
+ const char *abmon_10;
+ const char *abmon_11;
+ const char *abmon_12;
+
+ const char *mon_1;
+ const char *mon_2;
+ const char *mon_3;
+ const char *mon_4;
+ const char *mon_5;
+ const char *mon_6;
+ const char *mon_7;
+ const char *mon_8;
+ const char *mon_9;
+ const char *mon_10;
+ const char *mon_11;
+ const char *mon_12;
+
+ const char *am_str;
+ const char *pm_str;
+
+ const char *d_t_fmt;
+ const char *d_fmt;
+ const char *t_fmt;
+ const char *t_fmt_ampm;
+ const char *era;
+
+ const char *era_year; /* non SUSv3 */
+ const char *era_d_fmt;
+ const char *alt_digits;
+ const char *era_d_t_fmt;
+ const char *era_t_fmt;
+
+ /* collate is at the end */
+
+ /* messages */
+ const char *yesexpr;
+ const char *noexpr;
+ const char *yesstr;
+ const char *nostr;
+
+ /* collate is at the end */
+ __collate_t collate;
+
+} __uclibc_locale_t;
+
+extern __uclibc_locale_t __global_locale_data;
+extern struct __uclibc_locale_struct * __global_locale;
+#endif /* _LIBC */
+
+typedef struct __uclibc_locale_struct *__locale_t;
+
+/* if we need to leave only _LIBC, then attribute_hidden is not usable */
+#if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc)
+extern int __locale_mbrtowc_l(wchar_t *__restrict dst,
+ const char *__restrict src,
+ __locale_t loc ) attribute_hidden;
+#endif
+
+#ifdef L_setlocale
+/* so we only get the warning once... */
+#warning need thread version of CUR_LOCALE!
+#endif
+/**********************************************************************/
+#ifdef __UCLIBC_HAS_XLOCALE__
+
+extern __locale_t __curlocale_var;
+
+#ifdef __UCLIBC_HAS_THREADS__
+
+extern __locale_t __curlocale(void) __THROW __attribute__ ((__const__));
+extern __locale_t __curlocale_set(__locale_t newloc);
+#define __UCLIBC_CURLOCALE (__curlocale())
+#define __UCLIBC_CURLOCALE_DATA (*__curlocale())
+
+#else /* __UCLIBC_HAS_THREADS__ */
+
+#define __UCLIBC_CURLOCALE (__curlocale_var)
+#define __UCLIBC_CURLOCALE_DATA (*__curlocale_var)
+
+#endif /* __UCLIBC_HAS_THREADS__ */
+
+#elif defined(__UCLIBC_HAS_LOCALE__)
+
+#define __UCLIBC_CURLOCALE (__global_locale)
+#define __UCLIBC_CURLOCALE_DATA (*__global_locale)
+
+#endif
+/**********************************************************************/
+#if defined(__UCLIBC_HAS_XLOCALE__) && defined(__UCLIBC_DO_XLOCALE)
+
+#define __XL_NPP(N) N ## _l
+#define __LOCALE_PARAM , __locale_t locale_arg
+#define __LOCALE_ARG , locale_arg
+#define __LOCALE_PTR locale_arg
+
+#else /* defined(__UCLIBC_HAS_XLOCALE__) && defined(__UCLIBC_DO_XLOCALE) */
+
+#define __XL_NPP(N) N
+#define __LOCALE_PARAM
+#define __LOCALE_ARG
+#define __LOCALE_PTR __UCLIBC_CURLOCALE
+
+#endif /* defined(__UCLIBC_HAS_XLOCALE__) && defined(__UCLIBC_DO_XLOCALE) */
+/**********************************************************************/
+
+#endif /* !defined(__LOCALE_C_ONLY) */
+/**********************************************************************/
+
+#endif /* _UCLIBC_LOCALE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_mutex.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_mutex.h
new file mode 100644
index 0000000..14aeb9c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_mutex.h
@@ -0,0 +1,88 @@
+/* Copyright (C) 2006 Manuel Novoa III <mjn3@codepoet.org>
+ *
+ * GNU Library General Public License (LGPL) version 2 or later.
+ *
+ * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
+ */
+
+#ifndef _UCLIBC_MUTEX_H
+#define _UCLIBC_MUTEX_H
+
+#include <features.h>
+
+#ifdef __UCLIBC_HAS_THREADS__
+
+#include <pthread.h>
+#include <bits/uClibc_pthread.h>
+
+#define __UCLIBC_MUTEX_TYPE pthread_mutex_t
+
+#define __UCLIBC_MUTEX(M) pthread_mutex_t M
+#define __UCLIBC_MUTEX_INIT(M,I) pthread_mutex_t M = I
+#define __UCLIBC_MUTEX_STATIC(M,I) static pthread_mutex_t M = I
+#define __UCLIBC_MUTEX_EXTERN(M) extern pthread_mutex_t M
+
+#define __UCLIBC_MUTEX_LOCK_CANCEL_UNSAFE(M) \
+ __pthread_mutex_lock(&(M))
+
+#define __UCLIBC_MUTEX_UNLOCK_CANCEL_UNSAFE(M) \
+ __pthread_mutex_unlock(&(M))
+
+#define __UCLIBC_MUTEX_TRYLOCK_CANCEL_UNSAFE(M) \
+ __pthread_mutex_trylock(&(M))
+
+#define __UCLIBC_MUTEX_CONDITIONAL_LOCK(M,C) \
+ do { \
+ struct _pthread_cleanup_buffer __infunc_pthread_cleanup_buffer; \
+ if (C) { \
+ _pthread_cleanup_push_defer(&__infunc_pthread_cleanup_buffer, \
+ (void (*) (void *))__pthread_mutex_unlock, \
+ &(M)); \
+ __pthread_mutex_lock(&(M)); \
+ } \
+ ((void)0)
+
+#define __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M,C) \
+ if (C) { \
+ _pthread_cleanup_pop_restore(&__infunc_pthread_cleanup_buffer,1); \
+ } \
+ } while (0)
+
+#define __UCLIBC_MUTEX_AUTO_LOCK_VAR(A) int A
+
+#define __UCLIBC_MUTEX_AUTO_LOCK(M,A,V) \
+ __UCLIBC_MUTEX_CONDITIONAL_LOCK(M,((A=(V)) == 0))
+
+#define __UCLIBC_MUTEX_AUTO_UNLOCK(M,A) \
+ __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M,(A == 0))
+
+#define __UCLIBC_MUTEX_LOCK(M) \
+ __UCLIBC_MUTEX_CONDITIONAL_LOCK(M, 1)
+
+#define __UCLIBC_MUTEX_UNLOCK(M) \
+ __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M, 1)
+
+#else
+
+#define __UCLIBC_MUTEX(M) void *__UCLIBC_MUTEX_DUMMY_ ## M
+#define __UCLIBC_MUTEX_INIT(M,I) extern void *__UCLIBC_MUTEX_DUMMY_ ## M
+#define __UCLIBC_MUTEX_STATIC(M,I) extern void *__UCLIBC_MUTEX_DUMMY_ ## M
+#define __UCLIBC_MUTEX_EXTERN(M) extern void *__UCLIBC_MUTEX_DUMMY_ ## M
+
+#define __UCLIBC_MUTEX_LOCK_CANCEL_UNSAFE(M) ((void)0)
+#define __UCLIBC_MUTEX_UNLOCK_CANCEL_UNSAFE(M) ((void)0)
+#define __UCLIBC_MUTEX_TRYLOCK_CANCEL_UNSAFE(M) (0) /* Always succeed? */
+
+#define __UCLIBC_MUTEX_CONDITIONAL_LOCK(M,C) ((void)0)
+#define __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M,C) ((void)0)
+
+#define __UCLIBC_MUTEX_AUTO_LOCK_VAR(A) ((void)0)
+#define __UCLIBC_MUTEX_AUTO_LOCK(M,A,V) ((void)0)
+#define __UCLIBC_MUTEX_AUTO_UNLOCK(M,A) ((void)0)
+
+#define __UCLIBC_MUTEX_LOCK(M) ((void)0)
+#define __UCLIBC_MUTEX_UNLOCK(M) ((void)0)
+
+#endif
+
+#endif /* _UCLIBC_MUTEX_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_page.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_page.h
new file mode 100644
index 0000000..915918c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_page.h
@@ -0,0 +1,35 @@
+/* Copyright (C) 2004 Erik Andersen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supply an architecture specific value for PAGE_SIZE and friends. */
+
+#ifndef _UCLIBC_PAGE_H
+#define _UCLIBC_PAGE_H
+
+/* PAGE_SIZE of mips is sortof wierd, and depends on how the kernel
+ * happens to have been configured. It might use 4KB, 16K or 64K
+ * pages. To avoid using the current kernel configuration settings,
+ * uClibc will simply use 4KB on mips and call it good. */
+#if 0
+#define PAGE_SHIFT 16
+#define PAGE_SHIFT 14
+#endif
+#define PAGE_SHIFT 12
+#define PAGE_SIZE (1UL << PAGE_SHIFT)
+#define PAGE_MASK (~(PAGE_SIZE-1))
+
+#endif /* _UCLIBC_PAGE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_pthread.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_pthread.h
new file mode 100644
index 0000000..1d6209f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_pthread.h
@@ -0,0 +1,50 @@
+/* Copyright (C) 2003 Manuel Novoa III
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * The GNU C Library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the GNU C Library; if not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307 USA.
+ */
+
+/* Supply prototypes for the internal thread functions used by the
+ * uClibc library code.
+ */
+
+#ifndef _UCLIBC_PTHREAD_H
+#define _UCLIBC_PTHREAD_H
+
+#ifndef _PTHREAD_H
+# error "Always include <pthread.h> rather than <bits/uClibc_pthread.h>"
+#endif
+
+#if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc)
+/* Threading functions internal to uClibc. Make these thread functions
+ * weak so that we can elide them from single-threaded processes. */
+extern int weak_function __pthread_mutex_init (pthread_mutex_t *__mutex,
+ __const pthread_mutexattr_t *__mutex_attr);
+extern int weak_function __pthread_mutex_destroy (pthread_mutex_t *__mutex);
+extern int weak_function __pthread_mutex_lock (pthread_mutex_t *__mutex);
+extern int weak_function __pthread_mutex_unlock (pthread_mutex_t *__mutex);
+extern void __uclibc_mutex_unlock (void *) attribute_hidden;
+extern int weak_function __pthread_mutex_trylock (pthread_mutex_t *__mutex);
+# ifndef __UCLIBC_HAS_THREADS_NATIVE__
+extern void weak_function _pthread_cleanup_push_defer (
+ struct _pthread_cleanup_buffer *__buffer,
+ void (*__routine) (void *), void *__arg);
+extern void weak_function _pthread_cleanup_pop_restore (
+ struct _pthread_cleanup_buffer *__buffer,
+ int __execute);
+# endif
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_stdio.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_stdio.h
new file mode 100644
index 0000000..843a2f2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_stdio.h
@@ -0,0 +1,517 @@
+/* Copyright (C) 2002-2004 Manuel Novoa III <mjn3@codepoet.org>
+ *
+ * GNU Library General Public License (LGPL) version 2 or later.
+ *
+ * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
+ */
+
+#ifndef _STDIO_H
+#error Always include <stdio.h> rather than <bits/uClibc_stdio.h>
+#endif
+
+/**********************************************************************/
+
+#define __STDIO_BUFFERS
+/* ANSI/ISO mandate at least 256. */
+#if defined(__UCLIBC_HAS_STDIO_BUFSIZ_NONE__)
+/* Fake this because some apps use stdio.h BUFSIZ. */
+#define __STDIO_BUFSIZ 256
+#undef __STDIO_BUFFERS
+#elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_256__)
+#define __STDIO_BUFSIZ 256
+#elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_512__)
+#define __STDIO_BUFSIZ 512
+#elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_1024__)
+#define __STDIO_BUFSIZ 1024
+#elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_2048__)
+#define __STDIO_BUFSIZ 2048
+#elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_4096__)
+#define __STDIO_BUFSIZ 4096
+#elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_8192__)
+#define __STDIO_BUFSIZ 8192
+#else
+#error config seems to be out of sync regarding bufsiz options
+#endif
+
+#ifdef __UCLIBC_HAS_STDIO_BUFSIZ_NONE__
+#define __STDIO_BUILTIN_BUF_SIZE 0
+#else /* __UCLIBC_HAS_STDIO_BUFSIZ_NONE__ */
+#if defined(__UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE__)
+#define __STDIO_BUILTIN_BUF_SIZE 0
+#elif defined(__UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4__)
+#define __STDIO_BUILTIN_BUF_SIZE 4
+#elif defined(__UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8__)
+#define __STDIO_BUILTIN_BUF_SIZE 8
+#else
+#error config seems to be out of sync regarding builtin buffer size
+#endif
+#endif
+
+#if defined(__STDIO_BUFFERS) || defined(__UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__) || defined(__UCLIBC_HAS_THREADS__)
+#define __STDIO_HAS_OPENLIST 1
+#else
+#undef __STDIO_HAS_OPENLIST
+#endif
+
+/**********************************************************************/
+/* Make sure defines related to large files are consistent. */
+#ifdef _LIBC
+
+#ifdef __UCLIBC_HAS_LFS__
+#undef __USE_LARGEFILE
+#undef __USE_LARGEFILE64
+#undef __USE_FILE_OFFSET64
+/* If we're actually building uClibc with large file support, only define... */
+#define __USE_LARGEFILE64 1
+#endif /* __UCLIBC_HAS_LFS__ */
+
+#else /* not _LIBC */
+
+#ifndef __UCLIBC_HAS_LFS__
+#if defined(__LARGEFILE64_SOURCE) || defined(__USE_LARGEFILE64) || defined(__USE_FILE_OFFSET64)
+#error Sorry... uClibc was built without large file support!
+#endif
+#endif /* __UCLIBC_HAS_LFS__ */
+
+#endif /* _LIBC */
+/**********************************************************************/
+#ifdef __UCLIBC_HAS_WCHAR__
+
+#define __need_wchar_t
+#include <stddef.h>
+
+/* Note: we don't really need mbstate for 8-bit locales. We do for UTF-8.
+ * For now, always use it. */
+#define __STDIO_MBSTATE
+#define __need_mbstate_t
+#include <wchar.h>
+
+#endif
+/**********************************************************************/
+/* Currently unimplemented/untested */
+/* #define __STDIO_FLEXIBLE_SETVBUF */
+
+#ifdef __UCLIBC_HAS_STDIO_GETC_MACRO__
+#define __STDIO_GETC_MACRO
+#endif
+
+#ifdef __UCLIBC_HAS_STDIO_PUTC_MACRO__
+#define __STDIO_PUTC_MACRO
+#endif
+
+
+/* These are consistency checks on the different options */
+
+#ifndef __STDIO_BUFFERS
+#undef __STDIO_GETC_MACRO
+#undef __STDIO_PUTC_MACRO
+#endif
+
+#ifdef __BCC__
+#undef __UCLIBC_HAS_LFS__
+#endif
+
+#ifndef __UCLIBC_HAS_LFS__
+#undef __UCLIBC_HAS_FOPEN_LARGEFILE_MODE__
+#endif
+
+/**********************************************************************/
+#include <bits/uClibc_mutex.h>
+
+/* user_locking
+ * 0 : do auto locking/unlocking
+ * 1 : user does locking/unlocking
+ * 2 : initial state prior to thread initialization
+ * with no auto locking/unlocking
+ *
+ * When threading is initialized, walk the stdio open stream list
+ * and do "if (user_locking == 2) user_locking = 0;".
+ *
+ * This way, we avoid calling the weak lock/unlock functions.
+ */
+
+#define __STDIO_AUTO_THREADLOCK_VAR \
+ __UCLIBC_MUTEX_AUTO_LOCK_VAR(__infunc_user_locking)
+
+#define __STDIO_AUTO_THREADLOCK(__stream) \
+ __UCLIBC_MUTEX_AUTO_LOCK((__stream)->__lock, __infunc_user_locking, \
+ (__stream)->__user_locking)
+
+#define __STDIO_AUTO_THREADUNLOCK(__stream) \
+ __UCLIBC_MUTEX_AUTO_UNLOCK((__stream)->__lock, __infunc_user_locking)
+
+#define __STDIO_ALWAYS_THREADLOCK(__stream) \
+ __UCLIBC_MUTEX_LOCK((__stream)->__lock)
+
+#define __STDIO_ALWAYS_THREADUNLOCK(__stream) \
+ __UCLIBC_MUTEX_UNLOCK((__stream)->__lock)
+
+#define __STDIO_ALWAYS_THREADLOCK_CANCEL_UNSAFE(__stream) \
+ __UCLIBC_MUTEX_LOCK_CANCEL_UNSAFE((__stream)->__lock)
+
+#define __STDIO_ALWAYS_THREADTRYLOCK_CANCEL_UNSAFE(__stream) \
+ __UCLIBC_MUTEX_TRYLOCK_CANCEL_UNSAFE((__stream)->__lock)
+
+#define __STDIO_ALWAYS_THREADUNLOCK_CANCEL_UNSAFE(__stream) \
+ __UCLIBC_MUTEX_UNLOCK_CANCEL_UNSAFE((__stream)->__lock)
+
+#ifdef __UCLIBC_HAS_THREADS__
+#define __STDIO_SET_USER_LOCKING(__stream) ((__stream)->__user_locking = 1)
+#else
+#define __STDIO_SET_USER_LOCKING(__stream) ((void)0)
+#endif
+
+/**********************************************************************/
+
+#define __STDIO_IOFBF 0 /* Fully buffered. */
+#define __STDIO_IOLBF 1 /* Line buffered. */
+#define __STDIO_IONBF 2 /* No buffering. */
+
+typedef struct {
+ __off_t __pos;
+#ifdef __STDIO_MBSTATE
+ __mbstate_t __mbstate;
+#endif
+#ifdef __UCLIBC_HAS_WCHAR__
+ int __mblen_pending;
+#endif
+} __STDIO_fpos_t;
+
+#ifdef __UCLIBC_HAS_LFS__
+typedef struct {
+ __off64_t __pos;
+#ifdef __STDIO_MBSTATE
+ __mbstate_t __mbstate;
+#endif
+#ifdef __UCLIBC_HAS_WCHAR__
+ int __mblen_pending;
+#endif
+} __STDIO_fpos64_t;
+#endif
+
+/**********************************************************************/
+#ifdef __UCLIBC_HAS_LFS__
+typedef __off64_t __offmax_t; /* TODO -- rename this? */
+#else
+typedef __off_t __offmax_t; /* TODO -- rename this? */
+#endif
+
+/**********************************************************************/
+#ifdef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__
+
+typedef __ssize_t __io_read_fn(void *__cookie, char *__buf, size_t __bufsize);
+typedef __ssize_t __io_write_fn(void *__cookie,
+ __const char *__buf, size_t __bufsize);
+/* NOTE: GLIBC difference!!! -- fopencookie seek function
+ * For glibc, the type of pos is always (__off64_t *) but in our case
+ * it is type (__off_t *) when the lib is built without large file support.
+ */
+typedef int __io_seek_fn(void *__cookie, __offmax_t *__pos, int __whence);
+typedef int __io_close_fn(void *__cookie);
+
+typedef struct {
+ __io_read_fn *read;
+ __io_write_fn *write;
+ __io_seek_fn *seek;
+ __io_close_fn *close;
+} _IO_cookie_io_functions_t;
+
+#if defined(_LIBC) || defined(_GNU_SOURCE)
+
+typedef __io_read_fn cookie_read_function_t;
+typedef __io_write_fn cookie_write_function_t;
+typedef __io_seek_fn cookie_seek_function_t;
+typedef __io_close_fn cookie_close_function_t;
+
+typedef _IO_cookie_io_functions_t cookie_io_functions_t;
+
+#endif
+
+#endif
+/**********************************************************************/
+
+struct __STDIO_FILE_STRUCT {
+ unsigned short __modeflags;
+ /* There could be a hole here, but modeflags is used most.*/
+#ifdef __UCLIBC_HAS_WCHAR__
+ unsigned char __ungot_width[2]; /* 0: current (building) char; 1: scanf */
+ /* Move the following futher down to avoid problems with getc/putc
+ * macros breaking shared apps when wchar config support is changed. */
+ /* wchar_t ungot[2]; */
+#else /* __UCLIBC_HAS_WCHAR__ */
+ unsigned char __ungot[2];
+#endif /* __UCLIBC_HAS_WCHAR__ */
+ int __filedes;
+#ifdef __STDIO_BUFFERS
+ unsigned char *__bufstart; /* pointer to buffer */
+ unsigned char *__bufend; /* pointer to 1 past end of buffer */
+ unsigned char *__bufpos;
+ unsigned char *__bufread; /* pointer to 1 past last buffered read char */
+
+#ifdef __STDIO_GETC_MACRO
+ unsigned char *__bufgetc_u; /* 1 past last readable by getc_unlocked */
+#endif /* __STDIO_GETC_MACRO */
+#ifdef __STDIO_PUTC_MACRO
+ unsigned char *__bufputc_u; /* 1 past last writeable by putc_unlocked */
+#endif /* __STDIO_PUTC_MACRO */
+
+#endif /* __STDIO_BUFFERS */
+
+#ifdef __STDIO_HAS_OPENLIST
+ struct __STDIO_FILE_STRUCT *__nextopen;
+#endif
+#ifdef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__
+ void *__cookie;
+ _IO_cookie_io_functions_t __gcs;
+#endif
+#ifdef __UCLIBC_HAS_WCHAR__
+ wchar_t __ungot[2];
+#endif
+#ifdef __STDIO_MBSTATE
+ __mbstate_t __state;
+#endif
+#ifdef __UCLIBC_HAS_XLOCALE__
+ void *__unused; /* Placeholder for codeset binding. */
+#endif
+#ifdef __UCLIBC_HAS_THREADS__
+ int __user_locking;
+ __UCLIBC_MUTEX(__lock);
+#endif
+/* Everything after this is unimplemented... and may be trashed. */
+#if __STDIO_BUILTIN_BUF_SIZE > 0
+ unsigned char __builtinbuf[__STDIO_BUILTIN_BUF_SIZE];
+#endif /* __STDIO_BUILTIN_BUF_SIZE > 0 */
+};
+
+
+/***********************************************************************/
+/* Having ungotten characters implies the stream is reading.
+ * The scheme used here treats the least significant 2 bits of
+ * the stream's modeflags member as follows:
+ * 0 0 Not currently reading.
+ * 0 1 Reading, but no ungetc() or scanf() push back chars.
+ * 1 0 Reading with one ungetc() char (ungot[1] is 1)
+ * or one scanf() pushed back char (ungot[1] is 0).
+ * 1 1 Reading with both an ungetc() char and a scanf()
+ * pushed back char. Note that this must be the result
+ * of a scanf() push back (in ungot[0]) _followed_ by
+ * an ungetc() call (in ungot[1]).
+ *
+ * Notes:
+ * scanf() can NOT use ungetc() to push back characters.
+ * (See section 7.19.6.2 of the C9X rationale -- WG14/N897.)
+ */
+
+#define __MASK_READING 0x0003U /* (0x0001 | 0x0002) */
+#define __FLAG_READING 0x0001U
+#define __FLAG_UNGOT 0x0002U
+#define __FLAG_EOF 0x0004U
+#define __FLAG_ERROR 0x0008U
+#define __FLAG_WRITEONLY 0x0010U
+#define __FLAG_READONLY 0x0020U /* (__FLAG_WRITEONLY << 1) */
+#define __FLAG_WRITING 0x0040U
+#define __FLAG_NARROW 0x0080U
+
+#define __FLAG_FBF 0x0000U /* must be 0 */
+#define __FLAG_LBF 0x0100U
+#define __FLAG_NBF 0x0200U /* (__FLAG_LBF << 1) */
+#define __MASK_BUFMODE 0x0300U /* (__FLAG_LBF|__FLAG_NBF) */
+#define __FLAG_APPEND 0x0400U /* fixed! == O_APPEND for linux */
+#define __FLAG_WIDE 0x0800U
+/* available slot 0x1000U */
+#define __FLAG_FREEFILE 0x2000U
+#define __FLAG_FREEBUF 0x4000U
+#define __FLAG_LARGEFILE 0x8000U /* fixed! == 0_LARGEFILE for linux */
+#define __FLAG_FAILED_FREOPEN __FLAG_LARGEFILE
+
+/* Note: In no-buffer mode, it would be possible to pack the necessary
+ * flags into one byte. Since we wouldn't be buffering and there would
+ * be no support for wchar, the only flags we would need would be:
+ * 2 bits : ungot count
+ * 2 bits : eof + error
+ * 2 bits : readonly + writeonly
+ * 1 bit : freefile
+ * 1 bit : appending
+ * So, for a very small system (< 128 files) we might have a
+ * 4-byte FILE struct of:
+ * unsigned char flags;
+ * signed char filedes;
+ * unsigned char ungot[2];
+ */
+/**********************************************************************
+ * PROTOTYPES OF INTERNAL FUNCTIONS
+ **********************************************************************/
+#if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc)
+
+extern void _stdio_init(void) attribute_hidden;
+extern void _stdio_term(void) attribute_hidden;
+
+#ifdef __STDIO_HAS_OPENLIST
+
+extern struct __STDIO_FILE_STRUCT *_stdio_openlist;
+
+#ifdef __UCLIBC_HAS_THREADS__
+__UCLIBC_MUTEX_EXTERN(_stdio_openlist_add_lock);
+#ifdef __STDIO_BUFFERS
+__UCLIBC_MUTEX_EXTERN(_stdio_openlist_del_lock);
+extern volatile int _stdio_openlist_use_count; /* _stdio_openlist_del_lock */
+extern int _stdio_openlist_del_count; /* _stdio_openlist_del_lock */
+#endif
+extern int _stdio_user_locking;
+extern void __stdio_init_mutex(__UCLIBC_MUTEX_TYPE *m) attribute_hidden;
+#endif
+
+#endif
+
+#endif
+/**********************************************************************/
+
+#define __CLEARERR_UNLOCKED(__stream) \
+ ((void)((__stream)->__modeflags &= ~(__FLAG_EOF|__FLAG_ERROR)))
+#define __FEOF_UNLOCKED(__stream) ((__stream)->__modeflags & __FLAG_EOF)
+#define __FERROR_UNLOCKED(__stream) ((__stream)->__modeflags & __FLAG_ERROR)
+
+#ifdef __UCLIBC_HAS_THREADS__
+# define __CLEARERR(__stream) (clearerr)(__stream)
+# define __FERROR(__stream) (ferror)(__stream)
+# define __FEOF(__stream) (feof)(__stream)
+#else
+# define __CLEARERR(__stream) __CLEARERR_UNLOCKED(__stream)
+# define __FERROR(__stream) __FERROR_UNLOCKED(__stream)
+# define __FEOF(__stream) __FEOF_UNLOCKED(__stream)
+#endif
+
+extern int __fgetc_unlocked(FILE *__stream);
+extern int __fputc_unlocked(int __c, FILE *__stream);
+
+/* First define the default definitions.
+ They are overridden below as necessary. */
+#define __FGETC_UNLOCKED(__stream) (__fgetc_unlocked)((__stream))
+#define __FGETC(__stream) (fgetc)((__stream))
+#define __GETC_UNLOCKED_MACRO(__stream) (__fgetc_unlocked)((__stream))
+#define __GETC_UNLOCKED(__stream) (__fgetc_unlocked)((__stream))
+#define __GETC(__stream) (fgetc)((__stream))
+
+#define __FPUTC_UNLOCKED(__c, __stream) (__fputc_unlocked)((__c),(__stream))
+#define __FPUTC(__c, __stream) (fputc)((__c),(__stream))
+#define __PUTC_UNLOCKED_MACRO(__c, __stream) (__fputc_unlocked)((__c),(__stream))
+#define __PUTC_UNLOCKED(__c, __stream) (__fputc_unlocked)((__c),(__stream))
+#define __PUTC(__c, __stream) (fputc)((__c),(__stream))
+
+
+#ifdef __STDIO_GETC_MACRO
+
+extern FILE *__stdin; /* For getchar() macro. */
+
+# undef __GETC_UNLOCKED_MACRO
+# define __GETC_UNLOCKED_MACRO(__stream) \
+ ( ((__stream)->__bufpos < (__stream)->__bufgetc_u) \
+ ? (*(__stream)->__bufpos++) \
+ : __fgetc_unlocked(__stream) )
+
+# if 0
+ /* Classic macro approach. getc{_unlocked} can have side effects. */
+# undef __GETC_UNLOCKED
+# define __GETC_UNLOCKED(__stream) __GETC_UNLOCKED_MACRO((__stream))
+# ifndef __UCLIBC_HAS_THREADS__
+# undef __GETC
+# define __GETC(__stream) __GETC_UNLOCKED_MACRO((__stream))
+# endif
+
+# else
+ /* Using gcc extension for safety and additional inlining. */
+# undef __FGETC_UNLOCKED
+# define __FGETC_UNLOCKED(__stream) \
+ (__extension__ ({ \
+ FILE *__S = (__stream); \
+ __GETC_UNLOCKED_MACRO(__S); \
+ }) )
+
+# undef __GETC_UNLOCKED
+# define __GETC_UNLOCKED(__stream) __FGETC_UNLOCKED((__stream))
+
+# ifdef __UCLIBC_HAS_THREADS__
+# undef __FGETC
+# define __FGETC(__stream) \
+ (__extension__ ({ \
+ FILE *__S = (__stream); \
+ ((__S->__user_locking ) \
+ ? __GETC_UNLOCKED_MACRO(__S) \
+ : (fgetc)(__S)); \
+ }) )
+
+# undef __GETC
+# define __GETC(__stream) __FGETC((__stream))
+
+# else
+
+# undef __FGETC
+# define __FGETC(__stream) __FGETC_UNLOCKED((__stream))
+# undef __GETC
+# define __GETC(__stream) __FGETC_UNLOCKED((__stream))
+
+# endif
+# endif
+
+#else
+
+#endif /* __STDIO_GETC_MACRO */
+
+
+#ifdef __STDIO_PUTC_MACRO
+
+extern FILE *__stdout; /* For putchar() macro. */
+
+# undef __PUTC_UNLOCKED_MACRO
+# define __PUTC_UNLOCKED_MACRO(__c, __stream) \
+ ( ((__stream)->__bufpos < (__stream)->__bufputc_u) \
+ ? (*(__stream)->__bufpos++) = (__c) \
+ : __fputc_unlocked((__c),(__stream)) )
+
+# if 0
+ /* Classic macro approach. putc{_unlocked} can have side effects.*/
+# undef __PUTC_UNLOCKED
+# define __PUTC_UNLOCKED(__c, __stream) \
+ __PUTC_UNLOCKED_MACRO((__c), (__stream))
+# ifndef __UCLIBC_HAS_THREADS__
+# undef __PUTC
+# define __PUTC(__c, __stream) __PUTC_UNLOCKED_MACRO((__c), (__stream))
+# endif
+
+# else
+ /* Using gcc extension for safety and additional inlining. */
+
+# undef __FPUTC_UNLOCKED
+# define __FPUTC_UNLOCKED(__c, __stream) \
+ (__extension__ ({ \
+ FILE *__S = (__stream); \
+ __PUTC_UNLOCKED_MACRO((__c),__S); \
+ }) )
+
+# undef __PUTC_UNLOCKED
+# define __PUTC_UNLOCKED(__c, __stream) __FPUTC_UNLOCKED((__c), (__stream))
+
+# ifdef __UCLIBC_HAS_THREADS__
+# undef __FPUTC
+# define __FPUTC(__c, __stream) \
+ (__extension__ ({ \
+ FILE *__S = (__stream); \
+ ((__S->__user_locking) \
+ ? __PUTC_UNLOCKED_MACRO((__c),__S) \
+ : (fputc)((__c),__S)); \
+ }) )
+
+# undef __PUTC
+# define __PUTC(__c, __stream) __FPUTC((__c), (__stream))
+
+# else
+
+# undef __FPUTC
+# define __FPUTC(__c, __stream) __FPUTC_UNLOCKED((__c),(__stream))
+# undef __PUTC
+# define __PUTC(__c, __stream) __FPUTC_UNLOCKED((__c),(__stream))
+
+# endif
+# endif
+
+#endif /* __STDIO_PUTC_MACRO */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_touplow.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_touplow.h
new file mode 100644
index 0000000..28d4e2f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_touplow.h
@@ -0,0 +1,55 @@
+/* Copyright (C) 2003 Manuel Novoa III
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * The GNU C Library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the GNU C Library; if not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307 USA.
+ */
+
+/* ATTENTION! ATTENTION! ATTENTION! ATTENTION! ATTENTION!
+ *
+ * Besides uClibc, I'm using this code in my libc for elks, which is
+ * a 16-bit environment with a fairly limited compiler. It would make
+ * things much easier for me if this file isn't modified unnecessarily.
+ * In particular, please put any new or replacement functions somewhere
+ * else, and modify the makefile to use your version instead.
+ * Thanks. Manuel
+ *
+ * ATTENTION! ATTENTION! ATTENTION! ATTENTION! ATTENTION! */
+
+#ifndef _UCLIBC_TOUPLOW_H
+#define _UCLIBC_TOUPLOW_H
+
+#include <features.h>
+#include <bits/types.h>
+
+/* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */
+
+typedef __uint16_t __ctype_mask_t;
+
+#ifdef __UCLIBC_HAS_CTYPE_SIGNED__
+
+typedef __int16_t __ctype_touplow_t;
+#define __UCLIBC_CTYPE_B_TBL_OFFSET 128
+#define __UCLIBC_CTYPE_TO_TBL_OFFSET 128
+
+#else /* __UCLIBC_HAS_CTYPE_SIGNED__ */
+
+typedef unsigned char __ctype_touplow_t;
+#define __UCLIBC_CTYPE_B_TBL_OFFSET 1
+#define __UCLIBC_CTYPE_TO_TBL_OFFSET 0
+
+#endif /* __UCLIBC_HAS_CTYPE_SIGNED__ */
+
+#endif /* _UCLIBC_TOUPLOW_H */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_uwchar.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_uwchar.h
new file mode 100644
index 0000000..ba2c42d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_uwchar.h
@@ -0,0 +1,57 @@
+/* Copyright (C) 2003 Manuel Novoa III
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * The GNU C Library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the GNU C Library; if not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307 USA.
+ */
+
+/* ATTENTION! ATTENTION! ATTENTION! ATTENTION! ATTENTION!
+ *
+ * Besides uClibc, I'm using this code in my libc for elks, which is
+ * a 16-bit environment with a fairly limited compiler. It would make
+ * things much easier for me if this file isn't modified unnecessarily.
+ * In particular, please put any new or replacement functions somewhere
+ * else, and modify the makefile to use your version instead.
+ * Thanks. Manuel
+ *
+ * ATTENTION! ATTENTION! ATTENTION! ATTENTION! ATTENTION! */
+
+
+/* Define an internal unsigned int type __uwchar_t just large enough
+ * to hold a wchar_t.
+ */
+
+#ifndef _UCLIBC_UWCHAR_H
+#define _UCLIBC_UWCHAR_H
+
+#include <limits.h>
+#include <stdint.h>
+
+#if WCHAR_MIN == 0
+typedef wchar_t __uwchar_t;
+#elif WCHAR_MAX <= USHRT_MAX
+typedef unsigned short __uwchar_t;
+#elif WCHAR_MAX <= UINT_MAX
+typedef unsigned int __uwchar_t;
+#elif WCHAR_MAX <= ULONG_MAX
+typedef unsigned long __uwchar_t;
+#elif defined(ULLONG_MAX) && (WCHAR_MAX <= ULLONG_MAX)
+typedef unsigned long long __uwchar_t;
+#elif WCHAR_MAX <= UINTMAX_MAX
+typedef uintmax_t __uwchar_t;
+#else
+#error Can not determine an appropriate type for __uwchar_t!
+#endif
+
+#endif /* _UCLIBC_UWCHAR_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_va_copy.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_va_copy.h
new file mode 100644
index 0000000..98663fc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uClibc_va_copy.h
@@ -0,0 +1,40 @@
+/* Copyright (C) 2005 Manuel Novoa III <mjn3@codepoet.org>
+ *
+ * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * The GNU C Library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the GNU C Library; if not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307 USA.
+ */
+
+#ifndef _UCLIBC_VA_COPY_H
+#define _UCLIBC_VA_COPY_H 1
+
+#include <stdarg.h>
+
+/* Deal with pre-C99 compilers. */
+#ifndef va_copy
+
+#ifdef __va_copy
+#define va_copy(A,B) __va_copy(A,B)
+#else
+#warning Neither va_copy (C99/SUSv3) or __va_copy is defined. Using a simple copy instead. But you should really check that this is appropriate and supply an arch-specific override if necessary.
+ /* the glibc manual suggests that this will usually suffice when
+ __va_copy doesn't exist. */
+#define va_copy(A,B) A = B
+#endif
+
+#endif /* va_copy */
+
+#endif /* _UCLIBC_VA_COPY_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uio.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uio.h
new file mode 100644
index 0000000..6a283ed
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/uio.h
@@ -0,0 +1,50 @@
+/* Copyright (C) 1996, 1997, 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if !defined _SYS_UIO_H && !defined _FCNTL_H
+# error "Never include <bits/uio.h> directly; use <sys/uio.h> instead."
+#endif
+
+#ifndef _BITS_UIO_H
+#define _BITS_UIO_H 1
+
+#include <sys/types.h>
+
+
+/* We should normally use the Linux kernel header file to define this
+ type and macros but this calls for trouble because of the header
+ includes other kernel headers. */
+
+/* Size of object which can be written atomically.
+
+ This macro has different values in different kernel versions. The
+ latest versions of the kernel use 1024 and this is good choice. Since
+ the C library implementation of readv/writev is able to emulate the
+ functionality even if the currently running kernel does not support
+ this large value the readv/writev call will not fail because of this. */
+#define UIO_MAXIOV 1024
+
+
+/* Structure for scatter/gather I/O. */
+struct iovec
+ {
+ void *iov_base; /* Pointer to data. */
+ size_t iov_len; /* Length of data. */
+ };
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/ustat.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/ustat.h
new file mode 100644
index 0000000..69c6b72
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/ustat.h
@@ -0,0 +1,31 @@
+/* Copyright (C) 1997, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_USTAT_H
+# error "Never include <bits/ustat.h> directly; use <sys/ustat.h> instead."
+#endif
+
+#include <sys/types.h>
+
+struct ustat
+ {
+ __daddr_t f_tfree; /* Number of free blocks. */
+ __ino_t f_tinode; /* Number of free inodes. */
+ char f_fname[6];
+ char f_fpack[6];
+ };
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/utmp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/utmp.h
new file mode 100644
index 0000000..e855ad7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/utmp.h
@@ -0,0 +1,125 @@
+/* The `struct utmp' type, describing entries in the utmp file. GNU version.
+ Copyright (C) 1993, 1996, 1997, 1998, 1999, 2002
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _UTMP_H
+# error "Never include <bits/utmp.h> directly; use <utmp.h> instead."
+#endif
+
+#include <paths.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <bits/wordsize.h>
+
+
+#define UT_LINESIZE 32
+#define UT_NAMESIZE 32
+#define UT_HOSTSIZE 256
+
+
+/* The structure describing an entry in the database of
+ previous logins. */
+struct lastlog
+ {
+#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+ int32_t ll_time;
+#else
+ __time_t ll_time;
+#endif
+ char ll_line[UT_LINESIZE];
+ char ll_host[UT_HOSTSIZE];
+ };
+
+
+/* The structure describing the status of a terminated process. This
+ type is used in `struct utmp' below. */
+struct exit_status
+ {
+ short int e_termination; /* Process termination status. */
+ short int e_exit; /* Process exit status. */
+ };
+
+
+/* The structure describing an entry in the user accounting database. */
+struct utmp
+{
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+ char ut_line[UT_LINESIZE]; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+ char ut_user[UT_NAMESIZE]; /* Username. */
+ char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+/* The ut_session and ut_tv fields must be the same size when compiled
+ 32- and 64-bit. This allows data files and shared memory to be
+ shared between 32- and 64-bit applications. */
+#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+ int32_t ut_session; /* Session ID, used for windowing. */
+ struct
+ {
+ int32_t tv_sec; /* Seconds. */
+ int32_t tv_usec; /* Microseconds. */
+ } ut_tv; /* Time entry was made. */
+#else
+ long int ut_session; /* Session ID, used for windowing. */
+ struct timeval ut_tv; /* Time entry was made. */
+#endif
+
+ int32_t ut_addr_v6[4]; /* Internet address of remote host. */
+ char __unused[20]; /* Reserved for future use. */
+};
+
+/* Backwards compatibility hacks. */
+#define ut_name ut_user
+#ifndef _NO_UT_TIME
+/* We have a problem here: `ut_time' is also used otherwise. Define
+ _NO_UT_TIME if the compiler complains. */
+# define ut_time ut_tv.tv_sec
+#endif
+#define ut_xtime ut_tv.tv_sec
+#define ut_addr ut_addr_v6[0]
+
+
+/* Values for the `ut_type' field of a `struct utmp'. */
+#define EMPTY 0 /* No valid user accounting information. */
+
+#define RUN_LVL 1 /* The system's runlevel. */
+#define BOOT_TIME 2 /* Time of system boot. */
+#define NEW_TIME 3 /* Time after system clock changed. */
+#define OLD_TIME 4 /* Time when system clock changed. */
+
+#define INIT_PROCESS 5 /* Process spawned by the init process. */
+#define LOGIN_PROCESS 6 /* Session leader of a logged in user. */
+#define USER_PROCESS 7 /* Normal process. */
+#define DEAD_PROCESS 8 /* Terminated process. */
+
+#define ACCOUNTING 9
+
+/* Old Linux name for the EMPTY type. */
+#define UT_UNKNOWN EMPTY
+
+
+/* Tell the user that we have a modern system with UT_HOST, UT_PID,
+ UT_TYPE, UT_ID and UT_TV fields. */
+#define _HAVE_UT_TYPE 1
+#define _HAVE_UT_PID 1
+#define _HAVE_UT_ID 1
+#define _HAVE_UT_TV 1
+#define _HAVE_UT_HOST 1
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/utmpx.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/utmpx.h
new file mode 100644
index 0000000..c84cda6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/utmpx.h
@@ -0,0 +1,103 @@
+/* Structures and definitions for the user accounting database. GNU version.
+ Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _UTMPX_H
+# error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead."
+#endif
+
+#include <bits/types.h>
+#include <sys/time.h>
+#include <bits/wordsize.h>
+
+
+#ifdef __USE_GNU
+# include <paths.h>
+# define _PATH_UTMPX _PATH_UTMP
+# define _PATH_WTMPX _PATH_WTMP
+#endif
+
+
+#define __UT_LINESIZE 32
+#define __UT_NAMESIZE 32
+#define __UT_HOSTSIZE 256
+
+
+/* The structure describing the status of a terminated process. This
+ type is used in `struct utmpx' below. */
+struct __exit_status
+ {
+#ifdef __USE_GNU
+ short int e_termination; /* Process termination status. */
+ short int e_exit; /* Process exit status. */
+#else
+ short int __e_termination; /* Process termination status. */
+ short int __e_exit; /* Process exit status. */
+#endif
+ };
+
+
+/* The structure describing an entry in the user accounting database. */
+struct utmpx
+{
+ short int ut_type; /* Type of login. */
+ __pid_t ut_pid; /* Process ID of login process. */
+ char ut_line[__UT_LINESIZE]; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+ char ut_user[__UT_NAMESIZE]; /* Username. */
+ char ut_host[__UT_HOSTSIZE]; /* Hostname for remote login. */
+ struct __exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+
+/* The fields ut_session and ut_tv must be the same size when compiled
+ 32- and 64-bit. This allows files and shared memory to be shared
+ between 32- and 64-bit applications. */
+#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+ __int32_t ut_session; /* Session ID, used for windowing. */
+ struct
+ {
+ __int32_t tv_sec; /* Seconds. */
+ __int32_t tv_usec; /* Microseconds. */
+ } ut_tv; /* Time entry was made. */
+#else
+ long int ut_session; /* Session ID, used for windowing. */
+ struct timeval ut_tv; /* Time entry was made. */
+#endif
+ __int32_t ut_addr_v6[4]; /* Internet address of remote host. */
+ char __unused[20]; /* Reserved for future use. */
+};
+
+
+/* Values for the `ut_type' field of a `struct utmpx'. */
+#define EMPTY 0 /* No valid user accounting information. */
+
+#ifdef __USE_GNU
+# define RUN_LVL 1 /* The system's runlevel. */
+#endif
+#define BOOT_TIME 2 /* Time of system boot. */
+#define NEW_TIME 3 /* Time after system clock changed. */
+#define OLD_TIME 4 /* Time when system clock changed. */
+
+#define INIT_PROCESS 5 /* Process spawned by the init process. */
+#define LOGIN_PROCESS 6 /* Session leader of a logged in user. */
+#define USER_PROCESS 7 /* Normal process. */
+#define DEAD_PROCESS 8 /* Terminated process. */
+
+#ifdef __USE_GNU
+# define ACCOUNTING 9 /* System accounting. */
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/utsname.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/utsname.h
new file mode 100644
index 0000000..35e71e3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/utsname.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_UTSNAME_H
+# error "Never include <bits/utsname.h> directly; use <sys/utsname.h> instead."
+#endif
+
+/* Length of the entries in `struct utsname' is 65. */
+#define _UTSNAME_LENGTH 65
+
+/* Linux provides as additional information in the `struct utsname'
+ the name of the current domain. Define _UTSNAME_DOMAIN_LENGTH
+ to a value != 0 to activate this entry. */
+#define _UTSNAME_DOMAIN_LENGTH _UTSNAME_LENGTH
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/waitflags.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/waitflags.h
new file mode 100644
index 0000000..464cedb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/waitflags.h
@@ -0,0 +1,38 @@
+/* Definitions of flag bits for `waitpid' et al.
+ Copyright (C) 1992,1996,1997,2000,2004,2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if !defined _SYS_WAIT_H && !defined _STDLIB_H
+# error "Never include <bits/waitflags.h> directly; use <sys/wait.h> instead."
+#endif
+
+
+/* Bits in the third argument to `waitpid'. */
+#define WNOHANG 1 /* Don't block waiting. */
+#define WUNTRACED 2 /* Report status of stopped children. */
+
+/* Bits in the fourth argument to `waitid'. */
+#define WSTOPPED 2 /* Report stopped child (same as WUNTRACED). */
+#define WEXITED 4 /* Report dead child. */
+#define WCONTINUED 8 /* Report continued child. */
+#define WNOWAIT 0x01000000 /* Don't reap, just poll status. */
+
+#define __WNOTHREAD 0x20000000 /* Don't wait on children of other threads
+ in this group */
+#define __WALL 0x40000000 /* Wait for any child. */
+#define __WCLONE 0x80000000 /* Wait for cloned process. */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/waitstatus.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/waitstatus.h
new file mode 100644
index 0000000..699c224
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/waitstatus.h
@@ -0,0 +1,106 @@
+/* Definitions of status bits for `wait' et al.
+ Copyright (C) 1992,1994,1996,1997,2000,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if !defined _SYS_WAIT_H && !defined _STDLIB_H
+# error "Never include <bits/waitstatus.h> directly; use <sys/wait.h> instead."
+#endif
+
+
+/* Everything extant so far uses these same bits. */
+
+
+/* If WIFEXITED(STATUS), the low-order 8 bits of the status. */
+#define __WEXITSTATUS(status) (((status) & 0xff00) >> 8)
+
+/* If WIFSIGNALED(STATUS), the terminating signal. */
+#define __WTERMSIG(status) ((status) & 0x7f)
+
+/* If WIFSTOPPED(STATUS), the signal that stopped the child. */
+#define __WSTOPSIG(status) __WEXITSTATUS(status)
+
+/* Nonzero if STATUS indicates normal termination. */
+#define __WIFEXITED(status) (__WTERMSIG(status) == 0)
+
+/* Nonzero if STATUS indicates termination by a signal. */
+#define __WIFSIGNALED(status) \
+ (((signed char) (((status) & 0x7f) + 1) >> 1) > 0)
+
+/* Nonzero if STATUS indicates the child is stopped. */
+#define __WIFSTOPPED(status) (((status) & 0xff) == 0x7f)
+
+/* Nonzero if STATUS indicates the child continued after a stop. We only
+ define this if <bits/waitflags.h> provides the WCONTINUED flag bit. */
+#ifdef WCONTINUED
+# define __WIFCONTINUED(status) ((status) == __W_CONTINUED)
+#endif
+
+/* Nonzero if STATUS indicates the child dumped core. */
+#define __WCOREDUMP(status) ((status) & __WCOREFLAG)
+
+/* Macros for constructing status values. */
+#define __W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
+#define __W_STOPCODE(sig) ((sig) << 8 | 0x7f)
+#define __W_CONTINUED 0xffff
+#define __WCOREFLAG 0x80
+
+
+#ifdef __USE_BSD
+
+# include <endian.h>
+
+union wait
+ {
+ int w_status;
+ struct
+ {
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int __w_termsig:7; /* Terminating signal. */
+ unsigned int __w_coredump:1; /* Set if dumped core. */
+ unsigned int __w_retcode:8; /* Return code if exited normally. */
+ unsigned int:16;
+# endif /* Little endian. */
+# if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int:16;
+ unsigned int __w_retcode:8;
+ unsigned int __w_coredump:1;
+ unsigned int __w_termsig:7;
+# endif /* Big endian. */
+ } __wait_terminated;
+ struct
+ {
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int __w_stopval:8; /* W_STOPPED if stopped. */
+ unsigned int __w_stopsig:8; /* Stopping signal. */
+ unsigned int:16;
+# endif /* Little endian. */
+# if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int:16;
+ unsigned int __w_stopsig:8; /* Stopping signal. */
+ unsigned int __w_stopval:8; /* W_STOPPED if stopped. */
+# endif /* Big endian. */
+ } __wait_stopped;
+ };
+
+# define w_termsig __wait_terminated.__w_termsig
+# define w_coredump __wait_terminated.__w_coredump
+# define w_retcode __wait_terminated.__w_retcode
+# define w_stopsig __wait_stopped.__w_stopsig
+# define w_stopval __wait_stopped.__w_stopval
+
+#endif /* Use BSD. */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/wchar.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/wchar.h
new file mode 100644
index 0000000..ef1f563
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/wchar.h
@@ -0,0 +1,26 @@
+/* wchar_t type related definitions.
+ Copyright (C) 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _BITS_WCHAR_H
+#define _BITS_WCHAR_H 1
+
+#define __WCHAR_MIN (-2147483647 - 1)
+#define __WCHAR_MAX (2147483647)
+
+#endif /* bits/wchar.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/wordsize.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/wordsize.h
new file mode 100644
index 0000000..666c7ad
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/wordsize.h
@@ -0,0 +1,19 @@
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#define __WORDSIZE _MIPS_SZPTR
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/xopen_lim.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/xopen_lim.h
new file mode 100644
index 0000000..c2363ab
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/bits/xopen_lim.h
@@ -0,0 +1,150 @@
+/* Copyright (C) 1996, 1997, 1999, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * Never include this file directly; use <limits.h> instead.
+ */
+
+/* Additional definitions from X/Open Portability Guide, Issue 4, Version 2
+ System Interfaces and Headers, 4.16 <limits.h>
+
+ Please note only the values which are not greater than the minimum
+ stated in the standard document are listed. The `sysconf' functions
+ should be used to obtain the actual value. */
+
+#ifndef _XOPEN_LIM_H
+#define _XOPEN_LIM_H 1
+
+#define __need_IOV_MAX
+#include <bits/stdio_lim.h>
+
+/* We do not provide fixed values for
+
+ ARG_MAX Maximum length of argument to the `exec' function
+ including environment data.
+
+ ATEXIT_MAX Maximum number of functions that may be registered
+ with `atexit'.
+
+ CHILD_MAX Maximum number of simultaneous processes per real
+ user ID.
+
+ OPEN_MAX Maximum number of files that one process can have open
+ at anyone time.
+
+ PAGESIZE
+ PAGE_SIZE Size of bytes of a page.
+
+ PASS_MAX Maximum number of significant bytes in a password.
+
+ We only provide a fixed limit for
+
+ IOV_MAX Maximum number of `iovec' structures that one process has
+ available for use with `readv' or writev'.
+
+ if this is indeed fixed by the underlying system.
+*/
+
+
+/* Maximum number of `iovec' structures that one process has available
+ for use with `readv' or writev'. */
+#define _XOPEN_IOV_MAX _POSIX_UIO_MAXIOV
+
+
+/* Maximum value of `digit' in calls to the `printf' and `scanf'
+ functions. Posix dictates this should be a minimum of 9 */
+#if !defined(__UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS__) || (__UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS__ <= 1)
+#undef NL_ARGMAX
+#elif __UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS__ < 9
+#define NL_ARGMAX 9
+#else
+#define NL_ARGMAX __UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS__
+#endif
+
+/* Maximum number of bytes in a `LANG' name. We have no limit. */
+#define NL_LANGMAX _POSIX2_LINE_MAX
+
+/* Maximum message number. We have no limit. */
+#define NL_MSGMAX INT_MAX
+
+/* Maximum number of bytes in N-to-1 collation mapping. We have no
+ limit. */
+#define NL_NMAX INT_MAX
+
+/* Maximum set number. We have no limit. */
+#define NL_SETMAX INT_MAX
+
+/* Maximum number of bytes in a message. We have no limit. */
+#define NL_TEXTMAX INT_MAX
+
+/* Default process priority. */
+#define NZERO 20
+
+
+/* Number of bits in a word of type `int'. */
+#ifdef INT_MAX
+# if INT_MAX == 32767
+# define WORD_BIT 16
+# else
+# if INT_MAX == 2147483647
+# define WORD_BIT 32
+# else
+/* Safe assumption. */
+# define WORD_BIT 64
+# endif
+# endif
+#elif defined __INT_MAX__
+# if __INT_MAX__ == 32767
+# define WORD_BIT 16
+# else
+# if __INT_MAX__ == 2147483647
+# define WORD_BIT 32
+# else
+/* Safe assumption. */
+# define WORD_BIT 64
+# endif
+# endif
+#else
+# define WORD_BIT 32
+#endif
+
+/* Number of bits in a word of type `long int'. */
+#ifdef LONG_MAX
+# if LONG_MAX == 2147483647
+# define LONG_BIT 32
+# else
+/* Safe assumption. */
+# define LONG_BIT 64
+# endif
+#elif defined __LONG_MAX__
+# if __LONG_MAX__ == 2147483647
+# define LONG_BIT 32
+# else
+/* Safe assumption. */
+# define LONG_BIT 64
+# endif
+#else
+# include <bits/wordsize.h>
+# if __WORDSIZE == 64
+# define LONG_BIT 64
+# else
+# define LONG_BIT 32
+# endif
+#endif
+
+#endif /* bits/xopen_lim.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/byteswap.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/byteswap.h
new file mode 100644
index 0000000..b61d4dd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/byteswap.h
@@ -0,0 +1,40 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _BYTESWAP_H
+#define _BYTESWAP_H 1
+
+/* Get the machine specific, optimized definitions. */
+#include <bits/byteswap.h>
+
+
+/* The following definitions must all be macros since otherwise some
+ of the possible optimizations are not possible. */
+
+/* Return a value with all bytes in the 16 bit argument swapped. */
+#define bswap_16(x) __bswap_16 (x)
+
+/* Return a value with all bytes in the 32 bit argument swapped. */
+#define bswap_32(x) __bswap_32 (x)
+
+#if defined __GNUC__ && __GNUC__ >= 2
+/* Return a value with all bytes in the 64 bit argument swapped. */
+# define bswap_64(x) __bswap_64 (x)
+#endif
+
+#endif /* byteswap.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/complex.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/complex.h
new file mode 100644
index 0000000..c16fcfa
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/complex.h
@@ -0,0 +1,107 @@
+/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99: 7.3 Complex arithmetic <complex.h>
+ */
+
+#ifndef _COMPLEX_H
+#define _COMPLEX_H 1
+
+#include <features.h>
+
+/* Get general and ISO C99 specific information. */
+#include <bits/mathdef.h>
+
+__BEGIN_DECLS
+
+/* We might need to add support for more compilers here. But since ISO
+ C99 is out hopefully all maintained compilers will soon provide the data
+ types `float complex' and `double complex'. */
+#if __GNUC_PREREQ(2, 7) && !__GNUC_PREREQ(2, 97)
+# define _Complex __complex__
+#endif
+
+#define complex _Complex
+
+/* Narrowest imaginary unit. This depends on the floating-point
+ evaluation method.
+ XXX This probably has to go into a gcc related file. */
+#define _Complex_I (__extension__ 1.0iF)
+
+/* Another more descriptive name is `I'.
+ XXX Once we have the imaginary support switch this to _Imaginary_I. */
+#undef I
+#define I _Complex_I
+
+/* The file <bits/cmathcalls.h> contains the prototypes for all the
+ actual math functions. These macros are used for those prototypes,
+ so we can easily declare each function as both `name' and `__name',
+ and can declare the float versions `namef' and `__namef'. */
+
+#define __MATHCALL(function, args) \
+ __MATHDECL (_Mdouble_complex_,function, args)
+#define __MATHDECL(type, function, args) \
+ __MATHDECL_1(type, function, args); \
+ __MATHDECL_1(type, __CONCAT(__,function), args)
+#define __MATHDECL_1(type, function, args) \
+ extern type __MATH_PRECNAME(function) args __THROW
+
+#define _Mdouble_ double
+#define __MATH_PRECNAME(name) name
+#include <bits/cmathcalls.h>
+#undef _Mdouble_
+#undef __MATH_PRECNAME
+
+/* Now the float versions. */
+#ifndef _Mfloat_
+# define _Mfloat_ float
+#endif
+#define _Mdouble_ _Mfloat_
+#ifdef __STDC__
+# define __MATH_PRECNAME(name) name##f
+#else
+# define __MATH_PRECNAME(name) name/**/f
+#endif
+#include <bits/cmathcalls.h>
+#undef _Mdouble_
+#undef __MATH_PRECNAME
+
+/* And the long double versions. It is non-critical to define them
+ here unconditionally since `long double' is required in ISO C99. */
+#if __STDC__ - 0 || __GNUC__ - 0 && !defined __NO_LONG_DOUBLE_MATH
+# ifndef _Mlong_double_
+# define _Mlong_double_ long double
+# endif
+# define _Mdouble_ _Mlong_double_
+# ifdef __STDC__
+# define __MATH_PRECNAME(name) name##l
+# else
+# define __MATH_PRECNAME(name) name/**/l
+# endif
+# include <bits/cmathcalls.h>
+#endif
+#undef _Mdouble_
+#undef __MATH_PRECNAME
+#undef __MATHDECL_1
+#undef __MATHDECL
+#undef __MATHCALL
+
+__END_DECLS
+
+#endif /* complex.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/cpio.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/cpio.h
new file mode 100644
index 0000000..fae3275
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/cpio.h
@@ -0,0 +1,74 @@
+/* Extended cpio format from POSIX.1.
+ This file is part of the GNU C Library.
+ Copyright (C) 1992, 1998 Free Software Foundation, Inc.
+ NOTE: The canonical source of this file is maintained with the GNU cpio.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _CPIO_H
+#define _CPIO_H 1
+
+/* A cpio archive consists of a sequence of files.
+ Each file has a 76 byte header,
+ a variable length, NUL terminated filename,
+ and variable length file data.
+ A header for a filename "TRAILER!!!" indicates the end of the archive. */
+
+/* All the fields in the header are ISO 646 (approximately ASCII) strings
+ of octal numbers, left padded, not NUL terminated.
+
+ Field Name Length in Bytes Notes
+ c_magic 6 must be "070707"
+ c_dev 6
+ c_ino 6
+ c_mode 6 see below for value
+ c_uid 6
+ c_gid 6
+ c_nlink 6
+ c_rdev 6 only valid for chr and blk special files
+ c_mtime 11
+ c_namesize 6 count includes terminating NUL in pathname
+ c_filesize 11 must be 0 for FIFOs and directories */
+
+/* Value for the field `c_magic'. */
+#define MAGIC "070707"
+
+/* Values for c_mode, OR'd together: */
+
+#define C_IRUSR 000400
+#define C_IWUSR 000200
+#define C_IXUSR 000100
+#define C_IRGRP 000040
+#define C_IWGRP 000020
+#define C_IXGRP 000010
+#define C_IROTH 000004
+#define C_IWOTH 000002
+#define C_IXOTH 000001
+
+#define C_ISUID 004000
+#define C_ISGID 002000
+#define C_ISVTX 001000
+
+#define C_ISBLK 060000
+#define C_ISCHR 020000
+#define C_ISDIR 040000
+#define C_ISFIFO 010000
+#define C_ISSOCK 0140000
+#define C_ISLNK 0120000
+#define C_ISCTG 0110000
+#define C_ISREG 0100000
+
+#endif /* cpio.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/crypt.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/crypt.h
new file mode 100644
index 0000000..f3fed7c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/crypt.h
@@ -0,0 +1,41 @@
+/*
+ * crypt(3) implementation for uClibc
+ *
+ * The uClibc Library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * The GNU C Library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the GNU C Library; if not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307 USA.
+ *
+ */
+
+#ifndef _CRYPT_H
+#define _CRYPT_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Encrypt characters from KEY using salt to perturb the encryption method.
+ * If salt begins with "$1$", MD5 hashing is used instead of DES. */
+extern char *crypt (const char *__key, const char *__salt);
+
+/* Setup DES tables according KEY. */
+extern void setkey (const char *__key);
+
+/* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt
+ block in place. */
+extern void encrypt (char *__block, int __edflag);
+
+__END_DECLS
+
+#endif /* crypt.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/ctype.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/ctype.h
new file mode 100644
index 0000000..78cff7d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/ctype.h
@@ -0,0 +1,383 @@
+/* Copyright (C) 1991,92,93,95,96,97,98,99,2001,02
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard 7.4: Character handling <ctype.h>
+ */
+
+#ifndef _CTYPE_H
+#define _CTYPE_H 1
+
+#include <features.h>
+#include <bits/types.h>
+
+#ifdef __UCLIBC_HAS_CTYPE_TABLES__
+
+__BEGIN_DECLS
+
+#ifndef _ISbit
+/* These are all the characteristics of characters.
+ If there get to be more than 16 distinct characteristics,
+ __ctype_mask_t will need to be adjusted. */
+
+# define _ISbit(bit) (1 << (bit))
+
+enum
+{
+ _ISupper = _ISbit (0), /* UPPERCASE. */
+ _ISlower = _ISbit (1), /* lowercase. */
+ _ISalpha = _ISbit (2), /* Alphabetic. */
+ _ISdigit = _ISbit (3), /* Numeric. */
+ _ISxdigit = _ISbit (4), /* Hexadecimal numeric. */
+ _ISspace = _ISbit (5), /* Whitespace. */
+ _ISprint = _ISbit (6), /* Printing. */
+ _ISgraph = _ISbit (7), /* Graphical. */
+ _ISblank = _ISbit (8), /* Blank (usually SPC and TAB). */
+ _IScntrl = _ISbit (9), /* Control character. */
+ _ISpunct = _ISbit (10), /* Punctuation. */
+ _ISalnum = _ISbit (11) /* Alphanumeric. */
+};
+#else
+#error _ISbit already defined!
+#endif /* ! _ISbit */
+
+#include <bits/uClibc_touplow.h>
+
+#ifdef __UCLIBC_HAS_CTYPE_SIGNED__
+# define __UCLIBC_CTYPE_IN_TO_DOMAIN(c) (((unsigned int)((c) + 128)) < 384)
+
+#else /* __UCLIBC_HAS_CTYPE_SIGNED__ */
+# define __UCLIBC_CTYPE_IN_TO_DOMAIN(c) (((unsigned int)(c)) < 256)
+
+#endif /* __UCLIBC_HAS_CTYPE_SIGNED__ */
+
+/* In the thread-specific locale model (see `uselocale' in <locale.h>)
+ we cannot use global variables for these as was done in the past.
+ Instead, the following accessor functions return the address of
+ each variable, which is local to the current thread if multithreaded.
+
+ These point into arrays of 384, so they can be indexed by any `unsigned
+ char' value [0,255]; by EOF (-1); or by any `signed char' value
+ [-128,-1). ISO C requires that the ctype functions work for `unsigned
+ char' values and for EOF; we also support negative `signed char' values
+ for broken old programs. The case conversion arrays are of `int's
+ rather than `unsigned char's because tolower (EOF) must be EOF, which
+ doesn't fit into an `unsigned char'. But today more important is that
+ the arrays are also used for multi-byte character sets. */
+
+/* uClibc differences:
+ *
+ * When __UCLIBC_HAS_CTYPE_SIGNED is defined,
+ *
+ * The upper and lower mapping arrays are type int16_t, so that
+ * they may store all char values plus EOF. The glibc reasoning
+ * given above for these being type int is questionable, as the
+ * ctype mapping functions map from the set of (unsigned) char
+ * and EOF back into the set. They have no awareness of multi-byte
+ * or wide characters.
+ *
+ * Otherwise,
+ *
+ * The ctype array is defined for -1..255.
+ * The upper and lower mapping arrays are defined for 0..255.
+ * The upper and lower mapping arrays are type unsigned char.
+ */
+
+/* Pointers to the default C-locale data. */
+extern const __ctype_mask_t *__C_ctype_b;
+extern const __ctype_touplow_t *__C_ctype_toupper;
+extern const __ctype_touplow_t *__C_ctype_tolower;
+
+#ifdef __UCLIBC_HAS_XLOCALE__
+
+extern __const __ctype_mask_t **__ctype_b_loc (void)
+ __attribute__ ((__const));
+extern __const __ctype_touplow_t **__ctype_tolower_loc (void)
+ __attribute__ ((__const));
+extern __const __ctype_touplow_t **__ctype_toupper_loc (void)
+ __attribute__ ((__const));
+
+#define __UCLIBC_CTYPE_B (*__ctype_b_loc())
+#define __UCLIBC_CTYPE_TOLOWER (*__ctype_tolower_loc())
+#define __UCLIBC_CTYPE_TOUPPER (*__ctype_toupper_loc())
+
+#else /* __UCLIBC_HAS_XLOCALE__ */
+
+/* Pointers to the current global locale data in use. */
+extern const __ctype_mask_t *__ctype_b;
+extern const __ctype_touplow_t *__ctype_toupper;
+extern const __ctype_touplow_t *__ctype_tolower;
+
+#define __UCLIBC_CTYPE_B (__ctype_b)
+#define __UCLIBC_CTYPE_TOLOWER (__ctype_tolower)
+#define __UCLIBC_CTYPE_TOUPPER (__ctype_toupper)
+
+#endif /* __UCLIBC_HAS_XLOCALE__ */
+
+#define __isctype(c, type) \
+ ((__UCLIBC_CTYPE_B)[(int) (c)] & (__ctype_mask_t) type)
+
+#define __isascii(c) (((c) & ~0x7f) == 0) /* If C is a 7 bit value. */
+#define __toascii(c) ((c) & 0x7f) /* Mask off high bits. */
+
+#if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc)
+/* isdigit() is really locale-invariant, so provide some small fast macros.
+ * These are uClibc-specific. */
+#define __isdigit_char(C) (((unsigned char)((C) - '0')) <= 9)
+#define __isdigit_int(C) (((unsigned int)((C) - '0')) <= 9)
+#endif
+
+#define __exctype(name) extern int name (int) __THROW
+
+__BEGIN_NAMESPACE_STD
+
+/* The following names are all functions:
+ int isCHARACTERISTIC(int c);
+ which return nonzero iff C has CHARACTERISTIC.
+ For the meaning of the characteristic names, see the `enum' above. */
+__exctype (isalnum);
+__exctype (isalpha);
+__exctype (iscntrl);
+__exctype (isdigit);
+__exctype (islower);
+__exctype (isgraph);
+__exctype (isprint);
+__exctype (ispunct);
+__exctype (isspace);
+__exctype (isupper);
+__exctype (isxdigit);
+
+
+/* Return the lowercase version of C. */
+extern int tolower (int __c) __THROW;
+
+/* Return the uppercase version of C. */
+extern int toupper (int __c) __THROW;
+
+__END_NAMESPACE_STD
+
+
+/* ISO C99 introduced one new function. */
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+
+__exctype (isblank);
+
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_GNU
+/* Test C for a set of character classes according to MASK. */
+extern int isctype (int __c, int __mask) __THROW;
+#endif
+
+#if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
+
+/* Return nonzero iff C is in the ASCII set
+ (i.e., is no more than 7 bits wide). */
+extern int isascii (int __c) __THROW;
+
+/* Return the part of C that is in the ASCII set
+ (i.e., the low-order 7 bits of C). */
+extern int toascii (int __c) __THROW;
+
+/* These are the same as `toupper' and `tolower' except that they do not
+ check the argument for being in the range of a `char'. */
+__exctype (_toupper);
+__exctype (_tolower);
+#endif /* Use SVID or use misc. */
+
+/* This code is needed for the optimized mapping functions. */
+#define __tobody(c, f, a, args) \
+ (__extension__ \
+ ({ int __res; \
+ if (sizeof (c) > 1) \
+ { \
+ if (__builtin_constant_p (c)) \
+ { \
+ int __c = (c); \
+ __res = __UCLIBC_CTYPE_IN_TO_DOMAIN(__c) ? (a)[__c] : __c; \
+ } \
+ else \
+ __res = f args; \
+ } \
+ else \
+ __res = (a)[(int) (c)]; \
+ __res; }))
+
+#if !defined __NO_CTYPE && !defined __cplusplus
+# define isalnum(c) __isctype((c), _ISalnum)
+# define isalpha(c) __isctype((c), _ISalpha)
+# define iscntrl(c) __isctype((c), _IScntrl)
+# define isdigit(c) __isctype((c), _ISdigit)
+# define islower(c) __isctype((c), _ISlower)
+# define isgraph(c) __isctype((c), _ISgraph)
+# define isprint(c) __isctype((c), _ISprint)
+# define ispunct(c) __isctype((c), _ISpunct)
+# define isspace(c) __isctype((c), _ISspace)
+# define isupper(c) __isctype((c), _ISupper)
+# define isxdigit(c) __isctype((c), _ISxdigit)
+
+# ifdef __USE_ISOC99
+# define isblank(c) __isctype((c), _ISblank)
+# endif
+
+# ifdef __USE_EXTERN_INLINES
+extern __inline int
+__NTH (tolower (int __c))
+{
+ return __UCLIBC_CTYPE_IN_TO_DOMAIN(__c) ? (__UCLIBC_CTYPE_TOLOWER)[__c] : __c;
+}
+
+extern __inline int
+__NTH (toupper (int __c))
+{
+ return __UCLIBC_CTYPE_IN_TO_DOMAIN(__c) ? (__UCLIBC_CTYPE_TOUPPER)[__c] : __c;
+}
+# endif
+
+# if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus
+# define tolower(c) __tobody (c, tolower, __UCLIBC_CTYPE_TOLOWER, (c))
+# define toupper(c) __tobody (c, toupper, __UCLIBC_CTYPE_TOUPPER, (c))
+# endif /* Optimizing gcc */
+
+# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
+# define isascii(c) __isascii (c)
+# define toascii(c) __toascii (c)
+
+# define _tolower(c) ((int) (__UCLIBC_CTYPE_TOLOWER)[(int) (c)])
+# define _toupper(c) ((int) (__UCLIBC_CTYPE_TOUPPER)[(int) (c)])
+# endif
+
+#endif /* Not __NO_CTYPE. */
+
+
+#if defined(__USE_GNU) && defined(__UCLIBC_HAS_XLOCALE__)
+/* The concept of one static locale per category is not very well
+ thought out. Many applications will need to process its data using
+ information from several different locales. Another application is
+ the implementation of the internationalization handling in the
+ upcoming ISO C++ standard library. To support this another set of
+ the functions using locale data exist which have an additional
+ argument.
+
+ Attention: all these functions are *not* standardized in any form.
+ This is a proof-of-concept implementation. */
+
+/* Structure for reentrant locale using functions. This is an
+ (almost) opaque type for the user level programs. */
+# include <xlocale.h>
+
+/* These definitions are similar to the ones above but all functions
+ take as an argument a handle for the locale which shall be used. */
+# define __isctype_l(c, type, locale) \
+ ((locale)->__ctype_b[(int) (c)] & (__ctype_mask_t) type)
+
+# define __exctype_l(name) \
+ extern int name (int, __locale_t) __THROW
+
+/* The following names are all functions:
+ int isCHARACTERISTIC(int c, locale_t *locale);
+ which return nonzero iff C has CHARACTERISTIC.
+ For the meaning of the characteristic names, see the `enum' above. */
+__exctype_l (isalnum_l);
+__exctype_l (isalpha_l);
+__exctype_l (iscntrl_l);
+__exctype_l (isdigit_l);
+__exctype_l (islower_l);
+__exctype_l (isgraph_l);
+__exctype_l (isprint_l);
+__exctype_l (ispunct_l);
+__exctype_l (isspace_l);
+__exctype_l (isupper_l);
+__exctype_l (isxdigit_l);
+
+__exctype_l (isblank_l);
+
+
+/* Return the lowercase version of C in locale L. */
+extern int __tolower_l (int __c, __locale_t __l) __THROW;
+extern int tolower_l (int __c, __locale_t __l) __THROW;
+
+/* Return the uppercase version of C. */
+extern int __toupper_l (int __c, __locale_t __l) __THROW;
+extern int toupper_l (int __c, __locale_t __l) __THROW;
+
+# if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus
+# define __tolower_l(c, locale) \
+ __tobody (c, __tolower_l, (locale)->__ctype_tolower, (c, locale))
+# define __toupper_l(c, locale) \
+ __tobody (c, __toupper_l, (locale)->__ctype_toupper, (c, locale))
+# define tolower_l(c, locale) __tolower_l ((c), (locale))
+# define toupper_l(c, locale) __toupper_l ((c), (locale))
+# endif /* Optimizing gcc */
+
+
+# ifndef __NO_CTYPE
+# define __isalnum_l(c,l) __isctype_l((c), _ISalnum, (l))
+# define __isalpha_l(c,l) __isctype_l((c), _ISalpha, (l))
+# define __iscntrl_l(c,l) __isctype_l((c), _IScntrl, (l))
+# define __isdigit_l(c,l) __isctype_l((c), _ISdigit, (l))
+# define __islower_l(c,l) __isctype_l((c), _ISlower, (l))
+# define __isgraph_l(c,l) __isctype_l((c), _ISgraph, (l))
+# define __isprint_l(c,l) __isctype_l((c), _ISprint, (l))
+# define __ispunct_l(c,l) __isctype_l((c), _ISpunct, (l))
+# define __isspace_l(c,l) __isctype_l((c), _ISspace, (l))
+# define __isupper_l(c,l) __isctype_l((c), _ISupper, (l))
+# define __isxdigit_l(c,l) __isctype_l((c), _ISxdigit, (l))
+
+# define __isblank_l(c,l) __isctype_l((c), _ISblank, (l))
+
+# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
+# define __isascii_l(c,l) ((l), __isascii (c))
+# define __toascii_l(c,l) ((l), __toascii (c))
+# endif
+
+# define isalnum_l(c,l) __isalnum_l ((c), (l))
+# define isalpha_l(c,l) __isalpha_l ((c), (l))
+# define iscntrl_l(c,l) __iscntrl_l ((c), (l))
+# define isdigit_l(c,l) __isdigit_l ((c), (l))
+# define islower_l(c,l) __islower_l ((c), (l))
+# define isgraph_l(c,l) __isgraph_l ((c), (l))
+# define isprint_l(c,l) __isprint_l ((c), (l))
+# define ispunct_l(c,l) __ispunct_l ((c), (l))
+# define isspace_l(c,l) __isspace_l ((c), (l))
+# define isupper_l(c,l) __isupper_l ((c), (l))
+# define isxdigit_l(c,l) __isxdigit_l ((c), (l))
+
+# define isblank_l(c,l) __isblank_l ((c), (l))
+
+# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
+# define isascii_l(c,l) __isascii_l ((c), (l))
+# define toascii_l(c,l) __toascii_l ((c), (l))
+# endif
+
+# endif /* Not __NO_CTYPE. */
+
+#endif /* Use GNU. */
+
+__END_DECLS
+
+#else /* __UCLIBC_HAS_CTYPE_TABLES__ */
+
+#include <bits/uClibc_ctype.h>
+
+#endif
+
+#endif /* ctype.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/dirent.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/dirent.h
new file mode 100644
index 0000000..565a94d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/dirent.h
@@ -0,0 +1,293 @@
+/* Copyright (C) 1991-2000, 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 5.1.2 Directory Operations <dirent.h>
+ */
+
+#ifndef _DIRENT_H
+#define _DIRENT_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <bits/types.h>
+
+#ifdef __USE_XOPEN
+# ifndef __ino_t_defined
+# ifndef __USE_FILE_OFFSET64
+typedef __ino_t ino_t;
+# else
+typedef __ino64_t ino_t;
+# endif
+# define __ino_t_defined
+# endif
+# if defined __USE_LARGEFILE64 && !defined __ino64_t_defined
+typedef __ino64_t ino64_t;
+# define __ino64_t_defined
+# endif
+#endif
+
+/* This file defines `struct dirent'.
+
+ It defines the macro `_DIRENT_HAVE_D_NAMLEN' iff there is a `d_namlen'
+ member that gives the length of `d_name'.
+
+ It defines the macro `_DIRENT_HAVE_D_RECLEN' iff there is a `d_reclen'
+ member that gives the size of the entire directory entry.
+
+ It defines the macro `_DIRENT_HAVE_D_OFF' iff there is a `d_off'
+ member that gives the file offset of the next directory entry.
+
+ It defines the macro `_DIRENT_HAVE_D_TYPE' iff there is a `d_type'
+ member that gives the type of the file.
+ */
+
+#include <bits/dirent.h>
+
+#if (defined __USE_BSD || defined __USE_MISC) && !defined d_fileno
+# define d_ino d_fileno /* Backward compatibility. */
+#endif
+
+/* These macros extract size information from a `struct dirent *'.
+ They may evaluate their argument multiple times, so it must not
+ have side effects. Each of these may involve a relatively costly
+ call to `strlen' on some systems, so these values should be cached.
+
+ _D_EXACT_NAMLEN (DP) returns the length of DP->d_name, not including
+ its terminating null character.
+
+ _D_ALLOC_NAMLEN (DP) returns a size at least (_D_EXACT_NAMLEN (DP) + 1);
+ that is, the allocation size needed to hold the DP->d_name string.
+ Use this macro when you don't need the exact length, just an upper bound.
+ This macro is less likely to require calling `strlen' than _D_EXACT_NAMLEN.
+ */
+
+#ifdef _DIRENT_HAVE_D_NAMLEN
+# define _D_EXACT_NAMLEN(d) ((d)->d_namlen)
+# define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1)
+#else
+# define _D_EXACT_NAMLEN(d) (strlen ((d)->d_name))
+# ifdef _DIRENT_HAVE_D_RECLEN
+# define _D_ALLOC_NAMLEN(d) (((char *) (d) + (d)->d_reclen) - &(d)->d_name[0])
+# else
+# define _D_ALLOC_NAMLEN(d) (sizeof (d)->d_name > 1 ? sizeof (d)->d_name : \
+ _D_EXACT_NAMLEN (d) + 1)
+# endif
+#endif
+
+
+#ifdef __USE_BSD
+/* File types for `d_type'. */
+enum
+ {
+ DT_UNKNOWN = 0,
+# define DT_UNKNOWN DT_UNKNOWN
+ DT_FIFO = 1,
+# define DT_FIFO DT_FIFO
+ DT_CHR = 2,
+# define DT_CHR DT_CHR
+ DT_DIR = 4,
+# define DT_DIR DT_DIR
+ DT_BLK = 6,
+# define DT_BLK DT_BLK
+ DT_REG = 8,
+# define DT_REG DT_REG
+ DT_LNK = 10,
+# define DT_LNK DT_LNK
+ DT_SOCK = 12,
+# define DT_SOCK DT_SOCK
+ DT_WHT = 14
+# define DT_WHT DT_WHT
+ };
+
+/* Convert between stat structure types and directory types. */
+# define IFTODT(mode) (((mode) & 0170000) >> 12)
+# define DTTOIF(dirtype) ((dirtype) << 12)
+#endif
+
+
+/* This is the data type of directory stream objects.
+ The actual structure is opaque to users. */
+typedef struct __dirstream DIR;
+
+/* Open a directory stream on NAME.
+ Return a DIR stream on the directory, or NULL if it could not be opened.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern DIR *opendir (__const char *__name) __nonnull ((1));
+
+/* Close the directory stream DIRP.
+ Return 0 if successful, -1 if not.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int closedir (DIR *__dirp) __nonnull ((1));
+
+/* Read a directory entry from DIRP. Return a pointer to a `struct
+ dirent' describing the entry, or NULL for EOF or error. The
+ storage returned may be overwritten by a later readdir call on the
+ same DIR stream.
+
+ If the Large File Support API is selected we have to use the
+ appropriate interface.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+#ifndef __USE_FILE_OFFSET64
+extern struct dirent *readdir (DIR *__dirp) __nonnull ((1));
+#else
+# ifdef __REDIRECT
+extern struct dirent *__REDIRECT (readdir, (DIR *__dirp), readdir64)
+ __nonnull ((1));
+# else
+# define readdir readdir64
+# endif
+#endif
+
+#ifdef __USE_LARGEFILE64
+extern struct dirent64 *readdir64 (DIR *__dirp) __nonnull ((1));
+#endif
+
+#if defined __USE_POSIX || defined __USE_MISC
+/* Reentrant version of `readdir'. Return in RESULT a pointer to the
+ next entry.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+# ifndef __USE_FILE_OFFSET64
+extern int readdir_r (DIR *__restrict __dirp,
+ struct dirent *__restrict __entry,
+ struct dirent **__restrict __result)
+ __nonnull ((1, 2, 3));
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (readdir_r,
+ (DIR *__restrict __dirp,
+ struct dirent *__restrict __entry,
+ struct dirent **__restrict __result),
+ readdir64_r) __nonnull ((1, 2, 3));
+# else
+# define readdir_r readdir64_r
+# endif
+# endif
+
+# ifdef __USE_LARGEFILE64
+extern int readdir64_r (DIR *__restrict __dirp,
+ struct dirent64 *__restrict __entry,
+ struct dirent64 **__restrict __result)
+ __nonnull ((1, 2, 3));
+# endif
+#endif /* POSIX or misc */
+
+/* Rewind DIRP to the beginning of the directory. */
+extern void rewinddir (DIR *__dirp) __THROW __nonnull ((1));
+
+#if defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN
+# include <bits/types.h>
+
+/* Seek to position POS on DIRP. */
+extern void seekdir (DIR *__dirp, long int __pos) __THROW __nonnull ((1));
+
+/* Return the current position of DIRP. */
+extern long int telldir (DIR *__dirp) __THROW __nonnull ((1));
+#endif
+
+#if defined __USE_BSD || defined __USE_MISC
+
+/* Return the file descriptor used by DIRP. */
+extern int dirfd (DIR *__dirp) __THROW __nonnull ((1));
+
+# if 0 /* defined __OPTIMIZE__ && defined _DIR_dirfd */
+# define dirfd(dirp) _DIR_dirfd (dirp)
+# endif
+
+# ifndef MAXNAMLEN
+/* Get the definitions of the POSIX.1 limits. */
+# include <bits/posix1_lim.h>
+
+/* `MAXNAMLEN' is the BSD name for what POSIX calls `NAME_MAX'. */
+# ifdef NAME_MAX
+# define MAXNAMLEN NAME_MAX
+# else
+# define MAXNAMLEN 255
+# endif
+# endif
+
+# define __need_size_t
+# include <stddef.h>
+
+/* Scan the directory DIR, calling SELECTOR on each directory entry.
+ Entries for which SELECT returns nonzero are individually malloc'd,
+ sorted using qsort with CMP, and collected in a malloc'd array in
+ *NAMELIST. Returns the number of entries selected, or -1 on error. */
+# ifndef __USE_FILE_OFFSET64
+extern int scandir (__const char *__restrict __dir,
+ struct dirent ***__restrict __namelist,
+ int (*__selector) (__const struct dirent *),
+ int (*__cmp) (__const void *, __const void *))
+ __nonnull ((1, 2));
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (scandir,
+ (__const char *__restrict __dir,
+ struct dirent ***__restrict __namelist,
+ int (*__selector) (__const struct dirent *),
+ int (*__cmp) (__const void *, __const void *)),
+ scandir64) __nonnull ((1, 2));
+# else
+# define scandir scandir64
+# endif
+# endif
+
+# if defined __USE_GNU && defined __USE_LARGEFILE64
+/* This function is like `scandir' but it uses the 64bit dirent structure.
+ Please note that the CMP function must now work with struct dirent64 **. */
+extern int scandir64 (__const char *__restrict __dir,
+ struct dirent64 ***__restrict __namelist,
+ int (*__selector) (__const struct dirent64 *),
+ int (*__cmp) (__const void *, __const void *))
+ __nonnull ((1, 2));
+# endif
+
+/* Function to compare two `struct dirent's alphabetically. */
+# ifndef __USE_FILE_OFFSET64
+extern int alphasort (__const void *__e1, __const void *__e2)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (alphasort,
+ (__const void *__e1, __const void *__e2),
+ alphasort64) __attribute_pure__ __nonnull ((1, 2));
+# else
+# define alphasort alphasort64
+# endif
+# endif
+
+# if defined __USE_GNU && defined __USE_LARGEFILE64
+extern int alphasort64 (__const void *__e1, __const void *__e2)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+# endif
+
+#endif /* Use BSD or misc. */
+
+__END_DECLS
+
+#endif /* dirent.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/dlfcn.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/dlfcn.h
new file mode 100644
index 0000000..2348e43
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/dlfcn.h
@@ -0,0 +1,201 @@
+/* User functions for run-time dynamic loading.
+ Copyright (C) 1995-1999,2000,2001,2003,2004,2006
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _DLFCN_H
+#define _DLFCN_H 1
+
+#include <features.h>
+#define __need_size_t
+#include <stddef.h>
+
+/* Collect various system dependent definitions and declarations. */
+#include <bits/dlfcn.h>
+
+
+#ifdef __USE_GNU
+/* If the first argument of `dlsym' or `dlvsym' is set to RTLD_NEXT
+ the run-time address of the symbol called NAME in the next shared
+ object is returned. The "next" relation is defined by the order
+ the shared objects were loaded. */
+# define RTLD_NEXT ((void *) -1l)
+
+/* If the first argument to `dlsym' or `dlvsym' is set to RTLD_DEFAULT
+ the run-time address of the symbol called NAME in the global scope
+ is returned. */
+# define RTLD_DEFAULT ((void *) 0)
+
+
+# if 0 /* uClibc doesnt support this */
+/* Type for namespace indeces. */
+typedef long int Lmid_t;
+
+/* Special namespace ID values. */
+# define LM_ID_BASE 0 /* Initial namespace. */
+# define LM_ID_NEWLM -1 /* For dlmopen: request new namespace. */
+# endif
+#endif
+
+__BEGIN_DECLS
+
+/* Open the shared object FILE and map it in; return a handle that can be
+ passed to `dlsym' to get symbol values from it. */
+extern void *dlopen (__const char *__file, int __mode) __THROW;
+
+/* Unmap and close a shared object opened by `dlopen'.
+ The handle cannot be used again after calling `dlclose'. */
+extern int dlclose (void *__handle) __THROW __nonnull ((1));
+
+/* Find the run-time address in the shared object HANDLE refers to
+ of the symbol called NAME. */
+extern void *dlsym (void *__restrict __handle,
+ __const char *__restrict __name) __THROW __nonnull ((2));
+
+#if 0 /*def __USE_GNU*/
+/* Like `dlopen', but request object to be allocated in a new namespace. */
+extern void *dlmopen (Lmid_t __nsid, __const char *__file, int __mode) __THROW;
+
+/* Find the run-time address in the shared object HANDLE refers to
+ of the symbol called NAME with VERSION. */
+extern void *dlvsym (void *__restrict __handle,
+ __const char *__restrict __name,
+ __const char *__restrict __version)
+ __THROW __nonnull ((2, 3));
+#endif
+
+/* When any of the above functions fails, call this function
+ to return a string describing the error. Each call resets
+ the error string so that a following call returns null. */
+extern char *dlerror (void) __THROW;
+
+
+#ifdef __USE_GNU
+/* Structure containing information about object searched using
+ `dladdr'. */
+typedef struct
+{
+ __const char *dli_fname; /* File name of defining object. */
+ void *dli_fbase; /* Load address of that object. */
+ __const char *dli_sname; /* Name of nearest symbol. */
+ void *dli_saddr; /* Exact value of nearest symbol. */
+} Dl_info;
+
+/* Fill in *INFO with the following information about ADDRESS.
+ Returns 0 iff no shared object's segments contain that address. */
+extern int dladdr (__const void *__address, Dl_info *__info)
+ __THROW __nonnull ((2));
+
+#if 0 /* not supported by uClibc */
+/* Same as `dladdr', but additionally sets *EXTRA_INFO according to FLAGS. */
+extern int dladdr1 (__const void *__address, Dl_info *__info,
+ void **__extra_info, int __flags) __THROW __nonnull ((2));
+
+/* These are the possible values for the FLAGS argument to `dladdr1'.
+ This indicates what extra information is stored at *EXTRA_INFO.
+ It may also be zero, in which case the EXTRA_INFO argument is not used. */
+enum
+ {
+ /* Matching symbol table entry (const ElfNN_Sym *). */
+ RTLD_DL_SYMENT = 1,
+
+ /* The object containing the address (struct link_map *). */
+ RTLD_DL_LINKMAP = 2
+ };
+
+
+/* Get information about the shared object HANDLE refers to.
+ REQUEST is from among the values below, and determines the use of ARG.
+
+ On success, returns zero. On failure, returns -1 and records an error
+ message to be fetched with `dlerror'. */
+extern int dlinfo (void *__restrict __handle,
+ int __request, void *__restrict __arg)
+ __THROW __nonnull ((1, 3));
+
+/* These are the possible values for the REQUEST argument to `dlinfo'. */
+enum
+ {
+ /* Treat ARG as `lmid_t *'; store namespace ID for HANDLE there. */
+ RTLD_DI_LMID = 1,
+
+ /* Treat ARG as `struct link_map **';
+ store the `struct link_map *' for HANDLE there. */
+ RTLD_DI_LINKMAP = 2,
+
+ RTLD_DI_CONFIGADDR = 3, /* Unsupported, defined by Solaris. */
+
+ /* Treat ARG as `Dl_serinfo *' (see below), and fill in to describe the
+ directories that will be searched for dependencies of this object.
+ RTLD_DI_SERINFOSIZE fills in just the `dls_cnt' and `dls_size'
+ entries to indicate the size of the buffer that must be passed to
+ RTLD_DI_SERINFO to fill in the full information. */
+ RTLD_DI_SERINFO = 4,
+ RTLD_DI_SERINFOSIZE = 5,
+
+ /* Treat ARG as `char *', and store there the directory name used to
+ expand $ORIGIN in this shared object's dependency file names. */
+ RTLD_DI_ORIGIN = 6,
+
+ RTLD_DI_PROFILENAME = 7, /* Unsupported, defined by Solaris. */
+ RTLD_DI_PROFILEOUT = 8, /* Unsupported, defined by Solaris. */
+
+ /* Treat ARG as `size_t *', and store there the TLS module ID
+ of this object's PT_TLS segment, as used in TLS relocations;
+ store zero if this object does not define a PT_TLS segment. */
+ RTLD_DI_TLS_MODID = 9,
+
+ /* Treat ARG as `void **', and store there a pointer to the calling
+ thread's TLS block corresponding to this object's PT_TLS segment.
+ Store a null pointer if this object does not define a PT_TLS
+ segment, or if the calling thread has not allocated a block for it. */
+ RTLD_DI_TLS_DATA = 10,
+
+ RTLD_DI_MAX = 10,
+ };
+
+
+/* This is the type of elements in `Dl_serinfo', below.
+ The `dls_name' member points to space in the buffer passed to `dlinfo'. */
+typedef struct
+{
+ char *dls_name; /* Name of library search path directory. */
+ unsigned int dls_flags; /* Indicates where this directory came from. */
+} Dl_serpath;
+
+/* This is the structure that must be passed (by reference) to `dlinfo' for
+ the RTLD_DI_SERINFO and RTLD_DI_SERINFOSIZE requests. */
+typedef struct
+{
+ size_t dls_size; /* Size in bytes of the whole buffer. */
+ unsigned int dls_cnt; /* Number of elements in `dls_serpath'. */
+ Dl_serpath dls_serpath[1]; /* Actually longer, dls_cnt elements. */
+} Dl_serinfo;
+
+#else
+
+/* Get information about the shared objects currently loaded */
+extern int dlinfo (void);
+
+#endif
+#endif /* __USE_GNU */
+
+
+__END_DECLS
+
+#endif /* dlfcn.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/..install.cmd
new file mode 100644
index 0000000..e88e1f9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/drm/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/drm /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/drm mips drm.h drm_mode.h drm_sarea.h i810_drm.h i830_drm.h i915_drm.h mga_drm.h r128_drm.h radeon_drm.h savage_drm.h sis_drm.h via_drm.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/drm /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/drm mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/drm/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/drm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/drm.h
new file mode 100644
index 0000000..cb1ec51
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/drm.h
@@ -0,0 +1,744 @@
+/**
+ * \file drm.h
+ * Header for the Direct Rendering Manager
+ *
+ * \author Rickard E. (Rik) Faith <faith@valinux.com>
+ *
+ * \par Acknowledgments:
+ * Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic \c cmpxchg.
+ */
+
+/*
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _DRM_H_
+#define _DRM_H_
+
+#include <linux/types.h>
+#include <asm/ioctl.h> /* For _IO* macros */
+#define DRM_IOCTL_NR(n) _IOC_NR(n)
+#define DRM_IOC_VOID _IOC_NONE
+#define DRM_IOC_READ _IOC_READ
+#define DRM_IOC_WRITE _IOC_WRITE
+#define DRM_IOC_READWRITE _IOC_READ|_IOC_WRITE
+#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
+
+#define DRM_MAJOR 226
+#define DRM_MAX_MINOR 15
+
+#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */
+#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */
+#define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */
+#define DRM_RAM_PERCENT 10 /**< How much system ram can we lock? */
+
+#define _DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */
+#define _DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */
+#define _DRM_LOCK_IS_HELD(lock) ((lock) & _DRM_LOCK_HELD)
+#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT)
+#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT))
+
+typedef unsigned int drm_handle_t;
+typedef unsigned int drm_context_t;
+typedef unsigned int drm_drawable_t;
+typedef unsigned int drm_magic_t;
+
+/**
+ * Cliprect.
+ *
+ * \warning: If you change this structure, make sure you change
+ * XF86DRIClipRectRec in the server as well
+ *
+ * \note KW: Actually it's illegal to change either for
+ * backwards-compatibility reasons.
+ */
+struct drm_clip_rect {
+ unsigned short x1;
+ unsigned short y1;
+ unsigned short x2;
+ unsigned short y2;
+};
+
+/**
+ * Drawable information.
+ */
+struct drm_drawable_info {
+ unsigned int num_rects;
+ struct drm_clip_rect *rects;
+};
+
+/**
+ * Texture region,
+ */
+struct drm_tex_region {
+ unsigned char next;
+ unsigned char prev;
+ unsigned char in_use;
+ unsigned char padding;
+ unsigned int age;
+};
+
+/**
+ * Hardware lock.
+ *
+ * The lock structure is a simple cache-line aligned integer. To avoid
+ * processor bus contention on a multiprocessor system, there should not be any
+ * other data stored in the same cache line.
+ */
+struct drm_hw_lock {
+ __volatile__ unsigned int lock; /**< lock variable */
+ char padding[60]; /**< Pad to cache line */
+};
+
+/**
+ * DRM_IOCTL_VERSION ioctl argument type.
+ *
+ * \sa drmGetVersion().
+ */
+struct drm_version {
+ int version_major; /**< Major version */
+ int version_minor; /**< Minor version */
+ int version_patchlevel; /**< Patch level */
+ size_t name_len; /**< Length of name buffer */
+ char *name; /**< Name of driver */
+ size_t date_len; /**< Length of date buffer */
+ char *date; /**< User-space buffer to hold date */
+ size_t desc_len; /**< Length of desc buffer */
+ char *desc; /**< User-space buffer to hold desc */
+};
+
+/**
+ * DRM_IOCTL_GET_UNIQUE ioctl argument type.
+ *
+ * \sa drmGetBusid() and drmSetBusId().
+ */
+struct drm_unique {
+ size_t unique_len; /**< Length of unique */
+ char *unique; /**< Unique name for driver instantiation */
+};
+
+struct drm_list {
+ int count; /**< Length of user-space structures */
+ struct drm_version *version;
+};
+
+struct drm_block {
+ int unused;
+};
+
+/**
+ * DRM_IOCTL_CONTROL ioctl argument type.
+ *
+ * \sa drmCtlInstHandler() and drmCtlUninstHandler().
+ */
+struct drm_control {
+ enum {
+ DRM_ADD_COMMAND,
+ DRM_RM_COMMAND,
+ DRM_INST_HANDLER,
+ DRM_UNINST_HANDLER
+ } func;
+ int irq;
+};
+
+/**
+ * Type of memory to map.
+ */
+enum drm_map_type {
+ _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */
+ _DRM_REGISTERS = 1, /**< no caching, no core dump */
+ _DRM_SHM = 2, /**< shared, cached */
+ _DRM_AGP = 3, /**< AGP/GART */
+ _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */
+ _DRM_CONSISTENT = 5, /**< Consistent memory for PCI DMA */
+ _DRM_GEM = 6, /**< GEM object */
+};
+
+/**
+ * Memory mapping flags.
+ */
+enum drm_map_flags {
+ _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */
+ _DRM_READ_ONLY = 0x02,
+ _DRM_LOCKED = 0x04, /**< shared, cached, locked */
+ _DRM_KERNEL = 0x08, /**< kernel requires access */
+ _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */
+ _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */
+ _DRM_REMOVABLE = 0x40, /**< Removable mapping */
+ _DRM_DRIVER = 0x80 /**< Managed by driver */
+};
+
+struct drm_ctx_priv_map {
+ unsigned int ctx_id; /**< Context requesting private mapping */
+ void *handle; /**< Handle of map */
+};
+
+/**
+ * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls
+ * argument type.
+ *
+ * \sa drmAddMap().
+ */
+struct drm_map {
+ unsigned long offset; /**< Requested physical address (0 for SAREA)*/
+ unsigned long size; /**< Requested physical size (bytes) */
+ enum drm_map_type type; /**< Type of memory to map */
+ enum drm_map_flags flags; /**< Flags */
+ void *handle; /**< User-space: "Handle" to pass to mmap() */
+ /**< Kernel-space: kernel-virtual address */
+ int mtrr; /**< MTRR slot used */
+ /* Private data */
+};
+
+/**
+ * DRM_IOCTL_GET_CLIENT ioctl argument type.
+ */
+struct drm_client {
+ int idx; /**< Which client desired? */
+ int auth; /**< Is client authenticated? */
+ unsigned long pid; /**< Process ID */
+ unsigned long uid; /**< User ID */
+ unsigned long magic; /**< Magic */
+ unsigned long iocs; /**< Ioctl count */
+};
+
+enum drm_stat_type {
+ _DRM_STAT_LOCK,
+ _DRM_STAT_OPENS,
+ _DRM_STAT_CLOSES,
+ _DRM_STAT_IOCTLS,
+ _DRM_STAT_LOCKS,
+ _DRM_STAT_UNLOCKS,
+ _DRM_STAT_VALUE, /**< Generic value */
+ _DRM_STAT_BYTE, /**< Generic byte counter (1024bytes/K) */
+ _DRM_STAT_COUNT, /**< Generic non-byte counter (1000/k) */
+
+ _DRM_STAT_IRQ, /**< IRQ */
+ _DRM_STAT_PRIMARY, /**< Primary DMA bytes */
+ _DRM_STAT_SECONDARY, /**< Secondary DMA bytes */
+ _DRM_STAT_DMA, /**< DMA */
+ _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */
+ _DRM_STAT_MISSED /**< Missed DMA opportunity */
+ /* Add to the *END* of the list */
+};
+
+/**
+ * DRM_IOCTL_GET_STATS ioctl argument type.
+ */
+struct drm_stats {
+ unsigned long count;
+ struct {
+ unsigned long value;
+ enum drm_stat_type type;
+ } data[15];
+};
+
+/**
+ * Hardware locking flags.
+ */
+enum drm_lock_flags {
+ _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */
+ _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */
+ _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */
+ _DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */
+ /* These *HALT* flags aren't supported yet
+ -- they will be used to support the
+ full-screen DGA-like mode. */
+ _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */
+ _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */
+};
+
+/**
+ * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type.
+ *
+ * \sa drmGetLock() and drmUnlock().
+ */
+struct drm_lock {
+ int context;
+ enum drm_lock_flags flags;
+};
+
+/**
+ * DMA flags
+ *
+ * \warning
+ * These values \e must match xf86drm.h.
+ *
+ * \sa drm_dma.
+ */
+enum drm_dma_flags {
+ /* Flags for DMA buffer dispatch */
+ _DRM_DMA_BLOCK = 0x01, /**<
+ * Block until buffer dispatched.
+ *
+ * \note The buffer may not yet have
+ * been processed by the hardware --
+ * getting a hardware lock with the
+ * hardware quiescent will ensure
+ * that the buffer has been
+ * processed.
+ */
+ _DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */
+ _DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */
+
+ /* Flags for DMA buffer request */
+ _DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */
+ _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */
+ _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */
+};
+
+/**
+ * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type.
+ *
+ * \sa drmAddBufs().
+ */
+struct drm_buf_desc {
+ int count; /**< Number of buffers of this size */
+ int size; /**< Size in bytes */
+ int low_mark; /**< Low water mark */
+ int high_mark; /**< High water mark */
+ enum {
+ _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */
+ _DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */
+ _DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */
+ _DRM_FB_BUFFER = 0x08, /**< Buffer is in frame buffer */
+ _DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */
+ } flags;
+ unsigned long agp_start; /**<
+ * Start address of where the AGP buffers are
+ * in the AGP aperture
+ */
+};
+
+/**
+ * DRM_IOCTL_INFO_BUFS ioctl argument type.
+ */
+struct drm_buf_info {
+ int count; /**< Entries in list */
+ struct drm_buf_desc *list;
+};
+
+/**
+ * DRM_IOCTL_FREE_BUFS ioctl argument type.
+ */
+struct drm_buf_free {
+ int count;
+ int *list;
+};
+
+/**
+ * Buffer information
+ *
+ * \sa drm_buf_map.
+ */
+struct drm_buf_pub {
+ int idx; /**< Index into the master buffer list */
+ int total; /**< Buffer size */
+ int used; /**< Amount of buffer in use (for DMA) */
+ void *address; /**< Address of buffer */
+};
+
+/**
+ * DRM_IOCTL_MAP_BUFS ioctl argument type.
+ */
+struct drm_buf_map {
+ int count; /**< Length of the buffer list */
+ void *virtual; /**< Mmap'd area in user-virtual */
+ struct drm_buf_pub *list; /**< Buffer information */
+};
+
+/**
+ * DRM_IOCTL_DMA ioctl argument type.
+ *
+ * Indices here refer to the offset into the buffer list in drm_buf_get.
+ *
+ * \sa drmDMA().
+ */
+struct drm_dma {
+ int context; /**< Context handle */
+ int send_count; /**< Number of buffers to send */
+ int *send_indices; /**< List of handles to buffers */
+ int *send_sizes; /**< Lengths of data to send */
+ enum drm_dma_flags flags; /**< Flags */
+ int request_count; /**< Number of buffers requested */
+ int request_size; /**< Desired size for buffers */
+ int *request_indices; /**< Buffer information */
+ int *request_sizes;
+ int granted_count; /**< Number of buffers granted */
+};
+
+enum drm_ctx_flags {
+ _DRM_CONTEXT_PRESERVED = 0x01,
+ _DRM_CONTEXT_2DONLY = 0x02
+};
+
+/**
+ * DRM_IOCTL_ADD_CTX ioctl argument type.
+ *
+ * \sa drmCreateContext() and drmDestroyContext().
+ */
+struct drm_ctx {
+ drm_context_t handle;
+ enum drm_ctx_flags flags;
+};
+
+/**
+ * DRM_IOCTL_RES_CTX ioctl argument type.
+ */
+struct drm_ctx_res {
+ int count;
+ struct drm_ctx *contexts;
+};
+
+/**
+ * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type.
+ */
+struct drm_draw {
+ drm_drawable_t handle;
+};
+
+/**
+ * DRM_IOCTL_UPDATE_DRAW ioctl argument type.
+ */
+typedef enum {
+ DRM_DRAWABLE_CLIPRECTS,
+} drm_drawable_info_type_t;
+
+struct drm_update_draw {
+ drm_drawable_t handle;
+ unsigned int type;
+ unsigned int num;
+ unsigned long long data;
+};
+
+/**
+ * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type.
+ */
+struct drm_auth {
+ drm_magic_t magic;
+};
+
+/**
+ * DRM_IOCTL_IRQ_BUSID ioctl argument type.
+ *
+ * \sa drmGetInterruptFromBusID().
+ */
+struct drm_irq_busid {
+ int irq; /**< IRQ number */
+ int busnum; /**< bus number */
+ int devnum; /**< device number */
+ int funcnum; /**< function number */
+};
+
+enum drm_vblank_seq_type {
+ _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */
+ _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */
+ _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */
+ _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */
+ _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */
+ _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking, unsupported */
+};
+
+#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE)
+#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_SIGNAL | _DRM_VBLANK_SECONDARY | \
+ _DRM_VBLANK_NEXTONMISS)
+
+struct drm_wait_vblank_request {
+ enum drm_vblank_seq_type type;
+ unsigned int sequence;
+ unsigned long signal;
+};
+
+struct drm_wait_vblank_reply {
+ enum drm_vblank_seq_type type;
+ unsigned int sequence;
+ long tval_sec;
+ long tval_usec;
+};
+
+/**
+ * DRM_IOCTL_WAIT_VBLANK ioctl argument type.
+ *
+ * \sa drmWaitVBlank().
+ */
+union drm_wait_vblank {
+ struct drm_wait_vblank_request request;
+ struct drm_wait_vblank_reply reply;
+};
+
+#define _DRM_PRE_MODESET 1
+#define _DRM_POST_MODESET 2
+
+/**
+ * DRM_IOCTL_MODESET_CTL ioctl argument type
+ *
+ * \sa drmModesetCtl().
+ */
+struct drm_modeset_ctl {
+ __u32 crtc;
+ __u32 cmd;
+};
+
+/**
+ * DRM_IOCTL_AGP_ENABLE ioctl argument type.
+ *
+ * \sa drmAgpEnable().
+ */
+struct drm_agp_mode {
+ unsigned long mode; /**< AGP mode */
+};
+
+/**
+ * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type.
+ *
+ * \sa drmAgpAlloc() and drmAgpFree().
+ */
+struct drm_agp_buffer {
+ unsigned long size; /**< In bytes -- will round to page boundary */
+ unsigned long handle; /**< Used for binding / unbinding */
+ unsigned long type; /**< Type of memory to allocate */
+ unsigned long physical; /**< Physical used by i810 */
+};
+
+/**
+ * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type.
+ *
+ * \sa drmAgpBind() and drmAgpUnbind().
+ */
+struct drm_agp_binding {
+ unsigned long handle; /**< From drm_agp_buffer */
+ unsigned long offset; /**< In bytes -- will round to page boundary */
+};
+
+/**
+ * DRM_IOCTL_AGP_INFO ioctl argument type.
+ *
+ * \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(),
+ * drmAgpBase(), drmAgpSize(), drmAgpMemoryUsed(), drmAgpMemoryAvail(),
+ * drmAgpVendorId() and drmAgpDeviceId().
+ */
+struct drm_agp_info {
+ int agp_version_major;
+ int agp_version_minor;
+ unsigned long mode;
+ unsigned long aperture_base; /* physical address */
+ unsigned long aperture_size; /* bytes */
+ unsigned long memory_allowed; /* bytes */
+ unsigned long memory_used;
+
+ /* PCI information */
+ unsigned short id_vendor;
+ unsigned short id_device;
+};
+
+/**
+ * DRM_IOCTL_SG_ALLOC ioctl argument type.
+ */
+struct drm_scatter_gather {
+ unsigned long size; /**< In bytes -- will round to page boundary */
+ unsigned long handle; /**< Used for mapping / unmapping */
+};
+
+/**
+ * DRM_IOCTL_SET_VERSION ioctl argument type.
+ */
+struct drm_set_version {
+ int drm_di_major;
+ int drm_di_minor;
+ int drm_dd_major;
+ int drm_dd_minor;
+};
+
+/** DRM_IOCTL_GEM_CLOSE ioctl argument type */
+struct drm_gem_close {
+ /** Handle of the object to be closed. */
+ __u32 handle;
+ __u32 pad;
+};
+
+/** DRM_IOCTL_GEM_FLINK ioctl argument type */
+struct drm_gem_flink {
+ /** Handle for the object being named */
+ __u32 handle;
+
+ /** Returned global name */
+ __u32 name;
+};
+
+/** DRM_IOCTL_GEM_OPEN ioctl argument type */
+struct drm_gem_open {
+ /** Name of object being opened */
+ __u32 name;
+
+ /** Returned handle for the object */
+ __u32 handle;
+
+ /** Returned size of the object */
+ __u64 size;
+};
+
+#include "drm_mode.h"
+
+#define DRM_IOCTL_BASE 'd'
+#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr)
+#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type)
+#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type)
+#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type)
+
+#define DRM_IOCTL_VERSION DRM_IOWR(0x00, struct drm_version)
+#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, struct drm_unique)
+#define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, struct drm_auth)
+#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, struct drm_irq_busid)
+#define DRM_IOCTL_GET_MAP DRM_IOWR(0x04, struct drm_map)
+#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client)
+#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats)
+#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version)
+#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl)
+#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close)
+#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink)
+#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open)
+
+#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique)
+#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth)
+#define DRM_IOCTL_BLOCK DRM_IOWR(0x12, struct drm_block)
+#define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, struct drm_block)
+#define DRM_IOCTL_CONTROL DRM_IOW( 0x14, struct drm_control)
+#define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, struct drm_map)
+#define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, struct drm_buf_desc)
+#define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, struct drm_buf_desc)
+#define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, struct drm_buf_info)
+#define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, struct drm_buf_map)
+#define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, struct drm_buf_free)
+
+#define DRM_IOCTL_RM_MAP DRM_IOW( 0x1b, struct drm_map)
+
+#define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, struct drm_ctx_priv_map)
+#define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, struct drm_ctx_priv_map)
+
+#define DRM_IOCTL_SET_MASTER DRM_IO(0x1e)
+#define DRM_IOCTL_DROP_MASTER DRM_IO(0x1f)
+
+#define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, struct drm_ctx)
+#define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, struct drm_ctx)
+#define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, struct drm_ctx)
+#define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, struct drm_ctx)
+#define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, struct drm_ctx)
+#define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, struct drm_ctx)
+#define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, struct drm_ctx_res)
+#define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, struct drm_draw)
+#define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, struct drm_draw)
+#define DRM_IOCTL_DMA DRM_IOWR(0x29, struct drm_dma)
+#define DRM_IOCTL_LOCK DRM_IOW( 0x2a, struct drm_lock)
+#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock)
+#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock)
+
+#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30)
+#define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31)
+#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode)
+#define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, struct drm_agp_info)
+#define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, struct drm_agp_buffer)
+#define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, struct drm_agp_buffer)
+#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding)
+#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding)
+
+#define DRM_IOCTL_SG_ALLOC DRM_IOWR(0x38, struct drm_scatter_gather)
+#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather)
+
+#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank)
+
+#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw)
+
+#define DRM_IOCTL_MODE_GETRESOURCES DRM_IOWR(0xA0, struct drm_mode_card_res)
+#define DRM_IOCTL_MODE_GETCRTC DRM_IOWR(0xA1, struct drm_mode_crtc)
+#define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA2, struct drm_mode_crtc)
+#define DRM_IOCTL_MODE_CURSOR DRM_IOWR(0xA3, struct drm_mode_cursor)
+#define DRM_IOCTL_MODE_GETGAMMA DRM_IOWR(0xA4, struct drm_mode_crtc_lut)
+#define DRM_IOCTL_MODE_SETGAMMA DRM_IOWR(0xA5, struct drm_mode_crtc_lut)
+#define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xA6, struct drm_mode_get_encoder)
+#define DRM_IOCTL_MODE_GETCONNECTOR DRM_IOWR(0xA7, struct drm_mode_get_connector)
+#define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA8, struct drm_mode_mode_cmd)
+#define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd)
+
+#define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAA, struct drm_mode_get_property)
+#define DRM_IOCTL_MODE_SETPROPERTY DRM_IOWR(0xAB, struct drm_mode_connector_set_property)
+#define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, struct drm_mode_get_blob)
+#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd)
+#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd)
+#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int)
+
+/**
+ * Device specific ioctls should only be in their respective headers
+ * The device specific ioctl range is from 0x40 to 0x99.
+ * Generic IOCTLS restart at 0xA0.
+ *
+ * \sa drmCommandNone(), drmCommandRead(), drmCommandWrite(), and
+ * drmCommandReadWrite().
+ */
+#define DRM_COMMAND_BASE 0x40
+#define DRM_COMMAND_END 0xA0
+
+/* typedef area */
+typedef struct drm_clip_rect drm_clip_rect_t;
+typedef struct drm_drawable_info drm_drawable_info_t;
+typedef struct drm_tex_region drm_tex_region_t;
+typedef struct drm_hw_lock drm_hw_lock_t;
+typedef struct drm_version drm_version_t;
+typedef struct drm_unique drm_unique_t;
+typedef struct drm_list drm_list_t;
+typedef struct drm_block drm_block_t;
+typedef struct drm_control drm_control_t;
+typedef enum drm_map_type drm_map_type_t;
+typedef enum drm_map_flags drm_map_flags_t;
+typedef struct drm_ctx_priv_map drm_ctx_priv_map_t;
+typedef struct drm_map drm_map_t;
+typedef struct drm_client drm_client_t;
+typedef enum drm_stat_type drm_stat_type_t;
+typedef struct drm_stats drm_stats_t;
+typedef enum drm_lock_flags drm_lock_flags_t;
+typedef struct drm_lock drm_lock_t;
+typedef enum drm_dma_flags drm_dma_flags_t;
+typedef struct drm_buf_desc drm_buf_desc_t;
+typedef struct drm_buf_info drm_buf_info_t;
+typedef struct drm_buf_free drm_buf_free_t;
+typedef struct drm_buf_pub drm_buf_pub_t;
+typedef struct drm_buf_map drm_buf_map_t;
+typedef struct drm_dma drm_dma_t;
+typedef union drm_wait_vblank drm_wait_vblank_t;
+typedef struct drm_agp_mode drm_agp_mode_t;
+typedef enum drm_ctx_flags drm_ctx_flags_t;
+typedef struct drm_ctx drm_ctx_t;
+typedef struct drm_ctx_res drm_ctx_res_t;
+typedef struct drm_draw drm_draw_t;
+typedef struct drm_update_draw drm_update_draw_t;
+typedef struct drm_auth drm_auth_t;
+typedef struct drm_irq_busid drm_irq_busid_t;
+typedef enum drm_vblank_seq_type drm_vblank_seq_type_t;
+
+typedef struct drm_agp_buffer drm_agp_buffer_t;
+typedef struct drm_agp_binding drm_agp_binding_t;
+typedef struct drm_agp_info drm_agp_info_t;
+typedef struct drm_scatter_gather drm_scatter_gather_t;
+typedef struct drm_set_version drm_set_version_t;
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/drm_mode.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/drm_mode.h
new file mode 100644
index 0000000..ae304cc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/drm_mode.h
@@ -0,0 +1,268 @@
+/*
+ * Copyright (c) 2007 Dave Airlie <airlied@linux.ie>
+ * Copyright (c) 2007 Jakob Bornecrantz <wallbraker@gmail.com>
+ * Copyright (c) 2008 Red Hat Inc.
+ * Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA
+ * Copyright (c) 2007-2008 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef _DRM_MODE_H
+#define _DRM_MODE_H
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+
+#define DRM_DISPLAY_INFO_LEN 32
+#define DRM_CONNECTOR_NAME_LEN 32
+#define DRM_DISPLAY_MODE_LEN 32
+#define DRM_PROP_NAME_LEN 32
+
+#define DRM_MODE_TYPE_BUILTIN (1<<0)
+#define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN)
+#define DRM_MODE_TYPE_CRTC_C ((1<<2) | DRM_MODE_TYPE_BUILTIN)
+#define DRM_MODE_TYPE_PREFERRED (1<<3)
+#define DRM_MODE_TYPE_DEFAULT (1<<4)
+#define DRM_MODE_TYPE_USERDEF (1<<5)
+#define DRM_MODE_TYPE_DRIVER (1<<6)
+
+/* Video mode flags */
+/* bit compatible with the xorg definitions. */
+#define DRM_MODE_FLAG_PHSYNC (1<<0)
+#define DRM_MODE_FLAG_NHSYNC (1<<1)
+#define DRM_MODE_FLAG_PVSYNC (1<<2)
+#define DRM_MODE_FLAG_NVSYNC (1<<3)
+#define DRM_MODE_FLAG_INTERLACE (1<<4)
+#define DRM_MODE_FLAG_DBLSCAN (1<<5)
+#define DRM_MODE_FLAG_CSYNC (1<<6)
+#define DRM_MODE_FLAG_PCSYNC (1<<7)
+#define DRM_MODE_FLAG_NCSYNC (1<<8)
+#define DRM_MODE_FLAG_HSKEW (1<<9) /* hskew provided */
+#define DRM_MODE_FLAG_BCAST (1<<10)
+#define DRM_MODE_FLAG_PIXMUX (1<<11)
+#define DRM_MODE_FLAG_DBLCLK (1<<12)
+#define DRM_MODE_FLAG_CLKDIV2 (1<<13)
+
+/* DPMS flags */
+/* bit compatible with the xorg definitions. */
+#define DRM_MODE_DPMS_ON 0
+#define DRM_MODE_DPMS_STANDBY 1
+#define DRM_MODE_DPMS_SUSPEND 2
+#define DRM_MODE_DPMS_OFF 3
+
+/* Scaling mode options */
+#define DRM_MODE_SCALE_NON_GPU 0
+#define DRM_MODE_SCALE_FULLSCREEN 1
+#define DRM_MODE_SCALE_NO_SCALE 2
+#define DRM_MODE_SCALE_ASPECT 3
+
+/* Dithering mode options */
+#define DRM_MODE_DITHERING_OFF 0
+#define DRM_MODE_DITHERING_ON 1
+
+struct drm_mode_modeinfo {
+ __u32 clock;
+ __u16 hdisplay, hsync_start, hsync_end, htotal, hskew;
+ __u16 vdisplay, vsync_start, vsync_end, vtotal, vscan;
+
+ __u32 vrefresh; /* vertical refresh * 1000 */
+
+ __u32 flags;
+ __u32 type;
+ char name[DRM_DISPLAY_MODE_LEN];
+};
+
+struct drm_mode_card_res {
+ __u64 fb_id_ptr;
+ __u64 crtc_id_ptr;
+ __u64 connector_id_ptr;
+ __u64 encoder_id_ptr;
+ __u32 count_fbs;
+ __u32 count_crtcs;
+ __u32 count_connectors;
+ __u32 count_encoders;
+ __u32 min_width, max_width;
+ __u32 min_height, max_height;
+};
+
+struct drm_mode_crtc {
+ __u64 set_connectors_ptr;
+ __u32 count_connectors;
+
+ __u32 crtc_id; /**< Id */
+ __u32 fb_id; /**< Id of framebuffer */
+
+ __u32 x, y; /**< Position on the frameuffer */
+
+ __u32 gamma_size;
+ __u32 mode_valid;
+ struct drm_mode_modeinfo mode;
+};
+
+#define DRM_MODE_ENCODER_NONE 0
+#define DRM_MODE_ENCODER_DAC 1
+#define DRM_MODE_ENCODER_TMDS 2
+#define DRM_MODE_ENCODER_LVDS 3
+#define DRM_MODE_ENCODER_TVDAC 4
+
+struct drm_mode_get_encoder {
+ __u32 encoder_id;
+ __u32 encoder_type;
+
+ __u32 crtc_id; /**< Id of crtc */
+
+ __u32 possible_crtcs;
+ __u32 possible_clones;
+};
+
+/* This is for connectors with multiple signal types. */
+/* Try to match DRM_MODE_CONNECTOR_X as closely as possible. */
+#define DRM_MODE_SUBCONNECTOR_Automatic 0
+#define DRM_MODE_SUBCONNECTOR_Unknown 0
+#define DRM_MODE_SUBCONNECTOR_DVID 3
+#define DRM_MODE_SUBCONNECTOR_DVIA 4
+#define DRM_MODE_SUBCONNECTOR_Composite 5
+#define DRM_MODE_SUBCONNECTOR_SVIDEO 6
+#define DRM_MODE_SUBCONNECTOR_Component 8
+
+#define DRM_MODE_CONNECTOR_Unknown 0
+#define DRM_MODE_CONNECTOR_VGA 1
+#define DRM_MODE_CONNECTOR_DVII 2
+#define DRM_MODE_CONNECTOR_DVID 3
+#define DRM_MODE_CONNECTOR_DVIA 4
+#define DRM_MODE_CONNECTOR_Composite 5
+#define DRM_MODE_CONNECTOR_SVIDEO 6
+#define DRM_MODE_CONNECTOR_LVDS 7
+#define DRM_MODE_CONNECTOR_Component 8
+#define DRM_MODE_CONNECTOR_9PinDIN 9
+#define DRM_MODE_CONNECTOR_DisplayPort 10
+#define DRM_MODE_CONNECTOR_HDMIA 11
+#define DRM_MODE_CONNECTOR_HDMIB 12
+
+struct drm_mode_get_connector {
+
+ __u64 encoders_ptr;
+ __u64 modes_ptr;
+ __u64 props_ptr;
+ __u64 prop_values_ptr;
+
+ __u32 count_modes;
+ __u32 count_props;
+ __u32 count_encoders;
+
+ __u32 encoder_id; /**< Current Encoder */
+ __u32 connector_id; /**< Id */
+ __u32 connector_type;
+ __u32 connector_type_id;
+
+ __u32 connection;
+ __u32 mm_width, mm_height; /**< HxW in millimeters */
+ __u32 subpixel;
+};
+
+#define DRM_MODE_PROP_PENDING (1<<0)
+#define DRM_MODE_PROP_RANGE (1<<1)
+#define DRM_MODE_PROP_IMMUTABLE (1<<2)
+#define DRM_MODE_PROP_ENUM (1<<3) /* enumerated type with text strings */
+#define DRM_MODE_PROP_BLOB (1<<4)
+
+struct drm_mode_property_enum {
+ __u64 value;
+ char name[DRM_PROP_NAME_LEN];
+};
+
+struct drm_mode_get_property {
+ __u64 values_ptr; /* values and blob lengths */
+ __u64 enum_blob_ptr; /* enum and blob id ptrs */
+
+ __u32 prop_id;
+ __u32 flags;
+ char name[DRM_PROP_NAME_LEN];
+
+ __u32 count_values;
+ __u32 count_enum_blobs;
+};
+
+struct drm_mode_connector_set_property {
+ __u64 value;
+ __u32 prop_id;
+ __u32 connector_id;
+};
+
+struct drm_mode_get_blob {
+ __u32 blob_id;
+ __u32 length;
+ __u64 data;
+};
+
+struct drm_mode_fb_cmd {
+ __u32 fb_id;
+ __u32 width, height;
+ __u32 pitch;
+ __u32 bpp;
+ __u32 depth;
+ /* driver specific handle */
+ __u32 handle;
+};
+
+struct drm_mode_mode_cmd {
+ __u32 connector_id;
+ struct drm_mode_modeinfo mode;
+};
+
+#define DRM_MODE_CURSOR_BO (1<<0)
+#define DRM_MODE_CURSOR_MOVE (1<<1)
+
+/*
+ * depending on the value in flags diffrent members are used.
+ *
+ * CURSOR_BO uses
+ * crtc
+ * width
+ * height
+ * handle - if 0 turns the cursor of
+ *
+ * CURSOR_MOVE uses
+ * crtc
+ * x
+ * y
+ */
+struct drm_mode_cursor {
+ __u32 flags;
+ __u32 crtc_id;
+ __s32 x;
+ __s32 y;
+ __u32 width;
+ __u32 height;
+ /* driver specific handle */
+ __u32 handle;
+};
+
+struct drm_mode_crtc_lut {
+ __u32 crtc_id;
+ __u32 gamma_size;
+
+ /* pointers to arrays */
+ __u64 red;
+ __u64 green;
+ __u64 blue;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/drm_sarea.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/drm_sarea.h
new file mode 100644
index 0000000..7325558
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/drm_sarea.h
@@ -0,0 +1,82 @@
+/**
+ * \file drm_sarea.h
+ * \brief SAREA definitions
+ *
+ * \author Michel Dänzer <michel@daenzer.net>
+ */
+
+/*
+ * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _DRM_SAREA_H_
+#define _DRM_SAREA_H_
+
+#include "drm.h"
+
+/* SAREA area needs to be at least a page */
+#if defined(__alpha__)
+#define SAREA_MAX 0x2000U
+#elif defined(__ia64__)
+#define SAREA_MAX 0x10000U /* 64kB */
+#else
+/* Intel 830M driver needs at least 8k SAREA */
+#define SAREA_MAX 0x2000U
+#endif
+
+/** Maximum number of drawables in the SAREA */
+#define SAREA_MAX_DRAWABLES 256
+
+#define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000
+
+/** SAREA drawable */
+struct drm_sarea_drawable {
+ unsigned int stamp;
+ unsigned int flags;
+};
+
+/** SAREA frame */
+struct drm_sarea_frame {
+ unsigned int x;
+ unsigned int y;
+ unsigned int width;
+ unsigned int height;
+ unsigned int fullscreen;
+};
+
+/** SAREA */
+struct drm_sarea {
+ /** first thing is always the DRM locking structure */
+ struct drm_hw_lock lock;
+ /** \todo Use readers/writer lock for drm_sarea::drawable_lock */
+ struct drm_hw_lock drawable_lock;
+ struct drm_sarea_drawable drawableTable[SAREA_MAX_DRAWABLES]; /**< drawables */
+ struct drm_sarea_frame frame; /**< frame */
+ drm_context_t dummy_context;
+};
+
+typedef struct drm_sarea_drawable drm_sarea_drawable_t;
+typedef struct drm_sarea_frame drm_sarea_frame_t;
+typedef struct drm_sarea drm_sarea_t;
+
+#endif /* _DRM_SAREA_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/i810_drm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/i810_drm.h
new file mode 100644
index 0000000..7a10bb6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/i810_drm.h
@@ -0,0 +1,281 @@
+#ifndef _I810_DRM_H_
+#define _I810_DRM_H_
+
+/* WARNING: These defines must be the same as what the Xserver uses.
+ * if you change them, you must change the defines in the Xserver.
+ */
+
+#ifndef _I810_DEFINES_
+#define _I810_DEFINES_
+
+#define I810_DMA_BUF_ORDER 12
+#define I810_DMA_BUF_SZ (1<<I810_DMA_BUF_ORDER)
+#define I810_DMA_BUF_NR 256
+#define I810_NR_SAREA_CLIPRECTS 8
+
+/* Each region is a minimum of 64k, and there are at most 64 of them.
+ */
+#define I810_NR_TEX_REGIONS 64
+#define I810_LOG_MIN_TEX_REGION_SIZE 16
+#endif
+
+#define I810_UPLOAD_TEX0IMAGE 0x1 /* handled clientside */
+#define I810_UPLOAD_TEX1IMAGE 0x2 /* handled clientside */
+#define I810_UPLOAD_CTX 0x4
+#define I810_UPLOAD_BUFFERS 0x8
+#define I810_UPLOAD_TEX0 0x10
+#define I810_UPLOAD_TEX1 0x20
+#define I810_UPLOAD_CLIPRECTS 0x40
+
+/* Indices into buf.Setup where various bits of state are mirrored per
+ * context and per buffer. These can be fired at the card as a unit,
+ * or in a piecewise fashion as required.
+ */
+
+/* Destbuffer state
+ * - backbuffer linear offset and pitch -- invarient in the current dri
+ * - zbuffer linear offset and pitch -- also invarient
+ * - drawing origin in back and depth buffers.
+ *
+ * Keep the depth/back buffer state here to accommodate private buffers
+ * in the future.
+ */
+#define I810_DESTREG_DI0 0 /* CMD_OP_DESTBUFFER_INFO (2 dwords) */
+#define I810_DESTREG_DI1 1
+#define I810_DESTREG_DV0 2 /* GFX_OP_DESTBUFFER_VARS (2 dwords) */
+#define I810_DESTREG_DV1 3
+#define I810_DESTREG_DR0 4 /* GFX_OP_DRAWRECT_INFO (4 dwords) */
+#define I810_DESTREG_DR1 5
+#define I810_DESTREG_DR2 6
+#define I810_DESTREG_DR3 7
+#define I810_DESTREG_DR4 8
+#define I810_DEST_SETUP_SIZE 10
+
+/* Context state
+ */
+#define I810_CTXREG_CF0 0 /* GFX_OP_COLOR_FACTOR */
+#define I810_CTXREG_CF1 1
+#define I810_CTXREG_ST0 2 /* GFX_OP_STIPPLE */
+#define I810_CTXREG_ST1 3
+#define I810_CTXREG_VF 4 /* GFX_OP_VERTEX_FMT */
+#define I810_CTXREG_MT 5 /* GFX_OP_MAP_TEXELS */
+#define I810_CTXREG_MC0 6 /* GFX_OP_MAP_COLOR_STAGES - stage 0 */
+#define I810_CTXREG_MC1 7 /* GFX_OP_MAP_COLOR_STAGES - stage 1 */
+#define I810_CTXREG_MC2 8 /* GFX_OP_MAP_COLOR_STAGES - stage 2 */
+#define I810_CTXREG_MA0 9 /* GFX_OP_MAP_ALPHA_STAGES - stage 0 */
+#define I810_CTXREG_MA1 10 /* GFX_OP_MAP_ALPHA_STAGES - stage 1 */
+#define I810_CTXREG_MA2 11 /* GFX_OP_MAP_ALPHA_STAGES - stage 2 */
+#define I810_CTXREG_SDM 12 /* GFX_OP_SRC_DEST_MONO */
+#define I810_CTXREG_FOG 13 /* GFX_OP_FOG_COLOR */
+#define I810_CTXREG_B1 14 /* GFX_OP_BOOL_1 */
+#define I810_CTXREG_B2 15 /* GFX_OP_BOOL_2 */
+#define I810_CTXREG_LCS 16 /* GFX_OP_LINEWIDTH_CULL_SHADE_MODE */
+#define I810_CTXREG_PV 17 /* GFX_OP_PV_RULE -- Invarient! */
+#define I810_CTXREG_ZA 18 /* GFX_OP_ZBIAS_ALPHAFUNC */
+#define I810_CTXREG_AA 19 /* GFX_OP_ANTIALIAS */
+#define I810_CTX_SETUP_SIZE 20
+
+/* Texture state (per tex unit)
+ */
+#define I810_TEXREG_MI0 0 /* GFX_OP_MAP_INFO (4 dwords) */
+#define I810_TEXREG_MI1 1
+#define I810_TEXREG_MI2 2
+#define I810_TEXREG_MI3 3
+#define I810_TEXREG_MF 4 /* GFX_OP_MAP_FILTER */
+#define I810_TEXREG_MLC 5 /* GFX_OP_MAP_LOD_CTL */
+#define I810_TEXREG_MLL 6 /* GFX_OP_MAP_LOD_LIMITS */
+#define I810_TEXREG_MCS 7 /* GFX_OP_MAP_COORD_SETS ??? */
+#define I810_TEX_SETUP_SIZE 8
+
+/* Flags for clear ioctl
+ */
+#define I810_FRONT 0x1
+#define I810_BACK 0x2
+#define I810_DEPTH 0x4
+
+typedef enum _drm_i810_init_func {
+ I810_INIT_DMA = 0x01,
+ I810_CLEANUP_DMA = 0x02,
+ I810_INIT_DMA_1_4 = 0x03
+} drm_i810_init_func_t;
+
+/* This is the init structure after v1.2 */
+typedef struct _drm_i810_init {
+ drm_i810_init_func_t func;
+ unsigned int mmio_offset;
+ unsigned int buffers_offset;
+ int sarea_priv_offset;
+ unsigned int ring_start;
+ unsigned int ring_end;
+ unsigned int ring_size;
+ unsigned int front_offset;
+ unsigned int back_offset;
+ unsigned int depth_offset;
+ unsigned int overlay_offset;
+ unsigned int overlay_physical;
+ unsigned int w;
+ unsigned int h;
+ unsigned int pitch;
+ unsigned int pitch_bits;
+} drm_i810_init_t;
+
+/* This is the init structure prior to v1.2 */
+typedef struct _drm_i810_pre12_init {
+ drm_i810_init_func_t func;
+ unsigned int mmio_offset;
+ unsigned int buffers_offset;
+ int sarea_priv_offset;
+ unsigned int ring_start;
+ unsigned int ring_end;
+ unsigned int ring_size;
+ unsigned int front_offset;
+ unsigned int back_offset;
+ unsigned int depth_offset;
+ unsigned int w;
+ unsigned int h;
+ unsigned int pitch;
+ unsigned int pitch_bits;
+} drm_i810_pre12_init_t;
+
+/* Warning: If you change the SAREA structure you must change the Xserver
+ * structure as well */
+
+typedef struct _drm_i810_tex_region {
+ unsigned char next, prev; /* indices to form a circular LRU */
+ unsigned char in_use; /* owned by a client, or free? */
+ int age; /* tracked by clients to update local LRU's */
+} drm_i810_tex_region_t;
+
+typedef struct _drm_i810_sarea {
+ unsigned int ContextState[I810_CTX_SETUP_SIZE];
+ unsigned int BufferState[I810_DEST_SETUP_SIZE];
+ unsigned int TexState[2][I810_TEX_SETUP_SIZE];
+ unsigned int dirty;
+
+ unsigned int nbox;
+ struct drm_clip_rect boxes[I810_NR_SAREA_CLIPRECTS];
+
+ /* Maintain an LRU of contiguous regions of texture space. If
+ * you think you own a region of texture memory, and it has an
+ * age different to the one you set, then you are mistaken and
+ * it has been stolen by another client. If global texAge
+ * hasn't changed, there is no need to walk the list.
+ *
+ * These regions can be used as a proxy for the fine-grained
+ * texture information of other clients - by maintaining them
+ * in the same lru which is used to age their own textures,
+ * clients have an approximate lru for the whole of global
+ * texture space, and can make informed decisions as to which
+ * areas to kick out. There is no need to choose whether to
+ * kick out your own texture or someone else's - simply eject
+ * them all in LRU order.
+ */
+
+ drm_i810_tex_region_t texList[I810_NR_TEX_REGIONS + 1];
+ /* Last elt is sentinal */
+ int texAge; /* last time texture was uploaded */
+ int last_enqueue; /* last time a buffer was enqueued */
+ int last_dispatch; /* age of the most recently dispatched buffer */
+ int last_quiescent; /* */
+ int ctxOwner; /* last context to upload state */
+
+ int vertex_prim;
+
+ int pf_enabled; /* is pageflipping allowed? */
+ int pf_active;
+ int pf_current_page; /* which buffer is being displayed? */
+} drm_i810_sarea_t;
+
+/* WARNING: If you change any of these defines, make sure to change the
+ * defines in the Xserver file (xf86drmMga.h)
+ */
+
+/* i810 specific ioctls
+ * The device specific ioctl range is 0x40 to 0x79.
+ */
+#define DRM_I810_INIT 0x00
+#define DRM_I810_VERTEX 0x01
+#define DRM_I810_CLEAR 0x02
+#define DRM_I810_FLUSH 0x03
+#define DRM_I810_GETAGE 0x04
+#define DRM_I810_GETBUF 0x05
+#define DRM_I810_SWAP 0x06
+#define DRM_I810_COPY 0x07
+#define DRM_I810_DOCOPY 0x08
+#define DRM_I810_OV0INFO 0x09
+#define DRM_I810_FSTATUS 0x0a
+#define DRM_I810_OV0FLIP 0x0b
+#define DRM_I810_MC 0x0c
+#define DRM_I810_RSTATUS 0x0d
+#define DRM_I810_FLIP 0x0e
+
+#define DRM_IOCTL_I810_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I810_INIT, drm_i810_init_t)
+#define DRM_IOCTL_I810_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_I810_VERTEX, drm_i810_vertex_t)
+#define DRM_IOCTL_I810_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_I810_CLEAR, drm_i810_clear_t)
+#define DRM_IOCTL_I810_FLUSH DRM_IO( DRM_COMMAND_BASE + DRM_I810_FLUSH)
+#define DRM_IOCTL_I810_GETAGE DRM_IO( DRM_COMMAND_BASE + DRM_I810_GETAGE)
+#define DRM_IOCTL_I810_GETBUF DRM_IOWR(DRM_COMMAND_BASE + DRM_I810_GETBUF, drm_i810_dma_t)
+#define DRM_IOCTL_I810_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_I810_SWAP)
+#define DRM_IOCTL_I810_COPY DRM_IOW( DRM_COMMAND_BASE + DRM_I810_COPY, drm_i810_copy_t)
+#define DRM_IOCTL_I810_DOCOPY DRM_IO( DRM_COMMAND_BASE + DRM_I810_DOCOPY)
+#define DRM_IOCTL_I810_OV0INFO DRM_IOR( DRM_COMMAND_BASE + DRM_I810_OV0INFO, drm_i810_overlay_t)
+#define DRM_IOCTL_I810_FSTATUS DRM_IO ( DRM_COMMAND_BASE + DRM_I810_FSTATUS)
+#define DRM_IOCTL_I810_OV0FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I810_OV0FLIP)
+#define DRM_IOCTL_I810_MC DRM_IOW( DRM_COMMAND_BASE + DRM_I810_MC, drm_i810_mc_t)
+#define DRM_IOCTL_I810_RSTATUS DRM_IO ( DRM_COMMAND_BASE + DRM_I810_RSTATUS)
+#define DRM_IOCTL_I810_FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I810_FLIP)
+
+typedef struct _drm_i810_clear {
+ int clear_color;
+ int clear_depth;
+ int flags;
+} drm_i810_clear_t;
+
+/* These may be placeholders if we have more cliprects than
+ * I810_NR_SAREA_CLIPRECTS. In that case, the client sets discard to
+ * false, indicating that the buffer will be dispatched again with a
+ * new set of cliprects.
+ */
+typedef struct _drm_i810_vertex {
+ int idx; /* buffer index */
+ int used; /* nr bytes in use */
+ int discard; /* client is finished with the buffer? */
+} drm_i810_vertex_t;
+
+typedef struct _drm_i810_copy_t {
+ int idx; /* buffer index */
+ int used; /* nr bytes in use */
+ void *address; /* Address to copy from */
+} drm_i810_copy_t;
+
+#define PR_TRIANGLES (0x0<<18)
+#define PR_TRISTRIP_0 (0x1<<18)
+#define PR_TRISTRIP_1 (0x2<<18)
+#define PR_TRIFAN (0x3<<18)
+#define PR_POLYGON (0x4<<18)
+#define PR_LINES (0x5<<18)
+#define PR_LINESTRIP (0x6<<18)
+#define PR_RECTS (0x7<<18)
+#define PR_MASK (0x7<<18)
+
+typedef struct drm_i810_dma {
+ void *virtual;
+ int request_idx;
+ int request_size;
+ int granted;
+} drm_i810_dma_t;
+
+typedef struct _drm_i810_overlay_t {
+ unsigned int offset; /* Address of the Overlay Regs */
+ unsigned int physical;
+} drm_i810_overlay_t;
+
+typedef struct _drm_i810_mc {
+ int idx; /* buffer index */
+ int used; /* nr bytes in use */
+ int num_blocks; /* number of GFXBlocks */
+ int *length; /* List of lengths for GFXBlocks (FUTURE) */
+ unsigned int last_render; /* Last Render Request */
+} drm_i810_mc_t;
+
+#endif /* _I810_DRM_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/i830_drm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/i830_drm.h
new file mode 100644
index 0000000..e1b08e4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/i830_drm.h
@@ -0,0 +1,342 @@
+#ifndef _I830_DRM_H_
+#define _I830_DRM_H_
+
+/* WARNING: These defines must be the same as what the Xserver uses.
+ * if you change them, you must change the defines in the Xserver.
+ *
+ * KW: Actually, you can't ever change them because doing so would
+ * break backwards compatibility.
+ */
+
+#ifndef _I830_DEFINES_
+#define _I830_DEFINES_
+
+#define I830_DMA_BUF_ORDER 12
+#define I830_DMA_BUF_SZ (1<<I830_DMA_BUF_ORDER)
+#define I830_DMA_BUF_NR 256
+#define I830_NR_SAREA_CLIPRECTS 8
+
+/* Each region is a minimum of 64k, and there are at most 64 of them.
+ */
+#define I830_NR_TEX_REGIONS 64
+#define I830_LOG_MIN_TEX_REGION_SIZE 16
+
+/* KW: These aren't correct but someone set them to two and then
+ * released the module. Now we can't change them as doing so would
+ * break backwards compatibility.
+ */
+#define I830_TEXTURE_COUNT 2
+#define I830_TEXBLEND_COUNT I830_TEXTURE_COUNT
+
+#define I830_TEXBLEND_SIZE 12 /* (4 args + op) * 2 + COLOR_FACTOR */
+
+#define I830_UPLOAD_CTX 0x1
+#define I830_UPLOAD_BUFFERS 0x2
+#define I830_UPLOAD_CLIPRECTS 0x4
+#define I830_UPLOAD_TEX0_IMAGE 0x100 /* handled clientside */
+#define I830_UPLOAD_TEX0_CUBE 0x200 /* handled clientside */
+#define I830_UPLOAD_TEX1_IMAGE 0x400 /* handled clientside */
+#define I830_UPLOAD_TEX1_CUBE 0x800 /* handled clientside */
+#define I830_UPLOAD_TEX2_IMAGE 0x1000 /* handled clientside */
+#define I830_UPLOAD_TEX2_CUBE 0x2000 /* handled clientside */
+#define I830_UPLOAD_TEX3_IMAGE 0x4000 /* handled clientside */
+#define I830_UPLOAD_TEX3_CUBE 0x8000 /* handled clientside */
+#define I830_UPLOAD_TEX_N_IMAGE(n) (0x100 << (n * 2))
+#define I830_UPLOAD_TEX_N_CUBE(n) (0x200 << (n * 2))
+#define I830_UPLOAD_TEXIMAGE_MASK 0xff00
+#define I830_UPLOAD_TEX0 0x10000
+#define I830_UPLOAD_TEX1 0x20000
+#define I830_UPLOAD_TEX2 0x40000
+#define I830_UPLOAD_TEX3 0x80000
+#define I830_UPLOAD_TEX_N(n) (0x10000 << (n))
+#define I830_UPLOAD_TEX_MASK 0xf0000
+#define I830_UPLOAD_TEXBLEND0 0x100000
+#define I830_UPLOAD_TEXBLEND1 0x200000
+#define I830_UPLOAD_TEXBLEND2 0x400000
+#define I830_UPLOAD_TEXBLEND3 0x800000
+#define I830_UPLOAD_TEXBLEND_N(n) (0x100000 << (n))
+#define I830_UPLOAD_TEXBLEND_MASK 0xf00000
+#define I830_UPLOAD_TEX_PALETTE_N(n) (0x1000000 << (n))
+#define I830_UPLOAD_TEX_PALETTE_SHARED 0x4000000
+#define I830_UPLOAD_STIPPLE 0x8000000
+
+/* Indices into buf.Setup where various bits of state are mirrored per
+ * context and per buffer. These can be fired at the card as a unit,
+ * or in a piecewise fashion as required.
+ */
+
+/* Destbuffer state
+ * - backbuffer linear offset and pitch -- invarient in the current dri
+ * - zbuffer linear offset and pitch -- also invarient
+ * - drawing origin in back and depth buffers.
+ *
+ * Keep the depth/back buffer state here to accommodate private buffers
+ * in the future.
+ */
+
+#define I830_DESTREG_CBUFADDR 0
+#define I830_DESTREG_DBUFADDR 1
+#define I830_DESTREG_DV0 2
+#define I830_DESTREG_DV1 3
+#define I830_DESTREG_SENABLE 4
+#define I830_DESTREG_SR0 5
+#define I830_DESTREG_SR1 6
+#define I830_DESTREG_SR2 7
+#define I830_DESTREG_DR0 8
+#define I830_DESTREG_DR1 9
+#define I830_DESTREG_DR2 10
+#define I830_DESTREG_DR3 11
+#define I830_DESTREG_DR4 12
+#define I830_DEST_SETUP_SIZE 13
+
+/* Context state
+ */
+#define I830_CTXREG_STATE1 0
+#define I830_CTXREG_STATE2 1
+#define I830_CTXREG_STATE3 2
+#define I830_CTXREG_STATE4 3
+#define I830_CTXREG_STATE5 4
+#define I830_CTXREG_IALPHAB 5
+#define I830_CTXREG_STENCILTST 6
+#define I830_CTXREG_ENABLES_1 7
+#define I830_CTXREG_ENABLES_2 8
+#define I830_CTXREG_AA 9
+#define I830_CTXREG_FOGCOLOR 10
+#define I830_CTXREG_BLENDCOLR0 11
+#define I830_CTXREG_BLENDCOLR 12 /* Dword 1 of 2 dword command */
+#define I830_CTXREG_VF 13
+#define I830_CTXREG_VF2 14
+#define I830_CTXREG_MCSB0 15
+#define I830_CTXREG_MCSB1 16
+#define I830_CTX_SETUP_SIZE 17
+
+/* 1.3: Stipple state
+ */
+#define I830_STPREG_ST0 0
+#define I830_STPREG_ST1 1
+#define I830_STP_SETUP_SIZE 2
+
+/* Texture state (per tex unit)
+ */
+
+#define I830_TEXREG_MI0 0 /* GFX_OP_MAP_INFO (6 dwords) */
+#define I830_TEXREG_MI1 1
+#define I830_TEXREG_MI2 2
+#define I830_TEXREG_MI3 3
+#define I830_TEXREG_MI4 4
+#define I830_TEXREG_MI5 5
+#define I830_TEXREG_MF 6 /* GFX_OP_MAP_FILTER */
+#define I830_TEXREG_MLC 7 /* GFX_OP_MAP_LOD_CTL */
+#define I830_TEXREG_MLL 8 /* GFX_OP_MAP_LOD_LIMITS */
+#define I830_TEXREG_MCS 9 /* GFX_OP_MAP_COORD_SETS */
+#define I830_TEX_SETUP_SIZE 10
+
+#define I830_TEXREG_TM0LI 0 /* load immediate 2 texture map n */
+#define I830_TEXREG_TM0S0 1
+#define I830_TEXREG_TM0S1 2
+#define I830_TEXREG_TM0S2 3
+#define I830_TEXREG_TM0S3 4
+#define I830_TEXREG_TM0S4 5
+#define I830_TEXREG_NOP0 6 /* noop */
+#define I830_TEXREG_NOP1 7 /* noop */
+#define I830_TEXREG_NOP2 8 /* noop */
+#define __I830_TEXREG_MCS 9 /* GFX_OP_MAP_COORD_SETS -- shared */
+#define __I830_TEX_SETUP_SIZE 10
+
+#define I830_FRONT 0x1
+#define I830_BACK 0x2
+#define I830_DEPTH 0x4
+
+#endif /* _I830_DEFINES_ */
+
+typedef struct _drm_i830_init {
+ enum {
+ I830_INIT_DMA = 0x01,
+ I830_CLEANUP_DMA = 0x02
+ } func;
+ unsigned int mmio_offset;
+ unsigned int buffers_offset;
+ int sarea_priv_offset;
+ unsigned int ring_start;
+ unsigned int ring_end;
+ unsigned int ring_size;
+ unsigned int front_offset;
+ unsigned int back_offset;
+ unsigned int depth_offset;
+ unsigned int w;
+ unsigned int h;
+ unsigned int pitch;
+ unsigned int pitch_bits;
+ unsigned int back_pitch;
+ unsigned int depth_pitch;
+ unsigned int cpp;
+} drm_i830_init_t;
+
+/* Warning: If you change the SAREA structure you must change the Xserver
+ * structure as well */
+
+typedef struct _drm_i830_tex_region {
+ unsigned char next, prev; /* indices to form a circular LRU */
+ unsigned char in_use; /* owned by a client, or free? */
+ int age; /* tracked by clients to update local LRU's */
+} drm_i830_tex_region_t;
+
+typedef struct _drm_i830_sarea {
+ unsigned int ContextState[I830_CTX_SETUP_SIZE];
+ unsigned int BufferState[I830_DEST_SETUP_SIZE];
+ unsigned int TexState[I830_TEXTURE_COUNT][I830_TEX_SETUP_SIZE];
+ unsigned int TexBlendState[I830_TEXBLEND_COUNT][I830_TEXBLEND_SIZE];
+ unsigned int TexBlendStateWordsUsed[I830_TEXBLEND_COUNT];
+ unsigned int Palette[2][256];
+ unsigned int dirty;
+
+ unsigned int nbox;
+ struct drm_clip_rect boxes[I830_NR_SAREA_CLIPRECTS];
+
+ /* Maintain an LRU of contiguous regions of texture space. If
+ * you think you own a region of texture memory, and it has an
+ * age different to the one you set, then you are mistaken and
+ * it has been stolen by another client. If global texAge
+ * hasn't changed, there is no need to walk the list.
+ *
+ * These regions can be used as a proxy for the fine-grained
+ * texture information of other clients - by maintaining them
+ * in the same lru which is used to age their own textures,
+ * clients have an approximate lru for the whole of global
+ * texture space, and can make informed decisions as to which
+ * areas to kick out. There is no need to choose whether to
+ * kick out your own texture or someone else's - simply eject
+ * them all in LRU order.
+ */
+
+ drm_i830_tex_region_t texList[I830_NR_TEX_REGIONS + 1];
+ /* Last elt is sentinal */
+ int texAge; /* last time texture was uploaded */
+ int last_enqueue; /* last time a buffer was enqueued */
+ int last_dispatch; /* age of the most recently dispatched buffer */
+ int last_quiescent; /* */
+ int ctxOwner; /* last context to upload state */
+
+ int vertex_prim;
+
+ int pf_enabled; /* is pageflipping allowed? */
+ int pf_active;
+ int pf_current_page; /* which buffer is being displayed? */
+
+ int perf_boxes; /* performance boxes to be displayed */
+
+ /* Here's the state for texunits 2,3:
+ */
+ unsigned int TexState2[I830_TEX_SETUP_SIZE];
+ unsigned int TexBlendState2[I830_TEXBLEND_SIZE];
+ unsigned int TexBlendStateWordsUsed2;
+
+ unsigned int TexState3[I830_TEX_SETUP_SIZE];
+ unsigned int TexBlendState3[I830_TEXBLEND_SIZE];
+ unsigned int TexBlendStateWordsUsed3;
+
+ unsigned int StippleState[I830_STP_SETUP_SIZE];
+} drm_i830_sarea_t;
+
+/* Flags for perf_boxes
+ */
+#define I830_BOX_RING_EMPTY 0x1 /* populated by kernel */
+#define I830_BOX_FLIP 0x2 /* populated by kernel */
+#define I830_BOX_WAIT 0x4 /* populated by kernel & client */
+#define I830_BOX_TEXTURE_LOAD 0x8 /* populated by kernel */
+#define I830_BOX_LOST_CONTEXT 0x10 /* populated by client */
+
+/* I830 specific ioctls
+ * The device specific ioctl range is 0x40 to 0x79.
+ */
+#define DRM_I830_INIT 0x00
+#define DRM_I830_VERTEX 0x01
+#define DRM_I830_CLEAR 0x02
+#define DRM_I830_FLUSH 0x03
+#define DRM_I830_GETAGE 0x04
+#define DRM_I830_GETBUF 0x05
+#define DRM_I830_SWAP 0x06
+#define DRM_I830_COPY 0x07
+#define DRM_I830_DOCOPY 0x08
+#define DRM_I830_FLIP 0x09
+#define DRM_I830_IRQ_EMIT 0x0a
+#define DRM_I830_IRQ_WAIT 0x0b
+#define DRM_I830_GETPARAM 0x0c
+#define DRM_I830_SETPARAM 0x0d
+
+#define DRM_IOCTL_I830_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_IOCTL_I830_INIT, drm_i830_init_t)
+#define DRM_IOCTL_I830_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_IOCTL_I830_VERTEX, drm_i830_vertex_t)
+#define DRM_IOCTL_I830_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_IOCTL_I830_CLEAR, drm_i830_clear_t)
+#define DRM_IOCTL_I830_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_IOCTL_I830_FLUSH)
+#define DRM_IOCTL_I830_GETAGE DRM_IO ( DRM_COMMAND_BASE + DRM_IOCTL_I830_GETAGE)
+#define DRM_IOCTL_I830_GETBUF DRM_IOWR(DRM_COMMAND_BASE + DRM_IOCTL_I830_GETBUF, drm_i830_dma_t)
+#define DRM_IOCTL_I830_SWAP DRM_IO ( DRM_COMMAND_BASE + DRM_IOCTL_I830_SWAP)
+#define DRM_IOCTL_I830_COPY DRM_IOW( DRM_COMMAND_BASE + DRM_IOCTL_I830_COPY, drm_i830_copy_t)
+#define DRM_IOCTL_I830_DOCOPY DRM_IO ( DRM_COMMAND_BASE + DRM_IOCTL_I830_DOCOPY)
+#define DRM_IOCTL_I830_FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_IOCTL_I830_FLIP)
+#define DRM_IOCTL_I830_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_IOCTL_I830_IRQ_EMIT, drm_i830_irq_emit_t)
+#define DRM_IOCTL_I830_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_IOCTL_I830_IRQ_WAIT, drm_i830_irq_wait_t)
+#define DRM_IOCTL_I830_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_IOCTL_I830_GETPARAM, drm_i830_getparam_t)
+#define DRM_IOCTL_I830_SETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_IOCTL_I830_SETPARAM, drm_i830_setparam_t)
+
+typedef struct _drm_i830_clear {
+ int clear_color;
+ int clear_depth;
+ int flags;
+ unsigned int clear_colormask;
+ unsigned int clear_depthmask;
+} drm_i830_clear_t;
+
+/* These may be placeholders if we have more cliprects than
+ * I830_NR_SAREA_CLIPRECTS. In that case, the client sets discard to
+ * false, indicating that the buffer will be dispatched again with a
+ * new set of cliprects.
+ */
+typedef struct _drm_i830_vertex {
+ int idx; /* buffer index */
+ int used; /* nr bytes in use */
+ int discard; /* client is finished with the buffer? */
+} drm_i830_vertex_t;
+
+typedef struct _drm_i830_copy_t {
+ int idx; /* buffer index */
+ int used; /* nr bytes in use */
+ void *address; /* Address to copy from */
+} drm_i830_copy_t;
+
+typedef struct drm_i830_dma {
+ void *virtual;
+ int request_idx;
+ int request_size;
+ int granted;
+} drm_i830_dma_t;
+
+/* 1.3: Userspace can request & wait on irq's:
+ */
+typedef struct drm_i830_irq_emit {
+ int *irq_seq;
+} drm_i830_irq_emit_t;
+
+typedef struct drm_i830_irq_wait {
+ int irq_seq;
+} drm_i830_irq_wait_t;
+
+/* 1.3: New ioctl to query kernel params:
+ */
+#define I830_PARAM_IRQ_ACTIVE 1
+
+typedef struct drm_i830_getparam {
+ int param;
+ int *value;
+} drm_i830_getparam_t;
+
+/* 1.3: New ioctl to set kernel params:
+ */
+#define I830_SETPARAM_USE_MI_BATCHBUFFER_START 1
+
+typedef struct drm_i830_setparam {
+ int param;
+ int value;
+} drm_i830_setparam_t;
+
+#endif /* _I830_DRM_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/i915_drm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/i915_drm.h
new file mode 100644
index 0000000..da7b995
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/i915_drm.h
@@ -0,0 +1,670 @@
+/*
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef _I915_DRM_H_
+#define _I915_DRM_H_
+
+/* Please note that modifications to all structs defined here are
+ * subject to backwards-compatibility constraints.
+ */
+#include <linux/types.h>
+#include "drm.h"
+
+/* Each region is a minimum of 16k, and there are at most 255 of them.
+ */
+#define I915_NR_TEX_REGIONS 255 /* table size 2k - maximum due to use
+ * of chars for next/prev indices */
+#define I915_LOG_MIN_TEX_REGION_SIZE 14
+
+typedef struct _drm_i915_init {
+ enum {
+ I915_INIT_DMA = 0x01,
+ I915_CLEANUP_DMA = 0x02,
+ I915_RESUME_DMA = 0x03
+ } func;
+ unsigned int mmio_offset;
+ int sarea_priv_offset;
+ unsigned int ring_start;
+ unsigned int ring_end;
+ unsigned int ring_size;
+ unsigned int front_offset;
+ unsigned int back_offset;
+ unsigned int depth_offset;
+ unsigned int w;
+ unsigned int h;
+ unsigned int pitch;
+ unsigned int pitch_bits;
+ unsigned int back_pitch;
+ unsigned int depth_pitch;
+ unsigned int cpp;
+ unsigned int chipset;
+} drm_i915_init_t;
+
+typedef struct _drm_i915_sarea {
+ struct drm_tex_region texList[I915_NR_TEX_REGIONS + 1];
+ int last_upload; /* last time texture was uploaded */
+ int last_enqueue; /* last time a buffer was enqueued */
+ int last_dispatch; /* age of the most recently dispatched buffer */
+ int ctxOwner; /* last context to upload state */
+ int texAge;
+ int pf_enabled; /* is pageflipping allowed? */
+ int pf_active;
+ int pf_current_page; /* which buffer is being displayed? */
+ int perf_boxes; /* performance boxes to be displayed */
+ int width, height; /* screen size in pixels */
+
+ drm_handle_t front_handle;
+ int front_offset;
+ int front_size;
+
+ drm_handle_t back_handle;
+ int back_offset;
+ int back_size;
+
+ drm_handle_t depth_handle;
+ int depth_offset;
+ int depth_size;
+
+ drm_handle_t tex_handle;
+ int tex_offset;
+ int tex_size;
+ int log_tex_granularity;
+ int pitch;
+ int rotation; /* 0, 90, 180 or 270 */
+ int rotated_offset;
+ int rotated_size;
+ int rotated_pitch;
+ int virtualX, virtualY;
+
+ unsigned int front_tiled;
+ unsigned int back_tiled;
+ unsigned int depth_tiled;
+ unsigned int rotated_tiled;
+ unsigned int rotated2_tiled;
+
+ int pipeA_x;
+ int pipeA_y;
+ int pipeA_w;
+ int pipeA_h;
+ int pipeB_x;
+ int pipeB_y;
+ int pipeB_w;
+ int pipeB_h;
+
+ /* fill out some space for old userspace triple buffer */
+ drm_handle_t unused_handle;
+ __u32 unused1, unused2, unused3;
+
+ /* buffer object handles for static buffers. May change
+ * over the lifetime of the client.
+ */
+ __u32 front_bo_handle;
+ __u32 back_bo_handle;
+ __u32 unused_bo_handle;
+ __u32 depth_bo_handle;
+
+} drm_i915_sarea_t;
+
+/* due to userspace building against these headers we need some compat here */
+#define planeA_x pipeA_x
+#define planeA_y pipeA_y
+#define planeA_w pipeA_w
+#define planeA_h pipeA_h
+#define planeB_x pipeB_x
+#define planeB_y pipeB_y
+#define planeB_w pipeB_w
+#define planeB_h pipeB_h
+
+/* Flags for perf_boxes
+ */
+#define I915_BOX_RING_EMPTY 0x1
+#define I915_BOX_FLIP 0x2
+#define I915_BOX_WAIT 0x4
+#define I915_BOX_TEXTURE_LOAD 0x8
+#define I915_BOX_LOST_CONTEXT 0x10
+
+/* I915 specific ioctls
+ * The device specific ioctl range is 0x40 to 0x79.
+ */
+#define DRM_I915_INIT 0x00
+#define DRM_I915_FLUSH 0x01
+#define DRM_I915_FLIP 0x02
+#define DRM_I915_BATCHBUFFER 0x03
+#define DRM_I915_IRQ_EMIT 0x04
+#define DRM_I915_IRQ_WAIT 0x05
+#define DRM_I915_GETPARAM 0x06
+#define DRM_I915_SETPARAM 0x07
+#define DRM_I915_ALLOC 0x08
+#define DRM_I915_FREE 0x09
+#define DRM_I915_INIT_HEAP 0x0a
+#define DRM_I915_CMDBUFFER 0x0b
+#define DRM_I915_DESTROY_HEAP 0x0c
+#define DRM_I915_SET_VBLANK_PIPE 0x0d
+#define DRM_I915_GET_VBLANK_PIPE 0x0e
+#define DRM_I915_VBLANK_SWAP 0x0f
+#define DRM_I915_HWS_ADDR 0x11
+#define DRM_I915_GEM_INIT 0x13
+#define DRM_I915_GEM_EXECBUFFER 0x14
+#define DRM_I915_GEM_PIN 0x15
+#define DRM_I915_GEM_UNPIN 0x16
+#define DRM_I915_GEM_BUSY 0x17
+#define DRM_I915_GEM_THROTTLE 0x18
+#define DRM_I915_GEM_ENTERVT 0x19
+#define DRM_I915_GEM_LEAVEVT 0x1a
+#define DRM_I915_GEM_CREATE 0x1b
+#define DRM_I915_GEM_PREAD 0x1c
+#define DRM_I915_GEM_PWRITE 0x1d
+#define DRM_I915_GEM_MMAP 0x1e
+#define DRM_I915_GEM_SET_DOMAIN 0x1f
+#define DRM_I915_GEM_SW_FINISH 0x20
+#define DRM_I915_GEM_SET_TILING 0x21
+#define DRM_I915_GEM_GET_TILING 0x22
+#define DRM_I915_GEM_GET_APERTURE 0x23
+#define DRM_I915_GEM_MMAP_GTT 0x24
+#define DRM_I915_GET_PIPE_FROM_CRTC_ID 0x25
+
+#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
+#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH)
+#define DRM_IOCTL_I915_FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLIP)
+#define DRM_IOCTL_I915_BATCHBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_BATCHBUFFER, drm_i915_batchbuffer_t)
+#define DRM_IOCTL_I915_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_IRQ_EMIT, drm_i915_irq_emit_t)
+#define DRM_IOCTL_I915_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_IRQ_WAIT, drm_i915_irq_wait_t)
+#define DRM_IOCTL_I915_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GETPARAM, drm_i915_getparam_t)
+#define DRM_IOCTL_I915_SETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SETPARAM, drm_i915_setparam_t)
+#define DRM_IOCTL_I915_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_ALLOC, drm_i915_mem_alloc_t)
+#define DRM_IOCTL_I915_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_FREE, drm_i915_mem_free_t)
+#define DRM_IOCTL_I915_INIT_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT_HEAP, drm_i915_mem_init_heap_t)
+#define DRM_IOCTL_I915_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_CMDBUFFER, drm_i915_cmdbuffer_t)
+#define DRM_IOCTL_I915_DESTROY_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_DESTROY_HEAP, drm_i915_mem_destroy_heap_t)
+#define DRM_IOCTL_I915_SET_VBLANK_PIPE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SET_VBLANK_PIPE, drm_i915_vblank_pipe_t)
+#define DRM_IOCTL_I915_GET_VBLANK_PIPE DRM_IOR( DRM_COMMAND_BASE + DRM_I915_GET_VBLANK_PIPE, drm_i915_vblank_pipe_t)
+#define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t)
+#define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init)
+#define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer)
+#define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin)
+#define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin)
+#define DRM_IOCTL_I915_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_BUSY, struct drm_i915_gem_busy)
+#define DRM_IOCTL_I915_GEM_THROTTLE DRM_IO ( DRM_COMMAND_BASE + DRM_I915_GEM_THROTTLE)
+#define DRM_IOCTL_I915_GEM_ENTERVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_ENTERVT)
+#define DRM_IOCTL_I915_GEM_LEAVEVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_LEAVEVT)
+#define DRM_IOCTL_I915_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE, struct drm_i915_gem_create)
+#define DRM_IOCTL_I915_GEM_PREAD DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PREAD, struct drm_i915_gem_pread)
+#define DRM_IOCTL_I915_GEM_PWRITE DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PWRITE, struct drm_i915_gem_pwrite)
+#define DRM_IOCTL_I915_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct drm_i915_gem_mmap)
+#define DRM_IOCTL_I915_GEM_MMAP_GTT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP_GTT, struct drm_i915_gem_mmap_gtt)
+#define DRM_IOCTL_I915_GEM_SET_DOMAIN DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SET_DOMAIN, struct drm_i915_gem_set_domain)
+#define DRM_IOCTL_I915_GEM_SW_FINISH DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SW_FINISH, struct drm_i915_gem_sw_finish)
+#define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling)
+#define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling)
+#define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture)
+#define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_intel_get_pipe_from_crtc_id)
+
+/* Allow drivers to submit batchbuffers directly to hardware, relying
+ * on the security mechanisms provided by hardware.
+ */
+typedef struct drm_i915_batchbuffer {
+ int start; /* agp offset */
+ int used; /* nr bytes in use */
+ int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
+ int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
+ int num_cliprects; /* mulitpass with multiple cliprects? */
+ struct drm_clip_rect *cliprects; /* pointer to userspace cliprects */
+} drm_i915_batchbuffer_t;
+
+/* As above, but pass a pointer to userspace buffer which can be
+ * validated by the kernel prior to sending to hardware.
+ */
+typedef struct _drm_i915_cmdbuffer {
+ char *buf; /* pointer to userspace command buffer */
+ int sz; /* nr bytes in buf */
+ int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
+ int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
+ int num_cliprects; /* mulitpass with multiple cliprects? */
+ struct drm_clip_rect *cliprects; /* pointer to userspace cliprects */
+} drm_i915_cmdbuffer_t;
+
+/* Userspace can request & wait on irq's:
+ */
+typedef struct drm_i915_irq_emit {
+ int *irq_seq;
+} drm_i915_irq_emit_t;
+
+typedef struct drm_i915_irq_wait {
+ int irq_seq;
+} drm_i915_irq_wait_t;
+
+/* Ioctl to query kernel params:
+ */
+#define I915_PARAM_IRQ_ACTIVE 1
+#define I915_PARAM_ALLOW_BATCHBUFFER 2
+#define I915_PARAM_LAST_DISPATCH 3
+#define I915_PARAM_CHIPSET_ID 4
+#define I915_PARAM_HAS_GEM 5
+#define I915_PARAM_NUM_FENCES_AVAIL 6
+
+typedef struct drm_i915_getparam {
+ int param;
+ int *value;
+} drm_i915_getparam_t;
+
+/* Ioctl to set kernel params:
+ */
+#define I915_SETPARAM_USE_MI_BATCHBUFFER_START 1
+#define I915_SETPARAM_TEX_LRU_LOG_GRANULARITY 2
+#define I915_SETPARAM_ALLOW_BATCHBUFFER 3
+#define I915_SETPARAM_NUM_USED_FENCES 4
+
+typedef struct drm_i915_setparam {
+ int param;
+ int value;
+} drm_i915_setparam_t;
+
+/* A memory manager for regions of shared memory:
+ */
+#define I915_MEM_REGION_AGP 1
+
+typedef struct drm_i915_mem_alloc {
+ int region;
+ int alignment;
+ int size;
+ int *region_offset; /* offset from start of fb or agp */
+} drm_i915_mem_alloc_t;
+
+typedef struct drm_i915_mem_free {
+ int region;
+ int region_offset;
+} drm_i915_mem_free_t;
+
+typedef struct drm_i915_mem_init_heap {
+ int region;
+ int size;
+ int start;
+} drm_i915_mem_init_heap_t;
+
+/* Allow memory manager to be torn down and re-initialized (eg on
+ * rotate):
+ */
+typedef struct drm_i915_mem_destroy_heap {
+ int region;
+} drm_i915_mem_destroy_heap_t;
+
+/* Allow X server to configure which pipes to monitor for vblank signals
+ */
+#define DRM_I915_VBLANK_PIPE_A 1
+#define DRM_I915_VBLANK_PIPE_B 2
+
+typedef struct drm_i915_vblank_pipe {
+ int pipe;
+} drm_i915_vblank_pipe_t;
+
+/* Schedule buffer swap at given vertical blank:
+ */
+typedef struct drm_i915_vblank_swap {
+ drm_drawable_t drawable;
+ enum drm_vblank_seq_type seqtype;
+ unsigned int sequence;
+} drm_i915_vblank_swap_t;
+
+typedef struct drm_i915_hws_addr {
+ __u64 addr;
+} drm_i915_hws_addr_t;
+
+struct drm_i915_gem_init {
+ /**
+ * Beginning offset in the GTT to be managed by the DRM memory
+ * manager.
+ */
+ __u64 gtt_start;
+ /**
+ * Ending offset in the GTT to be managed by the DRM memory
+ * manager.
+ */
+ __u64 gtt_end;
+};
+
+struct drm_i915_gem_create {
+ /**
+ * Requested size for the object.
+ *
+ * The (page-aligned) allocated size for the object will be returned.
+ */
+ __u64 size;
+ /**
+ * Returned handle for the object.
+ *
+ * Object handles are nonzero.
+ */
+ __u32 handle;
+ __u32 pad;
+};
+
+struct drm_i915_gem_pread {
+ /** Handle for the object being read. */
+ __u32 handle;
+ __u32 pad;
+ /** Offset into the object to read from */
+ __u64 offset;
+ /** Length of data to read */
+ __u64 size;
+ /**
+ * Pointer to write the data into.
+ *
+ * This is a fixed-size type for 32/64 compatibility.
+ */
+ __u64 data_ptr;
+};
+
+struct drm_i915_gem_pwrite {
+ /** Handle for the object being written to. */
+ __u32 handle;
+ __u32 pad;
+ /** Offset into the object to write to */
+ __u64 offset;
+ /** Length of data to write */
+ __u64 size;
+ /**
+ * Pointer to read the data from.
+ *
+ * This is a fixed-size type for 32/64 compatibility.
+ */
+ __u64 data_ptr;
+};
+
+struct drm_i915_gem_mmap {
+ /** Handle for the object being mapped. */
+ __u32 handle;
+ __u32 pad;
+ /** Offset in the object to map. */
+ __u64 offset;
+ /**
+ * Length of data to map.
+ *
+ * The value will be page-aligned.
+ */
+ __u64 size;
+ /**
+ * Returned pointer the data was mapped at.
+ *
+ * This is a fixed-size type for 32/64 compatibility.
+ */
+ __u64 addr_ptr;
+};
+
+struct drm_i915_gem_mmap_gtt {
+ /** Handle for the object being mapped. */
+ __u32 handle;
+ __u32 pad;
+ /**
+ * Fake offset to use for subsequent mmap call
+ *
+ * This is a fixed-size type for 32/64 compatibility.
+ */
+ __u64 offset;
+};
+
+struct drm_i915_gem_set_domain {
+ /** Handle for the object */
+ __u32 handle;
+
+ /** New read domains */
+ __u32 read_domains;
+
+ /** New write domain */
+ __u32 write_domain;
+};
+
+struct drm_i915_gem_sw_finish {
+ /** Handle for the object */
+ __u32 handle;
+};
+
+struct drm_i915_gem_relocation_entry {
+ /**
+ * Handle of the buffer being pointed to by this relocation entry.
+ *
+ * It's appealing to make this be an index into the mm_validate_entry
+ * list to refer to the buffer, but this allows the driver to create
+ * a relocation list for state buffers and not re-write it per
+ * exec using the buffer.
+ */
+ __u32 target_handle;
+
+ /**
+ * Value to be added to the offset of the target buffer to make up
+ * the relocation entry.
+ */
+ __u32 delta;
+
+ /** Offset in the buffer the relocation entry will be written into */
+ __u64 offset;
+
+ /**
+ * Offset value of the target buffer that the relocation entry was last
+ * written as.
+ *
+ * If the buffer has the same offset as last time, we can skip syncing
+ * and writing the relocation. This value is written back out by
+ * the execbuffer ioctl when the relocation is written.
+ */
+ __u64 presumed_offset;
+
+ /**
+ * Target memory domains read by this operation.
+ */
+ __u32 read_domains;
+
+ /**
+ * Target memory domains written by this operation.
+ *
+ * Note that only one domain may be written by the whole
+ * execbuffer operation, so that where there are conflicts,
+ * the application will get -EINVAL back.
+ */
+ __u32 write_domain;
+};
+
+/** @{
+ * Intel memory domains
+ *
+ * Most of these just align with the various caches in
+ * the system and are used to flush and invalidate as
+ * objects end up cached in different domains.
+ */
+/** CPU cache */
+#define I915_GEM_DOMAIN_CPU 0x00000001
+/** Render cache, used by 2D and 3D drawing */
+#define I915_GEM_DOMAIN_RENDER 0x00000002
+/** Sampler cache, used by texture engine */
+#define I915_GEM_DOMAIN_SAMPLER 0x00000004
+/** Command queue, used to load batch buffers */
+#define I915_GEM_DOMAIN_COMMAND 0x00000008
+/** Instruction cache, used by shader programs */
+#define I915_GEM_DOMAIN_INSTRUCTION 0x00000010
+/** Vertex address cache */
+#define I915_GEM_DOMAIN_VERTEX 0x00000020
+/** GTT domain - aperture and scanout */
+#define I915_GEM_DOMAIN_GTT 0x00000040
+/** @} */
+
+struct drm_i915_gem_exec_object {
+ /**
+ * User's handle for a buffer to be bound into the GTT for this
+ * operation.
+ */
+ __u32 handle;
+
+ /** Number of relocations to be performed on this buffer */
+ __u32 relocation_count;
+ /**
+ * Pointer to array of struct drm_i915_gem_relocation_entry containing
+ * the relocations to be performed in this buffer.
+ */
+ __u64 relocs_ptr;
+
+ /** Required alignment in graphics aperture */
+ __u64 alignment;
+
+ /**
+ * Returned value of the updated offset of the object, for future
+ * presumed_offset writes.
+ */
+ __u64 offset;
+};
+
+struct drm_i915_gem_execbuffer {
+ /**
+ * List of buffers to be validated with their relocations to be
+ * performend on them.
+ *
+ * This is a pointer to an array of struct drm_i915_gem_validate_entry.
+ *
+ * These buffers must be listed in an order such that all relocations
+ * a buffer is performing refer to buffers that have already appeared
+ * in the validate list.
+ */
+ __u64 buffers_ptr;
+ __u32 buffer_count;
+
+ /** Offset in the batchbuffer to start execution from. */
+ __u32 batch_start_offset;
+ /** Bytes used in batchbuffer from batch_start_offset */
+ __u32 batch_len;
+ __u32 DR1;
+ __u32 DR4;
+ __u32 num_cliprects;
+ /** This is a struct drm_clip_rect *cliprects */
+ __u64 cliprects_ptr;
+};
+
+struct drm_i915_gem_pin {
+ /** Handle of the buffer to be pinned. */
+ __u32 handle;
+ __u32 pad;
+
+ /** alignment required within the aperture */
+ __u64 alignment;
+
+ /** Returned GTT offset of the buffer. */
+ __u64 offset;
+};
+
+struct drm_i915_gem_unpin {
+ /** Handle of the buffer to be unpinned. */
+ __u32 handle;
+ __u32 pad;
+};
+
+struct drm_i915_gem_busy {
+ /** Handle of the buffer to check for busy */
+ __u32 handle;
+
+ /** Return busy status (1 if busy, 0 if idle) */
+ __u32 busy;
+};
+
+#define I915_TILING_NONE 0
+#define I915_TILING_X 1
+#define I915_TILING_Y 2
+
+#define I915_BIT_6_SWIZZLE_NONE 0
+#define I915_BIT_6_SWIZZLE_9 1
+#define I915_BIT_6_SWIZZLE_9_10 2
+#define I915_BIT_6_SWIZZLE_9_11 3
+#define I915_BIT_6_SWIZZLE_9_10_11 4
+/* Not seen by userland */
+#define I915_BIT_6_SWIZZLE_UNKNOWN 5
+/* Seen by userland. */
+#define I915_BIT_6_SWIZZLE_9_17 6
+#define I915_BIT_6_SWIZZLE_9_10_17 7
+
+struct drm_i915_gem_set_tiling {
+ /** Handle of the buffer to have its tiling state updated */
+ __u32 handle;
+
+ /**
+ * Tiling mode for the object (I915_TILING_NONE, I915_TILING_X,
+ * I915_TILING_Y).
+ *
+ * This value is to be set on request, and will be updated by the
+ * kernel on successful return with the actual chosen tiling layout.
+ *
+ * The tiling mode may be demoted to I915_TILING_NONE when the system
+ * has bit 6 swizzling that can't be managed correctly by GEM.
+ *
+ * Buffer contents become undefined when changing tiling_mode.
+ */
+ __u32 tiling_mode;
+
+ /**
+ * Stride in bytes for the object when in I915_TILING_X or
+ * I915_TILING_Y.
+ */
+ __u32 stride;
+
+ /**
+ * Returned address bit 6 swizzling required for CPU access through
+ * mmap mapping.
+ */
+ __u32 swizzle_mode;
+};
+
+struct drm_i915_gem_get_tiling {
+ /** Handle of the buffer to get tiling state for. */
+ __u32 handle;
+
+ /**
+ * Current tiling mode for the object (I915_TILING_NONE, I915_TILING_X,
+ * I915_TILING_Y).
+ */
+ __u32 tiling_mode;
+
+ /**
+ * Returned address bit 6 swizzling required for CPU access through
+ * mmap mapping.
+ */
+ __u32 swizzle_mode;
+};
+
+struct drm_i915_gem_get_aperture {
+ /** Total size of the aperture used by i915_gem_execbuffer, in bytes */
+ __u64 aper_size;
+
+ /**
+ * Available space in the aperture used by i915_gem_execbuffer, in
+ * bytes
+ */
+ __u64 aper_available_size;
+};
+
+struct drm_i915_get_pipe_from_crtc_id {
+ /** ID of CRTC being requested **/
+ __u32 crtc_id;
+
+ /** pipe of requested CRTC **/
+ __u32 pipe;
+};
+
+#endif /* _I915_DRM_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/mga_drm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/mga_drm.h
new file mode 100644
index 0000000..52632bb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/mga_drm.h
@@ -0,0 +1,419 @@
+/* mga_drm.h -- Public header for the Matrox g200/g400 driver -*- linux-c -*-
+ * Created: Tue Jan 25 01:50:01 1999 by jhartmann@precisioninsight.com
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Jeff Hartmann <jhartmann@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
+ *
+ * Rewritten by:
+ * Gareth Hughes <gareth@valinux.com>
+ */
+
+#ifndef __MGA_DRM_H__
+#define __MGA_DRM_H__
+
+#include <linux/types.h>
+
+/* WARNING: If you change any of these defines, make sure to change the
+ * defines in the Xserver file (mga_sarea.h)
+ */
+
+#ifndef __MGA_SAREA_DEFINES__
+#define __MGA_SAREA_DEFINES__
+
+/* WARP pipe flags
+ */
+#define MGA_F 0x1 /* fog */
+#define MGA_A 0x2 /* alpha */
+#define MGA_S 0x4 /* specular */
+#define MGA_T2 0x8 /* multitexture */
+
+#define MGA_WARP_TGZ 0
+#define MGA_WARP_TGZF (MGA_F)
+#define MGA_WARP_TGZA (MGA_A)
+#define MGA_WARP_TGZAF (MGA_F|MGA_A)
+#define MGA_WARP_TGZS (MGA_S)
+#define MGA_WARP_TGZSF (MGA_S|MGA_F)
+#define MGA_WARP_TGZSA (MGA_S|MGA_A)
+#define MGA_WARP_TGZSAF (MGA_S|MGA_F|MGA_A)
+#define MGA_WARP_T2GZ (MGA_T2)
+#define MGA_WARP_T2GZF (MGA_T2|MGA_F)
+#define MGA_WARP_T2GZA (MGA_T2|MGA_A)
+#define MGA_WARP_T2GZAF (MGA_T2|MGA_A|MGA_F)
+#define MGA_WARP_T2GZS (MGA_T2|MGA_S)
+#define MGA_WARP_T2GZSF (MGA_T2|MGA_S|MGA_F)
+#define MGA_WARP_T2GZSA (MGA_T2|MGA_S|MGA_A)
+#define MGA_WARP_T2GZSAF (MGA_T2|MGA_S|MGA_F|MGA_A)
+
+#define MGA_MAX_G200_PIPES 8 /* no multitex */
+#define MGA_MAX_G400_PIPES 16
+#define MGA_MAX_WARP_PIPES MGA_MAX_G400_PIPES
+#define MGA_WARP_UCODE_SIZE 32768 /* in bytes */
+
+#define MGA_CARD_TYPE_G200 1
+#define MGA_CARD_TYPE_G400 2
+#define MGA_CARD_TYPE_G450 3 /* not currently used */
+#define MGA_CARD_TYPE_G550 4
+
+#define MGA_FRONT 0x1
+#define MGA_BACK 0x2
+#define MGA_DEPTH 0x4
+
+/* What needs to be changed for the current vertex dma buffer?
+ */
+#define MGA_UPLOAD_CONTEXT 0x1
+#define MGA_UPLOAD_TEX0 0x2
+#define MGA_UPLOAD_TEX1 0x4
+#define MGA_UPLOAD_PIPE 0x8
+#define MGA_UPLOAD_TEX0IMAGE 0x10 /* handled client-side */
+#define MGA_UPLOAD_TEX1IMAGE 0x20 /* handled client-side */
+#define MGA_UPLOAD_2D 0x40
+#define MGA_WAIT_AGE 0x80 /* handled client-side */
+#define MGA_UPLOAD_CLIPRECTS 0x100 /* handled client-side */
+#if 0
+#define MGA_DMA_FLUSH 0x200 /* set when someone gets the lock
+ quiescent */
+#endif
+
+/* 32 buffers of 64k each, total 2 meg.
+ */
+#define MGA_BUFFER_SIZE (1 << 16)
+#define MGA_NUM_BUFFERS 128
+
+/* Keep these small for testing.
+ */
+#define MGA_NR_SAREA_CLIPRECTS 8
+
+/* 2 heaps (1 for card, 1 for agp), each divided into upto 128
+ * regions, subject to a minimum region size of (1<<16) == 64k.
+ *
+ * Clients may subdivide regions internally, but when sharing between
+ * clients, the region size is the minimum granularity.
+ */
+
+#define MGA_CARD_HEAP 0
+#define MGA_AGP_HEAP 1
+#define MGA_NR_TEX_HEAPS 2
+#define MGA_NR_TEX_REGIONS 16
+#define MGA_LOG_MIN_TEX_REGION_SIZE 16
+
+#define DRM_MGA_IDLE_RETRY 2048
+
+#endif /* __MGA_SAREA_DEFINES__ */
+
+/* Setup registers for 3D context
+ */
+typedef struct {
+ unsigned int dstorg;
+ unsigned int maccess;
+ unsigned int plnwt;
+ unsigned int dwgctl;
+ unsigned int alphactrl;
+ unsigned int fogcolor;
+ unsigned int wflag;
+ unsigned int tdualstage0;
+ unsigned int tdualstage1;
+ unsigned int fcol;
+ unsigned int stencil;
+ unsigned int stencilctl;
+} drm_mga_context_regs_t;
+
+/* Setup registers for 2D, X server
+ */
+typedef struct {
+ unsigned int pitch;
+} drm_mga_server_regs_t;
+
+/* Setup registers for each texture unit
+ */
+typedef struct {
+ unsigned int texctl;
+ unsigned int texctl2;
+ unsigned int texfilter;
+ unsigned int texbordercol;
+ unsigned int texorg;
+ unsigned int texwidth;
+ unsigned int texheight;
+ unsigned int texorg1;
+ unsigned int texorg2;
+ unsigned int texorg3;
+ unsigned int texorg4;
+} drm_mga_texture_regs_t;
+
+/* General aging mechanism
+ */
+typedef struct {
+ unsigned int head; /* Position of head pointer */
+ unsigned int wrap; /* Primary DMA wrap count */
+} drm_mga_age_t;
+
+typedef struct _drm_mga_sarea {
+ /* The channel for communication of state information to the kernel
+ * on firing a vertex dma buffer.
+ */
+ drm_mga_context_regs_t context_state;
+ drm_mga_server_regs_t server_state;
+ drm_mga_texture_regs_t tex_state[2];
+ unsigned int warp_pipe;
+ unsigned int dirty;
+ unsigned int vertsize;
+
+ /* The current cliprects, or a subset thereof.
+ */
+ struct drm_clip_rect boxes[MGA_NR_SAREA_CLIPRECTS];
+ unsigned int nbox;
+
+ /* Information about the most recently used 3d drawable. The
+ * client fills in the req_* fields, the server fills in the
+ * exported_ fields and puts the cliprects into boxes, above.
+ *
+ * The client clears the exported_drawable field before
+ * clobbering the boxes data.
+ */
+ unsigned int req_drawable; /* the X drawable id */
+ unsigned int req_draw_buffer; /* MGA_FRONT or MGA_BACK */
+
+ unsigned int exported_drawable;
+ unsigned int exported_index;
+ unsigned int exported_stamp;
+ unsigned int exported_buffers;
+ unsigned int exported_nfront;
+ unsigned int exported_nback;
+ int exported_back_x, exported_front_x, exported_w;
+ int exported_back_y, exported_front_y, exported_h;
+ struct drm_clip_rect exported_boxes[MGA_NR_SAREA_CLIPRECTS];
+
+ /* Counters for aging textures and for client-side throttling.
+ */
+ unsigned int status[4];
+ unsigned int last_wrap;
+
+ drm_mga_age_t last_frame;
+ unsigned int last_enqueue; /* last time a buffer was enqueued */
+ unsigned int last_dispatch; /* age of the most recently dispatched buffer */
+ unsigned int last_quiescent; /* */
+
+ /* LRU lists for texture memory in agp space and on the card.
+ */
+ struct drm_tex_region texList[MGA_NR_TEX_HEAPS][MGA_NR_TEX_REGIONS + 1];
+ unsigned int texAge[MGA_NR_TEX_HEAPS];
+
+ /* Mechanism to validate card state.
+ */
+ int ctxOwner;
+} drm_mga_sarea_t;
+
+/* MGA specific ioctls
+ * The device specific ioctl range is 0x40 to 0x79.
+ */
+#define DRM_MGA_INIT 0x00
+#define DRM_MGA_FLUSH 0x01
+#define DRM_MGA_RESET 0x02
+#define DRM_MGA_SWAP 0x03
+#define DRM_MGA_CLEAR 0x04
+#define DRM_MGA_VERTEX 0x05
+#define DRM_MGA_INDICES 0x06
+#define DRM_MGA_ILOAD 0x07
+#define DRM_MGA_BLIT 0x08
+#define DRM_MGA_GETPARAM 0x09
+
+/* 3.2:
+ * ioctls for operating on fences.
+ */
+#define DRM_MGA_SET_FENCE 0x0a
+#define DRM_MGA_WAIT_FENCE 0x0b
+#define DRM_MGA_DMA_BOOTSTRAP 0x0c
+
+#define DRM_IOCTL_MGA_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_INIT, drm_mga_init_t)
+#define DRM_IOCTL_MGA_FLUSH DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_FLUSH, drm_lock_t)
+#define DRM_IOCTL_MGA_RESET DRM_IO( DRM_COMMAND_BASE + DRM_MGA_RESET)
+#define DRM_IOCTL_MGA_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_MGA_SWAP)
+#define DRM_IOCTL_MGA_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_CLEAR, drm_mga_clear_t)
+#define DRM_IOCTL_MGA_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_VERTEX, drm_mga_vertex_t)
+#define DRM_IOCTL_MGA_INDICES DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_INDICES, drm_mga_indices_t)
+#define DRM_IOCTL_MGA_ILOAD DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_ILOAD, drm_mga_iload_t)
+#define DRM_IOCTL_MGA_BLIT DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_BLIT, drm_mga_blit_t)
+#define DRM_IOCTL_MGA_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_GETPARAM, drm_mga_getparam_t)
+#define DRM_IOCTL_MGA_SET_FENCE DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_SET_FENCE, __u32)
+#define DRM_IOCTL_MGA_WAIT_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_WAIT_FENCE, __u32)
+#define DRM_IOCTL_MGA_DMA_BOOTSTRAP DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_DMA_BOOTSTRAP, drm_mga_dma_bootstrap_t)
+
+typedef struct _drm_mga_warp_index {
+ int installed;
+ unsigned long phys_addr;
+ int size;
+} drm_mga_warp_index_t;
+
+typedef struct drm_mga_init {
+ enum {
+ MGA_INIT_DMA = 0x01,
+ MGA_CLEANUP_DMA = 0x02
+ } func;
+
+ unsigned long sarea_priv_offset;
+
+ int chipset;
+ int sgram;
+
+ unsigned int maccess;
+
+ unsigned int fb_cpp;
+ unsigned int front_offset, front_pitch;
+ unsigned int back_offset, back_pitch;
+
+ unsigned int depth_cpp;
+ unsigned int depth_offset, depth_pitch;
+
+ unsigned int texture_offset[MGA_NR_TEX_HEAPS];
+ unsigned int texture_size[MGA_NR_TEX_HEAPS];
+
+ unsigned long fb_offset;
+ unsigned long mmio_offset;
+ unsigned long status_offset;
+ unsigned long warp_offset;
+ unsigned long primary_offset;
+ unsigned long buffers_offset;
+} drm_mga_init_t;
+
+typedef struct drm_mga_dma_bootstrap {
+ /**
+ * \name AGP texture region
+ *
+ * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, these fields will
+ * be filled in with the actual AGP texture settings.
+ *
+ * \warning
+ * If these fields are non-zero, but dma_mga_dma_bootstrap::agp_mode
+ * is zero, it means that PCI memory (most likely through the use of
+ * an IOMMU) is being used for "AGP" textures.
+ */
+ /*@{ */
+ unsigned long texture_handle; /**< Handle used to map AGP textures. */
+ __u32 texture_size; /**< Size of the AGP texture region. */
+ /*@} */
+
+ /**
+ * Requested size of the primary DMA region.
+ *
+ * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, this field will be
+ * filled in with the actual AGP mode. If AGP was not available
+ */
+ __u32 primary_size;
+
+ /**
+ * Requested number of secondary DMA buffers.
+ *
+ * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, this field will be
+ * filled in with the actual number of secondary DMA buffers
+ * allocated. Particularly when PCI DMA is used, this may be
+ * (subtantially) less than the number requested.
+ */
+ __u32 secondary_bin_count;
+
+ /**
+ * Requested size of each secondary DMA buffer.
+ *
+ * While the kernel \b is free to reduce
+ * dma_mga_dma_bootstrap::secondary_bin_count, it is \b not allowed
+ * to reduce dma_mga_dma_bootstrap::secondary_bin_size.
+ */
+ __u32 secondary_bin_size;
+
+ /**
+ * Bit-wise mask of AGPSTAT2_* values. Currently only \c AGPSTAT2_1X,
+ * \c AGPSTAT2_2X, and \c AGPSTAT2_4X are supported. If this value is
+ * zero, it means that PCI DMA should be used, even if AGP is
+ * possible.
+ *
+ * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, this field will be
+ * filled in with the actual AGP mode. If AGP was not available
+ * (i.e., PCI DMA was used), this value will be zero.
+ */
+ __u32 agp_mode;
+
+ /**
+ * Desired AGP GART size, measured in megabytes.
+ */
+ __u8 agp_size;
+} drm_mga_dma_bootstrap_t;
+
+typedef struct drm_mga_clear {
+ unsigned int flags;
+ unsigned int clear_color;
+ unsigned int clear_depth;
+ unsigned int color_mask;
+ unsigned int depth_mask;
+} drm_mga_clear_t;
+
+typedef struct drm_mga_vertex {
+ int idx; /* buffer to queue */
+ int used; /* bytes in use */
+ int discard; /* client finished with buffer? */
+} drm_mga_vertex_t;
+
+typedef struct drm_mga_indices {
+ int idx; /* buffer to queue */
+ unsigned int start;
+ unsigned int end;
+ int discard; /* client finished with buffer? */
+} drm_mga_indices_t;
+
+typedef struct drm_mga_iload {
+ int idx;
+ unsigned int dstorg;
+ unsigned int length;
+} drm_mga_iload_t;
+
+typedef struct _drm_mga_blit {
+ unsigned int planemask;
+ unsigned int srcorg;
+ unsigned int dstorg;
+ int src_pitch, dst_pitch;
+ int delta_sx, delta_sy;
+ int delta_dx, delta_dy;
+ int height, ydir; /* flip image vertically */
+ int source_pitch, dest_pitch;
+} drm_mga_blit_t;
+
+/* 3.1: An ioctl to get parameters that aren't available to the 3d
+ * client any other way.
+ */
+#define MGA_PARAM_IRQ_NR 1
+
+/* 3.2: Query the actual card type. The DDX only distinguishes between
+ * G200 chips and non-G200 chips, which it calls G400. It turns out that
+ * there are some very sublte differences between the G4x0 chips and the G550
+ * chips. Using this parameter query, a client-side driver can detect the
+ * difference between a G4x0 and a G550.
+ */
+#define MGA_PARAM_CARD_TYPE 2
+
+typedef struct drm_mga_getparam {
+ int param;
+ void *value;
+} drm_mga_getparam_t;
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/r128_drm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/r128_drm.h
new file mode 100644
index 0000000..ede78ff
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/r128_drm.h
@@ -0,0 +1,326 @@
+/* r128_drm.h -- Public header for the r128 driver -*- linux-c -*-
+ * Created: Wed Apr 5 19:24:19 2000 by kevin@precisioninsight.com
+ */
+/*
+ * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Gareth Hughes <gareth@valinux.com>
+ * Kevin E. Martin <martin@valinux.com>
+ */
+
+#ifndef __R128_DRM_H__
+#define __R128_DRM_H__
+
+/* WARNING: If you change any of these defines, make sure to change the
+ * defines in the X server file (r128_sarea.h)
+ */
+#ifndef __R128_SAREA_DEFINES__
+#define __R128_SAREA_DEFINES__
+
+/* What needs to be changed for the current vertex buffer?
+ */
+#define R128_UPLOAD_CONTEXT 0x001
+#define R128_UPLOAD_SETUP 0x002
+#define R128_UPLOAD_TEX0 0x004
+#define R128_UPLOAD_TEX1 0x008
+#define R128_UPLOAD_TEX0IMAGES 0x010
+#define R128_UPLOAD_TEX1IMAGES 0x020
+#define R128_UPLOAD_CORE 0x040
+#define R128_UPLOAD_MASKS 0x080
+#define R128_UPLOAD_WINDOW 0x100
+#define R128_UPLOAD_CLIPRECTS 0x200 /* handled client-side */
+#define R128_REQUIRE_QUIESCENCE 0x400
+#define R128_UPLOAD_ALL 0x7ff
+
+#define R128_FRONT 0x1
+#define R128_BACK 0x2
+#define R128_DEPTH 0x4
+
+/* Primitive types
+ */
+#define R128_POINTS 0x1
+#define R128_LINES 0x2
+#define R128_LINE_STRIP 0x3
+#define R128_TRIANGLES 0x4
+#define R128_TRIANGLE_FAN 0x5
+#define R128_TRIANGLE_STRIP 0x6
+
+/* Vertex/indirect buffer size
+ */
+#define R128_BUFFER_SIZE 16384
+
+/* Byte offsets for indirect buffer data
+ */
+#define R128_INDEX_PRIM_OFFSET 20
+#define R128_HOSTDATA_BLIT_OFFSET 32
+
+/* Keep these small for testing.
+ */
+#define R128_NR_SAREA_CLIPRECTS 12
+
+/* There are 2 heaps (local/AGP). Each region within a heap is a
+ * minimum of 64k, and there are at most 64 of them per heap.
+ */
+#define R128_LOCAL_TEX_HEAP 0
+#define R128_AGP_TEX_HEAP 1
+#define R128_NR_TEX_HEAPS 2
+#define R128_NR_TEX_REGIONS 64
+#define R128_LOG_TEX_GRANULARITY 16
+
+#define R128_NR_CONTEXT_REGS 12
+
+#define R128_MAX_TEXTURE_LEVELS 11
+#define R128_MAX_TEXTURE_UNITS 2
+
+#endif /* __R128_SAREA_DEFINES__ */
+
+typedef struct {
+ /* Context state - can be written in one large chunk */
+ unsigned int dst_pitch_offset_c;
+ unsigned int dp_gui_master_cntl_c;
+ unsigned int sc_top_left_c;
+ unsigned int sc_bottom_right_c;
+ unsigned int z_offset_c;
+ unsigned int z_pitch_c;
+ unsigned int z_sten_cntl_c;
+ unsigned int tex_cntl_c;
+ unsigned int misc_3d_state_cntl_reg;
+ unsigned int texture_clr_cmp_clr_c;
+ unsigned int texture_clr_cmp_msk_c;
+ unsigned int fog_color_c;
+
+ /* Texture state */
+ unsigned int tex_size_pitch_c;
+ unsigned int constant_color_c;
+
+ /* Setup state */
+ unsigned int pm4_vc_fpu_setup;
+ unsigned int setup_cntl;
+
+ /* Mask state */
+ unsigned int dp_write_mask;
+ unsigned int sten_ref_mask_c;
+ unsigned int plane_3d_mask_c;
+
+ /* Window state */
+ unsigned int window_xy_offset;
+
+ /* Core state */
+ unsigned int scale_3d_cntl;
+} drm_r128_context_regs_t;
+
+/* Setup registers for each texture unit
+ */
+typedef struct {
+ unsigned int tex_cntl;
+ unsigned int tex_combine_cntl;
+ unsigned int tex_size_pitch;
+ unsigned int tex_offset[R128_MAX_TEXTURE_LEVELS];
+ unsigned int tex_border_color;
+} drm_r128_texture_regs_t;
+
+typedef struct drm_r128_sarea {
+ /* The channel for communication of state information to the kernel
+ * on firing a vertex buffer.
+ */
+ drm_r128_context_regs_t context_state;
+ drm_r128_texture_regs_t tex_state[R128_MAX_TEXTURE_UNITS];
+ unsigned int dirty;
+ unsigned int vertsize;
+ unsigned int vc_format;
+
+ /* The current cliprects, or a subset thereof.
+ */
+ struct drm_clip_rect boxes[R128_NR_SAREA_CLIPRECTS];
+ unsigned int nbox;
+
+ /* Counters for client-side throttling of rendering clients.
+ */
+ unsigned int last_frame;
+ unsigned int last_dispatch;
+
+ struct drm_tex_region tex_list[R128_NR_TEX_HEAPS][R128_NR_TEX_REGIONS + 1];
+ unsigned int tex_age[R128_NR_TEX_HEAPS];
+ int ctx_owner;
+ int pfAllowPageFlip; /* number of 3d windows (0,1,2 or more) */
+ int pfCurrentPage; /* which buffer is being displayed? */
+} drm_r128_sarea_t;
+
+/* WARNING: If you change any of these defines, make sure to change the
+ * defines in the Xserver file (xf86drmR128.h)
+ */
+
+/* Rage 128 specific ioctls
+ * The device specific ioctl range is 0x40 to 0x79.
+ */
+#define DRM_R128_INIT 0x00
+#define DRM_R128_CCE_START 0x01
+#define DRM_R128_CCE_STOP 0x02
+#define DRM_R128_CCE_RESET 0x03
+#define DRM_R128_CCE_IDLE 0x04
+/* 0x05 not used */
+#define DRM_R128_RESET 0x06
+#define DRM_R128_SWAP 0x07
+#define DRM_R128_CLEAR 0x08
+#define DRM_R128_VERTEX 0x09
+#define DRM_R128_INDICES 0x0a
+#define DRM_R128_BLIT 0x0b
+#define DRM_R128_DEPTH 0x0c
+#define DRM_R128_STIPPLE 0x0d
+/* 0x0e not used */
+#define DRM_R128_INDIRECT 0x0f
+#define DRM_R128_FULLSCREEN 0x10
+#define DRM_R128_CLEAR2 0x11
+#define DRM_R128_GETPARAM 0x12
+#define DRM_R128_FLIP 0x13
+
+#define DRM_IOCTL_R128_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_R128_INIT, drm_r128_init_t)
+#define DRM_IOCTL_R128_CCE_START DRM_IO( DRM_COMMAND_BASE + DRM_R128_CCE_START)
+#define DRM_IOCTL_R128_CCE_STOP DRM_IOW( DRM_COMMAND_BASE + DRM_R128_CCE_STOP, drm_r128_cce_stop_t)
+#define DRM_IOCTL_R128_CCE_RESET DRM_IO( DRM_COMMAND_BASE + DRM_R128_CCE_RESET)
+#define DRM_IOCTL_R128_CCE_IDLE DRM_IO( DRM_COMMAND_BASE + DRM_R128_CCE_IDLE)
+/* 0x05 not used */
+#define DRM_IOCTL_R128_RESET DRM_IO( DRM_COMMAND_BASE + DRM_R128_RESET)
+#define DRM_IOCTL_R128_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_R128_SWAP)
+#define DRM_IOCTL_R128_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_R128_CLEAR, drm_r128_clear_t)
+#define DRM_IOCTL_R128_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_R128_VERTEX, drm_r128_vertex_t)
+#define DRM_IOCTL_R128_INDICES DRM_IOW( DRM_COMMAND_BASE + DRM_R128_INDICES, drm_r128_indices_t)
+#define DRM_IOCTL_R128_BLIT DRM_IOW( DRM_COMMAND_BASE + DRM_R128_BLIT, drm_r128_blit_t)
+#define DRM_IOCTL_R128_DEPTH DRM_IOW( DRM_COMMAND_BASE + DRM_R128_DEPTH, drm_r128_depth_t)
+#define DRM_IOCTL_R128_STIPPLE DRM_IOW( DRM_COMMAND_BASE + DRM_R128_STIPPLE, drm_r128_stipple_t)
+/* 0x0e not used */
+#define DRM_IOCTL_R128_INDIRECT DRM_IOWR(DRM_COMMAND_BASE + DRM_R128_INDIRECT, drm_r128_indirect_t)
+#define DRM_IOCTL_R128_FULLSCREEN DRM_IOW( DRM_COMMAND_BASE + DRM_R128_FULLSCREEN, drm_r128_fullscreen_t)
+#define DRM_IOCTL_R128_CLEAR2 DRM_IOW( DRM_COMMAND_BASE + DRM_R128_CLEAR2, drm_r128_clear2_t)
+#define DRM_IOCTL_R128_GETPARAM DRM_IOWR( DRM_COMMAND_BASE + DRM_R128_GETPARAM, drm_r128_getparam_t)
+#define DRM_IOCTL_R128_FLIP DRM_IO( DRM_COMMAND_BASE + DRM_R128_FLIP)
+
+typedef struct drm_r128_init {
+ enum {
+ R128_INIT_CCE = 0x01,
+ R128_CLEANUP_CCE = 0x02
+ } func;
+ unsigned long sarea_priv_offset;
+ int is_pci;
+ int cce_mode;
+ int cce_secure;
+ int ring_size;
+ int usec_timeout;
+
+ unsigned int fb_bpp;
+ unsigned int front_offset, front_pitch;
+ unsigned int back_offset, back_pitch;
+ unsigned int depth_bpp;
+ unsigned int depth_offset, depth_pitch;
+ unsigned int span_offset;
+
+ unsigned long fb_offset;
+ unsigned long mmio_offset;
+ unsigned long ring_offset;
+ unsigned long ring_rptr_offset;
+ unsigned long buffers_offset;
+ unsigned long agp_textures_offset;
+} drm_r128_init_t;
+
+typedef struct drm_r128_cce_stop {
+ int flush;
+ int idle;
+} drm_r128_cce_stop_t;
+
+typedef struct drm_r128_clear {
+ unsigned int flags;
+ unsigned int clear_color;
+ unsigned int clear_depth;
+ unsigned int color_mask;
+ unsigned int depth_mask;
+} drm_r128_clear_t;
+
+typedef struct drm_r128_vertex {
+ int prim;
+ int idx; /* Index of vertex buffer */
+ int count; /* Number of vertices in buffer */
+ int discard; /* Client finished with buffer? */
+} drm_r128_vertex_t;
+
+typedef struct drm_r128_indices {
+ int prim;
+ int idx;
+ int start;
+ int end;
+ int discard; /* Client finished with buffer? */
+} drm_r128_indices_t;
+
+typedef struct drm_r128_blit {
+ int idx;
+ int pitch;
+ int offset;
+ int format;
+ unsigned short x, y;
+ unsigned short width, height;
+} drm_r128_blit_t;
+
+typedef struct drm_r128_depth {
+ enum {
+ R128_WRITE_SPAN = 0x01,
+ R128_WRITE_PIXELS = 0x02,
+ R128_READ_SPAN = 0x03,
+ R128_READ_PIXELS = 0x04
+ } func;
+ int n;
+ int *x;
+ int *y;
+ unsigned int *buffer;
+ unsigned char *mask;
+} drm_r128_depth_t;
+
+typedef struct drm_r128_stipple {
+ unsigned int *mask;
+} drm_r128_stipple_t;
+
+typedef struct drm_r128_indirect {
+ int idx;
+ int start;
+ int end;
+ int discard;
+} drm_r128_indirect_t;
+
+typedef struct drm_r128_fullscreen {
+ enum {
+ R128_INIT_FULLSCREEN = 0x01,
+ R128_CLEANUP_FULLSCREEN = 0x02
+ } func;
+} drm_r128_fullscreen_t;
+
+/* 2.3: An ioctl to get parameters that aren't available to the 3d
+ * client any other way.
+ */
+#define R128_PARAM_IRQ_NR 1
+
+typedef struct drm_r128_getparam {
+ int param;
+ void *value;
+} drm_r128_getparam_t;
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/radeon_drm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/radeon_drm.h
new file mode 100644
index 0000000..15aed8e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/radeon_drm.h
@@ -0,0 +1,754 @@
+/* radeon_drm.h -- Public header for the radeon driver -*- linux-c -*-
+ *
+ * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
+ * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Kevin E. Martin <martin@valinux.com>
+ * Gareth Hughes <gareth@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#ifndef __RADEON_DRM_H__
+#define __RADEON_DRM_H__
+
+#include <linux/types.h>
+
+/* WARNING: If you change any of these defines, make sure to change the
+ * defines in the X server file (radeon_sarea.h)
+ */
+#ifndef __RADEON_SAREA_DEFINES__
+#define __RADEON_SAREA_DEFINES__
+
+/* Old style state flags, required for sarea interface (1.1 and 1.2
+ * clears) and 1.2 drm_vertex2 ioctl.
+ */
+#define RADEON_UPLOAD_CONTEXT 0x00000001
+#define RADEON_UPLOAD_VERTFMT 0x00000002
+#define RADEON_UPLOAD_LINE 0x00000004
+#define RADEON_UPLOAD_BUMPMAP 0x00000008
+#define RADEON_UPLOAD_MASKS 0x00000010
+#define RADEON_UPLOAD_VIEWPORT 0x00000020
+#define RADEON_UPLOAD_SETUP 0x00000040
+#define RADEON_UPLOAD_TCL 0x00000080
+#define RADEON_UPLOAD_MISC 0x00000100
+#define RADEON_UPLOAD_TEX0 0x00000200
+#define RADEON_UPLOAD_TEX1 0x00000400
+#define RADEON_UPLOAD_TEX2 0x00000800
+#define RADEON_UPLOAD_TEX0IMAGES 0x00001000
+#define RADEON_UPLOAD_TEX1IMAGES 0x00002000
+#define RADEON_UPLOAD_TEX2IMAGES 0x00004000
+#define RADEON_UPLOAD_CLIPRECTS 0x00008000 /* handled client-side */
+#define RADEON_REQUIRE_QUIESCENCE 0x00010000
+#define RADEON_UPLOAD_ZBIAS 0x00020000 /* version 1.2 and newer */
+#define RADEON_UPLOAD_ALL 0x003effff
+#define RADEON_UPLOAD_CONTEXT_ALL 0x003e01ff
+
+/* New style per-packet identifiers for use in cmd_buffer ioctl with
+ * the RADEON_EMIT_PACKET command. Comments relate new packets to old
+ * state bits and the packet size:
+ */
+#define RADEON_EMIT_PP_MISC 0 /* context/7 */
+#define RADEON_EMIT_PP_CNTL 1 /* context/3 */
+#define RADEON_EMIT_RB3D_COLORPITCH 2 /* context/1 */
+#define RADEON_EMIT_RE_LINE_PATTERN 3 /* line/2 */
+#define RADEON_EMIT_SE_LINE_WIDTH 4 /* line/1 */
+#define RADEON_EMIT_PP_LUM_MATRIX 5 /* bumpmap/1 */
+#define RADEON_EMIT_PP_ROT_MATRIX_0 6 /* bumpmap/2 */
+#define RADEON_EMIT_RB3D_STENCILREFMASK 7 /* masks/3 */
+#define RADEON_EMIT_SE_VPORT_XSCALE 8 /* viewport/6 */
+#define RADEON_EMIT_SE_CNTL 9 /* setup/2 */
+#define RADEON_EMIT_SE_CNTL_STATUS 10 /* setup/1 */
+#define RADEON_EMIT_RE_MISC 11 /* misc/1 */
+#define RADEON_EMIT_PP_TXFILTER_0 12 /* tex0/6 */
+#define RADEON_EMIT_PP_BORDER_COLOR_0 13 /* tex0/1 */
+#define RADEON_EMIT_PP_TXFILTER_1 14 /* tex1/6 */
+#define RADEON_EMIT_PP_BORDER_COLOR_1 15 /* tex1/1 */
+#define RADEON_EMIT_PP_TXFILTER_2 16 /* tex2/6 */
+#define RADEON_EMIT_PP_BORDER_COLOR_2 17 /* tex2/1 */
+#define RADEON_EMIT_SE_ZBIAS_FACTOR 18 /* zbias/2 */
+#define RADEON_EMIT_SE_TCL_OUTPUT_VTX_FMT 19 /* tcl/11 */
+#define RADEON_EMIT_SE_TCL_MATERIAL_EMMISSIVE_RED 20 /* material/17 */
+#define R200_EMIT_PP_TXCBLEND_0 21 /* tex0/4 */
+#define R200_EMIT_PP_TXCBLEND_1 22 /* tex1/4 */
+#define R200_EMIT_PP_TXCBLEND_2 23 /* tex2/4 */
+#define R200_EMIT_PP_TXCBLEND_3 24 /* tex3/4 */
+#define R200_EMIT_PP_TXCBLEND_4 25 /* tex4/4 */
+#define R200_EMIT_PP_TXCBLEND_5 26 /* tex5/4 */
+#define R200_EMIT_PP_TXCBLEND_6 27 /* /4 */
+#define R200_EMIT_PP_TXCBLEND_7 28 /* /4 */
+#define R200_EMIT_TCL_LIGHT_MODEL_CTL_0 29 /* tcl/7 */
+#define R200_EMIT_TFACTOR_0 30 /* tf/7 */
+#define R200_EMIT_VTX_FMT_0 31 /* vtx/5 */
+#define R200_EMIT_VAP_CTL 32 /* vap/1 */
+#define R200_EMIT_MATRIX_SELECT_0 33 /* msl/5 */
+#define R200_EMIT_TEX_PROC_CTL_2 34 /* tcg/5 */
+#define R200_EMIT_TCL_UCP_VERT_BLEND_CTL 35 /* tcl/1 */
+#define R200_EMIT_PP_TXFILTER_0 36 /* tex0/6 */
+#define R200_EMIT_PP_TXFILTER_1 37 /* tex1/6 */
+#define R200_EMIT_PP_TXFILTER_2 38 /* tex2/6 */
+#define R200_EMIT_PP_TXFILTER_3 39 /* tex3/6 */
+#define R200_EMIT_PP_TXFILTER_4 40 /* tex4/6 */
+#define R200_EMIT_PP_TXFILTER_5 41 /* tex5/6 */
+#define R200_EMIT_PP_TXOFFSET_0 42 /* tex0/1 */
+#define R200_EMIT_PP_TXOFFSET_1 43 /* tex1/1 */
+#define R200_EMIT_PP_TXOFFSET_2 44 /* tex2/1 */
+#define R200_EMIT_PP_TXOFFSET_3 45 /* tex3/1 */
+#define R200_EMIT_PP_TXOFFSET_4 46 /* tex4/1 */
+#define R200_EMIT_PP_TXOFFSET_5 47 /* tex5/1 */
+#define R200_EMIT_VTE_CNTL 48 /* vte/1 */
+#define R200_EMIT_OUTPUT_VTX_COMP_SEL 49 /* vtx/1 */
+#define R200_EMIT_PP_TAM_DEBUG3 50 /* tam/1 */
+#define R200_EMIT_PP_CNTL_X 51 /* cst/1 */
+#define R200_EMIT_RB3D_DEPTHXY_OFFSET 52 /* cst/1 */
+#define R200_EMIT_RE_AUX_SCISSOR_CNTL 53 /* cst/1 */
+#define R200_EMIT_RE_SCISSOR_TL_0 54 /* cst/2 */
+#define R200_EMIT_RE_SCISSOR_TL_1 55 /* cst/2 */
+#define R200_EMIT_RE_SCISSOR_TL_2 56 /* cst/2 */
+#define R200_EMIT_SE_VAP_CNTL_STATUS 57 /* cst/1 */
+#define R200_EMIT_SE_VTX_STATE_CNTL 58 /* cst/1 */
+#define R200_EMIT_RE_POINTSIZE 59 /* cst/1 */
+#define R200_EMIT_TCL_INPUT_VTX_VECTOR_ADDR_0 60 /* cst/4 */
+#define R200_EMIT_PP_CUBIC_FACES_0 61
+#define R200_EMIT_PP_CUBIC_OFFSETS_0 62
+#define R200_EMIT_PP_CUBIC_FACES_1 63
+#define R200_EMIT_PP_CUBIC_OFFSETS_1 64
+#define R200_EMIT_PP_CUBIC_FACES_2 65
+#define R200_EMIT_PP_CUBIC_OFFSETS_2 66
+#define R200_EMIT_PP_CUBIC_FACES_3 67
+#define R200_EMIT_PP_CUBIC_OFFSETS_3 68
+#define R200_EMIT_PP_CUBIC_FACES_4 69
+#define R200_EMIT_PP_CUBIC_OFFSETS_4 70
+#define R200_EMIT_PP_CUBIC_FACES_5 71
+#define R200_EMIT_PP_CUBIC_OFFSETS_5 72
+#define RADEON_EMIT_PP_TEX_SIZE_0 73
+#define RADEON_EMIT_PP_TEX_SIZE_1 74
+#define RADEON_EMIT_PP_TEX_SIZE_2 75
+#define R200_EMIT_RB3D_BLENDCOLOR 76
+#define R200_EMIT_TCL_POINT_SPRITE_CNTL 77
+#define RADEON_EMIT_PP_CUBIC_FACES_0 78
+#define RADEON_EMIT_PP_CUBIC_OFFSETS_T0 79
+#define RADEON_EMIT_PP_CUBIC_FACES_1 80
+#define RADEON_EMIT_PP_CUBIC_OFFSETS_T1 81
+#define RADEON_EMIT_PP_CUBIC_FACES_2 82
+#define RADEON_EMIT_PP_CUBIC_OFFSETS_T2 83
+#define R200_EMIT_PP_TRI_PERF_CNTL 84
+#define R200_EMIT_PP_AFS_0 85
+#define R200_EMIT_PP_AFS_1 86
+#define R200_EMIT_ATF_TFACTOR 87
+#define R200_EMIT_PP_TXCTLALL_0 88
+#define R200_EMIT_PP_TXCTLALL_1 89
+#define R200_EMIT_PP_TXCTLALL_2 90
+#define R200_EMIT_PP_TXCTLALL_3 91
+#define R200_EMIT_PP_TXCTLALL_4 92
+#define R200_EMIT_PP_TXCTLALL_5 93
+#define R200_EMIT_VAP_PVS_CNTL 94
+#define RADEON_MAX_STATE_PACKETS 95
+
+/* Commands understood by cmd_buffer ioctl. More can be added but
+ * obviously these can't be removed or changed:
+ */
+#define RADEON_CMD_PACKET 1 /* emit one of the register packets above */
+#define RADEON_CMD_SCALARS 2 /* emit scalar data */
+#define RADEON_CMD_VECTORS 3 /* emit vector data */
+#define RADEON_CMD_DMA_DISCARD 4 /* discard current dma buf */
+#define RADEON_CMD_PACKET3 5 /* emit hw packet */
+#define RADEON_CMD_PACKET3_CLIP 6 /* emit hw packet wrapped in cliprects */
+#define RADEON_CMD_SCALARS2 7 /* r200 stopgap */
+#define RADEON_CMD_WAIT 8 /* emit hw wait commands -- note:
+ * doesn't make the cpu wait, just
+ * the graphics hardware */
+#define RADEON_CMD_VECLINEAR 9 /* another r200 stopgap */
+
+typedef union {
+ int i;
+ struct {
+ unsigned char cmd_type, pad0, pad1, pad2;
+ } header;
+ struct {
+ unsigned char cmd_type, packet_id, pad0, pad1;
+ } packet;
+ struct {
+ unsigned char cmd_type, offset, stride, count;
+ } scalars;
+ struct {
+ unsigned char cmd_type, offset, stride, count;
+ } vectors;
+ struct {
+ unsigned char cmd_type, addr_lo, addr_hi, count;
+ } veclinear;
+ struct {
+ unsigned char cmd_type, buf_idx, pad0, pad1;
+ } dma;
+ struct {
+ unsigned char cmd_type, flags, pad0, pad1;
+ } wait;
+} drm_radeon_cmd_header_t;
+
+#define RADEON_WAIT_2D 0x1
+#define RADEON_WAIT_3D 0x2
+
+/* Allowed parameters for R300_CMD_PACKET3
+ */
+#define R300_CMD_PACKET3_CLEAR 0
+#define R300_CMD_PACKET3_RAW 1
+
+/* Commands understood by cmd_buffer ioctl for R300.
+ * The interface has not been stabilized, so some of these may be removed
+ * and eventually reordered before stabilization.
+ */
+#define R300_CMD_PACKET0 1
+#define R300_CMD_VPU 2 /* emit vertex program upload */
+#define R300_CMD_PACKET3 3 /* emit a packet3 */
+#define R300_CMD_END3D 4 /* emit sequence ending 3d rendering */
+#define R300_CMD_CP_DELAY 5
+#define R300_CMD_DMA_DISCARD 6
+#define R300_CMD_WAIT 7
+# define R300_WAIT_2D 0x1
+# define R300_WAIT_3D 0x2
+/* these two defines are DOING IT WRONG - however
+ * we have userspace which relies on using these.
+ * The wait interface is backwards compat new
+ * code should use the NEW_WAIT defines below
+ * THESE ARE NOT BIT FIELDS
+ */
+# define R300_WAIT_2D_CLEAN 0x3
+# define R300_WAIT_3D_CLEAN 0x4
+
+# define R300_NEW_WAIT_2D_3D 0x3
+# define R300_NEW_WAIT_2D_2D_CLEAN 0x4
+# define R300_NEW_WAIT_3D_3D_CLEAN 0x6
+# define R300_NEW_WAIT_2D_2D_CLEAN_3D_3D_CLEAN 0x8
+
+#define R300_CMD_SCRATCH 8
+#define R300_CMD_R500FP 9
+
+typedef union {
+ unsigned int u;
+ struct {
+ unsigned char cmd_type, pad0, pad1, pad2;
+ } header;
+ struct {
+ unsigned char cmd_type, count, reglo, reghi;
+ } packet0;
+ struct {
+ unsigned char cmd_type, count, adrlo, adrhi;
+ } vpu;
+ struct {
+ unsigned char cmd_type, packet, pad0, pad1;
+ } packet3;
+ struct {
+ unsigned char cmd_type, packet;
+ unsigned short count; /* amount of packet2 to emit */
+ } delay;
+ struct {
+ unsigned char cmd_type, buf_idx, pad0, pad1;
+ } dma;
+ struct {
+ unsigned char cmd_type, flags, pad0, pad1;
+ } wait;
+ struct {
+ unsigned char cmd_type, reg, n_bufs, flags;
+ } scratch;
+ struct {
+ unsigned char cmd_type, count, adrlo, adrhi_flags;
+ } r500fp;
+} drm_r300_cmd_header_t;
+
+#define RADEON_FRONT 0x1
+#define RADEON_BACK 0x2
+#define RADEON_DEPTH 0x4
+#define RADEON_STENCIL 0x8
+#define RADEON_CLEAR_FASTZ 0x80000000
+#define RADEON_USE_HIERZ 0x40000000
+#define RADEON_USE_COMP_ZBUF 0x20000000
+
+#define R500FP_CONSTANT_TYPE (1 << 1)
+#define R500FP_CONSTANT_CLAMP (1 << 2)
+
+/* Primitive types
+ */
+#define RADEON_POINTS 0x1
+#define RADEON_LINES 0x2
+#define RADEON_LINE_STRIP 0x3
+#define RADEON_TRIANGLES 0x4
+#define RADEON_TRIANGLE_FAN 0x5
+#define RADEON_TRIANGLE_STRIP 0x6
+
+/* Vertex/indirect buffer size
+ */
+#define RADEON_BUFFER_SIZE 65536
+
+/* Byte offsets for indirect buffer data
+ */
+#define RADEON_INDEX_PRIM_OFFSET 20
+
+#define RADEON_SCRATCH_REG_OFFSET 32
+
+#define R600_SCRATCH_REG_OFFSET 256
+
+#define RADEON_NR_SAREA_CLIPRECTS 12
+
+/* There are 2 heaps (local/GART). Each region within a heap is a
+ * minimum of 64k, and there are at most 64 of them per heap.
+ */
+#define RADEON_LOCAL_TEX_HEAP 0
+#define RADEON_GART_TEX_HEAP 1
+#define RADEON_NR_TEX_HEAPS 2
+#define RADEON_NR_TEX_REGIONS 64
+#define RADEON_LOG_TEX_GRANULARITY 16
+
+#define RADEON_MAX_TEXTURE_LEVELS 12
+#define RADEON_MAX_TEXTURE_UNITS 3
+
+#define RADEON_MAX_SURFACES 8
+
+/* Blits have strict offset rules. All blit offset must be aligned on
+ * a 1K-byte boundary.
+ */
+#define RADEON_OFFSET_SHIFT 10
+#define RADEON_OFFSET_ALIGN (1 << RADEON_OFFSET_SHIFT)
+#define RADEON_OFFSET_MASK (RADEON_OFFSET_ALIGN - 1)
+
+#endif /* __RADEON_SAREA_DEFINES__ */
+
+typedef struct {
+ unsigned int red;
+ unsigned int green;
+ unsigned int blue;
+ unsigned int alpha;
+} radeon_color_regs_t;
+
+typedef struct {
+ /* Context state */
+ unsigned int pp_misc; /* 0x1c14 */
+ unsigned int pp_fog_color;
+ unsigned int re_solid_color;
+ unsigned int rb3d_blendcntl;
+ unsigned int rb3d_depthoffset;
+ unsigned int rb3d_depthpitch;
+ unsigned int rb3d_zstencilcntl;
+
+ unsigned int pp_cntl; /* 0x1c38 */
+ unsigned int rb3d_cntl;
+ unsigned int rb3d_coloroffset;
+ unsigned int re_width_height;
+ unsigned int rb3d_colorpitch;
+ unsigned int se_cntl;
+
+ /* Vertex format state */
+ unsigned int se_coord_fmt; /* 0x1c50 */
+
+ /* Line state */
+ unsigned int re_line_pattern; /* 0x1cd0 */
+ unsigned int re_line_state;
+
+ unsigned int se_line_width; /* 0x1db8 */
+
+ /* Bumpmap state */
+ unsigned int pp_lum_matrix; /* 0x1d00 */
+
+ unsigned int pp_rot_matrix_0; /* 0x1d58 */
+ unsigned int pp_rot_matrix_1;
+
+ /* Mask state */
+ unsigned int rb3d_stencilrefmask; /* 0x1d7c */
+ unsigned int rb3d_ropcntl;
+ unsigned int rb3d_planemask;
+
+ /* Viewport state */
+ unsigned int se_vport_xscale; /* 0x1d98 */
+ unsigned int se_vport_xoffset;
+ unsigned int se_vport_yscale;
+ unsigned int se_vport_yoffset;
+ unsigned int se_vport_zscale;
+ unsigned int se_vport_zoffset;
+
+ /* Setup state */
+ unsigned int se_cntl_status; /* 0x2140 */
+
+ /* Misc state */
+ unsigned int re_top_left; /* 0x26c0 */
+ unsigned int re_misc;
+} drm_radeon_context_regs_t;
+
+typedef struct {
+ /* Zbias state */
+ unsigned int se_zbias_factor; /* 0x1dac */
+ unsigned int se_zbias_constant;
+} drm_radeon_context2_regs_t;
+
+/* Setup registers for each texture unit
+ */
+typedef struct {
+ unsigned int pp_txfilter;
+ unsigned int pp_txformat;
+ unsigned int pp_txoffset;
+ unsigned int pp_txcblend;
+ unsigned int pp_txablend;
+ unsigned int pp_tfactor;
+ unsigned int pp_border_color;
+} drm_radeon_texture_regs_t;
+
+typedef struct {
+ unsigned int start;
+ unsigned int finish;
+ unsigned int prim:8;
+ unsigned int stateidx:8;
+ unsigned int numverts:16; /* overloaded as offset/64 for elt prims */
+ unsigned int vc_format; /* vertex format */
+} drm_radeon_prim_t;
+
+typedef struct {
+ drm_radeon_context_regs_t context;
+ drm_radeon_texture_regs_t tex[RADEON_MAX_TEXTURE_UNITS];
+ drm_radeon_context2_regs_t context2;
+ unsigned int dirty;
+} drm_radeon_state_t;
+
+typedef struct {
+ /* The channel for communication of state information to the
+ * kernel on firing a vertex buffer with either of the
+ * obsoleted vertex/index ioctls.
+ */
+ drm_radeon_context_regs_t context_state;
+ drm_radeon_texture_regs_t tex_state[RADEON_MAX_TEXTURE_UNITS];
+ unsigned int dirty;
+ unsigned int vertsize;
+ unsigned int vc_format;
+
+ /* The current cliprects, or a subset thereof.
+ */
+ struct drm_clip_rect boxes[RADEON_NR_SAREA_CLIPRECTS];
+ unsigned int nbox;
+
+ /* Counters for client-side throttling of rendering clients.
+ */
+ unsigned int last_frame;
+ unsigned int last_dispatch;
+ unsigned int last_clear;
+
+ struct drm_tex_region tex_list[RADEON_NR_TEX_HEAPS][RADEON_NR_TEX_REGIONS +
+ 1];
+ unsigned int tex_age[RADEON_NR_TEX_HEAPS];
+ int ctx_owner;
+ int pfState; /* number of 3d windows (0,1,2ormore) */
+ int pfCurrentPage; /* which buffer is being displayed? */
+ int crtc2_base; /* CRTC2 frame offset */
+ int tiling_enabled; /* set by drm, read by 2d + 3d clients */
+} drm_radeon_sarea_t;
+
+/* WARNING: If you change any of these defines, make sure to change the
+ * defines in the Xserver file (xf86drmRadeon.h)
+ *
+ * KW: actually it's illegal to change any of this (backwards compatibility).
+ */
+
+/* Radeon specific ioctls
+ * The device specific ioctl range is 0x40 to 0x79.
+ */
+#define DRM_RADEON_CP_INIT 0x00
+#define DRM_RADEON_CP_START 0x01
+#define DRM_RADEON_CP_STOP 0x02
+#define DRM_RADEON_CP_RESET 0x03
+#define DRM_RADEON_CP_IDLE 0x04
+#define DRM_RADEON_RESET 0x05
+#define DRM_RADEON_FULLSCREEN 0x06
+#define DRM_RADEON_SWAP 0x07
+#define DRM_RADEON_CLEAR 0x08
+#define DRM_RADEON_VERTEX 0x09
+#define DRM_RADEON_INDICES 0x0A
+#define DRM_RADEON_NOT_USED
+#define DRM_RADEON_STIPPLE 0x0C
+#define DRM_RADEON_INDIRECT 0x0D
+#define DRM_RADEON_TEXTURE 0x0E
+#define DRM_RADEON_VERTEX2 0x0F
+#define DRM_RADEON_CMDBUF 0x10
+#define DRM_RADEON_GETPARAM 0x11
+#define DRM_RADEON_FLIP 0x12
+#define DRM_RADEON_ALLOC 0x13
+#define DRM_RADEON_FREE 0x14
+#define DRM_RADEON_INIT_HEAP 0x15
+#define DRM_RADEON_IRQ_EMIT 0x16
+#define DRM_RADEON_IRQ_WAIT 0x17
+#define DRM_RADEON_CP_RESUME 0x18
+#define DRM_RADEON_SETPARAM 0x19
+#define DRM_RADEON_SURF_ALLOC 0x1a
+#define DRM_RADEON_SURF_FREE 0x1b
+
+#define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t)
+#define DRM_IOCTL_RADEON_CP_START DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_START)
+#define DRM_IOCTL_RADEON_CP_STOP DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_STOP, drm_radeon_cp_stop_t)
+#define DRM_IOCTL_RADEON_CP_RESET DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_RESET)
+#define DRM_IOCTL_RADEON_CP_IDLE DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_IDLE)
+#define DRM_IOCTL_RADEON_RESET DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_RESET)
+#define DRM_IOCTL_RADEON_FULLSCREEN DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_FULLSCREEN, drm_radeon_fullscreen_t)
+#define DRM_IOCTL_RADEON_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_SWAP)
+#define DRM_IOCTL_RADEON_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CLEAR, drm_radeon_clear_t)
+#define DRM_IOCTL_RADEON_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_VERTEX, drm_radeon_vertex_t)
+#define DRM_IOCTL_RADEON_INDICES DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_INDICES, drm_radeon_indices_t)
+#define DRM_IOCTL_RADEON_STIPPLE DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_STIPPLE, drm_radeon_stipple_t)
+#define DRM_IOCTL_RADEON_INDIRECT DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INDIRECT, drm_radeon_indirect_t)
+#define DRM_IOCTL_RADEON_TEXTURE DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_TEXTURE, drm_radeon_texture_t)
+#define DRM_IOCTL_RADEON_VERTEX2 DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_VERTEX2, drm_radeon_vertex2_t)
+#define DRM_IOCTL_RADEON_CMDBUF DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CMDBUF, drm_radeon_cmd_buffer_t)
+#define DRM_IOCTL_RADEON_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GETPARAM, drm_radeon_getparam_t)
+#define DRM_IOCTL_RADEON_FLIP DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_FLIP)
+#define DRM_IOCTL_RADEON_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_ALLOC, drm_radeon_mem_alloc_t)
+#define DRM_IOCTL_RADEON_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_FREE, drm_radeon_mem_free_t)
+#define DRM_IOCTL_RADEON_INIT_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_INIT_HEAP, drm_radeon_mem_init_heap_t)
+#define DRM_IOCTL_RADEON_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_IRQ_EMIT, drm_radeon_irq_emit_t)
+#define DRM_IOCTL_RADEON_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_IRQ_WAIT, drm_radeon_irq_wait_t)
+#define DRM_IOCTL_RADEON_CP_RESUME DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_RESUME)
+#define DRM_IOCTL_RADEON_SETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SETPARAM, drm_radeon_setparam_t)
+#define DRM_IOCTL_RADEON_SURF_ALLOC DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SURF_ALLOC, drm_radeon_surface_alloc_t)
+#define DRM_IOCTL_RADEON_SURF_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SURF_FREE, drm_radeon_surface_free_t)
+
+typedef struct drm_radeon_init {
+ enum {
+ RADEON_INIT_CP = 0x01,
+ RADEON_CLEANUP_CP = 0x02,
+ RADEON_INIT_R200_CP = 0x03,
+ RADEON_INIT_R300_CP = 0x04,
+ RADEON_INIT_R600_CP = 0x05
+ } func;
+ unsigned long sarea_priv_offset;
+ int is_pci;
+ int cp_mode;
+ int gart_size;
+ int ring_size;
+ int usec_timeout;
+
+ unsigned int fb_bpp;
+ unsigned int front_offset, front_pitch;
+ unsigned int back_offset, back_pitch;
+ unsigned int depth_bpp;
+ unsigned int depth_offset, depth_pitch;
+
+ unsigned long fb_offset;
+ unsigned long mmio_offset;
+ unsigned long ring_offset;
+ unsigned long ring_rptr_offset;
+ unsigned long buffers_offset;
+ unsigned long gart_textures_offset;
+} drm_radeon_init_t;
+
+typedef struct drm_radeon_cp_stop {
+ int flush;
+ int idle;
+} drm_radeon_cp_stop_t;
+
+typedef struct drm_radeon_fullscreen {
+ enum {
+ RADEON_INIT_FULLSCREEN = 0x01,
+ RADEON_CLEANUP_FULLSCREEN = 0x02
+ } func;
+} drm_radeon_fullscreen_t;
+
+#define CLEAR_X1 0
+#define CLEAR_Y1 1
+#define CLEAR_X2 2
+#define CLEAR_Y2 3
+#define CLEAR_DEPTH 4
+
+typedef union drm_radeon_clear_rect {
+ float f[5];
+ unsigned int ui[5];
+} drm_radeon_clear_rect_t;
+
+typedef struct drm_radeon_clear {
+ unsigned int flags;
+ unsigned int clear_color;
+ unsigned int clear_depth;
+ unsigned int color_mask;
+ unsigned int depth_mask; /* misnamed field: should be stencil */
+ drm_radeon_clear_rect_t *depth_boxes;
+} drm_radeon_clear_t;
+
+typedef struct drm_radeon_vertex {
+ int prim;
+ int idx; /* Index of vertex buffer */
+ int count; /* Number of vertices in buffer */
+ int discard; /* Client finished with buffer? */
+} drm_radeon_vertex_t;
+
+typedef struct drm_radeon_indices {
+ int prim;
+ int idx;
+ int start;
+ int end;
+ int discard; /* Client finished with buffer? */
+} drm_radeon_indices_t;
+
+/* v1.2 - obsoletes drm_radeon_vertex and drm_radeon_indices
+ * - allows multiple primitives and state changes in a single ioctl
+ * - supports driver change to emit native primitives
+ */
+typedef struct drm_radeon_vertex2 {
+ int idx; /* Index of vertex buffer */
+ int discard; /* Client finished with buffer? */
+ int nr_states;
+ drm_radeon_state_t *state;
+ int nr_prims;
+ drm_radeon_prim_t *prim;
+} drm_radeon_vertex2_t;
+
+/* v1.3 - obsoletes drm_radeon_vertex2
+ * - allows arbitarily large cliprect list
+ * - allows updating of tcl packet, vector and scalar state
+ * - allows memory-efficient description of state updates
+ * - allows state to be emitted without a primitive
+ * (for clears, ctx switches)
+ * - allows more than one dma buffer to be referenced per ioctl
+ * - supports tcl driver
+ * - may be extended in future versions with new cmd types, packets
+ */
+typedef struct drm_radeon_cmd_buffer {
+ int bufsz;
+ char *buf;
+ int nbox;
+ struct drm_clip_rect *boxes;
+} drm_radeon_cmd_buffer_t;
+
+typedef struct drm_radeon_tex_image {
+ unsigned int x, y; /* Blit coordinates */
+ unsigned int width, height;
+ const void *data;
+} drm_radeon_tex_image_t;
+
+typedef struct drm_radeon_texture {
+ unsigned int offset;
+ int pitch;
+ int format;
+ int width; /* Texture image coordinates */
+ int height;
+ drm_radeon_tex_image_t *image;
+} drm_radeon_texture_t;
+
+typedef struct drm_radeon_stipple {
+ unsigned int *mask;
+} drm_radeon_stipple_t;
+
+typedef struct drm_radeon_indirect {
+ int idx;
+ int start;
+ int end;
+ int discard;
+} drm_radeon_indirect_t;
+
+/* enum for card type parameters */
+#define RADEON_CARD_PCI 0
+#define RADEON_CARD_AGP 1
+#define RADEON_CARD_PCIE 2
+
+/* 1.3: An ioctl to get parameters that aren't available to the 3d
+ * client any other way.
+ */
+#define RADEON_PARAM_GART_BUFFER_OFFSET 1 /* card offset of 1st GART buffer */
+#define RADEON_PARAM_LAST_FRAME 2
+#define RADEON_PARAM_LAST_DISPATCH 3
+#define RADEON_PARAM_LAST_CLEAR 4
+/* Added with DRM version 1.6. */
+#define RADEON_PARAM_IRQ_NR 5
+#define RADEON_PARAM_GART_BASE 6 /* card offset of GART base */
+/* Added with DRM version 1.8. */
+#define RADEON_PARAM_REGISTER_HANDLE 7 /* for drmMap() */
+#define RADEON_PARAM_STATUS_HANDLE 8
+#define RADEON_PARAM_SAREA_HANDLE 9
+#define RADEON_PARAM_GART_TEX_HANDLE 10
+#define RADEON_PARAM_SCRATCH_OFFSET 11
+#define RADEON_PARAM_CARD_TYPE 12
+#define RADEON_PARAM_VBLANK_CRTC 13 /* VBLANK CRTC */
+#define RADEON_PARAM_FB_LOCATION 14 /* FB location */
+#define RADEON_PARAM_NUM_GB_PIPES 15 /* num GB pipes */
+
+typedef struct drm_radeon_getparam {
+ int param;
+ void *value;
+} drm_radeon_getparam_t;
+
+/* 1.6: Set up a memory manager for regions of shared memory:
+ */
+#define RADEON_MEM_REGION_GART 1
+#define RADEON_MEM_REGION_FB 2
+
+typedef struct drm_radeon_mem_alloc {
+ int region;
+ int alignment;
+ int size;
+ int *region_offset; /* offset from start of fb or GART */
+} drm_radeon_mem_alloc_t;
+
+typedef struct drm_radeon_mem_free {
+ int region;
+ int region_offset;
+} drm_radeon_mem_free_t;
+
+typedef struct drm_radeon_mem_init_heap {
+ int region;
+ int size;
+ int start;
+} drm_radeon_mem_init_heap_t;
+
+/* 1.6: Userspace can request & wait on irq's:
+ */
+typedef struct drm_radeon_irq_emit {
+ int *irq_seq;
+} drm_radeon_irq_emit_t;
+
+typedef struct drm_radeon_irq_wait {
+ int irq_seq;
+} drm_radeon_irq_wait_t;
+
+/* 1.10: Clients tell the DRM where they think the framebuffer is located in
+ * the card's address space, via a new generic ioctl to set parameters
+ */
+
+typedef struct drm_radeon_setparam {
+ unsigned int param;
+ __s64 value;
+} drm_radeon_setparam_t;
+
+#define RADEON_SETPARAM_FB_LOCATION 1 /* determined framebuffer location */
+#define RADEON_SETPARAM_SWITCH_TILING 2 /* enable/disable color tiling */
+#define RADEON_SETPARAM_PCIGART_LOCATION 3 /* PCI Gart Location */
+#define RADEON_SETPARAM_NEW_MEMMAP 4 /* Use new memory map */
+#define RADEON_SETPARAM_PCIGART_TABLE_SIZE 5 /* PCI GART Table Size */
+#define RADEON_SETPARAM_VBLANK_CRTC 6 /* VBLANK CRTC */
+/* 1.14: Clients can allocate/free a surface
+ */
+typedef struct drm_radeon_surface_alloc {
+ unsigned int address;
+ unsigned int size;
+ unsigned int flags;
+} drm_radeon_surface_alloc_t;
+
+typedef struct drm_radeon_surface_free {
+ unsigned int address;
+} drm_radeon_surface_free_t;
+
+#define DRM_RADEON_VBLANK_CRTC1 1
+#define DRM_RADEON_VBLANK_CRTC2 2
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/savage_drm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/savage_drm.h
new file mode 100644
index 0000000..f7a75ef
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/savage_drm.h
@@ -0,0 +1,210 @@
+/* savage_drm.h -- Public header for the savage driver
+ *
+ * Copyright 2004 Felix Kuehling
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sub license,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL FELIX KUEHLING BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __SAVAGE_DRM_H__
+#define __SAVAGE_DRM_H__
+
+#ifndef __SAVAGE_SAREA_DEFINES__
+#define __SAVAGE_SAREA_DEFINES__
+
+/* 2 heaps (1 for card, 1 for agp), each divided into upto 128
+ * regions, subject to a minimum region size of (1<<16) == 64k.
+ *
+ * Clients may subdivide regions internally, but when sharing between
+ * clients, the region size is the minimum granularity.
+ */
+
+#define SAVAGE_CARD_HEAP 0
+#define SAVAGE_AGP_HEAP 1
+#define SAVAGE_NR_TEX_HEAPS 2
+#define SAVAGE_NR_TEX_REGIONS 16
+#define SAVAGE_LOG_MIN_TEX_REGION_SIZE 16
+
+#endif /* __SAVAGE_SAREA_DEFINES__ */
+
+typedef struct _drm_savage_sarea {
+ /* LRU lists for texture memory in agp space and on the card.
+ */
+ struct drm_tex_region texList[SAVAGE_NR_TEX_HEAPS][SAVAGE_NR_TEX_REGIONS +
+ 1];
+ unsigned int texAge[SAVAGE_NR_TEX_HEAPS];
+
+ /* Mechanism to validate card state.
+ */
+ int ctxOwner;
+} drm_savage_sarea_t, *drm_savage_sarea_ptr;
+
+/* Savage-specific ioctls
+ */
+#define DRM_SAVAGE_BCI_INIT 0x00
+#define DRM_SAVAGE_BCI_CMDBUF 0x01
+#define DRM_SAVAGE_BCI_EVENT_EMIT 0x02
+#define DRM_SAVAGE_BCI_EVENT_WAIT 0x03
+
+#define DRM_IOCTL_SAVAGE_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_SAVAGE_BCI_INIT, drm_savage_init_t)
+#define DRM_IOCTL_SAVAGE_CMDBUF DRM_IOW( DRM_COMMAND_BASE + DRM_SAVAGE_BCI_CMDBUF, drm_savage_cmdbuf_t)
+#define DRM_IOCTL_SAVAGE_EVENT_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_SAVAGE_BCI_EVENT_EMIT, drm_savage_event_emit_t)
+#define DRM_IOCTL_SAVAGE_EVENT_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_SAVAGE_BCI_EVENT_WAIT, drm_savage_event_wait_t)
+
+#define SAVAGE_DMA_PCI 1
+#define SAVAGE_DMA_AGP 3
+typedef struct drm_savage_init {
+ enum {
+ SAVAGE_INIT_BCI = 1,
+ SAVAGE_CLEANUP_BCI = 2
+ } func;
+ unsigned int sarea_priv_offset;
+
+ /* some parameters */
+ unsigned int cob_size;
+ unsigned int bci_threshold_lo, bci_threshold_hi;
+ unsigned int dma_type;
+
+ /* frame buffer layout */
+ unsigned int fb_bpp;
+ unsigned int front_offset, front_pitch;
+ unsigned int back_offset, back_pitch;
+ unsigned int depth_bpp;
+ unsigned int depth_offset, depth_pitch;
+
+ /* local textures */
+ unsigned int texture_offset;
+ unsigned int texture_size;
+
+ /* physical locations of non-permanent maps */
+ unsigned long status_offset;
+ unsigned long buffers_offset;
+ unsigned long agp_textures_offset;
+ unsigned long cmd_dma_offset;
+} drm_savage_init_t;
+
+typedef union drm_savage_cmd_header drm_savage_cmd_header_t;
+typedef struct drm_savage_cmdbuf {
+ /* command buffer in client's address space */
+ drm_savage_cmd_header_t *cmd_addr;
+ unsigned int size; /* size of the command buffer in 64bit units */
+
+ unsigned int dma_idx; /* DMA buffer index to use */
+ int discard; /* discard DMA buffer when done */
+ /* vertex buffer in client's address space */
+ unsigned int *vb_addr;
+ unsigned int vb_size; /* size of client vertex buffer in bytes */
+ unsigned int vb_stride; /* stride of vertices in 32bit words */
+ /* boxes in client's address space */
+ struct drm_clip_rect *box_addr;
+ unsigned int nbox; /* number of clipping boxes */
+} drm_savage_cmdbuf_t;
+
+#define SAVAGE_WAIT_2D 0x1 /* wait for 2D idle before updating event tag */
+#define SAVAGE_WAIT_3D 0x2 /* wait for 3D idle before updating event tag */
+#define SAVAGE_WAIT_IRQ 0x4 /* emit or wait for IRQ, not implemented yet */
+typedef struct drm_savage_event {
+ unsigned int count;
+ unsigned int flags;
+} drm_savage_event_emit_t, drm_savage_event_wait_t;
+
+/* Commands for the cmdbuf ioctl
+ */
+#define SAVAGE_CMD_STATE 0 /* a range of state registers */
+#define SAVAGE_CMD_DMA_PRIM 1 /* vertices from DMA buffer */
+#define SAVAGE_CMD_VB_PRIM 2 /* vertices from client vertex buffer */
+#define SAVAGE_CMD_DMA_IDX 3 /* indexed vertices from DMA buffer */
+#define SAVAGE_CMD_VB_IDX 4 /* indexed vertices client vertex buffer */
+#define SAVAGE_CMD_CLEAR 5 /* clear buffers */
+#define SAVAGE_CMD_SWAP 6 /* swap buffers */
+
+/* Primitive types
+*/
+#define SAVAGE_PRIM_TRILIST 0 /* triangle list */
+#define SAVAGE_PRIM_TRISTRIP 1 /* triangle strip */
+#define SAVAGE_PRIM_TRIFAN 2 /* triangle fan */
+#define SAVAGE_PRIM_TRILIST_201 3 /* reorder verts for correct flat
+ * shading on s3d */
+
+/* Skip flags (vertex format)
+ */
+#define SAVAGE_SKIP_Z 0x01
+#define SAVAGE_SKIP_W 0x02
+#define SAVAGE_SKIP_C0 0x04
+#define SAVAGE_SKIP_C1 0x08
+#define SAVAGE_SKIP_S0 0x10
+#define SAVAGE_SKIP_T0 0x20
+#define SAVAGE_SKIP_ST0 0x30
+#define SAVAGE_SKIP_S1 0x40
+#define SAVAGE_SKIP_T1 0x80
+#define SAVAGE_SKIP_ST1 0xc0
+#define SAVAGE_SKIP_ALL_S3D 0x3f
+#define SAVAGE_SKIP_ALL_S4 0xff
+
+/* Buffer names for clear command
+ */
+#define SAVAGE_FRONT 0x1
+#define SAVAGE_BACK 0x2
+#define SAVAGE_DEPTH 0x4
+
+/* 64-bit command header
+ */
+union drm_savage_cmd_header {
+ struct {
+ unsigned char cmd; /* command */
+ unsigned char pad0;
+ unsigned short pad1;
+ unsigned short pad2;
+ unsigned short pad3;
+ } cmd; /* generic */
+ struct {
+ unsigned char cmd;
+ unsigned char global; /* need idle engine? */
+ unsigned short count; /* number of consecutive registers */
+ unsigned short start; /* first register */
+ unsigned short pad3;
+ } state; /* SAVAGE_CMD_STATE */
+ struct {
+ unsigned char cmd;
+ unsigned char prim; /* primitive type */
+ unsigned short skip; /* vertex format (skip flags) */
+ unsigned short count; /* number of vertices */
+ unsigned short start; /* first vertex in DMA/vertex buffer */
+ } prim; /* SAVAGE_CMD_DMA_PRIM, SAVAGE_CMD_VB_PRIM */
+ struct {
+ unsigned char cmd;
+ unsigned char prim;
+ unsigned short skip;
+ unsigned short count; /* number of indices that follow */
+ unsigned short pad3;
+ } idx; /* SAVAGE_CMD_DMA_IDX, SAVAGE_CMD_VB_IDX */
+ struct {
+ unsigned char cmd;
+ unsigned char pad0;
+ unsigned short pad1;
+ unsigned int flags;
+ } clear0; /* SAVAGE_CMD_CLEAR */
+ struct {
+ unsigned int mask;
+ unsigned int value;
+ } clear1; /* SAVAGE_CMD_CLEAR data */
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/sis_drm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/sis_drm.h
new file mode 100644
index 0000000..30f7b38
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/sis_drm.h
@@ -0,0 +1,67 @@
+/* sis_drv.h -- Private header for sis driver -*- linux-c -*- */
+/*
+ * Copyright 2005 Eric Anholt
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef __SIS_DRM_H__
+#define __SIS_DRM_H__
+
+/* SiS specific ioctls */
+#define NOT_USED_0_3
+#define DRM_SIS_FB_ALLOC 0x04
+#define DRM_SIS_FB_FREE 0x05
+#define NOT_USED_6_12
+#define DRM_SIS_AGP_INIT 0x13
+#define DRM_SIS_AGP_ALLOC 0x14
+#define DRM_SIS_AGP_FREE 0x15
+#define DRM_SIS_FB_INIT 0x16
+
+#define DRM_IOCTL_SIS_FB_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_SIS_FB_ALLOC, drm_sis_mem_t)
+#define DRM_IOCTL_SIS_FB_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_SIS_FB_FREE, drm_sis_mem_t)
+#define DRM_IOCTL_SIS_AGP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_SIS_AGP_INIT, drm_sis_agp_t)
+#define DRM_IOCTL_SIS_AGP_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_SIS_AGP_ALLOC, drm_sis_mem_t)
+#define DRM_IOCTL_SIS_AGP_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_SIS_AGP_FREE, drm_sis_mem_t)
+#define DRM_IOCTL_SIS_FB_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_SIS_FB_INIT, drm_sis_fb_t)
+/*
+#define DRM_IOCTL_SIS_FLIP DRM_IOW( 0x48, drm_sis_flip_t)
+#define DRM_IOCTL_SIS_FLIP_INIT DRM_IO( 0x49)
+#define DRM_IOCTL_SIS_FLIP_FINAL DRM_IO( 0x50)
+*/
+
+typedef struct {
+ int context;
+ unsigned int offset;
+ unsigned int size;
+ unsigned long free;
+} drm_sis_mem_t;
+
+typedef struct {
+ unsigned int offset, size;
+} drm_sis_agp_t;
+
+typedef struct {
+ unsigned int offset, size;
+} drm_sis_fb_t;
+
+#endif /* __SIS_DRM_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/via_drm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/via_drm.h
new file mode 100644
index 0000000..535b558
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/drm/via_drm.h
@@ -0,0 +1,275 @@
+/*
+ * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
+ * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sub license,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+#ifndef _VIA_DRM_H_
+#define _VIA_DRM_H_
+
+#include <linux/types.h>
+
+/* WARNING: These defines must be the same as what the Xserver uses.
+ * if you change them, you must change the defines in the Xserver.
+ */
+
+#ifndef _VIA_DEFINES_
+#define _VIA_DEFINES_
+
+#include "via_drmclient.h"
+
+#define VIA_NR_SAREA_CLIPRECTS 8
+#define VIA_NR_XVMC_PORTS 10
+#define VIA_NR_XVMC_LOCKS 5
+#define VIA_MAX_CACHELINE_SIZE 64
+#define XVMCLOCKPTR(saPriv,lockNo) \
+ ((__volatile__ struct drm_hw_lock *)(((((unsigned long) (saPriv)->XvMCLockArea) + \
+ (VIA_MAX_CACHELINE_SIZE - 1)) & \
+ ~(VIA_MAX_CACHELINE_SIZE - 1)) + \
+ VIA_MAX_CACHELINE_SIZE*(lockNo)))
+
+/* Each region is a minimum of 64k, and there are at most 64 of them.
+ */
+#define VIA_NR_TEX_REGIONS 64
+#define VIA_LOG_MIN_TEX_REGION_SIZE 16
+#endif
+
+#define VIA_UPLOAD_TEX0IMAGE 0x1 /* handled clientside */
+#define VIA_UPLOAD_TEX1IMAGE 0x2 /* handled clientside */
+#define VIA_UPLOAD_CTX 0x4
+#define VIA_UPLOAD_BUFFERS 0x8
+#define VIA_UPLOAD_TEX0 0x10
+#define VIA_UPLOAD_TEX1 0x20
+#define VIA_UPLOAD_CLIPRECTS 0x40
+#define VIA_UPLOAD_ALL 0xff
+
+/* VIA specific ioctls */
+#define DRM_VIA_ALLOCMEM 0x00
+#define DRM_VIA_FREEMEM 0x01
+#define DRM_VIA_AGP_INIT 0x02
+#define DRM_VIA_FB_INIT 0x03
+#define DRM_VIA_MAP_INIT 0x04
+#define DRM_VIA_DEC_FUTEX 0x05
+#define NOT_USED
+#define DRM_VIA_DMA_INIT 0x07
+#define DRM_VIA_CMDBUFFER 0x08
+#define DRM_VIA_FLUSH 0x09
+#define DRM_VIA_PCICMD 0x0a
+#define DRM_VIA_CMDBUF_SIZE 0x0b
+#define NOT_USED
+#define DRM_VIA_WAIT_IRQ 0x0d
+#define DRM_VIA_DMA_BLIT 0x0e
+#define DRM_VIA_BLIT_SYNC 0x0f
+
+#define DRM_IOCTL_VIA_ALLOCMEM DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_ALLOCMEM, drm_via_mem_t)
+#define DRM_IOCTL_VIA_FREEMEM DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_FREEMEM, drm_via_mem_t)
+#define DRM_IOCTL_VIA_AGP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_AGP_INIT, drm_via_agp_t)
+#define DRM_IOCTL_VIA_FB_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_FB_INIT, drm_via_fb_t)
+#define DRM_IOCTL_VIA_MAP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_MAP_INIT, drm_via_init_t)
+#define DRM_IOCTL_VIA_DEC_FUTEX DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_DEC_FUTEX, drm_via_futex_t)
+#define DRM_IOCTL_VIA_DMA_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_DMA_INIT, drm_via_dma_init_t)
+#define DRM_IOCTL_VIA_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_CMDBUFFER, drm_via_cmdbuffer_t)
+#define DRM_IOCTL_VIA_FLUSH DRM_IO( DRM_COMMAND_BASE + DRM_VIA_FLUSH)
+#define DRM_IOCTL_VIA_PCICMD DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_PCICMD, drm_via_cmdbuffer_t)
+#define DRM_IOCTL_VIA_CMDBUF_SIZE DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_CMDBUF_SIZE, \
+ drm_via_cmdbuf_size_t)
+#define DRM_IOCTL_VIA_WAIT_IRQ DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_WAIT_IRQ, drm_via_irqwait_t)
+#define DRM_IOCTL_VIA_DMA_BLIT DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_DMA_BLIT, drm_via_dmablit_t)
+#define DRM_IOCTL_VIA_BLIT_SYNC DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_BLIT_SYNC, drm_via_blitsync_t)
+
+/* Indices into buf.Setup where various bits of state are mirrored per
+ * context and per buffer. These can be fired at the card as a unit,
+ * or in a piecewise fashion as required.
+ */
+
+#define VIA_TEX_SETUP_SIZE 8
+
+/* Flags for clear ioctl
+ */
+#define VIA_FRONT 0x1
+#define VIA_BACK 0x2
+#define VIA_DEPTH 0x4
+#define VIA_STENCIL 0x8
+#define VIA_MEM_VIDEO 0 /* matches drm constant */
+#define VIA_MEM_AGP 1 /* matches drm constant */
+#define VIA_MEM_SYSTEM 2
+#define VIA_MEM_MIXED 3
+#define VIA_MEM_UNKNOWN 4
+
+typedef struct {
+ __u32 offset;
+ __u32 size;
+} drm_via_agp_t;
+
+typedef struct {
+ __u32 offset;
+ __u32 size;
+} drm_via_fb_t;
+
+typedef struct {
+ __u32 context;
+ __u32 type;
+ __u32 size;
+ unsigned long index;
+ unsigned long offset;
+} drm_via_mem_t;
+
+typedef struct _drm_via_init {
+ enum {
+ VIA_INIT_MAP = 0x01,
+ VIA_CLEANUP_MAP = 0x02
+ } func;
+
+ unsigned long sarea_priv_offset;
+ unsigned long fb_offset;
+ unsigned long mmio_offset;
+ unsigned long agpAddr;
+} drm_via_init_t;
+
+typedef struct _drm_via_futex {
+ enum {
+ VIA_FUTEX_WAIT = 0x00,
+ VIA_FUTEX_WAKE = 0X01
+ } func;
+ __u32 ms;
+ __u32 lock;
+ __u32 val;
+} drm_via_futex_t;
+
+typedef struct _drm_via_dma_init {
+ enum {
+ VIA_INIT_DMA = 0x01,
+ VIA_CLEANUP_DMA = 0x02,
+ VIA_DMA_INITIALIZED = 0x03
+ } func;
+
+ unsigned long offset;
+ unsigned long size;
+ unsigned long reg_pause_addr;
+} drm_via_dma_init_t;
+
+typedef struct _drm_via_cmdbuffer {
+ char *buf;
+ unsigned long size;
+} drm_via_cmdbuffer_t;
+
+/* Warning: If you change the SAREA structure you must change the Xserver
+ * structure as well */
+
+typedef struct _drm_via_tex_region {
+ unsigned char next, prev; /* indices to form a circular LRU */
+ unsigned char inUse; /* owned by a client, or free? */
+ int age; /* tracked by clients to update local LRU's */
+} drm_via_tex_region_t;
+
+typedef struct _drm_via_sarea {
+ unsigned int dirty;
+ unsigned int nbox;
+ struct drm_clip_rect boxes[VIA_NR_SAREA_CLIPRECTS];
+ drm_via_tex_region_t texList[VIA_NR_TEX_REGIONS + 1];
+ int texAge; /* last time texture was uploaded */
+ int ctxOwner; /* last context to upload state */
+ int vertexPrim;
+
+ /*
+ * Below is for XvMC.
+ * We want the lock integers alone on, and aligned to, a cache line.
+ * Therefore this somewhat strange construct.
+ */
+
+ char XvMCLockArea[VIA_MAX_CACHELINE_SIZE * (VIA_NR_XVMC_LOCKS + 1)];
+
+ unsigned int XvMCDisplaying[VIA_NR_XVMC_PORTS];
+ unsigned int XvMCSubPicOn[VIA_NR_XVMC_PORTS];
+ unsigned int XvMCCtxNoGrabbed; /* Last context to hold decoder */
+
+ /* Used by the 3d driver only at this point, for pageflipping:
+ */
+ unsigned int pfCurrentOffset;
+} drm_via_sarea_t;
+
+typedef struct _drm_via_cmdbuf_size {
+ enum {
+ VIA_CMDBUF_SPACE = 0x01,
+ VIA_CMDBUF_LAG = 0x02
+ } func;
+ int wait;
+ __u32 size;
+} drm_via_cmdbuf_size_t;
+
+typedef enum {
+ VIA_IRQ_ABSOLUTE = 0x0,
+ VIA_IRQ_RELATIVE = 0x1,
+ VIA_IRQ_SIGNAL = 0x10000000,
+ VIA_IRQ_FORCE_SEQUENCE = 0x20000000
+} via_irq_seq_type_t;
+
+#define VIA_IRQ_FLAGS_MASK 0xF0000000
+
+enum drm_via_irqs {
+ drm_via_irq_hqv0 = 0,
+ drm_via_irq_hqv1,
+ drm_via_irq_dma0_dd,
+ drm_via_irq_dma0_td,
+ drm_via_irq_dma1_dd,
+ drm_via_irq_dma1_td,
+ drm_via_irq_num
+};
+
+struct drm_via_wait_irq_request {
+ unsigned irq;
+ via_irq_seq_type_t type;
+ __u32 sequence;
+ __u32 signal;
+};
+
+typedef union drm_via_irqwait {
+ struct drm_via_wait_irq_request request;
+ struct drm_wait_vblank_reply reply;
+} drm_via_irqwait_t;
+
+typedef struct drm_via_blitsync {
+ __u32 sync_handle;
+ unsigned engine;
+} drm_via_blitsync_t;
+
+/* - * Below,"flags" is currently unused but will be used for possible future
+ * extensions like kernel space bounce buffers for bad alignments and
+ * blit engine busy-wait polling for better latency in the absence of
+ * interrupts.
+ */
+
+typedef struct drm_via_dmablit {
+ __u32 num_lines;
+ __u32 line_length;
+
+ __u32 fb_addr;
+ __u32 fb_stride;
+
+ unsigned char *mem_addr;
+ __u32 mem_stride;
+
+ __u32 flags;
+ int to_fb;
+
+ drm_via_blitsync_t sync;
+} drm_via_dmablit_t;
+
+#endif /* _VIA_DRM_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/elf.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/elf.h
new file mode 100644
index 0000000..19805d7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/elf.h
@@ -0,0 +1,2928 @@
+/* This file defines standard ELF types, structures, and macros.
+ Copyright (C) 1995-2003, 2004, 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ELF_H
+#define _ELF_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Standard ELF types. */
+
+#include <stdint.h>
+
+/* Type for a 16-bit quantity. */
+typedef uint16_t Elf32_Half;
+typedef uint16_t Elf64_Half;
+
+/* Types for signed and unsigned 32-bit quantities. */
+typedef uint32_t Elf32_Word;
+typedef int32_t Elf32_Sword;
+typedef uint32_t Elf64_Word;
+typedef int32_t Elf64_Sword;
+
+/* Types for signed and unsigned 64-bit quantities. */
+typedef uint64_t Elf32_Xword;
+typedef int64_t Elf32_Sxword;
+typedef uint64_t Elf64_Xword;
+typedef int64_t Elf64_Sxword;
+
+/* Type of addresses. */
+typedef uint32_t Elf32_Addr;
+typedef uint64_t Elf64_Addr;
+
+/* Type of file offsets. */
+typedef uint32_t Elf32_Off;
+typedef uint64_t Elf64_Off;
+
+/* Type for section indices, which are 16-bit quantities. */
+typedef uint16_t Elf32_Section;
+typedef uint16_t Elf64_Section;
+
+/* Type for version symbol information. */
+typedef Elf32_Half Elf32_Versym;
+typedef Elf64_Half Elf64_Versym;
+
+
+/* The ELF file header. This appears at the start of every ELF file. */
+
+#define EI_NIDENT (16)
+
+typedef struct
+{
+ unsigned char e_ident[EI_NIDENT]; /* Magic number and other info */
+ Elf32_Half e_type; /* Object file type */
+ Elf32_Half e_machine; /* Architecture */
+ Elf32_Word e_version; /* Object file version */
+ Elf32_Addr e_entry; /* Entry point virtual address */
+ Elf32_Off e_phoff; /* Program header table file offset */
+ Elf32_Off e_shoff; /* Section header table file offset */
+ Elf32_Word e_flags; /* Processor-specific flags */
+ Elf32_Half e_ehsize; /* ELF header size in bytes */
+ Elf32_Half e_phentsize; /* Program header table entry size */
+ Elf32_Half e_phnum; /* Program header table entry count */
+ Elf32_Half e_shentsize; /* Section header table entry size */
+ Elf32_Half e_shnum; /* Section header table entry count */
+ Elf32_Half e_shstrndx; /* Section header string table index */
+} Elf32_Ehdr;
+
+typedef struct
+{
+ unsigned char e_ident[EI_NIDENT]; /* Magic number and other info */
+ Elf64_Half e_type; /* Object file type */
+ Elf64_Half e_machine; /* Architecture */
+ Elf64_Word e_version; /* Object file version */
+ Elf64_Addr e_entry; /* Entry point virtual address */
+ Elf64_Off e_phoff; /* Program header table file offset */
+ Elf64_Off e_shoff; /* Section header table file offset */
+ Elf64_Word e_flags; /* Processor-specific flags */
+ Elf64_Half e_ehsize; /* ELF header size in bytes */
+ Elf64_Half e_phentsize; /* Program header table entry size */
+ Elf64_Half e_phnum; /* Program header table entry count */
+ Elf64_Half e_shentsize; /* Section header table entry size */
+ Elf64_Half e_shnum; /* Section header table entry count */
+ Elf64_Half e_shstrndx; /* Section header string table index */
+} Elf64_Ehdr;
+
+/* Fields in the e_ident array. The EI_* macros are indices into the
+ array. The macros under each EI_* macro are the values the byte
+ may have. */
+
+#define EI_MAG0 0 /* File identification byte 0 index */
+#define ELFMAG0 0x7f /* Magic number byte 0 */
+
+#define EI_MAG1 1 /* File identification byte 1 index */
+#define ELFMAG1 'E' /* Magic number byte 1 */
+
+#define EI_MAG2 2 /* File identification byte 2 index */
+#define ELFMAG2 'L' /* Magic number byte 2 */
+
+#define EI_MAG3 3 /* File identification byte 3 index */
+#define ELFMAG3 'F' /* Magic number byte 3 */
+
+/* Conglomeration of the identification bytes, for easy testing as a word. */
+#define ELFMAG "\177ELF"
+#define SELFMAG 4
+
+#define EI_CLASS 4 /* File class byte index */
+#define ELFCLASSNONE 0 /* Invalid class */
+#define ELFCLASS32 1 /* 32-bit objects */
+#define ELFCLASS64 2 /* 64-bit objects */
+#define ELFCLASSNUM 3
+
+#define EI_DATA 5 /* Data encoding byte index */
+#define ELFDATANONE 0 /* Invalid data encoding */
+#define ELFDATA2LSB 1 /* 2's complement, little endian */
+#define ELFDATA2MSB 2 /* 2's complement, big endian */
+#define ELFDATANUM 3
+
+#define EI_VERSION 6 /* File version byte index */
+ /* Value must be EV_CURRENT */
+
+#define EI_OSABI 7 /* OS ABI identification */
+#define ELFOSABI_NONE 0 /* UNIX System V ABI */
+#define ELFOSABI_SYSV 0 /* Alias. */
+#define ELFOSABI_HPUX 1 /* HP-UX */
+#define ELFOSABI_NETBSD 2 /* NetBSD. */
+#define ELFOSABI_LINUX 3 /* Linux. */
+#define ELFOSABI_HURD 4 /* GNU/Hurd */
+#define ELFOSABI_SOLARIS 6 /* Sun Solaris. */
+#define ELFOSABI_AIX 7 /* IBM AIX. */
+#define ELFOSABI_IRIX 8 /* SGI Irix. */
+#define ELFOSABI_FREEBSD 9 /* FreeBSD. */
+#define ELFOSABI_TRU64 10 /* Compaq TRU64 UNIX. */
+#define ELFOSABI_MODESTO 11 /* Novell Modesto. */
+#define ELFOSABI_OPENBSD 12 /* OpenBSD. */
+#define ELFOSABI_OPENVMS 13 /* OpenVMS */
+#define ELFOSABI_NSK 14 /* Hewlett-Packard Non-Stop Kernel */
+#define ELFOSABI_AROS 15 /* Amiga Research OS */
+#define ELFOSABI_ARM 97 /* ARM */
+#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */
+
+#define EI_ABIVERSION 8 /* ABI version */
+
+#define EI_PAD 9 /* Byte index of padding bytes */
+
+/* Legal values for e_type (object file type). */
+
+#define ET_NONE 0 /* No file type */
+#define ET_REL 1 /* Relocatable file */
+#define ET_EXEC 2 /* Executable file */
+#define ET_DYN 3 /* Shared object file */
+#define ET_CORE 4 /* Core file */
+#define ET_NUM 5 /* Number of defined types */
+#define ET_LOOS 0xfe00 /* OS-specific range start */
+#define ET_HIOS 0xfeff /* OS-specific range end */
+#define ET_LOPROC 0xff00 /* Processor-specific range start */
+#define ET_HIPROC 0xffff /* Processor-specific range end */
+
+/* Legal values for e_machine (architecture). */
+
+#define EM_NONE 0 /* No machine */
+#define EM_M32 1 /* AT&T WE 32100 */
+#define EM_SPARC 2 /* SUN SPARC */
+#define EM_386 3 /* Intel 80386 */
+#define EM_68K 4 /* Motorola m68k family */
+#define EM_88K 5 /* Motorola m88k family */
+#define EM_486 6 /* Intel 80486 *//* Reserved for future use */
+#define EM_860 7 /* Intel 80860 */
+#define EM_MIPS 8 /* MIPS R3000 big-endian */
+#define EM_S370 9 /* IBM System/370 */
+#define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */
+
+#define EM_PARISC 15 /* HPPA */
+#define EM_VPP500 17 /* Fujitsu VPP500 */
+#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */
+#define EM_960 19 /* Intel 80960 */
+#define EM_PPC 20 /* PowerPC */
+#define EM_PPC64 21 /* PowerPC 64-bit */
+#define EM_S390 22 /* IBM S390 */
+
+#define EM_V800 36 /* NEC V800 series */
+#define EM_FR20 37 /* Fujitsu FR20 */
+#define EM_RH32 38 /* TRW RH-32 */
+#define EM_MCORE 39 /* Motorola M*Core */ /* May also be taken by Fujitsu MMA */
+#define EM_RCE 39 /* Old name for MCore */
+#define EM_ARM 40 /* ARM */
+#define EM_FAKE_ALPHA 41 /* Digital Alpha */
+#define EM_SH 42 /* Renesas SH */
+#define EM_SPARCV9 43 /* SPARC v9 64-bit */
+#define EM_TRICORE 44 /* Siemens Tricore */
+#define EM_ARC 45 /* Argonaut RISC Core */
+#define EM_H8_300 46 /* Renesas H8/300 */
+#define EM_H8_300H 47 /* Renesas H8/300H */
+#define EM_H8S 48 /* Renesas H8S */
+#define EM_H8_500 49 /* Renesas H8/500 */
+#define EM_IA_64 50 /* Intel Merced */
+#define EM_MIPS_X 51 /* Stanford MIPS-X */
+#define EM_COLDFIRE 52 /* Motorola Coldfire */
+#define EM_68HC12 53 /* Motorola M68HC12 */
+#define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator*/
+#define EM_PCP 55 /* Siemens PCP */
+#define EM_NCPU 56 /* Sony nCPU embeeded RISC */
+#define EM_NDR1 57 /* Denso NDR1 microprocessor */
+#define EM_STARCORE 58 /* Motorola Start*Core processor */
+#define EM_ME16 59 /* Toyota ME16 processor */
+#define EM_ST100 60 /* STMicroelectronic ST100 processor */
+#define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam*/
+#define EM_X86_64 62 /* AMD x86-64 architecture */
+#define EM_PDSP 63 /* Sony DSP Processor */
+
+#define EM_FX66 66 /* Siemens FX66 microcontroller */
+#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */
+#define EM_ST7 68 /* STmicroelectronics ST7 8 bit mc */
+#define EM_68HC16 69 /* Motorola MC68HC16 microcontroller */
+#define EM_68HC11 70 /* Motorola MC68HC11 microcontroller */
+#define EM_68HC08 71 /* Motorola MC68HC08 microcontroller */
+#define EM_68HC05 72 /* Motorola MC68HC05 microcontroller */
+#define EM_SVX 73 /* Silicon Graphics SVx */
+#define EM_ST19 74 /* STMicroelectronics ST19 8 bit mc */
+#define EM_VAX 75 /* Digital VAX */
+#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */
+#define EM_JAVELIN 77 /* Infineon Technologies 32-bit embedded processor */
+#define EM_FIREPATH 78 /* Element 14 64-bit DSP Processor */
+#define EM_ZSP 79 /* LSI Logic 16-bit DSP Processor */
+#define EM_MMIX 80 /* Donald Knuth's educational 64-bit processor */
+#define EM_HUANY 81 /* Harvard University machine-independent object files */
+#define EM_PRISM 82 /* SiTera Prism */
+#define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */
+#define EM_FR30 84 /* Fujitsu FR30 */
+#define EM_D10V 85 /* Mitsubishi D10V */
+#define EM_D30V 86 /* Mitsubishi D30V */
+#define EM_V850 87 /* NEC v850 */
+#define EM_M32R 88 /* Renesas M32R */
+#define EM_MN10300 89 /* Matsushita MN10300 */
+#define EM_MN10200 90 /* Matsushita MN10200 */
+#define EM_PJ 91 /* picoJava */
+#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */
+#define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */
+#define EM_XTENSA 94 /* Tensilica Xtensa Architecture */
+#define EM_IP2K 101 /* Ubicom IP2022 micro controller */
+#define EM_CR 103 /* National Semiconductor CompactRISC */
+#define EM_MSP430 105 /* TI msp430 micro controller */
+#define EM_BLACKFIN 106 /* Analog Devices Blackfin */
+#define EM_ALTERA_NIOS2 113 /* Altera Nios II soft-core processor */
+#define EM_CRX 114 /* National Semiconductor CRX */
+#define EM_NUM 95
+
+/* If it is necessary to assign new unofficial EM_* values, please pick large
+ random numbers (0x8523, 0xa7f2, etc.) to minimize the chances of collision
+ with official or non-GNU unofficial values.
+
+ NOTE: Do not just increment the most recent number by one.
+ Somebody else somewhere will do exactly the same thing, and you
+ will have a collision. Instead, pick a random number.
+
+ Normally, each entity or maintainer responsible for a machine with an
+ unofficial e_machine number should eventually ask registry@caldera.com for
+ an officially blessed number to be added to the list above. */
+
+/* picoJava */
+#define EM_PJ_OLD 99
+
+/* Cygnus PowerPC ELF backend. Written in the absence of an ABI. */
+#define EM_CYGNUS_POWERPC 0x9025
+
+/* Old version of Sparc v9, from before the ABI; this should be
+ removed shortly. */
+#define EM_OLD_SPARCV9 11
+
+/* Old version of PowerPC, this should be removed shortly. */
+#define EM_PPC_OLD 17
+
+/* (Deprecated) Temporary number for the OpenRISC processor. */
+#define EM_OR32 0x8472
+
+/* Renesas M32C and M16C. */
+#define EM_M32C 0xFEB0
+
+/* Cygnus M32R ELF backend. Written in the absence of an ABI. */
+#define EM_CYGNUS_M32R 0x9041
+
+/* old S/390 backend magic number. Written in the absence of an ABI. */
+#define EM_S390_OLD 0xa390
+
+/* D10V backend magic number. Written in the absence of an ABI. */
+#define EM_CYGNUS_D10V 0x7650
+
+/* D30V backend magic number. Written in the absence of an ABI. */
+#define EM_CYGNUS_D30V 0x7676
+
+/* V850 backend magic number. Written in the absense of an ABI. */
+#define EM_CYGNUS_V850 0x9080
+
+/* mn10200 and mn10300 backend magic numbers.
+ Written in the absense of an ABI. */
+#define EM_CYGNUS_MN10200 0xdead
+#define EM_CYGNUS_MN10300 0xbeef
+
+/* FR30 magic number - no EABI available. */
+#define EM_CYGNUS_FR30 0x3330
+
+/* AVR magic number
+ Written in the absense of an ABI. */
+#define EM_AVR_OLD 0x1057
+
+/* OpenRISC magic number
+ Written in the absense of an ABI. */
+#define EM_OPENRISC_OLD 0x3426
+
+/* DLX magic number
+ Written in the absense of an ABI. */
+#define EM_DLX 0x5aa5
+
+#define EM_XSTORMY16 0xad45
+
+/* FRV magic number - no EABI available??. */
+#define EM_CYGNUS_FRV 0x5441
+
+/* Ubicom IP2xxx; no ABI */
+#define EM_IP2K_OLD 0x8217
+
+#define EM_MT 0x2530 /* Morpho MT; no ABI */
+
+/* MSP430 magic number
+ Written in the absense everything. */
+#define EM_MSP430_OLD 0x1059
+
+/* Vitesse IQ2000. */
+#define EM_IQ2000 0xFEBA
+
+/* Old, unofficial value for Xtensa. */
+#define EM_XTENSA_OLD 0xabc7
+
+/* Alpha backend magic number. Written in the absence of an ABI. */
+#define EM_ALPHA 0x9026
+
+/* NIOS magic number - no EABI available. */
+#define EM_NIOS32 0xFEBB
+
+/* V850 backend magic number. Written in the absense of an ABI. */
+#define EM_CYGNUS_V850 0x9080
+
+/* Legal values for e_version (version). */
+
+#define EV_NONE 0 /* Invalid ELF version */
+#define EV_CURRENT 1 /* Current version */
+#define EV_NUM 2
+
+/* Section header. */
+
+typedef struct
+{
+ Elf32_Word sh_name; /* Section name (string tbl index) */
+ Elf32_Word sh_type; /* Section type */
+ Elf32_Word sh_flags; /* Section flags */
+ Elf32_Addr sh_addr; /* Section virtual addr at execution */
+ Elf32_Off sh_offset; /* Section file offset */
+ Elf32_Word sh_size; /* Section size in bytes */
+ Elf32_Word sh_link; /* Link to another section */
+ Elf32_Word sh_info; /* Additional section information */
+ Elf32_Word sh_addralign; /* Section alignment */
+ Elf32_Word sh_entsize; /* Entry size if section holds table */
+} Elf32_Shdr;
+
+typedef struct
+{
+ Elf64_Word sh_name; /* Section name (string tbl index) */
+ Elf64_Word sh_type; /* Section type */
+ Elf64_Xword sh_flags; /* Section flags */
+ Elf64_Addr sh_addr; /* Section virtual addr at execution */
+ Elf64_Off sh_offset; /* Section file offset */
+ Elf64_Xword sh_size; /* Section size in bytes */
+ Elf64_Word sh_link; /* Link to another section */
+ Elf64_Word sh_info; /* Additional section information */
+ Elf64_Xword sh_addralign; /* Section alignment */
+ Elf64_Xword sh_entsize; /* Entry size if section holds table */
+} Elf64_Shdr;
+
+/* Special section indices. */
+
+#define SHN_UNDEF 0 /* Undefined section */
+#define SHN_LORESERVE 0xff00 /* Start of reserved indices */
+#define SHN_LOPROC 0xff00 /* Start of processor-specific */
+#define SHN_BEFORE 0xff00 /* Order section before all others
+ (Solaris). */
+#define SHN_AFTER 0xff01 /* Order section after all others
+ (Solaris). */
+#define SHN_HIPROC 0xff1f /* End of processor-specific */
+#define SHN_LOOS 0xff20 /* Start of OS-specific */
+#define SHN_HIOS 0xff3f /* End of OS-specific */
+#define SHN_ABS 0xfff1 /* Associated symbol is absolute */
+#define SHN_COMMON 0xfff2 /* Associated symbol is common */
+#define SHN_XINDEX 0xffff /* Index is in extra table. */
+#define SHN_HIRESERVE 0xffff /* End of reserved indices */
+
+/* Legal values for sh_type (section type). */
+
+#define SHT_NULL 0 /* Section header table entry unused */
+#define SHT_PROGBITS 1 /* Program data */
+#define SHT_SYMTAB 2 /* Symbol table */
+#define SHT_STRTAB 3 /* String table */
+#define SHT_RELA 4 /* Relocation entries with addends */
+#define SHT_HASH 5 /* Symbol hash table */
+#define SHT_DYNAMIC 6 /* Dynamic linking information */
+#define SHT_NOTE 7 /* Notes */
+#define SHT_NOBITS 8 /* Program space with no data (bss) */
+#define SHT_REL 9 /* Relocation entries, no addends */
+#define SHT_SHLIB 10 /* Reserved */
+#define SHT_DYNSYM 11 /* Dynamic linker symbol table */
+#define SHT_INIT_ARRAY 14 /* Array of constructors */
+#define SHT_FINI_ARRAY 15 /* Array of destructors */
+#define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */
+#define SHT_GROUP 17 /* Section group */
+#define SHT_SYMTAB_SHNDX 18 /* Extended section indeces */
+#define SHT_NUM 19 /* Number of defined types. */
+#define SHT_LOOS 0x60000000 /* Start OS-specific */
+#define SHT_GNU_LIBLIST 0x6ffffff7 /* Prelink library list */
+#define SHT_CHECKSUM 0x6ffffff8 /* Checksum for DSO content. */
+#define SHT_LOSUNW 0x6ffffffa /* Sun-specific low bound. */
+#define SHT_SUNW_move 0x6ffffffa
+#define SHT_SUNW_COMDAT 0x6ffffffb
+#define SHT_SUNW_syminfo 0x6ffffffc
+#define SHT_GNU_verdef 0x6ffffffd /* Version definition section. */
+#define SHT_GNU_verneed 0x6ffffffe /* Version needs section. */
+#define SHT_GNU_versym 0x6fffffff /* Version symbol table. */
+#define SHT_HISUNW 0x6fffffff /* Sun-specific high bound. */
+#define SHT_HIOS 0x6fffffff /* End OS-specific type */
+#define SHT_LOPROC 0x70000000 /* Start of processor-specific */
+#define SHT_HIPROC 0x7fffffff /* End of processor-specific */
+#define SHT_LOUSER 0x80000000 /* Start of application-specific */
+#define SHT_HIUSER 0x8fffffff /* End of application-specific */
+
+/* Legal values for sh_flags (section flags). */
+
+#define SHF_WRITE (1 << 0) /* Writable */
+#define SHF_ALLOC (1 << 1) /* Occupies memory during execution */
+#define SHF_EXECINSTR (1 << 2) /* Executable */
+#define SHF_MERGE (1 << 4) /* Might be merged */
+#define SHF_STRINGS (1 << 5) /* Contains nul-terminated strings */
+#define SHF_INFO_LINK (1 << 6) /* `sh_info' contains SHT index */
+#define SHF_LINK_ORDER (1 << 7) /* Preserve order after combining */
+#define SHF_OS_NONCONFORMING (1 << 8) /* Non-standard OS specific handling
+ required */
+#define SHF_GROUP (1 << 9) /* Section is member of a group. */
+#define SHF_TLS (1 << 10) /* Section hold thread-local data. */
+#define SHF_MASKOS 0x0ff00000 /* OS-specific. */
+#define SHF_MASKPROC 0xf0000000 /* Processor-specific */
+#define SHF_ORDERED (1 << 30) /* Special ordering requirement
+ (Solaris). */
+#define SHF_EXCLUDE (1 << 31) /* Section is excluded unless
+ referenced or allocated (Solaris).*/
+
+/* Section group handling. */
+#define GRP_COMDAT 0x1 /* Mark group as COMDAT. */
+
+/* Symbol table entry. */
+
+typedef struct
+{
+ Elf32_Word st_name; /* Symbol name (string tbl index) */
+ Elf32_Addr st_value; /* Symbol value */
+ Elf32_Word st_size; /* Symbol size */
+ unsigned char st_info; /* Symbol type and binding */
+ unsigned char st_other; /* Symbol visibility */
+ Elf32_Section st_shndx; /* Section index */
+} Elf32_Sym;
+
+typedef struct
+{
+ Elf64_Word st_name; /* Symbol name (string tbl index) */
+ unsigned char st_info; /* Symbol type and binding */
+ unsigned char st_other; /* Symbol visibility */
+ Elf64_Section st_shndx; /* Section index */
+ Elf64_Addr st_value; /* Symbol value */
+ Elf64_Xword st_size; /* Symbol size */
+} Elf64_Sym;
+
+/* The syminfo section if available contains additional information about
+ every dynamic symbol. */
+
+typedef struct
+{
+ Elf32_Half si_boundto; /* Direct bindings, symbol bound to */
+ Elf32_Half si_flags; /* Per symbol flags */
+} Elf32_Syminfo;
+
+typedef struct
+{
+ Elf64_Half si_boundto; /* Direct bindings, symbol bound to */
+ Elf64_Half si_flags; /* Per symbol flags */
+} Elf64_Syminfo;
+
+/* Possible values for si_boundto. */
+#define SYMINFO_BT_SELF 0xffff /* Symbol bound to self */
+#define SYMINFO_BT_PARENT 0xfffe /* Symbol bound to parent */
+#define SYMINFO_BT_LOWRESERVE 0xff00 /* Beginning of reserved entries */
+
+/* Possible bitmasks for si_flags. */
+#define SYMINFO_FLG_DIRECT 0x0001 /* Direct bound symbol */
+#define SYMINFO_FLG_PASSTHRU 0x0002 /* Pass-thru symbol for translator */
+#define SYMINFO_FLG_COPY 0x0004 /* Symbol is a copy-reloc */
+#define SYMINFO_FLG_LAZYLOAD 0x0008 /* Symbol bound to object to be lazy
+ loaded */
+/* Syminfo version values. */
+#define SYMINFO_NONE 0
+#define SYMINFO_CURRENT 1
+#define SYMINFO_NUM 2
+
+
+/* How to extract and insert information held in the st_info field. */
+
+#define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4)
+#define ELF32_ST_TYPE(val) ((val) & 0xf)
+#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
+
+/* Both Elf32_Sym and Elf64_Sym use the same one-byte st_info field. */
+#define ELF64_ST_BIND(val) ELF32_ST_BIND (val)
+#define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val)
+#define ELF64_ST_INFO(bind, type) ELF32_ST_INFO ((bind), (type))
+
+/* Legal values for ST_BIND subfield of st_info (symbol binding). */
+
+#define STB_LOCAL 0 /* Local symbol */
+#define STB_GLOBAL 1 /* Global symbol */
+#define STB_WEAK 2 /* Weak symbol */
+#define STB_NUM 3 /* Number of defined types. */
+#define STB_LOOS 10 /* Start of OS-specific */
+#define STB_HIOS 12 /* End of OS-specific */
+#define STB_LOPROC 13 /* Start of processor-specific */
+#define STB_HIPROC 15 /* End of processor-specific */
+
+/* Legal values for ST_TYPE subfield of st_info (symbol type). */
+
+#define STT_NOTYPE 0 /* Symbol type is unspecified */
+#define STT_OBJECT 1 /* Symbol is a data object */
+#define STT_FUNC 2 /* Symbol is a code object */
+#define STT_SECTION 3 /* Symbol associated with a section */
+#define STT_FILE 4 /* Symbol's name is file name */
+#define STT_COMMON 5 /* Symbol is a common data object */
+#define STT_TLS 6 /* Symbol is thread-local data object*/
+#define STT_NUM 7 /* Number of defined types. */
+#define STT_LOOS 10 /* Start of OS-specific */
+#define STT_HIOS 12 /* End of OS-specific */
+#define STT_LOPROC 13 /* Start of processor-specific */
+#define STT_HIPROC 15 /* End of processor-specific */
+
+
+/* Symbol table indices are found in the hash buckets and chain table
+ of a symbol hash table section. This special index value indicates
+ the end of a chain, meaning no further symbols are found in that bucket. */
+
+#define STN_UNDEF 0 /* End of a chain. */
+
+
+/* How to extract and insert information held in the st_other field. */
+
+#define ELF32_ST_VISIBILITY(o) ((o) & 0x03)
+
+/* For ELF64 the definitions are the same. */
+#define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o)
+
+/* Symbol visibility specification encoded in the st_other field. */
+#define STV_DEFAULT 0 /* Default symbol visibility rules */
+#define STV_INTERNAL 1 /* Processor specific hidden class */
+#define STV_HIDDEN 2 /* Sym unavailable in other modules */
+#define STV_PROTECTED 3 /* Not preemptible, not exported */
+
+
+/* Relocation table entry without addend (in section of type SHT_REL). */
+
+typedef struct
+{
+ Elf32_Addr r_offset; /* Address */
+ Elf32_Word r_info; /* Relocation type and symbol index */
+} Elf32_Rel;
+
+/* I have seen two different definitions of the Elf64_Rel and
+ Elf64_Rela structures, so we'll leave them out until Novell (or
+ whoever) gets their act together. */
+/* The following, at least, is used on Sparc v9, MIPS, and Alpha. */
+
+typedef struct
+{
+ Elf64_Addr r_offset; /* Address */
+ Elf64_Xword r_info; /* Relocation type and symbol index */
+} Elf64_Rel;
+
+/* Relocation table entry with addend (in section of type SHT_RELA). */
+
+typedef struct
+{
+ Elf32_Addr r_offset; /* Address */
+ Elf32_Word r_info; /* Relocation type and symbol index */
+ Elf32_Sword r_addend; /* Addend */
+} Elf32_Rela;
+
+typedef struct
+{
+ Elf64_Addr r_offset; /* Address */
+ Elf64_Xword r_info; /* Relocation type and symbol index */
+ Elf64_Sxword r_addend; /* Addend */
+} Elf64_Rela;
+
+/* How to extract and insert information held in the r_info field. */
+
+#define ELF32_R_SYM(val) ((val) >> 8)
+#define ELF32_R_TYPE(val) ((val) & 0xff)
+#define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff))
+
+#define ELF64_R_SYM(i) ((i) >> 32)
+#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
+#define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type))
+
+/* Program segment header. */
+
+typedef struct
+{
+ Elf32_Word p_type; /* Segment type */
+ Elf32_Off p_offset; /* Segment file offset */
+ Elf32_Addr p_vaddr; /* Segment virtual address */
+ Elf32_Addr p_paddr; /* Segment physical address */
+ Elf32_Word p_filesz; /* Segment size in file */
+ Elf32_Word p_memsz; /* Segment size in memory */
+ Elf32_Word p_flags; /* Segment flags */
+ Elf32_Word p_align; /* Segment alignment */
+} Elf32_Phdr;
+
+typedef struct
+{
+ Elf64_Word p_type; /* Segment type */
+ Elf64_Word p_flags; /* Segment flags */
+ Elf64_Off p_offset; /* Segment file offset */
+ Elf64_Addr p_vaddr; /* Segment virtual address */
+ Elf64_Addr p_paddr; /* Segment physical address */
+ Elf64_Xword p_filesz; /* Segment size in file */
+ Elf64_Xword p_memsz; /* Segment size in memory */
+ Elf64_Xword p_align; /* Segment alignment */
+} Elf64_Phdr;
+
+/* Legal values for p_type (segment type). */
+
+#define PT_NULL 0 /* Program header table entry unused */
+#define PT_LOAD 1 /* Loadable program segment */
+#define PT_DYNAMIC 2 /* Dynamic linking information */
+#define PT_INTERP 3 /* Program interpreter */
+#define PT_NOTE 4 /* Auxiliary information */
+#define PT_SHLIB 5 /* Reserved */
+#define PT_PHDR 6 /* Entry for header table itself */
+#define PT_TLS 7 /* Thread-local storage segment */
+#define PT_NUM 8 /* Number of defined types */
+#define PT_LOOS 0x60000000 /* Start of OS-specific */
+#define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */
+#define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */
+#define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */
+#define PT_PAX_FLAGS 0x65041580 /* Indicates PaX flag markings */
+#define PT_LOSUNW 0x6ffffffa
+#define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */
+#define PT_SUNWSTACK 0x6ffffffb /* Stack segment */
+#define PT_HISUNW 0x6fffffff
+#define PT_HIOS 0x6fffffff /* End of OS-specific */
+#define PT_LOPROC 0x70000000 /* Start of processor-specific */
+#define PT_HIPROC 0x7fffffff /* End of processor-specific */
+
+/* Legal values for p_flags (segment flags). */
+
+#define PF_X (1 << 0) /* Segment is executable */
+#define PF_W (1 << 1) /* Segment is writable */
+#define PF_R (1 << 2) /* Segment is readable */
+#define PF_PAGEEXEC (1 << 4) /* Enable PAGEEXEC */
+#define PF_NOPAGEEXEC (1 << 5) /* Disable PAGEEXEC */
+#define PF_SEGMEXEC (1 << 6) /* Enable SEGMEXEC */
+#define PF_NOSEGMEXEC (1 << 7) /* Disable SEGMEXEC */
+#define PF_MPROTECT (1 << 8) /* Enable MPROTECT */
+#define PF_NOMPROTECT (1 << 9) /* Disable MPROTECT */
+#define PF_RANDEXEC (1 << 10) /* Enable RANDEXEC */
+#define PF_NORANDEXEC (1 << 11) /* Disable RANDEXEC */
+#define PF_EMUTRAMP (1 << 12) /* Enable EMUTRAMP */
+#define PF_NOEMUTRAMP (1 << 13) /* Disable EMUTRAMP */
+#define PF_RANDMMAP (1 << 14) /* Enable RANDMMAP */
+#define PF_NORANDMMAP (1 << 15) /* Disable RANDMMAP */
+#define PF_MASKOS 0x0ff00000 /* OS-specific */
+#define PF_MASKPROC 0xf0000000 /* Processor-specific */
+
+/* Legal values for note segment descriptor types for core files. */
+
+#define NT_PRSTATUS 1 /* Contains copy of prstatus struct */
+#define NT_FPREGSET 2 /* Contains copy of fpregset struct */
+#define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */
+#define NT_PRXREG 4 /* Contains copy of prxregset struct */
+#define NT_TASKSTRUCT 4 /* Contains copy of task structure */
+#define NT_PLATFORM 5 /* String from sysinfo(SI_PLATFORM) */
+#define NT_AUXV 6 /* Contains copy of auxv array */
+#define NT_GWINDOWS 7 /* Contains copy of gwindows struct */
+#define NT_ASRS 8 /* Contains copy of asrset struct */
+#define NT_PSTATUS 10 /* Contains copy of pstatus struct */
+#define NT_PSINFO 13 /* Contains copy of psinfo struct */
+#define NT_PRCRED 14 /* Contains copy of prcred struct */
+#define NT_UTSNAME 15 /* Contains copy of utsname struct */
+#define NT_LWPSTATUS 16 /* Contains copy of lwpstatus struct */
+#define NT_LWPSINFO 17 /* Contains copy of lwpinfo struct */
+#define NT_PRFPXREG 20 /* Contains copy of fprxregset struct*/
+
+/* Legal values for the note segment descriptor types for object files. */
+
+#define NT_VERSION 1 /* Contains a version string. */
+
+
+/* Dynamic section entry. */
+
+typedef struct
+{
+ Elf32_Sword d_tag; /* Dynamic entry type */
+ union
+ {
+ Elf32_Word d_val; /* Integer value */
+ Elf32_Addr d_ptr; /* Address value */
+ } d_un;
+} Elf32_Dyn;
+
+typedef struct
+{
+ Elf64_Sxword d_tag; /* Dynamic entry type */
+ union
+ {
+ Elf64_Xword d_val; /* Integer value */
+ Elf64_Addr d_ptr; /* Address value */
+ } d_un;
+} Elf64_Dyn;
+
+/* Legal values for d_tag (dynamic entry type). */
+
+#define DT_NULL 0 /* Marks end of dynamic section */
+#define DT_NEEDED 1 /* Name of needed library */
+#define DT_PLTRELSZ 2 /* Size in bytes of PLT relocs */
+#define DT_PLTGOT 3 /* Processor defined value */
+#define DT_HASH 4 /* Address of symbol hash table */
+#define DT_STRTAB 5 /* Address of string table */
+#define DT_SYMTAB 6 /* Address of symbol table */
+#define DT_RELA 7 /* Address of Rela relocs */
+#define DT_RELASZ 8 /* Total size of Rela relocs */
+#define DT_RELAENT 9 /* Size of one Rela reloc */
+#define DT_STRSZ 10 /* Size of string table */
+#define DT_SYMENT 11 /* Size of one symbol table entry */
+#define DT_INIT 12 /* Address of init function */
+#define DT_FINI 13 /* Address of termination function */
+#define DT_SONAME 14 /* Name of shared object */
+#define DT_RPATH 15 /* Library search path (deprecated) */
+#define DT_SYMBOLIC 16 /* Start symbol search here */
+#define DT_REL 17 /* Address of Rel relocs */
+#define DT_RELSZ 18 /* Total size of Rel relocs */
+#define DT_RELENT 19 /* Size of one Rel reloc */
+#define DT_PLTREL 20 /* Type of reloc in PLT */
+#define DT_DEBUG 21 /* For debugging; unspecified */
+#define DT_TEXTREL 22 /* Reloc might modify .text */
+#define DT_JMPREL 23 /* Address of PLT relocs */
+#define DT_BIND_NOW 24 /* Process relocations of object */
+#define DT_INIT_ARRAY 25 /* Array with addresses of init fct */
+#define DT_FINI_ARRAY 26 /* Array with addresses of fini fct */
+#define DT_INIT_ARRAYSZ 27 /* Size in bytes of DT_INIT_ARRAY */
+#define DT_FINI_ARRAYSZ 28 /* Size in bytes of DT_FINI_ARRAY */
+#define DT_RUNPATH 29 /* Library search path */
+#define DT_FLAGS 30 /* Flags for the object being loaded */
+#define DT_ENCODING 32 /* Start of encoded range */
+#define DT_PREINIT_ARRAY 32 /* Array with addresses of preinit fct*/
+#define DT_PREINIT_ARRAYSZ 33 /* size in bytes of DT_PREINIT_ARRAY */
+#define DT_NUM 34 /* Number used */
+#define DT_LOOS 0x6000000d /* Start of OS-specific */
+#define DT_HIOS 0x6ffff000 /* End of OS-specific */
+#define DT_LOPROC 0x70000000 /* Start of processor-specific */
+#define DT_HIPROC 0x7fffffff /* End of processor-specific */
+#define DT_PROCNUM DT_MIPS_NUM /* Most used by any processor */
+
+/* DT_* entries which fall between DT_VALRNGHI & DT_VALRNGLO use the
+ Dyn.d_un.d_val field of the Elf*_Dyn structure. This follows Sun's
+ approach. */
+#define DT_VALRNGLO 0x6ffffd00
+#define DT_GNU_PRELINKED 0x6ffffdf5 /* Prelinking timestamp */
+#define DT_GNU_CONFLICTSZ 0x6ffffdf6 /* Size of conflict section */
+#define DT_GNU_LIBLISTSZ 0x6ffffdf7 /* Size of library list */
+#define DT_CHECKSUM 0x6ffffdf8
+#define DT_PLTPADSZ 0x6ffffdf9
+#define DT_MOVEENT 0x6ffffdfa
+#define DT_MOVESZ 0x6ffffdfb
+#define DT_FEATURE_1 0x6ffffdfc /* Feature selection (DTF_*). */
+#define DT_POSFLAG_1 0x6ffffdfd /* Flags for DT_* entries, effecting
+ the following DT_* entry. */
+#define DT_SYMINSZ 0x6ffffdfe /* Size of syminfo table (in bytes) */
+#define DT_SYMINENT 0x6ffffdff /* Entry size of syminfo */
+#define DT_VALRNGHI 0x6ffffdff
+#define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag)) /* Reverse order! */
+#define DT_VALNUM 12
+
+/* DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the
+ Dyn.d_un.d_ptr field of the Elf*_Dyn structure.
+
+ If any adjustment is made to the ELF object after it has been
+ built these entries will need to be adjusted. */
+#define DT_ADDRRNGLO 0x6ffffe00
+#define DT_GNU_CONFLICT 0x6ffffef8 /* Start of conflict section */
+#define DT_GNU_LIBLIST 0x6ffffef9 /* Library list */
+#define DT_CONFIG 0x6ffffefa /* Configuration information. */
+#define DT_DEPAUDIT 0x6ffffefb /* Dependency auditing. */
+#define DT_AUDIT 0x6ffffefc /* Object auditing. */
+#define DT_PLTPAD 0x6ffffefd /* PLT padding. */
+#define DT_MOVETAB 0x6ffffefe /* Move table. */
+#define DT_SYMINFO 0x6ffffeff /* Syminfo table. */
+#define DT_ADDRRNGHI 0x6ffffeff
+#define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag)) /* Reverse order! */
+#define DT_ADDRNUM 10
+
+/* The versioning entry types. The next are defined as part of the
+ GNU extension. */
+#define DT_VERSYM 0x6ffffff0
+
+#define DT_RELACOUNT 0x6ffffff9
+#define DT_RELCOUNT 0x6ffffffa
+
+/* These were chosen by Sun. */
+#define DT_FLAGS_1 0x6ffffffb /* State flags, see DF_1_* below. */
+#define DT_VERDEF 0x6ffffffc /* Address of version definition
+ table */
+#define DT_VERDEFNUM 0x6ffffffd /* Number of version definitions */
+#define DT_VERNEED 0x6ffffffe /* Address of table with needed
+ versions */
+#define DT_VERNEEDNUM 0x6fffffff /* Number of needed versions */
+#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) /* Reverse order! */
+#define DT_VERSIONTAGNUM 16
+
+/* Sun added these machine-independent extensions in the "processor-specific"
+ range. Be compatible. */
+#define DT_AUXILIARY 0x7ffffffd /* Shared object to load before self */
+#define DT_FILTER 0x7fffffff /* Shared object to get values from */
+#define DT_EXTRATAGIDX(tag) ((Elf32_Word)-((Elf32_Sword) (tag) <<1>>1)-1)
+#define DT_EXTRANUM 3
+
+/* Values of `d_un.d_val' in the DT_FLAGS entry. */
+#define DF_ORIGIN 0x00000001 /* Object may use DF_ORIGIN */
+#define DF_SYMBOLIC 0x00000002 /* Symbol resolutions starts here */
+#define DF_TEXTREL 0x00000004 /* Object contains text relocations */
+#define DF_BIND_NOW 0x00000008 /* No lazy binding for this object */
+#define DF_STATIC_TLS 0x00000010 /* Module uses the static TLS model */
+
+/* State flags selectable in the `d_un.d_val' element of the DT_FLAGS_1
+ entry in the dynamic section. */
+#define DF_1_NOW 0x00000001 /* Set RTLD_NOW for this object. */
+#define DF_1_GLOBAL 0x00000002 /* Set RTLD_GLOBAL for this object. */
+#define DF_1_GROUP 0x00000004 /* Set RTLD_GROUP for this object. */
+#define DF_1_NODELETE 0x00000008 /* Set RTLD_NODELETE for this object.*/
+#define DF_1_LOADFLTR 0x00000010 /* Trigger filtee loading at runtime.*/
+#define DF_1_INITFIRST 0x00000020 /* Set RTLD_INITFIRST for this object*/
+#define DF_1_NOOPEN 0x00000040 /* Set RTLD_NOOPEN for this object. */
+#define DF_1_ORIGIN 0x00000080 /* $ORIGIN must be handled. */
+#define DF_1_DIRECT 0x00000100 /* Direct binding enabled. */
+#define DF_1_TRANS 0x00000200
+#define DF_1_INTERPOSE 0x00000400 /* Object is used to interpose. */
+#define DF_1_NODEFLIB 0x00000800 /* Ignore default lib search path. */
+#define DF_1_NODUMP 0x00001000 /* Object can't be dldump'ed. */
+#define DF_1_CONFALT 0x00002000 /* Configuration alternative created.*/
+#define DF_1_ENDFILTEE 0x00004000 /* Filtee terminates filters search. */
+#define DF_1_DISPRELDNE 0x00008000 /* Disp reloc applied at build time. */
+#define DF_1_DISPRELPND 0x00010000 /* Disp reloc applied at run-time. */
+
+/* Flags for the feature selection in DT_FEATURE_1. */
+#define DTF_1_PARINIT 0x00000001
+#define DTF_1_CONFEXP 0x00000002
+
+/* Flags in the DT_POSFLAG_1 entry effecting only the next DT_* entry. */
+#define DF_P1_LAZYLOAD 0x00000001 /* Lazyload following object. */
+#define DF_P1_GROUPPERM 0x00000002 /* Symbols from next object are not
+ generally available. */
+
+/* Version definition sections. */
+
+typedef struct
+{
+ Elf32_Half vd_version; /* Version revision */
+ Elf32_Half vd_flags; /* Version information */
+ Elf32_Half vd_ndx; /* Version Index */
+ Elf32_Half vd_cnt; /* Number of associated aux entries */
+ Elf32_Word vd_hash; /* Version name hash value */
+ Elf32_Word vd_aux; /* Offset in bytes to verdaux array */
+ Elf32_Word vd_next; /* Offset in bytes to next verdef
+ entry */
+} Elf32_Verdef;
+
+typedef struct
+{
+ Elf64_Half vd_version; /* Version revision */
+ Elf64_Half vd_flags; /* Version information */
+ Elf64_Half vd_ndx; /* Version Index */
+ Elf64_Half vd_cnt; /* Number of associated aux entries */
+ Elf64_Word vd_hash; /* Version name hash value */
+ Elf64_Word vd_aux; /* Offset in bytes to verdaux array */
+ Elf64_Word vd_next; /* Offset in bytes to next verdef
+ entry */
+} Elf64_Verdef;
+
+
+/* Legal values for vd_version (version revision). */
+#define VER_DEF_NONE 0 /* No version */
+#define VER_DEF_CURRENT 1 /* Current version */
+#define VER_DEF_NUM 2 /* Given version number */
+
+/* Legal values for vd_flags (version information flags). */
+#define VER_FLG_BASE 0x1 /* Version definition of file itself */
+#define VER_FLG_WEAK 0x2 /* Weak version identifier */
+
+/* Versym symbol index values. */
+#define VER_NDX_LOCAL 0 /* Symbol is local. */
+#define VER_NDX_GLOBAL 1 /* Symbol is global. */
+#define VER_NDX_LORESERVE 0xff00 /* Beginning of reserved entries. */
+#define VER_NDX_ELIMINATE 0xff01 /* Symbol is to be eliminated. */
+
+/* Auxialiary version information. */
+
+typedef struct
+{
+ Elf32_Word vda_name; /* Version or dependency names */
+ Elf32_Word vda_next; /* Offset in bytes to next verdaux
+ entry */
+} Elf32_Verdaux;
+
+typedef struct
+{
+ Elf64_Word vda_name; /* Version or dependency names */
+ Elf64_Word vda_next; /* Offset in bytes to next verdaux
+ entry */
+} Elf64_Verdaux;
+
+
+/* Version dependency section. */
+
+typedef struct
+{
+ Elf32_Half vn_version; /* Version of structure */
+ Elf32_Half vn_cnt; /* Number of associated aux entries */
+ Elf32_Word vn_file; /* Offset of filename for this
+ dependency */
+ Elf32_Word vn_aux; /* Offset in bytes to vernaux array */
+ Elf32_Word vn_next; /* Offset in bytes to next verneed
+ entry */
+} Elf32_Verneed;
+
+typedef struct
+{
+ Elf64_Half vn_version; /* Version of structure */
+ Elf64_Half vn_cnt; /* Number of associated aux entries */
+ Elf64_Word vn_file; /* Offset of filename for this
+ dependency */
+ Elf64_Word vn_aux; /* Offset in bytes to vernaux array */
+ Elf64_Word vn_next; /* Offset in bytes to next verneed
+ entry */
+} Elf64_Verneed;
+
+
+/* Legal values for vn_version (version revision). */
+#define VER_NEED_NONE 0 /* No version */
+#define VER_NEED_CURRENT 1 /* Current version */
+#define VER_NEED_NUM 2 /* Given version number */
+
+/* Auxiliary needed version information. */
+
+typedef struct
+{
+ Elf32_Word vna_hash; /* Hash value of dependency name */
+ Elf32_Half vna_flags; /* Dependency specific information */
+ Elf32_Half vna_other; /* Unused */
+ Elf32_Word vna_name; /* Dependency name string offset */
+ Elf32_Word vna_next; /* Offset in bytes to next vernaux
+ entry */
+} Elf32_Vernaux;
+
+typedef struct
+{
+ Elf64_Word vna_hash; /* Hash value of dependency name */
+ Elf64_Half vna_flags; /* Dependency specific information */
+ Elf64_Half vna_other; /* Unused */
+ Elf64_Word vna_name; /* Dependency name string offset */
+ Elf64_Word vna_next; /* Offset in bytes to next vernaux
+ entry */
+} Elf64_Vernaux;
+
+
+/* Legal values for vna_flags. */
+#define VER_FLG_WEAK 0x2 /* Weak version identifier */
+
+
+/* Auxiliary vector. */
+
+/* This vector is normally only used by the program interpreter. The
+ usual definition in an ABI supplement uses the name auxv_t. The
+ vector is not usually defined in a standard <elf.h> file, but it
+ can't hurt. We rename it to avoid conflicts. The sizes of these
+ types are an arrangement between the exec server and the program
+ interpreter, so we don't fully specify them here. */
+
+typedef struct
+{
+ uint32_t a_type; /* Entry type */
+ union
+ {
+ uint32_t a_val; /* Integer value */
+ /* We use to have pointer elements added here. We cannot do that,
+ though, since it does not work when using 32-bit definitions
+ on 64-bit platforms and vice versa. */
+ } a_un;
+} Elf32_auxv_t;
+
+typedef struct
+{
+ uint64_t a_type; /* Entry type */
+ union
+ {
+ uint64_t a_val; /* Integer value */
+ /* We use to have pointer elements added here. We cannot do that,
+ though, since it does not work when using 32-bit definitions
+ on 64-bit platforms and vice versa. */
+ } a_un;
+} Elf64_auxv_t;
+
+/* Legal values for a_type (entry type). */
+
+#define AT_NULL 0 /* End of vector */
+#define AT_IGNORE 1 /* Entry should be ignored */
+#define AT_EXECFD 2 /* File descriptor of program */
+#define AT_PHDR 3 /* Program headers for program */
+#define AT_PHENT 4 /* Size of program header entry */
+#define AT_PHNUM 5 /* Number of program headers */
+#define AT_PAGESZ 6 /* System page size */
+#define AT_BASE 7 /* Base address of interpreter */
+#define AT_FLAGS 8 /* Flags */
+#define AT_ENTRY 9 /* Entry point of program */
+#define AT_NOTELF 10 /* Program is not ELF */
+#define AT_UID 11 /* Real uid */
+#define AT_EUID 12 /* Effective uid */
+#define AT_GID 13 /* Real gid */
+#define AT_EGID 14 /* Effective gid */
+#define AT_CLKTCK 17 /* Frequency of times() */
+
+/* Some more special a_type values describing the hardware. */
+#define AT_PLATFORM 15 /* String identifying platform. */
+#define AT_HWCAP 16 /* Machine dependent hints about
+ processor capabilities. */
+
+/* This entry gives some information about the FPU initialization
+ performed by the kernel. */
+#define AT_FPUCW 18 /* Used FPU control word. */
+
+/* Cache block sizes. */
+#define AT_DCACHEBSIZE 19 /* Data cache block size. */
+#define AT_ICACHEBSIZE 20 /* Instruction cache block size. */
+#define AT_UCACHEBSIZE 21 /* Unified cache block size. */
+
+/* A special ignored value for PPC, used by the kernel to control the
+ interpretation of the AUXV. Must be > 16. */
+#define AT_IGNOREPPC 22 /* Entry should be ignored. */
+
+#define AT_SECURE 23 /* Boolean, was exec setuid-like? */
+
+/* Pointer to the global system page used for system calls and other
+ nice things. */
+#define AT_SYSINFO 32
+#define AT_SYSINFO_EHDR 33
+
+/* Shapes of the caches. Bits 0-3 contains associativity; bits 4-7 contains
+ log2 of line size; mask those to get cache size. */
+#define AT_L1I_CACHESHAPE 34
+#define AT_L1D_CACHESHAPE 35
+#define AT_L2_CACHESHAPE 36
+#define AT_L3_CACHESHAPE 37
+
+/* Note section contents. Each entry in the note section begins with
+ a header of a fixed form. */
+
+typedef struct
+{
+ Elf32_Word n_namesz; /* Length of the note's name. */
+ Elf32_Word n_descsz; /* Length of the note's descriptor. */
+ Elf32_Word n_type; /* Type of the note. */
+} Elf32_Nhdr;
+
+typedef struct
+{
+ Elf64_Word n_namesz; /* Length of the note's name. */
+ Elf64_Word n_descsz; /* Length of the note's descriptor. */
+ Elf64_Word n_type; /* Type of the note. */
+} Elf64_Nhdr;
+
+/* Known names of notes. */
+
+/* Solaris entries in the note section have this name. */
+#define ELF_NOTE_SOLARIS "SUNW Solaris"
+
+/* Note entries for GNU systems have this name. */
+#define ELF_NOTE_GNU "GNU"
+
+
+/* Defined types of notes for Solaris. */
+
+/* Value of descriptor (one word) is desired pagesize for the binary. */
+#define ELF_NOTE_PAGESIZE_HINT 1
+
+
+/* Defined note types for GNU systems. */
+
+/* ABI information. The descriptor consists of words:
+ word 0: OS descriptor
+ word 1: major version of the ABI
+ word 2: minor version of the ABI
+ word 3: subminor version of the ABI
+*/
+#define ELF_NOTE_ABI 1
+
+/* Known OSes. These value can appear in word 0 of an ELF_NOTE_ABI
+ note section entry. */
+#define ELF_NOTE_OS_LINUX 0
+#define ELF_NOTE_OS_GNU 1
+#define ELF_NOTE_OS_SOLARIS2 2
+#define ELF_NOTE_OS_FREEBSD 3
+
+
+/* Move records. */
+typedef struct
+{
+ Elf32_Xword m_value; /* Symbol value. */
+ Elf32_Word m_info; /* Size and index. */
+ Elf32_Word m_poffset; /* Symbol offset. */
+ Elf32_Half m_repeat; /* Repeat count. */
+ Elf32_Half m_stride; /* Stride info. */
+} Elf32_Move;
+
+typedef struct
+{
+ Elf64_Xword m_value; /* Symbol value. */
+ Elf64_Xword m_info; /* Size and index. */
+ Elf64_Xword m_poffset; /* Symbol offset. */
+ Elf64_Half m_repeat; /* Repeat count. */
+ Elf64_Half m_stride; /* Stride info. */
+} Elf64_Move;
+
+/* Macro to construct move records. */
+#define ELF32_M_SYM(info) ((info) >> 8)
+#define ELF32_M_SIZE(info) ((unsigned char) (info))
+#define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char) (size))
+
+#define ELF64_M_SYM(info) ELF32_M_SYM (info)
+#define ELF64_M_SIZE(info) ELF32_M_SIZE (info)
+#define ELF64_M_INFO(sym, size) ELF32_M_INFO (sym, size)
+
+
+/* Motorola 68k specific definitions. */
+
+/* Values for Elf32_Ehdr.e_flags. */
+#define EF_CPU32 0x00810000
+
+/* m68k relocs. */
+
+#define R_68K_NONE 0 /* No reloc */
+#define R_68K_32 1 /* Direct 32 bit */
+#define R_68K_16 2 /* Direct 16 bit */
+#define R_68K_8 3 /* Direct 8 bit */
+#define R_68K_PC32 4 /* PC relative 32 bit */
+#define R_68K_PC16 5 /* PC relative 16 bit */
+#define R_68K_PC8 6 /* PC relative 8 bit */
+#define R_68K_GOT32 7 /* 32 bit PC relative GOT entry */
+#define R_68K_GOT16 8 /* 16 bit PC relative GOT entry */
+#define R_68K_GOT8 9 /* 8 bit PC relative GOT entry */
+#define R_68K_GOT32O 10 /* 32 bit GOT offset */
+#define R_68K_GOT16O 11 /* 16 bit GOT offset */
+#define R_68K_GOT8O 12 /* 8 bit GOT offset */
+#define R_68K_PLT32 13 /* 32 bit PC relative PLT address */
+#define R_68K_PLT16 14 /* 16 bit PC relative PLT address */
+#define R_68K_PLT8 15 /* 8 bit PC relative PLT address */
+#define R_68K_PLT32O 16 /* 32 bit PLT offset */
+#define R_68K_PLT16O 17 /* 16 bit PLT offset */
+#define R_68K_PLT8O 18 /* 8 bit PLT offset */
+#define R_68K_COPY 19 /* Copy symbol at runtime */
+#define R_68K_GLOB_DAT 20 /* Create GOT entry */
+#define R_68K_JMP_SLOT 21 /* Create PLT entry */
+#define R_68K_RELATIVE 22 /* Adjust by program base */
+/* Keep this the last entry. */
+#define R_68K_NUM 23
+
+/* Intel 80386 specific definitions. */
+
+/* i386 relocs. */
+
+#define R_386_NONE 0 /* No reloc */
+#define R_386_32 1 /* Direct 32 bit */
+#define R_386_PC32 2 /* PC relative 32 bit */
+#define R_386_GOT32 3 /* 32 bit GOT entry */
+#define R_386_PLT32 4 /* 32 bit PLT address */
+#define R_386_COPY 5 /* Copy symbol at runtime */
+#define R_386_GLOB_DAT 6 /* Create GOT entry */
+#define R_386_JMP_SLOT 7 /* Create PLT entry */
+#define R_386_RELATIVE 8 /* Adjust by program base */
+#define R_386_GOTOFF 9 /* 32 bit offset to GOT */
+#define R_386_GOTPC 10 /* 32 bit PC relative offset to GOT */
+#define R_386_32PLT 11
+#define R_386_TLS_TPOFF 14 /* Offset in static TLS block */
+#define R_386_TLS_IE 15 /* Address of GOT entry for static TLS
+ block offset */
+#define R_386_TLS_GOTIE 16 /* GOT entry for static TLS block
+ offset */
+#define R_386_TLS_LE 17 /* Offset relative to static TLS
+ block */
+#define R_386_TLS_GD 18 /* Direct 32 bit for GNU version of
+ general dynamic thread local data */
+#define R_386_TLS_LDM 19 /* Direct 32 bit for GNU version of
+ local dynamic thread local data
+ in LE code */
+#define R_386_16 20
+#define R_386_PC16 21
+#define R_386_8 22
+#define R_386_PC8 23
+#define R_386_TLS_GD_32 24 /* Direct 32 bit for general dynamic
+ thread local data */
+#define R_386_TLS_GD_PUSH 25 /* Tag for pushl in GD TLS code */
+#define R_386_TLS_GD_CALL 26 /* Relocation for call to
+ __tls_get_addr() */
+#define R_386_TLS_GD_POP 27 /* Tag for popl in GD TLS code */
+#define R_386_TLS_LDM_32 28 /* Direct 32 bit for local dynamic
+ thread local data in LE code */
+#define R_386_TLS_LDM_PUSH 29 /* Tag for pushl in LDM TLS code */
+#define R_386_TLS_LDM_CALL 30 /* Relocation for call to
+ __tls_get_addr() in LDM code */
+#define R_386_TLS_LDM_POP 31 /* Tag for popl in LDM TLS code */
+#define R_386_TLS_LDO_32 32 /* Offset relative to TLS block */
+#define R_386_TLS_IE_32 33 /* GOT entry for negated static TLS
+ block offset */
+#define R_386_TLS_LE_32 34 /* Negated offset relative to static
+ TLS block */
+#define R_386_TLS_DTPMOD32 35 /* ID of module containing symbol */
+#define R_386_TLS_DTPOFF32 36 /* Offset in TLS block */
+#define R_386_TLS_TPOFF32 37 /* Negated offset in static TLS block */
+/* Keep this the last entry. */
+#define R_386_NUM 38
+
+/* Blackfin specific definitions. */
+#define R_BFIN_unused0 0x00
+#define R_BFIN_pcrel5m2 0x01
+#define R_BFIN_unused1 0x02
+#define R_BFIN_pcrel10 0x03
+#define R_BFIN_pcrel12_jump 0x04
+#define R_BFIN_rimm16 0x05
+#define R_BFIN_luimm16 0x06
+#define R_BFIN_huimm16 0x07
+#define R_BFIN_pcrel12_jump_s 0x08
+#define R_BFIN_pcrel24_jump_x 0x09
+#define R_BFIN_pcrel24 0x0a
+#define R_BFIN_unusedb 0x0b
+#define R_BFIN_unusedc 0x0c
+#define R_BFIN_pcrel24_jump_l 0x0d
+#define R_BFIN_pcrel24_call_x 0x0e
+#define R_BFIN_var_eq_symb 0x0f
+#define R_BFIN_byte_data 0x10
+#define R_BFIN_byte2_data 0x11
+#define R_BFIN_byte4_data 0x12
+#define R_BFIN_pcrel11 0x13
+
+#define R_BFIN_GOT17M4 0x14
+#define R_BFIN_GOTHI 0x15
+#define R_BFIN_GOTLO 0x16
+#define R_BFIN_FUNCDESC 0x17
+#define R_BFIN_FUNCDESC_GOT17M4 0x18
+#define R_BFIN_FUNCDESC_GOTHI 0x19
+#define R_BFIN_FUNCDESC_GOTLO 0x1a
+#define R_BFIN_FUNCDESC_VALUE 0x1b
+#define R_BFIN_FUNCDESC_GOTOFF17M4 0x1c
+#define R_BFIN_FUNCDESC_GOTOFFHI 0x1d
+#define R_BFIN_FUNCDESC_GOTOFFLO 0x1e
+#define R_BFIN_GOTOFF17M4 0x1f
+#define R_BFIN_GOTOFFHI 0x20
+#define R_BFIN_GOTOFFLO 0x21
+
+#define EF_BFIN_PIC 0x00000001 /* -fpic */
+#define EF_BFIN_FDPIC 0x00000002 /* -mfdpic */
+#define EF_BFIN_CODE_IN_L1 0x00000010 /* --code-in-l1 */
+#define EF_BFIN_DATA_IN_L1 0x00000020 /* --data-in-l1 */
+
+/* FR-V specific definitions. */
+#define R_FRV_NONE 0 /* No reloc. */
+#define R_FRV_32 1 /* Direct 32 bit. */
+/* Canonical function descriptor address. */
+#define R_FRV_FUNCDESC 14
+/* Private function descriptor initialization. */
+#define R_FRV_FUNCDESC_VALUE 18
+
+ /* gpr support */
+#define EF_FRV_GPR_MASK 0x00000003 /* mask for # of gprs */
+#define EF_FRV_GPR_32 0x00000001 /* -mgpr-32 */
+#define EF_FRV_GPR_64 0x00000002 /* -mgpr-64 */
+
+ /* fpr support */
+#define EF_FRV_FPR_MASK 0x0000000c /* mask for # of fprs */
+#define EF_FRV_FPR_32 0x00000004 /* -mfpr-32 */
+#define EF_FRV_FPR_64 0x00000008 /* -mfpr-64 */
+#define EF_FRV_FPR_NONE 0x0000000c /* -msoft-float */
+
+#define EF_FRV_PIC 0x00000100
+#define EF_FRV_FDPIC 0x00008000
+
+/* SUN SPARC specific definitions. */
+
+/* Legal values for ST_TYPE subfield of st_info (symbol type). */
+
+#define STT_SPARC_REGISTER 13 /* Global register reserved to app. */
+
+/* Values for Elf64_Ehdr.e_flags. */
+
+#define EF_SPARCV9_MM 3
+#define EF_SPARCV9_TSO 0
+#define EF_SPARCV9_PSO 1
+#define EF_SPARCV9_RMO 2
+#define EF_SPARC_LEDATA 0x800000 /* little endian data */
+#define EF_SPARC_EXT_MASK 0xFFFF00
+#define EF_SPARC_32PLUS 0x000100 /* generic V8+ features */
+#define EF_SPARC_SUN_US1 0x000200 /* Sun UltraSPARC1 extensions */
+#define EF_SPARC_HAL_R1 0x000400 /* HAL R1 extensions */
+#define EF_SPARC_SUN_US3 0x000800 /* Sun UltraSPARCIII extensions */
+
+/* SPARC relocs. */
+
+#define R_SPARC_NONE 0 /* No reloc */
+#define R_SPARC_8 1 /* Direct 8 bit */
+#define R_SPARC_16 2 /* Direct 16 bit */
+#define R_SPARC_32 3 /* Direct 32 bit */
+#define R_SPARC_DISP8 4 /* PC relative 8 bit */
+#define R_SPARC_DISP16 5 /* PC relative 16 bit */
+#define R_SPARC_DISP32 6 /* PC relative 32 bit */
+#define R_SPARC_WDISP30 7 /* PC relative 30 bit shifted */
+#define R_SPARC_WDISP22 8 /* PC relative 22 bit shifted */
+#define R_SPARC_HI22 9 /* High 22 bit */
+#define R_SPARC_22 10 /* Direct 22 bit */
+#define R_SPARC_13 11 /* Direct 13 bit */
+#define R_SPARC_LO10 12 /* Truncated 10 bit */
+#define R_SPARC_GOT10 13 /* Truncated 10 bit GOT entry */
+#define R_SPARC_GOT13 14 /* 13 bit GOT entry */
+#define R_SPARC_GOT22 15 /* 22 bit GOT entry shifted */
+#define R_SPARC_PC10 16 /* PC relative 10 bit truncated */
+#define R_SPARC_PC22 17 /* PC relative 22 bit shifted */
+#define R_SPARC_WPLT30 18 /* 30 bit PC relative PLT address */
+#define R_SPARC_COPY 19 /* Copy symbol at runtime */
+#define R_SPARC_GLOB_DAT 20 /* Create GOT entry */
+#define R_SPARC_JMP_SLOT 21 /* Create PLT entry */
+#define R_SPARC_RELATIVE 22 /* Adjust by program base */
+#define R_SPARC_UA32 23 /* Direct 32 bit unaligned */
+
+/* Additional Sparc64 relocs. */
+
+#define R_SPARC_PLT32 24 /* Direct 32 bit ref to PLT entry */
+#define R_SPARC_HIPLT22 25 /* High 22 bit PLT entry */
+#define R_SPARC_LOPLT10 26 /* Truncated 10 bit PLT entry */
+#define R_SPARC_PCPLT32 27 /* PC rel 32 bit ref to PLT entry */
+#define R_SPARC_PCPLT22 28 /* PC rel high 22 bit PLT entry */
+#define R_SPARC_PCPLT10 29 /* PC rel trunc 10 bit PLT entry */
+#define R_SPARC_10 30 /* Direct 10 bit */
+#define R_SPARC_11 31 /* Direct 11 bit */
+#define R_SPARC_64 32 /* Direct 64 bit */
+#define R_SPARC_OLO10 33 /* 10bit with secondary 13bit addend */
+#define R_SPARC_HH22 34 /* Top 22 bits of direct 64 bit */
+#define R_SPARC_HM10 35 /* High middle 10 bits of ... */
+#define R_SPARC_LM22 36 /* Low middle 22 bits of ... */
+#define R_SPARC_PC_HH22 37 /* Top 22 bits of pc rel 64 bit */
+#define R_SPARC_PC_HM10 38 /* High middle 10 bit of ... */
+#define R_SPARC_PC_LM22 39 /* Low miggle 22 bits of ... */
+#define R_SPARC_WDISP16 40 /* PC relative 16 bit shifted */
+#define R_SPARC_WDISP19 41 /* PC relative 19 bit shifted */
+#define R_SPARC_7 43 /* Direct 7 bit */
+#define R_SPARC_5 44 /* Direct 5 bit */
+#define R_SPARC_6 45 /* Direct 6 bit */
+#define R_SPARC_DISP64 46 /* PC relative 64 bit */
+#define R_SPARC_PLT64 47 /* Direct 64 bit ref to PLT entry */
+#define R_SPARC_HIX22 48 /* High 22 bit complemented */
+#define R_SPARC_LOX10 49 /* Truncated 11 bit complemented */
+#define R_SPARC_H44 50 /* Direct high 12 of 44 bit */
+#define R_SPARC_M44 51 /* Direct mid 22 of 44 bit */
+#define R_SPARC_L44 52 /* Direct low 10 of 44 bit */
+#define R_SPARC_REGISTER 53 /* Global register usage */
+#define R_SPARC_UA64 54 /* Direct 64 bit unaligned */
+#define R_SPARC_UA16 55 /* Direct 16 bit unaligned */
+#define R_SPARC_TLS_GD_HI22 56
+#define R_SPARC_TLS_GD_LO10 57
+#define R_SPARC_TLS_GD_ADD 58
+#define R_SPARC_TLS_GD_CALL 59
+#define R_SPARC_TLS_LDM_HI22 60
+#define R_SPARC_TLS_LDM_LO10 61
+#define R_SPARC_TLS_LDM_ADD 62
+#define R_SPARC_TLS_LDM_CALL 63
+#define R_SPARC_TLS_LDO_HIX22 64
+#define R_SPARC_TLS_LDO_LOX10 65
+#define R_SPARC_TLS_LDO_ADD 66
+#define R_SPARC_TLS_IE_HI22 67
+#define R_SPARC_TLS_IE_LO10 68
+#define R_SPARC_TLS_IE_LD 69
+#define R_SPARC_TLS_IE_LDX 70
+#define R_SPARC_TLS_IE_ADD 71
+#define R_SPARC_TLS_LE_HIX22 72
+#define R_SPARC_TLS_LE_LOX10 73
+#define R_SPARC_TLS_DTPMOD32 74
+#define R_SPARC_TLS_DTPMOD64 75
+#define R_SPARC_TLS_DTPOFF32 76
+#define R_SPARC_TLS_DTPOFF64 77
+#define R_SPARC_TLS_TPOFF32 78
+#define R_SPARC_TLS_TPOFF64 79
+/* Keep this the last entry. */
+#define R_SPARC_NUM 80
+
+/* For Sparc64, legal values for d_tag of Elf64_Dyn. */
+
+#define DT_SPARC_REGISTER 0x70000001
+#define DT_SPARC_NUM 2
+
+/* Bits present in AT_HWCAP, primarily for Sparc32. */
+
+#define HWCAP_SPARC_FLUSH 1 /* The cpu supports flush insn. */
+#define HWCAP_SPARC_STBAR 2
+#define HWCAP_SPARC_SWAP 4
+#define HWCAP_SPARC_MULDIV 8
+#define HWCAP_SPARC_V9 16 /* The cpu is v9, so v8plus is ok. */
+#define HWCAP_SPARC_ULTRA3 32
+
+/* MIPS R3000 specific definitions. */
+
+/* Legal values for e_flags field of Elf32_Ehdr. */
+
+#define EF_MIPS_NOREORDER 1 /* A .noreorder directive was used */
+#define EF_MIPS_PIC 2 /* Contains PIC code */
+#define EF_MIPS_CPIC 4 /* Uses PIC calling sequence */
+#define EF_MIPS_XGOT 8
+#define EF_MIPS_64BIT_WHIRL 16
+#define EF_MIPS_ABI2 32
+#define EF_MIPS_ABI_ON32 64
+#define EF_MIPS_ARCH 0xf0000000 /* MIPS architecture level */
+
+/* Legal values for MIPS architecture level. */
+
+#define EF_MIPS_ARCH_1 0x00000000 /* -mips1 code. */
+#define EF_MIPS_ARCH_2 0x10000000 /* -mips2 code. */
+#define EF_MIPS_ARCH_3 0x20000000 /* -mips3 code. */
+#define EF_MIPS_ARCH_4 0x30000000 /* -mips4 code. */
+#define EF_MIPS_ARCH_5 0x40000000 /* -mips5 code. */
+#define EF_MIPS_ARCH_32 0x60000000 /* MIPS32 code. */
+#define EF_MIPS_ARCH_64 0x70000000 /* MIPS64 code. */
+
+/* The following are non-official names and should not be used. */
+
+#define E_MIPS_ARCH_1 0x00000000 /* -mips1 code. */
+#define E_MIPS_ARCH_2 0x10000000 /* -mips2 code. */
+#define E_MIPS_ARCH_3 0x20000000 /* -mips3 code. */
+#define E_MIPS_ARCH_4 0x30000000 /* -mips4 code. */
+#define E_MIPS_ARCH_5 0x40000000 /* -mips5 code. */
+#define E_MIPS_ARCH_32 0x60000000 /* MIPS32 code. */
+#define E_MIPS_ARCH_64 0x70000000 /* MIPS64 code. */
+
+/* Special section indices. */
+
+#define SHN_MIPS_ACOMMON 0xff00 /* Allocated common symbols */
+#define SHN_MIPS_TEXT 0xff01 /* Allocated test symbols. */
+#define SHN_MIPS_DATA 0xff02 /* Allocated data symbols. */
+#define SHN_MIPS_SCOMMON 0xff03 /* Small common symbols */
+#define SHN_MIPS_SUNDEFINED 0xff04 /* Small undefined symbols */
+
+/* Legal values for sh_type field of Elf32_Shdr. */
+
+#define SHT_MIPS_LIBLIST 0x70000000 /* Shared objects used in link */
+#define SHT_MIPS_MSYM 0x70000001
+#define SHT_MIPS_CONFLICT 0x70000002 /* Conflicting symbols */
+#define SHT_MIPS_GPTAB 0x70000003 /* Global data area sizes */
+#define SHT_MIPS_UCODE 0x70000004 /* Reserved for SGI/MIPS compilers */
+#define SHT_MIPS_DEBUG 0x70000005 /* MIPS ECOFF debugging information*/
+#define SHT_MIPS_REGINFO 0x70000006 /* Register usage information */
+#define SHT_MIPS_PACKAGE 0x70000007
+#define SHT_MIPS_PACKSYM 0x70000008
+#define SHT_MIPS_RELD 0x70000009
+#define SHT_MIPS_IFACE 0x7000000b
+#define SHT_MIPS_CONTENT 0x7000000c
+#define SHT_MIPS_OPTIONS 0x7000000d /* Miscellaneous options. */
+#define SHT_MIPS_SHDR 0x70000010
+#define SHT_MIPS_FDESC 0x70000011
+#define SHT_MIPS_EXTSYM 0x70000012
+#define SHT_MIPS_DENSE 0x70000013
+#define SHT_MIPS_PDESC 0x70000014
+#define SHT_MIPS_LOCSYM 0x70000015
+#define SHT_MIPS_AUXSYM 0x70000016
+#define SHT_MIPS_OPTSYM 0x70000017
+#define SHT_MIPS_LOCSTR 0x70000018
+#define SHT_MIPS_LINE 0x70000019
+#define SHT_MIPS_RFDESC 0x7000001a
+#define SHT_MIPS_DELTASYM 0x7000001b
+#define SHT_MIPS_DELTAINST 0x7000001c
+#define SHT_MIPS_DELTACLASS 0x7000001d
+#define SHT_MIPS_DWARF 0x7000001e /* DWARF debugging information. */
+#define SHT_MIPS_DELTADECL 0x7000001f
+#define SHT_MIPS_SYMBOL_LIB 0x70000020
+#define SHT_MIPS_EVENTS 0x70000021 /* Event section. */
+#define SHT_MIPS_TRANSLATE 0x70000022
+#define SHT_MIPS_PIXIE 0x70000023
+#define SHT_MIPS_XLATE 0x70000024
+#define SHT_MIPS_XLATE_DEBUG 0x70000025
+#define SHT_MIPS_WHIRL 0x70000026
+#define SHT_MIPS_EH_REGION 0x70000027
+#define SHT_MIPS_XLATE_OLD 0x70000028
+#define SHT_MIPS_PDR_EXCEPTION 0x70000029
+
+/* Legal values for sh_flags field of Elf32_Shdr. */
+
+#define SHF_MIPS_GPREL 0x10000000 /* Must be part of global data area */
+#define SHF_MIPS_MERGE 0x20000000
+#define SHF_MIPS_ADDR 0x40000000
+#define SHF_MIPS_STRINGS 0x80000000
+#define SHF_MIPS_NOSTRIP 0x08000000
+#define SHF_MIPS_LOCAL 0x04000000
+#define SHF_MIPS_NAMES 0x02000000
+#define SHF_MIPS_NODUPE 0x01000000
+
+
+/* Symbol tables. */
+
+/* MIPS specific values for `st_other'. */
+#define STO_MIPS_DEFAULT 0x0
+#define STO_MIPS_INTERNAL 0x1
+#define STO_MIPS_HIDDEN 0x2
+#define STO_MIPS_PROTECTED 0x3
+#define STO_MIPS_SC_ALIGN_UNUSED 0xff
+
+/* MIPS specific values for `st_info'. */
+#define STB_MIPS_SPLIT_COMMON 13
+
+/* Entries found in sections of type SHT_MIPS_GPTAB. */
+
+typedef union
+{
+ struct
+ {
+ Elf32_Word gt_current_g_value; /* -G value used for compilation */
+ Elf32_Word gt_unused; /* Not used */
+ } gt_header; /* First entry in section */
+ struct
+ {
+ Elf32_Word gt_g_value; /* If this value were used for -G */
+ Elf32_Word gt_bytes; /* This many bytes would be used */
+ } gt_entry; /* Subsequent entries in section */
+} Elf32_gptab;
+
+/* Entry found in sections of type SHT_MIPS_REGINFO. */
+
+typedef struct
+{
+ Elf32_Word ri_gprmask; /* General registers used */
+ Elf32_Word ri_cprmask[4]; /* Coprocessor registers used */
+ Elf32_Sword ri_gp_value; /* $gp register value */
+} Elf32_RegInfo;
+
+/* Entries found in sections of type SHT_MIPS_OPTIONS. */
+
+typedef struct
+{
+ unsigned char kind; /* Determines interpretation of the
+ variable part of descriptor. */
+ unsigned char size; /* Size of descriptor, including header. */
+ Elf32_Section section; /* Section header index of section affected,
+ 0 for global options. */
+ Elf32_Word info; /* Kind-specific information. */
+} Elf_Options;
+
+/* Values for `kind' field in Elf_Options. */
+
+#define ODK_NULL 0 /* Undefined. */
+#define ODK_REGINFO 1 /* Register usage information. */
+#define ODK_EXCEPTIONS 2 /* Exception processing options. */
+#define ODK_PAD 3 /* Section padding options. */
+#define ODK_HWPATCH 4 /* Hardware workarounds performed */
+#define ODK_FILL 5 /* record the fill value used by the linker. */
+#define ODK_TAGS 6 /* reserve space for desktop tools to write. */
+#define ODK_HWAND 7 /* HW workarounds. 'AND' bits when merging. */
+#define ODK_HWOR 8 /* HW workarounds. 'OR' bits when merging. */
+
+/* Values for `info' in Elf_Options for ODK_EXCEPTIONS entries. */
+
+#define OEX_FPU_MIN 0x1f /* FPE's which MUST be enabled. */
+#define OEX_FPU_MAX 0x1f00 /* FPE's which MAY be enabled. */
+#define OEX_PAGE0 0x10000 /* page zero must be mapped. */
+#define OEX_SMM 0x20000 /* Force sequential memory mode? */
+#define OEX_FPDBUG 0x40000 /* Force floating point debug mode? */
+#define OEX_PRECISEFP OEX_FPDBUG
+#define OEX_DISMISS 0x80000 /* Dismiss invalid address faults? */
+
+#define OEX_FPU_INVAL 0x10
+#define OEX_FPU_DIV0 0x08
+#define OEX_FPU_OFLO 0x04
+#define OEX_FPU_UFLO 0x02
+#define OEX_FPU_INEX 0x01
+
+/* Masks for `info' in Elf_Options for an ODK_HWPATCH entry. */
+
+#define OHW_R4KEOP 0x1 /* R4000 end-of-page patch. */
+#define OHW_R8KPFETCH 0x2 /* may need R8000 prefetch patch. */
+#define OHW_R5KEOP 0x4 /* R5000 end-of-page patch. */
+#define OHW_R5KCVTL 0x8 /* R5000 cvt.[ds].l bug. clean=1. */
+
+#define OPAD_PREFIX 0x1
+#define OPAD_POSTFIX 0x2
+#define OPAD_SYMBOL 0x4
+
+/* Entry found in `.options' section. */
+
+typedef struct
+{
+ Elf32_Word hwp_flags1; /* Extra flags. */
+ Elf32_Word hwp_flags2; /* Extra flags. */
+} Elf_Options_Hw;
+
+/* Masks for `info' in ElfOptions for ODK_HWAND and ODK_HWOR entries. */
+
+#define OHWA0_R4KEOP_CHECKED 0x00000001
+#define OHWA1_R4KEOP_CLEAN 0x00000002
+
+/* MIPS relocs. */
+
+#define R_MIPS_NONE 0 /* No reloc */
+#define R_MIPS_16 1 /* Direct 16 bit */
+#define R_MIPS_32 2 /* Direct 32 bit */
+#define R_MIPS_REL32 3 /* PC relative 32 bit */
+#define R_MIPS_26 4 /* Direct 26 bit shifted */
+#define R_MIPS_HI16 5 /* High 16 bit */
+#define R_MIPS_LO16 6 /* Low 16 bit */
+#define R_MIPS_GPREL16 7 /* GP relative 16 bit */
+#define R_MIPS_LITERAL 8 /* 16 bit literal entry */
+#define R_MIPS_GOT16 9 /* 16 bit GOT entry */
+#define R_MIPS_PC16 10 /* PC relative 16 bit */
+#define R_MIPS_CALL16 11 /* 16 bit GOT entry for function */
+#define R_MIPS_GPREL32 12 /* GP relative 32 bit */
+
+#define R_MIPS_SHIFT5 16
+#define R_MIPS_SHIFT6 17
+#define R_MIPS_64 18
+#define R_MIPS_GOT_DISP 19
+#define R_MIPS_GOT_PAGE 20
+#define R_MIPS_GOT_OFST 21
+#define R_MIPS_GOT_HI16 22
+#define R_MIPS_GOT_LO16 23
+#define R_MIPS_SUB 24
+#define R_MIPS_INSERT_A 25
+#define R_MIPS_INSERT_B 26
+#define R_MIPS_DELETE 27
+#define R_MIPS_HIGHER 28
+#define R_MIPS_HIGHEST 29
+#define R_MIPS_CALL_HI16 30
+#define R_MIPS_CALL_LO16 31
+#define R_MIPS_SCN_DISP 32
+#define R_MIPS_REL16 33
+#define R_MIPS_ADD_IMMEDIATE 34
+#define R_MIPS_PJUMP 35
+#define R_MIPS_RELGOT 36
+#define R_MIPS_JALR 37
+#define R_MIPS_TLS_DTPMOD32 38 /* Module number 32 bit */
+#define R_MIPS_TLS_DTPREL32 39 /* Module-relative offset 32 bit */
+#define R_MIPS_TLS_DTPMOD64 40 /* Module number 64 bit */
+#define R_MIPS_TLS_DTPREL64 41 /* Module-relative offset 64 bit */
+#define R_MIPS_TLS_GD 42 /* 16 bit GOT offset for GD */
+#define R_MIPS_TLS_LDM 43 /* 16 bit GOT offset for LDM */
+#define R_MIPS_TLS_DTPREL_HI16 44 /* Module-relative offset, high 16 bits */
+#define R_MIPS_TLS_DTPREL_LO16 45 /* Module-relative offset, low 16 bits */
+#define R_MIPS_TLS_GOTTPREL 46 /* 16 bit GOT offset for IE */
+#define R_MIPS_TLS_TPREL32 47 /* TP-relative offset, 32 bit */
+#define R_MIPS_TLS_TPREL64 48 /* TP-relative offset, 64 bit */
+#define R_MIPS_TLS_TPREL_HI16 49 /* TP-relative offset, high 16 bits */
+#define R_MIPS_TLS_TPREL_LO16 50 /* TP-relative offset, low 16 bits */
+/* Keep this the last entry. */
+#define R_MIPS_NUM 51
+
+/* Legal values for p_type field of Elf32_Phdr. */
+
+#define PT_MIPS_REGINFO 0x70000000 /* Register usage information */
+#define PT_MIPS_RTPROC 0x70000001 /* Runtime procedure table. */
+#define PT_MIPS_OPTIONS 0x70000002
+
+/* Special program header types. */
+
+#define PF_MIPS_LOCAL 0x10000000
+
+/* Legal values for d_tag field of Elf32_Dyn. */
+
+#define DT_MIPS_RLD_VERSION 0x70000001 /* Runtime linker interface version */
+#define DT_MIPS_TIME_STAMP 0x70000002 /* Timestamp */
+#define DT_MIPS_ICHECKSUM 0x70000003 /* Checksum */
+#define DT_MIPS_IVERSION 0x70000004 /* Version string (string tbl index) */
+#define DT_MIPS_FLAGS 0x70000005 /* Flags */
+#define DT_MIPS_BASE_ADDRESS 0x70000006 /* Base address */
+#define DT_MIPS_MSYM 0x70000007
+#define DT_MIPS_CONFLICT 0x70000008 /* Address of CONFLICT section */
+#define DT_MIPS_LIBLIST 0x70000009 /* Address of LIBLIST section */
+#define DT_MIPS_LOCAL_GOTNO 0x7000000a /* Number of local GOT entries */
+#define DT_MIPS_CONFLICTNO 0x7000000b /* Number of CONFLICT entries */
+#define DT_MIPS_LIBLISTNO 0x70000010 /* Number of LIBLIST entries */
+#define DT_MIPS_SYMTABNO 0x70000011 /* Number of DYNSYM entries */
+#define DT_MIPS_UNREFEXTNO 0x70000012 /* First external DYNSYM */
+#define DT_MIPS_GOTSYM 0x70000013 /* First GOT entry in DYNSYM */
+#define DT_MIPS_HIPAGENO 0x70000014 /* Number of GOT page table entries */
+#define DT_MIPS_RLD_MAP 0x70000016 /* Address of run time loader map. */
+#define DT_MIPS_DELTA_CLASS 0x70000017 /* Delta C++ class definition. */
+#define DT_MIPS_DELTA_CLASS_NO 0x70000018 /* Number of entries in
+ DT_MIPS_DELTA_CLASS. */
+#define DT_MIPS_DELTA_INSTANCE 0x70000019 /* Delta C++ class instances. */
+#define DT_MIPS_DELTA_INSTANCE_NO 0x7000001a /* Number of entries in
+ DT_MIPS_DELTA_INSTANCE. */
+#define DT_MIPS_DELTA_RELOC 0x7000001b /* Delta relocations. */
+#define DT_MIPS_DELTA_RELOC_NO 0x7000001c /* Number of entries in
+ DT_MIPS_DELTA_RELOC. */
+#define DT_MIPS_DELTA_SYM 0x7000001d /* Delta symbols that Delta
+ relocations refer to. */
+#define DT_MIPS_DELTA_SYM_NO 0x7000001e /* Number of entries in
+ DT_MIPS_DELTA_SYM. */
+#define DT_MIPS_DELTA_CLASSSYM 0x70000020 /* Delta symbols that hold the
+ class declaration. */
+#define DT_MIPS_DELTA_CLASSSYM_NO 0x70000021 /* Number of entries in
+ DT_MIPS_DELTA_CLASSSYM. */
+#define DT_MIPS_CXX_FLAGS 0x70000022 /* Flags indicating for C++ flavor. */
+#define DT_MIPS_PIXIE_INIT 0x70000023
+#define DT_MIPS_SYMBOL_LIB 0x70000024
+#define DT_MIPS_LOCALPAGE_GOTIDX 0x70000025
+#define DT_MIPS_LOCAL_GOTIDX 0x70000026
+#define DT_MIPS_HIDDEN_GOTIDX 0x70000027
+#define DT_MIPS_PROTECTED_GOTIDX 0x70000028
+#define DT_MIPS_OPTIONS 0x70000029 /* Address of .options. */
+#define DT_MIPS_INTERFACE 0x7000002a /* Address of .interface. */
+#define DT_MIPS_DYNSTR_ALIGN 0x7000002b
+#define DT_MIPS_INTERFACE_SIZE 0x7000002c /* Size of the .interface section. */
+#define DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002d /* Address of rld_text_rsolve
+ function stored in GOT. */
+#define DT_MIPS_PERF_SUFFIX 0x7000002e /* Default suffix of dso to be added
+ by rld on dlopen() calls. */
+#define DT_MIPS_COMPACT_SIZE 0x7000002f /* (O32)Size of compact rel section. */
+#define DT_MIPS_GP_VALUE 0x70000030 /* GP value for aux GOTs. */
+#define DT_MIPS_AUX_DYNAMIC 0x70000031 /* Address of aux .dynamic. */
+#define DT_MIPS_NUM 0x32
+
+/* Legal values for DT_MIPS_FLAGS Elf32_Dyn entry. */
+
+#define RHF_NONE 0 /* No flags */
+#define RHF_QUICKSTART (1 << 0) /* Use quickstart */
+#define RHF_NOTPOT (1 << 1) /* Hash size not power of 2 */
+#define RHF_NO_LIBRARY_REPLACEMENT (1 << 2) /* Ignore LD_LIBRARY_PATH */
+#define RHF_NO_MOVE (1 << 3)
+#define RHF_SGI_ONLY (1 << 4)
+#define RHF_GUARANTEE_INIT (1 << 5)
+#define RHF_DELTA_C_PLUS_PLUS (1 << 6)
+#define RHF_GUARANTEE_START_INIT (1 << 7)
+#define RHF_PIXIE (1 << 8)
+#define RHF_DEFAULT_DELAY_LOAD (1 << 9)
+#define RHF_REQUICKSTART (1 << 10)
+#define RHF_REQUICKSTARTED (1 << 11)
+#define RHF_CORD (1 << 12)
+#define RHF_NO_UNRES_UNDEF (1 << 13)
+#define RHF_RLD_ORDER_SAFE (1 << 14)
+
+/* Entries found in sections of type SHT_MIPS_LIBLIST. */
+
+typedef struct
+{
+ Elf32_Word l_name; /* Name (string table index) */
+ Elf32_Word l_time_stamp; /* Timestamp */
+ Elf32_Word l_checksum; /* Checksum */
+ Elf32_Word l_version; /* Interface version */
+ Elf32_Word l_flags; /* Flags */
+} Elf32_Lib;
+
+typedef struct
+{
+ Elf64_Word l_name; /* Name (string table index) */
+ Elf64_Word l_time_stamp; /* Timestamp */
+ Elf64_Word l_checksum; /* Checksum */
+ Elf64_Word l_version; /* Interface version */
+ Elf64_Word l_flags; /* Flags */
+} Elf64_Lib;
+
+
+/* Legal values for l_flags. */
+
+#define LL_NONE 0
+#define LL_EXACT_MATCH (1 << 0) /* Require exact match */
+#define LL_IGNORE_INT_VER (1 << 1) /* Ignore interface version */
+#define LL_REQUIRE_MINOR (1 << 2)
+#define LL_EXPORTS (1 << 3)
+#define LL_DELAY_LOAD (1 << 4)
+#define LL_DELTA (1 << 5)
+
+/* Entries found in sections of type SHT_MIPS_CONFLICT. */
+
+typedef Elf32_Addr Elf32_Conflict;
+
+
+/* HPPA specific definitions. */
+
+/* Legal values for e_flags field of Elf32_Ehdr. */
+
+#define EF_PARISC_TRAPNIL 0x00010000 /* Trap nil pointer dereference. */
+#define EF_PARISC_EXT 0x00020000 /* Program uses arch. extensions. */
+#define EF_PARISC_LSB 0x00040000 /* Program expects little endian. */
+#define EF_PARISC_WIDE 0x00080000 /* Program expects wide mode. */
+#define EF_PARISC_NO_KABP 0x00100000 /* No kernel assisted branch
+ prediction. */
+#define EF_PARISC_LAZYSWAP 0x00400000 /* Allow lazy swapping. */
+#define EF_PARISC_ARCH 0x0000ffff /* Architecture version. */
+
+/* Defined values for `e_flags & EF_PARISC_ARCH' are: */
+
+#define EFA_PARISC_1_0 0x020b /* PA-RISC 1.0 big-endian. */
+#define EFA_PARISC_1_1 0x0210 /* PA-RISC 1.1 big-endian. */
+#define EFA_PARISC_2_0 0x0214 /* PA-RISC 2.0 big-endian. */
+
+/* Additional section indeces. */
+
+#define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tenatively declared
+ symbols in ANSI C. */
+#define SHN_PARISC_HUGE_COMMON 0xff01 /* Common blocks in huge model. */
+
+/* Legal values for sh_type field of Elf32_Shdr. */
+
+#define SHT_PARISC_EXT 0x70000000 /* Contains product specific ext. */
+#define SHT_PARISC_UNWIND 0x70000001 /* Unwind information. */
+#define SHT_PARISC_DOC 0x70000002 /* Debug info for optimized code. */
+
+/* Legal values for sh_flags field of Elf32_Shdr. */
+
+#define SHF_PARISC_SHORT 0x20000000 /* Section with short addressing. */
+#define SHF_PARISC_HUGE 0x40000000 /* Section far from gp. */
+#define SHF_PARISC_SBP 0x80000000 /* Static branch prediction code. */
+
+/* Legal values for ST_TYPE subfield of st_info (symbol type). */
+
+#define STT_PARISC_MILLICODE 13 /* Millicode function entry point. */
+
+#define STT_HP_OPAQUE (STT_LOOS + 0x1)
+#define STT_HP_STUB (STT_LOOS + 0x2)
+
+/* HPPA relocs. */
+
+#define R_PARISC_NONE 0 /* No reloc. */
+#define R_PARISC_DIR32 1 /* Direct 32-bit reference. */
+#define R_PARISC_DIR21L 2 /* Left 21 bits of eff. address. */
+#define R_PARISC_DIR17R 3 /* Right 17 bits of eff. address. */
+#define R_PARISC_DIR17F 4 /* 17 bits of eff. address. */
+#define R_PARISC_DIR14R 6 /* Right 14 bits of eff. address. */
+#define R_PARISC_PCREL32 9 /* 32-bit rel. address. */
+#define R_PARISC_PCREL21L 10 /* Left 21 bits of rel. address. */
+#define R_PARISC_PCREL17R 11 /* Right 17 bits of rel. address. */
+#define R_PARISC_PCREL17F 12 /* 17 bits of rel. address. */
+#define R_PARISC_PCREL14R 14 /* Right 14 bits of rel. address. */
+#define R_PARISC_DPREL21L 18 /* Left 21 bits of rel. address. */
+#define R_PARISC_DPREL14R 22 /* Right 14 bits of rel. address. */
+#define R_PARISC_GPREL21L 26 /* GP-relative, left 21 bits. */
+#define R_PARISC_GPREL14R 30 /* GP-relative, right 14 bits. */
+#define R_PARISC_LTOFF21L 34 /* LT-relative, left 21 bits. */
+#define R_PARISC_LTOFF14R 38 /* LT-relative, right 14 bits. */
+#define R_PARISC_SECREL32 41 /* 32 bits section rel. address. */
+#define R_PARISC_SEGBASE 48 /* No relocation, set segment base. */
+#define R_PARISC_SEGREL32 49 /* 32 bits segment rel. address. */
+#define R_PARISC_PLTOFF21L 50 /* PLT rel. address, left 21 bits. */
+#define R_PARISC_PLTOFF14R 54 /* PLT rel. address, right 14 bits. */
+#define R_PARISC_LTOFF_FPTR32 57 /* 32 bits LT-rel. function pointer. */
+#define R_PARISC_LTOFF_FPTR21L 58 /* LT-rel. fct ptr, left 21 bits. */
+#define R_PARISC_LTOFF_FPTR14R 62 /* LT-rel. fct ptr, right 14 bits. */
+#define R_PARISC_FPTR64 64 /* 64 bits function address. */
+#define R_PARISC_PLABEL32 65 /* 32 bits function address. */
+#define R_PARISC_PCREL64 72 /* 64 bits PC-rel. address. */
+#define R_PARISC_PCREL22F 74 /* 22 bits PC-rel. address. */
+#define R_PARISC_PCREL14WR 75 /* PC-rel. address, right 14 bits. */
+#define R_PARISC_PCREL14DR 76 /* PC rel. address, right 14 bits. */
+#define R_PARISC_PCREL16F 77 /* 16 bits PC-rel. address. */
+#define R_PARISC_PCREL16WF 78 /* 16 bits PC-rel. address. */
+#define R_PARISC_PCREL16DF 79 /* 16 bits PC-rel. address. */
+#define R_PARISC_DIR64 80 /* 64 bits of eff. address. */
+#define R_PARISC_DIR14WR 83 /* 14 bits of eff. address. */
+#define R_PARISC_DIR14DR 84 /* 14 bits of eff. address. */
+#define R_PARISC_DIR16F 85 /* 16 bits of eff. address. */
+#define R_PARISC_DIR16WF 86 /* 16 bits of eff. address. */
+#define R_PARISC_DIR16DF 87 /* 16 bits of eff. address. */
+#define R_PARISC_GPREL64 88 /* 64 bits of GP-rel. address. */
+#define R_PARISC_GPREL14WR 91 /* GP-rel. address, right 14 bits. */
+#define R_PARISC_GPREL14DR 92 /* GP-rel. address, right 14 bits. */
+#define R_PARISC_GPREL16F 93 /* 16 bits GP-rel. address. */
+#define R_PARISC_GPREL16WF 94 /* 16 bits GP-rel. address. */
+#define R_PARISC_GPREL16DF 95 /* 16 bits GP-rel. address. */
+#define R_PARISC_LTOFF64 96 /* 64 bits LT-rel. address. */
+#define R_PARISC_LTOFF14WR 99 /* LT-rel. address, right 14 bits. */
+#define R_PARISC_LTOFF14DR 100 /* LT-rel. address, right 14 bits. */
+#define R_PARISC_LTOFF16F 101 /* 16 bits LT-rel. address. */
+#define R_PARISC_LTOFF16WF 102 /* 16 bits LT-rel. address. */
+#define R_PARISC_LTOFF16DF 103 /* 16 bits LT-rel. address. */
+#define R_PARISC_SECREL64 104 /* 64 bits section rel. address. */
+#define R_PARISC_SEGREL64 112 /* 64 bits segment rel. address. */
+#define R_PARISC_PLTOFF14WR 115 /* PLT-rel. address, right 14 bits. */
+#define R_PARISC_PLTOFF14DR 116 /* PLT-rel. address, right 14 bits. */
+#define R_PARISC_PLTOFF16F 117 /* 16 bits LT-rel. address. */
+#define R_PARISC_PLTOFF16WF 118 /* 16 bits PLT-rel. address. */
+#define R_PARISC_PLTOFF16DF 119 /* 16 bits PLT-rel. address. */
+#define R_PARISC_LTOFF_FPTR64 120 /* 64 bits LT-rel. function ptr. */
+#define R_PARISC_LTOFF_FPTR14WR 123 /* LT-rel. fct. ptr., right 14 bits. */
+#define R_PARISC_LTOFF_FPTR14DR 124 /* LT-rel. fct. ptr., right 14 bits. */
+#define R_PARISC_LTOFF_FPTR16F 125 /* 16 bits LT-rel. function ptr. */
+#define R_PARISC_LTOFF_FPTR16WF 126 /* 16 bits LT-rel. function ptr. */
+#define R_PARISC_LTOFF_FPTR16DF 127 /* 16 bits LT-rel. function ptr. */
+#define R_PARISC_LORESERVE 128
+#define R_PARISC_COPY 128 /* Copy relocation. */
+#define R_PARISC_IPLT 129 /* Dynamic reloc, imported PLT */
+#define R_PARISC_EPLT 130 /* Dynamic reloc, exported PLT */
+#define R_PARISC_TPREL32 153 /* 32 bits TP-rel. address. */
+#define R_PARISC_TPREL21L 154 /* TP-rel. address, left 21 bits. */
+#define R_PARISC_TPREL14R 158 /* TP-rel. address, right 14 bits. */
+#define R_PARISC_LTOFF_TP21L 162 /* LT-TP-rel. address, left 21 bits. */
+#define R_PARISC_LTOFF_TP14R 166 /* LT-TP-rel. address, right 14 bits.*/
+#define R_PARISC_LTOFF_TP14F 167 /* 14 bits LT-TP-rel. address. */
+#define R_PARISC_TPREL64 216 /* 64 bits TP-rel. address. */
+#define R_PARISC_TPREL14WR 219 /* TP-rel. address, right 14 bits. */
+#define R_PARISC_TPREL14DR 220 /* TP-rel. address, right 14 bits. */
+#define R_PARISC_TPREL16F 221 /* 16 bits TP-rel. address. */
+#define R_PARISC_TPREL16WF 222 /* 16 bits TP-rel. address. */
+#define R_PARISC_TPREL16DF 223 /* 16 bits TP-rel. address. */
+#define R_PARISC_LTOFF_TP64 224 /* 64 bits LT-TP-rel. address. */
+#define R_PARISC_LTOFF_TP14WR 227 /* LT-TP-rel. address, right 14 bits.*/
+#define R_PARISC_LTOFF_TP14DR 228 /* LT-TP-rel. address, right 14 bits.*/
+#define R_PARISC_LTOFF_TP16F 229 /* 16 bits LT-TP-rel. address. */
+#define R_PARISC_LTOFF_TP16WF 230 /* 16 bits LT-TP-rel. address. */
+#define R_PARISC_LTOFF_TP16DF 231 /* 16 bits LT-TP-rel. address. */
+#define R_PARISC_HIRESERVE 255
+
+/* Legal values for p_type field of Elf32_Phdr/Elf64_Phdr. */
+
+#define PT_HP_TLS (PT_LOOS + 0x0)
+#define PT_HP_CORE_NONE (PT_LOOS + 0x1)
+#define PT_HP_CORE_VERSION (PT_LOOS + 0x2)
+#define PT_HP_CORE_KERNEL (PT_LOOS + 0x3)
+#define PT_HP_CORE_COMM (PT_LOOS + 0x4)
+#define PT_HP_CORE_PROC (PT_LOOS + 0x5)
+#define PT_HP_CORE_LOADABLE (PT_LOOS + 0x6)
+#define PT_HP_CORE_STACK (PT_LOOS + 0x7)
+#define PT_HP_CORE_SHM (PT_LOOS + 0x8)
+#define PT_HP_CORE_MMF (PT_LOOS + 0x9)
+#define PT_HP_PARALLEL (PT_LOOS + 0x10)
+#define PT_HP_FASTBIND (PT_LOOS + 0x11)
+#define PT_HP_OPT_ANNOT (PT_LOOS + 0x12)
+#define PT_HP_HSL_ANNOT (PT_LOOS + 0x13)
+#define PT_HP_STACK (PT_LOOS + 0x14)
+
+#define PT_PARISC_ARCHEXT 0x70000000
+#define PT_PARISC_UNWIND 0x70000001
+
+/* Legal values for p_flags field of Elf32_Phdr/Elf64_Phdr. */
+
+#define PF_PARISC_SBP 0x08000000
+
+#define PF_HP_PAGE_SIZE 0x00100000
+#define PF_HP_FAR_SHARED 0x00200000
+#define PF_HP_NEAR_SHARED 0x00400000
+#define PF_HP_CODE 0x01000000
+#define PF_HP_MODIFY 0x02000000
+#define PF_HP_LAZYSWAP 0x04000000
+#define PF_HP_SBP 0x08000000
+
+
+/* Alpha specific definitions. */
+
+/* Legal values for e_flags field of Elf64_Ehdr. */
+
+#define EF_ALPHA_32BIT 1 /* All addresses must be < 2GB. */
+#define EF_ALPHA_CANRELAX 2 /* Relocations for relaxing exist. */
+
+/* Legal values for sh_type field of Elf64_Shdr. */
+
+/* These two are primerily concerned with ECOFF debugging info. */
+#define SHT_ALPHA_DEBUG 0x70000001
+#define SHT_ALPHA_REGINFO 0x70000002
+
+/* Legal values for sh_flags field of Elf64_Shdr. */
+
+#define SHF_ALPHA_GPREL 0x10000000
+
+/* Legal values for st_other field of Elf64_Sym. */
+#define STO_ALPHA_NOPV 0x80 /* No PV required. */
+#define STO_ALPHA_STD_GPLOAD 0x88 /* PV only used for initial ldgp. */
+
+/* Alpha relocs. */
+
+#define R_ALPHA_NONE 0 /* No reloc */
+#define R_ALPHA_REFLONG 1 /* Direct 32 bit */
+#define R_ALPHA_REFQUAD 2 /* Direct 64 bit */
+#define R_ALPHA_GPREL32 3 /* GP relative 32 bit */
+#define R_ALPHA_LITERAL 4 /* GP relative 16 bit w/optimization */
+#define R_ALPHA_LITUSE 5 /* Optimization hint for LITERAL */
+#define R_ALPHA_GPDISP 6 /* Add displacement to GP */
+#define R_ALPHA_BRADDR 7 /* PC+4 relative 23 bit shifted */
+#define R_ALPHA_HINT 8 /* PC+4 relative 16 bit shifted */
+#define R_ALPHA_SREL16 9 /* PC relative 16 bit */
+#define R_ALPHA_SREL32 10 /* PC relative 32 bit */
+#define R_ALPHA_SREL64 11 /* PC relative 64 bit */
+#define R_ALPHA_GPRELHIGH 17 /* GP relative 32 bit, high 16 bits */
+#define R_ALPHA_GPRELLOW 18 /* GP relative 32 bit, low 16 bits */
+#define R_ALPHA_GPREL16 19 /* GP relative 16 bit */
+#define R_ALPHA_COPY 24 /* Copy symbol at runtime */
+#define R_ALPHA_GLOB_DAT 25 /* Create GOT entry */
+#define R_ALPHA_JMP_SLOT 26 /* Create PLT entry */
+#define R_ALPHA_RELATIVE 27 /* Adjust by program base */
+#define R_ALPHA_TLS_GD_HI 28
+#define R_ALPHA_TLSGD 29
+#define R_ALPHA_TLS_LDM 30
+#define R_ALPHA_DTPMOD64 31
+#define R_ALPHA_GOTDTPREL 32
+#define R_ALPHA_DTPREL64 33
+#define R_ALPHA_DTPRELHI 34
+#define R_ALPHA_DTPRELLO 35
+#define R_ALPHA_DTPREL16 36
+#define R_ALPHA_GOTTPREL 37
+#define R_ALPHA_TPREL64 38
+#define R_ALPHA_TPRELHI 39
+#define R_ALPHA_TPRELLO 40
+#define R_ALPHA_TPREL16 41
+/* Keep this the last entry. */
+#define R_ALPHA_NUM 46
+
+/* Magic values of the LITUSE relocation addend. */
+#define LITUSE_ALPHA_ADDR 0
+#define LITUSE_ALPHA_BASE 1
+#define LITUSE_ALPHA_BYTOFF 2
+#define LITUSE_ALPHA_JSR 3
+#define LITUSE_ALPHA_TLS_GD 4
+#define LITUSE_ALPHA_TLS_LDM 5
+
+/* Legal values for d_tag of Elf64_Dyn. */
+#define DT_ALPHA_PLTRO (DT_LOPROC + 0)
+#define DT_ALPHA_NUM 1
+
+/* PowerPC specific declarations */
+
+/* Values for Elf32/64_Ehdr.e_flags. */
+#define EF_PPC_EMB 0x80000000 /* PowerPC embedded flag */
+
+/* Cygnus local bits below */
+#define EF_PPC_RELOCATABLE 0x00010000 /* PowerPC -mrelocatable flag*/
+#define EF_PPC_RELOCATABLE_LIB 0x00008000 /* PowerPC -mrelocatable-lib
+ flag */
+
+/* PowerPC relocations defined by the ABIs */
+#define R_PPC_NONE 0
+#define R_PPC_ADDR32 1 /* 32bit absolute address */
+#define R_PPC_ADDR24 2 /* 26bit address, 2 bits ignored. */
+#define R_PPC_ADDR16 3 /* 16bit absolute address */
+#define R_PPC_ADDR16_LO 4 /* lower 16bit of absolute address */
+#define R_PPC_ADDR16_HI 5 /* high 16bit of absolute address */
+#define R_PPC_ADDR16_HA 6 /* adjusted high 16bit */
+#define R_PPC_ADDR14 7 /* 16bit address, 2 bits ignored */
+#define R_PPC_ADDR14_BRTAKEN 8
+#define R_PPC_ADDR14_BRNTAKEN 9
+#define R_PPC_REL24 10 /* PC relative 26 bit */
+#define R_PPC_REL14 11 /* PC relative 16 bit */
+#define R_PPC_REL14_BRTAKEN 12
+#define R_PPC_REL14_BRNTAKEN 13
+#define R_PPC_GOT16 14
+#define R_PPC_GOT16_LO 15
+#define R_PPC_GOT16_HI 16
+#define R_PPC_GOT16_HA 17
+#define R_PPC_PLTREL24 18
+#define R_PPC_COPY 19
+#define R_PPC_GLOB_DAT 20
+#define R_PPC_JMP_SLOT 21
+#define R_PPC_RELATIVE 22
+#define R_PPC_LOCAL24PC 23
+#define R_PPC_UADDR32 24
+#define R_PPC_UADDR16 25
+#define R_PPC_REL32 26
+#define R_PPC_PLT32 27
+#define R_PPC_PLTREL32 28
+#define R_PPC_PLT16_LO 29
+#define R_PPC_PLT16_HI 30
+#define R_PPC_PLT16_HA 31
+#define R_PPC_SDAREL16 32
+#define R_PPC_SECTOFF 33
+#define R_PPC_SECTOFF_LO 34
+#define R_PPC_SECTOFF_HI 35
+#define R_PPC_SECTOFF_HA 36
+
+/* PowerPC relocations defined for the TLS access ABI. */
+#define R_PPC_TLS 67 /* none (sym+add)@tls */
+#define R_PPC_DTPMOD32 68 /* word32 (sym+add)@dtpmod */
+#define R_PPC_TPREL16 69 /* half16* (sym+add)@tprel */
+#define R_PPC_TPREL16_LO 70 /* half16 (sym+add)@tprel@l */
+#define R_PPC_TPREL16_HI 71 /* half16 (sym+add)@tprel@h */
+#define R_PPC_TPREL16_HA 72 /* half16 (sym+add)@tprel@ha */
+#define R_PPC_TPREL32 73 /* word32 (sym+add)@tprel */
+#define R_PPC_DTPREL16 74 /* half16* (sym+add)@dtprel */
+#define R_PPC_DTPREL16_LO 75 /* half16 (sym+add)@dtprel@l */
+#define R_PPC_DTPREL16_HI 76 /* half16 (sym+add)@dtprel@h */
+#define R_PPC_DTPREL16_HA 77 /* half16 (sym+add)@dtprel@ha */
+#define R_PPC_DTPREL32 78 /* word32 (sym+add)@dtprel */
+#define R_PPC_GOT_TLSGD16 79 /* half16* (sym+add)@got@tlsgd */
+#define R_PPC_GOT_TLSGD16_LO 80 /* half16 (sym+add)@got@tlsgd@l */
+#define R_PPC_GOT_TLSGD16_HI 81 /* half16 (sym+add)@got@tlsgd@h */
+#define R_PPC_GOT_TLSGD16_HA 82 /* half16 (sym+add)@got@tlsgd@ha */
+#define R_PPC_GOT_TLSLD16 83 /* half16* (sym+add)@got@tlsld */
+#define R_PPC_GOT_TLSLD16_LO 84 /* half16 (sym+add)@got@tlsld@l */
+#define R_PPC_GOT_TLSLD16_HI 85 /* half16 (sym+add)@got@tlsld@h */
+#define R_PPC_GOT_TLSLD16_HA 86 /* half16 (sym+add)@got@tlsld@ha */
+#define R_PPC_GOT_TPREL16 87 /* half16* (sym+add)@got@tprel */
+#define R_PPC_GOT_TPREL16_LO 88 /* half16 (sym+add)@got@tprel@l */
+#define R_PPC_GOT_TPREL16_HI 89 /* half16 (sym+add)@got@tprel@h */
+#define R_PPC_GOT_TPREL16_HA 90 /* half16 (sym+add)@got@tprel@ha */
+#define R_PPC_GOT_DTPREL16 91 /* half16* (sym+add)@got@dtprel */
+#define R_PPC_GOT_DTPREL16_LO 92 /* half16* (sym+add)@got@dtprel@l */
+#define R_PPC_GOT_DTPREL16_HI 93 /* half16* (sym+add)@got@dtprel@h */
+#define R_PPC_GOT_DTPREL16_HA 94 /* half16* (sym+add)@got@dtprel@ha */
+
+/* Keep this the last entry. */
+#define R_PPC_NUM 95
+
+/* The remaining relocs are from the Embedded ELF ABI, and are not
+ in the SVR4 ELF ABI. */
+#define R_PPC_EMB_NADDR32 101
+#define R_PPC_EMB_NADDR16 102
+#define R_PPC_EMB_NADDR16_LO 103
+#define R_PPC_EMB_NADDR16_HI 104
+#define R_PPC_EMB_NADDR16_HA 105
+#define R_PPC_EMB_SDAI16 106
+#define R_PPC_EMB_SDA2I16 107
+#define R_PPC_EMB_SDA2REL 108
+#define R_PPC_EMB_SDA21 109 /* 16 bit offset in SDA */
+#define R_PPC_EMB_MRKREF 110
+#define R_PPC_EMB_RELSEC16 111
+#define R_PPC_EMB_RELST_LO 112
+#define R_PPC_EMB_RELST_HI 113
+#define R_PPC_EMB_RELST_HA 114
+#define R_PPC_EMB_BIT_FLD 115
+#define R_PPC_EMB_RELSDA 116 /* 16 bit relative offset in SDA */
+
+/* Diab tool relocations. */
+#define R_PPC_DIAB_SDA21_LO 180 /* like EMB_SDA21, but lower 16 bit */
+#define R_PPC_DIAB_SDA21_HI 181 /* like EMB_SDA21, but high 16 bit */
+#define R_PPC_DIAB_SDA21_HA 182 /* like EMB_SDA21, adjusted high 16 */
+#define R_PPC_DIAB_RELSDA_LO 183 /* like EMB_RELSDA, but lower 16 bit */
+#define R_PPC_DIAB_RELSDA_HI 184 /* like EMB_RELSDA, but high 16 bit */
+#define R_PPC_DIAB_RELSDA_HA 185 /* like EMB_RELSDA, adjusted high 16 */
+
+/* GNU relocs used in PIC code sequences. */
+#define R_PPC_REL16 249 /* word32 (sym-.) */
+#define R_PPC_REL16_LO 250 /* half16 (sym-.)@l */
+#define R_PPC_REL16_HI 251 /* half16 (sym-.)@h */
+#define R_PPC_REL16_HA 252 /* half16 (sym-.)@ha */
+
+/* This is a phony reloc to handle any old fashioned TOC16 references
+ that may still be in object files. */
+#define R_PPC_TOC16 255
+
+/* PowerPC specific values for the Dyn d_tag field. */
+#define DT_PPC_GOT (DT_LOPROC + 0)
+#define DT_PPC_NUM 1
+
+/* PowerPC64 relocations defined by the ABIs */
+#define R_PPC64_NONE R_PPC_NONE
+#define R_PPC64_ADDR32 R_PPC_ADDR32 /* 32bit absolute address */
+#define R_PPC64_ADDR24 R_PPC_ADDR24 /* 26bit address, word aligned */
+#define R_PPC64_ADDR16 R_PPC_ADDR16 /* 16bit absolute address */
+#define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO /* lower 16bits of address */
+#define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI /* high 16bits of address. */
+#define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA /* adjusted high 16bits. */
+#define R_PPC64_ADDR14 R_PPC_ADDR14 /* 16bit address, word aligned */
+#define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN
+#define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN
+#define R_PPC64_REL24 R_PPC_REL24 /* PC-rel. 26 bit, word aligned */
+#define R_PPC64_REL14 R_PPC_REL14 /* PC relative 16 bit */
+#define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN
+#define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN
+#define R_PPC64_GOT16 R_PPC_GOT16
+#define R_PPC64_GOT16_LO R_PPC_GOT16_LO
+#define R_PPC64_GOT16_HI R_PPC_GOT16_HI
+#define R_PPC64_GOT16_HA R_PPC_GOT16_HA
+
+#define R_PPC64_COPY R_PPC_COPY
+#define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT
+#define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT
+#define R_PPC64_RELATIVE R_PPC_RELATIVE
+
+#define R_PPC64_UADDR32 R_PPC_UADDR32
+#define R_PPC64_UADDR16 R_PPC_UADDR16
+#define R_PPC64_REL32 R_PPC_REL32
+#define R_PPC64_PLT32 R_PPC_PLT32
+#define R_PPC64_PLTREL32 R_PPC_PLTREL32
+#define R_PPC64_PLT16_LO R_PPC_PLT16_LO
+#define R_PPC64_PLT16_HI R_PPC_PLT16_HI
+#define R_PPC64_PLT16_HA R_PPC_PLT16_HA
+
+#define R_PPC64_SECTOFF R_PPC_SECTOFF
+#define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO
+#define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI
+#define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA
+#define R_PPC64_ADDR30 37 /* word30 (S + A - P) >> 2 */
+#define R_PPC64_ADDR64 38 /* doubleword64 S + A */
+#define R_PPC64_ADDR16_HIGHER 39 /* half16 #higher(S + A) */
+#define R_PPC64_ADDR16_HIGHERA 40 /* half16 #highera(S + A) */
+#define R_PPC64_ADDR16_HIGHEST 41 /* half16 #highest(S + A) */
+#define R_PPC64_ADDR16_HIGHESTA 42 /* half16 #highesta(S + A) */
+#define R_PPC64_UADDR64 43 /* doubleword64 S + A */
+#define R_PPC64_REL64 44 /* doubleword64 S + A - P */
+#define R_PPC64_PLT64 45 /* doubleword64 L + A */
+#define R_PPC64_PLTREL64 46 /* doubleword64 L + A - P */
+#define R_PPC64_TOC16 47 /* half16* S + A - .TOC */
+#define R_PPC64_TOC16_LO 48 /* half16 #lo(S + A - .TOC.) */
+#define R_PPC64_TOC16_HI 49 /* half16 #hi(S + A - .TOC.) */
+#define R_PPC64_TOC16_HA 50 /* half16 #ha(S + A - .TOC.) */
+#define R_PPC64_TOC 51 /* doubleword64 .TOC */
+#define R_PPC64_PLTGOT16 52 /* half16* M + A */
+#define R_PPC64_PLTGOT16_LO 53 /* half16 #lo(M + A) */
+#define R_PPC64_PLTGOT16_HI 54 /* half16 #hi(M + A) */
+#define R_PPC64_PLTGOT16_HA 55 /* half16 #ha(M + A) */
+
+#define R_PPC64_ADDR16_DS 56 /* half16ds* (S + A) >> 2 */
+#define R_PPC64_ADDR16_LO_DS 57 /* half16ds #lo(S + A) >> 2 */
+#define R_PPC64_GOT16_DS 58 /* half16ds* (G + A) >> 2 */
+#define R_PPC64_GOT16_LO_DS 59 /* half16ds #lo(G + A) >> 2 */
+#define R_PPC64_PLT16_LO_DS 60 /* half16ds #lo(L + A) >> 2 */
+#define R_PPC64_SECTOFF_DS 61 /* half16ds* (R + A) >> 2 */
+#define R_PPC64_SECTOFF_LO_DS 62 /* half16ds #lo(R + A) >> 2 */
+#define R_PPC64_TOC16_DS 63 /* half16ds* (S + A - .TOC.) >> 2 */
+#define R_PPC64_TOC16_LO_DS 64 /* half16ds #lo(S + A - .TOC.) >> 2 */
+#define R_PPC64_PLTGOT16_DS 65 /* half16ds* (M + A) >> 2 */
+#define R_PPC64_PLTGOT16_LO_DS 66 /* half16ds #lo(M + A) >> 2 */
+
+/* PowerPC64 relocations defined for the TLS access ABI. */
+#define R_PPC64_TLS 67 /* none (sym+add)@tls */
+#define R_PPC64_DTPMOD64 68 /* doubleword64 (sym+add)@dtpmod */
+#define R_PPC64_TPREL16 69 /* half16* (sym+add)@tprel */
+#define R_PPC64_TPREL16_LO 70 /* half16 (sym+add)@tprel@l */
+#define R_PPC64_TPREL16_HI 71 /* half16 (sym+add)@tprel@h */
+#define R_PPC64_TPREL16_HA 72 /* half16 (sym+add)@tprel@ha */
+#define R_PPC64_TPREL64 73 /* doubleword64 (sym+add)@tprel */
+#define R_PPC64_DTPREL16 74 /* half16* (sym+add)@dtprel */
+#define R_PPC64_DTPREL16_LO 75 /* half16 (sym+add)@dtprel@l */
+#define R_PPC64_DTPREL16_HI 76 /* half16 (sym+add)@dtprel@h */
+#define R_PPC64_DTPREL16_HA 77 /* half16 (sym+add)@dtprel@ha */
+#define R_PPC64_DTPREL64 78 /* doubleword64 (sym+add)@dtprel */
+#define R_PPC64_GOT_TLSGD16 79 /* half16* (sym+add)@got@tlsgd */
+#define R_PPC64_GOT_TLSGD16_LO 80 /* half16 (sym+add)@got@tlsgd@l */
+#define R_PPC64_GOT_TLSGD16_HI 81 /* half16 (sym+add)@got@tlsgd@h */
+#define R_PPC64_GOT_TLSGD16_HA 82 /* half16 (sym+add)@got@tlsgd@ha */
+#define R_PPC64_GOT_TLSLD16 83 /* half16* (sym+add)@got@tlsld */
+#define R_PPC64_GOT_TLSLD16_LO 84 /* half16 (sym+add)@got@tlsld@l */
+#define R_PPC64_GOT_TLSLD16_HI 85 /* half16 (sym+add)@got@tlsld@h */
+#define R_PPC64_GOT_TLSLD16_HA 86 /* half16 (sym+add)@got@tlsld@ha */
+#define R_PPC64_GOT_TPREL16_DS 87 /* half16ds* (sym+add)@got@tprel */
+#define R_PPC64_GOT_TPREL16_LO_DS 88 /* half16ds (sym+add)@got@tprel@l */
+#define R_PPC64_GOT_TPREL16_HI 89 /* half16 (sym+add)@got@tprel@h */
+#define R_PPC64_GOT_TPREL16_HA 90 /* half16 (sym+add)@got@tprel@ha */
+#define R_PPC64_GOT_DTPREL16_DS 91 /* half16ds* (sym+add)@got@dtprel */
+#define R_PPC64_GOT_DTPREL16_LO_DS 92 /* half16ds (sym+add)@got@dtprel@l */
+#define R_PPC64_GOT_DTPREL16_HI 93 /* half16 (sym+add)@got@dtprel@h */
+#define R_PPC64_GOT_DTPREL16_HA 94 /* half16 (sym+add)@got@dtprel@ha */
+#define R_PPC64_TPREL16_DS 95 /* half16ds* (sym+add)@tprel */
+#define R_PPC64_TPREL16_LO_DS 96 /* half16ds (sym+add)@tprel@l */
+#define R_PPC64_TPREL16_HIGHER 97 /* half16 (sym+add)@tprel@higher */
+#define R_PPC64_TPREL16_HIGHERA 98 /* half16 (sym+add)@tprel@highera */
+#define R_PPC64_TPREL16_HIGHEST 99 /* half16 (sym+add)@tprel@highest */
+#define R_PPC64_TPREL16_HIGHESTA 100 /* half16 (sym+add)@tprel@highesta */
+#define R_PPC64_DTPREL16_DS 101 /* half16ds* (sym+add)@dtprel */
+#define R_PPC64_DTPREL16_LO_DS 102 /* half16ds (sym+add)@dtprel@l */
+#define R_PPC64_DTPREL16_HIGHER 103 /* half16 (sym+add)@dtprel@higher */
+#define R_PPC64_DTPREL16_HIGHERA 104 /* half16 (sym+add)@dtprel@highera */
+#define R_PPC64_DTPREL16_HIGHEST 105 /* half16 (sym+add)@dtprel@highest */
+#define R_PPC64_DTPREL16_HIGHESTA 106 /* half16 (sym+add)@dtprel@highesta */
+
+/* Keep this the last entry. */
+#define R_PPC64_NUM 107
+
+/* PowerPC64 specific values for the Dyn d_tag field. */
+#define DT_PPC64_GLINK (DT_LOPROC + 0)
+#define DT_PPC64_OPD (DT_LOPROC + 1)
+#define DT_PPC64_OPDSZ (DT_LOPROC + 2)
+#define DT_PPC64_NUM 3
+
+
+/* ARM specific declarations */
+
+/* Processor specific flags for the ELF header e_flags field. */
+#define EF_ARM_RELEXEC 0x01
+#define EF_ARM_HASENTRY 0x02
+#define EF_ARM_INTERWORK 0x04
+#define EF_ARM_APCS_26 0x08
+#define EF_ARM_APCS_FLOAT 0x10
+#define EF_ARM_PIC 0x20
+#define EF_ARM_ALIGN8 0x40 /* 8-bit structure alignment is in use */
+#define EF_ARM_NEW_ABI 0x80
+#define EF_ARM_OLD_ABI 0x100
+
+/* Other constants defined in the ARM ELF spec. version B-01. */
+/* NB. These conflict with values defined above. */
+#define EF_ARM_SYMSARESORTED 0x04
+#define EF_ARM_DYNSYMSUSESEGIDX 0x08
+#define EF_ARM_MAPSYMSFIRST 0x10
+#define EF_ARM_EABIMASK 0XFF000000
+
+#define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK)
+#define EF_ARM_EABI_UNKNOWN 0x00000000
+#define EF_ARM_EABI_VER1 0x01000000
+#define EF_ARM_EABI_VER2 0x02000000
+
+/* Additional symbol types for Thumb */
+#define STT_ARM_TFUNC 0xd
+
+/* ARM-specific values for sh_flags */
+#define SHF_ARM_ENTRYSECT 0x10000000 /* Section contains an entry point */
+#define SHF_ARM_COMDEF 0x80000000 /* Section may be multiply defined
+ in the input to a link step */
+
+/* ARM-specific program header flags */
+#define PF_ARM_SB 0x10000000 /* Segment contains the location
+ addressed by the static base */
+
+/* Processor specific values for the Phdr p_type field. */
+#define PT_ARM_EXIDX 0x70000001 /* .ARM.exidx segment */
+
+/* ARM relocs. */
+
+#define R_ARM_NONE 0 /* No reloc */
+#define R_ARM_PC24 1 /* PC relative 26 bit branch */
+#define R_ARM_ABS32 2 /* Direct 32 bit */
+#define R_ARM_REL32 3 /* PC relative 32 bit */
+#define R_ARM_PC13 4
+#define R_ARM_ABS16 5 /* Direct 16 bit */
+#define R_ARM_ABS12 6 /* Direct 12 bit */
+#define R_ARM_THM_ABS5 7
+#define R_ARM_ABS8 8 /* Direct 8 bit */
+#define R_ARM_SBREL32 9
+#define R_ARM_THM_PC22 10
+#define R_ARM_THM_PC8 11
+#define R_ARM_AMP_VCALL9 12
+#define R_ARM_SWI24 13
+#define R_ARM_THM_SWI8 14
+#define R_ARM_XPC25 15
+#define R_ARM_THM_XPC22 16
+#define R_ARM_COPY 20 /* Copy symbol at runtime */
+#define R_ARM_GLOB_DAT 21 /* Create GOT entry */
+#define R_ARM_JUMP_SLOT 22 /* Create PLT entry */
+#define R_ARM_RELATIVE 23 /* Adjust by program base */
+#define R_ARM_GOTOFF 24 /* 32 bit offset to GOT */
+#define R_ARM_GOTPC 25 /* 32 bit PC relative offset to GOT */
+#define R_ARM_GOT32 26 /* 32 bit GOT entry */
+#define R_ARM_PLT32 27 /* 32 bit PLT address */
+#define R_ARM_ALU_PCREL_7_0 32
+#define R_ARM_ALU_PCREL_15_8 33
+#define R_ARM_ALU_PCREL_23_15 34
+#define R_ARM_LDR_SBREL_11_0 35
+#define R_ARM_ALU_SBREL_19_12 36
+#define R_ARM_ALU_SBREL_27_20 37
+#define R_ARM_GNU_VTENTRY 100
+#define R_ARM_GNU_VTINHERIT 101
+#define R_ARM_THM_PC11 102 /* thumb unconditional branch */
+#define R_ARM_THM_PC9 103 /* thumb conditional branch */
+#define R_ARM_RXPC25 249
+#define R_ARM_RSBREL32 250
+#define R_ARM_THM_RPC22 251
+#define R_ARM_RREL32 252
+#define R_ARM_RABS22 253
+#define R_ARM_RPC24 254
+#define R_ARM_RBASE 255
+/* Keep this the last entry. */
+#define R_ARM_NUM 256
+
+/* IA-64 specific declarations. */
+
+/* Processor specific flags for the Ehdr e_flags field. */
+#define EF_IA_64_MASKOS 0x0000000f /* os-specific flags */
+#define EF_IA_64_ABI64 0x00000010 /* 64-bit ABI */
+#define EF_IA_64_ARCH 0xff000000 /* arch. version mask */
+
+/* Processor specific values for the Phdr p_type field. */
+#define PT_IA_64_ARCHEXT (PT_LOPROC + 0) /* arch extension bits */
+#define PT_IA_64_UNWIND (PT_LOPROC + 1) /* ia64 unwind bits */
+#define PT_IA_64_HP_OPT_ANOT (PT_LOOS + 0x12)
+#define PT_IA_64_HP_HSL_ANOT (PT_LOOS + 0x13)
+#define PT_IA_64_HP_STACK (PT_LOOS + 0x14)
+
+/* Processor specific flags for the Phdr p_flags field. */
+#define PF_IA_64_NORECOV 0x80000000 /* spec insns w/o recovery */
+
+/* Processor specific values for the Shdr sh_type field. */
+#define SHT_IA_64_EXT (SHT_LOPROC + 0) /* extension bits */
+#define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* unwind bits */
+
+/* Processor specific flags for the Shdr sh_flags field. */
+#define SHF_IA_64_SHORT 0x10000000 /* section near gp */
+#define SHF_IA_64_NORECOV 0x20000000 /* spec insns w/o recovery */
+
+/* Processor specific values for the Dyn d_tag field. */
+#define DT_IA_64_PLT_RESERVE (DT_LOPROC + 0)
+#define DT_IA_64_NUM 1
+
+/* IA-64 relocations. */
+#define R_IA64_NONE 0x00 /* none */
+#define R_IA64_IMM14 0x21 /* symbol + addend, add imm14 */
+#define R_IA64_IMM22 0x22 /* symbol + addend, add imm22 */
+#define R_IA64_IMM64 0x23 /* symbol + addend, mov imm64 */
+#define R_IA64_DIR32MSB 0x24 /* symbol + addend, data4 MSB */
+#define R_IA64_DIR32LSB 0x25 /* symbol + addend, data4 LSB */
+#define R_IA64_DIR64MSB 0x26 /* symbol + addend, data8 MSB */
+#define R_IA64_DIR64LSB 0x27 /* symbol + addend, data8 LSB */
+#define R_IA64_GPREL22 0x2a /* @gprel(sym + add), add imm22 */
+#define R_IA64_GPREL64I 0x2b /* @gprel(sym + add), mov imm64 */
+#define R_IA64_GPREL32MSB 0x2c /* @gprel(sym + add), data4 MSB */
+#define R_IA64_GPREL32LSB 0x2d /* @gprel(sym + add), data4 LSB */
+#define R_IA64_GPREL64MSB 0x2e /* @gprel(sym + add), data8 MSB */
+#define R_IA64_GPREL64LSB 0x2f /* @gprel(sym + add), data8 LSB */
+#define R_IA64_LTOFF22 0x32 /* @ltoff(sym + add), add imm22 */
+#define R_IA64_LTOFF64I 0x33 /* @ltoff(sym + add), mov imm64 */
+#define R_IA64_PLTOFF22 0x3a /* @pltoff(sym + add), add imm22 */
+#define R_IA64_PLTOFF64I 0x3b /* @pltoff(sym + add), mov imm64 */
+#define R_IA64_PLTOFF64MSB 0x3e /* @pltoff(sym + add), data8 MSB */
+#define R_IA64_PLTOFF64LSB 0x3f /* @pltoff(sym + add), data8 LSB */
+#define R_IA64_FPTR64I 0x43 /* @fptr(sym + add), mov imm64 */
+#define R_IA64_FPTR32MSB 0x44 /* @fptr(sym + add), data4 MSB */
+#define R_IA64_FPTR32LSB 0x45 /* @fptr(sym + add), data4 LSB */
+#define R_IA64_FPTR64MSB 0x46 /* @fptr(sym + add), data8 MSB */
+#define R_IA64_FPTR64LSB 0x47 /* @fptr(sym + add), data8 LSB */
+#define R_IA64_PCREL60B 0x48 /* @pcrel(sym + add), brl */
+#define R_IA64_PCREL21B 0x49 /* @pcrel(sym + add), ptb, call */
+#define R_IA64_PCREL21M 0x4a /* @pcrel(sym + add), chk.s */
+#define R_IA64_PCREL21F 0x4b /* @pcrel(sym + add), fchkf */
+#define R_IA64_PCREL32MSB 0x4c /* @pcrel(sym + add), data4 MSB */
+#define R_IA64_PCREL32LSB 0x4d /* @pcrel(sym + add), data4 LSB */
+#define R_IA64_PCREL64MSB 0x4e /* @pcrel(sym + add), data8 MSB */
+#define R_IA64_PCREL64LSB 0x4f /* @pcrel(sym + add), data8 LSB */
+#define R_IA64_LTOFF_FPTR22 0x52 /* @ltoff(@fptr(s+a)), imm22 */
+#define R_IA64_LTOFF_FPTR64I 0x53 /* @ltoff(@fptr(s+a)), imm64 */
+#define R_IA64_LTOFF_FPTR32MSB 0x54 /* @ltoff(@fptr(s+a)), data4 MSB */
+#define R_IA64_LTOFF_FPTR32LSB 0x55 /* @ltoff(@fptr(s+a)), data4 LSB */
+#define R_IA64_LTOFF_FPTR64MSB 0x56 /* @ltoff(@fptr(s+a)), data8 MSB */
+#define R_IA64_LTOFF_FPTR64LSB 0x57 /* @ltoff(@fptr(s+a)), data8 LSB */
+#define R_IA64_SEGREL32MSB 0x5c /* @segrel(sym + add), data4 MSB */
+#define R_IA64_SEGREL32LSB 0x5d /* @segrel(sym + add), data4 LSB */
+#define R_IA64_SEGREL64MSB 0x5e /* @segrel(sym + add), data8 MSB */
+#define R_IA64_SEGREL64LSB 0x5f /* @segrel(sym + add), data8 LSB */
+#define R_IA64_SECREL32MSB 0x64 /* @secrel(sym + add), data4 MSB */
+#define R_IA64_SECREL32LSB 0x65 /* @secrel(sym + add), data4 LSB */
+#define R_IA64_SECREL64MSB 0x66 /* @secrel(sym + add), data8 MSB */
+#define R_IA64_SECREL64LSB 0x67 /* @secrel(sym + add), data8 LSB */
+#define R_IA64_REL32MSB 0x6c /* data 4 + REL */
+#define R_IA64_REL32LSB 0x6d /* data 4 + REL */
+#define R_IA64_REL64MSB 0x6e /* data 8 + REL */
+#define R_IA64_REL64LSB 0x6f /* data 8 + REL */
+#define R_IA64_LTV32MSB 0x74 /* symbol + addend, data4 MSB */
+#define R_IA64_LTV32LSB 0x75 /* symbol + addend, data4 LSB */
+#define R_IA64_LTV64MSB 0x76 /* symbol + addend, data8 MSB */
+#define R_IA64_LTV64LSB 0x77 /* symbol + addend, data8 LSB */
+#define R_IA64_PCREL21BI 0x79 /* @pcrel(sym + add), 21bit inst */
+#define R_IA64_PCREL22 0x7a /* @pcrel(sym + add), 22bit inst */
+#define R_IA64_PCREL64I 0x7b /* @pcrel(sym + add), 64bit inst */
+#define R_IA64_IPLTMSB 0x80 /* dynamic reloc, imported PLT, MSB */
+#define R_IA64_IPLTLSB 0x81 /* dynamic reloc, imported PLT, LSB */
+#define R_IA64_COPY 0x84 /* copy relocation */
+#define R_IA64_SUB 0x85 /* Addend and symbol difference */
+#define R_IA64_LTOFF22X 0x86 /* LTOFF22, relaxable. */
+#define R_IA64_LDXMOV 0x87 /* Use of LTOFF22X. */
+#define R_IA64_TPREL14 0x91 /* @tprel(sym + add), imm14 */
+#define R_IA64_TPREL22 0x92 /* @tprel(sym + add), imm22 */
+#define R_IA64_TPREL64I 0x93 /* @tprel(sym + add), imm64 */
+#define R_IA64_TPREL64MSB 0x96 /* @tprel(sym + add), data8 MSB */
+#define R_IA64_TPREL64LSB 0x97 /* @tprel(sym + add), data8 LSB */
+#define R_IA64_LTOFF_TPREL22 0x9a /* @ltoff(@tprel(s+a)), imm2 */
+#define R_IA64_DTPMOD64MSB 0xa6 /* @dtpmod(sym + add), data8 MSB */
+#define R_IA64_DTPMOD64LSB 0xa7 /* @dtpmod(sym + add), data8 LSB */
+#define R_IA64_LTOFF_DTPMOD22 0xaa /* @ltoff(@dtpmod(sym + add)), imm22 */
+#define R_IA64_DTPREL14 0xb1 /* @dtprel(sym + add), imm14 */
+#define R_IA64_DTPREL22 0xb2 /* @dtprel(sym + add), imm22 */
+#define R_IA64_DTPREL64I 0xb3 /* @dtprel(sym + add), imm64 */
+#define R_IA64_DTPREL32MSB 0xb4 /* @dtprel(sym + add), data4 MSB */
+#define R_IA64_DTPREL32LSB 0xb5 /* @dtprel(sym + add), data4 LSB */
+#define R_IA64_DTPREL64MSB 0xb6 /* @dtprel(sym + add), data8 MSB */
+#define R_IA64_DTPREL64LSB 0xb7 /* @dtprel(sym + add), data8 LSB */
+#define R_IA64_LTOFF_DTPREL22 0xba /* @ltoff(@dtprel(s+a)), imm22 */
+
+/* SH specific declarations */
+
+/* SH specific values for `st_other'. */
+
+/* If set, this is a symbol pointing to SHmedia code, which will be branched
+ to, so need to add 1 to the symbol value. */
+#define STO_SH5_ISA32 (1 << 2)
+
+/* SH relocs. */
+#define R_SH_NONE 0
+#define R_SH_DIR32 1
+#define R_SH_REL32 2
+#define R_SH_DIR8WPN 3
+#define R_SH_IND12W 4
+#define R_SH_DIR8WPL 5
+#define R_SH_DIR8WPZ 6
+#define R_SH_DIR8BP 7
+#define R_SH_DIR8W 8
+#define R_SH_DIR8L 9
+#define R_SH_SWITCH16 25
+#define R_SH_SWITCH32 26
+#define R_SH_USES 27
+#define R_SH_COUNT 28
+#define R_SH_ALIGN 29
+#define R_SH_CODE 30
+#define R_SH_DATA 31
+#define R_SH_LABEL 32
+#define R_SH_SWITCH8 33
+#define R_SH_GNU_VTINHERIT 34
+#define R_SH_GNU_VTENTRY 35
+#define R_SH_TLS_GD_32 144
+#define R_SH_TLS_LD_32 145
+#define R_SH_TLS_LDO_32 146
+#define R_SH_TLS_IE_32 147
+#define R_SH_TLS_LE_32 148
+#define R_SH_TLS_DTPMOD32 149
+#define R_SH_TLS_DTPOFF32 150
+#define R_SH_TLS_TPOFF32 151
+#define R_SH_GOT32 160
+#define R_SH_PLT32 161
+#define R_SH_COPY 162
+#define R_SH_GLOB_DAT 163
+#define R_SH_JMP_SLOT 164
+#define R_SH_RELATIVE 165
+#define R_SH_GOTOFF 166
+#define R_SH_GOTPC 167
+#define R_SH_RELATIVE_LOW16 197
+#define R_SH_RELATIVE_MEDLOW16 198
+#define R_SH_IMM_LOW16 246
+#define R_SH_IMM_LOW16_PCREL 247
+#define R_SH_IMM_MEDLOW16 248
+#define R_SH_IMM_MEDLOW16_PCREL 249
+
+/* Keep this the last entry. */
+#define R_SH_NUM 256
+
+/* Additional s390 relocs */
+
+#define R_390_NONE 0 /* No reloc. */
+#define R_390_8 1 /* Direct 8 bit. */
+#define R_390_12 2 /* Direct 12 bit. */
+#define R_390_16 3 /* Direct 16 bit. */
+#define R_390_32 4 /* Direct 32 bit. */
+#define R_390_PC32 5 /* PC relative 32 bit. */
+#define R_390_GOT12 6 /* 12 bit GOT offset. */
+#define R_390_GOT32 7 /* 32 bit GOT offset. */
+#define R_390_PLT32 8 /* 32 bit PC relative PLT address. */
+#define R_390_COPY 9 /* Copy symbol at runtime. */
+#define R_390_GLOB_DAT 10 /* Create GOT entry. */
+#define R_390_JMP_SLOT 11 /* Create PLT entry. */
+#define R_390_RELATIVE 12 /* Adjust by program base. */
+#define R_390_GOTOFF32 13 /* 32 bit offset to GOT. */
+#define R_390_GOTPC 14 /* 32 bit PC relative offset to GOT. */
+#define R_390_GOT16 15 /* 16 bit GOT offset. */
+#define R_390_PC16 16 /* PC relative 16 bit. */
+#define R_390_PC16DBL 17 /* PC relative 16 bit shifted by 1. */
+#define R_390_PLT16DBL 18 /* 16 bit PC rel. PLT shifted by 1. */
+#define R_390_PC32DBL 19 /* PC relative 32 bit shifted by 1. */
+#define R_390_PLT32DBL 20 /* 32 bit PC rel. PLT shifted by 1. */
+#define R_390_GOTPCDBL 21 /* 32 bit PC rel. GOT shifted by 1. */
+#define R_390_64 22 /* Direct 64 bit. */
+#define R_390_PC64 23 /* PC relative 64 bit. */
+#define R_390_GOT64 24 /* 64 bit GOT offset. */
+#define R_390_PLT64 25 /* 64 bit PC relative PLT address. */
+#define R_390_GOTENT 26 /* 32 bit PC rel. to GOT entry >> 1. */
+#define R_390_GOTOFF16 27 /* 16 bit offset to GOT. */
+#define R_390_GOTOFF64 28 /* 64 bit offset to GOT. */
+#define R_390_GOTPLT12 29 /* 12 bit offset to jump slot. */
+#define R_390_GOTPLT16 30 /* 16 bit offset to jump slot. */
+#define R_390_GOTPLT32 31 /* 32 bit offset to jump slot. */
+#define R_390_GOTPLT64 32 /* 64 bit offset to jump slot. */
+#define R_390_GOTPLTENT 33 /* 32 bit rel. offset to jump slot. */
+#define R_390_PLTOFF16 34 /* 16 bit offset from GOT to PLT. */
+#define R_390_PLTOFF32 35 /* 32 bit offset from GOT to PLT. */
+#define R_390_PLTOFF64 36 /* 16 bit offset from GOT to PLT. */
+#define R_390_TLS_LOAD 37 /* Tag for load insn in TLS code. */
+#define R_390_TLS_GDCALL 38 /* Tag for function call in general
+ dynamic TLS code. */
+#define R_390_TLS_LDCALL 39 /* Tag for function call in local
+ dynamic TLS code. */
+#define R_390_TLS_GD32 40 /* Direct 32 bit for general dynamic
+ thread local data. */
+#define R_390_TLS_GD64 41 /* Direct 64 bit for general dynamic
+ thread local data. */
+#define R_390_TLS_GOTIE12 42 /* 12 bit GOT offset for static TLS
+ block offset. */
+#define R_390_TLS_GOTIE32 43 /* 32 bit GOT offset for static TLS
+ block offset. */
+#define R_390_TLS_GOTIE64 44 /* 64 bit GOT offset for static TLS
+ block offset. */
+#define R_390_TLS_LDM32 45 /* Direct 32 bit for local dynamic
+ thread local data in LE code. */
+#define R_390_TLS_LDM64 46 /* Direct 64 bit for local dynamic
+ thread local data in LE code. */
+#define R_390_TLS_IE32 47 /* 32 bit address of GOT entry for
+ negated static TLS block offset. */
+#define R_390_TLS_IE64 48 /* 64 bit address of GOT entry for
+ negated static TLS block offset. */
+#define R_390_TLS_IEENT 49 /* 32 bit rel. offset to GOT entry for
+ negated static TLS block offset. */
+#define R_390_TLS_LE32 50 /* 32 bit negated offset relative to
+ static TLS block. */
+#define R_390_TLS_LE64 51 /* 64 bit negated offset relative to
+ static TLS block. */
+#define R_390_TLS_LDO32 52 /* 32 bit offset relative to TLS
+ block. */
+#define R_390_TLS_LDO64 53 /* 64 bit offset relative to TLS
+ block. */
+#define R_390_TLS_DTPMOD 54 /* ID of module containing symbol. */
+#define R_390_TLS_DTPOFF 55 /* Offset in TLS block. */
+#define R_390_TLS_TPOFF 56 /* Negated offset in static TLS
+ block. */
+#define R_390_20 57 /* Direct 20 bit. */
+#define R_390_GOT20 58 /* 20 bit GOT offset. */
+#define R_390_GOTPLT20 59 /* 20 bit offset to jump slot. */
+#define R_390_TLS_GOTIE20 60 /* 20 bit GOT offset for static TLS
+ block offset. */
+/* Keep this the last entry. */
+#define R_390_NUM 61
+
+
+/* CRIS flags. */
+#define EF_CRIS_VARIANT_MASK 0x0000000e
+#define EF_CRIS_VARIANT_ANY_V0_V10 0x00000000
+#define EF_CRIS_VARIANT_V32 0x00000002
+#define EF_CRIS_VARIANT_COMMON_V10_V32 0x00000004
+
+/* CRIS relocations. */
+#define R_CRIS_NONE 0
+#define R_CRIS_8 1
+#define R_CRIS_16 2
+#define R_CRIS_32 3
+#define R_CRIS_8_PCREL 4
+#define R_CRIS_16_PCREL 5
+#define R_CRIS_32_PCREL 6
+#define R_CRIS_GNU_VTINHERIT 7
+#define R_CRIS_GNU_VTENTRY 8
+#define R_CRIS_COPY 9
+#define R_CRIS_GLOB_DAT 10
+#define R_CRIS_JUMP_SLOT 11
+#define R_CRIS_RELATIVE 12
+#define R_CRIS_16_GOT 13
+#define R_CRIS_32_GOT 14
+#define R_CRIS_16_GOTPLT 15
+#define R_CRIS_32_GOTPLT 16
+#define R_CRIS_32_GOTREL 17
+#define R_CRIS_32_PLT_GOTREL 18
+#define R_CRIS_32_PLT_PCREL 19
+
+/* Keep this the last entry. */
+#define R_CRIS_NUM 20
+
+
+/* AMD x86-64 relocations. */
+#define R_X86_64_NONE 0 /* No reloc */
+#define R_X86_64_64 1 /* Direct 64 bit */
+#define R_X86_64_PC32 2 /* PC relative 32 bit signed */
+#define R_X86_64_GOT32 3 /* 32 bit GOT entry */
+#define R_X86_64_PLT32 4 /* 32 bit PLT address */
+#define R_X86_64_COPY 5 /* Copy symbol at runtime */
+#define R_X86_64_GLOB_DAT 6 /* Create GOT entry */
+#define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */
+#define R_X86_64_RELATIVE 8 /* Adjust by program base */
+#define R_X86_64_GOTPCREL 9 /* 32 bit signed PC relative
+ offset to GOT */
+#define R_X86_64_32 10 /* Direct 32 bit zero extended */
+#define R_X86_64_32S 11 /* Direct 32 bit sign extended */
+#define R_X86_64_16 12 /* Direct 16 bit zero extended */
+#define R_X86_64_PC16 13 /* 16 bit sign extended pc relative */
+#define R_X86_64_8 14 /* Direct 8 bit sign extended */
+#define R_X86_64_PC8 15 /* 8 bit sign extended pc relative */
+#define R_X86_64_DTPMOD64 16 /* ID of module containing symbol */
+#define R_X86_64_DTPOFF64 17 /* Offset in module's TLS block */
+#define R_X86_64_TPOFF64 18 /* Offset in initial TLS block */
+#define R_X86_64_TLSGD 19 /* 32 bit signed PC relative offset
+ to two GOT entries for GD symbol */
+#define R_X86_64_TLSLD 20 /* 32 bit signed PC relative offset
+ to two GOT entries for LD symbol */
+#define R_X86_64_DTPOFF32 21 /* Offset in TLS block */
+#define R_X86_64_GOTTPOFF 22 /* 32 bit signed PC relative offset
+ to GOT entry for IE symbol */
+#define R_X86_64_TPOFF32 23 /* Offset in initial TLS block */
+
+#define R_X86_64_NUM 24
+
+
+/* AM33 relocations. */
+#define R_MN10300_NONE 0 /* No reloc. */
+#define R_MN10300_32 1 /* Direct 32 bit. */
+#define R_MN10300_16 2 /* Direct 16 bit. */
+#define R_MN10300_8 3 /* Direct 8 bit. */
+#define R_MN10300_PCREL32 4 /* PC-relative 32-bit. */
+#define R_MN10300_PCREL16 5 /* PC-relative 16-bit signed. */
+#define R_MN10300_PCREL8 6 /* PC-relative 8-bit signed. */
+#define R_MN10300_GNU_VTINHERIT 7 /* Ancient C++ vtable garbage... */
+#define R_MN10300_GNU_VTENTRY 8 /* ... collection annotation. */
+#define R_MN10300_24 9 /* Direct 24 bit. */
+#define R_MN10300_GOTPC32 10 /* 32-bit PCrel offset to GOT. */
+#define R_MN10300_GOTPC16 11 /* 16-bit PCrel offset to GOT. */
+#define R_MN10300_GOTOFF32 12 /* 32-bit offset from GOT. */
+#define R_MN10300_GOTOFF24 13 /* 24-bit offset from GOT. */
+#define R_MN10300_GOTOFF16 14 /* 16-bit offset from GOT. */
+#define R_MN10300_PLT32 15 /* 32-bit PCrel to PLT entry. */
+#define R_MN10300_PLT16 16 /* 16-bit PCrel to PLT entry. */
+#define R_MN10300_GOT32 17 /* 32-bit offset to GOT entry. */
+#define R_MN10300_GOT24 18 /* 24-bit offset to GOT entry. */
+#define R_MN10300_GOT16 19 /* 16-bit offset to GOT entry. */
+#define R_MN10300_COPY 20 /* Copy symbol at runtime. */
+#define R_MN10300_GLOB_DAT 21 /* Create GOT entry. */
+#define R_MN10300_JMP_SLOT 22 /* Create PLT entry. */
+#define R_MN10300_RELATIVE 23 /* Adjust by program base. */
+
+#define R_MN10300_NUM 24
+
+
+/* M32R relocs. */
+#define R_M32R_NONE 0 /* No reloc. */
+#define R_M32R_16 1 /* Direct 16 bit. */
+#define R_M32R_32 2 /* Direct 32 bit. */
+#define R_M32R_24 3 /* Direct 24 bit. */
+#define R_M32R_10_PCREL 4 /* PC relative 10 bit shifted. */
+#define R_M32R_18_PCREL 5 /* PC relative 18 bit shifted. */
+#define R_M32R_26_PCREL 6 /* PC relative 26 bit shifted. */
+#define R_M32R_HI16_ULO 7 /* High 16 bit with unsigned low. */
+#define R_M32R_HI16_SLO 8 /* High 16 bit with signed low. */
+#define R_M32R_LO16 9 /* Low 16 bit. */
+#define R_M32R_SDA16 10 /* 16 bit offset in SDA. */
+#define R_M32R_GNU_VTINHERIT 11
+#define R_M32R_GNU_VTENTRY 12
+/* M32R relocs use SHT_RELA. */
+#define R_M32R_16_RELA 33 /* Direct 16 bit. */
+#define R_M32R_32_RELA 34 /* Direct 32 bit. */
+#define R_M32R_24_RELA 35 /* Direct 24 bit. */
+#define R_M32R_10_PCREL_RELA 36 /* PC relative 10 bit shifted. */
+#define R_M32R_18_PCREL_RELA 37 /* PC relative 18 bit shifted. */
+#define R_M32R_26_PCREL_RELA 38 /* PC relative 26 bit shifted. */
+#define R_M32R_HI16_ULO_RELA 39 /* High 16 bit with unsigned low */
+#define R_M32R_HI16_SLO_RELA 40 /* High 16 bit with signed low */
+#define R_M32R_LO16_RELA 41 /* Low 16 bit */
+#define R_M32R_SDA16_RELA 42 /* 16 bit offset in SDA */
+#define R_M32R_RELA_GNU_VTINHERIT 43
+#define R_M32R_RELA_GNU_VTENTRY 44
+
+#define R_M32R_GOT24 48 /* 24 bit GOT entry */
+#define R_M32R_26_PLTREL 49 /* 26 bit PC relative to PLT shifted */
+#define R_M32R_COPY 50 /* Copy symbol at runtime */
+#define R_M32R_GLOB_DAT 51 /* Create GOT entry */
+#define R_M32R_JMP_SLOT 52 /* Create PLT entry */
+#define R_M32R_RELATIVE 53 /* Adjust by program base */
+#define R_M32R_GOTOFF 54 /* 24 bit offset to GOT */
+#define R_M32R_GOTPC24 55 /* 24 bit PC relative offset to GOT */
+#define R_M32R_GOT16_HI_ULO 56 /* High 16 bit GOT entry with unsigned
+ low */
+#define R_M32R_GOT16_HI_SLO 57 /* High 16 bit GOT entry with signed
+ low */
+#define R_M32R_GOT16_LO 58 /* Low 16 bit GOT entry */
+#define R_M32R_GOTPC_HI_ULO 59 /* High 16 bit PC relative offset to
+ GOT with unsigned low */
+#define R_M32R_GOTPC_HI_SLO 60 /* High 16 bit PC relative offset to
+ GOT with signed low */
+#define R_M32R_GOTPC_LO 61 /* Low 16 bit PC relative offset to
+ GOT */
+#define R_M32R_GOTOFF_HI_ULO 62 /* High 16 bit offset to GOT
+ with unsigned low */
+#define R_M32R_GOTOFF_HI_SLO 63 /* High 16 bit offset to GOT
+ with signed low */
+#define R_M32R_GOTOFF_LO 64 /* Low 16 bit offset to GOT */
+#define R_M32R_NUM 256 /* Keep this the last entry. */
+
+/* i960 Relocations */
+#define R_960_NONE 0
+#define R_960_12 1
+#define R_960_32 2
+#define R_960_IP24 3
+#define R_960_SUB 4
+#define R_960_OPTCALL 5
+#define R_960_OPTCALLX 6
+#define R_960_OPTCALLXA 7
+/* Keep this the last entry. */
+#define R_960_NUM 8
+
+
+/* v850 relocations. */
+#define R_V850_NONE 0
+#define R_V850_9_PCREL 1
+#define R_V850_22_PCREL 2
+#define R_V850_HI16_S 3
+#define R_V850_HI16 4
+#define R_V850_LO16 5
+#define R_V850_32 6
+#define R_V850_16 7
+#define R_V850_8 8
+#define R_V850_SDA_16_16_OFFSET 9 /* For ld.b, st.b, set1, clr1,
+ not1, tst1, movea, movhi */
+#define R_V850_SDA_15_16_OFFSET 10 /* For ld.w, ld.h, ld.hu, st.w, st.h */
+#define R_V850_ZDA_16_16_OFFSET 11 /* For ld.b, st.b, set1, clr1,
+ not1, tst1, movea, movhi */
+#define R_V850_ZDA_15_16_OFFSET 12 /* For ld.w, ld.h, ld.hu, st.w, st.h */
+#define R_V850_TDA_6_8_OFFSET 13 /* For sst.w, sld.w */
+#define R_V850_TDA_7_8_OFFSET 14 /* For sst.h, sld.h */
+#define R_V850_TDA_7_7_OFFSET 15 /* For sst.b, sld.b */
+#define R_V850_TDA_16_16_OFFSET 16 /* For set1, clr1, not1, tst1,
+ movea, movhi */
+/* CYGNUS LOCAL v850e */
+#define R_V850_TDA_4_5_OFFSET 17 /* For sld.hu */
+#define R_V850_TDA_4_4_OFFSET 18 /* For sld.bu */
+#define R_V850_SDA_16_16_SPLIT_OFFSET 19 /* For ld.bu */
+#define R_V850_ZDA_16_16_SPLIT_OFFSET 20 /* For ld.bu */
+#define R_V850_CALLT_6_7_OFFSET 21 /* For callt */
+#define R_V850_CALLT_16_16_OFFSET 22 /* For callt */
+/* END CYGNUS LOCAL */
+#define R_V850_GNU_VTINHERIT 23
+#define R_V850_GNU_VTENTRY 24
+/* Keep this the last entry. */
+#define R_V850_NUM 25
+
+
+/* Renesas H8/300 Relocations */
+#define R_H8_NONE 0
+#define R_H8_DIR32 1
+#define R_H8_DIR32_28 2
+#define R_H8_DIR32_24 3
+#define R_H8_DIR32_16 4
+#define R_H8_DIR32U 6
+#define R_H8_DIR32U_28 7
+#define R_H8_DIR32U_24 8
+#define R_H8_DIR32U_20 9
+#define R_H8_DIR32U_16 10
+#define R_H8_DIR24 11
+#define R_H8_DIR24_20 12
+#define R_H8_DIR24_16 13
+#define R_H8_DIR24U 14
+#define R_H8_DIR24U_20 15
+#define R_H8_DIR24U_16 16
+#define R_H8_DIR16 17
+#define R_H8_DIR16U 18
+#define R_H8_DIR16S_32 19
+#define R_H8_DIR16S_28 20
+#define R_H8_DIR16S_24 21
+#define R_H8_DIR16S_20 22
+#define R_H8_DIR16S 23
+#define R_H8_DIR8 24
+#define R_H8_DIR8U 25
+#define R_H8_DIR8Z_32 26
+#define R_H8_DIR8Z_28 27
+#define R_H8_DIR8Z_24 28
+#define R_H8_DIR8Z_20 29
+#define R_H8_DIR8Z_16 30
+#define R_H8_PCREL16 31
+#define R_H8_PCREL8 32
+#define R_H8_BPOS 33
+#define R_H8_PCREL32 34
+#define R_H8_GOT32O 35
+#define R_H8_GOT16O 36
+#define R_H8_DIR16A8 59
+#define R_H8_DIR16R8 60
+#define R_H8_DIR24A8 61
+#define R_H8_DIR24R8 62
+#define R_H8_DIR32A16 63
+#define R_H8_ABS32 65
+#define R_H8_ABS32A16 127
+#define R_H8_NUM 128
+
+/* NIOS relocations. */
+#define R_NIOS_NONE 0
+#define R_NIOS_32 1 /* A 32 bit absolute relocation.*/
+#define R_NIOS_LO16_LO5 2 /* A LO-16 5 bit absolute relocation. */
+#define R_NIOS_LO16_HI11 3 /* A LO-16 top 11 bit absolute relocation. */
+#define R_NIOS_HI16_LO5 4 /* A HI-16 5 bit absolute relocation. */
+#define R_NIOS_HI16_HI11 5 /* A HI-16 top 11 bit absolute relocation. */
+#define R_NIOS_PCREL6 6 /* A 6 bit relative relocation. */
+#define R_NIOS_PCREL8 7 /* An 8 bit relative relocation. */
+#define R_NIOS_PCREL11 8 /* An 11 bit relative relocation. */
+#define R_NIOS_16 9 /* A 16 bit absolute relocation. */
+#define R_NIOS_H_LO5 10 /* Low 5-bits of absolute relocation in halfwords. */
+#define R_NIOS_H_HI11 11 /* Top 11 bits of 16-bit absolute relocation in halfwords. */
+#define R_NIOS_H_XLO5 12 /* Low 5 bits of top 16-bits of 32-bit absolute relocation in halfwords. */
+#define R_NIOS_H_XHI11 13 /* Top 11 bits of top 16-bits of 32-bit absolute relocation in halfwords. */
+#define R_NIOS_H_16 14 /* Half-word @h value */
+#define R_NIOS_H_32 15 /* Word @h value */
+#define R_NIOS_GNU_VTINHERIT 200 /* GNU extension to record C++ vtable hierarchy */
+#define R_NIOS_GNU_VTENTRY 201 /* GNU extension to record C++ vtable member usage */
+/* Keep this the last entry. */
+#define R_NIOS_NUM 202
+
+/* NIOS II relocations */
+#define R_NIOS2_NONE 0
+#define R_NIOS2_S16 1
+#define R_NIOS2_U16 2
+#define R_NIOS2_PCREL16 3
+#define R_NIOS2_CALL26 4
+#define R_NIOS2_IMM5 5
+#define R_NIOS2_CACHE_OPX 6
+#define R_NIOS2_IMM6 7
+#define R_NIOS2_IMM8 8
+#define R_NIOS2_HI16 9
+#define R_NIOS2_LO16 10
+#define R_NIOS2_HIADJ16 11
+#define R_NIOS2_BFD_RELOC_32 12
+#define R_NIOS2_BFD_RELOC_16 13
+#define R_NIOS2_BFD_RELOC_8 14
+#define R_NIOS2_GPREL 15
+#define R_NIOS2_GNU_VTINHERIT 16
+#define R_NIOS2_GNU_VTENTRY 17
+#define R_NIOS2_UJMP 18
+#define R_NIOS2_CJMP 19
+#define R_NIOS2_CALLR 20
+#define R_NIOS2_ALIGN 21
+/* Keep this the last entry. */
+#define R_NIOS2_NUM 22
+
+__END_DECLS
+
+#endif /* elf.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/endian.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/endian.h
new file mode 100644
index 0000000..2f7bce1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/endian.h
@@ -0,0 +1,58 @@
+/* Copyright (C) 1992, 1996, 1997, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ENDIAN_H
+#define _ENDIAN_H 1
+
+#include <features.h>
+
+/* Definitions for byte order, according to significance of bytes,
+ from low addresses to high addresses. The value is what you get by
+ putting '4' in the most significant byte, '3' in the second most
+ significant byte, '2' in the second least significant byte, and '1'
+ in the least significant byte, and then writing down one digit for
+ each byte, starting with the byte at the lowest address at the left,
+ and proceeding to the byte with the highest address at the right. */
+
+#define __LITTLE_ENDIAN 1234
+#define __BIG_ENDIAN 4321
+#define __PDP_ENDIAN 3412
+
+/* This file defines `__BYTE_ORDER' for the particular machine. */
+#include <bits/endian.h>
+
+/* Some machines may need to use a different endianness for floating point
+ values. */
+#ifndef __FLOAT_WORD_ORDER
+# define __FLOAT_WORD_ORDER __BYTE_ORDER
+#endif
+
+#ifdef __USE_BSD
+# define LITTLE_ENDIAN __LITTLE_ENDIAN
+# define BIG_ENDIAN __BIG_ENDIAN
+# define PDP_ENDIAN __PDP_ENDIAN
+# define BYTE_ORDER __BYTE_ORDER
+#endif
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+# define __LONG_LONG_PAIR(HI, LO) LO, HI
+#elif __BYTE_ORDER == __BIG_ENDIAN
+# define __LONG_LONG_PAIR(HI, LO) HI, LO
+#endif
+
+#endif /* endian.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/err.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/err.h
new file mode 100644
index 0000000..7ff3553
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/err.h
@@ -0,0 +1,58 @@
+/* 4.4BSD utility functions for error messages.
+ Copyright (C) 1995,1996,1997,1998,1999,2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ERR_H
+#define _ERR_H 1
+
+#include <features.h>
+
+#define __need___va_list
+#include <stdarg.h>
+#ifndef __GNUC_VA_LIST
+# define __gnuc_va_list __ptr_t
+#endif
+
+__BEGIN_DECLS
+
+/* Print "program: ", FORMAT, ": ", the standard error string for errno,
+ and a newline, on stderr. */
+extern void warn (__const char *__format, ...)
+ __attribute__ ((__format__ (__printf__, 1, 2)));
+extern void vwarn (__const char *__format, __gnuc_va_list)
+ __attribute__ ((__format__ (__printf__, 1, 0)));
+
+/* Likewise, but without ": " and the standard error string. */
+extern void warnx (__const char *__format, ...)
+ __attribute__ ((__format__ (__printf__, 1, 2)));
+extern void vwarnx (__const char *__format, __gnuc_va_list)
+ __attribute__ ((__format__ (__printf__, 1, 0)));
+
+/* Likewise, and then exit with STATUS. */
+extern void err (int __status, __const char *__format, ...)
+ __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
+extern void verr (int __status, __const char *__format, __gnuc_va_list)
+ __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
+extern void errx (int __status, __const char *__format, ...)
+ __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
+extern void verrx (int __status, __const char *, __gnuc_va_list)
+ __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
+
+__END_DECLS
+
+#endif /* err.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/errno.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/errno.h
new file mode 100644
index 0000000..aef117e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/errno.h
@@ -0,0 +1,77 @@
+/* Copyright (C) 1991,92,93,94,95,96,97,2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.5 Errors <errno.h>
+ */
+
+#ifndef _ERRNO_H
+
+/* The includer defined __need_Emath if he wants only the definitions
+ of EDOM and ERANGE, and not everything else. */
+#ifndef __need_Emath
+# define _ERRNO_H 1
+# include <features.h>
+#endif
+
+__BEGIN_DECLS
+
+/* Get the error number constants from the system-specific file.
+ This file will test __need_Emath and _ERRNO_H. */
+#include <bits/errno.h>
+#undef __need_Emath
+
+#ifdef _ERRNO_H
+
+/* Declare the `errno' variable, unless it's defined as a macro by
+ bits/errno.h. This is the case in GNU, where it is a per-thread
+ variable. This redeclaration using the macro still works, but it
+ will be a function declaration without a prototype and may trigger
+ a -Wstrict-prototypes warning. */
+#ifndef errno
+extern int errno;
+#endif
+
+#if defined __USE_GNU && defined __UCLIBC_HAS_PROGRAM_INVOCATION_NAME__
+
+/* The full and simple forms of the name with which the program was
+ invoked. These variables are set up automatically at startup based on
+ the value of ARGV[0] (this works only if you use GNU ld). */
+extern char *program_invocation_name, *program_invocation_short_name;
+#endif /* __USE_GNU */
+#endif /* _ERRNO_H */
+
+__END_DECLS
+
+#if defined _LIBC && ( defined IS_IN_libc || defined NOT_IN_libc )
+#include <bits/uClibc_errno.h>
+#endif
+
+#endif /* _ERRNO_H */
+
+/* The Hurd <bits/errno.h> defines `error_t' as an enumerated type so
+ that printing `error_t' values in the debugger shows the names. We
+ might need this definition sometimes even if this file was included
+ before. */
+#if defined __USE_GNU || defined __need_error_t
+# ifndef __error_t_defined
+typedef int error_t;
+# define __error_t_defined 1
+# endif
+# undef __need_error_t
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/error.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/error.h
new file mode 100644
index 0000000..b553cae
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/error.h
@@ -0,0 +1,52 @@
+/* Declaration for error-reporting function
+ Copyright (C) 1995, 1996, 1997, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ERROR_H
+#define _ERROR_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Print a message with `fprintf (stderr, FORMAT, ...)';
+ if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
+ If STATUS is nonzero, terminate the program with `exit (STATUS)'. */
+
+extern void error (int __status, int __errnum, const char *__format, ...)
+ __attribute__ ((__format__ (__printf__, 3, 4)));
+
+extern void error_at_line (int __status, int __errnum, const char *__fname,
+ unsigned int __lineno, const char *__format, ...)
+ __attribute__ ((__format__ (__printf__, 5, 6)));
+
+/* If NULL, error will flush stdout, then print on stderr the program
+ name, a colon and a space. Otherwise, error will call this
+ function without parameters instead. */
+extern void (*error_print_progname) (void);
+
+/* This variable is incremented each time `error' is called. */
+extern unsigned int error_message_count;
+
+/* Sometimes we want to have at most one error per line. This
+ variable controls whether this mode is selected or not. */
+extern int error_one_per_line;
+
+__END_DECLS
+
+#endif /* error.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/fcntl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/fcntl.h
new file mode 100644
index 0000000..a438902
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/fcntl.h
@@ -0,0 +1,228 @@
+/* Copyright (C) 1991,1992,1994-2001,2003,2004,2005
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 6.5 File Control Operations <fcntl.h>
+ */
+
+#ifndef _FCNTL_H
+#define _FCNTL_H 1
+
+#include <features.h>
+
+/* This must be early so <bits/fcntl.h> can define types winningly. */
+__BEGIN_DECLS
+
+/* Get the definitions of O_*, F_*, FD_*: all the
+ numbers and flag bits for `open', `fcntl', et al. */
+#include <bits/fcntl.h>
+
+/* For XPG all symbols from <sys/stat.h> should also be available. */
+#ifdef __USE_XOPEN
+# include <sys/stat.h>
+#endif
+
+#ifdef __USE_MISC
+# ifndef R_OK /* Verbatim from <unistd.h>. Ugh. */
+/* Values for the second argument to access.
+ These may be OR'd together. */
+# define R_OK 4 /* Test for read permission. */
+# define W_OK 2 /* Test for write permission. */
+# define X_OK 1 /* Test for execute permission. */
+# define F_OK 0 /* Test for existence. */
+# endif
+#endif /* Use misc. */
+
+/* XPG wants the following symbols. */
+#ifdef __USE_XOPEN /* <stdio.h> has the same definitions. */
+# define SEEK_SET 0 /* Seek from beginning of file. */
+# define SEEK_CUR 1 /* Seek from current position. */
+# define SEEK_END 2 /* Seek from end of file. */
+#endif /* XPG */
+
+#if 0 /*def __USE_GNU*/
+# define AT_FDCWD -100 /* Special value used to indicate
+ openat should use the current
+ working directory. */
+# define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */
+# define AT_REMOVEDIR 0x200 /* Remove directory instead of
+ unlinking file. */
+#endif
+
+/* Do the file control operation described by CMD on FD.
+ The remaining arguments are interpreted depending on CMD.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+#ifndef __USE_FILE_OFFSET64
+extern int fcntl (int __fd, int __cmd, ...);
+#else
+# ifdef __REDIRECT
+extern int __REDIRECT (fcntl, (int __fd, int __cmd, ...), fcntl64);
+# else
+# define fcntl fcntl64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int fcntl64 (int __fd, int __cmd, ...);
+#endif
+
+/* Open FILE and return a new file descriptor for it, or -1 on error.
+ OFLAG determines the type of access used. If O_CREAT is on OFLAG,
+ the third argument is taken as a `mode_t', the mode of the created file.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+#ifndef __USE_FILE_OFFSET64
+extern int open (__const char *__file, int __oflag, ...) __nonnull ((1));
+#else
+# ifdef __REDIRECT
+extern int __REDIRECT (open, (__const char *__file, int __oflag, ...), open64)
+ __nonnull ((1));
+# else
+# define open open64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int open64 (__const char *__file, int __oflag, ...) __nonnull ((1));
+#endif
+
+#if 0 /*def __USE_GNU*/
+/* Similar to OPEN but a relative path name is interpreted relative to
+ the directory for which FD is a descriptor.
+
+ NOTE: some other OPENAT implementation support additional functionality
+ through this interface, especially using the O_XATTR flag. This is not
+ yet supported here.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+# ifndef __USE_FILE_OFFSET64
+extern int openat (int __fd, __const char *__file, int __oflag, ...)
+ __nonnull ((2));
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (openat, (int __fd, __const char *__file, int __oflag,
+ ...), openat64) __nonnull ((2));
+# else
+# define openat openat64
+# endif
+# endif
+
+extern int openat64 (int __fd, __const char *__file, int __oflag, ...)
+ __nonnull ((2));
+#endif
+
+/* Create and open FILE, with mode MODE. This takes an `int' MODE
+ argument because that is what `mode_t' will be widened to.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+#ifndef __USE_FILE_OFFSET64
+extern int creat (__const char *__file, __mode_t __mode) __nonnull ((1));
+#else
+# ifdef __REDIRECT
+extern int __REDIRECT (creat, (__const char *__file, __mode_t __mode),
+ creat64) __nonnull ((1));
+# else
+# define creat creat64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int creat64 (__const char *__file, __mode_t __mode) __nonnull ((1));
+#endif
+
+#if !defined F_LOCK && (defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \
+ && !defined __USE_POSIX))
+/* NOTE: These declarations also appear in <unistd.h>; be sure to keep both
+ files consistent. Some systems have them there and some here, and some
+ software depends on the macros being defined without including both. */
+
+/* `lockf' is a simpler interface to the locking facilities of `fcntl'.
+ LEN is always relative to the current file position.
+ The CMD argument is one of the following. */
+
+# define F_ULOCK 0 /* Unlock a previously locked region. */
+# define F_LOCK 1 /* Lock a region for exclusive use. */
+# define F_TLOCK 2 /* Test and lock a region for exclusive use. */
+# define F_TEST 3 /* Test a region for other processes locks. */
+
+# ifndef __USE_FILE_OFFSET64
+extern int lockf (int __fd, int __cmd, __off_t __len);
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len), lockf64);
+# else
+# define lockf lockf64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int lockf64 (int __fd, int __cmd, __off64_t __len);
+# endif
+#endif
+
+#ifdef __USE_XOPEN2K
+/* Advice the system about the expected behaviour of the application with
+ respect to the file associated with FD. */
+# ifndef __USE_FILE_OFFSET64
+extern int posix_fadvise (int __fd, __off_t __offset, __off_t __len,
+ int __advise) __THROW;
+# else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (posix_fadvise, (int __fd, __off64_t __offset,
+ __off64_t __len, int __advise),
+ posix_fadvise64);
+# else
+# define posix_fadvise posix_fadvise64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len,
+ int __advise) __THROW;
+# endif
+
+#endif
+
+#if 0
+
+/* FIXME -- uClibc should probably implement these... */
+
+/* Reserve storage for the data of the file associated with FD.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+# ifndef __USE_FILE_OFFSET64
+extern int posix_fallocate (int __fd, __off_t __offset, __off_t __len);
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (posix_fallocate, (int __fd, __off64_t __offset,
+ __off64_t __len),
+ posix_fallocate64);
+# else
+# define posix_fallocate posix_fallocate64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int posix_fallocate64 (int __fd, __off64_t __offset, __off64_t __len);
+# endif
+#endif
+
+__END_DECLS
+
+#endif /* fcntl.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/features.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/features.h
new file mode 100644
index 0000000..aab3b7c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/features.h
@@ -0,0 +1,424 @@
+/* Copyright (C) 1991-1993,1995-2003,2004,2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _FEATURES_H
+#define _FEATURES_H 1
+
+/* This macro indicates that the installed library is uClibc. Use
+ * __UCLIBC_MAJOR__ and __UCLIBC_MINOR__ to test for the features in
+ * specific releases. */
+#define __UCLIBC__ 1
+
+/* Load up the current set of uClibc supported features along
+ * with the current uClibc major and minor version numbers.
+ * For uClibc release 0.9.26, these numbers would be:
+ * #define __UCLIBC_MAJOR__ 0
+ * #define __UCLIBC_MINOR__ 9
+ * #define __UCLIBC_SUBLEVEL__ 26
+ */
+#define __need_uClibc_config_h
+#include <bits/uClibc_config.h>
+#undef __need_uClibc_config_h
+#include <bits/uClibc_arch_features.h>
+
+/* For uClibc, always optimize for size -- this should disable
+ * a lot of expensive inlining... */
+#define __OPTIMIZE_SIZE__ 1
+
+/* These are defined by the user (or the compiler)
+ to specify the desired environment:
+
+ __STRICT_ANSI__ ISO Standard C.
+ _ISOC99_SOURCE Extensions to ISO C89 from ISO C99.
+ _POSIX_SOURCE IEEE Std 1003.1.
+ _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
+ if >=199309L, add IEEE Std 1003.1b-1993;
+ if >=199506L, add IEEE Std 1003.1c-1995;
+ if >=200112L, all of IEEE 1003.1-2004
+ _XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if
+ Single Unix conformance is wanted, to 600 for the
+ upcoming sixth revision.
+ _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions.
+ _LARGEFILE_SOURCE Some more functions for correct standard I/O.
+ _LARGEFILE64_SOURCE Additional functionality from LFS for large files.
+ _FILE_OFFSET_BITS=N Select default filesystem interface.
+ _BSD_SOURCE ISO C, POSIX, and 4.3BSD things.
+ _SVID_SOURCE ISO C, POSIX, and SVID things.
+ _ATFILE_SOURCE Additional *at interfaces.
+ _GNU_SOURCE All of the above, plus GNU extensions.
+ _REENTRANT Select additionally reentrant object.
+ _THREAD_SAFE Same as _REENTRANT, often used by other systems.
+ _FORTIFY_SOURCE If set to numeric value > 0 additional security
+ measures are defined, according to level.
+
+ The `-ansi' switch to the GNU C compiler defines __STRICT_ANSI__.
+ If none of these are defined, the default is to have _SVID_SOURCE,
+ _BSD_SOURCE, and _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to
+ 199506L. If more than one of these are defined, they accumulate.
+ For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE
+ together give you ISO C, 1003.1, and 1003.2, but nothing else.
+
+ These are defined by this file and are used by the
+ header files to decide what to declare or define:
+
+ __USE_ISOC99 Define ISO C99 things.
+ __USE_POSIX Define IEEE Std 1003.1 things.
+ __USE_POSIX2 Define IEEE Std 1003.2 things.
+ __USE_POSIX199309 Define IEEE Std 1003.1, and .1b things.
+ __USE_POSIX199506 Define IEEE Std 1003.1, .1b, .1c and .1i things.
+ __USE_XOPEN Define XPG things.
+ __USE_XOPEN_EXTENDED Define X/Open Unix things.
+ __USE_UNIX98 Define Single Unix V2 things.
+ __USE_XOPEN2K Define XPG6 things.
+ __USE_LARGEFILE Define correct standard I/O things.
+ __USE_LARGEFILE64 Define LFS things with separate names.
+ __USE_FILE_OFFSET64 Define 64bit interface as default.
+ __USE_BSD Define 4.3BSD things.
+ __USE_SVID Define SVID things.
+ __USE_MISC Define things common to BSD and System V Unix.
+ __USE_ATFILE Define *at interfaces and AT_* constants for them.
+ __USE_GNU Define GNU extensions.
+ __USE_REENTRANT Define reentrant/thread-safe *_r functions.
+ __USE_FORTIFY_LEVEL Additional security measures used, according to level.
+ __FAVOR_BSD Favor 4.3BSD things in cases of conflict.
+
+ The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are
+ defined by this file unconditionally. `__GNU_LIBRARY__' is provided
+ only for compatibility. All new code should use the other symbols
+ to test for features.
+
+ All macros listed above as possibly being defined by this file are
+ explicitly undefined if they are not explicitly defined.
+ Feature-test macros that are not defined by the user or compiler
+ but are implied by the other feature-test macros defined (or by the
+ lack of any definitions) are defined by the file. */
+
+
+/* Undefine everything, so we get a clean slate. */
+#undef __USE_ISOC99
+#undef __USE_POSIX
+#undef __USE_POSIX2
+#undef __USE_POSIX199309
+#undef __USE_POSIX199506
+#undef __USE_XOPEN
+#undef __USE_XOPEN_EXTENDED
+#undef __USE_UNIX98
+#undef __USE_XOPEN2K
+#undef __USE_LARGEFILE
+#undef __USE_LARGEFILE64
+#undef __USE_FILE_OFFSET64
+#undef __USE_BSD
+#undef __USE_SVID
+#undef __USE_MISC
+#undef __USE_ATFILE
+#undef __USE_GNU
+#undef __USE_REENTRANT
+#undef __USE_FORTIFY_LEVEL
+#undef __FAVOR_BSD
+#undef __KERNEL_STRICT_NAMES
+
+/* Suppress kernel-name space pollution unless user expressedly asks
+ for it. */
+#ifndef _LOOSE_KERNEL_NAMES
+# define __KERNEL_STRICT_NAMES
+#endif
+
+/* Always use ISO C things. */
+#define __USE_ANSI 1
+
+/* Convenience macros to test the versions of glibc and gcc.
+ Use them like this:
+ #if __GNUC_PREREQ(2,8)
+ ... code requiring gcc 2.8 or later ...
+ #endif
+ Note - they won't work for gcc1 or glibc1, since the _MINOR macros
+ were not defined then. */
+#if defined __GNUC__ && defined __GNUC_MINOR__
+# define __GNUC_PREREQ(maj, min) \
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+#else
+# define __GNUC_PREREQ(maj, min) 0
+#endif
+
+
+/* If _BSD_SOURCE was defined by the user, favor BSD over POSIX. */
+#if defined _BSD_SOURCE && \
+ !(defined _POSIX_SOURCE || defined _POSIX_C_SOURCE || \
+ defined _XOPEN_SOURCE || defined _XOPEN_SOURCE_EXTENDED || \
+ defined _GNU_SOURCE || defined _SVID_SOURCE)
+# define __FAVOR_BSD 1
+#endif
+
+/* If _GNU_SOURCE was defined by the user, turn on all the other features. */
+#ifdef _GNU_SOURCE
+# undef _ISOC99_SOURCE
+# define _ISOC99_SOURCE 1
+# undef _POSIX_SOURCE
+# define _POSIX_SOURCE 1
+# undef _POSIX_C_SOURCE
+# define _POSIX_C_SOURCE 199506L
+# undef _XOPEN_SOURCE
+# define _XOPEN_SOURCE 600
+# undef _XOPEN_SOURCE_EXTENDED
+# define _XOPEN_SOURCE_EXTENDED 1
+# ifdef __UCLIBC_HAS_LFS__
+# undef _LARGEFILE64_SOURCE
+# define _LARGEFILE64_SOURCE 1
+# endif /* __UCLIBC_HAS_LFS__ */
+# undef _BSD_SOURCE
+# define _BSD_SOURCE 1
+# undef _SVID_SOURCE
+# define _SVID_SOURCE 1
+# undef _ATFILE_SOURCE
+# define _ATFILE_SOURCE 1
+#endif
+
+/* If nothing (other than _GNU_SOURCE) is defined,
+ define _BSD_SOURCE and _SVID_SOURCE. */
+#if (!defined __STRICT_ANSI__ && !defined _ISOC99_SOURCE && \
+ !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE && \
+ !defined _XOPEN_SOURCE && !defined _XOPEN_SOURCE_EXTENDED && \
+ !defined _BSD_SOURCE && !defined _SVID_SOURCE)
+# define _BSD_SOURCE 1
+# define _SVID_SOURCE 1
+#endif
+
+/* This is to enable the ISO C99 extension. Also recognize the old macro
+ which was used prior to the standard acceptance. This macro will
+ eventually go away and the features enabled by default once the ISO C99
+ standard is widely adopted. */
+#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
+# define __USE_ISOC99 1
+#endif
+
+/* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2
+ (and IEEE Std 1003.1b-1993 unless _XOPEN_SOURCE is defined). */
+#if ((!defined __STRICT_ANSI__ || (_XOPEN_SOURCE - 0) >= 500) && \
+ !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE)
+# define _POSIX_SOURCE 1
+# if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 500
+# define _POSIX_C_SOURCE 2
+# else
+# define _POSIX_C_SOURCE 199506L
+# endif
+#endif
+
+#if defined _POSIX_SOURCE || _POSIX_C_SOURCE >= 1 || defined _XOPEN_SOURCE
+# define __USE_POSIX 1
+#endif
+
+#if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 || defined _XOPEN_SOURCE
+# define __USE_POSIX2 1
+#endif
+
+#if (_POSIX_C_SOURCE - 0) >= 199309L
+# define __USE_POSIX199309 1
+#endif
+
+#if (_POSIX_C_SOURCE - 0) >= 199506L
+# define __USE_POSIX199506 1
+#endif
+
+#if (_POSIX_C_SOURCE - 0) >= 200112L
+# define __USE_XOPEN2K 1
+#endif
+
+#ifdef _XOPEN_SOURCE
+# define __USE_XOPEN 1
+# if (_XOPEN_SOURCE - 0) >= 500
+# define __USE_XOPEN_EXTENDED 1
+# define __USE_UNIX98 1
+# undef _LARGEFILE_SOURCE
+# define _LARGEFILE_SOURCE 1
+# if (_XOPEN_SOURCE - 0) >= 600
+# define __USE_XOPEN2K 1
+# undef __USE_ISOC99
+# define __USE_ISOC99 1
+# endif
+# else
+# ifdef _XOPEN_SOURCE_EXTENDED
+# define __USE_XOPEN_EXTENDED 1
+# endif
+# endif
+#endif
+
+#ifdef _LARGEFILE_SOURCE
+# define __USE_LARGEFILE 1
+#endif
+
+#ifdef _LARGEFILE64_SOURCE
+# define __USE_LARGEFILE64 1
+#endif
+
+#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
+# define __USE_FILE_OFFSET64 1
+#endif
+
+#if defined _BSD_SOURCE || defined _SVID_SOURCE
+# define __USE_MISC 1
+#endif
+
+#ifdef _BSD_SOURCE
+# define __USE_BSD 1
+#endif
+
+#ifdef _SVID_SOURCE
+# define __USE_SVID 1
+#endif
+
+#ifdef _ATFILE_SOURCE
+# define __USE_ATFILE 1
+#endif
+
+#ifdef _GNU_SOURCE
+# define __USE_GNU 1
+#endif
+
+#if defined _REENTRANT || defined _THREAD_SAFE
+# define __USE_REENTRANT 1
+#endif
+
+/* uClibc does not support _FORTIFY_SOURCE */
+#undef _FORTIFY_SOURCE
+#if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \
+ && __GNUC_PREREQ(4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
+# if _FORTIFY_SOURCE > 1
+# define __USE_FORTIFY_LEVEL 2
+# else
+# define __USE_FORTIFY_LEVEL 1
+# endif
+#else
+# define __USE_FORTIFY_LEVEL 0
+#endif
+
+/* We do support the IEC 559 math functionality, real and complex. */
+#define __STDC_IEC_559__ 1
+#define __STDC_IEC_559_COMPLEX__ 1
+
+#ifdef __UCLIBC_HAS_WCHAR__
+/* wchar_t uses ISO 10646-1 (2nd ed., published 2000-09-15) / Unicode 3.1. */
+# define __STDC_ISO_10646__ 200009L
+#endif
+
+/* There is an unwholesomely huge amount of code out there that depends on the
+ * presence of GNU libc header files. We have GNU libc header files. So here
+ * we commit a horrible sin. At this point, we _lie_ and claim to be GNU libc
+ * to make things like /usr/include/linux/socket.h and lots of apps work as
+ * their developers intended. This is IMHO, pardonable, since these defines
+ * are not really intended to check for the presence of a particular library,
+ * but rather are used to define an _interface_. */
+#if !defined __FORCE_NOGLIBC && (!defined _LIBC || defined __FORCE_GLIBC)
+/* This macro indicates that the installed library is the GNU C Library.
+ For historic reasons the value now is 6 and this will stay from now
+ on. The use of this variable is deprecated. */
+# undef __GNU_LIBRARY__
+# define __GNU_LIBRARY__ 6
+
+/* Major and minor version number of the GNU C library package. Use
+ these macros to test for features in specific releases. */
+/* Don't do it, if you want to keep uClibc happy. */
+# define __GLIBC__ 2
+# define __GLIBC_MINOR__ 2
+#endif
+
+#define __GLIBC_PREREQ(maj, min) \
+ ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))
+
+#ifndef __UCLIBC__
+/* Decide whether a compiler supports the long long datatypes. */
+#if defined __GNUC__ \
+ || (defined __PGI && defined __i386__ ) \
+ || (defined __INTEL_COMPILER && (defined __i386__ || defined __ia64__)) \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
+# define __GLIBC_HAVE_LONG_LONG 1
+#endif
+#endif
+
+/* This is here only because every header file already includes this one. */
+#ifndef __ASSEMBLER__
+# ifndef _SYS_CDEFS_H
+# include <sys/cdefs.h>
+# endif
+
+/* If we don't have __REDIRECT, prototypes will be missing if
+ __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. */
+# if defined __USE_FILE_OFFSET64 && !defined __REDIRECT
+# define __USE_LARGEFILE 1
+# define __USE_LARGEFILE64 1
+# endif
+
+#endif /* !ASSEMBLER */
+
+/* Decide whether we can define 'extern inline' functions in headers. */
+#if __GNUC_PREREQ(2, 7) && defined __OPTIMIZE__ \
+ && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__
+# define __USE_EXTERN_INLINES 1
+#endif
+
+
+/* Make sure users large file options agree with uClibc's configuration. */
+#ifndef __UCLIBC_HAS_LFS__
+
+/* If uClibc was built without large file support, output an error if
+ * 64-bit file offsets were requested.
+ * NOTE: This is probably incorrect on a 64-bit arch... */
+# ifdef __USE_FILE_OFFSET64
+# error It appears you have defined _FILE_OFFSET_BITS=64. Unfortunately, \
+uClibc was built without large file support enabled.
+# endif
+
+/* If uClibc was built without large file support and _LARGEFILE64_SOURCE
+ * is defined, undefine it. */
+# ifdef _LARGEFILE64_SOURCE
+# undef _LARGEFILE64_SOURCE
+# undef __USE_LARGEFILE64
+# endif
+
+/* If we're actually building uClibc with large file support,
+ * define __USE_LARGEFILE64 and __USE_LARGEFILE. */
+#elif defined _LIBC
+# undef _LARGEFILE_SOURCE
+# undef _LARGEFILE64_SOURCE
+# undef _FILE_OFFSET_BITS
+# undef __USE_LARGEFILE
+# undef __USE_LARGEFILE64
+# undef __USE_FILE_OFFSET64
+# define _LARGEFILE_SOURCE 1
+# define _LARGEFILE64_SOURCE 1
+# define __USE_LARGEFILE 1
+# define __USE_LARGEFILE64 1
+#endif
+
+/* uClibc does not support *at interfaces. */
+#undef _ATFILE_SOURCE
+#undef __USE_ATFILE
+
+#ifdef _LIBC
+# include <libc-internal.h>
+#endif
+
+#ifndef __linux__
+# define __linux__ 1
+#endif
+
+/* Disable __user, which shows up in 2.6.x include asm headers
+ * that get pulled in by signal.h */
+#define __user
+
+#endif /* features.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/fnmatch.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/fnmatch.h
new file mode 100644
index 0000000..aefb007
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/fnmatch.h
@@ -0,0 +1,72 @@
+/* Copyright (C) 1991-93,96,97,98,99,2001,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _FNMATCH_H
+#define _FNMATCH_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef const
+# if (defined __STDC__ && __STDC__) || defined __cplusplus
+# define __const const
+# else
+# define __const
+# endif
+#endif
+
+/* We #undef these before defining them because some losing systems
+ (HP-UX A.08.07 for example) define these in <unistd.h>. */
+#undef FNM_PATHNAME
+#undef FNM_NOESCAPE
+#undef FNM_PERIOD
+
+/* Bits set in the FLAGS argument to `fnmatch'. */
+#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
+#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
+#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
+
+#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
+# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
+# define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
+# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
+# define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching. */
+#endif
+
+/* Value returned by `fnmatch' if STRING does not match PATTERN. */
+#define FNM_NOMATCH 1
+
+/* This value is returned if the implementation does not support
+ `fnmatch'. Since this is not the case here it will never be
+ returned but the conformance test suites still require the symbol
+ to be defined. */
+#ifdef _XOPEN_SOURCE
+# define FNM_NOSYS (-1)
+#endif
+
+/* Match NAME against the filename pattern PATTERN,
+ returning zero if it matches, FNM_NOMATCH if not. */
+extern int fnmatch (__const char *__pattern, __const char *__name,
+ int __flags);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* fnmatch.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/fpu_control.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/fpu_control.h
new file mode 100644
index 0000000..c58b235
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/fpu_control.h
@@ -0,0 +1,100 @@
+/* FPU control word bits. Mips version.
+ Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Olaf Flebbe and Ralf Baechle.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _FPU_CONTROL_H
+#define _FPU_CONTROL_H
+
+/* MIPS FPU floating point control register bits.
+ *
+ * 31-25 -> floating point conditions code bits 7-1. These bits are only
+ * available in MIPS IV.
+ * 24 -> flush denormalized results to zero instead of
+ * causing unimplemented operation exception. This bit is only
+ * available for MIPS III and newer.
+ * 23 -> Condition bit
+ * 22-18 -> reserved (read as 0, write with 0)
+ * 17 -> cause bit for unimplemented operation
+ * 16 -> cause bit for invalid exception
+ * 15 -> cause bit for division by zero exception
+ * 14 -> cause bit for overflow exception
+ * 13 -> cause bit for underflow exception
+ * 12 -> cause bit for inexact exception
+ * 11 -> enable exception for invalid exception
+ * 10 -> enable exception for division by zero exception
+ * 9 -> enable exception for overflow exception
+ * 8 -> enable exception for underflow exception
+ * 7 -> enable exception for inexact exception
+ * 6 -> flag invalid exception
+ * 5 -> flag division by zero exception
+ * 4 -> flag overflow exception
+ * 3 -> flag underflow exception
+ * 2 -> flag inexact exception
+ * 1-0 -> rounding control
+ *
+ *
+ * Rounding Control:
+ * 00 - rounding to nearest (RN)
+ * 01 - rounding toward zero (RZ)
+ * 10 - rounding (up) toward plus infinity (RP)
+ * 11 - rounding (down)toward minus infinity (RM)
+ */
+
+#include <features.h>
+
+/* masking of interrupts */
+#define _FPU_MASK_V 0x0800 /* Invalid operation */
+#define _FPU_MASK_Z 0x0400 /* Division by zero */
+#define _FPU_MASK_O 0x0200 /* Overflow */
+#define _FPU_MASK_U 0x0100 /* Underflow */
+#define _FPU_MASK_I 0x0080 /* Inexact operation */
+
+/* flush denormalized numbers to zero */
+#define _FPU_FLUSH_TZ 0x1000000
+
+/* rounding control */
+#define _FPU_RC_NEAREST 0x0 /* RECOMMENDED */
+#define _FPU_RC_ZERO 0x1
+#define _FPU_RC_UP 0x2
+#define _FPU_RC_DOWN 0x3
+
+#define _FPU_RESERVED 0xfe3c0000 /* Reserved bits in cw */
+
+
+/* The fdlibm code requires strict IEEE double precision arithmetic,
+ and no interrupts for exceptions, rounding to nearest. */
+
+#define _FPU_DEFAULT 0x00000000
+
+/* IEEE: same as above, but exceptions */
+#define _FPU_IEEE 0x00000F80
+
+/* Type of the control word. */
+typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__)));
+
+/* Macros for accessing the hardware control word. */
+#define _FPU_GETCW(cw) __asm__ ("cfc1 %0,$31" : "=r" (cw))
+#define _FPU_SETCW(cw) __asm__ ("ctc1 %0,$31" : : "r" (cw))
+
+#if 0
+/* Default control word set at startup. */
+extern fpu_control_t __fpu_control;
+#endif
+
+#endif /* fpu_control.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/getopt.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/getopt.h
new file mode 100644
index 0000000..a682f9c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/getopt.h
@@ -0,0 +1,4 @@
+/* This file will not be installed if not using gnu getopt. */
+
+#include <bits/getopt.h>
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/glob.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/glob.h
new file mode 100644
index 0000000..68ea2cb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/glob.h
@@ -0,0 +1,208 @@
+/* Copyright (C) 1991,92,95-98,2000,2001,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _GLOB_H
+#define _GLOB_H 1
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+/* We need `size_t' for the following definitions. */
+#ifndef __size_t
+# if defined __GNUC__ && __GNUC__ >= 2
+typedef __SIZE_TYPE__ __size_t;
+# ifdef __USE_XOPEN
+typedef __SIZE_TYPE__ size_t;
+# endif
+# else
+# include <stddef.h>
+# ifndef __size_t
+# define __size_t size_t
+# endif
+# endif
+#else
+/* The GNU CC stddef.h version defines __size_t as empty. We need a real
+ definition. */
+# undef __size_t
+# define __size_t size_t
+#endif
+
+/* Bits set in the FLAGS argument to `glob'. */
+#define GLOB_ERR (1 << 0)/* Return on read errors. */
+#define GLOB_MARK (1 << 1)/* Append a slash to each name. */
+#define GLOB_NOSORT (1 << 2)/* Don't sort the names. */
+#define GLOB_DOOFFS (1 << 3)/* Insert PGLOB->gl_offs NULLs. */
+#define GLOB_NOCHECK (1 << 4)/* If nothing matches, return the pattern. */
+#define GLOB_APPEND (1 << 5)/* Append to results of a previous call. */
+#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
+#define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */
+
+#if ( !defined __USE_POSIX2 || defined __USE_BSD || defined __USE_GNU ) && defined __UCLIBC_HAS_GNU_GLOB__
+# define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
+#if 1 /* uClibc gnu glob does not support these */
+# define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
+# define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */
+# define GLOB_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */
+# define GLOB_TILDE (1 << 12)/* Expand ~user and ~ to home directories. */
+# define GLOB_ONLYDIR (1 << 13)/* Match only directories. */
+# define GLOB_TILDE_CHECK (1 << 14)/* Like GLOB_TILDE but return an error
+ if the user name is not available. */
+# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
+ GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
+ GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
+ GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
+#else
+# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
+ GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
+ GLOB_PERIOD)
+#endif
+#else
+# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
+ GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
+ GLOB_PERIOD)
+#endif
+
+/* Error returns from `glob'. */
+#define GLOB_NOSPACE 1 /* Ran out of memory. */
+#define GLOB_ABORTED 2 /* Read error. */
+#define GLOB_NOMATCH 3 /* No matches found. */
+#define GLOB_NOSYS 4 /* Not implemented. */
+#if defined __USE_GNU && defined __UCLIBC_HAS_GNU_GLOB__
+/* Previous versions of this file defined GLOB_ABEND instead of
+ GLOB_ABORTED. Provide a compatibility definition here. */
+# define GLOB_ABEND GLOB_ABORTED
+#endif
+
+/* Structure describing a globbing run. */
+#if defined __USE_GNU && defined __UCLIBC_HAS_GNU_GLOB__
+struct stat;
+#endif
+typedef struct
+ {
+ __size_t gl_pathc; /* Count of paths matched by the pattern. */
+ char **gl_pathv; /* List of matched pathnames. */
+ __size_t gl_offs; /* Slots to reserve in `gl_pathv'. */
+#ifdef __UCLIBC_HAS_GNU_GLOB__
+ int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
+
+#if 1 /* uClibc gnu glob does not support these */
+ /* If the GLOB_ALTDIRFUNC flag is set, the following functions
+ are used instead of the normal file access functions. */
+ void (*gl_closedir) (void *);
+#ifdef __USE_GNU
+ struct dirent *(*gl_readdir) (void *);
+#else
+ void *(*gl_readdir) (void *);
+#endif
+ void *(*gl_opendir) (__const char *);
+#ifdef __USE_GNU
+ int (*gl_lstat) (__const char *__restrict, struct stat *__restrict);
+ int (*gl_stat) (__const char *__restrict, struct stat *__restrict);
+#else
+ int (*gl_lstat) (__const char *__restrict, void *__restrict);
+ int (*gl_stat) (__const char *__restrict, void *__restrict);
+#endif
+#endif
+#endif /* __UCLIBC_HAS_GNU_GLOB__ */
+ } glob_t;
+
+#ifdef __USE_LARGEFILE64
+# if defined __USE_GNU && defined __UCLIBC_HAS_GNU_GLOB__
+struct stat64;
+# endif
+typedef struct
+ {
+ __size_t gl_pathc;
+ char **gl_pathv;
+ __size_t gl_offs;
+#ifdef __UCLIBC_HAS_GNU_GLOB__
+ int gl_flags;
+
+#if 1 /* uClibc gnu glob does not support these */
+ /* If the GLOB_ALTDIRFUNC flag is set, the following functions
+ are used instead of the normal file access functions. */
+ void (*gl_closedir) (void *);
+# ifdef __USE_GNU
+ struct dirent64 *(*gl_readdir) (void *);
+# else
+ void *(*gl_readdir) (void *);
+# endif
+ void *(*gl_opendir) (__const char *);
+# ifdef __USE_GNU
+ int (*gl_lstat) (__const char *__restrict, struct stat64 *__restrict);
+ int (*gl_stat) (__const char *__restrict, struct stat64 *__restrict);
+# else
+ int (*gl_lstat) (__const char *__restrict, void *__restrict);
+ int (*gl_stat) (__const char *__restrict, void *__restrict);
+# endif
+#endif
+#endif /* __UCLIBC_HAS_GNU_GLOB__ */
+ } glob64_t;
+#endif
+
+#if defined(__USE_FILE_OFFSET64) && __GNUC__ < 2
+# define glob glob64
+# define globfree globfree64
+#endif
+
+/* Do glob searching for PATTERN, placing results in PGLOB.
+ The bits defined above may be set in FLAGS.
+ If a directory cannot be opened or read and ERRFUNC is not nil,
+ it is called with the pathname that caused the error, and the
+ `errno' value from the failing call; if it returns non-zero
+ `glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
+ If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
+ Otherwise, `glob' returns zero. */
+#if !defined __USE_FILE_OFFSET64 || __GNUC__ < 2
+extern int glob (__const char *__restrict __pattern, int __flags,
+ int (*__errfunc) (__const char *, int),
+ glob_t *__restrict __pglob) __THROW;
+
+/* Free storage allocated in PGLOB by a previous `glob' call. */
+extern void globfree (glob_t *__pglob) __THROW;
+#else
+extern int __REDIRECT_NTH (glob, (__const char *__restrict __pattern,
+ int __flags,
+ int (*__errfunc) (__const char *, int),
+ glob_t *__restrict __pglob), glob64);
+
+extern void __REDIRECT_NTH (globfree, (glob_t *__pglob), globfree64);
+#endif
+
+#ifdef __USE_LARGEFILE64
+extern int glob64 (__const char *__restrict __pattern, int __flags,
+ int (*__errfunc) (__const char *, int),
+ glob64_t *__restrict __pglob) __THROW;
+
+extern void globfree64 (glob64_t *__pglob) __THROW;
+#endif
+
+
+#if defined __USE_GNU && defined __UCLIBC_HAS_GNU_GLOB__
+/* Return nonzero if PATTERN contains any metacharacters.
+ Metacharacters can be quoted with backslashes if QUOTE is nonzero.
+
+ This function is not part of the interface specified by POSIX.2
+ but several programs want to use it. */
+extern int glob_pattern_p (__const char *__pattern, int __quote) __THROW;
+#endif
+
+__END_DECLS
+
+#endif /* glob.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/gnu-versions.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/gnu-versions.h
new file mode 100644
index 0000000..59e617c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/gnu-versions.h
@@ -0,0 +1,53 @@
+/* Header with interface version macros for library pieces copied elsewhere.
+ Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _GNU_VERSIONS_H
+#define _GNU_VERSIONS_H 1
+
+/* This file exists to define these few macros. Each specifies a version
+ number associated with the library interface of a piece of the C library
+ which is also distributed with other GNU packages. These pieces are
+ both part of the GNU C library and also distributed with other GNU
+ packages so those packages may use their facilities on systems lacking
+ the GNU C library. The source files for each piece surround all their
+ code with `#ifndef ELIDE_CODE' after defining it with this:
+
+ #define OBSTACK_INTERFACE_VERSION 1
+ #if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
+ #include <gnu-versions.h>
+ #if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
+ #define ELIDE_CODE
+ #endif
+ #endif
+
+ This allows those one to avoid compiling those files when part of a GNU
+ package not libc, on a system using a GNU C library that supports the
+ same interface.
+
+ Please preserve the format of the comments after each macro. And
+ remember, if any of these versions change, the libc.so major version
+ number must change too (so avoid it)! */
+
+#define _GNU_OBSTACK_INTERFACE_VERSION 1 /* vs malloc/obstack.c */
+#define _GNU_REGEX_INTERFACE_VERSION 1 /* vs posix/regex.c */
+#define _GNU_GLOB_INTERFACE_VERSION 1 /* vs posix/glob.c */
+#define _GNU_GETOPT_INTERFACE_VERSION 2 /* vs posix/getopt.c and
+ posix/getopt1.c */
+
+#endif /* gnu-versions.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/grp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/grp.h
new file mode 100644
index 0000000..6ad8be1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/grp.h
@@ -0,0 +1,207 @@
+/* Copyright (C) 1991,1992,1995-2001,2003,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 9.2.1 Group Database Access <grp.h>
+ */
+
+#ifndef _GRP_H
+#define _GRP_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <bits/types.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+
+/* For the Single Unix specification we must define this type here. */
+#if (defined __USE_XOPEN || defined __USE_XOPEN2K) && !defined __gid_t_defined
+typedef __gid_t gid_t;
+# define __gid_t_defined
+#endif
+
+/* The group structure. */
+struct group
+ {
+ char *gr_name; /* Group name. */
+ char *gr_passwd; /* Password. */
+ __gid_t gr_gid; /* Group ID. */
+ char **gr_mem; /* Member list. */
+ };
+
+
+#if defined __USE_SVID || defined __USE_GNU
+# define __need_FILE
+# include <stdio.h>
+#endif
+
+
+#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Rewind the group-file stream.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void setgrent (void);
+
+/* Close the group-file stream.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void endgrent (void);
+
+/* Read an entry from the group-file stream, opening it if necessary.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct group *getgrent (void);
+#endif
+
+#ifdef __USE_SVID
+/* Read a group entry from STREAM.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern struct group *fgetgrent (FILE *__stream);
+#endif
+
+#ifdef __USE_GNU
+/* Write the given entry onto the given stream.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int putgrent (__const struct group *__restrict __p,
+ FILE *__restrict __f);
+#endif
+
+/* Search for an entry with a matching group ID.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct group *getgrgid (__gid_t __gid);
+
+/* Search for an entry with a matching group name.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct group *getgrnam (__const char *__name);
+
+#if defined __USE_POSIX || defined __USE_MISC
+
+# ifdef __USE_MISC
+/* Reasonable value for the buffer sized used in the reentrant
+ functions below. But better use `sysconf'. */
+# define NSS_BUFLEN_GROUP 1024
+# endif
+
+/* Reentrant versions of some of the functions above.
+
+ PLEASE NOTE: the `getgrent_r' function is not (yet) standardized.
+ The interface may change in later versions of this library. But
+ the interface is designed following the principals used for the
+ other reentrant functions so the chances are good this is what the
+ POSIX people would choose.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+
+# ifdef __USE_GNU
+extern int getgrent_r (struct group *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen,
+ struct group **__restrict __result);
+# endif
+
+/* Search for an entry with a matching group ID.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int getgrgid_r (__gid_t __gid, struct group *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen,
+ struct group **__restrict __result);
+
+/* Search for an entry with a matching group name.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int getgrnam_r (__const char *__restrict __name,
+ struct group *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen,
+ struct group **__restrict __result);
+
+# ifdef __USE_SVID
+/* Read a group entry from STREAM. This function is not standardized
+ an probably never will.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int fgetgrent_r (FILE *__restrict __stream,
+ struct group *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen,
+ struct group **__restrict __result);
+# endif
+
+#endif /* POSIX or reentrant */
+
+
+#ifdef __USE_BSD
+
+# define __need_size_t
+# include <stddef.h>
+
+/* Set the group set for the current user to GROUPS (N of them). */
+extern int setgroups (size_t __n, __const __gid_t *__groups) __THROW;
+
+#if 0
+/* Store at most *NGROUPS members of the group set for USER into
+ *GROUPS. Also include GROUP. The actual number of groups found is
+ returned in *NGROUPS. Return -1 if the if *NGROUPS is too small.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int getgrouplist (__const char *__user, __gid_t __group,
+ __gid_t *__groups, int *__ngroups);
+#endif
+
+/* Initialize the group set for the current user
+ by reading the group database and using all groups
+ of which USER is a member. Also include GROUP.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int initgroups (__const char *__user, __gid_t __group);
+
+#endif /* Use BSD. */
+
+__END_DECLS
+
+#endif /* grp.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/hp-timing.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/hp-timing.h
new file mode 100644
index 0000000..099342d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/hp-timing.h
@@ -0,0 +1,83 @@
+/* High precision, low overhead timing functions. Generic version.
+ Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _HP_TIMING_H
+#define _HP_TIMING_H 1
+
+
+/* There are no generic definitions for the times. We could write something
+ using the `gettimeofday' system call where available but the overhead of
+ the system call might be too high.
+
+ In case a platform supports timers in the hardware the following macros
+ and types must be defined:
+
+ - HP_TIMING_AVAIL: test for availability.
+
+ - HP_TIMING_INLINE: this macro is non-zero if the functionality is not
+ implemented using function calls but instead uses some inlined code
+ which might simply consist of a few assembler instructions. We have to
+ know this since we might want to use the macros here in places where we
+ cannot make function calls.
+
+ - hp_timing_t: This is the type for variables used to store the time
+ values.
+
+ - HP_TIMING_ZERO: clear `hp_timing_t' object.
+
+ - HP_TIMING_NOW: place timestamp for current time in variable given as
+ parameter.
+
+ - HP_TIMING_DIFF_INIT: do whatever is necessary to be able to use the
+ HP_TIMING_DIFF macro.
+
+ - HP_TIMING_DIFF: compute difference between two times and store it
+ in a third. Source and destination might overlap.
+
+ - HP_TIMING_ACCUM: add time difference to another variable. This might
+ be a bit more complicated to implement for some platforms as the
+ operation should be thread-safe and 64bit arithmetic on 32bit platforms
+ is not.
+
+ - HP_TIMING_ACCUM_NT: this is the variant for situations where we know
+ there are no threads involved.
+
+ - HP_TIMING_PRINT: write decimal representation of the timing value into
+ the given string. This operation need not be inline even though
+ HP_TIMING_INLINE is specified.
+
+*/
+
+/* Provide dummy definitions. */
+#define HP_TIMING_AVAIL (0)
+#define HP_TIMING_INLINE (0)
+typedef int hp_timing_t;
+#define HP_TIMING_ZERO(Var)
+#define HP_TIMING_NOW(var)
+#define HP_TIMING_DIFF_INIT()
+#define HP_TIMING_DIFF(Diff, Start, End)
+#define HP_TIMING_ACCUM(Sum, Diff)
+#define HP_TIMING_ACCUM_NT(Sum, Diff)
+#define HP_TIMING_PRINT(Buf, Len, Val)
+
+/* Since this implementation is not available we tell the user about it. */
+#define HP_TIMING_NONAVAIL 1
+
+#endif /* hp-timing.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/ieee754.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/ieee754.h
new file mode 100644
index 0000000..7131e5d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/ieee754.h
@@ -0,0 +1,199 @@
+/* Copyright (C) 1992, 1995, 1996, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _IEEE754_H
+
+#define _IEEE754_H 1
+#include <features.h>
+
+#include <endian.h>
+
+__BEGIN_DECLS
+
+union ieee754_float
+ {
+ float f;
+
+ /* This is the IEEE 754 single-precision format. */
+ struct
+ {
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int negative:1;
+ unsigned int exponent:8;
+ unsigned int mantissa:23;
+#endif /* Big endian. */
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int mantissa:23;
+ unsigned int exponent:8;
+ unsigned int negative:1;
+#endif /* Little endian. */
+ } ieee;
+
+ /* This format makes it easier to see if a NaN is a signalling NaN. */
+ struct
+ {
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int negative:1;
+ unsigned int exponent:8;
+ unsigned int quiet_nan:1;
+ unsigned int mantissa:22;
+#endif /* Big endian. */
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int mantissa:22;
+ unsigned int quiet_nan:1;
+ unsigned int exponent:8;
+ unsigned int negative:1;
+#endif /* Little endian. */
+ } ieee_nan;
+ };
+
+#define IEEE754_FLOAT_BIAS 0x7f /* Added to exponent. */
+
+
+union ieee754_double
+ {
+ double d;
+
+ /* This is the IEEE 754 double-precision format. */
+ struct
+ {
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int negative:1;
+ unsigned int exponent:11;
+ /* Together these comprise the mantissa. */
+ unsigned int mantissa0:20;
+ unsigned int mantissa1:32;
+#endif /* Big endian. */
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+# if __FLOAT_WORD_ORDER == BIG_ENDIAN
+ unsigned int mantissa0:20;
+ unsigned int exponent:11;
+ unsigned int negative:1;
+ unsigned int mantissa1:32;
+# else
+ /* Together these comprise the mantissa. */
+ unsigned int mantissa1:32;
+ unsigned int mantissa0:20;
+ unsigned int exponent:11;
+ unsigned int negative:1;
+# endif
+#endif /* Little endian. */
+ } ieee;
+
+ /* This format makes it easier to see if a NaN is a signalling NaN. */
+ struct
+ {
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int negative:1;
+ unsigned int exponent:11;
+ unsigned int quiet_nan:1;
+ /* Together these comprise the mantissa. */
+ unsigned int mantissa0:19;
+ unsigned int mantissa1:32;
+#else
+# if __FLOAT_WORD_ORDER == BIG_ENDIAN
+ unsigned int mantissa0:19;
+ unsigned int quiet_nan:1;
+ unsigned int exponent:11;
+ unsigned int negative:1;
+ unsigned int mantissa1:32;
+# else
+ /* Together these comprise the mantissa. */
+ unsigned int mantissa1:32;
+ unsigned int mantissa0:19;
+ unsigned int quiet_nan:1;
+ unsigned int exponent:11;
+ unsigned int negative:1;
+# endif
+#endif
+ } ieee_nan;
+ };
+
+#define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */
+
+
+union ieee854_long_double
+ {
+ long double d;
+
+ /* This is the IEEE 854 double-extended-precision format. */
+ struct
+ {
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int negative:1;
+ unsigned int exponent:15;
+ unsigned int empty:16;
+ unsigned int mantissa0:32;
+ unsigned int mantissa1:32;
+#endif
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+# if __FLOAT_WORD_ORDER == BIG_ENDIAN
+ unsigned int exponent:15;
+ unsigned int negative:1;
+ unsigned int empty:16;
+ unsigned int mantissa0:32;
+ unsigned int mantissa1:32;
+# else
+ unsigned int mantissa1:32;
+ unsigned int mantissa0:32;
+ unsigned int exponent:15;
+ unsigned int negative:1;
+ unsigned int empty:16;
+# endif
+#endif
+ } ieee;
+
+ /* This is for NaNs in the IEEE 854 double-extended-precision format. */
+ struct
+ {
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int negative:1;
+ unsigned int exponent:15;
+ unsigned int empty:16;
+ unsigned int one:1;
+ unsigned int quiet_nan:1;
+ unsigned int mantissa0:30;
+ unsigned int mantissa1:32;
+#endif
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+# if __FLOAT_WORD_ORDER == BIG_ENDIAN
+ unsigned int exponent:15;
+ unsigned int negative:1;
+ unsigned int empty:16;
+ unsigned int mantissa0:30;
+ unsigned int quiet_nan:1;
+ unsigned int one:1;
+ unsigned int mantissa1:32;
+# else
+ unsigned int mantissa1:32;
+ unsigned int mantissa0:30;
+ unsigned int quiet_nan:1;
+ unsigned int one:1;
+ unsigned int exponent:15;
+ unsigned int negative:1;
+ unsigned int empty:16;
+# endif
+#endif
+ } ieee_nan;
+ };
+
+#define IEEE854_LONG_DOUBLE_BIAS 0x3fff
+
+__END_DECLS
+
+#endif /* ieee754.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/inttypes.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/inttypes.h
new file mode 100644
index 0000000..b1d4302
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/inttypes.h
@@ -0,0 +1,328 @@
+/* Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99: 7.8 Format conversion of integer types <inttypes.h>
+ */
+
+#ifndef _INTTYPES_H
+#define _INTTYPES_H 1
+
+#include <features.h>
+/* Get the type definitions. */
+#include <stdint.h>
+
+#ifdef __UCLIBC_HAS_WCHAR__
+/* Get a definition for wchar_t. But we must not define wchar_t itself. */
+#ifndef ____gwchar_t_defined
+# ifdef __cplusplus
+# define __gwchar_t wchar_t
+# elif defined __WCHAR_TYPE__
+typedef __WCHAR_TYPE__ __gwchar_t;
+# else
+# define __need_wchar_t
+# include <stddef.h>
+typedef wchar_t __gwchar_t;
+# endif
+# define ____gwchar_t_defined 1
+#endif
+#endif
+
+
+/* The ISO C99 standard specifies that these macros must only be
+ defined if explicitly requested. */
+#if !defined __cplusplus || defined __STDC_FORMAT_MACROS
+
+# if __WORDSIZE == 64
+# define __PRI64_PREFIX "l"
+# define __PRIPTR_PREFIX "l"
+# else
+# define __PRI64_PREFIX "ll"
+# define __PRIPTR_PREFIX
+# endif
+
+/* Macros for printing format specifiers. */
+
+/* Decimal notation. */
+# define PRId8 "d"
+# define PRId16 "d"
+# define PRId32 "d"
+# define PRId64 __PRI64_PREFIX "d"
+
+# define PRIdLEAST8 "d"
+# define PRIdLEAST16 "d"
+# define PRIdLEAST32 "d"
+# define PRIdLEAST64 __PRI64_PREFIX "d"
+
+# define PRIdFAST8 "d"
+# define PRIdFAST16 "d"
+# define PRIdFAST32 "d"
+# define PRIdFAST64 __PRI64_PREFIX "d"
+
+
+# define PRIi8 "i"
+# define PRIi16 "i"
+# define PRIi32 "i"
+# define PRIi64 __PRI64_PREFIX "i"
+
+# define PRIiLEAST8 "i"
+# define PRIiLEAST16 "i"
+# define PRIiLEAST32 "i"
+# define PRIiLEAST64 __PRI64_PREFIX "i"
+
+# define PRIiFAST8 "i"
+# define PRIiFAST16 "i"
+# define PRIiFAST32 "i"
+# define PRIiFAST64 __PRI64_PREFIX "i"
+
+/* Octal notation. */
+# define PRIo8 "o"
+# define PRIo16 "o"
+# define PRIo32 "o"
+# define PRIo64 __PRI64_PREFIX "o"
+
+# define PRIoLEAST8 "o"
+# define PRIoLEAST16 "o"
+# define PRIoLEAST32 "o"
+# define PRIoLEAST64 __PRI64_PREFIX "o"
+
+# define PRIoFAST8 "o"
+# define PRIoFAST16 "o"
+# define PRIoFAST32 "o"
+# define PRIoFAST64 __PRI64_PREFIX "o"
+
+/* Unsigned integers. */
+# define PRIu8 "u"
+# define PRIu16 "u"
+# define PRIu32 "u"
+# define PRIu64 __PRI64_PREFIX "u"
+
+# define PRIuLEAST8 "u"
+# define PRIuLEAST16 "u"
+# define PRIuLEAST32 "u"
+# define PRIuLEAST64 __PRI64_PREFIX "u"
+
+# define PRIuFAST8 "u"
+# define PRIuFAST16 "u"
+# define PRIuFAST32 "u"
+# define PRIuFAST64 __PRI64_PREFIX "u"
+
+/* lowercase hexadecimal notation. */
+# define PRIx8 "x"
+# define PRIx16 "x"
+# define PRIx32 "x"
+# define PRIx64 __PRI64_PREFIX "x"
+
+# define PRIxLEAST8 "x"
+# define PRIxLEAST16 "x"
+# define PRIxLEAST32 "x"
+# define PRIxLEAST64 __PRI64_PREFIX "x"
+
+# define PRIxFAST8 "x"
+# define PRIxFAST16 "x"
+# define PRIxFAST32 "x"
+# define PRIxFAST64 __PRI64_PREFIX "x"
+
+/* UPPERCASE hexadecimal notation. */
+# define PRIX8 "X"
+# define PRIX16 "X"
+# define PRIX32 "X"
+# define PRIX64 __PRI64_PREFIX "X"
+
+# define PRIXLEAST8 "X"
+# define PRIXLEAST16 "X"
+# define PRIXLEAST32 "X"
+# define PRIXLEAST64 __PRI64_PREFIX "X"
+
+# define PRIXFAST8 "X"
+# define PRIXFAST16 "X"
+# define PRIXFAST32 "X"
+# define PRIXFAST64 __PRI64_PREFIX "X"
+
+
+/* Macros for printing `intmax_t' and `uintmax_t'. */
+# define PRIdMAX __PRI64_PREFIX "d"
+# define PRIiMAX __PRI64_PREFIX "i"
+# define PRIoMAX __PRI64_PREFIX "o"
+# define PRIuMAX __PRI64_PREFIX "u"
+# define PRIxMAX __PRI64_PREFIX "x"
+# define PRIXMAX __PRI64_PREFIX "X"
+
+
+/* Macros for printing `intptr_t' and `uintptr_t'. */
+# define PRIdPTR __PRIPTR_PREFIX "d"
+# define PRIiPTR __PRIPTR_PREFIX "i"
+# define PRIoPTR __PRIPTR_PREFIX "o"
+# define PRIuPTR __PRIPTR_PREFIX "u"
+# define PRIxPTR __PRIPTR_PREFIX "x"
+# define PRIXPTR __PRIPTR_PREFIX "X"
+
+
+/* Macros for scanning format specifiers. */
+
+/* Signed decimal notation. */
+# define SCNd8 "hhd"
+# define SCNd16 "hd"
+# define SCNd32 "d"
+# define SCNd64 __PRI64_PREFIX "d"
+
+# define SCNdLEAST8 "hhd"
+# define SCNdLEAST16 "hd"
+# define SCNdLEAST32 "d"
+# define SCNdLEAST64 __PRI64_PREFIX "d"
+
+# define SCNdFAST8 "hhd"
+# define SCNdFAST16 __PRIPTR_PREFIX "d"
+# define SCNdFAST32 __PRIPTR_PREFIX "d"
+# define SCNdFAST64 __PRI64_PREFIX "d"
+
+/* Signed decimal notation. */
+# define SCNi8 "hhi"
+# define SCNi16 "hi"
+# define SCNi32 "i"
+# define SCNi64 __PRI64_PREFIX "i"
+
+# define SCNiLEAST8 "hhi"
+# define SCNiLEAST16 "hi"
+# define SCNiLEAST32 "i"
+# define SCNiLEAST64 __PRI64_PREFIX "i"
+
+# define SCNiFAST8 "hhi"
+# define SCNiFAST16 __PRIPTR_PREFIX "i"
+# define SCNiFAST32 __PRIPTR_PREFIX "i"
+# define SCNiFAST64 __PRI64_PREFIX "i"
+
+/* Unsigned decimal notation. */
+# define SCNu8 "hhu"
+# define SCNu16 "hu"
+# define SCNu32 "u"
+# define SCNu64 __PRI64_PREFIX "u"
+
+# define SCNuLEAST8 "hhu"
+# define SCNuLEAST16 "hu"
+# define SCNuLEAST32 "u"
+# define SCNuLEAST64 __PRI64_PREFIX "u"
+
+# define SCNuFAST8 "hhu"
+# define SCNuFAST16 __PRIPTR_PREFIX "u"
+# define SCNuFAST32 __PRIPTR_PREFIX "u"
+# define SCNuFAST64 __PRI64_PREFIX "u"
+
+/* Octal notation. */
+# define SCNo8 "hho"
+# define SCNo16 "ho"
+# define SCNo32 "o"
+# define SCNo64 __PRI64_PREFIX "o"
+
+# define SCNoLEAST8 "hho"
+# define SCNoLEAST16 "ho"
+# define SCNoLEAST32 "o"
+# define SCNoLEAST64 __PRI64_PREFIX "o"
+
+# define SCNoFAST8 "hho"
+# define SCNoFAST16 __PRIPTR_PREFIX "o"
+# define SCNoFAST32 __PRIPTR_PREFIX "o"
+# define SCNoFAST64 __PRI64_PREFIX "o"
+
+/* Hexadecimal notation. */
+# define SCNx8 "hhx"
+# define SCNx16 "hx"
+# define SCNx32 "x"
+# define SCNx64 __PRI64_PREFIX "x"
+
+# define SCNxLEAST8 "hhx"
+# define SCNxLEAST16 "hx"
+# define SCNxLEAST32 "x"
+# define SCNxLEAST64 __PRI64_PREFIX "x"
+
+# define SCNxFAST8 "hhx"
+# define SCNxFAST16 __PRIPTR_PREFIX "x"
+# define SCNxFAST32 __PRIPTR_PREFIX "x"
+# define SCNxFAST64 __PRI64_PREFIX "x"
+
+
+/* Macros for scanning `intmax_t' and `uintmax_t'. */
+# define SCNdMAX __PRI64_PREFIX "d"
+# define SCNiMAX __PRI64_PREFIX "i"
+# define SCNoMAX __PRI64_PREFIX "o"
+# define SCNuMAX __PRI64_PREFIX "u"
+# define SCNxMAX __PRI64_PREFIX "x"
+
+/* Macros for scaning `intptr_t' and `uintptr_t'. */
+# define SCNdPTR __PRIPTR_PREFIX "d"
+# define SCNiPTR __PRIPTR_PREFIX "i"
+# define SCNoPTR __PRIPTR_PREFIX "o"
+# define SCNuPTR __PRIPTR_PREFIX "u"
+# define SCNxPTR __PRIPTR_PREFIX "x"
+
+#endif /* C++ && format macros */
+
+
+__BEGIN_DECLS
+
+#if __WORDSIZE == 64
+
+/* We have to define the `uintmax_t' type using `ldiv_t'. */
+typedef struct
+ {
+ long int quot; /* Quotient. */
+ long int rem; /* Remainder. */
+ } imaxdiv_t;
+
+#else
+
+/* We have to define the `uintmax_t' type using `lldiv_t'. */
+typedef struct
+ {
+ long long int quot; /* Quotient. */
+ long long int rem; /* Remainder. */
+ } imaxdiv_t;
+
+#endif
+
+
+/* Compute absolute value of N. */
+extern intmax_t imaxabs (intmax_t __n) __THROW __attribute__ ((__const__));
+
+/* Return the `imaxdiv_t' representation of the value of NUMER over DENOM. */
+extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom)
+ __THROW __attribute__ ((__const__));
+
+/* Like `strtol' but convert to `intmax_t'. */
+extern intmax_t strtoimax (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base) __THROW;
+
+/* Like `strtoul' but convert to `uintmax_t'. */
+extern uintmax_t strtoumax (__const char *__restrict __nptr,
+ char ** __restrict __endptr, int __base) __THROW;
+
+#if defined __UCLIBC_HAS_WCHAR__ && __UCLIBC_HAS_WCHAR__
+/* Like `wcstol' but convert to `intmax_t'. */
+extern intmax_t wcstoimax (__const __gwchar_t *__restrict __nptr,
+ __gwchar_t **__restrict __endptr, int __base)
+ __THROW;
+
+/* Like `wcstoul' but convert to `uintmax_t'. */
+extern uintmax_t wcstoumax (__const __gwchar_t *__restrict __nptr,
+ __gwchar_t ** __restrict __endptr, int __base)
+ __THROW;
+#endif
+
+__END_DECLS
+
+#endif /* inttypes.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/langinfo.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/langinfo.h
new file mode 100644
index 0000000..837a87b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/langinfo.h
@@ -0,0 +1,623 @@
+/* Access to locale-dependent parameters.
+ Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _LANGINFO_H
+#define _LANGINFO_H 1
+
+/* Get the type definition. */
+#include <nl_types.h>
+
+#include <bits/uClibc_locale.h> /* Define the __LC_* category names. */
+
+
+__BEGIN_DECLS
+
+/* Construct an `nl_item' value for `nl_langinfo' from a locale category
+ (LC_*) and an item index within the category. Some code may depend on
+ the item values within a category increasing monotonically with the
+ indices. */
+#define _NL_ITEM(category, index) \
+ (((category) << __NL_ITEM_CATEGORY_SHIFT) | (index))
+
+/* Extract the category and item index from a constructed `nl_item' value. */
+#define _NL_ITEM_CATEGORY(item) ((int) (item) >> __NL_ITEM_CATEGORY_SHIFT)
+#define _NL_ITEM_INDEX(item) ((int) (item) & __NL_ITEM_INDEX_MASK)
+
+
+/* Enumeration of locale items that can be queried with `nl_langinfo'. */
+enum
+{
+ /* LC_TIME category: date and time formatting. */
+
+ /* Abbreviated days of the week. */
+ ABDAY_1 = _NL_ITEM (__LC_TIME, 0), /* Sun */
+#define ABDAY_1 ABDAY_1
+ ABDAY_2,
+#define ABDAY_2 ABDAY_2
+ ABDAY_3,
+#define ABDAY_3 ABDAY_3
+ ABDAY_4,
+#define ABDAY_4 ABDAY_4
+ ABDAY_5,
+#define ABDAY_5 ABDAY_5
+ ABDAY_6,
+#define ABDAY_6 ABDAY_6
+ ABDAY_7,
+#define ABDAY_7 ABDAY_7
+
+ /* Long-named days of the week. */
+ DAY_1, /* Sunday */
+#define DAY_1 DAY_1
+ DAY_2, /* Monday */
+#define DAY_2 DAY_2
+ DAY_3, /* Tuesday */
+#define DAY_3 DAY_3
+ DAY_4, /* Wednesday */
+#define DAY_4 DAY_4
+ DAY_5, /* Thursday */
+#define DAY_5 DAY_5
+ DAY_6, /* Friday */
+#define DAY_6 DAY_6
+ DAY_7, /* Saturday */
+#define DAY_7 DAY_7
+
+ /* Abbreviated month names. */
+ ABMON_1, /* Jan */
+#define ABMON_1 ABMON_1
+ ABMON_2,
+#define ABMON_2 ABMON_2
+ ABMON_3,
+#define ABMON_3 ABMON_3
+ ABMON_4,
+#define ABMON_4 ABMON_4
+ ABMON_5,
+#define ABMON_5 ABMON_5
+ ABMON_6,
+#define ABMON_6 ABMON_6
+ ABMON_7,
+#define ABMON_7 ABMON_7
+ ABMON_8,
+#define ABMON_8 ABMON_8
+ ABMON_9,
+#define ABMON_9 ABMON_9
+ ABMON_10,
+#define ABMON_10 ABMON_10
+ ABMON_11,
+#define ABMON_11 ABMON_11
+ ABMON_12,
+#define ABMON_12 ABMON_12
+
+ /* Long month names. */
+ MON_1, /* January */
+#define MON_1 MON_1
+ MON_2,
+#define MON_2 MON_2
+ MON_3,
+#define MON_3 MON_3
+ MON_4,
+#define MON_4 MON_4
+ MON_5,
+#define MON_5 MON_5
+ MON_6,
+#define MON_6 MON_6
+ MON_7,
+#define MON_7 MON_7
+ MON_8,
+#define MON_8 MON_8
+ MON_9,
+#define MON_9 MON_9
+ MON_10,
+#define MON_10 MON_10
+ MON_11,
+#define MON_11 MON_11
+ MON_12,
+#define MON_12 MON_12
+
+ AM_STR, /* Ante meridian string. */
+#define AM_STR AM_STR
+ PM_STR, /* Post meridian string. */
+#define PM_STR PM_STR
+
+ D_T_FMT, /* Date and time format for strftime. */
+#define D_T_FMT D_T_FMT
+ D_FMT, /* Date format for strftime. */
+#define D_FMT D_FMT
+ T_FMT, /* Time format for strftime. */
+#define T_FMT T_FMT
+ T_FMT_AMPM, /* 12-hour time format for strftime. */
+#define T_FMT_AMPM T_FMT_AMPM
+
+ ERA, /* Alternate era. */
+#define ERA ERA
+ __ERA_YEAR, /* Year in alternate era format. */
+#ifdef __USE_GNU
+# define ERA_YEAR __ERA_YEAR
+#endif
+ ERA_D_FMT, /* Date in alternate era format. */
+#define ERA_D_FMT ERA_D_FMT
+ ALT_DIGITS, /* Alternate symbols for digits. */
+#define ALT_DIGITS ALT_DIGITS
+ ERA_D_T_FMT, /* Date and time in alternate era format. */
+#define ERA_D_T_FMT ERA_D_T_FMT
+ ERA_T_FMT, /* Time in alternate era format. */
+#define ERA_T_FMT ERA_T_FMT
+
+#if 0
+ _NL_TIME_ERA_NUM_ENTRIES, /* Number entries in the era arrays. */
+ _NL_TIME_ERA_ENTRIES, /* Structure with era entries in usable form.*/
+
+ _NL_WABDAY_1, /* Sun */
+ _NL_WABDAY_2,
+ _NL_WABDAY_3,
+ _NL_WABDAY_4,
+ _NL_WABDAY_5,
+ _NL_WABDAY_6,
+ _NL_WABDAY_7,
+
+ /* Long-named days of the week. */
+ _NL_WDAY_1, /* Sunday */
+ _NL_WDAY_2, /* Monday */
+ _NL_WDAY_3, /* Tuesday */
+ _NL_WDAY_4, /* Wednesday */
+ _NL_WDAY_5, /* Thursday */
+ _NL_WDAY_6, /* Friday */
+ _NL_WDAY_7, /* Saturday */
+
+ /* Abbreviated month names. */
+ _NL_WABMON_1, /* Jan */
+ _NL_WABMON_2,
+ _NL_WABMON_3,
+ _NL_WABMON_4,
+ _NL_WABMON_5,
+ _NL_WABMON_6,
+ _NL_WABMON_7,
+ _NL_WABMON_8,
+ _NL_WABMON_9,
+ _NL_WABMON_10,
+ _NL_WABMON_11,
+ _NL_WABMON_12,
+
+ /* Long month names. */
+ _NL_WMON_1, /* January */
+ _NL_WMON_2,
+ _NL_WMON_3,
+ _NL_WMON_4,
+ _NL_WMON_5,
+ _NL_WMON_6,
+ _NL_WMON_7,
+ _NL_WMON_8,
+ _NL_WMON_9,
+ _NL_WMON_10,
+ _NL_WMON_11,
+ _NL_WMON_12,
+
+ _NL_WAM_STR, /* Ante meridian string. */
+ _NL_WPM_STR, /* Post meridian string. */
+
+ _NL_WD_T_FMT, /* Date and time format for strftime. */
+ _NL_WD_FMT, /* Date format for strftime. */
+ _NL_WT_FMT, /* Time format for strftime. */
+ _NL_WT_FMT_AMPM, /* 12-hour time format for strftime. */
+
+ _NL_WERA_YEAR, /* Year in alternate era format. */
+ _NL_WERA_D_FMT, /* Date in alternate era format. */
+ _NL_WALT_DIGITS, /* Alternate symbols for digits. */
+ _NL_WERA_D_T_FMT, /* Date and time in alternate era format. */
+ _NL_WERA_T_FMT, /* Time in alternate era format. */
+
+ _NL_TIME_WEEK_NDAYS,
+ _NL_TIME_WEEK_1STDAY,
+ _NL_TIME_WEEK_1STWEEK,
+ _NL_TIME_FIRST_WEEKDAY,
+ _NL_TIME_FIRST_WORKDAY,
+ _NL_TIME_CAL_DIRECTION,
+ _NL_TIME_TIMEZONE,
+
+ _DATE_FMT, /* strftime format for date. */
+#define _DATE_FMT _DATE_FMT
+ _NL_W_DATE_FMT,
+
+ _NL_TIME_CODESET,
+#endif /* 0 */
+
+ _NL_NUM_LC_TIME, /* Number of indices in LC_TIME category. */
+
+ /* LC_COLLATE category: text sorting.
+ This information is accessed by the strcoll and strxfrm functions.
+ These `nl_langinfo' names are used only internally. */
+#if 0
+ _NL_COLLATE_NRULES = _NL_ITEM (__LC_COLLATE, 0),
+ _NL_COLLATE_RULESETS,
+ _NL_COLLATE_TABLEMB,
+ _NL_COLLATE_WEIGHTMB,
+ _NL_COLLATE_EXTRAMB,
+ _NL_COLLATE_INDIRECTMB,
+ _NL_COLLATE_GAP1,
+ _NL_COLLATE_GAP2,
+ _NL_COLLATE_GAP3,
+ _NL_COLLATE_TABLEWC,
+ _NL_COLLATE_WEIGHTWC,
+ _NL_COLLATE_EXTRAWC,
+ _NL_COLLATE_INDIRECTWC,
+ _NL_COLLATE_SYMB_HASH_SIZEMB,
+ _NL_COLLATE_SYMB_TABLEMB,
+ _NL_COLLATE_SYMB_EXTRAMB,
+ _NL_COLLATE_COLLSEQMB,
+ _NL_COLLATE_COLLSEQWC,
+ _NL_COLLATE_CODESET,
+ _NL_NUM_LC_COLLATE,
+#endif
+
+ /* LC_CTYPE category: character classification.
+ This information is accessed by the functions in <ctype.h>.
+ These `nl_langinfo' names are used only internally. */
+#if 0
+ _NL_CTYPE_CLASS = _NL_ITEM (__LC_CTYPE, 0),
+ _NL_CTYPE_TOUPPER,
+ _NL_CTYPE_GAP1,
+ _NL_CTYPE_TOLOWER,
+ _NL_CTYPE_GAP2,
+ _NL_CTYPE_CLASS32,
+ _NL_CTYPE_GAP3,
+ _NL_CTYPE_GAP4,
+ _NL_CTYPE_GAP5,
+ _NL_CTYPE_GAP6,
+ _NL_CTYPE_CLASS_NAMES,
+ _NL_CTYPE_MAP_NAMES,
+ _NL_CTYPE_WIDTH,
+ _NL_CTYPE_MB_CUR_MAX,
+ _NL_CTYPE_CODESET_NAME,
+ CODESET = _NL_CTYPE_CODESET_NAME,
+#define CODESET CODESET
+ _NL_CTYPE_TOUPPER32,
+ _NL_CTYPE_TOLOWER32,
+ _NL_CTYPE_CLASS_OFFSET,
+ _NL_CTYPE_MAP_OFFSET,
+ _NL_CTYPE_INDIGITS_MB_LEN,
+ _NL_CTYPE_INDIGITS0_MB,
+ _NL_CTYPE_INDIGITS1_MB,
+ _NL_CTYPE_INDIGITS2_MB,
+ _NL_CTYPE_INDIGITS3_MB,
+ _NL_CTYPE_INDIGITS4_MB,
+ _NL_CTYPE_INDIGITS5_MB,
+ _NL_CTYPE_INDIGITS6_MB,
+ _NL_CTYPE_INDIGITS7_MB,
+ _NL_CTYPE_INDIGITS8_MB,
+ _NL_CTYPE_INDIGITS9_MB,
+ _NL_CTYPE_INDIGITS_WC_LEN,
+ _NL_CTYPE_INDIGITS0_WC,
+ _NL_CTYPE_INDIGITS1_WC,
+ _NL_CTYPE_INDIGITS2_WC,
+ _NL_CTYPE_INDIGITS3_WC,
+ _NL_CTYPE_INDIGITS4_WC,
+ _NL_CTYPE_INDIGITS5_WC,
+ _NL_CTYPE_INDIGITS6_WC,
+ _NL_CTYPE_INDIGITS7_WC,
+ _NL_CTYPE_INDIGITS8_WC,
+ _NL_CTYPE_INDIGITS9_WC,
+ _NL_CTYPE_OUTDIGIT0_MB,
+ _NL_CTYPE_OUTDIGIT1_MB,
+ _NL_CTYPE_OUTDIGIT2_MB,
+ _NL_CTYPE_OUTDIGIT3_MB,
+ _NL_CTYPE_OUTDIGIT4_MB,
+ _NL_CTYPE_OUTDIGIT5_MB,
+ _NL_CTYPE_OUTDIGIT6_MB,
+ _NL_CTYPE_OUTDIGIT7_MB,
+ _NL_CTYPE_OUTDIGIT8_MB,
+ _NL_CTYPE_OUTDIGIT9_MB,
+ _NL_CTYPE_OUTDIGIT0_WC,
+ _NL_CTYPE_OUTDIGIT1_WC,
+ _NL_CTYPE_OUTDIGIT2_WC,
+ _NL_CTYPE_OUTDIGIT3_WC,
+ _NL_CTYPE_OUTDIGIT4_WC,
+ _NL_CTYPE_OUTDIGIT5_WC,
+ _NL_CTYPE_OUTDIGIT6_WC,
+ _NL_CTYPE_OUTDIGIT7_WC,
+ _NL_CTYPE_OUTDIGIT8_WC,
+ _NL_CTYPE_OUTDIGIT9_WC,
+ _NL_CTYPE_TRANSLIT_TAB_SIZE,
+ _NL_CTYPE_TRANSLIT_FROM_IDX,
+ _NL_CTYPE_TRANSLIT_FROM_TBL,
+ _NL_CTYPE_TRANSLIT_TO_IDX,
+ _NL_CTYPE_TRANSLIT_TO_TBL,
+ _NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN,
+ _NL_CTYPE_TRANSLIT_DEFAULT_MISSING,
+ _NL_CTYPE_TRANSLIT_IGNORE_LEN,
+ _NL_CTYPE_TRANSLIT_IGNORE,
+ _NL_CTYPE_EXTRA_MAP_1,
+ _NL_CTYPE_EXTRA_MAP_2,
+ _NL_CTYPE_EXTRA_MAP_3,
+ _NL_CTYPE_EXTRA_MAP_4,
+ _NL_CTYPE_EXTRA_MAP_5,
+ _NL_CTYPE_EXTRA_MAP_6,
+ _NL_CTYPE_EXTRA_MAP_7,
+ _NL_CTYPE_EXTRA_MAP_8,
+ _NL_CTYPE_EXTRA_MAP_9,
+ _NL_CTYPE_EXTRA_MAP_10,
+ _NL_CTYPE_EXTRA_MAP_11,
+ _NL_CTYPE_EXTRA_MAP_12,
+ _NL_CTYPE_EXTRA_MAP_13,
+ _NL_CTYPE_EXTRA_MAP_14,
+ _NL_NUM_LC_CTYPE,
+#else /* 0 */
+ _NL_CTYPE_OUTDIGIT0_MB = _NL_ITEM (__LC_CTYPE, 0),
+ _NL_CTYPE_OUTDIGIT1_MB,
+ _NL_CTYPE_OUTDIGIT2_MB,
+ _NL_CTYPE_OUTDIGIT3_MB,
+ _NL_CTYPE_OUTDIGIT4_MB,
+ _NL_CTYPE_OUTDIGIT5_MB,
+ _NL_CTYPE_OUTDIGIT6_MB,
+ _NL_CTYPE_OUTDIGIT7_MB,
+ _NL_CTYPE_OUTDIGIT8_MB,
+ _NL_CTYPE_OUTDIGIT9_MB,
+ _NL_CTYPE_CODESET_NAME, /* uClibc note: MUST BE LAST ENTRY!!! */
+ CODESET = _NL_CTYPE_CODESET_NAME,
+#define CODESET CODESET
+#endif /* 0 */
+
+ /* LC_MONETARY category: formatting of monetary quantities.
+ These items each correspond to a member of `struct lconv',
+ defined in <locale.h>. */
+ __INT_CURR_SYMBOL = _NL_ITEM (__LC_MONETARY, 0),
+#ifdef __USE_GNU
+# define INT_CURR_SYMBOL __INT_CURR_SYMBOL
+#endif
+ __CURRENCY_SYMBOL,
+#ifdef __USE_GNU
+# define CURRENCY_SYMBOL __CURRENCY_SYMBOL
+#endif
+ __MON_DECIMAL_POINT,
+#ifdef __USE_GNU
+# define MON_DECIMAL_POINT __MON_DECIMAL_POINT
+#endif
+ __MON_THOUSANDS_SEP,
+#ifdef __USE_GNU
+# define MON_THOUSANDS_SEP __MON_THOUSANDS_SEP
+#endif
+ __MON_GROUPING,
+#ifdef __USE_GNU
+# define MON_GROUPING __MON_GROUPING
+#endif
+ __POSITIVE_SIGN,
+#ifdef __USE_GNU
+# define POSITIVE_SIGN __POSITIVE_SIGN
+#endif
+ __NEGATIVE_SIGN,
+#ifdef __USE_GNU
+# define NEGATIVE_SIGN __NEGATIVE_SIGN
+#endif
+ __INT_FRAC_DIGITS,
+#ifdef __USE_GNU
+# define INT_FRAC_DIGITS __INT_FRAC_DIGITS
+#endif
+ __FRAC_DIGITS,
+#ifdef __USE_GNU
+# define FRAC_DIGITS __FRAC_DIGITS
+#endif
+ __P_CS_PRECEDES,
+#ifdef __USE_GNU
+# define P_CS_PRECEDES __P_CS_PRECEDES
+#endif
+ __P_SEP_BY_SPACE,
+#ifdef __USE_GNU
+# define P_SEP_BY_SPACE __P_SEP_BY_SPACE
+#endif
+ __N_CS_PRECEDES,
+#ifdef __USE_GNU
+# define N_CS_PRECEDES __N_CS_PRECEDES
+#endif
+ __N_SEP_BY_SPACE,
+#ifdef __USE_GNU
+# define N_SEP_BY_SPACE __N_SEP_BY_SPACE
+#endif
+ __P_SIGN_POSN,
+#ifdef __USE_GNU
+# define P_SIGN_POSN __P_SIGN_POSN
+#endif
+ __N_SIGN_POSN,
+#ifdef __USE_GNU
+# define N_SIGN_POSN __N_SIGN_POSN
+#endif
+ __INT_P_CS_PRECEDES,
+#ifdef __USE_GNU
+# define INT_P_CS_PRECEDES __INT_P_CS_PRECEDES
+#endif
+ __INT_P_SEP_BY_SPACE,
+#ifdef __USE_GNU
+# define INT_P_SEP_BY_SPACE __INT_P_SEP_BY_SPACE
+#endif
+ __INT_N_CS_PRECEDES,
+#ifdef __USE_GNU
+# define INT_N_CS_PRECEDES __INT_N_CS_PRECEDES
+#endif
+ __INT_N_SEP_BY_SPACE,
+#ifdef __USE_GNU
+# define INT_N_SEP_BY_SPACE __INT_N_SEP_BY_SPACE
+#endif
+ __INT_P_SIGN_POSN,
+#ifdef __USE_GNU
+# define INT_P_SIGN_POSN __INT_P_SIGN_POSN
+#endif
+ __INT_N_SIGN_POSN,
+#ifdef __USE_GNU
+# define INT_N_SIGN_POSN __INT_N_SIGN_POSN
+#endif
+
+ _NL_MONETARY_CRNCYSTR,
+#define CRNCYSTR _NL_MONETARY_CRNCYSTR
+
+#if 0
+ _NL_MONETARY_DUO_INT_CURR_SYMBOL,
+ _NL_MONETARY_DUO_CURRENCY_SYMBOL,
+ _NL_MONETARY_DUO_INT_FRAC_DIGITS,
+ _NL_MONETARY_DUO_FRAC_DIGITS,
+ _NL_MONETARY_DUO_P_CS_PRECEDES,
+ _NL_MONETARY_DUO_P_SEP_BY_SPACE,
+ _NL_MONETARY_DUO_N_CS_PRECEDES,
+ _NL_MONETARY_DUO_N_SEP_BY_SPACE,
+ _NL_MONETARY_DUO_INT_P_CS_PRECEDES,
+ _NL_MONETARY_DUO_INT_P_SEP_BY_SPACE,
+ _NL_MONETARY_DUO_INT_N_CS_PRECEDES,
+ _NL_MONETARY_DUO_INT_N_SEP_BY_SPACE,
+ _NL_MONETARY_DUO_P_SIGN_POSN,
+ _NL_MONETARY_DUO_N_SIGN_POSN,
+ _NL_MONETARY_DUO_INT_P_SIGN_POSN,
+ _NL_MONETARY_DUO_INT_N_SIGN_POSN,
+ _NL_MONETARY_UNO_VALID_FROM,
+ _NL_MONETARY_UNO_VALID_TO,
+ _NL_MONETARY_DUO_VALID_FROM,
+ _NL_MONETARY_DUO_VALID_TO,
+ _NL_MONETARY_CONVERSION_RATE,
+ _NL_MONETARY_DECIMAL_POINT_WC,
+ _NL_MONETARY_THOUSANDS_SEP_WC,
+ _NL_MONETARY_CODESET,
+#endif /* 0 */
+ _NL_NUM_LC_MONETARY,
+
+ /* LC_NUMERIC category: formatting of numbers.
+ These also correspond to members of `struct lconv'; see <locale.h>. */
+ __DECIMAL_POINT = _NL_ITEM (__LC_NUMERIC, 0),
+#ifdef __USE_GNU
+# define DECIMAL_POINT __DECIMAL_POINT
+#endif
+ RADIXCHAR = __DECIMAL_POINT,
+#define RADIXCHAR RADIXCHAR
+ __THOUSANDS_SEP,
+#ifdef __USE_GNU
+# define THOUSANDS_SEP __THOUSANDS_SEP
+#endif
+ THOUSEP = __THOUSANDS_SEP,
+#define THOUSEP THOUSEP
+ __GROUPING,
+#ifdef __USE_GNU
+# define GROUPING __GROUPING
+#endif
+#if 0
+ _NL_NUMERIC_DECIMAL_POINT_WC,
+ _NL_NUMERIC_THOUSANDS_SEP_WC,
+ _NL_NUMERIC_CODESET,
+#endif
+ _NL_NUM_LC_NUMERIC,
+
+ __YESEXPR = _NL_ITEM (__LC_MESSAGES, 0), /* Regex matching ``yes'' input. */
+#define YESEXPR __YESEXPR
+ __NOEXPR, /* Regex matching ``no'' input. */
+#define NOEXPR __NOEXPR
+ __YESSTR, /* Output string for ``yes''. */
+#if defined __USE_GNU || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
+# define YESSTR __YESSTR
+#endif
+ __NOSTR, /* Output string for ``no''. */
+#if defined __USE_GNU || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
+# define NOSTR __NOSTR
+#endif
+#if 0
+ _NL_MESSAGES_CODESET,
+#endif
+ _NL_NUM_LC_MESSAGES,
+
+#if 0
+ _NL_PAPER_HEIGHT = _NL_ITEM (__LC_PAPER, 0),
+ _NL_PAPER_WIDTH,
+ _NL_PAPER_CODESET,
+ _NL_NUM_LC_PAPER,
+
+ _NL_NAME_NAME_FMT = _NL_ITEM (__LC_NAME, 0),
+ _NL_NAME_NAME_GEN,
+ _NL_NAME_NAME_MR,
+ _NL_NAME_NAME_MRS,
+ _NL_NAME_NAME_MISS,
+ _NL_NAME_NAME_MS,
+ _NL_NAME_CODESET,
+ _NL_NUM_LC_NAME,
+
+ _NL_ADDRESS_POSTAL_FMT = _NL_ITEM (__LC_ADDRESS, 0),
+ _NL_ADDRESS_COUNTRY_NAME,
+ _NL_ADDRESS_COUNTRY_POST,
+ _NL_ADDRESS_COUNTRY_AB2,
+ _NL_ADDRESS_COUNTRY_AB3,
+ _NL_ADDRESS_COUNTRY_CAR,
+ _NL_ADDRESS_COUNTRY_NUM,
+ _NL_ADDRESS_COUNTRY_ISBN,
+ _NL_ADDRESS_LANG_NAME,
+ _NL_ADDRESS_LANG_AB,
+ _NL_ADDRESS_LANG_TERM,
+ _NL_ADDRESS_LANG_LIB,
+ _NL_ADDRESS_CODESET,
+ _NL_NUM_LC_ADDRESS,
+
+ _NL_TELEPHONE_TEL_INT_FMT = _NL_ITEM (__LC_TELEPHONE, 0),
+ _NL_TELEPHONE_TEL_DOM_FMT,
+ _NL_TELEPHONE_INT_SELECT,
+ _NL_TELEPHONE_INT_PREFIX,
+ _NL_TELEPHONE_CODESET,
+ _NL_NUM_LC_TELEPHONE,
+
+ _NL_MEASUREMENT_MEASUREMENT = _NL_ITEM (__LC_MEASUREMENT, 0),
+ _NL_MEASUREMENT_CODESET,
+ _NL_NUM_LC_MEASUREMENT,
+
+ _NL_IDENTIFICATION_TITLE = _NL_ITEM (__LC_IDENTIFICATION, 0),
+ _NL_IDENTIFICATION_SOURCE,
+ _NL_IDENTIFICATION_ADDRESS,
+ _NL_IDENTIFICATION_CONTACT,
+ _NL_IDENTIFICATION_EMAIL,
+ _NL_IDENTIFICATION_TEL,
+ _NL_IDENTIFICATION_FAX,
+ _NL_IDENTIFICATION_LANGUAGE,
+ _NL_IDENTIFICATION_TERRITORY,
+ _NL_IDENTIFICATION_AUDIENCE,
+ _NL_IDENTIFICATION_APPLICATION,
+ _NL_IDENTIFICATION_ABBREVIATION,
+ _NL_IDENTIFICATION_REVISION,
+ _NL_IDENTIFICATION_DATE,
+ _NL_IDENTIFICATION_CATEGORY,
+ _NL_IDENTIFICATION_CODESET,
+ _NL_NUM_LC_IDENTIFICATION,
+#endif
+ /* This marks the highest value used. */
+ _NL_NUM
+};
+
+
+/* Return the current locale's value for ITEM.
+ If ITEM is invalid, an empty string is returned.
+
+ The string returned will not change until `setlocale' is called;
+ it is usually in read-only memory and cannot be modified. */
+
+extern char *nl_langinfo (nl_item __item) __THROW;
+
+
+#ifdef __UCLIBC_HAS_XLOCALE__
+#ifdef __USE_GNU
+/* This interface is for the extended locale model. See <locale.h> for
+ more information. */
+
+/* Get locale datatype definition. */
+# include <xlocale.h>
+
+/* Just like nl_langinfo but get the information from the locale object L. */
+extern char *nl_langinfo_l (nl_item __item, __locale_t l);
+#endif
+#endif
+
+__END_DECLS
+
+#endif /* langinfo.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/lastlog.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/lastlog.h
new file mode 100644
index 0000000..8cc4254
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/lastlog.h
@@ -0,0 +1,4 @@
+/* This header file is used in 4.3BSD to define `struct lastlog',
+ which we define in <bits/utmp.h>. */
+
+#include <utmp.h>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/libc-internal.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/libc-internal.h
new file mode 100644
index 0000000..f9c162f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/libc-internal.h
@@ -0,0 +1,3 @@
+#ifndef _LIBC_INTERNAL_H
+#define _LIBC_INTERNAL_H 1
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/libc-symbols.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/libc-symbols.h
new file mode 100644
index 0000000..2933431
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/libc-symbols.h
@@ -0,0 +1,726 @@
+/* Support macros for making weak and strong aliases for symbols,
+ and for using symbol sets and linker warnings with GNU ld.
+ Copyright (C) 1995-1998,2000-2003,2004,2005,2006
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _LIBC_SYMBOLS_H
+#define _LIBC_SYMBOLS_H 1
+
+/* This is defined for the compilation of all C library code. features.h
+ tests this to avoid inclusion of stubs.h while compiling the library,
+ before stubs.h has been generated. Some library code that is shared
+ with other packages also tests this symbol to see if it is being
+ compiled as part of the C library. We must define this before including
+ config.h, because it makes some definitions conditional on whether libc
+ itself is being compiled, or just some generator program. */
+#define _LIBC 1
+
+
+/* This file's macros are included implicitly in the compilation of every
+ file in the C library by -imacros.
+
+ We include uClibc_arch_features.h which is defined by arch devs.
+ It should define for us the following symbols:
+
+ * HAVE_ASM_SET_DIRECTIVE if we have `.set B, A' instead of `A = B'.
+ * ASM_GLOBAL_DIRECTIVE with `.globl' or `.global'.
+ * ASM_TYPE_DIRECTIVE_PREFIX with `@' or `#' or whatever for .type,
+ or leave it undefined if there is no .type directive.
+ * HAVE_ELF if using ELF, which supports weak symbols using `.weak'.
+ * HAVE_ASM_WEAK_DIRECTIVE if we have weak symbols using `.weak'.
+ * HAVE_ASM_WEAKEXT_DIRECTIVE if we have weak symbols using `.weakext'.
+
+ */
+
+#include <bits/uClibc_arch_features.h>
+
+/* Enable declarations of GNU extensions, since we are compiling them. */
+#define _GNU_SOURCE 1
+
+/* Prepare for the case that `__builtin_expect' is not available. */
+#if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ < 96
+# define __builtin_expect(x, expected_value) (x)
+#endif
+#ifndef likely
+# define likely(x) __builtin_expect((!!(x)),1)
+#endif
+#ifndef unlikely
+# define unlikely(x) __builtin_expect((!!(x)),0)
+#endif
+#ifndef __LINUX_COMPILER_H
+# define __LINUX_COMPILER_H
+#endif
+#ifndef __cast__
+# define __cast__(_to)
+#endif
+
+#define attribute_unused __attribute__ ((unused))
+
+#if defined __GNUC__ || defined __ICC
+# define attribute_noreturn __attribute__ ((__noreturn__))
+#else
+# define attribute_noreturn
+#endif
+
+#ifndef NOT_IN_libc
+# define IS_IN_libc 1
+#endif
+
+#ifdef __UCLIBC_NO_UNDERSCORES__
+# define NO_UNDERSCORES
+#else
+# undef NO_UNDERSCORES
+#endif
+
+#ifdef __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
+# define HAVE_ASM_SET_DIRECTIVE
+#else
+# undef HAVE_ASM_SET_DIRECTIVE
+#endif
+
+#ifdef __UCLIBC_ASM_GLOBAL_DIRECTIVE__
+# define ASM_GLOBAL_DIRECTIVE __UCLIBC_ASM_GLOBAL_DIRECTIVE__
+#else
+# define ASM_GLOBAL_DIRECTIVE .global
+#endif
+
+#ifdef __UCLIBC_HAVE_ASM_WEAK_DIRECTIVE__
+# define HAVE_ASM_WEAK_DIRECTIVE
+#else
+# undef HAVE_ASM_WEAK_DIRECTIVE
+#endif
+
+#ifdef __UCLIBC_HAVE_ASM_WEAKEXT_DIRECTIVE__
+# define HAVE_ASM_WEAKEXT_DIRECTIVE
+#else
+# undef HAVE_ASM_WEAKEXT_DIRECTIVE
+#endif
+
+#ifdef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
+# define HAVE_ASM_GLOBAL_DOT_NAME
+#else
+# undef HAVE_ASM_GLOBAL_DOT_NAME
+#endif
+
+#if defined HAVE_ASM_WEAK_DIRECTIVE || defined HAVE_ASM_WEAKEXT_DIRECTIVE
+# define HAVE_WEAK_SYMBOLS
+#endif
+
+#undef C_SYMBOL_NAME
+#ifndef C_SYMBOL_NAME
+# ifdef NO_UNDERSCORES
+# define C_SYMBOL_NAME(name) name
+# else
+# define C_SYMBOL_NAME(name) _##name
+# endif
+#endif
+
+#ifdef __UCLIBC_ASM_LINE_SEP__
+# define ASM_LINE_SEP __UCLIBC_ASM_LINE_SEP__
+#else
+# define ASM_LINE_SEP ;
+#endif
+
+#ifdef HAVE_ASM_GLOBAL_DOT_NAME
+# ifndef C_SYMBOL_DOT_NAME
+# if defined __GNUC__ && defined __GNUC_MINOR__ \
+ && (__GNUC__ << 16) + __GNUC_MINOR__ >= (3 << 16) + 1
+# define C_SYMBOL_DOT_NAME(name) .name
+# else
+# define C_SYMBOL_DOT_NAME(name) .##name
+# endif
+# endif
+#endif
+
+#ifndef __ASSEMBLER__
+/* GCC understands weak symbols and aliases; use its interface where
+ possible, instead of embedded assembly language. */
+
+/* Define ALIASNAME as a strong alias for NAME. */
+# define strong_alias(name, aliasname) _strong_alias(name, aliasname)
+# define _strong_alias(name, aliasname) \
+ extern __typeof (name) aliasname __attribute__ ((alias (#name)));
+
+/* This comes between the return type and function name in
+ a function definition to make that definition weak. */
+# define weak_function __attribute__ ((weak))
+# define weak_const_function __attribute__ ((weak, __const__))
+
+# ifdef HAVE_WEAK_SYMBOLS
+
+/* Define ALIASNAME as a weak alias for NAME.
+ If weak aliases are not available, this defines a strong alias. */
+# define weak_alias(name, aliasname) _weak_alias (name, aliasname)
+# define _weak_alias(name, aliasname) \
+ extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
+
+/* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */
+# define weak_extern(symbol) _weak_extern (weak symbol)
+# define _weak_extern(expr) _Pragma (#expr)
+
+# else
+
+# define weak_alias(name, aliasname) strong_alias(name, aliasname)
+# define weak_extern(symbol) /* Nothing. */
+
+# endif
+
+#else /* __ASSEMBLER__ */
+
+# ifdef HAVE_ASM_SET_DIRECTIVE
+# ifdef HAVE_ASM_GLOBAL_DOT_NAME
+# define strong_alias(original, alias) \
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original) ASM_LINE_SEP \
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
+ .set C_SYMBOL_DOT_NAME (alias),C_SYMBOL_DOT_NAME (original)
+# define strong_data_alias(original, alias) \
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original)
+# else
+# define strong_alias(original, alias) \
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original)
+# define strong_data_alias(original, alias) strong_alias(original, alias)
+# endif
+# else
+# ifdef HAVE_ASM_GLOBAL_DOT_NAME
+# define strong_alias(original, alias) \
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP \
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
+ C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
+# define strong_data_alias(original, alias) \
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
+# else
+# define strong_alias(original, alias) \
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
+# define strong_data_alias(original, alias) strong_alias(original, alias)
+# endif
+# endif
+
+# ifdef HAVE_WEAK_SYMBOLS
+# ifdef HAVE_ASM_WEAKEXT_DIRECTIVE
+# ifdef HAVE_ASM_GLOBAL_DOT_NAME
+# define weak_alias(original, alias) \
+ .weakext C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original) ASM_LINE_SEP \
+ .weakext C_SYMBOL_DOT_NAME (alias), C_SYMBOL_DOT_NAME (original)
+# else
+# define weak_alias(original, alias) \
+ .weakext C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original)
+# endif
+# define weak_extern(symbol) \
+ .weakext C_SYMBOL_NAME (symbol)
+
+# else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
+
+# ifdef HAVE_ASM_SET_DIRECTIVE
+# ifdef HAVE_ASM_GLOBAL_DOT_NAME
+# define weak_alias(original, alias) \
+ .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .set C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original) ASM_LINE_SEP \
+ .weak C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
+ .set C_SYMBOL_DOT_NAME (alias), C_SYMBOL_DOT_NAME (original)
+# else
+# define weak_alias(original, alias) \
+ .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .set C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original)
+# endif
+# else /* ! HAVE_ASM_SET_DIRECTIVE */
+# ifdef HAVE_ASM_GLOBAL_DOT_NAME
+# define weak_alias(original, alias) \
+ .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP \
+ .weak C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
+ C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
+# else
+# define weak_alias(original, alias) \
+ .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
+# endif
+# endif
+# define weak_extern(symbol) \
+ .weak C_SYMBOL_NAME (symbol)
+
+# endif /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
+
+# else /* ! HAVE_WEAK_SYMBOLS */
+
+# define weak_alias(original, alias) strong_alias(original, alias)
+# define weak_extern(symbol) /* Nothing */
+# endif /* ! HAVE_WEAK_SYMBOLS */
+
+#endif /* __ASSEMBLER__ */
+
+/* On some platforms we can make internal function calls (i.e., calls of
+ functions not exported) a bit faster by using a different calling
+ convention. */
+#ifndef internal_function
+# define internal_function /* empty */
+#endif
+
+/* We want the .gnu.warning.SYMBOL section to be unallocated. */
+#define __make_section_unallocated(section_string) \
+ __asm__ (".section " section_string "\n\t.previous");
+
+/* Tacking on "\n#APP\n\t#" to the section name makes gcc put it's bogus
+ section attributes on what looks like a comment to the assembler. */
+#ifdef __sparc__ //HAVE_SECTION_QUOTES
+# define __sec_comment "\"\n#APP\n\t#\""
+#else
+# define __sec_comment "\n#APP\n\t#"
+#endif
+
+/* When a reference to SYMBOL is encountered, the linker will emit a
+ warning message MSG. */
+#define link_warning(symbol, msg) \
+ __make_section_unallocated (".gnu.warning." #symbol) \
+ static const char __evoke_link_warning_##symbol[] \
+ __attribute__ ((used, section (".gnu.warning." #symbol __sec_comment))) \
+ = msg;
+
+/* Handling on non-exported internal names. We have to do this only
+ for shared code. */
+#ifdef SHARED
+# define INTUSE(name) name##_internal
+# define INTDEF(name) strong_alias (name, name##_internal)
+# define INTVARDEF(name) \
+ _INTVARDEF (name, name##_internal)
+# if defined HAVE_VISIBILITY_ATTRIBUTE
+# define _INTVARDEF(name, aliasname) \
+ extern __typeof (name) aliasname __attribute__ ((alias (#name), \
+ visibility ("hidden")));
+# else
+# define _INTVARDEF(name, aliasname) \
+ extern __typeof (name) aliasname __attribute__ ((alias (#name)));
+# endif
+# define INTDEF2(name, newname) strong_alias (name, newname##_internal)
+# define INTVARDEF2(name, newname) _INTVARDEF (name, newname##_internal)
+#else
+# define INTUSE(name) name
+# define INTDEF(name)
+# define INTVARDEF(name)
+# define INTDEF2(name, newname)
+# define INTVARDEF2(name, newname)
+#endif
+
+/* The following macros are used for PLT bypassing within libc.so
+ (and if needed other libraries similarly).
+ First of all, you need to have the function prototyped somewhere,
+ say in foo/foo.h:
+
+ int foo (int __bar);
+
+ If calls to foo within libc.so should always go to foo defined in libc.so,
+ then in include/foo.h you add:
+
+ libc_hidden_proto (foo)
+
+ line and after the foo function definition:
+
+ int foo (int __bar)
+ {
+ return __bar;
+ }
+ libc_hidden_def (foo)
+
+ or
+
+ int foo (int __bar)
+ {
+ return __bar;
+ }
+ libc_hidden_weak (foo)
+
+ Similarly for global data. If references to foo within libc.so should
+ always go to foo defined in libc.so, then in include/foo.h you add:
+
+ libc_hidden_proto (foo)
+
+ line and after foo's definition:
+
+ int foo = INITIAL_FOO_VALUE;
+ libc_hidden_data_def (foo)
+
+ or
+
+ int foo = INITIAL_FOO_VALUE;
+ libc_hidden_data_weak (foo)
+
+ If foo is normally just an alias (strong or weak) to some other function,
+ you should use the normal strong_alias first, then add libc_hidden_def
+ or libc_hidden_weak:
+
+ int baz (int __bar)
+ {
+ return __bar;
+ }
+ strong_alias (baz, foo)
+ libc_hidden_weak (foo)
+
+ If the function should be internal to multiple objects, say ld.so and
+ libc.so, the best way is to use:
+
+ #if !defined NOT_IN_libc || defined IS_IN_rtld
+ hidden_proto (foo)
+ #endif
+
+ in include/foo.h and the normal macros at all function definitions
+ depending on what DSO they belong to.
+
+ If versioned_symbol macro is used to define foo,
+ libc_hidden_ver macro should be used, as in:
+
+ int __real_foo (int __bar)
+ {
+ return __bar;
+ }
+ versioned_symbol (libc, __real_foo, foo, GLIBC_2_1);
+ libc_hidden_ver (__real_foo, foo) */
+
+/* uClibc specific (the above comment was copied from glibc):
+ * a. when ppc64 will be supported, we need changes to support:
+ * strong_data_alias (used by asm hidden_data_def)
+ * b. libc_hidden_proto(foo) should be added after the header having foo's prototype
+ * or after extern foo... to all source files that should use the internal version
+ * of foo within libc, even to the file defining foo itself, libc_hidden_def does
+ * not hide __GI_foo itself, although the name suggests it (hiding is done exclusively
+ * by libc_hidden_proto). The reasoning to have it after the header w/ foo's prototype is
+ * to get first the __REDIRECT from original header and then create the __GI_foo alias
+ * c. no versioning support, hidden[_data]_ver are noop
+ * d. hidden_def() in asm is _hidden_strong_alias (not strong_alias) */
+
+/* Arrange to hide uClibc internals */
+#if (defined __GNUC__ && \
+ (defined __GNUC_MINOR__ && ( __GNUC__ >= 3 && __GNUC_MINOR__ >= 3 ) \
+ || __GNUC__ >= 4)) || defined __ICC
+# define attribute_hidden __attribute__ ((visibility ("hidden")))
+# define __hidden_proto_hiddenattr(attrs...) __attribute__ ((visibility ("hidden"), ##attrs))
+#else
+# define attribute_hidden
+# define __hidden_proto_hiddenattr(attrs...)
+#endif
+
+#if /*!defined STATIC &&*/ !defined __BCC__
+# ifndef __ASSEMBLER__
+# define hidden_proto(name, attrs...) __hidden_proto (name, __GI_##name, ##attrs)
+# define __hidden_proto(name, internal, attrs...) \
+ extern __typeof (name) name __asm__ (__hidden_asmname (#internal)) \
+ __hidden_proto_hiddenattr (attrs);
+# define __hidden_asmname(name) __hidden_asmname1 (__USER_LABEL_PREFIX__, name)
+# define __hidden_asmname1(prefix, name) __hidden_asmname2(prefix, name)
+# define __hidden_asmname2(prefix, name) #prefix name
+# define __hidden_ver1(local, internal, name) \
+ extern __typeof (name) __EI_##name __asm__(__hidden_asmname (#internal)); \
+ extern __typeof (name) __EI_##name __attribute__((alias (__hidden_asmname1 (,#local))))
+# define hidden_ver(local, name) __hidden_ver1(local, __GI_##name, name);
+# define hidden_data_ver(local, name) hidden_ver(local, name)
+# define hidden_def(name) __hidden_ver1(__GI_##name, name, name);
+# define hidden_data_def(name) hidden_def(name)
+# define hidden_weak(name) \
+ __hidden_ver1(__GI_##name, name, name) __attribute__((weak));
+# define hidden_data_weak(name) hidden_weak(name)
+
+# else /* __ASSEMBLER__ */
+# ifdef HAVE_ASM_SET_DIRECTIVE
+# ifdef HAVE_ASM_GLOBAL_DOT_NAME
+# define _hidden_strong_alias(original, alias) \
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original) ASM_LINE_SEP \
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
+ .hidden C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
+ .set C_SYMBOL_DOT_NAME (alias),C_SYMBOL_DOT_NAME (original)
+# else
+# define _hidden_strong_alias(original, alias) \
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original)
+# endif
+# else
+# ifdef HAVE_ASM_GLOBAL_DOT_NAME
+# define _hidden_strong_alias(original, alias) \
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP \
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
+ .hidden C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
+ C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
+# else
+# define _hidden_strong_alias(original, alias) \
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
+# endif
+# endif
+
+# ifdef HAVE_ASM_GLOBAL_DOT_NAME
+# define _hidden_weak_alias(original, alias) \
+ .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .hidden C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
+ weak_alias(original, alias)
+# else
+# define _hidden_weak_alias(original, alias) \
+ .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ weak_alias(original, alias)
+# endif
+
+/* For assembly, we need to do the opposite of what we do in C:
+ in assembly gcc __REDIRECT stuff is not in place, so functions
+ are defined by its normal name and we need to create the
+ __GI_* alias to it, in C __REDIRECT causes the function definition
+ to use __GI_* name and we need to add alias to the real name.
+ There is no reason to use hidden_weak over hidden_def in assembly,
+ but we provide it for consistency with the C usage.
+ hidden_proto doesn't make sense for assembly but the equivalent
+ is to call via the HIDDEN_JUMPTARGET macro instead of JUMPTARGET. */
+# define hidden_def(name) _hidden_strong_alias (name, __GI_##name)
+# define hidden_weak(name) _hidden_weak_alias (name, __GI_##name)
+# define hidden_ver(local, name) strong_alias (local, __GI_##name)
+# define hidden_data_def(name) _hidden_strong_alias (name, __GI_##name)
+# define hidden_data_weak(name) _hidden_weak_alias (name, __GI_##name)
+# define hidden_data_ver(local, name) strong_data_alias (local, __GI_##name)
+# ifdef HAVE_ASM_GLOBAL_DOT_NAME
+# define HIDDEN_JUMPTARGET(name) .__GI_##name
+# else
+# define HIDDEN_JUMPTARGET(name) __GI_##name
+# endif
+# endif /* __ASSEMBLER__ */
+#else /* SHARED */
+# ifndef __ASSEMBLER__
+# define hidden_proto(name, attrs...)
+# else
+# define HIDDEN_JUMPTARGET(name) name
+# endif /* Not __ASSEMBLER__ */
+# define hidden_weak(name)
+# define hidden_def(name)
+# define hidden_ver(local, name)
+# define hidden_data_weak(name)
+# define hidden_data_def(name)
+# define hidden_data_ver(local, name)
+#endif /* SHARED */
+
+/* uClibc does not support versioning yet. */
+#define versioned_symbol(lib, local, symbol, version) /* weak_alias(local, symbol) */
+#undef hidden_ver
+#define hidden_ver(local, name) /* strong_alias(local, __GI_##name) */
+#undef hidden_data_ver
+#define hidden_data_ver(local, name) /* strong_alias(local,__GI_##name) */
+
+#if !defined NOT_IN_libc
+# define libc_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libc_hidden_def(name) hidden_def (name)
+# define libc_hidden_weak(name) hidden_weak (name)
+# define libc_hidden_ver(local, name) hidden_ver (local, name)
+# define libc_hidden_data_def(name) hidden_data_def (name)
+# define libc_hidden_data_weak(name) hidden_data_weak (name)
+# define libc_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libc_hidden_proto(name, attrs...)
+# define libc_hidden_def(name)
+# define libc_hidden_weak(name)
+# define libc_hidden_ver(local, name)
+# define libc_hidden_data_def(name)
+# define libc_hidden_data_weak(name)
+# define libc_hidden_data_ver(local, name)
+#endif
+
+#if defined NOT_IN_libc && defined IS_IN_rtld
+# define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define rtld_hidden_def(name) hidden_def (name)
+# define rtld_hidden_weak(name) hidden_weak (name)
+# define rtld_hidden_ver(local, name) hidden_ver (local, name)
+# define rtld_hidden_data_def(name) hidden_data_def (name)
+# define rtld_hidden_data_weak(name) hidden_data_weak (name)
+# define rtld_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define rtld_hidden_proto(name, attrs...)
+# define rtld_hidden_def(name)
+# define rtld_hidden_weak(name)
+# define rtld_hidden_ver(local, name)
+# define rtld_hidden_data_def(name)
+# define rtld_hidden_data_weak(name)
+# define rtld_hidden_data_ver(local, name)
+#endif
+
+#if defined NOT_IN_libc && defined IS_IN_libm
+# define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libm_hidden_def(name) hidden_def (name)
+# define libm_hidden_weak(name) hidden_weak (name)
+# define libm_hidden_ver(local, name) hidden_ver (local, name)
+# define libm_hidden_data_def(name) hidden_data_def (name)
+# define libm_hidden_data_weak(name) hidden_data_weak (name)
+# define libm_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libm_hidden_proto(name, attrs...)
+# define libm_hidden_def(name)
+# define libm_hidden_weak(name)
+# define libm_hidden_ver(local, name)
+# define libm_hidden_data_def(name)
+# define libm_hidden_data_weak(name)
+# define libm_hidden_data_ver(local, name)
+#endif
+
+#if defined NOT_IN_libc && defined IS_IN_libresolv
+# define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libresolv_hidden_def(name) hidden_def (name)
+# define libresolv_hidden_weak(name) hidden_weak (name)
+# define libresolv_hidden_ver(local, name) hidden_ver (local, name)
+# define libresolv_hidden_data_def(name) hidden_data_def (name)
+# define libresolv_hidden_data_weak(name) hidden_data_weak (name)
+# define libresolv_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libresolv_hidden_proto(name, attrs...)
+# define libresolv_hidden_def(name)
+# define libresolv_hidden_weak(name)
+# define libresolv_hidden_ver(local, name)
+# define libresolv_hidden_data_def(name)
+# define libresolv_hidden_data_weak(name)
+# define libresolv_hidden_data_ver(local, name)
+#endif
+
+#if defined NOT_IN_libc && defined IS_IN_librt
+# define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define librt_hidden_def(name) hidden_def (name)
+# define librt_hidden_weak(name) hidden_weak (name)
+# define librt_hidden_ver(local, name) hidden_ver (local, name)
+# define librt_hidden_data_def(name) hidden_data_def (name)
+# define librt_hidden_data_weak(name) hidden_data_weak (name)
+# define librt_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define librt_hidden_proto(name, attrs...)
+# define librt_hidden_def(name)
+# define librt_hidden_weak(name)
+# define librt_hidden_ver(local, name)
+# define librt_hidden_data_def(name)
+# define librt_hidden_data_weak(name)
+# define librt_hidden_data_ver(local, name)
+#endif
+
+#if defined NOT_IN_libc && defined IS_IN_libdl
+# define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libdl_hidden_def(name) hidden_def (name)
+# define libdl_hidden_weak(name) hidden_weak (name)
+# define libdl_hidden_ver(local, name) hidden_ver (local, name)
+# define libdl_hidden_data_def(name) hidden_data_def (name)
+# define libdl_hidden_data_weak(name) hidden_data_weak (name)
+# define libdl_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libdl_hidden_proto(name, attrs...)
+# define libdl_hidden_def(name)
+# define libdl_hidden_weak(name)
+# define libdl_hidden_ver(local, name)
+# define libdl_hidden_data_def(name)
+# define libdl_hidden_data_weak(name)
+# define libdl_hidden_data_ver(local, name)
+#endif
+
+#if defined NOT_IN_libc && defined IS_IN_libintl
+# define libintl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libintl_hidden_def(name) hidden_def (name)
+# define libintl_hidden_weak(name) hidden_weak (name)
+# define libintl_hidden_ver(local, name) hidden_ver (local, name)
+# define libintl_hidden_data_def(name) hidden_data_def (name)
+# define libintl_hidden_data_weak(name) hidden_data_weak (name)
+# define libintl_hidden_data_ver(local, name) hidden_data_ver(local, name)
+#else
+# define libintl_hidden_proto(name, attrs...)
+# define libintl_hidden_def(name)
+# define libintl_hidden_weak(name)
+# define libintl_hidden_ver(local, name)
+# define libintl_hidden_data_def(name)
+# define libintl_hidden_data_weak(name)
+# define libintl_hidden_data_ver(local, name)
+#endif
+
+#if defined NOT_IN_libc && defined IS_IN_libnsl
+# define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libnsl_hidden_def(name) hidden_def (name)
+# define libnsl_hidden_weak(name) hidden_weak (name)
+# define libnsl_hidden_ver(local, name) hidden_ver (local, name)
+# define libnsl_hidden_data_def(name) hidden_data_def (name)
+# define libnsl_hidden_data_weak(name) hidden_data_weak (name)
+# define libnsl_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libnsl_hidden_proto(name, attrs...)
+# define libnsl_hidden_def(name)
+# define libnsl_hidden_weak(name)
+# define libnsl_hidden_ver(local, name)
+# define libnsl_hidden_data_def(name)
+# define libnsl_hidden_data_weak(name)
+# define libnsl_hidden_data_ver(local, name)
+#endif
+
+#if defined NOT_IN_libc && defined IS_IN_libutil
+# define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libutil_hidden_def(name) hidden_def (name)
+# define libutil_hidden_weak(name) hidden_weak (name)
+# define libutil_hidden_ver(local, name) hidden_ver (local, name)
+# define libutil_hidden_data_def(name) hidden_data_def (name)
+# define libutil_hidden_data_weak(name) hidden_data_weak (name)
+# define libutil_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libutil_hidden_proto(name, attrs...)
+# define libutil_hidden_def(name)
+# define libutil_hidden_weak(name)
+# define libutil_hidden_ver(local, name)
+# define libutil_hidden_data_def(name)
+# define libutil_hidden_data_weak(name)
+# define libutil_hidden_data_ver(local, name)
+#endif
+
+#if defined NOT_IN_libc && defined IS_IN_libcrypt
+# define libcrypt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libcrypt_hidden_def(name) hidden_def (name)
+# define libcrypt_hidden_weak(name) hidden_weak (name)
+# define libcrypt_hidden_ver(local, name) hidden_ver (local, name)
+# define libcrypt_hidden_data_def(name) hidden_data_def (name)
+# define libcrypt_hidden_data_weak(name) hidden_data_weak (name)
+# define libcrypt_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libcrypt_hidden_proto(name, attrs...)
+# define libcrypt_hidden_def(name)
+# define libcrypt_hidden_weak(name)
+# define libcrypt_hidden_ver(local, name)
+# define libcrypt_hidden_data_def(name)
+# define libcrypt_hidden_data_weak(name)
+# define libcrypt_hidden_data_ver(local, name)
+#endif
+
+#if defined NOT_IN_libc && defined IS_IN_libpthread
+# define libpthread_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libpthread_hidden_def(name) hidden_def (name)
+# define libpthread_hidden_weak(name) hidden_weak (name)
+# define libpthread_hidden_ver(local, name) hidden_ver (local, name)
+# define libpthread_hidden_data_def(name) hidden_data_def (name)
+# define libpthread_hidden_data_weak(name) hidden_data_weak (name)
+# define libpthread_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libpthread_hidden_proto(name, attrs...)
+# define libpthread_hidden_def(name)
+# define libpthread_hidden_weak(name)
+# define libpthread_hidden_ver(local, name)
+# define libpthread_hidden_data_def(name)
+# define libpthread_hidden_data_weak(name)
+# define libpthread_hidden_data_ver(local, name)
+#endif
+
+#endif /* libc-symbols.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/libgen.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/libgen.h
new file mode 100644
index 0000000..b252543
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/libgen.h
@@ -0,0 +1,40 @@
+/* Copyright (C) 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _LIBGEN_H
+#define _LIBGEN_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Return directory part of PATH or "." if none is available. */
+extern char *dirname (char *__path) __THROW;
+
+/* Return final component of PATH.
+
+ This is the weird XPG version of this function. It sometimes will
+ modify its argument. Therefore we normally use the GNU version (in
+ <string.h>) and only if this header is included make the XPG
+ version available under the real name. */
+extern char *__xpg_basename (char *__path) __THROW;
+#define basename __xpg_basename
+
+__END_DECLS
+
+#endif /* libgen.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/limits.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/limits.h
new file mode 100644
index 0000000..45cd6f2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/limits.h
@@ -0,0 +1,153 @@
+/* Copyright (C) 1991, 92, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.10/5.2.4.2.1 Sizes of integer types <limits.h>
+ */
+
+#ifndef _LIBC_LIMITS_H_
+#define _LIBC_LIMITS_H_ 1
+
+#include <features.h>
+
+
+/* Maximum length of any multibyte character in any locale.
+ We define this value here since the gcc header does not define
+ the correct value. */
+#define MB_LEN_MAX 16
+
+
+/* If we are not using GNU CC we have to define all the symbols ourself.
+ Otherwise use gcc's definitions (see below). */
+#if !defined __GNUC__ || __GNUC__ < 2
+
+/* We only protect from multiple inclusion here, because all the other
+ #include's protect themselves, and in GCC 2 we may #include_next through
+ multiple copies of this file before we get to GCC's. */
+# ifndef _LIMITS_H
+# define _LIMITS_H 1
+
+#include <bits/wordsize.h>
+
+/* We don't have #include_next.
+ Define ANSI <limits.h> for standard 32-bit words. */
+
+/* These assume 8-bit `char's, 16-bit `short int's,
+ and 32-bit `int's and `long int's. */
+
+/* Number of bits in a `char'. */
+# define CHAR_BIT 8
+
+/* Minimum and maximum values a `signed char' can hold. */
+# define SCHAR_MIN (-128)
+# define SCHAR_MAX 127
+
+/* Maximum value an `unsigned char' can hold. (Minimum is 0.) */
+# define UCHAR_MAX 255
+
+/* Minimum and maximum values a `char' can hold. */
+# ifdef __CHAR_UNSIGNED__
+# define CHAR_MIN 0
+# define CHAR_MAX UCHAR_MAX
+# else
+# define CHAR_MIN SCHAR_MIN
+# define CHAR_MAX SCHAR_MAX
+# endif
+
+/* Minimum and maximum values a `signed short int' can hold. */
+# define SHRT_MIN (-32768)
+# define SHRT_MAX 32767
+
+/* Maximum value an `unsigned short int' can hold. (Minimum is 0.) */
+# define USHRT_MAX 65535
+
+/* Minimum and maximum values a `signed int' can hold. */
+# define INT_MIN (-INT_MAX - 1)
+# define INT_MAX 2147483647
+
+/* Maximum value an `unsigned int' can hold. (Minimum is 0.) */
+# define UINT_MAX 4294967295U
+
+/* Minimum and maximum values a `signed long int' can hold. */
+# if __WORDSIZE == 64
+# define LONG_MAX 9223372036854775807L
+# else
+# define LONG_MAX 2147483647L
+# endif
+# define LONG_MIN (-LONG_MAX - 1L)
+
+/* Maximum value an `unsigned long int' can hold. (Minimum is 0.) */
+# if __WORDSIZE == 64
+# define ULONG_MAX 18446744073709551615UL
+# else
+# define ULONG_MAX 4294967295UL
+# endif
+
+# ifdef __USE_ISOC99
+
+/* Minimum and maximum values a `signed long long int' can hold. */
+# define LLONG_MAX 9223372036854775807LL
+# define LLONG_MIN (-LLONG_MAX - 1LL)
+
+/* Maximum value an `unsigned long long int' can hold. (Minimum is 0.) */
+# define ULLONG_MAX 18446744073709551615ULL
+
+# endif /* ISO C99 */
+
+# endif /* limits.h */
+#endif /* GCC 2. */
+
+#endif /* !_LIBC_LIMITS_H_ */
+
+ /* Get the compiler's limits.h, which defines almost all the ISO constants.
+
+ We put this #include_next outside the double inclusion check because
+ it should be possible to include this file more than once and still get
+ the definitions from gcc's header. */
+#if defined __GNUC__ && !defined _GCC_LIMITS_H_
+/* `_GCC_LIMITS_H_' is what GCC's file defines. */
+# include_next <limits.h>
+
+/* The <limits.h> files in some gcc versions don't define LLONG_MIN,
+ LLONG_MAX, and ULLONG_MAX. Instead only the values gcc defined for
+ ages are available. */
+# ifdef __USE_ISOC99
+# ifndef LLONG_MIN
+# define LLONG_MIN LONG_LONG_MIN
+# endif
+# ifndef LLONG_MAX
+# define LLONG_MAX LONG_LONG_MAX
+# endif
+# ifndef ULLONG_MAX
+# define ULLONG_MAX ULONG_LONG_MAX
+# endif
+# endif
+#endif
+
+#ifdef __USE_POSIX
+/* POSIX adds things to <limits.h>. */
+# include <bits/posix1_lim.h>
+#endif
+
+#ifdef __USE_POSIX2
+# include <bits/posix2_lim.h>
+#endif
+
+#ifdef __USE_XOPEN
+# include <bits/xopen_lim.h>
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/link.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/link.h
new file mode 100644
index 0000000..b69dcda
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/link.h
@@ -0,0 +1,238 @@
+/* Data structure for communication from the run-time dynamic linker for
+ loaded ELF shared objects.
+ Copyright (C) 1995-2001, 2004, 2005, 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _LINK_H
+#define _LINK_H 1
+
+#include <features.h>
+#include <elf.h>
+#include <dlfcn.h>
+#include <sys/types.h>
+#if defined _LIBC && defined __UCLIBC_HAS_THREADS_NATIVE__
+#include <tls.h>
+#endif
+
+/* We use this macro to refer to ELF types independent of the native wordsize.
+ `ElfW(TYPE)' is used in place of `Elf32_TYPE' or `Elf64_TYPE'. */
+#define ElfW(type) _ElfW (Elf, __ELF_NATIVE_CLASS, type)
+#define _ElfW(e,w,t) _ElfW_1 (e, w, _##t)
+#define _ElfW_1(e,w,t) e##w##t
+
+#include <bits/elfclass.h> /* Defines __ELF_NATIVE_CLASS. */
+
+/* Rendezvous structure used by the run-time dynamic linker to communicate
+ details of shared object loading to the debugger. If the executable's
+ dynamic section has a DT_DEBUG element, the run-time linker sets that
+ element's value to the address where this structure can be found. */
+
+struct r_debug
+ {
+ int r_version; /* Version number for this protocol. */
+
+ struct link_map *r_map; /* Head of the chain of loaded objects. */
+
+ /* This is the address of a function internal to the run-time linker,
+ that will always be called when the linker begins to map in a
+ library or unmap it, and again when the mapping change is complete.
+ The debugger can set a breakpoint at this address if it wants to
+ notice shared object mapping changes. */
+ ElfW(Addr) r_brk;
+ enum
+ {
+ /* This state value describes the mapping change taking place when
+ the `r_brk' address is called. */
+ RT_CONSISTENT, /* Mapping change is complete. */
+ RT_ADD, /* Beginning to add a new object. */
+ RT_DELETE /* Beginning to remove an object mapping. */
+ } r_state;
+
+ ElfW(Addr) r_ldbase; /* Base address the linker is loaded at. */
+ };
+
+/* This is the instance of that structure used by the dynamic linker. */
+extern struct r_debug _r_debug;
+
+/* This symbol refers to the "dynamic structure" in the `.dynamic' section
+ of whatever module refers to `_DYNAMIC'. So, to find its own
+ `struct r_debug', a program could do:
+ for (dyn = _DYNAMIC; dyn->d_tag != DT_NULL; ++dyn)
+ if (dyn->d_tag == DT_DEBUG)
+ r_debug = (struct r_debug *) dyn->d_un.d_ptr;
+ */
+extern ElfW(Dyn) _DYNAMIC[];
+
+#ifdef __FDPIC__
+# include <bits/elf-fdpic.h>
+#endif
+
+/* Structure describing a loaded shared object. The `l_next' and `l_prev'
+ members form a chain of all the shared objects loaded at startup.
+
+ These data structures exist in space used by the run-time dynamic linker;
+ modifying them may have disastrous results. */
+
+struct link_map
+ {
+ /* These first few members are part of the protocol with the debugger.
+ This is the same format used in SVR4. */
+
+#ifdef __FDPIC__
+ struct elf32_fdpic_loadaddr l_addr;
+#else
+ ElfW(Addr) l_addr; /* Base address shared object is loaded at. */
+#endif
+ char *l_name; /* Absolute file name object was found in. */
+ ElfW(Dyn) *l_ld; /* Dynamic section of the shared object. */
+ struct link_map *l_next, *l_prev; /* Chain of loaded objects. */
+
+#ifdef USE_TLS
+ /* Thread-local storage related info. */
+
+ /* Start of the initialization image. */
+ void *l_tls_initimage;
+ /* Size of the initialization image. */
+ size_t l_tls_initimage_size;
+ /* Size of the TLS block. */
+ size_t l_tls_blocksize;
+ /* Alignment requirement of the TLS block. */
+ size_t l_tls_align;
+ /* Offset of first byte module alignment. */
+ size_t l_tls_firstbyte_offset;
+# ifndef NO_TLS_OFFSET
+# define NO_TLS_OFFSET 0
+# endif
+ /* For objects present at startup time: offset in the static TLS block. */
+ ptrdiff_t l_tls_offset;
+ /* Index of the module in the dtv array. */
+ size_t l_tls_modid;
+ /* Nonzero if _dl_init_static_tls should be called for this module */
+ unsigned int l_need_tls_init:1;
+#endif
+ };
+
+#ifdef __USE_GNU
+
+#if 0
+/* Version numbers for la_version handshake interface. */
+#define LAV_CURRENT 1
+
+/* Activity types signaled through la_activity. */
+enum
+ {
+ LA_ACT_CONSISTENT, /* Link map consistent again. */
+ LA_ACT_ADD, /* New object will be added. */
+ LA_ACT_DELETE /* Objects will be removed. */
+ };
+
+/* Values representing origin of name for dynamic loading. */
+enum
+ {
+ LA_SER_ORIG = 0x01, /* Original name. */
+ LA_SER_LIBPATH = 0x02, /* Directory from LD_LIBRARY_PATH. */
+ LA_SER_RUNPATH = 0x04, /* Directory from RPATH/RUNPATH. */
+ LA_SER_CONFIG = 0x08, /* Found through ldconfig. */
+ LA_SER_DEFAULT = 0x40, /* Default directory. */
+ LA_SER_SECURE = 0x80 /* Unused. */
+ };
+
+/* Values for la_objopen return value. */
+enum
+ {
+ LA_FLG_BINDTO = 0x01, /* Audit symbols bound to this object. */
+ LA_FLG_BINDFROM = 0x02 /* Audit symbols bound from this object. */
+ };
+
+/* Values for la_symbind flags parameter. */
+enum
+ {
+ LA_SYMB_NOPLTENTER = 0x01, /* la_pltenter will not be called. */
+ LA_SYMB_NOPLTEXIT = 0x02, /* la_pltexit will not be called. */
+ LA_SYMB_STRUCTCALL = 0x04, /* Return value is a structure. */
+ LA_SYMB_DLSYM = 0x08, /* Binding due to dlsym call. */
+ LA_SYMB_ALTVALUE = 0x10 /* Value has been changed by a previous
+ la_symbind call. */
+ };
+#endif
+
+struct dl_phdr_info
+ {
+#ifdef __FDPIC__
+ struct elf32_fdpic_loadaddr dlpi_addr;
+#else
+ ElfW(Addr) dlpi_addr;
+#endif
+ const char *dlpi_name;
+ const ElfW(Phdr) *dlpi_phdr;
+ ElfW(Half) dlpi_phnum;
+
+#if 0
+ /* Note: Following members were introduced after the first
+ version of this structure was available. Check the SIZE
+ argument passed to the dl_iterate_phdr callback to determine
+ whether or not each later member is available. */
+
+ /* Incremented when a new object may have been added. */
+ unsigned long long int dlpi_adds;
+ /* Incremented when an object may have been removed. */
+ unsigned long long int dlpi_subs;
+
+ /* If there is a PT_TLS segment, its module ID as used in
+ TLS relocations, else zero. */
+ size_t dlpi_tls_modid;
+
+ /* The address of the calling thread's instance of this module's
+ PT_TLS segment, if it has one and it has been allocated
+ in the calling thread, otherwise a null pointer. */
+ void *dlpi_tls_data;
+#endif
+ };
+
+__BEGIN_DECLS
+
+extern int dl_iterate_phdr (int (*__callback) (struct dl_phdr_info *,
+ size_t, void *),
+ void *__data);
+
+
+#if 0
+/* Prototypes for the ld.so auditing interfaces. These are not
+ defined anywhere in ld.so but instead have to be provided by the
+ auditing DSO. */
+extern unsigned int la_version (unsigned int __version);
+extern void la_activity (uintptr_t *__cookie, unsigned int __flag);
+extern char *la_objsearch (const char *__name, uintptr_t *__cookie,
+ unsigned int __flag);
+extern unsigned int la_objopen (struct link_map *__map, Lmid_t __lmid,
+ uintptr_t *__cookie);
+extern void la_preinit (uintptr_t *__cookie);
+extern uintptr_t la_symbind32 (Elf32_Sym *__sym, unsigned int __ndx,
+ uintptr_t *__refcook, uintptr_t *__defcook,
+ unsigned int *__flags, const char *__symname);
+extern uintptr_t la_symbind64 (Elf64_Sym *__sym, unsigned int __ndx,
+ uintptr_t *__refcook, uintptr_t *__defcook,
+ unsigned int *__flags, const char *__symname);
+extern unsigned int la_objclose (uintptr_t *__cookie);
+#endif
+
+__END_DECLS
+
+#endif
+
+#endif /* link.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/..install.cmd
new file mode 100644
index 0000000..0bc52bb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux mips acct.h adb.h adfs_fs.h affs_hardblocks.h agpgart.h aio_abi.h apm_bios.h arcfb.h atalk.h atm.h atm_eni.h atm_he.h atm_idt77105.h atm_nicstar.h atm_tcp.h atm_zatm.h atmapi.h atmarp.h atmbr2684.h atmclip.h atmdev.h atmioc.h atmlec.h atmmpc.h atmppp.h atmsap.h atmsvc.h audit.h auto_fs.h auto_fs4.h auxvec.h ax25.h b1lli.h baycom.h bfs_fs.h binfmts.h blkpg.h blktrace_api.h bpqether.h bsg.h can.h capability.h capi.h cciss_ioctl.h cdk.h cdrom.h cgroupstats.h chio.h cm4000_cs.h cn_proc.h coda.h coda_psdev.h coff.h comstats.h connector.h const.h cramfs_fs.h cuda.h cyclades.h cycx_cfm.h dcbnl.h dccp.h dlm.h dlm_device.h dlm_netlink.h dlm_plock.h dlmconstants.h dm-ioctl.h dn.h dqblk_xfs.h edd.h efs_fs_sb.h elf-em.h elf-fdpic.h elf.h elfcore.h errno.h errqueue.h ethtool.h eventpoll.h ext2_fs.h fadvise.h falloc.h fb.h fcntl.h fd.h fdreg.h fib_rules.h fiemap.h filter.h firewire-cdev.h firewire-constants.h flat.h fs.h fuse.h futex.h gameport.h gen_stats.h generic_serial.h genetlink.h gfs2_ondisk.h gigaset_dev.h hayesesp.h hdlc.h hdlcdrv.h hdreg.h hid.h hiddev.h hidraw.h hpet.h hysdn_if.h i2c-dev.h i2c.h i2o-dev.h i8k.h icmp.h icmpv6.h if.h if_addr.h if_addrlabel.h if_arcnet.h if_arp.h if_bonding.h if_bridge.h if_cablemodem.h if_ec.h if_eql.h if_ether.h if_fc.h if_fddi.h if_frad.h if_hippi.h if_infiniband.h if_link.h if_ltalk.h if_packet.h if_phonet.h if_plip.h if_ppp.h if_pppol2tp.h if_pppox.h if_slip.h if_strip.h if_tr.h if_tun.h if_tunnel.h if_vlan.h igmp.h in.h in6.h in_route.h inet_diag.h inotify.h input.h ioctl.h ip.h ip6_tunnel.h ip_vs.h ipc.h ipmi.h ipmi_msgdefs.h ipsec.h ipv6.h ipv6_route.h ipx.h irda.h irqnr.h isdn.h isdn_divertif.h isdn_ppp.h isdnif.h iso_fs.h ivtv.h ivtvfb.h ixjuser.h jffs2.h joystick.h kd.h kdev_t.h kernel.h kernelcapi.h keyboard.h keyctl.h limits.h llc.h loop.h lp.h magic.h major.h map_to_7segment.h matroxfb.h mempolicy.h meye.h mii.h minix_fs.h mman.h mmtimer.h mqueue.h mroute.h mroute6.h msdos_fs.h msg.h mtio.h n_r3964.h nbd.h ncp.h ncp_fs.h ncp_mount.h ncp_no.h neighbour.h net.h net_dropmon.h netdevice.h netfilter.h netfilter_arp.h netfilter_bridge.h netfilter_decnet.h netfilter_ipv4.h netfilter_ipv6.h netlink.h netrom.h nfs.h nfs2.h nfs3.h nfs4.h nfs4_mount.h nfs_fs.h nfs_idmap.h nfs_mount.h nfsacl.h nl80211.h nubus.h nvram.h oom.h param.h parport.h patchkey.h pci.h pci_regs.h personality.h pfkeyv2.h pg.h phantom.h phonet.h pkt_cls.h pkt_sched.h pktcdvd.h pmu.h poll.h posix_types.h ppdev.h ppp-comp.h ppp_defs.h prctl.h ptrace.h qnx4_fs.h qnxtypes.h quota.h radeonfb.h random.h raw.h reboot.h reiserfs_fs.h reiserfs_xattr.h resource.h romfs_fs.h rose.h route.h rtc.h rtnetlink.h scc.h sched.h screen_info.h sdla.h selinux_netlink.h sem.h serial.h serial_core.h serial_reg.h serio.h shm.h signal.h signalfd.h smb.h smb_fs.h smb_mount.h smbno.h snmp.h socket.h sockios.h som.h sonet.h sonypi.h sound.h soundcard.h stat.h stddef.h string.h suspend_ioctls.h swab.h synclink.h sysctl.h taskstats.h tcp.h telephony.h termios.h time.h times.h timex.h tiocl.h tipc.h tipc_config.h toshiba.h tty.h types.h udf_fs_i.h udp.h uinput.h uio.h ultrasound.h un.h unistd.h usbdevice_fs.h utime.h utsname.h veth.h videodev.h videodev2.h videotext.h virtio_9p.h virtio_balloon.h virtio_blk.h virtio_config.h virtio_console.h virtio_net.h virtio_pci.h virtio_ring.h virtio_rng.h vt.h wait.h wanrouter.h watchdog.h wimax.h wireless.h x25.h xattr.h xfrm.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux mips version.h; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/acct.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/acct.h
new file mode 100644
index 0000000..caea59d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/acct.h
@@ -0,0 +1,116 @@
+/*
+ * BSD Process Accounting for Linux - Definitions
+ *
+ * Author: Marco van Wieringen (mvw@planets.elm.net)
+ *
+ * This header file contains the definitions needed to implement
+ * BSD-style process accounting. The kernel accounting code and all
+ * user-level programs that try to do something useful with the
+ * process accounting log must include this file.
+ *
+ * Copyright (C) 1995 - 1997 Marco van Wieringen - ELM Consultancy B.V.
+ *
+ */
+
+#ifndef _LINUX_ACCT_H
+#define _LINUX_ACCT_H
+
+#include <linux/types.h>
+
+#include <asm/param.h>
+#include <asm/byteorder.h>
+
+/*
+ * comp_t is a 16-bit "floating" point number with a 3-bit base 8
+ * exponent and a 13-bit fraction.
+ * comp2_t is 24-bit with 5-bit base 2 exponent and 20 bit fraction
+ * (leading 1 not stored).
+ * See linux/kernel/acct.c for the specific encoding systems used.
+ */
+
+typedef __u16 comp_t;
+typedef __u32 comp2_t;
+
+/*
+ * accounting file record
+ *
+ * This structure contains all of the information written out to the
+ * process accounting file whenever a process exits.
+ */
+
+#define ACCT_COMM 16
+
+struct acct
+{
+ char ac_flag; /* Flags */
+ char ac_version; /* Always set to ACCT_VERSION */
+ /* for binary compatibility back until 2.0 */
+ __u16 ac_uid16; /* LSB of Real User ID */
+ __u16 ac_gid16; /* LSB of Real Group ID */
+ __u16 ac_tty; /* Control Terminal */
+ __u32 ac_btime; /* Process Creation Time */
+ comp_t ac_utime; /* User Time */
+ comp_t ac_stime; /* System Time */
+ comp_t ac_etime; /* Elapsed Time */
+ comp_t ac_mem; /* Average Memory Usage */
+ comp_t ac_io; /* Chars Transferred */
+ comp_t ac_rw; /* Blocks Read or Written */
+ comp_t ac_minflt; /* Minor Pagefaults */
+ comp_t ac_majflt; /* Major Pagefaults */
+ comp_t ac_swaps; /* Number of Swaps */
+/* m68k had no padding here. */
+#if !defined(CONFIG_M68K) || !defined(__KERNEL__)
+ __u16 ac_ahz; /* AHZ */
+#endif
+ __u32 ac_exitcode; /* Exitcode */
+ char ac_comm[ACCT_COMM + 1]; /* Command Name */
+ __u8 ac_etime_hi; /* Elapsed Time MSB */
+ __u16 ac_etime_lo; /* Elapsed Time LSB */
+ __u32 ac_uid; /* Real User ID */
+ __u32 ac_gid; /* Real Group ID */
+};
+
+struct acct_v3
+{
+ char ac_flag; /* Flags */
+ char ac_version; /* Always set to ACCT_VERSION */
+ __u16 ac_tty; /* Control Terminal */
+ __u32 ac_exitcode; /* Exitcode */
+ __u32 ac_uid; /* Real User ID */
+ __u32 ac_gid; /* Real Group ID */
+ __u32 ac_pid; /* Process ID */
+ __u32 ac_ppid; /* Parent Process ID */
+ __u32 ac_btime; /* Process Creation Time */
+ float ac_etime; /* Elapsed Time */
+ comp_t ac_utime; /* User Time */
+ comp_t ac_stime; /* System Time */
+ comp_t ac_mem; /* Average Memory Usage */
+ comp_t ac_io; /* Chars Transferred */
+ comp_t ac_rw; /* Blocks Read or Written */
+ comp_t ac_minflt; /* Minor Pagefaults */
+ comp_t ac_majflt; /* Major Pagefaults */
+ comp_t ac_swaps; /* Number of Swaps */
+ char ac_comm[ACCT_COMM]; /* Command Name */
+};
+
+/*
+ * accounting flags
+ */
+ /* bit set when the process ... */
+#define AFORK 0x01 /* ... executed fork, but did not exec */
+#define ASU 0x02 /* ... used super-user privileges */
+#define ACOMPAT 0x04 /* ... used compatibility mode (VAX only not used) */
+#define ACORE 0x08 /* ... dumped core */
+#define AXSIG 0x10 /* ... was killed by a signal */
+
+#ifdef __BIG_ENDIAN
+#define ACCT_BYTEORDER 0x80 /* accounting file is big endian */
+#else
+#define ACCT_BYTEORDER 0x00 /* accounting file is little endian */
+#endif
+
+#define ACCT_VERSION 2
+#define AHZ (HZ)
+
+
+#endif /* _LINUX_ACCT_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/adb.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/adb.h
new file mode 100644
index 0000000..0815025
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/adb.h
@@ -0,0 +1,44 @@
+/*
+ * Definitions for ADB (Apple Desktop Bus) support.
+ */
+#ifndef __ADB_H
+#define __ADB_H
+
+/* ADB commands */
+#define ADB_BUSRESET 0
+#define ADB_FLUSH(id) (0x01 | ((id) << 4))
+#define ADB_WRITEREG(id, reg) (0x08 | (reg) | ((id) << 4))
+#define ADB_READREG(id, reg) (0x0C | (reg) | ((id) << 4))
+
+/* ADB default device IDs (upper 4 bits of ADB command byte) */
+#define ADB_DONGLE 1 /* "software execution control" devices */
+#define ADB_KEYBOARD 2
+#define ADB_MOUSE 3
+#define ADB_TABLET 4
+#define ADB_MODEM 5
+#define ADB_MISC 7 /* maybe a monitor */
+
+#define ADB_RET_OK 0
+#define ADB_RET_TIMEOUT 3
+
+/* The kind of ADB request. The controller may emulate some
+ or all of those CUDA/PMU packet kinds */
+#define ADB_PACKET 0
+#define CUDA_PACKET 1
+#define ERROR_PACKET 2
+#define TIMER_PACKET 3
+#define POWER_PACKET 4
+#define MACIIC_PACKET 5
+#define PMU_PACKET 6
+#define ADB_QUERY 7
+
+/* ADB queries */
+
+/* ADB_QUERY_GETDEVINFO
+ * Query ADB slot for device presence
+ * data[2] = id, rep[0] = orig addr, rep[1] = handler_id
+ */
+#define ADB_QUERY_GETDEVINFO 1
+
+
+#endif /* __ADB_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/adfs_fs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/adfs_fs.h
new file mode 100644
index 0000000..fc9a5a1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/adfs_fs.h
@@ -0,0 +1,44 @@
+#ifndef _ADFS_FS_H
+#define _ADFS_FS_H
+
+#include <linux/types.h>
+#include <linux/magic.h>
+
+/*
+ * Disc Record at disc address 0xc00
+ */
+struct adfs_discrecord {
+ __u8 log2secsize;
+ __u8 secspertrack;
+ __u8 heads;
+ __u8 density;
+ __u8 idlen;
+ __u8 log2bpmb;
+ __u8 skew;
+ __u8 bootoption;
+ __u8 lowsector;
+ __u8 nzones;
+ __le16 zone_spare;
+ __le32 root;
+ __le32 disc_size;
+ __le16 disc_id;
+ __u8 disc_name[10];
+ __le32 disc_type;
+ __le32 disc_size_high;
+ __u8 log2sharesize:4;
+ __u8 unused40:4;
+ __u8 big_flag:1;
+ __u8 unused41:1;
+ __u8 nzones_high;
+ __le32 format_version;
+ __le32 root_size;
+ __u8 unused52[60 - 52];
+};
+
+#define ADFS_DISCRECORD (0xc00)
+#define ADFS_DR_OFFSET (0x1c0)
+#define ADFS_DR_SIZE 60
+#define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3)
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/affs_hardblocks.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/affs_hardblocks.h
new file mode 100644
index 0000000..f1b948c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/affs_hardblocks.h
@@ -0,0 +1,68 @@
+#ifndef AFFS_HARDBLOCKS_H
+#define AFFS_HARDBLOCKS_H
+
+#include <linux/types.h>
+
+/* Just the needed definitions for the RDB of an Amiga HD. */
+
+struct RigidDiskBlock {
+ __u32 rdb_ID;
+ __be32 rdb_SummedLongs;
+ __s32 rdb_ChkSum;
+ __u32 rdb_HostID;
+ __be32 rdb_BlockBytes;
+ __u32 rdb_Flags;
+ __u32 rdb_BadBlockList;
+ __be32 rdb_PartitionList;
+ __u32 rdb_FileSysHeaderList;
+ __u32 rdb_DriveInit;
+ __u32 rdb_Reserved1[6];
+ __u32 rdb_Cylinders;
+ __u32 rdb_Sectors;
+ __u32 rdb_Heads;
+ __u32 rdb_Interleave;
+ __u32 rdb_Park;
+ __u32 rdb_Reserved2[3];
+ __u32 rdb_WritePreComp;
+ __u32 rdb_ReducedWrite;
+ __u32 rdb_StepRate;
+ __u32 rdb_Reserved3[5];
+ __u32 rdb_RDBBlocksLo;
+ __u32 rdb_RDBBlocksHi;
+ __u32 rdb_LoCylinder;
+ __u32 rdb_HiCylinder;
+ __u32 rdb_CylBlocks;
+ __u32 rdb_AutoParkSeconds;
+ __u32 rdb_HighRDSKBlock;
+ __u32 rdb_Reserved4;
+ char rdb_DiskVendor[8];
+ char rdb_DiskProduct[16];
+ char rdb_DiskRevision[4];
+ char rdb_ControllerVendor[8];
+ char rdb_ControllerProduct[16];
+ char rdb_ControllerRevision[4];
+ __u32 rdb_Reserved5[10];
+};
+
+#define IDNAME_RIGIDDISK 0x5244534B /* "RDSK" */
+
+struct PartitionBlock {
+ __be32 pb_ID;
+ __be32 pb_SummedLongs;
+ __s32 pb_ChkSum;
+ __u32 pb_HostID;
+ __be32 pb_Next;
+ __u32 pb_Flags;
+ __u32 pb_Reserved1[2];
+ __u32 pb_DevFlags;
+ __u8 pb_DriveName[32];
+ __u32 pb_Reserved2[15];
+ __be32 pb_Environment[17];
+ __u32 pb_EReserved[15];
+};
+
+#define IDNAME_PARTITION 0x50415254 /* "PART" */
+
+#define RDB_ALLOCATION_LIMIT 16
+
+#endif /* AFFS_HARDBLOCKS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/agpgart.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/agpgart.h
new file mode 100644
index 0000000..c3f95de
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/agpgart.h
@@ -0,0 +1,111 @@
+/*
+ * AGPGART module version 0.99
+ * Copyright (C) 1999 Jeff Hartmann
+ * Copyright (C) 1999 Precision Insight, Inc.
+ * Copyright (C) 1999 Xi Graphics, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
+ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef _AGP_H
+#define _AGP_H 1
+
+#define AGPIOC_BASE 'A'
+#define AGPIOC_INFO _IOR (AGPIOC_BASE, 0, struct agp_info*)
+#define AGPIOC_ACQUIRE _IO (AGPIOC_BASE, 1)
+#define AGPIOC_RELEASE _IO (AGPIOC_BASE, 2)
+#define AGPIOC_SETUP _IOW (AGPIOC_BASE, 3, struct agp_setup*)
+#define AGPIOC_RESERVE _IOW (AGPIOC_BASE, 4, struct agp_region*)
+#define AGPIOC_PROTECT _IOW (AGPIOC_BASE, 5, struct agp_region*)
+#define AGPIOC_ALLOCATE _IOWR(AGPIOC_BASE, 6, struct agp_allocate*)
+#define AGPIOC_DEALLOCATE _IOW (AGPIOC_BASE, 7, int)
+#define AGPIOC_BIND _IOW (AGPIOC_BASE, 8, struct agp_bind*)
+#define AGPIOC_UNBIND _IOW (AGPIOC_BASE, 9, struct agp_unbind*)
+#define AGPIOC_CHIPSET_FLUSH _IO (AGPIOC_BASE, 10)
+
+#define AGP_DEVICE "/dev/agpgart"
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#include <linux/types.h>
+
+struct agp_version {
+ __u16 major;
+ __u16 minor;
+};
+
+typedef struct _agp_info {
+ struct agp_version version; /* version of the driver */
+ __u32 bridge_id; /* bridge vendor/device */
+ __u32 agp_mode; /* mode info of bridge */
+ unsigned long aper_base;/* base of aperture */
+ size_t aper_size; /* size of aperture */
+ size_t pg_total; /* max pages (swap + system) */
+ size_t pg_system; /* max pages (system) */
+ size_t pg_used; /* current pages used */
+} agp_info;
+
+typedef struct _agp_setup {
+ __u32 agp_mode; /* mode info of bridge */
+} agp_setup;
+
+/*
+ * The "prot" down below needs still a "sleep" flag somehow ...
+ */
+typedef struct _agp_segment {
+ __kernel_off_t pg_start; /* starting page to populate */
+ __kernel_size_t pg_count; /* number of pages */
+ int prot; /* prot flags for mmap */
+} agp_segment;
+
+typedef struct _agp_region {
+ __kernel_pid_t pid; /* pid of process */
+ __kernel_size_t seg_count; /* number of segments */
+ struct _agp_segment *seg_list;
+} agp_region;
+
+typedef struct _agp_allocate {
+ int key; /* tag of allocation */
+ __kernel_size_t pg_count;/* number of pages */
+ __u32 type; /* 0 == normal, other devspec */
+ __u32 physical; /* device specific (some devices
+ * need a phys address of the
+ * actual page behind the gatt
+ * table) */
+} agp_allocate;
+
+typedef struct _agp_bind {
+ int key; /* tag of allocation */
+ __kernel_off_t pg_start;/* starting page to populate */
+} agp_bind;
+
+typedef struct _agp_unbind {
+ int key; /* tag of allocation */
+ __u32 priority; /* priority for paging out */
+} agp_unbind;
+
+
+#endif /* _AGP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/aio_abi.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/aio_abi.h
new file mode 100644
index 0000000..2c87316
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/aio_abi.h
@@ -0,0 +1,111 @@
+/* include/linux/aio_abi.h
+ *
+ * Copyright 2000,2001,2002 Red Hat.
+ *
+ * Written by Benjamin LaHaise <bcrl@kvack.org>
+ *
+ * Distribute under the terms of the GPLv2 (see ../../COPYING) or under
+ * the following terms.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation is hereby granted, provided that the above copyright
+ * notice appears in all copies. This software is provided without any
+ * warranty, express or implied. Red Hat makes no representations about
+ * the suitability of this software for any purpose.
+ *
+ * IN NO EVENT SHALL RED HAT BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+ * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
+ * THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF RED HAT HAS BEEN ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * RED HAT DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND
+ * RED HAT HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
+ * ENHANCEMENTS, OR MODIFICATIONS.
+ */
+#ifndef __LINUX__AIO_ABI_H
+#define __LINUX__AIO_ABI_H
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+typedef unsigned long aio_context_t;
+
+enum {
+ IOCB_CMD_PREAD = 0,
+ IOCB_CMD_PWRITE = 1,
+ IOCB_CMD_FSYNC = 2,
+ IOCB_CMD_FDSYNC = 3,
+ /* These two are experimental.
+ * IOCB_CMD_PREADX = 4,
+ * IOCB_CMD_POLL = 5,
+ */
+ IOCB_CMD_NOOP = 6,
+ IOCB_CMD_PREADV = 7,
+ IOCB_CMD_PWRITEV = 8,
+};
+
+/*
+ * Valid flags for the "aio_flags" member of the "struct iocb".
+ *
+ * IOCB_FLAG_RESFD - Set if the "aio_resfd" member of the "struct iocb"
+ * is valid.
+ */
+#define IOCB_FLAG_RESFD (1 << 0)
+
+/* read() from /dev/aio returns these structures. */
+struct io_event {
+ __u64 data; /* the data field from the iocb */
+ __u64 obj; /* what iocb this event came from */
+ __s64 res; /* result code for this event */
+ __s64 res2; /* secondary result */
+};
+
+#if defined(__LITTLE_ENDIAN)
+#define PADDED(x,y) x, y
+#elif defined(__BIG_ENDIAN)
+#define PADDED(x,y) y, x
+#else
+#error edit for your odd byteorder.
+#endif
+
+/*
+ * we always use a 64bit off_t when communicating
+ * with userland. its up to libraries to do the
+ * proper padding and aio_error abstraction
+ */
+
+struct iocb {
+ /* these are internal to the kernel/libc. */
+ __u64 aio_data; /* data to be returned in event's data */
+ __u32 PADDED(aio_key, aio_reserved1);
+ /* the kernel sets aio_key to the req # */
+
+ /* common fields */
+ __u16 aio_lio_opcode; /* see IOCB_CMD_ above */
+ __s16 aio_reqprio;
+ __u32 aio_fildes;
+
+ __u64 aio_buf;
+ __u64 aio_nbytes;
+ __s64 aio_offset;
+
+ /* extra parameters */
+ __u64 aio_reserved2; /* TODO: use this for a (struct sigevent *) */
+
+ /* flags for the "struct iocb" */
+ __u32 aio_flags;
+
+ /*
+ * if the IOCB_FLAG_RESFD flag of "aio_flags" is set, this is an
+ * eventfd to signal AIO readiness to
+ */
+ __u32 aio_resfd;
+}; /* 64 bytes */
+
+#undef IFBIG
+#undef IFLITTLE
+
+#endif /* __LINUX__AIO_ABI_H */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/apm_bios.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/apm_bios.h
new file mode 100644
index 0000000..dee19a2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/apm_bios.h
@@ -0,0 +1,135 @@
+#ifndef _LINUX_APM_H
+#define _LINUX_APM_H
+
+/*
+ * Include file for the interface to an APM BIOS
+ * Copyright 1994-2001 Stephen Rothwell (sfr@canb.auug.org.au)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#include <linux/types.h>
+
+typedef unsigned short apm_event_t;
+typedef unsigned short apm_eventinfo_t;
+
+struct apm_bios_info {
+ __u16 version;
+ __u16 cseg;
+ __u32 offset;
+ __u16 cseg_16;
+ __u16 dseg;
+ __u16 flags;
+ __u16 cseg_len;
+ __u16 cseg_16_len;
+ __u16 dseg_len;
+};
+
+
+/*
+ * Power states
+ */
+#define APM_STATE_READY 0x0000
+#define APM_STATE_STANDBY 0x0001
+#define APM_STATE_SUSPEND 0x0002
+#define APM_STATE_OFF 0x0003
+#define APM_STATE_BUSY 0x0004
+#define APM_STATE_REJECT 0x0005
+#define APM_STATE_OEM_SYS 0x0020
+#define APM_STATE_OEM_DEV 0x0040
+
+#define APM_STATE_DISABLE 0x0000
+#define APM_STATE_ENABLE 0x0001
+
+#define APM_STATE_DISENGAGE 0x0000
+#define APM_STATE_ENGAGE 0x0001
+
+/*
+ * Events (results of Get PM Event)
+ */
+#define APM_SYS_STANDBY 0x0001
+#define APM_SYS_SUSPEND 0x0002
+#define APM_NORMAL_RESUME 0x0003
+#define APM_CRITICAL_RESUME 0x0004
+#define APM_LOW_BATTERY 0x0005
+#define APM_POWER_STATUS_CHANGE 0x0006
+#define APM_UPDATE_TIME 0x0007
+#define APM_CRITICAL_SUSPEND 0x0008
+#define APM_USER_STANDBY 0x0009
+#define APM_USER_SUSPEND 0x000a
+#define APM_STANDBY_RESUME 0x000b
+#define APM_CAPABILITY_CHANGE 0x000c
+
+/*
+ * Error codes
+ */
+#define APM_SUCCESS 0x00
+#define APM_DISABLED 0x01
+#define APM_CONNECTED 0x02
+#define APM_NOT_CONNECTED 0x03
+#define APM_16_CONNECTED 0x05
+#define APM_16_UNSUPPORTED 0x06
+#define APM_32_CONNECTED 0x07
+#define APM_32_UNSUPPORTED 0x08
+#define APM_BAD_DEVICE 0x09
+#define APM_BAD_PARAM 0x0a
+#define APM_NOT_ENGAGED 0x0b
+#define APM_BAD_FUNCTION 0x0c
+#define APM_RESUME_DISABLED 0x0d
+#define APM_NO_ERROR 0x53
+#define APM_BAD_STATE 0x60
+#define APM_NO_EVENTS 0x80
+#define APM_NOT_PRESENT 0x86
+
+/*
+ * APM Device IDs
+ */
+#define APM_DEVICE_BIOS 0x0000
+#define APM_DEVICE_ALL 0x0001
+#define APM_DEVICE_DISPLAY 0x0100
+#define APM_DEVICE_STORAGE 0x0200
+#define APM_DEVICE_PARALLEL 0x0300
+#define APM_DEVICE_SERIAL 0x0400
+#define APM_DEVICE_NETWORK 0x0500
+#define APM_DEVICE_PCMCIA 0x0600
+#define APM_DEVICE_BATTERY 0x8000
+#define APM_DEVICE_OEM 0xe000
+#define APM_DEVICE_OLD_ALL 0xffff
+#define APM_DEVICE_CLASS 0x00ff
+#define APM_DEVICE_MASK 0xff00
+
+
+/*
+ * Battery status
+ */
+#define APM_MAX_BATTERIES 2
+
+/*
+ * APM defined capability bit flags
+ */
+#define APM_CAP_GLOBAL_STANDBY 0x0001
+#define APM_CAP_GLOBAL_SUSPEND 0x0002
+#define APM_CAP_RESUME_STANDBY_TIMER 0x0004 /* Timer resume from standby */
+#define APM_CAP_RESUME_SUSPEND_TIMER 0x0008 /* Timer resume from suspend */
+#define APM_CAP_RESUME_STANDBY_RING 0x0010 /* Resume on Ring fr standby */
+#define APM_CAP_RESUME_SUSPEND_RING 0x0020 /* Resume on Ring fr suspend */
+#define APM_CAP_RESUME_STANDBY_PCMCIA 0x0040 /* Resume on PCMCIA Ring */
+#define APM_CAP_RESUME_SUSPEND_PCMCIA 0x0080 /* Resume on PCMCIA Ring */
+
+/*
+ * ioctl operations
+ */
+#include <linux/ioctl.h>
+
+#define APM_IOC_STANDBY _IO('A', 1)
+#define APM_IOC_SUSPEND _IO('A', 2)
+
+#endif /* LINUX_APM_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/arcfb.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/arcfb.h
new file mode 100644
index 0000000..721e765
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/arcfb.h
@@ -0,0 +1,8 @@
+#ifndef __LINUX_ARCFB_H__
+#define __LINUX_ARCFB_H__
+
+#define FBIO_WAITEVENT _IO('F', 0x88)
+#define FBIO_GETCONTROL2 _IOR('F', 0x89, size_t)
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atalk.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atalk.h
new file mode 100644
index 0000000..801c3e3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atalk.h
@@ -0,0 +1,43 @@
+#ifndef __LINUX_ATALK_H__
+#define __LINUX_ATALK_H__
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+/*
+ * AppleTalk networking structures
+ *
+ * The following are directly referenced from the University Of Michigan
+ * netatalk for compatibility reasons.
+ */
+#define ATPORT_FIRST 1
+#define ATPORT_RESERVED 128
+#define ATPORT_LAST 254 /* 254 is only legal on localtalk */
+#define ATADDR_ANYNET (__u16)0
+#define ATADDR_ANYNODE (__u8)0
+#define ATADDR_ANYPORT (__u8)0
+#define ATADDR_BCAST (__u8)255
+#define DDP_MAXSZ 587
+#define DDP_MAXHOPS 15 /* 4 bits of hop counter */
+
+#define SIOCATALKDIFADDR (SIOCPROTOPRIVATE + 0)
+
+struct atalk_addr {
+ __be16 s_net;
+ __u8 s_node;
+};
+
+struct sockaddr_at {
+ sa_family_t sat_family;
+ __u8 sat_port;
+ struct atalk_addr sat_addr;
+ char sat_zero[8];
+};
+
+struct atalk_netrange {
+ __u8 nr_phase;
+ __be16 nr_firstnet;
+ __be16 nr_lastnet;
+};
+
+#endif /* __LINUX_ATALK_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm.h
new file mode 100644
index 0000000..5e1c36d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm.h
@@ -0,0 +1,241 @@
+/* atm.h - general ATM declarations */
+
+/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
+
+
+/*
+ * WARNING: User-space programs should not #include <linux/atm.h> directly.
+ * Instead, #include <atm.h>
+ */
+
+#ifndef _LINUX_ATM_H
+#define _LINUX_ATM_H
+
+/*
+ * BEGIN_xx and END_xx markers are used for automatic generation of
+ * documentation. Do not change them.
+ */
+
+
+#include <linux/atmapi.h>
+#include <linux/atmsap.h>
+#include <linux/atmioc.h>
+#include <linux/types.h>
+
+
+/* general ATM constants */
+#define ATM_CELL_SIZE 53 /* ATM cell size incl. header */
+#define ATM_CELL_PAYLOAD 48 /* ATM payload size */
+#define ATM_AAL0_SDU 52 /* AAL0 SDU size */
+#define ATM_MAX_AAL34_PDU 65535 /* maximum AAL3/4 PDU payload */
+#define ATM_AAL5_TRAILER 8 /* AAL5 trailer size */
+#define ATM_MAX_AAL5_PDU 65535 /* maximum AAL5 PDU payload */
+#define ATM_MAX_CDV 9999 /* maximum (default) CDV */
+#define ATM_NOT_RSV_VCI 32 /* first non-reserved VCI value */
+
+#define ATM_MAX_VPI 255 /* maximum VPI at the UNI */
+#define ATM_MAX_VPI_NNI 4096 /* maximum VPI at the NNI */
+#define ATM_MAX_VCI 65535 /* maximum VCI */
+
+
+/* "protcol" values for the socket system call */
+#define ATM_NO_AAL 0 /* AAL not specified */
+#define ATM_AAL0 13 /* "raw" ATM cells */
+#define ATM_AAL1 1 /* AAL1 (CBR) */
+#define ATM_AAL2 2 /* AAL2 (VBR) */
+#define ATM_AAL34 3 /* AAL3/4 (data) */
+#define ATM_AAL5 5 /* AAL5 (data) */
+
+/*
+ * socket option name coding functions
+ *
+ * Note that __SO_ENCODE and __SO_LEVEL are somewhat a hack since the
+ * << 22 only reserves 9 bits for the level. On some architectures
+ * SOL_SOCKET is 0xFFFF, so that's a bit of a problem
+ */
+
+#define __SO_ENCODE(l,n,t) ((((l) & 0x1FF) << 22) | ((n) << 16) | \
+ sizeof(t))
+#define __SO_LEVEL_MATCH(c,m) (((c) >> 22) == ((m) & 0x1FF))
+#define __SO_NUMBER(c) (((c) >> 16) & 0x3f)
+#define __SO_SIZE(c) ((c) & 0x3fff)
+
+/*
+ * ATM layer
+ */
+
+#define SO_SETCLP __SO_ENCODE(SOL_ATM,0,int)
+ /* set CLP bit value - TODO */
+#define SO_CIRANGE __SO_ENCODE(SOL_ATM,1,struct atm_cirange)
+ /* connection identifier range; socket must be
+ bound or connected */
+#define SO_ATMQOS __SO_ENCODE(SOL_ATM,2,struct atm_qos)
+ /* Quality of Service setting */
+#define SO_ATMSAP __SO_ENCODE(SOL_ATM,3,struct atm_sap)
+ /* Service Access Point */
+#define SO_ATMPVC __SO_ENCODE(SOL_ATM,4,struct sockaddr_atmpvc)
+ /* "PVC" address (also for SVCs); get only */
+#define SO_MULTIPOINT __SO_ENCODE(SOL_ATM, 5, int)
+ /* make this vc a p2mp */
+
+
+/*
+ * Note @@@: since the socket layers don't really distinguish the control and
+ * the data plane but generally seems to be data plane-centric, any layer is
+ * about equally wrong for the SAP. If you have a better idea about this,
+ * please speak up ...
+ */
+
+
+/* ATM cell header (for AAL0) */
+
+/* BEGIN_CH */
+#define ATM_HDR_GFC_MASK 0xf0000000
+#define ATM_HDR_GFC_SHIFT 28
+#define ATM_HDR_VPI_MASK 0x0ff00000
+#define ATM_HDR_VPI_SHIFT 20
+#define ATM_HDR_VCI_MASK 0x000ffff0
+#define ATM_HDR_VCI_SHIFT 4
+#define ATM_HDR_PTI_MASK 0x0000000e
+#define ATM_HDR_PTI_SHIFT 1
+#define ATM_HDR_CLP 0x00000001
+/* END_CH */
+
+
+/* PTI codings */
+
+/* BEGIN_PTI */
+#define ATM_PTI_US0 0 /* user data cell, congestion not exp, SDU-type 0 */
+#define ATM_PTI_US1 1 /* user data cell, congestion not exp, SDU-type 1 */
+#define ATM_PTI_UCES0 2 /* user data cell, cong. experienced, SDU-type 0 */
+#define ATM_PTI_UCES1 3 /* user data cell, cong. experienced, SDU-type 1 */
+#define ATM_PTI_SEGF5 4 /* segment OAM F5 flow related cell */
+#define ATM_PTI_E2EF5 5 /* end-to-end OAM F5 flow related cell */
+#define ATM_PTI_RSV_RM 6 /* reserved for traffic control/resource mgmt */
+#define ATM_PTI_RSV 7 /* reserved */
+/* END_PTI */
+
+
+/*
+ * The following items should stay in linux/atm.h, which should be linked to
+ * netatm/atm.h
+ */
+
+/* Traffic description */
+
+#define ATM_NONE 0 /* no traffic */
+#define ATM_UBR 1
+#define ATM_CBR 2
+#define ATM_VBR 3
+#define ATM_ABR 4
+#define ATM_ANYCLASS 5 /* compatible with everything */
+
+#define ATM_MAX_PCR -1 /* maximum available PCR */
+
+struct atm_trafprm {
+ unsigned char traffic_class; /* traffic class (ATM_UBR, ...) */
+ int max_pcr; /* maximum PCR in cells per second */
+ int pcr; /* desired PCR in cells per second */
+ int min_pcr; /* minimum PCR in cells per second */
+ int max_cdv; /* maximum CDV in microseconds */
+ int max_sdu; /* maximum SDU in bytes */
+ /* extra params for ABR */
+ unsigned int icr; /* Initial Cell Rate (24-bit) */
+ unsigned int tbe; /* Transient Buffer Exposure (24-bit) */
+ unsigned int frtt : 24; /* Fixed Round Trip Time (24-bit) */
+ unsigned int rif : 4; /* Rate Increment Factor (4-bit) */
+ unsigned int rdf : 4; /* Rate Decrease Factor (4-bit) */
+ unsigned int nrm_pres :1; /* nrm present bit */
+ unsigned int trm_pres :1; /* rm present bit */
+ unsigned int adtf_pres :1; /* adtf present bit */
+ unsigned int cdf_pres :1; /* cdf present bit*/
+ unsigned int nrm :3; /* Max # of Cells for each forward RM cell (3-bit) */
+ unsigned int trm :3; /* Time between forward RM cells (3-bit) */
+ unsigned int adtf :10; /* ACR Decrease Time Factor (10-bit) */
+ unsigned int cdf :3; /* Cutoff Decrease Factor (3-bit) */
+ unsigned int spare :9; /* spare bits */
+};
+
+struct atm_qos {
+ struct atm_trafprm txtp; /* parameters in TX direction */
+ struct atm_trafprm rxtp __ATM_API_ALIGN;
+ /* parameters in RX direction */
+ unsigned char aal __ATM_API_ALIGN;
+};
+
+/* PVC addressing */
+
+#define ATM_ITF_ANY -1 /* "magic" PVC address values */
+#define ATM_VPI_ANY -1
+#define ATM_VCI_ANY -1
+#define ATM_VPI_UNSPEC -2
+#define ATM_VCI_UNSPEC -2
+
+
+struct sockaddr_atmpvc {
+ unsigned short sap_family; /* address family, AF_ATMPVC */
+ struct { /* PVC address */
+ short itf; /* ATM interface */
+ short vpi; /* VPI (only 8 bits at UNI) */
+ int vci; /* VCI (only 16 bits at UNI) */
+ } sap_addr __ATM_API_ALIGN; /* PVC address */
+};
+
+/* SVC addressing */
+
+#define ATM_ESA_LEN 20 /* ATM End System Address length */
+#define ATM_E164_LEN 12 /* maximum E.164 number length */
+
+#define ATM_AFI_DCC 0x39 /* DCC ATM Format */
+#define ATM_AFI_ICD 0x47 /* ICD ATM Format */
+#define ATM_AFI_E164 0x45 /* E.164 ATM Format */
+#define ATM_AFI_LOCAL 0x49 /* Local ATM Format */
+
+#define ATM_AFI_DCC_GROUP 0xBD /* DCC ATM Group Format */
+#define ATM_AFI_ICD_GROUP 0xC5 /* ICD ATM Group Format */
+#define ATM_AFI_E164_GROUP 0xC3 /* E.164 ATM Group Format */
+#define ATM_AFI_LOCAL_GROUP 0xC7 /* Local ATM Group Format */
+
+#define ATM_LIJ_NONE 0 /* no leaf-initiated join */
+#define ATM_LIJ 1 /* request joining */
+#define ATM_LIJ_RPJ 2 /* set to root-prompted join */
+#define ATM_LIJ_NJ 3 /* set to network join */
+
+
+struct sockaddr_atmsvc {
+ unsigned short sas_family; /* address family, AF_ATMSVC */
+ struct { /* SVC address */
+ unsigned char prv[ATM_ESA_LEN];/* private ATM address */
+ char pub[ATM_E164_LEN+1]; /* public address (E.164) */
+ /* unused addresses must be bzero'ed */
+ char lij_type; /* role in LIJ call; one of ATM_LIJ* */
+ __u32 lij_id; /* LIJ call identifier */
+ } sas_addr __ATM_API_ALIGN; /* SVC address */
+};
+
+
+static __inline__ int atmsvc_addr_in_use(struct sockaddr_atmsvc addr)
+{
+ return *addr.sas_addr.prv || *addr.sas_addr.pub;
+}
+
+
+static __inline__ int atmpvc_addr_in_use(struct sockaddr_atmpvc addr)
+{
+ return addr.sap_addr.itf || addr.sap_addr.vpi || addr.sap_addr.vci;
+}
+
+
+/*
+ * Some stuff for linux/sockios.h
+ */
+
+struct atmif_sioc {
+ int number;
+ int length;
+ void *arg;
+};
+
+
+typedef unsigned short atm_backend_t;
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_eni.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_eni.h
new file mode 100644
index 0000000..34f3179
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_eni.h
@@ -0,0 +1,23 @@
+/* atm_eni.h - Driver-specific declarations of the ENI driver (for use by
+ driver-specific utilities) */
+
+/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
+
+
+#ifndef LINUX_ATM_ENI_H
+#define LINUX_ATM_ENI_H
+
+#include <linux/atmioc.h>
+
+
+struct eni_multipliers {
+ int tx,rx; /* values are in percent and must be > 100 */
+};
+
+
+#define ENI_MEMDUMP _IOW('a',ATMIOC_SARPRV,struct atmif_sioc)
+ /* printk memory map */
+#define ENI_SETMULT _IOW('a',ATMIOC_SARPRV+7,struct atmif_sioc)
+ /* set buffer multipliers */
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_he.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_he.h
new file mode 100644
index 0000000..2a7713b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_he.h
@@ -0,0 +1,20 @@
+/* atm_he.h */
+
+#ifndef LINUX_ATM_HE_H
+#define LINUX_ATM_HE_H
+
+#include <linux/atmioc.h>
+
+#define HE_GET_REG _IOW('a', ATMIOC_SARPRV, struct atmif_sioc)
+
+#define HE_REGTYPE_PCI 1
+#define HE_REGTYPE_RCM 2
+#define HE_REGTYPE_TCM 3
+#define HE_REGTYPE_MBOX 4
+
+struct he_ioctl_reg {
+ unsigned addr, val;
+ char type;
+};
+
+#endif /* LINUX_ATM_HE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_idt77105.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_idt77105.h
new file mode 100644
index 0000000..8b72400
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_idt77105.h
@@ -0,0 +1,28 @@
+/* atm_idt77105.h - Driver-specific declarations of the IDT77105 driver (for
+ * use by driver-specific utilities) */
+
+/* Written 1999 by Greg Banks <gnb@linuxfan.com>. Copied from atm_suni.h. */
+
+
+#ifndef LINUX_ATM_IDT77105_H
+#define LINUX_ATM_IDT77105_H
+
+#include <linux/types.h>
+#include <linux/atmioc.h>
+#include <linux/atmdev.h>
+
+/*
+ * Structure for IDT77105_GETSTAT and IDT77105_GETSTATZ ioctls.
+ * Pointed to by `arg' in atmif_sioc.
+ */
+struct idt77105_stats {
+ __u32 symbol_errors; /* wire symbol errors */
+ __u32 tx_cells; /* cells transmitted */
+ __u32 rx_cells; /* cells received */
+ __u32 rx_hec_errors; /* Header Error Check errors on receive */
+};
+
+#define IDT77105_GETSTAT _IOW('a',ATMIOC_PHYPRV+2,struct atmif_sioc) /* get stats */
+#define IDT77105_GETSTATZ _IOW('a',ATMIOC_PHYPRV+3,struct atmif_sioc) /* get stats and zero */
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_nicstar.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_nicstar.h
new file mode 100644
index 0000000..577b79f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_nicstar.h
@@ -0,0 +1,53 @@
+/******************************************************************************
+ *
+ * atm_nicstar.h
+ *
+ * Driver-specific declarations for use by NICSTAR driver specific utils.
+ *
+ * Author: Rui Prior
+ *
+ * (C) INESC 1998
+ *
+ ******************************************************************************/
+
+
+#ifndef LINUX_ATM_NICSTAR_H
+#define LINUX_ATM_NICSTAR_H
+
+/* Note: non-kernel programs including this file must also include
+ * sys/types.h for struct timeval
+ */
+
+#include <linux/atmapi.h>
+#include <linux/atmioc.h>
+
+#define NS_GETPSTAT _IOWR('a',ATMIOC_SARPRV+1,struct atmif_sioc)
+ /* get pool statistics */
+#define NS_SETBUFLEV _IOW('a',ATMIOC_SARPRV+2,struct atmif_sioc)
+ /* set buffer level markers */
+#define NS_ADJBUFLEV _IO('a',ATMIOC_SARPRV+3)
+ /* adjust buffer level */
+
+typedef struct buf_nr
+{
+ unsigned min;
+ unsigned init;
+ unsigned max;
+}buf_nr;
+
+
+typedef struct pool_levels
+{
+ int buftype;
+ int count; /* (At least for now) only used in NS_GETPSTAT */
+ buf_nr level;
+} pool_levels;
+
+/* type must be one of the following: */
+#define NS_BUFTYPE_SMALL 1
+#define NS_BUFTYPE_LARGE 2
+#define NS_BUFTYPE_HUGE 3
+#define NS_BUFTYPE_IOVEC 4
+
+
+#endif /* LINUX_ATM_NICSTAR_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_tcp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_tcp.h
new file mode 100644
index 0000000..952e6ab
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_tcp.h
@@ -0,0 +1,61 @@
+/* atm_tcp.h - Driver-specific declarations of the ATMTCP driver (for use by
+ driver-specific utilities) */
+
+/* Written 1997-2000 by Werner Almesberger, EPFL LRC/ICA */
+
+
+#ifndef LINUX_ATM_TCP_H
+#define LINUX_ATM_TCP_H
+
+#include <linux/atmapi.h>
+#include <linux/atm.h>
+#include <linux/atmioc.h>
+#include <linux/types.h>
+
+
+/*
+ * All values in struct atmtcp_hdr are in network byte order
+ */
+
+struct atmtcp_hdr {
+ __u16 vpi;
+ __u16 vci;
+ __u32 length; /* ... of data part */
+};
+
+/*
+ * All values in struct atmtcp_command are in host byte order
+ */
+
+#define ATMTCP_HDR_MAGIC (~0) /* this length indicates a command */
+#define ATMTCP_CTRL_OPEN 1 /* request/reply */
+#define ATMTCP_CTRL_CLOSE 2 /* request/reply */
+
+struct atmtcp_control {
+ struct atmtcp_hdr hdr; /* must be first */
+ int type; /* message type; both directions */
+ atm_kptr_t vcc; /* both directions */
+ struct sockaddr_atmpvc addr; /* suggested value from kernel */
+ struct atm_qos qos; /* both directions */
+ int result; /* to kernel only */
+} __ATM_API_ALIGN;
+
+/*
+ * Field usage:
+ * Messge type dir. hdr.v?i type addr qos vcc result
+ * ----------- ---- ------- ---- ---- --- --- ------
+ * OPEN K->D Y Y Y Y Y 0
+ * OPEN D->K - Y Y Y Y Y
+ * CLOSE K->D - - Y - Y 0
+ * CLOSE D->K - - - - Y Y
+ */
+
+#define SIOCSIFATMTCP _IO('a',ATMIOC_ITF) /* set ATMTCP mode */
+#define ATMTCP_CREATE _IO('a',ATMIOC_ITF+14) /* create persistent ATMTCP
+ interface */
+#define ATMTCP_REMOVE _IO('a',ATMIOC_ITF+15) /* destroy persistent ATMTCP
+ interface */
+
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_zatm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_zatm.h
new file mode 100644
index 0000000..10f0fa2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atm_zatm.h
@@ -0,0 +1,52 @@
+/* atm_zatm.h - Driver-specific declarations of the ZATM driver (for use by
+ driver-specific utilities) */
+
+/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
+
+
+#ifndef LINUX_ATM_ZATM_H
+#define LINUX_ATM_ZATM_H
+
+/*
+ * Note: non-kernel programs including this file must also include
+ * sys/types.h for struct timeval
+ */
+
+#include <linux/atmapi.h>
+#include <linux/atmioc.h>
+
+#define ZATM_GETPOOL _IOW('a',ATMIOC_SARPRV+1,struct atmif_sioc)
+ /* get pool statistics */
+#define ZATM_GETPOOLZ _IOW('a',ATMIOC_SARPRV+2,struct atmif_sioc)
+ /* get statistics and zero */
+#define ZATM_SETPOOL _IOW('a',ATMIOC_SARPRV+3,struct atmif_sioc)
+ /* set pool parameters */
+
+struct zatm_pool_info {
+ int ref_count; /* free buffer pool usage counters */
+ int low_water,high_water; /* refill parameters */
+ int rqa_count,rqu_count; /* queue condition counters */
+ int offset,next_off; /* alignment optimizations: offset */
+ int next_cnt,next_thres; /* repetition counter and threshold */
+};
+
+struct zatm_pool_req {
+ int pool_num; /* pool number */
+ struct zatm_pool_info info; /* actual information */
+};
+
+struct zatm_t_hist {
+ struct timeval real; /* real (wall-clock) time */
+ struct timeval expected; /* expected real time */
+};
+
+
+#define ZATM_OAM_POOL 0 /* free buffer pool for OAM cells */
+#define ZATM_AAL0_POOL 1 /* free buffer pool for AAL0 cells */
+#define ZATM_AAL5_POOL_BASE 2 /* first AAL5 free buffer pool */
+#define ZATM_LAST_POOL ZATM_AAL5_POOL_BASE+10 /* max. 64 kB */
+
+#define ZATM_TIMER_HISTORY_SIZE 16 /* number of timer adjustments to
+ record; must be 2^n */
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmapi.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmapi.h
new file mode 100644
index 0000000..8fe54d9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmapi.h
@@ -0,0 +1,29 @@
+/* atmapi.h - ATM API user space/kernel compatibility */
+
+/* Written 1999,2000 by Werner Almesberger, EPFL ICA */
+
+
+#ifndef _LINUX_ATMAPI_H
+#define _LINUX_ATMAPI_H
+
+#if defined(__sparc__) || defined(__ia64__)
+/* such alignment is not required on 32 bit sparcs, but we can't
+ figure that we are on a sparc64 while compiling user-space programs. */
+#define __ATM_API_ALIGN __attribute__((aligned(8)))
+#else
+#define __ATM_API_ALIGN
+#endif
+
+
+/*
+ * Opaque type for kernel pointers. Note that _ is never accessed. We need
+ * the struct in order hide the array, so that we can make simple assignments
+ * instead of being forced to use memcpy. It also improves error reporting for
+ * code that still assumes that we're passing unsigned longs.
+ *
+ * Convention: NULL pointers are passed as a field of all zeroes.
+ */
+
+typedef struct { unsigned char _[8]; } __ATM_API_ALIGN atm_kptr_t;
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmarp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmarp.h
new file mode 100644
index 0000000..231f4bd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmarp.h
@@ -0,0 +1,41 @@
+/* atmarp.h - ATM ARP protocol and kernel-demon interface definitions */
+
+/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
+
+
+#ifndef _LINUX_ATMARP_H
+#define _LINUX_ATMARP_H
+
+#include <linux/types.h>
+#include <linux/atmapi.h>
+#include <linux/atmioc.h>
+
+
+#define ATMARP_RETRY_DELAY 30 /* request next resolution or forget
+ NAK after 30 sec - should go into
+ atmclip.h */
+#define ATMARP_MAX_UNRES_PACKETS 5 /* queue that many packets while
+ waiting for the resolver */
+
+
+#define ATMARPD_CTRL _IO('a',ATMIOC_CLIP+1) /* become atmarpd ctrl sock */
+#define ATMARP_MKIP _IO('a',ATMIOC_CLIP+2) /* attach socket to IP */
+#define ATMARP_SETENTRY _IO('a',ATMIOC_CLIP+3) /* fill or hide ARP entry */
+#define ATMARP_ENCAP _IO('a',ATMIOC_CLIP+5) /* change encapsulation */
+
+
+enum atmarp_ctrl_type {
+ act_invalid, /* catch uninitialized structures */
+ act_need, /* need address resolution */
+ act_up, /* interface is coming up */
+ act_down, /* interface is going down */
+ act_change /* interface configuration has changed */
+};
+
+struct atmarp_ctrl {
+ enum atmarp_ctrl_type type; /* message type */
+ int itf_num;/* interface number (if present) */
+ __be32 ip; /* IP address (act_need only) */
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmbr2684.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmbr2684.h
new file mode 100644
index 0000000..fdb2629
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmbr2684.h
@@ -0,0 +1,117 @@
+#ifndef _LINUX_ATMBR2684_H
+#define _LINUX_ATMBR2684_H
+
+#include <linux/types.h>
+#include <linux/atm.h>
+#include <linux/if.h> /* For IFNAMSIZ */
+
+/*
+ * Type of media we're bridging (ethernet, token ring, etc) Currently only
+ * ethernet is supported
+ */
+#define BR2684_MEDIA_ETHERNET (0) /* 802.3 */
+#define BR2684_MEDIA_802_4 (1) /* 802.4 */
+#define BR2684_MEDIA_TR (2) /* 802.5 - token ring */
+#define BR2684_MEDIA_FDDI (3)
+#define BR2684_MEDIA_802_6 (4) /* 802.6 */
+
+ /* used only at device creation: */
+#define BR2684_FLAG_ROUTED (1<<16) /* payload is routed, not bridged */
+
+/*
+ * Is there FCS inbound on this VC? This currently isn't supported.
+ */
+#define BR2684_FCSIN_NO (0)
+#define BR2684_FCSIN_IGNORE (1)
+#define BR2684_FCSIN_VERIFY (2)
+
+/*
+ * Is there FCS outbound on this VC? This currently isn't supported.
+ */
+#define BR2684_FCSOUT_NO (0)
+#define BR2684_FCSOUT_SENDZERO (1)
+#define BR2684_FCSOUT_GENERATE (2)
+
+/*
+ * Does this VC include LLC encapsulation?
+ */
+#define BR2684_ENCAPS_VC (0) /* VC-mux */
+#define BR2684_ENCAPS_LLC (1)
+#define BR2684_ENCAPS_AUTODETECT (2) /* Unsuported */
+
+/*
+ * Is this VC bridged or routed?
+ */
+
+#define BR2684_PAYLOAD_ROUTED (0)
+#define BR2684_PAYLOAD_BRIDGED (1)
+
+/*
+ * This is for the ATM_NEWBACKENDIF call - these are like socket families:
+ * the first element of the structure is the backend number and the rest
+ * is per-backend specific
+ */
+struct atm_newif_br2684 {
+ atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
+ int media; /* BR2684_MEDIA_*, flags in upper bits */
+ char ifname[IFNAMSIZ];
+ int mtu;
+};
+
+/*
+ * This structure is used to specify a br2684 interface - either by a
+ * positive integer (returned by ATM_NEWBACKENDIF) or the interfaces name
+ */
+#define BR2684_FIND_BYNOTHING (0)
+#define BR2684_FIND_BYNUM (1)
+#define BR2684_FIND_BYIFNAME (2)
+struct br2684_if_spec {
+ int method; /* BR2684_FIND_* */
+ union {
+ char ifname[IFNAMSIZ];
+ int devnum;
+ } spec;
+};
+
+/*
+ * This is for the ATM_SETBACKEND call - these are like socket families:
+ * the first element of the structure is the backend number and the rest
+ * is per-backend specific
+ */
+struct atm_backend_br2684 {
+ atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
+ struct br2684_if_spec ifspec;
+ int fcs_in; /* BR2684_FCSIN_* */
+ int fcs_out; /* BR2684_FCSOUT_* */
+ int fcs_auto; /* 1: fcs_{in,out} disabled if no FCS rx'ed */
+ int encaps; /* BR2684_ENCAPS_* */
+ int has_vpiid; /* 1: use vpn_id - Unsupported */
+ __u8 vpn_id[7];
+ int send_padding; /* unsupported */
+ int min_size; /* we will pad smaller packets than this */
+};
+
+/*
+ * The BR2684_SETFILT ioctl is an experimental mechanism for folks
+ * terminating a large number of IP-only vcc's. When netfilter allows
+ * efficient per-if in/out filters, this support will be removed
+ */
+struct br2684_filter {
+ __be32 prefix; /* network byte order */
+ __be32 netmask; /* 0 = disable filter */
+};
+
+struct br2684_filter_set {
+ struct br2684_if_spec ifspec;
+ struct br2684_filter filter;
+};
+
+enum br2684_payload {
+ p_routed = BR2684_PAYLOAD_ROUTED,
+ p_bridged = BR2684_PAYLOAD_BRIDGED,
+};
+
+#define BR2684_SETFILT _IOW( 'a', ATMIOC_BACKEND + 0, \
+ struct br2684_filter_set)
+
+#endif /* _LINUX_ATMBR2684_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmclip.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmclip.h
new file mode 100644
index 0000000..02c94c4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmclip.h
@@ -0,0 +1,21 @@
+/* atmclip.h - Classical IP over ATM */
+
+/* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */
+
+
+#ifndef LINUX_ATMCLIP_H
+#define LINUX_ATMCLIP_H
+
+#include <linux/sockios.h>
+#include <linux/atmioc.h>
+
+
+#define RFC1483LLC_LEN 8 /* LLC+OUI+PID = 8 */
+#define RFC1626_MTU 9180 /* RFC1626 default MTU */
+
+#define CLIP_DEFAULT_IDLETIMER 1200 /* 20 minutes, see RFC1755 */
+#define CLIP_CHECK_INTERVAL 10 /* check every ten seconds */
+
+#define SIOCMKCLIP _IO('a',ATMIOC_CLIP) /* create IP interface */
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmdev.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmdev.h
new file mode 100644
index 0000000..3351a4b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmdev.h
@@ -0,0 +1,215 @@
+/* atmdev.h - ATM device driver declarations and various related items */
+
+/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
+
+
+#ifndef LINUX_ATMDEV_H
+#define LINUX_ATMDEV_H
+
+
+#include <linux/atmapi.h>
+#include <linux/atm.h>
+#include <linux/atmioc.h>
+
+
+#define ESI_LEN 6
+
+#define ATM_OC3_PCR (155520000/270*260/8/53)
+ /* OC3 link rate: 155520000 bps
+ SONET overhead: /270*260 (9 section, 1 path)
+ bits per cell: /8/53
+ max cell rate: 353207.547 cells/sec */
+#define ATM_25_PCR ((25600000/8-8000)/54)
+ /* 25 Mbps ATM cell rate (59111) */
+#define ATM_OC12_PCR (622080000/1080*1040/8/53)
+ /* OC12 link rate: 622080000 bps
+ SONET overhead: /1080*1040
+ bits per cell: /8/53
+ max cell rate: 1412830.188 cells/sec */
+#define ATM_DS3_PCR (8000*12)
+ /* DS3: 12 cells in a 125 usec time slot */
+
+
+#define __AAL_STAT_ITEMS \
+ __HANDLE_ITEM(tx); /* TX okay */ \
+ __HANDLE_ITEM(tx_err); /* TX errors */ \
+ __HANDLE_ITEM(rx); /* RX okay */ \
+ __HANDLE_ITEM(rx_err); /* RX errors */ \
+ __HANDLE_ITEM(rx_drop); /* RX out of memory */
+
+struct atm_aal_stats {
+#define __HANDLE_ITEM(i) int i
+ __AAL_STAT_ITEMS
+#undef __HANDLE_ITEM
+};
+
+
+struct atm_dev_stats {
+ struct atm_aal_stats aal0;
+ struct atm_aal_stats aal34;
+ struct atm_aal_stats aal5;
+} __ATM_API_ALIGN;
+
+
+#define ATM_GETLINKRATE _IOW('a',ATMIOC_ITF+1,struct atmif_sioc)
+ /* get link rate */
+#define ATM_GETNAMES _IOW('a',ATMIOC_ITF+3,struct atm_iobuf)
+ /* get interface names (numbers) */
+#define ATM_GETTYPE _IOW('a',ATMIOC_ITF+4,struct atmif_sioc)
+ /* get interface type name */
+#define ATM_GETESI _IOW('a',ATMIOC_ITF+5,struct atmif_sioc)
+ /* get interface ESI */
+#define ATM_GETADDR _IOW('a',ATMIOC_ITF+6,struct atmif_sioc)
+ /* get itf's local ATM addr. list */
+#define ATM_RSTADDR _IOW('a',ATMIOC_ITF+7,struct atmif_sioc)
+ /* reset itf's ATM address list */
+#define ATM_ADDADDR _IOW('a',ATMIOC_ITF+8,struct atmif_sioc)
+ /* add a local ATM address */
+#define ATM_DELADDR _IOW('a',ATMIOC_ITF+9,struct atmif_sioc)
+ /* remove a local ATM address */
+#define ATM_GETCIRANGE _IOW('a',ATMIOC_ITF+10,struct atmif_sioc)
+ /* get connection identifier range */
+#define ATM_SETCIRANGE _IOW('a',ATMIOC_ITF+11,struct atmif_sioc)
+ /* set connection identifier range */
+#define ATM_SETESI _IOW('a',ATMIOC_ITF+12,struct atmif_sioc)
+ /* set interface ESI */
+#define ATM_SETESIF _IOW('a',ATMIOC_ITF+13,struct atmif_sioc)
+ /* force interface ESI */
+#define ATM_ADDLECSADDR _IOW('a', ATMIOC_ITF+14, struct atmif_sioc)
+ /* register a LECS address */
+#define ATM_DELLECSADDR _IOW('a', ATMIOC_ITF+15, struct atmif_sioc)
+ /* unregister a LECS address */
+#define ATM_GETLECSADDR _IOW('a', ATMIOC_ITF+16, struct atmif_sioc)
+ /* retrieve LECS address(es) */
+
+#define ATM_GETSTAT _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc)
+ /* get AAL layer statistics */
+#define ATM_GETSTATZ _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc)
+ /* get AAL layer statistics and zero */
+#define ATM_GETLOOP _IOW('a',ATMIOC_SARCOM+2,struct atmif_sioc)
+ /* get loopback mode */
+#define ATM_SETLOOP _IOW('a',ATMIOC_SARCOM+3,struct atmif_sioc)
+ /* set loopback mode */
+#define ATM_QUERYLOOP _IOW('a',ATMIOC_SARCOM+4,struct atmif_sioc)
+ /* query supported loopback modes */
+#define ATM_SETSC _IOW('a',ATMIOC_SPECIAL+1,int)
+ /* enable or disable single-copy */
+#define ATM_SETBACKEND _IOW('a',ATMIOC_SPECIAL+2,atm_backend_t)
+ /* set backend handler */
+#define ATM_NEWBACKENDIF _IOW('a',ATMIOC_SPECIAL+3,atm_backend_t)
+ /* use backend to make new if */
+#define ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct atm_iobuf)
+ /* add party to p2mp call */
+#ifdef CONFIG_COMPAT
+/* It actually takes struct sockaddr_atmsvc, not struct atm_iobuf */
+#define COMPAT_ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct compat_atm_iobuf)
+#endif
+#define ATM_DROPPARTY _IOW('a', ATMIOC_SPECIAL+5,int)
+ /* drop party from p2mp call */
+
+/*
+ * These are backend handkers that can be set via the ATM_SETBACKEND call
+ * above. In the future we may support dynamic loading of these - for now,
+ * they're just being used to share the ATMIOC_BACKEND ioctls
+ */
+#define ATM_BACKEND_RAW 0
+#define ATM_BACKEND_PPP 1 /* PPPoATM - RFC2364 */
+#define ATM_BACKEND_BR2684 2 /* Bridged RFC1483/2684 */
+
+/* for ATM_GETTYPE */
+#define ATM_ITFTYP_LEN 8 /* maximum length of interface type name */
+
+/*
+ * Loopback modes for ATM_{PHY,SAR}_{GET,SET}LOOP
+ */
+
+/* Point of loopback CPU-->SAR-->PHY-->line--> ... */
+#define __ATM_LM_NONE 0 /* no loop back ^ ^ ^ ^ */
+#define __ATM_LM_AAL 1 /* loop back PDUs --' | | | */
+#define __ATM_LM_ATM 2 /* loop back ATM cells ---' | | */
+/* RESERVED 4 loop back on PHY side ---' */
+#define __ATM_LM_PHY 8 /* loop back bits (digital) ----' | */
+#define __ATM_LM_ANALOG 16 /* loop back the analog signal --------' */
+
+/* Direction of loopback */
+#define __ATM_LM_MKLOC(n) ((n)) /* Local (i.e. loop TX to RX) */
+#define __ATM_LM_MKRMT(n) ((n) << 8) /* Remote (i.e. loop RX to TX) */
+
+#define __ATM_LM_XTLOC(n) ((n) & 0xff)
+#define __ATM_LM_XTRMT(n) (((n) >> 8) & 0xff)
+
+#define ATM_LM_NONE 0 /* no loopback */
+
+#define ATM_LM_LOC_AAL __ATM_LM_MKLOC(__ATM_LM_AAL)
+#define ATM_LM_LOC_ATM __ATM_LM_MKLOC(__ATM_LM_ATM)
+#define ATM_LM_LOC_PHY __ATM_LM_MKLOC(__ATM_LM_PHY)
+#define ATM_LM_LOC_ANALOG __ATM_LM_MKLOC(__ATM_LM_ANALOG)
+
+#define ATM_LM_RMT_AAL __ATM_LM_MKRMT(__ATM_LM_AAL)
+#define ATM_LM_RMT_ATM __ATM_LM_MKRMT(__ATM_LM_ATM)
+#define ATM_LM_RMT_PHY __ATM_LM_MKRMT(__ATM_LM_PHY)
+#define ATM_LM_RMT_ANALOG __ATM_LM_MKRMT(__ATM_LM_ANALOG)
+
+/*
+ * Note: ATM_LM_LOC_* and ATM_LM_RMT_* can be combined, provided that
+ * __ATM_LM_XTLOC(x) <= __ATM_LM_XTRMT(x)
+ */
+
+
+struct atm_iobuf {
+ int length;
+ void *buffer;
+};
+
+/* for ATM_GETCIRANGE / ATM_SETCIRANGE */
+
+#define ATM_CI_MAX -1 /* use maximum range of VPI/VCI */
+
+struct atm_cirange {
+ signed char vpi_bits; /* 1..8, ATM_CI_MAX (-1) for maximum */
+ signed char vci_bits; /* 1..16, ATM_CI_MAX (-1) for maximum */
+};
+
+/* for ATM_SETSC; actually taken from the ATM_VF number space */
+
+#define ATM_SC_RX 1024 /* enable RX single-copy */
+#define ATM_SC_TX 2048 /* enable TX single-copy */
+
+#define ATM_BACKLOG_DEFAULT 32 /* if we get more, we're likely to time out
+ anyway */
+
+/* MF: change_qos (Modify) flags */
+
+#define ATM_MF_IMMED 1 /* Block until change is effective */
+#define ATM_MF_INC_RSV 2 /* Change reservation on increase */
+#define ATM_MF_INC_SHP 4 /* Change shaping on increase */
+#define ATM_MF_DEC_RSV 8 /* Change reservation on decrease */
+#define ATM_MF_DEC_SHP 16 /* Change shaping on decrease */
+#define ATM_MF_BWD 32 /* Set the backward direction parameters */
+
+#define ATM_MF_SET (ATM_MF_INC_RSV | ATM_MF_INC_SHP | ATM_MF_DEC_RSV | \
+ ATM_MF_DEC_SHP | ATM_MF_BWD)
+
+/*
+ * ATM_VS_* are used to express VC state in a human-friendly way.
+ */
+
+#define ATM_VS_IDLE 0 /* VC is not used */
+#define ATM_VS_CONNECTED 1 /* VC is connected */
+#define ATM_VS_CLOSING 2 /* VC is closing */
+#define ATM_VS_LISTEN 3 /* VC is listening for incoming setups */
+#define ATM_VS_INUSE 4 /* VC is in use (registered with atmsigd) */
+#define ATM_VS_BOUND 5 /* VC is bound */
+
+#define ATM_VS2TXT_MAP \
+ "IDLE", "CONNECTED", "CLOSING", "LISTEN", "INUSE", "BOUND"
+
+#define ATM_VF2TXT_MAP \
+ "ADDR", "READY", "PARTIAL", "REGIS", \
+ "RELEASED", "HASQOS", "LISTEN", "META", \
+ "256", "512", "1024", "2048", \
+ "SESSION", "HASSAP", "BOUND", "CLOSE"
+
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmioc.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmioc.h
new file mode 100644
index 0000000..37f67aa
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmioc.h
@@ -0,0 +1,41 @@
+/* atmioc.h - ranges for ATM-related ioctl numbers */
+
+/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
+
+
+/*
+ * See http://icawww1.epfl.ch/linux-atm/magic.html for the complete list of
+ * "magic" ioctl numbers.
+ */
+
+
+#ifndef _LINUX_ATMIOC_H
+#define _LINUX_ATMIOC_H
+
+#include <asm/ioctl.h>
+ /* everybody including atmioc.h will also need _IO{,R,W,WR} */
+
+#define ATMIOC_PHYCOM 0x00 /* PHY device common ioctls, globally unique */
+#define ATMIOC_PHYCOM_END 0x0f
+#define ATMIOC_PHYTYP 0x10 /* PHY dev type ioctls, unique per PHY type */
+#define ATMIOC_PHYTYP_END 0x2f
+#define ATMIOC_PHYPRV 0x30 /* PHY dev private ioctls, unique per driver */
+#define ATMIOC_PHYPRV_END 0x4f
+#define ATMIOC_SARCOM 0x50 /* SAR device common ioctls, globally unique */
+#define ATMIOC_SARCOM_END 0x50
+#define ATMIOC_SARPRV 0x60 /* SAR dev private ioctls, unique per driver */
+#define ATMIOC_SARPRV_END 0x7f
+#define ATMIOC_ITF 0x80 /* Interface ioctls, globally unique */
+#define ATMIOC_ITF_END 0x8f
+#define ATMIOC_BACKEND 0x90 /* ATM generic backend ioctls, u. per backend */
+#define ATMIOC_BACKEND_END 0xaf
+/* 0xb0-0xbf: Reserved for future use */
+#define ATMIOC_AREQUIPA 0xc0 /* Application requested IP over ATM, glob. u. */
+#define ATMIOC_LANE 0xd0 /* LAN Emulation, globally unique */
+#define ATMIOC_MPOA 0xd8 /* MPOA, globally unique */
+#define ATMIOC_CLIP 0xe0 /* Classical IP over ATM control, globally u. */
+#define ATMIOC_CLIP_END 0xef
+#define ATMIOC_SPECIAL 0xf0 /* Special-purpose controls, globally unique */
+#define ATMIOC_SPECIAL_END 0xff
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmlec.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmlec.h
new file mode 100644
index 0000000..39c917f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmlec.h
@@ -0,0 +1,98 @@
+/*
+ * ATM Lan Emulation Daemon driver interface
+ *
+ * Marko Kiiskila <mkiiskila@yahoo.com>
+ */
+
+#ifndef _ATMLEC_H_
+#define _ATMLEC_H_
+
+#include <linux/atmapi.h>
+#include <linux/atmioc.h>
+#include <linux/atm.h>
+#include <linux/if_ether.h>
+#include <linux/types.h>
+
+/* ATM lec daemon control socket */
+#define ATMLEC_CTRL _IO('a', ATMIOC_LANE)
+#define ATMLEC_DATA _IO('a', ATMIOC_LANE+1)
+#define ATMLEC_MCAST _IO('a', ATMIOC_LANE+2)
+
+/* Maximum number of LEC interfaces (tweakable) */
+#define MAX_LEC_ITF 48
+
+/*
+ * From the total of MAX_LEC_ITF, last NUM_TR_DEVS are reserved for Token Ring.
+ * E.g. if MAX_LEC_ITF = 48 and NUM_TR_DEVS = 8, then lec0-lec39 are for
+ * Ethernet ELANs and lec40-lec47 are for Token Ring ELANS.
+ */
+#define NUM_TR_DEVS 8
+
+typedef enum {
+ l_set_mac_addr,
+ l_del_mac_addr,
+ l_svc_setup,
+ l_addr_delete,
+ l_topology_change,
+ l_flush_complete,
+ l_arp_update,
+ l_narp_req, /* LANE2 mandates the use of this */
+ l_config,
+ l_flush_tran_id,
+ l_set_lecid,
+ l_arp_xmt,
+ l_rdesc_arp_xmt,
+ l_associate_req,
+ l_should_bridge /* should we bridge this MAC? */
+} atmlec_msg_type;
+
+#define ATMLEC_MSG_TYPE_MAX l_should_bridge
+
+struct atmlec_config_msg {
+ unsigned int maximum_unknown_frame_count;
+ unsigned int max_unknown_frame_time;
+ unsigned short max_retry_count;
+ unsigned int aging_time;
+ unsigned int forward_delay_time;
+ unsigned int arp_response_time;
+ unsigned int flush_timeout;
+ unsigned int path_switching_delay;
+ unsigned int lane_version; /* LANE2: 1 for LANEv1, 2 for LANEv2 */
+ int mtu;
+ int is_proxy;
+};
+
+struct atmlec_msg {
+ atmlec_msg_type type;
+ int sizeoftlvs; /* LANE2: if != 0, tlvs follow */
+ union {
+ struct {
+ unsigned char mac_addr[ETH_ALEN];
+ unsigned char atm_addr[ATM_ESA_LEN];
+ unsigned int flag; /*
+ * Topology_change flag,
+ * remoteflag, permanent flag,
+ * lecid, transaction id
+ */
+ unsigned int targetless_le_arp; /* LANE2 */
+ unsigned int no_source_le_narp; /* LANE2 */
+ } normal;
+ struct atmlec_config_msg config;
+ struct {
+ __u16 lec_id; /* requestor lec_id */
+ __u32 tran_id; /* transaction id */
+ unsigned char mac_addr[ETH_ALEN]; /* dst mac addr */
+ unsigned char atm_addr[ATM_ESA_LEN]; /* reqestor ATM addr */
+ } proxy; /*
+ * For mapping LE_ARP requests to responses. Filled by
+ * zeppelin, returned by kernel. Used only when proxying
+ */
+ } content;
+} __ATM_API_ALIGN;
+
+struct atmlec_ioc {
+ int dev_num;
+ unsigned char atm_addr[ATM_ESA_LEN];
+ unsigned char receive; /* 1= receive vcc, 0 = send vcc */
+};
+#endif /* _ATMLEC_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmmpc.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmmpc.h
new file mode 100644
index 0000000..2aba578
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmmpc.h
@@ -0,0 +1,126 @@
+#ifndef _ATMMPC_H_
+#define _ATMMPC_H_
+
+#include <linux/atmapi.h>
+#include <linux/atmioc.h>
+#include <linux/atm.h>
+#include <linux/types.h>
+
+#define ATMMPC_CTRL _IO('a', ATMIOC_MPOA)
+#define ATMMPC_DATA _IO('a', ATMIOC_MPOA+1)
+
+#define MPC_SOCKET_INGRESS 1
+#define MPC_SOCKET_EGRESS 2
+
+struct atmmpc_ioc {
+ int dev_num;
+ __be32 ipaddr; /* the IP address of the shortcut */
+ int type; /* ingress or egress */
+};
+
+typedef struct in_ctrl_info {
+ __u8 Last_NHRP_CIE_code;
+ __u8 Last_Q2931_cause_value;
+ __u8 eg_MPC_ATM_addr[ATM_ESA_LEN];
+ __be32 tag;
+ __be32 in_dst_ip; /* IP address this ingress MPC sends packets to */
+ __u16 holding_time;
+ __u32 request_id;
+} in_ctrl_info;
+
+typedef struct eg_ctrl_info {
+ __u8 DLL_header[256];
+ __u8 DH_length;
+ __be32 cache_id;
+ __be32 tag;
+ __be32 mps_ip;
+ __be32 eg_dst_ip; /* IP address to which ingress MPC sends packets */
+ __u8 in_MPC_data_ATM_addr[ATM_ESA_LEN];
+ __u16 holding_time;
+} eg_ctrl_info;
+
+struct mpc_parameters {
+ __u16 mpc_p1; /* Shortcut-Setup Frame Count */
+ __u16 mpc_p2; /* Shortcut-Setup Frame Time */
+ __u8 mpc_p3[8]; /* Flow-detection Protocols */
+ __u16 mpc_p4; /* MPC Initial Retry Time */
+ __u16 mpc_p5; /* MPC Retry Time Maximum */
+ __u16 mpc_p6; /* Hold Down Time */
+} ;
+
+struct k_message {
+ __u16 type;
+ __be32 ip_mask;
+ __u8 MPS_ctrl[ATM_ESA_LEN];
+ union {
+ in_ctrl_info in_info;
+ eg_ctrl_info eg_info;
+ struct mpc_parameters params;
+ } content;
+ struct atm_qos qos;
+} __ATM_API_ALIGN;
+
+struct llc_snap_hdr {
+ /* RFC 1483 LLC/SNAP encapsulation for routed IP PDUs */
+ __u8 dsap; /* Destination Service Access Point (0xAA) */
+ __u8 ssap; /* Source Service Access Point (0xAA) */
+ __u8 ui; /* Unnumbered Information (0x03) */
+ __u8 org[3]; /* Organizational identification (0x000000) */
+ __u8 type[2]; /* Ether type (for IP) (0x0800) */
+};
+
+/* TLVs this MPC recognizes */
+#define TLV_MPOA_DEVICE_TYPE 0x00a03e2a
+
+/* MPOA device types in MPOA Device Type TLV */
+#define NON_MPOA 0
+#define MPS 1
+#define MPC 2
+#define MPS_AND_MPC 3
+
+
+/* MPC parameter defaults */
+
+#define MPC_P1 10 /* Shortcut-Setup Frame Count */
+#define MPC_P2 1 /* Shortcut-Setup Frame Time */
+#define MPC_P3 0 /* Flow-detection Protocols */
+#define MPC_P4 5 /* MPC Initial Retry Time */
+#define MPC_P5 40 /* MPC Retry Time Maximum */
+#define MPC_P6 160 /* Hold Down Time */
+#define HOLDING_TIME_DEFAULT 1200 /* same as MPS-p7 */
+
+/* MPC constants */
+
+#define MPC_C1 2 /* Retry Time Multiplier */
+#define MPC_C2 60 /* Initial Keep-Alive Lifetime */
+
+/* Message types - to MPOA daemon */
+
+#define SND_MPOA_RES_RQST 201
+#define SET_MPS_CTRL_ADDR 202
+#define SND_MPOA_RES_RTRY 203 /* Different type in a retry due to req id */
+#define STOP_KEEP_ALIVE_SM 204
+#define EGRESS_ENTRY_REMOVED 205
+#define SND_EGRESS_PURGE 206
+#define DIE 207 /* tell the daemon to exit() */
+#define DATA_PLANE_PURGE 208 /* Data plane purge because of egress cache hit miss or dead MPS */
+#define OPEN_INGRESS_SVC 209
+
+/* Message types - from MPOA daemon */
+
+#define MPOA_TRIGGER_RCVD 101
+#define MPOA_RES_REPLY_RCVD 102
+#define INGRESS_PURGE_RCVD 103
+#define EGRESS_PURGE_RCVD 104
+#define MPS_DEATH 105
+#define CACHE_IMPOS_RCVD 106
+#define SET_MPC_CTRL_ADDR 107 /* Our MPC's control ATM address */
+#define SET_MPS_MAC_ADDR 108
+#define CLEAN_UP_AND_EXIT 109
+#define SET_MPC_PARAMS 110 /* MPC configuration parameters */
+
+/* Message types - bidirectional */
+
+#define RELOAD 301 /* kill -HUP the daemon for reload */
+
+#endif /* _ATMMPC_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmppp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmppp.h
new file mode 100644
index 0000000..300dcce
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmppp.h
@@ -0,0 +1,24 @@
+/* atmppp.h - RFC2364 PPPoATM */
+
+/* Written 2000 by Mitchell Blank Jr */
+
+#ifndef _LINUX_ATMPPP_H
+#define _LINUX_ATMPPP_H
+
+#include <linux/atm.h>
+
+#define PPPOATM_ENCAPS_AUTODETECT (0)
+#define PPPOATM_ENCAPS_VC (1)
+#define PPPOATM_ENCAPS_LLC (2)
+
+/*
+ * This is for the ATM_SETBACKEND call - these are like socket families:
+ * the first element of the structure is the backend number and the rest
+ * is per-backend specific
+ */
+struct atm_backend_ppp {
+ atm_backend_t backend_num; /* ATM_BACKEND_PPP */
+ int encaps; /* PPPOATM_ENCAPS_* */
+};
+
+#endif /* _LINUX_ATMPPP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmsap.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmsap.h
new file mode 100644
index 0000000..799b104
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmsap.h
@@ -0,0 +1,162 @@
+/* atmsap.h - ATM Service Access Point addressing definitions */
+
+/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
+
+
+#ifndef _LINUX_ATMSAP_H
+#define _LINUX_ATMSAP_H
+
+#include <linux/atmapi.h>
+
+/*
+ * BEGIN_xx and END_xx markers are used for automatic generation of
+ * documentation. Do not change them.
+ */
+
+
+/*
+ * Layer 2 protocol identifiers
+ */
+
+/* BEGIN_L2 */
+#define ATM_L2_NONE 0 /* L2 not specified */
+#define ATM_L2_ISO1745 0x01 /* Basic mode ISO 1745 */
+#define ATM_L2_Q291 0x02 /* ITU-T Q.291 (Rec. I.441) */
+#define ATM_L2_X25_LL 0x06 /* ITU-T X.25, link layer */
+#define ATM_L2_X25_ML 0x07 /* ITU-T X.25, multilink */
+#define ATM_L2_LAPB 0x08 /* Extended LAPB, half-duplex (Rec. T.71) */
+#define ATM_L2_HDLC_ARM 0x09 /* HDLC ARM (ISO/IEC 4335) */
+#define ATM_L2_HDLC_NRM 0x0a /* HDLC NRM (ISO/IEC 4335) */
+#define ATM_L2_HDLC_ABM 0x0b /* HDLC ABM (ISO/IEC 4335) */
+#define ATM_L2_ISO8802 0x0c /* LAN LLC (ISO/IEC 8802/2) */
+#define ATM_L2_X75 0x0d /* ITU-T X.75, SLP */
+#define ATM_L2_Q922 0x0e /* ITU-T Q.922 */
+#define ATM_L2_USER 0x10 /* user-specified */
+#define ATM_L2_ISO7776 0x11 /* ISO 7776 DTE-DTE */
+/* END_L2 */
+
+
+/*
+ * Layer 3 protocol identifiers
+ */
+
+/* BEGIN_L3 */
+#define ATM_L3_NONE 0 /* L3 not specified */
+#define ATM_L3_X25 0x06 /* ITU-T X.25, packet layer */
+#define ATM_L3_ISO8208 0x07 /* ISO/IEC 8208 */
+#define ATM_L3_X223 0x08 /* ITU-T X.223 | ISO/IEC 8878 */
+#define ATM_L3_ISO8473 0x09 /* ITU-T X.233 | ISO/IEC 8473 */
+#define ATM_L3_T70 0x0a /* ITU-T T.70 minimum network layer */
+#define ATM_L3_TR9577 0x0b /* ISO/IEC TR 9577 */
+#define ATM_L3_H310 0x0c /* ITU-T Recommendation H.310 */
+#define ATM_L3_H321 0x0d /* ITU-T Recommendation H.321 */
+#define ATM_L3_USER 0x10 /* user-specified */
+/* END_L3 */
+
+
+/*
+ * High layer identifiers
+ */
+
+/* BEGIN_HL */
+#define ATM_HL_NONE 0 /* HL not specified */
+#define ATM_HL_ISO 0x01 /* ISO */
+#define ATM_HL_USER 0x02 /* user-specific */
+#define ATM_HL_HLP 0x03 /* high layer profile - UNI 3.0 only */
+#define ATM_HL_VENDOR 0x04 /* vendor-specific application identifier */
+/* END_HL */
+
+
+/*
+ * ITU-T coded mode of operation
+ */
+
+/* BEGIN_IMD */
+#define ATM_IMD_NONE 0 /* mode not specified */
+#define ATM_IMD_NORMAL 1 /* normal mode of operation */
+#define ATM_IMD_EXTENDED 2 /* extended mode of operation */
+/* END_IMD */
+
+/*
+ * H.310 code points
+ */
+
+#define ATM_TT_NONE 0 /* terminal type not specified */
+#define ATM_TT_RX 1 /* receive only */
+#define ATM_TT_TX 2 /* send only */
+#define ATM_TT_RXTX 3 /* receive and send */
+
+#define ATM_MC_NONE 0 /* no multiplexing */
+#define ATM_MC_TS 1 /* transport stream (TS) */
+#define ATM_MC_TS_FEC 2 /* transport stream with forward error corr. */
+#define ATM_MC_PS 3 /* program stream (PS) */
+#define ATM_MC_PS_FEC 4 /* program stream with forward error corr. */
+#define ATM_MC_H221 5 /* ITU-T Rec. H.221 */
+
+/*
+ * SAP structures
+ */
+
+#define ATM_MAX_HLI 8 /* maximum high-layer information length */
+
+
+struct atm_blli {
+ unsigned char l2_proto; /* layer 2 protocol */
+ union {
+ struct {
+ unsigned char mode; /* mode of operation (ATM_IMD_xxx), 0 if */
+ /* absent */
+ unsigned char window; /* window size (k), 1-127 (0 to omit) */
+ } itu; /* ITU-T encoding */
+ unsigned char user; /* user-specified l2 information */
+ } l2;
+ unsigned char l3_proto; /* layer 3 protocol */
+ union {
+ struct {
+ unsigned char mode; /* mode of operation (ATM_IMD_xxx), 0 if */
+ /* absent */
+ unsigned char def_size; /* default packet size (log2), 4-12 (0 to */
+ /* omit) */
+ unsigned char window;/* packet window size, 1-127 (0 to omit) */
+ } itu; /* ITU-T encoding */
+ unsigned char user; /* user specified l3 information */
+ struct { /* if l3_proto = ATM_L3_H310 */
+ unsigned char term_type; /* terminal type */
+ unsigned char fw_mpx_cap; /* forward multiplexing capability */
+ /* only if term_type != ATM_TT_NONE */
+ unsigned char bw_mpx_cap; /* backward multiplexing capability */
+ /* only if term_type != ATM_TT_NONE */
+ } h310;
+ struct { /* if l3_proto = ATM_L3_TR9577 */
+ unsigned char ipi; /* initial protocol id */
+ unsigned char snap[5];/* IEEE 802.1 SNAP identifier */
+ /* (only if ipi == NLPID_IEEE802_1_SNAP) */
+ } tr9577;
+ } l3;
+} __ATM_API_ALIGN;
+
+
+struct atm_bhli {
+ unsigned char hl_type; /* high layer information type */
+ unsigned char hl_length; /* length (only if hl_type == ATM_HL_USER || */
+ /* hl_type == ATM_HL_ISO) */
+ unsigned char hl_info[ATM_MAX_HLI];/* high layer information */
+};
+
+
+#define ATM_MAX_BLLI 3 /* maximum number of BLLI elements */
+
+
+struct atm_sap {
+ struct atm_bhli bhli; /* local SAP, high-layer information */
+ struct atm_blli blli[ATM_MAX_BLLI] __ATM_API_ALIGN;
+ /* local SAP, low-layer info */
+};
+
+
+static __inline__ int blli_in_use(struct atm_blli blli)
+{
+ return blli.l2_proto || blli.l3_proto;
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmsvc.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmsvc.h
new file mode 100644
index 0000000..aa71583
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/atmsvc.h
@@ -0,0 +1,55 @@
+/* atmsvc.h - ATM signaling kernel-demon interface definitions */
+
+/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
+
+
+#ifndef _LINUX_ATMSVC_H
+#define _LINUX_ATMSVC_H
+
+#include <linux/atmapi.h>
+#include <linux/atm.h>
+#include <linux/atmioc.h>
+
+
+#define ATMSIGD_CTRL _IO('a',ATMIOC_SPECIAL)
+ /* become ATM signaling demon control socket */
+
+enum atmsvc_msg_type { as_catch_null, as_bind, as_connect, as_accept, as_reject,
+ as_listen, as_okay, as_error, as_indicate, as_close,
+ as_itf_notify, as_modify, as_identify, as_terminate,
+ as_addparty, as_dropparty };
+
+struct atmsvc_msg {
+ enum atmsvc_msg_type type;
+ atm_kptr_t vcc;
+ atm_kptr_t listen_vcc; /* indicate */
+ int reply; /* for okay and close: */
+ /* < 0: error before active */
+ /* (sigd has discarded ctx) */
+ /* ==0: success */
+ /* > 0: error when active (still */
+ /* need to close) */
+ struct sockaddr_atmpvc pvc; /* indicate, okay (connect) */
+ struct sockaddr_atmsvc local; /* local SVC address */
+ struct atm_qos qos; /* QOS parameters */
+ struct atm_sap sap; /* SAP */
+ unsigned int session; /* for p2pm */
+ struct sockaddr_atmsvc svc; /* SVC address */
+} __ATM_API_ALIGN;
+
+/*
+ * Message contents: see ftp://icaftp.epfl.ch/pub/linux/atm/docs/isp-*.tar.gz
+ */
+
+/*
+ * Some policy stuff for atmsigd and for net/atm/svc.c. Both have to agree on
+ * what PCR is used to request bandwidth from the device driver. net/atm/svc.c
+ * tries to do better than that, but only if there's no routing decision (i.e.
+ * if signaling only uses one ATM interface).
+ */
+
+#define SELECT_TOP_PCR(tp) ((tp).pcr ? (tp).pcr : \
+ (tp).max_pcr && (tp).max_pcr != ATM_MAX_PCR ? (tp).max_pcr : \
+ (tp).min_pcr ? (tp).min_pcr : ATM_MAX_PCR)
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/audit.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/audit.h
new file mode 100644
index 0000000..b66d45f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/audit.h
@@ -0,0 +1,361 @@
+/* audit.h -- Auditing support
+ *
+ * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina.
+ * All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Written by Rickard E. (Rik) Faith <faith@redhat.com>
+ *
+ */
+
+#ifndef _LINUX_AUDIT_H_
+#define _LINUX_AUDIT_H_
+
+#include <linux/types.h>
+#include <linux/elf-em.h>
+
+/* The netlink messages for the audit system is divided into blocks:
+ * 1000 - 1099 are for commanding the audit system
+ * 1100 - 1199 user space trusted application messages
+ * 1200 - 1299 messages internal to the audit daemon
+ * 1300 - 1399 audit event messages
+ * 1400 - 1499 SE Linux use
+ * 1500 - 1599 kernel LSPP events
+ * 1600 - 1699 kernel crypto events
+ * 1700 - 1799 kernel anomaly records
+ * 1800 - 1899 kernel integrity events
+ * 1900 - 1999 future kernel use
+ * 2000 is for otherwise unclassified kernel audit messages (legacy)
+ * 2001 - 2099 unused (kernel)
+ * 2100 - 2199 user space anomaly records
+ * 2200 - 2299 user space actions taken in response to anomalies
+ * 2300 - 2399 user space generated LSPP events
+ * 2400 - 2499 user space crypto events
+ * 2500 - 2999 future user space (maybe integrity labels and related events)
+ *
+ * Messages from 1000-1199 are bi-directional. 1200-1299 & 2100 - 2999 are
+ * exclusively user space. 1300-2099 is kernel --> user space
+ * communication.
+ */
+#define AUDIT_GET 1000 /* Get status */
+#define AUDIT_SET 1001 /* Set status (enable/disable/auditd) */
+#define AUDIT_LIST 1002 /* List syscall rules -- deprecated */
+#define AUDIT_ADD 1003 /* Add syscall rule -- deprecated */
+#define AUDIT_DEL 1004 /* Delete syscall rule -- deprecated */
+#define AUDIT_USER 1005 /* Message from userspace -- deprecated */
+#define AUDIT_LOGIN 1006 /* Define the login id and information */
+#define AUDIT_WATCH_INS 1007 /* Insert file/dir watch entry */
+#define AUDIT_WATCH_REM 1008 /* Remove file/dir watch entry */
+#define AUDIT_WATCH_LIST 1009 /* List all file/dir watches */
+#define AUDIT_SIGNAL_INFO 1010 /* Get info about sender of signal to auditd */
+#define AUDIT_ADD_RULE 1011 /* Add syscall filtering rule */
+#define AUDIT_DEL_RULE 1012 /* Delete syscall filtering rule */
+#define AUDIT_LIST_RULES 1013 /* List syscall filtering rules */
+#define AUDIT_TRIM 1014 /* Trim junk from watched tree */
+#define AUDIT_MAKE_EQUIV 1015 /* Append to watched tree */
+#define AUDIT_TTY_GET 1016 /* Get TTY auditing status */
+#define AUDIT_TTY_SET 1017 /* Set TTY auditing status */
+
+#define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages mostly uninteresting to kernel */
+#define AUDIT_USER_AVC 1107 /* We filter this differently */
+#define AUDIT_USER_TTY 1124 /* Non-ICANON TTY input meaning */
+#define AUDIT_LAST_USER_MSG 1199
+#define AUDIT_FIRST_USER_MSG2 2100 /* More user space messages */
+#define AUDIT_LAST_USER_MSG2 2999
+
+#define AUDIT_DAEMON_START 1200 /* Daemon startup record */
+#define AUDIT_DAEMON_END 1201 /* Daemon normal stop record */
+#define AUDIT_DAEMON_ABORT 1202 /* Daemon error stop record */
+#define AUDIT_DAEMON_CONFIG 1203 /* Daemon config change */
+
+#define AUDIT_SYSCALL 1300 /* Syscall event */
+/* #define AUDIT_FS_WATCH 1301 * Deprecated */
+#define AUDIT_PATH 1302 /* Filename path information */
+#define AUDIT_IPC 1303 /* IPC record */
+#define AUDIT_SOCKETCALL 1304 /* sys_socketcall arguments */
+#define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */
+#define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */
+#define AUDIT_CWD 1307 /* Current working directory */
+#define AUDIT_EXECVE 1309 /* execve arguments */
+#define AUDIT_IPC_SET_PERM 1311 /* IPC new permissions record type */
+#define AUDIT_MQ_OPEN 1312 /* POSIX MQ open record type */
+#define AUDIT_MQ_SENDRECV 1313 /* POSIX MQ send/receive record type */
+#define AUDIT_MQ_NOTIFY 1314 /* POSIX MQ notify record type */
+#define AUDIT_MQ_GETSETATTR 1315 /* POSIX MQ get/set attribute record type */
+#define AUDIT_KERNEL_OTHER 1316 /* For use by 3rd party modules */
+#define AUDIT_FD_PAIR 1317 /* audit record for pipe/socketpair */
+#define AUDIT_OBJ_PID 1318 /* ptrace target */
+#define AUDIT_TTY 1319 /* Input on an administrative TTY */
+#define AUDIT_EOE 1320 /* End of multi-record event */
+#define AUDIT_BPRM_FCAPS 1321 /* Information about fcaps increasing perms */
+#define AUDIT_CAPSET 1322 /* Record showing argument to sys_capset */
+
+#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */
+#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
+#define AUDIT_AVC_PATH 1402 /* dentry, vfsmount pair from avc */
+#define AUDIT_MAC_POLICY_LOAD 1403 /* Policy file load */
+#define AUDIT_MAC_STATUS 1404 /* Changed enforcing,permissive,off */
+#define AUDIT_MAC_CONFIG_CHANGE 1405 /* Changes to booleans */
+#define AUDIT_MAC_UNLBL_ALLOW 1406 /* NetLabel: allow unlabeled traffic */
+#define AUDIT_MAC_CIPSOV4_ADD 1407 /* NetLabel: add CIPSOv4 DOI entry */
+#define AUDIT_MAC_CIPSOV4_DEL 1408 /* NetLabel: del CIPSOv4 DOI entry */
+#define AUDIT_MAC_MAP_ADD 1409 /* NetLabel: add LSM domain mapping */
+#define AUDIT_MAC_MAP_DEL 1410 /* NetLabel: del LSM domain mapping */
+#define AUDIT_MAC_IPSEC_ADDSA 1411 /* Not used */
+#define AUDIT_MAC_IPSEC_DELSA 1412 /* Not used */
+#define AUDIT_MAC_IPSEC_ADDSPD 1413 /* Not used */
+#define AUDIT_MAC_IPSEC_DELSPD 1414 /* Not used */
+#define AUDIT_MAC_IPSEC_EVENT 1415 /* Audit an IPSec event */
+#define AUDIT_MAC_UNLBL_STCADD 1416 /* NetLabel: add a static label */
+#define AUDIT_MAC_UNLBL_STCDEL 1417 /* NetLabel: del a static label */
+
+#define AUDIT_FIRST_KERN_ANOM_MSG 1700
+#define AUDIT_LAST_KERN_ANOM_MSG 1799
+#define AUDIT_ANOM_PROMISCUOUS 1700 /* Device changed promiscuous mode */
+#define AUDIT_ANOM_ABEND 1701 /* Process ended abnormally */
+#define AUDIT_INTEGRITY_DATA 1800 /* Data integrity verification */
+#define AUDIT_INTEGRITY_METADATA 1801 /* Metadata integrity verification */
+#define AUDIT_INTEGRITY_STATUS 1802 /* Integrity enable status */
+#define AUDIT_INTEGRITY_HASH 1803 /* Integrity HASH type */
+#define AUDIT_INTEGRITY_PCR 1804 /* PCR invalidation msgs */
+#define AUDIT_INTEGRITY_RULE 1805 /* policy rule */
+
+#define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */
+
+/* Rule flags */
+#define AUDIT_FILTER_USER 0x00 /* Apply rule to user-generated messages */
+#define AUDIT_FILTER_TASK 0x01 /* Apply rule at task creation (not syscall) */
+#define AUDIT_FILTER_ENTRY 0x02 /* Apply rule at syscall entry */
+#define AUDIT_FILTER_WATCH 0x03 /* Apply rule to file system watches */
+#define AUDIT_FILTER_EXIT 0x04 /* Apply rule at syscall exit */
+#define AUDIT_FILTER_TYPE 0x05 /* Apply rule at audit_log_start */
+
+#define AUDIT_NR_FILTERS 6
+
+#define AUDIT_FILTER_PREPEND 0x10 /* Prepend to front of list */
+
+/* Rule actions */
+#define AUDIT_NEVER 0 /* Do not build context if rule matches */
+#define AUDIT_POSSIBLE 1 /* Build context if rule matches */
+#define AUDIT_ALWAYS 2 /* Generate audit record if rule matches */
+
+/* Rule structure sizes -- if these change, different AUDIT_ADD and
+ * AUDIT_LIST commands must be implemented. */
+#define AUDIT_MAX_FIELDS 64
+#define AUDIT_MAX_KEY_LEN 256
+#define AUDIT_BITMASK_SIZE 64
+#define AUDIT_WORD(nr) ((__u32)((nr)/32))
+#define AUDIT_BIT(nr) (1 << ((nr) - AUDIT_WORD(nr)*32))
+
+#define AUDIT_SYSCALL_CLASSES 16
+#define AUDIT_CLASS_DIR_WRITE 0
+#define AUDIT_CLASS_DIR_WRITE_32 1
+#define AUDIT_CLASS_CHATTR 2
+#define AUDIT_CLASS_CHATTR_32 3
+#define AUDIT_CLASS_READ 4
+#define AUDIT_CLASS_READ_32 5
+#define AUDIT_CLASS_WRITE 6
+#define AUDIT_CLASS_WRITE_32 7
+#define AUDIT_CLASS_SIGNAL 8
+#define AUDIT_CLASS_SIGNAL_32 9
+
+/* This bitmask is used to validate user input. It represents all bits that
+ * are currently used in an audit field constant understood by the kernel.
+ * If you are adding a new #define AUDIT_<whatever>, please ensure that
+ * AUDIT_UNUSED_BITS is updated if need be. */
+#define AUDIT_UNUSED_BITS 0x07FFFC00
+
+
+/* Rule fields */
+ /* These are useful when checking the
+ * task structure at task creation time
+ * (AUDIT_PER_TASK). */
+#define AUDIT_PID 0
+#define AUDIT_UID 1
+#define AUDIT_EUID 2
+#define AUDIT_SUID 3
+#define AUDIT_FSUID 4
+#define AUDIT_GID 5
+#define AUDIT_EGID 6
+#define AUDIT_SGID 7
+#define AUDIT_FSGID 8
+#define AUDIT_LOGINUID 9
+#define AUDIT_PERS 10
+#define AUDIT_ARCH 11
+#define AUDIT_MSGTYPE 12
+#define AUDIT_SUBJ_USER 13 /* security label user */
+#define AUDIT_SUBJ_ROLE 14 /* security label role */
+#define AUDIT_SUBJ_TYPE 15 /* security label type */
+#define AUDIT_SUBJ_SEN 16 /* security label sensitivity label */
+#define AUDIT_SUBJ_CLR 17 /* security label clearance label */
+#define AUDIT_PPID 18
+#define AUDIT_OBJ_USER 19
+#define AUDIT_OBJ_ROLE 20
+#define AUDIT_OBJ_TYPE 21
+#define AUDIT_OBJ_LEV_LOW 22
+#define AUDIT_OBJ_LEV_HIGH 23
+
+ /* These are ONLY useful when checking
+ * at syscall exit time (AUDIT_AT_EXIT). */
+#define AUDIT_DEVMAJOR 100
+#define AUDIT_DEVMINOR 101
+#define AUDIT_INODE 102
+#define AUDIT_EXIT 103
+#define AUDIT_SUCCESS 104 /* exit >= 0; value ignored */
+#define AUDIT_WATCH 105
+#define AUDIT_PERM 106
+#define AUDIT_DIR 107
+#define AUDIT_FILETYPE 108
+
+#define AUDIT_ARG0 200
+#define AUDIT_ARG1 (AUDIT_ARG0+1)
+#define AUDIT_ARG2 (AUDIT_ARG0+2)
+#define AUDIT_ARG3 (AUDIT_ARG0+3)
+
+#define AUDIT_FILTERKEY 210
+
+#define AUDIT_NEGATE 0x80000000
+
+/* These are the supported operators.
+ * 4 2 1 8
+ * = > < ?
+ * ----------
+ * 0 0 0 0 00 nonsense
+ * 0 0 0 1 08 & bit mask
+ * 0 0 1 0 10 <
+ * 0 1 0 0 20 >
+ * 0 1 1 0 30 !=
+ * 1 0 0 0 40 =
+ * 1 0 0 1 48 &= bit test
+ * 1 0 1 0 50 <=
+ * 1 1 0 0 60 >=
+ * 1 1 1 1 78 all operators
+ */
+#define AUDIT_BIT_MASK 0x08000000
+#define AUDIT_LESS_THAN 0x10000000
+#define AUDIT_GREATER_THAN 0x20000000
+#define AUDIT_NOT_EQUAL 0x30000000
+#define AUDIT_EQUAL 0x40000000
+#define AUDIT_BIT_TEST (AUDIT_BIT_MASK|AUDIT_EQUAL)
+#define AUDIT_LESS_THAN_OR_EQUAL (AUDIT_LESS_THAN|AUDIT_EQUAL)
+#define AUDIT_GREATER_THAN_OR_EQUAL (AUDIT_GREATER_THAN|AUDIT_EQUAL)
+#define AUDIT_OPERATORS (AUDIT_EQUAL|AUDIT_NOT_EQUAL|AUDIT_BIT_MASK)
+
+enum {
+ Audit_equal,
+ Audit_not_equal,
+ Audit_bitmask,
+ Audit_bittest,
+ Audit_lt,
+ Audit_gt,
+ Audit_le,
+ Audit_ge,
+ Audit_bad
+};
+
+/* Status symbols */
+ /* Mask values */
+#define AUDIT_STATUS_ENABLED 0x0001
+#define AUDIT_STATUS_FAILURE 0x0002
+#define AUDIT_STATUS_PID 0x0004
+#define AUDIT_STATUS_RATE_LIMIT 0x0008
+#define AUDIT_STATUS_BACKLOG_LIMIT 0x0010
+ /* Failure-to-log actions */
+#define AUDIT_FAIL_SILENT 0
+#define AUDIT_FAIL_PRINTK 1
+#define AUDIT_FAIL_PANIC 2
+
+/* distinguish syscall tables */
+#define __AUDIT_ARCH_64BIT 0x80000000
+#define __AUDIT_ARCH_LE 0x40000000
+#define AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_ARMEB (EM_ARM)
+#define AUDIT_ARCH_CRIS (EM_CRIS|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_FRV (EM_FRV)
+#define AUDIT_ARCH_H8300 (EM_H8_300)
+#define AUDIT_ARCH_I386 (EM_386|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_IA64 (EM_IA_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_M32R (EM_M32R)
+#define AUDIT_ARCH_M68K (EM_68K)
+#define AUDIT_ARCH_MIPS (EM_MIPS)
+#define AUDIT_ARCH_MIPSEL (EM_MIPS|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_MIPS64 (EM_MIPS|__AUDIT_ARCH_64BIT)
+#define AUDIT_ARCH_MIPSEL64 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_PARISC (EM_PARISC)
+#define AUDIT_ARCH_PARISC64 (EM_PARISC|__AUDIT_ARCH_64BIT)
+#define AUDIT_ARCH_PPC (EM_PPC)
+#define AUDIT_ARCH_PPC64 (EM_PPC64|__AUDIT_ARCH_64BIT)
+#define AUDIT_ARCH_S390 (EM_S390)
+#define AUDIT_ARCH_S390X (EM_S390|__AUDIT_ARCH_64BIT)
+#define AUDIT_ARCH_SH (EM_SH)
+#define AUDIT_ARCH_SHEL (EM_SH|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_SH64 (EM_SH|__AUDIT_ARCH_64BIT)
+#define AUDIT_ARCH_SHEL64 (EM_SH|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_SPARC (EM_SPARC)
+#define AUDIT_ARCH_SPARC64 (EM_SPARCV9|__AUDIT_ARCH_64BIT)
+#define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+
+#define AUDIT_PERM_EXEC 1
+#define AUDIT_PERM_WRITE 2
+#define AUDIT_PERM_READ 4
+#define AUDIT_PERM_ATTR 8
+
+struct audit_status {
+ __u32 mask; /* Bit mask for valid entries */
+ __u32 enabled; /* 1 = enabled, 0 = disabled */
+ __u32 failure; /* Failure-to-log action */
+ __u32 pid; /* pid of auditd process */
+ __u32 rate_limit; /* messages rate limit (per second) */
+ __u32 backlog_limit; /* waiting messages limit */
+ __u32 lost; /* messages lost */
+ __u32 backlog; /* messages waiting in queue */
+};
+
+struct audit_tty_status {
+ __u32 enabled; /* 1 = enabled, 0 = disabled */
+};
+
+/* audit_rule_data supports filter rules with both integer and string
+ * fields. It corresponds with AUDIT_ADD_RULE, AUDIT_DEL_RULE and
+ * AUDIT_LIST_RULES requests.
+ */
+struct audit_rule_data {
+ __u32 flags; /* AUDIT_PER_{TASK,CALL}, AUDIT_PREPEND */
+ __u32 action; /* AUDIT_NEVER, AUDIT_POSSIBLE, AUDIT_ALWAYS */
+ __u32 field_count;
+ __u32 mask[AUDIT_BITMASK_SIZE]; /* syscall(s) affected */
+ __u32 fields[AUDIT_MAX_FIELDS];
+ __u32 values[AUDIT_MAX_FIELDS];
+ __u32 fieldflags[AUDIT_MAX_FIELDS];
+ __u32 buflen; /* total length of string fields */
+ char buf[0]; /* string fields buffer */
+};
+
+/* audit_rule is supported to maintain backward compatibility with
+ * userspace. It supports integer fields only and corresponds to
+ * AUDIT_ADD, AUDIT_DEL and AUDIT_LIST requests.
+ */
+struct audit_rule { /* for AUDIT_LIST, AUDIT_ADD, and AUDIT_DEL */
+ __u32 flags; /* AUDIT_PER_{TASK,CALL}, AUDIT_PREPEND */
+ __u32 action; /* AUDIT_NEVER, AUDIT_POSSIBLE, AUDIT_ALWAYS */
+ __u32 field_count;
+ __u32 mask[AUDIT_BITMASK_SIZE];
+ __u32 fields[AUDIT_MAX_FIELDS];
+ __u32 values[AUDIT_MAX_FIELDS];
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/auto_fs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/auto_fs.h
new file mode 100644
index 0000000..2726346
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/auto_fs.h
@@ -0,0 +1,79 @@
+/* -*- linux-c -*- ------------------------------------------------------- *
+ *
+ * linux/include/linux/auto_fs.h
+ *
+ * Copyright 1997 Transmeta Corporation - All Rights Reserved
+ *
+ * This file is part of the Linux kernel and is made available under
+ * the terms of the GNU General Public License, version 2, or at your
+ * option, any later version, incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+
+#ifndef _LINUX_AUTO_FS_H
+#define _LINUX_AUTO_FS_H
+
+#include <linux/types.h>
+#include <sys/ioctl.h>
+
+/* This file describes autofs v3 */
+#define AUTOFS_PROTO_VERSION 3
+
+/* Range of protocol versions defined */
+#define AUTOFS_MAX_PROTO_VERSION AUTOFS_PROTO_VERSION
+#define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION
+
+/*
+ * Architectures where both 32- and 64-bit binaries can be executed
+ * on 64-bit kernels need this. This keeps the structure format
+ * uniform, and makes sure the wait_queue_token isn't too big to be
+ * passed back down to the kernel.
+ *
+ * This assumes that on these architectures:
+ * mode 32 bit 64 bit
+ * -------------------------
+ * int 32 bit 32 bit
+ * long 32 bit 64 bit
+ *
+ * If so, 32-bit user-space code should be backwards compatible.
+ */
+
+#if defined(__sparc__) || defined(__mips__) || defined(__x86_64__) \
+ || defined(__powerpc__) || defined(__s390__)
+typedef unsigned int autofs_wqt_t;
+#else
+typedef unsigned long autofs_wqt_t;
+#endif
+
+/* Packet types */
+#define autofs_ptype_missing 0 /* Missing entry (mount request) */
+#define autofs_ptype_expire 1 /* Expire entry (umount request) */
+
+struct autofs_packet_hdr {
+ int proto_version; /* Protocol version */
+ int type; /* Type of packet */
+};
+
+struct autofs_packet_missing {
+ struct autofs_packet_hdr hdr;
+ autofs_wqt_t wait_queue_token;
+ int len;
+ char name[NAME_MAX+1];
+};
+
+/* v3 expire (via ioctl) */
+struct autofs_packet_expire {
+ struct autofs_packet_hdr hdr;
+ int len;
+ char name[NAME_MAX+1];
+};
+
+#define AUTOFS_IOC_READY _IO(0x93,0x60)
+#define AUTOFS_IOC_FAIL _IO(0x93,0x61)
+#define AUTOFS_IOC_CATATONIC _IO(0x93,0x62)
+#define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int)
+#define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long)
+#define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire)
+
+#endif /* _LINUX_AUTO_FS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/auto_fs4.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/auto_fs4.h
new file mode 100644
index 0000000..cf1db36
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/auto_fs4.h
@@ -0,0 +1,164 @@
+/* -*- c -*-
+ * linux/include/linux/auto_fs4.h
+ *
+ * Copyright 1999-2000 Jeremy Fitzhardinge <jeremy@goop.org>
+ *
+ * This file is part of the Linux kernel and is made available under
+ * the terms of the GNU General Public License, version 2, or at your
+ * option, any later version, incorporated herein by reference.
+ */
+
+#ifndef _LINUX_AUTO_FS4_H
+#define _LINUX_AUTO_FS4_H
+
+/* Include common v3 definitions */
+#include <linux/types.h>
+#include <linux/auto_fs.h>
+
+/* autofs v4 definitions */
+#undef AUTOFS_PROTO_VERSION
+#undef AUTOFS_MIN_PROTO_VERSION
+#undef AUTOFS_MAX_PROTO_VERSION
+
+#define AUTOFS_PROTO_VERSION 5
+#define AUTOFS_MIN_PROTO_VERSION 3
+#define AUTOFS_MAX_PROTO_VERSION 5
+
+#define AUTOFS_PROTO_SUBVERSION 1
+
+/* Mask for expire behaviour */
+#define AUTOFS_EXP_IMMEDIATE 1
+#define AUTOFS_EXP_LEAVES 2
+
+#define AUTOFS_TYPE_ANY 0U
+#define AUTOFS_TYPE_INDIRECT 1U
+#define AUTOFS_TYPE_DIRECT 2U
+#define AUTOFS_TYPE_OFFSET 4U
+
+static __inline__ void set_autofs_type_indirect(unsigned int *type)
+{
+ *type = AUTOFS_TYPE_INDIRECT;
+ return;
+}
+
+static __inline__ unsigned int autofs_type_indirect(unsigned int type)
+{
+ return (type == AUTOFS_TYPE_INDIRECT);
+}
+
+static __inline__ void set_autofs_type_direct(unsigned int *type)
+{
+ *type = AUTOFS_TYPE_DIRECT;
+ return;
+}
+
+static __inline__ unsigned int autofs_type_direct(unsigned int type)
+{
+ return (type == AUTOFS_TYPE_DIRECT);
+}
+
+static __inline__ void set_autofs_type_offset(unsigned int *type)
+{
+ *type = AUTOFS_TYPE_OFFSET;
+ return;
+}
+
+static __inline__ unsigned int autofs_type_offset(unsigned int type)
+{
+ return (type == AUTOFS_TYPE_OFFSET);
+}
+
+static __inline__ unsigned int autofs_type_trigger(unsigned int type)
+{
+ return (type == AUTOFS_TYPE_DIRECT || type == AUTOFS_TYPE_OFFSET);
+}
+
+/*
+ * This isn't really a type as we use it to say "no type set" to
+ * indicate we want to search for "any" mount in the
+ * autofs_dev_ioctl_ismountpoint() device ioctl function.
+ */
+static __inline__ void set_autofs_type_any(unsigned int *type)
+{
+ *type = AUTOFS_TYPE_ANY;
+ return;
+}
+
+static __inline__ unsigned int autofs_type_any(unsigned int type)
+{
+ return (type == AUTOFS_TYPE_ANY);
+}
+
+/* Daemon notification packet types */
+enum autofs_notify {
+ NFY_NONE,
+ NFY_MOUNT,
+ NFY_EXPIRE
+};
+
+/* Kernel protocol version 4 packet types */
+
+/* Expire entry (umount request) */
+#define autofs_ptype_expire_multi 2
+
+/* Kernel protocol version 5 packet types */
+
+/* Indirect mount missing and expire requests. */
+#define autofs_ptype_missing_indirect 3
+#define autofs_ptype_expire_indirect 4
+
+/* Direct mount missing and expire requests */
+#define autofs_ptype_missing_direct 5
+#define autofs_ptype_expire_direct 6
+
+/* v4 multi expire (via pipe) */
+struct autofs_packet_expire_multi {
+ struct autofs_packet_hdr hdr;
+ autofs_wqt_t wait_queue_token;
+ int len;
+ char name[NAME_MAX+1];
+};
+
+union autofs_packet_union {
+ struct autofs_packet_hdr hdr;
+ struct autofs_packet_missing missing;
+ struct autofs_packet_expire expire;
+ struct autofs_packet_expire_multi expire_multi;
+};
+
+/* autofs v5 common packet struct */
+struct autofs_v5_packet {
+ struct autofs_packet_hdr hdr;
+ autofs_wqt_t wait_queue_token;
+ __u32 dev;
+ __u64 ino;
+ __u32 uid;
+ __u32 gid;
+ __u32 pid;
+ __u32 tgid;
+ __u32 len;
+ char name[NAME_MAX+1];
+};
+
+typedef struct autofs_v5_packet autofs_packet_missing_indirect_t;
+typedef struct autofs_v5_packet autofs_packet_expire_indirect_t;
+typedef struct autofs_v5_packet autofs_packet_missing_direct_t;
+typedef struct autofs_v5_packet autofs_packet_expire_direct_t;
+
+union autofs_v5_packet_union {
+ struct autofs_packet_hdr hdr;
+ struct autofs_v5_packet v5_packet;
+ autofs_packet_missing_indirect_t missing_indirect;
+ autofs_packet_expire_indirect_t expire_indirect;
+ autofs_packet_missing_direct_t missing_direct;
+ autofs_packet_expire_direct_t expire_direct;
+};
+
+#define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int)
+#define AUTOFS_IOC_EXPIRE_INDIRECT AUTOFS_IOC_EXPIRE_MULTI
+#define AUTOFS_IOC_EXPIRE_DIRECT AUTOFS_IOC_EXPIRE_MULTI
+#define AUTOFS_IOC_PROTOSUBVER _IOR(0x93,0x67,int)
+#define AUTOFS_IOC_ASKUMOUNT _IOR(0x93,0x70,int)
+
+
+#endif /* _LINUX_AUTO_FS4_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/auxvec.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/auxvec.h
new file mode 100644
index 0000000..b6d13cf
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/auxvec.h
@@ -0,0 +1,35 @@
+#ifndef _LINUX_AUXVEC_H
+#define _LINUX_AUXVEC_H
+
+#include <asm/auxvec.h>
+
+/* Symbolic values for the entries in the auxiliary table
+ put on the initial stack */
+#define AT_NULL 0 /* end of vector */
+#define AT_IGNORE 1 /* entry should be ignored */
+#define AT_EXECFD 2 /* file descriptor of program */
+#define AT_PHDR 3 /* program headers for program */
+#define AT_PHENT 4 /* size of program header entry */
+#define AT_PHNUM 5 /* number of program headers */
+#define AT_PAGESZ 6 /* system page size */
+#define AT_BASE 7 /* base address of interpreter */
+#define AT_FLAGS 8 /* flags */
+#define AT_ENTRY 9 /* entry point of program */
+#define AT_NOTELF 10 /* program is not ELF */
+#define AT_UID 11 /* real uid */
+#define AT_EUID 12 /* effective uid */
+#define AT_GID 13 /* real gid */
+#define AT_EGID 14 /* effective gid */
+#define AT_PLATFORM 15 /* string identifying CPU for optimizations */
+#define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */
+#define AT_CLKTCK 17 /* frequency at which times() increments */
+/* AT_* values 18 through 22 are reserved */
+#define AT_SECURE 23 /* secure mode boolean */
+#define AT_BASE_PLATFORM 24 /* string identifying real platform, may
+ * differ from AT_PLATFORM. */
+#define AT_RANDOM 25 /* address of 16 random bytes */
+
+#define AT_EXECFN 31 /* filename of program */
+
+
+#endif /* _LINUX_AUXVEC_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ax25.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ax25.h
new file mode 100644
index 0000000..56c11f0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ax25.h
@@ -0,0 +1,116 @@
+/*
+ * These are the public elements of the Linux kernel AX.25 code. A similar
+ * file netrom.h exists for the NET/ROM protocol.
+ */
+
+#ifndef AX25_KERNEL_H
+#define AX25_KERNEL_H
+
+#include <linux/socket.h>
+
+#define AX25_MTU 256
+#define AX25_MAX_DIGIS 8
+
+#define AX25_WINDOW 1
+#define AX25_T1 2
+#define AX25_N2 3
+#define AX25_T3 4
+#define AX25_T2 5
+#define AX25_BACKOFF 6
+#define AX25_EXTSEQ 7
+#define AX25_PIDINCL 8
+#define AX25_IDLE 9
+#define AX25_PACLEN 10
+#define AX25_IAMDIGI 12
+
+#define AX25_KILL 99
+
+#define SIOCAX25GETUID (SIOCPROTOPRIVATE+0)
+#define SIOCAX25ADDUID (SIOCPROTOPRIVATE+1)
+#define SIOCAX25DELUID (SIOCPROTOPRIVATE+2)
+#define SIOCAX25NOUID (SIOCPROTOPRIVATE+3)
+#define SIOCAX25OPTRT (SIOCPROTOPRIVATE+7)
+#define SIOCAX25CTLCON (SIOCPROTOPRIVATE+8)
+#define SIOCAX25GETINFOOLD (SIOCPROTOPRIVATE+9)
+#define SIOCAX25ADDFWD (SIOCPROTOPRIVATE+10)
+#define SIOCAX25DELFWD (SIOCPROTOPRIVATE+11)
+#define SIOCAX25DEVCTL (SIOCPROTOPRIVATE+12)
+#define SIOCAX25GETINFO (SIOCPROTOPRIVATE+13)
+
+#define AX25_SET_RT_IPMODE 2
+
+#define AX25_NOUID_DEFAULT 0
+#define AX25_NOUID_BLOCK 1
+
+typedef struct {
+ char ax25_call[7]; /* 6 call + SSID (shifted ascii!) */
+} ax25_address;
+
+struct sockaddr_ax25 {
+ sa_family_t sax25_family;
+ ax25_address sax25_call;
+ int sax25_ndigis;
+ /* Digipeater ax25_address sets follow */
+};
+
+#define sax25_uid sax25_ndigis
+
+struct full_sockaddr_ax25 {
+ struct sockaddr_ax25 fsa_ax25;
+ ax25_address fsa_digipeater[AX25_MAX_DIGIS];
+};
+
+struct ax25_routes_struct {
+ ax25_address port_addr;
+ ax25_address dest_addr;
+ unsigned char digi_count;
+ ax25_address digi_addr[AX25_MAX_DIGIS];
+};
+
+struct ax25_route_opt_struct {
+ ax25_address port_addr;
+ ax25_address dest_addr;
+ int cmd;
+ int arg;
+};
+
+struct ax25_ctl_struct {
+ ax25_address port_addr;
+ ax25_address source_addr;
+ ax25_address dest_addr;
+ unsigned int cmd;
+ unsigned long arg;
+ unsigned char digi_count;
+ ax25_address digi_addr[AX25_MAX_DIGIS];
+};
+
+/* this will go away. Please do not export to user land */
+struct ax25_info_struct_deprecated {
+ unsigned int n2, n2count;
+ unsigned int t1, t1timer;
+ unsigned int t2, t2timer;
+ unsigned int t3, t3timer;
+ unsigned int idle, idletimer;
+ unsigned int state;
+ unsigned int rcv_q, snd_q;
+};
+
+struct ax25_info_struct {
+ unsigned int n2, n2count;
+ unsigned int t1, t1timer;
+ unsigned int t2, t2timer;
+ unsigned int t3, t3timer;
+ unsigned int idle, idletimer;
+ unsigned int state;
+ unsigned int rcv_q, snd_q;
+ unsigned int vs, vr, va, vs_max;
+ unsigned int paclen;
+ unsigned int window;
+};
+
+struct ax25_fwd_struct {
+ ax25_address port_from;
+ ax25_address port_to;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/b1lli.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/b1lli.h
new file mode 100644
index 0000000..713f712
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/b1lli.h
@@ -0,0 +1,73 @@
+/* $Id: b1lli.h,v 1.8.8.3 2001/09/23 22:25:05 kai Exp $
+ *
+ * ISDN lowlevel-module for AVM B1-card.
+ *
+ * Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de)
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
+
+#ifndef _B1LLI_H_
+#define _B1LLI_H_
+/*
+ * struct for loading t4 file
+ */
+typedef struct avmb1_t4file {
+ int len;
+ unsigned char *data;
+} avmb1_t4file;
+
+typedef struct avmb1_loaddef {
+ int contr;
+ avmb1_t4file t4file;
+} avmb1_loaddef;
+
+typedef struct avmb1_loadandconfigdef {
+ int contr;
+ avmb1_t4file t4file;
+ avmb1_t4file t4config;
+} avmb1_loadandconfigdef;
+
+typedef struct avmb1_resetdef {
+ int contr;
+} avmb1_resetdef;
+
+typedef struct avmb1_getdef {
+ int contr;
+ int cardtype;
+ int cardstate;
+} avmb1_getdef;
+
+/*
+ * struct for adding new cards
+ */
+typedef struct avmb1_carddef {
+ int port;
+ int irq;
+} avmb1_carddef;
+
+#define AVM_CARDTYPE_B1 0
+#define AVM_CARDTYPE_T1 1
+#define AVM_CARDTYPE_M1 2
+#define AVM_CARDTYPE_M2 3
+
+typedef struct avmb1_extcarddef {
+ int port;
+ int irq;
+ int cardtype;
+ int cardnr; /* for HEMA/T1 */
+} avmb1_extcarddef;
+
+#define AVMB1_LOAD 0 /* load image to card */
+#define AVMB1_ADDCARD 1 /* add a new card - OBSOLETE */
+#define AVMB1_RESETCARD 2 /* reset a card */
+#define AVMB1_LOAD_AND_CONFIG 3 /* load image and config to card */
+#define AVMB1_ADDCARD_WITH_TYPE 4 /* add a new card, with cardtype */
+#define AVMB1_GET_CARDINFO 5 /* get cardtype */
+#define AVMB1_REMOVECARD 6 /* remove a card - OBSOLETE */
+
+#define AVMB1_REGISTERCARD_IS_OBSOLETE
+
+#endif /* _B1LLI_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/baycom.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/baycom.h
new file mode 100644
index 0000000..81249e0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/baycom.h
@@ -0,0 +1,39 @@
+/*
+ * The Linux BAYCOM driver for the Baycom serial 1200 baud modem
+ * and the parallel 9600 baud modem
+ * (C) 1997-1998 by Thomas Sailer, HB9JNX/AE4WA
+ */
+
+#ifndef _BAYCOM_H
+#define _BAYCOM_H
+
+/* -------------------------------------------------------------------- */
+/*
+ * structs for the IOCTL commands
+ */
+
+struct baycom_debug_data {
+ unsigned long debug1;
+ unsigned long debug2;
+ long debug3;
+};
+
+struct baycom_ioctl {
+ int cmd;
+ union {
+ struct baycom_debug_data dbg;
+ } data;
+};
+
+/* -------------------------------------------------------------------- */
+
+/*
+ * ioctl values change for baycom
+ */
+#define BAYCOMCTL_GETDEBUG 0x92
+
+/* -------------------------------------------------------------------- */
+
+#endif /* _BAYCOM_H */
+
+/* --------------------------------------------------------------------- */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/bfs_fs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/bfs_fs.h
new file mode 100644
index 0000000..1c0b355
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/bfs_fs.h
@@ -0,0 +1,81 @@
+/*
+ * include/linux/bfs_fs.h - BFS data structures on disk.
+ * Copyright (C) 1999 Tigran Aivazian <tigran@veritas.com>
+ */
+
+#ifndef _LINUX_BFS_FS_H
+#define _LINUX_BFS_FS_H
+
+#include <linux/types.h>
+
+#define BFS_BSIZE_BITS 9
+#define BFS_BSIZE (1<<BFS_BSIZE_BITS)
+
+#define BFS_MAGIC 0x1BADFACE
+#define BFS_ROOT_INO 2
+#define BFS_INODES_PER_BLOCK 8
+
+/* SVR4 vnode type values (bfs_inode->i_vtype) */
+#define BFS_VDIR 2L
+#define BFS_VREG 1L
+
+/* BFS inode layout on disk */
+struct bfs_inode {
+ __le16 i_ino;
+ __u16 i_unused;
+ __le32 i_sblock;
+ __le32 i_eblock;
+ __le32 i_eoffset;
+ __le32 i_vtype;
+ __le32 i_mode;
+ __le32 i_uid;
+ __le32 i_gid;
+ __le32 i_nlink;
+ __le32 i_atime;
+ __le32 i_mtime;
+ __le32 i_ctime;
+ __u32 i_padding[4];
+};
+
+#define BFS_NAMELEN 14
+#define BFS_DIRENT_SIZE 16
+#define BFS_DIRS_PER_BLOCK 32
+
+struct bfs_dirent {
+ __le16 ino;
+ char name[BFS_NAMELEN];
+};
+
+/* BFS superblock layout on disk */
+struct bfs_super_block {
+ __le32 s_magic;
+ __le32 s_start;
+ __le32 s_end;
+ __le32 s_from;
+ __le32 s_to;
+ __s32 s_bfrom;
+ __s32 s_bto;
+ char s_fsname[6];
+ char s_volume[6];
+ __u32 s_padding[118];
+};
+
+
+#define BFS_OFF2INO(offset) \
+ ((((offset) - BFS_BSIZE) / sizeof(struct bfs_inode)) + BFS_ROOT_INO)
+
+#define BFS_INO2OFF(ino) \
+ ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE)
+#define BFS_NZFILESIZE(ip) \
+ ((le32_to_cpu((ip)->i_eoffset) + 1) - le32_to_cpu((ip)->i_sblock) * BFS_BSIZE)
+
+#define BFS_FILESIZE(ip) \
+ ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip))
+
+#define BFS_FILEBLOCKS(ip) \
+ ((ip)->i_sblock == 0 ? 0 : (le32_to_cpu((ip)->i_eblock) + 1) - le32_to_cpu((ip)->i_sblock))
+#define BFS_UNCLEAN(bfs_sb, sb) \
+ ((le32_to_cpu(bfs_sb->s_from) != -1) && (le32_to_cpu(bfs_sb->s_to) != -1) && !(sb->s_flags & MS_RDONLY))
+
+
+#endif /* _LINUX_BFS_FS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/binfmts.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/binfmts.h
new file mode 100644
index 0000000..6416794
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/binfmts.h
@@ -0,0 +1,20 @@
+#ifndef _LINUX_BINFMTS_H
+#define _LINUX_BINFMTS_H
+
+#include <linux/capability.h>
+
+struct pt_regs;
+
+/*
+ * These are the maximum length and maximum number of strings passed to the
+ * execve() system call. MAX_ARG_STRLEN is essentially random but serves to
+ * prevent the kernel from being unduly impacted by misaddressed pointers.
+ * MAX_ARG_STRINGS is chosen to fit in a signed 32-bit integer.
+ */
+#define MAX_ARG_STRLEN (PAGE_SIZE * 32)
+#define MAX_ARG_STRINGS 0x7FFFFFFF
+
+/* sizeof(linux_binprm->buf) */
+#define BINPRM_BUF_SIZE 128
+
+#endif /* _LINUX_BINFMTS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/blkpg.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/blkpg.h
new file mode 100644
index 0000000..c52dd4b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/blkpg.h
@@ -0,0 +1,58 @@
+#ifndef _LINUX_BLKPG_H
+#define _LINUX_BLKPG_H
+
+/*
+ * Partition table and disk geometry handling
+ *
+ * A single ioctl with lots of subfunctions:
+ *
+ * Device number stuff:
+ * get_whole_disk() (given the device number of a partition,
+ * find the device number of the encompassing disk)
+ * get_all_partitions() (given the device number of a disk, return the
+ * device numbers of all its known partitions)
+ *
+ * Partition stuff:
+ * add_partition()
+ * delete_partition()
+ * test_partition_in_use() (also for test_disk_in_use)
+ *
+ * Geometry stuff:
+ * get_geometry()
+ * set_geometry()
+ * get_bios_drivedata()
+ *
+ * For today, only the partition stuff - aeb, 990515
+ */
+
+#include <linux/ioctl.h>
+
+#define BLKPG _IO(0x12,105)
+
+/* The argument structure */
+struct blkpg_ioctl_arg {
+ int op;
+ int flags;
+ int datalen;
+ void *data;
+};
+
+/* The subfunctions (for the op field) */
+#define BLKPG_ADD_PARTITION 1
+#define BLKPG_DEL_PARTITION 2
+
+/* Sizes of name fields. Unused at present. */
+#define BLKPG_DEVNAMELTH 64
+#define BLKPG_VOLNAMELTH 64
+
+/* The data structure for ADD_PARTITION and DEL_PARTITION */
+struct blkpg_partition {
+ long long start; /* starting offset in bytes */
+ long long length; /* length in bytes */
+ int pno; /* partition number */
+ char devname[BLKPG_DEVNAMELTH]; /* partition name, like sda5 or c0d1p2,
+ to be used in kernel messages */
+ char volname[BLKPG_VOLNAMELTH]; /* volume label */
+};
+
+#endif /* _LINUX_BLKPG_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/blktrace_api.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/blktrace_api.h
new file mode 100644
index 0000000..b9901f6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/blktrace_api.h
@@ -0,0 +1,141 @@
+#ifndef BLKTRACE_H
+#define BLKTRACE_H
+
+#include <linux/types.h>
+
+/*
+ * Trace categories
+ */
+enum blktrace_cat {
+ BLK_TC_READ = 1 << 0, /* reads */
+ BLK_TC_WRITE = 1 << 1, /* writes */
+ BLK_TC_BARRIER = 1 << 2, /* barrier */
+ BLK_TC_SYNC = 1 << 3, /* sync IO */
+ BLK_TC_SYNCIO = BLK_TC_SYNC,
+ BLK_TC_QUEUE = 1 << 4, /* queueing/merging */
+ BLK_TC_REQUEUE = 1 << 5, /* requeueing */
+ BLK_TC_ISSUE = 1 << 6, /* issue */
+ BLK_TC_COMPLETE = 1 << 7, /* completions */
+ BLK_TC_FS = 1 << 8, /* fs requests */
+ BLK_TC_PC = 1 << 9, /* pc requests */
+ BLK_TC_NOTIFY = 1 << 10, /* special message */
+ BLK_TC_AHEAD = 1 << 11, /* readahead */
+ BLK_TC_META = 1 << 12, /* metadata */
+ BLK_TC_DISCARD = 1 << 13, /* discard requests */
+ BLK_TC_DRV_DATA = 1 << 14, /* binary per-driver data */
+
+ BLK_TC_END = 1 << 15, /* only 16-bits, reminder */
+};
+
+#define BLK_TC_SHIFT (16)
+#define BLK_TC_ACT(act) ((act) << BLK_TC_SHIFT)
+
+/*
+ * Basic trace actions
+ */
+enum blktrace_act {
+ __BLK_TA_QUEUE = 1, /* queued */
+ __BLK_TA_BACKMERGE, /* back merged to existing rq */
+ __BLK_TA_FRONTMERGE, /* front merge to existing rq */
+ __BLK_TA_GETRQ, /* allocated new request */
+ __BLK_TA_SLEEPRQ, /* sleeping on rq allocation */
+ __BLK_TA_REQUEUE, /* request requeued */
+ __BLK_TA_ISSUE, /* sent to driver */
+ __BLK_TA_COMPLETE, /* completed by driver */
+ __BLK_TA_PLUG, /* queue was plugged */
+ __BLK_TA_UNPLUG_IO, /* queue was unplugged by io */
+ __BLK_TA_UNPLUG_TIMER, /* queue was unplugged by timer */
+ __BLK_TA_INSERT, /* insert request */
+ __BLK_TA_SPLIT, /* bio was split */
+ __BLK_TA_BOUNCE, /* bio was bounced */
+ __BLK_TA_REMAP, /* bio was remapped */
+ __BLK_TA_ABORT, /* request aborted */
+ __BLK_TA_DRV_DATA, /* driver-specific binary data */
+};
+
+/*
+ * Notify events.
+ */
+enum blktrace_notify {
+ __BLK_TN_PROCESS = 0, /* establish pid/name mapping */
+ __BLK_TN_TIMESTAMP, /* include system clock */
+ __BLK_TN_MESSAGE, /* Character string message */
+};
+
+
+/*
+ * Trace actions in full. Additionally, read or write is masked
+ */
+#define BLK_TA_QUEUE (__BLK_TA_QUEUE | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_BACKMERGE (__BLK_TA_BACKMERGE | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_FRONTMERGE (__BLK_TA_FRONTMERGE | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_GETRQ (__BLK_TA_GETRQ | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_SLEEPRQ (__BLK_TA_SLEEPRQ | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_REQUEUE (__BLK_TA_REQUEUE | BLK_TC_ACT(BLK_TC_REQUEUE))
+#define BLK_TA_ISSUE (__BLK_TA_ISSUE | BLK_TC_ACT(BLK_TC_ISSUE))
+#define BLK_TA_COMPLETE (__BLK_TA_COMPLETE| BLK_TC_ACT(BLK_TC_COMPLETE))
+#define BLK_TA_PLUG (__BLK_TA_PLUG | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_UNPLUG_IO (__BLK_TA_UNPLUG_IO | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_UNPLUG_TIMER (__BLK_TA_UNPLUG_TIMER | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_INSERT (__BLK_TA_INSERT | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_SPLIT (__BLK_TA_SPLIT)
+#define BLK_TA_BOUNCE (__BLK_TA_BOUNCE)
+#define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_ABORT (__BLK_TA_ABORT | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_DRV_DATA (__BLK_TA_DRV_DATA | BLK_TC_ACT(BLK_TC_DRV_DATA))
+
+#define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY))
+#define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY))
+#define BLK_TN_MESSAGE (__BLK_TN_MESSAGE | BLK_TC_ACT(BLK_TC_NOTIFY))
+
+#define BLK_IO_TRACE_MAGIC 0x65617400
+#define BLK_IO_TRACE_VERSION 0x07
+
+/*
+ * The trace itself
+ */
+struct blk_io_trace {
+ __u32 magic; /* MAGIC << 8 | version */
+ __u32 sequence; /* event number */
+ __u64 time; /* in microseconds */
+ __u64 sector; /* disk offset */
+ __u32 bytes; /* transfer length */
+ __u32 action; /* what happened */
+ __u32 pid; /* who did it */
+ __u32 device; /* device number */
+ __u32 cpu; /* on what cpu did it happen */
+ __u16 error; /* completion error */
+ __u16 pdu_len; /* length of data after this trace */
+};
+
+/*
+ * The remap event
+ */
+struct blk_io_trace_remap {
+ __be32 device;
+ __be32 device_from;
+ __be64 sector;
+};
+
+enum {
+ Blktrace_setup = 1,
+ Blktrace_running,
+ Blktrace_stopped,
+};
+
+#define BLKTRACE_BDEV_SIZE 32
+
+/*
+ * User setup structure passed with BLKTRACESTART
+ */
+struct blk_user_trace_setup {
+ char name[BLKTRACE_BDEV_SIZE]; /* output */
+ __u16 act_mask; /* input */
+ __u32 buf_size; /* input */
+ __u32 buf_nr; /* input */
+ __u64 start_lba;
+ __u64 end_lba;
+ __u32 pid;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/bpqether.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/bpqether.h
new file mode 100644
index 0000000..a6c35e1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/bpqether.h
@@ -0,0 +1,41 @@
+#ifndef __BPQETHER_H
+#define __BPQETHER_H
+
+/*
+ * Defines for the BPQETHER pseudo device driver
+ */
+
+#ifndef __LINUX_IF_ETHER_H
+#include <linux/if_ether.h>
+#endif
+
+#define SIOCSBPQETHOPT (SIOCDEVPRIVATE+0) /* reserved */
+#define SIOCSBPQETHADDR (SIOCDEVPRIVATE+1)
+
+struct bpq_ethaddr {
+ unsigned char destination[ETH_ALEN];
+ unsigned char accept[ETH_ALEN];
+};
+
+/*
+ * For SIOCSBPQETHOPT - this is compatible with PI2/PacketTwin card drivers,
+ * currently not implemented, though. If someone wants to hook a radio
+ * to his Ethernet card he may find this useful. ;-)
+ */
+
+#define SIOCGBPQETHPARAM 0x5000 /* get Level 1 parameters */
+#define SIOCSBPQETHPARAM 0x5001 /* set */
+
+struct bpq_req {
+ int cmd;
+ int speed; /* unused */
+ int clockmode; /* unused */
+ int txdelay;
+ unsigned char persist; /* unused */
+ int slotime; /* unused */
+ int squeldelay;
+ int dmachan; /* unused */
+ int irq; /* unused */
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/bsg.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/bsg.h
new file mode 100644
index 0000000..7612d5c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/bsg.h
@@ -0,0 +1,65 @@
+#ifndef BSG_H
+#define BSG_H
+
+#include <linux/types.h>
+
+#define BSG_PROTOCOL_SCSI 0
+
+#define BSG_SUB_PROTOCOL_SCSI_CMD 0
+#define BSG_SUB_PROTOCOL_SCSI_TMF 1
+#define BSG_SUB_PROTOCOL_SCSI_TRANSPORT 2
+
+/*
+ * For flags member below
+ * sg.h sg_io_hdr also has bits defined for it's flags member. However
+ * none of these bits are implemented/used by bsg. The bits below are
+ * allocated to not conflict with sg.h ones anyway.
+ */
+#define BSG_FLAG_Q_AT_TAIL 0x10 /* default, == 0 at this bit, is Q_AT_HEAD */
+
+struct sg_io_v4 {
+ __s32 guard; /* [i] 'Q' to differentiate from v3 */
+ __u32 protocol; /* [i] 0 -> SCSI , .... */
+ __u32 subprotocol; /* [i] 0 -> SCSI command, 1 -> SCSI task
+ management function, .... */
+
+ __u32 request_len; /* [i] in bytes */
+ __u64 request; /* [i], [*i] {SCSI: cdb} */
+ __u64 request_tag; /* [i] {SCSI: task tag (only if flagged)} */
+ __u32 request_attr; /* [i] {SCSI: task attribute} */
+ __u32 request_priority; /* [i] {SCSI: task priority} */
+ __u32 request_extra; /* [i] {spare, for padding} */
+ __u32 max_response_len; /* [i] in bytes */
+ __u64 response; /* [i], [*o] {SCSI: (auto)sense data} */
+
+ /* "dout_": data out (to device); "din_": data in (from device) */
+ __u32 dout_iovec_count; /* [i] 0 -> "flat" dout transfer else
+ dout_xfer points to array of iovec */
+ __u32 dout_xfer_len; /* [i] bytes to be transferred to device */
+ __u32 din_iovec_count; /* [i] 0 -> "flat" din transfer */
+ __u32 din_xfer_len; /* [i] bytes to be transferred from device */
+ __u64 dout_xferp; /* [i], [*i] */
+ __u64 din_xferp; /* [i], [*o] */
+
+ __u32 timeout; /* [i] units: millisecond */
+ __u32 flags; /* [i] bit mask */
+ __u64 usr_ptr; /* [i->o] unused internally */
+ __u32 spare_in; /* [i] */
+
+ __u32 driver_status; /* [o] 0 -> ok */
+ __u32 transport_status; /* [o] 0 -> ok */
+ __u32 device_status; /* [o] {SCSI: command completion status} */
+ __u32 retry_delay; /* [o] {SCSI: status auxiliary information} */
+ __u32 info; /* [o] additional information */
+ __u32 duration; /* [o] time to complete, in milliseconds */
+ __u32 response_len; /* [o] bytes of response actually written */
+ __s32 din_resid; /* [o] din_xfer_len - actual_din_xfer_len */
+ __s32 dout_resid; /* [o] dout_xfer_len - actual_dout_xfer_len */
+ __u64 generated_tag; /* [o] {SCSI: transport generated task tag} */
+ __u32 spare_out; /* [o] */
+
+ __u32 padding;
+};
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/byteorder/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/byteorder/..install.cmd
new file mode 100644
index 0000000..3919ffe
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/byteorder/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/byteorder/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/byteorder /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/byteorder mips big_endian.h little_endian.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/byteorder /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/byteorder mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/byteorder/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/byteorder/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/byteorder/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/byteorder/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/byteorder/big_endian.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/byteorder/big_endian.h
new file mode 100644
index 0000000..a4ef98d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/byteorder/big_endian.h
@@ -0,0 +1,105 @@
+#ifndef _LINUX_BYTEORDER_BIG_ENDIAN_H
+#define _LINUX_BYTEORDER_BIG_ENDIAN_H
+
+#ifndef __BIG_ENDIAN
+#define __BIG_ENDIAN 4321
+#endif
+#ifndef __BIG_ENDIAN_BITFIELD
+#define __BIG_ENDIAN_BITFIELD
+#endif
+
+#include <linux/types.h>
+#include <linux/swab.h>
+
+#define __constant_htonl(x) ((__be32)(__u32)(x))
+#define __constant_ntohl(x) ((__u32)(__be32)(x))
+#define __constant_htons(x) ((__be16)(__u16)(x))
+#define __constant_ntohs(x) ((__u16)(__be16)(x))
+#define __constant_cpu_to_le64(x) ((__le64)___constant_swab64((x)))
+#define __constant_le64_to_cpu(x) ___constant_swab64((__u64)(__le64)(x))
+#define __constant_cpu_to_le32(x) ((__le32)___constant_swab32((x)))
+#define __constant_le32_to_cpu(x) ___constant_swab32((__u32)(__le32)(x))
+#define __constant_cpu_to_le16(x) ((__le16)___constant_swab16((x)))
+#define __constant_le16_to_cpu(x) ___constant_swab16((__u16)(__le16)(x))
+#define __constant_cpu_to_be64(x) ((__be64)(__u64)(x))
+#define __constant_be64_to_cpu(x) ((__u64)(__be64)(x))
+#define __constant_cpu_to_be32(x) ((__be32)(__u32)(x))
+#define __constant_be32_to_cpu(x) ((__u32)(__be32)(x))
+#define __constant_cpu_to_be16(x) ((__be16)(__u16)(x))
+#define __constant_be16_to_cpu(x) ((__u16)(__be16)(x))
+#define __cpu_to_le64(x) ((__le64)__swab64((x)))
+#define __le64_to_cpu(x) __swab64((__u64)(__le64)(x))
+#define __cpu_to_le32(x) ((__le32)__swab32((x)))
+#define __le32_to_cpu(x) __swab32((__u32)(__le32)(x))
+#define __cpu_to_le16(x) ((__le16)__swab16((x)))
+#define __le16_to_cpu(x) __swab16((__u16)(__le16)(x))
+#define __cpu_to_be64(x) ((__be64)(__u64)(x))
+#define __be64_to_cpu(x) ((__u64)(__be64)(x))
+#define __cpu_to_be32(x) ((__be32)(__u32)(x))
+#define __be32_to_cpu(x) ((__u32)(__be32)(x))
+#define __cpu_to_be16(x) ((__be16)(__u16)(x))
+#define __be16_to_cpu(x) ((__u16)(__be16)(x))
+
+static __inline__ __le64 __cpu_to_le64p(const __u64 *p)
+{
+ return (__le64)__swab64p(p);
+}
+static __inline__ __u64 __le64_to_cpup(const __le64 *p)
+{
+ return __swab64p((__u64 *)p);
+}
+static __inline__ __le32 __cpu_to_le32p(const __u32 *p)
+{
+ return (__le32)__swab32p(p);
+}
+static __inline__ __u32 __le32_to_cpup(const __le32 *p)
+{
+ return __swab32p((__u32 *)p);
+}
+static __inline__ __le16 __cpu_to_le16p(const __u16 *p)
+{
+ return (__le16)__swab16p(p);
+}
+static __inline__ __u16 __le16_to_cpup(const __le16 *p)
+{
+ return __swab16p((__u16 *)p);
+}
+static __inline__ __be64 __cpu_to_be64p(const __u64 *p)
+{
+ return (__be64)*p;
+}
+static __inline__ __u64 __be64_to_cpup(const __be64 *p)
+{
+ return (__u64)*p;
+}
+static __inline__ __be32 __cpu_to_be32p(const __u32 *p)
+{
+ return (__be32)*p;
+}
+static __inline__ __u32 __be32_to_cpup(const __be32 *p)
+{
+ return (__u32)*p;
+}
+static __inline__ __be16 __cpu_to_be16p(const __u16 *p)
+{
+ return (__be16)*p;
+}
+static __inline__ __u16 __be16_to_cpup(const __be16 *p)
+{
+ return (__u16)*p;
+}
+#define __cpu_to_le64s(x) __swab64s((x))
+#define __le64_to_cpus(x) __swab64s((x))
+#define __cpu_to_le32s(x) __swab32s((x))
+#define __le32_to_cpus(x) __swab32s((x))
+#define __cpu_to_le16s(x) __swab16s((x))
+#define __le16_to_cpus(x) __swab16s((x))
+#define __cpu_to_be64s(x) do { (void)(x); } while (0)
+#define __be64_to_cpus(x) do { (void)(x); } while (0)
+#define __cpu_to_be32s(x) do { (void)(x); } while (0)
+#define __be32_to_cpus(x) do { (void)(x); } while (0)
+#define __cpu_to_be16s(x) do { (void)(x); } while (0)
+#define __be16_to_cpus(x) do { (void)(x); } while (0)
+
+
+#endif /* _LINUX_BYTEORDER_BIG_ENDIAN_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/byteorder/little_endian.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/byteorder/little_endian.h
new file mode 100644
index 0000000..74e8a15
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/byteorder/little_endian.h
@@ -0,0 +1,105 @@
+#ifndef _LINUX_BYTEORDER_LITTLE_ENDIAN_H
+#define _LINUX_BYTEORDER_LITTLE_ENDIAN_H
+
+#ifndef __LITTLE_ENDIAN
+#define __LITTLE_ENDIAN 1234
+#endif
+#ifndef __LITTLE_ENDIAN_BITFIELD
+#define __LITTLE_ENDIAN_BITFIELD
+#endif
+
+#include <linux/types.h>
+#include <linux/swab.h>
+
+#define __constant_htonl(x) ((__be32)___constant_swab32((x)))
+#define __constant_ntohl(x) ___constant_swab32((__be32)(x))
+#define __constant_htons(x) ((__be16)___constant_swab16((x)))
+#define __constant_ntohs(x) ___constant_swab16((__be16)(x))
+#define __constant_cpu_to_le64(x) ((__le64)(__u64)(x))
+#define __constant_le64_to_cpu(x) ((__u64)(__le64)(x))
+#define __constant_cpu_to_le32(x) ((__le32)(__u32)(x))
+#define __constant_le32_to_cpu(x) ((__u32)(__le32)(x))
+#define __constant_cpu_to_le16(x) ((__le16)(__u16)(x))
+#define __constant_le16_to_cpu(x) ((__u16)(__le16)(x))
+#define __constant_cpu_to_be64(x) ((__be64)___constant_swab64((x)))
+#define __constant_be64_to_cpu(x) ___constant_swab64((__u64)(__be64)(x))
+#define __constant_cpu_to_be32(x) ((__be32)___constant_swab32((x)))
+#define __constant_be32_to_cpu(x) ___constant_swab32((__u32)(__be32)(x))
+#define __constant_cpu_to_be16(x) ((__be16)___constant_swab16((x)))
+#define __constant_be16_to_cpu(x) ___constant_swab16((__u16)(__be16)(x))
+#define __cpu_to_le64(x) ((__le64)(__u64)(x))
+#define __le64_to_cpu(x) ((__u64)(__le64)(x))
+#define __cpu_to_le32(x) ((__le32)(__u32)(x))
+#define __le32_to_cpu(x) ((__u32)(__le32)(x))
+#define __cpu_to_le16(x) ((__le16)(__u16)(x))
+#define __le16_to_cpu(x) ((__u16)(__le16)(x))
+#define __cpu_to_be64(x) ((__be64)__swab64((x)))
+#define __be64_to_cpu(x) __swab64((__u64)(__be64)(x))
+#define __cpu_to_be32(x) ((__be32)__swab32((x)))
+#define __be32_to_cpu(x) __swab32((__u32)(__be32)(x))
+#define __cpu_to_be16(x) ((__be16)__swab16((x)))
+#define __be16_to_cpu(x) __swab16((__u16)(__be16)(x))
+
+static __inline__ __le64 __cpu_to_le64p(const __u64 *p)
+{
+ return (__le64)*p;
+}
+static __inline__ __u64 __le64_to_cpup(const __le64 *p)
+{
+ return (__u64)*p;
+}
+static __inline__ __le32 __cpu_to_le32p(const __u32 *p)
+{
+ return (__le32)*p;
+}
+static __inline__ __u32 __le32_to_cpup(const __le32 *p)
+{
+ return (__u32)*p;
+}
+static __inline__ __le16 __cpu_to_le16p(const __u16 *p)
+{
+ return (__le16)*p;
+}
+static __inline__ __u16 __le16_to_cpup(const __le16 *p)
+{
+ return (__u16)*p;
+}
+static __inline__ __be64 __cpu_to_be64p(const __u64 *p)
+{
+ return (__be64)__swab64p(p);
+}
+static __inline__ __u64 __be64_to_cpup(const __be64 *p)
+{
+ return __swab64p((__u64 *)p);
+}
+static __inline__ __be32 __cpu_to_be32p(const __u32 *p)
+{
+ return (__be32)__swab32p(p);
+}
+static __inline__ __u32 __be32_to_cpup(const __be32 *p)
+{
+ return __swab32p((__u32 *)p);
+}
+static __inline__ __be16 __cpu_to_be16p(const __u16 *p)
+{
+ return (__be16)__swab16p(p);
+}
+static __inline__ __u16 __be16_to_cpup(const __be16 *p)
+{
+ return __swab16p((__u16 *)p);
+}
+#define __cpu_to_le64s(x) do { (void)(x); } while (0)
+#define __le64_to_cpus(x) do { (void)(x); } while (0)
+#define __cpu_to_le32s(x) do { (void)(x); } while (0)
+#define __le32_to_cpus(x) do { (void)(x); } while (0)
+#define __cpu_to_le16s(x) do { (void)(x); } while (0)
+#define __le16_to_cpus(x) do { (void)(x); } while (0)
+#define __cpu_to_be64s(x) __swab64s((x))
+#define __be64_to_cpus(x) __swab64s((x))
+#define __cpu_to_be32s(x) __swab32s((x))
+#define __be32_to_cpus(x) __swab32s((x))
+#define __cpu_to_be16s(x) __swab16s((x))
+#define __be16_to_cpus(x) __swab16s((x))
+
+
+#endif /* _LINUX_BYTEORDER_LITTLE_ENDIAN_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can.h
new file mode 100644
index 0000000..d183333
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can.h
@@ -0,0 +1,111 @@
+/*
+ * linux/can.h
+ *
+ * Definitions for CAN network layer (socket addr / CAN frame / CAN filter)
+ *
+ * Authors: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
+ * Urs Thuermann <urs.thuermann@volkswagen.de>
+ * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
+ * All rights reserved.
+ *
+ * Send feedback to <socketcan-users@lists.berlios.de>
+ *
+ */
+
+#ifndef CAN_H
+#define CAN_H
+
+#include <linux/types.h>
+#include <linux/socket.h>
+
+/* controller area network (CAN) kernel definitions */
+
+/* special address description flags for the CAN_ID */
+#define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */
+#define CAN_RTR_FLAG 0x40000000U /* remote transmission request */
+#define CAN_ERR_FLAG 0x20000000U /* error frame */
+
+/* valid bits in CAN ID for frame formats */
+#define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */
+#define CAN_EFF_MASK 0x1FFFFFFFU /* extended frame format (EFF) */
+#define CAN_ERR_MASK 0x1FFFFFFFU /* omit EFF, RTR, ERR flags */
+
+/*
+ * Controller Area Network Identifier structure
+ *
+ * bit 0-28 : CAN identifier (11/29 bit)
+ * bit 29 : error frame flag (0 = data frame, 1 = error frame)
+ * bit 30 : remote transmission request flag (1 = rtr frame)
+ * bit 31 : frame format flag (0 = standard 11 bit, 1 = extended 29 bit)
+ */
+typedef __u32 canid_t;
+
+/*
+ * Controller Area Network Error Frame Mask structure
+ *
+ * bit 0-28 : error class mask (see include/linux/can/error.h)
+ * bit 29-31 : set to zero
+ */
+typedef __u32 can_err_mask_t;
+
+/**
+ * struct can_frame - basic CAN frame structure
+ * @can_id: the CAN ID of the frame and CAN_*_FLAG flags, see above.
+ * @can_dlc: the data length field of the CAN frame
+ * @data: the CAN frame payload.
+ */
+struct can_frame {
+ canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
+ __u8 can_dlc; /* data length code: 0 .. 8 */
+ __u8 data[8] __attribute__((aligned(8)));
+};
+
+/* particular protocols of the protocol family PF_CAN */
+#define CAN_RAW 1 /* RAW sockets */
+#define CAN_BCM 2 /* Broadcast Manager */
+#define CAN_TP16 3 /* VAG Transport Protocol v1.6 */
+#define CAN_TP20 4 /* VAG Transport Protocol v2.0 */
+#define CAN_MCNET 5 /* Bosch MCNet */
+#define CAN_ISOTP 6 /* ISO 15765-2 Transport Protocol */
+#define CAN_NPROTO 7
+
+#define SOL_CAN_BASE 100
+
+/**
+ * struct sockaddr_can - the sockaddr structure for CAN sockets
+ * @can_family: address family number AF_CAN.
+ * @can_ifindex: CAN network interface index.
+ * @can_addr: protocol specific address information
+ */
+struct sockaddr_can {
+ sa_family_t can_family;
+ int can_ifindex;
+ union {
+ /* transport protocol class address information (e.g. ISOTP) */
+ struct { canid_t rx_id, tx_id; } tp;
+
+ /* reserved for future CAN protocols address information */
+ } can_addr;
+};
+
+/**
+ * struct can_filter - CAN ID based filter in can_register().
+ * @can_id: relevant bits of CAN ID which are not masked out.
+ * @can_mask: CAN mask (see description)
+ *
+ * Description:
+ * A filter matches, when
+ *
+ * <received_can_id> & mask == can_id & mask
+ *
+ * The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can
+ * filter for error frames (CAN_ERR_FLAG bit set in mask).
+ */
+struct can_filter {
+ canid_t can_id;
+ canid_t can_mask;
+};
+
+#define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */
+
+#endif /* CAN_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can/..install.cmd
new file mode 100644
index 0000000..5ae1a97
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/can/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/can /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/can mips bcm.h error.h raw.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/can /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/can mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/can/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can/bcm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can/bcm.h
new file mode 100644
index 0000000..1432b27
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can/bcm.h
@@ -0,0 +1,67 @@
+/*
+ * linux/can/bcm.h
+ *
+ * Definitions for CAN Broadcast Manager (BCM)
+ *
+ * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
+ * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
+ * All rights reserved.
+ *
+ * Send feedback to <socketcan-users@lists.berlios.de>
+ *
+ */
+
+#ifndef CAN_BCM_H
+#define CAN_BCM_H
+
+#include <linux/types.h>
+
+/**
+ * struct bcm_msg_head - head of messages to/from the broadcast manager
+ * @opcode: opcode, see enum below.
+ * @flags: special flags, see below.
+ * @count: number of frames to send before changing interval.
+ * @ival1: interval for the first @count frames.
+ * @ival2: interval for the following frames.
+ * @can_id: CAN ID of frames to be sent or received.
+ * @nframes: number of frames appended to the message head.
+ * @frames: array of CAN frames.
+ */
+struct bcm_msg_head {
+ __u32 opcode;
+ __u32 flags;
+ __u32 count;
+ struct timeval ival1, ival2;
+ canid_t can_id;
+ __u32 nframes;
+ struct can_frame frames[0];
+};
+
+enum {
+ TX_SETUP = 1, /* create (cyclic) transmission task */
+ TX_DELETE, /* remove (cyclic) transmission task */
+ TX_READ, /* read properties of (cyclic) transmission task */
+ TX_SEND, /* send one CAN frame */
+ RX_SETUP, /* create RX content filter subscription */
+ RX_DELETE, /* remove RX content filter subscription */
+ RX_READ, /* read properties of RX content filter subscription */
+ TX_STATUS, /* reply to TX_READ request */
+ TX_EXPIRED, /* notification on performed transmissions (count=0) */
+ RX_STATUS, /* reply to RX_READ request */
+ RX_TIMEOUT, /* cyclic message is absent */
+ RX_CHANGED /* updated CAN frame (detected content change) */
+};
+
+#define SETTIMER 0x0001
+#define STARTTIMER 0x0002
+#define TX_COUNTEVT 0x0004
+#define TX_ANNOUNCE 0x0008
+#define TX_CP_CAN_ID 0x0010
+#define RX_FILTER_ID 0x0020
+#define RX_CHECK_DLC 0x0040
+#define RX_NO_AUTOTIMER 0x0080
+#define RX_ANNOUNCE_RESUME 0x0100
+#define TX_RESET_MULTI_IDX 0x0200
+#define RX_RTR_FRAME 0x0400
+
+#endif /* CAN_BCM_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can/error.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can/error.h
new file mode 100644
index 0000000..d4127fd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can/error.h
@@ -0,0 +1,93 @@
+/*
+ * linux/can/error.h
+ *
+ * Definitions of the CAN error frame to be filtered and passed to the user.
+ *
+ * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
+ * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
+ * All rights reserved.
+ *
+ * Send feedback to <socketcan-users@lists.berlios.de>
+ *
+ */
+
+#ifndef CAN_ERROR_H
+#define CAN_ERROR_H
+
+#define CAN_ERR_DLC 8 /* dlc for error frames */
+
+/* error class (mask) in can_id */
+#define CAN_ERR_TX_TIMEOUT 0x00000001U /* TX timeout (by netdevice driver) */
+#define CAN_ERR_LOSTARB 0x00000002U /* lost arbitration / data[0] */
+#define CAN_ERR_CRTL 0x00000004U /* controller problems / data[1] */
+#define CAN_ERR_PROT 0x00000008U /* protocol violations / data[2..3] */
+#define CAN_ERR_TRX 0x00000010U /* transceiver status / data[4] */
+#define CAN_ERR_ACK 0x00000020U /* received no ACK on transmission */
+#define CAN_ERR_BUSOFF 0x00000040U /* bus off */
+#define CAN_ERR_BUSERROR 0x00000080U /* bus error (may flood!) */
+#define CAN_ERR_RESTARTED 0x00000100U /* controller restarted */
+
+/* arbitration lost in bit ... / data[0] */
+#define CAN_ERR_LOSTARB_UNSPEC 0x00 /* unspecified */
+ /* else bit number in bitstream */
+
+/* error status of CAN-controller / data[1] */
+#define CAN_ERR_CRTL_UNSPEC 0x00 /* unspecified */
+#define CAN_ERR_CRTL_RX_OVERFLOW 0x01 /* RX buffer overflow */
+#define CAN_ERR_CRTL_TX_OVERFLOW 0x02 /* TX buffer overflow */
+#define CAN_ERR_CRTL_RX_WARNING 0x04 /* reached warning level for RX errors */
+#define CAN_ERR_CRTL_TX_WARNING 0x08 /* reached warning level for TX errors */
+#define CAN_ERR_CRTL_RX_PASSIVE 0x10 /* reached error passive status RX */
+#define CAN_ERR_CRTL_TX_PASSIVE 0x20 /* reached error passive status TX */
+ /* (at least one error counter exceeds */
+ /* the protocol-defined level of 127) */
+
+/* error in CAN protocol (type) / data[2] */
+#define CAN_ERR_PROT_UNSPEC 0x00 /* unspecified */
+#define CAN_ERR_PROT_BIT 0x01 /* single bit error */
+#define CAN_ERR_PROT_FORM 0x02 /* frame format error */
+#define CAN_ERR_PROT_STUFF 0x04 /* bit stuffing error */
+#define CAN_ERR_PROT_BIT0 0x08 /* unable to send dominant bit */
+#define CAN_ERR_PROT_BIT1 0x10 /* unable to send recessive bit */
+#define CAN_ERR_PROT_OVERLOAD 0x20 /* bus overload */
+#define CAN_ERR_PROT_ACTIVE 0x40 /* active error announcement */
+#define CAN_ERR_PROT_TX 0x80 /* error occured on transmission */
+
+/* error in CAN protocol (location) / data[3] */
+#define CAN_ERR_PROT_LOC_UNSPEC 0x00 /* unspecified */
+#define CAN_ERR_PROT_LOC_SOF 0x03 /* start of frame */
+#define CAN_ERR_PROT_LOC_ID28_21 0x02 /* ID bits 28 - 21 (SFF: 10 - 3) */
+#define CAN_ERR_PROT_LOC_ID20_18 0x06 /* ID bits 20 - 18 (SFF: 2 - 0 )*/
+#define CAN_ERR_PROT_LOC_SRTR 0x04 /* substitute RTR (SFF: RTR) */
+#define CAN_ERR_PROT_LOC_IDE 0x05 /* identifier extension */
+#define CAN_ERR_PROT_LOC_ID17_13 0x07 /* ID bits 17-13 */
+#define CAN_ERR_PROT_LOC_ID12_05 0x0F /* ID bits 12-5 */
+#define CAN_ERR_PROT_LOC_ID04_00 0x0E /* ID bits 4-0 */
+#define CAN_ERR_PROT_LOC_RTR 0x0C /* RTR */
+#define CAN_ERR_PROT_LOC_RES1 0x0D /* reserved bit 1 */
+#define CAN_ERR_PROT_LOC_RES0 0x09 /* reserved bit 0 */
+#define CAN_ERR_PROT_LOC_DLC 0x0B /* data length code */
+#define CAN_ERR_PROT_LOC_DATA 0x0A /* data section */
+#define CAN_ERR_PROT_LOC_CRC_SEQ 0x08 /* CRC sequence */
+#define CAN_ERR_PROT_LOC_CRC_DEL 0x18 /* CRC delimiter */
+#define CAN_ERR_PROT_LOC_ACK 0x19 /* ACK slot */
+#define CAN_ERR_PROT_LOC_ACK_DEL 0x1B /* ACK delimiter */
+#define CAN_ERR_PROT_LOC_EOF 0x1A /* end of frame */
+#define CAN_ERR_PROT_LOC_INTERM 0x12 /* intermission */
+
+/* error status of CAN-transceiver / data[4] */
+/* CANH CANL */
+#define CAN_ERR_TRX_UNSPEC 0x00 /* 0000 0000 */
+#define CAN_ERR_TRX_CANH_NO_WIRE 0x04 /* 0000 0100 */
+#define CAN_ERR_TRX_CANH_SHORT_TO_BAT 0x05 /* 0000 0101 */
+#define CAN_ERR_TRX_CANH_SHORT_TO_VCC 0x06 /* 0000 0110 */
+#define CAN_ERR_TRX_CANH_SHORT_TO_GND 0x07 /* 0000 0111 */
+#define CAN_ERR_TRX_CANL_NO_WIRE 0x40 /* 0100 0000 */
+#define CAN_ERR_TRX_CANL_SHORT_TO_BAT 0x50 /* 0101 0000 */
+#define CAN_ERR_TRX_CANL_SHORT_TO_VCC 0x60 /* 0110 0000 */
+#define CAN_ERR_TRX_CANL_SHORT_TO_GND 0x70 /* 0111 0000 */
+#define CAN_ERR_TRX_CANL_SHORT_TO_CANH 0x80 /* 1000 0000 */
+
+/* controller specific additional information / data[5..7] */
+
+#endif /* CAN_ERROR_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can/raw.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can/raw.h
new file mode 100644
index 0000000..b2a0f87
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/can/raw.h
@@ -0,0 +1,31 @@
+/*
+ * linux/can/raw.h
+ *
+ * Definitions for raw CAN sockets
+ *
+ * Authors: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
+ * Urs Thuermann <urs.thuermann@volkswagen.de>
+ * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
+ * All rights reserved.
+ *
+ * Send feedback to <socketcan-users@lists.berlios.de>
+ *
+ */
+
+#ifndef CAN_RAW_H
+#define CAN_RAW_H
+
+#include <linux/can.h>
+
+#define SOL_CAN_RAW (SOL_CAN_BASE + CAN_RAW)
+
+/* for socket options affecting the socket (not the global system) */
+
+enum {
+ CAN_RAW_FILTER = 1, /* set 0 .. n can_filter(s) */
+ CAN_RAW_ERR_FILTER, /* set filter for error frames */
+ CAN_RAW_LOOPBACK, /* local loopback (default:on) */
+ CAN_RAW_RECV_OWN_MSGS /* receive my own msgs (default:off) */
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/capability.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/capability.h
new file mode 100644
index 0000000..10761b4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/capability.h
@@ -0,0 +1,347 @@
+/*
+ * This is <linux/capability.h>
+ *
+ * Andrew G. Morgan <morgan@kernel.org>
+ * Alexander Kjeldaas <astor@guardian.no>
+ * with help from Aleph1, Roland Buresund and Andrew Main.
+ *
+ * See here for the libcap library ("POSIX draft" compliance):
+ *
+ * ftp://linux.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/
+ */
+
+#ifndef _LINUX_CAPABILITY_H
+#define _LINUX_CAPABILITY_H
+
+#include <linux/types.h>
+
+struct task_struct;
+
+/* User-level do most of the mapping between kernel and user
+ capabilities based on the version tag given by the kernel. The
+ kernel might be somewhat backwards compatible, but don't bet on
+ it. */
+
+/* Note, cap_t, is defined by POSIX (draft) to be an "opaque" pointer to
+ a set of three capability sets. The transposition of 3*the
+ following structure to such a composite is better handled in a user
+ library since the draft standard requires the use of malloc/free
+ etc.. */
+
+#define _LINUX_CAPABILITY_VERSION_1 0x19980330
+#define _LINUX_CAPABILITY_U32S_1 1
+
+#define _LINUX_CAPABILITY_VERSION_2 0x20071026 /* deprecated - use v3 */
+#define _LINUX_CAPABILITY_U32S_2 2
+
+#define _LINUX_CAPABILITY_VERSION_3 0x20080522
+#define _LINUX_CAPABILITY_U32S_3 2
+
+typedef struct __user_cap_header_struct {
+ __u32 version;
+ int pid;
+} *cap_user_header_t;
+
+typedef struct __user_cap_data_struct {
+ __u32 effective;
+ __u32 permitted;
+ __u32 inheritable;
+} *cap_user_data_t;
+
+
+#define XATTR_CAPS_SUFFIX "capability"
+#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX
+
+#define VFS_CAP_REVISION_MASK 0xFF000000
+#define VFS_CAP_REVISION_SHIFT 24
+#define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK
+#define VFS_CAP_FLAGS_EFFECTIVE 0x000001
+
+#define VFS_CAP_REVISION_1 0x01000000
+#define VFS_CAP_U32_1 1
+#define XATTR_CAPS_SZ_1 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_1))
+
+#define VFS_CAP_REVISION_2 0x02000000
+#define VFS_CAP_U32_2 2
+#define XATTR_CAPS_SZ_2 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_2))
+
+#define XATTR_CAPS_SZ XATTR_CAPS_SZ_2
+#define VFS_CAP_U32 VFS_CAP_U32_2
+#define VFS_CAP_REVISION VFS_CAP_REVISION_2
+
+struct vfs_cap_data {
+ __le32 magic_etc; /* Little endian */
+ struct {
+ __le32 permitted; /* Little endian */
+ __le32 inheritable; /* Little endian */
+ } data[VFS_CAP_U32];
+};
+
+
+/*
+ * Backwardly compatible definition for source code - trapped in a
+ * 32-bit world. If you find you need this, please consider using
+ * libcap to untrap yourself...
+ */
+#define _LINUX_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_1
+#define _LINUX_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_1
+
+
+
+/**
+ ** POSIX-draft defined capabilities.
+ **/
+
+/* In a system with the [_POSIX_CHOWN_RESTRICTED] option defined, this
+ overrides the restriction of changing file ownership and group
+ ownership. */
+
+#define CAP_CHOWN 0
+
+/* Override all DAC access, including ACL execute access if
+ [_POSIX_ACL] is defined. Excluding DAC access covered by
+ CAP_LINUX_IMMUTABLE. */
+
+#define CAP_DAC_OVERRIDE 1
+
+/* Overrides all DAC restrictions regarding read and search on files
+ and directories, including ACL restrictions if [_POSIX_ACL] is
+ defined. Excluding DAC access covered by CAP_LINUX_IMMUTABLE. */
+
+#define CAP_DAC_READ_SEARCH 2
+
+/* Overrides all restrictions about allowed operations on files, where
+ file owner ID must be equal to the user ID, except where CAP_FSETID
+ is applicable. It doesn't override MAC and DAC restrictions. */
+
+#define CAP_FOWNER 3
+
+/* Overrides the following restrictions that the effective user ID
+ shall match the file owner ID when setting the S_ISUID and S_ISGID
+ bits on that file; that the effective group ID (or one of the
+ supplementary group IDs) shall match the file owner ID when setting
+ the S_ISGID bit on that file; that the S_ISUID and S_ISGID bits are
+ cleared on successful return from chown(2) (not implemented). */
+
+#define CAP_FSETID 4
+
+/* Overrides the restriction that the real or effective user ID of a
+ process sending a signal must match the real or effective user ID
+ of the process receiving the signal. */
+
+#define CAP_KILL 5
+
+/* Allows setgid(2) manipulation */
+/* Allows setgroups(2) */
+/* Allows forged gids on socket credentials passing. */
+
+#define CAP_SETGID 6
+
+/* Allows set*uid(2) manipulation (including fsuid). */
+/* Allows forged pids on socket credentials passing. */
+
+#define CAP_SETUID 7
+
+
+/**
+ ** Linux-specific capabilities
+ **/
+
+/* Without VFS support for capabilities:
+ * Transfer any capability in your permitted set to any pid,
+ * remove any capability in your permitted set from any pid
+ * With VFS support for capabilities (neither of above, but)
+ * Add any capability from current's capability bounding set
+ * to the current process' inheritable set
+ * Allow taking bits out of capability bounding set
+ * Allow modification of the securebits for a process
+ */
+
+#define CAP_SETPCAP 8
+
+/* Allow modification of S_IMMUTABLE and S_APPEND file attributes */
+
+#define CAP_LINUX_IMMUTABLE 9
+
+/* Allows binding to TCP/UDP sockets below 1024 */
+/* Allows binding to ATM VCIs below 32 */
+
+#define CAP_NET_BIND_SERVICE 10
+
+/* Allow broadcasting, listen to multicast */
+
+#define CAP_NET_BROADCAST 11
+
+/* Allow interface configuration */
+/* Allow administration of IP firewall, masquerading and accounting */
+/* Allow setting debug option on sockets */
+/* Allow modification of routing tables */
+/* Allow setting arbitrary process / process group ownership on
+ sockets */
+/* Allow binding to any address for transparent proxying */
+/* Allow setting TOS (type of service) */
+/* Allow setting promiscuous mode */
+/* Allow clearing driver statistics */
+/* Allow multicasting */
+/* Allow read/write of device-specific registers */
+/* Allow activation of ATM control sockets */
+
+#define CAP_NET_ADMIN 12
+
+/* Allow use of RAW sockets */
+/* Allow use of PACKET sockets */
+
+#define CAP_NET_RAW 13
+
+/* Allow locking of shared memory segments */
+/* Allow mlock and mlockall (which doesn't really have anything to do
+ with IPC) */
+
+#define CAP_IPC_LOCK 14
+
+/* Override IPC ownership checks */
+
+#define CAP_IPC_OWNER 15
+
+/* Insert and remove kernel modules - modify kernel without limit */
+#define CAP_SYS_MODULE 16
+
+/* Allow ioperm/iopl access */
+/* Allow sending USB messages to any device via /proc/bus/usb */
+
+#define CAP_SYS_RAWIO 17
+
+/* Allow use of chroot() */
+
+#define CAP_SYS_CHROOT 18
+
+/* Allow ptrace() of any process */
+
+#define CAP_SYS_PTRACE 19
+
+/* Allow configuration of process accounting */
+
+#define CAP_SYS_PACCT 20
+
+/* Allow configuration of the secure attention key */
+/* Allow administration of the random device */
+/* Allow examination and configuration of disk quotas */
+/* Allow configuring the kernel's syslog (printk behaviour) */
+/* Allow setting the domainname */
+/* Allow setting the hostname */
+/* Allow calling bdflush() */
+/* Allow mount() and umount(), setting up new smb connection */
+/* Allow some autofs root ioctls */
+/* Allow nfsservctl */
+/* Allow VM86_REQUEST_IRQ */
+/* Allow to read/write pci config on alpha */
+/* Allow irix_prctl on mips (setstacksize) */
+/* Allow flushing all cache on m68k (sys_cacheflush) */
+/* Allow removing semaphores */
+/* Used instead of CAP_CHOWN to "chown" IPC message queues, semaphores
+ and shared memory */
+/* Allow locking/unlocking of shared memory segment */
+/* Allow turning swap on/off */
+/* Allow forged pids on socket credentials passing */
+/* Allow setting readahead and flushing buffers on block devices */
+/* Allow setting geometry in floppy driver */
+/* Allow turning DMA on/off in xd driver */
+/* Allow administration of md devices (mostly the above, but some
+ extra ioctls) */
+/* Allow tuning the ide driver */
+/* Allow access to the nvram device */
+/* Allow administration of apm_bios, serial and bttv (TV) device */
+/* Allow manufacturer commands in isdn CAPI support driver */
+/* Allow reading non-standardized portions of pci configuration space */
+/* Allow DDI debug ioctl on sbpcd driver */
+/* Allow setting up serial ports */
+/* Allow sending raw qic-117 commands */
+/* Allow enabling/disabling tagged queuing on SCSI controllers and sending
+ arbitrary SCSI commands */
+/* Allow setting encryption key on loopback filesystem */
+/* Allow setting zone reclaim policy */
+
+#define CAP_SYS_ADMIN 21
+
+/* Allow use of reboot() */
+
+#define CAP_SYS_BOOT 22
+
+/* Allow raising priority and setting priority on other (different
+ UID) processes */
+/* Allow use of FIFO and round-robin (realtime) scheduling on own
+ processes and setting the scheduling algorithm used by another
+ process. */
+/* Allow setting cpu affinity on other processes */
+
+#define CAP_SYS_NICE 23
+
+/* Override resource limits. Set resource limits. */
+/* Override quota limits. */
+/* Override reserved space on ext2 filesystem */
+/* Modify data journaling mode on ext3 filesystem (uses journaling
+ resources) */
+/* NOTE: ext2 honors fsuid when checking for resource overrides, so
+ you can override using fsuid too */
+/* Override size restrictions on IPC message queues */
+/* Allow more than 64hz interrupts from the real-time clock */
+/* Override max number of consoles on console allocation */
+/* Override max number of keymaps */
+
+#define CAP_SYS_RESOURCE 24
+
+/* Allow manipulation of system clock */
+/* Allow irix_stime on mips */
+/* Allow setting the real-time clock */
+
+#define CAP_SYS_TIME 25
+
+/* Allow configuration of tty devices */
+/* Allow vhangup() of tty */
+
+#define CAP_SYS_TTY_CONFIG 26
+
+/* Allow the privileged aspects of mknod() */
+
+#define CAP_MKNOD 27
+
+/* Allow taking of leases on files */
+
+#define CAP_LEASE 28
+
+#define CAP_AUDIT_WRITE 29
+
+#define CAP_AUDIT_CONTROL 30
+
+#define CAP_SETFCAP 31
+
+/* Override MAC access.
+ The base kernel enforces no MAC policy.
+ An LSM may enforce a MAC policy, and if it does and it chooses
+ to implement capability based overrides of that policy, this is
+ the capability it should use to do so. */
+
+#define CAP_MAC_OVERRIDE 32
+
+/* Allow MAC configuration or state changes.
+ The base kernel requires no MAC configuration.
+ An LSM may enforce a MAC policy, and if it does and it chooses
+ to implement capability based checks on modifications to that
+ policy or the data required to maintain it, this is the
+ capability it should use to do so. */
+
+#define CAP_MAC_ADMIN 33
+
+#define CAP_LAST_CAP CAP_MAC_ADMIN
+
+#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
+
+/*
+ * Bit location of each capability (used by user-space library and kernel)
+ */
+
+#define CAP_TO_INDEX(x) ((x) >> 5) /* 1 << 5 == bits in __u32 */
+#define CAP_TO_MASK(x) (1 << ((x) & 31)) /* mask for indexed __u32 */
+
+
+#endif /* !_LINUX_CAPABILITY_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/capi.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/capi.h
new file mode 100644
index 0000000..2e00af4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/capi.h
@@ -0,0 +1,131 @@
+/* $Id: capi.h,v 1.4.6.1 2001/09/23 22:25:05 kai Exp $
+ *
+ * CAPI 2.0 Interface for Linux
+ *
+ * Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
+
+#ifndef __LINUX_CAPI_H__
+#define __LINUX_CAPI_H__
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+#include <linux/kernelcapi.h>
+
+/*
+ * CAPI_REGISTER
+ */
+
+typedef struct capi_register_params { /* CAPI_REGISTER */
+ __u32 level3cnt; /* No. of simulatneous user data connections */
+ __u32 datablkcnt; /* No. of buffered data messages */
+ __u32 datablklen; /* Size of buffered data messages */
+} capi_register_params;
+
+#define CAPI_REGISTER _IOW('C',0x01,struct capi_register_params)
+
+/*
+ * CAPI_GET_MANUFACTURER
+ */
+
+#define CAPI_MANUFACTURER_LEN 64
+
+#define CAPI_GET_MANUFACTURER _IOWR('C',0x06,int) /* broken: wanted size 64 (CAPI_MANUFACTURER_LEN) */
+
+/*
+ * CAPI_GET_VERSION
+ */
+
+typedef struct capi_version {
+ __u32 majorversion;
+ __u32 minorversion;
+ __u32 majormanuversion;
+ __u32 minormanuversion;
+} capi_version;
+
+#define CAPI_GET_VERSION _IOWR('C',0x07,struct capi_version)
+
+/*
+ * CAPI_GET_SERIAL
+ */
+
+#define CAPI_SERIAL_LEN 8
+#define CAPI_GET_SERIAL _IOWR('C',0x08,int) /* broken: wanted size 8 (CAPI_SERIAL_LEN) */
+
+/*
+ * CAPI_GET_PROFILE
+ */
+
+typedef struct capi_profile {
+ __u16 ncontroller; /* number of installed controller */
+ __u16 nbchannel; /* number of B-Channels */
+ __u32 goptions; /* global options */
+ __u32 support1; /* B1 protocols support */
+ __u32 support2; /* B2 protocols support */
+ __u32 support3; /* B3 protocols support */
+ __u32 reserved[6]; /* reserved */
+ __u32 manu[5]; /* manufacturer specific information */
+} capi_profile;
+
+#define CAPI_GET_PROFILE _IOWR('C',0x09,struct capi_profile)
+
+typedef struct capi_manufacturer_cmd {
+ unsigned long cmd;
+ void *data;
+} capi_manufacturer_cmd;
+
+/*
+ * CAPI_MANUFACTURER_CMD
+ */
+
+#define CAPI_MANUFACTURER_CMD _IOWR('C',0x20, struct capi_manufacturer_cmd)
+
+/*
+ * CAPI_GET_ERRCODE
+ * capi errcode is set, * if read, write, or ioctl returns EIO,
+ * ioctl returns errcode directly, and in arg, if != 0
+ */
+
+#define CAPI_GET_ERRCODE _IOR('C',0x21, __u16)
+
+/*
+ * CAPI_INSTALLED
+ */
+#define CAPI_INSTALLED _IOR('C',0x22, __u16)
+
+
+/*
+ * member contr is input for
+ * CAPI_GET_MANUFACTURER, CAPI_VERSION, CAPI_GET_SERIAL
+ * and CAPI_GET_PROFILE
+ */
+typedef union capi_ioctl_struct {
+ __u32 contr;
+ capi_register_params rparams;
+ __u8 manufacturer[CAPI_MANUFACTURER_LEN];
+ capi_version version;
+ __u8 serial[CAPI_SERIAL_LEN];
+ capi_profile profile;
+ capi_manufacturer_cmd cmd;
+ __u16 errcode;
+} capi_ioctl_struct;
+
+/*
+ * Middleware extension
+ */
+
+#define CAPIFLAG_HIGHJACKING 0x0001
+
+#define CAPI_GET_FLAGS _IOR('C',0x23, unsigned)
+#define CAPI_SET_FLAGS _IOR('C',0x24, unsigned)
+#define CAPI_CLR_FLAGS _IOR('C',0x25, unsigned)
+
+#define CAPI_NCCI_OPENCOUNT _IOR('C',0x26, unsigned)
+
+#define CAPI_NCCI_GETUNIT _IOR('C',0x27, unsigned)
+
+#endif /* __LINUX_CAPI_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cciss_ioctl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cciss_ioctl.h
new file mode 100644
index 0000000..7cbbecb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cciss_ioctl.h
@@ -0,0 +1,214 @@
+#ifndef CCISS_IOCTLH
+#define CCISS_IOCTLH
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+
+#define CCISS_IOC_MAGIC 'B'
+
+
+typedef struct _cciss_pci_info_struct
+{
+ unsigned char bus;
+ unsigned char dev_fn;
+ unsigned short domain;
+ __u32 board_id;
+} cciss_pci_info_struct;
+
+typedef struct _cciss_coalint_struct
+{
+ __u32 delay;
+ __u32 count;
+} cciss_coalint_struct;
+
+typedef char NodeName_type[16];
+
+typedef __u32 Heartbeat_type;
+
+#define CISS_PARSCSIU2 0x0001
+#define CISS_PARCSCIU3 0x0002
+#define CISS_FIBRE1G 0x0100
+#define CISS_FIBRE2G 0x0200
+typedef __u32 BusTypes_type;
+
+typedef char FirmwareVer_type[4];
+typedef __u32 DriverVer_type;
+
+#define MAX_KMALLOC_SIZE 128000
+
+#ifndef CCISS_CMD_H
+// This defines are duplicated in cciss_cmd.h in the driver directory
+
+//general boundary defintions
+#define SENSEINFOBYTES 32//note that this value may vary between host implementations
+
+//Command Status value
+#define CMD_SUCCESS 0x0000
+#define CMD_TARGET_STATUS 0x0001
+#define CMD_DATA_UNDERRUN 0x0002
+#define CMD_DATA_OVERRUN 0x0003
+#define CMD_INVALID 0x0004
+#define CMD_PROTOCOL_ERR 0x0005
+#define CMD_HARDWARE_ERR 0x0006
+#define CMD_CONNECTION_LOST 0x0007
+#define CMD_ABORTED 0x0008
+#define CMD_ABORT_FAILED 0x0009
+#define CMD_UNSOLICITED_ABORT 0x000A
+#define CMD_TIMEOUT 0x000B
+#define CMD_UNABORTABLE 0x000C
+
+//transfer direction
+#define XFER_NONE 0x00
+#define XFER_WRITE 0x01
+#define XFER_READ 0x02
+#define XFER_RSVD 0x03
+
+//task attribute
+#define ATTR_UNTAGGED 0x00
+#define ATTR_SIMPLE 0x04
+#define ATTR_HEADOFQUEUE 0x05
+#define ATTR_ORDERED 0x06
+#define ATTR_ACA 0x07
+
+//cdb type
+#define TYPE_CMD 0x00
+#define TYPE_MSG 0x01
+
+// Type defs used in the following structs
+#define BYTE __u8
+#define WORD __u16
+#define HWORD __u16
+#define DWORD __u32
+
+#define CISS_MAX_LUN 1024
+
+#define LEVEL2LUN 1 // index into Target(x) structure, due to byte swapping
+#define LEVEL3LUN 0
+
+#pragma pack(1)
+
+//Command List Structure
+typedef union _SCSI3Addr_struct {
+ struct {
+ BYTE Dev;
+ BYTE Bus:6;
+ BYTE Mode:2; // b00
+ } PeripDev;
+ struct {
+ BYTE DevLSB;
+ BYTE DevMSB:6;
+ BYTE Mode:2; // b01
+ } LogDev;
+ struct {
+ BYTE Dev:5;
+ BYTE Bus:3;
+ BYTE Targ:6;
+ BYTE Mode:2; // b10
+ } LogUnit;
+} SCSI3Addr_struct;
+
+typedef struct _PhysDevAddr_struct {
+ DWORD TargetId:24;
+ DWORD Bus:6;
+ DWORD Mode:2;
+ SCSI3Addr_struct Target[2]; //2 level target device addr
+} PhysDevAddr_struct;
+
+typedef struct _LogDevAddr_struct {
+ DWORD VolId:30;
+ DWORD Mode:2;
+ BYTE reserved[4];
+} LogDevAddr_struct;
+
+typedef union _LUNAddr_struct {
+ BYTE LunAddrBytes[8];
+ SCSI3Addr_struct SCSI3Lun[4];
+ PhysDevAddr_struct PhysDev;
+ LogDevAddr_struct LogDev;
+} LUNAddr_struct;
+
+typedef struct _RequestBlock_struct {
+ BYTE CDBLen;
+ struct {
+ BYTE Type:3;
+ BYTE Attribute:3;
+ BYTE Direction:2;
+ } Type;
+ HWORD Timeout;
+ BYTE CDB[16];
+} RequestBlock_struct;
+
+typedef union _MoreErrInfo_struct{
+ struct {
+ BYTE Reserved[3];
+ BYTE Type;
+ DWORD ErrorInfo;
+ }Common_Info;
+ struct{
+ BYTE Reserved[2];
+ BYTE offense_size;//size of offending entry
+ BYTE offense_num; //byte # of offense 0-base
+ DWORD offense_value;
+ }Invalid_Cmd;
+}MoreErrInfo_struct;
+typedef struct _ErrorInfo_struct {
+ BYTE ScsiStatus;
+ BYTE SenseLen;
+ HWORD CommandStatus;
+ DWORD ResidualCnt;
+ MoreErrInfo_struct MoreErrInfo;
+ BYTE SenseInfo[SENSEINFOBYTES];
+} ErrorInfo_struct;
+
+#pragma pack()
+#endif /* CCISS_CMD_H */
+
+typedef struct _IOCTL_Command_struct {
+ LUNAddr_struct LUN_info;
+ RequestBlock_struct Request;
+ ErrorInfo_struct error_info;
+ WORD buf_size; /* size in bytes of the buf */
+ BYTE *buf;
+} IOCTL_Command_struct;
+
+typedef struct _BIG_IOCTL_Command_struct {
+ LUNAddr_struct LUN_info;
+ RequestBlock_struct Request;
+ ErrorInfo_struct error_info;
+ DWORD malloc_size; /* < MAX_KMALLOC_SIZE in cciss.c */
+ DWORD buf_size; /* size in bytes of the buf */
+ /* < malloc_size * MAXSGENTRIES */
+ BYTE *buf;
+} BIG_IOCTL_Command_struct;
+
+typedef struct _LogvolInfo_struct{
+ __u32 LunID;
+ int num_opens; /* number of opens on the logical volume */
+ int num_parts; /* number of partitions configured on logvol */
+} LogvolInfo_struct;
+
+#define CCISS_GETPCIINFO _IOR(CCISS_IOC_MAGIC, 1, cciss_pci_info_struct)
+
+#define CCISS_GETINTINFO _IOR(CCISS_IOC_MAGIC, 2, cciss_coalint_struct)
+#define CCISS_SETINTINFO _IOW(CCISS_IOC_MAGIC, 3, cciss_coalint_struct)
+
+#define CCISS_GETNODENAME _IOR(CCISS_IOC_MAGIC, 4, NodeName_type)
+#define CCISS_SETNODENAME _IOW(CCISS_IOC_MAGIC, 5, NodeName_type)
+
+#define CCISS_GETHEARTBEAT _IOR(CCISS_IOC_MAGIC, 6, Heartbeat_type)
+#define CCISS_GETBUSTYPES _IOR(CCISS_IOC_MAGIC, 7, BusTypes_type)
+#define CCISS_GETFIRMVER _IOR(CCISS_IOC_MAGIC, 8, FirmwareVer_type)
+#define CCISS_GETDRIVVER _IOR(CCISS_IOC_MAGIC, 9, DriverVer_type)
+#define CCISS_REVALIDVOLS _IO(CCISS_IOC_MAGIC, 10)
+#define CCISS_PASSTHRU _IOWR(CCISS_IOC_MAGIC, 11, IOCTL_Command_struct)
+#define CCISS_DEREGDISK _IO(CCISS_IOC_MAGIC, 12)
+
+/* no longer used... use REGNEWD instead */
+#define CCISS_REGNEWDISK _IOW(CCISS_IOC_MAGIC, 13, int)
+
+#define CCISS_REGNEWD _IO(CCISS_IOC_MAGIC, 14)
+#define CCISS_RESCANDISK _IO(CCISS_IOC_MAGIC, 16)
+#define CCISS_GETLUNINFO _IOR(CCISS_IOC_MAGIC, 17, LogvolInfo_struct)
+#define CCISS_BIG_PASSTHRU _IOWR(CCISS_IOC_MAGIC, 18, BIG_IOCTL_Command_struct)
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cdk.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cdk.h
new file mode 100644
index 0000000..0908daf
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cdk.h
@@ -0,0 +1,486 @@
+/*****************************************************************************/
+
+/*
+ * cdk.h -- CDK interface definitions.
+ *
+ * Copyright (C) 1996-1998 Stallion Technologies
+ * Copyright (C) 1994-1996 Greg Ungerer.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/*****************************************************************************/
+#ifndef _CDK_H
+#define _CDK_H
+/*****************************************************************************/
+
+#pragma pack(2)
+
+/*
+ * The following set of definitions is used to communicate with the
+ * shared memory interface of the Stallion intelligent multiport serial
+ * boards. The definitions in this file are taken directly from the
+ * document titled "Generic Stackable Interface, Downloader and
+ * Communications Development Kit".
+ */
+
+/*
+ * Define the set of important shared memory addresses. These are
+ * required to initialize the board and get things started. All of these
+ * addresses are relative to the start of the shared memory.
+ */
+#define CDK_SIGADDR 0x200
+#define CDK_FEATADDR 0x280
+#define CDK_CDKADDR 0x300
+#define CDK_RDYADDR 0x262
+
+#define CDK_ALIVEMARKER 13
+
+/*
+ * On hardware power up the ROMs located on the EasyConnection 8/64 will
+ * fill out the following signature information into shared memory. This
+ * way the host system can quickly determine that the board is present
+ * and is operational.
+ */
+typedef struct cdkecpsig {
+ unsigned long magic;
+ unsigned short romver;
+ unsigned short cputype;
+ unsigned char panelid[8];
+} cdkecpsig_t;
+
+#define ECP_MAGIC 0x21504345
+
+/*
+ * On hardware power up the ROMs located on the ONboard, Stallion and
+ * Brumbys will fill out the following signature information into shared
+ * memory. This way the host system can quickly determine that the board
+ * is present and is operational.
+ */
+typedef struct cdkonbsig {
+ unsigned short magic0;
+ unsigned short magic1;
+ unsigned short magic2;
+ unsigned short magic3;
+ unsigned short romver;
+ unsigned short memoff;
+ unsigned short memseg;
+ unsigned short amask0;
+ unsigned short pic;
+ unsigned short status;
+ unsigned short btype;
+ unsigned short clkticks;
+ unsigned short clkspeed;
+ unsigned short amask1;
+ unsigned short amask2;
+} cdkonbsig_t;
+
+#define ONB_MAGIC0 0xf2a7
+#define ONB_MAGIC1 0xa149
+#define ONB_MAGIC2 0x6352
+#define ONB_MAGIC3 0xf121
+
+/*
+ * Define the feature area structure. The feature area is the set of
+ * startup parameters used by the slave image when it starts executing.
+ * They allow for the specification of buffer sizes, debug trace, etc.
+ */
+typedef struct cdkfeature {
+ unsigned long debug;
+ unsigned long banner;
+ unsigned long etype;
+ unsigned long nrdevs;
+ unsigned long brdspec;
+ unsigned long txrqsize;
+ unsigned long rxrqsize;
+ unsigned long flags;
+} cdkfeature_t;
+
+#define ETYP_DDK 0
+#define ETYP_CDK 1
+
+/*
+ * Define the CDK header structure. This is the info that the slave
+ * environment sets up after it has been downloaded and started. It
+ * essentially provides a memory map for the shared memory interface.
+ */
+typedef struct cdkhdr {
+ unsigned short command;
+ unsigned short status;
+ unsigned short port;
+ unsigned short mode;
+ unsigned long cmd_buf[14];
+ unsigned short alive_cnt;
+ unsigned short intrpt_mode;
+ unsigned char intrpt_id[8];
+ unsigned char ver_release;
+ unsigned char ver_modification;
+ unsigned char ver_fix;
+ unsigned char deadman_restart;
+ unsigned short deadman;
+ unsigned short nrdevs;
+ unsigned long memp;
+ unsigned long hostp;
+ unsigned long slavep;
+ unsigned char hostreq;
+ unsigned char slavereq;
+ unsigned char cmd_reserved[30];
+} cdkhdr_t;
+
+#define MODE_DDK 0
+#define MODE_CDK 1
+
+#define IMD_INTR 0x0
+#define IMD_PPINTR 0x1
+#define IMD_POLL 0xff
+
+/*
+ * Define the memory mapping structure. This structure is pointed to by
+ * the memp field in the stlcdkhdr struct. As many as these structures
+ * as required are layed out in shared memory to define how the rest of
+ * shared memory is divided up. There will be one for each port.
+ */
+typedef struct cdkmem {
+ unsigned short dtype;
+ unsigned long offset;
+} cdkmem_t;
+
+#define TYP_UNDEFINED 0x0
+#define TYP_ASYNCTRL 0x1
+#define TYP_ASYNC 0x20
+#define TYP_PARALLEL 0x40
+#define TYP_SYNCX21 0x60
+
+/*****************************************************************************/
+
+/*
+ * Following is a set of defines and structures used to actually deal
+ * with the serial ports on the board. Firstly is the set of commands
+ * that can be applied to ports.
+ */
+#define ASYCMD (((unsigned long) 'a') << 8)
+
+#define A_NULL (ASYCMD | 0)
+#define A_FLUSH (ASYCMD | 1)
+#define A_BREAK (ASYCMD | 2)
+#define A_GETPORT (ASYCMD | 3)
+#define A_SETPORT (ASYCMD | 4)
+#define A_SETPORTF (ASYCMD | 5)
+#define A_SETPORTFTX (ASYCMD | 6)
+#define A_SETPORTFRX (ASYCMD | 7)
+#define A_GETSIGNALS (ASYCMD | 8)
+#define A_SETSIGNALS (ASYCMD | 9)
+#define A_SETSIGNALSF (ASYCMD | 10)
+#define A_SETSIGNALSFTX (ASYCMD | 11)
+#define A_SETSIGNALSFRX (ASYCMD | 12)
+#define A_GETNOTIFY (ASYCMD | 13)
+#define A_SETNOTIFY (ASYCMD | 14)
+#define A_NOTIFY (ASYCMD | 15)
+#define A_PORTCTRL (ASYCMD | 16)
+#define A_GETSTATS (ASYCMD | 17)
+#define A_RQSTATE (ASYCMD | 18)
+#define A_FLOWSTATE (ASYCMD | 19)
+#define A_CLEARSTATS (ASYCMD | 20)
+
+/*
+ * Define those arguments used for simple commands.
+ */
+#define FLUSHRX 0x1
+#define FLUSHTX 0x2
+
+#define BREAKON -1
+#define BREAKOFF -2
+
+/*
+ * Define the port setting structure, and all those defines that go along
+ * with it. Basically this structure defines the characteristics of this
+ * port: baud rate, chars, parity, input/output char cooking etc.
+ */
+typedef struct asyport {
+ unsigned long baudout;
+ unsigned long baudin;
+ unsigned long iflag;
+ unsigned long oflag;
+ unsigned long lflag;
+ unsigned long pflag;
+ unsigned long flow;
+ unsigned long spare1;
+ unsigned short vtime;
+ unsigned short vmin;
+ unsigned short txlo;
+ unsigned short txhi;
+ unsigned short rxlo;
+ unsigned short rxhi;
+ unsigned short rxhog;
+ unsigned short spare2;
+ unsigned char csize;
+ unsigned char stopbs;
+ unsigned char parity;
+ unsigned char stopin;
+ unsigned char startin;
+ unsigned char stopout;
+ unsigned char startout;
+ unsigned char parmark;
+ unsigned char brkmark;
+ unsigned char cc[11];
+} asyport_t;
+
+#define PT_STOP1 0x0
+#define PT_STOP15 0x1
+#define PT_STOP2 0x2
+
+#define PT_NOPARITY 0x0
+#define PT_ODDPARITY 0x1
+#define PT_EVENPARITY 0x2
+#define PT_MARKPARITY 0x3
+#define PT_SPACEPARITY 0x4
+
+#define F_NONE 0x0
+#define F_IXON 0x1
+#define F_IXOFF 0x2
+#define F_IXANY 0x4
+#define F_IOXANY 0x8
+#define F_RTSFLOW 0x10
+#define F_CTSFLOW 0x20
+#define F_DTRFLOW 0x40
+#define F_DCDFLOW 0x80
+#define F_DSROFLOW 0x100
+#define F_DSRIFLOW 0x200
+
+#define FI_NORX 0x1
+#define FI_RAW 0x2
+#define FI_ISTRIP 0x4
+#define FI_UCLC 0x8
+#define FI_INLCR 0x10
+#define FI_ICRNL 0x20
+#define FI_IGNCR 0x40
+#define FI_IGNBREAK 0x80
+#define FI_DSCRDBREAK 0x100
+#define FI_1MARKBREAK 0x200
+#define FI_2MARKBREAK 0x400
+#define FI_XCHNGBREAK 0x800
+#define FI_IGNRXERRS 0x1000
+#define FI_DSCDRXERRS 0x2000
+#define FI_1MARKRXERRS 0x4000
+#define FI_2MARKRXERRS 0x8000
+#define FI_XCHNGRXERRS 0x10000
+#define FI_DSCRDNULL 0x20000
+
+#define FO_OLCUC 0x1
+#define FO_ONLCR 0x2
+#define FO_OOCRNL 0x4
+#define FO_ONOCR 0x8
+#define FO_ONLRET 0x10
+#define FO_ONL 0x20
+#define FO_OBS 0x40
+#define FO_OVT 0x80
+#define FO_OFF 0x100
+#define FO_OTAB1 0x200
+#define FO_OTAB2 0x400
+#define FO_OTAB3 0x800
+#define FO_OCR1 0x1000
+#define FO_OCR2 0x2000
+#define FO_OCR3 0x4000
+#define FO_OFILL 0x8000
+#define FO_ODELL 0x10000
+
+#define P_RTSLOCK 0x1
+#define P_CTSLOCK 0x2
+#define P_MAPRTS 0x4
+#define P_MAPCTS 0x8
+#define P_LOOPBACK 0x10
+#define P_DTRFOLLOW 0x20
+#define P_FAKEDCD 0x40
+
+#define P_RXIMIN 0x10000
+#define P_RXITIME 0x20000
+#define P_RXTHOLD 0x40000
+
+/*
+ * Define a structure to communicate serial port signal and data state
+ * information.
+ */
+typedef struct asysigs {
+ unsigned long data;
+ unsigned long signal;
+ unsigned long sigvalue;
+} asysigs_t;
+
+#define DT_TXBUSY 0x1
+#define DT_TXEMPTY 0x2
+#define DT_TXLOW 0x4
+#define DT_TXHIGH 0x8
+#define DT_TXFULL 0x10
+#define DT_TXHOG 0x20
+#define DT_TXFLOWED 0x40
+#define DT_TXBREAK 0x80
+
+#define DT_RXBUSY 0x100
+#define DT_RXEMPTY 0x200
+#define DT_RXLOW 0x400
+#define DT_RXHIGH 0x800
+#define DT_RXFULL 0x1000
+#define DT_RXHOG 0x2000
+#define DT_RXFLOWED 0x4000
+#define DT_RXBREAK 0x8000
+
+#define SG_DTR 0x1
+#define SG_DCD 0x2
+#define SG_RTS 0x4
+#define SG_CTS 0x8
+#define SG_DSR 0x10
+#define SG_RI 0x20
+
+/*
+ * Define the notification setting structure. This is used to tell the
+ * port what events we want to be informed about. Fields here use the
+ * same defines as for the asysigs structure above.
+ */
+typedef struct asynotify {
+ unsigned long ctrl;
+ unsigned long data;
+ unsigned long signal;
+ unsigned long sigvalue;
+} asynotify_t;
+
+/*
+ * Define the port control structure. It is used to do fine grain
+ * control operations on the port.
+ */
+typedef struct {
+ unsigned long rxctrl;
+ unsigned long txctrl;
+ char rximdch;
+ char tximdch;
+ char spare1;
+ char spare2;
+} asyctrl_t;
+
+#define CT_ENABLE 0x1
+#define CT_DISABLE 0x2
+#define CT_STOP 0x4
+#define CT_START 0x8
+#define CT_STARTFLOW 0x10
+#define CT_STOPFLOW 0x20
+#define CT_SENDCHR 0x40
+
+/*
+ * Define the stats structure kept for each port. This is a useful set
+ * of data collected for each port on the slave. The A_GETSTATS command
+ * is used to retrieve this data from the slave.
+ */
+typedef struct asystats {
+ unsigned long opens;
+ unsigned long txchars;
+ unsigned long rxchars;
+ unsigned long txringq;
+ unsigned long rxringq;
+ unsigned long txmsgs;
+ unsigned long rxmsgs;
+ unsigned long txflushes;
+ unsigned long rxflushes;
+ unsigned long overruns;
+ unsigned long framing;
+ unsigned long parity;
+ unsigned long ringover;
+ unsigned long lost;
+ unsigned long rxstart;
+ unsigned long rxstop;
+ unsigned long txstart;
+ unsigned long txstop;
+ unsigned long dcdcnt;
+ unsigned long dtrcnt;
+ unsigned long ctscnt;
+ unsigned long rtscnt;
+ unsigned long dsrcnt;
+ unsigned long ricnt;
+ unsigned long txbreaks;
+ unsigned long rxbreaks;
+ unsigned long signals;
+ unsigned long state;
+ unsigned long hwid;
+} asystats_t;
+
+/*****************************************************************************/
+
+/*
+ * All command and control communication with a device on the slave is
+ * via a control block in shared memory. Each device has its own control
+ * block, defined by the following structure. The control block allows
+ * the host to open, close and control the device on the slave.
+ */
+typedef struct cdkctrl {
+ unsigned char open;
+ unsigned char close;
+ unsigned long openarg;
+ unsigned long closearg;
+ unsigned long cmd;
+ unsigned long status;
+ unsigned long args[32];
+} cdkctrl_t;
+
+/*
+ * Each device on the slave passes data to and from the host via a ring
+ * queue in shared memory. Define a ring queue structure to hold the
+ * vital information about each ring queue. Two ring queues will be
+ * allocated for each port, one for receive data and one for transmit
+ * data.
+ */
+typedef struct cdkasyrq {
+ unsigned long offset;
+ unsigned short size;
+ unsigned short head;
+ unsigned short tail;
+} cdkasyrq_t;
+
+/*
+ * Each asynchronous port is defined in shared memory by the following
+ * structure. It contains a control block to command a device, and also
+ * the necessary data channel information as well.
+ */
+typedef struct cdkasy {
+ cdkctrl_t ctrl;
+ unsigned short notify;
+ asynotify_t changed;
+ unsigned short receive;
+ cdkasyrq_t rxq;
+ unsigned short transmit;
+ cdkasyrq_t txq;
+} cdkasy_t;
+
+#pragma pack()
+
+/*****************************************************************************/
+
+/*
+ * Define the set of ioctls used by the driver to do special things
+ * to the board. These include interrupting it, and initializing
+ * the driver after board startup and shutdown.
+ */
+#include <linux/ioctl.h>
+
+#define STL_BINTR _IO('s',20)
+#define STL_BSTART _IO('s',21)
+#define STL_BSTOP _IO('s',22)
+#define STL_BRESET _IO('s',23)
+
+/*
+ * Define a set of ioctl extensions, used to get at special stuff.
+ */
+#define STL_GETPFLAG _IO('s',80)
+#define STL_SETPFLAG _IO('s',81)
+
+/*****************************************************************************/
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cdrom.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cdrom.h
new file mode 100644
index 0000000..8adcaf1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cdrom.h
@@ -0,0 +1,912 @@
+/*
+ * -- <linux/cdrom.h>
+ * General header file for linux CD-ROM drivers
+ * Copyright (C) 1992 David Giller, rafetmad@oxy.edu
+ * 1994, 1995 Eberhard Mönkeberg, emoenke@gwdg.de
+ * 1996 David van Leeuwen, david@tm.tno.nl
+ * 1997, 1998 Erik Andersen, andersee@debian.org
+ * 1998-2002 Jens Axboe, axboe@suse.de
+ */
+
+#ifndef _LINUX_CDROM_H
+#define _LINUX_CDROM_H
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+/*******************************************************
+ * As of Linux 2.1.x, all Linux CD-ROM application programs will use this
+ * (and only this) include file. It is my hope to provide Linux with
+ * a uniform interface between software accessing CD-ROMs and the various
+ * device drivers that actually talk to the drives. There may still be
+ * 23 different kinds of strange CD-ROM drives, but at least there will
+ * now be one, and only one, Linux CD-ROM interface.
+ *
+ * Additionally, as of Linux 2.1.x, all Linux application programs
+ * should use the O_NONBLOCK option when opening a CD-ROM device
+ * for subsequent ioctl commands. This allows for neat system errors
+ * like "No medium found" or "Wrong medium type" upon attempting to
+ * mount or play an empty slot, mount an audio disc, or play a data disc.
+ * Generally, changing an application program to support O_NONBLOCK
+ * is as easy as the following:
+ * - drive = open("/dev/cdrom", O_RDONLY);
+ * + drive = open("/dev/cdrom", O_RDONLY | O_NONBLOCK);
+ * It is worth the small change.
+ *
+ * Patches for many common CD programs (provided by David A. van Leeuwen)
+ * can be found at: ftp://ftp.gwdg.de/pub/linux/cdrom/drivers/cm206/
+ *
+ *******************************************************/
+
+/* When a driver supports a certain function, but the cdrom drive we are
+ * using doesn't, we will return the error EDRIVE_CANT_DO_THIS. We will
+ * borrow the "Operation not supported" error from the network folks to
+ * accomplish this. Maybe someday we will get a more targeted error code,
+ * but this will do for now... */
+#define EDRIVE_CANT_DO_THIS EOPNOTSUPP
+
+/*******************************************************
+ * The CD-ROM IOCTL commands -- these should be supported by
+ * all the various cdrom drivers. For the CD-ROM ioctls, we
+ * will commandeer byte 0x53, or 'S'.
+ *******************************************************/
+#define CDROMPAUSE 0x5301 /* Pause Audio Operation */
+#define CDROMRESUME 0x5302 /* Resume paused Audio Operation */
+#define CDROMPLAYMSF 0x5303 /* Play Audio MSF (struct cdrom_msf) */
+#define CDROMPLAYTRKIND 0x5304 /* Play Audio Track/index
+ (struct cdrom_ti) */
+#define CDROMREADTOCHDR 0x5305 /* Read TOC header
+ (struct cdrom_tochdr) */
+#define CDROMREADTOCENTRY 0x5306 /* Read TOC entry
+ (struct cdrom_tocentry) */
+#define CDROMSTOP 0x5307 /* Stop the cdrom drive */
+#define CDROMSTART 0x5308 /* Start the cdrom drive */
+#define CDROMEJECT 0x5309 /* Ejects the cdrom media */
+#define CDROMVOLCTRL 0x530a /* Control output volume
+ (struct cdrom_volctrl) */
+#define CDROMSUBCHNL 0x530b /* Read subchannel data
+ (struct cdrom_subchnl) */
+#define CDROMREADMODE2 0x530c /* Read CDROM mode 2 data (2336 Bytes)
+ (struct cdrom_read) */
+#define CDROMREADMODE1 0x530d /* Read CDROM mode 1 data (2048 Bytes)
+ (struct cdrom_read) */
+#define CDROMREADAUDIO 0x530e /* (struct cdrom_read_audio) */
+#define CDROMEJECT_SW 0x530f /* enable(1)/disable(0) auto-ejecting */
+#define CDROMMULTISESSION 0x5310 /* Obtain the start-of-last-session
+ address of multi session disks
+ (struct cdrom_multisession) */
+#define CDROM_GET_MCN 0x5311 /* Obtain the "Universal Product Code"
+ if available (struct cdrom_mcn) */
+#define CDROM_GET_UPC CDROM_GET_MCN /* This one is deprecated,
+ but here anyway for compatibility */
+#define CDROMRESET 0x5312 /* hard-reset the drive */
+#define CDROMVOLREAD 0x5313 /* Get the drive's volume setting
+ (struct cdrom_volctrl) */
+#define CDROMREADRAW 0x5314 /* read data in raw mode (2352 Bytes)
+ (struct cdrom_read) */
+/*
+ * These ioctls are used only used in aztcd.c and optcd.c
+ */
+#define CDROMREADCOOKED 0x5315 /* read data in cooked mode */
+#define CDROMSEEK 0x5316 /* seek msf address */
+
+/*
+ * This ioctl is only used by the scsi-cd driver.
+ It is for playing audio in logical block addressing mode.
+ */
+#define CDROMPLAYBLK 0x5317 /* (struct cdrom_blk) */
+
+/*
+ * These ioctls are only used in optcd.c
+ */
+#define CDROMREADALL 0x5318 /* read all 2646 bytes */
+
+/*
+ * These ioctls are (now) only in ide-cd.c for controlling
+ * drive spindown time. They should be implemented in the
+ * Uniform driver, via generic packet commands, GPCMD_MODE_SELECT_10,
+ * GPCMD_MODE_SENSE_10 and the GPMODE_POWER_PAGE...
+ * -Erik
+ */
+#define CDROMGETSPINDOWN 0x531d
+#define CDROMSETSPINDOWN 0x531e
+
+/*
+ * These ioctls are implemented through the uniform CD-ROM driver
+ * They _will_ be adopted by all CD-ROM drivers, when all the CD-ROM
+ * drivers are eventually ported to the uniform CD-ROM driver interface.
+ */
+#define CDROMCLOSETRAY 0x5319 /* pendant of CDROMEJECT */
+#define CDROM_SET_OPTIONS 0x5320 /* Set behavior options */
+#define CDROM_CLEAR_OPTIONS 0x5321 /* Clear behavior options */
+#define CDROM_SELECT_SPEED 0x5322 /* Set the CD-ROM speed */
+#define CDROM_SELECT_DISC 0x5323 /* Select disc (for juke-boxes) */
+#define CDROM_MEDIA_CHANGED 0x5325 /* Check is media changed */
+#define CDROM_DRIVE_STATUS 0x5326 /* Get tray position, etc. */
+#define CDROM_DISC_STATUS 0x5327 /* Get disc type, etc. */
+#define CDROM_CHANGER_NSLOTS 0x5328 /* Get number of slots */
+#define CDROM_LOCKDOOR 0x5329 /* lock or unlock door */
+#define CDROM_DEBUG 0x5330 /* Turn debug messages on/off */
+#define CDROM_GET_CAPABILITY 0x5331 /* get capabilities */
+
+/* Note that scsi/scsi_ioctl.h also uses 0x5382 - 0x5386.
+ * Future CDROM ioctls should be kept below 0x537F
+ */
+
+/* This ioctl is only used by sbpcd at the moment */
+#define CDROMAUDIOBUFSIZ 0x5382 /* set the audio buffer size */
+ /* conflict with SCSI_IOCTL_GET_IDLUN */
+
+/* DVD-ROM Specific ioctls */
+#define DVD_READ_STRUCT 0x5390 /* Read structure */
+#define DVD_WRITE_STRUCT 0x5391 /* Write structure */
+#define DVD_AUTH 0x5392 /* Authentication */
+
+#define CDROM_SEND_PACKET 0x5393 /* send a packet to the drive */
+#define CDROM_NEXT_WRITABLE 0x5394 /* get next writable block */
+#define CDROM_LAST_WRITTEN 0x5395 /* get last block written on disc */
+
+/*******************************************************
+ * CDROM IOCTL structures
+ *******************************************************/
+
+/* Address in MSF format */
+struct cdrom_msf0
+{
+ __u8 minute;
+ __u8 second;
+ __u8 frame;
+};
+
+/* Address in either MSF or logical format */
+union cdrom_addr
+{
+ struct cdrom_msf0 msf;
+ int lba;
+};
+
+/* This struct is used by the CDROMPLAYMSF ioctl */
+struct cdrom_msf
+{
+ __u8 cdmsf_min0; /* start minute */
+ __u8 cdmsf_sec0; /* start second */
+ __u8 cdmsf_frame0; /* start frame */
+ __u8 cdmsf_min1; /* end minute */
+ __u8 cdmsf_sec1; /* end second */
+ __u8 cdmsf_frame1; /* end frame */
+};
+
+/* This struct is used by the CDROMPLAYTRKIND ioctl */
+struct cdrom_ti
+{
+ __u8 cdti_trk0; /* start track */
+ __u8 cdti_ind0; /* start index */
+ __u8 cdti_trk1; /* end track */
+ __u8 cdti_ind1; /* end index */
+};
+
+/* This struct is used by the CDROMREADTOCHDR ioctl */
+struct cdrom_tochdr
+{
+ __u8 cdth_trk0; /* start track */
+ __u8 cdth_trk1; /* end track */
+};
+
+/* This struct is used by the CDROMVOLCTRL and CDROMVOLREAD ioctls */
+struct cdrom_volctrl
+{
+ __u8 channel0;
+ __u8 channel1;
+ __u8 channel2;
+ __u8 channel3;
+};
+
+/* This struct is used by the CDROMSUBCHNL ioctl */
+struct cdrom_subchnl
+{
+ __u8 cdsc_format;
+ __u8 cdsc_audiostatus;
+ __u8 cdsc_adr: 4;
+ __u8 cdsc_ctrl: 4;
+ __u8 cdsc_trk;
+ __u8 cdsc_ind;
+ union cdrom_addr cdsc_absaddr;
+ union cdrom_addr cdsc_reladdr;
+};
+
+
+/* This struct is used by the CDROMREADTOCENTRY ioctl */
+struct cdrom_tocentry
+{
+ __u8 cdte_track;
+ __u8 cdte_adr :4;
+ __u8 cdte_ctrl :4;
+ __u8 cdte_format;
+ union cdrom_addr cdte_addr;
+ __u8 cdte_datamode;
+};
+
+/* This struct is used by the CDROMREADMODE1, and CDROMREADMODE2 ioctls */
+struct cdrom_read
+{
+ int cdread_lba;
+ char *cdread_bufaddr;
+ int cdread_buflen;
+};
+
+/* This struct is used by the CDROMREADAUDIO ioctl */
+struct cdrom_read_audio
+{
+ union cdrom_addr addr; /* frame address */
+ __u8 addr_format; /* CDROM_LBA or CDROM_MSF */
+ int nframes; /* number of 2352-byte-frames to read at once */
+ __u8 *buf; /* frame buffer (size: nframes*2352 bytes) */
+};
+
+/* This struct is used with the CDROMMULTISESSION ioctl */
+struct cdrom_multisession
+{
+ union cdrom_addr addr; /* frame address: start-of-last-session
+ (not the new "frame 16"!). Only valid
+ if the "xa_flag" is true. */
+ __u8 xa_flag; /* 1: "is XA disk" */
+ __u8 addr_format; /* CDROM_LBA or CDROM_MSF */
+};
+
+/* This struct is used with the CDROM_GET_MCN ioctl.
+ * Very few audio discs actually have Universal Product Code information,
+ * which should just be the Medium Catalog Number on the box. Also note
+ * that the way the codeis written on CD is _not_ uniform across all discs!
+ */
+struct cdrom_mcn
+{
+ __u8 medium_catalog_number[14]; /* 13 ASCII digits, null-terminated */
+};
+
+/* This is used by the CDROMPLAYBLK ioctl */
+struct cdrom_blk
+{
+ unsigned from;
+ unsigned short len;
+};
+
+#define CDROM_PACKET_SIZE 12
+
+#define CGC_DATA_UNKNOWN 0
+#define CGC_DATA_WRITE 1
+#define CGC_DATA_READ 2
+#define CGC_DATA_NONE 3
+
+/* for CDROM_PACKET_COMMAND ioctl */
+struct cdrom_generic_command
+{
+ unsigned char cmd[CDROM_PACKET_SIZE];
+ unsigned char *buffer;
+ unsigned int buflen;
+ int stat;
+ struct request_sense *sense;
+ unsigned char data_direction;
+ int quiet;
+ int timeout;
+ void *reserved[1]; /* unused, actually */
+};
+
+/*
+ * A CD-ROM physical sector size is 2048, 2052, 2056, 2324, 2332, 2336,
+ * 2340, or 2352 bytes long.
+
+* Sector types of the standard CD-ROM data formats:
+ *
+ * format sector type user data size (bytes)
+ * -----------------------------------------------------------------------------
+ * 1 (Red Book) CD-DA 2352 (CD_FRAMESIZE_RAW)
+ * 2 (Yellow Book) Mode1 Form1 2048 (CD_FRAMESIZE)
+ * 3 (Yellow Book) Mode1 Form2 2336 (CD_FRAMESIZE_RAW0)
+ * 4 (Green Book) Mode2 Form1 2048 (CD_FRAMESIZE)
+ * 5 (Green Book) Mode2 Form2 2328 (2324+4 spare bytes)
+ *
+ *
+ * The layout of the standard CD-ROM data formats:
+ * -----------------------------------------------------------------------------
+ * - audio (red): | audio_sample_bytes |
+ * | 2352 |
+ *
+ * - data (yellow, mode1): | sync - head - data - EDC - zero - ECC |
+ * | 12 - 4 - 2048 - 4 - 8 - 276 |
+ *
+ * - data (yellow, mode2): | sync - head - data |
+ * | 12 - 4 - 2336 |
+ *
+ * - XA data (green, mode2 form1): | sync - head - sub - data - EDC - ECC |
+ * | 12 - 4 - 8 - 2048 - 4 - 276 |
+ *
+ * - XA data (green, mode2 form2): | sync - head - sub - data - Spare |
+ * | 12 - 4 - 8 - 2324 - 4 |
+ *
+ */
+
+/* Some generally useful CD-ROM information -- mostly based on the above */
+#define CD_MINS 74 /* max. minutes per CD, not really a limit */
+#define CD_SECS 60 /* seconds per minute */
+#define CD_FRAMES 75 /* frames per second */
+#define CD_SYNC_SIZE 12 /* 12 sync bytes per raw data frame */
+#define CD_MSF_OFFSET 150 /* MSF numbering offset of first frame */
+#define CD_CHUNK_SIZE 24 /* lowest-level "data bytes piece" */
+#define CD_NUM_OF_CHUNKS 98 /* chunks per frame */
+#define CD_FRAMESIZE_SUB 96 /* subchannel data "frame" size */
+#define CD_HEAD_SIZE 4 /* header (address) bytes per raw data frame */
+#define CD_SUBHEAD_SIZE 8 /* subheader bytes per raw XA data frame */
+#define CD_EDC_SIZE 4 /* bytes EDC per most raw data frame types */
+#define CD_ZERO_SIZE 8 /* bytes zero per yellow book mode 1 frame */
+#define CD_ECC_SIZE 276 /* bytes ECC per most raw data frame types */
+#define CD_FRAMESIZE 2048 /* bytes per frame, "cooked" mode */
+#define CD_FRAMESIZE_RAW 2352 /* bytes per frame, "raw" mode */
+#define CD_FRAMESIZE_RAWER 2646 /* The maximum possible returned bytes */
+/* most drives don't deliver everything: */
+#define CD_FRAMESIZE_RAW1 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE) /*2340*/
+#define CD_FRAMESIZE_RAW0 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE-CD_HEAD_SIZE) /*2336*/
+
+#define CD_XA_HEAD (CD_HEAD_SIZE+CD_SUBHEAD_SIZE) /* "before data" part of raw XA frame */
+#define CD_XA_TAIL (CD_EDC_SIZE+CD_ECC_SIZE) /* "after data" part of raw XA frame */
+#define CD_XA_SYNC_HEAD (CD_SYNC_SIZE+CD_XA_HEAD) /* sync bytes + header of XA frame */
+
+/* CD-ROM address types (cdrom_tocentry.cdte_format) */
+#define CDROM_LBA 0x01 /* "logical block": first frame is #0 */
+#define CDROM_MSF 0x02 /* "minute-second-frame": binary, not bcd here! */
+
+/* bit to tell whether track is data or audio (cdrom_tocentry.cdte_ctrl) */
+#define CDROM_DATA_TRACK 0x04
+
+/* The leadout track is always 0xAA, regardless of # of tracks on disc */
+#define CDROM_LEADOUT 0xAA
+
+/* audio states (from SCSI-2, but seen with other drives, too) */
+#define CDROM_AUDIO_INVALID 0x00 /* audio status not supported */
+#define CDROM_AUDIO_PLAY 0x11 /* audio play operation in progress */
+#define CDROM_AUDIO_PAUSED 0x12 /* audio play operation paused */
+#define CDROM_AUDIO_COMPLETED 0x13 /* audio play successfully completed */
+#define CDROM_AUDIO_ERROR 0x14 /* audio play stopped due to error */
+#define CDROM_AUDIO_NO_STATUS 0x15 /* no current audio status to return */
+
+/* capability flags used with the uniform CD-ROM driver */
+#define CDC_CLOSE_TRAY 0x1 /* caddy systems _can't_ close */
+#define CDC_OPEN_TRAY 0x2 /* but _can_ eject. */
+#define CDC_LOCK 0x4 /* disable manual eject */
+#define CDC_SELECT_SPEED 0x8 /* programmable speed */
+#define CDC_SELECT_DISC 0x10 /* select disc from juke-box */
+#define CDC_MULTI_SESSION 0x20 /* read sessions>1 */
+#define CDC_MCN 0x40 /* Medium Catalog Number */
+#define CDC_MEDIA_CHANGED 0x80 /* media changed */
+#define CDC_PLAY_AUDIO 0x100 /* audio functions */
+#define CDC_RESET 0x200 /* hard reset device */
+#define CDC_DRIVE_STATUS 0x800 /* driver implements drive status */
+#define CDC_GENERIC_PACKET 0x1000 /* driver implements generic packets */
+#define CDC_CD_R 0x2000 /* drive is a CD-R */
+#define CDC_CD_RW 0x4000 /* drive is a CD-RW */
+#define CDC_DVD 0x8000 /* drive is a DVD */
+#define CDC_DVD_R 0x10000 /* drive can write DVD-R */
+#define CDC_DVD_RAM 0x20000 /* drive can write DVD-RAM */
+#define CDC_MO_DRIVE 0x40000 /* drive is an MO device */
+#define CDC_MRW 0x80000 /* drive can read MRW */
+#define CDC_MRW_W 0x100000 /* drive can write MRW */
+#define CDC_RAM 0x200000 /* ok to open for WRITE */
+
+/* drive status possibilities returned by CDROM_DRIVE_STATUS ioctl */
+#define CDS_NO_INFO 0 /* if not implemented */
+#define CDS_NO_DISC 1
+#define CDS_TRAY_OPEN 2
+#define CDS_DRIVE_NOT_READY 3
+#define CDS_DISC_OK 4
+
+/* return values for the CDROM_DISC_STATUS ioctl */
+/* can also return CDS_NO_[INFO|DISC], from above */
+#define CDS_AUDIO 100
+#define CDS_DATA_1 101
+#define CDS_DATA_2 102
+#define CDS_XA_2_1 103
+#define CDS_XA_2_2 104
+#define CDS_MIXED 105
+
+/* User-configurable behavior options for the uniform CD-ROM driver */
+#define CDO_AUTO_CLOSE 0x1 /* close tray on first open() */
+#define CDO_AUTO_EJECT 0x2 /* open tray on last release() */
+#define CDO_USE_FFLAGS 0x4 /* use O_NONBLOCK information on open */
+#define CDO_LOCK 0x8 /* lock tray on open files */
+#define CDO_CHECK_TYPE 0x10 /* check type on open for data */
+
+/* Special codes used when specifying changer slots. */
+#define CDSL_NONE (INT_MAX-1)
+#define CDSL_CURRENT INT_MAX
+
+/* For partition based multisession access. IDE can handle 64 partitions
+ * per drive - SCSI CD-ROM's use minors to differentiate between the
+ * various drives, so we can't do multisessions the same way there.
+ * Use the -o session=x option to mount on them.
+ */
+#define CD_PART_MAX 64
+#define CD_PART_MASK (CD_PART_MAX - 1)
+
+/*********************************************************************
+ * Generic Packet commands, MMC commands, and such
+ *********************************************************************/
+
+ /* The generic packet command opcodes for CD/DVD Logical Units,
+ * From Table 57 of the SFF8090 Ver. 3 (Mt. Fuji) draft standard. */
+#define GPCMD_BLANK 0xa1
+#define GPCMD_CLOSE_TRACK 0x5b
+#define GPCMD_FLUSH_CACHE 0x35
+#define GPCMD_FORMAT_UNIT 0x04
+#define GPCMD_GET_CONFIGURATION 0x46
+#define GPCMD_GET_EVENT_STATUS_NOTIFICATION 0x4a
+#define GPCMD_GET_PERFORMANCE 0xac
+#define GPCMD_INQUIRY 0x12
+#define GPCMD_LOAD_UNLOAD 0xa6
+#define GPCMD_MECHANISM_STATUS 0xbd
+#define GPCMD_MODE_SELECT_10 0x55
+#define GPCMD_MODE_SENSE_10 0x5a
+#define GPCMD_PAUSE_RESUME 0x4b
+#define GPCMD_PLAY_AUDIO_10 0x45
+#define GPCMD_PLAY_AUDIO_MSF 0x47
+#define GPCMD_PLAY_AUDIO_TI 0x48
+#define GPCMD_PLAY_CD 0xbc
+#define GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL 0x1e
+#define GPCMD_READ_10 0x28
+#define GPCMD_READ_12 0xa8
+#define GPCMD_READ_BUFFER 0x3c
+#define GPCMD_READ_BUFFER_CAPACITY 0x5c
+#define GPCMD_READ_CDVD_CAPACITY 0x25
+#define GPCMD_READ_CD 0xbe
+#define GPCMD_READ_CD_MSF 0xb9
+#define GPCMD_READ_DISC_INFO 0x51
+#define GPCMD_READ_DVD_STRUCTURE 0xad
+#define GPCMD_READ_FORMAT_CAPACITIES 0x23
+#define GPCMD_READ_HEADER 0x44
+#define GPCMD_READ_TRACK_RZONE_INFO 0x52
+#define GPCMD_READ_SUBCHANNEL 0x42
+#define GPCMD_READ_TOC_PMA_ATIP 0x43
+#define GPCMD_REPAIR_RZONE_TRACK 0x58
+#define GPCMD_REPORT_KEY 0xa4
+#define GPCMD_REQUEST_SENSE 0x03
+#define GPCMD_RESERVE_RZONE_TRACK 0x53
+#define GPCMD_SEND_CUE_SHEET 0x5d
+#define GPCMD_SCAN 0xba
+#define GPCMD_SEEK 0x2b
+#define GPCMD_SEND_DVD_STRUCTURE 0xbf
+#define GPCMD_SEND_EVENT 0xa2
+#define GPCMD_SEND_KEY 0xa3
+#define GPCMD_SEND_OPC 0x54
+#define GPCMD_SET_READ_AHEAD 0xa7
+#define GPCMD_SET_STREAMING 0xb6
+#define GPCMD_START_STOP_UNIT 0x1b
+#define GPCMD_STOP_PLAY_SCAN 0x4e
+#define GPCMD_TEST_UNIT_READY 0x00
+#define GPCMD_VERIFY_10 0x2f
+#define GPCMD_WRITE_10 0x2a
+#define GPCMD_WRITE_12 0xaa
+#define GPCMD_WRITE_AND_VERIFY_10 0x2e
+#define GPCMD_WRITE_BUFFER 0x3b
+/* This is listed as optional in ATAPI 2.6, but is (curiously)
+ * missing from Mt. Fuji, Table 57. It _is_ mentioned in Mt. Fuji
+ * Table 377 as an MMC command for SCSi devices though... Most ATAPI
+ * drives support it. */
+#define GPCMD_SET_SPEED 0xbb
+/* This seems to be a SCSI specific CD-ROM opcode
+ * to play data at track/index */
+#define GPCMD_PLAYAUDIO_TI 0x48
+/*
+ * From MS Media Status Notification Support Specification. For
+ * older drives only.
+ */
+#define GPCMD_GET_MEDIA_STATUS 0xda
+
+/* Mode page codes for mode sense/set */
+#define GPMODE_VENDOR_PAGE 0x00
+#define GPMODE_R_W_ERROR_PAGE 0x01
+#define GPMODE_WRITE_PARMS_PAGE 0x05
+#define GPMODE_WCACHING_PAGE 0x08
+#define GPMODE_AUDIO_CTL_PAGE 0x0e
+#define GPMODE_POWER_PAGE 0x1a
+#define GPMODE_FAULT_FAIL_PAGE 0x1c
+#define GPMODE_TO_PROTECT_PAGE 0x1d
+#define GPMODE_CAPABILITIES_PAGE 0x2a
+#define GPMODE_ALL_PAGES 0x3f
+/* Not in Mt. Fuji, but in ATAPI 2.6 -- deprecated now in favor
+ * of MODE_SENSE_POWER_PAGE */
+#define GPMODE_CDROM_PAGE 0x0d
+
+
+
+/* DVD struct types */
+#define DVD_STRUCT_PHYSICAL 0x00
+#define DVD_STRUCT_COPYRIGHT 0x01
+#define DVD_STRUCT_DISCKEY 0x02
+#define DVD_STRUCT_BCA 0x03
+#define DVD_STRUCT_MANUFACT 0x04
+
+struct dvd_layer {
+ __u8 book_version : 4;
+ __u8 book_type : 4;
+ __u8 min_rate : 4;
+ __u8 disc_size : 4;
+ __u8 layer_type : 4;
+ __u8 track_path : 1;
+ __u8 nlayers : 2;
+ __u8 track_density : 4;
+ __u8 linear_density : 4;
+ __u8 bca : 1;
+ __u32 start_sector;
+ __u32 end_sector;
+ __u32 end_sector_l0;
+};
+
+#define DVD_LAYERS 4
+
+struct dvd_physical {
+ __u8 type;
+ __u8 layer_num;
+ struct dvd_layer layer[DVD_LAYERS];
+};
+
+struct dvd_copyright {
+ __u8 type;
+
+ __u8 layer_num;
+ __u8 cpst;
+ __u8 rmi;
+};
+
+struct dvd_disckey {
+ __u8 type;
+
+ unsigned agid : 2;
+ __u8 value[2048];
+};
+
+struct dvd_bca {
+ __u8 type;
+
+ int len;
+ __u8 value[188];
+};
+
+struct dvd_manufact {
+ __u8 type;
+
+ __u8 layer_num;
+ int len;
+ __u8 value[2048];
+};
+
+typedef union {
+ __u8 type;
+
+ struct dvd_physical physical;
+ struct dvd_copyright copyright;
+ struct dvd_disckey disckey;
+ struct dvd_bca bca;
+ struct dvd_manufact manufact;
+} dvd_struct;
+
+/*
+ * DVD authentication ioctl
+ */
+
+/* Authentication states */
+#define DVD_LU_SEND_AGID 0
+#define DVD_HOST_SEND_CHALLENGE 1
+#define DVD_LU_SEND_KEY1 2
+#define DVD_LU_SEND_CHALLENGE 3
+#define DVD_HOST_SEND_KEY2 4
+
+/* Termination states */
+#define DVD_AUTH_ESTABLISHED 5
+#define DVD_AUTH_FAILURE 6
+
+/* Other functions */
+#define DVD_LU_SEND_TITLE_KEY 7
+#define DVD_LU_SEND_ASF 8
+#define DVD_INVALIDATE_AGID 9
+#define DVD_LU_SEND_RPC_STATE 10
+#define DVD_HOST_SEND_RPC_STATE 11
+
+/* State data */
+typedef __u8 dvd_key[5]; /* 40-bit value, MSB is first elem. */
+typedef __u8 dvd_challenge[10]; /* 80-bit value, MSB is first elem. */
+
+struct dvd_lu_send_agid {
+ __u8 type;
+ unsigned agid : 2;
+};
+
+struct dvd_host_send_challenge {
+ __u8 type;
+ unsigned agid : 2;
+
+ dvd_challenge chal;
+};
+
+struct dvd_send_key {
+ __u8 type;
+ unsigned agid : 2;
+
+ dvd_key key;
+};
+
+struct dvd_lu_send_challenge {
+ __u8 type;
+ unsigned agid : 2;
+
+ dvd_challenge chal;
+};
+
+#define DVD_CPM_NO_COPYRIGHT 0
+#define DVD_CPM_COPYRIGHTED 1
+
+#define DVD_CP_SEC_NONE 0
+#define DVD_CP_SEC_EXIST 1
+
+#define DVD_CGMS_UNRESTRICTED 0
+#define DVD_CGMS_SINGLE 2
+#define DVD_CGMS_RESTRICTED 3
+
+struct dvd_lu_send_title_key {
+ __u8 type;
+ unsigned agid : 2;
+
+ dvd_key title_key;
+ int lba;
+ unsigned cpm : 1;
+ unsigned cp_sec : 1;
+ unsigned cgms : 2;
+};
+
+struct dvd_lu_send_asf {
+ __u8 type;
+ unsigned agid : 2;
+
+ unsigned asf : 1;
+};
+
+struct dvd_host_send_rpcstate {
+ __u8 type;
+ __u8 pdrc;
+};
+
+struct dvd_lu_send_rpcstate {
+ __u8 type : 2;
+ __u8 vra : 3;
+ __u8 ucca : 3;
+ __u8 region_mask;
+ __u8 rpc_scheme;
+};
+
+typedef union {
+ __u8 type;
+
+ struct dvd_lu_send_agid lsa;
+ struct dvd_host_send_challenge hsc;
+ struct dvd_send_key lsk;
+ struct dvd_lu_send_challenge lsc;
+ struct dvd_send_key hsk;
+ struct dvd_lu_send_title_key lstk;
+ struct dvd_lu_send_asf lsasf;
+ struct dvd_host_send_rpcstate hrpcs;
+ struct dvd_lu_send_rpcstate lrpcs;
+} dvd_authinfo;
+
+struct request_sense {
+#if defined(__BIG_ENDIAN_BITFIELD)
+ __u8 valid : 1;
+ __u8 error_code : 7;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 error_code : 7;
+ __u8 valid : 1;
+#endif
+ __u8 segment_number;
+#if defined(__BIG_ENDIAN_BITFIELD)
+ __u8 reserved1 : 2;
+ __u8 ili : 1;
+ __u8 reserved2 : 1;
+ __u8 sense_key : 4;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 sense_key : 4;
+ __u8 reserved2 : 1;
+ __u8 ili : 1;
+ __u8 reserved1 : 2;
+#endif
+ __u8 information[4];
+ __u8 add_sense_len;
+ __u8 command_info[4];
+ __u8 asc;
+ __u8 ascq;
+ __u8 fruc;
+ __u8 sks[3];
+ __u8 asb[46];
+};
+
+/*
+ * feature profile
+ */
+#define CDF_RWRT 0x0020 /* "Random Writable" */
+#define CDF_HWDM 0x0024 /* "Hardware Defect Management" */
+#define CDF_MRW 0x0028
+
+/*
+ * media status bits
+ */
+#define CDM_MRW_NOTMRW 0
+#define CDM_MRW_BGFORMAT_INACTIVE 1
+#define CDM_MRW_BGFORMAT_ACTIVE 2
+#define CDM_MRW_BGFORMAT_COMPLETE 3
+
+/*
+ * mrw address spaces
+ */
+#define MRW_LBA_DMA 0
+#define MRW_LBA_GAA 1
+
+/*
+ * mrw mode pages (first is deprecated) -- probed at init time and
+ * cdi->mrw_mode_page is set
+ */
+#define MRW_MODE_PC_PRE1 0x2c
+#define MRW_MODE_PC 0x03
+
+struct mrw_feature_desc {
+ __be16 feature_code;
+#if defined(__BIG_ENDIAN_BITFIELD)
+ __u8 reserved1 : 2;
+ __u8 feature_version : 4;
+ __u8 persistent : 1;
+ __u8 curr : 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 curr : 1;
+ __u8 persistent : 1;
+ __u8 feature_version : 4;
+ __u8 reserved1 : 2;
+#endif
+ __u8 add_len;
+#if defined(__BIG_ENDIAN_BITFIELD)
+ __u8 reserved2 : 7;
+ __u8 write : 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 write : 1;
+ __u8 reserved2 : 7;
+#endif
+ __u8 reserved3;
+ __u8 reserved4;
+ __u8 reserved5;
+};
+
+/* cf. mmc4r02g.pdf 5.3.10 Random Writable Feature (0020h) pg 197 of 635 */
+struct rwrt_feature_desc {
+ __be16 feature_code;
+#if defined(__BIG_ENDIAN_BITFIELD)
+ __u8 reserved1 : 2;
+ __u8 feature_version : 4;
+ __u8 persistent : 1;
+ __u8 curr : 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 curr : 1;
+ __u8 persistent : 1;
+ __u8 feature_version : 4;
+ __u8 reserved1 : 2;
+#endif
+ __u8 add_len;
+ __u32 last_lba;
+ __u32 block_size;
+ __u16 blocking;
+#if defined(__BIG_ENDIAN_BITFIELD)
+ __u8 reserved2 : 7;
+ __u8 page_present : 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 page_present : 1;
+ __u8 reserved2 : 7;
+#endif
+ __u8 reserved3;
+};
+
+typedef struct {
+ __be16 disc_information_length;
+#if defined(__BIG_ENDIAN_BITFIELD)
+ __u8 reserved1 : 3;
+ __u8 erasable : 1;
+ __u8 border_status : 2;
+ __u8 disc_status : 2;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 disc_status : 2;
+ __u8 border_status : 2;
+ __u8 erasable : 1;
+ __u8 reserved1 : 3;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+ __u8 n_first_track;
+ __u8 n_sessions_lsb;
+ __u8 first_track_lsb;
+ __u8 last_track_lsb;
+#if defined(__BIG_ENDIAN_BITFIELD)
+ __u8 did_v : 1;
+ __u8 dbc_v : 1;
+ __u8 uru : 1;
+ __u8 reserved2 : 2;
+ __u8 dbit : 1;
+ __u8 mrw_status : 2;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 mrw_status : 2;
+ __u8 dbit : 1;
+ __u8 reserved2 : 2;
+ __u8 uru : 1;
+ __u8 dbc_v : 1;
+ __u8 did_v : 1;
+#endif
+ __u8 disc_type;
+ __u8 n_sessions_msb;
+ __u8 first_track_msb;
+ __u8 last_track_msb;
+ __u32 disc_id;
+ __u32 lead_in;
+ __u32 lead_out;
+ __u8 disc_bar_code[8];
+ __u8 reserved3;
+ __u8 n_opc;
+} disc_information;
+
+typedef struct {
+ __be16 track_information_length;
+ __u8 track_lsb;
+ __u8 session_lsb;
+ __u8 reserved1;
+#if defined(__BIG_ENDIAN_BITFIELD)
+ __u8 reserved2 : 2;
+ __u8 damage : 1;
+ __u8 copy : 1;
+ __u8 track_mode : 4;
+ __u8 rt : 1;
+ __u8 blank : 1;
+ __u8 packet : 1;
+ __u8 fp : 1;
+ __u8 data_mode : 4;
+ __u8 reserved3 : 6;
+ __u8 lra_v : 1;
+ __u8 nwa_v : 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 track_mode : 4;
+ __u8 copy : 1;
+ __u8 damage : 1;
+ __u8 reserved2 : 2;
+ __u8 data_mode : 4;
+ __u8 fp : 1;
+ __u8 packet : 1;
+ __u8 blank : 1;
+ __u8 rt : 1;
+ __u8 nwa_v : 1;
+ __u8 lra_v : 1;
+ __u8 reserved3 : 6;
+#endif
+ __be32 track_start;
+ __be32 next_writable;
+ __be32 free_blocks;
+ __be32 fixed_packet_size;
+ __be32 track_size;
+ __be32 last_rec_address;
+} track_information;
+
+struct feature_header {
+ __u32 data_len;
+ __u8 reserved1;
+ __u8 reserved2;
+ __u16 curr_profile;
+};
+
+struct mode_page_header {
+ __be16 mode_data_length;
+ __u8 medium_type;
+ __u8 reserved1;
+ __u8 reserved2;
+ __u8 reserved3;
+ __be16 desc_length;
+};
+
+
+#endif /* _LINUX_CDROM_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cgroupstats.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cgroupstats.h
new file mode 100644
index 0000000..3753c33
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cgroupstats.h
@@ -0,0 +1,71 @@
+/* cgroupstats.h - exporting per-cgroup statistics
+ *
+ * Copyright IBM Corporation, 2007
+ * Author Balbir Singh <balbir@linux.vnet.ibm.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2.1 of the GNU Lesser General Public License
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#ifndef _LINUX_CGROUPSTATS_H
+#define _LINUX_CGROUPSTATS_H
+
+#include <linux/types.h>
+#include <linux/taskstats.h>
+
+/*
+ * Data shared between user space and kernel space on a per cgroup
+ * basis. This data is shared using taskstats.
+ *
+ * Most of these states are derived by looking at the task->state value
+ * For the nr_io_wait state, a flag in the delay accounting structure
+ * indicates that the task is waiting on IO
+ *
+ * Each member is aligned to a 8 byte boundary.
+ */
+struct cgroupstats {
+ __u64 nr_sleeping; /* Number of tasks sleeping */
+ __u64 nr_running; /* Number of tasks running */
+ __u64 nr_stopped; /* Number of tasks in stopped state */
+ __u64 nr_uninterruptible; /* Number of tasks in uninterruptible */
+ /* state */
+ __u64 nr_io_wait; /* Number of tasks waiting on IO */
+};
+
+/*
+ * Commands sent from userspace
+ * Not versioned. New commands should only be inserted at the enum's end
+ * prior to __CGROUPSTATS_CMD_MAX
+ */
+
+enum {
+ CGROUPSTATS_CMD_UNSPEC = __TASKSTATS_CMD_MAX, /* Reserved */
+ CGROUPSTATS_CMD_GET, /* user->kernel request/get-response */
+ CGROUPSTATS_CMD_NEW, /* kernel->user event */
+ __CGROUPSTATS_CMD_MAX,
+};
+
+#define CGROUPSTATS_CMD_MAX (__CGROUPSTATS_CMD_MAX - 1)
+
+enum {
+ CGROUPSTATS_TYPE_UNSPEC = 0, /* Reserved */
+ CGROUPSTATS_TYPE_CGROUP_STATS, /* contains name + stats */
+ __CGROUPSTATS_TYPE_MAX,
+};
+
+#define CGROUPSTATS_TYPE_MAX (__CGROUPSTATS_TYPE_MAX - 1)
+
+enum {
+ CGROUPSTATS_CMD_ATTR_UNSPEC = 0,
+ CGROUPSTATS_CMD_ATTR_FD,
+ __CGROUPSTATS_CMD_ATTR_MAX,
+};
+
+#define CGROUPSTATS_CMD_ATTR_MAX (__CGROUPSTATS_CMD_ATTR_MAX - 1)
+
+#endif /* _LINUX_CGROUPSTATS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/chio.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/chio.h
new file mode 100644
index 0000000..6e0af99
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/chio.h
@@ -0,0 +1,168 @@
+/*
+ * ioctl interface for the scsi media changer driver
+ */
+
+/* changer element types */
+#define CHET_MT 0 /* media transport element (robot) */
+#define CHET_ST 1 /* storage element (media slots) */
+#define CHET_IE 2 /* import/export element */
+#define CHET_DT 3 /* data transfer element (tape/cdrom/whatever) */
+#define CHET_V1 4 /* vendor specific #1 */
+#define CHET_V2 5 /* vendor specific #2 */
+#define CHET_V3 6 /* vendor specific #3 */
+#define CHET_V4 7 /* vendor specific #4 */
+
+
+/*
+ * CHIOGPARAMS
+ * query changer properties
+ *
+ * CHIOVGPARAMS
+ * query vendor-specific element types
+ *
+ * accessing elements works by specifing type and unit of the element.
+ * for eample, storage elements are addressed with type = CHET_ST and
+ * unit = 0 .. cp_nslots-1
+ *
+ */
+struct changer_params {
+ int cp_curpicker; /* current transport element */
+ int cp_npickers; /* number of transport elements (CHET_MT) */
+ int cp_nslots; /* number of storage elements (CHET_ST) */
+ int cp_nportals; /* number of import/export elements (CHET_IE) */
+ int cp_ndrives; /* number of data transfer elements (CHET_DT) */
+};
+struct changer_vendor_params {
+ int cvp_n1; /* number of vendor specific elems (CHET_V1) */
+ char cvp_label1[16];
+ int cvp_n2; /* number of vendor specific elems (CHET_V2) */
+ char cvp_label2[16];
+ int cvp_n3; /* number of vendor specific elems (CHET_V3) */
+ char cvp_label3[16];
+ int cvp_n4; /* number of vendor specific elems (CHET_V4) */
+ char cvp_label4[16];
+ int reserved[8];
+};
+
+
+/*
+ * CHIOMOVE
+ * move a medium from one element to another
+ */
+struct changer_move {
+ int cm_fromtype; /* type/unit of source element */
+ int cm_fromunit;
+ int cm_totype; /* type/unit of destination element */
+ int cm_tounit;
+ int cm_flags;
+};
+#define CM_INVERT 1 /* flag: rotate media (for double-sided like MOD) */
+
+
+/*
+ * CHIOEXCHANGE
+ * move one medium from element #1 to element #2,
+ * and another one from element #2 to element #3.
+ * element #1 and #3 are allowed to be identical.
+ */
+struct changer_exchange {
+ int ce_srctype; /* type/unit of element #1 */
+ int ce_srcunit;
+ int ce_fdsttype; /* type/unit of element #2 */
+ int ce_fdstunit;
+ int ce_sdsttype; /* type/unit of element #3 */
+ int ce_sdstunit;
+ int ce_flags;
+};
+#define CE_INVERT1 1
+#define CE_INVERT2 2
+
+
+/*
+ * CHIOPOSITION
+ * move the transport element (robot arm) to a specific element.
+ */
+struct changer_position {
+ int cp_type;
+ int cp_unit;
+ int cp_flags;
+};
+#define CP_INVERT 1
+
+
+/*
+ * CHIOGSTATUS
+ * get element status for all elements of a specific type
+ */
+struct changer_element_status {
+ int ces_type;
+ unsigned char *ces_data;
+};
+#define CESTATUS_FULL 0x01 /* full */
+#define CESTATUS_IMPEXP 0x02 /* media was imported (inserted by sysop) */
+#define CESTATUS_EXCEPT 0x04 /* error condition */
+#define CESTATUS_ACCESS 0x08 /* access allowed */
+#define CESTATUS_EXENAB 0x10 /* element can export media */
+#define CESTATUS_INENAB 0x20 /* element can import media */
+
+
+/*
+ * CHIOGELEM
+ * get more detailed status information for a single element
+ */
+struct changer_get_element {
+ int cge_type; /* type/unit */
+ int cge_unit;
+ int cge_status; /* status */
+ int cge_errno; /* errno */
+ int cge_srctype; /* source element of the last move/exchange */
+ int cge_srcunit;
+ int cge_id; /* scsi id (for data transfer elements) */
+ int cge_lun; /* scsi lun (for data transfer elements) */
+ char cge_pvoltag[36]; /* primary volume tag */
+ char cge_avoltag[36]; /* alternate volume tag */
+ int cge_flags;
+};
+/* flags */
+#define CGE_ERRNO 0x01 /* errno available */
+#define CGE_INVERT 0x02 /* media inverted */
+#define CGE_SRC 0x04 /* media src available */
+#define CGE_IDLUN 0x08 /* ID+LUN available */
+#define CGE_PVOLTAG 0x10 /* primary volume tag available */
+#define CGE_AVOLTAG 0x20 /* alternate volume tag available */
+
+
+/*
+ * CHIOSVOLTAG
+ * set volume tag
+ */
+struct changer_set_voltag {
+ int csv_type; /* type/unit */
+ int csv_unit;
+ char csv_voltag[36]; /* volume tag */
+ int csv_flags;
+};
+#define CSV_PVOLTAG 0x01 /* primary volume tag */
+#define CSV_AVOLTAG 0x02 /* alternate volume tag */
+#define CSV_CLEARTAG 0x04 /* clear volume tag */
+
+/* ioctls */
+#define CHIOMOVE _IOW('c', 1,struct changer_move)
+#define CHIOEXCHANGE _IOW('c', 2,struct changer_exchange)
+#define CHIOPOSITION _IOW('c', 3,struct changer_position)
+#define CHIOGPICKER _IOR('c', 4,int) /* not impl. */
+#define CHIOSPICKER _IOW('c', 5,int) /* not impl. */
+#define CHIOGPARAMS _IOR('c', 6,struct changer_params)
+#define CHIOGSTATUS _IOW('c', 8,struct changer_element_status)
+#define CHIOGELEM _IOW('c',16,struct changer_get_element)
+#define CHIOINITELEM _IO('c',17)
+#define CHIOSVOLTAG _IOW('c',18,struct changer_set_voltag)
+#define CHIOGVPARAMS _IOR('c',19,struct changer_vendor_params)
+
+/* ---------------------------------------------------------------------- */
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cm4000_cs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cm4000_cs.h
new file mode 100644
index 0000000..2292880
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cm4000_cs.h
@@ -0,0 +1,62 @@
+#ifndef _CM4000_H_
+#define _CM4000_H_
+
+#include <linux/types.h>
+
+#define MAX_ATR 33
+
+#define CM4000_MAX_DEV 4
+
+/* those two structures are passed via ioctl() from/to userspace. They are
+ * used by existing userspace programs, so I kepth the awkward "bIFSD" naming
+ * not to break compilation of userspace apps. -HW */
+
+typedef struct atreq {
+ __s32 atr_len;
+ unsigned char atr[64];
+ __s32 power_act;
+ unsigned char bIFSD;
+ unsigned char bIFSC;
+} atreq_t;
+
+
+/* what is particularly stupid in the original driver is the arch-dependant
+ * member sizes. This leads to CONFIG_COMPAT breakage, since 32bit userspace
+ * will lay out the structure members differently than the 64bit kernel.
+ *
+ * I've changed "ptsreq.protocol" from "unsigned long" to "__u32".
+ * On 32bit this will make no difference. With 64bit kernels, it will make
+ * 32bit apps work, too.
+ */
+
+typedef struct ptsreq {
+ __u32 protocol; /*T=0: 2^0, T=1: 2^1*/
+ unsigned char flags;
+ unsigned char pts1;
+ unsigned char pts2;
+ unsigned char pts3;
+} ptsreq_t;
+
+#define CM_IOC_MAGIC 'c'
+#define CM_IOC_MAXNR 255
+
+#define CM_IOCGSTATUS _IOR (CM_IOC_MAGIC, 0, unsigned char *)
+#define CM_IOCGATR _IOWR(CM_IOC_MAGIC, 1, atreq_t *)
+#define CM_IOCSPTS _IOW (CM_IOC_MAGIC, 2, ptsreq_t *)
+#define CM_IOCSRDR _IO (CM_IOC_MAGIC, 3)
+#define CM_IOCARDOFF _IO (CM_IOC_MAGIC, 4)
+
+#define CM_IOSDBGLVL _IOW(CM_IOC_MAGIC, 250, int*)
+
+/* card and device states */
+#define CM_CARD_INSERTED 0x01
+#define CM_CARD_POWERED 0x02
+#define CM_ATR_PRESENT 0x04
+#define CM_ATR_VALID 0x08
+#define CM_STATE_VALID 0x0f
+/* extra info only from CM4000 */
+#define CM_NO_READER 0x10
+#define CM_BAD_CARD 0x20
+
+
+#endif /* _CM4000_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cn_proc.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cn_proc.h
new file mode 100644
index 0000000..d51c7a6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cn_proc.h
@@ -0,0 +1,100 @@
+/*
+ * cn_proc.h - process events connector
+ *
+ * Copyright (C) Matt Helsley, IBM Corp. 2005
+ * Based on cn_fork.h by Nguyen Anh Quynh and Guillaume Thouvenin
+ * Copyright (C) 2005 Nguyen Anh Quynh <aquynh@gmail.com>
+ * Copyright (C) 2005 Guillaume Thouvenin <guillaume.thouvenin@bull.net>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2.1 of the GNU Lesser General Public License
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#ifndef CN_PROC_H
+#define CN_PROC_H
+
+#include <linux/types.h>
+
+/*
+ * Userspace sends this enum to register with the kernel that it is listening
+ * for events on the connector.
+ */
+enum proc_cn_mcast_op {
+ PROC_CN_MCAST_LISTEN = 1,
+ PROC_CN_MCAST_IGNORE = 2
+};
+
+/*
+ * From the user's point of view, the process
+ * ID is the thread group ID and thread ID is the internal
+ * kernel "pid". So, fields are assigned as follow:
+ *
+ * In user space - In kernel space
+ *
+ * parent process ID = parent->tgid
+ * parent thread ID = parent->pid
+ * child process ID = child->tgid
+ * child thread ID = child->pid
+ */
+
+struct proc_event {
+ enum what {
+ /* Use successive bits so the enums can be used to record
+ * sets of events as well
+ */
+ PROC_EVENT_NONE = 0x00000000,
+ PROC_EVENT_FORK = 0x00000001,
+ PROC_EVENT_EXEC = 0x00000002,
+ PROC_EVENT_UID = 0x00000004,
+ PROC_EVENT_GID = 0x00000040,
+ /* "next" should be 0x00000400 */
+ /* "last" is the last process event: exit */
+ PROC_EVENT_EXIT = 0x80000000
+ } what;
+ __u32 cpu;
+ __u64 __attribute__((aligned(8))) timestamp_ns;
+ /* Number of nano seconds since system boot */
+ union { /* must be last field of proc_event struct */
+ struct {
+ __u32 err;
+ } ack;
+
+ struct fork_proc_event {
+ __kernel_pid_t parent_pid;
+ __kernel_pid_t parent_tgid;
+ __kernel_pid_t child_pid;
+ __kernel_pid_t child_tgid;
+ } fork;
+
+ struct exec_proc_event {
+ __kernel_pid_t process_pid;
+ __kernel_pid_t process_tgid;
+ } exec;
+
+ struct id_proc_event {
+ __kernel_pid_t process_pid;
+ __kernel_pid_t process_tgid;
+ union {
+ __u32 ruid; /* task uid */
+ __u32 rgid; /* task gid */
+ } r;
+ union {
+ __u32 euid;
+ __u32 egid;
+ } e;
+ } id;
+
+ struct exit_proc_event {
+ __kernel_pid_t process_pid;
+ __kernel_pid_t process_tgid;
+ __u32 exit_code, exit_signal;
+ } exit;
+ } event_data;
+};
+
+#endif /* CN_PROC_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/coda.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/coda.h
new file mode 100644
index 0000000..420c7ea
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/coda.h
@@ -0,0 +1,737 @@
+/*
+ You may distribute this file under either of the two licenses that
+ follow at your discretion.
+*/
+
+/* BLURB lgpl
+
+ Coda File System
+ Release 5
+
+ Copyright (c) 1987-1999 Carnegie Mellon University
+ Additional copyrights listed below
+
+This code is distributed "AS IS" without warranty of any kind under
+the terms of the GNU Library General Public Licence Version 2, as
+shown in the file LICENSE, or under the license shown below. The
+technical and financial contributors to Coda are listed in the file
+CREDITS.
+
+ Additional copyrights
+*/
+
+/*
+
+ Coda: an Experimental Distributed File System
+ Release 4.0
+
+ Copyright (c) 1987-1999 Carnegie Mellon University
+ All Rights Reserved
+
+Permission to use, copy, modify and distribute this software and its
+documentation is hereby granted, provided that both the copyright
+notice and this permission notice appear in all copies of the
+software, derivative works or modified versions, and any portions
+thereof, and that both notices appear in supporting documentation, and
+that credit is given to Carnegie Mellon University in all documents
+and publicity pertaining to direct or indirect use of this code or its
+derivatives.
+
+CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
+SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
+FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
+DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
+RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
+ANY DERIVATIVE WORK.
+
+Carnegie Mellon encourages users of this software to return any
+improvements or extensions that they make, and to grant Carnegie
+Mellon the rights to redistribute these changes without encumbrance.
+*/
+
+/*
+ *
+ * Based on cfs.h from Mach, but revamped for increased simplicity.
+ * Linux modifications by
+ * Peter Braam, Aug 1996
+ */
+
+#ifndef _CODA_HEADER_
+#define _CODA_HEADER_
+
+
+/* Catch new _KERNEL defn for NetBSD and DJGPP/__CYGWIN32__ */
+#if defined(__NetBSD__) || \
+ ((defined(DJGPP) || defined(__CYGWIN32__)) && !defined(KERNEL))
+#include <sys/types.h>
+#endif
+
+#ifndef CODA_MAXSYMLINKS
+#define CODA_MAXSYMLINKS 10
+#endif
+
+#if defined(DJGPP) || defined(__CYGWIN32__)
+#ifdef KERNEL
+typedef unsigned long u_long;
+typedef unsigned int u_int;
+typedef unsigned short u_short;
+typedef u_long ino_t;
+typedef u_long dev_t;
+typedef void * caddr_t;
+#ifdef DOS
+typedef unsigned __int64 u_quad_t;
+#else
+typedef unsigned long long u_quad_t;
+#endif
+
+#define __inline__
+
+struct timespec {
+ long ts_sec;
+ long ts_nsec;
+};
+#else /* DJGPP but not KERNEL */
+#include <sys/time.h>
+typedef unsigned long long u_quad_t;
+#endif /* !KERNEL */
+#endif /* !DJGPP */
+
+
+#if defined(__linux__)
+#include <linux/time.h>
+#define cdev_t u_quad_t
+#if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2)
+#define _UQUAD_T_ 1
+typedef unsigned long long u_quad_t;
+#endif
+#else
+#define cdev_t dev_t
+#endif
+
+#ifdef __CYGWIN32__
+struct timespec {
+ time_t tv_sec; /* seconds */
+ long tv_nsec; /* nanoseconds */
+};
+#endif
+
+#ifndef __BIT_TYPES_DEFINED__
+#define __BIT_TYPES_DEFINED__
+typedef signed char int8_t;
+typedef unsigned char u_int8_t;
+typedef short int16_t;
+typedef unsigned short u_int16_t;
+typedef int int32_t;
+typedef unsigned int u_int32_t;
+#endif
+
+
+/*
+ * Cfs constants
+ */
+#define CODA_MAXNAMLEN 255
+#define CODA_MAXPATHLEN 1024
+#define CODA_MAXSYMLINK 10
+
+/* these are Coda's version of O_RDONLY etc combinations
+ * to deal with VFS open modes
+ */
+#define C_O_READ 0x001
+#define C_O_WRITE 0x002
+#define C_O_TRUNC 0x010
+#define C_O_EXCL 0x100
+#define C_O_CREAT 0x200
+
+/* these are to find mode bits in Venus */
+#define C_M_READ 00400
+#define C_M_WRITE 00200
+
+/* for access Venus will use */
+#define C_A_C_OK 8 /* Test for writing upon create. */
+#define C_A_R_OK 4 /* Test for read permission. */
+#define C_A_W_OK 2 /* Test for write permission. */
+#define C_A_X_OK 1 /* Test for execute permission. */
+#define C_A_F_OK 0 /* Test for existence. */
+
+
+
+#ifndef _VENUS_DIRENT_T_
+#define _VENUS_DIRENT_T_ 1
+struct venus_dirent {
+ u_int32_t d_fileno; /* file number of entry */
+ u_int16_t d_reclen; /* length of this record */
+ u_int8_t d_type; /* file type, see below */
+ u_int8_t d_namlen; /* length of string in d_name */
+ char d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */
+};
+#undef DIRSIZ
+#define DIRSIZ(dp) ((sizeof (struct venus_dirent) - (CODA_MAXNAMLEN+1)) + \
+ (((dp)->d_namlen+1 + 3) &~ 3))
+
+/*
+ * File types
+ */
+#define CDT_UNKNOWN 0
+#define CDT_FIFO 1
+#define CDT_CHR 2
+#define CDT_DIR 4
+#define CDT_BLK 6
+#define CDT_REG 8
+#define CDT_LNK 10
+#define CDT_SOCK 12
+#define CDT_WHT 14
+
+/*
+ * Convert between stat structure types and directory types.
+ */
+#define IFTOCDT(mode) (((mode) & 0170000) >> 12)
+#define CDTTOIF(dirtype) ((dirtype) << 12)
+
+#endif
+
+#ifndef _VUID_T_
+#define _VUID_T_
+typedef u_int32_t vuid_t;
+typedef u_int32_t vgid_t;
+#endif /*_VUID_T_ */
+
+struct CodaFid {
+ u_int32_t opaque[4];
+};
+
+#define coda_f2i(fid)\
+ (fid ? (fid->opaque[3] ^ (fid->opaque[2]<<10) ^ (fid->opaque[1]<<20) ^ fid->opaque[0]) : 0)
+
+#ifndef _VENUS_VATTR_T_
+#define _VENUS_VATTR_T_
+/*
+ * Vnode types. VNON means no type.
+ */
+enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
+
+struct coda_vattr {
+ long va_type; /* vnode type (for create) */
+ u_short va_mode; /* files access mode and type */
+ short va_nlink; /* number of references to file */
+ vuid_t va_uid; /* owner user id */
+ vgid_t va_gid; /* owner group id */
+ long va_fileid; /* file id */
+ u_quad_t va_size; /* file size in bytes */
+ long va_blocksize; /* blocksize preferred for i/o */
+ struct timespec va_atime; /* time of last access */
+ struct timespec va_mtime; /* time of last modification */
+ struct timespec va_ctime; /* time file changed */
+ u_long va_gen; /* generation number of file */
+ u_long va_flags; /* flags defined for file */
+ cdev_t va_rdev; /* device special file represents */
+ u_quad_t va_bytes; /* bytes of disk space held by file */
+ u_quad_t va_filerev; /* file modification number */
+};
+
+#endif
+
+/* structure used by CODA_STATFS for getting cache information from venus */
+struct coda_statfs {
+ int32_t f_blocks;
+ int32_t f_bfree;
+ int32_t f_bavail;
+ int32_t f_files;
+ int32_t f_ffree;
+};
+
+/*
+ * Kernel <--> Venus communications.
+ */
+
+#define CODA_ROOT 2
+#define CODA_OPEN_BY_FD 3
+#define CODA_OPEN 4
+#define CODA_CLOSE 5
+#define CODA_IOCTL 6
+#define CODA_GETATTR 7
+#define CODA_SETATTR 8
+#define CODA_ACCESS 9
+#define CODA_LOOKUP 10
+#define CODA_CREATE 11
+#define CODA_REMOVE 12
+#define CODA_LINK 13
+#define CODA_RENAME 14
+#define CODA_MKDIR 15
+#define CODA_RMDIR 16
+#define CODA_SYMLINK 18
+#define CODA_READLINK 19
+#define CODA_FSYNC 20
+#define CODA_VGET 22
+#define CODA_SIGNAL 23
+#define CODA_REPLACE 24 /* DOWNCALL */
+#define CODA_FLUSH 25 /* DOWNCALL */
+#define CODA_PURGEUSER 26 /* DOWNCALL */
+#define CODA_ZAPFILE 27 /* DOWNCALL */
+#define CODA_ZAPDIR 28 /* DOWNCALL */
+#define CODA_PURGEFID 30 /* DOWNCALL */
+#define CODA_OPEN_BY_PATH 31
+#define CODA_RESOLVE 32
+#define CODA_REINTEGRATE 33
+#define CODA_STATFS 34
+#define CODA_STORE 35
+#define CODA_RELEASE 36
+#define CODA_NCALLS 37
+
+#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
+
+#define VC_MAXDATASIZE 8192
+#define VC_MAXMSGSIZE sizeof(union inputArgs)+sizeof(union outputArgs) +\
+ VC_MAXDATASIZE
+
+#define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)
+
+#define CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */
+
+/*
+ * Venus <-> Coda RPC arguments
+ */
+struct coda_in_hdr {
+ u_int32_t opcode;
+ u_int32_t unique; /* Keep multiple outstanding msgs distinct */
+ pid_t pid;
+ pid_t pgid;
+ vuid_t uid;
+};
+
+/* Really important that opcode and unique are 1st two fields! */
+struct coda_out_hdr {
+ u_int32_t opcode;
+ u_int32_t unique;
+ u_int32_t result;
+};
+
+/* coda_root: NO_IN */
+struct coda_root_out {
+ struct coda_out_hdr oh;
+ struct CodaFid VFid;
+};
+
+struct coda_root_in {
+ struct coda_in_hdr in;
+};
+
+/* coda_open: */
+struct coda_open_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int flags;
+};
+
+struct coda_open_out {
+ struct coda_out_hdr oh;
+ cdev_t dev;
+ ino_t inode;
+};
+
+
+/* coda_store: */
+struct coda_store_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int flags;
+};
+
+struct coda_store_out {
+ struct coda_out_hdr out;
+};
+
+/* coda_release: */
+struct coda_release_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int flags;
+};
+
+struct coda_release_out {
+ struct coda_out_hdr out;
+};
+
+/* coda_close: */
+struct coda_close_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int flags;
+};
+
+struct coda_close_out {
+ struct coda_out_hdr out;
+};
+
+/* coda_ioctl: */
+struct coda_ioctl_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int cmd;
+ int len;
+ int rwflag;
+ char *data; /* Place holder for data. */
+};
+
+struct coda_ioctl_out {
+ struct coda_out_hdr oh;
+ int len;
+ caddr_t data; /* Place holder for data. */
+};
+
+
+/* coda_getattr: */
+struct coda_getattr_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+};
+
+struct coda_getattr_out {
+ struct coda_out_hdr oh;
+ struct coda_vattr attr;
+};
+
+
+/* coda_setattr: NO_OUT */
+struct coda_setattr_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ struct coda_vattr attr;
+};
+
+struct coda_setattr_out {
+ struct coda_out_hdr out;
+};
+
+/* coda_access: NO_OUT */
+struct coda_access_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int flags;
+};
+
+struct coda_access_out {
+ struct coda_out_hdr out;
+};
+
+
+/* lookup flags */
+#define CLU_CASE_SENSITIVE 0x01
+#define CLU_CASE_INSENSITIVE 0x02
+
+/* coda_lookup: */
+struct coda_lookup_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int name; /* Place holder for data. */
+ int flags;
+};
+
+struct coda_lookup_out {
+ struct coda_out_hdr oh;
+ struct CodaFid VFid;
+ int vtype;
+};
+
+
+/* coda_create: */
+struct coda_create_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ struct coda_vattr attr;
+ int excl;
+ int mode;
+ int name; /* Place holder for data. */
+};
+
+struct coda_create_out {
+ struct coda_out_hdr oh;
+ struct CodaFid VFid;
+ struct coda_vattr attr;
+};
+
+
+/* coda_remove: NO_OUT */
+struct coda_remove_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int name; /* Place holder for data. */
+};
+
+struct coda_remove_out {
+ struct coda_out_hdr out;
+};
+
+/* coda_link: NO_OUT */
+struct coda_link_in {
+ struct coda_in_hdr ih;
+ struct CodaFid sourceFid; /* cnode to link *to* */
+ struct CodaFid destFid; /* Directory in which to place link */
+ int tname; /* Place holder for data. */
+};
+
+struct coda_link_out {
+ struct coda_out_hdr out;
+};
+
+
+/* coda_rename: NO_OUT */
+struct coda_rename_in {
+ struct coda_in_hdr ih;
+ struct CodaFid sourceFid;
+ int srcname;
+ struct CodaFid destFid;
+ int destname;
+};
+
+struct coda_rename_out {
+ struct coda_out_hdr out;
+};
+
+/* coda_mkdir: */
+struct coda_mkdir_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ struct coda_vattr attr;
+ int name; /* Place holder for data. */
+};
+
+struct coda_mkdir_out {
+ struct coda_out_hdr oh;
+ struct CodaFid VFid;
+ struct coda_vattr attr;
+};
+
+
+/* coda_rmdir: NO_OUT */
+struct coda_rmdir_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int name; /* Place holder for data. */
+};
+
+struct coda_rmdir_out {
+ struct coda_out_hdr out;
+};
+
+/* coda_symlink: NO_OUT */
+struct coda_symlink_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid; /* Directory to put symlink in */
+ int srcname;
+ struct coda_vattr attr;
+ int tname;
+};
+
+struct coda_symlink_out {
+ struct coda_out_hdr out;
+};
+
+/* coda_readlink: */
+struct coda_readlink_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+};
+
+struct coda_readlink_out {
+ struct coda_out_hdr oh;
+ int count;
+ caddr_t data; /* Place holder for data. */
+};
+
+
+/* coda_fsync: NO_OUT */
+struct coda_fsync_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+};
+
+struct coda_fsync_out {
+ struct coda_out_hdr out;
+};
+
+/* coda_vget: */
+struct coda_vget_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+};
+
+struct coda_vget_out {
+ struct coda_out_hdr oh;
+ struct CodaFid VFid;
+ int vtype;
+};
+
+
+/* CODA_SIGNAL is out-of-band, doesn't need data. */
+/* CODA_INVALIDATE is a venus->kernel call */
+/* CODA_FLUSH is a venus->kernel call */
+
+/* coda_purgeuser: */
+/* CODA_PURGEUSER is a venus->kernel call */
+struct coda_purgeuser_out {
+ struct coda_out_hdr oh;
+ vuid_t uid;
+};
+
+/* coda_zapfile: */
+/* CODA_ZAPFILE is a venus->kernel call */
+struct coda_zapfile_out {
+ struct coda_out_hdr oh;
+ struct CodaFid CodaFid;
+};
+
+/* coda_zapdir: */
+/* CODA_ZAPDIR is a venus->kernel call */
+struct coda_zapdir_out {
+ struct coda_out_hdr oh;
+ struct CodaFid CodaFid;
+};
+
+/* coda_purgefid: */
+/* CODA_PURGEFID is a venus->kernel call */
+struct coda_purgefid_out {
+ struct coda_out_hdr oh;
+ struct CodaFid CodaFid;
+};
+
+/* coda_replace: */
+/* CODA_REPLACE is a venus->kernel call */
+struct coda_replace_out { /* coda_replace is a venus->kernel call */
+ struct coda_out_hdr oh;
+ struct CodaFid NewFid;
+ struct CodaFid OldFid;
+};
+
+/* coda_open_by_fd: */
+struct coda_open_by_fd_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int flags;
+};
+
+struct coda_open_by_fd_out {
+ struct coda_out_hdr oh;
+ int fd;
+
+};
+
+/* coda_open_by_path: */
+struct coda_open_by_path_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int flags;
+};
+
+struct coda_open_by_path_out {
+ struct coda_out_hdr oh;
+ int path;
+};
+
+/* coda_statfs: NO_IN */
+struct coda_statfs_in {
+ struct coda_in_hdr in;
+};
+
+struct coda_statfs_out {
+ struct coda_out_hdr oh;
+ struct coda_statfs stat;
+};
+
+/*
+ * Occasionally, we don't cache the fid returned by CODA_LOOKUP.
+ * For instance, if the fid is inconsistent.
+ * This case is handled by setting the top bit of the type result parameter.
+ */
+#define CODA_NOCACHE 0x80000000
+
+union inputArgs {
+ struct coda_in_hdr ih; /* NB: every struct below begins with an ih */
+ struct coda_open_in coda_open;
+ struct coda_store_in coda_store;
+ struct coda_release_in coda_release;
+ struct coda_close_in coda_close;
+ struct coda_ioctl_in coda_ioctl;
+ struct coda_getattr_in coda_getattr;
+ struct coda_setattr_in coda_setattr;
+ struct coda_access_in coda_access;
+ struct coda_lookup_in coda_lookup;
+ struct coda_create_in coda_create;
+ struct coda_remove_in coda_remove;
+ struct coda_link_in coda_link;
+ struct coda_rename_in coda_rename;
+ struct coda_mkdir_in coda_mkdir;
+ struct coda_rmdir_in coda_rmdir;
+ struct coda_symlink_in coda_symlink;
+ struct coda_readlink_in coda_readlink;
+ struct coda_fsync_in coda_fsync;
+ struct coda_vget_in coda_vget;
+ struct coda_open_by_fd_in coda_open_by_fd;
+ struct coda_open_by_path_in coda_open_by_path;
+ struct coda_statfs_in coda_statfs;
+};
+
+union outputArgs {
+ struct coda_out_hdr oh; /* NB: every struct below begins with an oh */
+ struct coda_root_out coda_root;
+ struct coda_open_out coda_open;
+ struct coda_ioctl_out coda_ioctl;
+ struct coda_getattr_out coda_getattr;
+ struct coda_lookup_out coda_lookup;
+ struct coda_create_out coda_create;
+ struct coda_mkdir_out coda_mkdir;
+ struct coda_readlink_out coda_readlink;
+ struct coda_vget_out coda_vget;
+ struct coda_purgeuser_out coda_purgeuser;
+ struct coda_zapfile_out coda_zapfile;
+ struct coda_zapdir_out coda_zapdir;
+ struct coda_purgefid_out coda_purgefid;
+ struct coda_replace_out coda_replace;
+ struct coda_open_by_fd_out coda_open_by_fd;
+ struct coda_open_by_path_out coda_open_by_path;
+ struct coda_statfs_out coda_statfs;
+};
+
+union coda_downcalls {
+ /* CODA_INVALIDATE is a venus->kernel call */
+ /* CODA_FLUSH is a venus->kernel call */
+ struct coda_purgeuser_out purgeuser;
+ struct coda_zapfile_out zapfile;
+ struct coda_zapdir_out zapdir;
+ struct coda_purgefid_out purgefid;
+ struct coda_replace_out replace;
+};
+
+
+/*
+ * Used for identifying usage of "Control" and pioctls
+ */
+
+#define PIOCPARM_MASK 0x0000ffff
+struct ViceIoctl {
+ void *in; /* Data to be transferred in */
+ void *out; /* Data to be transferred out */
+ u_short in_size; /* Size of input buffer <= 2K */
+ u_short out_size; /* Maximum size of output buffer, <= 2K */
+};
+
+struct PioctlData {
+ const char *path;
+ int follow;
+ struct ViceIoctl vi;
+};
+
+#define CODA_CONTROL ".CONTROL"
+#define CODA_CONTROLLEN 8
+#define CTL_INO -1
+
+/* Data passed to mount */
+
+#define CODA_MOUNT_VERSION 1
+
+struct coda_mount_data {
+ int version;
+ int fd; /* Opened device */
+};
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/coda_psdev.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/coda_psdev.h
new file mode 100644
index 0000000..3cccd19
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/coda_psdev.h
@@ -0,0 +1,27 @@
+#ifndef __CODA_PSDEV_H
+#define __CODA_PSDEV_H
+
+#include <linux/magic.h>
+
+#define CODA_PSDEV_MAJOR 67
+#define MAX_CODADEVS 5 /* how many do we allow */
+
+
+/* messages between coda filesystem in kernel and Venus */
+struct upc_req {
+ struct list_head uc_chain;
+ caddr_t uc_data;
+ u_short uc_flags;
+ u_short uc_inSize; /* Size is at most 5000 bytes */
+ u_short uc_outSize;
+ u_short uc_opcode; /* copied from data to save lookup */
+ int uc_unique;
+ wait_queue_head_t uc_sleep; /* process' wait queue */
+};
+
+#define REQ_ASYNC 0x1
+#define REQ_READ 0x2
+#define REQ_WRITE 0x4
+#define REQ_ABORT 0x8
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/coff.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/coff.h
new file mode 100644
index 0000000..6354a7f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/coff.h
@@ -0,0 +1,351 @@
+/* This file is derived from the GAS 2.1.4 assembler control file.
+ The GAS product is under the GNU General Public License, version 2 or later.
+ As such, this file is also under that license.
+
+ If the file format changes in the COFF object, this file should be
+ subsequently updated to reflect the changes.
+
+ The actual loader module only uses a few of these structures. The full
+ set is documented here because I received the full set. If you wish
+ more information about COFF, then O'Reilly has a very excellent book.
+*/
+
+#define E_SYMNMLEN 8 /* Number of characters in a symbol name */
+#define E_FILNMLEN 14 /* Number of characters in a file name */
+#define E_DIMNUM 4 /* Number of array dimensions in auxiliary entry */
+
+/*
+ * These defines are byte order independent. There is no alignment of fields
+ * permitted in the structures. Therefore they are declared as characters
+ * and the values loaded from the character positions. It also makes it
+ * nice to have it "endian" independent.
+ */
+
+/* Load a short int from the following tables with little-endian formats */
+#define COFF_SHORT_L(ps) ((short)(((unsigned short)((unsigned char)ps[1])<<8)|\
+ ((unsigned short)((unsigned char)ps[0]))))
+
+/* Load a long int from the following tables with little-endian formats */
+#define COFF_LONG_L(ps) (((long)(((unsigned long)((unsigned char)ps[3])<<24) |\
+ ((unsigned long)((unsigned char)ps[2])<<16) |\
+ ((unsigned long)((unsigned char)ps[1])<<8) |\
+ ((unsigned long)((unsigned char)ps[0])))))
+
+/* Load a short int from the following tables with big-endian formats */
+#define COFF_SHORT_H(ps) ((short)(((unsigned short)((unsigned char)ps[0])<<8)|\
+ ((unsigned short)((unsigned char)ps[1]))))
+
+/* Load a long int from the following tables with big-endian formats */
+#define COFF_LONG_H(ps) (((long)(((unsigned long)((unsigned char)ps[0])<<24) |\
+ ((unsigned long)((unsigned char)ps[1])<<16) |\
+ ((unsigned long)((unsigned char)ps[2])<<8) |\
+ ((unsigned long)((unsigned char)ps[3])))))
+
+/* These may be overridden later by brain dead implementations which generate
+ a big-endian header with little-endian data. In that case, generate a
+ replacement macro which tests a flag and uses either of the two above
+ as appropriate. */
+
+#define COFF_LONG(v) COFF_LONG_L(v)
+#define COFF_SHORT(v) COFF_SHORT_L(v)
+
+/*** coff information for Intel 386/486. */
+
+/********************** FILE HEADER **********************/
+
+struct COFF_filehdr {
+ char f_magic[2]; /* magic number */
+ char f_nscns[2]; /* number of sections */
+ char f_timdat[4]; /* time & date stamp */
+ char f_symptr[4]; /* file pointer to symtab */
+ char f_nsyms[4]; /* number of symtab entries */
+ char f_opthdr[2]; /* sizeof(optional hdr) */
+ char f_flags[2]; /* flags */
+};
+
+/*
+ * Bits for f_flags:
+ *
+ * F_RELFLG relocation info stripped from file
+ * F_EXEC file is executable (i.e. no unresolved external
+ * references)
+ * F_LNNO line numbers stripped from file
+ * F_LSYMS local symbols stripped from file
+ * F_MINMAL this is a minimal object file (".m") output of fextract
+ * F_UPDATE this is a fully bound update file, output of ogen
+ * F_SWABD this file has had its bytes swabbed (in names)
+ * F_AR16WR this file has the byte ordering of an AR16WR
+ * (e.g. 11/70) machine
+ * F_AR32WR this file has the byte ordering of an AR32WR machine
+ * (e.g. vax and iNTEL 386)
+ * F_AR32W this file has the byte ordering of an AR32W machine
+ * (e.g. 3b,maxi)
+ * F_PATCH file contains "patch" list in optional header
+ * F_NODF (minimal file only) no decision functions for
+ * replaced functions
+ */
+
+#define COFF_F_RELFLG 0000001
+#define COFF_F_EXEC 0000002
+#define COFF_F_LNNO 0000004
+#define COFF_F_LSYMS 0000010
+#define COFF_F_MINMAL 0000020
+#define COFF_F_UPDATE 0000040
+#define COFF_F_SWABD 0000100
+#define COFF_F_AR16WR 0000200
+#define COFF_F_AR32WR 0000400
+#define COFF_F_AR32W 0001000
+#define COFF_F_PATCH 0002000
+#define COFF_F_NODF 0002000
+
+#define COFF_I386MAGIC 0x14c /* Linux's system */
+
+#if 0 /* Perhaps, someday, these formats may be used. */
+#define COFF_I386PTXMAGIC 0x154
+#define COFF_I386AIXMAGIC 0x175 /* IBM's AIX system */
+#define COFF_I386BADMAG(x) ((COFF_SHORT((x).f_magic) != COFF_I386MAGIC) \
+ && COFF_SHORT((x).f_magic) != COFF_I386PTXMAGIC \
+ && COFF_SHORT((x).f_magic) != COFF_I386AIXMAGIC)
+#else
+#define COFF_I386BADMAG(x) (COFF_SHORT((x).f_magic) != COFF_I386MAGIC)
+#endif
+
+#define COFF_FILHDR struct COFF_filehdr
+#define COFF_FILHSZ sizeof(COFF_FILHDR)
+
+/********************** AOUT "OPTIONAL HEADER" **********************/
+
+/* Linux COFF must have this "optional" header. Standard COFF has no entry
+ location for the "entry" point. They normally would start with the first
+ location of the .text section. This is not a good idea for linux. So,
+ the use of this "optional" header is not optional. It is required.
+
+ Do not be tempted to assume that the size of the optional header is
+ a constant and simply index the next byte by the size of this structure.
+ Use the 'f_opthdr' field in the main coff header for the size of the
+ structure actually written to the file!!
+*/
+
+typedef struct
+{
+ char magic[2]; /* type of file */
+ char vstamp[2]; /* version stamp */
+ char tsize[4]; /* text size in bytes, padded to FW bdry */
+ char dsize[4]; /* initialized data " " */
+ char bsize[4]; /* uninitialized data " " */
+ char entry[4]; /* entry pt. */
+ char text_start[4]; /* base of text used for this file */
+ char data_start[4]; /* base of data used for this file */
+}
+COFF_AOUTHDR;
+
+#define COFF_AOUTSZ (sizeof(COFF_AOUTHDR))
+
+#define COFF_STMAGIC 0401
+#define COFF_OMAGIC 0404
+#define COFF_JMAGIC 0407 /* dirty text and data image, can't share */
+#define COFF_DMAGIC 0410 /* dirty text segment, data aligned */
+#define COFF_ZMAGIC 0413 /* The proper magic number for executables */
+#define COFF_SHMAGIC 0443 /* shared library header */
+
+/********************** SECTION HEADER **********************/
+
+struct COFF_scnhdr {
+ char s_name[8]; /* section name */
+ char s_paddr[4]; /* physical address, aliased s_nlib */
+ char s_vaddr[4]; /* virtual address */
+ char s_size[4]; /* section size */
+ char s_scnptr[4]; /* file ptr to raw data for section */
+ char s_relptr[4]; /* file ptr to relocation */
+ char s_lnnoptr[4]; /* file ptr to line numbers */
+ char s_nreloc[2]; /* number of relocation entries */
+ char s_nlnno[2]; /* number of line number entries */
+ char s_flags[4]; /* flags */
+};
+
+#define COFF_SCNHDR struct COFF_scnhdr
+#define COFF_SCNHSZ sizeof(COFF_SCNHDR)
+
+/*
+ * names of "special" sections
+ */
+
+#define COFF_TEXT ".text"
+#define COFF_DATA ".data"
+#define COFF_BSS ".bss"
+#define COFF_COMMENT ".comment"
+#define COFF_LIB ".lib"
+
+#define COFF_SECT_TEXT 0 /* Section for instruction code */
+#define COFF_SECT_DATA 1 /* Section for initialized globals */
+#define COFF_SECT_BSS 2 /* Section for un-initialized globals */
+#define COFF_SECT_REQD 3 /* Minimum number of sections for good file */
+
+#define COFF_STYP_REG 0x00 /* regular segment */
+#define COFF_STYP_DSECT 0x01 /* dummy segment */
+#define COFF_STYP_NOLOAD 0x02 /* no-load segment */
+#define COFF_STYP_GROUP 0x04 /* group segment */
+#define COFF_STYP_PAD 0x08 /* .pad segment */
+#define COFF_STYP_COPY 0x10 /* copy section */
+#define COFF_STYP_TEXT 0x20 /* .text segment */
+#define COFF_STYP_DATA 0x40 /* .data segment */
+#define COFF_STYP_BSS 0x80 /* .bss segment */
+#define COFF_STYP_INFO 0x200 /* .comment section */
+#define COFF_STYP_OVER 0x400 /* overlay section */
+#define COFF_STYP_LIB 0x800 /* library section */
+
+/*
+ * Shared libraries have the following section header in the data field for
+ * each library.
+ */
+
+struct COFF_slib {
+ char sl_entsz[4]; /* Size of this entry */
+ char sl_pathndx[4]; /* size of the header field */
+};
+
+#define COFF_SLIBHD struct COFF_slib
+#define COFF_SLIBSZ sizeof(COFF_SLIBHD)
+
+/********************** LINE NUMBERS **********************/
+
+/* 1 line number entry for every "breakpointable" source line in a section.
+ * Line numbers are grouped on a per function basis; first entry in a function
+ * grouping will have l_lnno = 0 and in place of physical address will be the
+ * symbol table index of the function name.
+ */
+
+struct COFF_lineno {
+ union {
+ char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/
+ char l_paddr[4]; /* (physical) address of line number */
+ } l_addr;
+ char l_lnno[2]; /* line number */
+};
+
+#define COFF_LINENO struct COFF_lineno
+#define COFF_LINESZ 6
+
+/********************** SYMBOLS **********************/
+
+#define COFF_E_SYMNMLEN 8 /* # characters in a short symbol name */
+#define COFF_E_FILNMLEN 14 /* # characters in a file name */
+#define COFF_E_DIMNUM 4 /* # array dimensions in auxiliary entry */
+
+/*
+ * All symbols and sections have the following definition
+ */
+
+struct COFF_syment
+{
+ union {
+ char e_name[E_SYMNMLEN]; /* Symbol name (first 8 characters) */
+ struct {
+ char e_zeroes[4]; /* Leading zeros */
+ char e_offset[4]; /* Offset if this is a header section */
+ } e;
+ } e;
+
+ char e_value[4]; /* Value (address) of the segment */
+ char e_scnum[2]; /* Section number */
+ char e_type[2]; /* Type of section */
+ char e_sclass[1]; /* Loader class */
+ char e_numaux[1]; /* Number of auxiliary entries which follow */
+};
+
+#define COFF_N_BTMASK (0xf) /* Mask for important class bits */
+#define COFF_N_TMASK (0x30) /* Mask for important type bits */
+#define COFF_N_BTSHFT (4) /* # bits to shift class field */
+#define COFF_N_TSHIFT (2) /* # bits to shift type field */
+
+/*
+ * Auxiliary entries because the main table is too limiting.
+ */
+
+union COFF_auxent {
+
+/*
+ * Debugger information
+ */
+
+ struct {
+ char x_tagndx[4]; /* str, un, or enum tag indx */
+ union {
+ struct {
+ char x_lnno[2]; /* declaration line number */
+ char x_size[2]; /* str/union/array size */
+ } x_lnsz;
+ char x_fsize[4]; /* size of function */
+ } x_misc;
+
+ union {
+ struct { /* if ISFCN, tag, or .bb */
+ char x_lnnoptr[4]; /* ptr to fcn line # */
+ char x_endndx[4]; /* entry ndx past block end */
+ } x_fcn;
+
+ struct { /* if ISARY, up to 4 dimen. */
+ char x_dimen[E_DIMNUM][2];
+ } x_ary;
+ } x_fcnary;
+
+ char x_tvndx[2]; /* tv index */
+ } x_sym;
+
+/*
+ * Source file names (debugger information)
+ */
+
+ union {
+ char x_fname[E_FILNMLEN];
+ struct {
+ char x_zeroes[4];
+ char x_offset[4];
+ } x_n;
+ } x_file;
+
+/*
+ * Section information
+ */
+
+ struct {
+ char x_scnlen[4]; /* section length */
+ char x_nreloc[2]; /* # relocation entries */
+ char x_nlinno[2]; /* # line numbers */
+ } x_scn;
+
+/*
+ * Transfer vector (branch table)
+ */
+
+ struct {
+ char x_tvfill[4]; /* tv fill value */
+ char x_tvlen[2]; /* length of .tv */
+ char x_tvran[2][2]; /* tv range */
+ } x_tv; /* info about .tv section (in auxent of symbol .tv)) */
+};
+
+#define COFF_SYMENT struct COFF_syment
+#define COFF_SYMESZ 18
+#define COFF_AUXENT union COFF_auxent
+#define COFF_AUXESZ 18
+
+#define COFF_ETEXT "etext"
+
+/********************** RELOCATION DIRECTIVES **********************/
+
+struct COFF_reloc {
+ char r_vaddr[4]; /* Virtual address of item */
+ char r_symndx[4]; /* Symbol index in the symtab */
+ char r_type[2]; /* Relocation type */
+};
+
+#define COFF_RELOC struct COFF_reloc
+#define COFF_RELSZ 10
+
+#define COFF_DEF_DATA_SECTION_ALIGNMENT 4
+#define COFF_DEF_BSS_SECTION_ALIGNMENT 4
+#define COFF_DEF_TEXT_SECTION_ALIGNMENT 4
+
+/* For new sections we haven't heard of before */
+#define COFF_DEF_SECTION_ALIGNMENT 4
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/comstats.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/comstats.h
new file mode 100644
index 0000000..3f5ea8e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/comstats.h
@@ -0,0 +1,119 @@
+/*****************************************************************************/
+
+/*
+ * comstats.h -- Serial Port Stats.
+ *
+ * Copyright (C) 1996-1998 Stallion Technologies
+ * Copyright (C) 1994-1996 Greg Ungerer.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/*****************************************************************************/
+#ifndef _COMSTATS_H
+#define _COMSTATS_H
+/*****************************************************************************/
+
+/*
+ * Serial port stats structure. The structure itself is UART
+ * independent, but some fields may be UART/driver specific (for
+ * example state).
+ */
+
+typedef struct {
+ unsigned long brd;
+ unsigned long panel;
+ unsigned long port;
+ unsigned long hwid;
+ unsigned long type;
+ unsigned long txtotal;
+ unsigned long rxtotal;
+ unsigned long txbuffered;
+ unsigned long rxbuffered;
+ unsigned long rxoverrun;
+ unsigned long rxparity;
+ unsigned long rxframing;
+ unsigned long rxlost;
+ unsigned long txbreaks;
+ unsigned long rxbreaks;
+ unsigned long txxon;
+ unsigned long txxoff;
+ unsigned long rxxon;
+ unsigned long rxxoff;
+ unsigned long txctson;
+ unsigned long txctsoff;
+ unsigned long rxrtson;
+ unsigned long rxrtsoff;
+ unsigned long modem;
+ unsigned long state;
+ unsigned long flags;
+ unsigned long ttystate;
+ unsigned long cflags;
+ unsigned long iflags;
+ unsigned long oflags;
+ unsigned long lflags;
+ unsigned long signals;
+} comstats_t;
+
+
+/*
+ * Board stats structure. Returns useful info about the board.
+ */
+
+#define COM_MAXPANELS 8
+
+typedef struct {
+ unsigned long panel;
+ unsigned long type;
+ unsigned long hwid;
+ unsigned long nrports;
+} companel_t;
+
+typedef struct {
+ unsigned long brd;
+ unsigned long type;
+ unsigned long hwid;
+ unsigned long state;
+ unsigned long ioaddr;
+ unsigned long ioaddr2;
+ unsigned long memaddr;
+ unsigned long irq;
+ unsigned long nrpanels;
+ unsigned long nrports;
+ companel_t panels[COM_MAXPANELS];
+} combrd_t;
+
+
+/*
+ * Define the ioctl operations for stats stuff.
+ */
+#include <linux/ioctl.h>
+
+#define COM_GETPORTSTATS _IO('c',30)
+#define COM_CLRPORTSTATS _IO('c',31)
+#define COM_GETBRDSTATS _IO('c',32)
+
+
+/*
+ * Define the set of ioctls that give user level access to the
+ * private port, panel and board structures. The argument required
+ * will be driver dependent!
+ */
+#define COM_READPORT _IO('c',40)
+#define COM_READBOARD _IO('c',41)
+#define COM_READPANEL _IO('c',42)
+
+/*****************************************************************************/
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/connector.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/connector.h
new file mode 100644
index 0000000..f47072e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/connector.h
@@ -0,0 +1,98 @@
+/*
+ * connector.h
+ *
+ * 2004-2005 Copyright (c) Evgeniy Polyakov <johnpol@2ka.mipt.ru>
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __CONNECTOR_H
+#define __CONNECTOR_H
+
+#include <linux/types.h>
+
+#define CN_IDX_CONNECTOR 0xffffffff
+#define CN_VAL_CONNECTOR 0xffffffff
+
+/*
+ * Process Events connector unique ids -- used for message routing
+ */
+#define CN_IDX_PROC 0x1
+#define CN_VAL_PROC 0x1
+#define CN_IDX_CIFS 0x2
+#define CN_VAL_CIFS 0x1
+#define CN_W1_IDX 0x3 /* w1 communication */
+#define CN_W1_VAL 0x1
+#define CN_IDX_V86D 0x4
+#define CN_VAL_V86D_UVESAFB 0x1
+#define CN_IDX_BB 0x5 /* BlackBoard, from the TSP GPL sampling framework */
+#define CN_DST_IDX 0x6
+#define CN_DST_VAL 0x1
+
+#define CN_NETLINK_USERS 7
+
+/*
+ * Maximum connector's message size.
+ */
+#define CONNECTOR_MAX_MSG_SIZE 16384
+
+/*
+ * idx and val are unique identifiers which
+ * are used for message routing and
+ * must be registered in connector.h for in-kernel usage.
+ */
+
+struct cb_id {
+ __u32 idx;
+ __u32 val;
+};
+
+struct cn_msg {
+ struct cb_id id;
+
+ __u32 seq;
+ __u32 ack;
+
+ __u16 len; /* Length of the following data */
+ __u16 flags;
+ __u8 data[0];
+};
+
+/*
+ * Notify structure - requests notification about
+ * registering/unregistering idx/val in range [first, first+range].
+ */
+struct cn_notify_req {
+ __u32 first;
+ __u32 range;
+};
+
+/*
+ * Main notification control message
+ * *_notify_num - number of appropriate cn_notify_req structures after
+ * this struct.
+ * group - notification receiver's idx.
+ * len - total length of the attached data.
+ */
+struct cn_ctl_msg {
+ __u32 idx_notify_num;
+ __u32 val_notify_num;
+ __u32 group;
+ __u32 len;
+ __u8 data[0];
+};
+
+#endif /* __CONNECTOR_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/const.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/const.h
new file mode 100644
index 0000000..c22c707
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/const.h
@@ -0,0 +1,24 @@
+/* const.h: Macros for dealing with constants. */
+
+#ifndef _LINUX_CONST_H
+#define _LINUX_CONST_H
+
+/* Some constant macros are used in both assembler and
+ * C code. Therefore we cannot annotate them always with
+ * 'UL' and other type specifiers unilaterally. We
+ * use the following macros to deal with this.
+ *
+ * Similarly, _AT() will cast an expression with a type in C, but
+ * leave it unchanged in asm.
+ */
+
+#ifdef __ASSEMBLY__
+#define _AC(X,Y) X
+#define _AT(T,X) X
+#else
+#define __AC(X,Y) (X##Y)
+#define _AC(X,Y) __AC(X,Y)
+#define _AT(T,X) ((T)(X))
+#endif
+
+#endif /* !(_LINUX_CONST_H) */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cramfs_fs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cramfs_fs.h
new file mode 100644
index 0000000..3be4e5a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cramfs_fs.h
@@ -0,0 +1,93 @@
+#ifndef __CRAMFS_H
+#define __CRAMFS_H
+
+#include <linux/types.h>
+
+#define CRAMFS_MAGIC 0x28cd3d45 /* some random number */
+#define CRAMFS_MAGIC_WEND 0x453dcd28 /* magic number with the wrong endianess */
+#define CRAMFS_SIGNATURE "Compressed ROMFS"
+
+/*
+ * Width of various bitfields in struct cramfs_inode.
+ * Primarily used to generate warnings in mkcramfs.
+ */
+#define CRAMFS_MODE_WIDTH 16
+#define CRAMFS_UID_WIDTH 16
+#define CRAMFS_SIZE_WIDTH 24
+#define CRAMFS_GID_WIDTH 8
+#define CRAMFS_NAMELEN_WIDTH 6
+#define CRAMFS_OFFSET_WIDTH 26
+
+/*
+ * Since inode.namelen is a unsigned 6-bit number, the maximum cramfs
+ * path length is 63 << 2 = 252.
+ */
+#define CRAMFS_MAXPATHLEN (((1 << CRAMFS_NAMELEN_WIDTH) - 1) << 2)
+
+/*
+ * Reasonably terse representation of the inode data.
+ */
+struct cramfs_inode {
+ __u32 mode:CRAMFS_MODE_WIDTH, uid:CRAMFS_UID_WIDTH;
+ /* SIZE for device files is i_rdev */
+ __u32 size:CRAMFS_SIZE_WIDTH, gid:CRAMFS_GID_WIDTH;
+ /* NAMELEN is the length of the file name, divided by 4 and
+ rounded up. (cramfs doesn't support hard links.) */
+ /* OFFSET: For symlinks and non-empty regular files, this
+ contains the offset (divided by 4) of the file data in
+ compressed form (starting with an array of block pointers;
+ see README). For non-empty directories it is the offset
+ (divided by 4) of the inode of the first file in that
+ directory. For anything else, offset is zero. */
+ __u32 namelen:CRAMFS_NAMELEN_WIDTH, offset:CRAMFS_OFFSET_WIDTH;
+};
+
+struct cramfs_info {
+ __u32 crc;
+ __u32 edition;
+ __u32 blocks;
+ __u32 files;
+};
+
+/*
+ * Superblock information at the beginning of the FS.
+ */
+struct cramfs_super {
+ __u32 magic; /* 0x28cd3d45 - random number */
+ __u32 size; /* length in bytes */
+ __u32 flags; /* feature flags */
+ __u32 future; /* reserved for future use */
+ __u8 signature[16]; /* "Compressed ROMFS" */
+ struct cramfs_info fsid; /* unique filesystem info */
+ __u8 name[16]; /* user-defined name */
+ struct cramfs_inode root; /* root inode data */
+};
+
+/*
+ * Feature flags
+ *
+ * 0x00000000 - 0x000000ff: features that work for all past kernels
+ * 0x00000100 - 0xffffffff: features that don't work for past kernels
+ */
+#define CRAMFS_FLAG_FSID_VERSION_2 0x00000001 /* fsid version #2 */
+#define CRAMFS_FLAG_SORTED_DIRS 0x00000002 /* sorted dirs */
+#define CRAMFS_FLAG_HOLES 0x00000100 /* support for holes */
+#define CRAMFS_FLAG_WRONG_SIGNATURE 0x00000200 /* reserved */
+#define CRAMFS_FLAG_SHIFTED_ROOT_OFFSET 0x00000400 /* shifted root fs */
+
+/*
+ * Valid values in super.flags. Currently we refuse to mount
+ * if (flags & ~CRAMFS_SUPPORTED_FLAGS). Maybe that should be
+ * changed to test super.future instead.
+ */
+#define CRAMFS_SUPPORTED_FLAGS ( 0x000000ff \
+ | CRAMFS_FLAG_HOLES \
+ | CRAMFS_FLAG_WRONG_SIGNATURE \
+ | CRAMFS_FLAG_SHIFTED_ROOT_OFFSET )
+
+/* Uncompression interfaces to the underlying zlib */
+int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen);
+int cramfs_uncompress_init(void);
+void cramfs_uncompress_exit(void);
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cuda.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cuda.h
new file mode 100644
index 0000000..69c8bf0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cuda.h
@@ -0,0 +1,28 @@
+/*
+ * Definitions for talking to the CUDA. The CUDA is a microcontroller
+ * which controls the ADB, system power, RTC, and various other things.
+ *
+ * Copyright (C) 1996 Paul Mackerras.
+ */
+
+/* CUDA commands (2nd byte) */
+#define CUDA_WARM_START 0
+#define CUDA_AUTOPOLL 1
+#define CUDA_GET_6805_ADDR 2
+#define CUDA_GET_TIME 3
+#define CUDA_GET_PRAM 7
+#define CUDA_SET_6805_ADDR 8
+#define CUDA_SET_TIME 9
+#define CUDA_POWERDOWN 0xa
+#define CUDA_POWERUP_TIME 0xb
+#define CUDA_SET_PRAM 0xc
+#define CUDA_MS_RESET 0xd
+#define CUDA_SEND_DFAC 0xe
+#define CUDA_RESET_SYSTEM 0x11
+#define CUDA_SET_IPL 0x12
+#define CUDA_SET_AUTO_RATE 0x14
+#define CUDA_GET_AUTO_RATE 0x16
+#define CUDA_SET_DEVICE_LIST 0x19
+#define CUDA_GET_DEVICE_LIST 0x1a
+#define CUDA_GET_SET_IIC 0x22
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cyclades.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cyclades.h
new file mode 100644
index 0000000..11e08b7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cyclades.h
@@ -0,0 +1,506 @@
+/* $Revision: 3.0 $$Date: 1998/11/02 14:20:59 $
+ * linux/include/linux/cyclades.h
+ *
+ * This file was initially written by
+ * Randolph Bentson <bentson@grieg.seaslug.org> and is maintained by
+ * Ivan Passos <ivan@cyclades.com>.
+ *
+ * This file contains the general definitions for the cyclades.c driver
+ *$Log: cyclades.h,v $
+ *Revision 3.1 2002/01/29 11:36:16 henrique
+ *added throttle field on struct cyclades_port to indicate whether the
+ *port is throttled or not
+ *
+ *Revision 3.1 2000/04/19 18:52:52 ivan
+ *converted address fields to unsigned long and added fields for physical
+ *addresses on cyclades_card structure;
+ *
+ *Revision 3.0 1998/11/02 14:20:59 ivan
+ *added nports field on cyclades_card structure;
+ *
+ *Revision 2.5 1998/08/03 16:57:01 ivan
+ *added cyclades_idle_stats structure;
+ *
+ *Revision 2.4 1998/06/01 12:09:53 ivan
+ *removed closing_wait2 from cyclades_port structure;
+ *
+ *Revision 2.3 1998/03/16 18:01:12 ivan
+ *changes in the cyclades_port structure to get it closer to the
+ *standard serial port structure;
+ *added constants for new ioctls;
+ *
+ *Revision 2.2 1998/02/17 16:50:00 ivan
+ *changes in the cyclades_port structure (addition of shutdown_wait and
+ *chip_rev variables);
+ *added constants for new ioctls and for CD1400 rev. numbers.
+ *
+ *Revision 2.1 1997/10/24 16:03:00 ivan
+ *added rflow (which allows enabling the CD1400 special flow control
+ *feature) and rtsdtr_inv (which allows DTR/RTS pin inversion) to
+ *cyclades_port structure;
+ *added Alpha support
+ *
+ *Revision 2.0 1997/06/30 10:30:00 ivan
+ *added some new doorbell command constants related to IOCTLW and
+ *UART error signaling
+ *
+ *Revision 1.8 1997/06/03 15:30:00 ivan
+ *added constant ZFIRM_HLT
+ *added constant CyPCI_Ze_win ( = 2 * Cy_PCI_Zwin)
+ *
+ *Revision 1.7 1997/03/26 10:30:00 daniel
+ *new entries at the end of cyclades_port struct to reallocate
+ *variables illegally allocated within card memory.
+ *
+ *Revision 1.6 1996/09/09 18:35:30 bentson
+ *fold in changes for Cyclom-Z -- including structures for
+ *communicating with board as well modest changes to original
+ *structures to support new features.
+ *
+ *Revision 1.5 1995/11/13 21:13:31 bentson
+ *changes suggested by Michael Chastain <mec@duracef.shout.net>
+ *to support use of this file in non-kernel applications
+ *
+ *
+ */
+
+#ifndef _LINUX_CYCLADES_H
+#define _LINUX_CYCLADES_H
+
+#include <linux/types.h>
+
+struct cyclades_monitor {
+ unsigned long int_count;
+ unsigned long char_count;
+ unsigned long char_max;
+ unsigned long char_last;
+};
+
+/*
+ * These stats all reflect activity since the device was last initialized.
+ * (i.e., since the port was opened with no other processes already having it
+ * open)
+ */
+struct cyclades_idle_stats {
+ __kernel_time_t in_use; /* Time device has been in use (secs) */
+ __kernel_time_t recv_idle; /* Time since last char received (secs) */
+ __kernel_time_t xmit_idle; /* Time since last char transmitted (secs) */
+ unsigned long recv_bytes; /* Bytes received */
+ unsigned long xmit_bytes; /* Bytes transmitted */
+ unsigned long overruns; /* Input overruns */
+ unsigned long frame_errs; /* Input framing errors */
+ unsigned long parity_errs; /* Input parity errors */
+};
+
+#define CYCLADES_MAGIC 0x4359
+
+#define CYGETMON 0x435901
+#define CYGETTHRESH 0x435902
+#define CYSETTHRESH 0x435903
+#define CYGETDEFTHRESH 0x435904
+#define CYSETDEFTHRESH 0x435905
+#define CYGETTIMEOUT 0x435906
+#define CYSETTIMEOUT 0x435907
+#define CYGETDEFTIMEOUT 0x435908
+#define CYSETDEFTIMEOUT 0x435909
+#define CYSETRFLOW 0x43590a
+#define CYGETRFLOW 0x43590b
+#define CYSETRTSDTR_INV 0x43590c
+#define CYGETRTSDTR_INV 0x43590d
+#define CYZSETPOLLCYCLE 0x43590e
+#define CYZGETPOLLCYCLE 0x43590f
+#define CYGETCD1400VER 0x435910
+#define CYSETWAIT 0x435912
+#define CYGETWAIT 0x435913
+
+/*************** CYCLOM-Z ADDITIONS ***************/
+
+#define CZIOC ('M' << 8)
+#define CZ_NBOARDS (CZIOC|0xfa)
+#define CZ_BOOT_START (CZIOC|0xfb)
+#define CZ_BOOT_DATA (CZIOC|0xfc)
+#define CZ_BOOT_END (CZIOC|0xfd)
+#define CZ_TEST (CZIOC|0xfe)
+
+#define CZ_DEF_POLL (HZ/25)
+
+#define MAX_BOARD 4 /* Max number of boards */
+#define MAX_DEV 256 /* Max number of ports total */
+#define CYZ_MAX_SPEED 921600
+
+#define CYZ_FIFO_SIZE 16
+
+#define CYZ_BOOT_NWORDS 0x100
+struct CYZ_BOOT_CTRL {
+ unsigned short nboard;
+ int status[MAX_BOARD];
+ int nchannel[MAX_BOARD];
+ int fw_rev[MAX_BOARD];
+ unsigned long offset;
+ unsigned long data[CYZ_BOOT_NWORDS];
+};
+
+
+#ifndef DP_WINDOW_SIZE
+/* #include "cyclomz.h" */
+/****************** ****************** *******************/
+/*
+ * The data types defined below are used in all ZFIRM interface
+ * data structures. They accomodate differences between HW
+ * architectures and compilers.
+ */
+
+typedef __u64 ucdouble; /* 64 bits, unsigned */
+typedef __u32 uclong; /* 32 bits, unsigned */
+typedef __u16 ucshort; /* 16 bits, unsigned */
+typedef __u8 ucchar; /* 8 bits, unsigned */
+
+/*
+ * Memory Window Sizes
+ */
+
+#define DP_WINDOW_SIZE (0x00080000) /* window size 512 Kb */
+#define ZE_DP_WINDOW_SIZE (0x00100000) /* window size 1 Mb (Ze and
+ 8Zo V.2 */
+#define CTRL_WINDOW_SIZE (0x00000080) /* runtime regs 128 bytes */
+
+/*
+ * CUSTOM_REG - Cyclom-Z/PCI Custom Registers Set. The driver
+ * normally will access only interested on the fpga_id, fpga_version,
+ * start_cpu and stop_cpu.
+ */
+
+struct CUSTOM_REG {
+ __u32 fpga_id; /* FPGA Identification Register */
+ __u32 fpga_version; /* FPGA Version Number Register */
+ __u32 cpu_start; /* CPU start Register (write) */
+ __u32 cpu_stop; /* CPU stop Register (write) */
+ __u32 misc_reg; /* Miscellaneous Register */
+ __u32 idt_mode; /* IDT mode Register */
+ __u32 uart_irq_status; /* UART IRQ status Register */
+ __u32 clear_timer0_irq; /* Clear timer interrupt Register */
+ __u32 clear_timer1_irq; /* Clear timer interrupt Register */
+ __u32 clear_timer2_irq; /* Clear timer interrupt Register */
+ __u32 test_register; /* Test Register */
+ __u32 test_count; /* Test Count Register */
+ __u32 timer_select; /* Timer select register */
+ __u32 pr_uart_irq_status; /* Prioritized UART IRQ stat Reg */
+ __u32 ram_wait_state; /* RAM wait-state Register */
+ __u32 uart_wait_state; /* UART wait-state Register */
+ __u32 timer_wait_state; /* timer wait-state Register */
+ __u32 ack_wait_state; /* ACK wait State Register */
+};
+
+/*
+ * RUNTIME_9060 - PLX PCI9060ES local configuration and shared runtime
+ * registers. This structure can be used to access the 9060 registers
+ * (memory mapped).
+ */
+
+struct RUNTIME_9060 {
+ __u32 loc_addr_range; /* 00h - Local Address Range */
+ __u32 loc_addr_base; /* 04h - Local Address Base */
+ __u32 loc_arbitr; /* 08h - Local Arbitration */
+ __u32 endian_descr; /* 0Ch - Big/Little Endian Descriptor */
+ __u32 loc_rom_range; /* 10h - Local ROM Range */
+ __u32 loc_rom_base; /* 14h - Local ROM Base */
+ __u32 loc_bus_descr; /* 18h - Local Bus descriptor */
+ __u32 loc_range_mst; /* 1Ch - Local Range for Master to PCI */
+ __u32 loc_base_mst; /* 20h - Local Base for Master PCI */
+ __u32 loc_range_io; /* 24h - Local Range for Master IO */
+ __u32 pci_base_mst; /* 28h - PCI Base for Master PCI */
+ __u32 pci_conf_io; /* 2Ch - PCI configuration for Master IO */
+ __u32 filler1; /* 30h */
+ __u32 filler2; /* 34h */
+ __u32 filler3; /* 38h */
+ __u32 filler4; /* 3Ch */
+ __u32 mail_box_0; /* 40h - Mail Box 0 */
+ __u32 mail_box_1; /* 44h - Mail Box 1 */
+ __u32 mail_box_2; /* 48h - Mail Box 2 */
+ __u32 mail_box_3; /* 4Ch - Mail Box 3 */
+ __u32 filler5; /* 50h */
+ __u32 filler6; /* 54h */
+ __u32 filler7; /* 58h */
+ __u32 filler8; /* 5Ch */
+ __u32 pci_doorbell; /* 60h - PCI to Local Doorbell */
+ __u32 loc_doorbell; /* 64h - Local to PCI Doorbell */
+ __u32 intr_ctrl_stat; /* 68h - Interrupt Control/Status */
+ __u32 init_ctrl; /* 6Ch - EEPROM control, Init Control, etc */
+};
+
+/* Values for the Local Base Address re-map register */
+
+#define WIN_RAM 0x00000001L /* set the sliding window to RAM */
+#define WIN_CREG 0x14000001L /* set the window to custom Registers */
+
+/* Values timer select registers */
+
+#define TIMER_BY_1M 0x00 /* clock divided by 1M */
+#define TIMER_BY_256K 0x01 /* clock divided by 256k */
+#define TIMER_BY_128K 0x02 /* clock divided by 128k */
+#define TIMER_BY_32K 0x03 /* clock divided by 32k */
+
+/****************** ****************** *******************/
+#endif
+
+#ifndef ZFIRM_ID
+/* #include "zfwint.h" */
+/****************** ****************** *******************/
+/*
+ * This file contains the definitions for interfacing with the
+ * Cyclom-Z ZFIRM Firmware.
+ */
+
+/* General Constant definitions */
+
+#define MAX_CHAN 64 /* max number of channels per board */
+
+/* firmware id structure (set after boot) */
+
+#define ID_ADDRESS 0x00000180L /* signature/pointer address */
+#define ZFIRM_ID 0x5557465AL /* ZFIRM/U signature */
+#define ZFIRM_HLT 0x59505B5CL /* ZFIRM needs external power supply */
+#define ZFIRM_RST 0x56040674L /* RST signal (due to FW reset) */
+
+#define ZF_TINACT_DEF 1000 /* default inactivity timeout
+ (1000 ms) */
+#define ZF_TINACT ZF_TINACT_DEF
+
+struct FIRM_ID {
+ __u32 signature; /* ZFIRM/U signature */
+ __u32 zfwctrl_addr; /* pointer to ZFW_CTRL structure */
+};
+
+/* Op. System id */
+
+#define C_OS_LINUX 0x00000030 /* generic Linux system */
+
+/* channel op_mode */
+
+#define C_CH_DISABLE 0x00000000 /* channel is disabled */
+#define C_CH_TXENABLE 0x00000001 /* channel Tx enabled */
+#define C_CH_RXENABLE 0x00000002 /* channel Rx enabled */
+#define C_CH_ENABLE 0x00000003 /* channel Tx/Rx enabled */
+#define C_CH_LOOPBACK 0x00000004 /* Loopback mode */
+
+/* comm_parity - parity */
+
+#define C_PR_NONE 0x00000000 /* None */
+#define C_PR_ODD 0x00000001 /* Odd */
+#define C_PR_EVEN 0x00000002 /* Even */
+#define C_PR_MARK 0x00000004 /* Mark */
+#define C_PR_SPACE 0x00000008 /* Space */
+#define C_PR_PARITY 0x000000ff
+
+#define C_PR_DISCARD 0x00000100 /* discard char with frame/par error */
+#define C_PR_IGNORE 0x00000200 /* ignore frame/par error */
+
+/* comm_data_l - data length and stop bits */
+
+#define C_DL_CS5 0x00000001
+#define C_DL_CS6 0x00000002
+#define C_DL_CS7 0x00000004
+#define C_DL_CS8 0x00000008
+#define C_DL_CS 0x0000000f
+#define C_DL_1STOP 0x00000010
+#define C_DL_15STOP 0x00000020
+#define C_DL_2STOP 0x00000040
+#define C_DL_STOP 0x000000f0
+
+/* interrupt enabling/status */
+
+#define C_IN_DISABLE 0x00000000 /* zero, disable interrupts */
+#define C_IN_TXBEMPTY 0x00000001 /* tx buffer empty */
+#define C_IN_TXLOWWM 0x00000002 /* tx buffer below LWM */
+#define C_IN_RXHIWM 0x00000010 /* rx buffer above HWM */
+#define C_IN_RXNNDT 0x00000020 /* rx no new data timeout */
+#define C_IN_MDCD 0x00000100 /* modem DCD change */
+#define C_IN_MDSR 0x00000200 /* modem DSR change */
+#define C_IN_MRI 0x00000400 /* modem RI change */
+#define C_IN_MCTS 0x00000800 /* modem CTS change */
+#define C_IN_RXBRK 0x00001000 /* Break received */
+#define C_IN_PR_ERROR 0x00002000 /* parity error */
+#define C_IN_FR_ERROR 0x00004000 /* frame error */
+#define C_IN_OVR_ERROR 0x00008000 /* overrun error */
+#define C_IN_RXOFL 0x00010000 /* RX buffer overflow */
+#define C_IN_IOCTLW 0x00020000 /* I/O control w/ wait */
+#define C_IN_MRTS 0x00040000 /* modem RTS drop */
+#define C_IN_ICHAR 0x00080000
+
+/* flow control */
+
+#define C_FL_OXX 0x00000001 /* output Xon/Xoff flow control */
+#define C_FL_IXX 0x00000002 /* output Xon/Xoff flow control */
+#define C_FL_OIXANY 0x00000004 /* output Xon/Xoff (any xon) */
+#define C_FL_SWFLOW 0x0000000f
+
+/* flow status */
+
+#define C_FS_TXIDLE 0x00000000 /* no Tx data in the buffer or UART */
+#define C_FS_SENDING 0x00000001 /* UART is sending data */
+#define C_FS_SWFLOW 0x00000002 /* Tx is stopped by received Xoff */
+
+/* rs_control/rs_status RS-232 signals */
+
+#define C_RS_PARAM 0x80000000 /* Indicates presence of parameter in
+ IOCTLM command */
+#define C_RS_RTS 0x00000001 /* RTS */
+#define C_RS_DTR 0x00000004 /* DTR */
+#define C_RS_DCD 0x00000100 /* CD */
+#define C_RS_DSR 0x00000200 /* DSR */
+#define C_RS_RI 0x00000400 /* RI */
+#define C_RS_CTS 0x00000800 /* CTS */
+
+/* commands Host <-> Board */
+
+#define C_CM_RESET 0x01 /* reset/flush buffers */
+#define C_CM_IOCTL 0x02 /* re-read CH_CTRL */
+#define C_CM_IOCTLW 0x03 /* re-read CH_CTRL, intr when done */
+#define C_CM_IOCTLM 0x04 /* RS-232 outputs change */
+#define C_CM_SENDXOFF 0x10 /* send Xoff */
+#define C_CM_SENDXON 0x11 /* send Xon */
+#define C_CM_CLFLOW 0x12 /* Clear flow control (resume) */
+#define C_CM_SENDBRK 0x41 /* send break */
+#define C_CM_INTBACK 0x42 /* Interrupt back */
+#define C_CM_SET_BREAK 0x43 /* Tx break on */
+#define C_CM_CLR_BREAK 0x44 /* Tx break off */
+#define C_CM_CMD_DONE 0x45 /* Previous command done */
+#define C_CM_INTBACK2 0x46 /* Alternate Interrupt back */
+#define C_CM_TINACT 0x51 /* set inactivity detection */
+#define C_CM_IRQ_ENBL 0x52 /* enable generation of interrupts */
+#define C_CM_IRQ_DSBL 0x53 /* disable generation of interrupts */
+#define C_CM_ACK_ENBL 0x54 /* enable acknowledged interrupt mode */
+#define C_CM_ACK_DSBL 0x55 /* disable acknowledged intr mode */
+#define C_CM_FLUSH_RX 0x56 /* flushes Rx buffer */
+#define C_CM_FLUSH_TX 0x57 /* flushes Tx buffer */
+#define C_CM_Q_ENABLE 0x58 /* enables queue access from the
+ driver */
+#define C_CM_Q_DISABLE 0x59 /* disables queue access from the
+ driver */
+
+#define C_CM_TXBEMPTY 0x60 /* Tx buffer is empty */
+#define C_CM_TXLOWWM 0x61 /* Tx buffer low water mark */
+#define C_CM_RXHIWM 0x62 /* Rx buffer high water mark */
+#define C_CM_RXNNDT 0x63 /* rx no new data timeout */
+#define C_CM_TXFEMPTY 0x64
+#define C_CM_ICHAR 0x65
+#define C_CM_MDCD 0x70 /* modem DCD change */
+#define C_CM_MDSR 0x71 /* modem DSR change */
+#define C_CM_MRI 0x72 /* modem RI change */
+#define C_CM_MCTS 0x73 /* modem CTS change */
+#define C_CM_MRTS 0x74 /* modem RTS drop */
+#define C_CM_RXBRK 0x84 /* Break received */
+#define C_CM_PR_ERROR 0x85 /* Parity error */
+#define C_CM_FR_ERROR 0x86 /* Frame error */
+#define C_CM_OVR_ERROR 0x87 /* Overrun error */
+#define C_CM_RXOFL 0x88 /* RX buffer overflow */
+#define C_CM_CMDERROR 0x90 /* command error */
+#define C_CM_FATAL 0x91 /* fatal error */
+#define C_CM_HW_RESET 0x92 /* reset board */
+
+/*
+ * CH_CTRL - This per port structure contains all parameters
+ * that control an specific port. It can be seen as the
+ * configuration registers of a "super-serial-controller".
+ */
+
+struct CH_CTRL {
+ __u32 op_mode; /* operation mode */
+ __u32 intr_enable; /* interrupt masking */
+ __u32 sw_flow; /* SW flow control */
+ __u32 flow_status; /* output flow status */
+ __u32 comm_baud; /* baud rate - numerically specified */
+ __u32 comm_parity; /* parity */
+ __u32 comm_data_l; /* data length/stop */
+ __u32 comm_flags; /* other flags */
+ __u32 hw_flow; /* HW flow control */
+ __u32 rs_control; /* RS-232 outputs */
+ __u32 rs_status; /* RS-232 inputs */
+ __u32 flow_xon; /* xon char */
+ __u32 flow_xoff; /* xoff char */
+ __u32 hw_overflow; /* hw overflow counter */
+ __u32 sw_overflow; /* sw overflow counter */
+ __u32 comm_error; /* frame/parity error counter */
+ __u32 ichar;
+ __u32 filler[7];
+};
+
+
+/*
+ * BUF_CTRL - This per channel structure contains
+ * all Tx and Rx buffer control for a given channel.
+ */
+
+struct BUF_CTRL {
+ __u32 flag_dma; /* buffers are in Host memory */
+ __u32 tx_bufaddr; /* address of the tx buffer */
+ __u32 tx_bufsize; /* tx buffer size */
+ __u32 tx_threshold; /* tx low water mark */
+ __u32 tx_get; /* tail index tx buf */
+ __u32 tx_put; /* head index tx buf */
+ __u32 rx_bufaddr; /* address of the rx buffer */
+ __u32 rx_bufsize; /* rx buffer size */
+ __u32 rx_threshold; /* rx high water mark */
+ __u32 rx_get; /* tail index rx buf */
+ __u32 rx_put; /* head index rx buf */
+ __u32 filler[5]; /* filler to align structures */
+};
+
+/*
+ * BOARD_CTRL - This per board structure contains all global
+ * control fields related to the board.
+ */
+
+struct BOARD_CTRL {
+
+ /* static info provided by the on-board CPU */
+ __u32 n_channel; /* number of channels */
+ __u32 fw_version; /* firmware version */
+
+ /* static info provided by the driver */
+ __u32 op_system; /* op_system id */
+ __u32 dr_version; /* driver version */
+
+ /* board control area */
+ __u32 inactivity; /* inactivity control */
+
+ /* host to FW commands */
+ __u32 hcmd_channel; /* channel number */
+ __u32 hcmd_param; /* pointer to parameters */
+
+ /* FW to Host commands */
+ __u32 fwcmd_channel; /* channel number */
+ __u32 fwcmd_param; /* pointer to parameters */
+ __u32 zf_int_queue_addr; /* offset for INT_QUEUE structure */
+
+ /* filler so the structures are aligned */
+ __u32 filler[6];
+};
+
+/* Host Interrupt Queue */
+
+#define QUEUE_SIZE (10*MAX_CHAN)
+
+struct INT_QUEUE {
+ unsigned char intr_code[QUEUE_SIZE];
+ unsigned long channel[QUEUE_SIZE];
+ unsigned long param[QUEUE_SIZE];
+ unsigned long put;
+ unsigned long get;
+};
+
+/*
+ * ZFW_CTRL - This is the data structure that includes all other
+ * data structures used by the Firmware.
+ */
+
+struct ZFW_CTRL {
+ struct BOARD_CTRL board_ctrl;
+ struct CH_CTRL ch_ctrl[MAX_CHAN];
+ struct BUF_CTRL buf_ctrl[MAX_CHAN];
+};
+
+/****************** ****************** *******************/
+#endif
+
+#endif /* _LINUX_CYCLADES_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cycx_cfm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cycx_cfm.h
new file mode 100644
index 0000000..032d26e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/cycx_cfm.h
@@ -0,0 +1,101 @@
+/*
+* cycx_cfm.h Cyclom 2X WAN Link Driver.
+* Definitions for the Cyclom 2X Firmware Module (CFM).
+*
+* Author: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+*
+* Copyright: (c) 1998-2003 Arnaldo Carvalho de Melo
+*
+* Based on sdlasfm.h by Gene Kozin <74604.152@compuserve.com>
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version
+* 2 of the License, or (at your option) any later version.
+* ============================================================================
+* 1998/08/08 acme Initial version.
+*/
+#ifndef _CYCX_CFM_H
+#define _CYCX_CFM_H
+
+/* Defines */
+
+#define CFM_VERSION 2
+#define CFM_SIGNATURE "CFM - Cyclades CYCX Firmware Module"
+
+/* min/max */
+#define CFM_IMAGE_SIZE 0x20000 /* max size of CYCX code image file */
+#define CFM_DESCR_LEN 256 /* max length of description string */
+#define CFM_MAX_CYCX 1 /* max number of compatible adapters */
+#define CFM_LOAD_BUFSZ 0x400 /* buffer size for reset code (buffer_load) */
+
+/* Firmware Commands */
+#define GEN_POWER_ON 0x1280
+
+#define GEN_SET_SEG 0x1401 /* boot segment setting. */
+#define GEN_BOOT_DAT 0x1402 /* boot data. */
+#define GEN_START 0x1403 /* board start. */
+#define GEN_DEFPAR 0x1404 /* buffer length for boot. */
+
+/* Adapter Types */
+#define CYCX_2X 2
+/* for now only the 2X is supported, no plans to support 8X or 16X */
+#define CYCX_8X 8
+#define CYCX_16X 16
+
+#define CFID_X25_2X 5200
+
+/**
+ * struct cycx_fw_info - firmware module information.
+ * @codeid - firmware ID
+ * @version - firmware version number
+ * @adapter - compatible adapter types
+ * @memsize - minimum memory size
+ * @reserved - reserved
+ * @startoffs - entry point offset
+ * @winoffs - dual-port memory window offset
+ * @codeoffs - code load offset
+ * @codesize - code size
+ * @dataoffs - configuration data load offset
+ * @datasize - configuration data size
+ */
+struct cycx_fw_info {
+ unsigned short codeid;
+ unsigned short version;
+ unsigned short adapter[CFM_MAX_CYCX];
+ unsigned long memsize;
+ unsigned short reserved[2];
+ unsigned short startoffs;
+ unsigned short winoffs;
+ unsigned short codeoffs;
+ unsigned long codesize;
+ unsigned short dataoffs;
+ unsigned long datasize;
+};
+
+/**
+ * struct cycx_firmware - CYCX firmware file structure
+ * @signature - CFM file signature
+ * @version - file format version
+ * @checksum - info + image
+ * @reserved - reserved
+ * @descr - description string
+ * @info - firmware module info
+ * @image - code image (variable size)
+ */
+struct cycx_firmware {
+ char signature[80];
+ unsigned short version;
+ unsigned short checksum;
+ unsigned short reserved[6];
+ char descr[CFM_DESCR_LEN];
+ struct cycx_fw_info info;
+ unsigned char image[0];
+};
+
+struct cycx_fw_header {
+ unsigned long reset_size;
+ unsigned long data_size;
+ unsigned long code_size;
+};
+#endif /* _CYCX_CFM_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dcbnl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dcbnl.h
new file mode 100644
index 0000000..7d2e100
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dcbnl.h
@@ -0,0 +1,342 @@
+/*
+ * Copyright (c) 2008, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * Author: Lucy Liu <lucy.liu@intel.com>
+ */
+
+#ifndef __LINUX_DCBNL_H__
+#define __LINUX_DCBNL_H__
+
+#include <linux/types.h>
+
+#define DCB_PROTO_VERSION 1
+
+struct dcbmsg {
+ __u8 dcb_family;
+ __u8 cmd;
+ __u16 dcb_pad;
+};
+
+/**
+ * enum dcbnl_commands - supported DCB commands
+ *
+ * @DCB_CMD_UNDEFINED: unspecified command to catch errors
+ * @DCB_CMD_GSTATE: request the state of DCB in the device
+ * @DCB_CMD_SSTATE: set the state of DCB in the device
+ * @DCB_CMD_PGTX_GCFG: request the priority group configuration for Tx
+ * @DCB_CMD_PGTX_SCFG: set the priority group configuration for Tx
+ * @DCB_CMD_PGRX_GCFG: request the priority group configuration for Rx
+ * @DCB_CMD_PGRX_SCFG: set the priority group configuration for Rx
+ * @DCB_CMD_PFC_GCFG: request the priority flow control configuration
+ * @DCB_CMD_PFC_SCFG: set the priority flow control configuration
+ * @DCB_CMD_SET_ALL: apply all changes to the underlying device
+ * @DCB_CMD_GPERM_HWADDR: get the permanent MAC address of the underlying
+ * device. Only useful when using bonding.
+ * @DCB_CMD_GCAP: request the DCB capabilities of the device
+ * @DCB_CMD_GNUMTCS: get the number of traffic classes currently supported
+ * @DCB_CMD_SNUMTCS: set the number of traffic classes
+ * @DCB_CMD_GBCN: set backward congestion notification configuration
+ * @DCB_CMD_SBCN: get backward congestion notification configration.
+ */
+enum dcbnl_commands {
+ DCB_CMD_UNDEFINED,
+
+ DCB_CMD_GSTATE,
+ DCB_CMD_SSTATE,
+
+ DCB_CMD_PGTX_GCFG,
+ DCB_CMD_PGTX_SCFG,
+ DCB_CMD_PGRX_GCFG,
+ DCB_CMD_PGRX_SCFG,
+
+ DCB_CMD_PFC_GCFG,
+ DCB_CMD_PFC_SCFG,
+
+ DCB_CMD_SET_ALL,
+
+ DCB_CMD_GPERM_HWADDR,
+
+ DCB_CMD_GCAP,
+
+ DCB_CMD_GNUMTCS,
+ DCB_CMD_SNUMTCS,
+
+ DCB_CMD_PFC_GSTATE,
+ DCB_CMD_PFC_SSTATE,
+
+ DCB_CMD_BCN_GCFG,
+ DCB_CMD_BCN_SCFG,
+
+ __DCB_CMD_ENUM_MAX,
+ DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
+};
+
+/**
+ * enum dcbnl_attrs - DCB top-level netlink attributes
+ *
+ * @DCB_ATTR_UNDEFINED: unspecified attribute to catch errors
+ * @DCB_ATTR_IFNAME: interface name of the underlying device (NLA_STRING)
+ * @DCB_ATTR_STATE: enable state of DCB in the device (NLA_U8)
+ * @DCB_ATTR_PFC_STATE: enable state of PFC in the device (NLA_U8)
+ * @DCB_ATTR_PFC_CFG: priority flow control configuration (NLA_NESTED)
+ * @DCB_ATTR_NUM_TC: number of traffic classes supported in the device (NLA_U8)
+ * @DCB_ATTR_PG_CFG: priority group configuration (NLA_NESTED)
+ * @DCB_ATTR_SET_ALL: bool to commit changes to hardware or not (NLA_U8)
+ * @DCB_ATTR_PERM_HWADDR: MAC address of the physical device (NLA_NESTED)
+ * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED)
+ * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED)
+ * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED)
+ */
+enum dcbnl_attrs {
+ DCB_ATTR_UNDEFINED,
+
+ DCB_ATTR_IFNAME,
+ DCB_ATTR_STATE,
+ DCB_ATTR_PFC_STATE,
+ DCB_ATTR_PFC_CFG,
+ DCB_ATTR_NUM_TC,
+ DCB_ATTR_PG_CFG,
+ DCB_ATTR_SET_ALL,
+ DCB_ATTR_PERM_HWADDR,
+ DCB_ATTR_CAP,
+ DCB_ATTR_NUMTCS,
+ DCB_ATTR_BCN,
+
+ __DCB_ATTR_ENUM_MAX,
+ DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
+};
+
+/**
+ * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
+ *
+ * @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors
+ * @DCB_PFC_UP_ATTR_0: Priority Flow Control value for User Priority 0 (NLA_U8)
+ * @DCB_PFC_UP_ATTR_1: Priority Flow Control value for User Priority 1 (NLA_U8)
+ * @DCB_PFC_UP_ATTR_2: Priority Flow Control value for User Priority 2 (NLA_U8)
+ * @DCB_PFC_UP_ATTR_3: Priority Flow Control value for User Priority 3 (NLA_U8)
+ * @DCB_PFC_UP_ATTR_4: Priority Flow Control value for User Priority 4 (NLA_U8)
+ * @DCB_PFC_UP_ATTR_5: Priority Flow Control value for User Priority 5 (NLA_U8)
+ * @DCB_PFC_UP_ATTR_6: Priority Flow Control value for User Priority 6 (NLA_U8)
+ * @DCB_PFC_UP_ATTR_7: Priority Flow Control value for User Priority 7 (NLA_U8)
+ * @DCB_PFC_UP_ATTR_MAX: highest attribute number currently defined
+ * @DCB_PFC_UP_ATTR_ALL: apply to all priority flow control attrs (NLA_FLAG)
+ *
+ */
+enum dcbnl_pfc_up_attrs {
+ DCB_PFC_UP_ATTR_UNDEFINED,
+
+ DCB_PFC_UP_ATTR_0,
+ DCB_PFC_UP_ATTR_1,
+ DCB_PFC_UP_ATTR_2,
+ DCB_PFC_UP_ATTR_3,
+ DCB_PFC_UP_ATTR_4,
+ DCB_PFC_UP_ATTR_5,
+ DCB_PFC_UP_ATTR_6,
+ DCB_PFC_UP_ATTR_7,
+ DCB_PFC_UP_ATTR_ALL,
+
+ __DCB_PFC_UP_ATTR_ENUM_MAX,
+ DCB_PFC_UP_ATTR_MAX = __DCB_PFC_UP_ATTR_ENUM_MAX - 1,
+};
+
+/**
+ * enum dcbnl_pg_attrs - DCB Priority Group attributes
+ *
+ * @DCB_PG_ATTR_UNDEFINED: unspecified attribute to catch errors
+ * @DCB_PG_ATTR_TC_0: Priority Group Traffic Class 0 configuration (NLA_NESTED)
+ * @DCB_PG_ATTR_TC_1: Priority Group Traffic Class 1 configuration (NLA_NESTED)
+ * @DCB_PG_ATTR_TC_2: Priority Group Traffic Class 2 configuration (NLA_NESTED)
+ * @DCB_PG_ATTR_TC_3: Priority Group Traffic Class 3 configuration (NLA_NESTED)
+ * @DCB_PG_ATTR_TC_4: Priority Group Traffic Class 4 configuration (NLA_NESTED)
+ * @DCB_PG_ATTR_TC_5: Priority Group Traffic Class 5 configuration (NLA_NESTED)
+ * @DCB_PG_ATTR_TC_6: Priority Group Traffic Class 6 configuration (NLA_NESTED)
+ * @DCB_PG_ATTR_TC_7: Priority Group Traffic Class 7 configuration (NLA_NESTED)
+ * @DCB_PG_ATTR_TC_MAX: highest attribute number currently defined
+ * @DCB_PG_ATTR_TC_ALL: apply to all traffic classes (NLA_NESTED)
+ * @DCB_PG_ATTR_BW_ID_0: Percent of link bandwidth for Priority Group 0 (NLA_U8)
+ * @DCB_PG_ATTR_BW_ID_1: Percent of link bandwidth for Priority Group 1 (NLA_U8)
+ * @DCB_PG_ATTR_BW_ID_2: Percent of link bandwidth for Priority Group 2 (NLA_U8)
+ * @DCB_PG_ATTR_BW_ID_3: Percent of link bandwidth for Priority Group 3 (NLA_U8)
+ * @DCB_PG_ATTR_BW_ID_4: Percent of link bandwidth for Priority Group 4 (NLA_U8)
+ * @DCB_PG_ATTR_BW_ID_5: Percent of link bandwidth for Priority Group 5 (NLA_U8)
+ * @DCB_PG_ATTR_BW_ID_6: Percent of link bandwidth for Priority Group 6 (NLA_U8)
+ * @DCB_PG_ATTR_BW_ID_7: Percent of link bandwidth for Priority Group 7 (NLA_U8)
+ * @DCB_PG_ATTR_BW_ID_MAX: highest attribute number currently defined
+ * @DCB_PG_ATTR_BW_ID_ALL: apply to all priority groups (NLA_FLAG)
+ *
+ */
+enum dcbnl_pg_attrs {
+ DCB_PG_ATTR_UNDEFINED,
+
+ DCB_PG_ATTR_TC_0,
+ DCB_PG_ATTR_TC_1,
+ DCB_PG_ATTR_TC_2,
+ DCB_PG_ATTR_TC_3,
+ DCB_PG_ATTR_TC_4,
+ DCB_PG_ATTR_TC_5,
+ DCB_PG_ATTR_TC_6,
+ DCB_PG_ATTR_TC_7,
+ DCB_PG_ATTR_TC_MAX,
+ DCB_PG_ATTR_TC_ALL,
+
+ DCB_PG_ATTR_BW_ID_0,
+ DCB_PG_ATTR_BW_ID_1,
+ DCB_PG_ATTR_BW_ID_2,
+ DCB_PG_ATTR_BW_ID_3,
+ DCB_PG_ATTR_BW_ID_4,
+ DCB_PG_ATTR_BW_ID_5,
+ DCB_PG_ATTR_BW_ID_6,
+ DCB_PG_ATTR_BW_ID_7,
+ DCB_PG_ATTR_BW_ID_MAX,
+ DCB_PG_ATTR_BW_ID_ALL,
+
+ __DCB_PG_ATTR_ENUM_MAX,
+ DCB_PG_ATTR_MAX = __DCB_PG_ATTR_ENUM_MAX - 1,
+};
+
+/**
+ * enum dcbnl_tc_attrs - DCB Traffic Class attributes
+ *
+ * @DCB_TC_ATTR_PARAM_UNDEFINED: unspecified attribute to catch errors
+ * @DCB_TC_ATTR_PARAM_PGID: (NLA_U8) Priority group the traffic class belongs to
+ * Valid values are: 0-7
+ * @DCB_TC_ATTR_PARAM_UP_MAPPING: (NLA_U8) Traffic class to user priority map
+ * Some devices may not support changing the
+ * user priority map of a TC.
+ * @DCB_TC_ATTR_PARAM_STRICT_PRIO: (NLA_U8) Strict priority setting
+ * 0 - none
+ * 1 - group strict
+ * 2 - link strict
+ * @DCB_TC_ATTR_PARAM_BW_PCT: optional - (NLA_U8) If supported by the device and
+ * not configured to use link strict priority,
+ * this is the percentage of bandwidth of the
+ * priority group this traffic class belongs to
+ * @DCB_TC_ATTR_PARAM_ALL: (NLA_FLAG) all traffic class parameters
+ *
+ */
+enum dcbnl_tc_attrs {
+ DCB_TC_ATTR_PARAM_UNDEFINED,
+
+ DCB_TC_ATTR_PARAM_PGID,
+ DCB_TC_ATTR_PARAM_UP_MAPPING,
+ DCB_TC_ATTR_PARAM_STRICT_PRIO,
+ DCB_TC_ATTR_PARAM_BW_PCT,
+ DCB_TC_ATTR_PARAM_ALL,
+
+ __DCB_TC_ATTR_PARAM_ENUM_MAX,
+ DCB_TC_ATTR_PARAM_MAX = __DCB_TC_ATTR_PARAM_ENUM_MAX - 1,
+};
+
+/**
+ * enum dcbnl_cap_attrs - DCB Capability attributes
+ *
+ * @DCB_CAP_ATTR_UNDEFINED: unspecified attribute to catch errors
+ * @DCB_CAP_ATTR_ALL: (NLA_FLAG) all capability parameters
+ * @DCB_CAP_ATTR_PG: (NLA_U8) device supports Priority Groups
+ * @DCB_CAP_ATTR_PFC: (NLA_U8) device supports Priority Flow Control
+ * @DCB_CAP_ATTR_UP2TC: (NLA_U8) device supports user priority to
+ * traffic class mapping
+ * @DCB_CAP_ATTR_PG_TCS: (NLA_U8) bitmap where each bit represents a
+ * number of traffic classes the device
+ * can be configured to use for Priority Groups
+ * @DCB_CAP_ATTR_PFC_TCS: (NLA_U8) bitmap where each bit represents a
+ * number of traffic classes the device can be
+ * configured to use for Priority Flow Control
+ * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority
+ * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion
+ * Notification
+ */
+enum dcbnl_cap_attrs {
+ DCB_CAP_ATTR_UNDEFINED,
+ DCB_CAP_ATTR_ALL,
+ DCB_CAP_ATTR_PG,
+ DCB_CAP_ATTR_PFC,
+ DCB_CAP_ATTR_UP2TC,
+ DCB_CAP_ATTR_PG_TCS,
+ DCB_CAP_ATTR_PFC_TCS,
+ DCB_CAP_ATTR_GSP,
+ DCB_CAP_ATTR_BCN,
+
+ __DCB_CAP_ATTR_ENUM_MAX,
+ DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1,
+};
+
+/**
+ * enum dcbnl_numtcs_attrs - number of traffic classes
+ *
+ * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors
+ * @DCB_NUMTCS_ATTR_ALL: (NLA_FLAG) all traffic class attributes
+ * @DCB_NUMTCS_ATTR_PG: (NLA_U8) number of traffic classes used for
+ * priority groups
+ * @DCB_NUMTCS_ATTR_PFC: (NLA_U8) number of traffic classes which can
+ * support priority flow control
+ */
+enum dcbnl_numtcs_attrs {
+ DCB_NUMTCS_ATTR_UNDEFINED,
+ DCB_NUMTCS_ATTR_ALL,
+ DCB_NUMTCS_ATTR_PG,
+ DCB_NUMTCS_ATTR_PFC,
+
+ __DCB_NUMTCS_ATTR_ENUM_MAX,
+ DCB_NUMTCS_ATTR_MAX = __DCB_NUMTCS_ATTR_ENUM_MAX - 1,
+};
+
+enum dcbnl_bcn_attrs{
+ DCB_BCN_ATTR_UNDEFINED = 0,
+
+ DCB_BCN_ATTR_RP_0,
+ DCB_BCN_ATTR_RP_1,
+ DCB_BCN_ATTR_RP_2,
+ DCB_BCN_ATTR_RP_3,
+ DCB_BCN_ATTR_RP_4,
+ DCB_BCN_ATTR_RP_5,
+ DCB_BCN_ATTR_RP_6,
+ DCB_BCN_ATTR_RP_7,
+ DCB_BCN_ATTR_RP_ALL,
+
+ DCB_BCN_ATTR_BCNA_0,
+ DCB_BCN_ATTR_BCNA_1,
+ DCB_BCN_ATTR_ALPHA,
+ DCB_BCN_ATTR_BETA,
+ DCB_BCN_ATTR_GD,
+ DCB_BCN_ATTR_GI,
+ DCB_BCN_ATTR_TMAX,
+ DCB_BCN_ATTR_TD,
+ DCB_BCN_ATTR_RMIN,
+ DCB_BCN_ATTR_W,
+ DCB_BCN_ATTR_RD,
+ DCB_BCN_ATTR_RU,
+ DCB_BCN_ATTR_WRTT,
+ DCB_BCN_ATTR_RI,
+ DCB_BCN_ATTR_C,
+ DCB_BCN_ATTR_ALL,
+
+ __DCB_BCN_ATTR_ENUM_MAX,
+ DCB_BCN_ATTR_MAX = __DCB_BCN_ATTR_ENUM_MAX - 1,
+};
+
+/**
+ * enum dcb_general_attr_values - general DCB attribute values
+ *
+ * @DCB_ATTR_UNDEFINED: value used to indicate an attribute is not supported
+ *
+ */
+enum dcb_general_attr_values {
+ DCB_ATTR_VALUE_UNDEFINED = 0xff
+};
+
+
+#endif /* __LINUX_DCBNL_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dccp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dccp.h
new file mode 100644
index 0000000..bdd6d4a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dccp.h
@@ -0,0 +1,218 @@
+#ifndef _LINUX_DCCP_H
+#define _LINUX_DCCP_H
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+/**
+ * struct dccp_hdr - generic part of DCCP packet header
+ *
+ * @dccph_sport - Relevant port on the endpoint that sent this packet
+ * @dccph_dport - Relevant port on the other endpoint
+ * @dccph_doff - Data Offset from the start of the DCCP header, in 32-bit words
+ * @dccph_ccval - Used by the HC-Sender CCID
+ * @dccph_cscov - Parts of the packet that are covered by the Checksum field
+ * @dccph_checksum - Internet checksum, depends on dccph_cscov
+ * @dccph_x - 0 = 24 bit sequence number, 1 = 48
+ * @dccph_type - packet type, see DCCP_PKT_ prefixed macros
+ * @dccph_seq - sequence number high or low order 24 bits, depends on dccph_x
+ */
+struct dccp_hdr {
+ __be16 dccph_sport,
+ dccph_dport;
+ __u8 dccph_doff;
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 dccph_cscov:4,
+ dccph_ccval:4;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u8 dccph_ccval:4,
+ dccph_cscov:4;
+#else
+#error "Adjust your <asm/byteorder.h> defines"
+#endif
+ __sum16 dccph_checksum;
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 dccph_x:1,
+ dccph_type:4,
+ dccph_reserved:3;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u8 dccph_reserved:3,
+ dccph_type:4,
+ dccph_x:1;
+#else
+#error "Adjust your <asm/byteorder.h> defines"
+#endif
+ __u8 dccph_seq2;
+ __be16 dccph_seq;
+};
+
+/**
+ * struct dccp_hdr_ext - the low bits of a 48 bit seq packet
+ *
+ * @dccph_seq_low - low 24 bits of a 48 bit seq packet
+ */
+struct dccp_hdr_ext {
+ __be32 dccph_seq_low;
+};
+
+/**
+ * struct dccp_hdr_request - Connection initiation request header
+ *
+ * @dccph_req_service - Service to which the client app wants to connect
+ */
+struct dccp_hdr_request {
+ __be32 dccph_req_service;
+};
+/**
+ * struct dccp_hdr_ack_bits - acknowledgment bits common to most packets
+ *
+ * @dccph_resp_ack_nr_high - 48 bit ack number high order bits, contains GSR
+ * @dccph_resp_ack_nr_low - 48 bit ack number low order bits, contains GSR
+ */
+struct dccp_hdr_ack_bits {
+ __be16 dccph_reserved1;
+ __be16 dccph_ack_nr_high;
+ __be32 dccph_ack_nr_low;
+};
+/**
+ * struct dccp_hdr_response - Connection initiation response header
+ *
+ * @dccph_resp_ack - 48 bit Acknowledgment Number Subheader (5.3)
+ * @dccph_resp_service - Echoes the Service Code on a received DCCP-Request
+ */
+struct dccp_hdr_response {
+ struct dccp_hdr_ack_bits dccph_resp_ack;
+ __be32 dccph_resp_service;
+};
+
+/**
+ * struct dccp_hdr_reset - Unconditionally shut down a connection
+ *
+ * @dccph_reset_ack - 48 bit Acknowledgment Number Subheader (5.6)
+ * @dccph_reset_code - one of %dccp_reset_codes
+ * @dccph_reset_data - the Data 1 ... Data 3 fields from 5.6
+ */
+struct dccp_hdr_reset {
+ struct dccp_hdr_ack_bits dccph_reset_ack;
+ __u8 dccph_reset_code,
+ dccph_reset_data[3];
+};
+
+enum dccp_pkt_type {
+ DCCP_PKT_REQUEST = 0,
+ DCCP_PKT_RESPONSE,
+ DCCP_PKT_DATA,
+ DCCP_PKT_ACK,
+ DCCP_PKT_DATAACK,
+ DCCP_PKT_CLOSEREQ,
+ DCCP_PKT_CLOSE,
+ DCCP_PKT_RESET,
+ DCCP_PKT_SYNC,
+ DCCP_PKT_SYNCACK,
+ DCCP_PKT_INVALID,
+};
+
+#define DCCP_NR_PKT_TYPES DCCP_PKT_INVALID
+
+static __inline__ unsigned int dccp_packet_hdr_len(const __u8 type)
+{
+ if (type == DCCP_PKT_DATA)
+ return 0;
+ if (type == DCCP_PKT_DATAACK ||
+ type == DCCP_PKT_ACK ||
+ type == DCCP_PKT_SYNC ||
+ type == DCCP_PKT_SYNCACK ||
+ type == DCCP_PKT_CLOSE ||
+ type == DCCP_PKT_CLOSEREQ)
+ return sizeof(struct dccp_hdr_ack_bits);
+ if (type == DCCP_PKT_REQUEST)
+ return sizeof(struct dccp_hdr_request);
+ if (type == DCCP_PKT_RESPONSE)
+ return sizeof(struct dccp_hdr_response);
+ return sizeof(struct dccp_hdr_reset);
+}
+enum dccp_reset_codes {
+ DCCP_RESET_CODE_UNSPECIFIED = 0,
+ DCCP_RESET_CODE_CLOSED,
+ DCCP_RESET_CODE_ABORTED,
+ DCCP_RESET_CODE_NO_CONNECTION,
+ DCCP_RESET_CODE_PACKET_ERROR,
+ DCCP_RESET_CODE_OPTION_ERROR,
+ DCCP_RESET_CODE_MANDATORY_ERROR,
+ DCCP_RESET_CODE_CONNECTION_REFUSED,
+ DCCP_RESET_CODE_BAD_SERVICE_CODE,
+ DCCP_RESET_CODE_TOO_BUSY,
+ DCCP_RESET_CODE_BAD_INIT_COOKIE,
+ DCCP_RESET_CODE_AGGRESSION_PENALTY,
+
+ DCCP_MAX_RESET_CODES /* Leave at the end! */
+};
+
+/* DCCP options */
+enum {
+ DCCPO_PADDING = 0,
+ DCCPO_MANDATORY = 1,
+ DCCPO_MIN_RESERVED = 3,
+ DCCPO_MAX_RESERVED = 31,
+ DCCPO_CHANGE_L = 32,
+ DCCPO_CONFIRM_L = 33,
+ DCCPO_CHANGE_R = 34,
+ DCCPO_CONFIRM_R = 35,
+ DCCPO_NDP_COUNT = 37,
+ DCCPO_ACK_VECTOR_0 = 38,
+ DCCPO_ACK_VECTOR_1 = 39,
+ DCCPO_TIMESTAMP = 41,
+ DCCPO_TIMESTAMP_ECHO = 42,
+ DCCPO_ELAPSED_TIME = 43,
+ DCCPO_MAX = 45,
+ DCCPO_MIN_CCID_SPECIFIC = 128,
+ DCCPO_MAX_CCID_SPECIFIC = 255,
+};
+/* maximum size of a single TLV-encoded DCCP option (sans type/len bytes) */
+#define DCCP_SINGLE_OPT_MAXLEN 253
+
+/* DCCP CCIDS */
+enum {
+ DCCPC_CCID2 = 2,
+ DCCPC_CCID3 = 3,
+};
+
+/* DCCP features (RFC 4340 section 6.4) */
+enum dccp_feature_numbers {
+ DCCPF_RESERVED = 0,
+ DCCPF_CCID = 1,
+ DCCPF_SHORT_SEQNOS = 2,
+ DCCPF_SEQUENCE_WINDOW = 3,
+ DCCPF_ECN_INCAPABLE = 4,
+ DCCPF_ACK_RATIO = 5,
+ DCCPF_SEND_ACK_VECTOR = 6,
+ DCCPF_SEND_NDP_COUNT = 7,
+ DCCPF_MIN_CSUM_COVER = 8,
+ DCCPF_DATA_CHECKSUM = 9,
+ /* 10-127 reserved */
+ DCCPF_MIN_CCID_SPECIFIC = 128,
+ DCCPF_SEND_LEV_RATE = 192, /* RFC 4342, sec. 8.4 */
+ DCCPF_MAX_CCID_SPECIFIC = 255,
+};
+
+/* DCCP socket options */
+#define DCCP_SOCKOPT_PACKET_SIZE 1 /* XXX deprecated, without effect */
+#define DCCP_SOCKOPT_SERVICE 2
+#define DCCP_SOCKOPT_CHANGE_L 3
+#define DCCP_SOCKOPT_CHANGE_R 4
+#define DCCP_SOCKOPT_GET_CUR_MPS 5
+#define DCCP_SOCKOPT_SERVER_TIMEWAIT 6
+#define DCCP_SOCKOPT_SEND_CSCOV 10
+#define DCCP_SOCKOPT_RECV_CSCOV 11
+#define DCCP_SOCKOPT_AVAILABLE_CCIDS 12
+#define DCCP_SOCKOPT_CCID 13
+#define DCCP_SOCKOPT_TX_CCID 14
+#define DCCP_SOCKOPT_RX_CCID 15
+#define DCCP_SOCKOPT_CCID_RX_INFO 128
+#define DCCP_SOCKOPT_CCID_TX_INFO 192
+
+/* maximum number of services provided on the same listening port */
+#define DCCP_SERVICE_LIST_MAX_LEN 32
+
+
+#endif /* _LINUX_DCCP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dlm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dlm.h
new file mode 100644
index 0000000..2293367
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dlm.h
@@ -0,0 +1,77 @@
+/******************************************************************************
+*******************************************************************************
+**
+** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
+** Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
+**
+** This copyrighted material is made available to anyone wishing to use,
+** modify, copy, or redistribute it subject to the terms and conditions
+** of the GNU General Public License v.2.
+**
+*******************************************************************************
+******************************************************************************/
+
+#ifndef __DLM_DOT_H__
+#define __DLM_DOT_H__
+
+/*
+ * Interface to Distributed Lock Manager (DLM)
+ * routines and structures to use DLM lockspaces
+ */
+
+/* Lock levels and flags are here */
+#include <linux/dlmconstants.h>
+#include <linux/types.h>
+
+typedef void dlm_lockspace_t;
+
+/*
+ * Lock status block
+ *
+ * Use this structure to specify the contents of the lock value block. For a
+ * conversion request, this structure is used to specify the lock ID of the
+ * lock. DLM writes the status of the lock request and the lock ID assigned
+ * to the request in the lock status block.
+ *
+ * sb_lkid: the returned lock ID. It is set on new (non-conversion) requests.
+ * It is available when dlm_lock returns.
+ *
+ * sb_lvbptr: saves or returns the contents of the lock's LVB according to rules
+ * shown for the DLM_LKF_VALBLK flag.
+ *
+ * sb_flags: DLM_SBF_DEMOTED is returned if in the process of promoting a lock,
+ * it was first demoted to NL to avoid conversion deadlock.
+ * DLM_SBF_VALNOTVALID is returned if the resource's LVB is marked invalid.
+ *
+ * sb_status: the returned status of the lock request set prior to AST
+ * execution. Possible return values:
+ *
+ * 0 if lock request was successful
+ * -EAGAIN if request would block and is flagged DLM_LKF_NOQUEUE
+ * -ENOMEM if there is no memory to process request
+ * -EINVAL if there are invalid parameters
+ * -DLM_EUNLOCK if unlock request was successful
+ * -DLM_ECANCEL if a cancel completed successfully
+ */
+
+#define DLM_SBF_DEMOTED 0x01
+#define DLM_SBF_VALNOTVALID 0x02
+#define DLM_SBF_ALTMODE 0x04
+
+struct dlm_lksb {
+ int sb_status;
+ __u32 sb_lkid;
+ char sb_flags;
+ char * sb_lvbptr;
+};
+
+/* dlm_new_lockspace() flags */
+
+#define DLM_LSFL_NODIR 0x00000001
+#define DLM_LSFL_TIMEWARN 0x00000002
+#define DLM_LSFL_FS 0x00000004
+#define DLM_LSFL_NEWEXCL 0x00000008
+
+
+#endif /* __DLM_DOT_H__ */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dlm_device.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dlm_device.h
new file mode 100644
index 0000000..62d9ebf
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dlm_device.h
@@ -0,0 +1,108 @@
+/******************************************************************************
+*******************************************************************************
+**
+** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
+** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
+**
+** This copyrighted material is made available to anyone wishing to use,
+** modify, copy, or redistribute it subject to the terms and conditions
+** of the GNU General Public License v.2.
+**
+*******************************************************************************
+******************************************************************************/
+
+#ifndef _LINUX_DLM_DEVICE_H
+#define _LINUX_DLM_DEVICE_H
+
+/* This is the device interface for dlm, most users will use a library
+ * interface.
+ */
+
+#include <linux/dlm.h>
+#include <linux/types.h>
+
+#define DLM_USER_LVB_LEN 32
+
+/* Version of the device interface */
+#define DLM_DEVICE_VERSION_MAJOR 6
+#define DLM_DEVICE_VERSION_MINOR 0
+#define DLM_DEVICE_VERSION_PATCH 1
+
+/* struct passed to the lock write */
+struct dlm_lock_params {
+ __u8 mode;
+ __u8 namelen;
+ __u16 unused;
+ __u32 flags;
+ __u32 lkid;
+ __u32 parent;
+ __u64 xid;
+ __u64 timeout;
+ void *castparam;
+ void *castaddr;
+ void *bastparam;
+ void *bastaddr;
+ struct dlm_lksb *lksb;
+ char lvb[DLM_USER_LVB_LEN];
+ char name[0];
+};
+
+struct dlm_lspace_params {
+ __u32 flags;
+ __u32 minor;
+ char name[0];
+};
+
+struct dlm_purge_params {
+ __u32 nodeid;
+ __u32 pid;
+};
+
+struct dlm_write_request {
+ __u32 version[3];
+ __u8 cmd;
+ __u8 is64bit;
+ __u8 unused[2];
+
+ union {
+ struct dlm_lock_params lock;
+ struct dlm_lspace_params lspace;
+ struct dlm_purge_params purge;
+ } i;
+};
+
+struct dlm_device_version {
+ __u32 version[3];
+};
+
+/* struct read from the "device" fd,
+ consists mainly of userspace pointers for the library to use */
+
+struct dlm_lock_result {
+ __u32 version[3];
+ __u32 length;
+ void * user_astaddr;
+ void * user_astparam;
+ struct dlm_lksb * user_lksb;
+ struct dlm_lksb lksb;
+ __u8 bast_mode;
+ __u8 unused[3];
+ /* Offsets may be zero if no data is present */
+ __u32 lvb_offset;
+};
+
+/* Commands passed to the device */
+#define DLM_USER_LOCK 1
+#define DLM_USER_UNLOCK 2
+#define DLM_USER_QUERY 3
+#define DLM_USER_CREATE_LOCKSPACE 4
+#define DLM_USER_REMOVE_LOCKSPACE 5
+#define DLM_USER_PURGE 6
+#define DLM_USER_DEADLOCK 7
+
+/* Lockspace flags */
+#define DLM_USER_LSFLG_AUTOFREE 1
+#define DLM_USER_LSFLG_FORCEFREE 2
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dlm_netlink.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dlm_netlink.h
new file mode 100644
index 0000000..647c8ef
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dlm_netlink.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2007 Red Hat, Inc. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License v.2.
+ */
+
+#ifndef _DLM_NETLINK_H
+#define _DLM_NETLINK_H
+
+#include <linux/types.h>
+
+enum {
+ DLM_STATUS_WAITING = 1,
+ DLM_STATUS_GRANTED = 2,
+ DLM_STATUS_CONVERT = 3,
+};
+
+#define DLM_LOCK_DATA_VERSION 1
+
+struct dlm_lock_data {
+ __u16 version;
+ __u32 lockspace_id;
+ int nodeid;
+ int ownpid;
+ __u32 id;
+ __u32 remid;
+ __u64 xid;
+ __s8 status;
+ __s8 grmode;
+ __s8 rqmode;
+ unsigned long timestamp;
+ int resource_namelen;
+ char resource_name[DLM_RESNAME_MAXLEN];
+};
+
+enum {
+ DLM_CMD_UNSPEC = 0,
+ DLM_CMD_HELLO, /* user->kernel */
+ DLM_CMD_TIMEOUT, /* kernel->user */
+ __DLM_CMD_MAX,
+};
+
+#define DLM_CMD_MAX (__DLM_CMD_MAX - 1)
+
+enum {
+ DLM_TYPE_UNSPEC = 0,
+ DLM_TYPE_LOCK,
+ __DLM_TYPE_MAX,
+};
+
+#define DLM_TYPE_MAX (__DLM_TYPE_MAX - 1)
+
+#define DLM_GENL_VERSION 0x1
+#define DLM_GENL_NAME "DLM"
+
+#endif /* _DLM_NETLINK_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dlm_plock.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dlm_plock.h
new file mode 100644
index 0000000..9ea891a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dlm_plock.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2005-2008 Red Hat, Inc. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License v.2.
+ */
+
+#ifndef __DLM_PLOCK_DOT_H__
+#define __DLM_PLOCK_DOT_H__
+
+#include <linux/types.h>
+
+#define DLM_PLOCK_MISC_NAME "dlm_plock"
+
+#define DLM_PLOCK_VERSION_MAJOR 1
+#define DLM_PLOCK_VERSION_MINOR 1
+#define DLM_PLOCK_VERSION_PATCH 0
+
+enum {
+ DLM_PLOCK_OP_LOCK = 1,
+ DLM_PLOCK_OP_UNLOCK,
+ DLM_PLOCK_OP_GET,
+};
+
+struct dlm_plock_info {
+ __u32 version[3];
+ __u8 optype;
+ __u8 ex;
+ __u8 wait;
+ __u8 pad;
+ __u32 pid;
+ __s32 nodeid;
+ __s32 rv;
+ __u32 fsid;
+ __u64 number;
+ __u64 start;
+ __u64 end;
+ __u64 owner;
+};
+
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dlmconstants.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dlmconstants.h
new file mode 100644
index 0000000..47bf08d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dlmconstants.h
@@ -0,0 +1,163 @@
+/******************************************************************************
+*******************************************************************************
+**
+** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
+** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
+**
+** This copyrighted material is made available to anyone wishing to use,
+** modify, copy, or redistribute it subject to the terms and conditions
+** of the GNU General Public License v.2.
+**
+*******************************************************************************
+******************************************************************************/
+
+#ifndef __DLMCONSTANTS_DOT_H__
+#define __DLMCONSTANTS_DOT_H__
+
+/*
+ * Constants used by DLM interface.
+ */
+
+#define DLM_LOCKSPACE_LEN 64
+#define DLM_RESNAME_MAXLEN 64
+
+
+/*
+ * Lock Modes
+ */
+
+#define DLM_LOCK_IV (-1) /* invalid */
+#define DLM_LOCK_NL 0 /* null */
+#define DLM_LOCK_CR 1 /* concurrent read */
+#define DLM_LOCK_CW 2 /* concurrent write */
+#define DLM_LOCK_PR 3 /* protected read */
+#define DLM_LOCK_PW 4 /* protected write */
+#define DLM_LOCK_EX 5 /* exclusive */
+
+
+/*
+ * Flags to dlm_lock
+ *
+ * DLM_LKF_NOQUEUE
+ *
+ * Do not queue the lock request on the wait queue if it cannot be granted
+ * immediately. If the lock cannot be granted because of this flag, DLM will
+ * either return -EAGAIN from the dlm_lock call or will return 0 from
+ * dlm_lock and -EAGAIN in the lock status block when the AST is executed.
+ *
+ * DLM_LKF_CANCEL
+ *
+ * Used to cancel a pending lock request or conversion. A converting lock is
+ * returned to its previously granted mode.
+ *
+ * DLM_LKF_CONVERT
+ *
+ * Indicates a lock conversion request. For conversions the name and namelen
+ * are ignored and the lock ID in the LKSB is used to identify the lock.
+ *
+ * DLM_LKF_VALBLK
+ *
+ * Requests DLM to return the current contents of the lock value block in the
+ * lock status block. When this flag is set in a lock conversion from PW or EX
+ * modes, DLM assigns the value specified in the lock status block to the lock
+ * value block of the lock resource. The LVB is a DLM_LVB_LEN size array
+ * containing application-specific information.
+ *
+ * DLM_LKF_QUECVT
+ *
+ * Force a conversion request to be queued, even if it is compatible with
+ * the granted modes of other locks on the same resource.
+ *
+ * DLM_LKF_IVVALBLK
+ *
+ * Invalidate the lock value block.
+ *
+ * DLM_LKF_CONVDEADLK
+ *
+ * Allows the dlm to resolve conversion deadlocks internally by demoting the
+ * granted mode of a converting lock to NL. The DLM_SBF_DEMOTED flag is
+ * returned for a conversion that's been effected by this.
+ *
+ * DLM_LKF_PERSISTENT
+ *
+ * Only relevant to locks originating in userspace. A persistent lock will not
+ * be removed if the process holding the lock exits.
+ *
+ * DLM_LKF_NODLCKWT
+ *
+ * Do not cancel the lock if it gets into conversion deadlock.
+ * Exclude this lock from being monitored due to DLM_LSFL_TIMEWARN.
+ *
+ * DLM_LKF_NODLCKBLK
+ *
+ * net yet implemented
+ *
+ * DLM_LKF_EXPEDITE
+ *
+ * Used only with new requests for NL mode locks. Tells the lock manager
+ * to grant the lock, ignoring other locks in convert and wait queues.
+ *
+ * DLM_LKF_NOQUEUEBAST
+ *
+ * Send blocking AST's before returning -EAGAIN to the caller. It is only
+ * used along with the NOQUEUE flag. Blocking AST's are not sent for failed
+ * NOQUEUE requests otherwise.
+ *
+ * DLM_LKF_HEADQUE
+ *
+ * Add a lock to the head of the convert or wait queue rather than the tail.
+ *
+ * DLM_LKF_NOORDER
+ *
+ * Disregard the standard grant order rules and grant a lock as soon as it
+ * is compatible with other granted locks.
+ *
+ * DLM_LKF_ORPHAN
+ *
+ * not yet implemented
+ *
+ * DLM_LKF_ALTPR
+ *
+ * If the requested mode cannot be granted immediately, try to grant the lock
+ * in PR mode instead. If this alternate mode is granted instead of the
+ * requested mode, DLM_SBF_ALTMODE is returned in the lksb.
+ *
+ * DLM_LKF_ALTCW
+ *
+ * The same as ALTPR, but the alternate mode is CW.
+ *
+ * DLM_LKF_FORCEUNLOCK
+ *
+ * Unlock the lock even if it is converting or waiting or has sublocks.
+ * Only really for use by the userland device.c code.
+ *
+ */
+
+#define DLM_LKF_NOQUEUE 0x00000001
+#define DLM_LKF_CANCEL 0x00000002
+#define DLM_LKF_CONVERT 0x00000004
+#define DLM_LKF_VALBLK 0x00000008
+#define DLM_LKF_QUECVT 0x00000010
+#define DLM_LKF_IVVALBLK 0x00000020
+#define DLM_LKF_CONVDEADLK 0x00000040
+#define DLM_LKF_PERSISTENT 0x00000080
+#define DLM_LKF_NODLCKWT 0x00000100
+#define DLM_LKF_NODLCKBLK 0x00000200
+#define DLM_LKF_EXPEDITE 0x00000400
+#define DLM_LKF_NOQUEUEBAST 0x00000800
+#define DLM_LKF_HEADQUE 0x00001000
+#define DLM_LKF_NOORDER 0x00002000
+#define DLM_LKF_ORPHAN 0x00004000
+#define DLM_LKF_ALTPR 0x00008000
+#define DLM_LKF_ALTCW 0x00010000
+#define DLM_LKF_FORCEUNLOCK 0x00020000
+#define DLM_LKF_TIMEOUT 0x00040000
+
+/*
+ * Some return codes that are not in errno.h
+ */
+
+#define DLM_ECANCEL 0x10001
+#define DLM_EUNLOCK 0x10002
+
+#endif /* __DLMCONSTANTS_DOT_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dm-ioctl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dm-ioctl.h
new file mode 100644
index 0000000..48e44ee
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dm-ioctl.h
@@ -0,0 +1,302 @@
+/*
+ * Copyright (C) 2001 - 2003 Sistina Software (UK) Limited.
+ * Copyright (C) 2004 - 2005 Red Hat, Inc. All rights reserved.
+ *
+ * This file is released under the LGPL.
+ */
+
+#ifndef _LINUX_DM_IOCTL_V4_H
+#define _LINUX_DM_IOCTL_V4_H
+
+#include <linux/types.h>
+
+#define DM_DIR "mapper" /* Slashes not supported */
+#define DM_MAX_TYPE_NAME 16
+#define DM_NAME_LEN 128
+#define DM_UUID_LEN 129
+
+/*
+ * A traditional ioctl interface for the device mapper.
+ *
+ * Each device can have two tables associated with it, an
+ * 'active' table which is the one currently used by io passing
+ * through the device, and an 'inactive' one which is a table
+ * that is being prepared as a replacement for the 'active' one.
+ *
+ * DM_VERSION:
+ * Just get the version information for the ioctl interface.
+ *
+ * DM_REMOVE_ALL:
+ * Remove all dm devices, destroy all tables. Only really used
+ * for debug.
+ *
+ * DM_LIST_DEVICES:
+ * Get a list of all the dm device names.
+ *
+ * DM_DEV_CREATE:
+ * Create a new device, neither the 'active' or 'inactive' table
+ * slots will be filled. The device will be in suspended state
+ * after creation, however any io to the device will get errored
+ * since it will be out-of-bounds.
+ *
+ * DM_DEV_REMOVE:
+ * Remove a device, destroy any tables.
+ *
+ * DM_DEV_RENAME:
+ * Rename a device.
+ *
+ * DM_SUSPEND:
+ * This performs both suspend and resume, depending which flag is
+ * passed in.
+ * Suspend: This command will not return until all pending io to
+ * the device has completed. Further io will be deferred until
+ * the device is resumed.
+ * Resume: It is no longer an error to issue this command on an
+ * unsuspended device. If a table is present in the 'inactive'
+ * slot, it will be moved to the active slot, then the old table
+ * from the active slot will be _destroyed_. Finally the device
+ * is resumed.
+ *
+ * DM_DEV_STATUS:
+ * Retrieves the status for the table in the 'active' slot.
+ *
+ * DM_DEV_WAIT:
+ * Wait for a significant event to occur to the device. This
+ * could either be caused by an event triggered by one of the
+ * targets of the table in the 'active' slot, or a table change.
+ *
+ * DM_TABLE_LOAD:
+ * Load a table into the 'inactive' slot for the device. The
+ * device does _not_ need to be suspended prior to this command.
+ *
+ * DM_TABLE_CLEAR:
+ * Destroy any table in the 'inactive' slot (ie. abort).
+ *
+ * DM_TABLE_DEPS:
+ * Return a set of device dependencies for the 'active' table.
+ *
+ * DM_TABLE_STATUS:
+ * Return the targets status for the 'active' table.
+ *
+ * DM_TARGET_MSG:
+ * Pass a message string to the target at a specific offset of a device.
+ *
+ * DM_DEV_SET_GEOMETRY:
+ * Set the geometry of a device by passing in a string in this format:
+ *
+ * "cylinders heads sectors_per_track start_sector"
+ *
+ * Beware that CHS geometry is nearly obsolete and only provided
+ * for compatibility with dm devices that can be booted by a PC
+ * BIOS. See struct hd_geometry for range limits. Also note that
+ * the geometry is erased if the device size changes.
+ */
+
+/*
+ * All ioctl arguments consist of a single chunk of memory, with
+ * this structure at the start. If a uuid is specified any
+ * lookup (eg. for a DM_INFO) will be done on that, *not* the
+ * name.
+ */
+struct dm_ioctl {
+ /*
+ * The version number is made up of three parts:
+ * major - no backward or forward compatibility,
+ * minor - only backwards compatible,
+ * patch - both backwards and forwards compatible.
+ *
+ * All clients of the ioctl interface should fill in the
+ * version number of the interface that they were
+ * compiled with.
+ *
+ * All recognised ioctl commands (ie. those that don't
+ * return -ENOTTY) fill out this field, even if the
+ * command failed.
+ */
+ __u32 version[3]; /* in/out */
+ __u32 data_size; /* total size of data passed in
+ * including this struct */
+
+ __u32 data_start; /* offset to start of data
+ * relative to start of this struct */
+
+ __u32 target_count; /* in/out */
+ __s32 open_count; /* out */
+ __u32 flags; /* in/out */
+ __u32 event_nr; /* in/out */
+ __u32 padding;
+
+ __u64 dev; /* in/out */
+
+ char name[DM_NAME_LEN]; /* device name */
+ char uuid[DM_UUID_LEN]; /* unique identifier for
+ * the block device */
+ char data[7]; /* padding or data */
+};
+
+/*
+ * Used to specify tables. These structures appear after the
+ * dm_ioctl.
+ */
+struct dm_target_spec {
+ __u64 sector_start;
+ __u64 length;
+ __s32 status; /* used when reading from kernel only */
+
+ /*
+ * Location of the next dm_target_spec.
+ * - When specifying targets on a DM_TABLE_LOAD command, this value is
+ * the number of bytes from the start of the "current" dm_target_spec
+ * to the start of the "next" dm_target_spec.
+ * - When retrieving targets on a DM_TABLE_STATUS command, this value
+ * is the number of bytes from the start of the first dm_target_spec
+ * (that follows the dm_ioctl struct) to the start of the "next"
+ * dm_target_spec.
+ */
+ __u32 next;
+
+ char target_type[DM_MAX_TYPE_NAME];
+
+ /*
+ * Parameter string starts immediately after this object.
+ * Be careful to add padding after string to ensure correct
+ * alignment of subsequent dm_target_spec.
+ */
+};
+
+/*
+ * Used to retrieve the target dependencies.
+ */
+struct dm_target_deps {
+ __u32 count; /* Array size */
+ __u32 padding; /* unused */
+ __u64 dev[0]; /* out */
+};
+
+/*
+ * Used to get a list of all dm devices.
+ */
+struct dm_name_list {
+ __u64 dev;
+ __u32 next; /* offset to the next record from
+ the _start_ of this */
+ char name[0];
+};
+
+/*
+ * Used to retrieve the target versions
+ */
+struct dm_target_versions {
+ __u32 next;
+ __u32 version[3];
+
+ char name[0];
+};
+
+/*
+ * Used to pass message to a target
+ */
+struct dm_target_msg {
+ __u64 sector; /* Device sector */
+
+ char message[0];
+};
+
+/*
+ * If you change this make sure you make the corresponding change
+ * to dm-ioctl.c:lookup_ioctl()
+ */
+enum {
+ /* Top level cmds */
+ DM_VERSION_CMD = 0,
+ DM_REMOVE_ALL_CMD,
+ DM_LIST_DEVICES_CMD,
+
+ /* device level cmds */
+ DM_DEV_CREATE_CMD,
+ DM_DEV_REMOVE_CMD,
+ DM_DEV_RENAME_CMD,
+ DM_DEV_SUSPEND_CMD,
+ DM_DEV_STATUS_CMD,
+ DM_DEV_WAIT_CMD,
+
+ /* Table level cmds */
+ DM_TABLE_LOAD_CMD,
+ DM_TABLE_CLEAR_CMD,
+ DM_TABLE_DEPS_CMD,
+ DM_TABLE_STATUS_CMD,
+
+ /* Added later */
+ DM_LIST_VERSIONS_CMD,
+ DM_TARGET_MSG_CMD,
+ DM_DEV_SET_GEOMETRY_CMD
+};
+
+#define DM_IOCTL 0xfd
+
+#define DM_VERSION _IOWR(DM_IOCTL, DM_VERSION_CMD, struct dm_ioctl)
+#define DM_REMOVE_ALL _IOWR(DM_IOCTL, DM_REMOVE_ALL_CMD, struct dm_ioctl)
+#define DM_LIST_DEVICES _IOWR(DM_IOCTL, DM_LIST_DEVICES_CMD, struct dm_ioctl)
+
+#define DM_DEV_CREATE _IOWR(DM_IOCTL, DM_DEV_CREATE_CMD, struct dm_ioctl)
+#define DM_DEV_REMOVE _IOWR(DM_IOCTL, DM_DEV_REMOVE_CMD, struct dm_ioctl)
+#define DM_DEV_RENAME _IOWR(DM_IOCTL, DM_DEV_RENAME_CMD, struct dm_ioctl)
+#define DM_DEV_SUSPEND _IOWR(DM_IOCTL, DM_DEV_SUSPEND_CMD, struct dm_ioctl)
+#define DM_DEV_STATUS _IOWR(DM_IOCTL, DM_DEV_STATUS_CMD, struct dm_ioctl)
+#define DM_DEV_WAIT _IOWR(DM_IOCTL, DM_DEV_WAIT_CMD, struct dm_ioctl)
+
+#define DM_TABLE_LOAD _IOWR(DM_IOCTL, DM_TABLE_LOAD_CMD, struct dm_ioctl)
+#define DM_TABLE_CLEAR _IOWR(DM_IOCTL, DM_TABLE_CLEAR_CMD, struct dm_ioctl)
+#define DM_TABLE_DEPS _IOWR(DM_IOCTL, DM_TABLE_DEPS_CMD, struct dm_ioctl)
+#define DM_TABLE_STATUS _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, struct dm_ioctl)
+
+#define DM_LIST_VERSIONS _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, struct dm_ioctl)
+
+#define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl)
+#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
+
+#define DM_VERSION_MAJOR 4
+#define DM_VERSION_MINOR 14
+#define DM_VERSION_PATCHLEVEL 0
+#define DM_VERSION_EXTRA "-ioctl (2008-04-23)"
+
+/* Status bits */
+#define DM_READONLY_FLAG (1 << 0) /* In/Out */
+#define DM_SUSPEND_FLAG (1 << 1) /* In/Out */
+#define DM_PERSISTENT_DEV_FLAG (1 << 3) /* In */
+
+/*
+ * Flag passed into ioctl STATUS command to get table information
+ * rather than current status.
+ */
+#define DM_STATUS_TABLE_FLAG (1 << 4) /* In */
+
+/*
+ * Flags that indicate whether a table is present in either of
+ * the two table slots that a device has.
+ */
+#define DM_ACTIVE_PRESENT_FLAG (1 << 5) /* Out */
+#define DM_INACTIVE_PRESENT_FLAG (1 << 6) /* Out */
+
+/*
+ * Indicates that the buffer passed in wasn't big enough for the
+ * results.
+ */
+#define DM_BUFFER_FULL_FLAG (1 << 8) /* Out */
+
+/*
+ * This flag is now ignored.
+ */
+#define DM_SKIP_BDGET_FLAG (1 << 9) /* In */
+
+/*
+ * Set this to avoid attempting to freeze any filesystem when suspending.
+ */
+#define DM_SKIP_LOCKFS_FLAG (1 << 10) /* In */
+
+/*
+ * Set this to suspend without flushing queued ios.
+ */
+#define DM_NOFLUSH_FLAG (1 << 11) /* In */
+
+#endif /* _LINUX_DM_IOCTL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dn.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dn.h
new file mode 100644
index 0000000..fe99908
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dn.h
@@ -0,0 +1,149 @@
+#ifndef _LINUX_DN_H
+#define _LINUX_DN_H
+
+#include <linux/types.h>
+
+/*
+
+ DECnet Data Structures and Constants
+
+*/
+
+/*
+ * DNPROTO_NSP can't be the same as SOL_SOCKET,
+ * so increment each by one (compared to ULTRIX)
+ */
+#define DNPROTO_NSP 2 /* NSP protocol number */
+#define DNPROTO_ROU 3 /* Routing protocol number */
+#define DNPROTO_NML 4 /* Net mgt protocol number */
+#define DNPROTO_EVL 5 /* Evl protocol number (usr) */
+#define DNPROTO_EVR 6 /* Evl protocol number (evl) */
+#define DNPROTO_NSPT 7 /* NSP trace protocol number */
+
+
+#define DN_ADDL 2
+#define DN_MAXADDL 2 /* ULTRIX headers have 20 here, but pathworks has 2 */
+#define DN_MAXOPTL 16
+#define DN_MAXOBJL 16
+#define DN_MAXACCL 40
+#define DN_MAXALIASL 128
+#define DN_MAXNODEL 256
+#define DNBUFSIZE 65023
+
+/*
+ * SET/GET Socket options - must match the DSO_ numbers below
+ */
+#define SO_CONDATA 1
+#define SO_CONACCESS 2
+#define SO_PROXYUSR 3
+#define SO_LINKINFO 7
+
+#define DSO_CONDATA 1 /* Set/Get connect data */
+#define DSO_DISDATA 10 /* Set/Get disconnect data */
+#define DSO_CONACCESS 2 /* Set/Get connect access data */
+#define DSO_ACCEPTMODE 4 /* Set/Get accept mode */
+#define DSO_CONACCEPT 5 /* Accept deferred connection */
+#define DSO_CONREJECT 6 /* Reject deferred connection */
+#define DSO_LINKINFO 7 /* Set/Get link information */
+#define DSO_STREAM 8 /* Set socket type to stream */
+#define DSO_SEQPACKET 9 /* Set socket type to sequenced packet */
+#define DSO_MAXWINDOW 11 /* Maximum window size allowed */
+#define DSO_NODELAY 12 /* Turn off nagle */
+#define DSO_CORK 13 /* Wait for more data! */
+#define DSO_SERVICES 14 /* NSP Services field */
+#define DSO_INFO 15 /* NSP Info field */
+#define DSO_MAX 15 /* Maximum option number */
+
+
+/* LINK States */
+#define LL_INACTIVE 0
+#define LL_CONNECTING 1
+#define LL_RUNNING 2
+#define LL_DISCONNECTING 3
+
+#define ACC_IMMED 0
+#define ACC_DEFER 1
+
+#define SDF_WILD 1 /* Wild card object */
+#define SDF_PROXY 2 /* Addr eligible for proxy */
+#define SDF_UICPROXY 4 /* Use uic-based proxy */
+
+/* Structures */
+
+
+struct dn_naddr
+{
+ __le16 a_len;
+ __u8 a_addr[DN_MAXADDL]; /* Two bytes little endian */
+};
+
+struct sockaddr_dn
+{
+ __u16 sdn_family;
+ __u8 sdn_flags;
+ __u8 sdn_objnum;
+ __le16 sdn_objnamel;
+ __u8 sdn_objname[DN_MAXOBJL];
+ struct dn_naddr sdn_add;
+};
+#define sdn_nodeaddrl sdn_add.a_len /* Node address length */
+#define sdn_nodeaddr sdn_add.a_addr /* Node address */
+
+
+
+/*
+ * DECnet set/get DSO_CONDATA, DSO_DISDATA (optional data) structure
+ */
+struct optdata_dn {
+ __le16 opt_status; /* Extended status return */
+#define opt_sts opt_status
+ __le16 opt_optl; /* Length of user data */
+ __u8 opt_data[16]; /* User data */
+};
+
+struct accessdata_dn
+{
+ __u8 acc_accl;
+ __u8 acc_acc[DN_MAXACCL];
+ __u8 acc_passl;
+ __u8 acc_pass[DN_MAXACCL];
+ __u8 acc_userl;
+ __u8 acc_user[DN_MAXACCL];
+};
+
+/*
+ * DECnet logical link information structure
+ */
+struct linkinfo_dn {
+ __u16 idn_segsize; /* Segment size for link */
+ __u8 idn_linkstate; /* Logical link state */
+};
+
+/*
+ * Ethernet address format (for DECnet)
+ */
+union etheraddress {
+ __u8 dne_addr[6]; /* Full ethernet address */
+ struct {
+ __u8 dne_hiord[4]; /* DECnet HIORD prefix */
+ __u8 dne_nodeaddr[2]; /* DECnet node address */
+ } dne_remote;
+};
+
+
+/*
+ * DECnet physical socket address format
+ */
+struct dn_addr {
+ __le16 dna_family; /* AF_DECnet */
+ union etheraddress dna_netaddr; /* DECnet ethernet address */
+};
+
+#define DECNET_IOCTL_BASE 0x89 /* PROTOPRIVATE range */
+
+#define SIOCSNETADDR _IOW(DECNET_IOCTL_BASE, 0xe0, struct dn_naddr)
+#define SIOCGNETADDR _IOR(DECNET_IOCTL_BASE, 0xe1, struct dn_naddr)
+#define OSIOCSNETADDR _IOW(DECNET_IOCTL_BASE, 0xe0, int)
+#define OSIOCGNETADDR _IOR(DECNET_IOCTL_BASE, 0xe1, int)
+
+#endif /* _LINUX_DN_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dqblk_xfs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dqblk_xfs.h
new file mode 100644
index 0000000..527504c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dqblk_xfs.h
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 1995-2001,2004 Silicon Graphics, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesset General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#ifndef _LINUX_DQBLK_XFS_H
+#define _LINUX_DQBLK_XFS_H
+
+#include <linux/types.h>
+
+/*
+ * Disk quota - quotactl(2) commands for the XFS Quota Manager (XQM).
+ */
+
+#define XQM_CMD(x) (('X'<<8)+(x)) /* note: forms first QCMD argument */
+#define XQM_COMMAND(x) (((x) & (0xff<<8)) == ('X'<<8)) /* test if for XFS */
+
+#define XQM_USRQUOTA 0 /* system call user quota type */
+#define XQM_GRPQUOTA 1 /* system call group quota type */
+#define XQM_PRJQUOTA 2 /* system call project quota type */
+#define XQM_MAXQUOTAS 3
+
+#define Q_XQUOTAON XQM_CMD(1) /* enable accounting/enforcement */
+#define Q_XQUOTAOFF XQM_CMD(2) /* disable accounting/enforcement */
+#define Q_XGETQUOTA XQM_CMD(3) /* get disk limits and usage */
+#define Q_XSETQLIM XQM_CMD(4) /* set disk limits */
+#define Q_XGETQSTAT XQM_CMD(5) /* get quota subsystem status */
+#define Q_XQUOTARM XQM_CMD(6) /* free disk space used by dquots */
+#define Q_XQUOTASYNC XQM_CMD(7) /* delalloc flush, updates dquots */
+
+/*
+ * fs_disk_quota structure:
+ *
+ * This contains the current quota information regarding a user/proj/group.
+ * It is 64-bit aligned, and all the blk units are in BBs (Basic Blocks) of
+ * 512 bytes.
+ */
+#define FS_DQUOT_VERSION 1 /* fs_disk_quota.d_version */
+typedef struct fs_disk_quota {
+ __s8 d_version; /* version of this structure */
+ __s8 d_flags; /* XFS_{USER,PROJ,GROUP}_QUOTA */
+ __u16 d_fieldmask; /* field specifier */
+ __u32 d_id; /* user, project, or group ID */
+ __u64 d_blk_hardlimit;/* absolute limit on disk blks */
+ __u64 d_blk_softlimit;/* preferred limit on disk blks */
+ __u64 d_ino_hardlimit;/* maximum # allocated inodes */
+ __u64 d_ino_softlimit;/* preferred inode limit */
+ __u64 d_bcount; /* # disk blocks owned by the user */
+ __u64 d_icount; /* # inodes owned by the user */
+ __s32 d_itimer; /* zero if within inode limits */
+ /* if not, we refuse service */
+ __s32 d_btimer; /* similar to above; for disk blocks */
+ __u16 d_iwarns; /* # warnings issued wrt num inodes */
+ __u16 d_bwarns; /* # warnings issued wrt disk blocks */
+ __s32 d_padding2; /* padding2 - for future use */
+ __u64 d_rtb_hardlimit;/* absolute limit on realtime blks */
+ __u64 d_rtb_softlimit;/* preferred limit on RT disk blks */
+ __u64 d_rtbcount; /* # realtime blocks owned */
+ __s32 d_rtbtimer; /* similar to above; for RT disk blks */
+ __u16 d_rtbwarns; /* # warnings issued wrt RT disk blks */
+ __s16 d_padding3; /* padding3 - for future use */
+ char d_padding4[8]; /* yet more padding */
+} fs_disk_quota_t;
+
+/*
+ * These fields are sent to Q_XSETQLIM to specify fields that need to change.
+ */
+#define FS_DQ_ISOFT (1<<0)
+#define FS_DQ_IHARD (1<<1)
+#define FS_DQ_BSOFT (1<<2)
+#define FS_DQ_BHARD (1<<3)
+#define FS_DQ_RTBSOFT (1<<4)
+#define FS_DQ_RTBHARD (1<<5)
+#define FS_DQ_LIMIT_MASK (FS_DQ_ISOFT | FS_DQ_IHARD | FS_DQ_BSOFT | \
+ FS_DQ_BHARD | FS_DQ_RTBSOFT | FS_DQ_RTBHARD)
+/*
+ * These timers can only be set in super user's dquot. For others, timers are
+ * automatically started and stopped. Superusers timer values set the limits
+ * for the rest. In case these values are zero, the DQ_{F,B}TIMELIMIT values
+ * defined below are used.
+ * These values also apply only to the d_fieldmask field for Q_XSETQLIM.
+ */
+#define FS_DQ_BTIMER (1<<6)
+#define FS_DQ_ITIMER (1<<7)
+#define FS_DQ_RTBTIMER (1<<8)
+#define FS_DQ_TIMER_MASK (FS_DQ_BTIMER | FS_DQ_ITIMER | FS_DQ_RTBTIMER)
+
+/*
+ * Warning counts are set in both super user's dquot and others. For others,
+ * warnings are set/cleared by the administrators (or automatically by going
+ * below the soft limit). Superusers warning values set the warning limits
+ * for the rest. In case these values are zero, the DQ_{F,B}WARNLIMIT values
+ * defined below are used.
+ * These values also apply only to the d_fieldmask field for Q_XSETQLIM.
+ */
+#define FS_DQ_BWARNS (1<<9)
+#define FS_DQ_IWARNS (1<<10)
+#define FS_DQ_RTBWARNS (1<<11)
+#define FS_DQ_WARNS_MASK (FS_DQ_BWARNS | FS_DQ_IWARNS | FS_DQ_RTBWARNS)
+
+/*
+ * Various flags related to quotactl(2). Only relevant to XFS filesystems.
+ */
+#define XFS_QUOTA_UDQ_ACCT (1<<0) /* user quota accounting */
+#define XFS_QUOTA_UDQ_ENFD (1<<1) /* user quota limits enforcement */
+#define XFS_QUOTA_GDQ_ACCT (1<<2) /* group quota accounting */
+#define XFS_QUOTA_GDQ_ENFD (1<<3) /* group quota limits enforcement */
+#define XFS_QUOTA_PDQ_ACCT (1<<4) /* project quota accounting */
+#define XFS_QUOTA_PDQ_ENFD (1<<5) /* project quota limits enforcement */
+
+#define XFS_USER_QUOTA (1<<0) /* user quota type */
+#define XFS_PROJ_QUOTA (1<<1) /* project quota type */
+#define XFS_GROUP_QUOTA (1<<2) /* group quota type */
+
+/*
+ * fs_quota_stat is the struct returned in Q_XGETQSTAT for a given file system.
+ * Provides a centralized way to get meta information about the quota subsystem.
+ * eg. space taken up for user and group quotas, number of dquots currently
+ * incore.
+ */
+#define FS_QSTAT_VERSION 1 /* fs_quota_stat.qs_version */
+
+/*
+ * Some basic information about 'quota files'.
+ */
+typedef struct fs_qfilestat {
+ __u64 qfs_ino; /* inode number */
+ __u64 qfs_nblks; /* number of BBs 512-byte-blks */
+ __u32 qfs_nextents; /* number of extents */
+} fs_qfilestat_t;
+
+typedef struct fs_quota_stat {
+ __s8 qs_version; /* version number for future changes */
+ __u16 qs_flags; /* XFS_QUOTA_{U,P,G}DQ_{ACCT,ENFD} */
+ __s8 qs_pad; /* unused */
+ fs_qfilestat_t qs_uquota; /* user quota storage information */
+ fs_qfilestat_t qs_gquota; /* group quota storage information */
+ __u32 qs_incoredqs; /* number of dquots incore */
+ __s32 qs_btimelimit; /* limit for blks timer */
+ __s32 qs_itimelimit; /* limit for inodes timer */
+ __s32 qs_rtbtimelimit;/* limit for rt blks timer */
+ __u16 qs_bwarnlimit; /* limit for num warnings */
+ __u16 qs_iwarnlimit; /* limit for num warnings */
+} fs_quota_stat_t;
+
+#endif /* _LINUX_DQBLK_XFS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/..install.cmd
new file mode 100644
index 0000000..6a49916
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/dvb/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/dvb /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/dvb mips audio.h ca.h dmx.h frontend.h net.h osd.h version.h video.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/dvb /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/dvb mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/dvb/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/audio.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/audio.h
new file mode 100644
index 0000000..fec66bd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/audio.h
@@ -0,0 +1,135 @@
+/*
+ * audio.h
+ *
+ * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>
+ * & Marcus Metzler <marcus@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Lesser Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBAUDIO_H_
+#define _DVBAUDIO_H_
+
+#include <linux/types.h>
+
+typedef enum {
+ AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */
+ AUDIO_SOURCE_MEMORY /* Select internal memory as the main source */
+} audio_stream_source_t;
+
+
+typedef enum {
+ AUDIO_STOPPED, /* Device is stopped */
+ AUDIO_PLAYING, /* Device is currently playing */
+ AUDIO_PAUSED /* Device is paused */
+} audio_play_state_t;
+
+
+typedef enum {
+ AUDIO_STEREO,
+ AUDIO_MONO_LEFT,
+ AUDIO_MONO_RIGHT,
+ AUDIO_MONO,
+ AUDIO_STEREO_SWAPPED
+} audio_channel_select_t;
+
+
+typedef struct audio_mixer {
+ unsigned int volume_left;
+ unsigned int volume_right;
+ // what else do we need? bass, pass-through, ...
+} audio_mixer_t;
+
+
+typedef struct audio_status {
+ int AV_sync_state; /* sync audio and video? */
+ int mute_state; /* audio is muted */
+ audio_play_state_t play_state; /* current playback state */
+ audio_stream_source_t stream_source; /* current stream source */
+ audio_channel_select_t channel_select; /* currently selected channel */
+ int bypass_mode; /* pass on audio data to */
+ audio_mixer_t mixer_state; /* current mixer state */
+} audio_status_t; /* separate decoder hardware */
+
+
+typedef
+struct audio_karaoke{ /* if Vocal1 or Vocal2 are non-zero, they get mixed */
+ int vocal1; /* into left and right t at 70% each */
+ int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/
+ int melody; /* mixed into the left channel and */
+ /* Vocal2 into the right channel at 100% each. */
+ /* if Melody is non-zero, the melody channel gets mixed*/
+} audio_karaoke_t; /* into left and right */
+
+
+typedef __u16 audio_attributes_t;
+/* bits: descr. */
+/* 15-13 audio coding mode (0=ac3, 2=mpeg1, 3=mpeg2ext, 4=LPCM, 6=DTS, */
+/* 12 multichannel extension */
+/* 11-10 audio type (0=not spec, 1=language included) */
+/* 9- 8 audio application mode (0=not spec, 1=karaoke, 2=surround) */
+/* 7- 6 Quantization / DRC (mpeg audio: 1=DRC exists)(lpcm: 0=16bit, */
+/* 5- 4 Sample frequency fs (0=48kHz, 1=96kHz) */
+/* 2- 0 number of audio channels (n+1 channels) */
+
+
+/* for GET_CAPABILITIES and SET_FORMAT, the latter should only set one bit */
+#define AUDIO_CAP_DTS 1
+#define AUDIO_CAP_LPCM 2
+#define AUDIO_CAP_MP1 4
+#define AUDIO_CAP_MP2 8
+#define AUDIO_CAP_MP3 16
+#define AUDIO_CAP_AAC 32
+#define AUDIO_CAP_OGG 64
+#define AUDIO_CAP_SDDS 128
+#define AUDIO_CAP_AC3 256
+
+#define AUDIO_STOP _IO('o', 1)
+#define AUDIO_PLAY _IO('o', 2)
+#define AUDIO_PAUSE _IO('o', 3)
+#define AUDIO_CONTINUE _IO('o', 4)
+#define AUDIO_SELECT_SOURCE _IO('o', 5)
+#define AUDIO_SET_MUTE _IO('o', 6)
+#define AUDIO_SET_AV_SYNC _IO('o', 7)
+#define AUDIO_SET_BYPASS_MODE _IO('o', 8)
+#define AUDIO_CHANNEL_SELECT _IO('o', 9)
+#define AUDIO_GET_STATUS _IOR('o', 10, audio_status_t)
+
+#define AUDIO_GET_CAPABILITIES _IOR('o', 11, unsigned int)
+#define AUDIO_CLEAR_BUFFER _IO('o', 12)
+#define AUDIO_SET_ID _IO('o', 13)
+#define AUDIO_SET_MIXER _IOW('o', 14, audio_mixer_t)
+#define AUDIO_SET_STREAMTYPE _IO('o', 15)
+#define AUDIO_SET_EXT_ID _IO('o', 16)
+#define AUDIO_SET_ATTRIBUTES _IOW('o', 17, audio_attributes_t)
+#define AUDIO_SET_KARAOKE _IOW('o', 18, audio_karaoke_t)
+
+/**
+ * AUDIO_GET_PTS
+ *
+ * Read the 33 bit presentation time stamp as defined
+ * in ITU T-REC-H.222.0 / ISO/IEC 13818-1.
+ *
+ * The PTS should belong to the currently played
+ * frame if possible, but may also be a value close to it
+ * like the PTS of the last decoded frame or the last PTS
+ * extracted by the PES parser.
+ */
+#define AUDIO_GET_PTS _IOR('o', 19, __u64)
+#define AUDIO_BILINGUAL_CHANNEL_SELECT _IO('o', 20)
+
+#endif /* _DVBAUDIO_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/ca.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/ca.h
new file mode 100644
index 0000000..c18537f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/ca.h
@@ -0,0 +1,90 @@
+/*
+ * ca.h
+ *
+ * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>
+ * & Marcus Metzler <marcus@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Lesser Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBCA_H_
+#define _DVBCA_H_
+
+/* slot interface types and info */
+
+typedef struct ca_slot_info {
+ int num; /* slot number */
+
+ int type; /* CA interface this slot supports */
+#define CA_CI 1 /* CI high level interface */
+#define CA_CI_LINK 2 /* CI link layer level interface */
+#define CA_CI_PHYS 4 /* CI physical layer level interface */
+#define CA_DESCR 8 /* built-in descrambler */
+#define CA_SC 128 /* simple smart card interface */
+
+ unsigned int flags;
+#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */
+#define CA_CI_MODULE_READY 2
+} ca_slot_info_t;
+
+
+/* descrambler types and info */
+
+typedef struct ca_descr_info {
+ unsigned int num; /* number of available descramblers (keys) */
+ unsigned int type; /* type of supported scrambling system */
+#define CA_ECD 1
+#define CA_NDS 2
+#define CA_DSS 4
+} ca_descr_info_t;
+
+typedef struct ca_caps {
+ unsigned int slot_num; /* total number of CA card and module slots */
+ unsigned int slot_type; /* OR of all supported types */
+ unsigned int descr_num; /* total number of descrambler slots (keys) */
+ unsigned int descr_type; /* OR of all supported types */
+} ca_caps_t;
+
+/* a message to/from a CI-CAM */
+typedef struct ca_msg {
+ unsigned int index;
+ unsigned int type;
+ unsigned int length;
+ unsigned char msg[256];
+} ca_msg_t;
+
+typedef struct ca_descr {
+ unsigned int index;
+ unsigned int parity; /* 0 == even, 1 == odd */
+ unsigned char cw[8];
+} ca_descr_t;
+
+typedef struct ca_pid {
+ unsigned int pid;
+ int index; /* -1 == disable*/
+} ca_pid_t;
+
+#define CA_RESET _IO('o', 128)
+#define CA_GET_CAP _IOR('o', 129, ca_caps_t)
+#define CA_GET_SLOT_INFO _IOR('o', 130, ca_slot_info_t)
+#define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t)
+#define CA_GET_MSG _IOR('o', 132, ca_msg_t)
+#define CA_SEND_MSG _IOW('o', 133, ca_msg_t)
+#define CA_SET_DESCR _IOW('o', 134, ca_descr_t)
+#define CA_SET_PID _IOW('o', 135, ca_pid_t)
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/dmx.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/dmx.h
new file mode 100644
index 0000000..a0e0d3f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/dmx.h
@@ -0,0 +1,151 @@
+/*
+ * dmx.h
+ *
+ * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
+ * & Ralph Metzler <ralph@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBDMX_H_
+#define _DVBDMX_H_
+
+#include <linux/types.h>
+#include <time.h>
+
+
+#define DMX_FILTER_SIZE 16
+
+typedef enum
+{
+ DMX_OUT_DECODER, /* Streaming directly to decoder. */
+ DMX_OUT_TAP, /* Output going to a memory buffer */
+ /* (to be retrieved via the read command).*/
+ DMX_OUT_TS_TAP, /* Output multiplexed into a new TS */
+ /* (to be retrieved by reading from the */
+ /* logical DVR device). */
+ DMX_OUT_TSDEMUX_TAP /* Like TS_TAP but retrieved from the DMX device */
+} dmx_output_t;
+
+
+typedef enum
+{
+ DMX_IN_FRONTEND, /* Input from a front-end device. */
+ DMX_IN_DVR /* Input from the logical DVR device. */
+} dmx_input_t;
+
+
+typedef enum
+{
+ DMX_PES_AUDIO0,
+ DMX_PES_VIDEO0,
+ DMX_PES_TELETEXT0,
+ DMX_PES_SUBTITLE0,
+ DMX_PES_PCR0,
+
+ DMX_PES_AUDIO1,
+ DMX_PES_VIDEO1,
+ DMX_PES_TELETEXT1,
+ DMX_PES_SUBTITLE1,
+ DMX_PES_PCR1,
+
+ DMX_PES_AUDIO2,
+ DMX_PES_VIDEO2,
+ DMX_PES_TELETEXT2,
+ DMX_PES_SUBTITLE2,
+ DMX_PES_PCR2,
+
+ DMX_PES_AUDIO3,
+ DMX_PES_VIDEO3,
+ DMX_PES_TELETEXT3,
+ DMX_PES_SUBTITLE3,
+ DMX_PES_PCR3,
+
+ DMX_PES_OTHER
+} dmx_pes_type_t;
+
+#define DMX_PES_AUDIO DMX_PES_AUDIO0
+#define DMX_PES_VIDEO DMX_PES_VIDEO0
+#define DMX_PES_TELETEXT DMX_PES_TELETEXT0
+#define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0
+#define DMX_PES_PCR DMX_PES_PCR0
+
+
+typedef struct dmx_filter
+{
+ __u8 filter[DMX_FILTER_SIZE];
+ __u8 mask[DMX_FILTER_SIZE];
+ __u8 mode[DMX_FILTER_SIZE];
+} dmx_filter_t;
+
+
+struct dmx_sct_filter_params
+{
+ __u16 pid;
+ dmx_filter_t filter;
+ __u32 timeout;
+ __u32 flags;
+#define DMX_CHECK_CRC 1
+#define DMX_ONESHOT 2
+#define DMX_IMMEDIATE_START 4
+#define DMX_KERNEL_CLIENT 0x8000
+};
+
+
+struct dmx_pes_filter_params
+{
+ __u16 pid;
+ dmx_input_t input;
+ dmx_output_t output;
+ dmx_pes_type_t pes_type;
+ __u32 flags;
+};
+
+typedef struct dmx_caps {
+ __u32 caps;
+ int num_decoders;
+} dmx_caps_t;
+
+typedef enum {
+ DMX_SOURCE_FRONT0 = 0,
+ DMX_SOURCE_FRONT1,
+ DMX_SOURCE_FRONT2,
+ DMX_SOURCE_FRONT3,
+ DMX_SOURCE_DVR0 = 16,
+ DMX_SOURCE_DVR1,
+ DMX_SOURCE_DVR2,
+ DMX_SOURCE_DVR3
+} dmx_source_t;
+
+struct dmx_stc {
+ unsigned int num; /* input : which STC? 0..N */
+ unsigned int base; /* output: divisor for stc to get 90 kHz clock */
+ __u64 stc; /* output: stc in 'base'*90 kHz units */
+};
+
+
+#define DMX_START _IO('o', 41)
+#define DMX_STOP _IO('o', 42)
+#define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params)
+#define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params)
+#define DMX_SET_BUFFER_SIZE _IO('o', 45)
+#define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5])
+#define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t)
+#define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t)
+#define DMX_GET_STC _IOWR('o', 50, struct dmx_stc)
+
+#endif /*_DVBDMX_H_*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/frontend.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/frontend.h
new file mode 100644
index 0000000..51c8d2d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/frontend.h
@@ -0,0 +1,385 @@
+/*
+ * frontend.h
+ *
+ * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
+ * Ralph Metzler <ralph@convergence.de>
+ * Holger Waechtler <holger@convergence.de>
+ * Andre Draszik <ad@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBFRONTEND_H_
+#define _DVBFRONTEND_H_
+
+#include <linux/types.h>
+
+typedef enum fe_type {
+ FE_QPSK,
+ FE_QAM,
+ FE_OFDM,
+ FE_ATSC
+} fe_type_t;
+
+
+typedef enum fe_caps {
+ FE_IS_STUPID = 0,
+ FE_CAN_INVERSION_AUTO = 0x1,
+ FE_CAN_FEC_1_2 = 0x2,
+ FE_CAN_FEC_2_3 = 0x4,
+ FE_CAN_FEC_3_4 = 0x8,
+ FE_CAN_FEC_4_5 = 0x10,
+ FE_CAN_FEC_5_6 = 0x20,
+ FE_CAN_FEC_6_7 = 0x40,
+ FE_CAN_FEC_7_8 = 0x80,
+ FE_CAN_FEC_8_9 = 0x100,
+ FE_CAN_FEC_AUTO = 0x200,
+ FE_CAN_QPSK = 0x400,
+ FE_CAN_QAM_16 = 0x800,
+ FE_CAN_QAM_32 = 0x1000,
+ FE_CAN_QAM_64 = 0x2000,
+ FE_CAN_QAM_128 = 0x4000,
+ FE_CAN_QAM_256 = 0x8000,
+ FE_CAN_QAM_AUTO = 0x10000,
+ FE_CAN_TRANSMISSION_MODE_AUTO = 0x20000,
+ FE_CAN_BANDWIDTH_AUTO = 0x40000,
+ FE_CAN_GUARD_INTERVAL_AUTO = 0x80000,
+ FE_CAN_HIERARCHY_AUTO = 0x100000,
+ FE_CAN_8VSB = 0x200000,
+ FE_CAN_16VSB = 0x400000,
+ FE_HAS_EXTENDED_CAPS = 0x800000, /* We need more bitspace for newer APIs, indicate this. */
+ FE_CAN_2G_MODULATION = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */
+ FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */
+ FE_CAN_RECOVER = 0x40000000, /* frontend can recover from a cable unplug automatically */
+ FE_CAN_MUTE_TS = 0x80000000 /* frontend can stop spurious TS data output */
+} fe_caps_t;
+
+
+struct dvb_frontend_info {
+ char name[128];
+ fe_type_t type;
+ __u32 frequency_min;
+ __u32 frequency_max;
+ __u32 frequency_stepsize;
+ __u32 frequency_tolerance;
+ __u32 symbol_rate_min;
+ __u32 symbol_rate_max;
+ __u32 symbol_rate_tolerance; /* ppm */
+ __u32 notifier_delay; /* DEPRECATED */
+ fe_caps_t caps;
+};
+
+
+/**
+ * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for
+ * the meaning of this struct...
+ */
+struct dvb_diseqc_master_cmd {
+ __u8 msg [6]; /* { framing, address, command, data [3] } */
+ __u8 msg_len; /* valid values are 3...6 */
+};
+
+
+struct dvb_diseqc_slave_reply {
+ __u8 msg [4]; /* { framing, data [3] } */
+ __u8 msg_len; /* valid values are 0...4, 0 means no msg */
+ int timeout; /* return from ioctl after timeout ms with */
+}; /* errorcode when no message was received */
+
+
+typedef enum fe_sec_voltage {
+ SEC_VOLTAGE_13,
+ SEC_VOLTAGE_18,
+ SEC_VOLTAGE_OFF
+} fe_sec_voltage_t;
+
+
+typedef enum fe_sec_tone_mode {
+ SEC_TONE_ON,
+ SEC_TONE_OFF
+} fe_sec_tone_mode_t;
+
+
+typedef enum fe_sec_mini_cmd {
+ SEC_MINI_A,
+ SEC_MINI_B
+} fe_sec_mini_cmd_t;
+
+
+typedef enum fe_status {
+ FE_HAS_SIGNAL = 0x01, /* found something above the noise level */
+ FE_HAS_CARRIER = 0x02, /* found a DVB signal */
+ FE_HAS_VITERBI = 0x04, /* FEC is stable */
+ FE_HAS_SYNC = 0x08, /* found sync bytes */
+ FE_HAS_LOCK = 0x10, /* everything's working... */
+ FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */
+ FE_REINIT = 0x40 /* frontend was reinitialized, */
+} fe_status_t; /* application is recommended to reset */
+ /* DiSEqC, tone and parameters */
+
+typedef enum fe_spectral_inversion {
+ INVERSION_OFF,
+ INVERSION_ON,
+ INVERSION_AUTO
+} fe_spectral_inversion_t;
+
+
+typedef enum fe_code_rate {
+ FEC_NONE = 0,
+ FEC_1_2,
+ FEC_2_3,
+ FEC_3_4,
+ FEC_4_5,
+ FEC_5_6,
+ FEC_6_7,
+ FEC_7_8,
+ FEC_8_9,
+ FEC_AUTO,
+ FEC_3_5,
+ FEC_9_10,
+} fe_code_rate_t;
+
+
+typedef enum fe_modulation {
+ QPSK,
+ QAM_16,
+ QAM_32,
+ QAM_64,
+ QAM_128,
+ QAM_256,
+ QAM_AUTO,
+ VSB_8,
+ VSB_16,
+ PSK_8,
+ APSK_16,
+ APSK_32,
+ DQPSK,
+} fe_modulation_t;
+
+typedef enum fe_transmit_mode {
+ TRANSMISSION_MODE_2K,
+ TRANSMISSION_MODE_8K,
+ TRANSMISSION_MODE_AUTO
+} fe_transmit_mode_t;
+
+typedef enum fe_bandwidth {
+ BANDWIDTH_8_MHZ,
+ BANDWIDTH_7_MHZ,
+ BANDWIDTH_6_MHZ,
+ BANDWIDTH_AUTO
+} fe_bandwidth_t;
+
+
+typedef enum fe_guard_interval {
+ GUARD_INTERVAL_1_32,
+ GUARD_INTERVAL_1_16,
+ GUARD_INTERVAL_1_8,
+ GUARD_INTERVAL_1_4,
+ GUARD_INTERVAL_AUTO
+} fe_guard_interval_t;
+
+
+typedef enum fe_hierarchy {
+ HIERARCHY_NONE,
+ HIERARCHY_1,
+ HIERARCHY_2,
+ HIERARCHY_4,
+ HIERARCHY_AUTO
+} fe_hierarchy_t;
+
+
+struct dvb_qpsk_parameters {
+ __u32 symbol_rate; /* symbol rate in Symbols per second */
+ fe_code_rate_t fec_inner; /* forward error correction (see above) */
+};
+
+struct dvb_qam_parameters {
+ __u32 symbol_rate; /* symbol rate in Symbols per second */
+ fe_code_rate_t fec_inner; /* forward error correction (see above) */
+ fe_modulation_t modulation; /* modulation type (see above) */
+};
+
+struct dvb_vsb_parameters {
+ fe_modulation_t modulation; /* modulation type (see above) */
+};
+
+struct dvb_ofdm_parameters {
+ fe_bandwidth_t bandwidth;
+ fe_code_rate_t code_rate_HP; /* high priority stream code rate */
+ fe_code_rate_t code_rate_LP; /* low priority stream code rate */
+ fe_modulation_t constellation; /* modulation type (see above) */
+ fe_transmit_mode_t transmission_mode;
+ fe_guard_interval_t guard_interval;
+ fe_hierarchy_t hierarchy_information;
+};
+
+
+struct dvb_frontend_parameters {
+ __u32 frequency; /* (absolute) frequency in Hz for QAM/OFDM/ATSC */
+ /* intermediate frequency in kHz for QPSK */
+ fe_spectral_inversion_t inversion;
+ union {
+ struct dvb_qpsk_parameters qpsk;
+ struct dvb_qam_parameters qam;
+ struct dvb_ofdm_parameters ofdm;
+ struct dvb_vsb_parameters vsb;
+ } u;
+};
+
+
+struct dvb_frontend_event {
+ fe_status_t status;
+ struct dvb_frontend_parameters parameters;
+};
+
+/* S2API Commands */
+#define DTV_UNDEFINED 0
+#define DTV_TUNE 1
+#define DTV_CLEAR 2
+#define DTV_FREQUENCY 3
+#define DTV_MODULATION 4
+#define DTV_BANDWIDTH_HZ 5
+#define DTV_INVERSION 6
+#define DTV_DISEQC_MASTER 7
+#define DTV_SYMBOL_RATE 8
+#define DTV_INNER_FEC 9
+#define DTV_VOLTAGE 10
+#define DTV_TONE 11
+#define DTV_PILOT 12
+#define DTV_ROLLOFF 13
+#define DTV_DISEQC_SLAVE_REPLY 14
+
+/* Basic enumeration set for querying unlimited capabilities */
+#define DTV_FE_CAPABILITY_COUNT 15
+#define DTV_FE_CAPABILITY 16
+#define DTV_DELIVERY_SYSTEM 17
+
+#define DTV_API_VERSION 35
+#define DTV_API_VERSION 35
+#define DTV_CODE_RATE_HP 36
+#define DTV_CODE_RATE_LP 37
+#define DTV_GUARD_INTERVAL 38
+#define DTV_TRANSMISSION_MODE 39
+#define DTV_HIERARCHY 40
+
+#define DTV_MAX_COMMAND DTV_HIERARCHY
+
+typedef enum fe_pilot {
+ PILOT_ON,
+ PILOT_OFF,
+ PILOT_AUTO,
+} fe_pilot_t;
+
+typedef enum fe_rolloff {
+ ROLLOFF_35, /* Implied value in DVB-S, default for DVB-S2 */
+ ROLLOFF_20,
+ ROLLOFF_25,
+ ROLLOFF_AUTO,
+} fe_rolloff_t;
+
+typedef enum fe_delivery_system {
+ SYS_UNDEFINED,
+ SYS_DVBC_ANNEX_AC,
+ SYS_DVBC_ANNEX_B,
+ SYS_DVBT,
+ SYS_DSS,
+ SYS_DVBS,
+ SYS_DVBS2,
+ SYS_DVBH,
+ SYS_ISDBT,
+ SYS_ISDBS,
+ SYS_ISDBC,
+ SYS_ATSC,
+ SYS_ATSCMH,
+ SYS_DMBTH,
+ SYS_CMMB,
+ SYS_DAB,
+} fe_delivery_system_t;
+
+struct dtv_cmds_h {
+ char *name; /* A display name for debugging purposes */
+
+ __u32 cmd; /* A unique ID */
+
+ /* Flags */
+ __u32 set:1; /* Either a set or get property */
+ __u32 buffer:1; /* Does this property use the buffer? */
+ __u32 reserved:30; /* Align */
+};
+
+struct dtv_property {
+ __u32 cmd;
+ __u32 reserved[3];
+ union {
+ __u32 data;
+ struct {
+ __u8 data[32];
+ __u32 len;
+ __u32 reserved1[3];
+ void *reserved2;
+ } buffer;
+ } u;
+ int result;
+} __attribute__ ((packed));
+
+/* num of properties cannot exceed DTV_IOCTL_MAX_MSGS per ioctl */
+#define DTV_IOCTL_MAX_MSGS 64
+
+struct dtv_properties {
+ __u32 num;
+ struct dtv_property *props;
+};
+
+#define FE_SET_PROPERTY _IOW('o', 82, struct dtv_properties)
+#define FE_GET_PROPERTY _IOR('o', 83, struct dtv_properties)
+
+
+/**
+ * When set, this flag will disable any zigzagging or other "normal" tuning
+ * behaviour. Additionally, there will be no automatic monitoring of the lock
+ * status, and hence no frontend events will be generated. If a frontend device
+ * is closed, this flag will be automatically turned off when the device is
+ * reopened read-write.
+ */
+#define FE_TUNE_MODE_ONESHOT 0x01
+
+
+#define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info)
+
+#define FE_DISEQC_RESET_OVERLOAD _IO('o', 62)
+#define FE_DISEQC_SEND_MASTER_CMD _IOW('o', 63, struct dvb_diseqc_master_cmd)
+#define FE_DISEQC_RECV_SLAVE_REPLY _IOR('o', 64, struct dvb_diseqc_slave_reply)
+#define FE_DISEQC_SEND_BURST _IO('o', 65) /* fe_sec_mini_cmd_t */
+
+#define FE_SET_TONE _IO('o', 66) /* fe_sec_tone_mode_t */
+#define FE_SET_VOLTAGE _IO('o', 67) /* fe_sec_voltage_t */
+#define FE_ENABLE_HIGH_LNB_VOLTAGE _IO('o', 68) /* int */
+
+#define FE_READ_STATUS _IOR('o', 69, fe_status_t)
+#define FE_READ_BER _IOR('o', 70, __u32)
+#define FE_READ_SIGNAL_STRENGTH _IOR('o', 71, __u16)
+#define FE_READ_SNR _IOR('o', 72, __u16)
+#define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, __u32)
+
+#define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters)
+#define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters)
+#define FE_SET_FRONTEND_TUNE_MODE _IO('o', 81) /* unsigned int */
+#define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event)
+
+#define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */
+
+#endif /*_DVBFRONTEND_H_*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/net.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/net.h
new file mode 100644
index 0000000..f451e7e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/net.h
@@ -0,0 +1,52 @@
+/*
+ * net.h
+ *
+ * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
+ * & Ralph Metzler <ralph@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBNET_H_
+#define _DVBNET_H_
+
+#include <linux/types.h>
+
+struct dvb_net_if {
+ __u16 pid;
+ __u16 if_num;
+ __u8 feedtype;
+#define DVB_NET_FEEDTYPE_MPE 0 /* multi protocol encapsulation */
+#define DVB_NET_FEEDTYPE_ULE 1 /* ultra lightweight encapsulation */
+};
+
+
+#define NET_ADD_IF _IOWR('o', 52, struct dvb_net_if)
+#define NET_REMOVE_IF _IO('o', 53)
+#define NET_GET_IF _IOWR('o', 54, struct dvb_net_if)
+
+
+/* binary compatibility cruft: */
+struct __dvb_net_if_old {
+ __u16 pid;
+ __u16 if_num;
+};
+#define __NET_ADD_IF_OLD _IOWR('o', 52, struct __dvb_net_if_old)
+#define __NET_GET_IF_OLD _IOWR('o', 54, struct __dvb_net_if_old)
+
+
+#endif /*_DVBNET_H_*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/osd.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/osd.h
new file mode 100644
index 0000000..f28c7cb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/osd.h
@@ -0,0 +1,144 @@
+/*
+ * osd.h
+ *
+ * Copyright (C) 2001 Ralph Metzler <ralph@convergence.de>
+ * & Marcus Metzler <marcus@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Lesser Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBOSD_H_
+#define _DVBOSD_H_
+
+
+
+typedef enum {
+ // All functions return -2 on "not open"
+ OSD_Close=1, // ()
+ // Disables OSD and releases the buffers
+ // returns 0 on success
+ OSD_Open, // (x0,y0,x1,y1,BitPerPixel[2/4/8](color&0x0F),mix[0..15](color&0xF0))
+ // Opens OSD with this size and bit depth
+ // returns 0 on success, -1 on DRAM allocation error, -2 on "already open"
+ OSD_Show, // ()
+ // enables OSD mode
+ // returns 0 on success
+ OSD_Hide, // ()
+ // disables OSD mode
+ // returns 0 on success
+ OSD_Clear, // ()
+ // Sets all pixel to color 0
+ // returns 0 on success
+ OSD_Fill, // (color)
+ // Sets all pixel to color <col>
+ // returns 0 on success
+ OSD_SetColor, // (color,R{x0},G{y0},B{x1},opacity{y1})
+ // set palette entry <num> to <r,g,b>, <mix> and <trans> apply
+ // R,G,B: 0..255
+ // R=Red, G=Green, B=Blue
+ // opacity=0: pixel opacity 0% (only video pixel shows)
+ // opacity=1..254: pixel opacity as specified in header
+ // opacity=255: pixel opacity 100% (only OSD pixel shows)
+ // returns 0 on success, -1 on error
+ OSD_SetPalette, // (firstcolor{color},lastcolor{x0},data)
+ // Set a number of entries in the palette
+ // sets the entries "firstcolor" through "lastcolor" from the array "data"
+ // data has 4 byte for each color:
+ // R,G,B, and a opacity value: 0->transparent, 1..254->mix, 255->pixel
+ OSD_SetTrans, // (transparency{color})
+ // Sets transparency of mixed pixel (0..15)
+ // returns 0 on success
+ OSD_SetPixel, // (x0,y0,color)
+ // sets pixel <x>,<y> to color number <col>
+ // returns 0 on success, -1 on error
+ OSD_GetPixel, // (x0,y0)
+ // returns color number of pixel <x>,<y>, or -1
+ OSD_SetRow, // (x0,y0,x1,data)
+ // fills pixels x0,y through x1,y with the content of data[]
+ // returns 0 on success, -1 on clipping all pixel (no pixel drawn)
+ OSD_SetBlock, // (x0,y0,x1,y1,increment{color},data)
+ // fills pixels x0,y0 through x1,y1 with the content of data[]
+ // inc contains the width of one line in the data block,
+ // inc<=0 uses blockwidth as linewidth
+ // returns 0 on success, -1 on clipping all pixel
+ OSD_FillRow, // (x0,y0,x1,color)
+ // fills pixels x0,y through x1,y with the color <col>
+ // returns 0 on success, -1 on clipping all pixel
+ OSD_FillBlock, // (x0,y0,x1,y1,color)
+ // fills pixels x0,y0 through x1,y1 with the color <col>
+ // returns 0 on success, -1 on clipping all pixel
+ OSD_Line, // (x0,y0,x1,y1,color)
+ // draw a line from x0,y0 to x1,y1 with the color <col>
+ // returns 0 on success
+ OSD_Query, // (x0,y0,x1,y1,xasp{color}}), yasp=11
+ // fills parameters with the picture dimensions and the pixel aspect ratio
+ // returns 0 on success
+ OSD_Test, // ()
+ // draws a test picture. for debugging purposes only
+ // returns 0 on success
+// TODO: remove "test" in final version
+ OSD_Text, // (x0,y0,size,color,text)
+ OSD_SetWindow, // (x0) set window with number 0<x0<8 as current
+ OSD_MoveWindow, // move current window to (x0, y0)
+ OSD_OpenRaw, // Open other types of OSD windows
+} OSD_Command;
+
+typedef struct osd_cmd_s {
+ OSD_Command cmd;
+ int x0;
+ int y0;
+ int x1;
+ int y1;
+ int color;
+ void *data;
+} osd_cmd_t;
+
+/* OSD_OpenRaw: set 'color' to desired window type */
+typedef enum {
+ OSD_BITMAP1, /* 1 bit bitmap */
+ OSD_BITMAP2, /* 2 bit bitmap */
+ OSD_BITMAP4, /* 4 bit bitmap */
+ OSD_BITMAP8, /* 8 bit bitmap */
+ OSD_BITMAP1HR, /* 1 Bit bitmap half resolution */
+ OSD_BITMAP2HR, /* 2 bit bitmap half resolution */
+ OSD_BITMAP4HR, /* 4 bit bitmap half resolution */
+ OSD_BITMAP8HR, /* 8 bit bitmap half resolution */
+ OSD_YCRCB422, /* 4:2:2 YCRCB Graphic Display */
+ OSD_YCRCB444, /* 4:4:4 YCRCB Graphic Display */
+ OSD_YCRCB444HR, /* 4:4:4 YCRCB graphic half resolution */
+ OSD_VIDEOTSIZE, /* True Size Normal MPEG Video Display */
+ OSD_VIDEOHSIZE, /* MPEG Video Display Half Resolution */
+ OSD_VIDEOQSIZE, /* MPEG Video Display Quarter Resolution */
+ OSD_VIDEODSIZE, /* MPEG Video Display Double Resolution */
+ OSD_VIDEOTHSIZE, /* True Size MPEG Video Display Half Resolution */
+ OSD_VIDEOTQSIZE, /* True Size MPEG Video Display Quarter Resolution*/
+ OSD_VIDEOTDSIZE, /* True Size MPEG Video Display Double Resolution */
+ OSD_VIDEONSIZE, /* Full Size MPEG Video Display */
+ OSD_CURSOR /* Cursor */
+} osd_raw_window_t;
+
+typedef struct osd_cap_s {
+ int cmd;
+#define OSD_CAP_MEMSIZE 1 /* memory size */
+ long val;
+} osd_cap_t;
+
+
+#define OSD_SEND_CMD _IOW('o', 160, osd_cmd_t)
+#define OSD_GET_CAPABILITY _IOR('o', 161, osd_cap_t)
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/version.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/version.h
new file mode 100644
index 0000000..25b823b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/version.h
@@ -0,0 +1,29 @@
+/*
+ * version.h
+ *
+ * Copyright (C) 2000 Holger Waechtler <holger@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBVERSION_H_
+#define _DVBVERSION_H_
+
+#define DVB_API_VERSION 5
+#define DVB_API_VERSION_MINOR 0
+
+#endif /*_DVBVERSION_H_*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/video.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/video.h
new file mode 100644
index 0000000..fec79a7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/dvb/video.h
@@ -0,0 +1,272 @@
+/*
+ * video.h
+ *
+ * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
+ * & Ralph Metzler <ralph@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBVIDEO_H_
+#define _DVBVIDEO_H_
+
+#include <linux/types.h>
+#include <stdint.h>
+#include <time.h>
+
+typedef enum {
+ VIDEO_FORMAT_4_3, /* Select 4:3 format */
+ VIDEO_FORMAT_16_9, /* Select 16:9 format. */
+ VIDEO_FORMAT_221_1 /* 2.21:1 */
+} video_format_t;
+
+
+typedef enum {
+ VIDEO_SYSTEM_PAL,
+ VIDEO_SYSTEM_NTSC,
+ VIDEO_SYSTEM_PALN,
+ VIDEO_SYSTEM_PALNc,
+ VIDEO_SYSTEM_PALM,
+ VIDEO_SYSTEM_NTSC60,
+ VIDEO_SYSTEM_PAL60,
+ VIDEO_SYSTEM_PALM60
+} video_system_t;
+
+
+typedef enum {
+ VIDEO_PAN_SCAN, /* use pan and scan format */
+ VIDEO_LETTER_BOX, /* use letterbox format */
+ VIDEO_CENTER_CUT_OUT /* use center cut out format */
+} video_displayformat_t;
+
+typedef struct {
+ int w;
+ int h;
+ video_format_t aspect_ratio;
+} video_size_t;
+
+typedef enum {
+ VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */
+ VIDEO_SOURCE_MEMORY /* If this source is selected, the stream
+ comes from the user through the write
+ system call */
+} video_stream_source_t;
+
+
+typedef enum {
+ VIDEO_STOPPED, /* Video is stopped */
+ VIDEO_PLAYING, /* Video is currently playing */
+ VIDEO_FREEZED /* Video is freezed */
+} video_play_state_t;
+
+
+/* Decoder commands */
+#define VIDEO_CMD_PLAY (0)
+#define VIDEO_CMD_STOP (1)
+#define VIDEO_CMD_FREEZE (2)
+#define VIDEO_CMD_CONTINUE (3)
+
+/* Flags for VIDEO_CMD_FREEZE */
+#define VIDEO_CMD_FREEZE_TO_BLACK (1 << 0)
+
+/* Flags for VIDEO_CMD_STOP */
+#define VIDEO_CMD_STOP_TO_BLACK (1 << 0)
+#define VIDEO_CMD_STOP_IMMEDIATELY (1 << 1)
+
+/* Play input formats: */
+/* The decoder has no special format requirements */
+#define VIDEO_PLAY_FMT_NONE (0)
+/* The decoder requires full GOPs */
+#define VIDEO_PLAY_FMT_GOP (1)
+
+/* The structure must be zeroed before use by the application
+ This ensures it can be extended safely in the future. */
+struct video_command {
+ __u32 cmd;
+ __u32 flags;
+ union {
+ struct {
+ __u64 pts;
+ } stop;
+
+ struct {
+ /* 0 or 1000 specifies normal speed,
+ 1 specifies forward single stepping,
+ -1 specifies backward single stepping,
+ >1: playback at speed/1000 of the normal speed,
+ <-1: reverse playback at (-speed/1000) of the normal speed. */
+ __s32 speed;
+ __u32 format;
+ } play;
+
+ struct {
+ __u32 data[16];
+ } raw;
+ };
+};
+
+/* FIELD_UNKNOWN can be used if the hardware does not know whether
+ the Vsync is for an odd, even or progressive (i.e. non-interlaced)
+ field. */
+#define VIDEO_VSYNC_FIELD_UNKNOWN (0)
+#define VIDEO_VSYNC_FIELD_ODD (1)
+#define VIDEO_VSYNC_FIELD_EVEN (2)
+#define VIDEO_VSYNC_FIELD_PROGRESSIVE (3)
+
+struct video_event {
+ __s32 type;
+#define VIDEO_EVENT_SIZE_CHANGED 1
+#define VIDEO_EVENT_FRAME_RATE_CHANGED 2
+#define VIDEO_EVENT_DECODER_STOPPED 3
+#define VIDEO_EVENT_VSYNC 4
+ __kernel_time_t timestamp;
+ union {
+ video_size_t size;
+ unsigned int frame_rate; /* in frames per 1000sec */
+ unsigned char vsync_field; /* unknown/odd/even/progressive */
+ } u;
+};
+
+
+struct video_status {
+ int video_blank; /* blank video on freeze? */
+ video_play_state_t play_state; /* current state of playback */
+ video_stream_source_t stream_source; /* current source (demux/memory) */
+ video_format_t video_format; /* current aspect ratio of stream*/
+ video_displayformat_t display_format;/* selected cropping mode */
+};
+
+
+struct video_still_picture {
+ char *iFrame; /* pointer to a single iframe in memory */
+ __s32 size;
+};
+
+
+typedef
+struct video_highlight {
+ int active; /* 1=show highlight, 0=hide highlight */
+ __u8 contrast1; /* 7- 4 Pattern pixel contrast */
+ /* 3- 0 Background pixel contrast */
+ __u8 contrast2; /* 7- 4 Emphasis pixel-2 contrast */
+ /* 3- 0 Emphasis pixel-1 contrast */
+ __u8 color1; /* 7- 4 Pattern pixel color */
+ /* 3- 0 Background pixel color */
+ __u8 color2; /* 7- 4 Emphasis pixel-2 color */
+ /* 3- 0 Emphasis pixel-1 color */
+ __u32 ypos; /* 23-22 auto action mode */
+ /* 21-12 start y */
+ /* 9- 0 end y */
+ __u32 xpos; /* 23-22 button color number */
+ /* 21-12 start x */
+ /* 9- 0 end x */
+} video_highlight_t;
+
+
+typedef struct video_spu {
+ int active;
+ int stream_id;
+} video_spu_t;
+
+
+typedef struct video_spu_palette { /* SPU Palette information */
+ int length;
+ __u8 *palette;
+} video_spu_palette_t;
+
+
+typedef struct video_navi_pack {
+ int length; /* 0 ... 1024 */
+ __u8 data[1024];
+} video_navi_pack_t;
+
+
+typedef __u16 video_attributes_t;
+/* bits: descr. */
+/* 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) */
+/* 13-12 TV system (0=525/60, 1=625/50) */
+/* 11-10 Aspect ratio (0=4:3, 3=16:9) */
+/* 9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca */
+/* 7 line 21-1 data present in GOP (1=yes, 0=no) */
+/* 6 line 21-2 data present in GOP (1=yes, 0=no) */
+/* 5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 */
+/* 2 source letterboxed (1=yes, 0=no) */
+/* 0 film/camera mode (0=camera, 1=film (625/50 only)) */
+
+
+/* bit definitions for capabilities: */
+/* can the hardware decode MPEG1 and/or MPEG2? */
+#define VIDEO_CAP_MPEG1 1
+#define VIDEO_CAP_MPEG2 2
+/* can you send a system and/or program stream to video device?
+ (you still have to open the video and the audio device but only
+ send the stream to the video device) */
+#define VIDEO_CAP_SYS 4
+#define VIDEO_CAP_PROG 8
+/* can the driver also handle SPU, NAVI and CSS encoded data?
+ (CSS API is not present yet) */
+#define VIDEO_CAP_SPU 16
+#define VIDEO_CAP_NAVI 32
+#define VIDEO_CAP_CSS 64
+
+
+#define VIDEO_STOP _IO('o', 21)
+#define VIDEO_PLAY _IO('o', 22)
+#define VIDEO_FREEZE _IO('o', 23)
+#define VIDEO_CONTINUE _IO('o', 24)
+#define VIDEO_SELECT_SOURCE _IO('o', 25)
+#define VIDEO_SET_BLANK _IO('o', 26)
+#define VIDEO_GET_STATUS _IOR('o', 27, struct video_status)
+#define VIDEO_GET_EVENT _IOR('o', 28, struct video_event)
+#define VIDEO_SET_DISPLAY_FORMAT _IO('o', 29)
+#define VIDEO_STILLPICTURE _IOW('o', 30, struct video_still_picture)
+#define VIDEO_FAST_FORWARD _IO('o', 31)
+#define VIDEO_SLOWMOTION _IO('o', 32)
+#define VIDEO_GET_CAPABILITIES _IOR('o', 33, unsigned int)
+#define VIDEO_CLEAR_BUFFER _IO('o', 34)
+#define VIDEO_SET_ID _IO('o', 35)
+#define VIDEO_SET_STREAMTYPE _IO('o', 36)
+#define VIDEO_SET_FORMAT _IO('o', 37)
+#define VIDEO_SET_SYSTEM _IO('o', 38)
+#define VIDEO_SET_HIGHLIGHT _IOW('o', 39, video_highlight_t)
+#define VIDEO_SET_SPU _IOW('o', 50, video_spu_t)
+#define VIDEO_SET_SPU_PALETTE _IOW('o', 51, video_spu_palette_t)
+#define VIDEO_GET_NAVI _IOR('o', 52, video_navi_pack_t)
+#define VIDEO_SET_ATTRIBUTES _IO('o', 53)
+#define VIDEO_GET_SIZE _IOR('o', 55, video_size_t)
+#define VIDEO_GET_FRAME_RATE _IOR('o', 56, unsigned int)
+
+/**
+ * VIDEO_GET_PTS
+ *
+ * Read the 33 bit presentation time stamp as defined
+ * in ITU T-REC-H.222.0 / ISO/IEC 13818-1.
+ *
+ * The PTS should belong to the currently played
+ * frame if possible, but may also be a value close to it
+ * like the PTS of the last decoded frame or the last PTS
+ * extracted by the PES parser.
+ */
+#define VIDEO_GET_PTS _IOR('o', 57, __u64)
+
+/* Read the number of displayed frames since the decoder was started */
+#define VIDEO_GET_FRAME_COUNT _IOR('o', 58, __u64)
+
+#define VIDEO_COMMAND _IOWR('o', 59, struct video_command)
+#define VIDEO_TRY_COMMAND _IOWR('o', 60, struct video_command)
+
+#endif /*_DVBVIDEO_H_*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/edd.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/edd.h
new file mode 100644
index 0000000..31c2b12
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/edd.h
@@ -0,0 +1,191 @@
+/*
+ * linux/include/linux/edd.h
+ * Copyright (C) 2002, 2003, 2004 Dell Inc.
+ * by Matt Domsch <Matt_Domsch@dell.com>
+ *
+ * structures and definitions for the int 13h, ax={41,48}h
+ * BIOS Enhanced Disk Drive Services
+ * This is based on the T13 group document D1572 Revision 0 (August 14 2002)
+ * available at http://www.t13.org/docs2002/d1572r0.pdf. It is
+ * very similar to D1484 Revision 3 http://www.t13.org/docs2002/d1484r3.pdf
+ *
+ * In a nutshell, arch/{i386,x86_64}/boot/setup.S populates a scratch
+ * table in the boot_params that contains a list of BIOS-enumerated
+ * boot devices.
+ * In arch/{i386,x86_64}/kernel/setup.c, this information is
+ * transferred into the edd structure, and in drivers/firmware/edd.c, that
+ * information is used to identify BIOS boot disk. The code in setup.S
+ * is very sensitive to the size of these structures.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License v2.0 as published by
+ * the Free Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+#ifndef _LINUX_EDD_H
+#define _LINUX_EDD_H
+
+#include <linux/types.h>
+
+#define EDDNR 0x1e9 /* addr of number of edd_info structs at EDDBUF
+ in boot_params - treat this as 1 byte */
+#define EDDBUF 0xd00 /* addr of edd_info structs in boot_params */
+#define EDDMAXNR 6 /* number of edd_info structs starting at EDDBUF */
+#define EDDEXTSIZE 8 /* change these if you muck with the structures */
+#define EDDPARMSIZE 74
+#define CHECKEXTENSIONSPRESENT 0x41
+#define GETDEVICEPARAMETERS 0x48
+#define LEGACYGETDEVICEPARAMETERS 0x08
+#define EDDMAGIC1 0x55AA
+#define EDDMAGIC2 0xAA55
+
+
+#define READ_SECTORS 0x02 /* int13 AH=0x02 is READ_SECTORS command */
+#define EDD_MBR_SIG_OFFSET 0x1B8 /* offset of signature in the MBR */
+#define EDD_MBR_SIG_BUF 0x290 /* addr in boot params */
+#define EDD_MBR_SIG_MAX 16 /* max number of signatures to store */
+#define EDD_MBR_SIG_NR_BUF 0x1ea /* addr of number of MBR signtaures at EDD_MBR_SIG_BUF
+ in boot_params - treat this as 1 byte */
+
+#ifndef __ASSEMBLY__
+
+#define EDD_EXT_FIXED_DISK_ACCESS (1 << 0)
+#define EDD_EXT_DEVICE_LOCKING_AND_EJECTING (1 << 1)
+#define EDD_EXT_ENHANCED_DISK_DRIVE_SUPPORT (1 << 2)
+#define EDD_EXT_64BIT_EXTENSIONS (1 << 3)
+
+#define EDD_INFO_DMA_BOUNDARY_ERROR_TRANSPARENT (1 << 0)
+#define EDD_INFO_GEOMETRY_VALID (1 << 1)
+#define EDD_INFO_REMOVABLE (1 << 2)
+#define EDD_INFO_WRITE_VERIFY (1 << 3)
+#define EDD_INFO_MEDIA_CHANGE_NOTIFICATION (1 << 4)
+#define EDD_INFO_LOCKABLE (1 << 5)
+#define EDD_INFO_NO_MEDIA_PRESENT (1 << 6)
+#define EDD_INFO_USE_INT13_FN50 (1 << 7)
+
+struct edd_device_params {
+ __u16 length;
+ __u16 info_flags;
+ __u32 num_default_cylinders;
+ __u32 num_default_heads;
+ __u32 sectors_per_track;
+ __u64 number_of_sectors;
+ __u16 bytes_per_sector;
+ __u32 dpte_ptr; /* 0xFFFFFFFF for our purposes */
+ __u16 key; /* = 0xBEDD */
+ __u8 device_path_info_length; /* = 44 */
+ __u8 reserved2;
+ __u16 reserved3;
+ __u8 host_bus_type[4];
+ __u8 interface_type[8];
+ union {
+ struct {
+ __u16 base_address;
+ __u16 reserved1;
+ __u32 reserved2;
+ } __attribute__ ((packed)) isa;
+ struct {
+ __u8 bus;
+ __u8 slot;
+ __u8 function;
+ __u8 channel;
+ __u32 reserved;
+ } __attribute__ ((packed)) pci;
+ /* pcix is same as pci */
+ struct {
+ __u64 reserved;
+ } __attribute__ ((packed)) ibnd;
+ struct {
+ __u64 reserved;
+ } __attribute__ ((packed)) xprs;
+ struct {
+ __u64 reserved;
+ } __attribute__ ((packed)) htpt;
+ struct {
+ __u64 reserved;
+ } __attribute__ ((packed)) unknown;
+ } interface_path;
+ union {
+ struct {
+ __u8 device;
+ __u8 reserved1;
+ __u16 reserved2;
+ __u32 reserved3;
+ __u64 reserved4;
+ } __attribute__ ((packed)) ata;
+ struct {
+ __u8 device;
+ __u8 lun;
+ __u8 reserved1;
+ __u8 reserved2;
+ __u32 reserved3;
+ __u64 reserved4;
+ } __attribute__ ((packed)) atapi;
+ struct {
+ __u16 id;
+ __u64 lun;
+ __u16 reserved1;
+ __u32 reserved2;
+ } __attribute__ ((packed)) scsi;
+ struct {
+ __u64 serial_number;
+ __u64 reserved;
+ } __attribute__ ((packed)) usb;
+ struct {
+ __u64 eui;
+ __u64 reserved;
+ } __attribute__ ((packed)) i1394;
+ struct {
+ __u64 wwid;
+ __u64 lun;
+ } __attribute__ ((packed)) fibre;
+ struct {
+ __u64 identity_tag;
+ __u64 reserved;
+ } __attribute__ ((packed)) i2o;
+ struct {
+ __u32 array_number;
+ __u32 reserved1;
+ __u64 reserved2;
+ } __attribute__ ((packed)) raid;
+ struct {
+ __u8 device;
+ __u8 reserved1;
+ __u16 reserved2;
+ __u32 reserved3;
+ __u64 reserved4;
+ } __attribute__ ((packed)) sata;
+ struct {
+ __u64 reserved1;
+ __u64 reserved2;
+ } __attribute__ ((packed)) unknown;
+ } device_path;
+ __u8 reserved4;
+ __u8 checksum;
+} __attribute__ ((packed));
+
+struct edd_info {
+ __u8 device;
+ __u8 version;
+ __u16 interface_support;
+ __u16 legacy_max_cylinder;
+ __u8 legacy_max_head;
+ __u8 legacy_sectors_per_track;
+ struct edd_device_params params;
+} __attribute__ ((packed));
+
+struct edd {
+ unsigned int mbr_signature[EDD_MBR_SIG_MAX];
+ struct edd_info edd_info[EDDMAXNR];
+ unsigned char mbr_signature_nr;
+ unsigned char edd_info_nr;
+};
+
+#endif /*!__ASSEMBLY__ */
+
+#endif /* _LINUX_EDD_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/efs_fs_sb.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/efs_fs_sb.h
new file mode 100644
index 0000000..a01be90
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/efs_fs_sb.h
@@ -0,0 +1,62 @@
+/*
+ * efs_fs_sb.h
+ *
+ * Copyright (c) 1999 Al Smith
+ *
+ * Portions derived from IRIX header files (c) 1988 Silicon Graphics
+ */
+
+#ifndef __EFS_FS_SB_H__
+#define __EFS_FS_SB_H__
+
+#include <linux/types.h>
+#include <linux/magic.h>
+
+/* EFS superblock magic numbers */
+#define EFS_MAGIC 0x072959
+#define EFS_NEWMAGIC 0x07295a
+
+#define IS_EFS_MAGIC(x) ((x == EFS_MAGIC) || (x == EFS_NEWMAGIC))
+
+#define EFS_SUPER 1
+#define EFS_ROOTINODE 2
+
+/* efs superblock on disk */
+struct efs_super {
+ __be32 fs_size; /* size of filesystem, in sectors */
+ __be32 fs_firstcg; /* bb offset to first cg */
+ __be32 fs_cgfsize; /* size of cylinder group in bb's */
+ __be16 fs_cgisize; /* bb's of inodes per cylinder group */
+ __be16 fs_sectors; /* sectors per track */
+ __be16 fs_heads; /* heads per cylinder */
+ __be16 fs_ncg; /* # of cylinder groups in filesystem */
+ __be16 fs_dirty; /* fs needs to be fsck'd */
+ __be32 fs_time; /* last super-block update */
+ __be32 fs_magic; /* magic number */
+ char fs_fname[6]; /* file system name */
+ char fs_fpack[6]; /* file system pack name */
+ __be32 fs_bmsize; /* size of bitmap in bytes */
+ __be32 fs_tfree; /* total free data blocks */
+ __be32 fs_tinode; /* total free inodes */
+ __be32 fs_bmblock; /* bitmap location. */
+ __be32 fs_replsb; /* Location of replicated superblock. */
+ __be32 fs_lastialloc; /* last allocated inode */
+ char fs_spare[20]; /* space for expansion - MUST BE ZERO */
+ __be32 fs_checksum; /* checksum of volume portion of fs */
+};
+
+/* efs superblock information in memory */
+struct efs_sb_info {
+ __u32 fs_magic; /* superblock magic number */
+ __u32 fs_start; /* first block of filesystem */
+ __u32 first_block; /* first data block in filesystem */
+ __u32 total_blocks; /* total number of blocks in filesystem */
+ __u32 group_size; /* # of blocks a group consists of */
+ __u32 data_free; /* # of free data blocks */
+ __u32 inode_free; /* # of free inodes */
+ __u16 inode_blocks; /* # of blocks used for inodes in every grp */
+ __u16 total_groups; /* # of groups */
+};
+
+#endif /* __EFS_FS_SB_H__ */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/elf-em.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/elf-em.h
new file mode 100644
index 0000000..18bea78
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/elf-em.h
@@ -0,0 +1,55 @@
+#ifndef _LINUX_ELF_EM_H
+#define _LINUX_ELF_EM_H
+
+/* These constants define the various ELF target machines */
+#define EM_NONE 0
+#define EM_M32 1
+#define EM_SPARC 2
+#define EM_386 3
+#define EM_68K 4
+#define EM_88K 5
+#define EM_486 6 /* Perhaps disused */
+#define EM_860 7
+#define EM_MIPS 8 /* MIPS R3000 (officially, big-endian only) */
+ /* Next two are historical and binaries and
+ modules of these types will be rejected by
+ Linux. */
+#define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */
+#define EM_MIPS_RS4_BE 10 /* MIPS R4000 big-endian */
+
+#define EM_PARISC 15 /* HPPA */
+#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */
+#define EM_PPC 20 /* PowerPC */
+#define EM_PPC64 21 /* PowerPC64 */
+#define EM_SPU 23 /* Cell BE SPU */
+#define EM_SH 42 /* SuperH */
+#define EM_SPARCV9 43 /* SPARC v9 64-bit */
+#define EM_IA_64 50 /* HP/Intel IA-64 */
+#define EM_X86_64 62 /* AMD x86-64 */
+#define EM_S390 22 /* IBM S/390 */
+#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */
+#define EM_V850 87 /* NEC v850 */
+#define EM_M32R 88 /* Renesas M32R */
+#define EM_H8_300 46 /* Renesas H8/300,300H,H8S */
+#define EM_MN10300 89 /* Panasonic/MEI MN10300, AM33 */
+#define EM_BLACKFIN 106 /* ADI Blackfin Processor */
+#define EM_FRV 0x5441 /* Fujitsu FR-V */
+#define EM_AVR32 0x18ad /* Atmel AVR32 */
+
+/*
+ * This is an interim value that we will use until the committee comes
+ * up with a final number.
+ */
+#define EM_ALPHA 0x9026
+
+/* Bogus old v850 magic number, used by old tools. */
+#define EM_CYGNUS_V850 0x9080
+/* Bogus old m32r magic number, used by old tools. */
+#define EM_CYGNUS_M32R 0x9041
+/* This is the old interim value for S/390 architecture */
+#define EM_S390_OLD 0xA390
+/* Also Panasonic/MEI MN10300, AM33 */
+#define EM_CYGNUS_MN10300 0xbeef
+
+
+#endif /* _LINUX_ELF_EM_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/elf-fdpic.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/elf-fdpic.h
new file mode 100644
index 0000000..f52f635
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/elf-fdpic.h
@@ -0,0 +1,62 @@
+/* elf-fdpic.h: FDPIC ELF load map
+ *
+ * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_ELF_FDPIC_H
+#define _LINUX_ELF_FDPIC_H
+
+#include <linux/elf.h>
+
+#define PT_GNU_STACK (PT_LOOS + 0x474e551)
+
+/* segment mappings for ELF FDPIC libraries/executables/interpreters */
+struct elf32_fdpic_loadseg {
+ Elf32_Addr addr; /* core address to which mapped */
+ Elf32_Addr p_vaddr; /* VMA recorded in file */
+ Elf32_Word p_memsz; /* allocation size recorded in file */
+};
+
+struct elf32_fdpic_loadmap {
+ Elf32_Half version; /* version of these structures, just in case... */
+ Elf32_Half nsegs; /* number of segments */
+ struct elf32_fdpic_loadseg segs[];
+};
+
+#define ELF32_FDPIC_LOADMAP_VERSION 0x0000
+
+/*
+ * binfmt binary parameters structure
+ */
+struct elf_fdpic_params {
+ struct elfhdr hdr; /* ref copy of ELF header */
+ struct elf_phdr *phdrs; /* ref copy of PT_PHDR table */
+ struct elf32_fdpic_loadmap *loadmap; /* loadmap to be passed to userspace */
+ unsigned long elfhdr_addr; /* mapped ELF header user address */
+ unsigned long ph_addr; /* mapped PT_PHDR user address */
+ unsigned long map_addr; /* mapped loadmap user address */
+ unsigned long entry_addr; /* mapped entry user address */
+ unsigned long stack_size; /* stack size requested (PT_GNU_STACK) */
+ unsigned long dynamic_addr; /* mapped PT_DYNAMIC user address */
+ unsigned long load_addr; /* user address at which to map binary */
+ unsigned long flags;
+#define ELF_FDPIC_FLAG_ARRANGEMENT 0x0000000f /* PT_LOAD arrangement flags */
+#define ELF_FDPIC_FLAG_INDEPENDENT 0x00000000 /* PT_LOADs can be put anywhere */
+#define ELF_FDPIC_FLAG_HONOURVADDR 0x00000001 /* PT_LOAD.vaddr must be honoured */
+#define ELF_FDPIC_FLAG_CONSTDISP 0x00000002 /* PT_LOADs require constant
+ * displacement */
+#define ELF_FDPIC_FLAG_CONTIGUOUS 0x00000003 /* PT_LOADs should be contiguous */
+#define ELF_FDPIC_FLAG_EXEC_STACK 0x00000010 /* T if stack to be executable */
+#define ELF_FDPIC_FLAG_NOEXEC_STACK 0x00000020 /* T if stack not to be executable */
+#define ELF_FDPIC_FLAG_EXECUTABLE 0x00000040 /* T if this object is the executable */
+#define ELF_FDPIC_FLAG_PRESENT 0x80000000 /* T if this object is present */
+};
+
+
+#endif /* _LINUX_ELF_FDPIC_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/elf.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/elf.h
new file mode 100644
index 0000000..ac06599
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/elf.h
@@ -0,0 +1,377 @@
+#ifndef _LINUX_ELF_H
+#define _LINUX_ELF_H
+
+#include <linux/types.h>
+#include <linux/elf-em.h>
+
+struct file;
+
+#ifndef elf_read_implies_exec
+ /* Executables for which elf_read_implies_exec() returns TRUE will
+ have the READ_IMPLIES_EXEC personality flag set automatically.
+ Override in asm/elf.h as needed. */
+# define elf_read_implies_exec(ex, have_pt_gnu_stack) 0
+#endif
+
+/* 32-bit ELF base types. */
+typedef __u32 Elf32_Addr;
+typedef __u16 Elf32_Half;
+typedef __u32 Elf32_Off;
+typedef __s32 Elf32_Sword;
+typedef __u32 Elf32_Word;
+
+/* 64-bit ELF base types. */
+typedef __u64 Elf64_Addr;
+typedef __u16 Elf64_Half;
+typedef __s16 Elf64_SHalf;
+typedef __u64 Elf64_Off;
+typedef __s32 Elf64_Sword;
+typedef __u32 Elf64_Word;
+typedef __u64 Elf64_Xword;
+typedef __s64 Elf64_Sxword;
+
+/* These constants are for the segment types stored in the image headers */
+#define PT_NULL 0
+#define PT_LOAD 1
+#define PT_DYNAMIC 2
+#define PT_INTERP 3
+#define PT_NOTE 4
+#define PT_SHLIB 5
+#define PT_PHDR 6
+#define PT_TLS 7 /* Thread local storage segment */
+#define PT_LOOS 0x60000000 /* OS-specific */
+#define PT_HIOS 0x6fffffff /* OS-specific */
+#define PT_LOPROC 0x70000000
+#define PT_HIPROC 0x7fffffff
+#define PT_GNU_EH_FRAME 0x6474e550
+
+#define PT_GNU_STACK (PT_LOOS + 0x474e551)
+
+/* These constants define the different elf file types */
+#define ET_NONE 0
+#define ET_REL 1
+#define ET_EXEC 2
+#define ET_DYN 3
+#define ET_CORE 4
+#define ET_LOPROC 0xff00
+#define ET_HIPROC 0xffff
+
+/* This is the info that is needed to parse the dynamic section of the file */
+#define DT_NULL 0
+#define DT_NEEDED 1
+#define DT_PLTRELSZ 2
+#define DT_PLTGOT 3
+#define DT_HASH 4
+#define DT_STRTAB 5
+#define DT_SYMTAB 6
+#define DT_RELA 7
+#define DT_RELASZ 8
+#define DT_RELAENT 9
+#define DT_STRSZ 10
+#define DT_SYMENT 11
+#define DT_INIT 12
+#define DT_FINI 13
+#define DT_SONAME 14
+#define DT_RPATH 15
+#define DT_SYMBOLIC 16
+#define DT_REL 17
+#define DT_RELSZ 18
+#define DT_RELENT 19
+#define DT_PLTREL 20
+#define DT_DEBUG 21
+#define DT_TEXTREL 22
+#define DT_JMPREL 23
+#define DT_ENCODING 32
+#define OLD_DT_LOOS 0x60000000
+#define DT_LOOS 0x6000000d
+#define DT_HIOS 0x6ffff000
+#define DT_VALRNGLO 0x6ffffd00
+#define DT_VALRNGHI 0x6ffffdff
+#define DT_ADDRRNGLO 0x6ffffe00
+#define DT_ADDRRNGHI 0x6ffffeff
+#define DT_VERSYM 0x6ffffff0
+#define DT_RELACOUNT 0x6ffffff9
+#define DT_RELCOUNT 0x6ffffffa
+#define DT_FLAGS_1 0x6ffffffb
+#define DT_VERDEF 0x6ffffffc
+#define DT_VERDEFNUM 0x6ffffffd
+#define DT_VERNEED 0x6ffffffe
+#define DT_VERNEEDNUM 0x6fffffff
+#define OLD_DT_HIOS 0x6fffffff
+#define DT_LOPROC 0x70000000
+#define DT_HIPROC 0x7fffffff
+
+/* This info is needed when parsing the symbol table */
+#define STB_LOCAL 0
+#define STB_GLOBAL 1
+#define STB_WEAK 2
+
+#define STT_NOTYPE 0
+#define STT_OBJECT 1
+#define STT_FUNC 2
+#define STT_SECTION 3
+#define STT_FILE 4
+#define STT_COMMON 5
+#define STT_TLS 6
+
+#define ELF_ST_BIND(x) ((x) >> 4)
+#define ELF_ST_TYPE(x) (((unsigned int) x) & 0xf)
+#define ELF32_ST_BIND(x) ELF_ST_BIND(x)
+#define ELF32_ST_TYPE(x) ELF_ST_TYPE(x)
+#define ELF64_ST_BIND(x) ELF_ST_BIND(x)
+#define ELF64_ST_TYPE(x) ELF_ST_TYPE(x)
+
+typedef struct dynamic{
+ Elf32_Sword d_tag;
+ union{
+ Elf32_Sword d_val;
+ Elf32_Addr d_ptr;
+ } d_un;
+} Elf32_Dyn;
+
+typedef struct {
+ Elf64_Sxword d_tag; /* entry tag value */
+ union {
+ Elf64_Xword d_val;
+ Elf64_Addr d_ptr;
+ } d_un;
+} Elf64_Dyn;
+
+/* The following are used with relocations */
+#define ELF32_R_SYM(x) ((x) >> 8)
+#define ELF32_R_TYPE(x) ((x) & 0xff)
+
+#define ELF64_R_SYM(i) ((i) >> 32)
+#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
+
+typedef struct elf32_rel {
+ Elf32_Addr r_offset;
+ Elf32_Word r_info;
+} Elf32_Rel;
+
+typedef struct elf64_rel {
+ Elf64_Addr r_offset; /* Location at which to apply the action */
+ Elf64_Xword r_info; /* index and type of relocation */
+} Elf64_Rel;
+
+typedef struct elf32_rela{
+ Elf32_Addr r_offset;
+ Elf32_Word r_info;
+ Elf32_Sword r_addend;
+} Elf32_Rela;
+
+typedef struct elf64_rela {
+ Elf64_Addr r_offset; /* Location at which to apply the action */
+ Elf64_Xword r_info; /* index and type of relocation */
+ Elf64_Sxword r_addend; /* Constant addend used to compute value */
+} Elf64_Rela;
+
+typedef struct elf32_sym{
+ Elf32_Word st_name;
+ Elf32_Addr st_value;
+ Elf32_Word st_size;
+ unsigned char st_info;
+ unsigned char st_other;
+ Elf32_Half st_shndx;
+} Elf32_Sym;
+
+typedef struct elf64_sym {
+ Elf64_Word st_name; /* Symbol name, index in string tbl */
+ unsigned char st_info; /* Type and binding attributes */
+ unsigned char st_other; /* No defined meaning, 0 */
+ Elf64_Half st_shndx; /* Associated section index */
+ Elf64_Addr st_value; /* Value of the symbol */
+ Elf64_Xword st_size; /* Associated symbol size */
+} Elf64_Sym;
+
+
+#define EI_NIDENT 16
+
+typedef struct elf32_hdr{
+ unsigned char e_ident[EI_NIDENT];
+ Elf32_Half e_type;
+ Elf32_Half e_machine;
+ Elf32_Word e_version;
+ Elf32_Addr e_entry; /* Entry point */
+ Elf32_Off e_phoff;
+ Elf32_Off e_shoff;
+ Elf32_Word e_flags;
+ Elf32_Half e_ehsize;
+ Elf32_Half e_phentsize;
+ Elf32_Half e_phnum;
+ Elf32_Half e_shentsize;
+ Elf32_Half e_shnum;
+ Elf32_Half e_shstrndx;
+} Elf32_Ehdr;
+
+typedef struct elf64_hdr {
+ unsigned char e_ident[EI_NIDENT]; /* ELF "magic number" */
+ Elf64_Half e_type;
+ Elf64_Half e_machine;
+ Elf64_Word e_version;
+ Elf64_Addr e_entry; /* Entry point virtual address */
+ Elf64_Off e_phoff; /* Program header table file offset */
+ Elf64_Off e_shoff; /* Section header table file offset */
+ Elf64_Word e_flags;
+ Elf64_Half e_ehsize;
+ Elf64_Half e_phentsize;
+ Elf64_Half e_phnum;
+ Elf64_Half e_shentsize;
+ Elf64_Half e_shnum;
+ Elf64_Half e_shstrndx;
+} Elf64_Ehdr;
+
+/* These constants define the permissions on sections in the program
+ header, p_flags. */
+#define PF_R 0x4
+#define PF_W 0x2
+#define PF_X 0x1
+
+typedef struct elf32_phdr{
+ Elf32_Word p_type;
+ Elf32_Off p_offset;
+ Elf32_Addr p_vaddr;
+ Elf32_Addr p_paddr;
+ Elf32_Word p_filesz;
+ Elf32_Word p_memsz;
+ Elf32_Word p_flags;
+ Elf32_Word p_align;
+} Elf32_Phdr;
+
+typedef struct elf64_phdr {
+ Elf64_Word p_type;
+ Elf64_Word p_flags;
+ Elf64_Off p_offset; /* Segment file offset */
+ Elf64_Addr p_vaddr; /* Segment virtual address */
+ Elf64_Addr p_paddr; /* Segment physical address */
+ Elf64_Xword p_filesz; /* Segment size in file */
+ Elf64_Xword p_memsz; /* Segment size in memory */
+ Elf64_Xword p_align; /* Segment alignment, file & memory */
+} Elf64_Phdr;
+
+/* sh_type */
+#define SHT_NULL 0
+#define SHT_PROGBITS 1
+#define SHT_SYMTAB 2
+#define SHT_STRTAB 3
+#define SHT_RELA 4
+#define SHT_HASH 5
+#define SHT_DYNAMIC 6
+#define SHT_NOTE 7
+#define SHT_NOBITS 8
+#define SHT_REL 9
+#define SHT_SHLIB 10
+#define SHT_DYNSYM 11
+#define SHT_NUM 12
+#define SHT_LOPROC 0x70000000
+#define SHT_HIPROC 0x7fffffff
+#define SHT_LOUSER 0x80000000
+#define SHT_HIUSER 0xffffffff
+
+/* sh_flags */
+#define SHF_WRITE 0x1
+#define SHF_ALLOC 0x2
+#define SHF_EXECINSTR 0x4
+#define SHF_MASKPROC 0xf0000000
+
+/* special section indexes */
+#define SHN_UNDEF 0
+#define SHN_LORESERVE 0xff00
+#define SHN_LOPROC 0xff00
+#define SHN_HIPROC 0xff1f
+#define SHN_ABS 0xfff1
+#define SHN_COMMON 0xfff2
+#define SHN_HIRESERVE 0xffff
+
+typedef struct {
+ Elf32_Word sh_name;
+ Elf32_Word sh_type;
+ Elf32_Word sh_flags;
+ Elf32_Addr sh_addr;
+ Elf32_Off sh_offset;
+ Elf32_Word sh_size;
+ Elf32_Word sh_link;
+ Elf32_Word sh_info;
+ Elf32_Word sh_addralign;
+ Elf32_Word sh_entsize;
+} Elf32_Shdr;
+
+typedef struct elf64_shdr {
+ Elf64_Word sh_name; /* Section name, index in string tbl */
+ Elf64_Word sh_type; /* Type of section */
+ Elf64_Xword sh_flags; /* Miscellaneous section attributes */
+ Elf64_Addr sh_addr; /* Section virtual addr at execution */
+ Elf64_Off sh_offset; /* Section file offset */
+ Elf64_Xword sh_size; /* Size of section in bytes */
+ Elf64_Word sh_link; /* Index of another section */
+ Elf64_Word sh_info; /* Additional section information */
+ Elf64_Xword sh_addralign; /* Section alignment */
+ Elf64_Xword sh_entsize; /* Entry size if section holds table */
+} Elf64_Shdr;
+
+#define EI_MAG0 0 /* e_ident[] indexes */
+#define EI_MAG1 1
+#define EI_MAG2 2
+#define EI_MAG3 3
+#define EI_CLASS 4
+#define EI_DATA 5
+#define EI_VERSION 6
+#define EI_OSABI 7
+#define EI_PAD 8
+
+#define ELFMAG0 0x7f /* EI_MAG */
+#define ELFMAG1 'E'
+#define ELFMAG2 'L'
+#define ELFMAG3 'F'
+#define ELFMAG "\177ELF"
+#define SELFMAG 4
+
+#define ELFCLASSNONE 0 /* EI_CLASS */
+#define ELFCLASS32 1
+#define ELFCLASS64 2
+#define ELFCLASSNUM 3
+
+#define ELFDATANONE 0 /* e_ident[EI_DATA] */
+#define ELFDATA2LSB 1
+#define ELFDATA2MSB 2
+
+#define EV_NONE 0 /* e_version, EI_VERSION */
+#define EV_CURRENT 1
+#define EV_NUM 2
+
+#define ELFOSABI_NONE 0
+#define ELFOSABI_LINUX 3
+
+#ifndef ELF_OSABI
+#define ELF_OSABI ELFOSABI_NONE
+#endif
+
+/* Notes used in ET_CORE */
+#define NT_PRSTATUS 1
+#define NT_PRFPREG 2
+#define NT_PRPSINFO 3
+#define NT_TASKSTRUCT 4
+#define NT_AUXV 6
+#define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */
+#define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */
+#define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */
+#define NT_PPC_VSX 0x102 /* PowerPC VSX registers */
+#define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */
+#define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */
+
+
+/* Note header in a PT_NOTE section */
+typedef struct elf32_note {
+ Elf32_Word n_namesz; /* Name size */
+ Elf32_Word n_descsz; /* Content size */
+ Elf32_Word n_type; /* Content type */
+} Elf32_Nhdr;
+
+/* Note header in a PT_NOTE section */
+typedef struct elf64_note {
+ Elf64_Word n_namesz; /* Name size */
+ Elf64_Word n_descsz; /* Content size */
+ Elf64_Word n_type; /* Content type */
+} Elf64_Nhdr;
+
+#endif /* _LINUX_ELF_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/elfcore.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/elfcore.h
new file mode 100644
index 0000000..7e58df1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/elfcore.h
@@ -0,0 +1,95 @@
+#ifndef _LINUX_ELFCORE_H
+#define _LINUX_ELFCORE_H
+
+#include <linux/types.h>
+#include <linux/signal.h>
+#include <linux/time.h>
+#include <linux/ptrace.h>
+
+struct elf_siginfo
+{
+ int si_signo; /* signal number */
+ int si_code; /* extra code */
+ int si_errno; /* errno */
+};
+
+
+typedef elf_greg_t greg_t;
+typedef elf_gregset_t gregset_t;
+typedef elf_fpregset_t fpregset_t;
+typedef elf_fpxregset_t fpxregset_t;
+#define NGREG ELF_NGREG
+
+/*
+ * Definitions to generate Intel SVR4-like core files.
+ * These mostly have the same names as the SVR4 types with "elf_"
+ * tacked on the front to prevent clashes with linux definitions,
+ * and the typedef forms have been avoided. This is mostly like
+ * the SVR4 structure, but more Linuxy, with things that Linux does
+ * not support and which gdb doesn't really use excluded.
+ * Fields present but not used are marked with "XXX".
+ */
+struct elf_prstatus
+{
+#if 0
+ long pr_flags; /* XXX Process flags */
+ short pr_why; /* XXX Reason for process halt */
+ short pr_what; /* XXX More detailed reason */
+#endif
+ struct elf_siginfo pr_info; /* Info associated with signal */
+ short pr_cursig; /* Current signal */
+ unsigned long pr_sigpend; /* Set of pending signals */
+ unsigned long pr_sighold; /* Set of held signals */
+#if 0
+ struct sigaltstack pr_altstack; /* Alternate stack info */
+ struct sigaction pr_action; /* Signal action for current sig */
+#endif
+ pid_t pr_pid;
+ pid_t pr_ppid;
+ pid_t pr_pgrp;
+ pid_t pr_sid;
+ struct timeval pr_utime; /* User time */
+ struct timeval pr_stime; /* System time */
+ struct timeval pr_cutime; /* Cumulative user time */
+ struct timeval pr_cstime; /* Cumulative system time */
+#if 0
+ long pr_instr; /* Current instruction */
+#endif
+ elf_gregset_t pr_reg; /* GP registers */
+#ifdef CONFIG_BINFMT_ELF_FDPIC
+ /* When using FDPIC, the loadmap addresses need to be communicated
+ * to GDB in order for GDB to do the necessary relocations. The
+ * fields (below) used to communicate this information are placed
+ * immediately after ``pr_reg'', so that the loadmap addresses may
+ * be viewed as part of the register set if so desired.
+ */
+ unsigned long pr_exec_fdpic_loadmap;
+ unsigned long pr_interp_fdpic_loadmap;
+#endif
+ int pr_fpvalid; /* True if math co-processor being used. */
+};
+
+#define ELF_PRARGSZ (80) /* Number of chars for args */
+
+struct elf_prpsinfo
+{
+ char pr_state; /* numeric process state */
+ char pr_sname; /* char for pr_state */
+ char pr_zomb; /* zombie */
+ char pr_nice; /* nice val */
+ unsigned long pr_flag; /* flags */
+ __kernel_uid_t pr_uid;
+ __kernel_gid_t pr_gid;
+ pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid;
+ /* Lots missing */
+ char pr_fname[16]; /* filename of executable */
+ char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
+};
+
+typedef struct elf_prstatus prstatus_t;
+typedef struct elf_prpsinfo prpsinfo_t;
+#define PRARGSZ ELF_PRARGSZ
+
+
+
+#endif /* _LINUX_ELFCORE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/errno.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/errno.h
new file mode 100644
index 0000000..6385fa3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/errno.h
@@ -0,0 +1,7 @@
+#ifndef _LINUX_ERRNO_H
+#define _LINUX_ERRNO_H
+
+#include <asm/errno.h>
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/errqueue.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/errqueue.h
new file mode 100644
index 0000000..35de665
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/errqueue.h
@@ -0,0 +1,26 @@
+#ifndef _LINUX_ERRQUEUE_H
+#define _LINUX_ERRQUEUE_H 1
+
+#include <linux/types.h>
+
+struct sock_extended_err
+{
+ __u32 ee_errno;
+ __u8 ee_origin;
+ __u8 ee_type;
+ __u8 ee_code;
+ __u8 ee_pad;
+ __u32 ee_info;
+ __u32 ee_data;
+};
+
+#define SO_EE_ORIGIN_NONE 0
+#define SO_EE_ORIGIN_LOCAL 1
+#define SO_EE_ORIGIN_ICMP 2
+#define SO_EE_ORIGIN_ICMP6 3
+#define SO_EE_ORIGIN_TIMESTAMPING 4
+
+#define SO_EE_OFFENDER(ee) ((struct sockaddr*)((ee)+1))
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ethtool.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ethtool.h
new file mode 100644
index 0000000..fc48751
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ethtool.h
@@ -0,0 +1,530 @@
+/*
+ * ethtool.h: Defines for Linux ethtool.
+ *
+ * Copyright (C) 1998 David S. Miller (davem@redhat.com)
+ * Copyright 2001 Jeff Garzik <jgarzik@pobox.com>
+ * Portions Copyright 2001 Sun Microsystems (thockin@sun.com)
+ * Portions Copyright 2002 Intel (eli.kupermann@intel.com,
+ * christopher.leech@intel.com,
+ * scott.feldman@intel.com)
+ * Portions Copyright (C) Sun Microsystems 2008
+ */
+
+#ifndef _LINUX_ETHTOOL_H
+#define _LINUX_ETHTOOL_H
+
+#include <linux/types.h>
+
+/* This should work for both 32 and 64 bit userland. */
+struct ethtool_cmd {
+ __u32 cmd;
+ __u32 supported; /* Features this interface supports */
+ __u32 advertising; /* Features this interface advertises */
+ __u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */
+ __u8 duplex; /* Duplex, half or full */
+ __u8 port; /* Which connector port */
+ __u8 phy_address;
+ __u8 transceiver; /* Which transceiver to use */
+ __u8 autoneg; /* Enable or disable autonegotiation */
+ __u32 maxtxpkt; /* Tx pkts before generating tx int */
+ __u32 maxrxpkt; /* Rx pkts before generating rx int */
+ __u16 speed_hi;
+ __u16 reserved2;
+ __u32 reserved[3];
+};
+
+static __inline__ void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
+ __u32 speed)
+{
+
+ ep->speed = (__u16)speed;
+ ep->speed_hi = (__u16)(speed >> 16);
+}
+
+static __inline__ __u32 ethtool_cmd_speed(struct ethtool_cmd *ep)
+{
+ return (ep->speed_hi << 16) | ep->speed;
+}
+
+#define ETHTOOL_BUSINFO_LEN 32
+/* these strings are set to whatever the driver author decides... */
+struct ethtool_drvinfo {
+ __u32 cmd;
+ char driver[32]; /* driver short name, "tulip", "eepro100" */
+ char version[32]; /* driver version string */
+ char fw_version[32]; /* firmware version string, if applicable */
+ char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */
+ /* For PCI devices, use pci_name(pci_dev). */
+ char reserved1[32];
+ char reserved2[12];
+ __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */
+ __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */
+ __u32 testinfo_len;
+ __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */
+ __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */
+};
+
+#define SOPASS_MAX 6
+/* wake-on-lan settings */
+struct ethtool_wolinfo {
+ __u32 cmd;
+ __u32 supported;
+ __u32 wolopts;
+ __u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */
+};
+
+/* for passing single values */
+struct ethtool_value {
+ __u32 cmd;
+ __u32 data;
+};
+
+/* for passing big chunks of data */
+struct ethtool_regs {
+ __u32 cmd;
+ __u32 version; /* driver-specific, indicates different chips/revs */
+ __u32 len; /* bytes */
+ __u8 data[0];
+};
+
+/* for passing EEPROM chunks */
+struct ethtool_eeprom {
+ __u32 cmd;
+ __u32 magic;
+ __u32 offset; /* in bytes */
+ __u32 len; /* in bytes */
+ __u8 data[0];
+};
+
+/* for configuring coalescing parameters of chip */
+struct ethtool_coalesce {
+ __u32 cmd; /* ETHTOOL_{G,S}COALESCE */
+
+ /* How many usecs to delay an RX interrupt after
+ * a packet arrives. If 0, only rx_max_coalesced_frames
+ * is used.
+ */
+ __u32 rx_coalesce_usecs;
+
+ /* How many packets to delay an RX interrupt after
+ * a packet arrives. If 0, only rx_coalesce_usecs is
+ * used. It is illegal to set both usecs and max frames
+ * to zero as this would cause RX interrupts to never be
+ * generated.
+ */
+ __u32 rx_max_coalesced_frames;
+
+ /* Same as above two parameters, except that these values
+ * apply while an IRQ is being serviced by the host. Not
+ * all cards support this feature and the values are ignored
+ * in that case.
+ */
+ __u32 rx_coalesce_usecs_irq;
+ __u32 rx_max_coalesced_frames_irq;
+
+ /* How many usecs to delay a TX interrupt after
+ * a packet is sent. If 0, only tx_max_coalesced_frames
+ * is used.
+ */
+ __u32 tx_coalesce_usecs;
+
+ /* How many packets to delay a TX interrupt after
+ * a packet is sent. If 0, only tx_coalesce_usecs is
+ * used. It is illegal to set both usecs and max frames
+ * to zero as this would cause TX interrupts to never be
+ * generated.
+ */
+ __u32 tx_max_coalesced_frames;
+
+ /* Same as above two parameters, except that these values
+ * apply while an IRQ is being serviced by the host. Not
+ * all cards support this feature and the values are ignored
+ * in that case.
+ */
+ __u32 tx_coalesce_usecs_irq;
+ __u32 tx_max_coalesced_frames_irq;
+
+ /* How many usecs to delay in-memory statistics
+ * block updates. Some drivers do not have an in-memory
+ * statistic block, and in such cases this value is ignored.
+ * This value must not be zero.
+ */
+ __u32 stats_block_coalesce_usecs;
+
+ /* Adaptive RX/TX coalescing is an algorithm implemented by
+ * some drivers to improve latency under low packet rates and
+ * improve throughput under high packet rates. Some drivers
+ * only implement one of RX or TX adaptive coalescing. Anything
+ * not implemented by the driver causes these values to be
+ * silently ignored.
+ */
+ __u32 use_adaptive_rx_coalesce;
+ __u32 use_adaptive_tx_coalesce;
+
+ /* When the packet rate (measured in packets per second)
+ * is below pkt_rate_low, the {rx,tx}_*_low parameters are
+ * used.
+ */
+ __u32 pkt_rate_low;
+ __u32 rx_coalesce_usecs_low;
+ __u32 rx_max_coalesced_frames_low;
+ __u32 tx_coalesce_usecs_low;
+ __u32 tx_max_coalesced_frames_low;
+
+ /* When the packet rate is below pkt_rate_high but above
+ * pkt_rate_low (both measured in packets per second) the
+ * normal {rx,tx}_* coalescing parameters are used.
+ */
+
+ /* When the packet rate is (measured in packets per second)
+ * is above pkt_rate_high, the {rx,tx}_*_high parameters are
+ * used.
+ */
+ __u32 pkt_rate_high;
+ __u32 rx_coalesce_usecs_high;
+ __u32 rx_max_coalesced_frames_high;
+ __u32 tx_coalesce_usecs_high;
+ __u32 tx_max_coalesced_frames_high;
+
+ /* How often to do adaptive coalescing packet rate sampling,
+ * measured in seconds. Must not be zero.
+ */
+ __u32 rate_sample_interval;
+};
+
+/* for configuring RX/TX ring parameters */
+struct ethtool_ringparam {
+ __u32 cmd; /* ETHTOOL_{G,S}RINGPARAM */
+
+ /* Read only attributes. These indicate the maximum number
+ * of pending RX/TX ring entries the driver will allow the
+ * user to set.
+ */
+ __u32 rx_max_pending;
+ __u32 rx_mini_max_pending;
+ __u32 rx_jumbo_max_pending;
+ __u32 tx_max_pending;
+
+ /* Values changeable by the user. The valid values are
+ * in the range 1 to the "*_max_pending" counterpart above.
+ */
+ __u32 rx_pending;
+ __u32 rx_mini_pending;
+ __u32 rx_jumbo_pending;
+ __u32 tx_pending;
+};
+
+/* for configuring link flow control parameters */
+struct ethtool_pauseparam {
+ __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */
+
+ /* If the link is being auto-negotiated (via ethtool_cmd.autoneg
+ * being true) the user may set 'autonet' here non-zero to have the
+ * pause parameters be auto-negotiated too. In such a case, the
+ * {rx,tx}_pause values below determine what capabilities are
+ * advertised.
+ *
+ * If 'autoneg' is zero or the link is not being auto-negotiated,
+ * then {rx,tx}_pause force the driver to use/not-use pause
+ * flow control.
+ */
+ __u32 autoneg;
+ __u32 rx_pause;
+ __u32 tx_pause;
+};
+
+#define ETH_GSTRING_LEN 32
+enum ethtool_stringset {
+ ETH_SS_TEST = 0,
+ ETH_SS_STATS,
+ ETH_SS_PRIV_FLAGS,
+};
+
+/* for passing string sets for data tagging */
+struct ethtool_gstrings {
+ __u32 cmd; /* ETHTOOL_GSTRINGS */
+ __u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/
+ __u32 len; /* number of strings in the string set */
+ __u8 data[0];
+};
+
+enum ethtool_test_flags {
+ ETH_TEST_FL_OFFLINE = (1 << 0), /* online / offline */
+ ETH_TEST_FL_FAILED = (1 << 1), /* test passed / failed */
+};
+
+/* for requesting NIC test and getting results*/
+struct ethtool_test {
+ __u32 cmd; /* ETHTOOL_TEST */
+ __u32 flags; /* ETH_TEST_FL_xxx */
+ __u32 reserved;
+ __u32 len; /* result length, in number of u64 elements */
+ __u64 data[0];
+};
+
+/* for dumping NIC-specific statistics */
+struct ethtool_stats {
+ __u32 cmd; /* ETHTOOL_GSTATS */
+ __u32 n_stats; /* number of u64's being returned */
+ __u64 data[0];
+};
+
+struct ethtool_perm_addr {
+ __u32 cmd; /* ETHTOOL_GPERMADDR */
+ __u32 size;
+ __u8 data[0];
+};
+
+/* boolean flags controlling per-interface behavior characteristics.
+ * When reading, the flag indicates whether or not a certain behavior
+ * is enabled/present. When writing, the flag indicates whether
+ * or not the driver should turn on (set) or off (clear) a behavior.
+ *
+ * Some behaviors may read-only (unconditionally absent or present).
+ * If such is the case, return EINVAL in the set-flags operation if the
+ * flag differs from the read-only value.
+ */
+enum ethtool_flags {
+ ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */
+};
+
+/* The following structures are for supporting RX network flow
+ * classification configuration. Note, all multibyte fields, e.g.,
+ * ip4src, ip4dst, psrc, pdst, spi, etc. are expected to be in network
+ * byte order.
+ */
+struct ethtool_tcpip4_spec {
+ __be32 ip4src;
+ __be32 ip4dst;
+ __be16 psrc;
+ __be16 pdst;
+ __u8 tos;
+};
+
+struct ethtool_ah_espip4_spec {
+ __be32 ip4src;
+ __be32 ip4dst;
+ __be32 spi;
+ __u8 tos;
+};
+
+struct ethtool_rawip4_spec {
+ __be32 ip4src;
+ __be32 ip4dst;
+ __u8 hdata[64];
+};
+
+struct ethtool_ether_spec {
+ __be16 ether_type;
+ __u8 frame_size;
+ __u8 eframe[16];
+};
+
+#define ETH_RX_NFC_IP4 1
+#define ETH_RX_NFC_IP6 2
+
+struct ethtool_usrip4_spec {
+ __be32 ip4src;
+ __be32 ip4dst;
+ __be32 l4_4_bytes;
+ __u8 tos;
+ __u8 ip_ver;
+ __u8 proto;
+};
+
+struct ethtool_rx_flow_spec {
+ __u32 flow_type;
+ union {
+ struct ethtool_tcpip4_spec tcp_ip4_spec;
+ struct ethtool_tcpip4_spec udp_ip4_spec;
+ struct ethtool_tcpip4_spec sctp_ip4_spec;
+ struct ethtool_ah_espip4_spec ah_ip4_spec;
+ struct ethtool_ah_espip4_spec esp_ip4_spec;
+ struct ethtool_rawip4_spec raw_ip4_spec;
+ struct ethtool_ether_spec ether_spec;
+ struct ethtool_usrip4_spec usr_ip4_spec;
+ __u8 hdata[64];
+ } h_u, m_u; /* entry, mask */
+ __u64 ring_cookie;
+ __u32 location;
+};
+
+struct ethtool_rxnfc {
+ __u32 cmd;
+ __u32 flow_type;
+ /* The rx flow hash value or the rule DB size */
+ __u64 data;
+ struct ethtool_rx_flow_spec fs;
+ __u32 rule_cnt;
+ __u32 rule_locs[0];
+};
+
+
+/* CMDs currently supported */
+#define ETHTOOL_GSET 0x00000001 /* Get settings. */
+#define ETHTOOL_SSET 0x00000002 /* Set settings. */
+#define ETHTOOL_GDRVINFO 0x00000003 /* Get driver info. */
+#define ETHTOOL_GREGS 0x00000004 /* Get NIC registers. */
+#define ETHTOOL_GWOL 0x00000005 /* Get wake-on-lan options. */
+#define ETHTOOL_SWOL 0x00000006 /* Set wake-on-lan options. */
+#define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */
+#define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */
+#define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */
+#define ETHTOOL_GLINK 0x0000000a /* Get link status (ethtool_value) */
+#define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */
+#define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */
+#define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */
+#define ETHTOOL_SCOALESCE 0x0000000f /* Set coalesce config. */
+#define ETHTOOL_GRINGPARAM 0x00000010 /* Get ring parameters */
+#define ETHTOOL_SRINGPARAM 0x00000011 /* Set ring parameters. */
+#define ETHTOOL_GPAUSEPARAM 0x00000012 /* Get pause parameters */
+#define ETHTOOL_SPAUSEPARAM 0x00000013 /* Set pause parameters. */
+#define ETHTOOL_GRXCSUM 0x00000014 /* Get RX hw csum enable (ethtool_value) */
+#define ETHTOOL_SRXCSUM 0x00000015 /* Set RX hw csum enable (ethtool_value) */
+#define ETHTOOL_GTXCSUM 0x00000016 /* Get TX hw csum enable (ethtool_value) */
+#define ETHTOOL_STXCSUM 0x00000017 /* Set TX hw csum enable (ethtool_value) */
+#define ETHTOOL_GSG 0x00000018 /* Get scatter-gather enable
+ * (ethtool_value) */
+#define ETHTOOL_SSG 0x00000019 /* Set scatter-gather enable
+ * (ethtool_value). */
+#define ETHTOOL_TEST 0x0000001a /* execute NIC self-test. */
+#define ETHTOOL_GSTRINGS 0x0000001b /* get specified string set */
+#define ETHTOOL_PHYS_ID 0x0000001c /* identify the NIC */
+#define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */
+#define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */
+#define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */
+#define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */
+#define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */
+#define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */
+#define ETHTOOL_GGSO 0x00000023 /* Get GSO enable (ethtool_value) */
+#define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */
+#define ETHTOOL_GFLAGS 0x00000025 /* Get flags bitmap(ethtool_value) */
+#define ETHTOOL_SFLAGS 0x00000026 /* Set flags bitmap(ethtool_value) */
+#define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */
+#define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */
+
+#define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */
+#define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */
+#define ETHTOOL_GGRO 0x0000002b /* Get GRO enable (ethtool_value) */
+#define ETHTOOL_SGRO 0x0000002c /* Set GRO enable (ethtool_value) */
+#define ETHTOOL_GRXRINGS 0x0000002d /* Get RX rings available for LB */
+#define ETHTOOL_GRXCLSRLCNT 0x0000002e /* Get RX class rule count */
+#define ETHTOOL_GRXCLSRULE 0x0000002f /* Get RX classification rule */
+#define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */
+#define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */
+#define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */
+
+/* compatibility with older code */
+#define SPARC_ETH_GSET ETHTOOL_GSET
+#define SPARC_ETH_SSET ETHTOOL_SSET
+
+/* Indicates what features are supported by the interface. */
+#define SUPPORTED_10baseT_Half (1 << 0)
+#define SUPPORTED_10baseT_Full (1 << 1)
+#define SUPPORTED_100baseT_Half (1 << 2)
+#define SUPPORTED_100baseT_Full (1 << 3)
+#define SUPPORTED_1000baseT_Half (1 << 4)
+#define SUPPORTED_1000baseT_Full (1 << 5)
+#define SUPPORTED_Autoneg (1 << 6)
+#define SUPPORTED_TP (1 << 7)
+#define SUPPORTED_AUI (1 << 8)
+#define SUPPORTED_MII (1 << 9)
+#define SUPPORTED_FIBRE (1 << 10)
+#define SUPPORTED_BNC (1 << 11)
+#define SUPPORTED_10000baseT_Full (1 << 12)
+#define SUPPORTED_Pause (1 << 13)
+#define SUPPORTED_Asym_Pause (1 << 14)
+#define SUPPORTED_2500baseX_Full (1 << 15)
+
+/* Indicates what features are advertised by the interface. */
+#define ADVERTISED_10baseT_Half (1 << 0)
+#define ADVERTISED_10baseT_Full (1 << 1)
+#define ADVERTISED_100baseT_Half (1 << 2)
+#define ADVERTISED_100baseT_Full (1 << 3)
+#define ADVERTISED_1000baseT_Half (1 << 4)
+#define ADVERTISED_1000baseT_Full (1 << 5)
+#define ADVERTISED_Autoneg (1 << 6)
+#define ADVERTISED_TP (1 << 7)
+#define ADVERTISED_AUI (1 << 8)
+#define ADVERTISED_MII (1 << 9)
+#define ADVERTISED_FIBRE (1 << 10)
+#define ADVERTISED_BNC (1 << 11)
+#define ADVERTISED_10000baseT_Full (1 << 12)
+#define ADVERTISED_Pause (1 << 13)
+#define ADVERTISED_Asym_Pause (1 << 14)
+#define ADVERTISED_2500baseX_Full (1 << 15)
+
+/* The following are all involved in forcing a particular link
+ * mode for the device for setting things. When getting the
+ * devices settings, these indicate the current mode and whether
+ * it was foced up into this mode or autonegotiated.
+ */
+
+/* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */
+#define SPEED_10 10
+#define SPEED_100 100
+#define SPEED_1000 1000
+#define SPEED_2500 2500
+#define SPEED_10000 10000
+
+/* Duplex, half or full. */
+#define DUPLEX_HALF 0x00
+#define DUPLEX_FULL 0x01
+
+/* Which connector port. */
+#define PORT_TP 0x00
+#define PORT_AUI 0x01
+#define PORT_MII 0x02
+#define PORT_FIBRE 0x03
+#define PORT_BNC 0x04
+
+/* Which transceiver to use. */
+#define XCVR_INTERNAL 0x00
+#define XCVR_EXTERNAL 0x01
+#define XCVR_DUMMY1 0x02
+#define XCVR_DUMMY2 0x03
+#define XCVR_DUMMY3 0x04
+
+/* Enable or disable autonegotiation. If this is set to enable,
+ * the forced link modes above are completely ignored.
+ */
+#define AUTONEG_DISABLE 0x00
+#define AUTONEG_ENABLE 0x01
+
+/* Wake-On-Lan options. */
+#define WAKE_PHY (1 << 0)
+#define WAKE_UCAST (1 << 1)
+#define WAKE_MCAST (1 << 2)
+#define WAKE_BCAST (1 << 3)
+#define WAKE_ARP (1 << 4)
+#define WAKE_MAGIC (1 << 5)
+#define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
+
+/* L3-L4 network traffic flow types */
+#define TCP_V4_FLOW 0x01
+#define UDP_V4_FLOW 0x02
+#define SCTP_V4_FLOW 0x03
+#define AH_ESP_V4_FLOW 0x04
+#define TCP_V6_FLOW 0x05
+#define UDP_V6_FLOW 0x06
+#define SCTP_V6_FLOW 0x07
+#define AH_ESP_V6_FLOW 0x08
+#define AH_V4_FLOW 0x09
+#define ESP_V4_FLOW 0x0a
+#define AH_V6_FLOW 0x0b
+#define ESP_V6_FLOW 0x0c
+#define IP_USER_FLOW 0x0d
+
+/* L3-L4 network traffic flow hash options */
+#define RXH_L2DA (1 << 1)
+#define RXH_VLAN (1 << 2)
+#define RXH_L3_PROTO (1 << 3)
+#define RXH_IP_SRC (1 << 4)
+#define RXH_IP_DST (1 << 5)
+#define RXH_L4_B_0_1 (1 << 6) /* src port in case of TCP/UDP/SCTP */
+#define RXH_L4_B_2_3 (1 << 7) /* dst port in case of TCP/UDP/SCTP */
+#define RXH_DISCARD (1 << 31)
+
+#define RX_CLS_FLOW_DISC 0xffffffffffffffffULL
+
+#endif /* _LINUX_ETHTOOL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/eventpoll.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/eventpoll.h
new file mode 100644
index 0000000..d9d19ae
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/eventpoll.h
@@ -0,0 +1,54 @@
+/*
+ * include/linux/eventpoll.h ( Efficent event polling implementation )
+ * Copyright (C) 2001,...,2006 Davide Libenzi
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Davide Libenzi <davidel@xmailserver.org>
+ *
+ */
+
+#ifndef _LINUX_EVENTPOLL_H
+#define _LINUX_EVENTPOLL_H
+
+/* For O_CLOEXEC */
+#include <linux/fcntl.h>
+#include <linux/types.h>
+
+/* Flags for epoll_create1. */
+#define EPOLL_CLOEXEC O_CLOEXEC
+
+/* Valid opcodes to issue to sys_epoll_ctl() */
+#define EPOLL_CTL_ADD 1
+#define EPOLL_CTL_DEL 2
+#define EPOLL_CTL_MOD 3
+
+/* Set the One Shot behaviour for the target file descriptor */
+#define EPOLLONESHOT (1 << 30)
+
+/* Set the Edge Triggered behaviour for the target file descriptor */
+#define EPOLLET (1 << 31)
+
+/*
+ * On x86-64 make the 64bit structure have the same alignment as the
+ * 32bit structure. This makes 32bit emulation easier.
+ *
+ * UML/x86_64 needs the same packing as x86_64
+ */
+#ifdef __x86_64__
+#define EPOLL_PACKED __attribute__((packed))
+#else
+#define EPOLL_PACKED
+#endif
+
+struct epoll_event {
+ __u32 events;
+ __u64 data;
+} EPOLL_PACKED;
+
+
+#endif /* #ifndef _LINUX_EVENTPOLL_H */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ext2_fs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ext2_fs.h
new file mode 100644
index 0000000..afb7507
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ext2_fs.h
@@ -0,0 +1,556 @@
+/*
+ * linux/include/linux/ext2_fs.h
+ *
+ * Copyright (C) 1992, 1993, 1994, 1995
+ * Remy Card (card@masi.ibp.fr)
+ * Laboratoire MASI - Institut Blaise Pascal
+ * Universite Pierre et Marie Curie (Paris VI)
+ *
+ * from
+ *
+ * linux/include/linux/minix_fs.h
+ *
+ * Copyright (C) 1991, 1992 Linus Torvalds
+ */
+
+#ifndef _LINUX_EXT2_FS_H
+#define _LINUX_EXT2_FS_H
+
+#include <linux/types.h>
+#include <linux/magic.h>
+
+/*
+ * The second extended filesystem constants/structures
+ */
+
+/*
+ * Define EXT2FS_DEBUG to produce debug messages
+ */
+#undef EXT2FS_DEBUG
+
+/*
+ * Define EXT2_RESERVATION to reserve data blocks for expanding files
+ */
+#define EXT2_DEFAULT_RESERVE_BLOCKS 8
+/*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */
+#define EXT2_MAX_RESERVE_BLOCKS 1027
+#define EXT2_RESERVE_WINDOW_NOT_ALLOCATED 0
+/*
+ * The second extended file system version
+ */
+#define EXT2FS_DATE "95/08/09"
+#define EXT2FS_VERSION "0.5b"
+
+/*
+ * Debug code
+ */
+#ifdef EXT2FS_DEBUG
+# define ext2_debug(f, a...) { \
+ printk ("EXT2-fs DEBUG (%s, %d): %s:", \
+ __FILE__, __LINE__, __func__); \
+ printk (f, ## a); \
+ }
+#else
+# define ext2_debug(f, a...) /**/
+#endif
+
+/*
+ * Special inode numbers
+ */
+#define EXT2_BAD_INO 1 /* Bad blocks inode */
+#define EXT2_ROOT_INO 2 /* Root inode */
+#define EXT2_BOOT_LOADER_INO 5 /* Boot loader inode */
+#define EXT2_UNDEL_DIR_INO 6 /* Undelete directory inode */
+
+/* First non-reserved inode for old ext2 filesystems */
+#define EXT2_GOOD_OLD_FIRST_INO 11
+
+/* Assume that user mode programs are passing in an ext2fs superblock, not
+ * a kernel struct super_block. This will allow us to call the feature-test
+ * macros from user land. */
+#define EXT2_SB(sb) (sb)
+
+/*
+ * Maximal count of links to a file
+ */
+#define EXT2_LINK_MAX 32000
+
+/*
+ * Macro-instructions used to manage several block sizes
+ */
+#define EXT2_MIN_BLOCK_SIZE 1024
+#define EXT2_MAX_BLOCK_SIZE 4096
+#define EXT2_MIN_BLOCK_LOG_SIZE 10
+# define EXT2_BLOCK_SIZE(s) (EXT2_MIN_BLOCK_SIZE << (s)->s_log_block_size)
+#define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (__u32))
+# define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10)
+#define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \
+ EXT2_GOOD_OLD_INODE_SIZE : \
+ (s)->s_inode_size)
+#define EXT2_FIRST_INO(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \
+ EXT2_GOOD_OLD_FIRST_INO : \
+ (s)->s_first_ino)
+
+/*
+ * Macro-instructions used to manage fragments
+ */
+#define EXT2_MIN_FRAG_SIZE 1024
+#define EXT2_MAX_FRAG_SIZE 4096
+#define EXT2_MIN_FRAG_LOG_SIZE 10
+# define EXT2_FRAG_SIZE(s) (EXT2_MIN_FRAG_SIZE << (s)->s_log_frag_size)
+# define EXT2_FRAGS_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / EXT2_FRAG_SIZE(s))
+
+/*
+ * Structure of a blocks group descriptor
+ */
+struct ext2_group_desc
+{
+ __le32 bg_block_bitmap; /* Blocks bitmap block */
+ __le32 bg_inode_bitmap; /* Inodes bitmap block */
+ __le32 bg_inode_table; /* Inodes table block */
+ __le16 bg_free_blocks_count; /* Free blocks count */
+ __le16 bg_free_inodes_count; /* Free inodes count */
+ __le16 bg_used_dirs_count; /* Directories count */
+ __le16 bg_pad;
+ __le32 bg_reserved[3];
+};
+
+/*
+ * Macro-instructions used to manage group descriptors
+ */
+# define EXT2_BLOCKS_PER_GROUP(s) ((s)->s_blocks_per_group)
+# define EXT2_DESC_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_group_desc))
+# define EXT2_INODES_PER_GROUP(s) ((s)->s_inodes_per_group)
+
+/*
+ * Constants relative to the data blocks
+ */
+#define EXT2_NDIR_BLOCKS 12
+#define EXT2_IND_BLOCK EXT2_NDIR_BLOCKS
+#define EXT2_DIND_BLOCK (EXT2_IND_BLOCK + 1)
+#define EXT2_TIND_BLOCK (EXT2_DIND_BLOCK + 1)
+#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1)
+
+/*
+ * Inode flags (GETFLAGS/SETFLAGS)
+ */
+#define EXT2_SECRM_FL FS_SECRM_FL /* Secure deletion */
+#define EXT2_UNRM_FL FS_UNRM_FL /* Undelete */
+#define EXT2_COMPR_FL FS_COMPR_FL /* Compress file */
+#define EXT2_SYNC_FL FS_SYNC_FL /* Synchronous updates */
+#define EXT2_IMMUTABLE_FL FS_IMMUTABLE_FL /* Immutable file */
+#define EXT2_APPEND_FL FS_APPEND_FL /* writes to file may only append */
+#define EXT2_NODUMP_FL FS_NODUMP_FL /* do not dump file */
+#define EXT2_NOATIME_FL FS_NOATIME_FL /* do not update atime */
+/* Reserved for compression usage... */
+#define EXT2_DIRTY_FL FS_DIRTY_FL
+#define EXT2_COMPRBLK_FL FS_COMPRBLK_FL /* One or more compressed clusters */
+#define EXT2_NOCOMP_FL FS_NOCOMP_FL /* Don't compress */
+#define EXT2_ECOMPR_FL FS_ECOMPR_FL /* Compression error */
+/* End compression flags --- maybe not all used */
+#define EXT2_BTREE_FL FS_BTREE_FL /* btree format dir */
+#define EXT2_INDEX_FL FS_INDEX_FL /* hash-indexed directory */
+#define EXT2_IMAGIC_FL FS_IMAGIC_FL /* AFS directory */
+#define EXT2_JOURNAL_DATA_FL FS_JOURNAL_DATA_FL /* Reserved for ext3 */
+#define EXT2_NOTAIL_FL FS_NOTAIL_FL /* file tail should not be merged */
+#define EXT2_DIRSYNC_FL FS_DIRSYNC_FL /* dirsync behaviour (directories only) */
+#define EXT2_TOPDIR_FL FS_TOPDIR_FL /* Top of directory hierarchies*/
+#define EXT2_RESERVED_FL FS_RESERVED_FL /* reserved for ext2 lib */
+
+#define EXT2_FL_USER_VISIBLE FS_FL_USER_VISIBLE /* User visible flags */
+#define EXT2_FL_USER_MODIFIABLE FS_FL_USER_MODIFIABLE /* User modifiable flags */
+
+/* Flags that should be inherited by new inodes from their parent. */
+#define EXT2_FL_INHERITED (EXT2_SECRM_FL | EXT2_UNRM_FL | EXT2_COMPR_FL |\
+ EXT2_SYNC_FL | EXT2_IMMUTABLE_FL | EXT2_APPEND_FL |\
+ EXT2_NODUMP_FL | EXT2_NOATIME_FL | EXT2_COMPRBLK_FL|\
+ EXT2_NOCOMP_FL | EXT2_JOURNAL_DATA_FL |\
+ EXT2_NOTAIL_FL | EXT2_DIRSYNC_FL)
+
+/* Flags that are appropriate for regular files (all but dir-specific ones). */
+#define EXT2_REG_FLMASK (~(EXT2_DIRSYNC_FL | EXT2_TOPDIR_FL))
+
+/* Flags that are appropriate for non-directories/regular files. */
+#define EXT2_OTHER_FLMASK (EXT2_NODUMP_FL | EXT2_NOATIME_FL)
+
+/* Mask out flags that are inappropriate for the given type of inode. */
+static __inline__ __u32 ext2_mask_flags(umode_t mode, __u32 flags)
+{
+ if (S_ISDIR(mode))
+ return flags;
+ else if (S_ISREG(mode))
+ return flags & EXT2_REG_FLMASK;
+ else
+ return flags & EXT2_OTHER_FLMASK;
+}
+
+/*
+ * ioctl commands
+ */
+#define EXT2_IOC_GETFLAGS FS_IOC_GETFLAGS
+#define EXT2_IOC_SETFLAGS FS_IOC_SETFLAGS
+#define EXT2_IOC_GETVERSION FS_IOC_GETVERSION
+#define EXT2_IOC_SETVERSION FS_IOC_SETVERSION
+#define EXT2_IOC_GETRSVSZ _IOR('f', 5, long)
+#define EXT2_IOC_SETRSVSZ _IOW('f', 6, long)
+
+/*
+ * ioctl commands in 32 bit emulation
+ */
+#define EXT2_IOC32_GETFLAGS FS_IOC32_GETFLAGS
+#define EXT2_IOC32_SETFLAGS FS_IOC32_SETFLAGS
+#define EXT2_IOC32_GETVERSION FS_IOC32_GETVERSION
+#define EXT2_IOC32_SETVERSION FS_IOC32_SETVERSION
+
+/*
+ * Structure of an inode on the disk
+ */
+struct ext2_inode {
+ __le16 i_mode; /* File mode */
+ __le16 i_uid; /* Low 16 bits of Owner Uid */
+ __le32 i_size; /* Size in bytes */
+ __le32 i_atime; /* Access time */
+ __le32 i_ctime; /* Creation time */
+ __le32 i_mtime; /* Modification time */
+ __le32 i_dtime; /* Deletion Time */
+ __le16 i_gid; /* Low 16 bits of Group Id */
+ __le16 i_links_count; /* Links count */
+ __le32 i_blocks; /* Blocks count */
+ __le32 i_flags; /* File flags */
+ union {
+ struct {
+ __le32 l_i_reserved1;
+ } linux1;
+ struct {
+ __le32 h_i_translator;
+ } hurd1;
+ struct {
+ __le32 m_i_reserved1;
+ } masix1;
+ } osd1; /* OS dependent 1 */
+ __le32 i_block[EXT2_N_BLOCKS];/* Pointers to blocks */
+ __le32 i_generation; /* File version (for NFS) */
+ __le32 i_file_acl; /* File ACL */
+ __le32 i_dir_acl; /* Directory ACL */
+ __le32 i_faddr; /* Fragment address */
+ union {
+ struct {
+ __u8 l_i_frag; /* Fragment number */
+ __u8 l_i_fsize; /* Fragment size */
+ __u16 i_pad1;
+ __le16 l_i_uid_high; /* these 2 fields */
+ __le16 l_i_gid_high; /* were reserved2[0] */
+ __u32 l_i_reserved2;
+ } linux2;
+ struct {
+ __u8 h_i_frag; /* Fragment number */
+ __u8 h_i_fsize; /* Fragment size */
+ __le16 h_i_mode_high;
+ __le16 h_i_uid_high;
+ __le16 h_i_gid_high;
+ __le32 h_i_author;
+ } hurd2;
+ struct {
+ __u8 m_i_frag; /* Fragment number */
+ __u8 m_i_fsize; /* Fragment size */
+ __u16 m_pad1;
+ __u32 m_i_reserved2[2];
+ } masix2;
+ } osd2; /* OS dependent 2 */
+};
+
+#define i_size_high i_dir_acl
+
+#if defined(__KERNEL__) || defined(__linux__)
+#define i_reserved1 osd1.linux1.l_i_reserved1
+#define i_frag osd2.linux2.l_i_frag
+#define i_fsize osd2.linux2.l_i_fsize
+#define i_uid_low i_uid
+#define i_gid_low i_gid
+#define i_uid_high osd2.linux2.l_i_uid_high
+#define i_gid_high osd2.linux2.l_i_gid_high
+#define i_reserved2 osd2.linux2.l_i_reserved2
+#endif
+
+#ifdef __hurd__
+#define i_translator osd1.hurd1.h_i_translator
+#define i_frag osd2.hurd2.h_i_frag
+#define i_fsize osd2.hurd2.h_i_fsize
+#define i_uid_high osd2.hurd2.h_i_uid_high
+#define i_gid_high osd2.hurd2.h_i_gid_high
+#define i_author osd2.hurd2.h_i_author
+#endif
+
+#ifdef __masix__
+#define i_reserved1 osd1.masix1.m_i_reserved1
+#define i_frag osd2.masix2.m_i_frag
+#define i_fsize osd2.masix2.m_i_fsize
+#define i_reserved2 osd2.masix2.m_i_reserved2
+#endif
+
+/*
+ * File system states
+ */
+#define EXT2_VALID_FS 0x0001 /* Unmounted cleanly */
+#define EXT2_ERROR_FS 0x0002 /* Errors detected */
+
+/*
+ * Mount flags
+ */
+#define EXT2_MOUNT_CHECK 0x000001 /* Do mount-time checks */
+#define EXT2_MOUNT_OLDALLOC 0x000002 /* Don't use the new Orlov allocator */
+#define EXT2_MOUNT_GRPID 0x000004 /* Create files with directory's group */
+#define EXT2_MOUNT_DEBUG 0x000008 /* Some debugging messages */
+#define EXT2_MOUNT_ERRORS_CONT 0x000010 /* Continue on errors */
+#define EXT2_MOUNT_ERRORS_RO 0x000020 /* Remount fs ro on errors */
+#define EXT2_MOUNT_ERRORS_PANIC 0x000040 /* Panic on errors */
+#define EXT2_MOUNT_MINIX_DF 0x000080 /* Mimics the Minix statfs */
+#define EXT2_MOUNT_NOBH 0x000100 /* No buffer_heads */
+#define EXT2_MOUNT_NO_UID32 0x000200 /* Disable 32-bit UIDs */
+#define EXT2_MOUNT_XATTR_USER 0x004000 /* Extended user attributes */
+#define EXT2_MOUNT_POSIX_ACL 0x008000 /* POSIX Access Control Lists */
+#define EXT2_MOUNT_XIP 0x010000 /* Execute in place */
+#define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */
+#define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */
+#define EXT2_MOUNT_RESERVATION 0x080000 /* Preallocation */
+
+
+#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt
+#define set_opt(o, opt) o |= EXT2_MOUNT_##opt
+#define test_opt(sb, opt) (EXT2_SB(sb)->s_mount_opt & \
+ EXT2_MOUNT_##opt)
+/*
+ * Maximal mount counts between two filesystem checks
+ */
+#define EXT2_DFL_MAX_MNT_COUNT 20 /* Allow 20 mounts */
+#define EXT2_DFL_CHECKINTERVAL 0 /* Don't use interval check */
+
+/*
+ * Behaviour when detecting errors
+ */
+#define EXT2_ERRORS_CONTINUE 1 /* Continue execution */
+#define EXT2_ERRORS_RO 2 /* Remount fs read-only */
+#define EXT2_ERRORS_PANIC 3 /* Panic */
+#define EXT2_ERRORS_DEFAULT EXT2_ERRORS_CONTINUE
+
+/*
+ * Structure of the super block
+ */
+struct ext2_super_block {
+ __le32 s_inodes_count; /* Inodes count */
+ __le32 s_blocks_count; /* Blocks count */
+ __le32 s_r_blocks_count; /* Reserved blocks count */
+ __le32 s_free_blocks_count; /* Free blocks count */
+ __le32 s_free_inodes_count; /* Free inodes count */
+ __le32 s_first_data_block; /* First Data Block */
+ __le32 s_log_block_size; /* Block size */
+ __le32 s_log_frag_size; /* Fragment size */
+ __le32 s_blocks_per_group; /* # Blocks per group */
+ __le32 s_frags_per_group; /* # Fragments per group */
+ __le32 s_inodes_per_group; /* # Inodes per group */
+ __le32 s_mtime; /* Mount time */
+ __le32 s_wtime; /* Write time */
+ __le16 s_mnt_count; /* Mount count */
+ __le16 s_max_mnt_count; /* Maximal mount count */
+ __le16 s_magic; /* Magic signature */
+ __le16 s_state; /* File system state */
+ __le16 s_errors; /* Behaviour when detecting errors */
+ __le16 s_minor_rev_level; /* minor revision level */
+ __le32 s_lastcheck; /* time of last check */
+ __le32 s_checkinterval; /* max. time between checks */
+ __le32 s_creator_os; /* OS */
+ __le32 s_rev_level; /* Revision level */
+ __le16 s_def_resuid; /* Default uid for reserved blocks */
+ __le16 s_def_resgid; /* Default gid for reserved blocks */
+ /*
+ * These fields are for EXT2_DYNAMIC_REV superblocks only.
+ *
+ * Note: the difference between the compatible feature set and
+ * the incompatible feature set is that if there is a bit set
+ * in the incompatible feature set that the kernel doesn't
+ * know about, it should refuse to mount the filesystem.
+ *
+ * e2fsck's requirements are more strict; if it doesn't know
+ * about a feature in either the compatible or incompatible
+ * feature set, it must abort and not try to meddle with
+ * things it doesn't understand...
+ */
+ __le32 s_first_ino; /* First non-reserved inode */
+ __le16 s_inode_size; /* size of inode structure */
+ __le16 s_block_group_nr; /* block group # of this superblock */
+ __le32 s_feature_compat; /* compatible feature set */
+ __le32 s_feature_incompat; /* incompatible feature set */
+ __le32 s_feature_ro_compat; /* readonly-compatible feature set */
+ __u8 s_uuid[16]; /* 128-bit uuid for volume */
+ char s_volume_name[16]; /* volume name */
+ char s_last_mounted[64]; /* directory where last mounted */
+ __le32 s_algorithm_usage_bitmap; /* For compression */
+ /*
+ * Performance hints. Directory preallocation should only
+ * happen if the EXT2_COMPAT_PREALLOC flag is on.
+ */
+ __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/
+ __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */
+ __u16 s_padding1;
+ /*
+ * Journaling support valid if EXT3_FEATURE_COMPAT_HAS_JOURNAL set.
+ */
+ __u8 s_journal_uuid[16]; /* uuid of journal superblock */
+ __u32 s_journal_inum; /* inode number of journal file */
+ __u32 s_journal_dev; /* device number of journal file */
+ __u32 s_last_orphan; /* start of list of inodes to delete */
+ __u32 s_hash_seed[4]; /* HTREE hash seed */
+ __u8 s_def_hash_version; /* Default hash version to use */
+ __u8 s_reserved_char_pad;
+ __u16 s_reserved_word_pad;
+ __le32 s_default_mount_opts;
+ __le32 s_first_meta_bg; /* First metablock block group */
+ __u32 s_reserved[190]; /* Padding to the end of the block */
+};
+
+/*
+ * Codes for operating systems
+ */
+#define EXT2_OS_LINUX 0
+#define EXT2_OS_HURD 1
+#define EXT2_OS_MASIX 2
+#define EXT2_OS_FREEBSD 3
+#define EXT2_OS_LITES 4
+
+/*
+ * Revision levels
+ */
+#define EXT2_GOOD_OLD_REV 0 /* The good old (original) format */
+#define EXT2_DYNAMIC_REV 1 /* V2 format w/ dynamic inode sizes */
+
+#define EXT2_CURRENT_REV EXT2_GOOD_OLD_REV
+#define EXT2_MAX_SUPP_REV EXT2_DYNAMIC_REV
+
+#define EXT2_GOOD_OLD_INODE_SIZE 128
+
+/*
+ * Feature set definitions
+ */
+
+#define EXT2_HAS_COMPAT_FEATURE(sb,mask) \
+ ( EXT2_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) )
+#define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask) \
+ ( EXT2_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) )
+#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \
+ ( EXT2_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) )
+#define EXT2_SET_COMPAT_FEATURE(sb,mask) \
+ EXT2_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask)
+#define EXT2_SET_RO_COMPAT_FEATURE(sb,mask) \
+ EXT2_SB(sb)->s_es->s_feature_ro_compat |= cpu_to_le32(mask)
+#define EXT2_SET_INCOMPAT_FEATURE(sb,mask) \
+ EXT2_SB(sb)->s_es->s_feature_incompat |= cpu_to_le32(mask)
+#define EXT2_CLEAR_COMPAT_FEATURE(sb,mask) \
+ EXT2_SB(sb)->s_es->s_feature_compat &= ~cpu_to_le32(mask)
+#define EXT2_CLEAR_RO_COMPAT_FEATURE(sb,mask) \
+ EXT2_SB(sb)->s_es->s_feature_ro_compat &= ~cpu_to_le32(mask)
+#define EXT2_CLEAR_INCOMPAT_FEATURE(sb,mask) \
+ EXT2_SB(sb)->s_es->s_feature_incompat &= ~cpu_to_le32(mask)
+
+#define EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001
+#define EXT2_FEATURE_COMPAT_IMAGIC_INODES 0x0002
+#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004
+#define EXT2_FEATURE_COMPAT_EXT_ATTR 0x0008
+#define EXT2_FEATURE_COMPAT_RESIZE_INO 0x0010
+#define EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020
+#define EXT2_FEATURE_COMPAT_ANY 0xffffffff
+
+#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001
+#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002
+#define EXT2_FEATURE_RO_COMPAT_BTREE_DIR 0x0004
+#define EXT2_FEATURE_RO_COMPAT_ANY 0xffffffff
+
+#define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001
+#define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002
+#define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004
+#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008
+#define EXT2_FEATURE_INCOMPAT_META_BG 0x0010
+#define EXT2_FEATURE_INCOMPAT_ANY 0xffffffff
+
+#define EXT2_FEATURE_COMPAT_SUPP EXT2_FEATURE_COMPAT_EXT_ATTR
+#define EXT2_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE| \
+ EXT2_FEATURE_INCOMPAT_META_BG)
+#define EXT2_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \
+ EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \
+ EXT2_FEATURE_RO_COMPAT_BTREE_DIR)
+#define EXT2_FEATURE_RO_COMPAT_UNSUPPORTED ~EXT2_FEATURE_RO_COMPAT_SUPP
+#define EXT2_FEATURE_INCOMPAT_UNSUPPORTED ~EXT2_FEATURE_INCOMPAT_SUPP
+
+/*
+ * Default values for user and/or group using reserved blocks
+ */
+#define EXT2_DEF_RESUID 0
+#define EXT2_DEF_RESGID 0
+
+/*
+ * Default mount options
+ */
+#define EXT2_DEFM_DEBUG 0x0001
+#define EXT2_DEFM_BSDGROUPS 0x0002
+#define EXT2_DEFM_XATTR_USER 0x0004
+#define EXT2_DEFM_ACL 0x0008
+#define EXT2_DEFM_UID16 0x0010
+ /* Not used by ext2, but reserved for use by ext3 */
+#define EXT3_DEFM_JMODE 0x0060
+#define EXT3_DEFM_JMODE_DATA 0x0020
+#define EXT3_DEFM_JMODE_ORDERED 0x0040
+#define EXT3_DEFM_JMODE_WBACK 0x0060
+
+/*
+ * Structure of a directory entry
+ */
+#define EXT2_NAME_LEN 255
+
+struct ext2_dir_entry {
+ __le32 inode; /* Inode number */
+ __le16 rec_len; /* Directory entry length */
+ __le16 name_len; /* Name length */
+ char name[EXT2_NAME_LEN]; /* File name */
+};
+
+/*
+ * The new version of the directory entry. Since EXT2 structures are
+ * stored in intel byte order, and the name_len field could never be
+ * bigger than 255 chars, it's safe to reclaim the extra byte for the
+ * file_type field.
+ */
+struct ext2_dir_entry_2 {
+ __le32 inode; /* Inode number */
+ __le16 rec_len; /* Directory entry length */
+ __u8 name_len; /* Name length */
+ __u8 file_type;
+ char name[EXT2_NAME_LEN]; /* File name */
+};
+
+/*
+ * Ext2 directory file types. Only the low 3 bits are used. The
+ * other bits are reserved for now.
+ */
+enum {
+ EXT2_FT_UNKNOWN,
+ EXT2_FT_REG_FILE,
+ EXT2_FT_DIR,
+ EXT2_FT_CHRDEV,
+ EXT2_FT_BLKDEV,
+ EXT2_FT_FIFO,
+ EXT2_FT_SOCK,
+ EXT2_FT_SYMLINK,
+ EXT2_FT_MAX
+};
+
+/*
+ * EXT2_DIR_PAD defines the directory entries boundaries
+ *
+ * NOTE: It must be a multiple of 4
+ */
+#define EXT2_DIR_PAD 4
+#define EXT2_DIR_ROUND (EXT2_DIR_PAD - 1)
+#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \
+ ~EXT2_DIR_ROUND)
+#define EXT2_MAX_REC_LEN ((1<<16)-1)
+
+#endif /* _LINUX_EXT2_FS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fadvise.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fadvise.h
new file mode 100644
index 0000000..e8e7471
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fadvise.h
@@ -0,0 +1,21 @@
+#ifndef FADVISE_H_INCLUDED
+#define FADVISE_H_INCLUDED
+
+#define POSIX_FADV_NORMAL 0 /* No further special treatment. */
+#define POSIX_FADV_RANDOM 1 /* Expect random page references. */
+#define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
+#define POSIX_FADV_WILLNEED 3 /* Will need these pages. */
+
+/*
+ * The advise values for POSIX_FADV_DONTNEED and POSIX_ADV_NOREUSE
+ * for s390-64 differ from the values for the rest of the world.
+ */
+#if defined(__s390x__)
+#define POSIX_FADV_DONTNEED 6 /* Don't need these pages. */
+#define POSIX_FADV_NOREUSE 7 /* Data will be accessed once. */
+#else
+#define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
+#define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
+#endif
+
+#endif /* FADVISE_H_INCLUDED */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/falloc.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/falloc.h
new file mode 100644
index 0000000..8e912ab
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/falloc.h
@@ -0,0 +1,6 @@
+#ifndef _FALLOC_H_
+#define _FALLOC_H_
+
+#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */
+
+#endif /* _FALLOC_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fb.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fb.h
new file mode 100644
index 0000000..ab4b3dc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fb.h
@@ -0,0 +1,393 @@
+#ifndef _LINUX_FB_H
+#define _LINUX_FB_H
+
+#include <linux/types.h>
+#include <linux/i2c.h>
+
+struct dentry;
+
+/* Definitions of frame buffers */
+
+#define FB_MAX 32 /* sufficient for now */
+
+/* ioctls
+ 0x46 is 'F' */
+#define FBIOGET_VSCREENINFO 0x4600
+#define FBIOPUT_VSCREENINFO 0x4601
+#define FBIOGET_FSCREENINFO 0x4602
+#define FBIOGETCMAP 0x4604
+#define FBIOPUTCMAP 0x4605
+#define FBIOPAN_DISPLAY 0x4606
+#define FBIO_CURSOR _IOWR('F', 0x08, struct fb_cursor)
+/* 0x4607-0x460B are defined below */
+/* #define FBIOGET_MONITORSPEC 0x460C */
+/* #define FBIOPUT_MONITORSPEC 0x460D */
+/* #define FBIOSWITCH_MONIBIT 0x460E */
+#define FBIOGET_CON2FBMAP 0x460F
+#define FBIOPUT_CON2FBMAP 0x4610
+#define FBIOBLANK 0x4611 /* arg: 0 or vesa level + 1 */
+#define FBIOGET_VBLANK _IOR('F', 0x12, struct fb_vblank)
+#define FBIO_ALLOC 0x4613
+#define FBIO_FREE 0x4614
+#define FBIOGET_GLYPH 0x4615
+#define FBIOGET_HWCINFO 0x4616
+#define FBIOPUT_MODEINFO 0x4617
+#define FBIOGET_DISPINFO 0x4618
+
+
+#define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */
+#define FB_TYPE_PLANES 1 /* Non interleaved planes */
+#define FB_TYPE_INTERLEAVED_PLANES 2 /* Interleaved planes */
+#define FB_TYPE_TEXT 3 /* Text/attributes */
+#define FB_TYPE_VGA_PLANES 4 /* EGA/VGA planes */
+
+#define FB_AUX_TEXT_MDA 0 /* Monochrome text */
+#define FB_AUX_TEXT_CGA 1 /* CGA/EGA/VGA Color text */
+#define FB_AUX_TEXT_S3_MMIO 2 /* S3 MMIO fasttext */
+#define FB_AUX_TEXT_MGA_STEP16 3 /* MGA Millenium I: text, attr, 14 reserved bytes */
+#define FB_AUX_TEXT_MGA_STEP8 4 /* other MGAs: text, attr, 6 reserved bytes */
+#define FB_AUX_TEXT_SVGA_GROUP 8 /* 8-15: SVGA tileblit compatible modes */
+#define FB_AUX_TEXT_SVGA_MASK 7 /* lower three bits says step */
+#define FB_AUX_TEXT_SVGA_STEP2 8 /* SVGA text mode: text, attr */
+#define FB_AUX_TEXT_SVGA_STEP4 9 /* SVGA text mode: text, attr, 2 reserved bytes */
+#define FB_AUX_TEXT_SVGA_STEP8 10 /* SVGA text mode: text, attr, 6 reserved bytes */
+#define FB_AUX_TEXT_SVGA_STEP16 11 /* SVGA text mode: text, attr, 14 reserved bytes */
+#define FB_AUX_TEXT_SVGA_LAST 15 /* reserved up to 15 */
+
+#define FB_AUX_VGA_PLANES_VGA4 0 /* 16 color planes (EGA/VGA) */
+#define FB_AUX_VGA_PLANES_CFB4 1 /* CFB4 in planes (VGA) */
+#define FB_AUX_VGA_PLANES_CFB8 2 /* CFB8 in planes (VGA) */
+
+#define FB_VISUAL_MONO01 0 /* Monochr. 1=Black 0=White */
+#define FB_VISUAL_MONO10 1 /* Monochr. 1=White 0=Black */
+#define FB_VISUAL_TRUECOLOR 2 /* True color */
+#define FB_VISUAL_PSEUDOCOLOR 3 /* Pseudo color (like atari) */
+#define FB_VISUAL_DIRECTCOLOR 4 /* Direct color */
+#define FB_VISUAL_STATIC_PSEUDOCOLOR 5 /* Pseudo color readonly */
+
+#define FB_ACCEL_NONE 0 /* no hardware accelerator */
+#define FB_ACCEL_ATARIBLITT 1 /* Atari Blitter */
+#define FB_ACCEL_AMIGABLITT 2 /* Amiga Blitter */
+#define FB_ACCEL_S3_TRIO64 3 /* Cybervision64 (S3 Trio64) */
+#define FB_ACCEL_NCR_77C32BLT 4 /* RetinaZ3 (NCR 77C32BLT) */
+#define FB_ACCEL_S3_VIRGE 5 /* Cybervision64/3D (S3 ViRGE) */
+#define FB_ACCEL_ATI_MACH64GX 6 /* ATI Mach 64GX family */
+#define FB_ACCEL_DEC_TGA 7 /* DEC 21030 TGA */
+#define FB_ACCEL_ATI_MACH64CT 8 /* ATI Mach 64CT family */
+#define FB_ACCEL_ATI_MACH64VT 9 /* ATI Mach 64CT family VT class */
+#define FB_ACCEL_ATI_MACH64GT 10 /* ATI Mach 64CT family GT class */
+#define FB_ACCEL_SUN_CREATOR 11 /* Sun Creator/Creator3D */
+#define FB_ACCEL_SUN_CGSIX 12 /* Sun cg6 */
+#define FB_ACCEL_SUN_LEO 13 /* Sun leo/zx */
+#define FB_ACCEL_IMS_TWINTURBO 14 /* IMS Twin Turbo */
+#define FB_ACCEL_3DLABS_PERMEDIA2 15 /* 3Dlabs Permedia 2 */
+#define FB_ACCEL_MATROX_MGA2064W 16 /* Matrox MGA2064W (Millenium) */
+#define FB_ACCEL_MATROX_MGA1064SG 17 /* Matrox MGA1064SG (Mystique) */
+#define FB_ACCEL_MATROX_MGA2164W 18 /* Matrox MGA2164W (Millenium II) */
+#define FB_ACCEL_MATROX_MGA2164W_AGP 19 /* Matrox MGA2164W (Millenium II) */
+#define FB_ACCEL_MATROX_MGAG100 20 /* Matrox G100 (Productiva G100) */
+#define FB_ACCEL_MATROX_MGAG200 21 /* Matrox G200 (Myst, Mill, ...) */
+#define FB_ACCEL_SUN_CG14 22 /* Sun cgfourteen */
+#define FB_ACCEL_SUN_BWTWO 23 /* Sun bwtwo */
+#define FB_ACCEL_SUN_CGTHREE 24 /* Sun cgthree */
+#define FB_ACCEL_SUN_TCX 25 /* Sun tcx */
+#define FB_ACCEL_MATROX_MGAG400 26 /* Matrox G400 */
+#define FB_ACCEL_NV3 27 /* nVidia RIVA 128 */
+#define FB_ACCEL_NV4 28 /* nVidia RIVA TNT */
+#define FB_ACCEL_NV5 29 /* nVidia RIVA TNT2 */
+#define FB_ACCEL_CT_6555x 30 /* C&T 6555x */
+#define FB_ACCEL_3DFX_BANSHEE 31 /* 3Dfx Banshee */
+#define FB_ACCEL_ATI_RAGE128 32 /* ATI Rage128 family */
+#define FB_ACCEL_IGS_CYBER2000 33 /* CyberPro 2000 */
+#define FB_ACCEL_IGS_CYBER2010 34 /* CyberPro 2010 */
+#define FB_ACCEL_IGS_CYBER5000 35 /* CyberPro 5000 */
+#define FB_ACCEL_SIS_GLAMOUR 36 /* SiS 300/630/540 */
+#define FB_ACCEL_3DLABS_PERMEDIA3 37 /* 3Dlabs Permedia 3 */
+#define FB_ACCEL_ATI_RADEON 38 /* ATI Radeon family */
+#define FB_ACCEL_I810 39 /* Intel 810/815 */
+#define FB_ACCEL_SIS_GLAMOUR_2 40 /* SiS 315, 650, 740 */
+#define FB_ACCEL_SIS_XABRE 41 /* SiS 330 ("Xabre") */
+#define FB_ACCEL_I830 42 /* Intel 830M/845G/85x/865G */
+#define FB_ACCEL_NV_10 43 /* nVidia Arch 10 */
+#define FB_ACCEL_NV_20 44 /* nVidia Arch 20 */
+#define FB_ACCEL_NV_30 45 /* nVidia Arch 30 */
+#define FB_ACCEL_NV_40 46 /* nVidia Arch 40 */
+#define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */
+#define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */
+#define FB_ACCEL_OMAP1610 49 /* TI OMAP16xx */
+#define FB_ACCEL_TRIDENT_TGUI 50 /* Trident TGUI */
+#define FB_ACCEL_TRIDENT_3DIMAGE 51 /* Trident 3DImage */
+#define FB_ACCEL_TRIDENT_BLADE3D 52 /* Trident Blade3D */
+#define FB_ACCEL_TRIDENT_BLADEXP 53 /* Trident BladeXP */
+#define FB_ACCEL_CIRRUS_ALPINE 53 /* Cirrus Logic 543x/544x/5480 */
+#define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */
+#define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */
+#define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */
+#define FB_ACCEL_NEOMAGIC_NM2097 93 /* NeoMagic NM2097 */
+#define FB_ACCEL_NEOMAGIC_NM2160 94 /* NeoMagic NM2160 */
+#define FB_ACCEL_NEOMAGIC_NM2200 95 /* NeoMagic NM2200 */
+#define FB_ACCEL_NEOMAGIC_NM2230 96 /* NeoMagic NM2230 */
+#define FB_ACCEL_NEOMAGIC_NM2360 97 /* NeoMagic NM2360 */
+#define FB_ACCEL_NEOMAGIC_NM2380 98 /* NeoMagic NM2380 */
+
+#define FB_ACCEL_SAVAGE4 0x80 /* S3 Savage4 */
+#define FB_ACCEL_SAVAGE3D 0x81 /* S3 Savage3D */
+#define FB_ACCEL_SAVAGE3D_MV 0x82 /* S3 Savage3D-MV */
+#define FB_ACCEL_SAVAGE2000 0x83 /* S3 Savage2000 */
+#define FB_ACCEL_SAVAGE_MX_MV 0x84 /* S3 Savage/MX-MV */
+#define FB_ACCEL_SAVAGE_MX 0x85 /* S3 Savage/MX */
+#define FB_ACCEL_SAVAGE_IX_MV 0x86 /* S3 Savage/IX-MV */
+#define FB_ACCEL_SAVAGE_IX 0x87 /* S3 Savage/IX */
+#define FB_ACCEL_PROSAVAGE_PM 0x88 /* S3 ProSavage PM133 */
+#define FB_ACCEL_PROSAVAGE_KM 0x89 /* S3 ProSavage KM133 */
+#define FB_ACCEL_S3TWISTER_P 0x8a /* S3 Twister */
+#define FB_ACCEL_S3TWISTER_K 0x8b /* S3 TwisterK */
+#define FB_ACCEL_SUPERSAVAGE 0x8c /* S3 Supersavage */
+#define FB_ACCEL_PROSAVAGE_DDR 0x8d /* S3 ProSavage DDR */
+#define FB_ACCEL_PROSAVAGE_DDRK 0x8e /* S3 ProSavage DDR-K */
+
+struct fb_fix_screeninfo {
+ char id[16]; /* identification string eg "TT Builtin" */
+ unsigned long smem_start; /* Start of frame buffer mem */
+ /* (physical address) */
+ __u32 smem_len; /* Length of frame buffer mem */
+ __u32 type; /* see FB_TYPE_* */
+ __u32 type_aux; /* Interleave for interleaved Planes */
+ __u32 visual; /* see FB_VISUAL_* */
+ __u16 xpanstep; /* zero if no hardware panning */
+ __u16 ypanstep; /* zero if no hardware panning */
+ __u16 ywrapstep; /* zero if no hardware ywrap */
+ __u32 line_length; /* length of a line in bytes */
+ unsigned long mmio_start; /* Start of Memory Mapped I/O */
+ /* (physical address) */
+ __u32 mmio_len; /* Length of Memory Mapped I/O */
+ __u32 accel; /* Indicate to driver which */
+ /* specific chip/card we have */
+ __u16 reserved[3]; /* Reserved for future compatibility */
+};
+
+/* Interpretation of offset for color fields: All offsets are from the right,
+ * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you
+ * can use the offset as right argument to <<). A pixel afterwards is a bit
+ * stream and is written to video memory as that unmodified.
+ *
+ * For pseudocolor: offset and length should be the same for all color
+ * components. Offset specifies the position of the least significant bit
+ * of the pallette index in a pixel value. Length indicates the number
+ * of available palette entries (i.e. # of entries = 1 << length).
+ */
+struct fb_bitfield {
+ __u32 offset; /* beginning of bitfield */
+ __u32 length; /* length of bitfield */
+ __u32 msb_right; /* != 0 : Most significant bit is */
+ /* right */
+};
+
+#define FB_NONSTD_HAM 1 /* Hold-And-Modify (HAM) */
+#define FB_NONSTD_REV_PIX_IN_B 2 /* order of pixels in each byte is reversed */
+
+#define FB_ACTIVATE_NOW 0 /* set values immediately (or vbl)*/
+#define FB_ACTIVATE_NXTOPEN 1 /* activate on next open */
+#define FB_ACTIVATE_TEST 2 /* don't set, round up impossible */
+#define FB_ACTIVATE_MASK 15
+ /* values */
+#define FB_ACTIVATE_VBL 16 /* activate values on next vbl */
+#define FB_CHANGE_CMAP_VBL 32 /* change colormap on vbl */
+#define FB_ACTIVATE_ALL 64 /* change all VCs on this fb */
+#define FB_ACTIVATE_FORCE 128 /* force apply even when no change*/
+#define FB_ACTIVATE_INV_MODE 256 /* invalidate videomode */
+
+#define FB_ACCELF_TEXT 1 /* (OBSOLETE) see fb_info.flags and vc_mode */
+
+#define FB_SYNC_HOR_HIGH_ACT 1 /* horizontal sync high active */
+#define FB_SYNC_VERT_HIGH_ACT 2 /* vertical sync high active */
+#define FB_SYNC_EXT 4 /* external sync */
+#define FB_SYNC_COMP_HIGH_ACT 8 /* composite sync high active */
+#define FB_SYNC_BROADCAST 16 /* broadcast video timings */
+ /* vtotal = 144d/288n/576i => PAL */
+ /* vtotal = 121d/242n/484i => NTSC */
+#define FB_SYNC_ON_GREEN 32 /* sync on green */
+
+#define FB_VMODE_NONINTERLACED 0 /* non interlaced */
+#define FB_VMODE_INTERLACED 1 /* interlaced */
+#define FB_VMODE_DOUBLE 2 /* double scan */
+#define FB_VMODE_ODD_FLD_FIRST 4 /* interlaced: top line first */
+#define FB_VMODE_MASK 255
+
+#define FB_VMODE_YWRAP 256 /* ywrap instead of panning */
+#define FB_VMODE_SMOOTH_XPAN 512 /* smooth xpan possible (internally used) */
+#define FB_VMODE_CONUPDATE 512 /* don't update x/yoffset */
+
+/*
+ * Display rotation support
+ */
+#define FB_ROTATE_UR 0
+#define FB_ROTATE_CW 1
+#define FB_ROTATE_UD 2
+#define FB_ROTATE_CCW 3
+
+#define PICOS2KHZ(a) (1000000000UL/(a))
+#define KHZ2PICOS(a) (1000000000UL/(a))
+
+struct fb_var_screeninfo {
+ __u32 xres; /* visible resolution */
+ __u32 yres;
+ __u32 xres_virtual; /* virtual resolution */
+ __u32 yres_virtual;
+ __u32 xoffset; /* offset from virtual to visible */
+ __u32 yoffset; /* resolution */
+
+ __u32 bits_per_pixel; /* guess what */
+ __u32 grayscale; /* != 0 Graylevels instead of colors */
+
+ struct fb_bitfield red; /* bitfield in fb mem if true color, */
+ struct fb_bitfield green; /* else only length is significant */
+ struct fb_bitfield blue;
+ struct fb_bitfield transp; /* transparency */
+
+ __u32 nonstd; /* != 0 Non standard pixel format */
+
+ __u32 activate; /* see FB_ACTIVATE_* */
+
+ __u32 height; /* height of picture in mm */
+ __u32 width; /* width of picture in mm */
+
+ __u32 accel_flags; /* (OBSOLETE) see fb_info.flags */
+
+ /* Timing: All values in pixclocks, except pixclock (of course) */
+ __u32 pixclock; /* pixel clock in ps (pico seconds) */
+ __u32 left_margin; /* time from sync to picture */
+ __u32 right_margin; /* time from picture to sync */
+ __u32 upper_margin; /* time from sync to picture */
+ __u32 lower_margin;
+ __u32 hsync_len; /* length of horizontal sync */
+ __u32 vsync_len; /* length of vertical sync */
+ __u32 sync; /* see FB_SYNC_* */
+ __u32 vmode; /* see FB_VMODE_* */
+ __u32 rotate; /* angle we rotate counter clockwise */
+ __u32 reserved[5]; /* Reserved for future compatibility */
+};
+
+struct fb_cmap {
+ __u32 start; /* First entry */
+ __u32 len; /* Number of entries */
+ __u16 *red; /* Red values */
+ __u16 *green;
+ __u16 *blue;
+ __u16 *transp; /* transparency, can be NULL */
+};
+
+struct fb_con2fbmap {
+ __u32 console;
+ __u32 framebuffer;
+};
+
+/* VESA Blanking Levels */
+#define VESA_NO_BLANKING 0
+#define VESA_VSYNC_SUSPEND 1
+#define VESA_HSYNC_SUSPEND 2
+#define VESA_POWERDOWN 3
+
+
+enum {
+ /* screen: unblanked, hsync: on, vsync: on */
+ FB_BLANK_UNBLANK = VESA_NO_BLANKING,
+
+ /* screen: blanked, hsync: on, vsync: on */
+ FB_BLANK_NORMAL = VESA_NO_BLANKING + 1,
+
+ /* screen: blanked, hsync: on, vsync: off */
+ FB_BLANK_VSYNC_SUSPEND = VESA_VSYNC_SUSPEND + 1,
+
+ /* screen: blanked, hsync: off, vsync: on */
+ FB_BLANK_HSYNC_SUSPEND = VESA_HSYNC_SUSPEND + 1,
+
+ /* screen: blanked, hsync: off, vsync: off */
+ FB_BLANK_POWERDOWN = VESA_POWERDOWN + 1
+};
+
+#define FB_VBLANK_VBLANKING 0x001 /* currently in a vertical blank */
+#define FB_VBLANK_HBLANKING 0x002 /* currently in a horizontal blank */
+#define FB_VBLANK_HAVE_VBLANK 0x004 /* vertical blanks can be detected */
+#define FB_VBLANK_HAVE_HBLANK 0x008 /* horizontal blanks can be detected */
+#define FB_VBLANK_HAVE_COUNT 0x010 /* global retrace counter is available */
+#define FB_VBLANK_HAVE_VCOUNT 0x020 /* the vcount field is valid */
+#define FB_VBLANK_HAVE_HCOUNT 0x040 /* the hcount field is valid */
+#define FB_VBLANK_VSYNCING 0x080 /* currently in a vsync */
+#define FB_VBLANK_HAVE_VSYNC 0x100 /* verical syncs can be detected */
+
+struct fb_vblank {
+ __u32 flags; /* FB_VBLANK flags */
+ __u32 count; /* counter of retraces since boot */
+ __u32 vcount; /* current scanline position */
+ __u32 hcount; /* current scandot position */
+ __u32 reserved[4]; /* reserved for future compatibility */
+};
+
+/* Internal HW accel */
+#define ROP_COPY 0
+#define ROP_XOR 1
+
+struct fb_copyarea {
+ __u32 dx;
+ __u32 dy;
+ __u32 width;
+ __u32 height;
+ __u32 sx;
+ __u32 sy;
+};
+
+struct fb_fillrect {
+ __u32 dx; /* screen-relative */
+ __u32 dy;
+ __u32 width;
+ __u32 height;
+ __u32 color;
+ __u32 rop;
+};
+
+struct fb_image {
+ __u32 dx; /* Where to place image */
+ __u32 dy;
+ __u32 width; /* Size of image */
+ __u32 height;
+ __u32 fg_color; /* Only used when a mono bitmap */
+ __u32 bg_color;
+ __u8 depth; /* Depth of the image */
+ const char *data; /* Pointer to image data */
+ struct fb_cmap cmap; /* color map info */
+};
+
+/*
+ * hardware cursor control
+ */
+
+#define FB_CUR_SETIMAGE 0x01
+#define FB_CUR_SETPOS 0x02
+#define FB_CUR_SETHOT 0x04
+#define FB_CUR_SETCMAP 0x08
+#define FB_CUR_SETSHAPE 0x10
+#define FB_CUR_SETSIZE 0x20
+#define FB_CUR_SETALL 0xFF
+
+struct fbcurpos {
+ __u16 x, y;
+};
+
+struct fb_cursor {
+ __u16 set; /* what to set */
+ __u16 enable; /* cursor on/off */
+ __u16 rop; /* bitop operation */
+ const char *mask; /* cursor mask bits */
+ struct fbcurpos hot; /* cursor hot spot */
+ struct fb_image image; /* Cursor image */
+};
+
+#ifdef CONFIG_FB_BACKLIGHT
+/* Settings for the generic backlight code */
+#define FB_BACKLIGHT_LEVELS 128
+#define FB_BACKLIGHT_MAX 0xFF
+#endif
+
+
+#endif /* _LINUX_FB_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fcntl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fcntl.h
new file mode 100644
index 0000000..a4cd365
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fcntl.h
@@ -0,0 +1,44 @@
+#ifndef _LINUX_FCNTL_H
+#define _LINUX_FCNTL_H
+
+#include <asm/fcntl.h>
+
+#define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0)
+#define F_GETLEASE (F_LINUX_SPECIFIC_BASE + 1)
+
+/*
+ * Cancel a blocking posix lock; internal use only until we expose an
+ * asynchronous lock api to userspace:
+ */
+#define F_CANCELLK (F_LINUX_SPECIFIC_BASE + 5)
+
+/* Create a file descriptor with FD_CLOEXEC set. */
+#define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
+
+/*
+ * Request nofications on a directory.
+ * See below for events that may be notified.
+ */
+#define F_NOTIFY (F_LINUX_SPECIFIC_BASE+2)
+
+/*
+ * Types of directory notifications that may be requested.
+ */
+#define DN_ACCESS 0x00000001 /* File accessed */
+#define DN_MODIFY 0x00000002 /* File modified */
+#define DN_CREATE 0x00000004 /* File created */
+#define DN_DELETE 0x00000008 /* File removed */
+#define DN_RENAME 0x00000010 /* File renamed */
+#define DN_ATTRIB 0x00000020 /* File changed attibutes */
+#define DN_MULTISHOT 0x80000000 /* Don't remove notifier */
+
+#define AT_FDCWD -100 /* Special value used to indicate
+ openat should use the current
+ working directory. */
+#define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */
+#define AT_REMOVEDIR 0x200 /* Remove directory instead of
+ unlinking file. */
+#define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fd.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fd.h
new file mode 100644
index 0000000..d64375a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fd.h
@@ -0,0 +1,380 @@
+#ifndef _LINUX_FD_H
+#define _LINUX_FD_H
+
+#include <linux/ioctl.h>
+
+
+/* New file layout: Now the ioctl definitions immediately follow the
+ * definitions of the structures that they use */
+
+/*
+ * Geometry
+ */
+struct floppy_struct {
+ unsigned int size, /* nr of sectors total */
+ sect, /* sectors per track */
+ head, /* nr of heads */
+ track, /* nr of tracks */
+ stretch; /* bit 0 !=0 means double track steps */
+ /* bit 1 != 0 means swap sides */
+ /* bits 2..9 give the first sector */
+ /* number (the LSB is flipped) */
+#define FD_STRETCH 1
+#define FD_SWAPSIDES 2
+#define FD_ZEROBASED 4
+#define FD_SECTBASEMASK 0x3FC
+#define FD_MKSECTBASE(s) (((s) ^ 1) << 2)
+#define FD_SECTBASE(floppy) ((((floppy)->stretch & FD_SECTBASEMASK) >> 2) ^ 1)
+
+ unsigned char gap, /* gap1 size */
+
+ rate, /* data rate. |= 0x40 for perpendicular */
+#define FD_2M 0x4
+#define FD_SIZECODEMASK 0x38
+#define FD_SIZECODE(floppy) (((((floppy)->rate&FD_SIZECODEMASK)>> 3)+ 2) %8)
+#define FD_SECTSIZE(floppy) ( (floppy)->rate & FD_2M ? \
+ 512 : 128 << FD_SIZECODE(floppy) )
+#define FD_PERP 0x40
+
+ spec1, /* stepping rate, head unload time */
+ fmt_gap; /* gap2 size */
+ const char * name; /* used only for predefined formats */
+};
+
+
+/* commands needing write access have 0x40 set */
+/* commands needing super user access have 0x80 set */
+
+#define FDCLRPRM _IO(2, 0x41)
+/* clear user-defined parameters */
+
+#define FDSETPRM _IOW(2, 0x42, struct floppy_struct)
+#define FDSETMEDIAPRM FDSETPRM
+/* set user-defined parameters for current media */
+
+#define FDDEFPRM _IOW(2, 0x43, struct floppy_struct)
+#define FDGETPRM _IOR(2, 0x04, struct floppy_struct)
+#define FDDEFMEDIAPRM FDDEFPRM
+#define FDGETMEDIAPRM FDGETPRM
+/* set/get disk parameters */
+
+
+#define FDMSGON _IO(2,0x45)
+#define FDMSGOFF _IO(2,0x46)
+/* issue/don't issue kernel messages on media type change */
+
+
+/*
+ * Formatting (obsolete)
+ */
+#define FD_FILL_BYTE 0xF6 /* format fill byte. */
+
+struct format_descr {
+ unsigned int device,head,track;
+};
+
+#define FDFMTBEG _IO(2,0x47)
+/* begin formatting a disk */
+#define FDFMTTRK _IOW(2,0x48, struct format_descr)
+/* format the specified track */
+#define FDFMTEND _IO(2,0x49)
+/* end formatting a disk */
+
+
+/*
+ * Error thresholds
+ */
+struct floppy_max_errors {
+ unsigned int
+ abort, /* number of errors to be reached before aborting */
+ read_track, /* maximal number of errors permitted to read an
+ * entire track at once */
+ reset, /* maximal number of errors before a reset is tried */
+ recal, /* maximal number of errors before a recalibrate is
+ * tried */
+
+ /*
+ * Threshold for reporting FDC errors to the console.
+ * Setting this to zero may flood your screen when using
+ * ultra cheap floppies ;-)
+ */
+ reporting;
+
+};
+
+#define FDSETEMSGTRESH _IO(2,0x4a)
+/* set fdc error reporting threshold */
+
+#define FDFLUSH _IO(2,0x4b)
+/* flush buffers for media; either for verifying media, or for
+ * handling a media change without closing the file descriptor */
+
+#define FDSETMAXERRS _IOW(2, 0x4c, struct floppy_max_errors)
+#define FDGETMAXERRS _IOR(2, 0x0e, struct floppy_max_errors)
+/* set/get abortion and read_track threshold. See also floppy_drive_params
+ * structure */
+
+
+typedef char floppy_drive_name[16];
+#define FDGETDRVTYP _IOR(2, 0x0f, floppy_drive_name)
+/* get drive type: 5 1/4 or 3 1/2 */
+
+
+/*
+ * Drive parameters (user modifiable)
+ */
+struct floppy_drive_params {
+ signed char cmos; /* CMOS type */
+
+ /* Spec2 is (HLD<<1 | ND), where HLD is head load time (1=2ms, 2=4 ms
+ * etc) and ND is set means no DMA. Hardcoded to 6 (HLD=6ms, use DMA).
+ */
+ unsigned long max_dtr; /* Step rate, usec */
+ unsigned long hlt; /* Head load/settle time, msec */
+ unsigned long hut; /* Head unload time (remnant of
+ * 8" drives) */
+ unsigned long srt; /* Step rate, usec */
+
+ unsigned long spinup; /* time needed for spinup (expressed
+ * in jiffies) */
+ unsigned long spindown; /* timeout needed for spindown */
+ unsigned char spindown_offset; /* decides in which position the disk
+ * will stop */
+ unsigned char select_delay; /* delay to wait after select */
+ unsigned char rps; /* rotations per second */
+ unsigned char tracks; /* maximum number of tracks */
+ unsigned long timeout; /* timeout for interrupt requests */
+
+ unsigned char interleave_sect; /* if there are more sectors, use
+ * interleave */
+
+ struct floppy_max_errors max_errors;
+
+ char flags; /* various flags, including ftd_msg */
+/*
+ * Announce successful media type detection and media information loss after
+ * disk changes.
+ * Also used to enable/disable printing of overrun warnings.
+ */
+
+#define FTD_MSG 0x10
+#define FD_BROKEN_DCL 0x20
+#define FD_DEBUG 0x02
+#define FD_SILENT_DCL_CLEAR 0x4
+#define FD_INVERTED_DCL 0x80 /* must be 0x80, because of hardware
+ considerations */
+
+ char read_track; /* use readtrack during probing? */
+
+/*
+ * Auto-detection. Each drive type has eight formats which are
+ * used in succession to try to read the disk. If the FDC cannot lock onto
+ * the disk, the next format is tried. This uses the variable 'probing'.
+ */
+ short autodetect[8]; /* autodetected formats */
+
+ int checkfreq; /* how often should the drive be checked for disk
+ * changes */
+ int native_format; /* native format of this drive */
+};
+
+enum {
+ FD_NEED_TWADDLE_BIT, /* more magic */
+ FD_VERIFY_BIT, /* inquire for write protection */
+ FD_DISK_NEWCHANGE_BIT, /* change detected, and no action undertaken yet
+ * to clear media change status */
+ FD_UNUSED_BIT,
+ FD_DISK_CHANGED_BIT, /* disk has been changed since last i/o */
+ FD_DISK_WRITABLE_BIT /* disk is writable */
+};
+
+#define FDSETDRVPRM _IOW(2, 0x90, struct floppy_drive_params)
+#define FDGETDRVPRM _IOR(2, 0x11, struct floppy_drive_params)
+/* set/get drive parameters */
+
+
+/*
+ * Current drive state (not directly modifiable by user, readonly)
+ */
+struct floppy_drive_struct {
+ unsigned long flags;
+/* values for these flags */
+#define FD_NEED_TWADDLE (1 << FD_NEED_TWADDLE_BIT)
+#define FD_VERIFY (1 << FD_VERIFY_BIT)
+#define FD_DISK_NEWCHANGE (1 << FD_DISK_NEWCHANGE_BIT)
+#define FD_DISK_CHANGED (1 << FD_DISK_CHANGED_BIT)
+#define FD_DISK_WRITABLE (1 << FD_DISK_WRITABLE_BIT)
+
+ unsigned long spinup_date;
+ unsigned long select_date;
+ unsigned long first_read_date;
+ short probed_format;
+ short track; /* current track */
+ short maxblock; /* id of highest block read */
+ short maxtrack; /* id of highest half track read */
+ int generation; /* how many diskchanges? */
+
+/*
+ * (User-provided) media information is _not_ discarded after a media change
+ * if the corresponding keep_data flag is non-zero. Positive values are
+ * decremented after each probe.
+ */
+ int keep_data;
+
+ /* Prevent "aliased" accesses. */
+ int fd_ref;
+ int fd_device;
+ unsigned long last_checked; /* when was the drive last checked for a disk
+ * change? */
+
+ char *dmabuf;
+ int bufblocks;
+};
+
+#define FDGETDRVSTAT _IOR(2, 0x12, struct floppy_drive_struct)
+#define FDPOLLDRVSTAT _IOR(2, 0x13, struct floppy_drive_struct)
+/* get drive state: GET returns the cached state, POLL polls for new state */
+
+
+/*
+ * reset FDC
+ */
+enum reset_mode {
+ FD_RESET_IF_NEEDED, /* reset only if the reset flags is set */
+ FD_RESET_IF_RAWCMD, /* obsolete */
+ FD_RESET_ALWAYS /* reset always */
+};
+#define FDRESET _IO(2, 0x54)
+
+
+/*
+ * FDC state
+ */
+struct floppy_fdc_state {
+ int spec1; /* spec1 value last used */
+ int spec2; /* spec2 value last used */
+ int dtr;
+ unsigned char version; /* FDC version code */
+ unsigned char dor;
+ unsigned long address; /* io address */
+ unsigned int rawcmd:2;
+ unsigned int reset:1;
+ unsigned int need_configure:1;
+ unsigned int perp_mode:2;
+ unsigned int has_fifo:1;
+ unsigned int driver_version; /* version code for floppy driver */
+#define FD_DRIVER_VERSION 0x100
+/* user programs using the floppy API should use floppy_fdc_state to
+ * get the version number of the floppy driver that they are running
+ * on. If this version number is bigger than the one compiled into the
+ * user program (the FD_DRIVER_VERSION define), it should be prepared
+ * to bigger structures
+ */
+
+ unsigned char track[4];
+ /* Position of the heads of the 4 units attached to this FDC,
+ * as stored on the FDC. In the future, the position as stored
+ * on the FDC might not agree with the actual physical
+ * position of these drive heads. By allowing such
+ * disagreement, it will be possible to reset the FDC without
+ * incurring the expensive cost of repositioning all heads.
+ * Right now, these positions are hard wired to 0. */
+
+};
+
+#define FDGETFDCSTAT _IOR(2, 0x15, struct floppy_fdc_state)
+
+
+/*
+ * Asynchronous Write error tracking
+ */
+struct floppy_write_errors {
+ /* Write error logging.
+ *
+ * These fields can be cleared with the FDWERRORCLR ioctl.
+ * Only writes that were attempted but failed due to a physical media
+ * error are logged. write(2) calls that fail and return an error code
+ * to the user process are not counted.
+ */
+
+ unsigned int write_errors; /* number of physical write errors
+ * encountered */
+
+ /* position of first and last write errors */
+ unsigned long first_error_sector;
+ int first_error_generation;
+ unsigned long last_error_sector;
+ int last_error_generation;
+
+ unsigned int badness; /* highest retry count for a read or write
+ * operation */
+};
+
+#define FDWERRORCLR _IO(2, 0x56)
+/* clear write error and badness information */
+#define FDWERRORGET _IOR(2, 0x17, struct floppy_write_errors)
+/* get write error and badness information */
+
+
+/*
+ * Raw commands
+ */
+/* new interface flag: now we can do them in batches */
+#define FDHAVEBATCHEDRAWCMD
+
+struct floppy_raw_cmd {
+ unsigned int flags;
+#define FD_RAW_READ 1
+#define FD_RAW_WRITE 2
+#define FD_RAW_NO_MOTOR 4
+#define FD_RAW_DISK_CHANGE 4 /* out: disk change flag was set */
+#define FD_RAW_INTR 8 /* wait for an interrupt */
+#define FD_RAW_SPIN 0x10 /* spin up the disk for this command */
+#define FD_RAW_NO_MOTOR_AFTER 0x20 /* switch the motor off after command
+ * completion */
+#define FD_RAW_NEED_DISK 0x40 /* this command needs a disk to be present */
+#define FD_RAW_NEED_SEEK 0x80 /* this command uses an implied seek (soft) */
+
+/* more "in" flags */
+#define FD_RAW_MORE 0x100 /* more records follow */
+#define FD_RAW_STOP_IF_FAILURE 0x200 /* stop if we encounter a failure */
+#define FD_RAW_STOP_IF_SUCCESS 0x400 /* stop if command successful */
+#define FD_RAW_SOFTFAILURE 0x800 /* consider the return value for failure
+ * detection too */
+
+/* more "out" flags */
+#define FD_RAW_FAILURE 0x10000 /* command sent to fdc, fdc returned error */
+#define FD_RAW_HARDFAILURE 0x20000 /* fdc had to be reset, or timed out */
+
+ void *data;
+ char *kernel_data; /* location of data buffer in the kernel */
+ struct floppy_raw_cmd *next; /* used for chaining of raw cmd's
+ * within the kernel */
+ long length; /* in: length of dma transfer. out: remaining bytes */
+ long phys_length; /* physical length, if different from dma length */
+ int buffer_length; /* length of allocated buffer */
+
+ unsigned char rate;
+ unsigned char cmd_count;
+ unsigned char cmd[16];
+ unsigned char reply_count;
+ unsigned char reply[16];
+ int track;
+ int resultcode;
+
+ int reserved1;
+ int reserved2;
+};
+
+#define FDRAWCMD _IO(2, 0x58)
+/* send a raw command to the fdc. Structure size not included, because of
+ * batches */
+
+#define FDTWADDLE _IO(2, 0x59)
+/* flicker motor-on bit before reading a sector. Experimental */
+
+
+#define FDEJECT _IO(2, 0x5a)
+/* eject the disk */
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fdreg.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fdreg.h
new file mode 100644
index 0000000..c2eeb63
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fdreg.h
@@ -0,0 +1,137 @@
+#ifndef _LINUX_FDREG_H
+#define _LINUX_FDREG_H
+/*
+ * This file contains some defines for the floppy disk controller.
+ * Various sources. Mostly "IBM Microcomputers: A Programmers
+ * Handbook", Sanches and Canton.
+ */
+
+#ifdef FDPATCHES
+#define FD_IOPORT fdc_state[fdc].address
+#else
+/* It would be a lot saner just to force fdc_state[fdc].address to always
+ be set ! FIXME */
+#define FD_IOPORT 0x3f0
+#endif
+
+/* Fd controller regs. S&C, about page 340 */
+#define FD_STATUS (4 + FD_IOPORT )
+#define FD_DATA (5 + FD_IOPORT )
+
+/* Digital Output Register */
+#define FD_DOR (2 + FD_IOPORT )
+
+/* Digital Input Register (read) */
+#define FD_DIR (7 + FD_IOPORT )
+
+/* Diskette Control Register (write)*/
+#define FD_DCR (7 + FD_IOPORT )
+
+/* Bits of main status register */
+#define STATUS_BUSYMASK 0x0F /* drive busy mask */
+#define STATUS_BUSY 0x10 /* FDC busy */
+#define STATUS_DMA 0x20 /* 0- DMA mode */
+#define STATUS_DIR 0x40 /* 0- cpu->fdc */
+#define STATUS_READY 0x80 /* Data reg ready */
+
+/* Bits of FD_ST0 */
+#define ST0_DS 0x03 /* drive select mask */
+#define ST0_HA 0x04 /* Head (Address) */
+#define ST0_NR 0x08 /* Not Ready */
+#define ST0_ECE 0x10 /* Equipment check error */
+#define ST0_SE 0x20 /* Seek end */
+#define ST0_INTR 0xC0 /* Interrupt code mask */
+
+/* Bits of FD_ST1 */
+#define ST1_MAM 0x01 /* Missing Address Mark */
+#define ST1_WP 0x02 /* Write Protect */
+#define ST1_ND 0x04 /* No Data - unreadable */
+#define ST1_OR 0x10 /* OverRun */
+#define ST1_CRC 0x20 /* CRC error in data or addr */
+#define ST1_EOC 0x80 /* End Of Cylinder */
+
+/* Bits of FD_ST2 */
+#define ST2_MAM 0x01 /* Missing Address Mark (again) */
+#define ST2_BC 0x02 /* Bad Cylinder */
+#define ST2_SNS 0x04 /* Scan Not Satisfied */
+#define ST2_SEH 0x08 /* Scan Equal Hit */
+#define ST2_WC 0x10 /* Wrong Cylinder */
+#define ST2_CRC 0x20 /* CRC error in data field */
+#define ST2_CM 0x40 /* Control Mark = deleted */
+
+/* Bits of FD_ST3 */
+#define ST3_HA 0x04 /* Head (Address) */
+#define ST3_DS 0x08 /* drive is double-sided */
+#define ST3_TZ 0x10 /* Track Zero signal (1=track 0) */
+#define ST3_RY 0x20 /* drive is ready */
+#define ST3_WP 0x40 /* Write Protect */
+#define ST3_FT 0x80 /* Drive Fault */
+
+/* Values for FD_COMMAND */
+#define FD_RECALIBRATE 0x07 /* move to track 0 */
+#define FD_SEEK 0x0F /* seek track */
+#define FD_READ 0xE6 /* read with MT, MFM, SKip deleted */
+#define FD_WRITE 0xC5 /* write with MT, MFM */
+#define FD_SENSEI 0x08 /* Sense Interrupt Status */
+#define FD_SPECIFY 0x03 /* specify HUT etc */
+#define FD_FORMAT 0x4D /* format one track */
+#define FD_VERSION 0x10 /* get version code */
+#define FD_CONFIGURE 0x13 /* configure FIFO operation */
+#define FD_PERPENDICULAR 0x12 /* perpendicular r/w mode */
+#define FD_GETSTATUS 0x04 /* read ST3 */
+#define FD_DUMPREGS 0x0E /* dump the contents of the fdc regs */
+#define FD_READID 0xEA /* prints the header of a sector */
+#define FD_UNLOCK 0x14 /* Fifo config unlock */
+#define FD_LOCK 0x94 /* Fifo config lock */
+#define FD_RSEEK_OUT 0x8f /* seek out (i.e. to lower tracks) */
+#define FD_RSEEK_IN 0xcf /* seek in (i.e. to higher tracks) */
+
+/* the following commands are new in the 82078. They are not used in the
+ * floppy driver, except the first three. These commands may be useful for apps
+ * which use the FDRAWCMD interface. For doc, get the 82078 spec sheets at
+ * http://www-techdoc.intel.com/docs/periph/fd_contr/datasheets/ */
+
+#define FD_PARTID 0x18 /* part id ("extended" version cmd) */
+#define FD_SAVE 0x2e /* save fdc regs for later restore */
+#define FD_DRIVESPEC 0x8e /* drive specification: Access to the
+ * 2 Mbps data transfer rate for tape
+ * drives */
+
+#define FD_RESTORE 0x4e /* later restore */
+#define FD_POWERDOWN 0x27 /* configure FDC's powersave features */
+#define FD_FORMAT_N_WRITE 0xef /* format and write in one go. */
+#define FD_OPTION 0x33 /* ISO format (which is a clean way to
+ * pack more sectors on a track) */
+
+/* DMA commands */
+#define DMA_READ 0x46
+#define DMA_WRITE 0x4A
+
+/* FDC version return types */
+#define FDC_NONE 0x00
+#define FDC_UNKNOWN 0x10 /* DO NOT USE THIS TYPE EXCEPT IF IDENTIFICATION
+ FAILS EARLY */
+#define FDC_8272A 0x20 /* Intel 8272a, NEC 765 */
+#define FDC_765ED 0x30 /* Non-Intel 1MB-compatible FDC, can't detect */
+#define FDC_82072 0x40 /* Intel 82072; 8272a + FIFO + DUMPREGS */
+#define FDC_82072A 0x45 /* 82072A (on Sparcs) */
+#define FDC_82077_ORIG 0x51 /* Original version of 82077AA, sans LOCK */
+#define FDC_82077 0x52 /* 82077AA-1 */
+#define FDC_82078_UNKN 0x5f /* Unknown 82078 variant */
+#define FDC_82078 0x60 /* 44pin 82078 or 64pin 82078SL */
+#define FDC_82078_1 0x61 /* 82078-1 (2Mbps fdc) */
+#define FDC_S82078B 0x62 /* S82078B (first seen on Adaptec AVA-2825 VLB
+ * SCSI/EIDE/Floppy controller) */
+#define FDC_87306 0x63 /* National Semiconductor PC 87306 */
+
+/*
+ * Beware: the fdc type list is roughly sorted by increasing features.
+ * Presence of features is tested by comparing the FDC version id with the
+ * "oldest" version that has the needed feature.
+ * If during FDC detection, an obscure test fails late in the sequence, don't
+ * assign FDC_UNKNOWN. Else the FDC will be treated as a dumb 8272a, or worse.
+ * This is especially true if the tests are unneeded.
+ */
+
+#define FD_RESET_DELAY 20
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fib_rules.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fib_rules.h
new file mode 100644
index 0000000..87b606b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fib_rules.h
@@ -0,0 +1,71 @@
+#ifndef __LINUX_FIB_RULES_H
+#define __LINUX_FIB_RULES_H
+
+#include <linux/types.h>
+#include <linux/rtnetlink.h>
+
+/* rule is permanent, and cannot be deleted */
+#define FIB_RULE_PERMANENT 0x00000001
+#define FIB_RULE_INVERT 0x00000002
+#define FIB_RULE_UNRESOLVED 0x00000004
+#define FIB_RULE_DEV_DETACHED 0x00000008
+
+/* try to find source address in routing lookups */
+#define FIB_RULE_FIND_SADDR 0x00010000
+
+struct fib_rule_hdr
+{
+ __u8 family;
+ __u8 dst_len;
+ __u8 src_len;
+ __u8 tos;
+
+ __u8 table;
+ __u8 res1; /* reserved */
+ __u8 res2; /* reserved */
+ __u8 action;
+
+ __u32 flags;
+};
+
+enum
+{
+ FRA_UNSPEC,
+ FRA_DST, /* destination address */
+ FRA_SRC, /* source address */
+ FRA_IFNAME, /* interface name */
+ FRA_GOTO, /* target to jump to (FR_ACT_GOTO) */
+ FRA_UNUSED2,
+ FRA_PRIORITY, /* priority/preference */
+ FRA_UNUSED3,
+ FRA_UNUSED4,
+ FRA_UNUSED5,
+ FRA_FWMARK, /* mark */
+ FRA_FLOW, /* flow/class id */
+ FRA_UNUSED6,
+ FRA_UNUSED7,
+ FRA_UNUSED8,
+ FRA_TABLE, /* Extended table id */
+ FRA_FWMASK, /* mask for netfilter mark */
+ __FRA_MAX
+};
+
+#define FRA_MAX (__FRA_MAX - 1)
+
+enum
+{
+ FR_ACT_UNSPEC,
+ FR_ACT_TO_TBL, /* Pass to fixed table */
+ FR_ACT_GOTO, /* Jump to another rule */
+ FR_ACT_NOP, /* No operation */
+ FR_ACT_RES3,
+ FR_ACT_RES4,
+ FR_ACT_BLACKHOLE, /* Drop without notification */
+ FR_ACT_UNREACHABLE, /* Drop with ENETUNREACH */
+ FR_ACT_PROHIBIT, /* Drop with EACCES */
+ __FR_ACT_MAX,
+};
+
+#define FR_ACT_MAX (__FR_ACT_MAX - 1)
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fiemap.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fiemap.h
new file mode 100644
index 0000000..934e22d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fiemap.h
@@ -0,0 +1,66 @@
+/*
+ * FS_IOC_FIEMAP ioctl infrastructure.
+ *
+ * Some portions copyright (C) 2007 Cluster File Systems, Inc
+ *
+ * Authors: Mark Fasheh <mfasheh@suse.com>
+ * Kalpak Shah <kalpak.shah@sun.com>
+ * Andreas Dilger <adilger@sun.com>
+ */
+
+#ifndef _LINUX_FIEMAP_H
+#define _LINUX_FIEMAP_H
+
+#include <linux/types.h>
+
+struct fiemap_extent {
+ __u64 fe_logical; /* logical offset in bytes for the start of
+ * the extent from the beginning of the file */
+ __u64 fe_physical; /* physical offset in bytes for the start
+ * of the extent from the beginning of the disk */
+ __u64 fe_length; /* length in bytes for this extent */
+ __u64 fe_reserved64[2];
+ __u32 fe_flags; /* FIEMAP_EXTENT_* flags for this extent */
+ __u32 fe_reserved[3];
+};
+
+struct fiemap {
+ __u64 fm_start; /* logical offset (inclusive) at
+ * which to start mapping (in) */
+ __u64 fm_length; /* logical length of mapping which
+ * userspace wants (in) */
+ __u32 fm_flags; /* FIEMAP_FLAG_* flags for request (in/out) */
+ __u32 fm_mapped_extents;/* number of extents that were mapped (out) */
+ __u32 fm_extent_count; /* size of fm_extents array (in) */
+ __u32 fm_reserved;
+ struct fiemap_extent fm_extents[0]; /* array of mapped extents (out) */
+};
+
+#define FIEMAP_MAX_OFFSET (~0ULL)
+
+#define FIEMAP_FLAG_SYNC 0x00000001 /* sync file data before map */
+#define FIEMAP_FLAG_XATTR 0x00000002 /* map extended attribute tree */
+
+#define FIEMAP_FLAGS_COMPAT (FIEMAP_FLAG_SYNC | FIEMAP_FLAG_XATTR)
+
+#define FIEMAP_EXTENT_LAST 0x00000001 /* Last extent in file. */
+#define FIEMAP_EXTENT_UNKNOWN 0x00000002 /* Data location unknown. */
+#define FIEMAP_EXTENT_DELALLOC 0x00000004 /* Location still pending.
+ * Sets EXTENT_UNKNOWN. */
+#define FIEMAP_EXTENT_ENCODED 0x00000008 /* Data can not be read
+ * while fs is unmounted */
+#define FIEMAP_EXTENT_DATA_ENCRYPTED 0x00000080 /* Data is encrypted by fs.
+ * Sets EXTENT_NO_BYPASS. */
+#define FIEMAP_EXTENT_NOT_ALIGNED 0x00000100 /* Extent offsets may not be
+ * block aligned. */
+#define FIEMAP_EXTENT_DATA_INLINE 0x00000200 /* Data mixed with metadata.
+ * Sets EXTENT_NOT_ALIGNED.*/
+#define FIEMAP_EXTENT_DATA_TAIL 0x00000400 /* Multiple files in block.
+ * Sets EXTENT_NOT_ALIGNED.*/
+#define FIEMAP_EXTENT_UNWRITTEN 0x00000800 /* Space allocated, but
+ * no data (i.e. zero). */
+#define FIEMAP_EXTENT_MERGED 0x00001000 /* File does not natively
+ * support extents. Result
+ * merged for efficiency. */
+
+#endif /* _LINUX_FIEMAP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/filter.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/filter.h
new file mode 100644
index 0000000..0e4dbed
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/filter.h
@@ -0,0 +1,128 @@
+/*
+ * Linux Socket Filter Data Structures
+ */
+
+#ifndef __LINUX_FILTER_H__
+#define __LINUX_FILTER_H__
+
+
+#include <linux/types.h>
+
+
+/*
+ * Current version of the filter code architecture.
+ */
+#define BPF_MAJOR_VERSION 1
+#define BPF_MINOR_VERSION 1
+
+/*
+ * Try and keep these values and structures similar to BSD, especially
+ * the BPF code definitions which need to match so you can share filters
+ */
+
+struct sock_filter /* Filter block */
+{
+ __u16 code; /* Actual filter code */
+ __u8 jt; /* Jump true */
+ __u8 jf; /* Jump false */
+ __u32 k; /* Generic multiuse field */
+};
+
+struct sock_fprog /* Required for SO_ATTACH_FILTER. */
+{
+ unsigned short len; /* Number of filter blocks */
+ struct sock_filter *filter;
+};
+
+/*
+ * Instruction classes
+ */
+
+#define BPF_CLASS(code) ((code) & 0x07)
+#define BPF_LD 0x00
+#define BPF_LDX 0x01
+#define BPF_ST 0x02
+#define BPF_STX 0x03
+#define BPF_ALU 0x04
+#define BPF_JMP 0x05
+#define BPF_RET 0x06
+#define BPF_MISC 0x07
+
+/* ld/ldx fields */
+#define BPF_SIZE(code) ((code) & 0x18)
+#define BPF_W 0x00
+#define BPF_H 0x08
+#define BPF_B 0x10
+#define BPF_MODE(code) ((code) & 0xe0)
+#define BPF_IMM 0x00
+#define BPF_ABS 0x20
+#define BPF_IND 0x40
+#define BPF_MEM 0x60
+#define BPF_LEN 0x80
+#define BPF_MSH 0xa0
+
+/* alu/jmp fields */
+#define BPF_OP(code) ((code) & 0xf0)
+#define BPF_ADD 0x00
+#define BPF_SUB 0x10
+#define BPF_MUL 0x20
+#define BPF_DIV 0x30
+#define BPF_OR 0x40
+#define BPF_AND 0x50
+#define BPF_LSH 0x60
+#define BPF_RSH 0x70
+#define BPF_NEG 0x80
+#define BPF_JA 0x00
+#define BPF_JEQ 0x10
+#define BPF_JGT 0x20
+#define BPF_JGE 0x30
+#define BPF_JSET 0x40
+#define BPF_SRC(code) ((code) & 0x08)
+#define BPF_K 0x00
+#define BPF_X 0x08
+
+/* ret - BPF_K and BPF_X also apply */
+#define BPF_RVAL(code) ((code) & 0x18)
+#define BPF_A 0x10
+
+/* misc */
+#define BPF_MISCOP(code) ((code) & 0xf8)
+#define BPF_TAX 0x00
+#define BPF_TXA 0x80
+
+#ifndef BPF_MAXINSNS
+#define BPF_MAXINSNS 4096
+#endif
+
+/*
+ * Macros for filter block array initializers.
+ */
+#ifndef BPF_STMT
+#define BPF_STMT(code, k) { (unsigned short)(code), 0, 0, k }
+#endif
+#ifndef BPF_JUMP
+#define BPF_JUMP(code, k, jt, jf) { (unsigned short)(code), jt, jf, k }
+#endif
+
+/*
+ * Number of scratch memory words for: BPF_ST and BPF_STX
+ */
+#define BPF_MEMWORDS 16
+
+/* RATIONALE. Negative offsets are invalid in BPF.
+ We use them to reference ancillary data.
+ Unlike introduction new instructions, it does not break
+ existing compilers/optimizers.
+ */
+#define SKF_AD_OFF (-0x1000)
+#define SKF_AD_PROTOCOL 0
+#define SKF_AD_PKTTYPE 4
+#define SKF_AD_IFINDEX 8
+#define SKF_AD_NLATTR 12
+#define SKF_AD_NLATTR_NEST 16
+#define SKF_AD_MAX 20
+#define SKF_NET_OFF (-0x100000)
+#define SKF_LL_OFF (-0x200000)
+
+
+#endif /* __LINUX_FILTER_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/firewire-cdev.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/firewire-cdev.h
new file mode 100644
index 0000000..c6b3ca3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/firewire-cdev.h
@@ -0,0 +1,634 @@
+/*
+ * Char device interface.
+ *
+ * Copyright (C) 2005-2006 Kristian Hoegsberg <krh@bitplanet.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef _LINUX_FIREWIRE_CDEV_H
+#define _LINUX_FIREWIRE_CDEV_H
+
+#include <linux/ioctl.h>
+#include <linux/types.h>
+#include <linux/firewire-constants.h>
+
+#define FW_CDEV_EVENT_BUS_RESET 0x00
+#define FW_CDEV_EVENT_RESPONSE 0x01
+#define FW_CDEV_EVENT_REQUEST 0x02
+#define FW_CDEV_EVENT_ISO_INTERRUPT 0x03
+#define FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED 0x04
+#define FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED 0x05
+
+/**
+ * struct fw_cdev_event_common - Common part of all fw_cdev_event_ types
+ * @closure: For arbitrary use by userspace
+ * @type: Discriminates the fw_cdev_event_ types
+ *
+ * This struct may be used to access generic members of all fw_cdev_event_
+ * types regardless of the specific type.
+ *
+ * Data passed in the @closure field for a request will be returned in the
+ * corresponding event. It is big enough to hold a pointer on all platforms.
+ * The ioctl used to set @closure depends on the @type of event.
+ */
+struct fw_cdev_event_common {
+ __u64 closure;
+ __u32 type;
+};
+
+/**
+ * struct fw_cdev_event_bus_reset - Sent when a bus reset occurred
+ * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_GET_INFO ioctl
+ * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_BUS_RESET
+ * @node_id: New node ID of this node
+ * @local_node_id: Node ID of the local node, i.e. of the controller
+ * @bm_node_id: Node ID of the bus manager
+ * @irm_node_id: Node ID of the iso resource manager
+ * @root_node_id: Node ID of the root node
+ * @generation: New bus generation
+ *
+ * This event is sent when the bus the device belongs to goes through a bus
+ * reset. It provides information about the new bus configuration, such as
+ * new node ID for this device, new root ID, and others.
+ */
+struct fw_cdev_event_bus_reset {
+ __u64 closure;
+ __u32 type;
+ __u32 node_id;
+ __u32 local_node_id;
+ __u32 bm_node_id;
+ __u32 irm_node_id;
+ __u32 root_node_id;
+ __u32 generation;
+};
+
+/**
+ * struct fw_cdev_event_response - Sent when a response packet was received
+ * @closure: See &fw_cdev_event_common;
+ * set by %FW_CDEV_IOC_SEND_REQUEST ioctl
+ * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_RESPONSE
+ * @rcode: Response code returned by the remote node
+ * @length: Data length, i.e. the response's payload size in bytes
+ * @data: Payload data, if any
+ *
+ * This event is sent when the stack receives a response to an outgoing request
+ * sent by %FW_CDEV_IOC_SEND_REQUEST ioctl. The payload data for responses
+ * carrying data (read and lock responses) follows immediately and can be
+ * accessed through the @data field.
+ */
+struct fw_cdev_event_response {
+ __u64 closure;
+ __u32 type;
+ __u32 rcode;
+ __u32 length;
+ __u32 data[0];
+};
+
+/**
+ * struct fw_cdev_event_request - Sent on incoming request to an address region
+ * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_ALLOCATE ioctl
+ * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST
+ * @tcode: Transaction code of the incoming request
+ * @offset: The offset into the 48-bit per-node address space
+ * @handle: Reference to the kernel-side pending request
+ * @length: Data length, i.e. the request's payload size in bytes
+ * @data: Incoming data, if any
+ *
+ * This event is sent when the stack receives an incoming request to an address
+ * region registered using the %FW_CDEV_IOC_ALLOCATE ioctl. The request is
+ * guaranteed to be completely contained in the specified region. Userspace is
+ * responsible for sending the response by %FW_CDEV_IOC_SEND_RESPONSE ioctl,
+ * using the same @handle.
+ *
+ * The payload data for requests carrying data (write and lock requests)
+ * follows immediately and can be accessed through the @data field.
+ */
+struct fw_cdev_event_request {
+ __u64 closure;
+ __u32 type;
+ __u32 tcode;
+ __u64 offset;
+ __u32 handle;
+ __u32 length;
+ __u32 data[0];
+};
+
+/**
+ * struct fw_cdev_event_iso_interrupt - Sent when an iso packet was completed
+ * @closure: See &fw_cdev_event_common;
+ * set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl
+ * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_ISO_INTERRUPT
+ * @cycle: Cycle counter of the interrupt packet
+ * @header_length: Total length of following headers, in bytes
+ * @header: Stripped headers, if any
+ *
+ * This event is sent when the controller has completed an &fw_cdev_iso_packet
+ * with the %FW_CDEV_ISO_INTERRUPT bit set. In the receive case, the headers
+ * stripped of all packets up until and including the interrupt packet are
+ * returned in the @header field. The amount of header data per packet is as
+ * specified at iso context creation by &fw_cdev_create_iso_context.header_size.
+ *
+ * In version 1 of this ABI, header data consisted of the 1394 isochronous
+ * packet header, followed by quadlets from the packet payload if
+ * &fw_cdev_create_iso_context.header_size > 4.
+ *
+ * In version 2 of this ABI, header data consist of the 1394 isochronous
+ * packet header, followed by a timestamp quadlet if
+ * &fw_cdev_create_iso_context.header_size > 4, followed by quadlets from the
+ * packet payload if &fw_cdev_create_iso_context.header_size > 8.
+ *
+ * Behaviour of ver. 1 of this ABI is no longer available since ABI ver. 2.
+ *
+ * Format of 1394 iso packet header: 16 bits len, 2 bits tag, 6 bits channel,
+ * 4 bits tcode, 4 bits sy, in big endian byte order. Format of timestamp:
+ * 16 bits invalid, 3 bits cycleSeconds, 13 bits cycleCount, in big endian byte
+ * order.
+ */
+struct fw_cdev_event_iso_interrupt {
+ __u64 closure;
+ __u32 type;
+ __u32 cycle;
+ __u32 header_length;
+ __u32 header[0];
+};
+
+/**
+ * struct fw_cdev_event_iso_resource - Iso resources were allocated or freed
+ * @closure: See &fw_cdev_event_common;
+ * set by %FW_CDEV_IOC_(DE)ALLOCATE_ISO_RESOURCE(_ONCE) ioctl
+ * @type: %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED or
+ * %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED
+ * @handle: Reference by which an allocated resource can be deallocated
+ * @channel: Isochronous channel which was (de)allocated, if any
+ * @bandwidth: Bandwidth allocation units which were (de)allocated, if any
+ *
+ * An %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED event is sent after an isochronous
+ * resource was allocated at the IRM. The client has to check @channel and
+ * @bandwidth for whether the allocation actually succeeded.
+ *
+ * An %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event is sent after an isochronous
+ * resource was deallocated at the IRM. It is also sent when automatic
+ * reallocation after a bus reset failed.
+ *
+ * @channel is <0 if no channel was (de)allocated or if reallocation failed.
+ * @bandwidth is 0 if no bandwidth was (de)allocated or if reallocation failed.
+ */
+struct fw_cdev_event_iso_resource {
+ __u64 closure;
+ __u32 type;
+ __u32 handle;
+ __s32 channel;
+ __s32 bandwidth;
+};
+
+/**
+ * union fw_cdev_event - Convenience union of fw_cdev_event_ types
+ * @common: Valid for all types
+ * @bus_reset: Valid if @common.type == %FW_CDEV_EVENT_BUS_RESET
+ * @response: Valid if @common.type == %FW_CDEV_EVENT_RESPONSE
+ * @request: Valid if @common.type == %FW_CDEV_EVENT_REQUEST
+ * @iso_interrupt: Valid if @common.type == %FW_CDEV_EVENT_ISO_INTERRUPT
+ * @iso_resource: Valid if @common.type ==
+ * %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED or
+ * %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED
+ *
+ * Convenience union for userspace use. Events could be read(2) into an
+ * appropriately aligned char buffer and then cast to this union for further
+ * processing. Note that for a request, response or iso_interrupt event,
+ * the data[] or header[] may make the size of the full event larger than
+ * sizeof(union fw_cdev_event). Also note that if you attempt to read(2)
+ * an event into a buffer that is not large enough for it, the data that does
+ * not fit will be discarded so that the next read(2) will return a new event.
+ */
+union fw_cdev_event {
+ struct fw_cdev_event_common common;
+ struct fw_cdev_event_bus_reset bus_reset;
+ struct fw_cdev_event_response response;
+ struct fw_cdev_event_request request;
+ struct fw_cdev_event_iso_interrupt iso_interrupt;
+ struct fw_cdev_event_iso_resource iso_resource;
+};
+
+/* available since kernel version 2.6.22 */
+#define FW_CDEV_IOC_GET_INFO _IOWR('#', 0x00, struct fw_cdev_get_info)
+#define FW_CDEV_IOC_SEND_REQUEST _IOW('#', 0x01, struct fw_cdev_send_request)
+#define FW_CDEV_IOC_ALLOCATE _IOWR('#', 0x02, struct fw_cdev_allocate)
+#define FW_CDEV_IOC_DEALLOCATE _IOW('#', 0x03, struct fw_cdev_deallocate)
+#define FW_CDEV_IOC_SEND_RESPONSE _IOW('#', 0x04, struct fw_cdev_send_response)
+#define FW_CDEV_IOC_INITIATE_BUS_RESET _IOW('#', 0x05, struct fw_cdev_initiate_bus_reset)
+#define FW_CDEV_IOC_ADD_DESCRIPTOR _IOWR('#', 0x06, struct fw_cdev_add_descriptor)
+#define FW_CDEV_IOC_REMOVE_DESCRIPTOR _IOW('#', 0x07, struct fw_cdev_remove_descriptor)
+#define FW_CDEV_IOC_CREATE_ISO_CONTEXT _IOWR('#', 0x08, struct fw_cdev_create_iso_context)
+#define FW_CDEV_IOC_QUEUE_ISO _IOWR('#', 0x09, struct fw_cdev_queue_iso)
+#define FW_CDEV_IOC_START_ISO _IOW('#', 0x0a, struct fw_cdev_start_iso)
+#define FW_CDEV_IOC_STOP_ISO _IOW('#', 0x0b, struct fw_cdev_stop_iso)
+
+/* available since kernel version 2.6.24 */
+#define FW_CDEV_IOC_GET_CYCLE_TIMER _IOR('#', 0x0c, struct fw_cdev_get_cycle_timer)
+
+/* available since kernel version 2.6.30 */
+#define FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE _IOWR('#', 0x0d, struct fw_cdev_allocate_iso_resource)
+#define FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE _IOW('#', 0x0e, struct fw_cdev_deallocate)
+#define FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE _IOW('#', 0x0f, struct fw_cdev_allocate_iso_resource)
+#define FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE _IOW('#', 0x10, struct fw_cdev_allocate_iso_resource)
+#define FW_CDEV_IOC_GET_SPEED _IO('#', 0x11) /* returns speed code */
+#define FW_CDEV_IOC_SEND_BROADCAST_REQUEST _IOW('#', 0x12, struct fw_cdev_send_request)
+#define FW_CDEV_IOC_SEND_STREAM_PACKET _IOW('#', 0x13, struct fw_cdev_send_stream_packet)
+
+/*
+ * FW_CDEV_VERSION History
+ * 1 (2.6.22) - initial version
+ * 2 (2.6.30) - changed &fw_cdev_event_iso_interrupt.header if
+ * &fw_cdev_create_iso_context.header_size is 8 or more
+ */
+#define FW_CDEV_VERSION 2
+
+/**
+ * struct fw_cdev_get_info - General purpose information ioctl
+ * @version: The version field is just a running serial number.
+ * We never break backwards compatibility, but may add more
+ * structs and ioctls in later revisions.
+ * @rom_length: If @rom is non-zero, at most rom_length bytes of configuration
+ * ROM will be copied into that user space address. In either
+ * case, @rom_length is updated with the actual length of the
+ * configuration ROM.
+ * @rom: If non-zero, address of a buffer to be filled by a copy of the
+ * device's configuration ROM
+ * @bus_reset: If non-zero, address of a buffer to be filled by a
+ * &struct fw_cdev_event_bus_reset with the current state
+ * of the bus. This does not cause a bus reset to happen.
+ * @bus_reset_closure: Value of &closure in this and subsequent bus reset events
+ * @card: The index of the card this device belongs to
+ */
+struct fw_cdev_get_info {
+ __u32 version;
+ __u32 rom_length;
+ __u64 rom;
+ __u64 bus_reset;
+ __u64 bus_reset_closure;
+ __u32 card;
+};
+
+/**
+ * struct fw_cdev_send_request - Send an asynchronous request packet
+ * @tcode: Transaction code of the request
+ * @length: Length of outgoing payload, in bytes
+ * @offset: 48-bit offset at destination node
+ * @closure: Passed back to userspace in the response event
+ * @data: Userspace pointer to payload
+ * @generation: The bus generation where packet is valid
+ *
+ * Send a request to the device. This ioctl implements all outgoing requests.
+ * Both quadlet and block request specify the payload as a pointer to the data
+ * in the @data field. Once the transaction completes, the kernel writes an
+ * &fw_cdev_event_response event back. The @closure field is passed back to
+ * user space in the response event.
+ */
+struct fw_cdev_send_request {
+ __u32 tcode;
+ __u32 length;
+ __u64 offset;
+ __u64 closure;
+ __u64 data;
+ __u32 generation;
+};
+
+/**
+ * struct fw_cdev_send_response - Send an asynchronous response packet
+ * @rcode: Response code as determined by the userspace handler
+ * @length: Length of outgoing payload, in bytes
+ * @data: Userspace pointer to payload
+ * @handle: The handle from the &fw_cdev_event_request
+ *
+ * Send a response to an incoming request. By setting up an address range using
+ * the %FW_CDEV_IOC_ALLOCATE ioctl, userspace can listen for incoming requests. An
+ * incoming request will generate an %FW_CDEV_EVENT_REQUEST, and userspace must
+ * send a reply using this ioctl. The event has a handle to the kernel-side
+ * pending transaction, which should be used with this ioctl.
+ */
+struct fw_cdev_send_response {
+ __u32 rcode;
+ __u32 length;
+ __u64 data;
+ __u32 handle;
+};
+
+/**
+ * struct fw_cdev_allocate - Allocate a CSR address range
+ * @offset: Start offset of the address range
+ * @closure: To be passed back to userspace in request events
+ * @length: Length of the address range, in bytes
+ * @handle: Handle to the allocation, written by the kernel
+ *
+ * Allocate an address range in the 48-bit address space on the local node
+ * (the controller). This allows userspace to listen for requests with an
+ * offset within that address range. When the kernel receives a request
+ * within the range, an &fw_cdev_event_request event will be written back.
+ * The @closure field is passed back to userspace in the response event.
+ * The @handle field is an out parameter, returning a handle to the allocated
+ * range to be used for later deallocation of the range.
+ */
+struct fw_cdev_allocate {
+ __u64 offset;
+ __u64 closure;
+ __u32 length;
+ __u32 handle;
+};
+
+/**
+ * struct fw_cdev_deallocate - Free a CSR address range or isochronous resource
+ * @handle: Handle to the address range or iso resource, as returned by the
+ * kernel when the range or resource was allocated
+ */
+struct fw_cdev_deallocate {
+ __u32 handle;
+};
+
+#define FW_CDEV_LONG_RESET 0
+#define FW_CDEV_SHORT_RESET 1
+
+/**
+ * struct fw_cdev_initiate_bus_reset - Initiate a bus reset
+ * @type: %FW_CDEV_SHORT_RESET or %FW_CDEV_LONG_RESET
+ *
+ * Initiate a bus reset for the bus this device is on. The bus reset can be
+ * either the original (long) bus reset or the arbitrated (short) bus reset
+ * introduced in 1394a-2000.
+ */
+struct fw_cdev_initiate_bus_reset {
+ __u32 type; /* FW_CDEV_SHORT_RESET or FW_CDEV_LONG_RESET */
+};
+
+/**
+ * struct fw_cdev_add_descriptor - Add contents to the local node's config ROM
+ * @immediate: If non-zero, immediate key to insert before pointer
+ * @key: Upper 8 bits of root directory pointer
+ * @data: Userspace pointer to contents of descriptor block
+ * @length: Length of descriptor block data, in bytes
+ * @handle: Handle to the descriptor, written by the kernel
+ *
+ * Add a descriptor block and optionally a preceding immediate key to the local
+ * node's configuration ROM.
+ *
+ * The @key field specifies the upper 8 bits of the descriptor root directory
+ * pointer and the @data and @length fields specify the contents. The @key
+ * should be of the form 0xXX000000. The offset part of the root directory entry
+ * will be filled in by the kernel.
+ *
+ * If not 0, the @immediate field specifies an immediate key which will be
+ * inserted before the root directory pointer.
+ *
+ * If successful, the kernel adds the descriptor and writes back a handle to the
+ * kernel-side object to be used for later removal of the descriptor block and
+ * immediate key.
+ *
+ * This ioctl affects the configuration ROMs of all local nodes.
+ * The ioctl only succeeds on device files which represent a local node.
+ */
+struct fw_cdev_add_descriptor {
+ __u32 immediate;
+ __u32 key;
+ __u64 data;
+ __u32 length;
+ __u32 handle;
+};
+
+/**
+ * struct fw_cdev_remove_descriptor - Remove contents from the configuration ROM
+ * @handle: Handle to the descriptor, as returned by the kernel when the
+ * descriptor was added
+ *
+ * Remove a descriptor block and accompanying immediate key from the local
+ * nodes' configuration ROMs.
+ */
+struct fw_cdev_remove_descriptor {
+ __u32 handle;
+};
+
+#define FW_CDEV_ISO_CONTEXT_TRANSMIT 0
+#define FW_CDEV_ISO_CONTEXT_RECEIVE 1
+
+/**
+ * struct fw_cdev_create_iso_context - Create a context for isochronous IO
+ * @type: %FW_CDEV_ISO_CONTEXT_TRANSMIT or %FW_CDEV_ISO_CONTEXT_RECEIVE
+ * @header_size: Header size to strip for receive contexts
+ * @channel: Channel to bind to
+ * @speed: Speed to transmit at
+ * @closure: To be returned in &fw_cdev_event_iso_interrupt
+ * @handle: Handle to context, written back by kernel
+ *
+ * Prior to sending or receiving isochronous I/O, a context must be created.
+ * The context records information about the transmit or receive configuration
+ * and typically maps to an underlying hardware resource. A context is set up
+ * for either sending or receiving. It is bound to a specific isochronous
+ * channel.
+ *
+ * If a context was successfully created, the kernel writes back a handle to the
+ * context, which must be passed in for subsequent operations on that context.
+ *
+ * Note that the effect of a @header_size > 4 depends on
+ * &fw_cdev_get_info.version, as documented at &fw_cdev_event_iso_interrupt.
+ */
+struct fw_cdev_create_iso_context {
+ __u32 type;
+ __u32 header_size;
+ __u32 channel;
+ __u32 speed;
+ __u64 closure;
+ __u32 handle;
+};
+
+#define FW_CDEV_ISO_PAYLOAD_LENGTH(v) (v)
+#define FW_CDEV_ISO_INTERRUPT (1 << 16)
+#define FW_CDEV_ISO_SKIP (1 << 17)
+#define FW_CDEV_ISO_SYNC (1 << 17)
+#define FW_CDEV_ISO_TAG(v) ((v) << 18)
+#define FW_CDEV_ISO_SY(v) ((v) << 20)
+#define FW_CDEV_ISO_HEADER_LENGTH(v) ((v) << 24)
+
+/**
+ * struct fw_cdev_iso_packet - Isochronous packet
+ * @control: Contains the header length (8 uppermost bits), the sy field
+ * (4 bits), the tag field (2 bits), a sync flag (1 bit),
+ * a skip flag (1 bit), an interrupt flag (1 bit), and the
+ * payload length (16 lowermost bits)
+ * @header: Header and payload
+ *
+ * &struct fw_cdev_iso_packet is used to describe isochronous packet queues.
+ *
+ * Use the FW_CDEV_ISO_ macros to fill in @control. The sy and tag fields are
+ * specified by IEEE 1394a and IEC 61883.
+ *
+ * FIXME - finish this documentation
+ */
+struct fw_cdev_iso_packet {
+ __u32 control;
+ __u32 header[0];
+};
+
+/**
+ * struct fw_cdev_queue_iso - Queue isochronous packets for I/O
+ * @packets: Userspace pointer to packet data
+ * @data: Pointer into mmap()'ed payload buffer
+ * @size: Size of packet data in bytes
+ * @handle: Isochronous context handle
+ *
+ * Queue a number of isochronous packets for reception or transmission.
+ * This ioctl takes a pointer to an array of &fw_cdev_iso_packet structs,
+ * which describe how to transmit from or receive into a contiguous region
+ * of a mmap()'ed payload buffer. As part of the packet descriptors,
+ * a series of headers can be supplied, which will be prepended to the
+ * payload during DMA.
+ *
+ * The kernel may or may not queue all packets, but will write back updated
+ * values of the @packets, @data and @size fields, so the ioctl can be
+ * resubmitted easily.
+ */
+struct fw_cdev_queue_iso {
+ __u64 packets;
+ __u64 data;
+ __u32 size;
+ __u32 handle;
+};
+
+#define FW_CDEV_ISO_CONTEXT_MATCH_TAG0 1
+#define FW_CDEV_ISO_CONTEXT_MATCH_TAG1 2
+#define FW_CDEV_ISO_CONTEXT_MATCH_TAG2 4
+#define FW_CDEV_ISO_CONTEXT_MATCH_TAG3 8
+#define FW_CDEV_ISO_CONTEXT_MATCH_ALL_TAGS 15
+
+/**
+ * struct fw_cdev_start_iso - Start an isochronous transmission or reception
+ * @cycle: Cycle in which to start I/O. If @cycle is greater than or
+ * equal to 0, the I/O will start on that cycle.
+ * @sync: Determines the value to wait for for receive packets that have
+ * the %FW_CDEV_ISO_SYNC bit set
+ * @tags: Tag filter bit mask. Only valid for isochronous reception.
+ * Determines the tag values for which packets will be accepted.
+ * Use FW_CDEV_ISO_CONTEXT_MATCH_ macros to set @tags.
+ * @handle: Isochronous context handle within which to transmit or receive
+ */
+struct fw_cdev_start_iso {
+ __s32 cycle;
+ __u32 sync;
+ __u32 tags;
+ __u32 handle;
+};
+
+/**
+ * struct fw_cdev_stop_iso - Stop an isochronous transmission or reception
+ * @handle: Handle of isochronous context to stop
+ */
+struct fw_cdev_stop_iso {
+ __u32 handle;
+};
+
+/**
+ * struct fw_cdev_get_cycle_timer - read cycle timer register
+ * @local_time: system time, in microseconds since the Epoch
+ * @cycle_timer: isochronous cycle timer, as per OHCI 1.1 clause 5.13
+ *
+ * The %FW_CDEV_IOC_GET_CYCLE_TIMER ioctl reads the isochronous cycle timer
+ * and also the system clock. This allows to express the receive time of an
+ * isochronous packet as a system time with microsecond accuracy.
+ *
+ * @cycle_timer consists of 7 bits cycleSeconds, 13 bits cycleCount, and
+ * 12 bits cycleOffset, in host byte order.
+ */
+struct fw_cdev_get_cycle_timer {
+ __u64 local_time;
+ __u32 cycle_timer;
+};
+
+/**
+ * struct fw_cdev_allocate_iso_resource - (De)allocate a channel or bandwidth
+ * @closure: Passed back to userspace in correponding iso resource events
+ * @channels: Isochronous channels of which one is to be (de)allocated
+ * @bandwidth: Isochronous bandwidth units to be (de)allocated
+ * @handle: Handle to the allocation, written by the kernel (only valid in
+ * case of %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE ioctls)
+ *
+ * The %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE ioctl initiates allocation of an
+ * isochronous channel and/or of isochronous bandwidth at the isochronous
+ * resource manager (IRM). Only one of the channels specified in @channels is
+ * allocated. An %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED is sent after
+ * communication with the IRM, indicating success or failure in the event data.
+ * The kernel will automatically reallocate the resources after bus resets.
+ * Should a reallocation fail, an %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event
+ * will be sent. The kernel will also automatically deallocate the resources
+ * when the file descriptor is closed.
+ *
+ * The %FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE ioctl can be used to initiate
+ * deallocation of resources which were allocated as described above.
+ * An %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event concludes this operation.
+ *
+ * The %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE ioctl is a variant of allocation
+ * without automatic re- or deallocation.
+ * An %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED event concludes this operation,
+ * indicating success or failure in its data.
+ *
+ * The %FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE ioctl works like
+ * %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE except that resources are freed
+ * instead of allocated.
+ * An %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event concludes this operation.
+ *
+ * To summarize, %FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE allocates iso resources
+ * for the lifetime of the fd or handle.
+ * In contrast, %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE allocates iso resources
+ * for the duration of a bus generation.
+ *
+ * @channels is a host-endian bitfield with the least significant bit
+ * representing channel 0 and the most significant bit representing channel 63:
+ * 1ULL << c for each channel c that is a candidate for (de)allocation.
+ *
+ * @bandwidth is expressed in bandwidth allocation units, i.e. the time to send
+ * one quadlet of data (payload or header data) at speed S1600.
+ */
+struct fw_cdev_allocate_iso_resource {
+ __u64 closure;
+ __u64 channels;
+ __u32 bandwidth;
+ __u32 handle;
+};
+
+/**
+ * struct fw_cdev_send_stream_packet - send an asynchronous stream packet
+ * @length: Length of outgoing payload, in bytes
+ * @tag: Data format tag
+ * @channel: Isochronous channel to transmit to
+ * @sy: Synchronization code
+ * @closure: Passed back to userspace in the response event
+ * @data: Userspace pointer to payload
+ * @generation: The bus generation where packet is valid
+ * @speed: Speed to transmit at
+ *
+ * The %FW_CDEV_IOC_SEND_STREAM_PACKET ioctl sends an asynchronous stream packet
+ * to every device which is listening to the specified channel. The kernel
+ * writes an &fw_cdev_event_response event which indicates success or failure of
+ * the transmission.
+ */
+struct fw_cdev_send_stream_packet {
+ __u32 length;
+ __u32 tag;
+ __u32 channel;
+ __u32 sy;
+ __u64 closure;
+ __u64 data;
+ __u32 generation;
+ __u32 speed;
+};
+
+#endif /* _LINUX_FIREWIRE_CDEV_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/firewire-constants.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/firewire-constants.h
new file mode 100644
index 0000000..b316770
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/firewire-constants.h
@@ -0,0 +1,67 @@
+#ifndef _LINUX_FIREWIRE_CONSTANTS_H
+#define _LINUX_FIREWIRE_CONSTANTS_H
+
+#define TCODE_WRITE_QUADLET_REQUEST 0x0
+#define TCODE_WRITE_BLOCK_REQUEST 0x1
+#define TCODE_WRITE_RESPONSE 0x2
+#define TCODE_READ_QUADLET_REQUEST 0x4
+#define TCODE_READ_BLOCK_REQUEST 0x5
+#define TCODE_READ_QUADLET_RESPONSE 0x6
+#define TCODE_READ_BLOCK_RESPONSE 0x7
+#define TCODE_CYCLE_START 0x8
+#define TCODE_LOCK_REQUEST 0x9
+#define TCODE_STREAM_DATA 0xa
+#define TCODE_LOCK_RESPONSE 0xb
+
+#define EXTCODE_MASK_SWAP 0x1
+#define EXTCODE_COMPARE_SWAP 0x2
+#define EXTCODE_FETCH_ADD 0x3
+#define EXTCODE_LITTLE_ADD 0x4
+#define EXTCODE_BOUNDED_ADD 0x5
+#define EXTCODE_WRAP_ADD 0x6
+#define EXTCODE_VENDOR_DEPENDENT 0x7
+
+/* Juju specific tcodes */
+#define TCODE_LOCK_MASK_SWAP (0x10 | EXTCODE_MASK_SWAP)
+#define TCODE_LOCK_COMPARE_SWAP (0x10 | EXTCODE_COMPARE_SWAP)
+#define TCODE_LOCK_FETCH_ADD (0x10 | EXTCODE_FETCH_ADD)
+#define TCODE_LOCK_LITTLE_ADD (0x10 | EXTCODE_LITTLE_ADD)
+#define TCODE_LOCK_BOUNDED_ADD (0x10 | EXTCODE_BOUNDED_ADD)
+#define TCODE_LOCK_WRAP_ADD (0x10 | EXTCODE_WRAP_ADD)
+#define TCODE_LOCK_VENDOR_DEPENDENT (0x10 | EXTCODE_VENDOR_DEPENDENT)
+
+#define RCODE_COMPLETE 0x0
+#define RCODE_CONFLICT_ERROR 0x4
+#define RCODE_DATA_ERROR 0x5
+#define RCODE_TYPE_ERROR 0x6
+#define RCODE_ADDRESS_ERROR 0x7
+
+/* Juju specific rcodes */
+#define RCODE_SEND_ERROR 0x10
+#define RCODE_CANCELLED 0x11
+#define RCODE_BUSY 0x12
+#define RCODE_GENERATION 0x13
+#define RCODE_NO_ACK 0x14
+
+#define SCODE_100 0x0
+#define SCODE_200 0x1
+#define SCODE_400 0x2
+#define SCODE_800 0x3
+#define SCODE_1600 0x4
+#define SCODE_3200 0x5
+#define SCODE_BETA 0x3
+
+#define ACK_COMPLETE 0x1
+#define ACK_PENDING 0x2
+#define ACK_BUSY_X 0x4
+#define ACK_BUSY_A 0x5
+#define ACK_BUSY_B 0x6
+#define ACK_DATA_ERROR 0xd
+#define ACK_TYPE_ERROR 0xe
+
+#define RETRY_1 0x00
+#define RETRY_X 0x01
+#define RETRY_A 0x02
+#define RETRY_B 0x03
+
+#endif /* _LINUX_FIREWIRE_CONSTANTS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/flat.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/flat.h
new file mode 100644
index 0000000..8351bc7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/flat.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2002-2003 David McCullough <davidm@snapgear.com>
+ * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com>
+ * The Silver Hammer Group, Ltd.
+ *
+ * This file provides the definitions and structures needed to
+ * support uClinux flat-format executables.
+ */
+
+#ifndef _LINUX_FLAT_H
+#define _LINUX_FLAT_H
+
+
+#define FLAT_VERSION 0x00000004L
+
+#ifdef CONFIG_BINFMT_SHARED_FLAT
+#define MAX_SHARED_LIBS (4)
+#else
+#define MAX_SHARED_LIBS (1)
+#endif
+
+/*
+ * To make everything easier to port and manage cross platform
+ * development, all fields are in network byte order.
+ */
+
+struct flat_hdr {
+ char magic[4];
+ unsigned long rev; /* version (as above) */
+ unsigned long entry; /* Offset of first executable instruction
+ with text segment from beginning of file */
+ unsigned long data_start; /* Offset of data segment from beginning of
+ file */
+ unsigned long data_end; /* Offset of end of data segment
+ from beginning of file */
+ unsigned long bss_end; /* Offset of end of bss segment from beginning
+ of file */
+
+ /* (It is assumed that data_end through bss_end forms the bss segment.) */
+
+ unsigned long stack_size; /* Size of stack, in bytes */
+ unsigned long reloc_start; /* Offset of relocation records from
+ beginning of file */
+ unsigned long reloc_count; /* Number of relocation records */
+ unsigned long flags;
+ unsigned long build_date; /* When the program/library was built */
+ unsigned long filler[5]; /* Reservered, set to zero */
+};
+
+#define FLAT_FLAG_RAM 0x0001 /* load program entirely into RAM */
+#define FLAT_FLAG_GOTPIC 0x0002 /* program is PIC with GOT */
+#define FLAT_FLAG_GZIP 0x0004 /* all but the header is compressed */
+#define FLAT_FLAG_GZDATA 0x0008 /* only data/relocs are compressed (for XIP) */
+#define FLAT_FLAG_KTRACE 0x0010 /* output useful kernel trace for debugging */
+
+
+
+#endif /* _LINUX_FLAT_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fs.h
new file mode 100644
index 0000000..6461a29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fs.h
@@ -0,0 +1,356 @@
+#ifndef _LINUX_FS_H
+#define _LINUX_FS_H
+
+/*
+ * This file has definitions for some important file table
+ * structures etc.
+ */
+
+#include <linux/limits.h>
+#include <linux/ioctl.h>
+
+/*
+ * It's silly to have NR_OPEN bigger than NR_FILE, but you can change
+ * the file limit at runtime and only root can increase the per-process
+ * nr_file rlimit, so it's safe to set up a ridiculously high absolute
+ * upper limit on files-per-process.
+ *
+ * Some programs (notably those using select()) may have to be
+ * recompiled to take full advantage of the new limits..
+ */
+
+/* Fixed constants first: */
+#undef NR_OPEN
+#define INR_OPEN 1024 /* Initial setting for nfile rlimits */
+
+#define BLOCK_SIZE_BITS 10
+#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
+
+#define SEEK_SET 0 /* seek relative to beginning of file */
+#define SEEK_CUR 1 /* seek relative to current file position */
+#define SEEK_END 2 /* seek relative to end of file */
+#define SEEK_MAX SEEK_END
+
+/* And dynamically-tunable limits and defaults: */
+struct files_stat_struct {
+ int nr_files; /* read only */
+ int nr_free_files; /* read only */
+ int max_files; /* tunable */
+};
+
+struct inodes_stat_t {
+ int nr_inodes;
+ int nr_unused;
+ int dummy[5]; /* padding for sysctl ABI compatibility */
+};
+
+
+#define NR_FILE 8192 /* this can well be larger on a larger system */
+
+#define MAY_EXEC 1
+#define MAY_WRITE 2
+#define MAY_READ 4
+#define MAY_APPEND 8
+#define MAY_ACCESS 16
+#define MAY_OPEN 32
+
+/*
+ * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond
+ * to O_WRONLY and O_RDWR via the strange trick in __dentry_open()
+ */
+
+/* file is open for reading */
+#define FMODE_READ ((fmode_t)1)
+/* file is open for writing */
+#define FMODE_WRITE ((fmode_t)2)
+/* file is seekable */
+#define FMODE_LSEEK ((fmode_t)4)
+/* file can be accessed using pread */
+#define FMODE_PREAD ((fmode_t)8)
+/* file can be accessed using pwrite */
+#define FMODE_PWRITE ((fmode_t)16)
+/* File is opened for execution with sys_execve / sys_uselib */
+#define FMODE_EXEC ((fmode_t)32)
+/* File is opened with O_NDELAY (only set for block devices) */
+#define FMODE_NDELAY ((fmode_t)64)
+/* File is opened with O_EXCL (only set for block devices) */
+#define FMODE_EXCL ((fmode_t)128)
+/* File is opened using open(.., 3, ..) and is writeable only for ioctls
+ (specialy hack for floppy.c) */
+#define FMODE_WRITE_IOCTL ((fmode_t)256)
+
+/*
+ * Don't update ctime and mtime.
+ *
+ * Currently a special hack for the XFS open_by_handle ioctl, but we'll
+ * hopefully graduate it to a proper O_CMTIME flag supported by open(2) soon.
+ */
+#define FMODE_NOCMTIME ((fmode_t)2048)
+
+/*
+ * The below are the various read and write types that we support. Some of
+ * them include behavioral modifiers that send information down to the
+ * block layer and IO scheduler. Terminology:
+ *
+ * The block layer uses device plugging to defer IO a little bit, in
+ * the hope that we will see more IO very shortly. This increases
+ * coalescing of adjacent IO and thus reduces the number of IOs we
+ * have to send to the device. It also allows for better queuing,
+ * if the IO isn't mergeable. If the caller is going to be waiting
+ * for the IO, then he must ensure that the device is unplugged so
+ * that the IO is dispatched to the driver.
+ *
+ * All IO is handled async in Linux. This is fine for background
+ * writes, but for reads or writes that someone waits for completion
+ * on, we want to notify the block layer and IO scheduler so that they
+ * know about it. That allows them to make better scheduling
+ * decisions. So when the below references 'sync' and 'async', it
+ * is referencing this priority hint.
+ *
+ * With that in mind, the available types are:
+ *
+ * READ A normal read operation. Device will be plugged.
+ * READ_SYNC A synchronous read. Device is not plugged, caller can
+ * immediately wait on this read without caring about
+ * unplugging.
+ * READA Used for read-ahead operations. Lower priority, and the
+ * block layer could (in theory) choose to ignore this
+ * request if it runs into resource problems.
+ * WRITE A normal async write. Device will be plugged.
+ * SWRITE Like WRITE, but a special case for ll_rw_block() that
+ * tells it to lock the buffer first. Normally a buffer
+ * must be locked before doing IO.
+ * WRITE_SYNC_PLUG Synchronous write. Identical to WRITE, but passes down
+ * the hint that someone will be waiting on this IO
+ * shortly. The device must still be unplugged explicitly,
+ * WRITE_SYNC_PLUG does not do this as we could be
+ * submitting more writes before we actually wait on any
+ * of them.
+ * WRITE_SYNC Like WRITE_SYNC_PLUG, but also unplugs the device
+ * immediately after submission. The write equivalent
+ * of READ_SYNC.
+ * WRITE_ODIRECT Special case write for O_DIRECT only.
+ * SWRITE_SYNC
+ * SWRITE_SYNC_PLUG Like WRITE_SYNC/WRITE_SYNC_PLUG, but locks the buffer.
+ * See SWRITE.
+ * WRITE_BARRIER Like WRITE, but tells the block layer that all
+ * previously submitted writes must be safely on storage
+ * before this one is started. Also guarantees that when
+ * this write is complete, it itself is also safely on
+ * storage. Prevents reordering of writes on both sides
+ * of this IO.
+ *
+ */
+#define RW_MASK 1
+#define RWA_MASK 2
+#define READ 0
+#define WRITE 1
+#define READA 2 /* read-ahead - don't block if no resources */
+#define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */
+#define READ_SYNC (READ | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG))
+#define READ_META (READ | (1 << BIO_RW_META))
+#define WRITE_SYNC_PLUG (WRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE))
+#define WRITE_SYNC (WRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG))
+#define WRITE_ODIRECT (WRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG))
+#define SWRITE_SYNC_PLUG \
+ (SWRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE))
+#define SWRITE_SYNC (SWRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG))
+#define WRITE_BARRIER (WRITE | (1 << BIO_RW_BARRIER))
+
+/*
+ * These aren't really reads or writes, they pass down information about
+ * parts of device that are now unused by the file system.
+ */
+#define DISCARD_NOBARRIER (1 << BIO_RW_DISCARD)
+#define DISCARD_BARRIER ((1 << BIO_RW_DISCARD) | (1 << BIO_RW_BARRIER))
+
+#define SEL_IN 1
+#define SEL_OUT 2
+#define SEL_EX 4
+
+/* public flags for file_system_type */
+#define FS_REQUIRES_DEV 1
+#define FS_BINARY_MOUNTDATA 2
+#define FS_HAS_SUBTYPE 4
+#define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */
+#define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move()
+ * during rename() internally.
+ */
+
+/*
+ * These are the fs-independent mount-flags: up to 32 flags are supported
+ */
+#define MS_RDONLY 1 /* Mount read-only */
+#define MS_NOSUID 2 /* Ignore suid and sgid bits */
+#define MS_NODEV 4 /* Disallow access to device special files */
+#define MS_NOEXEC 8 /* Disallow program execution */
+#define MS_SYNCHRONOUS 16 /* Writes are synced at once */
+#define MS_REMOUNT 32 /* Alter flags of a mounted FS */
+#define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */
+#define MS_DIRSYNC 128 /* Directory modifications are synchronous */
+#define MS_NOATIME 1024 /* Do not update access times. */
+#define MS_NODIRATIME 2048 /* Do not update directory access times */
+#define MS_BIND 4096
+#define MS_MOVE 8192
+#define MS_REC 16384
+#define MS_VERBOSE 32768 /* War is peace. Verbosity is silence.
+ MS_VERBOSE is deprecated. */
+#define MS_SILENT 32768
+#define MS_POSIXACL (1<<16) /* VFS does not apply the umask */
+#define MS_UNBINDABLE (1<<17) /* change to unbindable */
+#define MS_PRIVATE (1<<18) /* change to private */
+#define MS_SLAVE (1<<19) /* change to slave */
+#define MS_SHARED (1<<20) /* change to shared */
+#define MS_RELATIME (1<<21) /* Update atime relative to mtime/ctime. */
+#define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */
+#define MS_I_VERSION (1<<23) /* Update inode I_version field */
+#define MS_STRICTATIME (1<<24) /* Always perform atime updates */
+#define MS_ACTIVE (1<<30)
+#define MS_NOUSER (1<<31)
+
+/*
+ * Superblock flags that can be altered by MS_REMOUNT
+ */
+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
+
+/*
+ * Old magic mount flag and mask
+ */
+#define MS_MGC_VAL 0xC0ED0000
+#define MS_MGC_MSK 0xffff0000
+
+/* Inode flags - they have nothing to superblock flags now */
+
+#define S_SYNC 1 /* Writes are synced at once */
+#define S_NOATIME 2 /* Do not update access times */
+#define S_APPEND 4 /* Append-only file */
+#define S_IMMUTABLE 8 /* Immutable file */
+#define S_DEAD 16 /* removed, but still open directory */
+#define S_NOQUOTA 32 /* Inode is not counted to quota */
+#define S_DIRSYNC 64 /* Directory modifications are synchronous */
+#define S_NOCMTIME 128 /* Do not update file c/mtime */
+#define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */
+#define S_PRIVATE 512 /* Inode is fs-internal */
+
+/*
+ * Note that nosuid etc flags are inode-specific: setting some file-system
+ * flags just means all the inodes inherit those flags by default. It might be
+ * possible to override it selectively if you really wanted to with some
+ * ioctl() that is not currently implemented.
+ *
+ * Exception: MS_RDONLY is always applied to the entire file system.
+ *
+ * Unfortunately, it is possible to change a filesystems flags with it mounted
+ * with files in use. This means that all of the inodes will not have their
+ * i_flags updated. Hence, i_flags no longer inherit the superblock mount
+ * flags, so these have to be checked separately. -- rmk@arm.uk.linux.org
+ */
+#define __IS_FLG(inode,flg) ((inode)->i_sb->s_flags & (flg))
+
+#define IS_RDONLY(inode) ((inode)->i_sb->s_flags & MS_RDONLY)
+#define IS_SYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS) || \
+ ((inode)->i_flags & S_SYNC))
+#define IS_DIRSYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \
+ ((inode)->i_flags & (S_SYNC|S_DIRSYNC)))
+#define IS_MANDLOCK(inode) __IS_FLG(inode, MS_MANDLOCK)
+#define IS_NOATIME(inode) __IS_FLG(inode, MS_RDONLY|MS_NOATIME)
+#define IS_I_VERSION(inode) __IS_FLG(inode, MS_I_VERSION)
+
+#define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA)
+#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND)
+#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE)
+#define IS_POSIXACL(inode) __IS_FLG(inode, MS_POSIXACL)
+
+#define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD)
+#define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME)
+#define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE)
+#define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE)
+
+/* the read-only stuff doesn't really belong here, but any other place is
+ probably as bad and I don't want to create yet another include file. */
+
+#define BLKROSET _IO(0x12,93) /* set device read-only (0 = read-write) */
+#define BLKROGET _IO(0x12,94) /* get read-only status (0 = read_write) */
+#define BLKRRPART _IO(0x12,95) /* re-read partition table */
+#define BLKGETSIZE _IO(0x12,96) /* return device size /512 (long *arg) */
+#define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */
+#define BLKRASET _IO(0x12,98) /* set read ahead for block device */
+#define BLKRAGET _IO(0x12,99) /* get current read ahead setting */
+#define BLKFRASET _IO(0x12,100)/* set filesystem (mm/filemap.c) read-ahead */
+#define BLKFRAGET _IO(0x12,101)/* get filesystem (mm/filemap.c) read-ahead */
+#define BLKSECTSET _IO(0x12,102)/* set max sectors per request (ll_rw_blk.c) */
+#define BLKSECTGET _IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */
+#define BLKSSZGET _IO(0x12,104)/* get block device sector size */
+#if 0
+#define BLKPG _IO(0x12,105)/* See blkpg.h */
+
+/* Some people are morons. Do not use sizeof! */
+
+#define BLKELVGET _IOR(0x12,106,size_t)/* elevator get */
+#define BLKELVSET _IOW(0x12,107,size_t)/* elevator set */
+/* This was here just to show that the number is taken -
+ probably all these _IO(0x12,*) ioctls should be moved to blkpg.h. */
+#endif
+/* A jump here: 108-111 have been used for various private purposes. */
+#define BLKBSZGET _IOR(0x12,112,size_t)
+#define BLKBSZSET _IOW(0x12,113,size_t)
+#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (u64 *arg) */
+#define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup)
+#define BLKTRACESTART _IO(0x12,116)
+#define BLKTRACESTOP _IO(0x12,117)
+#define BLKTRACETEARDOWN _IO(0x12,118)
+#define BLKDISCARD _IO(0x12,119)
+
+#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */
+#define FIBMAP _IO(0x00,1) /* bmap access */
+#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */
+#define FIFREEZE _IOWR('X', 119, int) /* Freeze */
+#define FITHAW _IOWR('X', 120, int) /* Thaw */
+
+#define FS_IOC_GETFLAGS _IOR('f', 1, long)
+#define FS_IOC_SETFLAGS _IOW('f', 2, long)
+#define FS_IOC_GETVERSION _IOR('v', 1, long)
+#define FS_IOC_SETVERSION _IOW('v', 2, long)
+#define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap)
+#define FS_IOC32_GETFLAGS _IOR('f', 1, int)
+#define FS_IOC32_SETFLAGS _IOW('f', 2, int)
+#define FS_IOC32_GETVERSION _IOR('v', 1, int)
+#define FS_IOC32_SETVERSION _IOW('v', 2, int)
+
+/*
+ * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)
+ */
+#define FS_SECRM_FL 0x00000001 /* Secure deletion */
+#define FS_UNRM_FL 0x00000002 /* Undelete */
+#define FS_COMPR_FL 0x00000004 /* Compress file */
+#define FS_SYNC_FL 0x00000008 /* Synchronous updates */
+#define FS_IMMUTABLE_FL 0x00000010 /* Immutable file */
+#define FS_APPEND_FL 0x00000020 /* writes to file may only append */
+#define FS_NODUMP_FL 0x00000040 /* do not dump file */
+#define FS_NOATIME_FL 0x00000080 /* do not update atime */
+/* Reserved for compression usage... */
+#define FS_DIRTY_FL 0x00000100
+#define FS_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */
+#define FS_NOCOMP_FL 0x00000400 /* Don't compress */
+#define FS_ECOMPR_FL 0x00000800 /* Compression error */
+/* End compression flags --- maybe not all used */
+#define FS_BTREE_FL 0x00001000 /* btree format dir */
+#define FS_INDEX_FL 0x00001000 /* hash-indexed directory */
+#define FS_IMAGIC_FL 0x00002000 /* AFS directory */
+#define FS_JOURNAL_DATA_FL 0x00004000 /* Reserved for ext3 */
+#define FS_NOTAIL_FL 0x00008000 /* file tail should not be merged */
+#define FS_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */
+#define FS_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/
+#define FS_EXTENT_FL 0x00080000 /* Extents */
+#define FS_DIRECTIO_FL 0x00100000 /* Use direct i/o */
+#define FS_RESERVED_FL 0x80000000 /* reserved for ext2 lib */
+
+#define FS_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */
+#define FS_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */
+
+
+#define SYNC_FILE_RANGE_WAIT_BEFORE 1
+#define SYNC_FILE_RANGE_WRITE 2
+#define SYNC_FILE_RANGE_WAIT_AFTER 4
+
+#endif /* _LINUX_FS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fuse.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fuse.h
new file mode 100644
index 0000000..162e5de
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/fuse.h
@@ -0,0 +1,480 @@
+/*
+ FUSE: Filesystem in Userspace
+ Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
+
+ This program can be distributed under the terms of the GNU GPL.
+ See the file COPYING.
+*/
+
+/*
+ * This file defines the kernel interface of FUSE
+ *
+ * Protocol changelog:
+ *
+ * 7.9:
+ * - new fuse_getattr_in input argument of GETATTR
+ * - add lk_flags in fuse_lk_in
+ * - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in
+ * - add blksize field to fuse_attr
+ * - add file flags field to fuse_read_in and fuse_write_in
+ *
+ * 7.10
+ * - add nonseekable open flag
+ *
+ * 7.11
+ * - add IOCTL message
+ * - add unsolicited notification support
+ * - add POLL message and NOTIFY_POLL notification
+ */
+
+#ifndef _LINUX_FUSE_H
+#define _LINUX_FUSE_H
+
+#include <linux/types.h>
+
+/** Version number of this interface */
+#define FUSE_KERNEL_VERSION 7
+
+/** Minor version number of this interface */
+#define FUSE_KERNEL_MINOR_VERSION 11
+
+/** The node ID of the root inode */
+#define FUSE_ROOT_ID 1
+
+/* Make sure all structures are padded to 64bit boundary, so 32bit
+ userspace works under 64bit kernels */
+
+struct fuse_attr {
+ __u64 ino;
+ __u64 size;
+ __u64 blocks;
+ __u64 atime;
+ __u64 mtime;
+ __u64 ctime;
+ __u32 atimensec;
+ __u32 mtimensec;
+ __u32 ctimensec;
+ __u32 mode;
+ __u32 nlink;
+ __u32 uid;
+ __u32 gid;
+ __u32 rdev;
+ __u32 blksize;
+ __u32 padding;
+};
+
+struct fuse_kstatfs {
+ __u64 blocks;
+ __u64 bfree;
+ __u64 bavail;
+ __u64 files;
+ __u64 ffree;
+ __u32 bsize;
+ __u32 namelen;
+ __u32 frsize;
+ __u32 padding;
+ __u32 spare[6];
+};
+
+struct fuse_file_lock {
+ __u64 start;
+ __u64 end;
+ __u32 type;
+ __u32 pid; /* tgid */
+};
+
+/**
+ * Bitmasks for fuse_setattr_in.valid
+ */
+#define FATTR_MODE (1 << 0)
+#define FATTR_UID (1 << 1)
+#define FATTR_GID (1 << 2)
+#define FATTR_SIZE (1 << 3)
+#define FATTR_ATIME (1 << 4)
+#define FATTR_MTIME (1 << 5)
+#define FATTR_FH (1 << 6)
+#define FATTR_ATIME_NOW (1 << 7)
+#define FATTR_MTIME_NOW (1 << 8)
+#define FATTR_LOCKOWNER (1 << 9)
+
+/**
+ * Flags returned by the OPEN request
+ *
+ * FOPEN_DIRECT_IO: bypass page cache for this open file
+ * FOPEN_KEEP_CACHE: don't invalidate the data cache on open
+ * FOPEN_NONSEEKABLE: the file is not seekable
+ */
+#define FOPEN_DIRECT_IO (1 << 0)
+#define FOPEN_KEEP_CACHE (1 << 1)
+#define FOPEN_NONSEEKABLE (1 << 2)
+
+/**
+ * INIT request/reply flags
+ *
+ * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
+ */
+#define FUSE_ASYNC_READ (1 << 0)
+#define FUSE_POSIX_LOCKS (1 << 1)
+#define FUSE_FILE_OPS (1 << 2)
+#define FUSE_ATOMIC_O_TRUNC (1 << 3)
+#define FUSE_EXPORT_SUPPORT (1 << 4)
+#define FUSE_BIG_WRITES (1 << 5)
+
+/**
+ * Release flags
+ */
+#define FUSE_RELEASE_FLUSH (1 << 0)
+
+/**
+ * Getattr flags
+ */
+#define FUSE_GETATTR_FH (1 << 0)
+
+/**
+ * Lock flags
+ */
+#define FUSE_LK_FLOCK (1 << 0)
+
+/**
+ * WRITE flags
+ *
+ * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed
+ * FUSE_WRITE_LOCKOWNER: lock_owner field is valid
+ */
+#define FUSE_WRITE_CACHE (1 << 0)
+#define FUSE_WRITE_LOCKOWNER (1 << 1)
+
+/**
+ * Read flags
+ */
+#define FUSE_READ_LOCKOWNER (1 << 1)
+
+/**
+ * Ioctl flags
+ *
+ * FUSE_IOCTL_COMPAT: 32bit compat ioctl on 64bit machine
+ * FUSE_IOCTL_UNRESTRICTED: not restricted to well-formed ioctls, retry allowed
+ * FUSE_IOCTL_RETRY: retry with new iovecs
+ *
+ * FUSE_IOCTL_MAX_IOV: maximum of in_iovecs + out_iovecs
+ */
+#define FUSE_IOCTL_COMPAT (1 << 0)
+#define FUSE_IOCTL_UNRESTRICTED (1 << 1)
+#define FUSE_IOCTL_RETRY (1 << 2)
+
+#define FUSE_IOCTL_MAX_IOV 256
+
+/**
+ * Poll flags
+ *
+ * FUSE_POLL_SCHEDULE_NOTIFY: request poll notify
+ */
+#define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
+
+enum fuse_opcode {
+ FUSE_LOOKUP = 1,
+ FUSE_FORGET = 2, /* no reply */
+ FUSE_GETATTR = 3,
+ FUSE_SETATTR = 4,
+ FUSE_READLINK = 5,
+ FUSE_SYMLINK = 6,
+ FUSE_MKNOD = 8,
+ FUSE_MKDIR = 9,
+ FUSE_UNLINK = 10,
+ FUSE_RMDIR = 11,
+ FUSE_RENAME = 12,
+ FUSE_LINK = 13,
+ FUSE_OPEN = 14,
+ FUSE_READ = 15,
+ FUSE_WRITE = 16,
+ FUSE_STATFS = 17,
+ FUSE_RELEASE = 18,
+ FUSE_FSYNC = 20,
+ FUSE_SETXATTR = 21,
+ FUSE_GETXATTR = 22,
+ FUSE_LISTXATTR = 23,
+ FUSE_REMOVEXATTR = 24,
+ FUSE_FLUSH = 25,
+ FUSE_INIT = 26,
+ FUSE_OPENDIR = 27,
+ FUSE_READDIR = 28,
+ FUSE_RELEASEDIR = 29,
+ FUSE_FSYNCDIR = 30,
+ FUSE_GETLK = 31,
+ FUSE_SETLK = 32,
+ FUSE_SETLKW = 33,
+ FUSE_ACCESS = 34,
+ FUSE_CREATE = 35,
+ FUSE_INTERRUPT = 36,
+ FUSE_BMAP = 37,
+ FUSE_DESTROY = 38,
+ FUSE_IOCTL = 39,
+ FUSE_POLL = 40,
+};
+
+enum fuse_notify_code {
+ FUSE_NOTIFY_POLL = 1,
+ FUSE_NOTIFY_CODE_MAX,
+};
+
+/* The read buffer is required to be at least 8k, but may be much larger */
+#define FUSE_MIN_READ_BUFFER 8192
+
+#define FUSE_COMPAT_ENTRY_OUT_SIZE 120
+
+struct fuse_entry_out {
+ __u64 nodeid; /* Inode ID */
+ __u64 generation; /* Inode generation: nodeid:gen must
+ be unique for the fs's lifetime */
+ __u64 entry_valid; /* Cache timeout for the name */
+ __u64 attr_valid; /* Cache timeout for the attributes */
+ __u32 entry_valid_nsec;
+ __u32 attr_valid_nsec;
+ struct fuse_attr attr;
+};
+
+struct fuse_forget_in {
+ __u64 nlookup;
+};
+
+struct fuse_getattr_in {
+ __u32 getattr_flags;
+ __u32 dummy;
+ __u64 fh;
+};
+
+#define FUSE_COMPAT_ATTR_OUT_SIZE 96
+
+struct fuse_attr_out {
+ __u64 attr_valid; /* Cache timeout for the attributes */
+ __u32 attr_valid_nsec;
+ __u32 dummy;
+ struct fuse_attr attr;
+};
+
+struct fuse_mknod_in {
+ __u32 mode;
+ __u32 rdev;
+};
+
+struct fuse_mkdir_in {
+ __u32 mode;
+ __u32 padding;
+};
+
+struct fuse_rename_in {
+ __u64 newdir;
+};
+
+struct fuse_link_in {
+ __u64 oldnodeid;
+};
+
+struct fuse_setattr_in {
+ __u32 valid;
+ __u32 padding;
+ __u64 fh;
+ __u64 size;
+ __u64 lock_owner;
+ __u64 atime;
+ __u64 mtime;
+ __u64 unused2;
+ __u32 atimensec;
+ __u32 mtimensec;
+ __u32 unused3;
+ __u32 mode;
+ __u32 unused4;
+ __u32 uid;
+ __u32 gid;
+ __u32 unused5;
+};
+
+struct fuse_open_in {
+ __u32 flags;
+ __u32 mode;
+};
+
+struct fuse_open_out {
+ __u64 fh;
+ __u32 open_flags;
+ __u32 padding;
+};
+
+struct fuse_release_in {
+ __u64 fh;
+ __u32 flags;
+ __u32 release_flags;
+ __u64 lock_owner;
+};
+
+struct fuse_flush_in {
+ __u64 fh;
+ __u32 unused;
+ __u32 padding;
+ __u64 lock_owner;
+};
+
+struct fuse_read_in {
+ __u64 fh;
+ __u64 offset;
+ __u32 size;
+ __u32 read_flags;
+ __u64 lock_owner;
+ __u32 flags;
+ __u32 padding;
+};
+
+#define FUSE_COMPAT_WRITE_IN_SIZE 24
+
+struct fuse_write_in {
+ __u64 fh;
+ __u64 offset;
+ __u32 size;
+ __u32 write_flags;
+ __u64 lock_owner;
+ __u32 flags;
+ __u32 padding;
+};
+
+struct fuse_write_out {
+ __u32 size;
+ __u32 padding;
+};
+
+#define FUSE_COMPAT_STATFS_SIZE 48
+
+struct fuse_statfs_out {
+ struct fuse_kstatfs st;
+};
+
+struct fuse_fsync_in {
+ __u64 fh;
+ __u32 fsync_flags;
+ __u32 padding;
+};
+
+struct fuse_setxattr_in {
+ __u32 size;
+ __u32 flags;
+};
+
+struct fuse_getxattr_in {
+ __u32 size;
+ __u32 padding;
+};
+
+struct fuse_getxattr_out {
+ __u32 size;
+ __u32 padding;
+};
+
+struct fuse_lk_in {
+ __u64 fh;
+ __u64 owner;
+ struct fuse_file_lock lk;
+ __u32 lk_flags;
+ __u32 padding;
+};
+
+struct fuse_lk_out {
+ struct fuse_file_lock lk;
+};
+
+struct fuse_access_in {
+ __u32 mask;
+ __u32 padding;
+};
+
+struct fuse_init_in {
+ __u32 major;
+ __u32 minor;
+ __u32 max_readahead;
+ __u32 flags;
+};
+
+struct fuse_init_out {
+ __u32 major;
+ __u32 minor;
+ __u32 max_readahead;
+ __u32 flags;
+ __u32 unused;
+ __u32 max_write;
+};
+
+struct fuse_interrupt_in {
+ __u64 unique;
+};
+
+struct fuse_bmap_in {
+ __u64 block;
+ __u32 blocksize;
+ __u32 padding;
+};
+
+struct fuse_bmap_out {
+ __u64 block;
+};
+
+struct fuse_ioctl_in {
+ __u64 fh;
+ __u32 flags;
+ __u32 cmd;
+ __u64 arg;
+ __u32 in_size;
+ __u32 out_size;
+};
+
+struct fuse_ioctl_out {
+ __s32 result;
+ __u32 flags;
+ __u32 in_iovs;
+ __u32 out_iovs;
+};
+
+struct fuse_poll_in {
+ __u64 fh;
+ __u64 kh;
+ __u32 flags;
+ __u32 padding;
+};
+
+struct fuse_poll_out {
+ __u32 revents;
+ __u32 padding;
+};
+
+struct fuse_notify_poll_wakeup_out {
+ __u64 kh;
+};
+
+struct fuse_in_header {
+ __u32 len;
+ __u32 opcode;
+ __u64 unique;
+ __u64 nodeid;
+ __u32 uid;
+ __u32 gid;
+ __u32 pid;
+ __u32 padding;
+};
+
+struct fuse_out_header {
+ __u32 len;
+ __s32 error;
+ __u64 unique;
+};
+
+struct fuse_dirent {
+ __u64 ino;
+ __u64 off;
+ __u32 namelen;
+ __u32 type;
+ char name[0];
+};
+
+#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
+#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1))
+#define FUSE_DIRENT_SIZE(d) \
+ FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
+
+#endif /* _LINUX_FUSE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/futex.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/futex.h
new file mode 100644
index 0000000..b559b66
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/futex.h
@@ -0,0 +1,151 @@
+#ifndef _LINUX_FUTEX_H
+#define _LINUX_FUTEX_H
+
+
+#include <linux/types.h>
+
+struct inode;
+struct mm_struct;
+struct task_struct;
+union ktime;
+
+/* Second argument to futex syscall */
+
+
+#define FUTEX_WAIT 0
+#define FUTEX_WAKE 1
+#define FUTEX_FD 2
+#define FUTEX_REQUEUE 3
+#define FUTEX_CMP_REQUEUE 4
+#define FUTEX_WAKE_OP 5
+#define FUTEX_LOCK_PI 6
+#define FUTEX_UNLOCK_PI 7
+#define FUTEX_TRYLOCK_PI 8
+#define FUTEX_WAIT_BITSET 9
+#define FUTEX_WAKE_BITSET 10
+
+#define FUTEX_PRIVATE_FLAG 128
+#define FUTEX_CLOCK_REALTIME 256
+#define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)
+
+#define FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG)
+#define FUTEX_WAKE_PRIVATE (FUTEX_WAKE | FUTEX_PRIVATE_FLAG)
+#define FUTEX_REQUEUE_PRIVATE (FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG)
+#define FUTEX_CMP_REQUEUE_PRIVATE (FUTEX_CMP_REQUEUE | FUTEX_PRIVATE_FLAG)
+#define FUTEX_WAKE_OP_PRIVATE (FUTEX_WAKE_OP | FUTEX_PRIVATE_FLAG)
+#define FUTEX_LOCK_PI_PRIVATE (FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG)
+#define FUTEX_UNLOCK_PI_PRIVATE (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG)
+#define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)
+#define FUTEX_WAIT_BITSET_PRIVATE (FUTEX_WAIT_BITS | FUTEX_PRIVATE_FLAG)
+#define FUTEX_WAKE_BITSET_PRIVATE (FUTEX_WAKE_BITS | FUTEX_PRIVATE_FLAG)
+
+/*
+ * Support for robust futexes: the kernel cleans up held futexes at
+ * thread exit time.
+ */
+
+/*
+ * Per-lock list entry - embedded in user-space locks, somewhere close
+ * to the futex field. (Note: user-space uses a double-linked list to
+ * achieve O(1) list add and remove, but the kernel only needs to know
+ * about the forward link)
+ *
+ * NOTE: this structure is part of the syscall ABI, and must not be
+ * changed.
+ */
+struct robust_list {
+ struct robust_list *next;
+};
+
+/*
+ * Per-thread list head:
+ *
+ * NOTE: this structure is part of the syscall ABI, and must only be
+ * changed if the change is first communicated with the glibc folks.
+ * (When an incompatible change is done, we'll increase the structure
+ * size, which glibc will detect)
+ */
+struct robust_list_head {
+ /*
+ * The head of the list. Points back to itself if empty:
+ */
+ struct robust_list list;
+
+ /*
+ * This relative offset is set by user-space, it gives the kernel
+ * the relative position of the futex field to examine. This way
+ * we keep userspace flexible, to freely shape its data-structure,
+ * without hardcoding any particular offset into the kernel:
+ */
+ long futex_offset;
+
+ /*
+ * The death of the thread may race with userspace setting
+ * up a lock's links. So to handle this race, userspace first
+ * sets this field to the address of the to-be-taken lock,
+ * then does the lock acquire, and then adds itself to the
+ * list, and then clears this field. Hence the kernel will
+ * always have full knowledge of all locks that the thread
+ * _might_ have taken. We check the owner TID in any case,
+ * so only truly owned locks will be handled.
+ */
+ struct robust_list *list_op_pending;
+};
+
+/*
+ * Are there any waiters for this robust futex:
+ */
+#define FUTEX_WAITERS 0x80000000
+
+/*
+ * The kernel signals via this bit that a thread holding a futex
+ * has exited without unlocking the futex. The kernel also does
+ * a FUTEX_WAKE on such futexes, after setting the bit, to wake
+ * up any possible waiters:
+ */
+#define FUTEX_OWNER_DIED 0x40000000
+
+/*
+ * The rest of the robust-futex field is for the TID:
+ */
+#define FUTEX_TID_MASK 0x3fffffff
+
+/*
+ * This limit protects against a deliberately circular list.
+ * (Not worth introducing an rlimit for it)
+ */
+#define ROBUST_LIST_LIMIT 2048
+
+/*
+ * bitset with all bits set for the FUTEX_xxx_BITSET OPs to request a
+ * match of any bit.
+ */
+#define FUTEX_BITSET_MATCH_ANY 0xffffffff
+
+
+#define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */
+#define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */
+#define FUTEX_OP_OR 2 /* *(int *)UADDR2 |= OPARG; */
+#define FUTEX_OP_ANDN 3 /* *(int *)UADDR2 &= ~OPARG; */
+#define FUTEX_OP_XOR 4 /* *(int *)UADDR2 ^= OPARG; */
+
+#define FUTEX_OP_OPARG_SHIFT 8 /* Use (1 << OPARG) instead of OPARG. */
+
+#define FUTEX_OP_CMP_EQ 0 /* if (oldval == CMPARG) wake */
+#define FUTEX_OP_CMP_NE 1 /* if (oldval != CMPARG) wake */
+#define FUTEX_OP_CMP_LT 2 /* if (oldval < CMPARG) wake */
+#define FUTEX_OP_CMP_LE 3 /* if (oldval <= CMPARG) wake */
+#define FUTEX_OP_CMP_GT 4 /* if (oldval > CMPARG) wake */
+#define FUTEX_OP_CMP_GE 5 /* if (oldval >= CMPARG) wake */
+
+/* FUTEX_WAKE_OP will perform atomically
+ int oldval = *(int *)UADDR2;
+ *(int *)UADDR2 = oldval OP OPARG;
+ if (oldval CMP CMPARG)
+ wake UADDR2; */
+
+#define FUTEX_OP(op, oparg, cmp, cmparg) \
+ (((op & 0xf) << 28) | ((cmp & 0xf) << 24) \
+ | ((oparg & 0xfff) << 12) | (cmparg & 0xfff))
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/gameport.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/gameport.h
new file mode 100644
index 0000000..1c33c4a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/gameport.h
@@ -0,0 +1,28 @@
+#ifndef _GAMEPORT_H
+#define _GAMEPORT_H
+
+/*
+ * Copyright (c) 1999-2002 Vojtech Pavlik
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+
+
+#define GAMEPORT_MODE_DISABLED 0
+#define GAMEPORT_MODE_RAW 1
+#define GAMEPORT_MODE_COOKED 2
+
+#define GAMEPORT_ID_VENDOR_ANALOG 0x0001
+#define GAMEPORT_ID_VENDOR_MADCATZ 0x0002
+#define GAMEPORT_ID_VENDOR_LOGITECH 0x0003
+#define GAMEPORT_ID_VENDOR_CREATIVE 0x0004
+#define GAMEPORT_ID_VENDOR_GENIUS 0x0005
+#define GAMEPORT_ID_VENDOR_INTERACT 0x0006
+#define GAMEPORT_ID_VENDOR_MICROSOFT 0x0007
+#define GAMEPORT_ID_VENDOR_THRUSTMASTER 0x0008
+#define GAMEPORT_ID_VENDOR_GRAVIS 0x0009
+#define GAMEPORT_ID_VENDOR_GUILLEMOT 0x000a
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/gen_stats.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/gen_stats.h
new file mode 100644
index 0000000..0ffa41d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/gen_stats.h
@@ -0,0 +1,67 @@
+#ifndef __LINUX_GEN_STATS_H
+#define __LINUX_GEN_STATS_H
+
+#include <linux/types.h>
+
+enum {
+ TCA_STATS_UNSPEC,
+ TCA_STATS_BASIC,
+ TCA_STATS_RATE_EST,
+ TCA_STATS_QUEUE,
+ TCA_STATS_APP,
+ __TCA_STATS_MAX,
+};
+#define TCA_STATS_MAX (__TCA_STATS_MAX - 1)
+
+/**
+ * struct gnet_stats_basic - byte/packet throughput statistics
+ * @bytes: number of seen bytes
+ * @packets: number of seen packets
+ */
+struct gnet_stats_basic
+{
+ __u64 bytes;
+ __u32 packets;
+} __attribute__ ((packed));
+
+/**
+ * struct gnet_stats_rate_est - rate estimator
+ * @bps: current byte rate
+ * @pps: current packet rate
+ */
+struct gnet_stats_rate_est
+{
+ __u32 bps;
+ __u32 pps;
+};
+
+/**
+ * struct gnet_stats_queue - queuing statistics
+ * @qlen: queue length
+ * @backlog: backlog size of queue
+ * @drops: number of dropped packets
+ * @requeues: number of requeues
+ * @overlimits: number of enqueues over the limit
+ */
+struct gnet_stats_queue
+{
+ __u32 qlen;
+ __u32 backlog;
+ __u32 drops;
+ __u32 requeues;
+ __u32 overlimits;
+};
+
+/**
+ * struct gnet_estimator - rate estimator configuration
+ * @interval: sampling period
+ * @ewma_log: the log of measurement window weight
+ */
+struct gnet_estimator
+{
+ signed char interval;
+ unsigned char ewma_log;
+};
+
+
+#endif /* __LINUX_GEN_STATS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/generic_serial.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/generic_serial.h
new file mode 100644
index 0000000..9f596b4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/generic_serial.h
@@ -0,0 +1,36 @@
+/*
+ * generic_serial.h
+ *
+ * Copyright (C) 1998 R.E.Wolff@BitWizard.nl
+ *
+ * written for the SX serial driver.
+ * Contains the code that should be shared over all the serial drivers.
+ *
+ * Version 0.1 -- December, 1998.
+ */
+
+#ifndef GENERIC_SERIAL_H
+#define GENERIC_SERIAL_H
+
+
+/* Flags */
+/* Warning: serial.h defines some ASYNC_ flags, they say they are "only"
+ used in serial.c, but they are also used in all other serial drivers.
+ Make sure they don't clash with these here... */
+#define GS_TX_INTEN 0x00800000
+#define GS_RX_INTEN 0x00400000
+#define GS_ACTIVE 0x00200000
+
+
+
+#define GS_TYPE_NORMAL 1
+
+#define GS_DEBUG_FLUSH 0x00000001
+#define GS_DEBUG_BTR 0x00000002
+#define GS_DEBUG_TERMIOS 0x00000004
+#define GS_DEBUG_STUFF 0x00000008
+#define GS_DEBUG_CLOSE 0x00000010
+#define GS_DEBUG_FLOW 0x00000020
+#define GS_DEBUG_WRITE 0x00000040
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/genetlink.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/genetlink.h
new file mode 100644
index 0000000..b834ef6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/genetlink.h
@@ -0,0 +1,83 @@
+#ifndef __LINUX_GENERIC_NETLINK_H
+#define __LINUX_GENERIC_NETLINK_H
+
+#include <linux/types.h>
+#include <linux/netlink.h>
+
+#define GENL_NAMSIZ 16 /* length of family name */
+
+#define GENL_MIN_ID NLMSG_MIN_TYPE
+#define GENL_MAX_ID 1023
+
+struct genlmsghdr {
+ __u8 cmd;
+ __u8 version;
+ __u16 reserved;
+};
+
+#define GENL_HDRLEN NLMSG_ALIGN(sizeof(struct genlmsghdr))
+
+#define GENL_ADMIN_PERM 0x01
+#define GENL_CMD_CAP_DO 0x02
+#define GENL_CMD_CAP_DUMP 0x04
+#define GENL_CMD_CAP_HASPOL 0x08
+
+/*
+ * List of reserved static generic netlink identifiers:
+ */
+#define GENL_ID_GENERATE 0
+#define GENL_ID_CTRL NLMSG_MIN_TYPE
+
+/**************************************************************************
+ * Controller
+ **************************************************************************/
+
+enum {
+ CTRL_CMD_UNSPEC,
+ CTRL_CMD_NEWFAMILY,
+ CTRL_CMD_DELFAMILY,
+ CTRL_CMD_GETFAMILY,
+ CTRL_CMD_NEWOPS,
+ CTRL_CMD_DELOPS,
+ CTRL_CMD_GETOPS,
+ CTRL_CMD_NEWMCAST_GRP,
+ CTRL_CMD_DELMCAST_GRP,
+ CTRL_CMD_GETMCAST_GRP, /* unused */
+ __CTRL_CMD_MAX,
+};
+
+#define CTRL_CMD_MAX (__CTRL_CMD_MAX - 1)
+
+enum {
+ CTRL_ATTR_UNSPEC,
+ CTRL_ATTR_FAMILY_ID,
+ CTRL_ATTR_FAMILY_NAME,
+ CTRL_ATTR_VERSION,
+ CTRL_ATTR_HDRSIZE,
+ CTRL_ATTR_MAXATTR,
+ CTRL_ATTR_OPS,
+ CTRL_ATTR_MCAST_GROUPS,
+ __CTRL_ATTR_MAX,
+};
+
+#define CTRL_ATTR_MAX (__CTRL_ATTR_MAX - 1)
+
+enum {
+ CTRL_ATTR_OP_UNSPEC,
+ CTRL_ATTR_OP_ID,
+ CTRL_ATTR_OP_FLAGS,
+ __CTRL_ATTR_OP_MAX,
+};
+
+#define CTRL_ATTR_OP_MAX (__CTRL_ATTR_OP_MAX - 1)
+
+enum {
+ CTRL_ATTR_MCAST_GRP_UNSPEC,
+ CTRL_ATTR_MCAST_GRP_NAME,
+ CTRL_ATTR_MCAST_GRP_ID,
+ __CTRL_ATTR_MCAST_GRP_MAX,
+};
+
+#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
+
+#endif /* __LINUX_GENERIC_NETLINK_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/gfs2_ondisk.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/gfs2_ondisk.h
new file mode 100644
index 0000000..c56b4bc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/gfs2_ondisk.h
@@ -0,0 +1,451 @@
+/*
+ * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
+ * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License v.2.
+ */
+
+#ifndef __GFS2_ONDISK_DOT_H__
+#define __GFS2_ONDISK_DOT_H__
+
+#include <linux/types.h>
+
+#define GFS2_MAGIC 0x01161970
+#define GFS2_BASIC_BLOCK 512
+#define GFS2_BASIC_BLOCK_SHIFT 9
+
+/* Lock numbers of the LM_TYPE_NONDISK type */
+
+#define GFS2_MOUNT_LOCK 0
+#define GFS2_LIVE_LOCK 1
+#define GFS2_TRANS_LOCK 2
+#define GFS2_RENAME_LOCK 3
+
+/* Format numbers for various metadata types */
+
+#define GFS2_FORMAT_NONE 0
+#define GFS2_FORMAT_SB 100
+#define GFS2_FORMAT_RG 200
+#define GFS2_FORMAT_RB 300
+#define GFS2_FORMAT_DI 400
+#define GFS2_FORMAT_IN 500
+#define GFS2_FORMAT_LF 600
+#define GFS2_FORMAT_JD 700
+#define GFS2_FORMAT_LH 800
+#define GFS2_FORMAT_LD 900
+#define GFS2_FORMAT_LB 1000
+#define GFS2_FORMAT_EA 1600
+#define GFS2_FORMAT_ED 1700
+#define GFS2_FORMAT_QC 1400
+/* These are format numbers for entities contained in files */
+#define GFS2_FORMAT_RI 1100
+#define GFS2_FORMAT_DE 1200
+#define GFS2_FORMAT_QU 1500
+/* These are part of the superblock */
+#define GFS2_FORMAT_FS 1801
+#define GFS2_FORMAT_MULTI 1900
+
+/*
+ * An on-disk inode number
+ */
+
+struct gfs2_inum {
+ __be64 no_formal_ino;
+ __be64 no_addr;
+};
+
+/*
+ * Generic metadata head structure
+ * Every inplace buffer logged in the journal must start with this.
+ */
+
+#define GFS2_METATYPE_NONE 0
+#define GFS2_METATYPE_SB 1
+#define GFS2_METATYPE_RG 2
+#define GFS2_METATYPE_RB 3
+#define GFS2_METATYPE_DI 4
+#define GFS2_METATYPE_IN 5
+#define GFS2_METATYPE_LF 6
+#define GFS2_METATYPE_JD 7
+#define GFS2_METATYPE_LH 8
+#define GFS2_METATYPE_LD 9
+#define GFS2_METATYPE_LB 12
+#define GFS2_METATYPE_EA 10
+#define GFS2_METATYPE_ED 11
+#define GFS2_METATYPE_QC 14
+
+struct gfs2_meta_header {
+ __be32 mh_magic;
+ __be32 mh_type;
+ __be64 __pad0; /* Was generation number in gfs1 */
+ __be32 mh_format;
+ __be32 __pad1; /* Was incarnation number in gfs1 */
+};
+
+/*
+ * super-block structure
+ *
+ * It's probably good if SIZEOF_SB <= GFS2_BASIC_BLOCK (512 bytes)
+ *
+ * Order is important, need to be able to read old superblocks to do on-disk
+ * version upgrades.
+ */
+
+/* Address of superblock in GFS2 basic blocks */
+#define GFS2_SB_ADDR 128
+
+/* The lock number for the superblock (must be zero) */
+#define GFS2_SB_LOCK 0
+
+/* Requirement: GFS2_LOCKNAME_LEN % 8 == 0
+ Includes: the fencing zero at the end */
+#define GFS2_LOCKNAME_LEN 64
+
+struct gfs2_sb {
+ struct gfs2_meta_header sb_header;
+
+ __be32 sb_fs_format;
+ __be32 sb_multihost_format;
+ __u32 __pad0; /* Was superblock flags in gfs1 */
+
+ __be32 sb_bsize;
+ __be32 sb_bsize_shift;
+ __u32 __pad1; /* Was journal segment size in gfs1 */
+
+ struct gfs2_inum sb_master_dir; /* Was jindex dinode in gfs1 */
+ struct gfs2_inum __pad2; /* Was rindex dinode in gfs1 */
+ struct gfs2_inum sb_root_dir;
+
+ char sb_lockproto[GFS2_LOCKNAME_LEN];
+ char sb_locktable[GFS2_LOCKNAME_LEN];
+
+ struct gfs2_inum __pad3; /* Was quota inode in gfs1 */
+ struct gfs2_inum __pad4; /* Was licence inode in gfs1 */
+#define GFS2_HAS_UUID 1
+ __u8 sb_uuid[16]; /* The UUID, maybe 0 for backwards compat */
+};
+
+/*
+ * resource index structure
+ */
+
+struct gfs2_rindex {
+ __be64 ri_addr; /* grp block disk address */
+ __be32 ri_length; /* length of rgrp header in fs blocks */
+ __u32 __pad;
+
+ __be64 ri_data0; /* first data location */
+ __be32 ri_data; /* num of data blocks in rgrp */
+
+ __be32 ri_bitbytes; /* number of bytes in data bitmaps */
+
+ __u8 ri_reserved[64];
+};
+
+/*
+ * resource group header structure
+ */
+
+/* Number of blocks per byte in rgrp */
+#define GFS2_NBBY 4
+#define GFS2_BIT_SIZE 2
+#define GFS2_BIT_MASK 0x00000003
+
+#define GFS2_BLKST_FREE 0
+#define GFS2_BLKST_USED 1
+#define GFS2_BLKST_UNLINKED 2
+#define GFS2_BLKST_DINODE 3
+
+#define GFS2_RGF_JOURNAL 0x00000001
+#define GFS2_RGF_METAONLY 0x00000002
+#define GFS2_RGF_DATAONLY 0x00000004
+#define GFS2_RGF_NOALLOC 0x00000008
+
+struct gfs2_rgrp {
+ struct gfs2_meta_header rg_header;
+
+ __be32 rg_flags;
+ __be32 rg_free;
+ __be32 rg_dinodes;
+ __be32 __pad;
+ __be64 rg_igeneration;
+
+ __u8 rg_reserved[80]; /* Several fields from gfs1 now reserved */
+};
+
+/*
+ * quota linked list: user quotas and group quotas form two separate
+ * singly linked lists. ll_next stores uids or gids of next quotas in the
+ * linked list.
+
+Given the uid/gid, how to calculate the quota file offsets for the corresponding
+gfs2_quota structures on disk:
+
+for user quotas, given uid,
+offset = uid * sizeof(struct gfs2_quota);
+
+for group quotas, given gid,
+offset = (gid * sizeof(struct gfs2_quota)) + sizeof(struct gfs2_quota);
+
+
+ uid:0 gid:0 uid:12 gid:12 uid:17 gid:17 uid:5142 gid:5142
++-------+-------+ +-------+-------+ +-------+- - - -+ +- - - -+-------+
+| valid | valid | :: | valid | valid | :: | valid | inval | :: | inval | valid |
++-------+-------+ +-------+-------+ +-------+- - - -+ +- - - -+-------+
+next:12 next:12 next:17 next:5142 next:NULL next:NULL
+ | | | | |<-- user quota list |
+ \______|___________/ \______|___________/ group quota list -->|
+ | | |
+ \__________________/ \_______________________________________/
+
+*/
+
+/*
+ * quota structure
+ */
+
+struct gfs2_quota {
+ __be64 qu_limit;
+ __be64 qu_warn;
+ __be64 qu_value;
+ __be32 qu_ll_next; /* location of next quota in list */
+ __u8 qu_reserved[60];
+};
+
+/*
+ * dinode structure
+ */
+
+#define GFS2_MAX_META_HEIGHT 10
+#define GFS2_DIR_MAX_DEPTH 17
+
+#define DT2IF(dt) (((dt) << 12) & S_IFMT)
+#define IF2DT(sif) (((sif) & S_IFMT) >> 12)
+
+enum {
+ gfs2fl_Jdata = 0,
+ gfs2fl_ExHash = 1,
+ gfs2fl_Unused = 2,
+ gfs2fl_EaIndirect = 3,
+ gfs2fl_Directio = 4,
+ gfs2fl_Immutable = 5,
+ gfs2fl_AppendOnly = 6,
+ gfs2fl_NoAtime = 7,
+ gfs2fl_Sync = 8,
+ gfs2fl_System = 9,
+ gfs2fl_TruncInProg = 29,
+ gfs2fl_InheritDirectio = 30,
+ gfs2fl_InheritJdata = 31,
+};
+
+/* Dinode flags */
+#define GFS2_DIF_JDATA 0x00000001
+#define GFS2_DIF_EXHASH 0x00000002
+#define GFS2_DIF_UNUSED 0x00000004 /* only in gfs1 */
+#define GFS2_DIF_EA_INDIRECT 0x00000008
+#define GFS2_DIF_DIRECTIO 0x00000010
+#define GFS2_DIF_IMMUTABLE 0x00000020
+#define GFS2_DIF_APPENDONLY 0x00000040
+#define GFS2_DIF_NOATIME 0x00000080
+#define GFS2_DIF_SYNC 0x00000100
+#define GFS2_DIF_SYSTEM 0x00000200 /* New in gfs2 */
+#define GFS2_DIF_TRUNC_IN_PROG 0x20000000 /* New in gfs2 */
+#define GFS2_DIF_INHERIT_DIRECTIO 0x40000000
+#define GFS2_DIF_INHERIT_JDATA 0x80000000
+
+struct gfs2_dinode {
+ struct gfs2_meta_header di_header;
+
+ struct gfs2_inum di_num;
+
+ __be32 di_mode; /* mode of file */
+ __be32 di_uid; /* owner's user id */
+ __be32 di_gid; /* owner's group id */
+ __be32 di_nlink; /* number of links to this file */
+ __be64 di_size; /* number of bytes in file */
+ __be64 di_blocks; /* number of blocks in file */
+ __be64 di_atime; /* time last accessed */
+ __be64 di_mtime; /* time last modified */
+ __be64 di_ctime; /* time last changed */
+ __be32 di_major; /* device major number */
+ __be32 di_minor; /* device minor number */
+
+ /* This section varies from gfs1. Padding added to align with
+ * remainder of dinode
+ */
+ __be64 di_goal_meta; /* rgrp to alloc from next */
+ __be64 di_goal_data; /* data block goal */
+ __be64 di_generation; /* generation number for NFS */
+
+ __be32 di_flags; /* GFS2_DIF_... */
+ __be32 di_payload_format; /* GFS2_FORMAT_... */
+ __u16 __pad1; /* Was ditype in gfs1 */
+ __be16 di_height; /* height of metadata */
+ __u32 __pad2; /* Unused incarnation number from gfs1 */
+
+ /* These only apply to directories */
+ __u16 __pad3; /* Padding */
+ __be16 di_depth; /* Number of bits in the table */
+ __be32 di_entries; /* The number of entries in the directory */
+
+ struct gfs2_inum __pad4; /* Unused even in current gfs1 */
+
+ __be64 di_eattr; /* extended attribute block number */
+ __be32 di_atime_nsec; /* nsec portion of atime */
+ __be32 di_mtime_nsec; /* nsec portion of mtime */
+ __be32 di_ctime_nsec; /* nsec portion of ctime */
+
+ __u8 di_reserved[44];
+};
+
+/*
+ * directory structure - many of these per directory file
+ */
+
+#define GFS2_FNAMESIZE 255
+#define GFS2_DIRENT_SIZE(name_len) ((sizeof(struct gfs2_dirent) + (name_len) + 7) & ~7)
+
+struct gfs2_dirent {
+ struct gfs2_inum de_inum;
+ __be32 de_hash;
+ __be16 de_rec_len;
+ __be16 de_name_len;
+ __be16 de_type;
+ __u8 __pad[14];
+};
+
+/*
+ * Header of leaf directory nodes
+ */
+
+struct gfs2_leaf {
+ struct gfs2_meta_header lf_header;
+
+ __be16 lf_depth; /* Depth of leaf */
+ __be16 lf_entries; /* Number of dirents in leaf */
+ __be32 lf_dirent_format; /* Format of the dirents */
+ __be64 lf_next; /* Next leaf, if overflow */
+
+ __u8 lf_reserved[64];
+};
+
+/*
+ * Extended attribute header format
+ */
+
+#define GFS2_EA_MAX_NAME_LEN 255
+#define GFS2_EA_MAX_DATA_LEN 65536
+
+#define GFS2_EATYPE_UNUSED 0
+#define GFS2_EATYPE_USR 1
+#define GFS2_EATYPE_SYS 2
+#define GFS2_EATYPE_SECURITY 3
+
+#define GFS2_EATYPE_LAST 3
+#define GFS2_EATYPE_VALID(x) ((x) <= GFS2_EATYPE_LAST)
+
+#define GFS2_EAFLAG_LAST 0x01 /* last ea in block */
+
+struct gfs2_ea_header {
+ __be32 ea_rec_len;
+ __be32 ea_data_len;
+ __u8 ea_name_len; /* no NULL pointer after the string */
+ __u8 ea_type; /* GFS2_EATYPE_... */
+ __u8 ea_flags; /* GFS2_EAFLAG_... */
+ __u8 ea_num_ptrs;
+ __u32 __pad;
+};
+
+/*
+ * Log header structure
+ */
+
+#define GFS2_LOG_HEAD_UNMOUNT 0x00000001 /* log is clean */
+
+struct gfs2_log_header {
+ struct gfs2_meta_header lh_header;
+
+ __be64 lh_sequence; /* Sequence number of this transaction */
+ __be32 lh_flags; /* GFS2_LOG_HEAD_... */
+ __be32 lh_tail; /* Block number of log tail */
+ __be32 lh_blkno;
+ __be32 lh_hash;
+};
+
+/*
+ * Log type descriptor
+ */
+
+#define GFS2_LOG_DESC_METADATA 300
+/* ld_data1 is the number of metadata blocks in the descriptor.
+ ld_data2 is unused. */
+
+#define GFS2_LOG_DESC_REVOKE 301
+/* ld_data1 is the number of revoke blocks in the descriptor.
+ ld_data2 is unused. */
+
+#define GFS2_LOG_DESC_JDATA 302
+/* ld_data1 is the number of data blocks in the descriptor.
+ ld_data2 is unused. */
+
+struct gfs2_log_descriptor {
+ struct gfs2_meta_header ld_header;
+
+ __be32 ld_type; /* GFS2_LOG_DESC_... */
+ __be32 ld_length; /* Number of buffers in this chunk */
+ __be32 ld_data1; /* descriptor-specific field */
+ __be32 ld_data2; /* descriptor-specific field */
+
+ __u8 ld_reserved[32];
+};
+
+/*
+ * Inum Range
+ * Describe a range of formal inode numbers allocated to
+ * one machine to assign to inodes.
+ */
+
+#define GFS2_INUM_QUANTUM 1048576
+
+struct gfs2_inum_range {
+ __be64 ir_start;
+ __be64 ir_length;
+};
+
+/*
+ * Statfs change
+ * Describes an change to the pool of free and allocated
+ * blocks.
+ */
+
+struct gfs2_statfs_change {
+ __be64 sc_total;
+ __be64 sc_free;
+ __be64 sc_dinodes;
+};
+
+/*
+ * Quota change
+ * Describes an allocation change for a particular
+ * user or group.
+ */
+
+#define GFS2_QCF_USER 0x00000001
+
+struct gfs2_quota_change {
+ __be64 qc_change;
+ __be32 qc_flags; /* GFS2_QCF_... */
+ __be32 qc_id;
+};
+
+struct gfs2_quota_lvb {
+ __be32 qb_magic;
+ __u32 __pad;
+ __be64 qb_limit; /* Hard limit of # blocks to alloc */
+ __be64 qb_warn; /* Warn user when alloc is above this # */
+ __be64 qb_value; /* Current # blocks allocated */
+};
+
+#endif /* __GFS2_ONDISK_DOT_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/gigaset_dev.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/gigaset_dev.h
new file mode 100644
index 0000000..5dc4a31
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/gigaset_dev.h
@@ -0,0 +1,30 @@
+/*
+ * interface to user space for the gigaset driver
+ *
+ * Copyright (c) 2004 by Hansjoerg Lipp <hjlipp@web.de>
+ *
+ * =====================================================================
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ * =====================================================================
+ */
+
+#ifndef GIGASET_INTERFACE_H
+#define GIGASET_INTERFACE_H
+
+#include <linux/ioctl.h>
+
+#define GIGASET_IOCTL 0x47
+
+#define GIGVER_DRIVER 0
+#define GIGVER_COMPAT 1
+#define GIGVER_FWBASE 2
+
+#define GIGASET_REDIR _IOWR (GIGASET_IOCTL, 0, int)
+#define GIGASET_CONFIG _IOWR (GIGASET_IOCTL, 1, int)
+#define GIGASET_BRKCHARS _IOW (GIGASET_IOCTL, 2, unsigned char[6]) //FIXME [6] okay?
+#define GIGASET_VERSION _IOWR (GIGASET_IOCTL, 3, unsigned[4])
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hayesesp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hayesesp.h
new file mode 100644
index 0000000..59d744d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hayesesp.h
@@ -0,0 +1,17 @@
+#ifndef HAYESESP_H
+#define HAYESESP_H
+
+struct hayes_esp_config {
+ short flow_on;
+ short flow_off;
+ short rx_trigger;
+ short tx_trigger;
+ short pio_threshold;
+ unsigned char rx_timeout;
+ char dma_channel;
+};
+
+
+
+#endif /* ESP_H */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdlc.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdlc.h
new file mode 100644
index 0000000..89e484d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdlc.h
@@ -0,0 +1,23 @@
+/*
+ * Generic HDLC support routines for Linux
+ *
+ * Copyright (C) 1999-2005 Krzysztof Halasa <khc@pm.waw.pl>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License
+ * as published by the Free Software Foundation.
+ */
+
+#ifndef __HDLC_H
+#define __HDLC_H
+
+
+#define HDLC_MAX_MTU 1500 /* Ethernet 1500 bytes */
+#if 0
+#define HDLC_MAX_MRU (HDLC_MAX_MTU + 10 + 14 + 4) /* for ETH+VLAN over FR */
+#else
+#define HDLC_MAX_MRU 1600 /* as required for FR network */
+#endif
+
+
+#endif /* __HDLC_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdlc/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdlc/..install.cmd
new file mode 100644
index 0000000..86e01b0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdlc/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/hdlc/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/hdlc /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/hdlc mips ioctl.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/hdlc /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/hdlc mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/hdlc/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdlc/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdlc/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdlc/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdlc/ioctl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdlc/ioctl.h
new file mode 100644
index 0000000..5839723
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdlc/ioctl.h
@@ -0,0 +1,81 @@
+#ifndef __HDLC_IOCTL_H__
+#define __HDLC_IOCTL_H__
+
+
+#define GENERIC_HDLC_VERSION 4 /* For synchronization with sethdlc utility */
+
+#define CLOCK_DEFAULT 0 /* Default setting */
+#define CLOCK_EXT 1 /* External TX and RX clock - DTE */
+#define CLOCK_INT 2 /* Internal TX and RX clock - DCE */
+#define CLOCK_TXINT 3 /* Internal TX and external RX clock */
+#define CLOCK_TXFROMRX 4 /* TX clock derived from external RX clock */
+
+
+#define ENCODING_DEFAULT 0 /* Default setting */
+#define ENCODING_NRZ 1
+#define ENCODING_NRZI 2
+#define ENCODING_FM_MARK 3
+#define ENCODING_FM_SPACE 4
+#define ENCODING_MANCHESTER 5
+
+
+#define PARITY_DEFAULT 0 /* Default setting */
+#define PARITY_NONE 1 /* No parity */
+#define PARITY_CRC16_PR0 2 /* CRC16, initial value 0x0000 */
+#define PARITY_CRC16_PR1 3 /* CRC16, initial value 0xFFFF */
+#define PARITY_CRC16_PR0_CCITT 4 /* CRC16, initial 0x0000, ITU-T version */
+#define PARITY_CRC16_PR1_CCITT 5 /* CRC16, initial 0xFFFF, ITU-T version */
+#define PARITY_CRC32_PR0_CCITT 6 /* CRC32, initial value 0x00000000 */
+#define PARITY_CRC32_PR1_CCITT 7 /* CRC32, initial value 0xFFFFFFFF */
+
+#define LMI_DEFAULT 0 /* Default setting */
+#define LMI_NONE 1 /* No LMI, all PVCs are static */
+#define LMI_ANSI 2 /* ANSI Annex D */
+#define LMI_CCITT 3 /* ITU-T Annex A */
+#define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */
+
+typedef struct {
+ unsigned int clock_rate; /* bits per second */
+ unsigned int clock_type; /* internal, external, TX-internal etc. */
+ unsigned short loopback;
+} sync_serial_settings; /* V.35, V.24, X.21 */
+
+typedef struct {
+ unsigned int clock_rate; /* bits per second */
+ unsigned int clock_type; /* internal, external, TX-internal etc. */
+ unsigned short loopback;
+ unsigned int slot_map;
+} te1_settings; /* T1, E1 */
+
+typedef struct {
+ unsigned short encoding;
+ unsigned short parity;
+} raw_hdlc_proto;
+
+typedef struct {
+ unsigned int t391;
+ unsigned int t392;
+ unsigned int n391;
+ unsigned int n392;
+ unsigned int n393;
+ unsigned short lmi;
+ unsigned short dce; /* 1 for DCE (network side) operation */
+} fr_proto;
+
+typedef struct {
+ unsigned int dlci;
+} fr_proto_pvc; /* for creating/deleting FR PVCs */
+
+typedef struct {
+ unsigned int dlci;
+ char master[IFNAMSIZ]; /* Name of master FRAD device */
+}fr_proto_pvc_info; /* for returning PVC information only */
+
+typedef struct {
+ unsigned int interval;
+ unsigned int timeout;
+} cisco_proto;
+
+/* PPP doesn't need any info now - supply length = 0 to ioctl */
+
+#endif /* __HDLC_IOCTL_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdlcdrv.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdlcdrv.h
new file mode 100644
index 0000000..422d965
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdlcdrv.h
@@ -0,0 +1,110 @@
+/*
+ * hdlcdrv.h -- HDLC packet radio network driver.
+ * The Linux soundcard driver for 1200 baud and 9600 baud packet radio
+ * (C) 1996-1998 by Thomas Sailer, HB9JNX/AE4WA
+ */
+
+#ifndef _HDLCDRV_H
+#define _HDLCDRV_H
+
+/* -------------------------------------------------------------------- */
+/*
+ * structs for the IOCTL commands
+ */
+
+struct hdlcdrv_params {
+ int iobase;
+ int irq;
+ int dma;
+ int dma2;
+ int seriobase;
+ int pariobase;
+ int midiiobase;
+};
+
+struct hdlcdrv_channel_params {
+ int tx_delay; /* the transmitter keyup delay in 10ms units */
+ int tx_tail; /* the transmitter keyoff delay in 10ms units */
+ int slottime; /* the slottime in 10ms; usually 10 = 100ms */
+ int ppersist; /* the p-persistence 0..255 */
+ int fulldup; /* some driver do not support full duplex, setting */
+ /* this just makes them send even if DCD is on */
+};
+
+struct hdlcdrv_old_channel_state {
+ int ptt;
+ int dcd;
+ int ptt_keyed;
+};
+
+struct hdlcdrv_channel_state {
+ int ptt;
+ int dcd;
+ int ptt_keyed;
+ unsigned long tx_packets;
+ unsigned long tx_errors;
+ unsigned long rx_packets;
+ unsigned long rx_errors;
+};
+
+struct hdlcdrv_ioctl {
+ int cmd;
+ union {
+ struct hdlcdrv_params mp;
+ struct hdlcdrv_channel_params cp;
+ struct hdlcdrv_channel_state cs;
+ struct hdlcdrv_old_channel_state ocs;
+ unsigned int calibrate;
+ unsigned char bits;
+ char modename[128];
+ char drivername[32];
+ } data;
+};
+
+/* -------------------------------------------------------------------- */
+
+/*
+ * ioctl values
+ */
+#define HDLCDRVCTL_GETMODEMPAR 0
+#define HDLCDRVCTL_SETMODEMPAR 1
+#define HDLCDRVCTL_MODEMPARMASK 2 /* not handled by hdlcdrv */
+#define HDLCDRVCTL_GETCHANNELPAR 10
+#define HDLCDRVCTL_SETCHANNELPAR 11
+#define HDLCDRVCTL_OLDGETSTAT 20
+#define HDLCDRVCTL_CALIBRATE 21
+#define HDLCDRVCTL_GETSTAT 22
+
+/*
+ * these are mainly for debugging purposes
+ */
+#define HDLCDRVCTL_GETSAMPLES 30
+#define HDLCDRVCTL_GETBITS 31
+
+/*
+ * not handled by hdlcdrv, but by its depending drivers
+ */
+#define HDLCDRVCTL_GETMODE 40
+#define HDLCDRVCTL_SETMODE 41
+#define HDLCDRVCTL_MODELIST 42
+#define HDLCDRVCTL_DRIVERNAME 43
+
+/*
+ * mask of needed modem parameters, returned by HDLCDRVCTL_MODEMPARMASK
+ */
+#define HDLCDRV_PARMASK_IOBASE (1<<0)
+#define HDLCDRV_PARMASK_IRQ (1<<1)
+#define HDLCDRV_PARMASK_DMA (1<<2)
+#define HDLCDRV_PARMASK_DMA2 (1<<3)
+#define HDLCDRV_PARMASK_SERIOBASE (1<<4)
+#define HDLCDRV_PARMASK_PARIOBASE (1<<5)
+#define HDLCDRV_PARMASK_MIDIIOBASE (1<<6)
+
+/* -------------------------------------------------------------------- */
+
+
+/* -------------------------------------------------------------------- */
+
+#endif /* _HDLCDRV_H */
+
+/* -------------------------------------------------------------------- */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdreg.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdreg.h
new file mode 100644
index 0000000..774173f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hdreg.h
@@ -0,0 +1,642 @@
+#ifndef _LINUX_HDREG_H
+#define _LINUX_HDREG_H
+
+#include <linux/types.h>
+
+/*
+ * Command Header sizes for IOCTL commands
+ */
+
+#define HDIO_DRIVE_CMD_HDR_SIZE (4 * sizeof(__u8))
+#define HDIO_DRIVE_HOB_HDR_SIZE (8 * sizeof(__u8))
+#define HDIO_DRIVE_TASK_HDR_SIZE (8 * sizeof(__u8))
+
+#define IDE_DRIVE_TASK_NO_DATA 0
+#define IDE_DRIVE_TASK_INVALID -1
+#define IDE_DRIVE_TASK_SET_XFER 1
+#define IDE_DRIVE_TASK_IN 2
+#define IDE_DRIVE_TASK_OUT 3
+#define IDE_DRIVE_TASK_RAW_WRITE 4
+
+/*
+ * Define standard taskfile in/out register
+ */
+#define IDE_TASKFILE_STD_IN_FLAGS 0xFE
+#define IDE_HOB_STD_IN_FLAGS 0x3C
+#define IDE_TASKFILE_STD_OUT_FLAGS 0xFE
+#define IDE_HOB_STD_OUT_FLAGS 0x3C
+
+typedef unsigned char task_ioreg_t;
+typedef unsigned long sata_ioreg_t;
+
+typedef union ide_reg_valid_s {
+ unsigned all : 16;
+ struct {
+ unsigned data : 1;
+ unsigned error_feature : 1;
+ unsigned sector : 1;
+ unsigned nsector : 1;
+ unsigned lcyl : 1;
+ unsigned hcyl : 1;
+ unsigned select : 1;
+ unsigned status_command : 1;
+
+ unsigned data_hob : 1;
+ unsigned error_feature_hob : 1;
+ unsigned sector_hob : 1;
+ unsigned nsector_hob : 1;
+ unsigned lcyl_hob : 1;
+ unsigned hcyl_hob : 1;
+ unsigned select_hob : 1;
+ unsigned control_hob : 1;
+ } b;
+} ide_reg_valid_t;
+
+typedef struct ide_task_request_s {
+ __u8 io_ports[8];
+ __u8 hob_ports[8]; /* bytes 6 and 7 are unused */
+ ide_reg_valid_t out_flags;
+ ide_reg_valid_t in_flags;
+ int data_phase;
+ int req_cmd;
+ unsigned long out_size;
+ unsigned long in_size;
+} ide_task_request_t;
+
+typedef struct ide_ioctl_request_s {
+ ide_task_request_t *task_request;
+ unsigned char *out_buffer;
+ unsigned char *in_buffer;
+} ide_ioctl_request_t;
+
+struct hd_drive_cmd_hdr {
+ __u8 command;
+ __u8 sector_number;
+ __u8 feature;
+ __u8 sector_count;
+};
+
+typedef struct hd_drive_task_hdr {
+ __u8 data;
+ __u8 feature;
+ __u8 sector_count;
+ __u8 sector_number;
+ __u8 low_cylinder;
+ __u8 high_cylinder;
+ __u8 device_head;
+ __u8 command;
+} task_struct_t;
+
+typedef struct hd_drive_hob_hdr {
+ __u8 data;
+ __u8 feature;
+ __u8 sector_count;
+ __u8 sector_number;
+ __u8 low_cylinder;
+ __u8 high_cylinder;
+ __u8 device_head;
+ __u8 control;
+} hob_struct_t;
+
+#define TASKFILE_NO_DATA 0x0000
+
+#define TASKFILE_IN 0x0001
+#define TASKFILE_MULTI_IN 0x0002
+
+#define TASKFILE_OUT 0x0004
+#define TASKFILE_MULTI_OUT 0x0008
+#define TASKFILE_IN_OUT 0x0010
+
+#define TASKFILE_IN_DMA 0x0020
+#define TASKFILE_OUT_DMA 0x0040
+#define TASKFILE_IN_DMAQ 0x0080
+#define TASKFILE_OUT_DMAQ 0x0100
+
+#define TASKFILE_P_IN 0x0200
+#define TASKFILE_P_OUT 0x0400
+#define TASKFILE_P_IN_DMA 0x0800
+#define TASKFILE_P_OUT_DMA 0x1000
+#define TASKFILE_P_IN_DMAQ 0x2000
+#define TASKFILE_P_OUT_DMAQ 0x4000
+#define TASKFILE_48 0x8000
+#define TASKFILE_INVALID 0x7fff
+
+/* ATA/ATAPI Commands pre T13 Spec */
+#define WIN_NOP 0x00
+/*
+ * 0x01->0x02 Reserved
+ */
+#define CFA_REQ_EXT_ERROR_CODE 0x03 /* CFA Request Extended Error Code */
+/*
+ * 0x04->0x07 Reserved
+ */
+#define WIN_SRST 0x08 /* ATAPI soft reset command */
+#define WIN_DEVICE_RESET 0x08
+/*
+ * 0x09->0x0F Reserved
+ */
+#define WIN_RECAL 0x10
+#define WIN_RESTORE WIN_RECAL
+/*
+ * 0x10->0x1F Reserved
+ */
+#define WIN_READ 0x20 /* 28-Bit */
+#define WIN_READ_ONCE 0x21 /* 28-Bit without retries */
+#define WIN_READ_LONG 0x22 /* 28-Bit */
+#define WIN_READ_LONG_ONCE 0x23 /* 28-Bit without retries */
+#define WIN_READ_EXT 0x24 /* 48-Bit */
+#define WIN_READDMA_EXT 0x25 /* 48-Bit */
+#define WIN_READDMA_QUEUED_EXT 0x26 /* 48-Bit */
+#define WIN_READ_NATIVE_MAX_EXT 0x27 /* 48-Bit */
+/*
+ * 0x28
+ */
+#define WIN_MULTREAD_EXT 0x29 /* 48-Bit */
+/*
+ * 0x2A->0x2F Reserved
+ */
+#define WIN_WRITE 0x30 /* 28-Bit */
+#define WIN_WRITE_ONCE 0x31 /* 28-Bit without retries */
+#define WIN_WRITE_LONG 0x32 /* 28-Bit */
+#define WIN_WRITE_LONG_ONCE 0x33 /* 28-Bit without retries */
+#define WIN_WRITE_EXT 0x34 /* 48-Bit */
+#define WIN_WRITEDMA_EXT 0x35 /* 48-Bit */
+#define WIN_WRITEDMA_QUEUED_EXT 0x36 /* 48-Bit */
+#define WIN_SET_MAX_EXT 0x37 /* 48-Bit */
+#define CFA_WRITE_SECT_WO_ERASE 0x38 /* CFA Write Sectors without erase */
+#define WIN_MULTWRITE_EXT 0x39 /* 48-Bit */
+/*
+ * 0x3A->0x3B Reserved
+ */
+#define WIN_WRITE_VERIFY 0x3C /* 28-Bit */
+/*
+ * 0x3D->0x3F Reserved
+ */
+#define WIN_VERIFY 0x40 /* 28-Bit - Read Verify Sectors */
+#define WIN_VERIFY_ONCE 0x41 /* 28-Bit - without retries */
+#define WIN_VERIFY_EXT 0x42 /* 48-Bit */
+/*
+ * 0x43->0x4F Reserved
+ */
+#define WIN_FORMAT 0x50
+/*
+ * 0x51->0x5F Reserved
+ */
+#define WIN_INIT 0x60
+/*
+ * 0x61->0x5F Reserved
+ */
+#define WIN_SEEK 0x70 /* 0x70-0x7F Reserved */
+
+#define CFA_TRANSLATE_SECTOR 0x87 /* CFA Translate Sector */
+#define WIN_DIAGNOSE 0x90
+#define WIN_SPECIFY 0x91 /* set drive geometry translation */
+#define WIN_DOWNLOAD_MICROCODE 0x92
+#define WIN_STANDBYNOW2 0x94
+#define WIN_STANDBY2 0x96
+#define WIN_SETIDLE2 0x97
+#define WIN_CHECKPOWERMODE2 0x98
+#define WIN_SLEEPNOW2 0x99
+/*
+ * 0x9A VENDOR
+ */
+#define WIN_PACKETCMD 0xA0 /* Send a packet command. */
+#define WIN_PIDENTIFY 0xA1 /* identify ATAPI device */
+#define WIN_QUEUED_SERVICE 0xA2
+#define WIN_SMART 0xB0 /* self-monitoring and reporting */
+#define CFA_ERASE_SECTORS 0xC0
+#define WIN_MULTREAD 0xC4 /* read sectors using multiple mode*/
+#define WIN_MULTWRITE 0xC5 /* write sectors using multiple mode */
+#define WIN_SETMULT 0xC6 /* enable/disable multiple mode */
+#define WIN_READDMA_QUEUED 0xC7 /* read sectors using Queued DMA transfers */
+#define WIN_READDMA 0xC8 /* read sectors using DMA transfers */
+#define WIN_READDMA_ONCE 0xC9 /* 28-Bit - without retries */
+#define WIN_WRITEDMA 0xCA /* write sectors using DMA transfers */
+#define WIN_WRITEDMA_ONCE 0xCB /* 28-Bit - without retries */
+#define WIN_WRITEDMA_QUEUED 0xCC /* write sectors using Queued DMA transfers */
+#define CFA_WRITE_MULTI_WO_ERASE 0xCD /* CFA Write multiple without erase */
+#define WIN_GETMEDIASTATUS 0xDA
+#define WIN_ACKMEDIACHANGE 0xDB /* ATA-1, ATA-2 vendor */
+#define WIN_POSTBOOT 0xDC
+#define WIN_PREBOOT 0xDD
+#define WIN_DOORLOCK 0xDE /* lock door on removable drives */
+#define WIN_DOORUNLOCK 0xDF /* unlock door on removable drives */
+#define WIN_STANDBYNOW1 0xE0
+#define WIN_IDLEIMMEDIATE 0xE1 /* force drive to become "ready" */
+#define WIN_STANDBY 0xE2 /* Set device in Standby Mode */
+#define WIN_SETIDLE1 0xE3
+#define WIN_READ_BUFFER 0xE4 /* force read only 1 sector */
+#define WIN_CHECKPOWERMODE1 0xE5
+#define WIN_SLEEPNOW1 0xE6
+#define WIN_FLUSH_CACHE 0xE7
+#define WIN_WRITE_BUFFER 0xE8 /* force write only 1 sector */
+#define WIN_WRITE_SAME 0xE9 /* read ata-2 to use */
+ /* SET_FEATURES 0x22 or 0xDD */
+#define WIN_FLUSH_CACHE_EXT 0xEA /* 48-Bit */
+#define WIN_IDENTIFY 0xEC /* ask drive to identify itself */
+#define WIN_MEDIAEJECT 0xED
+#define WIN_IDENTIFY_DMA 0xEE /* same as WIN_IDENTIFY, but DMA */
+#define WIN_SETFEATURES 0xEF /* set special drive features */
+#define EXABYTE_ENABLE_NEST 0xF0
+#define WIN_SECURITY_SET_PASS 0xF1
+#define WIN_SECURITY_UNLOCK 0xF2
+#define WIN_SECURITY_ERASE_PREPARE 0xF3
+#define WIN_SECURITY_ERASE_UNIT 0xF4
+#define WIN_SECURITY_FREEZE_LOCK 0xF5
+#define WIN_SECURITY_DISABLE 0xF6
+#define WIN_READ_NATIVE_MAX 0xF8 /* return the native maximum address */
+#define WIN_SET_MAX 0xF9
+#define DISABLE_SEAGATE 0xFB
+
+/* WIN_SMART sub-commands */
+
+#define SMART_READ_VALUES 0xD0
+#define SMART_READ_THRESHOLDS 0xD1
+#define SMART_AUTOSAVE 0xD2
+#define SMART_SAVE 0xD3
+#define SMART_IMMEDIATE_OFFLINE 0xD4
+#define SMART_READ_LOG_SECTOR 0xD5
+#define SMART_WRITE_LOG_SECTOR 0xD6
+#define SMART_WRITE_THRESHOLDS 0xD7
+#define SMART_ENABLE 0xD8
+#define SMART_DISABLE 0xD9
+#define SMART_STATUS 0xDA
+#define SMART_AUTO_OFFLINE 0xDB
+
+/* Password used in TF4 & TF5 executing SMART commands */
+
+#define SMART_LCYL_PASS 0x4F
+#define SMART_HCYL_PASS 0xC2
+
+/* WIN_SETFEATURES sub-commands */
+#define SETFEATURES_EN_8BIT 0x01 /* Enable 8-Bit Transfers */
+#define SETFEATURES_EN_WCACHE 0x02 /* Enable write cache */
+#define SETFEATURES_DIS_DEFECT 0x04 /* Disable Defect Management */
+#define SETFEATURES_EN_APM 0x05 /* Enable advanced power management */
+#define SETFEATURES_EN_SAME_R 0x22 /* for a region ATA-1 */
+#define SETFEATURES_DIS_MSN 0x31 /* Disable Media Status Notification */
+#define SETFEATURES_DIS_RETRY 0x33 /* Disable Retry */
+#define SETFEATURES_EN_AAM 0x42 /* Enable Automatic Acoustic Management */
+#define SETFEATURES_RW_LONG 0x44 /* Set Length of VS bytes */
+#define SETFEATURES_SET_CACHE 0x54 /* Set Cache segments to SC Reg. Val */
+#define SETFEATURES_DIS_RLA 0x55 /* Disable read look-ahead feature */
+#define SETFEATURES_EN_RI 0x5D /* Enable release interrupt */
+#define SETFEATURES_EN_SI 0x5E /* Enable SERVICE interrupt */
+#define SETFEATURES_DIS_RPOD 0x66 /* Disable reverting to power on defaults */
+#define SETFEATURES_DIS_ECC 0x77 /* Disable ECC byte count */
+#define SETFEATURES_DIS_8BIT 0x81 /* Disable 8-Bit Transfers */
+#define SETFEATURES_DIS_WCACHE 0x82 /* Disable write cache */
+#define SETFEATURES_EN_DEFECT 0x84 /* Enable Defect Management */
+#define SETFEATURES_DIS_APM 0x85 /* Disable advanced power management */
+#define SETFEATURES_EN_ECC 0x88 /* Enable ECC byte count */
+#define SETFEATURES_EN_MSN 0x95 /* Enable Media Status Notification */
+#define SETFEATURES_EN_RETRY 0x99 /* Enable Retry */
+#define SETFEATURES_EN_RLA 0xAA /* Enable read look-ahead feature */
+#define SETFEATURES_PREFETCH 0xAB /* Sets drive prefetch value */
+#define SETFEATURES_EN_REST 0xAC /* ATA-1 */
+#define SETFEATURES_4B_RW_LONG 0xBB /* Set Length of 4 bytes */
+#define SETFEATURES_DIS_AAM 0xC2 /* Disable Automatic Acoustic Management */
+#define SETFEATURES_EN_RPOD 0xCC /* Enable reverting to power on defaults */
+#define SETFEATURES_DIS_RI 0xDD /* Disable release interrupt ATAPI */
+#define SETFEATURES_EN_SAME_M 0xDD /* for a entire device ATA-1 */
+#define SETFEATURES_DIS_SI 0xDE /* Disable SERVICE interrupt ATAPI */
+
+/* WIN_SECURITY sub-commands */
+
+#define SECURITY_SET_PASSWORD 0xBA
+#define SECURITY_UNLOCK 0xBB
+#define SECURITY_ERASE_PREPARE 0xBC
+#define SECURITY_ERASE_UNIT 0xBD
+#define SECURITY_FREEZE_LOCK 0xBE
+#define SECURITY_DISABLE_PASSWORD 0xBF
+
+struct hd_geometry {
+ unsigned char heads;
+ unsigned char sectors;
+ unsigned short cylinders;
+ unsigned long start;
+};
+
+/* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x030n/0x031n */
+#define HDIO_GETGEO 0x0301 /* get device geometry */
+#define HDIO_GET_UNMASKINTR 0x0302 /* get current unmask setting */
+#define HDIO_GET_MULTCOUNT 0x0304 /* get current IDE blockmode setting */
+#define HDIO_GET_QDMA 0x0305 /* get use-qdma flag */
+
+#define HDIO_SET_XFER 0x0306 /* set transfer rate via proc */
+
+#define HDIO_OBSOLETE_IDENTITY 0x0307 /* OBSOLETE, DO NOT USE: returns 142 bytes */
+#define HDIO_GET_KEEPSETTINGS 0x0308 /* get keep-settings-on-reset flag */
+#define HDIO_GET_32BIT 0x0309 /* get current io_32bit setting */
+#define HDIO_GET_NOWERR 0x030a /* get ignore-write-error flag */
+#define HDIO_GET_DMA 0x030b /* get use-dma flag */
+#define HDIO_GET_NICE 0x030c /* get nice flags */
+#define HDIO_GET_IDENTITY 0x030d /* get IDE identification info */
+#define HDIO_GET_WCACHE 0x030e /* get write cache mode on|off */
+#define HDIO_GET_ACOUSTIC 0x030f /* get acoustic value */
+#define HDIO_GET_ADDRESS 0x0310 /* */
+
+#define HDIO_GET_BUSSTATE 0x031a /* get the bus state of the hwif */
+#define HDIO_TRISTATE_HWIF 0x031b /* execute a channel tristate */
+#define HDIO_DRIVE_RESET 0x031c /* execute a device reset */
+#define HDIO_DRIVE_TASKFILE 0x031d /* execute raw taskfile */
+#define HDIO_DRIVE_TASK 0x031e /* execute task and special drive command */
+#define HDIO_DRIVE_CMD 0x031f /* execute a special drive command */
+#define HDIO_DRIVE_CMD_AEB HDIO_DRIVE_TASK
+
+/* hd/ide ctl's that pass (arg) non-ptr values are numbered 0x032n/0x033n */
+#define HDIO_SET_MULTCOUNT 0x0321 /* change IDE blockmode */
+#define HDIO_SET_UNMASKINTR 0x0322 /* permit other irqs during I/O */
+#define HDIO_SET_KEEPSETTINGS 0x0323 /* keep ioctl settings on reset */
+#define HDIO_SET_32BIT 0x0324 /* change io_32bit flags */
+#define HDIO_SET_NOWERR 0x0325 /* change ignore-write-error flag */
+#define HDIO_SET_DMA 0x0326 /* change use-dma flag */
+#define HDIO_SET_PIO_MODE 0x0327 /* reconfig interface to new speed */
+#define HDIO_SCAN_HWIF 0x0328 /* register and (re)scan interface */
+#define HDIO_UNREGISTER_HWIF 0x032a /* unregister interface */
+#define HDIO_SET_NICE 0x0329 /* set nice flags */
+#define HDIO_SET_WCACHE 0x032b /* change write cache enable-disable */
+#define HDIO_SET_ACOUSTIC 0x032c /* change acoustic behavior */
+#define HDIO_SET_BUSSTATE 0x032d /* set the bus state of the hwif */
+#define HDIO_SET_QDMA 0x032e /* change use-qdma flag */
+#define HDIO_SET_ADDRESS 0x032f /* change lba addressing modes */
+
+/* bus states */
+enum {
+ BUSSTATE_OFF = 0,
+ BUSSTATE_ON,
+ BUSSTATE_TRISTATE
+};
+
+/* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x033n/0x033n */
+/* 0x330 is reserved - used to be HDIO_GETGEO_BIG */
+/* 0x331 is reserved - used to be HDIO_GETGEO_BIG_RAW */
+/* 0x338 is reserved - used to be HDIO_SET_IDE_SCSI */
+/* 0x339 is reserved - used to be HDIO_SET_SCSI_IDE */
+
+#define __NEW_HD_DRIVE_ID
+
+/*
+ * Structure returned by HDIO_GET_IDENTITY, as per ANSI NCITS ATA6 rev.1b spec.
+ *
+ * If you change something here, please remember to update fix_driveid() in
+ * ide/probe.c.
+ */
+struct hd_driveid {
+ unsigned short config; /* lots of obsolete bit flags */
+ unsigned short cyls; /* Obsolete, "physical" cyls */
+ unsigned short reserved2; /* reserved (word 2) */
+ unsigned short heads; /* Obsolete, "physical" heads */
+ unsigned short track_bytes; /* unformatted bytes per track */
+ unsigned short sector_bytes; /* unformatted bytes per sector */
+ unsigned short sectors; /* Obsolete, "physical" sectors per track */
+ unsigned short vendor0; /* vendor unique */
+ unsigned short vendor1; /* vendor unique */
+ unsigned short vendor2; /* Retired vendor unique */
+ unsigned char serial_no[20]; /* 0 = not_specified */
+ unsigned short buf_type; /* Retired */
+ unsigned short buf_size; /* Retired, 512 byte increments
+ * 0 = not_specified
+ */
+ unsigned short ecc_bytes; /* for r/w long cmds; 0 = not_specified */
+ unsigned char fw_rev[8]; /* 0 = not_specified */
+ unsigned char model[40]; /* 0 = not_specified */
+ unsigned char max_multsect; /* 0=not_implemented */
+ unsigned char vendor3; /* vendor unique */
+ unsigned short dword_io; /* 0=not_implemented; 1=implemented */
+ unsigned char vendor4; /* vendor unique */
+ unsigned char capability; /* (upper byte of word 49)
+ * 3: IORDYsup
+ * 2: IORDYsw
+ * 1: LBA
+ * 0: DMA
+ */
+ unsigned short reserved50; /* reserved (word 50) */
+ unsigned char vendor5; /* Obsolete, vendor unique */
+ unsigned char tPIO; /* Obsolete, 0=slow, 1=medium, 2=fast */
+ unsigned char vendor6; /* Obsolete, vendor unique */
+ unsigned char tDMA; /* Obsolete, 0=slow, 1=medium, 2=fast */
+ unsigned short field_valid; /* (word 53)
+ * 2: ultra_ok word 88
+ * 1: eide_ok words 64-70
+ * 0: cur_ok words 54-58
+ */
+ unsigned short cur_cyls; /* Obsolete, logical cylinders */
+ unsigned short cur_heads; /* Obsolete, l heads */
+ unsigned short cur_sectors; /* Obsolete, l sectors per track */
+ unsigned short cur_capacity0; /* Obsolete, l total sectors on drive */
+ unsigned short cur_capacity1; /* Obsolete, (2 words, misaligned int) */
+ unsigned char multsect; /* current multiple sector count */
+ unsigned char multsect_valid; /* when (bit0==1) multsect is ok */
+ unsigned int lba_capacity; /* Obsolete, total number of sectors */
+ unsigned short dma_1word; /* Obsolete, single-word dma info */
+ unsigned short dma_mword; /* multiple-word dma info */
+ unsigned short eide_pio_modes; /* bits 0:mode3 1:mode4 */
+ unsigned short eide_dma_min; /* min mword dma cycle time (ns) */
+ unsigned short eide_dma_time; /* recommended mword dma cycle time (ns) */
+ unsigned short eide_pio; /* min cycle time (ns), no IORDY */
+ unsigned short eide_pio_iordy; /* min cycle time (ns), with IORDY */
+ unsigned short words69_70[2]; /* reserved words 69-70
+ * future command overlap and queuing
+ */
+ unsigned short words71_74[4]; /* reserved words 71-74
+ * for IDENTIFY PACKET DEVICE command
+ */
+ unsigned short queue_depth; /* (word 75)
+ * 15:5 reserved
+ * 4:0 Maximum queue depth -1
+ */
+ unsigned short words76_79[4]; /* reserved words 76-79 */
+ unsigned short major_rev_num; /* (word 80) */
+ unsigned short minor_rev_num; /* (word 81) */
+ unsigned short command_set_1; /* (word 82) supported
+ * 15: Obsolete
+ * 14: NOP command
+ * 13: READ_BUFFER
+ * 12: WRITE_BUFFER
+ * 11: Obsolete
+ * 10: Host Protected Area
+ * 9: DEVICE Reset
+ * 8: SERVICE Interrupt
+ * 7: Release Interrupt
+ * 6: look-ahead
+ * 5: write cache
+ * 4: PACKET Command
+ * 3: Power Management Feature Set
+ * 2: Removable Feature Set
+ * 1: Security Feature Set
+ * 0: SMART Feature Set
+ */
+ unsigned short command_set_2; /* (word 83)
+ * 15: Shall be ZERO
+ * 14: Shall be ONE
+ * 13: FLUSH CACHE EXT
+ * 12: FLUSH CACHE
+ * 11: Device Configuration Overlay
+ * 10: 48-bit Address Feature Set
+ * 9: Automatic Acoustic Management
+ * 8: SET MAX security
+ * 7: reserved 1407DT PARTIES
+ * 6: SetF sub-command Power-Up
+ * 5: Power-Up in Standby Feature Set
+ * 4: Removable Media Notification
+ * 3: APM Feature Set
+ * 2: CFA Feature Set
+ * 1: READ/WRITE DMA QUEUED
+ * 0: Download MicroCode
+ */
+ unsigned short cfsse; /* (word 84)
+ * cmd set-feature supported extensions
+ * 15: Shall be ZERO
+ * 14: Shall be ONE
+ * 13:6 reserved
+ * 5: General Purpose Logging
+ * 4: Streaming Feature Set
+ * 3: Media Card Pass Through
+ * 2: Media Serial Number Valid
+ * 1: SMART selt-test supported
+ * 0: SMART error logging
+ */
+ unsigned short cfs_enable_1; /* (word 85)
+ * command set-feature enabled
+ * 15: Obsolete
+ * 14: NOP command
+ * 13: READ_BUFFER
+ * 12: WRITE_BUFFER
+ * 11: Obsolete
+ * 10: Host Protected Area
+ * 9: DEVICE Reset
+ * 8: SERVICE Interrupt
+ * 7: Release Interrupt
+ * 6: look-ahead
+ * 5: write cache
+ * 4: PACKET Command
+ * 3: Power Management Feature Set
+ * 2: Removable Feature Set
+ * 1: Security Feature Set
+ * 0: SMART Feature Set
+ */
+ unsigned short cfs_enable_2; /* (word 86)
+ * command set-feature enabled
+ * 15: Shall be ZERO
+ * 14: Shall be ONE
+ * 13: FLUSH CACHE EXT
+ * 12: FLUSH CACHE
+ * 11: Device Configuration Overlay
+ * 10: 48-bit Address Feature Set
+ * 9: Automatic Acoustic Management
+ * 8: SET MAX security
+ * 7: reserved 1407DT PARTIES
+ * 6: SetF sub-command Power-Up
+ * 5: Power-Up in Standby Feature Set
+ * 4: Removable Media Notification
+ * 3: APM Feature Set
+ * 2: CFA Feature Set
+ * 1: READ/WRITE DMA QUEUED
+ * 0: Download MicroCode
+ */
+ unsigned short csf_default; /* (word 87)
+ * command set-feature default
+ * 15: Shall be ZERO
+ * 14: Shall be ONE
+ * 13:6 reserved
+ * 5: General Purpose Logging enabled
+ * 4: Valid CONFIGURE STREAM executed
+ * 3: Media Card Pass Through enabled
+ * 2: Media Serial Number Valid
+ * 1: SMART selt-test supported
+ * 0: SMART error logging
+ */
+ unsigned short dma_ultra; /* (word 88) */
+ unsigned short trseuc; /* time required for security erase */
+ unsigned short trsEuc; /* time required for enhanced erase */
+ unsigned short CurAPMvalues; /* current APM values */
+ unsigned short mprc; /* master password revision code */
+ unsigned short hw_config; /* hardware config (word 93)
+ * 15: Shall be ZERO
+ * 14: Shall be ONE
+ * 13:
+ * 12:
+ * 11:
+ * 10:
+ * 9:
+ * 8:
+ * 7:
+ * 6:
+ * 5:
+ * 4:
+ * 3:
+ * 2:
+ * 1:
+ * 0: Shall be ONE
+ */
+ unsigned short acoustic; /* (word 94)
+ * 15:8 Vendor's recommended value
+ * 7:0 current value
+ */
+ unsigned short msrqs; /* min stream request size */
+ unsigned short sxfert; /* stream transfer time */
+ unsigned short sal; /* stream access latency */
+ unsigned int spg; /* stream performance granularity */
+ unsigned long long lba_capacity_2;/* 48-bit total number of sectors */
+ unsigned short words104_125[22];/* reserved words 104-125 */
+ unsigned short last_lun; /* (word 126) */
+ unsigned short word127; /* (word 127) Feature Set
+ * Removable Media Notification
+ * 15:2 reserved
+ * 1:0 00 = not supported
+ * 01 = supported
+ * 10 = reserved
+ * 11 = reserved
+ */
+ unsigned short dlf; /* (word 128)
+ * device lock function
+ * 15:9 reserved
+ * 8 security level 1:max 0:high
+ * 7:6 reserved
+ * 5 enhanced erase
+ * 4 expire
+ * 3 frozen
+ * 2 locked
+ * 1 en/disabled
+ * 0 capability
+ */
+ unsigned short csfo; /* (word 129)
+ * current set features options
+ * 15:4 reserved
+ * 3: auto reassign
+ * 2: reverting
+ * 1: read-look-ahead
+ * 0: write cache
+ */
+ unsigned short words130_155[26];/* reserved vendor words 130-155 */
+ unsigned short word156; /* reserved vendor word 156 */
+ unsigned short words157_159[3];/* reserved vendor words 157-159 */
+ unsigned short cfa_power; /* (word 160) CFA Power Mode
+ * 15 word 160 supported
+ * 14 reserved
+ * 13
+ * 12
+ * 11:0
+ */
+ unsigned short words161_175[15];/* Reserved for CFA */
+ unsigned short words176_205[30];/* Current Media Serial Number */
+ unsigned short words206_254[49];/* reserved words 206-254 */
+ unsigned short integrity_word; /* (word 255)
+ * 15:8 Checksum
+ * 7:0 Signature
+ */
+};
+
+/*
+ * IDE "nice" flags. These are used on a per drive basis to determine
+ * when to be nice and give more bandwidth to the other devices which
+ * share the same IDE bus.
+ */
+#define IDE_NICE_DSC_OVERLAP (0) /* per the DSC overlap protocol */
+#define IDE_NICE_ATAPI_OVERLAP (1) /* not supported yet */
+#define IDE_NICE_1 (3) /* when probably won't affect us much */
+#define IDE_NICE_0 (2) /* when sure that it won't affect us */
+#define IDE_NICE_2 (4) /* when we know it's on our expense */
+
+#endif /* _LINUX_HDREG_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hid.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hid.h
new file mode 100644
index 0000000..ca2cefd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hid.h
@@ -0,0 +1,67 @@
+#ifndef __HID_H
+#define __HID_H
+
+/*
+ * Copyright (c) 1999 Andreas Gal
+ * Copyright (c) 2000-2001 Vojtech Pavlik
+ * Copyright (c) 2006-2007 Jiri Kosina
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Should you need to contact me, the author, you can do so either by
+ * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
+ * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
+ */
+
+/*
+ * USB HID (Human Interface Device) interface class code
+ */
+
+#define USB_INTERFACE_CLASS_HID 3
+
+/*
+ * USB HID interface subclass and protocol codes
+ */
+
+#define USB_INTERFACE_SUBCLASS_BOOT 1
+#define USB_INTERFACE_PROTOCOL_KEYBOARD 1
+#define USB_INTERFACE_PROTOCOL_MOUSE 2
+
+/*
+ * HID class requests
+ */
+
+#define HID_REQ_GET_REPORT 0x01
+#define HID_REQ_GET_IDLE 0x02
+#define HID_REQ_GET_PROTOCOL 0x03
+#define HID_REQ_SET_REPORT 0x09
+#define HID_REQ_SET_IDLE 0x0A
+#define HID_REQ_SET_PROTOCOL 0x0B
+
+/*
+ * HID class descriptor types
+ */
+
+#define HID_DT_HID (USB_TYPE_CLASS | 0x01)
+#define HID_DT_REPORT (USB_TYPE_CLASS | 0x02)
+#define HID_DT_PHYSICAL (USB_TYPE_CLASS | 0x03)
+
+#define HID_MAX_DESCRIPTOR_SIZE 4096
+
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hiddev.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hiddev.h
new file mode 100644
index 0000000..94b36c3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hiddev.h
@@ -0,0 +1,212 @@
+#ifndef _HIDDEV_H
+#define _HIDDEV_H
+
+/*
+ * Copyright (c) 1999-2000 Vojtech Pavlik
+ *
+ * Sponsored by SuSE
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Should you need to contact me, the author, you can do so either by
+ * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
+ * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
+ */
+
+#include <linux/types.h>
+
+/*
+ * The event structure itself
+ */
+
+struct hiddev_event {
+ unsigned hid;
+ signed int value;
+};
+
+struct hiddev_devinfo {
+ __u32 bustype;
+ __u32 busnum;
+ __u32 devnum;
+ __u32 ifnum;
+ __s16 vendor;
+ __s16 product;
+ __s16 version;
+ __u32 num_applications;
+};
+
+struct hiddev_collection_info {
+ __u32 index;
+ __u32 type;
+ __u32 usage;
+ __u32 level;
+};
+
+#define HID_STRING_SIZE 256
+struct hiddev_string_descriptor {
+ __s32 index;
+ char value[HID_STRING_SIZE];
+};
+
+struct hiddev_report_info {
+ __u32 report_type;
+ __u32 report_id;
+ __u32 num_fields;
+};
+
+/* To do a GUSAGE/SUSAGE, fill in at least usage_code, report_type and
+ * report_id. Set report_id to REPORT_ID_UNKNOWN if the rest of the fields
+ * are unknown. Otherwise use a usage_ref struct filled in from a previous
+ * successful GUSAGE call to save time. To actually send a value to the
+ * device, perform a SUSAGE first, followed by a SREPORT. An INITREPORT or a
+ * GREPORT isn't necessary for a GUSAGE to return valid data.
+ */
+#define HID_REPORT_ID_UNKNOWN 0xffffffff
+#define HID_REPORT_ID_FIRST 0x00000100
+#define HID_REPORT_ID_NEXT 0x00000200
+#define HID_REPORT_ID_MASK 0x000000ff
+#define HID_REPORT_ID_MAX 0x000000ff
+
+#define HID_REPORT_TYPE_INPUT 1
+#define HID_REPORT_TYPE_OUTPUT 2
+#define HID_REPORT_TYPE_FEATURE 3
+#define HID_REPORT_TYPE_MIN 1
+#define HID_REPORT_TYPE_MAX 3
+
+struct hiddev_field_info {
+ __u32 report_type;
+ __u32 report_id;
+ __u32 field_index;
+ __u32 maxusage;
+ __u32 flags;
+ __u32 physical; /* physical usage for this field */
+ __u32 logical; /* logical usage for this field */
+ __u32 application; /* application usage for this field */
+ __s32 logical_minimum;
+ __s32 logical_maximum;
+ __s32 physical_minimum;
+ __s32 physical_maximum;
+ __u32 unit_exponent;
+ __u32 unit;
+};
+
+/* Fill in report_type, report_id and field_index to get the information on a
+ * field.
+ */
+#define HID_FIELD_CONSTANT 0x001
+#define HID_FIELD_VARIABLE 0x002
+#define HID_FIELD_RELATIVE 0x004
+#define HID_FIELD_WRAP 0x008
+#define HID_FIELD_NONLINEAR 0x010
+#define HID_FIELD_NO_PREFERRED 0x020
+#define HID_FIELD_NULL_STATE 0x040
+#define HID_FIELD_VOLATILE 0x080
+#define HID_FIELD_BUFFERED_BYTE 0x100
+
+struct hiddev_usage_ref {
+ __u32 report_type;
+ __u32 report_id;
+ __u32 field_index;
+ __u32 usage_index;
+ __u32 usage_code;
+ __s32 value;
+};
+
+/* hiddev_usage_ref_multi is used for sending multiple bytes to a control.
+ * It really manifests itself as setting the value of consecutive usages */
+#define HID_MAX_MULTI_USAGES 1024
+struct hiddev_usage_ref_multi {
+ struct hiddev_usage_ref uref;
+ __u32 num_values;
+ __s32 values[HID_MAX_MULTI_USAGES];
+};
+
+/* FIELD_INDEX_NONE is returned in read() data from the kernel when flags
+ * is set to (HIDDEV_FLAG_UREF | HIDDEV_FLAG_REPORT) and a new report has
+ * been sent by the device
+ */
+#define HID_FIELD_INDEX_NONE 0xffffffff
+
+/*
+ * Protocol version.
+ */
+
+#define HID_VERSION 0x010004
+
+/*
+ * IOCTLs (0x00 - 0x7f)
+ */
+
+#define HIDIOCGVERSION _IOR('H', 0x01, int)
+#define HIDIOCAPPLICATION _IO('H', 0x02)
+#define HIDIOCGDEVINFO _IOR('H', 0x03, struct hiddev_devinfo)
+#define HIDIOCGSTRING _IOR('H', 0x04, struct hiddev_string_descriptor)
+#define HIDIOCINITREPORT _IO('H', 0x05)
+#define HIDIOCGNAME(len) _IOC(_IOC_READ, 'H', 0x06, len)
+#define HIDIOCGREPORT _IOW('H', 0x07, struct hiddev_report_info)
+#define HIDIOCSREPORT _IOW('H', 0x08, struct hiddev_report_info)
+#define HIDIOCGREPORTINFO _IOWR('H', 0x09, struct hiddev_report_info)
+#define HIDIOCGFIELDINFO _IOWR('H', 0x0A, struct hiddev_field_info)
+#define HIDIOCGUSAGE _IOWR('H', 0x0B, struct hiddev_usage_ref)
+#define HIDIOCSUSAGE _IOW('H', 0x0C, struct hiddev_usage_ref)
+#define HIDIOCGUCODE _IOWR('H', 0x0D, struct hiddev_usage_ref)
+#define HIDIOCGFLAG _IOR('H', 0x0E, int)
+#define HIDIOCSFLAG _IOW('H', 0x0F, int)
+#define HIDIOCGCOLLECTIONINDEX _IOW('H', 0x10, struct hiddev_usage_ref)
+#define HIDIOCGCOLLECTIONINFO _IOWR('H', 0x11, struct hiddev_collection_info)
+#define HIDIOCGPHYS(len) _IOC(_IOC_READ, 'H', 0x12, len)
+
+/* For writing/reading to multiple/consecutive usages */
+#define HIDIOCGUSAGES _IOWR('H', 0x13, struct hiddev_usage_ref_multi)
+#define HIDIOCSUSAGES _IOW('H', 0x14, struct hiddev_usage_ref_multi)
+
+/*
+ * Flags to be used in HIDIOCSFLAG
+ */
+#define HIDDEV_FLAG_UREF 0x1
+#define HIDDEV_FLAG_REPORT 0x2
+#define HIDDEV_FLAGS 0x3
+
+/* To traverse the input report descriptor info for a HID device, perform the
+ * following:
+ *
+ * rinfo.report_type = HID_REPORT_TYPE_INPUT;
+ * rinfo.report_id = HID_REPORT_ID_FIRST;
+ * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo);
+ *
+ * while (ret >= 0) {
+ * for (i = 0; i < rinfo.num_fields; i++) {
+ * finfo.report_type = rinfo.report_type;
+ * finfo.report_id = rinfo.report_id;
+ * finfo.field_index = i;
+ * ioctl(fd, HIDIOCGFIELDINFO, &finfo);
+ * for (j = 0; j < finfo.maxusage; j++) {
+ * uref.report_type = rinfo.report_type;
+ * uref.report_id = rinfo.report_id;
+ * uref.field_index = i;
+ * uref.usage_index = j;
+ * ioctl(fd, HIDIOCGUCODE, &uref);
+ * ioctl(fd, HIDIOCGUSAGE, &uref);
+ * }
+ * }
+ * rinfo.report_id |= HID_REPORT_ID_NEXT;
+ * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo);
+ * }
+ */
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hidraw.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hidraw.h
new file mode 100644
index 0000000..9e19979
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hidraw.h
@@ -0,0 +1,47 @@
+#ifndef _HIDRAW_H
+#define _HIDRAW_H
+
+/*
+ * Copyright (c) 2007 Jiri Kosina
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <linux/hid.h>
+#include <linux/types.h>
+
+struct hidraw_report_descriptor {
+ __u32 size;
+ __u8 value[HID_MAX_DESCRIPTOR_SIZE];
+};
+
+struct hidraw_devinfo {
+ __u32 bustype;
+ __s16 vendor;
+ __s16 product;
+};
+
+/* ioctl interface */
+#define HIDIOCGRDESCSIZE _IOR('H', 0x01, int)
+#define HIDIOCGRDESC _IOR('H', 0x02, struct hidraw_report_descriptor)
+#define HIDIOCGRAWINFO _IOR('H', 0x03, struct hidraw_devinfo)
+#define HIDIOCGRAWNAME(len) _IOC(_IOC_READ, 'H', 0x04, len)
+#define HIDIOCGRAWPHYS(len) _IOC(_IOC_READ, 'H', 0x05, len)
+
+#define HIDRAW_FIRST_MINOR 0
+#define HIDRAW_MAX_DEVICES 64
+/* number of reports to buffer */
+#define HIDRAW_BUFFER_SIZE 64
+
+
+/* kernel-only API declarations */
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hpet.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hpet.h
new file mode 100644
index 0000000..263f7fe
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hpet.h
@@ -0,0 +1,23 @@
+#ifndef __HPET__
+#define __HPET__ 1
+
+
+
+
+struct hpet_info {
+ unsigned long hi_ireqfreq; /* Hz */
+ unsigned long hi_flags; /* information */
+ unsigned short hi_hpet;
+ unsigned short hi_timer;
+};
+
+#define HPET_INFO_PERIODIC 0x0010 /* periodic-capable comparator */
+
+#define HPET_IE_ON _IO('h', 0x01) /* interrupt on */
+#define HPET_IE_OFF _IO('h', 0x02) /* interrupt off */
+#define HPET_INFO _IOR('h', 0x03, struct hpet_info)
+#define HPET_EPI _IO('h', 0x04) /* enable periodic */
+#define HPET_DPI _IO('h', 0x05) /* disable periodic */
+#define HPET_IRQFREQ _IOW('h', 0x6, unsigned long) /* IRQFREQ usec */
+
+#endif /* !__HPET__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hysdn_if.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hysdn_if.h
new file mode 100644
index 0000000..00236ae
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/hysdn_if.h
@@ -0,0 +1,33 @@
+/* $Id: hysdn_if.h,v 1.1.8.3 2001/09/23 22:25:05 kai Exp $
+ *
+ * Linux driver for HYSDN cards
+ * ioctl definitions shared by hynetmgr and driver.
+ *
+ * Author Werner Cornelius (werner@titro.de) for Hypercope GmbH
+ * Copyright 1999 by Werner Cornelius (werner@titro.de)
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
+
+/****************/
+/* error values */
+/****************/
+#define ERR_NONE 0 /* no error occurred */
+#define ERR_ALREADY_BOOT 1000 /* we are already booting */
+#define EPOF_BAD_MAGIC 1001 /* bad magic in POF header */
+#define ERR_BOARD_DPRAM 1002 /* board DPRAM failed */
+#define EPOF_INTERNAL 1003 /* internal POF handler error */
+#define EPOF_BAD_IMG_SIZE 1004 /* POF boot image size invalid */
+#define ERR_BOOTIMG_FAIL 1005 /* 1. stage boot image did not start */
+#define ERR_BOOTSEQ_FAIL 1006 /* 2. stage boot seq handshake timeout */
+#define ERR_POF_TIMEOUT 1007 /* timeout waiting for card pof ready */
+#define ERR_NOT_BOOTED 1008 /* operation only allowed when booted */
+#define ERR_CONF_LONG 1009 /* conf line is too long */
+#define ERR_INV_CHAN 1010 /* invalid channel number */
+#define ERR_ASYNC_TIME 1011 /* timeout sending async data */
+
+
+
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/i2c-dev.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/i2c-dev.h
new file mode 100644
index 0000000..271d475
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/i2c-dev.h
@@ -0,0 +1,71 @@
+/*
+ i2c-dev.h - i2c-bus driver, char device interface
+
+ Copyright (C) 1995-97 Simon G. Vogl
+ Copyright (C) 1998-99 Frodo Looijaard <frodol@dds.nl>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef _LINUX_I2C_DEV_H
+#define _LINUX_I2C_DEV_H
+
+#include <linux/types.h>
+
+
+/* /dev/i2c-X ioctl commands. The ioctl's parameter is always an
+ * unsigned long, except for:
+ * - I2C_FUNCS, takes pointer to an unsigned long
+ * - I2C_RDWR, takes pointer to struct i2c_rdwr_ioctl_data
+ * - I2C_SMBUS, takes pointer to struct i2c_smbus_ioctl_data
+ */
+#define I2C_RETRIES 0x0701 /* number of times a device address should
+ be polled when not acknowledging */
+#define I2C_TIMEOUT 0x0702 /* set timeout in units of 10 ms */
+
+/* NOTE: Slave address is 7 or 10 bits, but 10-bit addresses
+ * are NOT supported! (due to code brokenness)
+ */
+#define I2C_SLAVE 0x0703 /* Use this slave address */
+#define I2C_SLAVE_FORCE 0x0706 /* Use this slave address, even if it
+ is already in use by a driver! */
+#define I2C_TENBIT 0x0704 /* 0 for 7 bit addrs, != 0 for 10 bit */
+
+#define I2C_FUNCS 0x0705 /* Get the adapter functionality mask */
+
+#define I2C_RDWR 0x0707 /* Combined R/W transfer (one STOP only) */
+
+#define I2C_PEC 0x0708 /* != 0 to use PEC with SMBus */
+#define I2C_SMBUS 0x0720 /* SMBus transfer */
+
+
+/* This is the structure as used in the I2C_SMBUS ioctl call */
+struct i2c_smbus_ioctl_data {
+ __u8 read_write;
+ __u8 command;
+ __u32 size;
+ union i2c_smbus_data *data;
+};
+
+/* This is the structure as used in the I2C_RDWR ioctl call */
+struct i2c_rdwr_ioctl_data {
+ struct i2c_msg *msgs; /* pointers to i2c_msgs */
+ __u32 nmsgs; /* number of i2c_msgs */
+};
+
+#define I2C_RDRW_IOCTL_MAX_MSGS 42
+
+
+#endif /* _LINUX_I2C_DEV_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/i2c.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/i2c.h
new file mode 100644
index 0000000..6d77f1f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/i2c.h
@@ -0,0 +1,149 @@
+/* ------------------------------------------------------------------------- */
+/* */
+/* i2c.h - definitions for the i2c-bus interface */
+/* */
+/* ------------------------------------------------------------------------- */
+/* Copyright (C) 1995-2000 Simon G. Vogl
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+/* ------------------------------------------------------------------------- */
+
+/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and
+ Frodo Looijaard <frodol@dds.nl> */
+
+#ifndef _LINUX_I2C_H
+#define _LINUX_I2C_H
+
+#include <linux/types.h>
+
+/**
+ * struct i2c_msg - an I2C transaction segment beginning with START
+ * @addr: Slave address, either seven or ten bits. When this is a ten
+ * bit address, I2C_M_TEN must be set in @flags and the adapter
+ * must support I2C_FUNC_10BIT_ADDR.
+ * @flags: I2C_M_RD is handled by all adapters. No other flags may be
+ * provided unless the adapter exported the relevant I2C_FUNC_*
+ * flags through i2c_check_functionality().
+ * @len: Number of data bytes in @buf being read from or written to the
+ * I2C slave address. For read transactions where I2C_M_RECV_LEN
+ * is set, the caller guarantees that this buffer can hold up to
+ * 32 bytes in addition to the initial length byte sent by the
+ * slave (plus, if used, the SMBus PEC); and this value will be
+ * incremented by the number of block data bytes received.
+ * @buf: The buffer into which data is read, or from which it's written.
+ *
+ * An i2c_msg is the low level representation of one segment of an I2C
+ * transaction. It is visible to drivers in the @i2c_transfer() procedure,
+ * to userspace from i2c-dev, and to I2C adapter drivers through the
+ * @i2c_adapter.@master_xfer() method.
+ *
+ * Except when I2C "protocol mangling" is used, all I2C adapters implement
+ * the standard rules for I2C transactions. Each transaction begins with a
+ * START. That is followed by the slave address, and a bit encoding read
+ * versus write. Then follow all the data bytes, possibly including a byte
+ * with SMBus PEC. The transfer terminates with a NAK, or when all those
+ * bytes have been transferred and ACKed. If this is the last message in a
+ * group, it is followed by a STOP. Otherwise it is followed by the next
+ * @i2c_msg transaction segment, beginning with a (repeated) START.
+ *
+ * Alternatively, when the adapter supports I2C_FUNC_PROTOCOL_MANGLING then
+ * passing certain @flags may have changed those standard protocol behaviors.
+ * Those flags are only for use with broken/nonconforming slaves, and with
+ * adapters which are known to support the specific mangling options they
+ * need (one or more of IGNORE_NAK, NO_RD_ACK, NOSTART, and REV_DIR_ADDR).
+ */
+struct i2c_msg {
+ __u16 addr; /* slave address */
+ __u16 flags;
+#define I2C_M_TEN 0x0010 /* this is a ten bit chip address */
+#define I2C_M_RD 0x0001 /* read data, from slave to master */
+#define I2C_M_NOSTART 0x4000 /* if I2C_FUNC_PROTOCOL_MANGLING */
+#define I2C_M_REV_DIR_ADDR 0x2000 /* if I2C_FUNC_PROTOCOL_MANGLING */
+#define I2C_M_IGNORE_NAK 0x1000 /* if I2C_FUNC_PROTOCOL_MANGLING */
+#define I2C_M_NO_RD_ACK 0x0800 /* if I2C_FUNC_PROTOCOL_MANGLING */
+#define I2C_M_RECV_LEN 0x0400 /* length will be first received byte */
+ __u16 len; /* msg length */
+ __u8 *buf; /* pointer to msg data */
+};
+
+/* To determine what functionality is present */
+
+#define I2C_FUNC_I2C 0x00000001
+#define I2C_FUNC_10BIT_ADDR 0x00000002
+#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_NOSTART etc. */
+#define I2C_FUNC_SMBUS_PEC 0x00000008
+#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */
+#define I2C_FUNC_SMBUS_QUICK 0x00010000
+#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
+#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000
+#define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000
+#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000
+#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000
+#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000
+#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000
+#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000
+#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000
+#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */
+#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */
+
+#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \
+ I2C_FUNC_SMBUS_WRITE_BYTE)
+#define I2C_FUNC_SMBUS_BYTE_DATA (I2C_FUNC_SMBUS_READ_BYTE_DATA | \
+ I2C_FUNC_SMBUS_WRITE_BYTE_DATA)
+#define I2C_FUNC_SMBUS_WORD_DATA (I2C_FUNC_SMBUS_READ_WORD_DATA | \
+ I2C_FUNC_SMBUS_WRITE_WORD_DATA)
+#define I2C_FUNC_SMBUS_BLOCK_DATA (I2C_FUNC_SMBUS_READ_BLOCK_DATA | \
+ I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)
+#define I2C_FUNC_SMBUS_I2C_BLOCK (I2C_FUNC_SMBUS_READ_I2C_BLOCK | \
+ I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)
+
+#define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | \
+ I2C_FUNC_SMBUS_BYTE | \
+ I2C_FUNC_SMBUS_BYTE_DATA | \
+ I2C_FUNC_SMBUS_WORD_DATA | \
+ I2C_FUNC_SMBUS_PROC_CALL | \
+ I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \
+ I2C_FUNC_SMBUS_I2C_BLOCK | \
+ I2C_FUNC_SMBUS_PEC)
+
+/*
+ * Data for SMBus Messages
+ */
+#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */
+union i2c_smbus_data {
+ __u8 byte;
+ __u16 word;
+ __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */
+ /* and one more for user-space compatibility */
+};
+
+/* i2c_smbus_xfer read or write markers */
+#define I2C_SMBUS_READ 1
+#define I2C_SMBUS_WRITE 0
+
+/* SMBus transaction types (size parameter in the above functions)
+ Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */
+#define I2C_SMBUS_QUICK 0
+#define I2C_SMBUS_BYTE 1
+#define I2C_SMBUS_BYTE_DATA 2
+#define I2C_SMBUS_WORD_DATA 3
+#define I2C_SMBUS_PROC_CALL 4
+#define I2C_SMBUS_BLOCK_DATA 5
+#define I2C_SMBUS_I2C_BLOCK_BROKEN 6
+#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */
+#define I2C_SMBUS_I2C_BLOCK_DATA 8
+
+
+#endif /* _LINUX_I2C_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/i2o-dev.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/i2o-dev.h
new file mode 100644
index 0000000..bc580b6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/i2o-dev.h
@@ -0,0 +1,421 @@
+/*
+ * I2O user space accessible structures/APIs
+ *
+ * (c) Copyright 1999, 2000 Red Hat Software
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ *************************************************************************
+ *
+ * This header file defines the I2O APIs that are available to both
+ * the kernel and user level applications. Kernel specific structures
+ * are defined in i2o_osm. OSMs should include _only_ i2o_osm.h which
+ * automatically includes this file.
+ *
+ */
+
+#ifndef _I2O_DEV_H
+#define _I2O_DEV_H
+
+/* How many controllers are we allowing */
+#define MAX_I2O_CONTROLLERS 32
+
+#include <linux/ioctl.h>
+#include <linux/types.h>
+
+/*
+ * I2O Control IOCTLs and structures
+ */
+#define I2O_MAGIC_NUMBER 'i'
+#define I2OGETIOPS _IOR(I2O_MAGIC_NUMBER,0,__u8[MAX_I2O_CONTROLLERS])
+#define I2OHRTGET _IOWR(I2O_MAGIC_NUMBER,1,struct i2o_cmd_hrtlct)
+#define I2OLCTGET _IOWR(I2O_MAGIC_NUMBER,2,struct i2o_cmd_hrtlct)
+#define I2OPARMSET _IOWR(I2O_MAGIC_NUMBER,3,struct i2o_cmd_psetget)
+#define I2OPARMGET _IOWR(I2O_MAGIC_NUMBER,4,struct i2o_cmd_psetget)
+#define I2OSWDL _IOWR(I2O_MAGIC_NUMBER,5,struct i2o_sw_xfer)
+#define I2OSWUL _IOWR(I2O_MAGIC_NUMBER,6,struct i2o_sw_xfer)
+#define I2OSWDEL _IOWR(I2O_MAGIC_NUMBER,7,struct i2o_sw_xfer)
+#define I2OVALIDATE _IOR(I2O_MAGIC_NUMBER,8,__u32)
+#define I2OHTML _IOWR(I2O_MAGIC_NUMBER,9,struct i2o_html)
+#define I2OEVTREG _IOW(I2O_MAGIC_NUMBER,10,struct i2o_evt_id)
+#define I2OEVTGET _IOR(I2O_MAGIC_NUMBER,11,struct i2o_evt_info)
+#define I2OPASSTHRU _IOR(I2O_MAGIC_NUMBER,12,struct i2o_cmd_passthru)
+#define I2OPASSTHRU32 _IOR(I2O_MAGIC_NUMBER,12,struct i2o_cmd_passthru32)
+
+struct i2o_cmd_passthru32 {
+ unsigned int iop; /* IOP unit number */
+ __u32 msg; /* message */
+};
+
+struct i2o_cmd_passthru {
+ unsigned int iop; /* IOP unit number */
+ void *msg; /* message */
+};
+
+struct i2o_cmd_hrtlct {
+ unsigned int iop; /* IOP unit number */
+ void *resbuf; /* Buffer for result */
+ unsigned int *reslen; /* Buffer length in bytes */
+};
+
+struct i2o_cmd_psetget {
+ unsigned int iop; /* IOP unit number */
+ unsigned int tid; /* Target device TID */
+ void *opbuf; /* Operation List buffer */
+ unsigned int oplen; /* Operation List buffer length in bytes */
+ void *resbuf; /* Result List buffer */
+ unsigned int *reslen; /* Result List buffer length in bytes */
+};
+
+struct i2o_sw_xfer {
+ unsigned int iop; /* IOP unit number */
+ unsigned char flags; /* Flags field */
+ unsigned char sw_type; /* Software type */
+ unsigned int sw_id; /* Software ID */
+ void *buf; /* Pointer to software buffer */
+ unsigned int *swlen; /* Length of software data */
+ unsigned int *maxfrag; /* Maximum fragment count */
+ unsigned int *curfrag; /* Current fragment count */
+};
+
+struct i2o_html {
+ unsigned int iop; /* IOP unit number */
+ unsigned int tid; /* Target device ID */
+ unsigned int page; /* HTML page */
+ void *resbuf; /* Buffer for reply HTML page */
+ unsigned int *reslen; /* Length in bytes of reply buffer */
+ void *qbuf; /* Pointer to HTTP query string */
+ unsigned int qlen; /* Length in bytes of query string buffer */
+};
+
+#define I2O_EVT_Q_LEN 32
+
+struct i2o_evt_id {
+ unsigned int iop;
+ unsigned int tid;
+ unsigned int evt_mask;
+};
+
+/* Event data size = frame size - message header + evt indicator */
+#define I2O_EVT_DATA_SIZE 88
+
+struct i2o_evt_info {
+ struct i2o_evt_id id;
+ unsigned char evt_data[I2O_EVT_DATA_SIZE];
+ unsigned int data_size;
+};
+
+struct i2o_evt_get {
+ struct i2o_evt_info info;
+ int pending;
+ int lost;
+};
+
+typedef struct i2o_sg_io_hdr {
+ unsigned int flags; /* see I2O_DPT_SG_IO_FLAGS */
+} i2o_sg_io_hdr_t;
+
+/**************************************************************************
+ * HRT related constants and structures
+ **************************************************************************/
+#define I2O_BUS_LOCAL 0
+#define I2O_BUS_ISA 1
+#define I2O_BUS_EISA 2
+#define I2O_BUS_MCA 3
+#define I2O_BUS_PCI 4
+#define I2O_BUS_PCMCIA 5
+#define I2O_BUS_NUBUS 6
+#define I2O_BUS_CARDBUS 7
+#define I2O_BUS_UNKNOWN 0x80
+
+typedef struct _i2o_pci_bus {
+ __u8 PciFunctionNumber;
+ __u8 PciDeviceNumber;
+ __u8 PciBusNumber;
+ __u8 reserved;
+ __u16 PciVendorID;
+ __u16 PciDeviceID;
+} i2o_pci_bus;
+
+typedef struct _i2o_local_bus {
+ __u16 LbBaseIOPort;
+ __u16 reserved;
+ __u32 LbBaseMemoryAddress;
+} i2o_local_bus;
+
+typedef struct _i2o_isa_bus {
+ __u16 IsaBaseIOPort;
+ __u8 CSN;
+ __u8 reserved;
+ __u32 IsaBaseMemoryAddress;
+} i2o_isa_bus;
+
+typedef struct _i2o_eisa_bus_info {
+ __u16 EisaBaseIOPort;
+ __u8 reserved;
+ __u8 EisaSlotNumber;
+ __u32 EisaBaseMemoryAddress;
+} i2o_eisa_bus;
+
+typedef struct _i2o_mca_bus {
+ __u16 McaBaseIOPort;
+ __u8 reserved;
+ __u8 McaSlotNumber;
+ __u32 McaBaseMemoryAddress;
+} i2o_mca_bus;
+
+typedef struct _i2o_other_bus {
+ __u16 BaseIOPort;
+ __u16 reserved;
+ __u32 BaseMemoryAddress;
+} i2o_other_bus;
+
+typedef struct _i2o_hrt_entry {
+ __u32 adapter_id;
+ __u32 parent_tid:12;
+ __u32 state:4;
+ __u32 bus_num:8;
+ __u32 bus_type:8;
+ union {
+ i2o_pci_bus pci_bus;
+ i2o_local_bus local_bus;
+ i2o_isa_bus isa_bus;
+ i2o_eisa_bus eisa_bus;
+ i2o_mca_bus mca_bus;
+ i2o_other_bus other_bus;
+ } bus;
+} i2o_hrt_entry;
+
+typedef struct _i2o_hrt {
+ __u16 num_entries;
+ __u8 entry_len;
+ __u8 hrt_version;
+ __u32 change_ind;
+ i2o_hrt_entry hrt_entry[1];
+} i2o_hrt;
+
+typedef struct _i2o_lct_entry {
+ __u32 entry_size:16;
+ __u32 tid:12;
+ __u32 reserved:4;
+ __u32 change_ind;
+ __u32 device_flags;
+ __u32 class_id:12;
+ __u32 version:4;
+ __u32 vendor_id:16;
+ __u32 sub_class;
+ __u32 user_tid:12;
+ __u32 parent_tid:12;
+ __u32 bios_info:8;
+ __u8 identity_tag[8];
+ __u32 event_capabilities;
+} i2o_lct_entry;
+
+typedef struct _i2o_lct {
+ __u32 table_size:16;
+ __u32 boot_tid:12;
+ __u32 lct_ver:4;
+ __u32 iop_flags;
+ __u32 change_ind;
+ i2o_lct_entry lct_entry[1];
+} i2o_lct;
+
+typedef struct _i2o_status_block {
+ __u16 org_id;
+ __u16 reserved;
+ __u16 iop_id:12;
+ __u16 reserved1:4;
+ __u16 host_unit_id;
+ __u16 segment_number:12;
+ __u16 i2o_version:4;
+ __u8 iop_state;
+ __u8 msg_type;
+ __u16 inbound_frame_size;
+ __u8 init_code;
+ __u8 reserved2;
+ __u32 max_inbound_frames;
+ __u32 cur_inbound_frames;
+ __u32 max_outbound_frames;
+ char product_id[24];
+ __u32 expected_lct_size;
+ __u32 iop_capabilities;
+ __u32 desired_mem_size;
+ __u32 current_mem_size;
+ __u32 current_mem_base;
+ __u32 desired_io_size;
+ __u32 current_io_size;
+ __u32 current_io_base;
+ __u32 reserved3:24;
+ __u32 cmd_status:8;
+} i2o_status_block;
+
+/* Event indicator mask flags */
+#define I2O_EVT_IND_STATE_CHANGE 0x80000000
+#define I2O_EVT_IND_GENERAL_WARNING 0x40000000
+#define I2O_EVT_IND_CONFIGURATION_FLAG 0x20000000
+#define I2O_EVT_IND_LOCK_RELEASE 0x10000000
+#define I2O_EVT_IND_CAPABILITY_CHANGE 0x08000000
+#define I2O_EVT_IND_DEVICE_RESET 0x04000000
+#define I2O_EVT_IND_EVT_MASK_MODIFIED 0x02000000
+#define I2O_EVT_IND_FIELD_MODIFIED 0x01000000
+#define I2O_EVT_IND_VENDOR_EVT 0x00800000
+#define I2O_EVT_IND_DEVICE_STATE 0x00400000
+
+/* Executive event indicitors */
+#define I2O_EVT_IND_EXEC_RESOURCE_LIMITS 0x00000001
+#define I2O_EVT_IND_EXEC_CONNECTION_FAIL 0x00000002
+#define I2O_EVT_IND_EXEC_ADAPTER_FAULT 0x00000004
+#define I2O_EVT_IND_EXEC_POWER_FAIL 0x00000008
+#define I2O_EVT_IND_EXEC_RESET_PENDING 0x00000010
+#define I2O_EVT_IND_EXEC_RESET_IMMINENT 0x00000020
+#define I2O_EVT_IND_EXEC_HW_FAIL 0x00000040
+#define I2O_EVT_IND_EXEC_XCT_CHANGE 0x00000080
+#define I2O_EVT_IND_EXEC_NEW_LCT_ENTRY 0x00000100
+#define I2O_EVT_IND_EXEC_MODIFIED_LCT 0x00000200
+#define I2O_EVT_IND_EXEC_DDM_AVAILABILITY 0x00000400
+
+/* Random Block Storage Event Indicators */
+#define I2O_EVT_IND_BSA_VOLUME_LOAD 0x00000001
+#define I2O_EVT_IND_BSA_VOLUME_UNLOAD 0x00000002
+#define I2O_EVT_IND_BSA_VOLUME_UNLOAD_REQ 0x00000004
+#define I2O_EVT_IND_BSA_CAPACITY_CHANGE 0x00000008
+#define I2O_EVT_IND_BSA_SCSI_SMART 0x00000010
+
+/* Event data for generic events */
+#define I2O_EVT_STATE_CHANGE_NORMAL 0x00
+#define I2O_EVT_STATE_CHANGE_SUSPENDED 0x01
+#define I2O_EVT_STATE_CHANGE_RESTART 0x02
+#define I2O_EVT_STATE_CHANGE_NA_RECOVER 0x03
+#define I2O_EVT_STATE_CHANGE_NA_NO_RECOVER 0x04
+#define I2O_EVT_STATE_CHANGE_QUIESCE_REQUEST 0x05
+#define I2O_EVT_STATE_CHANGE_FAILED 0x10
+#define I2O_EVT_STATE_CHANGE_FAULTED 0x11
+
+#define I2O_EVT_GEN_WARNING_NORMAL 0x00
+#define I2O_EVT_GEN_WARNING_ERROR_THRESHOLD 0x01
+#define I2O_EVT_GEN_WARNING_MEDIA_FAULT 0x02
+
+#define I2O_EVT_CAPABILITY_OTHER 0x01
+#define I2O_EVT_CAPABILITY_CHANGED 0x02
+
+#define I2O_EVT_SENSOR_STATE_CHANGED 0x01
+
+/*
+ * I2O classes / subclasses
+ */
+
+/* Class ID and Code Assignments
+ * (LCT.ClassID.Version field)
+ */
+#define I2O_CLASS_VERSION_10 0x00
+#define I2O_CLASS_VERSION_11 0x01
+
+/* Class code names
+ * (from v1.5 Table 6-1 Class Code Assignments.)
+ */
+
+#define I2O_CLASS_EXECUTIVE 0x000
+#define I2O_CLASS_DDM 0x001
+#define I2O_CLASS_RANDOM_BLOCK_STORAGE 0x010
+#define I2O_CLASS_SEQUENTIAL_STORAGE 0x011
+#define I2O_CLASS_LAN 0x020
+#define I2O_CLASS_WAN 0x030
+#define I2O_CLASS_FIBRE_CHANNEL_PORT 0x040
+#define I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL 0x041
+#define I2O_CLASS_SCSI_PERIPHERAL 0x051
+#define I2O_CLASS_ATE_PORT 0x060
+#define I2O_CLASS_ATE_PERIPHERAL 0x061
+#define I2O_CLASS_FLOPPY_CONTROLLER 0x070
+#define I2O_CLASS_FLOPPY_DEVICE 0x071
+#define I2O_CLASS_BUS_ADAPTER 0x080
+#define I2O_CLASS_PEER_TRANSPORT_AGENT 0x090
+#define I2O_CLASS_PEER_TRANSPORT 0x091
+#define I2O_CLASS_END 0xfff
+
+/*
+ * Rest of 0x092 - 0x09f reserved for peer-to-peer classes
+ */
+
+#define I2O_CLASS_MATCH_ANYCLASS 0xffffffff
+
+/*
+ * Subclasses
+ */
+
+#define I2O_SUBCLASS_i960 0x001
+#define I2O_SUBCLASS_HDM 0x020
+#define I2O_SUBCLASS_ISM 0x021
+
+/* Operation functions */
+
+#define I2O_PARAMS_FIELD_GET 0x0001
+#define I2O_PARAMS_LIST_GET 0x0002
+#define I2O_PARAMS_MORE_GET 0x0003
+#define I2O_PARAMS_SIZE_GET 0x0004
+#define I2O_PARAMS_TABLE_GET 0x0005
+#define I2O_PARAMS_FIELD_SET 0x0006
+#define I2O_PARAMS_LIST_SET 0x0007
+#define I2O_PARAMS_ROW_ADD 0x0008
+#define I2O_PARAMS_ROW_DELETE 0x0009
+#define I2O_PARAMS_TABLE_CLEAR 0x000A
+
+/*
+ * I2O serial number conventions / formats
+ * (circa v1.5)
+ */
+
+#define I2O_SNFORMAT_UNKNOWN 0
+#define I2O_SNFORMAT_BINARY 1
+#define I2O_SNFORMAT_ASCII 2
+#define I2O_SNFORMAT_UNICODE 3
+#define I2O_SNFORMAT_LAN48_MAC 4
+#define I2O_SNFORMAT_WAN 5
+
+/*
+ * Plus new in v2.0 (Yellowstone pdf doc)
+ */
+
+#define I2O_SNFORMAT_LAN64_MAC 6
+#define I2O_SNFORMAT_DDM 7
+#define I2O_SNFORMAT_IEEE_REG64 8
+#define I2O_SNFORMAT_IEEE_REG128 9
+#define I2O_SNFORMAT_UNKNOWN2 0xff
+
+/*
+ * I2O Get Status State values
+ */
+
+#define ADAPTER_STATE_INITIALIZING 0x01
+#define ADAPTER_STATE_RESET 0x02
+#define ADAPTER_STATE_HOLD 0x04
+#define ADAPTER_STATE_READY 0x05
+#define ADAPTER_STATE_OPERATIONAL 0x08
+#define ADAPTER_STATE_FAILED 0x10
+#define ADAPTER_STATE_FAULTED 0x11
+
+/*
+ * Software module types
+ */
+#define I2O_SOFTWARE_MODULE_IRTOS 0x11
+#define I2O_SOFTWARE_MODULE_IOP_PRIVATE 0x22
+#define I2O_SOFTWARE_MODULE_IOP_CONFIG 0x23
+
+/*
+ * Vendors
+ */
+#define I2O_VENDOR_DPT 0x001b
+
+/*
+ * DPT / Adaptec specific values for i2o_sg_io_hdr flags.
+ */
+#define I2O_DPT_SG_FLAG_INTERPRET 0x00010000
+#define I2O_DPT_SG_FLAG_PHYSICAL 0x00020000
+
+#define I2O_DPT_FLASH_FRAG_SIZE 0x10000
+#define I2O_DPT_FLASH_READ 0x0101
+#define I2O_DPT_FLASH_WRITE 0x0102
+
+#endif /* _I2O_DEV_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/i8k.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/i8k.h
new file mode 100644
index 0000000..1c45ba5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/i8k.h
@@ -0,0 +1,46 @@
+/*
+ * i8k.h -- Linux driver for accessing the SMM BIOS on Dell laptops
+ *
+ * Copyright (C) 2001 Massimo Dal Zotto <dz@debian.org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef _LINUX_I8K_H
+#define _LINUX_I8K_H
+
+#define I8K_PROC "/proc/i8k"
+#define I8K_PROC_FMT "1.0"
+
+#define I8K_BIOS_VERSION _IOR ('i', 0x80, int) /* broken: meant 4 bytes */
+#define I8K_MACHINE_ID _IOR ('i', 0x81, int) /* broken: meant 16 bytes */
+#define I8K_POWER_STATUS _IOR ('i', 0x82, size_t)
+#define I8K_FN_STATUS _IOR ('i', 0x83, size_t)
+#define I8K_GET_TEMP _IOR ('i', 0x84, size_t)
+#define I8K_GET_SPEED _IOWR('i', 0x85, size_t)
+#define I8K_GET_FAN _IOWR('i', 0x86, size_t)
+#define I8K_SET_FAN _IOWR('i', 0x87, size_t)
+
+#define I8K_FAN_LEFT 1
+#define I8K_FAN_RIGHT 0
+#define I8K_FAN_OFF 0
+#define I8K_FAN_LOW 1
+#define I8K_FAN_HIGH 2
+#define I8K_FAN_MAX I8K_FAN_HIGH
+
+#define I8K_VOL_UP 1
+#define I8K_VOL_DOWN 2
+#define I8K_VOL_MUTE 4
+
+#define I8K_AC 1
+#define I8K_BATTERY 0
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/icmp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/icmp.h
new file mode 100644
index 0000000..9eedab5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/icmp.h
@@ -0,0 +1,97 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Definitions for the ICMP protocol.
+ *
+ * Version: @(#)icmp.h 1.0.3 04/28/93
+ *
+ * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_ICMP_H
+#define _LINUX_ICMP_H
+
+#include <linux/types.h>
+
+#define ICMP_ECHOREPLY 0 /* Echo Reply */
+#define ICMP_DEST_UNREACH 3 /* Destination Unreachable */
+#define ICMP_SOURCE_QUENCH 4 /* Source Quench */
+#define ICMP_REDIRECT 5 /* Redirect (change route) */
+#define ICMP_ECHO 8 /* Echo Request */
+#define ICMP_TIME_EXCEEDED 11 /* Time Exceeded */
+#define ICMP_PARAMETERPROB 12 /* Parameter Problem */
+#define ICMP_TIMESTAMP 13 /* Timestamp Request */
+#define ICMP_TIMESTAMPREPLY 14 /* Timestamp Reply */
+#define ICMP_INFO_REQUEST 15 /* Information Request */
+#define ICMP_INFO_REPLY 16 /* Information Reply */
+#define ICMP_ADDRESS 17 /* Address Mask Request */
+#define ICMP_ADDRESSREPLY 18 /* Address Mask Reply */
+#define NR_ICMP_TYPES 18
+
+
+/* Codes for UNREACH. */
+#define ICMP_NET_UNREACH 0 /* Network Unreachable */
+#define ICMP_HOST_UNREACH 1 /* Host Unreachable */
+#define ICMP_PROT_UNREACH 2 /* Protocol Unreachable */
+#define ICMP_PORT_UNREACH 3 /* Port Unreachable */
+#define ICMP_FRAG_NEEDED 4 /* Fragmentation Needed/DF set */
+#define ICMP_SR_FAILED 5 /* Source Route failed */
+#define ICMP_NET_UNKNOWN 6
+#define ICMP_HOST_UNKNOWN 7
+#define ICMP_HOST_ISOLATED 8
+#define ICMP_NET_ANO 9
+#define ICMP_HOST_ANO 10
+#define ICMP_NET_UNR_TOS 11
+#define ICMP_HOST_UNR_TOS 12
+#define ICMP_PKT_FILTERED 13 /* Packet filtered */
+#define ICMP_PREC_VIOLATION 14 /* Precedence violation */
+#define ICMP_PREC_CUTOFF 15 /* Precedence cut off */
+#define NR_ICMP_UNREACH 15 /* instead of hardcoding immediate value */
+
+/* Codes for REDIRECT. */
+#define ICMP_REDIR_NET 0 /* Redirect Net */
+#define ICMP_REDIR_HOST 1 /* Redirect Host */
+#define ICMP_REDIR_NETTOS 2 /* Redirect Net for TOS */
+#define ICMP_REDIR_HOSTTOS 3 /* Redirect Host for TOS */
+
+/* Codes for TIME_EXCEEDED. */
+#define ICMP_EXC_TTL 0 /* TTL count exceeded */
+#define ICMP_EXC_FRAGTIME 1 /* Fragment Reass time exceeded */
+
+
+struct icmphdr {
+ __u8 type;
+ __u8 code;
+ __sum16 checksum;
+ union {
+ struct {
+ __be16 id;
+ __be16 sequence;
+ } echo;
+ __be32 gateway;
+ struct {
+ __be16 __unused;
+ __be16 mtu;
+ } frag;
+ } un;
+};
+
+
+/*
+ * constants for (set|get)sockopt
+ */
+
+#define ICMP_FILTER 1
+
+struct icmp_filter {
+ __u32 data;
+};
+
+
+#endif /* _LINUX_ICMP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/icmpv6.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/icmpv6.h
new file mode 100644
index 0000000..5093dfc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/icmpv6.h
@@ -0,0 +1,164 @@
+#ifndef _LINUX_ICMPV6_H
+#define _LINUX_ICMPV6_H
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+struct icmp6hdr {
+
+ __u8 icmp6_type;
+ __u8 icmp6_code;
+ __sum16 icmp6_cksum;
+
+
+ union {
+ __be32 un_data32[1];
+ __be16 un_data16[2];
+ __u8 un_data8[4];
+
+ struct icmpv6_echo {
+ __be16 identifier;
+ __be16 sequence;
+ } u_echo;
+
+ struct icmpv6_nd_advt {
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u32 reserved:5,
+ override:1,
+ solicited:1,
+ router:1,
+ reserved2:24;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u32 router:1,
+ solicited:1,
+ override:1,
+ reserved:29;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+ } u_nd_advt;
+
+ struct icmpv6_nd_ra {
+ __u8 hop_limit;
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 reserved:3,
+ router_pref:2,
+ home_agent:1,
+ other:1,
+ managed:1;
+
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u8 managed:1,
+ other:1,
+ home_agent:1,
+ router_pref:2,
+ reserved:3;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+ __be16 rt_lifetime;
+ } u_nd_ra;
+
+ } icmp6_dataun;
+
+#define icmp6_identifier icmp6_dataun.u_echo.identifier
+#define icmp6_sequence icmp6_dataun.u_echo.sequence
+#define icmp6_pointer icmp6_dataun.un_data32[0]
+#define icmp6_mtu icmp6_dataun.un_data32[0]
+#define icmp6_unused icmp6_dataun.un_data32[0]
+#define icmp6_maxdelay icmp6_dataun.un_data16[0]
+#define icmp6_router icmp6_dataun.u_nd_advt.router
+#define icmp6_solicited icmp6_dataun.u_nd_advt.solicited
+#define icmp6_override icmp6_dataun.u_nd_advt.override
+#define icmp6_ndiscreserved icmp6_dataun.u_nd_advt.reserved
+#define icmp6_hop_limit icmp6_dataun.u_nd_ra.hop_limit
+#define icmp6_addrconf_managed icmp6_dataun.u_nd_ra.managed
+#define icmp6_addrconf_other icmp6_dataun.u_nd_ra.other
+#define icmp6_rt_lifetime icmp6_dataun.u_nd_ra.rt_lifetime
+#define icmp6_router_pref icmp6_dataun.u_nd_ra.router_pref
+};
+
+
+#define ICMPV6_ROUTER_PREF_LOW 0x3
+#define ICMPV6_ROUTER_PREF_MEDIUM 0x0
+#define ICMPV6_ROUTER_PREF_HIGH 0x1
+#define ICMPV6_ROUTER_PREF_INVALID 0x2
+
+#define ICMPV6_DEST_UNREACH 1
+#define ICMPV6_PKT_TOOBIG 2
+#define ICMPV6_TIME_EXCEED 3
+#define ICMPV6_PARAMPROB 4
+
+#define ICMPV6_INFOMSG_MASK 0x80
+
+#define ICMPV6_ECHO_REQUEST 128
+#define ICMPV6_ECHO_REPLY 129
+#define ICMPV6_MGM_QUERY 130
+#define ICMPV6_MGM_REPORT 131
+#define ICMPV6_MGM_REDUCTION 132
+
+#define ICMPV6_NI_QUERY 139
+#define ICMPV6_NI_REPLY 140
+
+#define ICMPV6_MLD2_REPORT 143
+
+#define ICMPV6_DHAAD_REQUEST 144
+#define ICMPV6_DHAAD_REPLY 145
+#define ICMPV6_MOBILE_PREFIX_SOL 146
+#define ICMPV6_MOBILE_PREFIX_ADV 147
+
+/*
+ * Codes for Destination Unreachable
+ */
+#define ICMPV6_NOROUTE 0
+#define ICMPV6_ADM_PROHIBITED 1
+#define ICMPV6_NOT_NEIGHBOUR 2
+#define ICMPV6_ADDR_UNREACH 3
+#define ICMPV6_PORT_UNREACH 4
+
+/*
+ * Codes for Time Exceeded
+ */
+#define ICMPV6_EXC_HOPLIMIT 0
+#define ICMPV6_EXC_FRAGTIME 1
+
+/*
+ * Codes for Parameter Problem
+ */
+#define ICMPV6_HDR_FIELD 0
+#define ICMPV6_UNK_NEXTHDR 1
+#define ICMPV6_UNK_OPTION 2
+
+/*
+ * constants for (set|get)sockopt
+ */
+
+#define ICMPV6_FILTER 1
+
+/*
+ * ICMPV6 filter
+ */
+
+#define ICMPV6_FILTER_BLOCK 1
+#define ICMPV6_FILTER_PASS 2
+#define ICMPV6_FILTER_BLOCKOTHERS 3
+#define ICMPV6_FILTER_PASSONLY 4
+
+struct icmp6_filter {
+ __u32 data[8];
+};
+
+/*
+ * Definitions for MLDv2
+ */
+#define MLD2_MODE_IS_INCLUDE 1
+#define MLD2_MODE_IS_EXCLUDE 2
+#define MLD2_CHANGE_TO_INCLUDE 3
+#define MLD2_CHANGE_TO_EXCLUDE 4
+#define MLD2_ALLOW_NEW_SOURCES 5
+#define MLD2_BLOCK_OLD_SOURCES 6
+
+#define MLD2_ALL_MCR_INIT { { { 0xff,0x02,0,0,0,0,0,0,0,0,0,0,0,0,0,0x16 } } }
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if.h
new file mode 100644
index 0000000..bc9b122
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if.h
@@ -0,0 +1,223 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for the INET interface module.
+ *
+ * Version: @(#)if.h 1.0.2 04/18/93
+ *
+ * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1982-1988
+ * Ross Biro
+ * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_IF_H
+#define _LINUX_IF_H
+
+#include <linux/types.h> /* for "__kernel_caddr_t" et al */
+#include <linux/socket.h> /* for "struct sockaddr" et al */
+ /* for "__user" et al */
+
+#define IFNAMSIZ 16
+#define IFALIASZ 256
+#include <linux/hdlc/ioctl.h>
+
+/* Standard interface flags (netdevice->flags). */
+#define IFF_UP 0x1 /* interface is up */
+#define IFF_BROADCAST 0x2 /* broadcast address valid */
+#define IFF_DEBUG 0x4 /* turn on debugging */
+#define IFF_LOOPBACK 0x8 /* is a loopback net */
+#define IFF_POINTOPOINT 0x10 /* interface is has p-p link */
+#define IFF_NOTRAILERS 0x20 /* avoid use of trailers */
+#define IFF_RUNNING 0x40 /* interface RFC2863 OPER_UP */
+#define IFF_NOARP 0x80 /* no ARP protocol */
+#define IFF_PROMISC 0x100 /* receive all packets */
+#define IFF_ALLMULTI 0x200 /* receive all multicast packets*/
+
+#define IFF_MASTER 0x400 /* master of a load balancer */
+#define IFF_SLAVE 0x800 /* slave of a load balancer */
+
+#define IFF_MULTICAST 0x1000 /* Supports multicast */
+
+#define IFF_PORTSEL 0x2000 /* can set media type */
+#define IFF_AUTOMEDIA 0x4000 /* auto media select active */
+#define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses*/
+
+#define IFF_LOWER_UP 0x10000 /* driver signals L1 up */
+#define IFF_DORMANT 0x20000 /* driver signals dormant */
+
+#define IFF_ECHO 0x40000 /* echo sent packets */
+
+#define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO|\
+ IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
+
+/* Private (from user) interface flags (netdevice->priv_flags). */
+#define IFF_802_1Q_VLAN 0x1 /* 802.1Q VLAN device. */
+#define IFF_EBRIDGE 0x2 /* Ethernet bridging device. */
+#define IFF_SLAVE_INACTIVE 0x4 /* bonding slave not the curr. active */
+#define IFF_MASTER_8023AD 0x8 /* bonding master, 802.3ad. */
+#define IFF_MASTER_ALB 0x10 /* bonding master, balance-alb. */
+#define IFF_BONDING 0x20 /* bonding master or slave */
+#define IFF_SLAVE_NEEDARP 0x40 /* need ARPs for validation */
+#define IFF_ISATAP 0x80 /* ISATAP interface (RFC4214) */
+#define IFF_MASTER_ARPMON 0x100 /* bonding master, ARP mon in use */
+#define IFF_WAN_HDLC 0x200 /* WAN HDLC device */
+
+#define IF_GET_IFACE 0x0001 /* for querying only */
+#define IF_GET_PROTO 0x0002
+
+/* For definitions see hdlc.h */
+#define IF_IFACE_V35 0x1000 /* V.35 serial interface */
+#define IF_IFACE_V24 0x1001 /* V.24 serial interface */
+#define IF_IFACE_X21 0x1002 /* X.21 serial interface */
+#define IF_IFACE_T1 0x1003 /* T1 telco serial interface */
+#define IF_IFACE_E1 0x1004 /* E1 telco serial interface */
+#define IF_IFACE_SYNC_SERIAL 0x1005 /* can't be set by software */
+#define IF_IFACE_X21D 0x1006 /* X.21 Dual Clocking (FarSite) */
+
+/* For definitions see hdlc.h */
+#define IF_PROTO_HDLC 0x2000 /* raw HDLC protocol */
+#define IF_PROTO_PPP 0x2001 /* PPP protocol */
+#define IF_PROTO_CISCO 0x2002 /* Cisco HDLC protocol */
+#define IF_PROTO_FR 0x2003 /* Frame Relay protocol */
+#define IF_PROTO_FR_ADD_PVC 0x2004 /* Create FR PVC */
+#define IF_PROTO_FR_DEL_PVC 0x2005 /* Delete FR PVC */
+#define IF_PROTO_X25 0x2006 /* X.25 */
+#define IF_PROTO_HDLC_ETH 0x2007 /* raw HDLC, Ethernet emulation */
+#define IF_PROTO_FR_ADD_ETH_PVC 0x2008 /* Create FR Ethernet-bridged PVC */
+#define IF_PROTO_FR_DEL_ETH_PVC 0x2009 /* Delete FR Ethernet-bridged PVC */
+#define IF_PROTO_FR_PVC 0x200A /* for reading PVC status */
+#define IF_PROTO_FR_ETH_PVC 0x200B
+#define IF_PROTO_RAW 0x200C /* RAW Socket */
+
+/* RFC 2863 operational status */
+enum {
+ IF_OPER_UNKNOWN,
+ IF_OPER_NOTPRESENT,
+ IF_OPER_DOWN,
+ IF_OPER_LOWERLAYERDOWN,
+ IF_OPER_TESTING,
+ IF_OPER_DORMANT,
+ IF_OPER_UP,
+};
+
+/* link modes */
+enum {
+ IF_LINK_MODE_DEFAULT,
+ IF_LINK_MODE_DORMANT, /* limit upward transition to dormant */
+};
+
+/*
+ * Device mapping structure. I'd just gone off and designed a
+ * beautiful scheme using only loadable modules with arguments
+ * for driver options and along come the PCMCIA people 8)
+ *
+ * Ah well. The get() side of this is good for WDSETUP, and it'll
+ * be handy for debugging things. The set side is fine for now and
+ * being very small might be worth keeping for clean configuration.
+ */
+
+struct ifmap
+{
+ unsigned long mem_start;
+ unsigned long mem_end;
+ unsigned short base_addr;
+ unsigned char irq;
+ unsigned char dma;
+ unsigned char port;
+ /* 3 bytes spare */
+};
+
+struct if_settings
+{
+ unsigned int type; /* Type of physical device or protocol */
+ unsigned int size; /* Size of the data allocated by the caller */
+ union {
+ /* {atm/eth/dsl}_settings anyone ? */
+ raw_hdlc_proto *raw_hdlc;
+ cisco_proto *cisco;
+ fr_proto *fr;
+ fr_proto_pvc *fr_pvc;
+ fr_proto_pvc_info *fr_pvc_info;
+
+ /* interface settings */
+ sync_serial_settings *sync;
+ te1_settings *te1;
+ } ifs_ifsu;
+};
+
+/*
+ * Interface request structure used for socket
+ * ioctl's. All interface ioctl's must have parameter
+ * definitions which begin with ifr_name. The
+ * remainder may be interface specific.
+ */
+
+struct ifreq
+{
+#define IFHWADDRLEN 6
+ union
+ {
+ char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+ } ifr_ifrn;
+
+ union {
+ struct sockaddr ifru_addr;
+ struct sockaddr ifru_dstaddr;
+ struct sockaddr ifru_broadaddr;
+ struct sockaddr ifru_netmask;
+ struct sockaddr ifru_hwaddr;
+ short ifru_flags;
+ int ifru_ivalue;
+ int ifru_mtu;
+ struct ifmap ifru_map;
+ char ifru_slave[IFNAMSIZ]; /* Just fits the size */
+ char ifru_newname[IFNAMSIZ];
+ void * ifru_data;
+ struct if_settings ifru_settings;
+ } ifr_ifru;
+};
+
+#define ifr_name ifr_ifrn.ifrn_name /* interface name */
+#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */
+#define ifr_addr ifr_ifru.ifru_addr /* address */
+#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-p lnk */
+#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
+#define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */
+#define ifr_flags ifr_ifru.ifru_flags /* flags */
+#define ifr_metric ifr_ifru.ifru_ivalue /* metric */
+#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
+#define ifr_map ifr_ifru.ifru_map /* device map */
+#define ifr_slave ifr_ifru.ifru_slave /* slave device */
+#define ifr_data ifr_ifru.ifru_data /* for use by interface */
+#define ifr_ifindex ifr_ifru.ifru_ivalue /* interface index */
+#define ifr_bandwidth ifr_ifru.ifru_ivalue /* link bandwidth */
+#define ifr_qlen ifr_ifru.ifru_ivalue /* Queue length */
+#define ifr_newname ifr_ifru.ifru_newname /* New name */
+#define ifr_settings ifr_ifru.ifru_settings /* Device/proto settings*/
+
+/*
+ * Structure used in SIOCGIFCONF request.
+ * Used to retrieve interface configuration
+ * for machine (useful for programs which
+ * must know all networks accessible).
+ */
+
+struct ifconf
+{
+ int ifc_len; /* size of buffer */
+ union
+ {
+ char *ifcu_buf;
+ struct ifreq *ifcu_req;
+ } ifc_ifcu;
+};
+#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
+#define ifc_req ifc_ifcu.ifcu_req /* array of structures */
+
+#endif /* _LINUX_IF_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_addr.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_addr.h
new file mode 100644
index 0000000..08ea980
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_addr.h
@@ -0,0 +1,61 @@
+#ifndef __LINUX_IF_ADDR_H
+#define __LINUX_IF_ADDR_H
+
+#include <linux/types.h>
+#include <linux/netlink.h>
+
+struct ifaddrmsg
+{
+ __u8 ifa_family;
+ __u8 ifa_prefixlen; /* The prefix length */
+ __u8 ifa_flags; /* Flags */
+ __u8 ifa_scope; /* Address scope */
+ __u32 ifa_index; /* Link index */
+};
+
+/*
+ * Important comment:
+ * IFA_ADDRESS is prefix address, rather than local interface address.
+ * It makes no difference for normally configured broadcast interfaces,
+ * but for point-to-point IFA_ADDRESS is DESTINATION address,
+ * local address is supplied in IFA_LOCAL attribute.
+ */
+enum
+{
+ IFA_UNSPEC,
+ IFA_ADDRESS,
+ IFA_LOCAL,
+ IFA_LABEL,
+ IFA_BROADCAST,
+ IFA_ANYCAST,
+ IFA_CACHEINFO,
+ IFA_MULTICAST,
+ __IFA_MAX,
+};
+
+#define IFA_MAX (__IFA_MAX - 1)
+
+/* ifa_flags */
+#define IFA_F_SECONDARY 0x01
+#define IFA_F_TEMPORARY IFA_F_SECONDARY
+
+#define IFA_F_NODAD 0x02
+#define IFA_F_OPTIMISTIC 0x04
+#define IFA_F_HOMEADDRESS 0x10
+#define IFA_F_DEPRECATED 0x20
+#define IFA_F_TENTATIVE 0x40
+#define IFA_F_PERMANENT 0x80
+
+struct ifa_cacheinfo
+{
+ __u32 ifa_prefered;
+ __u32 ifa_valid;
+ __u32 cstamp; /* created timestamp, hundredths of seconds */
+ __u32 tstamp; /* updated timestamp, hundredths of seconds */
+};
+
+/* backwards compatibility for userspace */
+#define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
+#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_addrlabel.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_addrlabel.h
new file mode 100644
index 0000000..89571f6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_addrlabel.h
@@ -0,0 +1,34 @@
+/*
+ * if_addrlabel.h - netlink interface for address labels
+ *
+ * Copyright (C)2007 USAGI/WIDE Project, All Rights Reserved.
+ *
+ * Authors:
+ * YOSHIFUJI Hideaki @ USAGI/WIDE <yoshfuji@linux-ipv6.org>
+ */
+
+#ifndef __LINUX_IF_ADDRLABEL_H
+#define __LINUX_IF_ADDRLABEL_H
+
+#include <linux/types.h>
+
+struct ifaddrlblmsg
+{
+ __u8 ifal_family; /* Address family */
+ __u8 __ifal_reserved; /* Reserved */
+ __u8 ifal_prefixlen; /* Prefix length */
+ __u8 ifal_flags; /* Flags */
+ __u32 ifal_index; /* Link index */
+ __u32 ifal_seq; /* sequence number */
+};
+
+enum
+{
+ IFAL_ADDRESS = 1,
+ IFAL_LABEL = 2,
+ __IFAL_MAX
+};
+
+#define IFAL_MAX (__IFAL_MAX - 1)
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_arcnet.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_arcnet.h
new file mode 100644
index 0000000..0835deb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_arcnet.h
@@ -0,0 +1,138 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for the ARCnet interface.
+ *
+ * Authors: David Woodhouse and Avery Pennarun
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_IF_ARCNET_H
+#define _LINUX_IF_ARCNET_H
+
+#include <linux/types.h>
+#include <linux/if_ether.h>
+
+
+/*
+ * These are the defined ARCnet Protocol ID's.
+ */
+
+/* CAP mode */
+/* No macro but uses 1-8 */
+
+/* RFC1201 Protocol ID's */
+#define ARC_P_IP 212 /* 0xD4 */
+#define ARC_P_IPV6 196 /* 0xC4: RFC2497 */
+#define ARC_P_ARP 213 /* 0xD5 */
+#define ARC_P_RARP 214 /* 0xD6 */
+#define ARC_P_IPX 250 /* 0xFA */
+#define ARC_P_NOVELL_EC 236 /* 0xEC */
+
+/* Old RFC1051 Protocol ID's */
+#define ARC_P_IP_RFC1051 240 /* 0xF0 */
+#define ARC_P_ARP_RFC1051 241 /* 0xF1 */
+
+/* MS LanMan/WfWg "NDIS" encapsulation */
+#define ARC_P_ETHER 232 /* 0xE8 */
+
+/* Unsupported/indirectly supported protocols */
+#define ARC_P_DATAPOINT_BOOT 0 /* very old Datapoint equipment */
+#define ARC_P_DATAPOINT_MOUNT 1
+#define ARC_P_POWERLAN_BEACON 8 /* Probably ATA-Netbios related */
+#define ARC_P_POWERLAN_BEACON2 243 /* 0xF3 */
+#define ARC_P_LANSOFT 251 /* 0xFB - what is this? */
+#define ARC_P_ATALK 0xDD
+
+/* Hardware address length */
+#define ARCNET_ALEN 1
+
+/*
+ * The RFC1201-specific components of an arcnet packet header.
+ */
+struct arc_rfc1201
+{
+ __u8 proto; /* protocol ID field - varies */
+ __u8 split_flag; /* for use with split packets */
+ __be16 sequence; /* sequence number */
+ __u8 payload[0]; /* space remaining in packet (504 bytes)*/
+};
+#define RFC1201_HDR_SIZE 4
+
+
+/*
+ * The RFC1051-specific components.
+ */
+struct arc_rfc1051
+{
+ __u8 proto; /* ARC_P_RFC1051_ARP/RFC1051_IP */
+ __u8 payload[0]; /* 507 bytes */
+};
+#define RFC1051_HDR_SIZE 1
+
+
+/*
+ * The ethernet-encap-specific components. We have a real ethernet header
+ * and some data.
+ */
+struct arc_eth_encap
+{
+ __u8 proto; /* Always ARC_P_ETHER */
+ struct ethhdr eth; /* standard ethernet header (yuck!) */
+ __u8 payload[0]; /* 493 bytes */
+};
+#define ETH_ENCAP_HDR_SIZE 14
+
+
+struct arc_cap
+{
+ __u8 proto;
+ __u8 cookie[sizeof(int)]; /* Actually NOT sent over the network */
+ union {
+ __u8 ack;
+ __u8 raw[0]; /* 507 bytes */
+ } mes;
+};
+
+/*
+ * The data needed by the actual arcnet hardware.
+ *
+ * Now, in the real arcnet hardware, the third and fourth bytes are the
+ * 'offset' specification instead of the length, and the soft data is at
+ * the _end_ of the 512-byte buffer. We hide this complexity inside the
+ * driver.
+ */
+struct arc_hardware
+{
+ __u8 source, /* source ARCnet - filled in automagically */
+ dest, /* destination ARCnet - 0 for broadcast */
+ offset[2]; /* offset bytes (some weird semantics) */
+};
+#define ARC_HDR_SIZE 4
+
+/*
+ * This is an ARCnet frame header, as seen by the kernel (and userspace,
+ * when you do a raw packet capture).
+ */
+struct archdr
+{
+ /* hardware requirements */
+ struct arc_hardware hard;
+
+ /* arcnet encapsulation-specific bits */
+ union {
+ struct arc_rfc1201 rfc1201;
+ struct arc_rfc1051 rfc1051;
+ struct arc_eth_encap eth_encap;
+ struct arc_cap cap;
+ __u8 raw[0]; /* 508 bytes */
+ } soft;
+};
+
+#endif /* _LINUX_IF_ARCNET_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_arp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_arp.h
new file mode 100644
index 0000000..7dff666
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_arp.h
@@ -0,0 +1,156 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for the ARP (RFC 826) protocol.
+ *
+ * Version: @(#)if_arp.h 1.0.1 04/16/93
+ *
+ * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1986-1988
+ * Portions taken from the KA9Q/NOS (v2.00m PA0GRI) source.
+ * Ross Biro
+ * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ * Florian La Roche,
+ * Jonathan Layes <layes@loran.com>
+ * Arnaldo Carvalho de Melo <acme@conectiva.com.br> ARPHRD_HWX25
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_IF_ARP_H
+#define _LINUX_IF_ARP_H
+
+#include <linux/netdevice.h>
+
+/* ARP protocol HARDWARE identifiers. */
+#define ARPHRD_NETROM 0 /* from KA9Q: NET/ROM pseudo */
+#define ARPHRD_ETHER 1 /* Ethernet 10Mbps */
+#define ARPHRD_EETHER 2 /* Experimental Ethernet */
+#define ARPHRD_AX25 3 /* AX.25 Level 2 */
+#define ARPHRD_PRONET 4 /* PROnet token ring */
+#define ARPHRD_CHAOS 5 /* Chaosnet */
+#define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet/TR/TB */
+#define ARPHRD_ARCNET 7 /* ARCnet */
+#define ARPHRD_APPLETLK 8 /* APPLEtalk */
+#define ARPHRD_DLCI 15 /* Frame Relay DLCI */
+#define ARPHRD_ATM 19 /* ATM */
+#define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id) */
+#define ARPHRD_IEEE1394 24 /* IEEE 1394 IPv4 - RFC 2734 */
+#define ARPHRD_EUI64 27 /* EUI-64 */
+#define ARPHRD_INFINIBAND 32 /* InfiniBand */
+
+/* Dummy types for non ARP hardware */
+#define ARPHRD_SLIP 256
+#define ARPHRD_CSLIP 257
+#define ARPHRD_SLIP6 258
+#define ARPHRD_CSLIP6 259
+#define ARPHRD_RSRVD 260 /* Notional KISS type */
+#define ARPHRD_ADAPT 264
+#define ARPHRD_ROSE 270
+#define ARPHRD_X25 271 /* CCITT X.25 */
+#define ARPHRD_HWX25 272 /* Boards with X.25 in firmware */
+#define ARPHRD_CAN 280 /* Controller Area Network */
+#define ARPHRD_PPP 512
+#define ARPHRD_CISCO 513 /* Cisco HDLC */
+#define ARPHRD_HDLC ARPHRD_CISCO
+#define ARPHRD_LAPB 516 /* LAPB */
+#define ARPHRD_DDCMP 517 /* Digital's DDCMP protocol */
+#define ARPHRD_RAWHDLC 518 /* Raw HDLC */
+
+#define ARPHRD_TUNNEL 768 /* IPIP tunnel */
+#define ARPHRD_TUNNEL6 769 /* IP6IP6 tunnel */
+#define ARPHRD_FRAD 770 /* Frame Relay Access Device */
+#define ARPHRD_SKIP 771 /* SKIP vif */
+#define ARPHRD_LOOPBACK 772 /* Loopback device */
+#define ARPHRD_LOCALTLK 773 /* Localtalk device */
+#define ARPHRD_FDDI 774 /* Fiber Distributed Data Interface */
+#define ARPHRD_BIF 775 /* AP1000 BIF */
+#define ARPHRD_SIT 776 /* sit0 device - IPv6-in-IPv4 */
+#define ARPHRD_IPDDP 777 /* IP over DDP tunneller */
+#define ARPHRD_IPGRE 778 /* GRE over IP */
+#define ARPHRD_PIMREG 779 /* PIMSM register interface */
+#define ARPHRD_HIPPI 780 /* High Performance Parallel Interface */
+#define ARPHRD_ASH 781 /* Nexus 64Mbps Ash */
+#define ARPHRD_ECONET 782 /* Acorn Econet */
+#define ARPHRD_IRDA 783 /* Linux-IrDA */
+/* ARP works differently on different FC media .. so */
+#define ARPHRD_FCPP 784 /* Point to point fibrechannel */
+#define ARPHRD_FCAL 785 /* Fibrechannel arbitrated loop */
+#define ARPHRD_FCPL 786 /* Fibrechannel public loop */
+#define ARPHRD_FCFABRIC 787 /* Fibrechannel fabric */
+ /* 787->799 reserved for fibrechannel media types */
+#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */
+#define ARPHRD_IEEE80211 801 /* IEEE 802.11 */
+#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */
+#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */
+
+#define ARPHRD_PHONET 820 /* PhoNet media type */
+#define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */
+
+#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */
+#define ARPHRD_NONE 0xFFFE /* zero header length */
+
+/* ARP protocol opcodes. */
+#define ARPOP_REQUEST 1 /* ARP request */
+#define ARPOP_REPLY 2 /* ARP reply */
+#define ARPOP_RREQUEST 3 /* RARP request */
+#define ARPOP_RREPLY 4 /* RARP reply */
+#define ARPOP_InREQUEST 8 /* InARP request */
+#define ARPOP_InREPLY 9 /* InARP reply */
+#define ARPOP_NAK 10 /* (ATM)ARP NAK */
+
+
+/* ARP ioctl request. */
+struct arpreq {
+ struct sockaddr arp_pa; /* protocol address */
+ struct sockaddr arp_ha; /* hardware address */
+ int arp_flags; /* flags */
+ struct sockaddr arp_netmask; /* netmask (only for proxy arps) */
+ char arp_dev[16];
+};
+
+struct arpreq_old {
+ struct sockaddr arp_pa; /* protocol address */
+ struct sockaddr arp_ha; /* hardware address */
+ int arp_flags; /* flags */
+ struct sockaddr arp_netmask; /* netmask (only for proxy arps) */
+};
+
+/* ARP Flag values. */
+#define ATF_COM 0x02 /* completed entry (ha valid) */
+#define ATF_PERM 0x04 /* permanent entry */
+#define ATF_PUBL 0x08 /* publish entry */
+#define ATF_USETRAILERS 0x10 /* has requested trailers */
+#define ATF_NETMASK 0x20 /* want to use a netmask (only
+ for proxy entries) */
+#define ATF_DONTPUB 0x40 /* don't answer this addresses */
+
+/*
+ * This structure defines an ethernet arp header.
+ */
+
+struct arphdr
+{
+ __be16 ar_hrd; /* format of hardware address */
+ __be16 ar_pro; /* format of protocol address */
+ unsigned char ar_hln; /* length of hardware address */
+ unsigned char ar_pln; /* length of protocol address */
+ __be16 ar_op; /* ARP opcode (command) */
+
+#if 0
+ /*
+ * Ethernet looks like this : This bit is variable sized however...
+ */
+ unsigned char ar_sha[ETH_ALEN]; /* sender hardware address */
+ unsigned char ar_sip[4]; /* sender IP address */
+ unsigned char ar_tha[ETH_ALEN]; /* target hardware address */
+ unsigned char ar_tip[4]; /* target IP address */
+#endif
+
+};
+
+
+#endif /* _LINUX_IF_ARP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_bonding.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_bonding.h
new file mode 100644
index 0000000..65c2d24
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_bonding.h
@@ -0,0 +1,125 @@
+/*
+ * Bond several ethernet interfaces into a Cisco, running 'Etherchannel'.
+ *
+ *
+ * Portions are (c) Copyright 1995 Simon "Guru Aleph-Null" Janes
+ * NCM: Network and Communications Management, Inc.
+ *
+ * BUT, I'm the one who modified it for ethernet, so:
+ * (c) Copyright 1999, Thomas Davis, tadavis@lbl.gov
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU Public License, incorporated herein by reference.
+ *
+ * 2003/03/18 - Amir Noam <amir.noam at intel dot com>
+ * - Added support for getting slave's speed and duplex via ethtool.
+ * Needed for 802.3ad and other future modes.
+ *
+ * 2003/03/18 - Tsippy Mendelson <tsippy.mendelson at intel dot com> and
+ * Shmulik Hen <shmulik.hen at intel dot com>
+ * - Enable support of modes that need to use the unique mac address of
+ * each slave.
+ *
+ * 2003/03/18 - Tsippy Mendelson <tsippy.mendelson at intel dot com> and
+ * Amir Noam <amir.noam at intel dot com>
+ * - Moved driver's private data types to bonding.h
+ *
+ * 2003/03/18 - Amir Noam <amir.noam at intel dot com>,
+ * Tsippy Mendelson <tsippy.mendelson at intel dot com> and
+ * Shmulik Hen <shmulik.hen at intel dot com>
+ * - Added support for IEEE 802.3ad Dynamic link aggregation mode.
+ *
+ * 2003/05/01 - Amir Noam <amir.noam at intel dot com>
+ * - Added ABI version control to restore compatibility between
+ * new/old ifenslave and new/old bonding.
+ *
+ * 2003/12/01 - Shmulik Hen <shmulik.hen at intel dot com>
+ * - Code cleanup and style changes
+ *
+ * 2005/05/05 - Jason Gabler <jygabler at lbl dot gov>
+ * - added definitions for various XOR hashing policies
+ */
+
+#ifndef _LINUX_IF_BONDING_H
+#define _LINUX_IF_BONDING_H
+
+#include <linux/if.h>
+#include <linux/types.h>
+#include <linux/if_ether.h>
+
+/* userland - kernel ABI version (2003/05/08) */
+#define BOND_ABI_VERSION 2
+
+/*
+ * We can remove these ioctl definitions in 2.5. People should use the
+ * SIOC*** versions of them instead
+ */
+#define BOND_ENSLAVE_OLD (SIOCDEVPRIVATE)
+#define BOND_RELEASE_OLD (SIOCDEVPRIVATE + 1)
+#define BOND_SETHWADDR_OLD (SIOCDEVPRIVATE + 2)
+#define BOND_SLAVE_INFO_QUERY_OLD (SIOCDEVPRIVATE + 11)
+#define BOND_INFO_QUERY_OLD (SIOCDEVPRIVATE + 12)
+#define BOND_CHANGE_ACTIVE_OLD (SIOCDEVPRIVATE + 13)
+
+#define BOND_CHECK_MII_STATUS (SIOCGMIIPHY)
+
+#define BOND_MODE_ROUNDROBIN 0
+#define BOND_MODE_ACTIVEBACKUP 1
+#define BOND_MODE_XOR 2
+#define BOND_MODE_BROADCAST 3
+#define BOND_MODE_8023AD 4
+#define BOND_MODE_TLB 5
+#define BOND_MODE_ALB 6 /* TLB + RLB (receive load balancing) */
+
+/* each slave's link has 4 states */
+#define BOND_LINK_UP 0 /* link is up and running */
+#define BOND_LINK_FAIL 1 /* link has just gone down */
+#define BOND_LINK_DOWN 2 /* link has been down for too long time */
+#define BOND_LINK_BACK 3 /* link is going back */
+
+/* each slave has several states */
+#define BOND_STATE_ACTIVE 0 /* link is active */
+#define BOND_STATE_BACKUP 1 /* link is backup */
+
+#define BOND_DEFAULT_MAX_BONDS 1 /* Default maximum number of devices to support */
+
+/* hashing types */
+#define BOND_XMIT_POLICY_LAYER2 0 /* layer 2 (MAC only), default */
+#define BOND_XMIT_POLICY_LAYER34 1 /* layer 3+4 (IP ^ (TCP || UDP)) */
+#define BOND_XMIT_POLICY_LAYER23 2 /* layer 2+3 (IP ^ MAC) */
+
+typedef struct ifbond {
+ __s32 bond_mode;
+ __s32 num_slaves;
+ __s32 miimon;
+} ifbond;
+
+typedef struct ifslave
+{
+ __s32 slave_id; /* Used as an IN param to the BOND_SLAVE_INFO_QUERY ioctl */
+ char slave_name[IFNAMSIZ];
+ __s8 link;
+ __s8 state;
+ __u32 link_failure_count;
+} ifslave;
+
+struct ad_info {
+ __u16 aggregator_id;
+ __u16 ports;
+ __u16 actor_key;
+ __u16 partner_key;
+ __u8 partner_system[ETH_ALEN];
+};
+
+#endif /* _LINUX_IF_BONDING_H */
+
+/*
+ * Local variables:
+ * version-control: t
+ * kept-new-versions: 5
+ * c-indent-level: 8
+ * c-basic-offset: 8
+ * tab-width: 8
+ * End:
+ */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_bridge.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_bridge.h
new file mode 100644
index 0000000..8458963
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_bridge.h
@@ -0,0 +1,104 @@
+/*
+ * Linux ethernet bridge
+ *
+ * Authors:
+ * Lennert Buytenhek <buytenh@gnu.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_IF_BRIDGE_H
+#define _LINUX_IF_BRIDGE_H
+
+#include <linux/types.h>
+
+#define SYSFS_BRIDGE_ATTR "bridge"
+#define SYSFS_BRIDGE_FDB "brforward"
+#define SYSFS_BRIDGE_PORT_SUBDIR "brif"
+#define SYSFS_BRIDGE_PORT_ATTR "brport"
+#define SYSFS_BRIDGE_PORT_LINK "bridge"
+
+#define BRCTL_VERSION 1
+
+#define BRCTL_GET_VERSION 0
+#define BRCTL_GET_BRIDGES 1
+#define BRCTL_ADD_BRIDGE 2
+#define BRCTL_DEL_BRIDGE 3
+#define BRCTL_ADD_IF 4
+#define BRCTL_DEL_IF 5
+#define BRCTL_GET_BRIDGE_INFO 6
+#define BRCTL_GET_PORT_LIST 7
+#define BRCTL_SET_BRIDGE_FORWARD_DELAY 8
+#define BRCTL_SET_BRIDGE_HELLO_TIME 9
+#define BRCTL_SET_BRIDGE_MAX_AGE 10
+#define BRCTL_SET_AGEING_TIME 11
+#define BRCTL_SET_GC_INTERVAL 12
+#define BRCTL_GET_PORT_INFO 13
+#define BRCTL_SET_BRIDGE_STP_STATE 14
+#define BRCTL_SET_BRIDGE_PRIORITY 15
+#define BRCTL_SET_PORT_PRIORITY 16
+#define BRCTL_SET_PATH_COST 17
+#define BRCTL_GET_FDB_ENTRIES 18
+
+#define BR_STATE_DISABLED 0
+#define BR_STATE_LISTENING 1
+#define BR_STATE_LEARNING 2
+#define BR_STATE_FORWARDING 3
+#define BR_STATE_BLOCKING 4
+
+struct __bridge_info
+{
+ __u64 designated_root;
+ __u64 bridge_id;
+ __u32 root_path_cost;
+ __u32 max_age;
+ __u32 hello_time;
+ __u32 forward_delay;
+ __u32 bridge_max_age;
+ __u32 bridge_hello_time;
+ __u32 bridge_forward_delay;
+ __u8 topology_change;
+ __u8 topology_change_detected;
+ __u8 root_port;
+ __u8 stp_enabled;
+ __u32 ageing_time;
+ __u32 gc_interval;
+ __u32 hello_timer_value;
+ __u32 tcn_timer_value;
+ __u32 topology_change_timer_value;
+ __u32 gc_timer_value;
+};
+
+struct __port_info
+{
+ __u64 designated_root;
+ __u64 designated_bridge;
+ __u16 port_id;
+ __u16 designated_port;
+ __u32 path_cost;
+ __u32 designated_cost;
+ __u8 state;
+ __u8 top_change_ack;
+ __u8 config_pending;
+ __u8 unused0;
+ __u32 message_age_timer_value;
+ __u32 forward_delay_timer_value;
+ __u32 hold_timer_value;
+};
+
+struct __fdb_entry
+{
+ __u8 mac_addr[6];
+ __u8 port_no;
+ __u8 is_local;
+ __u32 ageing_timer_value;
+ __u8 port_hi;
+ __u8 pad0;
+ __u16 unused;
+};
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_cablemodem.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_cablemodem.h
new file mode 100644
index 0000000..9ca1007
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_cablemodem.h
@@ -0,0 +1,22 @@
+#ifndef _LINUX_CABLEMODEM_H_
+#define _LINUX_CABLEMODEM_H_
+/*
+ * Author: Franco Venturi <fventuri@mediaone.net>
+ * Copyright 1998 Franco Venturi
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ */
+
+/* some useful defines for sb1000.c e cmconfig.c - fv */
+#define SIOCGCMSTATS SIOCDEVPRIVATE+0 /* get cable modem stats */
+#define SIOCGCMFIRMWARE SIOCDEVPRIVATE+1 /* get cm firmware version */
+#define SIOCGCMFREQUENCY SIOCDEVPRIVATE+2 /* get cable modem frequency */
+#define SIOCSCMFREQUENCY SIOCDEVPRIVATE+3 /* set cable modem frequency */
+#define SIOCGCMPIDS SIOCDEVPRIVATE+4 /* get cable modem PIDs */
+#define SIOCSCMPIDS SIOCDEVPRIVATE+5 /* set cable modem PIDs */
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_ec.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_ec.h
new file mode 100644
index 0000000..a8b81f8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_ec.h
@@ -0,0 +1,36 @@
+/* Definitions for Econet sockets. */
+
+#ifndef __LINUX_IF_EC
+#define __LINUX_IF_EC
+
+/* User visible stuff. Glibc provides its own but libc5 folk will use these */
+
+struct ec_addr
+{
+ unsigned char station; /* Station number. */
+ unsigned char net; /* Network number. */
+};
+
+struct sockaddr_ec
+{
+ unsigned short sec_family;
+ unsigned char port; /* Port number. */
+ unsigned char cb; /* Control/flag byte. */
+ unsigned char type; /* Type of message. */
+ struct ec_addr addr;
+ unsigned long cookie;
+};
+
+#define ECTYPE_PACKET_RECEIVED 0 /* Packet received */
+#define ECTYPE_TRANSMIT_STATUS 0x10 /* Transmit completed,
+ low nibble holds status */
+
+#define ECTYPE_TRANSMIT_OK 1
+#define ECTYPE_TRANSMIT_NOT_LISTENING 2
+#define ECTYPE_TRANSMIT_NET_ERROR 3
+#define ECTYPE_TRANSMIT_NO_CLOCK 4
+#define ECTYPE_TRANSMIT_LINE_JAMMED 5
+#define ECTYPE_TRANSMIT_NOT_PRESENT 6
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_eql.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_eql.h
new file mode 100644
index 0000000..c0b94ec
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_eql.h
@@ -0,0 +1,54 @@
+/*
+ * Equalizer Load-balancer for serial network interfaces.
+ *
+ * (c) Copyright 1995 Simon "Guru Aleph-Null" Janes
+ * NCM: Network and Communications Management, Inc.
+ *
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ * The author may be reached as simon@ncm.com, or C/O
+ * NCM
+ * Attn: Simon Janes
+ * 6803 Whittier Ave
+ * McLean VA 22101
+ * Phone: 1-703-847-0040 ext 103
+ */
+
+#ifndef _LINUX_IF_EQL_H
+#define _LINUX_IF_EQL_H
+
+#define EQL_DEFAULT_SLAVE_PRIORITY 28800
+#define EQL_DEFAULT_MAX_SLAVES 4
+#define EQL_DEFAULT_MTU 576
+#define EQL_DEFAULT_RESCHED_IVAL 100
+
+#define EQL_ENSLAVE (SIOCDEVPRIVATE)
+#define EQL_EMANCIPATE (SIOCDEVPRIVATE + 1)
+
+#define EQL_GETSLAVECFG (SIOCDEVPRIVATE + 2)
+#define EQL_SETSLAVECFG (SIOCDEVPRIVATE + 3)
+
+#define EQL_GETMASTRCFG (SIOCDEVPRIVATE + 4)
+#define EQL_SETMASTRCFG (SIOCDEVPRIVATE + 5)
+
+
+typedef struct master_config {
+ char master_name[16];
+ int max_slaves;
+ int min_slaves;
+} master_config_t;
+
+typedef struct slave_config {
+ char slave_name[16];
+ long priority;
+} slave_config_t;
+
+typedef struct slaving_request {
+ char slave_name[16];
+ long priority;
+} slaving_request_t;
+
+
+#endif /* _LINUX_EQL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_ether.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_ether.h
new file mode 100644
index 0000000..dde027f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_ether.h
@@ -0,0 +1,121 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for the Ethernet IEEE 802.3 interface.
+ *
+ * Version: @(#)if_ether.h 1.0.1a 02/08/94
+ *
+ * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ * Donald Becker, <becker@super.org>
+ * Alan Cox, <alan@lxorguk.ukuu.org.uk>
+ * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_IF_ETHER_H
+#define _LINUX_IF_ETHER_H
+
+#include <linux/types.h>
+
+/*
+ * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
+ * and FCS/CRC (frame check sequence).
+ */
+
+#define ETH_ALEN 6 /* Octets in one ethernet addr */
+#define ETH_HLEN 14 /* Total octets in header. */
+#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
+#define ETH_DATA_LEN 1500 /* Max. octets in payload */
+#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
+#define ETH_FCS_LEN 4 /* Octets in the FCS */
+
+/*
+ * These are the defined Ethernet Protocol ID's.
+ */
+
+#define ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */
+#define ETH_P_PUP 0x0200 /* Xerox PUP packet */
+#define ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */
+#define ETH_P_IP 0x0800 /* Internet Protocol packet */
+#define ETH_P_X25 0x0805 /* CCITT X.25 */
+#define ETH_P_ARP 0x0806 /* Address Resolution packet */
+#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */
+#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */
+#define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */
+#define ETH_P_DEC 0x6000 /* DEC Assigned proto */
+#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */
+#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */
+#define ETH_P_DNA_RT 0x6003 /* DEC DNA Routing */
+#define ETH_P_LAT 0x6004 /* DEC LAT */
+#define ETH_P_DIAG 0x6005 /* DEC Diagnostics */
+#define ETH_P_CUST 0x6006 /* DEC Customer use */
+#define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */
+#define ETH_P_TEB 0x6558 /* Trans Ether Bridging */
+#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */
+#define ETH_P_ATALK 0x809B /* Appletalk DDP */
+#define ETH_P_AARP 0x80F3 /* Appletalk AARP */
+#define ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */
+#define ETH_P_IPX 0x8137 /* IPX over DIX */
+#define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */
+#define ETH_P_PAUSE 0x8808 /* IEEE Pause frames. See 802.3 31B */
+#define ETH_P_SLOW 0x8809 /* Slow Protocol. See 802.3ad 43B */
+#define ETH_P_WCCP 0x883E /* Web-cache coordination protocol
+ * defined in draft-wilson-wrec-wccp-v2-00.txt */
+#define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */
+#define ETH_P_PPP_SES 0x8864 /* PPPoE session messages */
+#define ETH_P_MPLS_UC 0x8847 /* MPLS Unicast traffic */
+#define ETH_P_MPLS_MC 0x8848 /* MPLS Multicast traffic */
+#define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */
+#define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport
+ * over Ethernet
+ */
+#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
+#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
+#define ETH_P_TIPC 0x88CA /* TIPC */
+#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */
+#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
+
+/*
+ * Non DIX types. Won't clash for 1500 types.
+ */
+
+#define ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */
+#define ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */
+#define ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */
+#define ETH_P_802_2 0x0004 /* 802.2 frames */
+#define ETH_P_SNAP 0x0005 /* Internal only */
+#define ETH_P_DDCMP 0x0006 /* DEC DDCMP: Internal only */
+#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
+#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
+#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
+#define ETH_P_CAN 0x000C /* Controller Area Network */
+#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
+#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
+#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
+#define ETH_P_CONTROL 0x0016 /* Card specific control frames */
+#define ETH_P_IRDA 0x0017 /* Linux-IrDA */
+#define ETH_P_ECONET 0x0018 /* Acorn Econet */
+#define ETH_P_HDLC 0x0019 /* HDLC frames */
+#define ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */
+#define ETH_P_DSA 0x001B /* Distributed Switch Arch. */
+#define ETH_P_TRAILER 0x001C /* Trailer switch tagging */
+#define ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */
+
+/*
+ * This is an Ethernet frame header.
+ */
+
+struct ethhdr {
+ unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
+ unsigned char h_source[ETH_ALEN]; /* source ether addr */
+ __be16 h_proto; /* packet type ID field */
+} __attribute__((packed));
+
+
+#endif /* _LINUX_IF_ETHER_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_fc.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_fc.h
new file mode 100644
index 0000000..6ed7f1b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_fc.h
@@ -0,0 +1,51 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for Fibre Channel.
+ *
+ * Version: @(#)if_fc.h 0.0 11/20/98
+ *
+ * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ * Donald Becker, <becker@super.org>
+ * Peter De Schrijver, <stud11@cc4.kuleuven.ac.be>
+ * Vineet Abraham, <vma@iol.unh.edu>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_IF_FC_H
+#define _LINUX_IF_FC_H
+
+#include <linux/types.h>
+
+#define FC_ALEN 6 /* Octets in one ethernet addr */
+#define FC_HLEN (sizeof(struct fch_hdr)+sizeof(struct fcllc))
+#define FC_ID_LEN 3 /* Octets in a Fibre Channel Address */
+
+/* LLC and SNAP constants */
+#define EXTENDED_SAP 0xAA
+#define UI_CMD 0x03
+
+/* This is NOT the Fibre Channel frame header. The FC frame header is
+ * constructed in the driver as the Tachyon needs certain fields in
+ * certains positions. So, it can't be generalized here.*/
+
+struct fch_hdr {
+ __u8 daddr[FC_ALEN]; /* destination address */
+ __u8 saddr[FC_ALEN]; /* source address */
+};
+
+/* This is a Fibre Channel LLC structure */
+struct fcllc {
+ __u8 dsap; /* destination SAP */
+ __u8 ssap; /* source SAP */
+ __u8 llc; /* LLC control field */
+ __u8 protid[3]; /* protocol id */
+ __be16 ethertype; /* ether type field */
+};
+
+#endif /* _LINUX_IF_FC_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_fddi.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_fddi.h
new file mode 100644
index 0000000..be70f75
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_fddi.h
@@ -0,0 +1,108 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for the ANSI FDDI interface.
+ *
+ * Version: @(#)if_fddi.h 1.0.2 Sep 29 2004
+ *
+ * Author: Lawrence V. Stefani, <stefani@lkg.dec.com>
+ *
+ * if_fddi.h is based on previous if_ether.h and if_tr.h work by
+ * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ * Donald Becker, <becker@super.org>
+ * Alan Cox, <alan@lxorguk.ukuu.org.uk>
+ * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
+ * Peter De Schrijver, <stud11@cc4.kuleuven.ac.be>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_IF_FDDI_H
+#define _LINUX_IF_FDDI_H
+
+#include <linux/types.h>
+
+/*
+ * Define max and min legal sizes. The frame sizes do not include
+ * 4 byte FCS/CRC (frame check sequence).
+ */
+#define FDDI_K_ALEN 6 /* Octets in one FDDI address */
+#define FDDI_K_8022_HLEN 16 /* Total octets in 802.2 header */
+#define FDDI_K_SNAP_HLEN 21 /* Total octets in 802.2 SNAP header */
+#define FDDI_K_8022_ZLEN 16 /* Min octets in 802.2 frame sans FCS */
+#define FDDI_K_SNAP_ZLEN 21 /* Min octets in 802.2 SNAP frame sans FCS */
+#define FDDI_K_8022_DLEN 4475 /* Max octets in 802.2 payload */
+#define FDDI_K_SNAP_DLEN 4470 /* Max octets in 802.2 SNAP payload */
+#define FDDI_K_LLC_ZLEN 13 /* Min octets in LLC frame sans FCS */
+#define FDDI_K_LLC_LEN 4491 /* Max octets in LLC frame sans FCS */
+
+/* Define FDDI Frame Control (FC) Byte values */
+#define FDDI_FC_K_VOID 0x00
+#define FDDI_FC_K_NON_RESTRICTED_TOKEN 0x80
+#define FDDI_FC_K_RESTRICTED_TOKEN 0xC0
+#define FDDI_FC_K_SMT_MIN 0x41
+#define FDDI_FC_K_SMT_MAX 0x4F
+#define FDDI_FC_K_MAC_MIN 0xC1
+#define FDDI_FC_K_MAC_MAX 0xCF
+#define FDDI_FC_K_ASYNC_LLC_MIN 0x50
+#define FDDI_FC_K_ASYNC_LLC_DEF 0x54
+#define FDDI_FC_K_ASYNC_LLC_MAX 0x5F
+#define FDDI_FC_K_SYNC_LLC_MIN 0xD0
+#define FDDI_FC_K_SYNC_LLC_MAX 0xD7
+#define FDDI_FC_K_IMPLEMENTOR_MIN 0x60
+#define FDDI_FC_K_IMPLEMENTOR_MAX 0x6F
+#define FDDI_FC_K_RESERVED_MIN 0x70
+#define FDDI_FC_K_RESERVED_MAX 0x7F
+
+/* Define LLC and SNAP constants */
+#define FDDI_EXTENDED_SAP 0xAA
+#define FDDI_UI_CMD 0x03
+
+/* Define 802.2 Type 1 header */
+struct fddi_8022_1_hdr
+ {
+ __u8 dsap; /* destination service access point */
+ __u8 ssap; /* source service access point */
+ __u8 ctrl; /* control byte #1 */
+ } __attribute__ ((packed));
+
+/* Define 802.2 Type 2 header */
+struct fddi_8022_2_hdr
+ {
+ __u8 dsap; /* destination service access point */
+ __u8 ssap; /* source service access point */
+ __u8 ctrl_1; /* control byte #1 */
+ __u8 ctrl_2; /* control byte #2 */
+ } __attribute__ ((packed));
+
+/* Define 802.2 SNAP header */
+#define FDDI_K_OUI_LEN 3
+struct fddi_snap_hdr
+ {
+ __u8 dsap; /* always 0xAA */
+ __u8 ssap; /* always 0xAA */
+ __u8 ctrl; /* always 0x03 */
+ __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */
+ __be16 ethertype; /* packet type ID field */
+ } __attribute__ ((packed));
+
+/* Define FDDI LLC frame header */
+struct fddihdr
+ {
+ __u8 fc; /* frame control */
+ __u8 daddr[FDDI_K_ALEN]; /* destination address */
+ __u8 saddr[FDDI_K_ALEN]; /* source address */
+ union
+ {
+ struct fddi_8022_1_hdr llc_8022_1;
+ struct fddi_8022_2_hdr llc_8022_2;
+ struct fddi_snap_hdr llc_snap;
+ } hdr;
+ } __attribute__ ((packed));
+
+
+#endif /* _LINUX_IF_FDDI_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_frad.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_frad.h
new file mode 100644
index 0000000..0a4484b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_frad.h
@@ -0,0 +1,127 @@
+/*
+ * DLCI/FRAD Definitions for Frame Relay Access Devices. DLCI devices are
+ * created for each DLCI associated with a FRAD. The FRAD driver
+ * is not truly a network device, but the lower level device
+ * handler. This allows other FRAD manufacturers to use the DLCI
+ * code, including its RFC1490 encapsulation alongside the current
+ * implementation for the Sangoma cards.
+ *
+ * Version: @(#)if_ifrad.h 0.15 31 Mar 96
+ *
+ * Author: Mike McLagan <mike.mclagan@linux.org>
+ *
+ * Changes:
+ * 0.15 Mike McLagan changed structure defs (packed)
+ * re-arranged flags
+ * added DLCI_RET vars
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _FRAD_H_
+#define _FRAD_H_
+
+#include <linux/if.h>
+
+/* Structures and constants associated with the DLCI device driver */
+
+struct dlci_add
+{
+ char devname[IFNAMSIZ];
+ short dlci;
+};
+
+#define DLCI_GET_CONF (SIOCDEVPRIVATE + 2)
+#define DLCI_SET_CONF (SIOCDEVPRIVATE + 3)
+
+/*
+ * These are related to the Sangoma SDLA and should remain in order.
+ * Code within the SDLA module is based on the specifics of this
+ * structure. Change at your own peril.
+ */
+struct dlci_conf {
+ short flags;
+ short CIR_fwd;
+ short Bc_fwd;
+ short Be_fwd;
+ short CIR_bwd;
+ short Bc_bwd;
+ short Be_bwd;
+
+/* these are part of the status read */
+ short Tc_fwd;
+ short Tc_bwd;
+ short Tf_max;
+ short Tb_max;
+
+/* add any new fields here above is a mirror of sdla_dlci_conf */
+};
+
+#define DLCI_GET_SLAVE (SIOCDEVPRIVATE + 4)
+
+/* configuration flags for DLCI */
+#define DLCI_IGNORE_CIR_OUT 0x0001
+#define DLCI_ACCOUNT_CIR_IN 0x0002
+#define DLCI_BUFFER_IF 0x0008
+
+#define DLCI_VALID_FLAGS 0x000B
+
+/* FRAD driver uses these to indicate what it did with packet */
+#define DLCI_RET_OK 0x00
+#define DLCI_RET_ERR 0x01
+#define DLCI_RET_DROP 0x02
+
+/* defines for the actual Frame Relay hardware */
+#define FRAD_GET_CONF (SIOCDEVPRIVATE)
+#define FRAD_SET_CONF (SIOCDEVPRIVATE + 1)
+
+#define FRAD_LAST_IOCTL FRAD_SET_CONF
+
+/*
+ * Based on the setup for the Sangoma SDLA. If changes are
+ * necessary to this structure, a routine will need to be
+ * added to that module to copy fields.
+ */
+struct frad_conf
+{
+ short station;
+ short flags;
+ short kbaud;
+ short clocking;
+ short mtu;
+ short T391;
+ short T392;
+ short N391;
+ short N392;
+ short N393;
+ short CIR_fwd;
+ short Bc_fwd;
+ short Be_fwd;
+ short CIR_bwd;
+ short Bc_bwd;
+ short Be_bwd;
+
+/* Add new fields here, above is a mirror of the sdla_conf */
+
+};
+
+#define FRAD_STATION_CPE 0x0000
+#define FRAD_STATION_NODE 0x0001
+
+#define FRAD_TX_IGNORE_CIR 0x0001
+#define FRAD_RX_ACCOUNT_CIR 0x0002
+#define FRAD_DROP_ABORTED 0x0004
+#define FRAD_BUFFERIF 0x0008
+#define FRAD_STATS 0x0010
+#define FRAD_MCI 0x0100
+#define FRAD_AUTODLCI 0x8000
+#define FRAD_VALID_FLAGS 0x811F
+
+#define FRAD_CLOCK_INT 0x0001
+#define FRAD_CLOCK_EXT 0x0000
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_hippi.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_hippi.h
new file mode 100644
index 0000000..4a7c994
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_hippi.h
@@ -0,0 +1,158 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for the HIPPI interface.
+ *
+ * Version: @(#)if_hippi.h 1.0.0 05/26/97
+ *
+ * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ * Donald Becker, <becker@super.org>
+ * Alan Cox, <alan@lxorguk.ukuu.org.uk>
+ * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
+ * Jes Sorensen, <Jes.Sorensen@cern.ch>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_IF_HIPPI_H
+#define _LINUX_IF_HIPPI_H
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+/*
+ * HIPPI magic constants.
+ */
+
+#define HIPPI_ALEN 6 /* Bytes in one HIPPI hw-addr */
+#define HIPPI_HLEN sizeof(struct hippi_hdr)
+#define HIPPI_ZLEN 0 /* Min. bytes in frame without FCS */
+#define HIPPI_DATA_LEN 65280 /* Max. bytes in payload */
+#define HIPPI_FRAME_LEN (HIPPI_DATA_LEN + HIPPI_HLEN)
+ /* Max. bytes in frame without FCS */
+
+/*
+ * Define LLC and SNAP constants.
+ */
+#define HIPPI_EXTENDED_SAP 0xAA
+#define HIPPI_UI_CMD 0x03
+
+
+/*
+ * Do we need to list some sort of ID's here?
+ */
+
+/*
+ * HIPPI statistics collection data.
+ */
+
+struct hipnet_statistics
+{
+ int rx_packets; /* total packets received */
+ int tx_packets; /* total packets transmitted */
+ int rx_errors; /* bad packets received */
+ int tx_errors; /* packet transmit problems */
+ int rx_dropped; /* no space in linux buffers */
+ int tx_dropped; /* no space available in linux */
+
+ /* detailed rx_errors: */
+ int rx_length_errors;
+ int rx_over_errors; /* receiver ring buff overflow */
+ int rx_crc_errors; /* recved pkt with crc error */
+ int rx_frame_errors; /* recv'd frame alignment error */
+ int rx_fifo_errors; /* recv'r fifo overrun */
+ int rx_missed_errors; /* receiver missed packet */
+
+ /* detailed tx_errors */
+ int tx_aborted_errors;
+ int tx_carrier_errors;
+ int tx_fifo_errors;
+ int tx_heartbeat_errors;
+ int tx_window_errors;
+};
+
+
+struct hippi_fp_hdr
+{
+#if 0
+ __u8 ulp; /* must contain 4 */
+#if defined (__BIG_ENDIAN_BITFIELD)
+ __u8 d1_data_present:1; /* must be 1 */
+ __u8 start_d2_burst_boundary:1; /* must be zero */
+ __u8 reserved:6; /* must be zero */
+#if 0
+ __u16 reserved1:5;
+ __u16 d1_area_size:8; /* must be 3 */
+ __u16 d2_offset:3; /* must be zero */
+#endif
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 reserved:6; /* must be zero */
+ __u8 start_d2_burst_boundary:1; /* must be zero */
+ __u8 d1_data_present:1; /* must be 1 */
+#if 0
+ __u16 d2_offset:3; /* must be zero */
+ __u16 d1_area_size:8; /* must be 3 */
+ __u16 reserved1:5; /* must be zero */
+#endif
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+#else
+ __be32 fixed;
+#endif
+ __be32 d2_size;
+} __attribute__ ((packed));
+
+struct hippi_le_hdr
+{
+#if defined (__BIG_ENDIAN_BITFIELD)
+ __u8 fc:3;
+ __u8 double_wide:1;
+ __u8 message_type:4;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 message_type:4;
+ __u8 double_wide:1;
+ __u8 fc:3;
+#endif
+ __u8 dest_switch_addr[3];
+#if defined (__BIG_ENDIAN_BITFIELD)
+ __u8 dest_addr_type:4,
+ src_addr_type:4;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 src_addr_type:4,
+ dest_addr_type:4;
+#endif
+ __u8 src_switch_addr[3];
+ __u16 reserved;
+ __u8 daddr[HIPPI_ALEN];
+ __u16 locally_administered;
+ __u8 saddr[HIPPI_ALEN];
+} __attribute__ ((packed));
+
+#define HIPPI_OUI_LEN 3
+/*
+ * Looks like the dsap and ssap fields have been swapped by mistake in
+ * RFC 2067 "IP over HIPPI".
+ */
+struct hippi_snap_hdr
+{
+ __u8 dsap; /* always 0xAA */
+ __u8 ssap; /* always 0xAA */
+ __u8 ctrl; /* always 0x03 */
+ __u8 oui[HIPPI_OUI_LEN]; /* organizational universal id (zero)*/
+ __be16 ethertype; /* packet type ID field */
+} __attribute__ ((packed));
+
+struct hippi_hdr
+{
+ struct hippi_fp_hdr fp;
+ struct hippi_le_hdr le;
+ struct hippi_snap_hdr snap;
+} __attribute__ ((packed));
+
+#endif /* _LINUX_IF_HIPPI_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_infiniband.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_infiniband.h
new file mode 100644
index 0000000..3e659ec
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_infiniband.h
@@ -0,0 +1,29 @@
+/*
+ * This software is available to you under a choice of one of two
+ * licenses. You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available at
+ * <http://www.fsf.org/copyleft/gpl.html>, or the OpenIB.org BSD
+ * license, available in the LICENSE.TXT file accompanying this
+ * software. These details are also available at
+ * <http://openib.org/license.html>.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * Copyright (c) 2004 Topspin Communications. All rights reserved.
+ *
+ * $Id$
+ */
+
+#ifndef _LINUX_IF_INFINIBAND_H
+#define _LINUX_IF_INFINIBAND_H
+
+#define INFINIBAND_ALEN 20 /* Octets in IPoIB HW addr */
+
+#endif /* _LINUX_IF_INFINIBAND_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_link.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_link.h
new file mode 100644
index 0000000..b0b9e8a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_link.h
@@ -0,0 +1,191 @@
+#ifndef _LINUX_IF_LINK_H
+#define _LINUX_IF_LINK_H
+
+#include <linux/types.h>
+#include <linux/netlink.h>
+
+/* The struct should be in sync with struct net_device_stats */
+struct rtnl_link_stats
+{
+ __u32 rx_packets; /* total packets received */
+ __u32 tx_packets; /* total packets transmitted */
+ __u32 rx_bytes; /* total bytes received */
+ __u32 tx_bytes; /* total bytes transmitted */
+ __u32 rx_errors; /* bad packets received */
+ __u32 tx_errors; /* packet transmit problems */
+ __u32 rx_dropped; /* no space in linux buffers */
+ __u32 tx_dropped; /* no space available in linux */
+ __u32 multicast; /* multicast packets received */
+ __u32 collisions;
+
+ /* detailed rx_errors: */
+ __u32 rx_length_errors;
+ __u32 rx_over_errors; /* receiver ring buff overflow */
+ __u32 rx_crc_errors; /* recved pkt with crc error */
+ __u32 rx_frame_errors; /* recv'd frame alignment error */
+ __u32 rx_fifo_errors; /* recv'r fifo overrun */
+ __u32 rx_missed_errors; /* receiver missed packet */
+
+ /* detailed tx_errors */
+ __u32 tx_aborted_errors;
+ __u32 tx_carrier_errors;
+ __u32 tx_fifo_errors;
+ __u32 tx_heartbeat_errors;
+ __u32 tx_window_errors;
+
+ /* for cslip etc */
+ __u32 rx_compressed;
+ __u32 tx_compressed;
+};
+
+/* The struct should be in sync with struct ifmap */
+struct rtnl_link_ifmap
+{
+ __u64 mem_start;
+ __u64 mem_end;
+ __u64 base_addr;
+ __u16 irq;
+ __u8 dma;
+ __u8 port;
+};
+
+enum
+{
+ IFLA_UNSPEC,
+ IFLA_ADDRESS,
+ IFLA_BROADCAST,
+ IFLA_IFNAME,
+ IFLA_MTU,
+ IFLA_LINK,
+ IFLA_QDISC,
+ IFLA_STATS,
+ IFLA_COST,
+#define IFLA_COST IFLA_COST
+ IFLA_PRIORITY,
+#define IFLA_PRIORITY IFLA_PRIORITY
+ IFLA_MASTER,
+#define IFLA_MASTER IFLA_MASTER
+ IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */
+#define IFLA_WIRELESS IFLA_WIRELESS
+ IFLA_PROTINFO, /* Protocol specific information for a link */
+#define IFLA_PROTINFO IFLA_PROTINFO
+ IFLA_TXQLEN,
+#define IFLA_TXQLEN IFLA_TXQLEN
+ IFLA_MAP,
+#define IFLA_MAP IFLA_MAP
+ IFLA_WEIGHT,
+#define IFLA_WEIGHT IFLA_WEIGHT
+ IFLA_OPERSTATE,
+ IFLA_LINKMODE,
+ IFLA_LINKINFO,
+#define IFLA_LINKINFO IFLA_LINKINFO
+ IFLA_NET_NS_PID,
+ IFLA_IFALIAS,
+ __IFLA_MAX
+};
+
+
+#define IFLA_MAX (__IFLA_MAX - 1)
+
+/* backwards compatibility for userspace */
+#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
+#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
+
+/* ifi_flags.
+
+ IFF_* flags.
+
+ The only change is:
+ IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
+ more not changeable by user. They describe link media
+ characteristics and set by device driver.
+
+ Comments:
+ - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
+ - If neither of these three flags are set;
+ the interface is NBMA.
+
+ - IFF_MULTICAST does not mean anything special:
+ multicasts can be used on all not-NBMA links.
+ IFF_MULTICAST means that this media uses special encapsulation
+ for multicast frames. Apparently, all IFF_POINTOPOINT and
+ IFF_BROADCAST devices are able to use multicasts too.
+ */
+
+/* IFLA_LINK.
+ For usual devices it is equal ifi_index.
+ If it is a "virtual interface" (f.e. tunnel), ifi_link
+ can point to real physical interface (f.e. for bandwidth calculations),
+ or maybe 0, what means, that real media is unknown (usual
+ for IPIP tunnels, when route to endpoint is allowed to change)
+ */
+
+/* Subtype attributes for IFLA_PROTINFO */
+enum
+{
+ IFLA_INET6_UNSPEC,
+ IFLA_INET6_FLAGS, /* link flags */
+ IFLA_INET6_CONF, /* sysctl parameters */
+ IFLA_INET6_STATS, /* statistics */
+ IFLA_INET6_MCAST, /* MC things. What of them? */
+ IFLA_INET6_CACHEINFO, /* time values and max reasm size */
+ IFLA_INET6_ICMP6STATS, /* statistics (icmpv6) */
+ __IFLA_INET6_MAX
+};
+
+#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
+
+struct ifla_cacheinfo
+{
+ __u32 max_reasm_len;
+ __u32 tstamp; /* ipv6InterfaceTable updated timestamp */
+ __u32 reachable_time;
+ __u32 retrans_time;
+};
+
+enum
+{
+ IFLA_INFO_UNSPEC,
+ IFLA_INFO_KIND,
+ IFLA_INFO_DATA,
+ IFLA_INFO_XSTATS,
+ __IFLA_INFO_MAX,
+};
+
+#define IFLA_INFO_MAX (__IFLA_INFO_MAX - 1)
+
+/* VLAN section */
+
+enum
+{
+ IFLA_VLAN_UNSPEC,
+ IFLA_VLAN_ID,
+ IFLA_VLAN_FLAGS,
+ IFLA_VLAN_EGRESS_QOS,
+ IFLA_VLAN_INGRESS_QOS,
+ __IFLA_VLAN_MAX,
+};
+
+#define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1)
+
+struct ifla_vlan_flags {
+ __u32 flags;
+ __u32 mask;
+};
+
+enum
+{
+ IFLA_VLAN_QOS_UNSPEC,
+ IFLA_VLAN_QOS_MAPPING,
+ __IFLA_VLAN_QOS_MAX
+};
+
+#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1)
+
+struct ifla_vlan_qos_mapping
+{
+ __u32 from;
+ __u32 to;
+};
+
+#endif /* _LINUX_IF_LINK_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_ltalk.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_ltalk.h
new file mode 100644
index 0000000..92c3e30
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_ltalk.h
@@ -0,0 +1,9 @@
+#ifndef __LINUX_LTALK_H
+#define __LINUX_LTALK_H
+
+#define LTALK_HLEN 1
+#define LTALK_MTU 600
+#define LTALK_ALEN 1
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_packet.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_packet.h
new file mode 100644
index 0000000..18db066
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_packet.h
@@ -0,0 +1,139 @@
+#ifndef __LINUX_IF_PACKET_H
+#define __LINUX_IF_PACKET_H
+
+#include <linux/types.h>
+
+struct sockaddr_pkt
+{
+ unsigned short spkt_family;
+ unsigned char spkt_device[14];
+ __be16 spkt_protocol;
+};
+
+struct sockaddr_ll
+{
+ unsigned short sll_family;
+ __be16 sll_protocol;
+ int sll_ifindex;
+ unsigned short sll_hatype;
+ unsigned char sll_pkttype;
+ unsigned char sll_halen;
+ unsigned char sll_addr[8];
+};
+
+/* Packet types */
+
+#define PACKET_HOST 0 /* To us */
+#define PACKET_BROADCAST 1 /* To all */
+#define PACKET_MULTICAST 2 /* To group */
+#define PACKET_OTHERHOST 3 /* To someone else */
+#define PACKET_OUTGOING 4 /* Outgoing of any type */
+/* These ones are invisible by user level */
+#define PACKET_LOOPBACK 5 /* MC/BRD frame looped back */
+#define PACKET_FASTROUTE 6 /* Fastrouted frame */
+
+/* Packet socket options */
+
+#define PACKET_ADD_MEMBERSHIP 1
+#define PACKET_DROP_MEMBERSHIP 2
+#define PACKET_RECV_OUTPUT 3
+/* Value 4 is still used by obsolete turbo-packet. */
+#define PACKET_RX_RING 5
+#define PACKET_STATISTICS 6
+#define PACKET_COPY_THRESH 7
+#define PACKET_AUXDATA 8
+#define PACKET_ORIGDEV 9
+#define PACKET_VERSION 10
+#define PACKET_HDRLEN 11
+#define PACKET_RESERVE 12
+
+struct tpacket_stats
+{
+ unsigned int tp_packets;
+ unsigned int tp_drops;
+};
+
+struct tpacket_auxdata
+{
+ __u32 tp_status;
+ __u32 tp_len;
+ __u32 tp_snaplen;
+ __u16 tp_mac;
+ __u16 tp_net;
+ __u16 tp_vlan_tci;
+};
+
+struct tpacket_hdr
+{
+ unsigned long tp_status;
+#define TP_STATUS_KERNEL 0
+#define TP_STATUS_USER 1
+#define TP_STATUS_COPY 2
+#define TP_STATUS_LOSING 4
+#define TP_STATUS_CSUMNOTREADY 8
+ unsigned int tp_len;
+ unsigned int tp_snaplen;
+ unsigned short tp_mac;
+ unsigned short tp_net;
+ unsigned int tp_sec;
+ unsigned int tp_usec;
+};
+
+#define TPACKET_ALIGNMENT 16
+#define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1))
+#define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll))
+
+struct tpacket2_hdr
+{
+ __u32 tp_status;
+ __u32 tp_len;
+ __u32 tp_snaplen;
+ __u16 tp_mac;
+ __u16 tp_net;
+ __u32 tp_sec;
+ __u32 tp_nsec;
+ __u16 tp_vlan_tci;
+};
+
+#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll))
+
+enum tpacket_versions
+{
+ TPACKET_V1,
+ TPACKET_V2,
+};
+
+/*
+ Frame structure:
+
+ - Start. Frame must be aligned to TPACKET_ALIGNMENT=16
+ - struct tpacket_hdr
+ - pad to TPACKET_ALIGNMENT=16
+ - struct sockaddr_ll
+ - Gap, chosen so that packet data (Start+tp_net) alignes to TPACKET_ALIGNMENT=16
+ - Start+tp_mac: [ Optional MAC header ]
+ - Start+tp_net: Packet data, aligned to TPACKET_ALIGNMENT=16.
+ - Pad to align to TPACKET_ALIGNMENT=16
+ */
+
+struct tpacket_req
+{
+ unsigned int tp_block_size; /* Minimal size of contiguous block */
+ unsigned int tp_block_nr; /* Number of blocks */
+ unsigned int tp_frame_size; /* Size of frame */
+ unsigned int tp_frame_nr; /* Total number of frames */
+};
+
+struct packet_mreq
+{
+ int mr_ifindex;
+ unsigned short mr_type;
+ unsigned short mr_alen;
+ unsigned char mr_address[8];
+};
+
+#define PACKET_MR_MULTICAST 0
+#define PACKET_MR_PROMISC 1
+#define PACKET_MR_ALLMULTI 2
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_phonet.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_phonet.h
new file mode 100644
index 0000000..dfb0d4a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_phonet.h
@@ -0,0 +1,16 @@
+/*
+ * File: if_phonet.h
+ *
+ * Phonet interface kernel definitions
+ *
+ * Copyright (C) 2008 Nokia Corporation. All rights reserved.
+ */
+#ifndef LINUX_IF_PHONET_H
+#define LINUX_IF_PHONET_H
+
+#define PHONET_MIN_MTU 6 /* pn_length = 0 */
+#define PHONET_MAX_MTU 65541 /* pn_length = 0xffff */
+#define PHONET_DEV_MTU PHONET_MAX_MTU
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_plip.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_plip.h
new file mode 100644
index 0000000..153a649
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_plip.h
@@ -0,0 +1,28 @@
+/*
+ * NET3 PLIP tuning facilities for the new Niibe PLIP.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ */
+
+#ifndef _LINUX_IF_PLIP_H
+#define _LINUX_IF_PLIP_H
+
+#include <linux/sockios.h>
+
+#define SIOCDEVPLIP SIOCDEVPRIVATE
+
+struct plipconf
+{
+ unsigned short pcmd;
+ unsigned long nibble;
+ unsigned long trigger;
+};
+
+#define PLIP_GET_TIMEOUT 0x1
+#define PLIP_SET_TIMEOUT 0x2
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_ppp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_ppp.h
new file mode 100644
index 0000000..c57bd71
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_ppp.h
@@ -0,0 +1,173 @@
+/*
+ * if_ppp.h - Point-to-Point Protocol definitions.
+ *
+ * Copyright (c) 1989 Carnegie Mellon University.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by Carnegie Mellon University. The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ */
+
+/*
+ * ==FILEVERSION 20050812==
+ *
+ * NOTE TO MAINTAINERS:
+ * If you modify this file at all, please set the above date.
+ * if_ppp.h is shipped with a PPP distribution as well as with the kernel;
+ * if everyone increases the FILEVERSION number above, then scripts
+ * can do the right thing when deciding whether to install a new if_ppp.h
+ * file. Don't change the format of that line otherwise, so the
+ * installation script can recognize it.
+ */
+
+#ifndef _IF_PPP_H_
+#define _IF_PPP_H_
+
+#include <linux/types.h>
+
+
+/*
+ * Packet sizes
+ */
+
+#define PPP_MTU 1500 /* Default MTU (size of Info field) */
+#define PPP_MAXMRU 65000 /* Largest MRU we allow */
+#define PROTO_IPX 0x002b /* protocol numbers */
+#define PROTO_DNA_RT 0x0027 /* DNA Routing */
+
+
+/*
+ * Bit definitions for flags.
+ */
+
+#define SC_COMP_PROT 0x00000001 /* protocol compression (output) */
+#define SC_COMP_AC 0x00000002 /* header compression (output) */
+#define SC_COMP_TCP 0x00000004 /* TCP (VJ) compression (output) */
+#define SC_NO_TCP_CCID 0x00000008 /* disable VJ connection-id comp. */
+#define SC_REJ_COMP_AC 0x00000010 /* reject adrs/ctrl comp. on input */
+#define SC_REJ_COMP_TCP 0x00000020 /* reject TCP (VJ) comp. on input */
+#define SC_CCP_OPEN 0x00000040 /* Look at CCP packets */
+#define SC_CCP_UP 0x00000080 /* May send/recv compressed packets */
+#define SC_ENABLE_IP 0x00000100 /* IP packets may be exchanged */
+#define SC_LOOP_TRAFFIC 0x00000200 /* send traffic to pppd */
+#define SC_MULTILINK 0x00000400 /* do multilink encapsulation */
+#define SC_MP_SHORTSEQ 0x00000800 /* use short MP sequence numbers */
+#define SC_COMP_RUN 0x00001000 /* compressor has been inited */
+#define SC_DECOMP_RUN 0x00002000 /* decompressor has been inited */
+#define SC_MP_XSHORTSEQ 0x00004000 /* transmit short MP seq numbers */
+#define SC_DEBUG 0x00010000 /* enable debug messages */
+#define SC_LOG_INPKT 0x00020000 /* log contents of good pkts recvd */
+#define SC_LOG_OUTPKT 0x00040000 /* log contents of pkts sent */
+#define SC_LOG_RAWIN 0x00080000 /* log all chars received */
+#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */
+#define SC_SYNC 0x00200000 /* synchronous serial mode */
+#define SC_MUST_COMP 0x00400000 /* no uncompressed packets may be sent or received */
+#define SC_MASK 0x0f600fff /* bits that user can change */
+
+/* state bits */
+#define SC_XMIT_BUSY 0x10000000 /* (used by isdn_ppp?) */
+#define SC_RCV_ODDP 0x08000000 /* have rcvd char with odd parity */
+#define SC_RCV_EVNP 0x04000000 /* have rcvd char with even parity */
+#define SC_RCV_B7_1 0x02000000 /* have rcvd char with bit 7 = 1 */
+#define SC_RCV_B7_0 0x01000000 /* have rcvd char with bit 7 = 0 */
+#define SC_DC_FERROR 0x00800000 /* fatal decomp error detected */
+#define SC_DC_ERROR 0x00400000 /* non-fatal decomp error detected */
+
+/*
+ * Ioctl definitions.
+ */
+
+struct npioctl {
+ int protocol; /* PPP protocol, e.g. PPP_IP */
+ enum NPmode mode;
+};
+
+/* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS */
+struct ppp_option_data {
+ __u8 *ptr;
+ __u32 length;
+ int transmit;
+};
+
+struct ifpppstatsreq {
+ struct ifreq b;
+ struct ppp_stats stats; /* statistic information */
+};
+
+struct ifpppcstatsreq {
+ struct ifreq b;
+ struct ppp_comp_stats stats;
+};
+
+/* For PPPIOCGL2TPSTATS */
+struct pppol2tp_ioc_stats {
+ __u16 tunnel_id; /* redundant */
+ __u16 session_id; /* if zero, get tunnel stats */
+ __u32 using_ipsec:1; /* valid only for session_id == 0 */
+ aligned_u64 tx_packets;
+ aligned_u64 tx_bytes;
+ aligned_u64 tx_errors;
+ aligned_u64 rx_packets;
+ aligned_u64 rx_bytes;
+ aligned_u64 rx_seq_discards;
+ aligned_u64 rx_oos_packets;
+ aligned_u64 rx_errors;
+};
+
+#define ifr__name b.ifr_ifrn.ifrn_name
+#define stats_ptr b.ifr_ifru.ifru_data
+
+/*
+ * Ioctl definitions.
+ */
+
+#define PPPIOCGFLAGS _IOR('t', 90, int) /* get configuration flags */
+#define PPPIOCSFLAGS _IOW('t', 89, int) /* set configuration flags */
+#define PPPIOCGASYNCMAP _IOR('t', 88, int) /* get async map */
+#define PPPIOCSASYNCMAP _IOW('t', 87, int) /* set async map */
+#define PPPIOCGUNIT _IOR('t', 86, int) /* get ppp unit number */
+#define PPPIOCGRASYNCMAP _IOR('t', 85, int) /* get receive async map */
+#define PPPIOCSRASYNCMAP _IOW('t', 84, int) /* set receive async map */
+#define PPPIOCGMRU _IOR('t', 83, int) /* get max receive unit */
+#define PPPIOCSMRU _IOW('t', 82, int) /* set max receive unit */
+#define PPPIOCSMAXCID _IOW('t', 81, int) /* set VJ max slot ID */
+#define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm) /* get extended ACCM */
+#define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm) /* set extended ACCM */
+#define PPPIOCXFERUNIT _IO('t', 78) /* transfer PPP unit */
+#define PPPIOCSCOMPRESS _IOW('t', 77, struct ppp_option_data)
+#define PPPIOCGNPMODE _IOWR('t', 76, struct npioctl) /* get NP mode */
+#define PPPIOCSNPMODE _IOW('t', 75, struct npioctl) /* set NP mode */
+#define PPPIOCSPASS _IOW('t', 71, struct sock_fprog) /* set pass filter */
+#define PPPIOCSACTIVE _IOW('t', 70, struct sock_fprog) /* set active filt */
+#define PPPIOCGDEBUG _IOR('t', 65, int) /* Read debug level */
+#define PPPIOCSDEBUG _IOW('t', 64, int) /* Set debug level */
+#define PPPIOCGIDLE _IOR('t', 63, struct ppp_idle) /* get idle time */
+#define PPPIOCNEWUNIT _IOWR('t', 62, int) /* create new ppp unit */
+#define PPPIOCATTACH _IOW('t', 61, int) /* attach to ppp unit */
+#define PPPIOCDETACH _IOW('t', 60, int) /* detach from ppp unit/chan */
+#define PPPIOCSMRRU _IOW('t', 59, int) /* set multilink MRU */
+#define PPPIOCCONNECT _IOW('t', 58, int) /* connect channel to unit */
+#define PPPIOCDISCONN _IO('t', 57) /* disconnect channel */
+#define PPPIOCATTCHAN _IOW('t', 56, int) /* attach to ppp channel */
+#define PPPIOCGCHAN _IOR('t', 55, int) /* get ppp channel number */
+#define PPPIOCGL2TPSTATS _IOR('t', 54, struct pppol2tp_ioc_stats)
+
+#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0)
+#define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */
+#define SIOCGPPPCSTATS (SIOCDEVPRIVATE + 2)
+
+#if !defined(ifr_mtu)
+#define ifr_mtu ifr_ifru.ifru_metric
+#endif
+
+#endif /* _IF_PPP_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_pppol2tp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_pppol2tp.h
new file mode 100644
index 0000000..cb939b2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_pppol2tp.h
@@ -0,0 +1,66 @@
+/***************************************************************************
+ * Linux PPP over L2TP (PPPoL2TP) Socket Implementation (RFC 2661)
+ *
+ * This file supplies definitions required by the PPP over L2TP driver
+ * (pppol2tp.c). All version information wrt this file is located in pppol2tp.c
+ *
+ * License:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ */
+
+#ifndef __LINUX_IF_PPPOL2TP_H
+#define __LINUX_IF_PPPOL2TP_H
+
+#include <linux/types.h>
+
+
+/* Structure used to connect() the socket to a particular tunnel UDP
+ * socket.
+ */
+struct pppol2tp_addr
+{
+ __kernel_pid_t pid; /* pid that owns the fd.
+ * 0 => current */
+ int fd; /* FD of UDP socket to use */
+
+ struct sockaddr_in addr; /* IP address and port to send to */
+
+ __u16 s_tunnel, s_session; /* For matching incoming packets */
+ __u16 d_tunnel, d_session; /* For sending outgoing packets */
+};
+
+/* Socket options:
+ * DEBUG - bitmask of debug message categories
+ * SENDSEQ - 0 => don't send packets with sequence numbers
+ * 1 => send packets with sequence numbers
+ * RECVSEQ - 0 => receive packet sequence numbers are optional
+ * 1 => drop receive packets without sequence numbers
+ * LNSMODE - 0 => act as LAC.
+ * 1 => act as LNS.
+ * REORDERTO - reorder timeout (in millisecs). If 0, don't try to reorder.
+ */
+enum {
+ PPPOL2TP_SO_DEBUG = 1,
+ PPPOL2TP_SO_RECVSEQ = 2,
+ PPPOL2TP_SO_SENDSEQ = 3,
+ PPPOL2TP_SO_LNSMODE = 4,
+ PPPOL2TP_SO_REORDERTO = 5,
+};
+
+/* Debug message categories for the DEBUG socket option */
+enum {
+ PPPOL2TP_MSG_DEBUG = (1 << 0), /* verbose debug (if
+ * compiled in) */
+ PPPOL2TP_MSG_CONTROL = (1 << 1), /* userspace - kernel
+ * interface */
+ PPPOL2TP_MSG_SEQ = (1 << 2), /* sequence numbers */
+ PPPOL2TP_MSG_DATA = (1 << 3), /* data packets */
+};
+
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_pppox.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_pppox.h
new file mode 100644
index 0000000..d8e1511
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_pppox.h
@@ -0,0 +1,123 @@
+/***************************************************************************
+ * Linux PPP over X - Generic PPP transport layer sockets
+ * Linux PPP over Ethernet (PPPoE) Socket Implementation (RFC 2516)
+ *
+ * This file supplies definitions required by the PPP over Ethernet driver
+ * (pppox.c). All version information wrt this file is located in pppox.c
+ *
+ * License:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ */
+
+#ifndef __LINUX_IF_PPPOX_H
+#define __LINUX_IF_PPPOX_H
+
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+#include <linux/if_pppol2tp.h>
+
+/* For user-space programs to pick up these definitions
+ * which they wouldn't get otherwise without defining __KERNEL__
+ */
+#ifndef AF_PPPOX
+#define AF_PPPOX 24
+#define PF_PPPOX AF_PPPOX
+#endif /* !(AF_PPPOX) */
+
+/************************************************************************
+ * PPPoE addressing definition
+ */
+typedef __be16 sid_t;
+struct pppoe_addr{
+ sid_t sid; /* Session identifier */
+ unsigned char remote[ETH_ALEN]; /* Remote address */
+ char dev[IFNAMSIZ]; /* Local device to use */
+};
+
+/************************************************************************
+ * Protocols supported by AF_PPPOX
+ */
+#define PX_PROTO_OE 0 /* Currently just PPPoE */
+#define PX_PROTO_OL2TP 1 /* Now L2TP also */
+#define PX_MAX_PROTO 2
+
+struct sockaddr_pppox {
+ sa_family_t sa_family; /* address family, AF_PPPOX */
+ unsigned int sa_protocol; /* protocol identifier */
+ union{
+ struct pppoe_addr pppoe;
+ }sa_addr;
+}__attribute__ ((packed));
+
+/* The use of the above union isn't viable because the size of this
+ * struct must stay fixed over time -- applications use sizeof(struct
+ * sockaddr_pppox) to fill it. We use a protocol specific sockaddr
+ * type instead.
+ */
+struct sockaddr_pppol2tp {
+ sa_family_t sa_family; /* address family, AF_PPPOX */
+ unsigned int sa_protocol; /* protocol identifier */
+ struct pppol2tp_addr pppol2tp;
+}__attribute__ ((packed));
+
+/*********************************************************************
+ *
+ * ioctl interface for defining forwarding of connections
+ *
+ ********************************************************************/
+
+#define PPPOEIOCSFWD _IOW(0xB1 ,0, size_t)
+#define PPPOEIOCDFWD _IO(0xB1 ,1)
+/*#define PPPOEIOCGFWD _IOWR(0xB1,2, size_t)*/
+
+/* Codes to identify message types */
+#define PADI_CODE 0x09
+#define PADO_CODE 0x07
+#define PADR_CODE 0x19
+#define PADS_CODE 0x65
+#define PADT_CODE 0xa7
+struct pppoe_tag {
+ __be16 tag_type;
+ __be16 tag_len;
+ char tag_data[0];
+} __attribute ((packed));
+
+/* Tag identifiers */
+#define PTT_EOL __cpu_to_be16(0x0000)
+#define PTT_SRV_NAME __cpu_to_be16(0x0101)
+#define PTT_AC_NAME __cpu_to_be16(0x0102)
+#define PTT_HOST_UNIQ __cpu_to_be16(0x0103)
+#define PTT_AC_COOKIE __cpu_to_be16(0x0104)
+#define PTT_VENDOR __cpu_to_be16(0x0105)
+#define PTT_RELAY_SID __cpu_to_be16(0x0110)
+#define PTT_SRV_ERR __cpu_to_be16(0x0201)
+#define PTT_SYS_ERR __cpu_to_be16(0x0202)
+#define PTT_GEN_ERR __cpu_to_be16(0x0203)
+
+struct pppoe_hdr {
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 ver : 4;
+ __u8 type : 4;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u8 type : 4;
+ __u8 ver : 4;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+ __u8 code;
+ __be16 sid;
+ __be16 length;
+ struct pppoe_tag tag[0];
+} __attribute__ ((packed));
+
+/* Length of entire PPPoE + PPP header */
+#define PPPOE_SES_HLEN 8
+
+
+#endif /* !(__LINUX_IF_PPPOX_H) */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_slip.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_slip.h
new file mode 100644
index 0000000..1eb4e3a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_slip.h
@@ -0,0 +1,30 @@
+/*
+ * Swansea University Computer Society NET3
+ *
+ * This file declares the constants of special use with the SLIP/CSLIP/
+ * KISS TNC driver.
+ */
+
+#ifndef __LINUX_SLIP_H
+#define __LINUX_SLIP_H
+
+#define SL_MODE_SLIP 0
+#define SL_MODE_CSLIP 1
+#define SL_MODE_KISS 4
+
+#define SL_OPT_SIXBIT 2
+#define SL_OPT_ADAPTIVE 8
+
+/*
+ * VSV = ioctl for keepalive & outfill in SLIP driver
+ */
+
+#define SIOCSKEEPALIVE (SIOCDEVPRIVATE) /* Set keepalive timeout in sec */
+#define SIOCGKEEPALIVE (SIOCDEVPRIVATE+1) /* Get keepalive timeout */
+#define SIOCSOUTFILL (SIOCDEVPRIVATE+2) /* Set outfill timeout */
+#define SIOCGOUTFILL (SIOCDEVPRIVATE+3) /* Get outfill timeout */
+#define SIOCSLEASE (SIOCDEVPRIVATE+4) /* Set "leased" line type */
+#define SIOCGLEASE (SIOCDEVPRIVATE+5) /* Get line type */
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_strip.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_strip.h
new file mode 100644
index 0000000..6526a62
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_strip.h
@@ -0,0 +1,27 @@
+/*
+ * if_strip.h --
+ *
+ * Definitions for the STRIP interface
+ *
+ * Copyright 1996 The Board of Trustees of The Leland Stanford
+ * Junior University. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies. Stanford University
+ * makes no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without
+ * express or implied warranty.
+ */
+
+#ifndef __LINUX_STRIP_H
+#define __LINUX_STRIP_H
+
+#include <linux/types.h>
+
+typedef struct {
+ __u8 c[6];
+} MetricomAddress;
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_tr.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_tr.h
new file mode 100644
index 0000000..414bc95
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_tr.h
@@ -0,0 +1,95 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for the Token-Ring IEEE 802.5 interface.
+ *
+ * Version: @(#)if_tr.h 0.0 07/11/94
+ *
+ * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ * Donald Becker, <becker@super.org>
+ * Peter De Schrijver, <stud11@cc4.kuleuven.ac.be>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_IF_TR_H
+#define _LINUX_IF_TR_H
+
+#include <linux/types.h>
+#include <asm/byteorder.h> /* For __be16 */
+
+/* IEEE 802.5 Token-Ring magic constants. The frame sizes omit the preamble
+ and FCS/CRC (frame check sequence). */
+#define TR_ALEN 6 /* Octets in one token-ring addr */
+#define TR_HLEN (sizeof(struct trh_hdr)+sizeof(struct trllc))
+#define AC 0x10
+#define LLC_FRAME 0x40
+
+/* LLC and SNAP constants */
+#define EXTENDED_SAP 0xAA
+#define UI_CMD 0x03
+
+/* This is an Token-Ring frame header. */
+struct trh_hdr {
+ __u8 ac; /* access control field */
+ __u8 fc; /* frame control field */
+ __u8 daddr[TR_ALEN]; /* destination address */
+ __u8 saddr[TR_ALEN]; /* source address */
+ __be16 rcf; /* route control field */
+ __be16 rseg[8]; /* routing registers */
+};
+
+
+/* This is an Token-Ring LLC structure */
+struct trllc {
+ __u8 dsap; /* destination SAP */
+ __u8 ssap; /* source SAP */
+ __u8 llc; /* LLC control field */
+ __u8 protid[3]; /* protocol id */
+ __be16 ethertype; /* ether type field */
+};
+
+/* Token-Ring statistics collection data. */
+struct tr_statistics {
+ unsigned long rx_packets; /* total packets received */
+ unsigned long tx_packets; /* total packets transmitted */
+ unsigned long rx_bytes; /* total bytes received */
+ unsigned long tx_bytes; /* total bytes transmitted */
+ unsigned long rx_errors; /* bad packets received */
+ unsigned long tx_errors; /* packet transmit problems */
+ unsigned long rx_dropped; /* no space in linux buffers */
+ unsigned long tx_dropped; /* no space available in linux */
+ unsigned long multicast; /* multicast packets received */
+ unsigned long transmit_collision;
+
+ /* detailed Token-Ring errors. See IBM Token-Ring Network
+ Architecture for more info */
+
+ unsigned long line_errors;
+ unsigned long internal_errors;
+ unsigned long burst_errors;
+ unsigned long A_C_errors;
+ unsigned long abort_delimiters;
+ unsigned long lost_frames;
+ unsigned long recv_congest_count;
+ unsigned long frame_copied_errors;
+ unsigned long frequency_errors;
+ unsigned long token_errors;
+ unsigned long dummy1;
+};
+
+/* source routing stuff */
+#define TR_RII 0x80
+#define TR_RCF_DIR_BIT 0x80
+#define TR_RCF_LEN_MASK 0x1f00
+#define TR_RCF_BROADCAST 0x8000 /* all-routes broadcast */
+#define TR_RCF_LIMITED_BROADCAST 0xC000 /* single-route broadcast */
+#define TR_RCF_FRAME2K 0x20
+#define TR_RCF_BROADCAST_MASK 0xC000
+#define TR_MAXRIFLEN 18
+
+#endif /* _LINUX_IF_TR_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_tun.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_tun.h
new file mode 100644
index 0000000..049d6c9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_tun.h
@@ -0,0 +1,87 @@
+/*
+ * Universal TUN/TAP device driver.
+ * Copyright (C) 1999-2000 Maxim Krasnyansky <max_mk@yahoo.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __IF_TUN_H
+#define __IF_TUN_H
+
+#include <linux/types.h>
+#include <linux/if_ether.h>
+
+/* Read queue size */
+#define TUN_READQ_SIZE 500
+
+/* TUN device flags */
+#define TUN_TUN_DEV 0x0001
+#define TUN_TAP_DEV 0x0002
+#define TUN_TYPE_MASK 0x000f
+
+#define TUN_FASYNC 0x0010
+#define TUN_NOCHECKSUM 0x0020
+#define TUN_NO_PI 0x0040
+#define TUN_ONE_QUEUE 0x0080
+#define TUN_PERSIST 0x0100
+#define TUN_VNET_HDR 0x0200
+
+/* Ioctl defines */
+#define TUNSETNOCSUM _IOW('T', 200, int)
+#define TUNSETDEBUG _IOW('T', 201, int)
+#define TUNSETIFF _IOW('T', 202, int)
+#define TUNSETPERSIST _IOW('T', 203, int)
+#define TUNSETOWNER _IOW('T', 204, int)
+#define TUNSETLINK _IOW('T', 205, int)
+#define TUNSETGROUP _IOW('T', 206, int)
+#define TUNGETFEATURES _IOR('T', 207, unsigned int)
+#define TUNSETOFFLOAD _IOW('T', 208, unsigned int)
+#define TUNSETTXFILTER _IOW('T', 209, unsigned int)
+#define TUNGETIFF _IOR('T', 210, unsigned int)
+#define TUNGETSNDBUF _IOR('T', 211, int)
+#define TUNSETSNDBUF _IOW('T', 212, int)
+
+/* TUNSETIFF ifr flags */
+#define IFF_TUN 0x0001
+#define IFF_TAP 0x0002
+#define IFF_NO_PI 0x1000
+#define IFF_ONE_QUEUE 0x2000
+#define IFF_VNET_HDR 0x4000
+
+/* Features for GSO (TUNSETOFFLOAD). */
+#define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */
+#define TUN_F_TSO4 0x02 /* I can handle TSO for IPv4 packets */
+#define TUN_F_TSO6 0x04 /* I can handle TSO for IPv6 packets */
+#define TUN_F_TSO_ECN 0x08 /* I can handle TSO with ECN bits. */
+
+/* Protocol info prepended to the packets (when IFF_NO_PI is not set) */
+#define TUN_PKT_STRIP 0x0001
+struct tun_pi {
+ __u16 flags;
+ __be16 proto;
+};
+
+/*
+ * Filter spec (used for SETXXFILTER ioctls)
+ * This stuff is applicable only to the TAP (Ethernet) devices.
+ * If the count is zero the filter is disabled and the driver accepts
+ * all packets (promisc mode).
+ * If the filter is enabled in order to accept broadcast packets
+ * broadcast addr must be explicitly included in the addr list.
+ */
+#define TUN_FLT_ALLMULTI 0x0001 /* Accept all multicast packets */
+struct tun_filter {
+ __u16 flags; /* TUN_FLT_ flags see above */
+ __u16 count; /* Number of addresses */
+ __u8 addr[0][ETH_ALEN];
+};
+
+#endif /* __IF_TUN_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_tunnel.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_tunnel.h
new file mode 100644
index 0000000..3036cec
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_tunnel.h
@@ -0,0 +1,69 @@
+#ifndef _IF_TUNNEL_H_
+#define _IF_TUNNEL_H_
+
+#include <linux/types.h>
+
+
+#define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
+#define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
+#define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2)
+#define SIOCCHGTUNNEL (SIOCDEVPRIVATE + 3)
+#define SIOCGETPRL (SIOCDEVPRIVATE + 4)
+#define SIOCADDPRL (SIOCDEVPRIVATE + 5)
+#define SIOCDELPRL (SIOCDEVPRIVATE + 6)
+#define SIOCCHGPRL (SIOCDEVPRIVATE + 7)
+
+#define GRE_CSUM __cpu_to_be16(0x8000)
+#define GRE_ROUTING __cpu_to_be16(0x4000)
+#define GRE_KEY __cpu_to_be16(0x2000)
+#define GRE_SEQ __cpu_to_be16(0x1000)
+#define GRE_STRICT __cpu_to_be16(0x0800)
+#define GRE_REC __cpu_to_be16(0x0700)
+#define GRE_FLAGS __cpu_to_be16(0x00F8)
+#define GRE_VERSION __cpu_to_be16(0x0007)
+
+struct ip_tunnel_parm
+{
+ char name[IFNAMSIZ];
+ int link;
+ __be16 i_flags;
+ __be16 o_flags;
+ __be32 i_key;
+ __be32 o_key;
+ struct iphdr iph;
+};
+
+/* SIT-mode i_flags */
+#define SIT_ISATAP 0x0001
+
+struct ip_tunnel_prl {
+ __be32 addr;
+ __u16 flags;
+ __u16 __reserved;
+ __u32 datalen;
+ __u32 __reserved2;
+ /* data follows */
+};
+
+/* PRL flags */
+#define PRL_DEFAULT 0x0001
+
+enum
+{
+ IFLA_GRE_UNSPEC,
+ IFLA_GRE_LINK,
+ IFLA_GRE_IFLAGS,
+ IFLA_GRE_OFLAGS,
+ IFLA_GRE_IKEY,
+ IFLA_GRE_OKEY,
+ IFLA_GRE_LOCAL,
+ IFLA_GRE_REMOTE,
+ IFLA_GRE_TTL,
+ IFLA_GRE_TOS,
+ IFLA_GRE_PMTUDISC,
+ __IFLA_GRE_MAX,
+};
+
+#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1)
+
+#endif /* _IF_TUNNEL_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_vlan.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_vlan.h
new file mode 100644
index 0000000..2dc4a57
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/if_vlan.h
@@ -0,0 +1,62 @@
+/*
+ * VLAN An implementation of 802.1Q VLAN tagging.
+ *
+ * Authors: Ben Greear <greearb@candelatech.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ */
+
+#ifndef _LINUX_IF_VLAN_H_
+#define _LINUX_IF_VLAN_H_
+
+
+/* VLAN IOCTLs are found in sockios.h */
+
+/* Passed in vlan_ioctl_args structure to determine behaviour. */
+enum vlan_ioctl_cmds {
+ ADD_VLAN_CMD,
+ DEL_VLAN_CMD,
+ SET_VLAN_INGRESS_PRIORITY_CMD,
+ SET_VLAN_EGRESS_PRIORITY_CMD,
+ GET_VLAN_INGRESS_PRIORITY_CMD,
+ GET_VLAN_EGRESS_PRIORITY_CMD,
+ SET_VLAN_NAME_TYPE_CMD,
+ SET_VLAN_FLAG_CMD,
+ GET_VLAN_REALDEV_NAME_CMD, /* If this works, you know it's a VLAN device, btw */
+ GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */
+};
+
+enum vlan_flags {
+ VLAN_FLAG_REORDER_HDR = 0x1,
+ VLAN_FLAG_GVRP = 0x2,
+};
+
+enum vlan_name_types {
+ VLAN_NAME_TYPE_PLUS_VID, /* Name will look like: vlan0005 */
+ VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like: eth1.0005 */
+ VLAN_NAME_TYPE_PLUS_VID_NO_PAD, /* Name will look like: vlan5 */
+ VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD, /* Name will look like: eth0.5 */
+ VLAN_NAME_TYPE_HIGHEST
+};
+
+struct vlan_ioctl_args {
+ int cmd; /* Should be one of the vlan_ioctl_cmds enum above. */
+ char device1[24];
+
+ union {
+ char device2[24];
+ int VID;
+ unsigned int skb_priority;
+ unsigned int name_type;
+ unsigned int bind_type;
+ unsigned int flag; /* Matches vlan_dev_info flags */
+ } u;
+
+ short vlan_qos;
+};
+
+#endif /* !(_LINUX_IF_VLAN_H_) */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/igmp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/igmp.h
new file mode 100644
index 0000000..6c4c5a7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/igmp.h
@@ -0,0 +1,129 @@
+/*
+ * Linux NET3: Internet Group Management Protocol [IGMP]
+ *
+ * Authors:
+ * Alan Cox <alan@lxorguk.ukuu.org.uk>
+ *
+ * Extended to talk the BSD extended IGMP protocol of mrouted 3.6
+ *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_IGMP_H
+#define _LINUX_IGMP_H
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+/*
+ * IGMP protocol structures
+ */
+
+/*
+ * Header in on cable format
+ */
+
+struct igmphdr
+{
+ __u8 type;
+ __u8 code; /* For newer IGMP */
+ __sum16 csum;
+ __be32 group;
+};
+
+/* V3 group record types [grec_type] */
+#define IGMPV3_MODE_IS_INCLUDE 1
+#define IGMPV3_MODE_IS_EXCLUDE 2
+#define IGMPV3_CHANGE_TO_INCLUDE 3
+#define IGMPV3_CHANGE_TO_EXCLUDE 4
+#define IGMPV3_ALLOW_NEW_SOURCES 5
+#define IGMPV3_BLOCK_OLD_SOURCES 6
+
+struct igmpv3_grec {
+ __u8 grec_type;
+ __u8 grec_auxwords;
+ __be16 grec_nsrcs;
+ __be32 grec_mca;
+ __be32 grec_src[0];
+};
+
+struct igmpv3_report {
+ __u8 type;
+ __u8 resv1;
+ __be16 csum;
+ __be16 resv2;
+ __be16 ngrec;
+ struct igmpv3_grec grec[0];
+};
+
+struct igmpv3_query {
+ __u8 type;
+ __u8 code;
+ __be16 csum;
+ __be32 group;
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 qrv:3,
+ suppress:1,
+ resv:4;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u8 resv:4,
+ suppress:1,
+ qrv:3;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+ __u8 qqic;
+ __be16 nsrcs;
+ __be32 srcs[0];
+};
+
+#define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */
+#define IGMP_HOST_MEMBERSHIP_REPORT 0x12 /* Ditto */
+#define IGMP_DVMRP 0x13 /* DVMRP routing */
+#define IGMP_PIM 0x14 /* PIM routing */
+#define IGMP_TRACE 0x15
+#define IGMPV2_HOST_MEMBERSHIP_REPORT 0x16 /* V2 version of 0x11 */
+#define IGMP_HOST_LEAVE_MESSAGE 0x17
+#define IGMPV3_HOST_MEMBERSHIP_REPORT 0x22 /* V3 version of 0x11 */
+
+#define IGMP_MTRACE_RESP 0x1e
+#define IGMP_MTRACE 0x1f
+
+
+/*
+ * Use the BSD names for these for compatibility
+ */
+
+#define IGMP_DELAYING_MEMBER 0x01
+#define IGMP_IDLE_MEMBER 0x02
+#define IGMP_LAZY_MEMBER 0x03
+#define IGMP_SLEEPING_MEMBER 0x04
+#define IGMP_AWAKENING_MEMBER 0x05
+
+#define IGMP_MINLEN 8
+
+#define IGMP_MAX_HOST_REPORT_DELAY 10 /* max delay for response to */
+ /* query (in seconds) */
+
+#define IGMP_TIMER_SCALE 10 /* denotes that the igmphdr->timer field */
+ /* specifies time in 10th of seconds */
+
+#define IGMP_AGE_THRESHOLD 400 /* If this host don't hear any IGMP V1 */
+ /* message in this period of time, */
+ /* revert to IGMP v2 router. */
+
+#define IGMP_ALL_HOSTS htonl(0xE0000001L)
+#define IGMP_ALL_ROUTER htonl(0xE0000002L)
+#define IGMPV3_ALL_MCR htonl(0xE0000016L)
+#define IGMP_LOCAL_GROUP htonl(0xE0000000L)
+#define IGMP_LOCAL_GROUP_MASK htonl(0xFFFFFF00L)
+
+/*
+ * struct for keeping the multicast list in
+ */
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/in.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/in.h
new file mode 100644
index 0000000..83952be
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/in.h
@@ -0,0 +1,254 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Definitions of the Internet Protocol.
+ *
+ * Version: @(#)in.h 1.0.1 04/21/93
+ *
+ * Authors: Original taken from the GNU Project <netinet/in.h> file.
+ * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_IN_H
+#define _LINUX_IN_H
+
+#include <linux/types.h>
+#include <linux/socket.h>
+
+/* Standard well-defined IP protocols. */
+enum {
+ IPPROTO_IP = 0, /* Dummy protocol for TCP */
+ IPPROTO_ICMP = 1, /* Internet Control Message Protocol */
+ IPPROTO_IGMP = 2, /* Internet Group Management Protocol */
+ IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94) */
+ IPPROTO_TCP = 6, /* Transmission Control Protocol */
+ IPPROTO_EGP = 8, /* Exterior Gateway Protocol */
+ IPPROTO_PUP = 12, /* PUP protocol */
+ IPPROTO_UDP = 17, /* User Datagram Protocol */
+ IPPROTO_IDP = 22, /* XNS IDP protocol */
+ IPPROTO_DCCP = 33, /* Datagram Congestion Control Protocol */
+ IPPROTO_RSVP = 46, /* RSVP protocol */
+ IPPROTO_GRE = 47, /* Cisco GRE tunnels (rfc 1701,1702) */
+
+ IPPROTO_IPV6 = 41, /* IPv6-in-IPv4 tunnelling */
+
+ IPPROTO_ESP = 50, /* Encapsulation Security Payload protocol */
+ IPPROTO_AH = 51, /* Authentication Header protocol */
+ IPPROTO_BEETPH = 94, /* IP option pseudo header for BEET */
+ IPPROTO_PIM = 103, /* Protocol Independent Multicast */
+
+ IPPROTO_COMP = 108, /* Compression Header protocol */
+ IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */
+ IPPROTO_UDPLITE = 136, /* UDP-Lite (RFC 3828) */
+
+ IPPROTO_RAW = 255, /* Raw IP packets */
+ IPPROTO_MAX
+};
+
+
+/* Internet address. */
+struct in_addr {
+ __be32 s_addr;
+};
+
+#define IP_TOS 1
+#define IP_TTL 2
+#define IP_HDRINCL 3
+#define IP_OPTIONS 4
+#define IP_ROUTER_ALERT 5
+#define IP_RECVOPTS 6
+#define IP_RETOPTS 7
+#define IP_PKTINFO 8
+#define IP_PKTOPTIONS 9
+#define IP_MTU_DISCOVER 10
+#define IP_RECVERR 11
+#define IP_RECVTTL 12
+#define IP_RECVTOS 13
+#define IP_MTU 14
+#define IP_FREEBIND 15
+#define IP_IPSEC_POLICY 16
+#define IP_XFRM_POLICY 17
+#define IP_PASSSEC 18
+#define IP_TRANSPARENT 19
+
+/* BSD compatibility */
+#define IP_RECVRETOPTS IP_RETOPTS
+
+/* TProxy original addresses */
+#define IP_ORIGDSTADDR 20
+#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR
+
+/* IP_MTU_DISCOVER values */
+#define IP_PMTUDISC_DONT 0 /* Never send DF frames */
+#define IP_PMTUDISC_WANT 1 /* Use per route hints */
+#define IP_PMTUDISC_DO 2 /* Always DF */
+#define IP_PMTUDISC_PROBE 3 /* Ignore dst pmtu */
+
+#define IP_MULTICAST_IF 32
+#define IP_MULTICAST_TTL 33
+#define IP_MULTICAST_LOOP 34
+#define IP_ADD_MEMBERSHIP 35
+#define IP_DROP_MEMBERSHIP 36
+#define IP_UNBLOCK_SOURCE 37
+#define IP_BLOCK_SOURCE 38
+#define IP_ADD_SOURCE_MEMBERSHIP 39
+#define IP_DROP_SOURCE_MEMBERSHIP 40
+#define IP_MSFILTER 41
+#define MCAST_JOIN_GROUP 42
+#define MCAST_BLOCK_SOURCE 43
+#define MCAST_UNBLOCK_SOURCE 44
+#define MCAST_LEAVE_GROUP 45
+#define MCAST_JOIN_SOURCE_GROUP 46
+#define MCAST_LEAVE_SOURCE_GROUP 47
+#define MCAST_MSFILTER 48
+
+#define MCAST_EXCLUDE 0
+#define MCAST_INCLUDE 1
+
+/* These need to appear somewhere around here */
+#define IP_DEFAULT_MULTICAST_TTL 1
+#define IP_DEFAULT_MULTICAST_LOOP 1
+
+/* Request struct for multicast socket ops */
+
+struct ip_mreq
+{
+ struct in_addr imr_multiaddr; /* IP multicast address of group */
+ struct in_addr imr_interface; /* local IP address of interface */
+};
+
+struct ip_mreqn
+{
+ struct in_addr imr_multiaddr; /* IP multicast address of group */
+ struct in_addr imr_address; /* local IP address of interface */
+ int imr_ifindex; /* Interface index */
+};
+
+struct ip_mreq_source {
+ __be32 imr_multiaddr;
+ __be32 imr_interface;
+ __be32 imr_sourceaddr;
+};
+
+struct ip_msfilter {
+ __be32 imsf_multiaddr;
+ __be32 imsf_interface;
+ __u32 imsf_fmode;
+ __u32 imsf_numsrc;
+ __be32 imsf_slist[1];
+};
+
+#define IP_MSFILTER_SIZE(numsrc) \
+ (sizeof(struct ip_msfilter) - sizeof(__u32) \
+ + (numsrc) * sizeof(__u32))
+
+struct group_req
+{
+ __u32 gr_interface; /* interface index */
+ struct __kernel_sockaddr_storage gr_group; /* group address */
+};
+
+struct group_source_req
+{
+ __u32 gsr_interface; /* interface index */
+ struct __kernel_sockaddr_storage gsr_group; /* group address */
+ struct __kernel_sockaddr_storage gsr_source; /* source address */
+};
+
+struct group_filter
+{
+ __u32 gf_interface; /* interface index */
+ struct __kernel_sockaddr_storage gf_group; /* multicast address */
+ __u32 gf_fmode; /* filter mode */
+ __u32 gf_numsrc; /* number of sources */
+ struct __kernel_sockaddr_storage gf_slist[1]; /* interface index */
+};
+
+#define GROUP_FILTER_SIZE(numsrc) \
+ (sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage) \
+ + (numsrc) * sizeof(struct __kernel_sockaddr_storage))
+
+struct in_pktinfo
+{
+ int ipi_ifindex;
+ struct in_addr ipi_spec_dst;
+ struct in_addr ipi_addr;
+};
+
+/* Structure describing an Internet (IP) socket address. */
+#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
+struct sockaddr_in {
+ sa_family_t sin_family; /* Address family */
+ __be16 sin_port; /* Port number */
+ struct in_addr sin_addr; /* Internet address */
+
+ /* Pad to size of `struct sockaddr'. */
+ unsigned char __pad[__SOCK_SIZE__ - sizeof(short int) -
+ sizeof(unsigned short int) - sizeof(struct in_addr)];
+};
+#define sin_zero __pad /* for BSD UNIX comp. -FvK */
+
+
+/*
+ * Definitions of the bits in an Internet address integer.
+ * On subnets, host and network parts are found according
+ * to the subnet mask, not these masks.
+ */
+#define IN_CLASSA(a) ((((long int) (a)) & 0x80000000) == 0)
+#define IN_CLASSA_NET 0xff000000
+#define IN_CLASSA_NSHIFT 24
+#define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET)
+#define IN_CLASSA_MAX 128
+
+#define IN_CLASSB(a) ((((long int) (a)) & 0xc0000000) == 0x80000000)
+#define IN_CLASSB_NET 0xffff0000
+#define IN_CLASSB_NSHIFT 16
+#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET)
+#define IN_CLASSB_MAX 65536
+
+#define IN_CLASSC(a) ((((long int) (a)) & 0xe0000000) == 0xc0000000)
+#define IN_CLASSC_NET 0xffffff00
+#define IN_CLASSC_NSHIFT 8
+#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET)
+
+#define IN_CLASSD(a) ((((long int) (a)) & 0xf0000000) == 0xe0000000)
+#define IN_MULTICAST(a) IN_CLASSD(a)
+#define IN_MULTICAST_NET 0xF0000000
+
+#define IN_EXPERIMENTAL(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000)
+#define IN_BADCLASS(a) IN_EXPERIMENTAL((a))
+
+/* Address to accept any incoming messages. */
+#define INADDR_ANY ((unsigned long int) 0x00000000)
+
+/* Address to send to all hosts. */
+#define INADDR_BROADCAST ((unsigned long int) 0xffffffff)
+
+/* Address indicating an error return. */
+#define INADDR_NONE ((unsigned long int) 0xffffffff)
+
+/* Network number for local host loopback. */
+#define IN_LOOPBACKNET 127
+
+/* Address to loopback in software to local host. */
+#define INADDR_LOOPBACK 0x7f000001 /* 127.0.0.1 */
+#define IN_LOOPBACK(a) ((((long int) (a)) & 0xff000000) == 0x7f000000)
+
+/* Defines for Multicast INADDR */
+#define INADDR_UNSPEC_GROUP 0xe0000000U /* 224.0.0.0 */
+#define INADDR_ALLHOSTS_GROUP 0xe0000001U /* 224.0.0.1 */
+#define INADDR_ALLRTRS_GROUP 0xe0000002U /* 224.0.0.2 */
+#define INADDR_MAX_LOCAL_GROUP 0xe00000ffU /* 224.0.0.255 */
+
+
+/* <asm/byteorder.h> contains the htonl type stuff.. */
+#include <asm/byteorder.h>
+
+
+#endif /* _LINUX_IN_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/in6.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/in6.h
new file mode 100644
index 0000000..9536569
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/in6.h
@@ -0,0 +1,274 @@
+/*
+ * Types and definitions for AF_INET6
+ * Linux INET6 implementation
+ *
+ * Authors:
+ * Pedro Roque <roque@di.fc.ul.pt>
+ *
+ * Sources:
+ * IPv6 Program Interfaces for BSD Systems
+ * <draft-ietf-ipngwg-bsd-api-05.txt>
+ *
+ * Advanced Sockets API for IPv6
+ * <draft-stevens-advanced-api-00.txt>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_IN6_H
+#define _LINUX_IN6_H
+
+#include <linux/types.h>
+
+/*
+ * IPv6 address structure
+ */
+
+struct in6_addr
+{
+ union
+ {
+ __u8 u6_addr8[16];
+ __be16 u6_addr16[8];
+ __be32 u6_addr32[4];
+ } in6_u;
+#define s6_addr in6_u.u6_addr8
+#define s6_addr16 in6_u.u6_addr16
+#define s6_addr32 in6_u.u6_addr32
+};
+
+/* IPv6 Wildcard Address (::) and Loopback Address (::1) defined in RFC2553
+ * NOTE: Be aware the IN6ADDR_* constants and in6addr_* externals are defined
+ * in network byte order, not in host byte order as are the IPv4 equivalents
+ */
+
+struct sockaddr_in6 {
+ unsigned short int sin6_family; /* AF_INET6 */
+ __be16 sin6_port; /* Transport layer port # */
+ __be32 sin6_flowinfo; /* IPv6 flow information */
+ struct in6_addr sin6_addr; /* IPv6 address */
+ __u32 sin6_scope_id; /* scope id (new in RFC2553) */
+};
+
+struct ipv6_mreq {
+ /* IPv6 multicast address of group */
+ struct in6_addr ipv6mr_multiaddr;
+
+ /* local IPv6 address of interface */
+ int ipv6mr_ifindex;
+};
+
+#define ipv6mr_acaddr ipv6mr_multiaddr
+
+struct in6_flowlabel_req
+{
+ struct in6_addr flr_dst;
+ __be32 flr_label;
+ __u8 flr_action;
+ __u8 flr_share;
+ __u16 flr_flags;
+ __u16 flr_expires;
+ __u16 flr_linger;
+ __u32 __flr_pad;
+ /* Options in format of IPV6_PKTOPTIONS */
+};
+
+#define IPV6_FL_A_GET 0
+#define IPV6_FL_A_PUT 1
+#define IPV6_FL_A_RENEW 2
+
+#define IPV6_FL_F_CREATE 1
+#define IPV6_FL_F_EXCL 2
+
+#define IPV6_FL_S_NONE 0
+#define IPV6_FL_S_EXCL 1
+#define IPV6_FL_S_PROCESS 2
+#define IPV6_FL_S_USER 3
+#define IPV6_FL_S_ANY 255
+
+
+/*
+ * Bitmask constant declarations to help applications select out the
+ * flow label and priority fields.
+ *
+ * Note that this are in host byte order while the flowinfo field of
+ * sockaddr_in6 is in network byte order.
+ */
+
+#define IPV6_FLOWINFO_FLOWLABEL 0x000fffff
+#define IPV6_FLOWINFO_PRIORITY 0x0ff00000
+
+/* These defintions are obsolete */
+#define IPV6_PRIORITY_UNCHARACTERIZED 0x0000
+#define IPV6_PRIORITY_FILLER 0x0100
+#define IPV6_PRIORITY_UNATTENDED 0x0200
+#define IPV6_PRIORITY_RESERVED1 0x0300
+#define IPV6_PRIORITY_BULK 0x0400
+#define IPV6_PRIORITY_RESERVED2 0x0500
+#define IPV6_PRIORITY_INTERACTIVE 0x0600
+#define IPV6_PRIORITY_CONTROL 0x0700
+#define IPV6_PRIORITY_8 0x0800
+#define IPV6_PRIORITY_9 0x0900
+#define IPV6_PRIORITY_10 0x0a00
+#define IPV6_PRIORITY_11 0x0b00
+#define IPV6_PRIORITY_12 0x0c00
+#define IPV6_PRIORITY_13 0x0d00
+#define IPV6_PRIORITY_14 0x0e00
+#define IPV6_PRIORITY_15 0x0f00
+
+/*
+ * IPV6 extension headers
+ */
+#define IPPROTO_HOPOPTS 0 /* IPv6 hop-by-hop options */
+#define IPPROTO_ROUTING 43 /* IPv6 routing header */
+#define IPPROTO_FRAGMENT 44 /* IPv6 fragmentation header */
+#define IPPROTO_ICMPV6 58 /* ICMPv6 */
+#define IPPROTO_NONE 59 /* IPv6 no next header */
+#define IPPROTO_DSTOPTS 60 /* IPv6 destination options */
+#define IPPROTO_MH 135 /* IPv6 mobility header */
+
+/*
+ * IPv6 TLV options.
+ */
+#define IPV6_TLV_PAD0 0
+#define IPV6_TLV_PADN 1
+#define IPV6_TLV_ROUTERALERT 5
+#define IPV6_TLV_JUMBO 194
+#define IPV6_TLV_HAO 201 /* home address option */
+
+/*
+ * IPV6 socket options
+ */
+
+#define IPV6_ADDRFORM 1
+#define IPV6_2292PKTINFO 2
+#define IPV6_2292HOPOPTS 3
+#define IPV6_2292DSTOPTS 4
+#define IPV6_2292RTHDR 5
+#define IPV6_2292PKTOPTIONS 6
+#define IPV6_CHECKSUM 7
+#define IPV6_2292HOPLIMIT 8
+#define IPV6_NEXTHOP 9
+#define IPV6_AUTHHDR 10 /* obsolete */
+#define IPV6_FLOWINFO 11
+
+#define IPV6_UNICAST_HOPS 16
+#define IPV6_MULTICAST_IF 17
+#define IPV6_MULTICAST_HOPS 18
+#define IPV6_MULTICAST_LOOP 19
+#define IPV6_ADD_MEMBERSHIP 20
+#define IPV6_DROP_MEMBERSHIP 21
+#define IPV6_ROUTER_ALERT 22
+#define IPV6_MTU_DISCOVER 23
+#define IPV6_MTU 24
+#define IPV6_RECVERR 25
+#define IPV6_V6ONLY 26
+#define IPV6_JOIN_ANYCAST 27
+#define IPV6_LEAVE_ANYCAST 28
+
+/* IPV6_MTU_DISCOVER values */
+#define IPV6_PMTUDISC_DONT 0
+#define IPV6_PMTUDISC_WANT 1
+#define IPV6_PMTUDISC_DO 2
+#define IPV6_PMTUDISC_PROBE 3
+
+/* Flowlabel */
+#define IPV6_FLOWLABEL_MGR 32
+#define IPV6_FLOWINFO_SEND 33
+
+#define IPV6_IPSEC_POLICY 34
+#define IPV6_XFRM_POLICY 35
+
+/*
+ * Multicast:
+ * Following socket options are shared between IPv4 and IPv6.
+ *
+ * MCAST_JOIN_GROUP 42
+ * MCAST_BLOCK_SOURCE 43
+ * MCAST_UNBLOCK_SOURCE 44
+ * MCAST_LEAVE_GROUP 45
+ * MCAST_JOIN_SOURCE_GROUP 46
+ * MCAST_LEAVE_SOURCE_GROUP 47
+ * MCAST_MSFILTER 48
+ */
+
+/*
+ * Advanced API (RFC3542) (1)
+ *
+ * Note: IPV6_RECVRTHDRDSTOPTS does not exist. see net/ipv6/datagram.c.
+ */
+
+#define IPV6_RECVPKTINFO 49
+#define IPV6_PKTINFO 50
+#define IPV6_RECVHOPLIMIT 51
+#define IPV6_HOPLIMIT 52
+#define IPV6_RECVHOPOPTS 53
+#define IPV6_HOPOPTS 54
+#define IPV6_RTHDRDSTOPTS 55
+#define IPV6_RECVRTHDR 56
+#define IPV6_RTHDR 57
+#define IPV6_RECVDSTOPTS 58
+#define IPV6_DSTOPTS 59
+#if 0 /* not yet */
+#define IPV6_RECVPATHMTU 60
+#define IPV6_PATHMTU 61
+#define IPV6_DONTFRAG 62
+#define IPV6_USE_MIN_MTU 63
+#endif
+
+/*
+ * Netfilter (1)
+ *
+ * Following socket options are used in ip6_tables;
+ * see include/linux/netfilter_ipv6/ip6_tables.h.
+ *
+ * IP6T_SO_SET_REPLACE / IP6T_SO_GET_INFO 64
+ * IP6T_SO_SET_ADD_COUNTERS / IP6T_SO_GET_ENTRIES 65
+ */
+
+/*
+ * Advanced API (RFC3542) (2)
+ */
+#define IPV6_RECVTCLASS 66
+#define IPV6_TCLASS 67
+
+/*
+ * Netfilter (2)
+ *
+ * Following socket options are used in ip6_tables;
+ * see include/linux/netfilter_ipv6/ip6_tables.h.
+ *
+ * IP6T_SO_GET_REVISION_MATCH 68
+ * IP6T_SO_GET_REVISION_TARGET 69
+ */
+
+/* RFC5014: Source address selection */
+#define IPV6_ADDR_PREFERENCES 72
+
+#define IPV6_PREFER_SRC_TMP 0x0001
+#define IPV6_PREFER_SRC_PUBLIC 0x0002
+#define IPV6_PREFER_SRC_PUBTMP_DEFAULT 0x0100
+#define IPV6_PREFER_SRC_COA 0x0004
+#define IPV6_PREFER_SRC_HOME 0x0400
+#define IPV6_PREFER_SRC_CGA 0x0008
+#define IPV6_PREFER_SRC_NONCGA 0x0800
+
+/*
+ * Multicast Routing:
+ * see include/linux/mroute6.h.
+ *
+ * MRT6_INIT 200
+ * MRT6_DONE 201
+ * MRT6_ADD_MIF 202
+ * MRT6_DEL_MIF 203
+ * MRT6_ADD_MFC 204
+ * MRT6_DEL_MFC 205
+ * MRT6_VERSION 206
+ * MRT6_ASSERT 207
+ * MRT6_PIM 208
+ * (reserved) 209
+ */
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/in_route.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/in_route.h
new file mode 100644
index 0000000..b261b8c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/in_route.h
@@ -0,0 +1,32 @@
+#ifndef _LINUX_IN_ROUTE_H
+#define _LINUX_IN_ROUTE_H
+
+/* IPv4 routing cache flags */
+
+#define RTCF_DEAD RTNH_F_DEAD
+#define RTCF_ONLINK RTNH_F_ONLINK
+
+/* Obsolete flag. About to be deleted */
+#define RTCF_NOPMTUDISC RTM_F_NOPMTUDISC
+
+#define RTCF_NOTIFY 0x00010000
+#define RTCF_DIRECTDST 0x00020000 /* unused */
+#define RTCF_REDIRECTED 0x00040000
+#define RTCF_TPROXY 0x00080000 /* unused */
+
+#define RTCF_FAST 0x00200000 /* unused */
+#define RTCF_MASQ 0x00400000 /* unused */
+#define RTCF_SNAT 0x00800000 /* unused */
+#define RTCF_DOREDIRECT 0x01000000
+#define RTCF_DIRECTSRC 0x04000000
+#define RTCF_DNAT 0x08000000
+#define RTCF_BROADCAST 0x10000000
+#define RTCF_MULTICAST 0x20000000
+#define RTCF_REJECT 0x40000000 /* unused */
+#define RTCF_LOCAL 0x80000000
+
+#define RTCF_NAT (RTCF_DNAT|RTCF_SNAT)
+
+#define RT_TOS(tos) ((tos)&IPTOS_TOS_MASK)
+
+#endif /* _LINUX_IN_ROUTE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/inet_diag.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/inet_diag.h
new file mode 100644
index 0000000..1107ed2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/inet_diag.h
@@ -0,0 +1,124 @@
+#ifndef _INET_DIAG_H_
+#define _INET_DIAG_H_ 1
+
+#include <linux/types.h>
+
+/* Just some random number */
+#define TCPDIAG_GETSOCK 18
+#define DCCPDIAG_GETSOCK 19
+
+#define INET_DIAG_GETSOCK_MAX 24
+
+/* Socket identity */
+struct inet_diag_sockid {
+ __be16 idiag_sport;
+ __be16 idiag_dport;
+ __be32 idiag_src[4];
+ __be32 idiag_dst[4];
+ __u32 idiag_if;
+ __u32 idiag_cookie[2];
+#define INET_DIAG_NOCOOKIE (~0U)
+};
+
+/* Request structure */
+
+struct inet_diag_req {
+ __u8 idiag_family; /* Family of addresses. */
+ __u8 idiag_src_len;
+ __u8 idiag_dst_len;
+ __u8 idiag_ext; /* Query extended information */
+
+ struct inet_diag_sockid id;
+
+ __u32 idiag_states; /* States to dump */
+ __u32 idiag_dbs; /* Tables to dump (NI) */
+};
+
+enum {
+ INET_DIAG_REQ_NONE,
+ INET_DIAG_REQ_BYTECODE,
+};
+
+#define INET_DIAG_REQ_MAX INET_DIAG_REQ_BYTECODE
+
+/* Bytecode is sequence of 4 byte commands followed by variable arguments.
+ * All the commands identified by "code" are conditional jumps forward:
+ * to offset cc+"yes" or to offset cc+"no". "yes" is supposed to be
+ * length of the command and its arguments.
+ */
+
+struct inet_diag_bc_op {
+ unsigned char code;
+ unsigned char yes;
+ unsigned short no;
+};
+
+enum {
+ INET_DIAG_BC_NOP,
+ INET_DIAG_BC_JMP,
+ INET_DIAG_BC_S_GE,
+ INET_DIAG_BC_S_LE,
+ INET_DIAG_BC_D_GE,
+ INET_DIAG_BC_D_LE,
+ INET_DIAG_BC_AUTO,
+ INET_DIAG_BC_S_COND,
+ INET_DIAG_BC_D_COND,
+};
+
+struct inet_diag_hostcond {
+ __u8 family;
+ __u8 prefix_len;
+ int port;
+ __be32 addr[0];
+};
+
+/* Base info structure. It contains socket identity (addrs/ports/cookie)
+ * and, alas, the information shown by netstat. */
+struct inet_diag_msg {
+ __u8 idiag_family;
+ __u8 idiag_state;
+ __u8 idiag_timer;
+ __u8 idiag_retrans;
+
+ struct inet_diag_sockid id;
+
+ __u32 idiag_expires;
+ __u32 idiag_rqueue;
+ __u32 idiag_wqueue;
+ __u32 idiag_uid;
+ __u32 idiag_inode;
+};
+
+/* Extensions */
+
+enum {
+ INET_DIAG_NONE,
+ INET_DIAG_MEMINFO,
+ INET_DIAG_INFO,
+ INET_DIAG_VEGASINFO,
+ INET_DIAG_CONG,
+};
+
+#define INET_DIAG_MAX INET_DIAG_CONG
+
+
+/* INET_DIAG_MEM */
+
+struct inet_diag_meminfo {
+ __u32 idiag_rmem;
+ __u32 idiag_wmem;
+ __u32 idiag_fmem;
+ __u32 idiag_tmem;
+};
+
+/* INET_DIAG_VEGASINFO */
+
+struct tcpvegas_info {
+ __u32 tcpv_enabled;
+ __u32 tcpv_rttcnt;
+ __u32 tcpv_rtt;
+ __u32 tcpv_minrtt;
+};
+
+
+#endif /* _INET_DIAG_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/inotify.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/inotify.h
new file mode 100644
index 0000000..8be5ac5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/inotify.h
@@ -0,0 +1,73 @@
+/*
+ * Inode based directory notification for Linux
+ *
+ * Copyright (C) 2005 John McCutchan
+ */
+
+#ifndef _LINUX_INOTIFY_H
+#define _LINUX_INOTIFY_H
+
+/* For O_CLOEXEC and O_NONBLOCK */
+#include <linux/fcntl.h>
+#include <linux/types.h>
+
+/*
+ * struct inotify_event - structure read from the inotify device for each event
+ *
+ * When you are watching a directory, you will receive the filename for events
+ * such as IN_CREATE, IN_DELETE, IN_OPEN, IN_CLOSE, ..., relative to the wd.
+ */
+struct inotify_event {
+ __s32 wd; /* watch descriptor */
+ __u32 mask; /* watch mask */
+ __u32 cookie; /* cookie to synchronize two events */
+ __u32 len; /* length (including nulls) of name */
+ char name[0]; /* stub for possible name */
+};
+
+/* the following are legal, implemented events that user-space can watch for */
+#define IN_ACCESS 0x00000001 /* File was accessed */
+#define IN_MODIFY 0x00000002 /* File was modified */
+#define IN_ATTRIB 0x00000004 /* Metadata changed */
+#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed */
+#define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */
+#define IN_OPEN 0x00000020 /* File was opened */
+#define IN_MOVED_FROM 0x00000040 /* File was moved from X */
+#define IN_MOVED_TO 0x00000080 /* File was moved to Y */
+#define IN_CREATE 0x00000100 /* Subfile was created */
+#define IN_DELETE 0x00000200 /* Subfile was deleted */
+#define IN_DELETE_SELF 0x00000400 /* Self was deleted */
+#define IN_MOVE_SELF 0x00000800 /* Self was moved */
+
+/* the following are legal events. they are sent as needed to any watch */
+#define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted */
+#define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */
+#define IN_IGNORED 0x00008000 /* File was ignored */
+
+/* helper events */
+#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* close */
+#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */
+
+/* special flags */
+#define IN_ONLYDIR 0x01000000 /* only watch the path if it is a directory */
+#define IN_DONT_FOLLOW 0x02000000 /* don't follow a sym link */
+#define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */
+#define IN_ISDIR 0x40000000 /* event occurred against dir */
+#define IN_ONESHOT 0x80000000 /* only send event once */
+
+/*
+ * All of the events - we build the list by hand so that we can add flags in
+ * the future and not break backward compatibility. Apps will get only the
+ * events that they originally wanted. Be sure to add new events here!
+ */
+#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \
+ IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \
+ IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \
+ IN_MOVE_SELF)
+
+/* Flags for sys_inotify_init1. */
+#define IN_CLOEXEC O_CLOEXEC
+#define IN_NONBLOCK O_NONBLOCK
+
+
+#endif /* _LINUX_INOTIFY_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/input.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/input.h
new file mode 100644
index 0000000..47406fb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/input.h
@@ -0,0 +1,982 @@
+#ifndef _INPUT_H
+#define _INPUT_H
+
+/*
+ * Copyright (c) 1999-2002 Vojtech Pavlik
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <linux/types.h>
+
+/*
+ * The event structure itself
+ */
+
+struct input_event {
+ struct timeval time;
+ __u16 type;
+ __u16 code;
+ __s32 value;
+};
+
+/*
+ * Protocol version.
+ */
+
+#define EV_VERSION 0x010000
+
+/*
+ * IOCTLs (0x00 - 0x7f)
+ */
+
+struct input_id {
+ __u16 bustype;
+ __u16 vendor;
+ __u16 product;
+ __u16 version;
+};
+
+struct input_absinfo {
+ __s32 value;
+ __s32 minimum;
+ __s32 maximum;
+ __s32 fuzz;
+ __s32 flat;
+};
+
+#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */
+#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */
+#define EVIOCGREP _IOR('E', 0x03, int[2]) /* get repeat settings */
+#define EVIOCSREP _IOW('E', 0x03, int[2]) /* set repeat settings */
+#define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */
+#define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */
+
+#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */
+#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */
+#define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */
+
+#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global keystate */
+#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */
+#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */
+#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */
+
+#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */
+#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */
+#define EVIOCSABS(abs) _IOW('E', 0xc0 + abs, struct input_absinfo) /* set abs value/limits */
+
+#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */
+#define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */
+#define EVIOCGEFFECTS _IOR('E', 0x84, int) /* Report number of effects playable at the same time */
+
+#define EVIOCGRAB _IOW('E', 0x90, int) /* Grab/Release device */
+
+/*
+ * Event types
+ */
+
+#define EV_SYN 0x00
+#define EV_KEY 0x01
+#define EV_REL 0x02
+#define EV_ABS 0x03
+#define EV_MSC 0x04
+#define EV_SW 0x05
+#define EV_LED 0x11
+#define EV_SND 0x12
+#define EV_REP 0x14
+#define EV_FF 0x15
+#define EV_PWR 0x16
+#define EV_FF_STATUS 0x17
+#define EV_MAX 0x1f
+#define EV_CNT (EV_MAX+1)
+
+/*
+ * Synchronization events.
+ */
+
+#define SYN_REPORT 0
+#define SYN_CONFIG 1
+#define SYN_MT_REPORT 2
+
+/*
+ * Keys and buttons
+ *
+ * Most of the keys/buttons are modeled after USB HUT 1.12
+ * (see http://www.usb.org/developers/hidpage).
+ * Abbreviations in the comments:
+ * AC - Application Control
+ * AL - Application Launch Button
+ * SC - System Control
+ */
+
+#define KEY_RESERVED 0
+#define KEY_ESC 1
+#define KEY_1 2
+#define KEY_2 3
+#define KEY_3 4
+#define KEY_4 5
+#define KEY_5 6
+#define KEY_6 7
+#define KEY_7 8
+#define KEY_8 9
+#define KEY_9 10
+#define KEY_0 11
+#define KEY_MINUS 12
+#define KEY_EQUAL 13
+#define KEY_BACKSPACE 14
+#define KEY_TAB 15
+#define KEY_Q 16
+#define KEY_W 17
+#define KEY_E 18
+#define KEY_R 19
+#define KEY_T 20
+#define KEY_Y 21
+#define KEY_U 22
+#define KEY_I 23
+#define KEY_O 24
+#define KEY_P 25
+#define KEY_LEFTBRACE 26
+#define KEY_RIGHTBRACE 27
+#define KEY_ENTER 28
+#define KEY_LEFTCTRL 29
+#define KEY_A 30
+#define KEY_S 31
+#define KEY_D 32
+#define KEY_F 33
+#define KEY_G 34
+#define KEY_H 35
+#define KEY_J 36
+#define KEY_K 37
+#define KEY_L 38
+#define KEY_SEMICOLON 39
+#define KEY_APOSTROPHE 40
+#define KEY_GRAVE 41
+#define KEY_LEFTSHIFT 42
+#define KEY_BACKSLASH 43
+#define KEY_Z 44
+#define KEY_X 45
+#define KEY_C 46
+#define KEY_V 47
+#define KEY_B 48
+#define KEY_N 49
+#define KEY_M 50
+#define KEY_COMMA 51
+#define KEY_DOT 52
+#define KEY_SLASH 53
+#define KEY_RIGHTSHIFT 54
+#define KEY_KPASTERISK 55
+#define KEY_LEFTALT 56
+#define KEY_SPACE 57
+#define KEY_CAPSLOCK 58
+#define KEY_F1 59
+#define KEY_F2 60
+#define KEY_F3 61
+#define KEY_F4 62
+#define KEY_F5 63
+#define KEY_F6 64
+#define KEY_F7 65
+#define KEY_F8 66
+#define KEY_F9 67
+#define KEY_F10 68
+#define KEY_NUMLOCK 69
+#define KEY_SCROLLLOCK 70
+#define KEY_KP7 71
+#define KEY_KP8 72
+#define KEY_KP9 73
+#define KEY_KPMINUS 74
+#define KEY_KP4 75
+#define KEY_KP5 76
+#define KEY_KP6 77
+#define KEY_KPPLUS 78
+#define KEY_KP1 79
+#define KEY_KP2 80
+#define KEY_KP3 81
+#define KEY_KP0 82
+#define KEY_KPDOT 83
+
+#define KEY_ZENKAKUHANKAKU 85
+#define KEY_102ND 86
+#define KEY_F11 87
+#define KEY_F12 88
+#define KEY_RO 89
+#define KEY_KATAKANA 90
+#define KEY_HIRAGANA 91
+#define KEY_HENKAN 92
+#define KEY_KATAKANAHIRAGANA 93
+#define KEY_MUHENKAN 94
+#define KEY_KPJPCOMMA 95
+#define KEY_KPENTER 96
+#define KEY_RIGHTCTRL 97
+#define KEY_KPSLASH 98
+#define KEY_SYSRQ 99
+#define KEY_RIGHTALT 100
+#define KEY_LINEFEED 101
+#define KEY_HOME 102
+#define KEY_UP 103
+#define KEY_PAGEUP 104
+#define KEY_LEFT 105
+#define KEY_RIGHT 106
+#define KEY_END 107
+#define KEY_DOWN 108
+#define KEY_PAGEDOWN 109
+#define KEY_INSERT 110
+#define KEY_DELETE 111
+#define KEY_MACRO 112
+#define KEY_MUTE 113
+#define KEY_VOLUMEDOWN 114
+#define KEY_VOLUMEUP 115
+#define KEY_POWER 116 /* SC System Power Down */
+#define KEY_KPEQUAL 117
+#define KEY_KPPLUSMINUS 118
+#define KEY_PAUSE 119
+#define KEY_SCALE 120 /* AL Compiz Scale (Expose) */
+
+#define KEY_KPCOMMA 121
+#define KEY_HANGEUL 122
+#define KEY_HANGUEL KEY_HANGEUL
+#define KEY_HANJA 123
+#define KEY_YEN 124
+#define KEY_LEFTMETA 125
+#define KEY_RIGHTMETA 126
+#define KEY_COMPOSE 127
+
+#define KEY_STOP 128 /* AC Stop */
+#define KEY_AGAIN 129
+#define KEY_PROPS 130 /* AC Properties */
+#define KEY_UNDO 131 /* AC Undo */
+#define KEY_FRONT 132
+#define KEY_COPY 133 /* AC Copy */
+#define KEY_OPEN 134 /* AC Open */
+#define KEY_PASTE 135 /* AC Paste */
+#define KEY_FIND 136 /* AC Search */
+#define KEY_CUT 137 /* AC Cut */
+#define KEY_HELP 138 /* AL Integrated Help Center */
+#define KEY_MENU 139 /* Menu (show menu) */
+#define KEY_CALC 140 /* AL Calculator */
+#define KEY_SETUP 141
+#define KEY_SLEEP 142 /* SC System Sleep */
+#define KEY_WAKEUP 143 /* System Wake Up */
+#define KEY_FILE 144 /* AL Local Machine Browser */
+#define KEY_SENDFILE 145
+#define KEY_DELETEFILE 146
+#define KEY_XFER 147
+#define KEY_PROG1 148
+#define KEY_PROG2 149
+#define KEY_WWW 150 /* AL Internet Browser */
+#define KEY_MSDOS 151
+#define KEY_COFFEE 152 /* AL Terminal Lock/Screensaver */
+#define KEY_SCREENLOCK KEY_COFFEE
+#define KEY_DIRECTION 153
+#define KEY_CYCLEWINDOWS 154
+#define KEY_MAIL 155
+#define KEY_BOOKMARKS 156 /* AC Bookmarks */
+#define KEY_COMPUTER 157
+#define KEY_BACK 158 /* AC Back */
+#define KEY_FORWARD 159 /* AC Forward */
+#define KEY_CLOSECD 160
+#define KEY_EJECTCD 161
+#define KEY_EJECTCLOSECD 162
+#define KEY_NEXTSONG 163
+#define KEY_PLAYPAUSE 164
+#define KEY_PREVIOUSSONG 165
+#define KEY_STOPCD 166
+#define KEY_RECORD 167
+#define KEY_REWIND 168
+#define KEY_PHONE 169 /* Media Select Telephone */
+#define KEY_ISO 170
+#define KEY_CONFIG 171 /* AL Consumer Control Configuration */
+#define KEY_HOMEPAGE 172 /* AC Home */
+#define KEY_REFRESH 173 /* AC Refresh */
+#define KEY_EXIT 174 /* AC Exit */
+#define KEY_MOVE 175
+#define KEY_EDIT 176
+#define KEY_SCROLLUP 177
+#define KEY_SCROLLDOWN 178
+#define KEY_KPLEFTPAREN 179
+#define KEY_KPRIGHTPAREN 180
+#define KEY_NEW 181 /* AC New */
+#define KEY_REDO 182 /* AC Redo/Repeat */
+
+#define KEY_F13 183
+#define KEY_F14 184
+#define KEY_F15 185
+#define KEY_F16 186
+#define KEY_F17 187
+#define KEY_F18 188
+#define KEY_F19 189
+#define KEY_F20 190
+#define KEY_F21 191
+#define KEY_F22 192
+#define KEY_F23 193
+#define KEY_F24 194
+
+#define KEY_PLAYCD 200
+#define KEY_PAUSECD 201
+#define KEY_PROG3 202
+#define KEY_PROG4 203
+#define KEY_DASHBOARD 204 /* AL Dashboard */
+#define KEY_SUSPEND 205
+#define KEY_CLOSE 206 /* AC Close */
+#define KEY_PLAY 207
+#define KEY_FASTFORWARD 208
+#define KEY_BASSBOOST 209
+#define KEY_PRINT 210 /* AC Print */
+#define KEY_HP 211
+#define KEY_CAMERA 212
+#define KEY_SOUND 213
+#define KEY_QUESTION 214
+#define KEY_EMAIL 215
+#define KEY_CHAT 216
+#define KEY_SEARCH 217
+#define KEY_CONNECT 218
+#define KEY_FINANCE 219 /* AL Checkbook/Finance */
+#define KEY_SPORT 220
+#define KEY_SHOP 221
+#define KEY_ALTERASE 222
+#define KEY_CANCEL 223 /* AC Cancel */
+#define KEY_BRIGHTNESSDOWN 224
+#define KEY_BRIGHTNESSUP 225
+#define KEY_MEDIA 226
+
+#define KEY_SWITCHVIDEOMODE 227 /* Cycle between available video
+ outputs (Monitor/LCD/TV-out/etc) */
+#define KEY_KBDILLUMTOGGLE 228
+#define KEY_KBDILLUMDOWN 229
+#define KEY_KBDILLUMUP 230
+
+#define KEY_SEND 231 /* AC Send */
+#define KEY_REPLY 232 /* AC Reply */
+#define KEY_FORWARDMAIL 233 /* AC Forward Msg */
+#define KEY_SAVE 234 /* AC Save */
+#define KEY_DOCUMENTS 235
+
+#define KEY_BATTERY 236
+
+#define KEY_BLUETOOTH 237
+#define KEY_WLAN 238
+#define KEY_UWB 239
+
+#define KEY_UNKNOWN 240
+
+#define KEY_VIDEO_NEXT 241 /* drive next video source */
+#define KEY_VIDEO_PREV 242 /* drive previous video source */
+#define KEY_BRIGHTNESS_CYCLE 243 /* brightness up, after max is min */
+#define KEY_BRIGHTNESS_ZERO 244 /* brightness off, use ambient */
+#define KEY_DISPLAY_OFF 245 /* display device to off state */
+
+#define KEY_WIMAX 246
+
+/* Range 248 - 255 is reserved for special needs of AT keyboard driver */
+
+#define BTN_MISC 0x100
+#define BTN_0 0x100
+#define BTN_1 0x101
+#define BTN_2 0x102
+#define BTN_3 0x103
+#define BTN_4 0x104
+#define BTN_5 0x105
+#define BTN_6 0x106
+#define BTN_7 0x107
+#define BTN_8 0x108
+#define BTN_9 0x109
+
+#define BTN_MOUSE 0x110
+#define BTN_LEFT 0x110
+#define BTN_RIGHT 0x111
+#define BTN_MIDDLE 0x112
+#define BTN_SIDE 0x113
+#define BTN_EXTRA 0x114
+#define BTN_FORWARD 0x115
+#define BTN_BACK 0x116
+#define BTN_TASK 0x117
+
+#define BTN_JOYSTICK 0x120
+#define BTN_TRIGGER 0x120
+#define BTN_THUMB 0x121
+#define BTN_THUMB2 0x122
+#define BTN_TOP 0x123
+#define BTN_TOP2 0x124
+#define BTN_PINKIE 0x125
+#define BTN_BASE 0x126
+#define BTN_BASE2 0x127
+#define BTN_BASE3 0x128
+#define BTN_BASE4 0x129
+#define BTN_BASE5 0x12a
+#define BTN_BASE6 0x12b
+#define BTN_DEAD 0x12f
+
+#define BTN_GAMEPAD 0x130
+#define BTN_A 0x130
+#define BTN_B 0x131
+#define BTN_C 0x132
+#define BTN_X 0x133
+#define BTN_Y 0x134
+#define BTN_Z 0x135
+#define BTN_TL 0x136
+#define BTN_TR 0x137
+#define BTN_TL2 0x138
+#define BTN_TR2 0x139
+#define BTN_SELECT 0x13a
+#define BTN_START 0x13b
+#define BTN_MODE 0x13c
+#define BTN_THUMBL 0x13d
+#define BTN_THUMBR 0x13e
+
+#define BTN_DIGI 0x140
+#define BTN_TOOL_PEN 0x140
+#define BTN_TOOL_RUBBER 0x141
+#define BTN_TOOL_BRUSH 0x142
+#define BTN_TOOL_PENCIL 0x143
+#define BTN_TOOL_AIRBRUSH 0x144
+#define BTN_TOOL_FINGER 0x145
+#define BTN_TOOL_MOUSE 0x146
+#define BTN_TOOL_LENS 0x147
+#define BTN_TOUCH 0x14a
+#define BTN_STYLUS 0x14b
+#define BTN_STYLUS2 0x14c
+#define BTN_TOOL_DOUBLETAP 0x14d
+#define BTN_TOOL_TRIPLETAP 0x14e
+#define BTN_TOOL_QUADTAP 0x14f /* Four fingers on trackpad */
+
+#define BTN_WHEEL 0x150
+#define BTN_GEAR_DOWN 0x150
+#define BTN_GEAR_UP 0x151
+
+#define KEY_OK 0x160
+#define KEY_SELECT 0x161
+#define KEY_GOTO 0x162
+#define KEY_CLEAR 0x163
+#define KEY_POWER2 0x164
+#define KEY_OPTION 0x165
+#define KEY_INFO 0x166 /* AL OEM Features/Tips/Tutorial */
+#define KEY_TIME 0x167
+#define KEY_VENDOR 0x168
+#define KEY_ARCHIVE 0x169
+#define KEY_PROGRAM 0x16a /* Media Select Program Guide */
+#define KEY_CHANNEL 0x16b
+#define KEY_FAVORITES 0x16c
+#define KEY_EPG 0x16d
+#define KEY_PVR 0x16e /* Media Select Home */
+#define KEY_MHP 0x16f
+#define KEY_LANGUAGE 0x170
+#define KEY_TITLE 0x171
+#define KEY_SUBTITLE 0x172
+#define KEY_ANGLE 0x173
+#define KEY_ZOOM 0x174
+#define KEY_MODE 0x175
+#define KEY_KEYBOARD 0x176
+#define KEY_SCREEN 0x177
+#define KEY_PC 0x178 /* Media Select Computer */
+#define KEY_TV 0x179 /* Media Select TV */
+#define KEY_TV2 0x17a /* Media Select Cable */
+#define KEY_VCR 0x17b /* Media Select VCR */
+#define KEY_VCR2 0x17c /* VCR Plus */
+#define KEY_SAT 0x17d /* Media Select Satellite */
+#define KEY_SAT2 0x17e
+#define KEY_CD 0x17f /* Media Select CD */
+#define KEY_TAPE 0x180 /* Media Select Tape */
+#define KEY_RADIO 0x181
+#define KEY_TUNER 0x182 /* Media Select Tuner */
+#define KEY_PLAYER 0x183
+#define KEY_TEXT 0x184
+#define KEY_DVD 0x185 /* Media Select DVD */
+#define KEY_AUX 0x186
+#define KEY_MP3 0x187
+#define KEY_AUDIO 0x188
+#define KEY_VIDEO 0x189
+#define KEY_DIRECTORY 0x18a
+#define KEY_LIST 0x18b
+#define KEY_MEMO 0x18c /* Media Select Messages */
+#define KEY_CALENDAR 0x18d
+#define KEY_RED 0x18e
+#define KEY_GREEN 0x18f
+#define KEY_YELLOW 0x190
+#define KEY_BLUE 0x191
+#define KEY_CHANNELUP 0x192 /* Channel Increment */
+#define KEY_CHANNELDOWN 0x193 /* Channel Decrement */
+#define KEY_FIRST 0x194
+#define KEY_LAST 0x195 /* Recall Last */
+#define KEY_AB 0x196
+#define KEY_NEXT 0x197
+#define KEY_RESTART 0x198
+#define KEY_SLOW 0x199
+#define KEY_SHUFFLE 0x19a
+#define KEY_BREAK 0x19b
+#define KEY_PREVIOUS 0x19c
+#define KEY_DIGITS 0x19d
+#define KEY_TEEN 0x19e
+#define KEY_TWEN 0x19f
+#define KEY_VIDEOPHONE 0x1a0 /* Media Select Video Phone */
+#define KEY_GAMES 0x1a1 /* Media Select Games */
+#define KEY_ZOOMIN 0x1a2 /* AC Zoom In */
+#define KEY_ZOOMOUT 0x1a3 /* AC Zoom Out */
+#define KEY_ZOOMRESET 0x1a4 /* AC Zoom */
+#define KEY_WORDPROCESSOR 0x1a5 /* AL Word Processor */
+#define KEY_EDITOR 0x1a6 /* AL Text Editor */
+#define KEY_SPREADSHEET 0x1a7 /* AL Spreadsheet */
+#define KEY_GRAPHICSEDITOR 0x1a8 /* AL Graphics Editor */
+#define KEY_PRESENTATION 0x1a9 /* AL Presentation App */
+#define KEY_DATABASE 0x1aa /* AL Database App */
+#define KEY_NEWS 0x1ab /* AL Newsreader */
+#define KEY_VOICEMAIL 0x1ac /* AL Voicemail */
+#define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */
+#define KEY_MESSENGER 0x1ae /* AL Instant Messaging */
+#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */
+#define KEY_SPELLCHECK 0x1b0 /* AL Spell Check */
+#define KEY_LOGOFF 0x1b1 /* AL Logoff */
+
+#define KEY_DOLLAR 0x1b2
+#define KEY_EURO 0x1b3
+
+#define KEY_FRAMEBACK 0x1b4 /* Consumer - transport controls */
+#define KEY_FRAMEFORWARD 0x1b5
+#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */
+#define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */
+
+#define KEY_DEL_EOL 0x1c0
+#define KEY_DEL_EOS 0x1c1
+#define KEY_INS_LINE 0x1c2
+#define KEY_DEL_LINE 0x1c3
+
+#define KEY_FN 0x1d0
+#define KEY_FN_ESC 0x1d1
+#define KEY_FN_F1 0x1d2
+#define KEY_FN_F2 0x1d3
+#define KEY_FN_F3 0x1d4
+#define KEY_FN_F4 0x1d5
+#define KEY_FN_F5 0x1d6
+#define KEY_FN_F6 0x1d7
+#define KEY_FN_F7 0x1d8
+#define KEY_FN_F8 0x1d9
+#define KEY_FN_F9 0x1da
+#define KEY_FN_F10 0x1db
+#define KEY_FN_F11 0x1dc
+#define KEY_FN_F12 0x1dd
+#define KEY_FN_1 0x1de
+#define KEY_FN_2 0x1df
+#define KEY_FN_D 0x1e0
+#define KEY_FN_E 0x1e1
+#define KEY_FN_F 0x1e2
+#define KEY_FN_S 0x1e3
+#define KEY_FN_B 0x1e4
+
+#define KEY_BRL_DOT1 0x1f1
+#define KEY_BRL_DOT2 0x1f2
+#define KEY_BRL_DOT3 0x1f3
+#define KEY_BRL_DOT4 0x1f4
+#define KEY_BRL_DOT5 0x1f5
+#define KEY_BRL_DOT6 0x1f6
+#define KEY_BRL_DOT7 0x1f7
+#define KEY_BRL_DOT8 0x1f8
+#define KEY_BRL_DOT9 0x1f9
+#define KEY_BRL_DOT10 0x1fa
+
+#define KEY_NUMERIC_0 0x200 /* used by phones, remote controls, */
+#define KEY_NUMERIC_1 0x201 /* and other keypads */
+#define KEY_NUMERIC_2 0x202
+#define KEY_NUMERIC_3 0x203
+#define KEY_NUMERIC_4 0x204
+#define KEY_NUMERIC_5 0x205
+#define KEY_NUMERIC_6 0x206
+#define KEY_NUMERIC_7 0x207
+#define KEY_NUMERIC_8 0x208
+#define KEY_NUMERIC_9 0x209
+#define KEY_NUMERIC_STAR 0x20a
+#define KEY_NUMERIC_POUND 0x20b
+
+/* We avoid low common keys in module aliases so they don't get huge. */
+#define KEY_MIN_INTERESTING KEY_MUTE
+#define KEY_MAX 0x2ff
+#define KEY_CNT (KEY_MAX+1)
+
+/*
+ * Relative axes
+ */
+
+#define REL_X 0x00
+#define REL_Y 0x01
+#define REL_Z 0x02
+#define REL_RX 0x03
+#define REL_RY 0x04
+#define REL_RZ 0x05
+#define REL_HWHEEL 0x06
+#define REL_DIAL 0x07
+#define REL_WHEEL 0x08
+#define REL_MISC 0x09
+#define REL_MAX 0x0f
+#define REL_CNT (REL_MAX+1)
+
+/*
+ * Absolute axes
+ */
+
+#define ABS_X 0x00
+#define ABS_Y 0x01
+#define ABS_Z 0x02
+#define ABS_RX 0x03
+#define ABS_RY 0x04
+#define ABS_RZ 0x05
+#define ABS_THROTTLE 0x06
+#define ABS_RUDDER 0x07
+#define ABS_WHEEL 0x08
+#define ABS_GAS 0x09
+#define ABS_BRAKE 0x0a
+#define ABS_HAT0X 0x10
+#define ABS_HAT0Y 0x11
+#define ABS_HAT1X 0x12
+#define ABS_HAT1Y 0x13
+#define ABS_HAT2X 0x14
+#define ABS_HAT2Y 0x15
+#define ABS_HAT3X 0x16
+#define ABS_HAT3Y 0x17
+#define ABS_PRESSURE 0x18
+#define ABS_DISTANCE 0x19
+#define ABS_TILT_X 0x1a
+#define ABS_TILT_Y 0x1b
+#define ABS_TOOL_WIDTH 0x1c
+#define ABS_VOLUME 0x20
+#define ABS_MISC 0x28
+
+#define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse */
+#define ABS_MT_TOUCH_MINOR 0x31 /* Minor axis (omit if circular) */
+#define ABS_MT_WIDTH_MAJOR 0x32 /* Major axis of approaching ellipse */
+#define ABS_MT_WIDTH_MINOR 0x33 /* Minor axis (omit if circular) */
+#define ABS_MT_ORIENTATION 0x34 /* Ellipse orientation */
+#define ABS_MT_POSITION_X 0x35 /* Center X ellipse position */
+#define ABS_MT_POSITION_Y 0x36 /* Center Y ellipse position */
+#define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */
+#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */
+#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */
+
+#define ABS_MAX 0x3f
+#define ABS_CNT (ABS_MAX+1)
+
+/*
+ * Switch events
+ */
+
+#define SW_LID 0x00 /* set = lid shut */
+#define SW_TABLET_MODE 0x01 /* set = tablet mode */
+#define SW_HEADPHONE_INSERT 0x02 /* set = inserted */
+#define SW_RFKILL_ALL 0x03 /* rfkill master switch, type "any"
+ set = radio enabled */
+#define SW_RADIO SW_RFKILL_ALL /* deprecated */
+#define SW_MICROPHONE_INSERT 0x04 /* set = inserted */
+#define SW_DOCK 0x05 /* set = plugged into dock */
+#define SW_LINEOUT_INSERT 0x06 /* set = inserted */
+#define SW_JACK_PHYSICAL_INSERT 0x07 /* set = mechanical switch set */
+#define SW_VIDEOOUT_INSERT 0x08 /* set = inserted */
+#define SW_MAX 0x0f
+#define SW_CNT (SW_MAX+1)
+
+/*
+ * Misc events
+ */
+
+#define MSC_SERIAL 0x00
+#define MSC_PULSELED 0x01
+#define MSC_GESTURE 0x02
+#define MSC_RAW 0x03
+#define MSC_SCAN 0x04
+#define MSC_MAX 0x07
+#define MSC_CNT (MSC_MAX+1)
+
+/*
+ * LEDs
+ */
+
+#define LED_NUML 0x00
+#define LED_CAPSL 0x01
+#define LED_SCROLLL 0x02
+#define LED_COMPOSE 0x03
+#define LED_KANA 0x04
+#define LED_SLEEP 0x05
+#define LED_SUSPEND 0x06
+#define LED_MUTE 0x07
+#define LED_MISC 0x08
+#define LED_MAIL 0x09
+#define LED_CHARGING 0x0a
+#define LED_MAX 0x0f
+#define LED_CNT (LED_MAX+1)
+
+/*
+ * Autorepeat values
+ */
+
+#define REP_DELAY 0x00
+#define REP_PERIOD 0x01
+#define REP_MAX 0x01
+
+/*
+ * Sounds
+ */
+
+#define SND_CLICK 0x00
+#define SND_BELL 0x01
+#define SND_TONE 0x02
+#define SND_MAX 0x07
+#define SND_CNT (SND_MAX+1)
+
+/*
+ * IDs.
+ */
+
+#define ID_BUS 0
+#define ID_VENDOR 1
+#define ID_PRODUCT 2
+#define ID_VERSION 3
+
+#define BUS_PCI 0x01
+#define BUS_ISAPNP 0x02
+#define BUS_USB 0x03
+#define BUS_HIL 0x04
+#define BUS_BLUETOOTH 0x05
+#define BUS_VIRTUAL 0x06
+
+#define BUS_ISA 0x10
+#define BUS_I8042 0x11
+#define BUS_XTKBD 0x12
+#define BUS_RS232 0x13
+#define BUS_GAMEPORT 0x14
+#define BUS_PARPORT 0x15
+#define BUS_AMIGA 0x16
+#define BUS_ADB 0x17
+#define BUS_I2C 0x18
+#define BUS_HOST 0x19
+#define BUS_GSC 0x1A
+#define BUS_ATARI 0x1B
+
+/*
+ * MT_TOOL types
+ */
+#define MT_TOOL_FINGER 0
+#define MT_TOOL_PEN 1
+
+/*
+ * Values describing the status of a force-feedback effect
+ */
+#define FF_STATUS_STOPPED 0x00
+#define FF_STATUS_PLAYING 0x01
+#define FF_STATUS_MAX 0x01
+
+/*
+ * Structures used in ioctls to upload effects to a device
+ * They are pieces of a bigger structure (called ff_effect)
+ */
+
+/*
+ * All duration values are expressed in ms. Values above 32767 ms (0x7fff)
+ * should not be used and have unspecified results.
+ */
+
+/**
+ * struct ff_replay - defines scheduling of the force-feedback effect
+ * @length: duration of the effect
+ * @delay: delay before effect should start playing
+ */
+struct ff_replay {
+ __u16 length;
+ __u16 delay;
+};
+
+/**
+ * struct ff_trigger - defines what triggers the force-feedback effect
+ * @button: number of the button triggering the effect
+ * @interval: controls how soon the effect can be re-triggered
+ */
+struct ff_trigger {
+ __u16 button;
+ __u16 interval;
+};
+
+/**
+ * struct ff_envelope - generic force-feedback effect envelope
+ * @attack_length: duration of the attack (ms)
+ * @attack_level: level at the beginning of the attack
+ * @fade_length: duration of fade (ms)
+ * @fade_level: level at the end of fade
+ *
+ * The @attack_level and @fade_level are absolute values; when applying
+ * envelope force-feedback core will convert to positive/negative
+ * value based on polarity of the default level of the effect.
+ * Valid range for the attack and fade levels is 0x0000 - 0x7fff
+ */
+struct ff_envelope {
+ __u16 attack_length;
+ __u16 attack_level;
+ __u16 fade_length;
+ __u16 fade_level;
+};
+
+/**
+ * struct ff_constant_effect - defines parameters of a constant force-feedback effect
+ * @level: strength of the effect; may be negative
+ * @envelope: envelope data
+ */
+struct ff_constant_effect {
+ __s16 level;
+ struct ff_envelope envelope;
+};
+
+/**
+ * struct ff_ramp_effect - defines parameters of a ramp force-feedback effect
+ * @start_level: beginning strength of the effect; may be negative
+ * @end_level: final strength of the effect; may be negative
+ * @envelope: envelope data
+ */
+struct ff_ramp_effect {
+ __s16 start_level;
+ __s16 end_level;
+ struct ff_envelope envelope;
+};
+
+/**
+ * struct ff_condition_effect - defines a spring or friction force-feedback effect
+ * @right_saturation: maximum level when joystick moved all way to the right
+ * @left_saturation: same for the left side
+ * @right_coeff: controls how fast the force grows when the joystick moves
+ * to the right
+ * @left_coeff: same for the left side
+ * @deadband: size of the dead zone, where no force is produced
+ * @center: position of the dead zone
+ */
+struct ff_condition_effect {
+ __u16 right_saturation;
+ __u16 left_saturation;
+
+ __s16 right_coeff;
+ __s16 left_coeff;
+
+ __u16 deadband;
+ __s16 center;
+};
+
+/**
+ * struct ff_periodic_effect - defines parameters of a periodic force-feedback effect
+ * @waveform: kind of the effect (wave)
+ * @period: period of the wave (ms)
+ * @magnitude: peak value
+ * @offset: mean value of the wave (roughly)
+ * @phase: 'horizontal' shift
+ * @envelope: envelope data
+ * @custom_len: number of samples (FF_CUSTOM only)
+ * @custom_data: buffer of samples (FF_CUSTOM only)
+ *
+ * Known waveforms - FF_SQUARE, FF_TRIANGLE, FF_SINE, FF_SAW_UP,
+ * FF_SAW_DOWN, FF_CUSTOM. The exact syntax FF_CUSTOM is undefined
+ * for the time being as no driver supports it yet.
+ *
+ * Note: the data pointed by custom_data is copied by the driver.
+ * You can therefore dispose of the memory after the upload/update.
+ */
+struct ff_periodic_effect {
+ __u16 waveform;
+ __u16 period;
+ __s16 magnitude;
+ __s16 offset;
+ __u16 phase;
+
+ struct ff_envelope envelope;
+
+ __u32 custom_len;
+ __s16 *custom_data;
+};
+
+/**
+ * struct ff_rumble_effect - defines parameters of a periodic force-feedback effect
+ * @strong_magnitude: magnitude of the heavy motor
+ * @weak_magnitude: magnitude of the light one
+ *
+ * Some rumble pads have two motors of different weight. Strong_magnitude
+ * represents the magnitude of the vibration generated by the heavy one.
+ */
+struct ff_rumble_effect {
+ __u16 strong_magnitude;
+ __u16 weak_magnitude;
+};
+
+/**
+ * struct ff_effect - defines force feedback effect
+ * @type: type of the effect (FF_CONSTANT, FF_PERIODIC, FF_RAMP, FF_SPRING,
+ * FF_FRICTION, FF_DAMPER, FF_RUMBLE, FF_INERTIA, or FF_CUSTOM)
+ * @id: an unique id assigned to an effect
+ * @direction: direction of the effect
+ * @trigger: trigger conditions (struct ff_trigger)
+ * @replay: scheduling of the effect (struct ff_replay)
+ * @u: effect-specific structure (one of ff_constant_effect, ff_ramp_effect,
+ * ff_periodic_effect, ff_condition_effect, ff_rumble_effect) further
+ * defining effect parameters
+ *
+ * This structure is sent through ioctl from the application to the driver.
+ * To create a new effect application should set its @id to -1; the kernel
+ * will return assigned @id which can later be used to update or delete
+ * this effect.
+ *
+ * Direction of the effect is encoded as follows:
+ * 0 deg -> 0x0000 (down)
+ * 90 deg -> 0x4000 (left)
+ * 180 deg -> 0x8000 (up)
+ * 270 deg -> 0xC000 (right)
+ */
+struct ff_effect {
+ __u16 type;
+ __s16 id;
+ __u16 direction;
+ struct ff_trigger trigger;
+ struct ff_replay replay;
+
+ union {
+ struct ff_constant_effect constant;
+ struct ff_ramp_effect ramp;
+ struct ff_periodic_effect periodic;
+ struct ff_condition_effect condition[2]; /* One for each axis */
+ struct ff_rumble_effect rumble;
+ } u;
+};
+
+/*
+ * Force feedback effect types
+ */
+
+#define FF_RUMBLE 0x50
+#define FF_PERIODIC 0x51
+#define FF_CONSTANT 0x52
+#define FF_SPRING 0x53
+#define FF_FRICTION 0x54
+#define FF_DAMPER 0x55
+#define FF_INERTIA 0x56
+#define FF_RAMP 0x57
+
+#define FF_EFFECT_MIN FF_RUMBLE
+#define FF_EFFECT_MAX FF_RAMP
+
+/*
+ * Force feedback periodic effect types
+ */
+
+#define FF_SQUARE 0x58
+#define FF_TRIANGLE 0x59
+#define FF_SINE 0x5a
+#define FF_SAW_UP 0x5b
+#define FF_SAW_DOWN 0x5c
+#define FF_CUSTOM 0x5d
+
+#define FF_WAVEFORM_MIN FF_SQUARE
+#define FF_WAVEFORM_MAX FF_CUSTOM
+
+/*
+ * Set ff device properties
+ */
+
+#define FF_GAIN 0x60
+#define FF_AUTOCENTER 0x61
+
+#define FF_MAX 0x7f
+#define FF_CNT (FF_MAX+1)
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ioctl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ioctl.h
new file mode 100644
index 0000000..aa91eb3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ioctl.h
@@ -0,0 +1,7 @@
+#ifndef _LINUX_IOCTL_H
+#define _LINUX_IOCTL_H
+
+#include <asm/ioctl.h>
+
+#endif /* _LINUX_IOCTL_H */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ip.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ip.h
new file mode 100644
index 0000000..56f472a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ip.h
@@ -0,0 +1,136 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Definitions for the IP protocol.
+ *
+ * Version: @(#)ip.h 1.0.2 04/28/93
+ *
+ * Authors: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_IP_H
+#define _LINUX_IP_H
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+#define IPTOS_TOS_MASK 0x1E
+#define IPTOS_TOS(tos) ((tos)&IPTOS_TOS_MASK)
+#define IPTOS_LOWDELAY 0x10
+#define IPTOS_THROUGHPUT 0x08
+#define IPTOS_RELIABILITY 0x04
+#define IPTOS_MINCOST 0x02
+
+#define IPTOS_PREC_MASK 0xE0
+#define IPTOS_PREC(tos) ((tos)&IPTOS_PREC_MASK)
+#define IPTOS_PREC_NETCONTROL 0xe0
+#define IPTOS_PREC_INTERNETCONTROL 0xc0
+#define IPTOS_PREC_CRITIC_ECP 0xa0
+#define IPTOS_PREC_FLASHOVERRIDE 0x80
+#define IPTOS_PREC_FLASH 0x60
+#define IPTOS_PREC_IMMEDIATE 0x40
+#define IPTOS_PREC_PRIORITY 0x20
+#define IPTOS_PREC_ROUTINE 0x00
+
+
+/* IP options */
+#define IPOPT_COPY 0x80
+#define IPOPT_CLASS_MASK 0x60
+#define IPOPT_NUMBER_MASK 0x1f
+
+#define IPOPT_COPIED(o) ((o)&IPOPT_COPY)
+#define IPOPT_CLASS(o) ((o)&IPOPT_CLASS_MASK)
+#define IPOPT_NUMBER(o) ((o)&IPOPT_NUMBER_MASK)
+
+#define IPOPT_CONTROL 0x00
+#define IPOPT_RESERVED1 0x20
+#define IPOPT_MEASUREMENT 0x40
+#define IPOPT_RESERVED2 0x60
+
+#define IPOPT_END (0 |IPOPT_CONTROL)
+#define IPOPT_NOOP (1 |IPOPT_CONTROL)
+#define IPOPT_SEC (2 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_LSRR (3 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_TIMESTAMP (4 |IPOPT_MEASUREMENT)
+#define IPOPT_CIPSO (6 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_RR (7 |IPOPT_CONTROL)
+#define IPOPT_SID (8 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_SSRR (9 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_RA (20|IPOPT_CONTROL|IPOPT_COPY)
+
+#define IPVERSION 4
+#define MAXTTL 255
+#define IPDEFTTL 64
+
+#define IPOPT_OPTVAL 0
+#define IPOPT_OLEN 1
+#define IPOPT_OFFSET 2
+#define IPOPT_MINOFF 4
+#define MAX_IPOPTLEN 40
+#define IPOPT_NOP IPOPT_NOOP
+#define IPOPT_EOL IPOPT_END
+#define IPOPT_TS IPOPT_TIMESTAMP
+
+#define IPOPT_TS_TSONLY 0 /* timestamps only */
+#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
+#define IPOPT_TS_PRESPEC 3 /* specified modules only */
+
+#define IPV4_BEET_PHMAXLEN 8
+
+struct iphdr {
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 ihl:4,
+ version:4;
+#elif defined (__BIG_ENDIAN_BITFIELD)
+ __u8 version:4,
+ ihl:4;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+ __u8 tos;
+ __be16 tot_len;
+ __be16 id;
+ __be16 frag_off;
+ __u8 ttl;
+ __u8 protocol;
+ __sum16 check;
+ __be32 saddr;
+ __be32 daddr;
+ /*The options start here. */
+};
+
+
+struct ip_auth_hdr {
+ __u8 nexthdr;
+ __u8 hdrlen; /* This one is measured in 32 bit units! */
+ __be16 reserved;
+ __be32 spi;
+ __be32 seq_no; /* Sequence number */
+ __u8 auth_data[0]; /* Variable len but >=4. Mind the 64 bit alignment! */
+};
+
+struct ip_esp_hdr {
+ __be32 spi;
+ __be32 seq_no; /* Sequence number */
+ __u8 enc_data[0]; /* Variable len but >=8. Mind the 64 bit alignment! */
+};
+
+struct ip_comp_hdr {
+ __u8 nexthdr;
+ __u8 flags;
+ __be16 cpi;
+};
+
+struct ip_beet_phdr {
+ __u8 nexthdr;
+ __u8 hdrlen;
+ __u8 padlen;
+ __u8 reserved;
+};
+
+#endif /* _LINUX_IP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ip6_tunnel.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ip6_tunnel.h
new file mode 100644
index 0000000..acb9ad6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ip6_tunnel.h
@@ -0,0 +1,32 @@
+#ifndef _IP6_TUNNEL_H
+#define _IP6_TUNNEL_H
+
+#include <linux/types.h>
+
+#define IPV6_TLV_TNL_ENCAP_LIMIT 4
+#define IPV6_DEFAULT_TNL_ENCAP_LIMIT 4
+
+/* don't add encapsulation limit if one isn't present in inner packet */
+#define IP6_TNL_F_IGN_ENCAP_LIMIT 0x1
+/* copy the traffic class field from the inner packet */
+#define IP6_TNL_F_USE_ORIG_TCLASS 0x2
+/* copy the flowlabel from the inner packet */
+#define IP6_TNL_F_USE_ORIG_FLOWLABEL 0x4
+/* being used for Mobile IPv6 */
+#define IP6_TNL_F_MIP6_DEV 0x8
+/* copy DSCP from the outer packet */
+#define IP6_TNL_F_RCV_DSCP_COPY 0x10
+
+struct ip6_tnl_parm {
+ char name[IFNAMSIZ]; /* name of tunnel device */
+ int link; /* ifindex of underlying L2 interface */
+ __u8 proto; /* tunnel protocol */
+ __u8 encap_limit; /* encapsulation limit for tunnel */
+ __u8 hop_limit; /* hop limit for tunnel */
+ __be32 flowinfo; /* traffic class and flowlabel for tunnel */
+ __u32 flags; /* tunnel flags */
+ struct in6_addr laddr; /* local tunnel end-point address */
+ struct in6_addr raddr; /* remote tunnel end-point address */
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ip_vs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ip_vs.h
new file mode 100644
index 0000000..148265e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ip_vs.h
@@ -0,0 +1,405 @@
+/*
+ * IP Virtual Server
+ * data structure and functionality definitions
+ */
+
+#ifndef _IP_VS_H
+#define _IP_VS_H
+
+#include <linux/types.h> /* For __beXX types in userland */
+
+#define IP_VS_VERSION_CODE 0x010201
+#define NVERSION(version) \
+ (version >> 16) & 0xFF, \
+ (version >> 8) & 0xFF, \
+ version & 0xFF
+
+/*
+ * Virtual Service Flags
+ */
+#define IP_VS_SVC_F_PERSISTENT 0x0001 /* persistent port */
+#define IP_VS_SVC_F_HASHED 0x0002 /* hashed entry */
+
+/*
+ * Destination Server Flags
+ */
+#define IP_VS_DEST_F_AVAILABLE 0x0001 /* server is available */
+#define IP_VS_DEST_F_OVERLOAD 0x0002 /* server is overloaded */
+
+/*
+ * IPVS sync daemon states
+ */
+#define IP_VS_STATE_NONE 0x0000 /* daemon is stopped */
+#define IP_VS_STATE_MASTER 0x0001 /* started as master */
+#define IP_VS_STATE_BACKUP 0x0002 /* started as backup */
+
+/*
+ * IPVS socket options
+ */
+#define IP_VS_BASE_CTL (64+1024+64) /* base */
+
+#define IP_VS_SO_SET_NONE IP_VS_BASE_CTL /* just peek */
+#define IP_VS_SO_SET_INSERT (IP_VS_BASE_CTL+1)
+#define IP_VS_SO_SET_ADD (IP_VS_BASE_CTL+2)
+#define IP_VS_SO_SET_EDIT (IP_VS_BASE_CTL+3)
+#define IP_VS_SO_SET_DEL (IP_VS_BASE_CTL+4)
+#define IP_VS_SO_SET_FLUSH (IP_VS_BASE_CTL+5)
+#define IP_VS_SO_SET_LIST (IP_VS_BASE_CTL+6)
+#define IP_VS_SO_SET_ADDDEST (IP_VS_BASE_CTL+7)
+#define IP_VS_SO_SET_DELDEST (IP_VS_BASE_CTL+8)
+#define IP_VS_SO_SET_EDITDEST (IP_VS_BASE_CTL+9)
+#define IP_VS_SO_SET_TIMEOUT (IP_VS_BASE_CTL+10)
+#define IP_VS_SO_SET_STARTDAEMON (IP_VS_BASE_CTL+11)
+#define IP_VS_SO_SET_STOPDAEMON (IP_VS_BASE_CTL+12)
+#define IP_VS_SO_SET_RESTORE (IP_VS_BASE_CTL+13)
+#define IP_VS_SO_SET_SAVE (IP_VS_BASE_CTL+14)
+#define IP_VS_SO_SET_ZERO (IP_VS_BASE_CTL+15)
+#define IP_VS_SO_SET_MAX IP_VS_SO_SET_ZERO
+
+#define IP_VS_SO_GET_VERSION IP_VS_BASE_CTL
+#define IP_VS_SO_GET_INFO (IP_VS_BASE_CTL+1)
+#define IP_VS_SO_GET_SERVICES (IP_VS_BASE_CTL+2)
+#define IP_VS_SO_GET_SERVICE (IP_VS_BASE_CTL+3)
+#define IP_VS_SO_GET_DESTS (IP_VS_BASE_CTL+4)
+#define IP_VS_SO_GET_DEST (IP_VS_BASE_CTL+5) /* not used now */
+#define IP_VS_SO_GET_TIMEOUT (IP_VS_BASE_CTL+6)
+#define IP_VS_SO_GET_DAEMON (IP_VS_BASE_CTL+7)
+#define IP_VS_SO_GET_MAX IP_VS_SO_GET_DAEMON
+
+
+/*
+ * IPVS Connection Flags
+ */
+#define IP_VS_CONN_F_FWD_MASK 0x0007 /* mask for the fwd methods */
+#define IP_VS_CONN_F_MASQ 0x0000 /* masquerading/NAT */
+#define IP_VS_CONN_F_LOCALNODE 0x0001 /* local node */
+#define IP_VS_CONN_F_TUNNEL 0x0002 /* tunneling */
+#define IP_VS_CONN_F_DROUTE 0x0003 /* direct routing */
+#define IP_VS_CONN_F_BYPASS 0x0004 /* cache bypass */
+#define IP_VS_CONN_F_SYNC 0x0020 /* entry created by sync */
+#define IP_VS_CONN_F_HASHED 0x0040 /* hashed entry */
+#define IP_VS_CONN_F_NOOUTPUT 0x0080 /* no output packets */
+#define IP_VS_CONN_F_INACTIVE 0x0100 /* not established */
+#define IP_VS_CONN_F_OUT_SEQ 0x0200 /* must do output seq adjust */
+#define IP_VS_CONN_F_IN_SEQ 0x0400 /* must do input seq adjust */
+#define IP_VS_CONN_F_SEQ_MASK 0x0600 /* in/out sequence mask */
+#define IP_VS_CONN_F_NO_CPORT 0x0800 /* no client port set yet */
+#define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */
+
+#define IP_VS_SCHEDNAME_MAXLEN 16
+#define IP_VS_IFNAME_MAXLEN 16
+
+
+/*
+ * The struct ip_vs_service_user and struct ip_vs_dest_user are
+ * used to set IPVS rules through setsockopt.
+ */
+struct ip_vs_service_user {
+ /* virtual service addresses */
+ __u16 protocol;
+ __be32 addr; /* virtual ip address */
+ __be16 port;
+ __u32 fwmark; /* firwall mark of service */
+
+ /* virtual service options */
+ char sched_name[IP_VS_SCHEDNAME_MAXLEN];
+ unsigned flags; /* virtual service flags */
+ unsigned timeout; /* persistent timeout in sec */
+ __be32 netmask; /* persistent netmask */
+};
+
+
+struct ip_vs_dest_user {
+ /* destination server address */
+ __be32 addr;
+ __be16 port;
+
+ /* real server options */
+ unsigned conn_flags; /* connection flags */
+ int weight; /* destination weight */
+
+ /* thresholds for active connections */
+ __u32 u_threshold; /* upper threshold */
+ __u32 l_threshold; /* lower threshold */
+};
+
+
+/*
+ * IPVS statistics object (for user space)
+ */
+struct ip_vs_stats_user
+{
+ __u32 conns; /* connections scheduled */
+ __u32 inpkts; /* incoming packets */
+ __u32 outpkts; /* outgoing packets */
+ __u64 inbytes; /* incoming bytes */
+ __u64 outbytes; /* outgoing bytes */
+
+ __u32 cps; /* current connection rate */
+ __u32 inpps; /* current in packet rate */
+ __u32 outpps; /* current out packet rate */
+ __u32 inbps; /* current in byte rate */
+ __u32 outbps; /* current out byte rate */
+};
+
+
+/* The argument to IP_VS_SO_GET_INFO */
+struct ip_vs_getinfo {
+ /* version number */
+ unsigned int version;
+
+ /* size of connection hash table */
+ unsigned int size;
+
+ /* number of virtual services */
+ unsigned int num_services;
+};
+
+
+/* The argument to IP_VS_SO_GET_SERVICE */
+struct ip_vs_service_entry {
+ /* which service: user fills in these */
+ __u16 protocol;
+ __be32 addr; /* virtual address */
+ __be16 port;
+ __u32 fwmark; /* firwall mark of service */
+
+ /* service options */
+ char sched_name[IP_VS_SCHEDNAME_MAXLEN];
+ unsigned flags; /* virtual service flags */
+ unsigned timeout; /* persistent timeout */
+ __be32 netmask; /* persistent netmask */
+
+ /* number of real servers */
+ unsigned int num_dests;
+
+ /* statistics */
+ struct ip_vs_stats_user stats;
+};
+
+
+struct ip_vs_dest_entry {
+ __be32 addr; /* destination address */
+ __be16 port;
+ unsigned conn_flags; /* connection flags */
+ int weight; /* destination weight */
+
+ __u32 u_threshold; /* upper threshold */
+ __u32 l_threshold; /* lower threshold */
+
+ __u32 activeconns; /* active connections */
+ __u32 inactconns; /* inactive connections */
+ __u32 persistconns; /* persistent connections */
+
+ /* statistics */
+ struct ip_vs_stats_user stats;
+};
+
+
+/* The argument to IP_VS_SO_GET_DESTS */
+struct ip_vs_get_dests {
+ /* which service: user fills in these */
+ __u16 protocol;
+ __be32 addr; /* virtual address */
+ __be16 port;
+ __u32 fwmark; /* firwall mark of service */
+
+ /* number of real servers */
+ unsigned int num_dests;
+
+ /* the real servers */
+ struct ip_vs_dest_entry entrytable[0];
+};
+
+
+/* The argument to IP_VS_SO_GET_SERVICES */
+struct ip_vs_get_services {
+ /* number of virtual services */
+ unsigned int num_services;
+
+ /* service table */
+ struct ip_vs_service_entry entrytable[0];
+};
+
+
+/* The argument to IP_VS_SO_GET_TIMEOUT */
+struct ip_vs_timeout_user {
+ int tcp_timeout;
+ int tcp_fin_timeout;
+ int udp_timeout;
+};
+
+
+/* The argument to IP_VS_SO_GET_DAEMON */
+struct ip_vs_daemon_user {
+ /* sync daemon state (master/backup) */
+ int state;
+
+ /* multicast interface name */
+ char mcast_ifn[IP_VS_IFNAME_MAXLEN];
+
+ /* SyncID we belong to */
+ int syncid;
+};
+
+/*
+ *
+ * IPVS Generic Netlink interface definitions
+ *
+ */
+
+/* Generic Netlink family info */
+
+#define IPVS_GENL_NAME "IPVS"
+#define IPVS_GENL_VERSION 0x1
+
+struct ip_vs_flags {
+ __be32 flags;
+ __be32 mask;
+};
+
+/* Generic Netlink command attributes */
+enum {
+ IPVS_CMD_UNSPEC = 0,
+
+ IPVS_CMD_NEW_SERVICE, /* add service */
+ IPVS_CMD_SET_SERVICE, /* modify service */
+ IPVS_CMD_DEL_SERVICE, /* delete service */
+ IPVS_CMD_GET_SERVICE, /* get service info */
+
+ IPVS_CMD_NEW_DEST, /* add destination */
+ IPVS_CMD_SET_DEST, /* modify destination */
+ IPVS_CMD_DEL_DEST, /* delete destination */
+ IPVS_CMD_GET_DEST, /* get destination info */
+
+ IPVS_CMD_NEW_DAEMON, /* start sync daemon */
+ IPVS_CMD_DEL_DAEMON, /* stop sync daemon */
+ IPVS_CMD_GET_DAEMON, /* get sync daemon status */
+
+ IPVS_CMD_SET_CONFIG, /* set config settings */
+ IPVS_CMD_GET_CONFIG, /* get config settings */
+
+ IPVS_CMD_SET_INFO, /* only used in GET_INFO reply */
+ IPVS_CMD_GET_INFO, /* get general IPVS info */
+
+ IPVS_CMD_ZERO, /* zero all counters and stats */
+ IPVS_CMD_FLUSH, /* flush services and dests */
+
+ __IPVS_CMD_MAX,
+};
+
+#define IPVS_CMD_MAX (__IPVS_CMD_MAX - 1)
+
+/* Attributes used in the first level of commands */
+enum {
+ IPVS_CMD_ATTR_UNSPEC = 0,
+ IPVS_CMD_ATTR_SERVICE, /* nested service attribute */
+ IPVS_CMD_ATTR_DEST, /* nested destination attribute */
+ IPVS_CMD_ATTR_DAEMON, /* nested sync daemon attribute */
+ IPVS_CMD_ATTR_TIMEOUT_TCP, /* TCP connection timeout */
+ IPVS_CMD_ATTR_TIMEOUT_TCP_FIN, /* TCP FIN wait timeout */
+ IPVS_CMD_ATTR_TIMEOUT_UDP, /* UDP timeout */
+ __IPVS_CMD_ATTR_MAX,
+};
+
+#define IPVS_CMD_ATTR_MAX (__IPVS_SVC_ATTR_MAX - 1)
+
+/*
+ * Attributes used to describe a service
+ *
+ * Used inside nested attribute IPVS_CMD_ATTR_SERVICE
+ */
+enum {
+ IPVS_SVC_ATTR_UNSPEC = 0,
+ IPVS_SVC_ATTR_AF, /* address family */
+ IPVS_SVC_ATTR_PROTOCOL, /* virtual service protocol */
+ IPVS_SVC_ATTR_ADDR, /* virtual service address */
+ IPVS_SVC_ATTR_PORT, /* virtual service port */
+ IPVS_SVC_ATTR_FWMARK, /* firewall mark of service */
+
+ IPVS_SVC_ATTR_SCHED_NAME, /* name of scheduler */
+ IPVS_SVC_ATTR_FLAGS, /* virtual service flags */
+ IPVS_SVC_ATTR_TIMEOUT, /* persistent timeout */
+ IPVS_SVC_ATTR_NETMASK, /* persistent netmask */
+
+ IPVS_SVC_ATTR_STATS, /* nested attribute for service stats */
+ __IPVS_SVC_ATTR_MAX,
+};
+
+#define IPVS_SVC_ATTR_MAX (__IPVS_SVC_ATTR_MAX - 1)
+
+/*
+ * Attributes used to describe a destination (real server)
+ *
+ * Used inside nested attribute IPVS_CMD_ATTR_DEST
+ */
+enum {
+ IPVS_DEST_ATTR_UNSPEC = 0,
+ IPVS_DEST_ATTR_ADDR, /* real server address */
+ IPVS_DEST_ATTR_PORT, /* real server port */
+
+ IPVS_DEST_ATTR_FWD_METHOD, /* forwarding method */
+ IPVS_DEST_ATTR_WEIGHT, /* destination weight */
+
+ IPVS_DEST_ATTR_U_THRESH, /* upper threshold */
+ IPVS_DEST_ATTR_L_THRESH, /* lower threshold */
+
+ IPVS_DEST_ATTR_ACTIVE_CONNS, /* active connections */
+ IPVS_DEST_ATTR_INACT_CONNS, /* inactive connections */
+ IPVS_DEST_ATTR_PERSIST_CONNS, /* persistent connections */
+
+ IPVS_DEST_ATTR_STATS, /* nested attribute for dest stats */
+ __IPVS_DEST_ATTR_MAX,
+};
+
+#define IPVS_DEST_ATTR_MAX (__IPVS_DEST_ATTR_MAX - 1)
+
+/*
+ * Attributes describing a sync daemon
+ *
+ * Used inside nested attribute IPVS_CMD_ATTR_DAEMON
+ */
+enum {
+ IPVS_DAEMON_ATTR_UNSPEC = 0,
+ IPVS_DAEMON_ATTR_STATE, /* sync daemon state (master/backup) */
+ IPVS_DAEMON_ATTR_MCAST_IFN, /* multicast interface name */
+ IPVS_DAEMON_ATTR_SYNC_ID, /* SyncID we belong to */
+ __IPVS_DAEMON_ATTR_MAX,
+};
+
+#define IPVS_DAEMON_ATTR_MAX (__IPVS_DAEMON_ATTR_MAX - 1)
+
+/*
+ * Attributes used to describe service or destination entry statistics
+ *
+ * Used inside nested attributes IPVS_SVC_ATTR_STATS and IPVS_DEST_ATTR_STATS
+ */
+enum {
+ IPVS_STATS_ATTR_UNSPEC = 0,
+ IPVS_STATS_ATTR_CONNS, /* connections scheduled */
+ IPVS_STATS_ATTR_INPKTS, /* incoming packets */
+ IPVS_STATS_ATTR_OUTPKTS, /* outgoing packets */
+ IPVS_STATS_ATTR_INBYTES, /* incoming bytes */
+ IPVS_STATS_ATTR_OUTBYTES, /* outgoing bytes */
+
+ IPVS_STATS_ATTR_CPS, /* current connection rate */
+ IPVS_STATS_ATTR_INPPS, /* current in packet rate */
+ IPVS_STATS_ATTR_OUTPPS, /* current out packet rate */
+ IPVS_STATS_ATTR_INBPS, /* current in byte rate */
+ IPVS_STATS_ATTR_OUTBPS, /* current out byte rate */
+ __IPVS_STATS_ATTR_MAX,
+};
+
+#define IPVS_STATS_ATTR_MAX (__IPVS_STATS_ATTR_MAX - 1)
+
+/* Attributes used in response to IPVS_CMD_GET_INFO command */
+enum {
+ IPVS_INFO_ATTR_UNSPEC = 0,
+ IPVS_INFO_ATTR_VERSION, /* IPVS version number */
+ IPVS_INFO_ATTR_CONN_TAB_SIZE, /* size of connection hash table */
+ __IPVS_INFO_ATTR_MAX,
+};
+
+#define IPVS_INFO_ATTR_MAX (__IPVS_INFO_ATTR_MAX - 1)
+
+#endif /* _IP_VS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipc.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipc.h
new file mode 100644
index 0000000..98a53a1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipc.h
@@ -0,0 +1,81 @@
+#ifndef _LINUX_IPC_H
+#define _LINUX_IPC_H
+
+#include <linux/types.h>
+
+#define IPC_PRIVATE ((__kernel_key_t) 0)
+
+/* Obsolete, used only for backwards compatibility and libc5 compiles */
+struct ipc_perm
+{
+ __kernel_key_t key;
+ __kernel_uid_t uid;
+ __kernel_gid_t gid;
+ __kernel_uid_t cuid;
+ __kernel_gid_t cgid;
+ __kernel_mode_t mode;
+ unsigned short seq;
+};
+
+/* Include the definition of ipc64_perm */
+#include <asm/ipcbuf.h>
+
+/* resource get request flags */
+#define IPC_CREAT 00001000 /* create if key is nonexistent */
+#define IPC_EXCL 00002000 /* fail if key exists */
+#define IPC_NOWAIT 00004000 /* return error on wait */
+
+/* these fields are used by the DIPC package so the kernel as standard
+ should avoid using them if possible */
+
+#define IPC_DIPC 00010000 /* make it distributed */
+#define IPC_OWN 00020000 /* this machine is the DIPC owner */
+
+/*
+ * Control commands used with semctl, msgctl and shmctl
+ * see also specific commands in sem.h, msg.h and shm.h
+ */
+#define IPC_RMID 0 /* remove resource */
+#define IPC_SET 1 /* set ipc_perm options */
+#define IPC_STAT 2 /* get ipc_perm options */
+#define IPC_INFO 3 /* see ipcs */
+
+/*
+ * Version flags for semctl, msgctl, and shmctl commands
+ * These are passed as bitflags or-ed with the actual command
+ */
+#define IPC_OLD 0 /* Old version (no 32-bit UID support on many
+ architectures) */
+#define IPC_64 0x0100 /* New version (support 32-bit UIDs, bigger
+ message sizes, etc. */
+
+/*
+ * These are used to wrap system calls.
+ *
+ * See architecture code for ugly details..
+ */
+struct ipc_kludge {
+ struct msgbuf *msgp;
+ long msgtyp;
+};
+
+#define SEMOP 1
+#define SEMGET 2
+#define SEMCTL 3
+#define SEMTIMEDOP 4
+#define MSGSND 11
+#define MSGRCV 12
+#define MSGGET 13
+#define MSGCTL 14
+#define SHMAT 21
+#define SHMDT 22
+#define SHMGET 23
+#define SHMCTL 24
+
+/* Used by the DIPC package, try and avoid reusing it */
+#define DIPC 25
+
+#define IPCCALL(version,op) ((version)<<16 | (op))
+
+
+#endif /* _LINUX_IPC_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipmi.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipmi.h
new file mode 100644
index 0000000..b9ff672
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipmi.h
@@ -0,0 +1,456 @@
+/*
+ * ipmi.h
+ *
+ * MontaVista IPMI interface
+ *
+ * Author: MontaVista Software, Inc.
+ * Corey Minyard <minyard@mvista.com>
+ * source@mvista.com
+ *
+ * Copyright 2002 MontaVista Software Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __LINUX_IPMI_H
+#define __LINUX_IPMI_H
+
+#include <linux/ipmi_msgdefs.h>
+
+
+/*
+ * This file describes an interface to an IPMI driver. You have to
+ * have a fairly good understanding of IPMI to use this, so go read
+ * the specs first before actually trying to do anything.
+ *
+ * With that said, this driver provides a multi-user interface to the
+ * IPMI driver, and it allows multiple IPMI physical interfaces below
+ * the driver. The physical interfaces bind as a lower layer on the
+ * driver. They appear as interfaces to the application using this
+ * interface.
+ *
+ * Multi-user means that multiple applications may use the driver,
+ * send commands, receive responses, etc. The driver keeps track of
+ * commands the user sends and tracks the responses. The responses
+ * will go back to the application that send the command. If the
+ * response doesn't come back in time, the driver will return a
+ * timeout error response to the application. Asynchronous events
+ * from the BMC event queue will go to all users bound to the driver.
+ * The incoming event queue in the BMC will automatically be flushed
+ * if it becomes full and it is queried once a second to see if
+ * anything is in it. Incoming commands to the driver will get
+ * delivered as commands.
+ *
+ * This driver provides two main interfaces: one for in-kernel
+ * applications and another for userland applications. The
+ * capabilities are basically the same for both interface, although
+ * the interfaces are somewhat different. The stuff in the
+ * #ifdef __KERNEL__ below is the in-kernel interface. The userland
+ * interface is defined later in the file. */
+
+
+
+/*
+ * This is an overlay for all the address types, so it's easy to
+ * determine the actual address type. This is kind of like addresses
+ * work for sockets.
+ */
+#define IPMI_MAX_ADDR_SIZE 32
+struct ipmi_addr {
+ /* Try to take these from the "Channel Medium Type" table
+ in section 6.5 of the IPMI 1.5 manual. */
+ int addr_type;
+ short channel;
+ char data[IPMI_MAX_ADDR_SIZE];
+};
+
+/*
+ * When the address is not used, the type will be set to this value.
+ * The channel is the BMC's channel number for the channel (usually
+ * 0), or IPMC_BMC_CHANNEL if communicating directly with the BMC.
+ */
+#define IPMI_SYSTEM_INTERFACE_ADDR_TYPE 0x0c
+struct ipmi_system_interface_addr {
+ int addr_type;
+ short channel;
+ unsigned char lun;
+};
+
+/* An IPMB Address. */
+#define IPMI_IPMB_ADDR_TYPE 0x01
+/* Used for broadcast get device id as described in section 17.9 of the
+ IPMI 1.5 manual. */
+#define IPMI_IPMB_BROADCAST_ADDR_TYPE 0x41
+struct ipmi_ipmb_addr {
+ int addr_type;
+ short channel;
+ unsigned char slave_addr;
+ unsigned char lun;
+};
+
+/*
+ * A LAN Address. This is an address to/from a LAN interface bridged
+ * by the BMC, not an address actually out on the LAN.
+ *
+ * A concious decision was made here to deviate slightly from the IPMI
+ * spec. We do not use rqSWID and rsSWID like it shows in the
+ * message. Instead, we use remote_SWID and local_SWID. This means
+ * that any message (a request or response) from another device will
+ * always have exactly the same address. If you didn't do this,
+ * requests and responses from the same device would have different
+ * addresses, and that's not too cool.
+ *
+ * In this address, the remote_SWID is always the SWID the remote
+ * message came from, or the SWID we are sending the message to.
+ * local_SWID is always our SWID. Note that having our SWID in the
+ * message is a little weird, but this is required.
+ */
+#define IPMI_LAN_ADDR_TYPE 0x04
+struct ipmi_lan_addr {
+ int addr_type;
+ short channel;
+ unsigned char privilege;
+ unsigned char session_handle;
+ unsigned char remote_SWID;
+ unsigned char local_SWID;
+ unsigned char lun;
+};
+
+
+/*
+ * Channel for talking directly with the BMC. When using this
+ * channel, This is for the system interface address type only. FIXME
+ * - is this right, or should we use -1?
+ */
+#define IPMI_BMC_CHANNEL 0xf
+#define IPMI_NUM_CHANNELS 0x10
+
+/*
+ * Used to signify an "all channel" bitmask. This is more than the
+ * actual number of channels because this is used in userland and
+ * will cover us if the number of channels is extended.
+ */
+#define IPMI_CHAN_ALL (~0)
+
+
+/*
+ * A raw IPMI message without any addressing. This covers both
+ * commands and responses. The completion code is always the first
+ * byte of data in the response (as the spec shows the messages laid
+ * out).
+ */
+struct ipmi_msg {
+ unsigned char netfn;
+ unsigned char cmd;
+ unsigned short data_len;
+ unsigned char *data;
+};
+
+struct kernel_ipmi_msg {
+ unsigned char netfn;
+ unsigned char cmd;
+ unsigned short data_len;
+ unsigned char *data;
+};
+
+/*
+ * Various defines that are useful for IPMI applications.
+ */
+#define IPMI_INVALID_CMD_COMPLETION_CODE 0xC1
+#define IPMI_TIMEOUT_COMPLETION_CODE 0xC3
+#define IPMI_UNKNOWN_ERR_COMPLETION_CODE 0xff
+
+
+/*
+ * Receive types for messages coming from the receive interface. This
+ * is used for the receive in-kernel interface and in the receive
+ * IOCTL.
+ *
+ * The "IPMI_RESPONSE_RESPNOSE_TYPE" is a little strange sounding, but
+ * it allows you to get the message results when you send a response
+ * message.
+ */
+#define IPMI_RESPONSE_RECV_TYPE 1 /* A response to a command */
+#define IPMI_ASYNC_EVENT_RECV_TYPE 2 /* Something from the event queue */
+#define IPMI_CMD_RECV_TYPE 3 /* A command from somewhere else */
+#define IPMI_RESPONSE_RESPONSE_TYPE 4 /* The response for
+ a sent response, giving any
+ error status for sending the
+ response. When you send a
+ response message, this will
+ be returned. */
+#define IPMI_OEM_RECV_TYPE 5 /* The response for OEM Channels */
+
+/* Note that async events and received commands do not have a completion
+ code as the first byte of the incoming data, unlike a response. */
+
+
+/*
+ * Modes for ipmi_set_maint_mode() and the userland IOCTL. The AUTO
+ * setting is the default and means it will be set on certain
+ * commands. Hard setting it on and off will override automatic
+ * operation.
+ */
+#define IPMI_MAINTENANCE_MODE_AUTO 0
+#define IPMI_MAINTENANCE_MODE_OFF 1
+#define IPMI_MAINTENANCE_MODE_ON 2
+
+
+
+/*
+ * The userland interface
+ */
+
+/*
+ * The userland interface for the IPMI driver is a standard character
+ * device, with each instance of an interface registered as a minor
+ * number under the major character device.
+ *
+ * The read and write calls do not work, to get messages in and out
+ * requires ioctl calls because of the complexity of the data. select
+ * and poll do work, so you can wait for input using the file
+ * descriptor, you just can use read to get it.
+ *
+ * In general, you send a command down to the interface and receive
+ * responses back. You can use the msgid value to correlate commands
+ * and responses, the driver will take care of figuring out which
+ * incoming messages are for which command and find the proper msgid
+ * value to report. You will only receive reponses for commands you
+ * send. Asynchronous events, however, go to all open users, so you
+ * must be ready to handle these (or ignore them if you don't care).
+ *
+ * The address type depends upon the channel type. When talking
+ * directly to the BMC (IPMC_BMC_CHANNEL), the address is ignored
+ * (IPMI_UNUSED_ADDR_TYPE). When talking to an IPMB channel, you must
+ * supply a valid IPMB address with the addr_type set properly.
+ *
+ * When talking to normal channels, the driver takes care of the
+ * details of formatting and sending messages on that channel. You do
+ * not, for instance, have to format a send command, you just send
+ * whatever command you want to the channel, the driver will create
+ * the send command, automatically issue receive command and get even
+ * commands, and pass those up to the proper user.
+ */
+
+
+/* The magic IOCTL value for this interface. */
+#define IPMI_IOC_MAGIC 'i'
+
+
+/* Messages sent to the interface are this format. */
+struct ipmi_req {
+ unsigned char *addr; /* Address to send the message to. */
+ unsigned int addr_len;
+
+ long msgid; /* The sequence number for the message. This
+ exact value will be reported back in the
+ response to this request if it is a command.
+ If it is a response, this will be used as
+ the sequence value for the response. */
+
+ struct ipmi_msg msg;
+};
+/*
+ * Send a message to the interfaces. error values are:
+ * - EFAULT - an address supplied was invalid.
+ * - EINVAL - The address supplied was not valid, or the command
+ * was not allowed.
+ * - EMSGSIZE - The message to was too large.
+ * - ENOMEM - Buffers could not be allocated for the command.
+ */
+#define IPMICTL_SEND_COMMAND _IOR(IPMI_IOC_MAGIC, 13, \
+ struct ipmi_req)
+
+/* Messages sent to the interface with timing parameters are this
+ format. */
+struct ipmi_req_settime {
+ struct ipmi_req req;
+
+ /* See ipmi_request_settime() above for details on these
+ values. */
+ int retries;
+ unsigned int retry_time_ms;
+};
+/*
+ * Send a message to the interfaces with timing parameters. error values
+ * are:
+ * - EFAULT - an address supplied was invalid.
+ * - EINVAL - The address supplied was not valid, or the command
+ * was not allowed.
+ * - EMSGSIZE - The message to was too large.
+ * - ENOMEM - Buffers could not be allocated for the command.
+ */
+#define IPMICTL_SEND_COMMAND_SETTIME _IOR(IPMI_IOC_MAGIC, 21, \
+ struct ipmi_req_settime)
+
+/* Messages received from the interface are this format. */
+struct ipmi_recv {
+ int recv_type; /* Is this a command, response or an
+ asyncronous event. */
+
+ unsigned char *addr; /* Address the message was from is put
+ here. The caller must supply the
+ memory. */
+ unsigned int addr_len; /* The size of the address buffer.
+ The caller supplies the full buffer
+ length, this value is updated to
+ the actual message length when the
+ message is received. */
+
+ long msgid; /* The sequence number specified in the request
+ if this is a response. If this is a command,
+ this will be the sequence number from the
+ command. */
+
+ struct ipmi_msg msg; /* The data field must point to a buffer.
+ The data_size field must be set to the
+ size of the message buffer. The
+ caller supplies the full buffer
+ length, this value is updated to the
+ actual message length when the message
+ is received. */
+};
+
+/*
+ * Receive a message. error values:
+ * - EAGAIN - no messages in the queue.
+ * - EFAULT - an address supplied was invalid.
+ * - EINVAL - The address supplied was not valid.
+ * - EMSGSIZE - The message to was too large to fit into the message buffer,
+ * the message will be left in the buffer. */
+#define IPMICTL_RECEIVE_MSG _IOWR(IPMI_IOC_MAGIC, 12, \
+ struct ipmi_recv)
+
+/*
+ * Like RECEIVE_MSG, but if the message won't fit in the buffer, it
+ * will truncate the contents instead of leaving the data in the
+ * buffer.
+ */
+#define IPMICTL_RECEIVE_MSG_TRUNC _IOWR(IPMI_IOC_MAGIC, 11, \
+ struct ipmi_recv)
+
+/* Register to get commands from other entities on this interface. */
+struct ipmi_cmdspec {
+ unsigned char netfn;
+ unsigned char cmd;
+};
+
+/*
+ * Register to receive a specific command. error values:
+ * - EFAULT - an address supplied was invalid.
+ * - EBUSY - The netfn/cmd supplied was already in use.
+ * - ENOMEM - could not allocate memory for the entry.
+ */
+#define IPMICTL_REGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 14, \
+ struct ipmi_cmdspec)
+/*
+ * Unregister a regsitered command. error values:
+ * - EFAULT - an address supplied was invalid.
+ * - ENOENT - The netfn/cmd was not found registered for this user.
+ */
+#define IPMICTL_UNREGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 15, \
+ struct ipmi_cmdspec)
+
+/*
+ * Register to get commands from other entities on specific channels.
+ * This way, you can only listen on specific channels, or have messages
+ * from some channels go to one place and other channels to someplace
+ * else. The chans field is a bitmask, (1 << channel) for each channel.
+ * It may be IPMI_CHAN_ALL for all channels.
+ */
+struct ipmi_cmdspec_chans {
+ unsigned int netfn;
+ unsigned int cmd;
+ unsigned int chans;
+};
+
+/*
+ * Register to receive a specific command on specific channels. error values:
+ * - EFAULT - an address supplied was invalid.
+ * - EBUSY - One of the netfn/cmd/chans supplied was already in use.
+ * - ENOMEM - could not allocate memory for the entry.
+ */
+#define IPMICTL_REGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 28, \
+ struct ipmi_cmdspec_chans)
+/*
+ * Unregister some netfn/cmd/chans. error values:
+ * - EFAULT - an address supplied was invalid.
+ * - ENOENT - None of the netfn/cmd/chans were found registered for this user.
+ */
+#define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29, \
+ struct ipmi_cmdspec_chans)
+
+/*
+ * Set whether this interface receives events. Note that the first
+ * user registered for events will get all pending events for the
+ * interface. error values:
+ * - EFAULT - an address supplied was invalid.
+ */
+#define IPMICTL_SET_GETS_EVENTS_CMD _IOR(IPMI_IOC_MAGIC, 16, int)
+
+/*
+ * Set and get the slave address and LUN that we will use for our
+ * source messages. Note that this affects the interface, not just
+ * this user, so it will affect all users of this interface. This is
+ * so some initialization code can come in and do the OEM-specific
+ * things it takes to determine your address (if not the BMC) and set
+ * it for everyone else. You should probably leave the LUN alone.
+ */
+struct ipmi_channel_lun_address_set {
+ unsigned short channel;
+ unsigned char value;
+};
+#define IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD \
+ _IOR(IPMI_IOC_MAGIC, 24, struct ipmi_channel_lun_address_set)
+#define IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD \
+ _IOR(IPMI_IOC_MAGIC, 25, struct ipmi_channel_lun_address_set)
+#define IPMICTL_SET_MY_CHANNEL_LUN_CMD \
+ _IOR(IPMI_IOC_MAGIC, 26, struct ipmi_channel_lun_address_set)
+#define IPMICTL_GET_MY_CHANNEL_LUN_CMD \
+ _IOR(IPMI_IOC_MAGIC, 27, struct ipmi_channel_lun_address_set)
+/* Legacy interfaces, these only set IPMB 0. */
+#define IPMICTL_SET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 17, unsigned int)
+#define IPMICTL_GET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 18, unsigned int)
+#define IPMICTL_SET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 19, unsigned int)
+#define IPMICTL_GET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 20, unsigned int)
+
+/*
+ * Get/set the default timing values for an interface. You shouldn't
+ * generally mess with these.
+ */
+struct ipmi_timing_parms {
+ int retries;
+ unsigned int retry_time_ms;
+};
+#define IPMICTL_SET_TIMING_PARMS_CMD _IOR(IPMI_IOC_MAGIC, 22, \
+ struct ipmi_timing_parms)
+#define IPMICTL_GET_TIMING_PARMS_CMD _IOR(IPMI_IOC_MAGIC, 23, \
+ struct ipmi_timing_parms)
+
+/*
+ * Set the maintenance mode. See ipmi_set_maintenance_mode() above
+ * for a description of what this does.
+ */
+#define IPMICTL_GET_MAINTENANCE_MODE_CMD _IOR(IPMI_IOC_MAGIC, 30, int)
+#define IPMICTL_SET_MAINTENANCE_MODE_CMD _IOW(IPMI_IOC_MAGIC, 31, int)
+
+#endif /* __LINUX_IPMI_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipmi_msgdefs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipmi_msgdefs.h
new file mode 100644
index 0000000..df97e6e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipmi_msgdefs.h
@@ -0,0 +1,121 @@
+/*
+ * ipmi_smi.h
+ *
+ * MontaVista IPMI system management interface
+ *
+ * Author: MontaVista Software, Inc.
+ * Corey Minyard <minyard@mvista.com>
+ * source@mvista.com
+ *
+ * Copyright 2002 MontaVista Software Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __LINUX_IPMI_MSGDEFS_H
+#define __LINUX_IPMI_MSGDEFS_H
+
+/* Various definitions for IPMI messages used by almost everything in
+ the IPMI stack. */
+
+/* NetFNs and commands used inside the IPMI stack. */
+
+#define IPMI_NETFN_SENSOR_EVENT_REQUEST 0x04
+#define IPMI_NETFN_SENSOR_EVENT_RESPONSE 0x05
+#define IPMI_GET_EVENT_RECEIVER_CMD 0x01
+
+#define IPMI_NETFN_APP_REQUEST 0x06
+#define IPMI_NETFN_APP_RESPONSE 0x07
+#define IPMI_GET_DEVICE_ID_CMD 0x01
+#define IPMI_COLD_RESET_CMD 0x02
+#define IPMI_WARM_RESET_CMD 0x03
+#define IPMI_CLEAR_MSG_FLAGS_CMD 0x30
+#define IPMI_GET_DEVICE_GUID_CMD 0x08
+#define IPMI_GET_MSG_FLAGS_CMD 0x31
+#define IPMI_SEND_MSG_CMD 0x34
+#define IPMI_GET_MSG_CMD 0x33
+#define IPMI_SET_BMC_GLOBAL_ENABLES_CMD 0x2e
+#define IPMI_GET_BMC_GLOBAL_ENABLES_CMD 0x2f
+#define IPMI_READ_EVENT_MSG_BUFFER_CMD 0x35
+#define IPMI_GET_CHANNEL_INFO_CMD 0x42
+
+/* Bit for BMC global enables. */
+#define IPMI_BMC_RCV_MSG_INTR 0x01
+#define IPMI_BMC_EVT_MSG_INTR 0x02
+#define IPMI_BMC_EVT_MSG_BUFF 0x04
+#define IPMI_BMC_SYS_LOG 0x08
+
+#define IPMI_NETFN_STORAGE_REQUEST 0x0a
+#define IPMI_NETFN_STORAGE_RESPONSE 0x0b
+#define IPMI_ADD_SEL_ENTRY_CMD 0x44
+
+#define IPMI_NETFN_FIRMWARE_REQUEST 0x08
+#define IPMI_NETFN_FIRMWARE_RESPONSE 0x09
+
+/* The default slave address */
+#define IPMI_BMC_SLAVE_ADDR 0x20
+
+/* The BT interface on high-end HP systems supports up to 255 bytes in
+ * one transfer. Its "virtual" BMC supports some commands that are longer
+ * than 128 bytes. Use the full 256, plus NetFn/LUN, Cmd, cCode, plus
+ * some overhead; it's not worth the effort to dynamically size this based
+ * on the results of the "Get BT Capabilities" command. */
+#define IPMI_MAX_MSG_LENGTH 272 /* multiple of 16 */
+
+#define IPMI_CC_NO_ERROR 0x00
+#define IPMI_NODE_BUSY_ERR 0xc0
+#define IPMI_INVALID_COMMAND_ERR 0xc1
+#define IPMI_TIMEOUT_ERR 0xc3
+#define IPMI_ERR_MSG_TRUNCATED 0xc6
+#define IPMI_REQ_LEN_INVALID_ERR 0xc7
+#define IPMI_REQ_LEN_EXCEEDED_ERR 0xc8
+#define IPMI_NOT_IN_MY_STATE_ERR 0xd5 /* IPMI 2.0 */
+#define IPMI_LOST_ARBITRATION_ERR 0x81
+#define IPMI_BUS_ERR 0x82
+#define IPMI_NAK_ON_WRITE_ERR 0x83
+#define IPMI_ERR_UNSPECIFIED 0xff
+
+#define IPMI_CHANNEL_PROTOCOL_IPMB 1
+#define IPMI_CHANNEL_PROTOCOL_ICMB 2
+#define IPMI_CHANNEL_PROTOCOL_SMBUS 4
+#define IPMI_CHANNEL_PROTOCOL_KCS 5
+#define IPMI_CHANNEL_PROTOCOL_SMIC 6
+#define IPMI_CHANNEL_PROTOCOL_BT10 7
+#define IPMI_CHANNEL_PROTOCOL_BT15 8
+#define IPMI_CHANNEL_PROTOCOL_TMODE 9
+
+#define IPMI_CHANNEL_MEDIUM_IPMB 1
+#define IPMI_CHANNEL_MEDIUM_ICMB10 2
+#define IPMI_CHANNEL_MEDIUM_ICMB09 3
+#define IPMI_CHANNEL_MEDIUM_8023LAN 4
+#define IPMI_CHANNEL_MEDIUM_ASYNC 5
+#define IPMI_CHANNEL_MEDIUM_OTHER_LAN 6
+#define IPMI_CHANNEL_MEDIUM_PCI_SMBUS 7
+#define IPMI_CHANNEL_MEDIUM_SMBUS1 8
+#define IPMI_CHANNEL_MEDIUM_SMBUS2 9
+#define IPMI_CHANNEL_MEDIUM_USB1 10
+#define IPMI_CHANNEL_MEDIUM_USB2 11
+#define IPMI_CHANNEL_MEDIUM_SYSINTF 12
+#define IPMI_CHANNEL_MEDIUM_OEM_MIN 0x60
+#define IPMI_CHANNEL_MEDIUM_OEM_MAX 0x7f
+
+#endif /* __LINUX_IPMI_MSGDEFS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipsec.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipsec.h
new file mode 100644
index 0000000..d17a630
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipsec.h
@@ -0,0 +1,47 @@
+#ifndef _LINUX_IPSEC_H
+#define _LINUX_IPSEC_H
+
+/* The definitions, required to talk to KAME racoon IKE. */
+
+#include <linux/pfkeyv2.h>
+
+#define IPSEC_PORT_ANY 0
+#define IPSEC_ULPROTO_ANY 255
+#define IPSEC_PROTO_ANY 255
+
+enum {
+ IPSEC_MODE_ANY = 0, /* We do not support this for SA */
+ IPSEC_MODE_TRANSPORT = 1,
+ IPSEC_MODE_TUNNEL = 2,
+ IPSEC_MODE_BEET = 3
+};
+
+enum {
+ IPSEC_DIR_ANY = 0,
+ IPSEC_DIR_INBOUND = 1,
+ IPSEC_DIR_OUTBOUND = 2,
+ IPSEC_DIR_FWD = 3, /* It is our own */
+ IPSEC_DIR_MAX = 4,
+ IPSEC_DIR_INVALID = 5
+};
+
+enum {
+ IPSEC_POLICY_DISCARD = 0,
+ IPSEC_POLICY_NONE = 1,
+ IPSEC_POLICY_IPSEC = 2,
+ IPSEC_POLICY_ENTRUST = 3,
+ IPSEC_POLICY_BYPASS = 4
+};
+
+enum {
+ IPSEC_LEVEL_DEFAULT = 0,
+ IPSEC_LEVEL_USE = 1,
+ IPSEC_LEVEL_REQUIRE = 2,
+ IPSEC_LEVEL_UNIQUE = 3
+};
+
+#define IPSEC_MANUAL_REQID_MAX 0x3fff
+
+#define IPSEC_REPLAYWSIZE 32
+
+#endif /* _LINUX_IPSEC_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipv6.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipv6.h
new file mode 100644
index 0000000..12dfb33
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipv6.h
@@ -0,0 +1,159 @@
+#ifndef _IPV6_H
+#define _IPV6_H
+
+#include <linux/types.h>
+#include <linux/in6.h>
+#include <asm/byteorder.h>
+
+/* The latest drafts declared increase in minimal mtu up to 1280. */
+
+#define IPV6_MIN_MTU 1280
+
+/*
+ * Advanced API
+ * source interface/address selection, source routing, etc...
+ * *under construction*
+ */
+
+
+struct in6_pktinfo {
+ struct in6_addr ipi6_addr;
+ int ipi6_ifindex;
+};
+
+
+struct in6_ifreq {
+ struct in6_addr ifr6_addr;
+ __u32 ifr6_prefixlen;
+ int ifr6_ifindex;
+};
+
+#define IPV6_SRCRT_STRICT 0x01 /* Deprecated; will be removed */
+#define IPV6_SRCRT_TYPE_0 0 /* Deprecated; will be removed */
+#define IPV6_SRCRT_TYPE_2 2 /* IPv6 type 2 Routing Header */
+
+/*
+ * routing header
+ */
+struct ipv6_rt_hdr {
+ __u8 nexthdr;
+ __u8 hdrlen;
+ __u8 type;
+ __u8 segments_left;
+
+ /*
+ * type specific data
+ * variable length field
+ */
+};
+
+
+struct ipv6_opt_hdr {
+ __u8 nexthdr;
+ __u8 hdrlen;
+ /*
+ * TLV encoded option data follows.
+ */
+} __attribute__ ((packed)); /* required for some archs */
+
+#define ipv6_destopt_hdr ipv6_opt_hdr
+#define ipv6_hopopt_hdr ipv6_opt_hdr
+
+
+/*
+ * routing header type 0 (used in cmsghdr struct)
+ */
+
+struct rt0_hdr {
+ struct ipv6_rt_hdr rt_hdr;
+ __u32 reserved;
+ struct in6_addr addr[0];
+
+#define rt0_type rt_hdr.type
+};
+
+/*
+ * routing header type 2
+ */
+
+struct rt2_hdr {
+ struct ipv6_rt_hdr rt_hdr;
+ __u32 reserved;
+ struct in6_addr addr;
+
+#define rt2_type rt_hdr.type
+};
+
+/*
+ * home address option in destination options header
+ */
+
+struct ipv6_destopt_hao {
+ __u8 type;
+ __u8 length;
+ struct in6_addr addr;
+} __attribute__ ((__packed__));
+
+/*
+ * IPv6 fixed header
+ *
+ * BEWARE, it is incorrect. The first 4 bits of flow_lbl
+ * are glued to priority now, forming "class".
+ */
+
+struct ipv6hdr {
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 priority:4,
+ version:4;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u8 version:4,
+ priority:4;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+ __u8 flow_lbl[3];
+
+ __be16 payload_len;
+ __u8 nexthdr;
+ __u8 hop_limit;
+
+ struct in6_addr saddr;
+ struct in6_addr daddr;
+};
+
+
+/* index values for the variables in ipv6_devconf */
+enum {
+ DEVCONF_FORWARDING = 0,
+ DEVCONF_HOPLIMIT,
+ DEVCONF_MTU6,
+ DEVCONF_ACCEPT_RA,
+ DEVCONF_ACCEPT_REDIRECTS,
+ DEVCONF_AUTOCONF,
+ DEVCONF_DAD_TRANSMITS,
+ DEVCONF_RTR_SOLICITS,
+ DEVCONF_RTR_SOLICIT_INTERVAL,
+ DEVCONF_RTR_SOLICIT_DELAY,
+ DEVCONF_USE_TEMPADDR,
+ DEVCONF_TEMP_VALID_LFT,
+ DEVCONF_TEMP_PREFERED_LFT,
+ DEVCONF_REGEN_MAX_RETRY,
+ DEVCONF_MAX_DESYNC_FACTOR,
+ DEVCONF_MAX_ADDRESSES,
+ DEVCONF_FORCE_MLD_VERSION,
+ DEVCONF_ACCEPT_RA_DEFRTR,
+ DEVCONF_ACCEPT_RA_PINFO,
+ DEVCONF_ACCEPT_RA_RTR_PREF,
+ DEVCONF_RTR_PROBE_INTERVAL,
+ DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN,
+ DEVCONF_PROXY_NDP,
+ DEVCONF_OPTIMISTIC_DAD,
+ DEVCONF_ACCEPT_SOURCE_ROUTE,
+ DEVCONF_MC_FORWARDING,
+ DEVCONF_DISABLE_IPV6,
+ DEVCONF_ACCEPT_DAD,
+ DEVCONF_MAX
+};
+
+
+#endif /* _IPV6_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipv6_route.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipv6_route.h
new file mode 100644
index 0000000..45a6d1c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipv6_route.h
@@ -0,0 +1,58 @@
+/*
+ * Linux INET6 implementation
+ *
+ * Authors:
+ * Pedro Roque <roque@di.fc.ul.pt>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_IPV6_ROUTE_H
+#define _LINUX_IPV6_ROUTE_H
+
+#include <linux/types.h>
+
+#define RTF_DEFAULT 0x00010000 /* default - learned via ND */
+#define RTF_ALLONLINK 0x00020000 /* (deprecated and will be removed)
+ fallback, no routers on link */
+#define RTF_ADDRCONF 0x00040000 /* addrconf route - RA */
+#define RTF_PREFIX_RT 0x00080000 /* A prefix only route - RA */
+#define RTF_ANYCAST 0x00100000 /* Anycast */
+
+#define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */
+#define RTF_EXPIRES 0x00400000
+
+#define RTF_ROUTEINFO 0x00800000 /* route information - RA */
+
+#define RTF_CACHE 0x01000000 /* cache entry */
+#define RTF_FLOW 0x02000000 /* flow significant route */
+#define RTF_POLICY 0x04000000 /* policy route */
+
+#define RTF_PREF(pref) ((pref) << 27)
+#define RTF_PREF_MASK 0x18000000
+
+#define RTF_LOCAL 0x80000000
+
+
+struct in6_rtmsg {
+ struct in6_addr rtmsg_dst;
+ struct in6_addr rtmsg_src;
+ struct in6_addr rtmsg_gateway;
+ __u32 rtmsg_type;
+ __u16 rtmsg_dst_len;
+ __u16 rtmsg_src_len;
+ __u32 rtmsg_metric;
+ unsigned long rtmsg_info;
+ __u32 rtmsg_flags;
+ int rtmsg_ifindex;
+};
+
+#define RTMSG_NEWDEVICE 0x11
+#define RTMSG_DELDEVICE 0x12
+#define RTMSG_NEWROUTE 0x21
+#define RTMSG_DELROUTE 0x22
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipx.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipx.h
new file mode 100644
index 0000000..aabb1d2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ipx.h
@@ -0,0 +1,75 @@
+#ifndef _IPX_H_
+#define _IPX_H_
+#include <linux/types.h>
+#include <linux/sockios.h>
+#include <linux/socket.h>
+#define IPX_NODE_LEN 6
+#define IPX_MTU 576
+
+struct sockaddr_ipx {
+ sa_family_t sipx_family;
+ __be16 sipx_port;
+ __be32 sipx_network;
+ unsigned char sipx_node[IPX_NODE_LEN];
+ __u8 sipx_type;
+ unsigned char sipx_zero; /* 16 byte fill */
+};
+
+/*
+ * So we can fit the extra info for SIOCSIFADDR into the address nicely
+ */
+#define sipx_special sipx_port
+#define sipx_action sipx_zero
+#define IPX_DLTITF 0
+#define IPX_CRTITF 1
+
+struct ipx_route_definition {
+ __be32 ipx_network;
+ __be32 ipx_router_network;
+ unsigned char ipx_router_node[IPX_NODE_LEN];
+};
+
+struct ipx_interface_definition {
+ __be32 ipx_network;
+ unsigned char ipx_device[16];
+ unsigned char ipx_dlink_type;
+#define IPX_FRAME_NONE 0
+#define IPX_FRAME_SNAP 1
+#define IPX_FRAME_8022 2
+#define IPX_FRAME_ETHERII 3
+#define IPX_FRAME_8023 4
+#define IPX_FRAME_TR_8022 5 /* obsolete */
+ unsigned char ipx_special;
+#define IPX_SPECIAL_NONE 0
+#define IPX_PRIMARY 1
+#define IPX_INTERNAL 2
+ unsigned char ipx_node[IPX_NODE_LEN];
+};
+
+struct ipx_config_data {
+ unsigned char ipxcfg_auto_select_primary;
+ unsigned char ipxcfg_auto_create_interfaces;
+};
+
+/*
+ * OLD Route Definition for backward compatibility.
+ */
+
+struct ipx_route_def {
+ __be32 ipx_network;
+ __be32 ipx_router_network;
+#define IPX_ROUTE_NO_ROUTER 0
+ unsigned char ipx_router_node[IPX_NODE_LEN];
+ unsigned char ipx_device[16];
+ unsigned short ipx_flags;
+#define IPX_RT_SNAP 8
+#define IPX_RT_8022 4
+#define IPX_RT_BLUEBOOK 2
+#define IPX_RT_ROUTED 1
+};
+
+#define SIOCAIPXITFCRT (SIOCPROTOPRIVATE)
+#define SIOCAIPXPRISLT (SIOCPROTOPRIVATE + 1)
+#define SIOCIPXCFGDATA (SIOCPROTOPRIVATE + 2)
+#define SIOCIPXNCPCONN (SIOCPROTOPRIVATE + 3)
+#endif /* _IPX_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/irda.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/irda.h
new file mode 100644
index 0000000..00bdad0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/irda.h
@@ -0,0 +1,254 @@
+/*********************************************************************
+ *
+ * Filename: irda.h
+ * Version:
+ * Description:
+ * Status: Experimental.
+ * Author: Dag Brattli <dagb@cs.uit.no>
+ * Created at: Mon Mar 8 14:06:12 1999
+ * Modified at: Sat Dec 25 16:06:42 1999
+ * Modified by: Dag Brattli <dagb@cs.uit.no>
+ *
+ * Copyright (c) 1999 Dag Brattli, All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * Neither Dag Brattli nor University of Tromsø admit liability nor
+ * provide warranty for any of this software. This material is
+ * provided "AS-IS" and at no charge.
+ *
+ ********************************************************************/
+
+#ifndef KERNEL_IRDA_H
+#define KERNEL_IRDA_H
+
+#include <linux/types.h>
+
+/* Please do *not* add any #include in this file, this file is
+ * included as-is in user space.
+ * Please fix the calling file to properly included needed files before
+ * this one, or preferably to include <net/irda/irda.h> instead.
+ * Jean II */
+
+/* Hint bit positions for first hint byte */
+#define HINT_PNP 0x01
+#define HINT_PDA 0x02
+#define HINT_COMPUTER 0x04
+#define HINT_PRINTER 0x08
+#define HINT_MODEM 0x10
+#define HINT_FAX 0x20
+#define HINT_LAN 0x40
+#define HINT_EXTENSION 0x80
+
+/* Hint bit positions for second hint byte (first extension byte) */
+#define HINT_TELEPHONY 0x01
+#define HINT_FILE_SERVER 0x02
+#define HINT_COMM 0x04
+#define HINT_MESSAGE 0x08
+#define HINT_HTTP 0x10
+#define HINT_OBEX 0x20
+
+/* IrLMP character code values */
+#define CS_ASCII 0x00
+#define CS_ISO_8859_1 0x01
+#define CS_ISO_8859_2 0x02
+#define CS_ISO_8859_3 0x03
+#define CS_ISO_8859_4 0x04
+#define CS_ISO_8859_5 0x05
+#define CS_ISO_8859_6 0x06
+#define CS_ISO_8859_7 0x07
+#define CS_ISO_8859_8 0x08
+#define CS_ISO_8859_9 0x09
+#define CS_UNICODE 0xff
+
+/* These are the currently known dongles */
+typedef enum {
+ IRDA_TEKRAM_DONGLE = 0,
+ IRDA_ESI_DONGLE = 1,
+ IRDA_ACTISYS_DONGLE = 2,
+ IRDA_ACTISYS_PLUS_DONGLE = 3,
+ IRDA_GIRBIL_DONGLE = 4,
+ IRDA_LITELINK_DONGLE = 5,
+ IRDA_AIRPORT_DONGLE = 6,
+ IRDA_OLD_BELKIN_DONGLE = 7,
+ IRDA_EP7211_IR = 8,
+ IRDA_MCP2120_DONGLE = 9,
+ IRDA_ACT200L_DONGLE = 10,
+ IRDA_MA600_DONGLE = 11,
+ IRDA_TOIM3232_DONGLE = 12,
+ IRDA_EP7211_DONGLE = 13,
+} IRDA_DONGLE;
+
+/* Protocol types to be used for SOCK_DGRAM */
+enum {
+ IRDAPROTO_UNITDATA = 0,
+ IRDAPROTO_ULTRA = 1,
+ IRDAPROTO_MAX
+};
+
+#define SOL_IRLMP 266 /* Same as SOL_IRDA for now */
+#define SOL_IRTTP 266 /* Same as SOL_IRDA for now */
+
+#define IRLMP_ENUMDEVICES 1 /* Return discovery log */
+#define IRLMP_IAS_SET 2 /* Set an attribute in local IAS */
+#define IRLMP_IAS_QUERY 3 /* Query remote IAS for attribute */
+#define IRLMP_HINTS_SET 4 /* Set hint bits advertised */
+#define IRLMP_QOS_SET 5
+#define IRLMP_QOS_GET 6
+#define IRLMP_MAX_SDU_SIZE 7
+#define IRLMP_IAS_GET 8 /* Get an attribute from local IAS */
+#define IRLMP_IAS_DEL 9 /* Remove attribute from local IAS */
+#define IRLMP_HINT_MASK_SET 10 /* Set discovery filter */
+#define IRLMP_WAITDEVICE 11 /* Wait for a new discovery */
+
+#define IRTTP_MAX_SDU_SIZE IRLMP_MAX_SDU_SIZE /* Compatibility */
+
+#define IAS_MAX_STRING 256 /* See IrLMP 1.1, 4.3.3.2 */
+#define IAS_MAX_OCTET_STRING 1024 /* See IrLMP 1.1, 4.3.3.2 */
+#define IAS_MAX_CLASSNAME 60 /* See IrLMP 1.1, 4.3.1 */
+#define IAS_MAX_ATTRIBNAME 60 /* See IrLMP 1.1, 4.3.3.1 */
+#define IAS_MAX_ATTRIBNUMBER 256 /* See IrLMP 1.1, 4.3.3.1 */
+/* For user space backward compatibility - may be fixed in kernel 2.5.X
+ * Note : need 60+1 ('\0'), make it 64 for alignement - Jean II */
+#define IAS_EXPORT_CLASSNAME 64
+#define IAS_EXPORT_ATTRIBNAME 256
+
+/* Attribute type needed for struct irda_ias_set */
+#define IAS_MISSING 0
+#define IAS_INTEGER 1
+#define IAS_OCT_SEQ 2
+#define IAS_STRING 3
+
+#define LSAP_ANY 0xff
+
+struct sockaddr_irda {
+ sa_family_t sir_family; /* AF_IRDA */
+ __u8 sir_lsap_sel; /* LSAP selector */
+ __u32 sir_addr; /* Device address */
+ char sir_name[25]; /* Usually <service>:IrDA:TinyTP */
+};
+
+struct irda_device_info {
+ __u32 saddr; /* Address of local interface */
+ __u32 daddr; /* Address of remote device */
+ char info[22]; /* Description */
+ __u8 charset; /* Charset used for description */
+ __u8 hints[2]; /* Hint bits */
+};
+
+struct irda_device_list {
+ __u32 len;
+ struct irda_device_info dev[1];
+};
+
+struct irda_ias_set {
+ char irda_class_name[IAS_EXPORT_CLASSNAME];
+ char irda_attrib_name[IAS_EXPORT_ATTRIBNAME];
+ unsigned int irda_attrib_type;
+ union {
+ unsigned int irda_attrib_int;
+ struct {
+ unsigned short len;
+ __u8 octet_seq[IAS_MAX_OCTET_STRING];
+ } irda_attrib_octet_seq;
+ struct {
+ __u8 len;
+ __u8 charset;
+ __u8 string[IAS_MAX_STRING];
+ } irda_attrib_string;
+ } attribute;
+ __u32 daddr; /* Address of device (for some queries only) */
+};
+
+/* Some private IOCTL's (max 16) */
+#define SIOCSDONGLE (SIOCDEVPRIVATE + 0)
+#define SIOCGDONGLE (SIOCDEVPRIVATE + 1)
+#define SIOCSBANDWIDTH (SIOCDEVPRIVATE + 2)
+#define SIOCSMEDIABUSY (SIOCDEVPRIVATE + 3)
+#define SIOCGMEDIABUSY (SIOCDEVPRIVATE + 4)
+#define SIOCGRECEIVING (SIOCDEVPRIVATE + 5)
+#define SIOCSMODE (SIOCDEVPRIVATE + 6)
+#define SIOCGMODE (SIOCDEVPRIVATE + 7)
+#define SIOCSDTRRTS (SIOCDEVPRIVATE + 8)
+#define SIOCGQOS (SIOCDEVPRIVATE + 9)
+
+/* No reason to include <linux/if.h> just because of this one ;-) */
+#define IRNAMSIZ 16
+
+/* IrDA quality of service information (must not exceed 16 bytes) */
+struct if_irda_qos {
+ unsigned long baudrate;
+ unsigned short data_size;
+ unsigned short window_size;
+ unsigned short min_turn_time;
+ unsigned short max_turn_time;
+ unsigned char add_bofs;
+ unsigned char link_disc;
+};
+
+/* For setting RTS and DTR lines of a dongle */
+struct if_irda_line {
+ __u8 dtr;
+ __u8 rts;
+};
+
+/* IrDA interface configuration (data part must not exceed 16 bytes) */
+struct if_irda_req {
+ union {
+ char ifrn_name[IRNAMSIZ]; /* if name, e.g. "irda0" */
+ } ifr_ifrn;
+
+ /* Data part */
+ union {
+ struct if_irda_line ifru_line;
+ struct if_irda_qos ifru_qos;
+ unsigned short ifru_flags;
+ unsigned int ifru_receiving;
+ unsigned int ifru_mode;
+ unsigned int ifru_dongle;
+ } ifr_ifru;
+};
+
+#define ifr_baudrate ifr_ifru.ifru_qos.baudrate
+#define ifr_receiving ifr_ifru.ifru_receiving
+#define ifr_dongle ifr_ifru.ifru_dongle
+#define ifr_mode ifr_ifru.ifru_mode
+#define ifr_dtr ifr_ifru.ifru_line.dtr
+#define ifr_rts ifr_ifru.ifru_line.rts
+
+
+/* IrDA netlink definitions */
+#define IRDA_NL_NAME "irda"
+#define IRDA_NL_VERSION 1
+
+enum irda_nl_commands {
+ IRDA_NL_CMD_UNSPEC,
+ IRDA_NL_CMD_SET_MODE,
+ IRDA_NL_CMD_GET_MODE,
+
+ __IRDA_NL_CMD_AFTER_LAST
+};
+#define IRDA_NL_CMD_MAX (__IRDA_NL_CMD_AFTER_LAST - 1)
+
+enum nl80211_attrs {
+ IRDA_NL_ATTR_UNSPEC,
+ IRDA_NL_ATTR_IFNAME,
+ IRDA_NL_ATTR_MODE,
+
+ __IRDA_NL_ATTR_AFTER_LAST
+};
+#define IRDA_NL_ATTR_MAX (__IRDA_NL_ATTR_AFTER_LAST - 1)
+
+/* IrDA modes */
+#define IRDA_MODE_PRIMARY 0x1
+#define IRDA_MODE_SECONDARY 0x2
+#define IRDA_MODE_MONITOR 0x4
+
+#endif /* KERNEL_IRDA_H */
+
+
+
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/irqnr.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/irqnr.h
new file mode 100644
index 0000000..e0fb63c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/irqnr.h
@@ -0,0 +1,8 @@
+#ifndef _LINUX_IRQNR_H
+#define _LINUX_IRQNR_H
+
+/*
+ * Generic irq_desc iterators:
+ */
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn.h
new file mode 100644
index 0000000..596bbec
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn.h
@@ -0,0 +1,142 @@
+/* $Id: isdn.h,v 1.125.2.3 2004/02/10 01:07:14 keil Exp $
+ *
+ * Main header for the Linux ISDN subsystem (linklevel).
+ *
+ * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de)
+ * Copyright 1995,96 by Thinking Objects Software GmbH Wuerzburg
+ * Copyright 1995,96 by Michael Hipp (Michael.Hipp@student.uni-tuebingen.de)
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
+
+#ifndef __ISDN_H__
+#define __ISDN_H__
+
+#include <linux/ioctl.h>
+
+#define ISDN_MAX_DRIVERS 32
+#define ISDN_MAX_CHANNELS 64
+
+/* New ioctl-codes */
+#define IIOCNETAIF _IO('I',1)
+#define IIOCNETDIF _IO('I',2)
+#define IIOCNETSCF _IO('I',3)
+#define IIOCNETGCF _IO('I',4)
+#define IIOCNETANM _IO('I',5)
+#define IIOCNETDNM _IO('I',6)
+#define IIOCNETGNM _IO('I',7)
+#define IIOCGETSET _IO('I',8) /* no longer supported */
+#define IIOCSETSET _IO('I',9) /* no longer supported */
+#define IIOCSETVER _IO('I',10)
+#define IIOCNETHUP _IO('I',11)
+#define IIOCSETGST _IO('I',12)
+#define IIOCSETBRJ _IO('I',13)
+#define IIOCSIGPRF _IO('I',14)
+#define IIOCGETPRF _IO('I',15)
+#define IIOCSETPRF _IO('I',16)
+#define IIOCGETMAP _IO('I',17)
+#define IIOCSETMAP _IO('I',18)
+#define IIOCNETASL _IO('I',19)
+#define IIOCNETDIL _IO('I',20)
+#define IIOCGETCPS _IO('I',21)
+#define IIOCGETDVR _IO('I',22)
+#define IIOCNETLCR _IO('I',23) /* dwabc ioctl for LCR from isdnlog */
+#define IIOCNETDWRSET _IO('I',24) /* dwabc ioctl to reset abc-values to default on a net-interface */
+
+#define IIOCNETALN _IO('I',32)
+#define IIOCNETDLN _IO('I',33)
+
+#define IIOCNETGPN _IO('I',34)
+
+#define IIOCDBGVAR _IO('I',127)
+
+#define IIOCDRVCTL _IO('I',128)
+
+/* cisco hdlck device private ioctls */
+#define SIOCGKEEPPERIOD (SIOCDEVPRIVATE + 0)
+#define SIOCSKEEPPERIOD (SIOCDEVPRIVATE + 1)
+#define SIOCGDEBSERINT (SIOCDEVPRIVATE + 2)
+#define SIOCSDEBSERINT (SIOCDEVPRIVATE + 3)
+
+/* Packet encapsulations for net-interfaces */
+#define ISDN_NET_ENCAP_ETHER 0
+#define ISDN_NET_ENCAP_RAWIP 1
+#define ISDN_NET_ENCAP_IPTYP 2
+#define ISDN_NET_ENCAP_CISCOHDLC 3 /* Without SLARP and keepalive */
+#define ISDN_NET_ENCAP_SYNCPPP 4
+#define ISDN_NET_ENCAP_UIHDLC 5
+#define ISDN_NET_ENCAP_CISCOHDLCK 6 /* With SLARP and keepalive */
+#define ISDN_NET_ENCAP_X25IFACE 7 /* Documentation/networking/x25-iface.txt*/
+#define ISDN_NET_ENCAP_MAX_ENCAP ISDN_NET_ENCAP_X25IFACE
+
+/* Facility which currently uses an ISDN-channel */
+#define ISDN_USAGE_NONE 0
+#define ISDN_USAGE_RAW 1
+#define ISDN_USAGE_MODEM 2
+#define ISDN_USAGE_NET 3
+#define ISDN_USAGE_VOICE 4
+#define ISDN_USAGE_FAX 5
+#define ISDN_USAGE_MASK 7 /* Mask to get plain usage */
+#define ISDN_USAGE_DISABLED 32 /* This bit is set, if channel is disabled */
+#define ISDN_USAGE_EXCLUSIVE 64 /* This bit is set, if channel is exclusive */
+#define ISDN_USAGE_OUTGOING 128 /* This bit is set, if channel is outgoing */
+
+#define ISDN_MODEM_NUMREG 24 /* Number of Modem-Registers */
+#define ISDN_LMSNLEN 255 /* Length of tty's Listen-MSN string */
+#define ISDN_CMSGLEN 50 /* Length of CONNECT-Message to add for Modem */
+
+#define ISDN_MSNLEN 32
+#define NET_DV 0x06 /* Data version for isdn_net_ioctl_cfg */
+#define TTY_DV 0x06 /* Data version for iprofd etc. */
+
+#define INF_DV 0x01 /* Data version for /dev/isdninfo */
+
+typedef struct {
+ char drvid[25];
+ unsigned long arg;
+} isdn_ioctl_struct;
+
+typedef struct {
+ char name[10];
+ char phone[ISDN_MSNLEN];
+ int outgoing;
+} isdn_net_ioctl_phone;
+
+typedef struct {
+ char name[10]; /* Name of interface */
+ char master[10]; /* Name of Master for Bundling */
+ char slave[10]; /* Name of Slave for Bundling */
+ char eaz[256]; /* EAZ/MSN */
+ char drvid[25]; /* DriverId for Bindings */
+ int onhtime; /* Hangup-Timeout */
+ int charge; /* Charge-Units */
+ int l2_proto; /* Layer-2 protocol */
+ int l3_proto; /* Layer-3 protocol */
+ int p_encap; /* Encapsulation */
+ int exclusive; /* Channel, if bound exclusive */
+ int dialmax; /* Dial Retry-Counter */
+ int slavedelay; /* Delay until slave starts up */
+ int cbdelay; /* Delay before Callback */
+ int chargehup; /* Flag: Charge-Hangup */
+ int ihup; /* Flag: Hangup-Timeout on incoming line */
+ int secure; /* Flag: Secure */
+ int callback; /* Flag: Callback */
+ int cbhup; /* Flag: Reject Call before Callback */
+ int pppbind; /* ippp device for bindings */
+ int chargeint; /* Use fixed charge interval length */
+ int triggercps; /* BogoCPS needed for triggering slave */
+ int dialtimeout; /* Dial-Timeout */
+ int dialwait; /* Time to wait after failed dial */
+ int dialmode; /* Flag: off / on / auto */
+} isdn_net_ioctl_cfg;
+
+#define ISDN_NET_DIALMODE_MASK 0xC0 /* bits for status */
+#define ISDN_NET_DM_OFF 0x00 /* this interface is stopped */
+#define ISDN_NET_DM_MANUAL 0x40 /* this interface is on (manual) */
+#define ISDN_NET_DM_AUTO 0x80 /* this interface is autodial */
+#define ISDN_NET_DIALMODE(x) ((&(x))->flags & ISDN_NET_DIALMODE_MASK)
+
+
+#endif /* __ISDN_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn/..install.cmd
new file mode 100644
index 0000000..068ff5a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/isdn/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/isdn /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/isdn mips capicmd.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/isdn /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/isdn mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/isdn/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn/capicmd.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn/capicmd.h
new file mode 100644
index 0000000..b58635f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn/capicmd.h
@@ -0,0 +1,115 @@
+/* $Id: capicmd.h,v 1.2.6.2 2001/09/23 22:24:33 kai Exp $
+ *
+ * CAPI 2.0 Interface for Linux
+ *
+ * Copyright 1997 by Carsten Paeth <calle@calle.de>
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
+
+#ifndef __CAPICMD_H__
+#define __CAPICMD_H__
+
+#define CAPI_MSG_BASELEN 8
+#define CAPI_DATA_B3_REQ_LEN (CAPI_MSG_BASELEN+4+4+2+2+2)
+#define CAPI_DATA_B3_RESP_LEN (CAPI_MSG_BASELEN+4+2)
+
+/*----- CAPI commands -----*/
+#define CAPI_ALERT 0x01
+#define CAPI_CONNECT 0x02
+#define CAPI_CONNECT_ACTIVE 0x03
+#define CAPI_CONNECT_B3_ACTIVE 0x83
+#define CAPI_CONNECT_B3 0x82
+#define CAPI_CONNECT_B3_T90_ACTIVE 0x88
+#define CAPI_DATA_B3 0x86
+#define CAPI_DISCONNECT_B3 0x84
+#define CAPI_DISCONNECT 0x04
+#define CAPI_FACILITY 0x80
+#define CAPI_INFO 0x08
+#define CAPI_LISTEN 0x05
+#define CAPI_MANUFACTURER 0xff
+#define CAPI_RESET_B3 0x87
+#define CAPI_SELECT_B_PROTOCOL 0x41
+
+/*----- CAPI subcommands -----*/
+
+#define CAPI_REQ 0x80
+#define CAPI_CONF 0x81
+#define CAPI_IND 0x82
+#define CAPI_RESP 0x83
+
+/*----- CAPI combined commands -----*/
+
+#define CAPICMD(cmd,subcmd) (((cmd)<<8)|(subcmd))
+
+#define CAPI_DISCONNECT_REQ CAPICMD(CAPI_DISCONNECT,CAPI_REQ)
+#define CAPI_DISCONNECT_CONF CAPICMD(CAPI_DISCONNECT,CAPI_CONF)
+#define CAPI_DISCONNECT_IND CAPICMD(CAPI_DISCONNECT,CAPI_IND)
+#define CAPI_DISCONNECT_RESP CAPICMD(CAPI_DISCONNECT,CAPI_RESP)
+
+#define CAPI_ALERT_REQ CAPICMD(CAPI_ALERT,CAPI_REQ)
+#define CAPI_ALERT_CONF CAPICMD(CAPI_ALERT,CAPI_CONF)
+
+#define CAPI_CONNECT_REQ CAPICMD(CAPI_CONNECT,CAPI_REQ)
+#define CAPI_CONNECT_CONF CAPICMD(CAPI_CONNECT,CAPI_CONF)
+#define CAPI_CONNECT_IND CAPICMD(CAPI_CONNECT,CAPI_IND)
+#define CAPI_CONNECT_RESP CAPICMD(CAPI_CONNECT,CAPI_RESP)
+
+#define CAPI_CONNECT_ACTIVE_REQ CAPICMD(CAPI_CONNECT_ACTIVE,CAPI_REQ)
+#define CAPI_CONNECT_ACTIVE_CONF CAPICMD(CAPI_CONNECT_ACTIVE,CAPI_CONF)
+#define CAPI_CONNECT_ACTIVE_IND CAPICMD(CAPI_CONNECT_ACTIVE,CAPI_IND)
+#define CAPI_CONNECT_ACTIVE_RESP CAPICMD(CAPI_CONNECT_ACTIVE,CAPI_RESP)
+
+#define CAPI_SELECT_B_PROTOCOL_REQ CAPICMD(CAPI_SELECT_B_PROTOCOL,CAPI_REQ)
+#define CAPI_SELECT_B_PROTOCOL_CONF CAPICMD(CAPI_SELECT_B_PROTOCOL,CAPI_CONF)
+
+#define CAPI_CONNECT_B3_ACTIVE_REQ CAPICMD(CAPI_CONNECT_B3_ACTIVE,CAPI_REQ)
+#define CAPI_CONNECT_B3_ACTIVE_CONF CAPICMD(CAPI_CONNECT_B3_ACTIVE,CAPI_CONF)
+#define CAPI_CONNECT_B3_ACTIVE_IND CAPICMD(CAPI_CONNECT_B3_ACTIVE,CAPI_IND)
+#define CAPI_CONNECT_B3_ACTIVE_RESP CAPICMD(CAPI_CONNECT_B3_ACTIVE,CAPI_RESP)
+
+#define CAPI_CONNECT_B3_REQ CAPICMD(CAPI_CONNECT_B3,CAPI_REQ)
+#define CAPI_CONNECT_B3_CONF CAPICMD(CAPI_CONNECT_B3,CAPI_CONF)
+#define CAPI_CONNECT_B3_IND CAPICMD(CAPI_CONNECT_B3,CAPI_IND)
+#define CAPI_CONNECT_B3_RESP CAPICMD(CAPI_CONNECT_B3,CAPI_RESP)
+
+
+#define CAPI_CONNECT_B3_T90_ACTIVE_IND CAPICMD(CAPI_CONNECT_B3_T90_ACTIVE,CAPI_IND)
+#define CAPI_CONNECT_B3_T90_ACTIVE_RESP CAPICMD(CAPI_CONNECT_B3_T90_ACTIVE,CAPI_RESP)
+
+#define CAPI_DATA_B3_REQ CAPICMD(CAPI_DATA_B3,CAPI_REQ)
+#define CAPI_DATA_B3_CONF CAPICMD(CAPI_DATA_B3,CAPI_CONF)
+#define CAPI_DATA_B3_IND CAPICMD(CAPI_DATA_B3,CAPI_IND)
+#define CAPI_DATA_B3_RESP CAPICMD(CAPI_DATA_B3,CAPI_RESP)
+
+#define CAPI_DISCONNECT_B3_REQ CAPICMD(CAPI_DISCONNECT_B3,CAPI_REQ)
+#define CAPI_DISCONNECT_B3_CONF CAPICMD(CAPI_DISCONNECT_B3,CAPI_CONF)
+#define CAPI_DISCONNECT_B3_IND CAPICMD(CAPI_DISCONNECT_B3,CAPI_IND)
+#define CAPI_DISCONNECT_B3_RESP CAPICMD(CAPI_DISCONNECT_B3,CAPI_RESP)
+
+#define CAPI_RESET_B3_REQ CAPICMD(CAPI_RESET_B3,CAPI_REQ)
+#define CAPI_RESET_B3_CONF CAPICMD(CAPI_RESET_B3,CAPI_CONF)
+#define CAPI_RESET_B3_IND CAPICMD(CAPI_RESET_B3,CAPI_IND)
+#define CAPI_RESET_B3_RESP CAPICMD(CAPI_RESET_B3,CAPI_RESP)
+
+#define CAPI_LISTEN_REQ CAPICMD(CAPI_LISTEN,CAPI_REQ)
+#define CAPI_LISTEN_CONF CAPICMD(CAPI_LISTEN,CAPI_CONF)
+
+#define CAPI_MANUFACTURER_REQ CAPICMD(CAPI_MANUFACTURER,CAPI_REQ)
+#define CAPI_MANUFACTURER_CONF CAPICMD(CAPI_MANUFACTURER,CAPI_CONF)
+#define CAPI_MANUFACTURER_IND CAPICMD(CAPI_MANUFACTURER,CAPI_IND)
+#define CAPI_MANUFACTURER_RESP CAPICMD(CAPI_MANUFACTURER,CAPI_RESP)
+
+#define CAPI_FACILITY_REQ CAPICMD(CAPI_FACILITY,CAPI_REQ)
+#define CAPI_FACILITY_CONF CAPICMD(CAPI_FACILITY,CAPI_CONF)
+#define CAPI_FACILITY_IND CAPICMD(CAPI_FACILITY,CAPI_IND)
+#define CAPI_FACILITY_RESP CAPICMD(CAPI_FACILITY,CAPI_RESP)
+
+#define CAPI_INFO_REQ CAPICMD(CAPI_INFO,CAPI_REQ)
+#define CAPI_INFO_CONF CAPICMD(CAPI_INFO,CAPI_CONF)
+#define CAPI_INFO_IND CAPICMD(CAPI_INFO,CAPI_IND)
+#define CAPI_INFO_RESP CAPICMD(CAPI_INFO,CAPI_RESP)
+
+#endif /* __CAPICMD_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn_divertif.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn_divertif.h
new file mode 100644
index 0000000..10ff7e7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn_divertif.h
@@ -0,0 +1,26 @@
+/* $Id: isdn_divertif.h,v 1.4.6.1 2001/09/23 22:25:05 kai Exp $
+ *
+ * Header for the diversion supplementary interface for i4l.
+ *
+ * Author Werner Cornelius (werner@titro.de)
+ * Copyright by Werner Cornelius (werner@titro.de)
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
+
+
+/***********************************************************/
+/* magic value is also used to control version information */
+/***********************************************************/
+#define DIVERT_IF_MAGIC 0x25873401
+#define DIVERT_CMD_REG 0x00 /* register command */
+#define DIVERT_CMD_REL 0x01 /* release command */
+#define DIVERT_NO_ERR 0x00 /* return value no error */
+#define DIVERT_CMD_ERR 0x01 /* invalid cmd */
+#define DIVERT_VER_ERR 0x02 /* magic/version invalid */
+#define DIVERT_REG_ERR 0x03 /* module already registered */
+#define DIVERT_REL_ERR 0x04 /* module not registered */
+#define DIVERT_REG_NAME isdn_register_divert
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn_ppp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn_ppp.h
new file mode 100644
index 0000000..aabb015
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdn_ppp.h
@@ -0,0 +1,67 @@
+/* Linux ISDN subsystem, sync PPP, interface to ipppd
+ *
+ * Copyright 1994-1999 by Fritz Elfert (fritz@isdn4linux.de)
+ * Copyright 1995,96 Thinking Objects Software GmbH Wuerzburg
+ * Copyright 1995,96 by Michael Hipp (Michael.Hipp@student.uni-tuebingen.de)
+ * Copyright 2000-2002 by Kai Germaschewski (kai@germaschewski.name)
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
+
+#ifndef _LINUX_ISDN_PPP_H
+#define _LINUX_ISDN_PPP_H
+
+#define CALLTYPE_INCOMING 0x1
+#define CALLTYPE_OUTGOING 0x2
+#define CALLTYPE_CALLBACK 0x4
+
+#define IPPP_VERSION "2.2.0"
+
+struct pppcallinfo
+{
+ int calltype;
+ unsigned char local_num[64];
+ unsigned char remote_num[64];
+ int charge_units;
+};
+
+#define PPPIOCGCALLINFO _IOWR('t',128,struct pppcallinfo)
+#define PPPIOCBUNDLE _IOW('t',129,int)
+#define PPPIOCGMPFLAGS _IOR('t',130,int)
+#define PPPIOCSMPFLAGS _IOW('t',131,int)
+#define PPPIOCSMPMTU _IOW('t',132,int)
+#define PPPIOCSMPMRU _IOW('t',133,int)
+#define PPPIOCGCOMPRESSORS _IOR('t',134,unsigned long [8])
+#define PPPIOCSCOMPRESSOR _IOW('t',135,int)
+#define PPPIOCGIFNAME _IOR('t',136, char [IFNAMSIZ] )
+
+
+#define SC_MP_PROT 0x00000200
+#define SC_REJ_MP_PROT 0x00000400
+#define SC_OUT_SHORT_SEQ 0x00000800
+#define SC_IN_SHORT_SEQ 0x00004000
+
+#define SC_DECOMP_ON 0x01
+#define SC_COMP_ON 0x02
+#define SC_DECOMP_DISCARD 0x04
+#define SC_COMP_DISCARD 0x08
+#define SC_LINK_DECOMP_ON 0x10
+#define SC_LINK_COMP_ON 0x20
+#define SC_LINK_DECOMP_DISCARD 0x40
+#define SC_LINK_COMP_DISCARD 0x80
+
+#define ISDN_PPP_COMP_MAX_OPTIONS 16
+
+#define IPPP_COMP_FLAG_XMIT 0x1
+#define IPPP_COMP_FLAG_LINK 0x2
+
+struct isdn_ppp_comp_data {
+ int num;
+ unsigned char options[ISDN_PPP_COMP_MAX_OPTIONS];
+ int optlen;
+ int flags;
+};
+
+#endif /* _LINUX_ISDN_PPP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdnif.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdnif.h
new file mode 100644
index 0000000..1db1b0b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/isdnif.h
@@ -0,0 +1,56 @@
+/* $Id: isdnif.h,v 1.43.2.2 2004/01/12 23:08:35 keil Exp $
+ *
+ * Linux ISDN subsystem
+ * Definition of the interface between the subsystem and its low-level drivers.
+ *
+ * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de)
+ * Copyright 1995,96 Thinking Objects Software GmbH Wuerzburg
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
+
+#ifndef __ISDNIF_H__
+#define __ISDNIF_H__
+
+
+/*
+ * Values for general protocol-selection
+ */
+#define ISDN_PTYPE_UNKNOWN 0 /* Protocol undefined */
+#define ISDN_PTYPE_1TR6 1 /* german 1TR6-protocol */
+#define ISDN_PTYPE_EURO 2 /* EDSS1-protocol */
+#define ISDN_PTYPE_LEASED 3 /* for leased lines */
+#define ISDN_PTYPE_NI1 4 /* US NI-1 protocol */
+#define ISDN_PTYPE_MAX 7 /* Max. 8 Protocols */
+
+/*
+ * Values for Layer-2-protocol-selection
+ */
+#define ISDN_PROTO_L2_X75I 0 /* X75/LAPB with I-Frames */
+#define ISDN_PROTO_L2_X75UI 1 /* X75/LAPB with UI-Frames */
+#define ISDN_PROTO_L2_X75BUI 2 /* X75/LAPB with UI-Frames */
+#define ISDN_PROTO_L2_HDLC 3 /* HDLC */
+#define ISDN_PROTO_L2_TRANS 4 /* Transparent (Voice) */
+#define ISDN_PROTO_L2_X25DTE 5 /* X25/LAPB DTE mode */
+#define ISDN_PROTO_L2_X25DCE 6 /* X25/LAPB DCE mode */
+#define ISDN_PROTO_L2_V11096 7 /* V.110 bitrate adaption 9600 Baud */
+#define ISDN_PROTO_L2_V11019 8 /* V.110 bitrate adaption 19200 Baud */
+#define ISDN_PROTO_L2_V11038 9 /* V.110 bitrate adaption 38400 Baud */
+#define ISDN_PROTO_L2_MODEM 10 /* Analog Modem on Board */
+#define ISDN_PROTO_L2_FAX 11 /* Fax Group 2/3 */
+#define ISDN_PROTO_L2_HDLC_56K 12 /* HDLC 56k */
+#define ISDN_PROTO_L2_MAX 15 /* Max. 16 Protocols */
+
+/*
+ * Values for Layer-3-protocol-selection
+ */
+#define ISDN_PROTO_L3_TRANS 0 /* Transparent */
+#define ISDN_PROTO_L3_TRANSDSP 1 /* Transparent with DSP */
+#define ISDN_PROTO_L3_FCLASS2 2 /* Fax Group 2/3 CLASS 2 */
+#define ISDN_PROTO_L3_FCLASS1 3 /* Fax Group 2/3 CLASS 1 */
+#define ISDN_PROTO_L3_MAX 7 /* Max. 8 Protocols */
+
+
+#endif /* __ISDNIF_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/iso_fs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/iso_fs.h
new file mode 100644
index 0000000..4688ac4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/iso_fs.h
@@ -0,0 +1,165 @@
+#ifndef _ISOFS_FS_H
+#define _ISOFS_FS_H
+
+#include <linux/types.h>
+#include <linux/magic.h>
+
+/*
+ * The isofs filesystem constants/structures
+ */
+
+/* This part borrowed from the bsd386 isofs */
+#define ISODCL(from, to) (to - from + 1)
+
+struct iso_volume_descriptor {
+ char type[ISODCL(1,1)]; /* 711 */
+ char id[ISODCL(2,6)];
+ char version[ISODCL(7,7)];
+ char data[ISODCL(8,2048)];
+};
+
+/* volume descriptor types */
+#define ISO_VD_PRIMARY 1
+#define ISO_VD_SUPPLEMENTARY 2
+#define ISO_VD_END 255
+
+#define ISO_STANDARD_ID "CD001"
+
+struct iso_primary_descriptor {
+ char type [ISODCL ( 1, 1)]; /* 711 */
+ char id [ISODCL ( 2, 6)];
+ char version [ISODCL ( 7, 7)]; /* 711 */
+ char unused1 [ISODCL ( 8, 8)];
+ char system_id [ISODCL ( 9, 40)]; /* achars */
+ char volume_id [ISODCL ( 41, 72)]; /* dchars */
+ char unused2 [ISODCL ( 73, 80)];
+ char volume_space_size [ISODCL ( 81, 88)]; /* 733 */
+ char unused3 [ISODCL ( 89, 120)];
+ char volume_set_size [ISODCL (121, 124)]; /* 723 */
+ char volume_sequence_number [ISODCL (125, 128)]; /* 723 */
+ char logical_block_size [ISODCL (129, 132)]; /* 723 */
+ char path_table_size [ISODCL (133, 140)]; /* 733 */
+ char type_l_path_table [ISODCL (141, 144)]; /* 731 */
+ char opt_type_l_path_table [ISODCL (145, 148)]; /* 731 */
+ char type_m_path_table [ISODCL (149, 152)]; /* 732 */
+ char opt_type_m_path_table [ISODCL (153, 156)]; /* 732 */
+ char root_directory_record [ISODCL (157, 190)]; /* 9.1 */
+ char volume_set_id [ISODCL (191, 318)]; /* dchars */
+ char publisher_id [ISODCL (319, 446)]; /* achars */
+ char preparer_id [ISODCL (447, 574)]; /* achars */
+ char application_id [ISODCL (575, 702)]; /* achars */
+ char copyright_file_id [ISODCL (703, 739)]; /* 7.5 dchars */
+ char abstract_file_id [ISODCL (740, 776)]; /* 7.5 dchars */
+ char bibliographic_file_id [ISODCL (777, 813)]; /* 7.5 dchars */
+ char creation_date [ISODCL (814, 830)]; /* 8.4.26.1 */
+ char modification_date [ISODCL (831, 847)]; /* 8.4.26.1 */
+ char expiration_date [ISODCL (848, 864)]; /* 8.4.26.1 */
+ char effective_date [ISODCL (865, 881)]; /* 8.4.26.1 */
+ char file_structure_version [ISODCL (882, 882)]; /* 711 */
+ char unused4 [ISODCL (883, 883)];
+ char application_data [ISODCL (884, 1395)];
+ char unused5 [ISODCL (1396, 2048)];
+};
+
+/* Almost the same as the primary descriptor but two fields are specified */
+struct iso_supplementary_descriptor {
+ char type [ISODCL ( 1, 1)]; /* 711 */
+ char id [ISODCL ( 2, 6)];
+ char version [ISODCL ( 7, 7)]; /* 711 */
+ char flags [ISODCL ( 8, 8)]; /* 853 */
+ char system_id [ISODCL ( 9, 40)]; /* achars */
+ char volume_id [ISODCL ( 41, 72)]; /* dchars */
+ char unused2 [ISODCL ( 73, 80)];
+ char volume_space_size [ISODCL ( 81, 88)]; /* 733 */
+ char escape [ISODCL ( 89, 120)]; /* 856 */
+ char volume_set_size [ISODCL (121, 124)]; /* 723 */
+ char volume_sequence_number [ISODCL (125, 128)]; /* 723 */
+ char logical_block_size [ISODCL (129, 132)]; /* 723 */
+ char path_table_size [ISODCL (133, 140)]; /* 733 */
+ char type_l_path_table [ISODCL (141, 144)]; /* 731 */
+ char opt_type_l_path_table [ISODCL (145, 148)]; /* 731 */
+ char type_m_path_table [ISODCL (149, 152)]; /* 732 */
+ char opt_type_m_path_table [ISODCL (153, 156)]; /* 732 */
+ char root_directory_record [ISODCL (157, 190)]; /* 9.1 */
+ char volume_set_id [ISODCL (191, 318)]; /* dchars */
+ char publisher_id [ISODCL (319, 446)]; /* achars */
+ char preparer_id [ISODCL (447, 574)]; /* achars */
+ char application_id [ISODCL (575, 702)]; /* achars */
+ char copyright_file_id [ISODCL (703, 739)]; /* 7.5 dchars */
+ char abstract_file_id [ISODCL (740, 776)]; /* 7.5 dchars */
+ char bibliographic_file_id [ISODCL (777, 813)]; /* 7.5 dchars */
+ char creation_date [ISODCL (814, 830)]; /* 8.4.26.1 */
+ char modification_date [ISODCL (831, 847)]; /* 8.4.26.1 */
+ char expiration_date [ISODCL (848, 864)]; /* 8.4.26.1 */
+ char effective_date [ISODCL (865, 881)]; /* 8.4.26.1 */
+ char file_structure_version [ISODCL (882, 882)]; /* 711 */
+ char unused4 [ISODCL (883, 883)];
+ char application_data [ISODCL (884, 1395)];
+ char unused5 [ISODCL (1396, 2048)];
+};
+
+
+#define HS_STANDARD_ID "CDROM"
+
+struct hs_volume_descriptor {
+ char foo [ISODCL ( 1, 8)]; /* 733 */
+ char type [ISODCL ( 9, 9)]; /* 711 */
+ char id [ISODCL ( 10, 14)];
+ char version [ISODCL ( 15, 15)]; /* 711 */
+ char data[ISODCL(16,2048)];
+};
+
+
+struct hs_primary_descriptor {
+ char foo [ISODCL ( 1, 8)]; /* 733 */
+ char type [ISODCL ( 9, 9)]; /* 711 */
+ char id [ISODCL ( 10, 14)];
+ char version [ISODCL ( 15, 15)]; /* 711 */
+ char unused1 [ISODCL ( 16, 16)]; /* 711 */
+ char system_id [ISODCL ( 17, 48)]; /* achars */
+ char volume_id [ISODCL ( 49, 80)]; /* dchars */
+ char unused2 [ISODCL ( 81, 88)]; /* 733 */
+ char volume_space_size [ISODCL ( 89, 96)]; /* 733 */
+ char unused3 [ISODCL ( 97, 128)]; /* 733 */
+ char volume_set_size [ISODCL (129, 132)]; /* 723 */
+ char volume_sequence_number [ISODCL (133, 136)]; /* 723 */
+ char logical_block_size [ISODCL (137, 140)]; /* 723 */
+ char path_table_size [ISODCL (141, 148)]; /* 733 */
+ char type_l_path_table [ISODCL (149, 152)]; /* 731 */
+ char unused4 [ISODCL (153, 180)]; /* 733 */
+ char root_directory_record [ISODCL (181, 214)]; /* 9.1 */
+};
+
+/* We use this to help us look up the parent inode numbers. */
+
+struct iso_path_table{
+ unsigned char name_len[2]; /* 721 */
+ char extent[4]; /* 731 */
+ char parent[2]; /* 721 */
+ char name[0];
+} __attribute__((packed));
+
+/* high sierra is identical to iso, except that the date is only 6 bytes, and
+ there is an extra reserved byte after the flags */
+
+struct iso_directory_record {
+ char length [ISODCL (1, 1)]; /* 711 */
+ char ext_attr_length [ISODCL (2, 2)]; /* 711 */
+ char extent [ISODCL (3, 10)]; /* 733 */
+ char size [ISODCL (11, 18)]; /* 733 */
+ char date [ISODCL (19, 25)]; /* 7 by 711 */
+ char flags [ISODCL (26, 26)];
+ char file_unit_size [ISODCL (27, 27)]; /* 711 */
+ char interleave [ISODCL (28, 28)]; /* 711 */
+ char volume_sequence_number [ISODCL (29, 32)]; /* 723 */
+ unsigned char name_len [ISODCL (33, 33)]; /* 711 */
+ char name [0];
+} __attribute__((packed));
+
+#define ISOFS_BLOCK_BITS 11
+#define ISOFS_BLOCK_SIZE 2048
+
+#define ISOFS_BUFFER_SIZE(INODE) ((INODE)->i_sb->s_blocksize)
+#define ISOFS_BUFFER_BITS(INODE) ((INODE)->i_sb->s_blocksize_bits)
+
+#endif /* _ISOFS_FS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ivtv.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ivtv.h
new file mode 100644
index 0000000..bf3ce85
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ivtv.h
@@ -0,0 +1,69 @@
+/*
+ Public ivtv API header
+ Copyright (C) 2003-2004 Kevin Thayer <nufan_wfk at yahoo.com>
+ Copyright (C) 2004-2007 Hans Verkuil <hverkuil@xs4all.nl>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LINUX_IVTV_H__
+#define __LINUX_IVTV_H__
+
+
+#include <linux/types.h>
+#include <linux/videodev2.h>
+
+/* ivtv knows several distinct output modes: MPEG streaming,
+ YUV streaming, YUV updates through user DMA and the passthrough
+ mode.
+
+ In order to clearly tell the driver that we are in user DMA
+ YUV mode you need to call IVTV_IOC_DMA_FRAME with y_source == NULL
+ first (althrough if you don't then the first time
+ DMA_FRAME is called the mode switch is done automatically).
+
+ When you close the file handle the user DMA mode is exited again.
+
+ While in one mode, you cannot use another mode (EBUSY is returned).
+
+ All this means that if you want to change the YUV interlacing
+ for the user DMA YUV mode you first need to do call IVTV_IOC_DMA_FRAME
+ with y_source == NULL before you can set the correct format using
+ VIDIOC_S_FMT.
+
+ Eventually all this should be replaced with a proper V4L2 API,
+ but for now we have to do it this way. */
+
+struct ivtv_dma_frame {
+ enum v4l2_buf_type type; /* V4L2_BUF_TYPE_VIDEO_OUTPUT */
+ __u32 pixelformat; /* 0 == same as destination */
+ void *y_source; /* if NULL and type == V4L2_BUF_TYPE_VIDEO_OUTPUT,
+ then just switch to user DMA YUV output mode */
+ void *uv_source; /* Unused for RGB pixelformats */
+ struct v4l2_rect src;
+ struct v4l2_rect dst;
+ __u32 src_width;
+ __u32 src_height;
+};
+
+#define IVTV_IOC_DMA_FRAME _IOW ('V', BASE_VIDIOC_PRIVATE+0, struct ivtv_dma_frame)
+
+/* Deprecated defines: applications should use the defines from videodev2.h */
+#define IVTV_SLICED_TYPE_TELETEXT_B V4L2_MPEG_VBI_IVTV_TELETEXT_B
+#define IVTV_SLICED_TYPE_CAPTION_525 V4L2_MPEG_VBI_IVTV_CAPTION_525
+#define IVTV_SLICED_TYPE_WSS_625 V4L2_MPEG_VBI_IVTV_WSS_625
+#define IVTV_SLICED_TYPE_VPS V4L2_MPEG_VBI_IVTV_VPS
+
+#endif /* _LINUX_IVTV_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ivtvfb.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ivtvfb.h
new file mode 100644
index 0000000..d9be3ff
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ivtvfb.h
@@ -0,0 +1,38 @@
+/*
+ On Screen Display cx23415 Framebuffer driver
+
+ Copyright (C) 2006, 2007 Ian Armstrong <ian@iarmst.demon.co.uk>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LINUX_IVTVFB_H__
+#define __LINUX_IVTVFB_H__
+
+
+#include <linux/types.h>
+
+/* Framebuffer external API */
+
+struct ivtvfb_dma_frame {
+ void *source;
+ unsigned long dest_offset;
+ int count;
+};
+
+#define IVTVFB_IOC_DMA_FRAME _IOW('V', BASE_VIDIOC_PRIVATE+0, struct ivtvfb_dma_frame)
+#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ixjuser.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ixjuser.h
new file mode 100644
index 0000000..7d8525e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ixjuser.h
@@ -0,0 +1,720 @@
+#ifndef __LINUX_IXJUSER_H
+#define __LINUX_IXJUSER_H
+
+/******************************************************************************
+ *
+ * ixjuser.h
+ *
+ * Device Driver for Quicknet Technologies, Inc.'s Telephony cards
+ * including the Internet PhoneJACK, Internet PhoneJACK Lite,
+ * Internet PhoneJACK PCI, Internet LineJACK, Internet PhoneCARD and
+ * SmartCABLE
+ *
+ * (c) Copyright 1999-2001 Quicknet Technologies, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * Author: Ed Okerson, <eokerson@quicknet.net>
+ *
+ * Contributors: Greg Herlein, <gherlein@quicknet.net>
+ * David W. Erhart, <derhart@quicknet.net>
+ * John Sellers, <jsellers@quicknet.net>
+ * Mike Preston, <mpreston@quicknet.net>
+ *
+ * More information about the hardware related to this driver can be found
+ * at our website: http://www.quicknet.net
+ *
+ * Fixes:
+ *
+ * IN NO EVENT SHALL QUICKNET TECHNOLOGIES, INC. BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+ * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF QUICKNET
+ * TECHNOLOGIES, INC.HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * QUICKNET TECHNOLOGIES, INC. SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND QUICKNET TECHNOLOGIES, INC. HAS NO OBLIGATION
+ * TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ *****************************************************************************/
+
+#include <linux/telephony.h>
+
+
+/******************************************************************************
+*
+* IOCTL's used for the Quicknet Telephony Cards
+*
+* If you use the IXJCTL_TESTRAM command, the card must be power cycled to
+* reset the SRAM values before futher use.
+*
+******************************************************************************/
+
+#define IXJCTL_DSP_RESET _IO ('q', 0xC0)
+
+#define IXJCTL_RING PHONE_RING
+#define IXJCTL_HOOKSTATE PHONE_HOOKSTATE
+#define IXJCTL_MAXRINGS PHONE_MAXRINGS
+#define IXJCTL_RING_CADENCE PHONE_RING_CADENCE
+#define IXJCTL_RING_START PHONE_RING_START
+#define IXJCTL_RING_STOP PHONE_RING_STOP
+
+#define IXJCTL_CARDTYPE _IOR ('q', 0xC1, int)
+#define IXJCTL_SERIAL _IOR ('q', 0xC2, int)
+#define IXJCTL_DSP_TYPE _IOR ('q', 0xC3, int)
+#define IXJCTL_DSP_VERSION _IOR ('q', 0xC4, int)
+#define IXJCTL_VERSION _IOR ('q', 0xDA, char *)
+#define IXJCTL_DSP_IDLE _IO ('q', 0xC5)
+#define IXJCTL_TESTRAM _IO ('q', 0xC6)
+
+/******************************************************************************
+*
+* This group of IOCTLs deal with the record settings of the DSP
+*
+* The IXJCTL_REC_DEPTH command sets the internal buffer depth of the DSP.
+* Setting a lower depth reduces latency, but increases the demand of the
+* application to service the driver without frame loss. The DSP has 480
+* bytes of physical buffer memory for the record channel so the true
+* maximum limit is determined by how many frames will fit in the buffer.
+*
+* 1 uncompressed (480 byte) 16-bit linear frame.
+* 2 uncompressed (240 byte) 8-bit A-law/mu-law frames.
+* 15 TrueSpeech 8.5 frames.
+* 20 TrueSpeech 6.3,5.3,4.8 or 4.1 frames.
+*
+* The default in the driver is currently set to 2 frames.
+*
+* The IXJCTL_REC_VOLUME and IXJCTL_PLAY_VOLUME commands both use a Q8
+* number as a parameter, 0x100 scales the signal by 1.0, 0x200 scales the
+* signal by 2.0, 0x80 scales the signal by 0.5. No protection is given
+* against over-scaling, if the multiplication factor times the input
+* signal exceeds 16 bits, overflow distortion will occur. The default
+* setting is 0x100 (1.0).
+*
+* The IXJCTL_REC_LEVEL returns the average signal level (not r.m.s.) on
+* the most recently recorded frame as a 16 bit value.
+******************************************************************************/
+
+#define IXJCTL_REC_CODEC PHONE_REC_CODEC
+#define IXJCTL_REC_START PHONE_REC_START
+#define IXJCTL_REC_STOP PHONE_REC_STOP
+#define IXJCTL_REC_DEPTH PHONE_REC_DEPTH
+#define IXJCTL_FRAME PHONE_FRAME
+#define IXJCTL_REC_VOLUME PHONE_REC_VOLUME
+#define IXJCTL_REC_LEVEL PHONE_REC_LEVEL
+
+typedef enum {
+ f300_640 = 4, f300_500, f1100, f350, f400, f480, f440, f620, f20_50,
+ f133_200, f300, f300_420, f330, f300_425, f330_440, f340, f350_400,
+ f350_440, f350_450, f360, f380_420, f392, f400_425, f400_440, f400_450,
+ f420, f425, f425_450, f425_475, f435, f440_450, f440_480, f445, f450,
+ f452, f475, f480_620, f494, f500, f520, f523, f525, f540_660, f587,
+ f590, f600, f660, f700, f740, f750, f750_1450, f770, f800, f816, f850,
+ f857_1645, f900, f900_1300, f935_1215, f941_1477, f942, f950, f950_1400,
+ f975, f1000, f1020, f1050, f1100_1750, f1140, f1200, f1209, f1330, f1336,
+ lf1366, f1380, f1400, f1477, f1600, f1633_1638, f1800, f1860
+} IXJ_FILTER_FREQ;
+
+typedef struct {
+ unsigned int filter;
+ IXJ_FILTER_FREQ freq;
+ char enable;
+} IXJ_FILTER;
+
+typedef struct {
+ char enable;
+ char en_filter;
+ unsigned int filter;
+ unsigned int on1;
+ unsigned int off1;
+ unsigned int on2;
+ unsigned int off2;
+ unsigned int on3;
+ unsigned int off3;
+} IXJ_FILTER_CADENCE;
+
+#define IXJCTL_SET_FILTER _IOW ('q', 0xC7, IXJ_FILTER *)
+#define IXJCTL_SET_FILTER_RAW _IOW ('q', 0xDD, IXJ_FILTER_RAW *)
+#define IXJCTL_GET_FILTER_HIST _IOW ('q', 0xC8, int)
+#define IXJCTL_FILTER_CADENCE _IOW ('q', 0xD6, IXJ_FILTER_CADENCE *)
+#define IXJCTL_PLAY_CID _IO ('q', 0xD7)
+/******************************************************************************
+*
+* This IOCTL allows you to reassign values in the tone index table. The
+* tone table has 32 entries (0 - 31), but the driver only allows entries
+* 13 - 27 to be modified, entry 0 is reserved for silence and 1 - 12 are
+* the standard DTMF digits and 28 - 31 are the DTMF tones for A, B, C & D.
+* The positions used internally for Call Progress Tones are as follows:
+* Dial Tone - 25
+* Ring Back - 26
+* Busy Signal - 27
+*
+* The freq values are calculated as:
+* freq = cos(2 * PI * frequency / 8000)
+*
+* The most commonly needed values are already calculated and listed in the
+* enum IXJ_TONE_FREQ. Each tone index can have two frequencies with
+* different gains, if you are only using a single frequency set the unused
+* one to 0.
+*
+* The gain values range from 0 to 15 indicating +6dB to -24dB in 2dB
+* increments.
+*
+******************************************************************************/
+
+typedef enum {
+ hz20 = 0x7ffa,
+ hz50 = 0x7fe5,
+ hz133 = 0x7f4c,
+ hz200 = 0x7e6b,
+ hz261 = 0x7d50, /* .63 C1 */
+ hz277 = 0x7cfa, /* .18 CS1 */
+ hz293 = 0x7c9f, /* .66 D1 */
+ hz300 = 0x7c75,
+ hz311 = 0x7c32, /* .13 DS1 */
+ hz329 = 0x7bbf, /* .63 E1 */
+ hz330 = 0x7bb8,
+ hz340 = 0x7b75,
+ hz349 = 0x7b37, /* .23 F1 */
+ hz350 = 0x7b30,
+ hz360 = 0x7ae9,
+ hz369 = 0x7aa8, /* .99 FS1 */
+ hz380 = 0x7a56,
+ hz392 = 0x79fa, /* .00 G1 */
+ hz400 = 0x79bb,
+ hz415 = 0x7941, /* .30 GS1 */
+ hz420 = 0x7918,
+ hz425 = 0x78ee,
+ hz435 = 0x7899,
+ hz440 = 0x786d, /* .00 A1 */
+ hz445 = 0x7842,
+ hz450 = 0x7815,
+ hz452 = 0x7803,
+ hz466 = 0x7784, /* .16 AS1 */
+ hz475 = 0x7731,
+ hz480 = 0x7701,
+ hz493 = 0x7685, /* .88 B1 */
+ hz494 = 0x767b,
+ hz500 = 0x7640,
+ hz520 = 0x7578,
+ hz523 = 0x7559, /* .25 C2 */
+ hz525 = 0x7544,
+ hz540 = 0x74a7,
+ hz554 = 0x7411, /* .37 CS2 */
+ hz587 = 0x72a1, /* .33 D2 */
+ hz590 = 0x727f,
+ hz600 = 0x720b,
+ hz620 = 0x711e,
+ hz622 = 0x7106, /* .25 DS2 */
+ hz659 = 0x6f3b, /* .26 E2 */
+ hz660 = 0x6f2e,
+ hz698 = 0x6d3d, /* .46 F2 */
+ hz700 = 0x6d22,
+ hz739 = 0x6b09, /* .99 FS2 */
+ hz740 = 0x6afa,
+ hz750 = 0x6a6c,
+ hz770 = 0x694b,
+ hz783 = 0x688b, /* .99 G2 */
+ hz800 = 0x678d,
+ hz816 = 0x6698,
+ hz830 = 0x65bf, /* .61 GS2 */
+ hz850 = 0x6484,
+ hz857 = 0x6414,
+ hz880 = 0x629f, /* .00 A2 */
+ hz900 = 0x6154,
+ hz932 = 0x5f35, /* .33 AS2 */
+ hz935 = 0x5f01,
+ hz941 = 0x5e9a,
+ hz942 = 0x5e88,
+ hz950 = 0x5dfd,
+ hz975 = 0x5c44,
+ hz1000 = 0x5a81,
+ hz1020 = 0x5912,
+ hz1050 = 0x56e2,
+ hz1100 = 0x5320,
+ hz1140 = 0x5007,
+ hz1200 = 0x4b3b,
+ hz1209 = 0x4a80,
+ hz1215 = 0x4a02,
+ hz1250 = 0x471c,
+ hz1300 = 0x42e0,
+ hz1330 = 0x4049,
+ hz1336 = 0x3fc4,
+ hz1366 = 0x3d22,
+ hz1380 = 0x3be4,
+ hz1400 = 0x3a1b,
+ hz1450 = 0x3596,
+ hz1477 = 0x331c,
+ hz1500 = 0x30fb,
+ hz1600 = 0x278d,
+ hz1633 = 0x2462,
+ hz1638 = 0x23e7,
+ hz1645 = 0x233a,
+ hz1750 = 0x18f8,
+ hz1800 = 0x1405,
+ hz1860 = 0xe0b,
+ hz2100 = 0xf5f6,
+ hz2130 = 0xf2f5,
+ hz2450 = 0xd3b3,
+ hz2750 = 0xb8e4
+} IXJ_FREQ;
+
+typedef enum {
+ C1 = hz261,
+ CS1 = hz277,
+ D1 = hz293,
+ DS1 = hz311,
+ E1 = hz329,
+ F1 = hz349,
+ FS1 = hz369,
+ G1 = hz392,
+ GS1 = hz415,
+ A1 = hz440,
+ AS1 = hz466,
+ B1 = hz493,
+ C2 = hz523,
+ CS2 = hz554,
+ D2 = hz587,
+ DS2 = hz622,
+ E2 = hz659,
+ F2 = hz698,
+ FS2 = hz739,
+ G2 = hz783,
+ GS2 = hz830,
+ A2 = hz880,
+ AS2 = hz932,
+} IXJ_NOTE;
+
+typedef struct {
+ int tone_index;
+ int freq0;
+ int gain0;
+ int freq1;
+ int gain1;
+} IXJ_TONE;
+
+#define IXJCTL_INIT_TONE _IOW ('q', 0xC9, IXJ_TONE *)
+
+/******************************************************************************
+*
+* The IXJCTL_TONE_CADENCE ioctl defines tone sequences used for various
+* Call Progress Tones (CPT). This is accomplished by setting up an array of
+* IXJ_CADENCE_ELEMENT structures that sequentially define the states of
+* the tone sequence. The tone_on_time and tone_off time are in
+* 250 microsecond intervals. A pointer to this array is passed to the
+* driver as the ce element of an IXJ_CADENCE structure. The elements_used
+* must be set to the number of IXJ_CADENCE_ELEMENTS in the array. The
+* termination variable defines what to do at the end of a cadence, the
+* options are to play the cadence once and stop, to repeat the last
+* element of the cadence indefinitely, or to repeat the entire cadence
+* indefinitely. The ce variable is a pointer to the array of IXJ_TONE
+* structures. If the freq0 variable is non-zero, the tone table contents
+* for the tone_index are updated to the frequencies and gains defined. It
+* should be noted that DTMF tones cannot be reassigned, so if DTMF tone
+* table indexes are used in a cadence the frequency and gain variables will
+* be ignored.
+*
+* If the array elements contain frequency parameters the driver will
+* initialize the needed tone table elements and begin playing the tone,
+* there is no preset limit on the number of elements in the cadence. If
+* there is more than one frequency used in the cadence, sequential elements
+* of different frequencies MUST use different tone table indexes. Only one
+* cadence can be played at a time. It is possible to build complex
+* cadences with multiple frequencies using 2 tone table indexes by
+* alternating between them.
+*
+******************************************************************************/
+
+typedef struct {
+ int index;
+ int tone_on_time;
+ int tone_off_time;
+ int freq0;
+ int gain0;
+ int freq1;
+ int gain1;
+} IXJ_CADENCE_ELEMENT;
+
+typedef enum {
+ PLAY_ONCE,
+ REPEAT_LAST_ELEMENT,
+ REPEAT_ALL
+} IXJ_CADENCE_TERM;
+
+typedef struct {
+ int elements_used;
+ IXJ_CADENCE_TERM termination;
+ IXJ_CADENCE_ELEMENT *ce;
+} IXJ_CADENCE;
+
+#define IXJCTL_TONE_CADENCE _IOW ('q', 0xCA, IXJ_CADENCE *)
+/******************************************************************************
+*
+* This group of IOCTLs deal with the playback settings of the DSP
+*
+******************************************************************************/
+
+#define IXJCTL_PLAY_CODEC PHONE_PLAY_CODEC
+#define IXJCTL_PLAY_START PHONE_PLAY_START
+#define IXJCTL_PLAY_STOP PHONE_PLAY_STOP
+#define IXJCTL_PLAY_DEPTH PHONE_PLAY_DEPTH
+#define IXJCTL_PLAY_VOLUME PHONE_PLAY_VOLUME
+#define IXJCTL_PLAY_LEVEL PHONE_PLAY_LEVEL
+
+/******************************************************************************
+*
+* This group of IOCTLs deal with the Acoustic Echo Cancellation settings
+* of the DSP
+*
+* Issuing the IXJCTL_AEC_START command with a value of AEC_OFF has the
+* same effect as IXJCTL_AEC_STOP. This is to simplify slider bar
+* controls. IXJCTL_AEC_GET_LEVEL returns the current setting of the AEC.
+******************************************************************************/
+#define IXJCTL_AEC_START _IOW ('q', 0xCB, int)
+#define IXJCTL_AEC_STOP _IO ('q', 0xCC)
+#define IXJCTL_AEC_GET_LEVEL _IO ('q', 0xCD)
+
+#define AEC_OFF 0
+#define AEC_LOW 1
+#define AEC_MED 2
+#define AEC_HIGH 3
+#define AEC_AUTO 4
+#define AEC_AGC 5
+/******************************************************************************
+*
+* Call Progress Tones, DTMF, etc.
+* IXJCTL_DTMF_OOB determines if DTMF signaling is sent as Out-Of-Band
+* only. If you pass a 1, DTMF is suppressed from the audio stream.
+* Tone on and off times are in 250 microsecond intervals so
+* ioctl(ixj1, IXJCTL_SET_TONE_ON_TIME, 360);
+* will set the tone on time of board ixj1 to 360 * 250us = 90ms
+* the default values of tone on and off times is 840 or 210ms
+******************************************************************************/
+
+#define IXJCTL_DTMF_READY PHONE_DTMF_READY
+#define IXJCTL_GET_DTMF PHONE_GET_DTMF
+#define IXJCTL_GET_DTMF_ASCII PHONE_GET_DTMF_ASCII
+#define IXJCTL_DTMF_OOB PHONE_DTMF_OOB
+#define IXJCTL_EXCEPTION PHONE_EXCEPTION
+#define IXJCTL_PLAY_TONE PHONE_PLAY_TONE
+#define IXJCTL_SET_TONE_ON_TIME PHONE_SET_TONE_ON_TIME
+#define IXJCTL_SET_TONE_OFF_TIME PHONE_SET_TONE_OFF_TIME
+#define IXJCTL_GET_TONE_ON_TIME PHONE_GET_TONE_ON_TIME
+#define IXJCTL_GET_TONE_OFF_TIME PHONE_GET_TONE_OFF_TIME
+#define IXJCTL_GET_TONE_STATE PHONE_GET_TONE_STATE
+#define IXJCTL_BUSY PHONE_BUSY
+#define IXJCTL_RINGBACK PHONE_RINGBACK
+#define IXJCTL_DIALTONE PHONE_DIALTONE
+#define IXJCTL_CPT_STOP PHONE_CPT_STOP
+
+/******************************************************************************
+* LineJACK specific IOCTLs
+*
+* The lsb 4 bits of the LED argument represent the state of each of the 4
+* LED's on the LineJACK
+******************************************************************************/
+
+#define IXJCTL_SET_LED _IOW ('q', 0xCE, int)
+#define IXJCTL_MIXER _IOW ('q', 0xCF, int)
+
+/******************************************************************************
+*
+* The master volume controls use attenuation with 32 levels from 0 to -62dB
+* with steps of 2dB each, the defines should be OR'ed together then sent
+* as the parameter to the mixer command to change the mixer settings.
+*
+******************************************************************************/
+#define MIXER_MASTER_L 0x0000
+#define MIXER_MASTER_R 0x0100
+#define ATT00DB 0x00
+#define ATT02DB 0x01
+#define ATT04DB 0x02
+#define ATT06DB 0x03
+#define ATT08DB 0x04
+#define ATT10DB 0x05
+#define ATT12DB 0x06
+#define ATT14DB 0x07
+#define ATT16DB 0x08
+#define ATT18DB 0x09
+#define ATT20DB 0x0A
+#define ATT22DB 0x0B
+#define ATT24DB 0x0C
+#define ATT26DB 0x0D
+#define ATT28DB 0x0E
+#define ATT30DB 0x0F
+#define ATT32DB 0x10
+#define ATT34DB 0x11
+#define ATT36DB 0x12
+#define ATT38DB 0x13
+#define ATT40DB 0x14
+#define ATT42DB 0x15
+#define ATT44DB 0x16
+#define ATT46DB 0x17
+#define ATT48DB 0x18
+#define ATT50DB 0x19
+#define ATT52DB 0x1A
+#define ATT54DB 0x1B
+#define ATT56DB 0x1C
+#define ATT58DB 0x1D
+#define ATT60DB 0x1E
+#define ATT62DB 0x1F
+#define MASTER_MUTE 0x80
+
+/******************************************************************************
+*
+* The input volume controls use gain with 32 levels from +12dB to -50dB
+* with steps of 2dB each, the defines should be OR'ed together then sent
+* as the parameter to the mixer command to change the mixer settings.
+*
+******************************************************************************/
+#define MIXER_PORT_CD_L 0x0600
+#define MIXER_PORT_CD_R 0x0700
+#define MIXER_PORT_LINE_IN_L 0x0800
+#define MIXER_PORT_LINE_IN_R 0x0900
+#define MIXER_PORT_POTS_REC 0x0C00
+#define MIXER_PORT_MIC 0x0E00
+
+#define GAIN12DB 0x00
+#define GAIN10DB 0x01
+#define GAIN08DB 0x02
+#define GAIN06DB 0x03
+#define GAIN04DB 0x04
+#define GAIN02DB 0x05
+#define GAIN00DB 0x06
+#define GAIN_02DB 0x07
+#define GAIN_04DB 0x08
+#define GAIN_06DB 0x09
+#define GAIN_08DB 0x0A
+#define GAIN_10DB 0x0B
+#define GAIN_12DB 0x0C
+#define GAIN_14DB 0x0D
+#define GAIN_16DB 0x0E
+#define GAIN_18DB 0x0F
+#define GAIN_20DB 0x10
+#define GAIN_22DB 0x11
+#define GAIN_24DB 0x12
+#define GAIN_26DB 0x13
+#define GAIN_28DB 0x14
+#define GAIN_30DB 0x15
+#define GAIN_32DB 0x16
+#define GAIN_34DB 0x17
+#define GAIN_36DB 0x18
+#define GAIN_38DB 0x19
+#define GAIN_40DB 0x1A
+#define GAIN_42DB 0x1B
+#define GAIN_44DB 0x1C
+#define GAIN_46DB 0x1D
+#define GAIN_48DB 0x1E
+#define GAIN_50DB 0x1F
+#define INPUT_MUTE 0x80
+
+/******************************************************************************
+*
+* The POTS volume control use attenuation with 8 levels from 0dB to -28dB
+* with steps of 4dB each, the defines should be OR'ed together then sent
+* as the parameter to the mixer command to change the mixer settings.
+*
+******************************************************************************/
+#define MIXER_PORT_POTS_PLAY 0x0F00
+
+#define POTS_ATT_00DB 0x00
+#define POTS_ATT_04DB 0x01
+#define POTS_ATT_08DB 0x02
+#define POTS_ATT_12DB 0x03
+#define POTS_ATT_16DB 0x04
+#define POTS_ATT_20DB 0x05
+#define POTS_ATT_24DB 0x06
+#define POTS_ATT_28DB 0x07
+#define POTS_MUTE 0x80
+
+/******************************************************************************
+*
+* The DAA controls the interface to the PSTN port. The driver loads the
+* US coefficients by default, so if you live in a different country you
+* need to load the set for your countries phone system.
+*
+******************************************************************************/
+#define IXJCTL_DAA_COEFF_SET _IOW ('q', 0xD0, int)
+
+#define DAA_US 1 /*PITA 8kHz */
+#define DAA_UK 2 /*ISAR34 8kHz */
+#define DAA_FRANCE 3 /* */
+#define DAA_GERMANY 4
+#define DAA_AUSTRALIA 5
+#define DAA_JAPAN 6
+
+/******************************************************************************
+*
+* Use IXJCTL_PORT to set or query the port the card is set to. If the
+* argument is set to PORT_QUERY, the return value of the ioctl will
+* indicate which port is currently in use, otherwise it will change the
+* port.
+*
+******************************************************************************/
+#define IXJCTL_PORT _IOW ('q', 0xD1, int)
+
+#define PORT_QUERY 0
+#define PORT_POTS 1
+#define PORT_PSTN 2
+#define PORT_SPEAKER 3
+#define PORT_HANDSET 4
+
+#define IXJCTL_PSTN_SET_STATE PHONE_PSTN_SET_STATE
+#define IXJCTL_PSTN_GET_STATE PHONE_PSTN_GET_STATE
+
+#define PSTN_ON_HOOK 0
+#define PSTN_RINGING 1
+#define PSTN_OFF_HOOK 2
+#define PSTN_PULSE_DIAL 3
+
+/******************************************************************************
+*
+* The DAA Analog GAIN sets 2 parameters at one time, the receive gain (AGRR),
+* and the transmit gain (AGX). OR together the components and pass them
+* as the parameter to IXJCTL_DAA_AGAIN. The default setting is both at 0dB.
+*
+******************************************************************************/
+#define IXJCTL_DAA_AGAIN _IOW ('q', 0xD2, int)
+
+#define AGRR00DB 0x00 /* Analog gain in receive direction 0dB */
+#define AGRR3_5DB 0x10 /* Analog gain in receive direction 3.5dB */
+#define AGRR06DB 0x30 /* Analog gain in receive direction 6dB */
+
+#define AGX00DB 0x00 /* Analog gain in transmit direction 0dB */
+#define AGX_6DB 0x04 /* Analog gain in transmit direction -6dB */
+#define AGX3_5DB 0x08 /* Analog gain in transmit direction 3.5dB */
+#define AGX_2_5B 0x0C /* Analog gain in transmit direction -2.5dB */
+
+#define IXJCTL_PSTN_LINETEST _IO ('q', 0xD3)
+
+#define IXJCTL_CID _IOR ('q', 0xD4, PHONE_CID *)
+#define IXJCTL_VMWI _IOR ('q', 0xD8, int)
+#define IXJCTL_CIDCW _IOW ('q', 0xD9, PHONE_CID *)
+/******************************************************************************
+*
+* The wink duration is tunable with this ioctl. The default wink duration
+* is 320ms. You do not need to use this ioctl if you do not require a
+* different wink duration.
+*
+******************************************************************************/
+#define IXJCTL_WINK_DURATION PHONE_WINK_DURATION
+
+/******************************************************************************
+*
+* This ioctl will connect the POTS port to the PSTN port on the LineJACK
+* In order for this to work properly the port selection should be set to
+* the PSTN port with IXJCTL_PORT prior to calling this ioctl. This will
+* enable conference calls between PSTN callers and network callers.
+* Passing a 1 to this ioctl enables the POTS<->PSTN connection while
+* passing a 0 turns it back off.
+*
+******************************************************************************/
+#define IXJCTL_POTS_PSTN _IOW ('q', 0xD5, int)
+
+/******************************************************************************
+*
+* IOCTLs added by request.
+*
+* IXJCTL_HZ sets the value your Linux kernel uses for HZ as defined in
+* /usr/include/asm/param.h, this determines the fundamental
+* frequency of the clock ticks on your Linux system. The kernel
+* must be rebuilt if you change this value, also all modules you
+* use (except this one) must be recompiled. The default value
+* is 100, and you only need to use this IOCTL if you use some
+* other value.
+*
+*
+* IXJCTL_RATE sets the number of times per second that the driver polls
+* the DSP. This value cannot be larger than HZ. By
+* increasing both of these values, you may be able to reduce
+* latency because the max hang time that can exist between the
+* driver and the DSP will be reduced.
+*
+******************************************************************************/
+
+#define IXJCTL_HZ _IOW ('q', 0xE0, int)
+#define IXJCTL_RATE _IOW ('q', 0xE1, int)
+#define IXJCTL_FRAMES_READ _IOR ('q', 0xE2, unsigned long)
+#define IXJCTL_FRAMES_WRITTEN _IOR ('q', 0xE3, unsigned long)
+#define IXJCTL_READ_WAIT _IOR ('q', 0xE4, unsigned long)
+#define IXJCTL_WRITE_WAIT _IOR ('q', 0xE5, unsigned long)
+#define IXJCTL_DRYBUFFER_READ _IOR ('q', 0xE6, unsigned long)
+#define IXJCTL_DRYBUFFER_CLEAR _IO ('q', 0xE7)
+#define IXJCTL_DTMF_PRESCALE _IOW ('q', 0xE8, int)
+
+/******************************************************************************
+*
+* This ioctl allows the user application to control what events the driver
+* will send signals for, and what signals it will send for which event.
+* By default, if signaling is enabled, all events will send SIGIO when
+* they occur. To disable signals for an event set the signal to 0.
+*
+******************************************************************************/
+typedef enum {
+ SIG_DTMF_READY,
+ SIG_HOOKSTATE,
+ SIG_FLASH,
+ SIG_PSTN_RING,
+ SIG_CALLER_ID,
+ SIG_PSTN_WINK,
+ SIG_F0, SIG_F1, SIG_F2, SIG_F3,
+ SIG_FC0, SIG_FC1, SIG_FC2, SIG_FC3,
+ SIG_READ_READY = 33,
+ SIG_WRITE_READY = 34
+} IXJ_SIGEVENT;
+
+typedef struct {
+ unsigned int event;
+ int signal;
+} IXJ_SIGDEF;
+
+#define IXJCTL_SIGCTL _IOW ('q', 0xE9, IXJ_SIGDEF *)
+
+/******************************************************************************
+*
+* These ioctls allow the user application to change the gain in the
+* Smart Cable of the Internet Phone Card. Sending -1 as a value will cause
+* return value to be the current setting. Valid values to set are 0x00 - 0x1F
+*
+* 11111 = +12 dB
+* 10111 = 0 dB
+* 00000 = -34.5 dB
+*
+* IXJCTL_SC_RXG sets the Receive gain
+* IXJCTL_SC_TXG sets the Transmit gain
+*
+******************************************************************************/
+#define IXJCTL_SC_RXG _IOW ('q', 0xEA, int)
+#define IXJCTL_SC_TXG _IOW ('q', 0xEB, int)
+
+/******************************************************************************
+*
+* The intercom IOCTL's short the output from one card to the input of the
+* other and vice versa (actually done in the DSP read function). It is only
+* necessary to execute the IOCTL on one card, but it is necessary to have
+* both devices open to be able to detect hook switch changes. The record
+* codec and rate of each card must match the playback codec and rate of
+* the other card for this to work properly.
+*
+******************************************************************************/
+
+#define IXJCTL_INTERCOM_START _IOW ('q', 0xFD, int)
+#define IXJCTL_INTERCOM_STOP _IOW ('q', 0xFE, int)
+
+/******************************************************************************
+ *
+ * new structure for accessing raw filter information
+ *
+ ******************************************************************************/
+
+typedef struct {
+ unsigned int filter;
+ char enable;
+ unsigned int coeff[19];
+} IXJ_FILTER_RAW;
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/jffs2.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/jffs2.h
new file mode 100644
index 0000000..2b32d63
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/jffs2.h
@@ -0,0 +1,222 @@
+/*
+ * JFFS2 -- Journalling Flash File System, Version 2.
+ *
+ * Copyright (C) 2001-2003 Red Hat, Inc.
+ *
+ * Created by David Woodhouse <dwmw2@infradead.org>
+ *
+ * For licensing information, see the file 'LICENCE' in the
+ * jffs2 directory.
+ */
+
+#ifndef __LINUX_JFFS2_H__
+#define __LINUX_JFFS2_H__
+
+#include <linux/types.h>
+#include <linux/magic.h>
+
+/* You must include something which defines the C99 uintXX_t types.
+ We don't do it from here because this file is used in too many
+ different environments. */
+
+/* Values we may expect to find in the 'magic' field */
+#define JFFS2_OLD_MAGIC_BITMASK 0x1984
+#define JFFS2_MAGIC_BITMASK 0x1985
+#define KSAMTIB_CIGAM_2SFFJ 0x8519 /* For detecting wrong-endian fs */
+#define JFFS2_EMPTY_BITMASK 0xffff
+#define JFFS2_DIRTY_BITMASK 0x0000
+
+/* Summary node MAGIC marker */
+#define JFFS2_SUM_MAGIC 0x02851885
+
+/* We only allow a single char for length, and 0xFF is empty flash so
+ we don't want it confused with a real length. Hence max 254.
+*/
+#define JFFS2_MAX_NAME_LEN 254
+
+/* How small can we sensibly write nodes? */
+#define JFFS2_MIN_DATA_LEN 128
+
+#define JFFS2_COMPR_NONE 0x00
+#define JFFS2_COMPR_ZERO 0x01
+#define JFFS2_COMPR_RTIME 0x02
+#define JFFS2_COMPR_RUBINMIPS 0x03
+#define JFFS2_COMPR_COPY 0x04
+#define JFFS2_COMPR_DYNRUBIN 0x05
+#define JFFS2_COMPR_ZLIB 0x06
+#define JFFS2_COMPR_LZO 0x07
+/* Compatibility flags. */
+#define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */
+#define JFFS2_NODE_ACCURATE 0x2000
+/* INCOMPAT: Fail to mount the filesystem */
+#define JFFS2_FEATURE_INCOMPAT 0xc000
+/* ROCOMPAT: Mount read-only */
+#define JFFS2_FEATURE_ROCOMPAT 0x8000
+/* RWCOMPAT_COPY: Mount read/write, and copy the node when it's GC'd */
+#define JFFS2_FEATURE_RWCOMPAT_COPY 0x4000
+/* RWCOMPAT_DELETE: Mount read/write, and delete the node when it's GC'd */
+#define JFFS2_FEATURE_RWCOMPAT_DELETE 0x0000
+
+#define JFFS2_NODETYPE_DIRENT (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 1)
+#define JFFS2_NODETYPE_INODE (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 2)
+#define JFFS2_NODETYPE_CLEANMARKER (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
+#define JFFS2_NODETYPE_PADDING (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 4)
+
+#define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6)
+
+#define JFFS2_NODETYPE_XATTR (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 8)
+#define JFFS2_NODETYPE_XREF (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 9)
+
+/* XATTR Related */
+#define JFFS2_XPREFIX_USER 1 /* for "user." */
+#define JFFS2_XPREFIX_SECURITY 2 /* for "security." */
+#define JFFS2_XPREFIX_ACL_ACCESS 3 /* for "system.posix_acl_access" */
+#define JFFS2_XPREFIX_ACL_DEFAULT 4 /* for "system.posix_acl_default" */
+#define JFFS2_XPREFIX_TRUSTED 5 /* for "trusted.*" */
+
+#define JFFS2_ACL_VERSION 0x0001
+
+// Maybe later...
+//#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
+//#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4)
+
+
+#define JFFS2_INO_FLAG_PREREAD 1 /* Do read_inode() for this one at
+ mount time, don't wait for it to
+ happen later */
+#define JFFS2_INO_FLAG_USERCOMPR 2 /* User has requested a specific
+ compression type */
+
+
+/* These can go once we've made sure we've caught all uses without
+ byteswapping */
+
+typedef struct {
+ __u32 v32;
+} __attribute__((packed)) jint32_t;
+
+typedef struct {
+ __u32 m;
+} __attribute__((packed)) jmode_t;
+
+typedef struct {
+ __u16 v16;
+} __attribute__((packed)) jint16_t;
+
+struct jffs2_unknown_node
+{
+ /* All start like this */
+ jint16_t magic;
+ jint16_t nodetype;
+ jint32_t totlen; /* So we can skip over nodes we don't grok */
+ jint32_t hdr_crc;
+};
+
+struct jffs2_raw_dirent
+{
+ jint16_t magic;
+ jint16_t nodetype; /* == JFFS2_NODETYPE_DIRENT */
+ jint32_t totlen;
+ jint32_t hdr_crc;
+ jint32_t pino;
+ jint32_t version;
+ jint32_t ino; /* == zero for unlink */
+ jint32_t mctime;
+ __u8 nsize;
+ __u8 type;
+ __u8 unused[2];
+ jint32_t node_crc;
+ jint32_t name_crc;
+ __u8 name[0];
+};
+
+/* The JFFS2 raw inode structure: Used for storage on physical media. */
+/* The uid, gid, atime, mtime and ctime members could be longer, but
+ are left like this for space efficiency. If and when people decide
+ they really need them extended, it's simple enough to add support for
+ a new type of raw node.
+*/
+struct jffs2_raw_inode
+{
+ jint16_t magic; /* A constant magic number. */
+ jint16_t nodetype; /* == JFFS2_NODETYPE_INODE */
+ jint32_t totlen; /* Total length of this node (inc data, etc.) */
+ jint32_t hdr_crc;
+ jint32_t ino; /* Inode number. */
+ jint32_t version; /* Version number. */
+ jmode_t mode; /* The file's type or mode. */
+ jint16_t uid; /* The file's owner. */
+ jint16_t gid; /* The file's group. */
+ jint32_t isize; /* Total resultant size of this inode (used for truncations) */
+ jint32_t atime; /* Last access time. */
+ jint32_t mtime; /* Last modification time. */
+ jint32_t ctime; /* Change time. */
+ jint32_t offset; /* Where to begin to write. */
+ jint32_t csize; /* (Compressed) data size */
+ jint32_t dsize; /* Size of the node's data. (after decompression) */
+ __u8 compr; /* Compression algorithm used */
+ __u8 usercompr; /* Compression algorithm requested by the user */
+ jint16_t flags; /* See JFFS2_INO_FLAG_* */
+ jint32_t data_crc; /* CRC for the (compressed) data. */
+ jint32_t node_crc; /* CRC for the raw inode (excluding data) */
+ __u8 data[0];
+};
+
+struct jffs2_raw_xattr {
+ jint16_t magic;
+ jint16_t nodetype; /* = JFFS2_NODETYPE_XATTR */
+ jint32_t totlen;
+ jint32_t hdr_crc;
+ jint32_t xid; /* XATTR identifier number */
+ jint32_t version;
+ __u8 xprefix;
+ __u8 name_len;
+ jint16_t value_len;
+ jint32_t data_crc;
+ jint32_t node_crc;
+ __u8 data[0];
+} __attribute__((packed));
+
+struct jffs2_raw_xref
+{
+ jint16_t magic;
+ jint16_t nodetype; /* = JFFS2_NODETYPE_XREF */
+ jint32_t totlen;
+ jint32_t hdr_crc;
+ jint32_t ino; /* inode number */
+ jint32_t xid; /* XATTR identifier number */
+ jint32_t xseqno; /* xref sequencial number */
+ jint32_t node_crc;
+} __attribute__((packed));
+
+struct jffs2_raw_summary
+{
+ jint16_t magic;
+ jint16_t nodetype; /* = JFFS2_NODETYPE_SUMMARY */
+ jint32_t totlen;
+ jint32_t hdr_crc;
+ jint32_t sum_num; /* number of sum entries*/
+ jint32_t cln_mkr; /* clean marker size, 0 = no cleanmarker */
+ jint32_t padded; /* sum of the size of padding nodes */
+ jint32_t sum_crc; /* summary information crc */
+ jint32_t node_crc; /* node crc */
+ jint32_t sum[0]; /* inode summary info */
+};
+
+union jffs2_node_union
+{
+ struct jffs2_raw_inode i;
+ struct jffs2_raw_dirent d;
+ struct jffs2_raw_xattr x;
+ struct jffs2_raw_xref r;
+ struct jffs2_raw_summary s;
+ struct jffs2_unknown_node u;
+};
+
+/* Data payload for device nodes. */
+union jffs2_device_node {
+ jint16_t old;
+ jint32_t new;
+};
+
+#endif /* __LINUX_JFFS2_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/joystick.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/joystick.h
new file mode 100644
index 0000000..0cb947f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/joystick.h
@@ -0,0 +1,136 @@
+#ifndef _LINUX_JOYSTICK_H
+#define _LINUX_JOYSTICK_H
+
+/*
+ * Copyright (C) 1996-2000 Vojtech Pavlik
+ *
+ * Sponsored by SuSE
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Should you need to contact me, the author, you can do so either by
+ * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
+ * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
+ */
+
+#include <linux/types.h>
+#include <linux/input.h>
+
+/*
+ * Version
+ */
+
+#define JS_VERSION 0x020100
+
+/*
+ * Types and constants for reading from /dev/js
+ */
+
+#define JS_EVENT_BUTTON 0x01 /* button pressed/released */
+#define JS_EVENT_AXIS 0x02 /* joystick moved */
+#define JS_EVENT_INIT 0x80 /* initial state of device */
+
+struct js_event {
+ __u32 time; /* event timestamp in milliseconds */
+ __s16 value; /* value */
+ __u8 type; /* event type */
+ __u8 number; /* axis/button number */
+};
+
+/*
+ * IOCTL commands for joystick driver
+ */
+
+#define JSIOCGVERSION _IOR('j', 0x01, __u32) /* get driver version */
+
+#define JSIOCGAXES _IOR('j', 0x11, __u8) /* get number of axes */
+#define JSIOCGBUTTONS _IOR('j', 0x12, __u8) /* get number of buttons */
+#define JSIOCGNAME(len) _IOC(_IOC_READ, 'j', 0x13, len) /* get identifier string */
+
+#define JSIOCSCORR _IOW('j', 0x21, struct js_corr) /* set correction values */
+#define JSIOCGCORR _IOR('j', 0x22, struct js_corr) /* get correction values */
+
+#define JSIOCSAXMAP _IOW('j', 0x31, __u8[ABS_MAX + 1]) /* set axis mapping */
+#define JSIOCGAXMAP _IOR('j', 0x32, __u8[ABS_MAX + 1]) /* get axis mapping */
+#define JSIOCSBTNMAP _IOW('j', 0x33, __u16[KEY_MAX - BTN_MISC + 1]) /* set button mapping */
+#define JSIOCGBTNMAP _IOR('j', 0x34, __u16[KEY_MAX - BTN_MISC + 1]) /* get button mapping */
+
+/*
+ * Types and constants for get/set correction
+ */
+
+#define JS_CORR_NONE 0x00 /* returns raw values */
+#define JS_CORR_BROKEN 0x01 /* broken line */
+
+struct js_corr {
+ __s32 coef[8];
+ __s16 prec;
+ __u16 type;
+};
+
+/*
+ * v0.x compatibility definitions
+ */
+
+#define JS_RETURN sizeof(struct JS_DATA_TYPE)
+#define JS_TRUE 1
+#define JS_FALSE 0
+#define JS_X_0 0x01
+#define JS_Y_0 0x02
+#define JS_X_1 0x04
+#define JS_Y_1 0x08
+#define JS_MAX 2
+
+#define JS_DEF_TIMEOUT 0x1300
+#define JS_DEF_CORR 0
+#define JS_DEF_TIMELIMIT 10L
+
+#define JS_SET_CAL 1
+#define JS_GET_CAL 2
+#define JS_SET_TIMEOUT 3
+#define JS_GET_TIMEOUT 4
+#define JS_SET_TIMELIMIT 5
+#define JS_GET_TIMELIMIT 6
+#define JS_GET_ALL 7
+#define JS_SET_ALL 8
+
+struct JS_DATA_TYPE {
+ __s32 buttons;
+ __s32 x;
+ __s32 y;
+};
+
+struct JS_DATA_SAVE_TYPE_32 {
+ __s32 JS_TIMEOUT;
+ __s32 BUSY;
+ __s32 JS_EXPIRETIME;
+ __s32 JS_TIMELIMIT;
+ struct JS_DATA_TYPE JS_SAVE;
+ struct JS_DATA_TYPE JS_CORR;
+};
+
+struct JS_DATA_SAVE_TYPE_64 {
+ __s32 JS_TIMEOUT;
+ __s32 BUSY;
+ __s64 JS_EXPIRETIME;
+ __s64 JS_TIMELIMIT;
+ struct JS_DATA_TYPE JS_SAVE;
+ struct JS_DATA_TYPE JS_CORR;
+};
+
+
+#endif /* _LINUX_JOYSTICK_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/kd.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/kd.h
new file mode 100644
index 0000000..15c8122
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/kd.h
@@ -0,0 +1,182 @@
+#ifndef _LINUX_KD_H
+#define _LINUX_KD_H
+#include <linux/types.h>
+
+
+/* 0x4B is 'K', to avoid collision with termios and vt */
+
+#define GIO_FONT 0x4B60 /* gets font in expanded form */
+#define PIO_FONT 0x4B61 /* use font in expanded form */
+
+#define GIO_FONTX 0x4B6B /* get font using struct consolefontdesc */
+#define PIO_FONTX 0x4B6C /* set font using struct consolefontdesc */
+struct consolefontdesc {
+ unsigned short charcount; /* characters in font (256 or 512) */
+ unsigned short charheight; /* scan lines per character (1-32) */
+ char *chardata; /* font data in expanded form */
+};
+
+#define PIO_FONTRESET 0x4B6D /* reset to default font */
+
+#define GIO_CMAP 0x4B70 /* gets colour palette on VGA+ */
+#define PIO_CMAP 0x4B71 /* sets colour palette on VGA+ */
+
+#define KIOCSOUND 0x4B2F /* start sound generation (0 for off) */
+#define KDMKTONE 0x4B30 /* generate tone */
+
+#define KDGETLED 0x4B31 /* return current led state */
+#define KDSETLED 0x4B32 /* set led state [lights, not flags] */
+#define LED_SCR 0x01 /* scroll lock led */
+#define LED_NUM 0x02 /* num lock led */
+#define LED_CAP 0x04 /* caps lock led */
+
+#define KDGKBTYPE 0x4B33 /* get keyboard type */
+#define KB_84 0x01
+#define KB_101 0x02 /* this is what we always answer */
+#define KB_OTHER 0x03
+
+#define KDADDIO 0x4B34 /* add i/o port as valid */
+#define KDDELIO 0x4B35 /* del i/o port as valid */
+#define KDENABIO 0x4B36 /* enable i/o to video board */
+#define KDDISABIO 0x4B37 /* disable i/o to video board */
+
+#define KDSETMODE 0x4B3A /* set text/graphics mode */
+#define KD_TEXT 0x00
+#define KD_GRAPHICS 0x01
+#define KD_TEXT0 0x02 /* obsolete */
+#define KD_TEXT1 0x03 /* obsolete */
+#define KDGETMODE 0x4B3B /* get current mode */
+
+#define KDMAPDISP 0x4B3C /* map display into address space */
+#define KDUNMAPDISP 0x4B3D /* unmap display from address space */
+
+typedef char scrnmap_t;
+#define E_TABSZ 256
+#define GIO_SCRNMAP 0x4B40 /* get screen mapping from kernel */
+#define PIO_SCRNMAP 0x4B41 /* put screen mapping table in kernel */
+#define GIO_UNISCRNMAP 0x4B69 /* get full Unicode screen mapping */
+#define PIO_UNISCRNMAP 0x4B6A /* set full Unicode screen mapping */
+
+#define GIO_UNIMAP 0x4B66 /* get unicode-to-font mapping from kernel */
+struct unipair {
+ unsigned short unicode;
+ unsigned short fontpos;
+};
+struct unimapdesc {
+ unsigned short entry_ct;
+ struct unipair *entries;
+};
+#define PIO_UNIMAP 0x4B67 /* put unicode-to-font mapping in kernel */
+#define PIO_UNIMAPCLR 0x4B68 /* clear table, possibly advise hash algorithm */
+struct unimapinit {
+ unsigned short advised_hashsize; /* 0 if no opinion */
+ unsigned short advised_hashstep; /* 0 if no opinion */
+ unsigned short advised_hashlevel; /* 0 if no opinion */
+};
+
+#define UNI_DIRECT_BASE 0xF000 /* start of Direct Font Region */
+#define UNI_DIRECT_MASK 0x01FF /* Direct Font Region bitmask */
+
+#define K_RAW 0x00
+#define K_XLATE 0x01
+#define K_MEDIUMRAW 0x02
+#define K_UNICODE 0x03
+#define KDGKBMODE 0x4B44 /* gets current keyboard mode */
+#define KDSKBMODE 0x4B45 /* sets current keyboard mode */
+
+#define K_METABIT 0x03
+#define K_ESCPREFIX 0x04
+#define KDGKBMETA 0x4B62 /* gets meta key handling mode */
+#define KDSKBMETA 0x4B63 /* sets meta key handling mode */
+
+#define K_SCROLLLOCK 0x01
+#define K_NUMLOCK 0x02
+#define K_CAPSLOCK 0x04
+#define KDGKBLED 0x4B64 /* get led flags (not lights) */
+#define KDSKBLED 0x4B65 /* set led flags (not lights) */
+
+struct kbentry {
+ unsigned char kb_table;
+ unsigned char kb_index;
+ unsigned short kb_value;
+};
+#define K_NORMTAB 0x00
+#define K_SHIFTTAB 0x01
+#define K_ALTTAB 0x02
+#define K_ALTSHIFTTAB 0x03
+
+#define KDGKBENT 0x4B46 /* gets one entry in translation table */
+#define KDSKBENT 0x4B47 /* sets one entry in translation table */
+
+struct kbsentry {
+ unsigned char kb_func;
+ unsigned char kb_string[512];
+};
+#define KDGKBSENT 0x4B48 /* gets one function key string entry */
+#define KDSKBSENT 0x4B49 /* sets one function key string entry */
+
+struct kbdiacr {
+ unsigned char diacr, base, result;
+};
+struct kbdiacrs {
+ unsigned int kb_cnt; /* number of entries in following array */
+ struct kbdiacr kbdiacr[256]; /* MAX_DIACR from keyboard.h */
+};
+#define KDGKBDIACR 0x4B4A /* read kernel accent table */
+#define KDSKBDIACR 0x4B4B /* write kernel accent table */
+
+struct kbdiacruc {
+ unsigned int diacr, base, result;
+};
+struct kbdiacrsuc {
+ unsigned int kb_cnt; /* number of entries in following array */
+ struct kbdiacruc kbdiacruc[256]; /* MAX_DIACR from keyboard.h */
+};
+#define KDGKBDIACRUC 0x4BFA /* read kernel accent table - UCS */
+#define KDSKBDIACRUC 0x4BFB /* write kernel accent table - UCS */
+
+struct kbkeycode {
+ unsigned int scancode, keycode;
+};
+#define KDGETKEYCODE 0x4B4C /* read kernel keycode table entry */
+#define KDSETKEYCODE 0x4B4D /* write kernel keycode table entry */
+
+#define KDSIGACCEPT 0x4B4E /* accept kbd generated signals */
+
+struct kbd_repeat {
+ int delay; /* in msec; <= 0: don't change */
+ int period; /* in msec; <= 0: don't change */
+ /* earlier this field was misnamed "rate" */
+};
+
+#define KDKBDREP 0x4B52 /* set keyboard delay/repeat rate;
+ * actually used values are returned */
+
+#define KDFONTOP 0x4B72 /* font operations */
+
+struct console_font_op {
+ unsigned int op; /* operation code KD_FONT_OP_* */
+ unsigned int flags; /* KD_FONT_FLAG_* */
+ unsigned int width, height; /* font size */
+ unsigned int charcount;
+ unsigned char *data; /* font data with height fixed to 32 */
+};
+
+struct console_font {
+ unsigned int width, height; /* font size */
+ unsigned int charcount;
+ unsigned char *data; /* font data with height fixed to 32 */
+};
+
+#define KD_FONT_OP_SET 0 /* Set font */
+#define KD_FONT_OP_GET 1 /* Get font */
+#define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default, data points to name / NULL */
+#define KD_FONT_OP_COPY 3 /* Copy from another console */
+
+#define KD_FONT_FLAG_DONT_RECALC 1 /* Don't recalculate hw charcell size [compat] */
+
+/* note: 0x4B00-0x4B4E all have had a value at some time;
+ don't reuse for the time being */
+/* note: 0x4B60-0x4B6D, 0x4B70-0x4B72 used above */
+
+#endif /* _LINUX_KD_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/kdev_t.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/kdev_t.h
new file mode 100644
index 0000000..af5551d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/kdev_t.h
@@ -0,0 +1,11 @@
+#ifndef _LINUX_KDEV_T_H
+#define _LINUX_KDEV_T_H
+
+/*
+Some programs want their definitions of MAJOR and MINOR and MKDEV
+from the kernel sources. These must be the externally visible ones.
+*/
+#define MAJOR(dev) ((dev)>>8)
+#define MINOR(dev) ((dev) & 0xff)
+#define MKDEV(ma,mi) ((ma)<<8 | (mi))
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/kernel.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/kernel.h
new file mode 100644
index 0000000..299702e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/kernel.h
@@ -0,0 +1,51 @@
+#ifndef _LINUX_KERNEL_H
+#define _LINUX_KERNEL_H
+
+/*
+ * 'kernel.h' contains some often-used function prototypes etc
+ */
+
+
+#define SI_LOAD_SHIFT 16
+struct sysinfo {
+ long uptime; /* Seconds since boot */
+ unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
+ unsigned long totalram; /* Total usable main memory size */
+ unsigned long freeram; /* Available memory size */
+ unsigned long sharedram; /* Amount of shared memory */
+ unsigned long bufferram; /* Memory used by buffers */
+ unsigned long totalswap; /* Total swap space size */
+ unsigned long freeswap; /* swap space still available */
+ unsigned short procs; /* Number of current processes */
+ unsigned short pad; /* explicit padding for m68k */
+ unsigned long totalhigh; /* Total high memory size */
+ unsigned long freehigh; /* Available high memory size */
+ unsigned int mem_unit; /* Memory unit size in bytes */
+ char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */
+};
+
+/* Force a compilation error if condition is true */
+#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
+
+/* Force a compilation error if condition is true, but also produce a
+ result (of value 0 and type size_t), so the expression can be used
+ e.g. in a structure initializer (or where-ever else comma expressions
+ aren't permitted). */
+#define BUILD_BUG_ON_ZERO(e) (sizeof(char[1 - 2 * !!(e)]) - 1)
+
+/* Trap pasters of __FUNCTION__ at compile-time */
+#define __FUNCTION__ (__func__)
+
+/* This helps us to avoid #ifdef CONFIG_NUMA */
+#ifdef CONFIG_NUMA
+#define NUMA_BUILD 1
+#else
+#define NUMA_BUILD 0
+#endif
+
+/* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */
+#ifdef CONFIG_FTRACE_MCOUNT_RECORD
+# define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/kernelcapi.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/kernelcapi.h
new file mode 100644
index 0000000..92f6b42
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/kernelcapi.h
@@ -0,0 +1,47 @@
+/*
+ * $Id: kernelcapi.h,v 1.8.6.2 2001/02/07 11:31:31 kai Exp $
+ *
+ * Kernel CAPI 2.0 Interface for Linux
+ *
+ * (c) Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
+ *
+ */
+
+#ifndef __KERNELCAPI_H__
+#define __KERNELCAPI_H__
+
+#define CAPI_MAXAPPL 240 /* maximum number of applications */
+#define CAPI_MAXCONTR 32 /* maximum number of controller */
+#define CAPI_MAXDATAWINDOW 8
+
+
+typedef struct kcapi_flagdef {
+ int contr;
+ int flag;
+} kcapi_flagdef;
+
+typedef struct kcapi_carddef {
+ char driver[32];
+ unsigned int port;
+ unsigned irq;
+ unsigned int membase;
+ int cardnr;
+} kcapi_carddef;
+
+/* new ioctls >= 10 */
+#define KCAPI_CMD_TRACE 10
+#define KCAPI_CMD_ADDCARD 11 /* OBSOLETE */
+
+/*
+ * flag > 2 => trace also data
+ * flag & 1 => show trace
+ */
+#define KCAPI_TRACE_OFF 0
+#define KCAPI_TRACE_SHORT_NO_DATA 1
+#define KCAPI_TRACE_FULL_NO_DATA 2
+#define KCAPI_TRACE_SHORT 3
+#define KCAPI_TRACE_FULL 4
+
+
+
+#endif /* __KERNELCAPI_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/keyboard.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/keyboard.h
new file mode 100644
index 0000000..38e399f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/keyboard.h
@@ -0,0 +1,442 @@
+#ifndef __LINUX_KEYBOARD_H
+#define __LINUX_KEYBOARD_H
+
+#include <linux/wait.h>
+
+#define KG_SHIFT 0
+#define KG_CTRL 2
+#define KG_ALT 3
+#define KG_ALTGR 1
+#define KG_SHIFTL 4
+#define KG_KANASHIFT 4
+#define KG_SHIFTR 5
+#define KG_CTRLL 6
+#define KG_CTRLR 7
+#define KG_CAPSSHIFT 8
+
+#define NR_SHIFT 9
+
+#define NR_KEYS 256
+#define MAX_NR_KEYMAPS 256
+/* This means 128Kb if all keymaps are allocated. Only the superuser
+ may increase the number of keymaps beyond MAX_NR_OF_USER_KEYMAPS. */
+#define MAX_NR_OF_USER_KEYMAPS 256 /* should be at least 7 */
+
+
+#define MAX_NR_FUNC 256 /* max nr of strings assigned to keys */
+
+#define KT_LATIN 0 /* we depend on this being zero */
+#define KT_LETTER 11 /* symbol that can be acted upon by CapsLock */
+#define KT_FN 1
+#define KT_SPEC 2
+#define KT_PAD 3
+#define KT_DEAD 4
+#define KT_CONS 5
+#define KT_CUR 6
+#define KT_SHIFT 7
+#define KT_META 8
+#define KT_ASCII 9
+#define KT_LOCK 10
+#define KT_SLOCK 12
+#define KT_BRL 14
+
+#define K(t,v) (((t)<<8)|(v))
+#define KTYP(x) ((x) >> 8)
+#define KVAL(x) ((x) & 0xff)
+
+#define K_F1 K(KT_FN,0)
+#define K_F2 K(KT_FN,1)
+#define K_F3 K(KT_FN,2)
+#define K_F4 K(KT_FN,3)
+#define K_F5 K(KT_FN,4)
+#define K_F6 K(KT_FN,5)
+#define K_F7 K(KT_FN,6)
+#define K_F8 K(KT_FN,7)
+#define K_F9 K(KT_FN,8)
+#define K_F10 K(KT_FN,9)
+#define K_F11 K(KT_FN,10)
+#define K_F12 K(KT_FN,11)
+#define K_F13 K(KT_FN,12)
+#define K_F14 K(KT_FN,13)
+#define K_F15 K(KT_FN,14)
+#define K_F16 K(KT_FN,15)
+#define K_F17 K(KT_FN,16)
+#define K_F18 K(KT_FN,17)
+#define K_F19 K(KT_FN,18)
+#define K_F20 K(KT_FN,19)
+#define K_FIND K(KT_FN,20)
+#define K_INSERT K(KT_FN,21)
+#define K_REMOVE K(KT_FN,22)
+#define K_SELECT K(KT_FN,23)
+#define K_PGUP K(KT_FN,24) /* PGUP is a synonym for PRIOR */
+#define K_PGDN K(KT_FN,25) /* PGDN is a synonym for NEXT */
+#define K_MACRO K(KT_FN,26)
+#define K_HELP K(KT_FN,27)
+#define K_DO K(KT_FN,28)
+#define K_PAUSE K(KT_FN,29)
+#define K_F21 K(KT_FN,30)
+#define K_F22 K(KT_FN,31)
+#define K_F23 K(KT_FN,32)
+#define K_F24 K(KT_FN,33)
+#define K_F25 K(KT_FN,34)
+#define K_F26 K(KT_FN,35)
+#define K_F27 K(KT_FN,36)
+#define K_F28 K(KT_FN,37)
+#define K_F29 K(KT_FN,38)
+#define K_F30 K(KT_FN,39)
+#define K_F31 K(KT_FN,40)
+#define K_F32 K(KT_FN,41)
+#define K_F33 K(KT_FN,42)
+#define K_F34 K(KT_FN,43)
+#define K_F35 K(KT_FN,44)
+#define K_F36 K(KT_FN,45)
+#define K_F37 K(KT_FN,46)
+#define K_F38 K(KT_FN,47)
+#define K_F39 K(KT_FN,48)
+#define K_F40 K(KT_FN,49)
+#define K_F41 K(KT_FN,50)
+#define K_F42 K(KT_FN,51)
+#define K_F43 K(KT_FN,52)
+#define K_F44 K(KT_FN,53)
+#define K_F45 K(KT_FN,54)
+#define K_F46 K(KT_FN,55)
+#define K_F47 K(KT_FN,56)
+#define K_F48 K(KT_FN,57)
+#define K_F49 K(KT_FN,58)
+#define K_F50 K(KT_FN,59)
+#define K_F51 K(KT_FN,60)
+#define K_F52 K(KT_FN,61)
+#define K_F53 K(KT_FN,62)
+#define K_F54 K(KT_FN,63)
+#define K_F55 K(KT_FN,64)
+#define K_F56 K(KT_FN,65)
+#define K_F57 K(KT_FN,66)
+#define K_F58 K(KT_FN,67)
+#define K_F59 K(KT_FN,68)
+#define K_F60 K(KT_FN,69)
+#define K_F61 K(KT_FN,70)
+#define K_F62 K(KT_FN,71)
+#define K_F63 K(KT_FN,72)
+#define K_F64 K(KT_FN,73)
+#define K_F65 K(KT_FN,74)
+#define K_F66 K(KT_FN,75)
+#define K_F67 K(KT_FN,76)
+#define K_F68 K(KT_FN,77)
+#define K_F69 K(KT_FN,78)
+#define K_F70 K(KT_FN,79)
+#define K_F71 K(KT_FN,80)
+#define K_F72 K(KT_FN,81)
+#define K_F73 K(KT_FN,82)
+#define K_F74 K(KT_FN,83)
+#define K_F75 K(KT_FN,84)
+#define K_F76 K(KT_FN,85)
+#define K_F77 K(KT_FN,86)
+#define K_F78 K(KT_FN,87)
+#define K_F79 K(KT_FN,88)
+#define K_F80 K(KT_FN,89)
+#define K_F81 K(KT_FN,90)
+#define K_F82 K(KT_FN,91)
+#define K_F83 K(KT_FN,92)
+#define K_F84 K(KT_FN,93)
+#define K_F85 K(KT_FN,94)
+#define K_F86 K(KT_FN,95)
+#define K_F87 K(KT_FN,96)
+#define K_F88 K(KT_FN,97)
+#define K_F89 K(KT_FN,98)
+#define K_F90 K(KT_FN,99)
+#define K_F91 K(KT_FN,100)
+#define K_F92 K(KT_FN,101)
+#define K_F93 K(KT_FN,102)
+#define K_F94 K(KT_FN,103)
+#define K_F95 K(KT_FN,104)
+#define K_F96 K(KT_FN,105)
+#define K_F97 K(KT_FN,106)
+#define K_F98 K(KT_FN,107)
+#define K_F99 K(KT_FN,108)
+#define K_F100 K(KT_FN,109)
+#define K_F101 K(KT_FN,110)
+#define K_F102 K(KT_FN,111)
+#define K_F103 K(KT_FN,112)
+#define K_F104 K(KT_FN,113)
+#define K_F105 K(KT_FN,114)
+#define K_F106 K(KT_FN,115)
+#define K_F107 K(KT_FN,116)
+#define K_F108 K(KT_FN,117)
+#define K_F109 K(KT_FN,118)
+#define K_F110 K(KT_FN,119)
+#define K_F111 K(KT_FN,120)
+#define K_F112 K(KT_FN,121)
+#define K_F113 K(KT_FN,122)
+#define K_F114 K(KT_FN,123)
+#define K_F115 K(KT_FN,124)
+#define K_F116 K(KT_FN,125)
+#define K_F117 K(KT_FN,126)
+#define K_F118 K(KT_FN,127)
+#define K_F119 K(KT_FN,128)
+#define K_F120 K(KT_FN,129)
+#define K_F121 K(KT_FN,130)
+#define K_F122 K(KT_FN,131)
+#define K_F123 K(KT_FN,132)
+#define K_F124 K(KT_FN,133)
+#define K_F125 K(KT_FN,134)
+#define K_F126 K(KT_FN,135)
+#define K_F127 K(KT_FN,136)
+#define K_F128 K(KT_FN,137)
+#define K_F129 K(KT_FN,138)
+#define K_F130 K(KT_FN,139)
+#define K_F131 K(KT_FN,140)
+#define K_F132 K(KT_FN,141)
+#define K_F133 K(KT_FN,142)
+#define K_F134 K(KT_FN,143)
+#define K_F135 K(KT_FN,144)
+#define K_F136 K(KT_FN,145)
+#define K_F137 K(KT_FN,146)
+#define K_F138 K(KT_FN,147)
+#define K_F139 K(KT_FN,148)
+#define K_F140 K(KT_FN,149)
+#define K_F141 K(KT_FN,150)
+#define K_F142 K(KT_FN,151)
+#define K_F143 K(KT_FN,152)
+#define K_F144 K(KT_FN,153)
+#define K_F145 K(KT_FN,154)
+#define K_F146 K(KT_FN,155)
+#define K_F147 K(KT_FN,156)
+#define K_F148 K(KT_FN,157)
+#define K_F149 K(KT_FN,158)
+#define K_F150 K(KT_FN,159)
+#define K_F151 K(KT_FN,160)
+#define K_F152 K(KT_FN,161)
+#define K_F153 K(KT_FN,162)
+#define K_F154 K(KT_FN,163)
+#define K_F155 K(KT_FN,164)
+#define K_F156 K(KT_FN,165)
+#define K_F157 K(KT_FN,166)
+#define K_F158 K(KT_FN,167)
+#define K_F159 K(KT_FN,168)
+#define K_F160 K(KT_FN,169)
+#define K_F161 K(KT_FN,170)
+#define K_F162 K(KT_FN,171)
+#define K_F163 K(KT_FN,172)
+#define K_F164 K(KT_FN,173)
+#define K_F165 K(KT_FN,174)
+#define K_F166 K(KT_FN,175)
+#define K_F167 K(KT_FN,176)
+#define K_F168 K(KT_FN,177)
+#define K_F169 K(KT_FN,178)
+#define K_F170 K(KT_FN,179)
+#define K_F171 K(KT_FN,180)
+#define K_F172 K(KT_FN,181)
+#define K_F173 K(KT_FN,182)
+#define K_F174 K(KT_FN,183)
+#define K_F175 K(KT_FN,184)
+#define K_F176 K(KT_FN,185)
+#define K_F177 K(KT_FN,186)
+#define K_F178 K(KT_FN,187)
+#define K_F179 K(KT_FN,188)
+#define K_F180 K(KT_FN,189)
+#define K_F181 K(KT_FN,190)
+#define K_F182 K(KT_FN,191)
+#define K_F183 K(KT_FN,192)
+#define K_F184 K(KT_FN,193)
+#define K_F185 K(KT_FN,194)
+#define K_F186 K(KT_FN,195)
+#define K_F187 K(KT_FN,196)
+#define K_F188 K(KT_FN,197)
+#define K_F189 K(KT_FN,198)
+#define K_F190 K(KT_FN,199)
+#define K_F191 K(KT_FN,200)
+#define K_F192 K(KT_FN,201)
+#define K_F193 K(KT_FN,202)
+#define K_F194 K(KT_FN,203)
+#define K_F195 K(KT_FN,204)
+#define K_F196 K(KT_FN,205)
+#define K_F197 K(KT_FN,206)
+#define K_F198 K(KT_FN,207)
+#define K_F199 K(KT_FN,208)
+#define K_F200 K(KT_FN,209)
+#define K_F201 K(KT_FN,210)
+#define K_F202 K(KT_FN,211)
+#define K_F203 K(KT_FN,212)
+#define K_F204 K(KT_FN,213)
+#define K_F205 K(KT_FN,214)
+#define K_F206 K(KT_FN,215)
+#define K_F207 K(KT_FN,216)
+#define K_F208 K(KT_FN,217)
+#define K_F209 K(KT_FN,218)
+#define K_F210 K(KT_FN,219)
+#define K_F211 K(KT_FN,220)
+#define K_F212 K(KT_FN,221)
+#define K_F213 K(KT_FN,222)
+#define K_F214 K(KT_FN,223)
+#define K_F215 K(KT_FN,224)
+#define K_F216 K(KT_FN,225)
+#define K_F217 K(KT_FN,226)
+#define K_F218 K(KT_FN,227)
+#define K_F219 K(KT_FN,228)
+#define K_F220 K(KT_FN,229)
+#define K_F221 K(KT_FN,230)
+#define K_F222 K(KT_FN,231)
+#define K_F223 K(KT_FN,232)
+#define K_F224 K(KT_FN,233)
+#define K_F225 K(KT_FN,234)
+#define K_F226 K(KT_FN,235)
+#define K_F227 K(KT_FN,236)
+#define K_F228 K(KT_FN,237)
+#define K_F229 K(KT_FN,238)
+#define K_F230 K(KT_FN,239)
+#define K_F231 K(KT_FN,240)
+#define K_F232 K(KT_FN,241)
+#define K_F233 K(KT_FN,242)
+#define K_F234 K(KT_FN,243)
+#define K_F235 K(KT_FN,244)
+#define K_F236 K(KT_FN,245)
+#define K_F237 K(KT_FN,246)
+#define K_F238 K(KT_FN,247)
+#define K_F239 K(KT_FN,248)
+#define K_F240 K(KT_FN,249)
+#define K_F241 K(KT_FN,250)
+#define K_F242 K(KT_FN,251)
+#define K_F243 K(KT_FN,252)
+#define K_F244 K(KT_FN,253)
+#define K_F245 K(KT_FN,254)
+#define K_UNDO K(KT_FN,255)
+
+
+#define K_HOLE K(KT_SPEC,0)
+#define K_ENTER K(KT_SPEC,1)
+#define K_SH_REGS K(KT_SPEC,2)
+#define K_SH_MEM K(KT_SPEC,3)
+#define K_SH_STAT K(KT_SPEC,4)
+#define K_BREAK K(KT_SPEC,5)
+#define K_CONS K(KT_SPEC,6)
+#define K_CAPS K(KT_SPEC,7)
+#define K_NUM K(KT_SPEC,8)
+#define K_HOLD K(KT_SPEC,9)
+#define K_SCROLLFORW K(KT_SPEC,10)
+#define K_SCROLLBACK K(KT_SPEC,11)
+#define K_BOOT K(KT_SPEC,12)
+#define K_CAPSON K(KT_SPEC,13)
+#define K_COMPOSE K(KT_SPEC,14)
+#define K_SAK K(KT_SPEC,15)
+#define K_DECRCONSOLE K(KT_SPEC,16)
+#define K_INCRCONSOLE K(KT_SPEC,17)
+#define K_SPAWNCONSOLE K(KT_SPEC,18)
+#define K_BARENUMLOCK K(KT_SPEC,19)
+
+#define K_ALLOCATED K(KT_SPEC,126) /* dynamically allocated keymap */
+#define K_NOSUCHMAP K(KT_SPEC,127) /* returned by KDGKBENT */
+
+#define K_P0 K(KT_PAD,0)
+#define K_P1 K(KT_PAD,1)
+#define K_P2 K(KT_PAD,2)
+#define K_P3 K(KT_PAD,3)
+#define K_P4 K(KT_PAD,4)
+#define K_P5 K(KT_PAD,5)
+#define K_P6 K(KT_PAD,6)
+#define K_P7 K(KT_PAD,7)
+#define K_P8 K(KT_PAD,8)
+#define K_P9 K(KT_PAD,9)
+#define K_PPLUS K(KT_PAD,10) /* key-pad plus */
+#define K_PMINUS K(KT_PAD,11) /* key-pad minus */
+#define K_PSTAR K(KT_PAD,12) /* key-pad asterisk (star) */
+#define K_PSLASH K(KT_PAD,13) /* key-pad slash */
+#define K_PENTER K(KT_PAD,14) /* key-pad enter */
+#define K_PCOMMA K(KT_PAD,15) /* key-pad comma: kludge... */
+#define K_PDOT K(KT_PAD,16) /* key-pad dot (period): kludge... */
+#define K_PPLUSMINUS K(KT_PAD,17) /* key-pad plus/minus */
+#define K_PPARENL K(KT_PAD,18) /* key-pad left parenthesis */
+#define K_PPARENR K(KT_PAD,19) /* key-pad right parenthesis */
+
+#define NR_PAD 20
+
+#define K_DGRAVE K(KT_DEAD,0)
+#define K_DACUTE K(KT_DEAD,1)
+#define K_DCIRCM K(KT_DEAD,2)
+#define K_DTILDE K(KT_DEAD,3)
+#define K_DDIERE K(KT_DEAD,4)
+#define K_DCEDIL K(KT_DEAD,5)
+
+#define NR_DEAD 6
+
+#define K_DOWN K(KT_CUR,0)
+#define K_LEFT K(KT_CUR,1)
+#define K_RIGHT K(KT_CUR,2)
+#define K_UP K(KT_CUR,3)
+
+#define K_SHIFT K(KT_SHIFT,KG_SHIFT)
+#define K_CTRL K(KT_SHIFT,KG_CTRL)
+#define K_ALT K(KT_SHIFT,KG_ALT)
+#define K_ALTGR K(KT_SHIFT,KG_ALTGR)
+#define K_SHIFTL K(KT_SHIFT,KG_SHIFTL)
+#define K_SHIFTR K(KT_SHIFT,KG_SHIFTR)
+#define K_CTRLL K(KT_SHIFT,KG_CTRLL)
+#define K_CTRLR K(KT_SHIFT,KG_CTRLR)
+#define K_CAPSSHIFT K(KT_SHIFT,KG_CAPSSHIFT)
+
+#define K_ASC0 K(KT_ASCII,0)
+#define K_ASC1 K(KT_ASCII,1)
+#define K_ASC2 K(KT_ASCII,2)
+#define K_ASC3 K(KT_ASCII,3)
+#define K_ASC4 K(KT_ASCII,4)
+#define K_ASC5 K(KT_ASCII,5)
+#define K_ASC6 K(KT_ASCII,6)
+#define K_ASC7 K(KT_ASCII,7)
+#define K_ASC8 K(KT_ASCII,8)
+#define K_ASC9 K(KT_ASCII,9)
+#define K_HEX0 K(KT_ASCII,10)
+#define K_HEX1 K(KT_ASCII,11)
+#define K_HEX2 K(KT_ASCII,12)
+#define K_HEX3 K(KT_ASCII,13)
+#define K_HEX4 K(KT_ASCII,14)
+#define K_HEX5 K(KT_ASCII,15)
+#define K_HEX6 K(KT_ASCII,16)
+#define K_HEX7 K(KT_ASCII,17)
+#define K_HEX8 K(KT_ASCII,18)
+#define K_HEX9 K(KT_ASCII,19)
+#define K_HEXa K(KT_ASCII,20)
+#define K_HEXb K(KT_ASCII,21)
+#define K_HEXc K(KT_ASCII,22)
+#define K_HEXd K(KT_ASCII,23)
+#define K_HEXe K(KT_ASCII,24)
+#define K_HEXf K(KT_ASCII,25)
+
+#define NR_ASCII 26
+
+#define K_SHIFTLOCK K(KT_LOCK,KG_SHIFT)
+#define K_CTRLLOCK K(KT_LOCK,KG_CTRL)
+#define K_ALTLOCK K(KT_LOCK,KG_ALT)
+#define K_ALTGRLOCK K(KT_LOCK,KG_ALTGR)
+#define K_SHIFTLLOCK K(KT_LOCK,KG_SHIFTL)
+#define K_SHIFTRLOCK K(KT_LOCK,KG_SHIFTR)
+#define K_CTRLLLOCK K(KT_LOCK,KG_CTRLL)
+#define K_CTRLRLOCK K(KT_LOCK,KG_CTRLR)
+#define K_CAPSSHIFTLOCK K(KT_LOCK,KG_CAPSSHIFT)
+
+#define K_SHIFT_SLOCK K(KT_SLOCK,KG_SHIFT)
+#define K_CTRL_SLOCK K(KT_SLOCK,KG_CTRL)
+#define K_ALT_SLOCK K(KT_SLOCK,KG_ALT)
+#define K_ALTGR_SLOCK K(KT_SLOCK,KG_ALTGR)
+#define K_SHIFTL_SLOCK K(KT_SLOCK,KG_SHIFTL)
+#define K_SHIFTR_SLOCK K(KT_SLOCK,KG_SHIFTR)
+#define K_CTRLL_SLOCK K(KT_SLOCK,KG_CTRLL)
+#define K_CTRLR_SLOCK K(KT_SLOCK,KG_CTRLR)
+#define K_CAPSSHIFT_SLOCK K(KT_SLOCK,KG_CAPSSHIFT)
+
+#define NR_LOCK 9
+
+#define K_BRL_BLANK K(KT_BRL, 0)
+#define K_BRL_DOT1 K(KT_BRL, 1)
+#define K_BRL_DOT2 K(KT_BRL, 2)
+#define K_BRL_DOT3 K(KT_BRL, 3)
+#define K_BRL_DOT4 K(KT_BRL, 4)
+#define K_BRL_DOT5 K(KT_BRL, 5)
+#define K_BRL_DOT6 K(KT_BRL, 6)
+#define K_BRL_DOT7 K(KT_BRL, 7)
+#define K_BRL_DOT8 K(KT_BRL, 8)
+#define K_BRL_DOT9 K(KT_BRL, 9)
+#define K_BRL_DOT10 K(KT_BRL, 10)
+
+#define NR_BRL 11
+
+#define MAX_DIACR 256
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/keyctl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/keyctl.h
new file mode 100644
index 0000000..c0688eb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/keyctl.h
@@ -0,0 +1,56 @@
+/* keyctl.h: keyctl command IDs
+ *
+ * Copyright (C) 2004, 2008 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_KEYCTL_H
+#define _LINUX_KEYCTL_H
+
+/* special process keyring shortcut IDs */
+#define KEY_SPEC_THREAD_KEYRING -1 /* - key ID for thread-specific keyring */
+#define KEY_SPEC_PROCESS_KEYRING -2 /* - key ID for process-specific keyring */
+#define KEY_SPEC_SESSION_KEYRING -3 /* - key ID for session-specific keyring */
+#define KEY_SPEC_USER_KEYRING -4 /* - key ID for UID-specific keyring */
+#define KEY_SPEC_USER_SESSION_KEYRING -5 /* - key ID for UID-session keyring */
+#define KEY_SPEC_GROUP_KEYRING -6 /* - key ID for GID-specific keyring */
+#define KEY_SPEC_REQKEY_AUTH_KEY -7 /* - key ID for assumed request_key auth key */
+#define KEY_SPEC_REQUESTOR_KEYRING -8 /* - key ID for request_key() dest keyring */
+
+/* request-key default keyrings */
+#define KEY_REQKEY_DEFL_NO_CHANGE -1
+#define KEY_REQKEY_DEFL_DEFAULT 0
+#define KEY_REQKEY_DEFL_THREAD_KEYRING 1
+#define KEY_REQKEY_DEFL_PROCESS_KEYRING 2
+#define KEY_REQKEY_DEFL_SESSION_KEYRING 3
+#define KEY_REQKEY_DEFL_USER_KEYRING 4
+#define KEY_REQKEY_DEFL_USER_SESSION_KEYRING 5
+#define KEY_REQKEY_DEFL_GROUP_KEYRING 6
+#define KEY_REQKEY_DEFL_REQUESTOR_KEYRING 7
+
+/* keyctl commands */
+#define KEYCTL_GET_KEYRING_ID 0 /* ask for a keyring's ID */
+#define KEYCTL_JOIN_SESSION_KEYRING 1 /* join or start named session keyring */
+#define KEYCTL_UPDATE 2 /* update a key */
+#define KEYCTL_REVOKE 3 /* revoke a key */
+#define KEYCTL_CHOWN 4 /* set ownership of a key */
+#define KEYCTL_SETPERM 5 /* set perms on a key */
+#define KEYCTL_DESCRIBE 6 /* describe a key */
+#define KEYCTL_CLEAR 7 /* clear contents of a keyring */
+#define KEYCTL_LINK 8 /* link a key into a keyring */
+#define KEYCTL_UNLINK 9 /* unlink a key from a keyring */
+#define KEYCTL_SEARCH 10 /* search for a key in a keyring */
+#define KEYCTL_READ 11 /* read a key or keyring's contents */
+#define KEYCTL_INSTANTIATE 12 /* instantiate a partially constructed key */
+#define KEYCTL_NEGATE 13 /* negate a partially constructed key */
+#define KEYCTL_SET_REQKEY_KEYRING 14 /* set default request-key keyring */
+#define KEYCTL_SET_TIMEOUT 15 /* set key timeout */
+#define KEYCTL_ASSUME_AUTHORITY 16 /* assume request_key() authorisation */
+#define KEYCTL_GET_SECURITY 17 /* get key security label */
+
+#endif /* _LINUX_KEYCTL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/limits.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/limits.h
new file mode 100644
index 0000000..2d0f941
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/limits.h
@@ -0,0 +1,20 @@
+#ifndef _LINUX_LIMITS_H
+#define _LINUX_LIMITS_H
+
+#define NR_OPEN 1024
+
+#define NGROUPS_MAX 65536 /* supplemental group IDs are available */
+#define ARG_MAX 131072 /* # bytes of args + environ for exec() */
+#define LINK_MAX 127 /* # links a file may have */
+#define MAX_CANON 255 /* size of the canonical input queue */
+#define MAX_INPUT 255 /* size of the type-ahead buffer */
+#define NAME_MAX 255 /* # chars in a file name */
+#define PATH_MAX 4096 /* # chars in a path name including nul */
+#define PIPE_BUF 4096 /* # bytes in atomic write to a pipe */
+#define XATTR_NAME_MAX 255 /* # chars in an extended attribute name */
+#define XATTR_SIZE_MAX 65536 /* size of an extended attribute value (64k) */
+#define XATTR_LIST_MAX 65536 /* size of extended attribute namelist (64k) */
+
+#define RTSIG_MAX 32
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/llc.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/llc.h
new file mode 100644
index 0000000..6bb32fe
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/llc.h
@@ -0,0 +1,73 @@
+#ifndef __LINUX_LLC_H
+#define __LINUX_LLC_H
+/*
+ * IEEE 802.2 User Interface SAPs for Linux, data structures and indicators.
+ *
+ * Copyright (c) 2001 by Jay Schulist <jschlst@samba.org>
+ *
+ * This program can be redistributed or modified under the terms of the
+ * GNU General Public License as published by the Free Software Foundation.
+ * This program is distributed without any warranty or implied warranty
+ * of merchantability or fitness for a particular purpose.
+ *
+ * See the GNU General Public License for more details.
+ */
+#define __LLC_SOCK_SIZE__ 16 /* sizeof(sockaddr_llc), word align. */
+struct sockaddr_llc {
+ sa_family_t sllc_family; /* AF_LLC */
+ sa_family_t sllc_arphrd; /* ARPHRD_ETHER */
+ unsigned char sllc_test;
+ unsigned char sllc_xid;
+ unsigned char sllc_ua; /* UA data, only for SOCK_STREAM. */
+ unsigned char sllc_sap;
+ unsigned char sllc_mac[IFHWADDRLEN];
+ unsigned char __pad[__LLC_SOCK_SIZE__ - sizeof(sa_family_t) * 2 -
+ sizeof(unsigned char) * 4 - IFHWADDRLEN];
+};
+
+/* sockopt definitions. */
+enum llc_sockopts {
+ LLC_OPT_UNKNOWN = 0,
+ LLC_OPT_RETRY, /* max retrans attempts. */
+ LLC_OPT_SIZE, /* max PDU size (octets). */
+ LLC_OPT_ACK_TMR_EXP, /* ack expire time (secs). */
+ LLC_OPT_P_TMR_EXP, /* pf cycle expire time (secs). */
+ LLC_OPT_REJ_TMR_EXP, /* rej sent expire time (secs). */
+ LLC_OPT_BUSY_TMR_EXP, /* busy state expire time (secs). */
+ LLC_OPT_TX_WIN, /* tx window size. */
+ LLC_OPT_RX_WIN, /* rx window size. */
+ LLC_OPT_MAX
+};
+
+#define LLC_OPT_MAX_RETRY 100
+#define LLC_OPT_MAX_SIZE 4196
+#define LLC_OPT_MAX_WIN 127
+#define LLC_OPT_MAX_ACK_TMR_EXP 60
+#define LLC_OPT_MAX_P_TMR_EXP 60
+#define LLC_OPT_MAX_REJ_TMR_EXP 60
+#define LLC_OPT_MAX_BUSY_TMR_EXP 60
+
+/* LLC SAP types. */
+#define LLC_SAP_NULL 0x00 /* NULL SAP. */
+#define LLC_SAP_LLC 0x02 /* LLC Sublayer Management. */
+#define LLC_SAP_SNA 0x04 /* SNA Path Control. */
+#define LLC_SAP_PNM 0x0E /* Proway Network Management. */
+#define LLC_SAP_IP 0x06 /* TCP/IP. */
+#define LLC_SAP_BSPAN 0x42 /* Bridge Spanning Tree Proto */
+#define LLC_SAP_MMS 0x4E /* Manufacturing Message Srv. */
+#define LLC_SAP_8208 0x7E /* ISO 8208 */
+#define LLC_SAP_3COM 0x80 /* 3COM. */
+#define LLC_SAP_PRO 0x8E /* Proway Active Station List */
+#define LLC_SAP_SNAP 0xAA /* SNAP. */
+#define LLC_SAP_BANYAN 0xBC /* Banyan. */
+#define LLC_SAP_IPX 0xE0 /* IPX/SPX. */
+#define LLC_SAP_NETBEUI 0xF0 /* NetBEUI. */
+#define LLC_SAP_LANMGR 0xF4 /* LanManager. */
+#define LLC_SAP_IMPL 0xF8 /* IMPL */
+#define LLC_SAP_DISC 0xFC /* Discovery */
+#define LLC_SAP_OSI 0xFE /* OSI Network Layers. */
+#define LLC_SAP_LAR 0xDC /* LAN Address Resolution */
+#define LLC_SAP_RM 0xD4 /* Resource Management */
+#define LLC_SAP_GLOBAL 0xFF /* Global SAP. */
+
+#endif /* __LINUX_LLC_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/loop.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/loop.h
new file mode 100644
index 0000000..988cfed
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/loop.h
@@ -0,0 +1,90 @@
+#ifndef _LINUX_LOOP_H
+#define _LINUX_LOOP_H
+
+/*
+ * include/linux/loop.h
+ *
+ * Written by Theodore Ts'o, 3/29/93.
+ *
+ * Copyright 1993 by Theodore Ts'o. Redistribution of this file is
+ * permitted under the GNU General Public License.
+ */
+
+#define LO_NAME_SIZE 64
+#define LO_KEY_SIZE 32
+
+
+/*
+ * Loop flags
+ */
+enum {
+ LO_FLAGS_READ_ONLY = 1,
+ LO_FLAGS_USE_AOPS = 2,
+ LO_FLAGS_AUTOCLEAR = 4,
+};
+
+#include <asm/posix_types.h> /* for __kernel_old_dev_t */
+#include <linux/types.h> /* for __u64 */
+
+/* Backwards compatibility version */
+struct loop_info {
+ int lo_number; /* ioctl r/o */
+ __kernel_old_dev_t lo_device; /* ioctl r/o */
+ unsigned long lo_inode; /* ioctl r/o */
+ __kernel_old_dev_t lo_rdevice; /* ioctl r/o */
+ int lo_offset;
+ int lo_encrypt_type;
+ int lo_encrypt_key_size; /* ioctl w/o */
+ int lo_flags; /* ioctl r/o */
+ char lo_name[LO_NAME_SIZE];
+ unsigned char lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
+ unsigned long lo_init[2];
+ char reserved[4];
+};
+
+struct loop_info64 {
+ __u64 lo_device; /* ioctl r/o */
+ __u64 lo_inode; /* ioctl r/o */
+ __u64 lo_rdevice; /* ioctl r/o */
+ __u64 lo_offset;
+ __u64 lo_sizelimit;/* bytes, 0 == max available */
+ __u32 lo_number; /* ioctl r/o */
+ __u32 lo_encrypt_type;
+ __u32 lo_encrypt_key_size; /* ioctl w/o */
+ __u32 lo_flags; /* ioctl r/o */
+ __u8 lo_file_name[LO_NAME_SIZE];
+ __u8 lo_crypt_name[LO_NAME_SIZE];
+ __u8 lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
+ __u64 lo_init[2];
+};
+
+/*
+ * Loop filter types
+ */
+
+#define LO_CRYPT_NONE 0
+#define LO_CRYPT_XOR 1
+#define LO_CRYPT_DES 2
+#define LO_CRYPT_FISH2 3 /* Twofish encryption */
+#define LO_CRYPT_BLOW 4
+#define LO_CRYPT_CAST128 5
+#define LO_CRYPT_IDEA 6
+#define LO_CRYPT_DUMMY 9
+#define LO_CRYPT_SKIPJACK 10
+#define LO_CRYPT_CRYPTOAPI 18
+#define MAX_LO_CRYPT 20
+
+/*
+ * IOCTL commands --- we will commandeer 0x4C ('L')
+ */
+
+#define LOOP_SET_FD 0x4C00
+#define LOOP_CLR_FD 0x4C01
+#define LOOP_SET_STATUS 0x4C02
+#define LOOP_GET_STATUS 0x4C03
+#define LOOP_SET_STATUS64 0x4C04
+#define LOOP_GET_STATUS64 0x4C05
+#define LOOP_CHANGE_FD 0x4C06
+#define LOOP_SET_CAPACITY 0x4C07
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/lp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/lp.h
new file mode 100644
index 0000000..59b1a6f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/lp.h
@@ -0,0 +1,100 @@
+#ifndef _LINUX_LP_H
+#define _LINUX_LP_H
+
+/*
+ * usr/include/linux/lp.h c.1991-1992 James Wiegand
+ * many modifications copyright (C) 1992 Michael K. Johnson
+ * Interrupt support added 1993 Nigel Gamble
+ * Removed 8255 status defines from inside __KERNEL__ Marcelo Tosatti
+ */
+
+/*
+ * Per POSIX guidelines, this module reserves the LP and lp prefixes
+ * These are the lp_table[minor].flags flags...
+ */
+#define LP_EXIST 0x0001
+#define LP_SELEC 0x0002
+#define LP_BUSY 0x0004
+#define LP_BUSY_BIT_POS 2
+#define LP_OFFL 0x0008
+#define LP_NOPA 0x0010
+#define LP_ERR 0x0020
+#define LP_ABORT 0x0040
+#define LP_CAREFUL 0x0080 /* obsoleted -arca */
+#define LP_ABORTOPEN 0x0100
+
+#define LP_TRUST_IRQ_ 0x0200 /* obsolete */
+#define LP_NO_REVERSE 0x0400 /* No reverse mode available. */
+#define LP_DATA_AVAIL 0x0800 /* Data is available. */
+
+/*
+ * bit defines for 8255 status port
+ * base + 1
+ * accessed with LP_S(minor), which gets the byte...
+ */
+#define LP_PBUSY 0x80 /* inverted input, active high */
+#define LP_PACK 0x40 /* unchanged input, active low */
+#define LP_POUTPA 0x20 /* unchanged input, active high */
+#define LP_PSELECD 0x10 /* unchanged input, active high */
+#define LP_PERRORP 0x08 /* unchanged input, active low */
+
+/* timeout for each character. This is relative to bus cycles -- it
+ * is the count in a busy loop. THIS IS THE VALUE TO CHANGE if you
+ * have extremely slow printing, or if the machine seems to slow down
+ * a lot when you print. If you have slow printing, increase this
+ * number and recompile, and if your system gets bogged down, decrease
+ * this number. This can be changed with the tunelp(8) command as well.
+ */
+
+#define LP_INIT_CHAR 1000
+
+/* The parallel port specs apparently say that there needs to be
+ * a .5usec wait before and after the strobe.
+ */
+
+#define LP_INIT_WAIT 1
+
+/* This is the amount of time that the driver waits for the printer to
+ * catch up when the printer's buffer appears to be filled. If you
+ * want to tune this and have a fast printer (i.e. HPIIIP), decrease
+ * this number, and if you have a slow printer, increase this number.
+ * This is in hundredths of a second, the default 2 being .05 second.
+ * Or use the tunelp(8) command, which is especially nice if you want
+ * change back and forth between character and graphics printing, which
+ * are wildly different...
+ */
+
+#define LP_INIT_TIME 2
+
+/* IOCTL numbers */
+#define LPCHAR 0x0601 /* corresponds to LP_INIT_CHAR */
+#define LPTIME 0x0602 /* corresponds to LP_INIT_TIME */
+#define LPABORT 0x0604 /* call with TRUE arg to abort on error,
+ FALSE to retry. Default is retry. */
+#define LPSETIRQ 0x0605 /* call with new IRQ number,
+ or 0 for polling (no IRQ) */
+#define LPGETIRQ 0x0606 /* get the current IRQ number */
+#define LPWAIT 0x0608 /* corresponds to LP_INIT_WAIT */
+/* NOTE: LPCAREFUL is obsoleted and it' s always the default right now -arca */
+#define LPCAREFUL 0x0609 /* call with TRUE arg to require out-of-paper, off-
+ line, and error indicators good on all writes,
+ FALSE to ignore them. Default is ignore. */
+#define LPABORTOPEN 0x060a /* call with TRUE arg to abort open() on error,
+ FALSE to ignore error. Default is ignore. */
+#define LPGETSTATUS 0x060b /* return LP_S(minor) */
+#define LPRESET 0x060c /* reset printer */
+#ifdef LP_STATS
+#define LPGETSTATS 0x060d /* get statistics (struct lp_stats) */
+#endif
+#define LPGETFLAGS 0x060e /* get status flags */
+#define LPSETTIMEOUT 0x060f /* set parport timeout */
+
+/* timeout for printk'ing a timeout, in jiffies (100ths of a second).
+ This is also used for re-checking error conditions if LP_ABORT is
+ not set. This is the default behavior. */
+
+#define LP_TIMEOUT_INTERRUPT (60 * HZ)
+#define LP_TIMEOUT_POLLED (10 * HZ)
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/magic.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/magic.h
new file mode 100644
index 0000000..5b4e28b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/magic.h
@@ -0,0 +1,53 @@
+#ifndef __LINUX_MAGIC_H__
+#define __LINUX_MAGIC_H__
+
+#define ADFS_SUPER_MAGIC 0xadf5
+#define AFFS_SUPER_MAGIC 0xadff
+#define AFS_SUPER_MAGIC 0x5346414F
+#define AUTOFS_SUPER_MAGIC 0x0187
+#define CODA_SUPER_MAGIC 0x73757245
+#define DEBUGFS_MAGIC 0x64626720
+#define SYSFS_MAGIC 0x62656572
+#define SECURITYFS_MAGIC 0x73636673
+#define TMPFS_MAGIC 0x01021994
+#define SQUASHFS_MAGIC 0x73717368
+#define EFS_SUPER_MAGIC 0x414A53
+#define EXT2_SUPER_MAGIC 0xEF53
+#define EXT3_SUPER_MAGIC 0xEF53
+#define XENFS_SUPER_MAGIC 0xabba1974
+#define EXT4_SUPER_MAGIC 0xEF53
+#define BTRFS_SUPER_MAGIC 0x9123683E
+#define HPFS_SUPER_MAGIC 0xf995e849
+#define ISOFS_SUPER_MAGIC 0x9660
+#define JFFS2_SUPER_MAGIC 0x72b6
+#define ANON_INODE_FS_MAGIC 0x09041934
+
+#define MINIX_SUPER_MAGIC 0x137F /* original minix fs */
+#define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */
+#define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */
+#define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */
+#define MINIX3_SUPER_MAGIC 0x4d5a /* minix V3 fs */
+
+#define MSDOS_SUPER_MAGIC 0x4d44 /* MD */
+#define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */
+#define NFS_SUPER_MAGIC 0x6969
+#define OPENPROM_SUPER_MAGIC 0x9fa1
+#define PROC_SUPER_MAGIC 0x9fa0
+#define QNX4_SUPER_MAGIC 0x002f /* qnx4 fs detection */
+
+#define REISERFS_SUPER_MAGIC 0x52654973 /* used by gcc */
+ /* used by file system utilities that
+ look at the superblock, etc. */
+#define REISERFS_SUPER_MAGIC_STRING "ReIsErFs"
+#define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs"
+#define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs"
+
+#define SMB_SUPER_MAGIC 0x517B
+#define USBDEVICE_SUPER_MAGIC 0x9fa2
+#define CGROUP_SUPER_MAGIC 0x27e0eb
+
+#define FUTEXFS_SUPER_MAGIC 0xBAD1DEA
+#define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA
+
+#define STACK_END_MAGIC 0x57AC6E9D
+#endif /* __LINUX_MAGIC_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/major.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/major.h
new file mode 100644
index 0000000..058ec15
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/major.h
@@ -0,0 +1,176 @@
+#ifndef _LINUX_MAJOR_H
+#define _LINUX_MAJOR_H
+
+/*
+ * This file has definitions for major device numbers.
+ * For the device number assignments, see Documentation/devices.txt.
+ */
+
+#define UNNAMED_MAJOR 0
+#define MEM_MAJOR 1
+#define RAMDISK_MAJOR 1
+#define FLOPPY_MAJOR 2
+#define PTY_MASTER_MAJOR 2
+#define IDE0_MAJOR 3
+#define HD_MAJOR IDE0_MAJOR
+#define PTY_SLAVE_MAJOR 3
+#define TTY_MAJOR 4
+#define TTYAUX_MAJOR 5
+#define LP_MAJOR 6
+#define VCS_MAJOR 7
+#define LOOP_MAJOR 7
+#define SCSI_DISK0_MAJOR 8
+#define SCSI_TAPE_MAJOR 9
+#define MD_MAJOR 9
+#define MISC_MAJOR 10
+#define SCSI_CDROM_MAJOR 11
+#define MUX_MAJOR 11 /* PA-RISC only */
+#define XT_DISK_MAJOR 13
+#define INPUT_MAJOR 13
+#define SOUND_MAJOR 14
+#define CDU31A_CDROM_MAJOR 15
+#define JOYSTICK_MAJOR 15
+#define GOLDSTAR_CDROM_MAJOR 16
+#define OPTICS_CDROM_MAJOR 17
+#define SANYO_CDROM_MAJOR 18
+#define CYCLADES_MAJOR 19
+#define CYCLADESAUX_MAJOR 20
+#define MITSUMI_X_CDROM_MAJOR 20
+#define MFM_ACORN_MAJOR 21 /* ARM Linux /dev/mfm */
+#define SCSI_GENERIC_MAJOR 21
+#define IDE1_MAJOR 22
+#define DIGICU_MAJOR 22
+#define DIGI_MAJOR 23
+#define MITSUMI_CDROM_MAJOR 23
+#define CDU535_CDROM_MAJOR 24
+#define STL_SERIALMAJOR 24
+#define MATSUSHITA_CDROM_MAJOR 25
+#define STL_CALLOUTMAJOR 25
+#define MATSUSHITA_CDROM2_MAJOR 26
+#define QIC117_TAPE_MAJOR 27
+#define MATSUSHITA_CDROM3_MAJOR 27
+#define MATSUSHITA_CDROM4_MAJOR 28
+#define STL_SIOMEMMAJOR 28
+#define ACSI_MAJOR 28
+#define AZTECH_CDROM_MAJOR 29
+#define FB_MAJOR 29 /* /dev/fb* framebuffers */
+#define CM206_CDROM_MAJOR 32
+#define IDE2_MAJOR 33
+#define IDE3_MAJOR 34
+#define Z8530_MAJOR 34
+#define XPRAM_MAJOR 35 /* Expanded storage on S/390: "slow ram"*/
+#define NETLINK_MAJOR 36
+#define PS2ESDI_MAJOR 36
+#define IDETAPE_MAJOR 37
+#define Z2RAM_MAJOR 37
+#define APBLOCK_MAJOR 38 /* AP1000 Block device */
+#define DDV_MAJOR 39 /* AP1000 DDV block device */
+#define NBD_MAJOR 43 /* Network block device */
+#define RISCOM8_NORMAL_MAJOR 48
+#define DAC960_MAJOR 48 /* 48..55 */
+#define RISCOM8_CALLOUT_MAJOR 49
+#define MKISS_MAJOR 55
+#define DSP56K_MAJOR 55 /* DSP56001 processor device */
+
+#define IDE4_MAJOR 56
+#define IDE5_MAJOR 57
+
+#define SCSI_DISK1_MAJOR 65
+#define SCSI_DISK2_MAJOR 66
+#define SCSI_DISK3_MAJOR 67
+#define SCSI_DISK4_MAJOR 68
+#define SCSI_DISK5_MAJOR 69
+#define SCSI_DISK6_MAJOR 70
+#define SCSI_DISK7_MAJOR 71
+
+#define COMPAQ_SMART2_MAJOR 72
+#define COMPAQ_SMART2_MAJOR1 73
+#define COMPAQ_SMART2_MAJOR2 74
+#define COMPAQ_SMART2_MAJOR3 75
+#define COMPAQ_SMART2_MAJOR4 76
+#define COMPAQ_SMART2_MAJOR5 77
+#define COMPAQ_SMART2_MAJOR6 78
+#define COMPAQ_SMART2_MAJOR7 79
+
+#define SPECIALIX_NORMAL_MAJOR 75
+#define SPECIALIX_CALLOUT_MAJOR 76
+
+#define AURORA_MAJOR 79
+
+#define I2O_MAJOR 80 /* 80->87 */
+
+#define SHMIQ_MAJOR 85 /* Linux/mips, SGI /dev/shmiq */
+#define SCSI_CHANGER_MAJOR 86
+
+#define IDE6_MAJOR 88
+#define IDE7_MAJOR 89
+#define IDE8_MAJOR 90
+#define IDE9_MAJOR 91
+
+#define DASD_MAJOR 94
+
+#define MDISK_MAJOR 95
+
+#define UBD_MAJOR 98
+
+#define PP_MAJOR 99
+#define JSFD_MAJOR 99
+
+#define PHONE_MAJOR 100
+
+#define COMPAQ_CISS_MAJOR 104
+#define COMPAQ_CISS_MAJOR1 105
+#define COMPAQ_CISS_MAJOR2 106
+#define COMPAQ_CISS_MAJOR3 107
+#define COMPAQ_CISS_MAJOR4 108
+#define COMPAQ_CISS_MAJOR5 109
+#define COMPAQ_CISS_MAJOR6 110
+#define COMPAQ_CISS_MAJOR7 111
+
+#define VIODASD_MAJOR 112
+#define VIOCD_MAJOR 113
+
+#define ATARAID_MAJOR 114
+
+#define SCSI_DISK8_MAJOR 128
+#define SCSI_DISK9_MAJOR 129
+#define SCSI_DISK10_MAJOR 130
+#define SCSI_DISK11_MAJOR 131
+#define SCSI_DISK12_MAJOR 132
+#define SCSI_DISK13_MAJOR 133
+#define SCSI_DISK14_MAJOR 134
+#define SCSI_DISK15_MAJOR 135
+
+#define UNIX98_PTY_MASTER_MAJOR 128
+#define UNIX98_PTY_MAJOR_COUNT 8
+#define UNIX98_PTY_SLAVE_MAJOR (UNIX98_PTY_MASTER_MAJOR+UNIX98_PTY_MAJOR_COUNT)
+
+#define RTF_MAJOR 150
+#define RAW_MAJOR 162
+
+#define USB_ACM_MAJOR 166
+#define USB_ACM_AUX_MAJOR 167
+#define USB_CHAR_MAJOR 180
+
+#define MMC_BLOCK_MAJOR 179
+
+#define VXVM_MAJOR 199 /* VERITAS volume i/o driver */
+#define VXSPEC_MAJOR 200 /* VERITAS volume config driver */
+#define VXDMP_MAJOR 201 /* VERITAS volume multipath driver */
+
+#define XENVBD_MAJOR 202 /* Xen virtual block device */
+
+#define MSR_MAJOR 202
+#define CPUID_MAJOR 203
+
+#define OSST_MAJOR 206 /* OnStream-SCx0 SCSI tape */
+
+#define IBM_TTY3270_MAJOR 227
+#define IBM_FS3270_MAJOR 228
+
+#define VIOTAPE_MAJOR 230
+
+#define BLOCK_EXT_MAJOR 259
+#define SCSI_OSD_MAJOR 260 /* open-osd's OSD scsi device */
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/map_to_7segment.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/map_to_7segment.h
new file mode 100644
index 0000000..12d62a5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/map_to_7segment.h
@@ -0,0 +1,187 @@
+/*
+ * Copyright (c) 2005 Henk Vergonet <Henk.Vergonet@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef MAP_TO_7SEGMENT_H
+#define MAP_TO_7SEGMENT_H
+
+/* This file provides translation primitives and tables for the conversion
+ * of (ASCII) characters to a 7-segments notation.
+ *
+ * The 7 segment's wikipedia notation below is used as standard.
+ * See: http://en.wikipedia.org/wiki/Seven_segment_display
+ *
+ * Notation: +-a-+
+ * f b
+ * +-g-+
+ * e c
+ * +-d-+
+ *
+ * Usage:
+ *
+ * Register a map variable, and fill it with a character set:
+ * static SEG7_DEFAULT_MAP(map_seg7);
+ *
+ *
+ * Then use for conversion:
+ * seg7 = map_to_seg7(&map_seg7, some_char);
+ * ...
+ *
+ * In device drivers it is recommended, if required, to make the char map
+ * accessible via the sysfs interface using the following scheme:
+ *
+ * static ssize_t show_map(struct device *dev, char *buf) {
+ * memcpy(buf, &map_seg7, sizeof(map_seg7));
+ * return sizeof(map_seg7);
+ * }
+ * static ssize_t store_map(struct device *dev, const char *buf, size_t cnt) {
+ * if(cnt != sizeof(map_seg7))
+ * return -EINVAL;
+ * memcpy(&map_seg7, buf, cnt);
+ * return cnt;
+ * }
+ * static DEVICE_ATTR(map_seg7, PERMS_RW, show_map, store_map);
+ *
+ * History:
+ * 2005-05-31 RFC linux-kernel@vger.kernel.org
+ */
+#include <linux/errno.h>
+
+
+#define BIT_SEG7_A 0
+#define BIT_SEG7_B 1
+#define BIT_SEG7_C 2
+#define BIT_SEG7_D 3
+#define BIT_SEG7_E 4
+#define BIT_SEG7_F 5
+#define BIT_SEG7_G 6
+#define BIT_SEG7_RESERVED 7
+
+struct seg7_conversion_map {
+ unsigned char table[128];
+};
+
+static __inline__ int map_to_seg7(struct seg7_conversion_map *map, int c)
+{
+ return c >= 0 && c < sizeof(map->table) ? map->table[c] : -EINVAL;
+}
+
+#define SEG7_CONVERSION_MAP(_name, _map) \
+ struct seg7_conversion_map _name = { .table = { _map } }
+
+/*
+ * It is recommended to use a facility that allows user space to redefine
+ * custom character sets for LCD devices. Please use a sysfs interface
+ * as described above.
+ */
+#define MAP_TO_SEG7_SYSFS_FILE "map_seg7"
+
+/*******************************************************************************
+ * ASCII conversion table
+ ******************************************************************************/
+
+#define _SEG7(l,a,b,c,d,e,f,g) \
+ ( a<<BIT_SEG7_A | b<<BIT_SEG7_B | c<<BIT_SEG7_C | d<<BIT_SEG7_D | \
+ e<<BIT_SEG7_E | f<<BIT_SEG7_F | g<<BIT_SEG7_G )
+
+#define _MAP_0_32_ASCII_SEG7_NON_PRINTABLE \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+
+#define _MAP_33_47_ASCII_SEG7_SYMBOL \
+ _SEG7('!',0,0,0,0,1,1,0), _SEG7('"',0,1,0,0,0,1,0), _SEG7('#',0,1,1,0,1,1,0),\
+ _SEG7('$',1,0,1,1,0,1,1), _SEG7('%',0,0,1,0,0,1,0), _SEG7('&',1,0,1,1,1,1,1),\
+ _SEG7('\'',0,0,0,0,0,1,0),_SEG7('(',1,0,0,1,1,1,0), _SEG7(')',1,1,1,1,0,0,0),\
+ _SEG7('*',0,1,1,0,1,1,1), _SEG7('+',0,1,1,0,0,0,1), _SEG7(',',0,0,0,0,1,0,0),\
+ _SEG7('-',0,0,0,0,0,0,1), _SEG7('.',0,0,0,0,1,0,0), _SEG7('/',0,1,0,0,1,0,1),
+
+#define _MAP_48_57_ASCII_SEG7_NUMERIC \
+ _SEG7('0',1,1,1,1,1,1,0), _SEG7('1',0,1,1,0,0,0,0), _SEG7('2',1,1,0,1,1,0,1),\
+ _SEG7('3',1,1,1,1,0,0,1), _SEG7('4',0,1,1,0,0,1,1), _SEG7('5',1,0,1,1,0,1,1),\
+ _SEG7('6',1,0,1,1,1,1,1), _SEG7('7',1,1,1,0,0,0,0), _SEG7('8',1,1,1,1,1,1,1),\
+ _SEG7('9',1,1,1,1,0,1,1),
+
+#define _MAP_58_64_ASCII_SEG7_SYMBOL \
+ _SEG7(':',0,0,0,1,0,0,1), _SEG7(';',0,0,0,1,0,0,1), _SEG7('<',1,0,0,0,0,1,1),\
+ _SEG7('=',0,0,0,1,0,0,1), _SEG7('>',1,1,0,0,0,0,1), _SEG7('?',1,1,1,0,0,1,0),\
+ _SEG7('@',1,1,0,1,1,1,1),
+
+#define _MAP_65_90_ASCII_SEG7_ALPHA_UPPR \
+ _SEG7('A',1,1,1,0,1,1,1), _SEG7('B',1,1,1,1,1,1,1), _SEG7('C',1,0,0,1,1,1,0),\
+ _SEG7('D',1,1,1,1,1,1,0), _SEG7('E',1,0,0,1,1,1,1), _SEG7('F',1,0,0,0,1,1,1),\
+ _SEG7('G',1,1,1,1,0,1,1), _SEG7('H',0,1,1,0,1,1,1), _SEG7('I',0,1,1,0,0,0,0),\
+ _SEG7('J',0,1,1,1,0,0,0), _SEG7('K',0,1,1,0,1,1,1), _SEG7('L',0,0,0,1,1,1,0),\
+ _SEG7('M',1,1,1,0,1,1,0), _SEG7('N',1,1,1,0,1,1,0), _SEG7('O',1,1,1,1,1,1,0),\
+ _SEG7('P',1,1,0,0,1,1,1), _SEG7('Q',1,1,1,1,1,1,0), _SEG7('R',1,1,1,0,1,1,1),\
+ _SEG7('S',1,0,1,1,0,1,1), _SEG7('T',0,0,0,1,1,1,1), _SEG7('U',0,1,1,1,1,1,0),\
+ _SEG7('V',0,1,1,1,1,1,0), _SEG7('W',0,1,1,1,1,1,1), _SEG7('X',0,1,1,0,1,1,1),\
+ _SEG7('Y',0,1,1,0,0,1,1), _SEG7('Z',1,1,0,1,1,0,1),
+
+#define _MAP_91_96_ASCII_SEG7_SYMBOL \
+ _SEG7('[',1,0,0,1,1,1,0), _SEG7('\\',0,0,1,0,0,1,1),_SEG7(']',1,1,1,1,0,0,0),\
+ _SEG7('^',1,1,0,0,0,1,0), _SEG7('_',0,0,0,1,0,0,0), _SEG7('`',0,1,0,0,0,0,0),
+
+#define _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \
+ _SEG7('A',1,1,1,0,1,1,1), _SEG7('b',0,0,1,1,1,1,1), _SEG7('c',0,0,0,1,1,0,1),\
+ _SEG7('d',0,1,1,1,1,0,1), _SEG7('E',1,0,0,1,1,1,1), _SEG7('F',1,0,0,0,1,1,1),\
+ _SEG7('G',1,1,1,1,0,1,1), _SEG7('h',0,0,1,0,1,1,1), _SEG7('i',0,0,1,0,0,0,0),\
+ _SEG7('j',0,0,1,1,0,0,0), _SEG7('k',0,0,1,0,1,1,1), _SEG7('L',0,0,0,1,1,1,0),\
+ _SEG7('M',1,1,1,0,1,1,0), _SEG7('n',0,0,1,0,1,0,1), _SEG7('o',0,0,1,1,1,0,1),\
+ _SEG7('P',1,1,0,0,1,1,1), _SEG7('q',1,1,1,0,0,1,1), _SEG7('r',0,0,0,0,1,0,1),\
+ _SEG7('S',1,0,1,1,0,1,1), _SEG7('T',0,0,0,1,1,1,1), _SEG7('u',0,0,1,1,1,0,0),\
+ _SEG7('v',0,0,1,1,1,0,0), _SEG7('W',0,1,1,1,1,1,1), _SEG7('X',0,1,1,0,1,1,1),\
+ _SEG7('y',0,1,1,1,0,1,1), _SEG7('Z',1,1,0,1,1,0,1),
+
+#define _MAP_123_126_ASCII_SEG7_SYMBOL \
+ _SEG7('{',1,0,0,1,1,1,0), _SEG7('|',0,0,0,0,1,1,0), _SEG7('}',1,1,1,1,0,0,0),\
+ _SEG7('~',1,0,0,0,0,0,0),
+
+/* Maps */
+
+/* This set tries to map as close as possible to the visible characteristics
+ * of the ASCII symbol, lowercase and uppercase letters may differ in
+ * presentation on the display.
+ */
+#define MAP_ASCII7SEG_ALPHANUM \
+ _MAP_0_32_ASCII_SEG7_NON_PRINTABLE \
+ _MAP_33_47_ASCII_SEG7_SYMBOL \
+ _MAP_48_57_ASCII_SEG7_NUMERIC \
+ _MAP_58_64_ASCII_SEG7_SYMBOL \
+ _MAP_65_90_ASCII_SEG7_ALPHA_UPPR \
+ _MAP_91_96_ASCII_SEG7_SYMBOL \
+ _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \
+ _MAP_123_126_ASCII_SEG7_SYMBOL
+
+/* This set tries to map as close as possible to the symbolic characteristics
+ * of the ASCII character for maximum discrimination.
+ * For now this means all alpha chars are in lower case representations.
+ * (This for example facilitates the use of hex numbers with uppercase input.)
+ */
+#define MAP_ASCII7SEG_ALPHANUM_LC \
+ _MAP_0_32_ASCII_SEG7_NON_PRINTABLE \
+ _MAP_33_47_ASCII_SEG7_SYMBOL \
+ _MAP_48_57_ASCII_SEG7_NUMERIC \
+ _MAP_58_64_ASCII_SEG7_SYMBOL \
+ _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \
+ _MAP_91_96_ASCII_SEG7_SYMBOL \
+ _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \
+ _MAP_123_126_ASCII_SEG7_SYMBOL
+
+#define SEG7_DEFAULT_MAP(_name) \
+ SEG7_CONVERSION_MAP(_name,MAP_ASCII7SEG_ALPHANUM)
+
+#endif /* MAP_TO_7SEGMENT_H */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/matroxfb.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/matroxfb.h
new file mode 100644
index 0000000..2203121
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/matroxfb.h
@@ -0,0 +1,43 @@
+#ifndef __LINUX_MATROXFB_H__
+#define __LINUX_MATROXFB_H__
+
+#include <asm/ioctl.h>
+#include <linux/types.h>
+#include <linux/videodev2.h>
+
+struct matroxioc_output_mode {
+ __u32 output; /* which output */
+#define MATROXFB_OUTPUT_PRIMARY 0x0000
+#define MATROXFB_OUTPUT_SECONDARY 0x0001
+#define MATROXFB_OUTPUT_DFP 0x0002
+ __u32 mode; /* which mode */
+#define MATROXFB_OUTPUT_MODE_PAL 0x0001
+#define MATROXFB_OUTPUT_MODE_NTSC 0x0002
+#define MATROXFB_OUTPUT_MODE_MONITOR 0x0080
+};
+#define MATROXFB_SET_OUTPUT_MODE _IOW('n',0xFA,size_t)
+#define MATROXFB_GET_OUTPUT_MODE _IOWR('n',0xFA,size_t)
+
+/* bitfield */
+#define MATROXFB_OUTPUT_CONN_PRIMARY (1 << MATROXFB_OUTPUT_PRIMARY)
+#define MATROXFB_OUTPUT_CONN_SECONDARY (1 << MATROXFB_OUTPUT_SECONDARY)
+#define MATROXFB_OUTPUT_CONN_DFP (1 << MATROXFB_OUTPUT_DFP)
+/* connect these outputs to this framebuffer */
+#define MATROXFB_SET_OUTPUT_CONNECTION _IOW('n',0xF8,size_t)
+/* which outputs are connected to this framebuffer */
+#define MATROXFB_GET_OUTPUT_CONNECTION _IOR('n',0xF8,size_t)
+/* which outputs are available for this framebuffer */
+#define MATROXFB_GET_AVAILABLE_OUTPUTS _IOR('n',0xF9,size_t)
+/* which outputs exist on this framebuffer */
+#define MATROXFB_GET_ALL_OUTPUTS _IOR('n',0xFB,size_t)
+
+enum matroxfb_ctrl_id {
+ MATROXFB_CID_TESTOUT = V4L2_CID_PRIVATE_BASE,
+ MATROXFB_CID_DEFLICKER,
+ MATROXFB_CID_LAST
+};
+
+#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mempolicy.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mempolicy.h
new file mode 100644
index 0000000..40b072d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mempolicy.h
@@ -0,0 +1,56 @@
+#ifndef _LINUX_MEMPOLICY_H
+#define _LINUX_MEMPOLICY_H 1
+
+#include <linux/errno.h>
+
+/*
+ * NUMA memory policies for Linux.
+ * Copyright 2003,2004 Andi Kleen SuSE Labs
+ */
+
+/*
+ * Both the MPOL_* mempolicy mode and the MPOL_F_* optional mode flags are
+ * passed by the user to either set_mempolicy() or mbind() in an 'int' actual.
+ * The MPOL_MODE_FLAGS macro determines the legal set of optional mode flags.
+ */
+
+/* Policies */
+enum {
+ MPOL_DEFAULT,
+ MPOL_PREFERRED,
+ MPOL_BIND,
+ MPOL_INTERLEAVE,
+ MPOL_MAX, /* always last member of enum */
+};
+
+/* Flags for set_mempolicy */
+#define MPOL_F_STATIC_NODES (1 << 15)
+#define MPOL_F_RELATIVE_NODES (1 << 14)
+
+/*
+ * MPOL_MODE_FLAGS is the union of all possible optional mode flags passed to
+ * either set_mempolicy() or mbind().
+ */
+#define MPOL_MODE_FLAGS (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES)
+
+/* Flags for get_mempolicy */
+#define MPOL_F_NODE (1<<0) /* return next IL mode instead of node mask */
+#define MPOL_F_ADDR (1<<1) /* look up vma using address */
+#define MPOL_F_MEMS_ALLOWED (1<<2) /* return allowed memories */
+
+/* Flags for mbind */
+#define MPOL_MF_STRICT (1<<0) /* Verify existing pages in the mapping */
+#define MPOL_MF_MOVE (1<<1) /* Move pages owned by this process to conform to mapping */
+#define MPOL_MF_MOVE_ALL (1<<2) /* Move every page to conform to mapping */
+#define MPOL_MF_INTERNAL (1<<3) /* Internal flags start here */
+
+/*
+ * Internal flags that share the struct mempolicy flags word with
+ * "mode flags". These flags are allocated from bit 0 up, as they
+ * are never OR'ed into the mode in mempolicy API arguments.
+ */
+#define MPOL_F_SHARED (1 << 0) /* identify shared policies */
+#define MPOL_F_LOCAL (1 << 1) /* preferred local allocation */
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/meye.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/meye.h
new file mode 100644
index 0000000..12010ac
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/meye.h
@@ -0,0 +1,66 @@
+/*
+ * Motion Eye video4linux driver for Sony Vaio PictureBook
+ *
+ * Copyright (C) 2001-2003 Stelian Pop <stelian@popies.net>
+ *
+ * Copyright (C) 2001-2002 Alcôve <www.alcove.com>
+ *
+ * Copyright (C) 2000 Andrew Tridgell <tridge@valinux.com>
+ *
+ * Earlier work by Werner Almesberger, Paul `Rusty' Russell and Paul Mackerras.
+ *
+ * Some parts borrowed from various video4linux drivers, especially
+ * bttv-driver.c and zoran.c, see original files for credits.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef _MEYE_H_
+#define _MEYE_H_
+
+/****************************************************************************/
+/* Private API for handling mjpeg capture / playback. */
+/****************************************************************************/
+
+struct meye_params {
+ unsigned char subsample;
+ unsigned char quality;
+ unsigned char sharpness;
+ unsigned char agc;
+ unsigned char picture;
+ unsigned char framerate;
+};
+
+/* query the extended parameters */
+#define MEYEIOC_G_PARAMS _IOR ('v', BASE_VIDIOCPRIVATE+0, struct meye_params)
+/* set the extended parameters */
+#define MEYEIOC_S_PARAMS _IOW ('v', BASE_VIDIOCPRIVATE+1, struct meye_params)
+/* queue a buffer for mjpeg capture */
+#define MEYEIOC_QBUF_CAPT _IOW ('v', BASE_VIDIOCPRIVATE+2, int)
+/* sync a previously queued mjpeg buffer */
+#define MEYEIOC_SYNC _IOWR('v', BASE_VIDIOCPRIVATE+3, int)
+/* get a still uncompressed snapshot */
+#define MEYEIOC_STILLCAPT _IO ('v', BASE_VIDIOCPRIVATE+4)
+/* get a jpeg compressed snapshot */
+#define MEYEIOC_STILLJCAPT _IOR ('v', BASE_VIDIOCPRIVATE+5, int)
+
+/* V4L2 private controls */
+#define V4L2_CID_AGC V4L2_CID_PRIVATE_BASE
+#define V4L2_CID_MEYE_SHARPNESS (V4L2_CID_PRIVATE_BASE + 1)
+#define V4L2_CID_PICTURE (V4L2_CID_PRIVATE_BASE + 2)
+#define V4L2_CID_JPEGQUAL (V4L2_CID_PRIVATE_BASE + 3)
+#define V4L2_CID_FRAMERATE (V4L2_CID_PRIVATE_BASE + 4)
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mii.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mii.h
new file mode 100644
index 0000000..de1d74e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mii.h
@@ -0,0 +1,150 @@
+/*
+ * linux/mii.h: definitions for MII-compatible transceivers
+ * Originally drivers/net/sunhme.h.
+ *
+ * Copyright (C) 1996, 1999, 2001 David S. Miller (davem@redhat.com)
+ */
+
+#ifndef __LINUX_MII_H__
+#define __LINUX_MII_H__
+
+#include <linux/types.h>
+
+/* Generic MII registers. */
+
+#define MII_BMCR 0x00 /* Basic mode control register */
+#define MII_BMSR 0x01 /* Basic mode status register */
+#define MII_PHYSID1 0x02 /* PHYS ID 1 */
+#define MII_PHYSID2 0x03 /* PHYS ID 2 */
+#define MII_ADVERTISE 0x04 /* Advertisement control reg */
+#define MII_LPA 0x05 /* Link partner ability reg */
+#define MII_EXPANSION 0x06 /* Expansion register */
+#define MII_CTRL1000 0x09 /* 1000BASE-T control */
+#define MII_STAT1000 0x0a /* 1000BASE-T status */
+#define MII_ESTATUS 0x0f /* Extended Status */
+#define MII_DCOUNTER 0x12 /* Disconnect counter */
+#define MII_FCSCOUNTER 0x13 /* False carrier counter */
+#define MII_NWAYTEST 0x14 /* N-way auto-neg test reg */
+#define MII_RERRCOUNTER 0x15 /* Receive error counter */
+#define MII_SREVISION 0x16 /* Silicon revision */
+#define MII_RESV1 0x17 /* Reserved... */
+#define MII_LBRERROR 0x18 /* Lpback, rx, bypass error */
+#define MII_PHYADDR 0x19 /* PHY address */
+#define MII_RESV2 0x1a /* Reserved... */
+#define MII_TPISTATUS 0x1b /* TPI status for 10mbps */
+#define MII_NCONFIG 0x1c /* Network interface config */
+
+/* Basic mode control register. */
+#define BMCR_RESV 0x003f /* Unused... */
+#define BMCR_SPEED1000 0x0040 /* MSB of Speed (1000) */
+#define BMCR_CTST 0x0080 /* Collision test */
+#define BMCR_FULLDPLX 0x0100 /* Full duplex */
+#define BMCR_ANRESTART 0x0200 /* Auto negotiation restart */
+#define BMCR_ISOLATE 0x0400 /* Disconnect DP83840 from MII */
+#define BMCR_PDOWN 0x0800 /* Powerdown the DP83840 */
+#define BMCR_ANENABLE 0x1000 /* Enable auto negotiation */
+#define BMCR_SPEED100 0x2000 /* Select 100Mbps */
+#define BMCR_LOOPBACK 0x4000 /* TXD loopback bits */
+#define BMCR_RESET 0x8000 /* Reset the DP83840 */
+
+/* Basic mode status register. */
+#define BMSR_ERCAP 0x0001 /* Ext-reg capability */
+#define BMSR_JCD 0x0002 /* Jabber detected */
+#define BMSR_LSTATUS 0x0004 /* Link status */
+#define BMSR_ANEGCAPABLE 0x0008 /* Able to do auto-negotiation */
+#define BMSR_RFAULT 0x0010 /* Remote fault detected */
+#define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */
+#define BMSR_RESV 0x00c0 /* Unused... */
+#define BMSR_ESTATEN 0x0100 /* Extended Status in R15 */
+#define BMSR_100HALF2 0x0200 /* Can do 100BASE-T2 HDX */
+#define BMSR_100FULL2 0x0400 /* Can do 100BASE-T2 FDX */
+#define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */
+#define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */
+#define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */
+#define BMSR_100FULL 0x4000 /* Can do 100mbps, full-duplex */
+#define BMSR_100BASE4 0x8000 /* Can do 100mbps, 4k packets */
+
+/* Advertisement control register. */
+#define ADVERTISE_SLCT 0x001f /* Selector bits */
+#define ADVERTISE_CSMA 0x0001 /* Only selector supported */
+#define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */
+#define ADVERTISE_1000XFULL 0x0020 /* Try for 1000BASE-X full-duplex */
+#define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */
+#define ADVERTISE_1000XHALF 0x0040 /* Try for 1000BASE-X half-duplex */
+#define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */
+#define ADVERTISE_1000XPAUSE 0x0080 /* Try for 1000BASE-X pause */
+#define ADVERTISE_100FULL 0x0100 /* Try for 100mbps full-duplex */
+#define ADVERTISE_1000XPSE_ASYM 0x0100 /* Try for 1000BASE-X asym pause */
+#define ADVERTISE_100BASE4 0x0200 /* Try for 100mbps 4k packets */
+#define ADVERTISE_PAUSE_CAP 0x0400 /* Try for pause */
+#define ADVERTISE_PAUSE_ASYM 0x0800 /* Try for asymetric pause */
+#define ADVERTISE_RESV 0x1000 /* Unused... */
+#define ADVERTISE_RFAULT 0x2000 /* Say we can detect faults */
+#define ADVERTISE_LPACK 0x4000 /* Ack link partners response */
+#define ADVERTISE_NPAGE 0x8000 /* Next page bit */
+
+#define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \
+ ADVERTISE_CSMA)
+#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \
+ ADVERTISE_100HALF | ADVERTISE_100FULL)
+
+/* Link partner ability register. */
+#define LPA_SLCT 0x001f /* Same as advertise selector */
+#define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */
+#define LPA_1000XFULL 0x0020 /* Can do 1000BASE-X full-duplex */
+#define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */
+#define LPA_1000XHALF 0x0040 /* Can do 1000BASE-X half-duplex */
+#define LPA_100HALF 0x0080 /* Can do 100mbps half-duplex */
+#define LPA_1000XPAUSE 0x0080 /* Can do 1000BASE-X pause */
+#define LPA_100FULL 0x0100 /* Can do 100mbps full-duplex */
+#define LPA_1000XPAUSE_ASYM 0x0100 /* Can do 1000BASE-X pause asym*/
+#define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */
+#define LPA_PAUSE_CAP 0x0400 /* Can pause */
+#define LPA_PAUSE_ASYM 0x0800 /* Can pause asymetrically */
+#define LPA_RESV 0x1000 /* Unused... */
+#define LPA_RFAULT 0x2000 /* Link partner faulted */
+#define LPA_LPACK 0x4000 /* Link partner acked us */
+#define LPA_NPAGE 0x8000 /* Next page bit */
+
+#define LPA_DUPLEX (LPA_10FULL | LPA_100FULL)
+#define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4)
+
+/* Expansion register for auto-negotiation. */
+#define EXPANSION_NWAY 0x0001 /* Can do N-way auto-nego */
+#define EXPANSION_LCWP 0x0002 /* Got new RX page code word */
+#define EXPANSION_ENABLENPAGE 0x0004 /* This enables npage words */
+#define EXPANSION_NPCAPABLE 0x0008 /* Link partner supports npage */
+#define EXPANSION_MFAULTS 0x0010 /* Multiple faults detected */
+#define EXPANSION_RESV 0xffe0 /* Unused... */
+
+#define ESTATUS_1000_TFULL 0x2000 /* Can do 1000BT Full */
+#define ESTATUS_1000_THALF 0x1000 /* Can do 1000BT Half */
+
+/* N-way test register. */
+#define NWAYTEST_RESV1 0x00ff /* Unused... */
+#define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */
+#define NWAYTEST_RESV2 0xfe00 /* Unused... */
+
+/* 1000BASE-T Control register */
+#define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */
+#define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */
+
+/* 1000BASE-T Status register */
+#define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */
+#define LPA_1000REMRXOK 0x1000 /* Link partner remote receiver status */
+#define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */
+#define LPA_1000HALF 0x0400 /* Link partner 1000BASE-T half duplex */
+
+/* Flow control flags */
+#define FLOW_CTRL_TX 0x01
+#define FLOW_CTRL_RX 0x02
+
+/* This structure is used in all SIOCxMIIxxx ioctl calls */
+struct mii_ioctl_data {
+ __u16 phy_id;
+ __u16 reg_num;
+ __u16 val_in;
+ __u16 val_out;
+};
+
+#endif /* __LINUX_MII_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/minix_fs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/minix_fs.h
new file mode 100644
index 0000000..13fe09e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/minix_fs.h
@@ -0,0 +1,106 @@
+#ifndef _LINUX_MINIX_FS_H
+#define _LINUX_MINIX_FS_H
+
+#include <linux/types.h>
+#include <linux/magic.h>
+
+/*
+ * The minix filesystem constants/structures
+ */
+
+/*
+ * Thanks to Kees J Bot for sending me the definitions of the new
+ * minix filesystem (aka V2) with bigger inodes and 32-bit block
+ * pointers.
+ */
+
+#define MINIX_ROOT_INO 1
+
+/* Not the same as the bogus LINK_MAX in <linux/limits.h>. Oh well. */
+#define MINIX_LINK_MAX 250
+#define MINIX2_LINK_MAX 65530
+
+#define MINIX_I_MAP_SLOTS 8
+#define MINIX_Z_MAP_SLOTS 64
+#define MINIX_VALID_FS 0x0001 /* Clean fs. */
+#define MINIX_ERROR_FS 0x0002 /* fs has errors. */
+
+#define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode)))
+
+/*
+ * This is the original minix inode layout on disk.
+ * Note the 8-bit gid and atime and ctime.
+ */
+struct minix_inode {
+ __u16 i_mode;
+ __u16 i_uid;
+ __u32 i_size;
+ __u32 i_time;
+ __u8 i_gid;
+ __u8 i_nlinks;
+ __u16 i_zone[9];
+};
+
+/*
+ * The new minix inode has all the time entries, as well as
+ * long block numbers and a third indirect block (7+1+1+1
+ * instead of 7+1+1). Also, some previously 8-bit values are
+ * now 16-bit. The inode is now 64 bytes instead of 32.
+ */
+struct minix2_inode {
+ __u16 i_mode;
+ __u16 i_nlinks;
+ __u16 i_uid;
+ __u16 i_gid;
+ __u32 i_size;
+ __u32 i_atime;
+ __u32 i_mtime;
+ __u32 i_ctime;
+ __u32 i_zone[10];
+};
+
+/*
+ * minix super-block data on disk
+ */
+struct minix_super_block {
+ __u16 s_ninodes;
+ __u16 s_nzones;
+ __u16 s_imap_blocks;
+ __u16 s_zmap_blocks;
+ __u16 s_firstdatazone;
+ __u16 s_log_zone_size;
+ __u32 s_max_size;
+ __u16 s_magic;
+ __u16 s_state;
+ __u32 s_zones;
+};
+
+/*
+ * V3 minix super-block data on disk
+ */
+struct minix3_super_block {
+ __u32 s_ninodes;
+ __u16 s_pad0;
+ __u16 s_imap_blocks;
+ __u16 s_zmap_blocks;
+ __u16 s_firstdatazone;
+ __u16 s_log_zone_size;
+ __u16 s_pad1;
+ __u32 s_max_size;
+ __u32 s_zones;
+ __u16 s_magic;
+ __u16 s_pad2;
+ __u16 s_blocksize;
+ __u8 s_disk_version;
+};
+
+struct minix_dir_entry {
+ __u16 inode;
+ char name[0];
+};
+
+struct minix3_dir_entry {
+ __u32 inode;
+ char name[0];
+};
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mman.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mman.h
new file mode 100644
index 0000000..36b3004
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mman.h
@@ -0,0 +1,13 @@
+#ifndef _LINUX_MMAN_H
+#define _LINUX_MMAN_H
+
+#include <asm/mman.h>
+
+#define MREMAP_MAYMOVE 1
+#define MREMAP_FIXED 2
+
+#define OVERCOMMIT_GUESS 0
+#define OVERCOMMIT_ALWAYS 1
+#define OVERCOMMIT_NEVER 2
+
+#endif /* _LINUX_MMAN_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mmtimer.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mmtimer.h
new file mode 100644
index 0000000..884cabf
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mmtimer.h
@@ -0,0 +1,56 @@
+/*
+ * Intel Multimedia Timer device interface
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (c) 2001-2004 Silicon Graphics, Inc. All rights reserved.
+ *
+ * This file should define an interface compatible with the IA-PC Multimedia
+ * Timers Draft Specification (rev. 0.97) from Intel. Note that some
+ * hardware may not be able to safely export its registers to userspace,
+ * so the ioctl interface should support all necessary functionality.
+ *
+ * 11/01/01 - jbarnes - initial revision
+ * 9/10/04 - Christoph Lameter - remove interrupt support
+ * 9/17/04 - jbarnes - remove test program, move some #defines to the driver
+ */
+
+#ifndef _LINUX_MMTIMER_H
+#define _LINUX_MMTIMER_H
+
+/*
+ * Breakdown of the ioctl's available. An 'optional' next to the command
+ * indicates that supporting this command is optional, while 'required'
+ * commands must be implemented if conformance is desired.
+ *
+ * MMTIMER_GETOFFSET - optional
+ * Should return the offset (relative to the start of the page where the
+ * registers are mapped) for the counter in question.
+ *
+ * MMTIMER_GETRES - required
+ * The resolution of the clock in femto (10^-15) seconds
+ *
+ * MMTIMER_GETFREQ - required
+ * Frequency of the clock in Hz
+ *
+ * MMTIMER_GETBITS - required
+ * Number of bits in the clock's counter
+ *
+ * MMTIMER_MMAPAVAIL - required
+ * Returns nonzero if the registers can be mmap'd into userspace, 0 otherwise
+ *
+ * MMTIMER_GETCOUNTER - required
+ * Gets the current value in the counter
+ */
+#define MMTIMER_IOCTL_BASE 'm'
+
+#define MMTIMER_GETOFFSET _IO(MMTIMER_IOCTL_BASE, 0)
+#define MMTIMER_GETRES _IOR(MMTIMER_IOCTL_BASE, 1, unsigned long)
+#define MMTIMER_GETFREQ _IOR(MMTIMER_IOCTL_BASE, 2, unsigned long)
+#define MMTIMER_GETBITS _IO(MMTIMER_IOCTL_BASE, 4)
+#define MMTIMER_MMAPAVAIL _IO(MMTIMER_IOCTL_BASE, 6)
+#define MMTIMER_GETCOUNTER _IOR(MMTIMER_IOCTL_BASE, 9, unsigned long)
+
+#endif /* _LINUX_MMTIMER_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mqueue.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mqueue.h
new file mode 100644
index 0000000..8b5a796
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mqueue.h
@@ -0,0 +1,53 @@
+/* Copyright (C) 2003 Krzysztof Benedyczak & Michal Wronski
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ It is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _LINUX_MQUEUE_H
+#define _LINUX_MQUEUE_H
+
+#define MQ_PRIO_MAX 32768
+/* per-uid limit of kernel memory used by mqueue, in bytes */
+#define MQ_BYTES_MAX 819200
+
+struct mq_attr {
+ long mq_flags; /* message queue flags */
+ long mq_maxmsg; /* maximum number of messages */
+ long mq_msgsize; /* maximum message size */
+ long mq_curmsgs; /* number of messages currently queued */
+ long __reserved[4]; /* ignored for input, zeroed for output */
+};
+
+/*
+ * SIGEV_THREAD implementation:
+ * SIGEV_THREAD must be implemented in user space. If SIGEV_THREAD is passed
+ * to mq_notify, then
+ * - sigev_signo must be the file descriptor of an AF_NETLINK socket. It's not
+ * necessary that the socket is bound.
+ * - sigev_value.sival_ptr must point to a cookie that is NOTIFY_COOKIE_LEN
+ * bytes long.
+ * If the notification is triggered, then the cookie is sent to the netlink
+ * socket. The last byte of the cookie is replaced with the NOTIFY_?? codes:
+ * NOTIFY_WOKENUP if the notification got triggered, NOTIFY_REMOVED if it was
+ * removed, either due to a close() on the message queue fd or due to a
+ * mq_notify() that removed the notification.
+ */
+#define NOTIFY_NONE 0
+#define NOTIFY_WOKENUP 1
+#define NOTIFY_REMOVED 2
+
+#define NOTIFY_COOKIE_LEN 32
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mroute.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mroute.h
new file mode 100644
index 0000000..ad2289a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mroute.h
@@ -0,0 +1,141 @@
+#ifndef __LINUX_MROUTE_H
+#define __LINUX_MROUTE_H
+
+#include <linux/sockios.h>
+#include <linux/types.h>
+
+/*
+ * Based on the MROUTING 3.5 defines primarily to keep
+ * source compatibility with BSD.
+ *
+ * See the mrouted code for the original history.
+ *
+ * Protocol Independent Multicast (PIM) data structures included
+ * Carlos Picoto (cap@di.fc.ul.pt)
+ *
+ */
+
+#define MRT_BASE 200
+#define MRT_INIT (MRT_BASE) /* Activate the kernel mroute code */
+#define MRT_DONE (MRT_BASE+1) /* Shutdown the kernel mroute */
+#define MRT_ADD_VIF (MRT_BASE+2) /* Add a virtual interface */
+#define MRT_DEL_VIF (MRT_BASE+3) /* Delete a virtual interface */
+#define MRT_ADD_MFC (MRT_BASE+4) /* Add a multicast forwarding entry */
+#define MRT_DEL_MFC (MRT_BASE+5) /* Delete a multicast forwarding entry */
+#define MRT_VERSION (MRT_BASE+6) /* Get the kernel multicast version */
+#define MRT_ASSERT (MRT_BASE+7) /* Activate PIM assert mode */
+#define MRT_PIM (MRT_BASE+8) /* enable PIM code */
+
+#define SIOCGETVIFCNT SIOCPROTOPRIVATE /* IP protocol privates */
+#define SIOCGETSGCNT (SIOCPROTOPRIVATE+1)
+#define SIOCGETRPF (SIOCPROTOPRIVATE+2)
+
+#define MAXVIFS 32
+typedef unsigned long vifbitmap_t; /* User mode code depends on this lot */
+typedef unsigned short vifi_t;
+#define ALL_VIFS ((vifi_t)(-1))
+
+/*
+ * Same idea as select
+ */
+
+#define VIFM_SET(n,m) ((m)|=(1<<(n)))
+#define VIFM_CLR(n,m) ((m)&=~(1<<(n)))
+#define VIFM_ISSET(n,m) ((m)&(1<<(n)))
+#define VIFM_CLRALL(m) ((m)=0)
+#define VIFM_COPY(mfrom,mto) ((mto)=(mfrom))
+#define VIFM_SAME(m1,m2) ((m1)==(m2))
+
+/*
+ * Passed by mrouted for an MRT_ADD_VIF - again we use the
+ * mrouted 3.6 structures for compatibility
+ */
+
+struct vifctl {
+ vifi_t vifc_vifi; /* Index of VIF */
+ unsigned char vifc_flags; /* VIFF_ flags */
+ unsigned char vifc_threshold; /* ttl limit */
+ unsigned int vifc_rate_limit; /* Rate limiter values (NI) */
+ struct in_addr vifc_lcl_addr; /* Our address */
+ struct in_addr vifc_rmt_addr; /* IPIP tunnel addr */
+};
+
+#define VIFF_TUNNEL 0x1 /* IPIP tunnel */
+#define VIFF_SRCRT 0x2 /* NI */
+#define VIFF_REGISTER 0x4 /* register vif */
+
+/*
+ * Cache manipulation structures for mrouted and PIMd
+ */
+
+struct mfcctl
+{
+ struct in_addr mfcc_origin; /* Origin of mcast */
+ struct in_addr mfcc_mcastgrp; /* Group in question */
+ vifi_t mfcc_parent; /* Where it arrived */
+ unsigned char mfcc_ttls[MAXVIFS]; /* Where it is going */
+ unsigned int mfcc_pkt_cnt; /* pkt count for src-grp */
+ unsigned int mfcc_byte_cnt;
+ unsigned int mfcc_wrong_if;
+ int mfcc_expire;
+};
+
+/*
+ * Group count retrieval for mrouted
+ */
+
+struct sioc_sg_req
+{
+ struct in_addr src;
+ struct in_addr grp;
+ unsigned long pktcnt;
+ unsigned long bytecnt;
+ unsigned long wrong_if;
+};
+
+/*
+ * To get vif packet counts
+ */
+
+struct sioc_vif_req
+{
+ vifi_t vifi; /* Which iface */
+ unsigned long icount; /* In packets */
+ unsigned long ocount; /* Out packets */
+ unsigned long ibytes; /* In bytes */
+ unsigned long obytes; /* Out bytes */
+};
+
+/*
+ * This is the format the mroute daemon expects to see IGMP control
+ * data. Magically happens to be like an IP packet as per the original
+ */
+
+struct igmpmsg
+{
+ __u32 unused1,unused2;
+ unsigned char im_msgtype; /* What is this */
+ unsigned char im_mbz; /* Must be zero */
+ unsigned char im_vif; /* Interface (this ought to be a vifi_t!) */
+ unsigned char unused3;
+ struct in_addr im_src,im_dst;
+};
+
+/*
+ * That's all usermode folks
+ */
+
+
+
+#define MFC_ASSERT_THRESH (3*HZ) /* Maximal freq. of asserts */
+
+/*
+ * Pseudo messages used by mrouted
+ */
+
+#define IGMPMSG_NOCACHE 1 /* Kern cache fill request to mrouted */
+#define IGMPMSG_WRONGVIF 2 /* For PIM assert processing (unused) */
+#define IGMPMSG_WHOLEPKT 3 /* For PIM Register processing */
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mroute6.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mroute6.h
new file mode 100644
index 0000000..fb5843d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mroute6.h
@@ -0,0 +1,137 @@
+#ifndef __LINUX_MROUTE6_H
+#define __LINUX_MROUTE6_H
+
+#include <linux/types.h>
+#include <linux/sockios.h>
+
+/*
+ * Based on the MROUTING 3.5 defines primarily to keep
+ * source compatibility with BSD.
+ *
+ * See the pim6sd code for the original history.
+ *
+ * Protocol Independent Multicast (PIM) data structures included
+ * Carlos Picoto (cap@di.fc.ul.pt)
+ *
+ */
+
+#define MRT6_BASE 200
+#define MRT6_INIT (MRT6_BASE) /* Activate the kernel mroute code */
+#define MRT6_DONE (MRT6_BASE+1) /* Shutdown the kernel mroute */
+#define MRT6_ADD_MIF (MRT6_BASE+2) /* Add a virtual interface */
+#define MRT6_DEL_MIF (MRT6_BASE+3) /* Delete a virtual interface */
+#define MRT6_ADD_MFC (MRT6_BASE+4) /* Add a multicast forwarding entry */
+#define MRT6_DEL_MFC (MRT6_BASE+5) /* Delete a multicast forwarding entry */
+#define MRT6_VERSION (MRT6_BASE+6) /* Get the kernel multicast version */
+#define MRT6_ASSERT (MRT6_BASE+7) /* Activate PIM assert mode */
+#define MRT6_PIM (MRT6_BASE+8) /* enable PIM code */
+
+#define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE /* IP protocol privates */
+#define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1)
+#define SIOCGETRPF (SIOCPROTOPRIVATE+2)
+
+#define MAXMIFS 32
+typedef unsigned long mifbitmap_t; /* User mode code depends on this lot */
+typedef unsigned short mifi_t;
+#define ALL_MIFS ((mifi_t)(-1))
+
+#ifndef IF_SETSIZE
+#define IF_SETSIZE 256
+#endif
+
+typedef __u32 if_mask;
+#define NIFBITS (sizeof(if_mask) * 8) /* bits per mask */
+
+#if !defined(__KERNEL__) && !defined(DIV_ROUND_UP)
+#define DIV_ROUND_UP(x,y) (((x) + ((y) - 1)) / (y))
+#endif
+
+typedef struct if_set {
+ if_mask ifs_bits[DIV_ROUND_UP(IF_SETSIZE, NIFBITS)];
+} if_set;
+
+#define IF_SET(n, p) ((p)->ifs_bits[(n)/NIFBITS] |= (1 << ((n) % NIFBITS)))
+#define IF_CLR(n, p) ((p)->ifs_bits[(n)/NIFBITS] &= ~(1 << ((n) % NIFBITS)))
+#define IF_ISSET(n, p) ((p)->ifs_bits[(n)/NIFBITS] & (1 << ((n) % NIFBITS)))
+#define IF_COPY(f, t) bcopy(f, t, sizeof(*(f)))
+#define IF_ZERO(p) bzero(p, sizeof(*(p)))
+
+/*
+ * Passed by mrouted for an MRT_ADD_MIF - again we use the
+ * mrouted 3.6 structures for compatibility
+ */
+
+struct mif6ctl {
+ mifi_t mif6c_mifi; /* Index of MIF */
+ unsigned char mif6c_flags; /* MIFF_ flags */
+ unsigned char vifc_threshold; /* ttl limit */
+ __u16 mif6c_pifi; /* the index of the physical IF */
+ unsigned int vifc_rate_limit; /* Rate limiter values (NI) */
+};
+
+#define MIFF_REGISTER 0x1 /* register vif */
+
+/*
+ * Cache manipulation structures for mrouted and PIMd
+ */
+
+struct mf6cctl
+{
+ struct sockaddr_in6 mf6cc_origin; /* Origin of mcast */
+ struct sockaddr_in6 mf6cc_mcastgrp; /* Group in question */
+ mifi_t mf6cc_parent; /* Where it arrived */
+ struct if_set mf6cc_ifset; /* Where it is going */
+};
+
+/*
+ * Group count retrieval for pim6sd
+ */
+
+struct sioc_sg_req6
+{
+ struct sockaddr_in6 src;
+ struct sockaddr_in6 grp;
+ unsigned long pktcnt;
+ unsigned long bytecnt;
+ unsigned long wrong_if;
+};
+
+/*
+ * To get vif packet counts
+ */
+
+struct sioc_mif_req6
+{
+ mifi_t mifi; /* Which iface */
+ unsigned long icount; /* In packets */
+ unsigned long ocount; /* Out packets */
+ unsigned long ibytes; /* In bytes */
+ unsigned long obytes; /* Out bytes */
+};
+
+/*
+ * That's all usermode folks
+ */
+
+
+
+/*
+ * Structure used to communicate from kernel to multicast router.
+ * We'll overlay the structure onto an MLD header (not an IPv6 heder like igmpmsg{}
+ * used for IPv4 implementation). This is because this structure will be passed via an
+ * IPv6 raw socket, on wich an application will only receiver the payload i.e the data after
+ * the IPv6 header and all the extension headers. (See section 3 of RFC 3542)
+ */
+
+struct mrt6msg {
+#define MRT6MSG_NOCACHE 1
+#define MRT6MSG_WRONGMIF 2
+#define MRT6MSG_WHOLEPKT 3 /* used for use level encap */
+ __u8 im6_mbz; /* must be zero */
+ __u8 im6_msgtype; /* what type of message */
+ __u16 im6_mif; /* mif rec'd on */
+ __u32 im6_pad; /* padding for 64 bit arch */
+ struct in6_addr im6_src, im6_dst;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/msdos_fs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/msdos_fs.h
new file mode 100644
index 0000000..85470e1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/msdos_fs.h
@@ -0,0 +1,165 @@
+#ifndef _LINUX_MSDOS_FS_H
+#define _LINUX_MSDOS_FS_H
+
+#include <linux/types.h>
+#include <linux/magic.h>
+#include <asm/byteorder.h>
+
+/*
+ * The MS-DOS filesystem constants/structures
+ */
+
+#define SECTOR_SIZE 512 /* sector size (bytes) */
+#define SECTOR_BITS 9 /* log2(SECTOR_SIZE) */
+#define MSDOS_DPB (MSDOS_DPS) /* dir entries per block */
+#define MSDOS_DPB_BITS 4 /* log2(MSDOS_DPB) */
+#define MSDOS_DPS (SECTOR_SIZE / sizeof(struct msdos_dir_entry))
+#define MSDOS_DPS_BITS 4 /* log2(MSDOS_DPS) */
+#define CF_LE_W(v) le16_to_cpu(v)
+#define CF_LE_L(v) le32_to_cpu(v)
+#define CT_LE_W(v) cpu_to_le16(v)
+#define CT_LE_L(v) cpu_to_le32(v)
+
+
+#define MSDOS_ROOT_INO 1 /* == MINIX_ROOT_INO */
+#define MSDOS_DIR_BITS 5 /* log2(sizeof(struct msdos_dir_entry)) */
+
+/* directory limit */
+#define FAT_MAX_DIR_ENTRIES (65536)
+#define FAT_MAX_DIR_SIZE (FAT_MAX_DIR_ENTRIES << MSDOS_DIR_BITS)
+
+#define ATTR_NONE 0 /* no attribute bits */
+#define ATTR_RO 1 /* read-only */
+#define ATTR_HIDDEN 2 /* hidden */
+#define ATTR_SYS 4 /* system */
+#define ATTR_VOLUME 8 /* volume label */
+#define ATTR_DIR 16 /* directory */
+#define ATTR_ARCH 32 /* archived */
+
+/* attribute bits that are copied "as is" */
+#define ATTR_UNUSED (ATTR_VOLUME | ATTR_ARCH | ATTR_SYS | ATTR_HIDDEN)
+/* bits that are used by the Windows 95/Windows NT extended FAT */
+#define ATTR_EXT (ATTR_RO | ATTR_HIDDEN | ATTR_SYS | ATTR_VOLUME)
+
+#define CASE_LOWER_BASE 8 /* base is lower case */
+#define CASE_LOWER_EXT 16 /* extension is lower case */
+
+#define DELETED_FLAG 0xe5 /* marks file as deleted when in name[0] */
+#define IS_FREE(n) (!*(n) || *(n) == DELETED_FLAG)
+
+#define MSDOS_NAME 11 /* maximum name length */
+#define MSDOS_LONGNAME 256 /* maximum name length */
+#define MSDOS_SLOTS 21 /* max # of slots for short and long names */
+#define MSDOS_DOT ". " /* ".", padded to MSDOS_NAME chars */
+#define MSDOS_DOTDOT ".. " /* "..", padded to MSDOS_NAME chars */
+
+#define FAT_FIRST_ENT(s, x) ((MSDOS_SB(s)->fat_bits == 32 ? 0x0FFFFF00 : \
+ MSDOS_SB(s)->fat_bits == 16 ? 0xFF00 : 0xF00) | (x))
+
+/* start of data cluster's entry (number of reserved clusters) */
+#define FAT_START_ENT 2
+
+/* maximum number of clusters */
+#define MAX_FAT12 0xFF4
+#define MAX_FAT16 0xFFF4
+#define MAX_FAT32 0x0FFFFFF6
+#define MAX_FAT(s) (MSDOS_SB(s)->fat_bits == 32 ? MAX_FAT32 : \
+ MSDOS_SB(s)->fat_bits == 16 ? MAX_FAT16 : MAX_FAT12)
+
+/* bad cluster mark */
+#define BAD_FAT12 0xFF7
+#define BAD_FAT16 0xFFF7
+#define BAD_FAT32 0x0FFFFFF7
+
+/* standard EOF */
+#define EOF_FAT12 0xFFF
+#define EOF_FAT16 0xFFFF
+#define EOF_FAT32 0x0FFFFFFF
+
+#define FAT_ENT_FREE (0)
+#define FAT_ENT_BAD (BAD_FAT32)
+#define FAT_ENT_EOF (EOF_FAT32)
+
+#define FAT_FSINFO_SIG1 0x41615252
+#define FAT_FSINFO_SIG2 0x61417272
+#define IS_FSINFO(x) (le32_to_cpu((x)->signature1) == FAT_FSINFO_SIG1 \
+ && le32_to_cpu((x)->signature2) == FAT_FSINFO_SIG2)
+
+struct __fat_dirent {
+ long d_ino;
+ __kernel_off_t d_off;
+ unsigned short d_reclen;
+ char d_name[256]; /* We must not include limits.h! */
+};
+
+/*
+ * ioctl commands
+ */
+#define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct __fat_dirent[2])
+#define VFAT_IOCTL_READDIR_SHORT _IOR('r', 2, struct __fat_dirent[2])
+/* <linux/videotext.h> has used 0x72 ('r') in collision, so skip a few */
+#define FAT_IOCTL_GET_ATTRIBUTES _IOR('r', 0x10, __u32)
+#define FAT_IOCTL_SET_ATTRIBUTES _IOW('r', 0x11, __u32)
+
+struct fat_boot_sector {
+ __u8 ignored[3]; /* Boot strap short or near jump */
+ __u8 system_id[8]; /* Name - can be used to special case
+ partition manager volumes */
+ __u8 sector_size[2]; /* bytes per logical sector */
+ __u8 sec_per_clus; /* sectors/cluster */
+ __le16 reserved; /* reserved sectors */
+ __u8 fats; /* number of FATs */
+ __u8 dir_entries[2]; /* root directory entries */
+ __u8 sectors[2]; /* number of sectors */
+ __u8 media; /* media code */
+ __le16 fat_length; /* sectors/FAT */
+ __le16 secs_track; /* sectors per track */
+ __le16 heads; /* number of heads */
+ __le32 hidden; /* hidden sectors (unused) */
+ __le32 total_sect; /* number of sectors (if sectors == 0) */
+
+ /* The following fields are only used by FAT32 */
+ __le32 fat32_length; /* sectors/FAT */
+ __le16 flags; /* bit 8: fat mirroring, low 4: active fat */
+ __u8 version[2]; /* major, minor filesystem version */
+ __le32 root_cluster; /* first cluster in root directory */
+ __le16 info_sector; /* filesystem info sector */
+ __le16 backup_boot; /* backup boot sector */
+ __le16 reserved2[6]; /* Unused */
+};
+
+struct fat_boot_fsinfo {
+ __le32 signature1; /* 0x41615252L */
+ __le32 reserved1[120]; /* Nothing as far as I can tell */
+ __le32 signature2; /* 0x61417272L */
+ __le32 free_clusters; /* Free cluster count. -1 if unknown */
+ __le32 next_cluster; /* Most recently allocated cluster */
+ __le32 reserved2[4];
+};
+
+struct msdos_dir_entry {
+ __u8 name[MSDOS_NAME];/* name and extension */
+ __u8 attr; /* attribute bits */
+ __u8 lcase; /* Case for base and extension */
+ __u8 ctime_cs; /* Creation time, centiseconds (0-199) */
+ __le16 ctime; /* Creation time */
+ __le16 cdate; /* Creation date */
+ __le16 adate; /* Last access date */
+ __le16 starthi; /* High 16 bits of cluster in FAT32 */
+ __le16 time,date,start;/* time, date and first cluster */
+ __le32 size; /* file size (in bytes) */
+};
+
+/* Up to 13 characters of the name */
+struct msdos_dir_slot {
+ __u8 id; /* sequence number for slot */
+ __u8 name0_4[10]; /* first 5 characters in name */
+ __u8 attr; /* attribute byte */
+ __u8 reserved; /* always 0 */
+ __u8 alias_checksum; /* checksum for 8.3 alias */
+ __u8 name5_10[12]; /* 6 more characters in name */
+ __le16 start; /* starting cluster number, 0 in long slots */
+ __u8 name11_12[4]; /* last 2 characters in name */
+};
+
+#endif /* !_LINUX_MSDOS_FS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/msg.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/msg.h
new file mode 100644
index 0000000..cef8e30
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/msg.h
@@ -0,0 +1,75 @@
+#ifndef _LINUX_MSG_H
+#define _LINUX_MSG_H
+
+#include <linux/ipc.h>
+
+/* ipcs ctl commands */
+#define MSG_STAT 11
+#define MSG_INFO 12
+
+/* msgrcv options */
+#define MSG_NOERROR 010000 /* no error if message is too big */
+#define MSG_EXCEPT 020000 /* recv any msg except of specified type.*/
+
+/* Obsolete, used only for backwards compatibility and libc5 compiles */
+struct msqid_ds {
+ struct ipc_perm msg_perm;
+ struct msg *msg_first; /* first message on queue,unused */
+ struct msg *msg_last; /* last message in queue,unused */
+ __kernel_time_t msg_stime; /* last msgsnd time */
+ __kernel_time_t msg_rtime; /* last msgrcv time */
+ __kernel_time_t msg_ctime; /* last change time */
+ unsigned long msg_lcbytes; /* Reuse junk fields for 32 bit */
+ unsigned long msg_lqbytes; /* ditto */
+ unsigned short msg_cbytes; /* current number of bytes on queue */
+ unsigned short msg_qnum; /* number of messages in queue */
+ unsigned short msg_qbytes; /* max number of bytes on queue */
+ __kernel_ipc_pid_t msg_lspid; /* pid of last msgsnd */
+ __kernel_ipc_pid_t msg_lrpid; /* last receive pid */
+};
+
+/* Include the definition of msqid64_ds */
+#include <asm/msgbuf.h>
+
+/* message buffer for msgsnd and msgrcv calls */
+struct msgbuf {
+ long mtype; /* type of message */
+ char mtext[1]; /* message text */
+};
+
+/* buffer for msgctl calls IPC_INFO, MSG_INFO */
+struct msginfo {
+ int msgpool;
+ int msgmap;
+ int msgmax;
+ int msgmnb;
+ int msgmni;
+ int msgssz;
+ int msgtql;
+ unsigned short msgseg;
+};
+
+/*
+ * Scaling factor to compute msgmni:
+ * the memory dedicated to msg queues (msgmni * msgmnb) should occupy
+ * at most 1/MSG_MEM_SCALE of the lowmem (see the formula in ipc/msg.c):
+ * up to 8MB : msgmni = 16 (MSGMNI)
+ * 4 GB : msgmni = 8K
+ * more than 16 GB : msgmni = 32K (IPCMNI)
+ */
+#define MSG_MEM_SCALE 32
+
+#define MSGMNI 16 /* <= IPCMNI */ /* max # of msg queue identifiers */
+#define MSGMAX 8192 /* <= INT_MAX */ /* max size of message (bytes) */
+#define MSGMNB 16384 /* <= INT_MAX */ /* default max size of a message queue */
+
+/* unused */
+#define MSGPOOL (MSGMNI * MSGMNB / 1024) /* size in kbytes of message pool */
+#define MSGTQL MSGMNB /* number of system message headers */
+#define MSGMAP MSGMNB /* number of entries in message map */
+#define MSGSSZ 16 /* message segment size */
+#define __MSGSEG ((MSGPOOL * 1024) / MSGSSZ) /* max no. of segments */
+#define MSGSEG (__MSGSEG <= 0xffff ? __MSGSEG : 0xffff)
+
+
+#endif /* _LINUX_MSG_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mtio.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mtio.h
new file mode 100644
index 0000000..ef01d6a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/mtio.h
@@ -0,0 +1,206 @@
+/*
+ * linux/mtio.h header file for Linux. Written by H. Bergman
+ *
+ * Modified for special ioctls provided by zftape in September 1997
+ * by C.-J. Heine.
+ */
+
+#ifndef _LINUX_MTIO_H
+#define _LINUX_MTIO_H
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+
+/*
+ * Structures and definitions for mag tape io control commands
+ */
+
+/* structure for MTIOCTOP - mag tape op command */
+struct mtop {
+ short mt_op; /* operations defined below */
+ int mt_count; /* how many of them */
+};
+
+/* Magnetic Tape operations [Not all operations supported by all drivers]: */
+#define MTRESET 0 /* +reset drive in case of problems */
+#define MTFSF 1 /* forward space over FileMark,
+ * position at first record of next file
+ */
+#define MTBSF 2 /* backward space FileMark (position before FM) */
+#define MTFSR 3 /* forward space record */
+#define MTBSR 4 /* backward space record */
+#define MTWEOF 5 /* write an end-of-file record (mark) */
+#define MTREW 6 /* rewind */
+#define MTOFFL 7 /* rewind and put the drive offline (eject?) */
+#define MTNOP 8 /* no op, set status only (read with MTIOCGET) */
+#define MTRETEN 9 /* retension tape */
+#define MTBSFM 10 /* +backward space FileMark, position at FM */
+#define MTFSFM 11 /* +forward space FileMark, position at FM */
+#define MTEOM 12 /* goto end of recorded media (for appending files).
+ * MTEOM positions after the last FM, ready for
+ * appending another file.
+ */
+#define MTERASE 13 /* erase tape -- be careful! */
+
+#define MTRAS1 14 /* run self test 1 (nondestructive) */
+#define MTRAS2 15 /* run self test 2 (destructive) */
+#define MTRAS3 16 /* reserved for self test 3 */
+
+#define MTSETBLK 20 /* set block length (SCSI) */
+#define MTSETDENSITY 21 /* set tape density (SCSI) */
+#define MTSEEK 22 /* seek to block (Tandberg, etc.) */
+#define MTTELL 23 /* tell block (Tandberg, etc.) */
+#define MTSETDRVBUFFER 24 /* set the drive buffering according to SCSI-2 */
+ /* ordinary buffered operation with code 1 */
+#define MTFSS 25 /* space forward over setmarks */
+#define MTBSS 26 /* space backward over setmarks */
+#define MTWSM 27 /* write setmarks */
+
+#define MTLOCK 28 /* lock the drive door */
+#define MTUNLOCK 29 /* unlock the drive door */
+#define MTLOAD 30 /* execute the SCSI load command */
+#define MTUNLOAD 31 /* execute the SCSI unload command */
+#define MTCOMPRESSION 32/* control compression with SCSI mode page 15 */
+#define MTSETPART 33 /* Change the active tape partition */
+#define MTMKPART 34 /* Format the tape with one or two partitions */
+
+/* structure for MTIOCGET - mag tape get status command */
+
+struct mtget {
+ long mt_type; /* type of magtape device */
+ long mt_resid; /* residual count: (not sure)
+ * number of bytes ignored, or
+ * number of files not skipped, or
+ * number of records not skipped.
+ */
+ /* the following registers are device dependent */
+ long mt_dsreg; /* status register */
+ long mt_gstat; /* generic (device independent) status */
+ long mt_erreg; /* error register */
+ /* The next two fields are not always used */
+ __kernel_daddr_t mt_fileno; /* number of current file on tape */
+ __kernel_daddr_t mt_blkno; /* current block number */
+};
+
+
+
+/*
+ * Constants for mt_type. Not all of these are supported,
+ * and these are not all of the ones that are supported.
+ */
+#define MT_ISUNKNOWN 0x01
+#define MT_ISQIC02 0x02 /* Generic QIC-02 tape streamer */
+#define MT_ISWT5150 0x03 /* Wangtek 5150EQ, QIC-150, QIC-02 */
+#define MT_ISARCHIVE_5945L2 0x04 /* Archive 5945L-2, QIC-24, QIC-02? */
+#define MT_ISCMSJ500 0x05 /* CMS Jumbo 500 (QIC-02?) */
+#define MT_ISTDC3610 0x06 /* Tandberg 6310, QIC-24 */
+#define MT_ISARCHIVE_VP60I 0x07 /* Archive VP60i, QIC-02 */
+#define MT_ISARCHIVE_2150L 0x08 /* Archive Viper 2150L */
+#define MT_ISARCHIVE_2060L 0x09 /* Archive Viper 2060L */
+#define MT_ISARCHIVESC499 0x0A /* Archive SC-499 QIC-36 controller */
+#define MT_ISQIC02_ALL_FEATURES 0x0F /* Generic QIC-02 with all features */
+#define MT_ISWT5099EEN24 0x11 /* Wangtek 5099-een24, 60MB, QIC-24 */
+#define MT_ISTEAC_MT2ST 0x12 /* Teac MT-2ST 155mb drive, Teac DC-1 card (Wangtek type) */
+#define MT_ISEVEREX_FT40A 0x32 /* Everex FT40A (QIC-40) */
+#define MT_ISDDS1 0x51 /* DDS device without partitions */
+#define MT_ISDDS2 0x52 /* DDS device with partitions */
+#define MT_ISONSTREAM_SC 0x61 /* OnStream SCSI tape drives (SC-x0)
+ and SCSI emulated (DI, DP, USB) */
+#define MT_ISSCSI1 0x71 /* Generic ANSI SCSI-1 tape unit */
+#define MT_ISSCSI2 0x72 /* Generic ANSI SCSI-2 tape unit */
+
+/* QIC-40/80/3010/3020 ftape supported drives.
+ * 20bit vendor ID + 0x800000 (see ftape-vendors.h)
+ */
+#define MT_ISFTAPE_UNKNOWN 0x800000 /* obsolete */
+#define MT_ISFTAPE_FLAG 0x800000
+
+
+/* structure for MTIOCPOS - mag tape get position command */
+
+struct mtpos {
+ long mt_blkno; /* current block number */
+};
+
+
+/* mag tape io control commands */
+#define MTIOCTOP _IOW('m', 1, struct mtop) /* do a mag tape op */
+#define MTIOCGET _IOR('m', 2, struct mtget) /* get tape status */
+#define MTIOCPOS _IOR('m', 3, struct mtpos) /* get tape position */
+
+
+/* Generic Mag Tape (device independent) status macros for examining
+ * mt_gstat -- HP-UX compatible.
+ * There is room for more generic status bits here, but I don't
+ * know which of them are reserved. At least three or so should
+ * be added to make this really useful.
+ */
+#define GMT_EOF(x) ((x) & 0x80000000)
+#define GMT_BOT(x) ((x) & 0x40000000)
+#define GMT_EOT(x) ((x) & 0x20000000)
+#define GMT_SM(x) ((x) & 0x10000000) /* DDS setmark */
+#define GMT_EOD(x) ((x) & 0x08000000) /* DDS EOD */
+#define GMT_WR_PROT(x) ((x) & 0x04000000)
+/* #define GMT_ ? ((x) & 0x02000000) */
+#define GMT_ONLINE(x) ((x) & 0x01000000)
+#define GMT_D_6250(x) ((x) & 0x00800000)
+#define GMT_D_1600(x) ((x) & 0x00400000)
+#define GMT_D_800(x) ((x) & 0x00200000)
+/* #define GMT_ ? ((x) & 0x00100000) */
+/* #define GMT_ ? ((x) & 0x00080000) */
+#define GMT_DR_OPEN(x) ((x) & 0x00040000) /* door open (no tape) */
+/* #define GMT_ ? ((x) & 0x00020000) */
+#define GMT_IM_REP_EN(x) ((x) & 0x00010000) /* immediate report mode */
+#define GMT_CLN(x) ((x) & 0x00008000) /* cleaning requested */
+/* 15 generic status bits unused */
+
+
+/* SCSI-tape specific definitions */
+/* Bitfield shifts in the status */
+#define MT_ST_BLKSIZE_SHIFT 0
+#define MT_ST_BLKSIZE_MASK 0xffffff
+#define MT_ST_DENSITY_SHIFT 24
+#define MT_ST_DENSITY_MASK 0xff000000
+
+#define MT_ST_SOFTERR_SHIFT 0
+#define MT_ST_SOFTERR_MASK 0xffff
+
+/* Bitfields for the MTSETDRVBUFFER ioctl */
+#define MT_ST_OPTIONS 0xf0000000
+#define MT_ST_BOOLEANS 0x10000000
+#define MT_ST_SETBOOLEANS 0x30000000
+#define MT_ST_CLEARBOOLEANS 0x40000000
+#define MT_ST_WRITE_THRESHOLD 0x20000000
+#define MT_ST_DEF_BLKSIZE 0x50000000
+#define MT_ST_DEF_OPTIONS 0x60000000
+#define MT_ST_TIMEOUTS 0x70000000
+#define MT_ST_SET_TIMEOUT (MT_ST_TIMEOUTS | 0x000000)
+#define MT_ST_SET_LONG_TIMEOUT (MT_ST_TIMEOUTS | 0x100000)
+#define MT_ST_SET_CLN 0x80000000
+
+#define MT_ST_BUFFER_WRITES 0x1
+#define MT_ST_ASYNC_WRITES 0x2
+#define MT_ST_READ_AHEAD 0x4
+#define MT_ST_DEBUGGING 0x8
+#define MT_ST_TWO_FM 0x10
+#define MT_ST_FAST_MTEOM 0x20
+#define MT_ST_AUTO_LOCK 0x40
+#define MT_ST_DEF_WRITES 0x80
+#define MT_ST_CAN_BSR 0x100
+#define MT_ST_NO_BLKLIMS 0x200
+#define MT_ST_CAN_PARTITIONS 0x400
+#define MT_ST_SCSI2LOGICAL 0x800
+#define MT_ST_SYSV 0x1000
+#define MT_ST_NOWAIT 0x2000
+#define MT_ST_SILI 0x4000
+
+/* The mode parameters to be controlled. Parameter chosen with bits 20-28 */
+#define MT_ST_CLEAR_DEFAULT 0xfffff
+#define MT_ST_DEF_DENSITY (MT_ST_DEF_OPTIONS | 0x100000)
+#define MT_ST_DEF_COMPRESSION (MT_ST_DEF_OPTIONS | 0x200000)
+#define MT_ST_DEF_DRVBUFFER (MT_ST_DEF_OPTIONS | 0x300000)
+
+/* The offset for the arguments for the special HP changer load command. */
+#define MT_ST_HPLOADER_OFFSET 10000
+
+#endif /* _LINUX_MTIO_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/n_r3964.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/n_r3964.h
new file mode 100644
index 0000000..f716807
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/n_r3964.h
@@ -0,0 +1,99 @@
+/* r3964 linediscipline for linux
+ *
+ * -----------------------------------------------------------
+ * Copyright by
+ * Philips Automation Projects
+ * Kassel (Germany)
+ * http://www.pap-philips.de
+ * -----------------------------------------------------------
+ * This software may be used and distributed according to the terms of
+ * the GNU General Public License, incorporated herein by reference.
+ *
+ * Author:
+ * L. Haag
+ *
+ * $Log: r3964.h,v $
+ * Revision 1.4 2005/12/21 19:54:24 Kurt Huwig <kurt huwig de>
+ * Fixed HZ usage on 2.6 kernels
+ * Removed unnecessary include
+ *
+ * Revision 1.3 2001/03/18 13:02:24 dwmw2
+ * Fix timer usage, use spinlocks properly.
+ *
+ * Revision 1.2 2001/03/18 12:53:15 dwmw2
+ * Merge changes in 2.4.2
+ *
+ * Revision 1.1.1.1 1998/10/13 16:43:14 dwmw2
+ * This'll screw the version control
+ *
+ * Revision 1.6 1998/09/30 00:40:38 dwmw2
+ * Updated to use kernel's N_R3964 if available
+ *
+ * Revision 1.4 1998/04/02 20:29:44 lhaag
+ * select, blocking, ...
+ *
+ * Revision 1.3 1998/02/12 18:58:43 root
+ * fixed some memory leaks
+ * calculation of checksum characters
+ *
+ * Revision 1.2 1998/02/07 13:03:17 root
+ * ioctl read_telegram
+ *
+ * Revision 1.1 1998/02/06 19:19:43 root
+ * Initial revision
+ *
+ *
+ */
+
+#ifndef __LINUX_N_R3964_H__
+#define __LINUX_N_R3964_H__
+
+/* line disciplines for r3964 protocol */
+
+
+/*
+ * Ioctl-commands
+ */
+
+#define R3964_ENABLE_SIGNALS 0x5301
+#define R3964_SETPRIORITY 0x5302
+#define R3964_USE_BCC 0x5303
+#define R3964_READ_TELEGRAM 0x5304
+
+/* Options for R3964_SETPRIORITY */
+#define R3964_MASTER 0
+#define R3964_SLAVE 1
+
+/* Options for R3964_ENABLE_SIGNALS */
+#define R3964_SIG_ACK 0x0001
+#define R3964_SIG_DATA 0x0002
+#define R3964_SIG_ALL 0x000f
+#define R3964_SIG_NONE 0x0000
+#define R3964_USE_SIGIO 0x1000
+
+/*
+ * r3964 operation states:
+ */
+
+/* types for msg_id: */
+enum {R3964_MSG_ACK=1, R3964_MSG_DATA };
+
+#define R3964_MAX_MSG_COUNT 32
+
+/* error codes for client messages */
+#define R3964_OK 0 /* no error. */
+#define R3964_TX_FAIL -1 /* transmission error, block NOT sent */
+#define R3964_OVERFLOW -2 /* msg queue overflow */
+
+/* the client gets this struct when calling read(fd,...): */
+struct r3964_client_message {
+ int msg_id;
+ int arg;
+ int error_code;
+};
+
+#define R3964_MTU 256
+
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nbd.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nbd.h
new file mode 100644
index 0000000..6eab0ab
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nbd.h
@@ -0,0 +1,68 @@
+/*
+ * 1999 Copyright (C) Pavel Machek, pavel@ucw.cz. This code is GPL.
+ * 1999/11/04 Copyright (C) 1999 VMware, Inc. (Regis "HPReg" Duchesne)
+ * Made nbd_end_request() use the io_request_lock
+ * 2001 Copyright (C) Steven Whitehouse
+ * New nbd_end_request() for compatibility with new linux block
+ * layer code.
+ * 2003/06/24 Louis D. Langholtz <ldl@aros.net>
+ * Removed unneeded blksize_bits field from nbd_device struct.
+ * Cleanup PARANOIA usage & code.
+ * 2004/02/19 Paul Clements
+ * Removed PARANOIA, plus various cleanup and comments
+ */
+
+#ifndef LINUX_NBD_H
+#define LINUX_NBD_H
+
+#include <linux/types.h>
+
+#define NBD_SET_SOCK _IO( 0xab, 0 )
+#define NBD_SET_BLKSIZE _IO( 0xab, 1 )
+#define NBD_SET_SIZE _IO( 0xab, 2 )
+#define NBD_DO_IT _IO( 0xab, 3 )
+#define NBD_CLEAR_SOCK _IO( 0xab, 4 )
+#define NBD_CLEAR_QUE _IO( 0xab, 5 )
+#define NBD_PRINT_DEBUG _IO( 0xab, 6 )
+#define NBD_SET_SIZE_BLOCKS _IO( 0xab, 7 )
+#define NBD_DISCONNECT _IO( 0xab, 8 )
+#define NBD_SET_TIMEOUT _IO( 0xab, 9 )
+
+enum {
+ NBD_CMD_READ = 0,
+ NBD_CMD_WRITE = 1,
+ NBD_CMD_DISC = 2
+};
+
+#define nbd_cmd(req) ((req)->cmd[0])
+
+/* userspace doesn't need the nbd_device structure */
+
+/* These are sent over the network in the request/reply magic fields */
+
+#define NBD_REQUEST_MAGIC 0x25609513
+#define NBD_REPLY_MAGIC 0x67446698
+/* Do *not* use magics: 0x12560953 0x96744668. */
+
+/*
+ * This is the packet used for communication between client and
+ * server. All data are in network byte order.
+ */
+struct nbd_request {
+ __be32 magic;
+ __be32 type; /* == READ || == WRITE */
+ char handle[8];
+ __be64 from;
+ __be32 len;
+} __attribute__ ((packed));
+
+/*
+ * This is the reply packet that nbd-server sends back to the client after
+ * it has completed an I/O request (or an error occurs).
+ */
+struct nbd_reply {
+ __be32 magic;
+ __be32 error; /* 0 = ok, else error */
+ char handle[8]; /* handle you got from request */
+};
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ncp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ncp.h
new file mode 100644
index 0000000..4482ad7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ncp.h
@@ -0,0 +1,198 @@
+/*
+ * ncp.h
+ *
+ * Copyright (C) 1995 by Volker Lendecke
+ * Modified for sparc by J.F. Chadima
+ * Modified for __constant_ntoh by Frank A. Vorstenbosch
+ *
+ */
+
+#ifndef _LINUX_NCP_H
+#define _LINUX_NCP_H
+
+#include <linux/types.h>
+
+#define NCP_PTYPE (0x11)
+#define NCP_PORT (0x0451)
+
+#define NCP_ALLOC_SLOT_REQUEST (0x1111)
+#define NCP_REQUEST (0x2222)
+#define NCP_DEALLOC_SLOT_REQUEST (0x5555)
+
+struct ncp_request_header {
+ __u16 type;
+ __u8 sequence;
+ __u8 conn_low;
+ __u8 task;
+ __u8 conn_high;
+ __u8 function;
+ __u8 data[0];
+} __attribute__((packed));
+
+#define NCP_REPLY (0x3333)
+#define NCP_WATCHDOG (0x3E3E)
+#define NCP_POSITIVE_ACK (0x9999)
+
+struct ncp_reply_header {
+ __u16 type;
+ __u8 sequence;
+ __u8 conn_low;
+ __u8 task;
+ __u8 conn_high;
+ __u8 completion_code;
+ __u8 connection_state;
+ __u8 data[0];
+} __attribute__((packed));
+
+#define NCP_VOLNAME_LEN (16)
+#define NCP_NUMBER_OF_VOLUMES (256)
+struct ncp_volume_info {
+ __u32 total_blocks;
+ __u32 free_blocks;
+ __u32 purgeable_blocks;
+ __u32 not_yet_purgeable_blocks;
+ __u32 total_dir_entries;
+ __u32 available_dir_entries;
+ __u8 sectors_per_block;
+ char volume_name[NCP_VOLNAME_LEN + 1];
+};
+
+#define AR_READ (cpu_to_le16(1))
+#define AR_WRITE (cpu_to_le16(2))
+#define AR_EXCLUSIVE (cpu_to_le16(0x20))
+
+#define NCP_FILE_ID_LEN 6
+
+/* Defines for Name Spaces */
+#define NW_NS_DOS 0
+#define NW_NS_MAC 1
+#define NW_NS_NFS 2
+#define NW_NS_FTAM 3
+#define NW_NS_OS2 4
+
+/* Defines for ReturnInformationMask */
+#define RIM_NAME (cpu_to_le32(1))
+#define RIM_SPACE_ALLOCATED (cpu_to_le32(2))
+#define RIM_ATTRIBUTES (cpu_to_le32(4))
+#define RIM_DATA_SIZE (cpu_to_le32(8))
+#define RIM_TOTAL_SIZE (cpu_to_le32(0x10))
+#define RIM_EXT_ATTR_INFO (cpu_to_le32(0x20))
+#define RIM_ARCHIVE (cpu_to_le32(0x40))
+#define RIM_MODIFY (cpu_to_le32(0x80))
+#define RIM_CREATION (cpu_to_le32(0x100))
+#define RIM_OWNING_NAMESPACE (cpu_to_le32(0x200))
+#define RIM_DIRECTORY (cpu_to_le32(0x400))
+#define RIM_RIGHTS (cpu_to_le32(0x800))
+#define RIM_ALL (cpu_to_le32(0xFFF))
+#define RIM_COMPRESSED_INFO (cpu_to_le32(0x80000000))
+
+/* Defines for NSInfoBitMask */
+#define NSIBM_NFS_NAME 0x0001
+#define NSIBM_NFS_MODE 0x0002
+#define NSIBM_NFS_GID 0x0004
+#define NSIBM_NFS_NLINKS 0x0008
+#define NSIBM_NFS_RDEV 0x0010
+#define NSIBM_NFS_LINK 0x0020
+#define NSIBM_NFS_CREATED 0x0040
+#define NSIBM_NFS_UID 0x0080
+#define NSIBM_NFS_ACSFLAG 0x0100
+#define NSIBM_NFS_MYFLAG 0x0200
+
+/* open/create modes */
+#define OC_MODE_OPEN 0x01
+#define OC_MODE_TRUNCATE 0x02
+#define OC_MODE_REPLACE 0x02
+#define OC_MODE_CREATE 0x08
+
+/* open/create results */
+#define OC_ACTION_NONE 0x00
+#define OC_ACTION_OPEN 0x01
+#define OC_ACTION_CREATE 0x02
+#define OC_ACTION_TRUNCATE 0x04
+#define OC_ACTION_REPLACE 0x04
+
+/* access rights attributes */
+#ifndef AR_READ_ONLY
+#define AR_READ_ONLY 0x0001
+#define AR_WRITE_ONLY 0x0002
+#define AR_DENY_READ 0x0004
+#define AR_DENY_WRITE 0x0008
+#define AR_COMPATIBILITY 0x0010
+#define AR_WRITE_THROUGH 0x0040
+#define AR_OPEN_COMPRESSED 0x0100
+#endif
+
+struct nw_nfs_info {
+ __u32 mode;
+ __u32 rdev;
+};
+
+struct nw_info_struct {
+ __u32 spaceAlloc;
+ __le32 attributes;
+ __u16 flags;
+ __le32 dataStreamSize;
+ __le32 totalStreamSize;
+ __u16 numberOfStreams;
+ __le16 creationTime;
+ __le16 creationDate;
+ __u32 creatorID;
+ __le16 modifyTime;
+ __le16 modifyDate;
+ __u32 modifierID;
+ __le16 lastAccessDate;
+ __u16 archiveTime;
+ __u16 archiveDate;
+ __u32 archiverID;
+ __u16 inheritedRightsMask;
+ __le32 dirEntNum;
+ __le32 DosDirNum;
+ __u32 volNumber;
+ __u32 EADataSize;
+ __u32 EAKeyCount;
+ __u32 EAKeySize;
+ __u32 NSCreator;
+ __u8 nameLen;
+ __u8 entryName[256];
+ /* libncp may depend on there being nothing after entryName */
+} __attribute__((packed));
+
+/* modify mask - use with MODIFY_DOS_INFO structure */
+#define DM_ATTRIBUTES (cpu_to_le32(0x02))
+#define DM_CREATE_DATE (cpu_to_le32(0x04))
+#define DM_CREATE_TIME (cpu_to_le32(0x08))
+#define DM_CREATOR_ID (cpu_to_le32(0x10))
+#define DM_ARCHIVE_DATE (cpu_to_le32(0x20))
+#define DM_ARCHIVE_TIME (cpu_to_le32(0x40))
+#define DM_ARCHIVER_ID (cpu_to_le32(0x80))
+#define DM_MODIFY_DATE (cpu_to_le32(0x0100))
+#define DM_MODIFY_TIME (cpu_to_le32(0x0200))
+#define DM_MODIFIER_ID (cpu_to_le32(0x0400))
+#define DM_LAST_ACCESS_DATE (cpu_to_le32(0x0800))
+#define DM_INHERITED_RIGHTS_MASK (cpu_to_le32(0x1000))
+#define DM_MAXIMUM_SPACE (cpu_to_le32(0x2000))
+
+struct nw_modify_dos_info {
+ __le32 attributes;
+ __le16 creationDate;
+ __le16 creationTime;
+ __u32 creatorID;
+ __le16 modifyDate;
+ __le16 modifyTime;
+ __u32 modifierID;
+ __u16 archiveDate;
+ __u16 archiveTime;
+ __u32 archiverID;
+ __le16 lastAccessDate;
+ __u16 inheritanceGrantMask;
+ __u16 inheritanceRevokeMask;
+ __u32 maximumSpace;
+} __attribute__((packed));
+
+struct nw_search_sequence {
+ __u8 volNumber;
+ __u32 dirBase;
+ __u32 sequence;
+} __attribute__((packed));
+
+#endif /* _LINUX_NCP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ncp_fs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ncp_fs.h
new file mode 100644
index 0000000..b542047
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ncp_fs.h
@@ -0,0 +1,147 @@
+/*
+ * ncp_fs.h
+ *
+ * Copyright (C) 1995, 1996 by Volker Lendecke
+ *
+ */
+
+#ifndef _LINUX_NCP_FS_H
+#define _LINUX_NCP_FS_H
+
+#include <linux/fs.h>
+#include <linux/in.h>
+#include <linux/types.h>
+#include <linux/magic.h>
+
+#include <linux/ipx.h>
+#include <linux/ncp_no.h>
+
+/*
+ * ioctl commands
+ */
+
+struct ncp_ioctl_request {
+ unsigned int function;
+ unsigned int size;
+ char *data;
+};
+
+struct ncp_fs_info {
+ int version;
+ struct sockaddr_ipx addr;
+ __kernel_uid_t mounted_uid;
+ int connection; /* Connection number the server assigned us */
+ int buffer_size; /* The negotiated buffer size, to be
+ used for read/write requests! */
+
+ int volume_number;
+ __le32 directory_id;
+};
+
+struct ncp_fs_info_v2 {
+ int version;
+ unsigned long mounted_uid;
+ unsigned int connection;
+ unsigned int buffer_size;
+
+ unsigned int volume_number;
+ __le32 directory_id;
+
+ __u32 dummy1;
+ __u32 dummy2;
+ __u32 dummy3;
+};
+
+struct ncp_sign_init
+{
+ char sign_root[8];
+ char sign_last[16];
+};
+
+struct ncp_lock_ioctl
+{
+#define NCP_LOCK_LOG 0
+#define NCP_LOCK_SH 1
+#define NCP_LOCK_EX 2
+#define NCP_LOCK_CLEAR 256
+ int cmd;
+ int origin;
+ unsigned int offset;
+ unsigned int length;
+#define NCP_LOCK_DEFAULT_TIMEOUT 18
+#define NCP_LOCK_MAX_TIMEOUT 180
+ int timeout;
+};
+
+struct ncp_setroot_ioctl
+{
+ int volNumber;
+ int namespace;
+ __le32 dirEntNum;
+};
+
+struct ncp_objectname_ioctl
+{
+#define NCP_AUTH_NONE 0x00
+#define NCP_AUTH_BIND 0x31
+#define NCP_AUTH_NDS 0x32
+ int auth_type;
+ size_t object_name_len;
+ void * object_name; /* a userspace data, in most cases user name */
+};
+
+struct ncp_privatedata_ioctl
+{
+ size_t len;
+ void * data; /* ~1000 for NDS */
+};
+
+/* NLS charsets by ioctl */
+#define NCP_IOCSNAME_LEN 20
+struct ncp_nls_ioctl
+{
+ unsigned char codepage[NCP_IOCSNAME_LEN+1];
+ unsigned char iocharset[NCP_IOCSNAME_LEN+1];
+};
+
+#define NCP_IOC_NCPREQUEST _IOR('n', 1, struct ncp_ioctl_request)
+#define NCP_IOC_GETMOUNTUID _IOW('n', 2, __kernel_old_uid_t)
+#define NCP_IOC_GETMOUNTUID2 _IOW('n', 2, unsigned long)
+
+#define NCP_IOC_CONN_LOGGED_IN _IO('n', 3)
+
+#define NCP_GET_FS_INFO_VERSION (1)
+#define NCP_IOC_GET_FS_INFO _IOWR('n', 4, struct ncp_fs_info)
+#define NCP_GET_FS_INFO_VERSION_V2 (2)
+#define NCP_IOC_GET_FS_INFO_V2 _IOWR('n', 4, struct ncp_fs_info_v2)
+
+#define NCP_IOC_SIGN_INIT _IOR('n', 5, struct ncp_sign_init)
+#define NCP_IOC_SIGN_WANTED _IOR('n', 6, int)
+#define NCP_IOC_SET_SIGN_WANTED _IOW('n', 6, int)
+
+#define NCP_IOC_LOCKUNLOCK _IOR('n', 7, struct ncp_lock_ioctl)
+
+#define NCP_IOC_GETROOT _IOW('n', 8, struct ncp_setroot_ioctl)
+#define NCP_IOC_SETROOT _IOR('n', 8, struct ncp_setroot_ioctl)
+
+#define NCP_IOC_GETOBJECTNAME _IOWR('n', 9, struct ncp_objectname_ioctl)
+#define NCP_IOC_SETOBJECTNAME _IOR('n', 9, struct ncp_objectname_ioctl)
+#define NCP_IOC_GETPRIVATEDATA _IOWR('n', 10, struct ncp_privatedata_ioctl)
+#define NCP_IOC_SETPRIVATEDATA _IOR('n', 10, struct ncp_privatedata_ioctl)
+
+#define NCP_IOC_GETCHARSETS _IOWR('n', 11, struct ncp_nls_ioctl)
+#define NCP_IOC_SETCHARSETS _IOR('n', 11, struct ncp_nls_ioctl)
+
+#define NCP_IOC_GETDENTRYTTL _IOW('n', 12, __u32)
+#define NCP_IOC_SETDENTRYTTL _IOR('n', 12, __u32)
+
+/*
+ * The packet size to allocate. One page should be enough.
+ */
+#define NCP_PACKET_SIZE 4070
+
+#define NCP_MAXPATHLEN 255
+#define NCP_MAXNAMELEN 14
+
+
+#endif /* _LINUX_NCP_FS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ncp_mount.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ncp_mount.h
new file mode 100644
index 0000000..ebe4a2e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ncp_mount.h
@@ -0,0 +1,72 @@
+/*
+ * ncp_mount.h
+ *
+ * Copyright (C) 1995, 1996 by Volker Lendecke
+ *
+ */
+
+#ifndef _LINUX_NCP_MOUNT_H
+#define _LINUX_NCP_MOUNT_H
+
+#include <linux/types.h>
+#include <linux/ncp.h>
+
+#define NCP_MOUNT_VERSION 3 /* Binary */
+
+/* Values for flags */
+#define NCP_MOUNT_SOFT 0x0001
+#define NCP_MOUNT_INTR 0x0002
+#define NCP_MOUNT_STRONG 0x0004 /* enable delete/rename of r/o files */
+#define NCP_MOUNT_NO_OS2 0x0008 /* do not use OS/2 (LONG) namespace */
+#define NCP_MOUNT_NO_NFS 0x0010 /* do not use NFS namespace */
+#define NCP_MOUNT_EXTRAS 0x0020
+#define NCP_MOUNT_SYMLINKS 0x0040 /* enable symlinks */
+#define NCP_MOUNT_NFS_EXTRAS 0x0080 /* Enable use of NFS NS meta-info */
+
+struct ncp_mount_data {
+ int version;
+ unsigned int ncp_fd; /* The socket to the ncp port */
+ __kernel_uid_t mounted_uid; /* Who may umount() this filesystem? */
+ __kernel_pid_t wdog_pid; /* Who cares for our watchdog packets? */
+
+ unsigned char mounted_vol[NCP_VOLNAME_LEN + 1];
+ unsigned int time_out; /* How long should I wait after
+ sending a NCP request? */
+ unsigned int retry_count; /* And how often should I retry? */
+ unsigned int flags;
+
+ __kernel_uid_t uid;
+ __kernel_gid_t gid;
+ __kernel_mode_t file_mode;
+ __kernel_mode_t dir_mode;
+};
+
+#define NCP_MOUNT_VERSION_V4 (4) /* Binary or text */
+
+struct ncp_mount_data_v4 {
+ int version;
+ unsigned long flags; /* NCP_MOUNT_* flags */
+ /* MIPS uses long __kernel_uid_t, but... */
+ /* we neever pass -1, so it is safe */
+ unsigned long mounted_uid; /* Who may umount() this filesystem? */
+ /* MIPS uses long __kernel_pid_t */
+ long wdog_pid; /* Who cares for our watchdog packets? */
+
+ unsigned int ncp_fd; /* The socket to the ncp port */
+ unsigned int time_out; /* How long should I wait after
+ sending a NCP request? */
+ unsigned int retry_count; /* And how often should I retry? */
+
+ /* MIPS uses long __kernel_uid_t... */
+ /* we never pass -1, so it is safe */
+ unsigned long uid;
+ unsigned long gid;
+ /* MIPS uses unsigned long __kernel_mode_t */
+ unsigned long file_mode;
+ unsigned long dir_mode;
+};
+
+#define NCP_MOUNT_VERSION_V5 (5) /* Text only */
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ncp_no.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ncp_no.h
new file mode 100644
index 0000000..cddaa48
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ncp_no.h
@@ -0,0 +1,19 @@
+#ifndef _NCP_NO
+#define _NCP_NO
+
+/* these define the attribute byte as seen by NCP */
+#define aRONLY (__cpu_to_le32(1))
+#define aHIDDEN (__cpu_to_le32(2))
+#define aSYSTEM (__cpu_to_le32(4))
+#define aEXECUTE (__cpu_to_le32(8))
+#define aDIR (__cpu_to_le32(0x10))
+#define aARCH (__cpu_to_le32(0x20))
+#define aSHARED (__cpu_to_le32(0x80))
+#define aDONTSUBALLOCATE (__cpu_to_le32(1L<<11))
+#define aTRANSACTIONAL (__cpu_to_le32(1L<<12))
+#define aPURGE (__cpu_to_le32(1L<<16))
+#define aRENAMEINHIBIT (__cpu_to_le32(1L<<17))
+#define aDELETEINHIBIT (__cpu_to_le32(1L<<18))
+#define aDONTCOMPRESS (__cpu_to_le32(1L<<27))
+
+#endif /* _NCP_NO */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/neighbour.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/neighbour.h
new file mode 100644
index 0000000..12c9de1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/neighbour.h
@@ -0,0 +1,161 @@
+#ifndef __LINUX_NEIGHBOUR_H
+#define __LINUX_NEIGHBOUR_H
+
+#include <linux/types.h>
+#include <linux/netlink.h>
+
+struct ndmsg
+{
+ __u8 ndm_family;
+ __u8 ndm_pad1;
+ __u16 ndm_pad2;
+ __s32 ndm_ifindex;
+ __u16 ndm_state;
+ __u8 ndm_flags;
+ __u8 ndm_type;
+};
+
+enum
+{
+ NDA_UNSPEC,
+ NDA_DST,
+ NDA_LLADDR,
+ NDA_CACHEINFO,
+ NDA_PROBES,
+ __NDA_MAX
+};
+
+#define NDA_MAX (__NDA_MAX - 1)
+
+/*
+ * Neighbor Cache Entry Flags
+ */
+
+#define NTF_USE 0x01
+#define NTF_PROXY 0x08 /* == ATF_PUBL */
+#define NTF_ROUTER 0x80
+
+/*
+ * Neighbor Cache Entry States.
+ */
+
+#define NUD_INCOMPLETE 0x01
+#define NUD_REACHABLE 0x02
+#define NUD_STALE 0x04
+#define NUD_DELAY 0x08
+#define NUD_PROBE 0x10
+#define NUD_FAILED 0x20
+
+/* Dummy states */
+#define NUD_NOARP 0x40
+#define NUD_PERMANENT 0x80
+#define NUD_NONE 0x00
+
+/* NUD_NOARP & NUD_PERMANENT are pseudostates, they never change
+ and make no address resolution or NUD.
+ NUD_PERMANENT is also cannot be deleted by garbage collectors.
+ */
+
+struct nda_cacheinfo
+{
+ __u32 ndm_confirmed;
+ __u32 ndm_used;
+ __u32 ndm_updated;
+ __u32 ndm_refcnt;
+};
+
+/*****************************************************************
+ * Neighbour tables specific messages.
+ *
+ * To retrieve the neighbour tables send RTM_GETNEIGHTBL with the
+ * NLM_F_DUMP flag set. Every neighbour table configuration is
+ * spread over multiple messages to avoid running into message
+ * size limits on systems with many interfaces. The first message
+ * in the sequence transports all not device specific data such as
+ * statistics, configuration, and the default parameter set.
+ * This message is followed by 0..n messages carrying device
+ * specific parameter sets.
+ * Although the ordering should be sufficient, NDTA_NAME can be
+ * used to identify sequences. The initial message can be identified
+ * by checking for NDTA_CONFIG. The device specific messages do
+ * not contain this TLV but have NDTPA_IFINDEX set to the
+ * corresponding interface index.
+ *
+ * To change neighbour table attributes, send RTM_SETNEIGHTBL
+ * with NDTA_NAME set. Changeable attribute include NDTA_THRESH[1-3],
+ * NDTA_GC_INTERVAL, and all TLVs in NDTA_PARMS unless marked
+ * otherwise. Device specific parameter sets can be changed by
+ * setting NDTPA_IFINDEX to the interface index of the corresponding
+ * device.
+ ****/
+
+struct ndt_stats
+{
+ __u64 ndts_allocs;
+ __u64 ndts_destroys;
+ __u64 ndts_hash_grows;
+ __u64 ndts_res_failed;
+ __u64 ndts_lookups;
+ __u64 ndts_hits;
+ __u64 ndts_rcv_probes_mcast;
+ __u64 ndts_rcv_probes_ucast;
+ __u64 ndts_periodic_gc_runs;
+ __u64 ndts_forced_gc_runs;
+};
+
+enum {
+ NDTPA_UNSPEC,
+ NDTPA_IFINDEX, /* u32, unchangeable */
+ NDTPA_REFCNT, /* u32, read-only */
+ NDTPA_REACHABLE_TIME, /* u64, read-only, msecs */
+ NDTPA_BASE_REACHABLE_TIME, /* u64, msecs */
+ NDTPA_RETRANS_TIME, /* u64, msecs */
+ NDTPA_GC_STALETIME, /* u64, msecs */
+ NDTPA_DELAY_PROBE_TIME, /* u64, msecs */
+ NDTPA_QUEUE_LEN, /* u32 */
+ NDTPA_APP_PROBES, /* u32 */
+ NDTPA_UCAST_PROBES, /* u32 */
+ NDTPA_MCAST_PROBES, /* u32 */
+ NDTPA_ANYCAST_DELAY, /* u64, msecs */
+ NDTPA_PROXY_DELAY, /* u64, msecs */
+ NDTPA_PROXY_QLEN, /* u32 */
+ NDTPA_LOCKTIME, /* u64, msecs */
+ __NDTPA_MAX
+};
+#define NDTPA_MAX (__NDTPA_MAX - 1)
+
+struct ndtmsg
+{
+ __u8 ndtm_family;
+ __u8 ndtm_pad1;
+ __u16 ndtm_pad2;
+};
+
+struct ndt_config
+{
+ __u16 ndtc_key_len;
+ __u16 ndtc_entry_size;
+ __u32 ndtc_entries;
+ __u32 ndtc_last_flush; /* delta to now in msecs */
+ __u32 ndtc_last_rand; /* delta to now in msecs */
+ __u32 ndtc_hash_rnd;
+ __u32 ndtc_hash_mask;
+ __u32 ndtc_hash_chain_gc;
+ __u32 ndtc_proxy_qlen;
+};
+
+enum {
+ NDTA_UNSPEC,
+ NDTA_NAME, /* char *, unchangeable */
+ NDTA_THRESH1, /* u32 */
+ NDTA_THRESH2, /* u32 */
+ NDTA_THRESH3, /* u32 */
+ NDTA_CONFIG, /* struct ndt_config, read-only */
+ NDTA_PARMS, /* nested TLV NDTPA_* */
+ NDTA_STATS, /* struct ndt_stats, read-only */
+ NDTA_GC_INTERVAL, /* u64, msecs */
+ __NDTA_MAX
+};
+#define NDTA_MAX (__NDTA_MAX - 1)
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/net.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/net.h
new file mode 100644
index 0000000..2b4120b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/net.h
@@ -0,0 +1,55 @@
+/*
+ * NET An implementation of the SOCKET network access protocol.
+ * This is the master header file for the Linux NET layer,
+ * or, in plain English: the networking handling part of the
+ * kernel.
+ *
+ * Version: @(#)net.h 1.0.3 05/25/93
+ *
+ * Authors: Orest Zborowski, <obz@Kodak.COM>
+ * Ross Biro
+ * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_NET_H
+#define _LINUX_NET_H
+
+#include <linux/socket.h>
+#include <asm/socket.h>
+
+#define NPROTO AF_MAX
+
+#define SYS_SOCKET 1 /* sys_socket(2) */
+#define SYS_BIND 2 /* sys_bind(2) */
+#define SYS_CONNECT 3 /* sys_connect(2) */
+#define SYS_LISTEN 4 /* sys_listen(2) */
+#define SYS_ACCEPT 5 /* sys_accept(2) */
+#define SYS_GETSOCKNAME 6 /* sys_getsockname(2) */
+#define SYS_GETPEERNAME 7 /* sys_getpeername(2) */
+#define SYS_SOCKETPAIR 8 /* sys_socketpair(2) */
+#define SYS_SEND 9 /* sys_send(2) */
+#define SYS_RECV 10 /* sys_recv(2) */
+#define SYS_SENDTO 11 /* sys_sendto(2) */
+#define SYS_RECVFROM 12 /* sys_recvfrom(2) */
+#define SYS_SHUTDOWN 13 /* sys_shutdown(2) */
+#define SYS_SETSOCKOPT 14 /* sys_setsockopt(2) */
+#define SYS_GETSOCKOPT 15 /* sys_getsockopt(2) */
+#define SYS_SENDMSG 16 /* sys_sendmsg(2) */
+#define SYS_RECVMSG 17 /* sys_recvmsg(2) */
+#define SYS_ACCEPT4 18 /* sys_accept4(2) */
+
+typedef enum {
+ SS_FREE = 0, /* not allocated */
+ SS_UNCONNECTED, /* unconnected to any socket */
+ SS_CONNECTING, /* in process of connecting */
+ SS_CONNECTED, /* connected to socket */
+ SS_DISCONNECTING /* in process of disconnecting */
+} socket_state;
+
+#define __SO_ACCEPTCON (1 << 16) /* performed a listen */
+
+#endif /* _LINUX_NET_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/net_dropmon.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/net_dropmon.h
new file mode 100644
index 0000000..0e2e100
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/net_dropmon.h
@@ -0,0 +1,57 @@
+#ifndef __NET_DROPMON_H
+#define __NET_DROPMON_H
+
+#include <linux/types.h>
+#include <linux/netlink.h>
+
+struct net_dm_drop_point {
+ __u8 pc[8];
+ __u32 count;
+};
+
+#define NET_DM_CFG_VERSION 0
+#define NET_DM_CFG_ALERT_COUNT 1
+#define NET_DM_CFG_ALERT_DELAY 2
+#define NET_DM_CFG_MAX 3
+
+struct net_dm_config_entry {
+ __u32 type;
+ __u64 data __attribute__((aligned(8)));
+};
+
+struct net_dm_config_msg {
+ __u32 entries;
+ struct net_dm_config_entry options[0];
+};
+
+struct net_dm_alert_msg {
+ __u32 entries;
+ struct net_dm_drop_point points[0];
+};
+
+struct net_dm_user_msg {
+ union {
+ struct net_dm_config_msg user;
+ struct net_dm_alert_msg alert;
+ } u;
+};
+
+
+/* These are the netlink message types for this protocol */
+
+enum {
+ NET_DM_CMD_UNSPEC = 0,
+ NET_DM_CMD_ALERT,
+ NET_DM_CMD_CONFIG,
+ NET_DM_CMD_START,
+ NET_DM_CMD_STOP,
+ _NET_DM_CMD_MAX,
+};
+
+#define NET_DM_CMD_MAX (_NET_DM_CMD_MAX - 1)
+
+/*
+ * Our group identifiers
+ */
+#define NET_DM_GRP_ALERT 1
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netdevice.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netdevice.h
new file mode 100644
index 0000000..5e649c0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netdevice.h
@@ -0,0 +1,92 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Definitions for the Interfaces handler.
+ *
+ * Version: @(#)dev.h 1.0.10 08/12/93
+ *
+ * Authors: Ross Biro
+ * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ * Corey Minyard <wf-rch!minyard@relay.EU.net>
+ * Donald J. Becker, <becker@cesdis.gsfc.nasa.gov>
+ * Alan Cox, <alan@lxorguk.ukuu.org.uk>
+ * Bjorn Ekwall. <bj0rn@blox.se>
+ * Pekka Riikonen <priikone@poseidon.pspt.fi>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * Moved to /usr/include/linux for NET3
+ */
+#ifndef _LINUX_NETDEVICE_H
+#define _LINUX_NETDEVICE_H
+
+#include <linux/if.h>
+#include <linux/if_ether.h>
+#include <linux/if_packet.h>
+
+
+#define MAX_ADDR_LEN 32 /* Largest hardware address length */
+
+/* Driver transmit return codes */
+#define NETDEV_TX_OK 0 /* driver took care of packet */
+#define NETDEV_TX_BUSY 1 /* driver tx path was busy*/
+#define NETDEV_TX_LOCKED -1 /* driver tx lock was already taken */
+
+
+/*
+ * Network device statistics. Akin to the 2.0 ether stats but
+ * with byte counters.
+ */
+
+struct net_device_stats
+{
+ unsigned long rx_packets; /* total packets received */
+ unsigned long tx_packets; /* total packets transmitted */
+ unsigned long rx_bytes; /* total bytes received */
+ unsigned long tx_bytes; /* total bytes transmitted */
+ unsigned long rx_errors; /* bad packets received */
+ unsigned long tx_errors; /* packet transmit problems */
+ unsigned long rx_dropped; /* no space in linux buffers */
+ unsigned long tx_dropped; /* no space available in linux */
+ unsigned long multicast; /* multicast packets received */
+ unsigned long collisions;
+
+ /* detailed rx_errors: */
+ unsigned long rx_length_errors;
+ unsigned long rx_over_errors; /* receiver ring buff overflow */
+ unsigned long rx_crc_errors; /* recved pkt with crc error */
+ unsigned long rx_frame_errors; /* recv'd frame alignment error */
+ unsigned long rx_fifo_errors; /* recv'r fifo overrun */
+ unsigned long rx_missed_errors; /* receiver missed packet */
+
+ /* detailed tx_errors */
+ unsigned long tx_aborted_errors;
+ unsigned long tx_carrier_errors;
+ unsigned long tx_fifo_errors;
+ unsigned long tx_heartbeat_errors;
+ unsigned long tx_window_errors;
+
+ /* for cslip etc */
+ unsigned long rx_compressed;
+ unsigned long tx_compressed;
+};
+
+
+/* Media selection options. */
+enum {
+ IF_PORT_UNKNOWN = 0,
+ IF_PORT_10BASE2,
+ IF_PORT_10BASET,
+ IF_PORT_AUI,
+ IF_PORT_100BASET,
+ IF_PORT_100BASETX,
+ IF_PORT_100BASEFX
+};
+
+
+#endif /* _LINUX_DEV_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter.h
new file mode 100644
index 0000000..2eb00b6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter.h
@@ -0,0 +1,59 @@
+#ifndef __LINUX_NETFILTER_H
+#define __LINUX_NETFILTER_H
+
+#include <linux/types.h>
+
+
+/* Responses from hook functions. */
+#define NF_DROP 0
+#define NF_ACCEPT 1
+#define NF_STOLEN 2
+#define NF_QUEUE 3
+#define NF_REPEAT 4
+#define NF_STOP 5
+#define NF_MAX_VERDICT NF_STOP
+
+/* we overload the higher bits for encoding auxiliary data such as the queue
+ * number. Not nice, but better than additional function arguments. */
+#define NF_VERDICT_MASK 0x0000ffff
+#define NF_VERDICT_BITS 16
+
+#define NF_VERDICT_QMASK 0xffff0000
+#define NF_VERDICT_QBITS 16
+
+#define NF_QUEUE_NR(x) ((((x) << NF_VERDICT_BITS) & NF_VERDICT_QMASK) | NF_QUEUE)
+
+/* only for userspace compatibility */
+/* Generic cache responses from hook functions.
+ <= 0x2000 is used for protocol-flags. */
+#define NFC_UNKNOWN 0x4000
+#define NFC_ALTERED 0x8000
+
+enum nf_inet_hooks {
+ NF_INET_PRE_ROUTING,
+ NF_INET_LOCAL_IN,
+ NF_INET_FORWARD,
+ NF_INET_LOCAL_OUT,
+ NF_INET_POST_ROUTING,
+ NF_INET_NUMHOOKS
+};
+
+enum {
+ NFPROTO_UNSPEC = 0,
+ NFPROTO_IPV4 = 2,
+ NFPROTO_ARP = 3,
+ NFPROTO_BRIDGE = 7,
+ NFPROTO_IPV6 = 10,
+ NFPROTO_DECNET = 12,
+ NFPROTO_NUMPROTO,
+};
+
+union nf_inet_addr {
+ __u32 all[4];
+ __be32 ip;
+ __be32 ip6[4];
+ struct in_addr in;
+ struct in6_addr in6;
+};
+
+#endif /*__LINUX_NETFILTER_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/..install.cmd
new file mode 100644
index 0000000..456ff2f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/netfilter/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/netfilter /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/netfilter mips nf_conntrack_common.h nf_conntrack_ftp.h nf_conntrack_sctp.h nf_conntrack_tcp.h nf_conntrack_tuple_common.h nfnetlink.h nfnetlink_compat.h nfnetlink_conntrack.h nfnetlink_log.h nfnetlink_queue.h x_tables.h xt_CLASSIFY.h xt_CONNMARK.h xt_CONNSECMARK.h xt_DSCP.h xt_LED.h xt_MARK.h xt_NFLOG.h xt_NFQUEUE.h xt_RATEEST.h xt_SECMARK.h xt_TCPMSS.h xt_TCPOPTSTRIP.h xt_TPROXY.h xt_cluster.h xt_comment.h xt_connbytes.h xt_connlimit.h xt_connmark.h xt_conntrack.h xt_dccp.h xt_dscp.h xt_esp.h xt_hashlimit.h xt_helper.h xt_iprange.h xt_length.h xt_limit.h xt_mac.h xt_mark.h xt_multiport.h xt_owner.h xt_physdev.h xt_pkttype.h xt_policy.h xt_quota.h xt_rateest.h xt_realm.h xt_recent.h xt_sctp.h xt_state.h xt_statistic.h xt_string.h xt_tcpmss.h xt_tcpudp.h xt_time.h xt_u32.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/netfilter /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/netfilter mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/netfilter/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nf_conntrack_common.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nf_conntrack_common.h
new file mode 100644
index 0000000..d766ef1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nf_conntrack_common.h
@@ -0,0 +1,148 @@
+#ifndef _NF_CONNTRACK_COMMON_H
+#define _NF_CONNTRACK_COMMON_H
+/* Connection state tracking for netfilter. This is separated from,
+ but required by, the NAT layer; it can also be used by an iptables
+ extension. */
+enum ip_conntrack_info
+{
+ /* Part of an established connection (either direction). */
+ IP_CT_ESTABLISHED,
+
+ /* Like NEW, but related to an existing connection, or ICMP error
+ (in either direction). */
+ IP_CT_RELATED,
+
+ /* Started a new connection to track (only
+ IP_CT_DIR_ORIGINAL); may be a retransmission. */
+ IP_CT_NEW,
+
+ /* >= this indicates reply direction */
+ IP_CT_IS_REPLY,
+
+ /* Number of distinct IP_CT types (no NEW in reply dirn). */
+ IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1
+};
+
+/* Bitset representing status of connection. */
+enum ip_conntrack_status {
+ /* It's an expected connection: bit 0 set. This bit never changed */
+ IPS_EXPECTED_BIT = 0,
+ IPS_EXPECTED = (1 << IPS_EXPECTED_BIT),
+
+ /* We've seen packets both ways: bit 1 set. Can be set, not unset. */
+ IPS_SEEN_REPLY_BIT = 1,
+ IPS_SEEN_REPLY = (1 << IPS_SEEN_REPLY_BIT),
+
+ /* Conntrack should never be early-expired. */
+ IPS_ASSURED_BIT = 2,
+ IPS_ASSURED = (1 << IPS_ASSURED_BIT),
+
+ /* Connection is confirmed: originating packet has left box */
+ IPS_CONFIRMED_BIT = 3,
+ IPS_CONFIRMED = (1 << IPS_CONFIRMED_BIT),
+
+ /* Connection needs src nat in orig dir. This bit never changed. */
+ IPS_SRC_NAT_BIT = 4,
+ IPS_SRC_NAT = (1 << IPS_SRC_NAT_BIT),
+
+ /* Connection needs dst nat in orig dir. This bit never changed. */
+ IPS_DST_NAT_BIT = 5,
+ IPS_DST_NAT = (1 << IPS_DST_NAT_BIT),
+
+ /* Both together. */
+ IPS_NAT_MASK = (IPS_DST_NAT | IPS_SRC_NAT),
+
+ /* Connection needs TCP sequence adjusted. */
+ IPS_SEQ_ADJUST_BIT = 6,
+ IPS_SEQ_ADJUST = (1 << IPS_SEQ_ADJUST_BIT),
+
+ /* NAT initialization bits. */
+ IPS_SRC_NAT_DONE_BIT = 7,
+ IPS_SRC_NAT_DONE = (1 << IPS_SRC_NAT_DONE_BIT),
+
+ IPS_DST_NAT_DONE_BIT = 8,
+ IPS_DST_NAT_DONE = (1 << IPS_DST_NAT_DONE_BIT),
+
+ /* Both together */
+ IPS_NAT_DONE_MASK = (IPS_DST_NAT_DONE | IPS_SRC_NAT_DONE),
+
+ /* Connection is dying (removed from lists), can not be unset. */
+ IPS_DYING_BIT = 9,
+ IPS_DYING = (1 << IPS_DYING_BIT),
+
+ /* Connection has fixed timeout. */
+ IPS_FIXED_TIMEOUT_BIT = 10,
+ IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT),
+};
+
+/* Connection tracking event bits */
+enum ip_conntrack_events
+{
+ /* New conntrack */
+ IPCT_NEW_BIT = 0,
+ IPCT_NEW = (1 << IPCT_NEW_BIT),
+
+ /* Expected connection */
+ IPCT_RELATED_BIT = 1,
+ IPCT_RELATED = (1 << IPCT_RELATED_BIT),
+
+ /* Destroyed conntrack */
+ IPCT_DESTROY_BIT = 2,
+ IPCT_DESTROY = (1 << IPCT_DESTROY_BIT),
+
+ /* Timer has been refreshed */
+ IPCT_REFRESH_BIT = 3,
+ IPCT_REFRESH = (1 << IPCT_REFRESH_BIT),
+
+ /* Status has changed */
+ IPCT_STATUS_BIT = 4,
+ IPCT_STATUS = (1 << IPCT_STATUS_BIT),
+
+ /* Update of protocol info */
+ IPCT_PROTOINFO_BIT = 5,
+ IPCT_PROTOINFO = (1 << IPCT_PROTOINFO_BIT),
+
+ /* Volatile protocol info */
+ IPCT_PROTOINFO_VOLATILE_BIT = 6,
+ IPCT_PROTOINFO_VOLATILE = (1 << IPCT_PROTOINFO_VOLATILE_BIT),
+
+ /* New helper for conntrack */
+ IPCT_HELPER_BIT = 7,
+ IPCT_HELPER = (1 << IPCT_HELPER_BIT),
+
+ /* Update of helper info */
+ IPCT_HELPINFO_BIT = 8,
+ IPCT_HELPINFO = (1 << IPCT_HELPINFO_BIT),
+
+ /* Volatile helper info */
+ IPCT_HELPINFO_VOLATILE_BIT = 9,
+ IPCT_HELPINFO_VOLATILE = (1 << IPCT_HELPINFO_VOLATILE_BIT),
+
+ /* NAT info */
+ IPCT_NATINFO_BIT = 10,
+ IPCT_NATINFO = (1 << IPCT_NATINFO_BIT),
+
+ /* Counter highest bit has been set, unused */
+ IPCT_COUNTER_FILLING_BIT = 11,
+ IPCT_COUNTER_FILLING = (1 << IPCT_COUNTER_FILLING_BIT),
+
+ /* Mark is set */
+ IPCT_MARK_BIT = 12,
+ IPCT_MARK = (1 << IPCT_MARK_BIT),
+
+ /* NAT sequence adjustment */
+ IPCT_NATSEQADJ_BIT = 13,
+ IPCT_NATSEQADJ = (1 << IPCT_NATSEQADJ_BIT),
+
+ /* Secmark is set */
+ IPCT_SECMARK_BIT = 14,
+ IPCT_SECMARK = (1 << IPCT_SECMARK_BIT),
+};
+
+enum ip_conntrack_expect_events {
+ IPEXP_NEW_BIT = 0,
+ IPEXP_NEW = (1 << IPEXP_NEW_BIT),
+};
+
+
+#endif /* _NF_CONNTRACK_COMMON_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nf_conntrack_ftp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nf_conntrack_ftp.h
new file mode 100644
index 0000000..c0dbb4e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nf_conntrack_ftp.h
@@ -0,0 +1,19 @@
+#ifndef _NF_CONNTRACK_FTP_H
+#define _NF_CONNTRACK_FTP_H
+/* FTP tracking. */
+
+/* This enum is exposed to userspace */
+enum nf_ct_ftp_type
+{
+ /* PORT command from client */
+ NF_CT_FTP_PORT,
+ /* PASV response from server */
+ NF_CT_FTP_PASV,
+ /* EPRT command from client */
+ NF_CT_FTP_EPRT,
+ /* EPSV response from server */
+ NF_CT_FTP_EPSV,
+};
+
+
+#endif /* _NF_CONNTRACK_FTP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nf_conntrack_sctp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nf_conntrack_sctp.h
new file mode 100644
index 0000000..768f78c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nf_conntrack_sctp.h
@@ -0,0 +1,26 @@
+#ifndef _NF_CONNTRACK_SCTP_H
+#define _NF_CONNTRACK_SCTP_H
+/* SCTP tracking. */
+
+#include <linux/netfilter/nf_conntrack_tuple_common.h>
+
+enum sctp_conntrack {
+ SCTP_CONNTRACK_NONE,
+ SCTP_CONNTRACK_CLOSED,
+ SCTP_CONNTRACK_COOKIE_WAIT,
+ SCTP_CONNTRACK_COOKIE_ECHOED,
+ SCTP_CONNTRACK_ESTABLISHED,
+ SCTP_CONNTRACK_SHUTDOWN_SENT,
+ SCTP_CONNTRACK_SHUTDOWN_RECD,
+ SCTP_CONNTRACK_SHUTDOWN_ACK_SENT,
+ SCTP_CONNTRACK_MAX
+};
+
+struct ip_ct_sctp
+{
+ enum sctp_conntrack state;
+
+ __be32 vtag[IP_CT_DIR_MAX];
+};
+
+#endif /* _NF_CONNTRACK_SCTP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nf_conntrack_tcp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nf_conntrack_tcp.h
new file mode 100644
index 0000000..d501596
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nf_conntrack_tcp.h
@@ -0,0 +1,47 @@
+#ifndef _NF_CONNTRACK_TCP_H
+#define _NF_CONNTRACK_TCP_H
+/* TCP tracking. */
+
+#include <linux/types.h>
+
+/* This is exposed to userspace (ctnetlink) */
+enum tcp_conntrack {
+ TCP_CONNTRACK_NONE,
+ TCP_CONNTRACK_SYN_SENT,
+ TCP_CONNTRACK_SYN_RECV,
+ TCP_CONNTRACK_ESTABLISHED,
+ TCP_CONNTRACK_FIN_WAIT,
+ TCP_CONNTRACK_CLOSE_WAIT,
+ TCP_CONNTRACK_LAST_ACK,
+ TCP_CONNTRACK_TIME_WAIT,
+ TCP_CONNTRACK_CLOSE,
+ TCP_CONNTRACK_LISTEN,
+ TCP_CONNTRACK_MAX,
+ TCP_CONNTRACK_IGNORE
+};
+
+/* Window scaling is advertised by the sender */
+#define IP_CT_TCP_FLAG_WINDOW_SCALE 0x01
+
+/* SACK is permitted by the sender */
+#define IP_CT_TCP_FLAG_SACK_PERM 0x02
+
+/* This sender sent FIN first */
+#define IP_CT_TCP_FLAG_CLOSE_INIT 0x04
+
+/* Be liberal in window checking */
+#define IP_CT_TCP_FLAG_BE_LIBERAL 0x08
+
+/* Has unacknowledged data */
+#define IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED 0x10
+
+/* The field td_maxack has been set */
+#define IP_CT_TCP_FLAG_MAXACK_SET 0x20
+
+struct nf_ct_tcp_flags {
+ __u8 flags;
+ __u8 mask;
+};
+
+
+#endif /* _NF_CONNTRACK_TCP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nf_conntrack_tuple_common.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nf_conntrack_tuple_common.h
new file mode 100644
index 0000000..8e145f0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nf_conntrack_tuple_common.h
@@ -0,0 +1,13 @@
+#ifndef _NF_CONNTRACK_TUPLE_COMMON_H
+#define _NF_CONNTRACK_TUPLE_COMMON_H
+
+enum ip_conntrack_dir
+{
+ IP_CT_DIR_ORIGINAL,
+ IP_CT_DIR_REPLY,
+ IP_CT_DIR_MAX
+};
+
+#define CTINFO2DIR(ctinfo) ((ctinfo) >= IP_CT_IS_REPLY ? IP_CT_DIR_REPLY : IP_CT_DIR_ORIGINAL)
+
+#endif /* _NF_CONNTRACK_TUPLE_COMMON_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nfnetlink.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nfnetlink.h
new file mode 100644
index 0000000..034ae90
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nfnetlink.h
@@ -0,0 +1,51 @@
+#ifndef _NFNETLINK_H
+#define _NFNETLINK_H
+#include <linux/types.h>
+#include <linux/netfilter/nfnetlink_compat.h>
+
+enum nfnetlink_groups {
+ NFNLGRP_NONE,
+#define NFNLGRP_NONE NFNLGRP_NONE
+ NFNLGRP_CONNTRACK_NEW,
+#define NFNLGRP_CONNTRACK_NEW NFNLGRP_CONNTRACK_NEW
+ NFNLGRP_CONNTRACK_UPDATE,
+#define NFNLGRP_CONNTRACK_UPDATE NFNLGRP_CONNTRACK_UPDATE
+ NFNLGRP_CONNTRACK_DESTROY,
+#define NFNLGRP_CONNTRACK_DESTROY NFNLGRP_CONNTRACK_DESTROY
+ NFNLGRP_CONNTRACK_EXP_NEW,
+#define NFNLGRP_CONNTRACK_EXP_NEW NFNLGRP_CONNTRACK_EXP_NEW
+ NFNLGRP_CONNTRACK_EXP_UPDATE,
+#define NFNLGRP_CONNTRACK_EXP_UPDATE NFNLGRP_CONNTRACK_EXP_UPDATE
+ NFNLGRP_CONNTRACK_EXP_DESTROY,
+#define NFNLGRP_CONNTRACK_EXP_DESTROY NFNLGRP_CONNTRACK_EXP_DESTROY
+ __NFNLGRP_MAX,
+};
+#define NFNLGRP_MAX (__NFNLGRP_MAX - 1)
+
+/* General form of address family dependent message.
+ */
+struct nfgenmsg {
+ __u8 nfgen_family; /* AF_xxx */
+ __u8 version; /* nfnetlink version */
+ __be16 res_id; /* resource id */
+};
+
+#define NFNETLINK_V0 0
+
+/* netfilter netlink message types are split in two pieces:
+ * 8 bit subsystem, 8bit operation.
+ */
+
+#define NFNL_SUBSYS_ID(x) ((x & 0xff00) >> 8)
+#define NFNL_MSG_TYPE(x) (x & 0x00ff)
+
+/* No enum here, otherwise __stringify() trick of MODULE_ALIAS_NFNL_SUBSYS()
+ * won't work anymore */
+#define NFNL_SUBSYS_NONE 0
+#define NFNL_SUBSYS_CTNETLINK 1
+#define NFNL_SUBSYS_CTNETLINK_EXP 2
+#define NFNL_SUBSYS_QUEUE 3
+#define NFNL_SUBSYS_ULOG 4
+#define NFNL_SUBSYS_COUNT 5
+
+#endif /* _NFNETLINK_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nfnetlink_compat.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nfnetlink_compat.h
new file mode 100644
index 0000000..343ecb7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nfnetlink_compat.h
@@ -0,0 +1,62 @@
+#ifndef _NFNETLINK_COMPAT_H
+#define _NFNETLINK_COMPAT_H
+
+#include <linux/types.h>
+
+/* Old nfnetlink macros for userspace */
+
+/* nfnetlink groups: Up to 32 maximum */
+#define NF_NETLINK_CONNTRACK_NEW 0x00000001
+#define NF_NETLINK_CONNTRACK_UPDATE 0x00000002
+#define NF_NETLINK_CONNTRACK_DESTROY 0x00000004
+#define NF_NETLINK_CONNTRACK_EXP_NEW 0x00000008
+#define NF_NETLINK_CONNTRACK_EXP_UPDATE 0x00000010
+#define NF_NETLINK_CONNTRACK_EXP_DESTROY 0x00000020
+
+/* Generic structure for encapsulation optional netfilter information.
+ * It is reminiscent of sockaddr, but with sa_family replaced
+ * with attribute type.
+ * ! This should someday be put somewhere generic as now rtnetlink and
+ * ! nfnetlink use the same attributes methods. - J. Schulist.
+ */
+
+struct nfattr
+{
+ __u16 nfa_len;
+ __u16 nfa_type; /* we use 15 bits for the type, and the highest
+ * bit to indicate whether the payload is nested */
+};
+
+/* FIXME: Apart from NFNL_NFA_NESTED shamelessly copy and pasted from
+ * rtnetlink.h, it's time to put this in a generic file */
+
+#define NFNL_NFA_NEST 0x8000
+#define NFA_TYPE(attr) ((attr)->nfa_type & 0x7fff)
+
+#define NFA_ALIGNTO 4
+#define NFA_ALIGN(len) (((len) + NFA_ALIGNTO - 1) & ~(NFA_ALIGNTO - 1))
+#define NFA_OK(nfa,len) ((len) > 0 && (nfa)->nfa_len >= sizeof(struct nfattr) \
+ && (nfa)->nfa_len <= (len))
+#define NFA_NEXT(nfa,attrlen) ((attrlen) -= NFA_ALIGN((nfa)->nfa_len), \
+ (struct nfattr *)(((char *)(nfa)) + NFA_ALIGN((nfa)->nfa_len)))
+#define NFA_LENGTH(len) (NFA_ALIGN(sizeof(struct nfattr)) + (len))
+#define NFA_SPACE(len) NFA_ALIGN(NFA_LENGTH(len))
+#define NFA_DATA(nfa) ((void *)(((char *)(nfa)) + NFA_LENGTH(0)))
+#define NFA_PAYLOAD(nfa) ((int)((nfa)->nfa_len) - NFA_LENGTH(0))
+#define NFA_NEST(skb, type) \
+({ struct nfattr *__start = (struct nfattr *)skb_tail_pointer(skb); \
+ NFA_PUT(skb, (NFNL_NFA_NEST | type), 0, NULL); \
+ __start; })
+#define NFA_NEST_END(skb, start) \
+({ (start)->nfa_len = skb_tail_pointer(skb) - (unsigned char *)(start); \
+ (skb)->len; })
+#define NFA_NEST_CANCEL(skb, start) \
+({ if (start) \
+ skb_trim(skb, (unsigned char *) (start) - (skb)->data); \
+ -1; })
+
+#define NFM_NFA(n) ((struct nfattr *)(((char *)(n)) \
+ + NLMSG_ALIGN(sizeof(struct nfgenmsg))))
+#define NFM_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct nfgenmsg))
+
+#endif /* _NFNETLINK_COMPAT_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nfnetlink_conntrack.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nfnetlink_conntrack.h
new file mode 100644
index 0000000..1a865e4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nfnetlink_conntrack.h
@@ -0,0 +1,172 @@
+#ifndef _IPCONNTRACK_NETLINK_H
+#define _IPCONNTRACK_NETLINK_H
+#include <linux/netfilter/nfnetlink.h>
+
+enum cntl_msg_types {
+ IPCTNL_MSG_CT_NEW,
+ IPCTNL_MSG_CT_GET,
+ IPCTNL_MSG_CT_DELETE,
+ IPCTNL_MSG_CT_GET_CTRZERO,
+
+ IPCTNL_MSG_MAX
+};
+
+enum ctnl_exp_msg_types {
+ IPCTNL_MSG_EXP_NEW,
+ IPCTNL_MSG_EXP_GET,
+ IPCTNL_MSG_EXP_DELETE,
+
+ IPCTNL_MSG_EXP_MAX
+};
+
+
+enum ctattr_type {
+ CTA_UNSPEC,
+ CTA_TUPLE_ORIG,
+ CTA_TUPLE_REPLY,
+ CTA_STATUS,
+ CTA_PROTOINFO,
+ CTA_HELP,
+ CTA_NAT_SRC,
+#define CTA_NAT CTA_NAT_SRC /* backwards compatibility */
+ CTA_TIMEOUT,
+ CTA_MARK,
+ CTA_COUNTERS_ORIG,
+ CTA_COUNTERS_REPLY,
+ CTA_USE,
+ CTA_ID,
+ CTA_NAT_DST,
+ CTA_TUPLE_MASTER,
+ CTA_NAT_SEQ_ADJ_ORIG,
+ CTA_NAT_SEQ_ADJ_REPLY,
+ CTA_SECMARK,
+ __CTA_MAX
+};
+#define CTA_MAX (__CTA_MAX - 1)
+
+enum ctattr_tuple {
+ CTA_TUPLE_UNSPEC,
+ CTA_TUPLE_IP,
+ CTA_TUPLE_PROTO,
+ __CTA_TUPLE_MAX
+};
+#define CTA_TUPLE_MAX (__CTA_TUPLE_MAX - 1)
+
+enum ctattr_ip {
+ CTA_IP_UNSPEC,
+ CTA_IP_V4_SRC,
+ CTA_IP_V4_DST,
+ CTA_IP_V6_SRC,
+ CTA_IP_V6_DST,
+ __CTA_IP_MAX
+};
+#define CTA_IP_MAX (__CTA_IP_MAX - 1)
+
+enum ctattr_l4proto {
+ CTA_PROTO_UNSPEC,
+ CTA_PROTO_NUM,
+ CTA_PROTO_SRC_PORT,
+ CTA_PROTO_DST_PORT,
+ CTA_PROTO_ICMP_ID,
+ CTA_PROTO_ICMP_TYPE,
+ CTA_PROTO_ICMP_CODE,
+ CTA_PROTO_ICMPV6_ID,
+ CTA_PROTO_ICMPV6_TYPE,
+ CTA_PROTO_ICMPV6_CODE,
+ __CTA_PROTO_MAX
+};
+#define CTA_PROTO_MAX (__CTA_PROTO_MAX - 1)
+
+enum ctattr_protoinfo {
+ CTA_PROTOINFO_UNSPEC,
+ CTA_PROTOINFO_TCP,
+ CTA_PROTOINFO_DCCP,
+ CTA_PROTOINFO_SCTP,
+ __CTA_PROTOINFO_MAX
+};
+#define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1)
+
+enum ctattr_protoinfo_tcp {
+ CTA_PROTOINFO_TCP_UNSPEC,
+ CTA_PROTOINFO_TCP_STATE,
+ CTA_PROTOINFO_TCP_WSCALE_ORIGINAL,
+ CTA_PROTOINFO_TCP_WSCALE_REPLY,
+ CTA_PROTOINFO_TCP_FLAGS_ORIGINAL,
+ CTA_PROTOINFO_TCP_FLAGS_REPLY,
+ __CTA_PROTOINFO_TCP_MAX
+};
+#define CTA_PROTOINFO_TCP_MAX (__CTA_PROTOINFO_TCP_MAX - 1)
+
+enum ctattr_protoinfo_dccp {
+ CTA_PROTOINFO_DCCP_UNSPEC,
+ CTA_PROTOINFO_DCCP_STATE,
+ CTA_PROTOINFO_DCCP_ROLE,
+ __CTA_PROTOINFO_DCCP_MAX,
+};
+#define CTA_PROTOINFO_DCCP_MAX (__CTA_PROTOINFO_DCCP_MAX - 1)
+
+enum ctattr_protoinfo_sctp {
+ CTA_PROTOINFO_SCTP_UNSPEC,
+ CTA_PROTOINFO_SCTP_STATE,
+ CTA_PROTOINFO_SCTP_VTAG_ORIGINAL,
+ CTA_PROTOINFO_SCTP_VTAG_REPLY,
+ __CTA_PROTOINFO_SCTP_MAX
+};
+#define CTA_PROTOINFO_SCTP_MAX (__CTA_PROTOINFO_SCTP_MAX - 1)
+
+enum ctattr_counters {
+ CTA_COUNTERS_UNSPEC,
+ CTA_COUNTERS_PACKETS, /* 64bit counters */
+ CTA_COUNTERS_BYTES, /* 64bit counters */
+ CTA_COUNTERS32_PACKETS, /* old 32bit counters, unused */
+ CTA_COUNTERS32_BYTES, /* old 32bit counters, unused */
+ __CTA_COUNTERS_MAX
+};
+#define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1)
+
+enum ctattr_nat {
+ CTA_NAT_UNSPEC,
+ CTA_NAT_MINIP,
+ CTA_NAT_MAXIP,
+ CTA_NAT_PROTO,
+ __CTA_NAT_MAX
+};
+#define CTA_NAT_MAX (__CTA_NAT_MAX - 1)
+
+enum ctattr_protonat {
+ CTA_PROTONAT_UNSPEC,
+ CTA_PROTONAT_PORT_MIN,
+ CTA_PROTONAT_PORT_MAX,
+ __CTA_PROTONAT_MAX
+};
+#define CTA_PROTONAT_MAX (__CTA_PROTONAT_MAX - 1)
+
+enum ctattr_natseq {
+ CTA_NAT_SEQ_UNSPEC,
+ CTA_NAT_SEQ_CORRECTION_POS,
+ CTA_NAT_SEQ_OFFSET_BEFORE,
+ CTA_NAT_SEQ_OFFSET_AFTER,
+ __CTA_NAT_SEQ_MAX
+};
+#define CTA_NAT_SEQ_MAX (__CTA_NAT_SEQ_MAX - 1)
+
+enum ctattr_expect {
+ CTA_EXPECT_UNSPEC,
+ CTA_EXPECT_MASTER,
+ CTA_EXPECT_TUPLE,
+ CTA_EXPECT_MASK,
+ CTA_EXPECT_TIMEOUT,
+ CTA_EXPECT_ID,
+ CTA_EXPECT_HELP_NAME,
+ __CTA_EXPECT_MAX
+};
+#define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1)
+
+enum ctattr_help {
+ CTA_HELP_UNSPEC,
+ CTA_HELP_NAME,
+ __CTA_HELP_MAX
+};
+#define CTA_HELP_MAX (__CTA_HELP_MAX - 1)
+
+#endif /* _IPCONNTRACK_NETLINK_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nfnetlink_log.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nfnetlink_log.h
new file mode 100644
index 0000000..d3bab7a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nfnetlink_log.h
@@ -0,0 +1,96 @@
+#ifndef _NFNETLINK_LOG_H
+#define _NFNETLINK_LOG_H
+
+/* This file describes the netlink messages (i.e. 'protocol packets'),
+ * and not any kind of function definitions. It is shared between kernel and
+ * userspace. Don't put kernel specific stuff in here */
+
+#include <linux/types.h>
+#include <linux/netfilter/nfnetlink.h>
+
+enum nfulnl_msg_types {
+ NFULNL_MSG_PACKET, /* packet from kernel to userspace */
+ NFULNL_MSG_CONFIG, /* connect to a particular queue */
+
+ NFULNL_MSG_MAX
+};
+
+struct nfulnl_msg_packet_hdr {
+ __be16 hw_protocol; /* hw protocol (network order) */
+ __u8 hook; /* netfilter hook */
+ __u8 _pad;
+};
+
+struct nfulnl_msg_packet_hw {
+ __be16 hw_addrlen;
+ __u16 _pad;
+ __u8 hw_addr[8];
+};
+
+struct nfulnl_msg_packet_timestamp {
+ aligned_be64 sec;
+ aligned_be64 usec;
+};
+
+enum nfulnl_attr_type {
+ NFULA_UNSPEC,
+ NFULA_PACKET_HDR,
+ NFULA_MARK, /* __u32 nfmark */
+ NFULA_TIMESTAMP, /* nfulnl_msg_packet_timestamp */
+ NFULA_IFINDEX_INDEV, /* __u32 ifindex */
+ NFULA_IFINDEX_OUTDEV, /* __u32 ifindex */
+ NFULA_IFINDEX_PHYSINDEV, /* __u32 ifindex */
+ NFULA_IFINDEX_PHYSOUTDEV, /* __u32 ifindex */
+ NFULA_HWADDR, /* nfulnl_msg_packet_hw */
+ NFULA_PAYLOAD, /* opaque data payload */
+ NFULA_PREFIX, /* string prefix */
+ NFULA_UID, /* user id of socket */
+ NFULA_SEQ, /* instance-local sequence number */
+ NFULA_SEQ_GLOBAL, /* global sequence number */
+ NFULA_GID, /* group id of socket */
+ NFULA_HWTYPE, /* hardware type */
+ NFULA_HWHEADER, /* hardware header */
+ NFULA_HWLEN, /* hardware header length */
+
+ __NFULA_MAX
+};
+#define NFULA_MAX (__NFULA_MAX - 1)
+
+enum nfulnl_msg_config_cmds {
+ NFULNL_CFG_CMD_NONE,
+ NFULNL_CFG_CMD_BIND,
+ NFULNL_CFG_CMD_UNBIND,
+ NFULNL_CFG_CMD_PF_BIND,
+ NFULNL_CFG_CMD_PF_UNBIND,
+};
+
+struct nfulnl_msg_config_cmd {
+ __u8 command; /* nfulnl_msg_config_cmds */
+} __attribute__ ((packed));
+
+struct nfulnl_msg_config_mode {
+ __be32 copy_range;
+ __u8 copy_mode;
+ __u8 _pad;
+} __attribute__ ((packed));
+
+enum nfulnl_attr_config {
+ NFULA_CFG_UNSPEC,
+ NFULA_CFG_CMD, /* nfulnl_msg_config_cmd */
+ NFULA_CFG_MODE, /* nfulnl_msg_config_mode */
+ NFULA_CFG_NLBUFSIZ, /* __u32 buffer size */
+ NFULA_CFG_TIMEOUT, /* __u32 in 1/100 s */
+ NFULA_CFG_QTHRESH, /* __u32 */
+ NFULA_CFG_FLAGS, /* __u16 */
+ __NFULA_CFG_MAX
+};
+#define NFULA_CFG_MAX (__NFULA_CFG_MAX -1)
+
+#define NFULNL_COPY_NONE 0x00
+#define NFULNL_COPY_META 0x01
+#define NFULNL_COPY_PACKET 0x02
+
+#define NFULNL_CFG_F_SEQ 0x0001
+#define NFULNL_CFG_F_SEQ_GLOBAL 0x0002
+
+#endif /* _NFNETLINK_LOG_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nfnetlink_queue.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nfnetlink_queue.h
new file mode 100644
index 0000000..2455fe5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/nfnetlink_queue.h
@@ -0,0 +1,90 @@
+#ifndef _NFNETLINK_QUEUE_H
+#define _NFNETLINK_QUEUE_H
+
+#include <linux/types.h>
+#include <linux/netfilter/nfnetlink.h>
+
+enum nfqnl_msg_types {
+ NFQNL_MSG_PACKET, /* packet from kernel to userspace */
+ NFQNL_MSG_VERDICT, /* verdict from userspace to kernel */
+ NFQNL_MSG_CONFIG, /* connect to a particular queue */
+
+ NFQNL_MSG_MAX
+};
+
+struct nfqnl_msg_packet_hdr {
+ __be32 packet_id; /* unique ID of packet in queue */
+ __be16 hw_protocol; /* hw protocol (network order) */
+ __u8 hook; /* netfilter hook */
+} __attribute__ ((packed));
+
+struct nfqnl_msg_packet_hw {
+ __be16 hw_addrlen;
+ __u16 _pad;
+ __u8 hw_addr[8];
+};
+
+struct nfqnl_msg_packet_timestamp {
+ aligned_be64 sec;
+ aligned_be64 usec;
+};
+
+enum nfqnl_attr_type {
+ NFQA_UNSPEC,
+ NFQA_PACKET_HDR,
+ NFQA_VERDICT_HDR, /* nfqnl_msg_verdict_hrd */
+ NFQA_MARK, /* __u32 nfmark */
+ NFQA_TIMESTAMP, /* nfqnl_msg_packet_timestamp */
+ NFQA_IFINDEX_INDEV, /* __u32 ifindex */
+ NFQA_IFINDEX_OUTDEV, /* __u32 ifindex */
+ NFQA_IFINDEX_PHYSINDEV, /* __u32 ifindex */
+ NFQA_IFINDEX_PHYSOUTDEV, /* __u32 ifindex */
+ NFQA_HWADDR, /* nfqnl_msg_packet_hw */
+ NFQA_PAYLOAD, /* opaque data payload */
+
+ __NFQA_MAX
+};
+#define NFQA_MAX (__NFQA_MAX - 1)
+
+struct nfqnl_msg_verdict_hdr {
+ __be32 verdict;
+ __be32 id;
+};
+
+
+enum nfqnl_msg_config_cmds {
+ NFQNL_CFG_CMD_NONE,
+ NFQNL_CFG_CMD_BIND,
+ NFQNL_CFG_CMD_UNBIND,
+ NFQNL_CFG_CMD_PF_BIND,
+ NFQNL_CFG_CMD_PF_UNBIND,
+};
+
+struct nfqnl_msg_config_cmd {
+ __u8 command; /* nfqnl_msg_config_cmds */
+ __u8 _pad;
+ __be16 pf; /* AF_xxx for PF_[UN]BIND */
+};
+
+enum nfqnl_config_mode {
+ NFQNL_COPY_NONE,
+ NFQNL_COPY_META,
+ NFQNL_COPY_PACKET,
+};
+
+struct nfqnl_msg_config_params {
+ __be32 copy_range;
+ __u8 copy_mode; /* enum nfqnl_config_mode */
+} __attribute__ ((packed));
+
+
+enum nfqnl_attr_config {
+ NFQA_CFG_UNSPEC,
+ NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */
+ NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */
+ NFQA_CFG_QUEUE_MAXLEN, /* __u32 */
+ __NFQA_CFG_MAX
+};
+#define NFQA_CFG_MAX (__NFQA_CFG_MAX-1)
+
+#endif /* _NFNETLINK_QUEUE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/x_tables.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/x_tables.h
new file mode 100644
index 0000000..2794d97
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/x_tables.h
@@ -0,0 +1,175 @@
+#ifndef _X_TABLES_H
+#define _X_TABLES_H
+
+#include <linux/types.h>
+
+#define XT_FUNCTION_MAXNAMELEN 30
+#define XT_TABLE_MAXNAMELEN 32
+
+struct xt_entry_match
+{
+ union {
+ struct {
+ __u16 match_size;
+
+ /* Used by userspace */
+ char name[XT_FUNCTION_MAXNAMELEN-1];
+
+ __u8 revision;
+ } user;
+ struct {
+ __u16 match_size;
+
+ /* Used inside the kernel */
+ struct xt_match *match;
+ } kernel;
+
+ /* Total length */
+ __u16 match_size;
+ } u;
+
+ unsigned char data[0];
+};
+
+struct xt_entry_target
+{
+ union {
+ struct {
+ __u16 target_size;
+
+ /* Used by userspace */
+ char name[XT_FUNCTION_MAXNAMELEN-1];
+
+ __u8 revision;
+ } user;
+ struct {
+ __u16 target_size;
+
+ /* Used inside the kernel */
+ struct xt_target *target;
+ } kernel;
+
+ /* Total length */
+ __u16 target_size;
+ } u;
+
+ unsigned char data[0];
+};
+
+#define XT_TARGET_INIT(__name, __size) \
+{ \
+ .target.u.user = { \
+ .target_size = XT_ALIGN(__size), \
+ .name = __name, \
+ }, \
+}
+
+struct xt_standard_target
+{
+ struct xt_entry_target target;
+ int verdict;
+};
+
+/* The argument to IPT_SO_GET_REVISION_*. Returns highest revision
+ * kernel supports, if >= revision. */
+struct xt_get_revision
+{
+ char name[XT_FUNCTION_MAXNAMELEN-1];
+
+ __u8 revision;
+};
+
+/* CONTINUE verdict for targets */
+#define XT_CONTINUE 0xFFFFFFFF
+
+/* For standard target */
+#define XT_RETURN (-NF_REPEAT - 1)
+
+/* this is a dummy structure to find out the alignment requirement for a struct
+ * containing all the fundamental data types that are used in ipt_entry,
+ * ip6t_entry and arpt_entry. This sucks, and it is a hack. It will be my
+ * personal pleasure to remove it -HW
+ */
+struct _xt_align
+{
+ __u8 u8;
+ __u16 u16;
+ __u32 u32;
+ __u64 u64;
+};
+
+#define XT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1)) \
+ & ~(__alignof__(struct _xt_align)-1))
+
+/* Standard return verdict, or do jump. */
+#define XT_STANDARD_TARGET ""
+/* Error verdict. */
+#define XT_ERROR_TARGET "ERROR"
+
+#define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0)
+#define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0)
+
+struct xt_counters
+{
+ __u64 pcnt, bcnt; /* Packet and byte counters */
+};
+
+/* The argument to IPT_SO_ADD_COUNTERS. */
+struct xt_counters_info
+{
+ /* Which table. */
+ char name[XT_TABLE_MAXNAMELEN];
+
+ unsigned int num_counters;
+
+ /* The counters (actually `number' of these). */
+ struct xt_counters counters[0];
+};
+
+#define XT_INV_PROTO 0x40 /* Invert the sense of PROTO. */
+
+/* fn returns 0 to continue iteration */
+#define XT_MATCH_ITERATE(type, e, fn, args...) \
+({ \
+ unsigned int __i; \
+ int __ret = 0; \
+ struct xt_entry_match *__m; \
+ \
+ for (__i = sizeof(type); \
+ __i < (e)->target_offset; \
+ __i += __m->u.match_size) { \
+ __m = (void *)e + __i; \
+ \
+ __ret = fn(__m , ## args); \
+ if (__ret != 0) \
+ break; \
+ } \
+ __ret; \
+})
+
+/* fn returns 0 to continue iteration */
+#define XT_ENTRY_ITERATE_CONTINUE(type, entries, size, n, fn, args...) \
+({ \
+ unsigned int __i, __n; \
+ int __ret = 0; \
+ type *__entry; \
+ \
+ for (__i = 0, __n = 0; __i < (size); \
+ __i += __entry->next_offset, __n++) { \
+ __entry = (void *)(entries) + __i; \
+ if (__n < n) \
+ continue; \
+ \
+ __ret = fn(__entry , ## args); \
+ if (__ret != 0) \
+ break; \
+ } \
+ __ret; \
+})
+
+/* fn returns 0 to continue iteration */
+#define XT_ENTRY_ITERATE(type, entries, size, fn, args...) \
+ XT_ENTRY_ITERATE_CONTINUE(type, entries, size, 0, fn, args)
+
+
+#endif /* _X_TABLES_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_CLASSIFY.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_CLASSIFY.h
new file mode 100644
index 0000000..a813bf1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_CLASSIFY.h
@@ -0,0 +1,10 @@
+#ifndef _XT_CLASSIFY_H
+#define _XT_CLASSIFY_H
+
+#include <linux/types.h>
+
+struct xt_classify_target_info {
+ __u32 priority;
+};
+
+#endif /*_XT_CLASSIFY_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_CONNMARK.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_CONNMARK.h
new file mode 100644
index 0000000..7635c8f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_CONNMARK.h
@@ -0,0 +1,32 @@
+#ifndef _XT_CONNMARK_H_target
+#define _XT_CONNMARK_H_target
+
+#include <linux/types.h>
+
+/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com>
+ * by Henrik Nordstrom <hno@marasystems.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+enum {
+ XT_CONNMARK_SET = 0,
+ XT_CONNMARK_SAVE,
+ XT_CONNMARK_RESTORE
+};
+
+struct xt_connmark_target_info {
+ unsigned long mark;
+ unsigned long mask;
+ __u8 mode;
+};
+
+struct xt_connmark_tginfo1 {
+ __u32 ctmark, ctmask, nfmask;
+ __u8 mode;
+};
+
+#endif /*_XT_CONNMARK_H_target*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_CONNSECMARK.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_CONNSECMARK.h
new file mode 100644
index 0000000..b973ff8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_CONNSECMARK.h
@@ -0,0 +1,15 @@
+#ifndef _XT_CONNSECMARK_H_target
+#define _XT_CONNSECMARK_H_target
+
+#include <linux/types.h>
+
+enum {
+ CONNSECMARK_SAVE = 1,
+ CONNSECMARK_RESTORE,
+};
+
+struct xt_connsecmark_target_info {
+ __u8 mode;
+};
+
+#endif /*_XT_CONNSECMARK_H_target */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_DSCP.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_DSCP.h
new file mode 100644
index 0000000..648e0b3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_DSCP.h
@@ -0,0 +1,26 @@
+/* x_tables module for setting the IPv4/IPv6 DSCP field
+ *
+ * (C) 2002 Harald Welte <laforge@gnumonks.org>
+ * based on ipt_FTOS.c (C) 2000 by Matthew G. Marsh <mgm@paktronix.com>
+ * This software is distributed under GNU GPL v2, 1991
+ *
+ * See RFC2474 for a description of the DSCP field within the IP Header.
+ *
+ * xt_DSCP.h,v 1.7 2002/03/14 12:03:13 laforge Exp
+*/
+#ifndef _XT_DSCP_TARGET_H
+#define _XT_DSCP_TARGET_H
+#include <linux/netfilter/xt_dscp.h>
+#include <linux/types.h>
+
+/* target info */
+struct xt_DSCP_info {
+ __u8 dscp;
+};
+
+struct xt_tos_target_info {
+ __u8 tos_value;
+ __u8 tos_mask;
+};
+
+#endif /* _XT_DSCP_TARGET_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_LED.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_LED.h
new file mode 100644
index 0000000..f5509e7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_LED.h
@@ -0,0 +1,15 @@
+#ifndef _XT_LED_H
+#define _XT_LED_H
+
+#include <linux/types.h>
+
+struct xt_led_info {
+ char id[27]; /* Unique ID for this trigger in the LED class */
+ __u8 always_blink; /* Blink even if the LED is already on */
+ __u32 delay; /* Delay until LED is switched off after trigger */
+
+ /* Kernel data used in the module */
+ void *internal_data __attribute__((aligned(8)));
+};
+
+#endif /* _XT_LED_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_MARK.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_MARK.h
new file mode 100644
index 0000000..028304b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_MARK.h
@@ -0,0 +1,27 @@
+#ifndef _XT_MARK_H_target
+#define _XT_MARK_H_target
+
+#include <linux/types.h>
+
+/* Version 0 */
+struct xt_mark_target_info {
+ unsigned long mark;
+};
+
+/* Version 1 */
+enum {
+ XT_MARK_SET=0,
+ XT_MARK_AND,
+ XT_MARK_OR,
+};
+
+struct xt_mark_target_info_v1 {
+ unsigned long mark;
+ __u8 mode;
+};
+
+struct xt_mark_tginfo2 {
+ __u32 mark, mask;
+};
+
+#endif /*_XT_MARK_H_target */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_NFLOG.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_NFLOG.h
new file mode 100644
index 0000000..87b5831
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_NFLOG.h
@@ -0,0 +1,20 @@
+#ifndef _XT_NFLOG_TARGET
+#define _XT_NFLOG_TARGET
+
+#include <linux/types.h>
+
+#define XT_NFLOG_DEFAULT_GROUP 0x1
+#define XT_NFLOG_DEFAULT_THRESHOLD 0
+
+#define XT_NFLOG_MASK 0x0
+
+struct xt_nflog_info {
+ __u32 len;
+ __u16 group;
+ __u16 threshold;
+ __u16 flags;
+ __u16 pad;
+ char prefix[64];
+};
+
+#endif /* _XT_NFLOG_TARGET */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_NFQUEUE.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_NFQUEUE.h
new file mode 100644
index 0000000..982a89f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_NFQUEUE.h
@@ -0,0 +1,18 @@
+/* iptables module for using NFQUEUE mechanism
+ *
+ * (C) 2005 Harald Welte <laforge@netfilter.org>
+ *
+ * This software is distributed under GNU GPL v2, 1991
+ *
+*/
+#ifndef _XT_NFQ_TARGET_H
+#define _XT_NFQ_TARGET_H
+
+#include <linux/types.h>
+
+/* target info */
+struct xt_NFQ_info {
+ __u16 queuenum;
+};
+
+#endif /* _XT_NFQ_TARGET_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_RATEEST.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_RATEEST.h
new file mode 100644
index 0000000..6605e20
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_RATEEST.h
@@ -0,0 +1,15 @@
+#ifndef _XT_RATEEST_TARGET_H
+#define _XT_RATEEST_TARGET_H
+
+#include <linux/types.h>
+
+struct xt_rateest_target_info {
+ char name[IFNAMSIZ];
+ __s8 interval;
+ __u8 ewma_log;
+
+ /* Used internally by the kernel */
+ struct xt_rateest *est __attribute__((aligned(8)));
+};
+
+#endif /* _XT_RATEEST_TARGET_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_SECMARK.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_SECMARK.h
new file mode 100644
index 0000000..6fcd344
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_SECMARK.h
@@ -0,0 +1,28 @@
+#ifndef _XT_SECMARK_H_target
+#define _XT_SECMARK_H_target
+
+#include <linux/types.h>
+
+/*
+ * This is intended for use by various security subsystems (but not
+ * at the same time).
+ *
+ * 'mode' refers to the specific security subsystem which the
+ * packets are being marked for.
+ */
+#define SECMARK_MODE_SEL 0x01 /* SELinux */
+#define SECMARK_SELCTX_MAX 256
+
+struct xt_secmark_target_selinux_info {
+ __u32 selsid;
+ char selctx[SECMARK_SELCTX_MAX];
+};
+
+struct xt_secmark_target_info {
+ __u8 mode;
+ union {
+ struct xt_secmark_target_selinux_info sel;
+ } u;
+};
+
+#endif /*_XT_SECMARK_H_target */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_TCPMSS.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_TCPMSS.h
new file mode 100644
index 0000000..9a6960a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_TCPMSS.h
@@ -0,0 +1,12 @@
+#ifndef _XT_TCPMSS_H
+#define _XT_TCPMSS_H
+
+#include <linux/types.h>
+
+struct xt_tcpmss_info {
+ __u16 mss;
+};
+
+#define XT_TCPMSS_CLAMP_PMTU 0xffff
+
+#endif /* _XT_TCPMSS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_TCPOPTSTRIP.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_TCPOPTSTRIP.h
new file mode 100644
index 0000000..2db5432
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_TCPOPTSTRIP.h
@@ -0,0 +1,13 @@
+#ifndef _XT_TCPOPTSTRIP_H
+#define _XT_TCPOPTSTRIP_H
+
+#define tcpoptstrip_set_bit(bmap, idx) \
+ (bmap[(idx) >> 5] |= 1U << (idx & 31))
+#define tcpoptstrip_test_bit(bmap, idx) \
+ (((1U << (idx & 31)) & bmap[(idx) >> 5]) != 0)
+
+struct xt_tcpoptstrip_target_info {
+ u_int32_t strip_bmap[8];
+};
+
+#endif /* _XT_TCPOPTSTRIP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_TPROXY.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_TPROXY.h
new file mode 100644
index 0000000..152e8f9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_TPROXY.h
@@ -0,0 +1,14 @@
+#ifndef _XT_TPROXY_H_target
+#define _XT_TPROXY_H_target
+
+/* TPROXY target is capable of marking the packet to perform
+ * redirection. We can get rid of that whenever we get support for
+ * mutliple targets in the same rule. */
+struct xt_tproxy_target_info {
+ u_int32_t mark_mask;
+ u_int32_t mark_value;
+ __be32 laddr;
+ __be16 lport;
+};
+
+#endif /* _XT_TPROXY_H_target */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_cluster.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_cluster.h
new file mode 100644
index 0000000..8866826
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_cluster.h
@@ -0,0 +1,17 @@
+#ifndef _XT_CLUSTER_MATCH_H
+#define _XT_CLUSTER_MATCH_H
+
+enum xt_cluster_flags {
+ XT_CLUSTER_F_INV = (1 << 0)
+};
+
+struct xt_cluster_match_info {
+ u_int32_t total_nodes;
+ u_int32_t node_mask;
+ u_int32_t hash_seed;
+ u_int32_t flags;
+};
+
+#define XT_CLUSTER_NODES_MAX 32
+
+#endif /* _XT_CLUSTER_MATCH_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_comment.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_comment.h
new file mode 100644
index 0000000..eacfedc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_comment.h
@@ -0,0 +1,10 @@
+#ifndef _XT_COMMENT_H
+#define _XT_COMMENT_H
+
+#define XT_MAX_COMMENT_LEN 256
+
+struct xt_comment_info {
+ unsigned char comment[XT_MAX_COMMENT_LEN];
+};
+
+#endif /* XT_COMMENT_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_connbytes.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_connbytes.h
new file mode 100644
index 0000000..52bd615
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_connbytes.h
@@ -0,0 +1,27 @@
+#ifndef _XT_CONNBYTES_H
+#define _XT_CONNBYTES_H
+
+#include <linux/types.h>
+
+enum xt_connbytes_what {
+ XT_CONNBYTES_PKTS,
+ XT_CONNBYTES_BYTES,
+ XT_CONNBYTES_AVGPKT,
+};
+
+enum xt_connbytes_direction {
+ XT_CONNBYTES_DIR_ORIGINAL,
+ XT_CONNBYTES_DIR_REPLY,
+ XT_CONNBYTES_DIR_BOTH,
+};
+
+struct xt_connbytes_info
+{
+ struct {
+ aligned_u64 from; /* count to be matched */
+ aligned_u64 to; /* count to be matched */
+ } count;
+ __u8 what; /* ipt_connbytes_what */
+ __u8 direction; /* ipt_connbytes_direction */
+};
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_connlimit.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_connlimit.h
new file mode 100644
index 0000000..9ba54e4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_connlimit.h
@@ -0,0 +1,20 @@
+#ifndef _XT_CONNLIMIT_H
+#define _XT_CONNLIMIT_H
+
+struct xt_connlimit_data;
+
+struct xt_connlimit_info {
+ union {
+ union nf_inet_addr mask;
+ union {
+ __be32 v4_mask;
+ __be32 v6_mask[4];
+ };
+ };
+ unsigned int limit, inverse;
+
+ /* Used internally by the kernel */
+ struct xt_connlimit_data *data __attribute__((aligned(8)));
+};
+
+#endif /* _XT_CONNLIMIT_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_connmark.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_connmark.h
new file mode 100644
index 0000000..571e266
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_connmark.h
@@ -0,0 +1,25 @@
+#ifndef _XT_CONNMARK_H
+#define _XT_CONNMARK_H
+
+#include <linux/types.h>
+
+/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com>
+ * by Henrik Nordstrom <hno@marasystems.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+struct xt_connmark_info {
+ unsigned long mark, mask;
+ __u8 invert;
+};
+
+struct xt_connmark_mtinfo1 {
+ __u32 mark, mask;
+ __u8 invert;
+};
+
+#endif /*_XT_CONNMARK_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_conntrack.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_conntrack.h
new file mode 100644
index 0000000..3430c77
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_conntrack.h
@@ -0,0 +1,84 @@
+/* Header file for kernel module to match connection tracking information.
+ * GPL (C) 2001 Marc Boucher (marc@mbsi.ca).
+ */
+
+#ifndef _XT_CONNTRACK_H
+#define _XT_CONNTRACK_H
+
+#include <linux/types.h>
+#include <linux/netfilter/nf_conntrack_tuple_common.h>
+
+#define XT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1))
+#define XT_CONNTRACK_STATE_INVALID (1 << 0)
+
+#define XT_CONNTRACK_STATE_SNAT (1 << (IP_CT_NUMBER + 1))
+#define XT_CONNTRACK_STATE_DNAT (1 << (IP_CT_NUMBER + 2))
+#define XT_CONNTRACK_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 3))
+
+/* flags, invflags: */
+enum {
+ XT_CONNTRACK_STATE = 1 << 0,
+ XT_CONNTRACK_PROTO = 1 << 1,
+ XT_CONNTRACK_ORIGSRC = 1 << 2,
+ XT_CONNTRACK_ORIGDST = 1 << 3,
+ XT_CONNTRACK_REPLSRC = 1 << 4,
+ XT_CONNTRACK_REPLDST = 1 << 5,
+ XT_CONNTRACK_STATUS = 1 << 6,
+ XT_CONNTRACK_EXPIRES = 1 << 7,
+ XT_CONNTRACK_ORIGSRC_PORT = 1 << 8,
+ XT_CONNTRACK_ORIGDST_PORT = 1 << 9,
+ XT_CONNTRACK_REPLSRC_PORT = 1 << 10,
+ XT_CONNTRACK_REPLDST_PORT = 1 << 11,
+ XT_CONNTRACK_DIRECTION = 1 << 12,
+};
+
+/* This is exposed to userspace, so remains frozen in time. */
+struct ip_conntrack_old_tuple
+{
+ struct {
+ __be32 ip;
+ union {
+ __u16 all;
+ } u;
+ } src;
+
+ struct {
+ __be32 ip;
+ union {
+ __u16 all;
+ } u;
+
+ /* The protocol. */
+ __u16 protonum;
+ } dst;
+};
+
+struct xt_conntrack_info
+{
+ unsigned int statemask, statusmask;
+
+ struct ip_conntrack_old_tuple tuple[IP_CT_DIR_MAX];
+ struct in_addr sipmsk[IP_CT_DIR_MAX], dipmsk[IP_CT_DIR_MAX];
+
+ unsigned long expires_min, expires_max;
+
+ /* Flags word */
+ __u8 flags;
+ /* Inverse flags */
+ __u8 invflags;
+};
+
+struct xt_conntrack_mtinfo1 {
+ union nf_inet_addr origsrc_addr, origsrc_mask;
+ union nf_inet_addr origdst_addr, origdst_mask;
+ union nf_inet_addr replsrc_addr, replsrc_mask;
+ union nf_inet_addr repldst_addr, repldst_mask;
+ __u32 expires_min, expires_max;
+ __u16 l4proto;
+ __be16 origsrc_port, origdst_port;
+ __be16 replsrc_port, repldst_port;
+ __u16 match_flags, invert_flags;
+ __u8 state_mask, status_mask;
+};
+
+#endif /*_XT_CONNTRACK_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_dccp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_dccp.h
new file mode 100644
index 0000000..a579e1b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_dccp.h
@@ -0,0 +1,25 @@
+#ifndef _XT_DCCP_H_
+#define _XT_DCCP_H_
+
+#include <linux/types.h>
+
+#define XT_DCCP_SRC_PORTS 0x01
+#define XT_DCCP_DEST_PORTS 0x02
+#define XT_DCCP_TYPE 0x04
+#define XT_DCCP_OPTION 0x08
+
+#define XT_DCCP_VALID_FLAGS 0x0f
+
+struct xt_dccp_info {
+ __u16 dpts[2]; /* Min, Max */
+ __u16 spts[2]; /* Min, Max */
+
+ __u16 flags;
+ __u16 invflags;
+
+ __u16 typemask;
+ __u8 option;
+};
+
+#endif /* _XT_DCCP_H_ */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_dscp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_dscp.h
new file mode 100644
index 0000000..15f8932
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_dscp.h
@@ -0,0 +1,31 @@
+/* x_tables module for matching the IPv4/IPv6 DSCP field
+ *
+ * (C) 2002 Harald Welte <laforge@gnumonks.org>
+ * This software is distributed under GNU GPL v2, 1991
+ *
+ * See RFC2474 for a description of the DSCP field within the IP Header.
+ *
+ * xt_dscp.h,v 1.3 2002/08/05 19:00:21 laforge Exp
+*/
+#ifndef _XT_DSCP_H
+#define _XT_DSCP_H
+
+#include <linux/types.h>
+
+#define XT_DSCP_MASK 0xfc /* 11111100 */
+#define XT_DSCP_SHIFT 2
+#define XT_DSCP_MAX 0x3f /* 00111111 */
+
+/* match info */
+struct xt_dscp_info {
+ __u8 dscp;
+ __u8 invert;
+};
+
+struct xt_tos_match_info {
+ __u8 tos_mask;
+ __u8 tos_value;
+ __u8 invert;
+};
+
+#endif /* _XT_DSCP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_esp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_esp.h
new file mode 100644
index 0000000..ef6fa47
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_esp.h
@@ -0,0 +1,16 @@
+#ifndef _XT_ESP_H
+#define _XT_ESP_H
+
+#include <linux/types.h>
+
+struct xt_esp
+{
+ __u32 spis[2]; /* Security Parameter Index */
+ __u8 invflags; /* Inverse flags */
+};
+
+/* Values for "invflags" field in struct xt_esp. */
+#define XT_ESP_INV_SPI 0x01 /* Invert the sense of spi. */
+#define XT_ESP_INV_MASK 0x01 /* All possible flags. */
+
+#endif /*_XT_ESP_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_hashlimit.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_hashlimit.h
new file mode 100644
index 0000000..b1925b5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_hashlimit.h
@@ -0,0 +1,68 @@
+#ifndef _XT_HASHLIMIT_H
+#define _XT_HASHLIMIT_H
+
+#include <linux/types.h>
+
+/* timings are in milliseconds. */
+#define XT_HASHLIMIT_SCALE 10000
+/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490
+ seconds, or one every 59 hours. */
+
+/* details of this structure hidden by the implementation */
+struct xt_hashlimit_htable;
+
+enum {
+ XT_HASHLIMIT_HASH_DIP = 1 << 0,
+ XT_HASHLIMIT_HASH_DPT = 1 << 1,
+ XT_HASHLIMIT_HASH_SIP = 1 << 2,
+ XT_HASHLIMIT_HASH_SPT = 1 << 3,
+ XT_HASHLIMIT_INVERT = 1 << 4,
+};
+
+struct hashlimit_cfg {
+ __u32 mode; /* bitmask of XT_HASHLIMIT_HASH_* */
+ __u32 avg; /* Average secs between packets * scale */
+ __u32 burst; /* Period multiplier for upper limit. */
+
+ /* user specified */
+ __u32 size; /* how many buckets */
+ __u32 max; /* max number of entries */
+ __u32 gc_interval; /* gc interval */
+ __u32 expire; /* when do entries expire? */
+};
+
+struct xt_hashlimit_info {
+ char name [IFNAMSIZ]; /* name */
+ struct hashlimit_cfg cfg;
+
+ /* Used internally by the kernel */
+ struct xt_hashlimit_htable *hinfo;
+ union {
+ void *ptr;
+ struct xt_hashlimit_info *master;
+ } u;
+};
+
+struct hashlimit_cfg1 {
+ __u32 mode; /* bitmask of XT_HASHLIMIT_HASH_* */
+ __u32 avg; /* Average secs between packets * scale */
+ __u32 burst; /* Period multiplier for upper limit. */
+
+ /* user specified */
+ __u32 size; /* how many buckets */
+ __u32 max; /* max number of entries */
+ __u32 gc_interval; /* gc interval */
+ __u32 expire; /* when do entries expire? */
+
+ __u8 srcmask, dstmask;
+};
+
+struct xt_hashlimit_mtinfo1 {
+ char name[IFNAMSIZ];
+ struct hashlimit_cfg1 cfg;
+
+ /* Used internally by the kernel */
+ struct xt_hashlimit_htable *hinfo __attribute__((aligned(8)));
+};
+
+#endif /*_XT_HASHLIMIT_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_helper.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_helper.h
new file mode 100644
index 0000000..6b42763
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_helper.h
@@ -0,0 +1,8 @@
+#ifndef _XT_HELPER_H
+#define _XT_HELPER_H
+
+struct xt_helper_info {
+ int invert;
+ char name[30];
+};
+#endif /* _XT_HELPER_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_iprange.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_iprange.h
new file mode 100644
index 0000000..c1f21a7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_iprange.h
@@ -0,0 +1,19 @@
+#ifndef _LINUX_NETFILTER_XT_IPRANGE_H
+#define _LINUX_NETFILTER_XT_IPRANGE_H 1
+
+#include <linux/types.h>
+
+enum {
+ IPRANGE_SRC = 1 << 0, /* match source IP address */
+ IPRANGE_DST = 1 << 1, /* match destination IP address */
+ IPRANGE_SRC_INV = 1 << 4, /* negate the condition */
+ IPRANGE_DST_INV = 1 << 5, /* -"- */
+};
+
+struct xt_iprange_mtinfo {
+ union nf_inet_addr src_min, src_max;
+ union nf_inet_addr dst_min, dst_max;
+ __u8 flags;
+};
+
+#endif /* _LINUX_NETFILTER_XT_IPRANGE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_length.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_length.h
new file mode 100644
index 0000000..b82ed7c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_length.h
@@ -0,0 +1,11 @@
+#ifndef _XT_LENGTH_H
+#define _XT_LENGTH_H
+
+#include <linux/types.h>
+
+struct xt_length_info {
+ __u16 min, max;
+ __u8 invert;
+};
+
+#endif /*_XT_LENGTH_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_limit.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_limit.h
new file mode 100644
index 0000000..bb47fc4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_limit.h
@@ -0,0 +1,24 @@
+#ifndef _XT_RATE_H
+#define _XT_RATE_H
+
+#include <linux/types.h>
+
+/* timings are in milliseconds. */
+#define XT_LIMIT_SCALE 10000
+
+struct xt_limit_priv;
+
+/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490
+ seconds, or one every 59 hours. */
+struct xt_rateinfo {
+ __u32 avg; /* Average secs between packets * scale */
+ __u32 burst; /* Period multiplier for upper limit. */
+
+ /* Used internally by the kernel */
+ unsigned long prev; /* moved to xt_limit_priv */
+ __u32 credit; /* moved to xt_limit_priv */
+ __u32 credit_cap, cost;
+
+ struct xt_limit_priv *master;
+};
+#endif /*_XT_RATE_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_mac.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_mac.h
new file mode 100644
index 0000000..b892cdc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_mac.h
@@ -0,0 +1,8 @@
+#ifndef _XT_MAC_H
+#define _XT_MAC_H
+
+struct xt_mac_info {
+ unsigned char srcaddr[ETH_ALEN];
+ int invert;
+};
+#endif /*_XT_MAC_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_mark.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_mark.h
new file mode 100644
index 0000000..6fa460a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_mark.h
@@ -0,0 +1,16 @@
+#ifndef _XT_MARK_H
+#define _XT_MARK_H
+
+#include <linux/types.h>
+
+struct xt_mark_info {
+ unsigned long mark, mask;
+ __u8 invert;
+};
+
+struct xt_mark_mtinfo1 {
+ __u32 mark, mask;
+ __u8 invert;
+};
+
+#endif /*_XT_MARK_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_multiport.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_multiport.h
new file mode 100644
index 0000000..185db49
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_multiport.h
@@ -0,0 +1,32 @@
+#ifndef _XT_MULTIPORT_H
+#define _XT_MULTIPORT_H
+
+#include <linux/types.h>
+
+enum xt_multiport_flags
+{
+ XT_MULTIPORT_SOURCE,
+ XT_MULTIPORT_DESTINATION,
+ XT_MULTIPORT_EITHER
+};
+
+#define XT_MULTI_PORTS 15
+
+/* Must fit inside union xt_matchinfo: 16 bytes */
+struct xt_multiport
+{
+ __u8 flags; /* Type of comparison */
+ __u8 count; /* Number of ports */
+ __u16 ports[XT_MULTI_PORTS]; /* Ports */
+};
+
+struct xt_multiport_v1
+{
+ __u8 flags; /* Type of comparison */
+ __u8 count; /* Number of ports */
+ __u16 ports[XT_MULTI_PORTS]; /* Ports */
+ __u8 pflags[XT_MULTI_PORTS]; /* Port flags */
+ __u8 invert; /* Invert flag */
+};
+
+#endif /*_XT_MULTIPORT_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_owner.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_owner.h
new file mode 100644
index 0000000..2081761
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_owner.h
@@ -0,0 +1,18 @@
+#ifndef _XT_OWNER_MATCH_H
+#define _XT_OWNER_MATCH_H
+
+#include <linux/types.h>
+
+enum {
+ XT_OWNER_UID = 1 << 0,
+ XT_OWNER_GID = 1 << 1,
+ XT_OWNER_SOCKET = 1 << 2,
+};
+
+struct xt_owner_match_info {
+ __u32 uid_min, uid_max;
+ __u32 gid_min, gid_max;
+ __u8 match, invert;
+};
+
+#endif /* _XT_OWNER_MATCH_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_physdev.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_physdev.h
new file mode 100644
index 0000000..7d53660
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_physdev.h
@@ -0,0 +1,23 @@
+#ifndef _XT_PHYSDEV_H
+#define _XT_PHYSDEV_H
+
+#include <linux/types.h>
+
+
+#define XT_PHYSDEV_OP_IN 0x01
+#define XT_PHYSDEV_OP_OUT 0x02
+#define XT_PHYSDEV_OP_BRIDGED 0x04
+#define XT_PHYSDEV_OP_ISIN 0x08
+#define XT_PHYSDEV_OP_ISOUT 0x10
+#define XT_PHYSDEV_OP_MASK (0x20 - 1)
+
+struct xt_physdev_info {
+ char physindev[IFNAMSIZ];
+ char in_mask[IFNAMSIZ];
+ char physoutdev[IFNAMSIZ];
+ char out_mask[IFNAMSIZ];
+ __u8 invert;
+ __u8 bitmask;
+};
+
+#endif /*_XT_PHYSDEV_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_pkttype.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_pkttype.h
new file mode 100644
index 0000000..f265cf5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_pkttype.h
@@ -0,0 +1,8 @@
+#ifndef _XT_PKTTYPE_H
+#define _XT_PKTTYPE_H
+
+struct xt_pkttype_info {
+ int pkttype;
+ int invert;
+};
+#endif /*_XT_PKTTYPE_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_policy.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_policy.h
new file mode 100644
index 0000000..f8a2690
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_policy.h
@@ -0,0 +1,64 @@
+#ifndef _XT_POLICY_H
+#define _XT_POLICY_H
+
+#include <linux/types.h>
+
+#define XT_POLICY_MAX_ELEM 4
+
+enum xt_policy_flags
+{
+ XT_POLICY_MATCH_IN = 0x1,
+ XT_POLICY_MATCH_OUT = 0x2,
+ XT_POLICY_MATCH_NONE = 0x4,
+ XT_POLICY_MATCH_STRICT = 0x8,
+};
+
+enum xt_policy_modes
+{
+ XT_POLICY_MODE_TRANSPORT,
+ XT_POLICY_MODE_TUNNEL
+};
+
+struct xt_policy_spec
+{
+ __u8 saddr:1,
+ daddr:1,
+ proto:1,
+ mode:1,
+ spi:1,
+ reqid:1;
+};
+
+union xt_policy_addr
+{
+ struct in_addr a4;
+ struct in6_addr a6;
+};
+
+struct xt_policy_elem
+{
+ union {
+ struct {
+ union xt_policy_addr saddr;
+ union xt_policy_addr smask;
+ union xt_policy_addr daddr;
+ union xt_policy_addr dmask;
+ };
+ };
+ __be32 spi;
+ __u32 reqid;
+ __u8 proto;
+ __u8 mode;
+
+ struct xt_policy_spec match;
+ struct xt_policy_spec invert;
+};
+
+struct xt_policy_info
+{
+ struct xt_policy_elem pol[XT_POLICY_MAX_ELEM];
+ __u16 flags;
+ __u16 len;
+};
+
+#endif /* _XT_POLICY_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_quota.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_quota.h
new file mode 100644
index 0000000..8dc89df
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_quota.h
@@ -0,0 +1,20 @@
+#ifndef _XT_QUOTA_H
+#define _XT_QUOTA_H
+
+enum xt_quota_flags {
+ XT_QUOTA_INVERT = 0x1,
+};
+#define XT_QUOTA_MASK 0x1
+
+struct xt_quota_priv;
+
+struct xt_quota_info {
+ u_int32_t flags;
+ u_int32_t pad;
+
+ /* Used internally by the kernel */
+ aligned_u64 quota;
+ struct xt_quota_priv *master;
+};
+
+#endif /* _XT_QUOTA_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_rateest.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_rateest.h
new file mode 100644
index 0000000..d40a619
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_rateest.h
@@ -0,0 +1,37 @@
+#ifndef _XT_RATEEST_MATCH_H
+#define _XT_RATEEST_MATCH_H
+
+#include <linux/types.h>
+
+enum xt_rateest_match_flags {
+ XT_RATEEST_MATCH_INVERT = 1<<0,
+ XT_RATEEST_MATCH_ABS = 1<<1,
+ XT_RATEEST_MATCH_REL = 1<<2,
+ XT_RATEEST_MATCH_DELTA = 1<<3,
+ XT_RATEEST_MATCH_BPS = 1<<4,
+ XT_RATEEST_MATCH_PPS = 1<<5,
+};
+
+enum xt_rateest_match_mode {
+ XT_RATEEST_MATCH_NONE,
+ XT_RATEEST_MATCH_EQ,
+ XT_RATEEST_MATCH_LT,
+ XT_RATEEST_MATCH_GT,
+};
+
+struct xt_rateest_match_info {
+ char name1[IFNAMSIZ];
+ char name2[IFNAMSIZ];
+ __u16 flags;
+ __u16 mode;
+ __u32 bps1;
+ __u32 pps1;
+ __u32 bps2;
+ __u32 pps2;
+
+ /* Used internally by the kernel */
+ struct xt_rateest *est1 __attribute__((aligned(8)));
+ struct xt_rateest *est2 __attribute__((aligned(8)));
+};
+
+#endif /* _XT_RATEEST_MATCH_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_realm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_realm.h
new file mode 100644
index 0000000..d4a82ee
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_realm.h
@@ -0,0 +1,12 @@
+#ifndef _XT_REALM_H
+#define _XT_REALM_H
+
+#include <linux/types.h>
+
+struct xt_realm_info {
+ __u32 id;
+ __u32 mask;
+ __u8 invert;
+};
+
+#endif /* _XT_REALM_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_recent.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_recent.h
new file mode 100644
index 0000000..d2c2766
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_recent.h
@@ -0,0 +1,28 @@
+#ifndef _LINUX_NETFILTER_XT_RECENT_H
+#define _LINUX_NETFILTER_XT_RECENT_H 1
+
+#include <linux/types.h>
+
+enum {
+ XT_RECENT_CHECK = 1 << 0,
+ XT_RECENT_SET = 1 << 1,
+ XT_RECENT_UPDATE = 1 << 2,
+ XT_RECENT_REMOVE = 1 << 3,
+ XT_RECENT_TTL = 1 << 4,
+
+ XT_RECENT_SOURCE = 0,
+ XT_RECENT_DEST = 1,
+
+ XT_RECENT_NAME_LEN = 200,
+};
+
+struct xt_recent_mtinfo {
+ __u32 seconds;
+ __u32 hit_count;
+ __u8 check_set;
+ __u8 invert;
+ char name[XT_RECENT_NAME_LEN];
+ __u8 side;
+};
+
+#endif /* _LINUX_NETFILTER_XT_RECENT_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_sctp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_sctp.h
new file mode 100644
index 0000000..a501e61
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_sctp.h
@@ -0,0 +1,92 @@
+#ifndef _XT_SCTP_H_
+#define _XT_SCTP_H_
+
+#include <linux/types.h>
+
+#define XT_SCTP_SRC_PORTS 0x01
+#define XT_SCTP_DEST_PORTS 0x02
+#define XT_SCTP_CHUNK_TYPES 0x04
+
+#define XT_SCTP_VALID_FLAGS 0x07
+
+struct xt_sctp_flag_info {
+ __u8 chunktype;
+ __u8 flag;
+ __u8 flag_mask;
+};
+
+#define XT_NUM_SCTP_FLAGS 4
+
+struct xt_sctp_info {
+ __u16 dpts[2]; /* Min, Max */
+ __u16 spts[2]; /* Min, Max */
+
+ __u32 chunkmap[256 / sizeof (__u32)]; /* Bit mask of chunks to be matched according to RFC 2960 */
+
+#define SCTP_CHUNK_MATCH_ANY 0x01 /* Match if any of the chunk types are present */
+#define SCTP_CHUNK_MATCH_ALL 0x02 /* Match if all of the chunk types are present */
+#define SCTP_CHUNK_MATCH_ONLY 0x04 /* Match if these are the only chunk types present */
+
+ __u32 chunk_match_type;
+ struct xt_sctp_flag_info flag_info[XT_NUM_SCTP_FLAGS];
+ int flag_count;
+
+ __u32 flags;
+ __u32 invflags;
+};
+
+#define bytes(type) (sizeof(type) * 8)
+
+#define SCTP_CHUNKMAP_SET(chunkmap, type) \
+ do { \
+ (chunkmap)[type / bytes(__u32)] |= \
+ 1 << (type % bytes(__u32)); \
+ } while (0)
+
+#define SCTP_CHUNKMAP_CLEAR(chunkmap, type) \
+ do { \
+ (chunkmap)[type / bytes(__u32)] &= \
+ ~(1 << (type % bytes(__u32))); \
+ } while (0)
+
+#define SCTP_CHUNKMAP_IS_SET(chunkmap, type) \
+({ \
+ ((chunkmap)[type / bytes (__u32)] & \
+ (1 << (type % bytes (__u32)))) ? 1: 0; \
+})
+
+#define SCTP_CHUNKMAP_RESET(chunkmap) \
+ memset((chunkmap), 0, sizeof(chunkmap))
+
+#define SCTP_CHUNKMAP_SET_ALL(chunkmap) \
+ memset((chunkmap), ~0U, sizeof(chunkmap))
+
+#define SCTP_CHUNKMAP_COPY(destmap, srcmap) \
+ memcpy((destmap), (srcmap), sizeof(srcmap))
+
+#define SCTP_CHUNKMAP_IS_CLEAR(chunkmap) \
+ __sctp_chunkmap_is_clear((chunkmap), ARRAY_SIZE(chunkmap))
+static __inline__ bool
+__sctp_chunkmap_is_clear(const __u32 *chunkmap, unsigned int n)
+{
+ unsigned int i;
+ for (i = 0; i < n; ++i)
+ if (chunkmap[i])
+ return false;
+ return true;
+}
+
+#define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap) \
+ __sctp_chunkmap_is_all_set((chunkmap), ARRAY_SIZE(chunkmap))
+static __inline__ bool
+__sctp_chunkmap_is_all_set(const __u32 *chunkmap, unsigned int n)
+{
+ unsigned int i;
+ for (i = 0; i < n; ++i)
+ if (chunkmap[i] != ~0U)
+ return false;
+ return true;
+}
+
+#endif /* _XT_SCTP_H_ */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_state.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_state.h
new file mode 100644
index 0000000..c06f32e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_state.h
@@ -0,0 +1,13 @@
+#ifndef _XT_STATE_H
+#define _XT_STATE_H
+
+#define XT_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1))
+#define XT_STATE_INVALID (1 << 0)
+
+#define XT_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 1))
+
+struct xt_state_info
+{
+ unsigned int statemask;
+};
+#endif /*_XT_STATE_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_statistic.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_statistic.h
new file mode 100644
index 0000000..4e983ef
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_statistic.h
@@ -0,0 +1,36 @@
+#ifndef _XT_STATISTIC_H
+#define _XT_STATISTIC_H
+
+#include <linux/types.h>
+
+enum xt_statistic_mode {
+ XT_STATISTIC_MODE_RANDOM,
+ XT_STATISTIC_MODE_NTH,
+ __XT_STATISTIC_MODE_MAX
+};
+#define XT_STATISTIC_MODE_MAX (__XT_STATISTIC_MODE_MAX - 1)
+
+enum xt_statistic_flags {
+ XT_STATISTIC_INVERT = 0x1,
+};
+#define XT_STATISTIC_MASK 0x1
+
+struct xt_statistic_priv;
+
+struct xt_statistic_info {
+ __u16 mode;
+ __u16 flags;
+ union {
+ struct {
+ __u32 probability;
+ } random;
+ struct {
+ __u32 every;
+ __u32 packet;
+ __u32 count; /* unused */
+ } nth;
+ } u;
+ struct xt_statistic_priv *master __attribute__((aligned(8)));
+};
+
+#endif /* _XT_STATISTIC_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_string.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_string.h
new file mode 100644
index 0000000..ecbb95f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_string.h
@@ -0,0 +1,35 @@
+#ifndef _XT_STRING_H
+#define _XT_STRING_H
+
+#include <linux/types.h>
+
+#define XT_STRING_MAX_PATTERN_SIZE 128
+#define XT_STRING_MAX_ALGO_NAME_SIZE 16
+
+enum {
+ XT_STRING_FLAG_INVERT = 0x01,
+ XT_STRING_FLAG_IGNORECASE = 0x02
+};
+
+struct xt_string_info
+{
+ __u16 from_offset;
+ __u16 to_offset;
+ char algo[XT_STRING_MAX_ALGO_NAME_SIZE];
+ char pattern[XT_STRING_MAX_PATTERN_SIZE];
+ __u8 patlen;
+ union {
+ struct {
+ __u8 invert;
+ } v0;
+
+ struct {
+ __u8 flags;
+ } v1;
+ } u;
+
+ /* Used internally by the kernel */
+ struct ts_config __attribute__((aligned(8))) *config;
+};
+
+#endif /*_XT_STRING_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_tcpmss.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_tcpmss.h
new file mode 100644
index 0000000..fbac56b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_tcpmss.h
@@ -0,0 +1,11 @@
+#ifndef _XT_TCPMSS_MATCH_H
+#define _XT_TCPMSS_MATCH_H
+
+#include <linux/types.h>
+
+struct xt_tcpmss_match_info {
+ __u16 mss_min, mss_max;
+ __u8 invert;
+};
+
+#endif /*_XT_TCPMSS_MATCH_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_tcpudp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_tcpudp.h
new file mode 100644
index 0000000..a490a0b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_tcpudp.h
@@ -0,0 +1,38 @@
+#ifndef _XT_TCPUDP_H
+#define _XT_TCPUDP_H
+
+#include <linux/types.h>
+
+/* TCP matching stuff */
+struct xt_tcp
+{
+ __u16 spts[2]; /* Source port range. */
+ __u16 dpts[2]; /* Destination port range. */
+ __u8 option; /* TCP Option iff non-zero*/
+ __u8 flg_mask; /* TCP flags mask byte */
+ __u8 flg_cmp; /* TCP flags compare byte */
+ __u8 invflags; /* Inverse flags */
+};
+
+/* Values for "inv" field in struct ipt_tcp. */
+#define XT_TCP_INV_SRCPT 0x01 /* Invert the sense of source ports. */
+#define XT_TCP_INV_DSTPT 0x02 /* Invert the sense of dest ports. */
+#define XT_TCP_INV_FLAGS 0x04 /* Invert the sense of TCP flags. */
+#define XT_TCP_INV_OPTION 0x08 /* Invert the sense of option test. */
+#define XT_TCP_INV_MASK 0x0F /* All possible flags. */
+
+/* UDP matching stuff */
+struct xt_udp
+{
+ __u16 spts[2]; /* Source port range. */
+ __u16 dpts[2]; /* Destination port range. */
+ __u8 invflags; /* Inverse flags */
+};
+
+/* Values for "invflags" field in struct ipt_udp. */
+#define XT_UDP_INV_SRCPT 0x01 /* Invert the sense of source ports. */
+#define XT_UDP_INV_DSTPT 0x02 /* Invert the sense of dest ports. */
+#define XT_UDP_INV_MASK 0x03 /* All possible flags. */
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_time.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_time.h
new file mode 100644
index 0000000..14b6df4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_time.h
@@ -0,0 +1,25 @@
+#ifndef _XT_TIME_H
+#define _XT_TIME_H 1
+
+struct xt_time_info {
+ u_int32_t date_start;
+ u_int32_t date_stop;
+ u_int32_t daytime_start;
+ u_int32_t daytime_stop;
+ u_int32_t monthdays_match;
+ u_int8_t weekdays_match;
+ u_int8_t flags;
+};
+
+enum {
+ /* Match against local time (instead of UTC) */
+ XT_TIME_LOCAL_TZ = 1 << 0,
+
+ /* Shortcuts */
+ XT_TIME_ALL_MONTHDAYS = 0xFFFFFFFE,
+ XT_TIME_ALL_WEEKDAYS = 0xFE,
+ XT_TIME_MIN_DAYTIME = 0,
+ XT_TIME_MAX_DAYTIME = 24 * 60 * 60 - 1,
+};
+
+#endif /* _XT_TIME_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_u32.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_u32.h
new file mode 100644
index 0000000..9947f56
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter/xt_u32.h
@@ -0,0 +1,40 @@
+#ifndef _XT_U32_H
+#define _XT_U32_H 1
+
+enum xt_u32_ops {
+ XT_U32_AND,
+ XT_U32_LEFTSH,
+ XT_U32_RIGHTSH,
+ XT_U32_AT,
+};
+
+struct xt_u32_location_element {
+ u_int32_t number;
+ u_int8_t nextop;
+};
+
+struct xt_u32_value_element {
+ u_int32_t min;
+ u_int32_t max;
+};
+
+/*
+ * Any way to allow for an arbitrary number of elements?
+ * For now, I settle with a limit of 10 each.
+ */
+#define XT_U32_MAXSIZE 10
+
+struct xt_u32_test {
+ struct xt_u32_location_element location[XT_U32_MAXSIZE+1];
+ struct xt_u32_value_element value[XT_U32_MAXSIZE+1];
+ u_int8_t nnums;
+ u_int8_t nvalues;
+};
+
+struct xt_u32 {
+ struct xt_u32_test tests[XT_U32_MAXSIZE+1];
+ u_int8_t ntests;
+ u_int8_t invert;
+};
+
+#endif /* _XT_U32_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_arp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_arp.h
new file mode 100644
index 0000000..92bc6dd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_arp.h
@@ -0,0 +1,19 @@
+#ifndef __LINUX_ARP_NETFILTER_H
+#define __LINUX_ARP_NETFILTER_H
+
+/* ARP-specific defines for netfilter.
+ * (C)2002 Rusty Russell IBM -- This code is GPL.
+ */
+
+#include <linux/netfilter.h>
+
+/* There is no PF_ARP. */
+#define NF_ARP 0
+
+/* ARP Hooks */
+#define NF_ARP_IN 0
+#define NF_ARP_OUT 1
+#define NF_ARP_FORWARD 2
+#define NF_ARP_NUMHOOKS 3
+
+#endif /* __LINUX_ARP_NETFILTER_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_arp/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_arp/..install.cmd
new file mode 100644
index 0000000..c21c55b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_arp/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/netfilter_arp/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/netfilter_arp /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/netfilter_arp mips arp_tables.h arpt_mangle.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/netfilter_arp /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/netfilter_arp mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/netfilter_arp/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_arp/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_arp/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_arp/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_arp/arp_tables.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_arp/arp_tables.h
new file mode 100644
index 0000000..16ae7c3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_arp/arp_tables.h
@@ -0,0 +1,218 @@
+/*
+ * Format of an ARP firewall descriptor
+ *
+ * src, tgt, src_mask, tgt_mask, arpop, arpop_mask are always stored in
+ * network byte order.
+ * flags are stored in host byte order (of course).
+ */
+
+#ifndef _ARPTABLES_H
+#define _ARPTABLES_H
+
+#include <linux/types.h>
+
+#include <linux/netfilter_arp.h>
+
+#include <linux/netfilter/x_tables.h>
+
+#define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
+#define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
+
+#define ARPT_DEV_ADDR_LEN_MAX 16
+
+struct arpt_devaddr_info {
+ char addr[ARPT_DEV_ADDR_LEN_MAX];
+ char mask[ARPT_DEV_ADDR_LEN_MAX];
+};
+
+/* Yes, Virginia, you have to zero the padding. */
+struct arpt_arp {
+ /* Source and target IP addr */
+ struct in_addr src, tgt;
+ /* Mask for src and target IP addr */
+ struct in_addr smsk, tmsk;
+
+ /* Device hw address length, src+target device addresses */
+ u_int8_t arhln, arhln_mask;
+ struct arpt_devaddr_info src_devaddr;
+ struct arpt_devaddr_info tgt_devaddr;
+
+ /* ARP operation code. */
+ __be16 arpop, arpop_mask;
+
+ /* ARP hardware address and protocol address format. */
+ __be16 arhrd, arhrd_mask;
+ __be16 arpro, arpro_mask;
+
+ /* The protocol address length is only accepted if it is 4
+ * so there is no use in offering a way to do filtering on it.
+ */
+
+ char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
+ unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
+
+ /* Flags word */
+ u_int8_t flags;
+ /* Inverse flags */
+ u_int16_t invflags;
+};
+
+#define arpt_entry_target xt_entry_target
+#define arpt_standard_target xt_standard_target
+
+/* Values for "flag" field in struct arpt_ip (general arp structure).
+ * No flags defined yet.
+ */
+#define ARPT_F_MASK 0x00 /* All possible flag bits mask. */
+
+/* Values for "inv" field in struct arpt_arp. */
+#define ARPT_INV_VIA_IN 0x0001 /* Invert the sense of IN IFACE. */
+#define ARPT_INV_VIA_OUT 0x0002 /* Invert the sense of OUT IFACE */
+#define ARPT_INV_SRCIP 0x0004 /* Invert the sense of SRC IP. */
+#define ARPT_INV_TGTIP 0x0008 /* Invert the sense of TGT IP. */
+#define ARPT_INV_SRCDEVADDR 0x0010 /* Invert the sense of SRC DEV ADDR. */
+#define ARPT_INV_TGTDEVADDR 0x0020 /* Invert the sense of TGT DEV ADDR. */
+#define ARPT_INV_ARPOP 0x0040 /* Invert the sense of ARP OP. */
+#define ARPT_INV_ARPHRD 0x0080 /* Invert the sense of ARP HRD. */
+#define ARPT_INV_ARPPRO 0x0100 /* Invert the sense of ARP PRO. */
+#define ARPT_INV_ARPHLN 0x0200 /* Invert the sense of ARP HLN. */
+#define ARPT_INV_MASK 0x03FF /* All possible flag bits mask. */
+
+/* This structure defines each of the firewall rules. Consists of 3
+ parts which are 1) general ARP header stuff 2) match specific
+ stuff 3) the target to perform if the rule matches */
+struct arpt_entry
+{
+ struct arpt_arp arp;
+
+ /* Size of arpt_entry + matches */
+ u_int16_t target_offset;
+ /* Size of arpt_entry + matches + target */
+ u_int16_t next_offset;
+
+ /* Back pointer */
+ unsigned int comefrom;
+
+ /* Packet and byte counters. */
+ struct xt_counters counters;
+
+ /* The matches (if any), then the target. */
+ unsigned char elems[0];
+};
+
+/*
+ * New IP firewall options for [gs]etsockopt at the RAW IP level.
+ * Unlike BSD Linux inherits IP options so you don't have to use a raw
+ * socket for this. Instead we check rights in the calls.
+ *
+ * ATTENTION: check linux/in.h before adding new number here.
+ */
+#define ARPT_BASE_CTL 96
+
+#define ARPT_SO_SET_REPLACE (ARPT_BASE_CTL)
+#define ARPT_SO_SET_ADD_COUNTERS (ARPT_BASE_CTL + 1)
+#define ARPT_SO_SET_MAX ARPT_SO_SET_ADD_COUNTERS
+
+#define ARPT_SO_GET_INFO (ARPT_BASE_CTL)
+#define ARPT_SO_GET_ENTRIES (ARPT_BASE_CTL + 1)
+/* #define ARPT_SO_GET_REVISION_MATCH (APRT_BASE_CTL + 2) */
+#define ARPT_SO_GET_REVISION_TARGET (ARPT_BASE_CTL + 3)
+#define ARPT_SO_GET_MAX (ARPT_SO_GET_REVISION_TARGET)
+
+/* CONTINUE verdict for targets */
+#define ARPT_CONTINUE XT_CONTINUE
+
+/* For standard target */
+#define ARPT_RETURN XT_RETURN
+
+/* The argument to ARPT_SO_GET_INFO */
+struct arpt_getinfo
+{
+ /* Which table: caller fills this in. */
+ char name[ARPT_TABLE_MAXNAMELEN];
+
+ /* Kernel fills these in. */
+ /* Which hook entry points are valid: bitmask */
+ unsigned int valid_hooks;
+
+ /* Hook entry points: one per netfilter hook. */
+ unsigned int hook_entry[NF_ARP_NUMHOOKS];
+
+ /* Underflow points. */
+ unsigned int underflow[NF_ARP_NUMHOOKS];
+
+ /* Number of entries */
+ unsigned int num_entries;
+
+ /* Size of entries. */
+ unsigned int size;
+};
+
+/* The argument to ARPT_SO_SET_REPLACE. */
+struct arpt_replace
+{
+ /* Which table. */
+ char name[ARPT_TABLE_MAXNAMELEN];
+
+ /* Which hook entry points are valid: bitmask. You can't
+ change this. */
+ unsigned int valid_hooks;
+
+ /* Number of entries */
+ unsigned int num_entries;
+
+ /* Total size of new entries */
+ unsigned int size;
+
+ /* Hook entry points. */
+ unsigned int hook_entry[NF_ARP_NUMHOOKS];
+
+ /* Underflow points. */
+ unsigned int underflow[NF_ARP_NUMHOOKS];
+
+ /* Information about old entries: */
+ /* Number of counters (must be equal to current number of entries). */
+ unsigned int num_counters;
+ /* The old entries' counters. */
+ struct xt_counters *counters;
+
+ /* The entries (hang off end: not really an array). */
+ struct arpt_entry entries[0];
+};
+
+/* The argument to ARPT_SO_ADD_COUNTERS. */
+#define arpt_counters_info xt_counters_info
+#define arpt_counters xt_counters
+
+/* The argument to ARPT_SO_GET_ENTRIES. */
+struct arpt_get_entries
+{
+ /* Which table: user fills this in. */
+ char name[ARPT_TABLE_MAXNAMELEN];
+
+ /* User fills this in: total entry size. */
+ unsigned int size;
+
+ /* The entries. */
+ struct arpt_entry entrytable[0];
+};
+
+/* Standard return verdict, or do jump. */
+#define ARPT_STANDARD_TARGET XT_STANDARD_TARGET
+/* Error verdict. */
+#define ARPT_ERROR_TARGET XT_ERROR_TARGET
+
+/* Helper functions */
+static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e)
+{
+ return (void *)e + e->target_offset;
+}
+
+/* fn returns 0 to continue iteration */
+#define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \
+ XT_ENTRY_ITERATE(struct arpt_entry, entries, size, fn, ## args)
+
+/*
+ * Main firewall chains definitions and global var's definitions.
+ */
+#endif /* _ARPTABLES_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_arp/arpt_mangle.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_arp/arpt_mangle.h
new file mode 100644
index 0000000..250f502
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_arp/arpt_mangle.h
@@ -0,0 +1,26 @@
+#ifndef _ARPT_MANGLE_H
+#define _ARPT_MANGLE_H
+#include <linux/netfilter_arp/arp_tables.h>
+
+#define ARPT_MANGLE_ADDR_LEN_MAX sizeof(struct in_addr)
+struct arpt_mangle
+{
+ char src_devaddr[ARPT_DEV_ADDR_LEN_MAX];
+ char tgt_devaddr[ARPT_DEV_ADDR_LEN_MAX];
+ union {
+ struct in_addr src_ip;
+ } u_s;
+ union {
+ struct in_addr tgt_ip;
+ } u_t;
+ u_int8_t flags;
+ int target;
+};
+
+#define ARPT_MANGLE_SDEV 0x01
+#define ARPT_MANGLE_TDEV 0x02
+#define ARPT_MANGLE_SIP 0x04
+#define ARPT_MANGLE_TIP 0x08
+#define ARPT_MANGLE_MASK 0x0f
+
+#endif /* _ARPT_MANGLE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge.h
new file mode 100644
index 0000000..5094ecc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge.h
@@ -0,0 +1,27 @@
+#ifndef __LINUX_BRIDGE_NETFILTER_H
+#define __LINUX_BRIDGE_NETFILTER_H
+
+/* bridge-specific defines for netfilter.
+ */
+
+#include <linux/netfilter.h>
+#include <linux/if_ether.h>
+#include <linux/if_vlan.h>
+#include <linux/if_pppox.h>
+
+/* Bridge Hooks */
+/* After promisc drops, checksum checks. */
+#define NF_BR_PRE_ROUTING 0
+/* If the packet is destined for this box. */
+#define NF_BR_LOCAL_IN 1
+/* If the packet is destined for another interface. */
+#define NF_BR_FORWARD 2
+/* Packets coming from a local process. */
+#define NF_BR_LOCAL_OUT 3
+/* Packets about to hit the wire. */
+#define NF_BR_POST_ROUTING 4
+/* Not really a hook, but used for the ebtables broute table */
+#define NF_BR_BROUTING 5
+#define NF_BR_NUMHOOKS 6
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/..install.cmd
new file mode 100644
index 0000000..70e7f9e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/netfilter_bridge/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/netfilter_bridge /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/netfilter_bridge mips ebt_802_3.h ebt_among.h ebt_arp.h ebt_arpreply.h ebt_ip.h ebt_limit.h ebt_log.h ebt_mark_m.h ebt_mark_t.h ebt_nat.h ebt_pkttype.h ebt_redirect.h ebt_stp.h ebt_ulog.h ebt_vlan.h ebtables.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/netfilter_bridge /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/netfilter_bridge mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/netfilter_bridge/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_802_3.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_802_3.h
new file mode 100644
index 0000000..b61e308
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_802_3.h
@@ -0,0 +1,61 @@
+#ifndef __LINUX_BRIDGE_EBT_802_3_H
+#define __LINUX_BRIDGE_EBT_802_3_H
+
+#define EBT_802_3_SAP 0x01
+#define EBT_802_3_TYPE 0x02
+
+#define EBT_802_3_MATCH "802_3"
+
+/*
+ * If frame has DSAP/SSAP value 0xaa you must check the SNAP type
+ * to discover what kind of packet we're carrying.
+ */
+#define CHECK_TYPE 0xaa
+
+/*
+ * Control field may be one or two bytes. If the first byte has
+ * the value 0x03 then the entire length is one byte, otherwise it is two.
+ * One byte controls are used in Unnumbered Information frames.
+ * Two byte controls are used in Numbered Information frames.
+ */
+#define IS_UI 0x03
+
+#define EBT_802_3_MASK (EBT_802_3_SAP | EBT_802_3_TYPE | EBT_802_3)
+
+/* ui has one byte ctrl, ni has two */
+struct hdr_ui {
+ uint8_t dsap;
+ uint8_t ssap;
+ uint8_t ctrl;
+ uint8_t orig[3];
+ __be16 type;
+};
+
+struct hdr_ni {
+ uint8_t dsap;
+ uint8_t ssap;
+ __be16 ctrl;
+ uint8_t orig[3];
+ __be16 type;
+};
+
+struct ebt_802_3_hdr {
+ uint8_t daddr[6];
+ uint8_t saddr[6];
+ __be16 len;
+ union {
+ struct hdr_ui ui;
+ struct hdr_ni ni;
+ } llc;
+};
+
+
+struct ebt_802_3_info
+{
+ uint8_t sap;
+ __be16 type;
+ uint8_t bitmask;
+ uint8_t invflags;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_among.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_among.h
new file mode 100644
index 0000000..7654069
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_among.h
@@ -0,0 +1,65 @@
+#ifndef __LINUX_BRIDGE_EBT_AMONG_H
+#define __LINUX_BRIDGE_EBT_AMONG_H
+
+#define EBT_AMONG_DST 0x01
+#define EBT_AMONG_SRC 0x02
+
+/* Grzegorz Borowiak <grzes@gnu.univ.gda.pl> 2003
+ *
+ * Write-once-read-many hash table, used for checking if a given
+ * MAC address belongs to a set or not and possibly for checking
+ * if it is related with a given IPv4 address.
+ *
+ * The hash value of an address is its last byte.
+ *
+ * In real-world ethernet addresses, values of the last byte are
+ * evenly distributed and there is no need to consider other bytes.
+ * It would only slow the routines down.
+ *
+ * For MAC address comparison speedup reasons, we introduce a trick.
+ * MAC address is mapped onto an array of two 32-bit integers.
+ * This pair of integers is compared with MAC addresses in the
+ * hash table, which are stored also in form of pairs of integers
+ * (in `cmp' array). This is quick as it requires only two elementary
+ * number comparisons in worst case. Further, we take advantage of
+ * fact that entropy of 3 last bytes of address is larger than entropy
+ * of 3 first bytes. So first we compare 4 last bytes of addresses and
+ * if they are the same we compare 2 first.
+ *
+ * Yes, it is a memory overhead, but in 2003 AD, who cares?
+ */
+
+struct ebt_mac_wormhash_tuple
+{
+ uint32_t cmp[2];
+ __be32 ip;
+};
+
+struct ebt_mac_wormhash
+{
+ int table[257];
+ int poolsize;
+ struct ebt_mac_wormhash_tuple pool[0];
+};
+
+#define ebt_mac_wormhash_size(x) ((x) ? sizeof(struct ebt_mac_wormhash) \
+ + (x)->poolsize * sizeof(struct ebt_mac_wormhash_tuple) : 0)
+
+struct ebt_among_info
+{
+ int wh_dst_ofs;
+ int wh_src_ofs;
+ int bitmask;
+};
+
+#define EBT_AMONG_DST_NEG 0x1
+#define EBT_AMONG_SRC_NEG 0x2
+
+#define ebt_among_wh_dst(x) ((x)->wh_dst_ofs ? \
+ (struct ebt_mac_wormhash*)((char*)(x) + (x)->wh_dst_ofs) : NULL)
+#define ebt_among_wh_src(x) ((x)->wh_src_ofs ? \
+ (struct ebt_mac_wormhash*)((char*)(x) + (x)->wh_src_ofs) : NULL)
+
+#define EBT_AMONG_MATCH "among"
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_arp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_arp.h
new file mode 100644
index 0000000..cbf4843
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_arp.h
@@ -0,0 +1,34 @@
+#ifndef __LINUX_BRIDGE_EBT_ARP_H
+#define __LINUX_BRIDGE_EBT_ARP_H
+
+#define EBT_ARP_OPCODE 0x01
+#define EBT_ARP_HTYPE 0x02
+#define EBT_ARP_PTYPE 0x04
+#define EBT_ARP_SRC_IP 0x08
+#define EBT_ARP_DST_IP 0x10
+#define EBT_ARP_SRC_MAC 0x20
+#define EBT_ARP_DST_MAC 0x40
+#define EBT_ARP_GRAT 0x80
+#define EBT_ARP_MASK (EBT_ARP_OPCODE | EBT_ARP_HTYPE | EBT_ARP_PTYPE | \
+ EBT_ARP_SRC_IP | EBT_ARP_DST_IP | EBT_ARP_SRC_MAC | EBT_ARP_DST_MAC | \
+ EBT_ARP_GRAT)
+#define EBT_ARP_MATCH "arp"
+
+struct ebt_arp_info
+{
+ __be16 htype;
+ __be16 ptype;
+ __be16 opcode;
+ __be32 saddr;
+ __be32 smsk;
+ __be32 daddr;
+ __be32 dmsk;
+ unsigned char smaddr[ETH_ALEN];
+ unsigned char smmsk[ETH_ALEN];
+ unsigned char dmaddr[ETH_ALEN];
+ unsigned char dmmsk[ETH_ALEN];
+ uint8_t bitmask;
+ uint8_t invflags;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_arpreply.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_arpreply.h
new file mode 100644
index 0000000..96a8339
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_arpreply.h
@@ -0,0 +1,11 @@
+#ifndef __LINUX_BRIDGE_EBT_ARPREPLY_H
+#define __LINUX_BRIDGE_EBT_ARPREPLY_H
+
+struct ebt_arpreply_info
+{
+ unsigned char mac[ETH_ALEN];
+ int target;
+};
+#define EBT_ARPREPLY_TARGET "arpreply"
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_ip.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_ip.h
new file mode 100644
index 0000000..d684747
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_ip.h
@@ -0,0 +1,43 @@
+/*
+ * ebt_ip
+ *
+ * Authors:
+ * Bart De Schuymer <bart.de.schuymer@pandora.be>
+ *
+ * April, 2002
+ *
+ * Changes:
+ * added ip-sport and ip-dport
+ * Innominate Security Technologies AG <mhopf@innominate.com>
+ * September, 2002
+ */
+
+#ifndef __LINUX_BRIDGE_EBT_IP_H
+#define __LINUX_BRIDGE_EBT_IP_H
+
+#define EBT_IP_SOURCE 0x01
+#define EBT_IP_DEST 0x02
+#define EBT_IP_TOS 0x04
+#define EBT_IP_PROTO 0x08
+#define EBT_IP_SPORT 0x10
+#define EBT_IP_DPORT 0x20
+#define EBT_IP_MASK (EBT_IP_SOURCE | EBT_IP_DEST | EBT_IP_TOS | EBT_IP_PROTO |\
+ EBT_IP_SPORT | EBT_IP_DPORT )
+#define EBT_IP_MATCH "ip"
+
+/* the same values are used for the invflags */
+struct ebt_ip_info
+{
+ __be32 saddr;
+ __be32 daddr;
+ __be32 smsk;
+ __be32 dmsk;
+ uint8_t tos;
+ uint8_t protocol;
+ uint8_t bitmask;
+ uint8_t invflags;
+ uint16_t sport[2];
+ uint16_t dport[2];
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_limit.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_limit.h
new file mode 100644
index 0000000..d8b6500
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_limit.h
@@ -0,0 +1,23 @@
+#ifndef __LINUX_BRIDGE_EBT_LIMIT_H
+#define __LINUX_BRIDGE_EBT_LIMIT_H
+
+#define EBT_LIMIT_MATCH "limit"
+
+/* timings are in milliseconds. */
+#define EBT_LIMIT_SCALE 10000
+
+/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490
+ seconds, or one every 59 hours. */
+
+struct ebt_limit_info
+{
+ u_int32_t avg; /* Average secs between packets * scale */
+ u_int32_t burst; /* Period multiplier for upper limit. */
+
+ /* Used internally by the kernel */
+ unsigned long prev;
+ u_int32_t credit;
+ u_int32_t credit_cap, cost;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_log.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_log.h
new file mode 100644
index 0000000..b76e653
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_log.h
@@ -0,0 +1,19 @@
+#ifndef __LINUX_BRIDGE_EBT_LOG_H
+#define __LINUX_BRIDGE_EBT_LOG_H
+
+#define EBT_LOG_IP 0x01 /* if the frame is made by ip, log the ip information */
+#define EBT_LOG_ARP 0x02
+#define EBT_LOG_NFLOG 0x04
+#define EBT_LOG_IP6 0x08
+#define EBT_LOG_MASK (EBT_LOG_IP | EBT_LOG_ARP | EBT_LOG_IP6)
+#define EBT_LOG_PREFIX_SIZE 30
+#define EBT_LOG_WATCHER "log"
+
+struct ebt_log_info
+{
+ uint8_t loglevel;
+ uint8_t prefix[EBT_LOG_PREFIX_SIZE];
+ uint32_t bitmask;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_mark_m.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_mark_m.h
new file mode 100644
index 0000000..301524f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_mark_m.h
@@ -0,0 +1,15 @@
+#ifndef __LINUX_BRIDGE_EBT_MARK_M_H
+#define __LINUX_BRIDGE_EBT_MARK_M_H
+
+#define EBT_MARK_AND 0x01
+#define EBT_MARK_OR 0x02
+#define EBT_MARK_MASK (EBT_MARK_AND | EBT_MARK_OR)
+struct ebt_mark_m_info
+{
+ unsigned long mark, mask;
+ uint8_t invert;
+ uint8_t bitmask;
+};
+#define EBT_MARK_MATCH "mark_m"
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_mark_t.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_mark_t.h
new file mode 100644
index 0000000..6270f6f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_mark_t.h
@@ -0,0 +1,24 @@
+#ifndef __LINUX_BRIDGE_EBT_MARK_T_H
+#define __LINUX_BRIDGE_EBT_MARK_T_H
+
+/* The target member is reused for adding new actions, the
+ * value of the real target is -1 to -NUM_STANDARD_TARGETS.
+ * For backward compatibility, the 4 lsb (2 would be enough,
+ * but let's play it safe) are kept to designate this target.
+ * The remaining bits designate the action. By making the set
+ * action 0xfffffff0, the result will look ok for older
+ * versions. [September 2006] */
+#define MARK_SET_VALUE (0xfffffff0)
+#define MARK_OR_VALUE (0xffffffe0)
+#define MARK_AND_VALUE (0xffffffd0)
+#define MARK_XOR_VALUE (0xffffffc0)
+
+struct ebt_mark_t_info
+{
+ unsigned long mark;
+ /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */
+ int target;
+};
+#define EBT_MARK_TARGET "mark"
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_nat.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_nat.h
new file mode 100644
index 0000000..435b886
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_nat.h
@@ -0,0 +1,14 @@
+#ifndef __LINUX_BRIDGE_EBT_NAT_H
+#define __LINUX_BRIDGE_EBT_NAT_H
+
+#define NAT_ARP_BIT (0x00000010)
+struct ebt_nat_info
+{
+ unsigned char mac[ETH_ALEN];
+ /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */
+ int target;
+};
+#define EBT_SNAT_TARGET "snat"
+#define EBT_DNAT_TARGET "dnat"
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_pkttype.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_pkttype.h
new file mode 100644
index 0000000..0d64bbb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_pkttype.h
@@ -0,0 +1,11 @@
+#ifndef __LINUX_BRIDGE_EBT_PKTTYPE_H
+#define __LINUX_BRIDGE_EBT_PKTTYPE_H
+
+struct ebt_pkttype_info
+{
+ uint8_t pkt_type;
+ uint8_t invert;
+};
+#define EBT_PKTTYPE_MATCH "pkttype"
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_redirect.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_redirect.h
new file mode 100644
index 0000000..5c67990
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_redirect.h
@@ -0,0 +1,11 @@
+#ifndef __LINUX_BRIDGE_EBT_REDIRECT_H
+#define __LINUX_BRIDGE_EBT_REDIRECT_H
+
+struct ebt_redirect_info
+{
+ /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */
+ int target;
+};
+#define EBT_REDIRECT_TARGET "redirect"
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_stp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_stp.h
new file mode 100644
index 0000000..e5fd678
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_stp.h
@@ -0,0 +1,46 @@
+#ifndef __LINUX_BRIDGE_EBT_STP_H
+#define __LINUX_BRIDGE_EBT_STP_H
+
+#define EBT_STP_TYPE 0x0001
+
+#define EBT_STP_FLAGS 0x0002
+#define EBT_STP_ROOTPRIO 0x0004
+#define EBT_STP_ROOTADDR 0x0008
+#define EBT_STP_ROOTCOST 0x0010
+#define EBT_STP_SENDERPRIO 0x0020
+#define EBT_STP_SENDERADDR 0x0040
+#define EBT_STP_PORT 0x0080
+#define EBT_STP_MSGAGE 0x0100
+#define EBT_STP_MAXAGE 0x0200
+#define EBT_STP_HELLOTIME 0x0400
+#define EBT_STP_FWDD 0x0800
+
+#define EBT_STP_MASK 0x0fff
+#define EBT_STP_CONFIG_MASK 0x0ffe
+
+#define EBT_STP_MATCH "stp"
+
+struct ebt_stp_config_info
+{
+ uint8_t flags;
+ uint16_t root_priol, root_priou;
+ char root_addr[6], root_addrmsk[6];
+ uint32_t root_costl, root_costu;
+ uint16_t sender_priol, sender_priou;
+ char sender_addr[6], sender_addrmsk[6];
+ uint16_t portl, portu;
+ uint16_t msg_agel, msg_ageu;
+ uint16_t max_agel, max_ageu;
+ uint16_t hello_timel, hello_timeu;
+ uint16_t forward_delayl, forward_delayu;
+};
+
+struct ebt_stp_info
+{
+ uint8_t type;
+ struct ebt_stp_config_info config;
+ uint16_t bitmask;
+ uint16_t invflags;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_ulog.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_ulog.h
new file mode 100644
index 0000000..b677e26
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_ulog.h
@@ -0,0 +1,36 @@
+#ifndef _EBT_ULOG_H
+#define _EBT_ULOG_H
+
+#define EBT_ULOG_DEFAULT_NLGROUP 0
+#define EBT_ULOG_DEFAULT_QTHRESHOLD 1
+#define EBT_ULOG_MAXNLGROUPS 32 /* hardcoded netlink max */
+#define EBT_ULOG_PREFIX_LEN 32
+#define EBT_ULOG_MAX_QLEN 50
+#define EBT_ULOG_WATCHER "ulog"
+#define EBT_ULOG_VERSION 1
+
+struct ebt_ulog_info {
+ uint32_t nlgroup;
+ unsigned int cprange;
+ unsigned int qthreshold;
+ char prefix[EBT_ULOG_PREFIX_LEN];
+};
+
+typedef struct ebt_ulog_packet_msg {
+ int version;
+ char indev[IFNAMSIZ];
+ char outdev[IFNAMSIZ];
+ char physindev[IFNAMSIZ];
+ char physoutdev[IFNAMSIZ];
+ char prefix[EBT_ULOG_PREFIX_LEN];
+ struct timeval stamp;
+ unsigned long mark;
+ unsigned int hook;
+ size_t data_len;
+ /* The complete packet, including Ethernet header and perhaps
+ * the VLAN header is appended */
+ unsigned char data[0] __attribute__
+ ((aligned (__alignof__(struct ebt_ulog_info))));
+} ebt_ulog_packet_msg_t;
+
+#endif /* _EBT_ULOG_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_vlan.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_vlan.h
new file mode 100644
index 0000000..1d98be4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebt_vlan.h
@@ -0,0 +1,20 @@
+#ifndef __LINUX_BRIDGE_EBT_VLAN_H
+#define __LINUX_BRIDGE_EBT_VLAN_H
+
+#define EBT_VLAN_ID 0x01
+#define EBT_VLAN_PRIO 0x02
+#define EBT_VLAN_ENCAP 0x04
+#define EBT_VLAN_MASK (EBT_VLAN_ID | EBT_VLAN_PRIO | EBT_VLAN_ENCAP)
+#define EBT_VLAN_MATCH "vlan"
+
+struct ebt_vlan_info {
+ uint16_t id; /* VLAN ID {1-4095} */
+ uint8_t prio; /* VLAN User Priority {0-7} */
+ __be16 encap; /* VLAN Encapsulated frame code {0-65535} */
+ uint8_t bitmask; /* Args bitmask bit 1=1 - ID arg,
+ bit 2=1 User-Priority arg, bit 3=1 encap*/
+ uint8_t invflags; /* Inverse bitmask bit 1=1 - inversed ID arg,
+ bit 2=1 - inversed Pirority arg */
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebtables.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebtables.h
new file mode 100644
index 0000000..1272888
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_bridge/ebtables.h
@@ -0,0 +1,275 @@
+/*
+ * ebtables
+ *
+ * Authors:
+ * Bart De Schuymer <bdschuym@pandora.be>
+ *
+ * ebtables.c,v 2.0, April, 2002
+ *
+ * This code is stongly inspired on the iptables code which is
+ * Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling
+ */
+
+#ifndef __LINUX_BRIDGE_EFF_H
+#define __LINUX_BRIDGE_EFF_H
+#include <linux/if.h>
+#include <linux/netfilter_bridge.h>
+#include <linux/if_ether.h>
+
+#define EBT_TABLE_MAXNAMELEN 32
+#define EBT_CHAIN_MAXNAMELEN EBT_TABLE_MAXNAMELEN
+#define EBT_FUNCTION_MAXNAMELEN EBT_TABLE_MAXNAMELEN
+
+/* verdicts >0 are "branches" */
+#define EBT_ACCEPT -1
+#define EBT_DROP -2
+#define EBT_CONTINUE -3
+#define EBT_RETURN -4
+#define NUM_STANDARD_TARGETS 4
+/* ebtables target modules store the verdict inside an int. We can
+ * reclaim a part of this int for backwards compatible extensions.
+ * The 4 lsb are more than enough to store the verdict. */
+#define EBT_VERDICT_BITS 0x0000000F
+
+struct xt_match;
+struct xt_target;
+
+struct ebt_counter
+{
+ uint64_t pcnt;
+ uint64_t bcnt;
+};
+
+struct ebt_replace
+{
+ char name[EBT_TABLE_MAXNAMELEN];
+ unsigned int valid_hooks;
+ /* nr of rules in the table */
+ unsigned int nentries;
+ /* total size of the entries */
+ unsigned int entries_size;
+ /* start of the chains */
+ struct ebt_entries *hook_entry[NF_BR_NUMHOOKS];
+ /* nr of counters userspace expects back */
+ unsigned int num_counters;
+ /* where the kernel will put the old counters */
+ struct ebt_counter *counters;
+ char *entries;
+};
+
+struct ebt_replace_kernel
+{
+ char name[EBT_TABLE_MAXNAMELEN];
+ unsigned int valid_hooks;
+ /* nr of rules in the table */
+ unsigned int nentries;
+ /* total size of the entries */
+ unsigned int entries_size;
+ /* start of the chains */
+ struct ebt_entries *hook_entry[NF_BR_NUMHOOKS];
+ /* nr of counters userspace expects back */
+ unsigned int num_counters;
+ /* where the kernel will put the old counters */
+ struct ebt_counter *counters;
+ char *entries;
+};
+
+struct ebt_entries {
+ /* this field is always set to zero
+ * See EBT_ENTRY_OR_ENTRIES.
+ * Must be same size as ebt_entry.bitmask */
+ unsigned int distinguisher;
+ /* the chain name */
+ char name[EBT_CHAIN_MAXNAMELEN];
+ /* counter offset for this chain */
+ unsigned int counter_offset;
+ /* one standard (accept, drop, return) per hook */
+ int policy;
+ /* nr. of entries */
+ unsigned int nentries;
+ /* entry list */
+ char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
+};
+
+/* used for the bitmask of struct ebt_entry */
+
+/* This is a hack to make a difference between an ebt_entry struct and an
+ * ebt_entries struct when traversing the entries from start to end.
+ * Using this simplifies the code alot, while still being able to use
+ * ebt_entries.
+ * Contrary, iptables doesn't use something like ebt_entries and therefore uses
+ * different techniques for naming the policy and such. So, iptables doesn't
+ * need a hack like this.
+ */
+#define EBT_ENTRY_OR_ENTRIES 0x01
+/* these are the normal masks */
+#define EBT_NOPROTO 0x02
+#define EBT_802_3 0x04
+#define EBT_SOURCEMAC 0x08
+#define EBT_DESTMAC 0x10
+#define EBT_F_MASK (EBT_NOPROTO | EBT_802_3 | EBT_SOURCEMAC | EBT_DESTMAC \
+ | EBT_ENTRY_OR_ENTRIES)
+
+#define EBT_IPROTO 0x01
+#define EBT_IIN 0x02
+#define EBT_IOUT 0x04
+#define EBT_ISOURCE 0x8
+#define EBT_IDEST 0x10
+#define EBT_ILOGICALIN 0x20
+#define EBT_ILOGICALOUT 0x40
+#define EBT_INV_MASK (EBT_IPROTO | EBT_IIN | EBT_IOUT | EBT_ILOGICALIN \
+ | EBT_ILOGICALOUT | EBT_ISOURCE | EBT_IDEST)
+
+struct ebt_entry_match
+{
+ union {
+ char name[EBT_FUNCTION_MAXNAMELEN];
+ struct xt_match *match;
+ } u;
+ /* size of data */
+ unsigned int match_size;
+ unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
+};
+
+struct ebt_entry_watcher
+{
+ union {
+ char name[EBT_FUNCTION_MAXNAMELEN];
+ struct xt_target *watcher;
+ } u;
+ /* size of data */
+ unsigned int watcher_size;
+ unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
+};
+
+struct ebt_entry_target
+{
+ union {
+ char name[EBT_FUNCTION_MAXNAMELEN];
+ struct xt_target *target;
+ } u;
+ /* size of data */
+ unsigned int target_size;
+ unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
+};
+
+#define EBT_STANDARD_TARGET "standard"
+struct ebt_standard_target
+{
+ struct ebt_entry_target target;
+ int verdict;
+};
+
+/* one entry */
+struct ebt_entry {
+ /* this needs to be the first field */
+ unsigned int bitmask;
+ unsigned int invflags;
+ __be16 ethproto;
+ /* the physical in-dev */
+ char in[IFNAMSIZ];
+ /* the logical in-dev */
+ char logical_in[IFNAMSIZ];
+ /* the physical out-dev */
+ char out[IFNAMSIZ];
+ /* the logical out-dev */
+ char logical_out[IFNAMSIZ];
+ unsigned char sourcemac[ETH_ALEN];
+ unsigned char sourcemsk[ETH_ALEN];
+ unsigned char destmac[ETH_ALEN];
+ unsigned char destmsk[ETH_ALEN];
+ /* sizeof ebt_entry + matches */
+ unsigned int watchers_offset;
+ /* sizeof ebt_entry + matches + watchers */
+ unsigned int target_offset;
+ /* sizeof ebt_entry + matches + watchers + target */
+ unsigned int next_offset;
+ unsigned char elems[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
+};
+
+/* {g,s}etsockopt numbers */
+#define EBT_BASE_CTL 128
+
+#define EBT_SO_SET_ENTRIES (EBT_BASE_CTL)
+#define EBT_SO_SET_COUNTERS (EBT_SO_SET_ENTRIES+1)
+#define EBT_SO_SET_MAX (EBT_SO_SET_COUNTERS+1)
+
+#define EBT_SO_GET_INFO (EBT_BASE_CTL)
+#define EBT_SO_GET_ENTRIES (EBT_SO_GET_INFO+1)
+#define EBT_SO_GET_INIT_INFO (EBT_SO_GET_ENTRIES+1)
+#define EBT_SO_GET_INIT_ENTRIES (EBT_SO_GET_INIT_INFO+1)
+#define EBT_SO_GET_MAX (EBT_SO_GET_INIT_ENTRIES+1)
+
+
+/* blatently stolen from ip_tables.h
+ * fn returns 0 to continue iteration */
+#define EBT_MATCH_ITERATE(e, fn, args...) \
+({ \
+ unsigned int __i; \
+ int __ret = 0; \
+ struct ebt_entry_match *__match; \
+ \
+ for (__i = sizeof(struct ebt_entry); \
+ __i < (e)->watchers_offset; \
+ __i += __match->match_size + \
+ sizeof(struct ebt_entry_match)) { \
+ __match = (void *)(e) + __i; \
+ \
+ __ret = fn(__match , ## args); \
+ if (__ret != 0) \
+ break; \
+ } \
+ if (__ret == 0) { \
+ if (__i != (e)->watchers_offset) \
+ __ret = -EINVAL; \
+ } \
+ __ret; \
+})
+
+#define EBT_WATCHER_ITERATE(e, fn, args...) \
+({ \
+ unsigned int __i; \
+ int __ret = 0; \
+ struct ebt_entry_watcher *__watcher; \
+ \
+ for (__i = e->watchers_offset; \
+ __i < (e)->target_offset; \
+ __i += __watcher->watcher_size + \
+ sizeof(struct ebt_entry_watcher)) { \
+ __watcher = (void *)(e) + __i; \
+ \
+ __ret = fn(__watcher , ## args); \
+ if (__ret != 0) \
+ break; \
+ } \
+ if (__ret == 0) { \
+ if (__i != (e)->target_offset) \
+ __ret = -EINVAL; \
+ } \
+ __ret; \
+})
+
+#define EBT_ENTRY_ITERATE(entries, size, fn, args...) \
+({ \
+ unsigned int __i; \
+ int __ret = 0; \
+ struct ebt_entry *__entry; \
+ \
+ for (__i = 0; __i < (size);) { \
+ __entry = (void *)(entries) + __i; \
+ __ret = fn(__entry , ## args); \
+ if (__ret != 0) \
+ break; \
+ if (__entry->bitmask != 0) \
+ __i += __entry->next_offset; \
+ else \
+ __i += sizeof(struct ebt_entries); \
+ } \
+ if (__ret == 0) { \
+ if (__i != (size)) \
+ __ret = -EINVAL; \
+ } \
+ __ret; \
+})
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_decnet.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_decnet.h
new file mode 100644
index 0000000..ca70c6c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_decnet.h
@@ -0,0 +1,72 @@
+#ifndef __LINUX_DECNET_NETFILTER_H
+#define __LINUX_DECNET_NETFILTER_H
+
+/* DECnet-specific defines for netfilter.
+ * This file (C) Steve Whitehouse 1999 derived from the
+ * ipv4 netfilter header file which is
+ * (C)1998 Rusty Russell -- This code is GPL.
+ */
+
+#include <linux/netfilter.h>
+
+/* only for userspace compatibility */
+/* IP Cache bits. */
+/* Src IP address. */
+#define NFC_DN_SRC 0x0001
+/* Dest IP address. */
+#define NFC_DN_DST 0x0002
+/* Input device. */
+#define NFC_DN_IF_IN 0x0004
+/* Output device. */
+#define NFC_DN_IF_OUT 0x0008
+
+/* DECnet Hooks */
+/* After promisc drops, checksum checks. */
+#define NF_DN_PRE_ROUTING 0
+/* If the packet is destined for this box. */
+#define NF_DN_LOCAL_IN 1
+/* If the packet is destined for another interface. */
+#define NF_DN_FORWARD 2
+/* Packets coming from a local process. */
+#define NF_DN_LOCAL_OUT 3
+/* Packets about to hit the wire. */
+#define NF_DN_POST_ROUTING 4
+/* Input Hello Packets */
+#define NF_DN_HELLO 5
+/* Input Routing Packets */
+#define NF_DN_ROUTE 6
+#define NF_DN_NUMHOOKS 7
+
+enum nf_dn_hook_priorities {
+ NF_DN_PRI_FIRST = INT_MIN,
+ NF_DN_PRI_CONNTRACK = -200,
+ NF_DN_PRI_MANGLE = -150,
+ NF_DN_PRI_NAT_DST = -100,
+ NF_DN_PRI_FILTER = 0,
+ NF_DN_PRI_NAT_SRC = 100,
+ NF_DN_PRI_DNRTMSG = 200,
+ NF_DN_PRI_LAST = INT_MAX,
+};
+
+struct nf_dn_rtmsg {
+ int nfdn_ifindex;
+};
+
+#define NFDN_RTMSG(r) ((unsigned char *)(r) + NLMSG_ALIGN(sizeof(struct nf_dn_rtmsg)))
+
+/* backwards compatibility for userspace */
+#define DNRMG_L1_GROUP 0x01
+#define DNRMG_L2_GROUP 0x02
+
+enum {
+ DNRNG_NLGRP_NONE,
+#define DNRNG_NLGRP_NONE DNRNG_NLGRP_NONE
+ DNRNG_NLGRP_L1,
+#define DNRNG_NLGRP_L1 DNRNG_NLGRP_L1
+ DNRNG_NLGRP_L2,
+#define DNRNG_NLGRP_L2 DNRNG_NLGRP_L2
+ __DNRNG_NLGRP_MAX
+};
+#define DNRNG_NLGRP_MAX (__DNRNG_NLGRP_MAX - 1)
+
+#endif /*__LINUX_DECNET_NETFILTER_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4.h
new file mode 100644
index 0000000..4d7ba3e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4.h
@@ -0,0 +1,75 @@
+#ifndef __LINUX_IP_NETFILTER_H
+#define __LINUX_IP_NETFILTER_H
+
+/* IPv4-specific defines for netfilter.
+ * (C)1998 Rusty Russell -- This code is GPL.
+ */
+
+#include <linux/netfilter.h>
+
+/* only for userspace compatibility */
+/* IP Cache bits. */
+/* Src IP address. */
+#define NFC_IP_SRC 0x0001
+/* Dest IP address. */
+#define NFC_IP_DST 0x0002
+/* Input device. */
+#define NFC_IP_IF_IN 0x0004
+/* Output device. */
+#define NFC_IP_IF_OUT 0x0008
+/* TOS. */
+#define NFC_IP_TOS 0x0010
+/* Protocol. */
+#define NFC_IP_PROTO 0x0020
+/* IP options. */
+#define NFC_IP_OPTIONS 0x0040
+/* Frag & flags. */
+#define NFC_IP_FRAG 0x0080
+
+/* Per-protocol information: only matters if proto match. */
+/* TCP flags. */
+#define NFC_IP_TCPFLAGS 0x0100
+/* Source port. */
+#define NFC_IP_SRC_PT 0x0200
+/* Dest port. */
+#define NFC_IP_DST_PT 0x0400
+/* Something else about the proto */
+#define NFC_IP_PROTO_UNKNOWN 0x2000
+
+/* IP Hooks */
+/* After promisc drops, checksum checks. */
+#define NF_IP_PRE_ROUTING 0
+/* If the packet is destined for this box. */
+#define NF_IP_LOCAL_IN 1
+/* If the packet is destined for another interface. */
+#define NF_IP_FORWARD 2
+/* Packets coming from a local process. */
+#define NF_IP_LOCAL_OUT 3
+/* Packets about to hit the wire. */
+#define NF_IP_POST_ROUTING 4
+#define NF_IP_NUMHOOKS 5
+
+enum nf_ip_hook_priorities {
+ NF_IP_PRI_FIRST = INT_MIN,
+ NF_IP_PRI_CONNTRACK_DEFRAG = -400,
+ NF_IP_PRI_RAW = -300,
+ NF_IP_PRI_SELINUX_FIRST = -225,
+ NF_IP_PRI_CONNTRACK = -200,
+ NF_IP_PRI_MANGLE = -150,
+ NF_IP_PRI_NAT_DST = -100,
+ NF_IP_PRI_FILTER = 0,
+ NF_IP_PRI_SECURITY = 50,
+ NF_IP_PRI_NAT_SRC = 100,
+ NF_IP_PRI_SELINUX_LAST = 225,
+ NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX,
+ NF_IP_PRI_LAST = INT_MAX,
+};
+
+/* Arguments for setsockopt SOL_IP: */
+/* 2.0 firewalling went from 64 through 71 (and +256, +512, etc). */
+/* 2.2 firewalling (+ masq) went from 64 through 76 */
+/* 2.4 firewalling went 64 through 67. */
+#define SO_ORIGINAL_DST 80
+
+
+#endif /*__LINUX_IP_NETFILTER_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/..install.cmd
new file mode 100644
index 0000000..ca329e6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/netfilter_ipv4/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/netfilter_ipv4 /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/netfilter_ipv4 mips ip_queue.h ip_tables.h ipt_CLASSIFY.h ipt_CLUSTERIP.h ipt_CONNMARK.h ipt_DSCP.h ipt_ECN.h ipt_LOG.h ipt_MARK.h ipt_NFQUEUE.h ipt_REJECT.h ipt_SAME.h ipt_TCPMSS.h ipt_TOS.h ipt_TTL.h ipt_ULOG.h ipt_addrtype.h ipt_ah.h ipt_comment.h ipt_connbytes.h ipt_connmark.h ipt_conntrack.h ipt_dccp.h ipt_dscp.h ipt_ecn.h ipt_esp.h ipt_hashlimit.h ipt_helper.h ipt_iprange.h ipt_length.h ipt_limit.h ipt_mac.h ipt_mark.h ipt_multiport.h ipt_owner.h ipt_physdev.h ipt_pkttype.h ipt_policy.h ipt_realm.h ipt_recent.h ipt_sctp.h ipt_state.h ipt_string.h ipt_tcpmss.h ipt_tos.h ipt_ttl.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/netfilter_ipv4 /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/netfilter_ipv4 mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/netfilter_ipv4/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ip_queue.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ip_queue.h
new file mode 100644
index 0000000..f5229b1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ip_queue.h
@@ -0,0 +1,64 @@
+/*
+ * This is a module which is used for queueing IPv4 packets and
+ * communicating with userspace via netlink.
+ *
+ * (C) 2000 James Morris, this code is GPL.
+ */
+#ifndef _IP_QUEUE_H
+#define _IP_QUEUE_H
+
+#include <net/if.h>
+
+/* Messages sent from kernel */
+typedef struct ipq_packet_msg {
+ unsigned long packet_id; /* ID of queued packet */
+ unsigned long mark; /* Netfilter mark value */
+ long timestamp_sec; /* Packet arrival time (seconds) */
+ long timestamp_usec; /* Packet arrvial time (+useconds) */
+ unsigned int hook; /* Netfilter hook we rode in on */
+ char indev_name[IFNAMSIZ]; /* Name of incoming interface */
+ char outdev_name[IFNAMSIZ]; /* Name of outgoing interface */
+ __be16 hw_protocol; /* Hardware protocol (network order) */
+ unsigned short hw_type; /* Hardware type */
+ unsigned char hw_addrlen; /* Hardware address length */
+ unsigned char hw_addr[8]; /* Hardware address */
+ size_t data_len; /* Length of packet data */
+ unsigned char payload[0]; /* Optional packet data */
+} ipq_packet_msg_t;
+
+/* Messages sent from userspace */
+typedef struct ipq_mode_msg {
+ unsigned char value; /* Requested mode */
+ size_t range; /* Optional range of packet requested */
+} ipq_mode_msg_t;
+
+typedef struct ipq_verdict_msg {
+ unsigned int value; /* Verdict to hand to netfilter */
+ unsigned long id; /* Packet ID for this verdict */
+ size_t data_len; /* Length of replacement data */
+ unsigned char payload[0]; /* Optional replacement packet */
+} ipq_verdict_msg_t;
+
+typedef struct ipq_peer_msg {
+ union {
+ ipq_verdict_msg_t verdict;
+ ipq_mode_msg_t mode;
+ } msg;
+} ipq_peer_msg_t;
+
+/* Packet delivery modes */
+enum {
+ IPQ_COPY_NONE, /* Initial mode, packets are dropped */
+ IPQ_COPY_META, /* Copy metadata */
+ IPQ_COPY_PACKET /* Copy metadata + packet (range) */
+};
+#define IPQ_COPY_MAX IPQ_COPY_PACKET
+
+/* Types of messages */
+#define IPQM_BASE 0x10 /* standard netlink messages below this */
+#define IPQM_MODE (IPQM_BASE + 1) /* Mode request from peer */
+#define IPQM_VERDICT (IPQM_BASE + 2) /* Verdict from peer */
+#define IPQM_PACKET (IPQM_BASE + 3) /* Packet from kernel */
+#define IPQM_MAX (IPQM_BASE + 4)
+
+#endif /*_IP_QUEUE_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ip_tables.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ip_tables.h
new file mode 100644
index 0000000..a9f21c9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ip_tables.h
@@ -0,0 +1,236 @@
+/*
+ * 25-Jul-1998 Major changes to allow for ip chain table
+ *
+ * 3-Jan-2000 Named tables to allow packet selection for different uses.
+ */
+
+/*
+ * Format of an IP firewall descriptor
+ *
+ * src, dst, src_mask, dst_mask are always stored in network byte order.
+ * flags are stored in host byte order (of course).
+ * Port numbers are stored in HOST byte order.
+ */
+
+#ifndef _IPTABLES_H
+#define _IPTABLES_H
+
+#include <linux/types.h>
+
+#include <linux/netfilter_ipv4.h>
+
+#include <linux/netfilter/x_tables.h>
+
+#define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
+#define IPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
+#define ipt_match xt_match
+#define ipt_target xt_target
+#define ipt_table xt_table
+#define ipt_get_revision xt_get_revision
+
+/* Yes, Virginia, you have to zero the padding. */
+struct ipt_ip {
+ /* Source and destination IP addr */
+ struct in_addr src, dst;
+ /* Mask for src and dest IP addr */
+ struct in_addr smsk, dmsk;
+ char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
+ unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
+
+ /* Protocol, 0 = ANY */
+ u_int16_t proto;
+
+ /* Flags word */
+ u_int8_t flags;
+ /* Inverse flags */
+ u_int8_t invflags;
+};
+
+#define ipt_entry_match xt_entry_match
+#define ipt_entry_target xt_entry_target
+#define ipt_standard_target xt_standard_target
+
+#define ipt_counters xt_counters
+
+/* Values for "flag" field in struct ipt_ip (general ip structure). */
+#define IPT_F_FRAG 0x01 /* Set if rule is a fragment rule */
+#define IPT_F_GOTO 0x02 /* Set if jump is a goto */
+#define IPT_F_MASK 0x03 /* All possible flag bits mask. */
+
+/* Values for "inv" field in struct ipt_ip. */
+#define IPT_INV_VIA_IN 0x01 /* Invert the sense of IN IFACE. */
+#define IPT_INV_VIA_OUT 0x02 /* Invert the sense of OUT IFACE */
+#define IPT_INV_TOS 0x04 /* Invert the sense of TOS. */
+#define IPT_INV_SRCIP 0x08 /* Invert the sense of SRC IP. */
+#define IPT_INV_DSTIP 0x10 /* Invert the sense of DST OP. */
+#define IPT_INV_FRAG 0x20 /* Invert the sense of FRAG. */
+#define IPT_INV_PROTO XT_INV_PROTO
+#define IPT_INV_MASK 0x7F /* All possible flag bits mask. */
+
+/* This structure defines each of the firewall rules. Consists of 3
+ parts which are 1) general IP header stuff 2) match specific
+ stuff 3) the target to perform if the rule matches */
+struct ipt_entry
+{
+ struct ipt_ip ip;
+
+ /* Mark with fields that we care about. */
+ unsigned int nfcache;
+
+ /* Size of ipt_entry + matches */
+ u_int16_t target_offset;
+ /* Size of ipt_entry + matches + target */
+ u_int16_t next_offset;
+
+ /* Back pointer */
+ unsigned int comefrom;
+
+ /* Packet and byte counters. */
+ struct xt_counters counters;
+
+ /* The matches (if any), then the target. */
+ unsigned char elems[0];
+};
+
+/*
+ * New IP firewall options for [gs]etsockopt at the RAW IP level.
+ * Unlike BSD Linux inherits IP options so you don't have to use a raw
+ * socket for this. Instead we check rights in the calls.
+ *
+ * ATTENTION: check linux/in.h before adding new number here.
+ */
+#define IPT_BASE_CTL 64
+
+#define IPT_SO_SET_REPLACE (IPT_BASE_CTL)
+#define IPT_SO_SET_ADD_COUNTERS (IPT_BASE_CTL + 1)
+#define IPT_SO_SET_MAX IPT_SO_SET_ADD_COUNTERS
+
+#define IPT_SO_GET_INFO (IPT_BASE_CTL)
+#define IPT_SO_GET_ENTRIES (IPT_BASE_CTL + 1)
+#define IPT_SO_GET_REVISION_MATCH (IPT_BASE_CTL + 2)
+#define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3)
+#define IPT_SO_GET_MAX IPT_SO_GET_REVISION_TARGET
+
+#define IPT_CONTINUE XT_CONTINUE
+#define IPT_RETURN XT_RETURN
+
+#include <linux/netfilter/xt_tcpudp.h>
+#define ipt_udp xt_udp
+#define ipt_tcp xt_tcp
+
+#define IPT_TCP_INV_SRCPT XT_TCP_INV_SRCPT
+#define IPT_TCP_INV_DSTPT XT_TCP_INV_DSTPT
+#define IPT_TCP_INV_FLAGS XT_TCP_INV_FLAGS
+#define IPT_TCP_INV_OPTION XT_TCP_INV_OPTION
+#define IPT_TCP_INV_MASK XT_TCP_INV_MASK
+
+#define IPT_UDP_INV_SRCPT XT_UDP_INV_SRCPT
+#define IPT_UDP_INV_DSTPT XT_UDP_INV_DSTPT
+#define IPT_UDP_INV_MASK XT_UDP_INV_MASK
+
+/* ICMP matching stuff */
+struct ipt_icmp
+{
+ u_int8_t type; /* type to match */
+ u_int8_t code[2]; /* range of code */
+ u_int8_t invflags; /* Inverse flags */
+};
+
+/* Values for "inv" field for struct ipt_icmp. */
+#define IPT_ICMP_INV 0x01 /* Invert the sense of type/code test */
+
+/* The argument to IPT_SO_GET_INFO */
+struct ipt_getinfo
+{
+ /* Which table: caller fills this in. */
+ char name[IPT_TABLE_MAXNAMELEN];
+
+ /* Kernel fills these in. */
+ /* Which hook entry points are valid: bitmask */
+ unsigned int valid_hooks;
+
+ /* Hook entry points: one per netfilter hook. */
+ unsigned int hook_entry[NF_INET_NUMHOOKS];
+
+ /* Underflow points. */
+ unsigned int underflow[NF_INET_NUMHOOKS];
+
+ /* Number of entries */
+ unsigned int num_entries;
+
+ /* Size of entries. */
+ unsigned int size;
+};
+
+/* The argument to IPT_SO_SET_REPLACE. */
+struct ipt_replace
+{
+ /* Which table. */
+ char name[IPT_TABLE_MAXNAMELEN];
+
+ /* Which hook entry points are valid: bitmask. You can't
+ change this. */
+ unsigned int valid_hooks;
+
+ /* Number of entries */
+ unsigned int num_entries;
+
+ /* Total size of new entries */
+ unsigned int size;
+
+ /* Hook entry points. */
+ unsigned int hook_entry[NF_INET_NUMHOOKS];
+
+ /* Underflow points. */
+ unsigned int underflow[NF_INET_NUMHOOKS];
+
+ /* Information about old entries: */
+ /* Number of counters (must be equal to current number of entries). */
+ unsigned int num_counters;
+ /* The old entries' counters. */
+ struct xt_counters *counters;
+
+ /* The entries (hang off end: not really an array). */
+ struct ipt_entry entries[0];
+};
+
+/* The argument to IPT_SO_ADD_COUNTERS. */
+#define ipt_counters_info xt_counters_info
+
+/* The argument to IPT_SO_GET_ENTRIES. */
+struct ipt_get_entries
+{
+ /* Which table: user fills this in. */
+ char name[IPT_TABLE_MAXNAMELEN];
+
+ /* User fills this in: total entry size. */
+ unsigned int size;
+
+ /* The entries. */
+ struct ipt_entry entrytable[0];
+};
+
+/* Standard return verdict, or do jump. */
+#define IPT_STANDARD_TARGET XT_STANDARD_TARGET
+/* Error verdict. */
+#define IPT_ERROR_TARGET XT_ERROR_TARGET
+
+/* Helper functions */
+static __inline__ struct ipt_entry_target *
+ipt_get_target(struct ipt_entry *e)
+{
+ return (void *)e + e->target_offset;
+}
+
+/* fn returns 0 to continue iteration */
+#define IPT_MATCH_ITERATE(e, fn, args...) \
+ XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args)
+
+/* fn returns 0 to continue iteration */
+#define IPT_ENTRY_ITERATE(entries, size, fn, args...) \
+ XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args)
+
+/*
+ * Main firewall chains definitions and global var's definitions.
+ */
+#endif /* _IPTABLES_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_CLASSIFY.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_CLASSIFY.h
new file mode 100644
index 0000000..a46d511
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_CLASSIFY.h
@@ -0,0 +1,7 @@
+#ifndef _IPT_CLASSIFY_H
+#define _IPT_CLASSIFY_H
+
+#include <linux/netfilter/xt_CLASSIFY.h>
+#define ipt_classify_target_info xt_classify_target_info
+
+#endif /*_IPT_CLASSIFY_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h
new file mode 100644
index 0000000..e5a3687
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h
@@ -0,0 +1,34 @@
+#ifndef _IPT_CLUSTERIP_H_target
+#define _IPT_CLUSTERIP_H_target
+
+enum clusterip_hashmode {
+ CLUSTERIP_HASHMODE_SIP = 0,
+ CLUSTERIP_HASHMODE_SIP_SPT,
+ CLUSTERIP_HASHMODE_SIP_SPT_DPT,
+};
+
+#define CLUSTERIP_HASHMODE_MAX CLUSTERIP_HASHMODE_SIP_SPT_DPT
+
+#define CLUSTERIP_MAX_NODES 16
+
+#define CLUSTERIP_FLAG_NEW 0x00000001
+
+struct clusterip_config;
+
+struct ipt_clusterip_tgt_info {
+
+ u_int32_t flags;
+
+ /* only relevant for new ones */
+ u_int8_t clustermac[6];
+ u_int16_t num_total_nodes;
+ u_int16_t num_local_nodes;
+ u_int16_t local_nodes[CLUSTERIP_MAX_NODES];
+ u_int32_t hash_mode;
+ u_int32_t hash_initval;
+
+ /* Used internally by the kernel */
+ struct clusterip_config *config;
+};
+
+#endif /*_IPT_CLUSTERIP_H_target*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_CONNMARK.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_CONNMARK.h
new file mode 100644
index 0000000..9ecfee0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_CONNMARK.h
@@ -0,0 +1,19 @@
+#ifndef _IPT_CONNMARK_H_target
+#define _IPT_CONNMARK_H_target
+
+/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com>
+ * by Henrik Nordstrom <hno@marasystems.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+#include <linux/netfilter/xt_CONNMARK.h>
+#define IPT_CONNMARK_SET XT_CONNMARK_SET
+#define IPT_CONNMARK_SAVE XT_CONNMARK_SAVE
+#define IPT_CONNMARK_RESTORE XT_CONNMARK_RESTORE
+
+#define ipt_connmark_target_info xt_connmark_target_info
+
+#endif /*_IPT_CONNMARK_H_target*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_DSCP.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_DSCP.h
new file mode 100644
index 0000000..3491e52
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_DSCP.h
@@ -0,0 +1,18 @@
+/* iptables module for setting the IPv4 DSCP field
+ *
+ * (C) 2002 Harald Welte <laforge@gnumonks.org>
+ * based on ipt_FTOS.c (C) 2000 by Matthew G. Marsh <mgm@paktronix.com>
+ * This software is distributed under GNU GPL v2, 1991
+ *
+ * See RFC2474 for a description of the DSCP field within the IP Header.
+ *
+ * ipt_DSCP.h,v 1.7 2002/03/14 12:03:13 laforge Exp
+*/
+#ifndef _IPT_DSCP_TARGET_H
+#define _IPT_DSCP_TARGET_H
+#include <linux/netfilter_ipv4/ipt_dscp.h>
+#include <linux/netfilter/xt_DSCP.h>
+
+#define ipt_DSCP_info xt_DSCP_info
+
+#endif /* _IPT_DSCP_TARGET_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_ECN.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_ECN.h
new file mode 100644
index 0000000..94e0d98
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_ECN.h
@@ -0,0 +1,31 @@
+/* Header file for iptables ipt_ECN target
+ *
+ * (C) 2002 by Harald Welte <laforge@gnumonks.org>
+ *
+ * This software is distributed under GNU GPL v2, 1991
+ *
+ * ipt_ECN.h,v 1.3 2002/05/29 12:17:40 laforge Exp
+*/
+#ifndef _IPT_ECN_TARGET_H
+#define _IPT_ECN_TARGET_H
+#include <linux/netfilter_ipv4/ipt_DSCP.h>
+
+#define IPT_ECN_IP_MASK (~IPT_DSCP_MASK)
+
+#define IPT_ECN_OP_SET_IP 0x01 /* set ECN bits of IPv4 header */
+#define IPT_ECN_OP_SET_ECE 0x10 /* set ECE bit of TCP header */
+#define IPT_ECN_OP_SET_CWR 0x20 /* set CWR bit of TCP header */
+
+#define IPT_ECN_OP_MASK 0xce
+
+struct ipt_ECN_info {
+ u_int8_t operation; /* bitset of operations */
+ u_int8_t ip_ect; /* ECT codepoint of IPv4 header, pre-shifted */
+ union {
+ struct {
+ u_int8_t ece:1, cwr:1; /* TCP ECT bits */
+ } tcp;
+ } proto;
+};
+
+#endif /* _IPT_ECN_TARGET_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_LOG.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_LOG.h
new file mode 100644
index 0000000..90fa652
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_LOG.h
@@ -0,0 +1,18 @@
+#ifndef _IPT_LOG_H
+#define _IPT_LOG_H
+
+/* make sure not to change this without changing netfilter.h:NF_LOG_* (!) */
+#define IPT_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */
+#define IPT_LOG_TCPOPT 0x02 /* Log TCP options */
+#define IPT_LOG_IPOPT 0x04 /* Log IP options */
+#define IPT_LOG_UID 0x08 /* Log UID owning local socket */
+#define IPT_LOG_NFLOG 0x10 /* Unsupported, don't reuse */
+#define IPT_LOG_MASK 0x1f
+
+struct ipt_log_info {
+ unsigned char level;
+ unsigned char logflags;
+ char prefix[30];
+};
+
+#endif /*_IPT_LOG_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_MARK.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_MARK.h
new file mode 100644
index 0000000..697a486
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_MARK.h
@@ -0,0 +1,18 @@
+#ifndef _IPT_MARK_H_target
+#define _IPT_MARK_H_target
+
+/* Backwards compatibility for old userspace */
+
+#include <linux/netfilter/xt_MARK.h>
+
+/* Version 0 */
+#define ipt_mark_target_info xt_mark_target_info
+
+/* Version 1 */
+#define IPT_MARK_SET XT_MARK_SET
+#define IPT_MARK_AND XT_MARK_AND
+#define IPT_MARK_OR XT_MARK_OR
+
+#define ipt_mark_target_info_v1 xt_mark_target_info_v1
+
+#endif /*_IPT_MARK_H_target*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_NFQUEUE.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_NFQUEUE.h
new file mode 100644
index 0000000..97a2a75
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_NFQUEUE.h
@@ -0,0 +1,16 @@
+/* iptables module for using NFQUEUE mechanism
+ *
+ * (C) 2005 Harald Welte <laforge@netfilter.org>
+ *
+ * This software is distributed under GNU GPL v2, 1991
+ *
+*/
+#ifndef _IPT_NFQ_TARGET_H
+#define _IPT_NFQ_TARGET_H
+
+/* Backwards compatibility for old userspace */
+#include <linux/netfilter/xt_NFQUEUE.h>
+
+#define ipt_NFQ_info xt_NFQ_info
+
+#endif /* _IPT_DSCP_TARGET_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_REJECT.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_REJECT.h
new file mode 100644
index 0000000..4293a1a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_REJECT.h
@@ -0,0 +1,20 @@
+#ifndef _IPT_REJECT_H
+#define _IPT_REJECT_H
+
+enum ipt_reject_with {
+ IPT_ICMP_NET_UNREACHABLE,
+ IPT_ICMP_HOST_UNREACHABLE,
+ IPT_ICMP_PROT_UNREACHABLE,
+ IPT_ICMP_PORT_UNREACHABLE,
+ IPT_ICMP_ECHOREPLY,
+ IPT_ICMP_NET_PROHIBITED,
+ IPT_ICMP_HOST_PROHIBITED,
+ IPT_TCP_RESET,
+ IPT_ICMP_ADMIN_PROHIBITED
+};
+
+struct ipt_reject_info {
+ enum ipt_reject_with with; /* reject type */
+};
+
+#endif /*_IPT_REJECT_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_SAME.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_SAME.h
new file mode 100644
index 0000000..be6e682
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_SAME.h
@@ -0,0 +1,19 @@
+#ifndef _IPT_SAME_H
+#define _IPT_SAME_H
+
+#define IPT_SAME_MAX_RANGE 10
+
+#define IPT_SAME_NODST 0x01
+
+struct ipt_same_info
+{
+ unsigned char info;
+ u_int32_t rangesize;
+ u_int32_t ipnum;
+ u_int32_t *iparray;
+
+ /* hangs off end. */
+ struct nf_nat_range range[IPT_SAME_MAX_RANGE];
+};
+
+#endif /*_IPT_SAME_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_TCPMSS.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_TCPMSS.h
new file mode 100644
index 0000000..7a850f9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_TCPMSS.h
@@ -0,0 +1,9 @@
+#ifndef _IPT_TCPMSS_H
+#define _IPT_TCPMSS_H
+
+#include <linux/netfilter/xt_TCPMSS.h>
+
+#define ipt_tcpmss_info xt_tcpmss_info
+#define IPT_TCPMSS_CLAMP_PMTU XT_TCPMSS_CLAMP_PMTU
+
+#endif /*_IPT_TCPMSS_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_TOS.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_TOS.h
new file mode 100644
index 0000000..6bf9e1f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_TOS.h
@@ -0,0 +1,12 @@
+#ifndef _IPT_TOS_H_target
+#define _IPT_TOS_H_target
+
+#ifndef IPTOS_NORMALSVC
+#define IPTOS_NORMALSVC 0
+#endif
+
+struct ipt_tos_target_info {
+ u_int8_t tos;
+};
+
+#endif /*_IPT_TOS_H_target*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_TTL.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_TTL.h
new file mode 100644
index 0000000..ee6611e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_TTL.h
@@ -0,0 +1,21 @@
+/* TTL modification module for IP tables
+ * (C) 2000 by Harald Welte <laforge@netfilter.org> */
+
+#ifndef _IPT_TTL_H
+#define _IPT_TTL_H
+
+enum {
+ IPT_TTL_SET = 0,
+ IPT_TTL_INC,
+ IPT_TTL_DEC
+};
+
+#define IPT_TTL_MAXMODE IPT_TTL_DEC
+
+struct ipt_TTL_info {
+ u_int8_t mode;
+ u_int8_t ttl;
+};
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_ULOG.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_ULOG.h
new file mode 100644
index 0000000..417aad2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_ULOG.h
@@ -0,0 +1,49 @@
+/* Header file for IP tables userspace logging, Version 1.8
+ *
+ * (C) 2000-2002 by Harald Welte <laforge@gnumonks.org>
+ *
+ * Distributed under the terms of GNU GPL */
+
+#ifndef _IPT_ULOG_H
+#define _IPT_ULOG_H
+
+#ifndef NETLINK_NFLOG
+#define NETLINK_NFLOG 5
+#endif
+
+#define ULOG_DEFAULT_NLGROUP 1
+#define ULOG_DEFAULT_QTHRESHOLD 1
+
+#define ULOG_MAC_LEN 80
+#define ULOG_PREFIX_LEN 32
+
+#define ULOG_MAX_QLEN 50
+/* Why 50? Well... there is a limit imposed by the slab cache 131000
+ * bytes. So the multipart netlink-message has to be < 131000 bytes.
+ * Assuming a standard ethernet-mtu of 1500, we could define this up
+ * to 80... but even 50 seems to be big enough. */
+
+/* private data structure for each rule with a ULOG target */
+struct ipt_ulog_info {
+ unsigned int nl_group;
+ size_t copy_range;
+ size_t qthreshold;
+ char prefix[ULOG_PREFIX_LEN];
+};
+
+/* Format of the ULOG packets passed through netlink */
+typedef struct ulog_packet_msg {
+ unsigned long mark;
+ long timestamp_sec;
+ long timestamp_usec;
+ unsigned int hook;
+ char indev_name[IFNAMSIZ];
+ char outdev_name[IFNAMSIZ];
+ size_t data_len;
+ char prefix[ULOG_PREFIX_LEN];
+ unsigned char mac_len;
+ unsigned char mac[ULOG_MAC_LEN];
+ unsigned char payload[0];
+} ulog_packet_msg_t;
+
+#endif /*_IPT_ULOG_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_addrtype.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_addrtype.h
new file mode 100644
index 0000000..446de6a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_addrtype.h
@@ -0,0 +1,25 @@
+#ifndef _IPT_ADDRTYPE_H
+#define _IPT_ADDRTYPE_H
+
+enum {
+ IPT_ADDRTYPE_INVERT_SOURCE = 0x0001,
+ IPT_ADDRTYPE_INVERT_DEST = 0x0002,
+ IPT_ADDRTYPE_LIMIT_IFACE_IN = 0x0004,
+ IPT_ADDRTYPE_LIMIT_IFACE_OUT = 0x0008,
+};
+
+struct ipt_addrtype_info_v1 {
+ u_int16_t source; /* source-type mask */
+ u_int16_t dest; /* dest-type mask */
+ u_int32_t flags;
+};
+
+/* revision 0 */
+struct ipt_addrtype_info {
+ u_int16_t source; /* source-type mask */
+ u_int16_t dest; /* dest-type mask */
+ u_int32_t invert_source;
+ u_int32_t invert_dest;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_ah.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_ah.h
new file mode 100644
index 0000000..7b9a2ac
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_ah.h
@@ -0,0 +1,16 @@
+#ifndef _IPT_AH_H
+#define _IPT_AH_H
+
+struct ipt_ah
+{
+ u_int32_t spis[2]; /* Security Parameter Index */
+ u_int8_t invflags; /* Inverse flags */
+};
+
+
+
+/* Values for "invflags" field in struct ipt_ah. */
+#define IPT_AH_INV_SPI 0x01 /* Invert the sense of spi. */
+#define IPT_AH_INV_MASK 0x01 /* All possible flags. */
+
+#endif /*_IPT_AH_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_comment.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_comment.h
new file mode 100644
index 0000000..ae2afc2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_comment.h
@@ -0,0 +1,10 @@
+#ifndef _IPT_COMMENT_H
+#define _IPT_COMMENT_H
+
+#include <linux/netfilter/xt_comment.h>
+
+#define IPT_MAX_COMMENT_LEN XT_MAX_COMMENT_LEN
+
+#define ipt_comment_info xt_comment_info
+
+#endif /* _IPT_COMMENT_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_connbytes.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_connbytes.h
new file mode 100644
index 0000000..f63e6ee
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_connbytes.h
@@ -0,0 +1,18 @@
+#ifndef _IPT_CONNBYTES_H
+#define _IPT_CONNBYTES_H
+
+#include <linux/netfilter/xt_connbytes.h>
+#define ipt_connbytes_what xt_connbytes_what
+
+#define IPT_CONNBYTES_PKTS XT_CONNBYTES_PKTS
+#define IPT_CONNBYTES_BYTES XT_CONNBYTES_BYTES
+#define IPT_CONNBYTES_AVGPKT XT_CONNBYTES_AVGPKT
+
+#define ipt_connbytes_direction xt_connbytes_direction
+#define IPT_CONNBYTES_DIR_ORIGINAL XT_CONNBYTES_DIR_ORIGINAL
+#define IPT_CONNBYTES_DIR_REPLY XT_CONNBYTES_DIR_REPLY
+#define IPT_CONNBYTES_DIR_BOTH XT_CONNBYTES_DIR_BOTH
+
+#define ipt_connbytes_info xt_connbytes_info
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_connmark.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_connmark.h
new file mode 100644
index 0000000..c7ba656
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_connmark.h
@@ -0,0 +1,7 @@
+#ifndef _IPT_CONNMARK_H
+#define _IPT_CONNMARK_H
+
+#include <linux/netfilter/xt_connmark.h>
+#define ipt_connmark_info xt_connmark_info
+
+#endif /*_IPT_CONNMARK_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_conntrack.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_conntrack.h
new file mode 100644
index 0000000..cde6762
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_conntrack.h
@@ -0,0 +1,28 @@
+/* Header file for kernel module to match connection tracking information.
+ * GPL (C) 2001 Marc Boucher (marc@mbsi.ca).
+ */
+
+#ifndef _IPT_CONNTRACK_H
+#define _IPT_CONNTRACK_H
+
+#include <linux/netfilter/xt_conntrack.h>
+
+#define IPT_CONNTRACK_STATE_BIT(ctinfo) XT_CONNTRACK_STATE_BIT(ctinfo)
+#define IPT_CONNTRACK_STATE_INVALID XT_CONNTRACK_STATE_INVALID
+
+#define IPT_CONNTRACK_STATE_SNAT XT_CONNTRACK_STATE_SNAT
+#define IPT_CONNTRACK_STATE_DNAT XT_CONNTRACK_STATE_DNAT
+#define IPT_CONNTRACK_STATE_UNTRACKED XT_CONNTRACK_STATE_UNTRACKED
+
+/* flags, invflags: */
+#define IPT_CONNTRACK_STATE XT_CONNTRACK_STATE
+#define IPT_CONNTRACK_PROTO XT_CONNTRACK_PROTO
+#define IPT_CONNTRACK_ORIGSRC XT_CONNTRACK_ORIGSRC
+#define IPT_CONNTRACK_ORIGDST XT_CONNTRACK_ORIGDST
+#define IPT_CONNTRACK_REPLSRC XT_CONNTRACK_REPLSRC
+#define IPT_CONNTRACK_REPLDST XT_CONNTRACK_REPLDST
+#define IPT_CONNTRACK_STATUS XT_CONNTRACK_STATUS
+#define IPT_CONNTRACK_EXPIRES XT_CONNTRACK_EXPIRES
+
+#define ipt_conntrack_info xt_conntrack_info
+#endif /*_IPT_CONNTRACK_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_dccp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_dccp.h
new file mode 100644
index 0000000..e70d11e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_dccp.h
@@ -0,0 +1,15 @@
+#ifndef _IPT_DCCP_H_
+#define _IPT_DCCP_H_
+
+#include <linux/netfilter/xt_dccp.h>
+#define IPT_DCCP_SRC_PORTS XT_DCCP_SRC_PORTS
+#define IPT_DCCP_DEST_PORTS XT_DCCP_DEST_PORTS
+#define IPT_DCCP_TYPE XT_DCCP_TYPE
+#define IPT_DCCP_OPTION XT_DCCP_OPTION
+
+#define IPT_DCCP_VALID_FLAGS XT_DCCP_VALID_FLAGS
+
+#define ipt_dccp_info xt_dccp_info
+
+#endif /* _IPT_DCCP_H_ */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_dscp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_dscp.h
new file mode 100644
index 0000000..4b82ca9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_dscp.h
@@ -0,0 +1,21 @@
+/* iptables module for matching the IPv4 DSCP field
+ *
+ * (C) 2002 Harald Welte <laforge@gnumonks.org>
+ * This software is distributed under GNU GPL v2, 1991
+ *
+ * See RFC2474 for a description of the DSCP field within the IP Header.
+ *
+ * ipt_dscp.h,v 1.3 2002/08/05 19:00:21 laforge Exp
+*/
+#ifndef _IPT_DSCP_H
+#define _IPT_DSCP_H
+
+#include <linux/netfilter/xt_dscp.h>
+
+#define IPT_DSCP_MASK XT_DSCP_MASK
+#define IPT_DSCP_SHIFT XT_DSCP_SHIFT
+#define IPT_DSCP_MAX XT_DSCP_MAX
+
+#define ipt_dscp_info xt_dscp_info
+
+#endif /* _IPT_DSCP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_ecn.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_ecn.h
new file mode 100644
index 0000000..1f0d9a4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_ecn.h
@@ -0,0 +1,33 @@
+/* iptables module for matching the ECN header in IPv4 and TCP header
+ *
+ * (C) 2002 Harald Welte <laforge@gnumonks.org>
+ *
+ * This software is distributed under GNU GPL v2, 1991
+ *
+ * ipt_ecn.h,v 1.4 2002/08/05 19:39:00 laforge Exp
+*/
+#ifndef _IPT_ECN_H
+#define _IPT_ECN_H
+#include <linux/netfilter_ipv4/ipt_dscp.h>
+
+#define IPT_ECN_IP_MASK (~IPT_DSCP_MASK)
+
+#define IPT_ECN_OP_MATCH_IP 0x01
+#define IPT_ECN_OP_MATCH_ECE 0x10
+#define IPT_ECN_OP_MATCH_CWR 0x20
+
+#define IPT_ECN_OP_MATCH_MASK 0xce
+
+/* match info */
+struct ipt_ecn_info {
+ u_int8_t operation;
+ u_int8_t invert;
+ u_int8_t ip_ect;
+ union {
+ struct {
+ u_int8_t ect;
+ } tcp;
+ } proto;
+};
+
+#endif /* _IPT_ECN_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_esp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_esp.h
new file mode 100644
index 0000000..78296e7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_esp.h
@@ -0,0 +1,10 @@
+#ifndef _IPT_ESP_H
+#define _IPT_ESP_H
+
+#include <linux/netfilter/xt_esp.h>
+
+#define ipt_esp xt_esp
+#define IPT_ESP_INV_SPI XT_ESP_INV_SPI
+#define IPT_ESP_INV_MASK XT_ESP_INV_MASK
+
+#endif /*_IPT_ESP_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_hashlimit.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_hashlimit.h
new file mode 100644
index 0000000..5662120
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_hashlimit.h
@@ -0,0 +1,14 @@
+#ifndef _IPT_HASHLIMIT_H
+#define _IPT_HASHLIMIT_H
+
+#include <linux/netfilter/xt_hashlimit.h>
+
+#define IPT_HASHLIMIT_SCALE XT_HASHLIMIT_SCALE
+#define IPT_HASHLIMIT_HASH_DIP XT_HASHLIMIT_HASH_DIP
+#define IPT_HASHLIMIT_HASH_DPT XT_HASHLIMIT_HASH_DPT
+#define IPT_HASHLIMIT_HASH_SIP XT_HASHLIMIT_HASH_SIP
+#define IPT_HASHLIMIT_HASH_SPT XT_HASHLIMIT_HASH_SPT
+
+#define ipt_hashlimit_info xt_hashlimit_info
+
+#endif /* _IPT_HASHLIMIT_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_helper.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_helper.h
new file mode 100644
index 0000000..80452c2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_helper.h
@@ -0,0 +1,7 @@
+#ifndef _IPT_HELPER_H
+#define _IPT_HELPER_H
+
+#include <linux/netfilter/xt_helper.h>
+#define ipt_helper_info xt_helper_info
+
+#endif /* _IPT_HELPER_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_iprange.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_iprange.h
new file mode 100644
index 0000000..5f1aebd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_iprange.h
@@ -0,0 +1,21 @@
+#ifndef _IPT_IPRANGE_H
+#define _IPT_IPRANGE_H
+
+#include <linux/types.h>
+#include <linux/netfilter/xt_iprange.h>
+
+struct ipt_iprange {
+ /* Inclusive: network order. */
+ __be32 min_ip, max_ip;
+};
+
+struct ipt_iprange_info
+{
+ struct ipt_iprange src;
+ struct ipt_iprange dst;
+
+ /* Flags from above */
+ u_int8_t flags;
+};
+
+#endif /* _IPT_IPRANGE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_length.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_length.h
new file mode 100644
index 0000000..9b45206
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_length.h
@@ -0,0 +1,7 @@
+#ifndef _IPT_LENGTH_H
+#define _IPT_LENGTH_H
+
+#include <linux/netfilter/xt_length.h>
+#define ipt_length_info xt_length_info
+
+#endif /*_IPT_LENGTH_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_limit.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_limit.h
new file mode 100644
index 0000000..92f5cd0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_limit.h
@@ -0,0 +1,8 @@
+#ifndef _IPT_RATE_H
+#define _IPT_RATE_H
+
+#include <linux/netfilter/xt_limit.h>
+#define IPT_LIMIT_SCALE XT_LIMIT_SCALE
+#define ipt_rateinfo xt_rateinfo
+
+#endif /*_IPT_RATE_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_mac.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_mac.h
new file mode 100644
index 0000000..b186008
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_mac.h
@@ -0,0 +1,7 @@
+#ifndef _IPT_MAC_H
+#define _IPT_MAC_H
+
+#include <linux/netfilter/xt_mac.h>
+#define ipt_mac_info xt_mac_info
+
+#endif /*_IPT_MAC_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_mark.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_mark.h
new file mode 100644
index 0000000..bfde67c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_mark.h
@@ -0,0 +1,9 @@
+#ifndef _IPT_MARK_H
+#define _IPT_MARK_H
+
+/* Backwards compatibility for old userspace */
+#include <linux/netfilter/xt_mark.h>
+
+#define ipt_mark_info xt_mark_info
+
+#endif /*_IPT_MARK_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_multiport.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_multiport.h
new file mode 100644
index 0000000..55fe85e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_multiport.h
@@ -0,0 +1,15 @@
+#ifndef _IPT_MULTIPORT_H
+#define _IPT_MULTIPORT_H
+
+#include <linux/netfilter/xt_multiport.h>
+
+#define IPT_MULTIPORT_SOURCE XT_MULTIPORT_SOURCE
+#define IPT_MULTIPORT_DESTINATION XT_MULTIPORT_DESTINATION
+#define IPT_MULTIPORT_EITHER XT_MULTIPORT_EITHER
+
+#define IPT_MULTI_PORTS XT_MULTI_PORTS
+
+#define ipt_multiport xt_multiport
+#define ipt_multiport_v1 xt_multiport_v1
+
+#endif /*_IPT_MULTIPORT_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_owner.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_owner.h
new file mode 100644
index 0000000..a78445b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_owner.h
@@ -0,0 +1,20 @@
+#ifndef _IPT_OWNER_H
+#define _IPT_OWNER_H
+
+/* match and invert flags */
+#define IPT_OWNER_UID 0x01
+#define IPT_OWNER_GID 0x02
+#define IPT_OWNER_PID 0x04
+#define IPT_OWNER_SID 0x08
+#define IPT_OWNER_COMM 0x10
+
+struct ipt_owner_info {
+ __kernel_uid32_t uid;
+ __kernel_gid32_t gid;
+ __kernel_pid_t pid;
+ __kernel_pid_t sid;
+ char comm[16];
+ u_int8_t match, invert; /* flags */
+};
+
+#endif /*_IPT_OWNER_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_physdev.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_physdev.h
new file mode 100644
index 0000000..2400e71
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_physdev.h
@@ -0,0 +1,17 @@
+#ifndef _IPT_PHYSDEV_H
+#define _IPT_PHYSDEV_H
+
+/* Backwards compatibility for old userspace */
+
+#include <linux/netfilter/xt_physdev.h>
+
+#define IPT_PHYSDEV_OP_IN XT_PHYSDEV_OP_IN
+#define IPT_PHYSDEV_OP_OUT XT_PHYSDEV_OP_OUT
+#define IPT_PHYSDEV_OP_BRIDGED XT_PHYSDEV_OP_BRIDGED
+#define IPT_PHYSDEV_OP_ISIN XT_PHYSDEV_OP_ISIN
+#define IPT_PHYSDEV_OP_ISOUT XT_PHYSDEV_OP_ISOUT
+#define IPT_PHYSDEV_OP_MASK XT_PHYSDEV_OP_MASK
+
+#define ipt_physdev_info xt_physdev_info
+
+#endif /*_IPT_PHYSDEV_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_pkttype.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_pkttype.h
new file mode 100644
index 0000000..ff1fbc9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_pkttype.h
@@ -0,0 +1,7 @@
+#ifndef _IPT_PKTTYPE_H
+#define _IPT_PKTTYPE_H
+
+#include <linux/netfilter/xt_pkttype.h>
+#define ipt_pkttype_info xt_pkttype_info
+
+#endif /*_IPT_PKTTYPE_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_policy.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_policy.h
new file mode 100644
index 0000000..1037fb2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_policy.h
@@ -0,0 +1,23 @@
+#ifndef _IPT_POLICY_H
+#define _IPT_POLICY_H
+
+#include <linux/netfilter/xt_policy.h>
+
+#define IPT_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM
+
+/* ipt_policy_flags */
+#define IPT_POLICY_MATCH_IN XT_POLICY_MATCH_IN
+#define IPT_POLICY_MATCH_OUT XT_POLICY_MATCH_OUT
+#define IPT_POLICY_MATCH_NONE XT_POLICY_MATCH_NONE
+#define IPT_POLICY_MATCH_STRICT XT_POLICY_MATCH_STRICT
+
+/* ipt_policy_modes */
+#define IPT_POLICY_MODE_TRANSPORT XT_POLICY_MODE_TRANSPORT
+#define IPT_POLICY_MODE_TUNNEL XT_POLICY_MODE_TUNNEL
+
+#define ipt_policy_spec xt_policy_spec
+#define ipt_policy_addr xt_policy_addr
+#define ipt_policy_elem xt_policy_elem
+#define ipt_policy_info xt_policy_info
+
+#endif /* _IPT_POLICY_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_realm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_realm.h
new file mode 100644
index 0000000..b3996ea
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_realm.h
@@ -0,0 +1,7 @@
+#ifndef _IPT_REALM_H
+#define _IPT_REALM_H
+
+#include <linux/netfilter/xt_realm.h>
+#define ipt_realm_info xt_realm_info
+
+#endif /* _IPT_REALM_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_recent.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_recent.h
new file mode 100644
index 0000000..d636cca
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_recent.h
@@ -0,0 +1,21 @@
+#ifndef _IPT_RECENT_H
+#define _IPT_RECENT_H
+
+#include <linux/netfilter/xt_recent.h>
+
+#define ipt_recent_info xt_recent_mtinfo
+
+enum {
+ IPT_RECENT_CHECK = XT_RECENT_CHECK,
+ IPT_RECENT_SET = XT_RECENT_SET,
+ IPT_RECENT_UPDATE = XT_RECENT_UPDATE,
+ IPT_RECENT_REMOVE = XT_RECENT_REMOVE,
+ IPT_RECENT_TTL = XT_RECENT_TTL,
+
+ IPT_RECENT_SOURCE = XT_RECENT_SOURCE,
+ IPT_RECENT_DEST = XT_RECENT_DEST,
+
+ IPT_RECENT_NAME_LEN = XT_RECENT_NAME_LEN,
+};
+
+#endif /*_IPT_RECENT_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_sctp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_sctp.h
new file mode 100644
index 0000000..80b3dba
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_sctp.h
@@ -0,0 +1,105 @@
+#ifndef _IPT_SCTP_H_
+#define _IPT_SCTP_H_
+
+#define IPT_SCTP_SRC_PORTS 0x01
+#define IPT_SCTP_DEST_PORTS 0x02
+#define IPT_SCTP_CHUNK_TYPES 0x04
+
+#define IPT_SCTP_VALID_FLAGS 0x07
+
+
+struct ipt_sctp_flag_info {
+ u_int8_t chunktype;
+ u_int8_t flag;
+ u_int8_t flag_mask;
+};
+
+#define IPT_NUM_SCTP_FLAGS 4
+
+struct ipt_sctp_info {
+ u_int16_t dpts[2]; /* Min, Max */
+ u_int16_t spts[2]; /* Min, Max */
+
+ u_int32_t chunkmap[256 / sizeof (u_int32_t)]; /* Bit mask of chunks to be matched according to RFC 2960 */
+
+#define SCTP_CHUNK_MATCH_ANY 0x01 /* Match if any of the chunk types are present */
+#define SCTP_CHUNK_MATCH_ALL 0x02 /* Match if all of the chunk types are present */
+#define SCTP_CHUNK_MATCH_ONLY 0x04 /* Match if these are the only chunk types present */
+
+ u_int32_t chunk_match_type;
+ struct ipt_sctp_flag_info flag_info[IPT_NUM_SCTP_FLAGS];
+ int flag_count;
+
+ u_int32_t flags;
+ u_int32_t invflags;
+};
+
+#define bytes(type) (sizeof(type) * 8)
+
+#define SCTP_CHUNKMAP_SET(chunkmap, type) \
+ do { \
+ chunkmap[type / bytes(u_int32_t)] |= \
+ 1 << (type % bytes(u_int32_t)); \
+ } while (0)
+
+#define SCTP_CHUNKMAP_CLEAR(chunkmap, type) \
+ do { \
+ chunkmap[type / bytes(u_int32_t)] &= \
+ ~(1 << (type % bytes(u_int32_t))); \
+ } while (0)
+
+#define SCTP_CHUNKMAP_IS_SET(chunkmap, type) \
+({ \
+ (chunkmap[type / bytes (u_int32_t)] & \
+ (1 << (type % bytes (u_int32_t)))) ? 1: 0; \
+})
+
+#define SCTP_CHUNKMAP_RESET(chunkmap) \
+ do { \
+ int i; \
+ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
+ chunkmap[i] = 0; \
+ } while (0)
+
+#define SCTP_CHUNKMAP_SET_ALL(chunkmap) \
+ do { \
+ int i; \
+ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
+ chunkmap[i] = ~0; \
+ } while (0)
+
+#define SCTP_CHUNKMAP_COPY(destmap, srcmap) \
+ do { \
+ int i; \
+ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
+ destmap[i] = srcmap[i]; \
+ } while (0)
+
+#define SCTP_CHUNKMAP_IS_CLEAR(chunkmap) \
+({ \
+ int i; \
+ int flag = 1; \
+ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \
+ if (chunkmap[i]) { \
+ flag = 0; \
+ break; \
+ } \
+ } \
+ flag; \
+})
+
+#define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap) \
+({ \
+ int i; \
+ int flag = 1; \
+ for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \
+ if (chunkmap[i] != ~0) { \
+ flag = 0; \
+ break; \
+ } \
+ } \
+ flag; \
+})
+
+#endif /* _IPT_SCTP_H_ */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_state.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_state.h
new file mode 100644
index 0000000..a44a99c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_state.h
@@ -0,0 +1,15 @@
+#ifndef _IPT_STATE_H
+#define _IPT_STATE_H
+
+/* Backwards compatibility for old userspace */
+
+#include <linux/netfilter/xt_state.h>
+
+#define IPT_STATE_BIT XT_STATE_BIT
+#define IPT_STATE_INVALID XT_STATE_INVALID
+
+#define IPT_STATE_UNTRACKED XT_STATE_UNTRACKED
+
+#define ipt_state_info xt_state_info
+
+#endif /*_IPT_STATE_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_string.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_string.h
new file mode 100644
index 0000000..c26de30
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_string.h
@@ -0,0 +1,10 @@
+#ifndef _IPT_STRING_H
+#define _IPT_STRING_H
+
+#include <linux/netfilter/xt_string.h>
+
+#define IPT_STRING_MAX_PATTERN_SIZE XT_STRING_MAX_PATTERN_SIZE
+#define IPT_STRING_MAX_ALGO_NAME_SIZE XT_STRING_MAX_ALGO_NAME_SIZE
+#define ipt_string_info xt_string_info
+
+#endif /*_IPT_STRING_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_tcpmss.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_tcpmss.h
new file mode 100644
index 0000000..18bbc8e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_tcpmss.h
@@ -0,0 +1,7 @@
+#ifndef _IPT_TCPMSS_MATCH_H
+#define _IPT_TCPMSS_MATCH_H
+
+#include <linux/netfilter/xt_tcpmss.h>
+#define ipt_tcpmss_match_info xt_tcpmss_match_info
+
+#endif /*_IPT_TCPMSS_MATCH_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_tos.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_tos.h
new file mode 100644
index 0000000..a21f5df
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_tos.h
@@ -0,0 +1,13 @@
+#ifndef _IPT_TOS_H
+#define _IPT_TOS_H
+
+struct ipt_tos_info {
+ u_int8_t tos;
+ u_int8_t invert;
+};
+
+#ifndef IPTOS_NORMALSVC
+#define IPTOS_NORMALSVC 0
+#endif
+
+#endif /*_IPT_TOS_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_ttl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_ttl.h
new file mode 100644
index 0000000..ee24fd8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv4/ipt_ttl.h
@@ -0,0 +1,21 @@
+/* IP tables module for matching the value of the TTL
+ * (C) 2000 by Harald Welte <laforge@gnumonks.org> */
+
+#ifndef _IPT_TTL_H
+#define _IPT_TTL_H
+
+enum {
+ IPT_TTL_EQ = 0, /* equals */
+ IPT_TTL_NE, /* not equals */
+ IPT_TTL_LT, /* less than */
+ IPT_TTL_GT, /* greater than */
+};
+
+
+struct ipt_ttl_info {
+ u_int8_t mode;
+ u_int8_t ttl;
+};
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6.h
new file mode 100644
index 0000000..7430b39
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6.h
@@ -0,0 +1,72 @@
+#ifndef __LINUX_IP6_NETFILTER_H
+#define __LINUX_IP6_NETFILTER_H
+
+/* IPv6-specific defines for netfilter.
+ * (C)1998 Rusty Russell -- This code is GPL.
+ * (C)1999 David Jeffery
+ * this header was blatantly ripped from netfilter_ipv4.h
+ * it's amazing what adding a bunch of 6s can do =8^)
+ */
+
+#include <linux/netfilter.h>
+
+/* only for userspace compatibility */
+/* IP Cache bits. */
+/* Src IP address. */
+#define NFC_IP6_SRC 0x0001
+/* Dest IP address. */
+#define NFC_IP6_DST 0x0002
+/* Input device. */
+#define NFC_IP6_IF_IN 0x0004
+/* Output device. */
+#define NFC_IP6_IF_OUT 0x0008
+/* TOS. */
+#define NFC_IP6_TOS 0x0010
+/* Protocol. */
+#define NFC_IP6_PROTO 0x0020
+/* IP options. */
+#define NFC_IP6_OPTIONS 0x0040
+/* Frag & flags. */
+#define NFC_IP6_FRAG 0x0080
+
+
+/* Per-protocol information: only matters if proto match. */
+/* TCP flags. */
+#define NFC_IP6_TCPFLAGS 0x0100
+/* Source port. */
+#define NFC_IP6_SRC_PT 0x0200
+/* Dest port. */
+#define NFC_IP6_DST_PT 0x0400
+/* Something else about the proto */
+#define NFC_IP6_PROTO_UNKNOWN 0x2000
+
+/* IP6 Hooks */
+/* After promisc drops, checksum checks. */
+#define NF_IP6_PRE_ROUTING 0
+/* If the packet is destined for this box. */
+#define NF_IP6_LOCAL_IN 1
+/* If the packet is destined for another interface. */
+#define NF_IP6_FORWARD 2
+/* Packets coming from a local process. */
+#define NF_IP6_LOCAL_OUT 3
+/* Packets about to hit the wire. */
+#define NF_IP6_POST_ROUTING 4
+#define NF_IP6_NUMHOOKS 5
+
+
+enum nf_ip6_hook_priorities {
+ NF_IP6_PRI_FIRST = INT_MIN,
+ NF_IP6_PRI_CONNTRACK_DEFRAG = -400,
+ NF_IP6_PRI_SELINUX_FIRST = -225,
+ NF_IP6_PRI_CONNTRACK = -200,
+ NF_IP6_PRI_MANGLE = -150,
+ NF_IP6_PRI_NAT_DST = -100,
+ NF_IP6_PRI_FILTER = 0,
+ NF_IP6_PRI_SECURITY = 50,
+ NF_IP6_PRI_NAT_SRC = 100,
+ NF_IP6_PRI_SELINUX_LAST = 225,
+ NF_IP6_PRI_LAST = INT_MAX,
+};
+
+
+#endif /*__LINUX_IP6_NETFILTER_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/..install.cmd
new file mode 100644
index 0000000..4be891d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/netfilter_ipv6/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/netfilter_ipv6 /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/netfilter_ipv6 mips ip6_tables.h ip6t_HL.h ip6t_LOG.h ip6t_MARK.h ip6t_REJECT.h ip6t_ah.h ip6t_esp.h ip6t_frag.h ip6t_hl.h ip6t_ipv6header.h ip6t_length.h ip6t_limit.h ip6t_mac.h ip6t_mark.h ip6t_mh.h ip6t_multiport.h ip6t_opts.h ip6t_owner.h ip6t_physdev.h ip6t_policy.h ip6t_rt.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/netfilter_ipv6 /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/netfilter_ipv6 mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/netfilter_ipv6/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6_tables.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6_tables.h
new file mode 100644
index 0000000..70ed8a1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6_tables.h
@@ -0,0 +1,297 @@
+/*
+ * 25-Jul-1998 Major changes to allow for ip chain table
+ *
+ * 3-Jan-2000 Named tables to allow packet selection for different uses.
+ */
+
+/*
+ * Format of an IP6 firewall descriptor
+ *
+ * src, dst, src_mask, dst_mask are always stored in network byte order.
+ * flags are stored in host byte order (of course).
+ * Port numbers are stored in HOST byte order.
+ */
+
+#ifndef _IP6_TABLES_H
+#define _IP6_TABLES_H
+
+#include <linux/types.h>
+
+#include <linux/netfilter_ipv6.h>
+
+#include <linux/netfilter/x_tables.h>
+
+#define IP6T_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
+#define IP6T_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
+
+#define ip6t_match xt_match
+#define ip6t_target xt_target
+#define ip6t_table xt_table
+#define ip6t_get_revision xt_get_revision
+
+/* Yes, Virginia, you have to zero the padding. */
+struct ip6t_ip6 {
+ /* Source and destination IP6 addr */
+ struct in6_addr src, dst;
+ /* Mask for src and dest IP6 addr */
+ struct in6_addr smsk, dmsk;
+ char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
+ unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
+
+ /* Upper protocol number
+ * - The allowed value is 0 (any) or protocol number of last parsable
+ * header, which is 50 (ESP), 59 (No Next Header), 135 (MH), or
+ * the non IPv6 extension headers.
+ * - The protocol numbers of IPv6 extension headers except of ESP and
+ * MH do not match any packets.
+ * - You also need to set IP6T_FLAGS_PROTO to "flags" to check protocol.
+ */
+ u_int16_t proto;
+ /* TOS to match iff flags & IP6T_F_TOS */
+ u_int8_t tos;
+
+ /* Flags word */
+ u_int8_t flags;
+ /* Inverse flags */
+ u_int8_t invflags;
+};
+
+#define ip6t_entry_match xt_entry_match
+#define ip6t_entry_target xt_entry_target
+#define ip6t_standard_target xt_standard_target
+
+#define ip6t_counters xt_counters
+
+/* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */
+#define IP6T_F_PROTO 0x01 /* Set if rule cares about upper
+ protocols */
+#define IP6T_F_TOS 0x02 /* Match the TOS. */
+#define IP6T_F_GOTO 0x04 /* Set if jump is a goto */
+#define IP6T_F_MASK 0x07 /* All possible flag bits mask. */
+
+/* Values for "inv" field in struct ip6t_ip6. */
+#define IP6T_INV_VIA_IN 0x01 /* Invert the sense of IN IFACE. */
+#define IP6T_INV_VIA_OUT 0x02 /* Invert the sense of OUT IFACE */
+#define IP6T_INV_TOS 0x04 /* Invert the sense of TOS. */
+#define IP6T_INV_SRCIP 0x08 /* Invert the sense of SRC IP. */
+#define IP6T_INV_DSTIP 0x10 /* Invert the sense of DST OP. */
+#define IP6T_INV_FRAG 0x20 /* Invert the sense of FRAG. */
+#define IP6T_INV_PROTO XT_INV_PROTO
+#define IP6T_INV_MASK 0x7F /* All possible flag bits mask. */
+
+/* This structure defines each of the firewall rules. Consists of 3
+ parts which are 1) general IP header stuff 2) match specific
+ stuff 3) the target to perform if the rule matches */
+struct ip6t_entry
+{
+ struct ip6t_ip6 ipv6;
+
+ /* Mark with fields that we care about. */
+ unsigned int nfcache;
+
+ /* Size of ipt_entry + matches */
+ u_int16_t target_offset;
+ /* Size of ipt_entry + matches + target */
+ u_int16_t next_offset;
+
+ /* Back pointer */
+ unsigned int comefrom;
+
+ /* Packet and byte counters. */
+ struct xt_counters counters;
+
+ /* The matches (if any), then the target. */
+ unsigned char elems[0];
+};
+
+/* Standard entry */
+struct ip6t_standard
+{
+ struct ip6t_entry entry;
+ struct ip6t_standard_target target;
+};
+
+struct ip6t_error_target
+{
+ struct ip6t_entry_target target;
+ char errorname[IP6T_FUNCTION_MAXNAMELEN];
+};
+
+struct ip6t_error
+{
+ struct ip6t_entry entry;
+ struct ip6t_error_target target;
+};
+
+#define IP6T_ENTRY_INIT(__size) \
+{ \
+ .target_offset = sizeof(struct ip6t_entry), \
+ .next_offset = (__size), \
+}
+
+#define IP6T_STANDARD_INIT(__verdict) \
+{ \
+ .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_standard)), \
+ .target = XT_TARGET_INIT(IP6T_STANDARD_TARGET, \
+ sizeof(struct ip6t_standard_target)), \
+ .target.verdict = -(__verdict) - 1, \
+}
+
+#define IP6T_ERROR_INIT \
+{ \
+ .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_error)), \
+ .target = XT_TARGET_INIT(IP6T_ERROR_TARGET, \
+ sizeof(struct ip6t_error_target)), \
+ .target.errorname = "ERROR", \
+}
+
+/*
+ * New IP firewall options for [gs]etsockopt at the RAW IP level.
+ * Unlike BSD Linux inherits IP options so you don't have to use
+ * a raw socket for this. Instead we check rights in the calls.
+ *
+ * ATTENTION: check linux/in6.h before adding new number here.
+ */
+#define IP6T_BASE_CTL 64
+
+#define IP6T_SO_SET_REPLACE (IP6T_BASE_CTL)
+#define IP6T_SO_SET_ADD_COUNTERS (IP6T_BASE_CTL + 1)
+#define IP6T_SO_SET_MAX IP6T_SO_SET_ADD_COUNTERS
+
+#define IP6T_SO_GET_INFO (IP6T_BASE_CTL)
+#define IP6T_SO_GET_ENTRIES (IP6T_BASE_CTL + 1)
+#define IP6T_SO_GET_REVISION_MATCH (IP6T_BASE_CTL + 4)
+#define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5)
+#define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET
+
+/* CONTINUE verdict for targets */
+#define IP6T_CONTINUE XT_CONTINUE
+
+/* For standard target */
+#define IP6T_RETURN XT_RETURN
+
+/* TCP/UDP matching stuff */
+#include <linux/netfilter/xt_tcpudp.h>
+
+#define ip6t_tcp xt_tcp
+#define ip6t_udp xt_udp
+
+/* Values for "inv" field in struct ipt_tcp. */
+#define IP6T_TCP_INV_SRCPT XT_TCP_INV_SRCPT
+#define IP6T_TCP_INV_DSTPT XT_TCP_INV_DSTPT
+#define IP6T_TCP_INV_FLAGS XT_TCP_INV_FLAGS
+#define IP6T_TCP_INV_OPTION XT_TCP_INV_OPTION
+#define IP6T_TCP_INV_MASK XT_TCP_INV_MASK
+
+/* Values for "invflags" field in struct ipt_udp. */
+#define IP6T_UDP_INV_SRCPT XT_UDP_INV_SRCPT
+#define IP6T_UDP_INV_DSTPT XT_UDP_INV_DSTPT
+#define IP6T_UDP_INV_MASK XT_UDP_INV_MASK
+
+/* ICMP matching stuff */
+struct ip6t_icmp
+{
+ u_int8_t type; /* type to match */
+ u_int8_t code[2]; /* range of code */
+ u_int8_t invflags; /* Inverse flags */
+};
+
+/* Values for "inv" field for struct ipt_icmp. */
+#define IP6T_ICMP_INV 0x01 /* Invert the sense of type/code test */
+
+/* The argument to IP6T_SO_GET_INFO */
+struct ip6t_getinfo
+{
+ /* Which table: caller fills this in. */
+ char name[IP6T_TABLE_MAXNAMELEN];
+
+ /* Kernel fills these in. */
+ /* Which hook entry points are valid: bitmask */
+ unsigned int valid_hooks;
+
+ /* Hook entry points: one per netfilter hook. */
+ unsigned int hook_entry[NF_INET_NUMHOOKS];
+
+ /* Underflow points. */
+ unsigned int underflow[NF_INET_NUMHOOKS];
+
+ /* Number of entries */
+ unsigned int num_entries;
+
+ /* Size of entries. */
+ unsigned int size;
+};
+
+/* The argument to IP6T_SO_SET_REPLACE. */
+struct ip6t_replace
+{
+ /* Which table. */
+ char name[IP6T_TABLE_MAXNAMELEN];
+
+ /* Which hook entry points are valid: bitmask. You can't
+ change this. */
+ unsigned int valid_hooks;
+
+ /* Number of entries */
+ unsigned int num_entries;
+
+ /* Total size of new entries */
+ unsigned int size;
+
+ /* Hook entry points. */
+ unsigned int hook_entry[NF_INET_NUMHOOKS];
+
+ /* Underflow points. */
+ unsigned int underflow[NF_INET_NUMHOOKS];
+
+ /* Information about old entries: */
+ /* Number of counters (must be equal to current number of entries). */
+ unsigned int num_counters;
+ /* The old entries' counters. */
+ struct xt_counters *counters;
+
+ /* The entries (hang off end: not really an array). */
+ struct ip6t_entry entries[0];
+};
+
+/* The argument to IP6T_SO_ADD_COUNTERS. */
+#define ip6t_counters_info xt_counters_info
+
+/* The argument to IP6T_SO_GET_ENTRIES. */
+struct ip6t_get_entries
+{
+ /* Which table: user fills this in. */
+ char name[IP6T_TABLE_MAXNAMELEN];
+
+ /* User fills this in: total entry size. */
+ unsigned int size;
+
+ /* The entries. */
+ struct ip6t_entry entrytable[0];
+};
+
+/* Standard return verdict, or do jump. */
+#define IP6T_STANDARD_TARGET XT_STANDARD_TARGET
+/* Error verdict. */
+#define IP6T_ERROR_TARGET XT_ERROR_TARGET
+
+/* Helper functions */
+static __inline__ struct ip6t_entry_target *
+ip6t_get_target(struct ip6t_entry *e)
+{
+ return (void *)e + e->target_offset;
+}
+
+/* fn returns 0 to continue iteration */
+#define IP6T_MATCH_ITERATE(e, fn, args...) \
+ XT_MATCH_ITERATE(struct ip6t_entry, e, fn, ## args)
+
+/* fn returns 0 to continue iteration */
+#define IP6T_ENTRY_ITERATE(entries, size, fn, args...) \
+ XT_ENTRY_ITERATE(struct ip6t_entry, entries, size, fn, ## args)
+
+/*
+ * Main firewall chains definitions and global var's definitions.
+ */
+
+#endif /* _IP6_TABLES_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_HL.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_HL.h
new file mode 100644
index 0000000..afb7813
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_HL.h
@@ -0,0 +1,22 @@
+/* Hop Limit modification module for ip6tables
+ * Maciej Soltysiak <solt@dns.toxicfilms.tv>
+ * Based on HW's TTL module */
+
+#ifndef _IP6T_HL_H
+#define _IP6T_HL_H
+
+enum {
+ IP6T_HL_SET = 0,
+ IP6T_HL_INC,
+ IP6T_HL_DEC
+};
+
+#define IP6T_HL_MAXMODE IP6T_HL_DEC
+
+struct ip6t_HL_info {
+ u_int8_t mode;
+ u_int8_t hop_limit;
+};
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_LOG.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_LOG.h
new file mode 100644
index 0000000..0d0119b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_LOG.h
@@ -0,0 +1,18 @@
+#ifndef _IP6T_LOG_H
+#define _IP6T_LOG_H
+
+/* make sure not to change this without changing netfilter.h:NF_LOG_* (!) */
+#define IP6T_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */
+#define IP6T_LOG_TCPOPT 0x02 /* Log TCP options */
+#define IP6T_LOG_IPOPT 0x04 /* Log IP options */
+#define IP6T_LOG_UID 0x08 /* Log UID owning local socket */
+#define IP6T_LOG_NFLOG 0x10 /* Unsupported, don't use */
+#define IP6T_LOG_MASK 0x1f
+
+struct ip6t_log_info {
+ unsigned char level;
+ unsigned char logflags;
+ char prefix[30];
+};
+
+#endif /*_IPT_LOG_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_MARK.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_MARK.h
new file mode 100644
index 0000000..7cf629a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_MARK.h
@@ -0,0 +1,9 @@
+#ifndef _IP6T_MARK_H_target
+#define _IP6T_MARK_H_target
+
+/* Backwards compatibility for old userspace */
+#include <linux/netfilter/xt_MARK.h>
+
+#define ip6t_mark_target_info xt_mark_target_info
+
+#endif /*_IP6T_MARK_H_target*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_REJECT.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_REJECT.h
new file mode 100644
index 0000000..6be6504
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_REJECT.h
@@ -0,0 +1,18 @@
+#ifndef _IP6T_REJECT_H
+#define _IP6T_REJECT_H
+
+enum ip6t_reject_with {
+ IP6T_ICMP6_NO_ROUTE,
+ IP6T_ICMP6_ADM_PROHIBITED,
+ IP6T_ICMP6_NOT_NEIGHBOUR,
+ IP6T_ICMP6_ADDR_UNREACH,
+ IP6T_ICMP6_PORT_UNREACH,
+ IP6T_ICMP6_ECHOREPLY,
+ IP6T_TCP_RESET
+};
+
+struct ip6t_reject_info {
+ u_int32_t with; /* reject type */
+};
+
+#endif /*_IP6T_REJECT_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_ah.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_ah.h
new file mode 100644
index 0000000..8531879
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_ah.h
@@ -0,0 +1,21 @@
+#ifndef _IP6T_AH_H
+#define _IP6T_AH_H
+
+struct ip6t_ah
+{
+ u_int32_t spis[2]; /* Security Parameter Index */
+ u_int32_t hdrlen; /* Header Length */
+ u_int8_t hdrres; /* Test of the Reserved Filed */
+ u_int8_t invflags; /* Inverse flags */
+};
+
+#define IP6T_AH_SPI 0x01
+#define IP6T_AH_LEN 0x02
+#define IP6T_AH_RES 0x04
+
+/* Values for "invflags" field in struct ip6t_ah. */
+#define IP6T_AH_INV_SPI 0x01 /* Invert the sense of spi. */
+#define IP6T_AH_INV_LEN 0x02 /* Invert the sense of length. */
+#define IP6T_AH_INV_MASK 0x03 /* All possible flags. */
+
+#endif /*_IP6T_AH_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_esp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_esp.h
new file mode 100644
index 0000000..f62eaf5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_esp.h
@@ -0,0 +1,10 @@
+#ifndef _IP6T_ESP_H
+#define _IP6T_ESP_H
+
+#include <linux/netfilter/xt_esp.h>
+
+#define ip6t_esp xt_esp
+#define IP6T_ESP_INV_SPI XT_ESP_INV_SPI
+#define IP6T_ESP_INV_MASK XT_ESP_INV_MASK
+
+#endif /*_IP6T_ESP_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_frag.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_frag.h
new file mode 100644
index 0000000..66070a0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_frag.h
@@ -0,0 +1,24 @@
+#ifndef _IP6T_FRAG_H
+#define _IP6T_FRAG_H
+
+struct ip6t_frag
+{
+ u_int32_t ids[2]; /* Security Parameter Index */
+ u_int32_t hdrlen; /* Header Length */
+ u_int8_t flags; /* */
+ u_int8_t invflags; /* Inverse flags */
+};
+
+#define IP6T_FRAG_IDS 0x01
+#define IP6T_FRAG_LEN 0x02
+#define IP6T_FRAG_RES 0x04
+#define IP6T_FRAG_FST 0x08
+#define IP6T_FRAG_MF 0x10
+#define IP6T_FRAG_NMF 0x20
+
+/* Values for "invflags" field in struct ip6t_frag. */
+#define IP6T_FRAG_INV_IDS 0x01 /* Invert the sense of ids. */
+#define IP6T_FRAG_INV_LEN 0x02 /* Invert the sense of length. */
+#define IP6T_FRAG_INV_MASK 0x03 /* All possible flags. */
+
+#endif /*_IP6T_FRAG_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_hl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_hl.h
new file mode 100644
index 0000000..5ef91b8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_hl.h
@@ -0,0 +1,22 @@
+/* ip6tables module for matching the Hop Limit value
+ * Maciej Soltysiak <solt@dns.toxicfilms.tv>
+ * Based on HW's ttl module */
+
+#ifndef _IP6T_HL_H
+#define _IP6T_HL_H
+
+enum {
+ IP6T_HL_EQ = 0, /* equals */
+ IP6T_HL_NE, /* not equals */
+ IP6T_HL_LT, /* less than */
+ IP6T_HL_GT, /* greater than */
+};
+
+
+struct ip6t_hl_info {
+ u_int8_t mode;
+ u_int8_t hop_limit;
+};
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_ipv6header.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_ipv6header.h
new file mode 100644
index 0000000..51c53fc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_ipv6header.h
@@ -0,0 +1,27 @@
+/* ipv6header match - matches IPv6 packets based
+on whether they contain certain headers */
+
+/* Original idea: Brad Chapman
+ * Rewritten by: Andras Kis-Szabo <kisza@sch.bme.hu> */
+
+
+#ifndef __IPV6HEADER_H
+#define __IPV6HEADER_H
+
+struct ip6t_ipv6header_info
+{
+ u_int8_t matchflags;
+ u_int8_t invflags;
+ u_int8_t modeflag;
+};
+
+#define MASK_HOPOPTS 128
+#define MASK_DSTOPTS 64
+#define MASK_ROUTING 32
+#define MASK_FRAGMENT 16
+#define MASK_AH 8
+#define MASK_ESP 4
+#define MASK_NONE 2
+#define MASK_PROTO 1
+
+#endif /* __IPV6HEADER_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_length.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_length.h
new file mode 100644
index 0000000..9e9689d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_length.h
@@ -0,0 +1,8 @@
+#ifndef _IP6T_LENGTH_H
+#define _IP6T_LENGTH_H
+
+#include <linux/netfilter/xt_length.h>
+#define ip6t_length_info xt_length_info
+
+#endif /*_IP6T_LENGTH_H*/
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_limit.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_limit.h
new file mode 100644
index 0000000..487e5ea
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_limit.h
@@ -0,0 +1,8 @@
+#ifndef _IP6T_RATE_H
+#define _IP6T_RATE_H
+
+#include <linux/netfilter/xt_limit.h>
+#define IP6T_LIMIT_SCALE XT_LIMIT_SCALE
+#define ip6t_rateinfo xt_rateinfo
+
+#endif /*_IP6T_RATE_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_mac.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_mac.h
new file mode 100644
index 0000000..ac58e83
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_mac.h
@@ -0,0 +1,7 @@
+#ifndef _IP6T_MAC_H
+#define _IP6T_MAC_H
+
+#include <linux/netfilter/xt_mac.h>
+#define ip6t_mac_info xt_mac_info
+
+#endif /*_IP6T_MAC_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_mark.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_mark.h
new file mode 100644
index 0000000..ff20495
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_mark.h
@@ -0,0 +1,9 @@
+#ifndef _IP6T_MARK_H
+#define _IP6T_MARK_H
+
+/* Backwards compatibility for old userspace */
+#include <linux/netfilter/xt_mark.h>
+
+#define ip6t_mark_info xt_mark_info
+
+#endif /*_IPT_MARK_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_mh.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_mh.h
new file mode 100644
index 0000000..b9ca9a5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_mh.h
@@ -0,0 +1,15 @@
+#ifndef _IP6T_MH_H
+#define _IP6T_MH_H
+
+/* MH matching stuff */
+struct ip6t_mh
+{
+ u_int8_t types[2]; /* MH type range */
+ u_int8_t invflags; /* Inverse flags */
+};
+
+/* Values for "invflags" field in struct ip6t_mh. */
+#define IP6T_MH_INV_TYPE 0x01 /* Invert the sense of type. */
+#define IP6T_MH_INV_MASK 0x01 /* All possible flags. */
+
+#endif /*_IP6T_MH_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_multiport.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_multiport.h
new file mode 100644
index 0000000..042c926
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_multiport.h
@@ -0,0 +1,14 @@
+#ifndef _IP6T_MULTIPORT_H
+#define _IP6T_MULTIPORT_H
+
+#include <linux/netfilter/xt_multiport.h>
+
+#define IP6T_MULTIPORT_SOURCE XT_MULTIPORT_SOURCE
+#define IP6T_MULTIPORT_DESTINATION XT_MULTIPORT_DESTINATION
+#define IP6T_MULTIPORT_EITHER XT_MULTIPORT_EITHER
+
+#define IP6T_MULTI_PORTS XT_MULTI_PORTS
+
+#define ip6t_multiport xt_multiport
+
+#endif /*_IP6T_MULTIPORT_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_opts.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_opts.h
new file mode 100644
index 0000000..a07e363
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_opts.h
@@ -0,0 +1,23 @@
+#ifndef _IP6T_OPTS_H
+#define _IP6T_OPTS_H
+
+#define IP6T_OPTS_OPTSNR 16
+
+struct ip6t_opts
+{
+ u_int32_t hdrlen; /* Header Length */
+ u_int8_t flags; /* */
+ u_int8_t invflags; /* Inverse flags */
+ u_int16_t opts[IP6T_OPTS_OPTSNR]; /* opts */
+ u_int8_t optsnr; /* Nr of OPts */
+};
+
+#define IP6T_OPTS_LEN 0x01
+#define IP6T_OPTS_OPTS 0x02
+#define IP6T_OPTS_NSTRICT 0x04
+
+/* Values for "invflags" field in struct ip6t_rt. */
+#define IP6T_OPTS_INV_LEN 0x01 /* Invert the sense of length. */
+#define IP6T_OPTS_INV_MASK 0x01 /* All possible flags. */
+
+#endif /*_IP6T_OPTS_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_owner.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_owner.h
new file mode 100644
index 0000000..ec5cc7a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_owner.h
@@ -0,0 +1,18 @@
+#ifndef _IP6T_OWNER_H
+#define _IP6T_OWNER_H
+
+/* match and invert flags */
+#define IP6T_OWNER_UID 0x01
+#define IP6T_OWNER_GID 0x02
+#define IP6T_OWNER_PID 0x04
+#define IP6T_OWNER_SID 0x08
+
+struct ip6t_owner_info {
+ __kernel_uid32_t uid;
+ __kernel_gid32_t gid;
+ __kernel_pid_t pid;
+ __kernel_pid_t sid;
+ u_int8_t match, invert; /* flags */
+};
+
+#endif /*_IPT_OWNER_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_physdev.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_physdev.h
new file mode 100644
index 0000000..c161c0a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_physdev.h
@@ -0,0 +1,17 @@
+#ifndef _IP6T_PHYSDEV_H
+#define _IP6T_PHYSDEV_H
+
+/* Backwards compatibility for old userspace */
+
+#include <linux/netfilter/xt_physdev.h>
+
+#define IP6T_PHYSDEV_OP_IN XT_PHYSDEV_OP_IN
+#define IP6T_PHYSDEV_OP_OUT XT_PHYSDEV_OP_OUT
+#define IP6T_PHYSDEV_OP_BRIDGED XT_PHYSDEV_OP_BRIDGED
+#define IP6T_PHYSDEV_OP_ISIN XT_PHYSDEV_OP_ISIN
+#define IP6T_PHYSDEV_OP_ISOUT XT_PHYSDEV_OP_ISOUT
+#define IP6T_PHYSDEV_OP_MASK XT_PHYSDEV_OP_MASK
+
+#define ip6t_physdev_info xt_physdev_info
+
+#endif /*_IP6T_PHYSDEV_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_policy.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_policy.h
new file mode 100644
index 0000000..b1c449d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_policy.h
@@ -0,0 +1,23 @@
+#ifndef _IP6T_POLICY_H
+#define _IP6T_POLICY_H
+
+#include <linux/netfilter/xt_policy.h>
+
+#define IP6T_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM
+
+/* ip6t_policy_flags */
+#define IP6T_POLICY_MATCH_IN XT_POLICY_MATCH_IN
+#define IP6T_POLICY_MATCH_OUT XT_POLICY_MATCH_OUT
+#define IP6T_POLICY_MATCH_NONE XT_POLICY_MATCH_NONE
+#define IP6T_POLICY_MATCH_STRICT XT_POLICY_MATCH_STRICT
+
+/* ip6t_policy_modes */
+#define IP6T_POLICY_MODE_TRANSPORT XT_POLICY_MODE_TRANSPORT
+#define IP6T_POLICY_MODE_TUNNEL XT_POLICY_MODE_TUNNEL
+
+#define ip6t_policy_spec xt_policy_spec
+#define ip6t_policy_addr xt_policy_addr
+#define ip6t_policy_elem xt_policy_elem
+#define ip6t_policy_info xt_policy_info
+
+#endif /* _IP6T_POLICY_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_rt.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_rt.h
new file mode 100644
index 0000000..5215602
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netfilter_ipv6/ip6t_rt.h
@@ -0,0 +1,33 @@
+#ifndef _IP6T_RT_H
+#define _IP6T_RT_H
+
+/*#include <linux/in6.h>*/
+
+#define IP6T_RT_HOPS 16
+
+struct ip6t_rt
+{
+ u_int32_t rt_type; /* Routing Type */
+ u_int32_t segsleft[2]; /* Segments Left */
+ u_int32_t hdrlen; /* Header Length */
+ u_int8_t flags; /* */
+ u_int8_t invflags; /* Inverse flags */
+ struct in6_addr addrs[IP6T_RT_HOPS]; /* Hops */
+ u_int8_t addrnr; /* Nr of Addresses */
+};
+
+#define IP6T_RT_TYP 0x01
+#define IP6T_RT_SGS 0x02
+#define IP6T_RT_LEN 0x04
+#define IP6T_RT_RES 0x08
+#define IP6T_RT_FST_MASK 0x30
+#define IP6T_RT_FST 0x10
+#define IP6T_RT_FST_NSTRICT 0x20
+
+/* Values for "invflags" field in struct ip6t_rt. */
+#define IP6T_RT_INV_TYP 0x01 /* Invert the sense of type. */
+#define IP6T_RT_INV_SGS 0x02 /* Invert the sense of Segments. */
+#define IP6T_RT_INV_LEN 0x04 /* Invert the sense of length. */
+#define IP6T_RT_INV_MASK 0x07 /* All possible flags. */
+
+#endif /*_IP6T_RT_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netlink.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netlink.h
new file mode 100644
index 0000000..ec780bb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netlink.h
@@ -0,0 +1,155 @@
+#ifndef __LINUX_NETLINK_H
+#define __LINUX_NETLINK_H
+
+#include <linux/socket.h> /* for sa_family_t */
+#include <linux/types.h>
+
+#define NETLINK_ROUTE 0 /* Routing/device hook */
+#define NETLINK_UNUSED 1 /* Unused number */
+#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */
+#define NETLINK_FIREWALL 3 /* Firewalling hook */
+#define NETLINK_INET_DIAG 4 /* INET socket monitoring */
+#define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */
+#define NETLINK_XFRM 6 /* ipsec */
+#define NETLINK_SELINUX 7 /* SELinux event notifications */
+#define NETLINK_ISCSI 8 /* Open-iSCSI */
+#define NETLINK_AUDIT 9 /* auditing */
+#define NETLINK_FIB_LOOKUP 10
+#define NETLINK_CONNECTOR 11
+#define NETLINK_NETFILTER 12 /* netfilter subsystem */
+#define NETLINK_IP6_FW 13
+#define NETLINK_DNRTMSG 14 /* DECnet routing messages */
+#define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */
+#define NETLINK_GENERIC 16
+/* leave room for NETLINK_DM (DM Events) */
+#define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */
+#define NETLINK_ECRYPTFS 19
+
+#define MAX_LINKS 32
+
+struct net;
+
+struct sockaddr_nl
+{
+ sa_family_t nl_family; /* AF_NETLINK */
+ unsigned short nl_pad; /* zero */
+ __u32 nl_pid; /* port ID */
+ __u32 nl_groups; /* multicast groups mask */
+};
+
+struct nlmsghdr
+{
+ __u32 nlmsg_len; /* Length of message including header */
+ __u16 nlmsg_type; /* Message content */
+ __u16 nlmsg_flags; /* Additional flags */
+ __u32 nlmsg_seq; /* Sequence number */
+ __u32 nlmsg_pid; /* Sending process port ID */
+};
+
+/* Flags values */
+
+#define NLM_F_REQUEST 1 /* It is request message. */
+#define NLM_F_MULTI 2 /* Multipart message, terminated by NLMSG_DONE */
+#define NLM_F_ACK 4 /* Reply with ack, with zero or error code */
+#define NLM_F_ECHO 8 /* Echo this request */
+
+/* Modifiers to GET request */
+#define NLM_F_ROOT 0x100 /* specify tree root */
+#define NLM_F_MATCH 0x200 /* return all matching */
+#define NLM_F_ATOMIC 0x400 /* atomic GET */
+#define NLM_F_DUMP (NLM_F_ROOT|NLM_F_MATCH)
+
+/* Modifiers to NEW request */
+#define NLM_F_REPLACE 0x100 /* Override existing */
+#define NLM_F_EXCL 0x200 /* Do not touch, if it exists */
+#define NLM_F_CREATE 0x400 /* Create, if it does not exist */
+#define NLM_F_APPEND 0x800 /* Add to end of list */
+
+/*
+ 4.4BSD ADD NLM_F_CREATE|NLM_F_EXCL
+ 4.4BSD CHANGE NLM_F_REPLACE
+
+ True CHANGE NLM_F_CREATE|NLM_F_REPLACE
+ Append NLM_F_CREATE
+ Check NLM_F_EXCL
+ */
+
+#define NLMSG_ALIGNTO 4
+#define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
+#define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
+#define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN))
+#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
+#define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
+#define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
+ (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
+#define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \
+ (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
+ (nlh)->nlmsg_len <= (len))
+#define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
+
+#define NLMSG_NOOP 0x1 /* Nothing. */
+#define NLMSG_ERROR 0x2 /* Error */
+#define NLMSG_DONE 0x3 /* End of a dump */
+#define NLMSG_OVERRUN 0x4 /* Data lost */
+
+#define NLMSG_MIN_TYPE 0x10 /* < 0x10: reserved control messages */
+
+struct nlmsgerr
+{
+ int error;
+ struct nlmsghdr msg;
+};
+
+#define NETLINK_ADD_MEMBERSHIP 1
+#define NETLINK_DROP_MEMBERSHIP 2
+#define NETLINK_PKTINFO 3
+#define NETLINK_BROADCAST_ERROR 4
+#define NETLINK_NO_ENOBUFS 5
+
+struct nl_pktinfo
+{
+ __u32 group;
+};
+
+#define NET_MAJOR 36 /* Major 36 is reserved for networking */
+
+enum {
+ NETLINK_UNCONNECTED = 0,
+ NETLINK_CONNECTED,
+};
+
+/*
+ * <------- NLA_HDRLEN ------> <-- NLA_ALIGN(payload)-->
+ * +---------------------+- - -+- - - - - - - - - -+- - -+
+ * | Header | Pad | Payload | Pad |
+ * | (struct nlattr) | ing | | ing |
+ * +---------------------+- - -+- - - - - - - - - -+- - -+
+ * <-------------- nlattr->nla_len -------------->
+ */
+
+struct nlattr
+{
+ __u16 nla_len;
+ __u16 nla_type;
+};
+
+/*
+ * nla_type (16 bits)
+ * +---+---+-------------------------------+
+ * | N | O | Attribute Type |
+ * +---+---+-------------------------------+
+ * N := Carries nested attributes
+ * O := Payload stored in network byte order
+ *
+ * Note: The N and O flag are mutually exclusive.
+ */
+#define NLA_F_NESTED (1 << 15)
+#define NLA_F_NET_BYTEORDER (1 << 14)
+#define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
+
+#define NLA_ALIGNTO 4
+#define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))
+#define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr)))
+
+
+#endif /* __LINUX_NETLINK_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netrom.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netrom.h
new file mode 100644
index 0000000..6939b32
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/netrom.h
@@ -0,0 +1,34 @@
+/*
+ * These are the public elements of the Linux kernel NET/ROM implementation.
+ * For kernel AX.25 see the file ax25.h. This file requires ax25.h for the
+ * definition of the ax25_address structure.
+ */
+
+#ifndef NETROM_KERNEL_H
+#define NETROM_KERNEL_H
+
+#define NETROM_MTU 236
+
+#define NETROM_T1 1
+#define NETROM_T2 2
+#define NETROM_N2 3
+#define NETROM_T4 6
+#define NETROM_IDLE 7
+
+#define SIOCNRDECOBS (SIOCPROTOPRIVATE+2)
+
+struct nr_route_struct {
+#define NETROM_NEIGH 0
+#define NETROM_NODE 1
+ int type;
+ ax25_address callsign;
+ char device[16];
+ unsigned int quality;
+ char mnemonic[7];
+ ax25_address neighbour;
+ unsigned int obs_count;
+ unsigned int ndigis;
+ ax25_address digipeaters[AX25_MAX_DIGIS];
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs.h
new file mode 100644
index 0000000..e683d76
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs.h
@@ -0,0 +1,128 @@
+/*
+ * NFS protocol definitions
+ *
+ * This file contains constants mostly for Version 2 of the protocol,
+ * but also has a couple of NFSv3 bits in (notably the error codes).
+ */
+#ifndef _LINUX_NFS_H
+#define _LINUX_NFS_H
+
+#define NFS_PROGRAM 100003
+#define NFS_PORT 2049
+#define NFS_MAXDATA 8192
+#define NFS_MAXPATHLEN 1024
+#define NFS_MAXNAMLEN 255
+#define NFS_MAXGROUPS 16
+#define NFS_FHSIZE 32
+#define NFS_COOKIESIZE 4
+#define NFS_FIFO_DEV (-1)
+#define NFSMODE_FMT 0170000
+#define NFSMODE_DIR 0040000
+#define NFSMODE_CHR 0020000
+#define NFSMODE_BLK 0060000
+#define NFSMODE_REG 0100000
+#define NFSMODE_LNK 0120000
+#define NFSMODE_SOCK 0140000
+#define NFSMODE_FIFO 0010000
+
+#define NFS_MNT_PROGRAM 100005
+#define NFS_MNT_PORT 627
+
+/*
+ * NFS stats. The good thing with these values is that NFSv3 errors are
+ * a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which
+ * no-one uses anyway), so we can happily mix code as long as we make sure
+ * no NFSv3 errors are returned to NFSv2 clients.
+ * Error codes that have a `--' in the v2 column are not part of the
+ * standard, but seem to be widely used nevertheless.
+ */
+ enum nfs_stat {
+ NFS_OK = 0, /* v2 v3 v4 */
+ NFSERR_PERM = 1, /* v2 v3 v4 */
+ NFSERR_NOENT = 2, /* v2 v3 v4 */
+ NFSERR_IO = 5, /* v2 v3 v4 */
+ NFSERR_NXIO = 6, /* v2 v3 v4 */
+ NFSERR_EAGAIN = 11, /* v2 v3 */
+ NFSERR_ACCES = 13, /* v2 v3 v4 */
+ NFSERR_EXIST = 17, /* v2 v3 v4 */
+ NFSERR_XDEV = 18, /* v3 v4 */
+ NFSERR_NODEV = 19, /* v2 v3 v4 */
+ NFSERR_NOTDIR = 20, /* v2 v3 v4 */
+ NFSERR_ISDIR = 21, /* v2 v3 v4 */
+ NFSERR_INVAL = 22, /* v2 v3 v4 */
+ NFSERR_FBIG = 27, /* v2 v3 v4 */
+ NFSERR_NOSPC = 28, /* v2 v3 v4 */
+ NFSERR_ROFS = 30, /* v2 v3 v4 */
+ NFSERR_MLINK = 31, /* v3 v4 */
+ NFSERR_OPNOTSUPP = 45, /* v2 v3 */
+ NFSERR_NAMETOOLONG = 63, /* v2 v3 v4 */
+ NFSERR_NOTEMPTY = 66, /* v2 v3 v4 */
+ NFSERR_DQUOT = 69, /* v2 v3 v4 */
+ NFSERR_STALE = 70, /* v2 v3 v4 */
+ NFSERR_REMOTE = 71, /* v2 v3 */
+ NFSERR_WFLUSH = 99, /* v2 */
+ NFSERR_BADHANDLE = 10001, /* v3 v4 */
+ NFSERR_NOT_SYNC = 10002, /* v3 */
+ NFSERR_BAD_COOKIE = 10003, /* v3 v4 */
+ NFSERR_NOTSUPP = 10004, /* v3 v4 */
+ NFSERR_TOOSMALL = 10005, /* v3 v4 */
+ NFSERR_SERVERFAULT = 10006, /* v3 v4 */
+ NFSERR_BADTYPE = 10007, /* v3 v4 */
+ NFSERR_JUKEBOX = 10008, /* v3 v4 */
+ NFSERR_SAME = 10009, /* v4 */
+ NFSERR_DENIED = 10010, /* v4 */
+ NFSERR_EXPIRED = 10011, /* v4 */
+ NFSERR_LOCKED = 10012, /* v4 */
+ NFSERR_GRACE = 10013, /* v4 */
+ NFSERR_FHEXPIRED = 10014, /* v4 */
+ NFSERR_SHARE_DENIED = 10015, /* v4 */
+ NFSERR_WRONGSEC = 10016, /* v4 */
+ NFSERR_CLID_INUSE = 10017, /* v4 */
+ NFSERR_RESOURCE = 10018, /* v4 */
+ NFSERR_MOVED = 10019, /* v4 */
+ NFSERR_NOFILEHANDLE = 10020, /* v4 */
+ NFSERR_MINOR_VERS_MISMATCH = 10021, /* v4 */
+ NFSERR_STALE_CLIENTID = 10022, /* v4 */
+ NFSERR_STALE_STATEID = 10023, /* v4 */
+ NFSERR_OLD_STATEID = 10024, /* v4 */
+ NFSERR_BAD_STATEID = 10025, /* v4 */
+ NFSERR_BAD_SEQID = 10026, /* v4 */
+ NFSERR_NOT_SAME = 10027, /* v4 */
+ NFSERR_LOCK_RANGE = 10028, /* v4 */
+ NFSERR_SYMLINK = 10029, /* v4 */
+ NFSERR_RESTOREFH = 10030, /* v4 */
+ NFSERR_LEASE_MOVED = 10031, /* v4 */
+ NFSERR_ATTRNOTSUPP = 10032, /* v4 */
+ NFSERR_NO_GRACE = 10033, /* v4 */
+ NFSERR_RECLAIM_BAD = 10034, /* v4 */
+ NFSERR_RECLAIM_CONFLICT = 10035,/* v4 */
+ NFSERR_BAD_XDR = 10036, /* v4 */
+ NFSERR_LOCKS_HELD = 10037, /* v4 */
+ NFSERR_OPENMODE = 10038, /* v4 */
+ NFSERR_BADOWNER = 10039, /* v4 */
+ NFSERR_BADCHAR = 10040, /* v4 */
+ NFSERR_BADNAME = 10041, /* v4 */
+ NFSERR_BAD_RANGE = 10042, /* v4 */
+ NFSERR_LOCK_NOTSUPP = 10043, /* v4 */
+ NFSERR_OP_ILLEGAL = 10044, /* v4 */
+ NFSERR_DEADLOCK = 10045, /* v4 */
+ NFSERR_FILE_OPEN = 10046, /* v4 */
+ NFSERR_ADMIN_REVOKED = 10047, /* v4 */
+ NFSERR_CB_PATH_DOWN = 10048, /* v4 */
+};
+
+/* NFSv2 file types - beware, these are not the same in NFSv3 */
+
+enum nfs_ftype {
+ NFNON = 0,
+ NFREG = 1,
+ NFDIR = 2,
+ NFBLK = 3,
+ NFCHR = 4,
+ NFLNK = 5,
+ NFSOCK = 6,
+ NFBAD = 7,
+ NFFIFO = 8
+};
+
+#endif /* _LINUX_NFS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs2.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs2.h
new file mode 100644
index 0000000..0ed9517
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs2.h
@@ -0,0 +1,74 @@
+/*
+ * NFS protocol definitions
+ *
+ * This file contains constants for Version 2 of the protocol.
+ */
+#ifndef _LINUX_NFS2_H
+#define _LINUX_NFS2_H
+
+#define NFS2_PORT 2049
+#define NFS2_MAXDATA 8192
+#define NFS2_MAXPATHLEN 1024
+#define NFS2_MAXNAMLEN 255
+#define NFS2_MAXGROUPS 16
+#define NFS2_FHSIZE 32
+#define NFS2_COOKIESIZE 4
+#define NFS2_FIFO_DEV (-1)
+#define NFS2MODE_FMT 0170000
+#define NFS2MODE_DIR 0040000
+#define NFS2MODE_CHR 0020000
+#define NFS2MODE_BLK 0060000
+#define NFS2MODE_REG 0100000
+#define NFS2MODE_LNK 0120000
+#define NFS2MODE_SOCK 0140000
+#define NFS2MODE_FIFO 0010000
+
+
+/* NFSv2 file types - beware, these are not the same in NFSv3 */
+enum nfs2_ftype {
+ NF2NON = 0,
+ NF2REG = 1,
+ NF2DIR = 2,
+ NF2BLK = 3,
+ NF2CHR = 4,
+ NF2LNK = 5,
+ NF2SOCK = 6,
+ NF2BAD = 7,
+ NF2FIFO = 8
+};
+
+struct nfs2_fh {
+ char data[NFS2_FHSIZE];
+};
+
+/*
+ * Procedure numbers for NFSv2
+ */
+#define NFS2_VERSION 2
+#define NFSPROC_NULL 0
+#define NFSPROC_GETATTR 1
+#define NFSPROC_SETATTR 2
+#define NFSPROC_ROOT 3
+#define NFSPROC_LOOKUP 4
+#define NFSPROC_READLINK 5
+#define NFSPROC_READ 6
+#define NFSPROC_WRITECACHE 7
+#define NFSPROC_WRITE 8
+#define NFSPROC_CREATE 9
+#define NFSPROC_REMOVE 10
+#define NFSPROC_RENAME 11
+#define NFSPROC_LINK 12
+#define NFSPROC_SYMLINK 13
+#define NFSPROC_MKDIR 14
+#define NFSPROC_RMDIR 15
+#define NFSPROC_READDIR 16
+#define NFSPROC_STATFS 17
+
+#define NFS_MNT_PROGRAM 100005
+#define NFS_MNT_VERSION 1
+#define MNTPROC_NULL 0
+#define MNTPROC_MNT 1
+#define MNTPROC_UMNT 3
+#define MNTPROC_UMNTALL 4
+
+#endif /* _LINUX_NFS2_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs3.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs3.h
new file mode 100644
index 0000000..7d0225a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs3.h
@@ -0,0 +1,99 @@
+/*
+ * NFSv3 protocol definitions
+ */
+#ifndef _LINUX_NFS3_H
+#define _LINUX_NFS3_H
+
+#define NFS3_PORT 2049
+#define NFS3_MAXDATA 32768
+#define NFS3_MAXPATHLEN PATH_MAX
+#define NFS3_MAXNAMLEN NAME_MAX
+#define NFS3_MAXGROUPS 16
+#define NFS3_FHSIZE 64
+#define NFS3_COOKIESIZE 4
+#define NFS3_FIFO_DEV (-1)
+#define NFS3MODE_FMT 0170000
+#define NFS3MODE_DIR 0040000
+#define NFS3MODE_CHR 0020000
+#define NFS3MODE_BLK 0060000
+#define NFS3MODE_REG 0100000
+#define NFS3MODE_LNK 0120000
+#define NFS3MODE_SOCK 0140000
+#define NFS3MODE_FIFO 0010000
+
+/* Flags for access() call */
+#define NFS3_ACCESS_READ 0x0001
+#define NFS3_ACCESS_LOOKUP 0x0002
+#define NFS3_ACCESS_MODIFY 0x0004
+#define NFS3_ACCESS_EXTEND 0x0008
+#define NFS3_ACCESS_DELETE 0x0010
+#define NFS3_ACCESS_EXECUTE 0x0020
+#define NFS3_ACCESS_FULL 0x003f
+
+/* Flags for create mode */
+enum nfs3_createmode {
+ NFS3_CREATE_UNCHECKED = 0,
+ NFS3_CREATE_GUARDED = 1,
+ NFS3_CREATE_EXCLUSIVE = 2
+};
+
+/* NFSv3 file system properties */
+#define NFS3_FSF_LINK 0x0001
+#define NFS3_FSF_SYMLINK 0x0002
+#define NFS3_FSF_HOMOGENEOUS 0x0008
+#define NFS3_FSF_CANSETTIME 0x0010
+/* Some shorthands. See fs/nfsd/nfs3proc.c */
+#define NFS3_FSF_DEFAULT 0x001B
+#define NFS3_FSF_BILLYBOY 0x0018
+#define NFS3_FSF_READONLY 0x0008
+
+enum nfs3_ftype {
+ NF3NON = 0,
+ NF3REG = 1,
+ NF3DIR = 2,
+ NF3BLK = 3,
+ NF3CHR = 4,
+ NF3LNK = 5,
+ NF3SOCK = 6,
+ NF3FIFO = 7, /* changed from NFSv2 (was 8) */
+ NF3BAD = 8
+};
+
+struct nfs3_fh {
+ unsigned short size;
+ unsigned char data[NFS3_FHSIZE];
+};
+
+#define NFS3_VERSION 3
+#define NFS3PROC_NULL 0
+#define NFS3PROC_GETATTR 1
+#define NFS3PROC_SETATTR 2
+#define NFS3PROC_LOOKUP 3
+#define NFS3PROC_ACCESS 4
+#define NFS3PROC_READLINK 5
+#define NFS3PROC_READ 6
+#define NFS3PROC_WRITE 7
+#define NFS3PROC_CREATE 8
+#define NFS3PROC_MKDIR 9
+#define NFS3PROC_SYMLINK 10
+#define NFS3PROC_MKNOD 11
+#define NFS3PROC_REMOVE 12
+#define NFS3PROC_RMDIR 13
+#define NFS3PROC_RENAME 14
+#define NFS3PROC_LINK 15
+#define NFS3PROC_READDIR 16
+#define NFS3PROC_READDIRPLUS 17
+#define NFS3PROC_FSSTAT 18
+#define NFS3PROC_FSINFO 19
+#define NFS3PROC_PATHCONF 20
+#define NFS3PROC_COMMIT 21
+
+#define NFS_MNT3_PROGRAM 100005
+#define NFS_MNT3_VERSION 3
+#define MOUNTPROC3_NULL 0
+#define MOUNTPROC3_MNT 1
+#define MOUNTPROC3_UMNT 3
+#define MOUNTPROC3_UMNTALL 4
+
+
+#endif /* _LINUX_NFS3_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs4.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs4.h
new file mode 100644
index 0000000..371f21b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs4.h
@@ -0,0 +1,146 @@
+/*
+ * include/linux/nfs4.h
+ *
+ * NFSv4 protocol definitions.
+ *
+ * Copyright (c) 2002 The Regents of the University of Michigan.
+ * All rights reserved.
+ *
+ * Kendrick Smith <kmsmith@umich.edu>
+ * Andy Adamson <andros@umich.edu>
+ */
+
+#ifndef _LINUX_NFS4_H
+#define _LINUX_NFS4_H
+
+#include <linux/types.h>
+
+#define NFS4_BITMAP_SIZE 2
+#define NFS4_VERIFIER_SIZE 8
+#define NFS4_STATEID_SIZE 16
+#define NFS4_FHSIZE 128
+#define NFS4_MAXPATHLEN PATH_MAX
+#define NFS4_MAXNAMLEN NAME_MAX
+#define NFS4_MAX_SESSIONID_LEN 16
+
+#define NFS4_ACCESS_READ 0x0001
+#define NFS4_ACCESS_LOOKUP 0x0002
+#define NFS4_ACCESS_MODIFY 0x0004
+#define NFS4_ACCESS_EXTEND 0x0008
+#define NFS4_ACCESS_DELETE 0x0010
+#define NFS4_ACCESS_EXECUTE 0x0020
+
+#define NFS4_FH_PERSISTENT 0x0000
+#define NFS4_FH_NOEXPIRE_WITH_OPEN 0x0001
+#define NFS4_FH_VOLATILE_ANY 0x0002
+#define NFS4_FH_VOL_MIGRATION 0x0004
+#define NFS4_FH_VOL_RENAME 0x0008
+
+#define NFS4_OPEN_RESULT_CONFIRM 0x0002
+#define NFS4_OPEN_RESULT_LOCKTYPE_POSIX 0x0004
+
+#define NFS4_SHARE_ACCESS_MASK 0x000F
+#define NFS4_SHARE_ACCESS_READ 0x0001
+#define NFS4_SHARE_ACCESS_WRITE 0x0002
+#define NFS4_SHARE_ACCESS_BOTH 0x0003
+#define NFS4_SHARE_DENY_READ 0x0001
+#define NFS4_SHARE_DENY_WRITE 0x0002
+#define NFS4_SHARE_DENY_BOTH 0x0003
+
+/* nfs41 */
+#define NFS4_SHARE_WANT_MASK 0xFF00
+#define NFS4_SHARE_WANT_NO_PREFERENCE 0x0000
+#define NFS4_SHARE_WANT_READ_DELEG 0x0100
+#define NFS4_SHARE_WANT_WRITE_DELEG 0x0200
+#define NFS4_SHARE_WANT_ANY_DELEG 0x0300
+#define NFS4_SHARE_WANT_NO_DELEG 0x0400
+#define NFS4_SHARE_WANT_CANCEL 0x0500
+
+#define NFS4_SHARE_WHEN_MASK 0xF0000
+#define NFS4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL 0x10000
+#define NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED 0x20000
+
+#define NFS4_SET_TO_SERVER_TIME 0
+#define NFS4_SET_TO_CLIENT_TIME 1
+
+#define NFS4_ACE_ACCESS_ALLOWED_ACE_TYPE 0
+#define NFS4_ACE_ACCESS_DENIED_ACE_TYPE 1
+#define NFS4_ACE_SYSTEM_AUDIT_ACE_TYPE 2
+#define NFS4_ACE_SYSTEM_ALARM_ACE_TYPE 3
+
+#define ACL4_SUPPORT_ALLOW_ACL 0x01
+#define ACL4_SUPPORT_DENY_ACL 0x02
+#define ACL4_SUPPORT_AUDIT_ACL 0x04
+#define ACL4_SUPPORT_ALARM_ACL 0x08
+
+#define NFS4_ACE_FILE_INHERIT_ACE 0x00000001
+#define NFS4_ACE_DIRECTORY_INHERIT_ACE 0x00000002
+#define NFS4_ACE_NO_PROPAGATE_INHERIT_ACE 0x00000004
+#define NFS4_ACE_INHERIT_ONLY_ACE 0x00000008
+#define NFS4_ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x00000010
+#define NFS4_ACE_FAILED_ACCESS_ACE_FLAG 0x00000020
+#define NFS4_ACE_IDENTIFIER_GROUP 0x00000040
+
+#define NFS4_ACE_READ_DATA 0x00000001
+#define NFS4_ACE_LIST_DIRECTORY 0x00000001
+#define NFS4_ACE_WRITE_DATA 0x00000002
+#define NFS4_ACE_ADD_FILE 0x00000002
+#define NFS4_ACE_APPEND_DATA 0x00000004
+#define NFS4_ACE_ADD_SUBDIRECTORY 0x00000004
+#define NFS4_ACE_READ_NAMED_ATTRS 0x00000008
+#define NFS4_ACE_WRITE_NAMED_ATTRS 0x00000010
+#define NFS4_ACE_EXECUTE 0x00000020
+#define NFS4_ACE_DELETE_CHILD 0x00000040
+#define NFS4_ACE_READ_ATTRIBUTES 0x00000080
+#define NFS4_ACE_WRITE_ATTRIBUTES 0x00000100
+#define NFS4_ACE_DELETE 0x00010000
+#define NFS4_ACE_READ_ACL 0x00020000
+#define NFS4_ACE_WRITE_ACL 0x00040000
+#define NFS4_ACE_WRITE_OWNER 0x00080000
+#define NFS4_ACE_SYNCHRONIZE 0x00100000
+#define NFS4_ACE_GENERIC_READ 0x00120081
+#define NFS4_ACE_GENERIC_WRITE 0x00160106
+#define NFS4_ACE_GENERIC_EXECUTE 0x001200A0
+#define NFS4_ACE_MASK_ALL 0x001F01FF
+
+#define EXCHGID4_FLAG_SUPP_MOVED_REFER 0x00000001
+#define EXCHGID4_FLAG_SUPP_MOVED_MIGR 0x00000002
+#define EXCHGID4_FLAG_USE_NON_PNFS 0x00010000
+#define EXCHGID4_FLAG_USE_PNFS_MDS 0x00020000
+#define EXCHGID4_FLAG_USE_PNFS_DS 0x00040000
+#define EXCHGID4_FLAG_UPD_CONFIRMED_REC_A 0x40000000
+#define EXCHGID4_FLAG_CONFIRMED_R 0x80000000
+/*
+ * Since the validity of these bits depends on whether
+ * they're set in the argument or response, have separate
+ * invalid flag masks for arg (_A) and resp (_R).
+ */
+#define EXCHGID4_FLAG_MASK_A 0x40070003
+#define EXCHGID4_FLAG_MASK_R 0x80070003
+
+#define SEQ4_STATUS_CB_PATH_DOWN 0x00000001
+#define SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING 0x00000002
+#define SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED 0x00000004
+#define SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED 0x00000008
+#define SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED 0x00000010
+#define SEQ4_STATUS_ADMIN_STATE_REVOKED 0x00000020
+#define SEQ4_STATUS_RECALLABLE_STATE_REVOKED 0x00000040
+#define SEQ4_STATUS_LEASE_MOVED 0x00000080
+#define SEQ4_STATUS_RESTART_RECLAIM_NEEDED 0x00000100
+
+#define NFS4_MAX_UINT64 (~(u64)0)
+
+enum nfs4_acl_whotype {
+ NFS4_ACL_WHO_NAMED = 0,
+ NFS4_ACL_WHO_OWNER,
+ NFS4_ACL_WHO_GROUP,
+ NFS4_ACL_WHO_EVERYONE,
+};
+
+#endif
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs4_mount.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs4_mount.h
new file mode 100644
index 0000000..f4ff32d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs4_mount.h
@@ -0,0 +1,71 @@
+#ifndef _LINUX_NFS4_MOUNT_H
+#define _LINUX_NFS4_MOUNT_H
+
+/*
+ * linux/include/linux/nfs4_mount.h
+ *
+ * Copyright (C) 2002 Trond Myklebust
+ *
+ * structure passed from user-space to kernel-space during an nfsv4 mount
+ */
+
+/*
+ * WARNING! Do not delete or change the order of these fields. If
+ * a new field is required then add it to the end. The version field
+ * tracks which fields are present. This will ensure some measure of
+ * mount-to-kernel version compatibility. Some of these aren't used yet
+ * but here they are anyway.
+ */
+#define NFS4_MOUNT_VERSION 1
+
+struct nfs_string {
+ unsigned int len;
+ const char * data;
+};
+
+struct nfs4_mount_data {
+ int version; /* 1 */
+ int flags; /* 1 */
+ int rsize; /* 1 */
+ int wsize; /* 1 */
+ int timeo; /* 1 */
+ int retrans; /* 1 */
+ int acregmin; /* 1 */
+ int acregmax; /* 1 */
+ int acdirmin; /* 1 */
+ int acdirmax; /* 1 */
+
+ /* see the definition of 'struct clientaddr4' in RFC3010 */
+ struct nfs_string client_addr; /* 1 */
+
+ /* Mount path */
+ struct nfs_string mnt_path; /* 1 */
+
+ /* Server details */
+ struct nfs_string hostname; /* 1 */
+ /* Server IP address */
+ unsigned int host_addrlen; /* 1 */
+ struct sockaddr * host_addr; /* 1 */
+
+ /* Transport protocol to use */
+ int proto; /* 1 */
+
+ /* Pseudo-flavours to use for authentication. See RFC2623 */
+ int auth_flavourlen; /* 1 */
+ int *auth_flavours; /* 1 */
+};
+
+/* bits in the flags field */
+/* Note: the fields that correspond to existing NFSv2/v3 mount options
+ * should mirror the values from include/linux/nfs_mount.h
+ */
+
+#define NFS4_MOUNT_SOFT 0x0001 /* 1 */
+#define NFS4_MOUNT_INTR 0x0002 /* 1 */
+#define NFS4_MOUNT_NOCTO 0x0010 /* 1 */
+#define NFS4_MOUNT_NOAC 0x0020 /* 1 */
+#define NFS4_MOUNT_STRICTLOCK 0x1000 /* 1 */
+#define NFS4_MOUNT_UNSHARED 0x8000 /* 1 */
+#define NFS4_MOUNT_FLAGMASK 0x9033
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs_fs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs_fs.h
new file mode 100644
index 0000000..534aeee
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs_fs.h
@@ -0,0 +1,59 @@
+/*
+ * linux/include/linux/nfs_fs.h
+ *
+ * Copyright (C) 1992 Rick Sladkey
+ *
+ * OS-specific nfs filesystem definitions and declarations
+ */
+
+#ifndef _LINUX_NFS_FS_H
+#define _LINUX_NFS_FS_H
+
+#include <linux/magic.h>
+
+/* Default timeout values */
+#define NFS_DEF_UDP_TIMEO (11)
+#define NFS_DEF_UDP_RETRANS (3)
+#define NFS_DEF_TCP_TIMEO (600)
+#define NFS_DEF_TCP_RETRANS (2)
+
+#define NFS_MAX_UDP_TIMEOUT (60*HZ)
+#define NFS_MAX_TCP_TIMEOUT (600*HZ)
+
+#define NFS_DEF_ACREGMIN (3)
+#define NFS_DEF_ACREGMAX (60)
+#define NFS_DEF_ACDIRMIN (30)
+#define NFS_DEF_ACDIRMAX (60)
+
+/*
+ * When flushing a cluster of dirty pages, there can be different
+ * strategies:
+ */
+#define FLUSH_SYNC 1 /* file being synced, or contention */
+#define FLUSH_STABLE 4 /* commit to stable storage */
+#define FLUSH_LOWPRI 8 /* low priority background flush */
+#define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */
+#define FLUSH_NOCOMMIT 32 /* Don't send the NFSv3/v4 COMMIT */
+#define FLUSH_INVALIDATE 64 /* Invalidate the page cache */
+#define FLUSH_NOWRITEPAGE 128 /* Don't call writepage() */
+
+
+/*
+ * NFS debug flags
+ */
+#define NFSDBG_VFS 0x0001
+#define NFSDBG_DIRCACHE 0x0002
+#define NFSDBG_LOOKUPCACHE 0x0004
+#define NFSDBG_PAGECACHE 0x0008
+#define NFSDBG_PROC 0x0010
+#define NFSDBG_XDR 0x0020
+#define NFSDBG_FILE 0x0040
+#define NFSDBG_ROOT 0x0080
+#define NFSDBG_CALLBACK 0x0100
+#define NFSDBG_CLIENT 0x0200
+#define NFSDBG_MOUNT 0x0400
+#define NFSDBG_FSCACHE 0x0800
+#define NFSDBG_ALL 0xFFFF
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs_idmap.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs_idmap.h
new file mode 100644
index 0000000..05f843c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs_idmap.h
@@ -0,0 +1,65 @@
+/*
+ * include/linux/nfs_idmap.h
+ *
+ * UID and GID to name mapping for clients.
+ *
+ * Copyright (c) 2002 The Regents of the University of Michigan.
+ * All rights reserved.
+ *
+ * Marius Aamodt Eriksen <marius@umich.edu>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef NFS_IDMAP_H
+#define NFS_IDMAP_H
+
+#include <linux/types.h>
+
+/* XXX from bits/utmp.h */
+#define IDMAP_NAMESZ 128
+
+#define IDMAP_TYPE_USER 0
+#define IDMAP_TYPE_GROUP 1
+
+#define IDMAP_CONV_IDTONAME 0
+#define IDMAP_CONV_NAMETOID 1
+
+#define IDMAP_STATUS_INVALIDMSG 0x01
+#define IDMAP_STATUS_AGAIN 0x02
+#define IDMAP_STATUS_LOOKUPFAIL 0x04
+#define IDMAP_STATUS_SUCCESS 0x08
+
+struct idmap_msg {
+ __u8 im_type;
+ __u8 im_conv;
+ char im_name[IDMAP_NAMESZ];
+ __u32 im_id;
+ __u8 im_status;
+};
+
+
+#endif /* NFS_IDMAP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs_mount.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs_mount.h
new file mode 100644
index 0000000..4499016
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfs_mount.h
@@ -0,0 +1,73 @@
+#ifndef _LINUX_NFS_MOUNT_H
+#define _LINUX_NFS_MOUNT_H
+
+/*
+ * linux/include/linux/nfs_mount.h
+ *
+ * Copyright (C) 1992 Rick Sladkey
+ *
+ * structure passed from user-space to kernel-space during an nfs mount
+ */
+#include <linux/in.h>
+#include <linux/nfs.h>
+#include <linux/nfs2.h>
+#include <linux/nfs3.h>
+
+/*
+ * WARNING! Do not delete or change the order of these fields. If
+ * a new field is required then add it to the end. The version field
+ * tracks which fields are present. This will ensure some measure of
+ * mount-to-kernel version compatibility. Some of these aren't used yet
+ * but here they are anyway.
+ */
+#define NFS_MOUNT_VERSION 6
+#define NFS_MAX_CONTEXT_LEN 256
+
+struct nfs_mount_data {
+ int version; /* 1 */
+ int fd; /* 1 */
+ struct nfs2_fh old_root; /* 1 */
+ int flags; /* 1 */
+ int rsize; /* 1 */
+ int wsize; /* 1 */
+ int timeo; /* 1 */
+ int retrans; /* 1 */
+ int acregmin; /* 1 */
+ int acregmax; /* 1 */
+ int acdirmin; /* 1 */
+ int acdirmax; /* 1 */
+ struct sockaddr_in addr; /* 1 */
+ char hostname[NFS_MAXNAMLEN + 1]; /* 1 */
+ int namlen; /* 2 */
+ unsigned int bsize; /* 3 */
+ struct nfs3_fh root; /* 4 */
+ int pseudoflavor; /* 5 */
+ char context[NFS_MAX_CONTEXT_LEN + 1]; /* 6 */
+};
+
+/* bits in the flags field visible to user space */
+
+#define NFS_MOUNT_SOFT 0x0001 /* 1 */
+#define NFS_MOUNT_INTR 0x0002 /* 1 */ /* now unused, but ABI */
+#define NFS_MOUNT_SECURE 0x0004 /* 1 */
+#define NFS_MOUNT_POSIX 0x0008 /* 1 */
+#define NFS_MOUNT_NOCTO 0x0010 /* 1 */
+#define NFS_MOUNT_NOAC 0x0020 /* 1 */
+#define NFS_MOUNT_TCP 0x0040 /* 2 */
+#define NFS_MOUNT_VER3 0x0080 /* 3 */
+#define NFS_MOUNT_KERBEROS 0x0100 /* 3 */
+#define NFS_MOUNT_NONLM 0x0200 /* 3 */
+#define NFS_MOUNT_BROKEN_SUID 0x0400 /* 4 */
+#define NFS_MOUNT_NOACL 0x0800 /* 4 */
+#define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */
+#define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */
+#define NFS_MOUNT_NORDIRPLUS 0x4000 /* 5 */
+#define NFS_MOUNT_UNSHARED 0x8000 /* 5 */
+#define NFS_MOUNT_FLAGMASK 0xFFFF
+
+/* The following are for internal use only */
+#define NFS_MOUNT_LOOKUP_CACHE_NONEG 0x10000
+#define NFS_MOUNT_LOOKUP_CACHE_NONE 0x20000
+#define NFS_MOUNT_NORESVPORT 0x40000
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsacl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsacl.h
new file mode 100644
index 0000000..df5e19f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsacl.h
@@ -0,0 +1,29 @@
+/*
+ * File: linux/nfsacl.h
+ *
+ * (C) 2003 Andreas Gruenbacher <agruen@suse.de>
+ */
+#ifndef __LINUX_NFSACL_H
+#define __LINUX_NFSACL_H
+
+#define NFS_ACL_PROGRAM 100227
+
+#define ACLPROC2_GETACL 1
+#define ACLPROC2_SETACL 2
+#define ACLPROC2_GETATTR 3
+#define ACLPROC2_ACCESS 4
+
+#define ACLPROC3_GETACL 1
+#define ACLPROC3_SETACL 2
+
+
+/* Flags for the getacl/setacl mode */
+#define NFS_ACL 0x0001
+#define NFS_ACLCNT 0x0002
+#define NFS_DFACL 0x0004
+#define NFS_DFACLCNT 0x0008
+
+/* Flag for Default ACL entries */
+#define NFS_ACL_DEFAULT 0x1000
+
+#endif /* __LINUX_NFSACL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/..install.cmd
new file mode 100644
index 0000000..93ae1ae
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/nfsd/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/nfsd /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/nfsd mips const.h debug.h export.h nfsfh.h stats.h syscall.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/nfsd /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/nfsd mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/nfsd/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/const.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/const.h
new file mode 100644
index 0000000..22ffb9a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/const.h
@@ -0,0 +1,30 @@
+/*
+ * include/linux/nfsd/const.h
+ *
+ * Various constants related to NFS.
+ *
+ * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
+ */
+
+#ifndef _LINUX_NFSD_CONST_H
+#define _LINUX_NFSD_CONST_H
+
+#include <linux/nfs.h>
+#include <linux/nfs2.h>
+#include <linux/nfs3.h>
+#include <linux/nfs4.h>
+
+/*
+ * Maximum protocol version supported by knfsd
+ */
+#define NFSSVC_MAXVERS 3
+
+/*
+ * Maximum blocksizes supported by daemon under various circumstances.
+ */
+#define NFSSVC_MAXBLKSIZE RPCSVC_MAXPAYLOAD
+/* NFSv2 is limited by the protocol specification, see RFC 1094 */
+#define NFSSVC_MAXBLKSIZE_V2 (8*1024)
+
+
+#endif /* _LINUX_NFSD_CONST_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/debug.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/debug.h
new file mode 100644
index 0000000..7d58c12
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/debug.h
@@ -0,0 +1,40 @@
+/*
+ * linux/include/linux/nfsd/debug.h
+ *
+ * Debugging-related stuff for nfsd
+ *
+ * Copyright (C) 1995 Olaf Kirch <okir@monad.swb.de>
+ */
+
+#ifndef LINUX_NFSD_DEBUG_H
+#define LINUX_NFSD_DEBUG_H
+
+#include <linux/sunrpc/debug.h>
+
+/*
+ * Enable debugging for nfsd.
+ * Requires RPC_DEBUG.
+ */
+#ifdef RPC_DEBUG
+# define NFSD_DEBUG 1
+#endif
+
+/*
+ * knfsd debug flags
+ */
+#define NFSDDBG_SOCK 0x0001
+#define NFSDDBG_FH 0x0002
+#define NFSDDBG_EXPORT 0x0004
+#define NFSDDBG_SVC 0x0008
+#define NFSDDBG_PROC 0x0010
+#define NFSDDBG_FILEOP 0x0020
+#define NFSDDBG_AUTH 0x0040
+#define NFSDDBG_REPCACHE 0x0080
+#define NFSDDBG_XDR 0x0100
+#define NFSDDBG_LOCKD 0x0200
+#define NFSDDBG_ALL 0x7FFF
+#define NFSDDBG_NOCHANGE 0xFFFF
+
+
+
+#endif /* LINUX_NFSD_DEBUG_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/export.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/export.h
new file mode 100644
index 0000000..8429a17
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/export.h
@@ -0,0 +1,47 @@
+/*
+ * include/linux/nfsd/export.h
+ *
+ * Public declarations for NFS exports. The definitions for the
+ * syscall interface are in nfsctl.h
+ *
+ * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
+ */
+
+#ifndef NFSD_EXPORT_H
+#define NFSD_EXPORT_H
+
+# include <linux/types.h>
+
+/*
+ * Important limits for the exports stuff.
+ */
+#define NFSCLNT_IDMAX 1024
+#define NFSCLNT_ADDRMAX 16
+#define NFSCLNT_KEYMAX 32
+
+/*
+ * Export flags.
+ */
+#define NFSEXP_READONLY 0x0001
+#define NFSEXP_INSECURE_PORT 0x0002
+#define NFSEXP_ROOTSQUASH 0x0004
+#define NFSEXP_ALLSQUASH 0x0008
+#define NFSEXP_ASYNC 0x0010
+#define NFSEXP_GATHERED_WRITES 0x0020
+/* 40 80 100 currently unused */
+#define NFSEXP_NOHIDE 0x0200
+#define NFSEXP_NOSUBTREECHECK 0x0400
+#define NFSEXP_NOAUTHNLM 0x0800 /* Don't authenticate NLM requests - just trust */
+#define NFSEXP_MSNFS 0x1000 /* do silly things that MS clients expect */
+#define NFSEXP_FSID 0x2000
+#define NFSEXP_CROSSMOUNT 0x4000
+#define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */
+#define NFSEXP_ALLFLAGS 0xFE3F
+
+/* The flags that may vary depending on security flavor: */
+#define NFSEXP_SECINFO_FLAGS (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \
+ | NFSEXP_ALLSQUASH)
+
+
+#endif /* NFSD_EXPORT_H */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/nfsfh.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/nfsfh.h
new file mode 100644
index 0000000..043273c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/nfsfh.h
@@ -0,0 +1,120 @@
+/*
+ * include/linux/nfsd/nfsfh.h
+ *
+ * This file describes the layout of the file handles as passed
+ * over the wire.
+ *
+ * Earlier versions of knfsd used to sign file handles using keyed MD5
+ * or SHA. I've removed this code, because it doesn't give you more
+ * security than blocking external access to port 2049 on your firewall.
+ *
+ * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir@monad.swb.de>
+ */
+
+#ifndef _LINUX_NFSD_FH_H
+#define _LINUX_NFSD_FH_H
+
+# include <linux/types.h>
+#include <linux/nfsd/const.h>
+#include <linux/nfsd/debug.h>
+
+/*
+ * This is the old "dentry style" Linux NFSv2 file handle.
+ *
+ * The xino and xdev fields are currently used to transport the
+ * ino/dev of the exported inode.
+ */
+struct nfs_fhbase_old {
+ __u32 fb_dcookie; /* dentry cookie - always 0xfeebbaca */
+ __u32 fb_ino; /* our inode number */
+ __u32 fb_dirino; /* dir inode number, 0 for directories */
+ __u32 fb_dev; /* our device */
+ __u32 fb_xdev;
+ __u32 fb_xino;
+ __u32 fb_generation;
+};
+
+/*
+ * This is the new flexible, extensible style NFSv2/v3 file handle.
+ * by Neil Brown <neilb@cse.unsw.edu.au> - March 2000
+ *
+ * The file handle is seens as a list of 4byte words.
+ * The first word contains a version number (1) and four descriptor bytes
+ * that tell how the remaining 3 variable length fields should be handled.
+ * These three bytes are auth_type, fsid_type and fileid_type.
+ *
+ * All 4byte values are in host-byte-order.
+ *
+ * The auth_type field specifies how the filehandle can be authenticated
+ * This might allow a file to be confirmed to be in a writable part of a
+ * filetree without checking the path from it upto the root.
+ * Current values:
+ * 0 - No authentication. fb_auth is 0 bytes long
+ * Possible future values:
+ * 1 - 4 bytes taken from MD5 hash of the remainer of the file handle
+ * prefixed by a secret and with the important export flags.
+ *
+ * The fsid_type identifies how the filesystem (or export point) is
+ * encoded.
+ * Current values:
+ * 0 - 4 byte device id (ms-2-bytes major, ls-2-bytes minor), 4byte inode number
+ * NOTE: we cannot use the kdev_t device id value, because kdev_t.h
+ * says we mustn't. We must break it up and reassemble.
+ * 1 - 4 byte user specified identifier
+ * 2 - 4 byte major, 4 byte minor, 4 byte inode number - DEPRECATED
+ * 3 - 4 byte device id, encoded for user-space, 4 byte inode number
+ * 4 - 4 byte inode number and 4 byte uuid
+ * 5 - 8 byte uuid
+ * 6 - 16 byte uuid
+ * 7 - 8 byte inode number and 16 byte uuid
+ *
+ * The fileid_type identified how the file within the filesystem is encoded.
+ * This is (will be) passed to, and set by, the underlying filesystem if it supports
+ * filehandle operations. The filesystem must not use the value '0' or '0xff' and may
+ * only use the values 1 and 2 as defined below:
+ * Current values:
+ * 0 - The root, or export point, of the filesystem. fb_fileid is 0 bytes.
+ * 1 - 32bit inode number, 32 bit generation number.
+ * 2 - 32bit inode number, 32 bit generation number, 32 bit parent directory inode number.
+ *
+ */
+struct nfs_fhbase_new {
+ __u8 fb_version; /* == 1, even => nfs_fhbase_old */
+ __u8 fb_auth_type;
+ __u8 fb_fsid_type;
+ __u8 fb_fileid_type;
+ __u32 fb_auth[1];
+/* __u32 fb_fsid[0]; floating */
+/* __u32 fb_fileid[0]; floating */
+};
+
+struct knfsd_fh {
+ unsigned int fh_size; /* significant for NFSv3.
+ * Points to the current size while building
+ * a new file handle
+ */
+ union {
+ struct nfs_fhbase_old fh_old;
+ __u32 fh_pad[NFS4_FHSIZE/4];
+ struct nfs_fhbase_new fh_new;
+ } fh_base;
+};
+
+#define ofh_dcookie fh_base.fh_old.fb_dcookie
+#define ofh_ino fh_base.fh_old.fb_ino
+#define ofh_dirino fh_base.fh_old.fb_dirino
+#define ofh_dev fh_base.fh_old.fb_dev
+#define ofh_xdev fh_base.fh_old.fb_xdev
+#define ofh_xino fh_base.fh_old.fb_xino
+#define ofh_generation fh_base.fh_old.fb_generation
+
+#define fh_version fh_base.fh_new.fb_version
+#define fh_fsid_type fh_base.fh_new.fb_fsid_type
+#define fh_auth_type fh_base.fh_new.fb_auth_type
+#define fh_fileid_type fh_base.fh_new.fb_fileid_type
+#define fh_auth fh_base.fh_new.fb_auth
+#define fh_fsid fh_base.fh_new.fb_auth
+
+
+
+#endif /* _LINUX_NFSD_FH_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/stats.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/stats.h
new file mode 100644
index 0000000..b7024e8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/stats.h
@@ -0,0 +1,17 @@
+/*
+ * linux/include/linux/nfsd/stats.h
+ *
+ * Statistics for NFS server.
+ *
+ * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
+ */
+
+#ifndef LINUX_NFSD_STATS_H
+#define LINUX_NFSD_STATS_H
+
+#include <linux/nfs4.h>
+
+/* thread usage wraps very million seconds (approx one fortnight) */
+#define NFSD_USAGE_WRAP (HZ*1000000)
+
+#endif /* LINUX_NFSD_STATS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/syscall.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/syscall.h
new file mode 100644
index 0000000..d6004ad
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nfsd/syscall.h
@@ -0,0 +1,109 @@
+/*
+ * include/linux/nfsd/syscall.h
+ *
+ * This file holds all declarations for the knfsd syscall interface.
+ *
+ * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
+ */
+
+#ifndef NFSD_SYSCALL_H
+#define NFSD_SYSCALL_H
+
+# include <linux/types.h>
+#include <linux/posix_types.h>
+#include <linux/nfsd/const.h>
+#include <linux/nfsd/export.h>
+#include <linux/nfsd/nfsfh.h>
+
+/*
+ * Version of the syscall interface
+ */
+#define NFSCTL_VERSION 0x0201
+
+/*
+ * These are the commands understood by nfsctl().
+ */
+#define NFSCTL_SVC 0 /* This is a server process. */
+#define NFSCTL_ADDCLIENT 1 /* Add an NFS client. */
+#define NFSCTL_DELCLIENT 2 /* Remove an NFS client. */
+#define NFSCTL_EXPORT 3 /* export a file system. */
+#define NFSCTL_UNEXPORT 4 /* unexport a file system. */
+/*#define NFSCTL_UGIDUPDATE 5 / * update a client's uid/gid map. DISCARDED */
+/*#define NFSCTL_GETFH 6 / * get an fh by ino DISCARDED */
+#define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */
+#define NFSCTL_GETFS 8 /* get an fh by path with max FH len */
+
+/* SVC */
+struct nfsctl_svc {
+ unsigned short svc_port;
+ int svc_nthreads;
+};
+
+/* ADDCLIENT/DELCLIENT */
+struct nfsctl_client {
+ char cl_ident[NFSCLNT_IDMAX+1];
+ int cl_naddr;
+ struct in_addr cl_addrlist[NFSCLNT_ADDRMAX];
+ int cl_fhkeytype;
+ int cl_fhkeylen;
+ unsigned char cl_fhkey[NFSCLNT_KEYMAX];
+};
+
+/* EXPORT/UNEXPORT */
+struct nfsctl_export {
+ char ex_client[NFSCLNT_IDMAX+1];
+ char ex_path[NFS_MAXPATHLEN+1];
+ __kernel_old_dev_t ex_dev;
+ __kernel_ino_t ex_ino;
+ int ex_flags;
+ __kernel_uid_t ex_anon_uid;
+ __kernel_gid_t ex_anon_gid;
+};
+
+/* GETFD */
+struct nfsctl_fdparm {
+ struct sockaddr gd_addr;
+ char gd_path[NFS_MAXPATHLEN+1];
+ int gd_version;
+};
+
+/* GETFS - GET Filehandle with Size */
+struct nfsctl_fsparm {
+ struct sockaddr gd_addr;
+ char gd_path[NFS_MAXPATHLEN+1];
+ int gd_maxlen;
+};
+
+/*
+ * This is the argument union.
+ */
+struct nfsctl_arg {
+ int ca_version; /* safeguard */
+ union {
+ struct nfsctl_svc u_svc;
+ struct nfsctl_client u_client;
+ struct nfsctl_export u_export;
+ struct nfsctl_fdparm u_getfd;
+ struct nfsctl_fsparm u_getfs;
+ /*
+ * The following dummy member is needed to preserve binary compatibility
+ * on platforms where alignof(void*)>alignof(int). It's needed because
+ * this union used to contain a member (u_umap) which contained a
+ * pointer.
+ */
+ void *u_ptr;
+ } u;
+#define ca_svc u.u_svc
+#define ca_client u.u_client
+#define ca_export u.u_export
+#define ca_getfd u.u_getfd
+#define ca_getfs u.u_getfs
+};
+
+union nfsctl_res {
+ __u8 cr_getfh[NFS_FHSIZE];
+ struct knfsd_fh cr_getfs;
+};
+
+
+#endif /* NFSD_SYSCALL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nl80211.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nl80211.h
new file mode 100644
index 0000000..cbe8ce3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nl80211.h
@@ -0,0 +1,1065 @@
+#ifndef __LINUX_NL80211_H
+#define __LINUX_NL80211_H
+/*
+ * 802.11 netlink interface public header
+ *
+ * Copyright 2006, 2007, 2008 Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2008 Michael Wu <flamingice@sourmilk.net>
+ * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com>
+ * Copyright 2008 Michael Buesch <mb@bu3sch.de>
+ * Copyright 2008 Luis R. Rodriguez <lrodriguez@atheros.com>
+ * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
+ * Copyright 2008 Colin McCabe <colin@cozybit.com>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+/**
+ * DOC: Station handling
+ *
+ * Stations are added per interface, but a special case exists with VLAN
+ * interfaces. When a station is bound to an AP interface, it may be moved
+ * into a VLAN identified by a VLAN interface index (%NL80211_ATTR_STA_VLAN).
+ * The station is still assumed to belong to the AP interface it was added
+ * to.
+ *
+ * TODO: need more info?
+ */
+
+/**
+ * enum nl80211_commands - supported nl80211 commands
+ *
+ * @NL80211_CMD_UNSPEC: unspecified command to catch errors
+ *
+ * @NL80211_CMD_GET_WIPHY: request information about a wiphy or dump request
+ * to get a list of all present wiphys.
+ * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or
+ * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME,
+ * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ, and/or
+ * %NL80211_ATTR_WIPHY_CHANNEL_TYPE.
+ * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request
+ * or rename notification. Has attributes %NL80211_ATTR_WIPHY and
+ * %NL80211_ATTR_WIPHY_NAME.
+ * @NL80211_CMD_DEL_WIPHY: Wiphy deleted. Has attributes
+ * %NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME.
+ *
+ * @NL80211_CMD_GET_INTERFACE: Request an interface's configuration;
+ * either a dump request on a %NL80211_ATTR_WIPHY or a specific get
+ * on an %NL80211_ATTR_IFINDEX is supported.
+ * @NL80211_CMD_SET_INTERFACE: Set type of a virtual interface, requires
+ * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE.
+ * @NL80211_CMD_NEW_INTERFACE: Newly created virtual interface or response
+ * to %NL80211_CMD_GET_INTERFACE. Has %NL80211_ATTR_IFINDEX,
+ * %NL80211_ATTR_WIPHY and %NL80211_ATTR_IFTYPE attributes. Can also
+ * be sent from userspace to request creation of a new virtual interface,
+ * then requires attributes %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFTYPE and
+ * %NL80211_ATTR_IFNAME.
+ * @NL80211_CMD_DEL_INTERFACE: Virtual interface was deleted, has attributes
+ * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_WIPHY. Can also be sent from
+ * userspace to request deletion of a virtual interface, then requires
+ * attribute %NL80211_ATTR_IFINDEX.
+ *
+ * @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified
+ * by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC.
+ * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT,
+ * %NL80211_ATTR_KEY_DEFAULT_MGMT, or %NL80211_ATTR_KEY_THRESHOLD.
+ * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA,
+ * %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC and %NL80211_ATTR_KEY_CIPHER
+ * attributes.
+ * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX
+ * or %NL80211_ATTR_MAC.
+ *
+ * @NL80211_CMD_GET_BEACON: retrieve beacon information (returned in a
+ * %NL80222_CMD_NEW_BEACON message)
+ * @NL80211_CMD_SET_BEACON: set the beacon on an access point interface
+ * using the %NL80211_ATTR_BEACON_INTERVAL, %NL80211_ATTR_DTIM_PERIOD,
+ * %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL attributes.
+ * @NL80211_CMD_NEW_BEACON: add a new beacon to an access point interface,
+ * parameters are like for %NL80211_CMD_SET_BEACON.
+ * @NL80211_CMD_DEL_BEACON: remove the beacon, stop sending it
+ *
+ * @NL80211_CMD_GET_STATION: Get station attributes for station identified by
+ * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
+ * @NL80211_CMD_SET_STATION: Set station attributes for station identified by
+ * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
+ * @NL80211_CMD_NEW_STATION: Add a station with given attributes to the
+ * the interface identified by %NL80211_ATTR_IFINDEX.
+ * @NL80211_CMD_DEL_STATION: Remove a station identified by %NL80211_ATTR_MAC
+ * or, if no MAC address given, all stations, on the interface identified
+ * by %NL80211_ATTR_IFINDEX.
+ *
+ * @NL80211_CMD_GET_MPATH: Get mesh path attributes for mesh path to
+ * destination %NL80211_ATTR_MAC on the interface identified by
+ * %NL80211_ATTR_IFINDEX.
+ * @NL80211_CMD_SET_MPATH: Set mesh path attributes for mesh path to
+ * destination %NL80211_ATTR_MAC on the interface identified by
+ * %NL80211_ATTR_IFINDEX.
+ * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the
+ * the interface identified by %NL80211_ATTR_IFINDEX.
+ * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC
+ * or, if no MAC address given, all mesh paths, on the interface identified
+ * by %NL80211_ATTR_IFINDEX.
+ * @NL80211_CMD_SET_BSS: Set BSS attributes for BSS identified by
+ * %NL80211_ATTR_IFINDEX.
+ *
+ * @NL80211_CMD_GET_REG: ask the wireless core to send us its currently set
+ * regulatory domain.
+ * @NL80211_CMD_SET_REG: Set current regulatory domain. CRDA sends this command
+ * after being queried by the kernel. CRDA replies by sending a regulatory
+ * domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our
+ * current alpha2 if it found a match. It also provides
+ * NL80211_ATTR_REG_RULE_FLAGS, and a set of regulatory rules. Each
+ * regulatory rule is a nested set of attributes given by
+ * %NL80211_ATTR_REG_RULE_FREQ_[START|END] and
+ * %NL80211_ATTR_FREQ_RANGE_MAX_BW with an attached power rule given by
+ * %NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and
+ * %NL80211_ATTR_REG_RULE_POWER_MAX_EIRP.
+ * @NL80211_CMD_REQ_SET_REG: ask the wireless core to set the regulatory domain
+ * to the the specified ISO/IEC 3166-1 alpha2 country code. The core will
+ * store this as a valid request and then query userspace for it.
+ *
+ * @NL80211_CMD_GET_MESH_PARAMS: Get mesh networking properties for the
+ * interface identified by %NL80211_ATTR_IFINDEX
+ *
+ * @NL80211_CMD_SET_MESH_PARAMS: Set mesh networking properties for the
+ * interface identified by %NL80211_ATTR_IFINDEX
+ *
+ * @NL80211_CMD_SET_MGMT_EXTRA_IE: Set extra IEs for management frames. The
+ * interface is identified with %NL80211_ATTR_IFINDEX and the management
+ * frame subtype with %NL80211_ATTR_MGMT_SUBTYPE. The extra IE data to be
+ * added to the end of the specified management frame is specified with
+ * %NL80211_ATTR_IE. If the command succeeds, the requested data will be
+ * added to all specified management frames generated by
+ * kernel/firmware/driver.
+ * Note: This command has been removed and it is only reserved at this
+ * point to avoid re-using existing command number. The functionality this
+ * command was planned for has been provided with cleaner design with the
+ * option to specify additional IEs in NL80211_CMD_TRIGGER_SCAN,
+ * NL80211_CMD_AUTHENTICATE, NL80211_CMD_ASSOCIATE,
+ * NL80211_CMD_DEAUTHENTICATE, and NL80211_CMD_DISASSOCIATE.
+ *
+ * @NL80211_CMD_GET_SCAN: get scan results
+ * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters
+ * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to
+ * NL80211_CMD_GET_SCAN and on the "scan" multicast group)
+ * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons,
+ * partial scan results may be available
+ *
+ * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain
+ * has been changed and provides details of the request information
+ * that caused the change such as who initiated the regulatory request
+ * (%NL80211_ATTR_REG_INITIATOR), the wiphy_idx
+ * (%NL80211_ATTR_REG_ALPHA2) on which the request was made from if
+ * the initiator was %NL80211_REGDOM_SET_BY_COUNTRY_IE or
+ * %NL80211_REGDOM_SET_BY_DRIVER, the type of regulatory domain
+ * set (%NL80211_ATTR_REG_TYPE), if the type of regulatory domain is
+ * %NL80211_REG_TYPE_COUNTRY the alpha2 to which we have moved on
+ * to (%NL80211_ATTR_REG_ALPHA2).
+ *
+ * @NL80211_CMD_AUTHENTICATE: authentication request and notification.
+ * This command is used both as a command (request to authenticate) and
+ * as an event on the "mlme" multicast group indicating completion of the
+ * authentication process.
+ * When used as a command, %NL80211_ATTR_IFINDEX is used to identify the
+ * interface. %NL80211_ATTR_MAC is used to specify PeerSTAAddress (and
+ * BSSID in case of station mode). %NL80211_ATTR_SSID is used to specify
+ * the SSID (mainly for association, but is included in authentication
+ * request, too, to help BSS selection. %NL80211_ATTR_WIPHY_FREQ is used
+ * to specify the frequence of the channel in MHz. %NL80211_ATTR_AUTH_TYPE
+ * is used to specify the authentication type. %NL80211_ATTR_IE is used to
+ * define IEs (VendorSpecificInfo, but also including RSN IE and FT IEs)
+ * to be added to the frame.
+ * When used as an event, this reports reception of an Authentication
+ * frame in station and IBSS modes when the local MLME processed the
+ * frame, i.e., it was for the local STA and was received in correct
+ * state. This is similar to MLME-AUTHENTICATE.confirm primitive in the
+ * MLME SAP interface (kernel providing MLME, userspace SME). The
+ * included NL80211_ATTR_FRAME attribute contains the management frame
+ * (including both the header and frame body, but not FCS).
+ * @NL80211_CMD_ASSOCIATE: association request and notification; like
+ * NL80211_CMD_AUTHENTICATE but for Association and Reassociation
+ * (similar to MLME-ASSOCIATE.request, MLME-REASSOCIATE.request,
+ * MLME-ASSOCIATE.confirm or MLME-REASSOCIATE.confirm primitives).
+ * @NL80211_CMD_DEAUTHENTICATE: deauthentication request and notification; like
+ * NL80211_CMD_AUTHENTICATE but for Deauthentication frames (similar to
+ * MLME-DEAUTHENTICATION.request and MLME-DEAUTHENTICATE.indication
+ * primitives).
+ * @NL80211_CMD_DISASSOCIATE: disassociation request and notification; like
+ * NL80211_CMD_AUTHENTICATE but for Disassociation frames (similar to
+ * MLME-DISASSOCIATE.request and MLME-DISASSOCIATE.indication primitives).
+ *
+ * @NL80211_CMD_MAX: highest used command number
+ * @__NL80211_CMD_AFTER_LAST: internal use
+ */
+enum nl80211_commands {
+/* don't change the order or add anything inbetween, this is ABI! */
+ NL80211_CMD_UNSPEC,
+
+ NL80211_CMD_GET_WIPHY, /* can dump */
+ NL80211_CMD_SET_WIPHY,
+ NL80211_CMD_NEW_WIPHY,
+ NL80211_CMD_DEL_WIPHY,
+
+ NL80211_CMD_GET_INTERFACE, /* can dump */
+ NL80211_CMD_SET_INTERFACE,
+ NL80211_CMD_NEW_INTERFACE,
+ NL80211_CMD_DEL_INTERFACE,
+
+ NL80211_CMD_GET_KEY,
+ NL80211_CMD_SET_KEY,
+ NL80211_CMD_NEW_KEY,
+ NL80211_CMD_DEL_KEY,
+
+ NL80211_CMD_GET_BEACON,
+ NL80211_CMD_SET_BEACON,
+ NL80211_CMD_NEW_BEACON,
+ NL80211_CMD_DEL_BEACON,
+
+ NL80211_CMD_GET_STATION,
+ NL80211_CMD_SET_STATION,
+ NL80211_CMD_NEW_STATION,
+ NL80211_CMD_DEL_STATION,
+
+ NL80211_CMD_GET_MPATH,
+ NL80211_CMD_SET_MPATH,
+ NL80211_CMD_NEW_MPATH,
+ NL80211_CMD_DEL_MPATH,
+
+ NL80211_CMD_SET_BSS,
+
+ NL80211_CMD_SET_REG,
+ NL80211_CMD_REQ_SET_REG,
+
+ NL80211_CMD_GET_MESH_PARAMS,
+ NL80211_CMD_SET_MESH_PARAMS,
+
+ NL80211_CMD_SET_MGMT_EXTRA_IE /* reserved; not used */,
+
+ NL80211_CMD_GET_REG,
+
+ NL80211_CMD_GET_SCAN,
+ NL80211_CMD_TRIGGER_SCAN,
+ NL80211_CMD_NEW_SCAN_RESULTS,
+ NL80211_CMD_SCAN_ABORTED,
+
+ NL80211_CMD_REG_CHANGE,
+
+ NL80211_CMD_AUTHENTICATE,
+ NL80211_CMD_ASSOCIATE,
+ NL80211_CMD_DEAUTHENTICATE,
+ NL80211_CMD_DISASSOCIATE,
+
+ /* add new commands above here */
+
+ /* used to define NL80211_CMD_MAX below */
+ __NL80211_CMD_AFTER_LAST,
+ NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
+};
+
+/*
+ * Allow user space programs to use #ifdef on new commands by defining them
+ * here
+ */
+#define NL80211_CMD_SET_BSS NL80211_CMD_SET_BSS
+#define NL80211_CMD_SET_MGMT_EXTRA_IE NL80211_CMD_SET_MGMT_EXTRA_IE
+#define NL80211_CMD_REG_CHANGE NL80211_CMD_REG_CHANGE
+#define NL80211_CMD_AUTHENTICATE NL80211_CMD_AUTHENTICATE
+#define NL80211_CMD_ASSOCIATE NL80211_CMD_ASSOCIATE
+#define NL80211_CMD_DEAUTHENTICATE NL80211_CMD_DEAUTHENTICATE
+#define NL80211_CMD_DISASSOCIATE NL80211_CMD_DISASSOCIATE
+
+/**
+ * enum nl80211_attrs - nl80211 netlink attributes
+ *
+ * @NL80211_ATTR_UNSPEC: unspecified attribute to catch errors
+ *
+ * @NL80211_ATTR_WIPHY: index of wiphy to operate on, cf.
+ * /sys/class/ieee80211/<phyname>/index
+ * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
+ * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters
+ * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz
+ * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ
+ * if HT20 or HT40 are allowed (i.e., 802.11n disabled if not included):
+ * NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including
+ * this attribute)
+ * NL80211_CHAN_HT20 = HT20 only
+ * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel
+ * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel
+ *
+ * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on
+ * @NL80211_ATTR_IFNAME: network interface name
+ * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype
+ *
+ * @NL80211_ATTR_MAC: MAC address (various uses)
+ *
+ * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of
+ * 16 bytes encryption key followed by 8 bytes each for TX and RX MIC
+ * keys
+ * @NL80211_ATTR_KEY_IDX: key ID (u8, 0-3)
+ * @NL80211_ATTR_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11
+ * section 7.3.2.25.1, e.g. 0x000FAC04)
+ * @NL80211_ATTR_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and
+ * CCMP keys, each six bytes in little endian
+ *
+ * @NL80211_ATTR_BEACON_INTERVAL: beacon interval in TU
+ * @NL80211_ATTR_DTIM_PERIOD: DTIM period for beaconing
+ * @NL80211_ATTR_BEACON_HEAD: portion of the beacon before the TIM IE
+ * @NL80211_ATTR_BEACON_TAIL: portion of the beacon after the TIM IE
+ *
+ * @NL80211_ATTR_STA_AID: Association ID for the station (u16)
+ * @NL80211_ATTR_STA_FLAGS: flags, nested element with NLA_FLAG attributes of
+ * &enum nl80211_sta_flags.
+ * @NL80211_ATTR_STA_LISTEN_INTERVAL: listen interval as defined by
+ * IEEE 802.11 7.3.1.6 (u16).
+ * @NL80211_ATTR_STA_SUPPORTED_RATES: supported rates, array of supported
+ * rates as defined by IEEE 802.11 7.3.2.2 but without the length
+ * restriction (at most %NL80211_MAX_SUPP_RATES).
+ * @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station
+ * to, or the AP interface the station was originally added to to.
+ * @NL80211_ATTR_STA_INFO: information about a station, part of station info
+ * given for %NL80211_CMD_GET_STATION, nested attribute containing
+ * info as possible, see &enum nl80211_sta_info.
+ *
+ * @NL80211_ATTR_WIPHY_BANDS: Information about an operating bands,
+ * consisting of a nested array.
+ *
+ * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes).
+ * @NL80211_ATTR_PLINK_ACTION: action to perform on the mesh peer link.
+ * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path.
+ * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path
+ * info given for %NL80211_CMD_GET_MPATH, nested attribute described at
+ * &enum nl80211_mpath_info.
+ *
+ * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of
+ * &enum nl80211_mntr_flags.
+ *
+ * @NL80211_ATTR_REG_ALPHA2: an ISO-3166-alpha2 country code for which the
+ * current regulatory domain should be set to or is already set to.
+ * For example, 'CR', for Costa Rica. This attribute is used by the kernel
+ * to query the CRDA to retrieve one regulatory domain. This attribute can
+ * also be used by userspace to query the kernel for the currently set
+ * regulatory domain. We chose an alpha2 as that is also used by the
+ * IEEE-802.11d country information element to identify a country.
+ * Users can also simply ask the wireless core to set regulatory domain
+ * to a specific alpha2.
+ * @NL80211_ATTR_REG_RULES: a nested array of regulatory domain regulatory
+ * rules.
+ *
+ * @NL80211_ATTR_BSS_CTS_PROT: whether CTS protection is enabled (u8, 0 or 1)
+ * @NL80211_ATTR_BSS_SHORT_PREAMBLE: whether short preamble is enabled
+ * (u8, 0 or 1)
+ * @NL80211_ATTR_BSS_SHORT_SLOT_TIME: whether short slot time enabled
+ * (u8, 0 or 1)
+ * @NL80211_ATTR_BSS_BASIC_RATES: basic rates, array of basic
+ * rates in format defined by IEEE 802.11 7.3.2.2 but without the length
+ * restriction (at most %NL80211_MAX_SUPP_RATES).
+ *
+ * @NL80211_ATTR_HT_CAPABILITY: HT Capability information element (from
+ * association request when used with NL80211_CMD_NEW_STATION)
+ *
+ * @NL80211_ATTR_SUPPORTED_IFTYPES: nested attribute containing all
+ * supported interface types, each a flag attribute with the number
+ * of the interface mode.
+ *
+ * @NL80211_ATTR_MGMT_SUBTYPE: Management frame subtype for
+ * %NL80211_CMD_SET_MGMT_EXTRA_IE.
+ *
+ * @NL80211_ATTR_IE: Information element(s) data (used, e.g., with
+ * %NL80211_CMD_SET_MGMT_EXTRA_IE).
+ *
+ * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with
+ * a single scan request, a wiphy attribute.
+ *
+ * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz)
+ * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive
+ * scanning and include a zero-length SSID (wildcard) for wildcard scan
+ * @NL80211_ATTR_SCAN_GENERATION: the scan generation increases whenever the
+ * scan result list changes (BSS expired or added) so that applications
+ * can verify that they got a single, consistent snapshot (when all dump
+ * messages carried the same generation number)
+ * @NL80211_ATTR_BSS: scan result BSS
+ *
+ * @NL80211_ATTR_REG_INITIATOR: indicates who requested the regulatory domain
+ * currently in effect. This could be any of the %NL80211_REGDOM_SET_BY_*
+ * @NL80211_ATTR_REG_TYPE: indicates the type of the regulatory domain currently
+ * set. This can be one of the nl80211_reg_type (%NL80211_REGDOM_TYPE_*)
+ *
+ * @NL80211_ATTR_SUPPORTED_COMMANDS: wiphy attribute that specifies
+ * an array of command numbers (i.e. a mapping index to command number)
+ * that the driver for the given wiphy supports.
+ *
+ * @NL80211_ATTR_FRAME: frame data (binary attribute), including frame header
+ * and body, but not FCS; used, e.g., with NL80211_CMD_AUTHENTICATE and
+ * NL80211_CMD_ASSOCIATE events
+ * @NL80211_ATTR_SSID: SSID (binary attribute, 0..32 octets)
+ * @NL80211_ATTR_AUTH_TYPE: AuthenticationType, see &enum nl80211_auth_type,
+ * represented as a u32
+ * @NL80211_ATTR_REASON_CODE: ReasonCode for %NL80211_CMD_DEAUTHENTICATE and
+ * %NL80211_CMD_DISASSOCIATE, u16
+ *
+ * @NL80211_ATTR_MAX: highest attribute number currently defined
+ * @__NL80211_ATTR_AFTER_LAST: internal use
+ */
+enum nl80211_attrs {
+/* don't change the order or add anything inbetween, this is ABI! */
+ NL80211_ATTR_UNSPEC,
+
+ NL80211_ATTR_WIPHY,
+ NL80211_ATTR_WIPHY_NAME,
+
+ NL80211_ATTR_IFINDEX,
+ NL80211_ATTR_IFNAME,
+ NL80211_ATTR_IFTYPE,
+
+ NL80211_ATTR_MAC,
+
+ NL80211_ATTR_KEY_DATA,
+ NL80211_ATTR_KEY_IDX,
+ NL80211_ATTR_KEY_CIPHER,
+ NL80211_ATTR_KEY_SEQ,
+ NL80211_ATTR_KEY_DEFAULT,
+
+ NL80211_ATTR_BEACON_INTERVAL,
+ NL80211_ATTR_DTIM_PERIOD,
+ NL80211_ATTR_BEACON_HEAD,
+ NL80211_ATTR_BEACON_TAIL,
+
+ NL80211_ATTR_STA_AID,
+ NL80211_ATTR_STA_FLAGS,
+ NL80211_ATTR_STA_LISTEN_INTERVAL,
+ NL80211_ATTR_STA_SUPPORTED_RATES,
+ NL80211_ATTR_STA_VLAN,
+ NL80211_ATTR_STA_INFO,
+
+ NL80211_ATTR_WIPHY_BANDS,
+
+ NL80211_ATTR_MNTR_FLAGS,
+
+ NL80211_ATTR_MESH_ID,
+ NL80211_ATTR_STA_PLINK_ACTION,
+ NL80211_ATTR_MPATH_NEXT_HOP,
+ NL80211_ATTR_MPATH_INFO,
+
+ NL80211_ATTR_BSS_CTS_PROT,
+ NL80211_ATTR_BSS_SHORT_PREAMBLE,
+ NL80211_ATTR_BSS_SHORT_SLOT_TIME,
+
+ NL80211_ATTR_HT_CAPABILITY,
+
+ NL80211_ATTR_SUPPORTED_IFTYPES,
+
+ NL80211_ATTR_REG_ALPHA2,
+ NL80211_ATTR_REG_RULES,
+
+ NL80211_ATTR_MESH_PARAMS,
+
+ NL80211_ATTR_BSS_BASIC_RATES,
+
+ NL80211_ATTR_WIPHY_TXQ_PARAMS,
+ NL80211_ATTR_WIPHY_FREQ,
+ NL80211_ATTR_WIPHY_CHANNEL_TYPE,
+
+ NL80211_ATTR_KEY_DEFAULT_MGMT,
+
+ NL80211_ATTR_MGMT_SUBTYPE,
+ NL80211_ATTR_IE,
+
+ NL80211_ATTR_MAX_NUM_SCAN_SSIDS,
+
+ NL80211_ATTR_SCAN_FREQUENCIES,
+ NL80211_ATTR_SCAN_SSIDS,
+ NL80211_ATTR_SCAN_GENERATION,
+ NL80211_ATTR_BSS,
+
+ NL80211_ATTR_REG_INITIATOR,
+ NL80211_ATTR_REG_TYPE,
+
+ NL80211_ATTR_SUPPORTED_COMMANDS,
+
+ NL80211_ATTR_FRAME,
+ NL80211_ATTR_SSID,
+ NL80211_ATTR_AUTH_TYPE,
+ NL80211_ATTR_REASON_CODE,
+
+ /* add attributes here, update the policy in nl80211.c */
+
+ __NL80211_ATTR_AFTER_LAST,
+ NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
+};
+
+/*
+ * Allow user space programs to use #ifdef on new attributes by defining them
+ * here
+ */
+#define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY
+#define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES
+#define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS
+#define NL80211_ATTR_WIPHY_FREQ NL80211_ATTR_WIPHY_FREQ
+#define NL80211_ATTR_WIPHY_CHANNEL_TYPE NL80211_ATTR_WIPHY_CHANNEL_TYPE
+#define NL80211_ATTR_MGMT_SUBTYPE NL80211_ATTR_MGMT_SUBTYPE
+#define NL80211_ATTR_IE NL80211_ATTR_IE
+#define NL80211_ATTR_REG_INITIATOR NL80211_ATTR_REG_INITIATOR
+#define NL80211_ATTR_REG_TYPE NL80211_ATTR_REG_TYPE
+#define NL80211_ATTR_FRAME NL80211_ATTR_FRAME
+#define NL80211_ATTR_SSID NL80211_ATTR_SSID
+#define NL80211_ATTR_AUTH_TYPE NL80211_ATTR_AUTH_TYPE
+#define NL80211_ATTR_REASON_CODE NL80211_ATTR_REASON_CODE
+
+#define NL80211_MAX_SUPP_RATES 32
+#define NL80211_MAX_SUPP_REG_RULES 32
+#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0
+#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16
+#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24
+#define NL80211_HT_CAPABILITY_LEN 26
+
+/**
+ * enum nl80211_iftype - (virtual) interface types
+ *
+ * @NL80211_IFTYPE_UNSPECIFIED: unspecified type, driver decides
+ * @NL80211_IFTYPE_ADHOC: independent BSS member
+ * @NL80211_IFTYPE_STATION: managed BSS member
+ * @NL80211_IFTYPE_AP: access point
+ * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points
+ * @NL80211_IFTYPE_WDS: wireless distribution interface
+ * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
+ * @NL80211_IFTYPE_MESH_POINT: mesh point
+ * @NL80211_IFTYPE_MAX: highest interface type number currently defined
+ * @__NL80211_IFTYPE_AFTER_LAST: internal use
+ *
+ * These values are used with the %NL80211_ATTR_IFTYPE
+ * to set the type of an interface.
+ *
+ */
+enum nl80211_iftype {
+ NL80211_IFTYPE_UNSPECIFIED,
+ NL80211_IFTYPE_ADHOC,
+ NL80211_IFTYPE_STATION,
+ NL80211_IFTYPE_AP,
+ NL80211_IFTYPE_AP_VLAN,
+ NL80211_IFTYPE_WDS,
+ NL80211_IFTYPE_MONITOR,
+ NL80211_IFTYPE_MESH_POINT,
+
+ /* keep last */
+ __NL80211_IFTYPE_AFTER_LAST,
+ NL80211_IFTYPE_MAX = __NL80211_IFTYPE_AFTER_LAST - 1
+};
+
+/**
+ * enum nl80211_sta_flags - station flags
+ *
+ * Station flags. When a station is added to an AP interface, it is
+ * assumed to be already associated (and hence authenticated.)
+ *
+ * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X)
+ * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
+ * with short barker preamble
+ * @NL80211_STA_FLAG_WME: station is WME/QoS capable
+ * @NL80211_STA_FLAG_MFP: station uses management frame protection
+ */
+enum nl80211_sta_flags {
+ __NL80211_STA_FLAG_INVALID,
+ NL80211_STA_FLAG_AUTHORIZED,
+ NL80211_STA_FLAG_SHORT_PREAMBLE,
+ NL80211_STA_FLAG_WME,
+ NL80211_STA_FLAG_MFP,
+
+ /* keep last */
+ __NL80211_STA_FLAG_AFTER_LAST,
+ NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1
+};
+
+/**
+ * enum nl80211_rate_info - bitrate information
+ *
+ * These attribute types are used with %NL80211_STA_INFO_TXRATE
+ * when getting information about the bitrate of a station.
+ *
+ * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved
+ * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s)
+ * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8)
+ * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 Mhz dualchannel bitrate
+ * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval
+ * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined
+ * @__NL80211_RATE_INFO_AFTER_LAST: internal use
+ */
+enum nl80211_rate_info {
+ __NL80211_RATE_INFO_INVALID,
+ NL80211_RATE_INFO_BITRATE,
+ NL80211_RATE_INFO_MCS,
+ NL80211_RATE_INFO_40_MHZ_WIDTH,
+ NL80211_RATE_INFO_SHORT_GI,
+
+ /* keep last */
+ __NL80211_RATE_INFO_AFTER_LAST,
+ NL80211_RATE_INFO_MAX = __NL80211_RATE_INFO_AFTER_LAST - 1
+};
+
+/**
+ * enum nl80211_sta_info - station information
+ *
+ * These attribute types are used with %NL80211_ATTR_STA_INFO
+ * when getting information about a station.
+ *
+ * @__NL80211_STA_INFO_INVALID: attribute number 0 is reserved
+ * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs)
+ * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station)
+ * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station)
+ * @__NL80211_STA_INFO_AFTER_LAST: internal
+ * @NL80211_STA_INFO_MAX: highest possible station info attribute
+ * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm)
+ * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute
+ * containing info as possible, see &enum nl80211_sta_info_txrate.
+ * @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station)
+ * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this
+ * station)
+ */
+enum nl80211_sta_info {
+ __NL80211_STA_INFO_INVALID,
+ NL80211_STA_INFO_INACTIVE_TIME,
+ NL80211_STA_INFO_RX_BYTES,
+ NL80211_STA_INFO_TX_BYTES,
+ NL80211_STA_INFO_LLID,
+ NL80211_STA_INFO_PLID,
+ NL80211_STA_INFO_PLINK_STATE,
+ NL80211_STA_INFO_SIGNAL,
+ NL80211_STA_INFO_TX_BITRATE,
+ NL80211_STA_INFO_RX_PACKETS,
+ NL80211_STA_INFO_TX_PACKETS,
+
+ /* keep last */
+ __NL80211_STA_INFO_AFTER_LAST,
+ NL80211_STA_INFO_MAX = __NL80211_STA_INFO_AFTER_LAST - 1
+};
+
+/**
+ * enum nl80211_mpath_flags - nl80211 mesh path flags
+ *
+ * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active
+ * @NL80211_MPATH_FLAG_RESOLVING: the mesh path discovery process is running
+ * @NL80211_MPATH_FLAG_DSN_VALID: the mesh path contains a valid DSN
+ * @NL80211_MPATH_FLAG_FIXED: the mesh path has been manually set
+ * @NL80211_MPATH_FLAG_RESOLVED: the mesh path discovery process succeeded
+ */
+enum nl80211_mpath_flags {
+ NL80211_MPATH_FLAG_ACTIVE = 1<<0,
+ NL80211_MPATH_FLAG_RESOLVING = 1<<1,
+ NL80211_MPATH_FLAG_DSN_VALID = 1<<2,
+ NL80211_MPATH_FLAG_FIXED = 1<<3,
+ NL80211_MPATH_FLAG_RESOLVED = 1<<4,
+};
+
+/**
+ * enum nl80211_mpath_info - mesh path information
+ *
+ * These attribute types are used with %NL80211_ATTR_MPATH_INFO when getting
+ * information about a mesh path.
+ *
+ * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved
+ * @NL80211_ATTR_MPATH_FRAME_QLEN: number of queued frames for this destination
+ * @NL80211_ATTR_MPATH_DSN: destination sequence number
+ * @NL80211_ATTR_MPATH_METRIC: metric (cost) of this mesh path
+ * @NL80211_ATTR_MPATH_EXPTIME: expiration time for the path, in msec from now
+ * @NL80211_ATTR_MPATH_FLAGS: mesh path flags, enumerated in
+ * &enum nl80211_mpath_flags;
+ * @NL80211_ATTR_MPATH_DISCOVERY_TIMEOUT: total path discovery timeout, in msec
+ * @NL80211_ATTR_MPATH_DISCOVERY_RETRIES: mesh path discovery retries
+ */
+enum nl80211_mpath_info {
+ __NL80211_MPATH_INFO_INVALID,
+ NL80211_MPATH_INFO_FRAME_QLEN,
+ NL80211_MPATH_INFO_DSN,
+ NL80211_MPATH_INFO_METRIC,
+ NL80211_MPATH_INFO_EXPTIME,
+ NL80211_MPATH_INFO_FLAGS,
+ NL80211_MPATH_INFO_DISCOVERY_TIMEOUT,
+ NL80211_MPATH_INFO_DISCOVERY_RETRIES,
+
+ /* keep last */
+ __NL80211_MPATH_INFO_AFTER_LAST,
+ NL80211_MPATH_INFO_MAX = __NL80211_MPATH_INFO_AFTER_LAST - 1
+};
+
+/**
+ * enum nl80211_band_attr - band attributes
+ * @__NL80211_BAND_ATTR_INVALID: attribute number 0 is reserved
+ * @NL80211_BAND_ATTR_FREQS: supported frequencies in this band,
+ * an array of nested frequency attributes
+ * @NL80211_BAND_ATTR_RATES: supported bitrates in this band,
+ * an array of nested bitrate attributes
+ * @NL80211_BAND_ATTR_HT_MCS_SET: 16-byte attribute containing the MCS set as
+ * defined in 802.11n
+ * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE
+ * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n
+ * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n
+ */
+enum nl80211_band_attr {
+ __NL80211_BAND_ATTR_INVALID,
+ NL80211_BAND_ATTR_FREQS,
+ NL80211_BAND_ATTR_RATES,
+
+ NL80211_BAND_ATTR_HT_MCS_SET,
+ NL80211_BAND_ATTR_HT_CAPA,
+ NL80211_BAND_ATTR_HT_AMPDU_FACTOR,
+ NL80211_BAND_ATTR_HT_AMPDU_DENSITY,
+
+ /* keep last */
+ __NL80211_BAND_ATTR_AFTER_LAST,
+ NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
+};
+
+#define NL80211_BAND_ATTR_HT_CAPA NL80211_BAND_ATTR_HT_CAPA
+
+/**
+ * enum nl80211_frequency_attr - frequency attributes
+ * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
+ * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
+ * regulatory domain.
+ * @NL80211_FREQUENCY_ATTR_PASSIVE_SCAN: Only passive scanning is
+ * permitted on this channel in current regulatory domain.
+ * @NL80211_FREQUENCY_ATTR_NO_IBSS: IBSS networks are not permitted
+ * on this channel in current regulatory domain.
+ * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
+ * on this channel in current regulatory domain.
+ * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
+ * (100 * dBm).
+ */
+enum nl80211_frequency_attr {
+ __NL80211_FREQUENCY_ATTR_INVALID,
+ NL80211_FREQUENCY_ATTR_FREQ,
+ NL80211_FREQUENCY_ATTR_DISABLED,
+ NL80211_FREQUENCY_ATTR_PASSIVE_SCAN,
+ NL80211_FREQUENCY_ATTR_NO_IBSS,
+ NL80211_FREQUENCY_ATTR_RADAR,
+ NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
+
+ /* keep last */
+ __NL80211_FREQUENCY_ATTR_AFTER_LAST,
+ NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1
+};
+
+#define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER
+
+/**
+ * enum nl80211_bitrate_attr - bitrate attributes
+ * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps
+ * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported
+ * in 2.4 GHz band.
+ */
+enum nl80211_bitrate_attr {
+ __NL80211_BITRATE_ATTR_INVALID,
+ NL80211_BITRATE_ATTR_RATE,
+ NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE,
+
+ /* keep last */
+ __NL80211_BITRATE_ATTR_AFTER_LAST,
+ NL80211_BITRATE_ATTR_MAX = __NL80211_BITRATE_ATTR_AFTER_LAST - 1
+};
+
+/**
+ * enum nl80211_initiator - Indicates the initiator of a reg domain request
+ * @NL80211_REGDOM_SET_BY_CORE: Core queried CRDA for a dynamic world
+ * regulatory domain.
+ * @NL80211_REGDOM_SET_BY_USER: User asked the wireless core to set the
+ * regulatory domain.
+ * @NL80211_REGDOM_SET_BY_DRIVER: a wireless drivers has hinted to the
+ * wireless core it thinks its knows the regulatory domain we should be in.
+ * @NL80211_REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an
+ * 802.11 country information element with regulatory information it
+ * thinks we should consider.
+ */
+enum nl80211_reg_initiator {
+ NL80211_REGDOM_SET_BY_CORE,
+ NL80211_REGDOM_SET_BY_USER,
+ NL80211_REGDOM_SET_BY_DRIVER,
+ NL80211_REGDOM_SET_BY_COUNTRY_IE,
+};
+
+/**
+ * enum nl80211_reg_type - specifies the type of regulatory domain
+ * @NL80211_REGDOM_TYPE_COUNTRY: the regulatory domain set is one that pertains
+ * to a specific country. When this is set you can count on the
+ * ISO / IEC 3166 alpha2 country code being valid.
+ * @NL80211_REGDOM_TYPE_WORLD: the regulatory set domain is the world regulatory
+ * domain.
+ * @NL80211_REGDOM_TYPE_CUSTOM_WORLD: the regulatory domain set is a custom
+ * driver specific world regulatory domain. These do not apply system-wide
+ * and are only applicable to the individual devices which have requested
+ * them to be applied.
+ * @NL80211_REGDOM_TYPE_INTERSECTION: the regulatory domain set is the product
+ * of an intersection between two regulatory domains -- the previously
+ * set regulatory domain on the system and the last accepted regulatory
+ * domain request to be processed.
+ */
+enum nl80211_reg_type {
+ NL80211_REGDOM_TYPE_COUNTRY,
+ NL80211_REGDOM_TYPE_WORLD,
+ NL80211_REGDOM_TYPE_CUSTOM_WORLD,
+ NL80211_REGDOM_TYPE_INTERSECTION,
+};
+
+/**
+ * enum nl80211_reg_rule_attr - regulatory rule attributes
+ * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional
+ * considerations for a given frequency range. These are the
+ * &enum nl80211_reg_rule_flags.
+ * @NL80211_ATTR_FREQ_RANGE_START: starting frequencry for the regulatory
+ * rule in KHz. This is not a center of frequency but an actual regulatory
+ * band edge.
+ * @NL80211_ATTR_FREQ_RANGE_END: ending frequency for the regulatory rule
+ * in KHz. This is not a center a frequency but an actual regulatory
+ * band edge.
+ * @NL80211_ATTR_FREQ_RANGE_MAX_BW: maximum allowed bandwidth for this
+ * frequency range, in KHz.
+ * @NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN: the maximum allowed antenna gain
+ * for a given frequency range. The value is in mBi (100 * dBi).
+ * If you don't have one then don't send this.
+ * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for
+ * a given frequency range. The value is in mBm (100 * dBm).
+ */
+enum nl80211_reg_rule_attr {
+ __NL80211_REG_RULE_ATTR_INVALID,
+ NL80211_ATTR_REG_RULE_FLAGS,
+
+ NL80211_ATTR_FREQ_RANGE_START,
+ NL80211_ATTR_FREQ_RANGE_END,
+ NL80211_ATTR_FREQ_RANGE_MAX_BW,
+
+ NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN,
+ NL80211_ATTR_POWER_RULE_MAX_EIRP,
+
+ /* keep last */
+ __NL80211_REG_RULE_ATTR_AFTER_LAST,
+ NL80211_REG_RULE_ATTR_MAX = __NL80211_REG_RULE_ATTR_AFTER_LAST - 1
+};
+
+/**
+ * enum nl80211_reg_rule_flags - regulatory rule flags
+ *
+ * @NL80211_RRF_NO_OFDM: OFDM modulation not allowed
+ * @NL80211_RRF_NO_CCK: CCK modulation not allowed
+ * @NL80211_RRF_NO_INDOOR: indoor operation not allowed
+ * @NL80211_RRF_NO_OUTDOOR: outdoor operation not allowed
+ * @NL80211_RRF_DFS: DFS support is required to be used
+ * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links
+ * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links
+ * @NL80211_RRF_PASSIVE_SCAN: passive scan is required
+ * @NL80211_RRF_NO_IBSS: no IBSS is allowed
+ */
+enum nl80211_reg_rule_flags {
+ NL80211_RRF_NO_OFDM = 1<<0,
+ NL80211_RRF_NO_CCK = 1<<1,
+ NL80211_RRF_NO_INDOOR = 1<<2,
+ NL80211_RRF_NO_OUTDOOR = 1<<3,
+ NL80211_RRF_DFS = 1<<4,
+ NL80211_RRF_PTP_ONLY = 1<<5,
+ NL80211_RRF_PTMP_ONLY = 1<<6,
+ NL80211_RRF_PASSIVE_SCAN = 1<<7,
+ NL80211_RRF_NO_IBSS = 1<<8,
+};
+
+/**
+ * enum nl80211_mntr_flags - monitor configuration flags
+ *
+ * Monitor configuration flags.
+ *
+ * @__NL80211_MNTR_FLAG_INVALID: reserved
+ *
+ * @NL80211_MNTR_FLAG_FCSFAIL: pass frames with bad FCS
+ * @NL80211_MNTR_FLAG_PLCPFAIL: pass frames with bad PLCP
+ * @NL80211_MNTR_FLAG_CONTROL: pass control frames
+ * @NL80211_MNTR_FLAG_OTHER_BSS: disable BSSID filtering
+ * @NL80211_MNTR_FLAG_COOK_FRAMES: report frames after processing.
+ * overrides all other flags.
+ *
+ * @__NL80211_MNTR_FLAG_AFTER_LAST: internal use
+ * @NL80211_MNTR_FLAG_MAX: highest possible monitor flag
+ */
+enum nl80211_mntr_flags {
+ __NL80211_MNTR_FLAG_INVALID,
+ NL80211_MNTR_FLAG_FCSFAIL,
+ NL80211_MNTR_FLAG_PLCPFAIL,
+ NL80211_MNTR_FLAG_CONTROL,
+ NL80211_MNTR_FLAG_OTHER_BSS,
+ NL80211_MNTR_FLAG_COOK_FRAMES,
+
+ /* keep last */
+ __NL80211_MNTR_FLAG_AFTER_LAST,
+ NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1
+};
+
+/**
+ * enum nl80211_meshconf_params - mesh configuration parameters
+ *
+ * Mesh configuration parameters
+ *
+ * @__NL80211_MESHCONF_INVALID: internal use
+ *
+ * @NL80211_MESHCONF_RETRY_TIMEOUT: specifies the initial retry timeout in
+ * millisecond units, used by the Peer Link Open message
+ *
+ * @NL80211_MESHCONF_CONFIRM_TIMEOUT: specifies the inital confirm timeout, in
+ * millisecond units, used by the peer link management to close a peer link
+ *
+ * @NL80211_MESHCONF_HOLDING_TIMEOUT: specifies the holding timeout, in
+ * millisecond units
+ *
+ * @NL80211_MESHCONF_MAX_PEER_LINKS: maximum number of peer links allowed
+ * on this mesh interface
+ *
+ * @NL80211_MESHCONF_MAX_RETRIES: specifies the maximum number of peer link
+ * open retries that can be sent to establish a new peer link instance in a
+ * mesh
+ *
+ * @NL80211_MESHCONF_TTL: specifies the value of TTL field set at a source mesh
+ * point.
+ *
+ * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically
+ * open peer links when we detect compatible mesh peers.
+ *
+ * @NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES: the number of action frames
+ * containing a PREQ that an MP can send to a particular destination (path
+ * target)
+ *
+ * @NL80211_MESHCONF_PATH_REFRESH_TIME: how frequently to refresh mesh paths
+ * (in milliseconds)
+ *
+ * @NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT: minimum length of time to wait
+ * until giving up on a path discovery (in milliseconds)
+ *
+ * @NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT: The time (in TUs) for which mesh
+ * points receiving a PREQ shall consider the forwarding information from the
+ * root to be valid. (TU = time unit)
+ *
+ * @NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL: The minimum interval of time (in
+ * TUs) during which an MP can send only one action frame containing a PREQ
+ * reference element
+ *
+ * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs)
+ * that it takes for an HWMP information element to propagate across the mesh
+ *
+ * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute
+ *
+ * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
+ */
+enum nl80211_meshconf_params {
+ __NL80211_MESHCONF_INVALID,
+ NL80211_MESHCONF_RETRY_TIMEOUT,
+ NL80211_MESHCONF_CONFIRM_TIMEOUT,
+ NL80211_MESHCONF_HOLDING_TIMEOUT,
+ NL80211_MESHCONF_MAX_PEER_LINKS,
+ NL80211_MESHCONF_MAX_RETRIES,
+ NL80211_MESHCONF_TTL,
+ NL80211_MESHCONF_AUTO_OPEN_PLINKS,
+ NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES,
+ NL80211_MESHCONF_PATH_REFRESH_TIME,
+ NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT,
+ NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT,
+ NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL,
+ NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME,
+
+ /* keep last */
+ __NL80211_MESHCONF_ATTR_AFTER_LAST,
+ NL80211_MESHCONF_ATTR_MAX = __NL80211_MESHCONF_ATTR_AFTER_LAST - 1
+};
+
+/**
+ * enum nl80211_txq_attr - TX queue parameter attributes
+ * @__NL80211_TXQ_ATTR_INVALID: Attribute number 0 is reserved
+ * @NL80211_TXQ_ATTR_QUEUE: TX queue identifier (NL80211_TXQ_Q_*)
+ * @NL80211_TXQ_ATTR_TXOP: Maximum burst time in units of 32 usecs, 0 meaning
+ * disabled
+ * @NL80211_TXQ_ATTR_CWMIN: Minimum contention window [a value of the form
+ * 2^n-1 in the range 1..32767]
+ * @NL80211_TXQ_ATTR_CWMAX: Maximum contention window [a value of the form
+ * 2^n-1 in the range 1..32767]
+ * @NL80211_TXQ_ATTR_AIFS: Arbitration interframe space [0..255]
+ * @__NL80211_TXQ_ATTR_AFTER_LAST: Internal
+ * @NL80211_TXQ_ATTR_MAX: Maximum TXQ attribute number
+ */
+enum nl80211_txq_attr {
+ __NL80211_TXQ_ATTR_INVALID,
+ NL80211_TXQ_ATTR_QUEUE,
+ NL80211_TXQ_ATTR_TXOP,
+ NL80211_TXQ_ATTR_CWMIN,
+ NL80211_TXQ_ATTR_CWMAX,
+ NL80211_TXQ_ATTR_AIFS,
+
+ /* keep last */
+ __NL80211_TXQ_ATTR_AFTER_LAST,
+ NL80211_TXQ_ATTR_MAX = __NL80211_TXQ_ATTR_AFTER_LAST - 1
+};
+
+enum nl80211_txq_q {
+ NL80211_TXQ_Q_VO,
+ NL80211_TXQ_Q_VI,
+ NL80211_TXQ_Q_BE,
+ NL80211_TXQ_Q_BK
+};
+
+enum nl80211_channel_type {
+ NL80211_CHAN_NO_HT,
+ NL80211_CHAN_HT20,
+ NL80211_CHAN_HT40MINUS,
+ NL80211_CHAN_HT40PLUS
+};
+
+/**
+ * enum nl80211_bss - netlink attributes for a BSS
+ *
+ * @__NL80211_BSS_INVALID: invalid
+ * @NL80211_BSS_FREQUENCY: frequency in MHz (u32)
+ * @NL80211_BSS_TSF: TSF of the received probe response/beacon (u64)
+ * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16)
+ * @NL80211_BSS_CAPABILITY: capability field (CPU order, u16)
+ * @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the
+ * raw information elements from the probe response/beacon (bin)
+ * @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon
+ * in mBm (100 * dBm) (s32)
+ * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon
+ * in unspecified units, scaled to 0..100 (u8)
+ * @__NL80211_BSS_AFTER_LAST: internal
+ * @NL80211_BSS_MAX: highest BSS attribute
+ */
+enum nl80211_bss {
+ __NL80211_BSS_INVALID,
+ NL80211_BSS_BSSID,
+ NL80211_BSS_FREQUENCY,
+ NL80211_BSS_TSF,
+ NL80211_BSS_BEACON_INTERVAL,
+ NL80211_BSS_CAPABILITY,
+ NL80211_BSS_INFORMATION_ELEMENTS,
+ NL80211_BSS_SIGNAL_MBM,
+ NL80211_BSS_SIGNAL_UNSPEC,
+
+ /* keep last */
+ __NL80211_BSS_AFTER_LAST,
+ NL80211_BSS_MAX = __NL80211_BSS_AFTER_LAST - 1
+};
+
+/**
+ * enum nl80211_auth_type - AuthenticationType
+ *
+ * @NL80211_AUTHTYPE_OPEN_SYSTEM: Open System authentication
+ * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only)
+ * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r)
+ * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP)
+ */
+enum nl80211_auth_type {
+ NL80211_AUTHTYPE_OPEN_SYSTEM,
+ NL80211_AUTHTYPE_SHARED_KEY,
+ NL80211_AUTHTYPE_FT,
+ NL80211_AUTHTYPE_NETWORK_EAP,
+};
+#endif /* __LINUX_NL80211_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nubus.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nubus.h
new file mode 100644
index 0000000..60b03e4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nubus.h
@@ -0,0 +1,244 @@
+/*
+ nubus.h: various definitions and prototypes for NuBus drivers to use.
+
+ Originally written by Alan Cox.
+
+ Hacked to death by C. Scott Ananian and David Huggins-Daines.
+
+ Some of the constants in here are from the corresponding
+ NetBSD/OpenBSD header file, by Allen Briggs. We figured out the
+ rest of them on our own. */
+
+#ifndef LINUX_NUBUS_H
+#define LINUX_NUBUS_H
+
+#include <linux/types.h>
+
+enum nubus_category {
+ NUBUS_CAT_BOARD = 0x0001,
+ NUBUS_CAT_DISPLAY = 0x0003,
+ NUBUS_CAT_NETWORK = 0x0004,
+ NUBUS_CAT_COMMUNICATIONS = 0x0006,
+ NUBUS_CAT_FONT = 0x0009,
+ NUBUS_CAT_CPU = 0x000A,
+ /* For lack of a better name */
+ NUBUS_CAT_DUODOCK = 0x0020
+};
+
+enum nubus_type_network {
+ NUBUS_TYPE_ETHERNET = 0x0001,
+ NUBUS_TYPE_RS232 = 0x0002
+};
+
+enum nubus_type_display {
+ NUBUS_TYPE_VIDEO = 0x0001
+};
+
+enum nubus_type_cpu {
+ NUBUS_TYPE_68020 = 0x0003,
+ NUBUS_TYPE_68030 = 0x0004,
+ NUBUS_TYPE_68040 = 0x0005
+};
+
+/* Known <Cat,Type,SW,HW> tuples: (according to TattleTech and Slots)
+ * 68030 motherboards: <10,4,0,24>
+ * 68040 motherboards: <10,5,0,24>
+ * DuoDock Plus: <32,1,1,2>
+ *
+ * Toby Frame Buffer card: <3,1,1,1>
+ * RBV built-in video (IIci): <3,1,1,24>
+ * Valkyrie built-in video (Q630): <3,1,1,46>
+ * Macintosh Display Card: <3,1,1,25>
+ * Sonora built-in video (P460): <3,1,1,34>
+ * Jet framebuffer (DuoDock Plus): <3,1,1,41>
+ *
+ * SONIC comm-slot/on-board and DuoDock Ethernet: <4,1,1,272>
+ * SONIC LC-PDS Ethernet (Dayna, but like Apple 16-bit, sort of): <4,1,1,271>
+ * Apple SONIC LC-PDS Ethernet ("Apple Ethernet LC Twisted-Pair Card"): <4,1,0,281>
+ * Sonic Systems Ethernet A-Series Card: <4,1,268,256>
+ * Asante MacCon NuBus-A: <4,1,260,256> (alpha-1.0,1.1 revision)
+ * ROM on the above card: <2,1,0,0>
+ * Cabletron ethernet card: <4,1,1,265>
+ * Farallon ethernet card: <4,1,268,256> (identical to Sonic Systems card)
+ * Kinetics EtherPort IIN: <4,1,259,262>
+ * API Engineering EtherRun_LCa PDS enet card: <4,1,282,256>
+ *
+ * Add your devices to the list! You can obtain the "Slots" utility
+ * from Apple's FTP site at:
+ * ftp://dev.apple.com/devworld/Tool_Chest/Devices_-_Hardware/NuBus_Slot_Manager/
+ *
+ * Alternately, TattleTech can be found at any Info-Mac mirror site.
+ * or from its distribution site: ftp://ftp.decismkr.com/dms
+ */
+
+/* DrSW: Uniquely identifies the software interface to a board. This
+ is usually the one you want to look at when writing a driver. It's
+ not as useful as you think, though, because as we should know by
+ now (duh), "Apple Compatible" can mean a lot of things... */
+
+/* Add known DrSW values here */
+enum nubus_drsw {
+ /* NUBUS_CAT_DISPLAY */
+ NUBUS_DRSW_APPLE = 0x0001,
+ NUBUS_DRSW_APPLE_HIRES = 0x0013, /* MacII HiRes card driver */
+
+ /* NUBUS_CAT_NETWORK */
+ NUBUS_DRSW_3COM = 0x0000,
+ NUBUS_DRSW_CABLETRON = 0x0001,
+ NUBUS_DRSW_SONIC_LC = 0x0001,
+ NUBUS_DRSW_KINETICS = 0x0103,
+ NUBUS_DRSW_ASANTE = 0x0104,
+ NUBUS_DRSW_TECHWORKS = 0x0109,
+ NUBUS_DRSW_DAYNA = 0x010b,
+ NUBUS_DRSW_FARALLON = 0x010c,
+ NUBUS_DRSW_APPLE_SN = 0x010f,
+ NUBUS_DRSW_DAYNA2 = 0x0115,
+ NUBUS_DRSW_FOCUS = 0x011a,
+ NUBUS_DRSW_ASANTE_CS = 0x011d, /* use asante SMC9194 driver */
+ NUBUS_DRSW_DAYNA_LC = 0x011e,
+
+ /* NUBUS_CAT_CPU */
+ NUBUS_DRSW_NONE = 0x0000,
+};
+
+/* DrHW: Uniquely identifies the hardware interface to a board (or at
+ least, it should... some video cards are known to incorrectly
+ identify themselves as Toby cards) */
+
+/* Add known DrHW values here */
+enum nubus_drhw {
+ /* NUBUS_CAT_DISPLAY */
+ NUBUS_DRHW_APPLE_TFB = 0x0001, /* Toby frame buffer card */
+ NUBUS_DRHW_APPLE_WVC = 0x0006, /* Apple Workstation Video Card */
+ NUBUS_DRHW_SIGMA_CLRMAX = 0x0007, /* Sigma Design ColorMax */
+ NUBUS_DRHW_APPLE_SE30 = 0x0009, /* Apple SE/30 video */
+ NUBUS_DRHW_APPLE_HRVC = 0x0013, /* Mac II High-Res Video Card */
+ NUBUS_DRHW_APPLE_PVC = 0x0017, /* Mac II Portrait Video Card */
+ NUBUS_DRHW_APPLE_RBV1 = 0x0018, /* IIci RBV video */
+ NUBUS_DRHW_APPLE_MDC = 0x0019, /* Macintosh Display Card */
+ NUBUS_DRHW_APPLE_SONORA = 0x0022, /* Sonora built-in video */
+ NUBUS_DRHW_APPLE_24AC = 0x002b, /* Mac 24AC Video Card */
+ NUBUS_DRHW_APPLE_VALKYRIE = 0x002e,
+ NUBUS_DRHW_APPLE_JET = 0x0029, /* Jet framebuffer (DuoDock) */
+ NUBUS_DRHW_SMAC_GFX = 0x0105, /* SuperMac GFX */
+ NUBUS_DRHW_RASTER_CB264 = 0x013B, /* RasterOps ColorBoard 264 */
+ NUBUS_DRHW_MICRON_XCEED = 0x0146, /* Micron Exceed color */
+ NUBUS_DRHW_RDIUS_GSC = 0x0153, /* Radius GS/C */
+ NUBUS_DRHW_SMAC_SPEC8 = 0x017B, /* SuperMac Spectrum/8 */
+ NUBUS_DRHW_SMAC_SPEC24 = 0x017C, /* SuperMac Spectrum/24 */
+ NUBUS_DRHW_RASTER_CB364 = 0x026F, /* RasterOps ColorBoard 364 */
+ NUBUS_DRHW_RDIUS_DCGX = 0x027C, /* Radius DirectColor/GX */
+ NUBUS_DRHW_RDIUS_PC8 = 0x0291, /* Radius PrecisionColor 8 */
+ NUBUS_DRHW_LAPIS_PCS8 = 0x0292, /* Lapis ProColorServer 8 */
+ NUBUS_DRHW_RASTER_24XLI = 0x02A0, /* RasterOps 8/24 XLi */
+ NUBUS_DRHW_RASTER_PBPGT = 0x02A5, /* RasterOps PaintBoard Prism GT */
+ NUBUS_DRHW_EMACH_FSX = 0x02AE, /* E-Machines Futura SX */
+ NUBUS_DRHW_RASTER_24XLTV = 0x02B7, /* RasterOps 24XLTV */
+ NUBUS_DRHW_SMAC_THUND24 = 0x02CB, /* SuperMac Thunder/24 */
+ NUBUS_DRHW_SMAC_THUNDLGHT = 0x03D9, /* SuperMac ThunderLight */
+ NUBUS_DRHW_RDIUS_PC24XP = 0x0406, /* Radius PrecisionColor 24Xp */
+ NUBUS_DRHW_RDIUS_PC24X = 0x040A, /* Radius PrecisionColor 24X */
+ NUBUS_DRHW_RDIUS_PC8XJ = 0x040B, /* Radius PrecisionColor 8XJ */
+
+ /* NUBUS_CAT_NETWORK */
+ NUBUS_DRHW_INTERLAN = 0x0100,
+ NUBUS_DRHW_SMC9194 = 0x0101,
+ NUBUS_DRHW_KINETICS = 0x0106,
+ NUBUS_DRHW_CABLETRON = 0x0109,
+ NUBUS_DRHW_ASANTE_LC = 0x010f,
+ NUBUS_DRHW_SONIC = 0x0110,
+ NUBUS_DRHW_TECHWORKS = 0x0112,
+ NUBUS_DRHW_APPLE_SONIC_NB = 0x0118,
+ NUBUS_DRHW_APPLE_SONIC_LC = 0x0119,
+ NUBUS_DRHW_FOCUS = 0x011c,
+ NUBUS_DRHW_SONNET = 0x011d,
+};
+
+/* Resource IDs: These are the identifiers for the various weird and
+ wonderful tidbits of information that may or may not reside in the
+ NuBus ROM directory. */
+enum nubus_res_id {
+ NUBUS_RESID_TYPE = 0x0001,
+ NUBUS_RESID_NAME = 0x0002,
+ NUBUS_RESID_ICON = 0x0003,
+ NUBUS_RESID_DRVRDIR = 0x0004,
+ NUBUS_RESID_LOADREC = 0x0005,
+ NUBUS_RESID_BOOTREC = 0x0006,
+ NUBUS_RESID_FLAGS = 0x0007,
+ NUBUS_RESID_HWDEVID = 0x0008,
+ NUBUS_RESID_MINOR_BASEOS = 0x000a,
+ NUBUS_RESID_MINOR_LENGTH = 0x000b,
+ NUBUS_RESID_MAJOR_BASEOS = 0x000c,
+ NUBUS_RESID_MAJOR_LENGTH = 0x000d,
+ NUBUS_RESID_CICN = 0x000f,
+ NUBUS_RESID_ICL8 = 0x0010,
+ NUBUS_RESID_ICL4 = 0x0011,
+};
+
+/* Category-specific resources. */
+enum nubus_board_res_id {
+ NUBUS_RESID_BOARDID = 0x0020,
+ NUBUS_RESID_PRAMINITDATA = 0x0021,
+ NUBUS_RESID_PRIMARYINIT = 0x0022,
+ NUBUS_RESID_TIMEOUTCONST = 0x0023,
+ NUBUS_RESID_VENDORINFO = 0x0024,
+ NUBUS_RESID_BOARDFLAGS = 0x0025,
+ NUBUS_RESID_SECONDINIT = 0x0026,
+
+ /* Not sure why Apple put these next two in here */
+ NUBUS_RESID_VIDNAMES = 0x0041,
+ NUBUS_RESID_VIDMODES = 0x007e
+};
+
+/* Fields within the vendor info directory */
+enum nubus_vendor_res_id {
+ NUBUS_RESID_VEND_ID = 0x0001,
+ NUBUS_RESID_VEND_SERIAL = 0x0002,
+ NUBUS_RESID_VEND_REV = 0x0003,
+ NUBUS_RESID_VEND_PART = 0x0004,
+ NUBUS_RESID_VEND_DATE = 0x0005
+};
+
+enum nubus_net_res_id {
+ NUBUS_RESID_MAC_ADDRESS = 0x0080
+};
+
+enum nubus_cpu_res_id {
+ NUBUS_RESID_MEMINFO = 0x0081,
+ NUBUS_RESID_ROMINFO = 0x0082
+};
+
+enum nubus_display_res_id {
+ NUBUS_RESID_GAMMADIR = 0x0040,
+ NUBUS_RESID_FIRSTMODE = 0x0080,
+ NUBUS_RESID_SECONDMODE = 0x0081,
+ NUBUS_RESID_THIRDMODE = 0x0082,
+ NUBUS_RESID_FOURTHMODE = 0x0083,
+ NUBUS_RESID_FIFTHMODE = 0x0084,
+ NUBUS_RESID_SIXTHMODE = 0x0085
+};
+
+struct nubus_dir
+{
+ unsigned char *base;
+ unsigned char *ptr;
+ int done;
+ int mask;
+};
+
+struct nubus_dirent
+{
+ unsigned char *base;
+ unsigned char type;
+ __u32 data; /* Actually 24bits used */
+ int mask;
+};
+
+
+/* We'd like to get rid of this eventually. Only daynaport.c uses it now. */
+static __inline__ void *nubus_slot_addr(int slot)
+{
+ return (void *)(0xF0000000|(slot<<24));
+}
+
+#endif /* LINUX_NUBUS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nvram.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nvram.h
new file mode 100644
index 0000000..fbaa10e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/nvram.h
@@ -0,0 +1,16 @@
+#ifndef _LINUX_NVRAM_H
+#define _LINUX_NVRAM_H
+
+#include <linux/ioctl.h>
+
+/* /dev/nvram ioctls */
+#define NVRAM_INIT _IO('p', 0x40) /* initialize NVRAM and set checksum */
+#define NVRAM_SETCKS _IO('p', 0x41) /* recalculate checksum */
+
+/* for all current systems, this is where NVRAM starts */
+#define NVRAM_FIRST_BYTE 14
+/* all these functions expect an NVRAM offset, not an absolute */
+#define NVRAM_OFFSET(x) ((x)-NVRAM_FIRST_BYTE)
+
+
+#endif /* _LINUX_NVRAM_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/oom.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/oom.h
new file mode 100644
index 0000000..d7727b8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/oom.h
@@ -0,0 +1,10 @@
+#ifndef __INCLUDE_LINUX_OOM_H
+#define __INCLUDE_LINUX_OOM_H
+
+/* /proc/<pid>/oom_adj set to -17 protects from the oom-killer */
+#define OOM_DISABLE (-17)
+/* inclusive */
+#define OOM_ADJUST_MIN (-16)
+#define OOM_ADJUST_MAX 15
+
+#endif /* _INCLUDE_LINUX_OOM_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/param.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/param.h
new file mode 100644
index 0000000..092e92f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/param.h
@@ -0,0 +1,6 @@
+#ifndef _LINUX_PARAM_H
+#define _LINUX_PARAM_H
+
+#include <asm/param.h>
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/parport.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/parport.h
new file mode 100644
index 0000000..4cd4442
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/parport.h
@@ -0,0 +1,95 @@
+/*
+ * Any part of this program may be used in documents licensed under
+ * the GNU Free Documentation License, Version 1.1 or any later version
+ * published by the Free Software Foundation.
+ */
+
+#ifndef _PARPORT_H_
+#define _PARPORT_H_
+
+/* Start off with user-visible constants */
+
+/* Maximum of 16 ports per machine */
+#define PARPORT_MAX 16
+
+/* Magic numbers */
+#define PARPORT_IRQ_NONE -1
+#define PARPORT_DMA_NONE -1
+#define PARPORT_IRQ_AUTO -2
+#define PARPORT_DMA_AUTO -2
+#define PARPORT_DMA_NOFIFO -3
+#define PARPORT_DISABLE -2
+#define PARPORT_IRQ_PROBEONLY -3
+#define PARPORT_IOHI_AUTO -1
+
+#define PARPORT_CONTROL_STROBE 0x1
+#define PARPORT_CONTROL_AUTOFD 0x2
+#define PARPORT_CONTROL_INIT 0x4
+#define PARPORT_CONTROL_SELECT 0x8
+
+#define PARPORT_STATUS_ERROR 0x8
+#define PARPORT_STATUS_SELECT 0x10
+#define PARPORT_STATUS_PAPEROUT 0x20
+#define PARPORT_STATUS_ACK 0x40
+#define PARPORT_STATUS_BUSY 0x80
+
+/* Type classes for Plug-and-Play probe. */
+typedef enum {
+ PARPORT_CLASS_LEGACY = 0, /* Non-IEEE1284 device */
+ PARPORT_CLASS_PRINTER,
+ PARPORT_CLASS_MODEM,
+ PARPORT_CLASS_NET,
+ PARPORT_CLASS_HDC, /* Hard disk controller */
+ PARPORT_CLASS_PCMCIA,
+ PARPORT_CLASS_MEDIA, /* Multimedia device */
+ PARPORT_CLASS_FDC, /* Floppy disk controller */
+ PARPORT_CLASS_PORTS,
+ PARPORT_CLASS_SCANNER,
+ PARPORT_CLASS_DIGCAM,
+ PARPORT_CLASS_OTHER, /* Anything else */
+ PARPORT_CLASS_UNSPEC, /* No CLS field in ID */
+ PARPORT_CLASS_SCSIADAPTER
+} parport_device_class;
+
+/* The "modes" entry in parport is a bit field representing the
+ capabilities of the hardware. */
+#define PARPORT_MODE_PCSPP (1<<0) /* IBM PC registers available. */
+#define PARPORT_MODE_TRISTATE (1<<1) /* Can tristate. */
+#define PARPORT_MODE_EPP (1<<2) /* Hardware EPP. */
+#define PARPORT_MODE_ECP (1<<3) /* Hardware ECP. */
+#define PARPORT_MODE_COMPAT (1<<4) /* Hardware 'printer protocol'. */
+#define PARPORT_MODE_DMA (1<<5) /* Hardware can DMA. */
+#define PARPORT_MODE_SAFEININT (1<<6) /* SPP registers accessible in IRQ. */
+
+/* IEEE1284 modes:
+ Nibble mode, byte mode, ECP, ECPRLE and EPP are their own
+ 'extensibility request' values. Others are special.
+ 'Real' ECP modes must have the IEEE1284_MODE_ECP bit set. */
+#define IEEE1284_MODE_NIBBLE 0
+#define IEEE1284_MODE_BYTE (1<<0)
+#define IEEE1284_MODE_COMPAT (1<<8)
+#define IEEE1284_MODE_BECP (1<<9) /* Bounded ECP mode */
+#define IEEE1284_MODE_ECP (1<<4)
+#define IEEE1284_MODE_ECPRLE (IEEE1284_MODE_ECP | (1<<5))
+#define IEEE1284_MODE_ECPSWE (1<<10) /* Software-emulated */
+#define IEEE1284_MODE_EPP (1<<6)
+#define IEEE1284_MODE_EPPSL (1<<11) /* EPP 1.7 */
+#define IEEE1284_MODE_EPPSWE (1<<12) /* Software-emulated */
+#define IEEE1284_DEVICEID (1<<2) /* This is a flag */
+#define IEEE1284_EXT_LINK (1<<14) /* This flag causes the
+ * extensibility link to
+ * be requested, using
+ * bits 0-6. */
+
+/* For the benefit of parport_read/write, you can use these with
+ * parport_negotiate to use address operations. They have no effect
+ * other than to make parport_read/write use address transfers. */
+#define IEEE1284_ADDR (1<<13) /* This is a flag */
+#define IEEE1284_DATA 0 /* So is this */
+
+/* Flags for block transfer operations. */
+#define PARPORT_EPP_FAST (1<<0) /* Unreliable counts. */
+#define PARPORT_W91284PIC (1<<1) /* have a Warp9 w91284pic in the device */
+
+/* The rest is for the kernel only */
+#endif /* _PARPORT_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/patchkey.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/patchkey.h
new file mode 100644
index 0000000..23810dd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/patchkey.h
@@ -0,0 +1,33 @@
+/*
+ * <linux/patchkey.h> -- definition of _PATCHKEY macro
+ *
+ * Copyright (C) 2005 Stuart Brady
+ *
+ * This exists because awe_voice.h defined its own _PATCHKEY and it wasn't
+ * clear whether removing this would break anything in userspace.
+ *
+ * Do not include this file directly. Please use <sys/soundcard.h> instead.
+ * For kernel code, use <linux/soundcard.h>
+ */
+
+#ifndef _LINUX_PATCHKEY_H_INDIRECT
+#error "patchkey.h included directly"
+#endif
+
+#ifndef _LINUX_PATCHKEY_H
+#define _LINUX_PATCHKEY_H
+
+/* Endian macros. */
+# include <endian.h>
+
+#if defined(__BYTE_ORDER)
+# if __BYTE_ORDER == __BIG_ENDIAN
+# define _PATCHKEY(id) (0xfd00|id)
+# elif __BYTE_ORDER == __LITTLE_ENDIAN
+# define _PATCHKEY(id) ((id<<8)|0x00fd)
+# else
+# error "could not determine byte order"
+# endif
+#endif
+
+#endif /* _LINUX_PATCHKEY_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pci.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pci.h
new file mode 100644
index 0000000..a5bb5c7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pci.h
@@ -0,0 +1,41 @@
+/*
+ * pci.h
+ *
+ * PCI defines and function prototypes
+ * Copyright 1994, Drew Eckhardt
+ * Copyright 1997--1999 Martin Mares <mj@ucw.cz>
+ *
+ * For more information, please consult the following manuals (look at
+ * http://www.pcisig.com/ for how to get them):
+ *
+ * PCI BIOS Specification
+ * PCI Local Bus Specification
+ * PCI to PCI Bridge Specification
+ * PCI System Design Guide
+ */
+
+#ifndef LINUX_PCI_H
+#define LINUX_PCI_H
+
+#include <linux/pci_regs.h> /* The pci register defines */
+
+/*
+ * The PCI interface treats multi-function devices as independent
+ * devices. The slot/function address of each device is encoded
+ * in a single byte as follows:
+ *
+ * 7:3 = slot
+ * 2:0 = function
+ */
+#define PCI_DEVFN(slot, func) ((((slot) & 0x1f) << 3) | ((func) & 0x07))
+#define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f)
+#define PCI_FUNC(devfn) ((devfn) & 0x07)
+
+/* Ioctls for /proc/bus/pci/X/Y nodes. */
+#define PCIIOC_BASE ('P' << 24 | 'C' << 16 | 'I' << 8)
+#define PCIIOC_CONTROLLER (PCIIOC_BASE | 0x00) /* Get controller for PCI device. */
+#define PCIIOC_MMAP_IS_IO (PCIIOC_BASE | 0x01) /* Set mmap state to I/O space. */
+#define PCIIOC_MMAP_IS_MEM (PCIIOC_BASE | 0x02) /* Set mmap state to MEM space. */
+#define PCIIOC_WRITE_COMBINE (PCIIOC_BASE | 0x03) /* Enable/disable write-combining. */
+
+#endif /* LINUX_PCI_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pci_regs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pci_regs.h
new file mode 100644
index 0000000..616bf8b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pci_regs.h
@@ -0,0 +1,654 @@
+/*
+ * pci_regs.h
+ *
+ * PCI standard defines
+ * Copyright 1994, Drew Eckhardt
+ * Copyright 1997--1999 Martin Mares <mj@ucw.cz>
+ *
+ * For more information, please consult the following manuals (look at
+ * http://www.pcisig.com/ for how to get them):
+ *
+ * PCI BIOS Specification
+ * PCI Local Bus Specification
+ * PCI to PCI Bridge Specification
+ * PCI System Design Guide
+ *
+ * For hypertransport information, please consult the following manuals
+ * from http://www.hypertransport.org
+ *
+ * The Hypertransport I/O Link Specification
+ */
+
+#ifndef LINUX_PCI_REGS_H
+#define LINUX_PCI_REGS_H
+
+/*
+ * Under PCI, each device has 256 bytes of configuration address space,
+ * of which the first 64 bytes are standardized as follows:
+ */
+#define PCI_VENDOR_ID 0x00 /* 16 bits */
+#define PCI_DEVICE_ID 0x02 /* 16 bits */
+#define PCI_COMMAND 0x04 /* 16 bits */
+#define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */
+#define PCI_COMMAND_MEMORY 0x2 /* Enable response in Memory space */
+#define PCI_COMMAND_MASTER 0x4 /* Enable bus mastering */
+#define PCI_COMMAND_SPECIAL 0x8 /* Enable response to special cycles */
+#define PCI_COMMAND_INVALIDATE 0x10 /* Use memory write and invalidate */
+#define PCI_COMMAND_VGA_PALETTE 0x20 /* Enable palette snooping */
+#define PCI_COMMAND_PARITY 0x40 /* Enable parity checking */
+#define PCI_COMMAND_WAIT 0x80 /* Enable address/data stepping */
+#define PCI_COMMAND_SERR 0x100 /* Enable SERR */
+#define PCI_COMMAND_FAST_BACK 0x200 /* Enable back-to-back writes */
+#define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */
+
+#define PCI_STATUS 0x06 /* 16 bits */
+#define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */
+#define PCI_STATUS_66MHZ 0x20 /* Support 66 Mhz PCI 2.1 bus */
+#define PCI_STATUS_UDF 0x40 /* Support User Definable Features [obsolete] */
+#define PCI_STATUS_FAST_BACK 0x80 /* Accept fast-back to back */
+#define PCI_STATUS_PARITY 0x100 /* Detected parity error */
+#define PCI_STATUS_DEVSEL_MASK 0x600 /* DEVSEL timing */
+#define PCI_STATUS_DEVSEL_FAST 0x000
+#define PCI_STATUS_DEVSEL_MEDIUM 0x200
+#define PCI_STATUS_DEVSEL_SLOW 0x400
+#define PCI_STATUS_SIG_TARGET_ABORT 0x800 /* Set on target abort */
+#define PCI_STATUS_REC_TARGET_ABORT 0x1000 /* Master ack of " */
+#define PCI_STATUS_REC_MASTER_ABORT 0x2000 /* Set on master abort */
+#define PCI_STATUS_SIG_SYSTEM_ERROR 0x4000 /* Set when we drive SERR */
+#define PCI_STATUS_DETECTED_PARITY 0x8000 /* Set on parity error */
+
+#define PCI_CLASS_REVISION 0x08 /* High 24 bits are class, low 8 revision */
+#define PCI_REVISION_ID 0x08 /* Revision ID */
+#define PCI_CLASS_PROG 0x09 /* Reg. Level Programming Interface */
+#define PCI_CLASS_DEVICE 0x0a /* Device class */
+
+#define PCI_CACHE_LINE_SIZE 0x0c /* 8 bits */
+#define PCI_LATENCY_TIMER 0x0d /* 8 bits */
+#define PCI_HEADER_TYPE 0x0e /* 8 bits */
+#define PCI_HEADER_TYPE_NORMAL 0
+#define PCI_HEADER_TYPE_BRIDGE 1
+#define PCI_HEADER_TYPE_CARDBUS 2
+
+#define PCI_BIST 0x0f /* 8 bits */
+#define PCI_BIST_CODE_MASK 0x0f /* Return result */
+#define PCI_BIST_START 0x40 /* 1 to start BIST, 2 secs or less */
+#define PCI_BIST_CAPABLE 0x80 /* 1 if BIST capable */
+
+/*
+ * Base addresses specify locations in memory or I/O space.
+ * Decoded size can be determined by writing a value of
+ * 0xffffffff to the register, and reading it back. Only
+ * 1 bits are decoded.
+ */
+#define PCI_BASE_ADDRESS_0 0x10 /* 32 bits */
+#define PCI_BASE_ADDRESS_1 0x14 /* 32 bits [htype 0,1 only] */
+#define PCI_BASE_ADDRESS_2 0x18 /* 32 bits [htype 0 only] */
+#define PCI_BASE_ADDRESS_3 0x1c /* 32 bits */
+#define PCI_BASE_ADDRESS_4 0x20 /* 32 bits */
+#define PCI_BASE_ADDRESS_5 0x24 /* 32 bits */
+#define PCI_BASE_ADDRESS_SPACE 0x01 /* 0 = memory, 1 = I/O */
+#define PCI_BASE_ADDRESS_SPACE_IO 0x01
+#define PCI_BASE_ADDRESS_SPACE_MEMORY 0x00
+#define PCI_BASE_ADDRESS_MEM_TYPE_MASK 0x06
+#define PCI_BASE_ADDRESS_MEM_TYPE_32 0x00 /* 32 bit address */
+#define PCI_BASE_ADDRESS_MEM_TYPE_1M 0x02 /* Below 1M [obsolete] */
+#define PCI_BASE_ADDRESS_MEM_TYPE_64 0x04 /* 64 bit address */
+#define PCI_BASE_ADDRESS_MEM_PREFETCH 0x08 /* prefetchable? */
+#define PCI_BASE_ADDRESS_MEM_MASK (~0x0fUL)
+#define PCI_BASE_ADDRESS_IO_MASK (~0x03UL)
+/* bit 1 is reserved if address_space = 1 */
+
+/* Header type 0 (normal devices) */
+#define PCI_CARDBUS_CIS 0x28
+#define PCI_SUBSYSTEM_VENDOR_ID 0x2c
+#define PCI_SUBSYSTEM_ID 0x2e
+#define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */
+#define PCI_ROM_ADDRESS_ENABLE 0x01
+#define PCI_ROM_ADDRESS_MASK (~0x7ffUL)
+
+#define PCI_CAPABILITY_LIST 0x34 /* Offset of first capability list entry */
+
+/* 0x35-0x3b are reserved */
+#define PCI_INTERRUPT_LINE 0x3c /* 8 bits */
+#define PCI_INTERRUPT_PIN 0x3d /* 8 bits */
+#define PCI_MIN_GNT 0x3e /* 8 bits */
+#define PCI_MAX_LAT 0x3f /* 8 bits */
+
+/* Header type 1 (PCI-to-PCI bridges) */
+#define PCI_PRIMARY_BUS 0x18 /* Primary bus number */
+#define PCI_SECONDARY_BUS 0x19 /* Secondary bus number */
+#define PCI_SUBORDINATE_BUS 0x1a /* Highest bus number behind the bridge */
+#define PCI_SEC_LATENCY_TIMER 0x1b /* Latency timer for secondary interface */
+#define PCI_IO_BASE 0x1c /* I/O range behind the bridge */
+#define PCI_IO_LIMIT 0x1d
+#define PCI_IO_RANGE_TYPE_MASK 0x0fUL /* I/O bridging type */
+#define PCI_IO_RANGE_TYPE_16 0x00
+#define PCI_IO_RANGE_TYPE_32 0x01
+#define PCI_IO_RANGE_MASK (~0x0fUL)
+#define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */
+#define PCI_MEMORY_BASE 0x20 /* Memory range behind */
+#define PCI_MEMORY_LIMIT 0x22
+#define PCI_MEMORY_RANGE_TYPE_MASK 0x0fUL
+#define PCI_MEMORY_RANGE_MASK (~0x0fUL)
+#define PCI_PREF_MEMORY_BASE 0x24 /* Prefetchable memory range behind */
+#define PCI_PREF_MEMORY_LIMIT 0x26
+#define PCI_PREF_RANGE_TYPE_MASK 0x0fUL
+#define PCI_PREF_RANGE_TYPE_32 0x00
+#define PCI_PREF_RANGE_TYPE_64 0x01
+#define PCI_PREF_RANGE_MASK (~0x0fUL)
+#define PCI_PREF_BASE_UPPER32 0x28 /* Upper half of prefetchable memory range */
+#define PCI_PREF_LIMIT_UPPER32 0x2c
+#define PCI_IO_BASE_UPPER16 0x30 /* Upper half of I/O addresses */
+#define PCI_IO_LIMIT_UPPER16 0x32
+/* 0x34 same as for htype 0 */
+/* 0x35-0x3b is reserved */
+#define PCI_ROM_ADDRESS1 0x38 /* Same as PCI_ROM_ADDRESS, but for htype 1 */
+/* 0x3c-0x3d are same as for htype 0 */
+#define PCI_BRIDGE_CONTROL 0x3e
+#define PCI_BRIDGE_CTL_PARITY 0x01 /* Enable parity detection on secondary interface */
+#define PCI_BRIDGE_CTL_SERR 0x02 /* The same for SERR forwarding */
+#define PCI_BRIDGE_CTL_ISA 0x04 /* Enable ISA mode */
+#define PCI_BRIDGE_CTL_VGA 0x08 /* Forward VGA addresses */
+#define PCI_BRIDGE_CTL_MASTER_ABORT 0x20 /* Report master aborts */
+#define PCI_BRIDGE_CTL_BUS_RESET 0x40 /* Secondary bus reset */
+#define PCI_BRIDGE_CTL_FAST_BACK 0x80 /* Fast Back2Back enabled on secondary interface */
+
+/* Header type 2 (CardBus bridges) */
+#define PCI_CB_CAPABILITY_LIST 0x14
+/* 0x15 reserved */
+#define PCI_CB_SEC_STATUS 0x16 /* Secondary status */
+#define PCI_CB_PRIMARY_BUS 0x18 /* PCI bus number */
+#define PCI_CB_CARD_BUS 0x19 /* CardBus bus number */
+#define PCI_CB_SUBORDINATE_BUS 0x1a /* Subordinate bus number */
+#define PCI_CB_LATENCY_TIMER 0x1b /* CardBus latency timer */
+#define PCI_CB_MEMORY_BASE_0 0x1c
+#define PCI_CB_MEMORY_LIMIT_0 0x20
+#define PCI_CB_MEMORY_BASE_1 0x24
+#define PCI_CB_MEMORY_LIMIT_1 0x28
+#define PCI_CB_IO_BASE_0 0x2c
+#define PCI_CB_IO_BASE_0_HI 0x2e
+#define PCI_CB_IO_LIMIT_0 0x30
+#define PCI_CB_IO_LIMIT_0_HI 0x32
+#define PCI_CB_IO_BASE_1 0x34
+#define PCI_CB_IO_BASE_1_HI 0x36
+#define PCI_CB_IO_LIMIT_1 0x38
+#define PCI_CB_IO_LIMIT_1_HI 0x3a
+#define PCI_CB_IO_RANGE_MASK (~0x03UL)
+/* 0x3c-0x3d are same as for htype 0 */
+#define PCI_CB_BRIDGE_CONTROL 0x3e
+#define PCI_CB_BRIDGE_CTL_PARITY 0x01 /* Similar to standard bridge control register */
+#define PCI_CB_BRIDGE_CTL_SERR 0x02
+#define PCI_CB_BRIDGE_CTL_ISA 0x04
+#define PCI_CB_BRIDGE_CTL_VGA 0x08
+#define PCI_CB_BRIDGE_CTL_MASTER_ABORT 0x20
+#define PCI_CB_BRIDGE_CTL_CB_RESET 0x40 /* CardBus reset */
+#define PCI_CB_BRIDGE_CTL_16BIT_INT 0x80 /* Enable interrupt for 16-bit cards */
+#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 0x100 /* Prefetch enable for both memory regions */
+#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM1 0x200
+#define PCI_CB_BRIDGE_CTL_POST_WRITES 0x400
+#define PCI_CB_SUBSYSTEM_VENDOR_ID 0x40
+#define PCI_CB_SUBSYSTEM_ID 0x42
+#define PCI_CB_LEGACY_MODE_BASE 0x44 /* 16-bit PC Card legacy mode base address (ExCa) */
+/* 0x48-0x7f reserved */
+
+/* Capability lists */
+
+#define PCI_CAP_LIST_ID 0 /* Capability ID */
+#define PCI_CAP_ID_PM 0x01 /* Power Management */
+#define PCI_CAP_ID_AGP 0x02 /* Accelerated Graphics Port */
+#define PCI_CAP_ID_VPD 0x03 /* Vital Product Data */
+#define PCI_CAP_ID_SLOTID 0x04 /* Slot Identification */
+#define PCI_CAP_ID_MSI 0x05 /* Message Signalled Interrupts */
+#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */
+#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */
+#define PCI_CAP_ID_HT 0x08 /* HyperTransport */
+#define PCI_CAP_ID_VNDR 0x09 /* Vendor specific */
+#define PCI_CAP_ID_DBG 0x0A /* Debug port */
+#define PCI_CAP_ID_CCRC 0x0B /* CompactPCI Central Resource Control */
+#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */
+#define PCI_CAP_ID_SSVID 0x0D /* Bridge subsystem vendor/device ID */
+#define PCI_CAP_ID_AGP3 0x0E /* AGP Target PCI-PCI bridge */
+#define PCI_CAP_ID_EXP 0x10 /* PCI Express */
+#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */
+#define PCI_CAP_ID_AF 0x13 /* PCI Advanced Features */
+#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */
+#define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */
+#define PCI_CAP_SIZEOF 4
+
+/* Power Management Registers */
+
+#define PCI_PM_PMC 2 /* PM Capabilities Register */
+#define PCI_PM_CAP_VER_MASK 0x0007 /* Version */
+#define PCI_PM_CAP_PME_CLOCK 0x0008 /* PME clock required */
+#define PCI_PM_CAP_RESERVED 0x0010 /* Reserved field */
+#define PCI_PM_CAP_DSI 0x0020 /* Device specific initialization */
+#define PCI_PM_CAP_AUX_POWER 0x01C0 /* Auxilliary power support mask */
+#define PCI_PM_CAP_D1 0x0200 /* D1 power state support */
+#define PCI_PM_CAP_D2 0x0400 /* D2 power state support */
+#define PCI_PM_CAP_PME 0x0800 /* PME pin supported */
+#define PCI_PM_CAP_PME_MASK 0xF800 /* PME Mask of all supported states */
+#define PCI_PM_CAP_PME_D0 0x0800 /* PME# from D0 */
+#define PCI_PM_CAP_PME_D1 0x1000 /* PME# from D1 */
+#define PCI_PM_CAP_PME_D2 0x2000 /* PME# from D2 */
+#define PCI_PM_CAP_PME_D3 0x4000 /* PME# from D3 (hot) */
+#define PCI_PM_CAP_PME_D3cold 0x8000 /* PME# from D3 (cold) */
+#define PCI_PM_CAP_PME_SHIFT 11 /* Start of the PME Mask in PMC */
+#define PCI_PM_CTRL 4 /* PM control and status register */
+#define PCI_PM_CTRL_STATE_MASK 0x0003 /* Current power state (D0 to D3) */
+#define PCI_PM_CTRL_NO_SOFT_RESET 0x0008 /* No reset for D3hot->D0 */
+#define PCI_PM_CTRL_PME_ENABLE 0x0100 /* PME pin enable */
+#define PCI_PM_CTRL_DATA_SEL_MASK 0x1e00 /* Data select (??) */
+#define PCI_PM_CTRL_DATA_SCALE_MASK 0x6000 /* Data scale (??) */
+#define PCI_PM_CTRL_PME_STATUS 0x8000 /* PME pin status */
+#define PCI_PM_PPB_EXTENSIONS 6 /* PPB support extensions (??) */
+#define PCI_PM_PPB_B2_B3 0x40 /* Stop clock when in D3hot (??) */
+#define PCI_PM_BPCC_ENABLE 0x80 /* Bus power/clock control enable (??) */
+#define PCI_PM_DATA_REGISTER 7 /* (??) */
+#define PCI_PM_SIZEOF 8
+
+/* AGP registers */
+
+#define PCI_AGP_VERSION 2 /* BCD version number */
+#define PCI_AGP_RFU 3 /* Rest of capability flags */
+#define PCI_AGP_STATUS 4 /* Status register */
+#define PCI_AGP_STATUS_RQ_MASK 0xff000000 /* Maximum number of requests - 1 */
+#define PCI_AGP_STATUS_SBA 0x0200 /* Sideband addressing supported */
+#define PCI_AGP_STATUS_64BIT 0x0020 /* 64-bit addressing supported */
+#define PCI_AGP_STATUS_FW 0x0010 /* FW transfers supported */
+#define PCI_AGP_STATUS_RATE4 0x0004 /* 4x transfer rate supported */
+#define PCI_AGP_STATUS_RATE2 0x0002 /* 2x transfer rate supported */
+#define PCI_AGP_STATUS_RATE1 0x0001 /* 1x transfer rate supported */
+#define PCI_AGP_COMMAND 8 /* Control register */
+#define PCI_AGP_COMMAND_RQ_MASK 0xff000000 /* Master: Maximum number of requests */
+#define PCI_AGP_COMMAND_SBA 0x0200 /* Sideband addressing enabled */
+#define PCI_AGP_COMMAND_AGP 0x0100 /* Allow processing of AGP transactions */
+#define PCI_AGP_COMMAND_64BIT 0x0020 /* Allow processing of 64-bit addresses */
+#define PCI_AGP_COMMAND_FW 0x0010 /* Force FW transfers */
+#define PCI_AGP_COMMAND_RATE4 0x0004 /* Use 4x rate */
+#define PCI_AGP_COMMAND_RATE2 0x0002 /* Use 2x rate */
+#define PCI_AGP_COMMAND_RATE1 0x0001 /* Use 1x rate */
+#define PCI_AGP_SIZEOF 12
+
+/* Vital Product Data */
+
+#define PCI_VPD_ADDR 2 /* Address to access (15 bits!) */
+#define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */
+#define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */
+#define PCI_VPD_DATA 4 /* 32-bits of data returned here */
+
+/* Slot Identification */
+
+#define PCI_SID_ESR 2 /* Expansion Slot Register */
+#define PCI_SID_ESR_NSLOTS 0x1f /* Number of expansion slots available */
+#define PCI_SID_ESR_FIC 0x20 /* First In Chassis Flag */
+#define PCI_SID_CHASSIS_NR 3 /* Chassis Number */
+
+/* Message Signalled Interrupts registers */
+
+#define PCI_MSI_FLAGS 2 /* Various flags */
+#define PCI_MSI_FLAGS_64BIT 0x80 /* 64-bit addresses allowed */
+#define PCI_MSI_FLAGS_QSIZE 0x70 /* Message queue size configured */
+#define PCI_MSI_FLAGS_QMASK 0x0e /* Maximum queue size available */
+#define PCI_MSI_FLAGS_ENABLE 0x01 /* MSI feature enabled */
+#define PCI_MSI_FLAGS_MASKBIT 0x100 /* 64-bit mask bits allowed */
+#define PCI_MSI_RFU 3 /* Rest of capability flags */
+#define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */
+#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */
+#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */
+#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */
+#define PCI_MSI_MASK_BIT 16 /* Mask bits register */
+
+/* MSI-X registers (these are at offset PCI_MSIX_FLAGS) */
+#define PCI_MSIX_FLAGS 2
+#define PCI_MSIX_FLAGS_QSIZE 0x7FF
+#define PCI_MSIX_FLAGS_ENABLE (1 << 15)
+#define PCI_MSIX_FLAGS_MASKALL (1 << 14)
+#define PCI_MSIX_FLAGS_BIRMASK (7 << 0)
+#define PCI_MSIX_FLAGS_BITMASK (1 << 0)
+
+/* CompactPCI Hotswap Register */
+
+#define PCI_CHSWP_CSR 2 /* Control and Status Register */
+#define PCI_CHSWP_DHA 0x01 /* Device Hiding Arm */
+#define PCI_CHSWP_EIM 0x02 /* ENUM# Signal Mask */
+#define PCI_CHSWP_PIE 0x04 /* Pending Insert or Extract */
+#define PCI_CHSWP_LOO 0x08 /* LED On / Off */
+#define PCI_CHSWP_PI 0x30 /* Programming Interface */
+#define PCI_CHSWP_EXT 0x40 /* ENUM# status - extraction */
+#define PCI_CHSWP_INS 0x80 /* ENUM# status - insertion */
+
+/* PCI Advanced Feature registers */
+
+#define PCI_AF_LENGTH 2
+#define PCI_AF_CAP 3
+#define PCI_AF_CAP_TP 0x01
+#define PCI_AF_CAP_FLR 0x02
+#define PCI_AF_CTRL 4
+#define PCI_AF_CTRL_FLR 0x01
+#define PCI_AF_STATUS 5
+#define PCI_AF_STATUS_TP 0x01
+
+/* PCI-X registers */
+
+#define PCI_X_CMD 2 /* Modes & Features */
+#define PCI_X_CMD_DPERR_E 0x0001 /* Data Parity Error Recovery Enable */
+#define PCI_X_CMD_ERO 0x0002 /* Enable Relaxed Ordering */
+#define PCI_X_CMD_READ_512 0x0000 /* 512 byte maximum read byte count */
+#define PCI_X_CMD_READ_1K 0x0004 /* 1Kbyte maximum read byte count */
+#define PCI_X_CMD_READ_2K 0x0008 /* 2Kbyte maximum read byte count */
+#define PCI_X_CMD_READ_4K 0x000c /* 4Kbyte maximum read byte count */
+#define PCI_X_CMD_MAX_READ 0x000c /* Max Memory Read Byte Count */
+ /* Max # of outstanding split transactions */
+#define PCI_X_CMD_SPLIT_1 0x0000 /* Max 1 */
+#define PCI_X_CMD_SPLIT_2 0x0010 /* Max 2 */
+#define PCI_X_CMD_SPLIT_3 0x0020 /* Max 3 */
+#define PCI_X_CMD_SPLIT_4 0x0030 /* Max 4 */
+#define PCI_X_CMD_SPLIT_8 0x0040 /* Max 8 */
+#define PCI_X_CMD_SPLIT_12 0x0050 /* Max 12 */
+#define PCI_X_CMD_SPLIT_16 0x0060 /* Max 16 */
+#define PCI_X_CMD_SPLIT_32 0x0070 /* Max 32 */
+#define PCI_X_CMD_MAX_SPLIT 0x0070 /* Max Outstanding Split Transactions */
+#define PCI_X_CMD_VERSION(x) (((x) >> 12) & 3) /* Version */
+#define PCI_X_STATUS 4 /* PCI-X capabilities */
+#define PCI_X_STATUS_DEVFN 0x000000ff /* A copy of devfn */
+#define PCI_X_STATUS_BUS 0x0000ff00 /* A copy of bus nr */
+#define PCI_X_STATUS_64BIT 0x00010000 /* 64-bit device */
+#define PCI_X_STATUS_133MHZ 0x00020000 /* 133 MHz capable */
+#define PCI_X_STATUS_SPL_DISC 0x00040000 /* Split Completion Discarded */
+#define PCI_X_STATUS_UNX_SPL 0x00080000 /* Unexpected Split Completion */
+#define PCI_X_STATUS_COMPLEX 0x00100000 /* Device Complexity */
+#define PCI_X_STATUS_MAX_READ 0x00600000 /* Designed Max Memory Read Count */
+#define PCI_X_STATUS_MAX_SPLIT 0x03800000 /* Designed Max Outstanding Split Transactions */
+#define PCI_X_STATUS_MAX_CUM 0x1c000000 /* Designed Max Cumulative Read Size */
+#define PCI_X_STATUS_SPL_ERR 0x20000000 /* Rcvd Split Completion Error Msg */
+#define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */
+#define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */
+
+/* PCI Express capability registers */
+
+#define PCI_EXP_FLAGS 2 /* Capabilities register */
+#define PCI_EXP_FLAGS_VERS 0x000f /* Capability version */
+#define PCI_EXP_FLAGS_TYPE 0x00f0 /* Device/Port type */
+#define PCI_EXP_TYPE_ENDPOINT 0x0 /* Express Endpoint */
+#define PCI_EXP_TYPE_LEG_END 0x1 /* Legacy Endpoint */
+#define PCI_EXP_TYPE_ROOT_PORT 0x4 /* Root Port */
+#define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */
+#define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */
+#define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCI/PCI-X Bridge */
+#define PCI_EXP_TYPE_RC_END 0x9 /* Root Complex Integrated Endpoint */
+#define PCI_EXP_TYPE_RC_EC 0x10 /* Root Complex Event Collector */
+#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */
+#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */
+#define PCI_EXP_DEVCAP 4 /* Device capabilities */
+#define PCI_EXP_DEVCAP_PAYLOAD 0x07 /* Max_Payload_Size */
+#define PCI_EXP_DEVCAP_PHANTOM 0x18 /* Phantom functions */
+#define PCI_EXP_DEVCAP_EXT_TAG 0x20 /* Extended tags */
+#define PCI_EXP_DEVCAP_L0S 0x1c0 /* L0s Acceptable Latency */
+#define PCI_EXP_DEVCAP_L1 0xe00 /* L1 Acceptable Latency */
+#define PCI_EXP_DEVCAP_ATN_BUT 0x1000 /* Attention Button Present */
+#define PCI_EXP_DEVCAP_ATN_IND 0x2000 /* Attention Indicator Present */
+#define PCI_EXP_DEVCAP_PWR_IND 0x4000 /* Power Indicator Present */
+#define PCI_EXP_DEVCAP_RBER 0x8000 /* Role-Based Error Reporting */
+#define PCI_EXP_DEVCAP_PWR_VAL 0x3fc0000 /* Slot Power Limit Value */
+#define PCI_EXP_DEVCAP_PWR_SCL 0xc000000 /* Slot Power Limit Scale */
+#define PCI_EXP_DEVCAP_FLR 0x10000000 /* Function Level Reset */
+#define PCI_EXP_DEVCTL 8 /* Device Control */
+#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */
+#define PCI_EXP_DEVCTL_NFERE 0x0002 /* Non-Fatal Error Reporting Enable */
+#define PCI_EXP_DEVCTL_FERE 0x0004 /* Fatal Error Reporting Enable */
+#define PCI_EXP_DEVCTL_URRE 0x0008 /* Unsupported Request Reporting En. */
+#define PCI_EXP_DEVCTL_RELAX_EN 0x0010 /* Enable relaxed ordering */
+#define PCI_EXP_DEVCTL_PAYLOAD 0x00e0 /* Max_Payload_Size */
+#define PCI_EXP_DEVCTL_EXT_TAG 0x0100 /* Extended Tag Field Enable */
+#define PCI_EXP_DEVCTL_PHANTOM 0x0200 /* Phantom Functions Enable */
+#define PCI_EXP_DEVCTL_AUX_PME 0x0400 /* Auxiliary Power PM Enable */
+#define PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800 /* Enable No Snoop */
+#define PCI_EXP_DEVCTL_READRQ 0x7000 /* Max_Read_Request_Size */
+#define PCI_EXP_DEVCTL_BCR_FLR 0x8000 /* Bridge Configuration Retry / FLR */
+#define PCI_EXP_DEVSTA 10 /* Device Status */
+#define PCI_EXP_DEVSTA_CED 0x01 /* Correctable Error Detected */
+#define PCI_EXP_DEVSTA_NFED 0x02 /* Non-Fatal Error Detected */
+#define PCI_EXP_DEVSTA_FED 0x04 /* Fatal Error Detected */
+#define PCI_EXP_DEVSTA_URD 0x08 /* Unsupported Request Detected */
+#define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */
+#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */
+#define PCI_EXP_LNKCAP 12 /* Link Capabilities */
+#define PCI_EXP_LNKCAP_SLS 0x0000000f /* Supported Link Speeds */
+#define PCI_EXP_LNKCAP_MLW 0x000003f0 /* Maximum Link Width */
+#define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */
+#define PCI_EXP_LNKCAP_L0SEL 0x00007000 /* L0s Exit Latency */
+#define PCI_EXP_LNKCAP_L1EL 0x00038000 /* L1 Exit Latency */
+#define PCI_EXP_LNKCAP_CLKPM 0x00040000 /* L1 Clock Power Management */
+#define PCI_EXP_LNKCAP_SDERC 0x00080000 /* Suprise Down Error Reporting Capable */
+#define PCI_EXP_LNKCAP_DLLLARC 0x00100000 /* Data Link Layer Link Active Reporting Capable */
+#define PCI_EXP_LNKCAP_LBNC 0x00200000 /* Link Bandwidth Notification Capability */
+#define PCI_EXP_LNKCAP_PN 0xff000000 /* Port Number */
+#define PCI_EXP_LNKCTL 16 /* Link Control */
+#define PCI_EXP_LNKCTL_ASPMC 0x0003 /* ASPM Control */
+#define PCI_EXP_LNKCTL_RCB 0x0008 /* Read Completion Boundary */
+#define PCI_EXP_LNKCTL_LD 0x0010 /* Link Disable */
+#define PCI_EXP_LNKCTL_RL 0x0020 /* Retrain Link */
+#define PCI_EXP_LNKCTL_CCC 0x0040 /* Common Clock Configuration */
+#define PCI_EXP_LNKCTL_ES 0x0080 /* Extended Synch */
+#define PCI_EXP_LNKCTL_CLKREQ_EN 0x100 /* Enable clkreq */
+#define PCI_EXP_LNKCTL_HAWD 0x0200 /* Hardware Autonomous Width Disable */
+#define PCI_EXP_LNKCTL_LBMIE 0x0400 /* Link Bandwidth Management Interrupt Enable */
+#define PCI_EXP_LNKCTL_LABIE 0x0800 /* Lnk Autonomous Bandwidth Interrupt Enable */
+#define PCI_EXP_LNKSTA 18 /* Link Status */
+#define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */
+#define PCI_EXP_LNKSTA_NLW 0x03f0 /* Nogotiated Link Width */
+#define PCI_EXP_LNKSTA_LT 0x0800 /* Link Training */
+#define PCI_EXP_LNKSTA_SLC 0x1000 /* Slot Clock Configuration */
+#define PCI_EXP_LNKSTA_DLLLA 0x2000 /* Data Link Layer Link Active */
+#define PCI_EXP_LNKSTA_LBMS 0x4000 /* Link Bandwidth Management Status */
+#define PCI_EXP_LNKSTA_LABS 0x8000 /* Link Autonomous Bandwidth Status */
+#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */
+#define PCI_EXP_SLTCAP_ABP 0x00000001 /* Attention Button Present */
+#define PCI_EXP_SLTCAP_PCP 0x00000002 /* Power Controller Present */
+#define PCI_EXP_SLTCAP_MRLSP 0x00000004 /* MRL Sensor Present */
+#define PCI_EXP_SLTCAP_AIP 0x00000008 /* Attention Indicator Present */
+#define PCI_EXP_SLTCAP_PIP 0x00000010 /* Power Indicator Present */
+#define PCI_EXP_SLTCAP_HPS 0x00000020 /* Hot-Plug Surprise */
+#define PCI_EXP_SLTCAP_HPC 0x00000040 /* Hot-Plug Capable */
+#define PCI_EXP_SLTCAP_SPLV 0x00007f80 /* Slot Power Limit Value */
+#define PCI_EXP_SLTCAP_SPLS 0x00018000 /* Slot Power Limit Scale */
+#define PCI_EXP_SLTCAP_EIP 0x00020000 /* Electromechanical Interlock Present */
+#define PCI_EXP_SLTCAP_NCCS 0x00040000 /* No Command Completed Support */
+#define PCI_EXP_SLTCAP_PSN 0xfff80000 /* Physical Slot Number */
+#define PCI_EXP_SLTCTL 24 /* Slot Control */
+#define PCI_EXP_SLTCTL_ABPE 0x0001 /* Attention Button Pressed Enable */
+#define PCI_EXP_SLTCTL_PFDE 0x0002 /* Power Fault Detected Enable */
+#define PCI_EXP_SLTCTL_MRLSCE 0x0004 /* MRL Sensor Changed Enable */
+#define PCI_EXP_SLTCTL_PDCE 0x0008 /* Presence Detect Changed Enable */
+#define PCI_EXP_SLTCTL_CCIE 0x0010 /* Command Completed Interrupt Enable */
+#define PCI_EXP_SLTCTL_HPIE 0x0020 /* Hot-Plug Interrupt Enable */
+#define PCI_EXP_SLTCTL_AIC 0x00c0 /* Attention Indicator Control */
+#define PCI_EXP_SLTCTL_PIC 0x0300 /* Power Indicator Control */
+#define PCI_EXP_SLTCTL_PCC 0x0400 /* Power Controller Control */
+#define PCI_EXP_SLTCTL_EIC 0x0800 /* Electromechanical Interlock Control */
+#define PCI_EXP_SLTCTL_DLLSCE 0x1000 /* Data Link Layer State Changed Enable */
+#define PCI_EXP_SLTSTA 26 /* Slot Status */
+#define PCI_EXP_SLTSTA_ABP 0x0001 /* Attention Button Pressed */
+#define PCI_EXP_SLTSTA_PFD 0x0002 /* Power Fault Detected */
+#define PCI_EXP_SLTSTA_MRLSC 0x0004 /* MRL Sensor Changed */
+#define PCI_EXP_SLTSTA_PDC 0x0008 /* Presence Detect Changed */
+#define PCI_EXP_SLTSTA_CC 0x0010 /* Command Completed */
+#define PCI_EXP_SLTSTA_MRLSS 0x0020 /* MRL Sensor State */
+#define PCI_EXP_SLTSTA_PDS 0x0040 /* Presence Detect State */
+#define PCI_EXP_SLTSTA_EIS 0x0080 /* Electromechanical Interlock Status */
+#define PCI_EXP_SLTSTA_DLLSC 0x0100 /* Data Link Layer State Changed */
+#define PCI_EXP_RTCTL 28 /* Root Control */
+#define PCI_EXP_RTCTL_SECEE 0x01 /* System Error on Correctable Error */
+#define PCI_EXP_RTCTL_SENFEE 0x02 /* System Error on Non-Fatal Error */
+#define PCI_EXP_RTCTL_SEFEE 0x04 /* System Error on Fatal Error */
+#define PCI_EXP_RTCTL_PMEIE 0x08 /* PME Interrupt Enable */
+#define PCI_EXP_RTCTL_CRSSVE 0x10 /* CRS Software Visibility Enable */
+#define PCI_EXP_RTCAP 30 /* Root Capabilities */
+#define PCI_EXP_RTSTA 32 /* Root Status */
+#define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */
+#define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */
+#define PCI_EXP_DEVCTL2 40 /* Device Control 2 */
+#define PCI_EXP_DEVCTL2_ARI 0x20 /* Alternative Routing-ID */
+#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */
+#define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */
+
+/* Extended Capabilities (PCI-X 2.0 and Express) */
+#define PCI_EXT_CAP_ID(header) (header & 0x0000ffff)
+#define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf)
+#define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc)
+
+#define PCI_EXT_CAP_ID_ERR 1
+#define PCI_EXT_CAP_ID_VC 2
+#define PCI_EXT_CAP_ID_DSN 3
+#define PCI_EXT_CAP_ID_PWR 4
+#define PCI_EXT_CAP_ID_ARI 14
+#define PCI_EXT_CAP_ID_SRIOV 16
+
+/* Advanced Error Reporting */
+#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */
+#define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */
+#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */
+#define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */
+#define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */
+#define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */
+#define PCI_ERR_UNC_COMP_ABORT 0x00008000 /* Completer Abort */
+#define PCI_ERR_UNC_UNX_COMP 0x00010000 /* Unexpected Completion */
+#define PCI_ERR_UNC_RX_OVER 0x00020000 /* Receiver Overflow */
+#define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */
+#define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */
+#define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */
+#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */
+ /* Same bits as above */
+#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */
+ /* Same bits as above */
+#define PCI_ERR_COR_STATUS 16 /* Correctable Error Status */
+#define PCI_ERR_COR_RCVR 0x00000001 /* Receiver Error Status */
+#define PCI_ERR_COR_BAD_TLP 0x00000040 /* Bad TLP Status */
+#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */
+#define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */
+#define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */
+#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */
+ /* Same bits as above */
+#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */
+#define PCI_ERR_CAP_FEP(x) ((x) & 31) /* First Error Pointer */
+#define PCI_ERR_CAP_ECRC_GENC 0x00000020 /* ECRC Generation Capable */
+#define PCI_ERR_CAP_ECRC_GENE 0x00000040 /* ECRC Generation Enable */
+#define PCI_ERR_CAP_ECRC_CHKC 0x00000080 /* ECRC Check Capable */
+#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */
+#define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */
+#define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */
+/* Correctable Err Reporting Enable */
+#define PCI_ERR_ROOT_CMD_COR_EN 0x00000001
+/* Non-fatal Err Reporting Enable */
+#define PCI_ERR_ROOT_CMD_NONFATAL_EN 0x00000002
+/* Fatal Err Reporting Enable */
+#define PCI_ERR_ROOT_CMD_FATAL_EN 0x00000004
+#define PCI_ERR_ROOT_STATUS 48
+#define PCI_ERR_ROOT_COR_RCV 0x00000001 /* ERR_COR Received */
+/* Multi ERR_COR Received */
+#define PCI_ERR_ROOT_MULTI_COR_RCV 0x00000002
+/* ERR_FATAL/NONFATAL Recevied */
+#define PCI_ERR_ROOT_UNCOR_RCV 0x00000004
+/* Multi ERR_FATAL/NONFATAL Recevied */
+#define PCI_ERR_ROOT_MULTI_UNCOR_RCV 0x00000008
+#define PCI_ERR_ROOT_FIRST_FATAL 0x00000010 /* First Fatal */
+#define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */
+#define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */
+#define PCI_ERR_ROOT_COR_SRC 52
+#define PCI_ERR_ROOT_SRC 54
+
+/* Virtual Channel */
+#define PCI_VC_PORT_REG1 4
+#define PCI_VC_PORT_REG2 8
+#define PCI_VC_PORT_CTRL 12
+#define PCI_VC_PORT_STATUS 14
+#define PCI_VC_RES_CAP 16
+#define PCI_VC_RES_CTRL 20
+#define PCI_VC_RES_STATUS 26
+
+/* Power Budgeting */
+#define PCI_PWR_DSR 4 /* Data Select Register */
+#define PCI_PWR_DATA 8 /* Data Register */
+#define PCI_PWR_DATA_BASE(x) ((x) & 0xff) /* Base Power */
+#define PCI_PWR_DATA_SCALE(x) (((x) >> 8) & 3) /* Data Scale */
+#define PCI_PWR_DATA_PM_SUB(x) (((x) >> 10) & 7) /* PM Sub State */
+#define PCI_PWR_DATA_PM_STATE(x) (((x) >> 13) & 3) /* PM State */
+#define PCI_PWR_DATA_TYPE(x) (((x) >> 15) & 7) /* Type */
+#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */
+#define PCI_PWR_CAP 12 /* Capability */
+#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */
+
+/*
+ * Hypertransport sub capability types
+ *
+ * Unfortunately there are both 3 bit and 5 bit capability types defined
+ * in the HT spec, catering for that is a little messy. You probably don't
+ * want to use these directly, just use pci_find_ht_capability() and it
+ * will do the right thing for you.
+ */
+#define HT_3BIT_CAP_MASK 0xE0
+#define HT_CAPTYPE_SLAVE 0x00 /* Slave/Primary link configuration */
+#define HT_CAPTYPE_HOST 0x20 /* Host/Secondary link configuration */
+
+#define HT_5BIT_CAP_MASK 0xF8
+#define HT_CAPTYPE_IRQ 0x80 /* IRQ Configuration */
+#define HT_CAPTYPE_REMAPPING_40 0xA0 /* 40 bit address remapping */
+#define HT_CAPTYPE_REMAPPING_64 0xA2 /* 64 bit address remapping */
+#define HT_CAPTYPE_UNITID_CLUMP 0x90 /* Unit ID clumping */
+#define HT_CAPTYPE_EXTCONF 0x98 /* Extended Configuration Space Access */
+#define HT_CAPTYPE_MSI_MAPPING 0xA8 /* MSI Mapping Capability */
+#define HT_MSI_FLAGS 0x02 /* Offset to flags */
+#define HT_MSI_FLAGS_ENABLE 0x1 /* Mapping enable */
+#define HT_MSI_FLAGS_FIXED 0x2 /* Fixed mapping only */
+#define HT_MSI_FIXED_ADDR 0x00000000FEE00000ULL /* Fixed addr */
+#define HT_MSI_ADDR_LO 0x04 /* Offset to low addr bits */
+#define HT_MSI_ADDR_LO_MASK 0xFFF00000 /* Low address bit mask */
+#define HT_MSI_ADDR_HI 0x08 /* Offset to high addr bits */
+#define HT_CAPTYPE_DIRECT_ROUTE 0xB0 /* Direct routing configuration */
+#define HT_CAPTYPE_VCSET 0xB8 /* Virtual Channel configuration */
+#define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */
+#define HT_CAPTYPE_GEN3 0xD0 /* Generation 3 hypertransport configuration */
+#define HT_CAPTYPE_PM 0xE0 /* Hypertransport powermanagement configuration */
+
+/* Alternative Routing-ID Interpretation */
+#define PCI_ARI_CAP 0x04 /* ARI Capability Register */
+#define PCI_ARI_CAP_MFVC 0x0001 /* MFVC Function Groups Capability */
+#define PCI_ARI_CAP_ACS 0x0002 /* ACS Function Groups Capability */
+#define PCI_ARI_CAP_NFN(x) (((x) >> 8) & 0xff) /* Next Function Number */
+#define PCI_ARI_CTRL 0x06 /* ARI Control Register */
+#define PCI_ARI_CTRL_MFVC 0x0001 /* MFVC Function Groups Enable */
+#define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */
+#define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */
+
+/* Single Root I/O Virtualization */
+#define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */
+#define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */
+#define PCI_SRIOV_CAP_INTR(x) ((x) >> 21) /* Interrupt Message Number */
+#define PCI_SRIOV_CTRL 0x08 /* SR-IOV Control */
+#define PCI_SRIOV_CTRL_VFE 0x01 /* VF Enable */
+#define PCI_SRIOV_CTRL_VFM 0x02 /* VF Migration Enable */
+#define PCI_SRIOV_CTRL_INTR 0x04 /* VF Migration Interrupt Enable */
+#define PCI_SRIOV_CTRL_MSE 0x08 /* VF Memory Space Enable */
+#define PCI_SRIOV_CTRL_ARI 0x10 /* ARI Capable Hierarchy */
+#define PCI_SRIOV_STATUS 0x0a /* SR-IOV Status */
+#define PCI_SRIOV_STATUS_VFM 0x01 /* VF Migration Status */
+#define PCI_SRIOV_INITIAL_VF 0x0c /* Initial VFs */
+#define PCI_SRIOV_TOTAL_VF 0x0e /* Total VFs */
+#define PCI_SRIOV_NUM_VF 0x10 /* Number of VFs */
+#define PCI_SRIOV_FUNC_LINK 0x12 /* Function Dependency Link */
+#define PCI_SRIOV_VF_OFFSET 0x14 /* First VF Offset */
+#define PCI_SRIOV_VF_STRIDE 0x16 /* Following VF Stride */
+#define PCI_SRIOV_VF_DID 0x1a /* VF Device ID */
+#define PCI_SRIOV_SUP_PGSIZE 0x1c /* Supported Page Sizes */
+#define PCI_SRIOV_SYS_PGSIZE 0x20 /* System Page Size */
+#define PCI_SRIOV_BAR 0x24 /* VF BAR0 */
+#define PCI_SRIOV_NUM_BARS 6 /* Number of VF BARs */
+#define PCI_SRIOV_VFM 0x3c /* VF Migration State Array Offset*/
+#define PCI_SRIOV_VFM_BIR(x) ((x) & 7) /* State BIR */
+#define PCI_SRIOV_VFM_OFFSET(x) ((x) & ~7) /* State Offset */
+#define PCI_SRIOV_VFM_UA 0x0 /* Inactive.Unavailable */
+#define PCI_SRIOV_VFM_MI 0x1 /* Dormant.MigrateIn */
+#define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */
+#define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */
+
+#endif /* LINUX_PCI_REGS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/personality.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/personality.h
new file mode 100644
index 0000000..9f1ab5e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/personality.h
@@ -0,0 +1,65 @@
+#ifndef _LINUX_PERSONALITY_H
+#define _LINUX_PERSONALITY_H
+
+
+/*
+ * Flags for bug emulation.
+ *
+ * These occupy the top three bytes.
+ */
+enum {
+ ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization of VA space */
+ FDPIC_FUNCPTRS = 0x0080000, /* userspace function ptrs point to descriptors
+ * (signal handling)
+ */
+ MMAP_PAGE_ZERO = 0x0100000,
+ ADDR_COMPAT_LAYOUT = 0x0200000,
+ READ_IMPLIES_EXEC = 0x0400000,
+ ADDR_LIMIT_32BIT = 0x0800000,
+ SHORT_INODE = 0x1000000,
+ WHOLE_SECONDS = 0x2000000,
+ STICKY_TIMEOUTS = 0x4000000,
+ ADDR_LIMIT_3GB = 0x8000000,
+};
+
+/*
+ * Security-relevant compatibility flags that must be
+ * cleared upon setuid or setgid exec:
+ */
+#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC|ADDR_NO_RANDOMIZE)
+
+/*
+ * Personality types.
+ *
+ * These go in the low byte. Avoid using the top bit, it will
+ * conflict with error returns.
+ */
+enum {
+ PER_LINUX = 0x0000,
+ PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT,
+ PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS,
+ PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
+ PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
+ PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS |
+ WHOLE_SECONDS | SHORT_INODE,
+ PER_OSR5 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
+ PER_WYSEV386 = 0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
+ PER_ISCR4 = 0x0005 | STICKY_TIMEOUTS,
+ PER_BSD = 0x0006,
+ PER_SUNOS = 0x0006 | STICKY_TIMEOUTS,
+ PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
+ PER_LINUX32 = 0x0008,
+ PER_LINUX32_3GB = 0x0008 | ADDR_LIMIT_3GB,
+ PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS,/* IRIX5 32-bit */
+ PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS,/* IRIX6 new 32-bit */
+ PER_IRIX64 = 0x000b | STICKY_TIMEOUTS,/* IRIX6 64-bit */
+ PER_RISCOS = 0x000c,
+ PER_SOLARIS = 0x000d | STICKY_TIMEOUTS,
+ PER_UW7 = 0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
+ PER_OSF4 = 0x000f, /* OSF/1 v4 */
+ PER_HPUX = 0x0010,
+ PER_MASK = 0x00ff,
+};
+
+
+#endif /* _LINUX_PERSONALITY_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pfkeyv2.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pfkeyv2.h
new file mode 100644
index 0000000..228b0b6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pfkeyv2.h
@@ -0,0 +1,369 @@
+/* PF_KEY user interface, this is defined by rfc2367 so
+ * do not make arbitrary modifications or else this header
+ * file will not be compliant.
+ */
+
+#ifndef _LINUX_PFKEY2_H
+#define _LINUX_PFKEY2_H
+
+#include <linux/types.h>
+
+#define PF_KEY_V2 2
+#define PFKEYV2_REVISION 199806L
+
+struct sadb_msg {
+ __u8 sadb_msg_version;
+ __u8 sadb_msg_type;
+ __u8 sadb_msg_errno;
+ __u8 sadb_msg_satype;
+ __u16 sadb_msg_len;
+ __u16 sadb_msg_reserved;
+ __u32 sadb_msg_seq;
+ __u32 sadb_msg_pid;
+} __attribute__((packed));
+/* sizeof(struct sadb_msg) == 16 */
+
+struct sadb_ext {
+ __u16 sadb_ext_len;
+ __u16 sadb_ext_type;
+} __attribute__((packed));
+/* sizeof(struct sadb_ext) == 4 */
+
+struct sadb_sa {
+ __u16 sadb_sa_len;
+ __u16 sadb_sa_exttype;
+ __be32 sadb_sa_spi;
+ __u8 sadb_sa_replay;
+ __u8 sadb_sa_state;
+ __u8 sadb_sa_auth;
+ __u8 sadb_sa_encrypt;
+ __u32 sadb_sa_flags;
+} __attribute__((packed));
+/* sizeof(struct sadb_sa) == 16 */
+
+struct sadb_lifetime {
+ __u16 sadb_lifetime_len;
+ __u16 sadb_lifetime_exttype;
+ __u32 sadb_lifetime_allocations;
+ __u64 sadb_lifetime_bytes;
+ __u64 sadb_lifetime_addtime;
+ __u64 sadb_lifetime_usetime;
+} __attribute__((packed));
+/* sizeof(struct sadb_lifetime) == 32 */
+
+struct sadb_address {
+ __u16 sadb_address_len;
+ __u16 sadb_address_exttype;
+ __u8 sadb_address_proto;
+ __u8 sadb_address_prefixlen;
+ __u16 sadb_address_reserved;
+} __attribute__((packed));
+/* sizeof(struct sadb_address) == 8 */
+
+struct sadb_key {
+ __u16 sadb_key_len;
+ __u16 sadb_key_exttype;
+ __u16 sadb_key_bits;
+ __u16 sadb_key_reserved;
+} __attribute__((packed));
+/* sizeof(struct sadb_key) == 8 */
+
+struct sadb_ident {
+ __u16 sadb_ident_len;
+ __u16 sadb_ident_exttype;
+ __u16 sadb_ident_type;
+ __u16 sadb_ident_reserved;
+ __u64 sadb_ident_id;
+} __attribute__((packed));
+/* sizeof(struct sadb_ident) == 16 */
+
+struct sadb_sens {
+ __u16 sadb_sens_len;
+ __u16 sadb_sens_exttype;
+ __u32 sadb_sens_dpd;
+ __u8 sadb_sens_sens_level;
+ __u8 sadb_sens_sens_len;
+ __u8 sadb_sens_integ_level;
+ __u8 sadb_sens_integ_len;
+ __u32 sadb_sens_reserved;
+} __attribute__((packed));
+/* sizeof(struct sadb_sens) == 16 */
+
+/* followed by:
+ __u64 sadb_sens_bitmap[sens_len];
+ __u64 sadb_integ_bitmap[integ_len]; */
+
+struct sadb_prop {
+ __u16 sadb_prop_len;
+ __u16 sadb_prop_exttype;
+ __u8 sadb_prop_replay;
+ __u8 sadb_prop_reserved[3];
+} __attribute__((packed));
+/* sizeof(struct sadb_prop) == 8 */
+
+/* followed by:
+ struct sadb_comb sadb_combs[(sadb_prop_len +
+ sizeof(__u64) - sizeof(struct sadb_prop)) /
+ sizeof(struct sadb_comb)]; */
+
+struct sadb_comb {
+ __u8 sadb_comb_auth;
+ __u8 sadb_comb_encrypt;
+ __u16 sadb_comb_flags;
+ __u16 sadb_comb_auth_minbits;
+ __u16 sadb_comb_auth_maxbits;
+ __u16 sadb_comb_encrypt_minbits;
+ __u16 sadb_comb_encrypt_maxbits;
+ __u32 sadb_comb_reserved;
+ __u32 sadb_comb_soft_allocations;
+ __u32 sadb_comb_hard_allocations;
+ __u64 sadb_comb_soft_bytes;
+ __u64 sadb_comb_hard_bytes;
+ __u64 sadb_comb_soft_addtime;
+ __u64 sadb_comb_hard_addtime;
+ __u64 sadb_comb_soft_usetime;
+ __u64 sadb_comb_hard_usetime;
+} __attribute__((packed));
+/* sizeof(struct sadb_comb) == 72 */
+
+struct sadb_supported {
+ __u16 sadb_supported_len;
+ __u16 sadb_supported_exttype;
+ __u32 sadb_supported_reserved;
+} __attribute__((packed));
+/* sizeof(struct sadb_supported) == 8 */
+
+/* followed by:
+ struct sadb_alg sadb_algs[(sadb_supported_len +
+ sizeof(__u64) - sizeof(struct sadb_supported)) /
+ sizeof(struct sadb_alg)]; */
+
+struct sadb_alg {
+ __u8 sadb_alg_id;
+ __u8 sadb_alg_ivlen;
+ __u16 sadb_alg_minbits;
+ __u16 sadb_alg_maxbits;
+ __u16 sadb_alg_reserved;
+} __attribute__((packed));
+/* sizeof(struct sadb_alg) == 8 */
+
+struct sadb_spirange {
+ __u16 sadb_spirange_len;
+ __u16 sadb_spirange_exttype;
+ __u32 sadb_spirange_min;
+ __u32 sadb_spirange_max;
+ __u32 sadb_spirange_reserved;
+} __attribute__((packed));
+/* sizeof(struct sadb_spirange) == 16 */
+
+struct sadb_x_kmprivate {
+ __u16 sadb_x_kmprivate_len;
+ __u16 sadb_x_kmprivate_exttype;
+ __u32 sadb_x_kmprivate_reserved;
+} __attribute__((packed));
+/* sizeof(struct sadb_x_kmprivate) == 8 */
+
+struct sadb_x_sa2 {
+ __u16 sadb_x_sa2_len;
+ __u16 sadb_x_sa2_exttype;
+ __u8 sadb_x_sa2_mode;
+ __u8 sadb_x_sa2_reserved1;
+ __u16 sadb_x_sa2_reserved2;
+ __u32 sadb_x_sa2_sequence;
+ __u32 sadb_x_sa2_reqid;
+} __attribute__((packed));
+/* sizeof(struct sadb_x_sa2) == 16 */
+
+struct sadb_x_policy {
+ __u16 sadb_x_policy_len;
+ __u16 sadb_x_policy_exttype;
+ __u16 sadb_x_policy_type;
+ __u8 sadb_x_policy_dir;
+ __u8 sadb_x_policy_reserved;
+ __u32 sadb_x_policy_id;
+ __u32 sadb_x_policy_priority;
+} __attribute__((packed));
+/* sizeof(struct sadb_x_policy) == 16 */
+
+struct sadb_x_ipsecrequest {
+ __u16 sadb_x_ipsecrequest_len;
+ __u16 sadb_x_ipsecrequest_proto;
+ __u8 sadb_x_ipsecrequest_mode;
+ __u8 sadb_x_ipsecrequest_level;
+ __u16 sadb_x_ipsecrequest_reserved1;
+ __u32 sadb_x_ipsecrequest_reqid;
+ __u32 sadb_x_ipsecrequest_reserved2;
+} __attribute__((packed));
+/* sizeof(struct sadb_x_ipsecrequest) == 16 */
+
+/* This defines the TYPE of Nat Traversal in use. Currently only one
+ * type of NAT-T is supported, draft-ietf-ipsec-udp-encaps-06
+ */
+struct sadb_x_nat_t_type {
+ __u16 sadb_x_nat_t_type_len;
+ __u16 sadb_x_nat_t_type_exttype;
+ __u8 sadb_x_nat_t_type_type;
+ __u8 sadb_x_nat_t_type_reserved[3];
+} __attribute__((packed));
+/* sizeof(struct sadb_x_nat_t_type) == 8 */
+
+/* Pass a NAT Traversal port (Source or Dest port) */
+struct sadb_x_nat_t_port {
+ __u16 sadb_x_nat_t_port_len;
+ __u16 sadb_x_nat_t_port_exttype;
+ __be16 sadb_x_nat_t_port_port;
+ __u16 sadb_x_nat_t_port_reserved;
+} __attribute__((packed));
+/* sizeof(struct sadb_x_nat_t_port) == 8 */
+
+/* Generic LSM security context */
+struct sadb_x_sec_ctx {
+ __u16 sadb_x_sec_len;
+ __u16 sadb_x_sec_exttype;
+ __u8 sadb_x_ctx_alg; /* LSMs: e.g., selinux == 1 */
+ __u8 sadb_x_ctx_doi;
+ __u16 sadb_x_ctx_len;
+} __attribute__((packed));
+/* sizeof(struct sadb_sec_ctx) = 8 */
+
+/* Used by MIGRATE to pass addresses IKE will use to perform
+ * negotiation with the peer */
+struct sadb_x_kmaddress {
+ __u16 sadb_x_kmaddress_len;
+ __u16 sadb_x_kmaddress_exttype;
+ __u32 sadb_x_kmaddress_reserved;
+} __attribute__((packed));
+/* sizeof(struct sadb_x_kmaddress) == 8 */
+
+/* Message types */
+#define SADB_RESERVED 0
+#define SADB_GETSPI 1
+#define SADB_UPDATE 2
+#define SADB_ADD 3
+#define SADB_DELETE 4
+#define SADB_GET 5
+#define SADB_ACQUIRE 6
+#define SADB_REGISTER 7
+#define SADB_EXPIRE 8
+#define SADB_FLUSH 9
+#define SADB_DUMP 10
+#define SADB_X_PROMISC 11
+#define SADB_X_PCHANGE 12
+#define SADB_X_SPDUPDATE 13
+#define SADB_X_SPDADD 14
+#define SADB_X_SPDDELETE 15
+#define SADB_X_SPDGET 16
+#define SADB_X_SPDACQUIRE 17
+#define SADB_X_SPDDUMP 18
+#define SADB_X_SPDFLUSH 19
+#define SADB_X_SPDSETIDX 20
+#define SADB_X_SPDEXPIRE 21
+#define SADB_X_SPDDELETE2 22
+#define SADB_X_NAT_T_NEW_MAPPING 23
+#define SADB_X_MIGRATE 24
+#define SADB_MAX 24
+
+/* Security Association flags */
+#define SADB_SAFLAGS_PFS 1
+#define SADB_SAFLAGS_NOPMTUDISC 0x20000000
+#define SADB_SAFLAGS_DECAP_DSCP 0x40000000
+#define SADB_SAFLAGS_NOECN 0x80000000
+
+/* Security Association states */
+#define SADB_SASTATE_LARVAL 0
+#define SADB_SASTATE_MATURE 1
+#define SADB_SASTATE_DYING 2
+#define SADB_SASTATE_DEAD 3
+#define SADB_SASTATE_MAX 3
+
+/* Security Association types */
+#define SADB_SATYPE_UNSPEC 0
+#define SADB_SATYPE_AH 2
+#define SADB_SATYPE_ESP 3
+#define SADB_SATYPE_RSVP 5
+#define SADB_SATYPE_OSPFV2 6
+#define SADB_SATYPE_RIPV2 7
+#define SADB_SATYPE_MIP 8
+#define SADB_X_SATYPE_IPCOMP 9
+#define SADB_SATYPE_MAX 9
+
+/* Authentication algorithms */
+#define SADB_AALG_NONE 0
+#define SADB_AALG_MD5HMAC 2
+#define SADB_AALG_SHA1HMAC 3
+#define SADB_X_AALG_SHA2_256HMAC 5
+#define SADB_X_AALG_SHA2_384HMAC 6
+#define SADB_X_AALG_SHA2_512HMAC 7
+#define SADB_X_AALG_RIPEMD160HMAC 8
+#define SADB_X_AALG_AES_XCBC_MAC 9
+#define SADB_X_AALG_NULL 251 /* kame */
+#define SADB_AALG_MAX 251
+
+/* Encryption algorithms */
+#define SADB_EALG_NONE 0
+#define SADB_EALG_DESCBC 2
+#define SADB_EALG_3DESCBC 3
+#define SADB_X_EALG_CASTCBC 6
+#define SADB_X_EALG_BLOWFISHCBC 7
+#define SADB_EALG_NULL 11
+#define SADB_X_EALG_AESCBC 12
+#define SADB_X_EALG_AESCTR 13
+#define SADB_X_EALG_AES_CCM_ICV8 14
+#define SADB_X_EALG_AES_CCM_ICV12 15
+#define SADB_X_EALG_AES_CCM_ICV16 16
+#define SADB_X_EALG_AES_GCM_ICV8 18
+#define SADB_X_EALG_AES_GCM_ICV12 19
+#define SADB_X_EALG_AES_GCM_ICV16 20
+#define SADB_X_EALG_CAMELLIACBC 22
+#define SADB_EALG_MAX 253 /* last EALG */
+/* private allocations should use 249-255 (RFC2407) */
+#define SADB_X_EALG_SERPENTCBC 252 /* draft-ietf-ipsec-ciph-aes-cbc-00 */
+#define SADB_X_EALG_TWOFISHCBC 253 /* draft-ietf-ipsec-ciph-aes-cbc-00 */
+
+/* Compression algorithms */
+#define SADB_X_CALG_NONE 0
+#define SADB_X_CALG_OUI 1
+#define SADB_X_CALG_DEFLATE 2
+#define SADB_X_CALG_LZS 3
+#define SADB_X_CALG_LZJH 4
+#define SADB_X_CALG_MAX 4
+
+/* Extension Header values */
+#define SADB_EXT_RESERVED 0
+#define SADB_EXT_SA 1
+#define SADB_EXT_LIFETIME_CURRENT 2
+#define SADB_EXT_LIFETIME_HARD 3
+#define SADB_EXT_LIFETIME_SOFT 4
+#define SADB_EXT_ADDRESS_SRC 5
+#define SADB_EXT_ADDRESS_DST 6
+#define SADB_EXT_ADDRESS_PROXY 7
+#define SADB_EXT_KEY_AUTH 8
+#define SADB_EXT_KEY_ENCRYPT 9
+#define SADB_EXT_IDENTITY_SRC 10
+#define SADB_EXT_IDENTITY_DST 11
+#define SADB_EXT_SENSITIVITY 12
+#define SADB_EXT_PROPOSAL 13
+#define SADB_EXT_SUPPORTED_AUTH 14
+#define SADB_EXT_SUPPORTED_ENCRYPT 15
+#define SADB_EXT_SPIRANGE 16
+#define SADB_X_EXT_KMPRIVATE 17
+#define SADB_X_EXT_POLICY 18
+#define SADB_X_EXT_SA2 19
+/* The next four entries are for setting up NAT Traversal */
+#define SADB_X_EXT_NAT_T_TYPE 20
+#define SADB_X_EXT_NAT_T_SPORT 21
+#define SADB_X_EXT_NAT_T_DPORT 22
+#define SADB_X_EXT_NAT_T_OA 23
+#define SADB_X_EXT_SEC_CTX 24
+/* Used with MIGRATE to pass @ to IKE for negotiation */
+#define SADB_X_EXT_KMADDRESS 25
+#define SADB_EXT_MAX 25
+
+/* Identity Extension values */
+#define SADB_IDENTTYPE_RESERVED 0
+#define SADB_IDENTTYPE_PREFIX 1
+#define SADB_IDENTTYPE_FQDN 2
+#define SADB_IDENTTYPE_USERFQDN 3
+#define SADB_IDENTTYPE_MAX 3
+
+#endif /* !(_LINUX_PFKEY2_H) */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pg.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pg.h
new file mode 100644
index 0000000..db994bb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pg.h
@@ -0,0 +1,63 @@
+/* pg.h (c) 1998 Grant R. Guenther <grant@torque.net>
+ Under the terms of the GNU General Public License
+
+
+ pg.h defines the user interface to the generic ATAPI packet
+ command driver for parallel port ATAPI devices (pg). The
+ driver is loosely modelled after the generic SCSI driver, sg,
+ although the actual interface is different.
+
+ The pg driver provides a simple character device interface for
+ sending ATAPI commands to a device. With the exception of the
+ ATAPI reset operation, all operations are performed by a pair
+ of read and write operations to the appropriate /dev/pgN device.
+ A write operation delivers a command and any outbound data in
+ a single buffer. Normally, the write will succeed unless the
+ device is offline or malfunctioning, or there is already another
+ command pending. If the write succeeds, it should be followed
+ immediately by a read operation, to obtain any returned data and
+ status information. A read will fail if there is no operation
+ in progress.
+
+ As a special case, the device can be reset with a write operation,
+ and in this case, no following read is expected, or permitted.
+
+ There are no ioctl() operations. Any single operation
+ may transfer at most PG_MAX_DATA bytes. Note that the driver must
+ copy the data through an internal buffer. In keeping with all
+ current ATAPI devices, command packets are assumed to be exactly
+ 12 bytes in length.
+
+ To permit future changes to this interface, the headers in the
+ read and write buffers contain a single character "magic" flag.
+ Currently this flag must be the character "P".
+
+*/
+
+#define PG_MAGIC 'P'
+#define PG_RESET 'Z'
+#define PG_COMMAND 'C'
+
+#define PG_MAX_DATA 32768
+
+struct pg_write_hdr {
+
+ char magic; /* == PG_MAGIC */
+ char func; /* PG_RESET or PG_COMMAND */
+ int dlen; /* number of bytes expected to transfer */
+ int timeout; /* number of seconds before timeout */
+ char packet[12]; /* packet command */
+
+};
+
+struct pg_read_hdr {
+
+ char magic; /* == PG_MAGIC */
+ char scsi; /* "scsi" status == sense key */
+ int dlen; /* size of device transfer request */
+ int duration; /* time in seconds command took */
+ char pad[12]; /* not used */
+
+};
+
+/* end of pg.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/phantom.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/phantom.h
new file mode 100644
index 0000000..94dd664
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/phantom.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2005-2007 Jiri Slaby <jirislaby@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef __PHANTOM_H
+#define __PHANTOM_H
+
+#include <linux/types.h>
+
+/* PHN_(G/S)ET_REG param */
+struct phm_reg {
+ __u32 reg;
+ __u32 value;
+};
+
+/* PHN_(G/S)ET_REGS param */
+struct phm_regs {
+ __u32 count;
+ __u32 mask;
+ __u32 values[8];
+};
+
+#define PH_IOC_MAGIC 'p'
+#define PHN_GET_REG _IOWR(PH_IOC_MAGIC, 0, struct phm_reg *)
+#define PHN_SET_REG _IOW(PH_IOC_MAGIC, 1, struct phm_reg *)
+#define PHN_GET_REGS _IOWR(PH_IOC_MAGIC, 2, struct phm_regs *)
+#define PHN_SET_REGS _IOW(PH_IOC_MAGIC, 3, struct phm_regs *)
+/* this ioctl tells the driver, that the caller is not OpenHaptics and might
+ * use improved registers update (no more phantom switchoffs when using
+ * libphantom) */
+#define PHN_NOT_OH _IO(PH_IOC_MAGIC, 4)
+#define PHN_GETREG _IOWR(PH_IOC_MAGIC, 5, struct phm_reg)
+#define PHN_SETREG _IOW(PH_IOC_MAGIC, 6, struct phm_reg)
+#define PHN_GETREGS _IOWR(PH_IOC_MAGIC, 7, struct phm_regs)
+#define PHN_SETREGS _IOW(PH_IOC_MAGIC, 8, struct phm_regs)
+
+#define PHN_CONTROL 0x6 /* control byte in iaddr space */
+#define PHN_CTL_AMP 0x1 /* switch after torques change */
+#define PHN_CTL_BUT 0x2 /* is button switched */
+#define PHN_CTL_IRQ 0x10 /* is irq enabled */
+
+#define PHN_ZERO_FORCE 2048 /* zero torque on motor */
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/phonet.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/phonet.h
new file mode 100644
index 0000000..3ad3eea
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/phonet.h
@@ -0,0 +1,173 @@
+/**
+ * file phonet.h
+ *
+ * Phonet sockets kernel interface
+ *
+ * Copyright (C) 2008 Nokia Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef LINUX_PHONET_H
+#define LINUX_PHONET_H
+
+#include <linux/types.h>
+
+/* Automatic protocol selection */
+#define PN_PROTO_TRANSPORT 0
+/* Phonet datagram socket */
+#define PN_PROTO_PHONET 1
+/* Phonet pipe */
+#define PN_PROTO_PIPE 2
+#define PHONET_NPROTO 3
+
+/* Socket options for SOL_PNPIPE level */
+#define PNPIPE_ENCAP 1
+#define PNPIPE_IFINDEX 2
+
+#define PNADDR_ANY 0
+#define PNPORT_RESOURCE_ROUTING 0
+
+/* Values for PNPIPE_ENCAP option */
+#define PNPIPE_ENCAP_NONE 0
+#define PNPIPE_ENCAP_IP 1
+
+/* ioctls */
+#define SIOCPNGETOBJECT (SIOCPROTOPRIVATE + 0)
+
+/* Phonet protocol header */
+struct phonethdr {
+ __u8 pn_rdev;
+ __u8 pn_sdev;
+ __u8 pn_res;
+ __be16 pn_length;
+ __u8 pn_robj;
+ __u8 pn_sobj;
+} __attribute__((packed));
+
+/* Common Phonet payload header */
+struct phonetmsg {
+ __u8 pn_trans_id; /* transaction ID */
+ __u8 pn_msg_id; /* message type */
+ union {
+ struct {
+ __u8 pn_submsg_id; /* message subtype */
+ __u8 pn_data[5];
+ } base;
+ struct {
+ __u16 pn_e_res_id; /* extended resource ID */
+ __u8 pn_e_submsg_id; /* message subtype */
+ __u8 pn_e_data[3];
+ } ext;
+ } pn_msg_u;
+};
+#define PN_COMMON_MESSAGE 0xF0
+#define PN_COMMGR 0x10
+#define PN_PREFIX 0xE0 /* resource for extended messages */
+#define pn_submsg_id pn_msg_u.base.pn_submsg_id
+#define pn_e_submsg_id pn_msg_u.ext.pn_e_submsg_id
+#define pn_e_res_id pn_msg_u.ext.pn_e_res_id
+#define pn_data pn_msg_u.base.pn_data
+#define pn_e_data pn_msg_u.ext.pn_e_data
+
+/* data for unreachable errors */
+#define PN_COMM_SERVICE_NOT_IDENTIFIED_RESP 0x01
+#define PN_COMM_ISA_ENTITY_NOT_REACHABLE_RESP 0x14
+#define pn_orig_msg_id pn_data[0]
+#define pn_status pn_data[1]
+#define pn_e_orig_msg_id pn_e_data[0]
+#define pn_e_status pn_e_data[1]
+
+/* Phonet socket address structure */
+struct sockaddr_pn {
+ sa_family_t spn_family;
+ __u8 spn_obj;
+ __u8 spn_dev;
+ __u8 spn_resource;
+ __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3];
+} __attribute__ ((packed));
+
+static __inline__ __u16 pn_object(__u8 addr, __u16 port)
+{
+ return (addr << 8) | (port & 0x3ff);
+}
+
+static __inline__ __u8 pn_obj(__u16 handle)
+{
+ return handle & 0xff;
+}
+
+static __inline__ __u8 pn_dev(__u16 handle)
+{
+ return handle >> 8;
+}
+
+static __inline__ __u16 pn_port(__u16 handle)
+{
+ return handle & 0x3ff;
+}
+
+static __inline__ __u8 pn_addr(__u16 handle)
+{
+ return (handle >> 8) & 0xfc;
+}
+
+static __inline__ void pn_sockaddr_set_addr(struct sockaddr_pn *spn, __u8 addr)
+{
+ spn->spn_dev &= 0x03;
+ spn->spn_dev |= addr & 0xfc;
+}
+
+static __inline__ void pn_sockaddr_set_port(struct sockaddr_pn *spn, __u16 port)
+{
+ spn->spn_dev &= 0xfc;
+ spn->spn_dev |= (port >> 8) & 0x03;
+ spn->spn_obj = port & 0xff;
+}
+
+static __inline__ void pn_sockaddr_set_object(struct sockaddr_pn *spn,
+ __u16 handle)
+{
+ spn->spn_dev = pn_dev(handle);
+ spn->spn_obj = pn_obj(handle);
+}
+
+static __inline__ void pn_sockaddr_set_resource(struct sockaddr_pn *spn,
+ __u8 resource)
+{
+ spn->spn_resource = resource;
+}
+
+static __inline__ __u8 pn_sockaddr_get_addr(const struct sockaddr_pn *spn)
+{
+ return spn->spn_dev & 0xfc;
+}
+
+static __inline__ __u16 pn_sockaddr_get_port(const struct sockaddr_pn *spn)
+{
+ return ((spn->spn_dev & 0x03) << 8) | spn->spn_obj;
+}
+
+static __inline__ __u16 pn_sockaddr_get_object(const struct sockaddr_pn *spn)
+{
+ return pn_object(spn->spn_dev, spn->spn_obj);
+}
+
+static __inline__ __u8 pn_sockaddr_get_resource(const struct sockaddr_pn *spn)
+{
+ return spn->spn_resource;
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pkt_cls.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pkt_cls.h
new file mode 100644
index 0000000..3c842ed
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pkt_cls.h
@@ -0,0 +1,494 @@
+#ifndef __LINUX_PKT_CLS_H
+#define __LINUX_PKT_CLS_H
+
+#include <linux/types.h>
+#include <linux/pkt_sched.h>
+
+/* I think i could have done better macros ; for now this is stolen from
+ * some arch/mips code - jhs
+*/
+#define _TC_MAKE32(x) ((x))
+
+#define _TC_MAKEMASK1(n) (_TC_MAKE32(1) << _TC_MAKE32(n))
+#define _TC_MAKEMASK(v,n) (_TC_MAKE32((_TC_MAKE32(1)<<(v))-1) << _TC_MAKE32(n))
+#define _TC_MAKEVALUE(v,n) (_TC_MAKE32(v) << _TC_MAKE32(n))
+#define _TC_GETVALUE(v,n,m) ((_TC_MAKE32(v) & _TC_MAKE32(m)) >> _TC_MAKE32(n))
+
+/* verdict bit breakdown
+ *
+bit 0: when set -> this packet has been munged already
+
+bit 1: when set -> It is ok to munge this packet
+
+bit 2,3,4,5: Reclassify counter - sort of reverse TTL - if exceeded
+assume loop
+
+bit 6,7: Where this packet was last seen
+0: Above the transmit example at the socket level
+1: on the Ingress
+2: on the Egress
+
+bit 8: when set --> Request not to classify on ingress.
+
+bits 9,10,11: redirect counter - redirect TTL. Loop avoidance
+
+ *
+ * */
+
+#define TC_MUNGED _TC_MAKEMASK1(0)
+#define SET_TC_MUNGED(v) ( TC_MUNGED | (v & ~TC_MUNGED))
+#define CLR_TC_MUNGED(v) ( v & ~TC_MUNGED)
+
+#define TC_OK2MUNGE _TC_MAKEMASK1(1)
+#define SET_TC_OK2MUNGE(v) ( TC_OK2MUNGE | (v & ~TC_OK2MUNGE))
+#define CLR_TC_OK2MUNGE(v) ( v & ~TC_OK2MUNGE)
+
+#define S_TC_VERD _TC_MAKE32(2)
+#define M_TC_VERD _TC_MAKEMASK(4,S_TC_VERD)
+#define G_TC_VERD(x) _TC_GETVALUE(x,S_TC_VERD,M_TC_VERD)
+#define V_TC_VERD(x) _TC_MAKEVALUE(x,S_TC_VERD)
+#define SET_TC_VERD(v,n) ((V_TC_VERD(n)) | (v & ~M_TC_VERD))
+
+#define S_TC_FROM _TC_MAKE32(6)
+#define M_TC_FROM _TC_MAKEMASK(2,S_TC_FROM)
+#define G_TC_FROM(x) _TC_GETVALUE(x,S_TC_FROM,M_TC_FROM)
+#define V_TC_FROM(x) _TC_MAKEVALUE(x,S_TC_FROM)
+#define SET_TC_FROM(v,n) ((V_TC_FROM(n)) | (v & ~M_TC_FROM))
+#define AT_STACK 0x0
+#define AT_INGRESS 0x1
+#define AT_EGRESS 0x2
+
+#define TC_NCLS _TC_MAKEMASK1(8)
+#define SET_TC_NCLS(v) ( TC_NCLS | (v & ~TC_NCLS))
+#define CLR_TC_NCLS(v) ( v & ~TC_NCLS)
+
+#define S_TC_RTTL _TC_MAKE32(9)
+#define M_TC_RTTL _TC_MAKEMASK(3,S_TC_RTTL)
+#define G_TC_RTTL(x) _TC_GETVALUE(x,S_TC_RTTL,M_TC_RTTL)
+#define V_TC_RTTL(x) _TC_MAKEVALUE(x,S_TC_RTTL)
+#define SET_TC_RTTL(v,n) ((V_TC_RTTL(n)) | (v & ~M_TC_RTTL))
+
+#define S_TC_AT _TC_MAKE32(12)
+#define M_TC_AT _TC_MAKEMASK(2,S_TC_AT)
+#define G_TC_AT(x) _TC_GETVALUE(x,S_TC_AT,M_TC_AT)
+#define V_TC_AT(x) _TC_MAKEVALUE(x,S_TC_AT)
+#define SET_TC_AT(v,n) ((V_TC_AT(n)) | (v & ~M_TC_AT))
+
+/* Action attributes */
+enum
+{
+ TCA_ACT_UNSPEC,
+ TCA_ACT_KIND,
+ TCA_ACT_OPTIONS,
+ TCA_ACT_INDEX,
+ TCA_ACT_STATS,
+ __TCA_ACT_MAX
+};
+
+#define TCA_ACT_MAX __TCA_ACT_MAX
+#define TCA_OLD_COMPAT (TCA_ACT_MAX+1)
+#define TCA_ACT_MAX_PRIO 32
+#define TCA_ACT_BIND 1
+#define TCA_ACT_NOBIND 0
+#define TCA_ACT_UNBIND 1
+#define TCA_ACT_NOUNBIND 0
+#define TCA_ACT_REPLACE 1
+#define TCA_ACT_NOREPLACE 0
+#define MAX_REC_LOOP 4
+#define MAX_RED_LOOP 4
+
+#define TC_ACT_UNSPEC (-1)
+#define TC_ACT_OK 0
+#define TC_ACT_RECLASSIFY 1
+#define TC_ACT_SHOT 2
+#define TC_ACT_PIPE 3
+#define TC_ACT_STOLEN 4
+#define TC_ACT_QUEUED 5
+#define TC_ACT_REPEAT 6
+#define TC_ACT_JUMP 0x10000000
+
+/* Action type identifiers*/
+enum
+{
+ TCA_ID_UNSPEC=0,
+ TCA_ID_POLICE=1,
+ /* other actions go here */
+ __TCA_ID_MAX=255
+};
+
+#define TCA_ID_MAX __TCA_ID_MAX
+
+struct tc_police
+{
+ __u32 index;
+ int action;
+#define TC_POLICE_UNSPEC TC_ACT_UNSPEC
+#define TC_POLICE_OK TC_ACT_OK
+#define TC_POLICE_RECLASSIFY TC_ACT_RECLASSIFY
+#define TC_POLICE_SHOT TC_ACT_SHOT
+#define TC_POLICE_PIPE TC_ACT_PIPE
+
+ __u32 limit;
+ __u32 burst;
+ __u32 mtu;
+ struct tc_ratespec rate;
+ struct tc_ratespec peakrate;
+ int refcnt;
+ int bindcnt;
+ __u32 capab;
+};
+
+struct tcf_t
+{
+ __u64 install;
+ __u64 lastuse;
+ __u64 expires;
+};
+
+struct tc_cnt
+{
+ int refcnt;
+ int bindcnt;
+};
+
+#define tc_gen \
+ __u32 index; \
+ __u32 capab; \
+ int action; \
+ int refcnt; \
+ int bindcnt
+
+enum
+{
+ TCA_POLICE_UNSPEC,
+ TCA_POLICE_TBF,
+ TCA_POLICE_RATE,
+ TCA_POLICE_PEAKRATE,
+ TCA_POLICE_AVRATE,
+ TCA_POLICE_RESULT,
+ __TCA_POLICE_MAX
+#define TCA_POLICE_RESULT TCA_POLICE_RESULT
+};
+
+#define TCA_POLICE_MAX (__TCA_POLICE_MAX - 1)
+
+/* U32 filters */
+
+#define TC_U32_HTID(h) ((h)&0xFFF00000)
+#define TC_U32_USERHTID(h) (TC_U32_HTID(h)>>20)
+#define TC_U32_HASH(h) (((h)>>12)&0xFF)
+#define TC_U32_NODE(h) ((h)&0xFFF)
+#define TC_U32_KEY(h) ((h)&0xFFFFF)
+#define TC_U32_UNSPEC 0
+#define TC_U32_ROOT (0xFFF00000)
+
+enum
+{
+ TCA_U32_UNSPEC,
+ TCA_U32_CLASSID,
+ TCA_U32_HASH,
+ TCA_U32_LINK,
+ TCA_U32_DIVISOR,
+ TCA_U32_SEL,
+ TCA_U32_POLICE,
+ TCA_U32_ACT,
+ TCA_U32_INDEV,
+ TCA_U32_PCNT,
+ TCA_U32_MARK,
+ __TCA_U32_MAX
+};
+
+#define TCA_U32_MAX (__TCA_U32_MAX - 1)
+
+struct tc_u32_key
+{
+ __be32 mask;
+ __be32 val;
+ int off;
+ int offmask;
+};
+
+struct tc_u32_sel
+{
+ unsigned char flags;
+ unsigned char offshift;
+ unsigned char nkeys;
+
+ __be16 offmask;
+ __u16 off;
+ short offoff;
+
+ short hoff;
+ __be32 hmask;
+ struct tc_u32_key keys[0];
+};
+
+struct tc_u32_mark
+{
+ __u32 val;
+ __u32 mask;
+ __u32 success;
+};
+
+struct tc_u32_pcnt
+{
+ __u64 rcnt;
+ __u64 rhit;
+ __u64 kcnts[0];
+};
+
+/* Flags */
+
+#define TC_U32_TERMINAL 1
+#define TC_U32_OFFSET 2
+#define TC_U32_VAROFFSET 4
+#define TC_U32_EAT 8
+
+#define TC_U32_MAXDEPTH 8
+
+
+/* RSVP filter */
+
+enum
+{
+ TCA_RSVP_UNSPEC,
+ TCA_RSVP_CLASSID,
+ TCA_RSVP_DST,
+ TCA_RSVP_SRC,
+ TCA_RSVP_PINFO,
+ TCA_RSVP_POLICE,
+ TCA_RSVP_ACT,
+ __TCA_RSVP_MAX
+};
+
+#define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1 )
+
+struct tc_rsvp_gpi
+{
+ __u32 key;
+ __u32 mask;
+ int offset;
+};
+
+struct tc_rsvp_pinfo
+{
+ struct tc_rsvp_gpi dpi;
+ struct tc_rsvp_gpi spi;
+ __u8 protocol;
+ __u8 tunnelid;
+ __u8 tunnelhdr;
+ __u8 pad;
+};
+
+/* ROUTE filter */
+
+enum
+{
+ TCA_ROUTE4_UNSPEC,
+ TCA_ROUTE4_CLASSID,
+ TCA_ROUTE4_TO,
+ TCA_ROUTE4_FROM,
+ TCA_ROUTE4_IIF,
+ TCA_ROUTE4_POLICE,
+ TCA_ROUTE4_ACT,
+ __TCA_ROUTE4_MAX
+};
+
+#define TCA_ROUTE4_MAX (__TCA_ROUTE4_MAX - 1)
+
+
+/* FW filter */
+
+enum
+{
+ TCA_FW_UNSPEC,
+ TCA_FW_CLASSID,
+ TCA_FW_POLICE,
+ TCA_FW_INDEV, /* used by CONFIG_NET_CLS_IND */
+ TCA_FW_ACT, /* used by CONFIG_NET_CLS_ACT */
+ TCA_FW_MASK,
+ __TCA_FW_MAX
+};
+
+#define TCA_FW_MAX (__TCA_FW_MAX - 1)
+
+/* TC index filter */
+
+enum
+{
+ TCA_TCINDEX_UNSPEC,
+ TCA_TCINDEX_HASH,
+ TCA_TCINDEX_MASK,
+ TCA_TCINDEX_SHIFT,
+ TCA_TCINDEX_FALL_THROUGH,
+ TCA_TCINDEX_CLASSID,
+ TCA_TCINDEX_POLICE,
+ TCA_TCINDEX_ACT,
+ __TCA_TCINDEX_MAX
+};
+
+#define TCA_TCINDEX_MAX (__TCA_TCINDEX_MAX - 1)
+
+/* Flow filter */
+
+enum
+{
+ FLOW_KEY_SRC,
+ FLOW_KEY_DST,
+ FLOW_KEY_PROTO,
+ FLOW_KEY_PROTO_SRC,
+ FLOW_KEY_PROTO_DST,
+ FLOW_KEY_IIF,
+ FLOW_KEY_PRIORITY,
+ FLOW_KEY_MARK,
+ FLOW_KEY_NFCT,
+ FLOW_KEY_NFCT_SRC,
+ FLOW_KEY_NFCT_DST,
+ FLOW_KEY_NFCT_PROTO_SRC,
+ FLOW_KEY_NFCT_PROTO_DST,
+ FLOW_KEY_RTCLASSID,
+ FLOW_KEY_SKUID,
+ FLOW_KEY_SKGID,
+ FLOW_KEY_VLAN_TAG,
+ __FLOW_KEY_MAX,
+};
+
+#define FLOW_KEY_MAX (__FLOW_KEY_MAX - 1)
+
+enum
+{
+ FLOW_MODE_MAP,
+ FLOW_MODE_HASH,
+};
+
+enum
+{
+ TCA_FLOW_UNSPEC,
+ TCA_FLOW_KEYS,
+ TCA_FLOW_MODE,
+ TCA_FLOW_BASECLASS,
+ TCA_FLOW_RSHIFT,
+ TCA_FLOW_ADDEND,
+ TCA_FLOW_MASK,
+ TCA_FLOW_XOR,
+ TCA_FLOW_DIVISOR,
+ TCA_FLOW_ACT,
+ TCA_FLOW_POLICE,
+ TCA_FLOW_EMATCHES,
+ TCA_FLOW_PERTURB,
+ __TCA_FLOW_MAX
+};
+
+#define TCA_FLOW_MAX (__TCA_FLOW_MAX - 1)
+
+/* Basic filter */
+
+enum
+{
+ TCA_BASIC_UNSPEC,
+ TCA_BASIC_CLASSID,
+ TCA_BASIC_EMATCHES,
+ TCA_BASIC_ACT,
+ TCA_BASIC_POLICE,
+ __TCA_BASIC_MAX
+};
+
+#define TCA_BASIC_MAX (__TCA_BASIC_MAX - 1)
+
+
+/* Cgroup classifier */
+
+enum
+{
+ TCA_CGROUP_UNSPEC,
+ TCA_CGROUP_ACT,
+ TCA_CGROUP_POLICE,
+ TCA_CGROUP_EMATCHES,
+ __TCA_CGROUP_MAX,
+};
+
+#define TCA_CGROUP_MAX (__TCA_CGROUP_MAX - 1)
+
+/* Extended Matches */
+
+struct tcf_ematch_tree_hdr
+{
+ __u16 nmatches;
+ __u16 progid;
+};
+
+enum
+{
+ TCA_EMATCH_TREE_UNSPEC,
+ TCA_EMATCH_TREE_HDR,
+ TCA_EMATCH_TREE_LIST,
+ __TCA_EMATCH_TREE_MAX
+};
+#define TCA_EMATCH_TREE_MAX (__TCA_EMATCH_TREE_MAX - 1)
+
+struct tcf_ematch_hdr
+{
+ __u16 matchid;
+ __u16 kind;
+ __u16 flags;
+ __u16 pad; /* currently unused */
+};
+
+/* 0 1
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+ * +-----------------------+-+-+---+
+ * | Unused |S|I| R |
+ * +-----------------------+-+-+---+
+ *
+ * R(2) ::= relation to next ematch
+ * where: 0 0 END (last ematch)
+ * 0 1 AND
+ * 1 0 OR
+ * 1 1 Unused (invalid)
+ * I(1) ::= invert result
+ * S(1) ::= simple payload
+ */
+#define TCF_EM_REL_END 0
+#define TCF_EM_REL_AND (1<<0)
+#define TCF_EM_REL_OR (1<<1)
+#define TCF_EM_INVERT (1<<2)
+#define TCF_EM_SIMPLE (1<<3)
+
+#define TCF_EM_REL_MASK 3
+#define TCF_EM_REL_VALID(v) (((v) & TCF_EM_REL_MASK) != TCF_EM_REL_MASK)
+
+enum
+{
+ TCF_LAYER_LINK,
+ TCF_LAYER_NETWORK,
+ TCF_LAYER_TRANSPORT,
+ __TCF_LAYER_MAX
+};
+#define TCF_LAYER_MAX (__TCF_LAYER_MAX - 1)
+
+/* Ematch type assignments
+ * 1..32767 Reserved for ematches inside kernel tree
+ * 32768..65535 Free to use, not reliable
+ */
+#define TCF_EM_CONTAINER 0
+#define TCF_EM_CMP 1
+#define TCF_EM_NBYTE 2
+#define TCF_EM_U32 3
+#define TCF_EM_META 4
+#define TCF_EM_TEXT 5
+#define TCF_EM_VLAN 6
+#define TCF_EM_MAX 6
+
+enum
+{
+ TCF_EM_PROG_TC
+};
+
+enum
+{
+ TCF_EM_OPND_EQ,
+ TCF_EM_OPND_GT,
+ TCF_EM_OPND_LT
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pkt_sched.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pkt_sched.h
new file mode 100644
index 0000000..d51a2b3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pkt_sched.h
@@ -0,0 +1,521 @@
+#ifndef __LINUX_PKT_SCHED_H
+#define __LINUX_PKT_SCHED_H
+
+#include <linux/types.h>
+
+/* Logical priority bands not depending on specific packet scheduler.
+ Every scheduler will map them to real traffic classes, if it has
+ no more precise mechanism to classify packets.
+
+ These numbers have no special meaning, though their coincidence
+ with obsolete IPv6 values is not occasional :-). New IPv6 drafts
+ preferred full anarchy inspired by diffserv group.
+
+ Note: TC_PRIO_BESTEFFORT does not mean that it is the most unhappy
+ class, actually, as rule it will be handled with more care than
+ filler or even bulk.
+ */
+
+#define TC_PRIO_BESTEFFORT 0
+#define TC_PRIO_FILLER 1
+#define TC_PRIO_BULK 2
+#define TC_PRIO_INTERACTIVE_BULK 4
+#define TC_PRIO_INTERACTIVE 6
+#define TC_PRIO_CONTROL 7
+
+#define TC_PRIO_MAX 15
+
+/* Generic queue statistics, available for all the elements.
+ Particular schedulers may have also their private records.
+ */
+
+struct tc_stats
+{
+ __u64 bytes; /* NUmber of enqueues bytes */
+ __u32 packets; /* Number of enqueued packets */
+ __u32 drops; /* Packets dropped because of lack of resources */
+ __u32 overlimits; /* Number of throttle events when this
+ * flow goes out of allocated bandwidth */
+ __u32 bps; /* Current flow byte rate */
+ __u32 pps; /* Current flow packet rate */
+ __u32 qlen;
+ __u32 backlog;
+};
+
+struct tc_estimator
+{
+ signed char interval;
+ unsigned char ewma_log;
+};
+
+/* "Handles"
+ ---------
+
+ All the traffic control objects have 32bit identifiers, or "handles".
+
+ They can be considered as opaque numbers from user API viewpoint,
+ but actually they always consist of two fields: major and
+ minor numbers, which are interpreted by kernel specially,
+ that may be used by applications, though not recommended.
+
+ F.e. qdisc handles always have minor number equal to zero,
+ classes (or flows) have major equal to parent qdisc major, and
+ minor uniquely identifying class inside qdisc.
+
+ Macros to manipulate handles:
+ */
+
+#define TC_H_MAJ_MASK (0xFFFF0000U)
+#define TC_H_MIN_MASK (0x0000FFFFU)
+#define TC_H_MAJ(h) ((h)&TC_H_MAJ_MASK)
+#define TC_H_MIN(h) ((h)&TC_H_MIN_MASK)
+#define TC_H_MAKE(maj,min) (((maj)&TC_H_MAJ_MASK)|((min)&TC_H_MIN_MASK))
+
+#define TC_H_UNSPEC (0U)
+#define TC_H_ROOT (0xFFFFFFFFU)
+#define TC_H_INGRESS (0xFFFFFFF1U)
+
+struct tc_ratespec
+{
+ unsigned char cell_log;
+ unsigned char __reserved;
+ unsigned short overhead;
+ short cell_align;
+ unsigned short mpu;
+ __u32 rate;
+};
+
+#define TC_RTAB_SIZE 1024
+
+struct tc_sizespec {
+ unsigned char cell_log;
+ unsigned char size_log;
+ short cell_align;
+ int overhead;
+ unsigned int linklayer;
+ unsigned int mpu;
+ unsigned int mtu;
+ unsigned int tsize;
+};
+
+enum {
+ TCA_STAB_UNSPEC,
+ TCA_STAB_BASE,
+ TCA_STAB_DATA,
+ __TCA_STAB_MAX
+};
+
+#define TCA_STAB_MAX (__TCA_STAB_MAX - 1)
+
+/* FIFO section */
+
+struct tc_fifo_qopt
+{
+ __u32 limit; /* Queue length: bytes for bfifo, packets for pfifo */
+};
+
+/* PRIO section */
+
+#define TCQ_PRIO_BANDS 16
+#define TCQ_MIN_PRIO_BANDS 2
+
+struct tc_prio_qopt
+{
+ int bands; /* Number of bands */
+ __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */
+};
+
+/* MULTIQ section */
+
+struct tc_multiq_qopt {
+ __u16 bands; /* Number of bands */
+ __u16 max_bands; /* Maximum number of queues */
+};
+
+/* TBF section */
+
+struct tc_tbf_qopt
+{
+ struct tc_ratespec rate;
+ struct tc_ratespec peakrate;
+ __u32 limit;
+ __u32 buffer;
+ __u32 mtu;
+};
+
+enum
+{
+ TCA_TBF_UNSPEC,
+ TCA_TBF_PARMS,
+ TCA_TBF_RTAB,
+ TCA_TBF_PTAB,
+ __TCA_TBF_MAX,
+};
+
+#define TCA_TBF_MAX (__TCA_TBF_MAX - 1)
+
+
+/* TEQL section */
+
+/* TEQL does not require any parameters */
+
+/* SFQ section */
+
+struct tc_sfq_qopt
+{
+ unsigned quantum; /* Bytes per round allocated to flow */
+ int perturb_period; /* Period of hash perturbation */
+ __u32 limit; /* Maximal packets in queue */
+ unsigned divisor; /* Hash divisor */
+ unsigned flows; /* Maximal number of flows */
+};
+
+struct tc_sfq_xstats
+{
+ __s32 allot;
+};
+
+/*
+ * NOTE: limit, divisor and flows are hardwired to code at the moment.
+ *
+ * limit=flows=128, divisor=1024;
+ *
+ * The only reason for this is efficiency, it is possible
+ * to change these parameters in compile time.
+ */
+
+/* RED section */
+
+enum
+{
+ TCA_RED_UNSPEC,
+ TCA_RED_PARMS,
+ TCA_RED_STAB,
+ __TCA_RED_MAX,
+};
+
+#define TCA_RED_MAX (__TCA_RED_MAX - 1)
+
+struct tc_red_qopt
+{
+ __u32 limit; /* HARD maximal queue length (bytes) */
+ __u32 qth_min; /* Min average length threshold (bytes) */
+ __u32 qth_max; /* Max average length threshold (bytes) */
+ unsigned char Wlog; /* log(W) */
+ unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */
+ unsigned char Scell_log; /* cell size for idle damping */
+ unsigned char flags;
+#define TC_RED_ECN 1
+#define TC_RED_HARDDROP 2
+};
+
+struct tc_red_xstats
+{
+ __u32 early; /* Early drops */
+ __u32 pdrop; /* Drops due to queue limits */
+ __u32 other; /* Drops due to drop() calls */
+ __u32 marked; /* Marked packets */
+};
+
+/* GRED section */
+
+#define MAX_DPs 16
+
+enum
+{
+ TCA_GRED_UNSPEC,
+ TCA_GRED_PARMS,
+ TCA_GRED_STAB,
+ TCA_GRED_DPS,
+ __TCA_GRED_MAX,
+};
+
+#define TCA_GRED_MAX (__TCA_GRED_MAX - 1)
+
+struct tc_gred_qopt
+{
+ __u32 limit; /* HARD maximal queue length (bytes) */
+ __u32 qth_min; /* Min average length threshold (bytes) */
+ __u32 qth_max; /* Max average length threshold (bytes) */
+ __u32 DP; /* upto 2^32 DPs */
+ __u32 backlog;
+ __u32 qave;
+ __u32 forced;
+ __u32 early;
+ __u32 other;
+ __u32 pdrop;
+ __u8 Wlog; /* log(W) */
+ __u8 Plog; /* log(P_max/(qth_max-qth_min)) */
+ __u8 Scell_log; /* cell size for idle damping */
+ __u8 prio; /* prio of this VQ */
+ __u32 packets;
+ __u32 bytesin;
+};
+
+/* gred setup */
+struct tc_gred_sopt
+{
+ __u32 DPs;
+ __u32 def_DP;
+ __u8 grio;
+ __u8 flags;
+ __u16 pad1;
+};
+
+/* HTB section */
+#define TC_HTB_NUMPRIO 8
+#define TC_HTB_MAXDEPTH 8
+#define TC_HTB_PROTOVER 3 /* the same as HTB and TC's major */
+
+struct tc_htb_opt
+{
+ struct tc_ratespec rate;
+ struct tc_ratespec ceil;
+ __u32 buffer;
+ __u32 cbuffer;
+ __u32 quantum;
+ __u32 level; /* out only */
+ __u32 prio;
+};
+struct tc_htb_glob
+{
+ __u32 version; /* to match HTB/TC */
+ __u32 rate2quantum; /* bps->quantum divisor */
+ __u32 defcls; /* default class number */
+ __u32 debug; /* debug flags */
+
+ /* stats */
+ __u32 direct_pkts; /* count of non shapped packets */
+};
+enum
+{
+ TCA_HTB_UNSPEC,
+ TCA_HTB_PARMS,
+ TCA_HTB_INIT,
+ TCA_HTB_CTAB,
+ TCA_HTB_RTAB,
+ __TCA_HTB_MAX,
+};
+
+#define TCA_HTB_MAX (__TCA_HTB_MAX - 1)
+
+struct tc_htb_xstats
+{
+ __u32 lends;
+ __u32 borrows;
+ __u32 giants; /* too big packets (rate will not be accurate) */
+ __u32 tokens;
+ __u32 ctokens;
+};
+
+/* HFSC section */
+
+struct tc_hfsc_qopt
+{
+ __u16 defcls; /* default class */
+};
+
+struct tc_service_curve
+{
+ __u32 m1; /* slope of the first segment in bps */
+ __u32 d; /* x-projection of the first segment in us */
+ __u32 m2; /* slope of the second segment in bps */
+};
+
+struct tc_hfsc_stats
+{
+ __u64 work; /* total work done */
+ __u64 rtwork; /* work done by real-time criteria */
+ __u32 period; /* current period */
+ __u32 level; /* class level in hierarchy */
+};
+
+enum
+{
+ TCA_HFSC_UNSPEC,
+ TCA_HFSC_RSC,
+ TCA_HFSC_FSC,
+ TCA_HFSC_USC,
+ __TCA_HFSC_MAX,
+};
+
+#define TCA_HFSC_MAX (__TCA_HFSC_MAX - 1)
+
+
+/* CBQ section */
+
+#define TC_CBQ_MAXPRIO 8
+#define TC_CBQ_MAXLEVEL 8
+#define TC_CBQ_DEF_EWMA 5
+
+struct tc_cbq_lssopt
+{
+ unsigned char change;
+ unsigned char flags;
+#define TCF_CBQ_LSS_BOUNDED 1
+#define TCF_CBQ_LSS_ISOLATED 2
+ unsigned char ewma_log;
+ unsigned char level;
+#define TCF_CBQ_LSS_FLAGS 1
+#define TCF_CBQ_LSS_EWMA 2
+#define TCF_CBQ_LSS_MAXIDLE 4
+#define TCF_CBQ_LSS_MINIDLE 8
+#define TCF_CBQ_LSS_OFFTIME 0x10
+#define TCF_CBQ_LSS_AVPKT 0x20
+ __u32 maxidle;
+ __u32 minidle;
+ __u32 offtime;
+ __u32 avpkt;
+};
+
+struct tc_cbq_wrropt
+{
+ unsigned char flags;
+ unsigned char priority;
+ unsigned char cpriority;
+ unsigned char __reserved;
+ __u32 allot;
+ __u32 weight;
+};
+
+struct tc_cbq_ovl
+{
+ unsigned char strategy;
+#define TC_CBQ_OVL_CLASSIC 0
+#define TC_CBQ_OVL_DELAY 1
+#define TC_CBQ_OVL_LOWPRIO 2
+#define TC_CBQ_OVL_DROP 3
+#define TC_CBQ_OVL_RCLASSIC 4
+ unsigned char priority2;
+ __u16 pad;
+ __u32 penalty;
+};
+
+struct tc_cbq_police
+{
+ unsigned char police;
+ unsigned char __res1;
+ unsigned short __res2;
+};
+
+struct tc_cbq_fopt
+{
+ __u32 split;
+ __u32 defmap;
+ __u32 defchange;
+};
+
+struct tc_cbq_xstats
+{
+ __u32 borrows;
+ __u32 overactions;
+ __s32 avgidle;
+ __s32 undertime;
+};
+
+enum
+{
+ TCA_CBQ_UNSPEC,
+ TCA_CBQ_LSSOPT,
+ TCA_CBQ_WRROPT,
+ TCA_CBQ_FOPT,
+ TCA_CBQ_OVL_STRATEGY,
+ TCA_CBQ_RATE,
+ TCA_CBQ_RTAB,
+ TCA_CBQ_POLICE,
+ __TCA_CBQ_MAX,
+};
+
+#define TCA_CBQ_MAX (__TCA_CBQ_MAX - 1)
+
+/* dsmark section */
+
+enum {
+ TCA_DSMARK_UNSPEC,
+ TCA_DSMARK_INDICES,
+ TCA_DSMARK_DEFAULT_INDEX,
+ TCA_DSMARK_SET_TC_INDEX,
+ TCA_DSMARK_MASK,
+ TCA_DSMARK_VALUE,
+ __TCA_DSMARK_MAX,
+};
+
+#define TCA_DSMARK_MAX (__TCA_DSMARK_MAX - 1)
+
+/* ATM section */
+
+enum {
+ TCA_ATM_UNSPEC,
+ TCA_ATM_FD, /* file/socket descriptor */
+ TCA_ATM_PTR, /* pointer to descriptor - later */
+ TCA_ATM_HDR, /* LL header */
+ TCA_ATM_EXCESS, /* excess traffic class (0 for CLP) */
+ TCA_ATM_ADDR, /* PVC address (for output only) */
+ TCA_ATM_STATE, /* VC state (ATM_VS_*; for output only) */
+ __TCA_ATM_MAX,
+};
+
+#define TCA_ATM_MAX (__TCA_ATM_MAX - 1)
+
+/* Network emulator */
+
+enum
+{
+ TCA_NETEM_UNSPEC,
+ TCA_NETEM_CORR,
+ TCA_NETEM_DELAY_DIST,
+ TCA_NETEM_REORDER,
+ TCA_NETEM_CORRUPT,
+ __TCA_NETEM_MAX,
+};
+
+#define TCA_NETEM_MAX (__TCA_NETEM_MAX - 1)
+
+struct tc_netem_qopt
+{
+ __u32 latency; /* added delay (us) */
+ __u32 limit; /* fifo limit (packets) */
+ __u32 loss; /* random packet loss (0=none ~0=100%) */
+ __u32 gap; /* re-ordering gap (0 for none) */
+ __u32 duplicate; /* random packet dup (0=none ~0=100%) */
+ __u32 jitter; /* random jitter in latency (us) */
+};
+
+struct tc_netem_corr
+{
+ __u32 delay_corr; /* delay correlation */
+ __u32 loss_corr; /* packet loss correlation */
+ __u32 dup_corr; /* duplicate correlation */
+};
+
+struct tc_netem_reorder
+{
+ __u32 probability;
+ __u32 correlation;
+};
+
+struct tc_netem_corrupt
+{
+ __u32 probability;
+ __u32 correlation;
+};
+
+#define NETEM_DIST_SCALE 8192
+
+/* DRR */
+
+enum
+{
+ TCA_DRR_UNSPEC,
+ TCA_DRR_QUANTUM,
+ __TCA_DRR_MAX
+};
+
+#define TCA_DRR_MAX (__TCA_DRR_MAX - 1)
+
+struct tc_drr_stats
+{
+ __u32 deficit;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pktcdvd.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pktcdvd.h
new file mode 100644
index 0000000..eb6805f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pktcdvd.h
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2000 Jens Axboe <axboe@suse.de>
+ * Copyright (C) 2001-2004 Peter Osterlund <petero2@telia.com>
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License. See linux/COPYING for more information.
+ *
+ * Packet writing layer for ATAPI and SCSI CD-R, CD-RW, DVD-R, and
+ * DVD-RW devices.
+ *
+ */
+#ifndef __PKTCDVD_H
+#define __PKTCDVD_H
+
+#include <linux/types.h>
+
+/*
+ * 1 for normal debug messages, 2 is very verbose. 0 to turn it off.
+ */
+#define PACKET_DEBUG 1
+
+#define MAX_WRITERS 8
+
+#define PKT_RB_POOL_SIZE 512
+
+/*
+ * How long we should hold a non-full packet before starting data gathering.
+ */
+#define PACKET_WAIT_TIME (HZ * 5 / 1000)
+
+/*
+ * use drive write caching -- we need deferred error handling to be
+ * able to sucessfully recover with this option (drive will return good
+ * status as soon as the cdb is validated).
+ */
+#if defined(CONFIG_CDROM_PKTCDVD_WCACHE)
+#define USE_WCACHING 1
+#else
+#define USE_WCACHING 0
+#endif
+
+/*
+ * No user-servicable parts beyond this point ->
+ */
+
+/*
+ * device types
+ */
+#define PACKET_CDR 1
+#define PACKET_CDRW 2
+#define PACKET_DVDR 3
+#define PACKET_DVDRW 4
+
+/*
+ * flags
+ */
+#define PACKET_WRITABLE 1 /* pd is writable */
+#define PACKET_NWA_VALID 2 /* next writable address valid */
+#define PACKET_LRA_VALID 3 /* last recorded address valid */
+#define PACKET_MERGE_SEGS 4 /* perform segment merging to keep */
+ /* underlying cdrom device happy */
+
+/*
+ * Disc status -- from READ_DISC_INFO
+ */
+#define PACKET_DISC_EMPTY 0
+#define PACKET_DISC_INCOMPLETE 1
+#define PACKET_DISC_COMPLETE 2
+#define PACKET_DISC_OTHER 3
+
+/*
+ * write type, and corresponding data block type
+ */
+#define PACKET_MODE1 1
+#define PACKET_MODE2 2
+#define PACKET_BLOCK_MODE1 8
+#define PACKET_BLOCK_MODE2 10
+
+/*
+ * Last session/border status
+ */
+#define PACKET_SESSION_EMPTY 0
+#define PACKET_SESSION_INCOMPLETE 1
+#define PACKET_SESSION_RESERVED 2
+#define PACKET_SESSION_COMPLETE 3
+
+#define PACKET_MCN "4a656e734178626f65323030300000"
+
+#undef PACKET_USE_LS
+
+#define PKT_CTRL_CMD_SETUP 0
+#define PKT_CTRL_CMD_TEARDOWN 1
+#define PKT_CTRL_CMD_STATUS 2
+
+struct pkt_ctrl_command {
+ __u32 command; /* in: Setup, teardown, status */
+ __u32 dev_index; /* in/out: Device index */
+ __u32 dev; /* in/out: Device nr for cdrw device */
+ __u32 pkt_dev; /* in/out: Device nr for packet device */
+ __u32 num_devices; /* out: Largest device index + 1 */
+ __u32 padding; /* Not used */
+};
+
+/*
+ * packet ioctls
+ */
+#define PACKET_IOCTL_MAGIC ('X')
+#define PACKET_CTRL_CMD _IOWR(PACKET_IOCTL_MAGIC, 1, struct pkt_ctrl_command)
+
+
+#endif /* __PKTCDVD_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pmu.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pmu.h
new file mode 100644
index 0000000..5a77399
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/pmu.h
@@ -0,0 +1,135 @@
+/*
+ * Definitions for talking to the PMU. The PMU is a microcontroller
+ * which controls battery charging and system power on PowerBook 3400
+ * and 2400 models as well as the RTC and various other things.
+ *
+ * Copyright (C) 1998 Paul Mackerras.
+ */
+
+
+#define PMU_DRIVER_VERSION 2
+
+/*
+ * PMU commands
+ */
+#define PMU_POWER_CTRL0 0x10 /* control power of some devices */
+#define PMU_POWER_CTRL 0x11 /* control power of some devices */
+#define PMU_ADB_CMD 0x20 /* send ADB packet */
+#define PMU_ADB_POLL_OFF 0x21 /* disable ADB auto-poll */
+#define PMU_WRITE_NVRAM 0x33 /* write non-volatile RAM */
+#define PMU_READ_NVRAM 0x3b /* read non-volatile RAM */
+#define PMU_SET_RTC 0x30 /* set real-time clock */
+#define PMU_READ_RTC 0x38 /* read real-time clock */
+#define PMU_SET_VOLBUTTON 0x40 /* set volume up/down position */
+#define PMU_BACKLIGHT_BRIGHT 0x41 /* set backlight brightness */
+#define PMU_GET_VOLBUTTON 0x48 /* get volume up/down position */
+#define PMU_PCEJECT 0x4c /* eject PC-card from slot */
+#define PMU_BATTERY_STATE 0x6b /* report battery state etc. */
+#define PMU_SMART_BATTERY_STATE 0x6f /* report battery state (new way) */
+#define PMU_SET_INTR_MASK 0x70 /* set PMU interrupt mask */
+#define PMU_INT_ACK 0x78 /* read interrupt bits */
+#define PMU_SHUTDOWN 0x7e /* turn power off */
+#define PMU_CPU_SPEED 0x7d /* control CPU speed on some models */
+#define PMU_SLEEP 0x7f /* put CPU to sleep */
+#define PMU_POWER_EVENTS 0x8f /* Send power-event commands to PMU */
+#define PMU_I2C_CMD 0x9a /* I2C operations */
+#define PMU_RESET 0xd0 /* reset CPU */
+#define PMU_GET_BRIGHTBUTTON 0xd9 /* report brightness up/down pos */
+#define PMU_GET_COVER 0xdc /* report cover open/closed */
+#define PMU_SYSTEM_READY 0xdf /* tell PMU we are awake */
+#define PMU_GET_VERSION 0xea /* read the PMU version */
+
+/* Bits to use with the PMU_POWER_CTRL0 command */
+#define PMU_POW0_ON 0x80 /* OR this to power ON the device */
+#define PMU_POW0_OFF 0x00 /* leave bit 7 to 0 to power it OFF */
+#define PMU_POW0_HARD_DRIVE 0x04 /* Hard drive power (on wallstreet/lombard ?) */
+
+/* Bits to use with the PMU_POWER_CTRL command */
+#define PMU_POW_ON 0x80 /* OR this to power ON the device */
+#define PMU_POW_OFF 0x00 /* leave bit 7 to 0 to power it OFF */
+#define PMU_POW_BACKLIGHT 0x01 /* backlight power */
+#define PMU_POW_CHARGER 0x02 /* battery charger power */
+#define PMU_POW_IRLED 0x04 /* IR led power (on wallstreet) */
+#define PMU_POW_MEDIABAY 0x08 /* media bay power (wallstreet/lombard ?) */
+
+/* Bits in PMU interrupt and interrupt mask bytes */
+#define PMU_INT_PCEJECT 0x04 /* PC-card eject buttons */
+#define PMU_INT_SNDBRT 0x08 /* sound/brightness up/down buttons */
+#define PMU_INT_ADB 0x10 /* ADB autopoll or reply data */
+#define PMU_INT_BATTERY 0x20 /* Battery state change */
+#define PMU_INT_ENVIRONMENT 0x40 /* Environment interrupts */
+#define PMU_INT_TICK 0x80 /* 1-second tick interrupt */
+
+/* Other bits in PMU interrupt valid when PMU_INT_ADB is set */
+#define PMU_INT_ADB_AUTO 0x04 /* ADB autopoll, when PMU_INT_ADB */
+#define PMU_INT_WAITING_CHARGER 0x01 /* ??? */
+#define PMU_INT_AUTO_SRQ_POLL 0x02 /* ??? */
+
+/* Bits in the environement message (either obtained via PMU_GET_COVER,
+ * or via PMU_INT_ENVIRONMENT on core99 */
+#define PMU_ENV_LID_CLOSED 0x01 /* The lid is closed */
+
+/* I2C related definitions */
+#define PMU_I2C_MODE_SIMPLE 0
+#define PMU_I2C_MODE_STDSUB 1
+#define PMU_I2C_MODE_COMBINED 2
+
+#define PMU_I2C_BUS_STATUS 0
+#define PMU_I2C_BUS_SYSCLK 1
+#define PMU_I2C_BUS_POWER 2
+
+#define PMU_I2C_STATUS_OK 0
+#define PMU_I2C_STATUS_DATAREAD 1
+#define PMU_I2C_STATUS_BUSY 0xfe
+
+
+/* Kind of PMU (model) */
+enum {
+ PMU_UNKNOWN,
+ PMU_OHARE_BASED, /* 2400, 3400, 3500 (old G3 powerbook) */
+ PMU_HEATHROW_BASED, /* PowerBook G3 series */
+ PMU_PADDINGTON_BASED, /* 1999 PowerBook G3 */
+ PMU_KEYLARGO_BASED, /* Core99 motherboard (PMU99) */
+ PMU_68K_V1, /* 68K PMU, version 1 */
+ PMU_68K_V2, /* 68K PMU, version 2 */
+};
+
+/* PMU PMU_POWER_EVENTS commands */
+enum {
+ PMU_PWR_GET_POWERUP_EVENTS = 0x00,
+ PMU_PWR_SET_POWERUP_EVENTS = 0x01,
+ PMU_PWR_CLR_POWERUP_EVENTS = 0x02,
+ PMU_PWR_GET_WAKEUP_EVENTS = 0x03,
+ PMU_PWR_SET_WAKEUP_EVENTS = 0x04,
+ PMU_PWR_CLR_WAKEUP_EVENTS = 0x05,
+};
+
+/* Power events wakeup bits */
+enum {
+ PMU_PWR_WAKEUP_KEY = 0x01, /* Wake on key press */
+ PMU_PWR_WAKEUP_AC_INSERT = 0x02, /* Wake on AC adapter plug */
+ PMU_PWR_WAKEUP_AC_CHANGE = 0x04,
+ PMU_PWR_WAKEUP_LID_OPEN = 0x08,
+ PMU_PWR_WAKEUP_RING = 0x10,
+};
+
+/*
+ * Ioctl commands for the /dev/pmu device
+ */
+#include <linux/ioctl.h>
+
+/* no param */
+#define PMU_IOC_SLEEP _IO('B', 0)
+/* out param: u32* backlight value: 0 to 15 */
+#define PMU_IOC_GET_BACKLIGHT _IOR('B', 1, size_t)
+/* in param: u32 backlight value: 0 to 15 */
+#define PMU_IOC_SET_BACKLIGHT _IOW('B', 2, size_t)
+/* out param: u32* PMU model */
+#define PMU_IOC_GET_MODEL _IOR('B', 3, size_t)
+/* out param: u32* has_adb: 0 or 1 */
+#define PMU_IOC_HAS_ADB _IOR('B', 4, size_t)
+/* out param: u32* can_sleep: 0 or 1 */
+#define PMU_IOC_CAN_SLEEP _IOR('B', 5, size_t)
+/* no param, but historically was _IOR('B', 6, 0), meaning 4 bytes */
+#define PMU_IOC_GRAB_BACKLIGHT _IOR('B', 6, size_t)
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/poll.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/poll.h
new file mode 100644
index 0000000..421b305
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/poll.h
@@ -0,0 +1,7 @@
+#ifndef _LINUX_POLL_H
+#define _LINUX_POLL_H
+
+#include <asm/poll.h>
+
+
+#endif /* _LINUX_POLL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/posix_types.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/posix_types.h
new file mode 100644
index 0000000..f04c98c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/posix_types.h
@@ -0,0 +1,49 @@
+#ifndef _LINUX_POSIX_TYPES_H
+#define _LINUX_POSIX_TYPES_H
+
+#include <linux/stddef.h>
+
+/*
+ * This allows for 1024 file descriptors: if NR_OPEN is ever grown
+ * beyond that you'll have to change this too. But 1024 fd's seem to be
+ * enough even for such "real" unices like OSF/1, so hopefully this is
+ * one limit that doesn't have to be changed [again].
+ *
+ * Note that POSIX wants the FD_CLEAR(fd,fdsetp) defines to be in
+ * <sys/time.h> (and thus <linux/time.h>) - but this is a more logical
+ * place for them. Solved by having dummy defines in <sys/time.h>.
+ */
+
+/*
+ * Those macros may have been defined in <gnu/types.h>. But we always
+ * use the ones here.
+ */
+#undef __NFDBITS
+#define __NFDBITS (8 * sizeof(unsigned long))
+
+#undef __FD_SETSIZE
+#define __FD_SETSIZE 1024
+
+#undef __FDSET_LONGS
+#define __FDSET_LONGS (__FD_SETSIZE/__NFDBITS)
+
+#undef __FDELT
+#define __FDELT(d) ((d) / __NFDBITS)
+
+#undef __FDMASK
+#define __FDMASK(d) (1UL << ((d) % __NFDBITS))
+
+typedef struct {
+ unsigned long fds_bits [__FDSET_LONGS];
+} __kernel_fd_set;
+
+/* Type of a signal handler. */
+typedef void (*__kernel_sighandler_t)(int);
+
+/* Type of a SYSV IPC key. */
+typedef int __kernel_key_t;
+typedef int __kernel_mqd_t;
+
+#include <asm/posix_types.h>
+
+#endif /* _LINUX_POSIX_TYPES_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ppdev.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ppdev.h
new file mode 100644
index 0000000..dc18c5d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ppdev.h
@@ -0,0 +1,99 @@
+/*
+ * linux/include/linux/ppdev.h
+ *
+ * User-space parallel port device driver (header file).
+ *
+ * Copyright (C) 1998-9 Tim Waugh <tim@cyberelk.demon.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * Added PPGETTIME/PPSETTIME, Fred Barnes, 1999
+ * Added PPGETMODES/PPGETMODE/PPGETPHASE, Fred Barnes <frmb2@ukc.ac.uk>, 03/01/2001
+ */
+
+#define PP_IOCTL 'p'
+
+/* Set mode for read/write (e.g. IEEE1284_MODE_EPP) */
+#define PPSETMODE _IOW(PP_IOCTL, 0x80, int)
+
+/* Read status */
+#define PPRSTATUS _IOR(PP_IOCTL, 0x81, unsigned char)
+#define PPWSTATUS OBSOLETE__IOW(PP_IOCTL, 0x82, unsigned char)
+
+/* Read/write control */
+#define PPRCONTROL _IOR(PP_IOCTL, 0x83, unsigned char)
+#define PPWCONTROL _IOW(PP_IOCTL, 0x84, unsigned char)
+
+struct ppdev_frob_struct {
+ unsigned char mask;
+ unsigned char val;
+};
+#define PPFCONTROL _IOW(PP_IOCTL, 0x8e, struct ppdev_frob_struct)
+
+/* Read/write data */
+#define PPRDATA _IOR(PP_IOCTL, 0x85, unsigned char)
+#define PPWDATA _IOW(PP_IOCTL, 0x86, unsigned char)
+
+/* Read/write econtrol (not used) */
+#define PPRECONTROL OBSOLETE__IOR(PP_IOCTL, 0x87, unsigned char)
+#define PPWECONTROL OBSOLETE__IOW(PP_IOCTL, 0x88, unsigned char)
+
+/* Read/write FIFO (not used) */
+#define PPRFIFO OBSOLETE__IOR(PP_IOCTL, 0x89, unsigned char)
+#define PPWFIFO OBSOLETE__IOW(PP_IOCTL, 0x8a, unsigned char)
+
+/* Claim the port to start using it */
+#define PPCLAIM _IO(PP_IOCTL, 0x8b)
+
+/* Release the port when you aren't using it */
+#define PPRELEASE _IO(PP_IOCTL, 0x8c)
+
+/* Yield the port (release it if another driver is waiting,
+ * then reclaim) */
+#define PPYIELD _IO(PP_IOCTL, 0x8d)
+
+/* Register device exclusively (must be before PPCLAIM). */
+#define PPEXCL _IO(PP_IOCTL, 0x8f)
+
+/* Data line direction: non-zero for input mode. */
+#define PPDATADIR _IOW(PP_IOCTL, 0x90, int)
+
+/* Negotiate a particular IEEE 1284 mode. */
+#define PPNEGOT _IOW(PP_IOCTL, 0x91, int)
+
+/* Set control lines when an interrupt occurs. */
+#define PPWCTLONIRQ _IOW(PP_IOCTL, 0x92, unsigned char)
+
+/* Clear (and return) interrupt count. */
+#define PPCLRIRQ _IOR(PP_IOCTL, 0x93, int)
+
+/* Set the IEEE 1284 phase that we're in (e.g. IEEE1284_PH_FWD_IDLE) */
+#define PPSETPHASE _IOW(PP_IOCTL, 0x94, int)
+
+/* Set and get port timeout (struct timeval's) */
+#define PPGETTIME _IOR(PP_IOCTL, 0x95, struct timeval)
+#define PPSETTIME _IOW(PP_IOCTL, 0x96, struct timeval)
+
+/* Get available modes (what the hardware can do) */
+#define PPGETMODES _IOR(PP_IOCTL, 0x97, unsigned int)
+
+/* Get the current mode and phaze */
+#define PPGETMODE _IOR(PP_IOCTL, 0x98, int)
+#define PPGETPHASE _IOR(PP_IOCTL, 0x99, int)
+
+/* get/set flags */
+#define PPGETFLAGS _IOR(PP_IOCTL, 0x9a, int)
+#define PPSETFLAGS _IOW(PP_IOCTL, 0x9b, int)
+
+/* flags visible to the world */
+#define PP_FASTWRITE (1<<2)
+#define PP_FASTREAD (1<<3)
+#define PP_W91284PIC (1<<4)
+
+/* only masks user-visible flags */
+#define PP_FLAGMASK (PP_FASTWRITE | PP_FASTREAD | PP_W91284PIC)
+
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ppp-comp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ppp-comp.h
new file mode 100644
index 0000000..0748d39
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ppp-comp.h
@@ -0,0 +1,210 @@
+/*
+ * ppp-comp.h - Definitions for doing PPP packet compression.
+ *
+ * Copyright (c) 1994 The Australian National University.
+ * All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation is hereby granted, provided that the above copyright
+ * notice appears in all copies. This software is provided without any
+ * warranty, express or implied. The Australian National University
+ * makes no representations about the suitability of this software for
+ * any purpose.
+ *
+ * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
+ * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+ * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
+ * OF SUCH DAMAGE.
+ *
+ * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
+ * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
+ * OR MODIFICATIONS.
+ */
+
+/*
+ * ==FILEVERSION 980319==
+ *
+ * NOTE TO MAINTAINERS:
+ * If you modify this file at all, please set the above date.
+ * ppp-comp.h is shipped with a PPP distribution as well as with the kernel;
+ * if everyone increases the FILEVERSION number above, then scripts
+ * can do the right thing when deciding whether to install a new ppp-comp.h
+ * file. Don't change the format of that line otherwise, so the
+ * installation script can recognize it.
+ */
+
+#ifndef _NET_PPP_COMP_H
+#define _NET_PPP_COMP_H
+
+struct module;
+
+/*
+ * The following symbols control whether we include code for
+ * various compression methods.
+ */
+
+#ifndef DO_BSD_COMPRESS
+#define DO_BSD_COMPRESS 1 /* by default, include BSD-Compress */
+#endif
+#ifndef DO_DEFLATE
+#define DO_DEFLATE 1 /* by default, include Deflate */
+#endif
+#define DO_PREDICTOR_1 0
+#define DO_PREDICTOR_2 0
+
+/*
+ * Structure giving methods for compression/decompression.
+ */
+
+struct compressor {
+ int compress_proto; /* CCP compression protocol number */
+
+ /* Allocate space for a compressor (transmit side) */
+ void *(*comp_alloc) (unsigned char *options, int opt_len);
+
+ /* Free space used by a compressor */
+ void (*comp_free) (void *state);
+
+ /* Initialize a compressor */
+ int (*comp_init) (void *state, unsigned char *options,
+ int opt_len, int unit, int opthdr, int debug);
+
+ /* Reset a compressor */
+ void (*comp_reset) (void *state);
+
+ /* Compress a packet */
+ int (*compress) (void *state, unsigned char *rptr,
+ unsigned char *obuf, int isize, int osize);
+
+ /* Return compression statistics */
+ void (*comp_stat) (void *state, struct compstat *stats);
+
+ /* Allocate space for a decompressor (receive side) */
+ void *(*decomp_alloc) (unsigned char *options, int opt_len);
+
+ /* Free space used by a decompressor */
+ void (*decomp_free) (void *state);
+
+ /* Initialize a decompressor */
+ int (*decomp_init) (void *state, unsigned char *options,
+ int opt_len, int unit, int opthdr, int mru,
+ int debug);
+
+ /* Reset a decompressor */
+ void (*decomp_reset) (void *state);
+
+ /* Decompress a packet. */
+ int (*decompress) (void *state, unsigned char *ibuf, int isize,
+ unsigned char *obuf, int osize);
+
+ /* Update state for an incompressible packet received */
+ void (*incomp) (void *state, unsigned char *ibuf, int icnt);
+
+ /* Return decompression statistics */
+ void (*decomp_stat) (void *state, struct compstat *stats);
+
+ /* Used in locking compressor modules */
+ struct module *owner;
+ /* Extra skb space needed by the compressor algorithm */
+ unsigned int comp_extra;
+};
+
+/*
+ * The return value from decompress routine is the length of the
+ * decompressed packet if successful, otherwise DECOMP_ERROR
+ * or DECOMP_FATALERROR if an error occurred.
+ *
+ * We need to make this distinction so that we can disable certain
+ * useful functionality, namely sending a CCP reset-request as a result
+ * of an error detected after decompression. This is to avoid infringing
+ * a patent held by Motorola.
+ * Don't you just lurve software patents.
+ */
+
+#define DECOMP_ERROR -1 /* error detected before decomp. */
+#define DECOMP_FATALERROR -2 /* error detected after decomp. */
+
+/*
+ * CCP codes.
+ */
+
+#define CCP_CONFREQ 1
+#define CCP_CONFACK 2
+#define CCP_TERMREQ 5
+#define CCP_TERMACK 6
+#define CCP_RESETREQ 14
+#define CCP_RESETACK 15
+
+/*
+ * Max # bytes for a CCP option
+ */
+
+#define CCP_MAX_OPTION_LENGTH 32
+
+/*
+ * Parts of a CCP packet.
+ */
+
+#define CCP_CODE(dp) ((dp)[0])
+#define CCP_ID(dp) ((dp)[1])
+#define CCP_LENGTH(dp) (((dp)[2] << 8) + (dp)[3])
+#define CCP_HDRLEN 4
+
+#define CCP_OPT_CODE(dp) ((dp)[0])
+#define CCP_OPT_LENGTH(dp) ((dp)[1])
+#define CCP_OPT_MINLEN 2
+
+/*
+ * Definitions for BSD-Compress.
+ */
+
+#define CI_BSD_COMPRESS 21 /* config. option for BSD-Compress */
+#define CILEN_BSD_COMPRESS 3 /* length of config. option */
+
+/* Macros for handling the 3rd byte of the BSD-Compress config option. */
+#define BSD_NBITS(x) ((x) & 0x1F) /* number of bits requested */
+#define BSD_VERSION(x) ((x) >> 5) /* version of option format */
+#define BSD_CURRENT_VERSION 1 /* current version number */
+#define BSD_MAKE_OPT(v, n) (((v) << 5) | (n))
+
+#define BSD_MIN_BITS 9 /* smallest code size supported */
+#define BSD_MAX_BITS 15 /* largest code size supported */
+
+/*
+ * Definitions for Deflate.
+ */
+
+#define CI_DEFLATE 26 /* config option for Deflate */
+#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */
+#define CILEN_DEFLATE 4 /* length of its config option */
+
+#define DEFLATE_MIN_SIZE 9
+#define DEFLATE_MAX_SIZE 15
+#define DEFLATE_METHOD_VAL 8
+#define DEFLATE_SIZE(x) (((x) >> 4) + 8)
+#define DEFLATE_METHOD(x) ((x) & 0x0F)
+#define DEFLATE_MAKE_OPT(w) ((((w) - 8) << 4) + DEFLATE_METHOD_VAL)
+#define DEFLATE_CHK_SEQUENCE 0
+
+/*
+ * Definitions for MPPE.
+ */
+
+#define CI_MPPE 18 /* config option for MPPE */
+#define CILEN_MPPE 6 /* length of config option */
+
+/*
+ * Definitions for other, as yet unsupported, compression methods.
+ */
+
+#define CI_PREDICTOR_1 1 /* config option for Predictor-1 */
+#define CILEN_PREDICTOR_1 2 /* length of its config option */
+#define CI_PREDICTOR_2 2 /* config option for Predictor-2 */
+#define CILEN_PREDICTOR_2 2 /* length of its config option */
+
+
+#endif /* _NET_PPP_COMP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ppp_defs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ppp_defs.h
new file mode 100644
index 0000000..4114e5f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ppp_defs.h
@@ -0,0 +1,180 @@
+/*
+ * ppp_defs.h - PPP definitions.
+ *
+ * Copyright (c) 1994 The Australian National University.
+ * All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation is hereby granted, provided that the above copyright
+ * notice appears in all copies. This software is provided without any
+ * warranty, express or implied. The Australian National University
+ * makes no representations about the suitability of this software for
+ * any purpose.
+ *
+ * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
+ * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+ * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
+ * OF SUCH DAMAGE.
+ *
+ * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
+ * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
+ * OR MODIFICATIONS.
+ */
+
+#include <linux/types.h>
+
+/*
+ * ==FILEVERSION 20000114==
+ *
+ * NOTE TO MAINTAINERS:
+ * If you modify this file at all, please set the above date.
+ * ppp_defs.h is shipped with a PPP distribution as well as with the kernel;
+ * if everyone increases the FILEVERSION number above, then scripts
+ * can do the right thing when deciding whether to install a new ppp_defs.h
+ * file. Don't change the format of that line otherwise, so the
+ * installation script can recognize it.
+ */
+
+#ifndef _PPP_DEFS_H_
+#define _PPP_DEFS_H_
+
+/*
+ * The basic PPP frame.
+ */
+#define PPP_HDRLEN 4 /* octets for standard ppp header */
+#define PPP_FCSLEN 2 /* octets for FCS */
+#define PPP_MRU 1500 /* default MRU = max length of info field */
+
+#define PPP_ADDRESS(p) (((__u8 *)(p))[0])
+#define PPP_CONTROL(p) (((__u8 *)(p))[1])
+#define PPP_PROTOCOL(p) ((((__u8 *)(p))[2] << 8) + ((__u8 *)(p))[3])
+
+/*
+ * Significant octet values.
+ */
+#define PPP_ALLSTATIONS 0xff /* All-Stations broadcast address */
+#define PPP_UI 0x03 /* Unnumbered Information */
+#define PPP_FLAG 0x7e /* Flag Sequence */
+#define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */
+#define PPP_TRANS 0x20 /* Asynchronous transparency modifier */
+
+/*
+ * Protocol field values.
+ */
+#define PPP_IP 0x21 /* Internet Protocol */
+#define PPP_AT 0x29 /* AppleTalk Protocol */
+#define PPP_IPX 0x2b /* IPX protocol */
+#define PPP_VJC_COMP 0x2d /* VJ compressed TCP */
+#define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */
+#define PPP_MP 0x3d /* Multilink protocol */
+#define PPP_IPV6 0x57 /* Internet Protocol Version 6 */
+#define PPP_COMPFRAG 0xfb /* fragment compressed below bundle */
+#define PPP_COMP 0xfd /* compressed packet */
+#define PPP_MPLS_UC 0x0281 /* Multi Protocol Label Switching - Unicast */
+#define PPP_MPLS_MC 0x0283 /* Multi Protocol Label Switching - Multicast */
+#define PPP_IPCP 0x8021 /* IP Control Protocol */
+#define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */
+#define PPP_IPXCP 0x802b /* IPX Control Protocol */
+#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */
+#define PPP_CCPFRAG 0x80fb /* CCP at link level (below MP bundle) */
+#define PPP_CCP 0x80fd /* Compression Control Protocol */
+#define PPP_MPLSCP 0x80fd /* MPLS Control Protocol */
+#define PPP_LCP 0xc021 /* Link Control Protocol */
+#define PPP_PAP 0xc023 /* Password Authentication Protocol */
+#define PPP_LQR 0xc025 /* Link Quality Report protocol */
+#define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */
+#define PPP_CBCP 0xc029 /* Callback Control Protocol */
+
+/*
+ * Values for FCS calculations.
+ */
+
+#define PPP_INITFCS 0xffff /* Initial FCS value */
+#define PPP_GOODFCS 0xf0b8 /* Good final FCS value */
+
+
+/*
+ * Extended asyncmap - allows any character to be escaped.
+ */
+
+typedef __u32 ext_accm[8];
+
+/*
+ * What to do with network protocol (NP) packets.
+ */
+enum NPmode {
+ NPMODE_PASS, /* pass the packet through */
+ NPMODE_DROP, /* silently drop the packet */
+ NPMODE_ERROR, /* return an error */
+ NPMODE_QUEUE /* save it up for later. */
+};
+
+/*
+ * Statistics for LQRP and pppstats
+ */
+struct pppstat {
+ __u32 ppp_discards; /* # frames discarded */
+
+ __u32 ppp_ibytes; /* bytes received */
+ __u32 ppp_ioctects; /* bytes received not in error */
+ __u32 ppp_ipackets; /* packets received */
+ __u32 ppp_ierrors; /* receive errors */
+ __u32 ppp_ilqrs; /* # LQR frames received */
+
+ __u32 ppp_obytes; /* raw bytes sent */
+ __u32 ppp_ooctects; /* frame bytes sent */
+ __u32 ppp_opackets; /* packets sent */
+ __u32 ppp_oerrors; /* transmit errors */
+ __u32 ppp_olqrs; /* # LQR frames sent */
+};
+
+struct vjstat {
+ __u32 vjs_packets; /* outbound packets */
+ __u32 vjs_compressed; /* outbound compressed packets */
+ __u32 vjs_searches; /* searches for connection state */
+ __u32 vjs_misses; /* times couldn't find conn. state */
+ __u32 vjs_uncompressedin; /* inbound uncompressed packets */
+ __u32 vjs_compressedin; /* inbound compressed packets */
+ __u32 vjs_errorin; /* inbound unknown type packets */
+ __u32 vjs_tossed; /* inbound packets tossed because of error */
+};
+
+struct compstat {
+ __u32 unc_bytes; /* total uncompressed bytes */
+ __u32 unc_packets; /* total uncompressed packets */
+ __u32 comp_bytes; /* compressed bytes */
+ __u32 comp_packets; /* compressed packets */
+ __u32 inc_bytes; /* incompressible bytes */
+ __u32 inc_packets; /* incompressible packets */
+
+ /* the compression ratio is defined as in_count / bytes_out */
+ __u32 in_count; /* Bytes received */
+ __u32 bytes_out; /* Bytes transmitted */
+
+ double ratio; /* not computed in kernel. */
+};
+
+struct ppp_stats {
+ struct pppstat p; /* basic PPP statistics */
+ struct vjstat vj; /* VJ header compression statistics */
+};
+
+struct ppp_comp_stats {
+ struct compstat c; /* packet compression statistics */
+ struct compstat d; /* packet decompression statistics */
+};
+
+/*
+ * The following structure records the time in seconds since
+ * the last NP packet was sent or received.
+ */
+struct ppp_idle {
+ __kernel_time_t xmit_idle; /* time since last NP packet sent */
+ __kernel_time_t recv_idle; /* time since last NP packet received */
+};
+
+#endif /* _PPP_DEFS_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/prctl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/prctl.h
new file mode 100644
index 0000000..48d887e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/prctl.h
@@ -0,0 +1,88 @@
+#ifndef _LINUX_PRCTL_H
+#define _LINUX_PRCTL_H
+
+/* Values to pass as first argument to prctl() */
+
+#define PR_SET_PDEATHSIG 1 /* Second arg is a signal */
+#define PR_GET_PDEATHSIG 2 /* Second arg is a ptr to return the signal */
+
+/* Get/set current->mm->dumpable */
+#define PR_GET_DUMPABLE 3
+#define PR_SET_DUMPABLE 4
+
+/* Get/set unaligned access control bits (if meaningful) */
+#define PR_GET_UNALIGN 5
+#define PR_SET_UNALIGN 6
+# define PR_UNALIGN_NOPRINT 1 /* silently fix up unaligned user accesses */
+# define PR_UNALIGN_SIGBUS 2 /* generate SIGBUS on unaligned user access */
+
+/* Get/set whether or not to drop capabilities on setuid() away from
+ * uid 0 (as per security/commoncap.c) */
+#define PR_GET_KEEPCAPS 7
+#define PR_SET_KEEPCAPS 8
+
+/* Get/set floating-point emulation control bits (if meaningful) */
+#define PR_GET_FPEMU 9
+#define PR_SET_FPEMU 10
+# define PR_FPEMU_NOPRINT 1 /* silently emulate fp operations accesses */
+# define PR_FPEMU_SIGFPE 2 /* don't emulate fp operations, send SIGFPE instead */
+
+/* Get/set floating-point exception mode (if meaningful) */
+#define PR_GET_FPEXC 11
+#define PR_SET_FPEXC 12
+# define PR_FP_EXC_SW_ENABLE 0x80 /* Use FPEXC for FP exception enables */
+# define PR_FP_EXC_DIV 0x010000 /* floating point divide by zero */
+# define PR_FP_EXC_OVF 0x020000 /* floating point overflow */
+# define PR_FP_EXC_UND 0x040000 /* floating point underflow */
+# define PR_FP_EXC_RES 0x080000 /* floating point inexact result */
+# define PR_FP_EXC_INV 0x100000 /* floating point invalid operation */
+# define PR_FP_EXC_DISABLED 0 /* FP exceptions disabled */
+# define PR_FP_EXC_NONRECOV 1 /* async non-recoverable exc. mode */
+# define PR_FP_EXC_ASYNC 2 /* async recoverable exception mode */
+# define PR_FP_EXC_PRECISE 3 /* precise exception mode */
+
+/* Get/set whether we use statistical process timing or accurate timestamp
+ * based process timing */
+#define PR_GET_TIMING 13
+#define PR_SET_TIMING 14
+# define PR_TIMING_STATISTICAL 0 /* Normal, traditional,
+ statistical process timing */
+# define PR_TIMING_TIMESTAMP 1 /* Accurate timestamp based
+ process timing */
+
+#define PR_SET_NAME 15 /* Set process name */
+#define PR_GET_NAME 16 /* Get process name */
+
+/* Get/set process endian */
+#define PR_GET_ENDIAN 19
+#define PR_SET_ENDIAN 20
+# define PR_ENDIAN_BIG 0
+# define PR_ENDIAN_LITTLE 1 /* True little endian mode */
+# define PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */
+
+/* Get/set process seccomp mode */
+#define PR_GET_SECCOMP 21
+#define PR_SET_SECCOMP 22
+
+/* Get/set the capability bounding set (as per security/commoncap.c) */
+#define PR_CAPBSET_READ 23
+#define PR_CAPBSET_DROP 24
+
+/* Get/set the process' ability to use the timestamp counter instruction */
+#define PR_GET_TSC 25
+#define PR_SET_TSC 26
+# define PR_TSC_ENABLE 1 /* allow the use of the timestamp counter */
+# define PR_TSC_SIGSEGV 2 /* throw a SIGSEGV instead of reading the TSC */
+
+/* Get/set securebits (as per security/commoncap.c) */
+#define PR_GET_SECUREBITS 27
+#define PR_SET_SECUREBITS 28
+
+/*
+ * Get/set the timerslack as used by poll/select/nanosleep
+ * A value of 0 means "use default"
+ */
+#define PR_SET_TIMERSLACK 29
+#define PR_GET_TIMERSLACK 30
+
+#endif /* _LINUX_PRCTL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ptrace.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ptrace.h
new file mode 100644
index 0000000..6e66b68
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ptrace.h
@@ -0,0 +1,52 @@
+#ifndef _LINUX_PTRACE_H
+#define _LINUX_PTRACE_H
+/* ptrace.h */
+/* structs and defines to help the user use the ptrace system call. */
+
+/* has the defines to get at the registers. */
+
+#define PTRACE_TRACEME 0
+#define PTRACE_PEEKTEXT 1
+#define PTRACE_PEEKDATA 2
+#define PTRACE_PEEKUSR 3
+#define PTRACE_POKETEXT 4
+#define PTRACE_POKEDATA 5
+#define PTRACE_POKEUSR 6
+#define PTRACE_CONT 7
+#define PTRACE_KILL 8
+#define PTRACE_SINGLESTEP 9
+
+#define PTRACE_ATTACH 16
+#define PTRACE_DETACH 17
+
+#define PTRACE_SYSCALL 24
+
+/* 0x4200-0x4300 are reserved for architecture-independent additions. */
+#define PTRACE_SETOPTIONS 0x4200
+#define PTRACE_GETEVENTMSG 0x4201
+#define PTRACE_GETSIGINFO 0x4202
+#define PTRACE_SETSIGINFO 0x4203
+
+/* options set using PTRACE_SETOPTIONS */
+#define PTRACE_O_TRACESYSGOOD 0x00000001
+#define PTRACE_O_TRACEFORK 0x00000002
+#define PTRACE_O_TRACEVFORK 0x00000004
+#define PTRACE_O_TRACECLONE 0x00000008
+#define PTRACE_O_TRACEEXEC 0x00000010
+#define PTRACE_O_TRACEVFORKDONE 0x00000020
+#define PTRACE_O_TRACEEXIT 0x00000040
+
+#define PTRACE_O_MASK 0x0000007f
+
+/* Wait extended result codes for the above trace options. */
+#define PTRACE_EVENT_FORK 1
+#define PTRACE_EVENT_VFORK 2
+#define PTRACE_EVENT_CLONE 3
+#define PTRACE_EVENT_EXEC 4
+#define PTRACE_EVENT_VFORK_DONE 5
+#define PTRACE_EVENT_EXIT 6
+
+#include <asm/ptrace.h>
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/qnx4_fs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/qnx4_fs.h
new file mode 100644
index 0000000..e2bd543
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/qnx4_fs.h
@@ -0,0 +1,89 @@
+/*
+ * Name : qnx4_fs.h
+ * Author : Richard Frowijn
+ * Function : qnx4 global filesystem definitions
+ * History : 23-03-1998 created
+ */
+#ifndef _LINUX_QNX4_FS_H
+#define _LINUX_QNX4_FS_H
+
+#include <linux/types.h>
+#include <linux/qnxtypes.h>
+#include <linux/magic.h>
+
+#define QNX4_ROOT_INO 1
+
+#define QNX4_MAX_XTNTS_PER_XBLK 60
+/* for di_status */
+#define QNX4_FILE_USED 0x01
+#define QNX4_FILE_MODIFIED 0x02
+#define QNX4_FILE_BUSY 0x04
+#define QNX4_FILE_LINK 0x08
+#define QNX4_FILE_INODE 0x10
+#define QNX4_FILE_FSYSCLEAN 0x20
+
+#define QNX4_I_MAP_SLOTS 8
+#define QNX4_Z_MAP_SLOTS 64
+#define QNX4_VALID_FS 0x0001 /* Clean fs. */
+#define QNX4_ERROR_FS 0x0002 /* fs has errors. */
+#define QNX4_BLOCK_SIZE 0x200 /* blocksize of 512 bytes */
+#define QNX4_BLOCK_SIZE_BITS 9 /* blocksize shift */
+#define QNX4_DIR_ENTRY_SIZE 0x040 /* dir entry size of 64 bytes */
+#define QNX4_DIR_ENTRY_SIZE_BITS 6 /* dir entry size shift */
+#define QNX4_XBLK_ENTRY_SIZE 0x200 /* xblk entry size */
+#define QNX4_INODES_PER_BLOCK 0x08 /* 512 / 64 */
+
+/* for filenames */
+#define QNX4_SHORT_NAME_MAX 16
+#define QNX4_NAME_MAX 48
+
+/*
+ * This is the original qnx4 inode layout on disk.
+ */
+struct qnx4_inode_entry {
+ char di_fname[QNX4_SHORT_NAME_MAX];
+ qnx4_off_t di_size;
+ qnx4_xtnt_t di_first_xtnt;
+ __le32 di_xblk;
+ __le32 di_ftime;
+ __le32 di_mtime;
+ __le32 di_atime;
+ __le32 di_ctime;
+ qnx4_nxtnt_t di_num_xtnts;
+ qnx4_mode_t di_mode;
+ qnx4_muid_t di_uid;
+ qnx4_mgid_t di_gid;
+ qnx4_nlink_t di_nlink;
+ __u8 di_zero[4];
+ qnx4_ftype_t di_type;
+ __u8 di_status;
+};
+
+struct qnx4_link_info {
+ char dl_fname[QNX4_NAME_MAX];
+ __le32 dl_inode_blk;
+ __u8 dl_inode_ndx;
+ __u8 dl_spare[10];
+ __u8 dl_status;
+};
+
+struct qnx4_xblk {
+ __le32 xblk_next_xblk;
+ __le32 xblk_prev_xblk;
+ __u8 xblk_num_xtnts;
+ __u8 xblk_spare[3];
+ __le32 xblk_num_blocks;
+ qnx4_xtnt_t xblk_xtnts[QNX4_MAX_XTNTS_PER_XBLK];
+ char xblk_signature[8];
+ qnx4_xtnt_t xblk_first_xtnt;
+};
+
+struct qnx4_super_block {
+ struct qnx4_inode_entry RootDir;
+ struct qnx4_inode_entry Inode;
+ struct qnx4_inode_entry Boot;
+ struct qnx4_inode_entry AltBoot;
+};
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/qnxtypes.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/qnxtypes.h
new file mode 100644
index 0000000..bebbe5c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/qnxtypes.h
@@ -0,0 +1,28 @@
+/*
+ * Name : qnxtypes.h
+ * Author : Richard Frowijn
+ * Function : standard qnx types
+ * History : 22-03-1998 created
+ *
+ */
+
+#ifndef _QNX4TYPES_H
+#define _QNX4TYPES_H
+
+#include <linux/types.h>
+
+typedef __le16 qnx4_nxtnt_t;
+typedef __u8 qnx4_ftype_t;
+
+typedef struct {
+ __le32 xtnt_blk;
+ __le32 xtnt_size;
+} qnx4_xtnt_t;
+
+typedef __le16 qnx4_mode_t;
+typedef __le16 qnx4_muid_t;
+typedef __le16 qnx4_mgid_t;
+typedef __le32 qnx4_off_t;
+typedef __le16 qnx4_nlink_t;
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/quota.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/quota.h
new file mode 100644
index 0000000..3218a95
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/quota.h
@@ -0,0 +1,176 @@
+/*
+ * Copyright (c) 1982, 1986 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Robert Elz at The University of Melbourne.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _LINUX_QUOTA_
+#define _LINUX_QUOTA_
+
+#include <linux/errno.h>
+#include <linux/types.h>
+
+#define __DQUOT_VERSION__ "dquot_6.5.2"
+
+#define MAXQUOTAS 2
+#define USRQUOTA 0 /* element used for user quotas */
+#define GRPQUOTA 1 /* element used for group quotas */
+
+/*
+ * Definitions for the default names of the quotas files.
+ */
+#define INITQFNAMES { \
+ "user", /* USRQUOTA */ \
+ "group", /* GRPQUOTA */ \
+ "undefined", \
+};
+
+/*
+ * Command definitions for the 'quotactl' system call.
+ * The commands are broken into a main command defined below
+ * and a subcommand that is used to convey the type of
+ * quota that is being manipulated (see above).
+ */
+#define SUBCMDMASK 0x00ff
+#define SUBCMDSHIFT 8
+#define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
+
+#define Q_SYNC 0x800001 /* sync disk copy of a filesystems quotas */
+#define Q_QUOTAON 0x800002 /* turn quotas on */
+#define Q_QUOTAOFF 0x800003 /* turn quotas off */
+#define Q_GETFMT 0x800004 /* get quota format used on given filesystem */
+#define Q_GETINFO 0x800005 /* get information about quota files */
+#define Q_SETINFO 0x800006 /* set information about quota files */
+#define Q_GETQUOTA 0x800007 /* get user quota structure */
+#define Q_SETQUOTA 0x800008 /* set user quota structure */
+
+/* Quota format type IDs */
+#define QFMT_VFS_OLD 1
+#define QFMT_VFS_V0 2
+
+/* Size of block in which space limits are passed through the quota
+ * interface */
+#define QIF_DQBLKSIZE_BITS 10
+#define QIF_DQBLKSIZE (1 << QIF_DQBLKSIZE_BITS)
+
+/*
+ * Quota structure used for communication with userspace via quotactl
+ * Following flags are used to specify which fields are valid
+ */
+enum {
+ QIF_BLIMITS_B = 0,
+ QIF_SPACE_B,
+ QIF_ILIMITS_B,
+ QIF_INODES_B,
+ QIF_BTIME_B,
+ QIF_ITIME_B,
+};
+
+#define QIF_BLIMITS (1 << QIF_BLIMITS_B)
+#define QIF_SPACE (1 << QIF_SPACE_B)
+#define QIF_ILIMITS (1 << QIF_ILIMITS_B)
+#define QIF_INODES (1 << QIF_INODES_B)
+#define QIF_BTIME (1 << QIF_BTIME_B)
+#define QIF_ITIME (1 << QIF_ITIME_B)
+#define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS)
+#define QIF_USAGE (QIF_SPACE | QIF_INODES)
+#define QIF_TIMES (QIF_BTIME | QIF_ITIME)
+#define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES)
+
+struct if_dqblk {
+ __u64 dqb_bhardlimit;
+ __u64 dqb_bsoftlimit;
+ __u64 dqb_curspace;
+ __u64 dqb_ihardlimit;
+ __u64 dqb_isoftlimit;
+ __u64 dqb_curinodes;
+ __u64 dqb_btime;
+ __u64 dqb_itime;
+ __u32 dqb_valid;
+};
+
+/*
+ * Structure used for setting quota information about file via quotactl
+ * Following flags are used to specify which fields are valid
+ */
+#define IIF_BGRACE 1
+#define IIF_IGRACE 2
+#define IIF_FLAGS 4
+#define IIF_ALL (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)
+
+struct if_dqinfo {
+ __u64 dqi_bgrace;
+ __u64 dqi_igrace;
+ __u32 dqi_flags;
+ __u32 dqi_valid;
+};
+
+/*
+ * Definitions for quota netlink interface
+ */
+#define QUOTA_NL_NOWARN 0
+#define QUOTA_NL_IHARDWARN 1 /* Inode hardlimit reached */
+#define QUOTA_NL_ISOFTLONGWARN 2 /* Inode grace time expired */
+#define QUOTA_NL_ISOFTWARN 3 /* Inode softlimit reached */
+#define QUOTA_NL_BHARDWARN 4 /* Block hardlimit reached */
+#define QUOTA_NL_BSOFTLONGWARN 5 /* Block grace time expired */
+#define QUOTA_NL_BSOFTWARN 6 /* Block softlimit reached */
+#define QUOTA_NL_IHARDBELOW 7 /* Usage got below inode hardlimit */
+#define QUOTA_NL_ISOFTBELOW 8 /* Usage got below inode softlimit */
+#define QUOTA_NL_BHARDBELOW 9 /* Usage got below block hardlimit */
+#define QUOTA_NL_BSOFTBELOW 10 /* Usage got below block softlimit */
+
+enum {
+ QUOTA_NL_C_UNSPEC,
+ QUOTA_NL_C_WARNING,
+ __QUOTA_NL_C_MAX,
+};
+#define QUOTA_NL_C_MAX (__QUOTA_NL_C_MAX - 1)
+
+enum {
+ QUOTA_NL_A_UNSPEC,
+ QUOTA_NL_A_QTYPE,
+ QUOTA_NL_A_EXCESS_ID,
+ QUOTA_NL_A_WARNING,
+ QUOTA_NL_A_DEV_MAJOR,
+ QUOTA_NL_A_DEV_MINOR,
+ QUOTA_NL_A_CAUSED_ID,
+ __QUOTA_NL_A_MAX,
+};
+#define QUOTA_NL_A_MAX (__QUOTA_NL_A_MAX - 1)
+
+
+
+# /* nodep */ include <sys/cdefs.h>
+
+__BEGIN_DECLS
+long quotactl __P ((unsigned int, const char *, int, caddr_t));
+__END_DECLS
+
+#endif /* _QUOTA_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/radeonfb.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/radeonfb.h
new file mode 100644
index 0000000..8c4bbde
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/radeonfb.h
@@ -0,0 +1,15 @@
+#ifndef __LINUX_RADEONFB_H__
+#define __LINUX_RADEONFB_H__
+
+#include <asm/ioctl.h>
+#include <linux/types.h>
+
+#define ATY_RADEON_LCD_ON 0x00000001
+#define ATY_RADEON_CRT_ON 0x00000002
+
+
+#define FBIO_RADEON_GET_MIRROR _IOR('@', 3, size_t)
+#define FBIO_RADEON_SET_MIRROR _IOW('@', 4, size_t)
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/raid/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/raid/..install.cmd
new file mode 100644
index 0000000..421358e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/raid/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/raid/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/raid /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/raid mips md_p.h md_u.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/raid /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/raid mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/raid/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/raid/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/raid/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/raid/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/raid/md_p.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/raid/md_p.h
new file mode 100644
index 0000000..53a2545
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/raid/md_p.h
@@ -0,0 +1,277 @@
+/*
+ md_p.h : physical layout of Linux RAID devices
+ Copyright (C) 1996-98 Ingo Molnar, Gadi Oxman
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ You should have received a copy of the GNU General Public License
+ (for example /usr/src/linux/COPYING); if not, write to the Free
+ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef _MD_P_H
+#define _MD_P_H
+
+#include <linux/types.h>
+
+/*
+ * RAID superblock.
+ *
+ * The RAID superblock maintains some statistics on each RAID configuration.
+ * Each real device in the RAID set contains it near the end of the device.
+ * Some of the ideas are copied from the ext2fs implementation.
+ *
+ * We currently use 4096 bytes as follows:
+ *
+ * word offset function
+ *
+ * 0 - 31 Constant generic RAID device information.
+ * 32 - 63 Generic state information.
+ * 64 - 127 Personality specific information.
+ * 128 - 511 12 32-words descriptors of the disks in the raid set.
+ * 512 - 911 Reserved.
+ * 912 - 1023 Disk specific descriptor.
+ */
+
+/*
+ * If x is the real device size in bytes, we return an apparent size of:
+ *
+ * y = (x & ~(MD_RESERVED_BYTES - 1)) - MD_RESERVED_BYTES
+ *
+ * and place the 4kB superblock at offset y.
+ */
+#define MD_RESERVED_BYTES (64 * 1024)
+#define MD_RESERVED_SECTORS (MD_RESERVED_BYTES / 512)
+
+#define MD_NEW_SIZE_SECTORS(x) ((x & ~(MD_RESERVED_SECTORS - 1)) - MD_RESERVED_SECTORS)
+
+#define MD_SB_BYTES 4096
+#define MD_SB_WORDS (MD_SB_BYTES / 4)
+#define MD_SB_SECTORS (MD_SB_BYTES / 512)
+
+/*
+ * The following are counted in 32-bit words
+ */
+#define MD_SB_GENERIC_OFFSET 0
+#define MD_SB_PERSONALITY_OFFSET 64
+#define MD_SB_DISKS_OFFSET 128
+#define MD_SB_DESCRIPTOR_OFFSET 992
+
+#define MD_SB_GENERIC_CONSTANT_WORDS 32
+#define MD_SB_GENERIC_STATE_WORDS 32
+#define MD_SB_GENERIC_WORDS (MD_SB_GENERIC_CONSTANT_WORDS + MD_SB_GENERIC_STATE_WORDS)
+#define MD_SB_PERSONALITY_WORDS 64
+#define MD_SB_DESCRIPTOR_WORDS 32
+#define MD_SB_DISKS 27
+#define MD_SB_DISKS_WORDS (MD_SB_DISKS*MD_SB_DESCRIPTOR_WORDS)
+#define MD_SB_RESERVED_WORDS (1024 - MD_SB_GENERIC_WORDS - MD_SB_PERSONALITY_WORDS - MD_SB_DISKS_WORDS - MD_SB_DESCRIPTOR_WORDS)
+#define MD_SB_EQUAL_WORDS (MD_SB_GENERIC_WORDS + MD_SB_PERSONALITY_WORDS + MD_SB_DISKS_WORDS)
+
+/*
+ * Device "operational" state bits
+ */
+#define MD_DISK_FAULTY 0 /* disk is faulty / operational */
+#define MD_DISK_ACTIVE 1 /* disk is running or spare disk */
+#define MD_DISK_SYNC 2 /* disk is in sync with the raid set */
+#define MD_DISK_REMOVED 3 /* disk is in sync with the raid set */
+
+#define MD_DISK_WRITEMOSTLY 9 /* disk is "write-mostly" is RAID1 config.
+ * read requests will only be sent here in
+ * dire need
+ */
+
+typedef struct mdp_device_descriptor_s {
+ __u32 number; /* 0 Device number in the entire set */
+ __u32 major; /* 1 Device major number */
+ __u32 minor; /* 2 Device minor number */
+ __u32 raid_disk; /* 3 The role of the device in the raid set */
+ __u32 state; /* 4 Operational state */
+ __u32 reserved[MD_SB_DESCRIPTOR_WORDS - 5];
+} mdp_disk_t;
+
+#define MD_SB_MAGIC 0xa92b4efc
+
+/*
+ * Superblock state bits
+ */
+#define MD_SB_CLEAN 0
+#define MD_SB_ERRORS 1
+
+#define MD_SB_BITMAP_PRESENT 8 /* bitmap may be present nearby */
+
+/*
+ * Notes:
+ * - if an array is being reshaped (restriped) in order to change the
+ * the number of active devices in the array, 'raid_disks' will be
+ * the larger of the old and new numbers. 'delta_disks' will
+ * be the "new - old". So if +ve, raid_disks is the new value, and
+ * "raid_disks-delta_disks" is the old. If -ve, raid_disks is the
+ * old value and "raid_disks+delta_disks" is the new (smaller) value.
+ */
+
+
+typedef struct mdp_superblock_s {
+ /*
+ * Constant generic information
+ */
+ __u32 md_magic; /* 0 MD identifier */
+ __u32 major_version; /* 1 major version to which the set conforms */
+ __u32 minor_version; /* 2 minor version ... */
+ __u32 patch_version; /* 3 patchlevel version ... */
+ __u32 gvalid_words; /* 4 Number of used words in this section */
+ __u32 set_uuid0; /* 5 Raid set identifier */
+ __u32 ctime; /* 6 Creation time */
+ __u32 level; /* 7 Raid personality */
+ __u32 size; /* 8 Apparent size of each individual disk */
+ __u32 nr_disks; /* 9 total disks in the raid set */
+ __u32 raid_disks; /* 10 disks in a fully functional raid set */
+ __u32 md_minor; /* 11 preferred MD minor device number */
+ __u32 not_persistent; /* 12 does it have a persistent superblock */
+ __u32 set_uuid1; /* 13 Raid set identifier #2 */
+ __u32 set_uuid2; /* 14 Raid set identifier #3 */
+ __u32 set_uuid3; /* 15 Raid set identifier #4 */
+ __u32 gstate_creserved[MD_SB_GENERIC_CONSTANT_WORDS - 16];
+
+ /*
+ * Generic state information
+ */
+ __u32 utime; /* 0 Superblock update time */
+ __u32 state; /* 1 State bits (clean, ...) */
+ __u32 active_disks; /* 2 Number of currently active disks */
+ __u32 working_disks; /* 3 Number of working disks */
+ __u32 failed_disks; /* 4 Number of failed disks */
+ __u32 spare_disks; /* 5 Number of spare disks */
+ __u32 sb_csum; /* 6 checksum of the whole superblock */
+#ifdef __BIG_ENDIAN
+ __u32 events_hi; /* 7 high-order of superblock update count */
+ __u32 events_lo; /* 8 low-order of superblock update count */
+ __u32 cp_events_hi; /* 9 high-order of checkpoint update count */
+ __u32 cp_events_lo; /* 10 low-order of checkpoint update count */
+#else
+ __u32 events_lo; /* 7 low-order of superblock update count */
+ __u32 events_hi; /* 8 high-order of superblock update count */
+ __u32 cp_events_lo; /* 9 low-order of checkpoint update count */
+ __u32 cp_events_hi; /* 10 high-order of checkpoint update count */
+#endif
+ __u32 recovery_cp; /* 11 recovery checkpoint sector count */
+ /* There are only valid for minor_version > 90 */
+ __u64 reshape_position; /* 12,13 next address in array-space for reshape */
+ __u32 new_level; /* 14 new level we are reshaping to */
+ __u32 delta_disks; /* 15 change in number of raid_disks */
+ __u32 new_layout; /* 16 new layout */
+ __u32 new_chunk; /* 17 new chunk size (bytes) */
+ __u32 gstate_sreserved[MD_SB_GENERIC_STATE_WORDS - 18];
+
+ /*
+ * Personality information
+ */
+ __u32 layout; /* 0 the array's physical layout */
+ __u32 chunk_size; /* 1 chunk size in bytes */
+ __u32 root_pv; /* 2 LV root PV */
+ __u32 root_block; /* 3 LV root block */
+ __u32 pstate_reserved[MD_SB_PERSONALITY_WORDS - 4];
+
+ /*
+ * Disks information
+ */
+ mdp_disk_t disks[MD_SB_DISKS];
+
+ /*
+ * Reserved
+ */
+ __u32 reserved[MD_SB_RESERVED_WORDS];
+
+ /*
+ * Active descriptor
+ */
+ mdp_disk_t this_disk;
+
+} mdp_super_t;
+
+static __inline__ __u64 md_event(mdp_super_t *sb) {
+ __u64 ev = sb->events_hi;
+ return (ev<<32)| sb->events_lo;
+}
+
+#define MD_SUPERBLOCK_1_TIME_SEC_MASK ((1ULL<<40) - 1)
+
+/*
+ * The version-1 superblock :
+ * All numeric fields are little-endian.
+ *
+ * total size: 256 bytes plus 2 per device.
+ * 1K allows 384 devices.
+ */
+struct mdp_superblock_1 {
+ /* constant array information - 128 bytes */
+ __le32 magic; /* MD_SB_MAGIC: 0xa92b4efc - little endian */
+ __le32 major_version; /* 1 */
+ __le32 feature_map; /* bit 0 set if 'bitmap_offset' is meaningful */
+ __le32 pad0; /* always set to 0 when writing */
+
+ __u8 set_uuid[16]; /* user-space generated. */
+ char set_name[32]; /* set and interpreted by user-space */
+
+ __le64 ctime; /* lo 40 bits are seconds, top 24 are microseconds or 0*/
+ __le32 level; /* -4 (multipath), -1 (linear), 0,1,4,5 */
+ __le32 layout; /* only for raid5 and raid10 currently */
+ __le64 size; /* used size of component devices, in 512byte sectors */
+
+ __le32 chunksize; /* in 512byte sectors */
+ __le32 raid_disks;
+ __le32 bitmap_offset; /* sectors after start of superblock that bitmap starts
+ * NOTE: signed, so bitmap can be before superblock
+ * only meaningful of feature_map[0] is set.
+ */
+
+ /* These are only valid with feature bit '4' */
+ __le32 new_level; /* new level we are reshaping to */
+ __le64 reshape_position; /* next address in array-space for reshape */
+ __le32 delta_disks; /* change in number of raid_disks */
+ __le32 new_layout; /* new layout */
+ __le32 new_chunk; /* new chunk size (bytes) */
+ __u8 pad1[128-124]; /* set to 0 when written */
+
+ /* constant this-device information - 64 bytes */
+ __le64 data_offset; /* sector start of data, often 0 */
+ __le64 data_size; /* sectors in this device that can be used for data */
+ __le64 super_offset; /* sector start of this superblock */
+ __le64 recovery_offset;/* sectors before this offset (from data_offset) have been recovered */
+ __le32 dev_number; /* permanent identifier of this device - not role in raid */
+ __le32 cnt_corrected_read; /* number of read errors that were corrected by re-writing */
+ __u8 device_uuid[16]; /* user-space setable, ignored by kernel */
+ __u8 devflags; /* per-device flags. Only one defined...*/
+#define WriteMostly1 1 /* mask for writemostly flag in above */
+ __u8 pad2[64-57]; /* set to 0 when writing */
+
+ /* array state information - 64 bytes */
+ __le64 utime; /* 40 bits second, 24 btes microseconds */
+ __le64 events; /* incremented when superblock updated */
+ __le64 resync_offset; /* data before this offset (from data_offset) known to be in sync */
+ __le32 sb_csum; /* checksum upto devs[max_dev] */
+ __le32 max_dev; /* size of devs[] array to consider */
+ __u8 pad3[64-32]; /* set to 0 when writing */
+
+ /* device state information. Indexed by dev_number.
+ * 2 bytes per device
+ * Note there are no per-device state flags. State information is rolled
+ * into the 'roles' value. If a device is spare or faulty, then it doesn't
+ * have a meaningful role.
+ */
+ __le16 dev_roles[0]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */
+};
+
+/* feature_map bits */
+#define MD_FEATURE_BITMAP_OFFSET 1
+#define MD_FEATURE_RECOVERY_OFFSET 2 /* recovery_offset is present and
+ * must be honoured
+ */
+#define MD_FEATURE_RESHAPE_ACTIVE 4
+
+#define MD_FEATURE_ALL (1|2|4)
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/raid/md_u.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/raid/md_u.h
new file mode 100644
index 0000000..1185a7d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/raid/md_u.h
@@ -0,0 +1,156 @@
+/*
+ md_u.h : user <=> kernel API between Linux raidtools and RAID drivers
+ Copyright (C) 1998 Ingo Molnar
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ You should have received a copy of the GNU General Public License
+ (for example /usr/src/linux/COPYING); if not, write to the Free
+ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef _MD_U_H
+#define _MD_U_H
+
+/*
+ * Different major versions are not compatible.
+ * Different minor versions are only downward compatible.
+ * Different patchlevel versions are downward and upward compatible.
+ */
+#define MD_MAJOR_VERSION 0
+#define MD_MINOR_VERSION 90
+/*
+ * MD_PATCHLEVEL_VERSION indicates kernel functionality.
+ * >=1 means different superblock formats are selectable using SET_ARRAY_INFO
+ * and major_version/minor_version accordingly
+ * >=2 means that Internal bitmaps are supported by setting MD_SB_BITMAP_PRESENT
+ * in the super status byte
+ * >=3 means that bitmap superblock version 4 is supported, which uses
+ * little-ending representation rather than host-endian
+ */
+#define MD_PATCHLEVEL_VERSION 3
+
+/* ioctls */
+
+/* status */
+#define RAID_VERSION _IOR (MD_MAJOR, 0x10, mdu_version_t)
+#define GET_ARRAY_INFO _IOR (MD_MAJOR, 0x11, mdu_array_info_t)
+#define GET_DISK_INFO _IOR (MD_MAJOR, 0x12, mdu_disk_info_t)
+#define PRINT_RAID_DEBUG _IO (MD_MAJOR, 0x13)
+#define RAID_AUTORUN _IO (MD_MAJOR, 0x14)
+#define GET_BITMAP_FILE _IOR (MD_MAJOR, 0x15, mdu_bitmap_file_t)
+
+/* configuration */
+#define CLEAR_ARRAY _IO (MD_MAJOR, 0x20)
+#define ADD_NEW_DISK _IOW (MD_MAJOR, 0x21, mdu_disk_info_t)
+#define HOT_REMOVE_DISK _IO (MD_MAJOR, 0x22)
+#define SET_ARRAY_INFO _IOW (MD_MAJOR, 0x23, mdu_array_info_t)
+#define SET_DISK_INFO _IO (MD_MAJOR, 0x24)
+#define WRITE_RAID_INFO _IO (MD_MAJOR, 0x25)
+#define UNPROTECT_ARRAY _IO (MD_MAJOR, 0x26)
+#define PROTECT_ARRAY _IO (MD_MAJOR, 0x27)
+#define HOT_ADD_DISK _IO (MD_MAJOR, 0x28)
+#define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29)
+#define HOT_GENERATE_ERROR _IO (MD_MAJOR, 0x2a)
+#define SET_BITMAP_FILE _IOW (MD_MAJOR, 0x2b, int)
+
+/* usage */
+#define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t)
+/* 0x31 was START_ARRAY */
+#define STOP_ARRAY _IO (MD_MAJOR, 0x32)
+#define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33)
+#define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34)
+
+/* 63 partitions with the alternate major number (mdp) */
+#define MdpMinorShift 6
+
+typedef struct mdu_version_s {
+ int major;
+ int minor;
+ int patchlevel;
+} mdu_version_t;
+
+typedef struct mdu_array_info_s {
+ /*
+ * Generic constant information
+ */
+ int major_version;
+ int minor_version;
+ int patch_version;
+ int ctime;
+ int level;
+ int size;
+ int nr_disks;
+ int raid_disks;
+ int md_minor;
+ int not_persistent;
+
+ /*
+ * Generic state information
+ */
+ int utime; /* 0 Superblock update time */
+ int state; /* 1 State bits (clean, ...) */
+ int active_disks; /* 2 Number of currently active disks */
+ int working_disks; /* 3 Number of working disks */
+ int failed_disks; /* 4 Number of failed disks */
+ int spare_disks; /* 5 Number of spare disks */
+
+ /*
+ * Personality information
+ */
+ int layout; /* 0 the array's physical layout */
+ int chunk_size; /* 1 chunk size in bytes */
+
+} mdu_array_info_t;
+
+/* non-obvious values for 'level' */
+#define LEVEL_MULTIPATH (-4)
+#define LEVEL_LINEAR (-1)
+#define LEVEL_FAULTY (-5)
+
+/* we need a value for 'no level specified' and 0
+ * means 'raid0', so we need something else. This is
+ * for internal use only
+ */
+#define LEVEL_NONE (-1000000)
+
+typedef struct mdu_disk_info_s {
+ /*
+ * configuration/status of one particular disk
+ */
+ int number;
+ int major;
+ int minor;
+ int raid_disk;
+ int state;
+
+} mdu_disk_info_t;
+
+typedef struct mdu_start_info_s {
+ /*
+ * configuration/status of one particular disk
+ */
+ int major;
+ int minor;
+ int raid_disk;
+ int state;
+
+} mdu_start_info_t;
+
+typedef struct mdu_bitmap_file_s
+{
+ char pathname[4096];
+} mdu_bitmap_file_t;
+
+typedef struct mdu_param_s
+{
+ int personality; /* 1,2,3,4 */
+ int chunk_size; /* in bytes */
+ int max_fault; /* unused for now */
+} mdu_param_t;
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/random.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/random.h
new file mode 100644
index 0000000..912f4ff
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/random.h
@@ -0,0 +1,46 @@
+/*
+ * include/linux/random.h
+ *
+ * Include file for the random number generator.
+ */
+
+#ifndef _LINUX_RANDOM_H
+#define _LINUX_RANDOM_H
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+#include <linux/irqnr.h>
+
+/* ioctl()'s for the random number generator */
+
+/* Get the entropy count. */
+#define RNDGETENTCNT _IOR( 'R', 0x00, int )
+
+/* Add to (or subtract from) the entropy count. (Superuser only.) */
+#define RNDADDTOENTCNT _IOW( 'R', 0x01, int )
+
+/* Get the contents of the entropy pool. (Superuser only.) */
+#define RNDGETPOOL _IOR( 'R', 0x02, int [2] )
+
+/*
+ * Write bytes into the entropy pool and add to the entropy count.
+ * (Superuser only.)
+ */
+#define RNDADDENTROPY _IOW( 'R', 0x03, int [2] )
+
+/* Clear entropy count to 0. (Superuser only.) */
+#define RNDZAPENTCNT _IO( 'R', 0x04 )
+
+/* Clear the entropy pool and associated counters. (Superuser only.) */
+#define RNDCLEARPOOL _IO( 'R', 0x06 )
+
+struct rand_pool_info {
+ int entropy_count;
+ int buf_size;
+ __u32 buf[0];
+};
+
+/* Exported functions */
+
+
+#endif /* _LINUX_RANDOM_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/raw.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/raw.h
new file mode 100644
index 0000000..62d543e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/raw.h
@@ -0,0 +1,18 @@
+#ifndef __LINUX_RAW_H
+#define __LINUX_RAW_H
+
+#include <linux/types.h>
+
+#define RAW_SETBIND _IO( 0xac, 0 )
+#define RAW_GETBIND _IO( 0xac, 1 )
+
+struct raw_config_request
+{
+ int raw_minor;
+ __u64 block_major;
+ __u64 block_minor;
+};
+
+#define MAX_RAW_MINORS CONFIG_MAX_RAW_DEVS
+
+#endif /* __LINUX_RAW_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/reboot.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/reboot.h
new file mode 100644
index 0000000..aa33674
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/reboot.h
@@ -0,0 +1,39 @@
+#ifndef _LINUX_REBOOT_H
+#define _LINUX_REBOOT_H
+
+/*
+ * Magic values required to use _reboot() system call.
+ */
+
+#define LINUX_REBOOT_MAGIC1 0xfee1dead
+#define LINUX_REBOOT_MAGIC2 672274793
+#define LINUX_REBOOT_MAGIC2A 85072278
+#define LINUX_REBOOT_MAGIC2B 369367448
+#define LINUX_REBOOT_MAGIC2C 537993216
+
+
+/*
+ * Commands accepted by the _reboot() system call.
+ *
+ * RESTART Restart system using default command and mode.
+ * HALT Stop OS and give system control to ROM monitor, if any.
+ * CAD_ON Ctrl-Alt-Del sequence causes RESTART command.
+ * CAD_OFF Ctrl-Alt-Del sequence sends SIGINT to init task.
+ * POWER_OFF Stop OS and remove all power from system, if possible.
+ * RESTART2 Restart system using given command string.
+ * SW_SUSPEND Suspend system using software suspend if compiled in.
+ * KEXEC Restart system using a previously loaded Linux kernel
+ */
+
+#define LINUX_REBOOT_CMD_RESTART 0x01234567
+#define LINUX_REBOOT_CMD_HALT 0xCDEF0123
+#define LINUX_REBOOT_CMD_CAD_ON 0x89ABCDEF
+#define LINUX_REBOOT_CMD_CAD_OFF 0x00000000
+#define LINUX_REBOOT_CMD_POWER_OFF 0x4321FEDC
+#define LINUX_REBOOT_CMD_RESTART2 0xA1B2C3D4
+#define LINUX_REBOOT_CMD_SW_SUSPEND 0xD000FCE2
+#define LINUX_REBOOT_CMD_KEXEC 0x45584543
+
+
+
+#endif /* _LINUX_REBOOT_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/reiserfs_fs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/reiserfs_fs.h
new file mode 100644
index 0000000..43a2251
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/reiserfs_fs.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright 1996, 1997, 1998 Hans Reiser, see reiserfs/README for licensing and copyright details
+ */
+
+ /* this file has an amazingly stupid
+ name, yura please fix it to be
+ reiserfs.h, and merge all the rest
+ of our .h files that are in this
+ directory into it. */
+
+#ifndef _LINUX_REISER_FS_H
+#define _LINUX_REISER_FS_H
+
+#include <linux/types.h>
+#include <linux/magic.h>
+
+
+/*
+ * include/linux/reiser_fs.h
+ *
+ * Reiser File System constants and structures
+ *
+ */
+
+/* ioctl's command */
+#define REISERFS_IOC_UNPACK _IOW(0xCD,1,long)
+/* define following flags to be the same as in ext2, so that chattr(1),
+ lsattr(1) will work with us. */
+#define REISERFS_IOC_GETFLAGS FS_IOC_GETFLAGS
+#define REISERFS_IOC_SETFLAGS FS_IOC_SETFLAGS
+#define REISERFS_IOC_GETVERSION FS_IOC_GETVERSION
+#define REISERFS_IOC_SETVERSION FS_IOC_SETVERSION
+
+
+#endif /* _LINUX_REISER_FS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/reiserfs_xattr.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/reiserfs_xattr.h
new file mode 100644
index 0000000..38fff2e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/reiserfs_xattr.h
@@ -0,0 +1,25 @@
+/*
+ File: linux/reiserfs_xattr.h
+*/
+
+#ifndef _LINUX_REISERFS_XATTR_H
+#define _LINUX_REISERFS_XATTR_H
+
+#include <linux/types.h>
+
+/* Magic value in header */
+#define REISERFS_XATTR_MAGIC 0x52465841 /* "RFXA" */
+
+struct reiserfs_xattr_header {
+ __le32 h_magic; /* magic number for identification */
+ __le32 h_hash; /* hash of the value */
+};
+
+struct reiserfs_security_handle {
+ char *name;
+ void *value;
+ size_t length;
+};
+
+
+#endif /* _LINUX_REISERFS_XATTR_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/resource.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/resource.h
new file mode 100644
index 0000000..7ef7a15
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/resource.h
@@ -0,0 +1,75 @@
+#ifndef _LINUX_RESOURCE_H
+#define _LINUX_RESOURCE_H
+
+#include <linux/time.h>
+
+struct task_struct;
+
+/*
+ * Resource control/accounting header file for linux
+ */
+
+/*
+ * Definition of struct rusage taken from BSD 4.3 Reno
+ *
+ * We don't support all of these yet, but we might as well have them....
+ * Otherwise, each time we add new items, programs which depend on this
+ * structure will lose. This reduces the chances of that happening.
+ */
+#define RUSAGE_SELF 0
+#define RUSAGE_CHILDREN (-1)
+#define RUSAGE_BOTH (-2) /* sys_wait4() uses this */
+#define RUSAGE_THREAD 1 /* only the calling thread */
+
+struct rusage {
+ struct timeval ru_utime; /* user time used */
+ struct timeval ru_stime; /* system time used */
+ long ru_maxrss; /* maximum resident set size */
+ long ru_ixrss; /* integral shared memory size */
+ long ru_idrss; /* integral unshared data size */
+ long ru_isrss; /* integral unshared stack size */
+ long ru_minflt; /* page reclaims */
+ long ru_majflt; /* page faults */
+ long ru_nswap; /* swaps */
+ long ru_inblock; /* block input operations */
+ long ru_oublock; /* block output operations */
+ long ru_msgsnd; /* messages sent */
+ long ru_msgrcv; /* messages received */
+ long ru_nsignals; /* signals received */
+ long ru_nvcsw; /* voluntary context switches */
+ long ru_nivcsw; /* involuntary " */
+};
+
+struct rlimit {
+ unsigned long rlim_cur;
+ unsigned long rlim_max;
+};
+
+#define PRIO_MIN (-20)
+#define PRIO_MAX 20
+
+#define PRIO_PROCESS 0
+#define PRIO_PGRP 1
+#define PRIO_USER 2
+
+/*
+ * Limit the stack by to some sane default: root can always
+ * increase this limit if needed.. 8MB seems reasonable.
+ */
+#define _STK_LIM (8*1024*1024)
+
+/*
+ * GPG2 wants 64kB of mlocked memory, to make sure pass phrases
+ * and other sensitive information are never written to disk.
+ */
+#define MLOCK_LIMIT ((PAGE_SIZE > 64*1024) ? PAGE_SIZE : 64*1024)
+
+/*
+ * Due to binary compatibility, the actual resource numbers
+ * may be different for different linux versions..
+ */
+#include <asm/resource.h>
+
+int getrusage(struct task_struct *p, int who, struct rusage *ru);
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/romfs_fs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/romfs_fs.h
new file mode 100644
index 0000000..c490fbc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/romfs_fs.h
@@ -0,0 +1,56 @@
+#ifndef __LINUX_ROMFS_FS_H
+#define __LINUX_ROMFS_FS_H
+
+/* The basic structures of the romfs filesystem */
+
+#define ROMBSIZE BLOCK_SIZE
+#define ROMBSBITS BLOCK_SIZE_BITS
+#define ROMBMASK (ROMBSIZE-1)
+#define ROMFS_MAGIC 0x7275
+
+#define ROMFS_MAXFN 128
+
+#define __mkw(h,l) (((h)&0x00ff)<< 8|((l)&0x00ff))
+#define __mkl(h,l) (((h)&0xffff)<<16|((l)&0xffff))
+#define __mk4(a,b,c,d) cpu_to_be32(__mkl(__mkw(a,b),__mkw(c,d)))
+#define ROMSB_WORD0 __mk4('-','r','o','m')
+#define ROMSB_WORD1 __mk4('1','f','s','-')
+
+/* On-disk "super block" */
+
+struct romfs_super_block {
+ __be32 word0;
+ __be32 word1;
+ __be32 size;
+ __be32 checksum;
+ char name[0]; /* volume name */
+};
+
+/* On disk inode */
+
+struct romfs_inode {
+ __be32 next; /* low 4 bits see ROMFH_ */
+ __be32 spec;
+ __be32 size;
+ __be32 checksum;
+ char name[0];
+};
+
+#define ROMFH_TYPE 7
+#define ROMFH_HRD 0
+#define ROMFH_DIR 1
+#define ROMFH_REG 2
+#define ROMFH_SYM 3
+#define ROMFH_BLK 4
+#define ROMFH_CHR 5
+#define ROMFH_SCK 6
+#define ROMFH_FIF 7
+#define ROMFH_EXEC 8
+
+/* Alignment */
+
+#define ROMFH_SIZE 16
+#define ROMFH_PAD (ROMFH_SIZE-1)
+#define ROMFH_MASK (~ROMFH_PAD)
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/rose.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/rose.h
new file mode 100644
index 0000000..c7b4b18
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/rose.h
@@ -0,0 +1,87 @@
+/*
+ * These are the public elements of the Linux kernel Rose implementation.
+ * For kernel AX.25 see the file ax25.h. This file requires ax25.h for the
+ * definition of the ax25_address structure.
+ */
+
+#ifndef ROSE_KERNEL_H
+#define ROSE_KERNEL_H
+
+#define ROSE_MTU 251
+
+#define ROSE_MAX_DIGIS 6
+
+#define ROSE_DEFER 1
+#define ROSE_T1 2
+#define ROSE_T2 3
+#define ROSE_T3 4
+#define ROSE_IDLE 5
+#define ROSE_QBITINCL 6
+#define ROSE_HOLDBACK 7
+
+#define SIOCRSGCAUSE (SIOCPROTOPRIVATE+0)
+#define SIOCRSSCAUSE (SIOCPROTOPRIVATE+1)
+#define SIOCRSL2CALL (SIOCPROTOPRIVATE+2)
+#define SIOCRSSL2CALL (SIOCPROTOPRIVATE+2)
+#define SIOCRSACCEPT (SIOCPROTOPRIVATE+3)
+#define SIOCRSCLRRT (SIOCPROTOPRIVATE+4)
+#define SIOCRSGL2CALL (SIOCPROTOPRIVATE+5)
+#define SIOCRSGFACILITIES (SIOCPROTOPRIVATE+6)
+
+#define ROSE_DTE_ORIGINATED 0x00
+#define ROSE_NUMBER_BUSY 0x01
+#define ROSE_INVALID_FACILITY 0x03
+#define ROSE_NETWORK_CONGESTION 0x05
+#define ROSE_OUT_OF_ORDER 0x09
+#define ROSE_ACCESS_BARRED 0x0B
+#define ROSE_NOT_OBTAINABLE 0x0D
+#define ROSE_REMOTE_PROCEDURE 0x11
+#define ROSE_LOCAL_PROCEDURE 0x13
+#define ROSE_SHIP_ABSENT 0x39
+
+typedef struct {
+ char rose_addr[5];
+} rose_address;
+
+struct sockaddr_rose {
+ sa_family_t srose_family;
+ rose_address srose_addr;
+ ax25_address srose_call;
+ int srose_ndigis;
+ ax25_address srose_digi;
+};
+
+struct full_sockaddr_rose {
+ sa_family_t srose_family;
+ rose_address srose_addr;
+ ax25_address srose_call;
+ unsigned int srose_ndigis;
+ ax25_address srose_digis[ROSE_MAX_DIGIS];
+};
+
+struct rose_route_struct {
+ rose_address address;
+ unsigned short mask;
+ ax25_address neighbour;
+ char device[16];
+ unsigned char ndigis;
+ ax25_address digipeaters[AX25_MAX_DIGIS];
+};
+
+struct rose_cause_struct {
+ unsigned char cause;
+ unsigned char diagnostic;
+};
+
+struct rose_facilities_struct {
+ rose_address source_addr, dest_addr;
+ ax25_address source_call, dest_call;
+ unsigned char source_ndigis, dest_ndigis;
+ ax25_address source_digis[ROSE_MAX_DIGIS];
+ ax25_address dest_digis[ROSE_MAX_DIGIS];
+ unsigned int rand;
+ rose_address fail_addr;
+ ax25_address fail_call;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/route.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/route.h
new file mode 100644
index 0000000..c96ff9e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/route.h
@@ -0,0 +1,68 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for the IP router interface.
+ *
+ * Version: @(#)route.h 1.0.3 05/27/93
+ *
+ * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1986-1988
+ * for the purposes of compatibility only.
+ *
+ * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ * Changes:
+ * Mike McLagan : Routing by source
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_ROUTE_H
+#define _LINUX_ROUTE_H
+
+#include <linux/if.h>
+
+
+/* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */
+struct rtentry
+{
+ unsigned long rt_pad1;
+ struct sockaddr rt_dst; /* target address */
+ struct sockaddr rt_gateway; /* gateway addr (RTF_GATEWAY) */
+ struct sockaddr rt_genmask; /* target network mask (IP) */
+ unsigned short rt_flags;
+ short rt_pad2;
+ unsigned long rt_pad3;
+ void *rt_pad4;
+ short rt_metric; /* +1 for binary compatibility! */
+ char *rt_dev; /* forcing the device at add */
+ unsigned long rt_mtu; /* per route MTU/Window */
+#define rt_mss rt_mtu /* Compatibility :-( */
+ unsigned long rt_window; /* Window clamping */
+ unsigned short rt_irtt; /* Initial RTT */
+};
+
+
+#define RTF_UP 0x0001 /* route usable */
+#define RTF_GATEWAY 0x0002 /* destination is a gateway */
+#define RTF_HOST 0x0004 /* host entry (net otherwise) */
+#define RTF_REINSTATE 0x0008 /* reinstate route after tmout */
+#define RTF_DYNAMIC 0x0010 /* created dyn. (by redirect) */
+#define RTF_MODIFIED 0x0020 /* modified dyn. (by redirect) */
+#define RTF_MTU 0x0040 /* specific MTU for this route */
+#define RTF_MSS RTF_MTU /* Compatibility :-( */
+#define RTF_WINDOW 0x0080 /* per route window clamping */
+#define RTF_IRTT 0x0100 /* Initial round trip time */
+#define RTF_REJECT 0x0200 /* Reject route */
+
+/*
+ * <linux/ipv6_route.h> uses RTF values >= 64k
+ */
+
+
+
+#endif /* _LINUX_ROUTE_H */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/rtc.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/rtc.h
new file mode 100644
index 0000000..4aae894
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/rtc.h
@@ -0,0 +1,101 @@
+/*
+ * Generic RTC interface.
+ * This version contains the part of the user interface to the Real Time Clock
+ * service. It is used with both the legacy mc146818 and also EFI
+ * Struct rtc_time and first 12 ioctl by Paul Gortmaker, 1996 - separated out
+ * from <linux/mc146818rtc.h> to this file for 2.4 kernels.
+ *
+ * Copyright (C) 1999 Hewlett-Packard Co.
+ * Copyright (C) 1999 Stephane Eranian <eranian@hpl.hp.com>
+ */
+#ifndef _LINUX_RTC_H_
+#define _LINUX_RTC_H_
+
+/*
+ * The struct used to pass data via the following ioctl. Similar to the
+ * struct tm in <time.h>, but it needs to be here so that the kernel
+ * source is self contained, allowing cross-compiles, etc. etc.
+ */
+
+struct rtc_time {
+ int tm_sec;
+ int tm_min;
+ int tm_hour;
+ int tm_mday;
+ int tm_mon;
+ int tm_year;
+ int tm_wday;
+ int tm_yday;
+ int tm_isdst;
+};
+
+/*
+ * This data structure is inspired by the EFI (v0.92) wakeup
+ * alarm API.
+ */
+struct rtc_wkalrm {
+ unsigned char enabled; /* 0 = alarm disabled, 1 = alarm enabled */
+ unsigned char pending; /* 0 = alarm not pending, 1 = alarm pending */
+ struct rtc_time time; /* time the alarm is set to */
+};
+
+/*
+ * Data structure to control PLL correction some better RTC feature
+ * pll_value is used to get or set current value of correction,
+ * the rest of the struct is used to query HW capabilities.
+ * This is modeled after the RTC used in Q40/Q60 computers but
+ * should be sufficiently flexible for other devices
+ *
+ * +ve pll_value means clock will run faster by
+ * pll_value*pll_posmult/pll_clock
+ * -ve pll_value means clock will run slower by
+ * pll_value*pll_negmult/pll_clock
+ */
+
+struct rtc_pll_info {
+ int pll_ctrl; /* placeholder for fancier control */
+ int pll_value; /* get/set correction value */
+ int pll_max; /* max +ve (faster) adjustment value */
+ int pll_min; /* max -ve (slower) adjustment value */
+ int pll_posmult; /* factor for +ve correction */
+ int pll_negmult; /* factor for -ve correction */
+ long pll_clock; /* base PLL frequency */
+};
+
+/*
+ * ioctl calls that are permitted to the /dev/rtc interface, if
+ * any of the RTC drivers are enabled.
+ */
+
+#define RTC_AIE_ON _IO('p', 0x01) /* Alarm int. enable on */
+#define RTC_AIE_OFF _IO('p', 0x02) /* ... off */
+#define RTC_UIE_ON _IO('p', 0x03) /* Update int. enable on */
+#define RTC_UIE_OFF _IO('p', 0x04) /* ... off */
+#define RTC_PIE_ON _IO('p', 0x05) /* Periodic int. enable on */
+#define RTC_PIE_OFF _IO('p', 0x06) /* ... off */
+#define RTC_WIE_ON _IO('p', 0x0f) /* Watchdog int. enable on */
+#define RTC_WIE_OFF _IO('p', 0x10) /* ... off */
+
+#define RTC_ALM_SET _IOW('p', 0x07, struct rtc_time) /* Set alarm time */
+#define RTC_ALM_READ _IOR('p', 0x08, struct rtc_time) /* Read alarm time */
+#define RTC_RD_TIME _IOR('p', 0x09, struct rtc_time) /* Read RTC time */
+#define RTC_SET_TIME _IOW('p', 0x0a, struct rtc_time) /* Set RTC time */
+#define RTC_IRQP_READ _IOR('p', 0x0b, unsigned long) /* Read IRQ rate */
+#define RTC_IRQP_SET _IOW('p', 0x0c, unsigned long) /* Set IRQ rate */
+#define RTC_EPOCH_READ _IOR('p', 0x0d, unsigned long) /* Read epoch */
+#define RTC_EPOCH_SET _IOW('p', 0x0e, unsigned long) /* Set epoch */
+
+#define RTC_WKALM_SET _IOW('p', 0x0f, struct rtc_wkalrm)/* Set wakeup alarm*/
+#define RTC_WKALM_RD _IOR('p', 0x10, struct rtc_wkalrm)/* Get wakeup alarm*/
+
+#define RTC_PLL_GET _IOR('p', 0x11, struct rtc_pll_info) /* Get PLL correction */
+#define RTC_PLL_SET _IOW('p', 0x12, struct rtc_pll_info) /* Set PLL correction */
+
+/* interrupt flags */
+#define RTC_IRQF 0x80 /* any of the following is active */
+#define RTC_PF 0x40
+#define RTC_AF 0x20
+#define RTC_UF 0x10
+
+
+#endif /* _LINUX_RTC_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/rtnetlink.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/rtnetlink.h
new file mode 100644
index 0000000..63d1c69
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/rtnetlink.h
@@ -0,0 +1,614 @@
+#ifndef __LINUX_RTNETLINK_H
+#define __LINUX_RTNETLINK_H
+
+#include <linux/types.h>
+#include <linux/netlink.h>
+#include <linux/if_link.h>
+#include <linux/if_addr.h>
+#include <linux/neighbour.h>
+
+/****
+ * Routing/neighbour discovery messages.
+ ****/
+
+/* Types of messages */
+
+enum {
+ RTM_BASE = 16,
+#define RTM_BASE RTM_BASE
+
+ RTM_NEWLINK = 16,
+#define RTM_NEWLINK RTM_NEWLINK
+ RTM_DELLINK,
+#define RTM_DELLINK RTM_DELLINK
+ RTM_GETLINK,
+#define RTM_GETLINK RTM_GETLINK
+ RTM_SETLINK,
+#define RTM_SETLINK RTM_SETLINK
+
+ RTM_NEWADDR = 20,
+#define RTM_NEWADDR RTM_NEWADDR
+ RTM_DELADDR,
+#define RTM_DELADDR RTM_DELADDR
+ RTM_GETADDR,
+#define RTM_GETADDR RTM_GETADDR
+
+ RTM_NEWROUTE = 24,
+#define RTM_NEWROUTE RTM_NEWROUTE
+ RTM_DELROUTE,
+#define RTM_DELROUTE RTM_DELROUTE
+ RTM_GETROUTE,
+#define RTM_GETROUTE RTM_GETROUTE
+
+ RTM_NEWNEIGH = 28,
+#define RTM_NEWNEIGH RTM_NEWNEIGH
+ RTM_DELNEIGH,
+#define RTM_DELNEIGH RTM_DELNEIGH
+ RTM_GETNEIGH,
+#define RTM_GETNEIGH RTM_GETNEIGH
+
+ RTM_NEWRULE = 32,
+#define RTM_NEWRULE RTM_NEWRULE
+ RTM_DELRULE,
+#define RTM_DELRULE RTM_DELRULE
+ RTM_GETRULE,
+#define RTM_GETRULE RTM_GETRULE
+
+ RTM_NEWQDISC = 36,
+#define RTM_NEWQDISC RTM_NEWQDISC
+ RTM_DELQDISC,
+#define RTM_DELQDISC RTM_DELQDISC
+ RTM_GETQDISC,
+#define RTM_GETQDISC RTM_GETQDISC
+
+ RTM_NEWTCLASS = 40,
+#define RTM_NEWTCLASS RTM_NEWTCLASS
+ RTM_DELTCLASS,
+#define RTM_DELTCLASS RTM_DELTCLASS
+ RTM_GETTCLASS,
+#define RTM_GETTCLASS RTM_GETTCLASS
+
+ RTM_NEWTFILTER = 44,
+#define RTM_NEWTFILTER RTM_NEWTFILTER
+ RTM_DELTFILTER,
+#define RTM_DELTFILTER RTM_DELTFILTER
+ RTM_GETTFILTER,
+#define RTM_GETTFILTER RTM_GETTFILTER
+
+ RTM_NEWACTION = 48,
+#define RTM_NEWACTION RTM_NEWACTION
+ RTM_DELACTION,
+#define RTM_DELACTION RTM_DELACTION
+ RTM_GETACTION,
+#define RTM_GETACTION RTM_GETACTION
+
+ RTM_NEWPREFIX = 52,
+#define RTM_NEWPREFIX RTM_NEWPREFIX
+
+ RTM_GETMULTICAST = 58,
+#define RTM_GETMULTICAST RTM_GETMULTICAST
+
+ RTM_GETANYCAST = 62,
+#define RTM_GETANYCAST RTM_GETANYCAST
+
+ RTM_NEWNEIGHTBL = 64,
+#define RTM_NEWNEIGHTBL RTM_NEWNEIGHTBL
+ RTM_GETNEIGHTBL = 66,
+#define RTM_GETNEIGHTBL RTM_GETNEIGHTBL
+ RTM_SETNEIGHTBL,
+#define RTM_SETNEIGHTBL RTM_SETNEIGHTBL
+
+ RTM_NEWNDUSEROPT = 68,
+#define RTM_NEWNDUSEROPT RTM_NEWNDUSEROPT
+
+ RTM_NEWADDRLABEL = 72,
+#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL
+ RTM_DELADDRLABEL,
+#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL
+ RTM_GETADDRLABEL,
+#define RTM_GETADDRLABEL RTM_GETADDRLABEL
+
+ RTM_GETDCB = 78,
+#define RTM_GETDCB RTM_GETDCB
+ RTM_SETDCB,
+#define RTM_SETDCB RTM_SETDCB
+
+ __RTM_MAX,
+#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
+};
+
+#define RTM_NR_MSGTYPES (RTM_MAX + 1 - RTM_BASE)
+#define RTM_NR_FAMILIES (RTM_NR_MSGTYPES >> 2)
+#define RTM_FAM(cmd) (((cmd) - RTM_BASE) >> 2)
+
+/*
+ Generic structure for encapsulation of optional route information.
+ It is reminiscent of sockaddr, but with sa_family replaced
+ with attribute type.
+ */
+
+struct rtattr
+{
+ unsigned short rta_len;
+ unsigned short rta_type;
+};
+
+/* Macros to handle rtattributes */
+
+#define RTA_ALIGNTO 4
+#define RTA_ALIGN(len) ( ((len)+RTA_ALIGNTO-1) & ~(RTA_ALIGNTO-1) )
+#define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) && \
+ (rta)->rta_len >= sizeof(struct rtattr) && \
+ (rta)->rta_len <= (len))
+#define RTA_NEXT(rta,attrlen) ((attrlen) -= RTA_ALIGN((rta)->rta_len), \
+ (struct rtattr*)(((char*)(rta)) + RTA_ALIGN((rta)->rta_len)))
+#define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len))
+#define RTA_SPACE(len) RTA_ALIGN(RTA_LENGTH(len))
+#define RTA_DATA(rta) ((void*)(((char*)(rta)) + RTA_LENGTH(0)))
+#define RTA_PAYLOAD(rta) ((int)((rta)->rta_len) - RTA_LENGTH(0))
+
+
+
+
+/******************************************************************************
+ * Definitions used in routing table administration.
+ ****/
+
+struct rtmsg
+{
+ unsigned char rtm_family;
+ unsigned char rtm_dst_len;
+ unsigned char rtm_src_len;
+ unsigned char rtm_tos;
+
+ unsigned char rtm_table; /* Routing table id */
+ unsigned char rtm_protocol; /* Routing protocol; see below */
+ unsigned char rtm_scope; /* See below */
+ unsigned char rtm_type; /* See below */
+
+ unsigned rtm_flags;
+};
+
+/* rtm_type */
+
+enum
+{
+ RTN_UNSPEC,
+ RTN_UNICAST, /* Gateway or direct route */
+ RTN_LOCAL, /* Accept locally */
+ RTN_BROADCAST, /* Accept locally as broadcast,
+ send as broadcast */
+ RTN_ANYCAST, /* Accept locally as broadcast,
+ but send as unicast */
+ RTN_MULTICAST, /* Multicast route */
+ RTN_BLACKHOLE, /* Drop */
+ RTN_UNREACHABLE, /* Destination is unreachable */
+ RTN_PROHIBIT, /* Administratively prohibited */
+ RTN_THROW, /* Not in this table */
+ RTN_NAT, /* Translate this address */
+ RTN_XRESOLVE, /* Use external resolver */
+ __RTN_MAX
+};
+
+#define RTN_MAX (__RTN_MAX - 1)
+
+
+/* rtm_protocol */
+
+#define RTPROT_UNSPEC 0
+#define RTPROT_REDIRECT 1 /* Route installed by ICMP redirects;
+ not used by current IPv4 */
+#define RTPROT_KERNEL 2 /* Route installed by kernel */
+#define RTPROT_BOOT 3 /* Route installed during boot */
+#define RTPROT_STATIC 4 /* Route installed by administrator */
+
+/* Values of protocol >= RTPROT_STATIC are not interpreted by kernel;
+ they are just passed from user and back as is.
+ It will be used by hypothetical multiple routing daemons.
+ Note that protocol values should be standardized in order to
+ avoid conflicts.
+ */
+
+#define RTPROT_GATED 8 /* Apparently, GateD */
+#define RTPROT_RA 9 /* RDISC/ND router advertisements */
+#define RTPROT_MRT 10 /* Merit MRT */
+#define RTPROT_ZEBRA 11 /* Zebra */
+#define RTPROT_BIRD 12 /* BIRD */
+#define RTPROT_DNROUTED 13 /* DECnet routing daemon */
+#define RTPROT_XORP 14 /* XORP */
+#define RTPROT_NTK 15 /* Netsukuku */
+#define RTPROT_DHCP 16 /* DHCP client */
+
+/* rtm_scope
+
+ Really it is not scope, but sort of distance to the destination.
+ NOWHERE are reserved for not existing destinations, HOST is our
+ local addresses, LINK are destinations, located on directly attached
+ link and UNIVERSE is everywhere in the Universe.
+
+ Intermediate values are also possible f.e. interior routes
+ could be assigned a value between UNIVERSE and LINK.
+*/
+
+enum rt_scope_t
+{
+ RT_SCOPE_UNIVERSE=0,
+/* User defined values */
+ RT_SCOPE_SITE=200,
+ RT_SCOPE_LINK=253,
+ RT_SCOPE_HOST=254,
+ RT_SCOPE_NOWHERE=255
+};
+
+/* rtm_flags */
+
+#define RTM_F_NOTIFY 0x100 /* Notify user of route change */
+#define RTM_F_CLONED 0x200 /* This route is cloned */
+#define RTM_F_EQUALIZE 0x400 /* Multipath equalizer: NI */
+#define RTM_F_PREFIX 0x800 /* Prefix addresses */
+
+/* Reserved table identifiers */
+
+enum rt_class_t
+{
+ RT_TABLE_UNSPEC=0,
+/* User defined values */
+ RT_TABLE_COMPAT=252,
+ RT_TABLE_DEFAULT=253,
+ RT_TABLE_MAIN=254,
+ RT_TABLE_LOCAL=255,
+ RT_TABLE_MAX=0xFFFFFFFF
+};
+
+
+/* Routing message attributes */
+
+enum rtattr_type_t
+{
+ RTA_UNSPEC,
+ RTA_DST,
+ RTA_SRC,
+ RTA_IIF,
+ RTA_OIF,
+ RTA_GATEWAY,
+ RTA_PRIORITY,
+ RTA_PREFSRC,
+ RTA_METRICS,
+ RTA_MULTIPATH,
+ RTA_PROTOINFO, /* no longer used */
+ RTA_FLOW,
+ RTA_CACHEINFO,
+ RTA_SESSION, /* no longer used */
+ RTA_MP_ALGO, /* no longer used */
+ RTA_TABLE,
+ __RTA_MAX
+};
+
+#define RTA_MAX (__RTA_MAX - 1)
+
+#define RTM_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg))))
+#define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct rtmsg))
+
+/* RTM_MULTIPATH --- array of struct rtnexthop.
+ *
+ * "struct rtnexthop" describes all necessary nexthop information,
+ * i.e. parameters of path to a destination via this nexthop.
+ *
+ * At the moment it is impossible to set different prefsrc, mtu, window
+ * and rtt for different paths from multipath.
+ */
+
+struct rtnexthop
+{
+ unsigned short rtnh_len;
+ unsigned char rtnh_flags;
+ unsigned char rtnh_hops;
+ int rtnh_ifindex;
+};
+
+/* rtnh_flags */
+
+#define RTNH_F_DEAD 1 /* Nexthop is dead (used by multipath) */
+#define RTNH_F_PERVASIVE 2 /* Do recursive gateway lookup */
+#define RTNH_F_ONLINK 4 /* Gateway is forced on link */
+
+/* Macros to handle hexthops */
+
+#define RTNH_ALIGNTO 4
+#define RTNH_ALIGN(len) ( ((len)+RTNH_ALIGNTO-1) & ~(RTNH_ALIGNTO-1) )
+#define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && \
+ ((int)(rtnh)->rtnh_len) <= (len))
+#define RTNH_NEXT(rtnh) ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len)))
+#define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len))
+#define RTNH_SPACE(len) RTNH_ALIGN(RTNH_LENGTH(len))
+#define RTNH_DATA(rtnh) ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0)))
+
+/* RTM_CACHEINFO */
+
+struct rta_cacheinfo
+{
+ __u32 rta_clntref;
+ __u32 rta_lastuse;
+ __s32 rta_expires;
+ __u32 rta_error;
+ __u32 rta_used;
+
+#define RTNETLINK_HAVE_PEERINFO 1
+ __u32 rta_id;
+ __u32 rta_ts;
+ __u32 rta_tsage;
+};
+
+/* RTM_METRICS --- array of struct rtattr with types of RTAX_* */
+
+enum
+{
+ RTAX_UNSPEC,
+#define RTAX_UNSPEC RTAX_UNSPEC
+ RTAX_LOCK,
+#define RTAX_LOCK RTAX_LOCK
+ RTAX_MTU,
+#define RTAX_MTU RTAX_MTU
+ RTAX_WINDOW,
+#define RTAX_WINDOW RTAX_WINDOW
+ RTAX_RTT,
+#define RTAX_RTT RTAX_RTT
+ RTAX_RTTVAR,
+#define RTAX_RTTVAR RTAX_RTTVAR
+ RTAX_SSTHRESH,
+#define RTAX_SSTHRESH RTAX_SSTHRESH
+ RTAX_CWND,
+#define RTAX_CWND RTAX_CWND
+ RTAX_ADVMSS,
+#define RTAX_ADVMSS RTAX_ADVMSS
+ RTAX_REORDERING,
+#define RTAX_REORDERING RTAX_REORDERING
+ RTAX_HOPLIMIT,
+#define RTAX_HOPLIMIT RTAX_HOPLIMIT
+ RTAX_INITCWND,
+#define RTAX_INITCWND RTAX_INITCWND
+ RTAX_FEATURES,
+#define RTAX_FEATURES RTAX_FEATURES
+ RTAX_RTO_MIN,
+#define RTAX_RTO_MIN RTAX_RTO_MIN
+ __RTAX_MAX
+};
+
+#define RTAX_MAX (__RTAX_MAX - 1)
+
+#define RTAX_FEATURE_ECN 0x00000001
+#define RTAX_FEATURE_SACK 0x00000002
+#define RTAX_FEATURE_TIMESTAMP 0x00000004
+#define RTAX_FEATURE_ALLFRAG 0x00000008
+
+struct rta_session
+{
+ __u8 proto;
+ __u8 pad1;
+ __u16 pad2;
+
+ union {
+ struct {
+ __u16 sport;
+ __u16 dport;
+ } ports;
+
+ struct {
+ __u8 type;
+ __u8 code;
+ __u16 ident;
+ } icmpt;
+
+ __u32 spi;
+ } u;
+};
+
+/****
+ * General form of address family dependent message.
+ ****/
+
+struct rtgenmsg
+{
+ unsigned char rtgen_family;
+};
+
+/*****************************************************************
+ * Link layer specific messages.
+ ****/
+
+/* struct ifinfomsg
+ * passes link level specific information, not dependent
+ * on network protocol.
+ */
+
+struct ifinfomsg
+{
+ unsigned char ifi_family;
+ unsigned char __ifi_pad;
+ unsigned short ifi_type; /* ARPHRD_* */
+ int ifi_index; /* Link index */
+ unsigned ifi_flags; /* IFF_* flags */
+ unsigned ifi_change; /* IFF_* change mask */
+};
+
+/********************************************************************
+ * prefix information
+ ****/
+
+struct prefixmsg
+{
+ unsigned char prefix_family;
+ unsigned char prefix_pad1;
+ unsigned short prefix_pad2;
+ int prefix_ifindex;
+ unsigned char prefix_type;
+ unsigned char prefix_len;
+ unsigned char prefix_flags;
+ unsigned char prefix_pad3;
+};
+
+enum
+{
+ PREFIX_UNSPEC,
+ PREFIX_ADDRESS,
+ PREFIX_CACHEINFO,
+ __PREFIX_MAX
+};
+
+#define PREFIX_MAX (__PREFIX_MAX - 1)
+
+struct prefix_cacheinfo
+{
+ __u32 preferred_time;
+ __u32 valid_time;
+};
+
+
+/*****************************************************************
+ * Traffic control messages.
+ ****/
+
+struct tcmsg
+{
+ unsigned char tcm_family;
+ unsigned char tcm__pad1;
+ unsigned short tcm__pad2;
+ int tcm_ifindex;
+ __u32 tcm_handle;
+ __u32 tcm_parent;
+ __u32 tcm_info;
+};
+
+enum
+{
+ TCA_UNSPEC,
+ TCA_KIND,
+ TCA_OPTIONS,
+ TCA_STATS,
+ TCA_XSTATS,
+ TCA_RATE,
+ TCA_FCNT,
+ TCA_STATS2,
+ TCA_STAB,
+ __TCA_MAX
+};
+
+#define TCA_MAX (__TCA_MAX - 1)
+
+#define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
+#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
+
+/********************************************************************
+ * Neighbor Discovery userland options
+ ****/
+
+struct nduseroptmsg
+{
+ unsigned char nduseropt_family;
+ unsigned char nduseropt_pad1;
+ unsigned short nduseropt_opts_len; /* Total length of options */
+ int nduseropt_ifindex;
+ __u8 nduseropt_icmp_type;
+ __u8 nduseropt_icmp_code;
+ unsigned short nduseropt_pad2;
+ unsigned int nduseropt_pad3;
+ /* Followed by one or more ND options */
+};
+
+enum
+{
+ NDUSEROPT_UNSPEC,
+ NDUSEROPT_SRCADDR,
+ __NDUSEROPT_MAX
+};
+
+#define NDUSEROPT_MAX (__NDUSEROPT_MAX - 1)
+
+/* RTnetlink multicast groups - backwards compatibility for userspace */
+#define RTMGRP_LINK 1
+#define RTMGRP_NOTIFY 2
+#define RTMGRP_NEIGH 4
+#define RTMGRP_TC 8
+
+#define RTMGRP_IPV4_IFADDR 0x10
+#define RTMGRP_IPV4_MROUTE 0x20
+#define RTMGRP_IPV4_ROUTE 0x40
+#define RTMGRP_IPV4_RULE 0x80
+
+#define RTMGRP_IPV6_IFADDR 0x100
+#define RTMGRP_IPV6_MROUTE 0x200
+#define RTMGRP_IPV6_ROUTE 0x400
+#define RTMGRP_IPV6_IFINFO 0x800
+
+#define RTMGRP_DECnet_IFADDR 0x1000
+#define RTMGRP_DECnet_ROUTE 0x4000
+
+#define RTMGRP_IPV6_PREFIX 0x20000
+
+/* RTnetlink multicast groups */
+enum rtnetlink_groups {
+ RTNLGRP_NONE,
+#define RTNLGRP_NONE RTNLGRP_NONE
+ RTNLGRP_LINK,
+#define RTNLGRP_LINK RTNLGRP_LINK
+ RTNLGRP_NOTIFY,
+#define RTNLGRP_NOTIFY RTNLGRP_NOTIFY
+ RTNLGRP_NEIGH,
+#define RTNLGRP_NEIGH RTNLGRP_NEIGH
+ RTNLGRP_TC,
+#define RTNLGRP_TC RTNLGRP_TC
+ RTNLGRP_IPV4_IFADDR,
+#define RTNLGRP_IPV4_IFADDR RTNLGRP_IPV4_IFADDR
+ RTNLGRP_IPV4_MROUTE,
+#define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE
+ RTNLGRP_IPV4_ROUTE,
+#define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE
+ RTNLGRP_IPV4_RULE,
+#define RTNLGRP_IPV4_RULE RTNLGRP_IPV4_RULE
+ RTNLGRP_IPV6_IFADDR,
+#define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR
+ RTNLGRP_IPV6_MROUTE,
+#define RTNLGRP_IPV6_MROUTE RTNLGRP_IPV6_MROUTE
+ RTNLGRP_IPV6_ROUTE,
+#define RTNLGRP_IPV6_ROUTE RTNLGRP_IPV6_ROUTE
+ RTNLGRP_IPV6_IFINFO,
+#define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO
+ RTNLGRP_DECnet_IFADDR,
+#define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR
+ RTNLGRP_NOP2,
+ RTNLGRP_DECnet_ROUTE,
+#define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE
+ RTNLGRP_DECnet_RULE,
+#define RTNLGRP_DECnet_RULE RTNLGRP_DECnet_RULE
+ RTNLGRP_NOP4,
+ RTNLGRP_IPV6_PREFIX,
+#define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX
+ RTNLGRP_IPV6_RULE,
+#define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE
+ RTNLGRP_ND_USEROPT,
+#define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT
+ RTNLGRP_PHONET_IFADDR,
+#define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR
+ RTNLGRP_PHONET_ROUTE,
+#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE
+ __RTNLGRP_MAX
+};
+#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
+
+/* TC action piece */
+struct tcamsg
+{
+ unsigned char tca_family;
+ unsigned char tca__pad1;
+ unsigned short tca__pad2;
+};
+#define TA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcamsg))))
+#define TA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcamsg))
+#define TCA_ACT_TAB 1 /* attr type must be >=1 */
+#define TCAA_MAX 1
+
+/* End of information exported to user level */
+
+
+
+#endif /* __LINUX_RTNETLINK_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/scc.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/scc.h
new file mode 100644
index 0000000..167cc03
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/scc.h
@@ -0,0 +1,172 @@
+/* $Id: scc.h,v 1.29 1997/04/02 14:56:45 jreuter Exp jreuter $ */
+
+#ifndef _SCC_H
+#define _SCC_H
+
+
+/* selection of hardware types */
+
+#define PA0HZP 0x00 /* hardware type for PA0HZP SCC card and compatible */
+#define EAGLE 0x01 /* hardware type for EAGLE card */
+#define PC100 0x02 /* hardware type for PC100 card */
+#define PRIMUS 0x04 /* hardware type for PRIMUS-PC (DG9BL) card */
+#define DRSI 0x08 /* hardware type for DRSI PC*Packet card */
+#define BAYCOM 0x10 /* hardware type for BayCom (U)SCC */
+
+/* DEV ioctl() commands */
+
+enum SCC_ioctl_cmds {
+ SIOCSCCRESERVED = SIOCDEVPRIVATE,
+ SIOCSCCCFG,
+ SIOCSCCINI,
+ SIOCSCCCHANINI,
+ SIOCSCCSMEM,
+ SIOCSCCGKISS,
+ SIOCSCCSKISS,
+ SIOCSCCGSTAT,
+ SIOCSCCCAL
+};
+
+/* Device parameter control (from WAMPES) */
+
+enum L1_params {
+ PARAM_DATA,
+ PARAM_TXDELAY,
+ PARAM_PERSIST,
+ PARAM_SLOTTIME,
+ PARAM_TXTAIL,
+ PARAM_FULLDUP,
+ PARAM_SOFTDCD, /* was: PARAM_HW */
+ PARAM_MUTE, /* ??? */
+ PARAM_DTR,
+ PARAM_RTS,
+ PARAM_SPEED,
+ PARAM_ENDDELAY, /* ??? */
+ PARAM_GROUP,
+ PARAM_IDLE,
+ PARAM_MIN,
+ PARAM_MAXKEY,
+ PARAM_WAIT,
+ PARAM_MAXDEFER,
+ PARAM_TX,
+ PARAM_HWEVENT = 31,
+ PARAM_RETURN = 255 /* reset kiss mode */
+};
+
+/* fulldup parameter */
+
+enum FULLDUP_modes {
+ KISS_DUPLEX_HALF, /* normal CSMA operation */
+ KISS_DUPLEX_FULL, /* fullduplex, key down trx after transmission */
+ KISS_DUPLEX_LINK, /* fullduplex, key down trx after 'idletime' sec */
+ KISS_DUPLEX_OPTIMA /* fullduplex, let the protocol layer control the hw */
+};
+
+/* misc. parameters */
+
+#define TIMER_OFF 65535U /* to switch off timers */
+#define NO_SUCH_PARAM 65534U /* param not implemented */
+
+/* HWEVENT parameter */
+
+enum HWEVENT_opts {
+ HWEV_DCD_ON,
+ HWEV_DCD_OFF,
+ HWEV_ALL_SENT
+};
+
+/* channel grouping */
+
+#define RXGROUP 0100 /* if set, only tx when all channels clear */
+#define TXGROUP 0200 /* if set, don't transmit simultaneously */
+
+/* Tx/Rx clock sources */
+
+enum CLOCK_sources {
+ CLK_DPLL, /* normal halfduplex operation */
+ CLK_EXTERNAL, /* external clocking (G3RUH/DF9IC modems) */
+ CLK_DIVIDER, /* Rx = DPLL, Tx = divider (fullduplex with */
+ /* modems without clock regeneration */
+ CLK_BRG /* experimental fullduplex mode with DPLL/BRG for */
+ /* MODEMs without clock recovery */
+};
+
+/* Tx state */
+
+enum TX_state {
+ TXS_IDLE, /* Transmitter off, no data pending */
+ TXS_BUSY, /* waiting for permission to send / tailtime */
+ TXS_ACTIVE, /* Transmitter on, sending data */
+ TXS_NEWFRAME, /* reset CRC and send (next) frame */
+ TXS_IDLE2, /* Transmitter on, no data pending */
+ TXS_WAIT, /* Waiting for Mintime to expire */
+ TXS_TIMEOUT /* We had a transmission timeout */
+};
+
+typedef unsigned long io_port; /* type definition for an 'io port address' */
+
+/* SCC statistical information */
+
+struct scc_stat {
+ long rxints; /* Receiver interrupts */
+ long txints; /* Transmitter interrupts */
+ long exints; /* External/status interrupts */
+ long spints; /* Special receiver interrupts */
+
+ long txframes; /* Packets sent */
+ long rxframes; /* Number of Frames Actually Received */
+ long rxerrs; /* CRC Errors */
+ long txerrs; /* KISS errors */
+
+ unsigned int nospace; /* "Out of buffers" */
+ unsigned int rx_over; /* Receiver Overruns */
+ unsigned int tx_under; /* Transmitter Underruns */
+
+ unsigned int tx_state; /* Transmitter state */
+ int tx_queued; /* tx frames enqueued */
+
+ unsigned int maxqueue; /* allocated tx_buffers */
+ unsigned int bufsize; /* used buffersize */
+};
+
+struct scc_modem {
+ long speed; /* Line speed, bps */
+ char clocksrc; /* 0 = DPLL, 1 = external, 2 = divider */
+ char nrz; /* NRZ instead of NRZI */
+};
+
+struct scc_kiss_cmd {
+ int command; /* one of the KISS-Commands defined above */
+ unsigned param; /* KISS-Param */
+};
+
+struct scc_hw_config {
+ io_port data_a; /* data port channel A */
+ io_port ctrl_a; /* control port channel A */
+ io_port data_b; /* data port channel B */
+ io_port ctrl_b; /* control port channel B */
+ io_port vector_latch; /* INTACK-Latch (#) */
+ io_port special; /* special function port */
+
+ int irq; /* irq */
+ long clock; /* clock */
+ char option; /* command for function port */
+
+ char brand; /* hardware type */
+ char escc; /* use ext. features of a 8580/85180/85280 */
+};
+
+/* (#) only one INTACK latch allowed. */
+
+
+struct scc_mem_config {
+ unsigned int dummy;
+ unsigned int bufsize;
+};
+
+struct scc_calibrate {
+ unsigned int time;
+ unsigned char pattern;
+};
+
+#endif /* defined(_SCC_H) */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sched.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sched.h
new file mode 100644
index 0000000..95ec7c2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sched.h
@@ -0,0 +1,43 @@
+#ifndef _LINUX_SCHED_H
+#define _LINUX_SCHED_H
+
+/*
+ * cloning flags:
+ */
+#define CSIGNAL 0x000000ff /* signal mask to be sent at exit */
+#define CLONE_VM 0x00000100 /* set if VM shared between processes */
+#define CLONE_FS 0x00000200 /* set if fs info shared between processes */
+#define CLONE_FILES 0x00000400 /* set if open files shared between processes */
+#define CLONE_SIGHAND 0x00000800 /* set if signal handlers and blocked signals shared */
+#define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */
+#define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */
+#define CLONE_PARENT 0x00008000 /* set if we want to have the same parent as the cloner */
+#define CLONE_THREAD 0x00010000 /* Same thread group? */
+#define CLONE_NEWNS 0x00020000 /* New namespace group? */
+#define CLONE_SYSVSEM 0x00040000 /* share system V SEM_UNDO semantics */
+#define CLONE_SETTLS 0x00080000 /* create a new TLS for the child */
+#define CLONE_PARENT_SETTID 0x00100000 /* set the TID in the parent */
+#define CLONE_CHILD_CLEARTID 0x00200000 /* clear the TID in the child */
+#define CLONE_DETACHED 0x00400000 /* Unused, ignored */
+#define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */
+#define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */
+#define CLONE_STOPPED 0x02000000 /* Start in stopped state */
+#define CLONE_NEWUTS 0x04000000 /* New utsname group? */
+#define CLONE_NEWIPC 0x08000000 /* New ipcs */
+#define CLONE_NEWUSER 0x10000000 /* New user namespace */
+#define CLONE_NEWPID 0x20000000 /* New pid namespace */
+#define CLONE_NEWNET 0x40000000 /* New network namespace */
+#define CLONE_IO 0x80000000 /* Clone io context */
+
+/*
+ * Scheduling policies
+ */
+#define SCHED_NORMAL 0
+#define SCHED_FIFO 1
+#define SCHED_RR 2
+#define SCHED_BATCH 3
+/* SCHED_ISO: reserved but not implemented yet */
+#define SCHED_IDLE 5
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/screen_info.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/screen_info.h
new file mode 100644
index 0000000..4885982
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/screen_info.h
@@ -0,0 +1,69 @@
+#ifndef _SCREEN_INFO_H
+#define _SCREEN_INFO_H
+
+#include <linux/types.h>
+
+/*
+ * These are set up by the setup-routine at boot-time:
+ */
+
+struct screen_info {
+ __u8 orig_x; /* 0x00 */
+ __u8 orig_y; /* 0x01 */
+ __u16 ext_mem_k; /* 0x02 */
+ __u16 orig_video_page; /* 0x04 */
+ __u8 orig_video_mode; /* 0x06 */
+ __u8 orig_video_cols; /* 0x07 */
+ __u16 unused2; /* 0x08 */
+ __u16 orig_video_ega_bx;/* 0x0a */
+ __u16 unused3; /* 0x0c */
+ __u8 orig_video_lines; /* 0x0e */
+ __u8 orig_video_isVGA; /* 0x0f */
+ __u16 orig_video_points;/* 0x10 */
+
+ /* VESA graphic mode -- linear frame buffer */
+ __u16 lfb_width; /* 0x12 */
+ __u16 lfb_height; /* 0x14 */
+ __u16 lfb_depth; /* 0x16 */
+ __u32 lfb_base; /* 0x18 */
+ __u32 lfb_size; /* 0x1c */
+ __u16 cl_magic, cl_offset; /* 0x20 */
+ __u16 lfb_linelength; /* 0x24 */
+ __u8 red_size; /* 0x26 */
+ __u8 red_pos; /* 0x27 */
+ __u8 green_size; /* 0x28 */
+ __u8 green_pos; /* 0x29 */
+ __u8 blue_size; /* 0x2a */
+ __u8 blue_pos; /* 0x2b */
+ __u8 rsvd_size; /* 0x2c */
+ __u8 rsvd_pos; /* 0x2d */
+ __u16 vesapm_seg; /* 0x2e */
+ __u16 vesapm_off; /* 0x30 */
+ __u16 pages; /* 0x32 */
+ __u16 vesa_attributes; /* 0x34 */
+ __u32 capabilities; /* 0x36 */
+ __u8 _reserved[6]; /* 0x3a */
+} __attribute__((packed));
+
+#define VIDEO_TYPE_MDA 0x10 /* Monochrome Text Display */
+#define VIDEO_TYPE_CGA 0x11 /* CGA Display */
+#define VIDEO_TYPE_EGAM 0x20 /* EGA/VGA in Monochrome Mode */
+#define VIDEO_TYPE_EGAC 0x21 /* EGA in Color Mode */
+#define VIDEO_TYPE_VGAC 0x22 /* VGA+ in Color Mode */
+#define VIDEO_TYPE_VLFB 0x23 /* VESA VGA in graphic mode */
+
+#define VIDEO_TYPE_PICA_S3 0x30 /* ACER PICA-61 local S3 video */
+#define VIDEO_TYPE_MIPS_G364 0x31 /* MIPS Magnum 4000 G364 video */
+#define VIDEO_TYPE_SGI 0x33 /* Various SGI graphics hardware */
+
+#define VIDEO_TYPE_TGAC 0x40 /* DEC TGA */
+
+#define VIDEO_TYPE_SUN 0x50 /* Sun frame buffer. */
+#define VIDEO_TYPE_SUNPCI 0x51 /* Sun PCI based frame buffer. */
+
+#define VIDEO_TYPE_PMAC 0x60 /* PowerMacintosh frame buffer. */
+
+#define VIDEO_TYPE_EFI 0x70 /* EFI graphic mode */
+
+
+#endif /* _SCREEN_INFO_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sdla.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sdla.h
new file mode 100644
index 0000000..303b4fa
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sdla.h
@@ -0,0 +1,119 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for the Frame relay interface.
+ *
+ * Version: @(#)if_ifrad.h 0.20 13 Apr 96
+ *
+ * Author: Mike McLagan <mike.mclagan@linux.org>
+ *
+ * Changes:
+ * 0.15 Mike McLagan Structure packing
+ *
+ * 0.20 Mike McLagan New flags for S508 buffer handling
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef SDLA_H
+#define SDLA_H
+
+/* adapter type */
+#define SDLA_TYPES
+#define SDLA_S502A 5020
+#define SDLA_S502E 5021
+#define SDLA_S503 5030
+#define SDLA_S507 5070
+#define SDLA_S508 5080
+#define SDLA_S509 5090
+#define SDLA_UNKNOWN -1
+
+/* port selection flags for the S508 */
+#define SDLA_S508_PORT_V35 0x00
+#define SDLA_S508_PORT_RS232 0x02
+
+/* Z80 CPU speeds */
+#define SDLA_CPU_3M 0x00
+#define SDLA_CPU_5M 0x01
+#define SDLA_CPU_7M 0x02
+#define SDLA_CPU_8M 0x03
+#define SDLA_CPU_10M 0x04
+#define SDLA_CPU_16M 0x05
+#define SDLA_CPU_12M 0x06
+
+/* some private IOCTLs */
+#define SDLA_IDENTIFY (FRAD_LAST_IOCTL + 1)
+#define SDLA_CPUSPEED (FRAD_LAST_IOCTL + 2)
+#define SDLA_PROTOCOL (FRAD_LAST_IOCTL + 3)
+
+#define SDLA_CLEARMEM (FRAD_LAST_IOCTL + 4)
+#define SDLA_WRITEMEM (FRAD_LAST_IOCTL + 5)
+#define SDLA_READMEM (FRAD_LAST_IOCTL + 6)
+
+struct sdla_mem {
+ int addr;
+ int len;
+ void *data;
+};
+
+#define SDLA_START (FRAD_LAST_IOCTL + 7)
+#define SDLA_STOP (FRAD_LAST_IOCTL + 8)
+
+/* some offsets in the Z80's memory space */
+#define SDLA_NMIADDR 0x0000
+#define SDLA_CONF_ADDR 0x0010
+#define SDLA_S502A_NMIADDR 0x0066
+#define SDLA_CODE_BASEADDR 0x0100
+#define SDLA_WINDOW_SIZE 0x2000
+#define SDLA_ADDR_MASK 0x1FFF
+
+/* largest handleable block of data */
+#define SDLA_MAX_DATA 4080
+#define SDLA_MAX_MTU 4072 /* MAX_DATA - sizeof(fradhdr) */
+#define SDLA_MAX_DLCI 24
+
+/* this should be the same as frad_conf */
+struct sdla_conf {
+ short station;
+ short config;
+ short kbaud;
+ short clocking;
+ short max_frm;
+ short T391;
+ short T392;
+ short N391;
+ short N392;
+ short N393;
+ short CIR_fwd;
+ short Bc_fwd;
+ short Be_fwd;
+ short CIR_bwd;
+ short Bc_bwd;
+ short Be_bwd;
+};
+
+/* this should be the same as dlci_conf */
+struct sdla_dlci_conf {
+ short config;
+ short CIR_fwd;
+ short Bc_fwd;
+ short Be_fwd;
+ short CIR_bwd;
+ short Bc_bwd;
+ short Be_bwd;
+ short Tc_fwd;
+ short Tc_bwd;
+ short Tf_max;
+ short Tb_max;
+};
+
+
+void sdla(void *cfg_info, char *dev, struct frad_conf *conf, int quiet);
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/selinux_netlink.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/selinux_netlink.h
new file mode 100644
index 0000000..7a9bf6a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/selinux_netlink.h
@@ -0,0 +1,48 @@
+/*
+ * Netlink event notifications for SELinux.
+ *
+ * Author: James Morris <jmorris@redhat.com>
+ *
+ * Copyright (C) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ */
+#ifndef _LINUX_SELINUX_NETLINK_H
+#define _LINUX_SELINUX_NETLINK_H
+
+#include <linux/types.h>
+
+/* Message types. */
+#define SELNL_MSG_BASE 0x10
+enum {
+ SELNL_MSG_SETENFORCE = SELNL_MSG_BASE,
+ SELNL_MSG_POLICYLOAD,
+ SELNL_MSG_MAX
+};
+
+/* Multicast groups - backwards compatiblility for userspace */
+#define SELNL_GRP_NONE 0x00000000
+#define SELNL_GRP_AVC 0x00000001 /* AVC notifications */
+#define SELNL_GRP_ALL 0xffffffff
+
+enum selinux_nlgroups {
+ SELNLGRP_NONE,
+#define SELNLGRP_NONE SELNLGRP_NONE
+ SELNLGRP_AVC,
+#define SELNLGRP_AVC SELNLGRP_AVC
+ __SELNLGRP_MAX
+};
+#define SELNLGRP_MAX (__SELNLGRP_MAX - 1)
+
+/* Message structures */
+struct selnl_msg_setenforce {
+ __s32 val;
+};
+
+struct selnl_msg_policyload {
+ __u32 seqno;
+};
+
+#endif /* _LINUX_SELINUX_NETLINK_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sem.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sem.h
new file mode 100644
index 0000000..9f1974c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sem.h
@@ -0,0 +1,80 @@
+#ifndef _LINUX_SEM_H
+#define _LINUX_SEM_H
+
+#include <linux/ipc.h>
+
+/* semop flags */
+#define SEM_UNDO 0x1000 /* undo the operation on exit */
+
+/* semctl Command Definitions. */
+#define GETPID 11 /* get sempid */
+#define GETVAL 12 /* get semval */
+#define GETALL 13 /* get all semval's */
+#define GETNCNT 14 /* get semncnt */
+#define GETZCNT 15 /* get semzcnt */
+#define SETVAL 16 /* set semval */
+#define SETALL 17 /* set all semval's */
+
+/* ipcs ctl cmds */
+#define SEM_STAT 18
+#define SEM_INFO 19
+
+/* Obsolete, used only for backwards compatibility and libc5 compiles */
+struct semid_ds {
+ struct ipc_perm sem_perm; /* permissions .. see ipc.h */
+ __kernel_time_t sem_otime; /* last semop time */
+ __kernel_time_t sem_ctime; /* last change time */
+ struct sem *sem_base; /* ptr to first semaphore in array */
+ struct sem_queue *sem_pending; /* pending operations to be processed */
+ struct sem_queue **sem_pending_last; /* last pending operation */
+ struct sem_undo *undo; /* undo requests on this array */
+ unsigned short sem_nsems; /* no. of semaphores in array */
+};
+
+/* Include the definition of semid64_ds */
+#include <asm/sembuf.h>
+
+/* semop system calls takes an array of these. */
+struct sembuf {
+ unsigned short sem_num; /* semaphore index in array */
+ short sem_op; /* semaphore operation */
+ short sem_flg; /* operation flags */
+};
+
+/* arg for semctl system calls. */
+union semun {
+ int val; /* value for SETVAL */
+ struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */
+ unsigned short *array; /* array for GETALL & SETALL */
+ struct seminfo *__buf; /* buffer for IPC_INFO */
+ void *__pad;
+};
+
+struct seminfo {
+ int semmap;
+ int semmni;
+ int semmns;
+ int semmnu;
+ int semmsl;
+ int semopm;
+ int semume;
+ int semusz;
+ int semvmx;
+ int semaem;
+};
+
+#define SEMMNI 128 /* <= IPCMNI max # of semaphore identifiers */
+#define SEMMSL 250 /* <= 8 000 max num of semaphores per id */
+#define SEMMNS (SEMMNI*SEMMSL) /* <= INT_MAX max # of semaphores in system */
+#define SEMOPM 32 /* <= 1 000 max num of ops per semop call */
+#define SEMVMX 32767 /* <= 32767 semaphore maximum value */
+#define SEMAEM SEMVMX /* adjust on exit max value */
+
+/* unused */
+#define SEMUME SEMOPM /* max num of undo entries per process */
+#define SEMMNU SEMMNS /* num of undo structures system wide */
+#define SEMMAP SEMMNS /* # of entries in semaphore map */
+#define SEMUSZ 20 /* sizeof struct sem_undo */
+
+
+#endif /* _LINUX_SEM_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/serial.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/serial.h
new file mode 100644
index 0000000..a9a9ac4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/serial.h
@@ -0,0 +1,175 @@
+/*
+ * include/linux/serial.h
+ *
+ * Copyright (C) 1992 by Theodore Ts'o.
+ *
+ * Redistribution of this file is permitted under the terms of the GNU
+ * Public License (GPL)
+ */
+
+#ifndef _LINUX_SERIAL_H
+#define _LINUX_SERIAL_H
+
+#include <linux/types.h>
+
+
+struct serial_struct {
+ int type;
+ int line;
+ unsigned int port;
+ int irq;
+ int flags;
+ int xmit_fifo_size;
+ int custom_divisor;
+ int baud_base;
+ unsigned short close_delay;
+ char io_type;
+ char reserved_char[1];
+ int hub6;
+ unsigned short closing_wait; /* time to wait before closing */
+ unsigned short closing_wait2; /* no longer used... */
+ unsigned char *iomem_base;
+ unsigned short iomem_reg_shift;
+ unsigned int port_high;
+ unsigned long iomap_base; /* cookie passed into ioremap */
+};
+
+/*
+ * For the close wait times, 0 means wait forever for serial port to
+ * flush its output. 65535 means don't wait at all.
+ */
+#define ASYNC_CLOSING_WAIT_INF 0
+#define ASYNC_CLOSING_WAIT_NONE 65535
+
+/*
+ * These are the supported serial types.
+ */
+#define PORT_UNKNOWN 0
+#define PORT_8250 1
+#define PORT_16450 2
+#define PORT_16550 3
+#define PORT_16550A 4
+#define PORT_CIRRUS 5 /* usurped by cyclades.c */
+#define PORT_16650 6
+#define PORT_16650V2 7
+#define PORT_16750 8
+#define PORT_STARTECH 9 /* usurped by cyclades.c */
+#define PORT_16C950 10 /* Oxford Semiconductor */
+#define PORT_16654 11
+#define PORT_16850 12
+#define PORT_RSA 13 /* RSA-DV II/S card */
+#define PORT_MAX 13
+
+#define SERIAL_IO_PORT 0
+#define SERIAL_IO_HUB6 1
+#define SERIAL_IO_MEM 2
+
+struct serial_uart_config {
+ char *name;
+ int dfl_xmit_fifo_size;
+ int flags;
+};
+
+#define UART_CLEAR_FIFO 0x01
+#define UART_USE_FIFO 0x02
+#define UART_STARTECH 0x04
+#define UART_NATSEMI 0x08
+
+/*
+ * Definitions for async_struct (and serial_struct) flags field
+ */
+#define ASYNC_HUP_NOTIFY 0x0001 /* Notify getty on hangups and closes
+ on the callout port */
+#define ASYNC_FOURPORT 0x0002 /* Set OU1, OUT2 per AST Fourport settings */
+#define ASYNC_SAK 0x0004 /* Secure Attention Key (Orange book) */
+#define ASYNC_SPLIT_TERMIOS 0x0008 /* Separate termios for dialin/callout */
+
+#define ASYNC_SPD_MASK 0x1030
+#define ASYNC_SPD_HI 0x0010 /* Use 56000 instead of 38400 bps */
+
+#define ASYNC_SPD_VHI 0x0020 /* Use 115200 instead of 38400 bps */
+#define ASYNC_SPD_CUST 0x0030 /* Use user-specified divisor */
+
+#define ASYNC_SKIP_TEST 0x0040 /* Skip UART test during autoconfiguration */
+#define ASYNC_AUTO_IRQ 0x0080 /* Do automatic IRQ during autoconfiguration */
+#define ASYNC_SESSION_LOCKOUT 0x0100 /* Lock out cua opens based on session */
+#define ASYNC_PGRP_LOCKOUT 0x0200 /* Lock out cua opens based on pgrp */
+#define ASYNC_CALLOUT_NOHUP 0x0400 /* Don't do hangups for cua device */
+
+#define ASYNC_HARDPPS_CD 0x0800 /* Call hardpps when CD goes high */
+
+#define ASYNC_SPD_SHI 0x1000 /* Use 230400 instead of 38400 bps */
+#define ASYNC_SPD_WARP 0x1010 /* Use 460800 instead of 38400 bps */
+
+#define ASYNC_LOW_LATENCY 0x2000 /* Request low latency behaviour */
+
+#define ASYNC_BUGGY_UART 0x4000 /* This is a buggy UART, skip some safety
+ * checks. Note: can be dangerous! */
+
+#define ASYNC_AUTOPROBE 0x8000 /* Port was autoprobed by PCI or PNP code */
+
+#define ASYNC_FLAGS 0x7FFF /* Possible legal async flags */
+#define ASYNC_USR_MASK 0x3430 /* Legal flags that non-privileged
+ * users can set or reset */
+
+/* Internal flags used only by kernel/chr_drv/serial.c */
+#define ASYNC_INITIALIZED 0x80000000 /* Serial port was initialized */
+#define ASYNC_NORMAL_ACTIVE 0x20000000 /* Normal device is active */
+#define ASYNC_BOOT_AUTOCONF 0x10000000 /* Autoconfigure port on bootup */
+#define ASYNC_CLOSING 0x08000000 /* Serial port is closing */
+#define ASYNC_CTS_FLOW 0x04000000 /* Do CTS flow control */
+#define ASYNC_CHECK_CD 0x02000000 /* i.e., CLOCAL */
+#define ASYNC_SHARE_IRQ 0x01000000 /* for multifunction cards
+ --- no longer used */
+#define ASYNC_CONS_FLOW 0x00800000 /* flow control for console */
+
+#define ASYNC_BOOT_ONLYMCA 0x00400000 /* Probe only if MCA bus */
+#define ASYNC_INTERNAL_FLAGS 0xFFC00000 /* Internal flags */
+
+/*
+ * Multiport serial configuration structure --- external structure
+ */
+struct serial_multiport_struct {
+ int irq;
+ int port1;
+ unsigned char mask1, match1;
+ int port2;
+ unsigned char mask2, match2;
+ int port3;
+ unsigned char mask3, match3;
+ int port4;
+ unsigned char mask4, match4;
+ int port_monitor;
+ int reserved[32];
+};
+
+/*
+ * Serial input interrupt line counters -- external structure
+ * Four lines can interrupt: CTS, DSR, RI, DCD
+ */
+struct serial_icounter_struct {
+ int cts, dsr, rng, dcd;
+ int rx, tx;
+ int frame, overrun, parity, brk;
+ int buf_overrun;
+ int reserved[9];
+};
+
+/*
+ * Serial interface for controlling RS485 settings on chips with suitable
+ * support. Set with TIOCSRS485 and get with TIOCGRS485 if supported by your
+ * platform. The set function returns the new state, with any unsupported bits
+ * reverted appropriately.
+ */
+
+struct serial_rs485 {
+ __u32 flags; /* RS485 feature flags */
+#define SER_RS485_ENABLED (1 << 0)
+#define SER_RS485_RTS_ON_SEND (1 << 1)
+#define SER_RS485_RTS_AFTER_SEND (1 << 2)
+ __u32 delay_rts_before_send; /* Milliseconds */
+ __u32 padding[6]; /* Memory is cheap, new structs
+ are a royal PITA .. */
+};
+
+#endif /* _LINUX_SERIAL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/serial_core.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/serial_core.h
new file mode 100644
index 0000000..b46cc41
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/serial_core.h
@@ -0,0 +1,171 @@
+/*
+ * linux/drivers/char/serial_core.h
+ *
+ * Copyright (C) 2000 Deep Blue Solutions Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef LINUX_SERIAL_CORE_H
+#define LINUX_SERIAL_CORE_H
+
+/*
+ * The type definitions. These are from Ted Ts'o's serial.h
+ */
+#define PORT_UNKNOWN 0
+#define PORT_8250 1
+#define PORT_16450 2
+#define PORT_16550 3
+#define PORT_16550A 4
+#define PORT_CIRRUS 5
+#define PORT_16650 6
+#define PORT_16650V2 7
+#define PORT_16750 8
+#define PORT_STARTECH 9
+#define PORT_16C950 10
+#define PORT_16654 11
+#define PORT_16850 12
+#define PORT_RSA 13
+#define PORT_NS16550A 14
+#define PORT_XSCALE 15
+#define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */
+#define PORT_OCTEON 17 /* Cavium OCTEON internal UART */
+#define PORT_MAX_8250 17 /* max port ID */
+
+/*
+ * ARM specific type numbers. These are not currently guaranteed
+ * to be implemented, and will change in the future. These are
+ * separate so any additions to the old serial.c that occur before
+ * we are merged can be easily merged here.
+ */
+#define PORT_PXA 31
+#define PORT_AMBA 32
+#define PORT_CLPS711X 33
+#define PORT_SA1100 34
+#define PORT_UART00 35
+#define PORT_21285 37
+
+/* Sparc type numbers. */
+#define PORT_SUNZILOG 38
+#define PORT_SUNSAB 39
+
+/* DEC */
+#define PORT_DZ 46
+#define PORT_ZS 47
+
+/* Parisc type numbers. */
+#define PORT_MUX 48
+
+/* Atmel AT91 / AT32 SoC */
+#define PORT_ATMEL 49
+
+/* Macintosh Zilog type numbers */
+#define PORT_MAC_ZILOG 50 /* m68k : not yet implemented */
+#define PORT_PMAC_ZILOG 51
+
+/* SH-SCI */
+#define PORT_SCI 52
+#define PORT_SCIF 53
+#define PORT_IRDA 54
+
+/* Samsung S3C2410 SoC and derivatives thereof */
+#define PORT_S3C2410 55
+
+/* SGI IP22 aka Indy / Challenge S / Indigo 2 */
+#define PORT_IP22ZILOG 56
+
+/* Sharp LH7a40x -- an ARM9 SoC series */
+#define PORT_LH7A40X 57
+
+/* PPC CPM type number */
+#define PORT_CPM 58
+
+/* MPC52xx type numbers */
+#define PORT_MPC52xx 59
+
+/* IBM icom */
+#define PORT_ICOM 60
+
+/* Samsung S3C2440 SoC */
+#define PORT_S3C2440 61
+
+/* Motorola i.MX SoC */
+#define PORT_IMX 62
+
+/* Marvell MPSC */
+#define PORT_MPSC 63
+
+/* TXX9 type number */
+#define PORT_TXX9 64
+
+/* NEC VR4100 series SIU/DSIU */
+#define PORT_VR41XX_SIU 65
+#define PORT_VR41XX_DSIU 66
+
+/* Samsung S3C2400 SoC */
+#define PORT_S3C2400 67
+
+/* M32R SIO */
+#define PORT_M32R_SIO 68
+
+/*Digi jsm */
+#define PORT_JSM 69
+
+#define PORT_PNX8XXX 70
+
+/* Hilscher netx */
+#define PORT_NETX 71
+
+/* SUN4V Hypervisor Console */
+#define PORT_SUNHV 72
+
+#define PORT_S3C2412 73
+
+/* Xilinx uartlite */
+#define PORT_UARTLITE 74
+
+/* Blackfin bf5xx */
+#define PORT_BFIN 75
+
+/* Micrel KS8695 */
+#define PORT_KS8695 76
+
+/* Broadcom SB1250, etc. SOC */
+#define PORT_SB1250_DUART 77
+
+/* Freescale ColdFire */
+#define PORT_MCF 78
+
+/* Blackfin SPORT */
+#define PORT_BFIN_SPORT 79
+
+/* MN10300 on-chip UART numbers */
+#define PORT_MN10300 80
+#define PORT_MN10300_CTS 81
+
+#define PORT_SC26XX 82
+
+/* SH-SCI */
+#define PORT_SCIFA 83
+
+#define PORT_S3C6400 84
+
+/* NWPSERIAL */
+#define PORT_NWPSERIAL 85
+
+/* MAX3100 */
+#define PORT_MAX3100 86
+
+
+#endif /* LINUX_SERIAL_CORE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/serial_reg.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/serial_reg.h
new file mode 100644
index 0000000..96c0d93
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/serial_reg.h
@@ -0,0 +1,328 @@
+/*
+ * include/linux/serial_reg.h
+ *
+ * Copyright (C) 1992, 1994 by Theodore Ts'o.
+ *
+ * Redistribution of this file is permitted under the terms of the GNU
+ * Public License (GPL)
+ *
+ * These are the UART port assignments, expressed as offsets from the base
+ * register. These assignments should hold for any serial port based on
+ * a 8250, 16450, or 16550(A).
+ */
+
+#ifndef _LINUX_SERIAL_REG_H
+#define _LINUX_SERIAL_REG_H
+
+/*
+ * DLAB=0
+ */
+#define UART_RX 0 /* In: Receive buffer */
+#define UART_TX 0 /* Out: Transmit buffer */
+
+#define UART_IER 1 /* Out: Interrupt Enable Register */
+#define UART_IER_MSI 0x08 /* Enable Modem status interrupt */
+#define UART_IER_RLSI 0x04 /* Enable receiver line status interrupt */
+#define UART_IER_THRI 0x02 /* Enable Transmitter holding register int. */
+#define UART_IER_RDI 0x01 /* Enable receiver data interrupt */
+/*
+ * Sleep mode for ST16650 and TI16750. For the ST16650, EFR[4]=1
+ */
+#define UART_IERX_SLEEP 0x10 /* Enable sleep mode */
+
+#define UART_IIR 2 /* In: Interrupt ID Register */
+#define UART_IIR_NO_INT 0x01 /* No interrupts pending */
+#define UART_IIR_ID 0x06 /* Mask for the interrupt ID */
+#define UART_IIR_MSI 0x00 /* Modem status interrupt */
+#define UART_IIR_THRI 0x02 /* Transmitter holding register empty */
+#define UART_IIR_RDI 0x04 /* Receiver data interrupt */
+#define UART_IIR_RLSI 0x06 /* Receiver line status interrupt */
+
+#define UART_IIR_BUSY 0x07 /* DesignWare APB Busy Detect */
+
+#define UART_FCR 2 /* Out: FIFO Control Register */
+#define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */
+#define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */
+#define UART_FCR_CLEAR_XMIT 0x04 /* Clear the XMIT FIFO */
+#define UART_FCR_DMA_SELECT 0x08 /* For DMA applications */
+/*
+ * Note: The FIFO trigger levels are chip specific:
+ * RX:76 = 00 01 10 11 TX:54 = 00 01 10 11
+ * PC16550D: 1 4 8 14 xx xx xx xx
+ * TI16C550A: 1 4 8 14 xx xx xx xx
+ * TI16C550C: 1 4 8 14 xx xx xx xx
+ * ST16C550: 1 4 8 14 xx xx xx xx
+ * ST16C650: 8 16 24 28 16 8 24 30 PORT_16650V2
+ * NS16C552: 1 4 8 14 xx xx xx xx
+ * ST16C654: 8 16 56 60 8 16 32 56 PORT_16654
+ * TI16C750: 1 16 32 56 xx xx xx xx PORT_16750
+ * TI16C752: 8 16 56 60 8 16 32 56
+ */
+#define UART_FCR_R_TRIG_00 0x00
+#define UART_FCR_R_TRIG_01 0x40
+#define UART_FCR_R_TRIG_10 0x80
+#define UART_FCR_R_TRIG_11 0xc0
+#define UART_FCR_T_TRIG_00 0x00
+#define UART_FCR_T_TRIG_01 0x10
+#define UART_FCR_T_TRIG_10 0x20
+#define UART_FCR_T_TRIG_11 0x30
+
+#define UART_FCR_TRIGGER_MASK 0xC0 /* Mask for the FIFO trigger range */
+#define UART_FCR_TRIGGER_1 0x00 /* Mask for trigger set at 1 */
+#define UART_FCR_TRIGGER_4 0x40 /* Mask for trigger set at 4 */
+#define UART_FCR_TRIGGER_8 0x80 /* Mask for trigger set at 8 */
+#define UART_FCR_TRIGGER_14 0xC0 /* Mask for trigger set at 14 */
+/* 16650 definitions */
+#define UART_FCR6_R_TRIGGER_8 0x00 /* Mask for receive trigger set at 1 */
+#define UART_FCR6_R_TRIGGER_16 0x40 /* Mask for receive trigger set at 4 */
+#define UART_FCR6_R_TRIGGER_24 0x80 /* Mask for receive trigger set at 8 */
+#define UART_FCR6_R_TRIGGER_28 0xC0 /* Mask for receive trigger set at 14 */
+#define UART_FCR6_T_TRIGGER_16 0x00 /* Mask for transmit trigger set at 16 */
+#define UART_FCR6_T_TRIGGER_8 0x10 /* Mask for transmit trigger set at 8 */
+#define UART_FCR6_T_TRIGGER_24 0x20 /* Mask for transmit trigger set at 24 */
+#define UART_FCR6_T_TRIGGER_30 0x30 /* Mask for transmit trigger set at 30 */
+#define UART_FCR7_64BYTE 0x20 /* Go into 64 byte mode (TI16C750) */
+
+#define UART_LCR 3 /* Out: Line Control Register */
+/*
+ * Note: if the word length is 5 bits (UART_LCR_WLEN5), then setting
+ * UART_LCR_STOP will select 1.5 stop bits, not 2 stop bits.
+ */
+#define UART_LCR_DLAB 0x80 /* Divisor latch access bit */
+#define UART_LCR_SBC 0x40 /* Set break control */
+#define UART_LCR_SPAR 0x20 /* Stick parity (?) */
+#define UART_LCR_EPAR 0x10 /* Even parity select */
+#define UART_LCR_PARITY 0x08 /* Parity Enable */
+#define UART_LCR_STOP 0x04 /* Stop bits: 0=1 bit, 1=2 bits */
+#define UART_LCR_WLEN5 0x00 /* Wordlength: 5 bits */
+#define UART_LCR_WLEN6 0x01 /* Wordlength: 6 bits */
+#define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */
+#define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */
+
+#define UART_MCR 4 /* Out: Modem Control Register */
+#define UART_MCR_CLKSEL 0x80 /* Divide clock by 4 (TI16C752, EFR[4]=1) */
+#define UART_MCR_TCRTLR 0x40 /* Access TCR/TLR (TI16C752, EFR[4]=1) */
+#define UART_MCR_XONANY 0x20 /* Enable Xon Any (TI16C752, EFR[4]=1) */
+#define UART_MCR_AFE 0x20 /* Enable auto-RTS/CTS (TI16C550C/TI16C750) */
+#define UART_MCR_LOOP 0x10 /* Enable loopback test mode */
+#define UART_MCR_OUT2 0x08 /* Out2 complement */
+#define UART_MCR_OUT1 0x04 /* Out1 complement */
+#define UART_MCR_RTS 0x02 /* RTS complement */
+#define UART_MCR_DTR 0x01 /* DTR complement */
+
+#define UART_LSR 5 /* In: Line Status Register */
+#define UART_LSR_TEMT 0x40 /* Transmitter empty */
+#define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */
+#define UART_LSR_BI 0x10 /* Break interrupt indicator */
+#define UART_LSR_FE 0x08 /* Frame error indicator */
+#define UART_LSR_PE 0x04 /* Parity error indicator */
+#define UART_LSR_OE 0x02 /* Overrun error indicator */
+#define UART_LSR_DR 0x01 /* Receiver data ready */
+#define UART_LSR_BRK_ERROR_BITS 0x1E /* BI, FE, PE, OE bits */
+
+#define UART_MSR 6 /* In: Modem Status Register */
+#define UART_MSR_DCD 0x80 /* Data Carrier Detect */
+#define UART_MSR_RI 0x40 /* Ring Indicator */
+#define UART_MSR_DSR 0x20 /* Data Set Ready */
+#define UART_MSR_CTS 0x10 /* Clear to Send */
+#define UART_MSR_DDCD 0x08 /* Delta DCD */
+#define UART_MSR_TERI 0x04 /* Trailing edge ring indicator */
+#define UART_MSR_DDSR 0x02 /* Delta DSR */
+#define UART_MSR_DCTS 0x01 /* Delta CTS */
+#define UART_MSR_ANY_DELTA 0x0F /* Any of the delta bits! */
+
+#define UART_SCR 7 /* I/O: Scratch Register */
+
+/*
+ * DLAB=1
+ */
+#define UART_DLL 0 /* Out: Divisor Latch Low */
+#define UART_DLM 1 /* Out: Divisor Latch High */
+
+/*
+ * LCR=0xBF (or DLAB=1 for 16C660)
+ */
+#define UART_EFR 2 /* I/O: Extended Features Register */
+#define UART_EFR_CTS 0x80 /* CTS flow control */
+#define UART_EFR_RTS 0x40 /* RTS flow control */
+#define UART_EFR_SCD 0x20 /* Special character detect */
+#define UART_EFR_ECB 0x10 /* Enhanced control bit */
+/*
+ * the low four bits control software flow control
+ */
+
+/*
+ * LCR=0xBF, TI16C752, ST16650, ST16650A, ST16654
+ */
+#define UART_XON1 4 /* I/O: Xon character 1 */
+#define UART_XON2 5 /* I/O: Xon character 2 */
+#define UART_XOFF1 6 /* I/O: Xoff character 1 */
+#define UART_XOFF2 7 /* I/O: Xoff character 2 */
+
+/*
+ * EFR[4]=1 MCR[6]=1, TI16C752
+ */
+#define UART_TI752_TCR 6 /* I/O: transmission control register */
+#define UART_TI752_TLR 7 /* I/O: trigger level register */
+
+/*
+ * LCR=0xBF, XR16C85x
+ */
+#define UART_TRG 0 /* FCTR bit 7 selects Rx or Tx
+ * In: Fifo count
+ * Out: Fifo custom trigger levels */
+/*
+ * These are the definitions for the Programmable Trigger Register
+ */
+#define UART_TRG_1 0x01
+#define UART_TRG_4 0x04
+#define UART_TRG_8 0x08
+#define UART_TRG_16 0x10
+#define UART_TRG_32 0x20
+#define UART_TRG_64 0x40
+#define UART_TRG_96 0x60
+#define UART_TRG_120 0x78
+#define UART_TRG_128 0x80
+
+#define UART_FCTR 1 /* Feature Control Register */
+#define UART_FCTR_RTS_NODELAY 0x00 /* RTS flow control delay */
+#define UART_FCTR_RTS_4DELAY 0x01
+#define UART_FCTR_RTS_6DELAY 0x02
+#define UART_FCTR_RTS_8DELAY 0x03
+#define UART_FCTR_IRDA 0x04 /* IrDa data encode select */
+#define UART_FCTR_TX_INT 0x08 /* Tx interrupt type select */
+#define UART_FCTR_TRGA 0x00 /* Tx/Rx 550 trigger table select */
+#define UART_FCTR_TRGB 0x10 /* Tx/Rx 650 trigger table select */
+#define UART_FCTR_TRGC 0x20 /* Tx/Rx 654 trigger table select */
+#define UART_FCTR_TRGD 0x30 /* Tx/Rx 850 programmable trigger select */
+#define UART_FCTR_SCR_SWAP 0x40 /* Scratch pad register swap */
+#define UART_FCTR_RX 0x00 /* Programmable trigger mode select */
+#define UART_FCTR_TX 0x80 /* Programmable trigger mode select */
+
+/*
+ * LCR=0xBF, FCTR[6]=1
+ */
+#define UART_EMSR 7 /* Extended Mode Select Register */
+#define UART_EMSR_FIFO_COUNT 0x01 /* Rx/Tx select */
+#define UART_EMSR_ALT_COUNT 0x02 /* Alternating count select */
+
+/*
+ * The Intel XScale on-chip UARTs define these bits
+ */
+#define UART_IER_DMAE 0x80 /* DMA Requests Enable */
+#define UART_IER_UUE 0x40 /* UART Unit Enable */
+#define UART_IER_NRZE 0x20 /* NRZ coding Enable */
+#define UART_IER_RTOIE 0x10 /* Receiver Time Out Interrupt Enable */
+
+#define UART_IIR_TOD 0x08 /* Character Timeout Indication Detected */
+
+#define UART_FCR_PXAR1 0x00 /* receive FIFO treshold = 1 */
+#define UART_FCR_PXAR8 0x40 /* receive FIFO treshold = 8 */
+#define UART_FCR_PXAR16 0x80 /* receive FIFO treshold = 16 */
+#define UART_FCR_PXAR32 0xc0 /* receive FIFO treshold = 32 */
+
+
+
+
+/*
+ * These register definitions are for the 16C950
+ */
+#define UART_ASR 0x01 /* Additional Status Register */
+#define UART_RFL 0x03 /* Receiver FIFO level */
+#define UART_TFL 0x04 /* Transmitter FIFO level */
+#define UART_ICR 0x05 /* Index Control Register */
+
+/* The 16950 ICR registers */
+#define UART_ACR 0x00 /* Additional Control Register */
+#define UART_CPR 0x01 /* Clock Prescalar Register */
+#define UART_TCR 0x02 /* Times Clock Register */
+#define UART_CKS 0x03 /* Clock Select Register */
+#define UART_TTL 0x04 /* Transmitter Interrupt Trigger Level */
+#define UART_RTL 0x05 /* Receiver Interrupt Trigger Level */
+#define UART_FCL 0x06 /* Flow Control Level Lower */
+#define UART_FCH 0x07 /* Flow Control Level Higher */
+#define UART_ID1 0x08 /* ID #1 */
+#define UART_ID2 0x09 /* ID #2 */
+#define UART_ID3 0x0A /* ID #3 */
+#define UART_REV 0x0B /* Revision */
+#define UART_CSR 0x0C /* Channel Software Reset */
+#define UART_NMR 0x0D /* Nine-bit Mode Register */
+#define UART_CTR 0xFF
+
+/*
+ * The 16C950 Additional Control Register
+ */
+#define UART_ACR_RXDIS 0x01 /* Receiver disable */
+#define UART_ACR_TXDIS 0x02 /* Transmitter disable */
+#define UART_ACR_DSRFC 0x04 /* DSR Flow Control */
+#define UART_ACR_TLENB 0x20 /* 950 trigger levels enable */
+#define UART_ACR_ICRRD 0x40 /* ICR Read enable */
+#define UART_ACR_ASREN 0x80 /* Additional status enable */
+
+
+
+/*
+ * These definitions are for the RSA-DV II/S card, from
+ *
+ * Kiyokazu SUTO <suto@ks-and-ks.ne.jp>
+ */
+
+#define UART_RSA_BASE (-8)
+
+#define UART_RSA_MSR ((UART_RSA_BASE) + 0) /* I/O: Mode Select Register */
+
+#define UART_RSA_MSR_SWAP (1 << 0) /* Swap low/high 8 bytes in I/O port addr */
+#define UART_RSA_MSR_FIFO (1 << 2) /* Enable the external FIFO */
+#define UART_RSA_MSR_FLOW (1 << 3) /* Enable the auto RTS/CTS flow control */
+#define UART_RSA_MSR_ITYP (1 << 4) /* Level (1) / Edge triger (0) */
+
+#define UART_RSA_IER ((UART_RSA_BASE) + 1) /* I/O: Interrupt Enable Register */
+
+#define UART_RSA_IER_Rx_FIFO_H (1 << 0) /* Enable Rx FIFO half full int. */
+#define UART_RSA_IER_Tx_FIFO_H (1 << 1) /* Enable Tx FIFO half full int. */
+#define UART_RSA_IER_Tx_FIFO_E (1 << 2) /* Enable Tx FIFO empty int. */
+#define UART_RSA_IER_Rx_TOUT (1 << 3) /* Enable char receive timeout int */
+#define UART_RSA_IER_TIMER (1 << 4) /* Enable timer interrupt */
+
+#define UART_RSA_SRR ((UART_RSA_BASE) + 2) /* IN: Status Read Register */
+
+#define UART_RSA_SRR_Tx_FIFO_NEMP (1 << 0) /* Tx FIFO is not empty (1) */
+#define UART_RSA_SRR_Tx_FIFO_NHFL (1 << 1) /* Tx FIFO is not half full (1) */
+#define UART_RSA_SRR_Tx_FIFO_NFUL (1 << 2) /* Tx FIFO is not full (1) */
+#define UART_RSA_SRR_Rx_FIFO_NEMP (1 << 3) /* Rx FIFO is not empty (1) */
+#define UART_RSA_SRR_Rx_FIFO_NHFL (1 << 4) /* Rx FIFO is not half full (1) */
+#define UART_RSA_SRR_Rx_FIFO_NFUL (1 << 5) /* Rx FIFO is not full (1) */
+#define UART_RSA_SRR_Rx_TOUT (1 << 6) /* Character reception timeout occurred (1) */
+#define UART_RSA_SRR_TIMER (1 << 7) /* Timer interrupt occurred */
+
+#define UART_RSA_FRR ((UART_RSA_BASE) + 2) /* OUT: FIFO Reset Register */
+
+#define UART_RSA_TIVSR ((UART_RSA_BASE) + 3) /* I/O: Timer Interval Value Set Register */
+
+#define UART_RSA_TCR ((UART_RSA_BASE) + 4) /* OUT: Timer Control Register */
+
+#define UART_RSA_TCR_SWITCH (1 << 0) /* Timer on */
+
+/*
+ * The RSA DSV/II board has two fixed clock frequencies. One is the
+ * standard rate, and the other is 8 times faster.
+ */
+#define SERIAL_RSA_BAUD_BASE (921600)
+#define SERIAL_RSA_BAUD_BASE_LO (SERIAL_RSA_BAUD_BASE / 8)
+
+/*
+ * Extra serial register definitions for the internal UARTs
+ * in TI OMAP processors.
+ */
+#define UART_OMAP_MDR1 0x08 /* Mode definition register */
+#define UART_OMAP_MDR2 0x09 /* Mode definition register 2 */
+#define UART_OMAP_SCR 0x10 /* Supplementary control register */
+#define UART_OMAP_SSR 0x11 /* Supplementary status register */
+#define UART_OMAP_EBLR 0x12 /* BOF length register */
+#define UART_OMAP_OSC_12M_SEL 0x13 /* OMAP1510 12MHz osc select */
+#define UART_OMAP_MVER 0x14 /* Module version register */
+#define UART_OMAP_SYSC 0x15 /* System configuration register */
+#define UART_OMAP_SYSS 0x16 /* System status register */
+
+#endif /* _LINUX_SERIAL_REG_H */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/serio.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/serio.h
new file mode 100644
index 0000000..b2d73ea
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/serio.h
@@ -0,0 +1,76 @@
+#ifndef _SERIO_H
+#define _SERIO_H
+
+/*
+ * Copyright (C) 1999-2002 Vojtech Pavlik
+*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+
+#include <linux/ioctl.h>
+
+#define SPIOCSTYPE _IOW('q', 0x01, unsigned long)
+
+
+/*
+ * bit masks for use in "interrupt" flags (3rd argument)
+ */
+#define SERIO_TIMEOUT 1
+#define SERIO_PARITY 2
+#define SERIO_FRAME 4
+
+/*
+ * Serio types
+ */
+#define SERIO_XT 0x00
+#define SERIO_8042 0x01
+#define SERIO_RS232 0x02
+#define SERIO_HIL_MLC 0x03
+#define SERIO_PS_PSTHRU 0x05
+#define SERIO_8042_XL 0x06
+
+/*
+ * Serio protocols
+ */
+#define SERIO_UNKNOWN 0x00
+#define SERIO_MSC 0x01
+#define SERIO_SUN 0x02
+#define SERIO_MS 0x03
+#define SERIO_MP 0x04
+#define SERIO_MZ 0x05
+#define SERIO_MZP 0x06
+#define SERIO_MZPP 0x07
+#define SERIO_VSXXXAA 0x08
+#define SERIO_SUNKBD 0x10
+#define SERIO_WARRIOR 0x18
+#define SERIO_SPACEORB 0x19
+#define SERIO_MAGELLAN 0x1a
+#define SERIO_SPACEBALL 0x1b
+#define SERIO_GUNZE 0x1c
+#define SERIO_IFORCE 0x1d
+#define SERIO_STINGER 0x1e
+#define SERIO_NEWTON 0x1f
+#define SERIO_STOWAWAY 0x20
+#define SERIO_H3600 0x21
+#define SERIO_PS2SER 0x22
+#define SERIO_TWIDKBD 0x23
+#define SERIO_TWIDJOY 0x24
+#define SERIO_HIL 0x25
+#define SERIO_SNES232 0x26
+#define SERIO_SEMTECH 0x27
+#define SERIO_LKKBD 0x28
+#define SERIO_ELO 0x29
+#define SERIO_MICROTOUCH 0x30
+#define SERIO_PENMOUNT 0x31
+#define SERIO_TOUCHRIGHT 0x32
+#define SERIO_TOUCHWIN 0x33
+#define SERIO_TAOSEVM 0x34
+#define SERIO_FUJITSU 0x35
+#define SERIO_ZHENHUA 0x36
+#define SERIO_INEXIO 0x37
+#define SERIO_TOUCHIT213 0x38
+#define SERIO_W8001 0x39
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/shm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/shm.h
new file mode 100644
index 0000000..c99cef0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/shm.h
@@ -0,0 +1,75 @@
+#ifndef _LINUX_SHM_H_
+#define _LINUX_SHM_H_
+
+#include <linux/ipc.h>
+#include <linux/errno.h>
+#include <unistd.h>
+
+/*
+ * SHMMAX, SHMMNI and SHMALL are upper limits are defaults which can
+ * be increased by sysctl
+ */
+
+#define SHMMAX 0x2000000 /* max shared seg size (bytes) */
+#define SHMMIN 1 /* min shared seg size (bytes) */
+#define SHMMNI 4096 /* max num of segs system wide */
+#define SHMALL (SHMMAX/getpagesize()*(SHMMNI/16))
+#define SHMSEG SHMMNI /* max shared segs per process */
+
+
+/* Obsolete, used only for backwards compatibility and libc5 compiles */
+struct shmid_ds {
+ struct ipc_perm shm_perm; /* operation perms */
+ int shm_segsz; /* size of segment (bytes) */
+ __kernel_time_t shm_atime; /* last attach time */
+ __kernel_time_t shm_dtime; /* last detach time */
+ __kernel_time_t shm_ctime; /* last change time */
+ __kernel_ipc_pid_t shm_cpid; /* pid of creator */
+ __kernel_ipc_pid_t shm_lpid; /* pid of last operator */
+ unsigned short shm_nattch; /* no. of current attaches */
+ unsigned short shm_unused; /* compatibility */
+ void *shm_unused2; /* ditto - used by DIPC */
+ void *shm_unused3; /* unused */
+};
+
+/* Include the definition of shmid64_ds and shminfo64 */
+#include <asm/shmbuf.h>
+
+/* permission flag for shmget */
+#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */
+#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */
+
+/* mode for attach */
+#define SHM_RDONLY 010000 /* read-only access */
+#define SHM_RND 020000 /* round attach address to SHMLBA boundary */
+#define SHM_REMAP 040000 /* take-over region on attach */
+#define SHM_EXEC 0100000 /* execution access */
+
+/* super user shmctl commands */
+#define SHM_LOCK 11
+#define SHM_UNLOCK 12
+
+/* ipcs ctl commands */
+#define SHM_STAT 13
+#define SHM_INFO 14
+
+/* Obsolete, used only for backwards compatibility */
+struct shminfo {
+ int shmmax;
+ int shmmin;
+ int shmmni;
+ int shmseg;
+ int shmall;
+};
+
+struct shm_info {
+ int used_ids;
+ unsigned long shm_tot; /* total allocated shm */
+ unsigned long shm_rss; /* total resident shm */
+ unsigned long shm_swp; /* total swapped shm */
+ unsigned long swap_attempts;
+ unsigned long swap_successes;
+};
+
+
+#endif /* _LINUX_SHM_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/signal.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/signal.h
new file mode 100644
index 0000000..0bb69d8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/signal.h
@@ -0,0 +1,8 @@
+#ifndef _LINUX_SIGNAL_H
+#define _LINUX_SIGNAL_H
+
+#include <asm/signal.h>
+#include <asm/siginfo.h>
+
+
+#endif /* _LINUX_SIGNAL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/signalfd.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/signalfd.h
new file mode 100644
index 0000000..cd7325f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/signalfd.h
@@ -0,0 +1,52 @@
+/*
+ * include/linux/signalfd.h
+ *
+ * Copyright (C) 2007 Davide Libenzi <davidel@xmailserver.org>
+ *
+ */
+
+#ifndef _LINUX_SIGNALFD_H
+#define _LINUX_SIGNALFD_H
+
+#include <linux/types.h>
+/* For O_CLOEXEC and O_NONBLOCK */
+#include <linux/fcntl.h>
+
+/* Flags for signalfd4. */
+#define SFD_CLOEXEC O_CLOEXEC
+#define SFD_NONBLOCK O_NONBLOCK
+
+struct signalfd_siginfo {
+ __u32 ssi_signo;
+ __s32 ssi_errno;
+ __s32 ssi_code;
+ __u32 ssi_pid;
+ __u32 ssi_uid;
+ __s32 ssi_fd;
+ __u32 ssi_tid;
+ __u32 ssi_band;
+ __u32 ssi_overrun;
+ __u32 ssi_trapno;
+ __s32 ssi_status;
+ __s32 ssi_int;
+ __u64 ssi_ptr;
+ __u64 ssi_utime;
+ __u64 ssi_stime;
+ __u64 ssi_addr;
+
+ /*
+ * Pad strcture to 128 bytes. Remember to update the
+ * pad size when you add new members. We use a fixed
+ * size structure to avoid compatibility problems with
+ * future versions, and we leave extra space for additional
+ * members. We use fixed size members because this strcture
+ * comes out of a read(2) and we really don't want to have
+ * a compat on read(2).
+ */
+ __u8 __pad[48];
+};
+
+
+
+#endif /* _LINUX_SIGNALFD_H */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/smb.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/smb.h
new file mode 100644
index 0000000..9c94ad5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/smb.h
@@ -0,0 +1,64 @@
+/*
+ * smb.h
+ *
+ * Copyright (C) 1995, 1996 by Paal-Kr. Engstad and Volker Lendecke
+ * Copyright (C) 1997 by Volker Lendecke
+ *
+ */
+
+#ifndef _LINUX_SMB_H
+#define _LINUX_SMB_H
+
+#include <linux/types.h>
+#include <linux/magic.h>
+
+enum smb_protocol {
+ SMB_PROTOCOL_NONE,
+ SMB_PROTOCOL_CORE,
+ SMB_PROTOCOL_COREPLUS,
+ SMB_PROTOCOL_LANMAN1,
+ SMB_PROTOCOL_LANMAN2,
+ SMB_PROTOCOL_NT1
+};
+
+enum smb_case_hndl {
+ SMB_CASE_DEFAULT,
+ SMB_CASE_LOWER,
+ SMB_CASE_UPPER
+};
+
+struct smb_dskattr {
+ __u16 total;
+ __u16 allocblocks;
+ __u16 blocksize;
+ __u16 free;
+};
+
+struct smb_conn_opt {
+
+ /* The socket */
+ unsigned int fd;
+
+ enum smb_protocol protocol;
+ enum smb_case_hndl case_handling;
+
+ /* Connection-Options */
+
+ __u32 max_xmit;
+ __u16 server_uid;
+ __u16 tid;
+
+ /* The following are LANMAN 1.0 options */
+ __u16 secmode;
+ __u16 maxmux;
+ __u16 maxvcs;
+ __u16 rawmode;
+ __u32 sesskey;
+
+ /* The following are NT LM 0.12 options */
+ __u32 maxraw;
+ __u32 capabilities;
+ __s16 serverzone;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/smb_fs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/smb_fs.h
new file mode 100644
index 0000000..b7e9450
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/smb_fs.h
@@ -0,0 +1,25 @@
+/*
+ * smb_fs.h
+ *
+ * Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke
+ * Copyright (C) 1997 by Volker Lendecke
+ *
+ */
+
+#ifndef _LINUX_SMB_FS_H
+#define _LINUX_SMB_FS_H
+
+#include <linux/smb.h>
+
+/*
+ * ioctl commands
+ */
+#define SMB_IOC_GETMOUNTUID _IOR('u', 1, __kernel_old_uid_t)
+#define SMB_IOC_NEWCONN _IOW('u', 2, struct smb_conn_opt)
+
+/* __kernel_uid_t can never change, so we have to use __kernel_uid32_t */
+#define SMB_IOC_GETMOUNTUID32 _IOR('u', 3, __kernel_uid32_t)
+
+
+
+#endif /* _LINUX_SMB_FS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/smb_mount.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/smb_mount.h
new file mode 100644
index 0000000..82956ba
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/smb_mount.h
@@ -0,0 +1,27 @@
+/*
+ * smb_mount.h
+ *
+ * Copyright (C) 1995, 1996 by Paal-Kr. Engstad and Volker Lendecke
+ * Copyright (C) 1997 by Volker Lendecke
+ *
+ */
+
+#ifndef _LINUX_SMB_MOUNT_H
+#define _LINUX_SMB_MOUNT_H
+
+#include <linux/types.h>
+
+#define SMB_MOUNT_VERSION 6
+
+struct smb_mount_data {
+ int version;
+ __kernel_uid_t mounted_uid; /* Who may umount() this filesystem? */
+ __kernel_uid_t uid;
+ __kernel_gid_t gid;
+ __kernel_mode_t file_mode;
+ __kernel_mode_t dir_mode;
+};
+
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/smbno.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/smbno.h
new file mode 100644
index 0000000..f99e02d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/smbno.h
@@ -0,0 +1,363 @@
+#ifndef _SMBNO_H_
+#define _SMBNO_H_
+
+/* these define the attribute byte as seen by DOS */
+#define aRONLY (1L<<0)
+#define aHIDDEN (1L<<1)
+#define aSYSTEM (1L<<2)
+#define aVOLID (1L<<3)
+#define aDIR (1L<<4)
+#define aARCH (1L<<5)
+
+/* error classes */
+#define SUCCESS 0 /* The request was successful. */
+#define ERRDOS 0x01 /* Error is from the core DOS operating system set. */
+#define ERRSRV 0x02 /* Error is generated by the server network file manager.*/
+#define ERRHRD 0x03 /* Error is an hardware error. */
+#define ERRCMD 0xFF /* Command was not in the "SMB" format. */
+
+/* SMB X/Open error codes for the ERRdos error class */
+
+#define ERRbadfunc 1 /* Invalid function (or system call) */
+#define ERRbadfile 2 /* File not found (pathname error) */
+#define ERRbadpath 3 /* Directory not found */
+#define ERRnofids 4 /* Too many open files */
+#define ERRnoaccess 5 /* Access denied */
+#define ERRbadfid 6 /* Invalid fid */
+#define ERRbadmcb 7 /* Memory control blocks destroyed */
+#define ERRnomem 8 /* Out of memory */
+#define ERRbadmem 9 /* Invalid memory block address */
+#define ERRbadenv 10 /* Invalid environment */
+#define ERRbadformat 11 /* Invalid format */
+#define ERRbadaccess 12 /* Invalid open mode */
+#define ERRbaddata 13 /* Invalid data (only from ioctl call) */
+#define ERRres 14 /* reserved */
+#define ERRbaddrive 15 /* Invalid drive */
+#define ERRremcd 16 /* Attempt to delete current directory */
+#define ERRdiffdevice 17 /* rename/move across different filesystems */
+#define ERRnofiles 18 /* no more files found in file search */
+#define ERRbadshare 32 /* Share mode on file conflict with open mode */
+#define ERRlock 33 /* Lock request conflicts with existing lock */
+#define ERRfilexists 80 /* File in operation already exists */
+#define ERRbadpipe 230 /* Named pipe invalid */
+#define ERRpipebusy 231 /* All instances of pipe are busy */
+#define ERRpipeclosing 232 /* named pipe close in progress */
+#define ERRnotconnected 233 /* No process on other end of named pipe */
+#define ERRmoredata 234 /* More data to be returned */
+
+#define ERROR_INVALID_PARAMETER 87
+#define ERROR_DISK_FULL 112
+#define ERROR_INVALID_NAME 123
+#define ERROR_DIR_NOT_EMPTY 145
+#define ERROR_NOT_LOCKED 158
+#define ERROR_ALREADY_EXISTS 183 /* see also 80 ? */
+#define ERROR_EAS_DIDNT_FIT 275 /* Extended attributes didn't fit */
+#define ERROR_EAS_NOT_SUPPORTED 282 /* Extended attributes not supported */
+
+/* Error codes for the ERRSRV class */
+
+#define ERRerror 1 /* Non specific error code */
+#define ERRbadpw 2 /* Bad password */
+#define ERRbadtype 3 /* reserved */
+#define ERRaccess 4 /* No permissions to do the requested operation */
+#define ERRinvnid 5 /* tid invalid */
+#define ERRinvnetname 6 /* Invalid servername */
+#define ERRinvdevice 7 /* Invalid device */
+#define ERRqfull 49 /* Print queue full */
+#define ERRqtoobig 50 /* Queued item too big */
+#define ERRinvpfid 52 /* Invalid print file in smb_fid */
+#define ERRsmbcmd 64 /* Unrecognised command */
+#define ERRsrverror 65 /* smb server internal error */
+#define ERRfilespecs 67 /* fid and pathname invalid combination */
+#define ERRbadlink 68 /* reserved */
+#define ERRbadpermits 69 /* Access specified for a file is not valid */
+#define ERRbadpid 70 /* reserved */
+#define ERRsetattrmode 71 /* attribute mode invalid */
+#define ERRpaused 81 /* Message server paused */
+#define ERRmsgoff 82 /* Not receiving messages */
+#define ERRnoroom 83 /* No room for message */
+#define ERRrmuns 87 /* too many remote usernames */
+#define ERRtimeout 88 /* operation timed out */
+#define ERRnoresource 89 /* No resources currently available for request. */
+#define ERRtoomanyuids 90 /* too many userids */
+#define ERRbaduid 91 /* bad userid */
+#define ERRuseMPX 250 /* temporarily unable to use raw mode, use MPX mode */
+#define ERRuseSTD 251 /* temporarily unable to use raw mode, use std.mode */
+#define ERRcontMPX 252 /* resume MPX mode */
+#define ERRbadPW /* reserved */
+#define ERRnosupport 0xFFFF
+
+/* Error codes for the ERRHRD class */
+
+#define ERRnowrite 19 /* read only media */
+#define ERRbadunit 20 /* Unknown device */
+#define ERRnotready 21 /* Drive not ready */
+#define ERRbadcmd 22 /* Unknown command */
+#define ERRdata 23 /* Data (CRC) error */
+#define ERRbadreq 24 /* Bad request structure length */
+#define ERRseek 25
+#define ERRbadmedia 26
+#define ERRbadsector 27
+#define ERRnopaper 28
+#define ERRwrite 29 /* write fault */
+#define ERRread 30 /* read fault */
+#define ERRgeneral 31 /* General hardware failure */
+#define ERRwrongdisk 34
+#define ERRFCBunavail 35
+#define ERRsharebufexc 36 /* share buffer exceeded */
+#define ERRdiskfull 39
+
+/*
+ * Access modes when opening a file
+ */
+#define SMB_ACCMASK 0x0003
+#define SMB_O_RDONLY 0x0000
+#define SMB_O_WRONLY 0x0001
+#define SMB_O_RDWR 0x0002
+
+/* offsets into message for common items */
+#define smb_com 8
+#define smb_rcls 9
+#define smb_reh 10
+#define smb_err 11
+#define smb_flg 13
+#define smb_flg2 14
+#define smb_reb 13
+#define smb_tid 28
+#define smb_pid 30
+#define smb_uid 32
+#define smb_mid 34
+#define smb_wct 36
+#define smb_vwv 37
+#define smb_vwv0 37
+#define smb_vwv1 39
+#define smb_vwv2 41
+#define smb_vwv3 43
+#define smb_vwv4 45
+#define smb_vwv5 47
+#define smb_vwv6 49
+#define smb_vwv7 51
+#define smb_vwv8 53
+#define smb_vwv9 55
+#define smb_vwv10 57
+#define smb_vwv11 59
+#define smb_vwv12 61
+#define smb_vwv13 63
+#define smb_vwv14 65
+
+/* these are the trans2 sub fields for primary requests */
+#define smb_tpscnt smb_vwv0
+#define smb_tdscnt smb_vwv1
+#define smb_mprcnt smb_vwv2
+#define smb_mdrcnt smb_vwv3
+#define smb_msrcnt smb_vwv4
+#define smb_flags smb_vwv5
+#define smb_timeout smb_vwv6
+#define smb_pscnt smb_vwv9
+#define smb_psoff smb_vwv10
+#define smb_dscnt smb_vwv11
+#define smb_dsoff smb_vwv12
+#define smb_suwcnt smb_vwv13
+#define smb_setup smb_vwv14
+#define smb_setup0 smb_setup
+#define smb_setup1 (smb_setup+2)
+#define smb_setup2 (smb_setup+4)
+
+/* these are for the secondary requests */
+#define smb_spscnt smb_vwv2
+#define smb_spsoff smb_vwv3
+#define smb_spsdisp smb_vwv4
+#define smb_sdscnt smb_vwv5
+#define smb_sdsoff smb_vwv6
+#define smb_sdsdisp smb_vwv7
+#define smb_sfid smb_vwv8
+
+/* and these for responses */
+#define smb_tprcnt smb_vwv0
+#define smb_tdrcnt smb_vwv1
+#define smb_prcnt smb_vwv3
+#define smb_proff smb_vwv4
+#define smb_prdisp smb_vwv5
+#define smb_drcnt smb_vwv6
+#define smb_droff smb_vwv7
+#define smb_drdisp smb_vwv8
+
+/* the complete */
+#define SMBmkdir 0x00 /* create directory */
+#define SMBrmdir 0x01 /* delete directory */
+#define SMBopen 0x02 /* open file */
+#define SMBcreate 0x03 /* create file */
+#define SMBclose 0x04 /* close file */
+#define SMBflush 0x05 /* flush file */
+#define SMBunlink 0x06 /* delete file */
+#define SMBmv 0x07 /* rename file */
+#define SMBgetatr 0x08 /* get file attributes */
+#define SMBsetatr 0x09 /* set file attributes */
+#define SMBread 0x0A /* read from file */
+#define SMBwrite 0x0B /* write to file */
+#define SMBlock 0x0C /* lock byte range */
+#define SMBunlock 0x0D /* unlock byte range */
+#define SMBctemp 0x0E /* create temporary file */
+#define SMBmknew 0x0F /* make new file */
+#define SMBchkpth 0x10 /* check directory path */
+#define SMBexit 0x11 /* process exit */
+#define SMBlseek 0x12 /* seek */
+#define SMBtcon 0x70 /* tree connect */
+#define SMBtconX 0x75 /* tree connect and X*/
+#define SMBtdis 0x71 /* tree disconnect */
+#define SMBnegprot 0x72 /* negotiate protocol */
+#define SMBdskattr 0x80 /* get disk attributes */
+#define SMBsearch 0x81 /* search directory */
+#define SMBsplopen 0xC0 /* open print spool file */
+#define SMBsplwr 0xC1 /* write to print spool file */
+#define SMBsplclose 0xC2 /* close print spool file */
+#define SMBsplretq 0xC3 /* return print queue */
+#define SMBsends 0xD0 /* send single block message */
+#define SMBsendb 0xD1 /* send broadcast message */
+#define SMBfwdname 0xD2 /* forward user name */
+#define SMBcancelf 0xD3 /* cancel forward */
+#define SMBgetmac 0xD4 /* get machine name */
+#define SMBsendstrt 0xD5 /* send start of multi-block message */
+#define SMBsendend 0xD6 /* send end of multi-block message */
+#define SMBsendtxt 0xD7 /* send text of multi-block message */
+
+/* Core+ protocol */
+#define SMBlockread 0x13 /* Lock a range and read */
+#define SMBwriteunlock 0x14 /* Unlock a range then write */
+#define SMBreadbraw 0x1a /* read a block of data with no smb header */
+#define SMBwritebraw 0x1d /* write a block of data with no smb header */
+#define SMBwritec 0x20 /* secondary write request */
+#define SMBwriteclose 0x2c /* write a file then close it */
+
+/* dos extended protocol */
+#define SMBreadBraw 0x1A /* read block raw */
+#define SMBreadBmpx 0x1B /* read block multiplexed */
+#define SMBreadBs 0x1C /* read block (secondary response) */
+#define SMBwriteBraw 0x1D /* write block raw */
+#define SMBwriteBmpx 0x1E /* write block multiplexed */
+#define SMBwriteBs 0x1F /* write block (secondary request) */
+#define SMBwriteC 0x20 /* write complete response */
+#define SMBsetattrE 0x22 /* set file attributes expanded */
+#define SMBgetattrE 0x23 /* get file attributes expanded */
+#define SMBlockingX 0x24 /* lock/unlock byte ranges and X */
+#define SMBtrans 0x25 /* transaction - name, bytes in/out */
+#define SMBtranss 0x26 /* transaction (secondary request/response) */
+#define SMBioctl 0x27 /* IOCTL */
+#define SMBioctls 0x28 /* IOCTL (secondary request/response) */
+#define SMBcopy 0x29 /* copy */
+#define SMBmove 0x2A /* move */
+#define SMBecho 0x2B /* echo */
+#define SMBopenX 0x2D /* open and X */
+#define SMBreadX 0x2E /* read and X */
+#define SMBwriteX 0x2F /* write and X */
+#define SMBsesssetupX 0x73 /* Session Set Up & X (including User Logon) */
+#define SMBtconX 0x75 /* tree connect and X */
+#define SMBffirst 0x82 /* find first */
+#define SMBfunique 0x83 /* find unique */
+#define SMBfclose 0x84 /* find close */
+#define SMBinvalid 0xFE /* invalid command */
+
+
+/* Extended 2.0 protocol */
+#define SMBtrans2 0x32 /* TRANS2 protocol set */
+#define SMBtranss2 0x33 /* TRANS2 protocol set, secondary command */
+#define SMBfindclose 0x34 /* Terminate a TRANSACT2_FINDFIRST */
+#define SMBfindnclose 0x35 /* Terminate a TRANSACT2_FINDNOTIFYFIRST */
+#define SMBulogoffX 0x74 /* user logoff */
+
+/* these are the TRANS2 sub commands */
+#define TRANSACT2_OPEN 0
+#define TRANSACT2_FINDFIRST 1
+#define TRANSACT2_FINDNEXT 2
+#define TRANSACT2_QFSINFO 3
+#define TRANSACT2_SETFSINFO 4
+#define TRANSACT2_QPATHINFO 5
+#define TRANSACT2_SETPATHINFO 6
+#define TRANSACT2_QFILEINFO 7
+#define TRANSACT2_SETFILEINFO 8
+#define TRANSACT2_FSCTL 9
+#define TRANSACT2_IOCTL 10
+#define TRANSACT2_FINDNOTIFYFIRST 11
+#define TRANSACT2_FINDNOTIFYNEXT 12
+#define TRANSACT2_MKDIR 13
+
+/* Information Levels - Shared? */
+#define SMB_INFO_STANDARD 1
+#define SMB_INFO_QUERY_EA_SIZE 2
+#define SMB_INFO_QUERY_EAS_FROM_LIST 3
+#define SMB_INFO_QUERY_ALL_EAS 4
+#define SMB_INFO_IS_NAME_VALID 6
+
+/* Information Levels - TRANSACT2_FINDFIRST */
+#define SMB_FIND_FILE_DIRECTORY_INFO 0x101
+#define SMB_FIND_FILE_FULL_DIRECTORY_INFO 0x102
+#define SMB_FIND_FILE_NAMES_INFO 0x103
+#define SMB_FIND_FILE_BOTH_DIRECTORY_INFO 0x104
+
+/* Information Levels - TRANSACT2_QPATHINFO */
+#define SMB_QUERY_FILE_BASIC_INFO 0x101
+#define SMB_QUERY_FILE_STANDARD_INFO 0x102
+#define SMB_QUERY_FILE_EA_INFO 0x103
+#define SMB_QUERY_FILE_NAME_INFO 0x104
+#define SMB_QUERY_FILE_ALL_INFO 0x107
+#define SMB_QUERY_FILE_ALT_NAME_INFO 0x108
+#define SMB_QUERY_FILE_STREAM_INFO 0x109
+#define SMB_QUERY_FILE_COMPRESSION_INFO 0x10b
+
+/* Information Levels - TRANSACT2_SETFILEINFO */
+#define SMB_SET_FILE_BASIC_INFO 0x101
+#define SMB_SET_FILE_DISPOSITION_INFO 0x102
+#define SMB_SET_FILE_ALLOCATION_INFO 0x103
+#define SMB_SET_FILE_END_OF_FILE_INFO 0x104
+
+/* smb_flg field flags */
+#define SMB_FLAGS_SUPPORT_LOCKREAD 0x01
+#define SMB_FLAGS_CLIENT_BUF_AVAIL 0x02
+#define SMB_FLAGS_RESERVED 0x04
+#define SMB_FLAGS_CASELESS_PATHNAMES 0x08
+#define SMB_FLAGS_CANONICAL_PATHNAMES 0x10
+#define SMB_FLAGS_REQUEST_OPLOCK 0x20
+#define SMB_FLAGS_REQUEST_BATCH_OPLOCK 0x40
+#define SMB_FLAGS_REPLY 0x80
+
+/* smb_flg2 field flags (samba-2.2.0/source/include/smb.h) */
+#define SMB_FLAGS2_LONG_PATH_COMPONENTS 0x0001
+#define SMB_FLAGS2_EXTENDED_ATTRIBUTES 0x0002
+#define SMB_FLAGS2_DFS_PATHNAMES 0x1000
+#define SMB_FLAGS2_READ_PERMIT_NO_EXECUTE 0x2000
+#define SMB_FLAGS2_32_BIT_ERROR_CODES 0x4000
+#define SMB_FLAGS2_UNICODE_STRINGS 0x8000
+
+
+/*
+ * UNIX stuff (from samba trans2.h)
+ */
+#define MIN_UNIX_INFO_LEVEL 0x200
+#define MAX_UNIX_INFO_LEVEL 0x2FF
+#define SMB_FIND_FILE_UNIX 0x202
+#define SMB_QUERY_FILE_UNIX_BASIC 0x200
+#define SMB_QUERY_FILE_UNIX_LINK 0x201
+#define SMB_QUERY_FILE_UNIX_HLINK 0x202
+#define SMB_SET_FILE_UNIX_BASIC 0x200
+#define SMB_SET_FILE_UNIX_LINK 0x201
+#define SMB_SET_FILE_UNIX_HLINK 0x203
+#define SMB_QUERY_CIFS_UNIX_INFO 0x200
+
+/* values which means "don't change it" */
+#define SMB_MODE_NO_CHANGE 0xFFFFFFFF
+#define SMB_UID_NO_CHANGE 0xFFFFFFFF
+#define SMB_GID_NO_CHANGE 0xFFFFFFFF
+#define SMB_TIME_NO_CHANGE 0xFFFFFFFFFFFFFFFFULL
+#define SMB_SIZE_NO_CHANGE 0xFFFFFFFFFFFFFFFFULL
+
+/* UNIX filetype mappings. */
+#define UNIX_TYPE_FILE 0
+#define UNIX_TYPE_DIR 1
+#define UNIX_TYPE_SYMLINK 2
+#define UNIX_TYPE_CHARDEV 3
+#define UNIX_TYPE_BLKDEV 4
+#define UNIX_TYPE_FIFO 5
+#define UNIX_TYPE_SOCKET 6
+#define UNIX_TYPE_UNKNOWN 0xFFFFFFFF
+
+#endif /* _SMBNO_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/snmp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/snmp.h
new file mode 100644
index 0000000..aee3f1e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/snmp.h
@@ -0,0 +1,257 @@
+/*
+ * Definitions for MIBs
+ *
+ * Author: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
+ */
+
+#ifndef _LINUX_SNMP_H
+#define _LINUX_SNMP_H
+
+/* ipstats mib definitions */
+/*
+ * RFC 1213: MIB-II
+ * RFC 2011 (updates 1213): SNMPv2-MIB-IP
+ * RFC 2863: Interfaces Group MIB
+ * RFC 2465: IPv6 MIB: General Group
+ * draft-ietf-ipv6-rfc2011-update-10.txt: MIB for IP: IP Statistics Tables
+ */
+enum
+{
+ IPSTATS_MIB_NUM = 0,
+ IPSTATS_MIB_INRECEIVES, /* InReceives */
+ IPSTATS_MIB_INHDRERRORS, /* InHdrErrors */
+ IPSTATS_MIB_INTOOBIGERRORS, /* InTooBigErrors */
+ IPSTATS_MIB_INNOROUTES, /* InNoRoutes */
+ IPSTATS_MIB_INADDRERRORS, /* InAddrErrors */
+ IPSTATS_MIB_INUNKNOWNPROTOS, /* InUnknownProtos */
+ IPSTATS_MIB_INTRUNCATEDPKTS, /* InTruncatedPkts */
+ IPSTATS_MIB_INDISCARDS, /* InDiscards */
+ IPSTATS_MIB_INDELIVERS, /* InDelivers */
+ IPSTATS_MIB_OUTFORWDATAGRAMS, /* OutForwDatagrams */
+ IPSTATS_MIB_OUTREQUESTS, /* OutRequests */
+ IPSTATS_MIB_OUTDISCARDS, /* OutDiscards */
+ IPSTATS_MIB_OUTNOROUTES, /* OutNoRoutes */
+ IPSTATS_MIB_REASMTIMEOUT, /* ReasmTimeout */
+ IPSTATS_MIB_REASMREQDS, /* ReasmReqds */
+ IPSTATS_MIB_REASMOKS, /* ReasmOKs */
+ IPSTATS_MIB_REASMFAILS, /* ReasmFails */
+ IPSTATS_MIB_FRAGOKS, /* FragOKs */
+ IPSTATS_MIB_FRAGFAILS, /* FragFails */
+ IPSTATS_MIB_FRAGCREATES, /* FragCreates */
+ IPSTATS_MIB_INMCASTPKTS, /* InMcastPkts */
+ IPSTATS_MIB_OUTMCASTPKTS, /* OutMcastPkts */
+ IPSTATS_MIB_INBCASTPKTS, /* InBcastPkts */
+ IPSTATS_MIB_OUTBCASTPKTS, /* OutBcastPkts */
+ __IPSTATS_MIB_MAX
+};
+
+/* icmp mib definitions */
+/*
+ * RFC 1213: MIB-II ICMP Group
+ * RFC 2011 (updates 1213): SNMPv2 MIB for IP: ICMP group
+ */
+enum
+{
+ ICMP_MIB_NUM = 0,
+ ICMP_MIB_INMSGS, /* InMsgs */
+ ICMP_MIB_INERRORS, /* InErrors */
+ ICMP_MIB_INDESTUNREACHS, /* InDestUnreachs */
+ ICMP_MIB_INTIMEEXCDS, /* InTimeExcds */
+ ICMP_MIB_INPARMPROBS, /* InParmProbs */
+ ICMP_MIB_INSRCQUENCHS, /* InSrcQuenchs */
+ ICMP_MIB_INREDIRECTS, /* InRedirects */
+ ICMP_MIB_INECHOS, /* InEchos */
+ ICMP_MIB_INECHOREPS, /* InEchoReps */
+ ICMP_MIB_INTIMESTAMPS, /* InTimestamps */
+ ICMP_MIB_INTIMESTAMPREPS, /* InTimestampReps */
+ ICMP_MIB_INADDRMASKS, /* InAddrMasks */
+ ICMP_MIB_INADDRMASKREPS, /* InAddrMaskReps */
+ ICMP_MIB_OUTMSGS, /* OutMsgs */
+ ICMP_MIB_OUTERRORS, /* OutErrors */
+ ICMP_MIB_OUTDESTUNREACHS, /* OutDestUnreachs */
+ ICMP_MIB_OUTTIMEEXCDS, /* OutTimeExcds */
+ ICMP_MIB_OUTPARMPROBS, /* OutParmProbs */
+ ICMP_MIB_OUTSRCQUENCHS, /* OutSrcQuenchs */
+ ICMP_MIB_OUTREDIRECTS, /* OutRedirects */
+ ICMP_MIB_OUTECHOS, /* OutEchos */
+ ICMP_MIB_OUTECHOREPS, /* OutEchoReps */
+ ICMP_MIB_OUTTIMESTAMPS, /* OutTimestamps */
+ ICMP_MIB_OUTTIMESTAMPREPS, /* OutTimestampReps */
+ ICMP_MIB_OUTADDRMASKS, /* OutAddrMasks */
+ ICMP_MIB_OUTADDRMASKREPS, /* OutAddrMaskReps */
+ __ICMP_MIB_MAX
+};
+
+#define __ICMPMSG_MIB_MAX 512 /* Out+In for all 8-bit ICMP types */
+
+/* icmp6 mib definitions */
+/*
+ * RFC 2466: ICMPv6-MIB
+ */
+enum
+{
+ ICMP6_MIB_NUM = 0,
+ ICMP6_MIB_INMSGS, /* InMsgs */
+ ICMP6_MIB_INERRORS, /* InErrors */
+ ICMP6_MIB_OUTMSGS, /* OutMsgs */
+ __ICMP6_MIB_MAX
+};
+
+#define __ICMP6MSG_MIB_MAX 512 /* Out+In for all 8-bit ICMPv6 types */
+
+/* tcp mib definitions */
+/*
+ * RFC 1213: MIB-II TCP group
+ * RFC 2012 (updates 1213): SNMPv2-MIB-TCP
+ */
+enum
+{
+ TCP_MIB_NUM = 0,
+ TCP_MIB_RTOALGORITHM, /* RtoAlgorithm */
+ TCP_MIB_RTOMIN, /* RtoMin */
+ TCP_MIB_RTOMAX, /* RtoMax */
+ TCP_MIB_MAXCONN, /* MaxConn */
+ TCP_MIB_ACTIVEOPENS, /* ActiveOpens */
+ TCP_MIB_PASSIVEOPENS, /* PassiveOpens */
+ TCP_MIB_ATTEMPTFAILS, /* AttemptFails */
+ TCP_MIB_ESTABRESETS, /* EstabResets */
+ TCP_MIB_CURRESTAB, /* CurrEstab */
+ TCP_MIB_INSEGS, /* InSegs */
+ TCP_MIB_OUTSEGS, /* OutSegs */
+ TCP_MIB_RETRANSSEGS, /* RetransSegs */
+ TCP_MIB_INERRS, /* InErrs */
+ TCP_MIB_OUTRSTS, /* OutRsts */
+ __TCP_MIB_MAX
+};
+
+/* udp mib definitions */
+/*
+ * RFC 1213: MIB-II UDP group
+ * RFC 2013 (updates 1213): SNMPv2-MIB-UDP
+ */
+enum
+{
+ UDP_MIB_NUM = 0,
+ UDP_MIB_INDATAGRAMS, /* InDatagrams */
+ UDP_MIB_NOPORTS, /* NoPorts */
+ UDP_MIB_INERRORS, /* InErrors */
+ UDP_MIB_OUTDATAGRAMS, /* OutDatagrams */
+ UDP_MIB_RCVBUFERRORS, /* RcvbufErrors */
+ UDP_MIB_SNDBUFERRORS, /* SndbufErrors */
+ __UDP_MIB_MAX
+};
+
+/* linux mib definitions */
+enum
+{
+ LINUX_MIB_NUM = 0,
+ LINUX_MIB_SYNCOOKIESSENT, /* SyncookiesSent */
+ LINUX_MIB_SYNCOOKIESRECV, /* SyncookiesRecv */
+ LINUX_MIB_SYNCOOKIESFAILED, /* SyncookiesFailed */
+ LINUX_MIB_EMBRYONICRSTS, /* EmbryonicRsts */
+ LINUX_MIB_PRUNECALLED, /* PruneCalled */
+ LINUX_MIB_RCVPRUNED, /* RcvPruned */
+ LINUX_MIB_OFOPRUNED, /* OfoPruned */
+ LINUX_MIB_OUTOFWINDOWICMPS, /* OutOfWindowIcmps */
+ LINUX_MIB_LOCKDROPPEDICMPS, /* LockDroppedIcmps */
+ LINUX_MIB_ARPFILTER, /* ArpFilter */
+ LINUX_MIB_TIMEWAITED, /* TimeWaited */
+ LINUX_MIB_TIMEWAITRECYCLED, /* TimeWaitRecycled */
+ LINUX_MIB_TIMEWAITKILLED, /* TimeWaitKilled */
+ LINUX_MIB_PAWSPASSIVEREJECTED, /* PAWSPassiveRejected */
+ LINUX_MIB_PAWSACTIVEREJECTED, /* PAWSActiveRejected */
+ LINUX_MIB_PAWSESTABREJECTED, /* PAWSEstabRejected */
+ LINUX_MIB_DELAYEDACKS, /* DelayedACKs */
+ LINUX_MIB_DELAYEDACKLOCKED, /* DelayedACKLocked */
+ LINUX_MIB_DELAYEDACKLOST, /* DelayedACKLost */
+ LINUX_MIB_LISTENOVERFLOWS, /* ListenOverflows */
+ LINUX_MIB_LISTENDROPS, /* ListenDrops */
+ LINUX_MIB_TCPPREQUEUED, /* TCPPrequeued */
+ LINUX_MIB_TCPDIRECTCOPYFROMBACKLOG, /* TCPDirectCopyFromBacklog */
+ LINUX_MIB_TCPDIRECTCOPYFROMPREQUEUE, /* TCPDirectCopyFromPrequeue */
+ LINUX_MIB_TCPPREQUEUEDROPPED, /* TCPPrequeueDropped */
+ LINUX_MIB_TCPHPHITS, /* TCPHPHits */
+ LINUX_MIB_TCPHPHITSTOUSER, /* TCPHPHitsToUser */
+ LINUX_MIB_TCPPUREACKS, /* TCPPureAcks */
+ LINUX_MIB_TCPHPACKS, /* TCPHPAcks */
+ LINUX_MIB_TCPRENORECOVERY, /* TCPRenoRecovery */
+ LINUX_MIB_TCPSACKRECOVERY, /* TCPSackRecovery */
+ LINUX_MIB_TCPSACKRENEGING, /* TCPSACKReneging */
+ LINUX_MIB_TCPFACKREORDER, /* TCPFACKReorder */
+ LINUX_MIB_TCPSACKREORDER, /* TCPSACKReorder */
+ LINUX_MIB_TCPRENOREORDER, /* TCPRenoReorder */
+ LINUX_MIB_TCPTSREORDER, /* TCPTSReorder */
+ LINUX_MIB_TCPFULLUNDO, /* TCPFullUndo */
+ LINUX_MIB_TCPPARTIALUNDO, /* TCPPartialUndo */
+ LINUX_MIB_TCPDSACKUNDO, /* TCPDSACKUndo */
+ LINUX_MIB_TCPLOSSUNDO, /* TCPLossUndo */
+ LINUX_MIB_TCPLOSS, /* TCPLoss */
+ LINUX_MIB_TCPLOSTRETRANSMIT, /* TCPLostRetransmit */
+ LINUX_MIB_TCPRENOFAILURES, /* TCPRenoFailures */
+ LINUX_MIB_TCPSACKFAILURES, /* TCPSackFailures */
+ LINUX_MIB_TCPLOSSFAILURES, /* TCPLossFailures */
+ LINUX_MIB_TCPFASTRETRANS, /* TCPFastRetrans */
+ LINUX_MIB_TCPFORWARDRETRANS, /* TCPForwardRetrans */
+ LINUX_MIB_TCPSLOWSTARTRETRANS, /* TCPSlowStartRetrans */
+ LINUX_MIB_TCPTIMEOUTS, /* TCPTimeouts */
+ LINUX_MIB_TCPRENORECOVERYFAIL, /* TCPRenoRecoveryFail */
+ LINUX_MIB_TCPSACKRECOVERYFAIL, /* TCPSackRecoveryFail */
+ LINUX_MIB_TCPSCHEDULERFAILED, /* TCPSchedulerFailed */
+ LINUX_MIB_TCPRCVCOLLAPSED, /* TCPRcvCollapsed */
+ LINUX_MIB_TCPDSACKOLDSENT, /* TCPDSACKOldSent */
+ LINUX_MIB_TCPDSACKOFOSENT, /* TCPDSACKOfoSent */
+ LINUX_MIB_TCPDSACKRECV, /* TCPDSACKRecv */
+ LINUX_MIB_TCPDSACKOFORECV, /* TCPDSACKOfoRecv */
+ LINUX_MIB_TCPABORTONSYN, /* TCPAbortOnSyn */
+ LINUX_MIB_TCPABORTONDATA, /* TCPAbortOnData */
+ LINUX_MIB_TCPABORTONCLOSE, /* TCPAbortOnClose */
+ LINUX_MIB_TCPABORTONMEMORY, /* TCPAbortOnMemory */
+ LINUX_MIB_TCPABORTONTIMEOUT, /* TCPAbortOnTimeout */
+ LINUX_MIB_TCPABORTONLINGER, /* TCPAbortOnLinger */
+ LINUX_MIB_TCPABORTFAILED, /* TCPAbortFailed */
+ LINUX_MIB_TCPMEMORYPRESSURES, /* TCPMemoryPressures */
+ LINUX_MIB_TCPSACKDISCARD, /* TCPSACKDiscard */
+ LINUX_MIB_TCPDSACKIGNOREDOLD, /* TCPSACKIgnoredOld */
+ LINUX_MIB_TCPDSACKIGNOREDNOUNDO, /* TCPSACKIgnoredNoUndo */
+ LINUX_MIB_TCPSPURIOUSRTOS, /* TCPSpuriousRTOs */
+ LINUX_MIB_TCPMD5NOTFOUND, /* TCPMD5NotFound */
+ LINUX_MIB_TCPMD5UNEXPECTED, /* TCPMD5Unexpected */
+ LINUX_MIB_SACKSHIFTED,
+ LINUX_MIB_SACKMERGED,
+ LINUX_MIB_SACKSHIFTFALLBACK,
+ __LINUX_MIB_MAX
+};
+
+/* linux Xfrm mib definitions */
+enum
+{
+ LINUX_MIB_XFRMNUM = 0,
+ LINUX_MIB_XFRMINERROR, /* XfrmInError */
+ LINUX_MIB_XFRMINBUFFERERROR, /* XfrmInBufferError */
+ LINUX_MIB_XFRMINHDRERROR, /* XfrmInHdrError */
+ LINUX_MIB_XFRMINNOSTATES, /* XfrmInNoStates */
+ LINUX_MIB_XFRMINSTATEPROTOERROR, /* XfrmInStateProtoError */
+ LINUX_MIB_XFRMINSTATEMODEERROR, /* XfrmInStateModeError */
+ LINUX_MIB_XFRMINSTATESEQERROR, /* XfrmInStateSeqError */
+ LINUX_MIB_XFRMINSTATEEXPIRED, /* XfrmInStateExpired */
+ LINUX_MIB_XFRMINSTATEMISMATCH, /* XfrmInStateMismatch */
+ LINUX_MIB_XFRMINSTATEINVALID, /* XfrmInStateInvalid */
+ LINUX_MIB_XFRMINTMPLMISMATCH, /* XfrmInTmplMismatch */
+ LINUX_MIB_XFRMINNOPOLS, /* XfrmInNoPols */
+ LINUX_MIB_XFRMINPOLBLOCK, /* XfrmInPolBlock */
+ LINUX_MIB_XFRMINPOLERROR, /* XfrmInPolError */
+ LINUX_MIB_XFRMOUTERROR, /* XfrmOutError */
+ LINUX_MIB_XFRMOUTBUNDLEGENERROR, /* XfrmOutBundleGenError */
+ LINUX_MIB_XFRMOUTBUNDLECHECKERROR, /* XfrmOutBundleCheckError */
+ LINUX_MIB_XFRMOUTNOSTATES, /* XfrmOutNoStates */
+ LINUX_MIB_XFRMOUTSTATEPROTOERROR, /* XfrmOutStateProtoError */
+ LINUX_MIB_XFRMOUTSTATEMODEERROR, /* XfrmOutStateModeError */
+ LINUX_MIB_XFRMOUTSTATESEQERROR, /* XfrmOutStateSeqError */
+ LINUX_MIB_XFRMOUTSTATEEXPIRED, /* XfrmOutStateExpired */
+ LINUX_MIB_XFRMOUTPOLBLOCK, /* XfrmOutPolBlock */
+ LINUX_MIB_XFRMOUTPOLDEAD, /* XfrmOutPolDead */
+ LINUX_MIB_XFRMOUTPOLERROR, /* XfrmOutPolError */
+ __LINUX_MIB_XFRMMAX
+};
+
+#endif /* _LINUX_SNMP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/socket.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/socket.h
new file mode 100644
index 0000000..038c98a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/socket.h
@@ -0,0 +1,303 @@
+#ifndef _LINUX_SOCKET_H
+#define _LINUX_SOCKET_H
+
+/*
+ * Desired design of maximum size and alignment (see RFC2553)
+ */
+#define _K_SS_MAXSIZE 128 /* Implementation specific max size */
+#define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *))
+ /* Implementation specific desired alignment */
+
+struct __kernel_sockaddr_storage {
+ unsigned short ss_family; /* address family */
+ /* Following field(s) are implementation specific */
+ char __data[_K_SS_MAXSIZE - sizeof(unsigned short)];
+ /* space to achieve desired size, */
+ /* _SS_MAXSIZE value minus size of ss_family */
+} __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */
+
+#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+
+#include <asm/socket.h> /* arch-dependent defines */
+#include <linux/sockios.h> /* the SIOCxxx I/O controls */
+#include <linux/uio.h> /* iovec support */
+#include <linux/types.h> /* pid_t */
+ /* */
+
+
+typedef unsigned short sa_family_t;
+
+/*
+ * 1003.1g requires sa_family_t and that sa_data is char.
+ */
+
+struct sockaddr {
+ sa_family_t sa_family; /* address family, AF_xxx */
+ char sa_data[14]; /* 14 bytes of protocol address */
+};
+
+struct linger {
+ int l_onoff; /* Linger active */
+ int l_linger; /* How long to linger for */
+};
+
+#define sockaddr_storage __kernel_sockaddr_storage
+
+/*
+ * As we do 4.4BSD message passing we use a 4.4BSD message passing
+ * system, not 4.3. Thus msg_accrights(len) are now missing. They
+ * belong in an obscure libc emulation or the bin.
+ */
+
+struct msghdr {
+ void * msg_name; /* Socket name */
+ int msg_namelen; /* Length of name */
+ struct iovec * msg_iov; /* Data blocks */
+ __kernel_size_t msg_iovlen; /* Number of blocks */
+ void * msg_control; /* Per protocol magic (eg BSD file descriptor passing) */
+ __kernel_size_t msg_controllen; /* Length of cmsg list */
+ unsigned msg_flags;
+};
+
+/*
+ * POSIX 1003.1g - ancillary data object information
+ * Ancillary data consits of a sequence of pairs of
+ * (cmsghdr, cmsg_data[])
+ */
+
+struct cmsghdr {
+ __kernel_size_t cmsg_len; /* data byte count, including hdr */
+ int cmsg_level; /* originating protocol */
+ int cmsg_type; /* protocol-specific type */
+};
+
+/*
+ * Ancilliary data object information MACROS
+ * Table 5-14 of POSIX 1003.1g
+ */
+
+#define __CMSG_NXTHDR(ctl, len, cmsg) __cmsg_nxthdr((ctl),(len),(cmsg))
+#define CMSG_NXTHDR(mhdr, cmsg) cmsg_nxthdr((mhdr), (cmsg))
+
+#define CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) )
+
+#define CMSG_DATA(cmsg) ((void *)((char *)(cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))))
+#define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len))
+#define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
+
+#define __CMSG_FIRSTHDR(ctl,len) ((len) >= sizeof(struct cmsghdr) ? \
+ (struct cmsghdr *)(ctl) : \
+ (struct cmsghdr *)NULL)
+#define CMSG_FIRSTHDR(msg) __CMSG_FIRSTHDR((msg)->msg_control, (msg)->msg_controllen)
+#define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) && \
+ (cmsg)->cmsg_len <= (unsigned long) \
+ ((mhdr)->msg_controllen - \
+ ((char *)(cmsg) - (char *)(mhdr)->msg_control)))
+
+/*
+ * This mess will go away with glibc
+ */
+
+#if defined(__GNUC__)
+#define __KINLINE static __inline__
+#elif defined(__cplusplus)
+#define __KINLINE static __inline__
+#else
+#define __KINLINE static
+#endif
+
+
+/*
+ * Get the next cmsg header
+ *
+ * PLEASE, do not touch this function. If you think, that it is
+ * incorrect, grep kernel sources and think about consequences
+ * before trying to improve it.
+ *
+ * Now it always returns valid, not truncated ancillary object
+ * HEADER. But caller still MUST check, that cmsg->cmsg_len is
+ * inside range, given by msg->msg_controllen before using
+ * ancillary object DATA. --ANK (980731)
+ */
+
+__KINLINE struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size,
+ struct cmsghdr *__cmsg)
+{
+ struct cmsghdr * __ptr;
+
+ __ptr = (struct cmsghdr*)(((unsigned char *) __cmsg) + CMSG_ALIGN(__cmsg->cmsg_len));
+ if ((unsigned long)((char*)(__ptr+1) - (char *) __ctl) > __size)
+ return (struct cmsghdr *)0;
+
+ return __ptr;
+}
+
+__KINLINE struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__cmsg)
+{
+ return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg);
+}
+
+/* "Socket"-level control message types: */
+
+#define SCM_RIGHTS 0x01 /* rw: access rights (array of int) */
+#define SCM_CREDENTIALS 0x02 /* rw: struct ucred */
+#define SCM_SECURITY 0x03 /* rw: security label */
+
+struct ucred {
+ __u32 pid;
+ __u32 uid;
+ __u32 gid;
+};
+
+/* Supported address families. */
+#define AF_UNSPEC 0
+#define AF_UNIX 1 /* Unix domain sockets */
+#define AF_LOCAL 1 /* POSIX name for AF_UNIX */
+#define AF_INET 2 /* Internet IP Protocol */
+#define AF_AX25 3 /* Amateur Radio AX.25 */
+#define AF_IPX 4 /* Novell IPX */
+#define AF_APPLETALK 5 /* AppleTalk DDP */
+#define AF_NETROM 6 /* Amateur Radio NET/ROM */
+#define AF_BRIDGE 7 /* Multiprotocol bridge */
+#define AF_ATMPVC 8 /* ATM PVCs */
+#define AF_X25 9 /* Reserved for X.25 project */
+#define AF_INET6 10 /* IP version 6 */
+#define AF_ROSE 11 /* Amateur Radio X.25 PLP */
+#define AF_DECnet 12 /* Reserved for DECnet project */
+#define AF_NETBEUI 13 /* Reserved for 802.2LLC project*/
+#define AF_SECURITY 14 /* Security callback pseudo AF */
+#define AF_KEY 15 /* PF_KEY key management API */
+#define AF_NETLINK 16
+#define AF_ROUTE AF_NETLINK /* Alias to emulate 4.4BSD */
+#define AF_PACKET 17 /* Packet family */
+#define AF_ASH 18 /* Ash */
+#define AF_ECONET 19 /* Acorn Econet */
+#define AF_ATMSVC 20 /* ATM SVCs */
+#define AF_RDS 21 /* RDS sockets */
+#define AF_SNA 22 /* Linux SNA Project (nutters!) */
+#define AF_IRDA 23 /* IRDA sockets */
+#define AF_PPPOX 24 /* PPPoX sockets */
+#define AF_WANPIPE 25 /* Wanpipe API Sockets */
+#define AF_LLC 26 /* Linux LLC */
+#define AF_CAN 29 /* Controller Area Network */
+#define AF_TIPC 30 /* TIPC sockets */
+#define AF_BLUETOOTH 31 /* Bluetooth sockets */
+#define AF_IUCV 32 /* IUCV sockets */
+#define AF_RXRPC 33 /* RxRPC sockets */
+#define AF_ISDN 34 /* mISDN sockets */
+#define AF_PHONET 35 /* Phonet sockets */
+#define AF_MAX 36 /* For now.. */
+
+/* Protocol families, same as address families. */
+#define PF_UNSPEC AF_UNSPEC
+#define PF_UNIX AF_UNIX
+#define PF_LOCAL AF_LOCAL
+#define PF_INET AF_INET
+#define PF_AX25 AF_AX25
+#define PF_IPX AF_IPX
+#define PF_APPLETALK AF_APPLETALK
+#define PF_NETROM AF_NETROM
+#define PF_BRIDGE AF_BRIDGE
+#define PF_ATMPVC AF_ATMPVC
+#define PF_X25 AF_X25
+#define PF_INET6 AF_INET6
+#define PF_ROSE AF_ROSE
+#define PF_DECnet AF_DECnet
+#define PF_NETBEUI AF_NETBEUI
+#define PF_SECURITY AF_SECURITY
+#define PF_KEY AF_KEY
+#define PF_NETLINK AF_NETLINK
+#define PF_ROUTE AF_ROUTE
+#define PF_PACKET AF_PACKET
+#define PF_ASH AF_ASH
+#define PF_ECONET AF_ECONET
+#define PF_ATMSVC AF_ATMSVC
+#define PF_RDS AF_RDS
+#define PF_SNA AF_SNA
+#define PF_IRDA AF_IRDA
+#define PF_PPPOX AF_PPPOX
+#define PF_WANPIPE AF_WANPIPE
+#define PF_LLC AF_LLC
+#define PF_CAN AF_CAN
+#define PF_TIPC AF_TIPC
+#define PF_BLUETOOTH AF_BLUETOOTH
+#define PF_IUCV AF_IUCV
+#define PF_RXRPC AF_RXRPC
+#define PF_ISDN AF_ISDN
+#define PF_PHONET AF_PHONET
+#define PF_MAX AF_MAX
+
+/* Maximum queue length specifiable by listen. */
+#define SOMAXCONN 128
+
+/* Flags we can use with send/ and recv.
+ Added those for 1003.1g not all are supported yet
+ */
+
+#define MSG_OOB 1
+#define MSG_PEEK 2
+#define MSG_DONTROUTE 4
+#define MSG_TRYHARD 4 /* Synonym for MSG_DONTROUTE for DECnet */
+#define MSG_CTRUNC 8
+#define MSG_PROBE 0x10 /* Do not send. Only probe path f.e. for MTU */
+#define MSG_TRUNC 0x20
+#define MSG_DONTWAIT 0x40 /* Nonblocking io */
+#define MSG_EOR 0x80 /* End of record */
+#define MSG_WAITALL 0x100 /* Wait for a full request */
+#define MSG_FIN 0x200
+#define MSG_SYN 0x400
+#define MSG_CONFIRM 0x800 /* Confirm path validity */
+#define MSG_RST 0x1000
+#define MSG_ERRQUEUE 0x2000 /* Fetch message from error queue */
+#define MSG_NOSIGNAL 0x4000 /* Do not generate SIGPIPE */
+#define MSG_MORE 0x8000 /* Sender will send more */
+
+#define MSG_EOF MSG_FIN
+
+#define MSG_CMSG_CLOEXEC 0x40000000 /* Set close_on_exit for file
+ descriptor received through
+ SCM_RIGHTS */
+#if defined(CONFIG_COMPAT)
+#define MSG_CMSG_COMPAT 0x80000000 /* This message needs 32 bit fixups */
+#else
+#define MSG_CMSG_COMPAT 0 /* We never have 32 bit fixups */
+#endif
+
+
+/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
+#define SOL_IP 0
+/* #define SOL_ICMP 1 No-no-no! Due to Linux :-) we cannot use SOL_ICMP=1 */
+#define SOL_TCP 6
+#define SOL_UDP 17
+#define SOL_IPV6 41
+#define SOL_ICMPV6 58
+#define SOL_SCTP 132
+#define SOL_UDPLITE 136 /* UDP-Lite (RFC 3828) */
+#define SOL_RAW 255
+#define SOL_IPX 256
+#define SOL_AX25 257
+#define SOL_ATALK 258
+#define SOL_NETROM 259
+#define SOL_ROSE 260
+#define SOL_DECNET 261
+#define SOL_X25 262
+#define SOL_PACKET 263
+#define SOL_ATM 264 /* ATM layer (cell level) */
+#define SOL_AAL 265 /* ATM Adaption Layer (packet level) */
+#define SOL_IRDA 266
+#define SOL_NETBEUI 267
+#define SOL_LLC 268
+#define SOL_DCCP 269
+#define SOL_NETLINK 270
+#define SOL_TIPC 271
+#define SOL_RXRPC 272
+#define SOL_PPPOL2TP 273
+#define SOL_BLUETOOTH 274
+#define SOL_PNPIPE 275
+#define SOL_RDS 276
+
+/* IPX options */
+#define IPX_TYPE 1
+
+#endif /* not kernel and not glibc */
+#endif /* _LINUX_SOCKET_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sockios.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sockios.h
new file mode 100644
index 0000000..241f179
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sockios.h
@@ -0,0 +1,146 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Definitions of the socket-level I/O control calls.
+ *
+ * Version: @(#)sockios.h 1.0.2 03/09/93
+ *
+ * Authors: Ross Biro
+ * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_SOCKIOS_H
+#define _LINUX_SOCKIOS_H
+
+#include <asm/sockios.h>
+
+/* Linux-specific socket ioctls */
+#define SIOCINQ FIONREAD
+#define SIOCOUTQ TIOCOUTQ
+
+/* Routing table calls. */
+#define SIOCADDRT 0x890B /* add routing table entry */
+#define SIOCDELRT 0x890C /* delete routing table entry */
+#define SIOCRTMSG 0x890D /* call to routing system */
+
+/* Socket configuration controls. */
+#define SIOCGIFNAME 0x8910 /* get iface name */
+#define SIOCSIFLINK 0x8911 /* set iface channel */
+#define SIOCGIFCONF 0x8912 /* get iface list */
+#define SIOCGIFFLAGS 0x8913 /* get flags */
+#define SIOCSIFFLAGS 0x8914 /* set flags */
+#define SIOCGIFADDR 0x8915 /* get PA address */
+#define SIOCSIFADDR 0x8916 /* set PA address */
+#define SIOCGIFDSTADDR 0x8917 /* get remote PA address */
+#define SIOCSIFDSTADDR 0x8918 /* set remote PA address */
+#define SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */
+#define SIOCSIFBRDADDR 0x891a /* set broadcast PA address */
+#define SIOCGIFNETMASK 0x891b /* get network PA mask */
+#define SIOCSIFNETMASK 0x891c /* set network PA mask */
+#define SIOCGIFMETRIC 0x891d /* get metric */
+#define SIOCSIFMETRIC 0x891e /* set metric */
+#define SIOCGIFMEM 0x891f /* get memory address (BSD) */
+#define SIOCSIFMEM 0x8920 /* set memory address (BSD) */
+#define SIOCGIFMTU 0x8921 /* get MTU size */
+#define SIOCSIFMTU 0x8922 /* set MTU size */
+#define SIOCSIFNAME 0x8923 /* set interface name */
+#define SIOCSIFHWADDR 0x8924 /* set hardware address */
+#define SIOCGIFENCAP 0x8925 /* get/set encapsulations */
+#define SIOCSIFENCAP 0x8926
+#define SIOCGIFHWADDR 0x8927 /* Get hardware address */
+#define SIOCGIFSLAVE 0x8929 /* Driver slaving support */
+#define SIOCSIFSLAVE 0x8930
+#define SIOCADDMULTI 0x8931 /* Multicast address lists */
+#define SIOCDELMULTI 0x8932
+#define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */
+#define SIOGIFINDEX SIOCGIFINDEX /* misprint compatibility :-) */
+#define SIOCSIFPFLAGS 0x8934 /* set/get extended flags set */
+#define SIOCGIFPFLAGS 0x8935
+#define SIOCDIFADDR 0x8936 /* delete PA address */
+#define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */
+#define SIOCGIFCOUNT 0x8938 /* get number of devices */
+
+#define SIOCGIFBR 0x8940 /* Bridging support */
+#define SIOCSIFBR 0x8941 /* Set bridging options */
+
+#define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */
+#define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */
+
+/* SIOCGIFDIVERT was: 0x8944 Frame diversion support */
+/* SIOCSIFDIVERT was: 0x8945 Set frame diversion options */
+
+#define SIOCETHTOOL 0x8946 /* Ethtool interface */
+
+#define SIOCGMIIPHY 0x8947 /* Get address of MII PHY in use. */
+#define SIOCGMIIREG 0x8948 /* Read MII PHY register. */
+#define SIOCSMIIREG 0x8949 /* Write MII PHY register. */
+
+#define SIOCWANDEV 0x894A /* get/set netdev parameters */
+
+/* ARP cache control calls. */
+ /* 0x8950 - 0x8952 * obsolete calls, don't re-use */
+#define SIOCDARP 0x8953 /* delete ARP table entry */
+#define SIOCGARP 0x8954 /* get ARP table entry */
+#define SIOCSARP 0x8955 /* set ARP table entry */
+
+/* RARP cache control calls. */
+#define SIOCDRARP 0x8960 /* delete RARP table entry */
+#define SIOCGRARP 0x8961 /* get RARP table entry */
+#define SIOCSRARP 0x8962 /* set RARP table entry */
+
+/* Driver configuration calls */
+
+#define SIOCGIFMAP 0x8970 /* Get device parameters */
+#define SIOCSIFMAP 0x8971 /* Set device parameters */
+
+/* DLCI configuration calls */
+
+#define SIOCADDDLCI 0x8980 /* Create new DLCI device */
+#define SIOCDELDLCI 0x8981 /* Delete DLCI device */
+
+#define SIOCGIFVLAN 0x8982 /* 802.1Q VLAN support */
+#define SIOCSIFVLAN 0x8983 /* Set 802.1Q VLAN options */
+
+/* bonding calls */
+
+#define SIOCBONDENSLAVE 0x8990 /* enslave a device to the bond */
+#define SIOCBONDRELEASE 0x8991 /* release a slave from the bond*/
+#define SIOCBONDSETHWADDR 0x8992 /* set the hw addr of the bond */
+#define SIOCBONDSLAVEINFOQUERY 0x8993 /* rtn info about slave state */
+#define SIOCBONDINFOQUERY 0x8994 /* rtn info about bond state */
+#define SIOCBONDCHANGEACTIVE 0x8995 /* update to a new active slave */
+
+/* bridge calls */
+#define SIOCBRADDBR 0x89a0 /* create new bridge device */
+#define SIOCBRDELBR 0x89a1 /* remove bridge device */
+#define SIOCBRADDIF 0x89a2 /* add interface to bridge */
+#define SIOCBRDELIF 0x89a3 /* remove interface from bridge */
+
+/* hardware time stamping: parameters in linux/net_tstamp.h */
+#define SIOCSHWTSTAMP 0x89b0
+
+/* Device private ioctl calls */
+
+/*
+ * These 16 ioctls are available to devices via the do_ioctl() device
+ * vector. Each device should include this file and redefine these names
+ * as their own. Because these are device dependent it is a good idea
+ * _NOT_ to issue them to random objects and hope.
+ *
+ * THESE IOCTLS ARE _DEPRECATED_ AND WILL DISAPPEAR IN 2.5.X -DaveM
+ */
+
+#define SIOCDEVPRIVATE 0x89F0 /* to 89FF */
+
+/*
+ * These 16 ioctl calls are protocol private
+ */
+
+#define SIOCPROTOPRIVATE 0x89E0 /* to 89EF */
+#endif /* _LINUX_SOCKIOS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/som.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/som.h
new file mode 100644
index 0000000..166594e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/som.h
@@ -0,0 +1,154 @@
+#ifndef _LINUX_SOM_H
+#define _LINUX_SOM_H
+
+/* File format definition for SOM executables / shared libraries */
+
+/* we need struct timespec */
+#include <linux/time.h>
+
+#define SOM_PAGESIZE 4096
+
+/* this is the SOM header */
+struct som_hdr {
+ short system_id; /* magic number - system */
+ short a_magic; /* magic number - file type */
+ unsigned int version_id; /* versiod ID: YYMMDDHH */
+ struct timespec file_time; /* system clock */
+ unsigned int entry_space; /* space for entry point */
+ unsigned int entry_subspace; /* subspace for entry point */
+ unsigned int entry_offset; /* offset of entry point */
+ unsigned int aux_header_location; /* auxiliary header location */
+ unsigned int aux_header_size; /* auxiliary header size */
+ unsigned int som_length; /* length of entire SOM */
+ unsigned int presumed_dp; /* compiler's DP value */
+ unsigned int space_location; /* space dictionary location */
+ unsigned int space_total; /* number of space entries */
+ unsigned int subspace_location; /* subspace entries location */
+ unsigned int subspace_total; /* number of subspace entries */
+ unsigned int loader_fixup_location; /* MPE/iX loader fixup */
+ unsigned int loader_fixup_total; /* number of fixup records */
+ unsigned int space_strings_location; /* (sub)space names */
+ unsigned int space_strings_size; /* size of strings area */
+ unsigned int init_array_location; /* reserved */
+ unsigned int init_array_total; /* reserved */
+ unsigned int compiler_location; /* module dictionary */
+ unsigned int compiler_total; /* number of modules */
+ unsigned int symbol_location; /* symbol dictionary */
+ unsigned int symbol_total; /* number of symbols */
+ unsigned int fixup_request_location; /* fixup requests */
+ unsigned int fixup_request_total; /* number of fixup requests */
+ unsigned int symbol_strings_location;/* module & symbol names area */
+ unsigned int symbol_strings_size; /* size of strings area */
+ unsigned int unloadable_sp_location; /* unloadable spaces location */
+ unsigned int unloadable_sp_size; /* size of data */
+ unsigned int checksum;
+};
+
+/* values for system_id */
+
+#define SOM_SID_PARISC_1_0 0x020b
+#define SOM_SID_PARISC_1_1 0x0210
+#define SOM_SID_PARISC_2_0 0x0214
+
+/* values for a_magic */
+
+#define SOM_LIB_EXEC 0x0104
+#define SOM_RELOCATABLE 0x0106
+#define SOM_EXEC_NONSHARE 0x0107
+#define SOM_EXEC_SHARE 0x0108
+#define SOM_EXEC_DEMAND 0x010B
+#define SOM_LIB_DYN 0x010D
+#define SOM_LIB_SHARE 0x010E
+#define SOM_LIB_RELOC 0x0619
+
+/* values for version_id. Decimal not hex, yes. Grr. */
+
+#define SOM_ID_OLD 85082112
+#define SOM_ID_NEW 87102412
+
+struct aux_id {
+ unsigned int mandatory :1; /* the linker must understand this */
+ unsigned int copy :1; /* Must be copied by the linker */
+ unsigned int append :1; /* Must be merged by the linker */
+ unsigned int ignore :1; /* Discard section if unknown */
+ unsigned int reserved :12;
+ unsigned int type :16; /* Header type */
+ unsigned int length; /* length of _following_ data */
+};
+
+/* The Exec Auxiliary Header. Called The HP-UX Header within HP apparently. */
+struct som_exec_auxhdr {
+ struct aux_id som_auxhdr;
+ int exec_tsize; /* Text size in bytes */
+ int exec_tmem; /* Address to load text at */
+ int exec_tfile; /* Location of text in file */
+ int exec_dsize; /* Data size in bytes */
+ int exec_dmem; /* Address to load data at */
+ int exec_dfile; /* Location of data in file */
+ int exec_bsize; /* Uninitialised data (bss) */
+ int exec_entry; /* Address to start executing */
+ int exec_flags; /* loader flags */
+ int exec_bfill; /* initialisation value for bss */
+};
+
+/* Oh, the things people do to avoid casts. Shame it'll break with gcc's
+ * new aliasing rules really.
+ */
+union name_pt {
+ char * n_name;
+ unsigned int n_strx;
+};
+
+/* The Space Dictionary */
+struct space_dictionary_record {
+ union name_pt name; /* index to subspace name */
+ unsigned int is_loadable :1; /* loadable */
+ unsigned int is_defined :1; /* defined within file */
+ unsigned int is_private :1; /* not sharable */
+ unsigned int has_intermediate_code :1; /* contains intermediate code */
+ unsigned int is_tspecific :1; /* thread specific */
+ unsigned int reserved :11; /* for future expansion */
+ unsigned int sort_key :8; /* for linker */
+ unsigned int reserved2 :8; /* for future expansion */
+
+ int space_number; /* index */
+ int subspace_index; /* index into subspace dict */
+ unsigned int subspace_quantity; /* number of subspaces */
+ int loader_fix_index; /* for loader */
+ unsigned int loader_fix_quantity; /* for loader */
+ int init_pointer_index; /* data pointer array index */
+ unsigned int init_pointer_quantity; /* number of data pointers */
+};
+
+/* The Subspace Dictionary */
+struct subspace_dictionary_record {
+ int space_index;
+ unsigned int access_control_bits :7;
+ unsigned int memory_resident :1;
+ unsigned int dup_common :1;
+ unsigned int is_common :1;
+ unsigned int quadrant :2;
+ unsigned int initially_frozen :1;
+ unsigned int is_first :1;
+ unsigned int code_only :1;
+ unsigned int sort_key :8;
+ unsigned int replicate_init :1;
+ unsigned int continuation :1;
+ unsigned int is_tspecific :1;
+ unsigned int is_comdat :1;
+ unsigned int reserved :4;
+
+ int file_loc_init_value;
+ unsigned int initialization_length;
+ unsigned int subspace_start;
+ unsigned int subspace_length;
+
+ unsigned int reserved2 :5;
+ unsigned int alignment :27;
+
+ union name_pt name;
+ int fixup_request_index;
+ unsigned int fixup_request_quantity;
+};
+
+#endif /* _LINUX_SOM_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sonet.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sonet.h
new file mode 100644
index 0000000..cd68293
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sonet.h
@@ -0,0 +1,60 @@
+/* sonet.h - SONET/SHD physical layer control */
+
+/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
+
+
+#ifndef LINUX_SONET_H
+#define LINUX_SONET_H
+
+#define __SONET_ITEMS \
+ __HANDLE_ITEM(section_bip); /* section parity errors (B1) */ \
+ __HANDLE_ITEM(line_bip); /* line parity errors (B2) */ \
+ __HANDLE_ITEM(path_bip); /* path parity errors (B3) */ \
+ __HANDLE_ITEM(line_febe); /* line parity errors at remote */ \
+ __HANDLE_ITEM(path_febe); /* path parity errors at remote */ \
+ __HANDLE_ITEM(corr_hcs); /* correctable header errors */ \
+ __HANDLE_ITEM(uncorr_hcs); /* uncorrectable header errors */ \
+ __HANDLE_ITEM(tx_cells); /* cells sent */ \
+ __HANDLE_ITEM(rx_cells); /* cells received */
+
+struct sonet_stats {
+#define __HANDLE_ITEM(i) int i
+ __SONET_ITEMS
+#undef __HANDLE_ITEM
+} __attribute__ ((packed));
+
+
+#define SONET_GETSTAT _IOR('a',ATMIOC_PHYTYP,struct sonet_stats)
+ /* get statistics */
+#define SONET_GETSTATZ _IOR('a',ATMIOC_PHYTYP+1,struct sonet_stats)
+ /* ... and zero counters */
+#define SONET_SETDIAG _IOWR('a',ATMIOC_PHYTYP+2,int)
+ /* set error insertion */
+#define SONET_CLRDIAG _IOWR('a',ATMIOC_PHYTYP+3,int)
+ /* clear error insertion */
+#define SONET_GETDIAG _IOR('a',ATMIOC_PHYTYP+4,int)
+ /* query error insertion */
+#define SONET_SETFRAMING _IOW('a',ATMIOC_PHYTYP+5,int)
+ /* set framing mode (SONET/SDH) */
+#define SONET_GETFRAMING _IOR('a',ATMIOC_PHYTYP+6,int)
+ /* get framing mode */
+#define SONET_GETFRSENSE _IOR('a',ATMIOC_PHYTYP+7, \
+ unsigned char[SONET_FRSENSE_SIZE]) /* get framing sense information */
+
+#define SONET_INS_SBIP 1 /* section BIP */
+#define SONET_INS_LBIP 2 /* line BIP */
+#define SONET_INS_PBIP 4 /* path BIP */
+#define SONET_INS_FRAME 8 /* out of frame */
+#define SONET_INS_LOS 16 /* set line to zero */
+#define SONET_INS_LAIS 32 /* line alarm indication signal */
+#define SONET_INS_PAIS 64 /* path alarm indication signal */
+#define SONET_INS_HCS 128 /* insert HCS error */
+
+#define SONET_FRAME_SONET 0 /* SONET STS-3 framing */
+#define SONET_FRAME_SDH 1 /* SDH STM-1 framing */
+
+#define SONET_FRSENSE_SIZE 6 /* C1[3],H1[3] (0xff for unknown) */
+
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sonypi.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sonypi.h
new file mode 100644
index 0000000..a6f2c90
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sonypi.h
@@ -0,0 +1,143 @@
+/*
+ * Sony Programmable I/O Control Device driver for VAIO
+ *
+ * Copyright (C) 2001-2005 Stelian Pop <stelian@popies.net>
+ *
+ * Copyright (C) 2005 Narayanan R S <nars@kadamba.org>
+
+ * Copyright (C) 2001-2002 Alcôve <www.alcove.com>
+ *
+ * Copyright (C) 2001 Michael Ashley <m.ashley@unsw.edu.au>
+ *
+ * Copyright (C) 2001 Junichi Morita <jun1m@mars.dti.ne.jp>
+ *
+ * Copyright (C) 2000 Takaya Kinjo <t-kinjo@tc4.so-net.ne.jp>
+ *
+ * Copyright (C) 2000 Andrew Tridgell <tridge@valinux.com>
+ *
+ * Earlier work by Werner Almesberger, Paul `Rusty' Russell and Paul Mackerras.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#ifndef _SONYPI_H_
+#define _SONYPI_H_
+
+#include <linux/types.h>
+
+/* events the user application reading /dev/sonypi can use */
+
+#define SONYPI_EVENT_JOGDIAL_DOWN 1
+#define SONYPI_EVENT_JOGDIAL_UP 2
+#define SONYPI_EVENT_JOGDIAL_DOWN_PRESSED 3
+#define SONYPI_EVENT_JOGDIAL_UP_PRESSED 4
+#define SONYPI_EVENT_JOGDIAL_PRESSED 5
+#define SONYPI_EVENT_JOGDIAL_RELEASED 6 /* obsolete */
+#define SONYPI_EVENT_CAPTURE_PRESSED 7
+#define SONYPI_EVENT_CAPTURE_RELEASED 8 /* obsolete */
+#define SONYPI_EVENT_CAPTURE_PARTIALPRESSED 9
+#define SONYPI_EVENT_CAPTURE_PARTIALRELEASED 10
+#define SONYPI_EVENT_FNKEY_ESC 11
+#define SONYPI_EVENT_FNKEY_F1 12
+#define SONYPI_EVENT_FNKEY_F2 13
+#define SONYPI_EVENT_FNKEY_F3 14
+#define SONYPI_EVENT_FNKEY_F4 15
+#define SONYPI_EVENT_FNKEY_F5 16
+#define SONYPI_EVENT_FNKEY_F6 17
+#define SONYPI_EVENT_FNKEY_F7 18
+#define SONYPI_EVENT_FNKEY_F8 19
+#define SONYPI_EVENT_FNKEY_F9 20
+#define SONYPI_EVENT_FNKEY_F10 21
+#define SONYPI_EVENT_FNKEY_F11 22
+#define SONYPI_EVENT_FNKEY_F12 23
+#define SONYPI_EVENT_FNKEY_1 24
+#define SONYPI_EVENT_FNKEY_2 25
+#define SONYPI_EVENT_FNKEY_D 26
+#define SONYPI_EVENT_FNKEY_E 27
+#define SONYPI_EVENT_FNKEY_F 28
+#define SONYPI_EVENT_FNKEY_S 29
+#define SONYPI_EVENT_FNKEY_B 30
+#define SONYPI_EVENT_BLUETOOTH_PRESSED 31
+#define SONYPI_EVENT_PKEY_P1 32
+#define SONYPI_EVENT_PKEY_P2 33
+#define SONYPI_EVENT_PKEY_P3 34
+#define SONYPI_EVENT_BACK_PRESSED 35
+#define SONYPI_EVENT_LID_CLOSED 36
+#define SONYPI_EVENT_LID_OPENED 37
+#define SONYPI_EVENT_BLUETOOTH_ON 38
+#define SONYPI_EVENT_BLUETOOTH_OFF 39
+#define SONYPI_EVENT_HELP_PRESSED 40
+#define SONYPI_EVENT_FNKEY_ONLY 41
+#define SONYPI_EVENT_JOGDIAL_FAST_DOWN 42
+#define SONYPI_EVENT_JOGDIAL_FAST_UP 43
+#define SONYPI_EVENT_JOGDIAL_FAST_DOWN_PRESSED 44
+#define SONYPI_EVENT_JOGDIAL_FAST_UP_PRESSED 45
+#define SONYPI_EVENT_JOGDIAL_VFAST_DOWN 46
+#define SONYPI_EVENT_JOGDIAL_VFAST_UP 47
+#define SONYPI_EVENT_JOGDIAL_VFAST_DOWN_PRESSED 48
+#define SONYPI_EVENT_JOGDIAL_VFAST_UP_PRESSED 49
+#define SONYPI_EVENT_ZOOM_PRESSED 50
+#define SONYPI_EVENT_THUMBPHRASE_PRESSED 51
+#define SONYPI_EVENT_MEYE_FACE 52
+#define SONYPI_EVENT_MEYE_OPPOSITE 53
+#define SONYPI_EVENT_MEMORYSTICK_INSERT 54
+#define SONYPI_EVENT_MEMORYSTICK_EJECT 55
+#define SONYPI_EVENT_ANYBUTTON_RELEASED 56
+#define SONYPI_EVENT_BATTERY_INSERT 57
+#define SONYPI_EVENT_BATTERY_REMOVE 58
+#define SONYPI_EVENT_FNKEY_RELEASED 59
+#define SONYPI_EVENT_WIRELESS_ON 60
+#define SONYPI_EVENT_WIRELESS_OFF 61
+#define SONYPI_EVENT_ZOOM_IN_PRESSED 62
+#define SONYPI_EVENT_ZOOM_OUT_PRESSED 63
+#define SONYPI_EVENT_CD_EJECT_PRESSED 64
+#define SONYPI_EVENT_MODEKEY_PRESSED 65
+#define SONYPI_EVENT_PKEY_P4 66
+#define SONYPI_EVENT_PKEY_P5 67
+#define SONYPI_EVENT_SETTINGKEY_PRESSED 68
+#define SONYPI_EVENT_VOLUME_INC_PRESSED 69
+#define SONYPI_EVENT_VOLUME_DEC_PRESSED 70
+#define SONYPI_EVENT_BRIGHTNESS_PRESSED 71
+
+/* get/set brightness */
+#define SONYPI_IOCGBRT _IOR('v', 0, __u8)
+#define SONYPI_IOCSBRT _IOW('v', 0, __u8)
+
+/* get battery full capacity/remaining capacity */
+#define SONYPI_IOCGBAT1CAP _IOR('v', 2, __u16)
+#define SONYPI_IOCGBAT1REM _IOR('v', 3, __u16)
+#define SONYPI_IOCGBAT2CAP _IOR('v', 4, __u16)
+#define SONYPI_IOCGBAT2REM _IOR('v', 5, __u16)
+
+/* get battery flags: battery1/battery2/ac adapter present */
+#define SONYPI_BFLAGS_B1 0x01
+#define SONYPI_BFLAGS_B2 0x02
+#define SONYPI_BFLAGS_AC 0x04
+#define SONYPI_IOCGBATFLAGS _IOR('v', 7, __u8)
+
+/* get/set bluetooth subsystem state on/off */
+#define SONYPI_IOCGBLUE _IOR('v', 8, __u8)
+#define SONYPI_IOCSBLUE _IOW('v', 9, __u8)
+
+/* get/set fan state on/off */
+#define SONYPI_IOCGFAN _IOR('v', 10, __u8)
+#define SONYPI_IOCSFAN _IOW('v', 11, __u8)
+
+/* get temperature (C) */
+#define SONYPI_IOCGTEMP _IOR('v', 12, __u8)
+
+
+#endif /* _SONYPI_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sound.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sound.h
new file mode 100644
index 0000000..fdd842e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sound.h
@@ -0,0 +1,27 @@
+
+/*
+ * Minor numbers for the sound driver.
+ */
+
+#include <linux/fs.h>
+
+#define SND_DEV_CTL 0 /* Control port /dev/mixer */
+#define SND_DEV_SEQ 1 /* Sequencer output /dev/sequencer (FM
+ synthesizer and MIDI output) */
+#define SND_DEV_MIDIN 2 /* Raw midi access */
+#define SND_DEV_DSP 3 /* Digitized voice /dev/dsp */
+#define SND_DEV_AUDIO 4 /* Sparc compatible /dev/audio */
+#define SND_DEV_DSP16 5 /* Like /dev/dsp but 16 bits/sample */
+/* #define SND_DEV_STATUS 6 */ /* /dev/sndstat (obsolete) */
+#define SND_DEV_UNUSED 6
+#define SND_DEV_AWFM 7 /* Reserved */
+#define SND_DEV_SEQ2 8 /* /dev/sequencer, level 2 interface */
+/* #define SND_DEV_SNDPROC 9 */ /* /dev/sndproc for programmable devices (not used) */
+/* #define SND_DEV_DMMIDI 9 */
+#define SND_DEV_SYNTH 9 /* Raw synth access /dev/synth (same as /dev/dmfm) */
+#define SND_DEV_DMFM 10 /* Raw synth access /dev/dmfm */
+#define SND_DEV_UNKNOWN11 11
+#define SND_DEV_ADSP 12 /* Like /dev/dsp (obsolete) */
+#define SND_DEV_AMIDI 13 /* Like /dev/midi (obsolete) */
+#define SND_DEV_ADMMIDI 14 /* Like /dev/dmmidi (onsolete) */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/soundcard.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/soundcard.h
new file mode 100644
index 0000000..ba3dea7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/soundcard.h
@@ -0,0 +1,1278 @@
+#ifndef SOUNDCARD_H
+#define SOUNDCARD_H
+/*
+ * Copyright by Hannu Savolainen 1993-1997
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer. 2.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+/*
+ * OSS interface version. With versions earlier than 3.6 this value is
+ * an integer with value less than 361. In versions 3.6 and later
+ * it's a six digit hexadecimal value. For example value
+ * of 0x030600 represents OSS version 3.6.0.
+ * Use ioctl(fd, OSS_GETVERSION, &int) to get the version number of
+ * the currently active driver.
+ */
+#define SOUND_VERSION 0x030802
+#define OPEN_SOUND_SYSTEM
+
+/* In Linux we need to be prepared for cross compiling */
+#include <linux/ioctl.h>
+
+/* Endian macros. */
+# include <endian.h>
+
+/*
+ * Supported card ID numbers (Should be somewhere else?)
+ */
+
+#define SNDCARD_ADLIB 1
+#define SNDCARD_SB 2
+#define SNDCARD_PAS 3
+#define SNDCARD_GUS 4
+#define SNDCARD_MPU401 5
+#define SNDCARD_SB16 6
+#define SNDCARD_SB16MIDI 7
+#define SNDCARD_UART6850 8
+#define SNDCARD_GUS16 9
+#define SNDCARD_MSS 10
+#define SNDCARD_PSS 11
+#define SNDCARD_SSCAPE 12
+#define SNDCARD_PSS_MPU 13
+#define SNDCARD_PSS_MSS 14
+#define SNDCARD_SSCAPE_MSS 15
+#define SNDCARD_TRXPRO 16
+#define SNDCARD_TRXPRO_SB 17
+#define SNDCARD_TRXPRO_MPU 18
+#define SNDCARD_MAD16 19
+#define SNDCARD_MAD16_MPU 20
+#define SNDCARD_CS4232 21
+#define SNDCARD_CS4232_MPU 22
+#define SNDCARD_MAUI 23
+#define SNDCARD_PSEUDO_MSS 24
+#define SNDCARD_GUSPNP 25
+#define SNDCARD_UART401 26
+/* Sound card numbers 27 to N are reserved. Don't add more numbers here. */
+
+/***********************************
+ * IOCTL Commands for /dev/sequencer
+ */
+
+#ifndef _SIOWR
+#if defined(_IOWR) && (defined(_AIX) || (!defined(sun) && !defined(sparc) && !defined(__sparc__) && !defined(__INCioctlh) && !defined(__Lynx__)))
+/* Use already defined ioctl defines if they exist (except with Sun or Sparc) */
+#define SIOCPARM_MASK IOCPARM_MASK
+#define SIOC_VOID IOC_VOID
+#define SIOC_OUT IOC_OUT
+#define SIOC_IN IOC_IN
+#define SIOC_INOUT IOC_INOUT
+#define _SIOC_SIZE _IOC_SIZE
+#define _SIOC_DIR _IOC_DIR
+#define _SIOC_NONE _IOC_NONE
+#define _SIOC_READ _IOC_READ
+#define _SIOC_WRITE _IOC_WRITE
+#define _SIO _IO
+#define _SIOR _IOR
+#define _SIOW _IOW
+#define _SIOWR _IOWR
+#else
+
+/* Ioctl's have the command encoded in the lower word,
+ * and the size of any in or out parameters in the upper
+ * word. The high 2 bits of the upper word are used
+ * to encode the in/out status of the parameter; for now
+ * we restrict parameters to at most 8191 bytes.
+ */
+/* #define SIOCTYPE (0xff<<8) */
+#define SIOCPARM_MASK 0x1fff /* parameters must be < 8192 bytes */
+#define SIOC_VOID 0x00000000 /* no parameters */
+#define SIOC_OUT 0x20000000 /* copy out parameters */
+#define SIOC_IN 0x40000000 /* copy in parameters */
+#define SIOC_INOUT (SIOC_IN|SIOC_OUT)
+/* the 0x20000000 is so we can distinguish new ioctl's from old */
+#define _SIO(x,y) ((int)(SIOC_VOID|(x<<8)|y))
+#define _SIOR(x,y,t) ((int)(SIOC_OUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
+#define _SIOW(x,y,t) ((int)(SIOC_IN|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
+/* this should be _SIORW, but stdio got there first */
+#define _SIOWR(x,y,t) ((int)(SIOC_INOUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
+#define _SIOC_SIZE(x) ((x>>16)&SIOCPARM_MASK)
+#define _SIOC_DIR(x) (x & 0xf0000000)
+#define _SIOC_NONE SIOC_VOID
+#define _SIOC_READ SIOC_OUT
+#define _SIOC_WRITE SIOC_IN
+# endif /* _IOWR */
+#endif /* !_SIOWR */
+
+#define SNDCTL_SEQ_RESET _SIO ('Q', 0)
+#define SNDCTL_SEQ_SYNC _SIO ('Q', 1)
+#define SNDCTL_SYNTH_INFO _SIOWR('Q', 2, struct synth_info)
+#define SNDCTL_SEQ_CTRLRATE _SIOWR('Q', 3, int) /* Set/get timer resolution (HZ) */
+#define SNDCTL_SEQ_GETOUTCOUNT _SIOR ('Q', 4, int)
+#define SNDCTL_SEQ_GETINCOUNT _SIOR ('Q', 5, int)
+#define SNDCTL_SEQ_PERCMODE _SIOW ('Q', 6, int)
+#define SNDCTL_FM_LOAD_INSTR _SIOW ('Q', 7, struct sbi_instrument) /* Obsolete. Don't use!!!!!! */
+#define SNDCTL_SEQ_TESTMIDI _SIOW ('Q', 8, int)
+#define SNDCTL_SEQ_RESETSAMPLES _SIOW ('Q', 9, int)
+#define SNDCTL_SEQ_NRSYNTHS _SIOR ('Q',10, int)
+#define SNDCTL_SEQ_NRMIDIS _SIOR ('Q',11, int)
+#define SNDCTL_MIDI_INFO _SIOWR('Q',12, struct midi_info)
+#define SNDCTL_SEQ_THRESHOLD _SIOW ('Q',13, int)
+#define SNDCTL_SYNTH_MEMAVL _SIOWR('Q',14, int) /* in=dev#, out=memsize */
+#define SNDCTL_FM_4OP_ENABLE _SIOW ('Q',15, int) /* in=dev# */
+#define SNDCTL_SEQ_PANIC _SIO ('Q',17)
+#define SNDCTL_SEQ_OUTOFBAND _SIOW ('Q',18, struct seq_event_rec)
+#define SNDCTL_SEQ_GETTIME _SIOR ('Q',19, int)
+#define SNDCTL_SYNTH_ID _SIOWR('Q',20, struct synth_info)
+#define SNDCTL_SYNTH_CONTROL _SIOWR('Q',21, struct synth_control)
+#define SNDCTL_SYNTH_REMOVESAMPLE _SIOWR('Q',22, struct remove_sample)
+
+typedef struct synth_control
+{
+ int devno; /* Synthesizer # */
+ char data[4000]; /* Device spesific command/data record */
+}synth_control;
+
+typedef struct remove_sample
+{
+ int devno; /* Synthesizer # */
+ int bankno; /* MIDI bank # (0=General MIDI) */
+ int instrno; /* MIDI instrument number */
+} remove_sample;
+
+typedef struct seq_event_rec {
+ unsigned char arr[8];
+} seq_event_rec;
+
+#define SNDCTL_TMR_TIMEBASE _SIOWR('T', 1, int)
+#define SNDCTL_TMR_START _SIO ('T', 2)
+#define SNDCTL_TMR_STOP _SIO ('T', 3)
+#define SNDCTL_TMR_CONTINUE _SIO ('T', 4)
+#define SNDCTL_TMR_TEMPO _SIOWR('T', 5, int)
+#define SNDCTL_TMR_SOURCE _SIOWR('T', 6, int)
+# define TMR_INTERNAL 0x00000001
+# define TMR_EXTERNAL 0x00000002
+# define TMR_MODE_MIDI 0x00000010
+# define TMR_MODE_FSK 0x00000020
+# define TMR_MODE_CLS 0x00000040
+# define TMR_MODE_SMPTE 0x00000080
+#define SNDCTL_TMR_METRONOME _SIOW ('T', 7, int)
+#define SNDCTL_TMR_SELECT _SIOW ('T', 8, int)
+
+/*
+ * Some big endian/little endian handling macros
+ */
+
+#define _LINUX_PATCHKEY_H_INDIRECT
+#include <linux/patchkey.h>
+#undef _LINUX_PATCHKEY_H_INDIRECT
+
+#if defined(__BYTE_ORDER)
+# if __BYTE_ORDER == __BIG_ENDIAN
+# define AFMT_S16_NE AFMT_S16_BE
+# elif __BYTE_ORDER == __LITTLE_ENDIAN
+# define AFMT_S16_NE AFMT_S16_LE
+# else
+# error "could not determine byte order"
+# endif
+#endif
+
+/*
+ * Sample loading mechanism for internal synthesizers (/dev/sequencer)
+ * The following patch_info structure has been designed to support
+ * Gravis UltraSound. It tries to be universal format for uploading
+ * sample based patches but is probably too limited.
+ *
+ * (PBD) As Hannu guessed, the GUS structure is too limited for
+ * the WaveFront, but this is the right place for a constant definition.
+ */
+
+struct patch_info {
+ unsigned short key; /* Use WAVE_PATCH here */
+#define WAVE_PATCH _PATCHKEY(0x04)
+#define GUS_PATCH WAVE_PATCH
+#define WAVEFRONT_PATCH _PATCHKEY(0x06)
+
+ short device_no; /* Synthesizer number */
+ short instr_no; /* Midi pgm# */
+
+ unsigned int mode;
+/*
+ * The least significant byte has the same format than the GUS .PAT
+ * files
+ */
+#define WAVE_16_BITS 0x01 /* bit 0 = 8 or 16 bit wave data. */
+#define WAVE_UNSIGNED 0x02 /* bit 1 = Signed - Unsigned data. */
+#define WAVE_LOOPING 0x04 /* bit 2 = looping enabled-1. */
+#define WAVE_BIDIR_LOOP 0x08 /* bit 3 = Set is bidirectional looping. */
+#define WAVE_LOOP_BACK 0x10 /* bit 4 = Set is looping backward. */
+#define WAVE_SUSTAIN_ON 0x20 /* bit 5 = Turn sustaining on. (Env. pts. 3)*/
+#define WAVE_ENVELOPES 0x40 /* bit 6 = Enable envelopes - 1 */
+#define WAVE_FAST_RELEASE 0x80 /* bit 7 = Shut off immediately after note off */
+ /* (use the env_rate/env_offs fields). */
+/* Linux specific bits */
+#define WAVE_VIBRATO 0x00010000 /* The vibrato info is valid */
+#define WAVE_TREMOLO 0x00020000 /* The tremolo info is valid */
+#define WAVE_SCALE 0x00040000 /* The scaling info is valid */
+#define WAVE_FRACTIONS 0x00080000 /* Fraction information is valid */
+/* Reserved bits */
+#define WAVE_ROM 0x40000000 /* For future use */
+#define WAVE_MULAW 0x20000000 /* For future use */
+/* Other bits must be zeroed */
+
+ int len; /* Size of the wave data in bytes */
+ int loop_start, loop_end; /* Byte offsets from the beginning */
+
+/*
+ * The base_freq and base_note fields are used when computing the
+ * playback speed for a note. The base_note defines the tone frequency
+ * which is heard if the sample is played using the base_freq as the
+ * playback speed.
+ *
+ * The low_note and high_note fields define the minimum and maximum note
+ * frequencies for which this sample is valid. It is possible to define
+ * more than one samples for an instrument number at the same time. The
+ * low_note and high_note fields are used to select the most suitable one.
+ *
+ * The fields base_note, high_note and low_note should contain
+ * the note frequency multiplied by 1000. For example value for the
+ * middle A is 440*1000.
+ */
+
+ unsigned int base_freq;
+ unsigned int base_note;
+ unsigned int high_note;
+ unsigned int low_note;
+ int panning; /* -128=left, 127=right */
+ int detuning;
+
+/* New fields introduced in version 1.99.5 */
+
+ /* Envelope. Enabled by mode bit WAVE_ENVELOPES */
+ unsigned char env_rate[ 6 ]; /* GUS HW ramping rate */
+ unsigned char env_offset[ 6 ]; /* 255 == 100% */
+
+ /*
+ * The tremolo, vibrato and scale info are not supported yet.
+ * Enable by setting the mode bits WAVE_TREMOLO, WAVE_VIBRATO or
+ * WAVE_SCALE
+ */
+
+ unsigned char tremolo_sweep;
+ unsigned char tremolo_rate;
+ unsigned char tremolo_depth;
+
+ unsigned char vibrato_sweep;
+ unsigned char vibrato_rate;
+ unsigned char vibrato_depth;
+
+ int scale_frequency;
+ unsigned int scale_factor; /* from 0 to 2048 or 0 to 2 */
+
+ int volume;
+ int fractions;
+ int reserved1;
+ int spare[2];
+ char data[1]; /* The waveform data starts here */
+ };
+
+struct sysex_info {
+ short key; /* Use SYSEX_PATCH or MAUI_PATCH here */
+#define SYSEX_PATCH _PATCHKEY(0x05)
+#define MAUI_PATCH _PATCHKEY(0x06)
+ short device_no; /* Synthesizer number */
+ int len; /* Size of the sysex data in bytes */
+ unsigned char data[1]; /* Sysex data starts here */
+ };
+
+/*
+ * /dev/sequencer input events.
+ *
+ * The data written to the /dev/sequencer is a stream of events. Events
+ * are records of 4 or 8 bytes. The first byte defines the size.
+ * Any number of events can be written with a write call. There
+ * is a set of macros for sending these events. Use these macros if you
+ * want to maximize portability of your program.
+ *
+ * Events SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO. Are also input events.
+ * (All input events are currently 4 bytes long. Be prepared to support
+ * 8 byte events also. If you receive any event having first byte >= 128,
+ * it's a 8 byte event.
+ *
+ * The events are documented at the end of this file.
+ *
+ * Normal events (4 bytes)
+ * There is also a 8 byte version of most of the 4 byte events. The
+ * 8 byte one is recommended.
+ */
+#define SEQ_NOTEOFF 0
+#define SEQ_FMNOTEOFF SEQ_NOTEOFF /* Just old name */
+#define SEQ_NOTEON 1
+#define SEQ_FMNOTEON SEQ_NOTEON
+#define SEQ_WAIT TMR_WAIT_ABS
+#define SEQ_PGMCHANGE 3
+#define SEQ_FMPGMCHANGE SEQ_PGMCHANGE
+#define SEQ_SYNCTIMER TMR_START
+#define SEQ_MIDIPUTC 5
+#define SEQ_DRUMON 6 /*** OBSOLETE ***/
+#define SEQ_DRUMOFF 7 /*** OBSOLETE ***/
+#define SEQ_ECHO TMR_ECHO /* For synching programs with output */
+#define SEQ_AFTERTOUCH 9
+#define SEQ_CONTROLLER 10
+
+/*******************************************
+ * Midi controller numbers
+ *******************************************
+ * Controllers 0 to 31 (0x00 to 0x1f) and
+ * 32 to 63 (0x20 to 0x3f) are continuous
+ * controllers.
+ * In the MIDI 1.0 these controllers are sent using
+ * two messages. Controller numbers 0 to 31 are used
+ * to send the MSB and the controller numbers 32 to 63
+ * are for the LSB. Note that just 7 bits are used in MIDI bytes.
+ */
+
+#define CTL_BANK_SELECT 0x00
+#define CTL_MODWHEEL 0x01
+#define CTL_BREATH 0x02
+/* undefined 0x03 */
+#define CTL_FOOT 0x04
+#define CTL_PORTAMENTO_TIME 0x05
+#define CTL_DATA_ENTRY 0x06
+#define CTL_MAIN_VOLUME 0x07
+#define CTL_BALANCE 0x08
+/* undefined 0x09 */
+#define CTL_PAN 0x0a
+#define CTL_EXPRESSION 0x0b
+/* undefined 0x0c */
+/* undefined 0x0d */
+/* undefined 0x0e */
+/* undefined 0x0f */
+#define CTL_GENERAL_PURPOSE1 0x10
+#define CTL_GENERAL_PURPOSE2 0x11
+#define CTL_GENERAL_PURPOSE3 0x12
+#define CTL_GENERAL_PURPOSE4 0x13
+/* undefined 0x14 - 0x1f */
+
+/* undefined 0x20 */
+/* The controller numbers 0x21 to 0x3f are reserved for the */
+/* least significant bytes of the controllers 0x00 to 0x1f. */
+/* These controllers are not recognised by the driver. */
+
+/* Controllers 64 to 69 (0x40 to 0x45) are on/off switches. */
+/* 0=OFF and 127=ON (intermediate values are possible) */
+#define CTL_DAMPER_PEDAL 0x40
+#define CTL_SUSTAIN 0x40 /* Alias */
+#define CTL_HOLD 0x40 /* Alias */
+#define CTL_PORTAMENTO 0x41
+#define CTL_SOSTENUTO 0x42
+#define CTL_SOFT_PEDAL 0x43
+/* undefined 0x44 */
+#define CTL_HOLD2 0x45
+/* undefined 0x46 - 0x4f */
+
+#define CTL_GENERAL_PURPOSE5 0x50
+#define CTL_GENERAL_PURPOSE6 0x51
+#define CTL_GENERAL_PURPOSE7 0x52
+#define CTL_GENERAL_PURPOSE8 0x53
+/* undefined 0x54 - 0x5a */
+#define CTL_EXT_EFF_DEPTH 0x5b
+#define CTL_TREMOLO_DEPTH 0x5c
+#define CTL_CHORUS_DEPTH 0x5d
+#define CTL_DETUNE_DEPTH 0x5e
+#define CTL_CELESTE_DEPTH 0x5e /* Alias for the above one */
+#define CTL_PHASER_DEPTH 0x5f
+#define CTL_DATA_INCREMENT 0x60
+#define CTL_DATA_DECREMENT 0x61
+#define CTL_NONREG_PARM_NUM_LSB 0x62
+#define CTL_NONREG_PARM_NUM_MSB 0x63
+#define CTL_REGIST_PARM_NUM_LSB 0x64
+#define CTL_REGIST_PARM_NUM_MSB 0x65
+/* undefined 0x66 - 0x78 */
+/* reserved 0x79 - 0x7f */
+
+/* Pseudo controllers (not midi compatible) */
+#define CTRL_PITCH_BENDER 255
+#define CTRL_PITCH_BENDER_RANGE 254
+#define CTRL_EXPRESSION 253 /* Obsolete */
+#define CTRL_MAIN_VOLUME 252 /* Obsolete */
+#define SEQ_BALANCE 11
+#define SEQ_VOLMODE 12
+
+/*
+ * Volume mode decides how volumes are used
+ */
+
+#define VOL_METHOD_ADAGIO 1
+#define VOL_METHOD_LINEAR 2
+
+/*
+ * Note! SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO are used also as
+ * input events.
+ */
+
+/*
+ * Event codes 0xf0 to 0xfc are reserved for future extensions.
+ */
+
+#define SEQ_FULLSIZE 0xfd /* Long events */
+/*
+ * SEQ_FULLSIZE events are used for loading patches/samples to the
+ * synthesizer devices. These events are passed directly to the driver
+ * of the associated synthesizer device. There is no limit to the size
+ * of the extended events. These events are not queued but executed
+ * immediately when the write() is called (execution can take several
+ * seconds of time).
+ *
+ * When a SEQ_FULLSIZE message is written to the device, it must
+ * be written using exactly one write() call. Other events cannot
+ * be mixed to the same write.
+ *
+ * For FM synths (YM3812/OPL3) use struct sbi_instrument and write it to the
+ * /dev/sequencer. Don't write other data together with the instrument structure
+ * Set the key field of the structure to FM_PATCH. The device field is used to
+ * route the patch to the corresponding device.
+ *
+ * For wave table use struct patch_info. Initialize the key field
+ * to WAVE_PATCH.
+ */
+#define SEQ_PRIVATE 0xfe /* Low level HW dependent events (8 bytes) */
+#define SEQ_EXTENDED 0xff /* Extended events (8 bytes) OBSOLETE */
+
+/*
+ * Record for FM patches
+ */
+
+typedef unsigned char sbi_instr_data[32];
+
+struct sbi_instrument {
+ unsigned short key; /* FM_PATCH or OPL3_PATCH */
+#define FM_PATCH _PATCHKEY(0x01)
+#define OPL3_PATCH _PATCHKEY(0x03)
+ short device; /* Synth# (0-4) */
+ int channel; /* Program# to be initialized */
+ sbi_instr_data operators; /* Register settings for operator cells (.SBI format) */
+ };
+
+struct synth_info { /* Read only */
+ char name[30];
+ int device; /* 0-N. INITIALIZE BEFORE CALLING */
+ int synth_type;
+#define SYNTH_TYPE_FM 0
+#define SYNTH_TYPE_SAMPLE 1
+#define SYNTH_TYPE_MIDI 2 /* Midi interface */
+
+ int synth_subtype;
+#define FM_TYPE_ADLIB 0x00
+#define FM_TYPE_OPL3 0x01
+#define MIDI_TYPE_MPU401 0x401
+
+#define SAMPLE_TYPE_BASIC 0x10
+#define SAMPLE_TYPE_GUS SAMPLE_TYPE_BASIC
+#define SAMPLE_TYPE_WAVEFRONT 0x11
+
+ int perc_mode; /* No longer supported */
+ int nr_voices;
+ int nr_drums; /* Obsolete field */
+ int instr_bank_size;
+ unsigned int capabilities;
+#define SYNTH_CAP_PERCMODE 0x00000001 /* No longer used */
+#define SYNTH_CAP_OPL3 0x00000002 /* Set if OPL3 supported */
+#define SYNTH_CAP_INPUT 0x00000004 /* Input (MIDI) device */
+ int dummies[19]; /* Reserve space */
+ };
+
+struct sound_timer_info {
+ char name[32];
+ int caps;
+ };
+
+#define MIDI_CAP_MPU401 1 /* MPU-401 intelligent mode */
+
+struct midi_info {
+ char name[30];
+ int device; /* 0-N. INITIALIZE BEFORE CALLING */
+ unsigned int capabilities; /* To be defined later */
+ int dev_type;
+ int dummies[18]; /* Reserve space */
+ };
+
+/********************************************
+ * ioctl commands for the /dev/midi##
+ */
+typedef struct {
+ unsigned char cmd;
+ char nr_args, nr_returns;
+ unsigned char data[30];
+ } mpu_command_rec;
+
+#define SNDCTL_MIDI_PRETIME _SIOWR('m', 0, int)
+#define SNDCTL_MIDI_MPUMODE _SIOWR('m', 1, int)
+#define SNDCTL_MIDI_MPUCMD _SIOWR('m', 2, mpu_command_rec)
+
+/********************************************
+ * IOCTL commands for /dev/dsp and /dev/audio
+ */
+
+#define SNDCTL_DSP_RESET _SIO ('P', 0)
+#define SNDCTL_DSP_SYNC _SIO ('P', 1)
+#define SNDCTL_DSP_SPEED _SIOWR('P', 2, int)
+#define SNDCTL_DSP_STEREO _SIOWR('P', 3, int)
+#define SNDCTL_DSP_GETBLKSIZE _SIOWR('P', 4, int)
+#define SNDCTL_DSP_SAMPLESIZE SNDCTL_DSP_SETFMT
+#define SNDCTL_DSP_CHANNELS _SIOWR('P', 6, int)
+#define SOUND_PCM_WRITE_CHANNELS SNDCTL_DSP_CHANNELS
+#define SOUND_PCM_WRITE_FILTER _SIOWR('P', 7, int)
+#define SNDCTL_DSP_POST _SIO ('P', 8)
+#define SNDCTL_DSP_SUBDIVIDE _SIOWR('P', 9, int)
+#define SNDCTL_DSP_SETFRAGMENT _SIOWR('P',10, int)
+
+/* Audio data formats (Note! U8=8 and S16_LE=16 for compatibility) */
+#define SNDCTL_DSP_GETFMTS _SIOR ('P',11, int) /* Returns a mask */
+#define SNDCTL_DSP_SETFMT _SIOWR('P',5, int) /* Selects ONE fmt*/
+# define AFMT_QUERY 0x00000000 /* Return current fmt */
+# define AFMT_MU_LAW 0x00000001
+# define AFMT_A_LAW 0x00000002
+# define AFMT_IMA_ADPCM 0x00000004
+# define AFMT_U8 0x00000008
+# define AFMT_S16_LE 0x00000010 /* Little endian signed 16*/
+# define AFMT_S16_BE 0x00000020 /* Big endian signed 16 */
+# define AFMT_S8 0x00000040
+# define AFMT_U16_LE 0x00000080 /* Little endian U16 */
+# define AFMT_U16_BE 0x00000100 /* Big endian U16 */
+# define AFMT_MPEG 0x00000200 /* MPEG (2) audio */
+# define AFMT_AC3 0x00000400 /* Dolby Digital AC3 */
+
+/*
+ * Buffer status queries.
+ */
+typedef struct audio_buf_info {
+ int fragments; /* # of available fragments (partially usend ones not counted) */
+ int fragstotal; /* Total # of fragments allocated */
+ int fragsize; /* Size of a fragment in bytes */
+
+ int bytes; /* Available space in bytes (includes partially used fragments) */
+ /* Note! 'bytes' could be more than fragments*fragsize */
+ } audio_buf_info;
+
+#define SNDCTL_DSP_GETOSPACE _SIOR ('P',12, audio_buf_info)
+#define SNDCTL_DSP_GETISPACE _SIOR ('P',13, audio_buf_info)
+#define SNDCTL_DSP_NONBLOCK _SIO ('P',14)
+#define SNDCTL_DSP_GETCAPS _SIOR ('P',15, int)
+# define DSP_CAP_REVISION 0x000000ff /* Bits for revision level (0 to 255) */
+# define DSP_CAP_DUPLEX 0x00000100 /* Full duplex record/playback */
+# define DSP_CAP_REALTIME 0x00000200 /* Real time capability */
+# define DSP_CAP_BATCH 0x00000400 /* Device has some kind of */
+ /* internal buffers which may */
+ /* cause some delays and */
+ /* decrease precision of timing */
+# define DSP_CAP_COPROC 0x00000800 /* Has a coprocessor */
+ /* Sometimes it's a DSP */
+ /* but usually not */
+# define DSP_CAP_TRIGGER 0x00001000 /* Supports SETTRIGGER */
+# define DSP_CAP_MMAP 0x00002000 /* Supports mmap() */
+# define DSP_CAP_MULTI 0x00004000 /* support multiple open */
+# define DSP_CAP_BIND 0x00008000 /* channel binding to front/rear/cneter/lfe */
+
+
+#define SNDCTL_DSP_GETTRIGGER _SIOR ('P',16, int)
+#define SNDCTL_DSP_SETTRIGGER _SIOW ('P',16, int)
+# define PCM_ENABLE_INPUT 0x00000001
+# define PCM_ENABLE_OUTPUT 0x00000002
+
+typedef struct count_info {
+ int bytes; /* Total # of bytes processed */
+ int blocks; /* # of fragment transitions since last time */
+ int ptr; /* Current DMA pointer value */
+ } count_info;
+
+#define SNDCTL_DSP_GETIPTR _SIOR ('P',17, count_info)
+#define SNDCTL_DSP_GETOPTR _SIOR ('P',18, count_info)
+
+typedef struct buffmem_desc {
+ unsigned *buffer;
+ int size;
+ } buffmem_desc;
+#define SNDCTL_DSP_MAPINBUF _SIOR ('P', 19, buffmem_desc)
+#define SNDCTL_DSP_MAPOUTBUF _SIOR ('P', 20, buffmem_desc)
+#define SNDCTL_DSP_SETSYNCRO _SIO ('P', 21)
+#define SNDCTL_DSP_SETDUPLEX _SIO ('P', 22)
+#define SNDCTL_DSP_GETODELAY _SIOR ('P', 23, int)
+
+#define SNDCTL_DSP_GETCHANNELMASK _SIOWR('P', 64, int)
+#define SNDCTL_DSP_BIND_CHANNEL _SIOWR('P', 65, int)
+# define DSP_BIND_QUERY 0x00000000
+# define DSP_BIND_FRONT 0x00000001
+# define DSP_BIND_SURR 0x00000002
+# define DSP_BIND_CENTER_LFE 0x00000004
+# define DSP_BIND_HANDSET 0x00000008
+# define DSP_BIND_MIC 0x00000010
+# define DSP_BIND_MODEM1 0x00000020
+# define DSP_BIND_MODEM2 0x00000040
+# define DSP_BIND_I2S 0x00000080
+# define DSP_BIND_SPDIF 0x00000100
+
+#define SNDCTL_DSP_SETSPDIF _SIOW ('P', 66, int)
+#define SNDCTL_DSP_GETSPDIF _SIOR ('P', 67, int)
+# define SPDIF_PRO 0x0001
+# define SPDIF_N_AUD 0x0002
+# define SPDIF_COPY 0x0004
+# define SPDIF_PRE 0x0008
+# define SPDIF_CC 0x07f0
+# define SPDIF_L 0x0800
+# define SPDIF_DRS 0x4000
+# define SPDIF_V 0x8000
+
+/*
+ * Application's profile defines the way how playback underrun situations should be handled.
+ *
+ * APF_NORMAL (the default) and APF_NETWORK make the driver to cleanup the
+ * playback buffer whenever an underrun occurs. This consumes some time
+ * prevents looping the existing buffer.
+ * APF_CPUINTENS is intended to be set by CPU intensive applications which
+ * are likely to run out of time occasionally. In this mode the buffer cleanup is
+ * disabled which saves CPU time but also let's the previous buffer content to
+ * be played during the "pause" after the underrun.
+ */
+#define SNDCTL_DSP_PROFILE _SIOW ('P', 23, int)
+#define APF_NORMAL 0 /* Normal applications */
+#define APF_NETWORK 1 /* Underruns probably caused by an "external" delay */
+#define APF_CPUINTENS 2 /* Underruns probably caused by "overheating" the CPU */
+
+#define SOUND_PCM_READ_RATE _SIOR ('P', 2, int)
+#define SOUND_PCM_READ_CHANNELS _SIOR ('P', 6, int)
+#define SOUND_PCM_READ_BITS _SIOR ('P', 5, int)
+#define SOUND_PCM_READ_FILTER _SIOR ('P', 7, int)
+
+/* Some alias names */
+#define SOUND_PCM_WRITE_BITS SNDCTL_DSP_SETFMT
+#define SOUND_PCM_WRITE_RATE SNDCTL_DSP_SPEED
+#define SOUND_PCM_POST SNDCTL_DSP_POST
+#define SOUND_PCM_RESET SNDCTL_DSP_RESET
+#define SOUND_PCM_SYNC SNDCTL_DSP_SYNC
+#define SOUND_PCM_SUBDIVIDE SNDCTL_DSP_SUBDIVIDE
+#define SOUND_PCM_SETFRAGMENT SNDCTL_DSP_SETFRAGMENT
+#define SOUND_PCM_GETFMTS SNDCTL_DSP_GETFMTS
+#define SOUND_PCM_SETFMT SNDCTL_DSP_SETFMT
+#define SOUND_PCM_GETOSPACE SNDCTL_DSP_GETOSPACE
+#define SOUND_PCM_GETISPACE SNDCTL_DSP_GETISPACE
+#define SOUND_PCM_NONBLOCK SNDCTL_DSP_NONBLOCK
+#define SOUND_PCM_GETCAPS SNDCTL_DSP_GETCAPS
+#define SOUND_PCM_GETTRIGGER SNDCTL_DSP_GETTRIGGER
+#define SOUND_PCM_SETTRIGGER SNDCTL_DSP_SETTRIGGER
+#define SOUND_PCM_SETSYNCRO SNDCTL_DSP_SETSYNCRO
+#define SOUND_PCM_GETIPTR SNDCTL_DSP_GETIPTR
+#define SOUND_PCM_GETOPTR SNDCTL_DSP_GETOPTR
+#define SOUND_PCM_MAPINBUF SNDCTL_DSP_MAPINBUF
+#define SOUND_PCM_MAPOUTBUF SNDCTL_DSP_MAPOUTBUF
+
+/*
+ * ioctl calls to be used in communication with coprocessors and
+ * DSP chips.
+ */
+
+typedef struct copr_buffer {
+ int command; /* Set to 0 if not used */
+ int flags;
+#define CPF_NONE 0x0000
+#define CPF_FIRST 0x0001 /* First block */
+#define CPF_LAST 0x0002 /* Last block */
+ int len;
+ int offs; /* If required by the device (0 if not used) */
+
+ unsigned char data[4000]; /* NOTE! 4000 is not 4k */
+ } copr_buffer;
+
+typedef struct copr_debug_buf {
+ int command; /* Used internally. Set to 0 */
+ int parm1;
+ int parm2;
+ int flags;
+ int len; /* Length of data in bytes */
+ } copr_debug_buf;
+
+typedef struct copr_msg {
+ int len;
+ unsigned char data[4000];
+ } copr_msg;
+
+#define SNDCTL_COPR_RESET _SIO ('C', 0)
+#define SNDCTL_COPR_LOAD _SIOWR('C', 1, copr_buffer)
+#define SNDCTL_COPR_RDATA _SIOWR('C', 2, copr_debug_buf)
+#define SNDCTL_COPR_RCODE _SIOWR('C', 3, copr_debug_buf)
+#define SNDCTL_COPR_WDATA _SIOW ('C', 4, copr_debug_buf)
+#define SNDCTL_COPR_WCODE _SIOW ('C', 5, copr_debug_buf)
+#define SNDCTL_COPR_RUN _SIOWR('C', 6, copr_debug_buf)
+#define SNDCTL_COPR_HALT _SIOWR('C', 7, copr_debug_buf)
+#define SNDCTL_COPR_SENDMSG _SIOWR('C', 8, copr_msg)
+#define SNDCTL_COPR_RCVMSG _SIOR ('C', 9, copr_msg)
+
+/*********************************************
+ * IOCTL commands for /dev/mixer
+ */
+
+/*
+ * Mixer devices
+ *
+ * There can be up to 20 different analog mixer channels. The
+ * SOUND_MIXER_NRDEVICES gives the currently supported maximum.
+ * The SOUND_MIXER_READ_DEVMASK returns a bitmask which tells
+ * the devices supported by the particular mixer.
+ */
+
+#define SOUND_MIXER_NRDEVICES 25
+#define SOUND_MIXER_VOLUME 0
+#define SOUND_MIXER_BASS 1
+#define SOUND_MIXER_TREBLE 2
+#define SOUND_MIXER_SYNTH 3
+#define SOUND_MIXER_PCM 4
+#define SOUND_MIXER_SPEAKER 5
+#define SOUND_MIXER_LINE 6
+#define SOUND_MIXER_MIC 7
+#define SOUND_MIXER_CD 8
+#define SOUND_MIXER_IMIX 9 /* Recording monitor */
+#define SOUND_MIXER_ALTPCM 10
+#define SOUND_MIXER_RECLEV 11 /* Recording level */
+#define SOUND_MIXER_IGAIN 12 /* Input gain */
+#define SOUND_MIXER_OGAIN 13 /* Output gain */
+/*
+ * The AD1848 codec and compatibles have three line level inputs
+ * (line, aux1 and aux2). Since each card manufacturer have assigned
+ * different meanings to these inputs, it's inpractical to assign
+ * specific meanings (line, cd, synth etc.) to them.
+ */
+#define SOUND_MIXER_LINE1 14 /* Input source 1 (aux1) */
+#define SOUND_MIXER_LINE2 15 /* Input source 2 (aux2) */
+#define SOUND_MIXER_LINE3 16 /* Input source 3 (line) */
+#define SOUND_MIXER_DIGITAL1 17 /* Digital (input) 1 */
+#define SOUND_MIXER_DIGITAL2 18 /* Digital (input) 2 */
+#define SOUND_MIXER_DIGITAL3 19 /* Digital (input) 3 */
+#define SOUND_MIXER_PHONEIN 20 /* Phone input */
+#define SOUND_MIXER_PHONEOUT 21 /* Phone output */
+#define SOUND_MIXER_VIDEO 22 /* Video/TV (audio) in */
+#define SOUND_MIXER_RADIO 23 /* Radio in */
+#define SOUND_MIXER_MONITOR 24 /* Monitor (usually mic) volume */
+
+/* Some on/off settings (SOUND_SPECIAL_MIN - SOUND_SPECIAL_MAX) */
+/* Not counted to SOUND_MIXER_NRDEVICES, but use the same number space */
+#define SOUND_ONOFF_MIN 28
+#define SOUND_ONOFF_MAX 30
+
+/* Note! Number 31 cannot be used since the sign bit is reserved */
+#define SOUND_MIXER_NONE 31
+
+/*
+ * The following unsupported macros are no longer functional.
+ * Use SOUND_MIXER_PRIVATE# macros in future.
+ */
+#define SOUND_MIXER_ENHANCE SOUND_MIXER_NONE
+#define SOUND_MIXER_MUTE SOUND_MIXER_NONE
+#define SOUND_MIXER_LOUD SOUND_MIXER_NONE
+
+
+#define SOUND_DEVICE_LABELS {"Vol ", "Bass ", "Trebl", "Synth", "Pcm ", "Spkr ", "Line ", \
+ "Mic ", "CD ", "Mix ", "Pcm2 ", "Rec ", "IGain", "OGain", \
+ "Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3", \
+ "PhoneIn", "PhoneOut", "Video", "Radio", "Monitor"}
+
+#define SOUND_DEVICE_NAMES {"vol", "bass", "treble", "synth", "pcm", "speaker", "line", \
+ "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \
+ "line1", "line2", "line3", "dig1", "dig2", "dig3", \
+ "phin", "phout", "video", "radio", "monitor"}
+
+/* Device bitmask identifiers */
+
+#define SOUND_MIXER_RECSRC 0xff /* Arg contains a bit for each recording source */
+#define SOUND_MIXER_DEVMASK 0xfe /* Arg contains a bit for each supported device */
+#define SOUND_MIXER_RECMASK 0xfd /* Arg contains a bit for each supported recording source */
+#define SOUND_MIXER_CAPS 0xfc
+# define SOUND_CAP_EXCL_INPUT 0x00000001 /* Only one recording source at a time */
+#define SOUND_MIXER_STEREODEVS 0xfb /* Mixer channels supporting stereo */
+#define SOUND_MIXER_OUTSRC 0xfa /* Arg contains a bit for each input source to output */
+#define SOUND_MIXER_OUTMASK 0xf9 /* Arg contains a bit for each supported input source to output */
+
+/* Device mask bits */
+
+#define SOUND_MASK_VOLUME (1 << SOUND_MIXER_VOLUME)
+#define SOUND_MASK_BASS (1 << SOUND_MIXER_BASS)
+#define SOUND_MASK_TREBLE (1 << SOUND_MIXER_TREBLE)
+#define SOUND_MASK_SYNTH (1 << SOUND_MIXER_SYNTH)
+#define SOUND_MASK_PCM (1 << SOUND_MIXER_PCM)
+#define SOUND_MASK_SPEAKER (1 << SOUND_MIXER_SPEAKER)
+#define SOUND_MASK_LINE (1 << SOUND_MIXER_LINE)
+#define SOUND_MASK_MIC (1 << SOUND_MIXER_MIC)
+#define SOUND_MASK_CD (1 << SOUND_MIXER_CD)
+#define SOUND_MASK_IMIX (1 << SOUND_MIXER_IMIX)
+#define SOUND_MASK_ALTPCM (1 << SOUND_MIXER_ALTPCM)
+#define SOUND_MASK_RECLEV (1 << SOUND_MIXER_RECLEV)
+#define SOUND_MASK_IGAIN (1 << SOUND_MIXER_IGAIN)
+#define SOUND_MASK_OGAIN (1 << SOUND_MIXER_OGAIN)
+#define SOUND_MASK_LINE1 (1 << SOUND_MIXER_LINE1)
+#define SOUND_MASK_LINE2 (1 << SOUND_MIXER_LINE2)
+#define SOUND_MASK_LINE3 (1 << SOUND_MIXER_LINE3)
+#define SOUND_MASK_DIGITAL1 (1 << SOUND_MIXER_DIGITAL1)
+#define SOUND_MASK_DIGITAL2 (1 << SOUND_MIXER_DIGITAL2)
+#define SOUND_MASK_DIGITAL3 (1 << SOUND_MIXER_DIGITAL3)
+#define SOUND_MASK_PHONEIN (1 << SOUND_MIXER_PHONEIN)
+#define SOUND_MASK_PHONEOUT (1 << SOUND_MIXER_PHONEOUT)
+#define SOUND_MASK_RADIO (1 << SOUND_MIXER_RADIO)
+#define SOUND_MASK_VIDEO (1 << SOUND_MIXER_VIDEO)
+#define SOUND_MASK_MONITOR (1 << SOUND_MIXER_MONITOR)
+
+/* Obsolete macros */
+#define SOUND_MASK_MUTE (1 << SOUND_MIXER_MUTE)
+#define SOUND_MASK_ENHANCE (1 << SOUND_MIXER_ENHANCE)
+#define SOUND_MASK_LOUD (1 << SOUND_MIXER_LOUD)
+
+#define MIXER_READ(dev) _SIOR('M', dev, int)
+#define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME)
+#define SOUND_MIXER_READ_BASS MIXER_READ(SOUND_MIXER_BASS)
+#define SOUND_MIXER_READ_TREBLE MIXER_READ(SOUND_MIXER_TREBLE)
+#define SOUND_MIXER_READ_SYNTH MIXER_READ(SOUND_MIXER_SYNTH)
+#define SOUND_MIXER_READ_PCM MIXER_READ(SOUND_MIXER_PCM)
+#define SOUND_MIXER_READ_SPEAKER MIXER_READ(SOUND_MIXER_SPEAKER)
+#define SOUND_MIXER_READ_LINE MIXER_READ(SOUND_MIXER_LINE)
+#define SOUND_MIXER_READ_MIC MIXER_READ(SOUND_MIXER_MIC)
+#define SOUND_MIXER_READ_CD MIXER_READ(SOUND_MIXER_CD)
+#define SOUND_MIXER_READ_IMIX MIXER_READ(SOUND_MIXER_IMIX)
+#define SOUND_MIXER_READ_ALTPCM MIXER_READ(SOUND_MIXER_ALTPCM)
+#define SOUND_MIXER_READ_RECLEV MIXER_READ(SOUND_MIXER_RECLEV)
+#define SOUND_MIXER_READ_IGAIN MIXER_READ(SOUND_MIXER_IGAIN)
+#define SOUND_MIXER_READ_OGAIN MIXER_READ(SOUND_MIXER_OGAIN)
+#define SOUND_MIXER_READ_LINE1 MIXER_READ(SOUND_MIXER_LINE1)
+#define SOUND_MIXER_READ_LINE2 MIXER_READ(SOUND_MIXER_LINE2)
+#define SOUND_MIXER_READ_LINE3 MIXER_READ(SOUND_MIXER_LINE3)
+
+/* Obsolete macros */
+#define SOUND_MIXER_READ_MUTE MIXER_READ(SOUND_MIXER_MUTE)
+#define SOUND_MIXER_READ_ENHANCE MIXER_READ(SOUND_MIXER_ENHANCE)
+#define SOUND_MIXER_READ_LOUD MIXER_READ(SOUND_MIXER_LOUD)
+
+#define SOUND_MIXER_READ_RECSRC MIXER_READ(SOUND_MIXER_RECSRC)
+#define SOUND_MIXER_READ_DEVMASK MIXER_READ(SOUND_MIXER_DEVMASK)
+#define SOUND_MIXER_READ_RECMASK MIXER_READ(SOUND_MIXER_RECMASK)
+#define SOUND_MIXER_READ_STEREODEVS MIXER_READ(SOUND_MIXER_STEREODEVS)
+#define SOUND_MIXER_READ_CAPS MIXER_READ(SOUND_MIXER_CAPS)
+
+#define MIXER_WRITE(dev) _SIOWR('M', dev, int)
+#define SOUND_MIXER_WRITE_VOLUME MIXER_WRITE(SOUND_MIXER_VOLUME)
+#define SOUND_MIXER_WRITE_BASS MIXER_WRITE(SOUND_MIXER_BASS)
+#define SOUND_MIXER_WRITE_TREBLE MIXER_WRITE(SOUND_MIXER_TREBLE)
+#define SOUND_MIXER_WRITE_SYNTH MIXER_WRITE(SOUND_MIXER_SYNTH)
+#define SOUND_MIXER_WRITE_PCM MIXER_WRITE(SOUND_MIXER_PCM)
+#define SOUND_MIXER_WRITE_SPEAKER MIXER_WRITE(SOUND_MIXER_SPEAKER)
+#define SOUND_MIXER_WRITE_LINE MIXER_WRITE(SOUND_MIXER_LINE)
+#define SOUND_MIXER_WRITE_MIC MIXER_WRITE(SOUND_MIXER_MIC)
+#define SOUND_MIXER_WRITE_CD MIXER_WRITE(SOUND_MIXER_CD)
+#define SOUND_MIXER_WRITE_IMIX MIXER_WRITE(SOUND_MIXER_IMIX)
+#define SOUND_MIXER_WRITE_ALTPCM MIXER_WRITE(SOUND_MIXER_ALTPCM)
+#define SOUND_MIXER_WRITE_RECLEV MIXER_WRITE(SOUND_MIXER_RECLEV)
+#define SOUND_MIXER_WRITE_IGAIN MIXER_WRITE(SOUND_MIXER_IGAIN)
+#define SOUND_MIXER_WRITE_OGAIN MIXER_WRITE(SOUND_MIXER_OGAIN)
+#define SOUND_MIXER_WRITE_LINE1 MIXER_WRITE(SOUND_MIXER_LINE1)
+#define SOUND_MIXER_WRITE_LINE2 MIXER_WRITE(SOUND_MIXER_LINE2)
+#define SOUND_MIXER_WRITE_LINE3 MIXER_WRITE(SOUND_MIXER_LINE3)
+
+/* Obsolete macros */
+#define SOUND_MIXER_WRITE_MUTE MIXER_WRITE(SOUND_MIXER_MUTE)
+#define SOUND_MIXER_WRITE_ENHANCE MIXER_WRITE(SOUND_MIXER_ENHANCE)
+#define SOUND_MIXER_WRITE_LOUD MIXER_WRITE(SOUND_MIXER_LOUD)
+
+#define SOUND_MIXER_WRITE_RECSRC MIXER_WRITE(SOUND_MIXER_RECSRC)
+
+typedef struct mixer_info
+{
+ char id[16];
+ char name[32];
+ int modify_counter;
+ int fillers[10];
+} mixer_info;
+
+typedef struct _old_mixer_info /* Obsolete */
+{
+ char id[16];
+ char name[32];
+} _old_mixer_info;
+
+#define SOUND_MIXER_INFO _SIOR ('M', 101, mixer_info)
+#define SOUND_OLD_MIXER_INFO _SIOR ('M', 101, _old_mixer_info)
+
+/*
+ * A mechanism for accessing "proprietary" mixer features. This method
+ * permits passing 128 bytes of arbitrary data between a mixer application
+ * and the mixer driver. Interpretation of the record is defined by
+ * the particular mixer driver.
+ */
+typedef unsigned char mixer_record[128];
+
+#define SOUND_MIXER_ACCESS _SIOWR('M', 102, mixer_record)
+
+/*
+ * Two ioctls for special souncard function
+ */
+#define SOUND_MIXER_AGC _SIOWR('M', 103, int)
+#define SOUND_MIXER_3DSE _SIOWR('M', 104, int)
+
+/*
+ * The SOUND_MIXER_PRIVATE# commands can be redefined by low level drivers.
+ * These features can be used when accessing device specific features.
+ */
+#define SOUND_MIXER_PRIVATE1 _SIOWR('M', 111, int)
+#define SOUND_MIXER_PRIVATE2 _SIOWR('M', 112, int)
+#define SOUND_MIXER_PRIVATE3 _SIOWR('M', 113, int)
+#define SOUND_MIXER_PRIVATE4 _SIOWR('M', 114, int)
+#define SOUND_MIXER_PRIVATE5 _SIOWR('M', 115, int)
+
+/*
+ * SOUND_MIXER_GETLEVELS and SOUND_MIXER_SETLEVELS calls can be used
+ * for querying current mixer settings from the driver and for loading
+ * default volume settings _prior_ activating the mixer (loading
+ * doesn't affect current state of the mixer hardware). These calls
+ * are for internal use only.
+ */
+
+typedef struct mixer_vol_table {
+ int num; /* Index to volume table */
+ char name[32];
+ int levels[32];
+} mixer_vol_table;
+
+#define SOUND_MIXER_GETLEVELS _SIOWR('M', 116, mixer_vol_table)
+#define SOUND_MIXER_SETLEVELS _SIOWR('M', 117, mixer_vol_table)
+
+/*
+ * An ioctl for identifying the driver version. It will return value
+ * of the SOUND_VERSION macro used when compiling the driver.
+ * This call was introduced in OSS version 3.6 and it will not work
+ * with earlier versions (returns EINVAL).
+ */
+#define OSS_GETVERSION _SIOR ('M', 118, int)
+
+/*
+ * Level 2 event types for /dev/sequencer
+ */
+
+/*
+ * The 4 most significant bits of byte 0 specify the class of
+ * the event:
+ *
+ * 0x8X = system level events,
+ * 0x9X = device/port specific events, event[1] = device/port,
+ * The last 4 bits give the subtype:
+ * 0x02 = Channel event (event[3] = chn).
+ * 0x01 = note event (event[4] = note).
+ * (0x01 is not used alone but always with bit 0x02).
+ * event[2] = MIDI message code (0x80=note off etc.)
+ *
+ */
+
+#define EV_SEQ_LOCAL 0x80
+#define EV_TIMING 0x81
+#define EV_CHN_COMMON 0x92
+#define EV_CHN_VOICE 0x93
+#define EV_SYSEX 0x94
+/*
+ * Event types 200 to 220 are reserved for application use.
+ * These numbers will not be used by the driver.
+ */
+
+/*
+ * Events for event type EV_CHN_VOICE
+ */
+
+#define MIDI_NOTEOFF 0x80
+#define MIDI_NOTEON 0x90
+#define MIDI_KEY_PRESSURE 0xA0
+
+/*
+ * Events for event type EV_CHN_COMMON
+ */
+
+#define MIDI_CTL_CHANGE 0xB0
+#define MIDI_PGM_CHANGE 0xC0
+#define MIDI_CHN_PRESSURE 0xD0
+#define MIDI_PITCH_BEND 0xE0
+
+#define MIDI_SYSTEM_PREFIX 0xF0
+
+/*
+ * Timer event types
+ */
+#define TMR_WAIT_REL 1 /* Time relative to the prev time */
+#define TMR_WAIT_ABS 2 /* Absolute time since TMR_START */
+#define TMR_STOP 3
+#define TMR_START 4
+#define TMR_CONTINUE 5
+#define TMR_TEMPO 6
+#define TMR_ECHO 8
+#define TMR_CLOCK 9 /* MIDI clock */
+#define TMR_SPP 10 /* Song position pointer */
+#define TMR_TIMESIG 11 /* Time signature */
+
+/*
+ * Local event types
+ */
+#define LOCL_STARTAUDIO 1
+
+#if !defined(__KERNEL__) || defined(USE_SEQ_MACROS)
+/*
+ * Some convenience macros to simplify programming of the
+ * /dev/sequencer interface
+ *
+ * This is a legacy interface for applications written against
+ * the OSSlib-3.8 style interface. It is no longer possible
+ * to actually link against OSSlib with this header, but we
+ * still provide these macros for programs using them.
+ *
+ * If you want to use OSSlib, it is recommended that you get
+ * the GPL version of OSS-4.x and build against that version
+ * of the header.
+ *
+ * We redefine the extern keyword so that make headers_check
+ * does not complain about SEQ_USE_EXTBUF.
+ */
+#define SEQ_DECLAREBUF() SEQ_USE_EXTBUF()
+
+void seqbuf_dump(void); /* This function must be provided by programs */
+
+#define SEQ_PM_DEFINES int __foo_bar___
+
+#define SEQ_LOAD_GMINSTR(dev, instr)
+#define SEQ_LOAD_GMDRUM(dev, drum)
+
+#define _SEQ_EXTERN extern
+#define SEQ_USE_EXTBUF() \
+ _SEQ_EXTERN unsigned char _seqbuf[]; \
+ _SEQ_EXTERN int _seqbuflen; _SEQ_EXTERN int _seqbufptr
+
+#ifndef USE_SIMPLE_MACROS
+/* Sample seqbuf_dump() implementation:
+ *
+ * SEQ_DEFINEBUF (2048); -- Defines a buffer for 2048 bytes
+ *
+ * int seqfd; -- The file descriptor for /dev/sequencer.
+ *
+ * void
+ * seqbuf_dump ()
+ * {
+ * if (_seqbufptr)
+ * if (write (seqfd, _seqbuf, _seqbufptr) == -1)
+ * {
+ * perror ("write /dev/sequencer");
+ * exit (-1);
+ * }
+ * _seqbufptr = 0;
+ * }
+ */
+
+#define SEQ_DEFINEBUF(len) unsigned char _seqbuf[len]; int _seqbuflen = len;int _seqbufptr = 0
+#define _SEQ_NEEDBUF(len) if ((_seqbufptr+(len)) > _seqbuflen) seqbuf_dump()
+#define _SEQ_ADVBUF(len) _seqbufptr += len
+#define SEQ_DUMPBUF seqbuf_dump
+#else
+/*
+ * This variation of the sequencer macros is used just to format one event
+ * using fixed buffer.
+ *
+ * The program using the macro library must define the following macros before
+ * using this library.
+ *
+ * #define _seqbuf name of the buffer (unsigned char[])
+ * #define _SEQ_ADVBUF(len) If the applic needs to know the exact
+ * size of the event, this macro can be used.
+ * Otherwise this must be defined as empty.
+ * #define _seqbufptr Define the name of index variable or 0 if
+ * not required.
+ */
+#define _SEQ_NEEDBUF(len) /* empty */
+#endif
+
+#define SEQ_VOLUME_MODE(dev, mode) {_SEQ_NEEDBUF(8);\
+ _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
+ _seqbuf[_seqbufptr+1] = SEQ_VOLMODE;\
+ _seqbuf[_seqbufptr+2] = (dev);\
+ _seqbuf[_seqbufptr+3] = (mode);\
+ _seqbuf[_seqbufptr+4] = 0;\
+ _seqbuf[_seqbufptr+5] = 0;\
+ _seqbuf[_seqbufptr+6] = 0;\
+ _seqbuf[_seqbufptr+7] = 0;\
+ _SEQ_ADVBUF(8);}
+
+/*
+ * Midi voice messages
+ */
+
+#define _CHN_VOICE(dev, event, chn, note, parm) \
+ {_SEQ_NEEDBUF(8);\
+ _seqbuf[_seqbufptr] = EV_CHN_VOICE;\
+ _seqbuf[_seqbufptr+1] = (dev);\
+ _seqbuf[_seqbufptr+2] = (event);\
+ _seqbuf[_seqbufptr+3] = (chn);\
+ _seqbuf[_seqbufptr+4] = (note);\
+ _seqbuf[_seqbufptr+5] = (parm);\
+ _seqbuf[_seqbufptr+6] = (0);\
+ _seqbuf[_seqbufptr+7] = 0;\
+ _SEQ_ADVBUF(8);}
+
+#define SEQ_START_NOTE(dev, chn, note, vol) \
+ _CHN_VOICE(dev, MIDI_NOTEON, chn, note, vol)
+
+#define SEQ_STOP_NOTE(dev, chn, note, vol) \
+ _CHN_VOICE(dev, MIDI_NOTEOFF, chn, note, vol)
+
+#define SEQ_KEY_PRESSURE(dev, chn, note, pressure) \
+ _CHN_VOICE(dev, MIDI_KEY_PRESSURE, chn, note, pressure)
+
+/*
+ * Midi channel messages
+ */
+
+#define _CHN_COMMON(dev, event, chn, p1, p2, w14) \
+ {_SEQ_NEEDBUF(8);\
+ _seqbuf[_seqbufptr] = EV_CHN_COMMON;\
+ _seqbuf[_seqbufptr+1] = (dev);\
+ _seqbuf[_seqbufptr+2] = (event);\
+ _seqbuf[_seqbufptr+3] = (chn);\
+ _seqbuf[_seqbufptr+4] = (p1);\
+ _seqbuf[_seqbufptr+5] = (p2);\
+ *(short *)&_seqbuf[_seqbufptr+6] = (w14);\
+ _SEQ_ADVBUF(8);}
+/*
+ * SEQ_SYSEX permits sending of sysex messages. (It may look that it permits
+ * sending any MIDI bytes but it's absolutely not possible. Trying to do
+ * so _will_ cause problems with MPU401 intelligent mode).
+ *
+ * Sysex messages are sent in blocks of 1 to 6 bytes. Longer messages must be
+ * sent by calling SEQ_SYSEX() several times (there must be no other events
+ * between them). First sysex fragment must have 0xf0 in the first byte
+ * and the last byte (buf[len-1] of the last fragment must be 0xf7. No byte
+ * between these sysex start and end markers cannot be larger than 0x7f. Also
+ * lengths of each fragments (except the last one) must be 6.
+ *
+ * Breaking the above rules may work with some MIDI ports but is likely to
+ * cause fatal problems with some other devices (such as MPU401).
+ */
+#define SEQ_SYSEX(dev, buf, len) \
+ {int ii, ll=(len); \
+ unsigned char *bufp=buf;\
+ if (ll>6)ll=6;\
+ _SEQ_NEEDBUF(8);\
+ _seqbuf[_seqbufptr] = EV_SYSEX;\
+ _seqbuf[_seqbufptr+1] = (dev);\
+ for(ii=0;ii<ll;ii++)\
+ _seqbuf[_seqbufptr+ii+2] = bufp[ii];\
+ for(ii=ll;ii<6;ii++)\
+ _seqbuf[_seqbufptr+ii+2] = 0xff;\
+ _SEQ_ADVBUF(8);}
+
+#define SEQ_CHN_PRESSURE(dev, chn, pressure) \
+ _CHN_COMMON(dev, MIDI_CHN_PRESSURE, chn, pressure, 0, 0)
+
+#define SEQ_SET_PATCH SEQ_PGM_CHANGE
+#define SEQ_PGM_CHANGE(dev, chn, patch) \
+ _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0)
+
+#define SEQ_CONTROL(dev, chn, controller, value) \
+ _CHN_COMMON(dev, MIDI_CTL_CHANGE, chn, controller, 0, value)
+
+#define SEQ_BENDER(dev, chn, value) \
+ _CHN_COMMON(dev, MIDI_PITCH_BEND, chn, 0, 0, value)
+
+
+#define SEQ_V2_X_CONTROL(dev, voice, controller, value) {_SEQ_NEEDBUF(8);\
+ _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
+ _seqbuf[_seqbufptr+1] = SEQ_CONTROLLER;\
+ _seqbuf[_seqbufptr+2] = (dev);\
+ _seqbuf[_seqbufptr+3] = (voice);\
+ _seqbuf[_seqbufptr+4] = (controller);\
+ _seqbuf[_seqbufptr+5] = ((value)&0xff);\
+ _seqbuf[_seqbufptr+6] = ((value>>8)&0xff);\
+ _seqbuf[_seqbufptr+7] = 0;\
+ _SEQ_ADVBUF(8);}
+/*
+ * The following 5 macros are incorrectly implemented and obsolete.
+ * Use SEQ_BENDER and SEQ_CONTROL (with proper controller) instead.
+ */
+#define SEQ_PITCHBEND(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER, value)
+#define SEQ_BENDER_RANGE(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER_RANGE, value)
+#define SEQ_EXPRESSION(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_EXPRESSION, value*128)
+#define SEQ_MAIN_VOLUME(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_MAIN_VOLUME, (value*16383)/100)
+#define SEQ_PANNING(dev, voice, pos) SEQ_CONTROL(dev, voice, CTL_PAN, (pos+128) / 2)
+
+/*
+ * Timing and syncronization macros
+ */
+
+#define _TIMER_EVENT(ev, parm) {_SEQ_NEEDBUF(8);\
+ _seqbuf[_seqbufptr+0] = EV_TIMING; \
+ _seqbuf[_seqbufptr+1] = (ev); \
+ _seqbuf[_seqbufptr+2] = 0;\
+ _seqbuf[_seqbufptr+3] = 0;\
+ *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
+ _SEQ_ADVBUF(8);}
+
+#define SEQ_START_TIMER() _TIMER_EVENT(TMR_START, 0)
+#define SEQ_STOP_TIMER() _TIMER_EVENT(TMR_STOP, 0)
+#define SEQ_CONTINUE_TIMER() _TIMER_EVENT(TMR_CONTINUE, 0)
+#define SEQ_WAIT_TIME(ticks) _TIMER_EVENT(TMR_WAIT_ABS, ticks)
+#define SEQ_DELTA_TIME(ticks) _TIMER_EVENT(TMR_WAIT_REL, ticks)
+#define SEQ_ECHO_BACK(key) _TIMER_EVENT(TMR_ECHO, key)
+#define SEQ_SET_TEMPO(value) _TIMER_EVENT(TMR_TEMPO, value)
+#define SEQ_SONGPOS(pos) _TIMER_EVENT(TMR_SPP, pos)
+#define SEQ_TIME_SIGNATURE(sig) _TIMER_EVENT(TMR_TIMESIG, sig)
+
+/*
+ * Local control events
+ */
+
+#define _LOCAL_EVENT(ev, parm) {_SEQ_NEEDBUF(8);\
+ _seqbuf[_seqbufptr+0] = EV_SEQ_LOCAL; \
+ _seqbuf[_seqbufptr+1] = (ev); \
+ _seqbuf[_seqbufptr+2] = 0;\
+ _seqbuf[_seqbufptr+3] = 0;\
+ *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
+ _SEQ_ADVBUF(8);}
+
+#define SEQ_PLAYAUDIO(devmask) _LOCAL_EVENT(LOCL_STARTAUDIO, devmask)
+/*
+ * Events for the level 1 interface only
+ */
+
+#define SEQ_MIDIOUT(device, byte) {_SEQ_NEEDBUF(4);\
+ _seqbuf[_seqbufptr] = SEQ_MIDIPUTC;\
+ _seqbuf[_seqbufptr+1] = (byte);\
+ _seqbuf[_seqbufptr+2] = (device);\
+ _seqbuf[_seqbufptr+3] = 0;\
+ _SEQ_ADVBUF(4);}
+
+/*
+ * Patch loading.
+ */
+#define SEQ_WRPATCH(patchx, len) \
+ {if (_seqbufptr) SEQ_DUMPBUF();\
+ if (write(seqfd, (char*)(patchx), len)==-1) \
+ perror("Write patch: /dev/sequencer");}
+#define SEQ_WRPATCH2(patchx, len) \
+ (SEQ_DUMPBUF(), write(seqfd, (char*)(patchx), len))
+
+#endif
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/spi/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/spi/..install.cmd
new file mode 100644
index 0000000..12e42dd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/spi/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/spi/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/spi /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/spi mips spidev.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/spi /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/spi mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/spi/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/spi/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/spi/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/spi/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/spi/spidev.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/spi/spidev.h
new file mode 100644
index 0000000..95251cc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/spi/spidev.h
@@ -0,0 +1,129 @@
+/*
+ * include/linux/spi/spidev.h
+ *
+ * Copyright (C) 2006 SWAPP
+ * Andrea Paterniani <a.paterniani@swapp-eng.it>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef SPIDEV_H
+#define SPIDEV_H
+
+#include <linux/types.h>
+
+/* User space versions of kernel symbols for SPI clocking modes,
+ * matching <linux/spi/spi.h>
+ */
+
+#define SPI_CPHA 0x01
+#define SPI_CPOL 0x02
+
+#define SPI_MODE_0 (0|0)
+#define SPI_MODE_1 (0|SPI_CPHA)
+#define SPI_MODE_2 (SPI_CPOL|0)
+#define SPI_MODE_3 (SPI_CPOL|SPI_CPHA)
+
+#define SPI_CS_HIGH 0x04
+#define SPI_LSB_FIRST 0x08
+#define SPI_3WIRE 0x10
+#define SPI_LOOP 0x20
+
+/*---------------------------------------------------------------------------*/
+
+/* IOCTL commands */
+
+#define SPI_IOC_MAGIC 'k'
+
+/**
+ * struct spi_ioc_transfer - describes a single SPI transfer
+ * @tx_buf: Holds pointer to userspace buffer with transmit data, or null.
+ * If no data is provided, zeroes are shifted out.
+ * @rx_buf: Holds pointer to userspace buffer for receive data, or null.
+ * @len: Length of tx and rx buffers, in bytes.
+ * @speed_hz: Temporary override of the device's bitrate.
+ * @bits_per_word: Temporary override of the device's wordsize.
+ * @delay_usecs: If nonzero, how long to delay after the last bit transfer
+ * before optionally deselecting the device before the next transfer.
+ * @cs_change: True to deselect device before starting the next transfer.
+ *
+ * This structure is mapped directly to the kernel spi_transfer structure;
+ * the fields have the same meanings, except of course that the pointers
+ * are in a different address space (and may be of different sizes in some
+ * cases, such as 32-bit i386 userspace over a 64-bit x86_64 kernel).
+ * Zero-initialize the structure, including currently unused fields, to
+ * accomodate potential future updates.
+ *
+ * SPI_IOC_MESSAGE gives userspace the equivalent of kernel spi_sync().
+ * Pass it an array of related transfers, they'll execute together.
+ * Each transfer may be half duplex (either direction) or full duplex.
+ *
+ * struct spi_ioc_transfer mesg[4];
+ * ...
+ * status = ioctl(fd, SPI_IOC_MESSAGE(4), mesg);
+ *
+ * So for example one transfer might send a nine bit command (right aligned
+ * in a 16-bit word), the next could read a block of 8-bit data before
+ * terminating that command by temporarily deselecting the chip; the next
+ * could send a different nine bit command (re-selecting the chip), and the
+ * last transfer might write some register values.
+ */
+struct spi_ioc_transfer {
+ __u64 tx_buf;
+ __u64 rx_buf;
+
+ __u32 len;
+ __u32 speed_hz;
+
+ __u16 delay_usecs;
+ __u8 bits_per_word;
+ __u8 cs_change;
+ __u32 pad;
+
+ /* If the contents of 'struct spi_ioc_transfer' ever change
+ * incompatibly, then the ioctl number (currently 0) must change;
+ * ioctls with constant size fields get a bit more in the way of
+ * error checking than ones (like this) where that field varies.
+ *
+ * NOTE: struct layout is the same in 64bit and 32bit userspace.
+ */
+};
+
+/* not all platforms use <asm-generic/ioctl.h> or _IOC_TYPECHECK() ... */
+#define SPI_MSGSIZE(N) \
+ ((((N)*(sizeof (struct spi_ioc_transfer))) < (1 << _IOC_SIZEBITS)) \
+ ? ((N)*(sizeof (struct spi_ioc_transfer))) : 0)
+#define SPI_IOC_MESSAGE(N) _IOW(SPI_IOC_MAGIC, 0, char[SPI_MSGSIZE(N)])
+
+
+/* Read / Write of SPI mode (SPI_MODE_0..SPI_MODE_3) */
+#define SPI_IOC_RD_MODE _IOR(SPI_IOC_MAGIC, 1, __u8)
+#define SPI_IOC_WR_MODE _IOW(SPI_IOC_MAGIC, 1, __u8)
+
+/* Read / Write SPI bit justification */
+#define SPI_IOC_RD_LSB_FIRST _IOR(SPI_IOC_MAGIC, 2, __u8)
+#define SPI_IOC_WR_LSB_FIRST _IOW(SPI_IOC_MAGIC, 2, __u8)
+
+/* Read / Write SPI device word length (1..N) */
+#define SPI_IOC_RD_BITS_PER_WORD _IOR(SPI_IOC_MAGIC, 3, __u8)
+#define SPI_IOC_WR_BITS_PER_WORD _IOW(SPI_IOC_MAGIC, 3, __u8)
+
+/* Read / Write SPI device default max speed hz */
+#define SPI_IOC_RD_MAX_SPEED_HZ _IOR(SPI_IOC_MAGIC, 4, __u32)
+#define SPI_IOC_WR_MAX_SPEED_HZ _IOW(SPI_IOC_MAGIC, 4, __u32)
+
+
+
+#endif /* SPIDEV_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/stat.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/stat.h
new file mode 100644
index 0000000..0a9f037
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/stat.h
@@ -0,0 +1,45 @@
+#ifndef _LINUX_STAT_H
+#define _LINUX_STAT_H
+
+
+#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+
+#define S_IFMT 00170000
+#define S_IFSOCK 0140000
+#define S_IFLNK 0120000
+#define S_IFREG 0100000
+#define S_IFBLK 0060000
+#define S_IFDIR 0040000
+#define S_IFCHR 0020000
+#define S_IFIFO 0010000
+#define S_ISUID 0004000
+#define S_ISGID 0002000
+#define S_ISVTX 0001000
+
+#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
+#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
+#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
+#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
+#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
+
+#define S_IRWXU 00700
+#define S_IRUSR 00400
+#define S_IWUSR 00200
+#define S_IXUSR 00100
+
+#define S_IRWXG 00070
+#define S_IRGRP 00040
+#define S_IWGRP 00020
+#define S_IXGRP 00010
+
+#define S_IRWXO 00007
+#define S_IROTH 00004
+#define S_IWOTH 00002
+#define S_IXOTH 00001
+
+#endif
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/stddef.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/stddef.h
new file mode 100644
index 0000000..d12ce1b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/stddef.h
@@ -0,0 +1,14 @@
+#ifndef _LINUX_STDDEF_H
+#define _LINUX_STDDEF_H
+
+
+
+#undef NULL
+#if defined(__cplusplus)
+#define NULL 0
+#else
+#define NULL ((void *)0)
+#endif
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/string.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/string.h
new file mode 100644
index 0000000..d7ed844
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/string.h
@@ -0,0 +1,7 @@
+#ifndef _LINUX_STRING_H_
+#define _LINUX_STRING_H_
+
+/* We don't want strings.h stuff being used by user stuff by accident */
+
+#include <string.h>
+#endif /* _LINUX_STRING_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sunrpc/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sunrpc/..install.cmd
new file mode 100644
index 0000000..58bc60a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sunrpc/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/sunrpc/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/sunrpc /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/sunrpc mips debug.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/sunrpc /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/sunrpc mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/sunrpc/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sunrpc/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sunrpc/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sunrpc/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sunrpc/debug.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sunrpc/debug.h
new file mode 100644
index 0000000..4ead318
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sunrpc/debug.h
@@ -0,0 +1,48 @@
+/*
+ * linux/include/linux/sunrpc/debug.h
+ *
+ * Debugging support for sunrpc module
+ *
+ * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
+ */
+
+#ifndef _LINUX_SUNRPC_DEBUG_H_
+#define _LINUX_SUNRPC_DEBUG_H_
+
+/*
+ * RPC debug facilities
+ */
+#define RPCDBG_XPRT 0x0001
+#define RPCDBG_CALL 0x0002
+#define RPCDBG_DEBUG 0x0004
+#define RPCDBG_NFS 0x0008
+#define RPCDBG_AUTH 0x0010
+#define RPCDBG_BIND 0x0020
+#define RPCDBG_SCHED 0x0040
+#define RPCDBG_TRANS 0x0080
+#define RPCDBG_SVCXPRT 0x0100
+#define RPCDBG_SVCDSP 0x0200
+#define RPCDBG_MISC 0x0400
+#define RPCDBG_CACHE 0x0800
+#define RPCDBG_ALL 0x7fff
+
+
+/*
+ * Declarations for the sysctl debug interface, which allows to read or
+ * change the debug flags for rpc, nfs, nfsd, and lockd. Since the sunrpc
+ * module currently registers its sysctl table dynamically, the sysctl path
+ * for module FOO is <CTL_SUNRPC, CTL_FOODEBUG>.
+ */
+
+enum {
+ CTL_RPCDEBUG = 1,
+ CTL_NFSDEBUG,
+ CTL_NFSDDEBUG,
+ CTL_NLMDEBUG,
+ CTL_SLOTTABLE_UDP,
+ CTL_SLOTTABLE_TCP,
+ CTL_MIN_RESVPORT,
+ CTL_MAX_RESVPORT,
+};
+
+#endif /* _LINUX_SUNRPC_DEBUG_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/suspend_ioctls.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/suspend_ioctls.h
new file mode 100644
index 0000000..0b30382
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/suspend_ioctls.h
@@ -0,0 +1,33 @@
+#ifndef _LINUX_SUSPEND_IOCTLS_H
+#define _LINUX_SUSPEND_IOCTLS_H
+
+#include <linux/types.h>
+/*
+ * This structure is used to pass the values needed for the identification
+ * of the resume swap area from a user space to the kernel via the
+ * SNAPSHOT_SET_SWAP_AREA ioctl
+ */
+struct resume_swap_area {
+ __kernel_loff_t offset;
+ __u32 dev;
+} __attribute__((packed));
+
+#define SNAPSHOT_IOC_MAGIC '3'
+#define SNAPSHOT_FREEZE _IO(SNAPSHOT_IOC_MAGIC, 1)
+#define SNAPSHOT_UNFREEZE _IO(SNAPSHOT_IOC_MAGIC, 2)
+#define SNAPSHOT_ATOMIC_RESTORE _IO(SNAPSHOT_IOC_MAGIC, 4)
+#define SNAPSHOT_FREE _IO(SNAPSHOT_IOC_MAGIC, 5)
+#define SNAPSHOT_FREE_SWAP_PAGES _IO(SNAPSHOT_IOC_MAGIC, 9)
+#define SNAPSHOT_S2RAM _IO(SNAPSHOT_IOC_MAGIC, 11)
+#define SNAPSHOT_SET_SWAP_AREA _IOW(SNAPSHOT_IOC_MAGIC, 13, \
+ struct resume_swap_area)
+#define SNAPSHOT_GET_IMAGE_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 14, __kernel_loff_t)
+#define SNAPSHOT_PLATFORM_SUPPORT _IO(SNAPSHOT_IOC_MAGIC, 15)
+#define SNAPSHOT_POWER_OFF _IO(SNAPSHOT_IOC_MAGIC, 16)
+#define SNAPSHOT_CREATE_IMAGE _IOW(SNAPSHOT_IOC_MAGIC, 17, int)
+#define SNAPSHOT_PREF_IMAGE_SIZE _IO(SNAPSHOT_IOC_MAGIC, 18)
+#define SNAPSHOT_AVAIL_SWAP_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 19, __kernel_loff_t)
+#define SNAPSHOT_ALLOC_SWAP_PAGE _IOR(SNAPSHOT_IOC_MAGIC, 20, __kernel_loff_t)
+#define SNAPSHOT_IOC_MAXNR 20
+
+#endif /* _LINUX_SUSPEND_IOCTLS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/swab.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/swab.h
new file mode 100644
index 0000000..aa4afdd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/swab.h
@@ -0,0 +1,282 @@
+#ifndef _LINUX_SWAB_H
+#define _LINUX_SWAB_H
+
+#include <linux/types.h>
+
+#include <asm/swab.h>
+
+/*
+ * casts are necessary for constants, because we never know how for sure
+ * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
+ */
+#define ___constant_swab16(x) ((__u16)( \
+ (((__u16)(x) & (__u16)0x00ffU) << 8) | \
+ (((__u16)(x) & (__u16)0xff00U) >> 8)))
+
+#define ___constant_swab32(x) ((__u32)( \
+ (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
+ (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
+ (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
+ (((__u32)(x) & (__u32)0xff000000UL) >> 24)))
+
+#define ___constant_swab64(x) ((__u64)( \
+ (((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \
+ (((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \
+ (((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \
+ (((__u64)(x) & (__u64)0x00000000ff000000ULL) << 8) | \
+ (((__u64)(x) & (__u64)0x000000ff00000000ULL) >> 8) | \
+ (((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
+ (((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \
+ (((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56)))
+
+#define ___constant_swahw32(x) ((__u32)( \
+ (((__u32)(x) & (__u32)0x0000ffffUL) << 16) | \
+ (((__u32)(x) & (__u32)0xffff0000UL) >> 16)))
+
+#define ___constant_swahb32(x) ((__u32)( \
+ (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | \
+ (((__u32)(x) & (__u32)0xff00ff00UL) >> 8)))
+
+/*
+ * Implement the following as inlines, but define the interface using
+ * macros to allow constant folding when possible:
+ * ___swab16, ___swab32, ___swab64, ___swahw32, ___swahb32
+ */
+
+static __inline__ __u16 __fswab16(__u16 val)
+{
+#ifdef __arch_swab16
+ return __arch_swab16(val);
+#else
+ return ___constant_swab16(val);
+#endif
+}
+
+static __inline__ __u32 __fswab32(__u32 val)
+{
+#ifdef __arch_swab32
+ return __arch_swab32(val);
+#else
+ return ___constant_swab32(val);
+#endif
+}
+
+static __inline__ __u64 __fswab64(__u64 val)
+{
+#ifdef __arch_swab64
+ return __arch_swab64(val);
+#elif defined(__SWAB_64_THRU_32__)
+ __u32 h = val >> 32;
+ __u32 l = val & ((1ULL << 32) - 1);
+ return (((__u64)__fswab32(l)) << 32) | ((__u64)(__fswab32(h)));
+#else
+ return ___constant_swab64(val);
+#endif
+}
+
+static __inline__ __u32 __fswahw32(__u32 val)
+{
+#ifdef __arch_swahw32
+ return __arch_swahw32(val);
+#else
+ return ___constant_swahw32(val);
+#endif
+}
+
+static __inline__ __u32 __fswahb32(__u32 val)
+{
+#ifdef __arch_swahb32
+ return __arch_swahb32(val);
+#else
+ return ___constant_swahb32(val);
+#endif
+}
+
+/**
+ * __swab16 - return a byteswapped 16-bit value
+ * @x: value to byteswap
+ */
+#define __swab16(x) \
+ (__builtin_constant_p((__u16)(x)) ? \
+ ___constant_swab16(x) : \
+ __fswab16(x))
+
+/**
+ * __swab32 - return a byteswapped 32-bit value
+ * @x: value to byteswap
+ */
+#define __swab32(x) \
+ (__builtin_constant_p((__u32)(x)) ? \
+ ___constant_swab32(x) : \
+ __fswab32(x))
+
+/**
+ * __swab64 - return a byteswapped 64-bit value
+ * @x: value to byteswap
+ */
+#define __swab64(x) \
+ (__builtin_constant_p((__u64)(x)) ? \
+ ___constant_swab64(x) : \
+ __fswab64(x))
+
+/**
+ * __swahw32 - return a word-swapped 32-bit value
+ * @x: value to wordswap
+ *
+ * __swahw32(0x12340000) is 0x00001234
+ */
+#define __swahw32(x) \
+ (__builtin_constant_p((__u32)(x)) ? \
+ ___constant_swahw32(x) : \
+ __fswahw32(x))
+
+/**
+ * __swahb32 - return a high and low byte-swapped 32-bit value
+ * @x: value to byteswap
+ *
+ * __swahb32(0x12345678) is 0x34127856
+ */
+#define __swahb32(x) \
+ (__builtin_constant_p((__u32)(x)) ? \
+ ___constant_swahb32(x) : \
+ __fswahb32(x))
+
+/**
+ * __swab16p - return a byteswapped 16-bit value from a pointer
+ * @p: pointer to a naturally-aligned 16-bit value
+ */
+static __inline__ __u16 __swab16p(const __u16 *p)
+{
+#ifdef __arch_swab16p
+ return __arch_swab16p(p);
+#else
+ return __swab16(*p);
+#endif
+}
+
+/**
+ * __swab32p - return a byteswapped 32-bit value from a pointer
+ * @p: pointer to a naturally-aligned 32-bit value
+ */
+static __inline__ __u32 __swab32p(const __u32 *p)
+{
+#ifdef __arch_swab32p
+ return __arch_swab32p(p);
+#else
+ return __swab32(*p);
+#endif
+}
+
+/**
+ * __swab64p - return a byteswapped 64-bit value from a pointer
+ * @p: pointer to a naturally-aligned 64-bit value
+ */
+static __inline__ __u64 __swab64p(const __u64 *p)
+{
+#ifdef __arch_swab64p
+ return __arch_swab64p(p);
+#else
+ return __swab64(*p);
+#endif
+}
+
+/**
+ * __swahw32p - return a wordswapped 32-bit value from a pointer
+ * @p: pointer to a naturally-aligned 32-bit value
+ *
+ * See __swahw32() for details of wordswapping.
+ */
+static __inline__ __u32 __swahw32p(const __u32 *p)
+{
+#ifdef __arch_swahw32p
+ return __arch_swahw32p(p);
+#else
+ return __swahw32(*p);
+#endif
+}
+
+/**
+ * __swahb32p - return a high and low byteswapped 32-bit value from a pointer
+ * @p: pointer to a naturally-aligned 32-bit value
+ *
+ * See __swahb32() for details of high/low byteswapping.
+ */
+static __inline__ __u32 __swahb32p(const __u32 *p)
+{
+#ifdef __arch_swahb32p
+ return __arch_swahb32p(p);
+#else
+ return __swahb32(*p);
+#endif
+}
+
+/**
+ * __swab16s - byteswap a 16-bit value in-place
+ * @p: pointer to a naturally-aligned 16-bit value
+ */
+static __inline__ void __swab16s(__u16 *p)
+{
+#ifdef __arch_swab16s
+ __arch_swab16s(p);
+#else
+ *p = __swab16p(p);
+#endif
+}
+/**
+ * __swab32s - byteswap a 32-bit value in-place
+ * @p: pointer to a naturally-aligned 32-bit value
+ */
+static __inline__ void __swab32s(__u32 *p)
+{
+#ifdef __arch_swab32s
+ __arch_swab32s(p);
+#else
+ *p = __swab32p(p);
+#endif
+}
+
+/**
+ * __swab64s - byteswap a 64-bit value in-place
+ * @p: pointer to a naturally-aligned 64-bit value
+ */
+static __inline__ void __swab64s(__u64 *p)
+{
+#ifdef __arch_swab64s
+ __arch_swab64s(p);
+#else
+ *p = __swab64p(p);
+#endif
+}
+
+/**
+ * __swahw32s - wordswap a 32-bit value in-place
+ * @p: pointer to a naturally-aligned 32-bit value
+ *
+ * See __swahw32() for details of wordswapping
+ */
+static __inline__ void __swahw32s(__u32 *p)
+{
+#ifdef __arch_swahw32s
+ __arch_swahw32s(p);
+#else
+ *p = __swahw32p(p);
+#endif
+}
+
+/**
+ * __swahb32s - high and low byteswap a 32-bit value in-place
+ * @p: pointer to a naturally-aligned 32-bit value
+ *
+ * See __swahb32() for details of high and low byte swapping
+ */
+static __inline__ void __swahb32s(__u32 *p)
+{
+#ifdef __arch_swahb32s
+ __arch_swahb32s(p);
+#else
+ *p = __swahb32p(p);
+#endif
+}
+
+
+#endif /* _LINUX_SWAB_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/synclink.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/synclink.h
new file mode 100644
index 0000000..b95874b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/synclink.h
@@ -0,0 +1,295 @@
+/*
+ * SyncLink Multiprotocol Serial Adapter Driver
+ *
+ * $Id: synclink.h,v 3.14 2006/07/17 20:15:43 paulkf Exp $
+ *
+ * Copyright (C) 1998-2000 by Microgate Corporation
+ *
+ * Redistribution of this file is permitted under
+ * the terms of the GNU Public License (GPL)
+ */
+
+#ifndef _SYNCLINK_H_
+#define _SYNCLINK_H_
+#define SYNCLINK_H_VERSION 3.6
+
+#include <linux/types.h>
+
+#define BIT0 0x0001
+#define BIT1 0x0002
+#define BIT2 0x0004
+#define BIT3 0x0008
+#define BIT4 0x0010
+#define BIT5 0x0020
+#define BIT6 0x0040
+#define BIT7 0x0080
+#define BIT8 0x0100
+#define BIT9 0x0200
+#define BIT10 0x0400
+#define BIT11 0x0800
+#define BIT12 0x1000
+#define BIT13 0x2000
+#define BIT14 0x4000
+#define BIT15 0x8000
+#define BIT16 0x00010000
+#define BIT17 0x00020000
+#define BIT18 0x00040000
+#define BIT19 0x00080000
+#define BIT20 0x00100000
+#define BIT21 0x00200000
+#define BIT22 0x00400000
+#define BIT23 0x00800000
+#define BIT24 0x01000000
+#define BIT25 0x02000000
+#define BIT26 0x04000000
+#define BIT27 0x08000000
+#define BIT28 0x10000000
+#define BIT29 0x20000000
+#define BIT30 0x40000000
+#define BIT31 0x80000000
+
+
+#define HDLC_MAX_FRAME_SIZE 65535
+#define MAX_ASYNC_TRANSMIT 4096
+#define MAX_ASYNC_BUFFER_SIZE 4096
+
+#define ASYNC_PARITY_NONE 0
+#define ASYNC_PARITY_EVEN 1
+#define ASYNC_PARITY_ODD 2
+#define ASYNC_PARITY_SPACE 3
+
+#define HDLC_FLAG_UNDERRUN_ABORT7 0x0000
+#define HDLC_FLAG_UNDERRUN_ABORT15 0x0001
+#define HDLC_FLAG_UNDERRUN_FLAG 0x0002
+#define HDLC_FLAG_UNDERRUN_CRC 0x0004
+#define HDLC_FLAG_SHARE_ZERO 0x0010
+#define HDLC_FLAG_AUTO_CTS 0x0020
+#define HDLC_FLAG_AUTO_DCD 0x0040
+#define HDLC_FLAG_AUTO_RTS 0x0080
+#define HDLC_FLAG_RXC_DPLL 0x0100
+#define HDLC_FLAG_RXC_BRG 0x0200
+#define HDLC_FLAG_RXC_TXCPIN 0x8000
+#define HDLC_FLAG_RXC_RXCPIN 0x0000
+#define HDLC_FLAG_TXC_DPLL 0x0400
+#define HDLC_FLAG_TXC_BRG 0x0800
+#define HDLC_FLAG_TXC_TXCPIN 0x0000
+#define HDLC_FLAG_TXC_RXCPIN 0x0008
+#define HDLC_FLAG_DPLL_DIV8 0x1000
+#define HDLC_FLAG_DPLL_DIV16 0x2000
+#define HDLC_FLAG_DPLL_DIV32 0x0000
+#define HDLC_FLAG_HDLC_LOOPMODE 0x4000
+
+#define HDLC_CRC_NONE 0
+#define HDLC_CRC_16_CCITT 1
+#define HDLC_CRC_32_CCITT 2
+#define HDLC_CRC_MASK 0x00ff
+#define HDLC_CRC_RETURN_EX 0x8000
+
+#define RX_OK 0
+#define RX_CRC_ERROR 1
+
+#define HDLC_TXIDLE_FLAGS 0
+#define HDLC_TXIDLE_ALT_ZEROS_ONES 1
+#define HDLC_TXIDLE_ZEROS 2
+#define HDLC_TXIDLE_ONES 3
+#define HDLC_TXIDLE_ALT_MARK_SPACE 4
+#define HDLC_TXIDLE_SPACE 5
+#define HDLC_TXIDLE_MARK 6
+#define HDLC_TXIDLE_CUSTOM_8 0x10000000
+#define HDLC_TXIDLE_CUSTOM_16 0x20000000
+
+#define HDLC_ENCODING_NRZ 0
+#define HDLC_ENCODING_NRZB 1
+#define HDLC_ENCODING_NRZI_MARK 2
+#define HDLC_ENCODING_NRZI_SPACE 3
+#define HDLC_ENCODING_NRZI HDLC_ENCODING_NRZI_SPACE
+#define HDLC_ENCODING_BIPHASE_MARK 4
+#define HDLC_ENCODING_BIPHASE_SPACE 5
+#define HDLC_ENCODING_BIPHASE_LEVEL 6
+#define HDLC_ENCODING_DIFF_BIPHASE_LEVEL 7
+
+#define HDLC_PREAMBLE_LENGTH_8BITS 0
+#define HDLC_PREAMBLE_LENGTH_16BITS 1
+#define HDLC_PREAMBLE_LENGTH_32BITS 2
+#define HDLC_PREAMBLE_LENGTH_64BITS 3
+
+#define HDLC_PREAMBLE_PATTERN_NONE 0
+#define HDLC_PREAMBLE_PATTERN_ZEROS 1
+#define HDLC_PREAMBLE_PATTERN_FLAGS 2
+#define HDLC_PREAMBLE_PATTERN_10 3
+#define HDLC_PREAMBLE_PATTERN_01 4
+#define HDLC_PREAMBLE_PATTERN_ONES 5
+
+#define MGSL_MODE_ASYNC 1
+#define MGSL_MODE_HDLC 2
+#define MGSL_MODE_MONOSYNC 3
+#define MGSL_MODE_BISYNC 4
+#define MGSL_MODE_RAW 6
+#define MGSL_MODE_BASE_CLOCK 7
+
+#define MGSL_BUS_TYPE_ISA 1
+#define MGSL_BUS_TYPE_EISA 2
+#define MGSL_BUS_TYPE_PCI 5
+
+#define MGSL_INTERFACE_MASK 0xf
+#define MGSL_INTERFACE_DISABLE 0
+#define MGSL_INTERFACE_RS232 1
+#define MGSL_INTERFACE_V35 2
+#define MGSL_INTERFACE_RS422 3
+#define MGSL_INTERFACE_RTS_EN 0x10
+#define MGSL_INTERFACE_LL 0x20
+#define MGSL_INTERFACE_RL 0x40
+#define MGSL_INTERFACE_MSB_FIRST 0x80
+
+typedef struct _MGSL_PARAMS
+{
+ /* Common */
+
+ unsigned long mode; /* Asynchronous or HDLC */
+ unsigned char loopback; /* internal loopback mode */
+
+ /* HDLC Only */
+
+ unsigned short flags;
+ unsigned char encoding; /* NRZ, NRZI, etc. */
+ unsigned long clock_speed; /* external clock speed in bits per second */
+ unsigned char addr_filter; /* receive HDLC address filter, 0xFF = disable */
+ unsigned short crc_type; /* None, CRC16-CCITT, or CRC32-CCITT */
+ unsigned char preamble_length;
+ unsigned char preamble;
+
+ /* Async Only */
+
+ unsigned long data_rate; /* bits per second */
+ unsigned char data_bits; /* 7 or 8 data bits */
+ unsigned char stop_bits; /* 1 or 2 stop bits */
+ unsigned char parity; /* none, even, or odd */
+
+} MGSL_PARAMS, *PMGSL_PARAMS;
+
+#define MICROGATE_VENDOR_ID 0x13c0
+#define SYNCLINK_DEVICE_ID 0x0010
+#define MGSCC_DEVICE_ID 0x0020
+#define SYNCLINK_SCA_DEVICE_ID 0x0030
+#define SYNCLINK_GT_DEVICE_ID 0x0070
+#define SYNCLINK_GT4_DEVICE_ID 0x0080
+#define SYNCLINK_AC_DEVICE_ID 0x0090
+#define SYNCLINK_GT2_DEVICE_ID 0x00A0
+#define MGSL_MAX_SERIAL_NUMBER 30
+
+/*
+** device diagnostics status
+*/
+
+#define DiagStatus_OK 0
+#define DiagStatus_AddressFailure 1
+#define DiagStatus_AddressConflict 2
+#define DiagStatus_IrqFailure 3
+#define DiagStatus_IrqConflict 4
+#define DiagStatus_DmaFailure 5
+#define DiagStatus_DmaConflict 6
+#define DiagStatus_PciAdapterNotFound 7
+#define DiagStatus_CantAssignPciResources 8
+#define DiagStatus_CantAssignPciMemAddr 9
+#define DiagStatus_CantAssignPciIoAddr 10
+#define DiagStatus_CantAssignPciIrq 11
+#define DiagStatus_MemoryError 12
+
+#define SerialSignal_DCD 0x01 /* Data Carrier Detect */
+#define SerialSignal_TXD 0x02 /* Transmit Data */
+#define SerialSignal_RI 0x04 /* Ring Indicator */
+#define SerialSignal_RXD 0x08 /* Receive Data */
+#define SerialSignal_CTS 0x10 /* Clear to Send */
+#define SerialSignal_RTS 0x20 /* Request to Send */
+#define SerialSignal_DSR 0x40 /* Data Set Ready */
+#define SerialSignal_DTR 0x80 /* Data Terminal Ready */
+
+
+/*
+ * Counters of the input lines (CTS, DSR, RI, CD) interrupts
+ */
+struct mgsl_icount {
+ __u32 cts, dsr, rng, dcd, tx, rx;
+ __u32 frame, parity, overrun, brk;
+ __u32 buf_overrun;
+ __u32 txok;
+ __u32 txunder;
+ __u32 txabort;
+ __u32 txtimeout;
+ __u32 rxshort;
+ __u32 rxlong;
+ __u32 rxabort;
+ __u32 rxover;
+ __u32 rxcrc;
+ __u32 rxok;
+ __u32 exithunt;
+ __u32 rxidle;
+};
+
+struct gpio_desc {
+ __u32 state;
+ __u32 smask;
+ __u32 dir;
+ __u32 dmask;
+};
+
+#define DEBUG_LEVEL_DATA 1
+#define DEBUG_LEVEL_ERROR 2
+#define DEBUG_LEVEL_INFO 3
+#define DEBUG_LEVEL_BH 4
+#define DEBUG_LEVEL_ISR 5
+
+/*
+** Event bit flags for use with MgslWaitEvent
+*/
+
+#define MgslEvent_DsrActive 0x0001
+#define MgslEvent_DsrInactive 0x0002
+#define MgslEvent_Dsr 0x0003
+#define MgslEvent_CtsActive 0x0004
+#define MgslEvent_CtsInactive 0x0008
+#define MgslEvent_Cts 0x000c
+#define MgslEvent_DcdActive 0x0010
+#define MgslEvent_DcdInactive 0x0020
+#define MgslEvent_Dcd 0x0030
+#define MgslEvent_RiActive 0x0040
+#define MgslEvent_RiInactive 0x0080
+#define MgslEvent_Ri 0x00c0
+#define MgslEvent_ExitHuntMode 0x0100
+#define MgslEvent_IdleReceived 0x0200
+
+/* Private IOCTL codes:
+ *
+ * MGSL_IOCSPARAMS set MGSL_PARAMS structure values
+ * MGSL_IOCGPARAMS get current MGSL_PARAMS structure values
+ * MGSL_IOCSTXIDLE set current transmit idle mode
+ * MGSL_IOCGTXIDLE get current transmit idle mode
+ * MGSL_IOCTXENABLE enable or disable transmitter
+ * MGSL_IOCRXENABLE enable or disable receiver
+ * MGSL_IOCTXABORT abort transmitting frame (HDLC)
+ * MGSL_IOCGSTATS return current statistics
+ * MGSL_IOCWAITEVENT wait for specified event to occur
+ * MGSL_LOOPTXDONE transmit in HDLC LoopMode done
+ * MGSL_IOCSIF set the serial interface type
+ * MGSL_IOCGIF get the serial interface type
+ */
+#define MGSL_MAGIC_IOC 'm'
+#define MGSL_IOCSPARAMS _IOW(MGSL_MAGIC_IOC,0,struct _MGSL_PARAMS)
+#define MGSL_IOCGPARAMS _IOR(MGSL_MAGIC_IOC,1,struct _MGSL_PARAMS)
+#define MGSL_IOCSTXIDLE _IO(MGSL_MAGIC_IOC,2)
+#define MGSL_IOCGTXIDLE _IO(MGSL_MAGIC_IOC,3)
+#define MGSL_IOCTXENABLE _IO(MGSL_MAGIC_IOC,4)
+#define MGSL_IOCRXENABLE _IO(MGSL_MAGIC_IOC,5)
+#define MGSL_IOCTXABORT _IO(MGSL_MAGIC_IOC,6)
+#define MGSL_IOCGSTATS _IO(MGSL_MAGIC_IOC,7)
+#define MGSL_IOCWAITEVENT _IOWR(MGSL_MAGIC_IOC,8,int)
+#define MGSL_IOCCLRMODCOUNT _IO(MGSL_MAGIC_IOC,15)
+#define MGSL_IOCLOOPTXDONE _IO(MGSL_MAGIC_IOC,9)
+#define MGSL_IOCSIF _IO(MGSL_MAGIC_IOC,10)
+#define MGSL_IOCGIF _IO(MGSL_MAGIC_IOC,11)
+#define MGSL_IOCSGPIO _IOW(MGSL_MAGIC_IOC,16,struct gpio_desc)
+#define MGSL_IOCGGPIO _IOR(MGSL_MAGIC_IOC,17,struct gpio_desc)
+#define MGSL_IOCWAITGPIO _IOWR(MGSL_MAGIC_IOC,18,struct gpio_desc)
+
+
+#endif /* _SYNCLINK_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sysctl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sysctl.h
new file mode 100644
index 0000000..3e56945
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/sysctl.h
@@ -0,0 +1,940 @@
+/*
+ * sysctl.h: General linux system control interface
+ *
+ * Begun 24 March 1995, Stephen Tweedie
+ *
+ ****************************************************************
+ ****************************************************************
+ **
+ ** WARNING:
+ ** The values in this file are exported to user space via
+ ** the sysctl() binary interface. Do *NOT* change the
+ ** numbering of any existing values here, and do not change
+ ** any numbers within any one set of values. If you have to
+ ** redefine an existing interface, use a new number for it.
+ ** The kernel will then return -ENOTDIR to any application using
+ ** the old binary interface.
+ **
+ ** For new interfaces unless you really need a binary number
+ ** please use CTL_UNNUMBERED.
+ **
+ ****************************************************************
+ ****************************************************************
+ */
+
+#ifndef _LINUX_SYSCTL_H
+#define _LINUX_SYSCTL_H
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+
+
+struct file;
+struct completion;
+
+#define CTL_MAXNAME 10 /* how many path components do we allow in a
+ call to sysctl? In other words, what is
+ the largest acceptable value for the nlen
+ member of a struct __sysctl_args to have? */
+
+struct __sysctl_args {
+ int *name;
+ int nlen;
+ void *oldval;
+ size_t *oldlenp;
+ void *newval;
+ size_t newlen;
+ unsigned long __unused[4];
+};
+
+/* Define sysctl names first */
+
+/* Top-level names: */
+
+/* For internal pattern-matching use only: */
+
+enum
+{
+ CTL_KERN=1, /* General kernel info and control */
+ CTL_VM=2, /* VM management */
+ CTL_NET=3, /* Networking */
+ CTL_PROC=4, /* removal breaks strace(1) compilation */
+ CTL_FS=5, /* Filesystems */
+ CTL_DEBUG=6, /* Debugging */
+ CTL_DEV=7, /* Devices */
+ CTL_BUS=8, /* Busses */
+ CTL_ABI=9, /* Binary emulation */
+ CTL_CPU=10, /* CPU stuff (speed scaling, etc) */
+ CTL_ARLAN=254, /* arlan wireless driver */
+ CTL_S390DBF=5677, /* s390 debug */
+ CTL_SUNRPC=7249, /* sunrpc debug */
+ CTL_PM=9899, /* frv power management */
+ CTL_FRV=9898, /* frv specific sysctls */
+};
+
+/* CTL_BUS names: */
+enum
+{
+ CTL_BUS_ISA=1 /* ISA */
+};
+
+/* /proc/sys/fs/inotify/ */
+enum
+{
+ INOTIFY_MAX_USER_INSTANCES=1, /* max instances per user */
+ INOTIFY_MAX_USER_WATCHES=2, /* max watches per user */
+ INOTIFY_MAX_QUEUED_EVENTS=3 /* max queued events per instance */
+};
+
+/* CTL_KERN names: */
+enum
+{
+ KERN_OSTYPE=1, /* string: system version */
+ KERN_OSRELEASE=2, /* string: system release */
+ KERN_OSREV=3, /* int: system revision */
+ KERN_VERSION=4, /* string: compile time info */
+ KERN_SECUREMASK=5, /* struct: maximum rights mask */
+ KERN_PROF=6, /* table: profiling information */
+ KERN_NODENAME=7,
+ KERN_DOMAINNAME=8,
+
+ KERN_PANIC=15, /* int: panic timeout */
+ KERN_REALROOTDEV=16, /* real root device to mount after initrd */
+
+ KERN_SPARC_REBOOT=21, /* reboot command on Sparc */
+ KERN_CTLALTDEL=22, /* int: allow ctl-alt-del to reboot */
+ KERN_PRINTK=23, /* struct: control printk logging parameters */
+ KERN_NAMETRANS=24, /* Name translation */
+ KERN_PPC_HTABRECLAIM=25, /* turn htab reclaimation on/off on PPC */
+ KERN_PPC_ZEROPAGED=26, /* turn idle page zeroing on/off on PPC */
+ KERN_PPC_POWERSAVE_NAP=27, /* use nap mode for power saving */
+ KERN_MODPROBE=28,
+ KERN_SG_BIG_BUFF=29,
+ KERN_ACCT=30, /* BSD process accounting parameters */
+ KERN_PPC_L2CR=31, /* l2cr register on PPC */
+
+ KERN_RTSIGNR=32, /* Number of rt sigs queued */
+ KERN_RTSIGMAX=33, /* Max queuable */
+
+ KERN_SHMMAX=34, /* long: Maximum shared memory segment */
+ KERN_MSGMAX=35, /* int: Maximum size of a messege */
+ KERN_MSGMNB=36, /* int: Maximum message queue size */
+ KERN_MSGPOOL=37, /* int: Maximum system message pool size */
+ KERN_SYSRQ=38, /* int: Sysreq enable */
+ KERN_MAX_THREADS=39, /* int: Maximum nr of threads in the system */
+ KERN_RANDOM=40, /* Random driver */
+ KERN_SHMALL=41, /* int: Maximum size of shared memory */
+ KERN_MSGMNI=42, /* int: msg queue identifiers */
+ KERN_SEM=43, /* struct: sysv semaphore limits */
+ KERN_SPARC_STOP_A=44, /* int: Sparc Stop-A enable */
+ KERN_SHMMNI=45, /* int: shm array identifiers */
+ KERN_OVERFLOWUID=46, /* int: overflow UID */
+ KERN_OVERFLOWGID=47, /* int: overflow GID */
+ KERN_SHMPATH=48, /* string: path to shm fs */
+ KERN_HOTPLUG=49, /* string: path to uevent helper (deprecated) */
+ KERN_IEEE_EMULATION_WARNINGS=50, /* int: unimplemented ieee instructions */
+ KERN_S390_USER_DEBUG_LOGGING=51, /* int: dumps of user faults */
+ KERN_CORE_USES_PID=52, /* int: use core or core.%pid */
+ KERN_TAINTED=53, /* int: various kernel tainted flags */
+ KERN_CADPID=54, /* int: PID of the process to notify on CAD */
+ KERN_PIDMAX=55, /* int: PID # limit */
+ KERN_CORE_PATTERN=56, /* string: pattern for core-file names */
+ KERN_PANIC_ON_OOPS=57, /* int: whether we will panic on an oops */
+ KERN_HPPA_PWRSW=58, /* int: hppa soft-power enable */
+ KERN_HPPA_UNALIGNED=59, /* int: hppa unaligned-trap enable */
+ KERN_PRINTK_RATELIMIT=60, /* int: tune printk ratelimiting */
+ KERN_PRINTK_RATELIMIT_BURST=61, /* int: tune printk ratelimiting */
+ KERN_PTY=62, /* dir: pty driver */
+ KERN_NGROUPS_MAX=63, /* int: NGROUPS_MAX */
+ KERN_SPARC_SCONS_PWROFF=64, /* int: serial console power-off halt */
+ KERN_HZ_TIMER=65, /* int: hz timer on or off */
+ KERN_UNKNOWN_NMI_PANIC=66, /* int: unknown nmi panic flag */
+ KERN_BOOTLOADER_TYPE=67, /* int: boot loader type */
+ KERN_RANDOMIZE=68, /* int: randomize virtual address space */
+ KERN_SETUID_DUMPABLE=69, /* int: behaviour of dumps for setuid core */
+ KERN_SPIN_RETRY=70, /* int: number of spinlock retries */
+ KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */
+ KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */
+ KERN_COMPAT_LOG=73, /* int: print compat layer messages */
+ KERN_MAX_LOCK_DEPTH=74,
+ KERN_NMI_WATCHDOG=75, /* int: enable/disable nmi watchdog */
+ KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */
+};
+
+
+
+/* CTL_VM names: */
+enum
+{
+ VM_UNUSED1=1, /* was: struct: Set vm swapping control */
+ VM_UNUSED2=2, /* was; int: Linear or sqrt() swapout for hogs */
+ VM_UNUSED3=3, /* was: struct: Set free page thresholds */
+ VM_UNUSED4=4, /* Spare */
+ VM_OVERCOMMIT_MEMORY=5, /* Turn off the virtual memory safety limit */
+ VM_UNUSED5=6, /* was: struct: Set buffer memory thresholds */
+ VM_UNUSED7=7, /* was: struct: Set cache memory thresholds */
+ VM_UNUSED8=8, /* was: struct: Control kswapd behaviour */
+ VM_UNUSED9=9, /* was: struct: Set page table cache parameters */
+ VM_PAGE_CLUSTER=10, /* int: set number of pages to swap together */
+ VM_DIRTY_BACKGROUND=11, /* dirty_background_ratio */
+ VM_DIRTY_RATIO=12, /* dirty_ratio */
+ VM_DIRTY_WB_CS=13, /* dirty_writeback_centisecs */
+ VM_DIRTY_EXPIRE_CS=14, /* dirty_expire_centisecs */
+ VM_NR_PDFLUSH_THREADS=15, /* nr_pdflush_threads */
+ VM_OVERCOMMIT_RATIO=16, /* percent of RAM to allow overcommit in */
+ VM_PAGEBUF=17, /* struct: Control pagebuf parameters */
+ VM_HUGETLB_PAGES=18, /* int: Number of available Huge Pages */
+ VM_SWAPPINESS=19, /* Tendency to steal mapped memory */
+ VM_LOWMEM_RESERVE_RATIO=20,/* reservation ratio for lower memory zones */
+ VM_MIN_FREE_KBYTES=21, /* Minimum free kilobytes to maintain */
+ VM_MAX_MAP_COUNT=22, /* int: Maximum number of mmaps/address-space */
+ VM_LAPTOP_MODE=23, /* vm laptop mode */
+ VM_BLOCK_DUMP=24, /* block dump mode */
+ VM_HUGETLB_GROUP=25, /* permitted hugetlb group */
+ VM_VFS_CACHE_PRESSURE=26, /* dcache/icache reclaim pressure */
+ VM_LEGACY_VA_LAYOUT=27, /* legacy/compatibility virtual address space layout */
+ VM_SWAP_TOKEN_TIMEOUT=28, /* default time for token time out */
+ VM_DROP_PAGECACHE=29, /* int: nuke lots of pagecache */
+ VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */
+ VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */
+ VM_MIN_UNMAPPED=32, /* Set min percent of unmapped pages */
+ VM_PANIC_ON_OOM=33, /* panic at out-of-memory */
+ VM_VDSO_ENABLED=34, /* map VDSO into new processes? */
+ VM_MIN_SLAB=35, /* Percent pages ignored by zone reclaim */
+};
+
+
+/* CTL_NET names: */
+enum
+{
+ NET_CORE=1,
+ NET_ETHER=2,
+ NET_802=3,
+ NET_UNIX=4,
+ NET_IPV4=5,
+ NET_IPX=6,
+ NET_ATALK=7,
+ NET_NETROM=8,
+ NET_AX25=9,
+ NET_BRIDGE=10,
+ NET_ROSE=11,
+ NET_IPV6=12,
+ NET_X25=13,
+ NET_TR=14,
+ NET_DECNET=15,
+ NET_ECONET=16,
+ NET_SCTP=17,
+ NET_LLC=18,
+ NET_NETFILTER=19,
+ NET_DCCP=20,
+ NET_IRDA=412,
+};
+
+/* /proc/sys/kernel/random */
+enum
+{
+ RANDOM_POOLSIZE=1,
+ RANDOM_ENTROPY_COUNT=2,
+ RANDOM_READ_THRESH=3,
+ RANDOM_WRITE_THRESH=4,
+ RANDOM_BOOT_ID=5,
+ RANDOM_UUID=6
+};
+
+/* /proc/sys/kernel/pty */
+enum
+{
+ PTY_MAX=1,
+ PTY_NR=2
+};
+
+/* /proc/sys/bus/isa */
+enum
+{
+ BUS_ISA_MEM_BASE=1,
+ BUS_ISA_PORT_BASE=2,
+ BUS_ISA_PORT_SHIFT=3
+};
+
+/* /proc/sys/net/core */
+enum
+{
+ NET_CORE_WMEM_MAX=1,
+ NET_CORE_RMEM_MAX=2,
+ NET_CORE_WMEM_DEFAULT=3,
+ NET_CORE_RMEM_DEFAULT=4,
+/* was NET_CORE_DESTROY_DELAY */
+ NET_CORE_MAX_BACKLOG=6,
+ NET_CORE_FASTROUTE=7,
+ NET_CORE_MSG_COST=8,
+ NET_CORE_MSG_BURST=9,
+ NET_CORE_OPTMEM_MAX=10,
+ NET_CORE_HOT_LIST_LENGTH=11,
+ NET_CORE_DIVERT_VERSION=12,
+ NET_CORE_NO_CONG_THRESH=13,
+ NET_CORE_NO_CONG=14,
+ NET_CORE_LO_CONG=15,
+ NET_CORE_MOD_CONG=16,
+ NET_CORE_DEV_WEIGHT=17,
+ NET_CORE_SOMAXCONN=18,
+ NET_CORE_BUDGET=19,
+ NET_CORE_AEVENT_ETIME=20,
+ NET_CORE_AEVENT_RSEQTH=21,
+ NET_CORE_WARNINGS=22,
+};
+
+/* /proc/sys/net/ethernet */
+
+/* /proc/sys/net/802 */
+
+/* /proc/sys/net/unix */
+
+enum
+{
+ NET_UNIX_DESTROY_DELAY=1,
+ NET_UNIX_DELETE_DELAY=2,
+ NET_UNIX_MAX_DGRAM_QLEN=3,
+};
+
+/* /proc/sys/net/netfilter */
+enum
+{
+ NET_NF_CONNTRACK_MAX=1,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
+ NET_NF_CONNTRACK_UDP_TIMEOUT=10,
+ NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
+ NET_NF_CONNTRACK_ICMP_TIMEOUT=12,
+ NET_NF_CONNTRACK_GENERIC_TIMEOUT=13,
+ NET_NF_CONNTRACK_BUCKETS=14,
+ NET_NF_CONNTRACK_LOG_INVALID=15,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16,
+ NET_NF_CONNTRACK_TCP_LOOSE=17,
+ NET_NF_CONNTRACK_TCP_BE_LIBERAL=18,
+ NET_NF_CONNTRACK_TCP_MAX_RETRANS=19,
+ NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20,
+ NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21,
+ NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22,
+ NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23,
+ NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24,
+ NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
+ NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
+ NET_NF_CONNTRACK_COUNT=27,
+ NET_NF_CONNTRACK_ICMPV6_TIMEOUT=28,
+ NET_NF_CONNTRACK_FRAG6_TIMEOUT=29,
+ NET_NF_CONNTRACK_FRAG6_LOW_THRESH=30,
+ NET_NF_CONNTRACK_FRAG6_HIGH_THRESH=31,
+ NET_NF_CONNTRACK_CHECKSUM=32,
+};
+
+/* /proc/sys/net/ipv4 */
+enum
+{
+ /* v2.0 compatibile variables */
+ NET_IPV4_FORWARD=8,
+ NET_IPV4_DYNADDR=9,
+
+ NET_IPV4_CONF=16,
+ NET_IPV4_NEIGH=17,
+ NET_IPV4_ROUTE=18,
+ NET_IPV4_FIB_HASH=19,
+ NET_IPV4_NETFILTER=20,
+
+ NET_IPV4_TCP_TIMESTAMPS=33,
+ NET_IPV4_TCP_WINDOW_SCALING=34,
+ NET_IPV4_TCP_SACK=35,
+ NET_IPV4_TCP_RETRANS_COLLAPSE=36,
+ NET_IPV4_DEFAULT_TTL=37,
+ NET_IPV4_AUTOCONFIG=38,
+ NET_IPV4_NO_PMTU_DISC=39,
+ NET_IPV4_TCP_SYN_RETRIES=40,
+ NET_IPV4_IPFRAG_HIGH_THRESH=41,
+ NET_IPV4_IPFRAG_LOW_THRESH=42,
+ NET_IPV4_IPFRAG_TIME=43,
+ NET_IPV4_TCP_MAX_KA_PROBES=44,
+ NET_IPV4_TCP_KEEPALIVE_TIME=45,
+ NET_IPV4_TCP_KEEPALIVE_PROBES=46,
+ NET_IPV4_TCP_RETRIES1=47,
+ NET_IPV4_TCP_RETRIES2=48,
+ NET_IPV4_TCP_FIN_TIMEOUT=49,
+ NET_IPV4_IP_MASQ_DEBUG=50,
+ NET_TCP_SYNCOOKIES=51,
+ NET_TCP_STDURG=52,
+ NET_TCP_RFC1337=53,
+ NET_TCP_SYN_TAILDROP=54,
+ NET_TCP_MAX_SYN_BACKLOG=55,
+ NET_IPV4_LOCAL_PORT_RANGE=56,
+ NET_IPV4_ICMP_ECHO_IGNORE_ALL=57,
+ NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS=58,
+ NET_IPV4_ICMP_SOURCEQUENCH_RATE=59,
+ NET_IPV4_ICMP_DESTUNREACH_RATE=60,
+ NET_IPV4_ICMP_TIMEEXCEED_RATE=61,
+ NET_IPV4_ICMP_PARAMPROB_RATE=62,
+ NET_IPV4_ICMP_ECHOREPLY_RATE=63,
+ NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES=64,
+ NET_IPV4_IGMP_MAX_MEMBERSHIPS=65,
+ NET_TCP_TW_RECYCLE=66,
+ NET_IPV4_ALWAYS_DEFRAG=67,
+ NET_IPV4_TCP_KEEPALIVE_INTVL=68,
+ NET_IPV4_INET_PEER_THRESHOLD=69,
+ NET_IPV4_INET_PEER_MINTTL=70,
+ NET_IPV4_INET_PEER_MAXTTL=71,
+ NET_IPV4_INET_PEER_GC_MINTIME=72,
+ NET_IPV4_INET_PEER_GC_MAXTIME=73,
+ NET_TCP_ORPHAN_RETRIES=74,
+ NET_TCP_ABORT_ON_OVERFLOW=75,
+ NET_TCP_SYNACK_RETRIES=76,
+ NET_TCP_MAX_ORPHANS=77,
+ NET_TCP_MAX_TW_BUCKETS=78,
+ NET_TCP_FACK=79,
+ NET_TCP_REORDERING=80,
+ NET_TCP_ECN=81,
+ NET_TCP_DSACK=82,
+ NET_TCP_MEM=83,
+ NET_TCP_WMEM=84,
+ NET_TCP_RMEM=85,
+ NET_TCP_APP_WIN=86,
+ NET_TCP_ADV_WIN_SCALE=87,
+ NET_IPV4_NONLOCAL_BIND=88,
+ NET_IPV4_ICMP_RATELIMIT=89,
+ NET_IPV4_ICMP_RATEMASK=90,
+ NET_TCP_TW_REUSE=91,
+ NET_TCP_FRTO=92,
+ NET_TCP_LOW_LATENCY=93,
+ NET_IPV4_IPFRAG_SECRET_INTERVAL=94,
+ NET_IPV4_IGMP_MAX_MSF=96,
+ NET_TCP_NO_METRICS_SAVE=97,
+ NET_TCP_DEFAULT_WIN_SCALE=105,
+ NET_TCP_MODERATE_RCVBUF=106,
+ NET_TCP_TSO_WIN_DIVISOR=107,
+ NET_TCP_BIC_BETA=108,
+ NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109,
+ NET_TCP_CONG_CONTROL=110,
+ NET_TCP_ABC=111,
+ NET_IPV4_IPFRAG_MAX_DIST=112,
+ NET_TCP_MTU_PROBING=113,
+ NET_TCP_BASE_MSS=114,
+ NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115,
+ NET_TCP_DMA_COPYBREAK=116,
+ NET_TCP_SLOW_START_AFTER_IDLE=117,
+ NET_CIPSOV4_CACHE_ENABLE=118,
+ NET_CIPSOV4_CACHE_BUCKET_SIZE=119,
+ NET_CIPSOV4_RBM_OPTFMT=120,
+ NET_CIPSOV4_RBM_STRICTVALID=121,
+ NET_TCP_AVAIL_CONG_CONTROL=122,
+ NET_TCP_ALLOWED_CONG_CONTROL=123,
+ NET_TCP_MAX_SSTHRESH=124,
+ NET_TCP_FRTO_RESPONSE=125,
+};
+
+enum {
+ NET_IPV4_ROUTE_FLUSH=1,
+ NET_IPV4_ROUTE_MIN_DELAY=2, /* obsolete since 2.6.25 */
+ NET_IPV4_ROUTE_MAX_DELAY=3, /* obsolete since 2.6.25 */
+ NET_IPV4_ROUTE_GC_THRESH=4,
+ NET_IPV4_ROUTE_MAX_SIZE=5,
+ NET_IPV4_ROUTE_GC_MIN_INTERVAL=6,
+ NET_IPV4_ROUTE_GC_TIMEOUT=7,
+ NET_IPV4_ROUTE_GC_INTERVAL=8,
+ NET_IPV4_ROUTE_REDIRECT_LOAD=9,
+ NET_IPV4_ROUTE_REDIRECT_NUMBER=10,
+ NET_IPV4_ROUTE_REDIRECT_SILENCE=11,
+ NET_IPV4_ROUTE_ERROR_COST=12,
+ NET_IPV4_ROUTE_ERROR_BURST=13,
+ NET_IPV4_ROUTE_GC_ELASTICITY=14,
+ NET_IPV4_ROUTE_MTU_EXPIRES=15,
+ NET_IPV4_ROUTE_MIN_PMTU=16,
+ NET_IPV4_ROUTE_MIN_ADVMSS=17,
+ NET_IPV4_ROUTE_SECRET_INTERVAL=18,
+ NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS=19,
+};
+
+enum
+{
+ NET_PROTO_CONF_ALL=-2,
+ NET_PROTO_CONF_DEFAULT=-3
+
+ /* And device ifindices ... */
+};
+
+enum
+{
+ NET_IPV4_CONF_FORWARDING=1,
+ NET_IPV4_CONF_MC_FORWARDING=2,
+ NET_IPV4_CONF_PROXY_ARP=3,
+ NET_IPV4_CONF_ACCEPT_REDIRECTS=4,
+ NET_IPV4_CONF_SECURE_REDIRECTS=5,
+ NET_IPV4_CONF_SEND_REDIRECTS=6,
+ NET_IPV4_CONF_SHARED_MEDIA=7,
+ NET_IPV4_CONF_RP_FILTER=8,
+ NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE=9,
+ NET_IPV4_CONF_BOOTP_RELAY=10,
+ NET_IPV4_CONF_LOG_MARTIANS=11,
+ NET_IPV4_CONF_TAG=12,
+ NET_IPV4_CONF_ARPFILTER=13,
+ NET_IPV4_CONF_MEDIUM_ID=14,
+ NET_IPV4_CONF_NOXFRM=15,
+ NET_IPV4_CONF_NOPOLICY=16,
+ NET_IPV4_CONF_FORCE_IGMP_VERSION=17,
+ NET_IPV4_CONF_ARP_ANNOUNCE=18,
+ NET_IPV4_CONF_ARP_IGNORE=19,
+ NET_IPV4_CONF_PROMOTE_SECONDARIES=20,
+ NET_IPV4_CONF_ARP_ACCEPT=21,
+ NET_IPV4_CONF_ARP_NOTIFY=22,
+ __NET_IPV4_CONF_MAX
+};
+
+/* /proc/sys/net/ipv4/netfilter */
+enum
+{
+ NET_IPV4_NF_CONNTRACK_MAX=1,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
+ NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT=10,
+ NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
+ NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT=12,
+ NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT=13,
+ NET_IPV4_NF_CONNTRACK_BUCKETS=14,
+ NET_IPV4_NF_CONNTRACK_LOG_INVALID=15,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16,
+ NET_IPV4_NF_CONNTRACK_TCP_LOOSE=17,
+ NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL=18,
+ NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS=19,
+ NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20,
+ NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21,
+ NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22,
+ NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23,
+ NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24,
+ NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
+ NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
+ NET_IPV4_NF_CONNTRACK_COUNT=27,
+ NET_IPV4_NF_CONNTRACK_CHECKSUM=28,
+};
+
+/* /proc/sys/net/ipv6 */
+enum {
+ NET_IPV6_CONF=16,
+ NET_IPV6_NEIGH=17,
+ NET_IPV6_ROUTE=18,
+ NET_IPV6_ICMP=19,
+ NET_IPV6_BINDV6ONLY=20,
+ NET_IPV6_IP6FRAG_HIGH_THRESH=21,
+ NET_IPV6_IP6FRAG_LOW_THRESH=22,
+ NET_IPV6_IP6FRAG_TIME=23,
+ NET_IPV6_IP6FRAG_SECRET_INTERVAL=24,
+ NET_IPV6_MLD_MAX_MSF=25,
+};
+
+enum {
+ NET_IPV6_ROUTE_FLUSH=1,
+ NET_IPV6_ROUTE_GC_THRESH=2,
+ NET_IPV6_ROUTE_MAX_SIZE=3,
+ NET_IPV6_ROUTE_GC_MIN_INTERVAL=4,
+ NET_IPV6_ROUTE_GC_TIMEOUT=5,
+ NET_IPV6_ROUTE_GC_INTERVAL=6,
+ NET_IPV6_ROUTE_GC_ELASTICITY=7,
+ NET_IPV6_ROUTE_MTU_EXPIRES=8,
+ NET_IPV6_ROUTE_MIN_ADVMSS=9,
+ NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS=10
+};
+
+enum {
+ NET_IPV6_FORWARDING=1,
+ NET_IPV6_HOP_LIMIT=2,
+ NET_IPV6_MTU=3,
+ NET_IPV6_ACCEPT_RA=4,
+ NET_IPV6_ACCEPT_REDIRECTS=5,
+ NET_IPV6_AUTOCONF=6,
+ NET_IPV6_DAD_TRANSMITS=7,
+ NET_IPV6_RTR_SOLICITS=8,
+ NET_IPV6_RTR_SOLICIT_INTERVAL=9,
+ NET_IPV6_RTR_SOLICIT_DELAY=10,
+ NET_IPV6_USE_TEMPADDR=11,
+ NET_IPV6_TEMP_VALID_LFT=12,
+ NET_IPV6_TEMP_PREFERED_LFT=13,
+ NET_IPV6_REGEN_MAX_RETRY=14,
+ NET_IPV6_MAX_DESYNC_FACTOR=15,
+ NET_IPV6_MAX_ADDRESSES=16,
+ NET_IPV6_FORCE_MLD_VERSION=17,
+ NET_IPV6_ACCEPT_RA_DEFRTR=18,
+ NET_IPV6_ACCEPT_RA_PINFO=19,
+ NET_IPV6_ACCEPT_RA_RTR_PREF=20,
+ NET_IPV6_RTR_PROBE_INTERVAL=21,
+ NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22,
+ NET_IPV6_PROXY_NDP=23,
+ NET_IPV6_ACCEPT_SOURCE_ROUTE=25,
+ __NET_IPV6_MAX
+};
+
+/* /proc/sys/net/ipv6/icmp */
+enum {
+ NET_IPV6_ICMP_RATELIMIT=1
+};
+
+/* /proc/sys/net/<protocol>/neigh/<dev> */
+enum {
+ NET_NEIGH_MCAST_SOLICIT=1,
+ NET_NEIGH_UCAST_SOLICIT=2,
+ NET_NEIGH_APP_SOLICIT=3,
+ NET_NEIGH_RETRANS_TIME=4,
+ NET_NEIGH_REACHABLE_TIME=5,
+ NET_NEIGH_DELAY_PROBE_TIME=6,
+ NET_NEIGH_GC_STALE_TIME=7,
+ NET_NEIGH_UNRES_QLEN=8,
+ NET_NEIGH_PROXY_QLEN=9,
+ NET_NEIGH_ANYCAST_DELAY=10,
+ NET_NEIGH_PROXY_DELAY=11,
+ NET_NEIGH_LOCKTIME=12,
+ NET_NEIGH_GC_INTERVAL=13,
+ NET_NEIGH_GC_THRESH1=14,
+ NET_NEIGH_GC_THRESH2=15,
+ NET_NEIGH_GC_THRESH3=16,
+ NET_NEIGH_RETRANS_TIME_MS=17,
+ NET_NEIGH_REACHABLE_TIME_MS=18,
+ __NET_NEIGH_MAX
+};
+
+/* /proc/sys/net/dccp */
+enum {
+ NET_DCCP_DEFAULT=1,
+};
+
+/* /proc/sys/net/ipx */
+enum {
+ NET_IPX_PPROP_BROADCASTING=1,
+ NET_IPX_FORWARDING=2
+};
+
+/* /proc/sys/net/llc */
+enum {
+ NET_LLC2=1,
+ NET_LLC_STATION=2,
+};
+
+/* /proc/sys/net/llc/llc2 */
+enum {
+ NET_LLC2_TIMEOUT=1,
+};
+
+/* /proc/sys/net/llc/station */
+enum {
+ NET_LLC_STATION_ACK_TIMEOUT=1,
+};
+
+/* /proc/sys/net/llc/llc2/timeout */
+enum {
+ NET_LLC2_ACK_TIMEOUT=1,
+ NET_LLC2_P_TIMEOUT=2,
+ NET_LLC2_REJ_TIMEOUT=3,
+ NET_LLC2_BUSY_TIMEOUT=4,
+};
+
+/* /proc/sys/net/appletalk */
+enum {
+ NET_ATALK_AARP_EXPIRY_TIME=1,
+ NET_ATALK_AARP_TICK_TIME=2,
+ NET_ATALK_AARP_RETRANSMIT_LIMIT=3,
+ NET_ATALK_AARP_RESOLVE_TIME=4
+};
+
+
+/* /proc/sys/net/netrom */
+enum {
+ NET_NETROM_DEFAULT_PATH_QUALITY=1,
+ NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER=2,
+ NET_NETROM_NETWORK_TTL_INITIALISER=3,
+ NET_NETROM_TRANSPORT_TIMEOUT=4,
+ NET_NETROM_TRANSPORT_MAXIMUM_TRIES=5,
+ NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY=6,
+ NET_NETROM_TRANSPORT_BUSY_DELAY=7,
+ NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE=8,
+ NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT=9,
+ NET_NETROM_ROUTING_CONTROL=10,
+ NET_NETROM_LINK_FAILS_COUNT=11,
+ NET_NETROM_RESET=12
+};
+
+/* /proc/sys/net/ax25 */
+enum {
+ NET_AX25_IP_DEFAULT_MODE=1,
+ NET_AX25_DEFAULT_MODE=2,
+ NET_AX25_BACKOFF_TYPE=3,
+ NET_AX25_CONNECT_MODE=4,
+ NET_AX25_STANDARD_WINDOW=5,
+ NET_AX25_EXTENDED_WINDOW=6,
+ NET_AX25_T1_TIMEOUT=7,
+ NET_AX25_T2_TIMEOUT=8,
+ NET_AX25_T3_TIMEOUT=9,
+ NET_AX25_IDLE_TIMEOUT=10,
+ NET_AX25_N2=11,
+ NET_AX25_PACLEN=12,
+ NET_AX25_PROTOCOL=13,
+ NET_AX25_DAMA_SLAVE_TIMEOUT=14
+};
+
+/* /proc/sys/net/rose */
+enum {
+ NET_ROSE_RESTART_REQUEST_TIMEOUT=1,
+ NET_ROSE_CALL_REQUEST_TIMEOUT=2,
+ NET_ROSE_RESET_REQUEST_TIMEOUT=3,
+ NET_ROSE_CLEAR_REQUEST_TIMEOUT=4,
+ NET_ROSE_ACK_HOLD_BACK_TIMEOUT=5,
+ NET_ROSE_ROUTING_CONTROL=6,
+ NET_ROSE_LINK_FAIL_TIMEOUT=7,
+ NET_ROSE_MAX_VCS=8,
+ NET_ROSE_WINDOW_SIZE=9,
+ NET_ROSE_NO_ACTIVITY_TIMEOUT=10
+};
+
+/* /proc/sys/net/x25 */
+enum {
+ NET_X25_RESTART_REQUEST_TIMEOUT=1,
+ NET_X25_CALL_REQUEST_TIMEOUT=2,
+ NET_X25_RESET_REQUEST_TIMEOUT=3,
+ NET_X25_CLEAR_REQUEST_TIMEOUT=4,
+ NET_X25_ACK_HOLD_BACK_TIMEOUT=5,
+ NET_X25_FORWARD=6
+};
+
+/* /proc/sys/net/token-ring */
+enum
+{
+ NET_TR_RIF_TIMEOUT=1
+};
+
+/* /proc/sys/net/decnet/ */
+enum {
+ NET_DECNET_NODE_TYPE = 1,
+ NET_DECNET_NODE_ADDRESS = 2,
+ NET_DECNET_NODE_NAME = 3,
+ NET_DECNET_DEFAULT_DEVICE = 4,
+ NET_DECNET_TIME_WAIT = 5,
+ NET_DECNET_DN_COUNT = 6,
+ NET_DECNET_DI_COUNT = 7,
+ NET_DECNET_DR_COUNT = 8,
+ NET_DECNET_DST_GC_INTERVAL = 9,
+ NET_DECNET_CONF = 10,
+ NET_DECNET_NO_FC_MAX_CWND = 11,
+ NET_DECNET_MEM = 12,
+ NET_DECNET_RMEM = 13,
+ NET_DECNET_WMEM = 14,
+ NET_DECNET_DEBUG_LEVEL = 255
+};
+
+/* /proc/sys/net/decnet/conf/<dev> */
+enum {
+ NET_DECNET_CONF_LOOPBACK = -2,
+ NET_DECNET_CONF_DDCMP = -3,
+ NET_DECNET_CONF_PPP = -4,
+ NET_DECNET_CONF_X25 = -5,
+ NET_DECNET_CONF_GRE = -6,
+ NET_DECNET_CONF_ETHER = -7
+
+ /* ... and ifindex of devices */
+};
+
+/* /proc/sys/net/decnet/conf/<dev>/ */
+enum {
+ NET_DECNET_CONF_DEV_PRIORITY = 1,
+ NET_DECNET_CONF_DEV_T1 = 2,
+ NET_DECNET_CONF_DEV_T2 = 3,
+ NET_DECNET_CONF_DEV_T3 = 4,
+ NET_DECNET_CONF_DEV_FORWARDING = 5,
+ NET_DECNET_CONF_DEV_BLKSIZE = 6,
+ NET_DECNET_CONF_DEV_STATE = 7
+};
+
+/* /proc/sys/net/sctp */
+enum {
+ NET_SCTP_RTO_INITIAL = 1,
+ NET_SCTP_RTO_MIN = 2,
+ NET_SCTP_RTO_MAX = 3,
+ NET_SCTP_RTO_ALPHA = 4,
+ NET_SCTP_RTO_BETA = 5,
+ NET_SCTP_VALID_COOKIE_LIFE = 6,
+ NET_SCTP_ASSOCIATION_MAX_RETRANS = 7,
+ NET_SCTP_PATH_MAX_RETRANS = 8,
+ NET_SCTP_MAX_INIT_RETRANSMITS = 9,
+ NET_SCTP_HB_INTERVAL = 10,
+ NET_SCTP_PRESERVE_ENABLE = 11,
+ NET_SCTP_MAX_BURST = 12,
+ NET_SCTP_ADDIP_ENABLE = 13,
+ NET_SCTP_PRSCTP_ENABLE = 14,
+ NET_SCTP_SNDBUF_POLICY = 15,
+ NET_SCTP_SACK_TIMEOUT = 16,
+ NET_SCTP_RCVBUF_POLICY = 17,
+};
+
+/* /proc/sys/net/bridge */
+enum {
+ NET_BRIDGE_NF_CALL_ARPTABLES = 1,
+ NET_BRIDGE_NF_CALL_IPTABLES = 2,
+ NET_BRIDGE_NF_CALL_IP6TABLES = 3,
+ NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4,
+ NET_BRIDGE_NF_FILTER_PPPOE_TAGGED = 5,
+};
+
+/* proc/sys/net/irda */
+enum {
+ NET_IRDA_DISCOVERY=1,
+ NET_IRDA_DEVNAME=2,
+ NET_IRDA_DEBUG=3,
+ NET_IRDA_FAST_POLL=4,
+ NET_IRDA_DISCOVERY_SLOTS=5,
+ NET_IRDA_DISCOVERY_TIMEOUT=6,
+ NET_IRDA_SLOT_TIMEOUT=7,
+ NET_IRDA_MAX_BAUD_RATE=8,
+ NET_IRDA_MIN_TX_TURN_TIME=9,
+ NET_IRDA_MAX_TX_DATA_SIZE=10,
+ NET_IRDA_MAX_TX_WINDOW=11,
+ NET_IRDA_MAX_NOREPLY_TIME=12,
+ NET_IRDA_WARN_NOREPLY_TIME=13,
+ NET_IRDA_LAP_KEEPALIVE_TIME=14,
+};
+
+
+/* CTL_FS names: */
+enum
+{
+ FS_NRINODE=1, /* int:current number of allocated inodes */
+ FS_STATINODE=2,
+ FS_MAXINODE=3, /* int:maximum number of inodes that can be allocated */
+ FS_NRDQUOT=4, /* int:current number of allocated dquots */
+ FS_MAXDQUOT=5, /* int:maximum number of dquots that can be allocated */
+ FS_NRFILE=6, /* int:current number of allocated filedescriptors */
+ FS_MAXFILE=7, /* int:maximum number of filedescriptors that can be allocated */
+ FS_DENTRY=8,
+ FS_NRSUPER=9, /* int:current number of allocated super_blocks */
+ FS_MAXSUPER=10, /* int:maximum number of super_blocks that can be allocated */
+ FS_OVERFLOWUID=11, /* int: overflow UID */
+ FS_OVERFLOWGID=12, /* int: overflow GID */
+ FS_LEASES=13, /* int: leases enabled */
+ FS_DIR_NOTIFY=14, /* int: directory notification enabled */
+ FS_LEASE_TIME=15, /* int: maximum time to wait for a lease break */
+ FS_DQSTATS=16, /* disc quota usage statistics and control */
+ FS_XFS=17, /* struct: control xfs parameters */
+ FS_AIO_NR=18, /* current system-wide number of aio requests */
+ FS_AIO_MAX_NR=19, /* system-wide maximum number of aio requests */
+ FS_INOTIFY=20, /* inotify submenu */
+ FS_OCFS2=988, /* ocfs2 */
+};
+
+/* /proc/sys/fs/quota/ */
+enum {
+ FS_DQ_LOOKUPS = 1,
+ FS_DQ_DROPS = 2,
+ FS_DQ_READS = 3,
+ FS_DQ_WRITES = 4,
+ FS_DQ_CACHE_HITS = 5,
+ FS_DQ_ALLOCATED = 6,
+ FS_DQ_FREE = 7,
+ FS_DQ_SYNCS = 8,
+ FS_DQ_WARNINGS = 9,
+};
+
+/* CTL_DEBUG names: */
+
+/* CTL_DEV names: */
+enum {
+ DEV_CDROM=1,
+ DEV_HWMON=2,
+ DEV_PARPORT=3,
+ DEV_RAID=4,
+ DEV_MAC_HID=5,
+ DEV_SCSI=6,
+ DEV_IPMI=7,
+};
+
+/* /proc/sys/dev/cdrom */
+enum {
+ DEV_CDROM_INFO=1,
+ DEV_CDROM_AUTOCLOSE=2,
+ DEV_CDROM_AUTOEJECT=3,
+ DEV_CDROM_DEBUG=4,
+ DEV_CDROM_LOCK=5,
+ DEV_CDROM_CHECK_MEDIA=6
+};
+
+/* /proc/sys/dev/parport */
+enum {
+ DEV_PARPORT_DEFAULT=-3
+};
+
+/* /proc/sys/dev/raid */
+enum {
+ DEV_RAID_SPEED_LIMIT_MIN=1,
+ DEV_RAID_SPEED_LIMIT_MAX=2
+};
+
+/* /proc/sys/dev/parport/default */
+enum {
+ DEV_PARPORT_DEFAULT_TIMESLICE=1,
+ DEV_PARPORT_DEFAULT_SPINTIME=2
+};
+
+/* /proc/sys/dev/parport/parport n */
+enum {
+ DEV_PARPORT_SPINTIME=1,
+ DEV_PARPORT_BASE_ADDR=2,
+ DEV_PARPORT_IRQ=3,
+ DEV_PARPORT_DMA=4,
+ DEV_PARPORT_MODES=5,
+ DEV_PARPORT_DEVICES=6,
+ DEV_PARPORT_AUTOPROBE=16
+};
+
+/* /proc/sys/dev/parport/parport n/devices/ */
+enum {
+ DEV_PARPORT_DEVICES_ACTIVE=-3,
+};
+
+/* /proc/sys/dev/parport/parport n/devices/device n */
+enum {
+ DEV_PARPORT_DEVICE_TIMESLICE=1,
+};
+
+/* /proc/sys/dev/mac_hid */
+enum {
+ DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES=1,
+ DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES=2,
+ DEV_MAC_HID_MOUSE_BUTTON_EMULATION=3,
+ DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=4,
+ DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=5,
+ DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=6
+};
+
+/* /proc/sys/dev/scsi */
+enum {
+ DEV_SCSI_LOGGING_LEVEL=1,
+};
+
+/* /proc/sys/dev/ipmi */
+enum {
+ DEV_IPMI_POWEROFF_POWERCYCLE=1,
+};
+
+/* /proc/sys/abi */
+enum
+{
+ ABI_DEFHANDLER_COFF=1, /* default handler for coff binaries */
+ ABI_DEFHANDLER_ELF=2, /* default handler for ELF binaries */
+ ABI_DEFHANDLER_LCALL7=3,/* default handler for procs using lcall7 */
+ ABI_DEFHANDLER_LIBCSO=4,/* default handler for an libc.so ELF interp */
+ ABI_TRACE=5, /* tracing flags */
+ ABI_FAKE_UTSNAME=6, /* fake target utsname information */
+};
+
+
+#endif /* _LINUX_SYSCTL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/taskstats.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/taskstats.h
new file mode 100644
index 0000000..341dddb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/taskstats.h
@@ -0,0 +1,212 @@
+/* taskstats.h - exporting per-task statistics
+ *
+ * Copyright (C) Shailabh Nagar, IBM Corp. 2006
+ * (C) Balbir Singh, IBM Corp. 2006
+ * (C) Jay Lan, SGI, 2006
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2.1 of the GNU Lesser General Public License
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#ifndef _LINUX_TASKSTATS_H
+#define _LINUX_TASKSTATS_H
+
+#include <linux/types.h>
+
+/* Format for per-task data returned to userland when
+ * - a task exits
+ * - listener requests stats for a task
+ *
+ * The struct is versioned. Newer versions should only add fields to
+ * the bottom of the struct to maintain backward compatibility.
+ *
+ *
+ * To add new fields
+ * a) bump up TASKSTATS_VERSION
+ * b) add comment indicating new version number at end of struct
+ * c) add new fields after version comment; maintain 64-bit alignment
+ */
+
+
+#define TASKSTATS_VERSION 7
+#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
+ * in linux/sched.h */
+
+struct taskstats {
+
+ /* The version number of this struct. This field is always set to
+ * TAKSTATS_VERSION, which is defined in <linux/taskstats.h>.
+ * Each time the struct is changed, the value should be incremented.
+ */
+ __u16 version;
+ __u32 ac_exitcode; /* Exit status */
+
+ /* The accounting flags of a task as defined in <linux/acct.h>
+ * Defined values are AFORK, ASU, ACOMPAT, ACORE, and AXSIG.
+ */
+ __u8 ac_flag; /* Record flags */
+ __u8 ac_nice; /* task_nice */
+
+ /* Delay accounting fields start
+ *
+ * All values, until comment "Delay accounting fields end" are
+ * available only if delay accounting is enabled, even though the last
+ * few fields are not delays
+ *
+ * xxx_count is the number of delay values recorded
+ * xxx_delay_total is the corresponding cumulative delay in nanoseconds
+ *
+ * xxx_delay_total wraps around to zero on overflow
+ * xxx_count incremented regardless of overflow
+ */
+
+ /* Delay waiting for cpu, while runnable
+ * count, delay_total NOT updated atomically
+ */
+ __u64 cpu_count __attribute__((aligned(8)));
+ __u64 cpu_delay_total;
+
+ /* Following four fields atomically updated using task->delays->lock */
+
+ /* Delay waiting for synchronous block I/O to complete
+ * does not account for delays in I/O submission
+ */
+ __u64 blkio_count;
+ __u64 blkio_delay_total;
+
+ /* Delay waiting for page fault I/O (swap in only) */
+ __u64 swapin_count;
+ __u64 swapin_delay_total;
+
+ /* cpu "wall-clock" running time
+ * On some architectures, value will adjust for cpu time stolen
+ * from the kernel in involuntary waits due to virtualization.
+ * Value is cumulative, in nanoseconds, without a corresponding count
+ * and wraps around to zero silently on overflow
+ */
+ __u64 cpu_run_real_total;
+
+ /* cpu "virtual" running time
+ * Uses time intervals seen by the kernel i.e. no adjustment
+ * for kernel's involuntary waits due to virtualization.
+ * Value is cumulative, in nanoseconds, without a corresponding count
+ * and wraps around to zero silently on overflow
+ */
+ __u64 cpu_run_virtual_total;
+ /* Delay accounting fields end */
+ /* version 1 ends here */
+
+ /* Basic Accounting Fields start */
+ char ac_comm[TS_COMM_LEN]; /* Command name */
+ __u8 ac_sched __attribute__((aligned(8)));
+ /* Scheduling discipline */
+ __u8 ac_pad[3];
+ __u32 ac_uid __attribute__((aligned(8)));
+ /* User ID */
+ __u32 ac_gid; /* Group ID */
+ __u32 ac_pid; /* Process ID */
+ __u32 ac_ppid; /* Parent process ID */
+ __u32 ac_btime; /* Begin time [sec since 1970] */
+ __u64 ac_etime __attribute__((aligned(8)));
+ /* Elapsed time [usec] */
+ __u64 ac_utime; /* User CPU time [usec] */
+ __u64 ac_stime; /* SYstem CPU time [usec] */
+ __u64 ac_minflt; /* Minor Page Fault Count */
+ __u64 ac_majflt; /* Major Page Fault Count */
+ /* Basic Accounting Fields end */
+
+ /* Extended accounting fields start */
+ /* Accumulated RSS usage in duration of a task, in MBytes-usecs.
+ * The current rss usage is added to this counter every time
+ * a tick is charged to a task's system time. So, at the end we
+ * will have memory usage multiplied by system time. Thus an
+ * average usage per system time unit can be calculated.
+ */
+ __u64 coremem; /* accumulated RSS usage in MB-usec */
+ /* Accumulated virtual memory usage in duration of a task.
+ * Same as acct_rss_mem1 above except that we keep track of VM usage.
+ */
+ __u64 virtmem; /* accumulated VM usage in MB-usec */
+
+ /* High watermark of RSS and virtual memory usage in duration of
+ * a task, in KBytes.
+ */
+ __u64 hiwater_rss; /* High-watermark of RSS usage, in KB */
+ __u64 hiwater_vm; /* High-water VM usage, in KB */
+
+ /* The following four fields are I/O statistics of a task. */
+ __u64 read_char; /* bytes read */
+ __u64 write_char; /* bytes written */
+ __u64 read_syscalls; /* read syscalls */
+ __u64 write_syscalls; /* write syscalls */
+ /* Extended accounting fields end */
+
+#define TASKSTATS_HAS_IO_ACCOUNTING
+ /* Per-task storage I/O accounting starts */
+ __u64 read_bytes; /* bytes of read I/O */
+ __u64 write_bytes; /* bytes of write I/O */
+ __u64 cancelled_write_bytes; /* bytes of cancelled write I/O */
+
+ __u64 nvcsw; /* voluntary_ctxt_switches */
+ __u64 nivcsw; /* nonvoluntary_ctxt_switches */
+
+ /* time accounting for SMT machines */
+ __u64 ac_utimescaled; /* utime scaled on frequency etc */
+ __u64 ac_stimescaled; /* stime scaled on frequency etc */
+ __u64 cpu_scaled_run_real_total; /* scaled cpu_run_real_total */
+
+ /* Delay waiting for memory reclaim */
+ __u64 freepages_count;
+ __u64 freepages_delay_total;
+};
+
+
+/*
+ * Commands sent from userspace
+ * Not versioned. New commands should only be inserted at the enum's end
+ * prior to __TASKSTATS_CMD_MAX
+ */
+
+enum {
+ TASKSTATS_CMD_UNSPEC = 0, /* Reserved */
+ TASKSTATS_CMD_GET, /* user->kernel request/get-response */
+ TASKSTATS_CMD_NEW, /* kernel->user event */
+ __TASKSTATS_CMD_MAX,
+};
+
+#define TASKSTATS_CMD_MAX (__TASKSTATS_CMD_MAX - 1)
+
+enum {
+ TASKSTATS_TYPE_UNSPEC = 0, /* Reserved */
+ TASKSTATS_TYPE_PID, /* Process id */
+ TASKSTATS_TYPE_TGID, /* Thread group id */
+ TASKSTATS_TYPE_STATS, /* taskstats structure */
+ TASKSTATS_TYPE_AGGR_PID, /* contains pid + stats */
+ TASKSTATS_TYPE_AGGR_TGID, /* contains tgid + stats */
+ __TASKSTATS_TYPE_MAX,
+};
+
+#define TASKSTATS_TYPE_MAX (__TASKSTATS_TYPE_MAX - 1)
+
+enum {
+ TASKSTATS_CMD_ATTR_UNSPEC = 0,
+ TASKSTATS_CMD_ATTR_PID,
+ TASKSTATS_CMD_ATTR_TGID,
+ TASKSTATS_CMD_ATTR_REGISTER_CPUMASK,
+ TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK,
+ __TASKSTATS_CMD_ATTR_MAX,
+};
+
+#define TASKSTATS_CMD_ATTR_MAX (__TASKSTATS_CMD_ATTR_MAX - 1)
+
+/* NETLINK_GENERIC related info */
+
+#define TASKSTATS_GENL_NAME "TASKSTATS"
+#define TASKSTATS_GENL_VERSION 0x1
+
+#endif /* _LINUX_TASKSTATS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/..install.cmd
new file mode 100644
index 0000000..1ab211c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/tc_act/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/tc_act /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/tc_act mips tc_gact.h tc_ipt.h tc_mirred.h tc_nat.h tc_pedit.h tc_skbedit.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/tc_act /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/tc_act mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/tc_act/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_gact.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_gact.h
new file mode 100644
index 0000000..e895c0a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_gact.h
@@ -0,0 +1,35 @@
+#ifndef __LINUX_TC_GACT_H
+#define __LINUX_TC_GACT_H
+
+#include <linux/types.h>
+#include <linux/pkt_cls.h>
+
+#define TCA_ACT_GACT 5
+struct tc_gact
+{
+ tc_gen;
+
+};
+
+struct tc_gact_p
+{
+#define PGACT_NONE 0
+#define PGACT_NETRAND 1
+#define PGACT_DETERM 2
+#define MAX_RAND (PGACT_DETERM + 1 )
+ __u16 ptype;
+ __u16 pval;
+ int paction;
+};
+
+enum
+{
+ TCA_GACT_UNSPEC,
+ TCA_GACT_TM,
+ TCA_GACT_PARMS,
+ TCA_GACT_PROB,
+ __TCA_GACT_MAX
+};
+#define TCA_GACT_MAX (__TCA_GACT_MAX - 1)
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_ipt.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_ipt.h
new file mode 100644
index 0000000..4b6f7b6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_ipt.h
@@ -0,0 +1,21 @@
+#ifndef __LINUX_TC_IPT_H
+#define __LINUX_TC_IPT_H
+
+#include <linux/pkt_cls.h>
+
+#define TCA_ACT_IPT 6
+
+enum
+{
+ TCA_IPT_UNSPEC,
+ TCA_IPT_TABLE,
+ TCA_IPT_HOOK,
+ TCA_IPT_INDEX,
+ TCA_IPT_CNT,
+ TCA_IPT_TM,
+ TCA_IPT_TARG,
+ __TCA_IPT_MAX
+};
+#define TCA_IPT_MAX (__TCA_IPT_MAX - 1)
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_mirred.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_mirred.h
new file mode 100644
index 0000000..0a99ab6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_mirred.h
@@ -0,0 +1,29 @@
+#ifndef __LINUX_TC_MIR_H
+#define __LINUX_TC_MIR_H
+
+#include <linux/types.h>
+#include <linux/pkt_cls.h>
+
+#define TCA_ACT_MIRRED 8
+#define TCA_EGRESS_REDIR 1 /* packet redirect to EGRESS*/
+#define TCA_EGRESS_MIRROR 2 /* mirror packet to EGRESS */
+#define TCA_INGRESS_REDIR 3 /* packet redirect to INGRESS*/
+#define TCA_INGRESS_MIRROR 4 /* mirror packet to INGRESS */
+
+struct tc_mirred
+{
+ tc_gen;
+ int eaction; /* one of IN/EGRESS_MIRROR/REDIR */
+ __u32 ifindex; /* ifindex of egress port */
+};
+
+enum
+{
+ TCA_MIRRED_UNSPEC,
+ TCA_MIRRED_TM,
+ TCA_MIRRED_PARMS,
+ __TCA_MIRRED_MAX
+};
+#define TCA_MIRRED_MAX (__TCA_MIRRED_MAX - 1)
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_nat.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_nat.h
new file mode 100644
index 0000000..e7cf31e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_nat.h
@@ -0,0 +1,29 @@
+#ifndef __LINUX_TC_NAT_H
+#define __LINUX_TC_NAT_H
+
+#include <linux/pkt_cls.h>
+#include <linux/types.h>
+
+#define TCA_ACT_NAT 9
+
+enum
+{
+ TCA_NAT_UNSPEC,
+ TCA_NAT_PARMS,
+ TCA_NAT_TM,
+ __TCA_NAT_MAX
+};
+#define TCA_NAT_MAX (__TCA_NAT_MAX - 1)
+
+#define TCA_NAT_FLAG_EGRESS 1
+
+struct tc_nat
+{
+ tc_gen;
+ __be32 old_addr;
+ __be32 new_addr;
+ __be32 mask;
+ __u32 flags;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_pedit.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_pedit.h
new file mode 100644
index 0000000..54ce906
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_pedit.h
@@ -0,0 +1,37 @@
+#ifndef __LINUX_TC_PED_H
+#define __LINUX_TC_PED_H
+
+#include <linux/types.h>
+#include <linux/pkt_cls.h>
+
+#define TCA_ACT_PEDIT 7
+
+enum
+{
+ TCA_PEDIT_UNSPEC,
+ TCA_PEDIT_TM,
+ TCA_PEDIT_PARMS,
+ __TCA_PEDIT_MAX
+};
+#define TCA_PEDIT_MAX (__TCA_PEDIT_MAX - 1)
+
+struct tc_pedit_key
+{
+ __u32 mask; /* AND */
+ __u32 val; /*XOR */
+ __u32 off; /*offset */
+ __u32 at;
+ __u32 offmask;
+ __u32 shift;
+};
+
+struct tc_pedit_sel
+{
+ tc_gen;
+ unsigned char nkeys;
+ unsigned char flags;
+ struct tc_pedit_key keys[0];
+};
+#define tc_pedit tc_pedit_sel
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_skbedit.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_skbedit.h
new file mode 100644
index 0000000..a14e461
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_act/tc_skbedit.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2008, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * Author: Alexander Duyck <alexander.h.duyck@intel.com>
+ */
+
+#ifndef __LINUX_TC_SKBEDIT_H
+#define __LINUX_TC_SKBEDIT_H
+
+#include <linux/pkt_cls.h>
+
+#define TCA_ACT_SKBEDIT 11
+
+#define SKBEDIT_F_PRIORITY 0x1
+#define SKBEDIT_F_QUEUE_MAPPING 0x2
+
+struct tc_skbedit {
+ tc_gen;
+};
+
+enum {
+ TCA_SKBEDIT_UNSPEC,
+ TCA_SKBEDIT_TM,
+ TCA_SKBEDIT_PARMS,
+ TCA_SKBEDIT_PRIORITY,
+ TCA_SKBEDIT_QUEUE_MAPPING,
+ __TCA_SKBEDIT_MAX
+};
+#define TCA_SKBEDIT_MAX (__TCA_SKBEDIT_MAX - 1)
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/..install.cmd
new file mode 100644
index 0000000..1e775be
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/tc_ematch/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/tc_ematch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/tc_ematch mips tc_em_cmp.h tc_em_meta.h tc_em_nbyte.h tc_em_text.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/tc_ematch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/tc_ematch mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/tc_ematch/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/tc_em_cmp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/tc_em_cmp.h
new file mode 100644
index 0000000..38e7f7b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/tc_em_cmp.h
@@ -0,0 +1,27 @@
+#ifndef __LINUX_TC_EM_CMP_H
+#define __LINUX_TC_EM_CMP_H
+
+#include <linux/types.h>
+#include <linux/pkt_cls.h>
+
+struct tcf_em_cmp
+{
+ __u32 val;
+ __u32 mask;
+ __u16 off;
+ __u8 align:4;
+ __u8 flags:4;
+ __u8 layer:4;
+ __u8 opnd:4;
+};
+
+enum
+{
+ TCF_EM_ALIGN_U8 = 1,
+ TCF_EM_ALIGN_U16 = 2,
+ TCF_EM_ALIGN_U32 = 4
+};
+
+#define TCF_EM_CMP_TRANS 1
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/tc_em_meta.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/tc_em_meta.h
new file mode 100644
index 0000000..dcfb733
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/tc_em_meta.h
@@ -0,0 +1,96 @@
+#ifndef __LINUX_TC_EM_META_H
+#define __LINUX_TC_EM_META_H
+
+#include <linux/types.h>
+#include <linux/pkt_cls.h>
+
+enum
+{
+ TCA_EM_META_UNSPEC,
+ TCA_EM_META_HDR,
+ TCA_EM_META_LVALUE,
+ TCA_EM_META_RVALUE,
+ __TCA_EM_META_MAX
+};
+#define TCA_EM_META_MAX (__TCA_EM_META_MAX - 1)
+
+struct tcf_meta_val
+{
+ __u16 kind;
+ __u8 shift;
+ __u8 op;
+};
+
+#define TCF_META_TYPE_MASK (0xf << 12)
+#define TCF_META_TYPE(kind) (((kind) & TCF_META_TYPE_MASK) >> 12)
+#define TCF_META_ID_MASK 0x7ff
+#define TCF_META_ID(kind) ((kind) & TCF_META_ID_MASK)
+
+enum
+{
+ TCF_META_TYPE_VAR,
+ TCF_META_TYPE_INT,
+ __TCF_META_TYPE_MAX
+};
+#define TCF_META_TYPE_MAX (__TCF_META_TYPE_MAX - 1)
+
+enum
+{
+ TCF_META_ID_VALUE,
+ TCF_META_ID_RANDOM,
+ TCF_META_ID_LOADAVG_0,
+ TCF_META_ID_LOADAVG_1,
+ TCF_META_ID_LOADAVG_2,
+ TCF_META_ID_DEV,
+ TCF_META_ID_PRIORITY,
+ TCF_META_ID_PROTOCOL,
+ TCF_META_ID_PKTTYPE,
+ TCF_META_ID_PKTLEN,
+ TCF_META_ID_DATALEN,
+ TCF_META_ID_MACLEN,
+ TCF_META_ID_NFMARK,
+ TCF_META_ID_TCINDEX,
+ TCF_META_ID_RTCLASSID,
+ TCF_META_ID_RTIIF,
+ TCF_META_ID_SK_FAMILY,
+ TCF_META_ID_SK_STATE,
+ TCF_META_ID_SK_REUSE,
+ TCF_META_ID_SK_BOUND_IF,
+ TCF_META_ID_SK_REFCNT,
+ TCF_META_ID_SK_SHUTDOWN,
+ TCF_META_ID_SK_PROTO,
+ TCF_META_ID_SK_TYPE,
+ TCF_META_ID_SK_RCVBUF,
+ TCF_META_ID_SK_RMEM_ALLOC,
+ TCF_META_ID_SK_WMEM_ALLOC,
+ TCF_META_ID_SK_OMEM_ALLOC,
+ TCF_META_ID_SK_WMEM_QUEUED,
+ TCF_META_ID_SK_RCV_QLEN,
+ TCF_META_ID_SK_SND_QLEN,
+ TCF_META_ID_SK_ERR_QLEN,
+ TCF_META_ID_SK_FORWARD_ALLOCS,
+ TCF_META_ID_SK_SNDBUF,
+ TCF_META_ID_SK_ALLOCS,
+ TCF_META_ID_SK_ROUTE_CAPS,
+ TCF_META_ID_SK_HASH,
+ TCF_META_ID_SK_LINGERTIME,
+ TCF_META_ID_SK_ACK_BACKLOG,
+ TCF_META_ID_SK_MAX_ACK_BACKLOG,
+ TCF_META_ID_SK_PRIO,
+ TCF_META_ID_SK_RCVLOWAT,
+ TCF_META_ID_SK_RCVTIMEO,
+ TCF_META_ID_SK_SNDTIMEO,
+ TCF_META_ID_SK_SENDMSG_OFF,
+ TCF_META_ID_SK_WRITE_PENDING,
+ TCF_META_ID_VLAN_TAG,
+ __TCF_META_ID_MAX
+};
+#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1)
+
+struct tcf_meta_hdr
+{
+ struct tcf_meta_val left;
+ struct tcf_meta_val right;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/tc_em_nbyte.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/tc_em_nbyte.h
new file mode 100644
index 0000000..9ed8c2e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/tc_em_nbyte.h
@@ -0,0 +1,14 @@
+#ifndef __LINUX_TC_EM_NBYTE_H
+#define __LINUX_TC_EM_NBYTE_H
+
+#include <linux/types.h>
+#include <linux/pkt_cls.h>
+
+struct tcf_em_nbyte
+{
+ __u16 off;
+ __u16 len:12;
+ __u8 layer:4;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/tc_em_text.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/tc_em_text.h
new file mode 100644
index 0000000..d12a73a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tc_ematch/tc_em_text.h
@@ -0,0 +1,20 @@
+#ifndef __LINUX_TC_EM_TEXT_H
+#define __LINUX_TC_EM_TEXT_H
+
+#include <linux/types.h>
+#include <linux/pkt_cls.h>
+
+#define TC_EM_TEXT_ALGOSIZ 16
+
+struct tcf_em_text
+{
+ char algo[TC_EM_TEXT_ALGOSIZ];
+ __u16 from_offset;
+ __u16 to_offset;
+ __u16 pattern_len;
+ __u8 from_layer:4;
+ __u8 to_layer:4;
+ __u8 pad;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tcp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tcp.h
new file mode 100644
index 0000000..959231d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tcp.h
@@ -0,0 +1,174 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Definitions for the TCP protocol.
+ *
+ * Version: @(#)tcp.h 1.0.2 04/28/93
+ *
+ * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_TCP_H
+#define _LINUX_TCP_H
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+#include <linux/socket.h>
+
+struct tcphdr {
+ __be16 source;
+ __be16 dest;
+ __be32 seq;
+ __be32 ack_seq;
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u16 res1:4,
+ doff:4,
+ fin:1,
+ syn:1,
+ rst:1,
+ psh:1,
+ ack:1,
+ urg:1,
+ ece:1,
+ cwr:1;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u16 doff:4,
+ res1:4,
+ cwr:1,
+ ece:1,
+ urg:1,
+ ack:1,
+ psh:1,
+ rst:1,
+ syn:1,
+ fin:1;
+#else
+#error "Adjust your <asm/byteorder.h> defines"
+#endif
+ __be16 window;
+ __sum16 check;
+ __be16 urg_ptr;
+};
+
+/*
+ * The union cast uses a gcc extension to avoid aliasing problems
+ * (union is compatible to any of its members)
+ * This means this part of the code is -fstrict-aliasing safe now.
+ */
+union tcp_word_hdr {
+ struct tcphdr hdr;
+ __be32 words[5];
+};
+
+#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3])
+
+enum {
+ TCP_FLAG_CWR = __cpu_to_be32(0x00800000),
+ TCP_FLAG_ECE = __cpu_to_be32(0x00400000),
+ TCP_FLAG_URG = __cpu_to_be32(0x00200000),
+ TCP_FLAG_ACK = __cpu_to_be32(0x00100000),
+ TCP_FLAG_PSH = __cpu_to_be32(0x00080000),
+ TCP_FLAG_RST = __cpu_to_be32(0x00040000),
+ TCP_FLAG_SYN = __cpu_to_be32(0x00020000),
+ TCP_FLAG_FIN = __cpu_to_be32(0x00010000),
+ TCP_RESERVED_BITS = __cpu_to_be32(0x0F000000),
+ TCP_DATA_OFFSET = __cpu_to_be32(0xF0000000)
+};
+
+/* TCP socket options */
+#define TCP_NODELAY 1 /* Turn off Nagle's algorithm. */
+#define TCP_MAXSEG 2 /* Limit MSS */
+#define TCP_CORK 3 /* Never send partially complete segments */
+#define TCP_KEEPIDLE 4 /* Start keeplives after this period */
+#define TCP_KEEPINTVL 5 /* Interval between keepalives */
+#define TCP_KEEPCNT 6 /* Number of keepalives before death */
+#define TCP_SYNCNT 7 /* Number of SYN retransmits */
+#define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */
+#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */
+#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */
+#define TCP_INFO 11 /* Information about this connection. */
+#define TCP_QUICKACK 12 /* Block/reenable quick acks */
+#define TCP_CONGESTION 13 /* Congestion control algorithm */
+#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */
+
+#define TCPI_OPT_TIMESTAMPS 1
+#define TCPI_OPT_SACK 2
+#define TCPI_OPT_WSCALE 4
+#define TCPI_OPT_ECN 8
+
+enum tcp_ca_state
+{
+ TCP_CA_Open = 0,
+#define TCPF_CA_Open (1<<TCP_CA_Open)
+ TCP_CA_Disorder = 1,
+#define TCPF_CA_Disorder (1<<TCP_CA_Disorder)
+ TCP_CA_CWR = 2,
+#define TCPF_CA_CWR (1<<TCP_CA_CWR)
+ TCP_CA_Recovery = 3,
+#define TCPF_CA_Recovery (1<<TCP_CA_Recovery)
+ TCP_CA_Loss = 4
+#define TCPF_CA_Loss (1<<TCP_CA_Loss)
+};
+
+struct tcp_info
+{
+ __u8 tcpi_state;
+ __u8 tcpi_ca_state;
+ __u8 tcpi_retransmits;
+ __u8 tcpi_probes;
+ __u8 tcpi_backoff;
+ __u8 tcpi_options;
+ __u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
+
+ __u32 tcpi_rto;
+ __u32 tcpi_ato;
+ __u32 tcpi_snd_mss;
+ __u32 tcpi_rcv_mss;
+
+ __u32 tcpi_unacked;
+ __u32 tcpi_sacked;
+ __u32 tcpi_lost;
+ __u32 tcpi_retrans;
+ __u32 tcpi_fackets;
+
+ /* Times. */
+ __u32 tcpi_last_data_sent;
+ __u32 tcpi_last_ack_sent; /* Not remembered, sorry. */
+ __u32 tcpi_last_data_recv;
+ __u32 tcpi_last_ack_recv;
+
+ /* Metrics. */
+ __u32 tcpi_pmtu;
+ __u32 tcpi_rcv_ssthresh;
+ __u32 tcpi_rtt;
+ __u32 tcpi_rttvar;
+ __u32 tcpi_snd_ssthresh;
+ __u32 tcpi_snd_cwnd;
+ __u32 tcpi_advmss;
+ __u32 tcpi_reordering;
+
+ __u32 tcpi_rcv_rtt;
+ __u32 tcpi_rcv_space;
+
+ __u32 tcpi_total_retrans;
+};
+
+/* for TCP_MD5SIG socket option */
+#define TCP_MD5SIG_MAXKEYLEN 80
+
+struct tcp_md5sig {
+ struct __kernel_sockaddr_storage tcpm_addr; /* address associated */
+ __u16 __tcpm_pad1; /* zero */
+ __u16 tcpm_keylen; /* key length */
+ __u32 __tcpm_pad2; /* zero */
+ __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* key (binary) */
+};
+
+
+#endif /* _LINUX_TCP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/telephony.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/telephony.h
new file mode 100644
index 0000000..f63afe3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/telephony.h
@@ -0,0 +1,262 @@
+/******************************************************************************
+ *
+ * telephony.h
+ *
+ * Basic Linux Telephony Interface
+ *
+ * (c) Copyright 1999-2001 Quicknet Technologies, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * Authors: Ed Okerson, <eokerson@quicknet.net>
+ * Greg Herlein, <gherlein@quicknet.net>
+ *
+ * Contributors: Alan Cox, <alan@lxorguk.ukuu.org.uk>
+ * David W. Erhart, <derhart@quicknet.net>
+ *
+ * IN NO EVENT SHALL QUICKNET TECHNOLOGIES, INC. BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+ * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF QUICKNET
+ * TECHNOLOGIES, INC. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * QUICKNET TECHNOLOGIES, INC. SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND QUICKNET TECHNOLOGIES, INC. HAS NO OBLIGATION
+ * TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ *****************************************************************************/
+
+#ifndef TELEPHONY_H
+#define TELEPHONY_H
+
+#define TELEPHONY_VERSION 3013
+
+#define PHONE_VENDOR_IXJ 1
+#define PHONE_VENDOR_QUICKNET PHONE_VENDOR_IXJ
+#define PHONE_VENDOR_VOICETRONIX 2
+#define PHONE_VENDOR_ACULAB 3
+#define PHONE_VENDOR_DIGI 4
+#define PHONE_VENDOR_FRANKLIN 5
+
+/******************************************************************************
+ * Vendor Summary Information Area
+ *
+ * Quicknet Technologies, Inc. - makes low density analog telephony cards
+ * with audio compression, POTS and PSTN interfaces (www.quicknet.net)
+ *
+ * (other vendors following this API shuld add a short description of
+ * the telephony products they support under Linux)
+ *
+ *****************************************************************************/
+#define QTI_PHONEJACK 100
+#define QTI_LINEJACK 300
+#define QTI_PHONEJACK_LITE 400
+#define QTI_PHONEJACK_PCI 500
+#define QTI_PHONECARD 600
+
+/******************************************************************************
+*
+* The capabilities ioctls can inform you of the capabilities of each phone
+* device installed in your system. The PHONECTL_CAPABILITIES ioctl
+* returns an integer value indicating the number of capabilities the
+* device has. The PHONECTL_CAPABILITIES_LIST will fill an array of
+* capability structs with all of its capabilities. The
+* PHONECTL_CAPABILITIES_CHECK takes a single capability struct and returns
+* a TRUE if the device has that capability, otherwise it returns false.
+*
+******************************************************************************/
+typedef enum {
+ vendor = 0,
+ device,
+ port,
+ codec,
+ dsp
+} phone_cap;
+
+struct phone_capability {
+ char desc[80];
+ phone_cap captype;
+ int cap;
+ int handle;
+};
+
+typedef enum {
+ pots = 0,
+ pstn,
+ handset,
+ speaker
+} phone_ports;
+
+#define PHONE_CAPABILITIES _IO ('q', 0x80)
+#define PHONE_CAPABILITIES_LIST _IOR ('q', 0x81, struct phone_capability *)
+#define PHONE_CAPABILITIES_CHECK _IOW ('q', 0x82, struct phone_capability *)
+
+typedef struct {
+ char month[3];
+ char day[3];
+ char hour[3];
+ char min[3];
+ int numlen;
+ char number[11];
+ int namelen;
+ char name[80];
+} PHONE_CID;
+
+#define PHONE_RING _IO ('q', 0x83)
+#define PHONE_HOOKSTATE _IO ('q', 0x84)
+#define PHONE_MAXRINGS _IOW ('q', 0x85, char)
+#define PHONE_RING_CADENCE _IOW ('q', 0x86, short)
+#define OLD_PHONE_RING_START _IO ('q', 0x87)
+#define PHONE_RING_START _IOW ('q', 0x87, PHONE_CID *)
+#define PHONE_RING_STOP _IO ('q', 0x88)
+
+#define USA_RING_CADENCE 0xC0C0
+
+#define PHONE_REC_CODEC _IOW ('q', 0x89, int)
+#define PHONE_REC_START _IO ('q', 0x8A)
+#define PHONE_REC_STOP _IO ('q', 0x8B)
+#define PHONE_REC_DEPTH _IOW ('q', 0x8C, int)
+#define PHONE_FRAME _IOW ('q', 0x8D, int)
+#define PHONE_REC_VOLUME _IOW ('q', 0x8E, int)
+#define PHONE_REC_VOLUME_LINEAR _IOW ('q', 0xDB, int)
+#define PHONE_REC_LEVEL _IO ('q', 0x8F)
+
+#define PHONE_PLAY_CODEC _IOW ('q', 0x90, int)
+#define PHONE_PLAY_START _IO ('q', 0x91)
+#define PHONE_PLAY_STOP _IO ('q', 0x92)
+#define PHONE_PLAY_DEPTH _IOW ('q', 0x93, int)
+#define PHONE_PLAY_VOLUME _IOW ('q', 0x94, int)
+#define PHONE_PLAY_VOLUME_LINEAR _IOW ('q', 0xDC, int)
+#define PHONE_PLAY_LEVEL _IO ('q', 0x95)
+#define PHONE_DTMF_READY _IOR ('q', 0x96, int)
+#define PHONE_GET_DTMF _IOR ('q', 0x97, int)
+#define PHONE_GET_DTMF_ASCII _IOR ('q', 0x98, int)
+#define PHONE_DTMF_OOB _IOW ('q', 0x99, int)
+#define PHONE_EXCEPTION _IOR ('q', 0x9A, int)
+#define PHONE_PLAY_TONE _IOW ('q', 0x9B, char)
+#define PHONE_SET_TONE_ON_TIME _IOW ('q', 0x9C, int)
+#define PHONE_SET_TONE_OFF_TIME _IOW ('q', 0x9D, int)
+#define PHONE_GET_TONE_ON_TIME _IO ('q', 0x9E)
+#define PHONE_GET_TONE_OFF_TIME _IO ('q', 0x9F)
+#define PHONE_GET_TONE_STATE _IO ('q', 0xA0)
+#define PHONE_BUSY _IO ('q', 0xA1)
+#define PHONE_RINGBACK _IO ('q', 0xA2)
+#define PHONE_DIALTONE _IO ('q', 0xA3)
+#define PHONE_CPT_STOP _IO ('q', 0xA4)
+
+#define PHONE_PSTN_SET_STATE _IOW ('q', 0xA4, int)
+#define PHONE_PSTN_GET_STATE _IO ('q', 0xA5)
+
+#define PSTN_ON_HOOK 0
+#define PSTN_RINGING 1
+#define PSTN_OFF_HOOK 2
+#define PSTN_PULSE_DIAL 3
+
+/******************************************************************************
+*
+* The wink duration is tunable with this ioctl. The default wink duration
+* is 320ms. You do not need to use this ioctl if you do not require a
+* different wink duration.
+*
+******************************************************************************/
+#define PHONE_WINK_DURATION _IOW ('q', 0xA6, int)
+#define PHONE_WINK _IOW ('q', 0xAA, int)
+
+/******************************************************************************
+*
+* Codec Definitions
+*
+******************************************************************************/
+typedef enum {
+ G723_63 = 1,
+ G723_53 = 2,
+ TS85 = 3,
+ TS48 = 4,
+ TS41 = 5,
+ G728 = 6,
+ G729 = 7,
+ ULAW = 8,
+ ALAW = 9,
+ LINEAR16 = 10,
+ LINEAR8 = 11,
+ WSS = 12,
+ G729B = 13
+} phone_codec;
+
+struct phone_codec_data
+{
+ phone_codec type;
+ unsigned short buf_min, buf_opt, buf_max;
+};
+
+#define PHONE_QUERY_CODEC _IOWR ('q', 0xA7, struct phone_codec_data *)
+#define PHONE_PSTN_LINETEST _IO ('q', 0xA8)
+
+/******************************************************************************
+*
+* This controls the VAD/CNG functionality of G.723.1. The driver will
+* always pass full size frames, any unused bytes will be padded with zeros,
+* and frames passed to the driver should also be padded with zeros. The
+* frame type is encoded in the least significant two bits of the first
+* WORD of the frame as follows:
+*
+* bits 1-0 Frame Type Data Rate Significant Words
+* 00 0 G.723.1 6.3 12
+* 01 1 G.723.1 5.3 10
+* 10 2 VAD/CNG 2
+* 11 3 Repeat last CNG 2 bits
+*
+******************************************************************************/
+#define PHONE_VAD _IOW ('q', 0xA9, int)
+
+
+/******************************************************************************
+*
+* The exception structure allows us to multiplex multiple events onto the
+* select() exception set. If any of these flags are set select() will
+* return with a positive indication on the exception set. The dtmf_ready
+* bit indicates if there is data waiting in the DTMF buffer. The
+* hookstate bit is set if there is a change in hookstate status, it does not
+* indicate the current state of the hookswitch. The pstn_ring bit
+* indicates that the DAA on a LineJACK card has detected ring voltage on
+* the PSTN port. The caller_id bit indicates that caller_id data has been
+* received and is available. The pstn_wink bit indicates that the DAA on
+* the LineJACK has received a wink from the telco switch. The f0, f1, f2
+* and f3 bits indicate that the filter has been triggered by detecting the
+* frequency programmed into that filter.
+*
+* The remaining bits should be set to zero. They will become defined over time
+* for other interface cards and their needs.
+*
+******************************************************************************/
+struct phone_except
+{
+ unsigned int dtmf_ready:1;
+ unsigned int hookstate:1;
+ unsigned int pstn_ring:1;
+ unsigned int caller_id:1;
+ unsigned int pstn_wink:1;
+ unsigned int f0:1;
+ unsigned int f1:1;
+ unsigned int f2:1;
+ unsigned int f3:1;
+ unsigned int flash:1;
+ unsigned int fc0:1;
+ unsigned int fc1:1;
+ unsigned int fc2:1;
+ unsigned int fc3:1;
+ unsigned int reserved:18;
+};
+
+union telephony_exception {
+ struct phone_except bits;
+ unsigned int bytes;
+};
+
+
+#endif /* TELEPHONY_H */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/termios.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/termios.h
new file mode 100644
index 0000000..2acd0c1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/termios.h
@@ -0,0 +1,22 @@
+#ifndef _LINUX_TERMIOS_H
+#define _LINUX_TERMIOS_H
+
+#include <linux/types.h>
+#include <asm/termios.h>
+
+#define NFF 5
+
+struct termiox
+{
+ __u16 x_hflag;
+ __u16 x_cflag;
+ __u16 x_rflag[NFF];
+ __u16 x_sflag;
+};
+
+#define RTSXOFF 0x0001 /* RTS flow control on input */
+#define CTSXON 0x0002 /* CTS flow control on output */
+#define DTRXOFF 0x0004 /* DTR flow control on input */
+#define DSRXON 0x0008 /* DCD flow control on output */
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/time.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/time.h
new file mode 100644
index 0000000..12d8c89
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/time.h
@@ -0,0 +1,74 @@
+#ifndef _LINUX_TIME_H
+#define _LINUX_TIME_H
+
+#include <linux/types.h>
+
+
+#ifndef _STRUCT_TIMESPEC
+#define _STRUCT_TIMESPEC
+struct timespec {
+ __kernel_time_t tv_sec; /* seconds */
+ long tv_nsec; /* nanoseconds */
+};
+#endif
+
+struct timeval {
+ __kernel_time_t tv_sec; /* seconds */
+ __kernel_suseconds_t tv_usec; /* microseconds */
+};
+
+struct timezone {
+ int tz_minuteswest; /* minutes west of Greenwich */
+ int tz_dsttime; /* type of dst correction */
+};
+
+
+#define NFDBITS __NFDBITS
+
+#define FD_SETSIZE __FD_SETSIZE
+#define FD_SET(fd,fdsetp) __FD_SET(fd,fdsetp)
+#define FD_CLR(fd,fdsetp) __FD_CLR(fd,fdsetp)
+#define FD_ISSET(fd,fdsetp) __FD_ISSET(fd,fdsetp)
+#define FD_ZERO(fdsetp) __FD_ZERO(fdsetp)
+
+/*
+ * Names of the interval timers, and structure
+ * defining a timer setting:
+ */
+#define ITIMER_REAL 0
+#define ITIMER_VIRTUAL 1
+#define ITIMER_PROF 2
+
+struct itimerspec {
+ struct timespec it_interval; /* timer period */
+ struct timespec it_value; /* timer expiration */
+};
+
+struct itimerval {
+ struct timeval it_interval; /* timer interval */
+ struct timeval it_value; /* current value */
+};
+
+/*
+ * The IDs of the various system clocks (for POSIX.1b interval timers):
+ */
+#define CLOCK_REALTIME 0
+#define CLOCK_MONOTONIC 1
+#define CLOCK_PROCESS_CPUTIME_ID 2
+#define CLOCK_THREAD_CPUTIME_ID 3
+#define CLOCK_MONOTONIC_RAW 4
+
+/*
+ * The IDs of various hardware clocks:
+ */
+#define CLOCK_SGI_CYCLE 10
+#define MAX_CLOCKS 16
+#define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC)
+#define CLOCKS_MONO CLOCK_MONOTONIC
+
+/*
+ * The various flags for setting POSIX.1b interval timers:
+ */
+#define TIMER_ABSTIME 0x01
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/times.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/times.h
new file mode 100644
index 0000000..87b6261
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/times.h
@@ -0,0 +1,13 @@
+#ifndef _LINUX_TIMES_H
+#define _LINUX_TIMES_H
+
+#include <linux/types.h>
+
+struct tms {
+ __kernel_clock_t tms_utime;
+ __kernel_clock_t tms_stime;
+ __kernel_clock_t tms_cutime;
+ __kernel_clock_t tms_cstime;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/timex.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/timex.h
new file mode 100644
index 0000000..43789d9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/timex.h
@@ -0,0 +1,160 @@
+/*****************************************************************************
+ * *
+ * Copyright (c) David L. Mills 1993 *
+ * *
+ * Permission to use, copy, modify, and distribute this software and its *
+ * documentation for any purpose and without fee is hereby granted, provided *
+ * that the above copyright notice appears in all copies and that both the *
+ * copyright notice and this permission notice appear in supporting *
+ * documentation, and that the name University of Delaware not be used in *
+ * advertising or publicity pertaining to distribution of the software *
+ * without specific, written prior permission. The University of Delaware *
+ * makes no representations about the suitability this software for any *
+ * purpose. It is provided "as is" without express or implied warranty. *
+ * *
+ *****************************************************************************/
+
+/*
+ * Modification history timex.h
+ *
+ * 29 Dec 97 Russell King
+ * Moved CLOCK_TICK_RATE, CLOCK_TICK_FACTOR and FINETUNE to asm/timex.h
+ * for ARM machines
+ *
+ * 9 Jan 97 Adrian Sun
+ * Shifted LATCH define to allow access to alpha machines.
+ *
+ * 26 Sep 94 David L. Mills
+ * Added defines for hybrid phase/frequency-lock loop.
+ *
+ * 19 Mar 94 David L. Mills
+ * Moved defines from kernel routines to header file and added new
+ * defines for PPS phase-lock loop.
+ *
+ * 20 Feb 94 David L. Mills
+ * Revised status codes and structures for external clock and PPS
+ * signal discipline.
+ *
+ * 28 Nov 93 David L. Mills
+ * Adjusted parameters to improve stability and increase poll
+ * interval.
+ *
+ * 17 Sep 93 David L. Mills
+ * Created file $NTP/include/sys/timex.h
+ * 07 Oct 93 Torsten Duwe
+ * Derived linux/timex.h
+ * 1995-08-13 Torsten Duwe
+ * kernel PLL updated to 1994-12-13 specs (rfc-1589)
+ * 1997-08-30 Ulrich Windl
+ * Added new constant NTP_PHASE_LIMIT
+ * 2004-08-12 Christoph Lameter
+ * Reworked time interpolation logic
+ */
+#ifndef _LINUX_TIMEX_H
+#define _LINUX_TIMEX_H
+
+#include <linux/time.h>
+
+#define NTP_API 4 /* NTP API version */
+
+/*
+ * syscall interface - used (mainly by NTP daemon)
+ * to discipline kernel clock oscillator
+ */
+struct timex {
+ unsigned int modes; /* mode selector */
+ long offset; /* time offset (usec) */
+ long freq; /* frequency offset (scaled ppm) */
+ long maxerror; /* maximum error (usec) */
+ long esterror; /* estimated error (usec) */
+ int status; /* clock command/status */
+ long constant; /* pll time constant */
+ long precision; /* clock precision (usec) (read only) */
+ long tolerance; /* clock frequency tolerance (ppm)
+ * (read only)
+ */
+ struct timeval time; /* (read only) */
+ long tick; /* (modified) usecs between clock ticks */
+
+ long ppsfreq; /* pps frequency (scaled ppm) (ro) */
+ long jitter; /* pps jitter (us) (ro) */
+ int shift; /* interval duration (s) (shift) (ro) */
+ long stabil; /* pps stability (scaled ppm) (ro) */
+ long jitcnt; /* jitter limit exceeded (ro) */
+ long calcnt; /* calibration intervals (ro) */
+ long errcnt; /* calibration errors (ro) */
+ long stbcnt; /* stability limit exceeded (ro) */
+
+ int tai; /* TAI offset (ro) */
+
+ int :32; int :32; int :32; int :32;
+ int :32; int :32; int :32; int :32;
+ int :32; int :32; int :32;
+};
+
+/*
+ * Mode codes (timex.mode)
+ */
+#define ADJ_OFFSET 0x0001 /* time offset */
+#define ADJ_FREQUENCY 0x0002 /* frequency offset */
+#define ADJ_MAXERROR 0x0004 /* maximum time error */
+#define ADJ_ESTERROR 0x0008 /* estimated time error */
+#define ADJ_STATUS 0x0010 /* clock status */
+#define ADJ_TIMECONST 0x0020 /* pll time constant */
+#define ADJ_TAI 0x0080 /* set TAI offset */
+#define ADJ_MICRO 0x1000 /* select microsecond resolution */
+#define ADJ_NANO 0x2000 /* select nanosecond resolution */
+#define ADJ_TICK 0x4000 /* tick value */
+
+#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */
+#define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */
+
+/* xntp 3.4 compatibility names */
+#define MOD_OFFSET ADJ_OFFSET
+#define MOD_FREQUENCY ADJ_FREQUENCY
+#define MOD_MAXERROR ADJ_MAXERROR
+#define MOD_ESTERROR ADJ_ESTERROR
+#define MOD_STATUS ADJ_STATUS
+#define MOD_TIMECONST ADJ_TIMECONST
+
+
+/*
+ * Status codes (timex.status)
+ */
+#define STA_PLL 0x0001 /* enable PLL updates (rw) */
+#define STA_PPSFREQ 0x0002 /* enable PPS freq discipline (rw) */
+#define STA_PPSTIME 0x0004 /* enable PPS time discipline (rw) */
+#define STA_FLL 0x0008 /* select frequency-lock mode (rw) */
+
+#define STA_INS 0x0010 /* insert leap (rw) */
+#define STA_DEL 0x0020 /* delete leap (rw) */
+#define STA_UNSYNC 0x0040 /* clock unsynchronized (rw) */
+#define STA_FREQHOLD 0x0080 /* hold frequency (rw) */
+
+#define STA_PPSSIGNAL 0x0100 /* PPS signal present (ro) */
+#define STA_PPSJITTER 0x0200 /* PPS signal jitter exceeded (ro) */
+#define STA_PPSWANDER 0x0400 /* PPS signal wander exceeded (ro) */
+#define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */
+
+#define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */
+#define STA_NANO 0x2000 /* resolution (0 = us, 1 = ns) (ro) */
+#define STA_MODE 0x4000 /* mode (0 = PLL, 1 = FLL) (ro) */
+#define STA_CLK 0x8000 /* clock source (0 = A, 1 = B) (ro) */
+
+/* read-only bits */
+#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \
+ STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK)
+
+/*
+ * Clock states (time_state)
+ */
+#define TIME_OK 0 /* clock synchronized, no leap second */
+#define TIME_INS 1 /* insert leap second */
+#define TIME_DEL 2 /* delete leap second */
+#define TIME_OOP 3 /* leap second in progress */
+#define TIME_WAIT 4 /* leap second has occurred */
+#define TIME_ERROR 5 /* clock not synchronized */
+#define TIME_BAD TIME_ERROR /* bw compat */
+
+
+#endif /* LINUX_TIMEX_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tiocl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tiocl.h
new file mode 100644
index 0000000..4756862
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tiocl.h
@@ -0,0 +1,39 @@
+#ifndef _LINUX_TIOCL_H
+#define _LINUX_TIOCL_H
+
+#define TIOCL_SETSEL 2 /* set a selection */
+#define TIOCL_SELCHAR 0 /* select characters */
+#define TIOCL_SELWORD 1 /* select whole words */
+#define TIOCL_SELLINE 2 /* select whole lines */
+#define TIOCL_SELPOINTER 3 /* show the pointer */
+#define TIOCL_SELCLEAR 4 /* clear visibility of selection */
+#define TIOCL_SELMOUSEREPORT 16 /* report beginning of selection */
+#define TIOCL_SELBUTTONMASK 15 /* button mask for report */
+/* selection extent */
+struct tiocl_selection {
+ unsigned short xs; /* X start */
+ unsigned short ys; /* Y start */
+ unsigned short xe; /* X end */
+ unsigned short ye; /* Y end */
+ unsigned short sel_mode; /* selection mode */
+};
+
+#define TIOCL_PASTESEL 3 /* paste previous selection */
+#define TIOCL_UNBLANKSCREEN 4 /* unblank screen */
+
+#define TIOCL_SELLOADLUT 5
+ /* set characters to be considered alphabetic when selecting */
+ /* u32[8] bit array, 4 bytes-aligned with type */
+
+/* these two don't return a value: they write it back in the type */
+#define TIOCL_GETSHIFTSTATE 6 /* write shift state */
+#define TIOCL_GETMOUSEREPORTING 7 /* write whether mouse event are reported */
+#define TIOCL_SETVESABLANK 10 /* set vesa blanking mode */
+#define TIOCL_SETKMSGREDIRECT 11 /* restrict kernel messages to a vt */
+#define TIOCL_GETFGCONSOLE 12 /* get foreground vt */
+#define TIOCL_SCROLLCONSOLE 13 /* scroll console */
+#define TIOCL_BLANKSCREEN 14 /* keep screen blank even if a key is pressed */
+#define TIOCL_BLANKEDSCREEN 15 /* return which vt was blanked */
+#define TIOCL_GETKMSGREDIRECT 17 /* get the vt the kernel messages are restricted to */
+
+#endif /* _LINUX_TIOCL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tipc.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tipc.h
new file mode 100644
index 0000000..3ef026d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tipc.h
@@ -0,0 +1,213 @@
+/*
+ * include/linux/tipc.h: Include file for TIPC socket interface
+ *
+ * Copyright (c) 2003-2006, Ericsson AB
+ * Copyright (c) 2005, Wind River Systems
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LINUX_TIPC_H_
+#define _LINUX_TIPC_H_
+
+#include <linux/types.h>
+
+/*
+ * TIPC addressing primitives
+ */
+
+struct tipc_portid {
+ __u32 ref;
+ __u32 node;
+};
+
+struct tipc_name {
+ __u32 type;
+ __u32 instance;
+};
+
+struct tipc_name_seq {
+ __u32 type;
+ __u32 lower;
+ __u32 upper;
+};
+
+static __inline__ __u32 tipc_addr(unsigned int zone,
+ unsigned int cluster,
+ unsigned int node)
+{
+ return (zone << 24) | (cluster << 12) | node;
+}
+
+static __inline__ unsigned int tipc_zone(__u32 addr)
+{
+ return addr >> 24;
+}
+
+static __inline__ unsigned int tipc_cluster(__u32 addr)
+{
+ return (addr >> 12) & 0xfff;
+}
+
+static __inline__ unsigned int tipc_node(__u32 addr)
+{
+ return addr & 0xfff;
+}
+
+/*
+ * Application-accessible port name types
+ */
+
+#define TIPC_CFG_SRV 0 /* configuration service name type */
+#define TIPC_TOP_SRV 1 /* topology service name type */
+#define TIPC_RESERVED_TYPES 64 /* lowest user-publishable name type */
+
+/*
+ * Publication scopes when binding port names and port name sequences
+ */
+
+#define TIPC_ZONE_SCOPE 1
+#define TIPC_CLUSTER_SCOPE 2
+#define TIPC_NODE_SCOPE 3
+
+/*
+ * Limiting values for messages
+ */
+
+#define TIPC_MAX_USER_MSG_SIZE 66000
+
+/*
+ * Message importance levels
+ */
+
+#define TIPC_LOW_IMPORTANCE 0 /* default */
+#define TIPC_MEDIUM_IMPORTANCE 1
+#define TIPC_HIGH_IMPORTANCE 2
+#define TIPC_CRITICAL_IMPORTANCE 3
+
+/*
+ * Msg rejection/connection shutdown reasons
+ */
+
+#define TIPC_OK 0
+#define TIPC_ERR_NO_NAME 1
+#define TIPC_ERR_NO_PORT 2
+#define TIPC_ERR_NO_NODE 3
+#define TIPC_ERR_OVERLOAD 4
+#define TIPC_CONN_SHUTDOWN 5
+
+/*
+ * TIPC topology subscription service definitions
+ */
+
+#define TIPC_SUB_PORTS 0x01 /* filter for port availability */
+#define TIPC_SUB_SERVICE 0x02 /* filter for service availability */
+#define TIPC_SUB_CANCEL 0x04 /* cancel a subscription */
+#if 0
+/* The following filter options are not currently implemented */
+#define TIPC_SUB_NO_BIND_EVTS 0x04 /* filter out "publish" events */
+#define TIPC_SUB_NO_UNBIND_EVTS 0x08 /* filter out "withdraw" events */
+#define TIPC_SUB_SINGLE_EVT 0x10 /* expire after first event */
+#endif
+
+#define TIPC_WAIT_FOREVER ~0 /* timeout for permanent subscription */
+
+struct tipc_subscr {
+ struct tipc_name_seq seq; /* name sequence of interest */
+ __u32 timeout; /* subscription duration (in ms) */
+ __u32 filter; /* bitmask of filter options */
+ char usr_handle[8]; /* available for subscriber use */
+};
+
+#define TIPC_PUBLISHED 1 /* publication event */
+#define TIPC_WITHDRAWN 2 /* withdraw event */
+#define TIPC_SUBSCR_TIMEOUT 3 /* subscription timeout event */
+
+struct tipc_event {
+ __u32 event; /* event type */
+ __u32 found_lower; /* matching name seq instances */
+ __u32 found_upper; /* " " " " */
+ struct tipc_portid port; /* associated port */
+ struct tipc_subscr s; /* associated subscription */
+};
+
+/*
+ * Socket API
+ */
+
+#ifndef AF_TIPC
+#define AF_TIPC 30
+#endif
+
+#ifndef PF_TIPC
+#define PF_TIPC AF_TIPC
+#endif
+
+#ifndef SOL_TIPC
+#define SOL_TIPC 271
+#endif
+
+#define TIPC_ADDR_NAMESEQ 1
+#define TIPC_ADDR_MCAST 1
+#define TIPC_ADDR_NAME 2
+#define TIPC_ADDR_ID 3
+
+struct sockaddr_tipc {
+ unsigned short family;
+ unsigned char addrtype;
+ signed char scope;
+ union {
+ struct tipc_portid id;
+ struct tipc_name_seq nameseq;
+ struct {
+ struct tipc_name name;
+ __u32 domain; /* 0: own zone */
+ } name;
+ } addr;
+};
+
+/*
+ * Ancillary data objects supported by recvmsg()
+ */
+
+#define TIPC_ERRINFO 1 /* error info */
+#define TIPC_RETDATA 2 /* returned data */
+#define TIPC_DESTNAME 3 /* destination name */
+
+/*
+ * TIPC-specific socket option values
+ */
+
+#define TIPC_IMPORTANCE 127 /* Default: TIPC_LOW_IMPORTANCE */
+#define TIPC_SRC_DROPPABLE 128 /* Default: 0 (resend congested msg) */
+#define TIPC_DEST_DROPPABLE 129 /* Default: based on socket type */
+#define TIPC_CONN_TIMEOUT 130 /* Default: 8000 (ms) */
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tipc_config.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tipc_config.h
new file mode 100644
index 0000000..a4b59c1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tipc_config.h
@@ -0,0 +1,418 @@
+/*
+ * include/linux/tipc_config.h: Include file for TIPC configuration interface
+ *
+ * Copyright (c) 2003-2006, Ericsson AB
+ * Copyright (c) 2005-2007, Wind River Systems
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LINUX_TIPC_CONFIG_H_
+#define _LINUX_TIPC_CONFIG_H_
+
+#include <linux/types.h>
+#include <linux/string.h>
+#include <asm/byteorder.h>
+
+/*
+ * Configuration
+ *
+ * All configuration management messaging involves sending a request message
+ * to the TIPC configuration service on a node, which sends a reply message
+ * back. (In the future multi-message replies may be supported.)
+ *
+ * Both request and reply messages consist of a transport header and payload.
+ * The transport header contains info about the desired operation;
+ * the payload consists of zero or more type/length/value (TLV) items
+ * which specify parameters or results for the operation.
+ *
+ * For many operations, the request and reply messages have a fixed number
+ * of TLVs (usually zero or one); however, some reply messages may return
+ * a variable number of TLVs. A failed request is denoted by the presence
+ * of an "error string" TLV in the reply message instead of the TLV(s) the
+ * reply should contain if the request succeeds.
+ */
+
+/*
+ * Public commands:
+ * May be issued by any process.
+ * Accepted by own node, or by remote node only if remote management enabled.
+ */
+
+#define TIPC_CMD_NOOP 0x0000 /* tx none, rx none */
+#define TIPC_CMD_GET_NODES 0x0001 /* tx net_addr, rx node_info(s) */
+#define TIPC_CMD_GET_MEDIA_NAMES 0x0002 /* tx none, rx media_name(s) */
+#define TIPC_CMD_GET_BEARER_NAMES 0x0003 /* tx none, rx bearer_name(s) */
+#define TIPC_CMD_GET_LINKS 0x0004 /* tx net_addr, rx link_info(s) */
+#define TIPC_CMD_SHOW_NAME_TABLE 0x0005 /* tx name_tbl_query, rx ultra_string */
+#define TIPC_CMD_SHOW_PORTS 0x0006 /* tx none, rx ultra_string */
+#define TIPC_CMD_SHOW_LINK_STATS 0x000B /* tx link_name, rx ultra_string */
+
+#if 0
+#define TIPC_CMD_SHOW_PORT_STATS 0x0008 /* tx port_ref, rx ultra_string */
+#define TIPC_CMD_RESET_PORT_STATS 0x0009 /* tx port_ref, rx none */
+#define TIPC_CMD_GET_ROUTES 0x000A /* tx ?, rx ? */
+#define TIPC_CMD_GET_LINK_PEER 0x000D /* tx link_name, rx ? */
+#endif
+
+/*
+ * Protected commands:
+ * May only be issued by "network administration capable" process.
+ * Accepted by own node, or by remote node only if remote management enabled
+ * and this node is zone manager.
+ */
+
+#define TIPC_CMD_GET_REMOTE_MNG 0x4003 /* tx none, rx unsigned */
+#define TIPC_CMD_GET_MAX_PORTS 0x4004 /* tx none, rx unsigned */
+#define TIPC_CMD_GET_MAX_PUBL 0x4005 /* tx none, rx unsigned */
+#define TIPC_CMD_GET_MAX_SUBSCR 0x4006 /* tx none, rx unsigned */
+#define TIPC_CMD_GET_MAX_ZONES 0x4007 /* tx none, rx unsigned */
+#define TIPC_CMD_GET_MAX_CLUSTERS 0x4008 /* tx none, rx unsigned */
+#define TIPC_CMD_GET_MAX_NODES 0x4009 /* tx none, rx unsigned */
+#define TIPC_CMD_GET_MAX_SLAVES 0x400A /* tx none, rx unsigned */
+#define TIPC_CMD_GET_NETID 0x400B /* tx none, rx unsigned */
+
+#define TIPC_CMD_ENABLE_BEARER 0x4101 /* tx bearer_config, rx none */
+#define TIPC_CMD_DISABLE_BEARER 0x4102 /* tx bearer_name, rx none */
+#define TIPC_CMD_SET_LINK_TOL 0x4107 /* tx link_config, rx none */
+#define TIPC_CMD_SET_LINK_PRI 0x4108 /* tx link_config, rx none */
+#define TIPC_CMD_SET_LINK_WINDOW 0x4109 /* tx link_config, rx none */
+#define TIPC_CMD_SET_LOG_SIZE 0x410A /* tx unsigned, rx none */
+#define TIPC_CMD_DUMP_LOG 0x410B /* tx none, rx ultra_string */
+#define TIPC_CMD_RESET_LINK_STATS 0x410C /* tx link_name, rx none */
+
+#if 0
+#define TIPC_CMD_CREATE_LINK 0x4103 /* tx link_create, rx none */
+#define TIPC_CMD_REMOVE_LINK 0x4104 /* tx link_name, rx none */
+#define TIPC_CMD_BLOCK_LINK 0x4105 /* tx link_name, rx none */
+#define TIPC_CMD_UNBLOCK_LINK 0x4106 /* tx link_name, rx none */
+#endif
+
+/*
+ * Private commands:
+ * May only be issued by "network administration capable" process.
+ * Accepted by own node only; cannot be used on a remote node.
+ */
+
+#define TIPC_CMD_SET_NODE_ADDR 0x8001 /* tx net_addr, rx none */
+#if 0
+#define TIPC_CMD_SET_ZONE_MASTER 0x8002 /* tx none, rx none */
+#endif
+#define TIPC_CMD_SET_REMOTE_MNG 0x8003 /* tx unsigned, rx none */
+#define TIPC_CMD_SET_MAX_PORTS 0x8004 /* tx unsigned, rx none */
+#define TIPC_CMD_SET_MAX_PUBL 0x8005 /* tx unsigned, rx none */
+#define TIPC_CMD_SET_MAX_SUBSCR 0x8006 /* tx unsigned, rx none */
+#define TIPC_CMD_SET_MAX_ZONES 0x8007 /* tx unsigned, rx none */
+#define TIPC_CMD_SET_MAX_CLUSTERS 0x8008 /* tx unsigned, rx none */
+#define TIPC_CMD_SET_MAX_NODES 0x8009 /* tx unsigned, rx none */
+#define TIPC_CMD_SET_MAX_SLAVES 0x800A /* tx unsigned, rx none */
+#define TIPC_CMD_SET_NETID 0x800B /* tx unsigned, rx none */
+
+/*
+ * Reserved commands:
+ * May not be issued by any process.
+ * Used internally by TIPC.
+ */
+
+#define TIPC_CMD_NOT_NET_ADMIN 0xC001 /* tx none, rx none */
+
+/*
+ * TLV types defined for TIPC
+ */
+
+#define TIPC_TLV_NONE 0 /* no TLV present */
+#define TIPC_TLV_VOID 1 /* empty TLV (0 data bytes)*/
+#define TIPC_TLV_UNSIGNED 2 /* 32-bit integer */
+#define TIPC_TLV_STRING 3 /* char[128] (max) */
+#define TIPC_TLV_LARGE_STRING 4 /* char[2048] (max) */
+#define TIPC_TLV_ULTRA_STRING 5 /* char[32768] (max) */
+
+#define TIPC_TLV_ERROR_STRING 16 /* char[128] containing "error code" */
+#define TIPC_TLV_NET_ADDR 17 /* 32-bit integer denoting <Z.C.N> */
+#define TIPC_TLV_MEDIA_NAME 18 /* char[TIPC_MAX_MEDIA_NAME] */
+#define TIPC_TLV_BEARER_NAME 19 /* char[TIPC_MAX_BEARER_NAME] */
+#define TIPC_TLV_LINK_NAME 20 /* char[TIPC_MAX_LINK_NAME] */
+#define TIPC_TLV_NODE_INFO 21 /* struct tipc_node_info */
+#define TIPC_TLV_LINK_INFO 22 /* struct tipc_link_info */
+#define TIPC_TLV_BEARER_CONFIG 23 /* struct tipc_bearer_config */
+#define TIPC_TLV_LINK_CONFIG 24 /* struct tipc_link_config */
+#define TIPC_TLV_NAME_TBL_QUERY 25 /* struct tipc_name_table_query */
+#define TIPC_TLV_PORT_REF 26 /* 32-bit port reference */
+
+/*
+ * Maximum sizes of TIPC bearer-related names (including terminating NUL)
+ */
+
+#define TIPC_MAX_MEDIA_NAME 16 /* format = media */
+#define TIPC_MAX_IF_NAME 16 /* format = interface */
+#define TIPC_MAX_BEARER_NAME 32 /* format = media:interface */
+#define TIPC_MAX_LINK_NAME 60 /* format = Z.C.N:interface-Z.C.N:interface */
+
+/*
+ * Link priority limits (min, default, max, media default)
+ */
+
+#define TIPC_MIN_LINK_PRI 0
+#define TIPC_DEF_LINK_PRI 10
+#define TIPC_MAX_LINK_PRI 31
+#define TIPC_MEDIA_LINK_PRI (TIPC_MAX_LINK_PRI + 1)
+
+/*
+ * Link tolerance limits (min, default, max), in ms
+ */
+
+#define TIPC_MIN_LINK_TOL 50
+#define TIPC_DEF_LINK_TOL 1500
+#define TIPC_MAX_LINK_TOL 30000
+
+/*
+ * Link window limits (min, default, max), in packets
+ */
+
+#define TIPC_MIN_LINK_WIN 16
+#define TIPC_DEF_LINK_WIN 50
+#define TIPC_MAX_LINK_WIN 150
+
+
+struct tipc_node_info {
+ __be32 addr; /* network address of node */
+ __be32 up; /* 0=down, 1= up */
+};
+
+struct tipc_link_info {
+ __be32 dest; /* network address of peer node */
+ __be32 up; /* 0=down, 1=up */
+ char str[TIPC_MAX_LINK_NAME]; /* link name */
+};
+
+struct tipc_bearer_config {
+ __be32 priority; /* Range [1,31]. Override per link */
+ __be32 detect_scope;
+ char name[TIPC_MAX_BEARER_NAME];
+};
+
+struct tipc_link_config {
+ __be32 value;
+ char name[TIPC_MAX_LINK_NAME];
+};
+
+#define TIPC_NTQ_ALLTYPES 0x80000000
+
+struct tipc_name_table_query {
+ __be32 depth; /* 1:type, 2:+name info, 3:+port info, 4+:+debug info */
+ __be32 type; /* {t,l,u} info ignored if high bit of "depth" is set */
+ __be32 lowbound; /* (i.e. displays all entries of name table) */
+ __be32 upbound;
+};
+
+/*
+ * The error string TLV is a null-terminated string describing the cause
+ * of the request failure. To simplify error processing (and to save space)
+ * the first character of the string can be a special error code character
+ * (lying by the range 0x80 to 0xFF) which represents a pre-defined reason.
+ */
+
+#define TIPC_CFG_TLV_ERROR "\x80" /* request contains incorrect TLV(s) */
+#define TIPC_CFG_NOT_NET_ADMIN "\x81" /* must be network administrator */
+#define TIPC_CFG_NOT_ZONE_MSTR "\x82" /* must be zone master */
+#define TIPC_CFG_NO_REMOTE "\x83" /* remote management not enabled */
+#define TIPC_CFG_NOT_SUPPORTED "\x84" /* request is not supported by TIPC */
+#define TIPC_CFG_INVALID_VALUE "\x85" /* request has invalid argument value */
+
+#if 0
+/* prototypes TLV structures for proposed commands */
+struct tipc_link_create {
+ __u32 domain;
+ struct tipc_media_addr peer_addr;
+ char bearer_name[TIPC_MAX_BEARER_NAME];
+};
+
+struct tipc_route_info {
+ __u32 dest;
+ __u32 router;
+};
+#endif
+
+/*
+ * A TLV consists of a descriptor, followed by the TLV value.
+ * TLV descriptor fields are stored in network byte order;
+ * TLV values must also be stored in network byte order (where applicable).
+ * TLV descriptors must be aligned to addresses which are multiple of 4,
+ * so up to 3 bytes of padding may exist at the end of the TLV value area.
+ * There must not be any padding between the TLV descriptor and its value.
+ */
+
+struct tlv_desc {
+ __be16 tlv_len; /* TLV length (descriptor + value) */
+ __be16 tlv_type; /* TLV identifier */
+};
+
+#define TLV_ALIGNTO 4
+
+#define TLV_ALIGN(datalen) (((datalen)+(TLV_ALIGNTO-1)) & ~(TLV_ALIGNTO-1))
+#define TLV_LENGTH(datalen) (sizeof(struct tlv_desc) + (datalen))
+#define TLV_SPACE(datalen) (TLV_ALIGN(TLV_LENGTH(datalen)))
+#define TLV_DATA(tlv) ((void *)((char *)(tlv) + TLV_LENGTH(0)))
+
+static __inline__ int TLV_OK(const void *tlv, __u16 space)
+{
+ /*
+ * Would also like to check that "tlv" is a multiple of 4,
+ * but don't know how to do this in a portable way.
+ * - Tried doing (!(tlv & (TLV_ALIGNTO-1))), but GCC compiler
+ * won't allow binary "&" with a pointer.
+ * - Tried casting "tlv" to integer type, but causes warning about size
+ * mismatch when pointer is bigger than chosen type (int, long, ...).
+ */
+
+ return (space >= TLV_SPACE(0)) &&
+ (ntohs(((struct tlv_desc *)tlv)->tlv_len) <= space);
+}
+
+static __inline__ int TLV_CHECK(const void *tlv, __u16 space, __u16 exp_type)
+{
+ return TLV_OK(tlv, space) &&
+ (ntohs(((struct tlv_desc *)tlv)->tlv_type) == exp_type);
+}
+
+static __inline__ int TLV_SET(void *tlv, __u16 type, void *data, __u16 len)
+{
+ struct tlv_desc *tlv_ptr;
+ int tlv_len;
+
+ tlv_len = TLV_LENGTH(len);
+ tlv_ptr = (struct tlv_desc *)tlv;
+ tlv_ptr->tlv_type = htons(type);
+ tlv_ptr->tlv_len = htons(tlv_len);
+ if (len && data)
+ memcpy(TLV_DATA(tlv_ptr), data, tlv_len);
+ return TLV_SPACE(len);
+}
+
+/*
+ * A TLV list descriptor simplifies processing of messages
+ * containing multiple TLVs.
+ */
+
+struct tlv_list_desc {
+ struct tlv_desc *tlv_ptr; /* ptr to current TLV */
+ __u32 tlv_space; /* # bytes from curr TLV to list end */
+};
+
+static __inline__ void TLV_LIST_INIT(struct tlv_list_desc *list,
+ void *data, __u32 space)
+{
+ list->tlv_ptr = (struct tlv_desc *)data;
+ list->tlv_space = space;
+}
+
+static __inline__ int TLV_LIST_EMPTY(struct tlv_list_desc *list)
+{
+ return (list->tlv_space == 0);
+}
+
+static __inline__ int TLV_LIST_CHECK(struct tlv_list_desc *list, __u16 exp_type)
+{
+ return TLV_CHECK(list->tlv_ptr, list->tlv_space, exp_type);
+}
+
+static __inline__ void *TLV_LIST_DATA(struct tlv_list_desc *list)
+{
+ return TLV_DATA(list->tlv_ptr);
+}
+
+static __inline__ void TLV_LIST_STEP(struct tlv_list_desc *list)
+{
+ __u16 tlv_space = TLV_ALIGN(ntohs(list->tlv_ptr->tlv_len));
+
+ list->tlv_ptr = (struct tlv_desc *)((char *)list->tlv_ptr + tlv_space);
+ list->tlv_space -= tlv_space;
+}
+
+/*
+ * Configuration messages exchanged via NETLINK_GENERIC use the following
+ * family id, name, version and command.
+ */
+#define TIPC_GENL_NAME "TIPC"
+#define TIPC_GENL_VERSION 0x1
+#define TIPC_GENL_CMD 0x1
+
+/*
+ * TIPC specific header used in NETLINK_GENERIC requests.
+ */
+struct tipc_genlmsghdr {
+ __u32 dest; /* Destination address */
+ __u16 cmd; /* Command */
+ __u16 reserved; /* Unused */
+};
+
+#define TIPC_GENL_HDRLEN NLMSG_ALIGN(sizeof(struct tipc_genlmsghdr))
+
+/*
+ * Configuration messages exchanged via TIPC sockets use the TIPC configuration
+ * message header, which is defined below. This structure is analogous
+ * to the Netlink message header, but fields are stored in network byte order
+ * and no padding is permitted between the header and the message data
+ * that follows.
+ */
+
+struct tipc_cfg_msg_hdr
+{
+ __be32 tcm_len; /* Message length (including header) */
+ __be16 tcm_type; /* Command type */
+ __be16 tcm_flags; /* Additional flags */
+ char tcm_reserved[8]; /* Unused */
+};
+
+#define TCM_F_REQUEST 0x1 /* Flag: Request message */
+#define TCM_F_MORE 0x2 /* Flag: Message to be continued */
+
+#define TCM_ALIGN(datalen) (((datalen)+3) & ~3)
+#define TCM_LENGTH(datalen) (sizeof(struct tipc_cfg_msg_hdr) + datalen)
+#define TCM_SPACE(datalen) (TCM_ALIGN(TCM_LENGTH(datalen)))
+#define TCM_DATA(tcm_hdr) ((void *)((char *)(tcm_hdr) + TCM_LENGTH(0)))
+
+static __inline__ int TCM_SET(void *msg, __u16 cmd, __u16 flags,
+ void *data, __u16 data_len)
+{
+ struct tipc_cfg_msg_hdr *tcm_hdr;
+ int msg_len;
+
+ msg_len = TCM_LENGTH(data_len);
+ tcm_hdr = (struct tipc_cfg_msg_hdr *)msg;
+ tcm_hdr->tcm_len = htonl(msg_len);
+ tcm_hdr->tcm_type = htons(cmd);
+ tcm_hdr->tcm_flags = htons(flags);
+ if (data_len && data)
+ memcpy(TCM_DATA(msg), data, data_len);
+ return TCM_SPACE(data_len);
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/toshiba.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/toshiba.h
new file mode 100644
index 0000000..6a7c4ed
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/toshiba.h
@@ -0,0 +1,38 @@
+/* toshiba.h -- Linux driver for accessing the SMM on Toshiba laptops
+ *
+ * Copyright (c) 1996-2000 Jonathan A. Buzzard (jonathan@buzzard.org.uk)
+ *
+ * Thanks to Juergen Heinzl <juergen@monocerus.demon.co.uk> for the pointers
+ * on making sure the structure is aligned and packed.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef _LINUX_TOSHIBA_H
+#define _LINUX_TOSHIBA_H
+
+#define TOSH_PROC "/proc/toshiba"
+#define TOSH_DEVICE "/dev/toshiba"
+#define TOSH_SMM _IOWR('t', 0x90, int) /* broken: meant 24 bytes */
+
+typedef struct {
+ unsigned int eax;
+ unsigned int ebx __attribute__ ((packed));
+ unsigned int ecx __attribute__ ((packed));
+ unsigned int edx __attribute__ ((packed));
+ unsigned int esi __attribute__ ((packed));
+ unsigned int edi __attribute__ ((packed));
+} SMMRegisters;
+
+int tosh_smm(SMMRegisters *regs);
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tty.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tty.h
new file mode 100644
index 0000000..98996ba
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/tty.h
@@ -0,0 +1,8 @@
+#ifndef _LINUX_TTY_H
+#define _LINUX_TTY_H
+
+/*
+ * 'tty.h' defines some structures used by tty_io.c and some defines.
+ */
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/types.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/types.h
new file mode 100644
index 0000000..8b483c8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/types.h
@@ -0,0 +1,38 @@
+#ifndef _LINUX_TYPES_H
+#define _LINUX_TYPES_H
+
+#include <asm/types.h>
+
+#ifndef __ASSEMBLY__
+
+#include <linux/posix_types.h>
+
+
+/*
+ * Below are truly Linux-specific types that should never collide with
+ * any application/library that wants linux/types.h.
+ */
+
+#ifdef __CHECKER__
+#define __bitwise__ __attribute__((bitwise))
+#else
+#define __bitwise__
+#endif
+#ifdef __CHECK_ENDIAN__
+#define __bitwise __bitwise__
+#else
+#define __bitwise
+#endif
+
+typedef __u16 __bitwise __le16;
+typedef __u16 __bitwise __be16;
+typedef __u32 __bitwise __le32;
+typedef __u32 __bitwise __be32;
+typedef __u64 __bitwise __le64;
+typedef __u64 __bitwise __be64;
+
+typedef __u16 __bitwise __sum16;
+typedef __u32 __bitwise __wsum;
+
+#endif /* __ASSEMBLY__ */
+#endif /* _LINUX_TYPES_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/udf_fs_i.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/udf_fs_i.h
new file mode 100644
index 0000000..3536965
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/udf_fs_i.h
@@ -0,0 +1,21 @@
+/*
+ * udf_fs_i.h
+ *
+ * This file is intended for the Linux kernel/module.
+ *
+ * COPYRIGHT
+ * This file is distributed under the terms of the GNU General Public
+ * License (GPL). Copies of the GPL can be obtained from:
+ * ftp://prep.ai.mit.edu/pub/gnu/GPL
+ * Each contributing author retains all rights to their own work.
+ */
+#ifndef _UDF_FS_I_H
+#define _UDF_FS_I_H 1
+
+/* exported IOCTLs, we have 'l', 0x40-0x7f */
+#define UDF_GETEASIZE _IOR('l', 0x40, int)
+#define UDF_GETEABLOCK _IOR('l', 0x41, void *)
+#define UDF_GETVOLIDENT _IOR('l', 0x42, void *)
+#define UDF_RELOCATE_BLOCKS _IOWR('l', 0x43, long)
+
+#endif /* _UDF_FS_I_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/udp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/udp.h
new file mode 100644
index 0000000..13cf21a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/udp.h
@@ -0,0 +1,39 @@
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Definitions for the UDP protocol.
+ *
+ * Version: @(#)udp.h 1.0.2 04/28/93
+ *
+ * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_UDP_H
+#define _LINUX_UDP_H
+
+#include <linux/types.h>
+
+struct udphdr {
+ __be16 source;
+ __be16 dest;
+ __be16 len;
+ __sum16 check;
+};
+
+/* UDP socket options */
+#define UDP_CORK 1 /* Never send partially complete segments */
+#define UDP_ENCAP 100 /* Set the socket to accept encapsulated packets */
+
+/* UDP encapsulation types */
+#define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
+#define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */
+#define UDP_ENCAP_L2TPINUDP 3 /* rfc2661 */
+
+
+#endif /* _LINUX_UDP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/uinput.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/uinput.h
new file mode 100644
index 0000000..8ffd7da
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/uinput.h
@@ -0,0 +1,136 @@
+#ifndef __UINPUT_H_
+#define __UINPUT_H_
+/*
+ * User level driver support for input subsystem
+ *
+ * Heavily based on evdev.c by Vojtech Pavlik
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
+ *
+ * Changes/Revisions:
+ * 0.3 24/05/2006 (Anssi Hannula <anssi.hannulagmail.com>)
+ * - update ff support for the changes in kernel interface
+ * - add UINPUT_VERSION
+ * 0.2 16/10/2004 (Micah Dowty <micah@navi.cx>)
+ * - added force feedback support
+ * - added UI_SET_PHYS
+ * 0.1 20/06/2002
+ * - first public version
+ */
+
+#include <linux/input.h>
+
+#define UINPUT_VERSION 3
+
+
+struct uinput_ff_upload {
+ int request_id;
+ int retval;
+ struct ff_effect effect;
+ struct ff_effect old;
+};
+
+struct uinput_ff_erase {
+ int request_id;
+ int retval;
+ int effect_id;
+};
+
+/* ioctl */
+#define UINPUT_IOCTL_BASE 'U'
+#define UI_DEV_CREATE _IO(UINPUT_IOCTL_BASE, 1)
+#define UI_DEV_DESTROY _IO(UINPUT_IOCTL_BASE, 2)
+
+#define UI_SET_EVBIT _IOW(UINPUT_IOCTL_BASE, 100, int)
+#define UI_SET_KEYBIT _IOW(UINPUT_IOCTL_BASE, 101, int)
+#define UI_SET_RELBIT _IOW(UINPUT_IOCTL_BASE, 102, int)
+#define UI_SET_ABSBIT _IOW(UINPUT_IOCTL_BASE, 103, int)
+#define UI_SET_MSCBIT _IOW(UINPUT_IOCTL_BASE, 104, int)
+#define UI_SET_LEDBIT _IOW(UINPUT_IOCTL_BASE, 105, int)
+#define UI_SET_SNDBIT _IOW(UINPUT_IOCTL_BASE, 106, int)
+#define UI_SET_FFBIT _IOW(UINPUT_IOCTL_BASE, 107, int)
+#define UI_SET_PHYS _IOW(UINPUT_IOCTL_BASE, 108, char*)
+#define UI_SET_SWBIT _IOW(UINPUT_IOCTL_BASE, 109, int)
+
+#define UI_BEGIN_FF_UPLOAD _IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload)
+#define UI_END_FF_UPLOAD _IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload)
+#define UI_BEGIN_FF_ERASE _IOWR(UINPUT_IOCTL_BASE, 202, struct uinput_ff_erase)
+#define UI_END_FF_ERASE _IOW(UINPUT_IOCTL_BASE, 203, struct uinput_ff_erase)
+
+/*
+ * To write a force-feedback-capable driver, the upload_effect
+ * and erase_effect callbacks in input_dev must be implemented.
+ * The uinput driver will generate a fake input event when one of
+ * these callbacks are invoked. The userspace code then uses
+ * ioctls to retrieve additional parameters and send the return code.
+ * The callback blocks until this return code is sent.
+ *
+ * The described callback mechanism is only used if ff_effects_max
+ * is set.
+ *
+ * To implement upload_effect():
+ * 1. Wait for an event with type == EV_UINPUT and code == UI_FF_UPLOAD.
+ * A request ID will be given in 'value'.
+ * 2. Allocate a uinput_ff_upload struct, fill in request_id with
+ * the 'value' from the EV_UINPUT event.
+ * 3. Issue a UI_BEGIN_FF_UPLOAD ioctl, giving it the
+ * uinput_ff_upload struct. It will be filled in with the
+ * ff_effects passed to upload_effect().
+ * 4. Perform the effect upload, and place a return code back into
+ the uinput_ff_upload struct.
+ * 5. Issue a UI_END_FF_UPLOAD ioctl, also giving it the
+ * uinput_ff_upload_effect struct. This will complete execution
+ * of our upload_effect() handler.
+ *
+ * To implement erase_effect():
+ * 1. Wait for an event with type == EV_UINPUT and code == UI_FF_ERASE.
+ * A request ID will be given in 'value'.
+ * 2. Allocate a uinput_ff_erase struct, fill in request_id with
+ * the 'value' from the EV_UINPUT event.
+ * 3. Issue a UI_BEGIN_FF_ERASE ioctl, giving it the
+ * uinput_ff_erase struct. It will be filled in with the
+ * effect ID passed to erase_effect().
+ * 4. Perform the effect erasure, and place a return code back
+ * into the uinput_ff_erase struct.
+ * 5. Issue a UI_END_FF_ERASE ioctl, also giving it the
+ * uinput_ff_erase_effect struct. This will complete execution
+ * of our erase_effect() handler.
+ */
+
+/*
+ * This is the new event type, used only by uinput.
+ * 'code' is UI_FF_UPLOAD or UI_FF_ERASE, and 'value'
+ * is the unique request ID. This number was picked
+ * arbitrarily, above EV_MAX (since the input system
+ * never sees it) but in the range of a 16-bit int.
+ */
+#define EV_UINPUT 0x0101
+#define UI_FF_UPLOAD 1
+#define UI_FF_ERASE 2
+
+#define UINPUT_MAX_NAME_SIZE 80
+struct uinput_user_dev {
+ char name[UINPUT_MAX_NAME_SIZE];
+ struct input_id id;
+ int ff_effects_max;
+ int absmax[ABS_MAX + 1];
+ int absmin[ABS_MAX + 1];
+ int absfuzz[ABS_MAX + 1];
+ int absflat[ABS_MAX + 1];
+};
+#endif /* __UINPUT_H_ */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/uio.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/uio.h
new file mode 100644
index 0000000..f1cf625
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/uio.h
@@ -0,0 +1,49 @@
+#ifndef __LINUX_UIO_H
+#define __LINUX_UIO_H
+
+
+#include <linux/types.h>
+
+/*
+ * Berkeley style UIO structures - Alan Cox 1994.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+struct iovec
+{
+ void *iov_base; /* BSD uses caddr_t (1003.1g requires void *) */
+ __kernel_size_t iov_len; /* Must be size_t (1003.1g) */
+};
+
+
+/*
+ * UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1)
+ */
+
+#define UIO_FASTIOV 8
+#define UIO_MAXIOV 1024
+
+/*
+ * Total number of bytes covered by an iovec.
+ *
+ * NOTE that it is not safe to use this function until all the iovec's
+ * segment lengths have been validated. Because the individual lengths can
+ * overflow a size_t when added together.
+ */
+static __inline__ size_t iov_length(const struct iovec *iov, unsigned long nr_segs)
+{
+ unsigned long seg;
+ size_t ret = 0;
+
+ for (seg = 0; seg < nr_segs; seg++)
+ ret += iov[seg].iov_len;
+ return ret;
+}
+
+unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to);
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ultrasound.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ultrasound.h
new file mode 100644
index 0000000..6b7703e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/ultrasound.h
@@ -0,0 +1,103 @@
+#ifndef _ULTRASOUND_H_
+#define _ULTRASOUND_H_
+/*
+ * ultrasound.h - Macros for programming the Gravis Ultrasound
+ * These macros are extremely device dependent
+ * and not portable.
+ */
+/*
+ * Copyright (C) by Hannu Savolainen 1993-1997
+ *
+ * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
+ * Version 2 (June 1991). See the "COPYING" file distributed with this software
+ * for more info.
+ */
+
+
+/*
+ * Private events for Gravis Ultrasound (GUS)
+ *
+ * Format:
+ * byte 0 - SEQ_PRIVATE (0xfe)
+ * byte 1 - Synthesizer device number (0-N)
+ * byte 2 - Command (see below)
+ * byte 3 - Voice number (0-31)
+ * bytes 4 and 5 - parameter P1 (unsigned short)
+ * bytes 6 and 7 - parameter P2 (unsigned short)
+ *
+ * Commands:
+ * Each command affects one voice defined in byte 3.
+ * Unused parameters (P1 and/or P2 *MUST* be initialized to zero).
+ * _GUS_NUMVOICES - Sets max. number of concurrent voices (P1=14-31, default 16)
+ * _GUS_VOICESAMPLE- ************ OBSOLETE *************
+ * _GUS_VOICEON - Starts voice (P1=voice mode)
+ * _GUS_VOICEOFF - Stops voice (no parameters)
+ * _GUS_VOICEFADE - Stops the voice smoothly.
+ * _GUS_VOICEMODE - Alters the voice mode, don't start or stop voice (P1=voice mode)
+ * _GUS_VOICEBALA - Sets voice balence (P1, 0=left, 7=middle and 15=right, default 7)
+ * _GUS_VOICEFREQ - Sets voice (sample) playback frequency (P1=Hz)
+ * _GUS_VOICEVOL - Sets voice volume (P1=volume, 0xfff=max, 0xeff=half, 0x000=off)
+ * _GUS_VOICEVOL2 - Sets voice volume (P1=volume, 0xfff=max, 0xeff=half, 0x000=off)
+ * (Like GUS_VOICEVOL but doesn't change the hw
+ * volume. It just updates volume in the voice table).
+ *
+ * _GUS_RAMPRANGE - Sets limits for volume ramping (P1=low volume, P2=high volume)
+ * _GUS_RAMPRATE - Sets the speed for volume ramping (P1=scale, P2=rate)
+ * _GUS_RAMPMODE - Sets the volume ramping mode (P1=ramping mode)
+ * _GUS_RAMPON - Starts volume ramping (no parameters)
+ * _GUS_RAMPOFF - Stops volume ramping (no parameters)
+ * _GUS_VOLUME_SCALE - Changes the volume calculation constants
+ * for all voices.
+ */
+
+#define _GUS_NUMVOICES 0x00
+#define _GUS_VOICESAMPLE 0x01 /* OBSOLETE */
+#define _GUS_VOICEON 0x02
+#define _GUS_VOICEOFF 0x03
+#define _GUS_VOICEMODE 0x04
+#define _GUS_VOICEBALA 0x05
+#define _GUS_VOICEFREQ 0x06
+#define _GUS_VOICEVOL 0x07
+#define _GUS_RAMPRANGE 0x08
+#define _GUS_RAMPRATE 0x09
+#define _GUS_RAMPMODE 0x0a
+#define _GUS_RAMPON 0x0b
+#define _GUS_RAMPOFF 0x0c
+#define _GUS_VOICEFADE 0x0d
+#define _GUS_VOLUME_SCALE 0x0e
+#define _GUS_VOICEVOL2 0x0f
+#define _GUS_VOICE_POS 0x10
+
+/*
+ * GUS API macros
+ */
+
+#define _GUS_CMD(chn, voice, cmd, p1, p2) \
+ {_SEQ_NEEDBUF(8); _seqbuf[_seqbufptr] = SEQ_PRIVATE;\
+ _seqbuf[_seqbufptr+1] = (chn); _seqbuf[_seqbufptr+2] = cmd;\
+ _seqbuf[_seqbufptr+3] = voice;\
+ *(unsigned short*)&_seqbuf[_seqbufptr+4] = p1;\
+ *(unsigned short*)&_seqbuf[_seqbufptr+6] = p2;\
+ _SEQ_ADVBUF(8);}
+
+#define GUS_NUMVOICES(chn, p1) _GUS_CMD(chn, 0, _GUS_NUMVOICES, (p1), 0)
+#define GUS_VOICESAMPLE(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICESAMPLE, (p1), 0) /* OBSOLETE */
+#define GUS_VOICEON(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEON, (p1), 0)
+#define GUS_VOICEOFF(chn, voice) _GUS_CMD(chn, voice, _GUS_VOICEOFF, 0, 0)
+#define GUS_VOICEFADE(chn, voice) _GUS_CMD(chn, voice, _GUS_VOICEFADE, 0, 0)
+#define GUS_VOICEMODE(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEMODE, (p1), 0)
+#define GUS_VOICEBALA(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEBALA, (p1), 0)
+#define GUS_VOICEFREQ(chn, voice, p) _GUS_CMD(chn, voice, _GUS_VOICEFREQ, \
+ (p) & 0xffff, ((p) >> 16) & 0xffff)
+#define GUS_VOICEVOL(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEVOL, (p1), 0)
+#define GUS_VOICEVOL2(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEVOL2, (p1), 0)
+#define GUS_RAMPRANGE(chn, voice, low, high) _GUS_CMD(chn, voice, _GUS_RAMPRANGE, (low), (high))
+#define GUS_RAMPRATE(chn, voice, p1, p2) _GUS_CMD(chn, voice, _GUS_RAMPRATE, (p1), (p2))
+#define GUS_RAMPMODE(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_RAMPMODE, (p1), 0)
+#define GUS_RAMPON(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_RAMPON, (p1), 0)
+#define GUS_RAMPOFF(chn, voice) _GUS_CMD(chn, voice, _GUS_RAMPOFF, 0, 0)
+#define GUS_VOLUME_SCALE(chn, voice, p1, p2) _GUS_CMD(chn, voice, _GUS_VOLUME_SCALE, (p1), (p2))
+#define GUS_VOICE_POS(chn, voice, p) _GUS_CMD(chn, voice, _GUS_VOICE_POS, \
+ (p) & 0xffff, ((p) >> 16) & 0xffff)
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/un.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/un.h
new file mode 100644
index 0000000..45561c5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/un.h
@@ -0,0 +1,11 @@
+#ifndef _LINUX_UN_H
+#define _LINUX_UN_H
+
+#define UNIX_PATH_MAX 108
+
+struct sockaddr_un {
+ sa_family_t sun_family; /* AF_UNIX */
+ char sun_path[UNIX_PATH_MAX]; /* pathname */
+};
+
+#endif /* _LINUX_UN_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/unistd.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/unistd.h
new file mode 100644
index 0000000..aa8d5b5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/unistd.h
@@ -0,0 +1,9 @@
+#ifndef _LINUX_UNISTD_H_
+#define _LINUX_UNISTD_H_
+
+/*
+ * Include machine specific syscall numbers
+ */
+#include <asm/unistd.h>
+
+#endif /* _LINUX_UNISTD_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/..install.cmd
new file mode 100644
index 0000000..66d4ead
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/usb/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/usb /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/usb mips audio.h cdc.h ch9.h g_printer.h gadgetfs.h midi.h tmc.h vstusb.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/usb /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/usb mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/usb/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/audio.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/audio.h
new file mode 100644
index 0000000..8cb025f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/audio.h
@@ -0,0 +1,53 @@
+/*
+ * <linux/usb/audio.h> -- USB Audio definitions.
+ *
+ * Copyright (C) 2006 Thumtronics Pty Ltd.
+ * Developed for Thumtronics by Grey Innovation
+ * Ben Williamson <ben.williamson@greyinnovation.com>
+ *
+ * This software is distributed under the terms of the GNU General Public
+ * License ("GPL") version 2, as published by the Free Software Foundation.
+ *
+ * This file holds USB constants and structures defined
+ * by the USB Device Class Definition for Audio Devices.
+ * Comments below reference relevant sections of that document:
+ *
+ * http://www.usb.org/developers/devclass_docs/audio10.pdf
+ */
+
+#ifndef __LINUX_USB_AUDIO_H
+#define __LINUX_USB_AUDIO_H
+
+#include <linux/types.h>
+
+/* A.2 Audio Interface Subclass Codes */
+#define USB_SUBCLASS_AUDIOCONTROL 0x01
+#define USB_SUBCLASS_AUDIOSTREAMING 0x02
+#define USB_SUBCLASS_MIDISTREAMING 0x03
+
+/* 4.3.2 Class-Specific AC Interface Descriptor */
+struct usb_ac_header_descriptor {
+ __u8 bLength; /* 8+n */
+ __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
+ __u8 bDescriptorSubtype; /* USB_MS_HEADER */
+ __le16 bcdADC; /* 0x0100 */
+ __le16 wTotalLength; /* includes Unit and Terminal desc. */
+ __u8 bInCollection; /* n */
+ __u8 baInterfaceNr[]; /* [n] */
+} __attribute__ ((packed));
+
+#define USB_DT_AC_HEADER_SIZE(n) (8+(n))
+
+/* As above, but more useful for defining your own descriptors: */
+#define DECLARE_USB_AC_HEADER_DESCRIPTOR(n) \
+struct usb_ac_header_descriptor_##n { \
+ __u8 bLength; \
+ __u8 bDescriptorType; \
+ __u8 bDescriptorSubtype; \
+ __le16 bcdADC; \
+ __le16 wTotalLength; \
+ __u8 bInCollection; \
+ __u8 baInterfaceNr[n]; \
+} __attribute__ ((packed))
+
+#endif /* __LINUX_USB_AUDIO_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/cdc.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/cdc.h
new file mode 100644
index 0000000..c24124a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/cdc.h
@@ -0,0 +1,250 @@
+/*
+ * USB Communications Device Class (CDC) definitions
+ *
+ * CDC says how to talk to lots of different types of network adapters,
+ * notably ethernet adapters and various modems. It's used mostly with
+ * firmware based USB peripherals.
+ */
+
+#ifndef __LINUX_USB_CDC_H
+#define __LINUX_USB_CDC_H
+
+#include <linux/types.h>
+
+#define USB_CDC_SUBCLASS_ACM 0x02
+#define USB_CDC_SUBCLASS_ETHERNET 0x06
+#define USB_CDC_SUBCLASS_WHCM 0x08
+#define USB_CDC_SUBCLASS_DMM 0x09
+#define USB_CDC_SUBCLASS_MDLM 0x0a
+#define USB_CDC_SUBCLASS_OBEX 0x0b
+#define USB_CDC_SUBCLASS_EEM 0x0c
+
+#define USB_CDC_PROTO_NONE 0
+
+#define USB_CDC_ACM_PROTO_AT_V25TER 1
+#define USB_CDC_ACM_PROTO_AT_PCCA101 2
+#define USB_CDC_ACM_PROTO_AT_PCCA101_WAKE 3
+#define USB_CDC_ACM_PROTO_AT_GSM 4
+#define USB_CDC_ACM_PROTO_AT_3G 5
+#define USB_CDC_ACM_PROTO_AT_CDMA 6
+#define USB_CDC_ACM_PROTO_VENDOR 0xff
+
+#define USB_CDC_PROTO_EEM 7
+
+/*-------------------------------------------------------------------------*/
+
+/*
+ * Class-Specific descriptors ... there are a couple dozen of them
+ */
+
+#define USB_CDC_HEADER_TYPE 0x00 /* header_desc */
+#define USB_CDC_CALL_MANAGEMENT_TYPE 0x01 /* call_mgmt_descriptor */
+#define USB_CDC_ACM_TYPE 0x02 /* acm_descriptor */
+#define USB_CDC_UNION_TYPE 0x06 /* union_desc */
+#define USB_CDC_COUNTRY_TYPE 0x07
+#define USB_CDC_NETWORK_TERMINAL_TYPE 0x0a /* network_terminal_desc */
+#define USB_CDC_ETHERNET_TYPE 0x0f /* ether_desc */
+#define USB_CDC_WHCM_TYPE 0x11
+#define USB_CDC_MDLM_TYPE 0x12 /* mdlm_desc */
+#define USB_CDC_MDLM_DETAIL_TYPE 0x13 /* mdlm_detail_desc */
+#define USB_CDC_DMM_TYPE 0x14
+#define USB_CDC_OBEX_TYPE 0x15
+
+/* "Header Functional Descriptor" from CDC spec 5.2.3.1 */
+struct usb_cdc_header_desc {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubType;
+
+ __le16 bcdCDC;
+} __attribute__ ((packed));
+
+/* "Call Management Descriptor" from CDC spec 5.2.3.2 */
+struct usb_cdc_call_mgmt_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubType;
+
+ __u8 bmCapabilities;
+#define USB_CDC_CALL_MGMT_CAP_CALL_MGMT 0x01
+#define USB_CDC_CALL_MGMT_CAP_DATA_INTF 0x02
+
+ __u8 bDataInterface;
+} __attribute__ ((packed));
+
+/* "Abstract Control Management Descriptor" from CDC spec 5.2.3.3 */
+struct usb_cdc_acm_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubType;
+
+ __u8 bmCapabilities;
+} __attribute__ ((packed));
+
+/* capabilities from 5.2.3.3 */
+
+#define USB_CDC_COMM_FEATURE 0x01
+#define USB_CDC_CAP_LINE 0x02
+#define USB_CDC_CAP_BRK 0x04
+#define USB_CDC_CAP_NOTIFY 0x08
+
+/* "Union Functional Descriptor" from CDC spec 5.2.3.8 */
+struct usb_cdc_union_desc {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubType;
+
+ __u8 bMasterInterface0;
+ __u8 bSlaveInterface0;
+ /* ... and there could be other slave interfaces */
+} __attribute__ ((packed));
+
+/* "Country Selection Functional Descriptor" from CDC spec 5.2.3.9 */
+struct usb_cdc_country_functional_desc {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubType;
+
+ __u8 iCountryCodeRelDate;
+ __le16 wCountyCode0;
+ /* ... and there can be a lot of country codes */
+} __attribute__ ((packed));
+
+/* "Network Channel Terminal Functional Descriptor" from CDC spec 5.2.3.11 */
+struct usb_cdc_network_terminal_desc {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubType;
+
+ __u8 bEntityId;
+ __u8 iName;
+ __u8 bChannelIndex;
+ __u8 bPhysicalInterface;
+} __attribute__ ((packed));
+
+/* "Ethernet Networking Functional Descriptor" from CDC spec 5.2.3.16 */
+struct usb_cdc_ether_desc {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubType;
+
+ __u8 iMACAddress;
+ __le32 bmEthernetStatistics;
+ __le16 wMaxSegmentSize;
+ __le16 wNumberMCFilters;
+ __u8 bNumberPowerFilters;
+} __attribute__ ((packed));
+
+/* "Telephone Control Model Functional Descriptor" from CDC WMC spec 6.3..3 */
+struct usb_cdc_dmm_desc {
+ __u8 bFunctionLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubtype;
+ __u16 bcdVersion;
+ __le16 wMaxCommand;
+} __attribute__ ((packed));
+
+/* "MDLM Functional Descriptor" from CDC WMC spec 6.7.2.3 */
+struct usb_cdc_mdlm_desc {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubType;
+
+ __le16 bcdVersion;
+ __u8 bGUID[16];
+} __attribute__ ((packed));
+
+/* "MDLM Detail Functional Descriptor" from CDC WMC spec 6.7.2.4 */
+struct usb_cdc_mdlm_detail_desc {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubType;
+
+ /* type is associated with mdlm_desc.bGUID */
+ __u8 bGuidDescriptorType;
+ __u8 bDetailData[0];
+} __attribute__ ((packed));
+
+/* "OBEX Control Model Functional Descriptor" */
+struct usb_cdc_obex_desc {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubType;
+
+ __le16 bcdVersion;
+} __attribute__ ((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/*
+ * Class-Specific Control Requests (6.2)
+ *
+ * section 3.6.2.1 table 4 has the ACM profile, for modems.
+ * section 3.8.2 table 10 has the ethernet profile.
+ *
+ * Microsoft's RNDIS stack for Ethernet is a vendor-specific CDC ACM variant,
+ * heavily dependent on the encapsulated (proprietary) command mechanism.
+ */
+
+#define USB_CDC_SEND_ENCAPSULATED_COMMAND 0x00
+#define USB_CDC_GET_ENCAPSULATED_RESPONSE 0x01
+#define USB_CDC_REQ_SET_LINE_CODING 0x20
+#define USB_CDC_REQ_GET_LINE_CODING 0x21
+#define USB_CDC_REQ_SET_CONTROL_LINE_STATE 0x22
+#define USB_CDC_REQ_SEND_BREAK 0x23
+#define USB_CDC_SET_ETHERNET_MULTICAST_FILTERS 0x40
+#define USB_CDC_SET_ETHERNET_PM_PATTERN_FILTER 0x41
+#define USB_CDC_GET_ETHERNET_PM_PATTERN_FILTER 0x42
+#define USB_CDC_SET_ETHERNET_PACKET_FILTER 0x43
+#define USB_CDC_GET_ETHERNET_STATISTIC 0x44
+
+/* Line Coding Structure from CDC spec 6.2.13 */
+struct usb_cdc_line_coding {
+ __le32 dwDTERate;
+ __u8 bCharFormat;
+#define USB_CDC_1_STOP_BITS 0
+#define USB_CDC_1_5_STOP_BITS 1
+#define USB_CDC_2_STOP_BITS 2
+
+ __u8 bParityType;
+#define USB_CDC_NO_PARITY 0
+#define USB_CDC_ODD_PARITY 1
+#define USB_CDC_EVEN_PARITY 2
+#define USB_CDC_MARK_PARITY 3
+#define USB_CDC_SPACE_PARITY 4
+
+ __u8 bDataBits;
+} __attribute__ ((packed));
+
+/* table 62; bits in multicast filter */
+#define USB_CDC_PACKET_TYPE_PROMISCUOUS (1 << 0)
+#define USB_CDC_PACKET_TYPE_ALL_MULTICAST (1 << 1) /* no filter */
+#define USB_CDC_PACKET_TYPE_DIRECTED (1 << 2)
+#define USB_CDC_PACKET_TYPE_BROADCAST (1 << 3)
+#define USB_CDC_PACKET_TYPE_MULTICAST (1 << 4) /* filtered */
+
+
+/*-------------------------------------------------------------------------*/
+
+/*
+ * Class-Specific Notifications (6.3) sent by interrupt transfers
+ *
+ * section 3.8.2 table 11 of the CDC spec lists Ethernet notifications
+ * section 3.6.2.1 table 5 specifies ACM notifications, accepted by RNDIS
+ * RNDIS also defines its own bit-incompatible notifications
+ */
+
+#define USB_CDC_NOTIFY_NETWORK_CONNECTION 0x00
+#define USB_CDC_NOTIFY_RESPONSE_AVAILABLE 0x01
+#define USB_CDC_NOTIFY_SERIAL_STATE 0x20
+#define USB_CDC_NOTIFY_SPEED_CHANGE 0x2a
+
+struct usb_cdc_notification {
+ __u8 bmRequestType;
+ __u8 bNotificationType;
+ __le16 wValue;
+ __le16 wIndex;
+ __le16 wLength;
+} __attribute__ ((packed));
+
+#endif /* __LINUX_USB_CDC_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/ch9.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/ch9.h
new file mode 100644
index 0000000..59718b5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/ch9.h
@@ -0,0 +1,782 @@
+/*
+ * This file holds USB constants and structures that are needed for
+ * USB device APIs. These are used by the USB device model, which is
+ * defined in chapter 9 of the USB 2.0 specification and in the
+ * Wireless USB 1.0 (spread around). Linux has several APIs in C that
+ * need these:
+ *
+ * - the master/host side Linux-USB kernel driver API;
+ * - the "usbfs" user space API; and
+ * - the Linux "gadget" slave/device/peripheral side driver API.
+ *
+ * USB 2.0 adds an additional "On The Go" (OTG) mode, which lets systems
+ * act either as a USB master/host or as a USB slave/device. That means
+ * the master and slave side APIs benefit from working well together.
+ *
+ * There's also "Wireless USB", using low power short range radios for
+ * peripheral interconnection but otherwise building on the USB framework.
+ *
+ * Note all descriptors are declared '__attribute__((packed))' so that:
+ *
+ * [a] they never get padded, either internally (USB spec writers
+ * probably handled that) or externally;
+ *
+ * [b] so that accessing bigger-than-a-bytes fields will never
+ * generate bus errors on any platform, even when the location of
+ * its descriptor inside a bundle isn't "naturally aligned", and
+ *
+ * [c] for consistency, removing all doubt even when it appears to
+ * someone that the two other points are non-issues for that
+ * particular descriptor type.
+ */
+
+#ifndef __LINUX_USB_CH9_H
+#define __LINUX_USB_CH9_H
+
+#include <linux/types.h> /* __u8 etc */
+
+/*-------------------------------------------------------------------------*/
+
+/* CONTROL REQUEST SUPPORT */
+
+/*
+ * USB directions
+ *
+ * This bit flag is used in endpoint descriptors' bEndpointAddress field.
+ * It's also one of three fields in control requests bRequestType.
+ */
+#define USB_DIR_OUT 0 /* to device */
+#define USB_DIR_IN 0x80 /* to host */
+
+/*
+ * USB types, the second of three bRequestType fields
+ */
+#define USB_TYPE_MASK (0x03 << 5)
+#define USB_TYPE_STANDARD (0x00 << 5)
+#define USB_TYPE_CLASS (0x01 << 5)
+#define USB_TYPE_VENDOR (0x02 << 5)
+#define USB_TYPE_RESERVED (0x03 << 5)
+
+/*
+ * USB recipients, the third of three bRequestType fields
+ */
+#define USB_RECIP_MASK 0x1f
+#define USB_RECIP_DEVICE 0x00
+#define USB_RECIP_INTERFACE 0x01
+#define USB_RECIP_ENDPOINT 0x02
+#define USB_RECIP_OTHER 0x03
+/* From Wireless USB 1.0 */
+#define USB_RECIP_PORT 0x04
+#define USB_RECIP_RPIPE 0x05
+
+/*
+ * Standard requests, for the bRequest field of a SETUP packet.
+ *
+ * These are qualified by the bRequestType field, so that for example
+ * TYPE_CLASS or TYPE_VENDOR specific feature flags could be retrieved
+ * by a GET_STATUS request.
+ */
+#define USB_REQ_GET_STATUS 0x00
+#define USB_REQ_CLEAR_FEATURE 0x01
+#define USB_REQ_SET_FEATURE 0x03
+#define USB_REQ_SET_ADDRESS 0x05
+#define USB_REQ_GET_DESCRIPTOR 0x06
+#define USB_REQ_SET_DESCRIPTOR 0x07
+#define USB_REQ_GET_CONFIGURATION 0x08
+#define USB_REQ_SET_CONFIGURATION 0x09
+#define USB_REQ_GET_INTERFACE 0x0A
+#define USB_REQ_SET_INTERFACE 0x0B
+#define USB_REQ_SYNCH_FRAME 0x0C
+
+#define USB_REQ_SET_ENCRYPTION 0x0D /* Wireless USB */
+#define USB_REQ_GET_ENCRYPTION 0x0E
+#define USB_REQ_RPIPE_ABORT 0x0E
+#define USB_REQ_SET_HANDSHAKE 0x0F
+#define USB_REQ_RPIPE_RESET 0x0F
+#define USB_REQ_GET_HANDSHAKE 0x10
+#define USB_REQ_SET_CONNECTION 0x11
+#define USB_REQ_SET_SECURITY_DATA 0x12
+#define USB_REQ_GET_SECURITY_DATA 0x13
+#define USB_REQ_SET_WUSB_DATA 0x14
+#define USB_REQ_LOOPBACK_DATA_WRITE 0x15
+#define USB_REQ_LOOPBACK_DATA_READ 0x16
+#define USB_REQ_SET_INTERFACE_DS 0x17
+
+/* The Link Power Management (LPM) ECN defines USB_REQ_TEST_AND_SET command,
+ * used by hubs to put ports into a new L1 suspend state, except that it
+ * forgot to define its number ...
+ */
+
+/*
+ * USB feature flags are written using USB_REQ_{CLEAR,SET}_FEATURE, and
+ * are read as a bit array returned by USB_REQ_GET_STATUS. (So there
+ * are at most sixteen features of each type.) Hubs may also support a
+ * new USB_REQ_TEST_AND_SET_FEATURE to put ports into L1 suspend.
+ */
+#define USB_DEVICE_SELF_POWERED 0 /* (read only) */
+#define USB_DEVICE_REMOTE_WAKEUP 1 /* dev may initiate wakeup */
+#define USB_DEVICE_TEST_MODE 2 /* (wired high speed only) */
+#define USB_DEVICE_BATTERY 2 /* (wireless) */
+#define USB_DEVICE_B_HNP_ENABLE 3 /* (otg) dev may initiate HNP */
+#define USB_DEVICE_WUSB_DEVICE 3 /* (wireless)*/
+#define USB_DEVICE_A_HNP_SUPPORT 4 /* (otg) RH port supports HNP */
+#define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* (otg) other RH port does */
+#define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */
+
+#define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */
+
+
+/**
+ * struct usb_ctrlrequest - SETUP data for a USB device control request
+ * @bRequestType: matches the USB bmRequestType field
+ * @bRequest: matches the USB bRequest field
+ * @wValue: matches the USB wValue field (le16 byte order)
+ * @wIndex: matches the USB wIndex field (le16 byte order)
+ * @wLength: matches the USB wLength field (le16 byte order)
+ *
+ * This structure is used to send control requests to a USB device. It matches
+ * the different fields of the USB 2.0 Spec section 9.3, table 9-2. See the
+ * USB spec for a fuller description of the different fields, and what they are
+ * used for.
+ *
+ * Note that the driver for any interface can issue control requests.
+ * For most devices, interfaces don't coordinate with each other, so
+ * such requests may be made at any time.
+ */
+struct usb_ctrlrequest {
+ __u8 bRequestType;
+ __u8 bRequest;
+ __le16 wValue;
+ __le16 wIndex;
+ __le16 wLength;
+} __attribute__ ((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/*
+ * STANDARD DESCRIPTORS ... as returned by GET_DESCRIPTOR, or
+ * (rarely) accepted by SET_DESCRIPTOR.
+ *
+ * Note that all multi-byte values here are encoded in little endian
+ * byte order "on the wire". Within the kernel and when exposed
+ * through the Linux-USB APIs, they are not converted to cpu byte
+ * order; it is the responsibility of the client code to do this.
+ * The single exception is when device and configuration descriptors (but
+ * not other descriptors) are read from usbfs (i.e. /proc/bus/usb/BBB/DDD);
+ * in this case the fields are converted to host endianness by the kernel.
+ */
+
+/*
+ * Descriptor types ... USB 2.0 spec table 9.5
+ */
+#define USB_DT_DEVICE 0x01
+#define USB_DT_CONFIG 0x02
+#define USB_DT_STRING 0x03
+#define USB_DT_INTERFACE 0x04
+#define USB_DT_ENDPOINT 0x05
+#define USB_DT_DEVICE_QUALIFIER 0x06
+#define USB_DT_OTHER_SPEED_CONFIG 0x07
+#define USB_DT_INTERFACE_POWER 0x08
+/* these are from a minor usb 2.0 revision (ECN) */
+#define USB_DT_OTG 0x09
+#define USB_DT_DEBUG 0x0a
+#define USB_DT_INTERFACE_ASSOCIATION 0x0b
+/* these are from the Wireless USB spec */
+#define USB_DT_SECURITY 0x0c
+#define USB_DT_KEY 0x0d
+#define USB_DT_ENCRYPTION_TYPE 0x0e
+#define USB_DT_BOS 0x0f
+#define USB_DT_DEVICE_CAPABILITY 0x10
+#define USB_DT_WIRELESS_ENDPOINT_COMP 0x11
+#define USB_DT_WIRE_ADAPTER 0x21
+#define USB_DT_RPIPE 0x22
+#define USB_DT_CS_RADIO_CONTROL 0x23
+
+/* Conventional codes for class-specific descriptors. The convention is
+ * defined in the USB "Common Class" Spec (3.11). Individual class specs
+ * are authoritative for their usage, not the "common class" writeup.
+ */
+#define USB_DT_CS_DEVICE (USB_TYPE_CLASS | USB_DT_DEVICE)
+#define USB_DT_CS_CONFIG (USB_TYPE_CLASS | USB_DT_CONFIG)
+#define USB_DT_CS_STRING (USB_TYPE_CLASS | USB_DT_STRING)
+#define USB_DT_CS_INTERFACE (USB_TYPE_CLASS | USB_DT_INTERFACE)
+#define USB_DT_CS_ENDPOINT (USB_TYPE_CLASS | USB_DT_ENDPOINT)
+
+/* All standard descriptors have these 2 fields at the beginning */
+struct usb_descriptor_header {
+ __u8 bLength;
+ __u8 bDescriptorType;
+} __attribute__ ((packed));
+
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_DEVICE: Device descriptor */
+struct usb_device_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __le16 bcdUSB;
+ __u8 bDeviceClass;
+ __u8 bDeviceSubClass;
+ __u8 bDeviceProtocol;
+ __u8 bMaxPacketSize0;
+ __le16 idVendor;
+ __le16 idProduct;
+ __le16 bcdDevice;
+ __u8 iManufacturer;
+ __u8 iProduct;
+ __u8 iSerialNumber;
+ __u8 bNumConfigurations;
+} __attribute__ ((packed));
+
+#define USB_DT_DEVICE_SIZE 18
+
+
+/*
+ * Device and/or Interface Class codes
+ * as found in bDeviceClass or bInterfaceClass
+ * and defined by www.usb.org documents
+ */
+#define USB_CLASS_PER_INTERFACE 0 /* for DeviceClass */
+#define USB_CLASS_AUDIO 1
+#define USB_CLASS_COMM 2
+#define USB_CLASS_HID 3
+#define USB_CLASS_PHYSICAL 5
+#define USB_CLASS_STILL_IMAGE 6
+#define USB_CLASS_PRINTER 7
+#define USB_CLASS_MASS_STORAGE 8
+#define USB_CLASS_HUB 9
+#define USB_CLASS_CDC_DATA 0x0a
+#define USB_CLASS_CSCID 0x0b /* chip+ smart card */
+#define USB_CLASS_CONTENT_SEC 0x0d /* content security */
+#define USB_CLASS_VIDEO 0x0e
+#define USB_CLASS_WIRELESS_CONTROLLER 0xe0
+#define USB_CLASS_MISC 0xef
+#define USB_CLASS_APP_SPEC 0xfe
+#define USB_CLASS_VENDOR_SPEC 0xff
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_CONFIG: Configuration descriptor information.
+ *
+ * USB_DT_OTHER_SPEED_CONFIG is the same descriptor, except that the
+ * descriptor type is different. Highspeed-capable devices can look
+ * different depending on what speed they're currently running. Only
+ * devices with a USB_DT_DEVICE_QUALIFIER have any OTHER_SPEED_CONFIG
+ * descriptors.
+ */
+struct usb_config_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __le16 wTotalLength;
+ __u8 bNumInterfaces;
+ __u8 bConfigurationValue;
+ __u8 iConfiguration;
+ __u8 bmAttributes;
+ __u8 bMaxPower;
+} __attribute__ ((packed));
+
+#define USB_DT_CONFIG_SIZE 9
+
+/* from config descriptor bmAttributes */
+#define USB_CONFIG_ATT_ONE (1 << 7) /* must be set */
+#define USB_CONFIG_ATT_SELFPOWER (1 << 6) /* self powered */
+#define USB_CONFIG_ATT_WAKEUP (1 << 5) /* can wakeup */
+#define USB_CONFIG_ATT_BATTERY (1 << 4) /* battery powered */
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_STRING: String descriptor */
+struct usb_string_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __le16 wData[1]; /* UTF-16LE encoded */
+} __attribute__ ((packed));
+
+/* note that "string" zero is special, it holds language codes that
+ * the device supports, not Unicode characters.
+ */
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_INTERFACE: Interface descriptor */
+struct usb_interface_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 bInterfaceNumber;
+ __u8 bAlternateSetting;
+ __u8 bNumEndpoints;
+ __u8 bInterfaceClass;
+ __u8 bInterfaceSubClass;
+ __u8 bInterfaceProtocol;
+ __u8 iInterface;
+} __attribute__ ((packed));
+
+#define USB_DT_INTERFACE_SIZE 9
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_ENDPOINT: Endpoint descriptor */
+struct usb_endpoint_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 bEndpointAddress;
+ __u8 bmAttributes;
+ __le16 wMaxPacketSize;
+ __u8 bInterval;
+
+ /* NOTE: these two are _only_ in audio endpoints. */
+ /* use USB_DT_ENDPOINT*_SIZE in bLength, not sizeof. */
+ __u8 bRefresh;
+ __u8 bSynchAddress;
+} __attribute__ ((packed));
+
+#define USB_DT_ENDPOINT_SIZE 7
+#define USB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */
+
+
+/*
+ * Endpoints
+ */
+#define USB_ENDPOINT_NUMBER_MASK 0x0f /* in bEndpointAddress */
+#define USB_ENDPOINT_DIR_MASK 0x80
+
+#define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */
+#define USB_ENDPOINT_XFER_CONTROL 0
+#define USB_ENDPOINT_XFER_ISOC 1
+#define USB_ENDPOINT_XFER_BULK 2
+#define USB_ENDPOINT_XFER_INT 3
+#define USB_ENDPOINT_MAX_ADJUSTABLE 0x80
+
+/*-------------------------------------------------------------------------*/
+
+/**
+ * usb_endpoint_num - get the endpoint's number
+ * @epd: endpoint to be checked
+ *
+ * Returns @epd's number: 0 to 15.
+ */
+static __inline__ int usb_endpoint_num(const struct usb_endpoint_descriptor *epd)
+{
+ return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
+}
+
+/**
+ * usb_endpoint_type - get the endpoint's transfer type
+ * @epd: endpoint to be checked
+ *
+ * Returns one of USB_ENDPOINT_XFER_{CONTROL, ISOC, BULK, INT} according
+ * to @epd's transfer type.
+ */
+static __inline__ int usb_endpoint_type(const struct usb_endpoint_descriptor *epd)
+{
+ return epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
+}
+
+/**
+ * usb_endpoint_dir_in - check if the endpoint has IN direction
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint is of type IN, otherwise it returns false.
+ */
+static __inline__ int usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd)
+{
+ return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN);
+}
+
+/**
+ * usb_endpoint_dir_out - check if the endpoint has OUT direction
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint is of type OUT, otherwise it returns false.
+ */
+static __inline__ int usb_endpoint_dir_out(
+ const struct usb_endpoint_descriptor *epd)
+{
+ return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT);
+}
+
+/**
+ * usb_endpoint_xfer_bulk - check if the endpoint has bulk transfer type
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint is of type bulk, otherwise it returns false.
+ */
+static __inline__ int usb_endpoint_xfer_bulk(
+ const struct usb_endpoint_descriptor *epd)
+{
+ return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
+ USB_ENDPOINT_XFER_BULK);
+}
+
+/**
+ * usb_endpoint_xfer_control - check if the endpoint has control transfer type
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint is of type control, otherwise it returns false.
+ */
+static __inline__ int usb_endpoint_xfer_control(
+ const struct usb_endpoint_descriptor *epd)
+{
+ return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
+ USB_ENDPOINT_XFER_CONTROL);
+}
+
+/**
+ * usb_endpoint_xfer_int - check if the endpoint has interrupt transfer type
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint is of type interrupt, otherwise it returns
+ * false.
+ */
+static __inline__ int usb_endpoint_xfer_int(
+ const struct usb_endpoint_descriptor *epd)
+{
+ return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
+ USB_ENDPOINT_XFER_INT);
+}
+
+/**
+ * usb_endpoint_xfer_isoc - check if the endpoint has isochronous transfer type
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint is of type isochronous, otherwise it returns
+ * false.
+ */
+static __inline__ int usb_endpoint_xfer_isoc(
+ const struct usb_endpoint_descriptor *epd)
+{
+ return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
+ USB_ENDPOINT_XFER_ISOC);
+}
+
+/**
+ * usb_endpoint_is_bulk_in - check if the endpoint is bulk IN
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint has bulk transfer type and IN direction,
+ * otherwise it returns false.
+ */
+static __inline__ int usb_endpoint_is_bulk_in(
+ const struct usb_endpoint_descriptor *epd)
+{
+ return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd));
+}
+
+/**
+ * usb_endpoint_is_bulk_out - check if the endpoint is bulk OUT
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint has bulk transfer type and OUT direction,
+ * otherwise it returns false.
+ */
+static __inline__ int usb_endpoint_is_bulk_out(
+ const struct usb_endpoint_descriptor *epd)
+{
+ return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd));
+}
+
+/**
+ * usb_endpoint_is_int_in - check if the endpoint is interrupt IN
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint has interrupt transfer type and IN direction,
+ * otherwise it returns false.
+ */
+static __inline__ int usb_endpoint_is_int_in(
+ const struct usb_endpoint_descriptor *epd)
+{
+ return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd));
+}
+
+/**
+ * usb_endpoint_is_int_out - check if the endpoint is interrupt OUT
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint has interrupt transfer type and OUT direction,
+ * otherwise it returns false.
+ */
+static __inline__ int usb_endpoint_is_int_out(
+ const struct usb_endpoint_descriptor *epd)
+{
+ return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd));
+}
+
+/**
+ * usb_endpoint_is_isoc_in - check if the endpoint is isochronous IN
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint has isochronous transfer type and IN direction,
+ * otherwise it returns false.
+ */
+static __inline__ int usb_endpoint_is_isoc_in(
+ const struct usb_endpoint_descriptor *epd)
+{
+ return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd));
+}
+
+/**
+ * usb_endpoint_is_isoc_out - check if the endpoint is isochronous OUT
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint has isochronous transfer type and OUT direction,
+ * otherwise it returns false.
+ */
+static __inline__ int usb_endpoint_is_isoc_out(
+ const struct usb_endpoint_descriptor *epd)
+{
+ return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd));
+}
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_DEVICE_QUALIFIER: Device Qualifier descriptor */
+struct usb_qualifier_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __le16 bcdUSB;
+ __u8 bDeviceClass;
+ __u8 bDeviceSubClass;
+ __u8 bDeviceProtocol;
+ __u8 bMaxPacketSize0;
+ __u8 bNumConfigurations;
+ __u8 bRESERVED;
+} __attribute__ ((packed));
+
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_OTG (from OTG 1.0a supplement) */
+struct usb_otg_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 bmAttributes; /* support for HNP, SRP, etc */
+} __attribute__ ((packed));
+
+/* from usb_otg_descriptor.bmAttributes */
+#define USB_OTG_SRP (1 << 0)
+#define USB_OTG_HNP (1 << 1) /* swap host/device roles */
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_DEBUG: for special highspeed devices, replacing serial console */
+struct usb_debug_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ /* bulk endpoints with 8 byte maxpacket */
+ __u8 bDebugInEndpoint;
+ __u8 bDebugOutEndpoint;
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_INTERFACE_ASSOCIATION: groups interfaces */
+struct usb_interface_assoc_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 bFirstInterface;
+ __u8 bInterfaceCount;
+ __u8 bFunctionClass;
+ __u8 bFunctionSubClass;
+ __u8 bFunctionProtocol;
+ __u8 iFunction;
+} __attribute__ ((packed));
+
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_SECURITY: group of wireless security descriptors, including
+ * encryption types available for setting up a CC/association.
+ */
+struct usb_security_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __le16 wTotalLength;
+ __u8 bNumEncryptionTypes;
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_KEY: used with {GET,SET}_SECURITY_DATA; only public keys
+ * may be retrieved.
+ */
+struct usb_key_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 tTKID[3];
+ __u8 bReserved;
+ __u8 bKeyData[0];
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_ENCRYPTION_TYPE: bundled in DT_SECURITY groups */
+struct usb_encryption_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 bEncryptionType;
+#define USB_ENC_TYPE_UNSECURE 0
+#define USB_ENC_TYPE_WIRED 1 /* non-wireless mode */
+#define USB_ENC_TYPE_CCM_1 2 /* aes128/cbc session */
+#define USB_ENC_TYPE_RSA_1 3 /* rsa3072/sha1 auth */
+ __u8 bEncryptionValue; /* use in SET_ENCRYPTION */
+ __u8 bAuthKeyIndex;
+} __attribute__((packed));
+
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_BOS: group of device-level capabilities */
+struct usb_bos_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __le16 wTotalLength;
+ __u8 bNumDeviceCaps;
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_DEVICE_CAPABILITY: grouped with BOS */
+struct usb_dev_cap_header {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDevCapabilityType;
+} __attribute__((packed));
+
+#define USB_CAP_TYPE_WIRELESS_USB 1
+
+struct usb_wireless_cap_descriptor { /* Ultra Wide Band */
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDevCapabilityType;
+
+ __u8 bmAttributes;
+#define USB_WIRELESS_P2P_DRD (1 << 1)
+#define USB_WIRELESS_BEACON_MASK (3 << 2)
+#define USB_WIRELESS_BEACON_SELF (1 << 2)
+#define USB_WIRELESS_BEACON_DIRECTED (2 << 2)
+#define USB_WIRELESS_BEACON_NONE (3 << 2)
+ __le16 wPHYRates; /* bit rates, Mbps */
+#define USB_WIRELESS_PHY_53 (1 << 0) /* always set */
+#define USB_WIRELESS_PHY_80 (1 << 1)
+#define USB_WIRELESS_PHY_107 (1 << 2) /* always set */
+#define USB_WIRELESS_PHY_160 (1 << 3)
+#define USB_WIRELESS_PHY_200 (1 << 4) /* always set */
+#define USB_WIRELESS_PHY_320 (1 << 5)
+#define USB_WIRELESS_PHY_400 (1 << 6)
+#define USB_WIRELESS_PHY_480 (1 << 7)
+ __u8 bmTFITXPowerInfo; /* TFI power levels */
+ __u8 bmFFITXPowerInfo; /* FFI power levels */
+ __le16 bmBandGroup;
+ __u8 bReserved;
+} __attribute__((packed));
+
+#define USB_CAP_TYPE_EXT 2
+
+struct usb_ext_cap_descriptor { /* Link Power Management */
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDevCapabilityType;
+ __u8 bmAttributes;
+#define USB_LPM_SUPPORT (1 << 1) /* supports LPM */
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_WIRELESS_ENDPOINT_COMP: companion descriptor associated with
+ * each endpoint descriptor for a wireless device
+ */
+struct usb_wireless_ep_comp_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 bMaxBurst;
+ __u8 bMaxSequence;
+ __le16 wMaxStreamDelay;
+ __le16 wOverTheAirPacketSize;
+ __u8 bOverTheAirInterval;
+ __u8 bmCompAttributes;
+#define USB_ENDPOINT_SWITCH_MASK 0x03 /* in bmCompAttributes */
+#define USB_ENDPOINT_SWITCH_NO 0
+#define USB_ENDPOINT_SWITCH_SWITCH 1
+#define USB_ENDPOINT_SWITCH_SCALE 2
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_REQ_SET_HANDSHAKE is a four-way handshake used between a wireless
+ * host and a device for connection set up, mutual authentication, and
+ * exchanging short lived session keys. The handshake depends on a CC.
+ */
+struct usb_handshake {
+ __u8 bMessageNumber;
+ __u8 bStatus;
+ __u8 tTKID[3];
+ __u8 bReserved;
+ __u8 CDID[16];
+ __u8 nonce[16];
+ __u8 MIC[8];
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_REQ_SET_CONNECTION modifies or revokes a connection context (CC).
+ * A CC may also be set up using non-wireless secure channels (including
+ * wired USB!), and some devices may support CCs with multiple hosts.
+ */
+struct usb_connection_context {
+ __u8 CHID[16]; /* persistent host id */
+ __u8 CDID[16]; /* device id (unique w/in host context) */
+ __u8 CK[16]; /* connection key */
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB 2.0 defines three speeds, here's how Linux identifies them */
+
+enum usb_device_speed {
+ USB_SPEED_UNKNOWN = 0, /* enumerating */
+ USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */
+ USB_SPEED_HIGH, /* usb 2.0 */
+ USB_SPEED_VARIABLE, /* wireless (usb 2.5) */
+};
+
+enum usb_device_state {
+ /* NOTATTACHED isn't in the USB spec, and this state acts
+ * the same as ATTACHED ... but it's clearer this way.
+ */
+ USB_STATE_NOTATTACHED = 0,
+
+ /* chapter 9 and authentication (wireless) device states */
+ USB_STATE_ATTACHED,
+ USB_STATE_POWERED, /* wired */
+ USB_STATE_RECONNECTING, /* auth */
+ USB_STATE_UNAUTHENTICATED, /* auth */
+ USB_STATE_DEFAULT, /* limited function */
+ USB_STATE_ADDRESS,
+ USB_STATE_CONFIGURED, /* most functions */
+
+ USB_STATE_SUSPENDED
+
+ /* NOTE: there are actually four different SUSPENDED
+ * states, returning to POWERED, DEFAULT, ADDRESS, or
+ * CONFIGURED respectively when SOF tokens flow again.
+ * At this level there's no difference between L1 and L2
+ * suspend states. (L2 being original USB 1.1 suspend.)
+ */
+};
+
+#endif /* __LINUX_USB_CH9_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/g_printer.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/g_printer.h
new file mode 100644
index 0000000..6178fde
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/g_printer.h
@@ -0,0 +1,35 @@
+/*
+ * g_printer.h -- Header file for USB Printer gadget driver
+ *
+ * Copyright (C) 2007 Craig W. Nadler
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LINUX_USB_G_PRINTER_H
+#define __LINUX_USB_G_PRINTER_H
+
+#define PRINTER_NOT_ERROR 0x08
+#define PRINTER_SELECTED 0x10
+#define PRINTER_PAPER_EMPTY 0x20
+
+/* The 'g' code is also used by gadgetfs ioctl requests.
+ * Don't add any colliding codes to either driver, and keep
+ * them in unique ranges (size 0x20 for now).
+ */
+#define GADGET_GET_PRINTER_STATUS _IOR('g', 0x21, unsigned char)
+#define GADGET_SET_PRINTER_STATUS _IOWR('g', 0x22, unsigned char)
+
+#endif /* __LINUX_USB_G_PRINTER_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/gadgetfs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/gadgetfs.h
new file mode 100644
index 0000000..612102e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/gadgetfs.h
@@ -0,0 +1,88 @@
+/*
+ * Filesystem based user-mode API to USB Gadget controller hardware
+ *
+ * Other than ep0 operations, most things are done by read() and write()
+ * on endpoint files found in one directory. They are configured by
+ * writing descriptors, and then may be used for normal stream style
+ * i/o requests. When ep0 is configured, the device can enumerate;
+ * when it's closed, the device disconnects from usb. Operations on
+ * ep0 require ioctl() operations.
+ *
+ * Configuration and device descriptors get written to /dev/gadget/$CHIP,
+ * which may then be used to read usb_gadgetfs_event structs. The driver
+ * may activate endpoints as it handles SET_CONFIGURATION setup events,
+ * or earlier; writing endpoint descriptors to /dev/gadget/$ENDPOINT
+ * then performing data transfers by reading or writing.
+ */
+
+#ifndef __LINUX_USB_GADGETFS_H
+#define __LINUX_USB_GADGETFS_H
+
+#include <linux/types.h>
+#include <asm/ioctl.h>
+
+#include <linux/usb/ch9.h>
+
+/*
+ * Events are delivered on the ep0 file descriptor, when the user mode driver
+ * reads from this file descriptor after writing the descriptors. Don't
+ * stop polling this descriptor.
+ */
+
+enum usb_gadgetfs_event_type {
+ GADGETFS_NOP = 0,
+
+ GADGETFS_CONNECT,
+ GADGETFS_DISCONNECT,
+ GADGETFS_SETUP,
+ GADGETFS_SUSPEND,
+ /* and likely more ! */
+};
+
+/* NOTE: this structure must stay the same size and layout on
+ * both 32-bit and 64-bit kernels.
+ */
+struct usb_gadgetfs_event {
+ union {
+ /* NOP, DISCONNECT, SUSPEND: nothing
+ * ... some hardware can't report disconnection
+ */
+
+ /* CONNECT: just the speed */
+ enum usb_device_speed speed;
+
+ /* SETUP: packet; DATA phase i/o precedes next event
+ *(setup.bmRequestType & USB_DIR_IN) flags direction
+ * ... includes SET_CONFIGURATION, SET_INTERFACE
+ */
+ struct usb_ctrlrequest setup;
+ } u;
+ enum usb_gadgetfs_event_type type;
+};
+
+
+/* The 'g' code is also used by printer gadget ioctl requests.
+ * Don't add any colliding codes to either driver, and keep
+ * them in unique ranges (size 0x20 for now).
+ */
+
+/* endpoint ioctls */
+
+/* IN transfers may be reported to the gadget driver as complete
+ * when the fifo is loaded, before the host reads the data;
+ * OUT transfers may be reported to the host's "client" driver as
+ * complete when they're sitting in the FIFO unread.
+ * THIS returns how many bytes are "unclaimed" in the endpoint fifo
+ * (needed for precise fault handling, when the hardware allows it)
+ */
+#define GADGETFS_FIFO_STATUS _IO('g', 1)
+
+/* discards any unclaimed data in the fifo. */
+#define GADGETFS_FIFO_FLUSH _IO('g', 2)
+
+/* resets endpoint halt+toggle; used to implement set_interface.
+ * some hardware (like pxa2xx) can't support this.
+ */
+#define GADGETFS_CLEAR_HALT _IO('g', 3)
+
+#endif /* __LINUX_USB_GADGETFS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/midi.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/midi.h
new file mode 100644
index 0000000..1d10408
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/midi.h
@@ -0,0 +1,112 @@
+/*
+ * <linux/usb/midi.h> -- USB MIDI definitions.
+ *
+ * Copyright (C) 2006 Thumtronics Pty Ltd.
+ * Developed for Thumtronics by Grey Innovation
+ * Ben Williamson <ben.williamson@greyinnovation.com>
+ *
+ * This software is distributed under the terms of the GNU General Public
+ * License ("GPL") version 2, as published by the Free Software Foundation.
+ *
+ * This file holds USB constants and structures defined
+ * by the USB Device Class Definition for MIDI Devices.
+ * Comments below reference relevant sections of that document:
+ *
+ * http://www.usb.org/developers/devclass_docs/midi10.pdf
+ */
+
+#ifndef __LINUX_USB_MIDI_H
+#define __LINUX_USB_MIDI_H
+
+#include <linux/types.h>
+
+/* A.1 MS Class-Specific Interface Descriptor Subtypes */
+#define USB_MS_HEADER 0x01
+#define USB_MS_MIDI_IN_JACK 0x02
+#define USB_MS_MIDI_OUT_JACK 0x03
+#define USB_MS_ELEMENT 0x04
+
+/* A.2 MS Class-Specific Endpoint Descriptor Subtypes */
+#define USB_MS_GENERAL 0x01
+
+/* A.3 MS MIDI IN and OUT Jack Types */
+#define USB_MS_EMBEDDED 0x01
+#define USB_MS_EXTERNAL 0x02
+
+/* 6.1.2.1 Class-Specific MS Interface Header Descriptor */
+struct usb_ms_header_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDescriptorSubtype;
+ __le16 bcdMSC;
+ __le16 wTotalLength;
+} __attribute__ ((packed));
+
+#define USB_DT_MS_HEADER_SIZE 7
+
+/* 6.1.2.2 MIDI IN Jack Descriptor */
+struct usb_midi_in_jack_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
+ __u8 bDescriptorSubtype; /* USB_MS_MIDI_IN_JACK */
+ __u8 bJackType; /* USB_MS_EMBEDDED/EXTERNAL */
+ __u8 bJackID;
+ __u8 iJack;
+} __attribute__ ((packed));
+
+#define USB_DT_MIDI_IN_SIZE 6
+
+struct usb_midi_source_pin {
+ __u8 baSourceID;
+ __u8 baSourcePin;
+} __attribute__ ((packed));
+
+/* 6.1.2.3 MIDI OUT Jack Descriptor */
+struct usb_midi_out_jack_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
+ __u8 bDescriptorSubtype; /* USB_MS_MIDI_OUT_JACK */
+ __u8 bJackType; /* USB_MS_EMBEDDED/EXTERNAL */
+ __u8 bJackID;
+ __u8 bNrInputPins; /* p */
+ struct usb_midi_source_pin pins[]; /* [p] */
+ /*__u8 iJack; -- ommitted due to variable-sized pins[] */
+} __attribute__ ((packed));
+
+#define USB_DT_MIDI_OUT_SIZE(p) (7 + 2 * (p))
+
+/* As above, but more useful for defining your own descriptors: */
+#define DECLARE_USB_MIDI_OUT_JACK_DESCRIPTOR(p) \
+struct usb_midi_out_jack_descriptor_##p { \
+ __u8 bLength; \
+ __u8 bDescriptorType; \
+ __u8 bDescriptorSubtype; \
+ __u8 bJackType; \
+ __u8 bJackID; \
+ __u8 bNrInputPins; \
+ struct usb_midi_source_pin pins[p]; \
+ __u8 iJack; \
+} __attribute__ ((packed))
+
+/* 6.2.2 Class-Specific MS Bulk Data Endpoint Descriptor */
+struct usb_ms_endpoint_descriptor {
+ __u8 bLength; /* 4+n */
+ __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */
+ __u8 bDescriptorSubtype; /* USB_MS_GENERAL */
+ __u8 bNumEmbMIDIJack; /* n */
+ __u8 baAssocJackID[]; /* [n] */
+} __attribute__ ((packed));
+
+#define USB_DT_MS_ENDPOINT_SIZE(n) (4 + (n))
+
+/* As above, but more useful for defining your own descriptors: */
+#define DECLARE_USB_MS_ENDPOINT_DESCRIPTOR(n) \
+struct usb_ms_endpoint_descriptor_##n { \
+ __u8 bLength; \
+ __u8 bDescriptorType; \
+ __u8 bDescriptorSubtype; \
+ __u8 bNumEmbMIDIJack; \
+ __u8 baAssocJackID[n]; \
+} __attribute__ ((packed))
+
+#endif /* __LINUX_USB_MIDI_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/tmc.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/tmc.h
new file mode 100644
index 0000000..c045ae1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/tmc.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2007 Stefan Kopp, Gechingen, Germany
+ * Copyright (C) 2008 Novell, Inc.
+ * Copyright (C) 2008 Greg Kroah-Hartman <gregkh@suse.de>
+ *
+ * This file holds USB constants defined by the USB Device Class
+ * Definition for Test and Measurement devices published by the USB-IF.
+ *
+ * It also has the ioctl definitions for the usbtmc kernel driver that
+ * userspace needs to know about.
+ */
+
+#ifndef __LINUX_USB_TMC_H
+#define __LINUX_USB_TMC_H
+
+/* USB TMC status values */
+#define USBTMC_STATUS_SUCCESS 0x01
+#define USBTMC_STATUS_PENDING 0x02
+#define USBTMC_STATUS_FAILED 0x80
+#define USBTMC_STATUS_TRANSFER_NOT_IN_PROGRESS 0x81
+#define USBTMC_STATUS_SPLIT_NOT_IN_PROGRESS 0x82
+#define USBTMC_STATUS_SPLIT_IN_PROGRESS 0x83
+
+/* USB TMC requests values */
+#define USBTMC_REQUEST_INITIATE_ABORT_BULK_OUT 1
+#define USBTMC_REQUEST_CHECK_ABORT_BULK_OUT_STATUS 2
+#define USBTMC_REQUEST_INITIATE_ABORT_BULK_IN 3
+#define USBTMC_REQUEST_CHECK_ABORT_BULK_IN_STATUS 4
+#define USBTMC_REQUEST_INITIATE_CLEAR 5
+#define USBTMC_REQUEST_CHECK_CLEAR_STATUS 6
+#define USBTMC_REQUEST_GET_CAPABILITIES 7
+#define USBTMC_REQUEST_INDICATOR_PULSE 64
+
+/* Request values for USBTMC driver's ioctl entry point */
+#define USBTMC_IOC_NR 91
+#define USBTMC_IOCTL_INDICATOR_PULSE _IO(USBTMC_IOC_NR, 1)
+#define USBTMC_IOCTL_CLEAR _IO(USBTMC_IOC_NR, 2)
+#define USBTMC_IOCTL_ABORT_BULK_OUT _IO(USBTMC_IOC_NR, 3)
+#define USBTMC_IOCTL_ABORT_BULK_IN _IO(USBTMC_IOC_NR, 4)
+#define USBTMC_IOCTL_CLEAR_OUT_HALT _IO(USBTMC_IOC_NR, 6)
+#define USBTMC_IOCTL_CLEAR_IN_HALT _IO(USBTMC_IOC_NR, 7)
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/vstusb.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/vstusb.h
new file mode 100644
index 0000000..c44e16c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usb/vstusb.h
@@ -0,0 +1,71 @@
+/*****************************************************************************
+ * File: drivers/usb/misc/vstusb.h
+ *
+ * Purpose: Support for the bulk USB Vernier Spectrophotometers
+ *
+ * Author: EQware Engineering, Inc.
+ * Oregon City, OR, USA 97045
+ *
+ * Copyright: 2007, 2008
+ * Vernier Software & Technology
+ * Beaverton, OR, USA 97005
+ *
+ * Web: www.vernier.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *****************************************************************************/
+/*****************************************************************************
+ *
+ * The vstusb module is a standard usb 'client' driver running on top of the
+ * standard usb host controller stack.
+ *
+ * In general, vstusb supports standard bulk usb pipes. It supports multiple
+ * devices and multiple pipes per device.
+ *
+ * The vstusb driver supports two interfaces:
+ * 1 - ioctl SEND_PIPE/RECV_PIPE - a general bulk write/read msg
+ * interface to any pipe with timeout support;
+ * 2 - standard read/write with ioctl config - offers standard read/write
+ * interface with ioctl configured pipes and timeouts.
+ *
+ * Both interfaces can be signal from other process and will abort its i/o
+ * operation.
+ *
+ * A timeout of 0 means NO timeout. The user can still terminate the read via
+ * signal.
+ *
+ * If using multiple threads with this driver, the user should ensure that
+ * any reads, writes, or ioctls are complete before closing the device.
+ * Changing read/write timeouts or pipes takes effect on next read/write.
+ *
+ *****************************************************************************/
+
+struct vstusb_args {
+ union {
+ /* this struct is used for IOCTL_VSTUSB_SEND_PIPE, *
+ * IOCTL_VSTUSB_RECV_PIPE, and read()/write() fops */
+ struct {
+ void *buffer;
+ size_t count;
+ unsigned int timeout_ms;
+ int pipe;
+ };
+
+ /* this one is used for IOCTL_VSTUSB_CONFIG_RW */
+ struct {
+ int rd_pipe;
+ int rd_timeout_ms;
+ int wr_pipe;
+ int wr_timeout_ms;
+ };
+ };
+};
+
+#define VST_IOC_MAGIC 'L'
+#define VST_IOC_FIRST 0x20
+#define IOCTL_VSTUSB_SEND_PIPE _IO(VST_IOC_MAGIC, VST_IOC_FIRST)
+#define IOCTL_VSTUSB_RECV_PIPE _IO(VST_IOC_MAGIC, VST_IOC_FIRST + 1)
+#define IOCTL_VSTUSB_CONFIG_RW _IO(VST_IOC_MAGIC, VST_IOC_FIRST + 2)
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usbdevice_fs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usbdevice_fs.h
new file mode 100644
index 0000000..6411839
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/usbdevice_fs.h
@@ -0,0 +1,152 @@
+/*****************************************************************************/
+
+/*
+ * usbdevice_fs.h -- USB device file system.
+ *
+ * Copyright (C) 2000
+ * Thomas Sailer (sailer@ife.ee.ethz.ch)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * History:
+ * 0.1 04.01.2000 Created
+ */
+
+/*****************************************************************************/
+
+#ifndef _LINUX_USBDEVICE_FS_H
+#define _LINUX_USBDEVICE_FS_H
+
+#include <linux/types.h>
+#include <linux/magic.h>
+
+/* --------------------------------------------------------------------- */
+
+/* usbdevfs ioctl codes */
+
+struct usbdevfs_ctrltransfer {
+ __u8 bRequestType;
+ __u8 bRequest;
+ __u16 wValue;
+ __u16 wIndex;
+ __u16 wLength;
+ __u32 timeout; /* in milliseconds */
+ void *data;
+};
+
+struct usbdevfs_bulktransfer {
+ unsigned int ep;
+ unsigned int len;
+ unsigned int timeout; /* in milliseconds */
+ void *data;
+};
+
+struct usbdevfs_setinterface {
+ unsigned int interface;
+ unsigned int altsetting;
+};
+
+struct usbdevfs_disconnectsignal {
+ unsigned int signr;
+ void *context;
+};
+
+#define USBDEVFS_MAXDRIVERNAME 255
+
+struct usbdevfs_getdriver {
+ unsigned int interface;
+ char driver[USBDEVFS_MAXDRIVERNAME + 1];
+};
+
+struct usbdevfs_connectinfo {
+ unsigned int devnum;
+ unsigned char slow;
+};
+
+#define USBDEVFS_URB_SHORT_NOT_OK 0x01
+#define USBDEVFS_URB_ISO_ASAP 0x02
+#define USBDEVFS_URB_NO_FSBR 0x20
+#define USBDEVFS_URB_ZERO_PACKET 0x40
+#define USBDEVFS_URB_NO_INTERRUPT 0x80
+
+#define USBDEVFS_URB_TYPE_ISO 0
+#define USBDEVFS_URB_TYPE_INTERRUPT 1
+#define USBDEVFS_URB_TYPE_CONTROL 2
+#define USBDEVFS_URB_TYPE_BULK 3
+
+struct usbdevfs_iso_packet_desc {
+ unsigned int length;
+ unsigned int actual_length;
+ unsigned int status;
+};
+
+struct usbdevfs_urb {
+ unsigned char type;
+ unsigned char endpoint;
+ int status;
+ unsigned int flags;
+ void *buffer;
+ int buffer_length;
+ int actual_length;
+ int start_frame;
+ int number_of_packets;
+ int error_count;
+ unsigned int signr; /* signal to be sent on completion,
+ or 0 if none should be sent. */
+ void *usercontext;
+ struct usbdevfs_iso_packet_desc iso_frame_desc[0];
+};
+
+/* ioctls for talking directly to drivers */
+struct usbdevfs_ioctl {
+ int ifno; /* interface 0..N ; negative numbers reserved */
+ int ioctl_code; /* MUST encode size + direction of data so the
+ * macros in <asm/ioctl.h> give correct values */
+ void *data; /* param buffer (in, or out) */
+};
+
+/* You can do most things with hubs just through control messages,
+ * except find out what device connects to what port. */
+struct usbdevfs_hub_portinfo {
+ char nports; /* number of downstream ports in this hub */
+ char port [127]; /* e.g. port 3 connects to device 27 */
+};
+
+
+#define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer)
+#define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer)
+#define USBDEVFS_RESETEP _IOR('U', 3, unsigned int)
+#define USBDEVFS_SETINTERFACE _IOR('U', 4, struct usbdevfs_setinterface)
+#define USBDEVFS_SETCONFIGURATION _IOR('U', 5, unsigned int)
+#define USBDEVFS_GETDRIVER _IOW('U', 8, struct usbdevfs_getdriver)
+#define USBDEVFS_SUBMITURB _IOR('U', 10, struct usbdevfs_urb)
+#define USBDEVFS_SUBMITURB32 _IOR('U', 10, struct usbdevfs_urb32)
+#define USBDEVFS_DISCARDURB _IO('U', 11)
+#define USBDEVFS_REAPURB _IOW('U', 12, void *)
+#define USBDEVFS_REAPURB32 _IOW('U', 12, __u32)
+#define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *)
+#define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, __u32)
+#define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal)
+#define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int)
+#define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int)
+#define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo)
+#define USBDEVFS_IOCTL _IOWR('U', 18, struct usbdevfs_ioctl)
+#define USBDEVFS_IOCTL32 _IOWR('U', 18, struct usbdevfs_ioctl32)
+#define USBDEVFS_HUB_PORTINFO _IOR('U', 19, struct usbdevfs_hub_portinfo)
+#define USBDEVFS_RESET _IO('U', 20)
+#define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int)
+#define USBDEVFS_DISCONNECT _IO('U', 22)
+#define USBDEVFS_CONNECT _IO('U', 23)
+#endif /* _LINUX_USBDEVICE_FS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/utime.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/utime.h
new file mode 100644
index 0000000..5cdf673
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/utime.h
@@ -0,0 +1,11 @@
+#ifndef _LINUX_UTIME_H
+#define _LINUX_UTIME_H
+
+#include <linux/types.h>
+
+struct utimbuf {
+ __kernel_time_t actime;
+ __kernel_time_t modtime;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/utsname.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/utsname.h
new file mode 100644
index 0000000..ff71a1a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/utsname.h
@@ -0,0 +1,34 @@
+#ifndef _LINUX_UTSNAME_H
+#define _LINUX_UTSNAME_H
+
+#define __OLD_UTS_LEN 8
+
+struct oldold_utsname {
+ char sysname[9];
+ char nodename[9];
+ char release[9];
+ char version[9];
+ char machine[9];
+};
+
+#define __NEW_UTS_LEN 64
+
+struct old_utsname {
+ char sysname[65];
+ char nodename[65];
+ char release[65];
+ char version[65];
+ char machine[65];
+};
+
+struct new_utsname {
+ char sysname[65];
+ char nodename[65];
+ char release[65];
+ char version[65];
+ char machine[65];
+ char domainname[65];
+};
+
+
+#endif /* _LINUX_UTSNAME_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/version.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/version.h
new file mode 100644
index 0000000..e6a89ef
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/version.h
@@ -0,0 +1,2 @@
+#define LINUX_VERSION_CODE 132638
+#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/veth.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/veth.h
new file mode 100644
index 0000000..3354c1e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/veth.h
@@ -0,0 +1,12 @@
+#ifndef __NET_VETH_H_
+#define __NET_VETH_H_
+
+enum {
+ VETH_INFO_UNSPEC,
+ VETH_INFO_PEER,
+
+ __VETH_INFO_MAX
+#define VETH_INFO_MAX (__VETH_INFO_MAX - 1)
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/videodev.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/videodev.h
new file mode 100644
index 0000000..5983d6b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/videodev.h
@@ -0,0 +1,340 @@
+/*
+ * Video for Linux version 1 - OBSOLETE
+ *
+ * Header file for v4l1 drivers and applications, for
+ * Linux kernels 2.2.x or 2.4.x.
+ *
+ * Provides header for legacy drivers and applications
+ *
+ * See http://linuxtv.org for more info
+ *
+ */
+#ifndef __LINUX_VIDEODEV_H
+#define __LINUX_VIDEODEV_H
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+#include <linux/videodev2.h>
+
+#if defined(__MIN_V4L1) && defined (__KERNEL__)
+
+/*
+ * Used by those V4L2 core functions that need a minimum V4L1 support,
+ * in order to allow V4L1 Compatibilty code compilation.
+ */
+
+struct video_mbuf
+{
+ int size; /* Total memory to map */
+ int frames; /* Frames */
+ int offsets[VIDEO_MAX_FRAME];
+};
+
+#define VIDIOCGMBUF _IOR('v',20, struct video_mbuf) /* Memory map buffer info */
+
+#else
+#if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__)
+
+#define VID_TYPE_CAPTURE 1 /* Can capture */
+#define VID_TYPE_TUNER 2 /* Can tune */
+#define VID_TYPE_TELETEXT 4 /* Does teletext */
+#define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */
+#define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */
+#define VID_TYPE_CLIPPING 32 /* Can clip */
+#define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */
+#define VID_TYPE_SCALES 128 /* Scalable */
+#define VID_TYPE_MONOCHROME 256 /* Monochrome only */
+#define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */
+#define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */
+#define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */
+#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */
+#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */
+
+struct video_capability
+{
+ char name[32];
+ int type;
+ int channels; /* Num channels */
+ int audios; /* Num audio devices */
+ int maxwidth; /* Supported width */
+ int maxheight; /* And height */
+ int minwidth; /* Supported width */
+ int minheight; /* And height */
+};
+
+
+struct video_channel
+{
+ int channel;
+ char name[32];
+ int tuners;
+ __u32 flags;
+#define VIDEO_VC_TUNER 1 /* Channel has a tuner */
+#define VIDEO_VC_AUDIO 2 /* Channel has audio */
+ __u16 type;
+#define VIDEO_TYPE_TV 1
+#define VIDEO_TYPE_CAMERA 2
+ __u16 norm; /* Norm set by channel */
+};
+
+struct video_tuner
+{
+ int tuner;
+ char name[32];
+ unsigned long rangelow, rangehigh; /* Tuner range */
+ __u32 flags;
+#define VIDEO_TUNER_PAL 1
+#define VIDEO_TUNER_NTSC 2
+#define VIDEO_TUNER_SECAM 4
+#define VIDEO_TUNER_LOW 8 /* Uses KHz not MHz */
+#define VIDEO_TUNER_NORM 16 /* Tuner can set norm */
+#define VIDEO_TUNER_STEREO_ON 128 /* Tuner is seeing stereo */
+#define VIDEO_TUNER_RDS_ON 256 /* Tuner is seeing an RDS datastream */
+#define VIDEO_TUNER_MBS_ON 512 /* Tuner is seeing an MBS datastream */
+ __u16 mode; /* PAL/NTSC/SECAM/OTHER */
+#define VIDEO_MODE_PAL 0
+#define VIDEO_MODE_NTSC 1
+#define VIDEO_MODE_SECAM 2
+#define VIDEO_MODE_AUTO 3
+ __u16 signal; /* Signal strength 16bit scale */
+};
+
+struct video_picture
+{
+ __u16 brightness;
+ __u16 hue;
+ __u16 colour;
+ __u16 contrast;
+ __u16 whiteness; /* Black and white only */
+ __u16 depth; /* Capture depth */
+ __u16 palette; /* Palette in use */
+#define VIDEO_PALETTE_GREY 1 /* Linear greyscale */
+#define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */
+#define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */
+#define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */
+#define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */
+#define VIDEO_PALETTE_RGB555 6 /* 555 15bit RGB */
+#define VIDEO_PALETTE_YUV422 7 /* YUV422 capture */
+#define VIDEO_PALETTE_YUYV 8
+#define VIDEO_PALETTE_UYVY 9 /* The great thing about standards is ... */
+#define VIDEO_PALETTE_YUV420 10
+#define VIDEO_PALETTE_YUV411 11 /* YUV411 capture */
+#define VIDEO_PALETTE_RAW 12 /* RAW capture (BT848) */
+#define VIDEO_PALETTE_YUV422P 13 /* YUV 4:2:2 Planar */
+#define VIDEO_PALETTE_YUV411P 14 /* YUV 4:1:1 Planar */
+#define VIDEO_PALETTE_YUV420P 15 /* YUV 4:2:0 Planar */
+#define VIDEO_PALETTE_YUV410P 16 /* YUV 4:1:0 Planar */
+#define VIDEO_PALETTE_PLANAR 13 /* start of planar entries */
+#define VIDEO_PALETTE_COMPONENT 7 /* start of component entries */
+};
+
+struct video_audio
+{
+ int audio; /* Audio channel */
+ __u16 volume; /* If settable */
+ __u16 bass, treble;
+ __u32 flags;
+#define VIDEO_AUDIO_MUTE 1
+#define VIDEO_AUDIO_MUTABLE 2
+#define VIDEO_AUDIO_VOLUME 4
+#define VIDEO_AUDIO_BASS 8
+#define VIDEO_AUDIO_TREBLE 16
+#define VIDEO_AUDIO_BALANCE 32
+ char name[16];
+#define VIDEO_SOUND_MONO 1
+#define VIDEO_SOUND_STEREO 2
+#define VIDEO_SOUND_LANG1 4
+#define VIDEO_SOUND_LANG2 8
+ __u16 mode;
+ __u16 balance; /* Stereo balance */
+ __u16 step; /* Step actual volume uses */
+};
+
+struct video_clip
+{
+ __s32 x,y;
+ __s32 width, height;
+ struct video_clip *next; /* For user use/driver use only */
+};
+
+struct video_window
+{
+ __u32 x,y; /* Position of window */
+ __u32 width,height; /* Its size */
+ __u32 chromakey;
+ __u32 flags;
+ struct video_clip *clips; /* Set only */
+ int clipcount;
+#define VIDEO_WINDOW_INTERLACE 1
+#define VIDEO_WINDOW_CHROMAKEY 16 /* Overlay by chromakey */
+#define VIDEO_CLIP_BITMAP -1
+/* bitmap is 1024x625, a '1' bit represents a clipped pixel */
+#define VIDEO_CLIPMAP_SIZE (128 * 625)
+};
+
+struct video_capture
+{
+ __u32 x,y; /* Offsets into image */
+ __u32 width, height; /* Area to capture */
+ __u16 decimation; /* Decimation divider */
+ __u16 flags; /* Flags for capture */
+#define VIDEO_CAPTURE_ODD 0 /* Temporal */
+#define VIDEO_CAPTURE_EVEN 1
+};
+
+struct video_buffer
+{
+ void *base;
+ int height,width;
+ int depth;
+ int bytesperline;
+};
+
+struct video_mmap
+{
+ unsigned int frame; /* Frame (0 - n) for double buffer */
+ int height,width;
+ unsigned int format; /* should be VIDEO_PALETTE_* */
+};
+
+struct video_key
+{
+ __u8 key[8];
+ __u32 flags;
+};
+
+struct video_mbuf
+{
+ int size; /* Total memory to map */
+ int frames; /* Frames */
+ int offsets[VIDEO_MAX_FRAME];
+};
+
+#define VIDEO_NO_UNIT (-1)
+
+struct video_unit
+{
+ int video; /* Video minor */
+ int vbi; /* VBI minor */
+ int radio; /* Radio minor */
+ int audio; /* Audio minor */
+ int teletext; /* Teletext minor */
+};
+
+struct vbi_format {
+ __u32 sampling_rate; /* in Hz */
+ __u32 samples_per_line;
+ __u32 sample_format; /* VIDEO_PALETTE_RAW only (1 byte) */
+ __s32 start[2]; /* starting line for each frame */
+ __u32 count[2]; /* count of lines for each frame */
+ __u32 flags;
+#define VBI_UNSYNC 1 /* can distingues between top/bottom field */
+#define VBI_INTERLACED 2 /* lines are interlaced */
+};
+
+/* video_info is biased towards hardware mpeg encode/decode */
+/* but it could apply generically to any hardware compressor/decompressor */
+struct video_info
+{
+ __u32 frame_count; /* frames output since decode/encode began */
+ __u32 h_size; /* current unscaled horizontal size */
+ __u32 v_size; /* current unscaled veritcal size */
+ __u32 smpte_timecode; /* current SMPTE timecode (for current GOP) */
+ __u32 picture_type; /* current picture type */
+ __u32 temporal_reference; /* current temporal reference */
+ __u8 user_data[256]; /* user data last found in compressed stream */
+ /* user_data[0] contains user data flags, user_data[1] has count */
+};
+
+/* generic structure for setting playback modes */
+struct video_play_mode
+{
+ int mode;
+ int p1;
+ int p2;
+};
+
+/* for loading microcode / fpga programming */
+struct video_code
+{
+ char loadwhat[16]; /* name or tag of file being passed */
+ int datasize;
+ __u8 *data;
+};
+
+#define VIDIOCGCAP _IOR('v',1,struct video_capability) /* Get capabilities */
+#define VIDIOCGCHAN _IOWR('v',2,struct video_channel) /* Get channel info (sources) */
+#define VIDIOCSCHAN _IOW('v',3,struct video_channel) /* Set channel */
+#define VIDIOCGTUNER _IOWR('v',4,struct video_tuner) /* Get tuner abilities */
+#define VIDIOCSTUNER _IOW('v',5,struct video_tuner) /* Tune the tuner for the current channel */
+#define VIDIOCGPICT _IOR('v',6,struct video_picture) /* Get picture properties */
+#define VIDIOCSPICT _IOW('v',7,struct video_picture) /* Set picture properties */
+#define VIDIOCCAPTURE _IOW('v',8,int) /* Start, end capture */
+#define VIDIOCGWIN _IOR('v',9, struct video_window) /* Get the video overlay window */
+#define VIDIOCSWIN _IOW('v',10, struct video_window) /* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */
+#define VIDIOCGFBUF _IOR('v',11, struct video_buffer) /* Get frame buffer */
+#define VIDIOCSFBUF _IOW('v',12, struct video_buffer) /* Set frame buffer - root only */
+#define VIDIOCKEY _IOR('v',13, struct video_key) /* Video key event - to dev 255 is to all - cuts capture on all DMA windows with this key (0xFFFFFFFF == all) */
+#define VIDIOCGFREQ _IOR('v',14, unsigned long) /* Set tuner */
+#define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */
+#define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */
+#define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */
+#define VIDIOCSYNC _IOW('v',18, int) /* Sync with mmap grabbing */
+#define VIDIOCMCAPTURE _IOW('v',19, struct video_mmap) /* Grab frames */
+#define VIDIOCGMBUF _IOR('v',20, struct video_mbuf) /* Memory map buffer info */
+#define VIDIOCGUNIT _IOR('v',21, struct video_unit) /* Get attached units */
+#define VIDIOCGCAPTURE _IOR('v',22, struct video_capture) /* Get subcapture */
+#define VIDIOCSCAPTURE _IOW('v',23, struct video_capture) /* Set subcapture */
+#define VIDIOCSPLAYMODE _IOW('v',24, struct video_play_mode) /* Set output video mode/feature */
+#define VIDIOCSWRITEMODE _IOW('v',25, int) /* Set write mode */
+#define VIDIOCGPLAYINFO _IOR('v',26, struct video_info) /* Get current playback info from hardware */
+#define VIDIOCSMICROCODE _IOW('v',27, struct video_code) /* Load microcode into hardware */
+#define VIDIOCGVBIFMT _IOR('v',28, struct vbi_format) /* Get VBI information */
+#define VIDIOCSVBIFMT _IOW('v',29, struct vbi_format) /* Set VBI information */
+
+
+#define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */
+
+/* VIDIOCSWRITEMODE */
+#define VID_WRITE_MPEG_AUD 0
+#define VID_WRITE_MPEG_VID 1
+#define VID_WRITE_OSD 2
+#define VID_WRITE_TTX 3
+#define VID_WRITE_CC 4
+#define VID_WRITE_MJPEG 5
+
+/* VIDIOCSPLAYMODE */
+#define VID_PLAY_VID_OUT_MODE 0
+ /* p1: = VIDEO_MODE_PAL, VIDEO_MODE_NTSC, etc ... */
+#define VID_PLAY_GENLOCK 1
+ /* p1: 0 = OFF, 1 = ON */
+ /* p2: GENLOCK FINE DELAY value */
+#define VID_PLAY_NORMAL 2
+#define VID_PLAY_PAUSE 3
+#define VID_PLAY_SINGLE_FRAME 4
+#define VID_PLAY_FAST_FORWARD 5
+#define VID_PLAY_SLOW_MOTION 6
+#define VID_PLAY_IMMEDIATE_NORMAL 7
+#define VID_PLAY_SWITCH_CHANNELS 8
+#define VID_PLAY_FREEZE_FRAME 9
+#define VID_PLAY_STILL_MODE 10
+#define VID_PLAY_MASTER_MODE 11
+ /* p1: see below */
+#define VID_PLAY_MASTER_NONE 1
+#define VID_PLAY_MASTER_VIDEO 2
+#define VID_PLAY_MASTER_AUDIO 3
+#define VID_PLAY_ACTIVE_SCANLINES 12
+ /* p1 = first active; p2 = last active */
+#define VID_PLAY_RESET 13
+#define VID_PLAY_END_MARK 14
+
+#endif /* CONFIG_VIDEO_V4L1_COMPAT */
+#endif /* __MIN_V4L1 */
+
+#endif /* __LINUX_VIDEODEV_H */
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/videodev2.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/videodev2.h
new file mode 100644
index 0000000..3f88bb7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/videodev2.h
@@ -0,0 +1,1557 @@
+/*
+ * Video for Linux Two header file
+ *
+ * Copyright (C) 1999-2007 the contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Alternatively you can redistribute this file under the terms of the
+ * BSD license as stated below:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. The names of its contributors may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Header file for v4l or V4L2 drivers and applications
+ * with public API.
+ * All kernel-specific stuff were moved to media/v4l2-dev.h, so
+ * no #if __KERNEL tests are allowed here
+ *
+ * See http://linuxtv.org for more info
+ *
+ * Author: Bill Dirks <bill@thedirks.org>
+ * Justin Schoeman
+ * Hans Verkuil <hverkuil@xs4all.nl>
+ * et al.
+ */
+#ifndef __LINUX_VIDEODEV2_H
+#define __LINUX_VIDEODEV2_H
+
+#include <sys/time.h>
+
+#include <linux/ioctl.h>
+#include <linux/types.h>
+
+/*
+ * Common stuff for both V4L1 and V4L2
+ * Moved from videodev.h
+ */
+#define VIDEO_MAX_FRAME 32
+
+
+/* These defines are V4L1 specific and should not be used with the V4L2 API!
+ They will be removed from this header in the future. */
+
+#define VID_TYPE_CAPTURE 1 /* Can capture */
+#define VID_TYPE_TUNER 2 /* Can tune */
+#define VID_TYPE_TELETEXT 4 /* Does teletext */
+#define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */
+#define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */
+#define VID_TYPE_CLIPPING 32 /* Can clip */
+#define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */
+#define VID_TYPE_SCALES 128 /* Scalable */
+#define VID_TYPE_MONOCHROME 256 /* Monochrome only */
+#define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */
+#define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */
+#define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */
+#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */
+#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */
+
+/*
+ * M I S C E L L A N E O U S
+ */
+
+/* Four-character-code (FOURCC) */
+#define v4l2_fourcc(a, b, c, d)\
+ ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24))
+
+/*
+ * E N U M S
+ */
+enum v4l2_field {
+ V4L2_FIELD_ANY = 0, /* driver can choose from none,
+ top, bottom, interlaced
+ depending on whatever it thinks
+ is approximate ... */
+ V4L2_FIELD_NONE = 1, /* this device has no fields ... */
+ V4L2_FIELD_TOP = 2, /* top field only */
+ V4L2_FIELD_BOTTOM = 3, /* bottom field only */
+ V4L2_FIELD_INTERLACED = 4, /* both fields interlaced */
+ V4L2_FIELD_SEQ_TB = 5, /* both fields sequential into one
+ buffer, top-bottom order */
+ V4L2_FIELD_SEQ_BT = 6, /* same as above + bottom-top order */
+ V4L2_FIELD_ALTERNATE = 7, /* both fields alternating into
+ separate buffers */
+ V4L2_FIELD_INTERLACED_TB = 8, /* both fields interlaced, top field
+ first and the top field is
+ transmitted first */
+ V4L2_FIELD_INTERLACED_BT = 9, /* both fields interlaced, top field
+ first and the bottom field is
+ transmitted first */
+};
+#define V4L2_FIELD_HAS_TOP(field) \
+ ((field) == V4L2_FIELD_TOP ||\
+ (field) == V4L2_FIELD_INTERLACED ||\
+ (field) == V4L2_FIELD_INTERLACED_TB ||\
+ (field) == V4L2_FIELD_INTERLACED_BT ||\
+ (field) == V4L2_FIELD_SEQ_TB ||\
+ (field) == V4L2_FIELD_SEQ_BT)
+#define V4L2_FIELD_HAS_BOTTOM(field) \
+ ((field) == V4L2_FIELD_BOTTOM ||\
+ (field) == V4L2_FIELD_INTERLACED ||\
+ (field) == V4L2_FIELD_INTERLACED_TB ||\
+ (field) == V4L2_FIELD_INTERLACED_BT ||\
+ (field) == V4L2_FIELD_SEQ_TB ||\
+ (field) == V4L2_FIELD_SEQ_BT)
+#define V4L2_FIELD_HAS_BOTH(field) \
+ ((field) == V4L2_FIELD_INTERLACED ||\
+ (field) == V4L2_FIELD_INTERLACED_TB ||\
+ (field) == V4L2_FIELD_INTERLACED_BT ||\
+ (field) == V4L2_FIELD_SEQ_TB ||\
+ (field) == V4L2_FIELD_SEQ_BT)
+
+enum v4l2_buf_type {
+ V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,
+ V4L2_BUF_TYPE_VIDEO_OUTPUT = 2,
+ V4L2_BUF_TYPE_VIDEO_OVERLAY = 3,
+ V4L2_BUF_TYPE_VBI_CAPTURE = 4,
+ V4L2_BUF_TYPE_VBI_OUTPUT = 5,
+ V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6,
+ V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7,
+#if 1
+ /* Experimental */
+ V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
+#endif
+ V4L2_BUF_TYPE_PRIVATE = 0x80,
+};
+
+enum v4l2_ctrl_type {
+ V4L2_CTRL_TYPE_INTEGER = 1,
+ V4L2_CTRL_TYPE_BOOLEAN = 2,
+ V4L2_CTRL_TYPE_MENU = 3,
+ V4L2_CTRL_TYPE_BUTTON = 4,
+ V4L2_CTRL_TYPE_INTEGER64 = 5,
+ V4L2_CTRL_TYPE_CTRL_CLASS = 6,
+};
+
+enum v4l2_tuner_type {
+ V4L2_TUNER_RADIO = 1,
+ V4L2_TUNER_ANALOG_TV = 2,
+ V4L2_TUNER_DIGITAL_TV = 3,
+};
+
+enum v4l2_memory {
+ V4L2_MEMORY_MMAP = 1,
+ V4L2_MEMORY_USERPTR = 2,
+ V4L2_MEMORY_OVERLAY = 3,
+};
+
+/* see also http://vektor.theorem.ca/graphics/ycbcr/ */
+enum v4l2_colorspace {
+ /* ITU-R 601 -- broadcast NTSC/PAL */
+ V4L2_COLORSPACE_SMPTE170M = 1,
+
+ /* 1125-Line (US) HDTV */
+ V4L2_COLORSPACE_SMPTE240M = 2,
+
+ /* HD and modern captures. */
+ V4L2_COLORSPACE_REC709 = 3,
+
+ /* broken BT878 extents (601, luma range 16-253 instead of 16-235) */
+ V4L2_COLORSPACE_BT878 = 4,
+
+ /* These should be useful. Assume 601 extents. */
+ V4L2_COLORSPACE_470_SYSTEM_M = 5,
+ V4L2_COLORSPACE_470_SYSTEM_BG = 6,
+
+ /* I know there will be cameras that send this. So, this is
+ * unspecified chromaticities and full 0-255 on each of the
+ * Y'CbCr components
+ */
+ V4L2_COLORSPACE_JPEG = 7,
+
+ /* For RGB colourspaces, this is probably a good start. */
+ V4L2_COLORSPACE_SRGB = 8,
+};
+
+enum v4l2_priority {
+ V4L2_PRIORITY_UNSET = 0, /* not initialized */
+ V4L2_PRIORITY_BACKGROUND = 1,
+ V4L2_PRIORITY_INTERACTIVE = 2,
+ V4L2_PRIORITY_RECORD = 3,
+ V4L2_PRIORITY_DEFAULT = V4L2_PRIORITY_INTERACTIVE,
+};
+
+struct v4l2_rect {
+ __s32 left;
+ __s32 top;
+ __s32 width;
+ __s32 height;
+};
+
+struct v4l2_fract {
+ __u32 numerator;
+ __u32 denominator;
+};
+
+/*
+ * D R I V E R C A P A B I L I T I E S
+ */
+struct v4l2_capability {
+ __u8 driver[16]; /* i.e. "bttv" */
+ __u8 card[32]; /* i.e. "Hauppauge WinTV" */
+ __u8 bus_info[32]; /* "PCI:" + pci_name(pci_dev) */
+ __u32 version; /* should use KERNEL_VERSION() */
+ __u32 capabilities; /* Device capabilities */
+ __u32 reserved[4];
+};
+
+/* Values for 'capabilities' field */
+#define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */
+#define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */
+#define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */
+#define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */
+#define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */
+#define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */
+#define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */
+#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */
+#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200 /* Can do video output overlay */
+#define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */
+
+#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */
+#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
+#define V4L2_CAP_RADIO 0x00040000 /* is a radio device */
+
+#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */
+#define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */
+#define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */
+
+/*
+ * V I D E O I M A G E F O R M A T
+ */
+struct v4l2_pix_format {
+ __u32 width;
+ __u32 height;
+ __u32 pixelformat;
+ enum v4l2_field field;
+ __u32 bytesperline; /* for padding, zero if unused */
+ __u32 sizeimage;
+ enum v4l2_colorspace colorspace;
+ __u32 priv; /* private data, depends on pixelformat */
+};
+
+/* Pixel format FOURCC depth Description */
+#define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R', 'G', 'B', '1') /* 8 RGB-3-3-2 */
+#define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4') /* 16 xxxxrrrr ggggbbbb */
+#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O') /* 16 RGB-5-5-5 */
+#define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */
+#define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */
+#define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */
+#define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */
+#define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */
+#define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */
+#define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4') /* 32 RGB-8-8-8-8 */
+#define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */
+#define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */
+#define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */
+#define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */
+#define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */
+#define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16 YUV 4:2:2 */
+#define V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16 YUV 4:2:2 */
+#define V4L2_PIX_FMT_VYUY v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16 YUV 4:2:2 */
+#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16 YVU422 planar */
+#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 16 YVU411 planar */
+#define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y', '4', '1', 'P') /* 12 YUV 4:1:1 */
+#define V4L2_PIX_FMT_YUV444 v4l2_fourcc('Y', '4', '4', '4') /* 16 xxxxyyyy uuuuvvvv */
+#define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */
+#define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */
+#define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */
+
+/* two planes -- one Y, one Cr + Cb interleaved */
+#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */
+#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */
+#define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */
+#define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */
+
+/* The following formats are not defined in the V4L2 specification */
+#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */
+#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */
+#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16 YUV 4:2:2 */
+#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */
+#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */
+
+/* see http://www.siliconimaging.com/RGB%20Bayer.htm */
+#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */
+#define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */
+/*
+ * 10bit raw bayer, expanded to 16 bits
+ * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb...
+ */
+#define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0')
+/* 10bit raw bayer DPCM compressed to 8 bits */
+#define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0')
+#define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */
+
+/* compressed formats */
+#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */
+#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */
+#define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */
+#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */
+
+/* Vendor-specific formats */
+#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */
+#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */
+#define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */
+#define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */
+#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */
+#define V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S', '5', '0', '1') /* YUYV per line */
+#define V4L2_PIX_FMT_SPCA505 v4l2_fourcc('S', '5', '0', '5') /* YYUV per line */
+#define V4L2_PIX_FMT_SPCA508 v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */
+#define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */
+#define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */
+#define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */
+#define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */
+#define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */
+#define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */
+
+/*
+ * F O R M A T E N U M E R A T I O N
+ */
+struct v4l2_fmtdesc {
+ __u32 index; /* Format number */
+ enum v4l2_buf_type type; /* buffer type */
+ __u32 flags;
+ __u8 description[32]; /* Description string */
+ __u32 pixelformat; /* Format fourcc */
+ __u32 reserved[4];
+};
+
+#define V4L2_FMT_FLAG_COMPRESSED 0x0001
+
+#if 1
+ /* Experimental Frame Size and frame rate enumeration */
+/*
+ * F R A M E S I Z E E N U M E R A T I O N
+ */
+enum v4l2_frmsizetypes {
+ V4L2_FRMSIZE_TYPE_DISCRETE = 1,
+ V4L2_FRMSIZE_TYPE_CONTINUOUS = 2,
+ V4L2_FRMSIZE_TYPE_STEPWISE = 3,
+};
+
+struct v4l2_frmsize_discrete {
+ __u32 width; /* Frame width [pixel] */
+ __u32 height; /* Frame height [pixel] */
+};
+
+struct v4l2_frmsize_stepwise {
+ __u32 min_width; /* Minimum frame width [pixel] */
+ __u32 max_width; /* Maximum frame width [pixel] */
+ __u32 step_width; /* Frame width step size [pixel] */
+ __u32 min_height; /* Minimum frame height [pixel] */
+ __u32 max_height; /* Maximum frame height [pixel] */
+ __u32 step_height; /* Frame height step size [pixel] */
+};
+
+struct v4l2_frmsizeenum {
+ __u32 index; /* Frame size number */
+ __u32 pixel_format; /* Pixel format */
+ __u32 type; /* Frame size type the device supports. */
+
+ union { /* Frame size */
+ struct v4l2_frmsize_discrete discrete;
+ struct v4l2_frmsize_stepwise stepwise;
+ };
+
+ __u32 reserved[2]; /* Reserved space for future use */
+};
+
+/*
+ * F R A M E R A T E E N U M E R A T I O N
+ */
+enum v4l2_frmivaltypes {
+ V4L2_FRMIVAL_TYPE_DISCRETE = 1,
+ V4L2_FRMIVAL_TYPE_CONTINUOUS = 2,
+ V4L2_FRMIVAL_TYPE_STEPWISE = 3,
+};
+
+struct v4l2_frmival_stepwise {
+ struct v4l2_fract min; /* Minimum frame interval [s] */
+ struct v4l2_fract max; /* Maximum frame interval [s] */
+ struct v4l2_fract step; /* Frame interval step size [s] */
+};
+
+struct v4l2_frmivalenum {
+ __u32 index; /* Frame format index */
+ __u32 pixel_format; /* Pixel format */
+ __u32 width; /* Frame width */
+ __u32 height; /* Frame height */
+ __u32 type; /* Frame interval type the device supports. */
+
+ union { /* Frame interval */
+ struct v4l2_fract discrete;
+ struct v4l2_frmival_stepwise stepwise;
+ };
+
+ __u32 reserved[2]; /* Reserved space for future use */
+};
+#endif
+
+/*
+ * T I M E C O D E
+ */
+struct v4l2_timecode {
+ __u32 type;
+ __u32 flags;
+ __u8 frames;
+ __u8 seconds;
+ __u8 minutes;
+ __u8 hours;
+ __u8 userbits[4];
+};
+
+/* Type */
+#define V4L2_TC_TYPE_24FPS 1
+#define V4L2_TC_TYPE_25FPS 2
+#define V4L2_TC_TYPE_30FPS 3
+#define V4L2_TC_TYPE_50FPS 4
+#define V4L2_TC_TYPE_60FPS 5
+
+/* Flags */
+#define V4L2_TC_FLAG_DROPFRAME 0x0001 /* "drop-frame" mode */
+#define V4L2_TC_FLAG_COLORFRAME 0x0002
+#define V4L2_TC_USERBITS_field 0x000C
+#define V4L2_TC_USERBITS_USERDEFINED 0x0000
+#define V4L2_TC_USERBITS_8BITCHARS 0x0008
+/* The above is based on SMPTE timecodes */
+
+struct v4l2_jpegcompression {
+ int quality;
+
+ int APPn; /* Number of APP segment to be written,
+ * must be 0..15 */
+ int APP_len; /* Length of data in JPEG APPn segment */
+ char APP_data[60]; /* Data in the JPEG APPn segment. */
+
+ int COM_len; /* Length of data in JPEG COM segment */
+ char COM_data[60]; /* Data in JPEG COM segment */
+
+ __u32 jpeg_markers; /* Which markers should go into the JPEG
+ * output. Unless you exactly know what
+ * you do, leave them untouched.
+ * Inluding less markers will make the
+ * resulting code smaller, but there will
+ * be fewer aplications which can read it.
+ * The presence of the APP and COM marker
+ * is influenced by APP_len and COM_len
+ * ONLY, not by this property! */
+
+#define V4L2_JPEG_MARKER_DHT (1<<3) /* Define Huffman Tables */
+#define V4L2_JPEG_MARKER_DQT (1<<4) /* Define Quantization Tables */
+#define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */
+#define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */
+#define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will
+ * allways use APP0 */
+};
+
+/*
+ * M E M O R Y - M A P P I N G B U F F E R S
+ */
+struct v4l2_requestbuffers {
+ __u32 count;
+ enum v4l2_buf_type type;
+ enum v4l2_memory memory;
+ __u32 reserved[2];
+};
+
+struct v4l2_buffer {
+ __u32 index;
+ enum v4l2_buf_type type;
+ __u32 bytesused;
+ __u32 flags;
+ enum v4l2_field field;
+ struct timeval timestamp;
+ struct v4l2_timecode timecode;
+ __u32 sequence;
+
+ /* memory location */
+ enum v4l2_memory memory;
+ union {
+ __u32 offset;
+ unsigned long userptr;
+ } m;
+ __u32 length;
+ __u32 input;
+ __u32 reserved;
+};
+
+/* Flags for 'flags' field */
+#define V4L2_BUF_FLAG_MAPPED 0x0001 /* Buffer is mapped (flag) */
+#define V4L2_BUF_FLAG_QUEUED 0x0002 /* Buffer is queued for processing */
+#define V4L2_BUF_FLAG_DONE 0x0004 /* Buffer is ready */
+#define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */
+#define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */
+#define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */
+#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */
+#define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */
+
+/*
+ * O V E R L A Y P R E V I E W
+ */
+struct v4l2_framebuffer {
+ __u32 capability;
+ __u32 flags;
+/* FIXME: in theory we should pass something like PCI device + memory
+ * region + offset instead of some physical address */
+ void *base;
+ struct v4l2_pix_format fmt;
+};
+/* Flags for the 'capability' field. Read only */
+#define V4L2_FBUF_CAP_EXTERNOVERLAY 0x0001
+#define V4L2_FBUF_CAP_CHROMAKEY 0x0002
+#define V4L2_FBUF_CAP_LIST_CLIPPING 0x0004
+#define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008
+#define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010
+#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020
+#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040
+/* Flags for the 'flags' field. */
+#define V4L2_FBUF_FLAG_PRIMARY 0x0001
+#define V4L2_FBUF_FLAG_OVERLAY 0x0002
+#define V4L2_FBUF_FLAG_CHROMAKEY 0x0004
+#define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008
+#define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010
+#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020
+
+struct v4l2_clip {
+ struct v4l2_rect c;
+ struct v4l2_clip *next;
+};
+
+struct v4l2_window {
+ struct v4l2_rect w;
+ enum v4l2_field field;
+ __u32 chromakey;
+ struct v4l2_clip *clips;
+ __u32 clipcount;
+ void *bitmap;
+ __u8 global_alpha;
+};
+
+/*
+ * C A P T U R E P A R A M E T E R S
+ */
+struct v4l2_captureparm {
+ __u32 capability; /* Supported modes */
+ __u32 capturemode; /* Current mode */
+ struct v4l2_fract timeperframe; /* Time per frame in .1us units */
+ __u32 extendedmode; /* Driver-specific extensions */
+ __u32 readbuffers; /* # of buffers for read */
+ __u32 reserved[4];
+};
+
+/* Flags for 'capability' and 'capturemode' fields */
+#define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */
+#define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */
+
+struct v4l2_outputparm {
+ __u32 capability; /* Supported modes */
+ __u32 outputmode; /* Current mode */
+ struct v4l2_fract timeperframe; /* Time per frame in seconds */
+ __u32 extendedmode; /* Driver-specific extensions */
+ __u32 writebuffers; /* # of buffers for write */
+ __u32 reserved[4];
+};
+
+/*
+ * I N P U T I M A G E C R O P P I N G
+ */
+struct v4l2_cropcap {
+ enum v4l2_buf_type type;
+ struct v4l2_rect bounds;
+ struct v4l2_rect defrect;
+ struct v4l2_fract pixelaspect;
+};
+
+struct v4l2_crop {
+ enum v4l2_buf_type type;
+ struct v4l2_rect c;
+};
+
+/*
+ * A N A L O G V I D E O S T A N D A R D
+ */
+
+typedef __u64 v4l2_std_id;
+
+/* one bit for each */
+#define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)
+#define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)
+#define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004)
+#define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008)
+#define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010)
+#define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020)
+#define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040)
+#define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080)
+
+#define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100)
+#define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200)
+#define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)
+#define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800)
+
+#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000)
+#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)
+#define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000)
+#define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000)
+
+#define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
+#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
+#define V4L2_STD_SECAM_G ((v4l2_std_id)0x00040000)
+#define V4L2_STD_SECAM_H ((v4l2_std_id)0x00080000)
+#define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000)
+#define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)
+#define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000)
+#define V4L2_STD_SECAM_LC ((v4l2_std_id)0x00800000)
+
+/* ATSC/HDTV */
+#define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
+#define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)
+
+/* FIXME:
+ Although std_id is 64 bits, there is an issue on PPC32 architecture that
+ makes switch(__u64) to break. So, there's a hack on v4l2-common.c rounding
+ this value to 32 bits.
+ As, currently, the max value is for V4L2_STD_ATSC_16_VSB (30 bits wide),
+ it should work fine. However, if needed to add more than two standards,
+ v4l2-common.c should be fixed.
+ */
+
+/* some merged standards */
+#define V4L2_STD_MN (V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC)
+#define V4L2_STD_B (V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B)
+#define V4L2_STD_GH (V4L2_STD_PAL_G|V4L2_STD_PAL_H|V4L2_STD_SECAM_G|V4L2_STD_SECAM_H)
+#define V4L2_STD_DK (V4L2_STD_PAL_DK|V4L2_STD_SECAM_DK)
+
+/* some common needed stuff */
+#define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\
+ V4L2_STD_PAL_B1 |\
+ V4L2_STD_PAL_G)
+#define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\
+ V4L2_STD_PAL_D1 |\
+ V4L2_STD_PAL_K)
+#define V4L2_STD_PAL (V4L2_STD_PAL_BG |\
+ V4L2_STD_PAL_DK |\
+ V4L2_STD_PAL_H |\
+ V4L2_STD_PAL_I)
+#define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\
+ V4L2_STD_NTSC_M_JP |\
+ V4L2_STD_NTSC_M_KR)
+#define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\
+ V4L2_STD_SECAM_K |\
+ V4L2_STD_SECAM_K1)
+#define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\
+ V4L2_STD_SECAM_G |\
+ V4L2_STD_SECAM_H |\
+ V4L2_STD_SECAM_DK |\
+ V4L2_STD_SECAM_L |\
+ V4L2_STD_SECAM_LC)
+
+#define V4L2_STD_525_60 (V4L2_STD_PAL_M |\
+ V4L2_STD_PAL_60 |\
+ V4L2_STD_NTSC |\
+ V4L2_STD_NTSC_443)
+#define V4L2_STD_625_50 (V4L2_STD_PAL |\
+ V4L2_STD_PAL_N |\
+ V4L2_STD_PAL_Nc |\
+ V4L2_STD_SECAM)
+#define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\
+ V4L2_STD_ATSC_16_VSB)
+
+#define V4L2_STD_UNKNOWN 0
+#define V4L2_STD_ALL (V4L2_STD_525_60 |\
+ V4L2_STD_625_50)
+
+struct v4l2_standard {
+ __u32 index;
+ v4l2_std_id id;
+ __u8 name[24];
+ struct v4l2_fract frameperiod; /* Frames, not fields */
+ __u32 framelines;
+ __u32 reserved[4];
+};
+
+/*
+ * V I D E O I N P U T S
+ */
+struct v4l2_input {
+ __u32 index; /* Which input */
+ __u8 name[32]; /* Label */
+ __u32 type; /* Type of input */
+ __u32 audioset; /* Associated audios (bitfield) */
+ __u32 tuner; /* Associated tuner */
+ v4l2_std_id std;
+ __u32 status;
+ __u32 reserved[4];
+};
+
+/* Values for the 'type' field */
+#define V4L2_INPUT_TYPE_TUNER 1
+#define V4L2_INPUT_TYPE_CAMERA 2
+
+/* field 'status' - general */
+#define V4L2_IN_ST_NO_POWER 0x00000001 /* Attached device is off */
+#define V4L2_IN_ST_NO_SIGNAL 0x00000002
+#define V4L2_IN_ST_NO_COLOR 0x00000004
+
+/* field 'status' - sensor orientation */
+/* If sensor is mounted upside down set both bits */
+#define V4L2_IN_ST_HFLIP 0x00000010 /* Frames are flipped horizontally */
+#define V4L2_IN_ST_VFLIP 0x00000020 /* Frames are flipped vertically */
+
+/* field 'status' - analog */
+#define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */
+#define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */
+
+/* field 'status' - digital */
+#define V4L2_IN_ST_NO_SYNC 0x00010000 /* No synchronization lock */
+#define V4L2_IN_ST_NO_EQU 0x00020000 /* No equalizer lock */
+#define V4L2_IN_ST_NO_CARRIER 0x00040000 /* Carrier recovery failed */
+
+/* field 'status' - VCR and set-top box */
+#define V4L2_IN_ST_MACROVISION 0x01000000 /* Macrovision detected */
+#define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */
+#define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */
+
+/*
+ * V I D E O O U T P U T S
+ */
+struct v4l2_output {
+ __u32 index; /* Which output */
+ __u8 name[32]; /* Label */
+ __u32 type; /* Type of output */
+ __u32 audioset; /* Associated audios (bitfield) */
+ __u32 modulator; /* Associated modulator */
+ v4l2_std_id std;
+ __u32 reserved[4];
+};
+/* Values for the 'type' field */
+#define V4L2_OUTPUT_TYPE_MODULATOR 1
+#define V4L2_OUTPUT_TYPE_ANALOG 2
+#define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3
+
+/*
+ * C O N T R O L S
+ */
+struct v4l2_control {
+ __u32 id;
+ __s32 value;
+};
+
+struct v4l2_ext_control {
+ __u32 id;
+ __u32 reserved2[2];
+ union {
+ __s32 value;
+ __s64 value64;
+ void *reserved;
+ };
+} __attribute__ ((packed));
+
+struct v4l2_ext_controls {
+ __u32 ctrl_class;
+ __u32 count;
+ __u32 error_idx;
+ __u32 reserved[2];
+ struct v4l2_ext_control *controls;
+};
+
+/* Values for ctrl_class field */
+#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */
+#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */
+#define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */
+
+#define V4L2_CTRL_ID_MASK (0x0fffffff)
+#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
+#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
+
+/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
+struct v4l2_queryctrl {
+ __u32 id;
+ enum v4l2_ctrl_type type;
+ __u8 name[32]; /* Whatever */
+ __s32 minimum; /* Note signedness */
+ __s32 maximum;
+ __s32 step;
+ __s32 default_value;
+ __u32 flags;
+ __u32 reserved[2];
+};
+
+/* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
+struct v4l2_querymenu {
+ __u32 id;
+ __u32 index;
+ __u8 name[32]; /* Whatever */
+ __u32 reserved;
+};
+
+/* Control flags */
+#define V4L2_CTRL_FLAG_DISABLED 0x0001
+#define V4L2_CTRL_FLAG_GRABBED 0x0002
+#define V4L2_CTRL_FLAG_READ_ONLY 0x0004
+#define V4L2_CTRL_FLAG_UPDATE 0x0008
+#define V4L2_CTRL_FLAG_INACTIVE 0x0010
+#define V4L2_CTRL_FLAG_SLIDER 0x0020
+#define V4L2_CTRL_FLAG_WRITE_ONLY 0x0040
+
+/* Query flag, to be ORed with the control ID */
+#define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
+
+/* User-class control IDs defined by V4L2 */
+#define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900)
+#define V4L2_CID_USER_BASE V4L2_CID_BASE
+/* IDs reserved for driver specific controls */
+#define V4L2_CID_PRIVATE_BASE 0x08000000
+
+#define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1)
+#define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0)
+#define V4L2_CID_CONTRAST (V4L2_CID_BASE+1)
+#define V4L2_CID_SATURATION (V4L2_CID_BASE+2)
+#define V4L2_CID_HUE (V4L2_CID_BASE+3)
+#define V4L2_CID_AUDIO_VOLUME (V4L2_CID_BASE+5)
+#define V4L2_CID_AUDIO_BALANCE (V4L2_CID_BASE+6)
+#define V4L2_CID_AUDIO_BASS (V4L2_CID_BASE+7)
+#define V4L2_CID_AUDIO_TREBLE (V4L2_CID_BASE+8)
+#define V4L2_CID_AUDIO_MUTE (V4L2_CID_BASE+9)
+#define V4L2_CID_AUDIO_LOUDNESS (V4L2_CID_BASE+10)
+#define V4L2_CID_BLACK_LEVEL (V4L2_CID_BASE+11) /* Deprecated */
+#define V4L2_CID_AUTO_WHITE_BALANCE (V4L2_CID_BASE+12)
+#define V4L2_CID_DO_WHITE_BALANCE (V4L2_CID_BASE+13)
+#define V4L2_CID_RED_BALANCE (V4L2_CID_BASE+14)
+#define V4L2_CID_BLUE_BALANCE (V4L2_CID_BASE+15)
+#define V4L2_CID_GAMMA (V4L2_CID_BASE+16)
+#define V4L2_CID_WHITENESS (V4L2_CID_GAMMA) /* Deprecated */
+#define V4L2_CID_EXPOSURE (V4L2_CID_BASE+17)
+#define V4L2_CID_AUTOGAIN (V4L2_CID_BASE+18)
+#define V4L2_CID_GAIN (V4L2_CID_BASE+19)
+#define V4L2_CID_HFLIP (V4L2_CID_BASE+20)
+#define V4L2_CID_VFLIP (V4L2_CID_BASE+21)
+
+/* Deprecated; use V4L2_CID_PAN_RESET and V4L2_CID_TILT_RESET */
+#define V4L2_CID_HCENTER (V4L2_CID_BASE+22)
+#define V4L2_CID_VCENTER (V4L2_CID_BASE+23)
+
+#define V4L2_CID_POWER_LINE_FREQUENCY (V4L2_CID_BASE+24)
+enum v4l2_power_line_frequency {
+ V4L2_CID_POWER_LINE_FREQUENCY_DISABLED = 0,
+ V4L2_CID_POWER_LINE_FREQUENCY_50HZ = 1,
+ V4L2_CID_POWER_LINE_FREQUENCY_60HZ = 2,
+};
+#define V4L2_CID_HUE_AUTO (V4L2_CID_BASE+25)
+#define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE+26)
+#define V4L2_CID_SHARPNESS (V4L2_CID_BASE+27)
+#define V4L2_CID_BACKLIGHT_COMPENSATION (V4L2_CID_BASE+28)
+#define V4L2_CID_CHROMA_AGC (V4L2_CID_BASE+29)
+#define V4L2_CID_COLOR_KILLER (V4L2_CID_BASE+30)
+#define V4L2_CID_COLORFX (V4L2_CID_BASE+31)
+enum v4l2_colorfx {
+ V4L2_COLORFX_NONE = 0,
+ V4L2_COLORFX_BW = 1,
+ V4L2_COLORFX_SEPIA = 2,
+};
+
+/* last CID + 1 */
+#define V4L2_CID_LASTP1 (V4L2_CID_BASE+32)
+
+/* MPEG-class control IDs defined by V4L2 */
+#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
+#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1)
+
+/* MPEG streams */
+#define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0)
+enum v4l2_mpeg_stream_type {
+ V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */
+ V4L2_MPEG_STREAM_TYPE_MPEG2_TS = 1, /* MPEG-2 transport stream */
+ V4L2_MPEG_STREAM_TYPE_MPEG1_SS = 2, /* MPEG-1 system stream */
+ V4L2_MPEG_STREAM_TYPE_MPEG2_DVD = 3, /* MPEG-2 DVD-compatible stream */
+ V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4, /* MPEG-1 VCD-compatible stream */
+ V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */
+};
+#define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1)
+#define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2)
+#define V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_MPEG_BASE+3)
+#define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4)
+#define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5)
+#define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6)
+#define V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_MPEG_BASE+7)
+enum v4l2_mpeg_stream_vbi_fmt {
+ V4L2_MPEG_STREAM_VBI_FMT_NONE = 0, /* No VBI in the MPEG stream */
+ V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */
+};
+
+/* MPEG audio */
+#define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100)
+enum v4l2_mpeg_audio_sampling_freq {
+ V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0,
+ V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1,
+ V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2,
+};
+#define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101)
+enum v4l2_mpeg_audio_encoding {
+ V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0,
+ V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1,
+ V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2,
+ V4L2_MPEG_AUDIO_ENCODING_AAC = 3,
+ V4L2_MPEG_AUDIO_ENCODING_AC3 = 4,
+};
+#define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102)
+enum v4l2_mpeg_audio_l1_bitrate {
+ V4L2_MPEG_AUDIO_L1_BITRATE_32K = 0,
+ V4L2_MPEG_AUDIO_L1_BITRATE_64K = 1,
+ V4L2_MPEG_AUDIO_L1_BITRATE_96K = 2,
+ V4L2_MPEG_AUDIO_L1_BITRATE_128K = 3,
+ V4L2_MPEG_AUDIO_L1_BITRATE_160K = 4,
+ V4L2_MPEG_AUDIO_L1_BITRATE_192K = 5,
+ V4L2_MPEG_AUDIO_L1_BITRATE_224K = 6,
+ V4L2_MPEG_AUDIO_L1_BITRATE_256K = 7,
+ V4L2_MPEG_AUDIO_L1_BITRATE_288K = 8,
+ V4L2_MPEG_AUDIO_L1_BITRATE_320K = 9,
+ V4L2_MPEG_AUDIO_L1_BITRATE_352K = 10,
+ V4L2_MPEG_AUDIO_L1_BITRATE_384K = 11,
+ V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12,
+ V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13,
+};
+#define V4L2_CID_MPEG_AUDIO_L2_BITRATE (V4L2_CID_MPEG_BASE+103)
+enum v4l2_mpeg_audio_l2_bitrate {
+ V4L2_MPEG_AUDIO_L2_BITRATE_32K = 0,
+ V4L2_MPEG_AUDIO_L2_BITRATE_48K = 1,
+ V4L2_MPEG_AUDIO_L2_BITRATE_56K = 2,
+ V4L2_MPEG_AUDIO_L2_BITRATE_64K = 3,
+ V4L2_MPEG_AUDIO_L2_BITRATE_80K = 4,
+ V4L2_MPEG_AUDIO_L2_BITRATE_96K = 5,
+ V4L2_MPEG_AUDIO_L2_BITRATE_112K = 6,
+ V4L2_MPEG_AUDIO_L2_BITRATE_128K = 7,
+ V4L2_MPEG_AUDIO_L2_BITRATE_160K = 8,
+ V4L2_MPEG_AUDIO_L2_BITRATE_192K = 9,
+ V4L2_MPEG_AUDIO_L2_BITRATE_224K = 10,
+ V4L2_MPEG_AUDIO_L2_BITRATE_256K = 11,
+ V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12,
+ V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13,
+};
+#define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104)
+enum v4l2_mpeg_audio_l3_bitrate {
+ V4L2_MPEG_AUDIO_L3_BITRATE_32K = 0,
+ V4L2_MPEG_AUDIO_L3_BITRATE_40K = 1,
+ V4L2_MPEG_AUDIO_L3_BITRATE_48K = 2,
+ V4L2_MPEG_AUDIO_L3_BITRATE_56K = 3,
+ V4L2_MPEG_AUDIO_L3_BITRATE_64K = 4,
+ V4L2_MPEG_AUDIO_L3_BITRATE_80K = 5,
+ V4L2_MPEG_AUDIO_L3_BITRATE_96K = 6,
+ V4L2_MPEG_AUDIO_L3_BITRATE_112K = 7,
+ V4L2_MPEG_AUDIO_L3_BITRATE_128K = 8,
+ V4L2_MPEG_AUDIO_L3_BITRATE_160K = 9,
+ V4L2_MPEG_AUDIO_L3_BITRATE_192K = 10,
+ V4L2_MPEG_AUDIO_L3_BITRATE_224K = 11,
+ V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12,
+ V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13,
+};
+#define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105)
+enum v4l2_mpeg_audio_mode {
+ V4L2_MPEG_AUDIO_MODE_STEREO = 0,
+ V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1,
+ V4L2_MPEG_AUDIO_MODE_DUAL = 2,
+ V4L2_MPEG_AUDIO_MODE_MONO = 3,
+};
+#define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106)
+enum v4l2_mpeg_audio_mode_extension {
+ V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4 = 0,
+ V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8 = 1,
+ V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2,
+ V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3,
+};
+#define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107)
+enum v4l2_mpeg_audio_emphasis {
+ V4L2_MPEG_AUDIO_EMPHASIS_NONE = 0,
+ V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1,
+ V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17 = 2,
+};
+#define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108)
+enum v4l2_mpeg_audio_crc {
+ V4L2_MPEG_AUDIO_CRC_NONE = 0,
+ V4L2_MPEG_AUDIO_CRC_CRC16 = 1,
+};
+#define V4L2_CID_MPEG_AUDIO_MUTE (V4L2_CID_MPEG_BASE+109)
+#define V4L2_CID_MPEG_AUDIO_AAC_BITRATE (V4L2_CID_MPEG_BASE+110)
+#define V4L2_CID_MPEG_AUDIO_AC3_BITRATE (V4L2_CID_MPEG_BASE+111)
+enum v4l2_mpeg_audio_ac3_bitrate {
+ V4L2_MPEG_AUDIO_AC3_BITRATE_32K = 0,
+ V4L2_MPEG_AUDIO_AC3_BITRATE_40K = 1,
+ V4L2_MPEG_AUDIO_AC3_BITRATE_48K = 2,
+ V4L2_MPEG_AUDIO_AC3_BITRATE_56K = 3,
+ V4L2_MPEG_AUDIO_AC3_BITRATE_64K = 4,
+ V4L2_MPEG_AUDIO_AC3_BITRATE_80K = 5,
+ V4L2_MPEG_AUDIO_AC3_BITRATE_96K = 6,
+ V4L2_MPEG_AUDIO_AC3_BITRATE_112K = 7,
+ V4L2_MPEG_AUDIO_AC3_BITRATE_128K = 8,
+ V4L2_MPEG_AUDIO_AC3_BITRATE_160K = 9,
+ V4L2_MPEG_AUDIO_AC3_BITRATE_192K = 10,
+ V4L2_MPEG_AUDIO_AC3_BITRATE_224K = 11,
+ V4L2_MPEG_AUDIO_AC3_BITRATE_256K = 12,
+ V4L2_MPEG_AUDIO_AC3_BITRATE_320K = 13,
+ V4L2_MPEG_AUDIO_AC3_BITRATE_384K = 14,
+ V4L2_MPEG_AUDIO_AC3_BITRATE_448K = 15,
+ V4L2_MPEG_AUDIO_AC3_BITRATE_512K = 16,
+ V4L2_MPEG_AUDIO_AC3_BITRATE_576K = 17,
+ V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18,
+};
+
+/* MPEG video */
+#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200)
+enum v4l2_mpeg_video_encoding {
+ V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0,
+ V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1,
+ V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC = 2,
+};
+#define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201)
+enum v4l2_mpeg_video_aspect {
+ V4L2_MPEG_VIDEO_ASPECT_1x1 = 0,
+ V4L2_MPEG_VIDEO_ASPECT_4x3 = 1,
+ V4L2_MPEG_VIDEO_ASPECT_16x9 = 2,
+ V4L2_MPEG_VIDEO_ASPECT_221x100 = 3,
+};
+#define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202)
+#define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203)
+#define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_MPEG_BASE+204)
+#define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205)
+#define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206)
+enum v4l2_mpeg_video_bitrate_mode {
+ V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0,
+ V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1,
+};
+#define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207)
+#define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208)
+#define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209)
+#define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210)
+#define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211)
+
+/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */
+#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0)
+enum v4l2_mpeg_cx2341x_video_spatial_filter_mode {
+ V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0,
+ V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO = 1,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+1)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+2)
+enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type {
+ V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF = 0,
+ V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
+ V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT = 2,
+ V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE = 3,
+ V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+3)
+enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type {
+ V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF = 0,
+ V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+4)
+enum v4l2_mpeg_cx2341x_video_temporal_filter_mode {
+ V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0,
+ V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO = 1,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+5)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+6)
+enum v4l2_mpeg_cx2341x_video_median_filter_type {
+ V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF = 0,
+ V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR = 1,
+ V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT = 2,
+ V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3,
+ V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG = 4,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+7)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10)
+#define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11)
+
+/* Camera class control IDs */
+#define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900)
+#define V4L2_CID_CAMERA_CLASS (V4L2_CTRL_CLASS_CAMERA | 1)
+
+#define V4L2_CID_EXPOSURE_AUTO (V4L2_CID_CAMERA_CLASS_BASE+1)
+enum v4l2_exposure_auto_type {
+ V4L2_EXPOSURE_AUTO = 0,
+ V4L2_EXPOSURE_MANUAL = 1,
+ V4L2_EXPOSURE_SHUTTER_PRIORITY = 2,
+ V4L2_EXPOSURE_APERTURE_PRIORITY = 3
+};
+#define V4L2_CID_EXPOSURE_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+2)
+#define V4L2_CID_EXPOSURE_AUTO_PRIORITY (V4L2_CID_CAMERA_CLASS_BASE+3)
+
+#define V4L2_CID_PAN_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+4)
+#define V4L2_CID_TILT_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+5)
+#define V4L2_CID_PAN_RESET (V4L2_CID_CAMERA_CLASS_BASE+6)
+#define V4L2_CID_TILT_RESET (V4L2_CID_CAMERA_CLASS_BASE+7)
+
+#define V4L2_CID_PAN_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+8)
+#define V4L2_CID_TILT_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+9)
+
+#define V4L2_CID_FOCUS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+10)
+#define V4L2_CID_FOCUS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+11)
+#define V4L2_CID_FOCUS_AUTO (V4L2_CID_CAMERA_CLASS_BASE+12)
+
+#define V4L2_CID_ZOOM_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+13)
+#define V4L2_CID_ZOOM_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+14)
+#define V4L2_CID_ZOOM_CONTINUOUS (V4L2_CID_CAMERA_CLASS_BASE+15)
+
+#define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE+16)
+
+/*
+ * T U N I N G
+ */
+struct v4l2_tuner {
+ __u32 index;
+ __u8 name[32];
+ enum v4l2_tuner_type type;
+ __u32 capability;
+ __u32 rangelow;
+ __u32 rangehigh;
+ __u32 rxsubchans;
+ __u32 audmode;
+ __s32 signal;
+ __s32 afc;
+ __u32 reserved[4];
+};
+
+struct v4l2_modulator {
+ __u32 index;
+ __u8 name[32];
+ __u32 capability;
+ __u32 rangelow;
+ __u32 rangehigh;
+ __u32 txsubchans;
+ __u32 reserved[4];
+};
+
+/* Flags for the 'capability' field */
+#define V4L2_TUNER_CAP_LOW 0x0001
+#define V4L2_TUNER_CAP_NORM 0x0002
+#define V4L2_TUNER_CAP_STEREO 0x0010
+#define V4L2_TUNER_CAP_LANG2 0x0020
+#define V4L2_TUNER_CAP_SAP 0x0020
+#define V4L2_TUNER_CAP_LANG1 0x0040
+
+/* Flags for the 'rxsubchans' field */
+#define V4L2_TUNER_SUB_MONO 0x0001
+#define V4L2_TUNER_SUB_STEREO 0x0002
+#define V4L2_TUNER_SUB_LANG2 0x0004
+#define V4L2_TUNER_SUB_SAP 0x0004
+#define V4L2_TUNER_SUB_LANG1 0x0008
+
+/* Values for the 'audmode' field */
+#define V4L2_TUNER_MODE_MONO 0x0000
+#define V4L2_TUNER_MODE_STEREO 0x0001
+#define V4L2_TUNER_MODE_LANG2 0x0002
+#define V4L2_TUNER_MODE_SAP 0x0002
+#define V4L2_TUNER_MODE_LANG1 0x0003
+#define V4L2_TUNER_MODE_LANG1_LANG2 0x0004
+
+struct v4l2_frequency {
+ __u32 tuner;
+ enum v4l2_tuner_type type;
+ __u32 frequency;
+ __u32 reserved[8];
+};
+
+struct v4l2_hw_freq_seek {
+ __u32 tuner;
+ enum v4l2_tuner_type type;
+ __u32 seek_upward;
+ __u32 wrap_around;
+ __u32 reserved[8];
+};
+
+/*
+ * A U D I O
+ */
+struct v4l2_audio {
+ __u32 index;
+ __u8 name[32];
+ __u32 capability;
+ __u32 mode;
+ __u32 reserved[2];
+};
+
+/* Flags for the 'capability' field */
+#define V4L2_AUDCAP_STEREO 0x00001
+#define V4L2_AUDCAP_AVL 0x00002
+
+/* Flags for the 'mode' field */
+#define V4L2_AUDMODE_AVL 0x00001
+
+struct v4l2_audioout {
+ __u32 index;
+ __u8 name[32];
+ __u32 capability;
+ __u32 mode;
+ __u32 reserved[2];
+};
+
+/*
+ * M P E G S E R V I C E S
+ *
+ * NOTE: EXPERIMENTAL API
+ */
+#if 1
+#define V4L2_ENC_IDX_FRAME_I (0)
+#define V4L2_ENC_IDX_FRAME_P (1)
+#define V4L2_ENC_IDX_FRAME_B (2)
+#define V4L2_ENC_IDX_FRAME_MASK (0xf)
+
+struct v4l2_enc_idx_entry {
+ __u64 offset;
+ __u64 pts;
+ __u32 length;
+ __u32 flags;
+ __u32 reserved[2];
+};
+
+#define V4L2_ENC_IDX_ENTRIES (64)
+struct v4l2_enc_idx {
+ __u32 entries;
+ __u32 entries_cap;
+ __u32 reserved[4];
+ struct v4l2_enc_idx_entry entry[V4L2_ENC_IDX_ENTRIES];
+};
+
+
+#define V4L2_ENC_CMD_START (0)
+#define V4L2_ENC_CMD_STOP (1)
+#define V4L2_ENC_CMD_PAUSE (2)
+#define V4L2_ENC_CMD_RESUME (3)
+
+/* Flags for V4L2_ENC_CMD_STOP */
+#define V4L2_ENC_CMD_STOP_AT_GOP_END (1 << 0)
+
+struct v4l2_encoder_cmd {
+ __u32 cmd;
+ __u32 flags;
+ union {
+ struct {
+ __u32 data[8];
+ } raw;
+ };
+};
+
+#endif
+
+
+/*
+ * D A T A S E R V I C E S ( V B I )
+ *
+ * Data services API by Michael Schimek
+ */
+
+/* Raw VBI */
+struct v4l2_vbi_format {
+ __u32 sampling_rate; /* in 1 Hz */
+ __u32 offset;
+ __u32 samples_per_line;
+ __u32 sample_format; /* V4L2_PIX_FMT_* */
+ __s32 start[2];
+ __u32 count[2];
+ __u32 flags; /* V4L2_VBI_* */
+ __u32 reserved[2]; /* must be zero */
+};
+
+/* VBI flags */
+#define V4L2_VBI_UNSYNC (1 << 0)
+#define V4L2_VBI_INTERLACED (1 << 1)
+
+/* Sliced VBI
+ *
+ * This implements is a proposal V4L2 API to allow SLICED VBI
+ * required for some hardware encoders. It should change without
+ * notice in the definitive implementation.
+ */
+
+struct v4l2_sliced_vbi_format {
+ __u16 service_set;
+ /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
+ service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
+ (equals frame lines 313-336 for 625 line video
+ standards, 263-286 for 525 line standards) */
+ __u16 service_lines[2][24];
+ __u32 io_size;
+ __u32 reserved[2]; /* must be zero */
+};
+
+/* Teletext World System Teletext
+ (WST), defined on ITU-R BT.653-2 */
+#define V4L2_SLICED_TELETEXT_B (0x0001)
+/* Video Program System, defined on ETS 300 231*/
+#define V4L2_SLICED_VPS (0x0400)
+/* Closed Caption, defined on EIA-608 */
+#define V4L2_SLICED_CAPTION_525 (0x1000)
+/* Wide Screen System, defined on ITU-R BT1119.1 */
+#define V4L2_SLICED_WSS_625 (0x4000)
+
+#define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525)
+#define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625)
+
+struct v4l2_sliced_vbi_cap {
+ __u16 service_set;
+ /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
+ service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
+ (equals frame lines 313-336 for 625 line video
+ standards, 263-286 for 525 line standards) */
+ __u16 service_lines[2][24];
+ enum v4l2_buf_type type;
+ __u32 reserved[3]; /* must be 0 */
+};
+
+struct v4l2_sliced_vbi_data {
+ __u32 id;
+ __u32 field; /* 0: first field, 1: second field */
+ __u32 line; /* 1-23 */
+ __u32 reserved; /* must be 0 */
+ __u8 data[48];
+};
+
+/*
+ * Sliced VBI data inserted into MPEG Streams
+ */
+
+/*
+ * V4L2_MPEG_STREAM_VBI_FMT_IVTV:
+ *
+ * Structure of payload contained in an MPEG 2 Private Stream 1 PES Packet in an
+ * MPEG-2 Program Pack that contains V4L2_MPEG_STREAM_VBI_FMT_IVTV Sliced VBI
+ * data
+ *
+ * Note, the MPEG-2 Program Pack and Private Stream 1 PES packet header
+ * definitions are not included here. See the MPEG-2 specifications for details
+ * on these headers.
+ */
+
+/* Line type IDs */
+#define V4L2_MPEG_VBI_IVTV_TELETEXT_B (1)
+#define V4L2_MPEG_VBI_IVTV_CAPTION_525 (4)
+#define V4L2_MPEG_VBI_IVTV_WSS_625 (5)
+#define V4L2_MPEG_VBI_IVTV_VPS (7)
+
+struct v4l2_mpeg_vbi_itv0_line {
+ __u8 id; /* One of V4L2_MPEG_VBI_IVTV_* above */
+ __u8 data[42]; /* Sliced VBI data for the line */
+} __attribute__ ((packed));
+
+struct v4l2_mpeg_vbi_itv0 {
+ __le32 linemask[2]; /* Bitmasks of VBI service lines present */
+ struct v4l2_mpeg_vbi_itv0_line line[35];
+} __attribute__ ((packed));
+
+struct v4l2_mpeg_vbi_ITV0 {
+ struct v4l2_mpeg_vbi_itv0_line line[36];
+} __attribute__ ((packed));
+
+#define V4L2_MPEG_VBI_IVTV_MAGIC0 "itv0"
+#define V4L2_MPEG_VBI_IVTV_MAGIC1 "ITV0"
+
+struct v4l2_mpeg_vbi_fmt_ivtv {
+ __u8 magic[4];
+ union {
+ struct v4l2_mpeg_vbi_itv0 itv0;
+ struct v4l2_mpeg_vbi_ITV0 ITV0;
+ };
+} __attribute__ ((packed));
+
+/*
+ * A G G R E G A T E S T R U C T U R E S
+ */
+
+/* Stream data format
+ */
+struct v4l2_format {
+ enum v4l2_buf_type type;
+ union {
+ struct v4l2_pix_format pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */
+ struct v4l2_window win; /* V4L2_BUF_TYPE_VIDEO_OVERLAY */
+ struct v4l2_vbi_format vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */
+ struct v4l2_sliced_vbi_format sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */
+ __u8 raw_data[200]; /* user-defined */
+ } fmt;
+};
+
+
+/* Stream type-dependent parameters
+ */
+struct v4l2_streamparm {
+ enum v4l2_buf_type type;
+ union {
+ struct v4l2_captureparm capture;
+ struct v4l2_outputparm output;
+ __u8 raw_data[200]; /* user-defined */
+ } parm;
+};
+
+/*
+ * A D V A N C E D D E B U G G I N G
+ *
+ * NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS!
+ * FOR DEBUGGING, TESTING AND INTERNAL USE ONLY!
+ */
+
+/* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */
+
+#define V4L2_CHIP_MATCH_HOST 0 /* Match against chip ID on host (0 for the host) */
+#define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver name */
+#define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */
+#define V4L2_CHIP_MATCH_AC97 3 /* Match against anciliary AC97 chip */
+
+struct v4l2_dbg_match {
+ __u32 type; /* Match type */
+ union { /* Match this chip, meaning determined by type */
+ __u32 addr;
+ char name[32];
+ };
+} __attribute__ ((packed));
+
+struct v4l2_dbg_register {
+ struct v4l2_dbg_match match;
+ __u32 size; /* register size in bytes */
+ __u64 reg;
+ __u64 val;
+} __attribute__ ((packed));
+
+/* VIDIOC_DBG_G_CHIP_IDENT */
+struct v4l2_dbg_chip_ident {
+ struct v4l2_dbg_match match;
+ __u32 ident; /* chip identifier as specified in <media/v4l2-chip-ident.h> */
+ __u32 revision; /* chip revision, chip specific */
+} __attribute__ ((packed));
+
+/*
+ * I O C T L C O D E S F O R V I D E O D E V I C E S
+ *
+ */
+#define VIDIOC_QUERYCAP _IOR('V', 0, struct v4l2_capability)
+#define VIDIOC_RESERVED _IO('V', 1)
+#define VIDIOC_ENUM_FMT _IOWR('V', 2, struct v4l2_fmtdesc)
+#define VIDIOC_G_FMT _IOWR('V', 4, struct v4l2_format)
+#define VIDIOC_S_FMT _IOWR('V', 5, struct v4l2_format)
+#define VIDIOC_REQBUFS _IOWR('V', 8, struct v4l2_requestbuffers)
+#define VIDIOC_QUERYBUF _IOWR('V', 9, struct v4l2_buffer)
+#define VIDIOC_G_FBUF _IOR('V', 10, struct v4l2_framebuffer)
+#define VIDIOC_S_FBUF _IOW('V', 11, struct v4l2_framebuffer)
+#define VIDIOC_OVERLAY _IOW('V', 14, int)
+#define VIDIOC_QBUF _IOWR('V', 15, struct v4l2_buffer)
+#define VIDIOC_DQBUF _IOWR('V', 17, struct v4l2_buffer)
+#define VIDIOC_STREAMON _IOW('V', 18, int)
+#define VIDIOC_STREAMOFF _IOW('V', 19, int)
+#define VIDIOC_G_PARM _IOWR('V', 21, struct v4l2_streamparm)
+#define VIDIOC_S_PARM _IOWR('V', 22, struct v4l2_streamparm)
+#define VIDIOC_G_STD _IOR('V', 23, v4l2_std_id)
+#define VIDIOC_S_STD _IOW('V', 24, v4l2_std_id)
+#define VIDIOC_ENUMSTD _IOWR('V', 25, struct v4l2_standard)
+#define VIDIOC_ENUMINPUT _IOWR('V', 26, struct v4l2_input)
+#define VIDIOC_G_CTRL _IOWR('V', 27, struct v4l2_control)
+#define VIDIOC_S_CTRL _IOWR('V', 28, struct v4l2_control)
+#define VIDIOC_G_TUNER _IOWR('V', 29, struct v4l2_tuner)
+#define VIDIOC_S_TUNER _IOW('V', 30, struct v4l2_tuner)
+#define VIDIOC_G_AUDIO _IOR('V', 33, struct v4l2_audio)
+#define VIDIOC_S_AUDIO _IOW('V', 34, struct v4l2_audio)
+#define VIDIOC_QUERYCTRL _IOWR('V', 36, struct v4l2_queryctrl)
+#define VIDIOC_QUERYMENU _IOWR('V', 37, struct v4l2_querymenu)
+#define VIDIOC_G_INPUT _IOR('V', 38, int)
+#define VIDIOC_S_INPUT _IOWR('V', 39, int)
+#define VIDIOC_G_OUTPUT _IOR('V', 46, int)
+#define VIDIOC_S_OUTPUT _IOWR('V', 47, int)
+#define VIDIOC_ENUMOUTPUT _IOWR('V', 48, struct v4l2_output)
+#define VIDIOC_G_AUDOUT _IOR('V', 49, struct v4l2_audioout)
+#define VIDIOC_S_AUDOUT _IOW('V', 50, struct v4l2_audioout)
+#define VIDIOC_G_MODULATOR _IOWR('V', 54, struct v4l2_modulator)
+#define VIDIOC_S_MODULATOR _IOW('V', 55, struct v4l2_modulator)
+#define VIDIOC_G_FREQUENCY _IOWR('V', 56, struct v4l2_frequency)
+#define VIDIOC_S_FREQUENCY _IOW('V', 57, struct v4l2_frequency)
+#define VIDIOC_CROPCAP _IOWR('V', 58, struct v4l2_cropcap)
+#define VIDIOC_G_CROP _IOWR('V', 59, struct v4l2_crop)
+#define VIDIOC_S_CROP _IOW('V', 60, struct v4l2_crop)
+#define VIDIOC_G_JPEGCOMP _IOR('V', 61, struct v4l2_jpegcompression)
+#define VIDIOC_S_JPEGCOMP _IOW('V', 62, struct v4l2_jpegcompression)
+#define VIDIOC_QUERYSTD _IOR('V', 63, v4l2_std_id)
+#define VIDIOC_TRY_FMT _IOWR('V', 64, struct v4l2_format)
+#define VIDIOC_ENUMAUDIO _IOWR('V', 65, struct v4l2_audio)
+#define VIDIOC_ENUMAUDOUT _IOWR('V', 66, struct v4l2_audioout)
+#define VIDIOC_G_PRIORITY _IOR('V', 67, enum v4l2_priority)
+#define VIDIOC_S_PRIORITY _IOW('V', 68, enum v4l2_priority)
+#define VIDIOC_G_SLICED_VBI_CAP _IOWR('V', 69, struct v4l2_sliced_vbi_cap)
+#define VIDIOC_LOG_STATUS _IO('V', 70)
+#define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct v4l2_ext_controls)
+#define VIDIOC_S_EXT_CTRLS _IOWR('V', 72, struct v4l2_ext_controls)
+#define VIDIOC_TRY_EXT_CTRLS _IOWR('V', 73, struct v4l2_ext_controls)
+#if 1
+#define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum)
+#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum)
+#define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct v4l2_enc_idx)
+#define VIDIOC_ENCODER_CMD _IOWR('V', 77, struct v4l2_encoder_cmd)
+#define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct v4l2_encoder_cmd)
+#endif
+
+#if 1
+/* Experimental, meant for debugging, testing and internal use.
+ Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined.
+ You must be root to use these ioctls. Never use these in applications! */
+#define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_dbg_register)
+#define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register)
+
+/* Experimental, meant for debugging, testing and internal use.
+ Never use this ioctl in applications! */
+#define VIDIOC_DBG_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_dbg_chip_ident)
+#endif
+
+#define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek)
+/* Reminder: when adding new ioctls please add support for them to
+ drivers/media/video/v4l2-compat-ioctl32.c as well! */
+
+#ifdef __OLD_VIDIOC_
+/* for compatibility, will go away some day */
+#define VIDIOC_OVERLAY_OLD _IOWR('V', 14, int)
+#define VIDIOC_S_PARM_OLD _IOW('V', 22, struct v4l2_streamparm)
+#define VIDIOC_S_CTRL_OLD _IOW('V', 28, struct v4l2_control)
+#define VIDIOC_G_AUDIO_OLD _IOWR('V', 33, struct v4l2_audio)
+#define VIDIOC_G_AUDOUT_OLD _IOWR('V', 49, struct v4l2_audioout)
+#define VIDIOC_CROPCAP_OLD _IOR('V', 58, struct v4l2_cropcap)
+#endif
+
+#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
+
+#endif /* __LINUX_VIDEODEV2_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/videotext.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/videotext.h
new file mode 100644
index 0000000..6afaaf1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/videotext.h
@@ -0,0 +1,125 @@
+#ifndef _VTX_H
+#define _VTX_H
+
+/*
+ * Teletext (=Videotext) hardware decoders using interface /dev/vtx
+ * Do not confuse with drivers using /dev/vbi which decode videotext by software
+ *
+ * Videotext IOCTLs changed in order to use _IO() macros defined in <linux/ioctl.h>,
+ * unused tuner IOCTLs cleaned up by
+ * Michael Geng <linux@MichaelGeng.de>
+ *
+ * Copyright (c) 1994-97 Martin Buck <martin-2.buck@student.uni-ulm.de>
+ * Read COPYING for more information
+ *
+ */
+
+
+/*
+ * Videotext ioctls
+ */
+#define VTXIOCGETINFO _IOR (0x81, 1, vtx_info_t)
+#define VTXIOCCLRPAGE _IOW (0x81, 2, vtx_pagereq_t)
+#define VTXIOCCLRFOUND _IOW (0x81, 3, vtx_pagereq_t)
+#define VTXIOCPAGEREQ _IOW (0x81, 4, vtx_pagereq_t)
+#define VTXIOCGETSTAT _IOW (0x81, 5, vtx_pagereq_t)
+#define VTXIOCGETPAGE _IOW (0x81, 6, vtx_pagereq_t)
+#define VTXIOCSTOPDAU _IOW (0x81, 7, vtx_pagereq_t)
+#define VTXIOCPUTPAGE _IO (0x81, 8)
+#define VTXIOCSETDISP _IO (0x81, 9)
+#define VTXIOCPUTSTAT _IO (0x81, 10)
+#define VTXIOCCLRCACHE _IO (0x81, 11)
+#define VTXIOCSETVIRT _IOW (0x81, 12, long)
+
+/* for compatibility, will go away some day */
+#define VTXIOCGETINFO_OLD 0x7101 /* get version of driver & capabilities of vtx-chipset */
+#define VTXIOCCLRPAGE_OLD 0x7102 /* clear page-buffer */
+#define VTXIOCCLRFOUND_OLD 0x7103 /* clear bits indicating that page was found */
+#define VTXIOCPAGEREQ_OLD 0x7104 /* search for page */
+#define VTXIOCGETSTAT_OLD 0x7105 /* get status of page-buffer */
+#define VTXIOCGETPAGE_OLD 0x7106 /* get contents of page-buffer */
+#define VTXIOCSTOPDAU_OLD 0x7107 /* stop data acquisition unit */
+#define VTXIOCPUTPAGE_OLD 0x7108 /* display page on TV-screen */
+#define VTXIOCSETDISP_OLD 0x7109 /* set TV-mode */
+#define VTXIOCPUTSTAT_OLD 0x710a /* set status of TV-output-buffer */
+#define VTXIOCCLRCACHE_OLD 0x710b /* clear cache on VTX-interface (if avail.) */
+#define VTXIOCSETVIRT_OLD 0x710c /* turn on virtual mode (this disables TV-display) */
+
+/*
+ * Definitions for VTXIOCGETINFO
+ */
+
+#define SAA5243 0
+#define SAA5246 1
+#define SAA5249 2
+#define SAA5248 3
+#define XSTV5346 4
+
+typedef struct {
+ int version_major, version_minor; /* version of driver; if version_major changes, driver */
+ /* is not backward compatible!!! CHECK THIS!!! */
+ int numpages; /* number of page-buffers of vtx-chipset */
+ int cct_type; /* type of vtx-chipset (SAA5243, SAA5246, SAA5248 or
+ * SAA5249) */
+}
+vtx_info_t;
+
+
+/*
+ * Definitions for VTXIOC{CLRPAGE,CLRFOUND,PAGEREQ,GETSTAT,GETPAGE,STOPDAU,PUTPAGE,SETDISP}
+ */
+
+#define MIN_UNIT (1<<0)
+#define MIN_TEN (1<<1)
+#define HR_UNIT (1<<2)
+#define HR_TEN (1<<3)
+#define PG_UNIT (1<<4)
+#define PG_TEN (1<<5)
+#define PG_HUND (1<<6)
+#define PGMASK_MAX (1<<7)
+#define PGMASK_PAGE (PG_HUND | PG_TEN | PG_UNIT)
+#define PGMASK_HOUR (HR_TEN | HR_UNIT)
+#define PGMASK_MINUTE (MIN_TEN | MIN_UNIT)
+
+typedef struct
+{
+ int page; /* number of requested page (hexadecimal) */
+ int hour; /* requested hour (hexadecimal) */
+ int minute; /* requested minute (hexadecimal) */
+ int pagemask; /* mask defining which values of the above are set */
+ int pgbuf; /* buffer where page will be stored */
+ int start; /* start of requested part of page */
+ int end; /* end of requested part of page */
+ void *buffer; /* pointer to beginning of destination buffer */
+}
+vtx_pagereq_t;
+
+
+/*
+ * Definitions for VTXIOC{GETSTAT,PUTSTAT}
+ */
+
+#define VTX_PAGESIZE (40 * 24)
+#define VTX_VIRTUALSIZE (40 * 49)
+
+typedef struct
+{
+ int pagenum; /* number of page (hexadecimal) */
+ int hour; /* hour (hexadecimal) */
+ int minute; /* minute (hexadecimal) */
+ int charset; /* national charset */
+ unsigned delete : 1; /* delete page (C4) */
+ unsigned headline : 1; /* insert headline (C5) */
+ unsigned subtitle : 1; /* insert subtitle (C6) */
+ unsigned supp_header : 1; /* suppress header (C7) */
+ unsigned update : 1; /* update page (C8) */
+ unsigned inter_seq : 1; /* interrupted sequence (C9) */
+ unsigned dis_disp : 1; /* disable/suppress display (C10) */
+ unsigned serial : 1; /* serial mode (C11) */
+ unsigned notfound : 1; /* /FOUND */
+ unsigned pblf : 1; /* PBLF */
+ unsigned hamming : 1; /* hamming-error occurred */
+}
+vtx_pageinfo_t;
+
+#endif /* _VTX_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_9p.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_9p.h
new file mode 100644
index 0000000..b3c4a60
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_9p.h
@@ -0,0 +1,12 @@
+#ifndef _LINUX_VIRTIO_9P_H
+#define _LINUX_VIRTIO_9P_H
+/* This header is BSD licensed so anyone can use the definitions to implement
+ * compatible drivers/servers. */
+#include <linux/virtio_config.h>
+
+/* The ID for virtio console */
+#define VIRTIO_ID_9P 9
+/* Maximum number of virtio channels per partition (1 for now) */
+#define MAX_9P_CHAN 1
+
+#endif /* _LINUX_VIRTIO_9P_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_balloon.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_balloon.h
new file mode 100644
index 0000000..8726ff7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_balloon.h
@@ -0,0 +1,23 @@
+#ifndef _LINUX_VIRTIO_BALLOON_H
+#define _LINUX_VIRTIO_BALLOON_H
+/* This header is BSD licensed so anyone can use the definitions to implement
+ * compatible drivers/servers. */
+#include <linux/virtio_config.h>
+
+/* The ID for virtio_balloon */
+#define VIRTIO_ID_BALLOON 5
+
+/* The feature bitmap for virtio balloon */
+#define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */
+
+/* Size of a PFN in the balloon interface. */
+#define VIRTIO_BALLOON_PFN_SHIFT 12
+
+struct virtio_balloon_config
+{
+ /* Number of pages host wants Guest to give up. */
+ __le32 num_pages;
+ /* Number of pages we've actually got in balloon. */
+ __le32 actual;
+};
+#endif /* _LINUX_VIRTIO_BALLOON_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_blk.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_blk.h
new file mode 100644
index 0000000..94c56d2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_blk.h
@@ -0,0 +1,62 @@
+#ifndef _LINUX_VIRTIO_BLK_H
+#define _LINUX_VIRTIO_BLK_H
+/* This header is BSD licensed so anyone can use the definitions to implement
+ * compatible drivers/servers. */
+#include <linux/types.h>
+#include <linux/virtio_config.h>
+
+/* The ID for virtio_block */
+#define VIRTIO_ID_BLOCK 2
+
+/* Feature bits */
+#define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */
+#define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */
+#define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */
+#define VIRTIO_BLK_F_GEOMETRY 4 /* Legacy geometry available */
+#define VIRTIO_BLK_F_RO 5 /* Disk is read-only */
+#define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/
+
+struct virtio_blk_config
+{
+ /* The capacity (in 512-byte sectors). */
+ __u64 capacity;
+ /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */
+ __u32 size_max;
+ /* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */
+ __u32 seg_max;
+ /* geometry the device (if VIRTIO_BLK_F_GEOMETRY) */
+ struct virtio_blk_geometry {
+ __u16 cylinders;
+ __u8 heads;
+ __u8 sectors;
+ } geometry;
+ /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */
+ __u32 blk_size;
+} __attribute__((packed));
+
+/* These two define direction. */
+#define VIRTIO_BLK_T_IN 0
+#define VIRTIO_BLK_T_OUT 1
+
+/* This bit says it's a scsi command, not an actual read or write. */
+#define VIRTIO_BLK_T_SCSI_CMD 2
+
+/* Barrier before this op. */
+#define VIRTIO_BLK_T_BARRIER 0x80000000
+
+/* This is the first element of the read scatter-gather list. */
+struct virtio_blk_outhdr
+{
+ /* VIRTIO_BLK_T* */
+ __u32 type;
+ /* io priority. */
+ __u32 ioprio;
+ /* Sector (ie. 512 byte offset) */
+ __u64 sector;
+};
+
+/* And this is the final byte of the write scatter-gather list. */
+#define VIRTIO_BLK_S_OK 0
+#define VIRTIO_BLK_S_IOERR 1
+#define VIRTIO_BLK_S_UNSUPP 2
+#endif /* _LINUX_VIRTIO_BLK_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_config.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_config.h
new file mode 100644
index 0000000..26f45f1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_config.h
@@ -0,0 +1,31 @@
+#ifndef _LINUX_VIRTIO_CONFIG_H
+#define _LINUX_VIRTIO_CONFIG_H
+/* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so
+ * anyone can use the definitions to implement compatible drivers/servers. */
+
+/* Virtio devices use a standardized configuration space to define their
+ * features and pass configuration information, but each implementation can
+ * store and access that space differently. */
+#include <linux/types.h>
+
+/* Status byte for guest to report progress, and synchronize features. */
+/* We have seen device and processed generic fields (VIRTIO_CONFIG_F_VIRTIO) */
+#define VIRTIO_CONFIG_S_ACKNOWLEDGE 1
+/* We have found a driver for the device. */
+#define VIRTIO_CONFIG_S_DRIVER 2
+/* Driver has used its parts of the config, and is happy */
+#define VIRTIO_CONFIG_S_DRIVER_OK 4
+/* We've given up on this device. */
+#define VIRTIO_CONFIG_S_FAILED 0x80
+
+/* Some virtio feature bits (currently bits 28 through 31) are reserved for the
+ * transport being used (eg. virtio_ring), the rest are per-device feature
+ * bits. */
+#define VIRTIO_TRANSPORT_F_START 28
+#define VIRTIO_TRANSPORT_F_END 32
+
+/* Do we get callbacks when the ring is completely used, even if we've
+ * suppressed them? */
+#define VIRTIO_F_NOTIFY_ON_EMPTY 24
+
+#endif /* _LINUX_VIRTIO_CONFIG_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_console.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_console.h
new file mode 100644
index 0000000..06d638d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_console.h
@@ -0,0 +1,23 @@
+#ifndef _LINUX_VIRTIO_CONSOLE_H
+#define _LINUX_VIRTIO_CONSOLE_H
+#include <linux/types.h>
+#include <linux/virtio_config.h>
+/* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so
+ * anyone can use the definitions to implement compatible drivers/servers. */
+
+/* The ID for virtio console */
+#define VIRTIO_ID_CONSOLE 3
+
+/* Feature bits */
+#define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */
+
+struct virtio_console_config {
+ /* colums of the screens */
+ __u16 cols;
+ /* rows of the screens */
+ __u16 rows;
+} __attribute__((packed));
+
+
+
+#endif /* _LINUX_VIRTIO_CONSOLE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_net.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_net.h
new file mode 100644
index 0000000..cec79ad
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_net.h
@@ -0,0 +1,129 @@
+#ifndef _LINUX_VIRTIO_NET_H
+#define _LINUX_VIRTIO_NET_H
+/* This header is BSD licensed so anyone can use the definitions to implement
+ * compatible drivers/servers. */
+#include <linux/types.h>
+#include <linux/virtio_config.h>
+#include <linux/if_ether.h>
+
+/* The ID for virtio_net */
+#define VIRTIO_ID_NET 1
+
+/* The feature bitmap for virtio net */
+#define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */
+#define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */
+#define VIRTIO_NET_F_MAC 5 /* Host has given MAC address. */
+#define VIRTIO_NET_F_GSO 6 /* Host handles pkts w/ any GSO type */
+#define VIRTIO_NET_F_GUEST_TSO4 7 /* Guest can handle TSOv4 in. */
+#define VIRTIO_NET_F_GUEST_TSO6 8 /* Guest can handle TSOv6 in. */
+#define VIRTIO_NET_F_GUEST_ECN 9 /* Guest can handle TSO[6] w/ ECN in. */
+#define VIRTIO_NET_F_GUEST_UFO 10 /* Guest can handle UFO in. */
+#define VIRTIO_NET_F_HOST_TSO4 11 /* Host can handle TSOv4 in. */
+#define VIRTIO_NET_F_HOST_TSO6 12 /* Host can handle TSOv6 in. */
+#define VIRTIO_NET_F_HOST_ECN 13 /* Host can handle TSO[6] w/ ECN in. */
+#define VIRTIO_NET_F_HOST_UFO 14 /* Host can handle UFO in. */
+#define VIRTIO_NET_F_MRG_RXBUF 15 /* Host can merge receive buffers. */
+#define VIRTIO_NET_F_STATUS 16 /* virtio_net_config.status available */
+#define VIRTIO_NET_F_CTRL_VQ 17 /* Control channel available */
+#define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support */
+#define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */
+
+#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */
+
+struct virtio_net_config
+{
+ /* The config defining mac address (if VIRTIO_NET_F_MAC) */
+ __u8 mac[6];
+ /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */
+ __u16 status;
+} __attribute__((packed));
+
+/* This is the first element of the scatter-gather list. If you don't
+ * specify GSO or CSUM features, you can simply ignore the header. */
+struct virtio_net_hdr
+{
+#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset
+ __u8 flags;
+#define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame
+#define VIRTIO_NET_HDR_GSO_TCPV4 1 // GSO frame, IPv4 TCP (TSO)
+#define VIRTIO_NET_HDR_GSO_UDP 3 // GSO frame, IPv4 UDP (UFO)
+#define VIRTIO_NET_HDR_GSO_TCPV6 4 // GSO frame, IPv6 TCP
+#define VIRTIO_NET_HDR_GSO_ECN 0x80 // TCP has ECN set
+ __u8 gso_type;
+ __u16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */
+ __u16 gso_size; /* Bytes to append to hdr_len per frame */
+ __u16 csum_start; /* Position to start checksumming from */
+ __u16 csum_offset; /* Offset after that to place checksum */
+};
+
+/* This is the version of the header to use when the MRG_RXBUF
+ * feature has been negotiated. */
+struct virtio_net_hdr_mrg_rxbuf {
+ struct virtio_net_hdr hdr;
+ __u16 num_buffers; /* Number of merged rx buffers */
+};
+
+/*
+ * Control virtqueue data structures
+ *
+ * The control virtqueue expects a header in the first sg entry
+ * and an ack/status response in the last entry. Data for the
+ * command goes in between.
+ */
+struct virtio_net_ctrl_hdr {
+ __u8 class;
+ __u8 cmd;
+} __attribute__((packed));
+
+typedef __u8 virtio_net_ctrl_ack;
+
+#define VIRTIO_NET_OK 0
+#define VIRTIO_NET_ERR 1
+
+/*
+ * Control the RX mode, ie. promisucous and allmulti. PROMISC and
+ * ALLMULTI commands require an "out" sg entry containing a 1 byte
+ * state value, zero = disable, non-zero = enable. These commands
+ * are supported with the VIRTIO_NET_F_CTRL_RX feature.
+ */
+#define VIRTIO_NET_CTRL_RX 0
+ #define VIRTIO_NET_CTRL_RX_PROMISC 0
+ #define VIRTIO_NET_CTRL_RX_ALLMULTI 1
+
+/*
+ * Control the MAC filter table.
+ *
+ * The MAC filter table is managed by the hypervisor, the guest should
+ * assume the size is infinite. Filtering should be considered
+ * non-perfect, ie. based on hypervisor resources, the guest may
+ * received packets from sources not specified in the filter list.
+ *
+ * In addition to the class/cmd header, the TABLE_SET command requires
+ * two out scatterlists. Each contains a 4 byte count of entries followed
+ * by a concatenated byte stream of the ETH_ALEN MAC addresses. The
+ * first sg list contains unicast addresses, the second is for multicast.
+ * This functionality is present if the VIRTIO_NET_F_CTRL_RX feature
+ * is available.
+ */
+struct virtio_net_ctrl_mac {
+ __u32 entries;
+ __u8 macs[][ETH_ALEN];
+} __attribute__((packed));
+
+#define VIRTIO_NET_CTRL_MAC 1
+ #define VIRTIO_NET_CTRL_MAC_TABLE_SET 0
+
+/*
+ * Control VLAN filtering
+ *
+ * The VLAN filter table is controlled via a simple ADD/DEL interface.
+ * VLAN IDs not added may be filterd by the hypervisor. Del is the
+ * opposite of add. Both commands expect an out entry containing a 2
+ * byte VLAN ID. VLAN filterting is available with the
+ * VIRTIO_NET_F_CTRL_VLAN feature bit.
+ */
+#define VIRTIO_NET_CTRL_VLAN 2
+ #define VIRTIO_NET_CTRL_VLAN_ADD 0
+ #define VIRTIO_NET_CTRL_VLAN_DEL 1
+
+#endif /* _LINUX_VIRTIO_NET_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_pci.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_pci.h
new file mode 100644
index 0000000..cd0fd5d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_pci.h
@@ -0,0 +1,64 @@
+/*
+ * Virtio PCI driver
+ *
+ * This module allows virtio devices to be used over a virtual PCI device.
+ * This can be used with QEMU based VMMs like KVM or Xen.
+ *
+ * Copyright IBM Corp. 2007
+ *
+ * Authors:
+ * Anthony Liguori <aliguori@us.ibm.com>
+ *
+ * This header is BSD licensed so anyone can use the definitions to implement
+ * compatible drivers/servers.
+ */
+
+#ifndef _LINUX_VIRTIO_PCI_H
+#define _LINUX_VIRTIO_PCI_H
+
+#include <linux/virtio_config.h>
+
+/* A 32-bit r/o bitmask of the features supported by the host */
+#define VIRTIO_PCI_HOST_FEATURES 0
+
+/* A 32-bit r/w bitmask of features activated by the guest */
+#define VIRTIO_PCI_GUEST_FEATURES 4
+
+/* A 32-bit r/w PFN for the currently selected queue */
+#define VIRTIO_PCI_QUEUE_PFN 8
+
+/* A 16-bit r/o queue size for the currently selected queue */
+#define VIRTIO_PCI_QUEUE_NUM 12
+
+/* A 16-bit r/w queue selector */
+#define VIRTIO_PCI_QUEUE_SEL 14
+
+/* A 16-bit r/w queue notifier */
+#define VIRTIO_PCI_QUEUE_NOTIFY 16
+
+/* An 8-bit device status register. */
+#define VIRTIO_PCI_STATUS 18
+
+/* An 8-bit r/o interrupt status register. Reading the value will return the
+ * current contents of the ISR and will also clear it. This is effectively
+ * a read-and-acknowledge. */
+#define VIRTIO_PCI_ISR 19
+
+/* The bit of the ISR which indicates a device configuration change. */
+#define VIRTIO_PCI_ISR_CONFIG 0x2
+
+/* The remaining space is defined by each driver as the per-driver
+ * configuration space */
+#define VIRTIO_PCI_CONFIG 20
+
+/* Virtio ABI version, this must match exactly */
+#define VIRTIO_PCI_ABI_VERSION 0
+
+/* How many bits to shift physical queue address written to QUEUE_PFN.
+ * 12 is historical, and due to x86 page size. */
+#define VIRTIO_PCI_QUEUE_ADDR_SHIFT 12
+
+/* The alignment to use between consumer and producer parts of vring.
+ * x86 pagesize again. */
+#define VIRTIO_PCI_VRING_ALIGN 4096
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_ring.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_ring.h
new file mode 100644
index 0000000..6bb00c6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_ring.h
@@ -0,0 +1,112 @@
+#ifndef _LINUX_VIRTIO_RING_H
+#define _LINUX_VIRTIO_RING_H
+/* An interface for efficient virtio implementation, currently for use by KVM
+ * and lguest, but hopefully others soon. Do NOT change this since it will
+ * break existing servers and clients.
+ *
+ * This header is BSD licensed so anyone can use the definitions to implement
+ * compatible drivers/servers.
+ *
+ * Copyright Rusty Russell IBM Corporation 2007. */
+#include <linux/types.h>
+
+/* This marks a buffer as continuing via the next field. */
+#define VRING_DESC_F_NEXT 1
+/* This marks a buffer as write-only (otherwise read-only). */
+#define VRING_DESC_F_WRITE 2
+
+/* The Host uses this in used->flags to advise the Guest: don't kick me when
+ * you add a buffer. It's unreliable, so it's simply an optimization. Guest
+ * will still kick if it's out of buffers. */
+#define VRING_USED_F_NO_NOTIFY 1
+/* The Guest uses this in avail->flags to advise the Host: don't interrupt me
+ * when you consume a buffer. It's unreliable, so it's simply an
+ * optimization. */
+#define VRING_AVAIL_F_NO_INTERRUPT 1
+
+/* Virtio ring descriptors: 16 bytes. These can chain together via "next". */
+struct vring_desc
+{
+ /* Address (guest-physical). */
+ __u64 addr;
+ /* Length. */
+ __u32 len;
+ /* The flags as indicated above. */
+ __u16 flags;
+ /* We chain unused descriptors via this, too */
+ __u16 next;
+};
+
+struct vring_avail
+{
+ __u16 flags;
+ __u16 idx;
+ __u16 ring[];
+};
+
+/* u32 is used here for ids for padding reasons. */
+struct vring_used_elem
+{
+ /* Index of start of used descriptor chain. */
+ __u32 id;
+ /* Total length of the descriptor chain which was used (written to) */
+ __u32 len;
+};
+
+struct vring_used
+{
+ __u16 flags;
+ __u16 idx;
+ struct vring_used_elem ring[];
+};
+
+struct vring {
+ unsigned int num;
+
+ struct vring_desc *desc;
+
+ struct vring_avail *avail;
+
+ struct vring_used *used;
+};
+
+/* The standard layout for the ring is a continuous chunk of memory which looks
+ * like this. We assume num is a power of 2.
+ *
+ * struct vring
+ * {
+ * // The actual descriptors (16 bytes each)
+ * struct vring_desc desc[num];
+ *
+ * // A ring of available descriptor heads with free-running index.
+ * __u16 avail_flags;
+ * __u16 avail_idx;
+ * __u16 available[num];
+ *
+ * // Padding to the next align boundary.
+ * char pad[];
+ *
+ * // A ring of used descriptor heads with free-running index.
+ * __u16 used_flags;
+ * __u16 used_idx;
+ * struct vring_used_elem used[num];
+ * };
+ */
+static __inline__ void vring_init(struct vring *vr, unsigned int num, void *p,
+ unsigned long align)
+{
+ vr->num = num;
+ vr->desc = p;
+ vr->avail = p + num*sizeof(struct vring_desc);
+ vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + align-1)
+ & ~(align - 1));
+}
+
+static __inline__ unsigned vring_size(unsigned int num, unsigned long align)
+{
+ return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (2 + num)
+ + align - 1) & ~(align - 1))
+ + sizeof(__u16) * 2 + sizeof(struct vring_used_elem) * num;
+}
+
+#endif /* _LINUX_VIRTIO_RING_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_rng.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_rng.h
new file mode 100644
index 0000000..1a85dab
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/virtio_rng.h
@@ -0,0 +1,10 @@
+#ifndef _LINUX_VIRTIO_RNG_H
+#define _LINUX_VIRTIO_RNG_H
+/* This header is BSD licensed so anyone can use the definitions to implement
+ * compatible drivers/servers. */
+#include <linux/virtio_config.h>
+
+/* The ID for virtio_rng */
+#define VIRTIO_ID_RNG 4
+
+#endif /* _LINUX_VIRTIO_RNG_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/vt.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/vt.h
new file mode 100644
index 0000000..bbf9f8e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/vt.h
@@ -0,0 +1,66 @@
+#ifndef _LINUX_VT_H
+#define _LINUX_VT_H
+
+
+/*
+ * These constants are also useful for user-level apps (e.g., VC
+ * resizing).
+ */
+#define MIN_NR_CONSOLES 1 /* must be at least 1 */
+#define MAX_NR_CONSOLES 63 /* serial lines start at 64 */
+#define MAX_NR_USER_CONSOLES 63 /* must be root to allocate above this */
+ /* Note: the ioctl VT_GETSTATE does not work for
+ consoles 16 and higher (since it returns a short) */
+
+/* 0x56 is 'V', to avoid collision with termios and kd */
+
+#define VT_OPENQRY 0x5600 /* find available vt */
+
+struct vt_mode {
+ char mode; /* vt mode */
+ char waitv; /* if set, hang on writes if not active */
+ short relsig; /* signal to raise on release req */
+ short acqsig; /* signal to raise on acquisition */
+ short frsig; /* unused (set to 0) */
+};
+#define VT_GETMODE 0x5601 /* get mode of active vt */
+#define VT_SETMODE 0x5602 /* set mode of active vt */
+#define VT_AUTO 0x00 /* auto vt switching */
+#define VT_PROCESS 0x01 /* process controls switching */
+#define VT_ACKACQ 0x02 /* acknowledge switch */
+
+struct vt_stat {
+ unsigned short v_active; /* active vt */
+ unsigned short v_signal; /* signal to send */
+ unsigned short v_state; /* vt bitmask */
+};
+#define VT_GETSTATE 0x5603 /* get global vt state info */
+#define VT_SENDSIG 0x5604 /* signal to send to bitmask of vts */
+
+#define VT_RELDISP 0x5605 /* release display */
+
+#define VT_ACTIVATE 0x5606 /* make vt active */
+#define VT_WAITACTIVE 0x5607 /* wait for vt active */
+#define VT_DISALLOCATE 0x5608 /* free memory associated to vt */
+
+struct vt_sizes {
+ unsigned short v_rows; /* number of rows */
+ unsigned short v_cols; /* number of columns */
+ unsigned short v_scrollsize; /* number of lines of scrollback */
+};
+#define VT_RESIZE 0x5609 /* set kernel's idea of screensize */
+
+struct vt_consize {
+ unsigned short v_rows; /* number of rows */
+ unsigned short v_cols; /* number of columns */
+ unsigned short v_vlin; /* number of pixel rows on screen */
+ unsigned short v_clin; /* number of pixel rows per character */
+ unsigned short v_vcol; /* number of pixel columns on screen */
+ unsigned short v_ccol; /* number of pixel columns per character */
+};
+#define VT_RESIZEX 0x560A /* set kernel's idea of screensize + more */
+#define VT_LOCKSWITCH 0x560B /* disallow vt switching */
+#define VT_UNLOCKSWITCH 0x560C /* allow vt switching */
+#define VT_GETHIFONTMASK 0x560D /* return hi font mask */
+
+#endif /* _LINUX_VT_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wait.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wait.h
new file mode 100644
index 0000000..03dbdc2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wait.h
@@ -0,0 +1,21 @@
+#ifndef _LINUX_WAIT_H
+#define _LINUX_WAIT_H
+
+#define WNOHANG 0x00000001
+#define WUNTRACED 0x00000002
+#define WSTOPPED WUNTRACED
+#define WEXITED 0x00000004
+#define WCONTINUED 0x00000008
+#define WNOWAIT 0x01000000 /* Don't reap, just poll status. */
+
+#define __WNOTHREAD 0x20000000 /* Don't wait on children of other threads in this group */
+#define __WALL 0x40000000 /* Wait on all children, regardless of type */
+#define __WCLONE 0x80000000 /* Wait only on non-SIGCHLD children */
+
+/* First argument to waitid: */
+#define P_ALL 0
+#define P_PID 1
+#define P_PGID 2
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wanrouter.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wanrouter.h
new file mode 100644
index 0000000..45615ab
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wanrouter.h
@@ -0,0 +1,452 @@
+/*****************************************************************************
+* wanrouter.h Definitions for the WAN Multiprotocol Router Module.
+* This module provides API and common services for WAN Link
+* Drivers and is completely hardware-independent.
+*
+* Author: Nenad Corbic <ncorbic@sangoma.com>
+* Gideon Hack
+* Additions: Arnaldo Melo
+*
+* Copyright: (c) 1995-2000 Sangoma Technologies Inc.
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version
+* 2 of the License, or (at your option) any later version.
+* ============================================================================
+* Jul 21, 2000 Nenad Corbic Added WAN_FT1_READY State
+* Feb 24, 2000 Nenad Corbic Added support for socket based x25api
+* Jan 28, 2000 Nenad Corbic Added support for the ASYNC protocol.
+* Oct 04, 1999 Nenad Corbic Updated for 2.1.0 release
+* Jun 02, 1999 Gideon Hack Added support for the S514 adapter.
+* May 23, 1999 Arnaldo Melo Added local_addr to wanif_conf_t
+* WAN_DISCONNECTING state added
+* Jul 20, 1998 David Fong Added Inverse ARP options to 'wanif_conf_t'
+* Jun 12, 1998 David Fong Added Cisco HDLC support.
+* Dec 16, 1997 Jaspreet Singh Moved 'enable_IPX' and 'network_number' to
+* 'wanif_conf_t'
+* Dec 05, 1997 Jaspreet Singh Added 'pap', 'chap' to 'wanif_conf_t'
+* Added 'authenticator' to 'wan_ppp_conf_t'
+* Nov 06, 1997 Jaspreet Singh Changed Router Driver version to 1.1 from 1.0
+* Oct 20, 1997 Jaspreet Singh Added 'cir','bc','be' and 'mc' to 'wanif_conf_t'
+* Added 'enable_IPX' and 'network_number' to
+* 'wan_device_t'. Also added defines for
+* UDP PACKET TYPE, Interrupt test, critical values
+* for RACE conditions.
+* Oct 05, 1997 Jaspreet Singh Added 'dlci_num' and 'dlci[100]' to
+* 'wan_fr_conf_t' to configure a list of dlci(s)
+* for a NODE
+* Jul 07, 1997 Jaspreet Singh Added 'ttl' to 'wandev_conf_t' & 'wan_device_t'
+* May 29, 1997 Jaspreet Singh Added 'tx_int_enabled' to 'wan_device_t'
+* May 21, 1997 Jaspreet Singh Added 'udp_port' to 'wan_device_t'
+* Apr 25, 1997 Farhan Thawar Added 'udp_port' to 'wandev_conf_t'
+* Jan 16, 1997 Gene Kozin router_devlist made public
+* Jan 02, 1997 Gene Kozin Initial version (based on wanpipe.h).
+*****************************************************************************/
+
+#ifndef _ROUTER_H
+#define _ROUTER_H
+
+#define ROUTER_NAME "wanrouter" /* in case we ever change it */
+#define ROUTER_VERSION 1 /* version number */
+#define ROUTER_RELEASE 1 /* release (minor version) number */
+#define ROUTER_IOCTL 'W' /* for IOCTL calls */
+#define ROUTER_MAGIC 0x524D4157L /* signature: 'WANR' reversed */
+
+/* IOCTL codes for /proc/router/<device> entries (up to 255) */
+enum router_ioctls
+{
+ ROUTER_SETUP = ROUTER_IOCTL<<8, /* configure device */
+ ROUTER_DOWN, /* shut down device */
+ ROUTER_STAT, /* get device status */
+ ROUTER_IFNEW, /* add interface */
+ ROUTER_IFDEL, /* delete interface */
+ ROUTER_IFSTAT, /* get interface status */
+ ROUTER_USER = (ROUTER_IOCTL<<8)+16, /* driver-specific calls */
+ ROUTER_USER_MAX = (ROUTER_IOCTL<<8)+31
+};
+
+/* identifiers for displaying proc file data for dual port adapters */
+#define PROC_DATA_PORT_0 0x8000 /* the data is for port 0 */
+#define PROC_DATA_PORT_1 0x8001 /* the data is for port 1 */
+
+/* NLPID for packet encapsulation (ISO/IEC TR 9577) */
+#define NLPID_IP 0xCC /* Internet Protocol Datagram */
+#define NLPID_SNAP 0x80 /* IEEE Subnetwork Access Protocol */
+#define NLPID_CLNP 0x81 /* ISO/IEC 8473 */
+#define NLPID_ESIS 0x82 /* ISO/IEC 9542 */
+#define NLPID_ISIS 0x83 /* ISO/IEC ISIS */
+#define NLPID_Q933 0x08 /* CCITT Q.933 */
+
+/* Miscellaneous */
+#define WAN_IFNAME_SZ 15 /* max length of the interface name */
+#define WAN_DRVNAME_SZ 15 /* max length of the link driver name */
+#define WAN_ADDRESS_SZ 31 /* max length of the WAN media address */
+#define USED_BY_FIELD 8 /* max length of the used by field */
+
+/* Defines for UDP PACKET TYPE */
+#define UDP_PTPIPE_TYPE 0x01
+#define UDP_FPIPE_TYPE 0x02
+#define UDP_CPIPE_TYPE 0x03
+#define UDP_DRVSTATS_TYPE 0x04
+#define UDP_INVALID_TYPE 0x05
+
+/* Command return code */
+#define CMD_OK 0 /* normal firmware return code */
+#define CMD_TIMEOUT 0xFF /* firmware command timed out */
+
+/* UDP Packet Management */
+#define UDP_PKT_FRM_STACK 0x00
+#define UDP_PKT_FRM_NETWORK 0x01
+
+/* Maximum interrupt test counter */
+#define MAX_INTR_TEST_COUNTER 100
+
+/* Critical Values for RACE conditions*/
+#define CRITICAL_IN_ISR 0xA1
+#define CRITICAL_INTR_HANDLED 0xB1
+
+/****** Data Types **********************************************************/
+
+/*----------------------------------------------------------------------------
+ * X.25-specific link-level configuration.
+ */
+typedef struct wan_x25_conf
+{
+ unsigned lo_pvc; /* lowest permanent circuit number */
+ unsigned hi_pvc; /* highest permanent circuit number */
+ unsigned lo_svc; /* lowest switched circuit number */
+ unsigned hi_svc; /* highest switched circuit number */
+ unsigned hdlc_window; /* HDLC window size (1..7) */
+ unsigned pkt_window; /* X.25 packet window size (1..7) */
+ unsigned t1; /* HDLC timer T1, sec (1..30) */
+ unsigned t2; /* HDLC timer T2, sec (0..29) */
+ unsigned t4; /* HDLC supervisory frame timer = T4 * T1 */
+ unsigned n2; /* HDLC retransmission limit (1..30) */
+ unsigned t10_t20; /* X.25 RESTART timeout, sec (1..255) */
+ unsigned t11_t21; /* X.25 CALL timeout, sec (1..255) */
+ unsigned t12_t22; /* X.25 RESET timeout, sec (1..255) */
+ unsigned t13_t23; /* X.25 CLEAR timeout, sec (1..255) */
+ unsigned t16_t26; /* X.25 INTERRUPT timeout, sec (1..255) */
+ unsigned t28; /* X.25 REGISTRATION timeout, sec (1..255) */
+ unsigned r10_r20; /* RESTART retransmission limit (0..250) */
+ unsigned r12_r22; /* RESET retransmission limit (0..250) */
+ unsigned r13_r23; /* CLEAR retransmission limit (0..250) */
+ unsigned ccitt_compat; /* compatibility mode: 1988/1984/1980 */
+ unsigned x25_conf_opt; /* User defined x25 config optoins */
+ unsigned char LAPB_hdlc_only; /* Run in HDLC only mode */
+ unsigned char logging; /* Control connection logging */
+ unsigned char oob_on_modem; /* Whether to send modem status to the user app */
+} wan_x25_conf_t;
+
+/*----------------------------------------------------------------------------
+ * Frame relay specific link-level configuration.
+ */
+typedef struct wan_fr_conf
+{
+ unsigned signalling; /* local in-channel signalling type */
+ unsigned t391; /* link integrity verification timer */
+ unsigned t392; /* polling verification timer */
+ unsigned n391; /* full status polling cycle counter */
+ unsigned n392; /* error threshold counter */
+ unsigned n393; /* monitored events counter */
+ unsigned dlci_num; /* number of DLCs (access node) */
+ unsigned dlci[100]; /* List of all DLCIs */
+} wan_fr_conf_t;
+
+/*----------------------------------------------------------------------------
+ * PPP-specific link-level configuration.
+ */
+typedef struct wan_ppp_conf
+{
+ unsigned restart_tmr; /* restart timer */
+ unsigned auth_rsrt_tmr; /* authentication timer */
+ unsigned auth_wait_tmr; /* authentication timer */
+ unsigned mdm_fail_tmr; /* modem failure timer */
+ unsigned dtr_drop_tmr; /* DTR drop timer */
+ unsigned connect_tmout; /* connection timeout */
+ unsigned conf_retry; /* max. retry */
+ unsigned term_retry; /* max. retry */
+ unsigned fail_retry; /* max. retry */
+ unsigned auth_retry; /* max. retry */
+ unsigned auth_options; /* authentication opt. */
+ unsigned ip_options; /* IP options */
+ char authenticator; /* AUTHENTICATOR or not */
+ char ip_mode; /* Static/Host/Peer */
+} wan_ppp_conf_t;
+
+/*----------------------------------------------------------------------------
+ * CHDLC-specific link-level configuration.
+ */
+typedef struct wan_chdlc_conf
+{
+ unsigned char ignore_dcd; /* Protocol options: */
+ unsigned char ignore_cts; /* Ignore these to determine */
+ unsigned char ignore_keepalive; /* link status (Yes or No) */
+ unsigned char hdlc_streaming; /* hdlc_streaming mode (Y/N) */
+ unsigned char receive_only; /* no transmit buffering (Y/N) */
+ unsigned keepalive_tx_tmr; /* transmit keepalive timer */
+ unsigned keepalive_rx_tmr; /* receive keepalive timer */
+ unsigned keepalive_err_margin; /* keepalive_error_tolerance */
+ unsigned slarp_timer; /* SLARP request timer */
+} wan_chdlc_conf_t;
+
+
+/*----------------------------------------------------------------------------
+ * WAN device configuration. Passed to ROUTER_SETUP IOCTL.
+ */
+typedef struct wandev_conf
+{
+ unsigned magic; /* magic number (for verification) */
+ unsigned config_id; /* configuration structure identifier */
+ /****** hardware configuration ******/
+ unsigned ioport; /* adapter I/O port base */
+ unsigned long maddr; /* dual-port memory address */
+ unsigned msize; /* dual-port memory size */
+ int irq; /* interrupt request level */
+ int dma; /* DMA request level */
+ char S514_CPU_no[1]; /* S514 PCI adapter CPU number ('A' or 'B') */
+ unsigned PCI_slot_no; /* S514 PCI adapter slot number */
+ char auto_pci_cfg; /* S515 PCI automatic slot detection */
+ char comm_port; /* Communication Port (PRI=0, SEC=1) */
+ unsigned bps; /* data transfer rate */
+ unsigned mtu; /* maximum transmit unit size */
+ unsigned udp_port; /* UDP port for management */
+ unsigned char ttl; /* Time To Live for UDP security */
+ unsigned char ft1; /* FT1 Configurator Option */
+ char interface; /* RS-232/V.35, etc. */
+ char clocking; /* external/internal */
+ char line_coding; /* NRZ/NRZI/FM0/FM1, etc. */
+ char station; /* DTE/DCE, primary/secondary, etc. */
+ char connection; /* permanent/switched/on-demand */
+ char read_mode; /* read mode: Polling or interrupt */
+ char receive_only; /* disable tx buffers */
+ char tty; /* Create a fake tty device */
+ unsigned tty_major; /* Major number for wanpipe tty device */
+ unsigned tty_minor; /* Minor number for wanpipe tty device */
+ unsigned tty_mode; /* TTY operation mode SYNC or ASYNC */
+ char backup; /* Backup Mode */
+ unsigned hw_opt[4]; /* other hardware options */
+ unsigned reserved[4];
+ /****** arbitrary data ***************/
+ unsigned data_size; /* data buffer size */
+ void* data; /* data buffer, e.g. firmware */
+ union /****** protocol-specific ************/
+ {
+ wan_x25_conf_t x25; /* X.25 configuration */
+ wan_ppp_conf_t ppp; /* PPP configuration */
+ wan_fr_conf_t fr; /* frame relay configuration */
+ wan_chdlc_conf_t chdlc; /* Cisco HDLC configuration */
+ } u;
+} wandev_conf_t;
+
+/* 'config_id' definitions */
+#define WANCONFIG_X25 101 /* X.25 link */
+#define WANCONFIG_FR 102 /* frame relay link */
+#define WANCONFIG_PPP 103 /* synchronous PPP link */
+#define WANCONFIG_CHDLC 104 /* Cisco HDLC Link */
+#define WANCONFIG_BSC 105 /* BiSync Streaming */
+#define WANCONFIG_HDLC 106 /* HDLC Support */
+#define WANCONFIG_MPPP 107 /* Multi Port PPP over RAW CHDLC */
+
+/*
+ * Configuration options defines.
+ */
+/* general options */
+#define WANOPT_OFF 0
+#define WANOPT_ON 1
+#define WANOPT_NO 0
+#define WANOPT_YES 1
+
+/* intercace options */
+#define WANOPT_RS232 0
+#define WANOPT_V35 1
+
+/* data encoding options */
+#define WANOPT_NRZ 0
+#define WANOPT_NRZI 1
+#define WANOPT_FM0 2
+#define WANOPT_FM1 3
+
+/* link type options */
+#define WANOPT_POINTTOPOINT 0 /* RTS always active */
+#define WANOPT_MULTIDROP 1 /* RTS is active when transmitting */
+
+/* clocking options */
+#define WANOPT_EXTERNAL 0
+#define WANOPT_INTERNAL 1
+
+/* station options */
+#define WANOPT_DTE 0
+#define WANOPT_DCE 1
+#define WANOPT_CPE 0
+#define WANOPT_NODE 1
+#define WANOPT_SECONDARY 0
+#define WANOPT_PRIMARY 1
+
+/* connection options */
+#define WANOPT_PERMANENT 0 /* DTR always active */
+#define WANOPT_SWITCHED 1 /* use DTR to setup link (dial-up) */
+#define WANOPT_ONDEMAND 2 /* activate DTR only before sending */
+
+/* frame relay in-channel signalling */
+#define WANOPT_FR_ANSI 1 /* ANSI T1.617 Annex D */
+#define WANOPT_FR_Q933 2 /* ITU Q.933A */
+#define WANOPT_FR_LMI 3 /* LMI */
+
+/* PPP IP Mode Options */
+#define WANOPT_PPP_STATIC 0
+#define WANOPT_PPP_HOST 1
+#define WANOPT_PPP_PEER 2
+
+/* ASY Mode Options */
+#define WANOPT_ONE 1
+#define WANOPT_TWO 2
+#define WANOPT_ONE_AND_HALF 3
+
+#define WANOPT_NONE 0
+#define WANOPT_ODD 1
+#define WANOPT_EVEN 2
+
+/* CHDLC Protocol Options */
+/* DF Commmented out for now.
+
+#define WANOPT_CHDLC_NO_DCD IGNORE_DCD_FOR_LINK_STAT
+#define WANOPT_CHDLC_NO_CTS IGNORE_CTS_FOR_LINK_STAT
+#define WANOPT_CHDLC_NO_KEEPALIVE IGNORE_KPALV_FOR_LINK_STAT
+*/
+
+/* Port options */
+#define WANOPT_PRI 0
+#define WANOPT_SEC 1
+/* read mode */
+#define WANOPT_INTR 0
+#define WANOPT_POLL 1
+
+
+#define WANOPT_TTY_SYNC 0
+#define WANOPT_TTY_ASYNC 1
+/*----------------------------------------------------------------------------
+ * WAN Link Status Info (for ROUTER_STAT IOCTL).
+ */
+typedef struct wandev_stat
+{
+ unsigned state; /* link state */
+ unsigned ndev; /* number of configured interfaces */
+
+ /* link/interface configuration */
+ unsigned connection; /* permanent/switched/on-demand */
+ unsigned media_type; /* Frame relay/PPP/X.25/SDLC, etc. */
+ unsigned mtu; /* max. transmit unit for this device */
+
+ /* physical level statistics */
+ unsigned modem_status; /* modem status */
+ unsigned rx_frames; /* received frames count */
+ unsigned rx_overruns; /* receiver overrun error count */
+ unsigned rx_crc_err; /* receive CRC error count */
+ unsigned rx_aborts; /* received aborted frames count */
+ unsigned rx_bad_length; /* unexpetedly long/short frames count */
+ unsigned rx_dropped; /* frames discarded at device level */
+ unsigned tx_frames; /* transmitted frames count */
+ unsigned tx_underruns; /* aborted transmissions (underruns) count */
+ unsigned tx_timeouts; /* transmission timeouts */
+ unsigned tx_rejects; /* other transmit errors */
+
+ /* media level statistics */
+ unsigned rx_bad_format; /* frames with invalid format */
+ unsigned rx_bad_addr; /* frames with invalid media address */
+ unsigned tx_retries; /* frames re-transmitted */
+ unsigned reserved[16]; /* reserved for future use */
+} wandev_stat_t;
+
+/* 'state' defines */
+enum wan_states
+{
+ WAN_UNCONFIGURED, /* link/channel is not configured */
+ WAN_DISCONNECTED, /* link/channel is disconnected */
+ WAN_CONNECTING, /* connection is in progress */
+ WAN_CONNECTED, /* link/channel is operational */
+ WAN_LIMIT, /* for verification only */
+ WAN_DUALPORT, /* for Dual Port cards */
+ WAN_DISCONNECTING,
+ WAN_FT1_READY /* FT1 Configurator Ready */
+};
+
+enum {
+ WAN_LOCAL_IP,
+ WAN_POINTOPOINT_IP,
+ WAN_NETMASK_IP,
+ WAN_BROADCAST_IP
+};
+
+/* 'modem_status' masks */
+#define WAN_MODEM_CTS 0x0001 /* CTS line active */
+#define WAN_MODEM_DCD 0x0002 /* DCD line active */
+#define WAN_MODEM_DTR 0x0010 /* DTR line active */
+#define WAN_MODEM_RTS 0x0020 /* RTS line active */
+
+/*----------------------------------------------------------------------------
+ * WAN interface (logical channel) configuration (for ROUTER_IFNEW IOCTL).
+ */
+typedef struct wanif_conf
+{
+ unsigned magic; /* magic number */
+ unsigned config_id; /* configuration identifier */
+ char name[WAN_IFNAME_SZ+1]; /* interface name, ASCIIZ */
+ char addr[WAN_ADDRESS_SZ+1]; /* media address, ASCIIZ */
+ char usedby[USED_BY_FIELD]; /* used by API or WANPIPE */
+ unsigned idle_timeout; /* sec, before disconnecting */
+ unsigned hold_timeout; /* sec, before re-connecting */
+ unsigned cir; /* Committed Information Rate fwd,bwd*/
+ unsigned bc; /* Committed Burst Size fwd, bwd */
+ unsigned be; /* Excess Burst Size fwd, bwd */
+ unsigned char enable_IPX; /* Enable or Disable IPX */
+ unsigned char inarp; /* Send Inverse ARP requests Y/N */
+ unsigned inarp_interval; /* sec, between InARP requests */
+ unsigned long network_number; /* Network Number for IPX */
+ char mc; /* Multicast on or off */
+ char local_addr[WAN_ADDRESS_SZ+1];/* local media address, ASCIIZ */
+ unsigned char port; /* board port */
+ unsigned char protocol; /* prococol used in this channel (TCPOX25 or X25) */
+ char pap; /* PAP enabled or disabled */
+ char chap; /* CHAP enabled or disabled */
+ unsigned char userid[511]; /* List of User Id */
+ unsigned char passwd[511]; /* List of passwords */
+ unsigned char sysname[31]; /* Name of the system */
+ unsigned char ignore_dcd; /* Protocol options: */
+ unsigned char ignore_cts; /* Ignore these to determine */
+ unsigned char ignore_keepalive; /* link status (Yes or No) */
+ unsigned char hdlc_streaming; /* Hdlc streaming mode (Y/N) */
+ unsigned keepalive_tx_tmr; /* transmit keepalive timer */
+ unsigned keepalive_rx_tmr; /* receive keepalive timer */
+ unsigned keepalive_err_margin; /* keepalive_error_tolerance */
+ unsigned slarp_timer; /* SLARP request timer */
+ unsigned char ttl; /* Time To Live for UDP security */
+ char interface; /* RS-232/V.35, etc. */
+ char clocking; /* external/internal */
+ unsigned bps; /* data transfer rate */
+ unsigned mtu; /* maximum transmit unit size */
+ unsigned char if_down; /* brind down interface when disconnected */
+ unsigned char gateway; /* Is this interface a gateway */
+ unsigned char true_if_encoding; /* Set the dev->type to true board protocol */
+
+ unsigned char asy_data_trans; /* async API options */
+ unsigned char rts_hs_for_receive; /* async Protocol options */
+ unsigned char xon_xoff_hs_for_receive;
+ unsigned char xon_xoff_hs_for_transmit;
+ unsigned char dcd_hs_for_transmit;
+ unsigned char cts_hs_for_transmit;
+ unsigned char async_mode;
+ unsigned tx_bits_per_char;
+ unsigned rx_bits_per_char;
+ unsigned stop_bits;
+ unsigned char parity;
+ unsigned break_timer;
+ unsigned inter_char_timer;
+ unsigned rx_complete_length;
+ unsigned xon_char;
+ unsigned xoff_char;
+ unsigned char receive_only; /* no transmit buffering (Y/N) */
+} wanif_conf_t;
+
+#endif /* _ROUTER_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/watchdog.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/watchdog.h
new file mode 100644
index 0000000..5bc0c62
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/watchdog.h
@@ -0,0 +1,55 @@
+/*
+ * Generic watchdog defines. Derived from..
+ *
+ * Berkshire PC Watchdog Defines
+ * by Ken Hollis <khollis@bitgate.com>
+ *
+ */
+
+#ifndef _LINUX_WATCHDOG_H
+#define _LINUX_WATCHDOG_H
+
+#include <linux/ioctl.h>
+#include <linux/types.h>
+
+#define WATCHDOG_IOCTL_BASE 'W'
+
+struct watchdog_info {
+ __u32 options; /* Options the card/driver supports */
+ __u32 firmware_version; /* Firmware version of the card */
+ __u8 identity[32]; /* Identity of the board */
+};
+
+#define WDIOC_GETSUPPORT _IOR(WATCHDOG_IOCTL_BASE, 0, struct watchdog_info)
+#define WDIOC_GETSTATUS _IOR(WATCHDOG_IOCTL_BASE, 1, int)
+#define WDIOC_GETBOOTSTATUS _IOR(WATCHDOG_IOCTL_BASE, 2, int)
+#define WDIOC_GETTEMP _IOR(WATCHDOG_IOCTL_BASE, 3, int)
+#define WDIOC_SETOPTIONS _IOR(WATCHDOG_IOCTL_BASE, 4, int)
+#define WDIOC_KEEPALIVE _IOR(WATCHDOG_IOCTL_BASE, 5, int)
+#define WDIOC_SETTIMEOUT _IOWR(WATCHDOG_IOCTL_BASE, 6, int)
+#define WDIOC_GETTIMEOUT _IOR(WATCHDOG_IOCTL_BASE, 7, int)
+#define WDIOC_SETPRETIMEOUT _IOWR(WATCHDOG_IOCTL_BASE, 8, int)
+#define WDIOC_GETPRETIMEOUT _IOR(WATCHDOG_IOCTL_BASE, 9, int)
+#define WDIOC_GETTIMELEFT _IOR(WATCHDOG_IOCTL_BASE, 10, int)
+
+#define WDIOF_UNKNOWN -1 /* Unknown flag error */
+#define WDIOS_UNKNOWN -1 /* Unknown status error */
+
+#define WDIOF_OVERHEAT 0x0001 /* Reset due to CPU overheat */
+#define WDIOF_FANFAULT 0x0002 /* Fan failed */
+#define WDIOF_EXTERN1 0x0004 /* External relay 1 */
+#define WDIOF_EXTERN2 0x0008 /* External relay 2 */
+#define WDIOF_POWERUNDER 0x0010 /* Power bad/power fault */
+#define WDIOF_CARDRESET 0x0020 /* Card previously reset the CPU */
+#define WDIOF_POWEROVER 0x0040 /* Power over voltage */
+#define WDIOF_SETTIMEOUT 0x0080 /* Set timeout (in seconds) */
+#define WDIOF_MAGICCLOSE 0x0100 /* Supports magic close char */
+#define WDIOF_PRETIMEOUT 0x0200 /* Pretimeout (in seconds), get/set */
+#define WDIOF_KEEPALIVEPING 0x8000 /* Keep alive ping reply */
+
+#define WDIOS_DISABLECARD 0x0001 /* Turn off the watchdog timer */
+#define WDIOS_ENABLECARD 0x0002 /* Turn on the watchdog timer */
+#define WDIOS_TEMPPANIC 0x0004 /* Kernel panic on temperature trip */
+
+
+#endif /* ifndef _LINUX_WATCHDOG_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wimax.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wimax.h
new file mode 100644
index 0000000..c89de7f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wimax.h
@@ -0,0 +1,234 @@
+/*
+ * Linux WiMax
+ * API for user space
+ *
+ *
+ * Copyright (C) 2007-2008 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Intel Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * Intel Corporation <linux-wimax@intel.com>
+ * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
+ * - Initial implementation
+ *
+ *
+ * This file declares the user/kernel protocol that is spoken over
+ * Generic Netlink, as well as any type declaration that is to be used
+ * by kernel and user space.
+ *
+ * It is intended for user space to clone it verbatim to use it as a
+ * primary reference for definitions.
+ *
+ * Stuff intended for kernel usage as well as full protocol and stack
+ * documentation is rooted in include/net/wimax.h.
+ */
+
+#ifndef __LINUX__WIMAX_H__
+#define __LINUX__WIMAX_H__
+
+#include <linux/types.h>
+
+enum {
+ /**
+ * Version of the interface (unsigned decimal, MMm, max 25.5)
+ * M - Major: change if removing or modifying an existing call.
+ * m - minor: change when adding a new call
+ */
+ WIMAX_GNL_VERSION = 00,
+ /* Generic NetLink attributes */
+ WIMAX_GNL_ATTR_INVALID = 0x00,
+ WIMAX_GNL_ATTR_MAX = 10,
+};
+
+
+/*
+ * Generic NetLink operations
+ *
+ * Most of these map to an API call; _OP_ stands for operation, _RP_
+ * for reply and _RE_ for report (aka: signal).
+ */
+enum {
+ WIMAX_GNL_OP_MSG_FROM_USER, /* User to kernel message */
+ WIMAX_GNL_OP_MSG_TO_USER, /* Kernel to user message */
+ WIMAX_GNL_OP_RFKILL, /* Run wimax_rfkill() */
+ WIMAX_GNL_OP_RESET, /* Run wimax_rfkill() */
+ WIMAX_GNL_RE_STATE_CHANGE, /* Report: status change */
+};
+
+
+/* Message from user / to user */
+enum {
+ WIMAX_GNL_MSG_IFIDX = 1,
+ WIMAX_GNL_MSG_PIPE_NAME,
+ WIMAX_GNL_MSG_DATA,
+};
+
+
+/*
+ * wimax_rfkill()
+ *
+ * The state of the radio (ON/OFF) is mapped to the rfkill subsystem's
+ * switch state (DISABLED/ENABLED).
+ */
+enum wimax_rf_state {
+ WIMAX_RF_OFF = 0, /* Radio is off, rfkill on/enabled */
+ WIMAX_RF_ON = 1, /* Radio is on, rfkill off/disabled */
+ WIMAX_RF_QUERY = 2,
+};
+
+/* Attributes */
+enum {
+ WIMAX_GNL_RFKILL_IFIDX = 1,
+ WIMAX_GNL_RFKILL_STATE,
+};
+
+
+/* Attributes for wimax_reset() */
+enum {
+ WIMAX_GNL_RESET_IFIDX = 1,
+};
+
+
+/*
+ * Attributes for the Report State Change
+ *
+ * For now we just have the old and new states; new attributes might
+ * be added later on.
+ */
+enum {
+ WIMAX_GNL_STCH_IFIDX = 1,
+ WIMAX_GNL_STCH_STATE_OLD,
+ WIMAX_GNL_STCH_STATE_NEW,
+};
+
+
+/**
+ * enum wimax_st - The different states of a WiMAX device
+ * @__WIMAX_ST_NULL: The device structure has been allocated and zeroed,
+ * but still wimax_dev_add() hasn't been called. There is no state.
+ *
+ * @WIMAX_ST_DOWN: The device has been registered with the WiMAX and
+ * networking stacks, but it is not initialized (normally that is
+ * done with 'ifconfig DEV up' [or equivalent], which can upload
+ * firmware and enable communications with the device).
+ * In this state, the device is powered down and using as less
+ * power as possible.
+ * This state is the default after a call to wimax_dev_add(). It
+ * is ok to have drivers move directly to %WIMAX_ST_UNINITIALIZED
+ * or %WIMAX_ST_RADIO_OFF in _probe() after the call to
+ * wimax_dev_add().
+ * It is recommended that the driver leaves this state when
+ * calling 'ifconfig DEV up' and enters it back on 'ifconfig DEV
+ * down'.
+ *
+ * @__WIMAX_ST_QUIESCING: The device is being torn down, so no API
+ * operations are allowed to proceed except the ones needed to
+ * complete the device clean up process.
+ *
+ * @WIMAX_ST_UNINITIALIZED: [optional] Communication with the device
+ * is setup, but the device still requires some configuration
+ * before being operational.
+ * Some WiMAX API calls might work.
+ *
+ * @WIMAX_ST_RADIO_OFF: The device is fully up; radio is off (wether
+ * by hardware or software switches).
+ * It is recommended to always leave the device in this state
+ * after initialization.
+ *
+ * @WIMAX_ST_READY: The device is fully up and radio is on.
+ *
+ * @WIMAX_ST_SCANNING: [optional] The device has been instructed to
+ * scan. In this state, the device cannot be actively connected to
+ * a network.
+ *
+ * @WIMAX_ST_CONNECTING: The device is connecting to a network. This
+ * state exists because in some devices, the connect process can
+ * include a number of negotiations between user space, kernel
+ * space and the device. User space needs to know what the device
+ * is doing. If the connect sequence in a device is atomic and
+ * fast, the device can transition directly to CONNECTED
+ *
+ * @WIMAX_ST_CONNECTED: The device is connected to a network.
+ *
+ * @__WIMAX_ST_INVALID: This is an invalid state used to mark the
+ * maximum numeric value of states.
+ *
+ * Description:
+ *
+ * Transitions from one state to another one are atomic and can only
+ * be caused in kernel space with wimax_state_change(). To read the
+ * state, use wimax_state_get().
+ *
+ * States starting with __ are internal and shall not be used or
+ * referred to by drivers or userspace. They look ugly, but that's the
+ * point -- if any use is made non-internal to the stack, it is easier
+ * to catch on review.
+ *
+ * All API operations [with well defined exceptions] will take the
+ * device mutex before starting and then check the state. If the state
+ * is %__WIMAX_ST_NULL, %WIMAX_ST_DOWN, %WIMAX_ST_UNINITIALIZED or
+ * %__WIMAX_ST_QUIESCING, it will drop the lock and quit with
+ * -%EINVAL, -%ENOMEDIUM, -%ENOTCONN or -%ESHUTDOWN.
+ *
+ * The order of the definitions is important, so we can do numerical
+ * comparisons (eg: < %WIMAX_ST_RADIO_OFF means the device is not ready
+ * to operate).
+ */
+/*
+ * The allowed state transitions are described in the table below
+ * (states in rows can go to states in columns where there is an X):
+ *
+ * UNINI RADIO READY SCAN CONNEC CONNEC
+ * NULL DOWN QUIESCING TIALIZED OFF NING TING TED
+ * NULL - x
+ * DOWN - x x x
+ * QUIESCING x -
+ * UNINITIALIZED x - x
+ * RADIO_OFF x - x
+ * READY x x - x x x
+ * SCANNING x x x - x x
+ * CONNECTING x x x x - x
+ * CONNECTED x x x -
+ *
+ * This table not available in kernel-doc because the formatting messes it up.
+ */
+ enum wimax_st {
+ __WIMAX_ST_NULL = 0,
+ WIMAX_ST_DOWN,
+ __WIMAX_ST_QUIESCING,
+ WIMAX_ST_UNINITIALIZED,
+ WIMAX_ST_RADIO_OFF,
+ WIMAX_ST_READY,
+ WIMAX_ST_SCANNING,
+ WIMAX_ST_CONNECTING,
+ WIMAX_ST_CONNECTED,
+ __WIMAX_ST_INVALID /* Always keep last */
+};
+
+
+#endif /* #ifndef __LINUX__WIMAX_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wimax/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wimax/..install.cmd
new file mode 100644
index 0000000..234ef58
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wimax/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/wimax/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/wimax /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/wimax mips i2400m.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/linux/wimax /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/wimax mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/linux/wimax/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wimax/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wimax/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wimax/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wimax/i2400m.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wimax/i2400m.h
new file mode 100644
index 0000000..d5148a7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wimax/i2400m.h
@@ -0,0 +1,581 @@
+/*
+ * Intel Wireless WiMax Connection 2400m
+ * Host-Device protocol interface definitions
+ *
+ *
+ * Copyright (C) 2007-2008 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Intel Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * Intel Corporation <linux-wimax@intel.com>
+ * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
+ * - Initial implementation
+ *
+ *
+ * This header defines the data structures and constants used to
+ * communicate with the device.
+ *
+ * BOOTMODE/BOOTROM/FIRMWARE UPLOAD PROTOCOL
+ *
+ * The firmware upload protocol is quite simple and only requires a
+ * handful of commands. See drivers/net/wimax/i2400m/fw.c for more
+ * details.
+ *
+ * The BCF data structure is for the firmware file header.
+ *
+ *
+ * THE DATA / CONTROL PROTOCOL
+ *
+ * This is the normal protocol spoken with the device once the
+ * firmware is uploaded. It transports data payloads and control
+ * messages back and forth.
+ *
+ * It consists 'messages' that pack one or more payloads each. The
+ * format is described in detail in drivers/net/wimax/i2400m/rx.c and
+ * tx.c.
+ *
+ *
+ * THE L3L4 PROTOCOL
+ *
+ * The term L3L4 refers to Layer 3 (the device), Layer 4 (the
+ * driver/host software).
+ *
+ * This is the control protocol used by the host to control the i2400m
+ * device (scan, connect, disconnect...). This is sent to / received
+ * as control frames. These frames consist of a header and zero or
+ * more TLVs with information. We call each control frame a "message".
+ *
+ * Each message is composed of:
+ *
+ * HEADER
+ * [TLV0 + PAYLOAD0]
+ * [TLV1 + PAYLOAD1]
+ * [...]
+ * [TLVN + PAYLOADN]
+ *
+ * The HEADER is defined by 'struct i2400m_l3l4_hdr'. The payloads are
+ * defined by a TLV structure (Type Length Value) which is a 'header'
+ * (struct i2400m_tlv_hdr) and then the payload.
+ *
+ * All integers are represented as Little Endian.
+ *
+ * - REQUESTS AND EVENTS
+ *
+ * The requests can be clasified as follows:
+ *
+ * COMMAND: implies a request from the host to the device requesting
+ * an action being performed. The device will reply with a
+ * message (with the same type as the command), status and
+ * no (TLV) payload. Execution of a command might cause
+ * events (of different type) to be sent later on as
+ * device's state changes.
+ *
+ * GET/SET: similar to COMMAND, but will not cause other
+ * EVENTs. The reply, in the case of GET, will contain
+ * TLVs with the requested information.
+ *
+ * EVENT: asynchronous messages sent from the device, maybe as a
+ * consequence of previous COMMANDs but disassociated from
+ * them.
+ *
+ * Only one request might be pending at the same time (ie: don't
+ * parallelize nor post another GET request before the previous
+ * COMMAND has been acknowledged with it's corresponding reply by the
+ * device).
+ *
+ * The different requests and their formats are described below:
+ *
+ * I2400M_MT_* Message types
+ * I2400M_MS_* Message status (for replies, events)
+ * i2400m_tlv_* TLVs
+ *
+ * data types are named 'struct i2400m_msg_OPNAME', OPNAME matching the
+ * operation.
+ */
+
+#ifndef __LINUX__WIMAX__I2400M_H__
+#define __LINUX__WIMAX__I2400M_H__
+
+#include <linux/types.h>
+
+
+/*
+ * Host Device Interface (HDI) common to all busses
+ */
+
+/* Boot-mode (firmware upload mode) commands */
+
+/* Header for the firmware file */
+struct i2400m_bcf_hdr {
+ __le32 module_type;
+ __le32 header_len;
+ __le32 header_version;
+ __le32 module_id;
+ __le32 module_vendor;
+ __le32 date; /* BCD YYYMMDD */
+ __le32 size;
+ __le32 key_size; /* in dwords */
+ __le32 modulus_size; /* in dwords */
+ __le32 exponent_size; /* in dwords */
+ __u8 reserved[88];
+} __attribute__ ((packed));
+
+/* Boot mode opcodes */
+enum i2400m_brh_opcode {
+ I2400M_BRH_READ = 1,
+ I2400M_BRH_WRITE = 2,
+ I2400M_BRH_JUMP = 3,
+ I2400M_BRH_SIGNED_JUMP = 8,
+ I2400M_BRH_HASH_PAYLOAD_ONLY = 9,
+};
+
+/* Boot mode command masks and stuff */
+enum i2400m_brh {
+ I2400M_BRH_SIGNATURE = 0xcbbc0000,
+ I2400M_BRH_SIGNATURE_MASK = 0xffff0000,
+ I2400M_BRH_SIGNATURE_SHIFT = 16,
+ I2400M_BRH_OPCODE_MASK = 0x0000000f,
+ I2400M_BRH_RESPONSE_MASK = 0x000000f0,
+ I2400M_BRH_RESPONSE_SHIFT = 4,
+ I2400M_BRH_DIRECT_ACCESS = 0x00000400,
+ I2400M_BRH_RESPONSE_REQUIRED = 0x00000200,
+ I2400M_BRH_USE_CHECKSUM = 0x00000100,
+};
+
+
+/* Constants for bcf->module_id */
+enum i2400m_bcf_mod_id {
+ /* Firmware file carries its own pokes -- pokes are a set of
+ * magical values that have to be written in certain memory
+ * addresses to get the device up and ready for firmware
+ * download when it is in non-signed boot mode. */
+ I2400M_BCF_MOD_ID_POKES = 0x000000001,
+};
+
+
+/**
+ * i2400m_bootrom_header - Header for a boot-mode command
+ *
+ * @cmd: the above command descriptor
+ * @target_addr: where on the device memory should the action be performed.
+ * @data_size: for read/write, amount of data to be read/written
+ * @block_checksum: checksum value (if applicable)
+ * @payload: the beginning of data attached to this header
+ */
+struct i2400m_bootrom_header {
+ __le32 command; /* Compose with enum i2400_brh */
+ __le32 target_addr;
+ __le32 data_size;
+ __le32 block_checksum;
+ char payload[0];
+} __attribute__ ((packed));
+
+
+/*
+ * Data / control protocol
+ */
+
+/* Packet types for the host-device interface */
+enum i2400m_pt {
+ I2400M_PT_DATA = 0,
+ I2400M_PT_CTRL,
+ I2400M_PT_TRACE, /* For device debug */
+ I2400M_PT_RESET_WARM, /* device reset */
+ I2400M_PT_RESET_COLD, /* USB[transport] reset, like reconnect */
+ I2400M_PT_EDATA, /* Extended RX data */
+ I2400M_PT_ILLEGAL
+};
+
+
+/*
+ * Payload for a data packet
+ *
+ * This is prefixed to each and every outgoing DATA type.
+ */
+struct i2400m_pl_data_hdr {
+ __le32 reserved;
+} __attribute__((packed));
+
+
+/*
+ * Payload for an extended data packet
+ *
+ * New in fw v1.4
+ *
+ * @reorder: if this payload has to be reorder or not (and how)
+ * @cs: the type of data in the packet, as defined per (802.16e
+ * T11.13.19.1). Currently only 2 (IPv4 packet) supported.
+ *
+ * This is prefixed to each and every INCOMING DATA packet.
+ */
+struct i2400m_pl_edata_hdr {
+ __le32 reorder; /* bits defined in i2400m_ro */
+ __u8 cs;
+ __u8 reserved[11];
+} __attribute__((packed));
+
+enum i2400m_cs {
+ I2400M_CS_IPV4_0 = 0,
+ I2400M_CS_IPV4 = 2,
+};
+
+enum i2400m_ro {
+ I2400M_RO_NEEDED = 0x01,
+ I2400M_RO_TYPE = 0x03,
+ I2400M_RO_TYPE_SHIFT = 1,
+ I2400M_RO_CIN = 0x0f,
+ I2400M_RO_CIN_SHIFT = 4,
+ I2400M_RO_FBN = 0x07ff,
+ I2400M_RO_FBN_SHIFT = 8,
+ I2400M_RO_SN = 0x07ff,
+ I2400M_RO_SN_SHIFT = 21,
+};
+
+enum i2400m_ro_type {
+ I2400M_RO_TYPE_RESET = 0,
+ I2400M_RO_TYPE_PACKET,
+ I2400M_RO_TYPE_WS,
+ I2400M_RO_TYPE_PACKET_WS,
+};
+
+
+/* Misc constants */
+enum {
+ I2400M_PL_PAD = 16, /* Payload data size alignment */
+ I2400M_PL_SIZE_MAX = 0x3EFF,
+ I2400M_MAX_PLS_IN_MSG = 60,
+ /* protocol barkers: sync sequences; for notifications they
+ * are sent in groups of four. */
+ I2400M_H2D_PREVIEW_BARKER = 0xcafe900d,
+ I2400M_COLD_RESET_BARKER = 0xc01dc01d,
+ I2400M_WARM_RESET_BARKER = 0x50f750f7,
+ I2400M_NBOOT_BARKER = 0xdeadbeef,
+ I2400M_SBOOT_BARKER = 0x0ff1c1a1,
+ I2400M_ACK_BARKER = 0xfeedbabe,
+ I2400M_D2H_MSG_BARKER = 0xbeefbabe,
+};
+
+
+/*
+ * Hardware payload descriptor
+ *
+ * Bitfields encoded in a struct to enforce typing semantics.
+ *
+ * Look in rx.c and tx.c for a full description of the format.
+ */
+struct i2400m_pld {
+ __le32 val;
+} __attribute__ ((packed));
+
+#define I2400M_PLD_SIZE_MASK 0x00003fff
+#define I2400M_PLD_TYPE_SHIFT 16
+#define I2400M_PLD_TYPE_MASK 0x000f0000
+
+/*
+ * Header for a TX message or RX message
+ *
+ * @barker: preamble
+ * @size: used for management of the FIFO queue buffer; before
+ * sending, this is converted to be a real preamble. This
+ * indicates the real size of the TX message that starts at this
+ * point. If the highest bit is set, then this message is to be
+ * skipped.
+ * @sequence: sequence number of this message
+ * @offset: offset where the message itself starts -- see the comments
+ * in the file header about message header and payload descriptor
+ * alignment.
+ * @num_pls: number of payloads in this message
+ * @padding: amount of padding bytes at the end of the message to make
+ * it be of block-size aligned
+ *
+ * Look in rx.c and tx.c for a full description of the format.
+ */
+struct i2400m_msg_hdr {
+ union {
+ __le32 barker;
+ __u32 size; /* same size type as barker!! */
+ };
+ union {
+ __le32 sequence;
+ __u32 offset; /* same size type as barker!! */
+ };
+ __le16 num_pls;
+ __le16 rsv1;
+ __le16 padding;
+ __le16 rsv2;
+ struct i2400m_pld pld[0];
+} __attribute__ ((packed));
+
+
+
+/*
+ * L3/L4 control protocol
+ */
+
+enum {
+ /* Interface version */
+ I2400M_L3L4_VERSION = 0x0100,
+};
+
+/* Message types */
+enum i2400m_mt {
+ I2400M_MT_RESERVED = 0x0000,
+ I2400M_MT_INVALID = 0xffff,
+ I2400M_MT_REPORT_MASK = 0x8000,
+
+ I2400M_MT_GET_SCAN_RESULT = 0x4202,
+ I2400M_MT_SET_SCAN_PARAM = 0x4402,
+ I2400M_MT_CMD_RF_CONTROL = 0x4602,
+ I2400M_MT_CMD_SCAN = 0x4603,
+ I2400M_MT_CMD_CONNECT = 0x4604,
+ I2400M_MT_CMD_DISCONNECT = 0x4605,
+ I2400M_MT_CMD_EXIT_IDLE = 0x4606,
+ I2400M_MT_GET_LM_VERSION = 0x5201,
+ I2400M_MT_GET_DEVICE_INFO = 0x5202,
+ I2400M_MT_GET_LINK_STATUS = 0x5203,
+ I2400M_MT_GET_STATISTICS = 0x5204,
+ I2400M_MT_GET_STATE = 0x5205,
+ I2400M_MT_GET_MEDIA_STATUS = 0x5206,
+ I2400M_MT_SET_INIT_CONFIG = 0x5404,
+ I2400M_MT_CMD_INIT = 0x5601,
+ I2400M_MT_CMD_TERMINATE = 0x5602,
+ I2400M_MT_CMD_MODE_OF_OP = 0x5603,
+ I2400M_MT_CMD_RESET_DEVICE = 0x5604,
+ I2400M_MT_CMD_MONITOR_CONTROL = 0x5605,
+ I2400M_MT_CMD_ENTER_POWERSAVE = 0x5606,
+ I2400M_MT_GET_TLS_OPERATION_RESULT = 0x6201,
+ I2400M_MT_SET_EAP_SUCCESS = 0x6402,
+ I2400M_MT_SET_EAP_FAIL = 0x6403,
+ I2400M_MT_SET_EAP_KEY = 0x6404,
+ I2400M_MT_CMD_SEND_EAP_RESPONSE = 0x6602,
+ I2400M_MT_REPORT_SCAN_RESULT = 0xc002,
+ I2400M_MT_REPORT_STATE = 0xd002,
+ I2400M_MT_REPORT_POWERSAVE_READY = 0xd005,
+ I2400M_MT_REPORT_EAP_REQUEST = 0xe002,
+ I2400M_MT_REPORT_EAP_RESTART = 0xe003,
+ I2400M_MT_REPORT_ALT_ACCEPT = 0xe004,
+ I2400M_MT_REPORT_KEY_REQUEST = 0xe005,
+};
+
+
+/*
+ * Message Ack Status codes
+ *
+ * When a message is replied-to, this status is reported.
+ */
+enum i2400m_ms {
+ I2400M_MS_DONE_OK = 0,
+ I2400M_MS_DONE_IN_PROGRESS = 1,
+ I2400M_MS_INVALID_OP = 2,
+ I2400M_MS_BAD_STATE = 3,
+ I2400M_MS_ILLEGAL_VALUE = 4,
+ I2400M_MS_MISSING_PARAMS = 5,
+ I2400M_MS_VERSION_ERROR = 6,
+ I2400M_MS_ACCESSIBILITY_ERROR = 7,
+ I2400M_MS_BUSY = 8,
+ I2400M_MS_CORRUPTED_TLV = 9,
+ I2400M_MS_UNINITIALIZED = 10,
+ I2400M_MS_UNKNOWN_ERROR = 11,
+ I2400M_MS_PRODUCTION_ERROR = 12,
+ I2400M_MS_NO_RF = 13,
+ I2400M_MS_NOT_READY_FOR_POWERSAVE = 14,
+ I2400M_MS_THERMAL_CRITICAL = 15,
+ I2400M_MS_MAX
+};
+
+
+/**
+ * i2400m_tlv - enumeration of the different types of TLVs
+ *
+ * TLVs stand for type-length-value and are the header for a payload
+ * composed of almost anything. Each payload has a type assigned
+ * and a length.
+ */
+enum i2400m_tlv {
+ I2400M_TLV_L4_MESSAGE_VERSIONS = 129,
+ I2400M_TLV_SYSTEM_STATE = 141,
+ I2400M_TLV_MEDIA_STATUS = 161,
+ I2400M_TLV_RF_OPERATION = 162,
+ I2400M_TLV_RF_STATUS = 163,
+ I2400M_TLV_DEVICE_RESET_TYPE = 132,
+ I2400M_TLV_CONFIG_IDLE_PARAMETERS = 601,
+ I2400M_TLV_CONFIG_IDLE_TIMEOUT = 611,
+ I2400M_TLV_CONFIG_D2H_DATA_FORMAT = 614,
+ I2400M_TLV_CONFIG_DL_HOST_REORDER = 615,
+};
+
+
+struct i2400m_tlv_hdr {
+ __le16 type;
+ __le16 length; /* payload's */
+ __u8 pl[0];
+} __attribute__((packed));
+
+
+struct i2400m_l3l4_hdr {
+ __le16 type;
+ __le16 length; /* payload's */
+ __le16 version;
+ __le16 resv1;
+ __le16 status;
+ __le16 resv2;
+ struct i2400m_tlv_hdr pl[0];
+} __attribute__((packed));
+
+
+/**
+ * i2400m_system_state - different states of the device
+ */
+enum i2400m_system_state {
+ I2400M_SS_UNINITIALIZED = 1,
+ I2400M_SS_INIT,
+ I2400M_SS_READY,
+ I2400M_SS_SCAN,
+ I2400M_SS_STANDBY,
+ I2400M_SS_CONNECTING,
+ I2400M_SS_WIMAX_CONNECTED,
+ I2400M_SS_DATA_PATH_CONNECTED,
+ I2400M_SS_IDLE,
+ I2400M_SS_DISCONNECTING,
+ I2400M_SS_OUT_OF_ZONE,
+ I2400M_SS_SLEEPACTIVE,
+ I2400M_SS_PRODUCTION,
+ I2400M_SS_CONFIG,
+ I2400M_SS_RF_OFF,
+ I2400M_SS_RF_SHUTDOWN,
+ I2400M_SS_DEVICE_DISCONNECT,
+ I2400M_SS_MAX,
+};
+
+
+/**
+ * i2400m_tlv_system_state - report on the state of the system
+ *
+ * @state: see enum i2400m_system_state
+ */
+struct i2400m_tlv_system_state {
+ struct i2400m_tlv_hdr hdr;
+ __le32 state;
+} __attribute__((packed));
+
+
+struct i2400m_tlv_l4_message_versions {
+ struct i2400m_tlv_hdr hdr;
+ __le16 major;
+ __le16 minor;
+ __le16 branch;
+ __le16 reserved;
+} __attribute__((packed));
+
+
+struct i2400m_tlv_detailed_device_info {
+ struct i2400m_tlv_hdr hdr;
+ __u8 reserved1[400];
+ __u8 mac_address[6];
+ __u8 reserved2[2];
+} __attribute__((packed));
+
+
+enum i2400m_rf_switch_status {
+ I2400M_RF_SWITCH_ON = 1,
+ I2400M_RF_SWITCH_OFF = 2,
+};
+
+struct i2400m_tlv_rf_switches_status {
+ struct i2400m_tlv_hdr hdr;
+ __u8 sw_rf_switch; /* 1 ON, 2 OFF */
+ __u8 hw_rf_switch; /* 1 ON, 2 OFF */
+ __u8 reserved[2];
+} __attribute__((packed));
+
+
+enum {
+ i2400m_rf_operation_on = 1,
+ i2400m_rf_operation_off = 2
+};
+
+struct i2400m_tlv_rf_operation {
+ struct i2400m_tlv_hdr hdr;
+ __le32 status; /* 1 ON, 2 OFF */
+} __attribute__((packed));
+
+
+enum i2400m_tlv_reset_type {
+ I2400M_RESET_TYPE_COLD = 1,
+ I2400M_RESET_TYPE_WARM
+};
+
+struct i2400m_tlv_device_reset_type {
+ struct i2400m_tlv_hdr hdr;
+ __le32 reset_type;
+} __attribute__((packed));
+
+
+struct i2400m_tlv_config_idle_parameters {
+ struct i2400m_tlv_hdr hdr;
+ __le32 idle_timeout; /* 100 to 300000 ms [5min], 100 increments
+ * 0 disabled */
+ __le32 idle_paging_interval; /* frames */
+} __attribute__((packed));
+
+
+enum i2400m_media_status {
+ I2400M_MEDIA_STATUS_LINK_UP = 1,
+ I2400M_MEDIA_STATUS_LINK_DOWN,
+ I2400M_MEDIA_STATUS_LINK_RENEW,
+};
+
+struct i2400m_tlv_media_status {
+ struct i2400m_tlv_hdr hdr;
+ __le32 media_status;
+} __attribute__((packed));
+
+
+/* New in v1.4 */
+struct i2400m_tlv_config_idle_timeout {
+ struct i2400m_tlv_hdr hdr;
+ __le32 timeout; /* 100 to 300000 ms [5min], 100 increments
+ * 0 disabled */
+} __attribute__((packed));
+
+/* New in v1.4 -- for backward compat, will be removed */
+struct i2400m_tlv_config_d2h_data_format {
+ struct i2400m_tlv_hdr hdr;
+ __u8 format; /* 0 old format, 1 enhanced */
+ __u8 reserved[3];
+} __attribute__((packed));
+
+/* New in v1.4 */
+struct i2400m_tlv_config_dl_host_reorder {
+ struct i2400m_tlv_hdr hdr;
+ __u8 reorder; /* 0 disabled, 1 enabled */
+ __u8 reserved[3];
+} __attribute__((packed));
+
+
+#endif /* #ifndef __LINUX__WIMAX__I2400M_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wireless.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wireless.h
new file mode 100644
index 0000000..fc1fec0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/wireless.h
@@ -0,0 +1,1126 @@
+/*
+ * This file define a set of standard wireless extensions
+ *
+ * Version : 22 16.3.07
+ *
+ * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com>
+ * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved.
+ */
+
+#ifndef _LINUX_WIRELESS_H
+#define _LINUX_WIRELESS_H
+
+/************************** DOCUMENTATION **************************/
+/*
+ * Initial APIs (1996 -> onward) :
+ * -----------------------------
+ * Basically, the wireless extensions are for now a set of standard ioctl
+ * call + /proc/net/wireless
+ *
+ * The entry /proc/net/wireless give statistics and information on the
+ * driver.
+ * This is better than having each driver having its entry because
+ * its centralised and we may remove the driver module safely.
+ *
+ * Ioctl are used to configure the driver and issue commands. This is
+ * better than command line options of insmod because we may want to
+ * change dynamically (while the driver is running) some parameters.
+ *
+ * The ioctl mechanimsm are copied from standard devices ioctl.
+ * We have the list of command plus a structure descibing the
+ * data exchanged...
+ * Note that to add these ioctl, I was obliged to modify :
+ * # net/core/dev.c (two place + add include)
+ * # net/ipv4/af_inet.c (one place + add include)
+ *
+ * /proc/net/wireless is a copy of /proc/net/dev.
+ * We have a structure for data passed from the driver to /proc/net/wireless
+ * Too add this, I've modified :
+ * # net/core/dev.c (two other places)
+ * # include/linux/netdevice.h (one place)
+ * # include/linux/proc_fs.h (one place)
+ *
+ * New driver API (2002 -> onward) :
+ * -------------------------------
+ * This file is only concerned with the user space API and common definitions.
+ * The new driver API is defined and documented in :
+ * # include/net/iw_handler.h
+ *
+ * Note as well that /proc/net/wireless implementation has now moved in :
+ * # net/core/wireless.c
+ *
+ * Wireless Events (2002 -> onward) :
+ * --------------------------------
+ * Events are defined at the end of this file, and implemented in :
+ * # net/core/wireless.c
+ *
+ * Other comments :
+ * --------------
+ * Do not add here things that are redundant with other mechanisms
+ * (drivers init, ifconfig, /proc/net/dev, ...) and with are not
+ * wireless specific.
+ *
+ * These wireless extensions are not magic : each driver has to provide
+ * support for them...
+ *
+ * IMPORTANT NOTE : As everything in the kernel, this is very much a
+ * work in progress. Contact me if you have ideas of improvements...
+ */
+
+/***************************** INCLUDES *****************************/
+
+#include <linux/types.h> /* for __u* and __s* typedefs */
+#include <linux/socket.h> /* for "struct sockaddr" et al */
+#include <linux/if.h> /* for IFNAMSIZ and co... */
+
+/***************************** VERSION *****************************/
+/*
+ * This constant is used to know the availability of the wireless
+ * extensions and to know which version of wireless extensions it is
+ * (there is some stuff that will be added in the future...)
+ * I just plan to increment with each new version.
+ */
+#define WIRELESS_EXT 22
+
+/*
+ * Changes :
+ *
+ * V2 to V3
+ * --------
+ * Alan Cox start some incompatibles changes. I've integrated a bit more.
+ * - Encryption renamed to Encode to avoid US regulation problems
+ * - Frequency changed from float to struct to avoid problems on old 386
+ *
+ * V3 to V4
+ * --------
+ * - Add sensitivity
+ *
+ * V4 to V5
+ * --------
+ * - Missing encoding definitions in range
+ * - Access points stuff
+ *
+ * V5 to V6
+ * --------
+ * - 802.11 support (ESSID ioctls)
+ *
+ * V6 to V7
+ * --------
+ * - define IW_ESSID_MAX_SIZE and IW_MAX_AP
+ *
+ * V7 to V8
+ * --------
+ * - Changed my e-mail address
+ * - More 802.11 support (nickname, rate, rts, frag)
+ * - List index in frequencies
+ *
+ * V8 to V9
+ * --------
+ * - Support for 'mode of operation' (ad-hoc, managed...)
+ * - Support for unicast and multicast power saving
+ * - Change encoding to support larger tokens (>64 bits)
+ * - Updated iw_params (disable, flags) and use it for NWID
+ * - Extracted iw_point from iwreq for clarity
+ *
+ * V9 to V10
+ * ---------
+ * - Add PM capability to range structure
+ * - Add PM modifier : MAX/MIN/RELATIVE
+ * - Add encoding option : IW_ENCODE_NOKEY
+ * - Add TxPower ioctls (work like TxRate)
+ *
+ * V10 to V11
+ * ----------
+ * - Add WE version in range (help backward/forward compatibility)
+ * - Add retry ioctls (work like PM)
+ *
+ * V11 to V12
+ * ----------
+ * - Add SIOCSIWSTATS to get /proc/net/wireless programatically
+ * - Add DEV PRIVATE IOCTL to avoid collisions in SIOCDEVPRIVATE space
+ * - Add new statistics (frag, retry, beacon)
+ * - Add average quality (for user space calibration)
+ *
+ * V12 to V13
+ * ----------
+ * - Document creation of new driver API.
+ * - Extract union iwreq_data from struct iwreq (for new driver API).
+ * - Rename SIOCSIWNAME as SIOCSIWCOMMIT
+ *
+ * V13 to V14
+ * ----------
+ * - Wireless Events support : define struct iw_event
+ * - Define additional specific event numbers
+ * - Add "addr" and "param" fields in union iwreq_data
+ * - AP scanning stuff (SIOCSIWSCAN and friends)
+ *
+ * V14 to V15
+ * ----------
+ * - Add IW_PRIV_TYPE_ADDR for struct sockaddr private arg
+ * - Make struct iw_freq signed (both m & e), add explicit padding
+ * - Add IWEVCUSTOM for driver specific event/scanning token
+ * - Add IW_MAX_GET_SPY for driver returning a lot of addresses
+ * - Add IW_TXPOW_RANGE for range of Tx Powers
+ * - Add IWEVREGISTERED & IWEVEXPIRED events for Access Points
+ * - Add IW_MODE_MONITOR for passive monitor
+ *
+ * V15 to V16
+ * ----------
+ * - Increase the number of bitrates in iw_range to 32 (for 802.11g)
+ * - Increase the number of frequencies in iw_range to 32 (for 802.11b+a)
+ * - Reshuffle struct iw_range for increases, add filler
+ * - Increase IW_MAX_AP to 64 for driver returning a lot of addresses
+ * - Remove IW_MAX_GET_SPY because conflict with enhanced spy support
+ * - Add SIOCSIWTHRSPY/SIOCGIWTHRSPY and "struct iw_thrspy"
+ * - Add IW_ENCODE_TEMP and iw_range->encoding_login_index
+ *
+ * V16 to V17
+ * ----------
+ * - Add flags to frequency -> auto/fixed
+ * - Document (struct iw_quality *)->updated, add new flags (INVALID)
+ * - Wireless Event capability in struct iw_range
+ * - Add support for relative TxPower (yick !)
+ *
+ * V17 to V18 (From Jouni Malinen <j@w1.fi>)
+ * ----------
+ * - Add support for WPA/WPA2
+ * - Add extended encoding configuration (SIOCSIWENCODEEXT and
+ * SIOCGIWENCODEEXT)
+ * - Add SIOCSIWGENIE/SIOCGIWGENIE
+ * - Add SIOCSIWMLME
+ * - Add SIOCSIWPMKSA
+ * - Add struct iw_range bit field for supported encoding capabilities
+ * - Add optional scan request parameters for SIOCSIWSCAN
+ * - Add SIOCSIWAUTH/SIOCGIWAUTH for setting authentication and WPA
+ * related parameters (extensible up to 4096 parameter values)
+ * - Add wireless events: IWEVGENIE, IWEVMICHAELMICFAILURE,
+ * IWEVASSOCREQIE, IWEVASSOCRESPIE, IWEVPMKIDCAND
+ *
+ * V18 to V19
+ * ----------
+ * - Remove (struct iw_point *)->pointer from events and streams
+ * - Remove header includes to help user space
+ * - Increase IW_ENCODING_TOKEN_MAX from 32 to 64
+ * - Add IW_QUAL_ALL_UPDATED and IW_QUAL_ALL_INVALID macros
+ * - Add explicit flag to tell stats are in dBm : IW_QUAL_DBM
+ * - Add IW_IOCTL_IDX() and IW_EVENT_IDX() macros
+ *
+ * V19 to V20
+ * ----------
+ * - RtNetlink requests support (SET/GET)
+ *
+ * V20 to V21
+ * ----------
+ * - Remove (struct net_device *)->get_wireless_stats()
+ * - Change length in ESSID and NICK to strlen() instead of strlen()+1
+ * - Add IW_RETRY_SHORT/IW_RETRY_LONG retry modifiers
+ * - Power/Retry relative values no longer * 100000
+ * - Add explicit flag to tell stats are in 802.11k RCPI : IW_QUAL_RCPI
+ *
+ * V21 to V22
+ * ----------
+ * - Prevent leaking of kernel space in stream on 64 bits.
+ */
+
+/**************************** CONSTANTS ****************************/
+
+/* -------------------------- IOCTL LIST -------------------------- */
+
+/* Wireless Identification */
+#define SIOCSIWCOMMIT 0x8B00 /* Commit pending changes to driver */
+#define SIOCGIWNAME 0x8B01 /* get name == wireless protocol */
+/* SIOCGIWNAME is used to verify the presence of Wireless Extensions.
+ * Common values : "IEEE 802.11-DS", "IEEE 802.11-FH", "IEEE 802.11b"...
+ * Don't put the name of your driver there, it's useless. */
+
+/* Basic operations */
+#define SIOCSIWNWID 0x8B02 /* set network id (pre-802.11) */
+#define SIOCGIWNWID 0x8B03 /* get network id (the cell) */
+#define SIOCSIWFREQ 0x8B04 /* set channel/frequency (Hz) */
+#define SIOCGIWFREQ 0x8B05 /* get channel/frequency (Hz) */
+#define SIOCSIWMODE 0x8B06 /* set operation mode */
+#define SIOCGIWMODE 0x8B07 /* get operation mode */
+#define SIOCSIWSENS 0x8B08 /* set sensitivity (dBm) */
+#define SIOCGIWSENS 0x8B09 /* get sensitivity (dBm) */
+
+/* Informative stuff */
+#define SIOCSIWRANGE 0x8B0A /* Unused */
+#define SIOCGIWRANGE 0x8B0B /* Get range of parameters */
+#define SIOCSIWPRIV 0x8B0C /* Unused */
+#define SIOCGIWPRIV 0x8B0D /* get private ioctl interface info */
+#define SIOCSIWSTATS 0x8B0E /* Unused */
+#define SIOCGIWSTATS 0x8B0F /* Get /proc/net/wireless stats */
+/* SIOCGIWSTATS is strictly used between user space and the kernel, and
+ * is never passed to the driver (i.e. the driver will never see it). */
+
+/* Spy support (statistics per MAC address - used for Mobile IP support) */
+#define SIOCSIWSPY 0x8B10 /* set spy addresses */
+#define SIOCGIWSPY 0x8B11 /* get spy info (quality of link) */
+#define SIOCSIWTHRSPY 0x8B12 /* set spy threshold (spy event) */
+#define SIOCGIWTHRSPY 0x8B13 /* get spy threshold */
+
+/* Access Point manipulation */
+#define SIOCSIWAP 0x8B14 /* set access point MAC addresses */
+#define SIOCGIWAP 0x8B15 /* get access point MAC addresses */
+#define SIOCGIWAPLIST 0x8B17 /* Deprecated in favor of scanning */
+#define SIOCSIWSCAN 0x8B18 /* trigger scanning (list cells) */
+#define SIOCGIWSCAN 0x8B19 /* get scanning results */
+
+/* 802.11 specific support */
+#define SIOCSIWESSID 0x8B1A /* set ESSID (network name) */
+#define SIOCGIWESSID 0x8B1B /* get ESSID */
+#define SIOCSIWNICKN 0x8B1C /* set node name/nickname */
+#define SIOCGIWNICKN 0x8B1D /* get node name/nickname */
+/* As the ESSID and NICKN are strings up to 32 bytes long, it doesn't fit
+ * within the 'iwreq' structure, so we need to use the 'data' member to
+ * point to a string in user space, like it is done for RANGE... */
+
+/* Other parameters useful in 802.11 and some other devices */
+#define SIOCSIWRATE 0x8B20 /* set default bit rate (bps) */
+#define SIOCGIWRATE 0x8B21 /* get default bit rate (bps) */
+#define SIOCSIWRTS 0x8B22 /* set RTS/CTS threshold (bytes) */
+#define SIOCGIWRTS 0x8B23 /* get RTS/CTS threshold (bytes) */
+#define SIOCSIWFRAG 0x8B24 /* set fragmentation thr (bytes) */
+#define SIOCGIWFRAG 0x8B25 /* get fragmentation thr (bytes) */
+#define SIOCSIWTXPOW 0x8B26 /* set transmit power (dBm) */
+#define SIOCGIWTXPOW 0x8B27 /* get transmit power (dBm) */
+#define SIOCSIWRETRY 0x8B28 /* set retry limits and lifetime */
+#define SIOCGIWRETRY 0x8B29 /* get retry limits and lifetime */
+
+/* Encoding stuff (scrambling, hardware security, WEP...) */
+#define SIOCSIWENCODE 0x8B2A /* set encoding token & mode */
+#define SIOCGIWENCODE 0x8B2B /* get encoding token & mode */
+/* Power saving stuff (power management, unicast and multicast) */
+#define SIOCSIWPOWER 0x8B2C /* set Power Management settings */
+#define SIOCGIWPOWER 0x8B2D /* get Power Management settings */
+
+/* WPA : Generic IEEE 802.11 informatiom element (e.g., for WPA/RSN/WMM).
+ * This ioctl uses struct iw_point and data buffer that includes IE id and len
+ * fields. More than one IE may be included in the request. Setting the generic
+ * IE to empty buffer (len=0) removes the generic IE from the driver. Drivers
+ * are allowed to generate their own WPA/RSN IEs, but in these cases, drivers
+ * are required to report the used IE as a wireless event, e.g., when
+ * associating with an AP. */
+#define SIOCSIWGENIE 0x8B30 /* set generic IE */
+#define SIOCGIWGENIE 0x8B31 /* get generic IE */
+
+/* WPA : IEEE 802.11 MLME requests */
+#define SIOCSIWMLME 0x8B16 /* request MLME operation; uses
+ * struct iw_mlme */
+/* WPA : Authentication mode parameters */
+#define SIOCSIWAUTH 0x8B32 /* set authentication mode params */
+#define SIOCGIWAUTH 0x8B33 /* get authentication mode params */
+
+/* WPA : Extended version of encoding configuration */
+#define SIOCSIWENCODEEXT 0x8B34 /* set encoding token & mode */
+#define SIOCGIWENCODEEXT 0x8B35 /* get encoding token & mode */
+
+/* WPA2 : PMKSA cache management */
+#define SIOCSIWPMKSA 0x8B36 /* PMKSA cache operation */
+
+/* -------------------- DEV PRIVATE IOCTL LIST -------------------- */
+
+/* These 32 ioctl are wireless device private, for 16 commands.
+ * Each driver is free to use them for whatever purpose it chooses,
+ * however the driver *must* export the description of those ioctls
+ * with SIOCGIWPRIV and *must* use arguments as defined below.
+ * If you don't follow those rules, DaveM is going to hate you (reason :
+ * it make mixed 32/64bit operation impossible).
+ */
+#define SIOCIWFIRSTPRIV 0x8BE0
+#define SIOCIWLASTPRIV 0x8BFF
+/* Previously, we were using SIOCDEVPRIVATE, but we now have our
+ * separate range because of collisions with other tools such as
+ * 'mii-tool'.
+ * We now have 32 commands, so a bit more space ;-).
+ * Also, all 'even' commands are only usable by root and don't return the
+ * content of ifr/iwr to user (but you are not obliged to use the set/get
+ * convention, just use every other two command). More details in iwpriv.c.
+ * And I repeat : you are not forced to use them with iwpriv, but you
+ * must be compliant with it.
+ */
+
+/* ------------------------- IOCTL STUFF ------------------------- */
+
+/* The first and the last (range) */
+#define SIOCIWFIRST 0x8B00
+#define SIOCIWLAST SIOCIWLASTPRIV /* 0x8BFF */
+#define IW_IOCTL_IDX(cmd) ((cmd) - SIOCIWFIRST)
+
+/* Odd : get (world access), even : set (root access) */
+#define IW_IS_SET(cmd) (!((cmd) & 0x1))
+#define IW_IS_GET(cmd) ((cmd) & 0x1)
+
+/* ----------------------- WIRELESS EVENTS ----------------------- */
+/* Those are *NOT* ioctls, do not issue request on them !!! */
+/* Most events use the same identifier as ioctl requests */
+
+#define IWEVTXDROP 0x8C00 /* Packet dropped to excessive retry */
+#define IWEVQUAL 0x8C01 /* Quality part of statistics (scan) */
+#define IWEVCUSTOM 0x8C02 /* Driver specific ascii string */
+#define IWEVREGISTERED 0x8C03 /* Discovered a new node (AP mode) */
+#define IWEVEXPIRED 0x8C04 /* Expired a node (AP mode) */
+#define IWEVGENIE 0x8C05 /* Generic IE (WPA, RSN, WMM, ..)
+ * (scan results); This includes id and
+ * length fields. One IWEVGENIE may
+ * contain more than one IE. Scan
+ * results may contain one or more
+ * IWEVGENIE events. */
+#define IWEVMICHAELMICFAILURE 0x8C06 /* Michael MIC failure
+ * (struct iw_michaelmicfailure)
+ */
+#define IWEVASSOCREQIE 0x8C07 /* IEs used in (Re)Association Request.
+ * The data includes id and length
+ * fields and may contain more than one
+ * IE. This event is required in
+ * Managed mode if the driver
+ * generates its own WPA/RSN IE. This
+ * should be sent just before
+ * IWEVREGISTERED event for the
+ * association. */
+#define IWEVASSOCRESPIE 0x8C08 /* IEs used in (Re)Association
+ * Response. The data includes id and
+ * length fields and may contain more
+ * than one IE. This may be sent
+ * between IWEVASSOCREQIE and
+ * IWEVREGISTERED events for the
+ * association. */
+#define IWEVPMKIDCAND 0x8C09 /* PMKID candidate for RSN
+ * pre-authentication
+ * (struct iw_pmkid_cand) */
+
+#define IWEVFIRST 0x8C00
+#define IW_EVENT_IDX(cmd) ((cmd) - IWEVFIRST)
+
+/* ------------------------- PRIVATE INFO ------------------------- */
+/*
+ * The following is used with SIOCGIWPRIV. It allow a driver to define
+ * the interface (name, type of data) for its private ioctl.
+ * Privates ioctl are SIOCIWFIRSTPRIV -> SIOCIWLASTPRIV
+ */
+
+#define IW_PRIV_TYPE_MASK 0x7000 /* Type of arguments */
+#define IW_PRIV_TYPE_NONE 0x0000
+#define IW_PRIV_TYPE_BYTE 0x1000 /* Char as number */
+#define IW_PRIV_TYPE_CHAR 0x2000 /* Char as character */
+#define IW_PRIV_TYPE_INT 0x4000 /* 32 bits int */
+#define IW_PRIV_TYPE_FLOAT 0x5000 /* struct iw_freq */
+#define IW_PRIV_TYPE_ADDR 0x6000 /* struct sockaddr */
+
+#define IW_PRIV_SIZE_FIXED 0x0800 /* Variable or fixed number of args */
+
+#define IW_PRIV_SIZE_MASK 0x07FF /* Max number of those args */
+
+/*
+ * Note : if the number of args is fixed and the size < 16 octets,
+ * instead of passing a pointer we will put args in the iwreq struct...
+ */
+
+/* ----------------------- OTHER CONSTANTS ----------------------- */
+
+/* Maximum frequencies in the range struct */
+#define IW_MAX_FREQUENCIES 32
+/* Note : if you have something like 80 frequencies,
+ * don't increase this constant and don't fill the frequency list.
+ * The user will be able to set by channel anyway... */
+
+/* Maximum bit rates in the range struct */
+#define IW_MAX_BITRATES 32
+
+/* Maximum tx powers in the range struct */
+#define IW_MAX_TXPOWER 8
+/* Note : if you more than 8 TXPowers, just set the max and min or
+ * a few of them in the struct iw_range. */
+
+/* Maximum of address that you may set with SPY */
+#define IW_MAX_SPY 8
+
+/* Maximum of address that you may get in the
+ list of access points in range */
+#define IW_MAX_AP 64
+
+/* Maximum size of the ESSID and NICKN strings */
+#define IW_ESSID_MAX_SIZE 32
+
+/* Modes of operation */
+#define IW_MODE_AUTO 0 /* Let the driver decides */
+#define IW_MODE_ADHOC 1 /* Single cell network */
+#define IW_MODE_INFRA 2 /* Multi cell network, roaming, ... */
+#define IW_MODE_MASTER 3 /* Synchronisation master or Access Point */
+#define IW_MODE_REPEAT 4 /* Wireless Repeater (forwarder) */
+#define IW_MODE_SECOND 5 /* Secondary master/repeater (backup) */
+#define IW_MODE_MONITOR 6 /* Passive monitor (listen only) */
+#define IW_MODE_MESH 7 /* Mesh (IEEE 802.11s) network */
+
+/* Statistics flags (bitmask in updated) */
+#define IW_QUAL_QUAL_UPDATED 0x01 /* Value was updated since last read */
+#define IW_QUAL_LEVEL_UPDATED 0x02
+#define IW_QUAL_NOISE_UPDATED 0x04
+#define IW_QUAL_ALL_UPDATED 0x07
+#define IW_QUAL_DBM 0x08 /* Level + Noise are dBm */
+#define IW_QUAL_QUAL_INVALID 0x10 /* Driver doesn't provide value */
+#define IW_QUAL_LEVEL_INVALID 0x20
+#define IW_QUAL_NOISE_INVALID 0x40
+#define IW_QUAL_RCPI 0x80 /* Level + Noise are 802.11k RCPI */
+#define IW_QUAL_ALL_INVALID 0x70
+
+/* Frequency flags */
+#define IW_FREQ_AUTO 0x00 /* Let the driver decides */
+#define IW_FREQ_FIXED 0x01 /* Force a specific value */
+
+/* Maximum number of size of encoding token available
+ * they are listed in the range structure */
+#define IW_MAX_ENCODING_SIZES 8
+
+/* Maximum size of the encoding token in bytes */
+#define IW_ENCODING_TOKEN_MAX 64 /* 512 bits (for now) */
+
+/* Flags for encoding (along with the token) */
+#define IW_ENCODE_INDEX 0x00FF /* Token index (if needed) */
+#define IW_ENCODE_FLAGS 0xFF00 /* Flags defined below */
+#define IW_ENCODE_MODE 0xF000 /* Modes defined below */
+#define IW_ENCODE_DISABLED 0x8000 /* Encoding disabled */
+#define IW_ENCODE_ENABLED 0x0000 /* Encoding enabled */
+#define IW_ENCODE_RESTRICTED 0x4000 /* Refuse non-encoded packets */
+#define IW_ENCODE_OPEN 0x2000 /* Accept non-encoded packets */
+#define IW_ENCODE_NOKEY 0x0800 /* Key is write only, so not present */
+#define IW_ENCODE_TEMP 0x0400 /* Temporary key */
+
+/* Power management flags available (along with the value, if any) */
+#define IW_POWER_ON 0x0000 /* No details... */
+#define IW_POWER_TYPE 0xF000 /* Type of parameter */
+#define IW_POWER_PERIOD 0x1000 /* Value is a period/duration of */
+#define IW_POWER_TIMEOUT 0x2000 /* Value is a timeout (to go asleep) */
+#define IW_POWER_MODE 0x0F00 /* Power Management mode */
+#define IW_POWER_UNICAST_R 0x0100 /* Receive only unicast messages */
+#define IW_POWER_MULTICAST_R 0x0200 /* Receive only multicast messages */
+#define IW_POWER_ALL_R 0x0300 /* Receive all messages though PM */
+#define IW_POWER_FORCE_S 0x0400 /* Force PM procedure for sending unicast */
+#define IW_POWER_REPEATER 0x0800 /* Repeat broadcast messages in PM period */
+#define IW_POWER_MODIFIER 0x000F /* Modify a parameter */
+#define IW_POWER_MIN 0x0001 /* Value is a minimum */
+#define IW_POWER_MAX 0x0002 /* Value is a maximum */
+#define IW_POWER_RELATIVE 0x0004 /* Value is not in seconds/ms/us */
+
+/* Transmit Power flags available */
+#define IW_TXPOW_TYPE 0x00FF /* Type of value */
+#define IW_TXPOW_DBM 0x0000 /* Value is in dBm */
+#define IW_TXPOW_MWATT 0x0001 /* Value is in mW */
+#define IW_TXPOW_RELATIVE 0x0002 /* Value is in arbitrary units */
+#define IW_TXPOW_RANGE 0x1000 /* Range of value between min/max */
+
+/* Retry limits and lifetime flags available */
+#define IW_RETRY_ON 0x0000 /* No details... */
+#define IW_RETRY_TYPE 0xF000 /* Type of parameter */
+#define IW_RETRY_LIMIT 0x1000 /* Maximum number of retries*/
+#define IW_RETRY_LIFETIME 0x2000 /* Maximum duration of retries in us */
+#define IW_RETRY_MODIFIER 0x00FF /* Modify a parameter */
+#define IW_RETRY_MIN 0x0001 /* Value is a minimum */
+#define IW_RETRY_MAX 0x0002 /* Value is a maximum */
+#define IW_RETRY_RELATIVE 0x0004 /* Value is not in seconds/ms/us */
+#define IW_RETRY_SHORT 0x0010 /* Value is for short packets */
+#define IW_RETRY_LONG 0x0020 /* Value is for long packets */
+
+/* Scanning request flags */
+#define IW_SCAN_DEFAULT 0x0000 /* Default scan of the driver */
+#define IW_SCAN_ALL_ESSID 0x0001 /* Scan all ESSIDs */
+#define IW_SCAN_THIS_ESSID 0x0002 /* Scan only this ESSID */
+#define IW_SCAN_ALL_FREQ 0x0004 /* Scan all Frequencies */
+#define IW_SCAN_THIS_FREQ 0x0008 /* Scan only this Frequency */
+#define IW_SCAN_ALL_MODE 0x0010 /* Scan all Modes */
+#define IW_SCAN_THIS_MODE 0x0020 /* Scan only this Mode */
+#define IW_SCAN_ALL_RATE 0x0040 /* Scan all Bit-Rates */
+#define IW_SCAN_THIS_RATE 0x0080 /* Scan only this Bit-Rate */
+/* struct iw_scan_req scan_type */
+#define IW_SCAN_TYPE_ACTIVE 0
+#define IW_SCAN_TYPE_PASSIVE 1
+/* Maximum size of returned data */
+#define IW_SCAN_MAX_DATA 4096 /* In bytes */
+
+/* Scan capability flags - in (struct iw_range *)->scan_capa */
+#define IW_SCAN_CAPA_NONE 0x00
+#define IW_SCAN_CAPA_ESSID 0x01
+#define IW_SCAN_CAPA_BSSID 0x02
+#define IW_SCAN_CAPA_CHANNEL 0x04
+#define IW_SCAN_CAPA_MODE 0x08
+#define IW_SCAN_CAPA_RATE 0x10
+#define IW_SCAN_CAPA_TYPE 0x20
+#define IW_SCAN_CAPA_TIME 0x40
+
+/* Max number of char in custom event - use multiple of them if needed */
+#define IW_CUSTOM_MAX 256 /* In bytes */
+
+/* Generic information element */
+#define IW_GENERIC_IE_MAX 1024
+
+/* MLME requests (SIOCSIWMLME / struct iw_mlme) */
+#define IW_MLME_DEAUTH 0
+#define IW_MLME_DISASSOC 1
+#define IW_MLME_AUTH 2
+#define IW_MLME_ASSOC 3
+
+/* SIOCSIWAUTH/SIOCGIWAUTH struct iw_param flags */
+#define IW_AUTH_INDEX 0x0FFF
+#define IW_AUTH_FLAGS 0xF000
+/* SIOCSIWAUTH/SIOCGIWAUTH parameters (0 .. 4095)
+ * (IW_AUTH_INDEX mask in struct iw_param flags; this is the index of the
+ * parameter that is being set/get to; value will be read/written to
+ * struct iw_param value field) */
+#define IW_AUTH_WPA_VERSION 0
+#define IW_AUTH_CIPHER_PAIRWISE 1
+#define IW_AUTH_CIPHER_GROUP 2
+#define IW_AUTH_KEY_MGMT 3
+#define IW_AUTH_TKIP_COUNTERMEASURES 4
+#define IW_AUTH_DROP_UNENCRYPTED 5
+#define IW_AUTH_80211_AUTH_ALG 6
+#define IW_AUTH_WPA_ENABLED 7
+#define IW_AUTH_RX_UNENCRYPTED_EAPOL 8
+#define IW_AUTH_ROAMING_CONTROL 9
+#define IW_AUTH_PRIVACY_INVOKED 10
+#define IW_AUTH_CIPHER_GROUP_MGMT 11
+#define IW_AUTH_MFP 12
+
+/* IW_AUTH_WPA_VERSION values (bit field) */
+#define IW_AUTH_WPA_VERSION_DISABLED 0x00000001
+#define IW_AUTH_WPA_VERSION_WPA 0x00000002
+#define IW_AUTH_WPA_VERSION_WPA2 0x00000004
+
+/* IW_AUTH_PAIRWISE_CIPHER, IW_AUTH_GROUP_CIPHER, and IW_AUTH_CIPHER_GROUP_MGMT
+ * values (bit field) */
+#define IW_AUTH_CIPHER_NONE 0x00000001
+#define IW_AUTH_CIPHER_WEP40 0x00000002
+#define IW_AUTH_CIPHER_TKIP 0x00000004
+#define IW_AUTH_CIPHER_CCMP 0x00000008
+#define IW_AUTH_CIPHER_WEP104 0x00000010
+#define IW_AUTH_CIPHER_AES_CMAC 0x00000020
+
+/* IW_AUTH_KEY_MGMT values (bit field) */
+#define IW_AUTH_KEY_MGMT_802_1X 1
+#define IW_AUTH_KEY_MGMT_PSK 2
+
+/* IW_AUTH_80211_AUTH_ALG values (bit field) */
+#define IW_AUTH_ALG_OPEN_SYSTEM 0x00000001
+#define IW_AUTH_ALG_SHARED_KEY 0x00000002
+#define IW_AUTH_ALG_LEAP 0x00000004
+
+/* IW_AUTH_ROAMING_CONTROL values */
+#define IW_AUTH_ROAMING_ENABLE 0 /* driver/firmware based roaming */
+#define IW_AUTH_ROAMING_DISABLE 1 /* user space program used for roaming
+ * control */
+
+/* IW_AUTH_MFP (management frame protection) values */
+#define IW_AUTH_MFP_DISABLED 0 /* MFP disabled */
+#define IW_AUTH_MFP_OPTIONAL 1 /* MFP optional */
+#define IW_AUTH_MFP_REQUIRED 2 /* MFP required */
+
+/* SIOCSIWENCODEEXT definitions */
+#define IW_ENCODE_SEQ_MAX_SIZE 8
+/* struct iw_encode_ext ->alg */
+#define IW_ENCODE_ALG_NONE 0
+#define IW_ENCODE_ALG_WEP 1
+#define IW_ENCODE_ALG_TKIP 2
+#define IW_ENCODE_ALG_CCMP 3
+#define IW_ENCODE_ALG_PMK 4
+#define IW_ENCODE_ALG_AES_CMAC 5
+/* struct iw_encode_ext ->ext_flags */
+#define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001
+#define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002
+#define IW_ENCODE_EXT_GROUP_KEY 0x00000004
+#define IW_ENCODE_EXT_SET_TX_KEY 0x00000008
+
+/* IWEVMICHAELMICFAILURE : struct iw_michaelmicfailure ->flags */
+#define IW_MICFAILURE_KEY_ID 0x00000003 /* Key ID 0..3 */
+#define IW_MICFAILURE_GROUP 0x00000004
+#define IW_MICFAILURE_PAIRWISE 0x00000008
+#define IW_MICFAILURE_STAKEY 0x00000010
+#define IW_MICFAILURE_COUNT 0x00000060 /* 1 or 2 (0 = count not supported)
+ */
+
+/* Bit field values for enc_capa in struct iw_range */
+#define IW_ENC_CAPA_WPA 0x00000001
+#define IW_ENC_CAPA_WPA2 0x00000002
+#define IW_ENC_CAPA_CIPHER_TKIP 0x00000004
+#define IW_ENC_CAPA_CIPHER_CCMP 0x00000008
+#define IW_ENC_CAPA_4WAY_HANDSHAKE 0x00000010
+
+/* Event capability macros - in (struct iw_range *)->event_capa
+ * Because we have more than 32 possible events, we use an array of
+ * 32 bit bitmasks. Note : 32 bits = 0x20 = 2^5. */
+#define IW_EVENT_CAPA_BASE(cmd) ((cmd >= SIOCIWFIRSTPRIV) ? \
+ (cmd - SIOCIWFIRSTPRIV + 0x60) : \
+ (cmd - SIOCSIWCOMMIT))
+#define IW_EVENT_CAPA_INDEX(cmd) (IW_EVENT_CAPA_BASE(cmd) >> 5)
+#define IW_EVENT_CAPA_MASK(cmd) (1 << (IW_EVENT_CAPA_BASE(cmd) & 0x1F))
+/* Event capability constants - event autogenerated by the kernel
+ * This list is valid for most 802.11 devices, customise as needed... */
+#define IW_EVENT_CAPA_K_0 (IW_EVENT_CAPA_MASK(0x8B04) | \
+ IW_EVENT_CAPA_MASK(0x8B06) | \
+ IW_EVENT_CAPA_MASK(0x8B1A))
+#define IW_EVENT_CAPA_K_1 (IW_EVENT_CAPA_MASK(0x8B2A))
+/* "Easy" macro to set events in iw_range (less efficient) */
+#define IW_EVENT_CAPA_SET(event_capa, cmd) (event_capa[IW_EVENT_CAPA_INDEX(cmd)] |= IW_EVENT_CAPA_MASK(cmd))
+#define IW_EVENT_CAPA_SET_KERNEL(event_capa) {event_capa[0] |= IW_EVENT_CAPA_K_0; event_capa[1] |= IW_EVENT_CAPA_K_1; }
+
+
+/****************************** TYPES ******************************/
+
+/* --------------------------- SUBTYPES --------------------------- */
+/*
+ * Generic format for most parameters that fit in an int
+ */
+struct iw_param
+{
+ __s32 value; /* The value of the parameter itself */
+ __u8 fixed; /* Hardware should not use auto select */
+ __u8 disabled; /* Disable the feature */
+ __u16 flags; /* Various specifc flags (if any) */
+};
+
+/*
+ * For all data larger than 16 octets, we need to use a
+ * pointer to memory allocated in user space.
+ */
+struct iw_point
+{
+ void *pointer; /* Pointer to the data (in user space) */
+ __u16 length; /* number of fields or size in bytes */
+ __u16 flags; /* Optional params */
+};
+
+
+/*
+ * A frequency
+ * For numbers lower than 10^9, we encode the number in 'm' and
+ * set 'e' to 0
+ * For number greater than 10^9, we divide it by the lowest power
+ * of 10 to get 'm' lower than 10^9, with 'm'= f / (10^'e')...
+ * The power of 10 is in 'e', the result of the division is in 'm'.
+ */
+struct iw_freq
+{
+ __s32 m; /* Mantissa */
+ __s16 e; /* Exponent */
+ __u8 i; /* List index (when in range struct) */
+ __u8 flags; /* Flags (fixed/auto) */
+};
+
+/*
+ * Quality of the link
+ */
+struct iw_quality
+{
+ __u8 qual; /* link quality (%retries, SNR,
+ %missed beacons or better...) */
+ __u8 level; /* signal level (dBm) */
+ __u8 noise; /* noise level (dBm) */
+ __u8 updated; /* Flags to know if updated */
+};
+
+/*
+ * Packet discarded in the wireless adapter due to
+ * "wireless" specific problems...
+ * Note : the list of counter and statistics in net_device_stats
+ * is already pretty exhaustive, and you should use that first.
+ * This is only additional stats...
+ */
+struct iw_discarded
+{
+ __u32 nwid; /* Rx : Wrong nwid/essid */
+ __u32 code; /* Rx : Unable to code/decode (WEP) */
+ __u32 fragment; /* Rx : Can't perform MAC reassembly */
+ __u32 retries; /* Tx : Max MAC retries num reached */
+ __u32 misc; /* Others cases */
+};
+
+/*
+ * Packet/Time period missed in the wireless adapter due to
+ * "wireless" specific problems...
+ */
+struct iw_missed
+{
+ __u32 beacon; /* Missed beacons/superframe */
+};
+
+/*
+ * Quality range (for spy threshold)
+ */
+struct iw_thrspy
+{
+ struct sockaddr addr; /* Source address (hw/mac) */
+ struct iw_quality qual; /* Quality of the link */
+ struct iw_quality low; /* Low threshold */
+ struct iw_quality high; /* High threshold */
+};
+
+/*
+ * Optional data for scan request
+ *
+ * Note: these optional parameters are controlling parameters for the
+ * scanning behavior, these do not apply to getting scan results
+ * (SIOCGIWSCAN). Drivers are expected to keep a local BSS table and
+ * provide a merged results with all BSSes even if the previous scan
+ * request limited scanning to a subset, e.g., by specifying an SSID.
+ * Especially, scan results are required to include an entry for the
+ * current BSS if the driver is in Managed mode and associated with an AP.
+ */
+struct iw_scan_req
+{
+ __u8 scan_type; /* IW_SCAN_TYPE_{ACTIVE,PASSIVE} */
+ __u8 essid_len;
+ __u8 num_channels; /* num entries in channel_list;
+ * 0 = scan all allowed channels */
+ __u8 flags; /* reserved as padding; use zero, this may
+ * be used in the future for adding flags
+ * to request different scan behavior */
+ struct sockaddr bssid; /* ff:ff:ff:ff:ff:ff for broadcast BSSID or
+ * individual address of a specific BSS */
+
+ /*
+ * Use this ESSID if IW_SCAN_THIS_ESSID flag is used instead of using
+ * the current ESSID. This allows scan requests for specific ESSID
+ * without having to change the current ESSID and potentially breaking
+ * the current association.
+ */
+ __u8 essid[IW_ESSID_MAX_SIZE];
+
+ /*
+ * Optional parameters for changing the default scanning behavior.
+ * These are based on the MLME-SCAN.request from IEEE Std 802.11.
+ * TU is 1.024 ms. If these are set to 0, driver is expected to use
+ * reasonable default values. min_channel_time defines the time that
+ * will be used to wait for the first reply on each channel. If no
+ * replies are received, next channel will be scanned after this. If
+ * replies are received, total time waited on the channel is defined by
+ * max_channel_time.
+ */
+ __u32 min_channel_time; /* in TU */
+ __u32 max_channel_time; /* in TU */
+
+ struct iw_freq channel_list[IW_MAX_FREQUENCIES];
+};
+
+/* ------------------------- WPA SUPPORT ------------------------- */
+
+/*
+ * Extended data structure for get/set encoding (this is used with
+ * SIOCSIWENCODEEXT/SIOCGIWENCODEEXT. struct iw_point and IW_ENCODE_*
+ * flags are used in the same way as with SIOCSIWENCODE/SIOCGIWENCODE and
+ * only the data contents changes (key data -> this structure, including
+ * key data).
+ *
+ * If the new key is the first group key, it will be set as the default
+ * TX key. Otherwise, default TX key index is only changed if
+ * IW_ENCODE_EXT_SET_TX_KEY flag is set.
+ *
+ * Key will be changed with SIOCSIWENCODEEXT in all cases except for
+ * special "change TX key index" operation which is indicated by setting
+ * key_len = 0 and ext_flags |= IW_ENCODE_EXT_SET_TX_KEY.
+ *
+ * tx_seq/rx_seq are only used when respective
+ * IW_ENCODE_EXT_{TX,RX}_SEQ_VALID flag is set in ext_flags. Normal
+ * TKIP/CCMP operation is to set RX seq with SIOCSIWENCODEEXT and start
+ * TX seq from zero whenever key is changed. SIOCGIWENCODEEXT is normally
+ * used only by an Authenticator (AP or an IBSS station) to get the
+ * current TX sequence number. Using TX_SEQ_VALID for SIOCSIWENCODEEXT and
+ * RX_SEQ_VALID for SIOCGIWENCODEEXT are optional, but can be useful for
+ * debugging/testing.
+ */
+struct iw_encode_ext
+{
+ __u32 ext_flags; /* IW_ENCODE_EXT_* */
+ __u8 tx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
+ __u8 rx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
+ struct sockaddr addr; /* ff:ff:ff:ff:ff:ff for broadcast/multicast
+ * (group) keys or unicast address for
+ * individual keys */
+ __u16 alg; /* IW_ENCODE_ALG_* */
+ __u16 key_len;
+ __u8 key[0];
+};
+
+/* SIOCSIWMLME data */
+struct iw_mlme
+{
+ __u16 cmd; /* IW_MLME_* */
+ __u16 reason_code;
+ struct sockaddr addr;
+};
+
+/* SIOCSIWPMKSA data */
+#define IW_PMKSA_ADD 1
+#define IW_PMKSA_REMOVE 2
+#define IW_PMKSA_FLUSH 3
+
+#define IW_PMKID_LEN 16
+
+struct iw_pmksa
+{
+ __u32 cmd; /* IW_PMKSA_* */
+ struct sockaddr bssid;
+ __u8 pmkid[IW_PMKID_LEN];
+};
+
+/* IWEVMICHAELMICFAILURE data */
+struct iw_michaelmicfailure
+{
+ __u32 flags;
+ struct sockaddr src_addr;
+ __u8 tsc[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
+};
+
+/* IWEVPMKIDCAND data */
+#define IW_PMKID_CAND_PREAUTH 0x00000001 /* RNS pre-authentication enabled */
+struct iw_pmkid_cand
+{
+ __u32 flags; /* IW_PMKID_CAND_* */
+ __u32 index; /* the smaller the index, the higher the
+ * priority */
+ struct sockaddr bssid;
+};
+
+/* ------------------------ WIRELESS STATS ------------------------ */
+/*
+ * Wireless statistics (used for /proc/net/wireless)
+ */
+struct iw_statistics
+{
+ __u16 status; /* Status
+ * - device dependent for now */
+
+ struct iw_quality qual; /* Quality of the link
+ * (instant/mean/max) */
+ struct iw_discarded discard; /* Packet discarded counts */
+ struct iw_missed miss; /* Packet missed counts */
+};
+
+/* ------------------------ IOCTL REQUEST ------------------------ */
+/*
+ * This structure defines the payload of an ioctl, and is used
+ * below.
+ *
+ * Note that this structure should fit on the memory footprint
+ * of iwreq (which is the same as ifreq), which mean a max size of
+ * 16 octets = 128 bits. Warning, pointers might be 64 bits wide...
+ * You should check this when increasing the structures defined
+ * above in this file...
+ */
+union iwreq_data
+{
+ /* Config - generic */
+ char name[IFNAMSIZ];
+ /* Name : used to verify the presence of wireless extensions.
+ * Name of the protocol/provider... */
+
+ struct iw_point essid; /* Extended network name */
+ struct iw_param nwid; /* network id (or domain - the cell) */
+ struct iw_freq freq; /* frequency or channel :
+ * 0-1000 = channel
+ * > 1000 = frequency in Hz */
+
+ struct iw_param sens; /* signal level threshold */
+ struct iw_param bitrate; /* default bit rate */
+ struct iw_param txpower; /* default transmit power */
+ struct iw_param rts; /* RTS threshold threshold */
+ struct iw_param frag; /* Fragmentation threshold */
+ __u32 mode; /* Operation mode */
+ struct iw_param retry; /* Retry limits & lifetime */
+
+ struct iw_point encoding; /* Encoding stuff : tokens */
+ struct iw_param power; /* PM duration/timeout */
+ struct iw_quality qual; /* Quality part of statistics */
+
+ struct sockaddr ap_addr; /* Access point address */
+ struct sockaddr addr; /* Destination address (hw/mac) */
+
+ struct iw_param param; /* Other small parameters */
+ struct iw_point data; /* Other large parameters */
+};
+
+/*
+ * The structure to exchange data for ioctl.
+ * This structure is the same as 'struct ifreq', but (re)defined for
+ * convenience...
+ * Do I need to remind you about structure size (32 octets) ?
+ */
+struct iwreq
+{
+ union
+ {
+ char ifrn_name[IFNAMSIZ]; /* if name, e.g. "eth0" */
+ } ifr_ifrn;
+
+ /* Data part (defined just above) */
+ union iwreq_data u;
+};
+
+/* -------------------------- IOCTL DATA -------------------------- */
+/*
+ * For those ioctl which want to exchange mode data that what could
+ * fit in the above structure...
+ */
+
+/*
+ * Range of parameters
+ */
+
+struct iw_range
+{
+ /* Informative stuff (to choose between different interface) */
+ __u32 throughput; /* To give an idea... */
+ /* In theory this value should be the maximum benchmarked
+ * TCP/IP throughput, because with most of these devices the
+ * bit rate is meaningless (overhead an co) to estimate how
+ * fast the connection will go and pick the fastest one.
+ * I suggest people to play with Netperf or any benchmark...
+ */
+
+ /* NWID (or domain id) */
+ __u32 min_nwid; /* Minimal NWID we are able to set */
+ __u32 max_nwid; /* Maximal NWID we are able to set */
+
+ /* Old Frequency (backward compat - moved lower ) */
+ __u16 old_num_channels;
+ __u8 old_num_frequency;
+
+ /* Scan capabilities */
+ __u8 scan_capa; /* IW_SCAN_CAPA_* bit field */
+
+ /* Wireless event capability bitmasks */
+ __u32 event_capa[6];
+
+ /* signal level threshold range */
+ __s32 sensitivity;
+
+ /* Quality of link & SNR stuff */
+ /* Quality range (link, level, noise)
+ * If the quality is absolute, it will be in the range [0 ; max_qual],
+ * if the quality is dBm, it will be in the range [max_qual ; 0].
+ * Don't forget that we use 8 bit arithmetics... */
+ struct iw_quality max_qual; /* Quality of the link */
+ /* This should contain the average/typical values of the quality
+ * indicator. This should be the threshold between a "good" and
+ * a "bad" link (example : monitor going from green to orange).
+ * Currently, user space apps like quality monitors don't have any
+ * way to calibrate the measurement. With this, they can split
+ * the range between 0 and max_qual in different quality level
+ * (using a geometric subdivision centered on the average).
+ * I expect that people doing the user space apps will feedback
+ * us on which value we need to put in each driver... */
+ struct iw_quality avg_qual; /* Quality of the link */
+
+ /* Rates */
+ __u8 num_bitrates; /* Number of entries in the list */
+ __s32 bitrate[IW_MAX_BITRATES]; /* list, in bps */
+
+ /* RTS threshold */
+ __s32 min_rts; /* Minimal RTS threshold */
+ __s32 max_rts; /* Maximal RTS threshold */
+
+ /* Frag threshold */
+ __s32 min_frag; /* Minimal frag threshold */
+ __s32 max_frag; /* Maximal frag threshold */
+
+ /* Power Management duration & timeout */
+ __s32 min_pmp; /* Minimal PM period */
+ __s32 max_pmp; /* Maximal PM period */
+ __s32 min_pmt; /* Minimal PM timeout */
+ __s32 max_pmt; /* Maximal PM timeout */
+ __u16 pmp_flags; /* How to decode max/min PM period */
+ __u16 pmt_flags; /* How to decode max/min PM timeout */
+ __u16 pm_capa; /* What PM options are supported */
+
+ /* Encoder stuff */
+ __u16 encoding_size[IW_MAX_ENCODING_SIZES]; /* Different token sizes */
+ __u8 num_encoding_sizes; /* Number of entry in the list */
+ __u8 max_encoding_tokens; /* Max number of tokens */
+ /* For drivers that need a "login/passwd" form */
+ __u8 encoding_login_index; /* token index for login token */
+
+ /* Transmit power */
+ __u16 txpower_capa; /* What options are supported */
+ __u8 num_txpower; /* Number of entries in the list */
+ __s32 txpower[IW_MAX_TXPOWER]; /* list, in bps */
+
+ /* Wireless Extension version info */
+ __u8 we_version_compiled; /* Must be WIRELESS_EXT */
+ __u8 we_version_source; /* Last update of source */
+
+ /* Retry limits and lifetime */
+ __u16 retry_capa; /* What retry options are supported */
+ __u16 retry_flags; /* How to decode max/min retry limit */
+ __u16 r_time_flags; /* How to decode max/min retry life */
+ __s32 min_retry; /* Minimal number of retries */
+ __s32 max_retry; /* Maximal number of retries */
+ __s32 min_r_time; /* Minimal retry lifetime */
+ __s32 max_r_time; /* Maximal retry lifetime */
+
+ /* Frequency */
+ __u16 num_channels; /* Number of channels [0; num - 1] */
+ __u8 num_frequency; /* Number of entry in the list */
+ struct iw_freq freq[IW_MAX_FREQUENCIES]; /* list */
+ /* Note : this frequency list doesn't need to fit channel numbers,
+ * because each entry contain its channel index */
+
+ __u32 enc_capa; /* IW_ENC_CAPA_* bit field */
+};
+
+/*
+ * Private ioctl interface information
+ */
+
+struct iw_priv_args
+{
+ __u32 cmd; /* Number of the ioctl to issue */
+ __u16 set_args; /* Type and number of args */
+ __u16 get_args; /* Type and number of args */
+ char name[IFNAMSIZ]; /* Name of the extension */
+};
+
+/* ----------------------- WIRELESS EVENTS ----------------------- */
+/*
+ * Wireless events are carried through the rtnetlink socket to user
+ * space. They are encapsulated in the IFLA_WIRELESS field of
+ * a RTM_NEWLINK message.
+ */
+
+/*
+ * A Wireless Event. Contains basically the same data as the ioctl...
+ */
+struct iw_event
+{
+ __u16 len; /* Real length of this stuff */
+ __u16 cmd; /* Wireless IOCTL */
+ union iwreq_data u; /* IOCTL fixed payload */
+};
+
+/* Size of the Event prefix (including padding and alignement junk) */
+#define IW_EV_LCP_LEN (sizeof(struct iw_event) - sizeof(union iwreq_data))
+/* Size of the various events */
+#define IW_EV_CHAR_LEN (IW_EV_LCP_LEN + IFNAMSIZ)
+#define IW_EV_UINT_LEN (IW_EV_LCP_LEN + sizeof(__u32))
+#define IW_EV_FREQ_LEN (IW_EV_LCP_LEN + sizeof(struct iw_freq))
+#define IW_EV_PARAM_LEN (IW_EV_LCP_LEN + sizeof(struct iw_param))
+#define IW_EV_ADDR_LEN (IW_EV_LCP_LEN + sizeof(struct sockaddr))
+#define IW_EV_QUAL_LEN (IW_EV_LCP_LEN + sizeof(struct iw_quality))
+
+/* iw_point events are special. First, the payload (extra data) come at
+ * the end of the event, so they are bigger than IW_EV_POINT_LEN. Second,
+ * we omit the pointer, so start at an offset. */
+#define IW_EV_POINT_OFF (((char *) &(((struct iw_point *) NULL)->length)) - \
+ (char *) NULL)
+#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \
+ IW_EV_POINT_OFF)
+
+
+/* Size of the Event prefix when packed in stream */
+#define IW_EV_LCP_PK_LEN (4)
+/* Size of the various events when packed in stream */
+#define IW_EV_CHAR_PK_LEN (IW_EV_LCP_PK_LEN + IFNAMSIZ)
+#define IW_EV_UINT_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(__u32))
+#define IW_EV_FREQ_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_freq))
+#define IW_EV_PARAM_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_param))
+#define IW_EV_ADDR_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct sockaddr))
+#define IW_EV_QUAL_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_quality))
+#define IW_EV_POINT_PK_LEN (IW_EV_LCP_LEN + 4)
+
+#endif /* _LINUX_WIRELESS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/x25.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/x25.h
new file mode 100644
index 0000000..d035e4e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/x25.h
@@ -0,0 +1,150 @@
+/*
+ * These are the public elements of the Linux kernel X.25 implementation.
+ *
+ * History
+ * mar/20/00 Daniela Squassoni Disabling/enabling of facilities
+ * negotiation.
+ * apr/02/05 Shaun Pereira Selective sub address matching with
+ * call user data
+ */
+
+#ifndef X25_KERNEL_H
+#define X25_KERNEL_H
+
+#include <linux/types.h>
+
+#define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0)
+#define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1)
+#define SIOCX25GFACILITIES (SIOCPROTOPRIVATE + 2)
+#define SIOCX25SFACILITIES (SIOCPROTOPRIVATE + 3)
+#define SIOCX25GCALLUSERDATA (SIOCPROTOPRIVATE + 4)
+#define SIOCX25SCALLUSERDATA (SIOCPROTOPRIVATE + 5)
+#define SIOCX25GCAUSEDIAG (SIOCPROTOPRIVATE + 6)
+#define SIOCX25SCUDMATCHLEN (SIOCPROTOPRIVATE + 7)
+#define SIOCX25CALLACCPTAPPRV (SIOCPROTOPRIVATE + 8)
+#define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9)
+#define SIOCX25GDTEFACILITIES (SIOCPROTOPRIVATE + 10)
+#define SIOCX25SDTEFACILITIES (SIOCPROTOPRIVATE + 11)
+
+/*
+ * Values for {get,set}sockopt.
+ */
+#define X25_QBITINCL 1
+
+/*
+ * X.25 Packet Size values.
+ */
+#define X25_PS16 4
+#define X25_PS32 5
+#define X25_PS64 6
+#define X25_PS128 7
+#define X25_PS256 8
+#define X25_PS512 9
+#define X25_PS1024 10
+#define X25_PS2048 11
+#define X25_PS4096 12
+
+/*
+ * An X.121 address, it is held as ASCII text, null terminated, up to 15
+ * digits and a null terminator.
+ */
+struct x25_address {
+ char x25_addr[16];
+};
+
+/*
+ * Linux X.25 Address structure, used for bind, and connect mostly.
+ */
+struct sockaddr_x25 {
+ sa_family_t sx25_family; /* Must be AF_X25 */
+ struct x25_address sx25_addr; /* X.121 Address */
+};
+
+/*
+ * DTE/DCE subscription options.
+ *
+ * As this is missing lots of options, user should expect major
+ * changes of this structure in 2.5.x which might break compatibilty.
+ * The somewhat ugly dimension 200-sizeof() is needed to maintain
+ * backward compatibility.
+ */
+struct x25_subscrip_struct {
+ char device[200-sizeof(unsigned long)];
+ unsigned long global_facil_mask; /* 0 to disable negotiation */
+ unsigned int extended;
+};
+
+/* values for above global_facil_mask */
+
+#define X25_MASK_REVERSE 0x01
+#define X25_MASK_THROUGHPUT 0x02
+#define X25_MASK_PACKET_SIZE 0x04
+#define X25_MASK_WINDOW_SIZE 0x08
+
+#define X25_MASK_CALLING_AE 0x10
+#define X25_MASK_CALLED_AE 0x20
+
+
+/*
+ * Routing table control structure.
+ */
+struct x25_route_struct {
+ struct x25_address address;
+ unsigned int sigdigits;
+ char device[200];
+};
+
+/*
+ * Facilities structure.
+ */
+struct x25_facilities {
+ unsigned int winsize_in, winsize_out;
+ unsigned int pacsize_in, pacsize_out;
+ unsigned int throughput;
+ unsigned int reverse;
+};
+
+/*
+* ITU DTE facilities
+* Only the called and calling address
+* extension are currently implemented.
+* The rest are in place to avoid the struct
+* changing size if someone needs them later
+*/
+
+struct x25_dte_facilities {
+ __u16 delay_cumul;
+ __u16 delay_target;
+ __u16 delay_max;
+ __u8 min_throughput;
+ __u8 expedited;
+ __u8 calling_len;
+ __u8 called_len;
+ __u8 calling_ae[20];
+ __u8 called_ae[20];
+};
+
+/*
+ * Call User Data structure.
+ */
+struct x25_calluserdata {
+ unsigned int cudlength;
+ unsigned char cuddata[128];
+};
+
+/*
+ * Call clearing Cause and Diagnostic structure.
+ */
+struct x25_causediag {
+ unsigned char cause;
+ unsigned char diagnostic;
+};
+
+/*
+ * Further optional call user data match length selection
+ */
+struct x25_subaddr {
+ unsigned int cudmatchlength;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/xattr.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/xattr.h
new file mode 100644
index 0000000..82ca33c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/xattr.h
@@ -0,0 +1,17 @@
+/*
+ File: linux/xattr.h
+
+ Extended attributes handling.
+
+ Copyright (C) 2001 by Andreas Gruenbacher <a.gruenbacher@computer.org>
+ Copyright (c) 2001-2002 Silicon Graphics, Inc. All Rights Reserved.
+ Copyright (c) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com>
+*/
+#ifndef _LINUX_XATTR_H
+#define _LINUX_XATTR_H
+
+#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */
+#define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */
+
+
+#endif /* _LINUX_XATTR_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/xfrm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/xfrm.h
new file mode 100644
index 0000000..a59bc4a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/linux/xfrm.h
@@ -0,0 +1,483 @@
+#ifndef _LINUX_XFRM_H
+#define _LINUX_XFRM_H
+
+#include <linux/types.h>
+
+/* All of the structures in this file may not change size as they are
+ * passed into the kernel from userspace via netlink sockets.
+ */
+
+/* Structure to encapsulate addresses. I do not want to use
+ * "standard" structure. My apologies.
+ */
+typedef union
+{
+ __be32 a4;
+ __be32 a6[4];
+} xfrm_address_t;
+
+/* Ident of a specific xfrm_state. It is used on input to lookup
+ * the state by (spi,daddr,ah/esp) or to store information about
+ * spi, protocol and tunnel address on output.
+ */
+struct xfrm_id
+{
+ xfrm_address_t daddr;
+ __be32 spi;
+ __u8 proto;
+};
+
+struct xfrm_sec_ctx {
+ __u8 ctx_doi;
+ __u8 ctx_alg;
+ __u16 ctx_len;
+ __u32 ctx_sid;
+ char ctx_str[0];
+};
+
+/* Security Context Domains of Interpretation */
+#define XFRM_SC_DOI_RESERVED 0
+#define XFRM_SC_DOI_LSM 1
+
+/* Security Context Algorithms */
+#define XFRM_SC_ALG_RESERVED 0
+#define XFRM_SC_ALG_SELINUX 1
+
+/* Selector, used as selector both on policy rules (SPD) and SAs. */
+
+struct xfrm_selector
+{
+ xfrm_address_t daddr;
+ xfrm_address_t saddr;
+ __be16 dport;
+ __be16 dport_mask;
+ __be16 sport;
+ __be16 sport_mask;
+ __u16 family;
+ __u8 prefixlen_d;
+ __u8 prefixlen_s;
+ __u8 proto;
+ int ifindex;
+ __kernel_uid32_t user;
+};
+
+#define XFRM_INF (~(__u64)0)
+
+struct xfrm_lifetime_cfg
+{
+ __u64 soft_byte_limit;
+ __u64 hard_byte_limit;
+ __u64 soft_packet_limit;
+ __u64 hard_packet_limit;
+ __u64 soft_add_expires_seconds;
+ __u64 hard_add_expires_seconds;
+ __u64 soft_use_expires_seconds;
+ __u64 hard_use_expires_seconds;
+};
+
+struct xfrm_lifetime_cur
+{
+ __u64 bytes;
+ __u64 packets;
+ __u64 add_time;
+ __u64 use_time;
+};
+
+struct xfrm_replay_state
+{
+ __u32 oseq;
+ __u32 seq;
+ __u32 bitmap;
+};
+
+struct xfrm_algo {
+ char alg_name[64];
+ unsigned int alg_key_len; /* in bits */
+ char alg_key[0];
+};
+
+struct xfrm_algo_aead {
+ char alg_name[64];
+ unsigned int alg_key_len; /* in bits */
+ unsigned int alg_icv_len; /* in bits */
+ char alg_key[0];
+};
+
+struct xfrm_stats {
+ __u32 replay_window;
+ __u32 replay;
+ __u32 integrity_failed;
+};
+
+enum
+{
+ XFRM_POLICY_TYPE_MAIN = 0,
+ XFRM_POLICY_TYPE_SUB = 1,
+ XFRM_POLICY_TYPE_MAX = 2,
+ XFRM_POLICY_TYPE_ANY = 255
+};
+
+enum
+{
+ XFRM_POLICY_IN = 0,
+ XFRM_POLICY_OUT = 1,
+ XFRM_POLICY_FWD = 2,
+ XFRM_POLICY_MASK = 3,
+ XFRM_POLICY_MAX = 3
+};
+
+enum
+{
+ XFRM_SHARE_ANY, /* No limitations */
+ XFRM_SHARE_SESSION, /* For this session only */
+ XFRM_SHARE_USER, /* For this user only */
+ XFRM_SHARE_UNIQUE /* Use once */
+};
+
+#define XFRM_MODE_TRANSPORT 0
+#define XFRM_MODE_TUNNEL 1
+#define XFRM_MODE_ROUTEOPTIMIZATION 2
+#define XFRM_MODE_IN_TRIGGER 3
+#define XFRM_MODE_BEET 4
+#define XFRM_MODE_MAX 5
+
+/* Netlink configuration messages. */
+enum {
+ XFRM_MSG_BASE = 0x10,
+
+ XFRM_MSG_NEWSA = 0x10,
+#define XFRM_MSG_NEWSA XFRM_MSG_NEWSA
+ XFRM_MSG_DELSA,
+#define XFRM_MSG_DELSA XFRM_MSG_DELSA
+ XFRM_MSG_GETSA,
+#define XFRM_MSG_GETSA XFRM_MSG_GETSA
+
+ XFRM_MSG_NEWPOLICY,
+#define XFRM_MSG_NEWPOLICY XFRM_MSG_NEWPOLICY
+ XFRM_MSG_DELPOLICY,
+#define XFRM_MSG_DELPOLICY XFRM_MSG_DELPOLICY
+ XFRM_MSG_GETPOLICY,
+#define XFRM_MSG_GETPOLICY XFRM_MSG_GETPOLICY
+
+ XFRM_MSG_ALLOCSPI,
+#define XFRM_MSG_ALLOCSPI XFRM_MSG_ALLOCSPI
+ XFRM_MSG_ACQUIRE,
+#define XFRM_MSG_ACQUIRE XFRM_MSG_ACQUIRE
+ XFRM_MSG_EXPIRE,
+#define XFRM_MSG_EXPIRE XFRM_MSG_EXPIRE
+
+ XFRM_MSG_UPDPOLICY,
+#define XFRM_MSG_UPDPOLICY XFRM_MSG_UPDPOLICY
+ XFRM_MSG_UPDSA,
+#define XFRM_MSG_UPDSA XFRM_MSG_UPDSA
+
+ XFRM_MSG_POLEXPIRE,
+#define XFRM_MSG_POLEXPIRE XFRM_MSG_POLEXPIRE
+
+ XFRM_MSG_FLUSHSA,
+#define XFRM_MSG_FLUSHSA XFRM_MSG_FLUSHSA
+ XFRM_MSG_FLUSHPOLICY,
+#define XFRM_MSG_FLUSHPOLICY XFRM_MSG_FLUSHPOLICY
+
+ XFRM_MSG_NEWAE,
+#define XFRM_MSG_NEWAE XFRM_MSG_NEWAE
+ XFRM_MSG_GETAE,
+#define XFRM_MSG_GETAE XFRM_MSG_GETAE
+
+ XFRM_MSG_REPORT,
+#define XFRM_MSG_REPORT XFRM_MSG_REPORT
+
+ XFRM_MSG_MIGRATE,
+#define XFRM_MSG_MIGRATE XFRM_MSG_MIGRATE
+
+ XFRM_MSG_NEWSADINFO,
+#define XFRM_MSG_NEWSADINFO XFRM_MSG_NEWSADINFO
+ XFRM_MSG_GETSADINFO,
+#define XFRM_MSG_GETSADINFO XFRM_MSG_GETSADINFO
+
+ XFRM_MSG_NEWSPDINFO,
+#define XFRM_MSG_NEWSPDINFO XFRM_MSG_NEWSPDINFO
+ XFRM_MSG_GETSPDINFO,
+#define XFRM_MSG_GETSPDINFO XFRM_MSG_GETSPDINFO
+
+ XFRM_MSG_MAPPING,
+#define XFRM_MSG_MAPPING XFRM_MSG_MAPPING
+ __XFRM_MSG_MAX
+};
+#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1)
+
+#define XFRM_NR_MSGTYPES (XFRM_MSG_MAX + 1 - XFRM_MSG_BASE)
+
+/*
+ * Generic LSM security context for comunicating to user space
+ * NOTE: Same format as sadb_x_sec_ctx
+ */
+struct xfrm_user_sec_ctx {
+ __u16 len;
+ __u16 exttype;
+ __u8 ctx_alg; /* LSMs: e.g., selinux == 1 */
+ __u8 ctx_doi;
+ __u16 ctx_len;
+};
+
+struct xfrm_user_tmpl {
+ struct xfrm_id id;
+ __u16 family;
+ xfrm_address_t saddr;
+ __u32 reqid;
+ __u8 mode;
+ __u8 share;
+ __u8 optional;
+ __u32 aalgos;
+ __u32 ealgos;
+ __u32 calgos;
+};
+
+struct xfrm_encap_tmpl {
+ __u16 encap_type;
+ __be16 encap_sport;
+ __be16 encap_dport;
+ xfrm_address_t encap_oa;
+};
+
+/* AEVENT flags */
+enum xfrm_ae_ftype_t {
+ XFRM_AE_UNSPEC,
+ XFRM_AE_RTHR=1, /* replay threshold*/
+ XFRM_AE_RVAL=2, /* replay value */
+ XFRM_AE_LVAL=4, /* lifetime value */
+ XFRM_AE_ETHR=8, /* expiry timer threshold */
+ XFRM_AE_CR=16, /* Event cause is replay update */
+ XFRM_AE_CE=32, /* Event cause is timer expiry */
+ XFRM_AE_CU=64, /* Event cause is policy update */
+ __XFRM_AE_MAX
+
+#define XFRM_AE_MAX (__XFRM_AE_MAX - 1)
+};
+
+struct xfrm_userpolicy_type {
+ __u8 type;
+ __u16 reserved1;
+ __u8 reserved2;
+};
+
+/* Netlink message attributes. */
+enum xfrm_attr_type_t {
+ XFRMA_UNSPEC,
+ XFRMA_ALG_AUTH, /* struct xfrm_algo */
+ XFRMA_ALG_CRYPT, /* struct xfrm_algo */
+ XFRMA_ALG_COMP, /* struct xfrm_algo */
+ XFRMA_ENCAP, /* struct xfrm_algo + struct xfrm_encap_tmpl */
+ XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */
+ XFRMA_SA,
+ XFRMA_POLICY,
+ XFRMA_SEC_CTX, /* struct xfrm_sec_ctx */
+ XFRMA_LTIME_VAL,
+ XFRMA_REPLAY_VAL,
+ XFRMA_REPLAY_THRESH,
+ XFRMA_ETIMER_THRESH,
+ XFRMA_SRCADDR, /* xfrm_address_t */
+ XFRMA_COADDR, /* xfrm_address_t */
+ XFRMA_LASTUSED,
+ XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */
+ XFRMA_MIGRATE,
+ XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */
+ XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */
+ __XFRMA_MAX
+
+#define XFRMA_MAX (__XFRMA_MAX - 1)
+};
+
+enum xfrm_sadattr_type_t {
+ XFRMA_SAD_UNSPEC,
+ XFRMA_SAD_CNT,
+ XFRMA_SAD_HINFO,
+ __XFRMA_SAD_MAX
+
+#define XFRMA_SAD_MAX (__XFRMA_SAD_MAX - 1)
+};
+
+struct xfrmu_sadhinfo {
+ __u32 sadhcnt; /* current hash bkts */
+ __u32 sadhmcnt; /* max allowed hash bkts */
+};
+
+enum xfrm_spdattr_type_t {
+ XFRMA_SPD_UNSPEC,
+ XFRMA_SPD_INFO,
+ XFRMA_SPD_HINFO,
+ __XFRMA_SPD_MAX
+
+#define XFRMA_SPD_MAX (__XFRMA_SPD_MAX - 1)
+};
+
+struct xfrmu_spdinfo {
+ __u32 incnt;
+ __u32 outcnt;
+ __u32 fwdcnt;
+ __u32 inscnt;
+ __u32 outscnt;
+ __u32 fwdscnt;
+};
+
+struct xfrmu_spdhinfo {
+ __u32 spdhcnt;
+ __u32 spdhmcnt;
+};
+
+struct xfrm_usersa_info {
+ struct xfrm_selector sel;
+ struct xfrm_id id;
+ xfrm_address_t saddr;
+ struct xfrm_lifetime_cfg lft;
+ struct xfrm_lifetime_cur curlft;
+ struct xfrm_stats stats;
+ __u32 seq;
+ __u32 reqid;
+ __u16 family;
+ __u8 mode; /* XFRM_MODE_xxx */
+ __u8 replay_window;
+ __u8 flags;
+#define XFRM_STATE_NOECN 1
+#define XFRM_STATE_DECAP_DSCP 2
+#define XFRM_STATE_NOPMTUDISC 4
+#define XFRM_STATE_WILDRECV 8
+#define XFRM_STATE_ICMP 16
+#define XFRM_STATE_AF_UNSPEC 32
+};
+
+struct xfrm_usersa_id {
+ xfrm_address_t daddr;
+ __be32 spi;
+ __u16 family;
+ __u8 proto;
+};
+
+struct xfrm_aevent_id {
+ struct xfrm_usersa_id sa_id;
+ xfrm_address_t saddr;
+ __u32 flags;
+ __u32 reqid;
+};
+
+struct xfrm_userspi_info {
+ struct xfrm_usersa_info info;
+ __u32 min;
+ __u32 max;
+};
+
+struct xfrm_userpolicy_info {
+ struct xfrm_selector sel;
+ struct xfrm_lifetime_cfg lft;
+ struct xfrm_lifetime_cur curlft;
+ __u32 priority;
+ __u32 index;
+ __u8 dir;
+ __u8 action;
+#define XFRM_POLICY_ALLOW 0
+#define XFRM_POLICY_BLOCK 1
+ __u8 flags;
+#define XFRM_POLICY_LOCALOK 1 /* Allow user to override global policy */
+ /* Automatically expand selector to include matching ICMP payloads. */
+#define XFRM_POLICY_ICMP 2
+ __u8 share;
+};
+
+struct xfrm_userpolicy_id {
+ struct xfrm_selector sel;
+ __u32 index;
+ __u8 dir;
+};
+
+struct xfrm_user_acquire {
+ struct xfrm_id id;
+ xfrm_address_t saddr;
+ struct xfrm_selector sel;
+ struct xfrm_userpolicy_info policy;
+ __u32 aalgos;
+ __u32 ealgos;
+ __u32 calgos;
+ __u32 seq;
+};
+
+struct xfrm_user_expire {
+ struct xfrm_usersa_info state;
+ __u8 hard;
+};
+
+struct xfrm_user_polexpire {
+ struct xfrm_userpolicy_info pol;
+ __u8 hard;
+};
+
+struct xfrm_usersa_flush {
+ __u8 proto;
+};
+
+struct xfrm_user_report {
+ __u8 proto;
+ struct xfrm_selector sel;
+};
+
+/* Used by MIGRATE to pass addresses IKE should use to perform
+ * SA negotiation with the peer */
+struct xfrm_user_kmaddress {
+ xfrm_address_t local;
+ xfrm_address_t remote;
+ __u32 reserved;
+ __u16 family;
+};
+
+struct xfrm_user_migrate {
+ xfrm_address_t old_daddr;
+ xfrm_address_t old_saddr;
+ xfrm_address_t new_daddr;
+ xfrm_address_t new_saddr;
+ __u8 proto;
+ __u8 mode;
+ __u16 reserved;
+ __u32 reqid;
+ __u16 old_family;
+ __u16 new_family;
+};
+
+struct xfrm_user_mapping {
+ struct xfrm_usersa_id id;
+ __u32 reqid;
+ xfrm_address_t old_saddr;
+ xfrm_address_t new_saddr;
+ __be16 old_sport;
+ __be16 new_sport;
+};
+
+/* backwards compatibility for userspace */
+#define XFRMGRP_ACQUIRE 1
+#define XFRMGRP_EXPIRE 2
+#define XFRMGRP_SA 4
+#define XFRMGRP_POLICY 8
+#define XFRMGRP_REPORT 0x20
+
+enum xfrm_nlgroups {
+ XFRMNLGRP_NONE,
+#define XFRMNLGRP_NONE XFRMNLGRP_NONE
+ XFRMNLGRP_ACQUIRE,
+#define XFRMNLGRP_ACQUIRE XFRMNLGRP_ACQUIRE
+ XFRMNLGRP_EXPIRE,
+#define XFRMNLGRP_EXPIRE XFRMNLGRP_EXPIRE
+ XFRMNLGRP_SA,
+#define XFRMNLGRP_SA XFRMNLGRP_SA
+ XFRMNLGRP_POLICY,
+#define XFRMNLGRP_POLICY XFRMNLGRP_POLICY
+ XFRMNLGRP_AEVENTS,
+#define XFRMNLGRP_AEVENTS XFRMNLGRP_AEVENTS
+ XFRMNLGRP_REPORT,
+#define XFRMNLGRP_REPORT XFRMNLGRP_REPORT
+ XFRMNLGRP_MIGRATE,
+#define XFRMNLGRP_MIGRATE XFRMNLGRP_MIGRATE
+ XFRMNLGRP_MAPPING,
+#define XFRMNLGRP_MAPPING XFRMNLGRP_MAPPING
+ __XFRMNLGRP_MAX
+};
+#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1)
+
+#endif /* _LINUX_XFRM_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/locale.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/locale.h
new file mode 100644
index 0000000..02d33a0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/locale.h
@@ -0,0 +1,225 @@
+/* Copyright (C) 1991,92,95-99,2000,01,02 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.11 Localization <locale.h>
+ */
+
+#ifndef _LOCALE_H
+#define _LOCALE_H 1
+
+#include <features.h>
+
+#define __need_NULL
+#include <stddef.h>
+#include <bits/uClibc_locale.h>
+
+__BEGIN_DECLS
+
+/* These are the possibilities for the first argument to setlocale.
+ The code assumes that the lowest LC_* symbol has the value zero. */
+#define LC_CTYPE __LC_CTYPE
+#define LC_NUMERIC __LC_NUMERIC
+#define LC_TIME __LC_TIME
+#define LC_COLLATE __LC_COLLATE
+#define LC_MONETARY __LC_MONETARY
+#define LC_MESSAGES __LC_MESSAGES
+#if 0
+#define LC_PAPER __LC_PAPER
+#define LC_NAME __LC_NAME
+#define LC_ADDRESS __LC_ADDRESS
+#define LC_TELEPHONE __LC_TELEPHONE
+#define LC_MEASUREMENT __LC_MEASUREMENT
+#define LC_IDENTIFICATION __LC_IDENTIFICATION
+#endif
+#define LC_ALL __LC_ALL
+
+
+/* Structure giving information about numeric and monetary notation. */
+struct lconv
+{
+ /* Numeric (non-monetary) information. */
+
+ char *decimal_point; /* Decimal point character. */
+ char *thousands_sep; /* Thousands separator. */
+ /* Each element is the number of digits in each group;
+ elements with higher indices are farther left.
+ An element with value CHAR_MAX means that no further grouping is done.
+ An element with value 0 means that the previous element is used
+ for all groups farther left. */
+ char *grouping;
+
+ /* Monetary information. */
+
+ /* First three chars are a currency symbol from ISO 4217.
+ Fourth char is the separator. Fifth char is '\0'. */
+ char *int_curr_symbol;
+ char *currency_symbol; /* Local currency symbol. */
+ char *mon_decimal_point; /* Decimal point character. */
+ char *mon_thousands_sep; /* Thousands separator. */
+ char *mon_grouping; /* Like `grouping' element (above). */
+ char *positive_sign; /* Sign for positive values. */
+ char *negative_sign; /* Sign for negative values. */
+ char int_frac_digits; /* Int'l fractional digits. */
+ char frac_digits; /* Local fractional digits. */
+ /* 1 if currency_symbol precedes a positive value, 0 if succeeds. */
+ char p_cs_precedes;
+ /* 1 iff a space separates currency_symbol from a positive value. */
+ char p_sep_by_space;
+ /* 1 if currency_symbol precedes a negative value, 0 if succeeds. */
+ char n_cs_precedes;
+ /* 1 iff a space separates currency_symbol from a negative value. */
+ char n_sep_by_space;
+ /* Positive and negative sign positions:
+ 0 Parentheses surround the quantity and currency_symbol.
+ 1 The sign string precedes the quantity and currency_symbol.
+ 2 The sign string follows the quantity and currency_symbol.
+ 3 The sign string immediately precedes the currency_symbol.
+ 4 The sign string immediately follows the currency_symbol. */
+ char p_sign_posn;
+ char n_sign_posn;
+#ifdef __USE_ISOC99
+ /* 1 if int_curr_symbol precedes a positive value, 0 if succeeds. */
+ char int_p_cs_precedes;
+ /* 1 iff a space separates int_curr_symbol from a positive value. */
+ char int_p_sep_by_space;
+ /* 1 if int_curr_symbol precedes a negative value, 0 if succeeds. */
+ char int_n_cs_precedes;
+ /* 1 iff a space separates int_curr_symbol from a negative value. */
+ char int_n_sep_by_space;
+ /* Positive and negative sign positions:
+ 0 Parentheses surround the quantity and int_curr_symbol.
+ 1 The sign string precedes the quantity and int_curr_symbol.
+ 2 The sign string follows the quantity and int_curr_symbol.
+ 3 The sign string immediately precedes the int_curr_symbol.
+ 4 The sign string immediately follows the int_curr_symbol. */
+ char int_p_sign_posn;
+ char int_n_sign_posn;
+#else
+ char __int_p_cs_precedes;
+ char __int_p_sep_by_space;
+ char __int_n_cs_precedes;
+ char __int_n_sep_by_space;
+ char __int_p_sign_posn;
+ char __int_n_sign_posn;
+#endif
+};
+
+
+__BEGIN_NAMESPACE_STD
+
+/* Set and/or return the current locale. */
+extern char *setlocale (int __category, __const char *__locale) __THROW;
+
+/* Return the numeric/monetary information for the current locale. */
+extern struct lconv *localeconv (void) __THROW;
+
+__END_NAMESPACE_STD
+
+
+#if defined(__USE_GNU) && defined(__UCLIBC_HAS_XLOCALE__)
+/* The concept of one static locale per category is not very well
+ thought out. Many applications will need to process its data using
+ information from several different locales. Another application is
+ the implementation of the internationalization handling in the
+ upcoming ISO C++ standard library. To support this another set of
+ the functions using locale data exist which have an additional
+ argument.
+
+ Attention: all these functions are *not* standardized in any form.
+ This is a proof-of-concept implementation. */
+
+/* Get locale datatype definition. */
+# include <xlocale.h>
+
+typedef __locale_t locale_t;
+
+/* Return a reference to a data structure representing a set of locale
+ datasets. Unlike for the CATEGORY parameter for `setlocale' the
+ CATEGORY_MASK parameter here uses a single bit for each category,
+ made by OR'ing together LC_*_MASK bits above. */
+extern __locale_t newlocale (int __category_mask, __const char *__locale,
+ __locale_t __base) __THROW;
+
+/* These are the bits that can be set in the CATEGORY_MASK argument to
+ `newlocale'. In the GNU implementation, LC_FOO_MASK has the value
+ of (1 << LC_FOO), but this is not a part of the interface that
+ callers can assume will be true. */
+# define LC_CTYPE_MASK (1 << __LC_CTYPE)
+# define LC_NUMERIC_MASK (1 << __LC_NUMERIC)
+# define LC_TIME_MASK (1 << __LC_TIME)
+# define LC_COLLATE_MASK (1 << __LC_COLLATE)
+# define LC_MONETARY_MASK (1 << __LC_MONETARY)
+# define LC_MESSAGES_MASK (1 << __LC_MESSAGES)
+#ifdef L_newlocale
+#warning mask defines for extra locale categories
+#endif /* L_newlocale - uClibc note */
+#ifdef LC_PAPER
+# define LC_PAPER_MASK (1 << __LC_PAPER)
+# define LC_NAME_MASK (1 << __LC_NAME)
+# define LC_ADDRESS_MASK (1 << __LC_ADDRESS)
+# define LC_TELEPHONE_MASK (1 << __LC_TELEPHONE)
+# define LC_MEASUREMENT_MASK (1 << __LC_MEASUREMENT)
+# define LC_IDENTIFICATION_MASK (1 << __LC_IDENTIFICATION)
+# define LC_ALL_MASK (LC_CTYPE_MASK \
+ | LC_NUMERIC_MASK \
+ | LC_TIME_MASK \
+ | LC_COLLATE_MASK \
+ | LC_MONETARY_MASK \
+ | LC_MESSAGES_MASK \
+ | LC_PAPER_MASK \
+ | LC_NAME_MASK \
+ | LC_ADDRESS_MASK \
+ | LC_TELEPHONE_MASK \
+ | LC_MEASUREMENT_MASK \
+ | LC_IDENTIFICATION_MASK \
+ )
+#else /* LC_PAPER */
+# define LC_ALL_MASK (LC_CTYPE_MASK \
+ | LC_NUMERIC_MASK \
+ | LC_TIME_MASK \
+ | LC_COLLATE_MASK \
+ | LC_MONETARY_MASK \
+ | LC_MESSAGES_MASK \
+ )
+#endif /* LC_PAPER */
+
+/* Return a duplicate of the set of locale in DATASET. All usage
+ counters are increased if necessary. */
+extern __locale_t duplocale (__locale_t __dataset) __THROW;
+
+/* Free the data associated with a locale dataset previously returned
+ by a call to `setlocale_r'. */
+extern void freelocale (__locale_t __dataset) __THROW;
+
+/* Switch the current thread's locale to DATASET.
+ If DATASET is null, instead just return the current setting.
+ The special value LC_GLOBAL_LOCALE is the initial setting
+ for all threads and can also be installed any time, meaning
+ the thread uses the global settings controlled by `setlocale'. */
+extern __locale_t uselocale (__locale_t __dataset) __THROW;
+
+/* This value can be passed to `uselocale' and may be returned by it.
+ Passing this value to any other function has undefined behavior. */
+# define LC_GLOBAL_LOCALE ((__locale_t) -1L)
+
+#endif
+
+__END_DECLS
+
+#endif /* locale.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/malloc.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/malloc.h
new file mode 100644
index 0000000..354f153
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/malloc.h
@@ -0,0 +1,191 @@
+/* Prototypes and definition for malloc implementation.
+ Copyright (C) 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MALLOC_H
+#define _MALLOC_H 1
+
+#include <features.h>
+
+/*
+ `ptmalloc', a malloc implementation for multiple threads without
+ lock contention, by Wolfram Gloger <wmglo@dent.med.uni-muenchen.de>.
+ See the files `ptmalloc.c' or `COPYRIGHT' for copying conditions.
+
+ VERSION 2.6.4-pt Wed Dec 4 00:35:54 MET 1996
+
+ This work is mainly derived from malloc-2.6.4 by Doug Lea
+ <dl@cs.oswego.edu>, which is available from:
+
+ ftp://g.oswego.edu/pub/misc/malloc.c
+
+ This trimmed-down header file only provides function prototypes and
+ the exported data structures. For more detailed function
+ descriptions and compile-time options, see the source file
+ `ptmalloc.c'.
+*/
+
+#if defined(__STDC__) || defined (__cplusplus)
+# include <stddef.h>
+# define __malloc_ptr_t void *
+#else
+# undef size_t
+# define size_t unsigned int
+# undef ptrdiff_t
+# define ptrdiff_t int
+# define __malloc_ptr_t char *
+#endif
+
+#ifdef _LIBC
+/* Used by GNU libc internals. */
+# define __malloc_size_t size_t
+# define __malloc_ptrdiff_t ptrdiff_t
+#elif !defined __attribute_malloc__
+# define __attribute_malloc__
+#endif
+
+#ifdef __GNUC__
+
+/* GCC can always grok prototypes. For C++ programs we add throw()
+ to help it optimize the function calls. But this works only with
+ gcc 2.8.x and egcs. */
+#ifndef __THROW
+# if defined __cplusplus && (__GNUC__ >= 3 || __GNUC_MINOR__ >= 8)
+# define __THROW throw ()
+# else
+# define __THROW
+# endif
+#endif
+# define __MALLOC_P(args) args __THROW
+/* This macro will be used for functions which might take C++ callback
+ functions. */
+# define __MALLOC_PMT(args) args
+
+#else /* Not GCC. */
+
+# define __THROW
+
+# if (defined __STDC__ && __STDC__) || defined __cplusplus
+
+# define __MALLOC_P(args) args
+# define __MALLOC_PMT(args) args
+
+# else /* Not ANSI C or C++. */
+
+# define __MALLOC_P(args) () /* No prototypes. */
+# define __MALLOC_PMT(args) ()
+
+# endif /* ANSI C or C++. */
+
+#endif /* GCC. */
+
+#ifndef NULL
+# ifdef __cplusplus
+# define NULL 0
+# else
+# define NULL ((__malloc_ptr_t) 0)
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Allocate SIZE bytes of memory. */
+extern __malloc_ptr_t malloc __MALLOC_P ((size_t __size)) __attribute_malloc__;
+
+/* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */
+extern __malloc_ptr_t calloc __MALLOC_P ((size_t __nmemb, size_t __size))
+ __attribute_malloc__;
+
+/* Re-allocate the previously allocated block in __ptr, making the new
+ block SIZE bytes long. */
+extern __malloc_ptr_t realloc __MALLOC_P ((__malloc_ptr_t __ptr,
+ size_t __size))
+ __attribute_malloc__;
+
+/* Free a block allocated by `malloc', `realloc' or `calloc'. */
+extern void free __MALLOC_P ((__malloc_ptr_t __ptr));
+
+/* Allocate SIZE bytes allocated to ALIGNMENT bytes. */
+extern __malloc_ptr_t memalign __MALLOC_P ((size_t __alignment, size_t __size));
+
+/* Allocate SIZE bytes on a page boundary. */
+extern __malloc_ptr_t valloc __MALLOC_P ((size_t __size)) __attribute_malloc__;
+
+#ifdef __MALLOC_STANDARD__
+
+/* SVID2/XPG mallinfo structure */
+struct mallinfo {
+ int arena; /* total space allocated from system */
+ int ordblks; /* number of non-inuse chunks */
+ int smblks; /* unused -- always zero */
+ int hblks; /* number of mmapped regions */
+ int hblkhd; /* total space in mmapped regions */
+ int usmblks; /* unused -- always zero */
+ int fsmblks; /* unused -- always zero */
+ int uordblks; /* total allocated space */
+ int fordblks; /* total non-inuse space */
+ int keepcost; /* top-most, releasable (via malloc_trim) space */
+};
+
+/* Returns a copy of the updated current mallinfo. */
+extern struct mallinfo mallinfo __MALLOC_P ((void));
+
+/* Release all but __pad bytes of freed top-most memory back to the
+ system. Return 1 if successful, else 0. */
+extern int malloc_trim(size_t pad);
+
+#include <stdio.h>
+/* Prints brief summary statistics to the specified file.
+ * Writes to stderr if file is NULL. */
+extern void malloc_stats(FILE *file);
+
+/* SVID2/XPG mallopt options */
+#ifndef M_MXFAST
+# define M_MXFAST 1 /* UNUSED in this malloc */
+#endif
+#ifndef M_NLBLKS
+# define M_NLBLKS 2 /* UNUSED in this malloc */
+#endif
+#ifndef M_GRAIN
+# define M_GRAIN 3 /* UNUSED in this malloc */
+#endif
+#ifndef M_KEEP
+# define M_KEEP 4 /* UNUSED in this malloc */
+#endif
+
+/* mallopt options that actually do something */
+#define M_TRIM_THRESHOLD -1
+#define M_TOP_PAD -2
+#define M_MMAP_THRESHOLD -3
+#define M_MMAP_MAX -4
+#define M_CHECK_ACTION -5
+#define M_PERTURB -6
+
+/* General SVID/XPG interface to tunable parameters. */
+extern int mallopt __MALLOC_P ((int __param, int __val));
+
+#endif /* __MALLOC_STANDARD__ */
+
+
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+
+#endif /* malloc.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/math.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/math.h
new file mode 100644
index 0000000..c50b2e7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/math.h
@@ -0,0 +1,468 @@
+/* Declarations for math functions.
+ Copyright (C) 1991-1993, 1995-1999, 2001, 2002, 2004, 2006
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.12 Mathematics <math.h>
+ */
+
+#ifndef _MATH_H
+#define _MATH_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Get machine-dependent HUGE_VAL value (returned on overflow).
+ On all IEEE754 machines, this is +Infinity. */
+#include <bits/huge_val.h>
+#ifdef __USE_ISOC99
+# include <bits/huge_valf.h>
+# include <bits/huge_vall.h>
+
+/* Get machine-dependent INFINITY value. */
+# include <bits/inf.h>
+
+/* Get machine-dependent NAN value (returned for some domain errors). */
+# include <bits/nan.h>
+#endif /* __USE_ISOC99 */
+
+/* Get general and ISO C99 specific information. */
+#include <bits/mathdef.h>
+
+/* The file <bits/mathcalls.h> contains the prototypes for all the
+ actual math functions. These macros are used for those prototypes,
+ so we can easily declare each function as both `name' and `__name',
+ and can declare the float versions `namef' and `__namef'. */
+
+#define __MATHCALL(function,suffix, args) \
+ __MATHDECL (_Mdouble_,function,suffix, args)
+#define __MATHDECL(type, function,suffix, args) \
+ __MATHDECL_1(type, function,suffix, args); \
+ __MATHDECL_1(type, __CONCAT(__,function),suffix, args)
+#define __MATHCALLX(function,suffix, args, attrib) \
+ __MATHDECLX (_Mdouble_,function,suffix, args, attrib)
+#define __MATHDECLX(type, function,suffix, args, attrib) \
+ __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \
+ __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib)
+#define __MATHDECL_1(type, function,suffix, args) \
+ extern type __MATH_PRECNAME(function,suffix) args __THROW
+
+#define _Mdouble_ double
+#define __MATH_PRECNAME(name,r) __CONCAT(name,r)
+# define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_STD
+# define _Mdouble_END_NAMESPACE __END_NAMESPACE_STD
+#include <bits/mathcalls.h>
+#undef _Mdouble_
+#undef _Mdouble_BEGIN_NAMESPACE
+#undef _Mdouble_END_NAMESPACE
+#undef __MATH_PRECNAME
+
+#if defined __USE_MISC || defined __USE_ISOC99
+
+
+/* Include the file of declarations again, this time using `float'
+ instead of `double' and appending f to each function name. */
+
+# ifndef _Mfloat_
+# define _Mfloat_ float
+# endif
+# define _Mdouble_ _Mfloat_
+# ifdef __STDC__
+# define __MATH_PRECNAME(name,r) name##f##r
+# else
+# define __MATH_PRECNAME(name,r) name/**/f/**/r
+# endif
+# define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99
+# define _Mdouble_END_NAMESPACE __END_NAMESPACE_C99
+# include <bits/mathcalls.h>
+# undef _Mdouble_
+# undef _Mdouble_BEGIN_NAMESPACE
+# undef _Mdouble_END_NAMESPACE
+# undef __MATH_PRECNAME
+
+# if (__STDC__ - 0 || __GNUC__ - 0) \
+ && (!defined __NO_LONG_DOUBLE_MATH || defined __LDBL_COMPAT)
+# ifdef __LDBL_COMPAT
+
+# ifdef __USE_ISOC99
+extern float __nldbl_nexttowardf (float __x, long double __y)
+ __THROW __attribute__ ((__const__));
+# ifdef __REDIRECT_NTH
+extern float __REDIRECT_NTH (nexttowardf, (float __x, long double __y),
+ __nldbl_nexttowardf)
+ __attribute__ ((__const__));
+extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y),
+ nextafter) __attribute__ ((__const__));
+extern long double __REDIRECT_NTH (nexttowardl,
+ (long double __x, long double __y),
+ nextafter) __attribute__ ((__const__));
+# endif
+# endif
+
+/* Include the file of declarations again, this time using `long double'
+ instead of `double' and appending l to each function name. */
+
+# undef __MATHDECL_1
+# define __MATHDECL_2(type, function,suffix, args, alias) \
+ extern type __REDIRECT_NTH(__MATH_PRECNAME(function,suffix), \
+ args, alias)
+# define __MATHDECL_1(type, function,suffix, args) \
+ __MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix))
+# endif
+
+# ifndef _Mlong_double_
+# define _Mlong_double_ long double
+# endif
+# define _Mdouble_ _Mlong_double_
+# ifdef __STDC__
+# define __MATH_PRECNAME(name,r) name##l##r
+# else
+# define __MATH_PRECNAME(name,r) name/**/l/**/r
+# endif
+# define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99
+# define _Mdouble_END_NAMESPACE __END_NAMESPACE_C99
+# include <bits/mathcalls.h>
+# undef _Mdouble_
+# undef _Mdouble_BEGIN_NAMESPACE
+# undef _Mdouble_END_NAMESPACE
+# undef __MATH_PRECNAME
+
+# endif /* __STDC__ || __GNUC__ */
+
+#endif /* Use misc or ISO C99. */
+#undef __MATHDECL_1
+#undef __MATHDECL
+#undef __MATHCALL
+
+
+#if defined __USE_MISC || defined __USE_XOPEN
+/* This variable is used by `gamma' and `lgamma'. */
+extern int signgam;
+#endif
+
+
+/* ISO C99 defines some generic macros which work on any data type. */
+#ifdef __USE_ISOC99
+
+/* Get the architecture specific values describing the floating-point
+ evaluation. The following symbols will get defined:
+
+ float_t floating-point type at least as wide as `float' used
+ to evaluate `float' expressions
+ double_t floating-point type at least as wide as `double' used
+ to evaluate `double' expressions
+
+ FLT_EVAL_METHOD
+ Defined to
+ 0 if `float_t' is `float' and `double_t' is `double'
+ 1 if `float_t' and `double_t' are `double'
+ 2 if `float_t' and `double_t' are `long double'
+ else `float_t' and `double_t' are unspecified
+
+ INFINITY representation of the infinity value of type `float'
+
+ FP_FAST_FMA
+ FP_FAST_FMAF
+ FP_FAST_FMAL
+ If defined it indicates that the `fma' function
+ generally executes about as fast as a multiply and an add.
+ This macro is defined only iff the `fma' function is
+ implemented directly with a hardware multiply-add instructions.
+
+ FP_ILOGB0 Expands to a value returned by `ilogb (0.0)'.
+ FP_ILOGBNAN Expands to a value returned by `ilogb (NAN)'.
+
+ DECIMAL_DIG Number of decimal digits supported by conversion between
+ decimal and all internal floating-point formats.
+
+*/
+
+/* All floating-point numbers can be put in one of these categories. */
+enum
+ {
+ FP_NAN,
+# define FP_NAN FP_NAN
+ FP_INFINITE,
+# define FP_INFINITE FP_INFINITE
+ FP_ZERO,
+# define FP_ZERO FP_ZERO
+ FP_SUBNORMAL,
+# define FP_SUBNORMAL FP_SUBNORMAL
+ FP_NORMAL
+# define FP_NORMAL FP_NORMAL
+ };
+
+/* Return number of classification appropriate for X. */
+# ifdef __NO_LONG_DOUBLE_MATH
+# define fpclassify(x) \
+ (sizeof (x) == sizeof (float) ? __fpclassifyf (x) : __fpclassify (x))
+# else
+# define fpclassify(x) \
+ (sizeof (x) == sizeof (float) \
+ ? __fpclassifyf (x) \
+ : sizeof (x) == sizeof (double) \
+ ? __fpclassify (x) : __fpclassifyl (x))
+# endif
+
+/* Return nonzero value if sign of X is negative. */
+# ifdef __NO_LONG_DOUBLE_MATH
+# define signbit(x) \
+ (sizeof (x) == sizeof (float) ? __signbitf (x) : __signbit (x))
+# else
+# define signbit(x) \
+ (sizeof (x) == sizeof (float) \
+ ? __signbitf (x) \
+ : sizeof (x) == sizeof (double) \
+ ? __signbit (x) : __signbitl (x))
+# endif
+
+/* Return nonzero value if X is not +-Inf or NaN. */
+# ifdef __NO_LONG_DOUBLE_MATH
+# define isfinite(x) \
+ (sizeof (x) == sizeof (float) ? __finitef (x) : __finite (x))
+# else
+# define isfinite(x) \
+ (sizeof (x) == sizeof (float) \
+ ? __finitef (x) \
+ : sizeof (x) == sizeof (double) \
+ ? __finite (x) : __finitel (x))
+# endif
+
+/* Return nonzero value if X is neither zero, subnormal, Inf, nor NaN. */
+# define isnormal(x) (fpclassify (x) == FP_NORMAL)
+
+/* Return nonzero value if X is a NaN. We could use `fpclassify' but
+ we already have this functions `__isnan' and it is faster. */
+# ifdef __NO_LONG_DOUBLE_MATH
+# define isnan(x) \
+ (sizeof (x) == sizeof (float) ? __isnanf (x) : __isnan (x))
+# else
+# define isnan(x) \
+ (sizeof (x) == sizeof (float) \
+ ? __isnanf (x) \
+ : sizeof (x) == sizeof (double) \
+ ? __isnan (x) : __isnanl (x))
+# endif
+
+/* Return nonzero value is X is positive or negative infinity. */
+# ifdef __NO_LONG_DOUBLE_MATH
+# define isinf(x) \
+ (sizeof (x) == sizeof (float) ? __isinff (x) : __isinf (x))
+# else
+# define isinf(x) \
+ (sizeof (x) == sizeof (float) \
+ ? __isinff (x) \
+ : sizeof (x) == sizeof (double) \
+ ? __isinf (x) : __isinfl (x))
+# endif
+
+/* Bitmasks for the math_errhandling macro. */
+# define MATH_ERRNO 1 /* errno set by math functions. */
+# define MATH_ERREXCEPT 2 /* Exceptions raised by math functions. */
+
+#endif /* Use ISO C99. */
+
+#ifdef __USE_MISC
+/* Support for various different standard error handling behaviors. */
+typedef enum
+{
+ _IEEE_ = -1, /* According to IEEE 754/IEEE 854. */
+ _SVID_, /* According to System V, release 4. */
+ _XOPEN_, /* Nowadays also Unix98. */
+ _POSIX_,
+ _ISOC_ /* Actually this is ISO C99. */
+} _LIB_VERSION_TYPE;
+
+/* This variable can be changed at run-time to any of the values above to
+ affect floating point error handling behavior (it may also be necessary
+ to change the hardware FPU exception settings). */
+extern _LIB_VERSION_TYPE _LIB_VERSION;
+#endif
+
+
+#ifdef __USE_SVID
+/* In SVID error handling, `matherr' is called with this description
+ of the exceptional condition.
+
+ We have a problem when using C++ since `exception' is a reserved
+ name in C++. */
+# ifdef __cplusplus
+struct __exception
+# else
+struct exception
+# endif
+ {
+ int type;
+ char *name;
+ double arg1;
+ double arg2;
+ double retval;
+ };
+
+# ifdef __cplusplus
+extern int matherr (struct __exception *__exc) throw ();
+# else
+extern int matherr (struct exception *__exc);
+# endif
+
+# define X_TLOSS 1.41484755040568800000e+16
+
+/* Types of exceptions in the `type' field. */
+# define DOMAIN 1
+# define SING 2
+# define OVERFLOW 3
+# define UNDERFLOW 4
+# define TLOSS 5
+# define PLOSS 6
+
+/* SVID mode specifies returning this large value instead of infinity. */
+# define HUGE 3.40282347e+38F
+
+#else /* !SVID */
+
+# ifdef __USE_XOPEN
+/* X/Open wants another strange constant. */
+# define MAXFLOAT 3.40282347e+38F
+# endif
+
+#endif /* SVID */
+
+
+/* Some useful constants. */
+#if defined __USE_BSD || defined __USE_XOPEN
+# define M_E 2.7182818284590452354 /* e */
+# define M_LOG2E 1.4426950408889634074 /* log_2 e */
+# define M_LOG10E 0.43429448190325182765 /* log_10 e */
+# define M_LN2 0.69314718055994530942 /* log_e 2 */
+# define M_LN10 2.30258509299404568402 /* log_e 10 */
+# define M_PI 3.14159265358979323846 /* pi */
+# define M_PI_2 1.57079632679489661923 /* pi/2 */
+# define M_PI_4 0.78539816339744830962 /* pi/4 */
+# define M_1_PI 0.31830988618379067154 /* 1/pi */
+# define M_2_PI 0.63661977236758134308 /* 2/pi */
+# define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
+# define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
+# define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
+#endif
+
+/* The above constants are not adequate for computation using `long double's.
+ Therefore we provide as an extension constants with similar names as a
+ GNU extension. Provide enough digits for the 128-bit IEEE quad. */
+#ifdef __USE_GNU
+# define M_El 2.7182818284590452353602874713526625L /* e */
+# define M_LOG2El 1.4426950408889634073599246810018921L /* log_2 e */
+# define M_LOG10El 0.4342944819032518276511289189166051L /* log_10 e */
+# define M_LN2l 0.6931471805599453094172321214581766L /* log_e 2 */
+# define M_LN10l 2.3025850929940456840179914546843642L /* log_e 10 */
+# define M_PIl 3.1415926535897932384626433832795029L /* pi */
+# define M_PI_2l 1.5707963267948966192313216916397514L /* pi/2 */
+# define M_PI_4l 0.7853981633974483096156608458198757L /* pi/4 */
+# define M_1_PIl 0.3183098861837906715377675267450287L /* 1/pi */
+# define M_2_PIl 0.6366197723675813430755350534900574L /* 2/pi */
+# define M_2_SQRTPIl 1.1283791670955125738961589031215452L /* 2/sqrt(pi) */
+# define M_SQRT2l 1.4142135623730950488016887242096981L /* sqrt(2) */
+# define M_SQRT1_2l 0.7071067811865475244008443621048490L /* 1/sqrt(2) */
+#endif
+
+
+/* When compiling in strict ISO C compatible mode we must not use the
+ inline functions since they, among other things, do not set the
+ `errno' variable correctly. */
+#if defined __STRICT_ANSI__ && !defined __NO_MATH_INLINES
+# define __NO_MATH_INLINES 1
+#endif
+
+#if defined __USE_ISOC99 && __GNUC_PREREQ(2,97)
+/* ISO C99 defines some macros to compare number while taking care for
+ unordered numbers. Many FPUs provide special instructions to support
+ these operations. Generic support in GCC for these as builtins went
+ in before 3.0.0, but not all cpus added their patterns. We define
+ versions that use the builtins here, and <bits/mathinline.h> will
+ undef/redefine as appropriate for the specific GCC version in use. */
+# define isgreater(x, y) __builtin_isgreater(x, y)
+# define isgreaterequal(x, y) __builtin_isgreaterequal(x, y)
+# define isless(x, y) __builtin_isless(x, y)
+# define islessequal(x, y) __builtin_islessequal(x, y)
+# define islessgreater(x, y) __builtin_islessgreater(x, y)
+# define isunordered(u, v) __builtin_isunordered(u, v)
+#endif
+
+/* Get machine-dependent inline versions (if there are any). */
+#ifdef __USE_EXTERN_INLINES
+# include <bits/mathinline.h>
+#endif
+
+#ifdef __USE_ISOC99
+/* If we've still got undefined comparison macros, provide defaults. */
+
+/* Return nonzero value if X is greater than Y. */
+# ifndef isgreater
+# define isgreater(x, y) \
+ (__extension__ \
+ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
+ !isunordered (__x, __y) && __x > __y; }))
+# endif
+
+/* Return nonzero value if X is greater than or equal to Y. */
+# ifndef isgreaterequal
+# define isgreaterequal(x, y) \
+ (__extension__ \
+ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
+ !isunordered (__x, __y) && __x >= __y; }))
+# endif
+
+/* Return nonzero value if X is less than Y. */
+# ifndef isless
+# define isless(x, y) \
+ (__extension__ \
+ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
+ !isunordered (__x, __y) && __x < __y; }))
+# endif
+
+/* Return nonzero value if X is less than or equal to Y. */
+# ifndef islessequal
+# define islessequal(x, y) \
+ (__extension__ \
+ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
+ !isunordered (__x, __y) && __x <= __y; }))
+# endif
+
+/* Return nonzero value if either X is less than Y or Y is less than X. */
+# ifndef islessgreater
+# define islessgreater(x, y) \
+ (__extension__ \
+ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
+ !isunordered (__x, __y) && (__x < __y || __y < __x); }))
+# endif
+
+/* Return nonzero value if arguments are unordered. */
+# ifndef isunordered
+# define isunordered(u, v) \
+ (__extension__ \
+ ({ __typeof__(u) __u = (u); __typeof__(v) __v = (v); \
+ fpclassify (__u) == FP_NAN || fpclassify (__v) == FP_NAN; }))
+# endif
+
+#endif
+
+__END_DECLS
+
+
+#endif /* math.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/memory.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/memory.h
new file mode 100644
index 0000000..743fa6a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/memory.h
@@ -0,0 +1,34 @@
+/* Copyright (C) 1991, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * SVID
+ */
+
+#ifndef _MEMORY_H
+#define _MEMORY_H 1
+
+#include <features.h>
+
+
+#ifndef _STRING_H
+# include <string.h>
+#endif /* string.h */
+
+
+#endif /* memory.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/mntent.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/mntent.h
new file mode 100644
index 0000000..a82e953
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/mntent.h
@@ -0,0 +1,98 @@
+/* Utilities for reading/writing fstab, mtab, etc.
+ Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MNTENT_H
+#define _MNTENT_H 1
+
+#include <features.h>
+#define __need_FILE
+#include <stdio.h>
+#include <paths.h>
+
+
+/* File listing canonical interesting mount points. */
+#define MNTTAB _PATH_MNTTAB /* Deprecated alias. */
+
+/* File listing currently active mount points. */
+#define MOUNTED _PATH_MOUNTED /* Deprecated alias. */
+
+
+/* General filesystem types. */
+#define MNTTYPE_IGNORE "ignore" /* Ignore this entry. */
+#define MNTTYPE_NFS "nfs" /* Network file system. */
+#define MNTTYPE_SWAP "swap" /* Swap device. */
+
+
+/* Generic mount options. */
+#define MNTOPT_DEFAULTS "defaults" /* Use all default options. */
+#define MNTOPT_RO "ro" /* Read only. */
+#define MNTOPT_RW "rw" /* Read/write. */
+#define MNTOPT_SUID "suid" /* Set uid allowed. */
+#define MNTOPT_NOSUID "nosuid" /* No set uid allowed. */
+#define MNTOPT_NOAUTO "noauto" /* Do not auto mount. */
+
+
+__BEGIN_DECLS
+
+/* Structure describing a mount table entry. */
+struct mntent
+ {
+ char *mnt_fsname; /* Device or server for filesystem. */
+ char *mnt_dir; /* Directory mounted on. */
+ char *mnt_type; /* Type of filesystem: ufs, nfs, etc. */
+ char *mnt_opts; /* Comma-separated options for fs. */
+ int mnt_freq; /* Dump frequency (in days). */
+ int mnt_passno; /* Pass number for `fsck'. */
+ };
+
+
+/* Prepare to begin reading and/or writing mount table entries from the
+ beginning of FILE. MODE is as for `fopen'. */
+extern FILE *setmntent (__const char *__file, __const char *__mode) __THROW;
+
+/* Read one mount table entry from STREAM. Returns a pointer to storage
+ reused on the next call, or null for EOF or error (use feof/ferror to
+ check). */
+extern struct mntent *getmntent (FILE *__stream) __THROW;
+
+#ifdef __USE_MISC
+/* Reentrant version of the above function. */
+extern struct mntent *getmntent_r (FILE *__restrict __stream,
+ struct mntent *__restrict __result,
+ char *__restrict __buffer,
+ int __bufsize) __THROW;
+#endif
+
+/* Write the mount table entry described by MNT to STREAM.
+ Return zero on success, nonzero on failure. */
+extern int addmntent (FILE *__restrict __stream,
+ __const struct mntent *__restrict __mnt) __THROW;
+
+/* Close a stream opened with `setmntent'. */
+extern int endmntent (FILE *__stream) __THROW;
+
+/* Search MNT->mnt_opts for an option matching OPT.
+ Returns the address of the substring, or null if none found. */
+extern char *hasmntopt (__const struct mntent *__mnt,
+ __const char *__opt) __THROW;
+
+
+__END_DECLS
+
+#endif /* mntent.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/mqueue.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/mqueue.h
new file mode 100644
index 0000000..1ccad5b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/mqueue.h
@@ -0,0 +1,90 @@
+/* Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MQUEUE_H
+#define _MQUEUE_H 1
+
+#include <features.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#define __need_sigevent_t
+#include <bits/siginfo.h>
+#define __need_timespec
+#include <time.h>
+/* Get the definition of mqd_t and struct mq_attr. */
+#include <bits/mqueue.h>
+
+__BEGIN_DECLS
+
+/* Establish connection between a process and a message queue NAME and
+ return message queue descriptor or (mqd_t) -1 on error. OFLAG determines
+ the type of access used. If O_CREAT is on OFLAG, the third argument is
+ taken as a `mode_t', the mode of the created message queue, and the fourth
+ argument is taken as `struct mq_attr *', pointer to message queue
+ attributes. If the fourth argument is NULL, default attributes are
+ used. */
+extern mqd_t mq_open (const char *__name, int __oflag, ...) __THROW;
+
+/* Removes the association between message queue descriptor MQDES and its
+ message queue. */
+extern int mq_close (mqd_t __mqdes) __THROW;
+
+/* Query status and attributes of message queue MQDES. */
+extern int mq_getattr (mqd_t __mqdes, struct mq_attr *__mqstat) __THROW;
+
+/* Set attributes associated with message queue MQDES and if OMQSTAT is
+ not NULL also query its old attributes. */
+extern int mq_setattr (mqd_t __mqdes,
+ const struct mq_attr *__restrict __mqstat,
+ struct mq_attr *__restrict __omqstat) __THROW;
+
+/* Remove message queue named NAME. */
+extern int mq_unlink (const char *__name) __THROW;
+
+/* Register notification issued upon message arrival to an empty
+ message queue MQDES. */
+extern int mq_notify (mqd_t __mqdes, const struct sigevent *__notification)
+ __THROW;
+
+/* Receive the oldest from highest priority messages in message queue
+ MQDES. */
+extern ssize_t mq_receive (mqd_t __mqdes, char *__msg_ptr, size_t __msg_len,
+ unsigned int *__msg_prio);
+
+/* Add message pointed by MSG_PTR to message queue MQDES. */
+extern int mq_send (mqd_t __mqdes, const char *__msg_ptr, size_t __msg_len,
+ unsigned int __msg_prio);
+
+#ifdef __USE_XOPEN2K
+/* Receive the oldest from highest priority messages in message queue
+ MQDES, stop waiting if ABS_TIMEOUT expires. */
+extern ssize_t mq_timedreceive (mqd_t __mqdes, char *__restrict __msg_ptr,
+ size_t __msg_len,
+ unsigned int *__restrict __msg_prio,
+ const struct timespec *__restrict __abs_timeout);
+
+/* Add message pointed by MSG_PTR to message queue MQDES, stop blocking
+ on full message queue if ABS_TIMEOUT expires. */
+extern int mq_timedsend (mqd_t __mqdes, const char *__msg_ptr,
+ size_t __msg_len, unsigned int __msg_prio,
+ const struct timespec *__abs_timeout);
+#endif
+
+__END_DECLS
+
+#endif /* mqueue.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/..install.cmd
new file mode 100644
index 0000000..a7bd1c4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/mtd/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/mtd /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/mtd mips inftl-user.h jffs2-user.h mtd-abi.h mtd-user.h nftl-user.h ubi-user.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/mtd /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/mtd mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/mtd/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/inftl-user.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/inftl-user.h
new file mode 100644
index 0000000..8376bd1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/inftl-user.h
@@ -0,0 +1,91 @@
+/*
+ * Parts of INFTL headers shared with userspace
+ *
+ */
+
+#ifndef __MTD_INFTL_USER_H__
+#define __MTD_INFTL_USER_H__
+
+#include <linux/types.h>
+
+#define OSAK_VERSION 0x5120
+#define PERCENTUSED 98
+
+#define SECTORSIZE 512
+
+/* Block Control Information */
+
+struct inftl_bci {
+ __u8 ECCsig[6];
+ __u8 Status;
+ __u8 Status1;
+} __attribute__((packed));
+
+struct inftl_unithead1 {
+ __u16 virtualUnitNo;
+ __u16 prevUnitNo;
+ __u8 ANAC;
+ __u8 NACs;
+ __u8 parityPerField;
+ __u8 discarded;
+} __attribute__((packed));
+
+struct inftl_unithead2 {
+ __u8 parityPerField;
+ __u8 ANAC;
+ __u16 prevUnitNo;
+ __u16 virtualUnitNo;
+ __u8 NACs;
+ __u8 discarded;
+} __attribute__((packed));
+
+struct inftl_unittail {
+ __u8 Reserved[4];
+ __u16 EraseMark;
+ __u16 EraseMark1;
+} __attribute__((packed));
+
+union inftl_uci {
+ struct inftl_unithead1 a;
+ struct inftl_unithead2 b;
+ struct inftl_unittail c;
+};
+
+struct inftl_oob {
+ struct inftl_bci b;
+ union inftl_uci u;
+};
+
+
+/* INFTL Media Header */
+
+struct INFTLPartition {
+ __u32 virtualUnits;
+ __u32 firstUnit;
+ __u32 lastUnit;
+ __u32 flags;
+ __u32 spareUnits;
+ __u32 Reserved0;
+ __u32 Reserved1;
+} __attribute__((packed));
+
+struct INFTLMediaHeader {
+ char bootRecordID[8];
+ __u32 NoOfBootImageBlocks;
+ __u32 NoOfBinaryPartitions;
+ __u32 NoOfBDTLPartitions;
+ __u32 BlockMultiplierBits;
+ __u32 FormatFlags;
+ __u32 OsakVersion;
+ __u32 PercentUsed;
+ struct INFTLPartition Partitions[4];
+} __attribute__((packed));
+
+/* Partition flag types */
+#define INFTL_BINARY 0x20000000
+#define INFTL_BDTL 0x40000000
+#define INFTL_LAST 0x80000000
+
+#endif /* __MTD_INFTL_USER_H__ */
+
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/jffs2-user.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/jffs2-user.h
new file mode 100644
index 0000000..fa94b0e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/jffs2-user.h
@@ -0,0 +1,34 @@
+/*
+ * JFFS2 definitions for use in user space only
+ */
+
+#ifndef __JFFS2_USER_H__
+#define __JFFS2_USER_H__
+
+/* This file is blessed for inclusion by userspace */
+#include <linux/jffs2.h>
+#include <linux/types.h>
+#include <endian.h>
+#include <byteswap.h>
+
+#undef cpu_to_je16
+#undef cpu_to_je32
+#undef cpu_to_jemode
+#undef je16_to_cpu
+#undef je32_to_cpu
+#undef jemode_to_cpu
+
+extern int target_endian;
+
+#define t16(x) ({ __u16 __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_16(__b); })
+#define t32(x) ({ __u32 __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_32(__b); })
+
+#define cpu_to_je16(x) ((jint16_t){t16(x)})
+#define cpu_to_je32(x) ((jint32_t){t32(x)})
+#define cpu_to_jemode(x) ((jmode_t){t32(x)})
+
+#define je16_to_cpu(x) (t16((x).v16))
+#define je32_to_cpu(x) (t32((x).v32))
+#define jemode_to_cpu(x) (t32((x).m))
+
+#endif /* __JFFS2_USER_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/mtd-abi.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/mtd-abi.h
new file mode 100644
index 0000000..bda76db
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/mtd-abi.h
@@ -0,0 +1,152 @@
+/*
+ * Portions of MTD ABI definition which are shared by kernel and user space
+ */
+
+#ifndef __MTD_ABI_H__
+#define __MTD_ABI_H__
+
+#include <linux/types.h>
+
+struct erase_info_user {
+ __u32 start;
+ __u32 length;
+};
+
+struct mtd_oob_buf {
+ __u32 start;
+ __u32 length;
+ unsigned char *ptr;
+};
+
+#define MTD_ABSENT 0
+#define MTD_RAM 1
+#define MTD_ROM 2
+#define MTD_NORFLASH 3
+#define MTD_NANDFLASH 4
+#define MTD_DATAFLASH 6
+#define MTD_UBIVOLUME 7
+
+#define MTD_WRITEABLE 0x400 /* Device is writeable */
+#define MTD_BIT_WRITEABLE 0x800 /* Single bits can be flipped */
+#define MTD_NO_ERASE 0x1000 /* No erase necessary */
+#define MTD_POWERUP_LOCK 0x2000 /* Always locked after reset */
+
+// Some common devices / combinations of capabilities
+#define MTD_CAP_ROM 0
+#define MTD_CAP_RAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE)
+#define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE)
+#define MTD_CAP_NANDFLASH (MTD_WRITEABLE)
+
+/* ECC byte placement */
+#define MTD_NANDECC_OFF 0 // Switch off ECC (Not recommended)
+#define MTD_NANDECC_PLACE 1 // Use the given placement in the structure (YAFFS1 legacy mode)
+#define MTD_NANDECC_AUTOPLACE 2 // Use the default placement scheme
+#define MTD_NANDECC_PLACEONLY 3 // Use the given placement in the structure (Do not store ecc result on read)
+#define MTD_NANDECC_AUTOPL_USR 4 // Use the given autoplacement scheme rather than using the default
+
+/* OTP mode selection */
+#define MTD_OTP_OFF 0
+#define MTD_OTP_FACTORY 1
+#define MTD_OTP_USER 2
+
+struct mtd_info_user {
+ __u8 type;
+ __u32 flags;
+ __u32 size; // Total size of the MTD
+ __u32 erasesize;
+ __u32 writesize;
+ __u32 oobsize; // Amount of OOB data per block (e.g. 16)
+ /* The below two fields are obsolete and broken, do not use them
+ * (TODO: remove at some point) */
+ __u32 ecctype;
+ __u32 eccsize;
+};
+
+struct region_info_user {
+ __u32 offset; /* At which this region starts,
+ * from the beginning of the MTD */
+ __u32 erasesize; /* For this region */
+ __u32 numblocks; /* Number of blocks in this region */
+ __u32 regionindex;
+};
+
+struct otp_info {
+ __u32 start;
+ __u32 length;
+ __u32 locked;
+};
+
+#define MEMGETINFO _IOR('M', 1, struct mtd_info_user)
+#define MEMERASE _IOW('M', 2, struct erase_info_user)
+#define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf)
+#define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf)
+#define MEMLOCK _IOW('M', 5, struct erase_info_user)
+#define MEMUNLOCK _IOW('M', 6, struct erase_info_user)
+#define MEMGETREGIONCOUNT _IOR('M', 7, int)
+#define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user)
+#define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo)
+#define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo)
+#define MEMGETBADBLOCK _IOW('M', 11, __kernel_loff_t)
+#define MEMSETBADBLOCK _IOW('M', 12, __kernel_loff_t)
+#define OTPSELECT _IOR('M', 13, int)
+#define OTPGETREGIONCOUNT _IOW('M', 14, int)
+#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info)
+#define OTPLOCK _IOR('M', 16, struct otp_info)
+#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout)
+#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats)
+#define MTDFILEMODE _IO('M', 19)
+
+/*
+ * Obsolete legacy interface. Keep it in order not to break userspace
+ * interfaces
+ */
+struct nand_oobinfo {
+ __u32 useecc;
+ __u32 eccbytes;
+ __u32 oobfree[8][2];
+ __u32 eccpos[32];
+};
+
+struct nand_oobfree {
+ __u32 offset;
+ __u32 length;
+};
+
+#define MTD_MAX_OOBFREE_ENTRIES 8
+/*
+ * ECC layout control structure. Exported to userspace for
+ * diagnosis and to allow creation of raw images
+ */
+struct nand_ecclayout {
+ __u32 eccbytes;
+ __u32 eccpos[64];
+ __u32 oobavail;
+ struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES];
+};
+
+/**
+ * struct mtd_ecc_stats - error correction stats
+ *
+ * @corrected: number of corrected bits
+ * @failed: number of uncorrectable errors
+ * @badblocks: number of bad blocks in this partition
+ * @bbtblocks: number of blocks reserved for bad block tables
+ */
+struct mtd_ecc_stats {
+ __u32 corrected;
+ __u32 failed;
+ __u32 badblocks;
+ __u32 bbtblocks;
+};
+
+/*
+ * Read/write file modes for access to MTD
+ */
+enum mtd_file_modes {
+ MTD_MODE_NORMAL = MTD_OTP_OFF,
+ MTD_MODE_OTP_FACTORY = MTD_OTP_FACTORY,
+ MTD_MODE_OTP_USER = MTD_OTP_USER,
+ MTD_MODE_RAW,
+};
+
+#endif /* __MTD_ABI_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/mtd-user.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/mtd-user.h
new file mode 100644
index 0000000..170ceca
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/mtd-user.h
@@ -0,0 +1,19 @@
+/*
+ * MTD ABI header for use by user space only.
+ */
+
+#ifndef __MTD_USER_H__
+#define __MTD_USER_H__
+
+#include <stdint.h>
+
+/* This file is blessed for inclusion by userspace */
+#include <mtd/mtd-abi.h>
+
+typedef struct mtd_info_user mtd_info_t;
+typedef struct erase_info_user erase_info_t;
+typedef struct region_info_user region_info_t;
+typedef struct nand_oobinfo nand_oobinfo_t;
+typedef struct nand_ecclayout nand_ecclayout_t;
+
+#endif /* __MTD_USER_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/nftl-user.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/nftl-user.h
new file mode 100644
index 0000000..98e9e57
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/nftl-user.h
@@ -0,0 +1,76 @@
+/*
+ * Parts of NFTL headers shared with userspace
+ *
+ */
+
+#ifndef __MTD_NFTL_USER_H__
+#define __MTD_NFTL_USER_H__
+
+#include <linux/types.h>
+
+/* Block Control Information */
+
+struct nftl_bci {
+ unsigned char ECCSig[6];
+ __u8 Status;
+ __u8 Status1;
+}__attribute__((packed));
+
+/* Unit Control Information */
+
+struct nftl_uci0 {
+ __u16 VirtUnitNum;
+ __u16 ReplUnitNum;
+ __u16 SpareVirtUnitNum;
+ __u16 SpareReplUnitNum;
+} __attribute__((packed));
+
+struct nftl_uci1 {
+ __u32 WearInfo;
+ __u16 EraseMark;
+ __u16 EraseMark1;
+} __attribute__((packed));
+
+struct nftl_uci2 {
+ __u16 FoldMark;
+ __u16 FoldMark1;
+ __u32 unused;
+} __attribute__((packed));
+
+union nftl_uci {
+ struct nftl_uci0 a;
+ struct nftl_uci1 b;
+ struct nftl_uci2 c;
+};
+
+struct nftl_oob {
+ struct nftl_bci b;
+ union nftl_uci u;
+};
+
+/* NFTL Media Header */
+
+struct NFTLMediaHeader {
+ char DataOrgID[6];
+ __u16 NumEraseUnits;
+ __u16 FirstPhysicalEUN;
+ __u32 FormattedSize;
+ unsigned char UnitSizeFactor;
+} __attribute__((packed));
+
+#define MAX_ERASE_ZONES (8192 - 512)
+
+#define ERASE_MARK 0x3c69
+#define SECTOR_FREE 0xff
+#define SECTOR_USED 0x55
+#define SECTOR_IGNORE 0x11
+#define SECTOR_DELETED 0x00
+
+#define FOLD_MARK_IN_PROGRESS 0x5555
+
+#define ZONE_GOOD 0xff
+#define ZONE_BAD_ORIGINAL 0
+#define ZONE_BAD_MARKED 7
+
+
+#endif /* __MTD_NFTL_USER_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/ubi-user.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/ubi-user.h
new file mode 100644
index 0000000..466a832
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/mtd/ubi-user.h
@@ -0,0 +1,412 @@
+/*
+ * Copyright (c) International Business Machines Corp., 2006
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+ * the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Artem Bityutskiy (Битюцкий Ðртём)
+ */
+
+#ifndef __UBI_USER_H__
+#define __UBI_USER_H__
+
+#include <linux/types.h>
+
+/*
+ * UBI device creation (the same as MTD device attachment)
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * MTD devices may be attached using %UBI_IOCATT ioctl command of the UBI
+ * control device. The caller has to properly fill and pass
+ * &struct ubi_attach_req object - UBI will attach the MTD device specified in
+ * the request and return the newly created UBI device number as the ioctl
+ * return value.
+ *
+ * UBI device deletion (the same as MTD device detachment)
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * An UBI device maybe deleted with %UBI_IOCDET ioctl command of the UBI
+ * control device.
+ *
+ * UBI volume creation
+ * ~~~~~~~~~~~~~~~~~~~
+ *
+ * UBI volumes are created via the %UBI_IOCMKVOL ioctl command of UBI character
+ * device. A &struct ubi_mkvol_req object has to be properly filled and a
+ * pointer to it has to be passed to the ioctl.
+ *
+ * UBI volume deletion
+ * ~~~~~~~~~~~~~~~~~~~
+ *
+ * To delete a volume, the %UBI_IOCRMVOL ioctl command of the UBI character
+ * device should be used. A pointer to the 32-bit volume ID hast to be passed
+ * to the ioctl.
+ *
+ * UBI volume re-size
+ * ~~~~~~~~~~~~~~~~~~
+ *
+ * To re-size a volume, the %UBI_IOCRSVOL ioctl command of the UBI character
+ * device should be used. A &struct ubi_rsvol_req object has to be properly
+ * filled and a pointer to it has to be passed to the ioctl.
+ *
+ * UBI volumes re-name
+ * ~~~~~~~~~~~~~~~~~~~
+ *
+ * To re-name several volumes atomically at one go, the %UBI_IOCRNVOL command
+ * of the UBI character device should be used. A &struct ubi_rnvol_req object
+ * has to be properly filled and a pointer to it has to be passed to the ioctl.
+ *
+ * UBI volume update
+ * ~~~~~~~~~~~~~~~~~
+ *
+ * Volume update should be done via the %UBI_IOCVOLUP ioctl command of the
+ * corresponding UBI volume character device. A pointer to a 64-bit update
+ * size should be passed to the ioctl. After this, UBI expects user to write
+ * this number of bytes to the volume character device. The update is finished
+ * when the claimed number of bytes is passed. So, the volume update sequence
+ * is something like:
+ *
+ * fd = open("/dev/my_volume");
+ * ioctl(fd, UBI_IOCVOLUP, &image_size);
+ * write(fd, buf, image_size);
+ * close(fd);
+ *
+ * Logical eraseblock erase
+ * ~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * To erase a logical eraseblock, the %UBI_IOCEBER ioctl command of the
+ * corresponding UBI volume character device should be used. This command
+ * unmaps the requested logical eraseblock, makes sure the corresponding
+ * physical eraseblock is successfully erased, and returns.
+ *
+ * Atomic logical eraseblock change
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * Atomic logical eraseblock change operation is called using the %UBI_IOCEBCH
+ * ioctl command of the corresponding UBI volume character device. A pointer to
+ * a &struct ubi_leb_change_req object has to be passed to the ioctl. Then the
+ * user is expected to write the requested amount of bytes (similarly to what
+ * should be done in case of the "volume update" ioctl).
+ *
+ * Logical eraseblock map
+ * ~~~~~~~~~~~~~~~~~~~~~
+ *
+ * To map a logical eraseblock to a physical eraseblock, the %UBI_IOCEBMAP
+ * ioctl command should be used. A pointer to a &struct ubi_map_req object is
+ * expected to be passed. The ioctl maps the requested logical eraseblock to
+ * a physical eraseblock and returns. Only non-mapped logical eraseblocks can
+ * be mapped. If the logical eraseblock specified in the request is already
+ * mapped to a physical eraseblock, the ioctl fails and returns error.
+ *
+ * Logical eraseblock unmap
+ * ~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * To unmap a logical eraseblock to a physical eraseblock, the %UBI_IOCEBUNMAP
+ * ioctl command should be used. The ioctl unmaps the logical eraseblocks,
+ * schedules corresponding physical eraseblock for erasure, and returns. Unlike
+ * the "LEB erase" command, it does not wait for the physical eraseblock being
+ * erased. Note, the side effect of this is that if an unclean reboot happens
+ * after the unmap ioctl returns, you may find the LEB mapped again to the same
+ * physical eraseblock after the UBI is run again.
+ *
+ * Check if logical eraseblock is mapped
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * To check if a logical eraseblock is mapped to a physical eraseblock, the
+ * %UBI_IOCEBISMAP ioctl command should be used. It returns %0 if the LEB is
+ * not mapped, and %1 if it is mapped.
+ *
+ * Set an UBI volume property
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * To set an UBI volume property the %UBI_IOCSETPROP ioctl command should be
+ * used. A pointer to a &struct ubi_set_prop_req object is expected to be
+ * passed. The object describes which property should be set, and to which value
+ * it should be set.
+ */
+
+/*
+ * When a new UBI volume or UBI device is created, users may either specify the
+ * volume/device number they want to create or to let UBI automatically assign
+ * the number using these constants.
+ */
+#define UBI_VOL_NUM_AUTO (-1)
+#define UBI_DEV_NUM_AUTO (-1)
+
+/* Maximum volume name length */
+#define UBI_MAX_VOLUME_NAME 127
+
+/* ioctl commands of UBI character devices */
+
+#define UBI_IOC_MAGIC 'o'
+
+/* Create an UBI volume */
+#define UBI_IOCMKVOL _IOW(UBI_IOC_MAGIC, 0, struct ubi_mkvol_req)
+/* Remove an UBI volume */
+#define UBI_IOCRMVOL _IOW(UBI_IOC_MAGIC, 1, __s32)
+/* Re-size an UBI volume */
+#define UBI_IOCRSVOL _IOW(UBI_IOC_MAGIC, 2, struct ubi_rsvol_req)
+/* Re-name volumes */
+#define UBI_IOCRNVOL _IOW(UBI_IOC_MAGIC, 3, struct ubi_rnvol_req)
+
+/* ioctl commands of the UBI control character device */
+
+#define UBI_CTRL_IOC_MAGIC 'o'
+
+/* Attach an MTD device */
+#define UBI_IOCATT _IOW(UBI_CTRL_IOC_MAGIC, 64, struct ubi_attach_req)
+/* Detach an MTD device */
+#define UBI_IOCDET _IOW(UBI_CTRL_IOC_MAGIC, 65, __s32)
+
+/* ioctl commands of UBI volume character devices */
+
+#define UBI_VOL_IOC_MAGIC 'O'
+
+/* Start UBI volume update */
+#define UBI_IOCVOLUP _IOW(UBI_VOL_IOC_MAGIC, 0, __s64)
+/* LEB erasure command, used for debugging, disabled by default */
+#define UBI_IOCEBER _IOW(UBI_VOL_IOC_MAGIC, 1, __s32)
+/* Atomic LEB change command */
+#define UBI_IOCEBCH _IOW(UBI_VOL_IOC_MAGIC, 2, __s32)
+/* Map LEB command */
+#define UBI_IOCEBMAP _IOW(UBI_VOL_IOC_MAGIC, 3, struct ubi_map_req)
+/* Unmap LEB command */
+#define UBI_IOCEBUNMAP _IOW(UBI_VOL_IOC_MAGIC, 4, __s32)
+/* Check if LEB is mapped command */
+#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, __s32)
+/* Set an UBI volume property */
+#define UBI_IOCSETPROP _IOW(UBI_VOL_IOC_MAGIC, 6, struct ubi_set_prop_req)
+
+/* Maximum MTD device name length supported by UBI */
+#define MAX_UBI_MTD_NAME_LEN 127
+
+/* Maximum amount of UBI volumes that can be re-named at one go */
+#define UBI_MAX_RNVOL 32
+
+/*
+ * UBI data type hint constants.
+ *
+ * UBI_LONGTERM: long-term data
+ * UBI_SHORTTERM: short-term data
+ * UBI_UNKNOWN: data persistence is unknown
+ *
+ * These constants are used when data is written to UBI volumes in order to
+ * help the UBI wear-leveling unit to find more appropriate physical
+ * eraseblocks.
+ */
+enum {
+ UBI_LONGTERM = 1,
+ UBI_SHORTTERM = 2,
+ UBI_UNKNOWN = 3,
+};
+
+/*
+ * UBI volume type constants.
+ *
+ * @UBI_DYNAMIC_VOLUME: dynamic volume
+ * @UBI_STATIC_VOLUME: static volume
+ */
+enum {
+ UBI_DYNAMIC_VOLUME = 3,
+ UBI_STATIC_VOLUME = 4,
+};
+
+/*
+ * UBI set property ioctl constants
+ *
+ * @UBI_PROP_DIRECT_WRITE: allow / disallow user to directly write and
+ * erase individual eraseblocks on dynamic volumes
+ */
+enum {
+ UBI_PROP_DIRECT_WRITE = 1,
+};
+
+/**
+ * struct ubi_attach_req - attach MTD device request.
+ * @ubi_num: UBI device number to create
+ * @mtd_num: MTD device number to attach
+ * @vid_hdr_offset: VID header offset (use defaults if %0)
+ * @padding: reserved for future, not used, has to be zeroed
+ *
+ * This data structure is used to specify MTD device UBI has to attach and the
+ * parameters it has to use. The number which should be assigned to the new UBI
+ * device is passed in @ubi_num. UBI may automatically assign the number if
+ * @UBI_DEV_NUM_AUTO is passed. In this case, the device number is returned in
+ * @ubi_num.
+ *
+ * Most applications should pass %0 in @vid_hdr_offset to make UBI use default
+ * offset of the VID header within physical eraseblocks. The default offset is
+ * the next min. I/O unit after the EC header. For example, it will be offset
+ * 512 in case of a 512 bytes page NAND flash with no sub-page support. Or
+ * it will be 512 in case of a 2KiB page NAND flash with 4 512-byte sub-pages.
+ *
+ * But in rare cases, if this optimizes things, the VID header may be placed to
+ * a different offset. For example, the boot-loader might do things faster if
+ * the VID header sits at the end of the first 2KiB NAND page with 4 sub-pages.
+ * As the boot-loader would not normally need to read EC headers (unless it
+ * needs UBI in RW mode), it might be faster to calculate ECC. This is weird
+ * example, but it real-life example. So, in this example, @vid_hdr_offer would
+ * be 2KiB-64 bytes = 1984. Note, that this position is not even 512-bytes
+ * aligned, which is OK, as UBI is clever enough to realize this is 4th
+ * sub-page of the first page and add needed padding.
+ */
+struct ubi_attach_req {
+ __s32 ubi_num;
+ __s32 mtd_num;
+ __s32 vid_hdr_offset;
+ __s8 padding[12];
+};
+
+/**
+ * struct ubi_mkvol_req - volume description data structure used in
+ * volume creation requests.
+ * @vol_id: volume number
+ * @alignment: volume alignment
+ * @bytes: volume size in bytes
+ * @vol_type: volume type (%UBI_DYNAMIC_VOLUME or %UBI_STATIC_VOLUME)
+ * @padding1: reserved for future, not used, has to be zeroed
+ * @name_len: volume name length
+ * @padding2: reserved for future, not used, has to be zeroed
+ * @name: volume name
+ *
+ * This structure is used by user-space programs when creating new volumes. The
+ * @used_bytes field is only necessary when creating static volumes.
+ *
+ * The @alignment field specifies the required alignment of the volume logical
+ * eraseblock. This means, that the size of logical eraseblocks will be aligned
+ * to this number, i.e.,
+ * (UBI device logical eraseblock size) mod (@alignment) = 0.
+ *
+ * To put it differently, the logical eraseblock of this volume may be slightly
+ * shortened in order to make it properly aligned. The alignment has to be
+ * multiple of the flash minimal input/output unit, or %1 to utilize the entire
+ * available space of logical eraseblocks.
+ *
+ * The @alignment field may be useful, for example, when one wants to maintain
+ * a block device on top of an UBI volume. In this case, it is desirable to fit
+ * an integer number of blocks in logical eraseblocks of this UBI volume. With
+ * alignment it is possible to update this volume using plane UBI volume image
+ * BLOBs, without caring about how to properly align them.
+ */
+struct ubi_mkvol_req {
+ __s32 vol_id;
+ __s32 alignment;
+ __s64 bytes;
+ __s8 vol_type;
+ __s8 padding1;
+ __s16 name_len;
+ __s8 padding2[4];
+ char name[UBI_MAX_VOLUME_NAME + 1];
+} __attribute__ ((packed));
+
+/**
+ * struct ubi_rsvol_req - a data structure used in volume re-size requests.
+ * @vol_id: ID of the volume to re-size
+ * @bytes: new size of the volume in bytes
+ *
+ * Re-sizing is possible for both dynamic and static volumes. But while dynamic
+ * volumes may be re-sized arbitrarily, static volumes cannot be made to be
+ * smaller than the number of bytes they bear. To arbitrarily shrink a static
+ * volume, it must be wiped out first (by means of volume update operation with
+ * zero number of bytes).
+ */
+struct ubi_rsvol_req {
+ __s64 bytes;
+ __s32 vol_id;
+} __attribute__ ((packed));
+
+/**
+ * struct ubi_rnvol_req - volumes re-name request.
+ * @count: count of volumes to re-name
+ * @padding1: reserved for future, not used, has to be zeroed
+ * @vol_id: ID of the volume to re-name
+ * @name_len: name length
+ * @padding2: reserved for future, not used, has to be zeroed
+ * @name: new volume name
+ *
+ * UBI allows to re-name up to %32 volumes at one go. The count of volumes to
+ * re-name is specified in the @count field. The ID of the volumes to re-name
+ * and the new names are specified in the @vol_id and @name fields.
+ *
+ * The UBI volume re-name operation is atomic, which means that should power cut
+ * happen, the volumes will have either old name or new name. So the possible
+ * use-cases of this command is atomic upgrade. Indeed, to upgrade, say, volumes
+ * A and B one may create temporary volumes %A1 and %B1 with the new contents,
+ * then atomically re-name A1->A and B1->B, in which case old %A and %B will
+ * be removed.
+ *
+ * If it is not desirable to remove old A and B, the re-name request has to
+ * contain 4 entries: A1->A, A->A1, B1->B, B->B1, in which case old A1 and B1
+ * become A and B, and old A and B will become A1 and B1.
+ *
+ * It is also OK to request: A1->A, A1->X, B1->B, B->Y, in which case old A1
+ * and B1 become A and B, and old A and B become X and Y.
+ *
+ * In other words, in case of re-naming into an existing volume name, the
+ * existing volume is removed, unless it is re-named as well at the same
+ * re-name request.
+ */
+struct ubi_rnvol_req {
+ __s32 count;
+ __s8 padding1[12];
+ struct {
+ __s32 vol_id;
+ __s16 name_len;
+ __s8 padding2[2];
+ char name[UBI_MAX_VOLUME_NAME + 1];
+ } ents[UBI_MAX_RNVOL];
+} __attribute__ ((packed));
+
+/**
+ * struct ubi_leb_change_req - a data structure used in atomic LEB change
+ * requests.
+ * @lnum: logical eraseblock number to change
+ * @bytes: how many bytes will be written to the logical eraseblock
+ * @dtype: data type (%UBI_LONGTERM, %UBI_SHORTTERM, %UBI_UNKNOWN)
+ * @padding: reserved for future, not used, has to be zeroed
+ */
+struct ubi_leb_change_req {
+ __s32 lnum;
+ __s32 bytes;
+ __s8 dtype;
+ __s8 padding[7];
+} __attribute__ ((packed));
+
+/**
+ * struct ubi_map_req - a data structure used in map LEB requests.
+ * @lnum: logical eraseblock number to unmap
+ * @dtype: data type (%UBI_LONGTERM, %UBI_SHORTTERM, %UBI_UNKNOWN)
+ * @padding: reserved for future, not used, has to be zeroed
+ */
+struct ubi_map_req {
+ __s32 lnum;
+ __s8 dtype;
+ __s8 padding[3];
+} __attribute__ ((packed));
+
+
+/**
+ * struct ubi_set_prop_req - a data structure used to set an ubi volume
+ * property.
+ * @property: property to set (%UBI_PROP_DIRECT_WRITE)
+ * @padding: reserved for future, not used, has to be zeroed
+ * @value: value to set
+ */
+struct ubi_set_prop_req {
+ __u8 property;
+ __u8 padding[7];
+ __u64 value;
+} __attribute__ ((packed));
+
+#endif /* __UBI_USER_H__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/ethernet.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/ethernet.h
new file mode 100644
index 0000000..7ca8e83
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/ethernet.h
@@ -0,0 +1,76 @@
+/* Copyright (C) 1997, 1999, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Based on the FreeBSD version of this file. Curiously, that file
+ lacks a copyright in the header. */
+
+#ifndef __NET_ETHERNET_H
+#define __NET_ETHERNET_H 1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <linux/if_ether.h> /* IEEE 802.3 Ethernet constants */
+
+__BEGIN_DECLS
+
+/* This is a name for the 48 bit ethernet address available on many
+ systems. */
+struct ether_addr
+{
+ u_int8_t ether_addr_octet[ETH_ALEN];
+} __attribute__ ((__packed__));
+
+/* 10Mb/s ethernet header */
+struct ether_header
+{
+ u_int8_t ether_dhost[ETH_ALEN]; /* destination eth addr */
+ u_int8_t ether_shost[ETH_ALEN]; /* source ether addr */
+ u_int16_t ether_type; /* packet type ID field */
+} __attribute__ ((__packed__));
+
+/* Ethernet protocol ID's */
+#define ETHERTYPE_PUP 0x0200 /* Xerox PUP */
+#define ETHERTYPE_IP 0x0800 /* IP */
+#define ETHERTYPE_ARP 0x0806 /* Address resolution */
+#define ETHERTYPE_REVARP 0x8035 /* Reverse ARP */
+
+#define ETHER_ADDR_LEN ETH_ALEN /* size of ethernet addr */
+#define ETHER_TYPE_LEN 2 /* bytes in type field */
+#define ETHER_CRC_LEN 4 /* bytes in CRC field */
+#define ETHER_HDR_LEN ETH_HLEN /* total octets in header */
+#define ETHER_MIN_LEN (ETH_ZLEN + ETHER_CRC_LEN) /* min packet length */
+#define ETHER_MAX_LEN (ETH_FRAME_LEN + ETHER_CRC_LEN) /* max packet length */
+
+/* make sure ethenet length is valid */
+#define ETHER_IS_VALID_LEN(foo) \
+ ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
+
+/*
+ * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
+ * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
+ * by an ETHER type (as given above) and then the (variable-length) header.
+ */
+#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
+#define ETHERTYPE_NTRAILER 16
+
+#define ETHERMTU ETH_DATA_LEN
+#define ETHERMIN (ETHER_MIN_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN)
+
+__END_DECLS
+
+#endif /* net/ethernet.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if.h
new file mode 100644
index 0000000..ebb3e9f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if.h
@@ -0,0 +1,205 @@
+/* net/if.h -- declarations for inquiring about network interfaces
+ Copyright (C) 1997,98,99,2000,2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NET_IF_H
+#define _NET_IF_H 1
+
+#include <features.h>
+
+#ifdef __USE_MISC
+# include <sys/types.h>
+# include <sys/socket.h>
+#endif
+
+
+/* Length of interface name. */
+#define IF_NAMESIZE 16
+
+struct if_nameindex
+ {
+ unsigned int if_index; /* 1, 2, ... */
+ char *if_name; /* null terminated name: "eth0", ... */
+ };
+
+
+#ifdef __USE_MISC
+/* Standard interface flags. */
+enum
+ {
+ IFF_UP = 0x1, /* Interface is up. */
+# define IFF_UP IFF_UP
+ IFF_BROADCAST = 0x2, /* Broadcast address valid. */
+# define IFF_BROADCAST IFF_BROADCAST
+ IFF_DEBUG = 0x4, /* Turn on debugging. */
+# define IFF_DEBUG IFF_DEBUG
+ IFF_LOOPBACK = 0x8, /* Is a loopback net. */
+# define IFF_LOOPBACK IFF_LOOPBACK
+ IFF_POINTOPOINT = 0x10, /* Interface is point-to-point link. */
+# define IFF_POINTOPOINT IFF_POINTOPOINT
+ IFF_NOTRAILERS = 0x20, /* Avoid use of trailers. */
+# define IFF_NOTRAILERS IFF_NOTRAILERS
+ IFF_RUNNING = 0x40, /* Resources allocated. */
+# define IFF_RUNNING IFF_RUNNING
+ IFF_NOARP = 0x80, /* No address resolution protocol. */
+# define IFF_NOARP IFF_NOARP
+ IFF_PROMISC = 0x100, /* Receive all packets. */
+# define IFF_PROMISC IFF_PROMISC
+
+ /* Not supported */
+ IFF_ALLMULTI = 0x200, /* Receive all multicast packets. */
+# define IFF_ALLMULTI IFF_ALLMULTI
+
+ IFF_MASTER = 0x400, /* Master of a load balancer. */
+# define IFF_MASTER IFF_MASTER
+ IFF_SLAVE = 0x800, /* Slave of a load balancer. */
+# define IFF_SLAVE IFF_SLAVE
+
+ IFF_MULTICAST = 0x1000, /* Supports multicast. */
+# define IFF_MULTICAST IFF_MULTICAST
+
+ IFF_PORTSEL = 0x2000, /* Can set media type. */
+# define IFF_PORTSEL IFF_PORTSEL
+ IFF_AUTOMEDIA = 0x4000, /* Auto media select active. */
+# define IFF_AUTOMEDIA IFF_AUTOMEDIA
+ IFF_DYNAMIC = 0x8000 /* Dialup device with changing addresses. */
+# define IFF_DYNAMIC IFF_DYNAMIC
+ };
+
+/* The ifaddr structure contains information about one address of an
+ interface. They are maintained by the different address families,
+ are allocated and attached when an address is set, and are linked
+ together so all addresses for an interface can be located. */
+
+struct ifaddr
+ {
+ struct sockaddr ifa_addr; /* Address of interface. */
+ union
+ {
+ struct sockaddr ifu_broadaddr;
+ struct sockaddr ifu_dstaddr;
+ } ifa_ifu;
+ struct iface *ifa_ifp; /* Back-pointer to interface. */
+ struct ifaddr *ifa_next; /* Next address for interface. */
+ };
+
+# define ifa_broadaddr ifa_ifu.ifu_broadaddr /* broadcast address */
+# define ifa_dstaddr ifa_ifu.ifu_dstaddr /* other end of link */
+
+/* Device mapping structure. I'd just gone off and designed a
+ beautiful scheme using only loadable modules with arguments for
+ driver options and along come the PCMCIA people 8)
+
+ Ah well. The get() side of this is good for WDSETUP, and it'll be
+ handy for debugging things. The set side is fine for now and being
+ very small might be worth keeping for clean configuration. */
+
+struct ifmap
+ {
+ unsigned long int mem_start;
+ unsigned long int mem_end;
+ unsigned short int base_addr;
+ unsigned char irq;
+ unsigned char dma;
+ unsigned char port;
+ /* 3 bytes spare */
+ };
+
+/* Interface request structure used for socket ioctl's. All interface
+ ioctl's must have parameter definitions which begin with ifr_name.
+ The remainder may be interface specific. */
+
+struct ifreq
+ {
+# define IFHWADDRLEN 6
+# define IFNAMSIZ IF_NAMESIZE
+ union
+ {
+ char ifrn_name[IFNAMSIZ]; /* Interface name, e.g. "en0". */
+ } ifr_ifrn;
+
+ union
+ {
+ struct sockaddr ifru_addr;
+ struct sockaddr ifru_dstaddr;
+ struct sockaddr ifru_broadaddr;
+ struct sockaddr ifru_netmask;
+ struct sockaddr ifru_hwaddr;
+ short int ifru_flags;
+ int ifru_ivalue;
+ int ifru_mtu;
+ struct ifmap ifru_map;
+ char ifru_slave[IFNAMSIZ]; /* Just fits the size */
+ char ifru_newname[IFNAMSIZ];
+ __caddr_t ifru_data;
+ } ifr_ifru;
+ };
+# define ifr_name ifr_ifrn.ifrn_name /* interface name */
+# define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */
+# define ifr_addr ifr_ifru.ifru_addr /* address */
+# define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-p lnk */
+# define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
+# define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */
+# define ifr_flags ifr_ifru.ifru_flags /* flags */
+# define ifr_metric ifr_ifru.ifru_ivalue /* metric */
+# define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
+# define ifr_map ifr_ifru.ifru_map /* device map */
+# define ifr_slave ifr_ifru.ifru_slave /* slave device */
+# define ifr_data ifr_ifru.ifru_data /* for use by interface */
+# define ifr_ifindex ifr_ifru.ifru_ivalue /* interface index */
+# define ifr_bandwidth ifr_ifru.ifru_ivalue /* link bandwidth */
+# define ifr_qlen ifr_ifru.ifru_ivalue /* queue length */
+# define ifr_newname ifr_ifru.ifru_newname /* New name */
+# define _IOT_ifreq _IOT(_IOTS(char),IFNAMSIZ,_IOTS(char),16,0,0)
+# define _IOT_ifreq_short _IOT(_IOTS(char),IFNAMSIZ,_IOTS(short),1,0,0)
+# define _IOT_ifreq_int _IOT(_IOTS(char),IFNAMSIZ,_IOTS(int),1,0,0)
+
+
+/* Structure used in SIOCGIFCONF request. Used to retrieve interface
+ configuration for machine (useful for programs which must know all
+ networks accessible). */
+
+struct ifconf
+ {
+ int ifc_len; /* Size of buffer. */
+ union
+ {
+ __caddr_t ifcu_buf;
+ struct ifreq *ifcu_req;
+ } ifc_ifcu;
+ };
+# define ifc_buf ifc_ifcu.ifcu_buf /* Buffer address. */
+# define ifc_req ifc_ifcu.ifcu_req /* Array of structures. */
+# define _IOT_ifconf _IOT(_IOTS(struct ifconf),1,0,0,0,0) /* not right */
+#endif /* Misc. */
+
+__BEGIN_DECLS
+
+/* Convert an interface name to an index, and vice versa. */
+extern unsigned int if_nametoindex (__const char *__ifname) __THROW;
+extern char *if_indextoname (unsigned int __ifindex, char *__ifname) __THROW;
+
+/* Return a list of all interfaces and their indices. */
+extern struct if_nameindex *if_nameindex (void) __THROW;
+
+/* Free the data returned from if_nameindex. */
+extern void if_freenameindex (struct if_nameindex *__ptr) __THROW;
+
+__END_DECLS
+
+#endif /* net/if.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if_arp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if_arp.h
new file mode 100644
index 0000000..46f035b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if_arp.h
@@ -0,0 +1,176 @@
+/* Definitions for Address Resolution Protocol.
+ Copyright (C) 1997, 1999, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Based on the 4.4BSD and Linux version of this file. */
+
+#ifndef _NET_IF_ARP_H
+
+#define _NET_IF_ARP_H 1
+#include <sys/cdefs.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+__BEGIN_DECLS
+
+/* Some internals from deep down in the kernel. */
+#define MAX_ADDR_LEN 7
+
+
+/* This structure defines an ethernet arp header. */
+
+/* ARP protocol opcodes. */
+#define ARPOP_REQUEST 1 /* ARP request. */
+#define ARPOP_REPLY 2 /* ARP reply. */
+#define ARPOP_RREQUEST 3 /* RARP request. */
+#define ARPOP_RREPLY 4 /* RARP reply. */
+#define ARPOP_InREQUEST 8 /* InARP request. */
+#define ARPOP_InREPLY 9 /* InARP reply. */
+#define ARPOP_NAK 10 /* (ATM)ARP NAK. */
+
+/* See RFC 826 for protocol description. ARP packets are variable
+ in size; the arphdr structure defines the fixed-length portion.
+ Protocol type values are the same as those for 10 Mb/s Ethernet.
+ It is followed by the variable-sized fields ar_sha, arp_spa,
+ arp_tha and arp_tpa in that order, according to the lengths
+ specified. Field names used correspond to RFC 826. */
+
+struct arphdr
+ {
+ unsigned short int ar_hrd; /* Format of hardware address. */
+ unsigned short int ar_pro; /* Format of protocol address. */
+ unsigned char ar_hln; /* Length of hardware address. */
+ unsigned char ar_pln; /* Length of protocol address. */
+ unsigned short int ar_op; /* ARP opcode (command). */
+#if 0
+ /* Ethernet looks like this : This bit is variable sized
+ however... */
+ unsigned char __ar_sha[ETH_ALEN]; /* Sender hardware address. */
+ unsigned char __ar_sip[4]; /* Sender IP address. */
+ unsigned char __ar_tha[ETH_ALEN]; /* Target hardware address. */
+ unsigned char __ar_tip[4]; /* Target IP address. */
+#endif
+ };
+
+
+/* ARP protocol HARDWARE identifiers. */
+#define ARPHRD_NETROM 0 /* From KA9Q: NET/ROM pseudo. */
+#define ARPHRD_ETHER 1 /* Ethernet 10/100Mbps. */
+#define ARPHRD_EETHER 2 /* Experimental Ethernet. */
+#define ARPHRD_AX25 3 /* AX.25 Level 2. */
+#define ARPHRD_PRONET 4 /* PROnet token ring. */
+#define ARPHRD_CHAOS 5 /* Chaosnet. */
+#define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet/TR/TB. */
+#define ARPHRD_ARCNET 7 /* ARCnet. */
+#define ARPHRD_APPLETLK 8 /* APPLEtalk. */
+#define ARPHRD_DLCI 15 /* Frame Relay DLCI. */
+#define ARPHRD_ATM 19 /* ATM. */
+#define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id). */
+#define ARPHRD_IEEE1394 24 /* IEEE 1394 IPv4 - RFC 2734. */
+#define ARPHRD_EUI64 27 /* EUI-64. */
+#define ARPHRD_INFINIBAND 32 /* InfiniBand. */
+
+/* Dummy types for non ARP hardware */
+#define ARPHRD_SLIP 256
+#define ARPHRD_CSLIP 257
+#define ARPHRD_SLIP6 258
+#define ARPHRD_CSLIP6 259
+#define ARPHRD_RSRVD 260 /* Notional KISS type. */
+#define ARPHRD_ADAPT 264
+#define ARPHRD_ROSE 270
+#define ARPHRD_X25 271 /* CCITT X.25. */
+#define ARPHDR_HWX25 272 /* Boards with X.25 in firmware. */
+#define ARPHRD_PPP 512
+#define ARPHRD_CISCO 513 /* Cisco HDLC. */
+#define ARPHRD_HDLC ARPHRD_CISCO
+#define ARPHRD_LAPB 516 /* LAPB. */
+#define ARPHRD_DDCMP 517 /* Digital's DDCMP. */
+#define ARPHRD_RAWHDLC 518 /* Raw HDLC. */
+
+#define ARPHRD_TUNNEL 768 /* IPIP tunnel. */
+#define ARPHRD_TUNNEL6 769 /* IPIP6 tunnel. */
+#define ARPHRD_FRAD 770 /* Frame Relay Access Device. */
+#define ARPHRD_SKIP 771 /* SKIP vif. */
+#define ARPHRD_LOOPBACK 772 /* Loopback device. */
+#define ARPHRD_LOCALTLK 773 /* Localtalk device. */
+#define ARPHRD_FDDI 774 /* Fiber Distributed Data Interface. */
+#define ARPHRD_BIF 775 /* AP1000 BIF. */
+#define ARPHRD_SIT 776 /* sit0 device - IPv6-in-IPv4. */
+#define ARPHRD_IPDDP 777 /* IP-in-DDP tunnel. */
+#define ARPHRD_IPGRE 778 /* GRE over IP. */
+#define ARPHRD_PIMREG 779 /* PIMSM register interface. */
+#define ARPHRD_HIPPI 780 /* High Performance Parallel I'face. */
+#define ARPHRD_ASH 781 /* (Nexus Electronics) Ash. */
+#define ARPHRD_ECONET 782 /* Acorn Econet. */
+#define ARPHRD_IRDA 783 /* Linux-IrDA. */
+#define ARPHRD_FCPP 784 /* Point to point fibrechanel. */
+#define ARPHRD_FCAL 785 /* Fibrechanel arbitrated loop. */
+#define ARPHRD_FCPL 786 /* Fibrechanel public loop. */
+#define ARPHRD_FCFABRIC 787 /* Fibrechanel fabric. */
+#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR. */
+#define ARPHRD_IEEE80211 801 /* IEEE 802.11. */
+
+/* ARP ioctl request. */
+struct arpreq
+ {
+ struct sockaddr arp_pa; /* Protocol address. */
+ struct sockaddr arp_ha; /* Hardware address. */
+ int arp_flags; /* Flags. */
+ struct sockaddr arp_netmask; /* Netmask (only for proxy arps). */
+ char arp_dev[16];
+ };
+
+struct arpreq_old
+ {
+ struct sockaddr arp_pa; /* Protocol address. */
+ struct sockaddr arp_ha; /* Hardware address. */
+ int arp_flags; /* Flags. */
+ struct sockaddr arp_netmask; /* Netmask (only for proxy arps). */
+ };
+
+/* ARP Flag values. */
+#define ATF_COM 0x02 /* Completed entry (ha valid). */
+#define ATF_PERM 0x04 /* Permanent entry. */
+#define ATF_PUBL 0x08 /* Publish entry. */
+#define ATF_USETRAILERS 0x10 /* Has requested trailers. */
+#define ATF_NETMASK 0x20 /* Want to use a netmask (only
+ for proxy entries). */
+#define ATF_DONTPUB 0x40 /* Don't answer this addresses. */
+#define ATF_MAGIC 0x80 /* Automatically added entry. */
+
+
+/* Support for the user space arp daemon, arpd. */
+#define ARPD_UPDATE 0x01
+#define ARPD_LOOKUP 0x02
+#define ARPD_FLUSH 0x03
+
+struct arpd_request
+ {
+ unsigned short int req; /* Request type. */
+ u_int32_t ip; /* IP address of entry. */
+ unsigned long int dev; /* Device entry is tied to. */
+ unsigned long int stamp;
+ unsigned long int updated;
+ unsigned char ha[MAX_ADDR_LEN]; /* Hardware address. */
+ };
+
+__END_DECLS
+
+#endif /* net/if_arp.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if_packet.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if_packet.h
new file mode 100644
index 0000000..e5184e7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if_packet.h
@@ -0,0 +1,37 @@
+/* Definitions for use with Linux SOCK_PACKET sockets.
+ Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef __IF_PACKET_H
+#define __IF_PACKET_H
+
+#include <features.h>
+#include <bits/sockaddr.h>
+
+/* This is the SOCK_PACKET address structure as used in Linux 2.0.
+ From Linux 2.1 the AF_PACKET interface is preferred and you should
+ consider using it in place of this one. */
+
+struct sockaddr_pkt
+ {
+ __SOCKADDR_COMMON (spkt_);
+ unsigned char spkt_device[14];
+ unsigned short spkt_protocol;
+ };
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if_ppp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if_ppp.h
new file mode 100644
index 0000000..bf5ec83
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if_ppp.h
@@ -0,0 +1,169 @@
+/* From: if_ppp.h,v 1.3 1995/06/12 11:36:50 paulus Exp */
+
+/*
+ * if_ppp.h - Point-to-Point Protocol definitions.
+ *
+ * Copyright (c) 1989 Carnegie Mellon University.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+/*
+ * ==FILEVERSION 960926==
+ *
+ * NOTE TO MAINTAINERS:
+ * If you modify this file at all, please set the above date.
+ * if_ppp.h is shipped with a PPP distribution as well as with the kernel;
+ * if everyone increases the FILEVERSION number above, then scripts
+ * can do the right thing when deciding whether to install a new if_ppp.h
+ * file. Don't change the format of that line otherwise, so the
+ * installation script can recognize it.
+ */
+
+
+#ifndef __NET_IF_PPP_H
+#define __NET_IF_PPP_H 1
+
+#include <sys/types.h>
+#include <sys/cdefs.h>
+
+#include <net/if.h>
+#include <sys/ioctl.h>
+#include <net/ppp_defs.h>
+
+__BEGIN_DECLS
+
+/*
+ * Packet sizes
+ */
+
+#define PPP_MTU 1500 /* Default MTU (size of Info field) */
+#define PPP_MAXMRU 65000 /* Largest MRU we allow */
+#define PPP_VERSION "2.2.0"
+#define PPP_MAGIC 0x5002 /* Magic value for the ppp structure */
+#define PROTO_IPX 0x002b /* protocol numbers */
+#define PROTO_DNA_RT 0x0027 /* DNA Routing */
+
+
+/*
+ * Bit definitions for flags.
+ */
+
+#define SC_COMP_PROT 0x00000001 /* protocol compression (output) */
+#define SC_COMP_AC 0x00000002 /* header compression (output) */
+#define SC_COMP_TCP 0x00000004 /* TCP (VJ) compression (output) */
+#define SC_NO_TCP_CCID 0x00000008 /* disable VJ connection-id comp. */
+#define SC_REJ_COMP_AC 0x00000010 /* reject adrs/ctrl comp. on input */
+#define SC_REJ_COMP_TCP 0x00000020 /* reject TCP (VJ) comp. on input */
+#define SC_CCP_OPEN 0x00000040 /* Look at CCP packets */
+#define SC_CCP_UP 0x00000080 /* May send/recv compressed packets */
+#define SC_ENABLE_IP 0x00000100 /* IP packets may be exchanged */
+#define SC_COMP_RUN 0x00001000 /* compressor has been inited */
+#define SC_DECOMP_RUN 0x00002000 /* decompressor has been inited */
+#define SC_DEBUG 0x00010000 /* enable debug messages */
+#define SC_LOG_INPKT 0x00020000 /* log contents of good pkts recvd */
+#define SC_LOG_OUTPKT 0x00040000 /* log contents of pkts sent */
+#define SC_LOG_RAWIN 0x00080000 /* log all chars received */
+#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */
+#define SC_MASK 0x0fE0ffff /* bits that user can change */
+
+/* state bits */
+#define SC_ESCAPED 0x80000000 /* saw a PPP_ESCAPE */
+#define SC_FLUSH 0x40000000 /* flush input until next PPP_FLAG */
+#define SC_VJ_RESET 0x20000000 /* Need to reset the VJ decompressor */
+#define SC_XMIT_BUSY 0x10000000 /* ppp_write_wakeup is active */
+#define SC_RCV_ODDP 0x08000000 /* have rcvd char with odd parity */
+#define SC_RCV_EVNP 0x04000000 /* have rcvd char with even parity */
+#define SC_RCV_B7_1 0x02000000 /* have rcvd char with bit 7 = 1 */
+#define SC_RCV_B7_0 0x01000000 /* have rcvd char with bit 7 = 0 */
+#define SC_DC_FERROR 0x00800000 /* fatal decomp error detected */
+#define SC_DC_ERROR 0x00400000 /* non-fatal decomp error detected */
+
+/*
+ * Ioctl definitions.
+ */
+
+struct npioctl {
+ int protocol; /* PPP protocol, e.g. PPP_IP */
+ enum NPmode mode;
+};
+
+/* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS */
+struct ppp_option_data {
+ u_int8_t *ptr;
+ u_int32_t length;
+ int transmit;
+};
+
+struct ifpppstatsreq {
+ struct ifreq b;
+ struct ppp_stats stats; /* statistic information */
+};
+
+struct ifpppcstatsreq {
+ struct ifreq b;
+ struct ppp_comp_stats stats;
+};
+
+#define ifr__name b.ifr_ifrn.ifrn_name
+#define stats_ptr b.ifr_ifru.ifru_data
+
+/*
+ * Ioctl definitions.
+ */
+
+#define PPPIOCGFLAGS _IOR('t', 90, int) /* get configuration flags */
+#define PPPIOCSFLAGS _IOW('t', 89, int) /* set configuration flags */
+#define PPPIOCGASYNCMAP _IOR('t', 88, int) /* get async map */
+#define PPPIOCSASYNCMAP _IOW('t', 87, int) /* set async map */
+#define PPPIOCGUNIT _IOR('t', 86, int) /* get ppp unit number */
+#define PPPIOCGRASYNCMAP _IOR('t', 85, int) /* get receive async map */
+#define PPPIOCSRASYNCMAP _IOW('t', 84, int) /* set receive async map */
+#define PPPIOCGMRU _IOR('t', 83, int) /* get max receive unit */
+#define PPPIOCSMRU _IOW('t', 82, int) /* set max receive unit */
+#define PPPIOCSMAXCID _IOW('t', 81, int) /* set VJ max slot ID */
+#define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm) /* get extended ACCM */
+#define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm) /* set extended ACCM */
+#define PPPIOCXFERUNIT _IO('t', 78) /* transfer PPP unit */
+#define PPPIOCSCOMPRESS _IOW('t', 77, struct ppp_option_data)
+#define PPPIOCGNPMODE _IOWR('t', 76, struct npioctl) /* get NP mode */
+#define PPPIOCSNPMODE _IOW('t', 75, struct npioctl) /* set NP mode */
+#define PPPIOCGDEBUG _IOR('t', 65, int) /* Read debug level */
+#define PPPIOCSDEBUG _IOW('t', 64, int) /* Set debug level */
+#define PPPIOCGIDLE _IOR('t', 63, struct ppp_idle) /* get idle time */
+
+#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0)
+#define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */
+#define SIOCGPPPCSTATS (SIOCDEVPRIVATE + 2)
+
+#if !defined(ifr_mtu)
+#define ifr_mtu ifr_ifru.ifru_metric
+#endif
+
+__END_DECLS
+
+#endif /* net/if_ppp.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if_shaper.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if_shaper.h
new file mode 100644
index 0000000..7060af3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if_shaper.h
@@ -0,0 +1,59 @@
+/* Copyright (C) 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NET_IF_SHAPER_H
+#define _NET_IF_SHAPER_H 1
+
+#include <features.h>
+#include <sys/types.h>
+#include <net/if.h>
+#include <sys/ioctl.h>
+
+__BEGIN_DECLS
+
+#define SHAPER_QLEN 10
+/*
+ * This is a bit speed dependant (read it shouldnt be a constant!)
+ *
+ * 5 is about right for 28.8 upwards. Below that double for every
+ * halving of speed or so. - ie about 20 for 9600 baud.
+ */
+#define SHAPER_LATENCY (5 * HZ)
+#define SHAPER_MAXSLIP 2
+#define SHAPER_BURST (HZ / 50) /* Good for >128K then */
+
+#define SHAPER_SET_DEV 0x0001
+#define SHAPER_SET_SPEED 0x0002
+#define SHAPER_GET_DEV 0x0003
+#define SHAPER_GET_SPEED 0x0004
+
+struct shaperconf
+{
+ u_int16_t ss_cmd;
+ union
+ {
+ char ssu_name[14];
+ u_int32_t ssu_speed;
+ } ss_u;
+#define ss_speed ss_u.ssu_speed
+#define ss_name ss_u.ssu_name
+};
+
+__END_DECLS
+
+#endif /* net/if_shaper.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if_slip.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if_slip.h
new file mode 100644
index 0000000..66bd7f3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/if_slip.h
@@ -0,0 +1,25 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NET_IF_SLIP_H
+#define _NET_IF_SLIP_H 1
+
+/* We can use the kernel header. */
+#include <linux/if_slip.h>
+
+#endif /* net/if_slip.h. */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/ppp-comp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/ppp-comp.h
new file mode 100644
index 0000000..4a992d5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/ppp-comp.h
@@ -0,0 +1 @@
+#include <linux/ppp-comp.h>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/ppp_defs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/ppp_defs.h
new file mode 100644
index 0000000..f8924c4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/ppp_defs.h
@@ -0,0 +1,10 @@
+#ifndef _NET_PPP_DEFS_H
+#define _NET_PPP_DEFS_H 1
+
+#define __need_time_t
+#include <time.h>
+
+#include <asm/types.h>
+#include <linux/ppp_defs.h>
+
+#endif /* net/ppp_defs.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/route.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/route.h
new file mode 100644
index 0000000..da5c810
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/net/route.h
@@ -0,0 +1,145 @@
+/* Copyright (C) 1997, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Based on the 4.4BSD and Linux version of this file. */
+
+#ifndef _NET_ROUTE_H
+#define _NET_ROUTE_H 1
+
+#include <features.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <bits/wordsize.h>
+
+
+/* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */
+struct rtentry
+ {
+ unsigned long int rt_pad1;
+ struct sockaddr rt_dst; /* Target address. */
+ struct sockaddr rt_gateway; /* Gateway addr (RTF_GATEWAY). */
+ struct sockaddr rt_genmask; /* Target network mask (IP). */
+ unsigned short int rt_flags;
+ short int rt_pad2;
+ unsigned long int rt_pad3;
+ unsigned char rt_tos;
+ unsigned char rt_class;
+#if __WORDSIZE == 64
+ short int rt_pad4[3];
+#else
+ short int rt_pad4;
+#endif
+ short int rt_metric; /* +1 for binary compatibility! */
+ char *rt_dev; /* Forcing the device at add. */
+ unsigned long int rt_mtu; /* Per route MTU/Window. */
+ unsigned long int rt_window; /* Window clamping. */
+ unsigned short int rt_irtt; /* Initial RTT. */
+ };
+/* Compatibility hack. */
+#define rt_mss rt_mtu
+
+
+struct in6_rtmsg
+ {
+ struct in6_addr rtmsg_dst;
+ struct in6_addr rtmsg_src;
+ struct in6_addr rtmsg_gateway;
+ u_int32_t rtmsg_type;
+ u_int16_t rtmsg_dst_len;
+ u_int16_t rtmsg_src_len;
+ u_int32_t rtmsg_metric;
+ unsigned long int rtmsg_info;
+ u_int32_t rtmsg_flags;
+ int rtmsg_ifindex;
+ };
+
+
+#define RTF_UP 0x0001 /* Route usable. */
+#define RTF_GATEWAY 0x0002 /* Destination is a gateway. */
+
+#define RTF_HOST 0x0004 /* Host entry (net otherwise). */
+#define RTF_REINSTATE 0x0008 /* Reinstate route after timeout. */
+#define RTF_DYNAMIC 0x0010 /* Created dyn. (by redirect). */
+#define RTF_MODIFIED 0x0020 /* Modified dyn. (by redirect). */
+#define RTF_MTU 0x0040 /* Specific MTU for this route. */
+#define RTF_MSS RTF_MTU /* Compatibility. */
+#define RTF_WINDOW 0x0080 /* Per route window clamping. */
+#define RTF_IRTT 0x0100 /* Initial round trip time. */
+#define RTF_REJECT 0x0200 /* Reject route. */
+#define RTF_STATIC 0x0400 /* Manually injected route. */
+#define RTF_XRESOLVE 0x0800 /* External resolver. */
+#define RTF_NOFORWARD 0x1000 /* Forwarding inhibited. */
+#define RTF_THROW 0x2000 /* Go to next class. */
+#define RTF_NOPMTUDISC 0x4000 /* Do not send packets with DF. */
+
+/* for IPv6 */
+#define RTF_DEFAULT 0x00010000 /* default - learned via ND */
+#define RTF_ALLONLINK 0x00020000 /* fallback, no routers on link */
+#define RTF_ADDRCONF 0x00040000 /* addrconf route - RA */
+
+#define RTF_LINKRT 0x00100000 /* link specific - device match */
+#define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */
+
+#define RTF_CACHE 0x01000000 /* cache entry */
+#define RTF_FLOW 0x02000000 /* flow significant route */
+#define RTF_POLICY 0x04000000 /* policy route */
+
+#define RTCF_VALVE 0x00200000
+#define RTCF_MASQ 0x00400000
+#define RTCF_NAT 0x00800000
+#define RTCF_DOREDIRECT 0x01000000
+#define RTCF_LOG 0x02000000
+#define RTCF_DIRECTSRC 0x04000000
+
+#define RTF_LOCAL 0x80000000
+#define RTF_INTERFACE 0x40000000
+#define RTF_MULTICAST 0x20000000
+#define RTF_BROADCAST 0x10000000
+#define RTF_NAT 0x08000000
+
+#define RTF_ADDRCLASSMASK 0xF8000000
+#define RT_ADDRCLASS(flags) ((__u_int32_t) flags >> 23)
+
+#define RT_TOS(tos) ((tos) & IPTOS_TOS_MASK)
+
+#define RT_LOCALADDR(flags) ((flags & RTF_ADDRCLASSMASK) \
+ == (RTF_LOCAL|RTF_INTERFACE))
+
+#define RT_CLASS_UNSPEC 0
+#define RT_CLASS_DEFAULT 253
+
+#define RT_CLASS_MAIN 254
+#define RT_CLASS_LOCAL 255
+#define RT_CLASS_MAX 255
+
+
+#define RTMSG_ACK NLMSG_ACK
+#define RTMSG_OVERRUN NLMSG_OVERRUN
+
+#define RTMSG_NEWDEVICE 0x11
+#define RTMSG_DELDEVICE 0x12
+#define RTMSG_NEWROUTE 0x21
+#define RTMSG_DELROUTE 0x22
+#define RTMSG_NEWRULE 0x31
+#define RTMSG_DELRULE 0x32
+#define RTMSG_CONTROL 0x40
+
+#define RTMSG_AR_FAILED 0x51 /* Address Resolution failed. */
+
+#endif /* net/route.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/netax25/ax25.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netax25/ax25.h
new file mode 100644
index 0000000..ce3c7ab
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netax25/ax25.h
@@ -0,0 +1,171 @@
+/* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETAX25_AX25_H
+#define _NETAX25_AX25_H 1
+
+#include <features.h>
+#include <bits/sockaddr.h>
+
+/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx. */
+#define SOL_AX25 257
+
+/* AX.25 flags: */
+#define AX25_WINDOW 1
+#define AX25_T1 2
+#define AX25_T2 5
+#define AX25_T3 4
+#define AX25_N2 3
+#define AX25_BACKOFF 6
+#define AX25_EXTSEQ 7
+#define AX25_PIDINCL 8
+#define AX25_IDLE 9
+#define AX25_PACLEN 10
+#define AX25_IPMAXQUEUE 11
+#define AX25_IAMDIGI 12
+#define AX25_KILL 99
+
+/* AX.25 socket ioctls: */
+#define SIOCAX25GETUID (SIOCPROTOPRIVATE)
+#define SIOCAX25ADDUID (SIOCPROTOPRIVATE+1)
+#define SIOCAX25DELUID (SIOCPROTOPRIVATE+2)
+#define SIOCAX25NOUID (SIOCPROTOPRIVATE+3)
+#define SIOCAX25BPQADDR (SIOCPROTOPRIVATE+4)
+#define SIOCAX25GETPARMS (SIOCPROTOPRIVATE+5)
+#define SIOCAX25SETPARMS (SIOCPROTOPRIVATE+6)
+#define SIOCAX25OPTRT (SIOCPROTOPRIVATE+7)
+#define SIOCAX25CTLCON (SIOCPROTOPRIVATE+8)
+#define SIOCAX25GETINFO (SIOCPROTOPRIVATE+9)
+#define SIOCAX25ADDFWD (SIOCPROTOPRIVATE+10)
+#define SIOCAX25DELFWD (SIOCPROTOPRIVATE+11)
+
+/* unknown: */
+#define AX25_NOUID_DEFAULT 0
+#define AX25_NOUID_BLOCK 1
+#define AX25_SET_RT_IPMODE 2
+
+/* Digipeating flags: */
+#define AX25_DIGI_INBAND 0x01 /* Allow digipeating within port */
+#define AX25_DIGI_XBAND 0x02 /* Allow digipeating across ports */
+
+/* Maximim number of digipeaters: */
+#define AX25_MAX_DIGIS 8
+
+
+typedef struct
+ {
+ char ax25_call[7]; /* 6 call + SSID (shifted ascii) */
+ }
+ax25_address;
+
+struct sockaddr_ax25
+ {
+ sa_family_t sax25_family;
+ ax25_address sax25_call;
+ int sax25_ndigis;
+ };
+
+/*
+ * The sockaddr struct with the digipeater adresses:
+ */
+struct full_sockaddr_ax25
+ {
+ struct sockaddr_ax25 fsa_ax25;
+ ax25_address fsa_digipeater[AX25_MAX_DIGIS];
+ };
+#define sax25_uid sax25_ndigis
+
+struct ax25_routes_struct
+ {
+ ax25_address port_addr;
+ ax25_address dest_addr;
+ unsigned char digi_count;
+ ax25_address digi_addr[AX25_MAX_DIGIS];
+ };
+
+/* The AX.25 ioctl structure: */
+struct ax25_ctl_struct
+ {
+ ax25_address port_addr;
+ ax25_address source_addr;
+ ax25_address dest_addr;
+ unsigned int cmd;
+ unsigned long arg;
+ unsigned char digi_count;
+ ax25_address digi_addr[AX25_MAX_DIGIS];
+ };
+
+struct ax25_info_struct
+ {
+ unsigned int n2, n2count;
+ unsigned int t1, t1timer;
+ unsigned int t2, t2timer;
+ unsigned int t3, t3timer;
+ unsigned int idle, idletimer;
+ unsigned int state;
+ unsigned int rcv_q, snd_q;
+ };
+
+struct ax25_fwd_struct
+ {
+ ax25_address port_from;
+ ax25_address port_to;
+ };
+
+/* AX.25 route structure: */
+struct ax25_route_opt_struct
+ {
+ ax25_address port_addr;
+ ax25_address dest_addr;
+ int cmd;
+ int arg;
+ };
+
+/* AX.25 BPQ stuff: */
+struct ax25_bpqaddr_struct
+ {
+ char dev[16];
+ ax25_address addr;
+ };
+
+/* Definitions for the AX.25 `values' fields: */
+#define AX25_VALUES_IPDEFMODE 0 /* 'D'=DG 'V'=VC */
+#define AX25_VALUES_AXDEFMODE 1 /* 8=Normal 128=Extended Seq Nos */
+#define AX25_VALUES_NETROM 2 /* Allow NET/ROM - 0=No 1=Yes */
+#define AX25_VALUES_TEXT 3 /* Allow PID=Text - 0=No 1=Yes */
+#define AX25_VALUES_BACKOFF 4 /* 'E'=Exponential 'L'=Linear */
+#define AX25_VALUES_CONMODE 5 /* Allow connected modes - 0=No 1=Yes */
+#define AX25_VALUES_WINDOW 6 /* Default window size for standard AX.25 */
+#define AX25_VALUES_EWINDOW 7 /* Default window size for extended AX.25 */
+#define AX25_VALUES_T1 8 /* Default T1 timeout value */
+#define AX25_VALUES_T2 9 /* Default T2 timeout value */
+#define AX25_VALUES_T3 10 /* Default T3 timeout value */
+#define AX25_VALUES_N2 11 /* Default N2 value */
+#define AX25_VALUES_DIGI 12 /* Digipeat mode */
+#define AX25_VALUES_IDLE 13 /* mode vc idle timer */
+#define AX25_VALUES_PACLEN 14 /* AX.25 MTU */
+#define AX25_VALUES_IPMAXQUEUE 15 /* Maximum number of buffers enqueued */
+#define AX25_MAX_VALUES 20
+
+struct ax25_parms_struct
+ {
+ ax25_address port_addr;
+ unsigned short values[AX25_MAX_VALUES];
+ };
+
+#endif /* netax25/ax25.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/netdb.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netdb.h
new file mode 100644
index 0000000..fe3da82
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netdb.h
@@ -0,0 +1,658 @@
+/* Copyright (C) 1996-2002, 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* All data returned by the network data base library are supplied in
+ host order and returned in network order (suitable for use in
+ system calls). */
+
+#ifndef _NETDB_H
+#define _NETDB_H 1
+
+#include <features.h>
+
+#include <netinet/in.h>
+#include <stdint.h>
+#ifdef __USE_MISC
+/* This is necessary to make this include file properly replace the
+ Sun version. */
+# include <rpc/netdb.h>
+#endif
+
+#ifdef __USE_GNU
+# define __need_sigevent_t
+# include <bits/siginfo.h>
+# define __need_timespec
+# include <time.h>
+#endif
+
+#include <bits/netdb.h>
+
+/* Absolute file name for network data base files. */
+#define _PATH_HEQUIV "/etc/hosts.equiv"
+#define _PATH_HOSTS "/etc/hosts"
+#define _PATH_NETWORKS "/etc/networks"
+#define _PATH_NSSWITCH_CONF "/etc/nsswitch.conf"
+#define _PATH_PROTOCOLS "/etc/protocols"
+#define _PATH_SERVICES "/etc/services"
+
+
+__BEGIN_DECLS
+
+/* Error status for non-reentrant lookup functions.
+ We use a macro to access always the thread-specific `h_errno' variable.
+ We always need the extern int here in case internal libc code undefines
+ the macro because it needs access to the underlying storage. */
+extern int h_errno;
+#ifdef __UCLIBC_HAS_THREADS__
+# define h_errno (*__h_errno_location ())
+#endif
+
+/* Function to get address of global `h_errno' variable. */
+extern int *__h_errno_location (void) __THROW __attribute__ ((__const__));
+
+#ifdef _LIBC
+# define __set_h_errno(x) (h_errno = (x))
+#endif
+
+/* Possible values left in `h_errno'. */
+#define NETDB_INTERNAL -1 /* See errno. */
+#define NETDB_SUCCESS 0 /* No problem. */
+#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found. */
+#define TRY_AGAIN 2 /* Non-Authoritative Host not found,
+ or SERVERFAIL. */
+#define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED,
+ NOTIMP. */
+#define NO_DATA 4 /* Valid name, no data record of requested
+ type. */
+#define NO_ADDRESS NO_DATA /* No address, look for MX record. */
+
+#ifdef __USE_XOPEN2K
+/* Highest reserved Internet port number. */
+# define IPPORT_RESERVED 1024
+#endif
+
+#ifdef __USE_GNU
+/* Scope delimiter for getaddrinfo(), getnameinfo(). */
+# define SCOPE_DELIMITER '%'
+#endif
+
+/* Print error indicated by `h_errno' variable on standard error. STR
+ if non-null is printed before the error string. */
+extern void herror (__const char *__str) __THROW;
+
+/* Return string associated with error ERR_NUM. */
+extern __const char *hstrerror (int __err_num) __THROW;
+
+
+
+/* Description of data base entry for a single host. */
+struct hostent
+{
+ char *h_name; /* Official name of host. */
+ char **h_aliases; /* Alias list. */
+ int h_addrtype; /* Host address type. */
+ int h_length; /* Length of address. */
+ char **h_addr_list; /* List of addresses from name server. */
+#define h_addr h_addr_list[0] /* Address, for backward compatibility. */
+};
+
+/* Open host data base files and mark them as staying open even after
+ a later search if STAY_OPEN is non-zero.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void sethostent (int __stay_open);
+
+/* Close host data base files and clear `stay open' flag.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void endhostent (void);
+
+/* Get next entry from host data base file. Open data base if
+ necessary.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct hostent *gethostent (void);
+
+/* Return entry from host data base which address match ADDR with
+ length LEN and type TYPE.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct hostent *gethostbyaddr (__const void *__addr, __socklen_t __len,
+ int __type);
+
+/* Return entry from host data base for host with NAME.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct hostent *gethostbyname (__const char *__name);
+
+#ifdef __USE_MISC
+/* Return entry from host data base for host with NAME. AF must be
+ set to the address type which is `AF_INET' for IPv4 or `AF_INET6'
+ for IPv6.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern struct hostent *gethostbyname2 (__const char *__name, int __af);
+
+/* Reentrant versions of the functions above. The additional
+ arguments specify a buffer of BUFLEN starting at BUF. The last
+ argument is a pointer to a variable which gets the value which
+ would be stored in the global variable `herrno' by the
+ non-reentrant functions.
+
+ These functions are not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation they are cancellation points and
+ therefore not marked with __THROW. */
+extern int gethostent_r (struct hostent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct hostent **__restrict __result,
+ int *__restrict __h_errnop);
+
+extern int gethostbyaddr_r (__const void *__restrict __addr, __socklen_t __len,
+ int __type,
+ struct hostent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct hostent **__restrict __result,
+ int *__restrict __h_errnop);
+
+extern int gethostbyname_r (__const char *__restrict __name,
+ struct hostent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct hostent **__restrict __result,
+ int *__restrict __h_errnop);
+
+extern int gethostbyname2_r (__const char *__restrict __name, int __af,
+ struct hostent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct hostent **__restrict __result,
+ int *__restrict __h_errnop);
+#endif /* misc */
+
+
+/* Open network data base files and mark them as staying open even
+ after a later search if STAY_OPEN is non-zero.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void setnetent (int __stay_open);
+
+/* Close network data base files and clear `stay open' flag.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void endnetent (void);
+
+/* Get next entry from network data base file. Open data base if
+ necessary.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct netent *getnetent (void);
+
+/* Return entry from network data base which address match NET and
+ type TYPE.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct netent *getnetbyaddr (uint32_t __net, int __type);
+
+/* Return entry from network data base for network with NAME.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct netent *getnetbyname (__const char *__name);
+
+#if 0
+/* FIXME */
+#ifdef __USE_MISC
+/* Reentrant versions of the functions above. The additional
+ arguments specify a buffer of BUFLEN starting at BUF. The last
+ argument is a pointer to a variable which gets the value which
+ would be stored in the global variable `herrno' by the
+ non-reentrant functions.
+
+ These functions are not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation they are cancellation points and
+ therefore not marked with __THROW. */
+extern int getnetent_r (struct netent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct netent **__restrict __result,
+ int *__restrict __h_errnop);
+
+extern int getnetbyaddr_r (uint32_t __net, int __type,
+ struct netent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct netent **__restrict __result,
+ int *__restrict __h_errnop);
+
+extern int getnetbyname_r (__const char *__restrict __name,
+ struct netent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct netent **__restrict __result,
+ int *__restrict __h_errnop);
+#endif /* misc */
+#endif
+
+
+/* Description of data base entry for a single service. */
+struct servent
+{
+ char *s_name; /* Official service name. */
+ char **s_aliases; /* Alias list. */
+ int s_port; /* Port number. */
+ char *s_proto; /* Protocol to use. */
+};
+
+/* Open service data base files and mark them as staying open even
+ after a later search if STAY_OPEN is non-zero.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void setservent (int __stay_open);
+
+/* Close service data base files and clear `stay open' flag.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void endservent (void);
+
+/* Get next entry from service data base file. Open data base if
+ necessary.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct servent *getservent (void);
+
+/* Return entry from network data base for network with NAME and
+ protocol PROTO.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct servent *getservbyname (__const char *__name,
+ __const char *__proto);
+
+/* Return entry from service data base which matches port PORT and
+ protocol PROTO.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct servent *getservbyport (int __port, __const char *__proto);
+
+
+#ifdef __USE_MISC
+/* Reentrant versions of the functions above. The additional
+ arguments specify a buffer of BUFLEN starting at BUF.
+
+ These functions are not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation they are cancellation points and
+ therefore not marked with __THROW. */
+extern int getservent_r (struct servent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct servent **__restrict __result);
+
+extern int getservbyname_r (__const char *__restrict __name,
+ __const char *__restrict __proto,
+ struct servent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct servent **__restrict __result);
+
+extern int getservbyport_r (int __port, __const char *__restrict __proto,
+ struct servent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct servent **__restrict __result);
+#endif /* misc */
+
+
+/* Description of data base entry for a single service. */
+struct protoent
+{
+ char *p_name; /* Official protocol name. */
+ char **p_aliases; /* Alias list. */
+ int p_proto; /* Protocol number. */
+};
+
+/* Open protocol data base files and mark them as staying open even
+ after a later search if STAY_OPEN is non-zero.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void setprotoent (int __stay_open);
+
+/* Close protocol data base files and clear `stay open' flag.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void endprotoent (void);
+
+/* Get next entry from protocol data base file. Open data base if
+ necessary.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct protoent *getprotoent (void);
+
+/* Return entry from protocol data base for network with NAME.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct protoent *getprotobyname (__const char *__name);
+
+/* Return entry from protocol data base which number is PROTO.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct protoent *getprotobynumber (int __proto);
+
+
+#ifdef __USE_MISC
+/* Reentrant versions of the functions above. The additional
+ arguments specify a buffer of BUFLEN starting at BUF.
+
+ These functions are not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation they are cancellation points and
+ therefore not marked with __THROW. */
+extern int getprotoent_r (struct protoent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct protoent **__restrict __result);
+
+extern int getprotobyname_r (__const char *__restrict __name,
+ struct protoent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct protoent **__restrict __result);
+
+extern int getprotobynumber_r (int __proto,
+ struct protoent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct protoent **__restrict __result);
+
+
+#ifdef __UCLIBC_HAS_NETGROUP__
+/* Establish network group NETGROUP for enumeration.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int setnetgrent (__const char *__netgroup);
+
+/* Free all space allocated by previous `setnetgrent' call.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern void endnetgrent (void);
+
+/* Get next member of netgroup established by last `setnetgrent' call
+ and return pointers to elements in HOSTP, USERP, and DOMAINP.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int getnetgrent (char **__restrict __hostp,
+ char **__restrict __userp,
+ char **__restrict __domainp);
+
+
+/* Test whether NETGROUP contains the triple (HOST,USER,DOMAIN).
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int innetgr (__const char *__netgroup, __const char *__host,
+ __const char *__user, __const char *domain);
+
+/* Reentrant version of `getnetgrent' where result is placed in BUFFER.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int getnetgrent_r (char **__restrict __hostp,
+ char **__restrict __userp,
+ char **__restrict __domainp,
+ char *__restrict __buffer, size_t __buflen);
+#endif /* UCLIBC_HAS_NETGROUP */
+#endif /* misc */
+
+
+#ifdef __USE_BSD
+/* Call `rshd' at port RPORT on remote machine *AHOST to execute CMD.
+ The local user is LOCUSER, on the remote machine the command is
+ executed as REMUSER. In *FD2P the descriptor to the socket for the
+ connection is returned. The caller must have the right to use a
+ reserved port. When the function returns *AHOST contains the
+ official host name.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int rcmd (char **__restrict __ahost, unsigned short int __rport,
+ __const char *__restrict __locuser,
+ __const char *__restrict __remuser,
+ __const char *__restrict __cmd, int *__restrict __fd2p);
+
+#if 0
+/* FIXME */
+/* This is the equivalent function where the protocol can be selected
+ and which therefore can be used for IPv6.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int rcmd_af (char **__restrict __ahost, unsigned short int __rport,
+ __const char *__restrict __locuser,
+ __const char *__restrict __remuser,
+ __const char *__restrict __cmd, int *__restrict __fd2p,
+ sa_family_t __af);
+#endif
+
+/* Call `rexecd' at port RPORT on remote machine *AHOST to execute
+ CMD. The process runs at the remote machine using the ID of user
+ NAME whose cleartext password is PASSWD. In *FD2P the descriptor
+ to the socket for the connection is returned. When the function
+ returns *AHOST contains the official host name.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int rexec (char **__restrict __ahost, int __rport,
+ __const char *__restrict __name,
+ __const char *__restrict __pass,
+ __const char *__restrict __cmd, int *__restrict __fd2p);
+
+/* This is the equivalent function where the protocol can be selected
+ and which therefore can be used for IPv6.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int rexec_af (char **__restrict __ahost, int __rport,
+ __const char *__restrict __name,
+ __const char *__restrict __pass,
+ __const char *__restrict __cmd, int *__restrict __fd2p,
+ sa_family_t __af);
+
+/* Check whether user REMUSER on system RHOST is allowed to login as LOCUSER.
+ If SUSER is not zero the user tries to become superuser. Return 0 if
+ it is possible.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int ruserok (__const char *__rhost, int __suser,
+ __const char *__remuser, __const char *__locuser);
+
+#if 0
+/* FIXME */
+/* This is the equivalent function where the protocol can be selected
+ and which therefore can be used for IPv6.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int ruserok_af (__const char *__rhost, int __suser,
+ __const char *__remuser, __const char *__locuser,
+ sa_family_t __af);
+#endif
+
+/* Try to allocate reserved port, returning a descriptor for a socket opened
+ at this port or -1 if unsuccessful. The search for an available port
+ will start at ALPORT and continues with lower numbers.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int rresvport (int *__alport);
+
+#if 0
+/* FIXME */
+/* This is the equivalent function where the protocol can be selected
+ and which therefore can be used for IPv6.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int rresvport_af (int *__alport, sa_family_t __af);
+#endif
+#endif
+
+
+/* Extension from POSIX.1g. */
+#ifdef __USE_POSIX
+/* Structure to contain information about address of a service provider. */
+struct addrinfo
+{
+ int ai_flags; /* Input flags. */
+ int ai_family; /* Protocol family for socket. */
+ int ai_socktype; /* Socket type. */
+ int ai_protocol; /* Protocol for socket. */
+ socklen_t ai_addrlen; /* Length of socket address. */
+ struct sockaddr *ai_addr; /* Socket address for socket. */
+ char *ai_canonname; /* Canonical name for service location. */
+ struct addrinfo *ai_next; /* Pointer to next in list. */
+};
+
+/* Possible values for `ai_flags' field in `addrinfo' structure. */
+# define AI_PASSIVE 0x0001 /* Socket address is intended for `bind'. */
+# define AI_CANONNAME 0x0002 /* Request for canonical name. */
+# define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */
+# define AI_V4MAPPED 0x0008 /* IPv4 mapped addresses are acceptable. */
+# define AI_ALL 0x0010 /* Return IPv4 mapped and IPv6 addresses. */
+# define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose
+ returned address type.. */
+# ifdef __USE_GNU
+# define AI_IDN 0x0040 /* IDN encode input (assuming it is encoded
+ in the current locale's character set)
+ before looking it up. */
+# define AI_CANONIDN 0x0080 /* Translate canonical name from IDN format. */
+# define AI_IDN_ALLOW_UNASSIGNED 0x0100 /* Don't reject unassigned Unicode
+ code points. */
+# define AI_IDN_USE_STD3_ASCII_RULES 0x0200 /* Validate strings according to
+ STD3 rules. */
+# endif
+# define AI_NUMERICSERV 0x0400 /* Don't use name resolution. */
+
+/* Error values for `getaddrinfo' function. */
+# define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */
+# define EAI_NONAME -2 /* NAME or SERVICE is unknown. */
+# define EAI_AGAIN -3 /* Temporary failure in name resolution. */
+# define EAI_FAIL -4 /* Non-recoverable failure in name res. */
+# define EAI_NODATA -5 /* No address associated with NAME. */
+# define EAI_FAMILY -6 /* `ai_family' not supported. */
+# define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */
+# define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */
+# define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */
+# define EAI_MEMORY -10 /* Memory allocation failure. */
+# define EAI_SYSTEM -11 /* System error returned in `errno'. */
+# define EAI_OVERFLOW -12 /* Argument buffer overflow. */
+# ifdef __USE_GNU
+# define EAI_INPROGRESS -100 /* Processing request in progress. */
+# define EAI_CANCELED -101 /* Request canceled. */
+# define EAI_NOTCANCELED -102 /* Request not canceled. */
+# define EAI_ALLDONE -103 /* All requests done. */
+# define EAI_INTR -104 /* Interrupted by a signal. */
+# define EAI_IDN_ENCODE -105 /* IDN encoding failed. */
+# endif
+
+# define NI_MAXHOST 1025
+# define NI_MAXSERV 32
+
+# define NI_NUMERICHOST 1 /* Don't try to look up hostname. */
+# define NI_NUMERICSERV 2 /* Don't convert port number to name. */
+# define NI_NOFQDN 4 /* Only return nodename portion. */
+# define NI_NAMEREQD 8 /* Don't return numeric addresses. */
+# define NI_DGRAM 16 /* Look up UDP service rather than TCP. */
+# ifdef __USE_GNU
+# define NI_IDN 32 /* Convert name from IDN format. */
+# define NI_IDN_ALLOW_UNASSIGNED 64 /* Don't reject unassigned Unicode
+ code points. */
+# define NI_IDN_USE_STD3_ASCII_RULES 128 /* Validate strings according to
+ STD3 rules. */
+# endif
+
+/* Translate name of a service location and/or a service name to set of
+ socket addresses.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int getaddrinfo (__const char *__restrict __name,
+ __const char *__restrict __service,
+ __const struct addrinfo *__restrict __req,
+ struct addrinfo **__restrict __pai);
+
+/* Free `addrinfo' structure AI including associated storage. */
+extern void freeaddrinfo (struct addrinfo *__ai) __THROW;
+
+/* Convert error return from getaddrinfo() to a string. */
+extern __const char *gai_strerror (int __ecode) __THROW;
+
+/* Translate a socket address to a location and service name.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int getnameinfo (__const struct sockaddr *__restrict __sa,
+ socklen_t __salen, char *__restrict __host,
+ socklen_t __hostlen, char *__restrict __serv,
+ socklen_t __servlen, unsigned int __flags);
+#endif /* POSIX */
+
+__END_DECLS
+
+#endif /* netdb.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/neteconet/ec.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/neteconet/ec.h
new file mode 100644
index 0000000..f21601c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/neteconet/ec.h
@@ -0,0 +1,52 @@
+/* Definitions for use with Linux AF_ECONET sockets.
+ Copyright (C) 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETECONET_EC_H
+#define _NETECONET_EC_H 1
+
+#include <features.h>
+#include <bits/sockaddr.h>
+
+struct ec_addr
+ {
+ unsigned char station; /* Station number. */
+ unsigned char net; /* Network number. */
+ };
+
+struct sockaddr_ec
+ {
+ __SOCKADDR_COMMON (sec_);
+ unsigned char port; /* Port number. */
+ unsigned char cb; /* Control/flag byte. */
+ unsigned char type; /* Type of message. */
+ struct ec_addr addr;
+ unsigned long cookie;
+ };
+
+#define ECTYPE_PACKET_RECEIVED 0 /* Packet received */
+#define ECTYPE_TRANSMIT_STATUS 0x10 /* Transmit completed */
+
+#define ECTYPE_TRANSMIT_OK 1
+#define ECTYPE_TRANSMIT_NOT_LISTENING 2
+#define ECTYPE_TRANSMIT_NET_ERROR 3
+#define ECTYPE_TRANSMIT_NO_CLOCK 4
+#define ECTYPE_TRANSMIT_LINE_JAMMED 5
+#define ECTYPE_TRANSMIT_NOT_PRESENT 6
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ether.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ether.h
new file mode 100644
index 0000000..ca780e2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ether.h
@@ -0,0 +1,54 @@
+/* Functions for storing Ethernet addresses in ASCII and mapping to hostnames.
+ Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETINET_ETHER_H
+#define _NETINET_ETHER_H 1
+
+#include <features.h>
+
+/* Get definition of `struct ether_addr'. */
+#include <netinet/if_ether.h>
+
+__BEGIN_DECLS
+
+/* Convert 48 bit Ethernet ADDRess to ASCII. */
+extern char *ether_ntoa (__const struct ether_addr *__addr) __THROW;
+extern char *ether_ntoa_r (__const struct ether_addr *__addr, char *__buf)
+ __THROW;
+
+/* Convert ASCII string S to 48 bit Ethernet address. */
+extern struct ether_addr *ether_aton (__const char *__asc) __THROW;
+extern struct ether_addr *ether_aton_r (__const char *__asc,
+ struct ether_addr *__addr) __THROW;
+
+/* Map 48 bit Ethernet number ADDR to HOSTNAME. */
+extern int ether_ntohost (char *__hostname, __const struct ether_addr *__addr)
+ __THROW;
+
+/* Map HOSTNAME to 48 bit Ethernet address. */
+extern int ether_hostton (__const char *__hostname, struct ether_addr *__addr)
+ __THROW;
+
+/* Scan LINE and set ADDR and HOSTNAME. */
+extern int ether_line (__const char *__line, struct ether_addr *__addr,
+ char *__hostname) __THROW;
+
+__END_DECLS
+
+#endif /* netinet/ether.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/icmp6.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/icmp6.h
new file mode 100644
index 0000000..c5138a3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/icmp6.h
@@ -0,0 +1,346 @@
+/* Copyright (C) 1991,92,93,94,95,96,97,2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETINET_ICMP6_H
+#define _NETINET_ICMP6_H 1
+
+#include <inttypes.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#define ICMP6_FILTER 1
+
+#define ICMP6_FILTER_BLOCK 1
+#define ICMP6_FILTER_PASS 2
+#define ICMP6_FILTER_BLOCKOTHERS 3
+#define ICMP6_FILTER_PASSONLY 4
+
+struct icmp6_filter
+ {
+ uint32_t icmp6_filt[8];
+ };
+
+struct icmp6_hdr
+ {
+ uint8_t icmp6_type; /* type field */
+ uint8_t icmp6_code; /* code field */
+ uint16_t icmp6_cksum; /* checksum field */
+ union
+ {
+ uint32_t icmp6_un_data32[1]; /* type-specific field */
+ uint16_t icmp6_un_data16[2]; /* type-specific field */
+ uint8_t icmp6_un_data8[4]; /* type-specific field */
+ } icmp6_dataun;
+ };
+
+#define icmp6_data32 icmp6_dataun.icmp6_un_data32
+#define icmp6_data16 icmp6_dataun.icmp6_un_data16
+#define icmp6_data8 icmp6_dataun.icmp6_un_data8
+#define icmp6_pptr icmp6_data32[0] /* parameter prob */
+#define icmp6_mtu icmp6_data32[0] /* packet too big */
+#define icmp6_id icmp6_data16[0] /* echo request/reply */
+#define icmp6_seq icmp6_data16[1] /* echo request/reply */
+#define icmp6_maxdelay icmp6_data16[0] /* mcast group membership */
+
+#define ICMP6_DST_UNREACH 1
+#define ICMP6_PACKET_TOO_BIG 2
+#define ICMP6_TIME_EXCEEDED 3
+#define ICMP6_PARAM_PROB 4
+
+#define ICMP6_INFOMSG_MASK 0x80 /* all informational messages */
+
+#define ICMP6_ECHO_REQUEST 128
+#define ICMP6_ECHO_REPLY 129
+#define MLD_LISTENER_QUERY 130
+#define MLD_LISTENER_REPORT 131
+#define MLD_LISTENER_REDUCTION 132
+
+#define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */
+#define ICMP6_DST_UNREACH_ADMIN 1 /* communication with destination */
+ /* administratively prohibited */
+#define ICMP6_DST_UNREACH_BEYONDSCOPE 2 /* beyond scope of source address */
+#define ICMP6_DST_UNREACH_ADDR 3 /* address unreachable */
+#define ICMP6_DST_UNREACH_NOPORT 4 /* bad port */
+
+#define ICMP6_TIME_EXCEED_TRANSIT 0 /* Hop Limit == 0 in transit */
+#define ICMP6_TIME_EXCEED_REASSEMBLY 1 /* Reassembly time out */
+
+#define ICMP6_PARAMPROB_HEADER 0 /* erroneous header field */
+#define ICMP6_PARAMPROB_NEXTHEADER 1 /* unrecognized Next Header */
+#define ICMP6_PARAMPROB_OPTION 2 /* unrecognized IPv6 option */
+
+#define ICMP6_FILTER_WILLPASS(type, filterp) \
+ ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0)
+
+#define ICMP6_FILTER_WILLBLOCK(type, filterp) \
+ ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0)
+
+#define ICMP6_FILTER_SETPASS(type, filterp) \
+ ((((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31))))
+
+#define ICMP6_FILTER_SETBLOCK(type, filterp) \
+ ((((filterp)->icmp6_filt[(type) >> 5]) |= (1 << ((type) & 31))))
+
+#define ICMP6_FILTER_SETPASSALL(filterp) \
+ memset (filterp, 0, sizeof (struct icmp6_filter));
+
+#define ICMP6_FILTER_SETBLOCKALL(filterp) \
+ memset (filterp, 0xFF, sizeof (struct icmp6_filter));
+
+#define ND_ROUTER_SOLICIT 133
+#define ND_ROUTER_ADVERT 134
+#define ND_NEIGHBOR_SOLICIT 135
+#define ND_NEIGHBOR_ADVERT 136
+#define ND_REDIRECT 137
+
+struct nd_router_solicit /* router solicitation */
+ {
+ struct icmp6_hdr nd_rs_hdr;
+ /* could be followed by options */
+ };
+
+#define nd_rs_type nd_rs_hdr.icmp6_type
+#define nd_rs_code nd_rs_hdr.icmp6_code
+#define nd_rs_cksum nd_rs_hdr.icmp6_cksum
+#define nd_rs_reserved nd_rs_hdr.icmp6_data32[0]
+
+struct nd_router_advert /* router advertisement */
+ {
+ struct icmp6_hdr nd_ra_hdr;
+ uint32_t nd_ra_reachable; /* reachable time */
+ uint32_t nd_ra_retransmit; /* retransmit timer */
+ /* could be followed by options */
+ };
+
+#define nd_ra_type nd_ra_hdr.icmp6_type
+#define nd_ra_code nd_ra_hdr.icmp6_code
+#define nd_ra_cksum nd_ra_hdr.icmp6_cksum
+#define nd_ra_curhoplimit nd_ra_hdr.icmp6_data8[0]
+#define nd_ra_flags_reserved nd_ra_hdr.icmp6_data8[1]
+#define ND_RA_FLAG_MANAGED 0x80
+#define ND_RA_FLAG_OTHER 0x40
+#define ND_RA_FLAG_HOME_AGENT 0x20
+#define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1]
+
+struct nd_neighbor_solicit /* neighbor solicitation */
+ {
+ struct icmp6_hdr nd_ns_hdr;
+ struct in6_addr nd_ns_target; /* target address */
+ /* could be followed by options */
+ };
+
+#define nd_ns_type nd_ns_hdr.icmp6_type
+#define nd_ns_code nd_ns_hdr.icmp6_code
+#define nd_ns_cksum nd_ns_hdr.icmp6_cksum
+#define nd_ns_reserved nd_ns_hdr.icmp6_data32[0]
+
+struct nd_neighbor_advert /* neighbor advertisement */
+ {
+ struct icmp6_hdr nd_na_hdr;
+ struct in6_addr nd_na_target; /* target address */
+ /* could be followed by options */
+ };
+
+#define nd_na_type nd_na_hdr.icmp6_type
+#define nd_na_code nd_na_hdr.icmp6_code
+#define nd_na_cksum nd_na_hdr.icmp6_cksum
+#define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0]
+#if BYTE_ORDER == BIG_ENDIAN
+#define ND_NA_FLAG_ROUTER 0x80000000
+#define ND_NA_FLAG_SOLICITED 0x40000000
+#define ND_NA_FLAG_OVERRIDE 0x20000000
+#else /* BYTE_ORDER == LITTLE_ENDIAN */
+#define ND_NA_FLAG_ROUTER 0x00000080
+#define ND_NA_FLAG_SOLICITED 0x00000040
+#define ND_NA_FLAG_OVERRIDE 0x00000020
+#endif
+
+struct nd_redirect /* redirect */
+ {
+ struct icmp6_hdr nd_rd_hdr;
+ struct in6_addr nd_rd_target; /* target address */
+ struct in6_addr nd_rd_dst; /* destination address */
+ /* could be followed by options */
+ };
+
+#define nd_rd_type nd_rd_hdr.icmp6_type
+#define nd_rd_code nd_rd_hdr.icmp6_code
+#define nd_rd_cksum nd_rd_hdr.icmp6_cksum
+#define nd_rd_reserved nd_rd_hdr.icmp6_data32[0]
+
+struct nd_opt_hdr /* Neighbor discovery option header */
+ {
+ uint8_t nd_opt_type;
+ uint8_t nd_opt_len; /* in units of 8 octets */
+ /* followed by option specific data */
+ };
+
+#define ND_OPT_SOURCE_LINKADDR 1
+#define ND_OPT_TARGET_LINKADDR 2
+#define ND_OPT_PREFIX_INFORMATION 3
+#define ND_OPT_REDIRECTED_HEADER 4
+#define ND_OPT_MTU 5
+#define ND_OPT_RTR_ADV_INTERVAL 7
+#define ND_OPT_HOME_AGENT_INFO 8
+
+struct nd_opt_prefix_info /* prefix information */
+ {
+ uint8_t nd_opt_pi_type;
+ uint8_t nd_opt_pi_len;
+ uint8_t nd_opt_pi_prefix_len;
+ uint8_t nd_opt_pi_flags_reserved;
+ uint32_t nd_opt_pi_valid_time;
+ uint32_t nd_opt_pi_preferred_time;
+ uint32_t nd_opt_pi_reserved2;
+ struct in6_addr nd_opt_pi_prefix;
+ };
+
+#define ND_OPT_PI_FLAG_ONLINK 0x80
+#define ND_OPT_PI_FLAG_AUTO 0x40
+#define ND_OPT_PI_FLAG_RADDR 0x20
+
+struct nd_opt_rd_hdr /* redirected header */
+ {
+ uint8_t nd_opt_rh_type;
+ uint8_t nd_opt_rh_len;
+ uint16_t nd_opt_rh_reserved1;
+ uint32_t nd_opt_rh_reserved2;
+ /* followed by IP header and data */
+ };
+
+struct nd_opt_mtu /* MTU option */
+ {
+ uint8_t nd_opt_mtu_type;
+ uint8_t nd_opt_mtu_len;
+ uint16_t nd_opt_mtu_reserved;
+ uint32_t nd_opt_mtu_mtu;
+ };
+
+struct mld_hdr
+ {
+ struct icmp6_hdr mld_icmp6_hdr;
+ struct in6_addr mld_addr; /* multicast address */
+ };
+
+#define mld_type mld_icmp6_hdr.icmp6_type
+#define mld_code mld_icmp6_hdr.icmp6_code
+#define mld_cksum mld_icmp6_hdr.icmp6_cksum
+#define mld_maxdelay mld_icmp6_hdr.icmp6_data16[0]
+#define mld_reserved mld_icmp6_hdr.icmp6_data16[1]
+
+#define ICMP6_ROUTER_RENUMBERING 138
+
+struct icmp6_router_renum /* router renumbering header */
+ {
+ struct icmp6_hdr rr_hdr;
+ uint8_t rr_segnum;
+ uint8_t rr_flags;
+ uint16_t rr_maxdelay;
+ uint32_t rr_reserved;
+ };
+
+#define rr_type rr_hdr.icmp6_type
+#define rr_code rr_hdr.icmp6_code
+#define rr_cksum rr_hdr.icmp6_cksum
+#define rr_seqnum rr_hdr.icmp6_data32[0]
+
+/* Router renumbering flags */
+#define ICMP6_RR_FLAGS_TEST 0x80
+#define ICMP6_RR_FLAGS_REQRESULT 0x40
+#define ICMP6_RR_FLAGS_FORCEAPPLY 0x20
+#define ICMP6_RR_FLAGS_SPECSITE 0x10
+#define ICMP6_RR_FLAGS_PREVDONE 0x08
+
+struct rr_pco_match /* match prefix part */
+ {
+ uint8_t rpm_code;
+ uint8_t rpm_len;
+ uint8_t rpm_ordinal;
+ uint8_t rpm_matchlen;
+ uint8_t rpm_minlen;
+ uint8_t rpm_maxlen;
+ uint16_t rpm_reserved;
+ struct in6_addr rpm_prefix;
+ };
+
+/* PCO code values */
+#define RPM_PCO_ADD 1
+#define RPM_PCO_CHANGE 2
+#define RPM_PCO_SETGLOBAL 3
+
+struct rr_pco_use /* use prefix part */
+ {
+ uint8_t rpu_uselen;
+ uint8_t rpu_keeplen;
+ uint8_t rpu_ramask;
+ uint8_t rpu_raflags;
+ uint32_t rpu_vltime;
+ uint32_t rpu_pltime;
+ uint32_t rpu_flags;
+ struct in6_addr rpu_prefix;
+ };
+
+#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x20
+#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x10
+
+#if BYTE_ORDER == BIG_ENDIAN
+# define ICMP6_RR_PCOUSE_DECRVLTIME 0x80000000
+# define ICMP6_RR_PCOUSE_DECRPLTIME 0x40000000
+#elif BYTE_ORDER == LITTLE_ENDIAN
+# define ICMP6_RR_PCOUSE_DECRVLTIME 0x80
+# define ICMP6_RR_PCOUSE_DECRPLTIME 0x40
+#endif
+
+struct rr_result /* router renumbering result message */
+ {
+ uint16_t rrr_flags;
+ uint8_t rrr_ordinal;
+ uint8_t rrr_matchedlen;
+ uint32_t rrr_ifid;
+ struct in6_addr rrr_prefix;
+ };
+
+#if BYTE_ORDER == BIG_ENDIAN
+# define ICMP6_RR_RESULT_FLAGS_OOB 0x0002
+# define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0001
+#elif BYTE_ORDER == LITTLE_ENDIAN
+# define ICMP6_RR_RESULT_FLAGS_OOB 0x0200
+# define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0100
+#endif
+
+/* Mobile IPv6 extension: Advertisement Interval. */
+struct nd_opt_adv_interval
+ {
+ uint8_t nd_opt_adv_interval_type;
+ uint8_t nd_opt_adv_interval_len;
+ uint16_t nd_opt_adv_interval_reserved;
+ uint32_t nd_opt_adv_interval_ival;
+ };
+
+/* Mobile IPv6 extension: Home Agent Info. */
+struct nd_opt_home_agent_info
+ {
+ uint8_t nd_opt_home_agent_info_type;
+ uint8_t nd_opt_home_agent_info_len;
+ uint16_t nd_opt_home_agent_info_reserved;
+ int16_t nd_opt_home_agent_info_preference;
+ uint16_t nd_opt_home_agent_info_lifetime;
+ };
+
+#endif /* netinet/icmpv6.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/if_ether.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/if_ether.h
new file mode 100644
index 0000000..aadb59b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/if_ether.h
@@ -0,0 +1,105 @@
+/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef __NETINET_IF_ETHER_H
+
+#define __NETINET_IF_ETHER_H 1
+#include <features.h>
+#include <sys/types.h>
+
+/* Get definitions from kernel header file. */
+#include <linux/if_ether.h>
+
+#ifdef __USE_BSD
+/*
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)if_ether.h 8.3 (Berkeley) 5/2/95
+ * $FreeBSD$
+ */
+
+#include <net/ethernet.h>
+#include <net/if_arp.h>
+
+__BEGIN_DECLS
+/*
+ * Ethernet Address Resolution Protocol.
+ *
+ * See RFC 826 for protocol description. Structure below is adapted
+ * to resolving internet addresses. Field names used correspond to
+ * RFC 826.
+ */
+struct ether_arp {
+ struct arphdr ea_hdr; /* fixed-size header */
+ u_int8_t arp_sha[ETH_ALEN]; /* sender hardware address */
+ u_int8_t arp_spa[4]; /* sender protocol address */
+ u_int8_t arp_tha[ETH_ALEN]; /* target hardware address */
+ u_int8_t arp_tpa[4]; /* target protocol address */
+};
+#define arp_hrd ea_hdr.ar_hrd
+#define arp_pro ea_hdr.ar_pro
+#define arp_hln ea_hdr.ar_hln
+#define arp_pln ea_hdr.ar_pln
+#define arp_op ea_hdr.ar_op
+
+/*
+ * Macro to map an IP multicast address to an Ethernet multicast address.
+ * The high-order 25 bits of the Ethernet address are statically assigned,
+ * and the low-order 23 bits are taken from the low end of the IP address.
+ */
+#define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr) \
+ /* struct in_addr *ipaddr; */ \
+ /* u_char enaddr[ETH_ALEN]; */ \
+{ \
+ (enaddr)[0] = 0x01; \
+ (enaddr)[1] = 0x00; \
+ (enaddr)[2] = 0x5e; \
+ (enaddr)[3] = ((u_int8_t *)ipaddr)[1] & 0x7f; \
+ (enaddr)[4] = ((u_int8_t *)ipaddr)[2]; \
+ (enaddr)[5] = ((u_int8_t *)ipaddr)[3]; \
+}
+
+__END_DECLS
+#endif /* __USE_BSD */
+
+#endif /* netinet/if_ether.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/if_fddi.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/if_fddi.h
new file mode 100644
index 0000000..1a0ec92
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/if_fddi.h
@@ -0,0 +1,37 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETINET_IF_FDDI_H
+#define _NETINET_IF_FDDI_H 1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <asm/types.h>
+
+#include <linux/if_fddi.h>
+
+#ifdef __USE_BSD
+
+struct fddi_header {
+ u_int8_t fddi_fc; /* Frame Control (FC) value */
+ u_int8_t fddi_dhost[FDDI_K_ALEN]; /* Destination host */
+ u_int8_t fddi_shost[FDDI_K_ALEN]; /* Source host */
+};
+#endif
+
+#endif /* netinet/if_fddi.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/if_tr.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/if_tr.h
new file mode 100644
index 0000000..1a7bc68
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/if_tr.h
@@ -0,0 +1,41 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETINET_IF_TR_H
+#define _NETINET_IF_TR_H 1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <asm/types.h>
+
+#include <linux/if_tr.h>
+
+#ifdef __USE_BSD
+
+struct trn_hdr {
+ u_int8_t trn_ac; /* access control field */
+ u_int8_t trn_fc; /* field control field */
+ u_int8_t trn_dhost[TR_ALEN]; /* destination host */
+ u_int8_t trn_shost[TR_ALEN]; /* source host */
+ u_int16_t trn_rcf; /* route control field */
+ u_int16_t trn_rseg[8]; /* routing registers */
+};
+
+#endif
+
+#endif /* netinet/if_tr.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/igmp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/igmp.h
new file mode 100644
index 0000000..67396ba
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/igmp.h
@@ -0,0 +1,126 @@
+/* Copyright (C) 1997, 1999, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETINET_IGMP_H
+#define _NETINET_IGMP_H 1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#ifdef __USE_BSD
+
+#include <netinet/in.h>
+
+__BEGIN_DECLS
+
+/*
+ * Copyright (c) 1988 Stephen Deering.
+ * Copyright (c) 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Stephen Deering of Stanford University.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)igmp.h 8.1 (Berkeley) 6/10/93
+ * $FreeBSD$
+ */
+
+struct igmp {
+ u_int8_t igmp_type; /* IGMP type */
+ u_int8_t igmp_code; /* routing code */
+ u_int16_t igmp_cksum; /* checksum */
+ struct in_addr igmp_group; /* group address */
+};
+
+#define IGMP_MINLEN 8
+
+/*
+ * Message types, including version number.
+ */
+#define IGMP_MEMBERSHIP_QUERY 0x11 /* membership query */
+#define IGMP_V1_MEMBERSHIP_REPORT 0x12 /* Ver. 1 membership report */
+#define IGMP_V2_MEMBERSHIP_REPORT 0x16 /* Ver. 2 membership report */
+#define IGMP_V2_LEAVE_GROUP 0x17 /* Leave-group message */
+
+#define IGMP_DVMRP 0x13 /* DVMRP routing message */
+#define IGMP_PIM 0x14 /* PIM routing message */
+#define IGMP_TRACE 0x15
+
+#define IGMP_MTRACE_RESP 0x1e /* traceroute resp.(to sender)*/
+#define IGMP_MTRACE 0x1f /* mcast traceroute messages */
+
+#define IGMP_MAX_HOST_REPORT_DELAY 10 /* max delay for response to */
+ /* query (in seconds) according */
+ /* to RFC1112 */
+#define IGMP_TIMER_SCALE 10 /* denotes that the igmp code field */
+ /* specifies time in 10th of seconds*/
+
+/*
+ * States for the IGMP v2 state table.
+ */
+#define IGMP_DELAYING_MEMBER 1
+#define IGMP_IDLE_MEMBER 2
+#define IGMP_LAZY_MEMBER 3
+#define IGMP_SLEEPING_MEMBER 4
+#define IGMP_AWAKENING_MEMBER 5
+
+/*
+ * States for IGMP router version cache.
+ */
+#define IGMP_v1_ROUTER 1
+#define IGMP_v2_ROUTER 2
+
+/*
+ * The following four defininitions are for backwards compatibility.
+ * They should be removed as soon as all applications are updated to
+ * use the new constant names.
+ */
+#define IGMP_HOST_MEMBERSHIP_QUERY IGMP_MEMBERSHIP_QUERY
+#define IGMP_HOST_MEMBERSHIP_REPORT IGMP_V1_MEMBERSHIP_REPORT
+#define IGMP_HOST_NEW_MEMBERSHIP_REPORT IGMP_V2_MEMBERSHIP_REPORT
+#define IGMP_HOST_LEAVE_MESSAGE IGMP_V2_LEAVE_GROUP
+
+__END_DECLS
+
+#endif
+
+#endif /* netinet/igmp.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/in.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/in.h
new file mode 100644
index 0000000..935886e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/in.h
@@ -0,0 +1,512 @@
+/* Copyright (C) 1991-2001, 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETINET_IN_H
+#define _NETINET_IN_H 1
+
+#include <features.h>
+#include <stdint.h>
+#include <sys/socket.h>
+#include <bits/types.h>
+
+
+__BEGIN_DECLS
+
+/* Standard well-defined IP protocols. */
+enum
+ {
+ IPPROTO_IP = 0, /* Dummy protocol for TCP. */
+#define IPPROTO_IP IPPROTO_IP
+ IPPROTO_HOPOPTS = 0, /* IPv6 Hop-by-Hop options. */
+#define IPPROTO_HOPOPTS IPPROTO_HOPOPTS
+ IPPROTO_ICMP = 1, /* Internet Control Message Protocol. */
+#define IPPROTO_ICMP IPPROTO_ICMP
+ IPPROTO_IGMP = 2, /* Internet Group Management Protocol. */
+#define IPPROTO_IGMP IPPROTO_IGMP
+ IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94). */
+#define IPPROTO_IPIP IPPROTO_IPIP
+ IPPROTO_TCP = 6, /* Transmission Control Protocol. */
+#define IPPROTO_TCP IPPROTO_TCP
+ IPPROTO_EGP = 8, /* Exterior Gateway Protocol. */
+#define IPPROTO_EGP IPPROTO_EGP
+ IPPROTO_PUP = 12, /* PUP protocol. */
+#define IPPROTO_PUP IPPROTO_PUP
+ IPPROTO_UDP = 17, /* User Datagram Protocol. */
+#define IPPROTO_UDP IPPROTO_UDP
+ IPPROTO_IDP = 22, /* XNS IDP protocol. */
+#define IPPROTO_IDP IPPROTO_IDP
+ IPPROTO_TP = 29, /* SO Transport Protocol Class 4. */
+#define IPPROTO_TP IPPROTO_TP
+ IPPROTO_IPV6 = 41, /* IPv6 header. */
+#define IPPROTO_IPV6 IPPROTO_IPV6
+ IPPROTO_ROUTING = 43, /* IPv6 routing header. */
+#define IPPROTO_ROUTING IPPROTO_ROUTING
+ IPPROTO_FRAGMENT = 44, /* IPv6 fragmentation header. */
+#define IPPROTO_FRAGMENT IPPROTO_FRAGMENT
+ IPPROTO_RSVP = 46, /* Reservation Protocol. */
+#define IPPROTO_RSVP IPPROTO_RSVP
+ IPPROTO_GRE = 47, /* General Routing Encapsulation. */
+#define IPPROTO_GRE IPPROTO_GRE
+ IPPROTO_ESP = 50, /* encapsulating security payload. */
+#define IPPROTO_ESP IPPROTO_ESP
+ IPPROTO_AH = 51, /* authentication header. */
+#define IPPROTO_AH IPPROTO_AH
+ IPPROTO_ICMPV6 = 58, /* ICMPv6. */
+#define IPPROTO_ICMPV6 IPPROTO_ICMPV6
+ IPPROTO_NONE = 59, /* IPv6 no next header. */
+#define IPPROTO_NONE IPPROTO_NONE
+ IPPROTO_DSTOPTS = 60, /* IPv6 destination options. */
+#define IPPROTO_DSTOPTS IPPROTO_DSTOPTS
+ IPPROTO_MTP = 92, /* Multicast Transport Protocol. */
+#define IPPROTO_MTP IPPROTO_MTP
+ IPPROTO_ENCAP = 98, /* Encapsulation Header. */
+#define IPPROTO_ENCAP IPPROTO_ENCAP
+ IPPROTO_PIM = 103, /* Protocol Independent Multicast. */
+#define IPPROTO_PIM IPPROTO_PIM
+ IPPROTO_COMP = 108, /* Compression Header Protocol. */
+#define IPPROTO_COMP IPPROTO_COMP
+ IPPROTO_SCTP = 132, /* Stream Control Transmission Protocol. */
+#define IPPROTO_SCTP IPPROTO_SCTP
+ IPPROTO_RAW = 255, /* Raw IP packets. */
+#define IPPROTO_RAW IPPROTO_RAW
+ IPPROTO_MAX
+ };
+
+
+/* Type to represent a port. */
+typedef uint16_t in_port_t;
+
+/* Standard well-known ports. */
+enum
+ {
+ IPPORT_ECHO = 7, /* Echo service. */
+ IPPORT_DISCARD = 9, /* Discard transmissions service. */
+ IPPORT_SYSTAT = 11, /* System status service. */
+ IPPORT_DAYTIME = 13, /* Time of day service. */
+ IPPORT_NETSTAT = 15, /* Network status service. */
+ IPPORT_FTP = 21, /* File Transfer Protocol. */
+ IPPORT_TELNET = 23, /* Telnet protocol. */
+ IPPORT_SMTP = 25, /* Simple Mail Transfer Protocol. */
+ IPPORT_TIMESERVER = 37, /* Timeserver service. */
+ IPPORT_NAMESERVER = 42, /* Domain Name Service. */
+ IPPORT_WHOIS = 43, /* Internet Whois service. */
+ IPPORT_MTP = 57,
+
+ IPPORT_TFTP = 69, /* Trivial File Transfer Protocol. */
+ IPPORT_RJE = 77,
+ IPPORT_FINGER = 79, /* Finger service. */
+ IPPORT_TTYLINK = 87,
+ IPPORT_SUPDUP = 95, /* SUPDUP protocol. */
+
+
+ IPPORT_EXECSERVER = 512, /* execd service. */
+ IPPORT_LOGINSERVER = 513, /* rlogind service. */
+ IPPORT_CMDSERVER = 514,
+ IPPORT_EFSSERVER = 520,
+
+ /* UDP ports. */
+ IPPORT_BIFFUDP = 512,
+ IPPORT_WHOSERVER = 513,
+ IPPORT_ROUTESERVER = 520,
+
+ /* Ports less than this value are reserved for privileged processes. */
+ IPPORT_RESERVED = 1024,
+
+ /* Ports greater this value are reserved for (non-privileged) servers. */
+ IPPORT_USERRESERVED = 5000
+ };
+
+
+/* Internet address. */
+typedef uint32_t in_addr_t;
+struct in_addr
+ {
+ in_addr_t s_addr;
+ };
+
+
+/* Definitions of the bits in an Internet address integer.
+
+ On subnets, host and network parts are found according to
+ the subnet mask, not these masks. */
+
+#define IN_CLASSA(a) ((((in_addr_t)(a)) & 0x80000000) == 0)
+#define IN_CLASSA_NET 0xff000000
+#define IN_CLASSA_NSHIFT 24
+#define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET)
+#define IN_CLASSA_MAX 128
+
+#define IN_CLASSB(a) ((((in_addr_t)(a)) & 0xc0000000) == 0x80000000)
+#define IN_CLASSB_NET 0xffff0000
+#define IN_CLASSB_NSHIFT 16
+#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET)
+#define IN_CLASSB_MAX 65536
+
+#define IN_CLASSC(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xc0000000)
+#define IN_CLASSC_NET 0xffffff00
+#define IN_CLASSC_NSHIFT 8
+#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET)
+
+#define IN_CLASSD(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xe0000000)
+#define IN_MULTICAST(a) IN_CLASSD(a)
+
+#define IN_EXPERIMENTAL(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xe0000000)
+#define IN_BADCLASS(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xf0000000)
+
+/* Address to accept any incoming messages. */
+#define INADDR_ANY ((in_addr_t) 0x00000000)
+/* Address to send to all hosts. */
+#define INADDR_BROADCAST ((in_addr_t) 0xffffffff)
+/* Address indicating an error return. */
+#define INADDR_NONE ((in_addr_t) 0xffffffff)
+
+/* Network number for local host loopback. */
+#define IN_LOOPBACKNET 127
+/* Address to loopback in software to local host. */
+#ifndef INADDR_LOOPBACK
+# define INADDR_LOOPBACK ((in_addr_t) 0x7f000001) /* Inet 127.0.0.1. */
+#endif
+
+/* Defines for Multicast INADDR. */
+#define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000) /* 224.0.0.0 */
+#define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001) /* 224.0.0.1 */
+#define INADDR_ALLRTRS_GROUP ((in_addr_t) 0xe0000002) /* 224.0.0.2 */
+#define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff) /* 224.0.0.255 */
+
+
+/* IPv6 address */
+struct in6_addr
+ {
+ union
+ {
+ uint8_t u6_addr8[16];
+ uint16_t u6_addr16[8];
+ uint32_t u6_addr32[4];
+ } in6_u;
+#define s6_addr in6_u.u6_addr8
+#define s6_addr16 in6_u.u6_addr16
+#define s6_addr32 in6_u.u6_addr32
+ };
+
+extern const struct in6_addr in6addr_any; /* :: */
+extern const struct in6_addr in6addr_loopback; /* ::1 */
+#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
+#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
+
+#define INET_ADDRSTRLEN 16
+#define INET6_ADDRSTRLEN 46
+
+/* Get the definition of the macro to define the common sockaddr members. */
+#include <bits/socket.h>
+
+
+/* Structure describing an Internet socket address. */
+struct sockaddr_in
+ {
+ __SOCKADDR_COMMON (sin_);
+ in_port_t sin_port; /* Port number. */
+ struct in_addr sin_addr; /* Internet address. */
+
+ /* Pad to size of `struct sockaddr'. */
+ unsigned char sin_zero[sizeof (struct sockaddr) -
+ __SOCKADDR_COMMON_SIZE -
+ sizeof (in_port_t) -
+ sizeof (struct in_addr)];
+ };
+
+/* Ditto, for IPv6. */
+struct sockaddr_in6
+ {
+ __SOCKADDR_COMMON (sin6_);
+ in_port_t sin6_port; /* Transport layer port # */
+ uint32_t sin6_flowinfo; /* IPv6 flow information */
+ struct in6_addr sin6_addr; /* IPv6 address */
+ uint32_t sin6_scope_id; /* IPv6 scope-id */
+ };
+
+
+/* IPv4 multicast request. */
+struct ip_mreq
+ {
+ /* IP multicast address of group. */
+ struct in_addr imr_multiaddr;
+
+ /* Local IP address of interface. */
+ struct in_addr imr_interface;
+ };
+
+struct ip_mreq_source
+ {
+ /* IP multicast address of group. */
+ struct in_addr imr_multiaddr;
+
+ /* IP address of source. */
+ struct in_addr imr_interface;
+
+ /* IP address of interface. */
+ struct in_addr imr_sourceaddr;
+ };
+
+/* Likewise, for IPv6. */
+struct ipv6_mreq
+ {
+ /* IPv6 multicast address of group */
+ struct in6_addr ipv6mr_multiaddr;
+
+ /* local interface */
+ unsigned int ipv6mr_interface;
+ };
+
+
+/* Multicast group request. */
+struct group_req
+ {
+ /* Interface index. */
+ uint32_t gr_interface;
+
+ /* Group address. */
+ struct sockaddr_storage gr_group;
+ };
+
+struct group_source_req
+ {
+ /* Interface index. */
+ uint32_t gsr_interface;
+
+ /* Group address. */
+ struct sockaddr_storage gsr_group;
+
+ /* Source address. */
+ struct sockaddr_storage gsr_source;
+ };
+
+
+/* Full-state filter operations. */
+struct ip_msfilter
+ {
+ /* IP multicast address of group. */
+ struct in_addr imsf_multiaddr;
+
+ /* Local IP address of interface. */
+ struct in_addr imsf_interface;
+
+ /* Filter mode. */
+ uint32_t imsf_fmode;
+
+ /* Number of source addresses. */
+ uint32_t imsf_numsrc;
+ /* Source addresses. */
+ struct in_addr imsf_slist[1];
+ };
+
+#define IP_MSFILTER_SIZE(numsrc) (sizeof (struct ip_msfilter) \
+ - sizeof (struct in_addr) \
+ + (numsrc) * sizeof (struct in_addr))
+
+struct group_filter
+ {
+ /* Interface index. */
+ uint32_t gf_interface;
+
+ /* Group address. */
+ struct sockaddr_storage gf_group;
+
+ /* Filter mode. */
+ uint32_t gf_fmode;
+
+ /* Number of source addresses. */
+ uint32_t gf_numsrc;
+ /* Source addresses. */
+ struct sockaddr_storage gf_slist[1];
+};
+
+#define GROUP_FILTER_SIZE(numsrc) (sizeof (struct group_filter) \
+ - sizeof (struct sockaddr_storage) \
+ + ((numsrc) \
+ * sizeof (struct sockaddr_storage)))
+
+
+/* Get system-specific definitions. */
+#include <bits/in.h>
+
+/* Functions to convert between host and network byte order.
+
+ Please note that these functions normally take `unsigned long int' or
+ `unsigned short int' values as arguments and also return them. But
+ this was a short-sighted decision since on different systems the types
+ may have different representations but the values are always the same. */
+
+extern uint32_t ntohl (uint32_t __netlong) __THROW __attribute__ ((__const__));
+extern uint16_t ntohs (uint16_t __netshort)
+ __THROW __attribute__ ((__const__));
+extern uint32_t htonl (uint32_t __hostlong)
+ __THROW __attribute__ ((__const__));
+extern uint16_t htons (uint16_t __hostshort)
+ __THROW __attribute__ ((__const__));
+
+#include <endian.h>
+
+/* Get machine dependent optimized versions of byte swapping functions. */
+#include <bits/byteswap.h>
+
+#ifdef __OPTIMIZE__
+/* We can optimize calls to the conversion functions. Either nothing has
+ to be done or we are using directly the byte-swapping functions which
+ often can be inlined. */
+# if __BYTE_ORDER == __BIG_ENDIAN
+/* The host byte order is the same as network byte order,
+ so these functions are all just identity. */
+# define ntohl(x) (x)
+# define ntohs(x) (x)
+# define htonl(x) (x)
+# define htons(x) (x)
+# else
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+# define ntohl(x) __bswap_32 (x)
+# define ntohs(x) __bswap_16 (x)
+# define htonl(x) __bswap_32 (x)
+# define htons(x) __bswap_16 (x)
+# endif
+# endif
+#endif
+
+#define IN6_IS_ADDR_UNSPECIFIED(a) \
+ (((__const uint32_t *) (a))[0] == 0 \
+ && ((__const uint32_t *) (a))[1] == 0 \
+ && ((__const uint32_t *) (a))[2] == 0 \
+ && ((__const uint32_t *) (a))[3] == 0)
+
+#define IN6_IS_ADDR_LOOPBACK(a) \
+ (((__const uint32_t *) (a))[0] == 0 \
+ && ((__const uint32_t *) (a))[1] == 0 \
+ && ((__const uint32_t *) (a))[2] == 0 \
+ && ((__const uint32_t *) (a))[3] == htonl (1))
+
+#define IN6_IS_ADDR_MULTICAST(a) (((__const uint8_t *) (a))[0] == 0xff)
+
+#define IN6_IS_ADDR_LINKLOCAL(a) \
+ ((((__const uint32_t *) (a))[0] & htonl (0xffc00000)) \
+ == htonl (0xfe800000))
+
+#define IN6_IS_ADDR_SITELOCAL(a) \
+ ((((__const uint32_t *) (a))[0] & htonl (0xffc00000)) \
+ == htonl (0xfec00000))
+
+#define IN6_IS_ADDR_V4MAPPED(a) \
+ ((((__const uint32_t *) (a))[0] == 0) \
+ && (((__const uint32_t *) (a))[1] == 0) \
+ && (((__const uint32_t *) (a))[2] == htonl (0xffff)))
+
+#define IN6_IS_ADDR_V4COMPAT(a) \
+ ((((__const uint32_t *) (a))[0] == 0) \
+ && (((__const uint32_t *) (a))[1] == 0) \
+ && (((__const uint32_t *) (a))[2] == 0) \
+ && (ntohl (((__const uint32_t *) (a))[3]) > 1))
+
+#define IN6_ARE_ADDR_EQUAL(a,b) \
+ ((((__const uint32_t *) (a))[0] == ((__const uint32_t *) (b))[0]) \
+ && (((__const uint32_t *) (a))[1] == ((__const uint32_t *) (b))[1]) \
+ && (((__const uint32_t *) (a))[2] == ((__const uint32_t *) (b))[2]) \
+ && (((__const uint32_t *) (a))[3] == ((__const uint32_t *) (b))[3]))
+
+/* Bind socket to a privileged IP port. */
+extern int bindresvport (int __sockfd, struct sockaddr_in *__sock_in) __THROW;
+
+/* The IPv6 version of this function. */
+extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in)
+ __THROW;
+
+
+#define IN6_IS_ADDR_MC_NODELOCAL(a) \
+ (IN6_IS_ADDR_MULTICAST(a) \
+ && ((((__const uint8_t *) (a))[1] & 0xf) == 0x1))
+
+#define IN6_IS_ADDR_MC_LINKLOCAL(a) \
+ (IN6_IS_ADDR_MULTICAST(a) \
+ && ((((__const uint8_t *) (a))[1] & 0xf) == 0x2))
+
+#define IN6_IS_ADDR_MC_SITELOCAL(a) \
+ (IN6_IS_ADDR_MULTICAST(a) \
+ && ((((__const uint8_t *) (a))[1] & 0xf) == 0x5))
+
+#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
+ (IN6_IS_ADDR_MULTICAST(a) \
+ && ((((__const uint8_t *) (a))[1] & 0xf) == 0x8))
+
+#define IN6_IS_ADDR_MC_GLOBAL(a) \
+ (IN6_IS_ADDR_MULTICAST(a) \
+ && ((((__const uint8_t *) (a))[1] & 0xf) == 0xe))
+
+/* IPv6 packet information. */
+struct in6_pktinfo
+ {
+ struct in6_addr ipi6_addr; /* src/dst IPv6 address */
+ unsigned int ipi6_ifindex; /* send/recv interface index */
+ };
+
+
+#if 0 /*def __USE_GNU*/
+/* Hop-by-Hop and Destination Options Processing. */
+extern int inet6_option_space (int __nbytes) __THROW;
+extern int inet6_option_init (void *__bp, struct cmsghdr **__cmsgp,
+ int __type) __THROW;
+extern int inet6_option_append (struct cmsghdr *__cmsg,
+ __const uint8_t *__typep, int __multx,
+ int __plusy) __THROW;
+extern uint8_t *inet6_option_alloc (struct cmsghdr *__cmsg, int __datalen,
+ int __multx, int __plusy) __THROW;
+extern int inet6_option_next (__const struct cmsghdr *__cmsg,
+ uint8_t **__tptrp) __THROW;
+extern int inet6_option_find (__const struct cmsghdr *__cmsg,
+ uint8_t **__tptrp, int __type) __THROW;
+
+
+/* Multicast source filter support. */
+
+/* Get IPv4 source filter. */
+extern int getipv4sourcefilter (int __s, struct in_addr __interface_addr,
+ struct in_addr __group, uint32_t *__fmode,
+ uint32_t *__numsrc, struct in_addr *__slist)
+ __THROW;
+
+/* Set IPv4 source filter. */
+extern int setipv4sourcefilter (int __s, struct in_addr __interface_addr,
+ struct in_addr __group, uint32_t __fmode,
+ uint32_t __numsrc,
+ __const struct in_addr *__slist)
+ __THROW;
+
+
+/* Get source filter. */
+extern int getsourcefilter (int __s, uint32_t __interface_addr,
+ __const struct sockaddr *__group,
+ socklen_t __grouplen, uint32_t *__fmode,
+ uint32_t *__numsrc,
+ struct sockaddr_storage *__slist) __THROW;
+
+/* Set source filter. */
+extern int setsourcefilter (int __s, uint32_t __interface_addr,
+ __const struct sockaddr *__group,
+ socklen_t __grouplen, uint32_t __fmode,
+ uint32_t __numsrc,
+ __const struct sockaddr_storage *__slist) __THROW;
+#endif /* use GNU */
+
+__END_DECLS
+
+#endif /* netinet/in.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/in_systm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/in_systm.h
new file mode 100644
index 0000000..51a08e1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/in_systm.h
@@ -0,0 +1,41 @@
+/* System specific type definitions for networking code.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETINET_IN_SYSTM_H
+#define _NETINET_IN_SYSTM_H 1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+/*
+ * Network order versions of various data types. Unfortunately, BSD
+ * assumes specific sizes for shorts (16 bit) and longs (32 bit) which
+ * don't hold in general. As a consequence, the network order versions
+ * may not reflect the actual size of the native data types.
+ */
+
+typedef u_int16_t n_short; /* short as received from the net */
+typedef u_int32_t n_long; /* long as received from the net */
+typedef u_int32_t n_time; /* ms since 00:00 GMT, byte rev */
+
+__END_DECLS
+
+#endif /* netinet/in_systm.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip.h
new file mode 100644
index 0000000..fc91440
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip.h
@@ -0,0 +1,249 @@
+/* Copyright (C) 1991,92,93,95,96,97,98,99,2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef __NETINET_IP_H
+#define __NETINET_IP_H 1
+
+#include <features.h>
+#include <sys/types.h>
+
+#include <netinet/in.h>
+
+__BEGIN_DECLS
+
+struct timestamp
+ {
+ u_int8_t len;
+ u_int8_t ptr;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int flags:4;
+ unsigned int overflow:4;
+#elif __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int overflow:4;
+ unsigned int flags:4;
+#else
+# error "Please fix <bits/endian.h>"
+#endif
+ u_int32_t data[9];
+ };
+
+struct iphdr
+ {
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int ihl:4;
+ unsigned int version:4;
+#elif __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int version:4;
+ unsigned int ihl:4;
+#else
+# error "Please fix <bits/endian.h>"
+#endif
+ u_int8_t tos;
+ u_int16_t tot_len;
+ u_int16_t id;
+ u_int16_t frag_off;
+ u_int8_t ttl;
+ u_int8_t protocol;
+ u_int16_t check;
+ u_int32_t saddr;
+ u_int32_t daddr;
+ /*The options start here. */
+ };
+
+#ifdef __USE_BSD
+/*
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ip.h 8.1 (Berkeley) 6/10/93
+ */
+
+/*
+ * Definitions for internet protocol version 4.
+ * Per RFC 791, September 1981.
+ */
+
+/*
+ * Structure of an internet header, naked of options.
+ */
+struct ip
+ {
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int ip_hl:4; /* header length */
+ unsigned int ip_v:4; /* version */
+#endif
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int ip_v:4; /* version */
+ unsigned int ip_hl:4; /* header length */
+#endif
+ u_int8_t ip_tos; /* type of service */
+ u_short ip_len; /* total length */
+ u_short ip_id; /* identification */
+ u_short ip_off; /* fragment offset field */
+#define IP_RF 0x8000 /* reserved fragment flag */
+#define IP_DF 0x4000 /* dont fragment flag */
+#define IP_MF 0x2000 /* more fragments flag */
+#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
+ u_int8_t ip_ttl; /* time to live */
+ u_int8_t ip_p; /* protocol */
+ u_short ip_sum; /* checksum */
+ struct in_addr ip_src, ip_dst; /* source and dest address */
+ };
+
+/*
+ * Time stamp option structure.
+ */
+struct ip_timestamp
+ {
+ u_int8_t ipt_code; /* IPOPT_TS */
+ u_int8_t ipt_len; /* size of structure (variable) */
+ u_int8_t ipt_ptr; /* index of current entry */
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int ipt_flg:4; /* flags, see below */
+ unsigned int ipt_oflw:4; /* overflow counter */
+#endif
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int ipt_oflw:4; /* overflow counter */
+ unsigned int ipt_flg:4; /* flags, see below */
+#endif
+ u_int32_t data[9];
+ };
+#endif /* __USE_BSD */
+
+#define IPVERSION 4 /* IP version number */
+#define IP_MAXPACKET 65535 /* maximum packet size */
+
+/*
+ * Definitions for IP type of service (ip_tos)
+ */
+#define IPTOS_TOS_MASK 0x1E
+#define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK)
+#define IPTOS_LOWDELAY 0x10
+#define IPTOS_THROUGHPUT 0x08
+#define IPTOS_RELIABILITY 0x04
+#define IPTOS_LOWCOST 0x02
+#define IPTOS_MINCOST IPTOS_LOWCOST
+
+/*
+ * Definitions for IP precedence (also in ip_tos) (hopefully unused)
+ */
+#define IPTOS_PREC_MASK 0xe0
+#define IPTOS_PREC(tos) ((tos) & IPTOS_PREC_MASK)
+#define IPTOS_PREC_NETCONTROL 0xe0
+#define IPTOS_PREC_INTERNETCONTROL 0xc0
+#define IPTOS_PREC_CRITIC_ECP 0xa0
+#define IPTOS_PREC_FLASHOVERRIDE 0x80
+#define IPTOS_PREC_FLASH 0x60
+#define IPTOS_PREC_IMMEDIATE 0x40
+#define IPTOS_PREC_PRIORITY 0x20
+#define IPTOS_PREC_ROUTINE 0x00
+
+/*
+ * Definitions for options.
+ */
+#define IPOPT_COPY 0x80
+#define IPOPT_CLASS_MASK 0x60
+#define IPOPT_NUMBER_MASK 0x1f
+
+#define IPOPT_COPIED(o) ((o) & IPOPT_COPY)
+#define IPOPT_CLASS(o) ((o) & IPOPT_CLASS_MASK)
+#define IPOPT_NUMBER(o) ((o) & IPOPT_NUMBER_MASK)
+
+#define IPOPT_CONTROL 0x00
+#define IPOPT_RESERVED1 0x20
+#define IPOPT_DEBMEAS 0x40
+#define IPOPT_MEASUREMENT IPOPT_DEBMEAS
+#define IPOPT_RESERVED2 0x60
+
+#define IPOPT_EOL 0 /* end of option list */
+#define IPOPT_END IPOPT_EOL
+#define IPOPT_NOP 1 /* no operation */
+#define IPOPT_NOOP IPOPT_NOP
+
+#define IPOPT_RR 7 /* record packet route */
+#define IPOPT_TS 68 /* timestamp */
+#define IPOPT_TIMESTAMP IPOPT_TS
+#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */
+#define IPOPT_SEC IPOPT_SECURITY
+#define IPOPT_LSRR 131 /* loose source route */
+#define IPOPT_SATID 136 /* satnet id */
+#define IPOPT_SID IPOPT_SATID
+#define IPOPT_SSRR 137 /* strict source route */
+#define IPOPT_RA 148 /* router alert */
+
+/*
+ * Offsets to fields in options other than EOL and NOP.
+ */
+#define IPOPT_OPTVAL 0 /* option ID */
+#define IPOPT_OLEN 1 /* option length */
+#define IPOPT_OFFSET 2 /* offset within option */
+#define IPOPT_MINOFF 4 /* min value of above */
+
+#define MAX_IPOPTLEN 40
+
+/* flag bits for ipt_flg */
+#define IPOPT_TS_TSONLY 0 /* timestamps only */
+#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
+#define IPOPT_TS_PRESPEC 3 /* specified modules only */
+
+/* bits for security (not byte swapped) */
+#define IPOPT_SECUR_UNCLASS 0x0000
+#define IPOPT_SECUR_CONFID 0xf135
+#define IPOPT_SECUR_EFTO 0x789a
+#define IPOPT_SECUR_MMMM 0xbc4d
+#define IPOPT_SECUR_RESTR 0xaf13
+#define IPOPT_SECUR_SECRET 0xd788
+#define IPOPT_SECUR_TOPSECRET 0x6bc5
+
+/*
+ * Internet implementation parameters.
+ */
+#define MAXTTL 255 /* maximum time to live (seconds) */
+#define IPDEFTTL 64 /* default ttl, from RFC 1340 */
+#define IPFRAGTTL 60 /* time to live for frags, slowhz */
+#define IPTTLDEC 1 /* subtracted when forwarding */
+
+#define IP_MSS 576 /* default maximum segment size */
+
+__END_DECLS
+
+#endif /* netinet/ip.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip6.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip6.h
new file mode 100644
index 0000000..0ad62f8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip6.h
@@ -0,0 +1,188 @@
+/* Copyright (C) 1991-1997, 2001, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETINET_IP6_H
+#define _NETINET_IP6_H 1
+
+#include <inttypes.h>
+#include <netinet/in.h>
+
+struct ip6_hdr
+ {
+ union
+ {
+ struct ip6_hdrctl
+ {
+ uint32_t ip6_un1_flow; /* 4 bits version, 8 bits TC,
+ 20 bits flow-ID */
+ uint16_t ip6_un1_plen; /* payload length */
+ uint8_t ip6_un1_nxt; /* next header */
+ uint8_t ip6_un1_hlim; /* hop limit */
+ } ip6_un1;
+ uint8_t ip6_un2_vfc; /* 4 bits version, top 4 bits tclass */
+ } ip6_ctlun;
+ struct in6_addr ip6_src; /* source address */
+ struct in6_addr ip6_dst; /* destination address */
+ };
+
+#define ip6_vfc ip6_ctlun.ip6_un2_vfc
+#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow
+#define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen
+#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt
+#define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim
+#define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim
+
+/* Generic extension header. */
+struct ip6_ext
+ {
+ uint8_t ip6e_nxt; /* next header. */
+ uint8_t ip6e_len; /* length in units of 8 octets. */
+ };
+
+/* Hop-by-Hop options header. */
+struct ip6_hbh
+ {
+ uint8_t ip6h_nxt; /* next header. */
+ uint8_t ip6h_len; /* length in units of 8 octets. */
+ /* followed by options */
+ };
+
+/* Destination options header */
+struct ip6_dest
+ {
+ uint8_t ip6d_nxt; /* next header */
+ uint8_t ip6d_len; /* length in units of 8 octets */
+ /* followed by options */
+ };
+
+/* Routing header */
+struct ip6_rthdr
+ {
+ uint8_t ip6r_nxt; /* next header */
+ uint8_t ip6r_len; /* length in units of 8 octets */
+ uint8_t ip6r_type; /* routing type */
+ uint8_t ip6r_segleft; /* segments left */
+ /* followed by routing type specific data */
+ };
+
+/* Type 0 Routing header */
+struct ip6_rthdr0
+ {
+ uint8_t ip6r0_nxt; /* next header */
+ uint8_t ip6r0_len; /* length in units of 8 octets */
+ uint8_t ip6r0_type; /* always zero */
+ uint8_t ip6r0_segleft; /* segments left */
+ uint8_t ip6r0_reserved; /* reserved field */
+ uint8_t ip6r0_slmap[3]; /* strict/loose bit map */
+ struct in6_addr ip6r0_addr[1]; /* up to 23 addresses */
+ };
+
+/* Fragment header */
+struct ip6_frag
+ {
+ uint8_t ip6f_nxt; /* next header */
+ uint8_t ip6f_reserved; /* reserved field */
+ uint16_t ip6f_offlg; /* offset, reserved, and flag */
+ uint32_t ip6f_ident; /* identification */
+ };
+
+#if BYTE_ORDER == BIG_ENDIAN
+#define IP6F_OFF_MASK 0xfff8 /* mask out offset from _offlg */
+#define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */
+#define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */
+#else /* BYTE_ORDER == LITTLE_ENDIAN */
+#define IP6F_OFF_MASK 0xf8ff /* mask out offset from _offlg */
+#define IP6F_RESERVED_MASK 0x0600 /* reserved bits in ip6f_offlg */
+#define IP6F_MORE_FRAG 0x0100 /* more-fragments flag */
+#endif
+
+/* IPv6 options */
+struct ip6_opt
+ {
+ uint8_t ip6o_type;
+ uint8_t ip6o_len;
+ };
+
+/* The high-order 3 bits of the option type define the behavior
+ * when processing an unknown option and whether or not the option
+ * content changes in flight.
+ */
+#define IP6OPT_TYPE(o) ((o) & 0xc0)
+#define IP6OPT_TYPE_SKIP 0x00
+#define IP6OPT_TYPE_DISCARD 0x40
+#define IP6OPT_TYPE_FORCEICMP 0x80
+#define IP6OPT_TYPE_ICMP 0xc0
+#define IP6OPT_TYPE_MUTABLE 0x20
+
+/* Special option types for padding. */
+#define IP6OPT_PAD1 0
+#define IP6OPT_PADN 1
+
+#define IP6OPT_JUMBO 0xc2
+#define IP6OPT_NSAP_ADDR 0xc3
+#define IP6OPT_TUNNEL_LIMIT 0x04
+#define IP6OPT_ROUTER_ALERT 0x05
+
+/* Jumbo Payload Option */
+struct ip6_opt_jumbo
+ {
+ uint8_t ip6oj_type;
+ uint8_t ip6oj_len;
+ uint8_t ip6oj_jumbo_len[4];
+ };
+#define IP6OPT_JUMBO_LEN 6
+
+/* NSAP Address Option */
+struct ip6_opt_nsap
+ {
+ uint8_t ip6on_type;
+ uint8_t ip6on_len;
+ uint8_t ip6on_src_nsap_len;
+ uint8_t ip6on_dst_nsap_len;
+ /* followed by source NSAP */
+ /* followed by destination NSAP */
+ };
+
+/* Tunnel Limit Option */
+struct ip6_opt_tunnel
+ {
+ uint8_t ip6ot_type;
+ uint8_t ip6ot_len;
+ uint8_t ip6ot_encap_limit;
+ };
+
+/* Router Alert Option */
+struct ip6_opt_router
+ {
+ uint8_t ip6or_type;
+ uint8_t ip6or_len;
+ uint8_t ip6or_value[2];
+ };
+
+/* Router alert values (in network byte order) */
+#if BYTE_ORDER == BIG_ENDIAN
+# define IP6_ALERT_MLD 0x0000
+# define IP6_ALERT_RSVP 0x0001
+# define IP6_ALERT_AN 0x0002
+#else /* BYTE_ORDER == LITTLE_ENDING */
+# define IP6_ALERT_MLD 0x0000
+# define IP6_ALERT_RSVP 0x0100
+# define IP6_ALERT_AN 0x0200
+#endif
+
+#endif /* netinet/ip6.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip_fw.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip_fw.h
new file mode 100644
index 0000000..278a039
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip_fw.h
@@ -0,0 +1 @@
+#include <linux/ip_fw.h>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip_icmp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip_icmp.h
new file mode 100644
index 0000000..2fc8e9c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip_icmp.h
@@ -0,0 +1,283 @@
+/* Copyright (C) 1991, 92, 93, 95, 96, 97, 99 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef __NETINET_IP_ICMP_H
+#define __NETINET_IP_ICMP_H 1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+struct icmphdr
+{
+ u_int8_t type; /* message type */
+ u_int8_t code; /* type sub-code */
+ u_int16_t checksum;
+ union
+ {
+ struct
+ {
+ u_int16_t id;
+ u_int16_t sequence;
+ } echo; /* echo datagram */
+ u_int32_t gateway; /* gateway address */
+ struct
+ {
+ u_int16_t __unused;
+ u_int16_t mtu;
+ } frag; /* path mtu discovery */
+ } un;
+};
+
+#define ICMP_ECHOREPLY 0 /* Echo Reply */
+#define ICMP_DEST_UNREACH 3 /* Destination Unreachable */
+#define ICMP_SOURCE_QUENCH 4 /* Source Quench */
+#define ICMP_REDIRECT 5 /* Redirect (change route) */
+#define ICMP_ECHO 8 /* Echo Request */
+#define ICMP_TIME_EXCEEDED 11 /* Time Exceeded */
+#define ICMP_PARAMETERPROB 12 /* Parameter Problem */
+#define ICMP_TIMESTAMP 13 /* Timestamp Request */
+#define ICMP_TIMESTAMPREPLY 14 /* Timestamp Reply */
+#define ICMP_INFO_REQUEST 15 /* Information Request */
+#define ICMP_INFO_REPLY 16 /* Information Reply */
+#define ICMP_ADDRESS 17 /* Address Mask Request */
+#define ICMP_ADDRESSREPLY 18 /* Address Mask Reply */
+#define NR_ICMP_TYPES 18
+
+
+/* Codes for UNREACH. */
+#define ICMP_NET_UNREACH 0 /* Network Unreachable */
+#define ICMP_HOST_UNREACH 1 /* Host Unreachable */
+#define ICMP_PROT_UNREACH 2 /* Protocol Unreachable */
+#define ICMP_PORT_UNREACH 3 /* Port Unreachable */
+#define ICMP_FRAG_NEEDED 4 /* Fragmentation Needed/DF set */
+#define ICMP_SR_FAILED 5 /* Source Route failed */
+#define ICMP_NET_UNKNOWN 6
+#define ICMP_HOST_UNKNOWN 7
+#define ICMP_HOST_ISOLATED 8
+#define ICMP_NET_ANO 9
+#define ICMP_HOST_ANO 10
+#define ICMP_NET_UNR_TOS 11
+#define ICMP_HOST_UNR_TOS 12
+#define ICMP_PKT_FILTERED 13 /* Packet filtered */
+#define ICMP_PREC_VIOLATION 14 /* Precedence violation */
+#define ICMP_PREC_CUTOFF 15 /* Precedence cut off */
+#define NR_ICMP_UNREACH 15 /* instead of hardcoding immediate value */
+
+/* Codes for REDIRECT. */
+#define ICMP_REDIR_NET 0 /* Redirect Net */
+#define ICMP_REDIR_HOST 1 /* Redirect Host */
+#define ICMP_REDIR_NETTOS 2 /* Redirect Net for TOS */
+#define ICMP_REDIR_HOSTTOS 3 /* Redirect Host for TOS */
+
+/* Codes for TIME_EXCEEDED. */
+#define ICMP_EXC_TTL 0 /* TTL count exceeded */
+#define ICMP_EXC_FRAGTIME 1 /* Fragment Reass time exceeded */
+
+
+#ifdef __USE_BSD
+/*
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93
+ */
+
+#include <netinet/in.h>
+#include <netinet/ip.h>
+
+/*
+ * Internal of an ICMP Router Advertisement
+ */
+struct icmp_ra_addr
+{
+ u_int32_t ira_addr;
+ u_int32_t ira_preference;
+};
+
+struct icmp
+{
+ u_int8_t icmp_type; /* type of message, see below */
+ u_int8_t icmp_code; /* type sub code */
+ u_int16_t icmp_cksum; /* ones complement checksum of struct */
+ union
+ {
+ u_char ih_pptr; /* ICMP_PARAMPROB */
+ struct in_addr ih_gwaddr; /* gateway address */
+ struct ih_idseq /* echo datagram */
+ {
+ u_int16_t icd_id;
+ u_int16_t icd_seq;
+ } ih_idseq;
+ u_int32_t ih_void;
+
+ /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
+ struct ih_pmtu
+ {
+ u_int16_t ipm_void;
+ u_int16_t ipm_nextmtu;
+ } ih_pmtu;
+
+ struct ih_rtradv
+ {
+ u_int8_t irt_num_addrs;
+ u_int8_t irt_wpa;
+ u_int16_t irt_lifetime;
+ } ih_rtradv;
+ } icmp_hun;
+#define icmp_pptr icmp_hun.ih_pptr
+#define icmp_gwaddr icmp_hun.ih_gwaddr
+#define icmp_id icmp_hun.ih_idseq.icd_id
+#define icmp_seq icmp_hun.ih_idseq.icd_seq
+#define icmp_void icmp_hun.ih_void
+#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
+#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
+#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
+#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
+#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
+ union
+ {
+ struct
+ {
+ u_int32_t its_otime;
+ u_int32_t its_rtime;
+ u_int32_t its_ttime;
+ } id_ts;
+ struct
+ {
+ struct ip idi_ip;
+ /* options and then 64 bits of data */
+ } id_ip;
+ struct icmp_ra_addr id_radv;
+ u_int32_t id_mask;
+ u_int8_t id_data[1];
+ } icmp_dun;
+#define icmp_otime icmp_dun.id_ts.its_otime
+#define icmp_rtime icmp_dun.id_ts.its_rtime
+#define icmp_ttime icmp_dun.id_ts.its_ttime
+#define icmp_ip icmp_dun.id_ip.idi_ip
+#define icmp_radv icmp_dun.id_radv
+#define icmp_mask icmp_dun.id_mask
+#define icmp_data icmp_dun.id_data
+};
+
+/*
+ * Lower bounds on packet lengths for various types.
+ * For the error advice packets must first insure that the
+ * packet is large enough to contain the returned ip header.
+ * Only then can we do the check to see if 64 bits of packet
+ * data have been returned, since we need to check the returned
+ * ip header length.
+ */
+#define ICMP_MINLEN 8 /* abs minimum */
+#define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */
+#define ICMP_MASKLEN 12 /* address mask */
+#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */
+#ifndef _IP_VHL
+#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
+ /* N.B.: must separately check that ip_hl >= 5 */
+#else
+#define ICMP_ADVLEN(p) (8 + (IP_VHL_HL((p)->icmp_ip.ip_vhl) << 2) + 8)
+ /* N.B.: must separately check that header length >= 5 */
+#endif
+
+/* Definition of type and code fields. */
+/* defined above: ICMP_ECHOREPLY, ICMP_REDIRECT, ICMP_ECHO */
+#define ICMP_UNREACH 3 /* dest unreachable, codes: */
+#define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */
+#define ICMP_ROUTERADVERT 9 /* router advertisement */
+#define ICMP_ROUTERSOLICIT 10 /* router solicitation */
+#define ICMP_TIMXCEED 11 /* time exceeded, code: */
+#define ICMP_PARAMPROB 12 /* ip header bad */
+#define ICMP_TSTAMP 13 /* timestamp request */
+#define ICMP_TSTAMPREPLY 14 /* timestamp reply */
+#define ICMP_IREQ 15 /* information request */
+#define ICMP_IREQREPLY 16 /* information reply */
+#define ICMP_MASKREQ 17 /* address mask request */
+#define ICMP_MASKREPLY 18 /* address mask reply */
+
+#define ICMP_MAXTYPE 18
+
+/* UNREACH codes */
+#define ICMP_UNREACH_NET 0 /* bad net */
+#define ICMP_UNREACH_HOST 1 /* bad host */
+#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */
+#define ICMP_UNREACH_PORT 3 /* bad port */
+#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */
+#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */
+#define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */
+#define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */
+#define ICMP_UNREACH_ISOLATED 8 /* src host isolated */
+#define ICMP_UNREACH_NET_PROHIB 9 /* net denied */
+#define ICMP_UNREACH_HOST_PROHIB 10 /* host denied */
+#define ICMP_UNREACH_TOSNET 11 /* bad tos for net */
+#define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */
+#define ICMP_UNREACH_FILTER_PROHIB 13 /* admin prohib */
+#define ICMP_UNREACH_HOST_PRECEDENCE 14 /* host prec vio. */
+#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* prec cutoff */
+
+/* REDIRECT codes */
+#define ICMP_REDIRECT_NET 0 /* for network */
+#define ICMP_REDIRECT_HOST 1 /* for host */
+#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */
+#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */
+
+/* TIMEXCEED codes */
+#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */
+#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */
+
+/* PARAMPROB code */
+#define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */
+
+#define ICMP_INFOTYPE(type) \
+ ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
+ (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \
+ (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
+ (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
+ (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
+
+#endif /* __USE_BSD */
+
+__END_DECLS
+
+#endif /* netinet/ip_icmp.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip_tcp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip_tcp.h
new file mode 100644
index 0000000..600aebc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip_tcp.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 1982, 1986 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley. The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * @(#)tcp.h 7.5 (Berkeley) 6/29/88
+ */
+
+#ifndef _NETINET_IP_TCP_H
+#define _NETINET_IP_TCP_H
+
+#include <endian.h>
+#include <linux/socket.h>
+#include <sys/types.h>
+
+typedef u_int32_t tcp_seq;
+/*
+ * TCP header.
+ * Per RFC 793, September, 1981.
+ */
+struct tcphdr {
+ u_short th_sport; /* source port */
+ u_short th_dport; /* destination port */
+ tcp_seq th_seq; /* sequence number */
+ tcp_seq th_ack; /* acknowledgement number */
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ u_char th_x2:4, /* (unused) */
+ th_off:4; /* data offset */
+#endif
+#if __BYTE_ORDER == __BIG_ENDIAN
+ u_char th_off:4, /* data offset */
+ th_x2:4; /* (unused) */
+#endif
+ u_char th_flags;
+#define TH_FIN 0x01
+#define TH_SYN 0x02
+#define TH_RST 0x04
+#define TH_PUSH 0x08
+#define TH_ACK 0x10
+#define TH_URG 0x20
+ u_short th_win; /* window */
+ u_short th_sum; /* checksum */
+ u_short th_urp; /* urgent pointer */
+};
+
+#define TCPOPT_EOL 0
+#define TCPOPT_NOP 1
+#define TCPOPT_MAXSEG 2
+
+/*
+ * Default maximum segment size for TCP.
+ * With an IP MSS of 576, this is 536,
+ * but 512 is probably more convenient.
+ */
+#ifdef lint
+#define TCP_MSS 536
+#else
+#define TCP_MSS MIN(512, IP_MSS - sizeof (struct tcpiphdr))
+#endif
+
+#endif /* _NETINET_TCP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip_udp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip_udp.h
new file mode 100644
index 0000000..3f0d8ef
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/ip_udp.h
@@ -0,0 +1 @@
+#include <linux/udp.h>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/protocols.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/protocols.h
new file mode 100644
index 0000000..1a619c4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/protocols.h
@@ -0,0 +1,62 @@
+/* protocols.h */
+#ifndef _NETINET_PROTOCOLS_H
+#define _NETINET_PROTOCOLS_H
+
+#define IP_ICMP 1
+#define IP_IGMP 2
+#define IP_GGP 3
+#define IP_ST 5
+#define IP_TCP 6
+#define IP_UCL 7
+#define IP_EGP 8
+#define IP_IGP 9
+#define IP_BBN_RCC_MON 10
+#define IP_NVP_II 11
+#define IP_PUP 12
+#define IP_ARGUS 13
+#define IP_EMCON 14
+#define IP_XNET 15
+#define IP_CHAOS 16
+#define IP_UDP 17
+#define IP_MUX 18
+#define IP_DCN_MEAS 19
+#define IP_HMP 20
+#define IP_PRM 21
+#define IP_XNS_IDP 22
+#define IP_TRUNK1 23
+#define IP_TRUNK2 24
+#define IP_LEAF1 25
+#define IP_LEAF2 26
+#define IP_RDP 27
+#define IP_IRTP 28
+#define IP_ISO_TP4 29
+#define IP_NETBLT 30
+#define IP_MFE_NSP 31
+#define IP_MERIT_INP 32
+#define IP_SEP 33
+#define IP_3PC 34
+#define IP_CFTP 62
+#define SAT_EXPAK 64
+#define IP_RVD 66
+#define IP_IPPC 67
+#define IP_SAT_MON 69
+#define IP_VISA 70
+#define IP_IPCV 71
+#define IP_BR_SAT_MON 76
+#define IP_SUN_ND 77
+#define IP_WB_MON 78
+#define IP_WB_EXPAK 79
+#define IP_ISO_IP 80
+#define IP_VMTP 81
+#define IP_SECURE_VMTP 82
+#define IP_VINES 83
+#define IP_TTP 84
+#define NSFNET_IGP 85
+#define IP_DGP 86
+#define IP_TCF 87
+#define IP_IGRP 88
+#define IP_OSPFIGP 89
+#define IP_SPRITE_RPG 90
+#define IP_LARP 91
+
+#endif /* _NETINET_PROTOCOLS_H*/
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/tcp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/tcp.h
new file mode 100644
index 0000000..87099ec
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/tcp.h
@@ -0,0 +1,225 @@
+/*
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)tcp.h 8.1 (Berkeley) 6/10/93
+ */
+
+#ifndef _NETINET_TCP_H
+#define _NETINET_TCP_H 1
+
+#include <features.h>
+
+/*
+ * User-settable options (used with setsockopt).
+ */
+#define TCP_NODELAY 1 /* Don't delay send to coalesce packets */
+#define TCP_MAXSEG 2 /* Set maximum segment size */
+#define TCP_CORK 3 /* Control sending of partial frames */
+#define TCP_KEEPIDLE 4 /* Start keeplives after this period */
+#define TCP_KEEPINTVL 5 /* Interval between keepalives */
+#define TCP_KEEPCNT 6 /* Number of keepalives before death */
+#define TCP_SYNCNT 7 /* Number of SYN retransmits */
+#define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */
+#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */
+#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */
+#define TCP_INFO 11 /* Information about this connection. */
+#define TCP_QUICKACK 12 /* Bock/reenable quick ACKs. */
+
+#ifdef __USE_MISC
+# include <sys/types.h>
+
+# ifdef __FAVOR_BSD
+typedef u_int32_t tcp_seq;
+/*
+ * TCP header.
+ * Per RFC 793, September, 1981.
+ */
+struct tcphdr
+ {
+ u_int16_t th_sport; /* source port */
+ u_int16_t th_dport; /* destination port */
+ tcp_seq th_seq; /* sequence number */
+ tcp_seq th_ack; /* acknowledgement number */
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+ u_int8_t th_x2:4; /* (unused) */
+ u_int8_t th_off:4; /* data offset */
+# endif
+# if __BYTE_ORDER == __BIG_ENDIAN
+ u_int8_t th_off:4; /* data offset */
+ u_int8_t th_x2:4; /* (unused) */
+# endif
+ u_int8_t th_flags;
+# define TH_FIN 0x01
+# define TH_SYN 0x02
+# define TH_RST 0x04
+# define TH_PUSH 0x08
+# define TH_ACK 0x10
+# define TH_URG 0x20
+ u_int16_t th_win; /* window */
+ u_int16_t th_sum; /* checksum */
+ u_int16_t th_urp; /* urgent pointer */
+};
+
+# else /* !__FAVOR_BSD */
+struct tcphdr
+ {
+ u_int16_t source;
+ u_int16_t dest;
+ u_int32_t seq;
+ u_int32_t ack_seq;
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+ u_int16_t res1:4;
+ u_int16_t doff:4;
+ u_int16_t fin:1;
+ u_int16_t syn:1;
+ u_int16_t rst:1;
+ u_int16_t psh:1;
+ u_int16_t ack:1;
+ u_int16_t urg:1;
+ u_int16_t res2:2;
+# elif __BYTE_ORDER == __BIG_ENDIAN
+ u_int16_t doff:4;
+ u_int16_t res1:4;
+ u_int16_t res2:2;
+ u_int16_t urg:1;
+ u_int16_t ack:1;
+ u_int16_t psh:1;
+ u_int16_t rst:1;
+ u_int16_t syn:1;
+ u_int16_t fin:1;
+# else
+# error "Adjust your <bits/endian.h> defines"
+# endif
+ u_int16_t window;
+ u_int16_t check;
+ u_int16_t urg_ptr;
+};
+# endif /* __FAVOR_BSD */
+
+enum
+{
+ TCP_ESTABLISHED = 1,
+ TCP_SYN_SENT,
+ TCP_SYN_RECV,
+ TCP_FIN_WAIT1,
+ TCP_FIN_WAIT2,
+ TCP_TIME_WAIT,
+ TCP_CLOSE,
+ TCP_CLOSE_WAIT,
+ TCP_LAST_ACK,
+ TCP_LISTEN,
+ TCP_CLOSING /* now a valid state */
+};
+
+# define TCPOPT_EOL 0
+# define TCPOPT_NOP 1
+# define TCPOPT_MAXSEG 2
+# define TCPOLEN_MAXSEG 4
+# define TCPOPT_WINDOW 3
+# define TCPOLEN_WINDOW 3
+# define TCPOPT_SACK_PERMITTED 4 /* Experimental */
+# define TCPOLEN_SACK_PERMITTED 2
+# define TCPOPT_SACK 5 /* Experimental */
+# define TCPOPT_TIMESTAMP 8
+# define TCPOLEN_TIMESTAMP 10
+# define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
+
+# define TCPOPT_TSTAMP_HDR \
+ (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
+
+/*
+ * Default maximum segment size for TCP.
+ * With an IP MSS of 576, this is 536,
+ * but 512 is probably more convenient.
+ * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
+ */
+# define TCP_MSS 512
+
+# define TCP_MAXWIN 65535 /* largest value for (unscaled) window */
+
+# define TCP_MAX_WINSHIFT 14 /* maximum window shift */
+
+# define SOL_TCP 6 /* TCP level */
+
+
+# define TCPI_OPT_TIMESTAMPS 1
+# define TCPI_OPT_SACK 2
+# define TCPI_OPT_WSCALE 4
+# define TCPI_OPT_ECN 8
+
+/* Values for tcpi_state. */
+enum tcp_ca_state
+{
+ TCP_CA_Open = 0,
+ TCP_CA_Disorder = 1,
+ TCP_CA_CWR = 2,
+ TCP_CA_Recovery = 3,
+ TCP_CA_Loss = 4
+};
+
+struct tcp_info
+{
+ u_int8_t tcpi_state;
+ u_int8_t tcpi_ca_state;
+ u_int8_t tcpi_retransmits;
+ u_int8_t tcpi_probes;
+ u_int8_t tcpi_backoff;
+ u_int8_t tcpi_options;
+ u_int8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
+
+ u_int32_t tcpi_rto;
+ u_int32_t tcpi_ato;
+ u_int32_t tcpi_snd_mss;
+ u_int32_t tcpi_rcv_mss;
+
+ u_int32_t tcpi_unacked;
+ u_int32_t tcpi_sacked;
+ u_int32_t tcpi_lost;
+ u_int32_t tcpi_retrans;
+ u_int32_t tcpi_fackets;
+
+ /* Times. */
+ u_int32_t tcpi_last_data_sent;
+ u_int32_t tcpi_last_ack_sent; /* Not remembered, sorry. */
+ u_int32_t tcpi_last_data_recv;
+ u_int32_t tcpi_last_ack_recv;
+
+ /* Metrics. */
+ u_int32_t tcpi_pmtu;
+ u_int32_t tcpi_rcv_ssthresh;
+ u_int32_t tcpi_rtt;
+ u_int32_t tcpi_rttvar;
+ u_int32_t tcpi_snd_ssthresh;
+ u_int32_t tcpi_snd_cwnd;
+ u_int32_t tcpi_advmss;
+ u_int32_t tcpi_reordering;
+};
+
+#endif /* Misc. */
+
+#endif /* netinet/tcp.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/udp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/udp.h
new file mode 100644
index 0000000..5be4bbd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netinet/udp.h
@@ -0,0 +1,55 @@
+/* Copyright (C) 1991, 92, 93, 95, 96, 97 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * Copyright (c) 1982, 1986 Regents of the University of California.
+ * All rights reserved. The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
+#ifndef __NETINET_UDP_H
+#define __NETINET_UDP_H 1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+/* UDP header as specified by RFC 768, August 1980. */
+#ifdef __FAVOR_BSD
+struct udphdr {
+ u_int16_t uh_sport; /* source port */
+ u_int16_t uh_dport; /* destination port */
+ u_int16_t uh_ulen; /* udp length */
+ u_int16_t uh_sum; /* udp checksum */
+};
+#else
+
+struct udphdr {
+ u_int16_t source;
+ u_int16_t dest;
+ u_int16_t len;
+ u_int16_t check;
+};
+#endif
+
+#define SOL_UDP 17 /* sockopt level for UDP */
+
+__END_DECLS
+
+#endif /* netinet/udp.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/netipx/ipx.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netipx/ipx.h
new file mode 100644
index 0000000..7eb42ef
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netipx/ipx.h
@@ -0,0 +1,113 @@
+/* Copyright (C) 1991, 92, 93, 95, 96, 97, 98 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef __NETIPX_IPX_H
+#define __NETIPX_IPX_H 1
+
+#include <features.h>
+
+#include <sys/types.h>
+#include <bits/sockaddr.h>
+
+__BEGIN_DECLS
+
+#define SOL_IPX 256 /* sockopt level */
+
+#define IPX_TYPE 1
+#define IPX_NODE_LEN 6
+#define IPX_MTU 576
+
+struct sockaddr_ipx
+ {
+ sa_family_t sipx_family;
+ u_int16_t sipx_port;
+ u_int32_t sipx_network;
+ unsigned char sipx_node[IPX_NODE_LEN];
+ u_int8_t sipx_type;
+ unsigned char sipx_zero; /* 16 byte fill */
+ };
+
+/*
+ * So we can fit the extra info for SIOCSIFADDR into the address nicely
+ */
+
+#define sipx_special sipx_port
+#define sipx_action sipx_zero
+#define IPX_DLTITF 0
+#define IPX_CRTITF 1
+
+typedef struct ipx_route_definition
+ {
+ unsigned long ipx_network;
+ unsigned long ipx_router_network;
+ unsigned char ipx_router_node[IPX_NODE_LEN];
+ }
+ipx_route_definition;
+
+typedef struct ipx_interface_definition
+ {
+ unsigned long ipx_network;
+ unsigned char ipx_device[16];
+ unsigned char ipx_dlink_type;
+#define IPX_FRAME_NONE 0
+#define IPX_FRAME_SNAP 1
+#define IPX_FRAME_8022 2
+#define IPX_FRAME_ETHERII 3
+#define IPX_FRAME_8023 4
+#define IPX_FRAME_TR_8022 5
+ unsigned char ipx_special;
+#define IPX_SPECIAL_NONE 0
+#define IPX_PRIMARY 1
+#define IPX_INTERNAL 2
+ unsigned char ipx_node[IPX_NODE_LEN];
+ }
+ipx_interface_definition;
+
+typedef struct ipx_config_data
+ {
+ unsigned char ipxcfg_auto_select_primary;
+ unsigned char ipxcfg_auto_create_interfaces;
+ }
+ipx_config_data;
+
+/*
+ * OLD Route Definition for backward compatibility.
+ */
+
+struct ipx_route_def
+ {
+ unsigned long ipx_network;
+ unsigned long ipx_router_network;
+#define IPX_ROUTE_NO_ROUTER 0
+ unsigned char ipx_router_node[IPX_NODE_LEN];
+ unsigned char ipx_device[16];
+ unsigned short ipx_flags;
+#define IPX_RT_SNAP 8
+#define IPX_RT_8022 4
+#define IPX_RT_BLUEBOOK 2
+#define IPX_RT_ROUTED 1
+ };
+
+#define SIOCAIPXITFCRT (SIOCPROTOPRIVATE)
+#define SIOCAIPXPRISLT (SIOCPROTOPRIVATE + 1)
+#define SIOCIPXCFGDATA (SIOCPROTOPRIVATE + 2)
+#define SIOCIPXNCPCONN (SIOCPROTOPRIVATE + 3)
+
+__END_DECLS
+
+#endif /* netipx/ipx.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/netpacket/packet.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netpacket/packet.h
new file mode 100644
index 0000000..6c63428
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/netpacket/packet.h
@@ -0,0 +1,64 @@
+/* Definitions for use with Linux AF_PACKET sockets.
+ Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef __NETPACKET_PACKET_H
+#define __NETPACKET_PACKET_H 1
+
+struct sockaddr_ll
+ {
+ unsigned short int sll_family;
+ unsigned short int sll_protocol;
+ int sll_ifindex;
+ unsigned short int sll_hatype;
+ unsigned char sll_pkttype;
+ unsigned char sll_halen;
+ unsigned char sll_addr[8];
+ };
+
+/* Packet types. */
+
+#define PACKET_HOST 0 /* To us. */
+#define PACKET_BROADCAST 1 /* To all. */
+#define PACKET_MULTICAST 2 /* To group. */
+#define PACKET_OTHERHOST 3 /* To someone else. */
+#define PACKET_OUTGOING 4 /* Originated by us . */
+#define PACKET_LOOPBACK 5
+#define PACKET_FASTROUTE 6
+
+/* Packet socket options. */
+
+#define PACKET_ADD_MEMBERSHIP 1
+#define PACKET_DROP_MEMBERSHIP 2
+#define PACKET_RECV_OUTPUT 3
+#define PACKET_RX_RING 5
+#define PACKET_STATISTICS 6
+
+struct packet_mreq
+ {
+ int mr_ifindex;
+ unsigned short int mr_type;
+ unsigned short int mr_alen;
+ unsigned char mr_address[8];
+ };
+
+#define PACKET_MR_MULTICAST 0
+#define PACKET_MR_PROMISC 1
+#define PACKET_MR_ALLMULTI 2
+
+#endif /* netpacket/packet.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/nl_types.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/nl_types.h
new file mode 100644
index 0000000..74e7621
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/nl_types.h
@@ -0,0 +1,59 @@
+/* Copyright (C) 1996, 1997, 1999, 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NL_TYPES_H
+#define _NL_TYPES_H 1
+
+#include <features.h>
+
+/* The default message set used by the gencat program. */
+#define NL_SETD 1
+
+/* Value for FLAG parameter of `catgets' to say we want XPG4 compliance. */
+#define NL_CAT_LOCALE 1
+
+
+__BEGIN_DECLS
+
+#ifdef __UCLIBC_MJN3_ONLY__
+#warning "mjn3 FIXME: None of these prototypes have implementations."
+#endif
+
+/* Message catalog descriptor type. */
+typedef void *nl_catd;
+
+/* Type used by `nl_langinfo'. */
+typedef int nl_item;
+
+/* Open message catalog for later use, returning descriptor.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern nl_catd catopen (__const char *__cat_name, int __flag) __nonnull ((1));
+
+/* Return translation with NUMBER in SET of CATALOG; if not found
+ return STRING. */
+extern char *catgets (nl_catd __catalog, int __set, int __number,
+ __const char *__string) __THROW __nonnull ((1));
+
+/* Close message CATALOG. */
+extern int catclose (nl_catd __catalog) __THROW __nonnull ((1));
+
+__END_DECLS
+
+#endif /* nl_types.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/obstack.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/obstack.h
new file mode 100644
index 0000000..071acaf
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/obstack.h
@@ -0,0 +1,605 @@
+/* obstack.h - object stack macros
+ Copyright (C) 1988,89,90,91,92,93,94,96,97,98,99 Free Software Foundation, Inc.
+ This file is part of the GNU C Library. Its master source is NOT part of
+ the C library, however. The master source lives in /gd/gnu/lib.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Summary:
+
+All the apparent functions defined here are macros. The idea
+is that you would use these pre-tested macros to solve a
+very specific set of problems, and they would run fast.
+Caution: no side-effects in arguments please!! They may be
+evaluated MANY times!!
+
+These macros operate a stack of objects. Each object starts life
+small, and may grow to maturity. (Consider building a word syllable
+by syllable.) An object can move while it is growing. Once it has
+been "finished" it never changes address again. So the "top of the
+stack" is typically an immature growing object, while the rest of the
+stack is of mature, fixed size and fixed address objects.
+
+These routines grab large chunks of memory, using a function you
+supply, called `obstack_chunk_alloc'. On occasion, they free chunks,
+by calling `obstack_chunk_free'. You must define them and declare
+them before using any obstack macros.
+
+Each independent stack is represented by a `struct obstack'.
+Each of the obstack macros expects a pointer to such a structure
+as the first argument.
+
+One motivation for this package is the problem of growing char strings
+in symbol tables. Unless you are "fascist pig with a read-only mind"
+--Gosper's immortal quote from HAKMEM item 154, out of context--you
+would not like to put any arbitrary upper limit on the length of your
+symbols.
+
+In practice this often means you will build many short symbols and a
+few long symbols. At the time you are reading a symbol you don't know
+how long it is. One traditional method is to read a symbol into a
+buffer, realloc()ating the buffer every time you try to read a symbol
+that is longer than the buffer. This is beaut, but you still will
+want to copy the symbol from the buffer to a more permanent
+symbol-table entry say about half the time.
+
+With obstacks, you can work differently. Use one obstack for all symbol
+names. As you read a symbol, grow the name in the obstack gradually.
+When the name is complete, finalize it. Then, if the symbol exists already,
+free the newly read name.
+
+The way we do this is to take a large chunk, allocating memory from
+low addresses. When you want to build a symbol in the chunk you just
+add chars above the current "high water mark" in the chunk. When you
+have finished adding chars, because you got to the end of the symbol,
+you know how long the chars are, and you can create a new object.
+Mostly the chars will not burst over the highest address of the chunk,
+because you would typically expect a chunk to be (say) 100 times as
+long as an average object.
+
+In case that isn't clear, when we have enough chars to make up
+the object, THEY ARE ALREADY CONTIGUOUS IN THE CHUNK (guaranteed)
+so we just point to it where it lies. No moving of chars is
+needed and this is the second win: potentially long strings need
+never be explicitly shuffled. Once an object is formed, it does not
+change its address during its lifetime.
+
+When the chars burst over a chunk boundary, we allocate a larger
+chunk, and then copy the partly formed object from the end of the old
+chunk to the beginning of the new larger chunk. We then carry on
+accreting characters to the end of the object as we normally would.
+
+A special macro is provided to add a single char at a time to a
+growing object. This allows the use of register variables, which
+break the ordinary 'growth' macro.
+
+Summary:
+ We allocate large chunks.
+ We carve out one object at a time from the current chunk.
+ Once carved, an object never moves.
+ We are free to append data of any size to the currently
+ growing object.
+ Exactly one object is growing in an obstack at any one time.
+ You can run one obstack per control block.
+ You may have as many control blocks as you dare.
+ Because of the way we do it, you can `unwind' an obstack
+ back to a previous state. (You may remove objects much
+ as you would with a stack.)
+*/
+
+
+/* Don't do the contents of this file more than once. */
+
+#ifndef _OBSTACK_H
+#define _OBSTACK_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* We use subtraction of (char *) 0 instead of casting to int
+ because on word-addressable machines a simple cast to int
+ may ignore the byte-within-word field of the pointer. */
+
+#ifndef __PTR_TO_INT
+# define __PTR_TO_INT(P) ((P) - (char *) 0)
+#endif
+
+#ifndef __INT_TO_PTR
+# define __INT_TO_PTR(P) ((P) + (char *) 0)
+#endif
+
+/* We need the type of the resulting object. If __PTRDIFF_TYPE__ is
+ defined, as with GNU C, use that; that way we don't pollute the
+ namespace with <stddef.h>'s symbols. Otherwise, if <stddef.h> is
+ available, include it and use ptrdiff_t. In traditional C, long is
+ the best that we can do. */
+
+#ifdef __PTRDIFF_TYPE__
+# define PTR_INT_TYPE __PTRDIFF_TYPE__
+#else
+# ifdef HAVE_STDDEF_H
+# include <stddef.h>
+# define PTR_INT_TYPE ptrdiff_t
+# else
+# define PTR_INT_TYPE long
+# endif
+#endif
+
+#if defined _LIBC || defined HAVE_STRING_H
+# include <string.h>
+# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
+#else
+# ifdef memcpy
+# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
+# else
+# define _obstack_memcpy(To, From, N) bcopy ((From), (To), (N))
+# endif
+#endif
+
+struct _obstack_chunk /* Lives at front of each chunk. */
+{
+ char *limit; /* 1 past end of this chunk */
+ struct _obstack_chunk *prev; /* address of prior chunk or NULL */
+ char contents[4]; /* objects begin here */
+};
+
+struct obstack /* control current object in current chunk */
+{
+ long chunk_size; /* preferred size to allocate chunks in */
+ struct _obstack_chunk *chunk; /* address of current struct obstack_chunk */
+ char *object_base; /* address of object we are building */
+ char *next_free; /* where to add next char to current object */
+ char *chunk_limit; /* address of char after current chunk */
+ PTR_INT_TYPE temp; /* Temporary for some macros. */
+ int alignment_mask; /* Mask of alignment for each object. */
+#if defined __STDC__ && __STDC__
+ /* These prototypes vary based on `use_extra_arg', and we use
+ casts to the prototypeless function type in all assignments,
+ but having prototypes here quiets -Wstrict-prototypes. */
+ struct _obstack_chunk *(*chunkfun) (void *, long);
+ void (*freefun) (void *, struct _obstack_chunk *);
+ void *extra_arg; /* first arg for chunk alloc/dealloc funcs */
+#else
+ struct _obstack_chunk *(*chunkfun) (); /* User's fcn to allocate a chunk. */
+ void (*freefun) (); /* User's function to free a chunk. */
+ char *extra_arg; /* first arg for chunk alloc/dealloc funcs */
+#endif
+ unsigned use_extra_arg:1; /* chunk alloc/dealloc funcs take extra arg */
+ unsigned maybe_empty_object:1;/* There is a possibility that the current
+ chunk contains a zero-length object. This
+ prevents freeing the chunk if we allocate
+ a bigger chunk to replace it. */
+ unsigned alloc_failed:1; /* No longer used, as we now call the failed
+ handler on error, but retained for binary
+ compatibility. */
+};
+
+/* Declare the external functions we use; they are in obstack.c. */
+
+#if defined __STDC__ && __STDC__
+extern void _obstack_newchunk (struct obstack *, int);
+extern void _obstack_free (struct obstack *, void *);
+extern int _obstack_begin (struct obstack *, int, int,
+ void *(*) (long), void (*) (void *));
+extern int _obstack_begin_1 (struct obstack *, int, int,
+ void *(*) (void *, long),
+ void (*) (void *, void *), void *);
+extern int _obstack_memory_used (struct obstack *);
+#else
+extern void _obstack_newchunk ();
+extern void _obstack_free ();
+extern int _obstack_begin ();
+extern int _obstack_begin_1 ();
+extern int _obstack_memory_used ();
+#endif
+
+#if defined __STDC__ && __STDC__
+
+/* Do the function-declarations after the structs
+ but before defining the macros. */
+
+void obstack_init (struct obstack *obstack);
+
+void * obstack_alloc (struct obstack *obstack, int size);
+
+void * obstack_copy (struct obstack *obstack, const void *address, int size);
+void * obstack_copy0 (struct obstack *obstack, const void *address, int size);
+
+void obstack_free (struct obstack *obstack, void *block);
+
+void obstack_blank (struct obstack *obstack, int size);
+
+void obstack_grow (struct obstack *obstack, const void *data, int size);
+void obstack_grow0 (struct obstack *obstack, const void *data, int size);
+
+void obstack_1grow (struct obstack *obstack, int data_char);
+void obstack_ptr_grow (struct obstack *obstack, const void *data);
+void obstack_int_grow (struct obstack *obstack, int data);
+
+void * obstack_finish (struct obstack *obstack);
+
+int obstack_object_size (struct obstack *obstack);
+
+int obstack_room (struct obstack *obstack);
+void obstack_make_room (struct obstack *obstack, int size);
+void obstack_1grow_fast (struct obstack *obstack, int data_char);
+void obstack_ptr_grow_fast (struct obstack *obstack, const void *data);
+void obstack_int_grow_fast (struct obstack *obstack, int data);
+void obstack_blank_fast (struct obstack *obstack, int size);
+
+void * obstack_base (struct obstack *obstack);
+void * obstack_next_free (struct obstack *obstack);
+int obstack_alignment_mask (struct obstack *obstack);
+int obstack_chunk_size (struct obstack *obstack);
+int obstack_memory_used (struct obstack *obstack);
+
+#endif /* __STDC__ */
+
+/* Non-ANSI C cannot really support alternative functions for these macros,
+ so we do not declare them. */
+
+/* Error handler called when `obstack_chunk_alloc' failed to allocate
+ more memory. This can be set to a user defined function which
+ should either abort gracefully or use longjump - but shouldn't
+ return. The default action is to print a message and abort. */
+#if defined __STDC__ && __STDC__
+extern void (*obstack_alloc_failed_handler) (void);
+#else
+extern void (*obstack_alloc_failed_handler) ();
+#endif
+
+/* Exit value used when `print_and_abort' is used. */
+extern int obstack_exit_failure;
+
+/* Pointer to beginning of object being allocated or to be allocated next.
+ Note that this might not be the final address of the object
+ because a new chunk might be needed to hold the final size. */
+
+#define obstack_base(h) ((h)->object_base)
+
+/* Size for allocating ordinary chunks. */
+
+#define obstack_chunk_size(h) ((h)->chunk_size)
+
+/* Pointer to next byte not yet allocated in current chunk. */
+
+#define obstack_next_free(h) ((h)->next_free)
+
+/* Mask specifying low bits that should be clear in address of an object. */
+
+#define obstack_alignment_mask(h) ((h)->alignment_mask)
+
+/* To prevent prototype warnings provide complete argument list in
+ standard C version. */
+#if defined __STDC__ && __STDC__
+
+# define obstack_init(h) \
+ _obstack_begin ((h), 0, 0, \
+ (void *(*) (long)) obstack_chunk_alloc, \
+ (void (*) (void *)) obstack_chunk_free)
+
+# define obstack_begin(h, size) \
+ _obstack_begin ((h), (size), 0, \
+ (void *(*) (long)) obstack_chunk_alloc, \
+ (void (*) (void *)) obstack_chunk_free)
+
+# define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
+ _obstack_begin ((h), (size), (alignment), \
+ (void *(*) (long)) (chunkfun), \
+ (void (*) (void *)) (freefun))
+
+# define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
+ _obstack_begin_1 ((h), (size), (alignment), \
+ (void *(*) (void *, long)) (chunkfun), \
+ (void (*) (void *, void *)) (freefun), (arg))
+
+# define obstack_chunkfun(h, newchunkfun) \
+ ((h) -> chunkfun = (struct _obstack_chunk *(*)(void *, long)) (newchunkfun))
+
+# define obstack_freefun(h, newfreefun) \
+ ((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun))
+
+#else
+
+# define obstack_init(h) \
+ _obstack_begin ((h), 0, 0, \
+ (void *(*) ()) obstack_chunk_alloc, \
+ (void (*) ()) obstack_chunk_free)
+
+# define obstack_begin(h, size) \
+ _obstack_begin ((h), (size), 0, \
+ (void *(*) ()) obstack_chunk_alloc, \
+ (void (*) ()) obstack_chunk_free)
+
+# define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
+ _obstack_begin ((h), (size), (alignment), \
+ (void *(*) ()) (chunkfun), \
+ (void (*) ()) (freefun))
+
+# define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
+ _obstack_begin_1 ((h), (size), (alignment), \
+ (void *(*) ()) (chunkfun), \
+ (void (*) ()) (freefun), (arg))
+
+# define obstack_chunkfun(h, newchunkfun) \
+ ((h) -> chunkfun = (struct _obstack_chunk *(*)()) (newchunkfun))
+
+# define obstack_freefun(h, newfreefun) \
+ ((h) -> freefun = (void (*)()) (newfreefun))
+
+#endif
+
+#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = achar)
+
+#define obstack_blank_fast(h,n) ((h)->next_free += (n))
+
+#define obstack_memory_used(h) _obstack_memory_used (h)
+
+#if defined __GNUC__ && defined __STDC__ && __STDC__
+/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
+ does not implement __extension__. But that compiler doesn't define
+ __GNUC_MINOR__. */
+# if __GNUC__ < 2 || (defined __NeXT__ && __NeXT__ && !__GNUC_MINOR__)
+# define __extension__
+# endif
+
+/* For GNU C, if not -traditional,
+ we can define these macros to compute all args only once
+ without using a global variable.
+ Also, we can avoid using the `temp' slot, to make faster code. */
+
+# define obstack_object_size(OBSTACK) \
+ __extension__ \
+ ({ struct obstack *__o = (OBSTACK); \
+ (unsigned) (__o->next_free - __o->object_base); })
+
+# define obstack_room(OBSTACK) \
+ __extension__ \
+ ({ struct obstack *__o = (OBSTACK); \
+ (unsigned) (__o->chunk_limit - __o->next_free); })
+
+# define obstack_make_room(OBSTACK,length) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ int __len = (length); \
+ if (__o->chunk_limit - __o->next_free < __len) \
+ _obstack_newchunk (__o, __len); \
+ (void) 0; })
+
+# define obstack_empty_p(OBSTACK) \
+ __extension__ \
+ ({ struct obstack *__o = (OBSTACK); \
+ (__o->chunk->prev == 0 && __o->next_free - __o->chunk->contents == 0); })
+
+# define obstack_grow(OBSTACK,where,length) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ int __len = (length); \
+ if (__o->next_free + __len > __o->chunk_limit) \
+ _obstack_newchunk (__o, __len); \
+ _obstack_memcpy (__o->next_free, (where), __len); \
+ __o->next_free += __len; \
+ (void) 0; })
+
+# define obstack_grow0(OBSTACK,where,length) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ int __len = (length); \
+ if (__o->next_free + __len + 1 > __o->chunk_limit) \
+ _obstack_newchunk (__o, __len + 1); \
+ _obstack_memcpy (__o->next_free, (where), __len); \
+ __o->next_free += __len; \
+ *(__o->next_free)++ = 0; \
+ (void) 0; })
+
+# define obstack_1grow(OBSTACK,datum) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ if (__o->next_free + 1 > __o->chunk_limit) \
+ _obstack_newchunk (__o, 1); \
+ *(__o->next_free)++ = (datum); \
+ (void) 0; })
+
+/* These assume that the obstack alignment is good enough for pointers
+ or ints, and that the data added so far to the current object
+ shares that much alignment. */
+
+# define obstack_ptr_grow(OBSTACK,datum) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ if (__o->next_free + sizeof (void *) > __o->chunk_limit) \
+ _obstack_newchunk (__o, sizeof (void *)); \
+ *((void **)__o->next_free)++ = (datum); \
+ (void) 0; })
+
+# define obstack_int_grow(OBSTACK,datum) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ if (__o->next_free + sizeof (int) > __o->chunk_limit) \
+ _obstack_newchunk (__o, sizeof (int)); \
+ *((int *)__o->next_free)++ = (datum); \
+ (void) 0; })
+
+# define obstack_ptr_grow_fast(h,aptr) \
+ (*((void **) (h)->next_free)++ = (aptr))
+
+# define obstack_int_grow_fast(h,aint) \
+ (*((int *) (h)->next_free)++ = (aint))
+
+# define obstack_blank(OBSTACK,length) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ int __len = (length); \
+ if (__o->chunk_limit - __o->next_free < __len) \
+ _obstack_newchunk (__o, __len); \
+ __o->next_free += __len; \
+ (void) 0; })
+
+# define obstack_alloc(OBSTACK,length) \
+__extension__ \
+({ struct obstack *__h = (OBSTACK); \
+ obstack_blank (__h, (length)); \
+ obstack_finish (__h); })
+
+# define obstack_copy(OBSTACK,where,length) \
+__extension__ \
+({ struct obstack *__h = (OBSTACK); \
+ obstack_grow (__h, (where), (length)); \
+ obstack_finish (__h); })
+
+# define obstack_copy0(OBSTACK,where,length) \
+__extension__ \
+({ struct obstack *__h = (OBSTACK); \
+ obstack_grow0 (__h, (where), (length)); \
+ obstack_finish (__h); })
+
+/* The local variable is named __o1 to avoid a name conflict
+ when obstack_blank is called. */
+# define obstack_finish(OBSTACK) \
+__extension__ \
+({ struct obstack *__o1 = (OBSTACK); \
+ void *value; \
+ value = (void *) __o1->object_base; \
+ if (__o1->next_free == value) \
+ __o1->maybe_empty_object = 1; \
+ __o1->next_free \
+ = __INT_TO_PTR ((__PTR_TO_INT (__o1->next_free)+__o1->alignment_mask)\
+ & ~ (__o1->alignment_mask)); \
+ if (__o1->next_free - (char *)__o1->chunk \
+ > __o1->chunk_limit - (char *)__o1->chunk) \
+ __o1->next_free = __o1->chunk_limit; \
+ __o1->object_base = __o1->next_free; \
+ value; })
+
+# define obstack_free(OBSTACK, OBJ) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ void *__obj = (OBJ); \
+ if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \
+ __o->next_free = __o->object_base = (char *)__obj; \
+ else (obstack_free) (__o, __obj); })
+
+#else /* not __GNUC__ or not __STDC__ */
+
+# define obstack_object_size(h) \
+ (unsigned) ((h)->next_free - (h)->object_base)
+
+# define obstack_room(h) \
+ (unsigned) ((h)->chunk_limit - (h)->next_free)
+
+# define obstack_empty_p(h) \
+ ((h)->chunk->prev == 0 && (h)->next_free - (h)->chunk->contents == 0)
+
+/* Note that the call to _obstack_newchunk is enclosed in (..., 0)
+ so that we can avoid having void expressions
+ in the arms of the conditional expression.
+ Casting the third operand to void was tried before,
+ but some compilers won't accept it. */
+
+# define obstack_make_room(h,length) \
+( (h)->temp = (length), \
+ (((h)->next_free + (h)->temp > (h)->chunk_limit) \
+ ? (_obstack_newchunk ((h), (h)->temp), 0) : 0))
+
+# define obstack_grow(h,where,length) \
+( (h)->temp = (length), \
+ (((h)->next_free + (h)->temp > (h)->chunk_limit) \
+ ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
+ _obstack_memcpy ((h)->next_free, (where), (h)->temp), \
+ (h)->next_free += (h)->temp)
+
+# define obstack_grow0(h,where,length) \
+( (h)->temp = (length), \
+ (((h)->next_free + (h)->temp + 1 > (h)->chunk_limit) \
+ ? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0), \
+ _obstack_memcpy ((h)->next_free, (where), (h)->temp), \
+ (h)->next_free += (h)->temp, \
+ *((h)->next_free)++ = 0)
+
+# define obstack_1grow(h,datum) \
+( (((h)->next_free + 1 > (h)->chunk_limit) \
+ ? (_obstack_newchunk ((h), 1), 0) : 0), \
+ (*((h)->next_free)++ = (datum)))
+
+# define obstack_ptr_grow(h,datum) \
+( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \
+ ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \
+ (*((const char **) (((h)->next_free+=sizeof(char *))-sizeof(char *))) = (datum)))
+
+# define obstack_int_grow(h,datum) \
+( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \
+ ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \
+ (*((int *) (((h)->next_free+=sizeof(int))-sizeof(int))) = (datum)))
+
+# define obstack_ptr_grow_fast(h,aptr) \
+ (*((const char **) (h)->next_free)++ = (aptr))
+
+# define obstack_int_grow_fast(h,aint) \
+ (*((int *) (h)->next_free)++ = (aint))
+
+# define obstack_blank(h,length) \
+( (h)->temp = (length), \
+ (((h)->chunk_limit - (h)->next_free < (h)->temp) \
+ ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
+ ((h)->next_free += (h)->temp))
+
+# define obstack_alloc(h,length) \
+ (obstack_blank ((h), (length)), obstack_finish ((h)))
+
+# define obstack_copy(h,where,length) \
+ (obstack_grow ((h), (where), (length)), obstack_finish ((h)))
+
+# define obstack_copy0(h,where,length) \
+ (obstack_grow0 ((h), (where), (length)), obstack_finish ((h)))
+
+# define obstack_finish(h) \
+( ((h)->next_free == (h)->object_base \
+ ? (((h)->maybe_empty_object = 1), 0) \
+ : 0), \
+ (h)->temp = __PTR_TO_INT ((h)->object_base), \
+ (h)->next_free \
+ = __INT_TO_PTR ((__PTR_TO_INT ((h)->next_free)+(h)->alignment_mask) \
+ & ~ ((h)->alignment_mask)), \
+ (((h)->next_free - (char *) (h)->chunk \
+ > (h)->chunk_limit - (char *) (h)->chunk) \
+ ? ((h)->next_free = (h)->chunk_limit) : 0), \
+ (h)->object_base = (h)->next_free, \
+ __INT_TO_PTR ((h)->temp))
+
+# if defined __STDC__ && __STDC__
+# define obstack_free(h,obj) \
+( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
+ (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
+ ? (int) ((h)->next_free = (h)->object_base \
+ = (h)->temp + (char *) (h)->chunk) \
+ : (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0)))
+# else
+# define obstack_free(h,obj) \
+( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
+ (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
+ ? (int) ((h)->next_free = (h)->object_base \
+ = (h)->temp + (char *) (h)->chunk) \
+ : (_obstack_free ((h), (h)->temp + (char *) (h)->chunk), 0)))
+# endif
+
+#endif /* not __GNUC__ or not __STDC__ */
+
+#ifdef __cplusplus
+} /* C++ */
+#endif
+
+#endif /* obstack.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/paths.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/paths.h
new file mode 100644
index 0000000..ae892c4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/paths.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)paths.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _PATHS_H_
+#define _PATHS_H_
+
+/* Default search path. */
+#define _PATH_DEFPATH "/usr/bin:/bin"
+/* All standard utilities path. */
+#define _PATH_STDPATH \
+ "/usr/bin:/bin:/usr/sbin:/sbin"
+
+#define _PATH_BSHELL "/bin/sh"
+#define _PATH_CONSOLE "/dev/console"
+#define _PATH_CSHELL "/bin/csh"
+#define _PATH_DEVDB "/var/run/dev.db"
+#define _PATH_DEVNULL "/dev/null"
+#define _PATH_DRUM "/dev/drum"
+#define _PATH_KLOG "/proc/kmsg"
+#define _PATH_KMEM "/dev/kmem"
+#define _PATH_LASTLOG "/var/log/lastlog"
+#define _PATH_MAILDIR "/var/mail"
+#define _PATH_MAN "/usr/share/man"
+#define _PATH_MEM "/dev/mem"
+#define _PATH_MNTTAB "/etc/fstab"
+#define _PATH_MOUNTED "/etc/mtab"
+#define _PATH_NOLOGIN "/etc/nologin"
+#define _PATH_PRESERVE "/var/lib"
+#define _PATH_RWHODIR "/var/spool/rwho"
+#define _PATH_SENDMAIL "/usr/sbin/sendmail"
+#define _PATH_SHADOW "/etc/shadow"
+#define _PATH_SHELLS "/etc/shells"
+#define _PATH_TTY "/dev/tty"
+#define _PATH_UNIX "/boot/vmlinux"
+#define _PATH_UTMP "/var/run/utmp"
+#define _PATH_VI "/usr/bin/vi"
+#define _PATH_WTMP "/var/log/wtmp"
+
+/* uClibc */
+#ifdef _LIBC
+#define _PATH_PASSWD "/etc/passwd"
+#define _PATH_GROUP "/etc/group"
+#endif
+
+/* Provide trailing slash, since mostly used for building pathnames. */
+#define _PATH_DEV "/dev/"
+#define _PATH_TMP "/tmp/"
+#define _PATH_VARDB "/var/db/"
+#define _PATH_VARRUN "/var/run/"
+#define _PATH_VARTMP "/var/tmp/"
+
+#endif /* !_PATHS_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/poll.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/poll.h
new file mode 100644
index 0000000..06fb41a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/poll.h
@@ -0,0 +1 @@
+#include <sys/poll.h>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/protocols/routed.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/protocols/routed.h
new file mode 100644
index 0000000..befd865
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/protocols/routed.h
@@ -0,0 +1,101 @@
+/*-
+ * Copyright (c) 1983, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)routed.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _PROTOCOLS_ROUTED_H
+#define _PROTOCOLS_ROUTED_H 1
+
+#include <sys/socket.h>
+/*
+ * Routing Information Protocol
+ *
+ * Derived from Xerox NS Routing Information Protocol
+ * by changing 32-bit net numbers to sockaddr's and
+ * padding stuff to 32-bit boundaries.
+ */
+#define RIPVERSION 1
+
+struct netinfo {
+ struct sockaddr rip_dst; /* destination net/host */
+ int rip_metric; /* cost of route */
+};
+
+struct rip {
+ u_char rip_cmd; /* request/response */
+ u_char rip_vers; /* protocol version # */
+ u_char rip_res1[2]; /* pad to 32-bit boundary */
+ union {
+ struct netinfo ru_nets[1]; /* variable length... */
+ char ru_tracefile[1]; /* ditto ... */
+ } ripun;
+#define rip_nets ripun.ru_nets
+#define rip_tracefile ripun.ru_tracefile
+};
+
+/*
+ * Packet types.
+ */
+#define RIPCMD_REQUEST 1 /* want info */
+#define RIPCMD_RESPONSE 2 /* responding to request */
+#define RIPCMD_TRACEON 3 /* turn tracing on */
+#define RIPCMD_TRACEOFF 4 /* turn it off */
+
+#define RIPCMD_MAX 5
+#ifdef RIPCMDS
+char *ripcmds[RIPCMD_MAX] =
+ { "#0", "REQUEST", "RESPONSE", "TRACEON", "TRACEOFF" };
+#endif
+
+#define HOPCNT_INFINITY 16 /* per Xerox NS */
+#define MAXPACKETSIZE 512 /* max broadcast size */
+
+/*
+ * Timer values used in managing the routing table.
+ * Complete tables are broadcast every SUPPLY_INTERVAL seconds.
+ * If changes occur between updates, dynamic updates containing only changes
+ * may be sent. When these are sent, a timer is set for a random value
+ * between MIN_WAITTIME and MAX_WAITTIME, and no additional dynamic updates
+ * are sent until the timer expires.
+ *
+ * Every update of a routing entry forces an entry's timer to be reset.
+ * After EXPIRE_TIME without updates, the entry is marked invalid,
+ * but held onto until GARBAGE_TIME so that others may
+ * see it "be deleted".
+ */
+#define TIMER_RATE 30 /* alarm clocks every 30 seconds */
+
+#define SUPPLY_INTERVAL 30 /* time to supply tables */
+#define MIN_WAITTIME 2 /* min. interval to broadcast changes */
+#define MAX_WAITTIME 5 /* max. time to delay changes */
+
+#define EXPIRE_TIME 180 /* time to mark entry invalid */
+#define GARBAGE_TIME 240 /* time to garbage collect */
+
+#endif /* protocols/routed.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/protocols/rwhod.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/protocols/rwhod.h
new file mode 100644
index 0000000..446d6f9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/protocols/rwhod.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)rwhod.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _PROTOCOLS_RWHOD_H
+#define _PROTOCOLS_RWHOD_H 1
+
+#include <sys/types.h>
+
+/*
+ * rwho protocol packet format.
+ */
+struct outmp {
+ char out_line[8]; /* tty name */
+ char out_name[8]; /* user id */
+ int32_t out_time; /* time on */
+};
+
+struct whod {
+ char wd_vers; /* protocol version # */
+ char wd_type; /* packet type, see below */
+ char wd_pad[2];
+ int wd_sendtime; /* time stamp by sender */
+ int wd_recvtime; /* time stamp applied by receiver */
+ char wd_hostname[32]; /* hosts's name */
+ int wd_loadav[3]; /* load average as in uptime */
+ int wd_boottime; /* time system booted */
+ struct whoent {
+ struct outmp we_utmp; /* active tty info */
+ int we_idle; /* tty idle time */
+ } wd_we[1024 / sizeof (struct whoent)];
+};
+
+#define WHODVERSION 1
+#define WHODTYPE_STATUS 1 /* host status */
+
+/* We used to define _PATH_RWHODIR here but it's now in <paths.h>. */
+#include <paths.h>
+
+#endif /* protocols/rwhod.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/protocols/talkd.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/protocols/talkd.h
new file mode 100644
index 0000000..a8f33b1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/protocols/talkd.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)talkd.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _PROTOCOLS_TALKD_H
+#define _PROTOCOLS_TALKD_H 1
+
+/*
+ * This describes the protocol used by the talk server and clients.
+ *
+ * The talk server acts a repository of invitations, responding to
+ * requests by clients wishing to rendezvous for the purpose of
+ * holding a conversation. In normal operation, a client, the caller,
+ * initiates a rendezvous by sending a CTL_MSG to the server of
+ * type LOOK_UP. This causes the server to search its invitation
+ * tables to check if an invitation currently exists for the caller
+ * (to speak to the callee specified in the message). If the lookup
+ * fails, the caller then sends an ANNOUNCE message causing the server
+ * to broadcast an announcement on the callee's login ports requesting
+ * contact. When the callee responds, the local server uses the
+ * recorded invitation to respond with the appropriate rendezvous
+ * address and the caller and callee client programs establish a
+ * stream connection through which the conversation takes place.
+ */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+/*
+ * Client->server request message format.
+ */
+typedef struct {
+ u_char vers; /* protocol version */
+ u_char type; /* request type, see below */
+ u_char answer; /* not used */
+ u_char pad;
+ u_int32_t id_num; /* message id */
+ struct osockaddr addr; /* old (4.3) style */
+ struct osockaddr ctl_addr; /* old (4.3) style */
+ int32_t pid; /* caller's process id */
+#define NAME_SIZE 12
+ char l_name[NAME_SIZE];/* caller's name */
+ char r_name[NAME_SIZE];/* callee's name */
+#define TTY_SIZE 16
+ char r_tty[TTY_SIZE];/* callee's tty name */
+} CTL_MSG;
+
+/*
+ * Server->client response message format.
+ */
+typedef struct {
+ u_char vers; /* protocol version */
+ u_char type; /* type of request message, see below */
+ u_char answer; /* response to request message, see below */
+ u_char pad;
+ u_int32_t id_num; /* message id */
+ struct osockaddr addr; /* address for establishing conversation */
+} CTL_RESPONSE;
+
+#define TALK_VERSION 1 /* protocol version */
+
+/* message type values */
+#define LEAVE_INVITE 0 /* leave invitation with server */
+#define LOOK_UP 1 /* check for invitation by callee */
+#define DELETE 2 /* delete invitation by caller */
+#define ANNOUNCE 3 /* announce invitation by caller */
+
+/* answer values */
+#define SUCCESS 0 /* operation completed properly */
+#define NOT_HERE 1 /* callee not logged in */
+#define FAILED 2 /* operation failed for unexplained reason */
+#define MACHINE_UNKNOWN 3 /* caller's machine name unknown */
+#define PERMISSION_DENIED 4 /* callee's tty doesn't permit announce */
+#define UNKNOWN_REQUEST 5 /* request has invalid type value */
+#define BADVERSION 6 /* request has invalid protocol version */
+#define BADADDR 7 /* request has invalid addr value */
+#define BADCTLADDR 8 /* request has invalid ctl_addr value */
+
+/*
+ * Operational parameters.
+ */
+#define MAX_LIFE 60 /* max time daemon saves invitations */
+/* RING_WAIT should be 10's of seconds less than MAX_LIFE */
+#define RING_WAIT 30 /* time to wait before resending invitation */
+
+#endif /* protocols/talkd.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/protocols/timed.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/protocols/timed.h
new file mode 100644
index 0000000..4345bed
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/protocols/timed.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)timed.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _PROTOCOLS_TIMED_H
+#define _PROTOCOLS_TIMED_H 1
+
+#include <rpc/types.h>
+
+/*
+ * Time Synchronization Protocol
+ */
+
+#define TSPVERSION 1
+#define ANYADDR NULL
+
+struct tsp {
+ u_char tsp_type;
+ u_char tsp_vers;
+ u_short tsp_seq;
+ union {
+ struct timeval tspu_time;
+ char tspu_hopcnt;
+ } tsp_u;
+ char tsp_name[MAXHOSTNAMELEN];
+};
+
+#define tsp_time tsp_u.tspu_time
+#define tsp_hopcnt tsp_u.tspu_hopcnt
+
+/*
+ * Command types.
+ */
+#define TSP_ANY 0 /* match any types */
+#define TSP_ADJTIME 1 /* send adjtime */
+#define TSP_ACK 2 /* generic acknowledgement */
+#define TSP_MASTERREQ 3 /* ask for master's name */
+#define TSP_MASTERACK 4 /* acknowledge master request */
+#define TSP_SETTIME 5 /* send network time */
+#define TSP_MASTERUP 6 /* inform slaves that master is up */
+#define TSP_SLAVEUP 7 /* slave is up but not polled */
+#define TSP_ELECTION 8 /* advance candidature for master */
+#define TSP_ACCEPT 9 /* support candidature of master */
+#define TSP_REFUSE 10 /* reject candidature of master */
+#define TSP_CONFLICT 11 /* two or more masters present */
+#define TSP_RESOLVE 12 /* masters' conflict resolution */
+#define TSP_QUIT 13 /* reject candidature if master is up */
+#define TSP_DATE 14 /* reset the time (date command) */
+#define TSP_DATEREQ 15 /* remote request to reset the time */
+#define TSP_DATEACK 16 /* acknowledge time setting */
+#define TSP_TRACEON 17 /* turn tracing on */
+#define TSP_TRACEOFF 18 /* turn tracing off */
+#define TSP_MSITE 19 /* find out master's site */
+#define TSP_MSITEREQ 20 /* remote master's site request */
+#define TSP_TEST 21 /* for testing election algo */
+#define TSP_SETDATE 22 /* New from date command */
+#define TSP_SETDATEREQ 23 /* New remote for above */
+#define TSP_LOOP 24 /* loop detection packet */
+
+#define TSPTYPENUMBER 25
+
+#ifdef TSPTYPES
+char *tsptype[TSPTYPENUMBER] =
+ { "ANY", "ADJTIME", "ACK", "MASTERREQ", "MASTERACK", "SETTIME", "MASTERUP",
+ "SLAVEUP", "ELECTION", "ACCEPT", "REFUSE", "CONFLICT", "RESOLVE", "QUIT",
+ "DATE", "DATEREQ", "DATEACK", "TRACEON", "TRACEOFF", "MSITE", "MSITEREQ",
+ "TEST", "SETDATE", "SETDATEREQ", "LOOP" };
+#endif
+
+#endif /* protocols/timed.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/pthread.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/pthread.h
new file mode 100644
index 0000000..69aa2f8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/pthread.h
@@ -0,0 +1,691 @@
+/* Linuxthreads - a simple clone()-based implementation of Posix */
+/* threads for Linux. */
+/* Copyright (C) 1996 Xavier Leroy (Xavier.Leroy@inria.fr) */
+/* */
+/* This program is free software; you can redistribute it and/or */
+/* modify it under the terms of the GNU Library General Public License */
+/* as published by the Free Software Foundation; either version 2 */
+/* of the License, or (at your option) any later version. */
+/* */
+/* This program is distributed in the hope that it will be useful, */
+/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
+/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
+/* GNU Library General Public License for more details. */
+
+#ifndef _PTHREAD_H
+#define _PTHREAD_H 1
+
+#include <features.h>
+
+#include <sched.h>
+#include <time.h>
+
+#define __need_sigset_t
+#include <signal.h>
+#include <bits/pthreadtypes.h>
+#include <bits/initspin.h>
+
+
+__BEGIN_DECLS
+
+/* Initializers. */
+
+#define PTHREAD_MUTEX_INITIALIZER \
+ {0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, __LOCK_INITIALIZER}
+#ifdef __USE_GNU
+# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
+ {0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, __LOCK_INITIALIZER}
+# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
+ {0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, __LOCK_INITIALIZER}
+# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
+ {0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, __LOCK_INITIALIZER}
+#endif
+
+#define PTHREAD_COND_INITIALIZER {__LOCK_INITIALIZER, 0}
+
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
+# define PTHREAD_RWLOCK_INITIALIZER \
+ { __LOCK_INITIALIZER, 0, NULL, NULL, NULL, \
+ PTHREAD_RWLOCK_DEFAULT_NP, PTHREAD_PROCESS_PRIVATE }
+#endif
+#ifdef __USE_GNU
+# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
+ { __LOCK_INITIALIZER, 0, NULL, NULL, NULL, \
+ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, PTHREAD_PROCESS_PRIVATE }
+#endif
+
+/* Values for attributes. */
+
+enum
+{
+ PTHREAD_CREATE_JOINABLE,
+#define PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_JOINABLE
+ PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED PTHREAD_CREATE_DETACHED
+};
+
+enum
+{
+ PTHREAD_INHERIT_SCHED,
+#define PTHREAD_INHERIT_SCHED PTHREAD_INHERIT_SCHED
+ PTHREAD_EXPLICIT_SCHED
+#define PTHREAD_EXPLICIT_SCHED PTHREAD_EXPLICIT_SCHED
+};
+
+enum
+{
+ PTHREAD_SCOPE_SYSTEM,
+#define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_SYSTEM
+ PTHREAD_SCOPE_PROCESS
+#define PTHREAD_SCOPE_PROCESS PTHREAD_SCOPE_PROCESS
+};
+
+enum
+{
+ PTHREAD_MUTEX_ADAPTIVE_NP,
+ PTHREAD_MUTEX_RECURSIVE_NP,
+ PTHREAD_MUTEX_ERRORCHECK_NP,
+ PTHREAD_MUTEX_TIMED_NP
+#ifdef __USE_UNIX98
+ ,
+ PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_ADAPTIVE_NP,
+ PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
+ PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
+ PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
+#endif
+#ifdef __USE_GNU
+ /* For compatibility. */
+ , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_ADAPTIVE_NP
+#endif
+};
+
+enum
+{
+ PTHREAD_PROCESS_PRIVATE,
+#define PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_PRIVATE
+ PTHREAD_PROCESS_SHARED
+#define PTHREAD_PROCESS_SHARED PTHREAD_PROCESS_SHARED
+};
+
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
+enum
+{
+ PTHREAD_RWLOCK_PREFER_READER_NP,
+ PTHREAD_RWLOCK_PREFER_WRITER_NP,
+ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
+ PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_WRITER_NP
+};
+#endif /* Unix98 */
+
+#define PTHREAD_ONCE_INIT 0
+
+/* Special constants */
+
+#ifdef __USE_XOPEN2K
+/* -1 is distinct from 0 and all errno constants */
+# define PTHREAD_BARRIER_SERIAL_THREAD -1
+#endif
+
+/* Cleanup buffers */
+
+struct _pthread_cleanup_buffer
+{
+ void (*__routine) (void *); /* Function to call. */
+ void *__arg; /* Its argument. */
+ int __canceltype; /* Saved cancellation type. */
+ struct _pthread_cleanup_buffer *__prev; /* Chaining of cleanup functions. */
+};
+
+/* Cancellation */
+
+enum
+{
+ PTHREAD_CANCEL_ENABLE,
+#define PTHREAD_CANCEL_ENABLE PTHREAD_CANCEL_ENABLE
+ PTHREAD_CANCEL_DISABLE
+#define PTHREAD_CANCEL_DISABLE PTHREAD_CANCEL_DISABLE
+};
+enum
+{
+ PTHREAD_CANCEL_DEFERRED,
+#define PTHREAD_CANCEL_DEFERRED PTHREAD_CANCEL_DEFERRED
+ PTHREAD_CANCEL_ASYNCHRONOUS
+#define PTHREAD_CANCEL_ASYNCHRONOUS PTHREAD_CANCEL_ASYNCHRONOUS
+};
+#define PTHREAD_CANCELED ((void *) -1)
+
+
+/* Function for handling threads. */
+
+/* Create a thread with given attributes ATTR (or default attributes
+ if ATTR is NULL), and call function START_ROUTINE with given
+ arguments ARG. */
+extern int pthread_create (pthread_t *__restrict __threadp,
+ __const pthread_attr_t *__restrict __attr,
+ void *(*__start_routine) (void *),
+ void *__restrict __arg) __THROW;
+
+/* Obtain the identifier of the current thread. */
+extern pthread_t pthread_self (void) __THROW;
+
+/* Compare two thread identifiers. */
+extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __THROW;
+
+/* Terminate calling thread. */
+extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
+
+/* Make calling thread wait for termination of the thread TH. The
+ exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN
+ is not NULL. */
+extern int pthread_join (pthread_t __th, void **__thread_return);
+
+/* Indicate that the thread TH is never to be joined with PTHREAD_JOIN.
+ The resources of TH will therefore be freed immediately when it
+ terminates, instead of waiting for another thread to perform PTHREAD_JOIN
+ on it. */
+extern int pthread_detach (pthread_t __th) __THROW;
+
+
+/* Functions for handling attributes. */
+
+/* Initialize thread attribute *ATTR with default attributes
+ (detachstate is PTHREAD_JOINABLE, scheduling policy is SCHED_OTHER,
+ no user-provided stack). */
+extern int pthread_attr_init (pthread_attr_t *__attr) __THROW;
+
+/* Destroy thread attribute *ATTR. */
+extern int pthread_attr_destroy (pthread_attr_t *__attr) __THROW;
+
+/* Set the `detachstate' attribute in *ATTR according to DETACHSTATE. */
+extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
+ int __detachstate) __THROW;
+
+/* Return in *DETACHSTATE the `detachstate' attribute in *ATTR. */
+extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr,
+ int *__detachstate) __THROW;
+
+/* Set scheduling parameters (priority, etc) in *ATTR according to PARAM. */
+extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
+ __const struct sched_param *__restrict
+ __param) __THROW;
+
+/* Return in *PARAM the scheduling parameters of *ATTR. */
+extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict
+ __attr,
+ struct sched_param *__restrict __param)
+ __THROW;
+
+/* Set scheduling policy in *ATTR according to POLICY. */
+extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
+ __THROW;
+
+/* Return in *POLICY the scheduling policy of *ATTR. */
+extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict
+ __attr, int *__restrict __policy)
+ __THROW;
+
+/* Set scheduling inheritance mode in *ATTR according to INHERIT. */
+extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
+ int __inherit) __THROW;
+
+/* Return in *INHERIT the scheduling inheritance mode of *ATTR. */
+extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict
+ __attr, int *__restrict __inherit)
+ __THROW;
+
+/* Set scheduling contention scope in *ATTR according to SCOPE. */
+extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
+ __THROW;
+
+/* Return in *SCOPE the scheduling contention scope of *ATTR. */
+extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr,
+ int *__restrict __scope) __THROW;
+
+#ifdef __USE_UNIX98
+/* Set the size of the guard area at the bottom of the thread. */
+extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
+ size_t __guardsize) __THROW;
+
+/* Get the size of the guard area at the bottom of the thread. */
+extern int pthread_attr_getguardsize (__const pthread_attr_t *__restrict
+ __attr, size_t *__restrict __guardsize)
+ __THROW;
+#endif
+
+/* Set the starting address of the stack of the thread to be created.
+ Depending on whether the stack grows up or down the value must either
+ be higher or lower than all the address in the memory block. The
+ minimal size of the block must be PTHREAD_STACK_SIZE. */
+extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
+ void *__stackaddr) __THROW;
+
+/* Return the previously set address for the stack. */
+extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict
+ __attr, void **__restrict __stackaddr)
+ __THROW;
+
+#ifdef __USE_XOPEN2K
+/* The following two interfaces are intended to replace the last two. They
+ require setting the address as well as the size since only setting the
+ address will make the implementation on some architectures impossible. */
+extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
+ size_t __stacksize) __THROW;
+
+/* Return the previously set address for the stack. */
+extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
+ void **__restrict __stackaddr,
+ size_t *__restrict __stacksize) __THROW;
+#endif
+
+/* Add information about the minimum stack size needed for the thread
+ to be started. This size must never be less than PTHREAD_STACK_SIZE
+ and must also not exceed the system limits. */
+extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
+ size_t __stacksize) __THROW;
+
+/* Return the currently used minimal stack size. */
+extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict
+ __attr, size_t *__restrict __stacksize)
+ __THROW;
+
+#ifdef __USE_GNU
+/* Initialize thread attribute *ATTR with attributes corresponding to the
+ already running thread TH. It shall be called on unitialized ATTR
+ and destroyed with pthread_attr_destroy when no longer needed. */
+extern void* pthread_getattr_np(pthread_t thread, pthread_attr_t *attr);
+#endif
+
+/* Functions for scheduling control. */
+
+/* Set the scheduling parameters for TARGET_THREAD according to POLICY
+ and *PARAM. */
+extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
+ __const struct sched_param *__param)
+ __THROW;
+
+/* Return in *POLICY and *PARAM the scheduling parameters for TARGET_THREAD. */
+extern int pthread_getschedparam (pthread_t __target_thread,
+ int *__restrict __policy,
+ struct sched_param *__restrict __param)
+ __THROW;
+
+#ifdef __USE_UNIX98
+/* Determine level of concurrency. */
+extern int pthread_getconcurrency (void) __THROW;
+
+/* Set new concurrency level to LEVEL. */
+extern int pthread_setconcurrency (int __level) __THROW;
+#endif
+
+/* Functions for mutex handling. */
+
+/* Initialize MUTEX using attributes in *MUTEX_ATTR, or use the
+ default values if later is NULL. */
+extern int pthread_mutex_init (pthread_mutex_t *__restrict __mutex,
+ __const pthread_mutexattr_t *__restrict
+ __mutex_attr) __THROW;
+
+/* Destroy MUTEX. */
+extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) __THROW;
+
+/* Try to lock MUTEX. */
+extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) __THROW;
+
+/* Wait until lock for MUTEX becomes available and lock it. */
+extern int pthread_mutex_lock (pthread_mutex_t *__mutex) __THROW;
+
+#ifdef __USE_XOPEN2K
+/* Wait until lock becomes available, or specified time passes. */
+extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
+ __const struct timespec *__restrict
+ __abstime) __THROW;
+#endif
+
+/* Unlock MUTEX. */
+extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) __THROW;
+
+
+/* Functions for handling mutex attributes. */
+
+/* Initialize mutex attribute object ATTR with default attributes
+ (kind is PTHREAD_MUTEX_TIMED_NP). */
+extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) __THROW;
+
+/* Destroy mutex attribute object ATTR. */
+extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) __THROW;
+
+/* Get the process-shared flag of the mutex attribute ATTR. */
+extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *
+ __restrict __attr,
+ int *__restrict __pshared) __THROW;
+
+/* Set the process-shared flag of the mutex attribute ATTR. */
+extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
+ int __pshared) __THROW;
+
+#ifdef __USE_UNIX98
+/* Set the mutex kind attribute in *ATTR to KIND (either PTHREAD_MUTEX_NORMAL,
+ PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_ERRORCHECK, or
+ PTHREAD_MUTEX_DEFAULT). */
+extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
+ __THROW;
+
+/* Return in *KIND the mutex kind attribute in *ATTR. */
+extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict
+ __attr, int *__restrict __kind) __THROW;
+#endif
+
+
+/* Functions for handling conditional variables. */
+
+/* Initialize condition variable COND using attributes ATTR, or use
+ the default values if later is NULL. */
+extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
+ __const pthread_condattr_t *__restrict
+ __cond_attr) __THROW;
+
+/* Destroy condition variable COND. */
+extern int pthread_cond_destroy (pthread_cond_t *__cond) __THROW;
+
+/* Wake up one thread waiting for condition variable COND. */
+extern int pthread_cond_signal (pthread_cond_t *__cond) __THROW;
+
+/* Wake up all threads waiting for condition variables COND. */
+extern int pthread_cond_broadcast (pthread_cond_t *__cond) __THROW;
+
+/* Wait for condition variable COND to be signaled or broadcast.
+ MUTEX is assumed to be locked before. */
+extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
+ pthread_mutex_t *__restrict __mutex);
+
+/* Wait for condition variable COND to be signaled or broadcast until
+ ABSTIME. MUTEX is assumed to be locked before. ABSTIME is an
+ absolute time specification; zero is the beginning of the epoch
+ (00:00:00 GMT, January 1, 1970). */
+extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
+ pthread_mutex_t *__restrict __mutex,
+ __const struct timespec *__restrict
+ __abstime);
+
+/* Functions for handling condition variable attributes. */
+
+/* Initialize condition variable attribute ATTR. */
+extern int pthread_condattr_init (pthread_condattr_t *__attr) __THROW;
+
+/* Destroy condition variable attribute ATTR. */
+extern int pthread_condattr_destroy (pthread_condattr_t *__attr) __THROW;
+
+/* Get the process-shared flag of the condition variable attribute ATTR. */
+extern int pthread_condattr_getpshared (__const pthread_condattr_t *
+ __restrict __attr,
+ int *__restrict __pshared) __THROW;
+
+/* Set the process-shared flag of the condition variable attribute ATTR. */
+extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
+ int __pshared) __THROW;
+
+
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
+/* Functions for handling read-write locks. */
+
+/* Initialize read-write lock RWLOCK using attributes ATTR, or use
+ the default values if later is NULL. */
+extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
+ __const pthread_rwlockattr_t *__restrict
+ __attr) __THROW;
+
+/* Destroy read-write lock RWLOCK. */
+extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) __THROW;
+
+/* Acquire read lock for RWLOCK. */
+extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) __THROW;
+
+/* Try to acquire read lock for RWLOCK. */
+extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) __THROW;
+
+# ifdef __USE_XOPEN2K
+/* Try to acquire read lock for RWLOCK or return after specfied time. */
+extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
+ __const struct timespec *__restrict
+ __abstime) __THROW;
+# endif
+
+/* Acquire write lock for RWLOCK. */
+extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) __THROW;
+
+/* Try to acquire write lock for RWLOCK. */
+extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) __THROW;
+
+# ifdef __USE_XOPEN2K
+/* Try to acquire write lock for RWLOCK or return after specfied time. */
+extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
+ __const struct timespec *__restrict
+ __abstime) __THROW;
+# endif
+
+/* Unlock RWLOCK. */
+extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) __THROW;
+
+
+/* Functions for handling read-write lock attributes. */
+
+/* Initialize attribute object ATTR with default values. */
+extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) __THROW;
+
+/* Destroy attribute object ATTR. */
+extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) __THROW;
+
+/* Return current setting of process-shared attribute of ATTR in PSHARED. */
+extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t *
+ __restrict __attr,
+ int *__restrict __pshared) __THROW;
+
+/* Set process-shared attribute of ATTR to PSHARED. */
+extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
+ int __pshared) __THROW;
+
+/* Return current setting of reader/writer preference. */
+extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t *__attr,
+ int *__pref) __THROW;
+
+/* Set reader/write preference. */
+extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
+ int __pref) __THROW;
+#endif
+
+#if 0
+/* Not yet implemented in uClibc! */
+
+#ifdef __USE_XOPEN2K
+/* The IEEE Std. 1003.1j-2000 introduces functions to implement
+ spinlocks. */
+
+/* Initialize the spinlock LOCK. If PSHARED is nonzero the spinlock can
+ be shared between different processes. */
+extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
+ __THROW;
+
+/* Destroy the spinlock LOCK. */
+extern int pthread_spin_destroy (pthread_spinlock_t *__lock) __THROW;
+
+/* Wait until spinlock LOCK is retrieved. */
+extern int pthread_spin_lock (pthread_spinlock_t *__lock) __THROW;
+
+/* Try to lock spinlock LOCK. */
+extern int pthread_spin_trylock (pthread_spinlock_t *__lock) __THROW;
+
+/* Release spinlock LOCK. */
+extern int pthread_spin_unlock (pthread_spinlock_t *__lock) __THROW;
+
+
+/* Barriers are a also a new feature in 1003.1j-2000. */
+
+extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
+ __const pthread_barrierattr_t *__restrict
+ __attr, unsigned int __count) __THROW;
+
+extern int pthread_barrier_destroy (pthread_barrier_t *__barrier) __THROW;
+
+extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr) __THROW;
+
+extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr) __THROW;
+
+extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t *
+ __restrict __attr,
+ int *__restrict __pshared) __THROW;
+
+extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
+ int __pshared) __THROW;
+
+extern int pthread_barrier_wait (pthread_barrier_t *__barrier) __THROW;
+#endif
+#endif
+
+
+/* Functions for handling thread-specific data. */
+
+/* Create a key value identifying a location in the thread-specific
+ data area. Each thread maintains a distinct thread-specific data
+ area. DESTR_FUNCTION, if non-NULL, is called with the value
+ associated to that key when the key is destroyed.
+ DESTR_FUNCTION is not called if the value associated is NULL when
+ the key is destroyed. */
+extern int pthread_key_create (pthread_key_t *__key,
+ void (*__destr_function) (void *)) __THROW;
+
+/* Destroy KEY. */
+extern int pthread_key_delete (pthread_key_t __key) __THROW;
+
+/* Store POINTER in the thread-specific data slot identified by KEY. */
+extern int pthread_setspecific (pthread_key_t __key,
+ __const void *__pointer) __THROW;
+
+/* Return current value of the thread-specific data slot identified by KEY. */
+extern void *pthread_getspecific (pthread_key_t __key) __THROW;
+
+
+/* Functions for handling initialization. */
+
+/* Guarantee that the initialization function INIT_ROUTINE will be called
+ only once, even if pthread_once is executed several times with the
+ same ONCE_CONTROL argument. ONCE_CONTROL must point to a static or
+ extern variable initialized to PTHREAD_ONCE_INIT.
+
+ The initialization functions might throw exception which is why
+ this function is not marked with __THROW. */
+extern int pthread_once (pthread_once_t *__once_control,
+ void (*__init_routine) (void));
+
+
+/* Functions for handling cancellation. */
+
+/* Set cancelability state of current thread to STATE, returning old
+ state in *OLDSTATE if OLDSTATE is not NULL. */
+extern int pthread_setcancelstate (int __state, int *__oldstate);
+
+/* Set cancellation state of current thread to TYPE, returning the old
+ type in *OLDTYPE if OLDTYPE is not NULL. */
+extern int pthread_setcanceltype (int __type, int *__oldtype);
+
+/* Cancel THREAD immediately or at the next possibility. */
+extern int pthread_cancel (pthread_t __cancelthread);
+
+/* Test for pending cancellation for the current thread and terminate
+ the thread as per pthread_exit(PTHREAD_CANCELED) if it has been
+ cancelled. */
+extern void pthread_testcancel (void);
+
+/* Return the previously set address for the stack. */
+extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
+ void **__restrict __stackaddr,
+ size_t *__restrict __stacksize) __THROW;
+
+
+/* Install a cleanup handler: ROUTINE will be called with arguments ARG
+ when the thread is cancelled or calls pthread_exit. ROUTINE will also
+ be called with arguments ARG when the matching pthread_cleanup_pop
+ is executed with non-zero EXECUTE argument.
+ pthread_cleanup_push and pthread_cleanup_pop are macros and must always
+ be used in matching pairs at the same nesting level of braces. */
+
+#define pthread_cleanup_push(routine,arg) \
+ { struct _pthread_cleanup_buffer _buffer; \
+ _pthread_cleanup_push (&_buffer, (routine), (arg));
+
+extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *__buffer,
+ void (*__routine) (void *),
+ void *__arg) __THROW;
+
+/* Remove a cleanup handler installed by the matching pthread_cleanup_push.
+ If EXECUTE is non-zero, the handler function is called. */
+
+#define pthread_cleanup_pop(execute) \
+ _pthread_cleanup_pop (&_buffer, (execute)); }
+
+extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *__buffer,
+ int __execute) __THROW;
+
+/* Install a cleanup handler as pthread_cleanup_push does, but also
+ saves the current cancellation type and set it to deferred cancellation. */
+
+#ifdef __USE_GNU
+# define pthread_cleanup_push_defer_np(routine,arg) \
+ { struct _pthread_cleanup_buffer _buffer; \
+ _pthread_cleanup_push_defer (&_buffer, (routine), (arg));
+
+extern void _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *__buffer,
+ void (*__routine) (void *),
+ void *__arg) __THROW;
+
+/* Remove a cleanup handler as pthread_cleanup_pop does, but also
+ restores the cancellation type that was in effect when the matching
+ pthread_cleanup_push_defer was called. */
+
+# define pthread_cleanup_pop_restore_np(execute) \
+ _pthread_cleanup_pop_restore (&_buffer, (execute)); }
+
+extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *__buffer,
+ int __execute) __THROW;
+#endif
+
+
+#if 0
+/* Not yet implemented in uClibc! */
+
+#ifdef __USE_XOPEN2K
+/* Get ID of CPU-time clock for thread THREAD_ID. */
+extern int pthread_getcpuclockid (pthread_t __thread_id,
+ clockid_t *__clock_id) __THROW;
+#endif
+#endif
+
+
+/* Functions for handling signals. */
+#include <bits/sigthread.h>
+
+
+/* Functions for handling process creation and process execution. */
+
+/* Install handlers to be called when a new process is created with FORK.
+ The PREPARE handler is called in the parent process just before performing
+ FORK. The PARENT handler is called in the parent process just after FORK.
+ The CHILD handler is called in the child process. Each of the three
+ handlers can be NULL, meaning that no handler needs to be called at that
+ point.
+ PTHREAD_ATFORK can be called several times, in which case the PREPARE
+ handlers are called in LIFO order (last added with PTHREAD_ATFORK,
+ first called before FORK), and the PARENT and CHILD handlers are called
+ in FIFO (first added, first called). */
+
+extern int pthread_atfork (void (*__prepare) (void),
+ void (*__parent) (void),
+ void (*__child) (void)) __THROW;
+
+/* Terminate all threads in the program except the calling process.
+ Should be called just before invoking one of the exec*() functions. */
+
+extern void pthread_kill_other_threads_np (void) __THROW;
+
+__END_DECLS
+
+#endif /* pthread.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/pty.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/pty.h
new file mode 100644
index 0000000..2d4b5e2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/pty.h
@@ -0,0 +1,44 @@
+/* Functions for pseudo TTY handling.
+ Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _PTY_H
+#define _PTY_H 1
+
+#include <features.h>
+
+#include <termios.h>
+#include <sys/ioctl.h>
+
+
+__BEGIN_DECLS
+
+/* Create pseudo tty master slave pair with NAME and set terminal
+ attributes according to TERMP and WINP and return handles for both
+ ends in AMASTER and ASLAVE. */
+extern int openpty (int *__amaster, int *__aslave, char *__name,
+ struct termios *__termp, struct winsize *__winp) __THROW;
+
+/* Create child process and establish the slave pseudo terminal as the
+ child's controlling terminal. */
+extern int forkpty (int *__amaster, char *__name,
+ struct termios *__termp, struct winsize *__winp) __THROW;
+
+__END_DECLS
+
+#endif /* pty.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/pwd.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/pwd.h
new file mode 100644
index 0000000..e874133
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/pwd.h
@@ -0,0 +1,186 @@
+/* Copyright (C) 1991,1992,1995-2001,2003,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 9.2.2 User Database Access <pwd.h>
+ */
+
+#ifndef _PWD_H
+#define _PWD_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <bits/types.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+#if defined __USE_XOPEN || defined __USE_XOPEN2K
+/* The Single Unix specification says that some more types are
+ available here. */
+# ifndef __gid_t_defined
+typedef __gid_t gid_t;
+# define __gid_t_defined
+# endif
+
+# ifndef __uid_t_defined
+typedef __uid_t uid_t;
+# define __uid_t_defined
+# endif
+#endif
+
+/* The passwd structure. */
+struct passwd
+{
+ char *pw_name; /* Username. */
+ char *pw_passwd; /* Password. */
+ __uid_t pw_uid; /* User ID. */
+ __gid_t pw_gid; /* Group ID. */
+ char *pw_gecos; /* Real name. */
+ char *pw_dir; /* Home directory. */
+ char *pw_shell; /* Shell program. */
+};
+
+
+#if defined __USE_SVID || defined __USE_GNU
+# define __need_FILE
+# include <stdio.h>
+#endif
+
+
+#if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN_EXTENDED
+/* Rewind the password-file stream.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void setpwent (void);
+
+/* Close the password-file stream.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void endpwent (void);
+
+/* Read an entry from the password-file stream, opening it if necessary.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct passwd *getpwent (void);
+#endif
+
+#ifdef __USE_SVID
+/* Read an entry from STREAM.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern struct passwd *fgetpwent (FILE *__stream);
+
+/* Write the given entry onto the given stream.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int putpwent (__const struct passwd *__restrict __p,
+ FILE *__restrict __f);
+#endif
+
+/* Search for an entry with a matching user ID.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct passwd *getpwuid (__uid_t __uid);
+
+/* Search for an entry with a matching username.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern struct passwd *getpwnam (__const char *__name);
+
+#if defined __USE_POSIX || defined __USE_MISC
+
+# ifdef __USE_MISC
+/* Reasonable value for the buffer sized used in the reentrant
+ functions below. But better use `sysconf'. */
+# define NSS_BUFLEN_PASSWD 1024
+# endif
+
+/* Reentrant versions of some of the functions above.
+
+ PLEASE NOTE: the `getpwent_r' function is not (yet) standardized.
+ The interface may change in later versions of this library. But
+ the interface is designed following the principals used for the
+ other reentrant functions so the chances are good this is what the
+ POSIX people would choose. */
+
+# if defined __USE_SVID || defined __USE_MISC
+/* This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int getpwent_r (struct passwd *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen,
+ struct passwd **__restrict __result);
+# endif
+
+extern int getpwuid_r (__uid_t __uid,
+ struct passwd *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen,
+ struct passwd **__restrict __result);
+
+extern int getpwnam_r (__const char *__restrict __name,
+ struct passwd *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen,
+ struct passwd **__restrict __result);
+
+
+# ifdef __USE_SVID
+/* Read an entry from STREAM. This function is not standardized and
+ probably never will.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int fgetpwent_r (FILE *__restrict __stream,
+ struct passwd *__restrict __resultbuf,
+ char *__restrict __buffer, size_t __buflen,
+ struct passwd **__restrict __result);
+# endif
+
+#endif /* POSIX or reentrant */
+
+#ifdef __USE_GNU
+/* Re-construct the password-file line for the given uid
+ in the given buffer. This knows the format that the caller
+ will expect, but this need not be the format of the password file.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int getpw (__uid_t __uid, char *__buffer);
+#endif
+
+__END_DECLS
+
+#endif /* pwd.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/rdma/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rdma/..install.cmd
new file mode 100644
index 0000000..6cefd63
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rdma/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/rdma/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/rdma /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/rdma mips ib_user_mad.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/rdma /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/rdma mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/rdma/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/rdma/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rdma/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rdma/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/rdma/ib_user_mad.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rdma/ib_user_mad.h
new file mode 100644
index 0000000..d6fce1c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rdma/ib_user_mad.h
@@ -0,0 +1,203 @@
+/*
+ * Copyright (c) 2004 Topspin Communications. All rights reserved.
+ * Copyright (c) 2005 Voltaire, Inc. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses. You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef IB_USER_MAD_H
+#define IB_USER_MAD_H
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+
+/*
+ * Increment this value if any changes that break userspace ABI
+ * compatibility are made.
+ */
+#define IB_USER_MAD_ABI_VERSION 5
+
+/*
+ * Make sure that all structs defined in this file remain laid out so
+ * that they pack the same way on 32-bit and 64-bit architectures (to
+ * avoid incompatibility between 32-bit userspace and 64-bit kernels).
+ */
+
+/**
+ * ib_user_mad_hdr_old - Old version of MAD packet header without pkey_index
+ * @id - ID of agent MAD received with/to be sent with
+ * @status - 0 on successful receive, ETIMEDOUT if no response
+ * received (transaction ID in data[] will be set to TID of original
+ * request) (ignored on send)
+ * @timeout_ms - Milliseconds to wait for response (unset on receive)
+ * @retries - Number of automatic retries to attempt
+ * @qpn - Remote QP number received from/to be sent to
+ * @qkey - Remote Q_Key to be sent with (unset on receive)
+ * @lid - Remote lid received from/to be sent to
+ * @sl - Service level received with/to be sent with
+ * @path_bits - Local path bits received with/to be sent with
+ * @grh_present - If set, GRH was received/should be sent
+ * @gid_index - Local GID index to send with (unset on receive)
+ * @hop_limit - Hop limit in GRH
+ * @traffic_class - Traffic class in GRH
+ * @gid - Remote GID in GRH
+ * @flow_label - Flow label in GRH
+ */
+struct ib_user_mad_hdr_old {
+ __u32 id;
+ __u32 status;
+ __u32 timeout_ms;
+ __u32 retries;
+ __u32 length;
+ __be32 qpn;
+ __be32 qkey;
+ __be16 lid;
+ __u8 sl;
+ __u8 path_bits;
+ __u8 grh_present;
+ __u8 gid_index;
+ __u8 hop_limit;
+ __u8 traffic_class;
+ __u8 gid[16];
+ __be32 flow_label;
+};
+
+/**
+ * ib_user_mad_hdr - MAD packet header
+ * This layout allows specifying/receiving the P_Key index. To use
+ * this capability, an application must call the
+ * IB_USER_MAD_ENABLE_PKEY ioctl on the user MAD file handle before
+ * any other actions with the file handle.
+ * @id - ID of agent MAD received with/to be sent with
+ * @status - 0 on successful receive, ETIMEDOUT if no response
+ * received (transaction ID in data[] will be set to TID of original
+ * request) (ignored on send)
+ * @timeout_ms - Milliseconds to wait for response (unset on receive)
+ * @retries - Number of automatic retries to attempt
+ * @qpn - Remote QP number received from/to be sent to
+ * @qkey - Remote Q_Key to be sent with (unset on receive)
+ * @lid - Remote lid received from/to be sent to
+ * @sl - Service level received with/to be sent with
+ * @path_bits - Local path bits received with/to be sent with
+ * @grh_present - If set, GRH was received/should be sent
+ * @gid_index - Local GID index to send with (unset on receive)
+ * @hop_limit - Hop limit in GRH
+ * @traffic_class - Traffic class in GRH
+ * @gid - Remote GID in GRH
+ * @flow_label - Flow label in GRH
+ * @pkey_index - P_Key index
+ */
+struct ib_user_mad_hdr {
+ __u32 id;
+ __u32 status;
+ __u32 timeout_ms;
+ __u32 retries;
+ __u32 length;
+ __be32 qpn;
+ __be32 qkey;
+ __be16 lid;
+ __u8 sl;
+ __u8 path_bits;
+ __u8 grh_present;
+ __u8 gid_index;
+ __u8 hop_limit;
+ __u8 traffic_class;
+ __u8 gid[16];
+ __be32 flow_label;
+ __u16 pkey_index;
+ __u8 reserved[6];
+};
+
+/**
+ * ib_user_mad - MAD packet
+ * @hdr - MAD packet header
+ * @data - Contents of MAD
+ *
+ */
+struct ib_user_mad {
+ struct ib_user_mad_hdr hdr;
+ __u64 data[0];
+};
+
+/*
+ * Earlier versions of this interface definition declared the
+ * method_mask[] member as an array of __u32 but treated it as a
+ * bitmap made up of longs in the kernel. This ambiguity meant that
+ * 32-bit big-endian applications that can run on both 32-bit and
+ * 64-bit kernels had no consistent ABI to rely on, and 64-bit
+ * big-endian applications that treated method_mask as being made up
+ * of 32-bit words would have their bitmap misinterpreted.
+ *
+ * To clear up this confusion, we change the declaration of
+ * method_mask[] to use unsigned long and handle the conversion from
+ * 32-bit userspace to 64-bit kernel for big-endian systems in the
+ * compat_ioctl method. Unfortunately, to keep the structure layout
+ * the same, we need the method_mask[] array to be aligned only to 4
+ * bytes even when long is 64 bits, which forces us into this ugly
+ * typedef.
+ */
+typedef unsigned long __attribute__((aligned(4))) packed_ulong;
+#define IB_USER_MAD_LONGS_PER_METHOD_MASK (128 / (8 * sizeof (long)))
+
+/**
+ * ib_user_mad_reg_req - MAD registration request
+ * @id - Set by the kernel; used to identify agent in future requests.
+ * @qpn - Queue pair number; must be 0 or 1.
+ * @method_mask - The caller will receive unsolicited MADs for any method
+ * where @method_mask = 1.
+ * @mgmt_class - Indicates which management class of MADs should be receive
+ * by the caller. This field is only required if the user wishes to
+ * receive unsolicited MADs, otherwise it should be 0.
+ * @mgmt_class_version - Indicates which version of MADs for the given
+ * management class to receive.
+ * @oui: Indicates IEEE OUI when mgmt_class is a vendor class
+ * in the range from 0x30 to 0x4f. Otherwise not used.
+ * @rmpp_version: If set, indicates the RMPP version used.
+ *
+ */
+struct ib_user_mad_reg_req {
+ __u32 id;
+ packed_ulong method_mask[IB_USER_MAD_LONGS_PER_METHOD_MASK];
+ __u8 qpn;
+ __u8 mgmt_class;
+ __u8 mgmt_class_version;
+ __u8 oui[3];
+ __u8 rmpp_version;
+};
+
+#define IB_IOCTL_MAGIC 0x1b
+
+#define IB_USER_MAD_REGISTER_AGENT _IOWR(IB_IOCTL_MAGIC, 1, \
+ struct ib_user_mad_reg_req)
+
+#define IB_USER_MAD_UNREGISTER_AGENT _IOW(IB_IOCTL_MAGIC, 2, __u32)
+
+#define IB_USER_MAD_ENABLE_PKEY _IO(IB_IOCTL_MAGIC, 3)
+
+#endif /* IB_USER_MAD_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/regex.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/regex.h
new file mode 100644
index 0000000..2209f2b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/regex.h
@@ -0,0 +1,580 @@
+/* Definitions for data structures and routines for the regular
+ expression library.
+ Copyright (C) 1985,1989-93,1995-98,2000,2001,2002,2003,2005
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _REGEX_H
+#define _REGEX_H 1
+
+#include <sys/types.h>
+
+/* Allow the use in C++ code. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* POSIX says that <sys/types.h> must be included (by the caller) before
+ <regex.h>. */
+
+#if !defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE && defined VMS
+/* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it
+ should be there. */
+# include <stddef.h>
+#endif
+
+/* The following two types have to be signed and unsigned integer type
+ wide enough to hold a value of a pointer. For most ANSI compilers
+ ptrdiff_t and size_t should be likely OK. Still size of these two
+ types is 2 for Microsoft C. Ugh... */
+typedef long int s_reg_t;
+typedef unsigned long int active_reg_t;
+
+/* The following bits are used to determine the regexp syntax we
+ recognize. The set/not-set meanings are chosen so that Emacs syntax
+ remains the value 0. The bits are given in alphabetical order, and
+ the definitions shifted by one from the previous bit; thus, when we
+ add or remove a bit, only one other definition need change. */
+typedef unsigned long int reg_syntax_t;
+
+/* If this bit is not set, then \ inside a bracket expression is literal.
+ If set, then such a \ quotes the following character. */
+#define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1)
+
+/* If this bit is not set, then + and ? are operators, and \+ and \? are
+ literals.
+ If set, then \+ and \? are operators and + and ? are literals. */
+#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
+
+/* If this bit is set, then character classes are supported. They are:
+ [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:],
+ [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
+ If not set, then character classes are not supported. */
+#define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)
+
+/* If this bit is set, then ^ and $ are always anchors (outside bracket
+ expressions, of course).
+ If this bit is not set, then it depends:
+ ^ is an anchor if it is at the beginning of a regular
+ expression or after an open-group or an alternation operator;
+ $ is an anchor if it is at the end of a regular expression, or
+ before a close-group or an alternation operator.
+
+ This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
+ POSIX draft 11.2 says that * etc. in leading positions is undefined.
+ We already implemented a previous draft which made those constructs
+ invalid, though, so we haven't changed the code back. */
+#define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)
+
+/* If this bit is set, then special characters are always special
+ regardless of where they are in the pattern.
+ If this bit is not set, then special characters are special only in
+ some contexts; otherwise they are ordinary. Specifically,
+ * + ? and intervals are only special when not after the beginning,
+ open-group, or alternation operator. */
+#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
+
+/* If this bit is set, then *, +, ?, and { cannot be first in an re or
+ immediately after an alternation or begin-group operator. */
+#define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)
+
+/* If this bit is set, then . matches newline.
+ If not set, then it doesn't. */
+#define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)
+
+/* If this bit is set, then . doesn't match NUL.
+ If not set, then it does. */
+#define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)
+
+/* If this bit is set, nonmatching lists [^...] do not match newline.
+ If not set, they do. */
+#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
+
+/* If this bit is set, either \{...\} or {...} defines an
+ interval, depending on RE_NO_BK_BRACES.
+ If not set, \{, \}, {, and } are literals. */
+#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
+
+/* If this bit is set, +, ? and | aren't recognized as operators.
+ If not set, they are. */
+#define RE_LIMITED_OPS (RE_INTERVALS << 1)
+
+/* If this bit is set, newline is an alternation operator.
+ If not set, newline is literal. */
+#define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
+
+/* If this bit is set, then `{...}' defines an interval, and \{ and \}
+ are literals.
+ If not set, then `\{...\}' defines an interval. */
+#define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
+
+/* If this bit is set, (...) defines a group, and \( and \) are literals.
+ If not set, \(...\) defines a group, and ( and ) are literals. */
+#define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)
+
+/* If this bit is set, then \<digit> matches <digit>.
+ If not set, then \<digit> is a back-reference. */
+#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
+
+/* If this bit is set, then | is an alternation operator, and \| is literal.
+ If not set, then \| is an alternation operator, and | is literal. */
+#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
+
+/* If this bit is set, then an ending range point collating higher
+ than the starting range point, as in [z-a], is invalid.
+ If not set, then when ending range point collates higher than the
+ starting range point, the range is ignored. */
+#define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)
+
+/* If this bit is set, then an unmatched ) is ordinary.
+ If not set, then an unmatched ) is invalid. */
+#define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
+
+/* If this bit is set, succeed as soon as we match the whole pattern,
+ without further backtracking. */
+#define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)
+
+/* If this bit is set, do not process the GNU regex operators.
+ If not set, then the GNU regex operators are recognized. */
+#define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1)
+
+/* If this bit is set, turn on internal regex debugging.
+ If not set, and debugging was on, turn it off.
+ This only works if regex.c is compiled -DDEBUG.
+ We define this bit always, so that all that's needed to turn on
+ debugging is to recompile regex.c; the calling code can always have
+ this bit set, and it won't affect anything in the normal case. */
+#define RE_DEBUG (RE_NO_GNU_OPS << 1)
+
+/* If this bit is set, a syntactically invalid interval is treated as
+ a string of ordinary characters. For example, the ERE 'a{1' is
+ treated as 'a\{1'. */
+#define RE_INVALID_INTERVAL_ORD (RE_DEBUG << 1)
+
+/* If this bit is set, then ignore case when matching.
+ If not set, then case is significant. */
+#define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1)
+
+/* This bit is used internally like RE_CONTEXT_INDEP_ANCHORS but only
+ for ^, because it is difficult to scan the regex backwards to find
+ whether ^ should be special. */
+#define RE_CARET_ANCHORS_HERE (RE_ICASE << 1)
+
+/* If this bit is set, then \{ cannot be first in an bre or
+ immediately after an alternation or begin-group operator. */
+#define RE_CONTEXT_INVALID_DUP (RE_CARET_ANCHORS_HERE << 1)
+
+/* If this bit is set, then no_sub will be set to 1 during
+ re_compile_pattern. */
+#define RE_NO_SUB (RE_CONTEXT_INVALID_DUP << 1)
+
+/* This global variable defines the particular regexp syntax to use (for
+ some interfaces). When a regexp is compiled, the syntax used is
+ stored in the pattern buffer, so changing this does not affect
+ already-compiled regexps. */
+extern reg_syntax_t re_syntax_options;
+
+/* Define combinations of the above bits for the standard possibilities.
+ (The [[[ comments delimit what gets put into the Texinfo file, so
+ don't delete them!) */
+/* [[[begin syntaxes]]] */
+#define RE_SYNTAX_EMACS 0
+
+#define RE_SYNTAX_AWK \
+ (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
+ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
+ | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
+ | RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
+
+#define RE_SYNTAX_GNU_AWK \
+ ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \
+ & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS \
+ | RE_CONTEXT_INVALID_OPS ))
+
+#define RE_SYNTAX_POSIX_AWK \
+ (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \
+ | RE_INTERVALS | RE_NO_GNU_OPS)
+
+#define RE_SYNTAX_GREP \
+ (RE_BK_PLUS_QM | RE_CHAR_CLASSES \
+ | RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \
+ | RE_NEWLINE_ALT)
+
+#define RE_SYNTAX_EGREP \
+ (RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \
+ | RE_NEWLINE_ALT | RE_NO_BK_PARENS \
+ | RE_NO_BK_VBAR)
+
+#define RE_SYNTAX_POSIX_EGREP \
+ (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES \
+ | RE_INVALID_INTERVAL_ORD)
+
+/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
+#define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
+
+#define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
+
+/* Syntax bits common to both basic and extended POSIX regex syntax. */
+#define _RE_SYNTAX_POSIX_COMMON \
+ (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
+ | RE_INTERVALS | RE_NO_EMPTY_RANGES)
+
+#define RE_SYNTAX_POSIX_BASIC \
+ (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM | RE_CONTEXT_INVALID_DUP)
+
+/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
+ RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
+ isn't minimal, since other operators, such as \`, aren't disabled. */
+#define RE_SYNTAX_POSIX_MINIMAL_BASIC \
+ (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
+
+#define RE_SYNTAX_POSIX_EXTENDED \
+ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_VBAR \
+ | RE_CONTEXT_INVALID_OPS | RE_UNMATCHED_RIGHT_PAREN_ORD)
+
+/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INDEP_OPS is
+ removed and RE_NO_BK_REFS is added. */
+#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
+ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
+ | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
+/* [[[end syntaxes]]] */
+
+/* Maximum number of duplicates an interval can allow. Some systems
+ (erroneously) define this in other header files, but we want our
+ value, so remove any previous define. */
+#ifdef RE_DUP_MAX
+# undef RE_DUP_MAX
+#endif
+/* If sizeof(int) == 2, then ((1 << 15) - 1) overflows. */
+#define RE_DUP_MAX (0x7fff)
+
+
+/* POSIX `cflags' bits (i.e., information for `regcomp'). */
+
+/* If this bit is set, then use extended regular expression syntax.
+ If not set, then use basic regular expression syntax. */
+#define REG_EXTENDED 1
+
+/* If this bit is set, then ignore case when matching.
+ If not set, then case is significant. */
+#define REG_ICASE (REG_EXTENDED << 1)
+
+/* If this bit is set, then anchors do not match at newline
+ characters in the string.
+ If not set, then anchors do match at newlines. */
+#define REG_NEWLINE (REG_ICASE << 1)
+
+/* If this bit is set, then report only success or fail in regexec.
+ If not set, then returns differ between not matching and errors. */
+#define REG_NOSUB (REG_NEWLINE << 1)
+
+
+/* POSIX `eflags' bits (i.e., information for regexec). */
+
+/* If this bit is set, then the beginning-of-line operator doesn't match
+ the beginning of the string (presumably because it's not the
+ beginning of a line).
+ If not set, then the beginning-of-line operator does match the
+ beginning of the string. */
+#define REG_NOTBOL 1
+
+/* Like REG_NOTBOL, except for the end-of-line. */
+#define REG_NOTEOL (1 << 1)
+
+/* Use PMATCH[0] to delimit the start and end of the search in the
+ buffer. */
+#define REG_STARTEND (1 << 2)
+
+
+/* If any error codes are removed, changed, or added, update the
+ `re_error_msg' table in regex.c. */
+typedef enum
+{
+#ifdef _XOPEN_SOURCE
+ REG_ENOSYS = -1, /* This will never happen for this implementation. */
+#endif
+
+ REG_NOERROR = 0, /* Success. */
+ REG_NOMATCH, /* Didn't find a match (for regexec). */
+
+ /* POSIX regcomp return error codes. (In the order listed in the
+ standard.) */
+ REG_BADPAT, /* Invalid pattern. */
+ REG_ECOLLATE, /* Invalid collating element. */
+ REG_ECTYPE, /* Invalid character class name. */
+ REG_EESCAPE, /* Trailing backslash. */
+ REG_ESUBREG, /* Invalid back reference. */
+ REG_EBRACK, /* Unmatched left bracket. */
+ REG_EPAREN, /* Parenthesis imbalance. */
+ REG_EBRACE, /* Unmatched \{. */
+ REG_BADBR, /* Invalid contents of \{\}. */
+ REG_ERANGE, /* Invalid range end. */
+ REG_ESPACE, /* Ran out of memory. */
+ REG_BADRPT, /* No preceding re for repetition op. */
+
+ /* Error codes we've added. */
+ REG_EEND, /* Premature end. */
+ REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
+ REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
+} reg_errcode_t;
+
+/* This data structure represents a compiled pattern. Before calling
+ the pattern compiler, the fields `buffer', `allocated', `fastmap',
+ `translate', and `no_sub' can be set. After the pattern has been
+ compiled, the `re_nsub' field is available. All other fields are
+ private to the regex routines. */
+
+#ifndef RE_TRANSLATE_TYPE
+# define RE_TRANSLATE_TYPE unsigned char *
+#endif
+
+struct re_pattern_buffer
+{
+ /* Space that holds the compiled pattern. It is declared as
+ `unsigned char *' because its elements are sometimes used as
+ array indexes. */
+ unsigned char *buffer;
+
+ /* Number of bytes to which `buffer' points. */
+ unsigned long int allocated;
+
+ /* Number of bytes actually used in `buffer'. */
+ unsigned long int used;
+
+ /* Syntax setting with which the pattern was compiled. */
+ reg_syntax_t syntax;
+
+ /* Pointer to a fastmap, if any, otherwise zero. re_search uses the
+ fastmap, if there is one, to skip over impossible starting points
+ for matches. */
+ char *fastmap;
+
+ /* Either a translate table to apply to all characters before
+ comparing them, or zero for no translation. The translation is
+ applied to a pattern when it is compiled and to a string when it
+ is matched. */
+ RE_TRANSLATE_TYPE translate;
+
+ /* Number of subexpressions found by the compiler. */
+ size_t re_nsub;
+
+ /* Zero if this pattern cannot match the empty string, one else.
+ Well, in truth it's used only in `re_search_2', to see whether or
+ not we should use the fastmap, so we don't set this absolutely
+ perfectly; see `re_compile_fastmap' (the `duplicate' case). */
+ unsigned can_be_null : 1;
+
+ /* If REGS_UNALLOCATED, allocate space in the `regs' structure
+ for `max (RE_NREGS, re_nsub + 1)' groups.
+ If REGS_REALLOCATE, reallocate space if necessary.
+ If REGS_FIXED, use what's there. */
+#define REGS_UNALLOCATED 0
+#define REGS_REALLOCATE 1
+#define REGS_FIXED 2
+ unsigned regs_allocated : 2;
+
+ /* Set to zero when `regex_compile' compiles a pattern; set to one
+ by `re_compile_fastmap' if it updates the fastmap. */
+ unsigned fastmap_accurate : 1;
+
+ /* If set, `re_match_2' does not return information about
+ subexpressions. */
+ unsigned no_sub : 1;
+
+ /* If set, a beginning-of-line anchor doesn't match at the beginning
+ of the string. */
+ unsigned not_bol : 1;
+
+ /* Similarly for an end-of-line anchor. */
+ unsigned not_eol : 1;
+
+ /* If true, an anchor at a newline matches. */
+ unsigned newline_anchor : 1;
+};
+
+typedef struct re_pattern_buffer regex_t;
+
+/* Type for byte offsets within the string. POSIX mandates this. */
+typedef int regoff_t;
+
+
+/* This is the structure we store register match data in. See
+ regex.texinfo for a full description of what registers match. */
+struct re_registers
+{
+ unsigned num_regs;
+ regoff_t *start;
+ regoff_t *end;
+};
+
+
+/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
+ `re_match_2' returns information about at least this many registers
+ the first time a `regs' structure is passed. */
+#ifndef RE_NREGS
+# define RE_NREGS 30
+#endif
+
+
+/* POSIX specification for registers. Aside from the different names than
+ `re_registers', POSIX uses an array of structures, instead of a
+ structure of arrays. */
+typedef struct
+{
+ regoff_t rm_so; /* Byte offset from string's start to substring's start. */
+ regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
+} regmatch_t;
+
+/* Declarations for routines. */
+
+/* To avoid duplicating every routine declaration -- once with a
+ prototype (if we are ANSI), and once without (if we aren't) -- we
+ use the following macro to declare argument types. This
+ unfortunately clutters up the declarations a bit, but I think it's
+ worth it. */
+
+#if __STDC__
+
+# define _RE_ARGS(args) args
+
+#else /* not __STDC__ */
+
+# define _RE_ARGS(args) ()
+
+#endif /* not __STDC__ */
+
+/* Sets the current default syntax to SYNTAX, and return the old syntax.
+ You can also simply assign to the `re_syntax_options' variable. */
+extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t __syntax));
+
+/* Compile the regular expression PATTERN, with length LENGTH
+ and syntax given by the global `re_syntax_options', into the buffer
+ BUFFER. Return NULL if successful, and an error string if not. */
+extern const char *re_compile_pattern _RE_ARGS ((const char *__pattern, size_t __length,
+ struct re_pattern_buffer *__buffer));
+
+
+/* Compile a fastmap for the compiled pattern in BUFFER; used to
+ accelerate searches. Return 0 if successful and -2 if was an
+ internal error. */
+extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *__buffer));
+
+
+/* Search in the string STRING (with length LENGTH) for the pattern
+ compiled into BUFFER. Start searching at position START, for RANGE
+ characters. Return the starting position of the match, -1 for no
+ match, or -2 for an internal error. Also return register
+ information in REGS (if REGS and BUFFER->no_sub are nonzero). */
+extern int re_search _RE_ARGS ((struct re_pattern_buffer *__buffer, const char *__string,
+ int __length, int __start, int __range,
+ struct re_registers *__regs));
+
+
+/* Like `re_search', but search in the concatenation of STRING1 and
+ STRING2. Also, stop searching at index START + STOP. */
+extern int re_search_2 _RE_ARGS ((struct re_pattern_buffer *__buffer,
+ const char *__string1, int __length1,
+ const char *__string2, int __length2, int __start,
+ int __range, struct re_registers *__regs, int __stop));
+
+
+/* Like `re_search', but return how many characters in STRING the regexp
+ in BUFFER matched, starting at position START. */
+extern int re_match _RE_ARGS ((struct re_pattern_buffer *__buffer, const char *__string,
+ int __length, int __start, struct re_registers *__regs));
+
+
+/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
+extern int re_match_2 _RE_ARGS ((struct re_pattern_buffer *__buffer,
+ const char *__string1, int __length1,
+ const char *__string2, int __length2, int __start,
+ struct re_registers *__regs, int __stop));
+
+
+/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
+ ENDS. Subsequent matches using BUFFER and REGS will use this memory
+ for recording register information. STARTS and ENDS must be
+ allocated with malloc, and must each be at least `NUM_REGS * sizeof
+ (regoff_t)' bytes long.
+
+ If NUM_REGS == 0, then subsequent matches should allocate their own
+ register data.
+
+ Unless this function is called, the first search or match using
+ PATTERN_BUFFER will allocate its own register data, without
+ freeing the old data. */
+extern void re_set_registers _RE_ARGS ((struct re_pattern_buffer *__buffer,
+ struct re_registers *__regs,
+ unsigned int __num_regs,
+ regoff_t *__starts, regoff_t *__ends));
+
+#if defined _REGEX_RE_COMP || defined _LIBC
+# ifndef _CRAY
+/* 4.2 bsd compatibility. */
+extern char *re_comp _RE_ARGS ((const char *));
+extern int re_exec _RE_ARGS ((const char *));
+# endif
+#endif
+
+/* GCC 2.95 and later have "__restrict"; C99 compilers have
+ "restrict", and "configure" may have defined "restrict". */
+#ifndef __restrict
+# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
+# if defined restrict || 199901L <= __STDC_VERSION__
+# define __restrict restrict
+# else
+# define __restrict
+# endif
+# endif
+#endif
+/* gcc 3.1 and up support the [restrict] syntax. */
+#ifndef __restrict_arr
+# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+# define __restrict_arr __restrict
+# else
+# define __restrict_arr
+# endif
+#endif
+
+/* POSIX compatibility. */
+extern int regcomp _RE_ARGS ((regex_t *__restrict __preg,
+ const char *__restrict __pattern,
+ int __cflags));
+
+extern int regexec _RE_ARGS ((const regex_t *__restrict __preg,
+ const char *__restrict __string, size_t __nmatch,
+ regmatch_t __pmatch[__restrict_arr],
+ int __eflags));
+
+extern size_t regerror _RE_ARGS ((int __errcode, const regex_t *__restrict __preg,
+ char *__restrict __errbuf, size_t __errbuf_size));
+
+extern void regfree _RE_ARGS ((regex_t *__preg));
+
+
+#ifdef __cplusplus
+}
+#endif /* C++ */
+
+#endif /* regex.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/regexp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/regexp.h
new file mode 100644
index 0000000..b7b50b7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/regexp.h
@@ -0,0 +1,222 @@
+/* Copyright (C) 1996, 1997, 1998, 1999, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _REGEXP_H
+#define _REGEXP_H 1
+
+/* The contents of this header file was first standardized in X/Open
+ System Interface and Headers Issue 2, originally coming from SysV.
+ In issue 4, version 2, it is marked as TO BE WITDRAWN, and it has
+ been withdrawn in SUSv3.
+
+ This code shouldn't be used in any newly written code. It is
+ included only for compatibility reasons. Use the POSIX definition
+ in <regex.h> for portable applications and a reasonable interface. */
+
+#include <features.h>
+#include <alloca.h>
+#include <regex.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* The implementation provided here emulates the needed functionality
+ by mapping to the POSIX regular expression matcher. The interface
+ for the here included function is weird (this really is a harmless
+ word).
+
+ The user has to provide six macros before this header file can be
+ included:
+
+ INIT Declarations vor variables which can be used by the
+ other macros.
+
+ GETC() Return the value of the next character in the regular
+ expression pattern. Successive calls should return
+ successive characters.
+
+ PEEKC() Return the value of the next character in the regular
+ expression pattern. Immediately successive calls to
+ PEEKC() should return the same character which should
+ also be the next character returned by GETC().
+
+ UNGETC(c) Cause `c' to be returned by the next call to GETC() and
+ PEEKC().
+
+ RETURN(ptr) Used for normal exit of the `compile' function. `ptr'
+ is a pointer to the character after the last character of
+ the compiled regular expression.
+
+ ERROR(val) Used for abnormal return from `compile'. `val' is the
+ error number. The error codes are:
+ 11 Range endpoint too large.
+ 16 Bad number.
+ 25 \digit out of range.
+ 36 Illegal or missing delimiter.
+ 41 No remembered search string.
+ 42 \( \) imbalance.
+ 43 Too many \(.
+ 44 More tan two numbers given in \{ \}.
+ 45 } expected after \.
+ 46 First number exceeds second in \{ \}.
+ 49 [ ] imbalance.
+ 50 Regular expression overflow.
+
+ */
+
+__BEGIN_DECLS
+
+/* Interface variables. They contain the results of the successful
+ calls to `setp' and `advance'. */
+extern char *loc1;
+extern char *loc2;
+
+/* The use of this variable in the `advance' function is not
+ supported. */
+extern char *locs;
+
+
+#ifndef __DO_NOT_DEFINE_COMPILE
+/* Get and compile the user supplied pattern up to end of line or
+ string or until EOF is seen, whatever happens first. The result is
+ placed in the buffer starting at EXPBUF and delimited by ENDBUF.
+
+ This function cannot be defined in the libc itself since it depends
+ on the macros. */
+char *
+compile (char *__restrict instring, char *__restrict expbuf,
+ __const char *__restrict endbuf, int eof)
+{
+ char *__input_buffer = NULL;
+ size_t __input_size = 0;
+ size_t __current_size = 0;
+ int __ch;
+ int __error;
+ INIT
+
+ /* Align the expression buffer according to the needs for an object
+ of type `regex_t'. Then check for minimum size of the buffer for
+ the compiled regular expression. */
+ regex_t *__expr_ptr;
+# if defined __GNUC__ && __GNUC__ >= 2
+ const size_t __req = __alignof__ (regex_t *);
+# else
+ /* How shall we find out? We simply guess it and can change it is
+ this really proofs to be wrong. */
+ const size_t __req = 8;
+# endif
+ expbuf += __req;
+ expbuf -= (expbuf - ((char *) 0)) % __req;
+ if (endbuf < expbuf + sizeof (regex_t))
+ {
+ ERROR (50);
+ }
+ __expr_ptr = (regex_t *) expbuf;
+ /* The remaining space in the buffer can be used for the compiled
+ pattern. */
+ __expr_ptr->buffer = expbuf + sizeof (regex_t);
+ __expr_ptr->allocated = endbuf - (char *) __expr_ptr->buffer;
+
+ while ((__ch = (GETC ())) != eof)
+ {
+ if (__ch == '\0' || __ch == '\n')
+ {
+ UNGETC (__ch);
+ break;
+ }
+
+ if (__current_size + 1 >= __input_size)
+ {
+ size_t __new_size = __input_size ? 2 * __input_size : 128;
+ char *__new_room = (char *) alloca (__new_size);
+ /* See whether we can use the old buffer. */
+ if (__new_room + __new_size == __input_buffer)
+ {
+ __input_size += __new_size;
+ __input_buffer = (char *) memcpy (__new_room, __input_buffer,
+ __current_size);
+ }
+ else if (__input_buffer + __input_size == __new_room)
+ __input_size += __new_size;
+ else
+ {
+ __input_size = __new_size;
+ __input_buffer = (char *) memcpy (__new_room, __input_buffer,
+ __current_size);
+ }
+ }
+ __input_buffer[__current_size++] = __ch;
+ }
+ __input_buffer[__current_size++] = '\0';
+
+ /* Now compile the pattern. */
+ __error = regcomp (__expr_ptr, __input_buffer, REG_NEWLINE);
+ if (__error != 0)
+ /* Oh well, we have to translate POSIX error codes. */
+ switch (__error)
+ {
+ case REG_BADPAT:
+ case REG_ECOLLATE:
+ case REG_ECTYPE:
+ case REG_EESCAPE:
+ case REG_BADRPT:
+ case REG_EEND:
+ case REG_ERPAREN:
+ default:
+ /* There is no matching error code. */
+ RETURN (36);
+ case REG_ESUBREG:
+ RETURN (25);
+ case REG_EBRACK:
+ RETURN (49);
+ case REG_EPAREN:
+ RETURN (42);
+ case REG_EBRACE:
+ RETURN (44);
+ case REG_BADBR:
+ RETURN (46);
+ case REG_ERANGE:
+ RETURN (11);
+ case REG_ESPACE:
+ case REG_ESIZE:
+ ERROR (50);
+ }
+
+ /* Everything is ok. */
+ RETURN ((char *) (__expr_ptr->buffer + __expr_ptr->used));
+}
+#endif
+
+
+/* Find the next match in STRING. The compiled regular expression is
+ found in the buffer starting at EXPBUF. `loc1' will return the
+ first character matched and `loc2' points to the next unmatched
+ character. */
+extern int step (__const char *__restrict __string,
+ __const char *__restrict __expbuf) __THROW;
+
+/* Match the beginning of STRING with the compiled regular expression
+ in EXPBUF. If the match is successful `loc2' will contain the
+ position of the first unmatched character. */
+extern int advance (__const char *__restrict __string,
+ __const char *__restrict __expbuf) __THROW;
+
+
+__END_DECLS
+
+#endif /* regexp.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/resolv.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/resolv.h
new file mode 100644
index 0000000..3434f5d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/resolv.h
@@ -0,0 +1,395 @@
+/*
+ * Copyright (c) 1983, 1987, 1989
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+/*
+ * @(#)resolv.h 8.1 (Berkeley) 6/2/93
+ * $BINDId: resolv.h,v 8.31 2000/03/30 20:16:50 vixie Exp $
+ */
+
+#ifndef _RESOLV_H_
+
+/* These headers are needed for types used in the `struct res_state'
+ declaration. */
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#ifndef __need_res_state
+# define _RESOLV_H_
+
+# include <sys/param.h>
+# include <sys/cdefs.h>
+# include <stdio.h>
+# include <arpa/nameser.h>
+#endif
+
+#ifndef __res_state_defined
+# define __res_state_defined
+
+typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
+ res_sendhookact;
+
+typedef res_sendhookact (*res_send_qhook) (struct sockaddr_in * const *ns,
+ const u_char **query,
+ int *querylen,
+ u_char *ans,
+ int anssiz,
+ int *resplen);
+
+typedef res_sendhookact (*res_send_rhook) (const struct sockaddr_in *ns,
+ const u_char *query,
+ int querylen,
+ u_char *ans,
+ int anssiz,
+ int *resplen);
+
+/*
+ * Global defines and variables for resolver stub.
+ */
+# define MAXNS 3 /* max # name servers we'll track */
+# define MAXDFLSRCH 3 /* # default domain levels to try */
+# define MAXDNSRCH 6 /* max # domains in search path */
+# define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */
+
+# define RES_TIMEOUT 5 /* min. seconds between retries */
+# define MAXRESOLVSORT 10 /* number of net to sort on */
+# define RES_MAXNDOTS 15 /* should reflect bit field size */
+# define RES_MAXRETRANS 30 /* only for resolv.conf/RES_OPTIONS */
+# define RES_MAXRETRY 5 /* only for resolv.conf/RES_OPTIONS */
+# define RES_DFLRETRY 2 /* Default #/tries. */
+# define RES_MAXTIME 65535 /* Infinity, in milliseconds. */
+
+struct __res_state {
+ int retrans; /* retransmition time interval */
+ int retry; /* number of times to retransmit */
+ u_long options; /* option flags - see below. */
+ int nscount; /* number of name servers */
+ struct sockaddr_in
+ nsaddr_list[MAXNS]; /* address of name server */
+# define nsaddr nsaddr_list[0] /* for backward compatibility */
+ u_short id; /* current message id */
+ char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */
+ char defdname[256]; /* default domain (deprecated) */
+ u_long pfcode; /* RES_PRF_ flags - see below. */
+ unsigned ndots:4; /* threshold for initial abs. query */
+ unsigned nsort:4; /* number of elements in sort_list[] */
+ char unused[3];
+ struct {
+ struct in_addr addr;
+ u_int32_t mask;
+ } sort_list[MAXRESOLVSORT];
+ res_send_qhook qhook; /* query hook */
+ res_send_rhook rhook; /* response hook */
+ int res_h_errno; /* last one set for this context */
+ int _vcsock; /* PRIVATE: for res_send VC i/o */
+ u_int _flags; /* PRIVATE: see below */
+ union {
+ char pad[52]; /* On an i386 this means 512b total. */
+ struct {
+ u_int16_t nscount;
+#if 0
+ u_int16_t nsmap[MAXNS];
+#else
+ u_int16_t nstimes[MAXNS]; /* ms. */
+#endif
+ int nssocks[MAXNS];
+ u_int16_t nscount6;
+ u_int16_t nsinit;
+ struct sockaddr_in6 *nsaddrs[MAXNS];
+#if 0
+#ifdef _LIBC
+ unsigned long long int initstamp
+ __attribute__((packed));
+#else
+ unsigned int _initstamp[2];
+#endif
+#endif
+ } _ext;
+ } _u;
+};
+
+typedef struct __res_state *res_state;
+# undef __need_res_state
+#endif
+
+#ifdef _RESOLV_H_
+/*
+ * Revision information. This is the release date in YYYYMMDD format.
+ * It can change every day so the right thing to do with it is use it
+ * in preprocessor commands such as "#if (__RES > 19931104)". Do not
+ * compare for equality; rather, use it to determine whether your resolver
+ * is new enough to contain a certain feature.
+ */
+
+#if 0
+#define __RES 19991006
+#else
+#define __RES 19960801
+#endif
+
+/*
+ * Resolver configuration file.
+ * Normally not present, but may contain the address of the
+ * inital name server(s) to query and the domain search list.
+ */
+
+#ifndef _PATH_RESCONF
+#define _PATH_RESCONF "/etc/resolv.conf"
+#endif
+
+struct res_sym {
+ int number; /* Identifying number, like T_MX */
+ char * name; /* Its symbolic name, like "MX" */
+ char * humanname; /* Its fun name, like "mail exchanger" */
+};
+
+/*
+ * Resolver flags (used to be discrete per-module statics ints).
+ */
+#define RES_F_VC 0x00000001 /* socket is TCP */
+#define RES_F_CONN 0x00000002 /* socket is connected */
+
+/* res_findzonecut() options */
+#define RES_EXHAUSTIVE 0x00000001 /* always do all queries */
+
+/*
+ * Resolver options (keep these in synch with res_debug.c, please)
+ */
+#define RES_INIT 0x00000001 /* address initialized */
+#define RES_DEBUG 0x00000002 /* print debug messages */
+#define RES_AAONLY 0x00000004 /* authoritative answers only (!IMPL)*/
+#define RES_USEVC 0x00000008 /* use virtual circuit */
+#define RES_PRIMARY 0x00000010 /* query primary server only (!IMPL) */
+#define RES_IGNTC 0x00000020 /* ignore trucation errors */
+#define RES_RECURSE 0x00000040 /* recursion desired */
+#define RES_DEFNAMES 0x00000080 /* use default domain name */
+#define RES_STAYOPEN 0x00000100 /* Keep TCP socket open */
+#define RES_DNSRCH 0x00000200 /* search up local domain tree */
+#define RES_INSECURE1 0x00000400 /* type 1 security disabled */
+#define RES_INSECURE2 0x00000800 /* type 2 security disabled */
+#define RES_NOALIASES 0x00001000 /* shuts off HOSTALIASES feature */
+#define RES_USE_INET6 0x00002000 /* use/map IPv6 in gethostbyname() */
+#define RES_ROTATE 0x00004000 /* rotate ns list after each query */
+#define RES_NOCHECKNAME 0x00008000 /* do not check names for sanity. */
+#define RES_KEEPTSIG 0x00010000 /* do not strip TSIG records */
+#define RES_BLAST 0x00020000 /* blast all recursive servers */
+#if 0
+#define RES_USEBSTRING 0x00040000 /* IPv6 reverse lookup with byte
+ strings */
+#define RES_NOIP6DOTINT 0x00080000 /* Do not use .ip6.int in IPv6
+ reverse lookup */
+
+#define RES_DEFAULT (RES_RECURSE|RES_DEFNAMES|RES_DNSRCH|RES_NOIP6DOTINT)
+#else
+#define RES_DEFAULT (RES_RECURSE|RES_DEFNAMES|RES_DNSRCH)
+#endif
+
+/*
+ * Resolver "pfcode" values. Used by dig.
+ */
+#define RES_PRF_STATS 0x00000001
+#define RES_PRF_UPDATE 0x00000002
+#define RES_PRF_CLASS 0x00000004
+#define RES_PRF_CMD 0x00000008
+#define RES_PRF_QUES 0x00000010
+#define RES_PRF_ANS 0x00000020
+#define RES_PRF_AUTH 0x00000040
+#define RES_PRF_ADD 0x00000080
+#define RES_PRF_HEAD1 0x00000100
+#define RES_PRF_HEAD2 0x00000200
+#define RES_PRF_TTLID 0x00000400
+#define RES_PRF_HEADX 0x00000800
+#define RES_PRF_QUERY 0x00001000
+#define RES_PRF_REPLY 0x00002000
+#define RES_PRF_INIT 0x00004000
+/* 0x00008000 */
+
+/* Things involving an internal (static) resolver context. */
+#if 0
+__BEGIN_DECLS
+extern struct __res_state *__res_state(void) __attribute__ ((__const__));
+__END_DECLS
+#define _res (*__res_state())
+#else
+extern struct __res_state _res;
+#endif
+
+#define fp_nquery __fp_nquery
+#define fp_query __fp_query
+#define hostalias __hostalias
+#define p_query __p_query
+#define res_close __res_close
+#define res_init __res_init
+#define res_isourserver __res_isourserver
+#define res_mkquery __res_mkquery
+#define res_query __res_query
+#define res_querydomain __res_querydomain
+#define res_search __res_search
+#define res_send __res_send
+
+__BEGIN_DECLS
+void fp_nquery (const u_char *, int, FILE *) __THROW;
+void fp_query (const u_char *, FILE *) __THROW;
+const char * hostalias (const char *) __THROW;
+void p_query (const u_char *) __THROW;
+#ifdef __UCLIBC_HAS_BSD_RES_CLOSE__
+void res_close (void) __THROW;
+#endif
+int res_init (void) __THROW;
+int res_isourserver (const struct sockaddr_in *) __THROW;
+int res_mkquery (int, const char *, int, int, const u_char *,
+ int, const u_char *, u_char *, int) __THROW;
+int res_query (const char *, int, int, u_char *, int) __THROW;
+int res_querydomain (const char *, const char *, int, int,
+ u_char *, int) __THROW;
+int res_search (const char *, int, int, u_char *, int) __THROW;
+int res_send (const u_char *, int, u_char *, int) __THROW;
+__END_DECLS
+
+#define b64_ntop __b64_ntop
+#define b64_pton __b64_pton
+#define dn_comp __dn_comp
+#define dn_count_labels __dn_count_labels
+#define dn_expand __dn_expand
+#define dn_skipname __dn_skipname
+#define fp_resstat __fp_resstat
+#define loc_aton __loc_aton
+#define loc_ntoa __loc_ntoa
+#define p_cdname __p_cdname
+#define p_cdnname __p_cdnname
+#define p_class __p_class
+#define p_fqname __p_fqname
+#define p_fqnname __p_fqnname
+#define p_option __p_option
+#define p_secstodate __p_secstodate
+#define p_section __p_section
+#define p_time __p_time
+#define p_type __p_type
+#define p_rcode __p_rcode
+#define putlong __putlong
+#define putshort __putshort
+#define res_dnok __res_dnok
+#define res_hnok __res_hnok
+#define res_hostalias __res_hostalias
+#define res_mailok __res_mailok
+#define res_nameinquery __res_nameinquery
+#define res_nclose __res_nclose
+#define res_ninit __res_ninit
+#define res_nmkquery __res_nmkquery
+#define res_npquery __res_npquery
+#define res_nquery __res_nquery
+#define res_nquerydomain __res_nquerydomain
+#define res_nsearch __res_nsearch
+#define res_nsend __res_nsend
+#define res_nisourserver __res_nisourserver
+#define res_ownok __res_ownok
+#define res_queriesmatch __res_queriesmatch
+#define res_randomid __res_randomid
+#define sym_ntop __sym_ntop
+#define sym_ntos __sym_ntos
+#define sym_ston __sym_ston
+__BEGIN_DECLS
+int res_hnok (const char *) __THROW;
+int res_ownok (const char *) __THROW;
+int res_mailok (const char *) __THROW;
+int res_dnok (const char *) __THROW;
+int sym_ston (const struct res_sym *, const char *, int *) __THROW;
+const char * sym_ntos (const struct res_sym *, int, int *) __THROW;
+const char * sym_ntop (const struct res_sym *, int, int *) __THROW;
+int b64_ntop (u_char const *, size_t, char *, size_t) __THROW;
+int b64_pton (char const *, u_char *, size_t) __THROW;
+int loc_aton (const char *ascii, u_char *binary) __THROW;
+const char * loc_ntoa (const u_char *binary, char *ascii) __THROW;
+int dn_skipname (const u_char *, const u_char *) __THROW;
+void putlong (u_int32_t, u_char *) __THROW;
+void putshort (u_int16_t, u_char *) __THROW;
+const char * p_class (int) __THROW;
+const char * p_time (u_int32_t) __THROW;
+const char * p_type (int) __THROW;
+const char * p_rcode (int) __THROW;
+const u_char * p_cdnname (const u_char *, const u_char *, int, FILE *)
+ __THROW;
+const u_char * p_cdname (const u_char *, const u_char *, FILE *) __THROW;
+const u_char * p_fqnname (const u_char *cp, const u_char *msg,
+ int, char *, int) __THROW;
+const u_char * p_fqname (const u_char *, const u_char *, FILE *) __THROW;
+const char * p_option (u_long option) __THROW;
+char * p_secstodate (u_long) __THROW;
+int dn_count_labels (const char *) __THROW;
+int dn_comp (const char *, u_char *, int, u_char **, u_char **)
+ __THROW;
+int dn_expand (const u_char *, const u_char *, const u_char *,
+ char *, int) __THROW;
+u_int res_randomid (void) __THROW;
+int res_nameinquery (const char *, int, int,
+ const u_char *, const u_char *) __THROW;
+int res_queriesmatch (const u_char *, const u_char *,
+ const u_char *, const u_char *) __THROW;
+const char * p_section (int section, int opcode) __THROW;
+/* Things involving a resolver context. */
+int res_ninit (res_state) __THROW;
+int res_nisourserver (const res_state,
+ const struct sockaddr_in *) __THROW;
+void fp_resstat (const res_state, FILE *) __THROW;
+void res_npquery (const res_state, const u_char *, int, FILE *)
+ __THROW;
+const char * res_hostalias (const res_state, const char *, char *, size_t)
+ __THROW;
+int res_nquery (res_state, const char *, int, int, u_char *, int)
+ __THROW;
+int res_nsearch (res_state, const char *, int, int, u_char *, int)
+ __THROW;
+int res_nquerydomain (res_state, const char *, const char *, int,
+ int, u_char *, int) __THROW;
+int res_nmkquery (res_state, int, const char *, int, int,
+ const u_char *, int, const u_char *, u_char *,
+ int) __THROW;
+int res_nsend (res_state, const u_char *, int, u_char *, int)
+ __THROW;
+void res_nclose (res_state) __THROW;
+__END_DECLS
+#endif
+
+#endif /* !_RESOLV_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/auth.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/auth.h
new file mode 100644
index 0000000..17eb59f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/auth.h
@@ -0,0 +1,224 @@
+/* @(#)auth.h 2.3 88/08/07 4.0 RPCSRC; from 1.17 88/02/08 SMI */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * auth.h, Authentication interface.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ *
+ * The data structures are completely opaque to the client. The client
+ * is required to pass a AUTH * to routines that create rpc
+ * "sessions".
+ */
+
+#ifndef _RPC_AUTH_H
+
+#define _RPC_AUTH_H 1
+#ifdef _LIBC
+/* Some adjustments to make the libc source from glibc
+ * compile more easily with uClibc... */
+#ifndef __FORCE_GLIBC
+#define __FORCE_GLIBC
+#endif
+#ifndef _GNU_SOUCE
+#define _GNU_SOUCE
+#endif
+#define _(X) X
+#endif
+#include <features.h>
+#include <rpc/xdr.h>
+
+__BEGIN_DECLS
+
+#define MAX_AUTH_BYTES 400
+#define MAXNETNAMELEN 255 /* maximum length of network user's name */
+
+/*
+ * Status returned from authentication check
+ */
+enum auth_stat {
+ AUTH_OK=0,
+ /*
+ * failed at remote end
+ */
+ AUTH_BADCRED=1, /* bogus credentials (seal broken) */
+ AUTH_REJECTEDCRED=2, /* client should begin new session */
+ AUTH_BADVERF=3, /* bogus verifier (seal broken) */
+ AUTH_REJECTEDVERF=4, /* verifier expired or was replayed */
+ AUTH_TOOWEAK=5, /* rejected due to security reasons */
+ /*
+ * failed locally
+ */
+ AUTH_INVALIDRESP=6, /* bogus response verifier */
+ AUTH_FAILED=7 /* some unknown reason */
+};
+
+union des_block {
+ struct {
+ u_int32_t high;
+ u_int32_t low;
+ } key;
+ char c[8];
+};
+typedef union des_block des_block;
+extern bool_t xdr_des_block (XDR *__xdrs, des_block *__blkp) __THROW;
+
+/*
+ * Authentication info. Opaque to client.
+ */
+struct opaque_auth {
+ enum_t oa_flavor; /* flavor of auth */
+ caddr_t oa_base; /* address of more auth stuff */
+ u_int oa_length; /* not to exceed MAX_AUTH_BYTES */
+};
+
+/*
+ * Auth handle, interface to client side authenticators.
+ */
+typedef struct AUTH AUTH;
+struct AUTH {
+ struct opaque_auth ah_cred;
+ struct opaque_auth ah_verf;
+ union des_block ah_key;
+ struct auth_ops {
+ void (*ah_nextverf) (AUTH *);
+ int (*ah_marshal) (AUTH *, XDR *); /* nextverf & serialize */
+ int (*ah_validate) (AUTH *, struct opaque_auth *);
+ /* validate verifier */
+ int (*ah_refresh) (AUTH *); /* refresh credentials */
+ void (*ah_destroy) (AUTH *); /* destroy this structure */
+ } *ah_ops;
+ caddr_t ah_private;
+};
+
+
+/*
+ * Authentication ops.
+ * The ops and the auth handle provide the interface to the authenticators.
+ *
+ * AUTH *auth;
+ * XDR *xdrs;
+ * struct opaque_auth verf;
+ */
+#define AUTH_NEXTVERF(auth) \
+ ((*((auth)->ah_ops->ah_nextverf))(auth))
+#define auth_nextverf(auth) \
+ ((*((auth)->ah_ops->ah_nextverf))(auth))
+
+#define AUTH_MARSHALL(auth, xdrs) \
+ ((*((auth)->ah_ops->ah_marshal))(auth, xdrs))
+#define auth_marshall(auth, xdrs) \
+ ((*((auth)->ah_ops->ah_marshal))(auth, xdrs))
+
+#define AUTH_VALIDATE(auth, verfp) \
+ ((*((auth)->ah_ops->ah_validate))((auth), verfp))
+#define auth_validate(auth, verfp) \
+ ((*((auth)->ah_ops->ah_validate))((auth), verfp))
+
+#define AUTH_REFRESH(auth) \
+ ((*((auth)->ah_ops->ah_refresh))(auth))
+#define auth_refresh(auth) \
+ ((*((auth)->ah_ops->ah_refresh))(auth))
+
+#define AUTH_DESTROY(auth) \
+ ((*((auth)->ah_ops->ah_destroy))(auth))
+#define auth_destroy(auth) \
+ ((*((auth)->ah_ops->ah_destroy))(auth))
+
+
+extern struct opaque_auth _null_auth;
+
+
+/*
+ * These are the various implementations of client side authenticators.
+ */
+
+/*
+ * Unix style authentication
+ * AUTH *authunix_create(machname, uid, gid, len, aup_gids)
+ * char *machname;
+ * int uid;
+ * int gid;
+ * int len;
+ * int *aup_gids;
+ */
+extern AUTH *authunix_create (char *__machname, __uid_t __uid, __gid_t __gid,
+ int __len, __gid_t *__aup_gids);
+extern AUTH *authunix_create_default (void);
+extern AUTH *authnone_create (void) __THROW;
+extern AUTH *authdes_create (const char *__servername, u_int __window,
+ struct sockaddr *__syncaddr, des_block *__ckey)
+ __THROW;
+extern AUTH *authdes_pk_create (const char *, netobj *, u_int,
+ struct sockaddr *, des_block *) __THROW;
+
+
+#define AUTH_NONE 0 /* no authentication */
+#define AUTH_NULL 0 /* backward compatibility */
+#define AUTH_SYS 1 /* unix style (uid, gids) */
+#define AUTH_UNIX AUTH_SYS
+#define AUTH_SHORT 2 /* short hand unix style */
+#define AUTH_DES 3 /* des style (encrypted timestamps) */
+#define AUTH_DH AUTH_DES /* Diffie-Hellman (this is DES) */
+#define AUTH_KERB 4 /* kerberos style */
+
+/*
+ * Netname manipulating functions
+ *
+ */
+extern int getnetname (char *) __THROW;
+extern int host2netname (char *, __const char *, __const char *) __THROW;
+extern int user2netname (char *, __const uid_t, __const char *) __THROW;
+extern int netname2user (__const char *, uid_t *, gid_t *, int *, gid_t *)
+ __THROW;
+extern int netname2host (__const char *, char *, __const int) __THROW;
+
+/*
+ *
+ * These routines interface to the keyserv daemon
+ *
+ */
+extern int key_decryptsession (char *, des_block *);
+extern int key_decryptsession_pk (char *, netobj *, des_block *);
+extern int key_encryptsession (char *, des_block *);
+extern int key_encryptsession_pk (char *, netobj *, des_block *);
+extern int key_gendes (des_block *);
+extern int key_setsecret (char *);
+extern int key_secretkey_is_set (void);
+extern int key_get_conv (char *, des_block *);
+
+/*
+ * XDR an opaque authentication struct.
+ */
+extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *) __THROW;
+
+__END_DECLS
+
+#endif /* rpc/auth.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/auth_des.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/auth_des.h
new file mode 100644
index 0000000..12ada84
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/auth_des.h
@@ -0,0 +1,112 @@
+/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _RPC_AUTH_DES_H
+#define _RPC_AUTH_DES_H 1
+
+#include <sys/cdefs.h>
+#include <rpc/auth.h>
+
+__BEGIN_DECLS
+
+/* There are two kinds of "names": fullnames and nicknames */
+enum authdes_namekind
+ {
+ ADN_FULLNAME,
+ ADN_NICKNAME
+ };
+
+/* A fullname contains the network name of the client,
+ a conversation key and the window */
+struct authdes_fullname
+ {
+ char *name; /* network name of client, up to MAXNETNAMELEN */
+ des_block key; /* conversation key */
+ uint32_t window; /* associated window */
+ };
+
+/* A credential */
+struct authdes_cred
+ {
+ enum authdes_namekind adc_namekind;
+ struct authdes_fullname adc_fullname;
+ uint32_t adc_nickname;
+ };
+
+/* A timeval replacement for !32bit platforms */
+struct rpc_timeval
+ {
+ uint32_t tv_sec; /* Seconds. */
+ uint32_t tv_usec; /* Microseconds. */
+ };
+
+/* A des authentication verifier */
+struct authdes_verf
+ {
+ union
+ {
+ struct rpc_timeval adv_ctime; /* clear time */
+ des_block adv_xtime; /* crypt time */
+ }
+ adv_time_u;
+ uint32_t adv_int_u;
+ };
+
+/* des authentication verifier: client variety
+
+ adv_timestamp is the current time.
+ adv_winverf is the credential window + 1.
+ Both are encrypted using the conversation key. */
+#define adv_timestamp adv_time_u.adv_ctime
+#define adv_xtimestamp adv_time_u.adv_xtime
+#define adv_winverf adv_int_u
+
+/* des authentication verifier: server variety
+
+ adv_timeverf is the client's timestamp + client's window
+ adv_nickname is the server's nickname for the client.
+ adv_timeverf is encrypted using the conversation key. */
+#define adv_timeverf adv_time_u.adv_ctime
+#define adv_xtimeverf adv_time_u.adv_xtime
+#define adv_nickname adv_int_u
+
+/* Map a des credential into a unix cred. */
+extern int authdes_getucred (__const struct authdes_cred * __adc,
+ uid_t * __uid, gid_t * __gid,
+ short *__grouplen, gid_t * __groups) __THROW;
+
+/* Get the public key for NAME and place it in KEY. NAME can only be
+ up to MAXNETNAMELEN bytes long and the destination buffer KEY should
+ have HEXKEYBYTES + 1 bytes long to fit all characters from the key. */
+extern int getpublickey (__const char *__name, char *__key) __THROW;
+
+/* Get the secret key for NAME and place it in KEY. PASSWD is used to
+ decrypt the encrypted key stored in the database. NAME can only be
+ up to MAXNETNAMELEN bytes long and the destination buffer KEY
+ should have HEXKEYBYTES + 1 bytes long to fit all characters from
+ the key. */
+extern int getsecretkey (__const char *__name, char *__key,
+ __const char *__passwd) __THROW;
+
+extern int rtime (struct sockaddr_in *__addrp, struct rpc_timeval *__timep,
+ struct rpc_timeval *__timeout) __THROW;
+
+__END_DECLS
+
+
+#endif /* rpc/auth_des.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/auth_unix.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/auth_unix.h
new file mode 100644
index 0000000..424661d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/auth_unix.h
@@ -0,0 +1,90 @@
+/* @(#)auth_unix.h 2.2 88/07/29 4.0 RPCSRC; from 1.8 88/02/08 SMI */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+/* @(#)auth_unix.h 1.5 86/07/16 SMI */
+
+/*
+ * auth_unix.h, Protocol for UNIX style authentication parameters for RPC
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+/*
+ * The system is very weak. The client uses no encryption for it
+ * credentials and only sends null verifiers. The server sends backs
+ * null verifiers or optionally a verifier that suggests a new short hand
+ * for the credentials.
+ */
+
+#ifndef _RPC_AUTH_UNIX_H
+#define _RPC_AUTH_UNIX_H 1
+
+#include <features.h>
+#include <sys/types.h>
+#include <rpc/types.h>
+#include <rpc/auth.h>
+#include <rpc/xdr.h>
+
+__BEGIN_DECLS
+
+/* The machine name is part of a credential; it may not exceed 255 bytes */
+#define MAX_MACHINE_NAME 255
+
+/* gids compose part of a credential; there may not be more than 16 of them */
+#define NGRPS 16
+
+/*
+ * Unix style credentials.
+ */
+struct authunix_parms
+ {
+ u_long aup_time;
+ char *aup_machname;
+ __uid_t aup_uid;
+ __gid_t aup_gid;
+ u_int aup_len;
+ __gid_t *aup_gids;
+ };
+
+extern bool_t xdr_authunix_parms (XDR *__xdrs, struct authunix_parms *__p)
+ __THROW;
+
+/*
+ * If a response verifier has flavor AUTH_SHORT,
+ * then the body of the response verifier encapsulates the following structure;
+ * again it is serialized in the obvious fashion.
+ */
+struct short_hand_verf
+ {
+ struct opaque_auth new_cred;
+ };
+
+__END_DECLS
+
+#endif /* rpc/auth_unix.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/clnt.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/clnt.h
new file mode 100644
index 0000000..cf271c5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/clnt.h
@@ -0,0 +1,421 @@
+/* @(#)clnt.h 2.1 88/07/29 4.0 RPCSRC; from 1.31 88/02/08 SMI*/
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * clnt.h - Client side remote procedure call interface.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_CLNT_H
+#define _RPC_CLNT_H 1
+
+#include <features.h>
+#include <sys/types.h>
+#include <rpc/types.h>
+#include <rpc/auth.h>
+#include <sys/un.h>
+
+__BEGIN_DECLS
+
+/*
+ * Rpc calls return an enum clnt_stat. This should be looked at more,
+ * since each implementation is required to live with this (implementation
+ * independent) list of errors.
+ */
+enum clnt_stat {
+ RPC_SUCCESS=0, /* call succeeded */
+ /*
+ * local errors
+ */
+ RPC_CANTENCODEARGS=1, /* can't encode arguments */
+ RPC_CANTDECODERES=2, /* can't decode results */
+ RPC_CANTSEND=3, /* failure in sending call */
+ RPC_CANTRECV=4, /* failure in receiving result */
+ RPC_TIMEDOUT=5, /* call timed out */
+ /*
+ * remote errors
+ */
+ RPC_VERSMISMATCH=6, /* rpc versions not compatible */
+ RPC_AUTHERROR=7, /* authentication error */
+ RPC_PROGUNAVAIL=8, /* program not available */
+ RPC_PROGVERSMISMATCH=9, /* program version mismatched */
+ RPC_PROCUNAVAIL=10, /* procedure unavailable */
+ RPC_CANTDECODEARGS=11, /* decode arguments error */
+ RPC_SYSTEMERROR=12, /* generic "other problem" */
+ RPC_NOBROADCAST = 21, /* Broadcasting not supported */
+ /*
+ * callrpc & clnt_create errors
+ */
+ RPC_UNKNOWNHOST=13, /* unknown host name */
+ RPC_UNKNOWNPROTO=17, /* unknown protocol */
+ RPC_UNKNOWNADDR = 19, /* Remote address unknown */
+
+ /*
+ * rpcbind errors
+ */
+ RPC_RPCBFAILURE=14, /* portmapper failed in its call */
+#define RPC_PMAPFAILURE RPC_RPCBFAILURE
+ RPC_PROGNOTREGISTERED=15, /* remote program is not registered */
+ RPC_N2AXLATEFAILURE = 22, /* Name to addr translation failed */
+ /*
+ * unspecified error
+ */
+ RPC_FAILED=16,
+ RPC_INTR=18,
+ RPC_TLIERROR=20,
+ RPC_UDERROR=23,
+ /*
+ * asynchronous errors
+ */
+ RPC_INPROGRESS = 24,
+ RPC_STALERACHANDLE = 25
+};
+
+
+/*
+ * Error info.
+ */
+struct rpc_err {
+ enum clnt_stat re_status;
+ union {
+ int RE_errno; /* related system error */
+ enum auth_stat RE_why; /* why the auth error occurred */
+ struct {
+ u_long low; /* lowest verion supported */
+ u_long high; /* highest verion supported */
+ } RE_vers;
+ struct { /* maybe meaningful if RPC_FAILED */
+ long s1;
+ long s2;
+ } RE_lb; /* life boot & debugging only */
+ } ru;
+#define re_errno ru.RE_errno
+#define re_why ru.RE_why
+#define re_vers ru.RE_vers
+#define re_lb ru.RE_lb
+};
+
+
+/*
+ * Client rpc handle.
+ * Created by individual implementations, see e.g. rpc_udp.c.
+ * Client is responsible for initializing auth, see e.g. auth_none.c.
+ */
+typedef struct CLIENT CLIENT;
+struct CLIENT {
+ AUTH *cl_auth; /* authenticator */
+ struct clnt_ops {
+ enum clnt_stat (*cl_call) (CLIENT *, u_long, xdrproc_t, caddr_t, xdrproc_t,
+ caddr_t, struct timeval);
+ /* call remote procedure */
+ void (*cl_abort) (void); /* abort a call */
+ void (*cl_geterr) (CLIENT *, struct rpc_err *);
+ /* get specific error code */
+ bool_t (*cl_freeres) (CLIENT *, xdrproc_t, caddr_t);
+ /* frees results */
+ void (*cl_destroy) (CLIENT *); /* destroy this structure */
+ bool_t (*cl_control) (CLIENT *, int, char *);
+ /* the ioctl() of rpc */
+ } *cl_ops;
+ caddr_t cl_private; /* private stuff */
+};
+
+
+/*
+ * client side rpc interface ops
+ *
+ * Parameter types are:
+ *
+ */
+
+/*
+ * enum clnt_stat
+ * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout)
+ * CLIENT *rh;
+ * u_long proc;
+ * xdrproc_t xargs;
+ * caddr_t argsp;
+ * xdrproc_t xres;
+ * caddr_t resp;
+ * struct timeval timeout;
+ */
+#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \
+ ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
+#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \
+ ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
+
+/*
+ * void
+ * CLNT_ABORT(rh);
+ * CLIENT *rh;
+ */
+#define CLNT_ABORT(rh) ((*(rh)->cl_ops->cl_abort)(rh))
+#define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh))
+
+/*
+ * struct rpc_err
+ * CLNT_GETERR(rh);
+ * CLIENT *rh;
+ */
+#define CLNT_GETERR(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp))
+#define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp))
+
+
+/*
+ * bool_t
+ * CLNT_FREERES(rh, xres, resp);
+ * CLIENT *rh;
+ * xdrproc_t xres;
+ * caddr_t resp;
+ */
+#define CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
+#define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
+
+/*
+ * bool_t
+ * CLNT_CONTROL(cl, request, info)
+ * CLIENT *cl;
+ * u_int request;
+ * char *info;
+ */
+#define CLNT_CONTROL(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
+#define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
+
+/*
+ * control operations that apply to all transports
+ *
+ * Note: options marked XXX are no-ops in this implementation of RPC.
+ * The are present in TI-RPC but can't be implemented here since they
+ * depend on the presence of STREAMS/TLI, which we don't have.
+ */
+#define CLSET_TIMEOUT 1 /* set timeout (timeval) */
+#define CLGET_TIMEOUT 2 /* get timeout (timeval) */
+#define CLGET_SERVER_ADDR 3 /* get server's address (sockaddr) */
+#define CLGET_FD 6 /* get connections file descriptor */
+#define CLGET_SVC_ADDR 7 /* get server's address (netbuf) XXX */
+#define CLSET_FD_CLOSE 8 /* close fd while clnt_destroy */
+#define CLSET_FD_NCLOSE 9 /* Do not close fd while clnt_destroy*/
+#define CLGET_XID 10 /* Get xid */
+#define CLSET_XID 11 /* Set xid */
+#define CLGET_VERS 12 /* Get version number */
+#define CLSET_VERS 13 /* Set version number */
+#define CLGET_PROG 14 /* Get program number */
+#define CLSET_PROG 15 /* Set program number */
+#define CLSET_SVC_ADDR 16 /* get server's address (netbuf) XXX */
+#define CLSET_PUSH_TIMOD 17 /* push timod if not already present XXX */
+#define CLSET_POP_TIMOD 18 /* pop timod XXX */
+/*
+ * Connectionless only control operations
+ */
+#define CLSET_RETRY_TIMEOUT 4 /* set retry timeout (timeval) */
+#define CLGET_RETRY_TIMEOUT 5 /* get retry timeout (timeval) */
+
+/*
+ * void
+ * CLNT_DESTROY(rh);
+ * CLIENT *rh;
+ */
+#define CLNT_DESTROY(rh) ((*(rh)->cl_ops->cl_destroy)(rh))
+#define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh))
+
+
+/*
+ * RPCTEST is a test program which is accessible on every rpc
+ * transport/port. It is used for testing, performance evaluation,
+ * and network administration.
+ */
+
+#define RPCTEST_PROGRAM ((u_long)1)
+#define RPCTEST_VERSION ((u_long)1)
+#define RPCTEST_NULL_PROC ((u_long)2)
+#define RPCTEST_NULL_BATCH_PROC ((u_long)3)
+
+/*
+ * By convention, procedure 0 takes null arguments and returns them
+ */
+
+#define NULLPROC ((u_long)0)
+
+/*
+ * Below are the client handle creation routines for the various
+ * implementations of client side rpc. They can return NULL if a
+ * creation failure occurs.
+ */
+
+/*
+ * Memory based rpc (for speed check and testing)
+ * CLIENT *
+ * clntraw_create(prog, vers)
+ * u_long prog;
+ * u_long vers;
+ */
+extern CLIENT *clntraw_create (__const u_long __prog, __const u_long __vers)
+ __THROW;
+
+
+/*
+ * Generic client creation routine. Supported protocols are "udp", "tcp" and
+ * "unix"
+ * CLIENT *
+ * clnt_create(host, prog, vers, prot)
+ * char *host; -- hostname
+ * u_long prog; -- program number
+ * u_ong vers; -- version number
+ * char *prot; -- protocol
+ */
+extern CLIENT *clnt_create (__const char *__host, __const u_long __prog,
+ __const u_long __vers, __const char *__prot)
+ __THROW;
+
+
+/*
+ * TCP based rpc
+ * CLIENT *
+ * clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
+ * struct sockaddr_in *raddr;
+ * u_long prog;
+ * u_long version;
+ * register int *sockp;
+ * u_int sendsz;
+ * u_int recvsz;
+ */
+extern CLIENT *clnttcp_create (struct sockaddr_in *__raddr, u_long __prog,
+ u_long __version, int *__sockp, u_int __sendsz,
+ u_int __recvsz) __THROW;
+
+/*
+ * UDP based rpc.
+ * CLIENT *
+ * clntudp_create(raddr, program, version, wait, sockp)
+ * struct sockaddr_in *raddr;
+ * u_long program;
+ * u_long version;
+ * struct timeval wait_resend;
+ * int *sockp;
+ *
+ * Same as above, but you specify max packet sizes.
+ * CLIENT *
+ * clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)
+ * struct sockaddr_in *raddr;
+ * u_long program;
+ * u_long version;
+ * struct timeval wait_resend;
+ * int *sockp;
+ * u_int sendsz;
+ * u_int recvsz;
+ */
+extern CLIENT *clntudp_create (struct sockaddr_in *__raddr, u_long __program,
+ u_long __version, struct timeval __wait_resend,
+ int *__sockp) __THROW;
+extern CLIENT *clntudp_bufcreate (struct sockaddr_in *__raddr,
+ u_long __program, u_long __version,
+ struct timeval __wait_resend, int *__sockp,
+ u_int __sendsz, u_int __recvsz) __THROW;
+
+
+
+
+/*
+ * AF_UNIX based rpc
+ * CLIENT *
+ * clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
+ * struct sockaddr_un *raddr;
+ * u_long prog;
+ * u_long version;
+ * register int *sockp;
+ * u_int sendsz;
+ * u_int recvsz;
+ */
+extern CLIENT *clntunix_create (struct sockaddr_un *__raddr, u_long __program,
+ u_long __version, int *__sockp,
+ u_int __sendsz, u_int __recvsz) __THROW;
+
+
+extern int callrpc (__const char *__host, __const u_long __prognum,
+ __const u_long __versnum, __const u_long __procnum,
+ __const xdrproc_t __inproc, __const char *__in,
+ __const xdrproc_t __outproc, char *__out) __THROW;
+extern int _rpc_dtablesize (void) __THROW;
+
+/*
+ * Print why creation failed
+ */
+extern void clnt_pcreateerror (__const char *__msg); /* stderr */
+extern char *clnt_spcreateerror(__const char *__msg) __THROW; /* string */
+
+/*
+ * Like clnt_perror(), but is more verbose in its output
+ */
+extern void clnt_perrno (enum clnt_stat __num); /* stderr */
+
+/*
+ * Print an English error message, given the client error code
+ */
+extern void clnt_perror (CLIENT *__clnt, __const char *__msg);
+ /* stderr */
+extern char *clnt_sperror (CLIENT *__clnt, __const char *__msg) __THROW;
+ /* string */
+
+/*
+ * If a creation fails, the following allows the user to figure out why.
+ */
+struct rpc_createerr {
+ enum clnt_stat cf_stat;
+ struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
+};
+
+extern struct rpc_createerr rpc_createerr;
+
+
+
+/*
+ * Copy error message to buffer.
+ */
+extern char *clnt_sperrno (enum clnt_stat __num) __THROW; /* string */
+
+/*
+ * get the port number on the host for the rpc program,version and proto
+ */
+extern int getrpcport (__const char * __host, u_long __prognum,
+ u_long __versnum, u_int proto) __THROW;
+
+/*
+ * get the local host's IP address without consulting
+ * name service library functions
+ */
+extern void get_myaddress (struct sockaddr_in *) __THROW;
+
+#define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */
+#define RPCSMALLMSGSIZE 400 /* a more reasonable packet size */
+
+__END_DECLS
+
+#endif /* rpc/clnt.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/des_crypt.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/des_crypt.h
new file mode 100644
index 0000000..6a65887
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/des_crypt.h
@@ -0,0 +1,97 @@
+/*
+ * @(#)des_crypt.h 2.1 88/08/11 4.0 RPCSRC; from 1.4 88/02/08 (C) 1986 SMI
+ *
+ * des_crypt.h, des library routine interface
+ * Copyright (C) 1986, Sun Microsystems, Inc.
+ */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+#ifndef __DES_CRYPT_H__
+#define __DES_CRYPT_H__ 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#define DES_MAXDATA 8192 /* max bytes encrypted in one call */
+#define DES_DIRMASK (1 << 0)
+#define DES_ENCRYPT (0*DES_DIRMASK) /* Encrypt */
+#define DES_DECRYPT (1*DES_DIRMASK) /* Decrypt */
+
+
+#define DES_DEVMASK (1 << 1)
+#define DES_HW (0*DES_DEVMASK) /* Use hardware device */
+#define DES_SW (1*DES_DEVMASK) /* Use software device */
+
+
+#define DESERR_NONE 0 /* succeeded */
+#define DESERR_NOHWDEVICE 1 /* succeeded, but hw device not available */
+#define DESERR_HWERROR 2 /* failed, hardware/driver error */
+#define DESERR_BADPARAM 3 /* failed, bad parameter to call */
+
+#define DES_FAILED(err) \
+ ((err) > DESERR_NOHWDEVICE)
+
+/*
+ * cbc_crypt()
+ * ecb_crypt()
+ *
+ * Encrypt (or decrypt) len bytes of a buffer buf.
+ * The length must be a multiple of eight.
+ * The key should have odd parity in the low bit of each byte.
+ * ivec is the input vector, and is updated to the new one (cbc only).
+ * The mode is created by oring together the appropriate parameters.
+ * DESERR_NOHWDEVICE is returned if DES_HW was specified but
+ * there was no hardware to do it on (the data will still be
+ * encrypted though, in software).
+ */
+
+
+/*
+ * Cipher Block Chaining mode
+ */
+extern int cbc_crypt (char *__key, char *__buf, unsigned __len,
+ unsigned __mode, char *__ivec) __THROW;
+
+/*
+ * Electronic Code Book mode
+ */
+extern int ecb_crypt (char *__key, char *__buf, unsigned __len,
+ unsigned __mode) __THROW;
+
+/*
+ * Set des parity for a key.
+ * DES parity is odd and in the low bit of each byte
+ */
+extern void des_setparity (char *__key) __THROW;
+
+__END_DECLS
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/key_prot.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/key_prot.h
new file mode 100644
index 0000000..3e2eb72
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/key_prot.h
@@ -0,0 +1,346 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#ifndef _KEY_PROT_H_RPCGEN
+#define _KEY_PROT_H_RPCGEN
+
+#include <rpc/rpc.h>
+
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+#if 0
+#pragma ident "@(#)key_prot.x 1.7 94/04/29 SMI"
+#endif
+/* Copyright (c) 1990, 1991 Sun Microsystems, Inc. */
+
+/*
+ * Compiled from key_prot.x using rpcgen.
+ * DO NOT EDIT THIS FILE!
+ * This is NOT source code!
+ */
+#define PROOT 3
+#define HEXMODULUS "d4a0ba0250b6fd2ec626e7efd637df76c716e22d0944b88b"
+#define HEXKEYBYTES 48
+#define KEYSIZE 192
+#define KEYBYTES 24
+#define KEYCHECKSUMSIZE 16
+
+enum keystatus {
+ KEY_SUCCESS = 0,
+ KEY_NOSECRET = 1,
+ KEY_UNKNOWN = 2,
+ KEY_SYSTEMERR = 3,
+};
+typedef enum keystatus keystatus;
+#ifdef __cplusplus
+extern "C" bool_t xdr_keystatus(XDR *, keystatus*);
+#elif __STDC__
+extern bool_t xdr_keystatus(XDR *, keystatus*);
+#else /* Old Style C */
+bool_t xdr_keystatus();
+#endif /* Old Style C */
+
+
+typedef char keybuf[HEXKEYBYTES];
+#ifdef __cplusplus
+extern "C" bool_t xdr_keybuf(XDR *, keybuf);
+#elif __STDC__
+extern bool_t xdr_keybuf(XDR *, keybuf);
+#else /* Old Style C */
+bool_t xdr_keybuf();
+#endif /* Old Style C */
+
+
+typedef char *netnamestr;
+#ifdef __cplusplus
+extern "C" bool_t xdr_netnamestr(XDR *, netnamestr*);
+#elif __STDC__
+extern bool_t xdr_netnamestr(XDR *, netnamestr*);
+#else /* Old Style C */
+bool_t xdr_netnamestr();
+#endif /* Old Style C */
+
+
+struct cryptkeyarg {
+ netnamestr remotename;
+ des_block deskey;
+};
+typedef struct cryptkeyarg cryptkeyarg;
+#ifdef __cplusplus
+extern "C" bool_t xdr_cryptkeyarg(XDR *, cryptkeyarg*);
+#elif __STDC__
+extern bool_t xdr_cryptkeyarg(XDR *, cryptkeyarg*);
+#else /* Old Style C */
+bool_t xdr_cryptkeyarg();
+#endif /* Old Style C */
+
+
+struct cryptkeyarg2 {
+ netnamestr remotename;
+ netobj remotekey;
+ des_block deskey;
+};
+typedef struct cryptkeyarg2 cryptkeyarg2;
+#ifdef __cplusplus
+extern "C" bool_t xdr_cryptkeyarg2(XDR *, cryptkeyarg2*);
+#elif __STDC__
+extern bool_t xdr_cryptkeyarg2(XDR *, cryptkeyarg2*);
+#else /* Old Style C */
+bool_t xdr_cryptkeyarg2();
+#endif /* Old Style C */
+
+
+struct cryptkeyres {
+ keystatus status;
+ union {
+ des_block deskey;
+ } cryptkeyres_u;
+};
+typedef struct cryptkeyres cryptkeyres;
+#ifdef __cplusplus
+extern "C" bool_t xdr_cryptkeyres(XDR *, cryptkeyres*);
+#elif __STDC__
+extern bool_t xdr_cryptkeyres(XDR *, cryptkeyres*);
+#else /* Old Style C */
+bool_t xdr_cryptkeyres();
+#endif /* Old Style C */
+
+#define MAXGIDS 16
+
+struct unixcred {
+ u_int uid;
+ u_int gid;
+ struct {
+ u_int gids_len;
+ u_int *gids_val;
+ } gids;
+};
+typedef struct unixcred unixcred;
+#ifdef __cplusplus
+extern "C" bool_t xdr_unixcred(XDR *, unixcred*);
+#elif __STDC__
+extern bool_t xdr_unixcred(XDR *, unixcred*);
+#else /* Old Style C */
+bool_t xdr_unixcred();
+#endif /* Old Style C */
+
+
+struct getcredres {
+ keystatus status;
+ union {
+ unixcred cred;
+ } getcredres_u;
+};
+typedef struct getcredres getcredres;
+#ifdef __cplusplus
+extern "C" bool_t xdr_getcredres(XDR *, getcredres*);
+#elif __STDC__
+extern bool_t xdr_getcredres(XDR *, getcredres*);
+#else /* Old Style C */
+bool_t xdr_getcredres();
+#endif /* Old Style C */
+
+
+struct key_netstarg {
+ keybuf st_priv_key;
+ keybuf st_pub_key;
+ netnamestr st_netname;
+};
+typedef struct key_netstarg key_netstarg;
+#ifdef __cplusplus
+extern "C" bool_t xdr_key_netstarg(XDR *, key_netstarg*);
+#elif __STDC__
+extern bool_t xdr_key_netstarg(XDR *, key_netstarg*);
+#else /* Old Style C */
+bool_t xdr_key_netstarg();
+#endif /* Old Style C */
+
+
+struct key_netstres {
+ keystatus status;
+ union {
+ key_netstarg knet;
+ } key_netstres_u;
+};
+typedef struct key_netstres key_netstres;
+#ifdef __cplusplus
+extern "C" bool_t xdr_key_netstres(XDR *, key_netstres*);
+#elif __STDC__
+extern bool_t xdr_key_netstres(XDR *, key_netstres*);
+#else /* Old Style C */
+bool_t xdr_key_netstres();
+#endif /* Old Style C */
+
+
+#ifndef opaque
+#define opaque char
+#endif
+
+
+#define KEY_PROG ((u_long)100029)
+#define KEY_VERS ((u_long)1)
+
+#ifdef __cplusplus
+#define KEY_SET ((u_long)1)
+extern "C" keystatus * key_set_1(opaque *, CLIENT *);
+extern "C" keystatus * key_set_1_svc(opaque *, struct svc_req *);
+#define KEY_ENCRYPT ((u_long)2)
+extern "C" cryptkeyres * key_encrypt_1(cryptkeyarg *, CLIENT *);
+extern "C" cryptkeyres * key_encrypt_1_svc(cryptkeyarg *, struct svc_req *);
+#define KEY_DECRYPT ((u_long)3)
+extern "C" cryptkeyres * key_decrypt_1(cryptkeyarg *, CLIENT *);
+extern "C" cryptkeyres * key_decrypt_1_svc(cryptkeyarg *, struct svc_req *);
+#define KEY_GEN ((u_long)4)
+extern "C" des_block * key_gen_1(void *, CLIENT *);
+extern "C" des_block * key_gen_1_svc(void *, struct svc_req *);
+#define KEY_GETCRED ((u_long)5)
+extern "C" getcredres * key_getcred_1(netnamestr *, CLIENT *);
+extern "C" getcredres * key_getcred_1_svc(netnamestr *, struct svc_req *);
+
+#elif __STDC__
+#define KEY_SET ((u_long)1)
+extern keystatus * key_set_1(opaque *, CLIENT *);
+extern keystatus * key_set_1_svc(opaque *, struct svc_req *);
+#define KEY_ENCRYPT ((u_long)2)
+extern cryptkeyres * key_encrypt_1(cryptkeyarg *, CLIENT *);
+extern cryptkeyres * key_encrypt_1_svc(cryptkeyarg *, struct svc_req *);
+#define KEY_DECRYPT ((u_long)3)
+extern cryptkeyres * key_decrypt_1(cryptkeyarg *, CLIENT *);
+extern cryptkeyres * key_decrypt_1_svc(cryptkeyarg *, struct svc_req *);
+#define KEY_GEN ((u_long)4)
+extern des_block * key_gen_1(void *, CLIENT *);
+extern des_block * key_gen_1_svc(void *, struct svc_req *);
+#define KEY_GETCRED ((u_long)5)
+extern getcredres * key_getcred_1(netnamestr *, CLIENT *);
+extern getcredres * key_getcred_1_svc(netnamestr *, struct svc_req *);
+
+#else /* Old Style C */
+#define KEY_SET ((u_long)1)
+extern keystatus * key_set_1();
+extern keystatus * key_set_1_svc();
+#define KEY_ENCRYPT ((u_long)2)
+extern cryptkeyres * key_encrypt_1();
+extern cryptkeyres * key_encrypt_1_svc();
+#define KEY_DECRYPT ((u_long)3)
+extern cryptkeyres * key_decrypt_1();
+extern cryptkeyres * key_decrypt_1_svc();
+#define KEY_GEN ((u_long)4)
+extern des_block * key_gen_1();
+extern des_block * key_gen_1_svc();
+#define KEY_GETCRED ((u_long)5)
+extern getcredres * key_getcred_1();
+extern getcredres * key_getcred_1_svc();
+#endif /* Old Style C */
+#define KEY_VERS2 ((u_long)2)
+
+#ifdef __cplusplus
+extern "C" keystatus * key_set_2(opaque *, CLIENT *);
+extern "C" keystatus * key_set_2_svc(opaque *, struct svc_req *);
+extern "C" cryptkeyres * key_encrypt_2(cryptkeyarg *, CLIENT *);
+extern "C" cryptkeyres * key_encrypt_2_svc(cryptkeyarg *, struct svc_req *);
+extern "C" cryptkeyres * key_decrypt_2(cryptkeyarg *, CLIENT *);
+extern "C" cryptkeyres * key_decrypt_2_svc(cryptkeyarg *, struct svc_req *);
+extern "C" des_block * key_gen_2(void *, CLIENT *);
+extern "C" des_block * key_gen_2_svc(void *, struct svc_req *);
+extern "C" getcredres * key_getcred_2(netnamestr *, CLIENT *);
+extern "C" getcredres * key_getcred_2_svc(netnamestr *, struct svc_req *);
+#define KEY_ENCRYPT_PK ((u_long)6)
+extern "C" cryptkeyres * key_encrypt_pk_2(cryptkeyarg2 *, CLIENT *);
+extern "C" cryptkeyres * key_encrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *);
+#define KEY_DECRYPT_PK ((u_long)7)
+extern "C" cryptkeyres * key_decrypt_pk_2(cryptkeyarg2 *, CLIENT *);
+extern "C" cryptkeyres * key_decrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *);
+#define KEY_NET_PUT ((u_long)8)
+extern "C" keystatus * key_net_put_2(key_netstarg *, CLIENT *);
+extern "C" keystatus * key_net_put_2_svc(key_netstarg *, struct svc_req *);
+#define KEY_NET_GET ((u_long)9)
+extern "C" key_netstres * key_net_get_2(void *, CLIENT *);
+extern "C" key_netstres * key_net_get_2_svc(void *, struct svc_req *);
+#define KEY_GET_CONV ((u_long)10)
+extern "C" cryptkeyres * key_get_conv_2(opaque *, CLIENT *);
+extern "C" cryptkeyres * key_get_conv_2_svc(opaque *, struct svc_req *);
+
+#elif __STDC__
+extern keystatus * key_set_2(opaque *, CLIENT *);
+extern keystatus * key_set_2_svc(opaque *, struct svc_req *);
+extern cryptkeyres * key_encrypt_2(cryptkeyarg *, CLIENT *);
+extern cryptkeyres * key_encrypt_2_svc(cryptkeyarg *, struct svc_req *);
+extern cryptkeyres * key_decrypt_2(cryptkeyarg *, CLIENT *);
+extern cryptkeyres * key_decrypt_2_svc(cryptkeyarg *, struct svc_req *);
+extern des_block * key_gen_2(void *, CLIENT *);
+extern des_block * key_gen_2_svc(void *, struct svc_req *);
+extern getcredres * key_getcred_2(netnamestr *, CLIENT *);
+extern getcredres * key_getcred_2_svc(netnamestr *, struct svc_req *);
+#define KEY_ENCRYPT_PK ((u_long)6)
+extern cryptkeyres * key_encrypt_pk_2(cryptkeyarg2 *, CLIENT *);
+extern cryptkeyres * key_encrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *);
+#define KEY_DECRYPT_PK ((u_long)7)
+extern cryptkeyres * key_decrypt_pk_2(cryptkeyarg2 *, CLIENT *);
+extern cryptkeyres * key_decrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *);
+#define KEY_NET_PUT ((u_long)8)
+extern keystatus * key_net_put_2(key_netstarg *, CLIENT *);
+extern keystatus * key_net_put_2_svc(key_netstarg *, struct svc_req *);
+#define KEY_NET_GET ((u_long)9)
+extern key_netstres * key_net_get_2(void *, CLIENT *);
+extern key_netstres * key_net_get_2_svc(void *, struct svc_req *);
+#define KEY_GET_CONV ((u_long)10)
+extern cryptkeyres * key_get_conv_2(opaque *, CLIENT *);
+extern cryptkeyres * key_get_conv_2_svc(opaque *, struct svc_req *);
+
+#else /* Old Style C */
+extern keystatus * key_set_2();
+extern keystatus * key_set_2_svc();
+extern cryptkeyres * key_encrypt_2();
+extern cryptkeyres * key_encrypt_2_svc();
+extern cryptkeyres * key_decrypt_2();
+extern cryptkeyres * key_decrypt_2_svc();
+extern des_block * key_gen_2();
+extern des_block * key_gen_2_svc();
+extern getcredres * key_getcred_2();
+extern getcredres * key_getcred_2_svc();
+#define KEY_ENCRYPT_PK ((u_long)6)
+extern cryptkeyres * key_encrypt_pk_2();
+extern cryptkeyres * key_encrypt_pk_2_svc();
+#define KEY_DECRYPT_PK ((u_long)7)
+extern cryptkeyres * key_decrypt_pk_2();
+extern cryptkeyres * key_decrypt_pk_2_svc();
+#define KEY_NET_PUT ((u_long)8)
+extern keystatus * key_net_put_2();
+extern keystatus * key_net_put_2_svc();
+#define KEY_NET_GET ((u_long)9)
+extern key_netstres * key_net_get_2();
+extern key_netstres * key_net_get_2_svc();
+#define KEY_GET_CONV ((u_long)10)
+extern cryptkeyres * key_get_conv_2();
+extern cryptkeyres * key_get_conv_2_svc();
+#endif /* Old Style C */
+
+#endif /* !_KEY_PROT_H_RPCGEN */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/netdb.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/netdb.h
new file mode 100644
index 0000000..8671737
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/netdb.h
@@ -0,0 +1,74 @@
+/* @(#)netdb.h 2.1 88/07/29 3.9 RPCSRC */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+/* @(#)rpc.h 1.8 87/07/24 SMI */
+
+/* Cleaned up for GNU C library roland@gnu.ai.mit.edu:
+ added multiple inclusion protection and use of <sys/cdefs.h>.
+ In GNU this file is #include'd by <netdb.h>. */
+
+#ifndef _RPC_NETDB_H
+#define _RPC_NETDB_H 1
+
+#include <features.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+__BEGIN_DECLS
+
+struct rpcent
+{
+ char *r_name; /* Name of server for this rpc program. */
+ char **r_aliases; /* Alias list. */
+ int r_number; /* RPC program number. */
+};
+
+extern void setrpcent (int __stayopen) __THROW;
+extern void endrpcent (void) __THROW;
+extern struct rpcent *getrpcbyname (__const char *__name) __THROW;
+extern struct rpcent *getrpcbynumber (int __number) __THROW;
+extern struct rpcent *getrpcent (void) __THROW;
+
+#if defined __USE_MISC && defined __UCLIBC_HAS_REENTRANT_RPC__
+extern int getrpcbyname_r (__const char *__name, struct rpcent *__result_buf,
+ char *__buffer, size_t __buflen,
+ struct rpcent **__result) __THROW;
+
+extern int getrpcbynumber_r (int __number, struct rpcent *__result_buf,
+ char *__buffer, size_t __buflen,
+ struct rpcent **__result) __THROW;
+
+extern int getrpcent_r (struct rpcent *__result_buf, char *__buffer,
+ size_t __buflen, struct rpcent **__result) __THROW;
+#endif
+
+__END_DECLS
+
+#endif /* rpc/netdb.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/pmap_clnt.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/pmap_clnt.h
new file mode 100644
index 0000000..1b1c452
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/pmap_clnt.h
@@ -0,0 +1,98 @@
+/* @(#)pmap_clnt.h 2.1 88/07/29 4.0 RPCSRC; from 1.11 88/02/08 SMI */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * pmap_clnt.h
+ * Supplies C routines to get to portmap services.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_PMAP_CLNT_H
+#define _RPC_PMAP_CLNT_H 1
+
+#include <features.h>
+#include <rpc/types.h>
+#include <rpc/xdr.h>
+#include <rpc/clnt.h>
+
+__BEGIN_DECLS
+
+typedef bool_t (*resultproc_t) (caddr_t resp, struct sockaddr_in *raddr);
+
+/*
+ * Usage:
+ * success = pmap_set(program, version, protocol, port);
+ * success = pmap_unset(program, version);
+ * port = pmap_getport(address, program, version, protocol);
+ * head = pmap_getmaps(address);
+ * clnt_stat = pmap_rmtcall(address, program, version, procedure,
+ * xdrargs, argsp, xdrres, resp, tout, port_ptr)
+ * (works for udp only.)
+ * clnt_stat = clnt_broadcast(program, version, procedure,
+ * xdrargs, argsp, xdrres, resp, eachresult)
+ * (like pmap_rmtcall, except the call is broadcasted to all
+ * locally connected nets. For each valid response received,
+ * the procedure eachresult is called. Its form is:
+ * done = eachresult(resp, raddr)
+ * bool_t done;
+ * caddr_t resp;
+ * struct sockaddr_in raddr;
+ * where resp points to the results of the call and raddr is the
+ * address if the responder to the broadcast.
+ */
+
+extern bool_t pmap_set (__const u_long __program, __const u_long __vers,
+ int __protocol, u_short __port) __THROW;
+extern bool_t pmap_unset (__const u_long __program, __const u_long __vers)
+ __THROW;
+extern struct pmaplist *pmap_getmaps (struct sockaddr_in *__address) __THROW;
+extern enum clnt_stat pmap_rmtcall (struct sockaddr_in *__addr,
+ __const u_long __prog,
+ __const u_long __vers,
+ __const u_long __proc,
+ xdrproc_t __xdrargs,
+ caddr_t __argsp, xdrproc_t __xdrres,
+ caddr_t __resp, struct timeval __tout,
+ u_long *__port_ptr) __THROW;
+extern enum clnt_stat clnt_broadcast (__const u_long __prog,
+ __const u_long __vers,
+ __const u_long __proc, xdrproc_t __xargs,
+ caddr_t __argsp, xdrproc_t __xresults,
+ caddr_t __resultsp,
+ resultproc_t __eachresult) __THROW;
+extern u_short pmap_getport (struct sockaddr_in *__address,
+ __const u_long __program,
+ __const u_long __version, u_int __protocol)
+ __THROW;
+
+__END_DECLS
+
+#endif /* rpc/pmap_clnt.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/pmap_prot.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/pmap_prot.h
new file mode 100644
index 0000000..cd64e36
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/pmap_prot.h
@@ -0,0 +1,108 @@
+/* @(#)pmap_prot.h 2.1 88/07/29 4.0 RPCSRC; from 1.14 88/02/08 SMI */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * pmap_prot.h
+ * Protocol for the local binder service, or pmap.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_PMAP_PROT_H
+#define _RPC_PMAP_PROT_H 1
+
+#include <features.h>
+
+#include <rpc/xdr.h>
+
+__BEGIN_DECLS
+
+/* The following procedures are supported by the protocol:
+ *
+ * PMAPPROC_NULL() returns ()
+ * takes nothing, returns nothing
+ *
+ * PMAPPROC_SET(struct pmap) returns (bool_t)
+ * TRUE is success, FALSE is failure. Registers the tuple
+ * [prog, vers, prot, port].
+ *
+ * PMAPPROC_UNSET(struct pmap) returns (bool_t)
+ * TRUE is success, FALSE is failure. Un-registers pair
+ * [prog, vers]. prot and port are ignored.
+ *
+ * PMAPPROC_GETPORT(struct pmap) returns (long unsigned).
+ * 0 is failure. Otherwise returns the port number where the pair
+ * [prog, vers] is registered. It may lie!
+ *
+ * PMAPPROC_DUMP() RETURNS (struct pmaplist *)
+ *
+ * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
+ * RETURNS (port, string<>);
+ * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs);
+ * Calls the procedure on the local machine. If it is not registered,
+ * this procedure is quite; ie it does not return error information!!!
+ * This procedure only is supported on rpc/udp and calls via
+ * rpc/udp. This routine only passes null authentication parameters.
+ * This file has no interface to xdr routines for PMAPPROC_CALLIT.
+ *
+ * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
+ */
+
+#define PMAPPORT ((u_short)111)
+#define PMAPPROG ((u_long)100000)
+#define PMAPVERS ((u_long)2)
+#define PMAPVERS_PROTO ((u_long)2)
+#define PMAPVERS_ORIG ((u_long)1)
+#define PMAPPROC_NULL ((u_long)0)
+#define PMAPPROC_SET ((u_long)1)
+#define PMAPPROC_UNSET ((u_long)2)
+#define PMAPPROC_GETPORT ((u_long)3)
+#define PMAPPROC_DUMP ((u_long)4)
+#define PMAPPROC_CALLIT ((u_long)5)
+
+struct pmap {
+ long unsigned pm_prog;
+ long unsigned pm_vers;
+ long unsigned pm_prot;
+ long unsigned pm_port;
+};
+
+extern bool_t xdr_pmap (XDR *__xdrs, struct pmap *__regs) __THROW;
+
+struct pmaplist {
+ struct pmap pml_map;
+ struct pmaplist *pml_next;
+};
+
+extern bool_t xdr_pmaplist (XDR *__xdrs, struct pmaplist **__rp) __THROW;
+
+__END_DECLS
+
+#endif /* rpc/pmap_prot.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/pmap_rmt.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/pmap_rmt.h
new file mode 100644
index 0000000..7a38b5f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/pmap_rmt.h
@@ -0,0 +1,68 @@
+/* @(#)pmap_rmt.h 2.1 88/07/29 4.0 RPCSRC; from 1.2 88/02/08 SMI */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * Structures and XDR routines for parameters to and replies from
+ * the portmapper remote-call-service.
+ *
+ * Copyright (C) 1986, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_PMAP_RMT_H
+#define _RPC_PMAP_RMT_H 1
+
+#include <features.h>
+#include <sys/types.h>
+#include <rpc/types.h>
+#include <rpc/xdr.h>
+
+__BEGIN_DECLS
+
+struct rmtcallargs {
+ u_long prog, vers, proc, arglen;
+ caddr_t args_ptr;
+ xdrproc_t xdr_args;
+};
+
+extern bool_t xdr_rmtcall_args (XDR *__xdrs, struct rmtcallargs *__crp)
+ __THROW;
+
+struct rmtcallres {
+ u_long *port_ptr;
+ u_long resultslen;
+ caddr_t results_ptr;
+ xdrproc_t xdr_results;
+};
+
+extern bool_t xdr_rmtcallres (XDR *__xdrs, struct rmtcallres *__crp) __THROW;
+
+__END_DECLS
+
+#endif /* rpc/pmap_rmt.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/rpc.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/rpc.h
new file mode 100644
index 0000000..9236e72
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/rpc.h
@@ -0,0 +1,110 @@
+/* @(#)rpc.h 2.3 88/08/10 4.0 RPCSRC; from 1.9 88/02/08 SMI */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * rpc.h, Just includes the billions of rpc header files necessary to
+ * do remote procedure calling.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_RPC_H
+#define _RPC_RPC_H 1
+
+#ifdef _LIBC
+/* Some adjustments to make the libc source from glibc
+ * compile more easily with uClibc... */
+#ifndef __FORCE_GLIBC
+#define __FORCE_GLIBC
+#endif
+#ifndef _GNU_SOUCE
+#define _GNU_SOUCE
+#endif
+#define _(X) X
+#include <features.h>
+#endif
+
+#include <rpc/types.h> /* some typedefs */
+#include <netinet/in.h>
+
+/* external data representation interfaces */
+#include <rpc/xdr.h> /* generic (de)serializer */
+
+/* Client side only authentication */
+#include <rpc/auth.h> /* generic authenticator (client side) */
+
+/* Client side (mostly) remote procedure call */
+#include <rpc/clnt.h> /* generic rpc stuff */
+
+/* semi-private protocol headers */
+#include <rpc/rpc_msg.h> /* protocol for rpc messages */
+#include <rpc/auth_unix.h> /* protocol for unix style cred */
+#include <rpc/auth_des.h> /* protocol for des style cred */
+
+/* Server side only remote procedure callee */
+#include <rpc/svc.h> /* service manager and multiplexer */
+#include <rpc/svc_auth.h> /* service side authenticator */
+
+/*
+ * COMMENT OUT THE NEXT INCLUDE IF RUNNING ON SUN OS OR ON A VERSION
+ * OF UNIX BASED ON NFSSRC. These systems will already have the structures
+ * defined by <rpc/netdb.h> included in <netdb.h>.
+ */
+/* routines for parsing /etc/rpc */
+#include <rpc/netdb.h> /* structures and routines to parse /etc/rpc */
+
+__BEGIN_DECLS
+
+/* Global variables, protected for multi-threaded applications. */
+extern fd_set *__rpc_thread_svc_fdset (void) __attribute__ ((__const__));
+#define svc_fdset (*__rpc_thread_svc_fdset ())
+
+extern struct rpc_createerr *__rpc_thread_createerr (void)
+ __attribute__ ((__const__));
+#define get_rpc_createerr() (*__rpc_thread_createerr ())
+/* The people who "engineered" RPC should bee punished for naming the
+ data structure and the variable the same. We cannot always define the
+ macro 'rpc_createerr' because this would prevent people from defining
+ object of type 'struct rpc_createerr'. So we leave it up to the user
+ to select transparent replacement also of this variable. */
+#ifdef _RPC_MT_VARS
+# define rpc_createerr (*__rpc_thread_createerr ())
+#endif
+
+extern struct pollfd **__rpc_thread_svc_pollfd (void)
+ __attribute__ ((__const__));
+#define svc_pollfd (*__rpc_thread_svc_pollfd ())
+
+extern int *__rpc_thread_svc_max_pollfd (void) __attribute__ ((__const__));
+#define svc_max_pollfd (*__rpc_thread_svc_max_pollfd ())
+
+__END_DECLS
+
+#endif /* rpc/rpc.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/rpc_des.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/rpc_des.h
new file mode 100644
index 0000000..0f36d16
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/rpc_des.h
@@ -0,0 +1,72 @@
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+/*
+ * Generic DES driver interface
+ * Keep this file hardware independent!
+ * Copyright (c) 1986 by Sun Microsystems, Inc.
+ */
+
+#ifndef _DES_H
+#define _DES_H
+
+#include <sys/types.h>
+
+#define DES_MAXLEN 65536 /* maximum # of bytes to encrypt */
+#define DES_QUICKLEN 16 /* maximum # of bytes to encrypt quickly */
+
+enum desdir
+ {
+ ENCRYPT, DECRYPT
+ };
+enum desmode
+ {
+ CBC, ECB
+ };
+
+/*
+ * parameters to ioctl call
+ */
+struct desparams
+ {
+ u_char des_key[8]; /* key (with low bit parity) */
+ enum desdir des_dir; /* direction */
+ enum desmode des_mode; /* mode */
+ u_char des_ivec[8]; /* input vector */
+ unsigned des_len; /* number of bytes to crypt */
+ union
+ {
+ u_char UDES_data[DES_QUICKLEN];
+ u_char *UDES_buf;
+ }
+ UDES;
+#define des_data UDES.UDES_data /* direct data here if quick */
+#define des_buf UDES.UDES_buf /* otherwise, pointer to data */
+ };
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/rpc_msg.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/rpc_msg.h
new file mode 100644
index 0000000..636d60e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/rpc_msg.h
@@ -0,0 +1,202 @@
+/* @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+/* @(#)rpc_msg.h 1.7 86/07/16 SMI */
+
+#ifndef _RPC_MSG_H
+#define _RPC_MSG_H 1
+
+#include <sys/cdefs.h>
+
+#include <rpc/xdr.h>
+#include <rpc/clnt.h>
+
+/*
+ * rpc_msg.h
+ * rpc message definition
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#define RPC_MSG_VERSION ((u_long) 2)
+#define RPC_SERVICE_PORT ((u_short) 2048)
+
+__BEGIN_DECLS
+
+/*
+ * Bottom up definition of an rpc message.
+ * NOTE: call and reply use the same overall struct but
+ * different parts of unions within it.
+ */
+
+enum msg_type {
+ CALL=0,
+ REPLY=1
+};
+
+enum reply_stat {
+ MSG_ACCEPTED=0,
+ MSG_DENIED=1
+};
+
+enum accept_stat {
+ SUCCESS=0,
+ PROG_UNAVAIL=1,
+ PROG_MISMATCH=2,
+ PROC_UNAVAIL=3,
+ GARBAGE_ARGS=4,
+ SYSTEM_ERR=5
+};
+
+enum reject_stat {
+ RPC_MISMATCH=0,
+ AUTH_ERROR=1
+};
+
+/*
+ * Reply part of an rpc exchange
+ */
+
+/*
+ * Reply to an rpc request that was accepted by the server.
+ * Note: there could be an error even though the request was
+ * accepted.
+ */
+struct accepted_reply {
+ struct opaque_auth ar_verf;
+ enum accept_stat ar_stat;
+ union {
+ struct {
+ u_long low;
+ u_long high;
+ } AR_versions;
+ struct {
+ caddr_t where;
+ xdrproc_t proc;
+ } AR_results;
+ /* and many other null cases */
+ } ru;
+#define ar_results ru.AR_results
+#define ar_vers ru.AR_versions
+};
+
+/*
+ * Reply to an rpc request that was rejected by the server.
+ */
+struct rejected_reply {
+ enum reject_stat rj_stat;
+ union {
+ struct {
+ u_long low;
+ u_long high;
+ } RJ_versions;
+ enum auth_stat RJ_why; /* why authentication did not work */
+ } ru;
+#define rj_vers ru.RJ_versions
+#define rj_why ru.RJ_why
+};
+
+/*
+ * Body of a reply to an rpc request.
+ */
+struct reply_body {
+ enum reply_stat rp_stat;
+ union {
+ struct accepted_reply RP_ar;
+ struct rejected_reply RP_dr;
+ } ru;
+#define rp_acpt ru.RP_ar
+#define rp_rjct ru.RP_dr
+};
+
+/*
+ * Body of an rpc request call.
+ */
+struct call_body {
+ u_long cb_rpcvers; /* must be equal to two */
+ u_long cb_prog;
+ u_long cb_vers;
+ u_long cb_proc;
+ struct opaque_auth cb_cred;
+ struct opaque_auth cb_verf; /* protocol specific - provided by client */
+};
+
+/*
+ * The rpc message
+ */
+struct rpc_msg {
+ u_long rm_xid;
+ enum msg_type rm_direction;
+ union {
+ struct call_body RM_cmb;
+ struct reply_body RM_rmb;
+ } ru;
+#define rm_call ru.RM_cmb
+#define rm_reply ru.RM_rmb
+};
+#define acpted_rply ru.RM_rmb.ru.RP_ar
+#define rjcted_rply ru.RM_rmb.ru.RP_dr
+
+
+/*
+ * XDR routine to handle a rpc message.
+ * xdr_callmsg(xdrs, cmsg)
+ * XDR *xdrs;
+ * struct rpc_msg *cmsg;
+ */
+extern bool_t xdr_callmsg (XDR *__xdrs, struct rpc_msg *__cmsg) __THROW;
+
+/*
+ * XDR routine to pre-serialize the static part of a rpc message.
+ * xdr_callhdr(xdrs, cmsg)
+ * XDR *xdrs;
+ * struct rpc_msg *cmsg;
+ */
+extern bool_t xdr_callhdr (XDR *__xdrs, struct rpc_msg *__cmsg) __THROW;
+
+/*
+ * XDR routine to handle a rpc reply.
+ * xdr_replymsg(xdrs, rmsg)
+ * XDR *xdrs;
+ * struct rpc_msg *rmsg;
+ */
+extern bool_t xdr_replymsg (XDR *__xdrs, struct rpc_msg *__rmsg) __THROW;
+
+/*
+ * Fills in the error part of a reply message.
+ * _seterr_reply(msg, error)
+ * struct rpc_msg *msg;
+ * struct rpc_err *error;
+ */
+extern void _seterr_reply (struct rpc_msg *__msg, struct rpc_err *__error)
+ __THROW;
+
+__END_DECLS
+
+#endif /* rpc/rpc_msg.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/svc.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/svc.h
new file mode 100644
index 0000000..3ffca50
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/svc.h
@@ -0,0 +1,316 @@
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * svc.h, Server-side remote procedure call interface.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_SVC_H
+#define _RPC_SVC_H 1
+
+#include <features.h>
+#include <rpc/rpc_msg.h>
+
+__BEGIN_DECLS
+
+/*
+ * This interface must manage two items concerning remote procedure calling:
+ *
+ * 1) An arbitrary number of transport connections upon which rpc requests
+ * are received. The two most notable transports are TCP and UDP; they are
+ * created and registered by routines in svc_tcp.c and svc_udp.c, respectively;
+ * they in turn call xprt_register and xprt_unregister.
+ *
+ * 2) An arbitrary number of locally registered services. Services are
+ * described by the following four data: program number, version number,
+ * "service dispatch" function, a transport handle, and a boolean that
+ * indicates whether or not the exported program should be registered with a
+ * local binder service; if true the program's number and version and the
+ * port number from the transport handle are registered with the binder.
+ * These data are registered with the rpc svc system via svc_register.
+ *
+ * A service's dispatch function is called whenever an rpc request comes in
+ * on a transport. The request's program and version numbers must match
+ * those of the registered service. The dispatch function is passed two
+ * parameters, struct svc_req * and SVCXPRT *, defined below.
+ */
+
+enum xprt_stat {
+ XPRT_DIED,
+ XPRT_MOREREQS,
+ XPRT_IDLE
+};
+
+/*
+ * Server side transport handle
+ */
+typedef struct SVCXPRT SVCXPRT;
+struct SVCXPRT {
+ int xp_sock;
+ u_short xp_port; /* associated port number */
+ const struct xp_ops {
+ bool_t (*xp_recv) (SVCXPRT *__xprt, struct rpc_msg *__msg);
+ /* receive incoming requests */
+ enum xprt_stat (*xp_stat) (SVCXPRT *__xprt);
+ /* get transport status */
+ bool_t (*xp_getargs) (SVCXPRT *__xprt, xdrproc_t __xdr_args,
+ caddr_t args_ptr); /* get arguments */
+ bool_t (*xp_reply) (SVCXPRT *__xprt, struct rpc_msg *__msg);
+ /* send reply */
+ bool_t (*xp_freeargs) (SVCXPRT *__xprt, xdrproc_t __xdr_args,
+ caddr_t args_ptr);
+ /* free mem allocated for args */
+ void (*xp_destroy) (SVCXPRT *__xprt);
+ /* destroy this struct */
+ } *xp_ops;
+ int xp_addrlen; /* length of remote address */
+ struct sockaddr_in xp_raddr; /* remote address */
+ struct opaque_auth xp_verf; /* raw response verifier */
+ caddr_t xp_p1; /* private */
+ caddr_t xp_p2; /* private */
+ char xp_pad [256]; /* padding, internal use */
+};
+
+/*
+ * Approved way of getting address of caller
+ */
+#define svc_getcaller(x) (&(x)->xp_raddr)
+
+/*
+ * Operations defined on an SVCXPRT handle
+ *
+ * SVCXPRT *xprt;
+ * struct rpc_msg *msg;
+ * xdrproc_t xargs;
+ * caddr_t argsp;
+ */
+#define SVC_RECV(xprt, msg) \
+ (*(xprt)->xp_ops->xp_recv)((xprt), (msg))
+#define svc_recv(xprt, msg) \
+ (*(xprt)->xp_ops->xp_recv)((xprt), (msg))
+
+#define SVC_STAT(xprt) \
+ (*(xprt)->xp_ops->xp_stat)(xprt)
+#define svc_stat(xprt) \
+ (*(xprt)->xp_ops->xp_stat)(xprt)
+
+#define SVC_GETARGS(xprt, xargs, argsp) \
+ (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
+#define svc_getargs(xprt, xargs, argsp) \
+ (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
+
+#define SVC_REPLY(xprt, msg) \
+ (*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
+#define svc_reply(xprt, msg) \
+ (*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
+
+#define SVC_FREEARGS(xprt, xargs, argsp) \
+ (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
+#define svc_freeargs(xprt, xargs, argsp) \
+ (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
+
+#define SVC_DESTROY(xprt) \
+ (*(xprt)->xp_ops->xp_destroy)(xprt)
+#define svc_destroy(xprt) \
+ (*(xprt)->xp_ops->xp_destroy)(xprt)
+
+
+/*
+ * Service request
+ */
+struct svc_req {
+ rpcprog_t rq_prog; /* service program number */
+ rpcvers_t rq_vers; /* service protocol version */
+ rpcproc_t rq_proc; /* the desired procedure */
+ struct opaque_auth rq_cred; /* raw creds from the wire */
+ caddr_t rq_clntcred; /* read only cooked cred */
+ SVCXPRT *rq_xprt; /* associated transport */
+};
+
+#ifndef __DISPATCH_FN_T
+#define __DISPATCH_FN_T
+typedef void (*__dispatch_fn_t) (struct svc_req*, SVCXPRT*);
+#endif
+
+/*
+ * Service registration
+ *
+ * svc_register(xprt, prog, vers, dispatch, protocol)
+ * SVCXPRT *xprt;
+ * rpcprog_t prog;
+ * rpcvers_t vers;
+ * void (*dispatch)(struct svc_req*, SVCXPRT*);
+ * rpcprot_t protocol; like TCP or UDP, zero means do not register
+ */
+extern bool_t svc_register (SVCXPRT *__xprt, rpcprog_t __prog,
+ rpcvers_t __vers, __dispatch_fn_t __dispatch,
+ rpcprot_t __protocol) __THROW;
+
+/*
+ * Service un-registration
+ *
+ * svc_unregister(prog, vers)
+ * rpcprog_t prog;
+ * rpcvers_t vers;
+ */
+extern void svc_unregister (rpcprog_t __prog, rpcvers_t __vers) __THROW;
+
+/*
+ * Transport registration.
+ *
+ * xprt_register(xprt)
+ * SVCXPRT *xprt;
+ */
+extern void xprt_register (SVCXPRT *__xprt) __THROW;
+
+/*
+ * Transport un-register
+ *
+ * xprt_unregister(xprt)
+ * SVCXPRT *xprt;
+ */
+extern void xprt_unregister (SVCXPRT *__xprt) __THROW;
+
+
+/*
+ * When the service routine is called, it must first check to see if it
+ * knows about the procedure; if not, it should call svcerr_noproc
+ * and return. If so, it should deserialize its arguments via
+ * SVC_GETARGS (defined above). If the deserialization does not work,
+ * svcerr_decode should be called followed by a return. Successful
+ * decoding of the arguments should be followed the execution of the
+ * procedure's code and a call to svc_sendreply.
+ *
+ * Also, if the service refuses to execute the procedure due to too-
+ * weak authentication parameters, svcerr_weakauth should be called.
+ * Note: do not confuse access-control failure with weak authentication!
+ *
+ * NB: In pure implementations of rpc, the caller always waits for a reply
+ * msg. This message is sent when svc_sendreply is called.
+ * Therefore pure service implementations should always call
+ * svc_sendreply even if the function logically returns void; use
+ * xdr.h - xdr_void for the xdr routine. HOWEVER, tcp based rpc allows
+ * for the abuse of pure rpc via batched calling or pipelining. In the
+ * case of a batched call, svc_sendreply should NOT be called since
+ * this would send a return message, which is what batching tries to avoid.
+ * It is the service/protocol writer's responsibility to know which calls are
+ * batched and which are not. Warning: responding to batch calls may
+ * deadlock the caller and server processes!
+ */
+
+extern bool_t svc_sendreply (SVCXPRT *xprt, xdrproc_t __xdr_results,
+ caddr_t __xdr_location) __THROW;
+
+extern void svcerr_decode (SVCXPRT *__xprt) __THROW;
+
+extern void svcerr_weakauth (SVCXPRT *__xprt) __THROW;
+
+extern void svcerr_noproc (SVCXPRT *__xprt) __THROW;
+
+extern void svcerr_progvers (SVCXPRT *__xprt, rpcvers_t __low_vers,
+ rpcvers_t __high_vers) __THROW;
+
+extern void svcerr_auth (SVCXPRT *__xprt, enum auth_stat __why) __THROW;
+
+extern void svcerr_noprog (SVCXPRT *__xprt) __THROW;
+
+extern void svcerr_systemerr (SVCXPRT *__xprt) __THROW;
+
+/*
+ * Lowest level dispatching -OR- who owns this process anyway.
+ * Somebody has to wait for incoming requests and then call the correct
+ * service routine. The routine svc_run does infinite waiting; i.e.,
+ * svc_run never returns.
+ * Since another (coexistent) package may wish to selectively wait for
+ * incoming calls or other events outside of the rpc architecture, the
+ * routine svc_getreq is provided. It must be passed readfds, the
+ * "in-place" results of a select system call (see select, section 2).
+ */
+
+/*
+ * Global keeper of rpc service descriptors in use
+ * dynamic; must be inspected before each call to select
+ */
+
+extern struct pollfd *svc_pollfd;
+extern int svc_max_pollfd;
+extern fd_set svc_fdset;
+#define svc_fds svc_fdset.fds_bits[0] /* compatibility */
+
+/*
+ * a small program implemented by the svc_rpc implementation itself;
+ * also see clnt.h for protocol numbers.
+ */
+extern void svc_getreq (int __rdfds) __THROW;
+extern void svc_getreq_common (const int __fd) __THROW;
+extern void svc_getreqset (fd_set *__readfds) __THROW;
+extern void svc_getreq_poll (struct pollfd *, const int) __THROW;
+extern void svc_exit (void) __THROW;
+extern void svc_run (void) __THROW;
+
+/*
+ * Socket to use on svcxxx_create call to get default socket
+ */
+#define RPC_ANYSOCK -1
+
+/*
+ * These are the existing service side transport implementations
+ */
+
+/*
+ * Memory based rpc for testing and timing.
+ */
+extern SVCXPRT *svcraw_create (void) __THROW;
+
+/*
+ * Udp based rpc.
+ */
+extern SVCXPRT *svcudp_create (int __sock) __THROW;
+extern SVCXPRT *svcudp_bufcreate (int __sock, u_int __sendsz, u_int __recvsz)
+ __THROW;
+
+/*
+ * Tcp based rpc.
+ */
+extern SVCXPRT *svctcp_create (int __sock, u_int __sendsize, u_int __recvsize)
+ __THROW;
+
+
+/*
+ * Unix based rpc.
+ */
+extern SVCXPRT *svcunix_create (int __sock, u_int __sendsize, u_int __recvsize,
+ char *__path) __THROW;
+
+
+__END_DECLS
+
+#endif /* rpc/svc.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/svc_auth.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/svc_auth.h
new file mode 100644
index 0000000..1c1a715
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/svc_auth.h
@@ -0,0 +1,54 @@
+/* @(#)svc_auth.h 2.1 88/07/29 4.0 RPCSRC */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+/* @(#)svc_auth.h 1.6 86/07/16 SMI */
+
+/*
+ * svc_auth.h, Service side of rpc authentication.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_SVC_AUTH_H
+#define _RPC_SVC_AUTH_H 1
+
+#include <features.h>
+#include <rpc/svc.h>
+
+__BEGIN_DECLS
+
+/*
+ * Server side authenticator
+ */
+extern enum auth_stat _authenticate (struct svc_req *__rqst,
+ struct rpc_msg *__msg) __THROW;
+
+__END_DECLS
+
+#endif /* rpc/svc_auth.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/types.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/types.h
new file mode 100644
index 0000000..469576e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/types.h
@@ -0,0 +1,108 @@
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+/* fixincludes should not add extern "C" to this file */
+/*
+ * Rpc additions to <sys/types.h>
+ */
+#ifndef _RPC_TYPES_H
+#define _RPC_TYPES_H 1
+
+#ifdef _LIBC
+/* Some adjustments to make the libc source from glibc
+ * compile more easily with uClibc... */
+#ifndef __FORCE_GLIBC
+#define __FORCE_GLIBC
+#endif
+#ifndef _GNU_SOUCE
+#define _GNU_SOUCE
+#endif
+#define _(X) X
+#endif
+#include <features.h>
+
+typedef int bool_t;
+typedef int enum_t;
+/* This needs to be changed to uint32_t in the future */
+typedef unsigned long rpcprog_t;
+typedef unsigned long rpcvers_t;
+typedef unsigned long rpcproc_t;
+typedef unsigned long rpcprot_t;
+typedef unsigned long rpcport_t;
+
+#define __dontcare__ -1
+
+#ifndef FALSE
+# define FALSE (0)
+#endif
+
+#ifndef TRUE
+# define TRUE (1)
+#endif
+
+#ifndef NULL
+# define NULL 0
+#endif
+
+#include <stdlib.h> /* For malloc decl. */
+#define mem_alloc(bsize) malloc(bsize)
+#define mem_free(ptr, bsize) free(ptr)
+
+#ifndef makedev /* ie, we haven't already included it */
+#include <sys/types.h>
+#endif
+
+#ifndef __u_char_defined
+typedef __u_char u_char;
+typedef __u_short u_short;
+typedef __u_int u_int;
+typedef __u_long u_long;
+typedef __quad_t quad_t;
+typedef __u_quad_t u_quad_t;
+typedef __fsid_t fsid_t;
+# define __u_char_defined
+#endif
+#ifndef __daddr_t_defined
+typedef __daddr_t daddr_t;
+typedef __caddr_t caddr_t;
+# define __daddr_t_defined
+#endif
+
+#include <sys/time.h>
+#include <sys/param.h>
+
+#include <netinet/in.h>
+
+#ifndef INADDR_LOOPBACK
+#define INADDR_LOOPBACK (u_long)0x7F000001
+#endif
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 64
+#endif
+
+#endif /* rpc/types.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/xdr.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/xdr.h
new file mode 100644
index 0000000..25dd214
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/rpc/xdr.h
@@ -0,0 +1,385 @@
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+/*
+ * xdr.h, External Data Representation Serialization Routines.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_XDR_H
+#define _RPC_XDR_H 1
+
+#ifdef _LIBC
+/* Some adjustments to make the libc source from glibc
+ * compile more easily with uClibc... */
+# ifndef __FORCE_GLIBC
+# define __FORCE_GLIBC
+# endif
+# define _(X) X
+#endif
+#include <features.h>
+#include <sys/types.h>
+#include <rpc/types.h>
+
+/* We need FILE. */
+#include <stdio.h>
+
+__BEGIN_DECLS
+
+/*
+ * XDR provides a conventional way for converting between C data
+ * types and an external bit-string representation. Library supplied
+ * routines provide for the conversion on built-in C data types. These
+ * routines and utility routines defined here are used to help implement
+ * a type encode/decode routine for each user-defined type.
+ *
+ * Each data type provides a single procedure which takes two arguments:
+ *
+ * bool_t
+ * xdrproc(xdrs, argresp)
+ * XDR *xdrs;
+ * <type> *argresp;
+ *
+ * xdrs is an instance of a XDR handle, to which or from which the data
+ * type is to be converted. argresp is a pointer to the structure to be
+ * converted. The XDR handle contains an operation field which indicates
+ * which of the operations (ENCODE, DECODE * or FREE) is to be performed.
+ *
+ * XDR_DECODE may allocate space if the pointer argresp is null. This
+ * data can be freed with the XDR_FREE operation.
+ *
+ * We write only one procedure per data type to make it easy
+ * to keep the encode and decode procedures for a data type consistent.
+ * In many cases the same code performs all operations on a user defined type,
+ * because all the hard work is done in the component type routines.
+ * decode as a series of calls on the nested data types.
+ */
+
+/*
+ * Xdr operations. XDR_ENCODE causes the type to be encoded into the
+ * stream. XDR_DECODE causes the type to be extracted from the stream.
+ * XDR_FREE can be used to release the space allocated by an XDR_DECODE
+ * request.
+ */
+enum xdr_op {
+ XDR_ENCODE = 0,
+ XDR_DECODE = 1,
+ XDR_FREE = 2
+};
+
+/*
+ * This is the number of bytes per unit of external data.
+ */
+#define BYTES_PER_XDR_UNIT (4)
+/*
+ * This only works if the above is a power of 2. But it's defined to be
+ * 4 by the appropriate RFCs. So it will work. And it's normally quicker
+ * than the old routine.
+ */
+#if 1
+#define RNDUP(x) (((x) + BYTES_PER_XDR_UNIT - 1) & ~(BYTES_PER_XDR_UNIT - 1))
+#else /* this is the old routine */
+#define RNDUP(x) ((((x) + BYTES_PER_XDR_UNIT - 1) / BYTES_PER_XDR_UNIT) \
+ * BYTES_PER_XDR_UNIT)
+#endif
+
+/*
+ * The XDR handle.
+ * Contains operation which is being applied to the stream,
+ * an operations vector for the particular implementation (e.g. see xdr_mem.c),
+ * and two private fields for the use of the particular implementation.
+ */
+typedef struct XDR XDR;
+struct XDR
+ {
+ enum xdr_op x_op; /* operation; fast additional param */
+ struct xdr_ops
+ {
+ bool_t (*x_getlong) (XDR *__xdrs, long *__lp);
+ /* get a long from underlying stream */
+ bool_t (*x_putlong) (XDR *__xdrs, __const long *__lp);
+ /* put a long to " */
+ bool_t (*x_getbytes) (XDR *__xdrs, caddr_t __addr, u_int __len);
+ /* get some bytes from " */
+ bool_t (*x_putbytes) (XDR *__xdrs, __const char *__addr, u_int __len);
+ /* put some bytes to " */
+ u_int (*x_getpostn) (__const XDR *__xdrs);
+ /* returns bytes off from beginning */
+ bool_t (*x_setpostn) (XDR *__xdrs, u_int __pos);
+ /* lets you reposition the stream */
+ int32_t *(*x_inline) (XDR *__xdrs, u_int __len);
+ /* buf quick ptr to buffered data */
+ void (*x_destroy) (XDR *__xdrs);
+ /* free privates of this xdr_stream */
+ bool_t (*x_getint32) (XDR *__xdrs, int32_t *__ip);
+ /* get a int from underlying stream */
+ bool_t (*x_putint32) (XDR *__xdrs, __const int32_t *__ip);
+ /* put a int to " */
+ }
+ *x_ops;
+ caddr_t x_public; /* users' data */
+ caddr_t x_private; /* pointer to private data */
+ caddr_t x_base; /* private used for position info */
+ u_int x_handy; /* extra private word */
+ };
+
+/*
+ * A xdrproc_t exists for each data type which is to be encoded or decoded.
+ *
+ * The second argument to the xdrproc_t is a pointer to an opaque pointer.
+ * The opaque pointer generally points to a structure of the data type
+ * to be decoded. If this pointer is 0, then the type routines should
+ * allocate dynamic storage of the appropriate size and return it.
+ * bool_t (*xdrproc_t)(XDR *, caddr_t *);
+ */
+typedef bool_t (*xdrproc_t) (XDR *, void *,...);
+
+
+/*
+ * Operations defined on a XDR handle
+ *
+ * XDR *xdrs;
+ * int32_t *int32p;
+ * long *longp;
+ * caddr_t addr;
+ * u_int len;
+ * u_int pos;
+ */
+#define XDR_GETINT32(xdrs, int32p) \
+ (*(xdrs)->x_ops->x_getint32)(xdrs, int32p)
+#define xdr_getint32(xdrs, int32p) \
+ (*(xdrs)->x_ops->x_getint32)(xdrs, int32p)
+
+#define XDR_PUTINT32(xdrs, int32p) \
+ (*(xdrs)->x_ops->x_putint32)(xdrs, int32p)
+#define xdr_putint32(xdrs, int32p) \
+ (*(xdrs)->x_ops->x_putint32)(xdrs, int32p)
+
+#define XDR_GETLONG(xdrs, longp) \
+ (*(xdrs)->x_ops->x_getlong)(xdrs, longp)
+#define xdr_getlong(xdrs, longp) \
+ (*(xdrs)->x_ops->x_getlong)(xdrs, longp)
+
+#define XDR_PUTLONG(xdrs, longp) \
+ (*(xdrs)->x_ops->x_putlong)(xdrs, longp)
+#define xdr_putlong(xdrs, longp) \
+ (*(xdrs)->x_ops->x_putlong)(xdrs, longp)
+
+#define XDR_GETBYTES(xdrs, addr, len) \
+ (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
+#define xdr_getbytes(xdrs, addr, len) \
+ (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
+
+#define XDR_PUTBYTES(xdrs, addr, len) \
+ (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
+#define xdr_putbytes(xdrs, addr, len) \
+ (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
+
+#define XDR_GETPOS(xdrs) \
+ (*(xdrs)->x_ops->x_getpostn)(xdrs)
+#define xdr_getpos(xdrs) \
+ (*(xdrs)->x_ops->x_getpostn)(xdrs)
+
+#define XDR_SETPOS(xdrs, pos) \
+ (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
+#define xdr_setpos(xdrs, pos) \
+ (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
+
+#define XDR_INLINE(xdrs, len) \
+ (*(xdrs)->x_ops->x_inline)(xdrs, len)
+#define xdr_inline(xdrs, len) \
+ (*(xdrs)->x_ops->x_inline)(xdrs, len)
+
+#define XDR_DESTROY(xdrs) \
+ do { \
+ if ((xdrs)->x_ops->x_destroy) \
+ (*(xdrs)->x_ops->x_destroy)(xdrs); \
+ } while (0)
+#define xdr_destroy(xdrs) \
+ do { \
+ if ((xdrs)->x_ops->x_destroy) \
+ (*(xdrs)->x_ops->x_destroy)(xdrs); \
+ } while (0)
+
+/*
+ * Support struct for discriminated unions.
+ * You create an array of xdrdiscrim structures, terminated with
+ * a entry with a null procedure pointer. The xdr_union routine gets
+ * the discriminant value and then searches the array of structures
+ * for a matching value. If a match is found the associated xdr routine
+ * is called to handle that part of the union. If there is
+ * no match, then a default routine may be called.
+ * If there is no match and no default routine it is an error.
+ */
+#define NULL_xdrproc_t ((xdrproc_t)0)
+struct xdr_discrim
+{
+ int value;
+ xdrproc_t proc;
+};
+
+/*
+ * Inline routines for fast encode/decode of primitive data types.
+ * Caveat emptor: these use single memory cycles to get the
+ * data from the underlying buffer, and will fail to operate
+ * properly if the data is not aligned. The standard way to use these
+ * is to say:
+ * if ((buf = XDR_INLINE(xdrs, count)) == NULL)
+ * return (FALSE);
+ * <<< macro calls >>>
+ * where ``count'' is the number of bytes of data occupied
+ * by the primitive data types.
+ *
+ * N.B. and frozen for all time: each data type here uses 4 bytes
+ * of external representation.
+ */
+
+#define IXDR_GET_INT32(buf) ((int32_t)ntohl((uint32_t)*(buf)++))
+#define IXDR_PUT_INT32(buf, v) (*(buf)++ = (int32_t)htonl((uint32_t)(v)))
+#define IXDR_GET_U_INT32(buf) ((uint32_t)IXDR_GET_INT32(buf))
+#define IXDR_PUT_U_INT32(buf, v) IXDR_PUT_INT32(buf, (int32_t)(v))
+
+/* WARNING: The IXDR_*_LONG defines are removed by Sun for new platforms
+ * and shouldn't be used any longer. Code which use this defines or longs
+ * in the RPC code will not work on 64bit Solaris platforms !
+ */
+#define IXDR_GET_LONG(buf) ((long)IXDR_GET_U_INT32(buf))
+#define IXDR_PUT_LONG(buf, v) ((long)IXDR_PUT_INT32(buf, (long)(v)))
+#define IXDR_GET_U_LONG(buf) ((u_long)IXDR_GET_LONG(buf))
+#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG(buf, (long)(v))
+
+
+#define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf))
+#define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_LONG(buf))
+#define IXDR_GET_SHORT(buf) ((short)IXDR_GET_LONG(buf))
+#define IXDR_GET_U_SHORT(buf) ((u_short)IXDR_GET_LONG(buf))
+
+#define IXDR_PUT_BOOL(buf, v) IXDR_PUT_LONG(buf, (long)(v))
+#define IXDR_PUT_ENUM(buf, v) IXDR_PUT_LONG(buf, (long)(v))
+#define IXDR_PUT_SHORT(buf, v) IXDR_PUT_LONG(buf, (long)(v))
+#define IXDR_PUT_U_SHORT(buf, v) IXDR_PUT_LONG(buf, (long)(v))
+
+/*
+ * These are the "generic" xdr routines.
+ * None of these can have const applied because it's not possible to
+ * know whether the call is a read or a write to the passed parameter
+ * also, the XDR structure is always updated by some of these calls.
+ */
+extern bool_t xdr_void (void) __THROW;
+extern bool_t xdr_short (XDR *__xdrs, short *__sp) __THROW;
+extern bool_t xdr_u_short (XDR *__xdrs, u_short *__usp) __THROW;
+extern bool_t xdr_int (XDR *__xdrs, int *__ip) __THROW;
+extern bool_t xdr_u_int (XDR *__xdrs, u_int *__up) __THROW;
+extern bool_t xdr_long (XDR *__xdrs, long *__lp) __THROW;
+extern bool_t xdr_u_long (XDR *__xdrs, u_long *__ulp) __THROW;
+extern bool_t xdr_hyper (XDR *__xdrs, quad_t *__llp) __THROW;
+extern bool_t xdr_u_hyper (XDR *__xdrs, u_quad_t *__ullp) __THROW;
+extern bool_t xdr_longlong_t (XDR *__xdrs, quad_t *__llp) __THROW;
+extern bool_t xdr_u_longlong_t (XDR *__xdrs, u_quad_t *__ullp) __THROW;
+extern bool_t xdr_int8_t (XDR *__xdrs, int8_t *__ip) __THROW;
+extern bool_t xdr_uint8_t (XDR *__xdrs, uint8_t *__up) __THROW;
+extern bool_t xdr_int16_t (XDR *__xdrs, int16_t *__ip) __THROW;
+extern bool_t xdr_uint16_t (XDR *__xdrs, uint16_t *__up) __THROW;
+extern bool_t xdr_int32_t (XDR *__xdrs, int32_t *__ip) __THROW;
+extern bool_t xdr_uint32_t (XDR *__xdrs, uint32_t *__up) __THROW;
+extern bool_t xdr_int64_t (XDR *__xdrs, int64_t *__ip) __THROW;
+extern bool_t xdr_uint64_t (XDR *__xdrs, uint64_t *__up) __THROW;
+extern bool_t xdr_bool (XDR *__xdrs, bool_t *__bp) __THROW;
+extern bool_t xdr_enum (XDR *__xdrs, enum_t *__ep) __THROW;
+extern bool_t xdr_array (XDR * _xdrs, caddr_t *__addrp, u_int *__sizep,
+ u_int __maxsize, u_int __elsize, xdrproc_t __elproc)
+ __THROW;
+extern bool_t xdr_bytes (XDR *__xdrs, char **__cpp, u_int *__sizep,
+ u_int __maxsize) __THROW;
+extern bool_t xdr_opaque (XDR *__xdrs, caddr_t __cp, u_int __cnt) __THROW;
+extern bool_t xdr_string (XDR *__xdrs, char **__cpp, u_int __maxsize) __THROW;
+extern bool_t xdr_union (XDR *__xdrs, enum_t *__dscmp, char *__unp,
+ __const struct xdr_discrim *__choices,
+ xdrproc_t dfault) __THROW;
+extern bool_t xdr_char (XDR *__xdrs, char *__cp) __THROW;
+extern bool_t xdr_u_char (XDR *__xdrs, u_char *__cp) __THROW;
+extern bool_t xdr_vector (XDR *__xdrs, char *__basep, u_int __nelem,
+ u_int __elemsize, xdrproc_t __xdr_elem) __THROW;
+extern bool_t xdr_float (XDR *__xdrs, float *__fp) __THROW;
+extern bool_t xdr_double (XDR *__xdrs, double *__dp) __THROW;
+extern bool_t xdr_reference (XDR *__xdrs, caddr_t *__xpp, u_int __size,
+ xdrproc_t __proc) __THROW;
+extern bool_t xdr_pointer (XDR *__xdrs, char **__objpp,
+ u_int __obj_size, xdrproc_t __xdr_obj) __THROW;
+extern bool_t xdr_wrapstring (XDR *__xdrs, char **__cpp) __THROW;
+extern u_long xdr_sizeof (xdrproc_t, void *) __THROW;
+
+/*
+ * Common opaque bytes objects used by many rpc protocols;
+ * declared here due to commonality.
+ */
+#define MAX_NETOBJ_SZ 1024
+struct netobj
+{
+ u_int n_len;
+ char *n_bytes;
+};
+typedef struct netobj netobj;
+extern bool_t xdr_netobj (XDR *__xdrs, struct netobj *__np) __THROW;
+
+/*
+ * These are the public routines for the various implementations of
+ * xdr streams.
+ */
+
+/* XDR using memory buffers */
+extern void xdrmem_create (XDR *__xdrs, __const caddr_t __addr,
+ u_int __size, enum xdr_op __xop) __THROW;
+
+/* XDR using stdio library */
+extern void xdrstdio_create (XDR *__xdrs, FILE *__file, enum xdr_op __xop)
+ __THROW;
+
+/* XDR pseudo records for tcp */
+extern void xdrrec_create (XDR *__xdrs, u_int __sendsize,
+ u_int __recvsize, caddr_t __tcp_handle,
+ int (*__readit) (char *, char *, int),
+ int (*__writeit) (char *, char *, int)) __THROW;
+
+/* make end of xdr record */
+extern bool_t xdrrec_endofrecord (XDR *__xdrs, bool_t __sendnow) __THROW;
+
+/* move to beginning of next record */
+extern bool_t xdrrec_skiprecord (XDR *__xdrs) __THROW;
+
+/* true if no more input */
+extern bool_t xdrrec_eof (XDR *__xdrs) __THROW;
+
+/* free memory buffers for xdr */
+extern void xdr_free (xdrproc_t __proc, char *__objp) __THROW;
+
+__END_DECLS
+
+#endif /* rpc/xdr.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sched.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sched.h
new file mode 100644
index 0000000..7cfdbf1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sched.h
@@ -0,0 +1,86 @@
+/* Definitions for POSIX 1003.1b-1993 (aka POSIX.4) scheduling interface.
+ Copyright (C) 1996,1997,1999,2001-2003,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SCHED_H
+#define _SCHED_H 1
+
+#include <features.h>
+
+/* Get type definitions. */
+#include <bits/types.h>
+
+#define __need_timespec
+#include <time.h>
+
+/* Get system specific constant and data structure definitions. */
+#include <bits/sched.h>
+/* Define the real names for the elements of `struct sched_param'. */
+#define sched_priority __sched_priority
+
+
+__BEGIN_DECLS
+
+/* Set scheduling parameters for a process. */
+extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param)
+ __THROW;
+
+/* Retrieve scheduling parameters for a particular process. */
+extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __THROW;
+
+/* Set scheduling algorithm and/or parameters for a process. */
+extern int sched_setscheduler (__pid_t __pid, int __policy,
+ __const struct sched_param *__param) __THROW;
+
+/* Retrieve scheduling algorithm for a particular purpose. */
+extern int sched_getscheduler (__pid_t __pid) __THROW;
+
+/* Yield the processor. */
+extern int sched_yield (void) __THROW;
+
+/* Get maximum priority value for a scheduler. */
+extern int sched_get_priority_max (int __algorithm) __THROW;
+
+/* Get minimum priority value for a scheduler. */
+extern int sched_get_priority_min (int __algorithm) __THROW;
+
+/* Get the SCHED_RR interval for the named process. */
+extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW;
+
+
+#ifdef __USE_GNU
+/* Access macros for `cpu_set'. */
+#define CPU_SETSIZE __CPU_SETSIZE
+#define CPU_SET(cpu, cpusetp) __CPU_SET (cpu, cpusetp)
+#define CPU_CLR(cpu, cpusetp) __CPU_CLR (cpu, cpusetp)
+#define CPU_ISSET(cpu, cpusetp) __CPU_ISSET (cpu, cpusetp)
+#define CPU_ZERO(cpusetp) __CPU_ZERO (cpusetp)
+
+
+/* Set the CPU affinity for a task */
+extern int sched_setaffinity (__pid_t __pid, size_t __cpusetsize,
+ __const cpu_set_t *__cpuset) __THROW;
+
+/* Get the CPU affinity for a task */
+extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize,
+ cpu_set_t *__cpuset) __THROW;
+#endif
+
+__END_DECLS
+
+#endif /* sched.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/scsi/scsi.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/scsi/scsi.h
new file mode 100644
index 0000000..49ab758
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/scsi/scsi.h
@@ -0,0 +1,226 @@
+/* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * This header file contains public constants and structures used by
+ * the scsi code for linux.
+ */
+
+#ifndef _SCSI_SCSI_H
+#define _SCSI_SCSI_H 1
+
+#include <features.h>
+
+/*
+ * SCSI opcodes
+ */
+
+#define TEST_UNIT_READY 0x00
+#define REZERO_UNIT 0x01
+#define REQUEST_SENSE 0x03
+#define FORMAT_UNIT 0x04
+#define READ_BLOCK_LIMITS 0x05
+#define REASSIGN_BLOCKS 0x07
+#define READ_6 0x08
+#define WRITE_6 0x0a
+#define SEEK_6 0x0b
+#define READ_REVERSE 0x0f
+#define WRITE_FILEMARKS 0x10
+#define SPACE 0x11
+#define INQUIRY 0x12
+#define RECOVER_BUFFERED_DATA 0x14
+#define MODE_SELECT 0x15
+#define RESERVE 0x16
+#define RELEASE 0x17
+#define COPY 0x18
+#define ERASE 0x19
+#define MODE_SENSE 0x1a
+#define START_STOP 0x1b
+#define RECEIVE_DIAGNOSTIC 0x1c
+#define SEND_DIAGNOSTIC 0x1d
+#define ALLOW_MEDIUM_REMOVAL 0x1e
+
+#define SET_WINDOW 0x24
+#define READ_CAPACITY 0x25
+#define READ_10 0x28
+#define WRITE_10 0x2a
+#define SEEK_10 0x2b
+#define WRITE_VERIFY 0x2e
+#define VERIFY 0x2f
+#define SEARCH_HIGH 0x30
+#define SEARCH_EQUAL 0x31
+#define SEARCH_LOW 0x32
+#define SET_LIMITS 0x33
+#define PRE_FETCH 0x34
+#define READ_POSITION 0x34
+#define SYNCHRONIZE_CACHE 0x35
+#define LOCK_UNLOCK_CACHE 0x36
+#define READ_DEFECT_DATA 0x37
+#define MEDIUM_SCAN 0x38
+#define COMPARE 0x39
+#define COPY_VERIFY 0x3a
+#define WRITE_BUFFER 0x3b
+#define READ_BUFFER 0x3c
+#define UPDATE_BLOCK 0x3d
+#define READ_LONG 0x3e
+#define WRITE_LONG 0x3f
+#define CHANGE_DEFINITION 0x40
+#define WRITE_SAME 0x41
+#define READ_TOC 0x43
+#define LOG_SELECT 0x4c
+#define LOG_SENSE 0x4d
+#define MODE_SELECT_10 0x55
+#define RESERVE_10 0x56
+#define RELEASE_10 0x57
+#define MODE_SENSE_10 0x5a
+#define PERSISTENT_RESERVE_IN 0x5e
+#define PERSISTENT_RESERVE_OUT 0x5f
+#define MOVE_MEDIUM 0xa5
+#define READ_12 0xa8
+#define WRITE_12 0xaa
+#define WRITE_VERIFY_12 0xae
+#define SEARCH_HIGH_12 0xb0
+#define SEARCH_EQUAL_12 0xb1
+#define SEARCH_LOW_12 0xb2
+#define READ_ELEMENT_STATUS 0xb8
+#define SEND_VOLUME_TAG 0xb6
+#define WRITE_LONG_2 0xea
+
+/*
+ * Status codes
+ */
+
+#define GOOD 0x00
+#define CHECK_CONDITION 0x01
+#define CONDITION_GOOD 0x02
+#define BUSY 0x04
+#define INTERMEDIATE_GOOD 0x08
+#define INTERMEDIATE_C_GOOD 0x0a
+#define RESERVATION_CONFLICT 0x0c
+#define COMMAND_TERMINATED 0x11
+#define QUEUE_FULL 0x14
+
+#define STATUS_MASK 0x3e
+
+/*
+ * SENSE KEYS
+ */
+
+#define NO_SENSE 0x00
+#define RECOVERED_ERROR 0x01
+#define NOT_READY 0x02
+#define MEDIUM_ERROR 0x03
+#define HARDWARE_ERROR 0x04
+#define ILLEGAL_REQUEST 0x05
+#define UNIT_ATTENTION 0x06
+#define DATA_PROTECT 0x07
+#define BLANK_CHECK 0x08
+#define COPY_ABORTED 0x0a
+#define ABORTED_COMMAND 0x0b
+#define VOLUME_OVERFLOW 0x0d
+#define MISCOMPARE 0x0e
+
+
+/*
+ * DEVICE TYPES
+ */
+
+#define TYPE_DISK 0x00
+#define TYPE_TAPE 0x01
+#define TYPE_PROCESSOR 0x03 /* HP scanners use this */
+#define TYPE_WORM 0x04 /* Treated as ROM by our system */
+#define TYPE_ROM 0x05
+#define TYPE_SCANNER 0x06
+#define TYPE_MOD 0x07 /* Magneto-optical disk -
+ * - treated as TYPE_DISK */
+#define TYPE_MEDIUM_CHANGER 0x08
+#define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */
+#define TYPE_NO_LUN 0x7f
+
+/*
+ * standard mode-select header prepended to all mode-select commands
+ *
+ * moved here from cdrom.h -- kraxel
+ */
+
+struct ccs_modesel_head
+ {
+ unsigned char _r1; /* reserved. */
+ unsigned char medium; /* device-specific medium type. */
+ unsigned char _r2; /* reserved. */
+ unsigned char block_desc_length; /* block descriptor length. */
+ unsigned char density; /* device-specific density code. */
+ unsigned char number_blocks_hi; /* number of blocks in this block
+ desc. */
+ unsigned char number_blocks_med;
+ unsigned char number_blocks_lo;
+ unsigned char _r3;
+ unsigned char block_length_hi; /* block length for blocks in this
+ desc. */
+ unsigned char block_length_med;
+ unsigned char block_length_lo;
+ };
+
+/*
+ * MESSAGE CODES
+ */
+
+#define COMMAND_COMPLETE 0x00
+#define EXTENDED_MESSAGE 0x01
+#define EXTENDED_MODIFY_DATA_POINTER 0x00
+#define EXTENDED_SDTR 0x01
+#define EXTENDED_EXTENDED_IDENTIFY 0x02 /* SCSI-I only */
+#define EXTENDED_WDTR 0x03
+#define SAVE_POINTERS 0x02
+#define RESTORE_POINTERS 0x03
+#define DISCONNECT 0x04
+#define INITIATOR_ERROR 0x05
+#define ABORT 0x06
+#define MESSAGE_REJECT 0x07
+#define NOP 0x08
+#define MSG_PARITY_ERROR 0x09
+#define LINKED_CMD_COMPLETE 0x0a
+#define LINKED_FLG_CMD_COMPLETE 0x0b
+#define BUS_DEVICE_RESET 0x0c
+
+#define INITIATE_RECOVERY 0x0f /* SCSI-II only */
+#define RELEASE_RECOVERY 0x10 /* SCSI-II only */
+
+#define SIMPLE_QUEUE_TAG 0x20
+#define HEAD_OF_QUEUE_TAG 0x21
+#define ORDERED_QUEUE_TAG 0x22
+
+/*
+ * Here are some scsi specific ioctl commands which are sometimes useful.
+ */
+/* These are a few other constants only used by scsi devices. */
+
+#define SCSI_IOCTL_GET_IDLUN 0x5382
+
+/* Used to turn on and off tagged queuing for scsi devices. */
+
+#define SCSI_IOCTL_TAGGED_ENABLE 0x5383
+#define SCSI_IOCTL_TAGGED_DISABLE 0x5384
+
+/* Used to obtain the host number of a device. */
+#define SCSI_IOCTL_PROBE_HOST 0x5385
+
+/* Used to get the bus number for a device. */
+#define SCSI_IOCTL_GET_BUS_NUMBER 0x5386
+
+#endif /* scsi/scsi.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/scsi/scsi_ioctl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/scsi/scsi_ioctl.h
new file mode 100644
index 0000000..11f0161
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/scsi/scsi_ioctl.h
@@ -0,0 +1,34 @@
+/* Copyright (C) 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SCSI_IOCTL_H
+#define _SCSI_IOCTL_H
+
+/* IOCTLs for SCSI. */
+#define SCSI_IOCTL_SEND_COMMAND 1 /* Send a command to the SCSI host. */
+#define SCSI_IOCTL_TEST_UNIT_READY 2 /* Test if unit is ready. */
+#define SCSI_IOCTL_BENCHMARK_COMMAND 3
+#define SCSI_IOCTL_SYNC 4 /* Request synchronous parameters. */
+#define SCSI_IOCTL_START_UNIT 5
+#define SCSI_IOCTL_STOP_UNIT 6
+#define SCSI_IOCTL_DOORLOCK 0x5380 /* Lock the eject mechanism. */
+#define SCSI_IOCTL_DOORUNLOCK 0x5381 /* Unlock the mechanism. */
+
+#endif
+
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/scsi/sg.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/scsi/sg.h
new file mode 100644
index 0000000..b0dc0ad
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/scsi/sg.h
@@ -0,0 +1,275 @@
+/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ History:
+ Started: Aug 9 by Lawrence Foard (entropy@world.std.com), to allow user
+ process control of SCSI devices.
+ Development Sponsored by Killy Corp. NY NY
+*/
+
+#ifndef _SCSI_SG_H
+#define _SCSI_SG_H 1
+
+#include <features.h>
+
+
+/* New interface introduced in the 3.x SG drivers follows */
+
+/* Same structure as used by readv() Linux system call. It defines one
+ scatter-gather element. */
+typedef struct sg_iovec
+{
+ void * iov_base; /* Starting address */
+ size_t iov_len; /* Length in bytes */
+} sg_iovec_t;
+
+
+typedef struct sg_io_hdr
+{
+ int interface_id; /* [i] 'S' for SCSI generic (required) */
+ int dxfer_direction; /* [i] data transfer direction */
+ unsigned char cmd_len; /* [i] SCSI command length ( <= 16 bytes) */
+ unsigned char mx_sb_len; /* [i] max length to write to sbp */
+ unsigned short int iovec_count; /* [i] 0 implies no scatter gather */
+ unsigned int dxfer_len; /* [i] byte count of data transfer */
+ void * dxferp; /* [i], [*io] points to data transfer memory
+ or scatter gather list */
+ unsigned char * cmdp; /* [i], [*i] points to command to perform */
+ unsigned char * sbp; /* [i], [*o] points to sense_buffer memory */
+ unsigned int timeout; /* [i] MAX_UINT->no timeout (unit: millisec) */
+ unsigned int flags; /* [i] 0 -> default, see SG_FLAG... */
+ int pack_id; /* [i->o] unused internally (normally) */
+ void * usr_ptr; /* [i->o] unused internally */
+ unsigned char status; /* [o] scsi status */
+ unsigned char masked_status;/* [o] shifted, masked scsi status */
+ unsigned char msg_status; /* [o] messaging level data (optional) */
+ unsigned char sb_len_wr; /* [o] byte count actually written to sbp */
+ unsigned short int host_status; /* [o] errors from host adapter */
+ unsigned short int driver_status;/* [o] errors from software driver */
+ int resid; /* [o] dxfer_len - actual_transferred */
+ unsigned int duration; /* [o] time taken by cmd (unit: millisec) */
+ unsigned int info; /* [o] auxiliary information */
+} sg_io_hdr_t;
+
+
+/* Use negative values to flag difference from original sg_header structure. */
+#define SG_DXFER_NONE -1 /* e.g. a SCSI Test Unit Ready command */
+#define SG_DXFER_TO_DEV -2 /* e.g. a SCSI WRITE command */
+#define SG_DXFER_FROM_DEV -3 /* e.g. a SCSI READ command */
+#define SG_DXFER_TO_FROM_DEV -4 /* treated like SG_DXFER_FROM_DEV with the
+ additional property than during indirect
+ IO the user buffer is copied into the
+ kernel buffers before the transfer */
+
+
+/* following flag values can be "or"-ed together */
+#define SG_FLAG_DIRECT_IO 1 /* default is indirect IO */
+#define SG_FLAG_LUN_INHIBIT 2 /* default is to put device's lun into */
+ /* the 2nd byte of SCSI command */
+#define SG_FLAG_NO_DXFER 0x10000 /* no transfer of kernel buffers to/from */
+ /* user space (debug indirect IO) */
+
+/* The following 'info' values are "or"-ed together. */
+#define SG_INFO_OK_MASK 0x1
+#define SG_INFO_OK 0x0 /* no sense, host nor driver "noise" */
+#define SG_INFO_CHECK 0x1 /* something abnormal happened */
+
+#define SG_INFO_DIRECT_IO_MASK 0x6
+#define SG_INFO_INDIRECT_IO 0x0 /* data xfer via kernel buffers (or no xfer) */
+#define SG_INFO_DIRECT_IO 0x2 /* direct IO requested and performed */
+#define SG_INFO_MIXED_IO 0x4 /* part direct, part indirect IO */
+
+
+/* Request information about a specific SG device, used by
+ SG_GET_SCSI_ID ioctl (). */
+struct sg_scsi_id {
+ /* Host number as in "scsi<n>" where 'n' is one of 0, 1, 2 etc. */
+ int host_no;
+ int channel;
+ /* SCSI id of target device. */
+ int scsi_id;
+ int lun;
+ /* TYPE_... defined in <scsi/scsi.h>. */
+ int scsi_type;
+ /* Host (adapter) maximum commands per lun. */
+ short int h_cmd_per_lun;
+ /* Device (or adapter) maximum queue length. */
+ short int d_queue_depth;
+ /* Unused, set to 0 for now. */
+ int unused[2];
+};
+
+/* Used by SG_GET_REQUEST_TABLE ioctl(). */
+typedef struct sg_req_info {
+ char req_state; /* 0 -> not used, 1 -> written, 2 -> ready to read */
+ char orphan; /* 0 -> normal request, 1 -> from interruped SG_IO */
+ char sg_io_owned; /* 0 -> complete with read(), 1 -> owned by SG_IO */
+ char problem; /* 0 -> no problem detected, 1 -> error to report */
+ int pack_id; /* pack_id associated with request */
+ void * usr_ptr; /* user provided pointer (in new interface) */
+ unsigned int duration; /* millisecs elapsed since written (req_state==1)
+ or request duration (req_state==2) */
+ int unused;
+} sg_req_info_t;
+
+
+/* IOCTLs: Those ioctls that are relevant to the SG 3.x drivers follow.
+ [Those that only apply to the SG 2.x drivers are at the end of the file.]
+ (_GET_s yield result via 'int *' 3rd argument unless otherwise indicated) */
+
+#define SG_EMULATED_HOST 0x2203 /* true for emulated host adapter (ATAPI) */
+
+/* Used to configure SCSI command transformation layer for ATAPI devices */
+/* Only supported by the ide-scsi driver */
+#define SG_SET_TRANSFORM 0x2204 /* N.B. 3rd arg is not pointer but value: */
+ /* 3rd arg = 0 to disable transform, 1 to enable it */
+#define SG_GET_TRANSFORM 0x2205
+
+#define SG_SET_RESERVED_SIZE 0x2275 /* request a new reserved buffer size */
+#define SG_GET_RESERVED_SIZE 0x2272 /* actual size of reserved buffer */
+
+/* The following ioctl has a 'sg_scsi_id_t *' object as its 3rd argument. */
+#define SG_GET_SCSI_ID 0x2276 /* Yields fd's bus, chan, dev, lun + type */
+/* SCSI id information can also be obtained from SCSI_IOCTL_GET_IDLUN */
+
+/* Override host setting and always DMA using low memory ( <16MB on i386) */
+#define SG_SET_FORCE_LOW_DMA 0x2279 /* 0-> use adapter setting, 1-> force */
+#define SG_GET_LOW_DMA 0x227a /* 0-> use all ram for dma; 1-> low dma ram */
+
+/* When SG_SET_FORCE_PACK_ID set to 1, pack_id is input to read() which
+ tries to fetch a packet with a matching pack_id, waits, or returns EAGAIN.
+ If pack_id is -1 then read oldest waiting. When ...FORCE_PACK_ID set to 0
+ then pack_id ignored by read() and oldest readable fetched. */
+#define SG_SET_FORCE_PACK_ID 0x227b
+#define SG_GET_PACK_ID 0x227c /* Yields oldest readable pack_id (or -1) */
+
+#define SG_GET_NUM_WAITING 0x227d /* Number of commands awaiting read() */
+
+/* Yields max scatter gather tablesize allowed by current host adapter */
+#define SG_GET_SG_TABLESIZE 0x227F /* 0 implies can't do scatter gather */
+
+#define SG_GET_VERSION_NUM 0x2282 /* Example: version 2.1.34 yields 20134 */
+
+/* Returns -EBUSY if occupied. 3rd argument pointer to int (see next) */
+#define SG_SCSI_RESET 0x2284
+/* Associated values that can be given to SG_SCSI_RESET follow */
+#define SG_SCSI_RESET_NOTHING 0
+#define SG_SCSI_RESET_DEVICE 1
+#define SG_SCSI_RESET_BUS 2
+#define SG_SCSI_RESET_HOST 3
+
+/* synchronous SCSI command ioctl, (only in version 3 interface) */
+#define SG_IO 0x2285 /* similar effect as write() followed by read() */
+
+#define SG_GET_REQUEST_TABLE 0x2286 /* yields table of active requests */
+
+/* How to treat EINTR during SG_IO ioctl(), only in SG 3.x series */
+#define SG_SET_KEEP_ORPHAN 0x2287 /* 1 -> hold for read(), 0 -> drop (def) */
+#define SG_GET_KEEP_ORPHAN 0x2288
+
+
+#define SG_SCATTER_SZ (8 * 4096) /* PAGE_SIZE not available to user */
+/* Largest size (in bytes) a single scatter-gather list element can have.
+ The value must be a power of 2 and <= (PAGE_SIZE * 32) [131072 bytes on
+ i386]. The minimum value is PAGE_SIZE. If scatter-gather not supported
+ by adapter then this value is the largest data block that can be
+ read/written by a single scsi command. The user can find the value of
+ PAGE_SIZE by calling getpagesize() defined in unistd.h . */
+
+#define SG_DEFAULT_RETRIES 1
+
+/* Defaults, commented if they differ from original sg driver */
+#define SG_DEF_FORCE_LOW_DMA 0 /* was 1 -> memory below 16MB on i386 */
+#define SG_DEF_FORCE_PACK_ID 0
+#define SG_DEF_KEEP_ORPHAN 0
+#define SG_DEF_RESERVED_SIZE SG_SCATTER_SZ /* load time option */
+
+/* maximum outstanding requests, write() yields EDOM if exceeded */
+#define SG_MAX_QUEUE 16
+
+#define SG_BIG_BUFF SG_DEF_RESERVED_SIZE /* for backward compatibility */
+
+/* Alternate style type names, "..._t" variants preferred */
+typedef struct sg_io_hdr Sg_io_hdr;
+typedef struct sg_io_vec Sg_io_vec;
+typedef struct sg_scsi_id Sg_scsi_id;
+typedef struct sg_req_info Sg_req_info;
+
+
+/* vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv */
+/* The older SG interface based on the 'sg_header' structure follows. */
+/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
+
+#define SG_MAX_SENSE 16 /* this only applies to the sg_header interface */
+
+struct sg_header
+ {
+ /* Length of incoming packet (including header). */
+ int pack_len;
+ /* Maximal length of expected reply. */
+ int reply_len;
+ /* Id number of packet. */
+ int pack_id;
+ /* 0==ok, otherwise error number. */
+ int result;
+ /* Force 12 byte command length for group 6 & 7 commands. */
+ unsigned int twelve_byte:1;
+ /* SCSI status from target. */
+ unsigned int target_status:5;
+ /* Host status (see "DID" codes). */
+ unsigned int host_status:8;
+ /* Driver status+suggestion. */
+ unsigned int driver_status:8;
+ /* Unused. */
+ unsigned int other_flags:10;
+ /* Output in 3 cases:
+ when target_status is CHECK_CONDITION or
+ when target_status is COMMAND_TERMINATED or
+ when (driver_status & DRIVER_SENSE) is true. */
+ unsigned char sense_buffer[SG_MAX_SENSE];
+ };
+
+
+/* IOCTLs: The following are not required (or ignored) when the sg_io_hdr_t
+ interface is used. They are kept for backward compatibility with
+ the original and version 2 drivers. */
+
+#define SG_SET_TIMEOUT 0x2201 /* Set timeout; *(int *)arg==timeout. */
+#define SG_GET_TIMEOUT 0x2202 /* Get timeout; return timeout. */
+
+/* Get/set command queuing state per fd (default is SG_DEF_COMMAND_Q). */
+#define SG_GET_COMMAND_Q 0x2270 /* Yields 0 (queuing off) or 1 (on). */
+#define SG_SET_COMMAND_Q 0x2271 /* Change queuing state with 0 or 1. */
+
+/* Turn on error sense trace (1..8), dump this device to log/console (9)
+ or dump all sg device states ( >9 ) to log/console. */
+#define SG_SET_DEBUG 0x227e /* 0 -> turn off debug */
+
+#define SG_NEXT_CMD_LEN 0x2283 /* Override SCSI command length with given
+ number on the next write() on this file
+ descriptor. */
+
+/* Defaults, commented if they differ from original sg driver */
+#define SG_DEFAULT_TIMEOUT (60*HZ) /* HZ == 'jiffies in 1 second' */
+#define SG_DEF_COMMAND_Q 0 /* command queuing is always on when
+ the new interface is used */
+#define SG_DEF_UNDERRUN_FLAG 0
+
+
+#endif /* scsi/sg.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/search.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/search.h
new file mode 100644
index 0000000..2ffba69
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/search.h
@@ -0,0 +1,175 @@
+/* Declarations for System V style searching functions.
+ Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SEARCH_H
+#define _SEARCH_H 1
+
+#include <features.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+__BEGIN_DECLS
+
+#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED
+/* Prototype structure for a linked-list data structure.
+ This is the type used by the `insque' and `remque' functions. */
+
+# ifdef __USE_GNU
+struct qelem
+ {
+ struct qelem *q_forw;
+ struct qelem *q_back;
+ char q_data[1];
+ };
+# endif
+
+
+/* Insert ELEM into a doubly-linked list, after PREV. */
+extern void insque (void *__elem, void *__prev) __THROW;
+
+/* Unlink ELEM from the doubly-linked list that it is in. */
+extern void remque (void *__elem) __THROW;
+#endif
+
+
+/* For use with hsearch(3). */
+#ifndef __COMPAR_FN_T
+# define __COMPAR_FN_T
+typedef int (*__compar_fn_t) (__const void *, __const void *);
+
+# ifdef __USE_GNU
+typedef __compar_fn_t comparison_fn_t;
+# endif
+#endif
+
+/* Action which shall be performed in the call the hsearch. */
+typedef enum
+ {
+ FIND,
+ ENTER
+ }
+ACTION;
+
+typedef struct entry
+ {
+ char *key;
+ void *data;
+ }
+ENTRY;
+
+/* Opaque type for internal use. */
+struct _ENTRY;
+
+/* Family of hash table handling functions. The functions also
+ have reentrant counterparts ending with _r. The non-reentrant
+ functions all work on a signle internal hashing table. */
+
+/* Search for entry matching ITEM.key in internal hash table. If
+ ACTION is `FIND' return found entry or signal error by returning
+ NULL. If ACTION is `ENTER' replace existing data (if any) with
+ ITEM.data. */
+extern ENTRY *hsearch (ENTRY __item, ACTION __action) __THROW;
+
+/* Create a new hashing table which will at most contain NEL elements. */
+extern int hcreate (size_t __nel) __THROW;
+
+/* Destroy current internal hashing table. */
+extern void hdestroy (void) __THROW;
+
+#ifdef __USE_GNU
+/* Data type for reentrant functions. */
+struct hsearch_data
+ {
+ struct _ENTRY *table;
+ unsigned int size;
+ unsigned int filled;
+ };
+
+/* Reentrant versions which can handle multiple hashing tables at the
+ same time. */
+extern int hsearch_r (ENTRY __item, ACTION __action, ENTRY **__retval,
+ struct hsearch_data *__htab) __THROW;
+extern int hcreate_r (size_t __nel, struct hsearch_data *__htab) __THROW;
+extern void hdestroy_r (struct hsearch_data *__htab) __THROW;
+#endif
+
+
+/* The tsearch routines are very interesting. They make many
+ assumptions about the compiler. It assumes that the first field
+ in node must be the "key" field, which points to the datum.
+ Everything depends on that. */
+/* For tsearch */
+typedef enum
+{
+ preorder,
+ postorder,
+ endorder,
+ leaf
+}
+VISIT;
+
+/* Search for an entry matching the given KEY in the tree pointed to
+ by *ROOTP and insert a new element if not found. */
+extern void *tsearch (__const void *__key, void **__rootp,
+ __compar_fn_t __compar);
+
+/* Search for an entry matching the given KEY in the tree pointed to
+ by *ROOTP. If no matching entry is available return NULL. */
+extern void *tfind (__const void *__key, void *__const *__rootp,
+ __compar_fn_t __compar);
+
+/* Remove the element matching KEY from the tree pointed to by *ROOTP. */
+extern void *tdelete (__const void *__restrict __key,
+ void **__restrict __rootp,
+ __compar_fn_t __compar);
+
+#ifndef __ACTION_FN_T
+# define __ACTION_FN_T
+typedef void (*__action_fn_t) (__const void *__nodep, VISIT __value,
+ int __level);
+#endif
+
+/* Walk through the whole tree and call the ACTION callback for every node
+ or leaf. */
+extern void twalk (__const void *__root, __action_fn_t __action);
+
+#ifdef __USE_GNU
+/* Callback type for function to free a tree node. If the keys are atomic
+ data this function should do nothing. */
+typedef void (*__free_fn_t) (void *__nodep);
+
+/* Destroy the whole tree, call FREEFCT for each node or leaf. */
+extern void tdestroy (void *__root, __free_fn_t __freefct);
+#endif
+
+
+/* Perform linear search for KEY by comparing by COMPAR in an array
+ [BASE,BASE+NMEMB*SIZE). */
+extern void *lfind (__const void *__key, __const void *__base,
+ size_t *__nmemb, size_t __size, __compar_fn_t __compar);
+
+/* Perform linear search for KEY by comparing by COMPAR function in
+ array [BASE,BASE+NMEMB*SIZE) and insert entry if not found. */
+extern void *lsearch (__const void *__key, void *__base,
+ size_t *__nmemb, size_t __size, __compar_fn_t __compar);
+
+__END_DECLS
+
+#endif /* search.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/semaphore.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/semaphore.h
new file mode 100644
index 0000000..7b09ea9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/semaphore.h
@@ -0,0 +1,87 @@
+/* Linuxthreads - a simple clone()-based implementation of Posix */
+/* threads for Linux. */
+/* Copyright (C) 1996 Xavier Leroy (Xavier.Leroy@inria.fr) */
+/* */
+/* This program is free software; you can redistribute it and/or */
+/* modify it under the terms of the GNU Library General Public License */
+/* as published by the Free Software Foundation; either version 2 */
+/* of the License, or (at your option) any later version. */
+/* */
+/* This program is distributed in the hope that it will be useful, */
+/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
+/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
+/* GNU Library General Public License for more details. */
+
+#ifndef _SEMAPHORE_H
+#define _SEMAPHORE_H 1
+
+#include <features.h>
+#include <sys/types.h>
+#ifdef __USE_XOPEN2K
+# define __need_timespec
+# include <time.h>
+#endif
+
+#ifndef _PTHREAD_DESCR_DEFINED
+/* Thread descriptors. Needed for `sem_t' definition. */
+typedef struct _pthread_descr_struct *_pthread_descr;
+# define _PTHREAD_DESCR_DEFINED
+#endif
+
+/* System specific semaphore definition. */
+typedef struct
+{
+ struct _pthread_fastlock __sem_lock;
+ int __sem_value;
+ _pthread_descr __sem_waiting;
+} sem_t;
+
+
+
+/* Value returned if `sem_open' failed. */
+#define SEM_FAILED ((sem_t *) 0)
+
+/* Maximum value the semaphore can have. */
+#define SEM_VALUE_MAX ((int) ((~0u) >> 1))
+
+
+__BEGIN_DECLS
+
+/* Initialize semaphore object SEM to VALUE. If PSHARED then share it
+ with other processes. */
+extern int sem_init (sem_t *__sem, int __pshared, unsigned int __value) __THROW;
+
+/* Free resources associated with semaphore object SEM. */
+extern int sem_destroy (sem_t *__sem) __THROW;
+
+/* Open a named semaphore NAME with open flaot OFLAG. */
+extern sem_t *sem_open (__const char *__name, int __oflag, ...) __THROW;
+
+/* Close descriptor for named semaphore SEM. */
+extern int sem_close (sem_t *__sem) __THROW;
+
+/* Remove named semaphore NAME. */
+extern int sem_unlink (__const char *__name) __THROW;
+
+/* Wait for SEM being posted. */
+extern int sem_wait (sem_t *__sem);
+
+#ifdef __USE_XOPEN2K
+/* Similar to `sem_wait' but wait only until ABSTIME. */
+extern int sem_timedwait (sem_t *__restrict __sem,
+ __const struct timespec *__restrict __abstime);
+#endif
+
+/* Test whether SEM is posted. */
+extern int sem_trywait (sem_t *__sem) __THROW;
+
+/* Post SEM. */
+extern int sem_post (sem_t *__sem) __THROW;
+
+/* Get current value of SEM and store it in *SVAL. */
+extern int sem_getvalue (sem_t *__restrict __sem, int *__restrict __sval)
+ __THROW;
+
+__END_DECLS
+
+#endif /* semaphore.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/setjmp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/setjmp.h
new file mode 100644
index 0000000..99e3dc8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/setjmp.h
@@ -0,0 +1,104 @@
+/* Copyright (C) 1991-1999, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.13 Nonlocal jumps <setjmp.h>
+ */
+
+#ifndef _SETJMP_H
+#define _SETJMP_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <bits/setjmp.h> /* Get `__jmp_buf'. */
+#include <bits/sigset.h> /* Get `__sigset_t'. */
+
+/* Calling environment, plus possibly a saved signal mask. */
+typedef struct __jmp_buf_tag /* C++ doesn't like tagless structs. */
+ {
+ /* NOTE: The machine-dependent definitions of `__sigsetjmp'
+ assume that a `jmp_buf' begins with a `__jmp_buf' and that
+ `__mask_was_saved' follows it. Do not move these members
+ or add others before it. */
+ __jmp_buf __jmpbuf; /* Calling environment. */
+ int __mask_was_saved; /* Saved the signal mask? */
+ __sigset_t __saved_mask; /* Saved signal mask. */
+ } jmp_buf[1];
+
+
+/* Store the calling environment in ENV, also saving the signal mask.
+ Return 0. */
+extern int setjmp (jmp_buf __env) __THROW;
+
+/* Store the calling environment in ENV, not saving the signal mask.
+ Return 0. */
+extern int _setjmp (jmp_buf __env) __THROW;
+
+/* Store the calling environment in ENV, also saving the
+ signal mask if SAVEMASK is nonzero. Return 0.
+ This is the internal name for `sigsetjmp'. */
+extern int __sigsetjmp (jmp_buf __env, int __savemask) __THROW;
+
+#ifndef __FAVOR_BSD
+/* Do not save the signal mask. This is equivalent to the `_setjmp'
+ BSD function. */
+# define setjmp(env) _setjmp (env)
+#else
+/* We are in 4.3 BSD-compatibility mode in which `setjmp'
+ saves the signal mask like `sigsetjmp (ENV, 1)'. We have to
+ define a macro since ISO C says `setjmp' is one. */
+# define setjmp(env) setjmp (env)
+#endif /* Favor BSD. */
+
+
+/* Jump to the environment saved in ENV, making the
+ `setjmp' call there return VAL, or 1 if VAL is 0. */
+extern void longjmp (jmp_buf __env, int __val)
+ __THROW __attribute__ ((__noreturn__));
+#if defined __USE_BSD || defined __USE_XOPEN
+/* Same. Usually `_longjmp' is used with `_setjmp', which does not save
+ the signal mask. But it is how ENV was saved that determines whether
+ `longjmp' restores the mask; `_longjmp' is just an alias. */
+extern void _longjmp (jmp_buf __env, int __val)
+ __THROW __attribute__ ((__noreturn__));
+#endif
+
+
+#ifdef __USE_POSIX
+/* Use the same type for `jmp_buf' and `sigjmp_buf'.
+ The `__mask_was_saved' flag determines whether
+ or not `longjmp' will restore the signal mask. */
+typedef jmp_buf sigjmp_buf;
+
+/* Store the calling environment in ENV, also saving the
+ signal mask if SAVEMASK is nonzero. Return 0. */
+# define sigsetjmp(env, savemask) __sigsetjmp (env, savemask)
+
+/* Jump to the environment saved in ENV, making the
+ sigsetjmp call there return VAL, or 1 if VAL is 0.
+ Restore the signal mask if that sigsetjmp call saved it.
+ This is just an alias `longjmp'. */
+extern void siglongjmp (sigjmp_buf __env, int __val)
+ __THROW __attribute__ ((__noreturn__));
+#endif /* Use POSIX. */
+
+__END_DECLS
+
+#endif /* setjmp.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sgidefs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sgidefs.h
new file mode 100644
index 0000000..74509fd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sgidefs.h
@@ -0,0 +1,73 @@
+/* Copyright (C) 1996, 1997, 1998, 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ralf Baechle <ralf@gnu.org>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SGIDEFS_H
+#define _SGIDEFS_H 1
+
+/*
+ * A crude hack to stop <asm/sgidefs.h>
+ */
+#undef __ASM_SGIDEFS_H
+#define __ASM_SGIDEFS_H
+
+/*
+ * And remove any damage it might have already done
+ */
+#undef _MIPS_ISA_MIPS1
+#undef _MIPS_ISA_MIPS2
+#undef _MIPS_ISA_MIPS3
+#undef _MIPS_ISA_MIPS4
+#undef _MIPS_ISA_MIPS5
+#undef _MIPS_ISA_MIPS32
+#undef _MIPS_ISA_MIPS64
+
+#undef _MIPS_SIM_ABI32
+#undef _MIPS_SIM_NABI32
+#undef _MIPS_SIM_ABI64
+
+/*
+ * Definitions for the ISA level
+ */
+#define _MIPS_ISA_MIPS1 1
+#define _MIPS_ISA_MIPS2 2
+#define _MIPS_ISA_MIPS3 3
+#define _MIPS_ISA_MIPS4 4
+#define _MIPS_ISA_MIPS5 5
+#define _MIPS_ISA_MIPS32 6
+#define _MIPS_ISA_MIPS64 7
+
+/*
+ * Subprogram calling convention
+ */
+#ifndef _ABIO32
+# define _ABIO32 1
+#endif
+#define _MIPS_SIM_ABI32 _ABIO32
+
+#ifndef _ABIN32
+# define _ABIN32 2
+#endif
+#define _MIPS_SIM_NABI32 _ABIN32
+
+#ifndef _ABI64
+# define _ABI64 3
+#endif
+#define _MIPS_SIM_ABI64 _ABI64
+
+#endif /* sgidefs.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sgtty.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sgtty.h
new file mode 100644
index 0000000..5b2bc41
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sgtty.h
@@ -0,0 +1,41 @@
+/* Copyright (C) 1991, 1992, 1996, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SGTTY_H
+#define _SGTTY_H 1
+
+#include <features.h>
+
+#include <sys/ioctl.h>
+
+/* On some systems this type is not defined by <bits/ioctl-types.h>;
+ in that case, the functions are just stubs that return ENOSYS. */
+struct sgttyb;
+
+__BEGIN_DECLS
+
+/* Fill in *PARAMS with terminal parameters associated with FD. */
+extern int gtty (int __fd, struct sgttyb *__params) __THROW;
+
+/* Set the terminal parameters associated with FD to *PARAMS. */
+extern int stty (int __fd, __const struct sgttyb *__params) __THROW;
+
+
+__END_DECLS
+
+#endif /* sgtty.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/shadow.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/shadow.h
new file mode 100644
index 0000000..778df52
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/shadow.h
@@ -0,0 +1,149 @@
+/* Copyright (C) 1996, 1997, 1998, 1999, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Declaration of types and functions for shadow password suite. */
+
+#ifndef _SHADOW_H
+#define _SHADOW_H 1
+
+#include <features.h>
+
+#include <paths.h>
+
+#define __need_FILE
+#include <stdio.h>
+#define __need_size_t
+#include <stddef.h>
+
+/* Paths to the user database files. */
+#define SHADOW _PATH_SHADOW
+
+
+__BEGIN_DECLS
+
+/* Structure of the password file. */
+struct spwd
+ {
+ char *sp_namp; /* Login name. */
+ char *sp_pwdp; /* Encrypted password. */
+ long int sp_lstchg; /* Date of last change. */
+ long int sp_min; /* Minimum number of days between changes. */
+ long int sp_max; /* Maximum number of days between changes. */
+ long int sp_warn; /* Number of days to warn user to change
+ the password. */
+ long int sp_inact; /* Number of days the account may be
+ inactive. */
+ long int sp_expire; /* Number of days since 1970-01-01 until
+ account expires. */
+ unsigned long int sp_flag; /* Reserved. */
+ };
+
+
+/* Open database for reading.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern void setspent (void);
+
+/* Close database.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern void endspent (void);
+
+/* Get next entry from database, perhaps after opening the file.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern struct spwd *getspent (void);
+
+/* Get shadow entry matching NAME.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern struct spwd *getspnam (__const char *__name);
+
+/* Read shadow entry from STRING.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern struct spwd *sgetspent (__const char *__string);
+
+/* Read next shadow entry from STREAM.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern struct spwd *fgetspent (FILE *__stream);
+
+/* Write line containing shadow password entry to stream.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int putspent (__const struct spwd *__p, FILE *__stream);
+
+
+#ifdef __USE_MISC
+/* Reentrant versions of some of the functions above.
+
+ These functions are not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation they are cancellation points and
+ therefore not marked with __THROW. */
+extern int getspent_r (struct spwd *__result_buf, char *__buffer,
+ size_t __buflen, struct spwd **__result);
+
+extern int getspnam_r (__const char *__name, struct spwd *__result_buf,
+ char *__buffer, size_t __buflen,
+ struct spwd **__result);
+
+extern int sgetspent_r (__const char *__string, struct spwd *__result_buf,
+ char *__buffer, size_t __buflen,
+ struct spwd **__result);
+
+extern int fgetspent_r (FILE *__stream, struct spwd *__result_buf,
+ char *__buffer, size_t __buflen,
+ struct spwd **__result);
+#endif /* misc */
+
+
+/* The simple locking functionality provided here is not suitable for
+ multi-threaded applications. */
+
+/* Protect password file against multi writers. */
+extern int lckpwdf (void) __THROW;
+
+/* Unlock password file. */
+extern int ulckpwdf (void) __THROW;
+
+__END_DECLS
+
+#endif /* shadow.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/signal.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/signal.h
new file mode 100644
index 0000000..288febd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/signal.h
@@ -0,0 +1,401 @@
+/* Copyright (C) 1991-2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.14 Signal handling <signal.h>
+ */
+
+#ifndef _SIGNAL_H
+
+#if !defined __need_sig_atomic_t && !defined __need_sigset_t
+# define _SIGNAL_H
+#endif
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <bits/sigset.h> /* __sigset_t, __sig_atomic_t. */
+
+/* An integral type that can be modified atomically, without the
+ possibility of a signal arriving in the middle of the operation. */
+#if defined __need_sig_atomic_t || defined _SIGNAL_H
+# ifndef __sig_atomic_t_defined
+# define __sig_atomic_t_defined
+__BEGIN_NAMESPACE_STD
+typedef __sig_atomic_t sig_atomic_t;
+__END_NAMESPACE_STD
+# endif
+# undef __need_sig_atomic_t
+#endif
+
+#if defined __need_sigset_t || (defined _SIGNAL_H && defined __USE_POSIX)
+# ifndef __sigset_t_defined
+# define __sigset_t_defined
+typedef __sigset_t sigset_t;
+# endif
+# undef __need_sigset_t
+#endif
+
+#ifdef _SIGNAL_H
+
+#include <bits/types.h>
+#include <bits/signum.h>
+
+#if defined __USE_XOPEN || defined __USE_XOPEN2K
+# ifndef __pid_t_defined
+typedef __pid_t pid_t;
+# define __pid_t_defined
+#endif
+#ifdef __USE_XOPEN
+# endif
+# ifndef __uid_t_defined
+typedef __uid_t uid_t;
+# define __uid_t_defined
+# endif
+#endif /* Unix98 */
+
+
+/* Type of a signal handler. */
+typedef void (*__sighandler_t) (int);
+
+/* The X/Open definition of `signal' specifies the SVID semantic. Use
+ the additional function `sysv_signal' when X/Open compatibility is
+ requested. */
+extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler)
+ __THROW;
+#ifdef __USE_GNU
+extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler)
+ __THROW;
+#endif
+
+/* Set the handler for the signal SIG to HANDLER, returning the old
+ handler, or SIG_ERR on error.
+ By default `signal' has the BSD semantic. */
+__BEGIN_NAMESPACE_STD
+#ifdef __USE_BSD
+extern __sighandler_t signal (int __sig, __sighandler_t __handler)
+ __THROW;
+#else
+/* Make sure the used `signal' implementation is the SVID version. */
+# ifdef __REDIRECT_NTH
+extern __sighandler_t __REDIRECT_NTH (signal,
+ (int __sig, __sighandler_t __handler),
+ __sysv_signal);
+# else
+# define signal __sysv_signal
+# endif
+#endif
+__END_NAMESPACE_STD
+
+#ifdef __USE_XOPEN
+/* The X/Open definition of `signal' conflicts with the BSD version.
+ So they defined another function `bsd_signal'. */
+extern __sighandler_t bsd_signal (int __sig, __sighandler_t __handler)
+ __THROW;
+#endif
+
+/* Send signal SIG to process number PID. If PID is zero,
+ send SIG to all processes in the current process's process group.
+ If PID is < -1, send SIG to all processes in process group - PID. */
+#ifdef __USE_POSIX
+extern int kill (__pid_t __pid, int __sig) __THROW;
+#endif /* Use POSIX. */
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Send SIG to all processes in process group PGRP.
+ If PGRP is zero, send SIG to all processes in
+ the current process's process group. */
+extern int killpg (__pid_t __pgrp, int __sig) __THROW;
+#endif /* Use BSD || X/Open Unix. */
+
+__BEGIN_NAMESPACE_STD
+/* Raise signal SIG, i.e., send SIG to yourself. */
+extern int raise (int __sig) __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_SVID
+/* SVID names for the same things. */
+extern __sighandler_t ssignal (int __sig, __sighandler_t __handler)
+ __THROW;
+extern int gsignal (int __sig) __THROW;
+#endif /* Use SVID. */
+
+#ifdef __USE_MISC
+/* Print a message describing the meaning of the given signal number. */
+extern void psignal (int __sig, __const char *__s);
+#endif /* Use misc. */
+
+
+/* The `sigpause' function has two different interfaces. The original
+ BSD definition defines the argument as a mask of the signal, while
+ the more modern interface in X/Open defines it as the signal
+ number. We go with the BSD version unless the user explicitly
+ selects the X/Open version.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int __sigpause (int __sig_or_mask, int __is_sig);
+
+#ifdef __FAVOR_BSD
+/* Set the mask of blocked signals to MASK,
+ wait for a signal to arrive, and then restore the mask. */
+extern int sigpause (int __mask) __THROW __attribute_deprecated__;
+# define sigpause(mask) __sigpause ((mask), 0)
+#else
+# ifdef __USE_XOPEN
+/* Remove a signal from the signal mask and suspend the process. */
+# define sigpause(sig) __sigpause ((sig), 1)
+# endif
+#endif
+
+
+#ifdef __USE_BSD
+/* None of the following functions should be used anymore. They are here
+ only for compatibility. A single word (`int') is not guaranteed to be
+ enough to hold a complete signal mask and therefore these functions
+ simply do not work in many situations. Use `sigprocmask' instead. */
+
+/* Compute mask for signal SIG. */
+# define sigmask(sig) __sigmask(sig)
+
+/* Block signals in MASK, returning the old mask. */
+extern int sigblock (int __mask) __THROW __attribute_deprecated__;
+
+/* Set the mask of blocked signals to MASK, returning the old mask. */
+extern int sigsetmask (int __mask) __THROW __attribute_deprecated__;
+
+/* Return currently selected signal mask. */
+extern int siggetmask (void) __THROW __attribute_deprecated__;
+#endif /* Use BSD. */
+
+
+#ifdef __USE_MISC
+# define NSIG _NSIG
+#endif
+
+#ifdef __USE_GNU
+typedef __sighandler_t sighandler_t;
+#endif
+
+/* 4.4 BSD uses the name `sig_t' for this. */
+#ifdef __USE_BSD
+typedef __sighandler_t sig_t;
+#endif
+
+#ifdef __USE_POSIX
+
+# ifdef __USE_POSIX199309
+/* We need `struct timespec' later on. */
+# define __need_timespec
+# include <time.h>
+
+/* Get the `siginfo_t' type plus the needed symbols. */
+# include <bits/siginfo.h>
+# endif
+
+/* Clear all signals from SET. */
+extern int sigemptyset (sigset_t *__set) __THROW __nonnull ((1));
+
+/* Set all signals in SET. */
+extern int sigfillset (sigset_t *__set) __THROW __nonnull ((1));
+
+/* Add SIGNO to SET. */
+extern int sigaddset (sigset_t *__set, int __signo) __THROW __nonnull ((1));
+
+/* Remove SIGNO from SET. */
+extern int sigdelset (sigset_t *__set, int __signo) __THROW __nonnull ((1));
+
+/* Return 1 if SIGNO is in SET, 0 if not. */
+extern int sigismember (__const sigset_t *__set, int __signo)
+ __THROW __nonnull ((1));
+
+# ifdef __USE_GNU
+/* Return non-empty value is SET is not empty. */
+extern int sigisemptyset (__const sigset_t *__set) __THROW __nonnull ((1));
+
+/* Build new signal set by combining the two inputs set using logical AND. */
+extern int sigandset (sigset_t *__set, __const sigset_t *__left,
+ __const sigset_t *__right) __THROW __nonnull ((1, 2, 3));
+
+/* Build new signal set by combining the two inputs set using logical OR. */
+extern int sigorset (sigset_t *__set, __const sigset_t *__left,
+ __const sigset_t *__right) __THROW __nonnull ((1, 2, 3));
+# endif /* GNU */
+
+/* Get the system-specific definitions of `struct sigaction'
+ and the `SA_*' and `SIG_*'. constants. */
+# include <bits/sigaction.h>
+
+/* Get and/or change the set of blocked signals. */
+extern int sigprocmask (int __how, __const sigset_t *__restrict __set,
+ sigset_t *__restrict __oset) __THROW;
+
+/* Change the set of blocked signals to SET,
+ wait until a signal arrives, and restore the set of blocked signals.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int sigsuspend (__const sigset_t *__set) __nonnull ((1));
+
+/* Get and/or set the action for signal SIG. */
+extern int sigaction (int __sig, __const struct sigaction *__restrict __act,
+ struct sigaction *__restrict __oact) __THROW;
+
+/* Put in SET all signals that are blocked and waiting to be delivered. */
+extern int sigpending (sigset_t *__set) __THROW __nonnull ((1));
+
+
+/* Select any of pending signals from SET or wait for any to arrive.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int sigwait (__const sigset_t *__restrict __set, int *__restrict __sig)
+ __nonnull ((1, 2));
+
+# ifdef __USE_POSIX199309
+/* Select any of pending signals from SET and place information in INFO.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int sigwaitinfo (__const sigset_t *__restrict __set,
+ siginfo_t *__restrict __info) __nonnull ((1));
+
+/* Select any of pending signals from SET and place information in INFO.
+ Wait the time specified by TIMEOUT if no signal is pending.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int sigtimedwait (__const sigset_t *__restrict __set,
+ siginfo_t *__restrict __info,
+ __const struct timespec *__restrict __timeout)
+ __nonnull ((1));
+
+/* Send signal SIG to the process PID. Associate data in VAL with the
+ signal. */
+extern int sigqueue (__pid_t __pid, int __sig, __const union sigval __val)
+ __THROW;
+# endif /* Use POSIX 199306. */
+
+#endif /* Use POSIX. */
+
+#ifdef __USE_BSD
+
+#ifdef __UCLIBC_HAS_SYS_SIGLIST__
+/* Names of the signals. This variable exists only for compatibility.
+ Use `strsignal' instead (see <string.h>). */
+#define _sys_siglist sys_siglist
+extern __const char *__const sys_siglist[_NSIG];
+#endif /* __UCLIBC_HAS_SYS_SIGLIST__ */
+
+/* Structure passed to `sigvec'. */
+struct sigvec
+ {
+ __sighandler_t sv_handler; /* Signal handler. */
+ int sv_mask; /* Mask of signals to be blocked. */
+
+ int sv_flags; /* Flags (see below). */
+# define sv_onstack sv_flags /* 4.2 BSD compatibility. */
+ };
+
+/* Bits in `sv_flags'. */
+# define SV_ONSTACK (1 << 0)/* Take the signal on the signal stack. */
+# define SV_INTERRUPT (1 << 1)/* Do not restart system calls. */
+# define SV_RESETHAND (1 << 2)/* Reset handler to SIG_DFL on receipt. */
+
+
+/* If VEC is non-NULL, set the handler for SIG to the `sv_handler' member
+ of VEC. The signals in `sv_mask' will be blocked while the handler runs.
+ If the SV_RESETHAND bit is set in `sv_flags', the handler for SIG will be
+ reset to SIG_DFL before `sv_handler' is entered. If OVEC is non-NULL,
+ it is filled in with the old information for SIG. */
+extern int sigvec (int __sig, __const struct sigvec *__vec,
+ struct sigvec *__ovec) __THROW;
+
+
+/* Get machine-dependent `struct sigcontext' and signal subcodes. */
+# include <bits/sigcontext.h>
+
+/* Restore the state saved in SCP. */
+extern int sigreturn (struct sigcontext *__scp) __THROW;
+
+#endif /* use BSD. */
+
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+
+/* If INTERRUPT is nonzero, make signal SIG interrupt system calls
+ (causing them to fail with EINTR); if INTERRUPT is zero, make system
+ calls be restarted after signal SIG. */
+extern int siginterrupt (int __sig, int __interrupt) __THROW;
+
+# include <bits/sigstack.h>
+# ifdef __USE_XOPEN
+/* This will define `ucontext_t' and `mcontext_t'. */
+# include <ucontext.h>
+# endif
+
+/* Run signals handlers on the stack specified by SS (if not NULL).
+ If OSS is not NULL, it is filled in with the old signal stack status.
+ This interface is obsolete and on many platform not implemented. */
+extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
+ __THROW __attribute_deprecated__;
+
+/* Alternate signal handler stack interface.
+ This interface should always be preferred over `sigstack'. */
+extern int sigaltstack (__const struct sigaltstack *__restrict __ss,
+ struct sigaltstack *__restrict __oss) __THROW;
+
+#endif /* use BSD or X/Open Unix. */
+
+#ifdef __USE_XOPEN_EXTENDED
+/* Simplified interface for signal management. */
+
+/* Add SIG to the calling process' signal mask. */
+extern int sighold (int __sig) __THROW;
+
+/* Remove SIG from the calling process' signal mask. */
+extern int sigrelse (int __sig) __THROW;
+
+/* Set the disposition of SIG to SIG_IGN. */
+extern int sigignore (int __sig) __THROW;
+
+/* Set the disposition of SIG. */
+extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __THROW;
+#endif
+
+#if defined __UCLIBC_HAS_THREADS__ && (defined __USE_POSIX199506 || defined __USE_UNIX98)
+/* Some of the functions for handling signals in threaded programs must
+ be defined here. */
+# include <bits/pthreadtypes.h>
+# include <bits/sigthread.h>
+#endif /* use Unix98 */
+
+/* The following functions are used internally in the C library and in
+ other code which need deep insights. */
+
+/* Return number of available real-time signal with highest priority. */
+extern int __libc_current_sigrtmin (void) __THROW;
+/* Return number of available real-time signal with lowest priority. */
+extern int __libc_current_sigrtmax (void) __THROW;
+
+#endif /* signal.h */
+
+__END_DECLS
+
+#endif /* not signal.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/..install.cmd
new file mode 100644
index 0000000..69bf1be
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/sound/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/sound /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/sound mips asequencer.h asound.h asound_fm.h emu10k1.h hdsp.h hdspm.h sb16_csp.h sfnt_info.h sscape_ioctl.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/sound /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/sound mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/sound/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/asequencer.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/asequencer.h
new file mode 100644
index 0000000..2be4da5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/asequencer.h
@@ -0,0 +1,614 @@
+/*
+ * Main header file for the ALSA sequencer
+ * Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
+ * (c) 1998-1999 by Jaroslav Kysela <perex@perex.cz>
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+#ifndef __SOUND_ASEQUENCER_H
+#define __SOUND_ASEQUENCER_H
+
+
+/** version of the sequencer */
+#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 1)
+
+/**
+ * definition of sequencer event types
+ */
+
+/** system messages
+ * event data type = #snd_seq_result
+ */
+#define SNDRV_SEQ_EVENT_SYSTEM 0
+#define SNDRV_SEQ_EVENT_RESULT 1
+
+/** note messages (channel specific)
+ * event data type = #snd_seq_ev_note
+ */
+#define SNDRV_SEQ_EVENT_NOTE 5
+#define SNDRV_SEQ_EVENT_NOTEON 6
+#define SNDRV_SEQ_EVENT_NOTEOFF 7
+#define SNDRV_SEQ_EVENT_KEYPRESS 8
+
+/** control messages (channel specific)
+ * event data type = #snd_seq_ev_ctrl
+ */
+#define SNDRV_SEQ_EVENT_CONTROLLER 10
+#define SNDRV_SEQ_EVENT_PGMCHANGE 11
+#define SNDRV_SEQ_EVENT_CHANPRESS 12
+#define SNDRV_SEQ_EVENT_PITCHBEND 13 /**< from -8192 to 8191 */
+#define SNDRV_SEQ_EVENT_CONTROL14 14 /**< 14 bit controller value */
+#define SNDRV_SEQ_EVENT_NONREGPARAM 15 /**< 14 bit NRPN address + 14 bit unsigned value */
+#define SNDRV_SEQ_EVENT_REGPARAM 16 /**< 14 bit RPN address + 14 bit unsigned value */
+
+/** synchronisation messages
+ * event data type = #snd_seq_ev_ctrl
+ */
+#define SNDRV_SEQ_EVENT_SONGPOS 20 /* Song Position Pointer with LSB and MSB values */
+#define SNDRV_SEQ_EVENT_SONGSEL 21 /* Song Select with song ID number */
+#define SNDRV_SEQ_EVENT_QFRAME 22 /* midi time code quarter frame */
+#define SNDRV_SEQ_EVENT_TIMESIGN 23 /* SMF Time Signature event */
+#define SNDRV_SEQ_EVENT_KEYSIGN 24 /* SMF Key Signature event */
+
+/** timer messages
+ * event data type = snd_seq_ev_queue_control
+ */
+#define SNDRV_SEQ_EVENT_START 30 /* midi Real Time Start message */
+#define SNDRV_SEQ_EVENT_CONTINUE 31 /* midi Real Time Continue message */
+#define SNDRV_SEQ_EVENT_STOP 32 /* midi Real Time Stop message */
+#define SNDRV_SEQ_EVENT_SETPOS_TICK 33 /* set tick queue position */
+#define SNDRV_SEQ_EVENT_SETPOS_TIME 34 /* set realtime queue position */
+#define SNDRV_SEQ_EVENT_TEMPO 35 /* (SMF) Tempo event */
+#define SNDRV_SEQ_EVENT_CLOCK 36 /* midi Real Time Clock message */
+#define SNDRV_SEQ_EVENT_TICK 37 /* midi Real Time Tick message */
+#define SNDRV_SEQ_EVENT_QUEUE_SKEW 38 /* skew queue tempo */
+
+/** others
+ * event data type = none
+ */
+#define SNDRV_SEQ_EVENT_TUNE_REQUEST 40 /* tune request */
+#define SNDRV_SEQ_EVENT_RESET 41 /* reset to power-on state */
+#define SNDRV_SEQ_EVENT_SENSING 42 /* "active sensing" event */
+
+/** echo back, kernel private messages
+ * event data type = any type
+ */
+#define SNDRV_SEQ_EVENT_ECHO 50 /* echo event */
+#define SNDRV_SEQ_EVENT_OSS 51 /* OSS raw event */
+
+/** system status messages (broadcast for subscribers)
+ * event data type = snd_seq_addr
+ */
+#define SNDRV_SEQ_EVENT_CLIENT_START 60 /* new client has connected */
+#define SNDRV_SEQ_EVENT_CLIENT_EXIT 61 /* client has left the system */
+#define SNDRV_SEQ_EVENT_CLIENT_CHANGE 62 /* client status/info has changed */
+#define SNDRV_SEQ_EVENT_PORT_START 63 /* new port was created */
+#define SNDRV_SEQ_EVENT_PORT_EXIT 64 /* port was deleted from system */
+#define SNDRV_SEQ_EVENT_PORT_CHANGE 65 /* port status/info has changed */
+
+/** port connection changes
+ * event data type = snd_seq_connect
+ */
+#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */
+#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */
+
+/* 70-89: synthesizer events - obsoleted */
+
+/** user-defined events with fixed length
+ * event data type = any
+ */
+#define SNDRV_SEQ_EVENT_USR0 90
+#define SNDRV_SEQ_EVENT_USR1 91
+#define SNDRV_SEQ_EVENT_USR2 92
+#define SNDRV_SEQ_EVENT_USR3 93
+#define SNDRV_SEQ_EVENT_USR4 94
+#define SNDRV_SEQ_EVENT_USR5 95
+#define SNDRV_SEQ_EVENT_USR6 96
+#define SNDRV_SEQ_EVENT_USR7 97
+#define SNDRV_SEQ_EVENT_USR8 98
+#define SNDRV_SEQ_EVENT_USR9 99
+
+/* 100-118: instrument layer - obsoleted */
+/* 119-129: reserved */
+
+/* 130-139: variable length events
+ * event data type = snd_seq_ev_ext
+ * (SNDRV_SEQ_EVENT_LENGTH_VARIABLE must be set)
+ */
+#define SNDRV_SEQ_EVENT_SYSEX 130 /* system exclusive data (variable length) */
+#define SNDRV_SEQ_EVENT_BOUNCE 131 /* error event */
+/* 132-134: reserved */
+#define SNDRV_SEQ_EVENT_USR_VAR0 135
+#define SNDRV_SEQ_EVENT_USR_VAR1 136
+#define SNDRV_SEQ_EVENT_USR_VAR2 137
+#define SNDRV_SEQ_EVENT_USR_VAR3 138
+#define SNDRV_SEQ_EVENT_USR_VAR4 139
+
+/* 150-151: kernel events with quote - DO NOT use in user clients */
+#define SNDRV_SEQ_EVENT_KERNEL_ERROR 150
+#define SNDRV_SEQ_EVENT_KERNEL_QUOTE 151 /* obsolete */
+
+/* 152-191: reserved */
+
+/* 192-254: hardware specific events */
+
+/* 255: special event */
+#define SNDRV_SEQ_EVENT_NONE 255
+
+
+typedef unsigned char snd_seq_event_type_t;
+
+/** event address */
+struct snd_seq_addr {
+ unsigned char client; /**< Client number: 0..255, 255 = broadcast to all clients */
+ unsigned char port; /**< Port within client: 0..255, 255 = broadcast to all ports */
+};
+
+/** port connection */
+struct snd_seq_connect {
+ struct snd_seq_addr sender;
+ struct snd_seq_addr dest;
+};
+
+
+#define SNDRV_SEQ_ADDRESS_UNKNOWN 253 /* unknown source */
+#define SNDRV_SEQ_ADDRESS_SUBSCRIBERS 254 /* send event to all subscribed ports */
+#define SNDRV_SEQ_ADDRESS_BROADCAST 255 /* send event to all queues/clients/ports/channels */
+#define SNDRV_SEQ_QUEUE_DIRECT 253 /* direct dispatch */
+
+ /* event mode flag - NOTE: only 8 bits available! */
+#define SNDRV_SEQ_TIME_STAMP_TICK (0<<0) /* timestamp in clock ticks */
+#define SNDRV_SEQ_TIME_STAMP_REAL (1<<0) /* timestamp in real time */
+#define SNDRV_SEQ_TIME_STAMP_MASK (1<<0)
+
+#define SNDRV_SEQ_TIME_MODE_ABS (0<<1) /* absolute timestamp */
+#define SNDRV_SEQ_TIME_MODE_REL (1<<1) /* relative to current time */
+#define SNDRV_SEQ_TIME_MODE_MASK (1<<1)
+
+#define SNDRV_SEQ_EVENT_LENGTH_FIXED (0<<2) /* fixed event size */
+#define SNDRV_SEQ_EVENT_LENGTH_VARIABLE (1<<2) /* variable event size */
+#define SNDRV_SEQ_EVENT_LENGTH_VARUSR (2<<2) /* variable event size - user memory space */
+#define SNDRV_SEQ_EVENT_LENGTH_MASK (3<<2)
+
+#define SNDRV_SEQ_PRIORITY_NORMAL (0<<4) /* normal priority */
+#define SNDRV_SEQ_PRIORITY_HIGH (1<<4) /* event should be processed before others */
+#define SNDRV_SEQ_PRIORITY_MASK (1<<4)
+
+
+ /* note event */
+struct snd_seq_ev_note {
+ unsigned char channel;
+ unsigned char note;
+ unsigned char velocity;
+ unsigned char off_velocity; /* only for SNDRV_SEQ_EVENT_NOTE */
+ unsigned int duration; /* only for SNDRV_SEQ_EVENT_NOTE */
+};
+
+ /* controller event */
+struct snd_seq_ev_ctrl {
+ unsigned char channel;
+ unsigned char unused1, unused2, unused3; /* pad */
+ unsigned int param;
+ signed int value;
+};
+
+ /* generic set of bytes (12x8 bit) */
+struct snd_seq_ev_raw8 {
+ unsigned char d[12]; /* 8 bit value */
+};
+
+ /* generic set of integers (3x32 bit) */
+struct snd_seq_ev_raw32 {
+ unsigned int d[3]; /* 32 bit value */
+};
+
+ /* external stored data */
+struct snd_seq_ev_ext {
+ unsigned int len; /* length of data */
+ void *ptr; /* pointer to data (note: maybe 64-bit) */
+} __attribute__((packed));
+
+struct snd_seq_result {
+ int event; /* processed event type */
+ int result;
+};
+
+
+struct snd_seq_real_time {
+ unsigned int tv_sec; /* seconds */
+ unsigned int tv_nsec; /* nanoseconds */
+};
+
+typedef unsigned int snd_seq_tick_time_t; /* midi ticks */
+
+union snd_seq_timestamp {
+ snd_seq_tick_time_t tick;
+ struct snd_seq_real_time time;
+};
+
+struct snd_seq_queue_skew {
+ unsigned int value;
+ unsigned int base;
+};
+
+ /* queue timer control */
+struct snd_seq_ev_queue_control {
+ unsigned char queue; /* affected queue */
+ unsigned char pad[3]; /* reserved */
+ union {
+ signed int value; /* affected value (e.g. tempo) */
+ union snd_seq_timestamp time; /* time */
+ unsigned int position; /* sync position */
+ struct snd_seq_queue_skew skew;
+ unsigned int d32[2];
+ unsigned char d8[8];
+ } param;
+};
+
+ /* quoted event - inside the kernel only */
+struct snd_seq_ev_quote {
+ struct snd_seq_addr origin; /* original sender */
+ unsigned short value; /* optional data */
+ struct snd_seq_event *event; /* quoted event */
+} __attribute__((packed));
+
+
+ /* sequencer event */
+struct snd_seq_event {
+ snd_seq_event_type_t type; /* event type */
+ unsigned char flags; /* event flags */
+ char tag;
+
+ unsigned char queue; /* schedule queue */
+ union snd_seq_timestamp time; /* schedule time */
+
+
+ struct snd_seq_addr source; /* source address */
+ struct snd_seq_addr dest; /* destination address */
+
+ union { /* event data... */
+ struct snd_seq_ev_note note;
+ struct snd_seq_ev_ctrl control;
+ struct snd_seq_ev_raw8 raw8;
+ struct snd_seq_ev_raw32 raw32;
+ struct snd_seq_ev_ext ext;
+ struct snd_seq_ev_queue_control queue;
+ union snd_seq_timestamp time;
+ struct snd_seq_addr addr;
+ struct snd_seq_connect connect;
+ struct snd_seq_result result;
+ struct snd_seq_ev_quote quote;
+ } data;
+};
+
+
+/*
+ * bounce event - stored as variable size data
+ */
+struct snd_seq_event_bounce {
+ int err;
+ struct snd_seq_event event;
+ /* external data follows here. */
+};
+
+
+ /* system information */
+struct snd_seq_system_info {
+ int queues; /* maximum queues count */
+ int clients; /* maximum clients count */
+ int ports; /* maximum ports per client */
+ int channels; /* maximum channels per port */
+ int cur_clients; /* current clients */
+ int cur_queues; /* current queues */
+ char reserved[24];
+};
+
+
+ /* system running information */
+struct snd_seq_running_info {
+ unsigned char client; /* client id */
+ unsigned char big_endian; /* 1 = big-endian */
+ unsigned char cpu_mode; /* 4 = 32bit, 8 = 64bit */
+ unsigned char pad; /* reserved */
+ unsigned char reserved[12];
+};
+
+
+ /* known client numbers */
+#define SNDRV_SEQ_CLIENT_SYSTEM 0
+ /* internal client numbers */
+#define SNDRV_SEQ_CLIENT_DUMMY 14 /* midi through */
+#define SNDRV_SEQ_CLIENT_OSS 15 /* oss sequencer emulator */
+
+
+ /* client types */
+typedef int __bitwise snd_seq_client_type_t;
+#define NO_CLIENT ((snd_seq_client_type_t) 0)
+#define USER_CLIENT ((snd_seq_client_type_t) 1)
+#define KERNEL_CLIENT ((snd_seq_client_type_t) 2)
+
+ /* event filter flags */
+#define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */
+#define SNDRV_SEQ_FILTER_MULTICAST (1<<1) /* accept multicast messages */
+#define SNDRV_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */
+#define SNDRV_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */
+
+struct snd_seq_client_info {
+ int client; /* client number to inquire */
+ snd_seq_client_type_t type; /* client type */
+ char name[64]; /* client name */
+ unsigned int filter; /* filter flags */
+ unsigned char multicast_filter[8]; /* multicast filter bitmap */
+ unsigned char event_filter[32]; /* event filter bitmap */
+ int num_ports; /* RO: number of ports */
+ int event_lost; /* number of lost events */
+ char reserved[64]; /* for future use */
+};
+
+
+/* client pool size */
+struct snd_seq_client_pool {
+ int client; /* client number to inquire */
+ int output_pool; /* outgoing (write) pool size */
+ int input_pool; /* incoming (read) pool size */
+ int output_room; /* minimum free pool size for select/blocking mode */
+ int output_free; /* unused size */
+ int input_free; /* unused size */
+ char reserved[64];
+};
+
+
+/* Remove events by specified criteria */
+
+#define SNDRV_SEQ_REMOVE_INPUT (1<<0) /* Flush input queues */
+#define SNDRV_SEQ_REMOVE_OUTPUT (1<<1) /* Flush output queues */
+#define SNDRV_SEQ_REMOVE_DEST (1<<2) /* Restrict by destination q:client:port */
+#define SNDRV_SEQ_REMOVE_DEST_CHANNEL (1<<3) /* Restrict by channel */
+#define SNDRV_SEQ_REMOVE_TIME_BEFORE (1<<4) /* Restrict to before time */
+#define SNDRV_SEQ_REMOVE_TIME_AFTER (1<<5) /* Restrict to time or after */
+#define SNDRV_SEQ_REMOVE_TIME_TICK (1<<6) /* Time is in ticks */
+#define SNDRV_SEQ_REMOVE_EVENT_TYPE (1<<7) /* Restrict to event type */
+#define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8) /* Do not flush off events */
+#define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9) /* Restrict to events with given tag */
+
+struct snd_seq_remove_events {
+ unsigned int remove_mode; /* Flags that determine what gets removed */
+
+ union snd_seq_timestamp time;
+
+ unsigned char queue; /* Queue for REMOVE_DEST */
+ struct snd_seq_addr dest; /* Address for REMOVE_DEST */
+ unsigned char channel; /* Channel for REMOVE_DEST */
+
+ int type; /* For REMOVE_EVENT_TYPE */
+ char tag; /* Tag for REMOVE_TAG */
+
+ int reserved[10]; /* To allow for future binary compatibility */
+
+};
+
+
+ /* known port numbers */
+#define SNDRV_SEQ_PORT_SYSTEM_TIMER 0
+#define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE 1
+
+ /* port capabilities (32 bits) */
+#define SNDRV_SEQ_PORT_CAP_READ (1<<0) /* readable from this port */
+#define SNDRV_SEQ_PORT_CAP_WRITE (1<<1) /* writable to this port */
+
+#define SNDRV_SEQ_PORT_CAP_SYNC_READ (1<<2)
+#define SNDRV_SEQ_PORT_CAP_SYNC_WRITE (1<<3)
+
+#define SNDRV_SEQ_PORT_CAP_DUPLEX (1<<4)
+
+#define SNDRV_SEQ_PORT_CAP_SUBS_READ (1<<5) /* allow read subscription */
+#define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1<<6) /* allow write subscription */
+#define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1<<7) /* routing not allowed */
+
+ /* port type */
+#define SNDRV_SEQ_PORT_TYPE_SPECIFIC (1<<0) /* hardware specific */
+#define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1) /* generic MIDI device */
+#define SNDRV_SEQ_PORT_TYPE_MIDI_GM (1<<2) /* General MIDI compatible device */
+#define SNDRV_SEQ_PORT_TYPE_MIDI_GS (1<<3) /* GS compatible device */
+#define SNDRV_SEQ_PORT_TYPE_MIDI_XG (1<<4) /* XG compatible device */
+#define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5) /* MT-32 compatible device */
+#define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1<<6) /* General MIDI 2 compatible device */
+
+/* other standards...*/
+#define SNDRV_SEQ_PORT_TYPE_SYNTH (1<<10) /* Synth device (no MIDI compatible - direct wavetable) */
+#define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */
+#define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */
+/*...*/
+#define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16) /* driver for a hardware device */
+#define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17) /* implemented in software */
+#define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18) /* generates sound */
+#define SNDRV_SEQ_PORT_TYPE_PORT (1<<19) /* connects to other device(s) */
+#define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */
+
+/* misc. conditioning flags */
+#define SNDRV_SEQ_PORT_FLG_GIVEN_PORT (1<<0)
+#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)
+#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)
+
+struct snd_seq_port_info {
+ struct snd_seq_addr addr; /* client/port numbers */
+ char name[64]; /* port name */
+
+ unsigned int capability; /* port capability bits */
+ unsigned int type; /* port type bits */
+ int midi_channels; /* channels per MIDI port */
+ int midi_voices; /* voices per MIDI port */
+ int synth_voices; /* voices per SYNTH port */
+
+ int read_use; /* R/O: subscribers for output (from this port) */
+ int write_use; /* R/O: subscribers for input (to this port) */
+
+ void *kernel; /* reserved for kernel use (must be NULL) */
+ unsigned int flags; /* misc. conditioning */
+ unsigned char time_queue; /* queue # for timestamping */
+ char reserved[59]; /* for future use */
+};
+
+
+/* queue flags */
+#define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0) /* sync enabled */
+
+/* queue information */
+struct snd_seq_queue_info {
+ int queue; /* queue id */
+
+ /*
+ * security settings, only owner of this queue can start/stop timer
+ * etc. if the queue is locked for other clients
+ */
+ int owner; /* client id for owner of the queue */
+ unsigned locked:1; /* timing queue locked for other queues */
+ char name[64]; /* name of this queue */
+ unsigned int flags; /* flags */
+ char reserved[60]; /* for future use */
+
+};
+
+/* queue info/status */
+struct snd_seq_queue_status {
+ int queue; /* queue id */
+ int events; /* read-only - queue size */
+ snd_seq_tick_time_t tick; /* current tick */
+ struct snd_seq_real_time time; /* current time */
+ int running; /* running state of queue */
+ int flags; /* various flags */
+ char reserved[64]; /* for the future */
+};
+
+
+/* queue tempo */
+struct snd_seq_queue_tempo {
+ int queue; /* sequencer queue */
+ unsigned int tempo; /* current tempo, us/tick */
+ int ppq; /* time resolution, ticks/quarter */
+ unsigned int skew_value; /* queue skew */
+ unsigned int skew_base; /* queue skew base */
+ char reserved[24]; /* for the future */
+};
+
+
+/* sequencer timer sources */
+#define SNDRV_SEQ_TIMER_ALSA 0 /* ALSA timer */
+#define SNDRV_SEQ_TIMER_MIDI_CLOCK 1 /* Midi Clock (CLOCK event) */
+#define SNDRV_SEQ_TIMER_MIDI_TICK 2 /* Midi Timer Tick (TICK event) */
+
+/* queue timer info */
+struct snd_seq_queue_timer {
+ int queue; /* sequencer queue */
+ int type; /* source timer type */
+ union {
+ struct {
+ struct snd_timer_id id; /* ALSA's timer ID */
+ unsigned int resolution; /* resolution in Hz */
+ } alsa;
+ } u;
+ char reserved[64]; /* for the future use */
+};
+
+
+struct snd_seq_queue_client {
+ int queue; /* sequencer queue */
+ int client; /* sequencer client */
+ int used; /* queue is used with this client
+ (must be set for accepting events) */
+ /* per client watermarks */
+ char reserved[64]; /* for future use */
+};
+
+
+#define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE (1<<0) /* exclusive connection */
+#define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1)
+#define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2)
+
+struct snd_seq_port_subscribe {
+ struct snd_seq_addr sender; /* sender address */
+ struct snd_seq_addr dest; /* destination address */
+ unsigned int voices; /* number of voices to be allocated (0 = don't care) */
+ unsigned int flags; /* modes */
+ unsigned char queue; /* input time-stamp queue (optional) */
+ unsigned char pad[3]; /* reserved */
+ char reserved[64];
+};
+
+/* type of query subscription */
+#define SNDRV_SEQ_QUERY_SUBS_READ 0
+#define SNDRV_SEQ_QUERY_SUBS_WRITE 1
+
+struct snd_seq_query_subs {
+ struct snd_seq_addr root; /* client/port id to be searched */
+ int type; /* READ or WRITE */
+ int index; /* 0..N-1 */
+ int num_subs; /* R/O: number of subscriptions on this port */
+ struct snd_seq_addr addr; /* R/O: result */
+ unsigned char queue; /* R/O: result */
+ unsigned int flags; /* R/O: result */
+ char reserved[64]; /* for future use */
+};
+
+
+/*
+ * IOCTL commands
+ */
+
+#define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int)
+#define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int)
+#define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info)
+#define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info)
+
+#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)
+#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info)
+
+#define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info)
+#define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct snd_seq_port_info)
+#define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct snd_seq_port_info)
+#define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct snd_seq_port_info)
+
+#define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct snd_seq_port_subscribe)
+#define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct snd_seq_port_subscribe)
+
+#define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct snd_seq_queue_info)
+#define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct snd_seq_queue_info)
+#define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct snd_seq_queue_info)
+#define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct snd_seq_queue_info)
+#define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct snd_seq_queue_info)
+#define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status)
+#define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct snd_seq_queue_tempo)
+#define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct snd_seq_queue_tempo)
+#define SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER _IOWR('S', 0x43, struct snd_seq_queue_owner)
+#define SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER _IOW ('S', 0x44, struct snd_seq_queue_owner)
+#define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct snd_seq_queue_timer)
+#define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct snd_seq_queue_timer)
+/* XXX
+#define SNDRV_SEQ_IOCTL_GET_QUEUE_SYNC _IOWR('S', 0x53, struct snd_seq_queue_sync)
+#define SNDRV_SEQ_IOCTL_SET_QUEUE_SYNC _IOW ('S', 0x54, struct snd_seq_queue_sync)
+*/
+#define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct snd_seq_queue_client)
+#define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct snd_seq_queue_client)
+#define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct snd_seq_client_pool)
+#define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct snd_seq_client_pool)
+#define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct snd_seq_remove_events)
+#define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct snd_seq_query_subs)
+#define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct snd_seq_port_subscribe)
+#define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct snd_seq_client_info)
+#define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct snd_seq_port_info)
+
+#endif /* __SOUND_ASEQUENCER_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/asound.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/asound.h
new file mode 100644
index 0000000..19cb233
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/asound.h
@@ -0,0 +1,894 @@
+/*
+ * Advanced Linux Sound Architecture - ALSA - Driver
+ * Copyright (c) 1994-2003 by Jaroslav Kysela <perex@perex.cz>,
+ * Abramo Bagnara <abramo@alsa-project.org>
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __SOUND_ASOUND_H
+#define __SOUND_ASOUND_H
+
+#include <linux/types.h>
+
+
+/*
+ * protocol version
+ */
+
+#define SNDRV_PROTOCOL_VERSION(major, minor, subminor) (((major)<<16)|((minor)<<8)|(subminor))
+#define SNDRV_PROTOCOL_MAJOR(version) (((version)>>16)&0xffff)
+#define SNDRV_PROTOCOL_MINOR(version) (((version)>>8)&0xff)
+#define SNDRV_PROTOCOL_MICRO(version) ((version)&0xff)
+#define SNDRV_PROTOCOL_INCOMPATIBLE(kversion, uversion) \
+ (SNDRV_PROTOCOL_MAJOR(kversion) != SNDRV_PROTOCOL_MAJOR(uversion) || \
+ (SNDRV_PROTOCOL_MAJOR(kversion) == SNDRV_PROTOCOL_MAJOR(uversion) && \
+ SNDRV_PROTOCOL_MINOR(kversion) != SNDRV_PROTOCOL_MINOR(uversion)))
+
+/****************************************************************************
+ * *
+ * Digital audio interface *
+ * *
+ ****************************************************************************/
+
+struct snd_aes_iec958 {
+ unsigned char status[24]; /* AES/IEC958 channel status bits */
+ unsigned char subcode[147]; /* AES/IEC958 subcode bits */
+ unsigned char pad; /* nothing */
+ unsigned char dig_subframe[4]; /* AES/IEC958 subframe bits */
+};
+
+/****************************************************************************
+ * *
+ * Section for driver hardware dependent interface - /dev/snd/hw? *
+ * *
+ ****************************************************************************/
+
+#define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
+
+enum {
+ SNDRV_HWDEP_IFACE_OPL2 = 0,
+ SNDRV_HWDEP_IFACE_OPL3,
+ SNDRV_HWDEP_IFACE_OPL4,
+ SNDRV_HWDEP_IFACE_SB16CSP, /* Creative Signal Processor */
+ SNDRV_HWDEP_IFACE_EMU10K1, /* FX8010 processor in EMU10K1 chip */
+ SNDRV_HWDEP_IFACE_YSS225, /* Yamaha FX processor */
+ SNDRV_HWDEP_IFACE_ICS2115, /* Wavetable synth */
+ SNDRV_HWDEP_IFACE_SSCAPE, /* Ensoniq SoundScape ISA card (MC68EC000) */
+ SNDRV_HWDEP_IFACE_VX, /* Digigram VX cards */
+ SNDRV_HWDEP_IFACE_MIXART, /* Digigram miXart cards */
+ SNDRV_HWDEP_IFACE_USX2Y, /* Tascam US122, US224 & US428 usb */
+ SNDRV_HWDEP_IFACE_EMUX_WAVETABLE, /* EmuX wavetable */
+ SNDRV_HWDEP_IFACE_BLUETOOTH, /* Bluetooth audio */
+ SNDRV_HWDEP_IFACE_USX2Y_PCM, /* Tascam US122, US224 & US428 rawusb pcm */
+ SNDRV_HWDEP_IFACE_PCXHR, /* Digigram PCXHR */
+ SNDRV_HWDEP_IFACE_SB_RC, /* SB Extigy/Audigy2NX remote control */
+ SNDRV_HWDEP_IFACE_HDA, /* HD-audio */
+ SNDRV_HWDEP_IFACE_USB_STREAM, /* direct access to usb stream */
+
+ /* Don't forget to change the following: */
+ SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_USB_STREAM
+};
+
+struct snd_hwdep_info {
+ unsigned int device; /* WR: device number */
+ int card; /* R: card number */
+ unsigned char id[64]; /* ID (user selectable) */
+ unsigned char name[80]; /* hwdep name */
+ int iface; /* hwdep interface */
+ unsigned char reserved[64]; /* reserved for future */
+};
+
+/* generic DSP loader */
+struct snd_hwdep_dsp_status {
+ unsigned int version; /* R: driver-specific version */
+ unsigned char id[32]; /* R: driver-specific ID string */
+ unsigned int num_dsps; /* R: number of DSP images to transfer */
+ unsigned int dsp_loaded; /* R: bit flags indicating the loaded DSPs */
+ unsigned int chip_ready; /* R: 1 = initialization finished */
+ unsigned char reserved[16]; /* reserved for future use */
+};
+
+struct snd_hwdep_dsp_image {
+ unsigned int index; /* W: DSP index */
+ unsigned char name[64]; /* W: ID (e.g. file name) */
+ unsigned char *image; /* W: binary image */
+ size_t length; /* W: size of image in bytes */
+ unsigned long driver_data; /* W: driver-specific data */
+};
+
+#define SNDRV_HWDEP_IOCTL_PVERSION _IOR ('H', 0x00, int)
+#define SNDRV_HWDEP_IOCTL_INFO _IOR ('H', 0x01, struct snd_hwdep_info)
+#define SNDRV_HWDEP_IOCTL_DSP_STATUS _IOR('H', 0x02, struct snd_hwdep_dsp_status)
+#define SNDRV_HWDEP_IOCTL_DSP_LOAD _IOW('H', 0x03, struct snd_hwdep_dsp_image)
+
+/*****************************************************************************
+ * *
+ * Digital Audio (PCM) interface - /dev/snd/pcm?? *
+ * *
+ *****************************************************************************/
+
+#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 9)
+
+typedef unsigned long snd_pcm_uframes_t;
+typedef signed long snd_pcm_sframes_t;
+
+enum {
+ SNDRV_PCM_CLASS_GENERIC = 0, /* standard mono or stereo device */
+ SNDRV_PCM_CLASS_MULTI, /* multichannel device */
+ SNDRV_PCM_CLASS_MODEM, /* software modem class */
+ SNDRV_PCM_CLASS_DIGITIZER, /* digitizer class */
+ /* Don't forget to change the following: */
+ SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER,
+};
+
+enum {
+ SNDRV_PCM_SUBCLASS_GENERIC_MIX = 0, /* mono or stereo subdevices are mixed together */
+ SNDRV_PCM_SUBCLASS_MULTI_MIX, /* multichannel subdevices are mixed together */
+ /* Don't forget to change the following: */
+ SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX,
+};
+
+enum {
+ SNDRV_PCM_STREAM_PLAYBACK = 0,
+ SNDRV_PCM_STREAM_CAPTURE,
+ SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE,
+};
+
+typedef int __bitwise snd_pcm_access_t;
+#define SNDRV_PCM_ACCESS_MMAP_INTERLEAVED ((snd_pcm_access_t) 0) /* interleaved mmap */
+#define SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED ((snd_pcm_access_t) 1) /* noninterleaved mmap */
+#define SNDRV_PCM_ACCESS_MMAP_COMPLEX ((snd_pcm_access_t) 2) /* complex mmap */
+#define SNDRV_PCM_ACCESS_RW_INTERLEAVED ((snd_pcm_access_t) 3) /* readi/writei */
+#define SNDRV_PCM_ACCESS_RW_NONINTERLEAVED ((snd_pcm_access_t) 4) /* readn/writen */
+#define SNDRV_PCM_ACCESS_LAST SNDRV_PCM_ACCESS_RW_NONINTERLEAVED
+
+typedef int __bitwise snd_pcm_format_t;
+#define SNDRV_PCM_FORMAT_S8 ((snd_pcm_format_t) 0)
+#define SNDRV_PCM_FORMAT_U8 ((snd_pcm_format_t) 1)
+#define SNDRV_PCM_FORMAT_S16_LE ((snd_pcm_format_t) 2)
+#define SNDRV_PCM_FORMAT_S16_BE ((snd_pcm_format_t) 3)
+#define SNDRV_PCM_FORMAT_U16_LE ((snd_pcm_format_t) 4)
+#define SNDRV_PCM_FORMAT_U16_BE ((snd_pcm_format_t) 5)
+#define SNDRV_PCM_FORMAT_S24_LE ((snd_pcm_format_t) 6) /* low three bytes */
+#define SNDRV_PCM_FORMAT_S24_BE ((snd_pcm_format_t) 7) /* low three bytes */
+#define SNDRV_PCM_FORMAT_U24_LE ((snd_pcm_format_t) 8) /* low three bytes */
+#define SNDRV_PCM_FORMAT_U24_BE ((snd_pcm_format_t) 9) /* low three bytes */
+#define SNDRV_PCM_FORMAT_S32_LE ((snd_pcm_format_t) 10)
+#define SNDRV_PCM_FORMAT_S32_BE ((snd_pcm_format_t) 11)
+#define SNDRV_PCM_FORMAT_U32_LE ((snd_pcm_format_t) 12)
+#define SNDRV_PCM_FORMAT_U32_BE ((snd_pcm_format_t) 13)
+#define SNDRV_PCM_FORMAT_FLOAT_LE ((snd_pcm_format_t) 14) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */
+#define SNDRV_PCM_FORMAT_FLOAT_BE ((snd_pcm_format_t) 15) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */
+#define SNDRV_PCM_FORMAT_FLOAT64_LE ((snd_pcm_format_t) 16) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */
+#define SNDRV_PCM_FORMAT_FLOAT64_BE ((snd_pcm_format_t) 17) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */
+#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE ((snd_pcm_format_t) 18) /* IEC-958 subframe, Little Endian */
+#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE ((snd_pcm_format_t) 19) /* IEC-958 subframe, Big Endian */
+#define SNDRV_PCM_FORMAT_MU_LAW ((snd_pcm_format_t) 20)
+#define SNDRV_PCM_FORMAT_A_LAW ((snd_pcm_format_t) 21)
+#define SNDRV_PCM_FORMAT_IMA_ADPCM ((snd_pcm_format_t) 22)
+#define SNDRV_PCM_FORMAT_MPEG ((snd_pcm_format_t) 23)
+#define SNDRV_PCM_FORMAT_GSM ((snd_pcm_format_t) 24)
+#define SNDRV_PCM_FORMAT_SPECIAL ((snd_pcm_format_t) 31)
+#define SNDRV_PCM_FORMAT_S24_3LE ((snd_pcm_format_t) 32) /* in three bytes */
+#define SNDRV_PCM_FORMAT_S24_3BE ((snd_pcm_format_t) 33) /* in three bytes */
+#define SNDRV_PCM_FORMAT_U24_3LE ((snd_pcm_format_t) 34) /* in three bytes */
+#define SNDRV_PCM_FORMAT_U24_3BE ((snd_pcm_format_t) 35) /* in three bytes */
+#define SNDRV_PCM_FORMAT_S20_3LE ((snd_pcm_format_t) 36) /* in three bytes */
+#define SNDRV_PCM_FORMAT_S20_3BE ((snd_pcm_format_t) 37) /* in three bytes */
+#define SNDRV_PCM_FORMAT_U20_3LE ((snd_pcm_format_t) 38) /* in three bytes */
+#define SNDRV_PCM_FORMAT_U20_3BE ((snd_pcm_format_t) 39) /* in three bytes */
+#define SNDRV_PCM_FORMAT_S18_3LE ((snd_pcm_format_t) 40) /* in three bytes */
+#define SNDRV_PCM_FORMAT_S18_3BE ((snd_pcm_format_t) 41) /* in three bytes */
+#define SNDRV_PCM_FORMAT_U18_3LE ((snd_pcm_format_t) 42) /* in three bytes */
+#define SNDRV_PCM_FORMAT_U18_3BE ((snd_pcm_format_t) 43) /* in three bytes */
+#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_U18_3BE
+
+#ifdef SNDRV_LITTLE_ENDIAN
+#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
+#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_LE
+#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_LE
+#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_LE
+#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_LE
+#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_LE
+#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE
+#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE
+#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE
+#endif
+#ifdef SNDRV_BIG_ENDIAN
+#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE
+#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_BE
+#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_BE
+#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_BE
+#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_BE
+#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_BE
+#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE
+#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE
+#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE
+#endif
+
+typedef int __bitwise snd_pcm_subformat_t;
+#define SNDRV_PCM_SUBFORMAT_STD ((snd_pcm_subformat_t) 0)
+#define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD
+
+#define SNDRV_PCM_INFO_MMAP 0x00000001 /* hardware supports mmap */
+#define SNDRV_PCM_INFO_MMAP_VALID 0x00000002 /* period data are valid during transfer */
+#define SNDRV_PCM_INFO_DOUBLE 0x00000004 /* Double buffering needed for PCM start/stop */
+#define SNDRV_PCM_INFO_BATCH 0x00000010 /* double buffering */
+#define SNDRV_PCM_INFO_INTERLEAVED 0x00000100 /* channels are interleaved */
+#define SNDRV_PCM_INFO_NONINTERLEAVED 0x00000200 /* channels are not interleaved */
+#define SNDRV_PCM_INFO_COMPLEX 0x00000400 /* complex frame organization (mmap only) */
+#define SNDRV_PCM_INFO_BLOCK_TRANSFER 0x00010000 /* hardware transfer block of samples */
+#define SNDRV_PCM_INFO_OVERRANGE 0x00020000 /* hardware supports ADC (capture) overrange detection */
+#define SNDRV_PCM_INFO_RESUME 0x00040000 /* hardware supports stream resume after suspend */
+#define SNDRV_PCM_INFO_PAUSE 0x00080000 /* pause ioctl is supported */
+#define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */
+#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */
+#define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */
+
+typedef int __bitwise snd_pcm_state_t;
+#define SNDRV_PCM_STATE_OPEN ((snd_pcm_state_t) 0) /* stream is open */
+#define SNDRV_PCM_STATE_SETUP ((snd_pcm_state_t) 1) /* stream has a setup */
+#define SNDRV_PCM_STATE_PREPARED ((snd_pcm_state_t) 2) /* stream is ready to start */
+#define SNDRV_PCM_STATE_RUNNING ((snd_pcm_state_t) 3) /* stream is running */
+#define SNDRV_PCM_STATE_XRUN ((snd_pcm_state_t) 4) /* stream reached an xrun */
+#define SNDRV_PCM_STATE_DRAINING ((snd_pcm_state_t) 5) /* stream is draining */
+#define SNDRV_PCM_STATE_PAUSED ((snd_pcm_state_t) 6) /* stream is paused */
+#define SNDRV_PCM_STATE_SUSPENDED ((snd_pcm_state_t) 7) /* hardware is suspended */
+#define SNDRV_PCM_STATE_DISCONNECTED ((snd_pcm_state_t) 8) /* hardware is disconnected */
+#define SNDRV_PCM_STATE_LAST SNDRV_PCM_STATE_DISCONNECTED
+
+enum {
+ SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000,
+ SNDRV_PCM_MMAP_OFFSET_STATUS = 0x80000000,
+ SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000,
+};
+
+union snd_pcm_sync_id {
+ unsigned char id[16];
+ unsigned short id16[8];
+ unsigned int id32[4];
+};
+
+struct snd_pcm_info {
+ unsigned int device; /* RO/WR (control): device number */
+ unsigned int subdevice; /* RO/WR (control): subdevice number */
+ int stream; /* RO/WR (control): stream direction */
+ int card; /* R: card number */
+ unsigned char id[64]; /* ID (user selectable) */
+ unsigned char name[80]; /* name of this device */
+ unsigned char subname[32]; /* subdevice name */
+ int dev_class; /* SNDRV_PCM_CLASS_* */
+ int dev_subclass; /* SNDRV_PCM_SUBCLASS_* */
+ unsigned int subdevices_count;
+ unsigned int subdevices_avail;
+ union snd_pcm_sync_id sync; /* hardware synchronization ID */
+ unsigned char reserved[64]; /* reserved for future... */
+};
+
+typedef int snd_pcm_hw_param_t;
+#define SNDRV_PCM_HW_PARAM_ACCESS 0 /* Access type */
+#define SNDRV_PCM_HW_PARAM_FORMAT 1 /* Format */
+#define SNDRV_PCM_HW_PARAM_SUBFORMAT 2 /* Subformat */
+#define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS
+#define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT
+
+#define SNDRV_PCM_HW_PARAM_SAMPLE_BITS 8 /* Bits per sample */
+#define SNDRV_PCM_HW_PARAM_FRAME_BITS 9 /* Bits per frame */
+#define SNDRV_PCM_HW_PARAM_CHANNELS 10 /* Channels */
+#define SNDRV_PCM_HW_PARAM_RATE 11 /* Approx rate */
+#define SNDRV_PCM_HW_PARAM_PERIOD_TIME 12 /* Approx distance between
+ * interrupts in us
+ */
+#define SNDRV_PCM_HW_PARAM_PERIOD_SIZE 13 /* Approx frames between
+ * interrupts
+ */
+#define SNDRV_PCM_HW_PARAM_PERIOD_BYTES 14 /* Approx bytes between
+ * interrupts
+ */
+#define SNDRV_PCM_HW_PARAM_PERIODS 15 /* Approx interrupts per
+ * buffer
+ */
+#define SNDRV_PCM_HW_PARAM_BUFFER_TIME 16 /* Approx duration of buffer
+ * in us
+ */
+#define SNDRV_PCM_HW_PARAM_BUFFER_SIZE 17 /* Size of buffer in frames */
+#define SNDRV_PCM_HW_PARAM_BUFFER_BYTES 18 /* Size of buffer in bytes */
+#define SNDRV_PCM_HW_PARAM_TICK_TIME 19 /* Approx tick duration in us */
+#define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS
+#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME
+
+#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */
+
+struct snd_interval {
+ unsigned int min, max;
+ unsigned int openmin:1,
+ openmax:1,
+ integer:1,
+ empty:1;
+};
+
+#define SNDRV_MASK_MAX 256
+
+struct snd_mask {
+ __u32 bits[(SNDRV_MASK_MAX+31)/32];
+};
+
+struct snd_pcm_hw_params {
+ unsigned int flags;
+ struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK -
+ SNDRV_PCM_HW_PARAM_FIRST_MASK + 1];
+ struct snd_mask mres[5]; /* reserved masks */
+ struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL -
+ SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
+ struct snd_interval ires[9]; /* reserved intervals */
+ unsigned int rmask; /* W: requested masks */
+ unsigned int cmask; /* R: changed masks */
+ unsigned int info; /* R: Info flags for returned setup */
+ unsigned int msbits; /* R: used most significant bits */
+ unsigned int rate_num; /* R: rate numerator */
+ unsigned int rate_den; /* R: rate denominator */
+ snd_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */
+ unsigned char reserved[64]; /* reserved for future */
+};
+
+enum {
+ SNDRV_PCM_TSTAMP_NONE = 0,
+ SNDRV_PCM_TSTAMP_ENABLE,
+ SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE,
+};
+
+struct snd_pcm_sw_params {
+ int tstamp_mode; /* timestamp mode */
+ unsigned int period_step;
+ unsigned int sleep_min; /* min ticks to sleep */
+ snd_pcm_uframes_t avail_min; /* min avail frames for wakeup */
+ snd_pcm_uframes_t xfer_align; /* obsolete: xfer size need to be a multiple */
+ snd_pcm_uframes_t start_threshold; /* min hw_avail frames for automatic start */
+ snd_pcm_uframes_t stop_threshold; /* min avail frames for automatic stop */
+ snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */
+ snd_pcm_uframes_t silence_size; /* silence block size */
+ snd_pcm_uframes_t boundary; /* pointers wrap point */
+ unsigned char reserved[64]; /* reserved for future */
+};
+
+struct snd_pcm_channel_info {
+ unsigned int channel;
+ __kernel_off_t offset; /* mmap offset */
+ unsigned int first; /* offset to first sample in bits */
+ unsigned int step; /* samples distance in bits */
+};
+
+struct snd_pcm_status {
+ snd_pcm_state_t state; /* stream state */
+ struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */
+ struct timespec tstamp; /* reference timestamp */
+ snd_pcm_uframes_t appl_ptr; /* appl ptr */
+ snd_pcm_uframes_t hw_ptr; /* hw ptr */
+ snd_pcm_sframes_t delay; /* current delay in frames */
+ snd_pcm_uframes_t avail; /* number of frames available */
+ snd_pcm_uframes_t avail_max; /* max frames available on hw since last status */
+ snd_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */
+ snd_pcm_state_t suspended_state; /* suspended stream state */
+ unsigned char reserved[60]; /* must be filled with zero */
+};
+
+struct snd_pcm_mmap_status {
+ snd_pcm_state_t state; /* RO: state - SNDRV_PCM_STATE_XXXX */
+ int pad1; /* Needed for 64 bit alignment */
+ snd_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */
+ struct timespec tstamp; /* Timestamp */
+ snd_pcm_state_t suspended_state; /* RO: suspended stream state */
+};
+
+struct snd_pcm_mmap_control {
+ snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */
+ snd_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */
+};
+
+#define SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0) /* execute hwsync */
+#define SNDRV_PCM_SYNC_PTR_APPL (1<<1) /* get appl_ptr from driver (r/w op) */
+#define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1<<2) /* get avail_min from driver */
+
+struct snd_pcm_sync_ptr {
+ unsigned int flags;
+ union {
+ struct snd_pcm_mmap_status status;
+ unsigned char reserved[64];
+ } s;
+ union {
+ struct snd_pcm_mmap_control control;
+ unsigned char reserved[64];
+ } c;
+};
+
+struct snd_xferi {
+ snd_pcm_sframes_t result;
+ void *buf;
+ snd_pcm_uframes_t frames;
+};
+
+struct snd_xfern {
+ snd_pcm_sframes_t result;
+ void * *bufs;
+ snd_pcm_uframes_t frames;
+};
+
+enum {
+ SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */
+ SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, /* posix_clock_monotonic equivalent */
+ SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
+};
+
+#define SNDRV_PCM_IOCTL_PVERSION _IOR('A', 0x00, int)
+#define SNDRV_PCM_IOCTL_INFO _IOR('A', 0x01, struct snd_pcm_info)
+#define SNDRV_PCM_IOCTL_TSTAMP _IOW('A', 0x02, int)
+#define SNDRV_PCM_IOCTL_TTSTAMP _IOW('A', 0x03, int)
+#define SNDRV_PCM_IOCTL_HW_REFINE _IOWR('A', 0x10, struct snd_pcm_hw_params)
+#define SNDRV_PCM_IOCTL_HW_PARAMS _IOWR('A', 0x11, struct snd_pcm_hw_params)
+#define SNDRV_PCM_IOCTL_HW_FREE _IO('A', 0x12)
+#define SNDRV_PCM_IOCTL_SW_PARAMS _IOWR('A', 0x13, struct snd_pcm_sw_params)
+#define SNDRV_PCM_IOCTL_STATUS _IOR('A', 0x20, struct snd_pcm_status)
+#define SNDRV_PCM_IOCTL_DELAY _IOR('A', 0x21, snd_pcm_sframes_t)
+#define SNDRV_PCM_IOCTL_HWSYNC _IO('A', 0x22)
+#define SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct snd_pcm_sync_ptr)
+#define SNDRV_PCM_IOCTL_CHANNEL_INFO _IOR('A', 0x32, struct snd_pcm_channel_info)
+#define SNDRV_PCM_IOCTL_PREPARE _IO('A', 0x40)
+#define SNDRV_PCM_IOCTL_RESET _IO('A', 0x41)
+#define SNDRV_PCM_IOCTL_START _IO('A', 0x42)
+#define SNDRV_PCM_IOCTL_DROP _IO('A', 0x43)
+#define SNDRV_PCM_IOCTL_DRAIN _IO('A', 0x44)
+#define SNDRV_PCM_IOCTL_PAUSE _IOW('A', 0x45, int)
+#define SNDRV_PCM_IOCTL_REWIND _IOW('A', 0x46, snd_pcm_uframes_t)
+#define SNDRV_PCM_IOCTL_RESUME _IO('A', 0x47)
+#define SNDRV_PCM_IOCTL_XRUN _IO('A', 0x48)
+#define SNDRV_PCM_IOCTL_FORWARD _IOW('A', 0x49, snd_pcm_uframes_t)
+#define SNDRV_PCM_IOCTL_WRITEI_FRAMES _IOW('A', 0x50, struct snd_xferi)
+#define SNDRV_PCM_IOCTL_READI_FRAMES _IOR('A', 0x51, struct snd_xferi)
+#define SNDRV_PCM_IOCTL_WRITEN_FRAMES _IOW('A', 0x52, struct snd_xfern)
+#define SNDRV_PCM_IOCTL_READN_FRAMES _IOR('A', 0x53, struct snd_xfern)
+#define SNDRV_PCM_IOCTL_LINK _IOW('A', 0x60, int)
+#define SNDRV_PCM_IOCTL_UNLINK _IO('A', 0x61)
+
+/*****************************************************************************
+ * *
+ * MIDI v1.0 interface *
+ * *
+ *****************************************************************************/
+
+/*
+ * Raw MIDI section - /dev/snd/midi??
+ */
+
+#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0)
+
+enum {
+ SNDRV_RAWMIDI_STREAM_OUTPUT = 0,
+ SNDRV_RAWMIDI_STREAM_INPUT,
+ SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT,
+};
+
+#define SNDRV_RAWMIDI_INFO_OUTPUT 0x00000001
+#define SNDRV_RAWMIDI_INFO_INPUT 0x00000002
+#define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004
+
+struct snd_rawmidi_info {
+ unsigned int device; /* RO/WR (control): device number */
+ unsigned int subdevice; /* RO/WR (control): subdevice number */
+ int stream; /* WR: stream */
+ int card; /* R: card number */
+ unsigned int flags; /* SNDRV_RAWMIDI_INFO_XXXX */
+ unsigned char id[64]; /* ID (user selectable) */
+ unsigned char name[80]; /* name of device */
+ unsigned char subname[32]; /* name of active or selected subdevice */
+ unsigned int subdevices_count;
+ unsigned int subdevices_avail;
+ unsigned char reserved[64]; /* reserved for future use */
+};
+
+struct snd_rawmidi_params {
+ int stream;
+ size_t buffer_size; /* queue size in bytes */
+ size_t avail_min; /* minimum avail bytes for wakeup */
+ unsigned int no_active_sensing: 1; /* do not send active sensing byte in close() */
+ unsigned char reserved[16]; /* reserved for future use */
+};
+
+struct snd_rawmidi_status {
+ int stream;
+ struct timespec tstamp; /* Timestamp */
+ size_t avail; /* available bytes */
+ size_t xruns; /* count of overruns since last status (in bytes) */
+ unsigned char reserved[16]; /* reserved for future use */
+};
+
+#define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int)
+#define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info)
+#define SNDRV_RAWMIDI_IOCTL_PARAMS _IOWR('W', 0x10, struct snd_rawmidi_params)
+#define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct snd_rawmidi_status)
+#define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int)
+#define SNDRV_RAWMIDI_IOCTL_DRAIN _IOW('W', 0x31, int)
+
+/*
+ * Timer section - /dev/snd/timer
+ */
+
+#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5)
+
+enum {
+ SNDRV_TIMER_CLASS_NONE = -1,
+ SNDRV_TIMER_CLASS_SLAVE = 0,
+ SNDRV_TIMER_CLASS_GLOBAL,
+ SNDRV_TIMER_CLASS_CARD,
+ SNDRV_TIMER_CLASS_PCM,
+ SNDRV_TIMER_CLASS_LAST = SNDRV_TIMER_CLASS_PCM,
+};
+
+/* slave timer classes */
+enum {
+ SNDRV_TIMER_SCLASS_NONE = 0,
+ SNDRV_TIMER_SCLASS_APPLICATION,
+ SNDRV_TIMER_SCLASS_SEQUENCER, /* alias */
+ SNDRV_TIMER_SCLASS_OSS_SEQUENCER, /* alias */
+ SNDRV_TIMER_SCLASS_LAST = SNDRV_TIMER_SCLASS_OSS_SEQUENCER,
+};
+
+/* global timers (device member) */
+#define SNDRV_TIMER_GLOBAL_SYSTEM 0
+#define SNDRV_TIMER_GLOBAL_RTC 1
+#define SNDRV_TIMER_GLOBAL_HPET 2
+#define SNDRV_TIMER_GLOBAL_HRTIMER 3
+
+/* info flags */
+#define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */
+
+struct snd_timer_id {
+ int dev_class;
+ int dev_sclass;
+ int card;
+ int device;
+ int subdevice;
+};
+
+struct snd_timer_ginfo {
+ struct snd_timer_id tid; /* requested timer ID */
+ unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */
+ int card; /* card number */
+ unsigned char id[64]; /* timer identification */
+ unsigned char name[80]; /* timer name */
+ unsigned long reserved0; /* reserved for future use */
+ unsigned long resolution; /* average period resolution in ns */
+ unsigned long resolution_min; /* minimal period resolution in ns */
+ unsigned long resolution_max; /* maximal period resolution in ns */
+ unsigned int clients; /* active timer clients */
+ unsigned char reserved[32];
+};
+
+struct snd_timer_gparams {
+ struct snd_timer_id tid; /* requested timer ID */
+ unsigned long period_num; /* requested precise period duration (in seconds) - numerator */
+ unsigned long period_den; /* requested precise period duration (in seconds) - denominator */
+ unsigned char reserved[32];
+};
+
+struct snd_timer_gstatus {
+ struct snd_timer_id tid; /* requested timer ID */
+ unsigned long resolution; /* current period resolution in ns */
+ unsigned long resolution_num; /* precise current period resolution (in seconds) - numerator */
+ unsigned long resolution_den; /* precise current period resolution (in seconds) - denominator */
+ unsigned char reserved[32];
+};
+
+struct snd_timer_select {
+ struct snd_timer_id id; /* bind to timer ID */
+ unsigned char reserved[32]; /* reserved */
+};
+
+struct snd_timer_info {
+ unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */
+ int card; /* card number */
+ unsigned char id[64]; /* timer identificator */
+ unsigned char name[80]; /* timer name */
+ unsigned long reserved0; /* reserved for future use */
+ unsigned long resolution; /* average period resolution in ns */
+ unsigned char reserved[64]; /* reserved */
+};
+
+#define SNDRV_TIMER_PSFLG_AUTO (1<<0) /* auto start, otherwise one-shot */
+#define SNDRV_TIMER_PSFLG_EXCLUSIVE (1<<1) /* exclusive use, precise start/stop/pause/continue */
+#define SNDRV_TIMER_PSFLG_EARLY_EVENT (1<<2) /* write early event to the poll queue */
+
+struct snd_timer_params {
+ unsigned int flags; /* flags - SNDRV_MIXER_PSFLG_* */
+ unsigned int ticks; /* requested resolution in ticks */
+ unsigned int queue_size; /* total size of queue (32-1024) */
+ unsigned int reserved0; /* reserved, was: failure locations */
+ unsigned int filter; /* event filter (bitmask of SNDRV_TIMER_EVENT_*) */
+ unsigned char reserved[60]; /* reserved */
+};
+
+struct snd_timer_status {
+ struct timespec tstamp; /* Timestamp - last update */
+ unsigned int resolution; /* current period resolution in ns */
+ unsigned int lost; /* counter of master tick lost */
+ unsigned int overrun; /* count of read queue overruns */
+ unsigned int queue; /* used queue size */
+ unsigned char reserved[64]; /* reserved */
+};
+
+#define SNDRV_TIMER_IOCTL_PVERSION _IOR('T', 0x00, int)
+#define SNDRV_TIMER_IOCTL_NEXT_DEVICE _IOWR('T', 0x01, struct snd_timer_id)
+#define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x02, int)
+#define SNDRV_TIMER_IOCTL_GINFO _IOWR('T', 0x03, struct snd_timer_ginfo)
+#define SNDRV_TIMER_IOCTL_GPARAMS _IOW('T', 0x04, struct snd_timer_gparams)
+#define SNDRV_TIMER_IOCTL_GSTATUS _IOWR('T', 0x05, struct snd_timer_gstatus)
+#define SNDRV_TIMER_IOCTL_SELECT _IOW('T', 0x10, struct snd_timer_select)
+#define SNDRV_TIMER_IOCTL_INFO _IOR('T', 0x11, struct snd_timer_info)
+#define SNDRV_TIMER_IOCTL_PARAMS _IOW('T', 0x12, struct snd_timer_params)
+#define SNDRV_TIMER_IOCTL_STATUS _IOR('T', 0x14, struct snd_timer_status)
+/* The following four ioctls are changed since 1.0.9 due to confliction */
+#define SNDRV_TIMER_IOCTL_START _IO('T', 0xa0)
+#define SNDRV_TIMER_IOCTL_STOP _IO('T', 0xa1)
+#define SNDRV_TIMER_IOCTL_CONTINUE _IO('T', 0xa2)
+#define SNDRV_TIMER_IOCTL_PAUSE _IO('T', 0xa3)
+
+struct snd_timer_read {
+ unsigned int resolution;
+ unsigned int ticks;
+};
+
+enum {
+ SNDRV_TIMER_EVENT_RESOLUTION = 0, /* val = resolution in ns */
+ SNDRV_TIMER_EVENT_TICK, /* val = ticks */
+ SNDRV_TIMER_EVENT_START, /* val = resolution in ns */
+ SNDRV_TIMER_EVENT_STOP, /* val = 0 */
+ SNDRV_TIMER_EVENT_CONTINUE, /* val = resolution in ns */
+ SNDRV_TIMER_EVENT_PAUSE, /* val = 0 */
+ SNDRV_TIMER_EVENT_EARLY, /* val = 0, early event */
+ SNDRV_TIMER_EVENT_SUSPEND, /* val = 0 */
+ SNDRV_TIMER_EVENT_RESUME, /* val = resolution in ns */
+ /* master timer events for slave timer instances */
+ SNDRV_TIMER_EVENT_MSTART = SNDRV_TIMER_EVENT_START + 10,
+ SNDRV_TIMER_EVENT_MSTOP = SNDRV_TIMER_EVENT_STOP + 10,
+ SNDRV_TIMER_EVENT_MCONTINUE = SNDRV_TIMER_EVENT_CONTINUE + 10,
+ SNDRV_TIMER_EVENT_MPAUSE = SNDRV_TIMER_EVENT_PAUSE + 10,
+ SNDRV_TIMER_EVENT_MSUSPEND = SNDRV_TIMER_EVENT_SUSPEND + 10,
+ SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10,
+};
+
+struct snd_timer_tread {
+ int event;
+ struct timespec tstamp;
+ unsigned int val;
+};
+
+/****************************************************************************
+ * *
+ * Section for driver control interface - /dev/snd/control? *
+ * *
+ ****************************************************************************/
+
+#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6)
+
+struct snd_ctl_card_info {
+ int card; /* card number */
+ int pad; /* reserved for future (was type) */
+ unsigned char id[16]; /* ID of card (user selectable) */
+ unsigned char driver[16]; /* Driver name */
+ unsigned char name[32]; /* Short name of soundcard */
+ unsigned char longname[80]; /* name + info text about soundcard */
+ unsigned char reserved_[16]; /* reserved for future (was ID of mixer) */
+ unsigned char mixername[80]; /* visual mixer identification */
+ unsigned char components[128]; /* card components / fine identification, delimited with one space (AC97 etc..) */
+};
+
+typedef int __bitwise snd_ctl_elem_type_t;
+#define SNDRV_CTL_ELEM_TYPE_NONE ((snd_ctl_elem_type_t) 0) /* invalid */
+#define SNDRV_CTL_ELEM_TYPE_BOOLEAN ((snd_ctl_elem_type_t) 1) /* boolean type */
+#define SNDRV_CTL_ELEM_TYPE_INTEGER ((snd_ctl_elem_type_t) 2) /* integer type */
+#define SNDRV_CTL_ELEM_TYPE_ENUMERATED ((snd_ctl_elem_type_t) 3) /* enumerated type */
+#define SNDRV_CTL_ELEM_TYPE_BYTES ((snd_ctl_elem_type_t) 4) /* byte array */
+#define SNDRV_CTL_ELEM_TYPE_IEC958 ((snd_ctl_elem_type_t) 5) /* IEC958 (S/PDIF) setup */
+#define SNDRV_CTL_ELEM_TYPE_INTEGER64 ((snd_ctl_elem_type_t) 6) /* 64-bit integer type */
+#define SNDRV_CTL_ELEM_TYPE_LAST SNDRV_CTL_ELEM_TYPE_INTEGER64
+
+typedef int __bitwise snd_ctl_elem_iface_t;
+#define SNDRV_CTL_ELEM_IFACE_CARD ((snd_ctl_elem_iface_t) 0) /* global control */
+#define SNDRV_CTL_ELEM_IFACE_HWDEP ((snd_ctl_elem_iface_t) 1) /* hardware dependent device */
+#define SNDRV_CTL_ELEM_IFACE_MIXER ((snd_ctl_elem_iface_t) 2) /* virtual mixer device */
+#define SNDRV_CTL_ELEM_IFACE_PCM ((snd_ctl_elem_iface_t) 3) /* PCM device */
+#define SNDRV_CTL_ELEM_IFACE_RAWMIDI ((snd_ctl_elem_iface_t) 4) /* RawMidi device */
+#define SNDRV_CTL_ELEM_IFACE_TIMER ((snd_ctl_elem_iface_t) 5) /* timer device */
+#define SNDRV_CTL_ELEM_IFACE_SEQUENCER ((snd_ctl_elem_iface_t) 6) /* sequencer client */
+#define SNDRV_CTL_ELEM_IFACE_LAST SNDRV_CTL_ELEM_IFACE_SEQUENCER
+
+#define SNDRV_CTL_ELEM_ACCESS_READ (1<<0)
+#define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1)
+#define SNDRV_CTL_ELEM_ACCESS_READWRITE (SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE)
+#define SNDRV_CTL_ELEM_ACCESS_VOLATILE (1<<2) /* control value may be changed without a notification */
+#define SNDRV_CTL_ELEM_ACCESS_TIMESTAMP (1<<3) /* when was control changed */
+#define SNDRV_CTL_ELEM_ACCESS_TLV_READ (1<<4) /* TLV read is possible */
+#define SNDRV_CTL_ELEM_ACCESS_TLV_WRITE (1<<5) /* TLV write is possible */
+#define SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE (SNDRV_CTL_ELEM_ACCESS_TLV_READ|SNDRV_CTL_ELEM_ACCESS_TLV_WRITE)
+#define SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND (1<<6) /* TLV command is possible */
+#define SNDRV_CTL_ELEM_ACCESS_INACTIVE (1<<8) /* control does actually nothing, but may be updated */
+#define SNDRV_CTL_ELEM_ACCESS_LOCK (1<<9) /* write lock */
+#define SNDRV_CTL_ELEM_ACCESS_OWNER (1<<10) /* write lock owner */
+#define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK (1<<28) /* kernel use a TLV callback */
+#define SNDRV_CTL_ELEM_ACCESS_USER (1<<29) /* user space element */
+/* bits 30 and 31 are obsoleted (for indirect access) */
+
+/* for further details see the ACPI and PCI power management specification */
+#define SNDRV_CTL_POWER_D0 0x0000 /* full On */
+#define SNDRV_CTL_POWER_D1 0x0100 /* partial On */
+#define SNDRV_CTL_POWER_D2 0x0200 /* partial On */
+#define SNDRV_CTL_POWER_D3 0x0300 /* Off */
+#define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000) /* Off, with power */
+#define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001) /* Off, without power */
+
+struct snd_ctl_elem_id {
+ unsigned int numid; /* numeric identifier, zero = invalid */
+ snd_ctl_elem_iface_t iface; /* interface identifier */
+ unsigned int device; /* device/client number */
+ unsigned int subdevice; /* subdevice (substream) number */
+ unsigned char name[44]; /* ASCII name of item */
+ unsigned int index; /* index of item */
+};
+
+struct snd_ctl_elem_list {
+ unsigned int offset; /* W: first element ID to get */
+ unsigned int space; /* W: count of element IDs to get */
+ unsigned int used; /* R: count of element IDs set */
+ unsigned int count; /* R: count of all elements */
+ struct snd_ctl_elem_id *pids; /* R: IDs */
+ unsigned char reserved[50];
+};
+
+struct snd_ctl_elem_info {
+ struct snd_ctl_elem_id id; /* W: element ID */
+ snd_ctl_elem_type_t type; /* R: value type - SNDRV_CTL_ELEM_TYPE_* */
+ unsigned int access; /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */
+ unsigned int count; /* count of values */
+ __kernel_pid_t owner; /* owner's PID of this control */
+ union {
+ struct {
+ long min; /* R: minimum value */
+ long max; /* R: maximum value */
+ long step; /* R: step (0 variable) */
+ } integer;
+ struct {
+ long long min; /* R: minimum value */
+ long long max; /* R: maximum value */
+ long long step; /* R: step (0 variable) */
+ } integer64;
+ struct {
+ unsigned int items; /* R: number of items */
+ unsigned int item; /* W: item number */
+ char name[64]; /* R: value name */
+ } enumerated;
+ unsigned char reserved[128];
+ } value;
+ union {
+ unsigned short d[4]; /* dimensions */
+ unsigned short *d_ptr; /* indirect - obsoleted */
+ } dimen;
+ unsigned char reserved[64-4*sizeof(unsigned short)];
+};
+
+struct snd_ctl_elem_value {
+ struct snd_ctl_elem_id id; /* W: element ID */
+ unsigned int indirect: 1; /* W: indirect access - obsoleted */
+ union {
+ union {
+ long value[128];
+ long *value_ptr; /* obsoleted */
+ } integer;
+ union {
+ long long value[64];
+ long long *value_ptr; /* obsoleted */
+ } integer64;
+ union {
+ unsigned int item[128];
+ unsigned int *item_ptr; /* obsoleted */
+ } enumerated;
+ union {
+ unsigned char data[512];
+ unsigned char *data_ptr; /* obsoleted */
+ } bytes;
+ struct snd_aes_iec958 iec958;
+ } value; /* RO */
+ struct timespec tstamp;
+ unsigned char reserved[128-sizeof(struct timespec)];
+};
+
+struct snd_ctl_tlv {
+ unsigned int numid; /* control element numeric identification */
+ unsigned int length; /* in bytes aligned to 4 */
+ unsigned int tlv[0]; /* first TLV */
+};
+
+#define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int)
+#define SNDRV_CTL_IOCTL_CARD_INFO _IOR('U', 0x01, struct snd_ctl_card_info)
+#define SNDRV_CTL_IOCTL_ELEM_LIST _IOWR('U', 0x10, struct snd_ctl_elem_list)
+#define SNDRV_CTL_IOCTL_ELEM_INFO _IOWR('U', 0x11, struct snd_ctl_elem_info)
+#define SNDRV_CTL_IOCTL_ELEM_READ _IOWR('U', 0x12, struct snd_ctl_elem_value)
+#define SNDRV_CTL_IOCTL_ELEM_WRITE _IOWR('U', 0x13, struct snd_ctl_elem_value)
+#define SNDRV_CTL_IOCTL_ELEM_LOCK _IOW('U', 0x14, struct snd_ctl_elem_id)
+#define SNDRV_CTL_IOCTL_ELEM_UNLOCK _IOW('U', 0x15, struct snd_ctl_elem_id)
+#define SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS _IOWR('U', 0x16, int)
+#define SNDRV_CTL_IOCTL_ELEM_ADD _IOWR('U', 0x17, struct snd_ctl_elem_info)
+#define SNDRV_CTL_IOCTL_ELEM_REPLACE _IOWR('U', 0x18, struct snd_ctl_elem_info)
+#define SNDRV_CTL_IOCTL_ELEM_REMOVE _IOWR('U', 0x19, struct snd_ctl_elem_id)
+#define SNDRV_CTL_IOCTL_TLV_READ _IOWR('U', 0x1a, struct snd_ctl_tlv)
+#define SNDRV_CTL_IOCTL_TLV_WRITE _IOWR('U', 0x1b, struct snd_ctl_tlv)
+#define SNDRV_CTL_IOCTL_TLV_COMMAND _IOWR('U', 0x1c, struct snd_ctl_tlv)
+#define SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE _IOWR('U', 0x20, int)
+#define SNDRV_CTL_IOCTL_HWDEP_INFO _IOR('U', 0x21, struct snd_hwdep_info)
+#define SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE _IOR('U', 0x30, int)
+#define SNDRV_CTL_IOCTL_PCM_INFO _IOWR('U', 0x31, struct snd_pcm_info)
+#define SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE _IOW('U', 0x32, int)
+#define SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE _IOWR('U', 0x40, int)
+#define SNDRV_CTL_IOCTL_RAWMIDI_INFO _IOWR('U', 0x41, struct snd_rawmidi_info)
+#define SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE _IOW('U', 0x42, int)
+#define SNDRV_CTL_IOCTL_POWER _IOWR('U', 0xd0, int)
+#define SNDRV_CTL_IOCTL_POWER_STATE _IOR('U', 0xd1, int)
+
+/*
+ * Read interface.
+ */
+
+enum sndrv_ctl_event_type {
+ SNDRV_CTL_EVENT_ELEM = 0,
+ SNDRV_CTL_EVENT_LAST = SNDRV_CTL_EVENT_ELEM,
+};
+
+#define SNDRV_CTL_EVENT_MASK_VALUE (1<<0) /* element value was changed */
+#define SNDRV_CTL_EVENT_MASK_INFO (1<<1) /* element info was changed */
+#define SNDRV_CTL_EVENT_MASK_ADD (1<<2) /* element was added */
+#define SNDRV_CTL_EVENT_MASK_TLV (1<<3) /* element TLV tree was changed */
+#define SNDRV_CTL_EVENT_MASK_REMOVE (~0U) /* element was removed */
+
+struct snd_ctl_event {
+ int type; /* event type - SNDRV_CTL_EVENT_* */
+ union {
+ struct {
+ unsigned int mask;
+ struct snd_ctl_elem_id id;
+ } elem;
+ unsigned char data8[60];
+ } data;
+};
+
+/*
+ * Control names
+ */
+
+#define SNDRV_CTL_NAME_NONE ""
+#define SNDRV_CTL_NAME_PLAYBACK "Playback "
+#define SNDRV_CTL_NAME_CAPTURE "Capture "
+
+#define SNDRV_CTL_NAME_IEC958_NONE ""
+#define SNDRV_CTL_NAME_IEC958_SWITCH "Switch"
+#define SNDRV_CTL_NAME_IEC958_VOLUME "Volume"
+#define SNDRV_CTL_NAME_IEC958_DEFAULT "Default"
+#define SNDRV_CTL_NAME_IEC958_MASK "Mask"
+#define SNDRV_CTL_NAME_IEC958_CON_MASK "Con Mask"
+#define SNDRV_CTL_NAME_IEC958_PRO_MASK "Pro Mask"
+#define SNDRV_CTL_NAME_IEC958_PCM_STREAM "PCM Stream"
+#define SNDRV_CTL_NAME_IEC958(expl,direction,what) "IEC958 " expl SNDRV_CTL_NAME_##direction SNDRV_CTL_NAME_IEC958_##what
+
+#endif /* __SOUND_ASOUND_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/asound_fm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/asound_fm.h
new file mode 100644
index 0000000..c2a4b96
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/asound_fm.h
@@ -0,0 +1,134 @@
+#ifndef __SOUND_ASOUND_FM_H
+#define __SOUND_ASOUND_FM_H
+
+/*
+ * Advanced Linux Sound Architecture - ALSA
+ *
+ * Interface file between ALSA driver & user space
+ * Copyright (c) 1994-98 by Jaroslav Kysela <perex@perex.cz>,
+ * 4Front Technologies
+ *
+ * Direct FM control
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#define SNDRV_DM_FM_MODE_OPL2 0x00
+#define SNDRV_DM_FM_MODE_OPL3 0x01
+
+struct snd_dm_fm_info {
+ unsigned char fm_mode; /* OPL mode, see SNDRV_DM_FM_MODE_XXX */
+ unsigned char rhythm; /* percussion mode flag */
+};
+
+/*
+ * Data structure composing an FM "note" or sound event.
+ */
+
+struct snd_dm_fm_voice {
+ unsigned char op; /* operator cell (0 or 1) */
+ unsigned char voice; /* FM voice (0 to 17) */
+
+ unsigned char am; /* amplitude modulation */
+ unsigned char vibrato; /* vibrato effect */
+ unsigned char do_sustain; /* sustain phase */
+ unsigned char kbd_scale; /* keyboard scaling */
+ unsigned char harmonic; /* 4 bits: harmonic and multiplier */
+ unsigned char scale_level; /* 2 bits: decrease output freq rises */
+ unsigned char volume; /* 6 bits: volume */
+
+ unsigned char attack; /* 4 bits: attack rate */
+ unsigned char decay; /* 4 bits: decay rate */
+ unsigned char sustain; /* 4 bits: sustain level */
+ unsigned char release; /* 4 bits: release rate */
+
+ unsigned char feedback; /* 3 bits: feedback for op0 */
+ unsigned char connection; /* 0 for serial, 1 for parallel */
+ unsigned char left; /* stereo left */
+ unsigned char right; /* stereo right */
+ unsigned char waveform; /* 3 bits: waveform shape */
+};
+
+/*
+ * This describes an FM note by its voice, octave, frequency number (10bit)
+ * and key on/off.
+ */
+
+struct snd_dm_fm_note {
+ unsigned char voice; /* 0-17 voice channel */
+ unsigned char octave; /* 3 bits: what octave to play */
+ unsigned int fnum; /* 10 bits: frequency number */
+ unsigned char key_on; /* set for active, clear for silent */
+};
+
+/*
+ * FM parameters that apply globally to all voices, and thus are not "notes"
+ */
+
+struct snd_dm_fm_params {
+ unsigned char am_depth; /* amplitude modulation depth (1=hi) */
+ unsigned char vib_depth; /* vibrato depth (1=hi) */
+ unsigned char kbd_split; /* keyboard split */
+ unsigned char rhythm; /* percussion mode select */
+
+ /* This block is the percussion instrument data */
+ unsigned char bass;
+ unsigned char snare;
+ unsigned char tomtom;
+ unsigned char cymbal;
+ unsigned char hihat;
+};
+
+/*
+ * FM mode ioctl settings
+ */
+
+#define SNDRV_DM_FM_IOCTL_INFO _IOR('H', 0x20, struct snd_dm_fm_info)
+#define SNDRV_DM_FM_IOCTL_RESET _IO ('H', 0x21)
+#define SNDRV_DM_FM_IOCTL_PLAY_NOTE _IOW('H', 0x22, struct snd_dm_fm_note)
+#define SNDRV_DM_FM_IOCTL_SET_VOICE _IOW('H', 0x23, struct snd_dm_fm_voice)
+#define SNDRV_DM_FM_IOCTL_SET_PARAMS _IOW('H', 0x24, struct snd_dm_fm_params)
+#define SNDRV_DM_FM_IOCTL_SET_MODE _IOW('H', 0x25, int)
+/* for OPL3 only */
+#define SNDRV_DM_FM_IOCTL_SET_CONNECTION _IOW('H', 0x26, int)
+/* SBI patch management */
+#define SNDRV_DM_FM_IOCTL_CLEAR_PATCHES _IO ('H', 0x40)
+
+#define SNDRV_DM_FM_OSS_IOCTL_RESET 0x20
+#define SNDRV_DM_FM_OSS_IOCTL_PLAY_NOTE 0x21
+#define SNDRV_DM_FM_OSS_IOCTL_SET_VOICE 0x22
+#define SNDRV_DM_FM_OSS_IOCTL_SET_PARAMS 0x23
+#define SNDRV_DM_FM_OSS_IOCTL_SET_MODE 0x24
+#define SNDRV_DM_FM_OSS_IOCTL_SET_OPL 0x25
+
+/*
+ * Patch Record - fixed size for write
+ */
+
+#define FM_KEY_SBI "SBI\032"
+#define FM_KEY_2OP "2OP\032"
+#define FM_KEY_4OP "4OP\032"
+
+struct sbi_patch {
+ unsigned char prog;
+ unsigned char bank;
+ char key[4];
+ char name[25];
+ char extension[7];
+ unsigned char data[32];
+};
+
+#endif /* __SOUND_ASOUND_FM_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/emu10k1.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/emu10k1.h
new file mode 100644
index 0000000..3524a84
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/emu10k1.h
@@ -0,0 +1,371 @@
+#ifndef __SOUND_EMU10K1_H
+#define __SOUND_EMU10K1_H
+
+#include <linux/types.h>
+
+/*
+ * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
+ * Creative Labs, Inc.
+ * Definitions for EMU10K1 (SB Live!) chips
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+
+/*
+ * ---- FX8010 ----
+ */
+
+#define EMU10K1_CARD_CREATIVE 0x00000000
+#define EMU10K1_CARD_EMUAPS 0x00000001
+
+#define EMU10K1_FX8010_PCM_COUNT 8
+
+/* instruction set */
+#define iMAC0 0x00 /* R = A + (X * Y >> 31) ; saturation */
+#define iMAC1 0x01 /* R = A + (-X * Y >> 31) ; saturation */
+#define iMAC2 0x02 /* R = A + (X * Y >> 31) ; wraparound */
+#define iMAC3 0x03 /* R = A + (-X * Y >> 31) ; wraparound */
+#define iMACINT0 0x04 /* R = A + X * Y ; saturation */
+#define iMACINT1 0x05 /* R = A + X * Y ; wraparound (31-bit) */
+#define iACC3 0x06 /* R = A + X + Y ; saturation */
+#define iMACMV 0x07 /* R = A, acc += X * Y >> 31 */
+#define iANDXOR 0x08 /* R = (A & X) ^ Y */
+#define iTSTNEG 0x09 /* R = (A >= Y) ? X : ~X */
+#define iLIMITGE 0x0a /* R = (A >= Y) ? X : Y */
+#define iLIMITLT 0x0b /* R = (A < Y) ? X : Y */
+#define iLOG 0x0c /* R = linear_data, A (log_data), X (max_exp), Y (format_word) */
+#define iEXP 0x0d /* R = log_data, A (linear_data), X (max_exp), Y (format_word) */
+#define iINTERP 0x0e /* R = A + (X * (Y - A) >> 31) ; saturation */
+#define iSKIP 0x0f /* R = A (cc_reg), X (count), Y (cc_test) */
+
+/* GPRs */
+#define FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x0f */
+#define EXTIN(x) (0x10 + (x)) /* x = 0x00 - 0x0f */
+#define EXTOUT(x) (0x20 + (x)) /* x = 0x00 - 0x0f physical outs -> FXWC low 16 bits */
+#define FXBUS2(x) (0x30 + (x)) /* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */
+ /* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */
+
+#define C_00000000 0x40
+#define C_00000001 0x41
+#define C_00000002 0x42
+#define C_00000003 0x43
+#define C_00000004 0x44
+#define C_00000008 0x45
+#define C_00000010 0x46
+#define C_00000020 0x47
+#define C_00000100 0x48
+#define C_00010000 0x49
+#define C_00080000 0x4a
+#define C_10000000 0x4b
+#define C_20000000 0x4c
+#define C_40000000 0x4d
+#define C_80000000 0x4e
+#define C_7fffffff 0x4f
+#define C_ffffffff 0x50
+#define C_fffffffe 0x51
+#define C_c0000000 0x52
+#define C_4f1bbcdc 0x53
+#define C_5a7ef9db 0x54
+#define C_00100000 0x55 /* ?? */
+#define GPR_ACCU 0x56 /* ACCUM, accumulator */
+#define GPR_COND 0x57 /* CCR, condition register */
+#define GPR_NOISE0 0x58 /* noise source */
+#define GPR_NOISE1 0x59 /* noise source */
+#define GPR_IRQ 0x5a /* IRQ register */
+#define GPR_DBAC 0x5b /* TRAM Delay Base Address Counter */
+#define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */
+#define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
+#define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
+#define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
+#define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
+
+#define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
+#define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
+#define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
+#define A_ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
+#define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
+#define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
+
+#define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f FX buses */
+#define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x0f physical ins */
+#define A_P16VIN(x) (0x50 + (x)) /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */
+#define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown */
+#define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */
+#define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */
+#define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */
+#define A3_EMU32IN(x) (0x160 + (x)) /* x = 0x00 - 0x3f "EMU32_IN_00 - _3F" - Only when .device = 0x0008 */
+#define A3_EMU32OUT(x) (0x1E0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_00 - _3F" - Only when .device = 0x0008 */
+#define A_GPR(x) (A_FXGPREGBASE + (x))
+
+/* cc_reg constants */
+#define CC_REG_NORMALIZED C_00000001
+#define CC_REG_BORROW C_00000002
+#define CC_REG_MINUS C_00000004
+#define CC_REG_ZERO C_00000008
+#define CC_REG_SATURATE C_00000010
+#define CC_REG_NONZERO C_00000100
+
+/* FX buses */
+#define FXBUS_PCM_LEFT 0x00
+#define FXBUS_PCM_RIGHT 0x01
+#define FXBUS_PCM_LEFT_REAR 0x02
+#define FXBUS_PCM_RIGHT_REAR 0x03
+#define FXBUS_MIDI_LEFT 0x04
+#define FXBUS_MIDI_RIGHT 0x05
+#define FXBUS_PCM_CENTER 0x06
+#define FXBUS_PCM_LFE 0x07
+#define FXBUS_PCM_LEFT_FRONT 0x08
+#define FXBUS_PCM_RIGHT_FRONT 0x09
+#define FXBUS_MIDI_REVERB 0x0c
+#define FXBUS_MIDI_CHORUS 0x0d
+#define FXBUS_PCM_LEFT_SIDE 0x0e
+#define FXBUS_PCM_RIGHT_SIDE 0x0f
+#define FXBUS_PT_LEFT 0x14
+#define FXBUS_PT_RIGHT 0x15
+
+/* Inputs */
+#define EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */
+#define EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */
+#define EXTIN_SPDIF_CD_L 0x02 /* internal S/PDIF CD - onboard - left */
+#define EXTIN_SPDIF_CD_R 0x03 /* internal S/PDIF CD - onboard - right */
+#define EXTIN_ZOOM_L 0x04 /* Zoom Video I2S - left */
+#define EXTIN_ZOOM_R 0x05 /* Zoom Video I2S - right */
+#define EXTIN_TOSLINK_L 0x06 /* LiveDrive - TOSLink Optical - left */
+#define EXTIN_TOSLINK_R 0x07 /* LiveDrive - TOSLink Optical - right */
+#define EXTIN_LINE1_L 0x08 /* LiveDrive - Line/Mic 1 - left */
+#define EXTIN_LINE1_R 0x09 /* LiveDrive - Line/Mic 1 - right */
+#define EXTIN_COAX_SPDIF_L 0x0a /* LiveDrive - Coaxial S/PDIF - left */
+#define EXTIN_COAX_SPDIF_R 0x0b /* LiveDrive - Coaxial S/PDIF - right */
+#define EXTIN_LINE2_L 0x0c /* LiveDrive - Line/Mic 2 - left */
+#define EXTIN_LINE2_R 0x0d /* LiveDrive - Line/Mic 2 - right */
+
+/* Outputs */
+#define EXTOUT_AC97_L 0x00 /* AC'97 playback channel - left */
+#define EXTOUT_AC97_R 0x01 /* AC'97 playback channel - right */
+#define EXTOUT_TOSLINK_L 0x02 /* LiveDrive - TOSLink Optical - left */
+#define EXTOUT_TOSLINK_R 0x03 /* LiveDrive - TOSLink Optical - right */
+#define EXTOUT_AC97_CENTER 0x04 /* SB Live 5.1 - center */
+#define EXTOUT_AC97_LFE 0x05 /* SB Live 5.1 - LFE */
+#define EXTOUT_HEADPHONE_L 0x06 /* LiveDrive - Headphone - left */
+#define EXTOUT_HEADPHONE_R 0x07 /* LiveDrive - Headphone - right */
+#define EXTOUT_REAR_L 0x08 /* Rear channel - left */
+#define EXTOUT_REAR_R 0x09 /* Rear channel - right */
+#define EXTOUT_ADC_CAP_L 0x0a /* ADC Capture buffer - left */
+#define EXTOUT_ADC_CAP_R 0x0b /* ADC Capture buffer - right */
+#define EXTOUT_MIC_CAP 0x0c /* MIC Capture buffer */
+#define EXTOUT_AC97_REAR_L 0x0d /* SB Live 5.1 (c) 2003 - Rear Left */
+#define EXTOUT_AC97_REAR_R 0x0e /* SB Live 5.1 (c) 2003 - Rear Right */
+#define EXTOUT_ACENTER 0x11 /* Analog Center */
+#define EXTOUT_ALFE 0x12 /* Analog LFE */
+
+/* Audigy Inputs */
+#define A_EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */
+#define A_EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */
+#define A_EXTIN_SPDIF_CD_L 0x02 /* digital CD left */
+#define A_EXTIN_SPDIF_CD_R 0x03 /* digital CD left */
+#define A_EXTIN_OPT_SPDIF_L 0x04 /* audigy drive Optical SPDIF - left */
+#define A_EXTIN_OPT_SPDIF_R 0x05 /* right */
+#define A_EXTIN_LINE2_L 0x08 /* audigy drive line2/mic2 - left */
+#define A_EXTIN_LINE2_R 0x09 /* right */
+#define A_EXTIN_ADC_L 0x0a /* Philips ADC - left */
+#define A_EXTIN_ADC_R 0x0b /* right */
+#define A_EXTIN_AUX2_L 0x0c /* audigy drive aux2 - left */
+#define A_EXTIN_AUX2_R 0x0d /* - right */
+
+/* Audigiy Outputs */
+#define A_EXTOUT_FRONT_L 0x00 /* digital front left */
+#define A_EXTOUT_FRONT_R 0x01 /* right */
+#define A_EXTOUT_CENTER 0x02 /* digital front center */
+#define A_EXTOUT_LFE 0x03 /* digital front lfe */
+#define A_EXTOUT_HEADPHONE_L 0x04 /* headphone audigy drive left */
+#define A_EXTOUT_HEADPHONE_R 0x05 /* right */
+#define A_EXTOUT_REAR_L 0x06 /* digital rear left */
+#define A_EXTOUT_REAR_R 0x07 /* right */
+#define A_EXTOUT_AFRONT_L 0x08 /* analog front left */
+#define A_EXTOUT_AFRONT_R 0x09 /* right */
+#define A_EXTOUT_ACENTER 0x0a /* analog center */
+#define A_EXTOUT_ALFE 0x0b /* analog LFE */
+#define A_EXTOUT_ASIDE_L 0x0c /* analog side left - Audigy 2 ZS */
+#define A_EXTOUT_ASIDE_R 0x0d /* right - Audigy 2 ZS */
+#define A_EXTOUT_AREAR_L 0x0e /* analog rear left */
+#define A_EXTOUT_AREAR_R 0x0f /* right */
+#define A_EXTOUT_AC97_L 0x10 /* AC97 left (front) */
+#define A_EXTOUT_AC97_R 0x11 /* right */
+#define A_EXTOUT_ADC_CAP_L 0x16 /* ADC capture buffer left */
+#define A_EXTOUT_ADC_CAP_R 0x17 /* right */
+#define A_EXTOUT_MIC_CAP 0x18 /* Mic capture buffer */
+
+/* Audigy constants */
+#define A_C_00000000 0xc0
+#define A_C_00000001 0xc1
+#define A_C_00000002 0xc2
+#define A_C_00000003 0xc3
+#define A_C_00000004 0xc4
+#define A_C_00000008 0xc5
+#define A_C_00000010 0xc6
+#define A_C_00000020 0xc7
+#define A_C_00000100 0xc8
+#define A_C_00010000 0xc9
+#define A_C_00000800 0xca
+#define A_C_10000000 0xcb
+#define A_C_20000000 0xcc
+#define A_C_40000000 0xcd
+#define A_C_80000000 0xce
+#define A_C_7fffffff 0xcf
+#define A_C_ffffffff 0xd0
+#define A_C_fffffffe 0xd1
+#define A_C_c0000000 0xd2
+#define A_C_4f1bbcdc 0xd3
+#define A_C_5a7ef9db 0xd4
+#define A_C_00100000 0xd5
+#define A_GPR_ACCU 0xd6 /* ACCUM, accumulator */
+#define A_GPR_COND 0xd7 /* CCR, condition register */
+#define A_GPR_NOISE0 0xd8 /* noise source */
+#define A_GPR_NOISE1 0xd9 /* noise source */
+#define A_GPR_IRQ 0xda /* IRQ register */
+#define A_GPR_DBAC 0xdb /* TRAM Delay Base Address Counter - internal */
+#define A_GPR_DBACE 0xde /* TRAM Delay Base Address Counter - external */
+
+/* definitions for debug register */
+#define EMU10K1_DBG_ZC 0x80000000 /* zero tram counter */
+#define EMU10K1_DBG_SATURATION_OCCURED 0x02000000 /* saturation control */
+#define EMU10K1_DBG_SATURATION_ADDR 0x01ff0000 /* saturation address */
+#define EMU10K1_DBG_SINGLE_STEP 0x00008000 /* single step mode */
+#define EMU10K1_DBG_STEP 0x00004000 /* start single step */
+#define EMU10K1_DBG_CONDITION_CODE 0x00003e00 /* condition code */
+#define EMU10K1_DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */
+
+/* tank memory address line */
+#define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */
+#define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */
+#define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */
+#define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */
+#define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */
+
+struct snd_emu10k1_fx8010_info {
+ unsigned int internal_tram_size; /* in samples */
+ unsigned int external_tram_size; /* in samples */
+ char fxbus_names[16][32]; /* names of FXBUSes */
+ char extin_names[16][32]; /* names of external inputs */
+ char extout_names[32][32]; /* names of external outputs */
+ unsigned int gpr_controls; /* count of GPR controls */
+};
+
+#define EMU10K1_GPR_TRANSLATION_NONE 0
+#define EMU10K1_GPR_TRANSLATION_TABLE100 1
+#define EMU10K1_GPR_TRANSLATION_BASS 2
+#define EMU10K1_GPR_TRANSLATION_TREBLE 3
+#define EMU10K1_GPR_TRANSLATION_ONOFF 4
+
+struct snd_emu10k1_fx8010_control_gpr {
+ struct snd_ctl_elem_id id; /* full control ID definition */
+ unsigned int vcount; /* visible count */
+ unsigned int count; /* count of GPR (1..16) */
+ unsigned short gpr[32]; /* GPR number(s) */
+ unsigned int value[32]; /* initial values */
+ unsigned int min; /* minimum range */
+ unsigned int max; /* maximum range */
+ unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */
+ const unsigned int *tlv;
+};
+
+/* old ABI without TLV support */
+struct snd_emu10k1_fx8010_control_old_gpr {
+ struct snd_ctl_elem_id id;
+ unsigned int vcount;
+ unsigned int count;
+ unsigned short gpr[32];
+ unsigned int value[32];
+ unsigned int min;
+ unsigned int max;
+ unsigned int translation;
+};
+
+struct snd_emu10k1_fx8010_code {
+ char name[128];
+
+ DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */
+ __u32 *gpr_map; /* initializers */
+
+ unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */
+ struct snd_emu10k1_fx8010_control_gpr *gpr_add_controls; /* GPR controls to add/replace */
+
+ unsigned int gpr_del_control_count; /* count of GPR controls to remove */
+ struct snd_ctl_elem_id *gpr_del_controls; /* IDs of GPR controls to remove */
+
+ unsigned int gpr_list_control_count; /* count of GPR controls to list */
+ unsigned int gpr_list_control_total; /* total count of GPR controls */
+ struct snd_emu10k1_fx8010_control_gpr *gpr_list_controls; /* listed GPR controls */
+
+ DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */
+ __u32 *tram_data_map; /* data initializers */
+ __u32 *tram_addr_map; /* map initializers */
+
+ DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */
+ __u32 *code; /* one instruction - 64 bits */
+};
+
+struct snd_emu10k1_fx8010_tram {
+ unsigned int address; /* 31.bit == 1 -> external TRAM */
+ unsigned int size; /* size in samples (4 bytes) */
+ unsigned int *samples; /* pointer to samples (20-bit) */
+ /* NULL->clear memory */
+};
+
+struct snd_emu10k1_fx8010_pcm_rec {
+ unsigned int substream; /* substream number */
+ unsigned int res1; /* reserved */
+ unsigned int channels; /* 16-bit channels count, zero = remove this substream */
+ unsigned int tram_start; /* ring buffer position in TRAM (in samples) */
+ unsigned int buffer_size; /* count of buffered samples */
+ unsigned short gpr_size; /* GPR containing size of ringbuffer in samples (host) */
+ unsigned short gpr_ptr; /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */
+ unsigned short gpr_count; /* GPR containing count of samples between two interrupts (host) */
+ unsigned short gpr_tmpcount; /* GPR containing current count of samples to interrupt (host = set, FX8010) */
+ unsigned short gpr_trigger; /* GPR containing trigger (activate) information (host) */
+ unsigned short gpr_running; /* GPR containing info if PCM is running (FX8010) */
+ unsigned char pad; /* reserved */
+ unsigned char etram[32]; /* external TRAM address & data (one per channel) */
+ unsigned int res2; /* reserved */
+};
+
+#define SNDRV_EMU10K1_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
+
+#define SNDRV_EMU10K1_IOCTL_INFO _IOR ('H', 0x10, struct snd_emu10k1_fx8010_info)
+#define SNDRV_EMU10K1_IOCTL_CODE_POKE _IOW ('H', 0x11, struct snd_emu10k1_fx8010_code)
+#define SNDRV_EMU10K1_IOCTL_CODE_PEEK _IOWR('H', 0x12, struct snd_emu10k1_fx8010_code)
+#define SNDRV_EMU10K1_IOCTL_TRAM_SETUP _IOW ('H', 0x20, int)
+#define SNDRV_EMU10K1_IOCTL_TRAM_POKE _IOW ('H', 0x21, struct snd_emu10k1_fx8010_tram)
+#define SNDRV_EMU10K1_IOCTL_TRAM_PEEK _IOWR('H', 0x22, struct snd_emu10k1_fx8010_tram)
+#define SNDRV_EMU10K1_IOCTL_PCM_POKE _IOW ('H', 0x30, struct snd_emu10k1_fx8010_pcm_rec)
+#define SNDRV_EMU10K1_IOCTL_PCM_PEEK _IOWR('H', 0x31, struct snd_emu10k1_fx8010_pcm_rec)
+#define SNDRV_EMU10K1_IOCTL_PVERSION _IOR ('H', 0x40, int)
+#define SNDRV_EMU10K1_IOCTL_STOP _IO ('H', 0x80)
+#define SNDRV_EMU10K1_IOCTL_CONTINUE _IO ('H', 0x81)
+#define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER _IO ('H', 0x82)
+#define SNDRV_EMU10K1_IOCTL_SINGLE_STEP _IOW ('H', 0x83, int)
+#define SNDRV_EMU10K1_IOCTL_DBG_READ _IOR ('H', 0x84, int)
+
+/* typedefs for compatibility to user-space */
+typedef struct snd_emu10k1_fx8010_info emu10k1_fx8010_info_t;
+typedef struct snd_emu10k1_fx8010_control_gpr emu10k1_fx8010_control_gpr_t;
+typedef struct snd_emu10k1_fx8010_code emu10k1_fx8010_code_t;
+typedef struct snd_emu10k1_fx8010_tram emu10k1_fx8010_tram_t;
+typedef struct snd_emu10k1_fx8010_pcm_rec emu10k1_fx8010_pcm_t;
+
+#endif /* __SOUND_EMU10K1_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/hdsp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/hdsp.h
new file mode 100644
index 0000000..ec6fa56
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/hdsp.h
@@ -0,0 +1,109 @@
+#ifndef __SOUND_HDSP_H
+#define __SOUND_HDSP_H
+
+/*
+ * Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/types.h>
+
+#define HDSP_MATRIX_MIXER_SIZE 2048
+
+enum HDSP_IO_Type {
+ Digiface,
+ Multiface,
+ H9652,
+ H9632,
+ Undefined,
+};
+
+struct hdsp_peak_rms {
+ __u32 input_peaks[26];
+ __u32 playback_peaks[26];
+ __u32 output_peaks[28];
+ __u64 input_rms[26];
+ __u64 playback_rms[26];
+ /* These are only used for H96xx cards */
+ __u64 output_rms[26];
+};
+
+#define SNDRV_HDSP_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct hdsp_peak_rms)
+
+struct hdsp_config_info {
+ unsigned char pref_sync_ref;
+ unsigned char wordclock_sync_check;
+ unsigned char spdif_sync_check;
+ unsigned char adatsync_sync_check;
+ unsigned char adat_sync_check[3];
+ unsigned char spdif_in;
+ unsigned char spdif_out;
+ unsigned char spdif_professional;
+ unsigned char spdif_emphasis;
+ unsigned char spdif_nonaudio;
+ unsigned int spdif_sample_rate;
+ unsigned int system_sample_rate;
+ unsigned int autosync_sample_rate;
+ unsigned char system_clock_mode;
+ unsigned char clock_source;
+ unsigned char autosync_ref;
+ unsigned char line_out;
+ unsigned char passthru;
+ unsigned char da_gain;
+ unsigned char ad_gain;
+ unsigned char phone_gain;
+ unsigned char xlr_breakout_cable;
+ unsigned char analog_extension_board;
+};
+
+#define SNDRV_HDSP_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, struct hdsp_config_info)
+
+struct hdsp_firmware {
+ void *firmware_data; /* 24413 x 4 bytes */
+};
+
+#define SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE _IOW('H', 0x42, struct hdsp_firmware)
+
+struct hdsp_version {
+ enum HDSP_IO_Type io_type;
+ unsigned short firmware_rev;
+};
+
+#define SNDRV_HDSP_IOCTL_GET_VERSION _IOR('H', 0x43, struct hdsp_version)
+
+struct hdsp_mixer {
+ unsigned short matrix[HDSP_MATRIX_MIXER_SIZE];
+};
+
+#define SNDRV_HDSP_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdsp_mixer)
+
+struct hdsp_9632_aeb {
+ int aebi;
+ int aebo;
+};
+
+#define SNDRV_HDSP_IOCTL_GET_9632_AEB _IOR('H', 0x45, struct hdsp_9632_aeb)
+
+/* typedefs for compatibility to user-space */
+typedef enum HDSP_IO_Type HDSP_IO_Type;
+typedef struct hdsp_peak_rms hdsp_peak_rms_t;
+typedef struct hdsp_config_info hdsp_config_info_t;
+typedef struct hdsp_firmware hdsp_firmware_t;
+typedef struct hdsp_version hdsp_version_t;
+typedef struct hdsp_mixer hdsp_mixer_t;
+typedef struct hdsp_9632_aeb hdsp_9632_aeb_t;
+
+#endif /* __SOUND_HDSP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/hdspm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/hdspm.h
new file mode 100644
index 0000000..81990b2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/hdspm.h
@@ -0,0 +1,134 @@
+#ifndef __SOUND_HDSPM_H
+#define __SOUND_HDSPM_H
+/*
+ * Copyright (C) 2003 Winfried Ritsch (IEM)
+ * based on hdsp.h from Thomas Charbonnel (thomas@undata.org)
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */
+#define HDSPM_MAX_CHANNELS 64
+
+/* -------------------- IOCTL Peak/RMS Meters -------------------- */
+
+/* peam rms level structure like we get from hardware
+
+ maybe in future we can memory map it so I just copy it
+ to user on ioctl call now an dont change anything
+ rms are made out of low and high values
+ where (long) ????_rms = (????_rms_l >> 8) + ((????_rms_h & 0xFFFFFF00)<<24)
+ (i asume so from the code)
+*/
+
+struct hdspm_peak_rms {
+
+ unsigned int level_offset[1024];
+
+ unsigned int input_peak[64];
+ unsigned int playback_peak[64];
+ unsigned int output_peak[64];
+ unsigned int xxx_peak[64]; /* not used */
+
+ unsigned int reserved[256]; /* not used */
+
+ unsigned int input_rms_l[64];
+ unsigned int playback_rms_l[64];
+ unsigned int output_rms_l[64];
+ unsigned int xxx_rms_l[64]; /* not used */
+
+ unsigned int input_rms_h[64];
+ unsigned int playback_rms_h[64];
+ unsigned int output_rms_h[64];
+ unsigned int xxx_rms_h[64]; /* not used */
+};
+
+struct hdspm_peak_rms_ioctl {
+ struct hdspm_peak_rms *peak;
+};
+
+/* use indirect access due to the limit of ioctl bit size */
+#define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \
+ _IOR('H', 0x40, struct hdspm_peak_rms_ioctl)
+
+/* ------------ CONFIG block IOCTL ---------------------- */
+
+struct hdspm_config_info {
+ unsigned char pref_sync_ref;
+ unsigned char wordclock_sync_check;
+ unsigned char madi_sync_check;
+ unsigned int system_sample_rate;
+ unsigned int autosync_sample_rate;
+ unsigned char system_clock_mode;
+ unsigned char clock_source;
+ unsigned char autosync_ref;
+ unsigned char line_out;
+ unsigned int passthru;
+ unsigned int analog_out;
+};
+
+#define SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO \
+ _IOR('H', 0x41, struct hdspm_config_info)
+
+
+/* get Soundcard Version */
+
+struct hdspm_version {
+ unsigned short firmware_rev;
+};
+
+#define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x43, struct hdspm_version)
+
+
+/* ------------- get Matrix Mixer IOCTL --------------- */
+
+/* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte =
+ * 32768 Bytes
+ */
+
+/* organisation is 64 channelfader in a continous memory block */
+/* equivalent to hardware definition, maybe for future feature of mmap of
+ * them
+ */
+/* each of 64 outputs has 64 infader and 64 outfader:
+ Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */
+
+#define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS
+
+struct hdspm_channelfader {
+ unsigned int in[HDSPM_MIXER_CHANNELS];
+ unsigned int pb[HDSPM_MIXER_CHANNELS];
+};
+
+struct hdspm_mixer {
+ struct hdspm_channelfader ch[HDSPM_MIXER_CHANNELS];
+};
+
+struct hdspm_mixer_ioctl {
+ struct hdspm_mixer *mixer;
+};
+
+/* use indirect access due to the limit of ioctl bit size */
+#define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdspm_mixer_ioctl)
+
+/* typedefs for compatibility to user-space */
+typedef struct hdspm_peak_rms hdspm_peak_rms_t;
+typedef struct hdspm_config_info hdspm_config_info_t;
+typedef struct hdspm_version hdspm_version_t;
+typedef struct hdspm_channelfader snd_hdspm_channelfader_t;
+typedef struct hdspm_mixer hdspm_mixer_t;
+
+#endif /* __SOUND_HDSPM_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/sb16_csp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/sb16_csp.h
new file mode 100644
index 0000000..50a351f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/sb16_csp.h
@@ -0,0 +1,115 @@
+#ifndef __SOUND_SB16_CSP_H
+#define __SOUND_SB16_CSP_H
+
+/*
+ * Copyright (c) 1999 by Uros Bizjak <uros@kss-loka.si>
+ * Takashi Iwai <tiwai@suse.de>
+ *
+ * SB16ASP/AWE32 CSP control
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+/* CSP modes */
+#define SNDRV_SB_CSP_MODE_NONE 0x00
+#define SNDRV_SB_CSP_MODE_DSP_READ 0x01 /* Record from DSP */
+#define SNDRV_SB_CSP_MODE_DSP_WRITE 0x02 /* Play to DSP */
+#define SNDRV_SB_CSP_MODE_QSOUND 0x04 /* QSound */
+
+/* CSP load flags */
+#define SNDRV_SB_CSP_LOAD_FROMUSER 0x01
+#define SNDRV_SB_CSP_LOAD_INITBLOCK 0x02
+
+/* CSP sample width */
+#define SNDRV_SB_CSP_SAMPLE_8BIT 0x01
+#define SNDRV_SB_CSP_SAMPLE_16BIT 0x02
+
+/* CSP channels */
+#define SNDRV_SB_CSP_MONO 0x01
+#define SNDRV_SB_CSP_STEREO 0x02
+
+/* CSP rates */
+#define SNDRV_SB_CSP_RATE_8000 0x01
+#define SNDRV_SB_CSP_RATE_11025 0x02
+#define SNDRV_SB_CSP_RATE_22050 0x04
+#define SNDRV_SB_CSP_RATE_44100 0x08
+#define SNDRV_SB_CSP_RATE_ALL 0x0f
+
+/* CSP running state */
+#define SNDRV_SB_CSP_ST_IDLE 0x00
+#define SNDRV_SB_CSP_ST_LOADED 0x01
+#define SNDRV_SB_CSP_ST_RUNNING 0x02
+#define SNDRV_SB_CSP_ST_PAUSED 0x04
+#define SNDRV_SB_CSP_ST_AUTO 0x08
+#define SNDRV_SB_CSP_ST_QSOUND 0x10
+
+/* maximum QSound value (180 degrees right) */
+#define SNDRV_SB_CSP_QSOUND_MAX_RIGHT 0x20
+
+/* maximum microcode RIFF file size */
+#define SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE 0x3000
+
+/* microcode header */
+struct snd_sb_csp_mc_header {
+ char codec_name[16]; /* id name of codec */
+ unsigned short func_req; /* requested function */
+};
+
+/* microcode to be loaded */
+struct snd_sb_csp_microcode {
+ struct snd_sb_csp_mc_header info;
+ unsigned char data[SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE];
+};
+
+/* start CSP with sample_width in mono/stereo */
+struct snd_sb_csp_start {
+ int sample_width; /* sample width, look above */
+ int channels; /* channels, look above */
+};
+
+/* CSP information */
+struct snd_sb_csp_info {
+ char codec_name[16]; /* id name of codec */
+ unsigned short func_nr; /* function number */
+ unsigned int acc_format; /* accepted PCM formats */
+ unsigned short acc_channels; /* accepted channels */
+ unsigned short acc_width; /* accepted sample width */
+ unsigned short acc_rates; /* accepted sample rates */
+ unsigned short csp_mode; /* CSP mode, see above */
+ unsigned short run_channels; /* current channels */
+ unsigned short run_width; /* current sample width */
+ unsigned short version; /* version id: 0x10 - 0x1f */
+ unsigned short state; /* state bits */
+};
+
+/* HWDEP controls */
+/* get CSP information */
+#define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, struct snd_sb_csp_info)
+/* load microcode to CSP */
+#define SNDRV_SB_CSP_IOCTL_LOAD_CODE _IOW('H', 0x11, struct snd_sb_csp_microcode)
+/* unload microcode from CSP */
+#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12)
+/* start CSP */
+#define SNDRV_SB_CSP_IOCTL_START _IOW('H', 0x13, struct snd_sb_csp_start)
+/* stop CSP */
+#define SNDRV_SB_CSP_IOCTL_STOP _IO('H', 0x14)
+/* pause CSP and DMA transfer */
+#define SNDRV_SB_CSP_IOCTL_PAUSE _IO('H', 0x15)
+/* restart CSP and DMA transfer */
+#define SNDRV_SB_CSP_IOCTL_RESTART _IO('H', 0x16)
+
+
+#endif /* __SOUND_SB16_CSP */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/sfnt_info.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/sfnt_info.h
new file mode 100644
index 0000000..1bce7fd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/sfnt_info.h
@@ -0,0 +1,212 @@
+#ifndef __SOUND_SFNT_INFO_H
+#define __SOUND_SFNT_INFO_H
+
+/*
+ * Patch record compatible with AWE driver on OSS
+ *
+ * Copyright (C) 1999-2000 Takashi Iwai
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <sound/asound.h>
+
+/*
+ * patch information record
+ */
+
+#ifdef SNDRV_BIG_ENDIAN
+#define SNDRV_OSS_PATCHKEY(id) (0xfd00|id)
+#else
+#define SNDRV_OSS_PATCHKEY(id) ((id<<8)|0xfd)
+#endif
+
+/* patch interface header: 16 bytes */
+struct soundfont_patch_info {
+ unsigned short key; /* use the key below */
+#define SNDRV_OSS_SOUNDFONT_PATCH SNDRV_OSS_PATCHKEY(0x07)
+
+ short device_no; /* synthesizer number */
+ unsigned short sf_id; /* file id (should be zero) */
+ short optarg; /* optional argument */
+ int len; /* data length (without this header) */
+
+ short type; /* patch operation type */
+#define SNDRV_SFNT_LOAD_INFO 0 /* awe_voice_rec */
+#define SNDRV_SFNT_LOAD_DATA 1 /* awe_sample_info */
+#define SNDRV_SFNT_OPEN_PATCH 2 /* awe_open_parm */
+#define SNDRV_SFNT_CLOSE_PATCH 3 /* none */
+ /* 4 is obsolete */
+#define SNDRV_SFNT_REPLACE_DATA 5 /* awe_sample_info (optarg=#channels)*/
+#define SNDRV_SFNT_MAP_PRESET 6 /* awe_voice_map */
+ /* 7 is not used */
+#define SNDRV_SFNT_PROBE_DATA 8 /* optarg=sample */
+#define SNDRV_SFNT_REMOVE_INFO 9 /* optarg=(bank<<8)|instr */
+
+ short reserved; /* word alignment data */
+
+ /* the actual patch data begins after this */
+};
+
+
+/*
+ * open patch
+ */
+
+#define SNDRV_SFNT_PATCH_NAME_LEN 32
+
+struct soundfont_open_parm {
+ unsigned short type; /* sample type */
+#define SNDRV_SFNT_PAT_TYPE_MISC 0
+#define SNDRV_SFNT_PAT_TYPE_GUS 6
+#define SNDRV_SFNT_PAT_TYPE_MAP 7
+#define SNDRV_SFNT_PAT_LOCKED 0x100 /* lock the samples */
+#define SNDRV_SFNT_PAT_SHARED 0x200 /* sample is shared */
+
+ short reserved;
+ char name[SNDRV_SFNT_PATCH_NAME_LEN];
+};
+
+
+/*
+ * raw voice information record
+ */
+
+/* wave table envelope & effect parameters to control EMU8000 */
+struct soundfont_voice_parm {
+ unsigned short moddelay; /* modulation delay (0x8000) */
+ unsigned short modatkhld; /* modulation attack & hold time (0x7f7f) */
+ unsigned short moddcysus; /* modulation decay & sustain (0x7f7f) */
+ unsigned short modrelease; /* modulation release time (0x807f) */
+ short modkeyhold, modkeydecay; /* envelope change per key (not used) */
+ unsigned short voldelay; /* volume delay (0x8000) */
+ unsigned short volatkhld; /* volume attack & hold time (0x7f7f) */
+ unsigned short voldcysus; /* volume decay & sustain (0x7f7f) */
+ unsigned short volrelease; /* volume release time (0x807f) */
+ short volkeyhold, volkeydecay; /* envelope change per key (not used) */
+ unsigned short lfo1delay; /* LFO1 delay (0x8000) */
+ unsigned short lfo2delay; /* LFO2 delay (0x8000) */
+ unsigned short pefe; /* modulation pitch & cutoff (0x0000) */
+ unsigned short fmmod; /* LFO1 pitch & cutoff (0x0000) */
+ unsigned short tremfrq; /* LFO1 volume & freq (0x0000) */
+ unsigned short fm2frq2; /* LFO2 pitch & freq (0x0000) */
+ unsigned char cutoff; /* initial cutoff (0xff) */
+ unsigned char filterQ; /* initial filter Q [0-15] (0x0) */
+ unsigned char chorus; /* chorus send (0x00) */
+ unsigned char reverb; /* reverb send (0x00) */
+ unsigned short reserved[4]; /* not used */
+};
+
+
+/* wave table parameters: 92 bytes */
+struct soundfont_voice_info {
+ unsigned short sf_id; /* file id (should be zero) */
+ unsigned short sample; /* sample id */
+ int start, end; /* sample offset correction */
+ int loopstart, loopend; /* loop offset correction */
+ short rate_offset; /* sample rate pitch offset */
+ unsigned short mode; /* sample mode */
+#define SNDRV_SFNT_MODE_ROMSOUND 0x8000
+#define SNDRV_SFNT_MODE_STEREO 1
+#define SNDRV_SFNT_MODE_LOOPING 2
+#define SNDRV_SFNT_MODE_NORELEASE 4 /* obsolete */
+#define SNDRV_SFNT_MODE_INIT_PARM 8
+
+ short root; /* midi root key */
+ short tune; /* pitch tuning (in cents) */
+ unsigned char low, high; /* key note range */
+ unsigned char vellow, velhigh; /* velocity range */
+ signed char fixkey, fixvel; /* fixed key, velocity */
+ signed char pan, fixpan; /* panning, fixed panning */
+ short exclusiveClass; /* exclusive class (0 = none) */
+ unsigned char amplitude; /* sample volume (127 max) */
+ unsigned char attenuation; /* attenuation (0.375dB) */
+ short scaleTuning; /* pitch scale tuning(%), normally 100 */
+ struct soundfont_voice_parm parm; /* voice envelope parameters */
+ unsigned short sample_mode; /* sample mode_flag (set by driver) */
+};
+
+
+/* instrument info header: 4 bytes */
+struct soundfont_voice_rec_hdr {
+ unsigned char bank; /* midi bank number */
+ unsigned char instr; /* midi preset number */
+ char nvoices; /* number of voices */
+ char write_mode; /* write mode; normally 0 */
+#define SNDRV_SFNT_WR_APPEND 0 /* append anyway */
+#define SNDRV_SFNT_WR_EXCLUSIVE 1 /* skip if already exists */
+#define SNDRV_SFNT_WR_REPLACE 2 /* replace if already exists */
+};
+
+
+/*
+ * sample wave information
+ */
+
+/* wave table sample header: 32 bytes */
+struct soundfont_sample_info {
+ unsigned short sf_id; /* file id (should be zero) */
+ unsigned short sample; /* sample id */
+ int start, end; /* start & end offset */
+ int loopstart, loopend; /* loop start & end offset */
+ int size; /* size (0 = ROM) */
+ short dummy; /* not used */
+ unsigned short mode_flags; /* mode flags */
+#define SNDRV_SFNT_SAMPLE_8BITS 1 /* wave data is 8bits */
+#define SNDRV_SFNT_SAMPLE_UNSIGNED 2 /* wave data is unsigned */
+#define SNDRV_SFNT_SAMPLE_NO_BLANK 4 /* no blank loop is attached */
+#define SNDRV_SFNT_SAMPLE_SINGLESHOT 8 /* single-shot w/o loop */
+#define SNDRV_SFNT_SAMPLE_BIDIR_LOOP 16 /* bidirectional looping */
+#define SNDRV_SFNT_SAMPLE_STEREO_LEFT 32 /* stereo left sound */
+#define SNDRV_SFNT_SAMPLE_STEREO_RIGHT 64 /* stereo right sound */
+#define SNDRV_SFNT_SAMPLE_REVERSE_LOOP 128 /* reverse looping */
+ unsigned int truesize; /* used memory size (set by driver) */
+};
+
+
+/*
+ * voice preset mapping (aliasing)
+ */
+
+struct soundfont_voice_map {
+ int map_bank, map_instr, map_key; /* key = -1 means all keys */
+ int src_bank, src_instr, src_key;
+};
+
+
+/*
+ * ioctls for hwdep
+ */
+
+#define SNDRV_EMUX_HWDEP_NAME "Emux WaveTable"
+
+#define SNDRV_EMUX_VERSION ((1 << 16) | (0 << 8) | 0) /* 1.0.0 */
+
+struct snd_emux_misc_mode {
+ int port; /* -1 = all */
+ int mode;
+ int value;
+ int value2; /* reserved */
+};
+
+#define SNDRV_EMUX_IOCTL_VERSION _IOR('H', 0x80, unsigned int)
+#define SNDRV_EMUX_IOCTL_LOAD_PATCH _IOWR('H', 0x81, struct soundfont_patch_info)
+#define SNDRV_EMUX_IOCTL_RESET_SAMPLES _IO('H', 0x82)
+#define SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES _IO('H', 0x83)
+#define SNDRV_EMUX_IOCTL_MEM_AVAIL _IOW('H', 0x84, int)
+#define SNDRV_EMUX_IOCTL_MISC_MODE _IOWR('H', 0x84, struct snd_emux_misc_mode)
+
+#endif /* __SOUND_SFNT_INFO_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/sscape_ioctl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/sscape_ioctl.h
new file mode 100644
index 0000000..c6653eb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sound/sscape_ioctl.h
@@ -0,0 +1,21 @@
+#ifndef SSCAPE_IOCTL_H
+#define SSCAPE_IOCTL_H
+
+
+struct sscape_bootblock
+{
+ unsigned char code[256];
+ unsigned version;
+};
+
+#define SSCAPE_MICROCODE_SIZE 65536
+
+struct sscape_microcode
+{
+ unsigned char *code;
+};
+
+#define SND_SSCAPE_LOAD_BOOTB _IOWR('P', 100, struct sscape_bootblock)
+#define SND_SSCAPE_LOAD_MCODE _IOW ('P', 101, struct sscape_microcode)
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/stdint.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/stdint.h
new file mode 100644
index 0000000..2f4020e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/stdint.h
@@ -0,0 +1,332 @@
+/* Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99: 7.18 Integer types <stdint.h>
+ */
+
+#ifndef _STDINT_H
+#define _STDINT_H 1
+
+#include <features.h>
+#ifdef __UCLIBC_HAS_WCHAR__
+#include <bits/wchar.h>
+#endif /* __UCLIBC_HAS_WCHAR__ */
+#include <bits/wordsize.h>
+
+/* Exact integral types. */
+
+/* Signed. */
+
+/* There is some amount of overlap with <sys/types.h> as known by inet code */
+#ifndef __int8_t_defined
+# define __int8_t_defined
+typedef signed char int8_t;
+typedef short int int16_t;
+typedef int int32_t;
+# if __WORDSIZE == 64
+typedef long int int64_t;
+# else
+__extension__
+typedef long long int int64_t;
+# endif
+#endif
+
+/* Unsigned. */
+typedef unsigned char uint8_t;
+typedef unsigned short int uint16_t;
+#ifndef __uint32_t_defined
+typedef unsigned int uint32_t;
+# define __uint32_t_defined
+#endif
+#if __WORDSIZE == 64
+typedef unsigned long int uint64_t;
+#else
+__extension__
+typedef unsigned long long int uint64_t;
+#endif
+
+
+/* Small types. */
+
+/* Signed. */
+typedef signed char int_least8_t;
+typedef short int int_least16_t;
+typedef int int_least32_t;
+#if __WORDSIZE == 64
+typedef long int int_least64_t;
+#else
+__extension__
+typedef long long int int_least64_t;
+#endif
+
+/* Unsigned. */
+typedef unsigned char uint_least8_t;
+typedef unsigned short int uint_least16_t;
+typedef unsigned int uint_least32_t;
+#if __WORDSIZE == 64
+typedef unsigned long int uint_least64_t;
+#else
+__extension__
+typedef unsigned long long int uint_least64_t;
+#endif
+
+
+/* Fast types. */
+
+/* Signed. */
+typedef signed char int_fast8_t;
+#if __WORDSIZE == 64
+typedef long int int_fast16_t;
+typedef long int int_fast32_t;
+typedef long int int_fast64_t;
+#else
+typedef int int_fast16_t;
+typedef int int_fast32_t;
+__extension__
+typedef long long int int_fast64_t;
+#endif
+
+/* Unsigned. */
+typedef unsigned char uint_fast8_t;
+#if __WORDSIZE == 64
+typedef unsigned long int uint_fast16_t;
+typedef unsigned long int uint_fast32_t;
+typedef unsigned long int uint_fast64_t;
+#else
+typedef unsigned int uint_fast16_t;
+typedef unsigned int uint_fast32_t;
+__extension__
+typedef unsigned long long int uint_fast64_t;
+#endif
+
+
+/* Types for `void *' pointers. */
+#if __WORDSIZE == 64
+# ifndef __intptr_t_defined
+typedef long int intptr_t;
+# define __intptr_t_defined
+# endif
+typedef unsigned long int uintptr_t;
+#else
+# ifndef __intptr_t_defined
+typedef int intptr_t;
+# define __intptr_t_defined
+# endif
+typedef unsigned int uintptr_t;
+#endif
+
+
+/* Largest integral types. */
+#if __WORDSIZE == 64
+typedef long int intmax_t;
+typedef unsigned long int uintmax_t;
+#else
+__extension__
+typedef long long int intmax_t;
+__extension__
+typedef unsigned long long int uintmax_t;
+#endif
+
+
+/* The ISO C99 standard specifies that in C++ implementations these
+ macros should only be defined if explicitly requested. */
+#if !defined __cplusplus || defined __STDC_LIMIT_MACROS
+
+# if __WORDSIZE == 64
+# define __INT64_C(c) c ## L
+# define __UINT64_C(c) c ## UL
+# else
+# define __INT64_C(c) c ## LL
+# define __UINT64_C(c) c ## ULL
+# endif
+
+/* Limits of integral types. */
+
+/* Minimum of signed integral types. */
+# define INT8_MIN (-128)
+# define INT16_MIN (-32767-1)
+# define INT32_MIN (-2147483647-1)
+# define INT64_MIN (-__INT64_C(9223372036854775807)-1)
+/* Maximum of signed integral types. */
+# define INT8_MAX (127)
+# define INT16_MAX (32767)
+# define INT32_MAX (2147483647)
+# define INT64_MAX (__INT64_C(9223372036854775807))
+
+/* Maximum of unsigned integral types. */
+# define UINT8_MAX (255)
+# define UINT16_MAX (65535)
+# define UINT32_MAX (4294967295U)
+# define UINT64_MAX (__UINT64_C(18446744073709551615))
+
+
+/* Minimum of signed integral types having a minimum size. */
+# define INT_LEAST8_MIN (-128)
+# define INT_LEAST16_MIN (-32767-1)
+# define INT_LEAST32_MIN (-2147483647-1)
+# define INT_LEAST64_MIN (-__INT64_C(9223372036854775807)-1)
+/* Maximum of signed integral types having a minimum size. */
+# define INT_LEAST8_MAX (127)
+# define INT_LEAST16_MAX (32767)
+# define INT_LEAST32_MAX (2147483647)
+# define INT_LEAST64_MAX (__INT64_C(9223372036854775807))
+
+/* Maximum of unsigned integral types having a minimum size. */
+# define UINT_LEAST8_MAX (255)
+# define UINT_LEAST16_MAX (65535)
+# define UINT_LEAST32_MAX (4294967295U)
+# define UINT_LEAST64_MAX (__UINT64_C(18446744073709551615))
+
+
+/* Minimum of fast signed integral types having a minimum size. */
+# define INT_FAST8_MIN (-128)
+# if __WORDSIZE == 64
+# define INT_FAST16_MIN (-9223372036854775807L-1)
+# define INT_FAST32_MIN (-9223372036854775807L-1)
+# else
+# define INT_FAST16_MIN (-2147483647-1)
+# define INT_FAST32_MIN (-2147483647-1)
+# endif
+# define INT_FAST64_MIN (-__INT64_C(9223372036854775807)-1)
+/* Maximum of fast signed integral types having a minimum size. */
+# define INT_FAST8_MAX (127)
+# if __WORDSIZE == 64
+# define INT_FAST16_MAX (9223372036854775807L)
+# define INT_FAST32_MAX (9223372036854775807L)
+# else
+# define INT_FAST16_MAX (2147483647)
+# define INT_FAST32_MAX (2147483647)
+# endif
+# define INT_FAST64_MAX (__INT64_C(9223372036854775807))
+
+/* Maximum of fast unsigned integral types having a minimum size. */
+# define UINT_FAST8_MAX (255)
+# if __WORDSIZE == 64
+# define UINT_FAST16_MAX (18446744073709551615UL)
+# define UINT_FAST32_MAX (18446744073709551615UL)
+# else
+# define UINT_FAST16_MAX (4294967295U)
+# define UINT_FAST32_MAX (4294967295U)
+# endif
+# define UINT_FAST64_MAX (__UINT64_C(18446744073709551615))
+
+
+/* Values to test for integral types holding `void *' pointer. */
+# if __WORDSIZE == 64
+# define INTPTR_MIN (-9223372036854775807L-1)
+# define INTPTR_MAX (9223372036854775807L)
+# define UINTPTR_MAX (18446744073709551615UL)
+# else
+# define INTPTR_MIN (-2147483647-1)
+# define INTPTR_MAX (2147483647)
+# define UINTPTR_MAX (4294967295U)
+# endif
+
+#if !defined(__H8300H__) && !defined(__H8300S__)
+/* Minimum for largest signed integral type. */
+# define INTMAX_MIN (-__INT64_C(9223372036854775807)-1)
+/* Maximum for largest signed integral type. */
+# define INTMAX_MAX (__INT64_C(9223372036854775807))
+
+/* Maximum for largest unsigned integral type. */
+# define UINTMAX_MAX (__UINT64_C(18446744073709551615))
+#else
+/* Minimum for largest signed integral type. */
+# define INTMAX_MIN (-LONG_LONG_MAX-1)
+/* Maximum for largest signed integral type. */
+# define INTMAX_MAX (LONG_LONG_MAX)
+
+/* Maximum for largest unsigned integral type. */
+# define UINTMAX_MAX (LONG_LONG_MAX<<1+1)
+#endif
+
+/* Limits of other integer types. */
+
+/* Limits of `ptrdiff_t' type. */
+# if __WORDSIZE == 64
+# define PTRDIFF_MIN (-9223372036854775807L-1)
+# define PTRDIFF_MAX (9223372036854775807L)
+# else
+# define PTRDIFF_MIN (-2147483647-1)
+# define PTRDIFF_MAX (2147483647)
+# endif
+
+/* Limits of `sig_atomic_t'. */
+# define SIG_ATOMIC_MIN (-2147483647-1)
+# define SIG_ATOMIC_MAX (2147483647)
+
+/* Limit of `size_t' type. */
+# if __WORDSIZE == 64
+# define SIZE_MAX (18446744073709551615UL)
+# else
+# define SIZE_MAX (4294967295U)
+# endif
+
+#ifdef __UCLIBC_HAS_WCHAR__
+/* Limits of `wchar_t'. */
+# ifndef WCHAR_MIN
+/* These constants might also be defined in <wchar.h>. */
+# define WCHAR_MIN __WCHAR_MIN
+# define WCHAR_MAX __WCHAR_MAX
+# endif
+
+/* Limits of `wint_t'. */
+# define WINT_MIN (0u)
+# define WINT_MAX (4294967295u)
+#endif /* __UCLIBC_HAS_WCHAR__ */
+
+#endif /* C++ && limit macros */
+
+
+/* The ISO C99 standard specifies that in C++ implementations these
+ should only be defined if explicitly requested. */
+#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
+
+/* Signed. */
+# define INT8_C(c) c
+# define INT16_C(c) c
+# define INT32_C(c) c
+# if __WORDSIZE == 64
+# define INT64_C(c) c ## L
+# else
+# define INT64_C(c) c ## LL
+# endif
+
+/* Unsigned. */
+# define UINT8_C(c) c ## U
+# define UINT16_C(c) c ## U
+# define UINT32_C(c) c ## U
+# if __WORDSIZE == 64
+# define UINT64_C(c) c ## UL
+# else
+# define UINT64_C(c) c ## ULL
+# endif
+
+/* Maximal type. */
+# if __WORDSIZE == 64
+# define INTMAX_C(c) c ## L
+# define UINTMAX_C(c) c ## UL
+# else
+# define INTMAX_C(c) c ## LL
+# define UINTMAX_C(c) c ## ULL
+# endif
+
+#endif /* C++ && constant macros */
+
+#endif /* stdint.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/stdio.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/stdio.h
new file mode 100644
index 0000000..fd2a738
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/stdio.h
@@ -0,0 +1,873 @@
+/*
+ Copyright (C) 1991,1994-2002,2003,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.19 Input/output <stdio.h>
+ */
+
+#ifndef _STDIO_H
+
+#if !defined __need_FILE && !defined __need___FILE
+# define _STDIO_H 1
+# include <features.h>
+
+__BEGIN_DECLS
+
+# define __need_size_t
+# define __need_NULL
+# include <stddef.h>
+
+# include <bits/types.h>
+# define __need_FILE
+# define __need___FILE
+#endif /* Don't need FILE. */
+
+
+#if !defined __FILE_defined && defined __need_FILE
+
+__BEGIN_NAMESPACE_STD
+/* The opaque type of streams. This is the definition used elsewhere. */
+typedef struct __STDIO_FILE_STRUCT FILE;
+__END_NAMESPACE_STD
+#if defined __USE_LARGEFILE64 || defined __USE_SVID || defined __USE_POSIX \
+ || defined __USE_BSD || defined __USE_ISOC99 || defined __USE_XOPEN \
+ || defined __USE_POSIX2
+__USING_NAMESPACE_STD(FILE)
+#endif
+
+# define __FILE_defined 1
+#endif /* FILE not defined. */
+#undef __need_FILE
+
+
+#if !defined ____FILE_defined && defined __need___FILE
+
+/* The opaque type of streams. This is the definition used elsewhere. */
+typedef struct __STDIO_FILE_STRUCT __FILE;
+
+# define ____FILE_defined 1
+#endif /* __FILE not defined. */
+#undef __need___FILE
+
+
+#ifdef _STDIO_H
+#undef _STDIO_USES_IOSTREAM
+
+#include <bits/uClibc_stdio.h>
+
+/* This define avoids name pollution if we're using GNU stdarg.h */
+# define __need___va_list
+#include <stdarg.h>
+
+/* The type of the second argument to `fgetpos' and `fsetpos'. */
+__BEGIN_NAMESPACE_STD
+#ifndef __USE_FILE_OFFSET64
+typedef __STDIO_fpos_t fpos_t;
+#else
+typedef __STDIO_fpos64_t fpos_t;
+#endif
+__END_NAMESPACE_STD
+#ifdef __USE_LARGEFILE64
+typedef __STDIO_fpos64_t fpos64_t;
+#endif
+
+/* The possibilities for the third argument to `setvbuf'. */
+#define _IOFBF __STDIO_IOFBF /* Fully buffered. */
+#define _IOLBF __STDIO_IOLBF /* Line buffered. */
+#define _IONBF __STDIO_IONBF /* No buffering. */
+
+
+/* Default buffer size. */
+#ifndef BUFSIZ
+# define BUFSIZ __STDIO_BUFSIZ
+#endif
+
+
+/* End of file character.
+ Some things throughout the library rely on this being -1. */
+#ifndef EOF
+# define EOF (-1)
+#endif
+
+
+/* The possibilities for the third argument to `fseek'.
+ These values should not be changed. */
+#define SEEK_SET 0 /* Seek from beginning of file. */
+#define SEEK_CUR 1 /* Seek from current position. */
+#define SEEK_END 2 /* Seek from end of file. */
+
+
+#if defined __USE_SVID || defined __USE_XOPEN
+/* Default path prefix for `tempnam' and `tmpnam'. */
+# define P_tmpdir "/tmp"
+#endif
+
+
+/* Get the values:
+ L_tmpnam How long an array of chars must be to be passed to `tmpnam'.
+ TMP_MAX The minimum number of unique filenames generated by tmpnam
+ (and tempnam when it uses tmpnam's name space),
+ or tempnam (the two are separate).
+ L_ctermid How long an array to pass to `ctermid'.
+ L_cuserid How long an array to pass to `cuserid'.
+ FOPEN_MAX Minimum number of files that can be open at once.
+ FILENAME_MAX Maximum length of a filename. */
+#include <bits/stdio_lim.h>
+
+
+/* Standard streams. */
+extern FILE *stdin; /* Standard input stream. */
+extern FILE *stdout; /* Standard output stream. */
+extern FILE *stderr; /* Standard error output stream. */
+/* C89/C99 say they're macros. Make them happy. */
+#define stdin stdin
+#define stdout stdout
+#define stderr stderr
+
+__BEGIN_NAMESPACE_STD
+/* Remove file FILENAME. */
+extern int remove (__const char *__filename) __THROW;
+/* Rename file OLD to NEW. */
+extern int rename (__const char *__old, __const char *__new) __THROW;
+__END_NAMESPACE_STD
+
+
+__BEGIN_NAMESPACE_STD
+/* Create a temporary file and open it read/write.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+#ifndef __USE_FILE_OFFSET64
+extern FILE *tmpfile (void);
+#else
+# ifdef __REDIRECT
+extern FILE *__REDIRECT (tmpfile, (void), tmpfile64);
+# else
+# define tmpfile tmpfile64
+# endif
+#endif
+
+#ifdef __USE_LARGEFILE64
+extern FILE *tmpfile64 (void);
+#endif
+
+/* Generate a temporary filename. */
+extern char *tmpnam (char *__s) __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_MISC
+/* This is the reentrant variant of `tmpnam'. The only difference is
+ that it does not allow S to be NULL. */
+extern char *tmpnam_r (char *__s) __THROW;
+#endif
+
+
+#if defined __USE_SVID || defined __USE_XOPEN
+/* Generate a unique temporary filename using up to five characters of PFX
+ if it is not NULL. The directory to put this file in is searched for
+ as follows: First the environment variable "TMPDIR" is checked.
+ If it contains the name of a writable directory, that directory is used.
+ If not and if DIR is not NULL, that value is checked. If that fails,
+ P_tmpdir is tried and finally "/tmp". The storage for the filename
+ is allocated by `malloc'. */
+extern char *tempnam (__const char *__dir, __const char *__pfx)
+ __THROW __attribute_malloc__;
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Close STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fclose (FILE *__stream);
+/* Flush STREAM, or all streams if STREAM is NULL.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fflush (FILE *__stream);
+__END_NAMESPACE_STD
+
+#ifdef __USE_MISC
+/* Faster versions when locking is not required.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int fflush_unlocked (FILE *__stream);
+#endif
+
+#ifdef __USE_GNU
+/* Close all streams.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int fcloseall (void);
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+#ifndef __USE_FILE_OFFSET64
+/* Open a file and create a new stream for it.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern FILE *fopen (__const char *__restrict __filename,
+ __const char *__restrict __modes);
+/* Open a file, replacing an existing stream with it.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern FILE *freopen (__const char *__restrict __filename,
+ __const char *__restrict __modes,
+ FILE *__restrict __stream);
+#else
+# ifdef __REDIRECT
+extern FILE *__REDIRECT (fopen, (__const char *__restrict __filename,
+ __const char *__restrict __modes), fopen64);
+extern FILE *__REDIRECT (freopen, (__const char *__restrict __filename,
+ __const char *__restrict __modes,
+ FILE *__restrict __stream), freopen64);
+# else
+# define fopen fopen64
+# define freopen freopen64
+# endif
+#endif
+__END_NAMESPACE_STD
+#ifdef __USE_LARGEFILE64
+extern FILE *fopen64 (__const char *__restrict __filename,
+ __const char *__restrict __modes);
+extern FILE *freopen64 (__const char *__restrict __filename,
+ __const char *__restrict __modes,
+ FILE *__restrict __stream);
+#endif
+
+#ifdef __USE_POSIX
+/* Create a new stream that refers to an existing system file descriptor. */
+extern FILE *fdopen (int __fd, __const char *__modes) __THROW;
+#endif
+
+#ifdef __USE_GNU
+#ifdef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__
+/* Create a new stream that refers to the given magic cookie,
+ and uses the given functions for input and output. */
+extern FILE *fopencookie (void *__restrict __magic_cookie,
+ __const char *__restrict __modes,
+ _IO_cookie_io_functions_t __io_funcs) __THROW;
+
+/* Create a new stream that refers to a memory buffer. */
+extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes) __THROW;
+
+/* Open a stream that writes into a malloc'd buffer that is expanded as
+ necessary. *BUFLOC and *SIZELOC are updated with the buffer's location
+ and the number of characters written on fflush or fclose. */
+extern FILE *open_memstream (char **__restrict __bufloc,
+ size_t *__restrict __sizeloc) __THROW;
+#endif
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* If BUF is NULL, make STREAM unbuffered.
+ Else make it use buffer BUF, of size BUFSIZ. */
+extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __THROW;
+/* Make STREAM use buffering mode MODE.
+ If BUF is not NULL, use N bytes of it for buffering;
+ else allocate an internal buffer N bytes long. */
+extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
+ int __modes, size_t __n) __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_BSD
+/* If BUF is NULL, make STREAM unbuffered.
+ Else make it use SIZE bytes of BUF for buffering. */
+extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
+ size_t __size) __THROW;
+
+/* Make STREAM line-buffered. */
+extern void setlinebuf (FILE *__stream) __THROW;
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Write formatted output to STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fprintf (FILE *__restrict __stream,
+ __const char *__restrict __format, ...);
+/* Write formatted output to stdout.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int printf (__const char *__restrict __format, ...);
+/* Write formatted output to S. */
+extern int sprintf (char *__restrict __s,
+ __const char *__restrict __format, ...) __THROW;
+
+/* Write formatted output to S from argument list ARG.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
+ __gnuc_va_list __arg);
+/* Write formatted output to stdout from argument list ARG.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
+/* Write formatted output to S from argument list ARG. */
+extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
+ __gnuc_va_list __arg) __THROW;
+__END_NAMESPACE_STD
+
+#if defined __USE_BSD || defined __USE_ISOC99 || defined __USE_UNIX98
+__BEGIN_NAMESPACE_C99
+/* Maximum chars of output to write in MAXLEN. */
+extern int snprintf (char *__restrict __s, size_t __maxlen,
+ __const char *__restrict __format, ...)
+ __THROW __attribute__ ((__format__ (__printf__, 3, 4)));
+
+extern int vsnprintf (char *__restrict __s, size_t __maxlen,
+ __const char *__restrict __format, __gnuc_va_list __arg)
+ __THROW __attribute__ ((__format__ (__printf__, 3, 0)));
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_GNU
+/* Write formatted output to a string dynamically allocated with `malloc'.
+ Store the address of the string in *PTR. */
+extern int vasprintf (char **__restrict __ptr, __const char *__restrict __f,
+ __gnuc_va_list __arg)
+ __THROW __attribute__ ((__format__ (__printf__, 2, 0)));
+#if 0 /* uClibc: disabled */
+extern int __asprintf (char **__restrict __ptr,
+ __const char *__restrict __fmt, ...)
+ __THROW __attribute__ ((__format__ (__printf__, 2, 3)));
+#endif
+extern int asprintf (char **__restrict __ptr,
+ __const char *__restrict __fmt, ...)
+ __THROW __attribute__ ((__format__ (__printf__, 2, 3)));
+
+/* Write formatted output to a file descriptor.
+
+ These functions are not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation they are cancellation points and
+ therefore not marked with __THROW. */
+extern int vdprintf (int __fd, __const char *__restrict __fmt,
+ __gnuc_va_list __arg)
+ __attribute__ ((__format__ (__printf__, 2, 0)));
+extern int dprintf (int __fd, __const char *__restrict __fmt, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Read formatted input from STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fscanf (FILE *__restrict __stream,
+ __const char *__restrict __format, ...);
+/* Read formatted input from stdin.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int scanf (__const char *__restrict __format, ...);
+/* Read formatted input from S. */
+extern int sscanf (__const char *__restrict __s,
+ __const char *__restrict __format, ...) __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Read formatted input from S into argument list ARG.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format,
+ __gnuc_va_list __arg)
+ __attribute__ ((__format__ (__scanf__, 2, 0)));
+
+/* Read formatted input from stdin into argument list ARG.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg)
+ __attribute__ ((__format__ (__scanf__, 1, 0)));
+
+/* Read formatted input from S into argument list ARG. */
+extern int vsscanf (__const char *__restrict __s,
+ __const char *__restrict __format, __gnuc_va_list __arg)
+ __THROW __attribute__ ((__format__ (__scanf__, 2, 0)));
+__END_NAMESPACE_C99
+#endif /* Use ISO C9x. */
+
+
+__BEGIN_NAMESPACE_STD
+/* Read a character from STREAM.
+
+ These functions are possible cancellation points and therefore not
+ marked with __THROW. */
+extern int fgetc (FILE *__stream);
+extern int getc (FILE *__stream);
+
+/* Read a character from stdin.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int getchar (void);
+__END_NAMESPACE_STD
+
+/* The C standard explicitly says this is a macro, so we always do the
+ optimization for it. */
+#define getc(_fp) __GETC(_fp)
+
+#if defined __USE_POSIX || defined __USE_MISC
+/* These are defined in POSIX.1:1996.
+
+ These functions are possible cancellation points and therefore not
+ marked with __THROW. */
+extern int getc_unlocked (FILE *__stream);
+extern int getchar_unlocked (void);
+
+/* SUSv3 allows getc_unlocked to be a macro */
+#define getc_unlocked(_fp) __GETC_UNLOCKED(_fp)
+#endif /* Use POSIX or MISC. */
+
+#ifdef __USE_MISC
+/* Faster version when locking is not necessary.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int fgetc_unlocked (FILE *__stream);
+#endif /* Use MISC. */
+
+
+__BEGIN_NAMESPACE_STD
+/* Write a character to STREAM.
+
+ These functions are possible cancellation points and therefore not
+ marked with __THROW.
+
+ These functions is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fputc (int __c, FILE *__stream);
+extern int putc (int __c, FILE *__stream);
+
+/* Write a character to stdout.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int putchar (int __c);
+__END_NAMESPACE_STD
+
+/* The C standard explicitly says this can be a macro,
+ so we always do the optimization for it. */
+#define putc(_ch, _fp) __PUTC(_ch, _fp)
+
+#ifdef __USE_MISC
+/* Faster version when locking is not necessary.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int fputc_unlocked (int __c, FILE *__stream);
+#endif /* Use MISC. */
+
+#if defined __USE_POSIX || defined __USE_MISC
+/* These are defined in POSIX.1:1996.
+
+ These functions are possible cancellation points and therefore not
+ marked with __THROW. */
+extern int putc_unlocked (int __c, FILE *__stream);
+extern int putchar_unlocked (int __c);
+
+/* SUSv3 allows putc_unlocked to be a macro */
+#define putc_unlocked(_ch, _fp) __PUTC_UNLOCKED(_ch, _fp)
+#endif /* Use POSIX or MISC. */
+
+
+#if defined __USE_SVID || defined __USE_MISC \
+ || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
+/* Get a word (int) from STREAM. */
+extern int getw (FILE *__stream);
+
+/* Write a word (int) to STREAM. */
+extern int putw (int __w, FILE *__stream);
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Get a newline-terminated string of finite length from STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream);
+
+/* Get a newline-terminated string from stdin, removing the newline.
+ DO NOT USE THIS FUNCTION!! There is no limit on how much it will read.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern char *gets (char *__s);
+__END_NAMESPACE_STD
+
+#ifdef __USE_GNU
+/* This function does the same as `fgets' but does not lock the stream.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern char *fgets_unlocked (char *__restrict __s, int __n,
+ FILE *__restrict __stream);
+#endif
+
+
+#ifdef __USE_GNU
+/* Read up to (and including) a DELIMITER from STREAM into *LINEPTR
+ (and null-terminate it). *LINEPTR is a pointer returned from malloc (or
+ NULL), pointing to *N characters of space. It is realloc'd as
+ necessary. Returns the number of characters read (not including the
+ null terminator), or -1 on error or EOF.
+
+ These functions are not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation they are cancellation points and
+ therefore not marked with __THROW. */
+#if 0 /* uClibc: disabled */
+extern __ssize_t __getdelim (char **__restrict __lineptr,
+ size_t *__restrict __n, int __delimiter,
+ FILE *__restrict __stream);
+#endif
+extern __ssize_t getdelim (char **__restrict __lineptr,
+ size_t *__restrict __n, int __delimiter,
+ FILE *__restrict __stream);
+
+/* Like `getdelim', but reads up to a newline.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern __ssize_t getline (char **__restrict __lineptr,
+ size_t *__restrict __n,
+ FILE *__restrict __stream);
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Write a string to STREAM.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
+
+/* Write a string, followed by a newline, to stdout.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern int puts (__const char *__s);
+
+
+/* Push a character back onto the input buffer of STREAM.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern int ungetc (int __c, FILE *__stream);
+
+
+/* Read chunks of generic data from STREAM.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern size_t fread (void *__restrict __ptr, size_t __size,
+ size_t __n, FILE *__restrict __stream);
+/* Write chunks of generic data to STREAM.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
+ size_t __n, FILE *__restrict __s);
+__END_NAMESPACE_STD
+
+#ifdef __USE_GNU
+/* This function does the same as `fputs' but does not lock the stream.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int fputs_unlocked (__const char *__restrict __s,
+ FILE *__restrict __stream);
+#endif
+
+#ifdef __USE_MISC
+/* Faster versions when locking is not necessary.
+
+ These functions are not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation they are cancellation points and
+ therefore not marked with __THROW. */
+extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
+ size_t __n, FILE *__restrict __stream);
+extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
+ size_t __n, FILE *__restrict __stream);
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Seek to a certain position on STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fseek (FILE *__stream, long int __off, int __whence);
+/* Return the current position of STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern long int ftell (FILE *__stream);
+/* Rewind to the beginning of STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void rewind (FILE *__stream);
+__END_NAMESPACE_STD
+
+/* The Single Unix Specification, Version 2, specifies an alternative,
+ more adequate interface for the two functions above which deal with
+ file offset. `long int' is not the right type. These definitions
+ are originally defined in the Large File Support API. */
+
+#if defined __USE_LARGEFILE || defined __USE_XOPEN2K
+# ifndef __USE_FILE_OFFSET64
+/* Seek to a certain position on STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fseeko (FILE *__stream, __off_t __off, int __whence);
+/* Return the current position of STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern __off_t ftello (FILE *__stream);
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (fseeko,
+ (FILE *__stream, __off64_t __off, int __whence),
+ fseeko64);
+extern __off64_t __REDIRECT (ftello, (FILE *__stream), ftello64);
+# else
+# define fseeko fseeko64
+# define ftello ftello64
+# endif
+# endif
+#endif
+
+__BEGIN_NAMESPACE_STD
+#ifndef __USE_FILE_OFFSET64
+/* Get STREAM's position.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
+/* Set STREAM's position.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fsetpos (FILE *__stream, __const fpos_t *__pos);
+#else
+# ifdef __REDIRECT
+extern int __REDIRECT (fgetpos, (FILE *__restrict __stream,
+ fpos_t *__restrict __pos), fgetpos64);
+extern int __REDIRECT (fsetpos,
+ (FILE *__stream, __const fpos_t *__pos), fsetpos64);
+# else
+# define fgetpos fgetpos64
+# define fsetpos fsetpos64
+# endif
+#endif
+__END_NAMESPACE_STD
+
+#ifdef __USE_LARGEFILE64
+extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
+extern __off64_t ftello64 (FILE *__stream);
+extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
+extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos);
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Clear the error and EOF indicators for STREAM. */
+extern void clearerr (FILE *__stream) __THROW;
+/* Return the EOF indicator for STREAM. */
+extern int feof (FILE *__stream) __THROW;
+/* Return the error indicator for STREAM. */
+extern int ferror (FILE *__stream) __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_MISC
+/* Faster versions when locking is not required. */
+extern void clearerr_unlocked (FILE *__stream) __THROW;
+extern int feof_unlocked (FILE *__stream) __THROW;
+extern int ferror_unlocked (FILE *__stream) __THROW;
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Print a message describing the meaning of the value of errno.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void perror (__const char *__s);
+__END_NAMESPACE_STD
+
+#ifdef __UCLIBC_HAS_SYS_ERRLIST__
+/* These variables normally should not be used directly. The `strerror'
+ function provides all the needed functionality. */
+#ifdef __USE_BSD
+extern int sys_nerr;
+extern __const char *__const sys_errlist[];
+#endif
+#endif /* __UCLIBC_HAS_SYS_ERRLIST__ */
+
+
+#ifdef __USE_POSIX
+/* Return the system file descriptor for STREAM. */
+extern int fileno (FILE *__stream) __THROW;
+#endif /* Use POSIX. */
+
+#ifdef __USE_MISC
+/* Faster version when locking is not required. */
+extern int fileno_unlocked (FILE *__stream) __THROW;
+#endif
+
+
+#if (defined __USE_POSIX2 || defined __USE_SVID || defined __USE_BSD || \
+ defined __USE_MISC)
+/* Create a new stream connected to a pipe running the given command.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern FILE *popen (__const char *__command, __const char *__modes);
+
+/* Close a stream opened by popen and return the status of its child.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int pclose (FILE *__stream);
+#endif
+
+
+#ifdef __USE_POSIX
+/* Return the name of the controlling terminal. */
+extern char *ctermid (char *__s) __THROW;
+#endif /* Use POSIX. */
+
+
+#ifdef __USE_XOPEN
+/* Return the name of the current user. */
+extern char *cuserid (char *__s);
+#endif /* Use X/Open, but not issue 6. */
+
+
+#if 0 /* def __USE_GNU uClibc note: not supported */
+struct obstack; /* See <obstack.h>. */
+
+/* Write formatted output to an obstack. */
+extern int obstack_printf (struct obstack *__restrict __obstack,
+ __const char *__restrict __format, ...)
+ __THROW __attribute__ ((__format__ (__printf__, 2, 3)));
+extern int obstack_vprintf (struct obstack *__restrict __obstack,
+ __const char *__restrict __format,
+ __gnuc_va_list __args)
+ __THROW __attribute__ ((__format__ (__printf__, 2, 0)));
+#endif /* Use GNU. */
+
+
+#if defined __USE_POSIX || defined __USE_MISC
+/* These are defined in POSIX.1:1996. */
+
+/* Acquire ownership of STREAM. */
+extern void flockfile (FILE *__stream) __THROW;
+
+/* Try to acquire ownership of STREAM but do not block if it is not
+ possible. */
+extern int ftrylockfile (FILE *__stream) __THROW;
+
+/* Relinquish the ownership granted for STREAM. */
+extern void funlockfile (FILE *__stream) __THROW;
+#endif /* POSIX || misc */
+
+#if defined __USE_XOPEN && !defined __USE_XOPEN2K && !defined __USE_GNU
+/* The X/Open standard requires some functions and variables to be
+ declared here which do not belong into this header. But we have to
+ follow. In GNU mode we don't do this nonsense. */
+# define __need_getopt
+# include <bits/getopt.h>
+#endif /* X/Open, but not issue 6 and not for GNU. */
+
+/* If we are compiling with optimizing read this file. It contains
+ several optimizing inline functions and macros. */
+#define fgetc(_fp) __FGETC(_fp)
+#define fputc(_ch, _fp) __FPUTC(_ch, _fp)
+
+#ifdef __USE_MISC
+#define fgetc_unlocked(_fp) __FGETC_UNLOCKED(_fp)
+#define fputc_unlocked(_ch, _fp) __FPUTC_UNLOCKED(_ch, _fp)
+#endif
+
+#ifndef __STDIO_GETC_MACRO
+#define __stdin stdin
+#endif
+#define getchar() __GETC(__stdin)
+
+#ifndef __STDIO_PUTC_MACRO
+#define __stdout stdout
+#endif
+#define putchar(_ch) __PUTC((_ch), __stdout)
+
+#if defined __USE_POSIX || defined __USE_MISC
+#define getchar_unlocked() __GETC_UNLOCKED(__stdin)
+#define putchar_unlocked(_ch) __PUTC_UNLOCKED((_ch), __stdout)
+#endif
+
+/* Clear the error and EOF indicators for STREAM. */
+#define clearerr(_fp) __CLEARERR(_fp)
+#define feof(_fp) __FEOF(_fp)
+#define ferror(_fp) __FERROR(_fp)
+
+#ifdef __USE_MISC
+#define clearerr_unlocked(_fp) __CLEARERR_UNLOCKED(_fp)
+#define feof_unlocked(_fp) __FEOF_UNLOCKED(_fp)
+#define ferror_unlocked(_fp) __FERROR_UNLOCKED(_fp)
+#endif
+
+__END_DECLS
+
+#endif /* <stdio.h> included. */
+
+#endif /* !_STDIO_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/stdio_ext.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/stdio_ext.h
new file mode 100644
index 0000000..23d12e0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/stdio_ext.h
@@ -0,0 +1,87 @@
+/* Functions to access FILE structure internals.
+ Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* This header contains the same definitions as the header of the same name
+ on Sun's Solaris OS. */
+
+#ifndef _STDIO_EXT_H
+#define _STDIO_EXT_H 1
+
+#include <stdio.h>
+
+enum
+{
+ /* Query current state of the locking status. */
+ FSETLOCKING_QUERY = 0,
+#define FSETLOCKING_QUERY FSETLOCKING_QUERY
+ /* The library protects all uses of the stream functions, except for
+ uses of the *_unlocked functions, by calls equivalent to flockfile(). */
+ FSETLOCKING_INTERNAL,
+#define FSETLOCKING_INTERNAL FSETLOCKING_INTERNAL
+ /* The user will take care of locking. */
+ FSETLOCKING_BYCALLER
+#define FSETLOCKING_BYCALLER FSETLOCKING_BYCALLER
+};
+
+
+__BEGIN_DECLS
+
+/* Return the size of the buffer of FP in bytes currently in use by
+ the given stream. */
+extern size_t __fbufsize (FILE *__fp) __THROW;
+
+
+/* Return non-zero value iff the stream FP is opened readonly, or if the
+ last operation on the stream was a read operation. */
+extern int __freading (FILE *__fp) __THROW;
+
+/* Return non-zero value iff the stream FP is opened write-only or
+ append-only, or if the last operation on the stream was a write
+ operation. */
+extern int __fwriting (FILE *__fp) __THROW;
+
+
+/* Return non-zero value iff stream FP is not opened write-only or
+ append-only. */
+extern int __freadable (FILE *__fp) __THROW;
+
+/* Return non-zero value iff stream FP is not opened read-only. */
+extern int __fwritable (FILE *__fp) __THROW;
+
+
+/* Return non-zero value iff the stream FP is line-buffered. */
+extern int __flbf (FILE *__fp) __THROW;
+
+
+/* Discard all pending buffered I/O on the stream FP. */
+extern void __fpurge (FILE *__fp) __THROW;
+
+/* Return amount of output in bytes pending on a stream FP. */
+extern size_t __fpending (FILE *__fp) __THROW;
+
+/* Flush all line-buffered files. */
+extern void _flushlbf (void);
+
+
+/* Set locking status of stream FP to TYPE. */
+extern int __fsetlocking (FILE *__fp, int __type) __THROW;
+
+__END_DECLS
+
+#endif /* stdio_ext.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/stdlib.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/stdlib.h
new file mode 100644
index 0000000..276f1ba
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/stdlib.h
@@ -0,0 +1,865 @@
+/* Copyright (C) 1991-2003, 2004, 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.20 General utilities <stdlib.h>
+ */
+
+#ifndef _STDLIB_H
+
+#include <features.h>
+
+/* Get size_t, wchar_t and NULL from <stddef.h>. */
+#define __need_size_t
+#ifndef __need_malloc_and_calloc
+# ifdef __UCLIBC_HAS_WCHAR__
+# define __need_wchar_t
+# endif
+# define __need_NULL
+#endif
+#include <stddef.h>
+
+__BEGIN_DECLS
+
+#ifndef __need_malloc_and_calloc
+#define _STDLIB_H 1
+
+#if defined __USE_XOPEN && !defined _SYS_WAIT_H
+/* XPG requires a few symbols from <sys/wait.h> being defined. */
+# include <bits/waitflags.h>
+# include <bits/waitstatus.h>
+
+# ifdef __USE_BSD
+
+/* Lots of hair to allow traditional BSD use of `union wait'
+ as well as POSIX.1 use of `int' for the status word. */
+
+# if defined __GNUC__ && !defined __cplusplus
+# define __WAIT_INT(status) \
+ (__extension__ ({ union { __typeof(status) __in; int __i; } __u; \
+ __u.__in = (status); __u.__i; }))
+# else
+# define __WAIT_INT(status) (*(int *) &(status))
+# endif
+
+/* This is the type of the argument to `wait'. The funky union
+ causes redeclarations with ether `int *' or `union wait *' to be
+ allowed without complaint. __WAIT_STATUS_DEFN is the type used in
+ the actual function definitions. */
+
+# if !defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus
+# define __WAIT_STATUS void *
+# define __WAIT_STATUS_DEFN void *
+# else
+/* This works in GCC 2.6.1 and later. */
+typedef union
+ {
+ union wait *__uptr;
+ int *__iptr;
+ } __WAIT_STATUS __attribute__ ((__transparent_union__));
+# define __WAIT_STATUS_DEFN int *
+# endif
+
+# else /* Don't use BSD. */
+
+# define __WAIT_INT(status) (status)
+# define __WAIT_STATUS int *
+# define __WAIT_STATUS_DEFN int *
+
+# endif /* Use BSD. */
+
+/* Define the macros <sys/wait.h> also would define this way. */
+# define WEXITSTATUS(status) __WEXITSTATUS(__WAIT_INT(status))
+# define WTERMSIG(status) __WTERMSIG(__WAIT_INT(status))
+# define WSTOPSIG(status) __WSTOPSIG(__WAIT_INT(status))
+# define WIFEXITED(status) __WIFEXITED(__WAIT_INT(status))
+# define WIFSIGNALED(status) __WIFSIGNALED(__WAIT_INT(status))
+# define WIFSTOPPED(status) __WIFSTOPPED(__WAIT_INT(status))
+# if 0 /* def __WIFCONTINUED */
+# define WIFCONTINUED(status) __WIFCONTINUED(__WAIT_INT(status))
+# endif
+#endif /* X/Open and <sys/wait.h> not included. */
+
+__BEGIN_NAMESPACE_STD
+/* Returned by `div'. */
+typedef struct
+ {
+ int quot; /* Quotient. */
+ int rem; /* Remainder. */
+ } div_t;
+
+/* Returned by `ldiv'. */
+#ifndef __ldiv_t_defined
+typedef struct
+ {
+ long int quot; /* Quotient. */
+ long int rem; /* Remainder. */
+ } ldiv_t;
+# define __ldiv_t_defined 1
+#endif
+__END_NAMESPACE_STD
+
+#if defined __USE_ISOC99 && !defined __lldiv_t_defined
+__BEGIN_NAMESPACE_C99
+/* Returned by `lldiv'. */
+__extension__ typedef struct
+ {
+ long long int quot; /* Quotient. */
+ long long int rem; /* Remainder. */
+ } lldiv_t;
+# define __lldiv_t_defined 1
+__END_NAMESPACE_C99
+#endif
+
+
+/* The largest number rand will return (same as INT_MAX). */
+#define RAND_MAX 2147483647
+
+
+/* We define these the same for all machines.
+ Changes from this to the outside world should be done in `_exit'. */
+#define EXIT_FAILURE 1 /* Failing exit status. */
+#define EXIT_SUCCESS 0 /* Successful exit status. */
+
+
+/* Maximum length of a multibyte character in the current locale. */
+#if 0
+#define MB_CUR_MAX (__ctype_get_mb_cur_max ())
+extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
+#endif
+#ifdef __UCLIBC_HAS_WCHAR__
+#define MB_CUR_MAX (_stdlib_mb_cur_max ())
+extern size_t _stdlib_mb_cur_max (void) __THROW __wur;
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+#ifdef __UCLIBC_HAS_FLOATS__
+/* Convert a string to a floating-point number. */
+extern double atof (__const char *__nptr)
+ __THROW __attribute_pure__ __nonnull ((1)) __wur;
+#endif /* __UCLIBC_HAS_FLOATS__ */
+/* Convert a string to an integer. */
+extern int atoi (__const char *__nptr)
+ __THROW __attribute_pure__ __nonnull ((1)) __wur;
+/* Convert a string to a long integer. */
+extern long int atol (__const char *__nptr)
+ __THROW __attribute_pure__ __nonnull ((1)) __wur;
+__END_NAMESPACE_STD
+
+#if defined __USE_ISOC99 || defined __USE_MISC
+__BEGIN_NAMESPACE_C99
+/* Convert a string to a long long integer. */
+__extension__ extern long long int atoll (__const char *__nptr)
+ __THROW __attribute_pure__ __nonnull ((1)) __wur;
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __UCLIBC_HAS_FLOATS__
+__BEGIN_NAMESPACE_STD
+/* Convert a string to a floating-point number. */
+extern double strtod (__const char *__restrict __nptr,
+ char **__restrict __endptr)
+ __THROW __nonnull ((1)) __wur;
+__END_NAMESPACE_STD
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Likewise for `float' and `long double' sizes of floating-point numbers. */
+extern float strtof (__const char *__restrict __nptr,
+ char **__restrict __endptr) __THROW __nonnull ((1)) __wur;
+
+extern long double strtold (__const char *__restrict __nptr,
+ char **__restrict __endptr)
+ __THROW __nonnull ((1)) __wur;
+__END_NAMESPACE_C99
+#endif
+#endif /* __UCLIBC_HAS_FLOATS__ */
+
+__BEGIN_NAMESPACE_STD
+/* Convert a string to a long integer. */
+extern long int strtol (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base)
+ __THROW __nonnull ((1)) __wur;
+/* Convert a string to an unsigned long integer. */
+extern unsigned long int strtoul (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base)
+ __THROW __nonnull ((1)) __wur;
+__END_NAMESPACE_STD
+
+#ifdef __USE_BSD
+/* Convert a string to a quadword integer. */
+__extension__
+extern long long int strtoq (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base)
+ __THROW __nonnull ((1)) __wur;
+/* Convert a string to an unsigned quadword integer. */
+__extension__
+extern unsigned long long int strtouq (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base)
+ __THROW __nonnull ((1)) __wur;
+#endif /* GCC and use BSD. */
+
+#if defined __USE_ISOC99 || defined __USE_MISC
+__BEGIN_NAMESPACE_C99
+/* Convert a string to a quadword integer. */
+__extension__
+extern long long int strtoll (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base)
+ __THROW __nonnull ((1)) __wur;
+/* Convert a string to an unsigned quadword integer. */
+__extension__
+extern unsigned long long int strtoull (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base)
+ __THROW __nonnull ((1)) __wur;
+__END_NAMESPACE_C99
+#endif /* ISO C99 or GCC and use MISC. */
+
+
+#ifdef __UCLIBC_HAS_XLOCALE__
+#ifdef __USE_GNU
+/* The concept of one static locale per category is not very well
+ thought out. Many applications will need to process its data using
+ information from several different locales. Another application is
+ the implementation of the internationalization handling in the
+ upcoming ISO C++ standard library. To support this another set of
+ the functions using locale data exist which have an additional
+ argument.
+
+ Attention: all these functions are *not* standardized in any form.
+ This is a proof-of-concept implementation. */
+
+/* Structure for reentrant locale using functions. This is an
+ (almost) opaque type for the user level programs. */
+# include <xlocale.h>
+
+/* Special versions of the functions above which take the locale to
+ use as an additional parameter. */
+extern long int strtol_l (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base,
+ __locale_t __loc) __THROW __nonnull ((1, 4)) __wur;
+
+extern unsigned long int strtoul_l (__const char *__restrict __nptr,
+ char **__restrict __endptr,
+ int __base, __locale_t __loc)
+ __THROW __nonnull ((1, 4)) __wur;
+
+__extension__
+extern long long int strtoll_l (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base,
+ __locale_t __loc)
+ __THROW __nonnull ((1, 4)) __wur;
+
+__extension__
+extern unsigned long long int strtoull_l (__const char *__restrict __nptr,
+ char **__restrict __endptr,
+ int __base, __locale_t __loc)
+ __THROW __nonnull ((1, 4)) __wur;
+
+#ifdef __UCLIBC_HAS_FLOATS__
+extern double strtod_l (__const char *__restrict __nptr,
+ char **__restrict __endptr, __locale_t __loc)
+ __THROW __nonnull ((1, 3)) __wur;
+
+extern float strtof_l (__const char *__restrict __nptr,
+ char **__restrict __endptr, __locale_t __loc)
+ __THROW __nonnull ((1, 3)) __wur;
+
+extern long double strtold_l (__const char *__restrict __nptr,
+ char **__restrict __endptr,
+ __locale_t __loc)
+ __THROW __nonnull ((1, 3)) __wur;
+#endif /* __UCLIBC_HAS_FLOATS__ */
+
+#endif /* GNU */
+#endif /* __UCLIBC_HAS_XLOCALE__ */
+
+
+#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED
+/* Convert N to base 64 using the digits "./0-9A-Za-z", least-significant
+ digit first. Returns a pointer to static storage overwritten by the
+ next call. */
+extern char *l64a (long int __n) __THROW __wur;
+
+/* Read a number from a string S in base 64 as above. */
+extern long int a64l (__const char *__s)
+ __THROW __attribute_pure__ __nonnull ((1)) __wur;
+
+#endif /* Use SVID || extended X/Open. */
+
+#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED || defined __USE_BSD
+# include <sys/types.h> /* we need int32_t... */
+
+/* These are the functions that actually do things. The `random', `srandom',
+ `initstate' and `setstate' functions are those from BSD Unices.
+ The `rand' and `srand' functions are required by the ANSI standard.
+ We provide both interfaces to the same random number generator. */
+/* Return a random long integer between 0 and RAND_MAX inclusive. */
+extern long int random (void) __THROW;
+
+/* Seed the random number generator with the given number. */
+extern void srandom (unsigned int __seed) __THROW;
+
+/* Initialize the random number generator to use state buffer STATEBUF,
+ of length STATELEN, and seed it with SEED. Optimal lengths are 8, 16,
+ 32, 64, 128 and 256, the bigger the better; values less than 8 will
+ cause an error and values greater than 256 will be rounded down. */
+extern char *initstate (unsigned int __seed, char *__statebuf,
+ size_t __statelen) __THROW __nonnull ((2));
+
+/* Switch the random number generator to state buffer STATEBUF,
+ which should have been previously initialized by `initstate'. */
+extern char *setstate (char *__statebuf) __THROW __nonnull ((1));
+
+
+# ifdef __USE_MISC
+/* Reentrant versions of the `random' family of functions.
+ These functions all use the following data structure to contain
+ state, rather than global state variables. */
+
+struct random_data
+ {
+ int32_t *fptr; /* Front pointer. */
+ int32_t *rptr; /* Rear pointer. */
+ int32_t *state; /* Array of state values. */
+ int rand_type; /* Type of random number generator. */
+ int rand_deg; /* Degree of random number generator. */
+ int rand_sep; /* Distance between front and rear. */
+ int32_t *end_ptr; /* Pointer behind state table. */
+ };
+
+extern int random_r (struct random_data *__restrict __buf,
+ int32_t *__restrict __result) __THROW __nonnull ((1, 2));
+
+extern int srandom_r (unsigned int __seed, struct random_data *__buf)
+ __THROW __nonnull ((2));
+
+extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
+ size_t __statelen,
+ struct random_data *__restrict __buf)
+ __THROW __nonnull ((2, 4));
+
+extern int setstate_r (char *__restrict __statebuf,
+ struct random_data *__restrict __buf)
+ __THROW __nonnull ((1, 2));
+# endif /* Use misc. */
+#endif /* Use SVID || extended X/Open || BSD. */
+
+
+__BEGIN_NAMESPACE_STD
+/* Return a random integer between 0 and RAND_MAX inclusive. */
+extern int rand (void) __THROW;
+/* Seed the random number generator with the given number. */
+extern void srand (unsigned int __seed) __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_POSIX
+/* Reentrant interface according to POSIX.1. */
+extern int rand_r (unsigned int *__seed) __THROW;
+#endif
+
+
+#if defined __USE_SVID || defined __USE_XOPEN
+/* System V style 48-bit random number generator functions. */
+
+#ifdef __UCLIBC_HAS_FLOATS__
+/* Return non-negative, double-precision floating-point value in [0.0,1.0). */
+extern double drand48 (void) __THROW;
+extern double erand48 (unsigned short int __xsubi[3]) __THROW __nonnull ((1));
+#endif /* __UCLIBC_HAS_FLOATS__ */
+
+/* Return non-negative, long integer in [0,2^31). */
+extern long int lrand48 (void) __THROW;
+extern long int nrand48 (unsigned short int __xsubi[3])
+ __THROW __nonnull ((1));
+
+/* Return signed, long integers in [-2^31,2^31). */
+extern long int mrand48 (void) __THROW;
+extern long int jrand48 (unsigned short int __xsubi[3])
+ __THROW __nonnull ((1));
+
+/* Seed random number generator. */
+extern void srand48 (long int __seedval) __THROW;
+extern unsigned short int *seed48 (unsigned short int __seed16v[3])
+ __THROW __nonnull ((1));
+extern void lcong48 (unsigned short int __param[7]) __THROW __nonnull ((1));
+
+# ifdef __USE_MISC
+/* Data structure for communication with thread safe versions. This
+ type is to be regarded as opaque. It's only exported because users
+ have to allocate objects of this type. */
+struct drand48_data
+ {
+ unsigned short int __x[3]; /* Current state. */
+ unsigned short int __old_x[3]; /* Old state. */
+ unsigned short int __c; /* Additive const. in congruential formula. */
+ unsigned short int __init; /* Flag for initializing. */
+ unsigned long long int __a; /* Factor in congruential formula. */
+ };
+
+#ifdef __UCLIBC_HAS_FLOATS__
+/* Return non-negative, double-precision floating-point value in [0.0,1.0). */
+extern int drand48_r (struct drand48_data *__restrict __buffer,
+ double *__restrict __result) __THROW __nonnull ((1, 2));
+extern int erand48_r (unsigned short int __xsubi[3],
+ struct drand48_data *__restrict __buffer,
+ double *__restrict __result) __THROW __nonnull ((1, 2));
+#endif /* __UCLIBC_HAS_FLOATS__ */
+
+/* Return non-negative, long integer in [0,2^31). */
+extern int lrand48_r (struct drand48_data *__restrict __buffer,
+ long int *__restrict __result)
+ __THROW __nonnull ((1, 2));
+extern int nrand48_r (unsigned short int __xsubi[3],
+ struct drand48_data *__restrict __buffer,
+ long int *__restrict __result)
+ __THROW __nonnull ((1, 2));
+
+/* Return signed, long integers in [-2^31,2^31). */
+extern int mrand48_r (struct drand48_data *__restrict __buffer,
+ long int *__restrict __result)
+ __THROW __nonnull ((1, 2));
+extern int jrand48_r (unsigned short int __xsubi[3],
+ struct drand48_data *__restrict __buffer,
+ long int *__restrict __result)
+ __THROW __nonnull ((1, 2));
+
+/* Seed random number generator. */
+extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
+ __THROW __nonnull ((2));
+
+extern int seed48_r (unsigned short int __seed16v[3],
+ struct drand48_data *__buffer) __THROW __nonnull ((1, 2));
+
+extern int lcong48_r (unsigned short int __param[7],
+ struct drand48_data *__buffer)
+ __THROW __nonnull ((1, 2));
+# endif /* Use misc. */
+#endif /* Use SVID or X/Open. */
+
+#endif /* don't just need malloc and calloc */
+
+#ifndef __malloc_and_calloc_defined
+# define __malloc_and_calloc_defined
+__BEGIN_NAMESPACE_STD
+/* Allocate SIZE bytes of memory. */
+extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
+/* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */
+extern void *calloc (size_t __nmemb, size_t __size)
+ __THROW __attribute_malloc__ __wur;
+__END_NAMESPACE_STD
+#endif
+
+#ifndef __need_malloc_and_calloc
+__BEGIN_NAMESPACE_STD
+/* Re-allocate the previously allocated block
+ in PTR, making the new block SIZE bytes long. */
+extern void *realloc (void *__ptr, size_t __size)
+ __THROW __attribute_malloc__ __attribute_warn_unused_result__;
+/* Free a block allocated by `malloc', `realloc' or `calloc'. */
+extern void free (void *__ptr) __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_MISC
+/* Free a block. An alias for `free'. (Sun Unices). */
+extern void cfree (void *__ptr) __THROW;
+#endif /* Use misc. */
+
+#if defined __USE_GNU || defined __USE_BSD || defined __USE_MISC
+# include <alloca.h>
+#endif /* Use GNU, BSD, or misc. */
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Allocate SIZE bytes on a page boundary. The storage cannot be freed. */
+extern void *valloc (size_t __size) __THROW __attribute_malloc__ __wur;
+#endif
+
+#ifdef __USE_XOPEN2K
+/* Allocate memory of SIZE bytes with an alignment of ALIGNMENT. */
+extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
+ __THROW __nonnull ((1)) __wur;
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Abort execution and generate a core-dump. */
+extern void abort (void) __THROW __attribute__ ((__noreturn__));
+
+
+/* Register a function to be called when `exit' is called. */
+extern int atexit (void (*__func) (void)) __THROW __nonnull ((1));
+__END_NAMESPACE_STD
+
+#ifdef __USE_MISC
+/* Register a function to be called with the status
+ given to `exit' and the given argument. */
+extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
+ __THROW __nonnull ((1));
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Call all functions registered with `atexit' and `on_exit',
+ in the reverse of the order in which they were registered
+ perform stdio cleanup, and terminate program execution with STATUS. */
+extern void exit (int __status) __THROW __attribute__ ((__noreturn__));
+__END_NAMESPACE_STD
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Terminate the program with STATUS without calling any of the
+ functions registered with `atexit' or `on_exit'. */
+extern void _Exit (int __status) __THROW __attribute__ ((__noreturn__));
+__END_NAMESPACE_C99
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Return the value of envariable NAME, or NULL if it doesn't exist. */
+extern char *getenv (__const char *__name) __THROW __nonnull ((1)) __wur;
+__END_NAMESPACE_STD
+
+/* This function is similar to the above but returns NULL if the
+ programs is running with SUID or SGID enabled. */
+extern char *__secure_getenv (__const char *__name)
+ __THROW __nonnull ((1)) __wur;
+
+#if defined __USE_SVID || defined __USE_XOPEN
+/* The SVID says this is in <stdio.h>, but this seems a better place. */
+/* Put STRING, which is of the form "NAME=VALUE", in the environment.
+ If there is no `=', remove NAME from the environment. */
+extern int putenv (char *__string) __THROW __nonnull ((1));
+#endif
+
+#if defined __USE_BSD || defined __USE_XOPEN2K
+/* Set NAME to VALUE in the environment.
+ If REPLACE is nonzero, overwrite an existing value. */
+extern int setenv (__const char *__name, __const char *__value, int __replace)
+ __THROW __nonnull ((2));
+
+/* Remove the variable NAME from the environment. */
+extern int unsetenv (__const char *__name) __THROW;
+#endif
+
+/* The following is used by uClibc in atexit.c and sysconf.c */
+/* We have no limit when __UCLIBC_DYNAMIC_ATEXIT__ is enabled. */
+#ifdef __UCLIBC_DYNAMIC_ATEXIT__
+# define __UCLIBC_MAX_ATEXIT INT_MAX
+#else
+# define __UCLIBC_MAX_ATEXIT 20
+#endif
+
+
+#ifdef __USE_MISC
+/* The `clearenv' was planned to be added to POSIX.1 but probably
+ never made it. Nevertheless the POSIX.9 standard (POSIX bindings
+ for Fortran 77) requires this function. */
+extern int clearenv (void) __THROW;
+#endif
+
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
+/* Generate a unique temporary file name from TEMPLATE.
+ The last six characters of TEMPLATE must be "XXXXXX";
+ they are replaced with a string that makes the file name unique.
+ Returns TEMPLATE, or a null pointer if it cannot get a unique file name. */
+extern char *mktemp (char *__template) __THROW __nonnull ((1)) __wur;
+
+/* Generate a unique temporary file name from TEMPLATE.
+ The last six characters of TEMPLATE must be "XXXXXX";
+ they are replaced with a string that makes the filename unique.
+ Returns a file descriptor open on the file for reading and writing,
+ or -1 if it cannot create a uniquely-named file.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+# ifndef __USE_FILE_OFFSET64
+extern int mkstemp (char *__template) __nonnull ((1)) __wur;
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (mkstemp, (char *__template), mkstemp64)
+ __nonnull ((1)) __wur;
+# else
+# define mkstemp mkstemp64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int mkstemp64 (char *__template) __nonnull ((1)) __wur;
+# endif
+#endif
+
+#ifdef __USE_BSD
+/* Create a unique temporary directory from TEMPLATE.
+ The last six characters of TEMPLATE must be "XXXXXX";
+ they are replaced with a string that makes the directory name unique.
+ Returns TEMPLATE, or a null pointer if it cannot get a unique name.
+ The directory is created mode 700. */
+extern char *mkdtemp (char *__template) __THROW __nonnull ((1)) __wur;
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Execute the given line as a shell command.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int system (__const char *__command) __wur;
+__END_NAMESPACE_STD
+
+
+#if 0 /* def __USE_GNU */
+/* Return a malloc'd string containing the canonical absolute name of the
+ named file. The last file name component need not exist, and may be a
+ symlink to a nonexistent file. */
+extern char *canonicalize_file_name (__const char *__name)
+ __THROW __nonnull ((1)) __wur;
+#endif
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Return the canonical absolute name of file NAME. The last file name
+ component need not exist, and may be a symlink to a nonexistent file.
+ If RESOLVED is null, the result is malloc'd; otherwise, if the canonical
+ name is PATH_MAX chars or more, returns null with `errno' set to
+ ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars, returns the
+ name in RESOLVED. */
+/* we choose to handle __resolved==NULL as crash :) */
+extern char *realpath (__const char *__restrict __name,
+ char *__restrict __resolved) __THROW __wur __nonnull((2));
+#endif
+
+
+/* Shorthand for type of comparison functions. */
+#ifndef __COMPAR_FN_T
+# define __COMPAR_FN_T
+typedef int (*__compar_fn_t) (__const void *, __const void *);
+
+# ifdef __USE_GNU
+typedef __compar_fn_t comparison_fn_t;
+# endif
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Do a binary search for KEY in BASE, which consists of NMEMB elements
+ of SIZE bytes each, using COMPAR to perform the comparisons. */
+extern void *bsearch (__const void *__key, __const void *__base,
+ size_t __nmemb, size_t __size, __compar_fn_t __compar)
+ __nonnull ((1, 2, 5)) __wur;
+
+/* Sort NMEMB elements of BASE, of SIZE bytes each,
+ using COMPAR to perform the comparisons. */
+extern void qsort (void *__base, size_t __nmemb, size_t __size,
+ __compar_fn_t __compar) __nonnull ((1, 4));
+
+
+/* Return the absolute value of X. */
+extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
+extern long int labs (long int __x) __THROW __attribute__ ((__const__)) __wur;
+__END_NAMESPACE_STD
+
+#ifdef __USE_ISOC99
+__extension__ extern long long int llabs (long long int __x)
+ __THROW __attribute__ ((__const__)) __wur;
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Return the `div_t', `ldiv_t' or `lldiv_t' representation
+ of the value of NUMER over DENOM. */
+/* GCC may have built-ins for these someday. */
+extern div_t div (int __numer, int __denom)
+ __THROW __attribute__ ((__const__)) __wur;
+extern ldiv_t ldiv (long int __numer, long int __denom)
+ __THROW __attribute__ ((__const__)) __wur;
+__END_NAMESPACE_STD
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+__extension__ extern lldiv_t lldiv (long long int __numer,
+ long long int __denom)
+ __THROW __attribute__ ((__const__)) __wur;
+__END_NAMESPACE_C99
+#endif
+
+
+#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED || defined __USE_BSD
+/* Convert floating point numbers to strings. The returned values are
+ valid only until another call to the same function. */
+
+# ifdef __UCLIBC_SUSV3_LEGACY__
+
+#if 0
+/* Convert VALUE to a string with NDIGIT digits and return a pointer to
+ this. Set *DECPT with the position of the decimal character and *SIGN
+ with the sign of the number. */
+extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
+ int *__restrict __sign) __THROW __nonnull ((3, 4)) __wur;
+
+/* Convert VALUE to a string rounded to NDIGIT decimal digits. Set *DECPT
+ with the position of the decimal character and *SIGN with the sign of
+ the number. */
+extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
+ int *__restrict __sign) __THROW __nonnull ((3, 4)) __wur;
+#endif
+
+/* If possible convert VALUE to a string with NDIGIT significant digits.
+ Otherwise use exponential representation. The resulting string will
+ be written to BUF. */
+extern char *gcvt (double __value, int __ndigit, char *__buf)
+ __THROW __nonnull ((3)) __wur;
+# endif /* __UCLIBC_SUSV3_LEGACY__ */
+
+# if 0 /*def __USE_MISC*/
+/* Long double versions of above functions. */
+extern char *qecvt (long double __value, int __ndigit,
+ int *__restrict __decpt, int *__restrict __sign)
+ __THROW __nonnull ((3, 4)) __wur;
+extern char *qfcvt (long double __value, int __ndigit,
+ int *__restrict __decpt, int *__restrict __sign)
+ __THROW __nonnull ((3, 4)) __wur;
+extern char *qgcvt (long double __value, int __ndigit, char *__buf)
+ __THROW __nonnull ((3)) __wur;
+
+
+/* Reentrant version of the functions above which provide their own
+ buffers. */
+extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
+ int *__restrict __sign, char *__restrict __buf,
+ size_t __len) __THROW __nonnull ((3, 4, 5));
+extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
+ int *__restrict __sign, char *__restrict __buf,
+ size_t __len) __THROW __nonnull ((3, 4, 5));
+
+extern int qecvt_r (long double __value, int __ndigit,
+ int *__restrict __decpt, int *__restrict __sign,
+ char *__restrict __buf, size_t __len)
+ __THROW __nonnull ((3, 4, 5));
+extern int qfcvt_r (long double __value, int __ndigit,
+ int *__restrict __decpt, int *__restrict __sign,
+ char *__restrict __buf, size_t __len)
+ __THROW __nonnull ((3, 4, 5));
+# endif /* misc */
+#endif /* use MISC || use X/Open Unix */
+
+#ifdef __UCLIBC_HAS_WCHAR__
+__BEGIN_NAMESPACE_STD
+/* Return the length of the multibyte character
+ in S, which is no longer than N. */
+extern int mblen (__const char *__s, size_t __n) __THROW __wur;
+/* Return the length of the given multibyte character,
+ putting its `wchar_t' representation in *PWC. */
+extern int mbtowc (wchar_t *__restrict __pwc,
+ __const char *__restrict __s, size_t __n) __THROW __wur;
+/* Put the multibyte character represented
+ by WCHAR in S, returning its length. */
+extern int wctomb (char *__s, wchar_t __wchar) __THROW __wur;
+
+
+/* Convert a multibyte string to a wide char string. */
+extern size_t mbstowcs (wchar_t *__restrict __pwcs,
+ __const char *__restrict __s, size_t __n) __THROW;
+/* Convert a wide char string to multibyte string. */
+extern size_t wcstombs (char *__restrict __s,
+ __const wchar_t *__restrict __pwcs, size_t __n)
+ __THROW;
+__END_NAMESPACE_STD
+#endif /* __UCLIBC_HAS_WCHAR__ */
+
+
+#ifdef __USE_SVID
+/* Determine whether the string value of RESPONSE matches the affirmation
+ or negative response expression as specified by the LC_MESSAGES category
+ in the program's current locale. Returns 1 if affirmative, 0 if
+ negative, and -1 if not matching. */
+extern int rpmatch (__const char *__response) __THROW __nonnull ((1)) __wur;
+#endif
+
+
+#ifdef __USE_XOPEN_EXTENDED
+/* Parse comma separated suboption from *OPTIONP and match against
+ strings in TOKENS. If found return index and set *VALUEP to
+ optional value introduced by an equal sign. If the suboption is
+ not part of TOKENS return in *VALUEP beginning of unknown
+ suboption. On exit *OPTIONP is set to the beginning of the next
+ token or at the terminating NUL character. */
+extern int getsubopt (char **__restrict __optionp,
+ char *__const *__restrict __tokens,
+ char **__restrict __valuep)
+ __THROW __nonnull ((1, 2, 3)) __wur;
+#endif
+
+
+#ifdef __USE_XOPEN
+/* Setup DES tables according KEY. */
+extern void setkey (__const char *__key) __THROW __nonnull ((1));
+#endif
+
+
+/* X/Open pseudo terminal handling. */
+
+#ifdef __USE_XOPEN2K
+/* Return a master pseudo-terminal handle. */
+extern int posix_openpt (int __oflag) __wur;
+#endif
+
+#ifdef __USE_XOPEN
+/* The next four functions all take a master pseudo-tty fd and
+ perform an operation on the associated slave: */
+
+/* Chown the slave to the calling user. */
+extern int grantpt (int __fd) __THROW;
+
+/* Release an internal lock so the slave can be opened.
+ Call after grantpt(). */
+extern int unlockpt (int __fd) __THROW;
+
+/* Return the pathname of the pseudo terminal slave assoicated with
+ the master FD is open on, or NULL on errors.
+ The returned storage is good until the next call to this function. */
+extern char *ptsname (int __fd) __THROW __wur;
+#endif
+
+#ifdef __USE_GNU
+/* Store at most BUFLEN characters of the pathname of the slave pseudo
+ terminal associated with the master FD is open on in BUF.
+ Return 0 on success, otherwise an error number. */
+extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
+ __THROW __nonnull ((2));
+
+/* Open a master pseudo terminal and return its file descriptor. */
+extern int getpt (void);
+#endif
+
+#if 0 /* def __USE_BSD */
+/* Put the 1 minute, 5 minute and 15 minute load averages into the first
+ NELEM elements of LOADAVG. Return the number written (never more than
+ three, but may be less than NELEM), or -1 if an error occurred. */
+extern int getloadavg (double __loadavg[], int __nelem)
+ __THROW __nonnull ((1));
+#endif
+
+#ifdef __UCLIBC_HAS_ARC4RANDOM__
+#include <stdint.h>
+extern uint32_t arc4random(void);
+extern void arc4random_stir(void);
+extern void arc4random_addrandom(unsigned char *, int);
+#endif
+
+#endif /* don't just need malloc and calloc */
+#undef __need_malloc_and_calloc
+
+__END_DECLS
+
+#endif /* stdlib.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/string.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/string.h
new file mode 100644
index 0000000..87d9534
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/string.h
@@ -0,0 +1,437 @@
+/* Copyright (C) 1991-1993, 1995-2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.21 String handling <string.h>
+ */
+
+#ifndef _STRING_H
+#define _STRING_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Get size_t and NULL from <stddef.h>. */
+#define __need_size_t
+#define __need_NULL
+#include <stddef.h>
+
+
+__BEGIN_NAMESPACE_STD
+/* Copy N bytes of SRC to DEST. */
+extern void *memcpy (void *__restrict __dest,
+ __const void *__restrict __src, size_t __n)
+ __THROW __nonnull ((1, 2));
+/* Copy N bytes of SRC to DEST, guaranteeing
+ correct behavior for overlapping strings. */
+extern void *memmove (void *__dest, __const void *__src, size_t __n)
+ __THROW __nonnull ((1, 2));
+__END_NAMESPACE_STD
+
+/* Copy no more than N bytes of SRC to DEST, stopping when C is found.
+ Return the position in DEST one byte past where C was copied,
+ or NULL if C was not found in the first N bytes of SRC. */
+#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN
+extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
+ int __c, size_t __n)
+ __THROW __nonnull ((1, 2));
+#endif /* SVID. */
+
+
+__BEGIN_NAMESPACE_STD
+/* Set N bytes of S to C. */
+extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
+
+/* Compare N bytes of S1 and S2. */
+extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+
+/* Search N bytes of S for C. */
+extern void *memchr (__const void *__s, int __c, size_t __n)
+ __THROW __attribute_pure__ __nonnull ((1));
+__END_NAMESPACE_STD
+
+#ifdef __USE_GNU
+/* Search in S for C. This is similar to `memchr' but there is no
+ length limit. */
+extern void *rawmemchr (__const void *__s, int __c)
+ __THROW __attribute_pure__ __nonnull ((1));
+
+/* Search N bytes of S for the final occurrence of C. */
+extern void *memrchr (__const void *__s, int __c, size_t __n)
+ __THROW __attribute_pure__ __nonnull ((1));
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Copy SRC to DEST. */
+extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
+ __THROW __nonnull ((1, 2));
+/* Copy no more than N characters of SRC to DEST. */
+extern char *strncpy (char *__restrict __dest,
+ __const char *__restrict __src, size_t __n)
+ __THROW __nonnull ((1, 2));
+
+/* Append SRC onto DEST. */
+extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
+ __THROW __nonnull ((1, 2));
+/* Append no more than N characters from SRC onto DEST. */
+extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
+ size_t __n) __THROW __nonnull ((1, 2));
+
+/* Compare S1 and S2. */
+extern int strcmp (__const char *__s1, __const char *__s2)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+/* Compare N characters of S1 and S2. */
+extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+
+/* Compare the collated forms of S1 and S2. */
+extern int strcoll (__const char *__s1, __const char *__s2)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+/* Put a transformation of SRC into no more than N bytes of DEST. */
+extern size_t strxfrm (char *__restrict __dest,
+ __const char *__restrict __src, size_t __n)
+ __THROW __nonnull ((2));
+__END_NAMESPACE_STD
+
+#if defined __USE_GNU && defined __UCLIBC_HAS_XLOCALE__
+/* The following functions are equivalent to the both above but they
+ take the locale they use for the collation as an extra argument.
+ This is not standardsized but something like will come. */
+# include <xlocale.h>
+
+/* Compare the collated forms of S1 and S2 using rules from L. */
+extern int strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l)
+ __THROW __attribute_pure__ __nonnull ((1, 2, 3));
+/* Put a transformation of SRC into no more than N bytes of DEST. */
+extern size_t strxfrm_l (char *__dest, __const char *__src, size_t __n,
+ __locale_t __l) __THROW __nonnull ((2, 4));
+#endif
+
+#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Duplicate S, returning an identical malloc'd string. */
+extern char *strdup (__const char *__s)
+ __THROW __attribute_malloc__ __nonnull ((1));
+#endif
+
+/* Return a malloc'd copy of at most N bytes of STRING. The
+ resultant string is terminated even if no null terminator
+ appears before STRING[N]. */
+#if defined __USE_GNU
+extern char *strndup (__const char *__string, size_t __n)
+ __THROW __attribute_malloc__ __nonnull ((1));
+#endif
+
+#if defined __USE_GNU && defined __GNUC__
+/* Duplicate S, returning an identical alloca'd string. */
+# define strdupa(s) \
+ (__extension__ \
+ ({ \
+ __const char *__old = (s); \
+ size_t __len = strlen (__old) + 1; \
+ char *__new = (char *) __builtin_alloca (__len); \
+ (char *) memcpy (__new, __old, __len); \
+ }))
+
+/* Return an alloca'd copy of at most N bytes of string. */
+# define strndupa(s, n) \
+ (__extension__ \
+ ({ \
+ __const char *__old = (s); \
+ size_t __len = strnlen (__old, (n)); \
+ char *__new = (char *) __builtin_alloca (__len + 1); \
+ __new[__len] = '\0'; \
+ (char *) memcpy (__new, __old, __len); \
+ }))
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Find the first occurrence of C in S. */
+extern char *strchr (__const char *__s, int __c)
+ __THROW __attribute_pure__ __nonnull ((1));
+/* Find the last occurrence of C in S. */
+extern char *strrchr (__const char *__s, int __c)
+ __THROW __attribute_pure__ __nonnull ((1));
+__END_NAMESPACE_STD
+
+#ifdef __USE_GNU
+/* This function is similar to `strchr'. But it returns a pointer to
+ the closing NUL byte in case C is not found in S. */
+extern char *strchrnul (__const char *__s, int __c)
+ __THROW __attribute_pure__ __nonnull ((1));
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Return the length of the initial segment of S which
+ consists entirely of characters not in REJECT. */
+extern size_t strcspn (__const char *__s, __const char *__reject)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+/* Return the length of the initial segment of S which
+ consists entirely of characters in ACCEPT. */
+extern size_t strspn (__const char *__s, __const char *__accept)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+/* Find the first occurrence in S of any character in ACCEPT. */
+extern char *strpbrk (__const char *__s, __const char *__accept)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+/* Find the first occurrence of NEEDLE in HAYSTACK. */
+extern char *strstr (__const char *__haystack, __const char *__needle)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+
+
+/* Divide S into tokens separated by characters in DELIM. */
+extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
+ __THROW __nonnull ((2));
+__END_NAMESPACE_STD
+
+/* Divide S into tokens separated by characters in DELIM. Information
+ passed between calls are stored in SAVE_PTR. */
+#if 0 /* uClibc: disabled */
+extern char *__strtok_r (char *__restrict __s,
+ __const char *__restrict __delim,
+ char **__restrict __save_ptr)
+ __THROW __nonnull ((2, 3));
+#endif
+#if defined __USE_POSIX || defined __USE_MISC
+extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
+ char **__restrict __save_ptr)
+ __THROW __nonnull ((2, 3));
+#endif
+
+#ifdef __USE_GNU
+/* Similar to `strstr' but this function ignores the case of both strings. */
+extern char *strcasestr (__const char *__haystack, __const char *__needle)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+#endif
+
+#ifdef __USE_GNU
+/* Find the first occurrence of NEEDLE in HAYSTACK.
+ NEEDLE is NEEDLELEN bytes long;
+ HAYSTACK is HAYSTACKLEN bytes long. */
+extern void *memmem (__const void *__haystack, size_t __haystacklen,
+ __const void *__needle, size_t __needlelen)
+ __THROW __attribute_pure__ __nonnull ((1, 3));
+
+/* Copy N bytes of SRC to DEST, return pointer to bytes after the
+ last written byte. */
+#if 0 /* uClibc: disabled */
+extern void *__mempcpy (void *__restrict __dest,
+ __const void *__restrict __src, size_t __n)
+ __THROW __nonnull ((1, 2));
+#endif
+extern void *mempcpy (void *__restrict __dest,
+ __const void *__restrict __src, size_t __n)
+ __THROW __nonnull ((1, 2));
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Return the length of S. */
+extern size_t strlen (__const char *__s)
+ __THROW __attribute_pure__ __nonnull ((1));
+__END_NAMESPACE_STD
+
+#ifdef __USE_GNU
+/* Find the length of STRING, but scan at most MAXLEN characters.
+ If no '\0' terminator is found in that many characters, return MAXLEN. */
+extern size_t strnlen (__const char *__string, size_t __maxlen)
+ __THROW __attribute_pure__ __nonnull ((1));
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Return a string describing the meaning of the `errno' code in ERRNUM. */
+extern char *strerror (int __errnum) __THROW;
+__END_NAMESPACE_STD
+#if defined __USE_XOPEN2K || defined __USE_MISC
+/* Reentrant version of `strerror'.
+ There are 2 flavors of `strerror_r', GNU which returns the string
+ and may or may not use the supplied temporary buffer and POSIX one
+ which fills the string into the buffer.
+ To use the POSIX version, -D_XOPEN_SOURCE=600 or -D_POSIX_C_SOURCE=200112L
+ without -D_GNU_SOURCE is needed, otherwise the GNU version is
+ preferred. */
+# if defined __USE_XOPEN2K && !defined __USE_GNU
+/* Fill BUF with a string describing the meaning of the `errno' code in
+ ERRNUM. */
+extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen)
+ __THROW __nonnull ((2));
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (strerror_r,
+ (int __errnum, char *__buf, size_t __buflen),
+ __xpg_strerror_r) __nonnull ((2));
+# else
+# define strerror_r __xpg_strerror_r
+# endif
+# else
+/* If a temporary buffer is required, at most BUFLEN bytes of BUF will be
+ used. */
+extern char *__glibc_strerror_r (int __errnum, char *__buf, size_t __buflen)
+ __THROW __nonnull ((2));
+# ifdef __REDIRECT_NTH
+extern char * __REDIRECT_NTH (strerror_r,
+ (int __errnum, char *__buf, size_t __buflen),
+ __glibc_strerror_r) __nonnull ((2));
+# else
+# define strerror_r __glibc_strerror_r
+# endif
+# endif
+#endif
+
+/* We define this function always since `bzero' is sometimes needed when
+ the namespace rules does not allow this. */
+#if 0 /* uClibc: disabled */
+extern void __bzero (void *__s, size_t __n) __THROW __nonnull ((1));
+#endif
+
+#ifdef __USE_BSD
+# ifdef __UCLIBC_SUSV3_LEGACY__
+/* Copy N bytes of SRC to DEST (like memmove, but args reversed). */
+extern void bcopy (__const void *__src, void *__dest, size_t __n)
+ __THROW __nonnull ((1, 2));
+
+/* Set N bytes of S to 0. */
+extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1));
+
+/* Compare N bytes of S1 and S2 (same as memcmp). */
+extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+
+/* Find the first occurrence of C in S (same as strchr). */
+extern char *index (__const char *__s, int __c)
+ __THROW __attribute_pure__ __nonnull ((1));
+
+/* Find the last occurrence of C in S (same as strrchr). */
+extern char *rindex (__const char *__s, int __c)
+ __THROW __attribute_pure__ __nonnull ((1));
+# else
+# ifdef __UCLIBC_SUSV3_LEGACY_MACROS__
+/* bcopy/bzero/bcmp/index/rindex are marked LEGACY in SuSv3.
+ * They are replaced as proposed by SuSv3. Don't sync this part
+ * with glibc and keep it in sync with strings.h. */
+
+# define bcopy(src,dest,n) (memmove((dest), (src), (n)), (void) 0)
+# define bzero(s,n) (memset((s), '\0', (n)), (void) 0)
+# define bcmp(s1,s2,n) memcmp((s1), (s2), (size_t)(n))
+# define index(s,c) strchr((s), (c))
+# define rindex(s,c) strrchr((s), (c))
+# endif
+# endif
+
+/* Return the position of the first bit set in I, or 0 if none are set.
+ The least-significant bit is position 1, the most-significant 32. */
+extern int ffs (int __i) __THROW __attribute__ ((__const__));
+
+/* The following two functions are non-standard but necessary for non-32 bit
+ platforms. */
+#if 0 /*def __USE_GNU*/
+extern int ffsl (long int __l) __THROW __attribute__ ((__const__));
+# ifdef __GNUC__
+__extension__ extern int ffsll (long long int __ll)
+ __THROW __attribute__ ((__const__));
+# endif
+# endif
+
+/* Compare S1 and S2, ignoring case. */
+extern int strcasecmp (__const char *__s1, __const char *__s2)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+
+/* Compare no more than N chars of S1 and S2, ignoring case. */
+extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+#endif /* Use BSD. */
+
+#if defined __USE_GNU && defined __UCLIBC_HAS_XLOCALE__
+/* Again versions of a few functions which use the given locale instead
+ of the global one. */
+extern int strcasecmp_l (__const char *__s1, __const char *__s2,
+ __locale_t __loc)
+ __THROW __attribute_pure__ __nonnull ((1, 2, 3));
+
+extern int strncasecmp_l (__const char *__s1, __const char *__s2,
+ size_t __n, __locale_t __loc)
+ __THROW __attribute_pure__ __nonnull ((1, 2, 4));
+#endif
+
+#ifdef __USE_BSD
+/* Return the next DELIM-delimited token from *STRINGP,
+ terminating it with a '\0', and update *STRINGP to point past it. */
+extern char *strsep (char **__restrict __stringp,
+ __const char *__restrict __delim)
+ __THROW __nonnull ((1, 2));
+#endif
+
+#ifdef __USE_GNU
+/* Compare S1 and S2 as strings holding name & indices/version numbers. */
+#if 0
+extern int strverscmp (__const char *__s1, __const char *__s2)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+#endif
+
+/* Return a string describing the meaning of the signal number in SIG. */
+extern char *strsignal (int __sig) __THROW;
+
+/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */
+#if 0 /* uClibc: disabled */
+extern char *__stpcpy (char *__restrict __dest, __const char *__restrict __src)
+ __THROW __nonnull ((1, 2));
+#endif
+extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src)
+ __THROW __nonnull ((1, 2));
+
+/* Copy no more than N characters of SRC to DEST, returning the address of
+ the last character written into DEST. */
+#if 0 /* uClibc: disabled */
+extern char *__stpncpy (char *__restrict __dest,
+ __const char *__restrict __src, size_t __n)
+ __THROW __nonnull ((1, 2));
+#endif
+extern char *stpncpy (char *__restrict __dest,
+ __const char *__restrict __src, size_t __n)
+ __THROW __nonnull ((1, 2));
+
+#if 0 /* uClibc does not support strfry or memfrob. */
+/* Sautee STRING briskly. */
+extern char *strfry (char *__string) __THROW __nonnull ((1));
+
+/* Frobnicate N bytes of S. */
+extern void *memfrob (void *__s, size_t __n) __THROW __nonnull ((1));
+#endif
+
+# ifndef basename
+/* Return the file name within directory of FILENAME. We don't
+ declare the function if the `basename' macro is available (defined
+ in <libgen.h>) which makes the XPG version of this function
+ available. */
+extern char *basename (__const char *__filename) __THROW __nonnull ((1));
+# endif
+#endif
+
+
+#ifdef __USE_BSD
+/* Two OpenBSD extension functions. */
+extern size_t strlcat(char *__restrict dst, const char *__restrict src,
+ size_t n) __THROW __nonnull ((1, 2));
+extern size_t strlcpy(char *__restrict dst, const char *__restrict src,
+ size_t n) __THROW __nonnull ((1, 2));
+#endif
+
+__END_DECLS
+
+#endif /* string.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/strings.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/strings.h
new file mode 100644
index 0000000..107c53a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/strings.h
@@ -0,0 +1,95 @@
+/* Copyright (C) 1991,92,96,97,99,2000,2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _STRINGS_H
+#define _STRINGS_H 1
+
+/* We don't need and should not read this file if <string.h> was already
+ read. The one exception being that if __USE_BSD isn't defined, then
+ these aren't defined in string.h, so we need to define them here. */
+
+/* keep this file in sync w/ string.h, the glibc version is out of date */
+
+#if !defined _STRING_H || !defined __USE_BSD
+
+# include <features.h>
+# define __need_size_t
+# include <stddef.h>
+
+__BEGIN_DECLS
+
+# ifdef __UCLIBC_SUSV3_LEGACY__
+/* Copy N bytes of SRC to DEST (like memmove, but args reversed). */
+extern void bcopy (__const void *__src, void *__dest, size_t __n)
+ __THROW __nonnull ((1, 2));
+
+/* Set N bytes of S to 0. */
+extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1));
+
+/* Compare N bytes of S1 and S2 (same as memcmp). */
+extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+
+/* Find the first occurrence of C in S (same as strchr). */
+extern char *index (__const char *__s, int __c)
+ __THROW __attribute_pure__ __nonnull ((1));
+
+/* Find the last occurrence of C in S (same as strrchr). */
+extern char *rindex (__const char *__s, int __c)
+ __THROW __attribute_pure__ __nonnull ((1));
+# else
+# ifdef __UCLIBC_SUSV3_LEGACY_MACROS__
+/* bcopy/bzero/bcmp/index/rindex are marked LEGACY in SuSv3.
+ * They are replaced as proposed by SuSv3. Don't sync this part
+ * with glibc and keep it in sync with string.h. */
+
+# define bcopy(src,dest,n) (memmove((dest), (src), (n)), (void) 0)
+# define bzero(s,n) (memset((s), '\0', (n)), (void) 0)
+# define bcmp(s1,s2,n) memcmp((s1), (s2), (size_t)(n))
+# define index(s,c) strchr((s), (c))
+# define rindex(s,c) strrchr((s), (c))
+# endif
+# endif
+
+/* Return the position of the first bit set in I, or 0 if none are set.
+ The least-significant bit is position 1, the most-significant 32. */
+extern int ffs (int __i) __THROW __attribute__ ((__const__));
+
+/* The following two functions are non-standard but necessary for non-32 bit
+ platforms. */
+#if 0 /*def __USE_GNU*/
+extern int ffsl (long int __l) __THROW __attribute__ ((__const__));
+# ifdef __GNUC__
+__extension__ extern int ffsll (long long int __ll)
+ __THROW __attribute__ ((__const__));
+# endif
+# endif
+
+/* Compare S1 and S2, ignoring case. */
+extern int strcasecmp (__const char *__s1, __const char *__s2)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+
+/* Compare no more than N chars of S1 and S2, ignoring case. */
+extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
+
+__END_DECLS
+
+#endif /* string.h */
+
+#endif /* strings.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/acct.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/acct.h
new file mode 100644
index 0000000..9ee8564
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/acct.h
@@ -0,0 +1,77 @@
+/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_ACCT_H
+#define _SYS_ACCT_H 1
+
+#include <features.h>
+
+#define __need_time_t
+#include <time.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+#define ACCT_COMM 16
+
+/*
+ comp_t is a 16-bit "floating" point number with a 3-bit base 8
+ exponent and a 13-bit fraction. See linux/kernel/acct.c for the
+ specific encoding system used.
+*/
+
+typedef u_int16_t comp_t;
+
+struct acct
+ {
+ char ac_flag; /* Accounting flags. */
+ u_int16_t ac_uid; /* Accounting user ID. */
+ u_int16_t ac_gid; /* Accounting group ID. */
+ u_int16_t ac_tty; /* Controlling tty. */
+ u_int32_t ac_btime; /* Beginning time. */
+ comp_t ac_utime; /* Accounting user time. */
+ comp_t ac_stime; /* Accounting system time. */
+ comp_t ac_etime; /* Accounting elapsed time. */
+ comp_t ac_mem; /* Accounting average memory usage. */
+ comp_t ac_io; /* Accounting chars transferred. */
+ comp_t ac_rw; /* Accounting blocks read or written. */
+ comp_t ac_minflt; /* Accounting minor pagefaults. */
+ comp_t ac_majflt; /* Accounting major pagefaults. */
+ comp_t ac_swaps; /* Accounting number of swaps. */
+ u_int32_t ac_exitcode; /* Accounting process exitcode. */
+ char ac_comm[ACCT_COMM+1]; /* Accounting command name. */
+ char ac_pad[10]; /* Accounting padding bytes. */
+ };
+
+enum
+ {
+ AFORK = 0x01, /* Has executed fork, but no exec. */
+ ASU = 0x02, /* Used super-user privileges. */
+ ACORE = 0x08, /* Dumped core. */
+ AXSIG = 0x10 /* Killed by a signal. */
+ };
+
+#define AHZ 100
+
+
+/* Switch process accounting on and off. */
+extern int acct (__const char *__filename) __THROW;
+
+__END_DECLS
+
+#endif /* sys/acct.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/asm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/asm.h
new file mode 100644
index 0000000..76f6af3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/asm.h
@@ -0,0 +1,473 @@
+/* Copyright (C) 1997, 1998, 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ralf Baechle <ralf@gnu.org>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_ASM_H
+#define _SYS_ASM_H
+
+#include <sgidefs.h>
+
+#ifndef CAT
+# ifdef __STDC__
+# define __CAT(str1,str2) str1##str2
+# else
+# define __CAT(str1,str2) str1/**/str2
+# endif
+# define CAT(str1,str2) __CAT(str1,str2)
+#endif
+
+/*
+ * Macros to handle different pointer/register sizes for 32/64-bit code
+ *
+ * 64 bit address space isn't used yet, so we may use the R3000 32 bit
+ * defines for now.
+ */
+#if (_MIPS_SIM == _MIPS_SIM_ABI32) || (_MIPS_SIM == _MIPS_SIM_NABI32)
+# define PTR .word
+# define PTRSIZE 4
+# define PTRLOG 2
+#elif (_MIPS_SIM == _MIPS_SIM_ABI64)
+# define PTR .dword
+# define PTRSIZE 8
+# define PTRLOG 3
+#endif
+
+/*
+ * PIC specific declarations
+ */
+#if (_MIPS_SIM == _MIPS_SIM_ABI32)
+# ifdef __PIC__
+# define CPRESTORE(register) \
+ .cprestore register
+# define CPLOAD(register) \
+ .cpload register
+# else
+# define CPRESTORE(register)
+# define CPLOAD(register)
+# endif
+
+# define CPADD(register) \
+ .cpadd register
+
+/*
+ * Set gp when at 1st instruction
+ */
+# define SETUP_GP \
+ .set noreorder; \
+ .cpload $25; \
+ .set reorder
+/* Set gp when not at 1st instruction */
+# define SETUP_GPX(r) \
+ .set noreorder; \
+ move r, $31; /* Save old ra. */ \
+ bal 10f; /* Find addr of cpload. */ \
+ nop; \
+10: \
+ .cpload $31; \
+ move $31, r; \
+ .set reorder
+# define SETUP_GPX_L(r, l) \
+ .set noreorder; \
+ move r, $31; /* Save old ra. */ \
+ bal l; /* Find addr of cpload. */ \
+ nop; \
+l: \
+ .cpload $31; \
+ move $31, r; \
+ .set reorder
+# define SAVE_GP(x) \
+ .cprestore x /* Save gp trigger t9/jalr conversion. */
+# define SETUP_GP64(a, b)
+# define SETUP_GPX64(a, b)
+# define SETUP_GPX64_L(cp_reg, ra_save, l)
+# define RESTORE_GP64
+# define USE_ALT_CP(a)
+#else /* (_MIPS_SIM == _MIPS_SIM_ABI64) || (_MIPS_SIM == _MIPS_SIM_NABI32) */
+/*
+ * For callee-saved gp calling convention:
+ */
+# define SETUP_GP
+# define SETUP_GPX(r)
+# define SETUP_GPX_L(r, l)
+# define SAVE_GP(x)
+
+# define SETUP_GP64(gpoffset, proc) \
+ .cpsetup $25, gpoffset, proc
+# define SETUP_GPX64(cp_reg, ra_save) \
+ move ra_save, $31; /* Save old ra. */ \
+ .set noreorder; \
+ bal 10f; /* Find addr of .cpsetup. */ \
+ nop; \
+10: \
+ .set reorder; \
+ .cpsetup $31, cp_reg, 10b; \
+ move $31, ra_save
+# define SETUP_GPX64_L(cp_reg, ra_save, l) \
+ move ra_save, $31; /* Save old ra. */ \
+ .set noreorder; \
+ bal l; /* Find addr of .cpsetup. */ \
+ nop; \
+l: \
+ .set reorder; \
+ .cpsetup $31, cp_reg, l; \
+ move $31, ra_save
+# define RESTORE_GP64 \
+ .cpreturn
+/* Use alternate register for context pointer. */
+# define USE_ALT_CP(reg) \
+ .cplocal reg
+#endif /* _MIPS_SIM != _MIPS_SIM_ABI32 */
+
+/*
+ * Stack Frame Definitions
+ */
+#if (_MIPS_SIM == _MIPS_SIM_ABI32)
+# define NARGSAVE 4 /* Space for 4 argument registers must be allocated. */
+#endif
+#if (_MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32)
+# define NARGSAVE 0 /* No caller responsibilities. */
+#endif
+
+
+/*
+ * LEAF - declare leaf routine
+ */
+#define LEAF(symbol) \
+ .globl symbol; \
+ .align 2; \
+ .type symbol,@function; \
+ .ent symbol,0; \
+symbol: .frame sp,0,ra
+
+/*
+ * NESTED - declare nested routine entry point
+ */
+#define NESTED(symbol, framesize, rpc) \
+ .globl symbol; \
+ .align 2; \
+ .type symbol,@function; \
+ .ent symbol,0; \
+symbol: .frame sp, framesize, rpc
+
+/*
+ * END - mark end of function
+ */
+#ifndef END
+# define END(function) \
+ .end function; \
+ .size function,.-function
+#endif
+
+/*
+ * EXPORT - export definition of symbol
+ */
+#define EXPORT(symbol) \
+ .globl symbol; \
+symbol:
+
+/*
+ * ABS - export absolute symbol
+ */
+#define ABS(symbol,value) \
+ .globl symbol; \
+symbol = value
+
+#define PANIC(msg) \
+ .set push; \
+ .set reorder; \
+ la a0,8f; \
+ jal panic; \
+9: b 9b; \
+ .set pop; \
+ TEXT(msg)
+
+/*
+ * Print formated string
+ */
+#define PRINT(string) \
+ .set push; \
+ .set reorder; \
+ la a0,8f; \
+ jal printk; \
+ .set pop; \
+ TEXT(string)
+
+#define TEXT(msg) \
+ .data; \
+8: .asciiz msg; \
+ .previous;
+
+/*
+ * Build text tables
+ */
+#define TTABLE(string) \
+ .text; \
+ .word 1f; \
+ .previous; \
+ .data; \
+1: .asciz string; \
+ .previous
+
+/*
+ * MIPS IV pref instruction.
+ * Use with .set noreorder only!
+ *
+ * MIPS IV implementations are free to treat this as a nop. The R5000
+ * is one of them. So we should have an option not to use this instruction.
+ */
+#if (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) || \
+ (_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64)
+# define PREF(hint,addr) \
+ pref hint,addr
+# define PREFX(hint,addr) \
+ prefx hint,addr
+#else
+# define PREF
+# define PREFX
+#endif
+
+/*
+ * MIPS ISA IV/V movn/movz instructions and equivalents for older CPUs.
+ */
+#if _MIPS_ISA == _MIPS_ISA_MIPS1
+# define MOVN(rd,rs,rt) \
+ .set push; \
+ .set reorder; \
+ beqz rt,9f; \
+ move rd,rs; \
+ .set pop; \
+9:
+# define MOVZ(rd,rs,rt) \
+ .set push; \
+ .set reorder; \
+ bnez rt,9f; \
+ move rd,rt; \
+ .set pop; \
+9:
+#endif /* _MIPS_ISA == _MIPS_ISA_MIPS1 */
+#if (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3)
+# define MOVN(rd,rs,rt) \
+ .set push; \
+ .set noreorder; \
+ bnezl rt,9f; \
+ move rd,rs; \
+ .set pop; \
+9:
+# define MOVZ(rd,rs,rt) \
+ .set push; \
+ .set noreorder; \
+ beqzl rt,9f; \
+ movz rd,rs; \
+ .set pop; \
+9:
+#endif /* (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) */
+#if (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) || \
+ (_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64)
+# define MOVN(rd,rs,rt) \
+ movn rd,rs,rt
+# define MOVZ(rd,rs,rt) \
+ movz rd,rs,rt
+#endif /* (_MIPS_ISA == _MIPS_ISA_MIPS4) || (_MIPS_ISA == _MIPS_ISA_MIPS5) */
+
+/*
+ * Stack alignment
+ */
+#if (_MIPS_SIM == _MIPS_SIM_ABI64) || (_MIPS_SIM == _MIPS_SIM_NABI32)
+# define ALSZ 15
+# define ALMASK ~15
+#else
+# define ALSZ 7
+# define ALMASK ~7
+#endif
+
+/*
+ * Size of a register
+ */
+#if (_MIPS_SIM == _MIPS_SIM_ABI64) || (_MIPS_SIM == _MIPS_SIM_NABI32)
+# define SZREG 8
+#else
+# define SZREG 4
+#endif
+
+/*
+ * Use the following macros in assemblercode to load/store registers,
+ * pointers etc.
+ */
+#if (SZREG == 4)
+# define REG_S sw
+# define REG_L lw
+#else
+# define REG_S sd
+# define REG_L ld
+#endif
+
+/*
+ * How to add/sub/load/store/shift C int variables.
+ */
+#if (_MIPS_SZINT == 32)
+# define INT_ADD add
+# define INT_ADDI addi
+# define INT_ADDU addu
+# define INT_ADDIU addiu
+# define INT_SUB add
+# define INT_SUBI subi
+# define INT_SUBU subu
+# define INT_SUBIU subu
+# define INT_L lw
+# define INT_S sw
+#endif
+
+#if (_MIPS_SZINT == 64)
+# define INT_ADD dadd
+# define INT_ADDI daddi
+# define INT_ADDU daddu
+# define INT_ADDIU daddiu
+# define INT_SUB dadd
+# define INT_SUBI dsubi
+# define INT_SUBU dsubu
+# define INT_SUBIU dsubu
+# define INT_L ld
+# define INT_S sd
+#endif
+
+/*
+ * How to add/sub/load/store/shift C long variables.
+ */
+#if (_MIPS_SZLONG == 32)
+# define LONG_ADD add
+# define LONG_ADDI addi
+# define LONG_ADDU addu
+# define LONG_ADDIU addiu
+# define LONG_SUB add
+# define LONG_SUBI subi
+# define LONG_SUBU subu
+# define LONG_SUBIU subu
+# define LONG_L lw
+# define LONG_S sw
+# define LONG_SLL sll
+# define LONG_SLLV sllv
+# define LONG_SRL srl
+# define LONG_SRLV srlv
+# define LONG_SRA sra
+# define LONG_SRAV srav
+#endif
+
+#if (_MIPS_SZLONG == 64)
+# define LONG_ADD dadd
+# define LONG_ADDI daddi
+# define LONG_ADDU daddu
+# define LONG_ADDIU daddiu
+# define LONG_SUB dadd
+# define LONG_SUBI dsubi
+# define LONG_SUBU dsubu
+# define LONG_SUBIU dsubu
+# define LONG_L ld
+# define LONG_S sd
+# define LONG_SLL dsll
+# define LONG_SLLV dsllv
+# define LONG_SRL dsrl
+# define LONG_SRLV dsrlv
+# define LONG_SRA dsra
+# define LONG_SRAV dsrav
+#endif
+
+/*
+ * How to add/sub/load/store/shift pointers.
+ */
+#if (_MIPS_SIM == _MIPS_SIM_ABI32 && _MIPS_SZPTR == 32)
+# define PTR_ADD add
+# define PTR_ADDI addi
+# define PTR_ADDU addu
+# define PTR_ADDIU addiu
+# define PTR_SUB add
+# define PTR_SUBI subi
+# define PTR_SUBU subu
+# define PTR_SUBIU subu
+# define PTR_L lw
+# define PTR_LA la
+# define PTR_S sw
+# define PTR_SLL sll
+# define PTR_SLLV sllv
+# define PTR_SRL srl
+# define PTR_SRLV srlv
+# define PTR_SRA sra
+# define PTR_SRAV srav
+
+# define PTR_SCALESHIFT 2
+#endif
+
+#if _MIPS_SIM == _MIPS_SIM_NABI32
+# define PTR_ADD add
+# define PTR_ADDI addi
+# define PTR_ADDU add /* no u */
+# define PTR_ADDIU addi /* no u */
+# define PTR_SUB add
+# define PTR_SUBI subi
+# define PTR_SUBU sub /* no u */
+# define PTR_SUBIU sub /* no u */
+# define PTR_L lw
+# define PTR_LA la
+# define PTR_S sw
+# define PTR_SLL sll
+# define PTR_SLLV sllv
+# define PTR_SRL srl
+# define PTR_SRLV srlv
+# define PTR_SRA sra
+# define PTR_SRAV srav
+
+# define PTR_SCALESHIFT 2
+#endif
+
+#if (_MIPS_SIM == _MIPS_SIM_ABI32 && _MIPS_SZPTR == 64 /* o64??? */) \
+ || _MIPS_SIM == _MIPS_SIM_ABI64
+# define PTR_ADD dadd
+# define PTR_ADDI daddi
+# define PTR_ADDU daddu
+# define PTR_ADDIU daddiu
+# define PTR_SUB dadd
+# define PTR_SUBI dsubi
+# define PTR_SUBU dsubu
+# define PTR_SUBIU dsubu
+# define PTR_L ld
+# define PTR_LA dla
+# define PTR_S sd
+# define PTR_SLL dsll
+# define PTR_SLLV dsllv
+# define PTR_SRL dsrl
+# define PTR_SRLV dsrlv
+# define PTR_SRA dsra
+# define PTR_SRAV dsrav
+
+# define PTR_SCALESHIFT 3
+#endif
+
+/*
+ * Some cp0 registers were extended to 64bit for MIPS III.
+ */
+#if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2) || \
+ (_MIPS_ISA == _MIPS_ISA_MIPS32)
+# define MFC0 mfc0
+# define MTC0 mtc0
+#endif
+#if (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4) || \
+ (_MIPS_ISA == _MIPS_ISA_MIPS5) || (_MIPS_ISA == _MIPS_ISA_MIPS64)
+# define MFC0 dmfc0
+# define MTC0 dmtc0
+#endif
+
+#endif /* sys/asm.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/bitypes.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/bitypes.h
new file mode 100644
index 0000000..3a9860f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/bitypes.h
@@ -0,0 +1,3 @@
+/* The GNU <sys/types.h> defines all the necessary types. */
+
+#include <sys/types.h>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/cachectl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/cachectl.h
new file mode 100644
index 0000000..a93e1fb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/cachectl.h
@@ -0,0 +1,42 @@
+/* Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_CACHECTL_H
+#define _SYS_CACHECTL_H 1
+
+#include <features.h>
+
+/*
+ * Get the kernel definition for the op bits.
+ */
+#include <asm/cachectl.h>
+
+__BEGIN_DECLS
+
+#ifdef __USE_MISC
+extern int cachectl (void *addr, __const int nbytes, __const int op) __THROW;
+#endif
+extern int __cachectl (void *addr, __const int nbytes, __const int op) __THROW;
+#ifdef __USE_MISC
+extern int cacheflush (void *addr, __const int nbytes, __const int op) __THROW;
+#endif
+extern int _flush_cache (char *addr, __const int nbytes, __const int op) __THROW;
+
+__END_DECLS
+
+#endif /* sys/cachectl.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/cdefs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/cdefs.h
new file mode 100644
index 0000000..8daac15
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/cdefs.h
@@ -0,0 +1,320 @@
+/* Copyright (C) 1992-2001, 2002, 2004, 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_CDEFS_H
+#define _SYS_CDEFS_H 1
+
+/* We are almost always included from features.h. */
+#ifndef _FEATURES_H
+# include <features.h>
+#endif
+
+/* The GNU libc does not support any K&R compilers or the traditional mode
+ of ISO C compilers anymore. Check for some of the combinations not
+ anymore supported. */
+#if defined __GNUC__ && !defined __STDC__
+# error "You need a ISO C conforming compiler to use the glibc headers"
+#endif
+
+/* Some user header file might have defined this before. */
+#undef __P
+#undef __PMT
+
+#ifdef __GNUC__
+
+/* GCC can always grok prototypes. For C++ programs we add throw()
+ to help it optimize the function calls. But this works only with
+ gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions
+ as non-throwing using a function attribute since programs can use
+ the -fexceptions options for C code as well. */
+# if !defined __cplusplus && __GNUC_PREREQ (3, 3)
+# define __THROW __attribute__ ((__nothrow__))
+# define __NTH(fct) __attribute__ ((__nothrow__)) fct
+# else
+# if defined __cplusplus && __GNUC_PREREQ (2,8)
+# define __THROW throw ()
+# define __NTH(fct) fct throw ()
+# else
+# define __THROW
+# define __NTH(fct) fct
+# endif
+# endif
+
+#else /* Not GCC. */
+
+# define __inline /* No inline functions. */
+
+# define __THROW
+# define __NTH(fct) fct
+
+# define __const const
+# define __signed signed
+# define __volatile volatile
+
+#endif /* GCC. */
+
+/* These two macros are not used in glibc anymore. They are kept here
+ only because some other projects expect the macros to be defined. */
+#define __P(args) args
+#define __PMT(args) args
+
+/* For these things, GCC behaves the ANSI way normally,
+ and the non-ANSI way under -traditional. */
+
+#define __CONCAT(x,y) x ## y
+#define __STRING(x) #x
+
+/* This is not a typedef so `const __ptr_t' does the right thing. */
+#define __ptr_t void *
+#define __long_double_t long double
+
+
+/* C++ needs to know that types and declarations are C, not C++. */
+#ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+#else
+# define __BEGIN_DECLS
+# define __END_DECLS
+#endif
+
+
+/* The standard library needs the functions from the ISO C90 standard
+ in the std namespace. At the same time we want to be safe for
+ future changes and we include the ISO C99 code in the non-standard
+ namespace __c99. The C++ wrapper header take case of adding the
+ definitions to the global namespace. */
+#if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES
+# define __BEGIN_NAMESPACE_STD namespace std {
+# define __END_NAMESPACE_STD }
+# define __USING_NAMESPACE_STD(name) using std::name;
+# define __BEGIN_NAMESPACE_C99 namespace __c99 {
+# define __END_NAMESPACE_C99 }
+# define __USING_NAMESPACE_C99(name) using __c99::name;
+#else
+/* For compatibility we do not add the declarations into any
+ namespace. They will end up in the global namespace which is what
+ old code expects. */
+# define __BEGIN_NAMESPACE_STD
+# define __END_NAMESPACE_STD
+# define __USING_NAMESPACE_STD(name)
+# define __BEGIN_NAMESPACE_C99
+# define __END_NAMESPACE_C99
+# define __USING_NAMESPACE_C99(name)
+#endif
+
+
+/* Support for bounded pointers. */
+#ifndef __BOUNDED_POINTERS__
+# define __bounded /* nothing */
+# define __unbounded /* nothing */
+# define __ptrvalue /* nothing */
+#endif
+
+
+/* Fortify support. */
+#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
+#define __bos0(ptr) __builtin_object_size (ptr, 0)
+#define __warndecl(name, msg) extern void name (void)
+
+
+/* Support for flexible arrays. */
+#if __GNUC_PREREQ (2,97)
+/* GCC 2.97 supports C99 flexible array members. */
+# define __flexarr []
+#else
+# ifdef __GNUC__
+# define __flexarr [0]
+# else
+# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+# define __flexarr []
+# else
+/* Some other non-C99 compiler. Approximate with [1]. */
+# define __flexarr [1]
+# endif
+# endif
+#endif
+
+
+/* __asm__ ("xyz") is used throughout the headers to rename functions
+ at the assembly language level. This is wrapped by the __REDIRECT
+ macro, in order to support compilers that can do this some other
+ way. When compilers don't support asm-names at all, we have to do
+ preprocessor tricks instead (which don't have exactly the right
+ semantics, but it's the best we can do).
+
+ Example:
+ int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */
+
+#if defined __GNUC__ && __GNUC__ >= 2
+
+# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias))
+# ifdef __cplusplus
+# define __REDIRECT_NTH(name, proto, alias) \
+ name proto __THROW __asm__ (__ASMNAME (#alias))
+# else
+# define __REDIRECT_NTH(name, proto, alias) \
+ name proto __asm__ (__ASMNAME (#alias)) __THROW
+# endif
+# define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+# define __ASMNAME2(prefix, cname) __STRING (prefix) cname
+
+/*
+#elif __SOME_OTHER_COMPILER__
+
+# define __REDIRECT(name, proto, alias) name proto; \
+ _Pragma("let " #name " = " #alias)
+*/
+#endif
+
+/* GCC has various useful declarations that can be made with the
+ `__attribute__' syntax. All of the ways we use this do fine if
+ they are omitted for compilers that don't understand it. */
+#if !defined __GNUC__ || __GNUC__ < 2
+# define __attribute__(xyz) /* Ignore */
+#endif
+
+/* We make this a no-op unless it can be used as both a variable and
+ a type attribute. gcc 2.8 is known to support both. */
+#if __GNUC_PREREQ (2,8)
+# define __attribute_aligned__(size) __attribute__ ((__aligned__ (size)))
+#else
+# define __attribute_aligned__(size) /* Ignore */
+#endif
+
+/* At some point during the gcc 2.96 development the `malloc' attribute
+ for functions was introduced. We don't want to use it unconditionally
+ (although this would be possible) since it generates warnings. */
+#if __GNUC_PREREQ (2,96)
+# define __attribute_malloc__ __attribute__ ((__malloc__))
+#else
+# define __attribute_malloc__ /* Ignore */
+#endif
+
+/* At some point during the gcc 2.96 development the `pure' attribute
+ for functions was introduced. We don't want to use it unconditionally
+ (although this would be possible) since it generates warnings. */
+#if __GNUC_PREREQ (2,96)
+# define __attribute_pure__ __attribute__ ((__pure__))
+#else
+# define __attribute_pure__ /* Ignore */
+#endif
+
+/* At some point during the gcc 3.1 development the `used' attribute
+ for functions was introduced. We don't want to use it unconditionally
+ (although this would be possible) since it generates warnings. */
+#if __GNUC_PREREQ (3,1)
+# define __attribute_used__ __attribute__ ((__used__))
+# define __attribute_noinline__ __attribute__ ((__noinline__))
+#else
+# define __attribute_used__ __attribute__ ((__unused__))
+# define __attribute_noinline__ /* Ignore */
+#endif
+
+/* gcc allows marking deprecated functions. */
+#if __GNUC_PREREQ (3,2) && !defined(__UCLIBC_HIDE_DEPRECATED__)
+# define __attribute_deprecated__ __attribute__ ((__deprecated__))
+#else
+# define __attribute_deprecated__ /* Ignore */
+#endif
+
+/* At some point during the gcc 2.8 development the `format_arg' attribute
+ for functions was introduced. We don't want to use it unconditionally
+ (although this would be possible) since it generates warnings.
+ If several `format_arg' attributes are given for the same function, in
+ gcc-3.0 and older, all but the last one are ignored. In newer gccs,
+ all designated arguments are considered. */
+#if __GNUC_PREREQ (2,8)
+# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x)))
+#else
+# define __attribute_format_arg__(x) /* Ignore */
+#endif
+
+/* At some point during the gcc 2.97 development the `strfmon' format
+ attribute for functions was introduced. We don't want to use it
+ unconditionally (although this would be possible) since it
+ generates warnings. */
+#if __GNUC_PREREQ (2,97)
+# define __attribute_format_strfmon__(a,b) \
+ __attribute__ ((__format__ (__strfmon__, a, b)))
+#else
+# define __attribute_format_strfmon__(a,b) /* Ignore */
+#endif
+
+/* The nonull function attribute allows to mark pointer parameters which
+ must not be NULL. */
+#if __GNUC_PREREQ (3,3)
+# define __nonnull(params) __attribute__ ((__nonnull__ params))
+#else
+# define __nonnull(params)
+#endif
+
+/* If fortification mode, we warn about unused results of certain
+ function calls which can lead to problems. */
+#if __GNUC_PREREQ (3,4)
+# define __attribute_warn_unused_result__ \
+ __attribute__ ((__warn_unused_result__))
+# if __USE_FORTIFY_LEVEL > 0
+# define __wur __attribute_warn_unused_result__
+# endif
+#else
+# define __attribute_warn_unused_result__ /* empty */
+#endif
+#ifndef __wur
+# define __wur /* Ignore */
+#endif
+
+/* Forces a function to be always inlined. */
+#if __GNUC_PREREQ (3,2)
+# define __always_inline __inline __attribute__ ((__always_inline__))
+#else
+# define __always_inline __inline
+#endif
+
+/* It is possible to compile containing GCC extensions even if GCC is
+ run in pedantic mode if the uses are carefully marked using the
+ `__extension__' keyword. But this is not generally available before
+ version 2.8. */
+#if !__GNUC_PREREQ (2,8)
+# define __extension__ /* Ignore */
+#endif
+
+/* __restrict is known in EGCS 1.2 and above. */
+#if !__GNUC_PREREQ (2,92)
+# define __restrict /* Ignore */
+#endif
+
+/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is
+ array_name[restrict]
+ GCC 3.1 supports this. */
+#if __GNUC_PREREQ (3,1) && !defined __GNUG__
+# define __restrict_arr __restrict
+#else
+# ifdef __GNUC__
+# define __restrict_arr /* Not supported in old GCC. */
+# else
+# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+# define __restrict_arr restrict
+# else
+/* Some other non-C99 compiler. */
+# define __restrict_arr /* Not supported. */
+# endif
+# endif
+#endif
+
+#endif /* sys/cdefs.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/dir.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/dir.h
new file mode 100644
index 0000000..2611d6c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/dir.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 1991, 1996 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_DIR_H
+#define _SYS_DIR_H 1
+
+#include <features.h>
+
+#include <dirent.h>
+
+#define direct dirent
+
+#endif /* sys/dir.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/epoll.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/epoll.h
new file mode 100644
index 0000000..68f173a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/epoll.h
@@ -0,0 +1,110 @@
+/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_EPOLL_H
+#define _SYS_EPOLL_H 1
+
+#include <stdint.h>
+#include <sys/types.h>
+
+
+enum EPOLL_EVENTS
+ {
+ EPOLLIN = 0x001,
+#define EPOLLIN EPOLLIN
+ EPOLLPRI = 0x002,
+#define EPOLLPRI EPOLLPRI
+ EPOLLOUT = 0x004,
+#define EPOLLOUT EPOLLOUT
+ EPOLLRDNORM = 0x040,
+#define EPOLLRDNORM EPOLLRDNORM
+ EPOLLRDBAND = 0x080,
+#define EPOLLRDBAND EPOLLRDBAND
+ EPOLLWRNORM = 0x100,
+#define EPOLLWRNORM EPOLLWRNORM
+ EPOLLWRBAND = 0x200,
+#define EPOLLWRBAND EPOLLWRBAND
+ EPOLLMSG = 0x400,
+#define EPOLLMSG EPOLLMSG
+ EPOLLERR = 0x008,
+#define EPOLLERR EPOLLERR
+ EPOLLHUP = 0x010,
+#define EPOLLHUP EPOLLHUP
+ EPOLLONESHOT = (1 << 30),
+#define EPOLLONESHOT EPOLLONESHOT
+ EPOLLET = (1 << 31)
+#define EPOLLET EPOLLET
+ };
+
+
+/* Valid opcodes ( "op" parameter ) to issue to epoll_ctl(). */
+#define EPOLL_CTL_ADD 1 /* Add a file decriptor to the interface. */
+#define EPOLL_CTL_DEL 2 /* Remove a file decriptor from the interface. */
+#define EPOLL_CTL_MOD 3 /* Change file decriptor epoll_event structure. */
+
+
+typedef union epoll_data
+{
+ void *ptr;
+ int fd;
+ uint32_t u32;
+ uint64_t u64;
+} epoll_data_t;
+
+struct epoll_event
+{
+ uint32_t events; /* Epoll events */
+ epoll_data_t data; /* User data variable */
+};
+
+
+__BEGIN_DECLS
+
+/* Creates an epoll instance. Returns an fd for the new instance.
+ The "size" parameter is a hint specifying the number of file
+ descriptors to be associated with the new instance. The fd
+ returned by epoll_create() should be closed with close(). */
+extern int epoll_create (int __size) __THROW;
+
+
+/* Manipulate an epoll instance "epfd". Returns 0 in case of success,
+ -1 in case of error ( the "errno" variable will contain the
+ specific error code ) The "op" parameter is one of the EPOLL_CTL_*
+ constants defined above. The "fd" parameter is the target of the
+ operation. The "event" parameter describes which events the caller
+ is interested in and any associated user data. */
+extern int epoll_ctl (int __epfd, int __op, int __fd,
+ struct epoll_event *__event) __THROW;
+
+
+/* Wait for events on an epoll instance "epfd". Returns the number of
+ triggered events returned in "events" buffer. Or -1 in case of
+ error with the "errno" variable set to the specific error code. The
+ "events" parameter is a buffer that will contain triggered
+ events. The "maxevents" is the maximum number of events to be
+ returned ( usually size of "events" ). The "timeout" parameter
+ specifies the maximum wait time in milliseconds (-1 == infinite).
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int epoll_wait (int __epfd, struct epoll_event *__events,
+ int __maxevents, int __timeout);
+
+__END_DECLS
+
+#endif /* sys/epoll.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/errno.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/errno.h
new file mode 100644
index 0000000..339f4fc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/errno.h
@@ -0,0 +1 @@
+#include <errno.h>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/fcntl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/fcntl.h
new file mode 100644
index 0000000..cd30455
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/fcntl.h
@@ -0,0 +1 @@
+#include <fcntl.h>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/file.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/file.h
new file mode 100644
index 0000000..93b3635
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/file.h
@@ -0,0 +1,56 @@
+/* Copyright (C) 1991, 92, 96, 97, 98, 99 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_FILE_H
+#define _SYS_FILE_H 1
+
+#include <features.h>
+
+#ifndef _FCNTL_H
+# include <fcntl.h>
+#endif
+
+__BEGIN_DECLS
+
+
+/* Alternate names for values for the WHENCE argument to `lseek'.
+ These are the same as SEEK_SET, SEEK_CUR, and SEEK_END, respectively. */
+#ifndef L_SET
+# define L_SET 0 /* Seek from beginning of file. */
+# define L_INCR 1 /* Seek from current position. */
+# define L_XTND 2 /* Seek from end of file. */
+#endif
+
+
+/* Operations for the `flock' call. */
+#define LOCK_SH 1 /* Shared lock. */
+#define LOCK_EX 2 /* Exclusive lock. */
+#define LOCK_UN 8 /* Unlock. */
+
+/* Can be OR'd in to one of the above. */
+#define LOCK_NB 4 /* Don't block when locking. */
+
+
+/* Apply or remove an advisory lock, according to OPERATION,
+ on the file FD refers to. */
+extern int flock (int __fd, int __operation) __THROW;
+
+
+__END_DECLS
+
+#endif /* sys/file.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/fpregdef.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/fpregdef.h
new file mode 100644
index 0000000..3781152
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/fpregdef.h
@@ -0,0 +1,61 @@
+/* Copyright (C) 1991, 92, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_FPREGDEF_H
+#define _SYS_FPREGDEF_H
+
+/*
+ * These definitions only cover the R3000-ish 16/32 register model.
+ * But we're trying to be R3000 friendly anyway ...
+ */
+#define fv0 $f0 /* return value */
+#define fv0f $f1
+#define fv1 $f2
+#define fv1f $f3
+#define fa0 $f12 /* argument registers */
+#define fa0f $f13
+#define fa1 $f14
+#define fa1f $f15
+#define ft0 $f4 /* caller saved */
+#define ft0f $f5
+#define ft1 $f6
+#define ft1f $f7
+#define ft2 $f8
+#define ft2f $f9
+#define ft3 $f10
+#define ft3f $f11
+#define ft4 $f16
+#define ft4f $f17
+#define ft5 $f18
+#define ft5f $f19
+#define fs0 $f20 /* callee saved */
+#define fs0f $f21
+#define fs1 $f22
+#define fs1f $f23
+#define fs2 $f24
+#define fs2f $f25
+#define fs3 $f26
+#define fs3f $f27
+#define fs4 $f28
+#define fs4f $f29
+#define fs5 $f30
+#define fs5f $f31
+
+#define fcr31 $31 /* FPU status register */
+
+#endif /* sys/fpregdef.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/fsuid.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/fsuid.h
new file mode 100644
index 0000000..4ecb199
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/fsuid.h
@@ -0,0 +1,36 @@
+/* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_FSUID_H
+#define _SYS_FSUID_H 1
+
+#include <features.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+/* Change uid used for file access control to UID, without affecting
+ other privileges (such as who can send signals at the process). */
+extern int setfsuid (__uid_t __uid) __THROW;
+
+/* Ditto for group id. */
+extern int setfsgid (__gid_t __gid) __THROW;
+
+__END_DECLS
+
+#endif /* fsuid.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/inotify.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/inotify.h
new file mode 100644
index 0000000..0131db9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/inotify.h
@@ -0,0 +1,92 @@
+/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_INOTIFY_H
+#define _SYS_INOTIFY_H 1
+
+#include <stdint.h>
+
+
+/* Structure describing an inotify event. */
+struct inotify_event
+{
+ int wd; /* Watch descriptor. */
+ uint32_t mask; /* Watch mask. */
+ uint32_t cookie; /* Cookie to synchronize two events. */
+ uint32_t len; /* Length (including NULs) of name. */
+ char name __flexarr; /* Name. */
+};
+
+
+/* Supported events suitable for MASK parameter of INOTIFY_ADD_WATCH. */
+#define IN_ACCESS 0x00000001 /* File was accessed. */
+#define IN_MODIFY 0x00000002 /* File was modified. */
+#define IN_ATTRIB 0x00000004 /* Metadata changed. */
+#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed. */
+#define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed. */
+#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* Close. */
+#define IN_OPEN 0x00000020 /* File was opened. */
+#define IN_MOVED_FROM 0x00000040 /* File was moved from X. */
+#define IN_MOVED_TO 0x00000080 /* File was moved to Y. */
+#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* Moves. */
+#define IN_CREATE 0x00000100 /* Subfile was created. */
+#define IN_DELETE 0x00000200 /* Subfile was deleted. */
+#define IN_DELETE_SELF 0x00000400 /* Self was deleted. */
+#define IN_MOVE_SELF 0x00000800 /* Self was moved. */
+
+/* Events sent by the kernel. */
+#define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted. */
+#define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed. */
+#define IN_IGNORED 0x00008000 /* File was ignored. */
+
+/* Helper events. */
+#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* Close. */
+#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* Moves. */
+
+/* Special flags. */
+#define IN_ONLYDIR 0x01000000 /* Only watch the path if it is a
+ directory. */
+#define IN_DONT_FOLLOW 0x02000000 /* Do not follow a sym link. */
+#define IN_MASK_ADD 0x20000000 /* Add to the mask of an already
+ existing watch. */
+#define IN_ISDIR 0x40000000 /* Event occurred against dir. */
+#define IN_ONESHOT 0x80000000 /* Only send event once. */
+
+/* All events which a program can wait on. */
+#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE \
+ | IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM \
+ | IN_MOVED_TO | IN_CREATE | IN_DELETE \
+ | IN_DELETE_SELF | IN_MOVE_SELF)
+
+
+__BEGIN_DECLS
+
+/* Create and initialize inotify instance. */
+extern int inotify_init (void) __THROW;
+
+/* Add watch of object NAME to inotify instance FD. Notify about
+ events specified by MASK. */
+extern int inotify_add_watch (int __fd, const char *__name, uint32_t __mask)
+ __THROW;
+
+/* Remove the watch specified by WD from the inotify instance FD. */
+extern int inotify_rm_watch (int __fd, uint32_t __wd) __THROW;
+
+__END_DECLS
+
+#endif /* sys/inotify.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ioctl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ioctl.h
new file mode 100644
index 0000000..6d8a0f4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ioctl.h
@@ -0,0 +1,46 @@
+/* Copyright (C) 1991, 92, 93, 94, 96, 98, 99 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_IOCTL_H
+#define _SYS_IOCTL_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Get the list of `ioctl' requests and related constants. */
+#include <bits/ioctls.h>
+
+/* Define some types used by `ioctl' requests. */
+#include <bits/ioctl-types.h>
+
+/* On a Unix system, the system <sys/ioctl.h> probably defines some of
+ the symbols we define in <sys/ttydefaults.h> (usually with the same
+ values). The code to generate <bits/ioctls.h> has omitted these
+ symbols to avoid the conflict, but a Unix program expects <sys/ioctl.h>
+ to define them, so we must include <sys/ttydefaults.h> here. */
+#include <sys/ttydefaults.h>
+
+/* Perform the I/O control operation specified by REQUEST on FD.
+ One argument may follow; its presence and type depend on REQUEST.
+ Return value depends on REQUEST. Usually -1 indicates error. */
+extern int ioctl (int __fd, unsigned long int __request, ...) __THROW;
+
+__END_DECLS
+
+#endif /* sys/ioctl.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ipc.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ipc.h
new file mode 100644
index 0000000..42806db
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ipc.h
@@ -0,0 +1,58 @@
+/* Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_IPC_H
+#define _SYS_IPC_H 1
+
+#include <features.h>
+
+#if !defined __USE_SVID && !defined __USE_XOPEN && __GNUC__ >= 2
+# warning "Files using this header must be compiled with _SVID_SOURCE or _XOPEN_SOURCE"
+#endif
+
+/* Get system dependent definition of `struct ipc_perm' and more. */
+#include <bits/ipc.h>
+
+#ifndef __uid_t_defined
+typedef __uid_t uid_t;
+# define __uid_t_defined
+#endif
+
+#ifndef __gid_t_defined
+typedef __gid_t gid_t;
+# define __gid_t_defined
+#endif
+
+#ifndef __mode_t_defined
+typedef __mode_t mode_t;
+# define __mode_t_defined
+#endif
+
+#ifndef __key_t_defined
+typedef __key_t key_t;
+# define __key_t_defined
+#endif
+
+__BEGIN_DECLS
+
+/* Generates key for System V style IPC. */
+extern key_t ftok (__const char *__pathname, int __proj_id) __THROW;
+
+__END_DECLS
+
+#endif /* sys/ipc.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/kd.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/kd.h
new file mode 100644
index 0000000..d459c07
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/kd.h
@@ -0,0 +1,35 @@
+/* Copyright (C) 1996, 1997, 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_KD_H
+#define _SYS_KD_H 1
+
+/* Make sure the <linux/types.h> header is not loaded. */
+#ifndef _LINUX_TYPES_H
+# define _LINUX_TYPES_H 1
+# define __undef_LINUX_TYPES_H
+#endif
+
+#include <linux/kd.h>
+
+#ifdef __undef_LINUX_TYPES_H
+# undef _LINUX_TYPES_H
+# undef __undef_LINUX_TYPES_H
+#endif
+
+#endif /* sys/kd.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/kdaemon.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/kdaemon.h
new file mode 100644
index 0000000..61491f9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/kdaemon.h
@@ -0,0 +1,33 @@
+/* Copyright (C) 1996, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Interfaces to control the various kernel daemons. */
+
+#ifndef _SYS_KDAEMON_H
+
+#define _SYS_KDAEMON_H 1
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Start, flush, or tune the kernel's buffer flushing daemon. */
+extern int bdflush (int __func, long int __data) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_KDAEMON_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/klog.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/klog.h
new file mode 100644
index 0000000..35f5fe4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/klog.h
@@ -0,0 +1,34 @@
+/* Copyright (C) 1996, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_KLOG_H
+
+#define _SYS_KLOG_H 1
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Control the kernel's logging facility. This corresponds exactly to
+ the kernel's syslog system call, but that name is easily confused
+ with the user-level syslog facility, which is something completely
+ different. */
+extern int klogctl (int __type, char *__bufp, int __len) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_KLOG_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/mman.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/mman.h
new file mode 100644
index 0000000..76c2009
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/mman.h
@@ -0,0 +1,174 @@
+/* Definitions for BSD-style memory management.
+ Copyright (C) 1994-2000, 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_MMAN_H
+#define _SYS_MMAN_H 1
+
+#include <features.h>
+#include <bits/types.h>
+#define __need_size_t
+#include <stddef.h>
+
+#ifndef __off_t_defined
+# ifndef __USE_FILE_OFFSET64
+typedef __off_t off_t;
+# else
+typedef __off64_t off_t;
+# endif
+# define __off_t_defined
+#endif
+
+#ifndef __mode_t_defined
+typedef __mode_t mode_t;
+# define __mode_t_defined
+#endif
+
+#include <bits/mman.h>
+
+/* Return value of `mmap' in case of an error. */
+#define MAP_FAILED ((void *) -1)
+
+__BEGIN_DECLS
+/* Map addresses starting near ADDR and extending for LEN bytes. from
+ OFFSET into the file FD describes according to PROT and FLAGS. If ADDR
+ is nonzero, it is the desired mapping address. If the MAP_FIXED bit is
+ set in FLAGS, the mapping will be at ADDR exactly (which must be
+ page-aligned); otherwise the system chooses a convenient nearby address.
+ The return value is the actual mapping address chosen or MAP_FAILED
+ for errors (in which case `errno' is set). A successful `mmap' call
+ deallocates any previous mapping for the affected region. */
+
+#ifndef __USE_FILE_OFFSET64
+extern void *mmap (void *__addr, size_t __len, int __prot,
+ int __flags, int __fd, __off_t __offset) __THROW;
+#else
+# ifdef __REDIRECT
+extern void * __REDIRECT (mmap,
+ (void *__addr, size_t __len, int __prot,
+ int __flags, int __fd, __off64_t __offset),
+ mmap64);
+# else
+# define mmap mmap64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern void *mmap64 (void *__addr, size_t __len, int __prot,
+ int __flags, int __fd, __off64_t __offset) __THROW;
+#endif
+
+/* Deallocate any mapping for the region starting at ADDR and extending LEN
+ bytes. Returns 0 if successful, -1 for errors (and sets errno). */
+extern int munmap (void *__addr, size_t __len) __THROW;
+
+/* Change the memory protection of the region starting at ADDR and
+ extending LEN bytes to PROT. Returns 0 if successful, -1 for errors
+ (and sets errno). */
+extern int mprotect (void *__addr, size_t __len, int __prot) __THROW;
+
+#ifdef __ARCH_USE_MMU__
+
+/* Synchronize the region starting at ADDR and extending LEN bytes with the
+ file it maps. Filesystem operations on a file being mapped are
+ unpredictable before this is done. Flags are from the MS_* set.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int msync (void *__addr, size_t __len, int __flags);
+
+#else
+
+/* On no-mmu systems you can't have real private mappings. */
+static inline int msync (void *__addr, size_t __len, int __flags) { return 0; }
+
+#endif
+
+#ifdef __USE_BSD
+/* Advise the system about particular usage patterns the program follows
+ for the region starting at ADDR and extending LEN bytes. */
+extern int madvise (void *__addr, size_t __len, int __advice) __THROW;
+#endif
+#ifdef __USE_XOPEN2K
+/* This is the POSIX name for this function. */
+extern int posix_madvise (void *__addr, size_t __len, int __advice) __THROW;
+#endif
+
+#ifdef __ARCH_USE_MMU__
+
+/* Guarantee all whole pages mapped by the range [ADDR,ADDR+LEN) to
+ be memory resident. */
+extern int mlock (__const void *__addr, size_t __len) __THROW;
+
+/* Unlock whole pages previously mapped by the range [ADDR,ADDR+LEN). */
+extern int munlock (__const void *__addr, size_t __len) __THROW;
+
+/* Cause all currently mapped pages of the process to be memory resident
+ until unlocked by a call to the `munlockall', until the process exits,
+ or until the process calls `execve'. */
+extern int mlockall (int __flags) __THROW;
+
+/* All currently mapped pages of the process' address space become
+ unlocked. */
+extern int munlockall (void) __THROW;
+
+#else
+
+/* On no-mmu systems, memory cannot be swapped out, so
+ * these functions will always succeed. */
+static inline int mlock (__const void *__addr, size_t __len) { return 0; }
+static inline int munlock (__const void *__addr, size_t __len) { return 0; }
+static inline int mlockall (int __flags) { return 0; }
+static inline int munlockall (void) { return 0; }
+
+#endif
+
+#ifdef __USE_MISC
+/* Remap pages mapped by the range [ADDR,ADDR+OLD_LEN) to new length
+ NEW_LEN. If MREMAP_MAYMOVE is set in FLAGS the returned address
+ may differ from ADDR. If MREMAP_FIXED is set in FLAGS the function
+ takes another paramter which is a fixed address at which the block
+ resides after a successful call. */
+extern void *mremap (void *__addr, size_t __old_len, size_t __new_len,
+ int __flags, ...) __THROW;
+
+/* mincore returns the memory residency status of the pages in the
+ current process's address space specified by [start, start + len).
+ The status is returned in a vector of bytes. The least significant
+ bit of each byte is 1 if the referenced page is in memory, otherwise
+ it is zero. */
+extern int mincore (void *__start, size_t __len, unsigned char *__vec)
+ __THROW;
+
+#if 0
+/* Remap arbitrary pages of a shared backing store within an existing
+ VMA. */
+extern int remap_file_pages (void *__start, size_t __size, int __prot,
+ size_t __pgoff, int __flags) __THROW;
+#endif
+#endif
+
+
+/* Open shared memory segment. */
+extern int shm_open (__const char *__name, int __oflag, mode_t __mode);
+
+/* Remove shared memory segment. */
+extern int shm_unlink (__const char *__name);
+
+__END_DECLS
+
+#endif /* sys/mman.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/mount.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/mount.h
new file mode 100644
index 0000000..b305549
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/mount.h
@@ -0,0 +1,119 @@
+/* Header file for mounting/unmount Linux filesystems.
+ Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* This is taken from /usr/include/linux/fs.h. */
+
+#ifndef _SYS_MOUNT_H
+#define _SYS_MOUNT_H 1
+
+#include <features.h>
+#include <sys/ioctl.h>
+
+#define BLOCK_SIZE 1024
+#define BLOCK_SIZE_BITS 10
+
+
+/* These are the fs-independent mount-flags: up to 16 flags are
+ supported */
+enum
+{
+ MS_RDONLY = 1, /* Mount read-only. */
+#define MS_RDONLY MS_RDONLY
+ MS_NOSUID = 2, /* Ignore suid and sgid bits. */
+#define MS_NOSUID MS_NOSUID
+ MS_NODEV = 4, /* Disallow access to device special files. */
+#define MS_NODEV MS_NODEV
+ MS_NOEXEC = 8, /* Disallow program execution. */
+#define MS_NOEXEC MS_NOEXEC
+ MS_SYNCHRONOUS = 16, /* Writes are synced at once. */
+#define MS_SYNCHRONOUS MS_SYNCHRONOUS
+ MS_REMOUNT = 32, /* Alter flags of a mounted FS. */
+#define MS_REMOUNT MS_REMOUNT
+ MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
+#define MS_MANDLOCK MS_MANDLOCK
+ S_WRITE = 128, /* Write on file/directory/symlink. */
+#define S_WRITE S_WRITE
+ S_APPEND = 256, /* Append-only file. */
+#define S_APPEND S_APPEND
+ S_IMMUTABLE = 512, /* Immutable file. */
+#define S_IMMUTABLE S_IMMUTABLE
+ MS_NOATIME = 1024, /* Do not update access times. */
+#define MS_NOATIME MS_NOATIME
+ MS_NODIRATIME = 2048, /* Do not update directory access times. */
+#define MS_NODIRATIME MS_NODIRATIME
+ MS_BIND = 4096, /* Bind directory at different place. */
+#define MS_BIND MS_BIND
+};
+
+/* Flags that can be altered by MS_REMOUNT */
+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
+ |MS_NODIRATIME)
+
+
+/* Magic mount flag number. Has to be or-ed to the flag values. */
+
+#define MS_MGC_VAL 0xc0ed0000 /* Magic flag number to indicate "new" flags */
+#define MS_MGC_MSK 0xffff0000 /* Magic flag number mask */
+
+
+/* The read-only stuff doesn't really belong here, but any other place
+ is probably as bad and I don't want to create yet another include
+ file. */
+
+#define BLKROSET _IO(0x12, 93) /* Set device read-only (0 = read-write). */
+#define BLKROGET _IO(0x12, 94) /* Get read-only status (0 = read_write). */
+#define BLKRRPART _IO(0x12, 95) /* Re-read partition table. */
+#define BLKGETSIZE _IO(0x12, 96) /* Return device size. */
+#define BLKFLSBUF _IO(0x12, 97) /* Flush buffer cache. */
+#define BLKRASET _IO(0x12, 98) /* Set read ahead for block device. */
+#define BLKRAGET _IO(0x12, 99) /* Get current read ahead setting. */
+#define BLKFRASET _IO(0x12,100) /* Set filesystem read-ahead. */
+#define BLKFRAGET _IO(0x12,101) /* Get filesystem read-ahead. */
+#define BLKSECTSET _IO(0x12,102) /* Set max sectors per request. */
+#define BLKSECTGET _IO(0x12,103) /* Get max sectors per request. */
+#define BLKSSZGET _IO(0x12,104) /* Get block device sector size. */
+#define BLKBSZGET _IOR(0x12,112,size_t)
+#define BLKBSZSET _IOW(0x12,113,size_t)
+#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size. */
+
+
+/* Possible value for FLAGS parameter of `umount2'. */
+enum
+{
+ MNT_FORCE = 1 /* Force unmounting. */
+#define MNT_FORCE MNT_FORCE
+};
+
+
+__BEGIN_DECLS
+
+/* Mount a filesystem. */
+extern int mount (__const char *__special_file, __const char *__dir,
+ __const char *__fstype, unsigned long int __rwflag,
+ __const void *__data) __THROW;
+
+/* Unmount a filesystem. */
+extern int umount (__const char *__special_file) __THROW;
+
+/* Unmount a filesystem. Force unmounting if FLAGS is set to MNT_FORCE. */
+extern int umount2 (__const char *__special_file, int __flags) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_MOUNT_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/msg.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/msg.h
new file mode 100644
index 0000000..1fd64b2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/msg.h
@@ -0,0 +1,81 @@
+/* Copyright (C) 1995,1996,1997,1999,2000,2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_MSG_H
+#define _SYS_MSG_H
+
+#include <features.h>
+
+/* Get common definition of System V style IPC. */
+#include <sys/ipc.h>
+
+/* Get system dependent definition of `struct msqid_ds' and more. */
+#include <bits/msq.h>
+
+/* Define types required by the standard. */
+#define __need_time_t
+#include <time.h>
+
+#ifndef __pid_t_defined
+typedef __pid_t pid_t;
+# define __pid_t_defined
+#endif
+
+#ifndef __ssize_t_defined
+typedef __ssize_t ssize_t;
+# define __ssize_t_defined
+#endif
+
+/* The following System V style IPC functions implement a message queue
+ system. The definition is found in XPG2. */
+
+#ifdef __USE_GNU
+/* Template for struct to be used as argument for `msgsnd' and `msgrcv'. */
+struct msgbuf
+ {
+ long int mtype; /* type of received/sent message */
+ char mtext[1]; /* text of the message */
+ };
+#endif
+
+
+__BEGIN_DECLS
+
+/* Message queue control operation. */
+extern int msgctl (int __msqid, int __cmd, struct msqid_ds *__buf) __THROW;
+
+/* Get messages queue. */
+extern int msgget (key_t __key, int __msgflg) __THROW;
+
+/* Receive message from message queue.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int msgrcv (int __msqid, void *__msgp, size_t __msgsz,
+ long int __msgtyp, int __msgflg);
+
+/* Send message to message queue.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int msgsnd (int __msqid, __const void *__msgp, size_t __msgsz,
+ int __msgflg);
+
+__END_DECLS
+
+#endif /* sys/msg.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/mtio.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/mtio.h
new file mode 100644
index 0000000..51fa550
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/mtio.h
@@ -0,0 +1,277 @@
+/* Structures and definitions for magnetic tape I/O control commands.
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Written by H. Bergman <hennus@cybercomm.nl>. */
+
+#ifndef _SYS_MTIO_H
+#define _SYS_MTIO_H 1
+
+/* Get necessary definitions from system and kernel headers. */
+#include <sys/types.h>
+#include <sys/ioctl.h>
+
+
+/* Structure for MTIOCTOP - magnetic tape operation command. */
+struct mtop
+ {
+ short int mt_op; /* Operations defined below. */
+ int mt_count; /* How many of them. */
+ };
+#define _IOT_mtop /* Hurd ioctl type field. */ \
+ _IOT (_IOTS (short), 1, _IOTS (int), 1, 0, 0)
+
+/* Magnetic Tape operations [Not all operations supported by all drivers]. */
+#define MTRESET 0 /* +reset drive in case of problems. */
+#define MTFSF 1 /* Forward space over FileMark,
+ * position at first record of next file. */
+#define MTBSF 2 /* Backward space FileMark (position before FM). */
+#define MTFSR 3 /* Forward space record. */
+#define MTBSR 4 /* Backward space record. */
+#define MTWEOF 5 /* Write an end-of-file record (mark). */
+#define MTREW 6 /* Rewind. */
+#define MTOFFL 7 /* Rewind and put the drive offline (eject?). */
+#define MTNOP 8 /* No op, set status only (read with MTIOCGET). */
+#define MTRETEN 9 /* Retension tape. */
+#define MTBSFM 10 /* +backward space FileMark, position at FM. */
+#define MTFSFM 11 /* +forward space FileMark, position at FM. */
+#define MTEOM 12 /* Goto end of recorded media (for appending files).
+ MTEOM positions after the last FM, ready for
+ appending another file. */
+#define MTERASE 13 /* Erase tape -- be careful! */
+
+#define MTRAS1 14 /* Run self test 1 (nondestructive). */
+#define MTRAS2 15 /* Run self test 2 (destructive). */
+#define MTRAS3 16 /* Reserved for self test 3. */
+
+#define MTSETBLK 20 /* Set block length (SCSI). */
+#define MTSETDENSITY 21 /* Set tape density (SCSI). */
+#define MTSEEK 22 /* Seek to block (Tandberg, etc.). */
+#define MTTELL 23 /* Tell block (Tandberg, etc.). */
+#define MTSETDRVBUFFER 24 /* Set the drive buffering according to SCSI-2.
+ Ordinary buffered operation with code 1. */
+#define MTFSS 25 /* Space forward over setmarks. */
+#define MTBSS 26 /* Space backward over setmarks. */
+#define MTWSM 27 /* Write setmarks. */
+
+#define MTLOCK 28 /* Lock the drive door. */
+#define MTUNLOCK 29 /* Unlock the drive door. */
+#define MTLOAD 30 /* Execute the SCSI load command. */
+#define MTUNLOAD 31 /* Execute the SCSI unload command. */
+#define MTCOMPRESSION 32/* Control compression with SCSI mode page 15. */
+#define MTSETPART 33 /* Change the active tape partition. */
+#define MTMKPART 34 /* Format the tape with one or two partitions. */
+
+/* structure for MTIOCGET - mag tape get status command */
+
+struct mtget
+ {
+ long int mt_type; /* Type of magtape device. */
+ long int mt_resid; /* Residual count: (not sure)
+ number of bytes ignored, or
+ number of files not skipped, or
+ number of records not skipped. */
+ /* The following registers are device dependent. */
+ long int mt_dsreg; /* Status register. */
+ long int mt_gstat; /* Generic (device independent) status. */
+ long int mt_erreg; /* Error register. */
+ /* The next two fields are not always used. */
+ __daddr_t mt_fileno; /* Number of current file on tape. */
+ __daddr_t mt_blkno; /* Current block number. */
+ };
+#define _IOT_mtget /* Hurd ioctl type field. */ \
+ _IOT (_IOTS (long), 7, 0, 0, 0, 0)
+
+
+/* Constants for mt_type. Not all of these are supported, and
+ these are not all of the ones that are supported. */
+#define MT_ISUNKNOWN 0x01
+#define MT_ISQIC02 0x02 /* Generic QIC-02 tape streamer. */
+#define MT_ISWT5150 0x03 /* Wangtek 5150EQ, QIC-150, QIC-02. */
+#define MT_ISARCHIVE_5945L2 0x04 /* Archive 5945L-2, QIC-24, QIC-02?. */
+#define MT_ISCMSJ500 0x05 /* CMS Jumbo 500 (QIC-02?). */
+#define MT_ISTDC3610 0x06 /* Tandberg 6310, QIC-24. */
+#define MT_ISARCHIVE_VP60I 0x07 /* Archive VP60i, QIC-02. */
+#define MT_ISARCHIVE_2150L 0x08 /* Archive Viper 2150L. */
+#define MT_ISARCHIVE_2060L 0x09 /* Archive Viper 2060L. */
+#define MT_ISARCHIVESC499 0x0A /* Archive SC-499 QIC-36 controller. */
+#define MT_ISQIC02_ALL_FEATURES 0x0F /* Generic QIC-02 with all features. */
+#define MT_ISWT5099EEN24 0x11 /* Wangtek 5099-een24, 60MB, QIC-24. */
+#define MT_ISTEAC_MT2ST 0x12 /* Teac MT-2ST 155mb drive,
+ Teac DC-1 card (Wangtek type). */
+#define MT_ISEVEREX_FT40A 0x32 /* Everex FT40A (QIC-40). */
+#define MT_ISDDS1 0x51 /* DDS device without partitions. */
+#define MT_ISDDS2 0x52 /* DDS device with partitions. */
+#define MT_ISSCSI1 0x71 /* Generic ANSI SCSI-1 tape unit. */
+#define MT_ISSCSI2 0x72 /* Generic ANSI SCSI-2 tape unit. */
+
+/* QIC-40/80/3010/3020 ftape supported drives.
+ 20bit vendor ID + 0x800000 (see vendors.h in ftape distribution). */
+#define MT_ISFTAPE_UNKNOWN 0x800000 /* obsolete */
+#define MT_ISFTAPE_FLAG 0x800000
+
+struct mt_tape_info
+ {
+ long int t_type; /* Device type id (mt_type). */
+ char *t_name; /* Descriptive name. */
+ };
+
+#define MT_TAPE_INFO \
+ { \
+ {MT_ISUNKNOWN, "Unknown type of tape device"}, \
+ {MT_ISQIC02, "Generic QIC-02 tape streamer"}, \
+ {MT_ISWT5150, "Wangtek 5150, QIC-150"}, \
+ {MT_ISARCHIVE_5945L2, "Archive 5945L-2"}, \
+ {MT_ISCMSJ500, "CMS Jumbo 500"}, \
+ {MT_ISTDC3610, "Tandberg TDC 3610, QIC-24"}, \
+ {MT_ISARCHIVE_VP60I, "Archive VP60i, QIC-02"}, \
+ {MT_ISARCHIVE_2150L, "Archive Viper 2150L"}, \
+ {MT_ISARCHIVE_2060L, "Archive Viper 2060L"}, \
+ {MT_ISARCHIVESC499, "Archive SC-499 QIC-36 controller"}, \
+ {MT_ISQIC02_ALL_FEATURES, "Generic QIC-02 tape, all features"}, \
+ {MT_ISWT5099EEN24, "Wangtek 5099-een24, 60MB"}, \
+ {MT_ISTEAC_MT2ST, "Teac MT-2ST 155mb data cassette drive"}, \
+ {MT_ISEVEREX_FT40A, "Everex FT40A, QIC-40"}, \
+ {MT_ISSCSI1, "Generic SCSI-1 tape"}, \
+ {MT_ISSCSI2, "Generic SCSI-2 tape"}, \
+ {0, NULL} \
+ }
+
+
+/* Structure for MTIOCPOS - mag tape get position command. */
+
+struct mtpos
+ {
+ long int mt_blkno; /* Current block number. */
+ };
+#define _IOT_mtpos /* Hurd ioctl type field. */ \
+ _IOT_SIMPLE (long)
+
+
+/* Structure for MTIOCGETCONFIG/MTIOCSETCONFIG primarily intended
+ as an interim solution for QIC-02 until DDI is fully implemented. */
+struct mtconfiginfo
+ {
+ long int mt_type; /* Drive type. */
+ long int ifc_type; /* Interface card type. */
+ unsigned short int irqnr; /* IRQ number to use. */
+ unsigned short int dmanr; /* DMA channel to use. */
+ unsigned short int port; /* IO port base address. */
+
+ unsigned long int debug; /* Debugging flags. */
+
+ unsigned have_dens:1;
+ unsigned have_bsf:1;
+ unsigned have_fsr:1;
+ unsigned have_bsr:1;
+ unsigned have_eod:1;
+ unsigned have_seek:1;
+ unsigned have_tell:1;
+ unsigned have_ras1:1;
+ unsigned have_ras2:1;
+ unsigned have_ras3:1;
+ unsigned have_qfa:1;
+
+ unsigned pad1:5;
+ char reserved[10];
+ };
+#define _IOT_mtconfiginfo /* Hurd ioctl type field. */ \
+ _IOT (_IOTS (long), 2, _IOTS (short), 3, _IOTS (long), 1) /* XXX wrong */
+
+
+/* Magnetic tape I/O control commands. */
+#define MTIOCTOP _IOW('m', 1, struct mtop) /* Do a mag tape op. */
+#define MTIOCGET _IOR('m', 2, struct mtget) /* Get tape status. */
+#define MTIOCPOS _IOR('m', 3, struct mtpos) /* Get tape position.*/
+
+/* The next two are used by the QIC-02 driver for runtime reconfiguration.
+ See tpqic02.h for struct mtconfiginfo. */
+#define MTIOCGETCONFIG _IOR('m', 4, struct mtconfiginfo) /* Get tape config.*/
+#define MTIOCSETCONFIG _IOW('m', 5, struct mtconfiginfo) /* Set tape config.*/
+
+/* Generic Mag Tape (device independent) status macros for examining
+ mt_gstat -- HP-UX compatible.
+ There is room for more generic status bits here, but I don't
+ know which of them are reserved. At least three or so should
+ be added to make this really useful. */
+#define GMT_EOF(x) ((x) & 0x80000000)
+#define GMT_BOT(x) ((x) & 0x40000000)
+#define GMT_EOT(x) ((x) & 0x20000000)
+#define GMT_SM(x) ((x) & 0x10000000) /* DDS setmark */
+#define GMT_EOD(x) ((x) & 0x08000000) /* DDS EOD */
+#define GMT_WR_PROT(x) ((x) & 0x04000000)
+/* #define GMT_ ? ((x) & 0x02000000) */
+#define GMT_ONLINE(x) ((x) & 0x01000000)
+#define GMT_D_6250(x) ((x) & 0x00800000)
+#define GMT_D_1600(x) ((x) & 0x00400000)
+#define GMT_D_800(x) ((x) & 0x00200000)
+/* #define GMT_ ? ((x) & 0x00100000) */
+/* #define GMT_ ? ((x) & 0x00080000) */
+#define GMT_DR_OPEN(x) ((x) & 0x00040000) /* Door open (no tape). */
+/* #define GMT_ ? ((x) & 0x00020000) */
+#define GMT_IM_REP_EN(x) ((x) & 0x00010000) /* Immediate report mode.*/
+/* 16 generic status bits unused. */
+
+
+/* SCSI-tape specific definitions. Bitfield shifts in the status */
+#define MT_ST_BLKSIZE_SHIFT 0
+#define MT_ST_BLKSIZE_MASK 0xffffff
+#define MT_ST_DENSITY_SHIFT 24
+#define MT_ST_DENSITY_MASK 0xff000000
+
+#define MT_ST_SOFTERR_SHIFT 0
+#define MT_ST_SOFTERR_MASK 0xffff
+
+/* Bitfields for the MTSETDRVBUFFER ioctl. */
+#define MT_ST_OPTIONS 0xf0000000
+#define MT_ST_BOOLEANS 0x10000000
+#define MT_ST_SETBOOLEANS 0x30000000
+#define MT_ST_CLEARBOOLEANS 0x40000000
+#define MT_ST_WRITE_THRESHOLD 0x20000000
+#define MT_ST_DEF_BLKSIZE 0x50000000
+#define MT_ST_DEF_OPTIONS 0x60000000
+
+#define MT_ST_BUFFER_WRITES 0x1
+#define MT_ST_ASYNC_WRITES 0x2
+#define MT_ST_READ_AHEAD 0x4
+#define MT_ST_DEBUGGING 0x8
+#define MT_ST_TWO_FM 0x10
+#define MT_ST_FAST_MTEOM 0x20
+#define MT_ST_AUTO_LOCK 0x40
+#define MT_ST_DEF_WRITES 0x80
+#define MT_ST_CAN_BSR 0x100
+#define MT_ST_NO_BLKLIMS 0x200
+#define MT_ST_CAN_PARTITIONS 0x400
+#define MT_ST_SCSI2LOGICAL 0x800
+
+/* The mode parameters to be controlled. Parameter chosen with bits 20-28. */
+#define MT_ST_CLEAR_DEFAULT 0xfffff
+#define MT_ST_DEF_DENSITY (MT_ST_DEF_OPTIONS | 0x100000)
+#define MT_ST_DEF_COMPRESSION (MT_ST_DEF_OPTIONS | 0x200000)
+#define MT_ST_DEF_DRVBUFFER (MT_ST_DEF_OPTIONS | 0x300000)
+
+/* The offset for the arguments for the special HP changer load command. */
+#define MT_ST_HPLOADER_OFFSET 10000
+
+
+/* Specify default tape device. */
+#ifndef DEFTAPE
+# define DEFTAPE "/dev/tape"
+#endif
+
+#endif /* mtio.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/param.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/param.h
new file mode 100644
index 0000000..0b0424e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/param.h
@@ -0,0 +1,72 @@
+/* Copyright (C) 1995,1996,1997,2000,2001,2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_PARAM_H
+#define _SYS_PARAM_H 1
+
+#include <limits.h>
+#include <linux/limits.h>
+#include <linux/param.h>
+
+/* BSD names for some <limits.h> values. */
+
+#define NBBY CHAR_BIT
+#ifndef NGROUPS
+# define NGROUPS NGROUPS_MAX
+#endif
+#define MAXSYMLINKS 20
+#define CANBSIZ MAX_CANON
+#define NCARGS ARG_MAX
+#define MAXPATHLEN PATH_MAX
+/* The following is not really correct but it is a value we used for a
+ long time and which seems to be usable. People should not use NOFILE
+ anyway. */
+#define NOFILE 256
+
+
+#include <sys/types.h>
+
+/* Bit map related macros. */
+#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
+#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
+#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
+#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
+
+/* Macros for counting and rounding. */
+#ifndef howmany
+# define howmany(x, y) (((x) + ((y) - 1)) / (y))
+#endif
+#ifdef __GNUC__
+# define roundup(x, y) (__builtin_constant_p (y) && powerof2 (y) \
+ ? (((x) + (y) - 1) & ~((y) - 1)) \
+ : ((((x) + ((y) - 1)) / (y)) * (y)))
+#else
+# define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
+#endif
+#define powerof2(x) ((((x) - 1) & (x)) == 0)
+
+/* Macros for min/max. */
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#define MAX(a,b) (((a)>(b))?(a):(b))
+
+
+/* Unit of `st_blocks'. */
+#define DEV_BSIZE 512
+
+
+#endif /* sys/param.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/personality.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/personality.h
new file mode 100644
index 0000000..5d14a9b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/personality.h
@@ -0,0 +1,73 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Taken verbatim from Linux 2.4 (include/linux/personality.h). */
+
+#ifndef _SYS_PERSONALITY_H
+#define _SYS_PERSONALITY_H 1
+
+#include <features.h>
+
+/* Flags for bug emulation.
+ These occupy the top three bytes. */
+enum
+ {
+ MMAP_PAGE_ZERO = 0x0100000,
+ ADDR_LIMIT_32BIT = 0x0800000,
+ SHORT_INODE = 0x1000000,
+ WHOLE_SECONDS = 0x2000000,
+ STICKY_TIMEOUTS = 0x4000000,
+ };
+
+/* Personality types.
+
+ These go in the low byte. Avoid using the top bit, it will
+ conflict with error returns. */
+enum
+ {
+ PER_LINUX = 0x0000,
+ PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT,
+ PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
+ PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
+ PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE,
+ PER_OSR5 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
+ PER_WYSEV386 = 0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
+ PER_ISCR4 = 0x0005 | STICKY_TIMEOUTS,
+ PER_BSD = 0x0006,
+ PER_SUNOS = 0x0006 | STICKY_TIMEOUTS,
+ PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
+ PER_LINUX32 = 0x0008,
+ PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS, /* IRIX5 32-bit */
+ PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS, /* IRIX6 new 32-bit */
+ PER_IRIX64 = 0x000b | STICKY_TIMEOUTS, /* IRIX6 64-bit */
+ PER_RISCOS = 0x000c,
+ PER_SOLARIS = 0x000d | STICKY_TIMEOUTS,
+ PER_UW7 = 0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
+ PER_HPUX = 0x000f,
+ PER_OSF4 = 0x0010,
+ PER_MASK = 0x00ff,
+ };
+
+__BEGIN_DECLS
+
+/* Set different ABIs (personalities). */
+extern int personality (unsigned long int __persona) __THROW;
+
+__END_DECLS
+
+#endif /* sys/personality.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/poll.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/poll.h
new file mode 100644
index 0000000..70f0d31
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/poll.h
@@ -0,0 +1,76 @@
+/* Compatibility definitions for System V `poll' interface.
+ Copyright (C) 1994,1996-2001,2004,2005,2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_POLL_H
+#define _SYS_POLL_H 1
+
+#include <features.h>
+
+/* Get the platform dependent bits of `poll'. */
+#include <bits/poll.h>
+#ifdef __USE_GNU
+/* Get the __sigset_t definition. */
+# include <bits/sigset.h>
+/* Get the timespec definition. */
+# define __need_timespec
+# include <time.h>
+/* get NULL definition. */
+# include <stddef.h>
+#endif
+
+
+/* Type used for the number of file descriptors. */
+typedef unsigned long int nfds_t;
+
+/* Data structure describing a polling request. */
+struct pollfd
+ {
+ int fd; /* File descriptor to poll. */
+ short int events; /* Types of events poller cares about. */
+ short int revents; /* Types of events that actually occurred. */
+ };
+
+
+__BEGIN_DECLS
+
+/* Poll the file descriptors described by the NFDS structures starting at
+ FDS. If TIMEOUT is nonzero and not -1, allow TIMEOUT milliseconds for
+ an event to occur; if TIMEOUT is -1, block until an event occurs.
+ Returns the number of file descriptors with events, zero if timed out,
+ or -1 for errors.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout);
+
+#ifdef __USE_GNU
+/* Like poll, but before waiting the threads signal mask is replaced
+ with that specified in the fourth parameter. For better usability,
+ the timeout value is specified using a TIMESPEC object.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int ppoll (struct pollfd *__fds, nfds_t __nfds,
+ __const struct timespec *__timeout,
+ __const __sigset_t *__ss);
+#endif
+
+__END_DECLS
+
+#endif /* sys/poll.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/prctl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/prctl.h
new file mode 100644
index 0000000..7e9b72d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/prctl.h
@@ -0,0 +1,32 @@
+/* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_PRCTL_H
+#define _SYS_PRCTL_H 1
+
+#include <features.h>
+#include <linux/prctl.h> /* The magic values come from here */
+
+__BEGIN_DECLS
+
+/* Control process execution. */
+extern int prctl (int __option, ...) __THROW;
+
+__END_DECLS
+
+#endif /* sys/prctl.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/procfs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/procfs.h
new file mode 100644
index 0000000..a21652e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/procfs.h
@@ -0,0 +1,112 @@
+/* Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_PROCFS_H
+#define _SYS_PROCFS_H 1
+
+/* This is somehow modelled after the file of the same name on SysVr4
+ systems. It provides a definition of the core file format for ELF
+ used on Linux. */
+
+#include <features.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/user.h>
+
+/* ELF register definitions */
+#define ELF_NGREG 45
+#define ELF_NFPREG 33
+
+typedef unsigned long elf_greg_t;
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+typedef double elf_fpreg_t;
+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+
+__BEGIN_DECLS
+
+struct elf_siginfo
+ {
+ int si_signo; /* Signal number. */
+ int si_code; /* Extra code. */
+ int si_errno; /* Errno. */
+ };
+
+
+/* Definitions to generate Intel SVR4-like core files. These mostly
+ have the same names as the SVR4 types with "elf_" tacked on the
+ front to prevent clashes with linux definitions, and the typedef
+ forms have been avoided. This is mostly like the SVR4 structure,
+ but more Linuxy, with things that Linux does not support and which
+ gdb doesn't really use excluded. Fields present but not used are
+ marked with "XXX". */
+struct elf_prstatus
+ {
+ struct elf_siginfo pr_info; /* Info associated with signal. */
+ short int pr_cursig; /* Current signal. */
+ unsigned long int pr_sigpend; /* Set of pending signals. */
+ unsigned long int pr_sighold; /* Set of held signals. */
+ __pid_t pr_pid;
+ __pid_t pr_ppid;
+ __pid_t pr_pgrp;
+ __pid_t pr_sid;
+ struct timeval pr_utime; /* User time. */
+ struct timeval pr_stime; /* System time. */
+ struct timeval pr_cutime; /* Cumulative user time. */
+ struct timeval pr_cstime; /* Cumulative system time. */
+ elf_gregset_t pr_reg; /* GP registers. */
+ int pr_fpvalid; /* True if math copro being used. */
+ };
+
+
+#define ELF_PRARGSZ (80) /* Number of chars for args */
+
+struct elf_prpsinfo
+ {
+ char pr_state; /* Numeric process state. */
+ char pr_sname; /* Char for pr_state. */
+ char pr_zomb; /* Zombie. */
+ char pr_nice; /* Nice val. */
+ unsigned long int pr_flag; /* Flags. */
+ long pr_uid;
+ long pr_gid;
+ int pr_pid, pr_ppid, pr_pgrp, pr_sid;
+ /* Lots missing */
+ char pr_fname[16]; /* Filename of executable. */
+ char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
+ };
+
+
+/* Addresses. */
+typedef void *psaddr_t;
+
+/* Register sets. Linux has different names. */
+typedef elf_gregset_t prgregset_t;
+typedef elf_fpregset_t prfpregset_t;
+
+/* We don't have any differences between processes and threads,
+ therefore habe only ine PID type. */
+typedef __pid_t lwpid_t;
+
+
+typedef struct elf_prstatus prstatus_t;
+typedef struct elf_prpsinfo prpsinfo_t;
+
+__END_DECLS
+
+#endif /* sys/procfs.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ptrace.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ptrace.h
new file mode 100644
index 0000000..b4aec4f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ptrace.h
@@ -0,0 +1,129 @@
+/* `ptrace' debugger support interface. Linux version.
+ Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_PTRACE_H
+#define _SYS_PTRACE_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Type of the REQUEST argument to `ptrace.' */
+enum __ptrace_request
+{
+ /* Indicate that the process making this request should be traced.
+ All signals received by this process can be intercepted by its
+ parent, and its parent can use the other `ptrace' requests. */
+ PTRACE_TRACEME = 0,
+#define PT_TRACE_ME PTRACE_TRACEME
+
+ /* Return the word in the process's text space at address ADDR. */
+ PTRACE_PEEKTEXT = 1,
+#define PT_READ_I PTRACE_PEEKTEXT
+
+ /* Return the word in the process's data space at address ADDR. */
+ PTRACE_PEEKDATA = 2,
+#define PT_READ_D PTRACE_PEEKDATA
+
+ /* Return the word in the process's user area at offset ADDR. */
+ PTRACE_PEEKUSER = 3,
+#define PT_READ_U PTRACE_PEEKUSER
+
+ /* Write the word DATA into the process's text space at address ADDR. */
+ PTRACE_POKETEXT = 4,
+#define PT_WRITE_I PTRACE_POKETEXT
+
+ /* Write the word DATA into the process's data space at address ADDR. */
+ PTRACE_POKEDATA = 5,
+#define PT_WRITE_D PTRACE_POKEDATA
+
+ /* Write the word DATA into the process's user area at offset ADDR. */
+ PTRACE_POKEUSER = 6,
+#define PT_WRITE_U PTRACE_POKEUSER
+
+ /* Continue the process. */
+ PTRACE_CONT = 7,
+#define PT_CONTINUE PTRACE_CONT
+
+ /* Kill the process. */
+ PTRACE_KILL = 8,
+#define PT_KILL PTRACE_KILL
+
+ /* Single step the process.
+ This is not supported on all machines. */
+ PTRACE_SINGLESTEP = 9,
+#define PT_STEP PTRACE_SINGLESTEP
+
+ /* Get all general purpose registers used by a processes.
+ This is not supported on all machines. */
+ PTRACE_GETREGS = 12,
+#define PT_GETREGS PTRACE_GETREGS
+
+ /* Set all general purpose registers used by a processes.
+ This is not supported on all machines. */
+ PTRACE_SETREGS = 13,
+#define PT_SETREGS PTRACE_SETREGS
+
+ /* Get all floating point registers used by a processes.
+ This is not supported on all machines. */
+ PTRACE_GETFPREGS = 14,
+#define PT_GETFPREGS PTRACE_GETFPREGS
+
+ /* Set all floating point registers used by a processes.
+ This is not supported on all machines. */
+ PTRACE_SETFPREGS = 15,
+#define PT_SETFPREGS PTRACE_SETFPREGS
+
+ /* Attach to a process that is already running. */
+ PTRACE_ATTACH = 16,
+#define PT_ATTACH PTRACE_ATTACH
+
+ /* Detach from a process attached to with PTRACE_ATTACH. */
+ PTRACE_DETACH = 17,
+#define PT_DETACH PTRACE_DETACH
+
+ /* Get all extended floating point registers used by a processes.
+ This is not supported on all machines. */
+ PTRACE_GETFPXREGS = 18,
+#define PT_GETFPXREGS PTRACE_GETFPXREGS
+
+ /* Set all extended floating point registers used by a processes.
+ This is not supported on all machines. */
+ PTRACE_SETFPXREGS = 19,
+#define PT_SETFPXREGS PTRACE_SETFPXREGS
+
+ /* Continue and stop at the next (return from) syscall. */
+ PTRACE_SYSCALL = 24
+#define PT_SYSCALL PTRACE_SYSCALL
+};
+
+/* Perform process tracing functions. REQUEST is one of the values
+ above, and determines the action to be taken.
+ For all requests except PTRACE_TRACEME, PID specifies the process to be
+ traced.
+
+ PID and the other arguments described above for the various requests should
+ appear (those that are used for the particular request) as:
+ pid_t PID, void *ADDR, int DATA, void *ADDR2
+ after REQUEST. */
+extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_PTRACE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/queue.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/queue.h
new file mode 100644
index 0000000..b0e6b38
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/queue.h
@@ -0,0 +1,557 @@
+/*
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)queue.h 8.5 (Berkeley) 8/20/94
+ */
+
+#ifndef _SYS_QUEUE_H_
+#define _SYS_QUEUE_H_
+
+/*
+ * This file defines five types of data structures: singly-linked lists,
+ * lists, simple queues, tail queues, and circular queues.
+ *
+ * A singly-linked list is headed by a single forward pointer. The
+ * elements are singly linked for minimum space and pointer manipulation
+ * overhead at the expense of O(n) removal for arbitrary elements. New
+ * elements can be added to the list after an existing element or at the
+ * head of the list. Elements being removed from the head of the list
+ * should use the explicit macro for this purpose for optimum
+ * efficiency. A singly-linked list may only be traversed in the forward
+ * direction. Singly-linked lists are ideal for applications with large
+ * datasets and few or no removals or for implementing a LIFO queue.
+ *
+ * A list is headed by a single forward pointer (or an array of forward
+ * pointers for a hash table header). The elements are doubly linked
+ * so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before
+ * or after an existing element or at the head of the list. A list
+ * may only be traversed in the forward direction.
+ *
+ * A simple queue is headed by a pair of pointers, one the head of the
+ * list and the other to the tail of the list. The elements are singly
+ * linked to save space, so elements can only be removed from the
+ * head of the list. New elements can be added to the list after
+ * an existing element, at the head of the list, or at the end of the
+ * list. A simple queue may only be traversed in the forward direction.
+ *
+ * A tail queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or
+ * after an existing element, at the head of the list, or at the end of
+ * the list. A tail queue may be traversed in either direction.
+ *
+ * A circle queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or after
+ * an existing element, at the head of the list, or at the end of the list.
+ * A circle queue may be traversed in either direction, but has a more
+ * complex end of list detection.
+ *
+ * For details on the use of these macros, see the queue(3) manual page.
+ */
+
+/*
+ * List definitions.
+ */
+#define LIST_HEAD(name, type) \
+struct name { \
+ struct type *lh_first; /* first element */ \
+}
+
+#define LIST_HEAD_INITIALIZER(head) \
+ { NULL }
+
+#define LIST_ENTRY(type) \
+struct { \
+ struct type *le_next; /* next element */ \
+ struct type **le_prev; /* address of previous next element */ \
+}
+
+/*
+ * List functions.
+ */
+#define LIST_INIT(head) do { \
+ (head)->lh_first = NULL; \
+} while (/*CONSTCOND*/0)
+
+#define LIST_INSERT_AFTER(listelm, elm, field) do { \
+ if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
+ (listelm)->field.le_next->field.le_prev = \
+ &(elm)->field.le_next; \
+ (listelm)->field.le_next = (elm); \
+ (elm)->field.le_prev = &(listelm)->field.le_next; \
+} while (/*CONSTCOND*/0)
+
+#define LIST_INSERT_BEFORE(listelm, elm, field) do { \
+ (elm)->field.le_prev = (listelm)->field.le_prev; \
+ (elm)->field.le_next = (listelm); \
+ *(listelm)->field.le_prev = (elm); \
+ (listelm)->field.le_prev = &(elm)->field.le_next; \
+} while (/*CONSTCOND*/0)
+
+#define LIST_INSERT_HEAD(head, elm, field) do { \
+ if (((elm)->field.le_next = (head)->lh_first) != NULL) \
+ (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
+ (head)->lh_first = (elm); \
+ (elm)->field.le_prev = &(head)->lh_first; \
+} while (/*CONSTCOND*/0)
+
+#define LIST_REMOVE(elm, field) do { \
+ if ((elm)->field.le_next != NULL) \
+ (elm)->field.le_next->field.le_prev = \
+ (elm)->field.le_prev; \
+ *(elm)->field.le_prev = (elm)->field.le_next; \
+} while (/*CONSTCOND*/0)
+
+#define LIST_FOREACH(var, head, field) \
+ for ((var) = ((head)->lh_first); \
+ (var); \
+ (var) = ((var)->field.le_next))
+
+/*
+ * List access methods.
+ */
+#define LIST_EMPTY(head) ((head)->lh_first == NULL)
+#define LIST_FIRST(head) ((head)->lh_first)
+#define LIST_NEXT(elm, field) ((elm)->field.le_next)
+
+
+/*
+ * Singly-linked List definitions.
+ */
+#define SLIST_HEAD(name, type) \
+struct name { \
+ struct type *slh_first; /* first element */ \
+}
+
+#define SLIST_HEAD_INITIALIZER(head) \
+ { NULL }
+
+#define SLIST_ENTRY(type) \
+struct { \
+ struct type *sle_next; /* next element */ \
+}
+
+/*
+ * Singly-linked List functions.
+ */
+#define SLIST_INIT(head) do { \
+ (head)->slh_first = NULL; \
+} while (/*CONSTCOND*/0)
+
+#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
+ (elm)->field.sle_next = (slistelm)->field.sle_next; \
+ (slistelm)->field.sle_next = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define SLIST_INSERT_HEAD(head, elm, field) do { \
+ (elm)->field.sle_next = (head)->slh_first; \
+ (head)->slh_first = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define SLIST_REMOVE_HEAD(head, field) do { \
+ (head)->slh_first = (head)->slh_first->field.sle_next; \
+} while (/*CONSTCOND*/0)
+
+#define SLIST_REMOVE(head, elm, type, field) do { \
+ if ((head)->slh_first == (elm)) { \
+ SLIST_REMOVE_HEAD((head), field); \
+ } \
+ else { \
+ struct type *curelm = (head)->slh_first; \
+ while(curelm->field.sle_next != (elm)) \
+ curelm = curelm->field.sle_next; \
+ curelm->field.sle_next = \
+ curelm->field.sle_next->field.sle_next; \
+ } \
+} while (/*CONSTCOND*/0)
+
+#define SLIST_FOREACH(var, head, field) \
+ for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
+
+/*
+ * Singly-linked List access methods.
+ */
+#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
+#define SLIST_FIRST(head) ((head)->slh_first)
+#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
+
+
+/*
+ * Singly-linked Tail queue declarations.
+ */
+#define STAILQ_HEAD(name, type) \
+struct name { \
+ struct type *stqh_first; /* first element */ \
+ struct type **stqh_last; /* addr of last next element */ \
+}
+
+#define STAILQ_HEAD_INITIALIZER(head) \
+ { NULL, &(head).stqh_first }
+
+#define STAILQ_ENTRY(type) \
+struct { \
+ struct type *stqe_next; /* next element */ \
+}
+
+/*
+ * Singly-linked Tail queue functions.
+ */
+#define STAILQ_INIT(head) do { \
+ (head)->stqh_first = NULL; \
+ (head)->stqh_last = &(head)->stqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_INSERT_HEAD(head, elm, field) do { \
+ if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
+ (head)->stqh_last = &(elm)->field.stqe_next; \
+ (head)->stqh_first = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.stqe_next = NULL; \
+ *(head)->stqh_last = (elm); \
+ (head)->stqh_last = &(elm)->field.stqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
+ (head)->stqh_last = &(elm)->field.stqe_next; \
+ (listelm)->field.stqe_next = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_REMOVE_HEAD(head, field) do { \
+ if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \
+ (head)->stqh_last = &(head)->stqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_REMOVE(head, elm, type, field) do { \
+ if ((head)->stqh_first == (elm)) { \
+ STAILQ_REMOVE_HEAD((head), field); \
+ } else { \
+ struct type *curelm = (head)->stqh_first; \
+ while (curelm->field.stqe_next != (elm)) \
+ curelm = curelm->field.stqe_next; \
+ if ((curelm->field.stqe_next = \
+ curelm->field.stqe_next->field.stqe_next) == NULL) \
+ (head)->stqh_last = &(curelm)->field.stqe_next; \
+ } \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_FOREACH(var, head, field) \
+ for ((var) = ((head)->stqh_first); \
+ (var); \
+ (var) = ((var)->field.stqe_next))
+
+/*
+ * Singly-linked Tail queue access methods.
+ */
+#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL)
+#define STAILQ_FIRST(head) ((head)->stqh_first)
+#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
+
+
+/*
+ * Simple queue definitions.
+ */
+#define SIMPLEQ_HEAD(name, type) \
+struct name { \
+ struct type *sqh_first; /* first element */ \
+ struct type **sqh_last; /* addr of last next element */ \
+}
+
+#define SIMPLEQ_HEAD_INITIALIZER(head) \
+ { NULL, &(head).sqh_first }
+
+#define SIMPLEQ_ENTRY(type) \
+struct { \
+ struct type *sqe_next; /* next element */ \
+}
+
+/*
+ * Simple queue functions.
+ */
+#define SIMPLEQ_INIT(head) do { \
+ (head)->sqh_first = NULL; \
+ (head)->sqh_last = &(head)->sqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \
+ if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+ (head)->sqh_first = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.sqe_next = NULL; \
+ *(head)->sqh_last = (elm); \
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+ (listelm)->field.sqe_next = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_REMOVE_HEAD(head, field) do { \
+ if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
+ (head)->sqh_last = &(head)->sqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_REMOVE(head, elm, type, field) do { \
+ if ((head)->sqh_first == (elm)) { \
+ SIMPLEQ_REMOVE_HEAD((head), field); \
+ } else { \
+ struct type *curelm = (head)->sqh_first; \
+ while (curelm->field.sqe_next != (elm)) \
+ curelm = curelm->field.sqe_next; \
+ if ((curelm->field.sqe_next = \
+ curelm->field.sqe_next->field.sqe_next) == NULL) \
+ (head)->sqh_last = &(curelm)->field.sqe_next; \
+ } \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_FOREACH(var, head, field) \
+ for ((var) = ((head)->sqh_first); \
+ (var); \
+ (var) = ((var)->field.sqe_next))
+
+/*
+ * Simple queue access methods.
+ */
+#define SIMPLEQ_EMPTY(head) ((head)->sqh_first == NULL)
+#define SIMPLEQ_FIRST(head) ((head)->sqh_first)
+#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next)
+
+
+/*
+ * Tail queue definitions.
+ */
+#define _TAILQ_HEAD(name, type, qual) \
+struct name { \
+ qual type *tqh_first; /* first element */ \
+ qual type *qual *tqh_last; /* addr of last next element */ \
+}
+#define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,)
+
+#define TAILQ_HEAD_INITIALIZER(head) \
+ { NULL, &(head).tqh_first }
+
+#define _TAILQ_ENTRY(type, qual) \
+struct { \
+ qual type *tqe_next; /* next element */ \
+ qual type *qual *tqe_prev; /* address of previous next element */\
+}
+#define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,)
+
+/*
+ * Tail queue functions.
+ */
+#define TAILQ_INIT(head) do { \
+ (head)->tqh_first = NULL; \
+ (head)->tqh_last = &(head)->tqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_INSERT_HEAD(head, elm, field) do { \
+ if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
+ (head)->tqh_first->field.tqe_prev = \
+ &(elm)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+ (head)->tqh_first = (elm); \
+ (elm)->field.tqe_prev = &(head)->tqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.tqe_next = NULL; \
+ (elm)->field.tqe_prev = (head)->tqh_last; \
+ *(head)->tqh_last = (elm); \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
+ (elm)->field.tqe_next->field.tqe_prev = \
+ &(elm)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+ (listelm)->field.tqe_next = (elm); \
+ (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
+ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
+ (elm)->field.tqe_next = (listelm); \
+ *(listelm)->field.tqe_prev = (elm); \
+ (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_REMOVE(head, elm, field) do { \
+ if (((elm)->field.tqe_next) != NULL) \
+ (elm)->field.tqe_next->field.tqe_prev = \
+ (elm)->field.tqe_prev; \
+ else \
+ (head)->tqh_last = (elm)->field.tqe_prev; \
+ *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_FOREACH(var, head, field) \
+ for ((var) = ((head)->tqh_first); \
+ (var); \
+ (var) = ((var)->field.tqe_next))
+
+#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
+ for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \
+ (var); \
+ (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
+
+/*
+ * Tail queue access methods.
+ */
+#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
+#define TAILQ_FIRST(head) ((head)->tqh_first)
+#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
+
+#define TAILQ_LAST(head, headname) \
+ (*(((struct headname *)((head)->tqh_last))->tqh_last))
+#define TAILQ_PREV(elm, headname, field) \
+ (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
+
+
+/*
+ * Circular queue definitions.
+ */
+#define CIRCLEQ_HEAD(name, type) \
+struct name { \
+ struct type *cqh_first; /* first element */ \
+ struct type *cqh_last; /* last element */ \
+}
+
+#define CIRCLEQ_HEAD_INITIALIZER(head) \
+ { (void *)&head, (void *)&head }
+
+#define CIRCLEQ_ENTRY(type) \
+struct { \
+ struct type *cqe_next; /* next element */ \
+ struct type *cqe_prev; /* previous element */ \
+}
+
+/*
+ * Circular queue functions.
+ */
+#define CIRCLEQ_INIT(head) do { \
+ (head)->cqh_first = (void *)(head); \
+ (head)->cqh_last = (void *)(head); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ (elm)->field.cqe_next = (listelm)->field.cqe_next; \
+ (elm)->field.cqe_prev = (listelm); \
+ if ((listelm)->field.cqe_next == (void *)(head)) \
+ (head)->cqh_last = (elm); \
+ else \
+ (listelm)->field.cqe_next->field.cqe_prev = (elm); \
+ (listelm)->field.cqe_next = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \
+ (elm)->field.cqe_next = (listelm); \
+ (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
+ if ((listelm)->field.cqe_prev == (void *)(head)) \
+ (head)->cqh_first = (elm); \
+ else \
+ (listelm)->field.cqe_prev->field.cqe_next = (elm); \
+ (listelm)->field.cqe_prev = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \
+ (elm)->field.cqe_next = (head)->cqh_first; \
+ (elm)->field.cqe_prev = (void *)(head); \
+ if ((head)->cqh_last == (void *)(head)) \
+ (head)->cqh_last = (elm); \
+ else \
+ (head)->cqh_first->field.cqe_prev = (elm); \
+ (head)->cqh_first = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.cqe_next = (void *)(head); \
+ (elm)->field.cqe_prev = (head)->cqh_last; \
+ if ((head)->cqh_first == (void *)(head)) \
+ (head)->cqh_first = (elm); \
+ else \
+ (head)->cqh_last->field.cqe_next = (elm); \
+ (head)->cqh_last = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_REMOVE(head, elm, field) do { \
+ if ((elm)->field.cqe_next == (void *)(head)) \
+ (head)->cqh_last = (elm)->field.cqe_prev; \
+ else \
+ (elm)->field.cqe_next->field.cqe_prev = \
+ (elm)->field.cqe_prev; \
+ if ((elm)->field.cqe_prev == (void *)(head)) \
+ (head)->cqh_first = (elm)->field.cqe_next; \
+ else \
+ (elm)->field.cqe_prev->field.cqe_next = \
+ (elm)->field.cqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_FOREACH(var, head, field) \
+ for ((var) = ((head)->cqh_first); \
+ (var) != (const void *)(head); \
+ (var) = ((var)->field.cqe_next))
+
+#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \
+ for ((var) = ((head)->cqh_last); \
+ (var) != (const void *)(head); \
+ (var) = ((var)->field.cqe_prev))
+
+/*
+ * Circular queue access methods.
+ */
+#define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head))
+#define CIRCLEQ_FIRST(head) ((head)->cqh_first)
+#define CIRCLEQ_LAST(head) ((head)->cqh_last)
+#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next)
+#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev)
+
+#define CIRCLEQ_LOOP_NEXT(head, elm, field) \
+ (((elm)->field.cqe_next == (void *)(head)) \
+ ? ((head)->cqh_first) \
+ : (elm->field.cqe_next))
+#define CIRCLEQ_LOOP_PREV(head, elm, field) \
+ (((elm)->field.cqe_prev == (void *)(head)) \
+ ? ((head)->cqh_last) \
+ : (elm->field.cqe_prev))
+
+#endif /* sys/queue.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/quota.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/quota.h
new file mode 100644
index 0000000..a6afdbe
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/quota.h
@@ -0,0 +1,158 @@
+/* This just represents the non-kernel parts of <linux/quota.h>.
+ *
+ * here's the corresponding copyright:
+ * Copyright (c) 1982, 1986 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Robert Elz at The University of Melbourne.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * Version: $Id: quota.h,v 1.1 2002/01/03 04:00:09 andersen Exp $
+ */
+
+#ifndef _SYS_QUOTA_H
+#define _SYS_QUOTA_H 1
+
+#include <features.h>
+#include <sys/types.h>
+
+/*
+ * Convert diskblocks to blocks and the other way around.
+ * currently only to fool the BSD source. :-)
+ */
+#define dbtob(num) ((num) << 10)
+#define btodb(num) ((num) >> 10)
+
+/*
+ * Convert count of filesystem blocks to diskquota blocks, meant
+ * for filesystems where i_blksize != BLOCK_SIZE
+ */
+#define fs_to_dq_blocks(num, blksize) (((num) * (blksize)) / BLOCK_SIZE)
+
+/*
+ * Definitions for disk quotas imposed on the average user
+ * (big brother finally hits Linux).
+ *
+ * The following constants define the amount of time given a user
+ * before the soft limits are treated as hard limits (usually resulting
+ * in an allocation failure). The timer is started when the user crosses
+ * their soft limit, it is reset when they go below their soft limit.
+ */
+#define MAX_IQ_TIME 604800 /* (7*24*60*60) 1 week */
+#define MAX_DQ_TIME 604800 /* (7*24*60*60) 1 week */
+
+#define MAXQUOTAS 2
+#define USRQUOTA 0 /* element used for user quotas */
+#define GRPQUOTA 1 /* element used for group quotas */
+
+/*
+ * Definitions for the default names of the quotas files.
+ */
+#define INITQFNAMES { \
+ "user", /* USRQUOTA */ \
+ "group", /* GRPQUOTA */ \
+ "undefined", \
+};
+
+#define QUOTAFILENAME "quota"
+#define QUOTAGROUP "staff"
+
+#define NR_DQHASH 43 /* Just an arbitrary number any suggestions ? */
+#define NR_DQUOTS 256 /* Number of quotas active at one time */
+
+/*
+ * Command definitions for the 'quotactl' system call.
+ * The commands are broken into a main command defined below
+ * and a subcommand that is used to convey the type of
+ * quota that is being manipulated (see above).
+ */
+#define SUBCMDMASK 0x00ff
+#define SUBCMDSHIFT 8
+#define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
+
+#define Q_QUOTAON 0x0100 /* enable quotas */
+#define Q_QUOTAOFF 0x0200 /* disable quotas */
+#define Q_GETQUOTA 0x0300 /* get limits and usage */
+#define Q_SETQUOTA 0x0400 /* set limits and usage */
+#define Q_SETUSE 0x0500 /* set usage */
+#define Q_SYNC 0x0600 /* sync disk copy of a filesystems quotas */
+#define Q_SETQLIM 0x0700 /* set limits */
+#define Q_GETSTATS 0x0800 /* get collected stats */
+#define Q_RSQUASH 0x1000 /* set root_squash option */
+
+/*
+ * The following structure defines the format of the disk quota file
+ * (as it appears on disk) - the file is an array of these structures
+ * indexed by user or group number.
+ */
+struct dqblk
+ {
+ u_int32_t dqb_bhardlimit; /* absolute limit on disk blks alloc */
+ u_int32_t dqb_bsoftlimit; /* preferred limit on disk blks */
+ u_int32_t dqb_curblocks; /* current block count */
+ u_int32_t dqb_ihardlimit; /* maximum # allocated inodes */
+ u_int32_t dqb_isoftlimit; /* preferred inode limit */
+ u_int32_t dqb_curinodes; /* current # allocated inodes */
+ time_t dqb_btime; /* time limit for excessive disk use */
+ time_t dqb_itime; /* time limit for excessive files */
+ };
+
+/*
+ * Shorthand notation.
+ */
+#define dq_bhardlimit dq_dqb.dqb_bhardlimit
+#define dq_bsoftlimit dq_dqb.dqb_bsoftlimit
+#define dq_curblocks dq_dqb.dqb_curblocks
+#define dq_ihardlimit dq_dqb.dqb_ihardlimit
+#define dq_isoftlimit dq_dqb.dqb_isoftlimit
+#define dq_curinodes dq_dqb.dqb_curinodes
+#define dq_btime dq_dqb.dqb_btime
+#define dq_itime dq_dqb.dqb_itime
+
+#define dqoff(UID) ((loff_t)((UID) * sizeof (struct dqblk)))
+
+struct dqstats
+ {
+ u_int32_t lookups;
+ u_int32_t drops;
+ u_int32_t reads;
+ u_int32_t writes;
+ u_int32_t cache_hits;
+ u_int32_t pages_allocated;
+ u_int32_t allocated_dquots;
+ u_int32_t free_dquots;
+ u_int32_t syncs;
+ };
+
+__BEGIN_DECLS
+
+extern int quotactl (int __cmd, const char *__special, int __id,
+ caddr_t __addr) __THROW;
+
+__END_DECLS
+
+#endif /* sys/quota.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/reboot.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/reboot.h
new file mode 100644
index 0000000..2a719c7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/reboot.h
@@ -0,0 +1,49 @@
+/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* This file should define RB_* macros to be used as flag
+ bits in the argument to the `reboot' system call. */
+
+#ifndef _SYS_REBOOT_H
+#define _SYS_REBOOT_H 1
+
+#include <features.h>
+
+/* Perform a hard reset now. */
+#define RB_AUTOBOOT 0x01234567
+
+/* Halt the system. */
+#define RB_HALT_SYSTEM 0xcdef0123
+
+/* Enable reboot using Ctrl-Alt-Delete keystroke. */
+#define RB_ENABLE_CAD 0x89abcdef
+
+/* Disable reboot using Ctrl-Alt-Delete keystroke. */
+#define RB_DISABLE_CAD 0
+
+/* Stop system and switch power off if possible. */
+#define RB_POWER_OFF 0x4321fedc
+
+__BEGIN_DECLS
+
+/* Reboot or halt the system. */
+extern int reboot (int __howto) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_REBOOT_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/regdef.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/regdef.h
new file mode 100644
index 0000000..9d2c4c1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/regdef.h
@@ -0,0 +1,80 @@
+/* Copyright (C) 1997, 1998, 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ralf Baechle <ralf@gnu.org>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_REGDEF_H
+#define _SYS_REGDEF_H
+
+/*
+ * Symbolic register names for 32 bit ABI
+ */
+#define zero $0 /* wired zero */
+#define AT $1 /* assembler temp - uppercase because of ".set at" */
+#define v0 $2 /* return value */
+#define v1 $3
+#define a0 $4 /* argument registers */
+#define a1 $5
+#define a2 $6
+#define a3 $7
+#if _MIPS_SIM != _MIPS_SIM_ABI32
+#define a4 $8
+#define a5 $9
+#define a6 $10
+#define a7 $11
+#define t0 $12
+#define t1 $13
+#define t2 $14
+#define t3 $15
+#define ta0 a4
+#define ta1 a5
+#define ta2 a6
+#define ta3 a7
+#else /* if _MIPS_SIM == _MIPS_SIM_ABI32 */
+#define t0 $8 /* caller saved */
+#define t1 $9
+#define t2 $10
+#define t3 $11
+#define t4 $12
+#define t5 $13
+#define t6 $14
+#define t7 $15
+#define ta0 t4
+#define ta1 t5
+#define ta2 t6
+#define ta3 t7
+#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
+#define s0 $16 /* callee saved */
+#define s1 $17
+#define s2 $18
+#define s3 $19
+#define s4 $20
+#define s5 $21
+#define s6 $22
+#define s7 $23
+#define t8 $24 /* caller saved */
+#define t9 $25
+#define jp $25 /* PIC jump register */
+#define k0 $26 /* kernel scratch */
+#define k1 $27
+#define gp $28 /* global pointer */
+#define sp $29 /* stack pointer */
+#define fp $30 /* frame pointer */
+#define s8 $30 /* same like fp! */
+#define ra $31 /* return address */
+
+#endif /* _SYS_REGDEF_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/resource.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/resource.h
new file mode 100644
index 0000000..3912741
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/resource.h
@@ -0,0 +1,103 @@
+/* Copyright (C) 1992,94,1996-2000,2002,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_RESOURCE_H
+#define _SYS_RESOURCE_H 1
+
+#include <features.h>
+
+/* Get the system-dependent definitions of structures and bit values. */
+#include <bits/resource.h>
+
+#ifndef __id_t_defined
+typedef __id_t id_t;
+# define __id_t_defined
+#endif
+
+__BEGIN_DECLS
+
+/* The X/Open standard defines that all the functions below must use
+ `int' as the type for the first argument. When we are compiling with
+ GNU extensions we change this slightly to provide better error
+ checking. */
+#if defined __USE_GNU && !defined __cplusplus
+typedef enum __rlimit_resource __rlimit_resource_t;
+typedef enum __rusage_who __rusage_who_t;
+typedef enum __priority_which __priority_which_t;
+#else
+typedef int __rlimit_resource_t;
+typedef int __rusage_who_t;
+typedef int __priority_which_t;
+#endif
+
+/* Put the soft and hard limits for RESOURCE in *RLIMITS.
+ Returns 0 if successful, -1 if not (and sets errno). */
+#ifndef __USE_FILE_OFFSET64
+extern int getrlimit (__rlimit_resource_t __resource,
+ struct rlimit *__rlimits) __THROW;
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (getrlimit, (__rlimit_resource_t __resource,
+ struct rlimit *__rlimits), getrlimit64);
+# else
+# define getrlimit getrlimit64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int getrlimit64 (__rlimit_resource_t __resource,
+ struct rlimit64 *__rlimits) __THROW;
+#endif
+
+/* Set the soft and hard limits for RESOURCE to *RLIMITS.
+ Only the super-user can increase hard limits.
+ Return 0 if successful, -1 if not (and sets errno). */
+#ifndef __USE_FILE_OFFSET64
+extern int setrlimit (__rlimit_resource_t __resource,
+ __const struct rlimit *__rlimits) __THROW;
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (setrlimit, (__rlimit_resource_t __resource,
+ __const struct rlimit *__rlimits),
+ setrlimit64);
+# else
+# define setrlimit setrlimit64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int setrlimit64 (__rlimit_resource_t __resource,
+ __const struct rlimit64 *__rlimits) __THROW;
+#endif
+
+/* Return resource usage information on process indicated by WHO
+ and put it in *USAGE. Returns 0 for success, -1 for failure. */
+extern int getrusage (__rusage_who_t __who, struct rusage *__usage) __THROW;
+
+/* Return the highest priority of any process specified by WHICH and WHO
+ (see above); if WHO is zero, the current process, process group, or user
+ (as specified by WHO) is used. A lower priority number means higher
+ priority. Priorities range from PRIO_MIN to PRIO_MAX (above). */
+extern int getpriority (__priority_which_t __which, id_t __who) __THROW;
+
+/* Set the priority of all processes specified by WHICH and WHO (see above)
+ to PRIO. Returns 0 on success, -1 on errors. */
+extern int setpriority (__priority_which_t __which, id_t __who, int __prio)
+ __THROW;
+
+__END_DECLS
+
+#endif /* sys/resource.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/select.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/select.h
new file mode 100644
index 0000000..2a40843
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/select.h
@@ -0,0 +1,130 @@
+/* `fd_set' type and related macros, and `select'/`pselect' declarations.
+ Copyright (C) 1996,97,98,99,2000,01,02,2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* POSIX 1003.1g: 6.2 Select from File Descriptor Sets <sys/select.h> */
+
+#ifndef _SYS_SELECT_H
+#define _SYS_SELECT_H 1
+
+#include <features.h>
+
+/* Get definition of needed basic types. */
+#include <bits/types.h>
+
+/* Get __FD_* definitions. */
+#include <bits/select.h>
+
+/* Get __sigset_t. */
+#include <bits/sigset.h>
+
+#ifndef __sigset_t_defined
+# define __sigset_t_defined
+typedef __sigset_t sigset_t;
+#endif
+
+/* Get definition of timer specification structures. */
+#define __need_time_t
+#define __need_timespec
+#include <time.h>
+#define __need_timeval
+#include <bits/time.h>
+
+#ifndef __suseconds_t_defined
+typedef __suseconds_t suseconds_t;
+# define __suseconds_t_defined
+#endif
+
+
+/* The fd_set member is required to be an array of longs. */
+typedef long int __fd_mask;
+
+/* Some versions of <linux/posix_types.h> define these macros. */
+#undef __NFDBITS
+#undef __FDELT
+#undef __FDMASK
+/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
+#define __NFDBITS (8 * sizeof (__fd_mask))
+#define __FDELT(d) ((d) / __NFDBITS)
+#define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS))
+
+/* fd_set for select and pselect. */
+typedef struct
+ {
+ /* XPG4.2 requires this member name. Otherwise avoid the name
+ from the global namespace. */
+#ifdef __USE_XOPEN
+ __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS];
+# define __FDS_BITS(set) ((set)->fds_bits)
+#else
+ __fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS];
+# define __FDS_BITS(set) ((set)->__fds_bits)
+#endif
+ } fd_set;
+
+/* Maximum number of file descriptors in `fd_set'. */
+#define FD_SETSIZE __FD_SETSIZE
+
+#ifdef __USE_MISC
+/* Sometimes the fd_set member is assumed to have this type. */
+typedef __fd_mask fd_mask;
+
+/* Number of bits per word of `fd_set' (some code assumes this is 32). */
+# define NFDBITS __NFDBITS
+#endif
+
+
+/* Access macros for `fd_set'. */
+#define FD_SET(fd, fdsetp) __FD_SET (fd, fdsetp)
+#define FD_CLR(fd, fdsetp) __FD_CLR (fd, fdsetp)
+#define FD_ISSET(fd, fdsetp) __FD_ISSET (fd, fdsetp)
+#define FD_ZERO(fdsetp) __FD_ZERO (fdsetp)
+
+
+__BEGIN_DECLS
+
+/* Check the first NFDS descriptors each in READFDS (if not NULL) for read
+ readiness, in WRITEFDS (if not NULL) for write readiness, and in EXCEPTFDS
+ (if not NULL) for exceptional conditions. If TIMEOUT is not NULL, time out
+ after waiting the interval specified therein. Returns the number of ready
+ descriptors, or -1 for errors.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int select (int __nfds, fd_set *__restrict __readfds,
+ fd_set *__restrict __writefds,
+ fd_set *__restrict __exceptfds,
+ struct timeval *__restrict __timeout);
+
+#ifdef __USE_XOPEN2K
+/* Same as above only that the TIMEOUT value is given with higher
+ resolution and a sigmask which is been set temporarily. This version
+ should be used.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int pselect (int __nfds, fd_set *__restrict __readfds,
+ fd_set *__restrict __writefds,
+ fd_set *__restrict __exceptfds,
+ const struct timespec *__restrict __timeout,
+ const __sigset_t *__restrict __sigmask);
+#endif
+
+__END_DECLS
+
+#endif /* sys/select.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sem.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sem.h
new file mode 100644
index 0000000..5b1d38f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sem.h
@@ -0,0 +1,58 @@
+/* Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SEM_H
+#define _SYS_SEM_H 1
+
+#include <features.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+/* Get common definition of System V style IPC. */
+#include <sys/ipc.h>
+
+/* Get system dependent definition of `struct semid_ds' and more. */
+#include <bits/sem.h>
+
+/* The following System V style IPC functions implement a semaphore
+ handling. The definition is found in XPG2. */
+
+/* Structure used for argument to `semop' to describe operations. */
+struct sembuf
+{
+ unsigned short int sem_num; /* semaphore number */
+ short int sem_op; /* semaphore operation */
+ short int sem_flg; /* operation flag */
+};
+
+
+__BEGIN_DECLS
+
+/* Semaphore control operation. */
+extern int semctl (int __semid, int __semnum, int __cmd, ...) __THROW;
+
+/* Get semaphore. */
+extern int semget (key_t __key, int __nsems, int __semflg) __THROW;
+
+/* Operate on semaphore. */
+extern int semop (int __semid, struct sembuf *__sops, size_t __nsops) __THROW;
+
+__END_DECLS
+
+#endif /* sys/sem.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sendfile.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sendfile.h
new file mode 100644
index 0000000..4c1367b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sendfile.h
@@ -0,0 +1,52 @@
+/* sendfile -- copy data directly from one file descriptor to another
+ Copyright (C) 1998,99,01,2002,2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SENDFILE_H
+#define _SYS_SENDFILE_H 1
+
+#include <features.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+/* Send up to COUNT bytes from file associated with IN_FD starting at
+ *OFFSET to descriptor OUT_FD. Set *OFFSET to the IN_FD's file position
+ following the read bytes. If OFFSET is a null pointer, use the normal
+ file position instead. Return the number of written bytes, or -1 in
+ case of error. */
+#ifndef __USE_FILE_OFFSET64
+extern ssize_t sendfile (int __out_fd, int __in_fd, off_t *__offset,
+ size_t __count) __THROW;
+#else
+# ifdef __REDIRECT_NTH
+extern ssize_t __REDIRECT_NTH (sendfile,
+ (int __out_fd, int __in_fd, __off64_t *__offset,
+ size_t __count), sendfile64);
+# else
+# define sendfile sendfile64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern ssize_t sendfile64 (int __out_fd, int __in_fd, __off64_t *__offset,
+ size_t __count) __THROW;
+#endif
+
+__END_DECLS
+
+#endif /* sys/sendfile.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/shm.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/shm.h
new file mode 100644
index 0000000..8ec30b4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/shm.h
@@ -0,0 +1,64 @@
+/* Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SHM_H
+#define _SYS_SHM_H 1
+
+#include <features.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+/* Get common definition of System V style IPC. */
+#include <sys/ipc.h>
+
+/* Get system dependent definition of `struct shmid_ds' and more. */
+#include <bits/shm.h>
+
+/* Define types required by the standard. */
+#define __need_time_t
+#include <time.h>
+
+#ifdef __USE_XOPEN
+# ifndef __pid_t_defined
+typedef __pid_t pid_t;
+# define __pid_t_defined
+# endif
+#endif /* X/Open */
+
+__BEGIN_DECLS
+
+/* The following System V style IPC functions implement a shared memory
+ facility. The definition is found in XPG4.2. */
+
+/* Shared memory control operation. */
+extern int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf) __THROW;
+
+/* Get shared memory segment. */
+extern int shmget (key_t __key, size_t __size, int __shmflg) __THROW;
+
+/* Attach shared memory segment. */
+extern void *shmat (int __shmid, __const void *__shmaddr, int __shmflg)
+ __THROW;
+
+/* Detach shared memory segment. */
+extern int shmdt (__const void *__shmaddr) __THROW;
+
+__END_DECLS
+
+#endif /* sys/shm.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/signal.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/signal.h
new file mode 100644
index 0000000..2e602da
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/signal.h
@@ -0,0 +1 @@
+#include <signal.h>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/socket.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/socket.h
new file mode 100644
index 0000000..4ae1ea9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/socket.h
@@ -0,0 +1,236 @@
+/* Declarations of socket constants, types, and functions.
+ Copyright (C) 1991,92,1994-2001,2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SOCKET_H
+#define _SYS_SOCKET_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <sys/uio.h>
+#define __need_size_t
+#include <stddef.h>
+
+
+/* This operating system-specific header file defines the SOCK_*, PF_*,
+ AF_*, MSG_*, SOL_*, and SO_* constants, and the `struct sockaddr',
+ `struct msghdr', and `struct linger' types. */
+#include <bits/socket.h>
+
+#ifdef __USE_BSD
+/* This is the 4.3 BSD `struct sockaddr' format, which is used as wire
+ format in the grotty old 4.3 `talk' protocol. */
+struct osockaddr
+ {
+ unsigned short int sa_family;
+ unsigned char sa_data[14];
+ };
+#endif
+
+/* The following constants should be used for the second parameter of
+ `shutdown'. */
+enum
+{
+ SHUT_RD = 0, /* No more receptions. */
+#define SHUT_RD SHUT_RD
+ SHUT_WR, /* No more transmissions. */
+#define SHUT_WR SHUT_WR
+ SHUT_RDWR /* No more receptions or transmissions. */
+#define SHUT_RDWR SHUT_RDWR
+};
+
+/* This is the type we use for generic socket address arguments.
+
+ With GCC 2.7 and later, the funky union causes redeclarations or
+ uses with any of the listed types to be allowed without complaint.
+ G++ 2.7 does not support transparent unions so there we want the
+ old-style declaration, too. */
+#if defined __cplusplus || !__GNUC_PREREQ (2, 7) || !defined __USE_GNU
+# define __SOCKADDR_ARG struct sockaddr *__restrict
+# define __CONST_SOCKADDR_ARG __const struct sockaddr *
+#else
+/* Add more `struct sockaddr_AF' types here as necessary.
+ These are all the ones I found on NetBSD and Linux. */
+# define __SOCKADDR_ALLTYPES \
+ __SOCKADDR_ONETYPE (sockaddr) \
+ __SOCKADDR_ONETYPE (sockaddr_at) \
+ __SOCKADDR_ONETYPE (sockaddr_ax25) \
+ __SOCKADDR_ONETYPE (sockaddr_dl) \
+ __SOCKADDR_ONETYPE (sockaddr_eon) \
+ __SOCKADDR_ONETYPE (sockaddr_in) \
+ __SOCKADDR_ONETYPE (sockaddr_in6) \
+ __SOCKADDR_ONETYPE (sockaddr_inarp) \
+ __SOCKADDR_ONETYPE (sockaddr_ipx) \
+ __SOCKADDR_ONETYPE (sockaddr_iso) \
+ __SOCKADDR_ONETYPE (sockaddr_ns) \
+ __SOCKADDR_ONETYPE (sockaddr_un) \
+ __SOCKADDR_ONETYPE (sockaddr_x25)
+
+# define __SOCKADDR_ONETYPE(type) struct type *__restrict __##type##__;
+typedef union { __SOCKADDR_ALLTYPES
+ } __SOCKADDR_ARG __attribute__ ((__transparent_union__));
+# undef __SOCKADDR_ONETYPE
+# define __SOCKADDR_ONETYPE(type) __const struct type *__restrict __##type##__;
+typedef union { __SOCKADDR_ALLTYPES
+ } __CONST_SOCKADDR_ARG __attribute__ ((__transparent_union__));
+# undef __SOCKADDR_ONETYPE
+#endif
+
+
+/* Create a new socket of type TYPE in domain DOMAIN, using
+ protocol PROTOCOL. If PROTOCOL is zero, one is chosen automatically.
+ Returns a file descriptor for the new socket, or -1 for errors. */
+extern int socket (int __domain, int __type, int __protocol) __THROW;
+
+/* Create two new sockets, of type TYPE in domain DOMAIN and using
+ protocol PROTOCOL, which are connected to each other, and put file
+ descriptors for them in FDS[0] and FDS[1]. If PROTOCOL is zero,
+ one will be chosen automatically. Returns 0 on success, -1 for errors. */
+extern int socketpair (int __domain, int __type, int __protocol,
+ int __fds[2]) __THROW;
+
+/* Give the socket FD the local address ADDR (which is LEN bytes long). */
+extern int bind (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len)
+ __THROW;
+
+/* Put the local address of FD into *ADDR and its length in *LEN. */
+extern int getsockname (int __fd, __SOCKADDR_ARG __addr,
+ socklen_t *__restrict __len) __THROW;
+
+/* Open a connection on socket FD to peer at ADDR (which LEN bytes long).
+ For connectionless socket types, just set the default address to send to
+ and the only address from which to accept transmissions.
+ Return 0 on success, -1 for errors.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int connect (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len);
+
+/* Put the address of the peer connected to socket FD into *ADDR
+ (which is *LEN bytes long), and its actual length into *LEN. */
+extern int getpeername (int __fd, __SOCKADDR_ARG __addr,
+ socklen_t *__restrict __len) __THROW;
+
+
+/* Send N bytes of BUF to socket FD. Returns the number sent or -1.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t send (int __fd, __const void *__buf, size_t __n, int __flags);
+
+/* Read N bytes into BUF from socket FD.
+ Returns the number read or -1 for errors.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t recv (int __fd, void *__buf, size_t __n, int __flags);
+
+/* Send N bytes of BUF on socket FD to peer at address ADDR (which is
+ ADDR_LEN bytes long). Returns the number sent, or -1 for errors.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t sendto (int __fd, __const void *__buf, size_t __n,
+ int __flags, __CONST_SOCKADDR_ARG __addr,
+ socklen_t __addr_len);
+
+/* Read N bytes into BUF through socket FD.
+ If ADDR is not NULL, fill in *ADDR_LEN bytes of it with tha address of
+ the sender, and store the actual size of the address in *ADDR_LEN.
+ Returns the number of bytes read or -1 for errors.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n,
+ int __flags, __SOCKADDR_ARG __addr,
+ socklen_t *__restrict __addr_len);
+
+
+/* Send a message described MESSAGE on socket FD.
+ Returns the number of bytes sent, or -1 for errors.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t sendmsg (int __fd, __const struct msghdr *__message,
+ int __flags);
+
+/* Receive a message as described by MESSAGE from socket FD.
+ Returns the number of bytes read or -1 for errors.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags);
+
+
+/* Put the current value for socket FD's option OPTNAME at protocol level LEVEL
+ into OPTVAL (which is *OPTLEN bytes long), and set *OPTLEN to the value's
+ actual length. Returns 0 on success, -1 for errors. */
+extern int getsockopt (int __fd, int __level, int __optname,
+ void *__restrict __optval,
+ socklen_t *__restrict __optlen) __THROW;
+
+/* Set socket FD's option OPTNAME at protocol level LEVEL
+ to *OPTVAL (which is OPTLEN bytes long).
+ Returns 0 on success, -1 for errors. */
+extern int setsockopt (int __fd, int __level, int __optname,
+ __const void *__optval, socklen_t __optlen) __THROW;
+
+
+/* Prepare to accept connections on socket FD.
+ N connection requests will be queued before further requests are refused.
+ Returns 0 on success, -1 for errors. */
+extern int listen (int __fd, int __n) __THROW;
+
+/* Await a connection on socket FD.
+ When a connection arrives, open a new socket to communicate with it,
+ set *ADDR (which is *ADDR_LEN bytes long) to the address of the connecting
+ peer and *ADDR_LEN to the address's actual length, and return the
+ new socket's descriptor, or -1 for errors.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int accept (int __fd, __SOCKADDR_ARG __addr,
+ socklen_t *__restrict __addr_len);
+
+/* Shut down all or part of the connection open on socket FD.
+ HOW determines what to shut down:
+ SHUT_RD = No more receptions;
+ SHUT_WR = No more transmissions;
+ SHUT_RDWR = No more receptions or transmissions.
+ Returns 0 on success, -1 for errors. */
+extern int shutdown (int __fd, int __how) __THROW;
+
+
+#ifdef __USE_XOPEN2K
+/* Determine wheter socket is at a out-of-band mark. */
+extern int sockatmark (int __fd) __THROW;
+#endif
+
+
+#ifdef __USE_MISC
+/* FDTYPE is S_IFSOCK or another S_IF* macro defined in <sys/stat.h>;
+ returns 1 if FD is open on an object of the indicated type, 0 if not,
+ or -1 for errors (setting errno). */
+extern int isfdtype (int __fd, int __fdtype) __THROW;
+#endif
+
+__END_DECLS
+
+#endif /* sys/socket.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/socketvar.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/socketvar.h
new file mode 100644
index 0000000..b177158
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/socketvar.h
@@ -0,0 +1,3 @@
+/* This header is used on many systems but for GNU we have everything
+ already defined in the standard header. */
+#include <sys/socket.h>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/soundcard.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/soundcard.h
new file mode 100644
index 0000000..fade986
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/soundcard.h
@@ -0,0 +1 @@
+#include <linux/soundcard.h>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/stat.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/stat.h
new file mode 100644
index 0000000..5082390
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/stat.h
@@ -0,0 +1,366 @@
+/* Copyright (C) 1991,1992,1995-2004,2005,2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 5.6 File Characteristics <sys/stat.h>
+ */
+
+#ifndef _SYS_STAT_H
+#define _SYS_STAT_H 1
+
+#include <features.h>
+
+#include <bits/types.h> /* For __mode_t and __dev_t. */
+
+#if defined __USE_XOPEN || defined __USE_MISC
+# if defined __USE_XOPEN || defined __USE_XOPEN2K
+# define __need_time_t
+# endif
+# ifdef __USE_MISC
+# define __need_timespec
+# endif
+# include <time.h> /* For time_t resp. timespec. */
+#endif
+
+#if defined __USE_XOPEN || defined __USE_XOPEN2K
+/* The Single Unix specification says that some more types are
+ available here. */
+# ifndef __dev_t_defined
+typedef __dev_t dev_t;
+# define __dev_t_defined
+# endif
+
+# ifndef __gid_t_defined
+typedef __gid_t gid_t;
+# define __gid_t_defined
+# endif
+
+# ifndef __ino_t_defined
+# ifndef __USE_FILE_OFFSET64
+typedef __ino_t ino_t;
+# else
+typedef __ino64_t ino_t;
+# endif
+# define __ino_t_defined
+# endif
+
+# ifndef __mode_t_defined
+typedef __mode_t mode_t;
+# define __mode_t_defined
+# endif
+
+# ifndef __nlink_t_defined
+typedef __nlink_t nlink_t;
+# define __nlink_t_defined
+# endif
+
+# ifndef __off_t_defined
+# ifndef __USE_FILE_OFFSET64
+typedef __off_t off_t;
+# else
+typedef __off64_t off_t;
+# endif
+# define __off_t_defined
+# endif
+
+# ifndef __uid_t_defined
+typedef __uid_t uid_t;
+# define __uid_t_defined
+# endif
+#endif /* X/Open */
+
+#ifdef __USE_UNIX98
+# ifndef __blkcnt_t_defined
+# ifndef __USE_FILE_OFFSET64
+typedef __blkcnt_t blkcnt_t;
+# else
+typedef __blkcnt64_t blkcnt_t;
+# endif
+# define __blkcnt_t_defined
+# endif
+
+# ifndef __blksize_t_defined
+typedef __blksize_t blksize_t;
+# define __blksize_t_defined
+# endif
+#endif /* Unix98 */
+
+__BEGIN_DECLS
+
+#include <bits/stat.h>
+
+#if defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN
+# define S_IFMT __S_IFMT
+# define S_IFDIR __S_IFDIR
+# define S_IFCHR __S_IFCHR
+# define S_IFBLK __S_IFBLK
+# define S_IFREG __S_IFREG
+# ifdef __S_IFIFO
+# define S_IFIFO __S_IFIFO
+# endif
+# ifdef __S_IFLNK
+# define S_IFLNK __S_IFLNK
+# endif
+# if (defined __USE_BSD || defined __USE_MISC || defined __USE_UNIX98) \
+ && defined __S_IFSOCK
+# define S_IFSOCK __S_IFSOCK
+# endif
+#endif
+
+/* Test macros for file types. */
+
+#define __S_ISTYPE(mode, mask) (((mode) & __S_IFMT) == (mask))
+
+#define S_ISDIR(mode) __S_ISTYPE((mode), __S_IFDIR)
+#define S_ISCHR(mode) __S_ISTYPE((mode), __S_IFCHR)
+#define S_ISBLK(mode) __S_ISTYPE((mode), __S_IFBLK)
+#define S_ISREG(mode) __S_ISTYPE((mode), __S_IFREG)
+#ifdef __S_IFIFO
+# define S_ISFIFO(mode) __S_ISTYPE((mode), __S_IFIFO)
+#endif
+#ifdef __S_IFLNK
+# define S_ISLNK(mode) __S_ISTYPE((mode), __S_IFLNK)
+#endif
+
+#if defined __USE_BSD && !defined __S_IFLNK
+# define S_ISLNK(mode) 0
+#endif
+
+#if (defined __USE_BSD || defined __USE_UNIX98) \
+ && defined __S_IFSOCK
+# define S_ISSOCK(mode) __S_ISTYPE((mode), __S_IFSOCK)
+#endif
+
+/* These are from POSIX.1b. If the objects are not implemented using separate
+ distinct file types, the macros always will evaluate to zero. Unlike the
+ other S_* macros the following three take a pointer to a `struct stat'
+ object as the argument. */
+#ifdef __USE_POSIX199309
+# define S_TYPEISMQ(buf) __S_TYPEISMQ(buf)
+# define S_TYPEISSEM(buf) __S_TYPEISSEM(buf)
+# define S_TYPEISSHM(buf) __S_TYPEISSHM(buf)
+#endif
+
+
+/* Protection bits. */
+
+#define S_ISUID __S_ISUID /* Set user ID on execution. */
+#define S_ISGID __S_ISGID /* Set group ID on execution. */
+
+#if defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN
+/* Save swapped text after use (sticky bit). This is pretty well obsolete. */
+# define S_ISVTX __S_ISVTX
+#endif
+
+#define S_IRUSR __S_IREAD /* Read by owner. */
+#define S_IWUSR __S_IWRITE /* Write by owner. */
+#define S_IXUSR __S_IEXEC /* Execute by owner. */
+/* Read, write, and execute by owner. */
+#define S_IRWXU (__S_IREAD|__S_IWRITE|__S_IEXEC)
+
+#if defined __USE_MISC && defined __USE_BSD
+# define S_IREAD S_IRUSR
+# define S_IWRITE S_IWUSR
+# define S_IEXEC S_IXUSR
+#endif
+
+#define S_IRGRP (S_IRUSR >> 3) /* Read by group. */
+#define S_IWGRP (S_IWUSR >> 3) /* Write by group. */
+#define S_IXGRP (S_IXUSR >> 3) /* Execute by group. */
+/* Read, write, and execute by group. */
+#define S_IRWXG (S_IRWXU >> 3)
+
+#define S_IROTH (S_IRGRP >> 3) /* Read by others. */
+#define S_IWOTH (S_IWGRP >> 3) /* Write by others. */
+#define S_IXOTH (S_IXGRP >> 3) /* Execute by others. */
+/* Read, write, and execute by others. */
+#define S_IRWXO (S_IRWXG >> 3)
+
+
+#ifdef __USE_BSD
+/* Macros for common mode bit masks. */
+# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */
+# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666*/
+
+# define S_BLKSIZE 512 /* Block size for `st_blocks'. */
+#endif
+
+
+#ifndef __USE_FILE_OFFSET64
+/* Get file attributes for FILE and put them in BUF. */
+extern int stat (__const char *__restrict __file,
+ struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
+
+/* Get file attributes for the file, device, pipe, or socket
+ that file descriptor FD is open on and put them in BUF. */
+extern int fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2));
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (stat, (__const char *__restrict __file,
+ struct stat *__restrict __buf), stat64)
+ __nonnull ((1, 2));
+extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64)
+ __nonnull ((2));
+# else
+# define stat stat64
+# define fstat fstat64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int stat64 (__const char *__restrict __file,
+ struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2));
+extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
+#endif
+
+#ifdef __USE_ATFILE
+/* Similar to stat, get the attributes for FILE and put them in BUF.
+ Relative path names are interpreted relative to FD unless FD is
+ AT_FDCWD. */
+# ifndef __USE_FILE_OFFSET64
+extern int fstatat (int __fd, __const char *__restrict __file,
+ struct stat *__restrict __buf, int __flag)
+ __THROW __nonnull ((2, 3));
+# else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (fstatat, (int __fd, __const char *__restrict __file,
+ struct stat *__restrict __buf,
+ int __flag),
+ fstatat64) __nonnull ((2, 3));
+# else
+# define fstatat fstatat64
+# endif
+# endif
+
+extern int fstatat64 (int __fd, __const char *__restrict __file,
+ struct stat64 *__restrict __buf, int __flag)
+ __THROW __nonnull ((2, 3));
+#endif
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+# ifndef __USE_FILE_OFFSET64
+/* Get file attributes about FILE and put them in BUF.
+ If FILE is a symbolic link, do not follow it. */
+extern int lstat (__const char *__restrict __file,
+ struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
+# else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (lstat,
+ (__const char *__restrict __file,
+ struct stat *__restrict __buf), lstat64)
+ __nonnull ((1, 2));
+# else
+# define lstat lstat64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int lstat64 (__const char *__restrict __file,
+ struct stat64 *__restrict __buf)
+ __THROW __nonnull ((1, 2));
+# endif
+#endif
+
+/* Set file access permissions for FILE to MODE.
+ If FILE is a symbolic link, this affects its target instead. */
+extern int chmod (__const char *__file, __mode_t __mode)
+ __THROW __nonnull ((1));
+
+#if 0 /*def __USE_BSD*/
+/* Set file access permissions for FILE to MODE.
+ If FILE is a symbolic link, this affects the link itself
+ rather than its target. */
+extern int lchmod (__const char *__file, __mode_t __mode)
+ __THROW __nonnull ((1));
+#endif
+
+/* Set file access permissions of the file FD is open on to MODE. */
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+extern int fchmod (int __fd, __mode_t __mode) __THROW;
+#endif
+
+#ifdef __USE_ATFILE
+/* Set file access permissions of FILE relative to
+ the directory FD is open on. */
+extern int fchmodat (int __fd, __const char *__file, __mode_t mode, int __flag)
+ __THROW __nonnull ((2)) __wur;
+#endif /* Use ATFILE. */
+
+
+
+/* Set the file creation mask of the current process to MASK,
+ and return the old creation mask. */
+extern __mode_t umask (__mode_t __mask) __THROW;
+
+#if 0 /*def __USE_GNU*/
+/* Get the current `umask' value without changing it.
+ This function is only available under the GNU Hurd. */
+extern __mode_t getumask (void) __THROW;
+#endif
+
+/* Create a new directory named PATH, with permission bits MODE. */
+extern int mkdir (__const char *__path, __mode_t __mode)
+ __THROW __nonnull ((1));
+
+#ifdef __USE_ATFILE
+/* Like mkdir, create a new directory with permission bits MODE. But
+ interpret relative PATH names relative to the directory associated
+ with FD. */
+extern int mkdirat (int __fd, __const char *__path, __mode_t __mode)
+ __THROW __nonnull ((2));
+#endif
+
+/* Create a device file named PATH, with permission and special bits MODE
+ and device number DEV (which can be constructed from major and minor
+ device numbers with the `makedev' macro above). */
+#if defined __USE_MISC || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev)
+ __THROW __nonnull ((1));
+#endif
+
+#ifdef __USE_ATFILE
+/* Like mknod, create a new device file with permission bits MODE and
+ device number DEV. But interpret relative PATH names relative to
+ the directory associated with FD. */
+extern int mknodat (int __fd, __const char *__path, __mode_t __mode,
+ __dev_t __dev) __THROW __nonnull ((2));
+#endif
+
+
+/* Create a new FIFO named PATH, with permission bits MODE. */
+extern int mkfifo (__const char *__path, __mode_t __mode)
+ __THROW __nonnull ((1));
+
+#ifdef __USE_ATFILE
+/* Like mkfifo, create a new FIFO with permission bits MODE. But
+ interpret relative PATH names relative to the directory associated
+ with FD. */
+extern int mkfifoat (int __fd, __const char *__path, __mode_t __mode)
+ __THROW __nonnull ((2));
+#endif
+
+/* on uClibc we have unversioned struct stat and mknod.
+ * bits/stat.h is filled with wrong info, so we undo it here. */
+#undef _STAT_VER
+#define _STAT_VER 0
+#undef _MKNOD_VER
+#define _MKNOD_VER 0
+
+__END_DECLS
+
+
+#endif /* sys/stat.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/statfs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/statfs.h
new file mode 100644
index 0000000..3b2226b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/statfs.h
@@ -0,0 +1,68 @@
+/* Definitions for getting information about a filesystem.
+ Copyright (C) 1996, 1997, 1998, 1999, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_STATFS_H
+#define _SYS_STATFS_H 1
+
+#include <features.h>
+
+/* Get the system-specific definition of `struct statfs'. */
+#include <bits/statfs.h>
+
+__BEGIN_DECLS
+
+/* Return information about the filesystem on which FILE resides. */
+#ifndef __USE_FILE_OFFSET64
+extern int statfs (__const char *__file, struct statfs *__buf)
+ __THROW __nonnull ((1, 2));
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (statfs,
+ (__const char *__file, struct statfs *__buf),
+ statfs64) __nonnull ((1, 2));
+# else
+# define statfs statfs64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int statfs64 (__const char *__file, struct statfs64 *__buf)
+ __THROW __nonnull ((1, 2));
+#endif
+
+/* Return information about the filesystem containing the file FILDES
+ refers to. */
+#ifndef __USE_FILE_OFFSET64
+extern int fstatfs (int __fildes, struct statfs *__buf)
+ __THROW __nonnull ((2));
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (fstatfs, (int __fildes, struct statfs *__buf),
+ fstatfs64) __nonnull ((2));
+# else
+# define fstatfs fstatfs64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int fstatfs64 (int __fildes, struct statfs64 *__buf)
+ __THROW __nonnull ((2));
+#endif
+
+__END_DECLS
+
+#endif /* sys/statfs.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/statvfs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/statvfs.h
new file mode 100644
index 0000000..685dd26
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/statvfs.h
@@ -0,0 +1,91 @@
+/* Definitions for getting information about a filesystem.
+ Copyright (C) 1998, 1999, 2000, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_STATVFS_H
+#define _SYS_STATVFS_H 1
+
+#include <features.h>
+
+/* Get the system-specific definition of `struct statfs'. */
+#include <bits/statvfs.h>
+
+#ifndef __USE_FILE_OFFSET64
+# ifndef __fsblkcnt_t_defined
+typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks. */
+# define __fsblkcnt_t_defined
+# endif
+# ifndef __fsfilcnt_t_defined
+typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes. */
+# define __fsfilcnt_t_defined
+# endif
+#else
+# ifndef __fsblkcnt_t_defined
+typedef __fsblkcnt64_t fsblkcnt_t; /* Type to count file system blocks. */
+# define __fsblkcnt_t_defined
+# endif
+# ifndef __fsfilcnt_t_defined
+typedef __fsfilcnt64_t fsfilcnt_t; /* Type to count file system inodes. */
+# define __fsfilcnt_t_defined
+# endif
+#endif
+
+__BEGIN_DECLS
+
+/* Return information about the filesystem on which FILE resides. */
+#ifndef __USE_FILE_OFFSET64
+extern int statvfs (__const char *__restrict __file,
+ struct statvfs *__restrict __buf)
+ __THROW __nonnull ((1, 2));
+#else
+# ifdef __REDIRECT
+extern int __REDIRECT (statvfs,
+ (__const char *__restrict __file,
+ struct statvfs *__restrict __buf), statvfs64)
+ __nonnull ((1, 2));
+# else
+# define statvfs statvfs64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int statvfs64 (__const char *__restrict __file,
+ struct statvfs64 *__restrict __buf)
+ __THROW __nonnull ((1, 2));
+#endif
+
+/* Return information about the filesystem containing the file FILDES
+ refers to. */
+#ifndef __USE_FILE_OFFSET64
+extern int fstatvfs (int __fildes, struct statvfs *__buf)
+ __THROW __nonnull ((2));
+#else
+# ifdef __REDIRECT
+extern int __REDIRECT (fstatvfs, (int __fildes, struct statvfs *__buf),
+ fstatvfs64) __nonnull ((2));
+# else
+# define fstatvfs fstatvfs64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int fstatvfs64 (int __fildes, struct statvfs64 *__buf)
+ __THROW __nonnull ((2));
+#endif
+
+__END_DECLS
+
+#endif /* sys/statvfs.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/swap.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/swap.h
new file mode 100644
index 0000000..b6e7bef
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/swap.h
@@ -0,0 +1,43 @@
+/* Calls to enable and disable swapping on specified locations. Linux version.
+ Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SWAP_H
+
+#define _SYS_SWAP_H 1
+#include <features.h>
+
+/* The swap priority is encoded as:
+ (prio << SWAP_FLAG_PRIO_SHIFT) & SWAP_FLAG_PRIO_MASK
+*/
+#define SWAP_FLAG_PREFER 0x8000 /* Set if swap priority is specified. */
+#define SWAP_FLAG_PRIO_MASK 0x7fff
+#define SWAP_FLAG_PRIO_SHIFT 0
+
+__BEGIN_DECLS
+
+/* Make the block special device PATH available to the system for swapping.
+ This call is restricted to the super-user. */
+extern int swapon (__const char *__path, int __flags) __THROW;
+
+/* Stop using block special device PATH for swapping. */
+extern int swapoff (__const char *__path) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_SWAP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/syscall.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/syscall.h
new file mode 100644
index 0000000..4c8ede8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/syscall.h
@@ -0,0 +1,37 @@
+/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYSCALL_H
+#define _SYSCALL_H 1
+
+/* The _syscall#() macros are for uClibc internal use only.
+ * User application code should use syscall() instead.
+ *
+ * The kernel provided _syscall[0-6] macros from asm/unistd.h are not suitable
+ * for use in uClibc as they lack PIC support etc, so for uClibc we use our own
+ * local _syscall# macros to be certain all such variations are handled
+ * properly.
+ */
+
+#include <features.h>
+#include <bits/sysnum.h>
+#if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc)
+# include <bits/syscalls.h>
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sysctl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sysctl.h
new file mode 100644
index 0000000..110efaa
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sysctl.h
@@ -0,0 +1,72 @@
+/* Copyright (C) 1996, 1999, 2002, 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SYSCTL_H
+#define _SYS_SYSCTL_H 1
+
+#include <features.h>
+#define __need_size_t
+#include <stddef.h>
+/* Prevent more kernel headers than necessary to be included. */
+#ifndef _LINUX_KERNEL_H
+# define _LINUX_KERNEL_H 1
+# define __undef_LINUX_KERNEL_H
+#endif
+#ifndef _LINUX_TYPES_H
+# define _LINUX_TYPES_H 1
+# define __undef_LINUX_TYPES_H
+#endif
+#ifndef _LINUX_LIST_H
+# define _LINUX_LIST_H 1
+# define __undef_LINUX_LIST_H
+#endif
+#ifndef __LINUX_COMPILER_H
+# define __LINUX_COMPILER_H 1
+# define __user
+# define __undef__LINUX_COMPILER_H
+#endif
+
+#include <linux/sysctl.h>
+
+#ifdef __undef_LINUX_KERNEL_H
+# undef _LINUX_KERNEL_H
+# undef __undef_LINUX_KERNEL_H
+#endif
+#ifdef __undef_LINUX_TYPES_H
+# undef _LINUX_TYPES_H
+# undef __undef_LINUX_TYPES_H
+#endif
+#ifdef __undef_LINUX_LIST_H
+# undef _LINUX_LIST_H
+# undef __undef_LINUX_LIST_H
+#endif
+#ifdef __undef__LINUX_COMPILER_H
+# undef __LINUX_COMPILER_H
+# undef __user
+# undef __undef__LINUX_COMPILER_H
+#endif
+
+__BEGIN_DECLS
+
+/* Read or write system parameters. */
+extern int sysctl (int *__name, int __nlen, void *__oldval,
+ size_t *__oldlenp, void *__newval, size_t __newlen) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_SYSCTL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sysinfo.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sysinfo.h
new file mode 100644
index 0000000..9fd4fa8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sysinfo.h
@@ -0,0 +1,67 @@
+/* Copyright (C) 1996, 1999, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SYSINFO_H
+#define _SYS_SYSINFO_H 1
+
+#include <features.h>
+
+#ifndef _LINUX_KERNEL_H
+/* Include our own copy of struct sysinfo to avoid binary compatability
+ * problems with Linux 2.4, which changed things. Grumble, grumble. */
+#define SI_LOAD_SHIFT 16
+struct sysinfo {
+ long uptime; /* Seconds since boot */
+ unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
+ unsigned long totalram; /* Total usable main memory size */
+ unsigned long freeram; /* Available memory size */
+ unsigned long sharedram; /* Amount of shared memory */
+ unsigned long bufferram; /* Memory used by buffers */
+ unsigned long totalswap; /* Total swap space size */
+ unsigned long freeswap; /* swap space still available */
+ unsigned short procs; /* Number of current processes */
+ unsigned short pad; /* Padding needed for m68k */
+ unsigned long totalhigh; /* Total high memory size */
+ unsigned long freehigh; /* Available high memory size */
+ unsigned int mem_unit; /* Memory unit size in bytes */
+ char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */
+};
+#endif
+
+__BEGIN_DECLS
+
+/* Returns information on overall system statistics. */
+extern int sysinfo (struct sysinfo *__info) __THROW;
+
+
+/* Return number of configured processors. */
+extern int get_nprocs_conf (void) __THROW;
+
+/* Return number of available processors. */
+extern int get_nprocs (void) __THROW;
+
+
+/* Return number of physical pages of memory in the system. */
+extern long int get_phys_pages (void) __THROW;
+
+/* Return number of available physical pages of memory in the system. */
+extern long int get_avphys_pages (void) __THROW;
+
+__END_DECLS
+
+#endif /* sys/sysinfo.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/syslog.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/syslog.h
new file mode 100644
index 0000000..cbbc31e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/syslog.h
@@ -0,0 +1,206 @@
+/*
+ * Copyright (c) 1982, 1986, 1988, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)syslog.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _SYS_SYSLOG_H
+#define _SYS_SYSLOG_H 1
+
+#include <features.h>
+#define __need___va_list
+#include <stdarg.h>
+
+
+#define _PATH_LOG "/dev/log"
+
+/*
+ * priorities/facilities are encoded into a single 32-bit quantity, where the
+ * bottom 3 bits are the priority (0-7) and the top 28 bits are the facility
+ * (0-big number). Both the priorities and the facilities map roughly
+ * one-to-one to strings in the syslogd(8) source code. This mapping is
+ * included in this file.
+ *
+ * priorities (these are ordered)
+ */
+#define LOG_EMERG 0 /* system is unusable */
+#define LOG_ALERT 1 /* action must be taken immediately */
+#define LOG_CRIT 2 /* critical conditions */
+#define LOG_ERR 3 /* error conditions */
+#define LOG_WARNING 4 /* warning conditions */
+#define LOG_NOTICE 5 /* normal but significant condition */
+#define LOG_INFO 6 /* informational */
+#define LOG_DEBUG 7 /* debug-level messages */
+
+#define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */
+ /* extract priority */
+#define LOG_PRI(p) ((p) & LOG_PRIMASK)
+#define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
+
+#ifdef SYSLOG_NAMES
+#define INTERNAL_NOPRI 0x10 /* the "no priority" priority */
+ /* mark "facility" */
+#define INTERNAL_MARK LOG_MAKEPRI(LOG_NFACILITIES, 0)
+typedef struct _code {
+ char *c_name;
+ int c_val;
+} CODE;
+
+CODE prioritynames[] =
+ {
+ { "alert", LOG_ALERT },
+ { "crit", LOG_CRIT },
+ { "debug", LOG_DEBUG },
+ { "emerg", LOG_EMERG },
+ { "err", LOG_ERR },
+ { "error", LOG_ERR }, /* DEPRECATED */
+ { "info", LOG_INFO },
+ { "none", INTERNAL_NOPRI }, /* INTERNAL */
+ { "notice", LOG_NOTICE },
+ { "panic", LOG_EMERG }, /* DEPRECATED */
+ { "warn", LOG_WARNING }, /* DEPRECATED */
+ { "warning", LOG_WARNING },
+ { NULL, -1 }
+ };
+#endif
+
+/* facility codes */
+#define LOG_KERN (0<<3) /* kernel messages */
+#define LOG_USER (1<<3) /* random user-level messages */
+#define LOG_MAIL (2<<3) /* mail system */
+#define LOG_DAEMON (3<<3) /* system daemons */
+#define LOG_AUTH (4<<3) /* security/authorization messages */
+#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
+#define LOG_LPR (6<<3) /* line printer subsystem */
+#define LOG_NEWS (7<<3) /* network news subsystem */
+#define LOG_UUCP (8<<3) /* UUCP subsystem */
+#define LOG_CRON (9<<3) /* clock daemon */
+#define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */
+#define LOG_FTP (11<<3) /* ftp daemon */
+
+ /* other codes through 15 reserved for system use */
+#define LOG_LOCAL0 (16<<3) /* reserved for local use */
+#define LOG_LOCAL1 (17<<3) /* reserved for local use */
+#define LOG_LOCAL2 (18<<3) /* reserved for local use */
+#define LOG_LOCAL3 (19<<3) /* reserved for local use */
+#define LOG_LOCAL4 (20<<3) /* reserved for local use */
+#define LOG_LOCAL5 (21<<3) /* reserved for local use */
+#define LOG_LOCAL6 (22<<3) /* reserved for local use */
+#define LOG_LOCAL7 (23<<3) /* reserved for local use */
+
+#define LOG_NFACILITIES 24 /* current number of facilities */
+#define LOG_FACMASK 0x03f8 /* mask to extract facility part */
+ /* facility of pri */
+#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
+
+#ifdef SYSLOG_NAMES
+CODE facilitynames[] =
+ {
+ { "auth", LOG_AUTH },
+ { "authpriv", LOG_AUTHPRIV },
+ { "cron", LOG_CRON },
+ { "daemon", LOG_DAEMON },
+ { "ftp", LOG_FTP },
+ { "kern", LOG_KERN },
+ { "lpr", LOG_LPR },
+ { "mail", LOG_MAIL },
+ { "mark", INTERNAL_MARK }, /* INTERNAL */
+ { "news", LOG_NEWS },
+ { "security", LOG_AUTH }, /* DEPRECATED */
+ { "syslog", LOG_SYSLOG },
+ { "user", LOG_USER },
+ { "uucp", LOG_UUCP },
+ { "local0", LOG_LOCAL0 },
+ { "local1", LOG_LOCAL1 },
+ { "local2", LOG_LOCAL2 },
+ { "local3", LOG_LOCAL3 },
+ { "local4", LOG_LOCAL4 },
+ { "local5", LOG_LOCAL5 },
+ { "local6", LOG_LOCAL6 },
+ { "local7", LOG_LOCAL7 },
+ { NULL, -1 }
+ };
+#endif
+
+/*
+ * arguments to setlogmask.
+ */
+#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */
+#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
+
+/*
+ * Option flags for openlog.
+ *
+ * LOG_ODELAY no longer does anything.
+ * LOG_NDELAY is the inverse of what it used to be.
+ */
+#define LOG_PID 0x01 /* log the pid with each message */
+#define LOG_CONS 0x02 /* log on the console if errors in sending */
+#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
+#define LOG_NDELAY 0x08 /* don't delay open */
+#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
+#define LOG_PERROR 0x20 /* log to stderr as well */
+
+__BEGIN_DECLS
+
+/* Close descriptor used to write to system logger.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void closelog (void);
+
+/* Open connection to system logger.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void openlog (__const char *__ident, int __option, int __facility);
+
+/* Set the log mask level. */
+extern int setlogmask (int __mask) __THROW;
+
+/* Generate a log message using FMT string and option arguments.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern void syslog (int __pri, __const char *__fmt, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+
+#ifdef __USE_BSD
+/* Generate a log message using FMT and using arguments pointed to by AP.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern void vsyslog (int __pri, __const char *__fmt, __gnuc_va_list __ap)
+ __attribute__ ((__format__ (__printf__, 2, 0)));
+#endif
+
+__END_DECLS
+
+#endif /* sys/syslog.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sysmacros.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sysmacros.h
new file mode 100644
index 0000000..c5efca4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sysmacros.h
@@ -0,0 +1,69 @@
+/* Definitions of macros to access `dev_t' values.
+ Copyright (C) 1996, 1997, 1999, 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SYSMACROS_H
+#define _SYS_SYSMACROS_H 1
+
+#include <features.h>
+
+/* If the compiler does not know long long it is out of luck. We are
+ not going to hack weird hacks to support the dev_t representation
+ they need. */
+#if 1 /*def __GLIBC_HAVE_LONG_LONG uClibc note: always enable */
+__extension__
+static __inline unsigned int gnu_dev_major (unsigned long long int __dev)
+ __THROW;
+__extension__
+static __inline unsigned int gnu_dev_minor (unsigned long long int __dev)
+ __THROW;
+__extension__
+static __inline unsigned long long int gnu_dev_makedev (unsigned int __major,
+ unsigned int __minor)
+ __THROW;
+
+# if defined __GNUC__ && __GNUC__ >= 2
+__extension__ static __inline unsigned int
+__NTH (gnu_dev_major (unsigned long long int __dev))
+{
+ return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
+}
+
+__extension__ static __inline unsigned int
+__NTH (gnu_dev_minor (unsigned long long int __dev))
+{
+ return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
+}
+
+__extension__ static __inline unsigned long long int
+__NTH (gnu_dev_makedev (unsigned int __major, unsigned int __minor))
+{
+ return ((__minor & 0xff) | ((__major & 0xfff) << 8)
+ | (((unsigned long long int) (__minor & ~0xff)) << 12)
+ | (((unsigned long long int) (__major & ~0xfff)) << 32));
+}
+# endif
+
+
+/* Access the functions with their traditional names. */
+# define major(dev) gnu_dev_major (dev)
+# define minor(dev) gnu_dev_minor (dev)
+# define makedev(maj, min) gnu_dev_makedev (maj, min)
+#endif
+
+#endif /* sys/sysmacros.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sysmips.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sysmips.h
new file mode 100644
index 0000000..6a63dc2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/sysmips.h
@@ -0,0 +1,44 @@
+/* Copyright (C) 1991, 92, 94, 95, 96, 97, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SYSMIPS_H
+#define _SYS_SYSMIPS_H 1
+
+#include <features.h>
+
+/*
+ * Commands for the sysmips(2) call
+ *
+ * sysmips(2) is deprecated - though some existing software uses it.
+ * We only support the following commands. Sysmips exists for compatibility
+ * purposes only so new software should avoid it.
+ */
+#define SETNAME 1 /* set hostname */
+#define FLUSH_CACHE 3 /* writeback and invalidate caches */
+#define MIPS_FIXADE 7 /* control address error fixing */
+#define MIPS_RDNVRAM 10 /* read NVRAM */
+#define MIPS_ATOMIC_SET 2001 /* atomically set variable */
+
+__BEGIN_DECLS
+
+extern int sysmips (__const int cmd, __const long arg1,
+ __const int arg2, __const int arg3) __THROW;
+
+__END_DECLS
+
+#endif /* sys/sysmips.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/tas.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/tas.h
new file mode 100644
index 0000000..1183b86
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/tas.h
@@ -0,0 +1,67 @@
+/* Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Maciej W. Rozycki <macro@ds2.pg.gda.pl>, 2000.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_TAS_H
+#define _SYS_TAS_H 1
+
+#include <features.h>
+#include <sgidefs.h>
+
+__BEGIN_DECLS
+
+extern int _test_and_set (int *p, int v) __THROW;
+
+#ifdef __USE_EXTERN_INLINES
+
+# ifndef _EXTERN_INLINE
+# define _EXTERN_INLINE extern __inline
+# endif
+
+_EXTERN_INLINE int
+__NTH (_test_and_set (int *p, int v))
+{
+ int r, t;
+
+ __asm__ __volatile__
+ ("/* Inline test and set */\n"
+ "1:\n\t"
+ ".set push\n\t"
+#if _MIPS_SIM == _ABIO32
+ ".set mips2\n\t"
+#endif
+ "ll %0,%3\n\t"
+ "move %1,%4\n\t"
+ "beq %0,%4,2f\n\t"
+ "sc %1,%2\n\t"
+ ".set pop\n\t"
+ "beqz %1,1b\n"
+ "2:\n\t"
+ "/* End test and set */"
+ : "=&r" (r), "=&r" (t), "=m" (*p)
+ : "m" (*p), "r" (v)
+ : "memory");
+
+ return r;
+}
+
+#endif /* __USE_EXTERN_INLINES */
+
+__END_DECLS
+
+#endif /* sys/tas.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/termios.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/termios.h
new file mode 100644
index 0000000..3e18805
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/termios.h
@@ -0,0 +1,4 @@
+#ifndef _SYS_TERMIOS_H
+#define _SYS_TERMIOS_H
+#include <termios.h>
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/time.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/time.h
new file mode 100644
index 0000000..66fb9e0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/time.h
@@ -0,0 +1,192 @@
+/* Copyright (C) 1991-1994,1996-2002,2003,2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_TIME_H
+#define _SYS_TIME_H 1
+
+#include <features.h>
+
+#include <bits/types.h>
+#define __need_time_t
+#include <time.h>
+#define __need_timeval
+#include <bits/time.h>
+
+#include <sys/select.h>
+
+#ifndef __suseconds_t_defined
+typedef __suseconds_t suseconds_t;
+# define __suseconds_t_defined
+#endif
+
+
+__BEGIN_DECLS
+
+#ifdef __USE_GNU
+/* Macros for converting between `struct timeval' and `struct timespec'. */
+# define TIMEVAL_TO_TIMESPEC(tv, ts) { \
+ (ts)->tv_sec = (tv)->tv_sec; \
+ (ts)->tv_nsec = (tv)->tv_usec * 1000; \
+}
+# define TIMESPEC_TO_TIMEVAL(tv, ts) { \
+ (tv)->tv_sec = (ts)->tv_sec; \
+ (tv)->tv_usec = (ts)->tv_nsec / 1000; \
+}
+#endif
+
+
+#ifdef __USE_BSD
+/* Structure crudely representing a timezone.
+ This is obsolete and should never be used. */
+struct timezone
+ {
+ int tz_minuteswest; /* Minutes west of GMT. */
+ int tz_dsttime; /* Nonzero if DST is ever in effect. */
+ };
+
+typedef struct timezone *__restrict __timezone_ptr_t;
+#else
+typedef void *__restrict __timezone_ptr_t;
+#endif
+
+/* Get the current time of day and timezone information,
+ putting it into *TV and *TZ. If TZ is NULL, *TZ is not filled.
+ Returns 0 on success, -1 on errors.
+ NOTE: This form of timezone information is obsolete.
+ Use the functions and variables declared in <time.h> instead. */
+extern int gettimeofday (struct timeval *__restrict __tv,
+ __timezone_ptr_t __tz) __THROW __nonnull ((1));
+
+#ifdef __USE_BSD
+/* Set the current time of day and timezone information.
+ This call is restricted to the super-user. */
+extern int settimeofday (__const struct timeval *__tv,
+ __const struct timezone *__tz)
+ __THROW __nonnull ((1));
+
+/* Adjust the current time of day by the amount in DELTA.
+ If OLDDELTA is not NULL, it is filled in with the amount
+ of time adjustment remaining to be done from the last `adjtime' call.
+ This call is restricted to the super-user. */
+extern int adjtime (__const struct timeval *__delta,
+ struct timeval *__olddelta) __THROW;
+#endif
+
+
+/* Values for the first argument to `getitimer' and `setitimer'. */
+enum __itimer_which
+ {
+ /* Timers run in real time. */
+ ITIMER_REAL = 0,
+#define ITIMER_REAL ITIMER_REAL
+ /* Timers run only when the process is executing. */
+ ITIMER_VIRTUAL = 1,
+#define ITIMER_VIRTUAL ITIMER_VIRTUAL
+ /* Timers run when the process is executing and when
+ the system is executing on behalf of the process. */
+ ITIMER_PROF = 2
+#define ITIMER_PROF ITIMER_PROF
+ };
+
+/* Type of the second argument to `getitimer' and
+ the second and third arguments `setitimer'. */
+struct itimerval
+ {
+ /* Value to put into `it_value' when the timer expires. */
+ struct timeval it_interval;
+ /* Time to the next timer expiration. */
+ struct timeval it_value;
+ };
+
+#if defined __USE_GNU && !defined __cplusplus
+/* Use the nicer parameter type only in GNU mode and not for C++ since the
+ strict C++ rules prevent the automatic promotion. */
+typedef enum __itimer_which __itimer_which_t;
+#else
+typedef int __itimer_which_t;
+#endif
+
+/* Set *VALUE to the current setting of timer WHICH.
+ Return 0 on success, -1 on errors. */
+extern int getitimer (__itimer_which_t __which,
+ struct itimerval *__value) __THROW;
+
+/* Set the timer WHICH to *NEW. If OLD is not NULL,
+ set *OLD to the old value of timer WHICH.
+ Returns 0 on success, -1 on errors. */
+extern int setitimer (__itimer_which_t __which,
+ __const struct itimerval *__restrict __new,
+ struct itimerval *__restrict __old) __THROW;
+
+/* Change the access time of FILE to TVP[0] and the modification time of
+ FILE to TVP[1]. If TVP is a null pointer, use the current time instead.
+ Returns 0 on success, -1 on errors. */
+extern int utimes (__const char *__file, __const struct timeval __tvp[2])
+ __THROW __nonnull ((1));
+
+#if 0 /*def __USE_BSD*/
+/* Same as `utimes', but does not follow symbolic links. */
+extern int lutimes (__const char *__file, __const struct timeval __tvp[2])
+ __THROW __nonnull ((1));
+
+/* Same as `utimes', but takes an open file descriptor instead of a name. */
+extern int futimes (int __fd, __const struct timeval __tvp[2]) __THROW;
+#endif
+
+#if 0 /*def __USE_GNU*/
+/* Change the access time of FILE relative to FD to TVP[0] and the
+ modification time of FILE to TVP[1]. If TVP is a null pointer, use
+ the current time instead. Returns 0 on success, -1 on errors. */
+extern int futimesat (int __fd, __const char *__file,
+ __const struct timeval __tvp[2]) __THROW;
+#endif
+
+
+#ifdef __USE_BSD
+/* Convenience macros for operations on timevals.
+ NOTE: `timercmp' does not work for >= or <=. */
+# define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
+# define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
+# define timercmp(a, b, CMP) \
+ (((a)->tv_sec == (b)->tv_sec) ? \
+ ((a)->tv_usec CMP (b)->tv_usec) : \
+ ((a)->tv_sec CMP (b)->tv_sec))
+# define timeradd(a, b, result) \
+ do { \
+ (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \
+ (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \
+ if ((result)->tv_usec >= 1000000) \
+ { \
+ ++(result)->tv_sec; \
+ (result)->tv_usec -= 1000000; \
+ } \
+ } while (0)
+# define timersub(a, b, result) \
+ do { \
+ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
+ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
+ if ((result)->tv_usec < 0) { \
+ --(result)->tv_sec; \
+ (result)->tv_usec += 1000000; \
+ } \
+ } while (0)
+#endif /* BSD */
+
+__END_DECLS
+
+#endif /* sys/time.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/timeb.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/timeb.h
new file mode 100644
index 0000000..dbdbf45
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/timeb.h
@@ -0,0 +1,46 @@
+/* Copyright (C) 1994, 1995, 1996, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_TIMEB_H
+#define _SYS_TIMEB_H 1
+
+#include <features.h>
+
+#define __need_time_t
+#include <time.h>
+
+
+__BEGIN_DECLS
+
+/* Structure returned by the `ftime' function. */
+
+struct timeb
+ {
+ time_t time; /* Seconds since epoch, as from `time'. */
+ unsigned short int millitm; /* Additional milliseconds. */
+ short int timezone; /* Minutes west of GMT. */
+ short int dstflag; /* Nonzero if Daylight Savings Time used. */
+ };
+
+/* Fill in TIMEBUF with information about the current time. */
+
+extern int ftime (struct timeb *__timebuf);
+
+__END_DECLS
+
+#endif /* sys/timeb.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/times.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/times.h
new file mode 100644
index 0000000..6022f2f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/times.h
@@ -0,0 +1,53 @@
+/* Copyright (C) 1991, 1992, 1996, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 4.5.2 Process Times <sys/times.h>
+ */
+
+#ifndef _SYS_TIMES_H
+#define _SYS_TIMES_H 1
+
+#include <features.h>
+
+#define __need_clock_t
+#include <time.h>
+
+
+__BEGIN_DECLS
+
+/* Structure describing CPU time used by a process and its children. */
+struct tms
+ {
+ clock_t tms_utime; /* User CPU time. */
+ clock_t tms_stime; /* System CPU time. */
+
+ clock_t tms_cutime; /* User CPU time of dead children. */
+ clock_t tms_cstime; /* System CPU time of dead children. */
+ };
+
+
+/* Store the CPU time used by this process and all its
+ dead children (and their dead children) in BUFFER.
+ Return the elapsed real time, or (clock_t) -1 for errors.
+ All times are in CLK_TCKths of a second. */
+extern clock_t times (struct tms *__buffer) __THROW;
+
+__END_DECLS
+
+#endif /* sys/times.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/timex.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/timex.h
new file mode 100644
index 0000000..773a5ab
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/timex.h
@@ -0,0 +1,127 @@
+/* Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_TIMEX_H
+#define _SYS_TIMEX_H 1
+
+#include <features.h>
+#include <sys/time.h>
+
+/* These definitions from linux/timex.h as of 2.2.0. */
+
+struct ntptimeval
+{
+ struct timeval time; /* current time (ro) */
+ long int maxerror; /* maximum error (us) (ro) */
+ long int esterror; /* estimated error (us) (ro) */
+};
+
+struct timex
+{
+ unsigned int modes; /* mode selector */
+ long int offset; /* time offset (usec) */
+ long int freq; /* frequency offset (scaled ppm) */
+ long int maxerror; /* maximum error (usec) */
+ long int esterror; /* estimated error (usec) */
+ int status; /* clock command/status */
+ long int constant; /* pll time constant */
+ long int precision; /* clock precision (usec) (read only) */
+ long int tolerance; /* clock frequency tolerance (ppm) (read only) */
+ struct timeval time; /* (read only) */
+ long int tick; /* (modified) usecs between clock ticks */
+
+ long int ppsfreq; /* pps frequency (scaled ppm) (ro) */
+ long int jitter; /* pps jitter (us) (ro) */
+ int shift; /* interval duration (s) (shift) (ro) */
+ long int stabil; /* pps stability (scaled ppm) (ro) */
+ long int jitcnt; /* jitter limit exceeded (ro) */
+ long int calcnt; /* calibration intervals (ro) */
+ long int errcnt; /* calibration errors (ro) */
+ long int stbcnt; /* stability limit exceeded (ro) */
+
+ /* ??? */
+ int :32; int :32; int :32; int :32;
+ int :32; int :32; int :32; int :32;
+ int :32; int :32; int :32; int :32;
+};
+
+/* Mode codes (timex.mode) */
+#define ADJ_OFFSET 0x0001 /* time offset */
+#define ADJ_FREQUENCY 0x0002 /* frequency offset */
+#define ADJ_MAXERROR 0x0004 /* maximum time error */
+#define ADJ_ESTERROR 0x0008 /* estimated time error */
+#define ADJ_STATUS 0x0010 /* clock status */
+#define ADJ_TIMECONST 0x0020 /* pll time constant */
+#define ADJ_TICK 0x4000 /* tick value */
+#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */
+
+/* xntp 3.4 compatibility names */
+#define MOD_OFFSET ADJ_OFFSET
+#define MOD_FREQUENCY ADJ_FREQUENCY
+#define MOD_MAXERROR ADJ_MAXERROR
+#define MOD_ESTERROR ADJ_ESTERROR
+#define MOD_STATUS ADJ_STATUS
+#define MOD_TIMECONST ADJ_TIMECONST
+#define MOD_CLKB ADJ_TICK
+#define MOD_CLKA ADJ_OFFSET_SINGLESHOT /* 0x8000 in original */
+
+
+/* Status codes (timex.status) */
+#define STA_PLL 0x0001 /* enable PLL updates (rw) */
+#define STA_PPSFREQ 0x0002 /* enable PPS freq discipline (rw) */
+#define STA_PPSTIME 0x0004 /* enable PPS time discipline (rw) */
+#define STA_FLL 0x0008 /* select frequency-lock mode (rw) */
+
+#define STA_INS 0x0010 /* insert leap (rw) */
+#define STA_DEL 0x0020 /* delete leap (rw) */
+#define STA_UNSYNC 0x0040 /* clock unsynchronized (rw) */
+#define STA_FREQHOLD 0x0080 /* hold frequency (rw) */
+
+#define STA_PPSSIGNAL 0x0100 /* PPS signal present (ro) */
+#define STA_PPSJITTER 0x0200 /* PPS signal jitter exceeded (ro) */
+#define STA_PPSWANDER 0x0400 /* PPS signal wander exceeded (ro) */
+#define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */
+
+#define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */
+
+#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \
+ STA_PPSERROR | STA_CLOCKERR) /* read-only bits */
+
+/* Clock states (time_state) */
+#define TIME_OK 0 /* clock synchronized, no leap second */
+#define TIME_INS 1 /* insert leap second */
+#define TIME_DEL 2 /* delete leap second */
+#define TIME_OOP 3 /* leap second in progress */
+#define TIME_WAIT 4 /* leap second has occurred */
+#define TIME_ERROR 5 /* clock not synchronized */
+#define TIME_BAD TIME_ERROR /* bw compat */
+
+/* Maximum time constant of the PLL. */
+#define MAXTC 6
+
+__BEGIN_DECLS
+
+extern int __adjtimex (struct timex *__ntx) __THROW;
+extern int adjtimex (struct timex *__ntx) __THROW;
+
+extern int ntp_gettime (struct ntptimeval *__ntv) __THROW;
+extern int ntp_adjtime (struct timex *__tntx) __THROW;
+
+__END_DECLS
+
+#endif /* sys/timex.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ttydefaults.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ttydefaults.h
new file mode 100644
index 0000000..9be168b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ttydefaults.h
@@ -0,0 +1,100 @@
+/*-
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ttydefaults.h 8.4 (Berkeley) 1/21/94
+ */
+
+/*
+ * System wide defaults for terminal state. Linux version.
+ */
+#ifndef _SYS_TTYDEFAULTS_H_
+#define _SYS_TTYDEFAULTS_H_
+
+/*
+ * Defaults on "first" open.
+ */
+#define TTYDEF_IFLAG (BRKINT | ISTRIP | ICRNL | IMAXBEL | IXON | IXANY)
+#define TTYDEF_OFLAG (OPOST | ONLCR | XTABS)
+#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
+#define TTYDEF_CFLAG (CREAD | CS7 | PARENB | HUPCL)
+#define TTYDEF_SPEED (B9600)
+
+/*
+ * Control Character Defaults
+ */
+#define CTRL(x) (x&037)
+#define CEOF CTRL('d')
+#ifdef _POSIX_VDISABLE
+# define CEOL _POSIX_VDISABLE
+#else
+# define CEOL '\0' /* XXX avoid _POSIX_VDISABLE */
+#endif
+#define CERASE 0177
+#define CINTR CTRL('c')
+#ifdef _POSIX_VDISABLE
+# define CSTATUS _POSIX_VDISABLE
+#else
+# define CSTATUS '\0' /* XXX avoid _POSIX_VDISABLE */
+#endif
+#define CKILL CTRL('u')
+#define CMIN 1
+#define CQUIT 034 /* FS, ^\ */
+#define CSUSP CTRL('z')
+#define CTIME 0
+#define CDSUSP CTRL('y')
+#define CSTART CTRL('q')
+#define CSTOP CTRL('s')
+#define CLNEXT CTRL('v')
+#define CDISCARD CTRL('o')
+#define CWERASE CTRL('w')
+#define CREPRINT CTRL('r')
+#define CEOT CEOF
+/* compat */
+#define CBRK CEOL
+#define CRPRNT CREPRINT
+#define CFLUSH CDISCARD
+
+/* PROTECTED INCLUSION ENDS HERE */
+#endif /* !_SYS_TTYDEFAULTS_H_ */
+
+/*
+ * #define TTYDEFCHARS to include an array of default control characters.
+ */
+#ifdef TTYDEFCHARS
+cc_t ttydefchars[NCCS] = {
+ CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT,
+ _POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT,
+ CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE
+};
+#undef TTYDEFCHARS
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/types.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/types.h
new file mode 100644
index 0000000..8c0b5dc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/types.h
@@ -0,0 +1,275 @@
+/* Copyright (C) 1991,1992,1994,1995,1996,1997,1998,1999,2000,2001,2002
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 2.6 Primitive System Data Types <sys/types.h>
+ */
+
+#ifndef _SYS_TYPES_H
+#define _SYS_TYPES_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <bits/types.h>
+
+#ifdef __USE_BSD
+# ifndef __u_char_defined
+typedef __u_char u_char;
+typedef __u_short u_short;
+typedef __u_int u_int;
+typedef __u_long u_long;
+typedef __quad_t quad_t;
+typedef __u_quad_t u_quad_t;
+typedef __fsid_t fsid_t;
+# define __u_char_defined
+# endif
+#endif
+
+typedef __loff_t loff_t;
+
+#ifndef __ino_t_defined
+# ifndef __USE_FILE_OFFSET64
+typedef __ino_t ino_t;
+# else
+typedef __ino64_t ino_t;
+# endif
+# define __ino_t_defined
+#endif
+#if defined __USE_LARGEFILE64 && !defined __ino64_t_defined
+typedef __ino64_t ino64_t;
+# define __ino64_t_defined
+#endif
+
+#ifndef __dev_t_defined
+typedef __dev_t dev_t;
+# define __dev_t_defined
+#endif
+
+#ifndef __gid_t_defined
+typedef __gid_t gid_t;
+# define __gid_t_defined
+#endif
+
+#ifndef __mode_t_defined
+typedef __mode_t mode_t;
+# define __mode_t_defined
+#endif
+
+#ifndef __nlink_t_defined
+typedef __nlink_t nlink_t;
+# define __nlink_t_defined
+#endif
+
+#ifndef __uid_t_defined
+typedef __uid_t uid_t;
+# define __uid_t_defined
+#endif
+
+#ifndef __off_t_defined
+# ifndef __USE_FILE_OFFSET64
+typedef __off_t off_t;
+# else
+typedef __off64_t off_t;
+# endif
+# define __off_t_defined
+#endif
+#if defined __USE_LARGEFILE64 && !defined __off64_t_defined
+typedef __off64_t off64_t;
+# define __off64_t_defined
+#endif
+
+#ifndef __pid_t_defined
+typedef __pid_t pid_t;
+# define __pid_t_defined
+#endif
+
+#if (defined __USE_SVID || defined __USE_XOPEN) && !defined __id_t_defined
+typedef __id_t id_t;
+# define __id_t_defined
+#endif
+
+#ifndef __ssize_t_defined
+typedef __ssize_t ssize_t;
+# define __ssize_t_defined
+#endif
+
+#ifdef __USE_BSD
+# ifndef __daddr_t_defined
+typedef __daddr_t daddr_t;
+typedef __caddr_t caddr_t;
+# define __daddr_t_defined
+# endif
+#endif
+
+#if (defined __USE_SVID || defined __USE_XOPEN) && !defined __key_t_defined
+typedef __key_t key_t;
+# define __key_t_defined
+#endif
+
+#ifdef __USE_XOPEN
+# define __need_clock_t
+#endif
+#define __need_time_t
+#define __need_timer_t
+#define __need_clockid_t
+#include <time.h>
+
+#ifdef __USE_XOPEN
+# ifndef __useconds_t_defined
+typedef __useconds_t useconds_t;
+# define __useconds_t_defined
+# endif
+# ifndef __suseconds_t_defined
+typedef __suseconds_t suseconds_t;
+# define __suseconds_t_defined
+# endif
+#endif
+
+#define __need_size_t
+#include <stddef.h>
+
+#ifdef __USE_MISC
+/* Old compatibility names for C types. */
+typedef unsigned long int ulong;
+typedef unsigned short int ushort;
+typedef unsigned int uint;
+#endif
+
+/* These size-specific names are used by some of the inet code. */
+
+#if !__GNUC_PREREQ (2, 7)
+
+/* These types are defined by the ISO C99 header <inttypes.h>. */
+# ifndef __int8_t_defined
+# define __int8_t_defined
+typedef char int8_t;
+typedef short int int16_t;
+typedef int int32_t;
+# if __WORDSIZE == 64
+typedef long int int64_t;
+# elif defined __GNUC__ || defined __ICC
+__extension__ typedef long long int int64_t;
+# endif
+# endif
+
+/* But these were defined by ISO C without the first `_'. */
+typedef unsigned char u_int8_t;
+typedef unsigned short int u_int16_t;
+typedef unsigned int u_int32_t;
+# if __WORDSIZE == 64
+typedef unsigned long int u_int64_t;
+# elif defined __GNUC__ || defined __ICC
+__extension__ typedef unsigned long long int u_int64_t;
+# endif
+
+typedef int register_t;
+
+#else
+
+/* For GCC 2.7 and later, we can use specific type-size attributes. */
+# define __intN_t(N, MODE) \
+ typedef int int##N##_t __attribute__ ((__mode__ (MODE)))
+# define __u_intN_t(N, MODE) \
+ typedef unsigned int u_int##N##_t __attribute__ ((__mode__ (MODE)))
+
+# ifndef __int8_t_defined
+# define __int8_t_defined
+__intN_t (8, __QI__);
+__intN_t (16, __HI__);
+__intN_t (32, __SI__);
+__intN_t (64, __DI__);
+# endif
+
+__u_intN_t (8, __QI__);
+__u_intN_t (16, __HI__);
+__u_intN_t (32, __SI__);
+__u_intN_t (64, __DI__);
+
+typedef int register_t __attribute__ ((__mode__ (__word__)));
+
+
+/* Some code from BIND tests this macro to see if the types above are
+ defined. */
+#endif
+#define __BIT_TYPES_DEFINED__ 1
+
+
+#ifdef __USE_BSD
+/* In BSD <sys/types.h> is expected to define BYTE_ORDER. */
+# include <endian.h>
+
+/* It also defines `fd_set' and the FD_* macros for `select'. */
+# include <sys/select.h>
+
+/* BSD defines these symbols, so we follow. */
+# include <sys/sysmacros.h>
+#endif /* Use BSD. */
+
+
+#if defined __USE_UNIX98 && !defined __blksize_t_defined
+typedef __blksize_t blksize_t;
+# define __blksize_t_defined
+#endif
+
+/* Types from the Large File Support interface. */
+#ifndef __USE_FILE_OFFSET64
+# ifndef __blkcnt_t_defined
+typedef __blkcnt_t blkcnt_t; /* Type to count number of disk blocks. */
+# define __blkcnt_t_defined
+# endif
+# ifndef __fsblkcnt_t_defined
+typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks. */
+# define __fsblkcnt_t_defined
+# endif
+# ifndef __fsfilcnt_t_defined
+typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes. */
+# define __fsfilcnt_t_defined
+# endif
+#else
+# ifndef __blkcnt_t_defined
+typedef __blkcnt64_t blkcnt_t; /* Type to count number of disk blocks. */
+# define __blkcnt_t_defined
+# endif
+# ifndef __fsblkcnt_t_defined
+typedef __fsblkcnt64_t fsblkcnt_t; /* Type to count file system blocks. */
+# define __fsblkcnt_t_defined
+# endif
+# ifndef __fsfilcnt_t_defined
+typedef __fsfilcnt64_t fsfilcnt_t; /* Type to count file system inodes. */
+# define __fsfilcnt_t_defined
+# endif
+#endif
+
+#ifdef __USE_LARGEFILE64
+typedef __blkcnt64_t blkcnt64_t; /* Type to count number of disk blocks. */
+typedef __fsblkcnt64_t fsblkcnt64_t; /* Type to count file system blocks. */
+typedef __fsfilcnt64_t fsfilcnt64_t; /* Type to count file system inodes. */
+#endif
+
+
+/* Now add the thread types. */
+#if (defined __USE_POSIX199506 || defined __USE_UNIX98) && defined __UCLIBC_HAS_THREADS__
+# include <bits/pthreadtypes.h>
+#endif
+
+__END_DECLS
+
+#endif /* sys/types.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ucontext.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ucontext.h
new file mode 100644
index 0000000..ac496f3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ucontext.h
@@ -0,0 +1,117 @@
+/* Copyright (C) 1997, 1998, 2000, 2003, 2004, 2006 Free Software
+ Foundation, Inc. This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Don't rely on this, the interface is currently messed up and may need to
+ be broken to be fixed. */
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H 1
+
+#include <features.h>
+#include <sgidefs.h>
+#include <signal.h>
+
+/* We need the signal context definitions even if they are not used
+ included in <signal.h>. */
+#include <bits/sigcontext.h>
+
+/* Type for general register. Even in o32 we assume 64-bit registers,
+ like the kernel. */
+__extension__ typedef unsigned long long int greg_t;
+
+/* Number of general registers. */
+#define NGREG 32
+#define NFPREG 32
+
+/* Container for all general registers. */
+typedef greg_t gregset_t[NGREG];
+
+/* Container for all FPU registers. */
+typedef struct fpregset {
+ union {
+ double fp_dregs[NFPREG];
+ struct {
+ float _fp_fregs;
+ unsigned int _fp_pad;
+ } fp_fregs[NFPREG];
+ } fp_r;
+} fpregset_t;
+
+
+/* Context to describe whole processor state. */
+#if _MIPS_SIM == _ABIO32
+/* Earlier versions of glibc for mips had an entirely different
+ definition of mcontext_t, that didn't even resemble the
+ corresponding kernel data structure. Since all legitimate uses of
+ ucontext_t in glibc mustn't have accessed anything beyond
+ uc_mcontext and, even then, taking a pointer to it, casting it to
+ sigcontext_t, and accessing it as such, which is what it has always
+ been, this can still be rectified. Fortunately, makecontext,
+ [gs]etcontext et all have never been implemented. */
+typedef struct
+ {
+ unsigned int regmask;
+ unsigned int status;
+ greg_t pc;
+ gregset_t gregs;
+ fpregset_t fpregs;
+ unsigned int fp_owned;
+ unsigned int fpc_csr;
+ unsigned int fpc_eir;
+ unsigned int used_math;
+ unsigned int dsp;
+ greg_t mdhi;
+ greg_t mdlo;
+ unsigned long hi1;
+ unsigned long lo1;
+ unsigned long hi2;
+ unsigned long lo2;
+ unsigned long hi3;
+ unsigned long lo3;
+ } mcontext_t;
+#else
+typedef struct
+ {
+ gregset_t gregs;
+ fpregset_t fpregs;
+ greg_t mdhi;
+ greg_t hi1;
+ greg_t hi2;
+ greg_t hi3;
+ greg_t mdlo;
+ greg_t lo1;
+ greg_t lo2;
+ greg_t lo3;
+ greg_t pc;
+ unsigned int fpc_csr;
+ unsigned int used_math;
+ unsigned int dsp;
+ unsigned int reserved;
+ } mcontext_t;
+#endif
+
+/* Userlevel context. */
+typedef struct ucontext
+ {
+ unsigned long int uc_flags;
+ struct ucontext *uc_link;
+ stack_t uc_stack;
+ mcontext_t uc_mcontext;
+ __sigset_t uc_sigmask;
+ } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/uio.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/uio.h
new file mode 100644
index 0000000..1b203f7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/uio.h
@@ -0,0 +1,54 @@
+/* Copyright (C) 1991, 92, 96, 97, 98, 99, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_UIO_H
+#define _SYS_UIO_H 1
+
+#include <features.h>
+
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+/* This file defines `struct iovec'. */
+#include <bits/uio.h>
+
+
+/* Read data from file descriptor FD, and put the result in the
+ buffers described by IOVEC, which is a vector of COUNT `struct iovec's.
+ The buffers are filled in the order specified.
+ Operates just like `read' (see <unistd.h>) except that data are
+ put in IOVEC instead of a contiguous buffer.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t readv (int __fd, __const struct iovec *__iovec, int __count);
+
+/* Write data pointed by the buffers described by IOVEC, which
+ is a vector of COUNT `struct iovec's, to file descriptor FD.
+ The data is written in the order specified.
+ Operates just like `write' (see <unistd.h>) except that the data
+ are taken from IOVEC instead of a contiguous buffer.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t writev (int __fd, __const struct iovec *__iovec, int __count);
+
+__END_DECLS
+
+#endif /* sys/uio.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/un.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/un.h
new file mode 100644
index 0000000..1fa10e4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/un.h
@@ -0,0 +1,47 @@
+/* Copyright (C) 1991, 1995, 1996, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_UN_H
+#define _SYS_UN_H 1
+
+#include <sys/cdefs.h>
+
+/* Get the definition of the macro to define the common sockaddr members. */
+#include <bits/sockaddr.h>
+
+__BEGIN_DECLS
+
+/* Structure describing the address of an AF_LOCAL (aka AF_UNIX) socket. */
+struct sockaddr_un
+ {
+ __SOCKADDR_COMMON (sun_);
+ char sun_path[108]; /* Path name. */
+ };
+
+
+#ifdef __USE_MISC
+# include <string.h> /* For prototype of `strlen'. */
+
+/* Evaluate to actual length of the `sockaddr_un' structure. */
+# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
+ + strlen ((ptr)->sun_path))
+#endif
+
+__END_DECLS
+
+#endif /* sys/un.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/unistd.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/unistd.h
new file mode 100644
index 0000000..1e823fb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/unistd.h
@@ -0,0 +1 @@
+#include <unistd.h>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/user.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/user.h
new file mode 100644
index 0000000..5d88094
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/user.h
@@ -0,0 +1,217 @@
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_USER_H
+#define _SYS_USER_H 1
+
+#include <sgidefs.h>
+
+/* The whole purpose of this file is for GDB and GDB only. Don't read
+ too much into it. Don't use it for anything other than GDB unless
+ you know what you are doing. */
+
+/* #include <asm/reg.h> */
+/* Instead of including the kernel header, that will vary depending on
+ whether the 32- or the 64-bit kernel is installed, we paste its
+ contents here. Note that the fact that the file is inline here,
+ instead of included separately, doesn't change in any way the
+ licensing status of a program that includes user.h. Since this is
+ for gdb alone, and gdb is GPLed, no surprises here. */
+#if _MIPS_SIM == _ABIO32
+/*
+ * Various register offset definitions for debuggers, core file
+ * examiners and whatnot.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 1999 by Ralf Baechle
+ */
+#ifndef __ASM_MIPS_REG_H
+#define __ASM_MIPS_REG_H
+
+/*
+ * This defines/structures correspond to the register layout on stack -
+ * if the order here is changed, it needs to be updated in
+ * include/asm-mips/stackframe.h
+ */
+#define EF_REG0 6
+#define EF_REG1 7
+#define EF_REG2 8
+#define EF_REG3 9
+#define EF_REG4 10
+#define EF_REG5 11
+#define EF_REG6 12
+#define EF_REG7 13
+#define EF_REG8 14
+#define EF_REG9 15
+#define EF_REG10 16
+#define EF_REG11 17
+#define EF_REG12 18
+#define EF_REG13 19
+#define EF_REG14 20
+#define EF_REG15 21
+#define EF_REG16 22
+#define EF_REG17 23
+#define EF_REG18 24
+#define EF_REG19 25
+#define EF_REG20 26
+#define EF_REG21 27
+#define EF_REG22 28
+#define EF_REG23 29
+#define EF_REG24 30
+#define EF_REG25 31
+/*
+ * k0/k1 unsaved
+ */
+#define EF_REG28 34
+#define EF_REG29 35
+#define EF_REG30 36
+#define EF_REG31 37
+
+/*
+ * Saved special registers
+ */
+#define EF_LO 38
+#define EF_HI 39
+
+#define EF_CP0_EPC 40
+#define EF_CP0_BADVADDR 41
+#define EF_CP0_STATUS 42
+#define EF_CP0_CAUSE 43
+
+#define EF_SIZE 180 /* size in bytes */
+
+#endif /* __ASM_MIPS_REG_H */
+
+#else /* _MIPS_SIM != _ABIO32 */
+
+/*
+ * Various register offset definitions for debuggers, core file
+ * examiners and whatnot.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 1999 Ralf Baechle
+ * Copyright (C) 1995, 1999 Silicon Graphics
+ */
+#ifndef _ASM_REG_H
+#define _ASM_REG_H
+
+/*
+ * This defines/structures correspond to the register layout on stack -
+ * if the order here is changed, it needs to be updated in
+ * include/asm-mips/stackframe.h
+ */
+#define EF_REG0 0
+#define EF_REG1 1
+#define EF_REG2 2
+#define EF_REG3 3
+#define EF_REG4 4
+#define EF_REG5 5
+#define EF_REG6 6
+#define EF_REG7 7
+#define EF_REG8 8
+#define EF_REG9 9
+#define EF_REG10 10
+#define EF_REG11 11
+#define EF_REG12 12
+#define EF_REG13 13
+#define EF_REG14 14
+#define EF_REG15 15
+#define EF_REG16 16
+#define EF_REG17 17
+#define EF_REG18 18
+#define EF_REG19 19
+#define EF_REG20 20
+#define EF_REG21 21
+#define EF_REG22 22
+#define EF_REG23 23
+#define EF_REG24 24
+#define EF_REG25 25
+/*
+ * k0/k1 unsaved
+ */
+#define EF_REG28 28
+#define EF_REG29 29
+#define EF_REG30 30
+#define EF_REG31 31
+
+/*
+ * Saved special registers
+ */
+#define EF_LO 32
+#define EF_HI 33
+
+#define EF_CP0_EPC 34
+#define EF_CP0_BADVADDR 35
+#define EF_CP0_STATUS 36
+#define EF_CP0_CAUSE 37
+
+#define EF_SIZE 304 /* size in bytes */
+
+#endif /* _ASM_REG_H */
+
+#endif /* _MIPS_SIM != _ABIO32 */
+
+#if _MIPS_SIM == _ABIO32
+
+struct user
+{
+ unsigned long regs[EF_SIZE/4+64]; /* integer and fp regs */
+ size_t u_tsize; /* text size (pages) */
+ size_t u_dsize; /* data size (pages) */
+ size_t u_ssize; /* stack size (pages) */
+ unsigned long start_code; /* text starting address */
+ unsigned long start_data; /* data starting address */
+ unsigned long start_stack; /* stack starting address */
+ long int signal; /* signal causing core dump */
+ void* u_ar0; /* help gdb find registers */
+ unsigned long magic; /* identifies a core file */
+ char u_comm[32]; /* user command name */
+};
+
+#else
+
+struct user {
+ __extension__ unsigned long regs[EF_SIZE/8+64]; /* integer and fp regs */
+ __extension__ unsigned long u_tsize; /* text size (pages) */
+ __extension__ unsigned long u_dsize; /* data size (pages) */
+ __extension__ unsigned long u_ssize; /* stack size (pages) */
+ __extension__ unsigned long long start_code; /* text starting address */
+ __extension__ unsigned long long start_data; /* data starting address */
+ __extension__ unsigned long long start_stack; /* stack starting address */
+ __extension__ long long signal; /* signal causing core dump */
+ __extension__ unsigned long long u_ar0; /* help gdb find registers */
+ __extension__ unsigned long long magic; /* identifies a core file */
+ char u_comm[32]; /* user command name */
+};
+
+#endif
+
+#include <bits/uClibc_page.h>
+#define NBPG PAGE_SIZE
+#define UPAGES 1
+#define HOST_TEXT_START_ADDR (u.start_code)
+#define HOST_DATA_START_ADDR (u.start_data)
+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
+
+#endif /* _SYS_USER_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ustat.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ustat.h
new file mode 100644
index 0000000..7a9cdac
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/ustat.h
@@ -0,0 +1,38 @@
+/* Header describing obsolete `ustat' interface.
+ Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * This interface is obsolete. Use <sys/statfs.h> instead.
+ */
+
+#ifndef _SYS_USTAT_H
+#define _SYS_USTAT_H 1
+
+#include <features.h>
+
+#include <sys/types.h>
+#include <bits/ustat.h>
+
+__BEGIN_DECLS
+
+extern int ustat (__dev_t __dev, struct ustat *__ubuf) __THROW;
+
+__END_DECLS
+
+#endif /* sys/ustat.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/utsname.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/utsname.h
new file mode 100644
index 0000000..ca195cb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/utsname.h
@@ -0,0 +1,74 @@
+/* Copyright (C) 1991, 92, 94, 96, 97, 99 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 4.4 System Identification <sys/utsname.h>
+ */
+
+#ifndef _SYS_UTSNAME_H
+#define _SYS_UTSNAME_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <bits/utsname.h>
+
+#ifndef _UTSNAME_NODENAME_LENGTH
+# define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH
+#endif
+
+/* Structure describing the system and machine. */
+struct utsname
+ {
+ /* Name of the implementation of the operating system. */
+ char sysname[_UTSNAME_LENGTH];
+
+ /* Name of this node on the network. */
+ char nodename[_UTSNAME_NODENAME_LENGTH];
+
+ /* Current release level of this implementation. */
+ char release[_UTSNAME_LENGTH];
+ /* Current version level of this release. */
+ char version[_UTSNAME_LENGTH];
+
+ /* Name of the hardware type the system is running on. */
+ char machine[_UTSNAME_LENGTH];
+
+#if _UTSNAME_DOMAIN_LENGTH - 0
+ /* Name of the domain of this node on the network. */
+# ifdef __USE_GNU
+ char domainname[_UTSNAME_DOMAIN_LENGTH];
+# else
+ char __domainname[_UTSNAME_DOMAIN_LENGTH];
+# endif
+#endif
+ };
+
+#ifdef __USE_SVID
+# define SYS_NMLN _UTSNAME_LENGTH
+#endif
+
+
+/* Put information about the system in NAME. */
+extern int uname (struct utsname *__name) __THROW;
+
+
+__END_DECLS
+
+#endif /* sys/utsname.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/vfs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/vfs.h
new file mode 100644
index 0000000..fa22d31
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/vfs.h
@@ -0,0 +1,4 @@
+/* Other systems declare `struct statfs' et al in <sys/vfs.h>,
+ so we have this file to be compatible with programs expecting it. */
+
+#include <sys/statfs.h>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/vt.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/vt.h
new file mode 100644
index 0000000..834abfb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/vt.h
@@ -0,0 +1 @@
+#include <linux/vt.h>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/wait.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/wait.h
new file mode 100644
index 0000000..81a54fc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/wait.h
@@ -0,0 +1,186 @@
+/* Copyright (C) 1991-1994,1996-2001,2003,2004,2005
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 3.2.1 Wait for Process Termination <sys/wait.h>
+ */
+
+#ifndef _SYS_WAIT_H
+#define _SYS_WAIT_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <signal.h>
+#include <sys/resource.h>
+
+/* These macros could also be defined in <stdlib.h>. */
+#if !defined _STDLIB_H || !defined __USE_XOPEN
+/* This will define the `W*' macros for the flag
+ bits to `waitpid', `wait3', and `wait4'. */
+# include <bits/waitflags.h>
+
+# ifdef __USE_BSD
+
+/* Lots of hair to allow traditional BSD use of `union wait'
+ as well as POSIX.1 use of `int' for the status word. */
+
+# if defined __GNUC__ && !defined __cplusplus
+# define __WAIT_INT(status) \
+ (__extension__ (((union { __typeof(status) __in; int __i; }) \
+ { .__in = (status) }).__i))
+# else
+# define __WAIT_INT(status) (*(__const int *) &(status))
+# endif
+
+/* This is the type of the argument to `wait'. The funky union
+ causes redeclarations with ether `int *' or `union wait *' to be
+ allowed without complaint. __WAIT_STATUS_DEFN is the type used in
+ the actual function definitions. */
+
+# if !defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus
+# define __WAIT_STATUS void *
+# define __WAIT_STATUS_DEFN void *
+# else
+/* This works in GCC 2.6.1 and later. */
+typedef union
+ {
+ union wait *__uptr;
+ int *__iptr;
+ } __WAIT_STATUS __attribute__ ((__transparent_union__));
+# define __WAIT_STATUS_DEFN int *
+# endif
+
+# else /* Don't use BSD. */
+
+# define __WAIT_INT(status) (status)
+# define __WAIT_STATUS int *
+# define __WAIT_STATUS_DEFN int *
+
+# endif /* Use BSD. */
+
+/* This will define all the `__W*' macros. */
+# include <bits/waitstatus.h>
+
+# define WEXITSTATUS(status) __WEXITSTATUS(__WAIT_INT(status))
+# define WTERMSIG(status) __WTERMSIG(__WAIT_INT(status))
+# define WSTOPSIG(status) __WSTOPSIG(__WAIT_INT(status))
+# define WIFEXITED(status) __WIFEXITED(__WAIT_INT(status))
+# define WIFSIGNALED(status) __WIFSIGNALED(__WAIT_INT(status))
+# define WIFSTOPPED(status) __WIFSTOPPED(__WAIT_INT(status))
+# if 0 /*def __WIFCONTINUED*/
+# define WIFCONTINUED(status) __WIFCONTINUED(__WAIT_INT(status))
+# endif
+#endif /* <stdlib.h> not included. */
+
+#ifdef __USE_BSD
+# define WCOREFLAG __WCOREFLAG
+# define WCOREDUMP(status) __WCOREDUMP(__WAIT_INT(status))
+# define W_EXITCODE(ret, sig) __W_EXITCODE(ret, sig)
+# define W_STOPCODE(sig) __W_STOPCODE(sig)
+#endif
+
+/* The following values are used by the `waitid' function. */
+#if defined __USE_SVID || defined __USE_XOPEN
+typedef enum
+{
+ P_ALL, /* Wait for any child. */
+ P_PID, /* Wait for specified process. */
+ P_PGID /* Wait for members of process group. */
+} idtype_t;
+#endif
+
+
+/* Wait for a child to die. When one does, put its status in *STAT_LOC
+ and return its process ID. For errors, return (pid_t) -1.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern __pid_t wait (__WAIT_STATUS __stat_loc);
+
+#ifdef __USE_BSD
+/* Special values for the PID argument to `waitpid' and `wait4'. */
+# define WAIT_ANY (-1) /* Any process. */
+# define WAIT_MYPGRP 0 /* Any process in my process group. */
+#endif
+
+/* Wait for a child matching PID to die.
+ If PID is greater than 0, match any process whose process ID is PID.
+ If PID is (pid_t) -1, match any process.
+ If PID is (pid_t) 0, match any process with the
+ same process group as the current process.
+ If PID is less than -1, match any process whose
+ process group is the absolute value of PID.
+ If the WNOHANG bit is set in OPTIONS, and that child
+ is not already dead, return (pid_t) 0. If successful,
+ return PID and store the dead child's status in STAT_LOC.
+ Return (pid_t) -1 for errors. If the WUNTRACED bit is
+ set in OPTIONS, return status for stopped children; otherwise don't.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options);
+
+#if defined __USE_SVID || defined __USE_XOPEN
+# define __need_siginfo_t
+# include <bits/siginfo.h>
+/* Wait for a childing matching IDTYPE and ID to change the status and
+ place appropriate information in *INFOP.
+ If IDTYPE is P_PID, match any process whose process ID is ID.
+ If IDTYPE is P_PGID, match any process whose process group is ID.
+ If IDTYPE is P_ALL, match any process.
+ If the WNOHANG bit is set in OPTIONS, and that child
+ is not already dead, clear *INFOP and return 0. If successful, store
+ exit code and status in *INFOP.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
+ int __options);
+#endif
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* This being here makes the prototypes valid whether or not
+ we have already included <sys/resource.h> to define `struct rusage'. */
+struct rusage;
+
+/* Wait for a child to exit. When one does, put its status in *STAT_LOC and
+ return its process ID. For errors return (pid_t) -1. If USAGE is not
+ nil, store information about the child's resource usage there. If the
+ WUNTRACED bit is set in OPTIONS, return status for stopped children;
+ otherwise don't. */
+extern __pid_t wait3 (__WAIT_STATUS __stat_loc, int __options,
+ struct rusage * __usage) __THROW;
+#endif
+
+#ifdef __USE_BSD
+/* This being here makes the prototypes valid whether or not
+ we have already included <sys/resource.h> to define `struct rusage'. */
+struct rusage;
+
+/* PID is like waitpid. Other args are like wait3. */
+extern __pid_t wait4 (__pid_t __pid, __WAIT_STATUS __stat_loc, int __options,
+ struct rusage *__usage) __THROW;
+#endif /* Use BSD. */
+
+
+__END_DECLS
+
+#endif /* sys/wait.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/xattr.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/xattr.h
new file mode 100644
index 0000000..2737f90
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sys/xattr.h
@@ -0,0 +1,104 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_XATTR_H
+#define _SYS_XATTR_H 1
+
+#include <features.h>
+#include <sys/types.h>
+
+
+__BEGIN_DECLS
+
+/* The following constants should be used for the fifth parameter of
+ `*setxattr'. */
+enum
+{
+ XATTR_CREATE = 1, /* set value, fail if attr already exists. */
+#define XATTR_CREATE XATTR_CREATE
+ XATTR_REPLACE = 2 /* set value, fail if attr does not exist. */
+#define XATTR_REPLACE XATTR_REPLACE
+};
+
+/* Set the attribute NAME of the file pointed to by PATH to VALUE (which
+ is SIZE bytes long). Return 0 on success, -1 for errors. */
+extern int setxattr (__const char *__path, __const char *__name,
+ __const void *__value, size_t __size, int __flags)
+ __THROW;
+
+/* Set the attribute NAME of the file pointed to by PATH to VALUE (which is
+ SIZE bytes long), not following symlinks for the last pathname component.
+ Return 0 on success, -1 for errors. */
+extern int lsetxattr (__const char *__path, __const char *__name,
+ __const void *__value, size_t __size, int __flags)
+ __THROW;
+
+/* Set the attribute NAME of the file descriptor FD to VALUE (which is SIZE
+ bytes long). Return 0 on success, -1 for errors. */
+extern int fsetxattr (int __fd, __const char *__name, __const void *__value,
+ size_t __size, int __flags) __THROW;
+
+/* Get the attribute NAME of the file pointed to by PATH to VALUE (which is
+ SIZE bytes long). Return 0 on success, -1 for errors. */
+extern ssize_t getxattr (__const char *__path, __const char *__name,
+ void *__value, size_t __size) __THROW;
+
+/* Get the attribute NAME of the file pointed to by PATH to VALUE (which is
+ SIZE bytes long), not following symlinks for the last pathname component.
+ Return 0 on success, -1 for errors. */
+extern ssize_t lgetxattr (__const char *__path, __const char *__name,
+ void *__value, size_t __size) __THROW;
+
+/* Get the attribute NAME of the file descriptor FD to VALUE (which is SIZE
+ bytes long). Return 0 on success, -1 for errors. */
+extern ssize_t fgetxattr (int __fd, __const char *__name, void *__value,
+ size_t __size) __THROW;
+
+/* List attributes of the file pointed to by PATH into the user-supplied
+ buffer LIST (which is SIZE bytes big). Return 0 on success, -1 for
+ errors. */
+extern ssize_t listxattr (__const char *__path, char *__list, size_t __size)
+ __THROW;
+
+/* List attributes of the file pointed to by PATH into the user-supplied
+ buffer LIST (which is SIZE bytes big), not following symlinks for the
+ last pathname component. Return 0 on success, -1 for errors. */
+extern ssize_t llistxattr (__const char *__path, char *__list, size_t __size)
+ __THROW;
+
+/* List attributes of the file descriptor FD into the user-supplied buffer
+ LIST (which is SIZE bytes big). Return 0 on success, -1 for errors. */
+extern ssize_t flistxattr (int __fd, char *__list, size_t __size)
+ __THROW;
+
+/* Remove the attribute NAME from the file pointed to by PATH. Return 0
+ on success, -1 for errors. */
+extern int removexattr (__const char *__path, __const char *__name) __THROW;
+
+/* Remove the attribute NAME from the file pointed to by PATH, not
+ following symlinks for the last pathname component. Return 0 on
+ success, -1 for errors. */
+extern int lremovexattr (__const char *__path, __const char *__name) __THROW;
+
+/* Remove the attribute NAME from the file descriptor FD. Return 0 on
+ success, -1 for errors. */
+extern int fremovexattr (int __fd, __const char *__name) __THROW;
+
+__END_DECLS
+
+#endif /* sys/xattr.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/syscall.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/syscall.h
new file mode 100644
index 0000000..4c30578
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/syscall.h
@@ -0,0 +1 @@
+#include <sys/syscall.h>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/sysexits.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sysexits.h
new file mode 100644
index 0000000..37246b6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/sysexits.h
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 1987, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)sysexits.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _SYSEXITS_H
+#define _SYSEXITS_H 1
+
+/*
+ * SYSEXITS.H -- Exit status codes for system programs.
+ *
+ * This include file attempts to categorize possible error
+ * exit statuses for system programs, notably delivermail
+ * and the Berkeley network.
+ *
+ * Error numbers begin at EX__BASE to reduce the possibility of
+ * clashing with other exit statuses that random programs may
+ * already return. The meaning of the codes is approximately
+ * as follows:
+ *
+ * EX_USAGE -- The command was used incorrectly, e.g., with
+ * the wrong number of arguments, a bad flag, a bad
+ * syntax in a parameter, or whatever.
+ * EX_DATAERR -- The input data was incorrect in some way.
+ * This should only be used for user's data & not
+ * system files.
+ * EX_NOINPUT -- An input file (not a system file) did not
+ * exist or was not readable. This could also include
+ * errors like "No message" to a mailer (if it cared
+ * to catch it).
+ * EX_NOUSER -- The user specified did not exist. This might
+ * be used for mail addresses or remote logins.
+ * EX_NOHOST -- The host specified did not exist. This is used
+ * in mail addresses or network requests.
+ * EX_UNAVAILABLE -- A service is unavailable. This can occur
+ * if a support program or file does not exist. This
+ * can also be used as a catchall message when something
+ * you wanted to do doesn't work, but you don't know
+ * why.
+ * EX_SOFTWARE -- An internal software error has been detected.
+ * This should be limited to non-operating system related
+ * errors as possible.
+ * EX_OSERR -- An operating system error has been detected.
+ * This is intended to be used for such things as "cannot
+ * fork", "cannot create pipe", or the like. It includes
+ * things like getuid returning a user that does not
+ * exist in the passwd file.
+ * EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp,
+ * etc.) does not exist, cannot be opened, or has some
+ * sort of error (e.g., syntax error).
+ * EX_CANTCREAT -- A (user specified) output file cannot be
+ * created.
+ * EX_IOERR -- An error occurred while doing I/O on some file.
+ * EX_TEMPFAIL -- temporary failure, indicating something that
+ * is not really an error. In sendmail, this means
+ * that a mailer (e.g.) could not create a connection,
+ * and the request should be reattempted later.
+ * EX_PROTOCOL -- the remote system returned something that
+ * was "not possible" during a protocol exchange.
+ * EX_NOPERM -- You did not have sufficient permission to
+ * perform the operation. This is not intended for
+ * file system problems, which should use NOINPUT or
+ * CANTCREAT, but rather for higher level permissions.
+ */
+
+#define EX_OK 0 /* successful termination */
+
+#define EX__BASE 64 /* base value for error messages */
+
+#define EX_USAGE 64 /* command line usage error */
+#define EX_DATAERR 65 /* data format error */
+#define EX_NOINPUT 66 /* cannot open input */
+#define EX_NOUSER 67 /* addressee unknown */
+#define EX_NOHOST 68 /* host name unknown */
+#define EX_UNAVAILABLE 69 /* service unavailable */
+#define EX_SOFTWARE 70 /* internal software error */
+#define EX_OSERR 71 /* system error (e.g., can't fork) */
+#define EX_OSFILE 72 /* critical OS file missing */
+#define EX_CANTCREAT 73 /* can't create (user) output file */
+#define EX_IOERR 74 /* input/output error */
+#define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */
+#define EX_PROTOCOL 76 /* remote error in protocol */
+#define EX_NOPERM 77 /* permission denied */
+#define EX_CONFIG 78 /* configuration error */
+
+#define EX__MAX 78 /* maximum listed value */
+
+#endif /* sysexits.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/syslog.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/syslog.h
new file mode 100644
index 0000000..830b492
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/syslog.h
@@ -0,0 +1 @@
+#include <sys/syslog.h>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/tar.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/tar.h
new file mode 100644
index 0000000..ddfef75
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/tar.h
@@ -0,0 +1,108 @@
+/* Extended tar format from POSIX.1.
+ Copyright (C) 1992, 1996 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Written by David J. MacKenzie.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _TAR_H
+#define _TAR_H 1
+
+/* A tar archive consists of 512-byte blocks.
+ Each file in the archive has a header block followed by 0+ data blocks.
+ Two blocks of NUL bytes indicate the end of the archive. */
+
+/* The fields of header blocks:
+ All strings are stored as ISO 646 (approximately ASCII) strings.
+
+ Fields are numeric unless otherwise noted below; numbers are ISO 646
+ representations of octal numbers, with leading zeros as needed.
+
+ linkname is only valid when typeflag==LNKTYPE. It doesn't use prefix;
+ files that are links to pathnames >100 chars long can not be stored
+ in a tar archive.
+
+ If typeflag=={LNKTYPE,SYMTYPE,DIRTYPE} then size must be 0.
+
+ devmajor and devminor are only valid for typeflag=={BLKTYPE,CHRTYPE}.
+
+ chksum contains the sum of all 512 bytes in the header block,
+ treating each byte as an 8-bit unsigned value and treating the
+ 8 bytes of chksum as blank characters.
+
+ uname and gname are used in preference to uid and gid, if those
+ names exist locally.
+
+ Field Name Byte Offset Length in Bytes Field Type
+ name 0 100 NUL-terminated if NUL fits
+ mode 100 8
+ uid 108 8
+ gid 116 8
+ size 124 12
+ mtime 136 12
+ chksum 148 8
+ typeflag 156 1 see below
+ linkname 157 100 NUL-terminated if NUL fits
+ magic 257 6 must be TMAGIC (NUL term.)
+ version 263 2 must be TVERSION
+ uname 265 32 NUL-terminated
+ gname 297 32 NUL-terminated
+ devmajor 329 8
+ devminor 337 8
+ prefix 345 155 NUL-terminated if NUL fits
+
+ If the first character of prefix is '\0', the file name is name;
+ otherwise, it is prefix/name. Files whose pathnames don't fit in that
+ length can not be stored in a tar archive. */
+
+/* The bits in mode: */
+#define TSUID 04000
+#define TSGID 02000
+#define TSVTX 01000
+#define TUREAD 00400
+#define TUWRITE 00200
+#define TUEXEC 00100
+#define TGREAD 00040
+#define TGWRITE 00020
+#define TGEXEC 00010
+#define TOREAD 00004
+#define TOWRITE 00002
+#define TOEXEC 00001
+
+/* The values for typeflag:
+ Values 'A'-'Z' are reserved for custom implementations.
+ All other values are reserved for future POSIX.1 revisions. */
+
+#define REGTYPE '0' /* Regular file (preferred code). */
+#define AREGTYPE '\0' /* Regular file (alternate code). */
+#define LNKTYPE '1' /* Hard link. */
+#define SYMTYPE '2' /* Symbolic link (hard if not supported). */
+#define CHRTYPE '3' /* Character special. */
+#define BLKTYPE '4' /* Block special. */
+#define DIRTYPE '5' /* Directory. */
+#define FIFOTYPE '6' /* Named pipe. */
+#define CONTTYPE '7' /* Contiguous file */
+ /* (regular file if not supported). */
+
+/* Contents of magic field and its length. */
+#define TMAGIC "ustar"
+#define TMAGLEN 6
+
+/* Contents of the version field and its length. */
+#define TVERSION "00"
+#define TVERSLEN 2
+
+#endif /* tar.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/termio.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/termio.h
new file mode 100644
index 0000000..0e610f0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/termio.h
@@ -0,0 +1,6 @@
+/* Compatible <termio.h> for old `struct termio' ioctl interface.
+ This is obsolete; use the POSIX.1 `struct termios' interface
+ defined in <termios.h> instead. */
+
+#include <termios.h>
+#include <sys/ioctl.h>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/termios.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/termios.h
new file mode 100644
index 0000000..9698b1f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/termios.h
@@ -0,0 +1,110 @@
+/* Copyright (C) 1991,92,93,94,96,97,98,99, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 7.1-2 General Terminal Interface <termios.h>
+ */
+
+#ifndef _TERMIOS_H
+#define _TERMIOS_H 1
+
+#include <features.h>
+#ifdef __USE_UNIX98
+/* We need `pid_t'. */
+# include <bits/types.h>
+# ifndef __pid_t_defined
+typedef __pid_t pid_t;
+# define __pid_t_defined
+# endif
+#endif
+
+__BEGIN_DECLS
+
+/* Get the system-dependent definitions of `struct termios', `tcflag_t',
+ `cc_t', `speed_t', and all the macros specifying the flag bits. */
+#include <bits/termios.h>
+
+#ifdef __USE_BSD
+/* Compare a character C to a value VAL from the `c_cc' array in a
+ `struct termios'. If VAL is _POSIX_VDISABLE, no character can match it. */
+# define CCEQ(val, c) ((c) == (val) && (val) != _POSIX_VDISABLE)
+#endif
+
+/* Return the output baud rate stored in *TERMIOS_P. */
+extern speed_t cfgetospeed (__const struct termios *__termios_p) __THROW;
+
+/* Return the input baud rate stored in *TERMIOS_P. */
+extern speed_t cfgetispeed (__const struct termios *__termios_p) __THROW;
+
+/* Set the output baud rate stored in *TERMIOS_P to SPEED. */
+extern int cfsetospeed (struct termios *__termios_p, speed_t __speed) __THROW;
+
+/* Set the input baud rate stored in *TERMIOS_P to SPEED. */
+extern int cfsetispeed (struct termios *__termios_p, speed_t __speed) __THROW;
+
+#ifdef __USE_BSD
+/* Set both the input and output baud rates in *TERMIOS_OP to SPEED. */
+extern int cfsetspeed (struct termios *__termios_p, speed_t __speed) __THROW;
+#endif
+
+
+/* Put the state of FD into *TERMIOS_P. */
+extern int tcgetattr (int __fd, struct termios *__termios_p) __THROW;
+
+/* Set the state of FD to *TERMIOS_P.
+ Values for OPTIONAL_ACTIONS (TCSA*) are in <bits/termios.h>. */
+extern int tcsetattr (int __fd, int __optional_actions,
+ __const struct termios *__termios_p) __THROW;
+
+
+#ifdef __USE_BSD
+/* Set *TERMIOS_P to indicate raw mode. */
+extern void cfmakeraw (struct termios *__termios_p) __THROW;
+#endif
+
+/* Send zero bits on FD. */
+extern int tcsendbreak (int __fd, int __duration) __THROW;
+
+/* Wait for pending output to be written on FD.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int tcdrain (int __fd);
+
+/* Flush pending data on FD.
+ Values for QUEUE_SELECTOR (TC{I,O,IO}FLUSH) are in <bits/termios.h>. */
+extern int tcflush (int __fd, int __queue_selector) __THROW;
+
+/* Suspend or restart transmission on FD.
+ Values for ACTION (TC[IO]{OFF,ON}) are in <bits/termios.h>. */
+extern int tcflow (int __fd, int __action) __THROW;
+
+
+#ifdef __USE_UNIX98
+/* Get process group ID for session leader for controlling terminal FD. */
+extern __pid_t tcgetsid (int __fd) __THROW;
+#endif
+
+
+#ifdef __USE_BSD
+# include <sys/ttydefaults.h>
+#endif
+
+__END_DECLS
+
+#endif /* termios.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/tgmath.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/tgmath.h
new file mode 100644
index 0000000..b146121
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/tgmath.h
@@ -0,0 +1,430 @@
+/* Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.22 Type-generic math <tgmath.h>
+ */
+
+#ifndef _TGMATH_H
+#define _TGMATH_H 1
+
+/* Include the needed headers. */
+#include <math.h>
+#include <complex.h>
+
+
+/* Since `complex' is currently not really implemented in most C compilers
+ and if it is implemented, the implementations differ. This makes it
+ quite difficult to write a generic implementation of this header. We
+ do not try this for now and instead concentrate only on GNU CC. Once
+ we have more information support for other compilers might follow. */
+
+#if __GNUC_PREREQ(2, 7)
+
+# ifdef __NO_LONG_DOUBLE_MATH
+# define __tgml(fct) fct
+# else
+# define __tgml(fct) fct ## l
+# endif
+
+/* This is ugly but unless gcc gets appropriate builtins we have to do
+ something like this. Don't ask how it works. */
+
+/* 1 if 'type' is a floating type, 0 if 'type' is an integer type.
+ Allows for _Bool. Expands to an integer constant expression. */
+# define __floating_type(type) (((type) 0.25) && ((type) 0.25 - 1))
+
+/* The tgmath real type for T, where E is 0 if T is an integer type and
+ 1 for a floating type. */
+# define __tgmath_real_type_sub(T, E) \
+ __typeof__(*(0 ? (__typeof__ (0 ? (double *) 0 : (void *) (E))) 0 \
+ : (__typeof__ (0 ? (T *) 0 : (void *) (!(E)))) 0))
+
+/* The tgmath real type of EXPR. */
+# define __tgmath_real_type(expr) \
+ __tgmath_real_type_sub(__typeof__(expr), __floating_type(__typeof__(expr)))
+
+
+/* We have two kinds of generic macros: to support functions which are
+ only defined on real valued parameters and those which are defined
+ for complex functions as well. */
+# define __TGMATH_UNARY_REAL_ONLY(Val, Fct) \
+ (__extension__ ({ __tgmath_real_type (Val) __tgmres; \
+ if (sizeof (Val) == sizeof (double) \
+ || __builtin_classify_type (Val) != 8) \
+ __tgmres = Fct (Val); \
+ else if (sizeof (Val) == sizeof (float)) \
+ __tgmres = Fct##f (Val); \
+ else \
+ __tgmres = __tgml(Fct) (Val); \
+ __tgmres; }))
+
+# define __TGMATH_BINARY_FIRST_REAL_ONLY(Val1, Val2, Fct) \
+ (__extension__ ({ __tgmath_real_type (Val1) __tgmres; \
+ if (sizeof (Val1) == sizeof (double) \
+ || __builtin_classify_type (Val1) != 8) \
+ __tgmres = Fct (Val1, Val2); \
+ else if (sizeof (Val1) == sizeof (float)) \
+ __tgmres = Fct##f (Val1, Val2); \
+ else \
+ __tgmres = __tgml(Fct) (Val1, Val2); \
+ __tgmres; }))
+
+# define __TGMATH_BINARY_REAL_ONLY(Val1, Val2, Fct) \
+ (__extension__ ({ __tgmath_real_type ((Val1) + (Val2)) __tgmres; \
+ if ((sizeof (Val1) > sizeof (double) \
+ || sizeof (Val2) > sizeof (double)) \
+ && __builtin_classify_type ((Val1) + (Val2)) == 8) \
+ __tgmres = __tgml(Fct) (Val1, Val2); \
+ else if (sizeof (Val1) == sizeof (double) \
+ || sizeof (Val2) == sizeof (double) \
+ || __builtin_classify_type (Val1) != 8 \
+ || __builtin_classify_type (Val2) != 8) \
+ __tgmres = Fct (Val1, Val2); \
+ else \
+ __tgmres = Fct##f (Val1, Val2); \
+ __tgmres; }))
+
+# define __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY(Val1, Val2, Val3, Fct) \
+ (__extension__ ({ __tgmath_real_type ((Val1) + (Val2)) __tgmres; \
+ if ((sizeof (Val1) > sizeof (double) \
+ || sizeof (Val2) > sizeof (double)) \
+ && __builtin_classify_type ((Val1) + (Val2)) == 8) \
+ __tgmres = __tgml(Fct) (Val1, Val2, Val3); \
+ else if (sizeof (Val1) == sizeof (double) \
+ || sizeof (Val2) == sizeof (double) \
+ || __builtin_classify_type (Val1) != 8 \
+ || __builtin_classify_type (Val2) != 8) \
+ __tgmres = Fct (Val1, Val2, Val3); \
+ else \
+ __tgmres = Fct##f (Val1, Val2, Val3); \
+ __tgmres; }))
+
+# define __TGMATH_TERNARY_REAL_ONLY(Val1, Val2, Val3, Fct) \
+ (__extension__ ({ __tgmath_real_type ((Val1) + (Val2) + (Val3)) __tgmres;\
+ if ((sizeof (Val1) > sizeof (double) \
+ || sizeof (Val2) > sizeof (double) \
+ || sizeof (Val3) > sizeof (double)) \
+ && __builtin_classify_type ((Val1) + (Val2) \
+ + (Val3)) == 8) \
+ __tgmres = __tgml(Fct) (Val1, Val2, Val3); \
+ else if (sizeof (Val1) == sizeof (double) \
+ || sizeof (Val2) == sizeof (double) \
+ || sizeof (Val3) == sizeof (double) \
+ || __builtin_classify_type (Val1) != 8 \
+ || __builtin_classify_type (Val2) != 8 \
+ || __builtin_classify_type (Val3) != 8) \
+ __tgmres = Fct (Val1, Val2, Val3); \
+ else \
+ __tgmres = Fct##f (Val1, Val2, Val3); \
+ __tgmres; }))
+
+/* XXX This definition has to be changed as soon as the compiler understands
+ the imaginary keyword. */
+# define __TGMATH_UNARY_REAL_IMAG(Val, Fct, Cfct) \
+ (__extension__ ({ __tgmath_real_type (Val) __tgmres; \
+ if (sizeof (__real__ (Val)) > sizeof (double) \
+ && __builtin_classify_type (__real__ (Val)) == 8) \
+ { \
+ if (sizeof (__real__ (Val)) == sizeof (Val)) \
+ __tgmres = __tgml(Fct) (Val); \
+ else \
+ __tgmres = __tgml(Cfct) (Val); \
+ } \
+ else if (sizeof (__real__ (Val)) == sizeof (double) \
+ || __builtin_classify_type (__real__ (Val)) \
+ != 8) \
+ { \
+ if (sizeof (__real__ (Val)) == sizeof (Val)) \
+ __tgmres = Fct (Val); \
+ else \
+ __tgmres = Cfct (Val); \
+ } \
+ else \
+ { \
+ if (sizeof (__real__ (Val)) == sizeof (Val)) \
+ __tgmres = Fct##f (Val); \
+ else \
+ __tgmres = Cfct##f (Val); \
+ } \
+ __tgmres; }))
+
+/* XXX This definition has to be changed as soon as the compiler understands
+ the imaginary keyword. */
+# define __TGMATH_UNARY_IMAG_ONLY(Val, Fct) \
+ (__extension__ ({ __tgmath_real_type (Val) __tgmres; \
+ if (sizeof (Val) == sizeof (__complex__ double) \
+ || __builtin_classify_type (__real__ (Val)) != 8) \
+ __tgmres = Fct (Val); \
+ else if (sizeof (Val) == sizeof (__complex__ float)) \
+ __tgmres = Fct##f (Val); \
+ else \
+ __tgmres = __tgml(Fct) (Val); \
+ __tgmres; }))
+
+/* XXX This definition has to be changed as soon as the compiler understands
+ the imaginary keyword. */
+# define __TGMATH_BINARY_REAL_IMAG(Val1, Val2, Fct, Cfct) \
+ (__extension__ ({ __tgmath_real_type ((Val1) + (Val2)) __tgmres; \
+ if ((sizeof (__real__ (Val1)) > sizeof (double) \
+ || sizeof (__real__ (Val2)) > sizeof (double)) \
+ && __builtin_classify_type (__real__ (Val1) \
+ + __real__ (Val2)) \
+ == 8) \
+ { \
+ if (sizeof (__real__ (Val1)) == sizeof (Val1) \
+ && sizeof (__real__ (Val2)) == sizeof (Val2)) \
+ __tgmres = __tgml(Fct) (Val1, Val2); \
+ else \
+ __tgmres = __tgml(Cfct) (Val1, Val2); \
+ } \
+ else if (sizeof (__real__ (Val1)) == sizeof (double) \
+ || sizeof (__real__ (Val2)) == sizeof(double) \
+ || (__builtin_classify_type (__real__ (Val1)) \
+ != 8) \
+ || (__builtin_classify_type (__real__ (Val2)) \
+ != 8)) \
+ { \
+ if (sizeof (__real__ (Val1)) == sizeof (Val1) \
+ && sizeof (__real__ (Val2)) == sizeof (Val2)) \
+ __tgmres = Fct (Val1, Val2); \
+ else \
+ __tgmres = Cfct (Val1, Val2); \
+ } \
+ else \
+ { \
+ if (sizeof (__real__ (Val1)) == sizeof (Val1) \
+ && sizeof (__real__ (Val2)) == sizeof (Val2)) \
+ __tgmres = Fct##f (Val1, Val2); \
+ else \
+ __tgmres = Cfct##f (Val1, Val2); \
+ } \
+ __tgmres; }))
+#else
+# error "Unsupported compiler; you cannot use <tgmath.h>"
+#endif
+
+
+/* Unary functions defined for real and complex values. */
+
+
+/* Trigonometric functions. */
+
+/* Arc cosine of X. */
+#define acos(Val) __TGMATH_UNARY_REAL_IMAG (Val, acos, cacos)
+/* Arc sine of X. */
+#define asin(Val) __TGMATH_UNARY_REAL_IMAG (Val, asin, casin)
+/* Arc tangent of X. */
+#define atan(Val) __TGMATH_UNARY_REAL_IMAG (Val, atan, catan)
+/* Arc tangent of Y/X. */
+#define atan2(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, atan2)
+
+/* Cosine of X. */
+#define cos(Val) __TGMATH_UNARY_REAL_IMAG (Val, cos, ccos)
+/* Sine of X. */
+#define sin(Val) __TGMATH_UNARY_REAL_IMAG (Val, sin, csin)
+/* Tangent of X. */
+#define tan(Val) __TGMATH_UNARY_REAL_IMAG (Val, tan, ctan)
+
+
+/* Hyperbolic functions. */
+
+/* Hyperbolic arc cosine of X. */
+#define acosh(Val) __TGMATH_UNARY_REAL_IMAG (Val, acosh, cacosh)
+/* Hyperbolic arc sine of X. */
+#define asinh(Val) __TGMATH_UNARY_REAL_IMAG (Val, asinh, casinh)
+/* Hyperbolic arc tangent of X. */
+#define atanh(Val) __TGMATH_UNARY_REAL_IMAG (Val, atanh, catanh)
+
+/* Hyperbolic cosine of X. */
+#define cosh(Val) __TGMATH_UNARY_REAL_IMAG (Val, cosh, ccosh)
+/* Hyperbolic sine of X. */
+#define sinh(Val) __TGMATH_UNARY_REAL_IMAG (Val, sinh, csinh)
+/* Hyperbolic tangent of X. */
+#define tanh(Val) __TGMATH_UNARY_REAL_IMAG (Val, tanh, ctanh)
+
+
+/* Exponential and logarithmic functions. */
+
+/* Exponential function of X. */
+#define exp(Val) __TGMATH_UNARY_REAL_IMAG (Val, exp, cexp)
+
+/* Break VALUE into a normalized fraction and an integral power of 2. */
+#define frexp(Val1, Val2) __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, frexp)
+
+/* X times (two to the EXP power). */
+#define ldexp(Val1, Val2) __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, ldexp)
+
+/* Natural logarithm of X. */
+#define log(Val) __TGMATH_UNARY_REAL_IMAG (Val, log, clog)
+
+/* Base-ten logarithm of X. */
+#ifdef __USE_GNU
+# define log10(Val) __TGMATH_UNARY_REAL_IMAG (Val, log10, __clog10)
+#else
+# define log10(Val) __TGMATH_UNARY_REAL_ONLY (Val, log10)
+#endif
+
+/* Return exp(X) - 1. */
+#define expm1(Val) __TGMATH_UNARY_REAL_ONLY (Val, expm1)
+
+/* Return log(1 + X). */
+#define log1p(Val) __TGMATH_UNARY_REAL_ONLY (Val, log1p)
+
+/* Return the base 2 signed integral exponent of X. */
+#define logb(Val) __TGMATH_UNARY_REAL_ONLY (Val, logb)
+
+/* Compute base-2 exponential of X. */
+#define exp2(Val) __TGMATH_UNARY_REAL_ONLY (Val, exp2)
+
+/* Compute base-2 logarithm of X. */
+#define log2(Val) __TGMATH_UNARY_REAL_ONLY (Val, log2)
+
+
+/* Power functions. */
+
+/* Return X to the Y power. */
+#define pow(Val1, Val2) __TGMATH_BINARY_REAL_IMAG (Val1, Val2, pow, cpow)
+
+/* Return the square root of X. */
+#define sqrt(Val) __TGMATH_UNARY_REAL_IMAG (Val, sqrt, csqrt)
+
+/* Return `sqrt(X*X + Y*Y)'. */
+#define hypot(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, hypot)
+
+/* Return the cube root of X. */
+#define cbrt(Val) __TGMATH_UNARY_REAL_ONLY (Val, cbrt)
+
+
+/* Nearest integer, absolute value, and remainder functions. */
+
+/* Smallest integral value not less than X. */
+#define ceil(Val) __TGMATH_UNARY_REAL_ONLY (Val, ceil)
+
+/* Absolute value of X. */
+#define fabs(Val) __TGMATH_UNARY_REAL_IMAG (Val, fabs, cabs)
+
+/* Largest integer not greater than X. */
+#define floor(Val) __TGMATH_UNARY_REAL_ONLY (Val, floor)
+
+/* Floating-point modulo remainder of X/Y. */
+#define fmod(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fmod)
+
+/* Round X to integral valuein floating-point format using current
+ rounding direction, but do not raise inexact exception. */
+#define nearbyint(Val) __TGMATH_UNARY_REAL_ONLY (Val, nearbyint)
+
+/* Round X to nearest integral value, rounding halfway cases away from
+ zero. */
+#define round(Val) __TGMATH_UNARY_REAL_ONLY (Val, round)
+
+/* Round X to the integral value in floating-point format nearest but
+ not larger in magnitude. */
+#define trunc(Val) __TGMATH_UNARY_REAL_ONLY (Val, trunc)
+
+/* Compute remainder of X and Y and put in *QUO a value with sign of x/y
+ and magnitude congruent `mod 2^n' to the magnitude of the integral
+ quotient x/y, with n >= 3. */
+#define remquo(Val1, Val2, Val3) \
+ __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY (Val1, Val2, Val3, remquo)
+
+/* Round X to nearest integral value according to current rounding
+ direction. */
+#define lrint(Val) __TGMATH_UNARY_REAL_ONLY (Val, lrint)
+#define llrint(Val) __TGMATH_UNARY_REAL_ONLY (Val, llrint)
+
+/* Round X to nearest integral value, rounding halfway cases away from
+ zero. */
+#define lround(Val) __TGMATH_UNARY_REAL_ONLY (Val, lround)
+#define llround(Val) __TGMATH_UNARY_REAL_ONLY (Val, llround)
+
+
+/* Return X with its signed changed to Y's. */
+#define copysign(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, copysign)
+
+/* Error and gamma functions. */
+#define erf(Val) __TGMATH_UNARY_REAL_ONLY (Val, erf)
+#define erfc(Val) __TGMATH_UNARY_REAL_ONLY (Val, erfc)
+#define tgamma(Val) __TGMATH_UNARY_REAL_ONLY (Val, tgamma)
+#define lgamma(Val) __TGMATH_UNARY_REAL_ONLY (Val, lgamma)
+
+
+/* Return the integer nearest X in the direction of the
+ prevailing rounding mode. */
+#define rint(Val) __TGMATH_UNARY_REAL_ONLY (Val, rint)
+
+/* Return X + epsilon if X < Y, X - epsilon if X > Y. */
+#define nextafter(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, nextafter)
+#define nexttoward(Val1, Val2) \
+ __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, nexttoward)
+
+/* Return the remainder of integer divison X / Y with infinite precision. */
+#define remainder(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, remainder)
+
+/* Return X times (2 to the Nth power). */
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
+# define scalb(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, scalb)
+#endif
+
+/* Return X times (2 to the Nth power). */
+#define scalbn(Val1, Val2) __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, scalbn)
+
+/* Return X times (2 to the Nth power). */
+#define scalbln(Val1, Val2) \
+ __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, scalbln)
+
+/* Return the binary exponent of X, which must be nonzero. */
+#define ilogb(Val) __TGMATH_UNARY_REAL_ONLY (Val, ilogb)
+
+
+/* Return positive difference between X and Y. */
+#define fdim(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fdim)
+
+/* Return maximum numeric value from X and Y. */
+#define fmax(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fmax)
+
+/* Return minimum numeric value from X and Y. */
+#define fmin(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fmin)
+
+
+/* Multiply-add function computed as a ternary operation. */
+#define fma(Val1, Val2, Val3) \
+ __TGMATH_TERNARY_REAL_ONLY (Val1, Val2, Val3, fma)
+
+
+/* Absolute value, conjugates, and projection. */
+
+/* Argument value of Z. */
+#define carg(Val) __TGMATH_UNARY_IMAG_ONLY (Val, carg)
+
+/* Complex conjugate of Z. */
+#define conj(Val) __TGMATH_UNARY_IMAG_ONLY (Val, conj)
+
+/* Projection of Z onto the Riemann sphere. */
+#define cproj(Val) __TGMATH_UNARY_IMAG_ONLY (Val, cproj)
+
+
+/* Decomposing complex values. */
+
+/* Imaginary part of Z. */
+#define cimag(Val) __TGMATH_UNARY_IMAG_ONLY (Val, cimag)
+
+/* Real part of Z. */
+#define creal(Val) __TGMATH_UNARY_IMAG_ONLY (Val, creal)
+
+#endif /* tgmath.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/thread_db.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/thread_db.h
new file mode 100644
index 0000000..c115399
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/thread_db.h
@@ -0,0 +1,459 @@
+/* thread_db.h -- interface to libthread_db.so library for debugging -lpthread
+ Copyright (C) 1999,2001,2002,2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _THREAD_DB_H
+#define _THREAD_DB_H 1
+
+/* This is the debugger interface for the LinuxThreads library. It is
+ modelled closely after the interface with same names in Solaris with
+ the goal to share the same code in the debugger. */
+#include <pthread.h>
+#include <stdint.h>
+#include <sys/types.h>
+#include <sys/procfs.h>
+
+
+/* Error codes of the library. */
+typedef enum
+{
+ TD_OK, /* No error. */
+ TD_ERR, /* No further specified error. */
+ TD_NOTHR, /* No matching thread found. */
+ TD_NOSV, /* No matching synchronization handle found. */
+ TD_NOLWP, /* No matching light-weighted process found. */
+ TD_BADPH, /* Invalid process handle. */
+ TD_BADTH, /* Invalid thread handle. */
+ TD_BADSH, /* Invalid synchronization handle. */
+ TD_BADTA, /* Invalid thread agent. */
+ TD_BADKEY, /* Invalid key. */
+ TD_NOMSG, /* No event available. */
+ TD_NOFPREGS, /* No floating-point register content available. */
+ TD_NOLIBTHREAD, /* Application not linked with thread library. */
+ TD_NOEVENT, /* Requested event is not supported. */
+ TD_NOCAPAB, /* Capability not available. */
+ TD_DBERR, /* Internal debug library error. */
+ TD_NOAPLIC, /* Operation is not applicable. */
+ TD_NOTSD, /* No thread-specific data available. */
+ TD_MALLOC, /* Out of memory. */
+ TD_PARTIALREG, /* Not entire register set was read or written. */
+ TD_NOXREGS, /* X register set not available for given thread. */
+ TD_TLSDEFER, /* Thread has not yet allocated TLS for given module. */
+ TD_NOTALLOC = TD_TLSDEFER,
+ TD_VERSION, /* Version if libpthread and libthread_db do not match. */
+ TD_NOTLS /* There is TLS segment in the given module. */
+} td_err_e;
+
+
+/* Possible thread states. TD_THR_ANY_STATE is a pseudo-state used to
+ select threads regardless of state in td_ta_thr_iter(). */
+typedef enum
+{
+ TD_THR_ANY_STATE,
+ TD_THR_UNKNOWN,
+ TD_THR_STOPPED,
+ TD_THR_RUN,
+ TD_THR_ACTIVE,
+ TD_THR_ZOMBIE,
+ TD_THR_SLEEP,
+ TD_THR_STOPPED_ASLEEP
+} td_thr_state_e;
+
+/* Thread type: user or system. TD_THR_ANY_TYPE is a pseudo-type used
+ to select threads regardless of type in td_ta_thr_iter(). */
+typedef enum
+{
+ TD_THR_ANY_TYPE,
+ TD_THR_USER,
+ TD_THR_SYSTEM
+} td_thr_type_e;
+
+
+/* Types of the debugging library. */
+
+/* Handle for a process. This type is opaque. */
+typedef struct td_thragent td_thragent_t;
+
+/* The actual thread handle type. This is also opaque. */
+typedef struct td_thrhandle
+{
+ td_thragent_t *th_ta_p;
+ psaddr_t th_unique;
+} td_thrhandle_t;
+
+
+/* Forward declaration of a type defined by and for the dynamic linker. */
+struct link_map;
+
+
+/* Flags for `td_ta_thr_iter'. */
+#define TD_THR_ANY_USER_FLAGS 0xffffffff
+#define TD_THR_LOWEST_PRIORITY -20
+#define TD_SIGNO_MASK NULL
+
+
+#define TD_EVENTSIZE 2
+#define BT_UISHIFT 5 /* log base 2 of BT_NBIPUI, to extract word index */
+#define BT_NBIPUI (1 << BT_UISHIFT) /* n bits per uint */
+#define BT_UIMASK (BT_NBIPUI - 1) /* to extract bit index */
+
+/* Bitmask of enabled events. */
+typedef struct td_thr_events
+{
+ uint32_t event_bits[TD_EVENTSIZE];
+} td_thr_events_t;
+
+/* Event set manipulation macros. */
+#define __td_eventmask(n) \
+ (UINT32_C (1) << (((n) - 1) & BT_UIMASK))
+#define __td_eventword(n) \
+ ((UINT32_C ((n) - 1)) >> BT_UISHIFT)
+
+#define td_event_emptyset(setp) \
+ do { \
+ int __i; \
+ for (__i = TD_EVENTSIZE; __i > 0; --__i) \
+ (setp)->event_bits[__i - 1] = 0; \
+ } while (0)
+
+#define td_event_fillset(setp) \
+ do { \
+ int __i; \
+ for (__i = TD_EVENTSIZE; __i > 0; --__i) \
+ (setp)->event_bits[__i - 1] = UINT32_C (0xffffffff); \
+ } while (0)
+
+#define td_event_addset(setp, n) \
+ (((setp)->event_bits[__td_eventword (n)]) |= __td_eventmask (n))
+#define td_event_delset(setp, n) \
+ (((setp)->event_bits[__td_eventword (n)]) &= ~__td_eventmask (n))
+#define td_eventismember(setp, n) \
+ (__td_eventmask (n) & ((setp)->event_bits[__td_eventword (n)]))
+#if TD_EVENTSIZE == 2
+# define td_eventisempty(setp) \
+ (!((setp)->event_bits[0]) && !((setp)->event_bits[1]))
+#else
+# error "td_eventisempty must be changed to match TD_EVENTSIZE"
+#endif
+
+/* Events reportable by the thread implementation. */
+typedef enum
+{
+ TD_ALL_EVENTS, /* Pseudo-event number. */
+ TD_EVENT_NONE = TD_ALL_EVENTS, /* Depends on context. */
+ TD_READY, /* Is executable now. */
+ TD_SLEEP, /* Blocked in a synchronization obj. */
+ TD_SWITCHTO, /* Now assigned to a process. */
+ TD_SWITCHFROM, /* Not anymore assigned to a process. */
+ TD_LOCK_TRY, /* Trying to get an unavailable lock. */
+ TD_CATCHSIG, /* Signal posted to the thread. */
+ TD_IDLE, /* Process getting idle. */
+ TD_CREATE, /* New thread created. */
+ TD_DEATH, /* Thread terminated. */
+ TD_PREEMPT, /* Preempted. */
+ TD_PRI_INHERIT, /* Inherited elevated priority. */
+ TD_REAP, /* Reaped. */
+ TD_CONCURRENCY, /* Number of processes changing. */
+ TD_TIMEOUT, /* Conditional variable wait timed out. */
+ TD_MIN_EVENT_NUM = TD_READY,
+ TD_MAX_EVENT_NUM = TD_TIMEOUT,
+ TD_EVENTS_ENABLE = 31 /* Event reporting enabled. */
+} td_event_e;
+
+/* Values representing the different ways events are reported. */
+typedef enum
+{
+ NOTIFY_BPT, /* User must insert breakpoint at u.bptaddr. */
+ NOTIFY_AUTOBPT, /* Breakpoint at u.bptaddr is automatically
+ inserted. */
+ NOTIFY_SYSCALL /* System call u.syscallno will be invoked. */
+} td_notify_e;
+
+/* Description how event type is reported. */
+typedef struct td_notify
+{
+ td_notify_e type; /* Way the event is reported. */
+ union
+ {
+ psaddr_t bptaddr; /* Address of breakpoint. */
+ int syscallno; /* Number of system call used. */
+ } u;
+} td_notify_t;
+
+/* Structure used to report event. */
+typedef struct td_event_msg
+{
+ td_event_e event; /* Event type being reported. */
+ const td_thrhandle_t *th_p; /* Thread reporting the event. */
+ union
+ {
+# if 0
+ td_synchandle_t *sh; /* Handle of synchronization object. */
+#endif
+ uintptr_t data; /* Event specific data. */
+ } msg;
+} td_event_msg_t;
+
+/* Structure containing event data available in each thread structure. */
+typedef struct
+{
+ td_thr_events_t eventmask; /* Mask of enabled events. */
+ td_event_e eventnum; /* Number of last event. */
+ void *eventdata; /* Data associated with event. */
+} td_eventbuf_t;
+
+
+/* Gathered statistics about the process. */
+typedef struct td_ta_stats
+{
+ int nthreads; /* Total number of threads in use. */
+ int r_concurrency; /* Concurrency level requested by user. */
+ int nrunnable_num; /* Average runnable threads, numerator. */
+ int nrunnable_den; /* Average runnable threads, denominator. */
+ int a_concurrency_num; /* Achieved concurrency level, numerator. */
+ int a_concurrency_den; /* Achieved concurrency level, denominator. */
+ int nlwps_num; /* Average number of processes in use,
+ numerator. */
+ int nlwps_den; /* Average number of processes in use,
+ denominator. */
+ int nidle_num; /* Average number of idling processes,
+ numerator. */
+ int nidle_den; /* Average number of idling processes,
+ denominator. */
+} td_ta_stats_t;
+
+
+/* Since Sun's library is based on Solaris threads we have to define a few
+ types to map them to POSIX threads. */
+typedef pthread_t thread_t;
+typedef pthread_key_t thread_key_t;
+
+
+/* Callback for iteration over threads. */
+typedef int td_thr_iter_f (const td_thrhandle_t *, void *);
+
+/* Callback for iteration over thread local data. */
+typedef int td_key_iter_f (thread_key_t, void (*) (void *), void *);
+
+
+
+/* Forward declaration. This has to be defined by the user. */
+struct ps_prochandle;
+
+
+/* Information about the thread. */
+typedef struct td_thrinfo
+{
+ td_thragent_t *ti_ta_p; /* Process handle. */
+ unsigned int ti_user_flags; /* Unused. */
+ thread_t ti_tid; /* Thread ID returned by
+ pthread_create(). */
+ char *ti_tls; /* Pointer to thread-local data. */
+ psaddr_t ti_startfunc; /* Start function passed to
+ pthread_create(). */
+ psaddr_t ti_stkbase; /* Base of thread's stack. */
+ long int ti_stksize; /* Size of thread's stack. */
+ psaddr_t ti_ro_area; /* Unused. */
+ int ti_ro_size; /* Unused. */
+ td_thr_state_e ti_state; /* Thread state. */
+ unsigned char ti_db_suspended; /* Nonzero if suspended by debugger. */
+ td_thr_type_e ti_type; /* Type of the thread (system vs
+ user thread). */
+ intptr_t ti_pc; /* Unused. */
+ intptr_t ti_sp; /* Unused. */
+ short int ti_flags; /* Unused. */
+ int ti_pri; /* Thread priority. */
+ lwpid_t ti_lid; /* Unused. */
+ sigset_t ti_sigmask; /* Signal mask. */
+ unsigned char ti_traceme; /* Nonzero if event reporting
+ enabled. */
+ unsigned char ti_preemptflag; /* Unused. */
+ unsigned char ti_pirecflag; /* Unused. */
+ sigset_t ti_pending; /* Set of pending signals. */
+ td_thr_events_t ti_events; /* Set of enabled events. */
+} td_thrinfo_t;
+
+
+
+/* Prototypes for exported library functions. */
+
+/* Initialize the thread debug support library. */
+extern td_err_e td_init (void);
+
+/* Historical relict. Should not be used anymore. */
+extern td_err_e td_log (void);
+
+/* Return list of symbols the library can request. */
+extern const char **td_symbol_list (void);
+
+/* Generate new thread debug library handle for process PS. */
+extern td_err_e td_ta_new (struct ps_prochandle *__ps, td_thragent_t **__ta);
+
+/* Free resources allocated for TA. */
+extern td_err_e td_ta_delete (td_thragent_t *__ta);
+
+/* Get number of currently running threads in process associated with TA. */
+extern td_err_e td_ta_get_nthreads (const td_thragent_t *__ta, int *__np);
+
+/* Return process handle passed in `td_ta_new' for process associated with
+ TA. */
+extern td_err_e td_ta_get_ph (const td_thragent_t *__ta,
+ struct ps_prochandle **__ph);
+
+/* Map thread library handle PT to thread debug library handle for process
+ associated with TA and store result in *TH. */
+extern td_err_e td_ta_map_id2thr (const td_thragent_t *__ta, pthread_t __pt,
+ td_thrhandle_t *__th);
+
+/* Map process ID LWPID to thread debug library handle for process
+ associated with TA and store result in *TH. */
+extern td_err_e td_ta_map_lwp2thr (const td_thragent_t *__ta, lwpid_t __lwpid,
+ td_thrhandle_t *__th);
+
+
+/* Call for each thread in a process associated with TA the callback function
+ CALLBACK. */
+extern td_err_e td_ta_thr_iter (const td_thragent_t *__ta,
+ td_thr_iter_f *__callback, void *__cbdata_p,
+ td_thr_state_e __state, int __ti_pri,
+ sigset_t *__ti_sigmask_p,
+ unsigned int __ti_user_flags);
+
+/* Call for each defined thread local data entry the callback function KI. */
+extern td_err_e td_ta_tsd_iter (const td_thragent_t *__ta, td_key_iter_f *__ki,
+ void *__p);
+
+
+/* Get event address for EVENT. */
+extern td_err_e td_ta_event_addr (const td_thragent_t *__ta,
+ td_event_e __event, td_notify_t *__ptr);
+
+/* Enable EVENT in global mask. */
+extern td_err_e td_ta_set_event (const td_thragent_t *__ta,
+ td_thr_events_t *__event);
+
+/* Disable EVENT in global mask. */
+extern td_err_e td_ta_clear_event (const td_thragent_t *__ta,
+ td_thr_events_t *__event);
+
+/* Return information about last event. */
+extern td_err_e td_ta_event_getmsg (const td_thragent_t *__ta,
+ td_event_msg_t *__msg);
+
+
+/* Set suggested concurrency level for process associated with TA. */
+extern td_err_e td_ta_setconcurrency (const td_thragent_t *__ta, int __level);
+
+
+/* Enable collecting statistics for process associated with TA. */
+extern td_err_e td_ta_enable_stats (const td_thragent_t *__ta, int __enable);
+
+/* Reset statistics. */
+extern td_err_e td_ta_reset_stats (const td_thragent_t *__ta);
+
+/* Retrieve statistics from process associated with TA. */
+extern td_err_e td_ta_get_stats (const td_thragent_t *__ta,
+ td_ta_stats_t *__statsp);
+
+
+/* Validate that TH is a thread handle. */
+extern td_err_e td_thr_validate (const td_thrhandle_t *__th);
+
+/* Return information about thread TH. */
+extern td_err_e td_thr_get_info (const td_thrhandle_t *__th,
+ td_thrinfo_t *__infop);
+
+/* Retrieve floating-point register contents of process running thread TH. */
+extern td_err_e td_thr_getfpregs (const td_thrhandle_t *__th,
+ prfpregset_t *__regset);
+
+/* Retrieve general register contents of process running thread TH. */
+extern td_err_e td_thr_getgregs (const td_thrhandle_t *__th,
+ prgregset_t __gregs);
+
+/* Retrieve extended register contents of process running thread TH. */
+extern td_err_e td_thr_getxregs (const td_thrhandle_t *__th, void *__xregs);
+
+/* Get size of extended register set of process running thread TH. */
+extern td_err_e td_thr_getxregsize (const td_thrhandle_t *__th, int *__sizep);
+
+/* Set floating-point register contents of process running thread TH. */
+extern td_err_e td_thr_setfpregs (const td_thrhandle_t *__th,
+ const prfpregset_t *__fpregs);
+
+/* Set general register contents of process running thread TH. */
+extern td_err_e td_thr_setgregs (const td_thrhandle_t *__th,
+ prgregset_t __gregs);
+
+/* Set extended register contents of process running thread TH. */
+extern td_err_e td_thr_setxregs (const td_thrhandle_t *__th,
+ const void *__addr);
+
+
+/* Get address of the given module's TLS storage area for the given thread. */
+extern td_err_e td_thr_tlsbase (const td_thrhandle_t *__th,
+ unsigned long int __modid,
+ psaddr_t *__base);
+
+/* Get address of thread local variable. */
+extern td_err_e td_thr_tls_get_addr (const td_thrhandle_t *__th,
+ void *__map_address, size_t __offset,
+ void **__address);
+
+
+/* Enable reporting for EVENT for thread TH. */
+extern td_err_e td_thr_event_enable (const td_thrhandle_t *__th, int __event);
+
+/* Enable EVENT for thread TH. */
+extern td_err_e td_thr_set_event (const td_thrhandle_t *__th,
+ td_thr_events_t *__event);
+
+/* Disable EVENT for thread TH. */
+extern td_err_e td_thr_clear_event (const td_thrhandle_t *__th,
+ td_thr_events_t *__event);
+
+/* Get event message for thread TH. */
+extern td_err_e td_thr_event_getmsg (const td_thrhandle_t *__th,
+ td_event_msg_t *__msg);
+
+
+/* Set priority of thread TH. */
+extern td_err_e td_thr_setprio (const td_thrhandle_t *__th, int __prio);
+
+
+/* Set pending signals for thread TH. */
+extern td_err_e td_thr_setsigpending (const td_thrhandle_t *__th,
+ unsigned char __n, const sigset_t *__ss);
+
+/* Set signal mask for thread TH. */
+extern td_err_e td_thr_sigsetmask (const td_thrhandle_t *__th,
+ const sigset_t *__ss);
+
+
+/* Return thread local data associated with key TK in thread TH. */
+extern td_err_e td_thr_tsd (const td_thrhandle_t *__th,
+ const thread_key_t __tk, void **__data);
+
+
+/* Suspend execution of thread TH. */
+extern td_err_e td_thr_dbsuspend (const td_thrhandle_t *__th);
+
+/* Resume execution of thread TH. */
+extern td_err_e td_thr_dbresume (const td_thrhandle_t *__th);
+
+#endif /* thread_db.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/time.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/time.h
new file mode 100644
index 0000000..425b71b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/time.h
@@ -0,0 +1,435 @@
+/* Copyright (C) 1991-1999,2000,2001,2002,2003,2006
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.23 Date and time <time.h>
+ */
+
+#ifndef _TIME_H
+
+#if (! defined __need_time_t && !defined __need_clock_t && \
+ ! defined __need_timespec)
+# define _TIME_H 1
+# include <features.h>
+
+__BEGIN_DECLS
+
+#endif
+
+#ifdef _TIME_H
+/* Get size_t and NULL from <stddef.h>. */
+# define __need_size_t
+# define __need_NULL
+# include <stddef.h>
+
+/* This defines CLOCKS_PER_SEC, which is the number of processor clock
+ ticks per second. */
+# include <bits/time.h>
+
+/* This is the obsolete POSIX.1-1988 name for the same constant. */
+# if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K
+# ifndef CLK_TCK
+# define CLK_TCK CLOCKS_PER_SEC
+# endif
+# endif
+
+#endif /* <time.h> included. */
+
+#if !defined __clock_t_defined && (defined _TIME_H || defined __need_clock_t)
+# define __clock_t_defined 1
+
+# include <bits/types.h>
+
+__BEGIN_NAMESPACE_STD
+/* Returned by `clock'. */
+typedef __clock_t clock_t;
+__END_NAMESPACE_STD
+#if defined __USE_XOPEN || defined __USE_POSIX || defined __USE_MISC
+__USING_NAMESPACE_STD(clock_t)
+#endif
+
+#endif /* clock_t not defined and <time.h> or need clock_t. */
+#undef __need_clock_t
+
+#if !defined __time_t_defined && (defined _TIME_H || defined __need_time_t)
+# define __time_t_defined 1
+
+# include <bits/types.h>
+
+__BEGIN_NAMESPACE_STD
+/* Returned by `time'. */
+typedef __time_t time_t;
+__END_NAMESPACE_STD
+#if defined __USE_POSIX || defined __USE_MISC || defined __USE_SVID
+__USING_NAMESPACE_STD(time_t)
+#endif
+
+#endif /* time_t not defined and <time.h> or need time_t. */
+#undef __need_time_t
+
+#if !defined __clockid_t_defined && \
+ ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_clockid_t)
+# define __clockid_t_defined 1
+
+# include <bits/types.h>
+
+/* Clock ID used in clock and timer functions. */
+typedef __clockid_t clockid_t;
+
+#endif /* clockid_t not defined and <time.h> or need clockid_t. */
+#undef __clockid_time_t
+
+#if !defined __timer_t_defined && \
+ ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_timer_t)
+# define __timer_t_defined 1
+
+# include <bits/types.h>
+
+/* Timer ID returned by `timer_create'. */
+typedef __timer_t timer_t;
+
+#endif /* timer_t not defined and <time.h> or need timer_t. */
+#undef __need_timer_t
+
+
+#if !defined __timespec_defined && \
+ ((defined _TIME_H && \
+ (defined __USE_POSIX199309 || defined __USE_MISC)) || \
+ defined __need_timespec)
+# define __timespec_defined 1
+
+# include <bits/types.h> /* This defines __time_t for us. */
+
+/* POSIX.1b structure for a time value. This is like a `struct timeval' but
+ has nanoseconds instead of microseconds. */
+struct timespec
+ {
+ __time_t tv_sec; /* Seconds. */
+ long int tv_nsec; /* Nanoseconds. */
+ };
+
+#endif /* timespec not defined and <time.h> or need timespec. */
+#undef __need_timespec
+
+
+#ifdef _TIME_H
+__BEGIN_NAMESPACE_STD
+/* Used by other time functions. */
+struct tm
+{
+ int tm_sec; /* Seconds. [0-60] (1 leap second) */
+ int tm_min; /* Minutes. [0-59] */
+ int tm_hour; /* Hours. [0-23] */
+ int tm_mday; /* Day. [1-31] */
+ int tm_mon; /* Month. [0-11] */
+ int tm_year; /* Year - 1900. */
+ int tm_wday; /* Day of week. [0-6] */
+ int tm_yday; /* Days in year.[0-365] */
+ int tm_isdst; /* DST. [-1/0/1]*/
+
+#ifdef __UCLIBC_HAS_TM_EXTENSIONS__
+#ifdef __USE_BSD
+ long int tm_gmtoff; /* Seconds east of UTC. */
+ __const char *tm_zone; /* Timezone abbreviation. */
+#else
+ long int __tm_gmtoff; /* Seconds east of UTC. */
+ __const char *__tm_zone; /* Timezone abbreviation. */
+#endif
+#endif /* __UCLIBC_HAS_TM_EXTENSIONS__ */
+};
+__END_NAMESPACE_STD
+#if defined __USE_XOPEN || defined __USE_POSIX || defined __USE_MISC
+__USING_NAMESPACE_STD(tm)
+#endif
+
+
+#ifdef __USE_POSIX199309
+/* POSIX.1b structure for timer start values and intervals. */
+struct itimerspec
+ {
+ struct timespec it_interval;
+ struct timespec it_value;
+ };
+
+/* We can use a simple forward declaration. */
+struct sigevent;
+
+#endif /* POSIX.1b */
+
+#ifdef __USE_XOPEN2K
+# ifndef __pid_t_defined
+typedef __pid_t pid_t;
+# define __pid_t_defined
+# endif
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Time used by the program so far (user time + system time).
+ The result / CLOCKS_PER_SECOND is program time in seconds. */
+extern clock_t clock (void) __THROW;
+
+/* Return the current time and put it in *TIMER if TIMER is not NULL. */
+extern time_t time (time_t *__timer) __THROW;
+
+#ifdef __UCLIBC_HAS_FLOATS__
+/* Return the difference between TIME1 and TIME0. */
+extern double difftime (time_t __time1, time_t __time0)
+ __THROW __attribute__ ((__const__));
+#endif /* __UCLIBC_HAS_FLOATS__ */
+
+/* Return the `time_t' representation of TP and normalize TP. */
+extern time_t mktime (struct tm *__tp) __THROW;
+
+
+/* Format TP into S according to FORMAT.
+ Write no more than MAXSIZE characters and return the number
+ of characters written, or 0 if it would exceed MAXSIZE. */
+extern size_t strftime (char *__restrict __s, size_t __maxsize,
+ __const char *__restrict __format,
+ __const struct tm *__restrict __tp) __THROW;
+__END_NAMESPACE_STD
+
+# ifdef __USE_XOPEN
+/* Parse S according to FORMAT and store binary time information in TP.
+ The return value is a pointer to the first unparsed character in S. */
+extern char *strptime (__const char *__restrict __s,
+ __const char *__restrict __fmt, struct tm *__tp)
+ __THROW;
+# endif
+
+#ifdef __UCLIBC_HAS_XLOCALE__
+# ifdef __USE_GNU
+/* Similar to the two functions above but take the information from
+ the provided locale and not the global locale. */
+# include <xlocale.h>
+
+extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
+ __const char *__restrict __format,
+ __const struct tm *__restrict __tp,
+ __locale_t __loc) __THROW;
+
+extern char *strptime_l (__const char *__restrict __s,
+ __const char *__restrict __fmt, struct tm *__tp,
+ __locale_t __loc) __THROW;
+# endif
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Return the `struct tm' representation of *TIMER
+ in Universal Coordinated Time (aka Greenwich Mean Time). */
+extern struct tm *gmtime (__const time_t *__timer) __THROW;
+
+/* Return the `struct tm' representation
+ of *TIMER in the local timezone. */
+extern struct tm *localtime (__const time_t *__timer) __THROW;
+__END_NAMESPACE_STD
+
+# if defined __USE_POSIX || defined __USE_MISC
+/* Return the `struct tm' representation of *TIMER in UTC,
+ using *TP to store the result. */
+extern struct tm *gmtime_r (__const time_t *__restrict __timer,
+ struct tm *__restrict __tp) __THROW;
+
+/* Return the `struct tm' representation of *TIMER in local time,
+ using *TP to store the result. */
+extern struct tm *localtime_r (__const time_t *__restrict __timer,
+ struct tm *__restrict __tp) __THROW;
+# endif /* POSIX or misc */
+
+__BEGIN_NAMESPACE_STD
+/* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n"
+ that is the representation of TP in this format. */
+extern char *asctime (__const struct tm *__tp) __THROW;
+
+/* Equivalent to `asctime (localtime (timer))'. */
+extern char *ctime (__const time_t *__timer) __THROW;
+__END_NAMESPACE_STD
+
+# if defined __USE_POSIX || defined __USE_MISC
+/* Reentrant versions of the above functions. */
+
+/* Return in BUF a string of the form "Day Mon dd hh:mm:ss yyyy\n"
+ that is the representation of TP in this format. */
+extern char *asctime_r (__const struct tm *__restrict __tp,
+ char *__restrict __buf) __THROW;
+
+/* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'. */
+extern char *ctime_r (__const time_t *__restrict __timer,
+ char *__restrict __buf) __THROW;
+# endif /* POSIX or misc */
+
+
+/* Defined in localtime.c. */
+#ifdef __UCLIBC_MJN3_ONLY__
+#warning "mjn3 FIXME: __tzname, __daylight, and __timezone have a prototype but are not defined."
+extern char *__tzname[2]; /* Current timezone names. */
+extern int __daylight; /* If daylight-saving time is ever in use. */
+extern long int __timezone; /* Seconds west of UTC. */
+#endif /* __UCLIBC_MJN3_ONLY__ */
+
+
+# ifdef __USE_POSIX
+/* Same as above. */
+extern char *tzname[2];
+
+/* Set time conversion information from the TZ environment variable.
+ If TZ is not defined, a locale-dependent default is used. */
+extern void tzset (void) __THROW;
+# endif
+
+# if defined __USE_SVID || defined __USE_XOPEN
+extern int daylight;
+extern long int timezone;
+# endif
+
+# ifdef __USE_SVID
+/* Set the system time to *WHEN.
+ This call is restricted to the superuser. */
+extern int stime (__const time_t *__when) __THROW;
+# endif
+
+
+/* Nonzero if YEAR is a leap year (every 4 years,
+ except every 100th isn't, and every 400th is). */
+# define __isleap(year) \
+ ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
+
+
+# ifdef __USE_MISC
+/* Miscellaneous functions many Unices inherited from the public domain
+ localtime package. These are included only for compatibility. */
+
+/* Like `mktime', but for TP represents Universal Time, not local time. */
+extern time_t timegm (struct tm *__tp) __THROW;
+
+/* Another name for `mktime'. */
+extern time_t timelocal (struct tm *__tp) __THROW;
+
+/* Return the number of days in YEAR. */
+extern int dysize (int __year) __THROW __attribute__ ((__const__));
+# endif
+
+
+# ifdef __USE_POSIX199309
+/* Pause execution for a number of nanoseconds.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int nanosleep (__const struct timespec *__requested_time,
+ struct timespec *__remaining);
+
+
+/* Get resolution of clock CLOCK_ID. */
+extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __THROW;
+
+/* Get current value of clock CLOCK_ID and store it in TP. */
+extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __THROW;
+
+/* Set clock CLOCK_ID to value TP. */
+extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp)
+ __THROW;
+
+#ifdef __UCLIBC_MJN3_ONLY__
+#warning "mjn3 FIXME: a bunch of unimplemented function prototypes."
+# ifdef __USE_XOPEN2K
+/* High-resolution sleep with the specified clock.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int clock_nanosleep (clockid_t __clock_id, int __flags,
+ __const struct timespec *__req,
+ struct timespec *__rem);
+
+/* Return clock ID for CPU-time clock. */
+extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __THROW;
+# endif
+#endif /* __UCLIBC_MJN3_ONLY__ */
+
+
+/* Create new per-process timer using CLOCK_ID. */
+extern int timer_create (clockid_t __clock_id,
+ struct sigevent *__restrict __evp,
+ timer_t *__restrict __timerid) __THROW;
+
+/* Delete timer TIMERID. */
+extern int timer_delete (timer_t __timerid) __THROW;
+
+/* Set timer TIMERID to VALUE, returning old value in OVLAUE. */
+extern int timer_settime (timer_t __timerid, int __flags,
+ __const struct itimerspec *__restrict __value,
+ struct itimerspec *__restrict __ovalue) __THROW;
+
+/* Get current value of timer TIMERID and store it in VLAUE. */
+extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
+ __THROW;
+
+/* Get expiration overrun for timer TIMERID. */
+extern int timer_getoverrun (timer_t __timerid) __THROW;
+# endif
+
+
+#ifdef __UCLIBC_MJN3_ONLY__
+#warning "mjn3 FIXME: a bunch of unimplemented function prototypes."
+# ifdef __USE_XOPEN_EXTENDED
+/* Set to one of the following values to indicate an error.
+ 1 the DATEMSK environment variable is null or undefined,
+ 2 the template file cannot be opened for reading,
+ 3 failed to get file status information,
+ 4 the template file is not a regular file,
+ 5 an error is encountered while reading the template file,
+ 6 memory allication failed (not enough memory available),
+ 7 there is no line in the template that matches the input,
+ 8 invalid input specification Example: February 31 or a time is
+ specified that can not be represented in a time_t (representing
+ the time in seconds since 00:00:00 UTC, January 1, 1970) */
+extern int getdate_err;
+
+/* Parse the given string as a date specification and return a value
+ representing the value. The templates from the file identified by
+ the environment variable DATEMSK are used. In case of an error
+ `getdate_err' is set.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern struct tm *getdate (__const char *__string);
+# endif
+
+# ifdef __USE_GNU
+/* Since `getdate' is not reentrant because of the use of `getdate_err'
+ and the static buffer to return the result in, we provide a thread-safe
+ variant. The functionality is the same. The result is returned in
+ the buffer pointed to by RESBUFP and in case of an error the return
+ value is != 0 with the same values as given above for `getdate_err'.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int getdate_r (__const char *__restrict __string,
+ struct tm *__restrict __resbufp);
+# endif
+#endif /* __UCLIBC_MJN3_ONLY__ */
+
+__END_DECLS
+
+#endif /* <time.h> included. */
+
+#endif /* <time.h> not already included. */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/ttyent.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/ttyent.h
new file mode 100644
index 0000000..0b221bc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/ttyent.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ttyent.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _TTYENT_H
+#define _TTYENT_H 1
+
+#include <features.h>
+
+#define _PATH_TTYS "/etc/ttys"
+
+#define _TTYS_OFF "off"
+#define _TTYS_ON "on"
+#define _TTYS_SECURE "secure"
+#define _TTYS_WINDOW "window"
+
+struct ttyent {
+ char *ty_name; /* terminal device name */
+ char *ty_getty; /* command to execute, usually getty */
+ char *ty_type; /* terminal type for termcap */
+#define TTY_ON 0x01 /* enable logins (start ty_getty program) */
+#define TTY_SECURE 0x02 /* allow uid of 0 to login */
+ int ty_status; /* status flags */
+ char *ty_window; /* command to start up window manager */
+ char *ty_comment; /* comment field */
+};
+
+
+__BEGIN_DECLS
+
+extern struct ttyent *getttyent (void) __THROW;
+extern struct ttyent *getttynam (__const char *__tty) __THROW;
+extern int setttyent (void) __THROW;
+extern int endttyent (void) __THROW;
+
+__END_DECLS
+
+#endif /* ttyent.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/ucontext.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/ucontext.h
new file mode 100644
index 0000000..5bd4645
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/ucontext.h
@@ -0,0 +1,32 @@
+/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _UCONTEXT_H
+#define _UCONTEXT_H 1
+
+#include <features.h>
+
+/* Get machine dependent definition of data structures. */
+#include <sys/ucontext.h>
+
+/* The System V ABI user-level context switching support functions
+ * are marked obsolescent by SuSv3, and are not implemented by
+ * uClibc. This header is therefore empty. */
+
+
+#endif /* ucontext.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/ulimit.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/ulimit.h
new file mode 100644
index 0000000..93b5f37
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/ulimit.h
@@ -0,0 +1,48 @@
+/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ULIMIT_H
+#define _ULIMIT_H 1
+
+#include <features.h>
+
+/* Constants used as the first parameter for `ulimit'. They denote limits
+ which can be set or retrieved using this function. */
+enum
+{
+ UL_GETFSIZE = 1, /* Return limit on the size of a file,
+ in units of 512 bytes. */
+#define UL_GETFSIZE UL_GETFSIZE
+ UL_SETFSIZE, /* Set limit on the size of a file to
+ second argument. */
+#define UL_SETFSIZE UL_SETFSIZE
+ __UL_GETMAXBRK, /* Return the maximum possible address
+ of the data segment. */
+ __UL_GETOPENMAX /* Return the maximum number of files
+ that the calling process can open.*/
+};
+
+
+__BEGIN_DECLS
+
+/* Control process limits according to CMD. */
+extern long int ulimit (int __cmd, ...) __THROW;
+
+__END_DECLS
+
+#endif /* ulimit.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/unistd.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/unistd.h
new file mode 100644
index 0000000..7590640
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/unistd.h
@@ -0,0 +1,1110 @@
+/* Copyright (C) 1991-2002,2003,2004,2005,2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 2.10 Symbolic Constants <unistd.h>
+ */
+
+#ifndef _UNISTD_H
+#define _UNISTD_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* These may be used to determine what facilities are present at compile time.
+ Their values can be obtained at run time from `sysconf'. */
+
+/* POSIX Standard approved as ISO/IEC 9945-1 as of December 2001. */
+#define _POSIX_VERSION 200112L
+
+/* These are not #ifdef __USE_POSIX2 because they are
+ in the theoretically application-owned namespace. */
+
+/* The utilities on GNU systems also correspond to this version. */
+#define _POSIX2_VERSION 200112L
+
+/* If defined, the implementation supports the
+ C Language Bindings Option. */
+#define _POSIX2_C_BIND 200112L
+
+/* If defined, the implementation supports the
+ C Language Development Utilities Option. */
+#define _POSIX2_C_DEV 200112L
+
+/* If defined, the implementation supports the
+ Software Development Utilities Option. */
+#define _POSIX2_SW_DEV 200112L
+
+/* If defined, the implementation supports the
+ creation of locales with the localedef utility. */
+#define _POSIX2_LOCALEDEF 200112L
+
+/* X/Open version number to which the library conforms. It is selectable. */
+#ifdef __USE_UNIX98
+# define _XOPEN_VERSION 500
+#else
+# define _XOPEN_VERSION 4
+#endif
+
+/* Commands and utilities from XPG4 are available. */
+#define _XOPEN_XCU_VERSION 4
+
+/* We are compatible with the old published standards as well. */
+#define _XOPEN_XPG2 1
+#define _XOPEN_XPG3 1
+#define _XOPEN_XPG4 1
+
+/* The X/Open Unix extensions are available. */
+#define _XOPEN_UNIX 1
+
+/* Encryption is present. */
+#define _XOPEN_CRYPT 1
+
+/* The enhanced internationalization capabilities according to XPG4.2
+ are present. */
+#define _XOPEN_ENH_I18N 1
+
+/* The legacy interfaces are also available. */
+#define _XOPEN_LEGACY 1
+
+
+/* Get values of POSIX options:
+
+ If these symbols are defined, the corresponding features are
+ always available. If not, they may be available sometimes.
+ The current values can be obtained with `sysconf'.
+
+ _POSIX_JOB_CONTROL Job control is supported.
+ _POSIX_SAVED_IDS Processes have a saved set-user-ID
+ and a saved set-group-ID.
+ _POSIX_REALTIME_SIGNALS Real-time, queued signals are supported.
+ _POSIX_PRIORITY_SCHEDULING Priority scheduling is supported.
+ _POSIX_TIMERS POSIX.4 clocks and timers are supported.
+ _POSIX_ASYNCHRONOUS_IO Asynchronous I/O is supported.
+ _POSIX_PRIORITIZED_IO Prioritized asynchronous I/O is supported.
+ _POSIX_SYNCHRONIZED_IO Synchronizing file data is supported.
+ _POSIX_FSYNC The fsync function is present.
+ _POSIX_MAPPED_FILES Mapping of files to memory is supported.
+ _POSIX_MEMLOCK Locking of all memory is supported.
+ _POSIX_MEMLOCK_RANGE Locking of ranges of memory is supported.
+ _POSIX_MEMORY_PROTECTION Setting of memory protections is supported.
+ _POSIX_MESSAGE_PASSING POSIX.4 message queues are supported.
+ _POSIX_SEMAPHORES POSIX.4 counting semaphores are supported.
+ _POSIX_SHARED_MEMORY_OBJECTS POSIX.4 shared memory objects are supported.
+ _POSIX_THREADS POSIX.1c pthreads are supported.
+ _POSIX_THREAD_ATTR_STACKADDR Thread stack address attribute option supported.
+ _POSIX_THREAD_ATTR_STACKSIZE Thread stack size attribute option supported.
+ _POSIX_THREAD_SAFE_FUNCTIONS Thread-safe functions are supported.
+ _POSIX_THREAD_PRIORITY_SCHEDULING
+ POSIX.1c thread execution scheduling supported.
+ _POSIX_THREAD_PRIO_INHERIT Thread priority inheritance option supported.
+ _POSIX_THREAD_PRIO_PROTECT Thread priority protection option supported.
+ _POSIX_THREAD_PROCESS_SHARED Process-shared synchronization supported.
+ _POSIX_PII Protocol-independent interfaces are supported.
+ _POSIX_PII_XTI XTI protocol-indep. interfaces are supported.
+ _POSIX_PII_SOCKET Socket protocol-indep. interfaces are supported.
+ _POSIX_PII_INTERNET Internet family of protocols supported.
+ _POSIX_PII_INTERNET_STREAM Connection-mode Internet protocol supported.
+ _POSIX_PII_INTERNET_DGRAM Connectionless Internet protocol supported.
+ _POSIX_PII_OSI ISO/OSI family of protocols supported.
+ _POSIX_PII_OSI_COTS Connection-mode ISO/OSI service supported.
+ _POSIX_PII_OSI_CLTS Connectionless ISO/OSI service supported.
+ _POSIX_POLL Implementation supports `poll' function.
+ _POSIX_SELECT Implementation supports `select' and `pselect'.
+
+ _XOPEN_REALTIME X/Open realtime support is available.
+ _XOPEN_REALTIME_THREADS X/Open realtime thread support is available.
+ _XOPEN_SHM Shared memory interface according to XPG4.2.
+
+ _XBS5_ILP32_OFF32 Implementation provides environment with 32-bit
+ int, long, pointer, and off_t types.
+ _XBS5_ILP32_OFFBIG Implementation provides environment with 32-bit
+ int, long, and pointer and off_t with at least
+ 64 bits.
+ _XBS5_LP64_OFF64 Implementation provides environment with 32-bit
+ int, and 64-bit long, pointer, and off_t types.
+ _XBS5_LPBIG_OFFBIG Implementation provides environment with at
+ least 32 bits int and long, pointer, and off_t
+ with at least 64 bits.
+
+ If any of these symbols is defined as -1, the corresponding option is not
+ true for any file. If any is defined as other than -1, the corresponding
+ option is true for all files. If a symbol is not defined at all, the value
+ for a specific file can be obtained from `pathconf' and `fpathconf'.
+
+ _POSIX_CHOWN_RESTRICTED Only the super user can use `chown' to change
+ the owner of a file. `chown' can only be used
+ to change the group ID of a file to a group of
+ which the calling process is a member.
+ _POSIX_NO_TRUNC Pathname components longer than
+ NAME_MAX generate an error.
+ _POSIX_VDISABLE If defined, if the value of an element of the
+ `c_cc' member of `struct termios' is
+ _POSIX_VDISABLE, no character will have the
+ effect associated with that element.
+ _POSIX_SYNC_IO Synchronous I/O may be performed.
+ _POSIX_ASYNC_IO Asynchronous I/O may be performed.
+ _POSIX_PRIO_IO Prioritized Asynchronous I/O may be performed.
+
+ Support for the Large File Support interface is not generally available.
+ If it is available the following constants are defined to one.
+ _LFS64_LARGEFILE Low-level I/O supports large files.
+ _LFS64_STDIO Standard I/O supports large files.
+ */
+
+#include <bits/posix_opt.h>
+
+/* Get the environment definitions from Unix98. */
+#ifdef __USE_UNIX98
+# include <bits/environments.h>
+#endif
+
+/* Standard file descriptors. */
+#define STDIN_FILENO 0 /* Standard input. */
+#define STDOUT_FILENO 1 /* Standard output. */
+#define STDERR_FILENO 2 /* Standard error output. */
+
+
+/* All functions that are not declared anywhere else. */
+
+#include <bits/types.h>
+
+#ifndef __ssize_t_defined
+typedef __ssize_t ssize_t;
+# define __ssize_t_defined
+#endif
+
+#define __need_size_t
+#define __need_NULL
+#include <stddef.h>
+
+#if defined __USE_XOPEN || defined __USE_XOPEN2K
+/* The Single Unix specification says that some more types are
+ available here. */
+# ifndef __gid_t_defined
+typedef __gid_t gid_t;
+# define __gid_t_defined
+# endif
+
+# ifndef __uid_t_defined
+typedef __uid_t uid_t;
+# define __uid_t_defined
+# endif
+
+# ifndef __off_t_defined
+# ifndef __USE_FILE_OFFSET64
+typedef __off_t off_t;
+# else
+typedef __off64_t off_t;
+# endif
+# define __off_t_defined
+# endif
+# if defined __USE_LARGEFILE64 && !defined __off64_t_defined
+typedef __off64_t off64_t;
+# define __off64_t_defined
+# endif
+
+# ifndef __useconds_t_defined
+typedef __useconds_t useconds_t;
+# define __useconds_t_defined
+# endif
+
+# ifndef __pid_t_defined
+typedef __pid_t pid_t;
+# define __pid_t_defined
+# endif
+#endif /* X/Open */
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
+# ifndef __intptr_t_defined
+typedef __intptr_t intptr_t;
+# define __intptr_t_defined
+# endif
+#endif
+
+#if defined __USE_BSD || defined __USE_XOPEN
+# ifndef __socklen_t_defined
+typedef __socklen_t socklen_t;
+# define __socklen_t_defined
+# endif
+#endif
+
+/* Values for the second argument to access.
+ These may be OR'd together. */
+#define R_OK 4 /* Test for read permission. */
+#define W_OK 2 /* Test for write permission. */
+#define X_OK 1 /* Test for execute permission. */
+#define F_OK 0 /* Test for existence. */
+
+/* Test for access to NAME using the real UID and real GID. */
+extern int access (__const char *__name, int __type) __THROW __nonnull ((1));
+
+#if 0 /*def __USE_GNU*/
+/* Test for access to NAME using the effective UID and GID
+ (as normal file operations use). */
+extern int euidaccess (__const char *__name, int __type)
+ __THROW __nonnull ((1));
+
+/* An alias for `euidaccess', used by some other systems. */
+extern int eaccess (__const char *__name, int __type)
+ __THROW __nonnull ((1));
+#endif
+
+#ifdef __USE_ATFILE
+/* Test for access to FILE relative to the directory FD is open on.
+ If AT_EACCESS is set in FLAG, then use effective IDs like `eaccess',
+ otherwise use real IDs like `access'. */
+extern int faccessat (int __fd, __const char *__file, int __type, int __flag)
+ __THROW __nonnull ((2)) __wur;
+#endif /* Use GNU. */
+
+
+/* Values for the WHENCE argument to lseek. */
+#ifndef _STDIO_H /* <stdio.h> has the same definitions. */
+# define SEEK_SET 0 /* Seek from beginning of file. */
+# define SEEK_CUR 1 /* Seek from current position. */
+# define SEEK_END 2 /* Seek from end of file. */
+#endif
+
+#if defined __USE_BSD && !defined L_SET
+/* Old BSD names for the same constants; just for compatibility. */
+# define L_SET SEEK_SET
+# define L_INCR SEEK_CUR
+# define L_XTND SEEK_END
+#endif
+
+
+/* Move FD's file position to OFFSET bytes from the
+ beginning of the file (if WHENCE is SEEK_SET),
+ the current position (if WHENCE is SEEK_CUR),
+ or the end of the file (if WHENCE is SEEK_END).
+ Return the new file position. */
+#ifndef __USE_FILE_OFFSET64
+extern __off_t lseek (int __fd, __off_t __offset, int __whence) __THROW;
+#else
+# ifdef __REDIRECT_NTH
+extern __off64_t __REDIRECT_NTH (lseek,
+ (int __fd, __off64_t __offset, int __whence),
+ lseek64);
+# else
+# define lseek lseek64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
+ __THROW;
+#endif
+
+/* Close the file descriptor FD.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int close (int __fd);
+
+/* Read NBYTES into BUF from FD. Return the
+ number read, -1 for errors or 0 for EOF.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur;
+
+/* Write N bytes of BUF to FD. Return the number written, or -1.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t write (int __fd, __const void *__buf, size_t __n) __wur;
+
+#ifdef __USE_UNIX98
+# ifndef __USE_FILE_OFFSET64
+/* Read NBYTES into BUF from FD at the given position OFFSET without
+ changing the file pointer. Return the number read, -1 for errors
+ or 0 for EOF.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t pread (int __fd, void *__buf, size_t __nbytes,
+ __off_t __offset) __wur;
+
+/* Write N bytes of BUF to FD at the given position OFFSET without
+ changing the file pointer. Return the number written, or -1.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t pwrite (int __fd, __const void *__buf, size_t __n,
+ __off_t __offset) __wur;
+# else
+# ifdef __REDIRECT
+extern ssize_t __REDIRECT (pread, (int __fd, void *__buf, size_t __nbytes,
+ __off64_t __offset),
+ pread64) __wur;
+extern ssize_t __REDIRECT (pwrite, (int __fd, __const void *__buf,
+ size_t __nbytes, __off64_t __offset),
+ pwrite64) __wur;
+# else
+# define pread pread64
+# define pwrite pwrite64
+# endif
+# endif
+
+# ifdef __USE_LARGEFILE64
+/* Read NBYTES into BUF from FD at the given position OFFSET without
+ changing the file pointer. Return the number read, -1 for errors
+ or 0 for EOF. */
+extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
+ __off64_t __offset) __wur;
+/* Write N bytes of BUF to FD at the given position OFFSET without
+ changing the file pointer. Return the number written, or -1. */
+extern ssize_t pwrite64 (int __fd, __const void *__buf, size_t __n,
+ __off64_t __offset) __wur;
+# endif
+#endif
+
+/* Create a one-way communication channel (pipe).
+ If successful, two file descriptors are stored in PIPEDES;
+ bytes written on PIPEDES[1] can be read from PIPEDES[0].
+ Returns 0 if successful, -1 if not. */
+extern int pipe (int __pipedes[2]) __THROW __wur;
+
+/* Schedule an alarm. In SECONDS seconds, the process will get a SIGALRM.
+ If SECONDS is zero, any currently scheduled alarm will be cancelled.
+ The function returns the number of seconds remaining until the last
+ alarm scheduled would have signaled, or zero if there wasn't one.
+ There is no return value to indicate an error, but you can set `errno'
+ to 0 and check its value after calling `alarm', and this might tell you.
+ The signal may come late due to processor scheduling. */
+extern unsigned int alarm (unsigned int __seconds) __THROW;
+
+/* Make the process sleep for SECONDS seconds, or until a signal arrives
+ and is not ignored. The function returns the number of seconds less
+ than SECONDS which it actually slept (thus zero if it slept the full time).
+ If a signal handler does a `longjmp' or modifies the handling of the
+ SIGALRM signal while inside `sleep' call, the handling of the SIGALRM
+ signal afterwards is undefined. There is no return value to indicate
+ error, but if `sleep' returns SECONDS, it probably didn't work.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern unsigned int sleep (unsigned int __seconds);
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Set an alarm to go off (generating a SIGALRM signal) in VALUE
+ microseconds. If INTERVAL is nonzero, when the alarm goes off, the
+ timer is reset to go off every INTERVAL microseconds thereafter.
+ Returns the number of microseconds remaining before the alarm. */
+extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
+ __THROW;
+
+/* Sleep USECONDS microseconds, or until a signal arrives that is not blocked
+ or ignored.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int usleep (__useconds_t __useconds);
+#endif
+
+
+/* Suspend the process until a signal arrives.
+ This always returns -1 and sets `errno' to EINTR.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int pause (void);
+
+
+/* Change the owner and group of FILE. */
+extern int chown (__const char *__file, __uid_t __owner, __gid_t __group)
+ __THROW __nonnull ((1)) __wur;
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Change the owner and group of the file that FD is open on. */
+extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __THROW __wur;
+
+
+/* Change owner and group of FILE, if it is a symbolic
+ link the ownership of the symbolic link is changed. */
+extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group)
+ __THROW __nonnull ((1)) __wur;
+
+#endif /* Use BSD || X/Open Unix. */
+
+#ifdef __USE_ATFILE
+/* Change the owner and group of FILE relative to the directory FD is open
+ on. */
+extern int fchownat (int __fd, __const char *__file, __uid_t __owner,
+ __gid_t __group, int __flag)
+ __THROW __nonnull ((2)) __wur;
+#endif /* Use GNU. */
+
+/* Change the process's working directory to PATH. */
+extern int chdir (__const char *__path) __THROW __nonnull ((1)) __wur;
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Change the process's working directory to the one FD is open on. */
+extern int fchdir (int __fd) __THROW __wur;
+#endif
+
+/* Get the pathname of the current working directory,
+ and put it in SIZE bytes of BUF. Returns NULL if the
+ directory couldn't be determined or SIZE was too small.
+ If successful, returns BUF. In GNU, if BUF is NULL,
+ an array is allocated with `malloc'; the array is SIZE
+ bytes long, unless SIZE == 0, in which case it is as
+ big as necessary. */
+extern char *getcwd (char *__buf, size_t __size) __THROW __wur;
+
+#ifdef __USE_GNU
+/* Return a malloc'd string containing the current directory name.
+ If the environment variable `PWD' is set, and its value is correct,
+ that value is used. */
+extern char *get_current_dir_name (void) __THROW;
+#endif
+
+#if 0 /*defined __USE_BSD || defined __USE_XOPEN_EXTENDED*/
+/* Put the absolute pathname of the current working directory in BUF.
+ If successful, return BUF. If not, put an error message in
+ BUF and return NULL. BUF should be at least PATH_MAX bytes long. */
+extern char *getwd (char *__buf)
+ __THROW __nonnull ((1)) __attribute_deprecated__ __wur;
+#endif
+
+
+/* Duplicate FD, returning a new file descriptor on the same file. */
+extern int dup (int __fd) __THROW __wur;
+
+/* Duplicate FD to FD2, closing FD2 and making it open on the same file. */
+extern int dup2 (int __fd, int __fd2) __THROW;
+
+/* NULL-terminated array of "NAME=VALUE" environment variables. */
+extern char **__environ;
+#ifdef __USE_GNU
+extern char **environ;
+#endif
+
+
+/* Replace the current process, executing PATH with arguments ARGV and
+ environment ENVP. ARGV and ENVP are terminated by NULL pointers. */
+extern int execve (__const char *__path, char *__const __argv[],
+ char *__const __envp[]) __THROW __nonnull ((1));
+
+#if 0 /*def __USE_GNU*/
+/* Execute the file FD refers to, overlaying the running program image.
+ ARGV and ENVP are passed to the new program, as for `execve'. */
+extern int fexecve (int __fd, char *__const __argv[], char *__const __envp[])
+ __THROW;
+#endif
+
+
+/* Execute PATH with arguments ARGV and environment from `environ'. */
+extern int execv (__const char *__path, char *__const __argv[])
+ __THROW __nonnull ((1));
+
+/* Execute PATH with all arguments after PATH until a NULL pointer,
+ and the argument after that for environment. */
+extern int execle (__const char *__path, __const char *__arg, ...)
+ __THROW __nonnull ((1));
+
+/* Execute PATH with all arguments after PATH until
+ a NULL pointer and environment from `environ'. */
+extern int execl (__const char *__path, __const char *__arg, ...)
+ __THROW __nonnull ((1));
+
+/* Execute FILE, searching in the `PATH' environment variable if it contains
+ no slashes, with arguments ARGV and environment from `environ'. */
+extern int execvp (__const char *__file, char *__const __argv[])
+ __THROW __nonnull ((1));
+
+/* Execute FILE, searching in the `PATH' environment variable if
+ it contains no slashes, with all arguments after FILE until a
+ NULL pointer and environment from `environ'. */
+extern int execlp (__const char *__file, __const char *__arg, ...)
+ __THROW __nonnull ((1));
+
+
+#if defined __USE_MISC || defined __USE_XOPEN
+/* Add INC to priority of the current process. */
+extern int nice (int __inc) __THROW __wur;
+#endif
+
+
+/* Terminate program execution with the low-order 8 bits of STATUS. */
+extern void _exit (int __status) __attribute__ ((__noreturn__));
+
+
+/* Get the `_PC_*' symbols for the NAME argument to `pathconf' and `fpathconf';
+ the `_SC_*' symbols for the NAME argument to `sysconf';
+ and the `_CS_*' symbols for the NAME argument to `confstr'. */
+#include <bits/confname.h>
+
+/* Get file-specific configuration information about PATH. */
+extern long int pathconf (__const char *__path, int __name)
+ __THROW __nonnull ((1));
+
+/* Get file-specific configuration about descriptor FD. */
+extern long int fpathconf (int __fd, int __name) __THROW;
+
+/* Get the value of the system variable NAME. */
+extern long int sysconf (int __name) __THROW;
+
+#ifdef __USE_POSIX2
+/* Get the value of the string-valued system variable NAME. */
+extern size_t confstr (int __name, char *__buf, size_t __len) __THROW;
+#endif
+
+
+/* Get the process ID of the calling process. */
+extern __pid_t getpid (void) __THROW;
+
+/* Get the process ID of the calling process's parent. */
+extern __pid_t getppid (void) __THROW;
+
+/* Get the process group ID of the calling process.
+ This function is different on old BSD. */
+#ifndef __FAVOR_BSD
+extern __pid_t getpgrp (void) __THROW;
+#else
+# ifdef __REDIRECT_NTH
+extern __pid_t __REDIRECT_NTH (getpgrp, (__pid_t __pid), __getpgid);
+# else
+# define getpgrp __getpgid
+# endif
+#endif
+
+/* Get the process group ID of process PID. */
+extern __pid_t __getpgid (__pid_t __pid) __THROW;
+#ifdef __USE_XOPEN_EXTENDED
+extern __pid_t getpgid (__pid_t __pid) __THROW;
+#endif
+
+
+/* Set the process group ID of the process matching PID to PGID.
+ If PID is zero, the current process's process group ID is set.
+ If PGID is zero, the process ID of the process is used. */
+extern int setpgid (__pid_t __pid, __pid_t __pgid) __THROW;
+
+#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Both System V and BSD have `setpgrp' functions, but with different
+ calling conventions. The BSD function is the same as POSIX.1 `setpgid'
+ (above). The System V function takes no arguments and puts the calling
+ process in its on group like `setpgid (0, 0)'.
+
+ New programs should always use `setpgid' instead.
+
+ The default in GNU is to provide the System V function. The BSD
+ function is available under -D_BSD_SOURCE. */
+
+# ifndef __FAVOR_BSD
+
+/* Set the process group ID of the calling process to its own PID.
+ This is exactly the same as `setpgid (0, 0)'. */
+extern int setpgrp (void) __THROW;
+
+# else
+
+/* Another name for `setpgid' (above). */
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (setpgrp, (__pid_t __pid, __pid_t __pgrp), setpgid);
+# else
+# define setpgrp setpgid
+# endif
+
+# endif /* Favor BSD. */
+#endif /* Use SVID or BSD. */
+
+/* Create a new session with the calling process as its leader.
+ The process group IDs of the session and the calling process
+ are set to the process ID of the calling process, which is returned. */
+extern __pid_t setsid (void) __THROW;
+
+#ifdef __USE_XOPEN_EXTENDED
+/* Return the session ID of the given process. */
+extern __pid_t getsid (__pid_t __pid) __THROW;
+#endif
+
+/* Get the real user ID of the calling process. */
+extern __uid_t getuid (void) __THROW;
+
+/* Get the effective user ID of the calling process. */
+extern __uid_t geteuid (void) __THROW;
+
+/* Get the real group ID of the calling process. */
+extern __gid_t getgid (void) __THROW;
+
+/* Get the effective group ID of the calling process. */
+extern __gid_t getegid (void) __THROW;
+
+/* If SIZE is zero, return the number of supplementary groups
+ the calling process is in. Otherwise, fill in the group IDs
+ of its supplementary groups in LIST and return the number written. */
+extern int getgroups (int __size, __gid_t __list[]) __THROW __wur;
+
+#if 0 /*def __USE_GNU*/
+/* Return nonzero iff the calling process is in group GID. */
+extern int group_member (__gid_t __gid) __THROW;
+#endif
+
+/* Set the user ID of the calling process to UID.
+ If the calling process is the super-user, set the real
+ and effective user IDs, and the saved set-user-ID to UID;
+ if not, the effective user ID is set to UID. */
+extern int setuid (__uid_t __uid) __THROW;
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Set the real user ID of the calling process to RUID,
+ and the effective user ID of the calling process to EUID. */
+extern int setreuid (__uid_t __ruid, __uid_t __euid) __THROW;
+#endif
+
+#if defined __USE_BSD || defined __USE_XOPEN2K
+/* Set the effective user ID of the calling process to UID. */
+extern int seteuid (__uid_t __uid) __THROW;
+#endif /* Use BSD. */
+
+/* Set the group ID of the calling process to GID.
+ If the calling process is the super-user, set the real
+ and effective group IDs, and the saved set-group-ID to GID;
+ if not, the effective group ID is set to GID. */
+extern int setgid (__gid_t __gid) __THROW;
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Set the real group ID of the calling process to RGID,
+ and the effective group ID of the calling process to EGID. */
+extern int setregid (__gid_t __rgid, __gid_t __egid) __THROW;
+#endif
+
+#if defined __USE_BSD || defined __USE_XOPEN2K
+/* Set the effective group ID of the calling process to GID. */
+extern int setegid (__gid_t __gid) __THROW;
+#endif /* Use BSD. */
+
+#ifdef __USE_GNU
+/* Fetch the real user ID, effective user ID, and saved-set user ID,
+ of the calling process. */
+extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
+ __THROW;
+
+/* Fetch the real group ID, effective group ID, and saved-set group ID,
+ of the calling process. */
+extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
+ __THROW;
+
+/* Set the real user ID, effective user ID, and saved-set user ID,
+ of the calling process to RUID, EUID, and SUID, respectively. */
+extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
+ __THROW;
+
+/* Set the real group ID, effective group ID, and saved-set group ID,
+ of the calling process to RGID, EGID, and SGID, respectively. */
+extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
+ __THROW;
+#endif
+
+
+#ifdef __ARCH_USE_MMU__
+/* Clone the calling process, creating an exact copy.
+ Return -1 for errors, 0 to the new process,
+ and the process ID of the new process to the old process. */
+extern __pid_t fork (void) __THROW;
+#endif
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* Clone the calling process, but without copying the whole address space.
+ The calling process is suspended until the new process exits or is
+ replaced by a call to `execve'. Return -1 for errors, 0 to the new process,
+ and the process ID of the new process to the old process. */
+extern __pid_t vfork (void) __THROW;
+#endif /* Use BSD. */
+
+
+/* Return the pathname of the terminal FD is open on, or NULL on errors.
+ The returned storage is good only until the next call to this function. */
+extern char *ttyname (int __fd) __THROW;
+
+/* Store at most BUFLEN characters of the pathname of the terminal FD is
+ open on in BUF. Return 0 on success, otherwise an error number. */
+extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
+ __THROW __nonnull ((2)) __wur;
+
+/* Return 1 if FD is a valid descriptor associated
+ with a terminal, zero if not. */
+extern int isatty (int __fd) __THROW;
+
+#if 0 /*defined __USE_BSD \
+ || (defined __USE_XOPEN_EXTENDED && !defined __USE_UNIX98)*/
+/* Return the index into the active-logins file (utmp) for
+ the controlling terminal. */
+extern int ttyslot (void) __THROW;
+#endif
+
+
+/* Make a link to FROM named TO. */
+extern int link (__const char *__from, __const char *__to)
+ __THROW __nonnull ((1, 2)) __wur;
+
+#ifdef __USE_ATFILE
+/* Like link but relative paths in TO and FROM are interpreted relative
+ to FROMFD and TOFD respectively. */
+extern int linkat (int __fromfd, __const char *__from, int __tofd,
+ __const char *__to, int __flags)
+ __THROW __nonnull ((2, 4)) __wur;
+#endif
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
+/* Make a symbolic link to FROM named TO. */
+extern int symlink (__const char *__from, __const char *__to)
+ __THROW __nonnull ((1, 2)) __wur;
+
+/* Read the contents of the symbolic link PATH into no more than
+ LEN bytes of BUF. The contents are not null-terminated.
+ Returns the number of characters read, or -1 for errors. */
+extern ssize_t readlink (__const char *__restrict __path,
+ char *__restrict __buf, size_t __len)
+ __THROW __nonnull ((1, 2)) __wur;
+#endif /* Use BSD. */
+
+#ifdef __USE_ATFILE
+/* Like symlink but a relative path in TO is interpreted relative to TOFD. */
+extern int symlinkat (__const char *__from, int __tofd,
+ __const char *__to) __THROW __nonnull ((1, 3)) __wur;
+
+/* Like readlink but a relative PATH is interpreted relative to FD. */
+extern ssize_t readlinkat (int __fd, __const char *__restrict __path,
+ char *__restrict __buf, size_t __len)
+ __THROW __nonnull ((2, 3)) __wur;
+#endif
+
+/* Remove the link NAME. */
+extern int unlink (__const char *__name) __THROW __nonnull ((1));
+
+#ifdef __USE_ATFILE
+/* Remove the link NAME relative to FD. */
+extern int unlinkat (int __fd, __const char *__name, int __flag)
+ __THROW __nonnull ((2));
+#endif
+
+/* Remove the directory PATH. */
+extern int rmdir (__const char *__path) __THROW __nonnull ((1));
+
+
+/* Return the foreground process group ID of FD. */
+extern __pid_t tcgetpgrp (int __fd) __THROW;
+
+/* Set the foreground process group ID of FD set PGRP_ID. */
+extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __THROW;
+
+
+/* Return the login name of the user.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern char *getlogin (void);
+#if defined __USE_REENTRANT || defined __USE_POSIX199506
+/* Return at most NAME_LEN characters of the login name of the user in NAME.
+ If it cannot be determined or some other error occurred, return the error
+ code. Otherwise return 0.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern int getlogin_r (char *__name, size_t __name_len) __nonnull ((1));
+#endif
+
+#if 0 /*def __USE_BSD*/
+/* Set the login name returned by `getlogin'. */
+extern int setlogin (__const char *__name) __THROW __nonnull ((1));
+#endif
+
+
+#ifdef __USE_POSIX2
+/* Get definitions and prototypes for functions to process the
+ arguments in ARGV (ARGC of them, minus the program name) for
+ options given in OPTS. */
+# define __need_getopt
+/* keep this for uClibc in bits/, we need it when GNU_GETOPT is disabled */
+# include <bits/getopt.h>
+#endif
+
+
+#if defined __USE_BSD || defined __USE_UNIX98
+/* Put the name of the current host in no more than LEN bytes of NAME.
+ The result is null-terminated if LEN is large enough for the full
+ name and the terminator. */
+extern int gethostname (char *__name, size_t __len) __THROW __nonnull ((1));
+#endif
+
+
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
+/* Set the name of the current host to NAME, which is LEN bytes long.
+ This call is restricted to the super-user. */
+extern int sethostname (__const char *__name, size_t __len)
+ __THROW __nonnull ((1)) __wur;
+
+/* Set the current machine's Internet number to ID.
+ This call is restricted to the super-user. */
+extern int sethostid (long int __id) __THROW __wur;
+
+
+/* Get and set the NIS (aka YP) domain name, if any.
+ Called just like `gethostname' and `sethostname'.
+ The NIS domain name is usually the empty string when not using NIS. */
+extern int getdomainname (char *__name, size_t __len)
+ __THROW __nonnull ((1)) __wur;
+extern int setdomainname (__const char *__name, size_t __len)
+ __THROW __nonnull ((1)) __wur;
+
+
+/* Revoke access permissions to all processes currently communicating
+ with the control terminal, and then send a SIGHUP signal to the process
+ group of the control terminal. */
+extern int vhangup (void) __THROW;
+
+#if 0
+/* Revoke the access of all descriptors currently open on FILE. */
+extern int revoke (__const char *__file) __THROW __nonnull ((1)) __wur;
+
+
+/* Enable statistical profiling, writing samples of the PC into at most
+ SIZE bytes of SAMPLE_BUFFER; every processor clock tick while profiling
+ is enabled, the system examines the user PC and increments
+ SAMPLE_BUFFER[((PC - OFFSET) / 2) * SCALE / 65536]. If SCALE is zero,
+ disable profiling. Returns zero on success, -1 on error. */
+extern int profil (unsigned short int *__sample_buffer, size_t __size,
+ size_t __offset, unsigned int __scale)
+ __THROW __nonnull ((1));
+#endif
+
+
+/* Turn accounting on if NAME is an existing file. The system will then write
+ a record for each process as it terminates, to this file. If NAME is NULL,
+ turn accounting off. This call is restricted to the super-user. */
+extern int acct (__const char *__name) __THROW;
+
+
+/* Successive calls return the shells listed in `/etc/shells'. */
+extern char *getusershell (void) __THROW;
+extern void endusershell (void) __THROW; /* Discard cached info. */
+extern void setusershell (void) __THROW; /* Rewind and re-read the file. */
+
+
+#ifdef __ARCH_USE_MMU__
+/* Put the program in the background, and dissociate from the controlling
+ terminal. If NOCHDIR is zero, do `chdir ("/")'. If NOCLOSE is zero,
+ redirects stdin, stdout, and stderr to /dev/null. */
+extern int daemon (int __nochdir, int __noclose) __THROW __wur;
+#endif
+#endif /* Use BSD || X/Open. */
+
+
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
+/* Make PATH be the root directory (the starting point for absolute paths).
+ This call is restricted to the super-user. */
+extern int chroot (__const char *__path) __THROW __nonnull ((1)) __wur;
+
+/* Prompt with PROMPT and read a string from the terminal without echoing.
+ Uses /dev/tty if possible; otherwise stderr and stdin. */
+extern char *getpass (__const char *__prompt) __nonnull ((1));
+#endif /* Use BSD || X/Open. */
+
+
+#if defined __USE_BSD || defined __USE_XOPEN
+/* Make all changes done to FD actually appear on disk.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int fsync (int __fd);
+#endif /* Use BSD || X/Open. */
+
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+
+/* Return identifier for the current host. */
+extern long int gethostid (void);
+
+/* Make all changes done to all files actually appear on disk. */
+extern void sync (void) __THROW;
+
+
+/* Return the number of bytes in a page. This is the system's page size,
+ which is not necessarily the same as the hardware page size. */
+extern int getpagesize (void) __THROW __attribute__ ((__const__));
+
+
+/* Return the maximum number of file descriptors
+ the current process could possibly have. */
+extern int getdtablesize (void) __THROW;
+
+
+/* Truncate FILE to LENGTH bytes. */
+# ifndef __USE_FILE_OFFSET64
+extern int truncate (__const char *__file, __off_t __length)
+ __THROW __nonnull ((1)) __wur;
+# else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (truncate,
+ (__const char *__file, __off64_t __length),
+ truncate64) __nonnull ((1)) __wur;
+# else
+# define truncate truncate64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int truncate64 (__const char *__file, __off64_t __length)
+ __THROW __nonnull ((1)) __wur;
+# endif
+
+#endif /* Use BSD || X/Open Unix. */
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
+
+/* Truncate the file FD is open on to LENGTH bytes. */
+# ifndef __USE_FILE_OFFSET64
+extern int ftruncate (int __fd, __off_t __length) __THROW __wur;
+# else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (ftruncate, (int __fd, __off64_t __length),
+ ftruncate64) __wur;
+# else
+# define ftruncate ftruncate64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int ftruncate64 (int __fd, __off64_t __length) __THROW __wur;
+# endif
+
+#endif /* Use BSD || X/Open Unix || POSIX 2003. */
+
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
+
+/* Set the end of accessible data space (aka "the break") to ADDR.
+ Returns zero on success and -1 for errors (with errno set). */
+extern int brk (void *__addr) __THROW __wur;
+
+/* Increase or decrease the end of accessible data space by DELTA bytes.
+ If successful, returns the address the previous end of data space
+ (i.e. the beginning of the new space, if DELTA > 0);
+ returns (void *) -1 for errors (with errno set). */
+extern void *sbrk (intptr_t __delta) __THROW;
+#endif
+
+
+#ifdef __USE_MISC
+/* Invoke `system call' number SYSNO, passing it the remaining arguments.
+ This is completely system-dependent, and not often useful.
+
+ In Unix, `syscall' sets `errno' for all errors and most calls return -1
+ for errors; in many systems you cannot pass arguments or get return
+ values for all system calls (`pipe', `fork', and `getppid' typically
+ among them).
+
+ In Mach, all system calls take normal arguments and always return an
+ error code (zero for success). */
+extern long int syscall (long int __sysno, ...) __THROW;
+
+#endif /* Use misc. */
+
+
+#if (defined __USE_MISC || defined __USE_XOPEN_EXTENDED) && !defined F_LOCK
+/* NOTE: These declarations also appear in <fcntl.h>; be sure to keep both
+ files consistent. Some systems have them there and some here, and some
+ software depends on the macros being defined without including both. */
+
+/* `lockf' is a simpler interface to the locking facilities of `fcntl'.
+ LEN is always relative to the current file position.
+ The CMD argument is one of the following.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+
+# define F_ULOCK 0 /* Unlock a previously locked region. */
+# define F_LOCK 1 /* Lock a region for exclusive use. */
+# define F_TLOCK 2 /* Test and lock a region for exclusive use. */
+# define F_TEST 3 /* Test a region for other processes locks. */
+
+# ifndef __USE_FILE_OFFSET64
+extern int lockf (int __fd, int __cmd, __off_t __len) __wur;
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len),
+ lockf64) __wur;
+# else
+# define lockf lockf64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int lockf64 (int __fd, int __cmd, __off64_t __len) __wur;
+# endif
+#endif /* Use misc and F_LOCK not already defined. */
+
+
+#ifdef __USE_GNU
+
+/* Evaluate EXPRESSION, and repeat as long as it returns -1 with `errno'
+ set to EINTR. */
+
+# define TEMP_FAILURE_RETRY(expression) \
+ (__extension__ \
+ ({ long int __result; \
+ do __result = (long int) (expression); \
+ while (__result == -1L && errno == EINTR); \
+ __result; }))
+#endif
+
+#if defined __USE_POSIX199309 || defined __USE_UNIX98
+/* Synchronize at least the data part of a file with the underlying
+ media. */
+extern int fdatasync (int __fildes) __THROW;
+#endif /* Use POSIX199309 */
+
+
+/* XPG4.2 specifies that prototypes for the encryption functions must
+ be defined here. */
+#ifdef __USE_XOPEN
+/* Encrypt at most 8 characters from KEY using salt to perturb DES. */
+extern char *crypt (__const char *__key, __const char *__salt)
+ __THROW __nonnull ((1, 2));
+
+/* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt
+ block in place. */
+extern void encrypt (char *__block, int __edflag) __THROW __nonnull ((1));
+
+
+/* Swab pairs bytes in the first N bytes of the area pointed to by
+ FROM and copy the result to TO. The value of TO must not be in the
+ range [FROM - N + 1, FROM - 1]. If N is odd the first byte in FROM
+ is without partner. */
+extern void swab (__const void *__restrict __from, void *__restrict __to,
+ ssize_t __n) __THROW __nonnull ((1, 2));
+#endif
+
+
+/* The Single Unix specification demands this prototype to be here.
+ It is also found in <stdio.h>. */
+#ifdef __USE_XOPEN
+/* Return the name of the controlling terminal. */
+extern char *ctermid (char *__s) __THROW;
+#endif
+
+
+/* Define some macros helping to catch buffer overflows. */
+#if __USE_FORTIFY_LEVEL > 0 && !defined __cplusplus
+# include <bits/unistd.h>
+#endif
+
+__END_DECLS
+
+#endif /* unistd.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/ustat.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/ustat.h
new file mode 100644
index 0000000..cba150e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/ustat.h
@@ -0,0 +1 @@
+#include <sys/ustat.h>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/utime.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/utime.h
new file mode 100644
index 0000000..dd5d265
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/utime.h
@@ -0,0 +1,52 @@
+/* Copyright (C) 1991, 92, 96, 97, 98, 99, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * POSIX Standard: 5.6.6 Set File Access and Modification Times <utime.h>
+ */
+
+#ifndef _UTIME_H
+#define _UTIME_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <bits/types.h>
+
+#if defined __USE_XOPEN || defined __USE_XOPEN2K
+# define __need_time_t
+# include <time.h>
+#endif
+
+/* Structure describing file times. */
+struct utimbuf
+ {
+ __time_t actime; /* Access time. */
+ __time_t modtime; /* Modification time. */
+ };
+
+/* Set the access and modification times of FILE to those given in
+ *FILE_TIMES. If FILE_TIMES is NULL, set them to the current time. */
+extern int utime (__const char *__file,
+ __const struct utimbuf *__file_times)
+ __THROW __nonnull ((1));
+
+__END_DECLS
+
+#endif /* utime.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/utmp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/utmp.h
new file mode 100644
index 0000000..585aad1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/utmp.h
@@ -0,0 +1,97 @@
+/* Copyright (C) 1993, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _UTMP_H
+#define _UTMP_H 1
+
+#include <features.h>
+
+#include <sys/types.h>
+
+
+__BEGIN_DECLS
+
+/* Get system dependent values and data structures. */
+#include <bits/utmp.h>
+
+/* Compatibility names for the strings of the canonical file names. */
+#define UTMP_FILE _PATH_UTMP
+#define UTMP_FILENAME _PATH_UTMP
+#define WTMP_FILE _PATH_WTMP
+#define WTMP_FILENAME _PATH_WTMP
+
+
+
+/* Make FD be the controlling terminal, stdin, stdout, and stderr;
+ then close FD. Returns 0 on success, nonzero on error. */
+extern int login_tty (int __fd) __THROW;
+
+
+/* Write the given entry into utmp and wtmp. */
+extern void login (__const struct utmp *__entry) __THROW;
+
+/* Write the utmp entry to say the user on UT_LINE has logged out. */
+extern int logout (__const char *__ut_line) __THROW;
+
+/* Append to wtmp an entry for the current time and the given info. */
+extern void logwtmp (__const char *__ut_line, __const char *__ut_name,
+ __const char *__ut_host) __THROW;
+
+/* Append entry UTMP to the wtmp-like file WTMP_FILE. */
+extern void updwtmp (__const char *__wtmp_file, __const struct utmp *__utmp)
+ __THROW;
+
+/* Change name of the utmp file to be examined. */
+extern int utmpname (__const char *__file) __THROW;
+
+/* Read next entry from a utmp-like file. */
+extern struct utmp *getutent (void) __THROW;
+
+/* Reset the input stream to the beginning of the file. */
+extern void setutent (void) __THROW;
+
+/* Close the current open file. */
+extern void endutent (void) __THROW;
+
+/* Search forward from the current point in the utmp file until the
+ next entry with a ut_type matching ID->ut_type. */
+extern struct utmp *getutid (__const struct utmp *__id) __THROW;
+
+/* Search forward from the current point in the utmp file until the
+ next entry with a ut_line matching LINE->ut_line. */
+extern struct utmp *getutline (__const struct utmp *__line) __THROW;
+
+/* Write out entry pointed to by UTMP_PTR into the utmp file. */
+extern struct utmp *pututline (__const struct utmp *__utmp_ptr) __THROW;
+
+
+#if 0 /* def __USE_MISC */
+/* Reentrant versions of the file for handling utmp files. */
+extern int getutent_r (struct utmp *__buffer, struct utmp **__result) __THROW;
+
+extern int getutid_r (__const struct utmp *__id, struct utmp *__buffer,
+ struct utmp **__result) __THROW;
+
+extern int getutline_r (__const struct utmp *__line,
+ struct utmp *__buffer, struct utmp **__result) __THROW;
+
+#endif /* Use misc. */
+
+__END_DECLS
+
+#endif /* utmp.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/values.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/values.h
new file mode 100644
index 0000000..d8bd8b5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/values.h
@@ -0,0 +1,71 @@
+/* Old compatibility names for <limits.h> and <float.h> constants.
+ Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* This interface is obsolete. New programs should use
+ <limits.h> and/or <float.h> instead of <values.h>. */
+
+#ifndef _VALUES_H
+#define _VALUES_H 1
+
+#include <features.h>
+
+#include <limits.h>
+
+#define _TYPEBITS(type) (sizeof (type) * CHAR_BIT)
+
+#define CHARBITS _TYPEBITS (char)
+#define SHORTBITS _TYPEBITS (short int)
+#define INTBITS _TYPEBITS (int)
+#define LONGBITS _TYPEBITS (long int)
+#define PTRBITS _TYPEBITS (char *)
+#define DOUBLEBITS _TYPEBITS (double)
+#define FLOATBITS _TYPEBITS (float)
+
+#define MINSHORT SHRT_MIN
+#define MININT INT_MIN
+#define MINLONG LONG_MIN
+
+#define MAXSHORT SHRT_MAX
+#define MAXINT INT_MAX
+#define MAXLONG LONG_MAX
+
+#define HIBITS MINSHORT
+#define HIBITL MINLONG
+
+
+#ifdef __UCLIBC_HAS_FLOATS__
+#include <float.h>
+
+#define MAXDOUBLE DBL_MAX
+#define MAXFLOAT FLT_MAX
+#define MINDOUBLE DBL_MIN
+#define MINFLOAT FLT_MIN
+#define DMINEXP DBL_MIN_EXP
+#define FMINEXP FLT_MIN_EXP
+#define DMAXEXP DBL_MAX_EXP
+#define FMAXEXP FLT_MAX_EXP
+#endif /* __UCLIBC_HAS_FLOATS__ */
+
+
+#ifdef __USE_MISC
+/* Some systems define this name instead of CHAR_BIT or CHARBITS. */
+# define BITSPERBYTE CHAR_BIT
+#endif
+
+#endif /* values.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/video/..install.cmd b/uclibc-crosstools-gcc-4.4.2-1/usr/include/video/..install.cmd
new file mode 100644
index 0000000..7bed870
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/video/..install.cmd
@@ -0,0 +1 @@
+cmd_/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/video/.install := perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/video /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/video mips edid.h sisfb.h uvesafb.h; perl scripts/headers_install.pl /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux-2.6.30/include/video /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/video mips ; touch /shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/linux/include/video/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/video/.install b/uclibc-crosstools-gcc-4.4.2-1/usr/include/video/.install
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/video/.install
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/video/edid.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/video/edid.h
new file mode 100644
index 0000000..4905b1b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/video/edid.h
@@ -0,0 +1,13 @@
+#ifndef __linux_video_edid_h__
+#define __linux_video_edid_h__
+
+#if !defined(__KERNEL__) || defined(CONFIG_X86)
+
+struct edid_info {
+ unsigned char dummy[128];
+};
+
+
+#endif
+
+#endif /* __linux_video_edid_h__ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/video/sisfb.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/video/sisfb.h
new file mode 100644
index 0000000..0b01f0c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/video/sisfb.h
@@ -0,0 +1,209 @@
+/*
+ * sisfb.h - definitions for the SiS framebuffer driver
+ *
+ * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the named License,
+ * or any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifndef _LINUX_SISFB_H_
+#define _LINUX_SISFB_H_
+
+#include <linux/types.h>
+#include <asm/ioctl.h>
+
+/**********************************************/
+/* PUBLIC */
+/**********************************************/
+
+/* vbflags, public (others in sis.h) */
+#define CRT2_DEFAULT 0x00000001
+#define CRT2_LCD 0x00000002
+#define CRT2_TV 0x00000004
+#define CRT2_VGA 0x00000008
+#define TV_NTSC 0x00000010
+#define TV_PAL 0x00000020
+#define TV_HIVISION 0x00000040
+#define TV_YPBPR 0x00000080
+#define TV_AVIDEO 0x00000100
+#define TV_SVIDEO 0x00000200
+#define TV_SCART 0x00000400
+#define TV_PALM 0x00001000
+#define TV_PALN 0x00002000
+#define TV_NTSCJ 0x00001000
+#define TV_CHSCART 0x00008000
+#define TV_CHYPBPR525I 0x00010000
+#define CRT1_VGA 0x00000000
+#define CRT1_LCDA 0x00020000
+#define VGA2_CONNECTED 0x00040000
+#define VB_DISPTYPE_CRT1 0x00080000 /* CRT1 connected and used */
+#define VB_SINGLE_MODE 0x20000000 /* CRT1 or CRT2; determined by DISPTYPE_CRTx */
+#define VB_MIRROR_MODE 0x40000000 /* CRT1 + CRT2 identical (mirror mode) */
+#define VB_DUALVIEW_MODE 0x80000000 /* CRT1 + CRT2 independent (dual head mode) */
+
+/* Aliases: */
+#define CRT2_ENABLE (CRT2_LCD | CRT2_TV | CRT2_VGA)
+#define TV_STANDARD (TV_NTSC | TV_PAL | TV_PALM | TV_PALN | TV_NTSCJ)
+#define TV_INTERFACE (TV_AVIDEO|TV_SVIDEO|TV_SCART|TV_HIVISION|TV_YPBPR|TV_CHSCART|TV_CHYPBPR525I)
+
+/* Only if TV_YPBPR is set: */
+#define TV_YPBPR525I TV_NTSC
+#define TV_YPBPR525P TV_PAL
+#define TV_YPBPR750P TV_PALM
+#define TV_YPBPR1080I TV_PALN
+#define TV_YPBPRALL (TV_YPBPR525I | TV_YPBPR525P | TV_YPBPR750P | TV_YPBPR1080I)
+
+#define VB_DISPTYPE_DISP2 CRT2_ENABLE
+#define VB_DISPTYPE_CRT2 CRT2_ENABLE
+#define VB_DISPTYPE_DISP1 VB_DISPTYPE_CRT1
+#define VB_DISPMODE_SINGLE VB_SINGLE_MODE
+#define VB_DISPMODE_MIRROR VB_MIRROR_MODE
+#define VB_DISPMODE_DUAL VB_DUALVIEW_MODE
+#define VB_DISPLAY_MODE (SINGLE_MODE | MIRROR_MODE | DUALVIEW_MODE)
+
+/* Structure argument for SISFB_GET_INFO ioctl */
+struct sisfb_info {
+ __u32 sisfb_id; /* for identifying sisfb */
+#ifndef SISFB_ID
+#define SISFB_ID 0x53495346 /* Identify myself with 'SISF' */
+#endif
+ __u32 chip_id; /* PCI-ID of detected chip */
+ __u32 memory; /* total video memory in KB */
+ __u32 heapstart; /* heap start offset in KB */
+ __u8 fbvidmode; /* current sisfb mode */
+
+ __u8 sisfb_version;
+ __u8 sisfb_revision;
+ __u8 sisfb_patchlevel;
+
+ __u8 sisfb_caps; /* sisfb capabilities */
+
+ __u32 sisfb_tqlen; /* turbo queue length (in KB) */
+
+ __u32 sisfb_pcibus; /* The card's PCI ID */
+ __u32 sisfb_pcislot;
+ __u32 sisfb_pcifunc;
+
+ __u8 sisfb_lcdpdc; /* PanelDelayCompensation */
+
+ __u8 sisfb_lcda; /* Detected status of LCDA for low res/text modes */
+
+ __u32 sisfb_vbflags;
+ __u32 sisfb_currentvbflags;
+
+ __u32 sisfb_scalelcd;
+ __u32 sisfb_specialtiming;
+
+ __u8 sisfb_haveemi;
+ __u8 sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33;
+ __u8 sisfb_haveemilcd;
+
+ __u8 sisfb_lcdpdca; /* PanelDelayCompensation for LCD-via-CRT1 */
+
+ __u16 sisfb_tvxpos, sisfb_tvypos; /* Warning: Values + 32 ! */
+
+ __u32 sisfb_heapsize; /* heap size (in KB) */
+ __u32 sisfb_videooffset; /* Offset of viewport in video memory (in bytes) */
+
+ __u32 sisfb_curfstn; /* currently running FSTN/DSTN mode */
+ __u32 sisfb_curdstn;
+
+ __u16 sisfb_pci_vendor; /* PCI vendor (SiS or XGI) */
+
+ __u32 sisfb_vbflags2; /* ivideo->vbflags2 */
+
+ __u8 sisfb_can_post; /* sisfb can POST this card */
+ __u8 sisfb_card_posted; /* card is POSTED */
+ __u8 sisfb_was_boot_device; /* This card was the boot video device (ie is primary) */
+
+ __u8 reserved[183]; /* for future use */
+};
+
+#define SISFB_CMD_GETVBFLAGS 0x55AA0001 /* no arg; result[1] = vbflags */
+#define SISFB_CMD_SWITCHCRT1 0x55AA0010 /* arg[0]: 99 = query, 0 = off, 1 = on */
+/* more to come */
+
+#define SISFB_CMD_ERR_OK 0x80000000 /* command succeeded */
+#define SISFB_CMD_ERR_LOCKED 0x80000001 /* sisfb is locked */
+#define SISFB_CMD_ERR_EARLY 0x80000002 /* request before sisfb took over gfx system */
+#define SISFB_CMD_ERR_NOVB 0x80000003 /* No video bridge */
+#define SISFB_CMD_ERR_NOCRT2 0x80000004 /* can't change CRT1 status, CRT2 disabled */
+/* more to come */
+#define SISFB_CMD_ERR_UNKNOWN 0x8000ffff /* Unknown command */
+#define SISFB_CMD_ERR_OTHER 0x80010000 /* Other error */
+
+/* Argument for SISFB_CMD ioctl */
+struct sisfb_cmd {
+ __u32 sisfb_cmd;
+ __u32 sisfb_arg[16];
+ __u32 sisfb_result[4];
+};
+
+/* Addtional IOCTLs for communication sisfb <> X driver */
+/* If changing this, vgatypes.h must also be changed (for X driver) */
+
+/* ioctl for identifying and giving some info (esp. memory heap start) */
+#define SISFB_GET_INFO_SIZE _IOR(0xF3,0x00,__u32)
+#define SISFB_GET_INFO _IOR(0xF3,0x01,struct sisfb_info)
+
+/* ioctrl to get current vertical retrace status */
+#define SISFB_GET_VBRSTATUS _IOR(0xF3,0x02,__u32)
+
+/* ioctl to enable/disable panning auto-maximize (like nomax parameter) */
+#define SISFB_GET_AUTOMAXIMIZE _IOR(0xF3,0x03,__u32)
+#define SISFB_SET_AUTOMAXIMIZE _IOW(0xF3,0x03,__u32)
+
+/* ioctls to relocate TV output (x=D[31:16], y=D[15:0], + 32)*/
+#define SISFB_GET_TVPOSOFFSET _IOR(0xF3,0x04,__u32)
+#define SISFB_SET_TVPOSOFFSET _IOW(0xF3,0x04,__u32)
+
+/* ioctl for internal sisfb commands (sisfbctrl) */
+#define SISFB_COMMAND _IOWR(0xF3,0x05,struct sisfb_cmd)
+
+/* ioctl for locking sisfb (no register access during lock) */
+/* As of now, only used to avoid register access during
+ * the ioctls listed above.
+ */
+#define SISFB_SET_LOCK _IOW(0xF3,0x06,__u32)
+
+/* ioctls 0xF3 up to 0x3F reserved for sisfb */
+
+/****************************************************************/
+/* The following are deprecated and should not be used anymore: */
+/****************************************************************/
+/* ioctl for identifying and giving some info (esp. memory heap start) */
+#define SISFB_GET_INFO_OLD _IOR('n',0xF8,__u32)
+/* ioctrl to get current vertical retrace status */
+#define SISFB_GET_VBRSTATUS_OLD _IOR('n',0xF9,__u32)
+/* ioctl to enable/disable panning auto-maximize (like nomax parameter) */
+#define SISFB_GET_AUTOMAXIMIZE_OLD _IOR('n',0xFA,__u32)
+#define SISFB_SET_AUTOMAXIMIZE_OLD _IOW('n',0xFA,__u32)
+/****************************************************************/
+/* End of deprecated ioctl numbers */
+/****************************************************************/
+
+/* For fb memory manager (FBIO_ALLOC, FBIO_FREE) */
+struct sis_memreq {
+ __u32 offset;
+ __u32 size;
+};
+
+/**********************************************/
+/* PRIVATE */
+/* (for IN-KERNEL usage only) */
+/**********************************************/
+
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/video/uvesafb.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/video/uvesafb.h
new file mode 100644
index 0000000..79e281b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/video/uvesafb.h
@@ -0,0 +1,60 @@
+#ifndef _UVESAFB_H
+#define _UVESAFB_H
+
+#include <linux/types.h>
+
+struct v86_regs {
+ __u32 ebx;
+ __u32 ecx;
+ __u32 edx;
+ __u32 esi;
+ __u32 edi;
+ __u32 ebp;
+ __u32 eax;
+ __u32 eip;
+ __u32 eflags;
+ __u32 esp;
+ __u16 cs;
+ __u16 ss;
+ __u16 es;
+ __u16 ds;
+ __u16 fs;
+ __u16 gs;
+};
+
+/* Task flags */
+#define TF_VBEIB 0x01
+#define TF_BUF_ESDI 0x02
+#define TF_BUF_ESBX 0x04
+#define TF_BUF_RET 0x08
+#define TF_EXIT 0x10
+
+struct uvesafb_task {
+ __u8 flags;
+ int buf_len;
+ struct v86_regs regs;
+};
+
+/* Constants for the capabilities field
+ * in vbe_ib */
+#define VBE_CAP_CAN_SWITCH_DAC 0x01
+#define VBE_CAP_VGACOMPAT 0x02
+
+/* The VBE Info Block */
+struct vbe_ib {
+ char vbe_signature[4];
+ __u16 vbe_version;
+ __u32 oem_string_ptr;
+ __u32 capabilities;
+ __u32 mode_list_ptr;
+ __u16 total_memory;
+ __u16 oem_software_rev;
+ __u32 oem_vendor_name_ptr;
+ __u32 oem_product_name_ptr;
+ __u32 oem_product_rev_ptr;
+ __u8 reserved[222];
+ char oem_data[256];
+ char misc_data[512];
+} __attribute__ ((packed));
+
+#endif /* _UVESAFB_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/wait.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/wait.h
new file mode 100644
index 0000000..d01b811
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/wait.h
@@ -0,0 +1 @@
+#include <sys/wait.h>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/wchar.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/wchar.h
new file mode 100644
index 0000000..e461f71
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/wchar.h
@@ -0,0 +1,752 @@
+/* Copyright (C) 1995-2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.24
+ * Extended multibyte and wide character utilities <wchar.h>
+ */
+
+#ifndef _WCHAR_H
+
+#ifndef __need_mbstate_t
+# define _WCHAR_H 1
+# include <features.h>
+#endif
+
+#ifndef __UCLIBC_HAS_WCHAR__
+#error Attempted to include wchar.h when uClibc built without wide char support.
+#endif
+
+#ifdef _WCHAR_H
+/* Get FILE definition. */
+# define __need___FILE
+# ifdef __USE_UNIX98
+# define __need_FILE
+# endif
+# include <stdio.h>
+/* Get va_list definition. */
+# define __need___va_list
+# include <stdarg.h>
+
+/* Get size_t, wchar_t, wint_t and NULL from <stddef.h>. */
+# define __need_size_t
+# define __need_wchar_t
+# define __need_NULL
+#endif
+#define __need_wint_t
+#include <stddef.h>
+
+#include <bits/wchar.h>
+
+/* We try to get wint_t from <stddef.h>, but not all GCC versions define it
+ there. So define it ourselves if it remains undefined. */
+#ifndef _WINT_T
+/* Integral type unchanged by default argument promotions that can
+ hold any value corresponding to members of the extended character
+ set, as well as at least one value that does not correspond to any
+ member of the extended character set. */
+# define _WINT_T
+typedef unsigned int wint_t;
+#else
+/* Work around problems with the <stddef.h> file which doesn't put
+ wint_t in the std namespace. */
+# if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES \
+ && defined __WINT_TYPE__
+__BEGIN_NAMESPACE_STD
+typedef __WINT_TYPE__ wint_t;
+__END_NAMESPACE_STD
+# endif
+#endif
+
+
+#ifndef __mbstate_t_defined
+# define __mbstate_t_defined 1
+/* Conversion state information. */
+#if 1
+typedef struct
+{
+ wchar_t __mask;
+ wchar_t __wc;
+} __mbstate_t;
+#else
+typedef struct
+{
+ int __count;
+ union
+ {
+ wint_t __wch;
+ char __wchb[4];
+ } __value; /* Value so far. */
+} __mbstate_t;
+#endif
+#endif
+#undef __need_mbstate_t
+
+
+/* The rest of the file is only used if used if __need_mbstate_t is not
+ defined. */
+#ifdef _WCHAR_H
+
+__BEGIN_NAMESPACE_C99
+/* Public type. */
+typedef __mbstate_t mbstate_t;
+__END_NAMESPACE_C99
+#ifdef __USE_GNU
+__USING_NAMESPACE_C99(mbstate_t)
+#endif
+
+#ifndef WCHAR_MIN
+/* These constants might also be defined in <inttypes.h>. */
+# define WCHAR_MIN __WCHAR_MIN
+# define WCHAR_MAX __WCHAR_MAX
+#endif
+
+#ifndef WEOF
+# define WEOF (0xffffffffu)
+#endif
+
+/* For XPG4 compliance we have to define the stuff from <wctype.h> here
+ as well. */
+#if defined __USE_XOPEN && !defined __USE_UNIX98
+# include <wctype.h>
+#endif
+
+
+__BEGIN_DECLS
+
+__BEGIN_NAMESPACE_STD
+/* This incomplete type is defined in <time.h> but needed here because
+ of `wcsftime'. */
+struct tm;
+/* XXX We have to clean this up at some point. Since tm is in the std
+ namespace but wcsftime is in __c99 the type wouldn't be found
+ without inserting it in the global namespace. */
+__USING_NAMESPACE_STD(tm)
+__END_NAMESPACE_STD
+
+
+__BEGIN_NAMESPACE_C99
+/* Copy SRC to DEST. */
+extern wchar_t *wcscpy (wchar_t *__restrict __dest,
+ __const wchar_t *__restrict __src) __THROW;
+/* Copy no more than N wide-characters of SRC to DEST. */
+extern wchar_t *wcsncpy (wchar_t *__restrict __dest,
+ __const wchar_t *__restrict __src, size_t __n)
+ __THROW;
+
+/* Append SRC onto DEST. */
+extern wchar_t *wcscat (wchar_t *__restrict __dest,
+ __const wchar_t *__restrict __src) __THROW;
+/* Append no more than N wide-characters of SRC onto DEST. */
+extern wchar_t *wcsncat (wchar_t *__restrict __dest,
+ __const wchar_t *__restrict __src, size_t __n)
+ __THROW;
+
+/* Compare S1 and S2. */
+extern int wcscmp (__const wchar_t *__s1, __const wchar_t *__s2)
+ __THROW __attribute_pure__;
+/* Compare N wide-characters of S1 and S2. */
+extern int wcsncmp (__const wchar_t *__s1, __const wchar_t *__s2, size_t __n)
+ __THROW __attribute_pure__;
+__END_NAMESPACE_C99
+
+#ifdef __USE_GNU
+/* Compare S1 and S2, ignoring case. */
+extern int wcscasecmp (__const wchar_t *__s1, __const wchar_t *__s2) __THROW;
+
+/* Compare no more than N chars of S1 and S2, ignoring case. */
+extern int wcsncasecmp (__const wchar_t *__s1, __const wchar_t *__s2,
+ size_t __n) __THROW;
+
+#ifdef __UCLIBC_HAS_XLOCALE__
+/* Similar to the two functions above but take the information from
+ the provided locale and not the global locale. */
+# include <xlocale.h>
+
+extern int wcscasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2,
+ __locale_t __loc) __THROW;
+
+extern int wcsncasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2,
+ size_t __n, __locale_t __loc) __THROW;
+#endif /* __UCLIBC_HAS_XLOCALE__ */
+#endif
+
+__BEGIN_NAMESPACE_C99
+/* Compare S1 and S2, both interpreted as appropriate to the
+ LC_COLLATE category of the current locale. */
+extern int wcscoll (__const wchar_t *__s1, __const wchar_t *__s2) __THROW;
+/* Transform S2 into array pointed to by S1 such that if wcscmp is
+ applied to two transformed strings the result is the as applying
+ `wcscoll' to the original strings. */
+extern size_t wcsxfrm (wchar_t *__restrict __s1,
+ __const wchar_t *__restrict __s2, size_t __n) __THROW;
+__END_NAMESPACE_C99
+
+#ifdef __USE_GNU
+#ifdef __UCLIBC_HAS_XLOCALE__
+/* Similar to the two functions above but take the information from
+ the provided locale and not the global locale. */
+
+/* Compare S1 and S2, both interpreted as appropriate to the
+ LC_COLLATE category of the given locale. */
+extern int wcscoll_l (__const wchar_t *__s1, __const wchar_t *__s2,
+ __locale_t __loc) __THROW;
+
+/* Transform S2 into array pointed to by S1 such that if wcscmp is
+ applied to two transformed strings the result is the as applying
+ `wcscoll' to the original strings. */
+extern size_t wcsxfrm_l (wchar_t *__s1, __const wchar_t *__s2,
+ size_t __n, __locale_t __loc) __THROW;
+
+#endif /* __UCLIBC_HAS_XLOCALE__ */
+
+/* Duplicate S, returning an identical malloc'd string. */
+extern wchar_t *wcsdup (__const wchar_t *__s) __THROW __attribute_malloc__;
+#endif
+
+__BEGIN_NAMESPACE_C99
+/* Find the first occurrence of WC in WCS. */
+extern wchar_t *wcschr (__const wchar_t *__wcs, wchar_t __wc)
+ __THROW __attribute_pure__;
+/* Find the last occurrence of WC in WCS. */
+extern wchar_t *wcsrchr (__const wchar_t *__wcs, wchar_t __wc)
+ __THROW __attribute_pure__;
+__END_NAMESPACE_C99
+
+#ifdef __USE_GNU
+/* This function is similar to `wcschr'. But it returns a pointer to
+ the closing NUL wide character in case C is not found in S. */
+extern wchar_t *wcschrnul (__const wchar_t *__s, wchar_t __wc)
+ __THROW __attribute_pure__;
+#endif
+
+__BEGIN_NAMESPACE_C99
+/* Return the length of the initial segmet of WCS which
+ consists entirely of wide characters not in REJECT. */
+extern size_t wcscspn (__const wchar_t *__wcs, __const wchar_t *__reject)
+ __THROW __attribute_pure__;
+/* Return the length of the initial segmet of WCS which
+ consists entirely of wide characters in ACCEPT. */
+extern size_t wcsspn (__const wchar_t *__wcs, __const wchar_t *__accept)
+ __THROW __attribute_pure__;
+/* Find the first occurrence in WCS of any character in ACCEPT. */
+extern wchar_t *wcspbrk (__const wchar_t *__wcs, __const wchar_t *__accept)
+ __THROW __attribute_pure__;
+/* Find the first occurrence of NEEDLE in HAYSTACK. */
+extern wchar_t *wcsstr (__const wchar_t *__haystack, __const wchar_t *__needle)
+ __THROW __attribute_pure__;
+
+/* Divide WCS into tokens separated by characters in DELIM. */
+extern wchar_t *wcstok (wchar_t *__restrict __s,
+ __const wchar_t *__restrict __delim,
+ wchar_t **__restrict __ptr) __THROW;
+
+/* Return the number of wide characters in S. */
+extern size_t wcslen (__const wchar_t *__s) __THROW __attribute_pure__;
+__END_NAMESPACE_C99
+
+#ifdef __USE_XOPEN
+/* Another name for `wcsstr' from XPG4. */
+extern wchar_t *wcswcs (__const wchar_t *__haystack, __const wchar_t *__needle)
+ __THROW __attribute_pure__;
+#endif
+
+#ifdef __USE_GNU
+/* Return the number of wide characters in S, but at most MAXLEN. */
+extern size_t wcsnlen (__const wchar_t *__s, size_t __maxlen)
+ __THROW __attribute_pure__;
+#endif
+
+
+__BEGIN_NAMESPACE_C99
+/* Search N wide characters of S for C. */
+extern wchar_t *wmemchr (__const wchar_t *__s, wchar_t __c, size_t __n)
+ __THROW __attribute_pure__;
+
+/* Compare N wide characters of S1 and S2. */
+extern int wmemcmp (__const wchar_t *__restrict __s1,
+ __const wchar_t *__restrict __s2, size_t __n)
+ __THROW __attribute_pure__;
+
+/* Copy N wide characters of SRC to DEST. */
+extern wchar_t *wmemcpy (wchar_t *__restrict __s1,
+ __const wchar_t *__restrict __s2, size_t __n) __THROW;
+
+/* Copy N wide characters of SRC to DEST, guaranteeing
+ correct behavior for overlapping strings. */
+extern wchar_t *wmemmove (wchar_t *__s1, __const wchar_t *__s2, size_t __n)
+ __THROW;
+
+/* Set N wide characters of S to C. */
+extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
+__END_NAMESPACE_C99
+
+#ifdef __USE_GNU
+/* Copy N wide characters of SRC to DEST and return pointer to following
+ wide character. */
+extern wchar_t *wmempcpy (wchar_t *__restrict __s1,
+ __const wchar_t *__restrict __s2, size_t __n)
+ __THROW;
+#endif
+
+
+__BEGIN_NAMESPACE_C99
+/* Determine whether C constitutes a valid (one-byte) multibyte
+ character. */
+extern wint_t btowc (int __c) __THROW;
+
+/* Determine whether C corresponds to a member of the extended
+ character set whose multibyte representation is a single byte. */
+extern int wctob (wint_t __c) __THROW;
+
+/* Determine whether PS points to an object representing the initial
+ state. */
+extern int mbsinit (__const mbstate_t *__ps) __THROW __attribute_pure__;
+
+/* Write wide character representation of multibyte character pointed
+ to by S to PWC. */
+extern size_t mbrtowc (wchar_t *__restrict __pwc,
+ __const char *__restrict __s, size_t __n,
+ mbstate_t *__p) __THROW;
+
+/* Write multibyte representation of wide character WC to S. */
+extern size_t wcrtomb (char *__restrict __s, wchar_t __wc,
+ mbstate_t *__restrict __ps) __THROW;
+
+/* Return number of bytes in multibyte character pointed to by S. */
+#if 0 /* uClibc: disabled */
+extern size_t __mbrlen (__const char *__restrict __s, size_t __n,
+ mbstate_t *__restrict __ps) __THROW;
+#endif
+extern size_t mbrlen (__const char *__restrict __s, size_t __n,
+ mbstate_t *__restrict __ps) __THROW;
+
+/* Write wide character representation of multibyte character string
+ SRC to DST. */
+extern size_t mbsrtowcs (wchar_t *__restrict __dst,
+ __const char **__restrict __src, size_t __len,
+ mbstate_t *__restrict __ps) __THROW;
+
+/* Write multibyte character representation of wide character string
+ SRC to DST. */
+extern size_t wcsrtombs (char *__restrict __dst,
+ __const wchar_t **__restrict __src, size_t __len,
+ mbstate_t *__restrict __ps) __THROW;
+__END_NAMESPACE_C99
+
+
+#ifdef __USE_GNU
+/* Write wide character representation of at most NMC bytes of the
+ multibyte character string SRC to DST. */
+extern size_t mbsnrtowcs (wchar_t *__restrict __dst,
+ __const char **__restrict __src, size_t __nmc,
+ size_t __len, mbstate_t *__restrict __ps) __THROW;
+
+/* Write multibyte character representation of at most NWC characters
+ from the wide character string SRC to DST. */
+extern size_t wcsnrtombs (char *__restrict __dst,
+ __const wchar_t **__restrict __src,
+ size_t __nwc, size_t __len,
+ mbstate_t *__restrict __ps) __THROW;
+#endif /* use GNU */
+
+
+/* The following functions are extensions found in X/Open CAE. */
+#ifdef __USE_XOPEN
+/* Determine number of column positions required for C. */
+extern int wcwidth (wchar_t __c) __THROW;
+
+/* Determine number of column positions required for first N wide
+ characters (or fewer if S ends before this) in S. */
+extern int wcswidth (__const wchar_t *__s, size_t __n) __THROW;
+#endif /* Use X/Open. */
+
+
+__BEGIN_NAMESPACE_C99
+#ifdef __UCLIBC_HAS_FLOATS__
+/* Convert initial portion of the wide string NPTR to `double'
+ representation. */
+extern double wcstod (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr) __THROW;
+
+#ifdef __USE_ISOC99
+/* Likewise for `float' and `long double' sizes of floating-point numbers. */
+extern float wcstof (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr) __THROW;
+extern long double wcstold (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr) __THROW;
+#endif /* C99 */
+#endif /* __UCLIBC_HAS_FLOATS__ */
+
+
+/* Convert initial portion of wide string NPTR to `long int'
+ representation. */
+extern long int wcstol (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr, int __base) __THROW;
+
+/* Convert initial portion of wide string NPTR to `unsigned long int'
+ representation. */
+extern unsigned long int wcstoul (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr, int __base)
+ __THROW;
+
+#if defined __USE_ISOC99 || (defined __GNUC__ && defined __USE_GNU)
+/* Convert initial portion of wide string NPTR to `long int'
+ representation. */
+__extension__
+extern long long int wcstoll (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr, int __base)
+ __THROW;
+
+/* Convert initial portion of wide string NPTR to `unsigned long long int'
+ representation. */
+__extension__
+extern unsigned long long int wcstoull (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr,
+ int __base) __THROW;
+#endif /* ISO C99 or GCC and GNU. */
+__END_NAMESPACE_C99
+
+#if defined __GNUC__ && defined __USE_GNU
+/* Convert initial portion of wide string NPTR to `long int'
+ representation. */
+__extension__
+extern long long int wcstoq (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr, int __base)
+ __THROW;
+
+/* Convert initial portion of wide string NPTR to `unsigned long long int'
+ representation. */
+__extension__
+extern unsigned long long int wcstouq (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr,
+ int __base) __THROW;
+#endif /* GCC and use GNU. */
+
+#ifdef __USE_GNU
+#ifdef __UCLIBC_HAS_XLOCALE__
+/* The concept of one static locale per category is not very well
+ thought out. Many applications will need to process its data using
+ information from several different locales. Another application is
+ the implementation of the internationalization handling in the
+ upcoming ISO C++ standard library. To support this another set of
+ the functions using locale data exist which have an additional
+ argument.
+
+ Attention: all these functions are *not* standardized in any form.
+ This is a proof-of-concept implementation. */
+
+/* Structure for reentrant locale using functions. This is an
+ (almost) opaque type for the user level programs. */
+# include <xlocale.h>
+
+/* Special versions of the functions above which take the locale to
+ use as an additional parameter. */
+extern long int wcstol_l (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr, int __base,
+ __locale_t __loc) __THROW;
+
+extern unsigned long int wcstoul_l (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr,
+ int __base, __locale_t __loc) __THROW;
+
+__extension__
+extern long long int wcstoll_l (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr,
+ int __base, __locale_t __loc) __THROW;
+
+__extension__
+extern unsigned long long int wcstoull_l (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr,
+ int __base, __locale_t __loc)
+ __THROW;
+
+#ifdef __UCLIBC_HAS_FLOATS__
+extern double wcstod_l (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr, __locale_t __loc)
+ __THROW;
+
+extern float wcstof_l (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr, __locale_t __loc)
+ __THROW;
+
+extern long double wcstold_l (__const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr,
+ __locale_t __loc) __THROW;
+#endif /* __UCLIBC_HAS_FLOATS__ */
+#endif /* __UCLIBC_HAS_XLOCALE__ */
+#endif /* GNU */
+
+
+#ifdef __USE_GNU
+/* Copy SRC to DEST, returning the address of the terminating L'\0' in
+ DEST. */
+extern wchar_t *wcpcpy (wchar_t *__dest, __const wchar_t *__src) __THROW;
+
+/* Copy no more than N characters of SRC to DEST, returning the address of
+ the last character written into DEST. */
+extern wchar_t *wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n)
+ __THROW;
+#endif /* use GNU */
+
+
+/* Wide character I/O functions. */
+#if defined __USE_ISOC99 || defined __USE_UNIX98
+__BEGIN_NAMESPACE_C99
+
+/* Select orientation for stream. */
+extern int fwide (__FILE *__fp, int __mode) __THROW;
+
+
+/* Write formatted output to STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fwprintf (__FILE *__restrict __stream,
+ __const wchar_t *__restrict __format, ...)
+ /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */;
+/* Write formatted output to stdout.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int wprintf (__const wchar_t *__restrict __format, ...)
+ /* __attribute__ ((__format__ (__wprintf__, 1, 2))) */;
+/* Write formatted output of at most N characters to S. */
+extern int swprintf (wchar_t *__restrict __s, size_t __n,
+ __const wchar_t *__restrict __format, ...)
+ __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 4))) */;
+
+/* Write formatted output to S from argument list ARG.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int vfwprintf (__FILE *__restrict __s,
+ __const wchar_t *__restrict __format,
+ __gnuc_va_list __arg)
+ /* __attribute__ ((__format__ (__wprintf__, 2, 0))) */;
+/* Write formatted output to stdout from argument list ARG.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int vwprintf (__const wchar_t *__restrict __format,
+ __gnuc_va_list __arg)
+ /* __attribute__ ((__format__ (__wprintf__, 1, 0))) */;
+/* Write formatted output of at most N character to S from argument
+ list ARG. */
+extern int vswprintf (wchar_t *__restrict __s, size_t __n,
+ __const wchar_t *__restrict __format,
+ __gnuc_va_list __arg)
+ __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */;
+
+
+/* Read formatted input from STREAM.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int fwscanf (__FILE *__restrict __stream,
+ __const wchar_t *__restrict __format, ...)
+ /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
+/* Read formatted input from stdin.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int wscanf (__const wchar_t *__restrict __format, ...)
+ /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */;
+/* Read formatted input from S. */
+extern int swscanf (__const wchar_t *__restrict __s,
+ __const wchar_t *__restrict __format, ...)
+ __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
+
+__END_NAMESPACE_C99
+#endif /* Use ISO C99 and Unix98. */
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+
+/* Read formatted input from S into argument list ARG.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int vfwscanf (__FILE *__restrict __s,
+ __const wchar_t *__restrict __format,
+ __gnuc_va_list __arg)
+ /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
+/* Read formatted input from stdin into argument list ARG.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int vwscanf (__const wchar_t *__restrict __format,
+ __gnuc_va_list __arg)
+ /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */;
+/* Read formatted input from S into argument list ARG. */
+extern int vswscanf (__const wchar_t *__restrict __s,
+ __const wchar_t *__restrict __format,
+ __gnuc_va_list __arg)
+ __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
+
+__END_NAMESPACE_C99
+#endif /* Use ISO C99. */
+
+
+__BEGIN_NAMESPACE_C99
+/* Read a character from STREAM.
+
+ These functions are possible cancellation points and therefore not
+ marked with __THROW. */
+extern wint_t fgetwc (__FILE *__stream);
+extern wint_t getwc (__FILE *__stream);
+
+/* Read a character from stdin.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern wint_t getwchar (void);
+
+
+/* Write a character to STREAM.
+
+ These functions are possible cancellation points and therefore not
+ marked with __THROW. */
+extern wint_t fputwc (wchar_t __wc, __FILE *__stream);
+extern wint_t putwc (wchar_t __wc, __FILE *__stream);
+
+/* Write a character to stdout.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern wint_t putwchar (wchar_t __wc);
+
+
+/* Get a newline-terminated wide character string of finite length
+ from STREAM.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n,
+ __FILE *__restrict __stream);
+
+/* Write a string to STREAM.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern int fputws (__const wchar_t *__restrict __ws,
+ __FILE *__restrict __stream);
+
+
+/* Push a character back onto the input buffer of STREAM.
+
+ This function is a possible cancellation points and therefore not
+ marked with __THROW. */
+extern wint_t ungetwc (wint_t __wc, __FILE *__stream);
+__END_NAMESPACE_C99
+
+
+#ifdef __USE_GNU
+/* These are defined to be equivalent to the `char' functions defined
+ in POSIX.1:1996.
+
+ These functions are not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation they are cancellation points and
+ therefore not marked with __THROW. */
+extern wint_t getwc_unlocked (__FILE *__stream);
+extern wint_t getwchar_unlocked (void);
+
+/* This is the wide character version of a GNU extension.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern wint_t fgetwc_unlocked (__FILE *__stream);
+
+/* Faster version when locking is not necessary.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern wint_t fputwc_unlocked (wchar_t __wc, __FILE *__stream);
+
+/* These are defined to be equivalent to the `char' functions defined
+ in POSIX.1:1996.
+
+ These functions are not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation they are cancellation points and
+ therefore not marked with __THROW. */
+extern wint_t putwc_unlocked (wchar_t __wc, __FILE *__stream);
+extern wint_t putwchar_unlocked (wchar_t __wc);
+
+
+/* This function does the same as `fgetws' but does not lock the stream.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n,
+ __FILE *__restrict __stream);
+
+/* This function does the same as `fputws' but does not lock the stream.
+
+ This function is not part of POSIX and therefore no official
+ cancellation point. But due to similarity with an POSIX interface
+ or due to the implementation it is a cancellation point and
+ therefore not marked with __THROW. */
+extern int fputws_unlocked (__const wchar_t *__restrict __ws,
+ __FILE *__restrict __stream);
+#endif
+
+
+__BEGIN_NAMESPACE_C99
+/* Format TP into S according to FORMAT.
+ Write no more than MAXSIZE wide characters and return the number
+ of wide characters written, or 0 if it would exceed MAXSIZE. */
+extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize,
+ __const wchar_t *__restrict __format,
+ __const struct tm *__restrict __tp) __THROW;
+__END_NAMESPACE_C99
+
+# if defined __USE_GNU && defined __UCLIBC_HAS_XLOCALE__
+# include <xlocale.h>
+
+/* Similar to `wcsftime' but takes the information from
+ the provided locale and not the global locale. */
+extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize,
+ __const wchar_t *__restrict __format,
+ __const struct tm *__restrict __tp,
+ __locale_t __loc) __THROW;
+# endif
+
+/* The X/Open standard demands that most of the functions defined in
+ the <wctype.h> header must also appear here. This is probably
+ because some X/Open members wrote their implementation before the
+ ISO C standard was published and introduced the better solution.
+ We have to provide these definitions for compliance reasons but we
+ do this nonsense only if really necessary. */
+#if defined __USE_UNIX98 && !defined __USE_GNU
+# define __need_iswxxx
+# include <wctype.h>
+#endif
+
+__END_DECLS
+
+#endif /* _WCHAR_H defined */
+
+#endif /* wchar.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/include/wctype.h b/uclibc-crosstools-gcc-4.4.2-1/usr/include/wctype.h
new file mode 100644
index 0000000..266ffab
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/include/wctype.h
@@ -0,0 +1,330 @@
+/* Copyright (C) 1996,97,98,99,2000,01,02 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * ISO C99 Standard: 7.25
+ * Wide character classification and mapping utilities <wctype.h>
+ */
+
+#ifndef _WCTYPE_H
+
+#include <features.h>
+#include <bits/types.h>
+
+#ifndef __UCLIBC_HAS_WCHAR__
+#error Attempted to include wctype.h when uClibc built without wide char support.
+#endif
+
+#ifndef __need_iswxxx
+# define _WCTYPE_H 1
+
+/* We try to get wint_t from <stddef.h>, but not all GCC versions define it
+ there. So define it ourselves if it remains undefined. */
+# define __need_wint_t
+# include <stddef.h>
+# ifndef _WINT_T
+/* Integral type unchanged by default argument promotions that can
+ hold any value corresponding to members of the extended character
+ set, as well as at least one value that does not correspond to any
+ member of the extended character set. */
+# define _WINT_T
+typedef unsigned int wint_t;
+# else
+# ifdef __USE_ISOC99
+__USING_NAMESPACE_C99(wint_t)
+# endif
+# endif
+
+/* Constant expression of type `wint_t' whose value does not correspond
+ to any member of the extended character set. */
+# ifndef WEOF
+# define WEOF (0xffffffffu)
+# endif
+#endif
+#undef __need_iswxxx
+
+
+/* The following part is also used in the <wcsmbs.h> header when compiled
+ in the Unix98 compatibility mode. */
+#ifndef __iswxxx_defined
+# define __iswxxx_defined 1
+
+__BEGIN_NAMESPACE_C99
+/* Scalar type that can hold values which represent locale-specific
+ character classifications. */
+/* uClibc note: glibc uses - typedef unsigned long int wctype_t; */
+typedef unsigned int wctype_t;
+__END_NAMESPACE_C99
+
+# ifndef _ISwbit
+# define _ISwbit(bit) (1 << (bit))
+
+enum
+{
+ __ISwupper = 0, /* UPPERCASE. */
+ __ISwlower = 1, /* lowercase. */
+ __ISwalpha = 2, /* Alphabetic. */
+ __ISwdigit = 3, /* Numeric. */
+ __ISwxdigit = 4, /* Hexadecimal numeric. */
+ __ISwspace = 5, /* Whitespace. */
+ __ISwprint = 6, /* Printing. */
+ __ISwgraph = 7, /* Graphical. */
+ __ISwblank = 8, /* Blank (usually SPC and TAB). */
+ __ISwcntrl = 9, /* Control character. */
+ __ISwpunct = 10, /* Punctuation. */
+ __ISwalnum = 11, /* Alphanumeric. */
+
+ _ISwupper = _ISwbit (__ISwupper), /* UPPERCASE. */
+ _ISwlower = _ISwbit (__ISwlower), /* lowercase. */
+ _ISwalpha = _ISwbit (__ISwalpha), /* Alphabetic. */
+ _ISwdigit = _ISwbit (__ISwdigit), /* Numeric. */
+ _ISwxdigit = _ISwbit (__ISwxdigit), /* Hexadecimal numeric. */
+ _ISwspace = _ISwbit (__ISwspace), /* Whitespace. */
+ _ISwprint = _ISwbit (__ISwprint), /* Printing. */
+ _ISwgraph = _ISwbit (__ISwgraph), /* Graphical. */
+ _ISwblank = _ISwbit (__ISwblank), /* Blank (usually SPC and TAB). */
+ _ISwcntrl = _ISwbit (__ISwcntrl), /* Control character. */
+ _ISwpunct = _ISwbit (__ISwpunct), /* Punctuation. */
+ _ISwalnum = _ISwbit (__ISwalnum) /* Alphanumeric. */
+};
+# else
+# if defined(__UCLIBC_MJN3_ONLY__) && defined(L_iswctype)
+#warning remove _ISwbit already defined check?
+#error _ISwbit already defined!
+# endif
+# endif /* Not _ISwbit */
+
+
+__BEGIN_DECLS
+
+__BEGIN_NAMESPACE_C99
+/*
+ * Wide-character classification functions: 7.15.2.1.
+ */
+
+/* Test for any wide character for which `iswalpha' or `iswdigit' is
+ true. */
+extern int iswalnum (wint_t __wc) __THROW;
+
+/* Test for any wide character for which `iswupper' or 'iswlower' is
+ true, or any wide character that is one of a locale-specific set of
+ wide-characters for which none of `iswcntrl', `iswdigit',
+ `iswpunct', or `iswspace' is true. */
+extern int iswalpha (wint_t __wc) __THROW;
+
+/* Test for any control wide character. */
+extern int iswcntrl (wint_t __wc) __THROW;
+
+/* Test for any wide character that corresponds to a decimal-digit
+ character. */
+extern int iswdigit (wint_t __wc) __THROW;
+
+/* Test for any wide character for which `iswprint' is true and
+ `iswspace' is false. */
+extern int iswgraph (wint_t __wc) __THROW;
+
+/* Test for any wide character that corresponds to a lowercase letter
+ or is one of a locale-specific set of wide characters for which
+ none of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */
+extern int iswlower (wint_t __wc) __THROW;
+
+/* Test for any printing wide character. */
+extern int iswprint (wint_t __wc) __THROW;
+
+/* Test for any printing wide character that is one of a
+ locale-specific et of wide characters for which neither `iswspace'
+ nor `iswalnum' is true. */
+extern int iswpunct (wint_t __wc) __THROW;
+
+/* Test for any wide character that corresponds to a locale-specific
+ set of wide characters for which none of `iswalnum', `iswgraph', or
+ `iswpunct' is true. */
+extern int iswspace (wint_t __wc) __THROW;
+
+/* Test for any wide character that corresponds to an uppercase letter
+ or is one of a locale-specific set of wide character for which none
+ of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */
+extern int iswupper (wint_t __wc) __THROW;
+
+/* Test for any wide character that corresponds to a hexadecimal-digit
+ character equivalent to that performed be the functions described
+ in the previous subclause. */
+extern int iswxdigit (wint_t __wc) __THROW;
+
+/* Test for any wide character that corresponds to a standard blank
+ wide character or a locale-specific set of wide characters for
+ which `iswalnum' is false. */
+# ifdef __USE_ISOC99
+extern int iswblank (wint_t __wc) __THROW;
+# endif
+
+/*
+ * Extensible wide-character classification functions: 7.15.2.2.
+ */
+
+/* Construct value that describes a class of wide characters identified
+ by the string argument PROPERTY. */
+extern wctype_t wctype (__const char *__property) __THROW;
+
+/* Determine whether the wide-character WC has the property described by
+ DESC. */
+extern int iswctype (wint_t __wc, wctype_t __desc) __THROW;
+__END_NAMESPACE_C99
+
+
+/*
+ * Wide-character case-mapping functions: 7.15.3.1.
+ */
+
+__BEGIN_NAMESPACE_C99
+/* Scalar type that can hold values which represent locale-specific
+ character mappings. */
+/* uClibc note: glibc uses - typedef __const __int32_t *wctrans_t; */
+typedef unsigned int wctrans_t;
+__END_NAMESPACE_C99
+#ifdef __USE_GNU
+__USING_NAMESPACE_C99(wctrans_t)
+#endif
+
+__BEGIN_NAMESPACE_C99
+/* Converts an uppercase letter to the corresponding lowercase letter. */
+extern wint_t towlower (wint_t __wc) __THROW;
+
+/* Converts an lowercase letter to the corresponding uppercase letter. */
+extern wint_t towupper (wint_t __wc) __THROW;
+__END_NAMESPACE_C99
+
+__END_DECLS
+
+#endif /* need iswxxx. */
+
+
+/* The remaining definitions and declarations must not appear in the
+ <wcsmbs.h> header. */
+#ifdef _WCTYPE_H
+
+/*
+ * Extensible wide-character mapping functions: 7.15.3.2.
+ */
+
+__BEGIN_DECLS
+
+__BEGIN_NAMESPACE_C99
+/* Construct value that describes a mapping between wide characters
+ identified by the string argument PROPERTY. */
+extern wctrans_t wctrans (__const char *__property) __THROW;
+
+/* Map the wide character WC using the mapping described by DESC. */
+extern wint_t towctrans (wint_t __wc, wctrans_t __desc) __THROW;
+__END_NAMESPACE_C99
+
+#if defined(__USE_GNU) && defined(__UCLIBC_HAS_XLOCALE__)
+/* Declare the interface to extended locale model. */
+# include <xlocale.h>
+
+/* Test for any wide character for which `iswalpha' or `iswdigit' is
+ true. */
+extern int iswalnum_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any wide character for which `iswupper' or 'iswlower' is
+ true, or any wide character that is one of a locale-specific set of
+ wide-characters for which none of `iswcntrl', `iswdigit',
+ `iswpunct', or `iswspace' is true. */
+extern int iswalpha_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any control wide character. */
+extern int iswcntrl_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any wide character that corresponds to a decimal-digit
+ character. */
+extern int iswdigit_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any wide character for which `iswprint' is true and
+ `iswspace' is false. */
+extern int iswgraph_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any wide character that corresponds to a lowercase letter
+ or is one of a locale-specific set of wide characters for which
+ none of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */
+extern int iswlower_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any printing wide character. */
+extern int iswprint_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any printing wide character that is one of a
+ locale-specific et of wide characters for which neither `iswspace'
+ nor `iswalnum' is true. */
+extern int iswpunct_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any wide character that corresponds to a locale-specific
+ set of wide characters for which none of `iswalnum', `iswgraph', or
+ `iswpunct' is true. */
+extern int iswspace_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any wide character that corresponds to an uppercase letter
+ or is one of a locale-specific set of wide character for which none
+ of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */
+extern int iswupper_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any wide character that corresponds to a hexadecimal-digit
+ character equivalent to that performed be the functions described
+ in the previous subclause. */
+extern int iswxdigit_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Test for any wide character that corresponds to a standard blank
+ wide character or a locale-specific set of wide characters for
+ which `iswalnum' is false. */
+extern int iswblank_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Construct value that describes a class of wide characters identified
+ by the string argument PROPERTY. */
+extern wctype_t wctype_l (__const char *__property, __locale_t __locale)
+ __THROW;
+
+/* Determine whether the wide-character WC has the property described by
+ DESC. */
+extern int iswctype_l (wint_t __wc, wctype_t __desc, __locale_t __locale)
+ __THROW;
+
+
+/*
+ * Wide-character case-mapping functions.
+ */
+
+/* Converts an uppercase letter to the corresponding lowercase letter. */
+extern wint_t towlower_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Converts an lowercase letter to the corresponding uppercase letter. */
+extern wint_t towupper_l (wint_t __wc, __locale_t __locale) __THROW;
+
+/* Construct value that describes a mapping between wide characters
+ identified by the string argument PROPERTY. */
+extern wctrans_t wctrans_l (__const char *__property, __locale_t __locale)
+ __THROW;
+
+/* Map the wide character WC using the mapping described by DESC. */
+extern wint_t towctrans_l (wint_t __wc, wctrans_t __desc,
+ __locale_t __locale) __THROW;
+
+# endif /* Use GNU. */
+
+__END_DECLS
+
+#endif /* __WCTYPE_H defined. */
+
+#endif /* wctype.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/info/cpp.info b/uclibc-crosstools-gcc-4.4.2-1/usr/info/cpp.info
new file mode 100644
index 0000000..221bf81
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/info/cpp.info
@@ -0,0 +1,5351 @@
+This is doc/cpp.info, produced by makeinfo version 4.9 from
+/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/gcc-4.4.2/gcc/doc/cpp.texi.
+
+ Copyright (C) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free
+Software Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation. A copy of
+the license is included in the section entitled "GNU Free Documentation
+License".
+
+ This manual contains no Invariant Sections. The Front-Cover Texts
+are (a) (see below), and the Back-Cover Texts are (b) (see below).
+
+ (a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+ (b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+software. Copies published by the Free Software Foundation raise
+funds for GNU development.
+
+INFO-DIR-SECTION Software development
+START-INFO-DIR-ENTRY
+* Cpp: (cpp). The GNU C preprocessor.
+END-INFO-DIR-ENTRY
+
+
+File: cpp.info, Node: Top, Next: Overview, Up: (dir)
+
+The C Preprocessor
+******************
+
+The C preprocessor implements the macro language used to transform C,
+C++, and Objective-C programs before they are compiled. It can also be
+useful on its own.
+
+* Menu:
+
+* Overview::
+* Header Files::
+* Macros::
+* Conditionals::
+* Diagnostics::
+* Line Control::
+* Pragmas::
+* Other Directives::
+* Preprocessor Output::
+* Traditional Mode::
+* Implementation Details::
+* Invocation::
+* Environment Variables::
+* GNU Free Documentation License::
+* Index of Directives::
+* Option Index::
+* Concept Index::
+
+ --- The Detailed Node Listing ---
+
+Overview
+
+* Character sets::
+* Initial processing::
+* Tokenization::
+* The preprocessing language::
+
+Header Files
+
+* Include Syntax::
+* Include Operation::
+* Search Path::
+* Once-Only Headers::
+* Alternatives to Wrapper #ifndef::
+* Computed Includes::
+* Wrapper Headers::
+* System Headers::
+
+Macros
+
+* Object-like Macros::
+* Function-like Macros::
+* Macro Arguments::
+* Stringification::
+* Concatenation::
+* Variadic Macros::
+* Predefined Macros::
+* Undefining and Redefining Macros::
+* Directives Within Macro Arguments::
+* Macro Pitfalls::
+
+Predefined Macros
+
+* Standard Predefined Macros::
+* Common Predefined Macros::
+* System-specific Predefined Macros::
+* C++ Named Operators::
+
+Macro Pitfalls
+
+* Misnesting::
+* Operator Precedence Problems::
+* Swallowing the Semicolon::
+* Duplication of Side Effects::
+* Self-Referential Macros::
+* Argument Prescan::
+* Newlines in Arguments::
+
+Conditionals
+
+* Conditional Uses::
+* Conditional Syntax::
+* Deleted Code::
+
+Conditional Syntax
+
+* Ifdef::
+* If::
+* Defined::
+* Else::
+* Elif::
+
+Implementation Details
+
+* Implementation-defined behavior::
+* Implementation limits::
+* Obsolete Features::
+* Differences from previous versions::
+
+Obsolete Features
+
+* Obsolete Features::
+
+ Copyright (C) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free
+Software Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation. A copy of
+the license is included in the section entitled "GNU Free Documentation
+License".
+
+ This manual contains no Invariant Sections. The Front-Cover Texts
+are (a) (see below), and the Back-Cover Texts are (b) (see below).
+
+ (a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+ (b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+software. Copies published by the Free Software Foundation raise
+funds for GNU development.
+
+
+File: cpp.info, Node: Overview, Next: Header Files, Prev: Top, Up: Top
+
+1 Overview
+**********
+
+The C preprocessor, often known as "cpp", is a "macro processor" that
+is used automatically by the C compiler to transform your program
+before compilation. It is called a macro processor because it allows
+you to define "macros", which are brief abbreviations for longer
+constructs.
+
+ The C preprocessor is intended to be used only with C, C++, and
+Objective-C source code. In the past, it has been abused as a general
+text processor. It will choke on input which does not obey C's lexical
+rules. For example, apostrophes will be interpreted as the beginning of
+character constants, and cause errors. Also, you cannot rely on it
+preserving characteristics of the input which are not significant to
+C-family languages. If a Makefile is preprocessed, all the hard tabs
+will be removed, and the Makefile will not work.
+
+ Having said that, you can often get away with using cpp on things
+which are not C. Other Algol-ish programming languages are often safe
+(Pascal, Ada, etc.) So is assembly, with caution. `-traditional-cpp'
+mode preserves more white space, and is otherwise more permissive. Many
+of the problems can be avoided by writing C or C++ style comments
+instead of native language comments, and keeping macros simple.
+
+ Wherever possible, you should use a preprocessor geared to the
+language you are writing in. Modern versions of the GNU assembler have
+macro facilities. Most high level programming languages have their own
+conditional compilation and inclusion mechanism. If all else fails,
+try a true general text processor, such as GNU M4.
+
+ C preprocessors vary in some details. This manual discusses the GNU
+C preprocessor, which provides a small superset of the features of ISO
+Standard C. In its default mode, the GNU C preprocessor does not do a
+few things required by the standard. These are features which are
+rarely, if ever, used, and may cause surprising changes to the meaning
+of a program which does not expect them. To get strict ISO Standard C,
+you should use the `-std=c89' or `-std=c99' options, depending on which
+version of the standard you want. To get all the mandatory
+diagnostics, you must also use `-pedantic'. *Note Invocation::.
+
+ This manual describes the behavior of the ISO preprocessor. To
+minimize gratuitous differences, where the ISO preprocessor's behavior
+does not conflict with traditional semantics, the traditional
+preprocessor should behave the same way. The various differences that
+do exist are detailed in the section *Note Traditional Mode::.
+
+ For clarity, unless noted otherwise, references to `CPP' in this
+manual refer to GNU CPP.
+
+* Menu:
+
+* Character sets::
+* Initial processing::
+* Tokenization::
+* The preprocessing language::
+
+
+File: cpp.info, Node: Character sets, Next: Initial processing, Up: Overview
+
+1.1 Character sets
+==================
+
+Source code character set processing in C and related languages is
+rather complicated. The C standard discusses two character sets, but
+there are really at least four.
+
+ The files input to CPP might be in any character set at all. CPP's
+very first action, before it even looks for line boundaries, is to
+convert the file into the character set it uses for internal
+processing. That set is what the C standard calls the "source"
+character set. It must be isomorphic with ISO 10646, also known as
+Unicode. CPP uses the UTF-8 encoding of Unicode.
+
+ The character sets of the input files are specified using the
+`-finput-charset=' option.
+
+ All preprocessing work (the subject of the rest of this manual) is
+carried out in the source character set. If you request textual output
+from the preprocessor with the `-E' option, it will be in UTF-8.
+
+ After preprocessing is complete, string and character constants are
+converted again, into the "execution" character set. This character
+set is under control of the user; the default is UTF-8, matching the
+source character set. Wide string and character constants have their
+own character set, which is not called out specifically in the
+standard. Again, it is under control of the user. The default is
+UTF-16 or UTF-32, whichever fits in the target's `wchar_t' type, in the
+target machine's byte order.(1) Octal and hexadecimal escape sequences
+do not undergo conversion; '\x12' has the value 0x12 regardless of the
+currently selected execution character set. All other escapes are
+replaced by the character in the source character set that they
+represent, then converted to the execution character set, just like
+unescaped characters.
+
+ Unless the experimental `-fextended-identifiers' option is used, GCC
+does not permit the use of characters outside the ASCII range, nor `\u'
+and `\U' escapes, in identifiers. Even with that option, characters
+outside the ASCII range can only be specified with the `\u' and `\U'
+escapes, not used directly in identifiers.
+
+ ---------- Footnotes ----------
+
+ (1) UTF-16 does not meet the requirements of the C standard for a
+wide character set, but the choice of 16-bit `wchar_t' is enshrined in
+some system ABIs so we cannot fix this.
+
+
+File: cpp.info, Node: Initial processing, Next: Tokenization, Prev: Character sets, Up: Overview
+
+1.2 Initial processing
+======================
+
+The preprocessor performs a series of textual transformations on its
+input. These happen before all other processing. Conceptually, they
+happen in a rigid order, and the entire file is run through each
+transformation before the next one begins. CPP actually does them all
+at once, for performance reasons. These transformations correspond
+roughly to the first three "phases of translation" described in the C
+standard.
+
+ 1. The input file is read into memory and broken into lines.
+
+ Different systems use different conventions to indicate the end of
+ a line. GCC accepts the ASCII control sequences `LF', `CR LF' and
+ `CR' as end-of-line markers. These are the canonical sequences
+ used by Unix, DOS and VMS, and the classic Mac OS (before OSX)
+ respectively. You may therefore safely copy source code written
+ on any of those systems to a different one and use it without
+ conversion. (GCC may lose track of the current line number if a
+ file doesn't consistently use one convention, as sometimes happens
+ when it is edited on computers with different conventions that
+ share a network file system.)
+
+ If the last line of any input file lacks an end-of-line marker,
+ the end of the file is considered to implicitly supply one. The C
+ standard says that this condition provokes undefined behavior, so
+ GCC will emit a warning message.
+
+ 2. If trigraphs are enabled, they are replaced by their corresponding
+ single characters. By default GCC ignores trigraphs, but if you
+ request a strictly conforming mode with the `-std' option, or you
+ specify the `-trigraphs' option, then it converts them.
+
+ These are nine three-character sequences, all starting with `??',
+ that are defined by ISO C to stand for single characters. They
+ permit obsolete systems that lack some of C's punctuation to use
+ C. For example, `??/' stands for `\', so '??/n' is a character
+ constant for a newline.
+
+ Trigraphs are not popular and many compilers implement them
+ incorrectly. Portable code should not rely on trigraphs being
+ either converted or ignored. With `-Wtrigraphs' GCC will warn you
+ when a trigraph may change the meaning of your program if it were
+ converted. *Note Wtrigraphs::.
+
+ In a string constant, you can prevent a sequence of question marks
+ from being confused with a trigraph by inserting a backslash
+ between the question marks, or by separating the string literal at
+ the trigraph and making use of string literal concatenation.
+ "(??\?)" is the string `(???)', not `(?]'. Traditional C
+ compilers do not recognize these idioms.
+
+ The nine trigraphs and their replacements are
+
+ Trigraph: ??( ??) ??< ??> ??= ??/ ??' ??! ??-
+ Replacement: [ ] { } # \ ^ | ~
+
+ 3. Continued lines are merged into one long line.
+
+ A continued line is a line which ends with a backslash, `\'. The
+ backslash is removed and the following line is joined with the
+ current one. No space is inserted, so you may split a line
+ anywhere, even in the middle of a word. (It is generally more
+ readable to split lines only at white space.)
+
+ The trailing backslash on a continued line is commonly referred to
+ as a "backslash-newline".
+
+ If there is white space between a backslash and the end of a line,
+ that is still a continued line. However, as this is usually the
+ result of an editing mistake, and many compilers will not accept
+ it as a continued line, GCC will warn you about it.
+
+ 4. All comments are replaced with single spaces.
+
+ There are two kinds of comments. "Block comments" begin with `/*'
+ and continue until the next `*/'. Block comments do not nest:
+
+ /* this is /* one comment */ text outside comment
+
+ "Line comments" begin with `//' and continue to the end of the
+ current line. Line comments do not nest either, but it does not
+ matter, because they would end in the same place anyway.
+
+ // this is // one comment
+ text outside comment
+
+ It is safe to put line comments inside block comments, or vice versa.
+
+ /* block comment
+ // contains line comment
+ yet more comment
+ */ outside comment
+
+ // line comment /* contains block comment */
+
+ But beware of commenting out one end of a block comment with a line
+comment.
+
+ // l.c. /* block comment begins
+ oops! this isn't a comment anymore */
+
+ Comments are not recognized within string literals. "/* blah */" is
+the string constant `/* blah */', not an empty string.
+
+ Line comments are not in the 1989 edition of the C standard, but they
+are recognized by GCC as an extension. In C++ and in the 1999 edition
+of the C standard, they are an official part of the language.
+
+ Since these transformations happen before all other processing, you
+can split a line mechanically with backslash-newline anywhere. You can
+comment out the end of a line. You can continue a line comment onto the
+next line with backslash-newline. You can even split `/*', `*/', and
+`//' onto multiple lines with backslash-newline. For example:
+
+ /\
+ *
+ */ # /*
+ */ defi\
+ ne FO\
+ O 10\
+ 20
+
+is equivalent to `#define FOO 1020'. All these tricks are extremely
+confusing and should not be used in code intended to be readable.
+
+ There is no way to prevent a backslash at the end of a line from
+being interpreted as a backslash-newline. This cannot affect any
+correct program, however.
+
+
+File: cpp.info, Node: Tokenization, Next: The preprocessing language, Prev: Initial processing, Up: Overview
+
+1.3 Tokenization
+================
+
+After the textual transformations are finished, the input file is
+converted into a sequence of "preprocessing tokens". These mostly
+correspond to the syntactic tokens used by the C compiler, but there are
+a few differences. White space separates tokens; it is not itself a
+token of any kind. Tokens do not have to be separated by white space,
+but it is often necessary to avoid ambiguities.
+
+ When faced with a sequence of characters that has more than one
+possible tokenization, the preprocessor is greedy. It always makes
+each token, starting from the left, as big as possible before moving on
+to the next token. For instance, `a+++++b' is interpreted as
+`a ++ ++ + b', not as `a ++ + ++ b', even though the latter
+tokenization could be part of a valid C program and the former could
+not.
+
+ Once the input file is broken into tokens, the token boundaries never
+change, except when the `##' preprocessing operator is used to paste
+tokens together. *Note Concatenation::. For example,
+
+ #define foo() bar
+ foo()baz
+ ==> bar baz
+ _not_
+ ==> barbaz
+
+ The compiler does not re-tokenize the preprocessor's output. Each
+preprocessing token becomes one compiler token.
+
+ Preprocessing tokens fall into five broad classes: identifiers,
+preprocessing numbers, string literals, punctuators, and other. An
+"identifier" is the same as an identifier in C: any sequence of
+letters, digits, or underscores, which begins with a letter or
+underscore. Keywords of C have no significance to the preprocessor;
+they are ordinary identifiers. You can define a macro whose name is a
+keyword, for instance. The only identifier which can be considered a
+preprocessing keyword is `defined'. *Note Defined::.
+
+ This is mostly true of other languages which use the C preprocessor.
+However, a few of the keywords of C++ are significant even in the
+preprocessor. *Note C++ Named Operators::.
+
+ In the 1999 C standard, identifiers may contain letters which are not
+part of the "basic source character set", at the implementation's
+discretion (such as accented Latin letters, Greek letters, or Chinese
+ideograms). This may be done with an extended character set, or the
+`\u' and `\U' escape sequences. The implementation of this feature in
+GCC is experimental; such characters are only accepted in the `\u' and
+`\U' forms and only if `-fextended-identifiers' is used.
+
+ As an extension, GCC treats `$' as a letter. This is for
+compatibility with some systems, such as VMS, where `$' is commonly
+used in system-defined function and object names. `$' is not a letter
+in strictly conforming mode, or if you specify the `-$' option. *Note
+Invocation::.
+
+ A "preprocessing number" has a rather bizarre definition. The
+category includes all the normal integer and floating point constants
+one expects of C, but also a number of other things one might not
+initially recognize as a number. Formally, preprocessing numbers begin
+with an optional period, a required decimal digit, and then continue
+with any sequence of letters, digits, underscores, periods, and
+exponents. Exponents are the two-character sequences `e+', `e-', `E+',
+`E-', `p+', `p-', `P+', and `P-'. (The exponents that begin with `p'
+or `P' are new to C99. They are used for hexadecimal floating-point
+constants.)
+
+ The purpose of this unusual definition is to isolate the preprocessor
+from the full complexity of numeric constants. It does not have to
+distinguish between lexically valid and invalid floating-point numbers,
+which is complicated. The definition also permits you to split an
+identifier at any position and get exactly two tokens, which can then be
+pasted back together with the `##' operator.
+
+ It's possible for preprocessing numbers to cause programs to be
+misinterpreted. For example, `0xE+12' is a preprocessing number which
+does not translate to any valid numeric constant, therefore a syntax
+error. It does not mean `0xE + 12', which is what you might have
+intended.
+
+ "String literals" are string constants, character constants, and
+header file names (the argument of `#include').(1) String constants
+and character constants are straightforward: "..." or '...'. In either
+case embedded quotes should be escaped with a backslash: '\'' is the
+character constant for `''. There is no limit on the length of a
+character constant, but the value of a character constant that contains
+more than one character is implementation-defined. *Note
+Implementation Details::.
+
+ Header file names either look like string constants, "...", or are
+written with angle brackets instead, <...>. In either case, backslash
+is an ordinary character. There is no way to escape the closing quote
+or angle bracket. The preprocessor looks for the header file in
+different places depending on which form you use. *Note Include
+Operation::.
+
+ No string literal may extend past the end of a line. Older versions
+of GCC accepted multi-line string constants. You may use continued
+lines instead, or string constant concatenation. *Note Differences
+from previous versions::.
+
+ "Punctuators" are all the usual bits of punctuation which are
+meaningful to C and C++. All but three of the punctuation characters in
+ASCII are C punctuators. The exceptions are `@', `$', and ``'. In
+addition, all the two- and three-character operators are punctuators.
+There are also six "digraphs", which the C++ standard calls
+"alternative tokens", which are merely alternate ways to spell other
+punctuators. This is a second attempt to work around missing
+punctuation in obsolete systems. It has no negative side effects,
+unlike trigraphs, but does not cover as much ground. The digraphs and
+their corresponding normal punctuators are:
+
+ Digraph: <% %> <: :> %: %:%:
+ Punctuator: { } [ ] # ##
+
+ Any other single character is considered "other". It is passed on to
+the preprocessor's output unmolested. The C compiler will almost
+certainly reject source code containing "other" tokens. In ASCII, the
+only other characters are `@', `$', ``', and control characters other
+than NUL (all bits zero). (Note that `$' is normally considered a
+letter.) All characters with the high bit set (numeric range
+0x7F-0xFF) are also "other" in the present implementation. This will
+change when proper support for international character sets is added to
+GCC.
+
+ NUL is a special case because of the high probability that its
+appearance is accidental, and because it may be invisible to the user
+(many terminals do not display NUL at all). Within comments, NULs are
+silently ignored, just as any other character would be. In running
+text, NUL is considered white space. For example, these two directives
+have the same meaning.
+
+ #define X^@1
+ #define X 1
+
+(where `^@' is ASCII NUL). Within string or character constants, NULs
+are preserved. In the latter two cases the preprocessor emits a
+warning message.
+
+ ---------- Footnotes ----------
+
+ (1) The C standard uses the term "string literal" to refer only to
+what we are calling "string constants".
+
+
+File: cpp.info, Node: The preprocessing language, Prev: Tokenization, Up: Overview
+
+1.4 The preprocessing language
+==============================
+
+After tokenization, the stream of tokens may simply be passed straight
+to the compiler's parser. However, if it contains any operations in the
+"preprocessing language", it will be transformed first. This stage
+corresponds roughly to the standard's "translation phase 4" and is what
+most people think of as the preprocessor's job.
+
+ The preprocessing language consists of "directives" to be executed
+and "macros" to be expanded. Its primary capabilities are:
+
+ * Inclusion of header files. These are files of declarations that
+ can be substituted into your program.
+
+ * Macro expansion. You can define "macros", which are abbreviations
+ for arbitrary fragments of C code. The preprocessor will replace
+ the macros with their definitions throughout the program. Some
+ macros are automatically defined for you.
+
+ * Conditional compilation. You can include or exclude parts of the
+ program according to various conditions.
+
+ * Line control. If you use a program to combine or rearrange source
+ files into an intermediate file which is then compiled, you can
+ use line control to inform the compiler where each source line
+ originally came from.
+
+ * Diagnostics. You can detect problems at compile time and issue
+ errors or warnings.
+
+ There are a few more, less useful, features.
+
+ Except for expansion of predefined macros, all these operations are
+triggered with "preprocessing directives". Preprocessing directives
+are lines in your program that start with `#'. Whitespace is allowed
+before and after the `#'. The `#' is followed by an identifier, the
+"directive name". It specifies the operation to perform. Directives
+are commonly referred to as `#NAME' where NAME is the directive name.
+For example, `#define' is the directive that defines a macro.
+
+ The `#' which begins a directive cannot come from a macro expansion.
+Also, the directive name is not macro expanded. Thus, if `foo' is
+defined as a macro expanding to `define', that does not make `#foo' a
+valid preprocessing directive.
+
+ The set of valid directive names is fixed. Programs cannot define
+new preprocessing directives.
+
+ Some directives require arguments; these make up the rest of the
+directive line and must be separated from the directive name by
+whitespace. For example, `#define' must be followed by a macro name
+and the intended expansion of the macro.
+
+ A preprocessing directive cannot cover more than one line. The line
+may, however, be continued with backslash-newline, or by a block comment
+which extends past the end of the line. In either case, when the
+directive is processed, the continuations have already been merged with
+the first line to make one long line.
+
+
+File: cpp.info, Node: Header Files, Next: Macros, Prev: Overview, Up: Top
+
+2 Header Files
+**************
+
+A header file is a file containing C declarations and macro definitions
+(*note Macros::) to be shared between several source files. You request
+the use of a header file in your program by "including" it, with the C
+preprocessing directive `#include'.
+
+ Header files serve two purposes.
+
+ * System header files declare the interfaces to parts of the
+ operating system. You include them in your program to supply the
+ definitions and declarations you need to invoke system calls and
+ libraries.
+
+ * Your own header files contain declarations for interfaces between
+ the source files of your program. Each time you have a group of
+ related declarations and macro definitions all or most of which
+ are needed in several different source files, it is a good idea to
+ create a header file for them.
+
+ Including a header file produces the same results as copying the
+header file into each source file that needs it. Such copying would be
+time-consuming and error-prone. With a header file, the related
+declarations appear in only one place. If they need to be changed, they
+can be changed in one place, and programs that include the header file
+will automatically use the new version when next recompiled. The header
+file eliminates the labor of finding and changing all the copies as well
+as the risk that a failure to find one copy will result in
+inconsistencies within a program.
+
+ In C, the usual convention is to give header files names that end
+with `.h'. It is most portable to use only letters, digits, dashes, and
+underscores in header file names, and at most one dot.
+
+* Menu:
+
+* Include Syntax::
+* Include Operation::
+* Search Path::
+* Once-Only Headers::
+* Alternatives to Wrapper #ifndef::
+* Computed Includes::
+* Wrapper Headers::
+* System Headers::
+
+
+File: cpp.info, Node: Include Syntax, Next: Include Operation, Up: Header Files
+
+2.1 Include Syntax
+==================
+
+Both user and system header files are included using the preprocessing
+directive `#include'. It has two variants:
+
+`#include <FILE>'
+ This variant is used for system header files. It searches for a
+ file named FILE in a standard list of system directories. You can
+ prepend directories to this list with the `-I' option (*note
+ Invocation::).
+
+`#include "FILE"'
+ This variant is used for header files of your own program. It
+ searches for a file named FILE first in the directory containing
+ the current file, then in the quote directories and then the same
+ directories used for `<FILE>'. You can prepend directories to the
+ list of quote directories with the `-iquote' option.
+
+ The argument of `#include', whether delimited with quote marks or
+angle brackets, behaves like a string constant in that comments are not
+recognized, and macro names are not expanded. Thus, `#include <x/*y>'
+specifies inclusion of a system header file named `x/*y'.
+
+ However, if backslashes occur within FILE, they are considered
+ordinary text characters, not escape characters. None of the character
+escape sequences appropriate to string constants in C are processed.
+Thus, `#include "x\n\\y"' specifies a filename containing three
+backslashes. (Some systems interpret `\' as a pathname separator. All
+of these also interpret `/' the same way. It is most portable to use
+only `/'.)
+
+ It is an error if there is anything (other than comments) on the line
+after the file name.
+
+
+File: cpp.info, Node: Include Operation, Next: Search Path, Prev: Include Syntax, Up: Header Files
+
+2.2 Include Operation
+=====================
+
+The `#include' directive works by directing the C preprocessor to scan
+the specified file as input before continuing with the rest of the
+current file. The output from the preprocessor contains the output
+already generated, followed by the output resulting from the included
+file, followed by the output that comes from the text after the
+`#include' directive. For example, if you have a header file
+`header.h' as follows,
+
+ char *test (void);
+
+and a main program called `program.c' that uses the header file, like
+this,
+
+ int x;
+ #include "header.h"
+
+ int
+ main (void)
+ {
+ puts (test ());
+ }
+
+the compiler will see the same token stream as it would if `program.c'
+read
+
+ int x;
+ char *test (void);
+
+ int
+ main (void)
+ {
+ puts (test ());
+ }
+
+ Included files are not limited to declarations and macro definitions;
+those are merely the typical uses. Any fragment of a C program can be
+included from another file. The include file could even contain the
+beginning of a statement that is concluded in the containing file, or
+the end of a statement that was started in the including file. However,
+an included file must consist of complete tokens. Comments and string
+literals which have not been closed by the end of an included file are
+invalid. For error recovery, they are considered to end at the end of
+the file.
+
+ To avoid confusion, it is best if header files contain only complete
+syntactic units--function declarations or definitions, type
+declarations, etc.
+
+ The line following the `#include' directive is always treated as a
+separate line by the C preprocessor, even if the included file lacks a
+final newline.
+
+
+File: cpp.info, Node: Search Path, Next: Once-Only Headers, Prev: Include Operation, Up: Header Files
+
+2.3 Search Path
+===============
+
+GCC looks in several different places for headers. On a normal Unix
+system, if you do not instruct it otherwise, it will look for headers
+requested with `#include <FILE>' in:
+
+ /usr/local/include
+ LIBDIR/gcc/TARGET/VERSION/include
+ /usr/TARGET/include
+ /usr/include
+
+ For C++ programs, it will also look in `/usr/include/g++-v3', first.
+In the above, TARGET is the canonical name of the system GCC was
+configured to compile code for; often but not always the same as the
+canonical name of the system it runs on. VERSION is the version of GCC
+in use.
+
+ You can add to this list with the `-IDIR' command line option. All
+the directories named by `-I' are searched, in left-to-right order,
+_before_ the default directories. The only exception is when `dir' is
+already searched by default. In this case, the option is ignored and
+the search order for system directories remains unchanged.
+
+ Duplicate directories are removed from the quote and bracket search
+chains before the two chains are merged to make the final search chain.
+Thus, it is possible for a directory to occur twice in the final search
+chain if it was specified in both the quote and bracket chains.
+
+ You can prevent GCC from searching any of the default directories
+with the `-nostdinc' option. This is useful when you are compiling an
+operating system kernel or some other program that does not use the
+standard C library facilities, or the standard C library itself. `-I'
+options are not ignored as described above when `-nostdinc' is in
+effect.
+
+ GCC looks for headers requested with `#include "FILE"' first in the
+directory containing the current file, then in the directories as
+specified by `-iquote' options, then in the same places it would have
+looked for a header requested with angle brackets. For example, if
+`/usr/include/sys/stat.h' contains `#include "types.h"', GCC looks for
+`types.h' first in `/usr/include/sys', then in its usual search path.
+
+ `#line' (*note Line Control::) does not change GCC's idea of the
+directory containing the current file.
+
+ You may put `-I-' at any point in your list of `-I' options. This
+has two effects. First, directories appearing before the `-I-' in the
+list are searched only for headers requested with quote marks.
+Directories after `-I-' are searched for all headers. Second, the
+directory containing the current file is not searched for anything,
+unless it happens to be one of the directories named by an `-I' switch.
+`-I-' is deprecated, `-iquote' should be used instead.
+
+ `-I. -I-' is not the same as no `-I' options at all, and does not
+cause the same behavior for `<>' includes that `""' includes get with
+no special options. `-I.' searches the compiler's current working
+directory for header files. That may or may not be the same as the
+directory containing the current file.
+
+ If you need to look for headers in a directory named `-', write
+`-I./-'.
+
+ There are several more ways to adjust the header search path. They
+are generally less useful. *Note Invocation::.
+
+
+File: cpp.info, Node: Once-Only Headers, Next: Alternatives to Wrapper #ifndef, Prev: Search Path, Up: Header Files
+
+2.4 Once-Only Headers
+=====================
+
+If a header file happens to be included twice, the compiler will process
+its contents twice. This is very likely to cause an error, e.g. when
+the compiler sees the same structure definition twice. Even if it does
+not, it will certainly waste time.
+
+ The standard way to prevent this is to enclose the entire real
+contents of the file in a conditional, like this:
+
+ /* File foo. */
+ #ifndef FILE_FOO_SEEN
+ #define FILE_FOO_SEEN
+
+ THE ENTIRE FILE
+
+ #endif /* !FILE_FOO_SEEN */
+
+ This construct is commonly known as a "wrapper #ifndef". When the
+header is included again, the conditional will be false, because
+`FILE_FOO_SEEN' is defined. The preprocessor will skip over the entire
+contents of the file, and the compiler will not see it twice.
+
+ CPP optimizes even further. It remembers when a header file has a
+wrapper `#ifndef'. If a subsequent `#include' specifies that header,
+and the macro in the `#ifndef' is still defined, it does not bother to
+rescan the file at all.
+
+ You can put comments outside the wrapper. They will not interfere
+with this optimization.
+
+ The macro `FILE_FOO_SEEN' is called the "controlling macro" or
+"guard macro". In a user header file, the macro name should not begin
+with `_'. In a system header file, it should begin with `__' to avoid
+conflicts with user programs. In any kind of header file, the macro
+name should contain the name of the file and some additional text, to
+avoid conflicts with other header files.
+
+
+File: cpp.info, Node: Alternatives to Wrapper #ifndef, Next: Computed Includes, Prev: Once-Only Headers, Up: Header Files
+
+2.5 Alternatives to Wrapper #ifndef
+===================================
+
+CPP supports two more ways of indicating that a header file should be
+read only once. Neither one is as portable as a wrapper `#ifndef' and
+we recommend you do not use them in new programs, with the caveat that
+`#import' is standard practice in Objective-C.
+
+ CPP supports a variant of `#include' called `#import' which includes
+a file, but does so at most once. If you use `#import' instead of
+`#include', then you don't need the conditionals inside the header file
+to prevent multiple inclusion of the contents. `#import' is standard
+in Objective-C, but is considered a deprecated extension in C and C++.
+
+ `#import' is not a well designed feature. It requires the users of
+a header file to know that it should only be included once. It is much
+better for the header file's implementor to write the file so that users
+don't need to know this. Using a wrapper `#ifndef' accomplishes this
+goal.
+
+ In the present implementation, a single use of `#import' will
+prevent the file from ever being read again, by either `#import' or
+`#include'. You should not rely on this; do not use both `#import' and
+`#include' to refer to the same header file.
+
+ Another way to prevent a header file from being included more than
+once is with the `#pragma once' directive. If `#pragma once' is seen
+when scanning a header file, that file will never be read again, no
+matter what.
+
+ `#pragma once' does not have the problems that `#import' does, but
+it is not recognized by all preprocessors, so you cannot rely on it in
+a portable program.
+
+
+File: cpp.info, Node: Computed Includes, Next: Wrapper Headers, Prev: Alternatives to Wrapper #ifndef, Up: Header Files
+
+2.6 Computed Includes
+=====================
+
+Sometimes it is necessary to select one of several different header
+files to be included into your program. They might specify
+configuration parameters to be used on different sorts of operating
+systems, for instance. You could do this with a series of conditionals,
+
+ #if SYSTEM_1
+ # include "system_1.h"
+ #elif SYSTEM_2
+ # include "system_2.h"
+ #elif SYSTEM_3
+ ...
+ #endif
+
+ That rapidly becomes tedious. Instead, the preprocessor offers the
+ability to use a macro for the header name. This is called a "computed
+include". Instead of writing a header name as the direct argument of
+`#include', you simply put a macro name there instead:
+
+ #define SYSTEM_H "system_1.h"
+ ...
+ #include SYSTEM_H
+
+`SYSTEM_H' will be expanded, and the preprocessor will look for
+`system_1.h' as if the `#include' had been written that way originally.
+`SYSTEM_H' could be defined by your Makefile with a `-D' option.
+
+ You must be careful when you define the macro. `#define' saves
+tokens, not text. The preprocessor has no way of knowing that the macro
+will be used as the argument of `#include', so it generates ordinary
+tokens, not a header name. This is unlikely to cause problems if you
+use double-quote includes, which are close enough to string constants.
+If you use angle brackets, however, you may have trouble.
+
+ The syntax of a computed include is actually a bit more general than
+the above. If the first non-whitespace character after `#include' is
+not `"' or `<', then the entire line is macro-expanded like running
+text would be.
+
+ If the line expands to a single string constant, the contents of that
+string constant are the file to be included. CPP does not re-examine
+the string for embedded quotes, but neither does it process backslash
+escapes in the string. Therefore
+
+ #define HEADER "a\"b"
+ #include HEADER
+
+looks for a file named `a\"b'. CPP searches for the file according to
+the rules for double-quoted includes.
+
+ If the line expands to a token stream beginning with a `<' token and
+including a `>' token, then the tokens between the `<' and the first
+`>' are combined to form the filename to be included. Any whitespace
+between tokens is reduced to a single space; then any space after the
+initial `<' is retained, but a trailing space before the closing `>' is
+ignored. CPP searches for the file according to the rules for
+angle-bracket includes.
+
+ In either case, if there are any tokens on the line after the file
+name, an error occurs and the directive is not processed. It is also
+an error if the result of expansion does not match either of the two
+expected forms.
+
+ These rules are implementation-defined behavior according to the C
+standard. To minimize the risk of different compilers interpreting your
+computed includes differently, we recommend you use only a single
+object-like macro which expands to a string constant. This will also
+minimize confusion for people reading your program.
+
+
+File: cpp.info, Node: Wrapper Headers, Next: System Headers, Prev: Computed Includes, Up: Header Files
+
+2.7 Wrapper Headers
+===================
+
+Sometimes it is necessary to adjust the contents of a system-provided
+header file without editing it directly. GCC's `fixincludes' operation
+does this, for example. One way to do that would be to create a new
+header file with the same name and insert it in the search path before
+the original header. That works fine as long as you're willing to
+replace the old header entirely. But what if you want to refer to the
+old header from the new one?
+
+ You cannot simply include the old header with `#include'. That will
+start from the beginning, and find your new header again. If your
+header is not protected from multiple inclusion (*note Once-Only
+Headers::), it will recurse infinitely and cause a fatal error.
+
+ You could include the old header with an absolute pathname:
+ #include "/usr/include/old-header.h"
+ This works, but is not clean; should the system headers ever move,
+you would have to edit the new headers to match.
+
+ There is no way to solve this problem within the C standard, but you
+can use the GNU extension `#include_next'. It means, "Include the
+_next_ file with this name". This directive works like `#include'
+except in searching for the specified file: it starts searching the
+list of header file directories _after_ the directory in which the
+current file was found.
+
+ Suppose you specify `-I /usr/local/include', and the list of
+directories to search also includes `/usr/include'; and suppose both
+directories contain `signal.h'. Ordinary `#include <signal.h>' finds
+the file under `/usr/local/include'. If that file contains
+`#include_next <signal.h>', it starts searching after that directory,
+and finds the file in `/usr/include'.
+
+ `#include_next' does not distinguish between `<FILE>' and `"FILE"'
+inclusion, nor does it check that the file you specify has the same
+name as the current file. It simply looks for the file named, starting
+with the directory in the search path after the one where the current
+file was found.
+
+ The use of `#include_next' can lead to great confusion. We
+recommend it be used only when there is no other alternative. In
+particular, it should not be used in the headers belonging to a specific
+program; it should be used only to make global corrections along the
+lines of `fixincludes'.
+
+
+File: cpp.info, Node: System Headers, Prev: Wrapper Headers, Up: Header Files
+
+2.8 System Headers
+==================
+
+The header files declaring interfaces to the operating system and
+runtime libraries often cannot be written in strictly conforming C.
+Therefore, GCC gives code found in "system headers" special treatment.
+All warnings, other than those generated by `#warning' (*note
+Diagnostics::), are suppressed while GCC is processing a system header.
+Macros defined in a system header are immune to a few warnings
+wherever they are expanded. This immunity is granted on an ad-hoc
+basis, when we find that a warning generates lots of false positives
+because of code in macros defined in system headers.
+
+ Normally, only the headers found in specific directories are
+considered system headers. These directories are determined when GCC
+is compiled. There are, however, two ways to make normal headers into
+system headers.
+
+ The `-isystem' command line option adds its argument to the list of
+directories to search for headers, just like `-I'. Any headers found
+in that directory will be considered system headers.
+
+ All directories named by `-isystem' are searched _after_ all
+directories named by `-I', no matter what their order was on the
+command line. If the same directory is named by both `-I' and
+`-isystem', the `-I' option is ignored. GCC provides an informative
+message when this occurs if `-v' is used.
+
+ There is also a directive, `#pragma GCC system_header', which tells
+GCC to consider the rest of the current include file a system header,
+no matter where it was found. Code that comes before the `#pragma' in
+the file will not be affected. `#pragma GCC system_header' has no
+effect in the primary source file.
+
+ On very old systems, some of the pre-defined system header
+directories get even more special treatment. GNU C++ considers code in
+headers found in those directories to be surrounded by an `extern "C"'
+block. There is no way to request this behavior with a `#pragma', or
+from the command line.
+
+
+File: cpp.info, Node: Macros, Next: Conditionals, Prev: Header Files, Up: Top
+
+3 Macros
+********
+
+A "macro" is a fragment of code which has been given a name. Whenever
+the name is used, it is replaced by the contents of the macro. There
+are two kinds of macros. They differ mostly in what they look like
+when they are used. "Object-like" macros resemble data objects when
+used, "function-like" macros resemble function calls.
+
+ You may define any valid identifier as a macro, even if it is a C
+keyword. The preprocessor does not know anything about keywords. This
+can be useful if you wish to hide a keyword such as `const' from an
+older compiler that does not understand it. However, the preprocessor
+operator `defined' (*note Defined::) can never be defined as a macro,
+and C++'s named operators (*note C++ Named Operators::) cannot be
+macros when you are compiling C++.
+
+* Menu:
+
+* Object-like Macros::
+* Function-like Macros::
+* Macro Arguments::
+* Stringification::
+* Concatenation::
+* Variadic Macros::
+* Predefined Macros::
+* Undefining and Redefining Macros::
+* Directives Within Macro Arguments::
+* Macro Pitfalls::
+
+
+File: cpp.info, Node: Object-like Macros, Next: Function-like Macros, Up: Macros
+
+3.1 Object-like Macros
+======================
+
+An "object-like macro" is a simple identifier which will be replaced by
+a code fragment. It is called object-like because it looks like a data
+object in code that uses it. They are most commonly used to give
+symbolic names to numeric constants.
+
+ You create macros with the `#define' directive. `#define' is
+followed by the name of the macro and then the token sequence it should
+be an abbreviation for, which is variously referred to as the macro's
+"body", "expansion" or "replacement list". For example,
+
+ #define BUFFER_SIZE 1024
+
+defines a macro named `BUFFER_SIZE' as an abbreviation for the token
+`1024'. If somewhere after this `#define' directive there comes a C
+statement of the form
+
+ foo = (char *) malloc (BUFFER_SIZE);
+
+then the C preprocessor will recognize and "expand" the macro
+`BUFFER_SIZE'. The C compiler will see the same tokens as it would if
+you had written
+
+ foo = (char *) malloc (1024);
+
+ By convention, macro names are written in uppercase. Programs are
+easier to read when it is possible to tell at a glance which names are
+macros.
+
+ The macro's body ends at the end of the `#define' line. You may
+continue the definition onto multiple lines, if necessary, using
+backslash-newline. When the macro is expanded, however, it will all
+come out on one line. For example,
+
+ #define NUMBERS 1, \
+ 2, \
+ 3
+ int x[] = { NUMBERS };
+ ==> int x[] = { 1, 2, 3 };
+
+The most common visible consequence of this is surprising line numbers
+in error messages.
+
+ There is no restriction on what can go in a macro body provided it
+decomposes into valid preprocessing tokens. Parentheses need not
+balance, and the body need not resemble valid C code. (If it does not,
+you may get error messages from the C compiler when you use the macro.)
+
+ The C preprocessor scans your program sequentially. Macro
+definitions take effect at the place you write them. Therefore, the
+following input to the C preprocessor
+
+ foo = X;
+ #define X 4
+ bar = X;
+
+produces
+
+ foo = X;
+ bar = 4;
+
+ When the preprocessor expands a macro name, the macro's expansion
+replaces the macro invocation, then the expansion is examined for more
+macros to expand. For example,
+
+ #define TABLESIZE BUFSIZE
+ #define BUFSIZE 1024
+ TABLESIZE
+ ==> BUFSIZE
+ ==> 1024
+
+`TABLESIZE' is expanded first to produce `BUFSIZE', then that macro is
+expanded to produce the final result, `1024'.
+
+ Notice that `BUFSIZE' was not defined when `TABLESIZE' was defined.
+The `#define' for `TABLESIZE' uses exactly the expansion you
+specify--in this case, `BUFSIZE'--and does not check to see whether it
+too contains macro names. Only when you _use_ `TABLESIZE' is the
+result of its expansion scanned for more macro names.
+
+ This makes a difference if you change the definition of `BUFSIZE' at
+some point in the source file. `TABLESIZE', defined as shown, will
+always expand using the definition of `BUFSIZE' that is currently in
+effect:
+
+ #define BUFSIZE 1020
+ #define TABLESIZE BUFSIZE
+ #undef BUFSIZE
+ #define BUFSIZE 37
+
+Now `TABLESIZE' expands (in two stages) to `37'.
+
+ If the expansion of a macro contains its own name, either directly or
+via intermediate macros, it is not expanded again when the expansion is
+examined for more macros. This prevents infinite recursion. *Note
+Self-Referential Macros::, for the precise details.
+
+
+File: cpp.info, Node: Function-like Macros, Next: Macro Arguments, Prev: Object-like Macros, Up: Macros
+
+3.2 Function-like Macros
+========================
+
+You can also define macros whose use looks like a function call. These
+are called "function-like macros". To define a function-like macro,
+you use the same `#define' directive, but you put a pair of parentheses
+immediately after the macro name. For example,
+
+ #define lang_init() c_init()
+ lang_init()
+ ==> c_init()
+
+ A function-like macro is only expanded if its name appears with a
+pair of parentheses after it. If you write just the name, it is left
+alone. This can be useful when you have a function and a macro of the
+same name, and you wish to use the function sometimes.
+
+ extern void foo(void);
+ #define foo() /* optimized inline version */
+ ...
+ foo();
+ funcptr = foo;
+
+ Here the call to `foo()' will use the macro, but the function
+pointer will get the address of the real function. If the macro were to
+be expanded, it would cause a syntax error.
+
+ If you put spaces between the macro name and the parentheses in the
+macro definition, that does not define a function-like macro, it defines
+an object-like macro whose expansion happens to begin with a pair of
+parentheses.
+
+ #define lang_init () c_init()
+ lang_init()
+ ==> () c_init()()
+
+ The first two pairs of parentheses in this expansion come from the
+macro. The third is the pair that was originally after the macro
+invocation. Since `lang_init' is an object-like macro, it does not
+consume those parentheses.
+
+
+File: cpp.info, Node: Macro Arguments, Next: Stringification, Prev: Function-like Macros, Up: Macros
+
+3.3 Macro Arguments
+===================
+
+Function-like macros can take "arguments", just like true functions.
+To define a macro that uses arguments, you insert "parameters" between
+the pair of parentheses in the macro definition that make the macro
+function-like. The parameters must be valid C identifiers, separated
+by commas and optionally whitespace.
+
+ To invoke a macro that takes arguments, you write the name of the
+macro followed by a list of "actual arguments" in parentheses, separated
+by commas. The invocation of the macro need not be restricted to a
+single logical line--it can cross as many lines in the source file as
+you wish. The number of arguments you give must match the number of
+parameters in the macro definition. When the macro is expanded, each
+use of a parameter in its body is replaced by the tokens of the
+corresponding argument. (You need not use all of the parameters in the
+macro body.)
+
+ As an example, here is a macro that computes the minimum of two
+numeric values, as it is defined in many C programs, and some uses.
+
+ #define min(X, Y) ((X) < (Y) ? (X) : (Y))
+ x = min(a, b); ==> x = ((a) < (b) ? (a) : (b));
+ y = min(1, 2); ==> y = ((1) < (2) ? (1) : (2));
+ z = min(a + 28, *p); ==> z = ((a + 28) < (*p) ? (a + 28) : (*p));
+
+(In this small example you can already see several of the dangers of
+macro arguments. *Note Macro Pitfalls::, for detailed explanations.)
+
+ Leading and trailing whitespace in each argument is dropped, and all
+whitespace between the tokens of an argument is reduced to a single
+space. Parentheses within each argument must balance; a comma within
+such parentheses does not end the argument. However, there is no
+requirement for square brackets or braces to balance, and they do not
+prevent a comma from separating arguments. Thus,
+
+ macro (array[x = y, x + 1])
+
+passes two arguments to `macro': `array[x = y' and `x + 1]'. If you
+want to supply `array[x = y, x + 1]' as an argument, you can write it
+as `array[(x = y, x + 1)]', which is equivalent C code.
+
+ All arguments to a macro are completely macro-expanded before they
+are substituted into the macro body. After substitution, the complete
+text is scanned again for macros to expand, including the arguments.
+This rule may seem strange, but it is carefully designed so you need
+not worry about whether any function call is actually a macro
+invocation. You can run into trouble if you try to be too clever,
+though. *Note Argument Prescan::, for detailed discussion.
+
+ For example, `min (min (a, b), c)' is first expanded to
+
+ min (((a) < (b) ? (a) : (b)), (c))
+
+and then to
+
+ ((((a) < (b) ? (a) : (b))) < (c)
+ ? (((a) < (b) ? (a) : (b)))
+ : (c))
+
+(Line breaks shown here for clarity would not actually be generated.)
+
+ You can leave macro arguments empty; this is not an error to the
+preprocessor (but many macros will then expand to invalid code). You
+cannot leave out arguments entirely; if a macro takes two arguments,
+there must be exactly one comma at the top level of its argument list.
+Here are some silly examples using `min':
+
+ min(, b) ==> (( ) < (b) ? ( ) : (b))
+ min(a, ) ==> ((a ) < ( ) ? (a ) : ( ))
+ min(,) ==> (( ) < ( ) ? ( ) : ( ))
+ min((,),) ==> (((,)) < ( ) ? ((,)) : ( ))
+
+ min() error--> macro "min" requires 2 arguments, but only 1 given
+ min(,,) error--> macro "min" passed 3 arguments, but takes just 2
+
+ Whitespace is not a preprocessing token, so if a macro `foo' takes
+one argument, `foo ()' and `foo ( )' both supply it an empty argument.
+Previous GNU preprocessor implementations and documentation were
+incorrect on this point, insisting that a function-like macro that
+takes a single argument be passed a space if an empty argument was
+required.
+
+ Macro parameters appearing inside string literals are not replaced by
+their corresponding actual arguments.
+
+ #define foo(x) x, "x"
+ foo(bar) ==> bar, "x"
+
+
+File: cpp.info, Node: Stringification, Next: Concatenation, Prev: Macro Arguments, Up: Macros
+
+3.4 Stringification
+===================
+
+Sometimes you may want to convert a macro argument into a string
+constant. Parameters are not replaced inside string constants, but you
+can use the `#' preprocessing operator instead. When a macro parameter
+is used with a leading `#', the preprocessor replaces it with the
+literal text of the actual argument, converted to a string constant.
+Unlike normal parameter replacement, the argument is not macro-expanded
+first. This is called "stringification".
+
+ There is no way to combine an argument with surrounding text and
+stringify it all together. Instead, you can write a series of adjacent
+string constants and stringified arguments. The preprocessor will
+replace the stringified arguments with string constants. The C
+compiler will then combine all the adjacent string constants into one
+long string.
+
+ Here is an example of a macro definition that uses stringification:
+
+ #define WARN_IF(EXP) \
+ do { if (EXP) \
+ fprintf (stderr, "Warning: " #EXP "\n"); } \
+ while (0)
+ WARN_IF (x == 0);
+ ==> do { if (x == 0)
+ fprintf (stderr, "Warning: " "x == 0" "\n"); } while (0);
+
+The argument for `EXP' is substituted once, as-is, into the `if'
+statement, and once, stringified, into the argument to `fprintf'. If
+`x' were a macro, it would be expanded in the `if' statement, but not
+in the string.
+
+ The `do' and `while (0)' are a kludge to make it possible to write
+`WARN_IF (ARG);', which the resemblance of `WARN_IF' to a function
+would make C programmers want to do; see *Note Swallowing the
+Semicolon::.
+
+ Stringification in C involves more than putting double-quote
+characters around the fragment. The preprocessor backslash-escapes the
+quotes surrounding embedded string constants, and all backslashes
+within string and character constants, in order to get a valid C string
+constant with the proper contents. Thus, stringifying `p = "foo\n";'
+results in "p = \"foo\\n\";". However, backslashes that are not inside
+string or character constants are not duplicated: `\n' by itself
+stringifies to "\n".
+
+ All leading and trailing whitespace in text being stringified is
+ignored. Any sequence of whitespace in the middle of the text is
+converted to a single space in the stringified result. Comments are
+replaced by whitespace long before stringification happens, so they
+never appear in stringified text.
+
+ There is no way to convert a macro argument into a character
+constant.
+
+ If you want to stringify the result of expansion of a macro argument,
+you have to use two levels of macros.
+
+ #define xstr(s) str(s)
+ #define str(s) #s
+ #define foo 4
+ str (foo)
+ ==> "foo"
+ xstr (foo)
+ ==> xstr (4)
+ ==> str (4)
+ ==> "4"
+
+ `s' is stringified when it is used in `str', so it is not
+macro-expanded first. But `s' is an ordinary argument to `xstr', so it
+is completely macro-expanded before `xstr' itself is expanded (*note
+Argument Prescan::). Therefore, by the time `str' gets to its
+argument, it has already been macro-expanded.
+
+
+File: cpp.info, Node: Concatenation, Next: Variadic Macros, Prev: Stringification, Up: Macros
+
+3.5 Concatenation
+=================
+
+It is often useful to merge two tokens into one while expanding macros.
+This is called "token pasting" or "token concatenation". The `##'
+preprocessing operator performs token pasting. When a macro is
+expanded, the two tokens on either side of each `##' operator are
+combined into a single token, which then replaces the `##' and the two
+original tokens in the macro expansion. Usually both will be
+identifiers, or one will be an identifier and the other a preprocessing
+number. When pasted, they make a longer identifier. This isn't the
+only valid case. It is also possible to concatenate two numbers (or a
+number and a name, such as `1.5' and `e3') into a number. Also,
+multi-character operators such as `+=' can be formed by token pasting.
+
+ However, two tokens that don't together form a valid token cannot be
+pasted together. For example, you cannot concatenate `x' with `+' in
+either order. If you try, the preprocessor issues a warning and emits
+the two tokens. Whether it puts white space between the tokens is
+undefined. It is common to find unnecessary uses of `##' in complex
+macros. If you get this warning, it is likely that you can simply
+remove the `##'.
+
+ Both the tokens combined by `##' could come from the macro body, but
+you could just as well write them as one token in the first place.
+Token pasting is most useful when one or both of the tokens comes from a
+macro argument. If either of the tokens next to an `##' is a parameter
+name, it is replaced by its actual argument before `##' executes. As
+with stringification, the actual argument is not macro-expanded first.
+If the argument is empty, that `##' has no effect.
+
+ Keep in mind that the C preprocessor converts comments to whitespace
+before macros are even considered. Therefore, you cannot create a
+comment by concatenating `/' and `*'. You can put as much whitespace
+between `##' and its operands as you like, including comments, and you
+can put comments in arguments that will be concatenated. However, it
+is an error if `##' appears at either end of a macro body.
+
+ Consider a C program that interprets named commands. There probably
+needs to be a table of commands, perhaps an array of structures declared
+as follows:
+
+ struct command
+ {
+ char *name;
+ void (*function) (void);
+ };
+
+ struct command commands[] =
+ {
+ { "quit", quit_command },
+ { "help", help_command },
+ ...
+ };
+
+ It would be cleaner not to have to give each command name twice,
+once in the string constant and once in the function name. A macro
+which takes the name of a command as an argument can make this
+unnecessary. The string constant can be created with stringification,
+and the function name by concatenating the argument with `_command'.
+Here is how it is done:
+
+ #define COMMAND(NAME) { #NAME, NAME ## _command }
+
+ struct command commands[] =
+ {
+ COMMAND (quit),
+ COMMAND (help),
+ ...
+ };
+
+
+File: cpp.info, Node: Variadic Macros, Next: Predefined Macros, Prev: Concatenation, Up: Macros
+
+3.6 Variadic Macros
+===================
+
+A macro can be declared to accept a variable number of arguments much as
+a function can. The syntax for defining the macro is similar to that of
+a function. Here is an example:
+
+ #define eprintf(...) fprintf (stderr, __VA_ARGS__)
+
+ This kind of macro is called "variadic". When the macro is invoked,
+all the tokens in its argument list after the last named argument (this
+macro has none), including any commas, become the "variable argument".
+This sequence of tokens replaces the identifier `__VA_ARGS__' in the
+macro body wherever it appears. Thus, we have this expansion:
+
+ eprintf ("%s:%d: ", input_file, lineno)
+ ==> fprintf (stderr, "%s:%d: ", input_file, lineno)
+
+ The variable argument is completely macro-expanded before it is
+inserted into the macro expansion, just like an ordinary argument. You
+may use the `#' and `##' operators to stringify the variable argument
+or to paste its leading or trailing token with another token. (But see
+below for an important special case for `##'.)
+
+ If your macro is complicated, you may want a more descriptive name
+for the variable argument than `__VA_ARGS__'. CPP permits this, as an
+extension. You may write an argument name immediately before the
+`...'; that name is used for the variable argument. The `eprintf'
+macro above could be written
+
+ #define eprintf(args...) fprintf (stderr, args)
+
+using this extension. You cannot use `__VA_ARGS__' and this extension
+in the same macro.
+
+ You can have named arguments as well as variable arguments in a
+variadic macro. We could define `eprintf' like this, instead:
+
+ #define eprintf(format, ...) fprintf (stderr, format, __VA_ARGS__)
+
+This formulation looks more descriptive, but unfortunately it is less
+flexible: you must now supply at least one argument after the format
+string. In standard C, you cannot omit the comma separating the named
+argument from the variable arguments. Furthermore, if you leave the
+variable argument empty, you will get a syntax error, because there
+will be an extra comma after the format string.
+
+ eprintf("success!\n", );
+ ==> fprintf(stderr, "success!\n", );
+
+ GNU CPP has a pair of extensions which deal with this problem.
+First, you are allowed to leave the variable argument out entirely:
+
+ eprintf ("success!\n")
+ ==> fprintf(stderr, "success!\n", );
+
+Second, the `##' token paste operator has a special meaning when placed
+between a comma and a variable argument. If you write
+
+ #define eprintf(format, ...) fprintf (stderr, format, ##__VA_ARGS__)
+
+and the variable argument is left out when the `eprintf' macro is used,
+then the comma before the `##' will be deleted. This does _not_ happen
+if you pass an empty argument, nor does it happen if the token
+preceding `##' is anything other than a comma.
+
+ eprintf ("success!\n")
+ ==> fprintf(stderr, "success!\n");
+
+The above explanation is ambiguous about the case where the only macro
+parameter is a variable arguments parameter, as it is meaningless to
+try to distinguish whether no argument at all is an empty argument or a
+missing argument. In this case the C99 standard is clear that the
+comma must remain, however the existing GCC extension used to swallow
+the comma. So CPP retains the comma when conforming to a specific C
+standard, and drops it otherwise.
+
+ C99 mandates that the only place the identifier `__VA_ARGS__' can
+appear is in the replacement list of a variadic macro. It may not be
+used as a macro name, macro argument name, or within a different type
+of macro. It may also be forbidden in open text; the standard is
+ambiguous. We recommend you avoid using it except for its defined
+purpose.
+
+ Variadic macros are a new feature in C99. GNU CPP has supported them
+for a long time, but only with a named variable argument (`args...',
+not `...' and `__VA_ARGS__'). If you are concerned with portability to
+previous versions of GCC, you should use only named variable arguments.
+On the other hand, if you are concerned with portability to other
+conforming implementations of C99, you should use only `__VA_ARGS__'.
+
+ Previous versions of CPP implemented the comma-deletion extension
+much more generally. We have restricted it in this release to minimize
+the differences from C99. To get the same effect with both this and
+previous versions of GCC, the token preceding the special `##' must be
+a comma, and there must be white space between that comma and whatever
+comes immediately before it:
+
+ #define eprintf(format, args...) fprintf (stderr, format , ##args)
+
+*Note Differences from previous versions::, for the gory details.
+
+
+File: cpp.info, Node: Predefined Macros, Next: Undefining and Redefining Macros, Prev: Variadic Macros, Up: Macros
+
+3.7 Predefined Macros
+=====================
+
+Several object-like macros are predefined; you use them without
+supplying their definitions. They fall into three classes: standard,
+common, and system-specific.
+
+ In C++, there is a fourth category, the named operators. They act
+like predefined macros, but you cannot undefine them.
+
+* Menu:
+
+* Standard Predefined Macros::
+* Common Predefined Macros::
+* System-specific Predefined Macros::
+* C++ Named Operators::
+
+
+File: cpp.info, Node: Standard Predefined Macros, Next: Common Predefined Macros, Up: Predefined Macros
+
+3.7.1 Standard Predefined Macros
+--------------------------------
+
+The standard predefined macros are specified by the relevant language
+standards, so they are available with all compilers that implement
+those standards. Older compilers may not provide all of them. Their
+names all start with double underscores.
+
+`__FILE__'
+ This macro expands to the name of the current input file, in the
+ form of a C string constant. This is the path by which the
+ preprocessor opened the file, not the short name specified in
+ `#include' or as the input file name argument. For example,
+ `"/usr/local/include/myheader.h"' is a possible expansion of this
+ macro.
+
+`__LINE__'
+ This macro expands to the current input line number, in the form
+ of a decimal integer constant. While we call it a predefined
+ macro, it's a pretty strange macro, since its "definition" changes
+ with each new line of source code.
+
+ `__FILE__' and `__LINE__' are useful in generating an error message
+to report an inconsistency detected by the program; the message can
+state the source line at which the inconsistency was detected. For
+example,
+
+ fprintf (stderr, "Internal error: "
+ "negative string length "
+ "%d at %s, line %d.",
+ length, __FILE__, __LINE__);
+
+ An `#include' directive changes the expansions of `__FILE__' and
+`__LINE__' to correspond to the included file. At the end of that
+file, when processing resumes on the input file that contained the
+`#include' directive, the expansions of `__FILE__' and `__LINE__'
+revert to the values they had before the `#include' (but `__LINE__' is
+then incremented by one as processing moves to the line after the
+`#include').
+
+ A `#line' directive changes `__LINE__', and may change `__FILE__' as
+well. *Note Line Control::.
+
+ C99 introduces `__func__', and GCC has provided `__FUNCTION__' for a
+long time. Both of these are strings containing the name of the
+current function (there are slight semantic differences; see the GCC
+manual). Neither of them is a macro; the preprocessor does not know the
+name of the current function. They tend to be useful in conjunction
+with `__FILE__' and `__LINE__', though.
+
+`__DATE__'
+ This macro expands to a string constant that describes the date on
+ which the preprocessor is being run. The string constant contains
+ eleven characters and looks like `"Feb 12 1996"'. If the day of
+ the month is less than 10, it is padded with a space on the left.
+
+ If GCC cannot determine the current date, it will emit a warning
+ message (once per compilation) and `__DATE__' will expand to
+ `"??? ?? ????"'.
+
+`__TIME__'
+ This macro expands to a string constant that describes the time at
+ which the preprocessor is being run. The string constant contains
+ eight characters and looks like `"23:59:01"'.
+
+ If GCC cannot determine the current time, it will emit a warning
+ message (once per compilation) and `__TIME__' will expand to
+ `"??:??:??"'.
+
+`__STDC__'
+ In normal operation, this macro expands to the constant 1, to
+ signify that this compiler conforms to ISO Standard C. If GNU CPP
+ is used with a compiler other than GCC, this is not necessarily
+ true; however, the preprocessor always conforms to the standard
+ unless the `-traditional-cpp' option is used.
+
+ This macro is not defined if the `-traditional-cpp' option is used.
+
+ On some hosts, the system compiler uses a different convention,
+ where `__STDC__' is normally 0, but is 1 if the user specifies
+ strict conformance to the C Standard. CPP follows the host
+ convention when processing system header files, but when
+ processing user files `__STDC__' is always 1. This has been
+ reported to cause problems; for instance, some versions of Solaris
+ provide X Windows headers that expect `__STDC__' to be either
+ undefined or 1. *Note Invocation::.
+
+`__STDC_VERSION__'
+ This macro expands to the C Standard's version number, a long
+ integer constant of the form `YYYYMML' where YYYY and MM are the
+ year and month of the Standard version. This signifies which
+ version of the C Standard the compiler conforms to. Like
+ `__STDC__', this is not necessarily accurate for the entire
+ implementation, unless GNU CPP is being used with GCC.
+
+ The value `199409L' signifies the 1989 C standard as amended in
+ 1994, which is the current default; the value `199901L' signifies
+ the 1999 revision of the C standard. Support for the 1999
+ revision is not yet complete.
+
+ This macro is not defined if the `-traditional-cpp' option is
+ used, nor when compiling C++ or Objective-C.
+
+`__STDC_HOSTED__'
+ This macro is defined, with value 1, if the compiler's target is a
+ "hosted environment". A hosted environment has the complete
+ facilities of the standard C library available.
+
+`__cplusplus'
+ This macro is defined when the C++ compiler is in use. You can use
+ `__cplusplus' to test whether a header is compiled by a C compiler
+ or a C++ compiler. This macro is similar to `__STDC_VERSION__', in
+ that it expands to a version number. A fully conforming
+ implementation of the 1998 C++ standard will define this macro to
+ `199711L'. The GNU C++ compiler is not yet fully conforming, so
+ it uses `1' instead. It is hoped to complete the implementation
+ of standard C++ in the near future.
+
+`__OBJC__'
+ This macro is defined, with value 1, when the Objective-C compiler
+ is in use. You can use `__OBJC__' to test whether a header is
+ compiled by a C compiler or a Objective-C compiler.
+
+`__ASSEMBLER__'
+ This macro is defined with value 1 when preprocessing assembly
+ language.
+
+
+
+File: cpp.info, Node: Common Predefined Macros, Next: System-specific Predefined Macros, Prev: Standard Predefined Macros, Up: Predefined Macros
+
+3.7.2 Common Predefined Macros
+------------------------------
+
+The common predefined macros are GNU C extensions. They are available
+with the same meanings regardless of the machine or operating system on
+which you are using GNU C or GNU Fortran. Their names all start with
+double underscores.
+
+`__COUNTER__'
+ This macro expands to sequential integral values starting from 0.
+ In conjunction with the `##' operator, this provides a convenient
+ means to generate unique identifiers. Care must be taken to
+ ensure that `__COUNTER__' is not expanded prior to inclusion of
+ precompiled headers which use it. Otherwise, the precompiled
+ headers will not be used.
+
+`__GFORTRAN__'
+ The GNU Fortran compiler defines this.
+
+`__GNUC__'
+`__GNUC_MINOR__'
+`__GNUC_PATCHLEVEL__'
+ These macros are defined by all GNU compilers that use the C
+ preprocessor: C, C++, Objective-C and Fortran. Their values are
+ the major version, minor version, and patch level of the compiler,
+ as integer constants. For example, GCC 3.2.1 will define
+ `__GNUC__' to 3, `__GNUC_MINOR__' to 2, and `__GNUC_PATCHLEVEL__'
+ to 1. These macros are also defined if you invoke the
+ preprocessor directly.
+
+ `__GNUC_PATCHLEVEL__' is new to GCC 3.0; it is also present in the
+ widely-used development snapshots leading up to 3.0 (which identify
+ themselves as GCC 2.96 or 2.97, depending on which snapshot you
+ have).
+
+ If all you need to know is whether or not your program is being
+ compiled by GCC, or a non-GCC compiler that claims to accept the
+ GNU C dialects, you can simply test `__GNUC__'. If you need to
+ write code which depends on a specific version, you must be more
+ careful. Each time the minor version is increased, the patch
+ level is reset to zero; each time the major version is increased
+ (which happens rarely), the minor version and patch level are
+ reset. If you wish to use the predefined macros directly in the
+ conditional, you will need to write it like this:
+
+ /* Test for GCC > 3.2.0 */
+ #if __GNUC__ > 3 || \
+ (__GNUC__ == 3 && (__GNUC_MINOR__ > 2 || \
+ (__GNUC_MINOR__ == 2 && \
+ __GNUC_PATCHLEVEL__ > 0))
+
+ Another approach is to use the predefined macros to calculate a
+ single number, then compare that against a threshold:
+
+ #define GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
+ ...
+ /* Test for GCC > 3.2.0 */
+ #if GCC_VERSION > 30200
+
+ Many people find this form easier to understand.
+
+`__GNUG__'
+ The GNU C++ compiler defines this. Testing it is equivalent to
+ testing `(__GNUC__ && __cplusplus)'.
+
+`__STRICT_ANSI__'
+ GCC defines this macro if and only if the `-ansi' switch, or a
+ `-std' switch specifying strict conformance to some version of ISO
+ C, was specified when GCC was invoked. It is defined to `1'.
+ This macro exists primarily to direct GNU libc's header files to
+ restrict their definitions to the minimal set found in the 1989 C
+ standard.
+
+`__BASE_FILE__'
+ This macro expands to the name of the main input file, in the form
+ of a C string constant. This is the source file that was specified
+ on the command line of the preprocessor or C compiler.
+
+`__INCLUDE_LEVEL__'
+ This macro expands to a decimal integer constant that represents
+ the depth of nesting in include files. The value of this macro is
+ incremented on every `#include' directive and decremented at the
+ end of every included file. It starts out at 0, its value within
+ the base file specified on the command line.
+
+`__ELF__'
+ This macro is defined if the target uses the ELF object format.
+
+`__VERSION__'
+ This macro expands to a string constant which describes the
+ version of the compiler in use. You should not rely on its
+ contents having any particular form, but it can be counted on to
+ contain at least the release number.
+
+`__OPTIMIZE__'
+`__OPTIMIZE_SIZE__'
+`__NO_INLINE__'
+ These macros describe the compilation mode. `__OPTIMIZE__' is
+ defined in all optimizing compilations. `__OPTIMIZE_SIZE__' is
+ defined if the compiler is optimizing for size, not speed.
+ `__NO_INLINE__' is defined if no functions will be inlined into
+ their callers (when not optimizing, or when inlining has been
+ specifically disabled by `-fno-inline').
+
+ These macros cause certain GNU header files to provide optimized
+ definitions, using macros or inline functions, of system library
+ functions. You should not use these macros in any way unless you
+ make sure that programs will execute with the same effect whether
+ or not they are defined. If they are defined, their value is 1.
+
+`__GNUC_GNU_INLINE__'
+ GCC defines this macro if functions declared `inline' will be
+ handled in GCC's traditional gnu89 mode. Object files will contain
+ externally visible definitions of all functions declared `inline'
+ without `extern' or `static'. They will not contain any
+ definitions of any functions declared `extern inline'.
+
+`__GNUC_STDC_INLINE__'
+ GCC defines this macro if functions declared `inline' will be
+ handled according to the ISO C99 standard. Object files will
+ contain externally visible definitions of all functions declared
+ `extern inline'. They will not contain definitions of any
+ functions declared `inline' without `extern'.
+
+ If this macro is defined, GCC supports the `gnu_inline' function
+ attribute as a way to always get the gnu89 behavior. Support for
+ this and `__GNUC_GNU_INLINE__' was added in GCC 4.1.3. If neither
+ macro is defined, an older version of GCC is being used: `inline'
+ functions will be compiled in gnu89 mode, and the `gnu_inline'
+ function attribute will not be recognized.
+
+`__CHAR_UNSIGNED__'
+ GCC defines this macro if and only if the data type `char' is
+ unsigned on the target machine. It exists to cause the standard
+ header file `limits.h' to work correctly. You should not use this
+ macro yourself; instead, refer to the standard macros defined in
+ `limits.h'.
+
+`__WCHAR_UNSIGNED__'
+ Like `__CHAR_UNSIGNED__', this macro is defined if and only if the
+ data type `wchar_t' is unsigned and the front-end is in C++ mode.
+
+`__REGISTER_PREFIX__'
+ This macro expands to a single token (not a string constant) which
+ is the prefix applied to CPU register names in assembly language
+ for this target. You can use it to write assembly that is usable
+ in multiple environments. For example, in the `m68k-aout'
+ environment it expands to nothing, but in the `m68k-coff'
+ environment it expands to a single `%'.
+
+`__USER_LABEL_PREFIX__'
+ This macro expands to a single token which is the prefix applied to
+ user labels (symbols visible to C code) in assembly. For example,
+ in the `m68k-aout' environment it expands to an `_', but in the
+ `m68k-coff' environment it expands to nothing.
+
+ This macro will have the correct definition even if
+ `-f(no-)underscores' is in use, but it will not be correct if
+ target-specific options that adjust this prefix are used (e.g. the
+ OSF/rose `-mno-underscores' option).
+
+`__SIZE_TYPE__'
+`__PTRDIFF_TYPE__'
+`__WCHAR_TYPE__'
+`__WINT_TYPE__'
+`__INTMAX_TYPE__'
+`__UINTMAX_TYPE__'
+ These macros are defined to the correct underlying types for the
+ `size_t', `ptrdiff_t', `wchar_t', `wint_t', `intmax_t', and
+ `uintmax_t' typedefs, respectively. They exist to make the
+ standard header files `stddef.h' and `wchar.h' work correctly.
+ You should not use these macros directly; instead, include the
+ appropriate headers and use the typedefs.
+
+`__CHAR_BIT__'
+ Defined to the number of bits used in the representation of the
+ `char' data type. It exists to make the standard header given
+ numerical limits work correctly. You should not use this macro
+ directly; instead, include the appropriate headers.
+
+`__SCHAR_MAX__'
+`__WCHAR_MAX__'
+`__SHRT_MAX__'
+`__INT_MAX__'
+`__LONG_MAX__'
+`__LONG_LONG_MAX__'
+`__INTMAX_MAX__'
+ Defined to the maximum value of the `signed char', `wchar_t',
+ `signed short', `signed int', `signed long', `signed long long',
+ and `intmax_t' types respectively. They exist to make the
+ standard header given numerical limits work correctly. You should
+ not use these macros directly; instead, include the appropriate
+ headers.
+
+`__SIZEOF_INT__'
+`__SIZEOF_LONG__'
+`__SIZEOF_LONG_LONG__'
+`__SIZEOF_SHORT__'
+`__SIZEOF_POINTER__'
+`__SIZEOF_FLOAT__'
+`__SIZEOF_DOUBLE__'
+`__SIZEOF_LONG_DOUBLE__'
+`__SIZEOF_SIZE_T__'
+`__SIZEOF_WCHAR_T__'
+`__SIZEOF_WINT_T__'
+`__SIZEOF_PTRDIFF_T__'
+ Defined to the number of bytes of the C standard data types: `int',
+ `long', `long long', `short', `void *', `float', `double', `long
+ double', `size_t', `wchar_t', `wint_t' and `ptrdiff_t'.
+
+`__DEPRECATED'
+ This macro is defined, with value 1, when compiling a C++ source
+ file with warnings about deprecated constructs enabled. These
+ warnings are enabled by default, but can be disabled with
+ `-Wno-deprecated'.
+
+`__EXCEPTIONS'
+ This macro is defined, with value 1, when compiling a C++ source
+ file with exceptions enabled. If `-fno-exceptions' is used when
+ compiling the file, then this macro is not defined.
+
+`__GXX_RTTI'
+ This macro is defined, with value 1, when compiling a C++ source
+ file with runtime type identification enabled. If `-fno-rtti' is
+ used when compiling the file, then this macro is not defined.
+
+`__USING_SJLJ_EXCEPTIONS__'
+ This macro is defined, with value 1, if the compiler uses the old
+ mechanism based on `setjmp' and `longjmp' for exception handling.
+
+`__GXX_EXPERIMENTAL_CXX0X__'
+ This macro is defined when compiling a C++ source file with the
+ option `-std=c++0x' or `-std=gnu++0x'. It indicates that some
+ features likely to be included in C++0x are available. Note that
+ these features are experimental, and may change or be removed in
+ future versions of GCC.
+
+`__GXX_WEAK__'
+ This macro is defined when compiling a C++ source file. It has the
+ value 1 if the compiler will use weak symbols, COMDAT sections, or
+ other similar techniques to collapse symbols with "vague linkage"
+ that are defined in multiple translation units. If the compiler
+ will not collapse such symbols, this macro is defined with value
+ 0. In general, user code should not need to make use of this
+ macro; the purpose of this macro is to ease implementation of the
+ C++ runtime library provided with G++.
+
+`__NEXT_RUNTIME__'
+ This macro is defined, with value 1, if (and only if) the NeXT
+ runtime (as in `-fnext-runtime') is in use for Objective-C. If
+ the GNU runtime is used, this macro is not defined, so that you
+ can use this macro to determine which runtime (NeXT or GNU) is
+ being used.
+
+`__LP64__'
+`_LP64'
+ These macros are defined, with value 1, if (and only if) the
+ compilation is for a target where `long int' and pointer both use
+ 64-bits and `int' uses 32-bit.
+
+`__SSP__'
+ This macro is defined, with value 1, when `-fstack-protector' is in
+ use.
+
+`__SSP_ALL__'
+ This macro is defined, with value 2, when `-fstack-protector-all'
+ is in use.
+
+`__TIMESTAMP__'
+ This macro expands to a string constant that describes the date
+ and time of the last modification of the current source file. The
+ string constant contains abbreviated day of the week, month, day
+ of the month, time in hh:mm:ss form, year and looks like
+ `"Sun Sep 16 01:03:52 1973"'. If the day of the month is less
+ than 10, it is padded with a space on the left.
+
+ If GCC cannot determine the current date, it will emit a warning
+ message (once per compilation) and `__TIMESTAMP__' will expand to
+ `"??? ??? ?? ??:??:?? ????"'.
+
+`__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1'
+`__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2'
+`__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4'
+`__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8'
+`__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16'
+ These macros are defined when the target processor supports atomic
+ compare and swap operations on operands 1, 2, 4, 8 or 16 bytes in
+ length, respectively.
+
+`__GCC_HAVE_DWARF2_CFI_ASM'
+ This macro is defined when the compiler is emitting Dwarf2 CFI
+ directives to the assembler. When this is defined, it is possible
+ to emit those same directives in inline assembly.
+
+
+File: cpp.info, Node: System-specific Predefined Macros, Next: C++ Named Operators, Prev: Common Predefined Macros, Up: Predefined Macros
+
+3.7.3 System-specific Predefined Macros
+---------------------------------------
+
+The C preprocessor normally predefines several macros that indicate what
+type of system and machine is in use. They are obviously different on
+each target supported by GCC. This manual, being for all systems and
+machines, cannot tell you what their names are, but you can use `cpp
+-dM' to see them all. *Note Invocation::. All system-specific
+predefined macros expand to the constant 1, so you can test them with
+either `#ifdef' or `#if'.
+
+ The C standard requires that all system-specific macros be part of
+the "reserved namespace". All names which begin with two underscores,
+or an underscore and a capital letter, are reserved for the compiler and
+library to use as they wish. However, historically system-specific
+macros have had names with no special prefix; for instance, it is common
+to find `unix' defined on Unix systems. For all such macros, GCC
+provides a parallel macro with two underscores added at the beginning
+and the end. If `unix' is defined, `__unix__' will be defined too.
+There will never be more than two underscores; the parallel of `_mips'
+is `__mips__'.
+
+ When the `-ansi' option, or any `-std' option that requests strict
+conformance, is given to the compiler, all the system-specific
+predefined macros outside the reserved namespace are suppressed. The
+parallel macros, inside the reserved namespace, remain defined.
+
+ We are slowly phasing out all predefined macros which are outside the
+reserved namespace. You should never use them in new programs, and we
+encourage you to correct older code to use the parallel macros whenever
+you find it. We don't recommend you use the system-specific macros that
+are in the reserved namespace, either. It is better in the long run to
+check specifically for features you need, using a tool such as
+`autoconf'.
+
+
+File: cpp.info, Node: C++ Named Operators, Prev: System-specific Predefined Macros, Up: Predefined Macros
+
+3.7.4 C++ Named Operators
+-------------------------
+
+In C++, there are eleven keywords which are simply alternate spellings
+of operators normally written with punctuation. These keywords are
+treated as such even in the preprocessor. They function as operators in
+`#if', and they cannot be defined as macros or poisoned. In C, you can
+request that those keywords take their C++ meaning by including
+`iso646.h'. That header defines each one as a normal object-like macro
+expanding to the appropriate punctuator.
+
+ These are the named operators and their corresponding punctuators:
+
+Named Operator Punctuator
+`and' `&&'
+`and_eq' `&='
+`bitand' `&'
+`bitor' `|'
+`compl' `~'
+`not' `!'
+`not_eq' `!='
+`or' `||'
+`or_eq' `|='
+`xor' `^'
+`xor_eq' `^='
+
+
+File: cpp.info, Node: Undefining and Redefining Macros, Next: Directives Within Macro Arguments, Prev: Predefined Macros, Up: Macros
+
+3.8 Undefining and Redefining Macros
+====================================
+
+If a macro ceases to be useful, it may be "undefined" with the `#undef'
+directive. `#undef' takes a single argument, the name of the macro to
+undefine. You use the bare macro name, even if the macro is
+function-like. It is an error if anything appears on the line after
+the macro name. `#undef' has no effect if the name is not a macro.
+
+ #define FOO 4
+ x = FOO; ==> x = 4;
+ #undef FOO
+ x = FOO; ==> x = FOO;
+
+ Once a macro has been undefined, that identifier may be "redefined"
+as a macro by a subsequent `#define' directive. The new definition
+need not have any resemblance to the old definition.
+
+ However, if an identifier which is currently a macro is redefined,
+then the new definition must be "effectively the same" as the old one.
+Two macro definitions are effectively the same if:
+ * Both are the same type of macro (object- or function-like).
+
+ * All the tokens of the replacement list are the same.
+
+ * If there are any parameters, they are the same.
+
+ * Whitespace appears in the same places in both. It need not be
+ exactly the same amount of whitespace, though. Remember that
+ comments count as whitespace.
+
+These definitions are effectively the same:
+ #define FOUR (2 + 2)
+ #define FOUR (2 + 2)
+ #define FOUR (2 /* two */ + 2)
+ but these are not:
+ #define FOUR (2 + 2)
+ #define FOUR ( 2+2 )
+ #define FOUR (2 * 2)
+ #define FOUR(score,and,seven,years,ago) (2 + 2)
+
+ If a macro is redefined with a definition that is not effectively the
+same as the old one, the preprocessor issues a warning and changes the
+macro to use the new definition. If the new definition is effectively
+the same, the redefinition is silently ignored. This allows, for
+instance, two different headers to define a common macro. The
+preprocessor will only complain if the definitions do not match.
+
+
+File: cpp.info, Node: Directives Within Macro Arguments, Next: Macro Pitfalls, Prev: Undefining and Redefining Macros, Up: Macros
+
+3.9 Directives Within Macro Arguments
+=====================================
+
+Occasionally it is convenient to use preprocessor directives within the
+arguments of a macro. The C and C++ standards declare that behavior in
+these cases is undefined.
+
+ Versions of CPP prior to 3.2 would reject such constructs with an
+error message. This was the only syntactic difference between normal
+functions and function-like macros, so it seemed attractive to remove
+this limitation, and people would often be surprised that they could
+not use macros in this way. Moreover, sometimes people would use
+conditional compilation in the argument list to a normal library
+function like `printf', only to find that after a library upgrade
+`printf' had changed to be a function-like macro, and their code would
+no longer compile. So from version 3.2 we changed CPP to successfully
+process arbitrary directives within macro arguments in exactly the same
+way as it would have processed the directive were the function-like
+macro invocation not present.
+
+ If, within a macro invocation, that macro is redefined, then the new
+definition takes effect in time for argument pre-expansion, but the
+original definition is still used for argument replacement. Here is a
+pathological example:
+
+ #define f(x) x x
+ f (1
+ #undef f
+ #define f 2
+ f)
+
+which expands to
+
+ 1 2 1 2
+
+with the semantics described above.
+
+
+File: cpp.info, Node: Macro Pitfalls, Prev: Directives Within Macro Arguments, Up: Macros
+
+3.10 Macro Pitfalls
+===================
+
+In this section we describe some special rules that apply to macros and
+macro expansion, and point out certain cases in which the rules have
+counter-intuitive consequences that you must watch out for.
+
+* Menu:
+
+* Misnesting::
+* Operator Precedence Problems::
+* Swallowing the Semicolon::
+* Duplication of Side Effects::
+* Self-Referential Macros::
+* Argument Prescan::
+* Newlines in Arguments::
+
+
+File: cpp.info, Node: Misnesting, Next: Operator Precedence Problems, Up: Macro Pitfalls
+
+3.10.1 Misnesting
+-----------------
+
+When a macro is called with arguments, the arguments are substituted
+into the macro body and the result is checked, together with the rest of
+the input file, for more macro calls. It is possible to piece together
+a macro call coming partially from the macro body and partially from the
+arguments. For example,
+
+ #define twice(x) (2*(x))
+ #define call_with_1(x) x(1)
+ call_with_1 (twice)
+ ==> twice(1)
+ ==> (2*(1))
+
+ Macro definitions do not have to have balanced parentheses. By
+writing an unbalanced open parenthesis in a macro body, it is possible
+to create a macro call that begins inside the macro body but ends
+outside of it. For example,
+
+ #define strange(file) fprintf (file, "%s %d",
+ ...
+ strange(stderr) p, 35)
+ ==> fprintf (stderr, "%s %d", p, 35)
+
+ The ability to piece together a macro call can be useful, but the
+use of unbalanced open parentheses in a macro body is just confusing,
+and should be avoided.
+
+
+File: cpp.info, Node: Operator Precedence Problems, Next: Swallowing the Semicolon, Prev: Misnesting, Up: Macro Pitfalls
+
+3.10.2 Operator Precedence Problems
+-----------------------------------
+
+You may have noticed that in most of the macro definition examples shown
+above, each occurrence of a macro argument name had parentheses around
+it. In addition, another pair of parentheses usually surround the
+entire macro definition. Here is why it is best to write macros that
+way.
+
+ Suppose you define a macro as follows,
+
+ #define ceil_div(x, y) (x + y - 1) / y
+
+whose purpose is to divide, rounding up. (One use for this operation is
+to compute how many `int' objects are needed to hold a certain number
+of `char' objects.) Then suppose it is used as follows:
+
+ a = ceil_div (b & c, sizeof (int));
+ ==> a = (b & c + sizeof (int) - 1) / sizeof (int);
+
+This does not do what is intended. The operator-precedence rules of C
+make it equivalent to this:
+
+ a = (b & (c + sizeof (int) - 1)) / sizeof (int);
+
+What we want is this:
+
+ a = ((b & c) + sizeof (int) - 1)) / sizeof (int);
+
+Defining the macro as
+
+ #define ceil_div(x, y) ((x) + (y) - 1) / (y)
+
+provides the desired result.
+
+ Unintended grouping can result in another way. Consider `sizeof
+ceil_div(1, 2)'. That has the appearance of a C expression that would
+compute the size of the type of `ceil_div (1, 2)', but in fact it means
+something very different. Here is what it expands to:
+
+ sizeof ((1) + (2) - 1) / (2)
+
+This would take the size of an integer and divide it by two. The
+precedence rules have put the division outside the `sizeof' when it was
+intended to be inside.
+
+ Parentheses around the entire macro definition prevent such problems.
+Here, then, is the recommended way to define `ceil_div':
+
+ #define ceil_div(x, y) (((x) + (y) - 1) / (y))
+
+
+File: cpp.info, Node: Swallowing the Semicolon, Next: Duplication of Side Effects, Prev: Operator Precedence Problems, Up: Macro Pitfalls
+
+3.10.3 Swallowing the Semicolon
+-------------------------------
+
+Often it is desirable to define a macro that expands into a compound
+statement. Consider, for example, the following macro, that advances a
+pointer (the argument `p' says where to find it) across whitespace
+characters:
+
+ #define SKIP_SPACES(p, limit) \
+ { char *lim = (limit); \
+ while (p < lim) { \
+ if (*p++ != ' ') { \
+ p--; break; }}}
+
+Here backslash-newline is used to split the macro definition, which must
+be a single logical line, so that it resembles the way such code would
+be laid out if not part of a macro definition.
+
+ A call to this macro might be `SKIP_SPACES (p, lim)'. Strictly
+speaking, the call expands to a compound statement, which is a complete
+statement with no need for a semicolon to end it. However, since it
+looks like a function call, it minimizes confusion if you can use it
+like a function call, writing a semicolon afterward, as in `SKIP_SPACES
+(p, lim);'
+
+ This can cause trouble before `else' statements, because the
+semicolon is actually a null statement. Suppose you write
+
+ if (*p != 0)
+ SKIP_SPACES (p, lim);
+ else ...
+
+The presence of two statements--the compound statement and a null
+statement--in between the `if' condition and the `else' makes invalid C
+code.
+
+ The definition of the macro `SKIP_SPACES' can be altered to solve
+this problem, using a `do ... while' statement. Here is how:
+
+ #define SKIP_SPACES(p, limit) \
+ do { char *lim = (limit); \
+ while (p < lim) { \
+ if (*p++ != ' ') { \
+ p--; break; }}} \
+ while (0)
+
+ Now `SKIP_SPACES (p, lim);' expands into
+
+ do {...} while (0);
+
+which is one statement. The loop executes exactly once; most compilers
+generate no extra code for it.
+
+
+File: cpp.info, Node: Duplication of Side Effects, Next: Self-Referential Macros, Prev: Swallowing the Semicolon, Up: Macro Pitfalls
+
+3.10.4 Duplication of Side Effects
+----------------------------------
+
+Many C programs define a macro `min', for "minimum", like this:
+
+ #define min(X, Y) ((X) < (Y) ? (X) : (Y))
+
+ When you use this macro with an argument containing a side effect,
+as shown here,
+
+ next = min (x + y, foo (z));
+
+it expands as follows:
+
+ next = ((x + y) < (foo (z)) ? (x + y) : (foo (z)));
+
+where `x + y' has been substituted for `X' and `foo (z)' for `Y'.
+
+ The function `foo' is used only once in the statement as it appears
+in the program, but the expression `foo (z)' has been substituted twice
+into the macro expansion. As a result, `foo' might be called two times
+when the statement is executed. If it has side effects or if it takes
+a long time to compute, the results might not be what you intended. We
+say that `min' is an "unsafe" macro.
+
+ The best solution to this problem is to define `min' in a way that
+computes the value of `foo (z)' only once. The C language offers no
+standard way to do this, but it can be done with GNU extensions as
+follows:
+
+ #define min(X, Y) \
+ ({ typeof (X) x_ = (X); \
+ typeof (Y) y_ = (Y); \
+ (x_ < y_) ? x_ : y_; })
+
+ The `({ ... })' notation produces a compound statement that acts as
+an expression. Its value is the value of its last statement. This
+permits us to define local variables and assign each argument to one.
+The local variables have underscores after their names to reduce the
+risk of conflict with an identifier of wider scope (it is impossible to
+avoid this entirely). Now each argument is evaluated exactly once.
+
+ If you do not wish to use GNU C extensions, the only solution is to
+be careful when _using_ the macro `min'. For example, you can
+calculate the value of `foo (z)', save it in a variable, and use that
+variable in `min':
+
+ #define min(X, Y) ((X) < (Y) ? (X) : (Y))
+ ...
+ {
+ int tem = foo (z);
+ next = min (x + y, tem);
+ }
+
+(where we assume that `foo' returns type `int').
+
+
+File: cpp.info, Node: Self-Referential Macros, Next: Argument Prescan, Prev: Duplication of Side Effects, Up: Macro Pitfalls
+
+3.10.5 Self-Referential Macros
+------------------------------
+
+A "self-referential" macro is one whose name appears in its definition.
+Recall that all macro definitions are rescanned for more macros to
+replace. If the self-reference were considered a use of the macro, it
+would produce an infinitely large expansion. To prevent this, the
+self-reference is not considered a macro call. It is passed into the
+preprocessor output unchanged. Consider an example:
+
+ #define foo (4 + foo)
+
+where `foo' is also a variable in your program.
+
+ Following the ordinary rules, each reference to `foo' will expand
+into `(4 + foo)'; then this will be rescanned and will expand into `(4
++ (4 + foo))'; and so on until the computer runs out of memory.
+
+ The self-reference rule cuts this process short after one step, at
+`(4 + foo)'. Therefore, this macro definition has the possibly useful
+effect of causing the program to add 4 to the value of `foo' wherever
+`foo' is referred to.
+
+ In most cases, it is a bad idea to take advantage of this feature. A
+person reading the program who sees that `foo' is a variable will not
+expect that it is a macro as well. The reader will come across the
+identifier `foo' in the program and think its value should be that of
+the variable `foo', whereas in fact the value is four greater.
+
+ One common, useful use of self-reference is to create a macro which
+expands to itself. If you write
+
+ #define EPERM EPERM
+
+then the macro `EPERM' expands to `EPERM'. Effectively, it is left
+alone by the preprocessor whenever it's used in running text. You can
+tell that it's a macro with `#ifdef'. You might do this if you want to
+define numeric constants with an `enum', but have `#ifdef' be true for
+each constant.
+
+ If a macro `x' expands to use a macro `y', and the expansion of `y'
+refers to the macro `x', that is an "indirect self-reference" of `x'.
+`x' is not expanded in this case either. Thus, if we have
+
+ #define x (4 + y)
+ #define y (2 * x)
+
+then `x' and `y' expand as follows:
+
+ x ==> (4 + y)
+ ==> (4 + (2 * x))
+
+ y ==> (2 * x)
+ ==> (2 * (4 + y))
+
+Each macro is expanded when it appears in the definition of the other
+macro, but not when it indirectly appears in its own definition.
+
+
+File: cpp.info, Node: Argument Prescan, Next: Newlines in Arguments, Prev: Self-Referential Macros, Up: Macro Pitfalls
+
+3.10.6 Argument Prescan
+-----------------------
+
+Macro arguments are completely macro-expanded before they are
+substituted into a macro body, unless they are stringified or pasted
+with other tokens. After substitution, the entire macro body, including
+the substituted arguments, is scanned again for macros to be expanded.
+The result is that the arguments are scanned _twice_ to expand macro
+calls in them.
+
+ Most of the time, this has no effect. If the argument contained any
+macro calls, they are expanded during the first scan. The result
+therefore contains no macro calls, so the second scan does not change
+it. If the argument were substituted as given, with no prescan, the
+single remaining scan would find the same macro calls and produce the
+same results.
+
+ You might expect the double scan to change the results when a
+self-referential macro is used in an argument of another macro (*note
+Self-Referential Macros::): the self-referential macro would be
+expanded once in the first scan, and a second time in the second scan.
+However, this is not what happens. The self-references that do not
+expand in the first scan are marked so that they will not expand in the
+second scan either.
+
+ You might wonder, "Why mention the prescan, if it makes no
+difference? And why not skip it and make the preprocessor faster?"
+The answer is that the prescan does make a difference in three special
+cases:
+
+ * Nested calls to a macro.
+
+ We say that "nested" calls to a macro occur when a macro's argument
+ contains a call to that very macro. For example, if `f' is a macro
+ that expects one argument, `f (f (1))' is a nested pair of calls to
+ `f'. The desired expansion is made by expanding `f (1)' and
+ substituting that into the definition of `f'. The prescan causes
+ the expected result to happen. Without the prescan, `f (1)' itself
+ would be substituted as an argument, and the inner use of `f' would
+ appear during the main scan as an indirect self-reference and
+ would not be expanded.
+
+ * Macros that call other macros that stringify or concatenate.
+
+ If an argument is stringified or concatenated, the prescan does not
+ occur. If you _want_ to expand a macro, then stringify or
+ concatenate its expansion, you can do that by causing one macro to
+ call another macro that does the stringification or concatenation.
+ For instance, if you have
+
+ #define AFTERX(x) X_ ## x
+ #define XAFTERX(x) AFTERX(x)
+ #define TABLESIZE 1024
+ #define BUFSIZE TABLESIZE
+
+ then `AFTERX(BUFSIZE)' expands to `X_BUFSIZE', and
+ `XAFTERX(BUFSIZE)' expands to `X_1024'. (Not to `X_TABLESIZE'.
+ Prescan always does a complete expansion.)
+
+ * Macros used in arguments, whose expansions contain unshielded
+ commas.
+
+ This can cause a macro expanded on the second scan to be called
+ with the wrong number of arguments. Here is an example:
+
+ #define foo a,b
+ #define bar(x) lose(x)
+ #define lose(x) (1 + (x))
+
+ We would like `bar(foo)' to turn into `(1 + (foo))', which would
+ then turn into `(1 + (a,b))'. Instead, `bar(foo)' expands into
+ `lose(a,b)', and you get an error because `lose' requires a single
+ argument. In this case, the problem is easily solved by the same
+ parentheses that ought to be used to prevent misnesting of
+ arithmetic operations:
+
+ #define foo (a,b)
+ or
+ #define bar(x) lose((x))
+
+ The extra pair of parentheses prevents the comma in `foo''s
+ definition from being interpreted as an argument separator.
+
+
+
+File: cpp.info, Node: Newlines in Arguments, Prev: Argument Prescan, Up: Macro Pitfalls
+
+3.10.7 Newlines in Arguments
+----------------------------
+
+The invocation of a function-like macro can extend over many logical
+lines. However, in the present implementation, the entire expansion
+comes out on one line. Thus line numbers emitted by the compiler or
+debugger refer to the line the invocation started on, which might be
+different to the line containing the argument causing the problem.
+
+ Here is an example illustrating this:
+
+ #define ignore_second_arg(a,b,c) a; c
+
+ ignore_second_arg (foo (),
+ ignored (),
+ syntax error);
+
+The syntax error triggered by the tokens `syntax error' results in an
+error message citing line three--the line of ignore_second_arg-- even
+though the problematic code comes from line five.
+
+ We consider this a bug, and intend to fix it in the near future.
+
+
+File: cpp.info, Node: Conditionals, Next: Diagnostics, Prev: Macros, Up: Top
+
+4 Conditionals
+**************
+
+A "conditional" is a directive that instructs the preprocessor to
+select whether or not to include a chunk of code in the final token
+stream passed to the compiler. Preprocessor conditionals can test
+arithmetic expressions, or whether a name is defined as a macro, or both
+simultaneously using the special `defined' operator.
+
+ A conditional in the C preprocessor resembles in some ways an `if'
+statement in C, but it is important to understand the difference between
+them. The condition in an `if' statement is tested during the
+execution of your program. Its purpose is to allow your program to
+behave differently from run to run, depending on the data it is
+operating on. The condition in a preprocessing conditional directive is
+tested when your program is compiled. Its purpose is to allow different
+code to be included in the program depending on the situation at the
+time of compilation.
+
+ However, the distinction is becoming less clear. Modern compilers
+often do test `if' statements when a program is compiled, if their
+conditions are known not to vary at run time, and eliminate code which
+can never be executed. If you can count on your compiler to do this,
+you may find that your program is more readable if you use `if'
+statements with constant conditions (perhaps determined by macros). Of
+course, you can only use this to exclude code, not type definitions or
+other preprocessing directives, and you can only do it if the code
+remains syntactically valid when it is not to be used.
+
+ GCC version 3 eliminates this kind of never-executed code even when
+not optimizing. Older versions did it only when optimizing.
+
+* Menu:
+
+* Conditional Uses::
+* Conditional Syntax::
+* Deleted Code::
+
+
+File: cpp.info, Node: Conditional Uses, Next: Conditional Syntax, Up: Conditionals
+
+4.1 Conditional Uses
+====================
+
+There are three general reasons to use a conditional.
+
+ * A program may need to use different code depending on the machine
+ or operating system it is to run on. In some cases the code for
+ one operating system may be erroneous on another operating system;
+ for example, it might refer to data types or constants that do not
+ exist on the other system. When this happens, it is not enough to
+ avoid executing the invalid code. Its mere presence will cause
+ the compiler to reject the program. With a preprocessing
+ conditional, the offending code can be effectively excised from
+ the program when it is not valid.
+
+ * You may want to be able to compile the same source file into two
+ different programs. One version might make frequent time-consuming
+ consistency checks on its intermediate data, or print the values of
+ those data for debugging, and the other not.
+
+ * A conditional whose condition is always false is one way to
+ exclude code from the program but keep it as a sort of comment for
+ future reference.
+
+ Simple programs that do not need system-specific logic or complex
+debugging hooks generally will not need to use preprocessing
+conditionals.
+
+
+File: cpp.info, Node: Conditional Syntax, Next: Deleted Code, Prev: Conditional Uses, Up: Conditionals
+
+4.2 Conditional Syntax
+======================
+
+A conditional in the C preprocessor begins with a "conditional
+directive": `#if', `#ifdef' or `#ifndef'.
+
+* Menu:
+
+* Ifdef::
+* If::
+* Defined::
+* Else::
+* Elif::
+
+
+File: cpp.info, Node: Ifdef, Next: If, Up: Conditional Syntax
+
+4.2.1 Ifdef
+-----------
+
+The simplest sort of conditional is
+
+ #ifdef MACRO
+
+ CONTROLLED TEXT
+
+ #endif /* MACRO */
+
+ This block is called a "conditional group". CONTROLLED TEXT will be
+included in the output of the preprocessor if and only if MACRO is
+defined. We say that the conditional "succeeds" if MACRO is defined,
+"fails" if it is not.
+
+ The CONTROLLED TEXT inside of a conditional can include
+preprocessing directives. They are executed only if the conditional
+succeeds. You can nest conditional groups inside other conditional
+groups, but they must be completely nested. In other words, `#endif'
+always matches the nearest `#ifdef' (or `#ifndef', or `#if'). Also,
+you cannot start a conditional group in one file and end it in another.
+
+ Even if a conditional fails, the CONTROLLED TEXT inside it is still
+run through initial transformations and tokenization. Therefore, it
+must all be lexically valid C. Normally the only way this matters is
+that all comments and string literals inside a failing conditional group
+must still be properly ended.
+
+ The comment following the `#endif' is not required, but it is a good
+practice if there is a lot of CONTROLLED TEXT, because it helps people
+match the `#endif' to the corresponding `#ifdef'. Older programs
+sometimes put MACRO directly after the `#endif' without enclosing it in
+a comment. This is invalid code according to the C standard. CPP
+accepts it with a warning. It never affects which `#ifndef' the
+`#endif' matches.
+
+ Sometimes you wish to use some code if a macro is _not_ defined.
+You can do this by writing `#ifndef' instead of `#ifdef'. One common
+use of `#ifndef' is to include code only the first time a header file
+is included. *Note Once-Only Headers::.
+
+ Macro definitions can vary between compilations for several reasons.
+Here are some samples.
+
+ * Some macros are predefined on each kind of machine (*note
+ System-specific Predefined Macros::). This allows you to provide
+ code specially tuned for a particular machine.
+
+ * System header files define more macros, associated with the
+ features they implement. You can test these macros with
+ conditionals to avoid using a system feature on a machine where it
+ is not implemented.
+
+ * Macros can be defined or undefined with the `-D' and `-U' command
+ line options when you compile the program. You can arrange to
+ compile the same source file into two different programs by
+ choosing a macro name to specify which program you want, writing
+ conditionals to test whether or how this macro is defined, and
+ then controlling the state of the macro with command line options,
+ perhaps set in the Makefile. *Note Invocation::.
+
+ * Your program might have a special header file (often called
+ `config.h') that is adjusted when the program is compiled. It can
+ define or not define macros depending on the features of the
+ system and the desired capabilities of the program. The
+ adjustment can be automated by a tool such as `autoconf', or done
+ by hand.
+
+
+File: cpp.info, Node: If, Next: Defined, Prev: Ifdef, Up: Conditional Syntax
+
+4.2.2 If
+--------
+
+The `#if' directive allows you to test the value of an arithmetic
+expression, rather than the mere existence of one macro. Its syntax is
+
+ #if EXPRESSION
+
+ CONTROLLED TEXT
+
+ #endif /* EXPRESSION */
+
+ EXPRESSION is a C expression of integer type, subject to stringent
+restrictions. It may contain
+
+ * Integer constants.
+
+ * Character constants, which are interpreted as they would be in
+ normal code.
+
+ * Arithmetic operators for addition, subtraction, multiplication,
+ division, bitwise operations, shifts, comparisons, and logical
+ operations (`&&' and `||'). The latter two obey the usual
+ short-circuiting rules of standard C.
+
+ * Macros. All macros in the expression are expanded before actual
+ computation of the expression's value begins.
+
+ * Uses of the `defined' operator, which lets you check whether macros
+ are defined in the middle of an `#if'.
+
+ * Identifiers that are not macros, which are all considered to be the
+ number zero. This allows you to write `#if MACRO' instead of
+ `#ifdef MACRO', if you know that MACRO, when defined, will always
+ have a nonzero value. Function-like macros used without their
+ function call parentheses are also treated as zero.
+
+ In some contexts this shortcut is undesirable. The `-Wundef'
+ option causes GCC to warn whenever it encounters an identifier
+ which is not a macro in an `#if'.
+
+ The preprocessor does not know anything about types in the language.
+Therefore, `sizeof' operators are not recognized in `#if', and neither
+are `enum' constants. They will be taken as identifiers which are not
+macros, and replaced by zero. In the case of `sizeof', this is likely
+to cause the expression to be invalid.
+
+ The preprocessor calculates the value of EXPRESSION. It carries out
+all calculations in the widest integer type known to the compiler; on
+most machines supported by GCC this is 64 bits. This is not the same
+rule as the compiler uses to calculate the value of a constant
+expression, and may give different results in some cases. If the value
+comes out to be nonzero, the `#if' succeeds and the CONTROLLED TEXT is
+included; otherwise it is skipped.
+
+
+File: cpp.info, Node: Defined, Next: Else, Prev: If, Up: Conditional Syntax
+
+4.2.3 Defined
+-------------
+
+The special operator `defined' is used in `#if' and `#elif' expressions
+to test whether a certain name is defined as a macro. `defined NAME'
+and `defined (NAME)' are both expressions whose value is 1 if NAME is
+defined as a macro at the current point in the program, and 0
+otherwise. Thus, `#if defined MACRO' is precisely equivalent to
+`#ifdef MACRO'.
+
+ `defined' is useful when you wish to test more than one macro for
+existence at once. For example,
+
+ #if defined (__vax__) || defined (__ns16000__)
+
+would succeed if either of the names `__vax__' or `__ns16000__' is
+defined as a macro.
+
+ Conditionals written like this:
+
+ #if defined BUFSIZE && BUFSIZE >= 1024
+
+can generally be simplified to just `#if BUFSIZE >= 1024', since if
+`BUFSIZE' is not defined, it will be interpreted as having the value
+zero.
+
+ If the `defined' operator appears as a result of a macro expansion,
+the C standard says the behavior is undefined. GNU cpp treats it as a
+genuine `defined' operator and evaluates it normally. It will warn
+wherever your code uses this feature if you use the command-line option
+`-pedantic', since other compilers may handle it differently.
+
+
+File: cpp.info, Node: Else, Next: Elif, Prev: Defined, Up: Conditional Syntax
+
+4.2.4 Else
+----------
+
+The `#else' directive can be added to a conditional to provide
+alternative text to be used if the condition fails. This is what it
+looks like:
+
+ #if EXPRESSION
+ TEXT-IF-TRUE
+ #else /* Not EXPRESSION */
+ TEXT-IF-FALSE
+ #endif /* Not EXPRESSION */
+
+If EXPRESSION is nonzero, the TEXT-IF-TRUE is included and the
+TEXT-IF-FALSE is skipped. If EXPRESSION is zero, the opposite happens.
+
+ You can use `#else' with `#ifdef' and `#ifndef', too.
+
+
+File: cpp.info, Node: Elif, Prev: Else, Up: Conditional Syntax
+
+4.2.5 Elif
+----------
+
+One common case of nested conditionals is used to check for more than
+two possible alternatives. For example, you might have
+
+ #if X == 1
+ ...
+ #else /* X != 1 */
+ #if X == 2
+ ...
+ #else /* X != 2 */
+ ...
+ #endif /* X != 2 */
+ #endif /* X != 1 */
+
+ Another conditional directive, `#elif', allows this to be
+abbreviated as follows:
+
+ #if X == 1
+ ...
+ #elif X == 2
+ ...
+ #else /* X != 2 and X != 1*/
+ ...
+ #endif /* X != 2 and X != 1*/
+
+ `#elif' stands for "else if". Like `#else', it goes in the middle
+of a conditional group and subdivides it; it does not require a
+matching `#endif' of its own. Like `#if', the `#elif' directive
+includes an expression to be tested. The text following the `#elif' is
+processed only if the original `#if'-condition failed and the `#elif'
+condition succeeds.
+
+ More than one `#elif' can go in the same conditional group. Then
+the text after each `#elif' is processed only if the `#elif' condition
+succeeds after the original `#if' and all previous `#elif' directives
+within it have failed.
+
+ `#else' is allowed after any number of `#elif' directives, but
+`#elif' may not follow `#else'.
+
+
+File: cpp.info, Node: Deleted Code, Prev: Conditional Syntax, Up: Conditionals
+
+4.3 Deleted Code
+================
+
+If you replace or delete a part of the program but want to keep the old
+code around for future reference, you often cannot simply comment it
+out. Block comments do not nest, so the first comment inside the old
+code will end the commenting-out. The probable result is a flood of
+syntax errors.
+
+ One way to avoid this problem is to use an always-false conditional
+instead. For instance, put `#if 0' before the deleted code and
+`#endif' after it. This works even if the code being turned off
+contains conditionals, but they must be entire conditionals (balanced
+`#if' and `#endif').
+
+ Some people use `#ifdef notdef' instead. This is risky, because
+`notdef' might be accidentally defined as a macro, and then the
+conditional would succeed. `#if 0' can be counted on to fail.
+
+ Do not use `#if 0' for comments which are not C code. Use a real
+comment, instead. The interior of `#if 0' must consist of complete
+tokens; in particular, single-quote characters must balance. Comments
+often contain unbalanced single-quote characters (known in English as
+apostrophes). These confuse `#if 0'. They don't confuse `/*'.
+
+
+File: cpp.info, Node: Diagnostics, Next: Line Control, Prev: Conditionals, Up: Top
+
+5 Diagnostics
+*************
+
+The directive `#error' causes the preprocessor to report a fatal error.
+The tokens forming the rest of the line following `#error' are used as
+the error message.
+
+ You would use `#error' inside of a conditional that detects a
+combination of parameters which you know the program does not properly
+support. For example, if you know that the program will not run
+properly on a VAX, you might write
+
+ #ifdef __vax__
+ #error "Won't work on VAXen. See comments at get_last_object."
+ #endif
+
+ If you have several configuration parameters that must be set up by
+the installation in a consistent way, you can use conditionals to detect
+an inconsistency and report it with `#error'. For example,
+
+ #if !defined(UNALIGNED_INT_ASM_OP) && defined(DWARF2_DEBUGGING_INFO)
+ #error "DWARF2_DEBUGGING_INFO requires UNALIGNED_INT_ASM_OP."
+ #endif
+
+ The directive `#warning' is like `#error', but causes the
+preprocessor to issue a warning and continue preprocessing. The tokens
+following `#warning' are used as the warning message.
+
+ You might use `#warning' in obsolete header files, with a message
+directing the user to the header file which should be used instead.
+
+ Neither `#error' nor `#warning' macro-expands its argument.
+Internal whitespace sequences are each replaced with a single space.
+The line must consist of complete tokens. It is wisest to make the
+argument of these directives be a single string constant; this avoids
+problems with apostrophes and the like.
+
+
+File: cpp.info, Node: Line Control, Next: Pragmas, Prev: Diagnostics, Up: Top
+
+6 Line Control
+**************
+
+The C preprocessor informs the C compiler of the location in your source
+code where each token came from. Presently, this is just the file name
+and line number. All the tokens resulting from macro expansion are
+reported as having appeared on the line of the source file where the
+outermost macro was used. We intend to be more accurate in the future.
+
+ If you write a program which generates source code, such as the
+`bison' parser generator, you may want to adjust the preprocessor's
+notion of the current file name and line number by hand. Parts of the
+output from `bison' are generated from scratch, other parts come from a
+standard parser file. The rest are copied verbatim from `bison''s
+input. You would like compiler error messages and symbolic debuggers
+to be able to refer to `bison''s input file.
+
+ `bison' or any such program can arrange this by writing `#line'
+directives into the output file. `#line' is a directive that specifies
+the original line number and source file name for subsequent input in
+the current preprocessor input file. `#line' has three variants:
+
+`#line LINENUM'
+ LINENUM is a non-negative decimal integer constant. It specifies
+ the line number which should be reported for the following line of
+ input. Subsequent lines are counted from LINENUM.
+
+`#line LINENUM FILENAME'
+ LINENUM is the same as for the first form, and has the same
+ effect. In addition, FILENAME is a string constant. The
+ following line and all subsequent lines are reported to come from
+ the file it specifies, until something else happens to change that.
+ FILENAME is interpreted according to the normal rules for a string
+ constant: backslash escapes are interpreted. This is different
+ from `#include'.
+
+ Previous versions of CPP did not interpret escapes in `#line'; we
+ have changed it because the standard requires they be interpreted,
+ and most other compilers do.
+
+`#line ANYTHING ELSE'
+ ANYTHING ELSE is checked for macro calls, which are expanded. The
+ result should match one of the above two forms.
+
+ `#line' directives alter the results of the `__FILE__' and
+`__LINE__' predefined macros from that point on. *Note Standard
+Predefined Macros::. They do not have any effect on `#include''s idea
+of the directory containing the current file. This is a change from
+GCC 2.95. Previously, a file reading
+
+ #line 1 "../src/gram.y"
+ #include "gram.h"
+
+ would search for `gram.h' in `../src', then the `-I' chain; the
+directory containing the physical source file would not be searched.
+In GCC 3.0 and later, the `#include' is not affected by the presence of
+a `#line' referring to a different directory.
+
+ We made this change because the old behavior caused problems when
+generated source files were transported between machines. For instance,
+it is common practice to ship generated parsers with a source release,
+so that people building the distribution do not need to have yacc or
+Bison installed. These files frequently have `#line' directives
+referring to the directory tree of the system where the distribution was
+created. If GCC tries to search for headers in those directories, the
+build is likely to fail.
+
+ The new behavior can cause failures too, if the generated file is not
+in the same directory as its source and it attempts to include a header
+which would be visible searching from the directory containing the
+source file. However, this problem is easily solved with an additional
+`-I' switch on the command line. The failures caused by the old
+semantics could sometimes be corrected only by editing the generated
+files, which is difficult and error-prone.
+
+
+File: cpp.info, Node: Pragmas, Next: Other Directives, Prev: Line Control, Up: Top
+
+7 Pragmas
+*********
+
+The `#pragma' directive is the method specified by the C standard for
+providing additional information to the compiler, beyond what is
+conveyed in the language itself. Three forms of this directive
+(commonly known as "pragmas") are specified by the 1999 C standard. A
+C compiler is free to attach any meaning it likes to other pragmas.
+
+ GCC has historically preferred to use extensions to the syntax of the
+language, such as `__attribute__', for this purpose. However, GCC does
+define a few pragmas of its own. These mostly have effects on the
+entire translation unit or source file.
+
+ In GCC version 3, all GNU-defined, supported pragmas have been given
+a `GCC' prefix. This is in line with the `STDC' prefix on all pragmas
+defined by C99. For backward compatibility, pragmas which were
+recognized by previous versions are still recognized without the `GCC'
+prefix, but that usage is deprecated. Some older pragmas are
+deprecated in their entirety. They are not recognized with the `GCC'
+prefix. *Note Obsolete Features::.
+
+ C99 introduces the `_Pragma' operator. This feature addresses a
+major problem with `#pragma': being a directive, it cannot be produced
+as the result of macro expansion. `_Pragma' is an operator, much like
+`sizeof' or `defined', and can be embedded in a macro.
+
+ Its syntax is `_Pragma (STRING-LITERAL)', where STRING-LITERAL can
+be either a normal or wide-character string literal. It is
+destringized, by replacing all `\\' with a single `\' and all `\"' with
+a `"'. The result is then processed as if it had appeared as the right
+hand side of a `#pragma' directive. For example,
+
+ _Pragma ("GCC dependency \"parse.y\"")
+
+has the same effect as `#pragma GCC dependency "parse.y"'. The same
+effect could be achieved using macros, for example
+
+ #define DO_PRAGMA(x) _Pragma (#x)
+ DO_PRAGMA (GCC dependency "parse.y")
+
+ The standard is unclear on where a `_Pragma' operator can appear.
+The preprocessor does not accept it within a preprocessing conditional
+directive like `#if'. To be safe, you are probably best keeping it out
+of directives other than `#define', and putting it on a line of its own.
+
+ This manual documents the pragmas which are meaningful to the
+preprocessor itself. Other pragmas are meaningful to the C or C++
+compilers. They are documented in the GCC manual.
+
+`#pragma GCC dependency'
+ `#pragma GCC dependency' allows you to check the relative dates of
+ the current file and another file. If the other file is more
+ recent than the current file, a warning is issued. This is useful
+ if the current file is derived from the other file, and should be
+ regenerated. The other file is searched for using the normal
+ include search path. Optional trailing text can be used to give
+ more information in the warning message.
+
+ #pragma GCC dependency "parse.y"
+ #pragma GCC dependency "/usr/include/time.h" rerun fixincludes
+
+`#pragma GCC poison'
+ Sometimes, there is an identifier that you want to remove
+ completely from your program, and make sure that it never creeps
+ back in. To enforce this, you can "poison" the identifier with
+ this pragma. `#pragma GCC poison' is followed by a list of
+ identifiers to poison. If any of those identifiers appears
+ anywhere in the source after the directive, it is a hard error.
+ For example,
+
+ #pragma GCC poison printf sprintf fprintf
+ sprintf(some_string, "hello");
+
+ will produce an error.
+
+ If a poisoned identifier appears as part of the expansion of a
+ macro which was defined before the identifier was poisoned, it
+ will _not_ cause an error. This lets you poison an identifier
+ without worrying about system headers defining macros that use it.
+
+ For example,
+
+ #define strrchr rindex
+ #pragma GCC poison rindex
+ strrchr(some_string, 'h');
+
+ will not produce an error.
+
+`#pragma GCC system_header'
+ This pragma takes no arguments. It causes the rest of the code in
+ the current file to be treated as if it came from a system header.
+ *Note System Headers::.
+
+
+
+File: cpp.info, Node: Other Directives, Next: Preprocessor Output, Prev: Pragmas, Up: Top
+
+8 Other Directives
+******************
+
+The `#ident' directive takes one argument, a string constant. On some
+systems, that string constant is copied into a special segment of the
+object file. On other systems, the directive is ignored. The `#sccs'
+directive is a synonym for `#ident'.
+
+ These directives are not part of the C standard, but they are not
+official GNU extensions either. What historical information we have
+been able to find, suggests they originated with System V.
+
+ Both `#ident' and `#sccs' are deprecated extensions.
+
+ The "null directive" consists of a `#' followed by a newline, with
+only whitespace (including comments) in between. A null directive is
+understood as a preprocessing directive but has no effect on the
+preprocessor output. The primary significance of the existence of the
+null directive is that an input line consisting of just a `#' will
+produce no output, rather than a line of output containing just a `#'.
+Supposedly some old C programs contain such lines.
+
+
+File: cpp.info, Node: Preprocessor Output, Next: Traditional Mode, Prev: Other Directives, Up: Top
+
+9 Preprocessor Output
+*********************
+
+When the C preprocessor is used with the C, C++, or Objective-C
+compilers, it is integrated into the compiler and communicates a stream
+of binary tokens directly to the compiler's parser. However, it can
+also be used in the more conventional standalone mode, where it produces
+textual output.
+
+ The output from the C preprocessor looks much like the input, except
+that all preprocessing directive lines have been replaced with blank
+lines and all comments with spaces. Long runs of blank lines are
+discarded.
+
+ The ISO standard specifies that it is implementation defined whether
+a preprocessor preserves whitespace between tokens, or replaces it with
+e.g. a single space. In GNU CPP, whitespace between tokens is collapsed
+to become a single space, with the exception that the first token on a
+non-directive line is preceded with sufficient spaces that it appears in
+the same column in the preprocessed output that it appeared in the
+original source file. This is so the output is easy to read. *Note
+Differences from previous versions::. CPP does not insert any
+whitespace where there was none in the original source, except where
+necessary to prevent an accidental token paste.
+
+ Source file name and line number information is conveyed by lines of
+the form
+
+ # LINENUM FILENAME FLAGS
+
+These are called "linemarkers". They are inserted as needed into the
+output (but never within a string or character constant). They mean
+that the following line originated in file FILENAME at line LINENUM.
+FILENAME will never contain any non-printing characters; they are
+replaced with octal escape sequences.
+
+ After the file name comes zero or more flags, which are `1', `2',
+`3', or `4'. If there are multiple flags, spaces separate them. Here
+is what the flags mean:
+
+`1'
+ This indicates the start of a new file.
+
+`2'
+ This indicates returning to a file (after having included another
+ file).
+
+`3'
+ This indicates that the following text comes from a system header
+ file, so certain warnings should be suppressed.
+
+`4'
+ This indicates that the following text should be treated as being
+ wrapped in an implicit `extern "C"' block.
+
+ As an extension, the preprocessor accepts linemarkers in
+non-assembler input files. They are treated like the corresponding
+`#line' directive, (*note Line Control::), except that trailing flags
+are permitted, and are interpreted with the meanings described above.
+If multiple flags are given, they must be in ascending order.
+
+ Some directives may be duplicated in the output of the preprocessor.
+These are `#ident' (always), `#pragma' (only if the preprocessor does
+not handle the pragma itself), and `#define' and `#undef' (with certain
+debugging options). If this happens, the `#' of the directive will
+always be in the first column, and there will be no space between the
+`#' and the directive name. If macro expansion happens to generate
+tokens which might be mistaken for a duplicated directive, a space will
+be inserted between the `#' and the directive name.
+
+
+File: cpp.info, Node: Traditional Mode, Next: Implementation Details, Prev: Preprocessor Output, Up: Top
+
+10 Traditional Mode
+*******************
+
+Traditional (pre-standard) C preprocessing is rather different from the
+preprocessing specified by the standard. When GCC is given the
+`-traditional-cpp' option, it attempts to emulate a traditional
+preprocessor.
+
+ GCC versions 3.2 and later only support traditional mode semantics in
+the preprocessor, and not in the compiler front ends. This chapter
+outlines the traditional preprocessor semantics we implemented.
+
+ The implementation does not correspond precisely to the behavior of
+earlier versions of GCC, nor to any true traditional preprocessor.
+After all, inconsistencies among traditional implementations were a
+major motivation for C standardization. However, we intend that it
+should be compatible with true traditional preprocessors in all ways
+that actually matter.
+
+* Menu:
+
+* Traditional lexical analysis::
+* Traditional macros::
+* Traditional miscellany::
+* Traditional warnings::
+
+
+File: cpp.info, Node: Traditional lexical analysis, Next: Traditional macros, Up: Traditional Mode
+
+10.1 Traditional lexical analysis
+=================================
+
+The traditional preprocessor does not decompose its input into tokens
+the same way a standards-conforming preprocessor does. The input is
+simply treated as a stream of text with minimal internal form.
+
+ This implementation does not treat trigraphs (*note trigraphs::)
+specially since they were an invention of the standards committee. It
+handles arbitrarily-positioned escaped newlines properly and splices
+the lines as you would expect; many traditional preprocessors did not
+do this.
+
+ The form of horizontal whitespace in the input file is preserved in
+the output. In particular, hard tabs remain hard tabs. This can be
+useful if, for example, you are preprocessing a Makefile.
+
+ Traditional CPP only recognizes C-style block comments, and treats
+the `/*' sequence as introducing a comment only if it lies outside
+quoted text. Quoted text is introduced by the usual single and double
+quotes, and also by an initial `<' in a `#include' directive.
+
+ Traditionally, comments are completely removed and are not replaced
+with a space. Since a traditional compiler does its own tokenization
+of the output of the preprocessor, this means that comments can
+effectively be used as token paste operators. However, comments behave
+like separators for text handled by the preprocessor itself, since it
+doesn't re-lex its input. For example, in
+
+ #if foo/**/bar
+
+`foo' and `bar' are distinct identifiers and expanded separately if
+they happen to be macros. In other words, this directive is equivalent
+to
+
+ #if foo bar
+
+rather than
+
+ #if foobar
+
+ Generally speaking, in traditional mode an opening quote need not
+have a matching closing quote. In particular, a macro may be defined
+with replacement text that contains an unmatched quote. Of course, if
+you attempt to compile preprocessed output containing an unmatched quote
+you will get a syntax error.
+
+ However, all preprocessing directives other than `#define' require
+matching quotes. For example:
+
+ #define m This macro's fine and has an unmatched quote
+ "/* This is not a comment. */
+ /* This is a comment. The following #include directive
+ is ill-formed. */
+ #include <stdio.h
+
+ Just as for the ISO preprocessor, what would be a closing quote can
+be escaped with a backslash to prevent the quoted text from closing.
+
+
+File: cpp.info, Node: Traditional macros, Next: Traditional miscellany, Prev: Traditional lexical analysis, Up: Traditional Mode
+
+10.2 Traditional macros
+=======================
+
+The major difference between traditional and ISO macros is that the
+former expand to text rather than to a token sequence. CPP removes all
+leading and trailing horizontal whitespace from a macro's replacement
+text before storing it, but preserves the form of internal whitespace.
+
+ One consequence is that it is legitimate for the replacement text to
+contain an unmatched quote (*note Traditional lexical analysis::). An
+unclosed string or character constant continues into the text following
+the macro call. Similarly, the text at the end of a macro's expansion
+can run together with the text after the macro invocation to produce a
+single token.
+
+ Normally comments are removed from the replacement text after the
+macro is expanded, but if the `-CC' option is passed on the command
+line comments are preserved. (In fact, the current implementation
+removes comments even before saving the macro replacement text, but it
+careful to do it in such a way that the observed effect is identical
+even in the function-like macro case.)
+
+ The ISO stringification operator `#' and token paste operator `##'
+have no special meaning. As explained later, an effect similar to
+these operators can be obtained in a different way. Macro names that
+are embedded in quotes, either from the main file or after macro
+replacement, do not expand.
+
+ CPP replaces an unquoted object-like macro name with its replacement
+text, and then rescans it for further macros to replace. Unlike
+standard macro expansion, traditional macro expansion has no provision
+to prevent recursion. If an object-like macro appears unquoted in its
+replacement text, it will be replaced again during the rescan pass, and
+so on _ad infinitum_. GCC detects when it is expanding recursive
+macros, emits an error message, and continues after the offending macro
+invocation.
+
+ #define PLUS +
+ #define INC(x) PLUS+x
+ INC(foo);
+ ==> ++foo;
+
+ Function-like macros are similar in form but quite different in
+behavior to their ISO counterparts. Their arguments are contained
+within parentheses, are comma-separated, and can cross physical lines.
+Commas within nested parentheses are not treated as argument
+separators. Similarly, a quote in an argument cannot be left unclosed;
+a following comma or parenthesis that comes before the closing quote is
+treated like any other character. There is no facility for handling
+variadic macros.
+
+ This implementation removes all comments from macro arguments, unless
+the `-C' option is given. The form of all other horizontal whitespace
+in arguments is preserved, including leading and trailing whitespace.
+In particular
+
+ f( )
+
+is treated as an invocation of the macro `f' with a single argument
+consisting of a single space. If you want to invoke a function-like
+macro that takes no arguments, you must not leave any whitespace
+between the parentheses.
+
+ If a macro argument crosses a new line, the new line is replaced with
+a space when forming the argument. If the previous line contained an
+unterminated quote, the following line inherits the quoted state.
+
+ Traditional preprocessors replace parameters in the replacement text
+with their arguments regardless of whether the parameters are within
+quotes or not. This provides a way to stringize arguments. For example
+
+ #define str(x) "x"
+ str(/* A comment */some text )
+ ==> "some text "
+
+Note that the comment is removed, but that the trailing space is
+preserved. Here is an example of using a comment to effect token
+pasting.
+
+ #define suffix(x) foo_/**/x
+ suffix(bar)
+ ==> foo_bar
+
+
+File: cpp.info, Node: Traditional miscellany, Next: Traditional warnings, Prev: Traditional macros, Up: Traditional Mode
+
+10.3 Traditional miscellany
+===========================
+
+Here are some things to be aware of when using the traditional
+preprocessor.
+
+ * Preprocessing directives are recognized only when their leading
+ `#' appears in the first column. There can be no whitespace
+ between the beginning of the line and the `#', but whitespace can
+ follow the `#'.
+
+ * A true traditional C preprocessor does not recognize `#error' or
+ `#pragma', and may not recognize `#elif'. CPP supports all the
+ directives in traditional mode that it supports in ISO mode,
+ including extensions, with the exception that the effects of
+ `#pragma GCC poison' are undefined.
+
+ * __STDC__ is not defined.
+
+ * If you use digraphs the behavior is undefined.
+
+ * If a line that looks like a directive appears within macro
+ arguments, the behavior is undefined.
+
+
+
+File: cpp.info, Node: Traditional warnings, Prev: Traditional miscellany, Up: Traditional Mode
+
+10.4 Traditional warnings
+=========================
+
+You can request warnings about features that did not exist, or worked
+differently, in traditional C with the `-Wtraditional' option. GCC
+does not warn about features of ISO C which you must use when you are
+using a conforming compiler, such as the `#' and `##' operators.
+
+ Presently `-Wtraditional' warns about:
+
+ * Macro parameters that appear within string literals in the macro
+ body. In traditional C macro replacement takes place within
+ string literals, but does not in ISO C.
+
+ * In traditional C, some preprocessor directives did not exist.
+ Traditional preprocessors would only consider a line to be a
+ directive if the `#' appeared in column 1 on the line. Therefore
+ `-Wtraditional' warns about directives that traditional C
+ understands but would ignore because the `#' does not appear as the
+ first character on the line. It also suggests you hide directives
+ like `#pragma' not understood by traditional C by indenting them.
+ Some traditional implementations would not recognize `#elif', so it
+ suggests avoiding it altogether.
+
+ * A function-like macro that appears without an argument list. In
+ some traditional preprocessors this was an error. In ISO C it
+ merely means that the macro is not expanded.
+
+ * The unary plus operator. This did not exist in traditional C.
+
+ * The `U' and `LL' integer constant suffixes, which were not
+ available in traditional C. (Traditional C does support the `L'
+ suffix for simple long integer constants.) You are not warned
+ about uses of these suffixes in macros defined in system headers.
+ For instance, `UINT_MAX' may well be defined as `4294967295U', but
+ you will not be warned if you use `UINT_MAX'.
+
+ You can usually avoid the warning, and the related warning about
+ constants which are so large that they are unsigned, by writing the
+ integer constant in question in hexadecimal, with no U suffix.
+ Take care, though, because this gives the wrong result in exotic
+ cases.
+
+
+File: cpp.info, Node: Implementation Details, Next: Invocation, Prev: Traditional Mode, Up: Top
+
+11 Implementation Details
+*************************
+
+Here we document details of how the preprocessor's implementation
+affects its user-visible behavior. You should try to avoid undue
+reliance on behavior described here, as it is possible that it will
+change subtly in future implementations.
+
+ Also documented here are obsolete features and changes from previous
+versions of CPP.
+
+* Menu:
+
+* Implementation-defined behavior::
+* Implementation limits::
+* Obsolete Features::
+* Differences from previous versions::
+
+
+File: cpp.info, Node: Implementation-defined behavior, Next: Implementation limits, Up: Implementation Details
+
+11.1 Implementation-defined behavior
+====================================
+
+This is how CPP behaves in all the cases which the C standard describes
+as "implementation-defined". This term means that the implementation
+is free to do what it likes, but must document its choice and stick to
+it.
+
+ * The mapping of physical source file multi-byte characters to the
+ execution character set.
+
+ The input character set can be specified using the
+ `-finput-charset' option, while the execution character set may be
+ controlled using the `-fexec-charset' and `-fwide-exec-charset'
+ options.
+
+ * Identifier characters.
+
+ The C and C++ standards allow identifiers to be composed of `_'
+ and the alphanumeric characters. C++ and C99 also allow universal
+ character names, and C99 further permits implementation-defined
+ characters. GCC currently only permits universal character names
+ if `-fextended-identifiers' is used, because the implementation of
+ universal character names in identifiers is experimental.
+
+ GCC allows the `$' character in identifiers as an extension for
+ most targets. This is true regardless of the `std=' switch, since
+ this extension cannot conflict with standards-conforming programs.
+ When preprocessing assembler, however, dollars are not identifier
+ characters by default.
+
+ Currently the targets that by default do not permit `$' are AVR,
+ IP2K, MMIX, MIPS Irix 3, ARM aout, and PowerPC targets for the AIX
+ operating system.
+
+ You can override the default with `-fdollars-in-identifiers' or
+ `fno-dollars-in-identifiers'. *Note fdollars-in-identifiers::.
+
+ * Non-empty sequences of whitespace characters.
+
+ In textual output, each whitespace sequence is collapsed to a
+ single space. For aesthetic reasons, the first token on each
+ non-directive line of output is preceded with sufficient spaces
+ that it appears in the same column as it did in the original
+ source file.
+
+ * The numeric value of character constants in preprocessor
+ expressions.
+
+ The preprocessor and compiler interpret character constants in the
+ same way; i.e. escape sequences such as `\a' are given the values
+ they would have on the target machine.
+
+ The compiler values a multi-character character constant a
+ character at a time, shifting the previous value left by the
+ number of bits per target character, and then or-ing in the
+ bit-pattern of the new character truncated to the width of a
+ target character. The final bit-pattern is given type `int', and
+ is therefore signed, regardless of whether single characters are
+ signed or not (a slight change from versions 3.1 and earlier of
+ GCC). If there are more characters in the constant than would fit
+ in the target `int' the compiler issues a warning, and the excess
+ leading characters are ignored.
+
+ For example, `'ab'' for a target with an 8-bit `char' would be
+ interpreted as
+ `(int) ((unsigned char) 'a' * 256 + (unsigned char) 'b')', and
+ `'\234a'' as
+ `(int) ((unsigned char) '\234' * 256 + (unsigned char) 'a')'.
+
+ * Source file inclusion.
+
+ For a discussion on how the preprocessor locates header files,
+ *Note Include Operation::.
+
+ * Interpretation of the filename resulting from a macro-expanded
+ `#include' directive.
+
+ *Note Computed Includes::.
+
+ * Treatment of a `#pragma' directive that after macro-expansion
+ results in a standard pragma.
+
+ No macro expansion occurs on any `#pragma' directive line, so the
+ question does not arise.
+
+ Note that GCC does not yet implement any of the standard pragmas.
+
+
+
+File: cpp.info, Node: Implementation limits, Next: Obsolete Features, Prev: Implementation-defined behavior, Up: Implementation Details
+
+11.2 Implementation limits
+==========================
+
+CPP has a small number of internal limits. This section lists the
+limits which the C standard requires to be no lower than some minimum,
+and all the others known. It is intended that there should be as few
+limits as possible. If you encounter an undocumented or inconvenient
+limit, please report that as a bug. *Note Reporting Bugs: (gcc)Bugs.
+
+ Where we say something is limited "only by available memory", that
+means that internal data structures impose no intrinsic limit, and space
+is allocated with `malloc' or equivalent. The actual limit will
+therefore depend on many things, such as the size of other things
+allocated by the compiler at the same time, the amount of memory
+consumed by other processes on the same computer, etc.
+
+ * Nesting levels of `#include' files.
+
+ We impose an arbitrary limit of 200 levels, to avoid runaway
+ recursion. The standard requires at least 15 levels.
+
+ * Nesting levels of conditional inclusion.
+
+ The C standard mandates this be at least 63. CPP is limited only
+ by available memory.
+
+ * Levels of parenthesized expressions within a full expression.
+
+ The C standard requires this to be at least 63. In preprocessor
+ conditional expressions, it is limited only by available memory.
+
+ * Significant initial characters in an identifier or macro name.
+
+ The preprocessor treats all characters as significant. The C
+ standard requires only that the first 63 be significant.
+
+ * Number of macros simultaneously defined in a single translation
+ unit.
+
+ The standard requires at least 4095 be possible. CPP is limited
+ only by available memory.
+
+ * Number of parameters in a macro definition and arguments in a
+ macro call.
+
+ We allow `USHRT_MAX', which is no smaller than 65,535. The minimum
+ required by the standard is 127.
+
+ * Number of characters on a logical source line.
+
+ The C standard requires a minimum of 4096 be permitted. CPP places
+ no limits on this, but you may get incorrect column numbers
+ reported in diagnostics for lines longer than 65,535 characters.
+
+ * Maximum size of a source file.
+
+ The standard does not specify any lower limit on the maximum size
+ of a source file. GNU cpp maps files into memory, so it is
+ limited by the available address space. This is generally at
+ least two gigabytes. Depending on the operating system, the size
+ of physical memory may or may not be a limitation.
+
+
+
+File: cpp.info, Node: Obsolete Features, Next: Differences from previous versions, Prev: Implementation limits, Up: Implementation Details
+
+11.3 Obsolete Features
+======================
+
+CPP has some features which are present mainly for compatibility with
+older programs. We discourage their use in new code. In some cases,
+we plan to remove the feature in a future version of GCC.
+
+11.3.1 Assertions
+-----------------
+
+"Assertions" are a deprecated alternative to macros in writing
+conditionals to test what sort of computer or system the compiled
+program will run on. Assertions are usually predefined, but you can
+define them with preprocessing directives or command-line options.
+
+ Assertions were intended to provide a more systematic way to describe
+the compiler's target system. However, in practice they are just as
+unpredictable as the system-specific predefined macros. In addition,
+they are not part of any standard, and only a few compilers support
+them. Therefore, the use of assertions is *less* portable than the use
+of system-specific predefined macros. We recommend you do not use them
+at all.
+
+ An assertion looks like this:
+
+ #PREDICATE (ANSWER)
+
+PREDICATE must be a single identifier. ANSWER can be any sequence of
+tokens; all characters are significant except for leading and trailing
+whitespace, and differences in internal whitespace sequences are
+ignored. (This is similar to the rules governing macro redefinition.)
+Thus, `(x + y)' is different from `(x+y)' but equivalent to
+`( x + y )'. Parentheses do not nest inside an answer.
+
+ To test an assertion, you write it in an `#if'. For example, this
+conditional succeeds if either `vax' or `ns16000' has been asserted as
+an answer for `machine'.
+
+ #if #machine (vax) || #machine (ns16000)
+
+You can test whether _any_ answer is asserted for a predicate by
+omitting the answer in the conditional:
+
+ #if #machine
+
+ Assertions are made with the `#assert' directive. Its sole argument
+is the assertion to make, without the leading `#' that identifies
+assertions in conditionals.
+
+ #assert PREDICATE (ANSWER)
+
+You may make several assertions with the same predicate and different
+answers. Subsequent assertions do not override previous ones for the
+same predicate. All the answers for any given predicate are
+simultaneously true.
+
+ Assertions can be canceled with the `#unassert' directive. It has
+the same syntax as `#assert'. In that form it cancels only the answer
+which was specified on the `#unassert' line; other answers for that
+predicate remain true. You can cancel an entire predicate by leaving
+out the answer:
+
+ #unassert PREDICATE
+
+In either form, if no such assertion has been made, `#unassert' has no
+effect.
+
+ You can also make or cancel assertions using command line options.
+*Note Invocation::.
+
+
+File: cpp.info, Node: Differences from previous versions, Prev: Obsolete Features, Up: Implementation Details
+
+11.4 Differences from previous versions
+=======================================
+
+This section details behavior which has changed from previous versions
+of CPP. We do not plan to change it again in the near future, but we
+do not promise not to, either.
+
+ The "previous versions" discussed here are 2.95 and before. The
+behavior of GCC 3.0 is mostly the same as the behavior of the widely
+used 2.96 and 2.97 development snapshots. Where there are differences,
+they generally represent bugs in the snapshots.
+
+ * -I- deprecated
+
+ This option has been deprecated in 4.0. `-iquote' is meant to
+ replace the need for this option.
+
+ * Order of evaluation of `#' and `##' operators
+
+ The standard does not specify the order of evaluation of a chain of
+ `##' operators, nor whether `#' is evaluated before, after, or at
+ the same time as `##'. You should therefore not write any code
+ which depends on any specific ordering. It is possible to
+ guarantee an ordering, if you need one, by suitable use of nested
+ macros.
+
+ An example of where this might matter is pasting the arguments `1',
+ `e' and `-2'. This would be fine for left-to-right pasting, but
+ right-to-left pasting would produce an invalid token `e-2'.
+
+ GCC 3.0 evaluates `#' and `##' at the same time and strictly left
+ to right. Older versions evaluated all `#' operators first, then
+ all `##' operators, in an unreliable order.
+
+ * The form of whitespace between tokens in preprocessor output
+
+ *Note Preprocessor Output::, for the current textual format. This
+ is also the format used by stringification. Normally, the
+ preprocessor communicates tokens directly to the compiler's
+ parser, and whitespace does not come up at all.
+
+ Older versions of GCC preserved all whitespace provided by the
+ user and inserted lots more whitespace of their own, because they
+ could not accurately predict when extra spaces were needed to
+ prevent accidental token pasting.
+
+ * Optional argument when invoking rest argument macros
+
+ As an extension, GCC permits you to omit the variable arguments
+ entirely when you use a variable argument macro. This is
+ forbidden by the 1999 C standard, and will provoke a pedantic
+ warning with GCC 3.0. Previous versions accepted it silently.
+
+ * `##' swallowing preceding text in rest argument macros
+
+ Formerly, in a macro expansion, if `##' appeared before a variable
+ arguments parameter, and the set of tokens specified for that
+ argument in the macro invocation was empty, previous versions of
+ CPP would back up and remove the preceding sequence of
+ non-whitespace characters (*not* the preceding token). This
+ extension is in direct conflict with the 1999 C standard and has
+ been drastically pared back.
+
+ In the current version of the preprocessor, if `##' appears between
+ a comma and a variable arguments parameter, and the variable
+ argument is omitted entirely, the comma will be removed from the
+ expansion. If the variable argument is empty, or the token before
+ `##' is not a comma, then `##' behaves as a normal token paste.
+
+ * `#line' and `#include'
+
+ The `#line' directive used to change GCC's notion of the
+ "directory containing the current file", used by `#include' with a
+ double-quoted header file name. In 3.0 and later, it does not.
+ *Note Line Control::, for further explanation.
+
+ * Syntax of `#line'
+
+ In GCC 2.95 and previous, the string constant argument to `#line'
+ was treated the same way as the argument to `#include': backslash
+ escapes were not honored, and the string ended at the second `"'.
+ This is not compliant with the C standard. In GCC 3.0, an attempt
+ was made to correct the behavior, so that the string was treated
+ as a real string constant, but it turned out to be buggy. In 3.1,
+ the bugs have been fixed. (We are not fixing the bugs in 3.0
+ because they affect relatively few people and the fix is quite
+ invasive.)
+
+
+
+File: cpp.info, Node: Invocation, Next: Environment Variables, Prev: Implementation Details, Up: Top
+
+12 Invocation
+*************
+
+Most often when you use the C preprocessor you will not have to invoke
+it explicitly: the C compiler will do so automatically. However, the
+preprocessor is sometimes useful on its own. All the options listed
+here are also acceptable to the C compiler and have the same meaning,
+except that the C compiler has different rules for specifying the output
+file.
+
+ _Note:_ Whether you use the preprocessor by way of `gcc' or `cpp',
+the "compiler driver" is run first. This program's purpose is to
+translate your command into invocations of the programs that do the
+actual work. Their command line interfaces are similar but not
+identical to the documented interface, and may change without notice.
+
+ The C preprocessor expects two file names as arguments, INFILE and
+OUTFILE. The preprocessor reads INFILE together with any other files
+it specifies with `#include'. All the output generated by the combined
+input files is written in OUTFILE.
+
+ Either INFILE or OUTFILE may be `-', which as INFILE means to read
+from standard input and as OUTFILE means to write to standard output.
+Also, if either file is omitted, it means the same as if `-' had been
+specified for that file.
+
+ Unless otherwise noted, or the option ends in `=', all options which
+take an argument may have that argument appear either immediately after
+the option, or with a space between option and argument: `-Ifoo' and
+`-I foo' have the same effect.
+
+ Many options have multi-letter names; therefore multiple
+single-letter options may _not_ be grouped: `-dM' is very different from
+`-d -M'.
+
+`-D NAME'
+ Predefine NAME as a macro, with definition `1'.
+
+`-D NAME=DEFINITION'
+ The contents of DEFINITION are tokenized and processed as if they
+ appeared during translation phase three in a `#define' directive.
+ In particular, the definition will be truncated by embedded
+ newline characters.
+
+ If you are invoking the preprocessor from a shell or shell-like
+ program you may need to use the shell's quoting syntax to protect
+ characters such as spaces that have a meaning in the shell syntax.
+
+ If you wish to define a function-like macro on the command line,
+ write its argument list with surrounding parentheses before the
+ equals sign (if any). Parentheses are meaningful to most shells,
+ so you will need to quote the option. With `sh' and `csh',
+ `-D'NAME(ARGS...)=DEFINITION'' works.
+
+ `-D' and `-U' options are processed in the order they are given on
+ the command line. All `-imacros FILE' and `-include FILE' options
+ are processed after all `-D' and `-U' options.
+
+`-U NAME'
+ Cancel any previous definition of NAME, either built in or
+ provided with a `-D' option.
+
+`-undef'
+ Do not predefine any system-specific or GCC-specific macros. The
+ standard predefined macros remain defined. *Note Standard
+ Predefined Macros::.
+
+`-I DIR'
+ Add the directory DIR to the list of directories to be searched
+ for header files. *Note Search Path::. Directories named by `-I'
+ are searched before the standard system include directories. If
+ the directory DIR is a standard system include directory, the
+ option is ignored to ensure that the default search order for
+ system directories and the special treatment of system headers are
+ not defeated (*note System Headers::) . If DIR begins with `=',
+ then the `=' will be replaced by the sysroot prefix; see
+ `--sysroot' and `-isysroot'.
+
+`-o FILE'
+ Write output to FILE. This is the same as specifying FILE as the
+ second non-option argument to `cpp'. `gcc' has a different
+ interpretation of a second non-option argument, so you must use
+ `-o' to specify the output file.
+
+`-Wall'
+ Turns on all optional warnings which are desirable for normal code.
+ At present this is `-Wcomment', `-Wtrigraphs', `-Wmultichar' and a
+ warning about integer promotion causing a change of sign in `#if'
+ expressions. Note that many of the preprocessor's warnings are on
+ by default and have no options to control them.
+
+`-Wcomment'
+`-Wcomments'
+ Warn whenever a comment-start sequence `/*' appears in a `/*'
+ comment, or whenever a backslash-newline appears in a `//' comment.
+ (Both forms have the same effect.)
+
+`-Wtrigraphs'
+ Most trigraphs in comments cannot affect the meaning of the
+ program. However, a trigraph that would form an escaped newline
+ (`??/' at the end of a line) can, by changing where the comment
+ begins or ends. Therefore, only trigraphs that would form escaped
+ newlines produce warnings inside a comment.
+
+ This option is implied by `-Wall'. If `-Wall' is not given, this
+ option is still enabled unless trigraphs are enabled. To get
+ trigraph conversion without warnings, but get the other `-Wall'
+ warnings, use `-trigraphs -Wall -Wno-trigraphs'.
+
+`-Wtraditional'
+ Warn about certain constructs that behave differently in
+ traditional and ISO C. Also warn about ISO C constructs that have
+ no traditional C equivalent, and problematic constructs which
+ should be avoided. *Note Traditional Mode::.
+
+`-Wundef'
+ Warn whenever an identifier which is not a macro is encountered in
+ an `#if' directive, outside of `defined'. Such identifiers are
+ replaced with zero.
+
+`-Wunused-macros'
+ Warn about macros defined in the main file that are unused. A
+ macro is "used" if it is expanded or tested for existence at least
+ once. The preprocessor will also warn if the macro has not been
+ used at the time it is redefined or undefined.
+
+ Built-in macros, macros defined on the command line, and macros
+ defined in include files are not warned about.
+
+ _Note:_ If a macro is actually used, but only used in skipped
+ conditional blocks, then CPP will report it as unused. To avoid
+ the warning in such a case, you might improve the scope of the
+ macro's definition by, for example, moving it into the first
+ skipped block. Alternatively, you could provide a dummy use with
+ something like:
+
+ #if defined the_macro_causing_the_warning
+ #endif
+
+`-Wendif-labels'
+ Warn whenever an `#else' or an `#endif' are followed by text.
+ This usually happens in code of the form
+
+ #if FOO
+ ...
+ #else FOO
+ ...
+ #endif FOO
+
+ The second and third `FOO' should be in comments, but often are not
+ in older programs. This warning is on by default.
+
+`-Werror'
+ Make all warnings into hard errors. Source code which triggers
+ warnings will be rejected.
+
+`-Wsystem-headers'
+ Issue warnings for code in system headers. These are normally
+ unhelpful in finding bugs in your own code, therefore suppressed.
+ If you are responsible for the system library, you may want to see
+ them.
+
+`-w'
+ Suppress all warnings, including those which GNU CPP issues by
+ default.
+
+`-pedantic'
+ Issue all the mandatory diagnostics listed in the C standard.
+ Some of them are left out by default, since they trigger
+ frequently on harmless code.
+
+`-pedantic-errors'
+ Issue all the mandatory diagnostics, and make all mandatory
+ diagnostics into errors. This includes mandatory diagnostics that
+ GCC issues without `-pedantic' but treats as warnings.
+
+`-M'
+ Instead of outputting the result of preprocessing, output a rule
+ suitable for `make' describing the dependencies of the main source
+ file. The preprocessor outputs one `make' rule containing the
+ object file name for that source file, a colon, and the names of
+ all the included files, including those coming from `-include' or
+ `-imacros' command line options.
+
+ Unless specified explicitly (with `-MT' or `-MQ'), the object file
+ name consists of the name of the source file with any suffix
+ replaced with object file suffix and with any leading directory
+ parts removed. If there are many included files then the rule is
+ split into several lines using `\'-newline. The rule has no
+ commands.
+
+ This option does not suppress the preprocessor's debug output,
+ such as `-dM'. To avoid mixing such debug output with the
+ dependency rules you should explicitly specify the dependency
+ output file with `-MF', or use an environment variable like
+ `DEPENDENCIES_OUTPUT' (*note Environment Variables::). Debug
+ output will still be sent to the regular output stream as normal.
+
+ Passing `-M' to the driver implies `-E', and suppresses warnings
+ with an implicit `-w'.
+
+`-MM'
+ Like `-M' but do not mention header files that are found in system
+ header directories, nor header files that are included, directly
+ or indirectly, from such a header.
+
+ This implies that the choice of angle brackets or double quotes in
+ an `#include' directive does not in itself determine whether that
+ header will appear in `-MM' dependency output. This is a slight
+ change in semantics from GCC versions 3.0 and earlier.
+
+`-MF FILE'
+ When used with `-M' or `-MM', specifies a file to write the
+ dependencies to. If no `-MF' switch is given the preprocessor
+ sends the rules to the same place it would have sent preprocessed
+ output.
+
+ When used with the driver options `-MD' or `-MMD', `-MF' overrides
+ the default dependency output file.
+
+`-MG'
+ In conjunction with an option such as `-M' requesting dependency
+ generation, `-MG' assumes missing header files are generated files
+ and adds them to the dependency list without raising an error.
+ The dependency filename is taken directly from the `#include'
+ directive without prepending any path. `-MG' also suppresses
+ preprocessed output, as a missing header file renders this useless.
+
+ This feature is used in automatic updating of makefiles.
+
+`-MP'
+ This option instructs CPP to add a phony target for each dependency
+ other than the main file, causing each to depend on nothing. These
+ dummy rules work around errors `make' gives if you remove header
+ files without updating the `Makefile' to match.
+
+ This is typical output:
+
+ test.o: test.c test.h
+
+ test.h:
+
+`-MT TARGET'
+ Change the target of the rule emitted by dependency generation. By
+ default CPP takes the name of the main input file, deletes any
+ directory components and any file suffix such as `.c', and appends
+ the platform's usual object suffix. The result is the target.
+
+ An `-MT' option will set the target to be exactly the string you
+ specify. If you want multiple targets, you can specify them as a
+ single argument to `-MT', or use multiple `-MT' options.
+
+ For example, `-MT '$(objpfx)foo.o'' might give
+
+ $(objpfx)foo.o: foo.c
+
+`-MQ TARGET'
+ Same as `-MT', but it quotes any characters which are special to
+ Make. `-MQ '$(objpfx)foo.o'' gives
+
+ $$(objpfx)foo.o: foo.c
+
+ The default target is automatically quoted, as if it were given
+ with `-MQ'.
+
+`-MD'
+ `-MD' is equivalent to `-M -MF FILE', except that `-E' is not
+ implied. The driver determines FILE based on whether an `-o'
+ option is given. If it is, the driver uses its argument but with
+ a suffix of `.d', otherwise it takes the name of the input file,
+ removes any directory components and suffix, and applies a `.d'
+ suffix.
+
+ If `-MD' is used in conjunction with `-E', any `-o' switch is
+ understood to specify the dependency output file (*note -MF:
+ dashMF.), but if used without `-E', each `-o' is understood to
+ specify a target object file.
+
+ Since `-E' is not implied, `-MD' can be used to generate a
+ dependency output file as a side-effect of the compilation process.
+
+`-MMD'
+ Like `-MD' except mention only user header files, not system
+ header files.
+
+`-x c'
+`-x c++'
+`-x objective-c'
+`-x assembler-with-cpp'
+ Specify the source language: C, C++, Objective-C, or assembly.
+ This has nothing to do with standards conformance or extensions;
+ it merely selects which base syntax to expect. If you give none
+ of these options, cpp will deduce the language from the extension
+ of the source file: `.c', `.cc', `.m', or `.S'. Some other common
+ extensions for C++ and assembly are also recognized. If cpp does
+ not recognize the extension, it will treat the file as C; this is
+ the most generic mode.
+
+ _Note:_ Previous versions of cpp accepted a `-lang' option which
+ selected both the language and the standards conformance level.
+ This option has been removed, because it conflicts with the `-l'
+ option.
+
+`-std=STANDARD'
+`-ansi'
+ Specify the standard to which the code should conform. Currently
+ CPP knows about C and C++ standards; others may be added in the
+ future.
+
+ STANDARD may be one of:
+ `iso9899:1990'
+ `c89'
+ The ISO C standard from 1990. `c89' is the customary
+ shorthand for this version of the standard.
+
+ The `-ansi' option is equivalent to `-std=c89'.
+
+ `iso9899:199409'
+ The 1990 C standard, as amended in 1994.
+
+ `iso9899:1999'
+ `c99'
+ `iso9899:199x'
+ `c9x'
+ The revised ISO C standard, published in December 1999.
+ Before publication, this was known as C9X.
+
+ `gnu89'
+ The 1990 C standard plus GNU extensions. This is the default.
+
+ `gnu99'
+ `gnu9x'
+ The 1999 C standard plus GNU extensions.
+
+ `c++98'
+ The 1998 ISO C++ standard plus amendments.
+
+ `gnu++98'
+ The same as `-std=c++98' plus GNU extensions. This is the
+ default for C++ code.
+
+`-I-'
+ Split the include path. Any directories specified with `-I'
+ options before `-I-' are searched only for headers requested with
+ `#include "FILE"'; they are not searched for `#include <FILE>'.
+ If additional directories are specified with `-I' options after
+ the `-I-', those directories are searched for all `#include'
+ directives.
+
+ In addition, `-I-' inhibits the use of the directory of the current
+ file directory as the first search directory for `#include "FILE"'.
+ *Note Search Path::. This option has been deprecated.
+
+`-nostdinc'
+ Do not search the standard system directories for header files.
+ Only the directories you have specified with `-I' options (and the
+ directory of the current file, if appropriate) are searched.
+
+`-nostdinc++'
+ Do not search for header files in the C++-specific standard
+ directories, but do still search the other standard directories.
+ (This option is used when building the C++ library.)
+
+`-include FILE'
+ Process FILE as if `#include "file"' appeared as the first line of
+ the primary source file. However, the first directory searched
+ for FILE is the preprocessor's working directory _instead of_ the
+ directory containing the main source file. If not found there, it
+ is searched for in the remainder of the `#include "..."' search
+ chain as normal.
+
+ If multiple `-include' options are given, the files are included
+ in the order they appear on the command line.
+
+`-imacros FILE'
+ Exactly like `-include', except that any output produced by
+ scanning FILE is thrown away. Macros it defines remain defined.
+ This allows you to acquire all the macros from a header without
+ also processing its declarations.
+
+ All files specified by `-imacros' are processed before all files
+ specified by `-include'.
+
+`-idirafter DIR'
+ Search DIR for header files, but do it _after_ all directories
+ specified with `-I' and the standard system directories have been
+ exhausted. DIR is treated as a system include directory. If DIR
+ begins with `=', then the `=' will be replaced by the sysroot
+ prefix; see `--sysroot' and `-isysroot'.
+
+`-iprefix PREFIX'
+ Specify PREFIX as the prefix for subsequent `-iwithprefix'
+ options. If the prefix represents a directory, you should include
+ the final `/'.
+
+`-iwithprefix DIR'
+`-iwithprefixbefore DIR'
+ Append DIR to the prefix specified previously with `-iprefix', and
+ add the resulting directory to the include search path.
+ `-iwithprefixbefore' puts it in the same place `-I' would;
+ `-iwithprefix' puts it where `-idirafter' would.
+
+`-isysroot DIR'
+ This option is like the `--sysroot' option, but applies only to
+ header files. See the `--sysroot' option for more information.
+
+`-imultilib DIR'
+ Use DIR as a subdirectory of the directory containing
+ target-specific C++ headers.
+
+`-isystem DIR'
+ Search DIR for header files, after all directories specified by
+ `-I' but before the standard system directories. Mark it as a
+ system directory, so that it gets the same special treatment as is
+ applied to the standard system directories. *Note System
+ Headers::. If DIR begins with `=', then the `=' will be replaced
+ by the sysroot prefix; see `--sysroot' and `-isysroot'.
+
+`-iquote DIR'
+ Search DIR only for header files requested with `#include "FILE"';
+ they are not searched for `#include <FILE>', before all
+ directories specified by `-I' and before the standard system
+ directories. *Note Search Path::. If DIR begins with `=', then
+ the `=' will be replaced by the sysroot prefix; see `--sysroot'
+ and `-isysroot'.
+
+`-fdirectives-only'
+ When preprocessing, handle directives, but do not expand macros.
+
+ The option's behavior depends on the `-E' and `-fpreprocessed'
+ options.
+
+ With `-E', preprocessing is limited to the handling of directives
+ such as `#define', `#ifdef', and `#error'. Other preprocessor
+ operations, such as macro expansion and trigraph conversion are
+ not performed. In addition, the `-dD' option is implicitly
+ enabled.
+
+ With `-fpreprocessed', predefinition of command line and most
+ builtin macros is disabled. Macros such as `__LINE__', which are
+ contextually dependent, are handled normally. This enables
+ compilation of files previously preprocessed with `-E
+ -fdirectives-only'.
+
+ With both `-E' and `-fpreprocessed', the rules for
+ `-fpreprocessed' take precedence. This enables full preprocessing
+ of files previously preprocessed with `-E -fdirectives-only'.
+
+`-fdollars-in-identifiers'
+ Accept `$' in identifiers. *Note Identifier characters::.
+
+`-fextended-identifiers'
+ Accept universal character names in identifiers. This option is
+ experimental; in a future version of GCC, it will be enabled by
+ default for C99 and C++.
+
+`-fpreprocessed'
+ Indicate to the preprocessor that the input file has already been
+ preprocessed. This suppresses things like macro expansion,
+ trigraph conversion, escaped newline splicing, and processing of
+ most directives. The preprocessor still recognizes and removes
+ comments, so that you can pass a file preprocessed with `-C' to
+ the compiler without problems. In this mode the integrated
+ preprocessor is little more than a tokenizer for the front ends.
+
+ `-fpreprocessed' is implicit if the input file has one of the
+ extensions `.i', `.ii' or `.mi'. These are the extensions that
+ GCC uses for preprocessed files created by `-save-temps'.
+
+`-ftabstop=WIDTH'
+ Set the distance between tab stops. This helps the preprocessor
+ report correct column numbers in warnings or errors, even if tabs
+ appear on the line. If the value is less than 1 or greater than
+ 100, the option is ignored. The default is 8.
+
+`-fexec-charset=CHARSET'
+ Set the execution character set, used for string and character
+ constants. The default is UTF-8. CHARSET can be any encoding
+ supported by the system's `iconv' library routine.
+
+`-fwide-exec-charset=CHARSET'
+ Set the wide execution character set, used for wide string and
+ character constants. The default is UTF-32 or UTF-16, whichever
+ corresponds to the width of `wchar_t'. As with `-fexec-charset',
+ CHARSET can be any encoding supported by the system's `iconv'
+ library routine; however, you will have problems with encodings
+ that do not fit exactly in `wchar_t'.
+
+`-finput-charset=CHARSET'
+ Set the input character set, used for translation from the
+ character set of the input file to the source character set used
+ by GCC. If the locale does not specify, or GCC cannot get this
+ information from the locale, the default is UTF-8. This can be
+ overridden by either the locale or this command line option.
+ Currently the command line option takes precedence if there's a
+ conflict. CHARSET can be any encoding supported by the system's
+ `iconv' library routine.
+
+`-fworking-directory'
+ Enable generation of linemarkers in the preprocessor output that
+ will let the compiler know the current working directory at the
+ time of preprocessing. When this option is enabled, the
+ preprocessor will emit, after the initial linemarker, a second
+ linemarker with the current working directory followed by two
+ slashes. GCC will use this directory, when it's present in the
+ preprocessed input, as the directory emitted as the current
+ working directory in some debugging information formats. This
+ option is implicitly enabled if debugging information is enabled,
+ but this can be inhibited with the negated form
+ `-fno-working-directory'. If the `-P' flag is present in the
+ command line, this option has no effect, since no `#line'
+ directives are emitted whatsoever.
+
+`-fno-show-column'
+ Do not print column numbers in diagnostics. This may be necessary
+ if diagnostics are being scanned by a program that does not
+ understand the column numbers, such as `dejagnu'.
+
+`-A PREDICATE=ANSWER'
+ Make an assertion with the predicate PREDICATE and answer ANSWER.
+ This form is preferred to the older form `-A PREDICATE(ANSWER)',
+ which is still supported, because it does not use shell special
+ characters. *Note Obsolete Features::.
+
+`-A -PREDICATE=ANSWER'
+ Cancel an assertion with the predicate PREDICATE and answer ANSWER.
+
+`-dCHARS'
+ CHARS is a sequence of one or more of the following characters,
+ and must not be preceded by a space. Other characters are
+ interpreted by the compiler proper, or reserved for future
+ versions of GCC, and so are silently ignored. If you specify
+ characters whose behavior conflicts, the result is undefined.
+
+ `M'
+ Instead of the normal output, generate a list of `#define'
+ directives for all the macros defined during the execution of
+ the preprocessor, including predefined macros. This gives
+ you a way of finding out what is predefined in your version
+ of the preprocessor. Assuming you have no file `foo.h', the
+ command
+
+ touch foo.h; cpp -dM foo.h
+
+ will show all the predefined macros.
+
+ If you use `-dM' without the `-E' option, `-dM' is
+ interpreted as a synonym for `-fdump-rtl-mach'. *Note
+ Debugging Options: (gcc)Debugging Options.
+
+ `D'
+ Like `M' except in two respects: it does _not_ include the
+ predefined macros, and it outputs _both_ the `#define'
+ directives and the result of preprocessing. Both kinds of
+ output go to the standard output file.
+
+ `N'
+ Like `D', but emit only the macro names, not their expansions.
+
+ `I'
+ Output `#include' directives in addition to the result of
+ preprocessing.
+
+ `U'
+ Like `D' except that only macros that are expanded, or whose
+ definedness is tested in preprocessor directives, are output;
+ the output is delayed until the use or test of the macro; and
+ `#undef' directives are also output for macros tested but
+ undefined at the time.
+
+`-P'
+ Inhibit generation of linemarkers in the output from the
+ preprocessor. This might be useful when running the preprocessor
+ on something that is not C code, and will be sent to a program
+ which might be confused by the linemarkers. *Note Preprocessor
+ Output::.
+
+`-C'
+ Do not discard comments. All comments are passed through to the
+ output file, except for comments in processed directives, which
+ are deleted along with the directive.
+
+ You should be prepared for side effects when using `-C'; it causes
+ the preprocessor to treat comments as tokens in their own right.
+ For example, comments appearing at the start of what would be a
+ directive line have the effect of turning that line into an
+ ordinary source line, since the first token on the line is no
+ longer a `#'.
+
+`-CC'
+ Do not discard comments, including during macro expansion. This is
+ like `-C', except that comments contained within macros are also
+ passed through to the output file where the macro is expanded.
+
+ In addition to the side-effects of the `-C' option, the `-CC'
+ option causes all C++-style comments inside a macro to be
+ converted to C-style comments. This is to prevent later use of
+ that macro from inadvertently commenting out the remainder of the
+ source line.
+
+ The `-CC' option is generally used to support lint comments.
+
+`-traditional-cpp'
+ Try to imitate the behavior of old-fashioned C preprocessors, as
+ opposed to ISO C preprocessors. *Note Traditional Mode::.
+
+`-trigraphs'
+ Process trigraph sequences. *Note Initial processing::.
+
+`-remap'
+ Enable special code to work around file systems which only permit
+ very short file names, such as MS-DOS.
+
+`--help'
+`--target-help'
+ Print text describing all the command line options instead of
+ preprocessing anything.
+
+`-v'
+ Verbose mode. Print out GNU CPP's version number at the beginning
+ of execution, and report the final form of the include path.
+
+`-H'
+ Print the name of each header file used, in addition to other
+ normal activities. Each name is indented to show how deep in the
+ `#include' stack it is. Precompiled header files are also
+ printed, even if they are found to be invalid; an invalid
+ precompiled header file is printed with `...x' and a valid one
+ with `...!' .
+
+`-version'
+`--version'
+ Print out GNU CPP's version number. With one dash, proceed to
+ preprocess as normal. With two dashes, exit immediately.
+
+
+File: cpp.info, Node: Environment Variables, Next: GNU Free Documentation License, Prev: Invocation, Up: Top
+
+13 Environment Variables
+************************
+
+This section describes the environment variables that affect how CPP
+operates. You can use them to specify directories or prefixes to use
+when searching for include files, or to control dependency output.
+
+ Note that you can also specify places to search using options such as
+`-I', and control dependency output with options like `-M' (*note
+Invocation::). These take precedence over environment variables, which
+in turn take precedence over the configuration of GCC.
+
+`CPATH'
+`C_INCLUDE_PATH'
+`CPLUS_INCLUDE_PATH'
+`OBJC_INCLUDE_PATH'
+ Each variable's value is a list of directories separated by a
+ special character, much like `PATH', in which to look for header
+ files. The special character, `PATH_SEPARATOR', is
+ target-dependent and determined at GCC build time. For Microsoft
+ Windows-based targets it is a semicolon, and for almost all other
+ targets it is a colon.
+
+ `CPATH' specifies a list of directories to be searched as if
+ specified with `-I', but after any paths given with `-I' options
+ on the command line. This environment variable is used regardless
+ of which language is being preprocessed.
+
+ The remaining environment variables apply only when preprocessing
+ the particular language indicated. Each specifies a list of
+ directories to be searched as if specified with `-isystem', but
+ after any paths given with `-isystem' options on the command line.
+
+ In all these variables, an empty element instructs the compiler to
+ search its current working directory. Empty elements can appear
+ at the beginning or end of a path. For instance, if the value of
+ `CPATH' is `:/special/include', that has the same effect as
+ `-I. -I/special/include'.
+
+ See also *Note Search Path::.
+
+`DEPENDENCIES_OUTPUT'
+ If this variable is set, its value specifies how to output
+ dependencies for Make based on the non-system header files
+ processed by the compiler. System header files are ignored in the
+ dependency output.
+
+ The value of `DEPENDENCIES_OUTPUT' can be just a file name, in
+ which case the Make rules are written to that file, guessing the
+ target name from the source file name. Or the value can have the
+ form `FILE TARGET', in which case the rules are written to file
+ FILE using TARGET as the target name.
+
+ In other words, this environment variable is equivalent to
+ combining the options `-MM' and `-MF' (*note Invocation::), with
+ an optional `-MT' switch too.
+
+`SUNPRO_DEPENDENCIES'
+ This variable is the same as `DEPENDENCIES_OUTPUT' (see above),
+ except that system header files are not ignored, so it implies
+ `-M' rather than `-MM'. However, the dependence on the main input
+ file is omitted. *Note Invocation::.
+
+
+File: cpp.info, Node: GNU Free Documentation License, Next: Index of Directives, Prev: Environment Variables, Up: Top
+
+GNU Free Documentation License
+******************************
+
+ Version 1.2, November 2002
+
+ Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ 0. PREAMBLE
+
+ The purpose of this License is to make a manual, textbook, or other
+ functional and useful document "free" in the sense of freedom: to
+ assure everyone the effective freedom to copy and redistribute it,
+ with or without modifying it, either commercially or
+ noncommercially. Secondarily, this License preserves for the
+ author and publisher a way to get credit for their work, while not
+ being considered responsible for modifications made by others.
+
+ This License is a kind of "copyleft", which means that derivative
+ works of the document must themselves be free in the same sense.
+ It complements the GNU General Public License, which is a copyleft
+ license designed for free software.
+
+ We have designed this License in order to use it for manuals for
+ free software, because free software needs free documentation: a
+ free program should come with manuals providing the same freedoms
+ that the software does. But this License is not limited to
+ software manuals; it can be used for any textual work, regardless
+ of subject matter or whether it is published as a printed book.
+ We recommend this License principally for works whose purpose is
+ instruction or reference.
+
+ 1. APPLICABILITY AND DEFINITIONS
+
+ This License applies to any manual or other work, in any medium,
+ that contains a notice placed by the copyright holder saying it
+ can be distributed under the terms of this License. Such a notice
+ grants a world-wide, royalty-free license, unlimited in duration,
+ to use that work under the conditions stated herein. The
+ "Document", below, refers to any such manual or work. Any member
+ of the public is a licensee, and is addressed as "you". You
+ accept the license if you copy, modify or distribute the work in a
+ way requiring permission under copyright law.
+
+ A "Modified Version" of the Document means any work containing the
+ Document or a portion of it, either copied verbatim, or with
+ modifications and/or translated into another language.
+
+ A "Secondary Section" is a named appendix or a front-matter section
+ of the Document that deals exclusively with the relationship of the
+ publishers or authors of the Document to the Document's overall
+ subject (or to related matters) and contains nothing that could
+ fall directly within that overall subject. (Thus, if the Document
+ is in part a textbook of mathematics, a Secondary Section may not
+ explain any mathematics.) The relationship could be a matter of
+ historical connection with the subject or with related matters, or
+ of legal, commercial, philosophical, ethical or political position
+ regarding them.
+
+ The "Invariant Sections" are certain Secondary Sections whose
+ titles are designated, as being those of Invariant Sections, in
+ the notice that says that the Document is released under this
+ License. If a section does not fit the above definition of
+ Secondary then it is not allowed to be designated as Invariant.
+ The Document may contain zero Invariant Sections. If the Document
+ does not identify any Invariant Sections then there are none.
+
+ The "Cover Texts" are certain short passages of text that are
+ listed, as Front-Cover Texts or Back-Cover Texts, in the notice
+ that says that the Document is released under this License. A
+ Front-Cover Text may be at most 5 words, and a Back-Cover Text may
+ be at most 25 words.
+
+ A "Transparent" copy of the Document means a machine-readable copy,
+ represented in a format whose specification is available to the
+ general public, that is suitable for revising the document
+ straightforwardly with generic text editors or (for images
+ composed of pixels) generic paint programs or (for drawings) some
+ widely available drawing editor, and that is suitable for input to
+ text formatters or for automatic translation to a variety of
+ formats suitable for input to text formatters. A copy made in an
+ otherwise Transparent file format whose markup, or absence of
+ markup, has been arranged to thwart or discourage subsequent
+ modification by readers is not Transparent. An image format is
+ not Transparent if used for any substantial amount of text. A
+ copy that is not "Transparent" is called "Opaque".
+
+ Examples of suitable formats for Transparent copies include plain
+ ASCII without markup, Texinfo input format, LaTeX input format,
+ SGML or XML using a publicly available DTD, and
+ standard-conforming simple HTML, PostScript or PDF designed for
+ human modification. Examples of transparent image formats include
+ PNG, XCF and JPG. Opaque formats include proprietary formats that
+ can be read and edited only by proprietary word processors, SGML or
+ XML for which the DTD and/or processing tools are not generally
+ available, and the machine-generated HTML, PostScript or PDF
+ produced by some word processors for output purposes only.
+
+ The "Title Page" means, for a printed book, the title page itself,
+ plus such following pages as are needed to hold, legibly, the
+ material this License requires to appear in the title page. For
+ works in formats which do not have any title page as such, "Title
+ Page" means the text near the most prominent appearance of the
+ work's title, preceding the beginning of the body of the text.
+
+ A section "Entitled XYZ" means a named subunit of the Document
+ whose title either is precisely XYZ or contains XYZ in parentheses
+ following text that translates XYZ in another language. (Here XYZ
+ stands for a specific section name mentioned below, such as
+ "Acknowledgements", "Dedications", "Endorsements", or "History".)
+ To "Preserve the Title" of such a section when you modify the
+ Document means that it remains a section "Entitled XYZ" according
+ to this definition.
+
+ The Document may include Warranty Disclaimers next to the notice
+ which states that this License applies to the Document. These
+ Warranty Disclaimers are considered to be included by reference in
+ this License, but only as regards disclaiming warranties: any other
+ implication that these Warranty Disclaimers may have is void and
+ has no effect on the meaning of this License.
+
+ 2. VERBATIM COPYING
+
+ You may copy and distribute the Document in any medium, either
+ commercially or noncommercially, provided that this License, the
+ copyright notices, and the license notice saying this License
+ applies to the Document are reproduced in all copies, and that you
+ add no other conditions whatsoever to those of this License. You
+ may not use technical measures to obstruct or control the reading
+ or further copying of the copies you make or distribute. However,
+ you may accept compensation in exchange for copies. If you
+ distribute a large enough number of copies you must also follow
+ the conditions in section 3.
+
+ You may also lend copies, under the same conditions stated above,
+ and you may publicly display copies.
+
+ 3. COPYING IN QUANTITY
+
+ If you publish printed copies (or copies in media that commonly
+ have printed covers) of the Document, numbering more than 100, and
+ the Document's license notice requires Cover Texts, you must
+ enclose the copies in covers that carry, clearly and legibly, all
+ these Cover Texts: Front-Cover Texts on the front cover, and
+ Back-Cover Texts on the back cover. Both covers must also clearly
+ and legibly identify you as the publisher of these copies. The
+ front cover must present the full title with all words of the
+ title equally prominent and visible. You may add other material
+ on the covers in addition. Copying with changes limited to the
+ covers, as long as they preserve the title of the Document and
+ satisfy these conditions, can be treated as verbatim copying in
+ other respects.
+
+ If the required texts for either cover are too voluminous to fit
+ legibly, you should put the first ones listed (as many as fit
+ reasonably) on the actual cover, and continue the rest onto
+ adjacent pages.
+
+ If you publish or distribute Opaque copies of the Document
+ numbering more than 100, you must either include a
+ machine-readable Transparent copy along with each Opaque copy, or
+ state in or with each Opaque copy a computer-network location from
+ which the general network-using public has access to download
+ using public-standard network protocols a complete Transparent
+ copy of the Document, free of added material. If you use the
+ latter option, you must take reasonably prudent steps, when you
+ begin distribution of Opaque copies in quantity, to ensure that
+ this Transparent copy will remain thus accessible at the stated
+ location until at least one year after the last time you
+ distribute an Opaque copy (directly or through your agents or
+ retailers) of that edition to the public.
+
+ It is requested, but not required, that you contact the authors of
+ the Document well before redistributing any large number of
+ copies, to give them a chance to provide you with an updated
+ version of the Document.
+
+ 4. MODIFICATIONS
+
+ You may copy and distribute a Modified Version of the Document
+ under the conditions of sections 2 and 3 above, provided that you
+ release the Modified Version under precisely this License, with
+ the Modified Version filling the role of the Document, thus
+ licensing distribution and modification of the Modified Version to
+ whoever possesses a copy of it. In addition, you must do these
+ things in the Modified Version:
+
+ A. Use in the Title Page (and on the covers, if any) a title
+ distinct from that of the Document, and from those of
+ previous versions (which should, if there were any, be listed
+ in the History section of the Document). You may use the
+ same title as a previous version if the original publisher of
+ that version gives permission.
+
+ B. List on the Title Page, as authors, one or more persons or
+ entities responsible for authorship of the modifications in
+ the Modified Version, together with at least five of the
+ principal authors of the Document (all of its principal
+ authors, if it has fewer than five), unless they release you
+ from this requirement.
+
+ C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+
+ D. Preserve all the copyright notices of the Document.
+
+ E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+
+ F. Include, immediately after the copyright notices, a license
+ notice giving the public permission to use the Modified
+ Version under the terms of this License, in the form shown in
+ the Addendum below.
+
+ G. Preserve in that license notice the full lists of Invariant
+ Sections and required Cover Texts given in the Document's
+ license notice.
+
+ H. Include an unaltered copy of this License.
+
+ I. Preserve the section Entitled "History", Preserve its Title,
+ and add to it an item stating at least the title, year, new
+ authors, and publisher of the Modified Version as given on
+ the Title Page. If there is no section Entitled "History" in
+ the Document, create one stating the title, year, authors,
+ and publisher of the Document as given on its Title Page,
+ then add an item describing the Modified Version as stated in
+ the previous sentence.
+
+ J. Preserve the network location, if any, given in the Document
+ for public access to a Transparent copy of the Document, and
+ likewise the network locations given in the Document for
+ previous versions it was based on. These may be placed in
+ the "History" section. You may omit a network location for a
+ work that was published at least four years before the
+ Document itself, or if the original publisher of the version
+ it refers to gives permission.
+
+ K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the
+ section all the substance and tone of each of the contributor
+ acknowledgements and/or dedications given therein.
+
+ L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section
+ titles.
+
+ M. Delete any section Entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+
+ N. Do not retitle any existing section to be Entitled
+ "Endorsements" or to conflict in title with any Invariant
+ Section.
+
+ O. Preserve any Warranty Disclaimers.
+
+ If the Modified Version includes new front-matter sections or
+ appendices that qualify as Secondary Sections and contain no
+ material copied from the Document, you may at your option
+ designate some or all of these sections as invariant. To do this,
+ add their titles to the list of Invariant Sections in the Modified
+ Version's license notice. These titles must be distinct from any
+ other section titles.
+
+ You may add a section Entitled "Endorsements", provided it contains
+ nothing but endorsements of your Modified Version by various
+ parties--for example, statements of peer review or that the text
+ has been approved by an organization as the authoritative
+ definition of a standard.
+
+ You may add a passage of up to five words as a Front-Cover Text,
+ and a passage of up to 25 words as a Back-Cover Text, to the end
+ of the list of Cover Texts in the Modified Version. Only one
+ passage of Front-Cover Text and one of Back-Cover Text may be
+ added by (or through arrangements made by) any one entity. If the
+ Document already includes a cover text for the same cover,
+ previously added by you or by arrangement made by the same entity
+ you are acting on behalf of, you may not add another; but you may
+ replace the old one, on explicit permission from the previous
+ publisher that added the old one.
+
+ The author(s) and publisher(s) of the Document do not by this
+ License give permission to use their names for publicity for or to
+ assert or imply endorsement of any Modified Version.
+
+ 5. COMBINING DOCUMENTS
+
+ You may combine the Document with other documents released under
+ this License, under the terms defined in section 4 above for
+ modified versions, provided that you include in the combination
+ all of the Invariant Sections of all of the original documents,
+ unmodified, and list them all as Invariant Sections of your
+ combined work in its license notice, and that you preserve all
+ their Warranty Disclaimers.
+
+ The combined work need only contain one copy of this License, and
+ multiple identical Invariant Sections may be replaced with a single
+ copy. If there are multiple Invariant Sections with the same name
+ but different contents, make the title of each such section unique
+ by adding at the end of it, in parentheses, the name of the
+ original author or publisher of that section if known, or else a
+ unique number. Make the same adjustment to the section titles in
+ the list of Invariant Sections in the license notice of the
+ combined work.
+
+ In the combination, you must combine any sections Entitled
+ "History" in the various original documents, forming one section
+ Entitled "History"; likewise combine any sections Entitled
+ "Acknowledgements", and any sections Entitled "Dedications". You
+ must delete all sections Entitled "Endorsements."
+
+ 6. COLLECTIONS OF DOCUMENTS
+
+ You may make a collection consisting of the Document and other
+ documents released under this License, and replace the individual
+ copies of this License in the various documents with a single copy
+ that is included in the collection, provided that you follow the
+ rules of this License for verbatim copying of each of the
+ documents in all other respects.
+
+ You may extract a single document from such a collection, and
+ distribute it individually under this License, provided you insert
+ a copy of this License into the extracted document, and follow
+ this License in all other respects regarding verbatim copying of
+ that document.
+
+ 7. AGGREGATION WITH INDEPENDENT WORKS
+
+ A compilation of the Document or its derivatives with other
+ separate and independent documents or works, in or on a volume of
+ a storage or distribution medium, is called an "aggregate" if the
+ copyright resulting from the compilation is not used to limit the
+ legal rights of the compilation's users beyond what the individual
+ works permit. When the Document is included in an aggregate, this
+ License does not apply to the other works in the aggregate which
+ are not themselves derivative works of the Document.
+
+ If the Cover Text requirement of section 3 is applicable to these
+ copies of the Document, then if the Document is less than one half
+ of the entire aggregate, the Document's Cover Texts may be placed
+ on covers that bracket the Document within the aggregate, or the
+ electronic equivalent of covers if the Document is in electronic
+ form. Otherwise they must appear on printed covers that bracket
+ the whole aggregate.
+
+ 8. TRANSLATION
+
+ Translation is considered a kind of modification, so you may
+ distribute translations of the Document under the terms of section
+ 4. Replacing Invariant Sections with translations requires special
+ permission from their copyright holders, but you may include
+ translations of some or all Invariant Sections in addition to the
+ original versions of these Invariant Sections. You may include a
+ translation of this License, and all the license notices in the
+ Document, and any Warranty Disclaimers, provided that you also
+ include the original English version of this License and the
+ original versions of those notices and disclaimers. In case of a
+ disagreement between the translation and the original version of
+ this License or a notice or disclaimer, the original version will
+ prevail.
+
+ If a section in the Document is Entitled "Acknowledgements",
+ "Dedications", or "History", the requirement (section 4) to
+ Preserve its Title (section 1) will typically require changing the
+ actual title.
+
+ 9. TERMINATION
+
+ You may not copy, modify, sublicense, or distribute the Document
+ except as expressly provided for under this License. Any other
+ attempt to copy, modify, sublicense or distribute the Document is
+ void, and will automatically terminate your rights under this
+ License. However, parties who have received copies, or rights,
+ from you under this License will not have their licenses
+ terminated so long as such parties remain in full compliance.
+
+ 10. FUTURE REVISIONS OF THIS LICENSE
+
+ The Free Software Foundation may publish new, revised versions of
+ the GNU Free Documentation License from time to time. Such new
+ versions will be similar in spirit to the present version, but may
+ differ in detail to address new problems or concerns. See
+ `http://www.gnu.org/copyleft/'.
+
+ Each version of the License is given a distinguishing version
+ number. If the Document specifies that a particular numbered
+ version of this License "or any later version" applies to it, you
+ have the option of following the terms and conditions either of
+ that specified version or of any later version that has been
+ published (not as a draft) by the Free Software Foundation. If
+ the Document does not specify a version number of this License,
+ you may choose any version ever published (not as a draft) by the
+ Free Software Foundation.
+
+ADDENDUM: How to use this License for your documents
+====================================================
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and license
+notices just after the title page:
+
+ Copyright (C) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.2
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+ Texts. A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
+
+ If you have Invariant Sections, Front-Cover Texts and Back-Cover
+Texts, replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with
+ the Front-Cover Texts being LIST, and with the Back-Cover Texts
+ being LIST.
+
+ If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+ If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License, to
+permit their use in free software.
+
+
+File: cpp.info, Node: Index of Directives, Next: Option Index, Prev: GNU Free Documentation License, Up: Top
+
+Index of Directives
+*******************
+
+
+* Menu:
+
+* #assert: Obsolete Features. (line 48)
+* #define: Object-like Macros. (line 11)
+* #elif: Elif. (line 6)
+* #else: Else. (line 6)
+* #endif: Ifdef. (line 6)
+* #error: Diagnostics. (line 6)
+* #ident: Other Directives. (line 6)
+* #if: Conditional Syntax. (line 6)
+* #ifdef: Ifdef. (line 6)
+* #ifndef: Ifdef. (line 40)
+* #import: Alternatives to Wrapper #ifndef.
+ (line 11)
+* #include: Include Syntax. (line 6)
+* #include_next: Wrapper Headers. (line 6)
+* #line: Line Control. (line 20)
+* #pragma GCC dependency: Pragmas. (line 53)
+* #pragma GCC poison: Pragmas. (line 65)
+* #pragma GCC system_header <1>: Pragmas. (line 92)
+* #pragma GCC system_header: System Headers. (line 31)
+* #sccs: Other Directives. (line 6)
+* #unassert: Obsolete Features. (line 59)
+* #undef: Undefining and Redefining Macros.
+ (line 6)
+* #warning: Diagnostics. (line 27)
+
+
+File: cpp.info, Node: Option Index, Next: Concept Index, Prev: Index of Directives, Up: Top
+
+Option Index
+************
+
+CPP's command line options and environment variables are indexed here
+without any initial `-' or `--'.
+
+
+* Menu:
+
+* A: Invocation. (line 522)
+* ansi: Invocation. (line 308)
+* C: Invocation. (line 581)
+* C_INCLUDE_PATH: Environment Variables.
+ (line 16)
+* CPATH: Environment Variables.
+ (line 15)
+* CPLUS_INCLUDE_PATH: Environment Variables.
+ (line 17)
+* D: Invocation. (line 39)
+* dD: Invocation. (line 554)
+* DEPENDENCIES_OUTPUT: Environment Variables.
+ (line 44)
+* dI: Invocation. (line 563)
+* dM: Invocation. (line 538)
+* dN: Invocation. (line 560)
+* dU: Invocation. (line 567)
+* fdirectives-only: Invocation. (line 430)
+* fdollars-in-identifiers: Invocation. (line 452)
+* fexec-charset: Invocation. (line 479)
+* fextended-identifiers: Invocation. (line 455)
+* finput-charset: Invocation. (line 492)
+* fno-show-column: Invocation. (line 517)
+* fno-working-directory: Invocation. (line 502)
+* fpreprocessed: Invocation. (line 460)
+* ftabstop: Invocation. (line 473)
+* fwide-exec-charset: Invocation. (line 484)
+* fworking-directory: Invocation. (line 502)
+* H: Invocation. (line 626)
+* help: Invocation. (line 618)
+* I: Invocation. (line 71)
+* I-: Invocation. (line 345)
+* idirafter: Invocation. (line 387)
+* imacros: Invocation. (line 378)
+* imultilib: Invocation. (line 410)
+* include: Invocation. (line 367)
+* iprefix: Invocation. (line 394)
+* iquote: Invocation. (line 422)
+* isysroot: Invocation. (line 406)
+* isystem: Invocation. (line 414)
+* iwithprefix: Invocation. (line 400)
+* iwithprefixbefore: Invocation. (line 400)
+* M: Invocation. (line 180)
+* MD: Invocation. (line 269)
+* MF: Invocation. (line 215)
+* MG: Invocation. (line 224)
+* MM: Invocation. (line 205)
+* MMD: Invocation. (line 285)
+* MP: Invocation. (line 234)
+* MQ: Invocation. (line 260)
+* MT: Invocation. (line 246)
+* nostdinc: Invocation. (line 357)
+* nostdinc++: Invocation. (line 362)
+* o: Invocation. (line 82)
+* OBJC_INCLUDE_PATH: Environment Variables.
+ (line 18)
+* P: Invocation. (line 574)
+* pedantic: Invocation. (line 170)
+* pedantic-errors: Invocation. (line 175)
+* remap: Invocation. (line 613)
+* std=: Invocation. (line 308)
+* SUNPRO_DEPENDENCIES: Environment Variables.
+ (line 60)
+* target-help: Invocation. (line 618)
+* traditional-cpp: Invocation. (line 606)
+* trigraphs: Invocation. (line 610)
+* U: Invocation. (line 62)
+* undef: Invocation. (line 66)
+* v: Invocation. (line 622)
+* version: Invocation. (line 635)
+* w: Invocation. (line 166)
+* Wall: Invocation. (line 88)
+* Wcomment: Invocation. (line 96)
+* Wcomments: Invocation. (line 96)
+* Wendif-labels: Invocation. (line 143)
+* Werror: Invocation. (line 156)
+* Wsystem-headers: Invocation. (line 160)
+* Wtraditional: Invocation. (line 113)
+* Wtrigraphs: Invocation. (line 101)
+* Wundef: Invocation. (line 119)
+* Wunused-macros: Invocation. (line 124)
+* x: Invocation. (line 292)
+
+
+File: cpp.info, Node: Concept Index, Prev: Option Index, Up: Top
+
+Concept Index
+*************
+
+
+* Menu:
+
+* # operator: Stringification. (line 6)
+* ## operator: Concatenation. (line 6)
+* _Pragma: Pragmas. (line 25)
+* alternative tokens: Tokenization. (line 106)
+* arguments: Macro Arguments. (line 6)
+* arguments in macro definitions: Macro Arguments. (line 6)
+* assertions: Obsolete Features. (line 13)
+* assertions, canceling: Obsolete Features. (line 59)
+* backslash-newline: Initial processing. (line 61)
+* block comments: Initial processing. (line 77)
+* C++ named operators: C++ Named Operators. (line 6)
+* character constants: Tokenization. (line 85)
+* character set, execution: Invocation. (line 479)
+* character set, input: Invocation. (line 492)
+* character set, wide execution: Invocation. (line 484)
+* command line: Invocation. (line 6)
+* commenting out code: Deleted Code. (line 6)
+* comments: Initial processing. (line 77)
+* common predefined macros: Common Predefined Macros.
+ (line 6)
+* computed includes: Computed Includes. (line 6)
+* concatenation: Concatenation. (line 6)
+* conditional group: Ifdef. (line 14)
+* conditionals: Conditionals. (line 6)
+* continued lines: Initial processing. (line 61)
+* controlling macro: Once-Only Headers. (line 35)
+* defined: Defined. (line 6)
+* dependencies for make as output: Environment Variables.
+ (line 45)
+* dependencies, make: Invocation. (line 180)
+* diagnostic: Diagnostics. (line 6)
+* differences from previous versions: Differences from previous versions.
+ (line 6)
+* digraphs: Tokenization. (line 106)
+* directive line: The preprocessing language.
+ (line 6)
+* directive name: The preprocessing language.
+ (line 6)
+* directives: The preprocessing language.
+ (line 6)
+* empty macro arguments: Macro Arguments. (line 66)
+* environment variables: Environment Variables.
+ (line 6)
+* expansion of arguments: Argument Prescan. (line 6)
+* FDL, GNU Free Documentation License: GNU Free Documentation License.
+ (line 6)
+* function-like macros: Function-like Macros.
+ (line 6)
+* grouping options: Invocation. (line 34)
+* guard macro: Once-Only Headers. (line 35)
+* header file: Header Files. (line 6)
+* header file names: Tokenization. (line 85)
+* identifiers: Tokenization. (line 34)
+* implementation limits: Implementation limits.
+ (line 6)
+* implementation-defined behavior: Implementation-defined behavior.
+ (line 6)
+* including just once: Once-Only Headers. (line 6)
+* invocation: Invocation. (line 6)
+* iso646.h: C++ Named Operators. (line 6)
+* line comments: Initial processing. (line 77)
+* line control: Line Control. (line 6)
+* line endings: Initial processing. (line 14)
+* linemarkers: Preprocessor Output. (line 28)
+* macro argument expansion: Argument Prescan. (line 6)
+* macro arguments and directives: Directives Within Macro Arguments.
+ (line 6)
+* macros in include: Computed Includes. (line 6)
+* macros with arguments: Macro Arguments. (line 6)
+* macros with variable arguments: Variadic Macros. (line 6)
+* make: Invocation. (line 180)
+* manifest constants: Object-like Macros. (line 6)
+* named operators: C++ Named Operators. (line 6)
+* newlines in macro arguments: Newlines in Arguments.
+ (line 6)
+* null directive: Other Directives. (line 17)
+* numbers: Tokenization. (line 61)
+* object-like macro: Object-like Macros. (line 6)
+* options: Invocation. (line 38)
+* options, grouping: Invocation. (line 34)
+* other tokens: Tokenization. (line 120)
+* output format: Preprocessor Output. (line 12)
+* overriding a header file: Wrapper Headers. (line 6)
+* parentheses in macro bodies: Operator Precedence Problems.
+ (line 6)
+* pitfalls of macros: Macro Pitfalls. (line 6)
+* predefined macros: Predefined Macros. (line 6)
+* predefined macros, system-specific: System-specific Predefined Macros.
+ (line 6)
+* predicates: Obsolete Features. (line 26)
+* preprocessing directives: The preprocessing language.
+ (line 6)
+* preprocessing numbers: Tokenization. (line 61)
+* preprocessing tokens: Tokenization. (line 6)
+* prescan of macro arguments: Argument Prescan. (line 6)
+* problems with macros: Macro Pitfalls. (line 6)
+* punctuators: Tokenization. (line 106)
+* redefining macros: Undefining and Redefining Macros.
+ (line 6)
+* repeated inclusion: Once-Only Headers. (line 6)
+* reporting errors: Diagnostics. (line 6)
+* reporting warnings: Diagnostics. (line 6)
+* reserved namespace: System-specific Predefined Macros.
+ (line 6)
+* self-reference: Self-Referential Macros.
+ (line 6)
+* semicolons (after macro calls): Swallowing the Semicolon.
+ (line 6)
+* side effects (in macro arguments): Duplication of Side Effects.
+ (line 6)
+* standard predefined macros.: Standard Predefined Macros.
+ (line 6)
+* string constants: Tokenization. (line 85)
+* string literals: Tokenization. (line 85)
+* stringification: Stringification. (line 6)
+* symbolic constants: Object-like Macros. (line 6)
+* system header files <1>: System Headers. (line 6)
+* system header files: Header Files. (line 13)
+* system-specific predefined macros: System-specific Predefined Macros.
+ (line 6)
+* testing predicates: Obsolete Features. (line 37)
+* token concatenation: Concatenation. (line 6)
+* token pasting: Concatenation. (line 6)
+* tokens: Tokenization. (line 6)
+* trigraphs: Initial processing. (line 32)
+* undefining macros: Undefining and Redefining Macros.
+ (line 6)
+* unsafe macros: Duplication of Side Effects.
+ (line 6)
+* variable number of arguments: Variadic Macros. (line 6)
+* variadic macros: Variadic Macros. (line 6)
+* wrapper #ifndef: Once-Only Headers. (line 6)
+* wrapper headers: Wrapper Headers. (line 6)
+
+
+
+Tag Table:
+Node: Top1141
+Node: Overview3855
+Node: Character sets6676
+Ref: Character sets-Footnote-18859
+Node: Initial processing9040
+Ref: trigraphs10599
+Node: Tokenization14801
+Ref: Tokenization-Footnote-121937
+Node: The preprocessing language22048
+Node: Header Files24926
+Node: Include Syntax26842
+Node: Include Operation28479
+Node: Search Path30327
+Node: Once-Only Headers33517
+Node: Alternatives to Wrapper #ifndef35176
+Node: Computed Includes36919
+Node: Wrapper Headers40077
+Node: System Headers42503
+Node: Macros44553
+Node: Object-like Macros45694
+Node: Function-like Macros49284
+Node: Macro Arguments50900
+Node: Stringification55045
+Node: Concatenation58251
+Node: Variadic Macros61359
+Node: Predefined Macros66146
+Node: Standard Predefined Macros66734
+Node: Common Predefined Macros72670
+Node: System-specific Predefined Macros85580
+Node: C++ Named Operators87601
+Node: Undefining and Redefining Macros88565
+Node: Directives Within Macro Arguments90669
+Node: Macro Pitfalls92217
+Node: Misnesting92750
+Node: Operator Precedence Problems93862
+Node: Swallowing the Semicolon95728
+Node: Duplication of Side Effects97751
+Node: Self-Referential Macros99934
+Node: Argument Prescan102343
+Node: Newlines in Arguments106097
+Node: Conditionals107048
+Node: Conditional Uses108878
+Node: Conditional Syntax110236
+Node: Ifdef110556
+Node: If113717
+Node: Defined116021
+Node: Else117304
+Node: Elif117874
+Node: Deleted Code119163
+Node: Diagnostics120410
+Node: Line Control122027
+Node: Pragmas125831
+Node: Other Directives130101
+Node: Preprocessor Output131208
+Node: Traditional Mode134409
+Node: Traditional lexical analysis135467
+Node: Traditional macros137970
+Node: Traditional miscellany141772
+Node: Traditional warnings142769
+Node: Implementation Details144966
+Node: Implementation-defined behavior145587
+Ref: Identifier characters146339
+Node: Implementation limits149414
+Node: Obsolete Features152088
+Node: Differences from previous versions154925
+Node: Invocation159133
+Ref: Wtrigraphs163585
+Ref: dashMF168360
+Ref: fdollars-in-identifiers177743
+Node: Environment Variables185906
+Node: GNU Free Documentation License188872
+Node: Index of Directives211305
+Node: Option Index213239
+Node: Concept Index219423
+
+End Tag Table
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/info/cppinternals.info b/uclibc-crosstools-gcc-4.4.2-1/usr/info/cppinternals.info
new file mode 100644
index 0000000..05b9424
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/info/cppinternals.info
@@ -0,0 +1,1036 @@
+This is doc/cppinternals.info, produced by makeinfo version 4.9 from
+/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/gcc-4.4.2/gcc/doc/cppinternals.texi.
+
+INFO-DIR-SECTION Software development
+START-INFO-DIR-ENTRY
+* Cpplib: (cppinternals). Cpplib internals.
+END-INFO-DIR-ENTRY
+
+ This file documents the internals of the GNU C Preprocessor.
+
+ Copyright 2000, 2001, 2002, 2004, 2005, 2006, 2007 Free Software
+Foundation, Inc.
+
+ Permission is granted to make and distribute verbatim copies of this
+manual provided the copyright notice and this permission notice are
+preserved on all copies.
+
+ Permission is granted to copy and distribute modified versions of
+this manual under the conditions for verbatim copying, provided also
+that the entire resulting derived work is distributed under the terms
+of a permission notice identical to this one.
+
+ Permission is granted to copy and distribute translations of this
+manual into another language, under the above conditions for modified
+versions.
+
+
+File: cppinternals.info, Node: Top, Next: Conventions, Up: (dir)
+
+The GNU C Preprocessor Internals
+********************************
+
+1 Cpplib--the GNU C Preprocessor
+********************************
+
+The GNU C preprocessor is implemented as a library, "cpplib", so it can
+be easily shared between a stand-alone preprocessor, and a preprocessor
+integrated with the C, C++ and Objective-C front ends. It is also
+available for use by other programs, though this is not recommended as
+its exposed interface has not yet reached a point of reasonable
+stability.
+
+ The library has been written to be re-entrant, so that it can be used
+to preprocess many files simultaneously if necessary. It has also been
+written with the preprocessing token as the fundamental unit; the
+preprocessor in previous versions of GCC would operate on text strings
+as the fundamental unit.
+
+ This brief manual documents the internals of cpplib, and explains
+some of the tricky issues. It is intended that, along with the
+comments in the source code, a reasonably competent C programmer should
+be able to figure out what the code is doing, and why things have been
+implemented the way they have.
+
+* Menu:
+
+* Conventions:: Conventions used in the code.
+* Lexer:: The combined C, C++ and Objective-C Lexer.
+* Hash Nodes:: All identifiers are entered into a hash table.
+* Macro Expansion:: Macro expansion algorithm.
+* Token Spacing:: Spacing and paste avoidance issues.
+* Line Numbering:: Tracking location within files.
+* Guard Macros:: Optimizing header files with guard macros.
+* Files:: File handling.
+* Concept Index:: Index.
+
+
+File: cppinternals.info, Node: Conventions, Next: Lexer, Prev: Top, Up: Top
+
+Conventions
+***********
+
+cpplib has two interfaces--one is exposed internally only, and the
+other is for both internal and external use.
+
+ The convention is that functions and types that are exposed to
+multiple files internally are prefixed with `_cpp_', and are to be
+found in the file `internal.h'. Functions and types exposed to external
+clients are in `cpplib.h', and prefixed with `cpp_'. For historical
+reasons this is no longer quite true, but we should strive to stick to
+it.
+
+ We are striving to reduce the information exposed in `cpplib.h' to
+the bare minimum necessary, and then to keep it there. This makes clear
+exactly what external clients are entitled to assume, and allows us to
+change internals in the future without worrying whether library clients
+are perhaps relying on some kind of undocumented implementation-specific
+behavior.
+
+
+File: cppinternals.info, Node: Lexer, Next: Hash Nodes, Prev: Conventions, Up: Top
+
+The Lexer
+*********
+
+Overview
+========
+
+The lexer is contained in the file `lex.c'. It is a hand-coded lexer,
+and not implemented as a state machine. It can understand C, C++ and
+Objective-C source code, and has been extended to allow reasonably
+successful preprocessing of assembly language. The lexer does not make
+an initial pass to strip out trigraphs and escaped newlines, but handles
+them as they are encountered in a single pass of the input file. It
+returns preprocessing tokens individually, not a line at a time.
+
+ It is mostly transparent to users of the library, since the library's
+interface for obtaining the next token, `cpp_get_token', takes care of
+lexing new tokens, handling directives, and expanding macros as
+necessary. However, the lexer does expose some functionality so that
+clients of the library can easily spell a given token, such as
+`cpp_spell_token' and `cpp_token_len'. These functions are useful when
+generating diagnostics, and for emitting the preprocessed output.
+
+Lexing a token
+==============
+
+Lexing of an individual token is handled by `_cpp_lex_direct' and its
+subroutines. In its current form the code is quite complicated, with
+read ahead characters and such-like, since it strives to not step back
+in the character stream in preparation for handling non-ASCII file
+encodings. The current plan is to convert any such files to UTF-8
+before processing them. This complexity is therefore unnecessary and
+will be removed, so I'll not discuss it further here.
+
+ The job of `_cpp_lex_direct' is simply to lex a token. It is not
+responsible for issues like directive handling, returning lookahead
+tokens directly, multiple-include optimization, or conditional block
+skipping. It necessarily has a minor ro^le to play in memory
+management of lexed lines. I discuss these issues in a separate section
+(*note Lexing a line::).
+
+ The lexer places the token it lexes into storage pointed to by the
+variable `cur_token', and then increments it. This variable is
+important for correct diagnostic positioning. Unless a specific line
+and column are passed to the diagnostic routines, they will examine the
+`line' and `col' values of the token just before the location that
+`cur_token' points to, and use that location to report the diagnostic.
+
+ The lexer does not consider whitespace to be a token in its own
+right. If whitespace (other than a new line) precedes a token, it sets
+the `PREV_WHITE' bit in the token's flags. Each token has its `line'
+and `col' variables set to the line and column of the first character
+of the token. This line number is the line number in the translation
+unit, and can be converted to a source (file, line) pair using the line
+map code.
+
+ The first token on a logical, i.e. unescaped, line has the flag
+`BOL' set for beginning-of-line. This flag is intended for internal
+use, both to distinguish a `#' that begins a directive from one that
+doesn't, and to generate a call-back to clients that want to be
+notified about the start of every non-directive line with tokens on it.
+Clients cannot reliably determine this for themselves: the first token
+might be a macro, and the tokens of a macro expansion do not have the
+`BOL' flag set. The macro expansion may even be empty, and the next
+token on the line certainly won't have the `BOL' flag set.
+
+ New lines are treated specially; exactly how the lexer handles them
+is context-dependent. The C standard mandates that directives are
+terminated by the first unescaped newline character, even if it appears
+in the middle of a macro expansion. Therefore, if the state variable
+`in_directive' is set, the lexer returns a `CPP_EOF' token, which is
+normally used to indicate end-of-file, to indicate end-of-directive.
+In a directive a `CPP_EOF' token never means end-of-file.
+Conveniently, if the caller was `collect_args', it already handles
+`CPP_EOF' as if it were end-of-file, and reports an error about an
+unterminated macro argument list.
+
+ The C standard also specifies that a new line in the middle of the
+arguments to a macro is treated as whitespace. This white space is
+important in case the macro argument is stringified. The state variable
+`parsing_args' is nonzero when the preprocessor is collecting the
+arguments to a macro call. It is set to 1 when looking for the opening
+parenthesis to a function-like macro, and 2 when collecting the actual
+arguments up to the closing parenthesis, since these two cases need to
+be distinguished sometimes. One such time is here: the lexer sets the
+`PREV_WHITE' flag of a token if it meets a new line when `parsing_args'
+is set to 2. It doesn't set it if it meets a new line when
+`parsing_args' is 1, since then code like
+
+ #define foo() bar
+ foo
+ baz
+
+would be output with an erroneous space before `baz':
+
+ foo
+ baz
+
+ This is a good example of the subtlety of getting token spacing
+correct in the preprocessor; there are plenty of tests in the testsuite
+for corner cases like this.
+
+ The lexer is written to treat each of `\r', `\n', `\r\n' and `\n\r'
+as a single new line indicator. This allows it to transparently
+preprocess MS-DOS, Macintosh and Unix files without their needing to
+pass through a special filter beforehand.
+
+ We also decided to treat a backslash, either `\' or the trigraph
+`??/', separated from one of the above newline indicators by
+non-comment whitespace only, as intending to escape the newline. It
+tends to be a typing mistake, and cannot reasonably be mistaken for
+anything else in any of the C-family grammars. Since handling it this
+way is not strictly conforming to the ISO standard, the library issues a
+warning wherever it encounters it.
+
+ Handling newlines like this is made simpler by doing it in one place
+only. The function `handle_newline' takes care of all newline
+characters, and `skip_escaped_newlines' takes care of arbitrarily long
+sequences of escaped newlines, deferring to `handle_newline' to handle
+the newlines themselves.
+
+ The most painful aspect of lexing ISO-standard C and C++ is handling
+trigraphs and backlash-escaped newlines. Trigraphs are processed before
+any interpretation of the meaning of a character is made, and
+unfortunately there is a trigraph representation for a backslash, so it
+is possible for the trigraph `??/' to introduce an escaped newline.
+
+ Escaped newlines are tedious because theoretically they can occur
+anywhere--between the `+' and `=' of the `+=' token, within the
+characters of an identifier, and even between the `*' and `/' that
+terminates a comment. Moreover, you cannot be sure there is just
+one--there might be an arbitrarily long sequence of them.
+
+ So, for example, the routine that lexes a number, `parse_number',
+cannot assume that it can scan forwards until the first non-number
+character and be done with it, because this could be the `\'
+introducing an escaped newline, or the `?' introducing the trigraph
+sequence that represents the `\' of an escaped newline. If it
+encounters a `?' or `\', it calls `skip_escaped_newlines' to skip over
+any potential escaped newlines before checking whether the number has
+been finished.
+
+ Similarly code in the main body of `_cpp_lex_direct' cannot simply
+check for a `=' after a `+' character to determine whether it has a
+`+=' token; it needs to be prepared for an escaped newline of some
+sort. Such cases use the function `get_effective_char', which returns
+the first character after any intervening escaped newlines.
+
+ The lexer needs to keep track of the correct column position,
+including counting tabs as specified by the `-ftabstop=' option. This
+should be done even within C-style comments; they can appear in the
+middle of a line, and we want to report diagnostics in the correct
+position for text appearing after the end of the comment.
+
+ Some identifiers, such as `__VA_ARGS__' and poisoned identifiers,
+may be invalid and require a diagnostic. However, if they appear in a
+macro expansion we don't want to complain with each use of the macro.
+It is therefore best to catch them during the lexing stage, in
+`parse_identifier'. In both cases, whether a diagnostic is needed or
+not is dependent upon the lexer's state. For example, we don't want to
+issue a diagnostic for re-poisoning a poisoned identifier, or for using
+`__VA_ARGS__' in the expansion of a variable-argument macro. Therefore
+`parse_identifier' makes use of state flags to determine whether a
+diagnostic is appropriate. Since we change state on a per-token basis,
+and don't lex whole lines at a time, this is not a problem.
+
+ Another place where state flags are used to change behavior is whilst
+lexing header names. Normally, a `<' would be lexed as a single token.
+After a `#include' directive, though, it should be lexed as a single
+token as far as the nearest `>' character. Note that we don't allow
+the terminators of header names to be escaped; the first `"' or `>'
+terminates the header name.
+
+ Interpretation of some character sequences depends upon whether we
+are lexing C, C++ or Objective-C, and on the revision of the standard in
+force. For example, `::' is a single token in C++, but in C it is two
+separate `:' tokens and almost certainly a syntax error. Such cases
+are handled by `_cpp_lex_direct' based upon command-line flags stored
+in the `cpp_options' structure.
+
+ Once a token has been lexed, it leads an independent existence. The
+spelling of numbers, identifiers and strings is copied to permanent
+storage from the original input buffer, so a token remains valid and
+correct even if its source buffer is freed with `_cpp_pop_buffer'. The
+storage holding the spellings of such tokens remains until the client
+program calls cpp_destroy, probably at the end of the translation unit.
+
+Lexing a line
+=============
+
+When the preprocessor was changed to return pointers to tokens, one
+feature I wanted was some sort of guarantee regarding how long a
+returned pointer remains valid. This is important to the stand-alone
+preprocessor, the future direction of the C family front ends, and even
+to cpplib itself internally.
+
+ Occasionally the preprocessor wants to be able to peek ahead in the
+token stream. For example, after the name of a function-like macro, it
+wants to check the next token to see if it is an opening parenthesis.
+Another example is that, after reading the first few tokens of a
+`#pragma' directive and not recognizing it as a registered pragma, it
+wants to backtrack and allow the user-defined handler for unknown
+pragmas to access the full `#pragma' token stream. The stand-alone
+preprocessor wants to be able to test the current token with the
+previous one to see if a space needs to be inserted to preserve their
+separate tokenization upon re-lexing (paste avoidance), so it needs to
+be sure the pointer to the previous token is still valid. The
+recursive-descent C++ parser wants to be able to perform tentative
+parsing arbitrarily far ahead in the token stream, and then to be able
+to jump back to a prior position in that stream if necessary.
+
+ The rule I chose, which is fairly natural, is to arrange that the
+preprocessor lex all tokens on a line consecutively into a token buffer,
+which I call a "token run", and when meeting an unescaped new line
+(newlines within comments do not count either), to start lexing back at
+the beginning of the run. Note that we do _not_ lex a line of tokens
+at once; if we did that `parse_identifier' would not have state flags
+available to warn about invalid identifiers (*note Invalid
+identifiers::).
+
+ In other words, accessing tokens that appeared earlier in the current
+line is valid, but since each logical line overwrites the tokens of the
+previous line, tokens from prior lines are unavailable. In particular,
+since a directive only occupies a single logical line, this means that
+the directive handlers like the `#pragma' handler can jump around in
+the directive's tokens if necessary.
+
+ Two issues remain: what about tokens that arise from macro
+expansions, and what happens when we have a long line that overflows
+the token run?
+
+ Since we promise clients that we preserve the validity of pointers
+that we have already returned for tokens that appeared earlier in the
+line, we cannot reallocate the run. Instead, on overflow it is
+expanded by chaining a new token run on to the end of the existing one.
+
+ The tokens forming a macro's replacement list are collected by the
+`#define' handler, and placed in storage that is only freed by
+`cpp_destroy'. So if a macro is expanded in the line of tokens, the
+pointers to the tokens of its expansion that are returned will always
+remain valid. However, macros are a little trickier than that, since
+they give rise to three sources of fresh tokens. They are the built-in
+macros like `__LINE__', and the `#' and `##' operators for
+stringification and token pasting. I handled this by allocating space
+for these tokens from the lexer's token run chain. This means they
+automatically receive the same lifetime guarantees as lexed tokens, and
+we don't need to concern ourselves with freeing them.
+
+ Lexing into a line of tokens solves some of the token memory
+management issues, but not all. The opening parenthesis after a
+function-like macro name might lie on a different line, and the front
+ends definitely want the ability to look ahead past the end of the
+current line. So cpplib only moves back to the start of the token run
+at the end of a line if the variable `keep_tokens' is zero.
+Line-buffering is quite natural for the preprocessor, and as a result
+the only time cpplib needs to increment this variable is whilst looking
+for the opening parenthesis to, and reading the arguments of, a
+function-like macro. In the near future cpplib will export an
+interface to increment and decrement this variable, so that clients can
+share full control over the lifetime of token pointers too.
+
+ The routine `_cpp_lex_token' handles moving to new token runs,
+calling `_cpp_lex_direct' to lex new tokens, or returning
+previously-lexed tokens if we stepped back in the token stream. It also
+checks each token for the `BOL' flag, which might indicate a directive
+that needs to be handled, or require a start-of-line call-back to be
+made. `_cpp_lex_token' also handles skipping over tokens in failed
+conditional blocks, and invalidates the control macro of the
+multiple-include optimization if a token was successfully lexed outside
+a directive. In other words, its callers do not need to concern
+themselves with such issues.
+
+
+File: cppinternals.info, Node: Hash Nodes, Next: Macro Expansion, Prev: Lexer, Up: Top
+
+Hash Nodes
+**********
+
+When cpplib encounters an "identifier", it generates a hash code for it
+and stores it in the hash table. By "identifier" we mean tokens with
+type `CPP_NAME'; this includes identifiers in the usual C sense, as
+well as keywords, directive names, macro names and so on. For example,
+all of `pragma', `int', `foo' and `__GNUC__' are identifiers and hashed
+when lexed.
+
+ Each node in the hash table contain various information about the
+identifier it represents. For example, its length and type. At any one
+time, each identifier falls into exactly one of three categories:
+
+ * Macros
+
+ These have been declared to be macros, either on the command line
+ or with `#define'. A few, such as `__TIME__' are built-ins
+ entered in the hash table during initialization. The hash node
+ for a normal macro points to a structure with more information
+ about the macro, such as whether it is function-like, how many
+ arguments it takes, and its expansion. Built-in macros are
+ flagged as special, and instead contain an enum indicating which
+ of the various built-in macros it is.
+
+ * Assertions
+
+ Assertions are in a separate namespace to macros. To enforce
+ this, cpp actually prepends a `#' character before hashing and
+ entering it in the hash table. An assertion's node points to a
+ chain of answers to that assertion.
+
+ * Void
+
+ Everything else falls into this category--an identifier that is not
+ currently a macro, or a macro that has since been undefined with
+ `#undef'.
+
+ When preprocessing C++, this category also includes the named
+ operators, such as `xor'. In expressions these behave like the
+ operators they represent, but in contexts where the spelling of a
+ token matters they are spelt differently. This spelling
+ distinction is relevant when they are operands of the stringizing
+ and pasting macro operators `#' and `##'. Named operator hash
+ nodes are flagged, both to catch the spelling distinction and to
+ prevent them from being defined as macros.
+
+ The same identifiers share the same hash node. Since each identifier
+token, after lexing, contains a pointer to its hash node, this is used
+to provide rapid lookup of various information. For example, when
+parsing a `#define' statement, CPP flags each argument's identifier
+hash node with the index of that argument. This makes duplicated
+argument checking an O(1) operation for each argument. Similarly, for
+each identifier in the macro's expansion, lookup to see if it is an
+argument, and which argument it is, is also an O(1) operation. Further,
+each directive name, such as `endif', has an associated directive enum
+stored in its hash node, so that directive lookup is also O(1).
+
+
+File: cppinternals.info, Node: Macro Expansion, Next: Token Spacing, Prev: Hash Nodes, Up: Top
+
+Macro Expansion Algorithm
+*************************
+
+Macro expansion is a tricky operation, fraught with nasty corner cases
+and situations that render what you thought was a nifty way to optimize
+the preprocessor's expansion algorithm wrong in quite subtle ways.
+
+ I strongly recommend you have a good grasp of how the C and C++
+standards require macros to be expanded before diving into this
+section, let alone the code!. If you don't have a clear mental picture
+of how things like nested macro expansion, stringification and token
+pasting are supposed to work, damage to your sanity can quickly result.
+
+Internal representation of macros
+=================================
+
+The preprocessor stores macro expansions in tokenized form. This saves
+repeated lexing passes during expansion, at the cost of a small
+increase in memory consumption on average. The tokens are stored
+contiguously in memory, so a pointer to the first one and a token count
+is all you need to get the replacement list of a macro.
+
+ If the macro is a function-like macro the preprocessor also stores
+its parameters, in the form of an ordered list of pointers to the hash
+table entry of each parameter's identifier. Further, in the macro's
+stored expansion each occurrence of a parameter is replaced with a
+special token of type `CPP_MACRO_ARG'. Each such token holds the index
+of the parameter it represents in the parameter list, which allows
+rapid replacement of parameters with their arguments during expansion.
+Despite this optimization it is still necessary to store the original
+parameters to the macro, both for dumping with e.g., `-dD', and to warn
+about non-trivial macro redefinitions when the parameter names have
+changed.
+
+Macro expansion overview
+========================
+
+The preprocessor maintains a "context stack", implemented as a linked
+list of `cpp_context' structures, which together represent the macro
+expansion state at any one time. The `struct cpp_reader' member
+variable `context' points to the current top of this stack. The top
+normally holds the unexpanded replacement list of the innermost macro
+under expansion, except when cpplib is about to pre-expand an argument,
+in which case it holds that argument's unexpanded tokens.
+
+ When there are no macros under expansion, cpplib is in "base
+context". All contexts other than the base context contain a
+contiguous list of tokens delimited by a starting and ending token.
+When not in base context, cpplib obtains the next token from the list
+of the top context. If there are no tokens left in the list, it pops
+that context off the stack, and subsequent ones if necessary, until an
+unexhausted context is found or it returns to base context. In base
+context, cpplib reads tokens directly from the lexer.
+
+ If it encounters an identifier that is both a macro and enabled for
+expansion, cpplib prepares to push a new context for that macro on the
+stack by calling the routine `enter_macro_context'. When this routine
+returns, the new context will contain the unexpanded tokens of the
+replacement list of that macro. In the case of function-like macros,
+`enter_macro_context' also replaces any parameters in the replacement
+list, stored as `CPP_MACRO_ARG' tokens, with the appropriate macro
+argument. If the standard requires that the parameter be replaced with
+its expanded argument, the argument will have been fully macro expanded
+first.
+
+ `enter_macro_context' also handles special macros like `__LINE__'.
+Although these macros expand to a single token which cannot contain any
+further macros, for reasons of token spacing (*note Token Spacing::)
+and simplicity of implementation, cpplib handles these special macros
+by pushing a context containing just that one token.
+
+ The final thing that `enter_macro_context' does before returning is
+to mark the macro disabled for expansion (except for special macros
+like `__TIME__'). The macro is re-enabled when its context is later
+popped from the context stack, as described above. This strict
+ordering ensures that a macro is disabled whilst its expansion is being
+scanned, but that it is _not_ disabled whilst any arguments to it are
+being expanded.
+
+Scanning the replacement list for macros to expand
+==================================================
+
+The C standard states that, after any parameters have been replaced
+with their possibly-expanded arguments, the replacement list is scanned
+for nested macros. Further, any identifiers in the replacement list
+that are not expanded during this scan are never again eligible for
+expansion in the future, if the reason they were not expanded is that
+the macro in question was disabled.
+
+ Clearly this latter condition can only apply to tokens resulting from
+argument pre-expansion. Other tokens never have an opportunity to be
+re-tested for expansion. It is possible for identifiers that are
+function-like macros to not expand initially but to expand during a
+later scan. This occurs when the identifier is the last token of an
+argument (and therefore originally followed by a comma or a closing
+parenthesis in its macro's argument list), and when it replaces its
+parameter in the macro's replacement list, the subsequent token happens
+to be an opening parenthesis (itself possibly the first token of an
+argument).
+
+ It is important to note that when cpplib reads the last token of a
+given context, that context still remains on the stack. Only when
+looking for the _next_ token do we pop it off the stack and drop to a
+lower context. This makes backing up by one token easy, but more
+importantly ensures that the macro corresponding to the current context
+is still disabled when we are considering the last token of its
+replacement list for expansion (or indeed expanding it). As an
+example, which illustrates many of the points above, consider
+
+ #define foo(x) bar x
+ foo(foo) (2)
+
+which fully expands to `bar foo (2)'. During pre-expansion of the
+argument, `foo' does not expand even though the macro is enabled, since
+it has no following parenthesis [pre-expansion of an argument only uses
+tokens from that argument; it cannot take tokens from whatever follows
+the macro invocation]. This still leaves the argument token `foo'
+eligible for future expansion. Then, when re-scanning after argument
+replacement, the token `foo' is rejected for expansion, and marked
+ineligible for future expansion, since the macro is now disabled. It
+is disabled because the replacement list `bar foo' of the macro is
+still on the context stack.
+
+ If instead the algorithm looked for an opening parenthesis first and
+then tested whether the macro were disabled it would be subtly wrong.
+In the example above, the replacement list of `foo' would be popped in
+the process of finding the parenthesis, re-enabling `foo' and expanding
+it a second time.
+
+Looking for a function-like macro's opening parenthesis
+=======================================================
+
+Function-like macros only expand when immediately followed by a
+parenthesis. To do this cpplib needs to temporarily disable macros and
+read the next token. Unfortunately, because of spacing issues (*note
+Token Spacing::), there can be fake padding tokens in-between, and if
+the next real token is not a parenthesis cpplib needs to be able to
+back up that one token as well as retain the information in any
+intervening padding tokens.
+
+ Backing up more than one token when macros are involved is not
+permitted by cpplib, because in general it might involve issues like
+restoring popped contexts onto the context stack, which are too hard.
+Instead, searching for the parenthesis is handled by a special
+function, `funlike_invocation_p', which remembers padding information
+as it reads tokens. If the next real token is not an opening
+parenthesis, it backs up that one token, and then pushes an extra
+context just containing the padding information if necessary.
+
+Marking tokens ineligible for future expansion
+==============================================
+
+As discussed above, cpplib needs a way of marking tokens as
+unexpandable. Since the tokens cpplib handles are read-only once they
+have been lexed, it instead makes a copy of the token and adds the flag
+`NO_EXPAND' to the copy.
+
+ For efficiency and to simplify memory management by avoiding having
+to remember to free these tokens, they are allocated as temporary tokens
+from the lexer's current token run (*note Lexing a line::) using the
+function `_cpp_temp_token'. The tokens are then re-used once the
+current line of tokens has been read in.
+
+ This might sound unsafe. However, tokens runs are not re-used at the
+end of a line if it happens to be in the middle of a macro argument
+list, and cpplib only wants to back-up more than one lexer token in
+situations where no macro expansion is involved, so the optimization is
+safe.
+
+
+File: cppinternals.info, Node: Token Spacing, Next: Line Numbering, Prev: Macro Expansion, Up: Top
+
+Token Spacing
+*************
+
+First, consider an issue that only concerns the stand-alone
+preprocessor: there needs to be a guarantee that re-reading its
+preprocessed output results in an identical token stream. Without
+taking special measures, this might not be the case because of macro
+substitution. For example:
+
+ #define PLUS +
+ #define EMPTY
+ #define f(x) =x=
+ +PLUS -EMPTY- PLUS+ f(=)
+ ==> + + - - + + = = =
+ _not_
+ ==> ++ -- ++ ===
+
+ One solution would be to simply insert a space between all adjacent
+tokens. However, we would like to keep space insertion to a minimum,
+both for aesthetic reasons and because it causes problems for people who
+still try to abuse the preprocessor for things like Fortran source and
+Makefiles.
+
+ For now, just notice that when tokens are added (or removed, as
+shown by the `EMPTY' example) from the original lexed token stream, we
+need to check for accidental token pasting. We call this "paste
+avoidance". Token addition and removal can only occur because of macro
+expansion, but accidental pasting can occur in many places: both before
+and after each macro replacement, each argument replacement, and
+additionally each token created by the `#' and `##' operators.
+
+ Look at how the preprocessor gets whitespace output correct
+normally. The `cpp_token' structure contains a flags byte, and one of
+those flags is `PREV_WHITE'. This is flagged by the lexer, and
+indicates that the token was preceded by whitespace of some form other
+than a new line. The stand-alone preprocessor can use this flag to
+decide whether to insert a space between tokens in the output.
+
+ Now consider the result of the following macro expansion:
+
+ #define add(x, y, z) x + y +z;
+ sum = add (1,2, 3);
+ ==> sum = 1 + 2 +3;
+
+ The interesting thing here is that the tokens `1' and `2' are output
+with a preceding space, and `3' is output without a preceding space,
+but when lexed none of these tokens had that property. Careful
+consideration reveals that `1' gets its preceding whitespace from the
+space preceding `add' in the macro invocation, _not_ replacement list.
+`2' gets its whitespace from the space preceding the parameter `y' in
+the macro replacement list, and `3' has no preceding space because
+parameter `z' has none in the replacement list.
+
+ Once lexed, tokens are effectively fixed and cannot be altered, since
+pointers to them might be held in many places, in particular by
+in-progress macro expansions. So instead of modifying the two tokens
+above, the preprocessor inserts a special token, which I call a
+"padding token", into the token stream to indicate that spacing of the
+subsequent token is special. The preprocessor inserts padding tokens
+in front of every macro expansion and expanded macro argument. These
+point to a "source token" from which the subsequent real token should
+inherit its spacing. In the above example, the source tokens are `add'
+in the macro invocation, and `y' and `z' in the macro replacement list,
+respectively.
+
+ It is quite easy to get multiple padding tokens in a row, for
+example if a macro's first replacement token expands straight into
+another macro.
+
+ #define foo bar
+ #define bar baz
+ [foo]
+ ==> [baz]
+
+ Here, two padding tokens are generated with sources the `foo' token
+between the brackets, and the `bar' token from foo's replacement list,
+respectively. Clearly the first padding token is the one to use, so
+the output code should contain a rule that the first padding token in a
+sequence is the one that matters.
+
+ But what if a macro expansion is left? Adjusting the above example
+slightly:
+
+ #define foo bar
+ #define bar EMPTY baz
+ #define EMPTY
+ [foo] EMPTY;
+ ==> [ baz] ;
+
+ As shown, now there should be a space before `baz' and the semicolon
+in the output.
+
+ The rules we decided above fail for `baz': we generate three padding
+tokens, one per macro invocation, before the token `baz'. We would
+then have it take its spacing from the first of these, which carries
+source token `foo' with no leading space.
+
+ It is vital that cpplib get spacing correct in these examples since
+any of these macro expansions could be stringified, where spacing
+matters.
+
+ So, this demonstrates that not just entering macro and argument
+expansions, but leaving them requires special handling too. I made
+cpplib insert a padding token with a `NULL' source token when leaving
+macro expansions, as well as after each replaced argument in a macro's
+replacement list. It also inserts appropriate padding tokens on either
+side of tokens created by the `#' and `##' operators. I expanded the
+rule so that, if we see a padding token with a `NULL' source token,
+_and_ that source token has no leading space, then we behave as if we
+have seen no padding tokens at all. A quick check shows this rule will
+then get the above example correct as well.
+
+ Now a relationship with paste avoidance is apparent: we have to be
+careful about paste avoidance in exactly the same locations we have
+padding tokens in order to get white space correct. This makes
+implementation of paste avoidance easy: wherever the stand-alone
+preprocessor is fixing up spacing because of padding tokens, and it
+turns out that no space is needed, it has to take the extra step to
+check that a space is not needed after all to avoid an accidental paste.
+The function `cpp_avoid_paste' advises whether a space is required
+between two consecutive tokens. To avoid excessive spacing, it tries
+hard to only require a space if one is likely to be necessary, but for
+reasons of efficiency it is slightly conservative and might recommend a
+space where one is not strictly needed.
+
+
+File: cppinternals.info, Node: Line Numbering, Next: Guard Macros, Prev: Token Spacing, Up: Top
+
+Line numbering
+**************
+
+Just which line number anyway?
+==============================
+
+There are three reasonable requirements a cpplib client might have for
+the line number of a token passed to it:
+
+ * The source line it was lexed on.
+
+ * The line it is output on. This can be different to the line it was
+ lexed on if, for example, there are intervening escaped newlines or
+ C-style comments. For example:
+
+ foo /* A long
+ comment */ bar \
+ baz
+ =>
+ foo bar baz
+
+ * If the token results from a macro expansion, the line of the macro
+ name, or possibly the line of the closing parenthesis in the case
+ of function-like macro expansion.
+
+ The `cpp_token' structure contains `line' and `col' members. The
+lexer fills these in with the line and column of the first character of
+the token. Consequently, but maybe unexpectedly, a token from the
+replacement list of a macro expansion carries the location of the token
+within the `#define' directive, because cpplib expands a macro by
+returning pointers to the tokens in its replacement list. The current
+implementation of cpplib assigns tokens created from built-in macros
+and the `#' and `##' operators the location of the most recently lexed
+token. This is a because they are allocated from the lexer's token
+runs, and because of the way the diagnostic routines infer the
+appropriate location to report.
+
+ The diagnostic routines in cpplib display the location of the most
+recently _lexed_ token, unless they are passed a specific line and
+column to report. For diagnostics regarding tokens that arise from
+macro expansions, it might also be helpful for the user to see the
+original location in the macro definition that the token came from.
+Since that is exactly the information each token carries, such an
+enhancement could be made relatively easily in future.
+
+ The stand-alone preprocessor faces a similar problem when determining
+the correct line to output the token on: the position attached to a
+token is fairly useless if the token came from a macro expansion. All
+tokens on a logical line should be output on its first physical line, so
+the token's reported location is also wrong if it is part of a physical
+line other than the first.
+
+ To solve these issues, cpplib provides a callback that is generated
+whenever it lexes a preprocessing token that starts a new logical line
+other than a directive. It passes this token (which may be a `CPP_EOF'
+token indicating the end of the translation unit) to the callback
+routine, which can then use the line and column of this token to
+produce correct output.
+
+Representation of line numbers
+==============================
+
+As mentioned above, cpplib stores with each token the line number that
+it was lexed on. In fact, this number is not the number of the line in
+the source file, but instead bears more resemblance to the number of the
+line in the translation unit.
+
+ The preprocessor maintains a monotonic increasing line count, which
+is incremented at every new line character (and also at the end of any
+buffer that does not end in a new line). Since a line number of zero is
+useful to indicate certain special states and conditions, this variable
+starts counting from one.
+
+ This variable therefore uniquely enumerates each line in the
+translation unit. With some simple infrastructure, it is straight
+forward to map from this to the original source file and line number
+pair, saving space whenever line number information needs to be saved.
+The code the implements this mapping lies in the files `line-map.c' and
+`line-map.h'.
+
+ Command-line macros and assertions are implemented by pushing a
+buffer containing the right hand side of an equivalent `#define' or
+`#assert' directive. Some built-in macros are handled similarly.
+Since these are all processed before the first line of the main input
+file, it will typically have an assigned line closer to twenty than to
+one.
+
+
+File: cppinternals.info, Node: Guard Macros, Next: Files, Prev: Line Numbering, Up: Top
+
+The Multiple-Include Optimization
+*********************************
+
+Header files are often of the form
+
+ #ifndef FOO
+ #define FOO
+ ...
+ #endif
+
+to prevent the compiler from processing them more than once. The
+preprocessor notices such header files, so that if the header file
+appears in a subsequent `#include' directive and `FOO' is defined, then
+it is ignored and it doesn't preprocess or even re-open the file a
+second time. This is referred to as the "multiple include
+optimization".
+
+ Under what circumstances is such an optimization valid? If the file
+were included a second time, it can only be optimized away if that
+inclusion would result in no tokens to return, and no relevant
+directives to process. Therefore the current implementation imposes
+requirements and makes some allowances as follows:
+
+ 1. There must be no tokens outside the controlling `#if'-`#endif'
+ pair, but whitespace and comments are permitted.
+
+ 2. There must be no directives outside the controlling directive
+ pair, but the "null directive" (a line containing nothing other
+ than a single `#' and possibly whitespace) is permitted.
+
+ 3. The opening directive must be of the form
+
+ #ifndef FOO
+
+ or
+
+ #if !defined FOO [equivalently, #if !defined(FOO)]
+
+ 4. In the second form above, the tokens forming the `#if' expression
+ must have come directly from the source file--no macro expansion
+ must have been involved. This is because macro definitions can
+ change, and tracking whether or not a relevant change has been
+ made is not worth the implementation cost.
+
+ 5. There can be no `#else' or `#elif' directives at the outer
+ conditional block level, because they would probably contain
+ something of interest to a subsequent pass.
+
+ First, when pushing a new file on the buffer stack,
+`_stack_include_file' sets the controlling macro `mi_cmacro' to `NULL',
+and sets `mi_valid' to `true'. This indicates that the preprocessor
+has not yet encountered anything that would invalidate the
+multiple-include optimization. As described in the next few
+paragraphs, these two variables having these values effectively
+indicates top-of-file.
+
+ When about to return a token that is not part of a directive,
+`_cpp_lex_token' sets `mi_valid' to `false'. This enforces the
+constraint that tokens outside the controlling conditional block
+invalidate the optimization.
+
+ The `do_if', when appropriate, and `do_ifndef' directive handlers
+pass the controlling macro to the function `push_conditional'. cpplib
+maintains a stack of nested conditional blocks, and after processing
+every opening conditional this function pushes an `if_stack' structure
+onto the stack. In this structure it records the controlling macro for
+the block, provided there is one and we're at top-of-file (as described
+above). If an `#elif' or `#else' directive is encountered, the
+controlling macro for that block is cleared to `NULL'. Otherwise, it
+survives until the `#endif' closing the block, upon which `do_endif'
+sets `mi_valid' to true and stores the controlling macro in `mi_cmacro'.
+
+ `_cpp_handle_directive' clears `mi_valid' when processing any
+directive other than an opening conditional and the null directive.
+With this, and requiring top-of-file to record a controlling macro, and
+no `#else' or `#elif' for it to survive and be copied to `mi_cmacro' by
+`do_endif', we have enforced the absence of directives outside the main
+conditional block for the optimization to be on.
+
+ Note that whilst we are inside the conditional block, `mi_valid' is
+likely to be reset to `false', but this does not matter since the
+closing `#endif' restores it to `true' if appropriate.
+
+ Finally, since `_cpp_lex_direct' pops the file off the buffer stack
+at `EOF' without returning a token, if the `#endif' directive was not
+followed by any tokens, `mi_valid' is `true' and `_cpp_pop_file_buffer'
+remembers the controlling macro associated with the file. Subsequent
+calls to `stack_include_file' result in no buffer being pushed if the
+controlling macro is defined, effecting the optimization.
+
+ A quick word on how we handle the
+
+ #if !defined FOO
+
+case. `_cpp_parse_expr' and `parse_defined' take steps to see whether
+the three stages `!', `defined-expression' and `end-of-directive' occur
+in order in a `#if' expression. If so, they return the guard macro to
+`do_if' in the variable `mi_ind_cmacro', and otherwise set it to `NULL'.
+`enter_macro_context' sets `mi_valid' to false, so if a macro was
+expanded whilst parsing any part of the expression, then the
+top-of-file test in `push_conditional' fails and the optimization is
+turned off.
+
+
+File: cppinternals.info, Node: Files, Next: Concept Index, Prev: Guard Macros, Up: Top
+
+File Handling
+*************
+
+Fairly obviously, the file handling code of cpplib resides in the file
+`files.c'. It takes care of the details of file searching, opening,
+reading and caching, for both the main source file and all the headers
+it recursively includes.
+
+ The basic strategy is to minimize the number of system calls. On
+many systems, the basic `open ()' and `fstat ()' system calls can be
+quite expensive. For every `#include'-d file, we need to try all the
+directories in the search path until we find a match. Some projects,
+such as glibc, pass twenty or thirty include paths on the command line,
+so this can rapidly become time consuming.
+
+ For a header file we have not encountered before we have little
+choice but to do this. However, it is often the case that the same
+headers are repeatedly included, and in these cases we try to avoid
+repeating the filesystem queries whilst searching for the correct file.
+
+ For each file we try to open, we store the constructed path in a
+splay tree. This path first undergoes simplification by the function
+`_cpp_simplify_pathname'. For example, `/usr/include/bits/../foo.h' is
+simplified to `/usr/include/foo.h' before we enter it in the splay tree
+and try to `open ()' the file. CPP will then find subsequent uses of
+`foo.h', even as `/usr/include/foo.h', in the splay tree and save
+system calls.
+
+ Further, it is likely the file contents have also been cached,
+saving a `read ()' system call. We don't bother caching the contents of
+header files that are re-inclusion protected, and whose re-inclusion
+macro is defined when we leave the header file for the first time. If
+the host supports it, we try to map suitably large files into memory,
+rather than reading them in directly.
+
+ The include paths are internally stored on a null-terminated
+singly-linked list, starting with the `"header.h"' directory search
+chain, which then links into the `<header.h>' directory chain.
+
+ Files included with the `<foo.h>' syntax start the lookup directly
+in the second half of this chain. However, files included with the
+`"foo.h"' syntax start at the beginning of the chain, but with one
+extra directory prepended. This is the directory of the current file;
+the one containing the `#include' directive. Prepending this directory
+on a per-file basis is handled by the function `search_from'.
+
+ Note that a header included with a directory component, such as
+`#include "mydir/foo.h"' and opened as
+`/usr/local/include/mydir/foo.h', will have the complete path minus the
+basename `foo.h' as the current directory.
+
+ Enough information is stored in the splay tree that CPP can
+immediately tell whether it can skip the header file because of the
+multiple include optimization, whether the file didn't exist or
+couldn't be opened for some reason, or whether the header was flagged
+not to be re-used, as it is with the obsolete `#import' directive.
+
+ For the benefit of MS-DOS filesystems with an 8.3 filename
+limitation, CPP offers the ability to treat various include file names
+as aliases for the real header files with shorter names. The map from
+one to the other is found in a special file called `header.gcc', stored
+in the command line (or system) include directories to which the mapping
+applies. This may be higher up the directory tree than the full path to
+the file minus the base name.
+
+
+File: cppinternals.info, Node: Concept Index, Prev: Files, Up: Top
+
+Concept Index
+*************
+
+
+* Menu:
+
+* assertions: Hash Nodes. (line 6)
+* controlling macros: Guard Macros. (line 6)
+* escaped newlines: Lexer. (line 6)
+* files: Files. (line 6)
+* guard macros: Guard Macros. (line 6)
+* hash table: Hash Nodes. (line 6)
+* header files: Conventions. (line 6)
+* identifiers: Hash Nodes. (line 6)
+* interface: Conventions. (line 6)
+* lexer: Lexer. (line 6)
+* line numbers: Line Numbering. (line 6)
+* macro expansion: Macro Expansion. (line 6)
+* macro representation (internal): Macro Expansion. (line 19)
+* macros: Hash Nodes. (line 6)
+* multiple-include optimization: Guard Macros. (line 6)
+* named operators: Hash Nodes. (line 6)
+* newlines: Lexer. (line 6)
+* paste avoidance: Token Spacing. (line 6)
+* spacing: Token Spacing. (line 6)
+* token run: Lexer. (line 192)
+* token spacing: Token Spacing. (line 6)
+
+
+
+Tag Table:
+Node: Top1018
+Node: Conventions2703
+Node: Lexer3645
+Ref: Invalid identifiers11558
+Ref: Lexing a line13507
+Node: Hash Nodes18280
+Node: Macro Expansion21159
+Node: Token Spacing30106
+Node: Line Numbering35966
+Node: Guard Macros40051
+Node: Files44842
+Node: Concept Index48308
+
+End Tag Table
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/info/dir b/uclibc-crosstools-gcc-4.4.2-1/usr/info/dir
new file mode 100644
index 0000000..dc7aa4b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/info/dir
@@ -0,0 +1,26 @@
+This is the file .../info/dir, which contains the
+topmost node of the Info hierarchy, called (dir)Top.
+The first time you invoke Info you start off looking at this node.
+
+File: dir, Node: Top This is the top of the INFO tree
+
+ This (the Directory node) gives a menu of major topics.
+ Typing "q" exits, "?" lists all Info commands, "d" returns here,
+ "h" gives a primer for first-timers,
+ "mEmacs<Return>" visits the Emacs manual, etc.
+
+ In Emacs, you can click mouse button 2 on a menu item or cross reference
+ to select it.
+
+* Menu:
+
+Software development
+* Cpp: (cpp). The GNU C preprocessor.
+* Cpplib: (cppinternals). Cpplib internals.
+* g++: (gcc). The GNU C++ compiler.
+* gcc: (gcc). The GNU Compiler Collection.
+* gccinstall: (gccinstall). Installing the GNU Compiler Collection.
+* gccint: (gccint). Internals of the GNU Compiler Collection.
+
+GNU Libraries
+* libgomp: (libgomp). GNU OpenMP runtime library
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/info/gcc.info b/uclibc-crosstools-gcc-4.4.2-1/usr/info/gcc.info
new file mode 100644
index 0000000..6ec34ce
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/info/gcc.info
@@ -0,0 +1,44027 @@
+This is doc/gcc.info, produced by makeinfo version 4.9 from
+/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/gcc-4.4.2/gcc/doc/gcc.texi.
+
+ Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free
+Software Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being "Funding Free Software", the Front-Cover Texts
+being (a) (see below), and with the Back-Cover Texts being (b) (see
+below). A copy of the license is included in the section entitled "GNU
+Free Documentation License".
+
+ (a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+ (b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+software. Copies published by the Free Software Foundation raise
+funds for GNU development.
+
+INFO-DIR-SECTION Software development
+START-INFO-DIR-ENTRY
+* gcc: (gcc). The GNU Compiler Collection.
+* g++: (gcc). The GNU C++ compiler.
+END-INFO-DIR-ENTRY
+ This file documents the use of the GNU compilers.
+
+ Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free
+Software Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being "Funding Free Software", the Front-Cover Texts
+being (a) (see below), and with the Back-Cover Texts being (b) (see
+below). A copy of the license is included in the section entitled "GNU
+Free Documentation License".
+
+ (a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+ (b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+software. Copies published by the Free Software Foundation raise
+funds for GNU development.
+
+
+
+File: gcc.info, Node: Top, Next: G++ and GCC, Up: (DIR)
+
+Introduction
+************
+
+This manual documents how to use the GNU compilers, as well as their
+features and incompatibilities, and how to report bugs. It corresponds
+to the compilers (Buildroot 2010.02-git) version 4.4.2. The internals
+of the GNU compilers, including how to port them to new targets and
+some information about how to write front ends for new languages, are
+documented in a separate manual. *Note Introduction: (gccint)Top.
+
+* Menu:
+
+* G++ and GCC:: You can compile C or C++ programs.
+* Standards:: Language standards supported by GCC.
+* Invoking GCC:: Command options supported by `gcc'.
+* C Implementation:: How GCC implements the ISO C specification.
+* C Extensions:: GNU extensions to the C language family.
+* C++ Extensions:: GNU extensions to the C++ language.
+* Objective-C:: GNU Objective-C runtime features.
+* Compatibility:: Binary Compatibility
+* Gcov:: `gcov'---a test coverage program.
+* Trouble:: If you have trouble using GCC.
+* Bugs:: How, why and where to report bugs.
+* Service:: How to find suppliers of support for GCC.
+* Contributing:: How to contribute to testing and developing GCC.
+
+* Funding:: How to help assure funding for free software.
+* GNU Project:: The GNU Project and GNU/Linux.
+
+* Copying:: GNU General Public License says
+ how you can copy and share GCC.
+* GNU Free Documentation License:: How you can copy and share this manual.
+* Contributors:: People who have contributed to GCC.
+
+* Option Index:: Index to command line options.
+* Keyword Index:: Index of concepts and symbol names.
+
+
+File: gcc.info, Node: G++ and GCC, Next: Standards, Prev: Top, Up: Top
+
+1 Programming Languages Supported by GCC
+****************************************
+
+GCC stands for "GNU Compiler Collection". GCC is an integrated
+distribution of compilers for several major programming languages.
+These languages currently include C, C++, Objective-C, Objective-C++,
+Java, Fortran, and Ada.
+
+ The abbreviation "GCC" has multiple meanings in common use. The
+current official meaning is "GNU Compiler Collection", which refers
+generically to the complete suite of tools. The name historically stood
+for "GNU C Compiler", and this usage is still common when the emphasis
+is on compiling C programs. Finally, the name is also used when
+speaking of the "language-independent" component of GCC: code shared
+among the compilers for all supported languages.
+
+ The language-independent component of GCC includes the majority of the
+optimizers, as well as the "back ends" that generate machine code for
+various processors.
+
+ The part of a compiler that is specific to a particular language is
+called the "front end". In addition to the front ends that are
+integrated components of GCC, there are several other front ends that
+are maintained separately. These support languages such as Pascal,
+Mercury, and COBOL. To use these, they must be built together with GCC
+proper.
+
+ Most of the compilers for languages other than C have their own names.
+The C++ compiler is G++, the Ada compiler is GNAT, and so on. When we
+talk about compiling one of those languages, we might refer to that
+compiler by its own name, or as GCC. Either is correct.
+
+ Historically, compilers for many languages, including C++ and Fortran,
+have been implemented as "preprocessors" which emit another high level
+language such as C. None of the compilers included in GCC are
+implemented this way; they all generate machine code directly. This
+sort of preprocessor should not be confused with the "C preprocessor",
+which is an integral feature of the C, C++, Objective-C and
+Objective-C++ languages.
+
+
+File: gcc.info, Node: Standards, Next: Invoking GCC, Prev: G++ and GCC, Up: Top
+
+2 Language Standards Supported by GCC
+*************************************
+
+For each language compiled by GCC for which there is a standard, GCC
+attempts to follow one or more versions of that standard, possibly with
+some exceptions, and possibly with some extensions.
+
+2.1 C language
+==============
+
+GCC supports three versions of the C standard, although support for the
+most recent version is not yet complete.
+
+ The original ANSI C standard (X3.159-1989) was ratified in 1989 and
+published in 1990. This standard was ratified as an ISO standard
+(ISO/IEC 9899:1990) later in 1990. There were no technical differences
+between these publications, although the sections of the ANSI standard
+were renumbered and became clauses in the ISO standard. This standard,
+in both its forms, is commonly known as "C89", or occasionally as
+"C90", from the dates of ratification. The ANSI standard, but not the
+ISO standard, also came with a Rationale document. To select this
+standard in GCC, use one of the options `-ansi', `-std=c89' or
+`-std=iso9899:1990'; to obtain all the diagnostics required by the
+standard, you should also specify `-pedantic' (or `-pedantic-errors' if
+you want them to be errors rather than warnings). *Note Options
+Controlling C Dialect: C Dialect Options.
+
+ Errors in the 1990 ISO C standard were corrected in two Technical
+Corrigenda published in 1994 and 1996. GCC does not support the
+uncorrected version.
+
+ An amendment to the 1990 standard was published in 1995. This
+amendment added digraphs and `__STDC_VERSION__' to the language, but
+otherwise concerned the library. This amendment is commonly known as
+"AMD1"; the amended standard is sometimes known as "C94" or "C95". To
+select this standard in GCC, use the option `-std=iso9899:199409'
+(with, as for other standard versions, `-pedantic' to receive all
+required diagnostics).
+
+ A new edition of the ISO C standard was published in 1999 as ISO/IEC
+9899:1999, and is commonly known as "C99". GCC has incomplete support
+for this standard version; see
+`http://gcc.gnu.org/gcc-4.4/c99status.html' for details. To select this
+standard, use `-std=c99' or `-std=iso9899:1999'. (While in
+development, drafts of this standard version were referred to as "C9X".)
+
+ Errors in the 1999 ISO C standard were corrected in three Technical
+Corrigenda published in 2001, 2004 and 2007. GCC does not support the
+uncorrected version.
+
+ By default, GCC provides some extensions to the C language that on
+rare occasions conflict with the C standard. *Note Extensions to the C
+Language Family: C Extensions. Use of the `-std' options listed above
+will disable these extensions where they conflict with the C standard
+version selected. You may also select an extended version of the C
+language explicitly with `-std=gnu89' (for C89 with GNU extensions) or
+`-std=gnu99' (for C99 with GNU extensions). The default, if no C
+language dialect options are given, is `-std=gnu89'; this will change to
+`-std=gnu99' in some future release when the C99 support is complete.
+Some features that are part of the C99 standard are accepted as
+extensions in C89 mode.
+
+ The ISO C standard defines (in clause 4) two classes of conforming
+implementation. A "conforming hosted implementation" supports the
+whole standard including all the library facilities; a "conforming
+freestanding implementation" is only required to provide certain
+library facilities: those in `<float.h>', `<limits.h>', `<stdarg.h>',
+and `<stddef.h>'; since AMD1, also those in `<iso646.h>'; and in C99,
+also those in `<stdbool.h>' and `<stdint.h>'. In addition, complex
+types, added in C99, are not required for freestanding implementations.
+The standard also defines two environments for programs, a
+"freestanding environment", required of all implementations and which
+may not have library facilities beyond those required of freestanding
+implementations, where the handling of program startup and termination
+are implementation-defined, and a "hosted environment", which is not
+required, in which all the library facilities are provided and startup
+is through a function `int main (void)' or `int main (int, char *[])'.
+An OS kernel would be a freestanding environment; a program using the
+facilities of an operating system would normally be in a hosted
+implementation.
+
+ GCC aims towards being usable as a conforming freestanding
+implementation, or as the compiler for a conforming hosted
+implementation. By default, it will act as the compiler for a hosted
+implementation, defining `__STDC_HOSTED__' as `1' and presuming that
+when the names of ISO C functions are used, they have the semantics
+defined in the standard. To make it act as a conforming freestanding
+implementation for a freestanding environment, use the option
+`-ffreestanding'; it will then define `__STDC_HOSTED__' to `0' and not
+make assumptions about the meanings of function names from the standard
+library, with exceptions noted below. To build an OS kernel, you may
+well still need to make your own arrangements for linking and startup.
+*Note Options Controlling C Dialect: C Dialect Options.
+
+ GCC does not provide the library facilities required only of hosted
+implementations, nor yet all the facilities required by C99 of
+freestanding implementations; to use the facilities of a hosted
+environment, you will need to find them elsewhere (for example, in the
+GNU C library). *Note Standard Libraries: Standard Libraries.
+
+ Most of the compiler support routines used by GCC are present in
+`libgcc', but there are a few exceptions. GCC requires the
+freestanding environment provide `memcpy', `memmove', `memset' and
+`memcmp'. Finally, if `__builtin_trap' is used, and the target does
+not implement the `trap' pattern, then GCC will emit a call to `abort'.
+
+ For references to Technical Corrigenda, Rationale documents and
+information concerning the history of C that is available online, see
+`http://gcc.gnu.org/readings.html'
+
+2.2 C++ language
+================
+
+GCC supports the ISO C++ standard (1998) and contains experimental
+support for the upcoming ISO C++ standard (200x).
+
+ The original ISO C++ standard was published as the ISO standard
+(ISO/IEC 14882:1998) and amended by a Technical Corrigenda published in
+2003 (ISO/IEC 14882:2003). These standards are referred to as C++98 and
+C++03, respectively. GCC implements the majority of C++98 (`export' is
+a notable exception) and most of the changes in C++03. To select this
+standard in GCC, use one of the options `-ansi' or `-std=c++98'; to
+obtain all the diagnostics required by the standard, you should also
+specify `-pedantic' (or `-pedantic-errors' if you want them to be
+errors rather than warnings).
+
+ The ISO C++ committee is working on a new ISO C++ standard, dubbed
+C++0x, that is intended to be published by 2009. C++0x contains several
+changes to the C++ language, some of which have been implemented in an
+experimental C++0x mode in GCC. The C++0x mode in GCC tracks the draft
+working paper for the C++0x standard; the latest working paper is
+available on the ISO C++ committee's web site at
+`http://www.open-std.org/jtc1/sc22/wg21/'. For information regarding
+the C++0x features available in the experimental C++0x mode, see
+`http://gcc.gnu.org/gcc-4.3/cxx0x_status.html'. To select this standard
+in GCC, use the option `-std=c++0x'; to obtain all the diagnostics
+required by the standard, you should also specify `-pedantic' (or
+`-pedantic-errors' if you want them to be errors rather than warnings).
+
+ By default, GCC provides some extensions to the C++ language; *Note
+Options Controlling C++ Dialect: C++ Dialect Options. Use of the
+`-std' option listed above will disable these extensions. You may also
+select an extended version of the C++ language explicitly with
+`-std=gnu++98' (for C++98 with GNU extensions) or `-std=gnu++0x' (for
+C++0x with GNU extensions). The default, if no C++ language dialect
+options are given, is `-std=gnu++98'.
+
+2.3 Objective-C and Objective-C++ languages
+===========================================
+
+There is no formal written standard for Objective-C or Objective-C++.
+The most authoritative manual is "Object-Oriented Programming and the
+Objective-C Language", available at a number of web sites:
+
+ *
+ `http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/'
+ is a recent (and periodically updated) version;
+
+ * `http://www.toodarkpark.org/computers/objc/' is an older example;
+
+ * `http://www.gnustep.org' and `http://gcc.gnu.org/readings.html'
+ have additional useful information.
+
+ *Note GNAT Reference Manual: (gnat_rm)Top, for information on standard
+conformance and compatibility of the Ada compiler.
+
+ *Note Standards: (gfortran)Standards, for details of standards
+supported by GNU Fortran.
+
+ *Note Compatibility with the Java Platform: (gcj)Compatibility, for
+details of compatibility between `gcj' and the Java Platform.
+
+
+File: gcc.info, Node: Invoking GCC, Next: C Implementation, Prev: Standards, Up: Top
+
+3 GCC Command Options
+*********************
+
+When you invoke GCC, it normally does preprocessing, compilation,
+assembly and linking. The "overall options" allow you to stop this
+process at an intermediate stage. For example, the `-c' option says
+not to run the linker. Then the output consists of object files output
+by the assembler.
+
+ Other options are passed on to one stage of processing. Some options
+control the preprocessor and others the compiler itself. Yet other
+options control the assembler and linker; most of these are not
+documented here, since you rarely need to use any of them.
+
+ Most of the command line options that you can use with GCC are useful
+for C programs; when an option is only useful with another language
+(usually C++), the explanation says so explicitly. If the description
+for a particular option does not mention a source language, you can use
+that option with all supported languages.
+
+ *Note Compiling C++ Programs: Invoking G++, for a summary of special
+options for compiling C++ programs.
+
+ The `gcc' program accepts options and file names as operands. Many
+options have multi-letter names; therefore multiple single-letter
+options may _not_ be grouped: `-dv' is very different from `-d -v'.
+
+ You can mix options and other arguments. For the most part, the order
+you use doesn't matter. Order does matter when you use several options
+of the same kind; for example, if you specify `-L' more than once, the
+directories are searched in the order specified. Also, the placement
+of the `-l' option is significant.
+
+ Many options have long names starting with `-f' or with `-W'--for
+example, `-fmove-loop-invariants', `-Wformat' and so on. Most of these
+have both positive and negative forms; the negative form of `-ffoo'
+would be `-fno-foo'. This manual documents only one of these two
+forms, whichever one is not the default.
+
+ *Note Option Index::, for an index to GCC's options.
+
+* Menu:
+
+* Option Summary:: Brief list of all options, without explanations.
+* Overall Options:: Controlling the kind of output:
+ an executable, object files, assembler files,
+ or preprocessed source.
+* Invoking G++:: Compiling C++ programs.
+* C Dialect Options:: Controlling the variant of C language compiled.
+* C++ Dialect Options:: Variations on C++.
+* Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
+ and Objective-C++.
+* Language Independent Options:: Controlling how diagnostics should be
+ formatted.
+* Warning Options:: How picky should the compiler be?
+* Debugging Options:: Symbol tables, measurements, and debugging dumps.
+* Optimize Options:: How much optimization?
+* Preprocessor Options:: Controlling header files and macro definitions.
+ Also, getting dependency information for Make.
+* Assembler Options:: Passing options to the assembler.
+* Link Options:: Specifying libraries and so on.
+* Directory Options:: Where to find header files and libraries.
+ Where to find the compiler executable files.
+* Spec Files:: How to pass switches to sub-processes.
+* Target Options:: Running a cross-compiler, or an old version of GCC.
+* Submodel Options:: Specifying minor hardware or convention variations,
+ such as 68010 vs 68020.
+* Code Gen Options:: Specifying conventions for function calls, data layout
+ and register usage.
+* Environment Variables:: Env vars that affect GCC.
+* Precompiled Headers:: Compiling a header once, and using it many times.
+* Running Protoize:: Automatically adding or removing function prototypes.
+
+
+File: gcc.info, Node: Option Summary, Next: Overall Options, Up: Invoking GCC
+
+3.1 Option Summary
+==================
+
+Here is a summary of all the options, grouped by type. Explanations are
+in the following sections.
+
+_Overall Options_
+ *Note Options Controlling the Kind of Output: Overall Options.
+ -c -S -E -o FILE -combine -pipe -pass-exit-codes
+ -x LANGUAGE -v -### --help[=CLASS[,...]] --target-help
+ --version -wrapper@FILE
+
+_C Language Options_
+ *Note Options Controlling C Dialect: C Dialect Options.
+ -ansi -std=STANDARD -fgnu89-inline
+ -aux-info FILENAME
+ -fno-asm -fno-builtin -fno-builtin-FUNCTION
+ -fhosted -ffreestanding -fopenmp -fms-extensions
+ -trigraphs -no-integrated-cpp -traditional -traditional-cpp
+ -fallow-single-precision -fcond-mismatch -flax-vector-conversions
+ -fsigned-bitfields -fsigned-char
+ -funsigned-bitfields -funsigned-char
+
+_C++ Language Options_
+ *Note Options Controlling C++ Dialect: C++ Dialect Options.
+ -fabi-version=N -fno-access-control -fcheck-new
+ -fconserve-space -ffriend-injection
+ -fno-elide-constructors
+ -fno-enforce-eh-specs
+ -ffor-scope -fno-for-scope -fno-gnu-keywords
+ -fno-implicit-templates
+ -fno-implicit-inline-templates
+ -fno-implement-inlines -fms-extensions
+ -fno-nonansi-builtins -fno-operator-names
+ -fno-optional-diags -fpermissive
+ -frepo -fno-rtti -fstats -ftemplate-depth-N
+ -fno-threadsafe-statics -fuse-cxa-atexit -fno-weak -nostdinc++
+ -fno-default-inline -fvisibility-inlines-hidden
+ -fvisibility-ms-compat
+ -Wabi -Wctor-dtor-privacy
+ -Wnon-virtual-dtor -Wreorder
+ -Weffc++ -Wstrict-null-sentinel
+ -Wno-non-template-friend -Wold-style-cast
+ -Woverloaded-virtual -Wno-pmf-conversions
+ -Wsign-promo
+
+_Objective-C and Objective-C++ Language Options_
+ *Note Options Controlling Objective-C and Objective-C++ Dialects:
+ Objective-C and Objective-C++ Dialect Options.
+ -fconstant-string-class=CLASS-NAME
+ -fgnu-runtime -fnext-runtime
+ -fno-nil-receivers
+ -fobjc-call-cxx-cdtors
+ -fobjc-direct-dispatch
+ -fobjc-exceptions
+ -fobjc-gc
+ -freplace-objc-classes
+ -fzero-link
+ -gen-decls
+ -Wassign-intercept
+ -Wno-protocol -Wselector
+ -Wstrict-selector-match
+ -Wundeclared-selector
+
+_Language Independent Options_
+ *Note Options to Control Diagnostic Messages Formatting: Language
+ Independent Options.
+ -fmessage-length=N
+ -fdiagnostics-show-location=[once|every-line]
+ -fdiagnostics-show-option
+
+_Warning Options_
+ *Note Options to Request or Suppress Warnings: Warning Options.
+ -fsyntax-only -pedantic -pedantic-errors
+ -w -Wextra -Wall -Waddress -Waggregate-return -Warray-bounds
+ -Wno-attributes -Wno-builtin-macro-redefined
+ -Wc++-compat -Wc++0x-compat -Wcast-align -Wcast-qual
+ -Wchar-subscripts -Wclobbered -Wcomment
+ -Wconversion -Wcoverage-mismatch -Wno-deprecated
+ -Wno-deprecated-declarations -Wdisabled-optimization
+ -Wno-div-by-zero -Wempty-body -Wenum-compare -Wno-endif-labels
+ -Werror -Werror=*
+ -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2
+ -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral
+ -Wformat-security -Wformat-y2k
+ -Wframe-larger-than=LEN -Wignored-qualifiers
+ -Wimplicit -Wimplicit-function-declaration -Wimplicit-int
+ -Winit-self -Winline
+ -Wno-int-to-pointer-cast -Wno-invalid-offsetof
+ -Winvalid-pch -Wlarger-than=LEN -Wunsafe-loop-optimizations
+ -Wlogical-op -Wlong-long
+ -Wmain -Wmissing-braces -Wmissing-field-initializers
+ -Wmissing-format-attribute -Wmissing-include-dirs
+ -Wmissing-noreturn -Wno-mudflap
+ -Wno-multichar -Wnonnull -Wno-overflow
+ -Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded
+ -Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format
+ -Wpointer-arith -Wno-pointer-to-int-cast
+ -Wredundant-decls
+ -Wreturn-type -Wsequence-point -Wshadow
+ -Wsign-compare -Wsign-conversion -Wstack-protector
+ -Wstrict-aliasing -Wstrict-aliasing=n
+ -Wstrict-overflow -Wstrict-overflow=N
+ -Wswitch -Wswitch-default -Wswitch-enum -Wsync-nand
+ -Wsystem-headers -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized
+ -Wunknown-pragmas -Wno-pragmas -Wunreachable-code
+ -Wunused -Wunused-function -Wunused-label -Wunused-parameter
+ -Wunused-value -Wunused-variable
+ -Wvariadic-macros -Wvla
+ -Wvolatile-register-var -Wwrite-strings
+
+_C and Objective-C-only Warning Options_
+ -Wbad-function-cast -Wmissing-declarations
+ -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs
+ -Wold-style-declaration -Wold-style-definition
+ -Wstrict-prototypes -Wtraditional -Wtraditional-conversion
+ -Wdeclaration-after-statement -Wpointer-sign
+
+_Debugging Options_
+ *Note Options for Debugging Your Program or GCC: Debugging Options.
+ -dLETTERS -dumpspecs -dumpmachine -dumpversion
+ -fdbg-cnt-list -fdbg-cnt=COUNTER-VALUE-LIST
+ -fdump-noaddr -fdump-unnumbered
+ -fdump-translation-unit[-N]
+ -fdump-class-hierarchy[-N]
+ -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline
+ -fdump-statistics
+ -fdump-tree-all
+ -fdump-tree-original[-N]
+ -fdump-tree-optimized[-N]
+ -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias
+ -fdump-tree-ch
+ -fdump-tree-ssa[-N] -fdump-tree-pre[-N]
+ -fdump-tree-ccp[-N] -fdump-tree-dce[-N]
+ -fdump-tree-gimple[-raw] -fdump-tree-mudflap[-N]
+ -fdump-tree-dom[-N]
+ -fdump-tree-dse[-N]
+ -fdump-tree-phiopt[-N]
+ -fdump-tree-forwprop[-N]
+ -fdump-tree-copyrename[-N]
+ -fdump-tree-nrv -fdump-tree-vect
+ -fdump-tree-sink
+ -fdump-tree-sra[-N]
+ -fdump-tree-fre[-N]
+ -fdump-tree-vrp[-N]
+ -ftree-vectorizer-verbose=N
+ -fdump-tree-storeccp[-N]
+ -feliminate-dwarf2-dups -feliminate-unused-debug-types
+ -feliminate-unused-debug-symbols -femit-class-debug-always
+ -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs
+ -frandom-seed=STRING -fsched-verbose=N
+ -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose
+ -ftest-coverage -ftime-report -fvar-tracking
+ -g -gLEVEL -gcoff -gdwarf-2
+ -ggdb -gstabs -gstabs+ -gvms -gxcoff -gxcoff+
+ -fno-merge-debug-strings -fno-dwarf2-cfi-asm
+ -fdebug-prefix-map=OLD=NEW
+ -femit-struct-debug-baseonly -femit-struct-debug-reduced
+ -femit-struct-debug-detailed[=SPEC-LIST]
+ -p -pg -print-file-name=LIBRARY -print-libgcc-file-name
+ -print-multi-directory -print-multi-lib
+ -print-prog-name=PROGRAM -print-search-dirs -Q
+ -print-sysroot -print-sysroot-headers-suffix
+ -save-temps -time
+
+_Optimization Options_
+ *Note Options that Control Optimization: Optimize Options.
+ -falign-functions[=N] -falign-jumps[=N]
+ -falign-labels[=N] -falign-loops[=N] -fassociative-math
+ -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize
+ -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves
+ -fcheck-data-deps -fconserve-stack -fcprop-registers -fcrossjumping
+ -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules -fcx-limited-range
+ -fdata-sections -fdce -fdce
+ -fdelayed-branch -fdelete-null-pointer-checks -fdse -fdse
+ -fearly-inlining -fexpensive-optimizations -ffast-math
+ -ffinite-math-only -ffloat-store -fforward-propagate
+ -ffunction-sections -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm
+ -fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining
+ -finline-functions -finline-functions-called-once -finline-limit=N
+ -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg -fipa-pta
+ -fipa-pure-const -fipa-reference -fipa-struct-reorg
+ -fipa-type-escape -fira-algorithm=ALGORITHM
+ -fira-region=REGION -fira-coalesce -fno-ira-share-save-slots
+ -fno-ira-share-spill-slots -fira-verbose=N
+ -fivopts -fkeep-inline-functions -fkeep-static-consts
+ -floop-block -floop-interchange -floop-strip-mine
+ -fmerge-all-constants -fmerge-constants -fmodulo-sched
+ -fmodulo-sched-allow-regmoves -fmove-loop-invariants -fmudflap
+ -fmudflapir -fmudflapth -fno-branch-count-reg -fno-default-inline
+ -fno-defer-pop -fno-function-cse -fno-guess-branch-probability
+ -fno-inline -fno-math-errno -fno-peephole -fno-peephole2
+ -fno-sched-interblock -fno-sched-spec -fno-signed-zeros
+ -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss
+ -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls
+ -fpeel-loops -fpredictive-commoning -fprefetch-loop-arrays
+ -fprofile-correction -fprofile-dir=PATH -fprofile-generate
+ -fprofile-generate=PATH
+ -fprofile-use -fprofile-use=PATH -fprofile-values
+ -freciprocal-math -fregmove -frename-registers -freorder-blocks
+ -freorder-blocks-and-partition -freorder-functions
+ -frerun-cse-after-loop -freschedule-modulo-scheduled-loops
+ -frounding-math -frtl-abstract-sequences -fsched2-use-superblocks
+ -fsched2-use-traces -fsched-spec-load -fsched-spec-load-dangerous
+ -fsched-stalled-insns-dep[=N] -fsched-stalled-insns[=N]
+ -fschedule-insns -fschedule-insns2 -fsection-anchors -fsee
+ -fselective-scheduling -fselective-scheduling2
+ -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops
+ -fsignaling-nans -fsingle-precision-constant -fsplit-ivs-in-unroller
+ -fsplit-wide-types -fstack-protector -fstack-protector-all
+ -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftracer
+ -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop
+ -ftree-copyrename -ftree-dce
+ -ftree-dominator-opts -ftree-dse -ftree-fre -ftree-loop-im
+ -ftree-loop-distribution
+ -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize
+ -ftree-parallelize-loops=N -ftree-pre -ftree-reassoc
+ -ftree-sink -ftree-sra -ftree-switch-conversion
+ -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp
+ -funit-at-a-time -funroll-all-loops -funroll-loops
+ -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops
+ -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb
+ -fwhole-program
+ --param NAME=VALUE
+ -O -O0 -O1 -O2 -O3 -Os
+
+_Preprocessor Options_
+ *Note Options Controlling the Preprocessor: Preprocessor Options.
+ -AQUESTION=ANSWER
+ -A-QUESTION[=ANSWER]
+ -C -dD -dI -dM -dN
+ -DMACRO[=DEFN] -E -H
+ -idirafter DIR
+ -include FILE -imacros FILE
+ -iprefix FILE -iwithprefix DIR
+ -iwithprefixbefore DIR -isystem DIR
+ -imultilib DIR -isysroot DIR
+ -M -MM -MF -MG -MP -MQ -MT -nostdinc
+ -P -fworking-directory -remap
+ -trigraphs -undef -UMACRO -Wp,OPTION
+ -Xpreprocessor OPTION
+
+_Assembler Option_
+ *Note Passing Options to the Assembler: Assembler Options.
+ -Wa,OPTION -Xassembler OPTION
+
+_Linker Options_
+ *Note Options for Linking: Link Options.
+ OBJECT-FILE-NAME -lLIBRARY
+ -nostartfiles -nodefaultlibs -nostdlib -pie -rdynamic
+ -s -static -static-libgcc -shared -shared-libgcc -symbolic
+ -T SCRIPT -Wl,OPTION -Xlinker OPTION
+ -u SYMBOL
+
+_Directory Options_
+ *Note Options for Directory Search: Directory Options.
+ -BPREFIX -IDIR -iquoteDIR -LDIR
+ -specs=FILE -I- --sysroot=DIR
+
+_Target Options_
+ *Note Target Options::.
+ -V VERSION -b MACHINE
+
+_Machine Dependent Options_
+ *Note Hardware Models and Configurations: Submodel Options.
+
+ _ARC Options_
+ -EB -EL
+ -mmangle-cpu -mcpu=CPU -mtext=TEXT-SECTION
+ -mdata=DATA-SECTION -mrodata=READONLY-DATA-SECTION
+
+ _ARM Options_
+ -mapcs-frame -mno-apcs-frame
+ -mabi=NAME
+ -mapcs-stack-check -mno-apcs-stack-check
+ -mapcs-float -mno-apcs-float
+ -mapcs-reentrant -mno-apcs-reentrant
+ -msched-prolog -mno-sched-prolog
+ -mlittle-endian -mbig-endian -mwords-little-endian
+ -mfloat-abi=NAME -msoft-float -mhard-float -mfpe
+ -mthumb-interwork -mno-thumb-interwork
+ -mcpu=NAME -march=NAME -mfpu=NAME
+ -mstructure-size-boundary=N
+ -mabort-on-noreturn
+ -mlong-calls -mno-long-calls
+ -msingle-pic-base -mno-single-pic-base
+ -mpic-register=REG
+ -mnop-fun-dllimport
+ -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns
+ -mpoke-function-name
+ -mthumb -marm
+ -mtpcs-frame -mtpcs-leaf-frame
+ -mcaller-super-interworking -mcallee-super-interworking
+ -mtp=NAME
+ -mword-relocations
+ -mfix-cortex-m3-ldrd
+
+ _AVR Options_
+ -mmcu=MCU -msize -mno-interrupts
+ -mcall-prologues -mno-tablejump -mtiny-stack -mint8
+
+ _Blackfin Options_
+ -mcpu=CPU[-SIREVISION]
+ -msim -momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer
+ -mspecld-anomaly -mno-specld-anomaly -mcsync-anomaly -mno-csync-anomaly
+ -mlow-64k -mno-low64k -mstack-check-l1 -mid-shared-library
+ -mno-id-shared-library -mshared-library-id=N
+ -mleaf-id-shared-library -mno-leaf-id-shared-library
+ -msep-data -mno-sep-data -mlong-calls -mno-long-calls
+ -mfast-fp -minline-plt -mmulticore -mcorea -mcoreb -msdram
+ -micplb
+
+ _CRIS Options_
+ -mcpu=CPU -march=CPU -mtune=CPU
+ -mmax-stack-frame=N -melinux-stacksize=N
+ -metrax4 -metrax100 -mpdebug -mcc-init -mno-side-effects
+ -mstack-align -mdata-align -mconst-align
+ -m32-bit -m16-bit -m8-bit -mno-prologue-epilogue -mno-gotplt
+ -melf -maout -melinux -mlinux -sim -sim2
+ -mmul-bug-workaround -mno-mul-bug-workaround
+
+ _CRX Options_
+ -mmac -mpush-args
+
+ _Darwin Options_
+ -all_load -allowable_client -arch -arch_errors_fatal
+ -arch_only -bind_at_load -bundle -bundle_loader
+ -client_name -compatibility_version -current_version
+ -dead_strip
+ -dependency-file -dylib_file -dylinker_install_name
+ -dynamic -dynamiclib -exported_symbols_list
+ -filelist -flat_namespace -force_cpusubtype_ALL
+ -force_flat_namespace -headerpad_max_install_names
+ -iframework
+ -image_base -init -install_name -keep_private_externs
+ -multi_module -multiply_defined -multiply_defined_unused
+ -noall_load -no_dead_strip_inits_and_terms
+ -nofixprebinding -nomultidefs -noprebind -noseglinkedit
+ -pagezero_size -prebind -prebind_all_twolevel_modules
+ -private_bundle -read_only_relocs -sectalign
+ -sectobjectsymbols -whyload -seg1addr
+ -sectcreate -sectobjectsymbols -sectorder
+ -segaddr -segs_read_only_addr -segs_read_write_addr
+ -seg_addr_table -seg_addr_table_filename -seglinkedit
+ -segprot -segs_read_only_addr -segs_read_write_addr
+ -single_module -static -sub_library -sub_umbrella
+ -twolevel_namespace -umbrella -undefined
+ -unexported_symbols_list -weak_reference_mismatches
+ -whatsloaded -F -gused -gfull -mmacosx-version-min=VERSION
+ -mkernel -mone-byte-bool
+
+ _DEC Alpha Options_
+ -mno-fp-regs -msoft-float -malpha-as -mgas
+ -mieee -mieee-with-inexact -mieee-conformant
+ -mfp-trap-mode=MODE -mfp-rounding-mode=MODE
+ -mtrap-precision=MODE -mbuild-constants
+ -mcpu=CPU-TYPE -mtune=CPU-TYPE
+ -mbwx -mmax -mfix -mcix
+ -mfloat-vax -mfloat-ieee
+ -mexplicit-relocs -msmall-data -mlarge-data
+ -msmall-text -mlarge-text
+ -mmemory-latency=TIME
+
+ _DEC Alpha/VMS Options_
+ -mvms-return-codes
+
+ _FR30 Options_
+ -msmall-model -mno-lsim
+
+ _FRV Options_
+ -mgpr-32 -mgpr-64 -mfpr-32 -mfpr-64
+ -mhard-float -msoft-float
+ -malloc-cc -mfixed-cc -mdword -mno-dword
+ -mdouble -mno-double
+ -mmedia -mno-media -mmuladd -mno-muladd
+ -mfdpic -minline-plt -mgprel-ro -multilib-library-pic
+ -mlinked-fp -mlong-calls -malign-labels
+ -mlibrary-pic -macc-4 -macc-8
+ -mpack -mno-pack -mno-eflags -mcond-move -mno-cond-move
+ -moptimize-membar -mno-optimize-membar
+ -mscc -mno-scc -mcond-exec -mno-cond-exec
+ -mvliw-branch -mno-vliw-branch
+ -mmulti-cond-exec -mno-multi-cond-exec -mnested-cond-exec
+ -mno-nested-cond-exec -mtomcat-stats
+ -mTLS -mtls
+ -mcpu=CPU
+
+ _GNU/Linux Options_
+ -muclibc
+
+ _H8/300 Options_
+ -mrelax -mh -ms -mn -mint32 -malign-300
+
+ _HPPA Options_
+ -march=ARCHITECTURE-TYPE
+ -mbig-switch -mdisable-fpregs -mdisable-indexing
+ -mfast-indirect-calls -mgas -mgnu-ld -mhp-ld
+ -mfixed-range=REGISTER-RANGE
+ -mjump-in-delay -mlinker-opt -mlong-calls
+ -mlong-load-store -mno-big-switch -mno-disable-fpregs
+ -mno-disable-indexing -mno-fast-indirect-calls -mno-gas
+ -mno-jump-in-delay -mno-long-load-store
+ -mno-portable-runtime -mno-soft-float
+ -mno-space-regs -msoft-float -mpa-risc-1-0
+ -mpa-risc-1-1 -mpa-risc-2-0 -mportable-runtime
+ -mschedule=CPU-TYPE -mspace-regs -msio -mwsio
+ -munix=UNIX-STD -nolibdld -static -threads
+
+ _i386 and x86-64 Options_
+ -mtune=CPU-TYPE -march=CPU-TYPE
+ -mfpmath=UNIT
+ -masm=DIALECT -mno-fancy-math-387
+ -mno-fp-ret-in-387 -msoft-float
+ -mno-wide-multiply -mrtd -malign-double
+ -mpreferred-stack-boundary=NUM
+ -mincoming-stack-boundary=NUM
+ -mcld -mcx16 -msahf -mrecip
+ -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx
+ -maes -mpclmul
+ -msse4a -m3dnow -mpopcnt -mabm -msse5
+ -mthreads -mno-align-stringops -minline-all-stringops
+ -minline-stringops-dynamically -mstringop-strategy=ALG
+ -mpush-args -maccumulate-outgoing-args -m128bit-long-double
+ -m96bit-long-double -mregparm=NUM -msseregparm
+ -mveclibabi=TYPE -mpc32 -mpc64 -mpc80 -mstackrealign
+ -momit-leaf-frame-pointer -mno-red-zone -mno-tls-direct-seg-refs
+ -mcmodel=CODE-MODEL
+ -m32 -m64 -mlarge-data-threshold=NUM
+ -mfused-madd -mno-fused-madd -msse2avx
+
+ _IA-64 Options_
+ -mbig-endian -mlittle-endian -mgnu-as -mgnu-ld -mno-pic
+ -mvolatile-asm-stop -mregister-names -mno-sdata
+ -mconstant-gp -mauto-pic -minline-float-divide-min-latency
+ -minline-float-divide-max-throughput
+ -minline-int-divide-min-latency
+ -minline-int-divide-max-throughput
+ -minline-sqrt-min-latency -minline-sqrt-max-throughput
+ -mno-dwarf2-asm -mearly-stop-bits
+ -mfixed-range=REGISTER-RANGE -mtls-size=TLS-SIZE
+ -mtune=CPU-TYPE -mt -pthread -milp32 -mlp64
+ -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec
+ -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec
+ -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose
+ -mno-sched-prefer-non-data-spec-insns
+ -mno-sched-prefer-non-control-spec-insns
+ -mno-sched-count-spec-in-critical-path
+
+ _M32R/D Options_
+ -m32r2 -m32rx -m32r
+ -mdebug
+ -malign-loops -mno-align-loops
+ -missue-rate=NUMBER
+ -mbranch-cost=NUMBER
+ -mmodel=CODE-SIZE-MODEL-TYPE
+ -msdata=SDATA-TYPE
+ -mno-flush-func -mflush-func=NAME
+ -mno-flush-trap -mflush-trap=NUMBER
+ -G NUM
+
+ _M32C Options_
+ -mcpu=CPU -msim -memregs=NUMBER
+
+ _M680x0 Options_
+ -march=ARCH -mcpu=CPU -mtune=TUNE
+ -m68000 -m68020 -m68020-40 -m68020-60 -m68030 -m68040
+ -m68060 -mcpu32 -m5200 -m5206e -m528x -m5307 -m5407
+ -mcfv4e -mbitfield -mno-bitfield -mc68000 -mc68020
+ -mnobitfield -mrtd -mno-rtd -mdiv -mno-div -mshort
+ -mno-short -mhard-float -m68881 -msoft-float -mpcrel
+ -malign-int -mstrict-align -msep-data -mno-sep-data
+ -mshared-library-id=n -mid-shared-library -mno-id-shared-library
+ -mxgot -mno-xgot
+
+ _M68hc1x Options_
+ -m6811 -m6812 -m68hc11 -m68hc12 -m68hcs12
+ -mauto-incdec -minmax -mlong-calls -mshort
+ -msoft-reg-count=COUNT
+
+ _MCore Options_
+ -mhardlit -mno-hardlit -mdiv -mno-div -mrelax-immediates
+ -mno-relax-immediates -mwide-bitfields -mno-wide-bitfields
+ -m4byte-functions -mno-4byte-functions -mcallgraph-data
+ -mno-callgraph-data -mslow-bytes -mno-slow-bytes -mno-lsim
+ -mlittle-endian -mbig-endian -m210 -m340 -mstack-increment
+
+ _MIPS Options_
+ -EL -EB -march=ARCH -mtune=ARCH
+ -mips1 -mips2 -mips3 -mips4 -mips32 -mips32r2
+ -mips64 -mips64r2
+ -mips16 -mno-mips16 -mflip-mips16
+ -minterlink-mips16 -mno-interlink-mips16
+ -mabi=ABI -mabicalls -mno-abicalls
+ -mshared -mno-shared -mplt -mno-plt -mxgot -mno-xgot
+ -mgp32 -mgp64 -mfp32 -mfp64 -mhard-float -msoft-float
+ -msingle-float -mdouble-float -mdsp -mno-dsp -mdspr2 -mno-dspr2
+ -mfpu=FPU-TYPE
+ -msmartmips -mno-smartmips
+ -mpaired-single -mno-paired-single -mdmx -mno-mdmx
+ -mips3d -mno-mips3d -mmt -mno-mt -mllsc -mno-llsc
+ -mlong64 -mlong32 -msym32 -mno-sym32
+ -GNUM -mlocal-sdata -mno-local-sdata
+ -mextern-sdata -mno-extern-sdata -mgpopt -mno-gopt
+ -membedded-data -mno-embedded-data
+ -muninit-const-in-rodata -mno-uninit-const-in-rodata
+ -mcode-readable=SETTING
+ -msplit-addresses -mno-split-addresses
+ -mexplicit-relocs -mno-explicit-relocs
+ -mcheck-zero-division -mno-check-zero-division
+ -mdivide-traps -mdivide-breaks
+ -mmemcpy -mno-memcpy -mlong-calls -mno-long-calls
+ -mmad -mno-mad -mfused-madd -mno-fused-madd -nocpp
+ -mfix-r4000 -mno-fix-r4000 -mfix-r4400 -mno-fix-r4400
+ -mfix-r10000 -mno-fix-r10000 -mfix-vr4120 -mno-fix-vr4120
+ -mfix-vr4130 -mno-fix-vr4130 -mfix-sb1 -mno-fix-sb1
+ -mflush-func=FUNC -mno-flush-func
+ -mbranch-cost=NUM -mbranch-likely -mno-branch-likely
+ -mfp-exceptions -mno-fp-exceptions
+ -mvr4130-align -mno-vr4130-align
+
+ _MMIX Options_
+ -mlibfuncs -mno-libfuncs -mepsilon -mno-epsilon -mabi=gnu
+ -mabi=mmixware -mzero-extend -mknuthdiv -mtoplevel-symbols
+ -melf -mbranch-predict -mno-branch-predict -mbase-addresses
+ -mno-base-addresses -msingle-exit -mno-single-exit
+
+ _MN10300 Options_
+ -mmult-bug -mno-mult-bug
+ -mam33 -mno-am33
+ -mam33-2 -mno-am33-2
+ -mreturn-pointer-on-d0
+ -mno-crt0 -mrelax
+
+ _PDP-11 Options_
+ -mfpu -msoft-float -mac0 -mno-ac0 -m40 -m45 -m10
+ -mbcopy -mbcopy-builtin -mint32 -mno-int16
+ -mint16 -mno-int32 -mfloat32 -mno-float64
+ -mfloat64 -mno-float32 -mabshi -mno-abshi
+ -mbranch-expensive -mbranch-cheap
+ -msplit -mno-split -munix-asm -mdec-asm
+
+ _picoChip Options_
+ -mae=AE_TYPE -mvliw-lookahead=N
+ -msymbol-as-address -mno-inefficient-warnings
+
+ _PowerPC Options_ See RS/6000 and PowerPC Options.
+
+ _RS/6000 and PowerPC Options_
+ -mcpu=CPU-TYPE
+ -mtune=CPU-TYPE
+ -mpower -mno-power -mpower2 -mno-power2
+ -mpowerpc -mpowerpc64 -mno-powerpc
+ -maltivec -mno-altivec
+ -mpowerpc-gpopt -mno-powerpc-gpopt
+ -mpowerpc-gfxopt -mno-powerpc-gfxopt
+ -mmfcrf -mno-mfcrf -mpopcntb -mno-popcntb -mfprnd -mno-fprnd
+ -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp
+ -mnew-mnemonics -mold-mnemonics
+ -mfull-toc -mminimal-toc -mno-fp-in-toc -mno-sum-in-toc
+ -m64 -m32 -mxl-compat -mno-xl-compat -mpe
+ -malign-power -malign-natural
+ -msoft-float -mhard-float -mmultiple -mno-multiple
+ -msingle-float -mdouble-float -msimple-fpu
+ -mstring -mno-string -mupdate -mno-update
+ -mavoid-indexed-addresses -mno-avoid-indexed-addresses
+ -mfused-madd -mno-fused-madd -mbit-align -mno-bit-align
+ -mstrict-align -mno-strict-align -mrelocatable
+ -mno-relocatable -mrelocatable-lib -mno-relocatable-lib
+ -mtoc -mno-toc -mlittle -mlittle-endian -mbig -mbig-endian
+ -mdynamic-no-pic -maltivec -mswdiv
+ -mprioritize-restricted-insns=PRIORITY
+ -msched-costly-dep=DEPENDENCE_TYPE
+ -minsert-sched-nops=SCHEME
+ -mcall-sysv -mcall-netbsd
+ -maix-struct-return -msvr4-struct-return
+ -mabi=ABI-TYPE -msecure-plt -mbss-plt
+ -misel -mno-isel
+ -misel=yes -misel=no
+ -mspe -mno-spe
+ -mspe=yes -mspe=no
+ -mpaired
+ -mgen-cell-microcode -mwarn-cell-microcode
+ -mvrsave -mno-vrsave
+ -mmulhw -mno-mulhw
+ -mdlmzb -mno-dlmzb
+ -mfloat-gprs=yes -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double
+ -mprototype -mno-prototype
+ -msim -mmvme -mads -myellowknife -memb -msdata
+ -msdata=OPT -mvxworks -G NUM -pthread
+
+ _S/390 and zSeries Options_
+ -mtune=CPU-TYPE -march=CPU-TYPE
+ -mhard-float -msoft-float -mhard-dfp -mno-hard-dfp
+ -mlong-double-64 -mlong-double-128
+ -mbackchain -mno-backchain -mpacked-stack -mno-packed-stack
+ -msmall-exec -mno-small-exec -mmvcle -mno-mvcle
+ -m64 -m31 -mdebug -mno-debug -mesa -mzarch
+ -mtpf-trace -mno-tpf-trace -mfused-madd -mno-fused-madd
+ -mwarn-framesize -mwarn-dynamicstack -mstack-size -mstack-guard
+
+ _Score Options_
+ -meb -mel
+ -mnhwloop
+ -muls
+ -mmac
+ -mscore5 -mscore5u -mscore7 -mscore7d
+
+ _SH Options_
+ -m1 -m2 -m2e -m3 -m3e
+ -m4-nofpu -m4-single-only -m4-single -m4
+ -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al
+ -m5-64media -m5-64media-nofpu
+ -m5-32media -m5-32media-nofpu
+ -m5-compact -m5-compact-nofpu
+ -mb -ml -mdalign -mrelax
+ -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave
+ -mieee -mbitops -misize -minline-ic_invalidate -mpadstruct -mspace
+ -mprefergot -musermode -multcost=NUMBER -mdiv=STRATEGY
+ -mdivsi3_libfunc=NAME -mfixed-range=REGISTER-RANGE
+ -madjust-unroll -mindexed-addressing -mgettrcost=NUMBER -mpt-fixed
+ -minvalid-symbols
+
+ _SPARC Options_
+ -mcpu=CPU-TYPE
+ -mtune=CPU-TYPE
+ -mcmodel=CODE-MODEL
+ -m32 -m64 -mapp-regs -mno-app-regs
+ -mfaster-structs -mno-faster-structs
+ -mfpu -mno-fpu -mhard-float -msoft-float
+ -mhard-quad-float -msoft-quad-float
+ -mimpure-text -mno-impure-text -mlittle-endian
+ -mstack-bias -mno-stack-bias
+ -munaligned-doubles -mno-unaligned-doubles
+ -mv8plus -mno-v8plus -mvis -mno-vis
+ -threads -pthreads -pthread
+
+ _SPU Options_
+ -mwarn-reloc -merror-reloc
+ -msafe-dma -munsafe-dma
+ -mbranch-hints
+ -msmall-mem -mlarge-mem -mstdmain
+ -mfixed-range=REGISTER-RANGE
+
+ _System V Options_
+ -Qy -Qn -YP,PATHS -Ym,DIR
+
+ _V850 Options_
+ -mlong-calls -mno-long-calls -mep -mno-ep
+ -mprolog-function -mno-prolog-function -mspace
+ -mtda=N -msda=N -mzda=N
+ -mapp-regs -mno-app-regs
+ -mdisable-callt -mno-disable-callt
+ -mv850e1
+ -mv850e
+ -mv850 -mbig-switch
+
+ _VAX Options_
+ -mg -mgnu -munix
+
+ _VxWorks Options_
+ -mrtp -non-static -Bstatic -Bdynamic
+ -Xbind-lazy -Xbind-now
+
+ _x86-64 Options_ See i386 and x86-64 Options.
+
+ _i386 and x86-64 Windows Options_
+ -mconsole -mcygwin -mno-cygwin -mdll
+ -mnop-fun-dllimport -mthread -mwin32 -mwindows
+
+ _Xstormy16 Options_
+ -msim
+
+ _Xtensa Options_
+ -mconst16 -mno-const16
+ -mfused-madd -mno-fused-madd
+ -mserialize-volatile -mno-serialize-volatile
+ -mtext-section-literals -mno-text-section-literals
+ -mtarget-align -mno-target-align
+ -mlongcalls -mno-longcalls
+
+ _zSeries Options_ See S/390 and zSeries Options.
+
+_Code Generation Options_
+ *Note Options for Code Generation Conventions: Code Gen Options.
+ -fcall-saved-REG -fcall-used-REG
+ -ffixed-REG -fexceptions
+ -fnon-call-exceptions -funwind-tables
+ -fasynchronous-unwind-tables
+ -finhibit-size-directive -finstrument-functions
+ -finstrument-functions-exclude-function-list=SYM,SYM,...
+ -finstrument-functions-exclude-file-list=FILE,FILE,...
+ -fno-common -fno-ident
+ -fpcc-struct-return -fpic -fPIC -fpie -fPIE
+ -fno-jump-tables
+ -frecord-gcc-switches
+ -freg-struct-return -fshort-enums
+ -fshort-double -fshort-wchar
+ -fverbose-asm -fpack-struct[=N] -fstack-check
+ -fstack-limit-register=REG -fstack-limit-symbol=SYM
+ -fno-stack-limit -fargument-alias -fargument-noalias
+ -fargument-noalias-global -fargument-noalias-anything
+ -fleading-underscore -ftls-model=MODEL
+ -ftrapv -fwrapv -fbounds-check
+ -fvisibility
+
+
+* Menu:
+
+* Overall Options:: Controlling the kind of output:
+ an executable, object files, assembler files,
+ or preprocessed source.
+* C Dialect Options:: Controlling the variant of C language compiled.
+* C++ Dialect Options:: Variations on C++.
+* Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
+ and Objective-C++.
+* Language Independent Options:: Controlling how diagnostics should be
+ formatted.
+* Warning Options:: How picky should the compiler be?
+* Debugging Options:: Symbol tables, measurements, and debugging dumps.
+* Optimize Options:: How much optimization?
+* Preprocessor Options:: Controlling header files and macro definitions.
+ Also, getting dependency information for Make.
+* Assembler Options:: Passing options to the assembler.
+* Link Options:: Specifying libraries and so on.
+* Directory Options:: Where to find header files and libraries.
+ Where to find the compiler executable files.
+* Spec Files:: How to pass switches to sub-processes.
+* Target Options:: Running a cross-compiler, or an old version of GCC.
+
+
+File: gcc.info, Node: Overall Options, Next: Invoking G++, Prev: Option Summary, Up: Invoking GCC
+
+3.2 Options Controlling the Kind of Output
+==========================================
+
+Compilation can involve up to four stages: preprocessing, compilation
+proper, assembly and linking, always in that order. GCC is capable of
+preprocessing and compiling several files either into several assembler
+input files, or into one assembler input file; then each assembler
+input file produces an object file, and linking combines all the object
+files (those newly compiled, and those specified as input) into an
+executable file.
+
+ For any given input file, the file name suffix determines what kind of
+compilation is done:
+
+`FILE.c'
+ C source code which must be preprocessed.
+
+`FILE.i'
+ C source code which should not be preprocessed.
+
+`FILE.ii'
+ C++ source code which should not be preprocessed.
+
+`FILE.m'
+ Objective-C source code. Note that you must link with the
+ `libobjc' library to make an Objective-C program work.
+
+`FILE.mi'
+ Objective-C source code which should not be preprocessed.
+
+`FILE.mm'
+`FILE.M'
+ Objective-C++ source code. Note that you must link with the
+ `libobjc' library to make an Objective-C++ program work. Note
+ that `.M' refers to a literal capital M.
+
+`FILE.mii'
+ Objective-C++ source code which should not be preprocessed.
+
+`FILE.h'
+ C, C++, Objective-C or Objective-C++ header file to be turned into
+ a precompiled header.
+
+`FILE.cc'
+`FILE.cp'
+`FILE.cxx'
+`FILE.cpp'
+`FILE.CPP'
+`FILE.c++'
+`FILE.C'
+ C++ source code which must be preprocessed. Note that in `.cxx',
+ the last two letters must both be literally `x'. Likewise, `.C'
+ refers to a literal capital C.
+
+`FILE.mm'
+`FILE.M'
+ Objective-C++ source code which must be preprocessed.
+
+`FILE.mii'
+ Objective-C++ source code which should not be preprocessed.
+
+`FILE.hh'
+`FILE.H'
+`FILE.hp'
+`FILE.hxx'
+`FILE.hpp'
+`FILE.HPP'
+`FILE.h++'
+`FILE.tcc'
+ C++ header file to be turned into a precompiled header.
+
+`FILE.f'
+`FILE.for'
+`FILE.ftn'
+ Fixed form Fortran source code which should not be preprocessed.
+
+`FILE.F'
+`FILE.FOR'
+`FILE.fpp'
+`FILE.FPP'
+`FILE.FTN'
+ Fixed form Fortran source code which must be preprocessed (with
+ the traditional preprocessor).
+
+`FILE.f90'
+`FILE.f95'
+`FILE.f03'
+`FILE.f08'
+ Free form Fortran source code which should not be preprocessed.
+
+`FILE.F90'
+`FILE.F95'
+`FILE.F03'
+`FILE.F08'
+ Free form Fortran source code which must be preprocessed (with the
+ traditional preprocessor).
+
+`FILE.ads'
+ Ada source code file which contains a library unit declaration (a
+ declaration of a package, subprogram, or generic, or a generic
+ instantiation), or a library unit renaming declaration (a package,
+ generic, or subprogram renaming declaration). Such files are also
+ called "specs".
+
+`FILE.adb'
+ Ada source code file containing a library unit body (a subprogram
+ or package body). Such files are also called "bodies".
+
+`FILE.s'
+ Assembler code.
+
+`FILE.S'
+`FILE.sx'
+ Assembler code which must be preprocessed.
+
+`OTHER'
+ An object file to be fed straight into linking. Any file name
+ with no recognized suffix is treated this way.
+
+ You can specify the input language explicitly with the `-x' option:
+
+`-x LANGUAGE'
+ Specify explicitly the LANGUAGE for the following input files
+ (rather than letting the compiler choose a default based on the
+ file name suffix). This option applies to all following input
+ files until the next `-x' option. Possible values for LANGUAGE
+ are:
+ c c-header c-cpp-output
+ c++ c++-header c++-cpp-output
+ objective-c objective-c-header objective-c-cpp-output
+ objective-c++ objective-c++-header objective-c++-cpp-output
+ assembler assembler-with-cpp
+ ada
+ f77 f77-cpp-input f95 f95-cpp-input
+ java
+
+`-x none'
+ Turn off any specification of a language, so that subsequent files
+ are handled according to their file name suffixes (as they are if
+ `-x' has not been used at all).
+
+`-pass-exit-codes'
+ Normally the `gcc' program will exit with the code of 1 if any
+ phase of the compiler returns a non-success return code. If you
+ specify `-pass-exit-codes', the `gcc' program will instead return
+ with numerically highest error produced by any phase that returned
+ an error indication. The C, C++, and Fortran frontends return 4,
+ if an internal compiler error is encountered.
+
+ If you only want some of the stages of compilation, you can use `-x'
+(or filename suffixes) to tell `gcc' where to start, and one of the
+options `-c', `-S', or `-E' to say where `gcc' is to stop. Note that
+some combinations (for example, `-x cpp-output -E') instruct `gcc' to
+do nothing at all.
+
+`-c'
+ Compile or assemble the source files, but do not link. The linking
+ stage simply is not done. The ultimate output is in the form of an
+ object file for each source file.
+
+ By default, the object file name for a source file is made by
+ replacing the suffix `.c', `.i', `.s', etc., with `.o'.
+
+ Unrecognized input files, not requiring compilation or assembly,
+ are ignored.
+
+`-S'
+ Stop after the stage of compilation proper; do not assemble. The
+ output is in the form of an assembler code file for each
+ non-assembler input file specified.
+
+ By default, the assembler file name for a source file is made by
+ replacing the suffix `.c', `.i', etc., with `.s'.
+
+ Input files that don't require compilation are ignored.
+
+`-E'
+ Stop after the preprocessing stage; do not run the compiler
+ proper. The output is in the form of preprocessed source code,
+ which is sent to the standard output.
+
+ Input files which don't require preprocessing are ignored.
+
+`-o FILE'
+ Place output in file FILE. This applies regardless to whatever
+ sort of output is being produced, whether it be an executable file,
+ an object file, an assembler file or preprocessed C code.
+
+ If `-o' is not specified, the default is to put an executable file
+ in `a.out', the object file for `SOURCE.SUFFIX' in `SOURCE.o', its
+ assembler file in `SOURCE.s', a precompiled header file in
+ `SOURCE.SUFFIX.gch', and all preprocessed C source on standard
+ output.
+
+`-v'
+ Print (on standard error output) the commands executed to run the
+ stages of compilation. Also print the version number of the
+ compiler driver program and of the preprocessor and the compiler
+ proper.
+
+`-###'
+ Like `-v' except the commands are not executed and all command
+ arguments are quoted. This is useful for shell scripts to capture
+ the driver-generated command lines.
+
+`-pipe'
+ Use pipes rather than temporary files for communication between the
+ various stages of compilation. This fails to work on some systems
+ where the assembler is unable to read from a pipe; but the GNU
+ assembler has no trouble.
+
+`-combine'
+ If you are compiling multiple source files, this option tells the
+ driver to pass all the source files to the compiler at once (for
+ those languages for which the compiler can handle this). This
+ will allow intermodule analysis (IMA) to be performed by the
+ compiler. Currently the only language for which this is supported
+ is C. If you pass source files for multiple languages to the
+ driver, using this option, the driver will invoke the compiler(s)
+ that support IMA once each, passing each compiler all the source
+ files appropriate for it. For those languages that do not support
+ IMA this option will be ignored, and the compiler will be invoked
+ once for each source file in that language. If you use this
+ option in conjunction with `-save-temps', the compiler will
+ generate multiple pre-processed files (one for each source file),
+ but only one (combined) `.o' or `.s' file.
+
+`--help'
+ Print (on the standard output) a description of the command line
+ options understood by `gcc'. If the `-v' option is also specified
+ then `--help' will also be passed on to the various processes
+ invoked by `gcc', so that they can display the command line options
+ they accept. If the `-Wextra' option has also been specified
+ (prior to the `--help' option), then command line options which
+ have no documentation associated with them will also be displayed.
+
+`--target-help'
+ Print (on the standard output) a description of target-specific
+ command line options for each tool. For some targets extra
+ target-specific information may also be printed.
+
+`--help={CLASS|[^]QUALIFIER}[,...]'
+ Print (on the standard output) a description of the command line
+ options understood by the compiler that fit into all specified
+ classes and qualifiers. These are the supported classes:
+
+ `optimizers'
+ This will display all of the optimization options supported
+ by the compiler.
+
+ `warnings'
+ This will display all of the options controlling warning
+ messages produced by the compiler.
+
+ `target'
+ This will display target-specific options. Unlike the
+ `--target-help' option however, target-specific options of the
+ linker and assembler will not be displayed. This is because
+ those tools do not currently support the extended `--help='
+ syntax.
+
+ `params'
+ This will display the values recognized by the `--param'
+ option.
+
+ LANGUAGE
+ This will display the options supported for LANGUAGE, where
+ LANGUAGE is the name of one of the languages supported in this
+ version of GCC.
+
+ `common'
+ This will display the options that are common to all
+ languages.
+
+ These are the supported qualifiers:
+
+ `undocumented'
+ Display only those options which are undocumented.
+
+ `joined'
+ Display options which take an argument that appears after an
+ equal sign in the same continuous piece of text, such as:
+ `--help=target'.
+
+ `separate'
+ Display options which take an argument that appears as a
+ separate word following the original option, such as: `-o
+ output-file'.
+
+ Thus for example to display all the undocumented target-specific
+ switches supported by the compiler the following can be used:
+
+ --help=target,undocumented
+
+ The sense of a qualifier can be inverted by prefixing it with the
+ `^' character, so for example to display all binary warning
+ options (i.e., ones that are either on or off and that do not take
+ an argument), which have a description the following can be used:
+
+ --help=warnings,^joined,^undocumented
+
+ The argument to `--help=' should not consist solely of inverted
+ qualifiers.
+
+ Combining several classes is possible, although this usually
+ restricts the output by so much that there is nothing to display.
+ One case where it does work however is when one of the classes is
+ TARGET. So for example to display all the target-specific
+ optimization options the following can be used:
+
+ --help=target,optimizers
+
+ The `--help=' option can be repeated on the command line. Each
+ successive use will display its requested class of options,
+ skipping those that have already been displayed.
+
+ If the `-Q' option appears on the command line before the
+ `--help=' option, then the descriptive text displayed by `--help='
+ is changed. Instead of describing the displayed options, an
+ indication is given as to whether the option is enabled, disabled
+ or set to a specific value (assuming that the compiler knows this
+ at the point where the `--help=' option is used).
+
+ Here is a truncated example from the ARM port of `gcc':
+
+ % gcc -Q -mabi=2 --help=target -c
+ The following options are target specific:
+ -mabi= 2
+ -mabort-on-noreturn [disabled]
+ -mapcs [disabled]
+
+ The output is sensitive to the effects of previous command line
+ options, so for example it is possible to find out which
+ optimizations are enabled at `-O2' by using:
+
+ -Q -O2 --help=optimizers
+
+ Alternatively you can discover which binary optimizations are
+ enabled by `-O3' by using:
+
+ gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
+ gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
+ diff /tmp/O2-opts /tmp/O3-opts | grep enabled
+
+`--version'
+ Display the version number and copyrights of the invoked GCC.
+
+`-wrapper'
+ Invoke all subcommands under a wrapper program. It takes a single
+ comma separated list as an argument, which will be used to invoke
+ the wrapper:
+
+ gcc -c t.c -wrapper gdb,--args
+
+ This will invoke all subprograms of gcc under "gdb -args", thus
+ cc1 invocation will be "gdb -args cc1 ...".
+
+`@FILE'
+ Read command-line options from FILE. The options read are
+ inserted in place of the original @FILE option. If FILE does not
+ exist, or cannot be read, then the option will be treated
+ literally, and not removed.
+
+ Options in FILE are separated by whitespace. A whitespace
+ character may be included in an option by surrounding the entire
+ option in either single or double quotes. Any character
+ (including a backslash) may be included by prefixing the character
+ to be included with a backslash. The FILE may itself contain
+ additional @FILE options; any such options will be processed
+ recursively.
+
+
+File: gcc.info, Node: Invoking G++, Next: C Dialect Options, Prev: Overall Options, Up: Invoking GCC
+
+3.3 Compiling C++ Programs
+==========================
+
+C++ source files conventionally use one of the suffixes `.C', `.cc',
+`.cpp', `.CPP', `.c++', `.cp', or `.cxx'; C++ header files often use
+`.hh', `.hpp', `.H', or (for shared template code) `.tcc'; and
+preprocessed C++ files use the suffix `.ii'. GCC recognizes files with
+these names and compiles them as C++ programs even if you call the
+compiler the same way as for compiling C programs (usually with the
+name `gcc').
+
+ However, the use of `gcc' does not add the C++ library. `g++' is a
+program that calls GCC and treats `.c', `.h' and `.i' files as C++
+source files instead of C source files unless `-x' is used, and
+automatically specifies linking against the C++ library. This program
+is also useful when precompiling a C header file with a `.h' extension
+for use in C++ compilations. On many systems, `g++' is also installed
+with the name `c++'.
+
+ When you compile C++ programs, you may specify many of the same
+command-line options that you use for compiling programs in any
+language; or command-line options meaningful for C and related
+languages; or options that are meaningful only for C++ programs. *Note
+Options Controlling C Dialect: C Dialect Options, for explanations of
+options for languages related to C. *Note Options Controlling C++
+Dialect: C++ Dialect Options, for explanations of options that are
+meaningful only for C++ programs.
+
+
+File: gcc.info, Node: C Dialect Options, Next: C++ Dialect Options, Prev: Invoking G++, Up: Invoking GCC
+
+3.4 Options Controlling C Dialect
+=================================
+
+The following options control the dialect of C (or languages derived
+from C, such as C++, Objective-C and Objective-C++) that the compiler
+accepts:
+
+`-ansi'
+ In C mode, this is equivalent to `-std=c89'. In C++ mode, it is
+ equivalent to `-std=c++98'.
+
+ This turns off certain features of GCC that are incompatible with
+ ISO C90 (when compiling C code), or of standard C++ (when
+ compiling C++ code), such as the `asm' and `typeof' keywords, and
+ predefined macros such as `unix' and `vax' that identify the type
+ of system you are using. It also enables the undesirable and
+ rarely used ISO trigraph feature. For the C compiler, it disables
+ recognition of C++ style `//' comments as well as the `inline'
+ keyword.
+
+ The alternate keywords `__asm__', `__extension__', `__inline__'
+ and `__typeof__' continue to work despite `-ansi'. You would not
+ want to use them in an ISO C program, of course, but it is useful
+ to put them in header files that might be included in compilations
+ done with `-ansi'. Alternate predefined macros such as `__unix__'
+ and `__vax__' are also available, with or without `-ansi'.
+
+ The `-ansi' option does not cause non-ISO programs to be rejected
+ gratuitously. For that, `-pedantic' is required in addition to
+ `-ansi'. *Note Warning Options::.
+
+ The macro `__STRICT_ANSI__' is predefined when the `-ansi' option
+ is used. Some header files may notice this macro and refrain from
+ declaring certain functions or defining certain macros that the
+ ISO standard doesn't call for; this is to avoid interfering with
+ any programs that might use these names for other things.
+
+ Functions that would normally be built in but do not have semantics
+ defined by ISO C (such as `alloca' and `ffs') are not built-in
+ functions when `-ansi' is used. *Note Other built-in functions
+ provided by GCC: Other Builtins, for details of the functions
+ affected.
+
+`-std='
+ Determine the language standard. *Note Language Standards
+ Supported by GCC: Standards, for details of these standard
+ versions. This option is currently only supported when compiling
+ C or C++.
+
+ The compiler can accept several base standards, such as `c89' or
+ `c++98', and GNU dialects of those standards, such as `gnu89' or
+ `gnu++98'. By specifying a base standard, the compiler will
+ accept all programs following that standard and those using GNU
+ extensions that do not contradict it. For example, `-std=c89'
+ turns off certain features of GCC that are incompatible with ISO
+ C90, such as the `asm' and `typeof' keywords, but not other GNU
+ extensions that do not have a meaning in ISO C90, such as omitting
+ the middle term of a `?:' expression. On the other hand, by
+ specifying a GNU dialect of a standard, all features the compiler
+ support are enabled, even when those features change the meaning
+ of the base standard and some strict-conforming programs may be
+ rejected. The particular standard is used by `-pedantic' to
+ identify which features are GNU extensions given that version of
+ the standard. For example `-std=gnu89 -pedantic' would warn about
+ C++ style `//' comments, while `-std=gnu99 -pedantic' would not.
+
+ A value for this option must be provided; possible values are
+
+ `c89'
+ `iso9899:1990'
+ Support all ISO C90 programs (certain GNU extensions that
+ conflict with ISO C90 are disabled). Same as `-ansi' for C
+ code.
+
+ `iso9899:199409'
+ ISO C90 as modified in amendment 1.
+
+ `c99'
+ `c9x'
+ `iso9899:1999'
+ `iso9899:199x'
+ ISO C99. Note that this standard is not yet fully supported;
+ see `http://gcc.gnu.org/gcc-4.4/c99status.html' for more
+ information. The names `c9x' and `iso9899:199x' are
+ deprecated.
+
+ `gnu89'
+ GNU dialect of ISO C90 (including some C99 features). This is
+ the default for C code.
+
+ `gnu99'
+ `gnu9x'
+ GNU dialect of ISO C99. When ISO C99 is fully implemented in
+ GCC, this will become the default. The name `gnu9x' is
+ deprecated.
+
+ `c++98'
+ The 1998 ISO C++ standard plus amendments. Same as `-ansi' for
+ C++ code.
+
+ `gnu++98'
+ GNU dialect of `-std=c++98'. This is the default for C++
+ code.
+
+ `c++0x'
+ The working draft of the upcoming ISO C++0x standard. This
+ option enables experimental features that are likely to be
+ included in C++0x. The working draft is constantly changing,
+ and any feature that is enabled by this flag may be removed
+ from future versions of GCC if it is not part of the C++0x
+ standard.
+
+ `gnu++0x'
+ GNU dialect of `-std=c++0x'. This option enables experimental
+ features that may be removed in future versions of GCC.
+
+`-fgnu89-inline'
+ The option `-fgnu89-inline' tells GCC to use the traditional GNU
+ semantics for `inline' functions when in C99 mode. *Note An
+ Inline Function is As Fast As a Macro: Inline. This option is
+ accepted and ignored by GCC versions 4.1.3 up to but not including
+ 4.3. In GCC versions 4.3 and later it changes the behavior of GCC
+ in C99 mode. Using this option is roughly equivalent to adding the
+ `gnu_inline' function attribute to all inline functions (*note
+ Function Attributes::).
+
+ The option `-fno-gnu89-inline' explicitly tells GCC to use the C99
+ semantics for `inline' when in C99 or gnu99 mode (i.e., it
+ specifies the default behavior). This option was first supported
+ in GCC 4.3. This option is not supported in C89 or gnu89 mode.
+
+ The preprocessor macros `__GNUC_GNU_INLINE__' and
+ `__GNUC_STDC_INLINE__' may be used to check which semantics are in
+ effect for `inline' functions. *Note Common Predefined Macros:
+ (cpp)Common Predefined Macros.
+
+`-aux-info FILENAME'
+ Output to the given filename prototyped declarations for all
+ functions declared and/or defined in a translation unit, including
+ those in header files. This option is silently ignored in any
+ language other than C.
+
+ Besides declarations, the file indicates, in comments, the origin
+ of each declaration (source file and line), whether the
+ declaration was implicit, prototyped or unprototyped (`I', `N' for
+ new or `O' for old, respectively, in the first character after the
+ line number and the colon), and whether it came from a declaration
+ or a definition (`C' or `F', respectively, in the following
+ character). In the case of function definitions, a K&R-style list
+ of arguments followed by their declarations is also provided,
+ inside comments, after the declaration.
+
+`-fno-asm'
+ Do not recognize `asm', `inline' or `typeof' as a keyword, so that
+ code can use these words as identifiers. You can use the keywords
+ `__asm__', `__inline__' and `__typeof__' instead. `-ansi' implies
+ `-fno-asm'.
+
+ In C++, this switch only affects the `typeof' keyword, since `asm'
+ and `inline' are standard keywords. You may want to use the
+ `-fno-gnu-keywords' flag instead, which has the same effect. In
+ C99 mode (`-std=c99' or `-std=gnu99'), this switch only affects
+ the `asm' and `typeof' keywords, since `inline' is a standard
+ keyword in ISO C99.
+
+`-fno-builtin'
+`-fno-builtin-FUNCTION'
+ Don't recognize built-in functions that do not begin with
+ `__builtin_' as prefix. *Note Other built-in functions provided
+ by GCC: Other Builtins, for details of the functions affected,
+ including those which are not built-in functions when `-ansi' or
+ `-std' options for strict ISO C conformance are used because they
+ do not have an ISO standard meaning.
+
+ GCC normally generates special code to handle certain built-in
+ functions more efficiently; for instance, calls to `alloca' may
+ become single instructions that adjust the stack directly, and
+ calls to `memcpy' may become inline copy loops. The resulting
+ code is often both smaller and faster, but since the function
+ calls no longer appear as such, you cannot set a breakpoint on
+ those calls, nor can you change the behavior of the functions by
+ linking with a different library. In addition, when a function is
+ recognized as a built-in function, GCC may use information about
+ that function to warn about problems with calls to that function,
+ or to generate more efficient code, even if the resulting code
+ still contains calls to that function. For example, warnings are
+ given with `-Wformat' for bad calls to `printf', when `printf' is
+ built in, and `strlen' is known not to modify global memory.
+
+ With the `-fno-builtin-FUNCTION' option only the built-in function
+ FUNCTION is disabled. FUNCTION must not begin with `__builtin_'.
+ If a function is named that is not built-in in this version of
+ GCC, this option is ignored. There is no corresponding
+ `-fbuiltin-FUNCTION' option; if you wish to enable built-in
+ functions selectively when using `-fno-builtin' or
+ `-ffreestanding', you may define macros such as:
+
+ #define abs(n) __builtin_abs ((n))
+ #define strcpy(d, s) __builtin_strcpy ((d), (s))
+
+`-fhosted'
+ Assert that compilation takes place in a hosted environment. This
+ implies `-fbuiltin'. A hosted environment is one in which the
+ entire standard library is available, and in which `main' has a
+ return type of `int'. Examples are nearly everything except a
+ kernel. This is equivalent to `-fno-freestanding'.
+
+`-ffreestanding'
+ Assert that compilation takes place in a freestanding environment.
+ This implies `-fno-builtin'. A freestanding environment is one
+ in which the standard library may not exist, and program startup
+ may not necessarily be at `main'. The most obvious example is an
+ OS kernel. This is equivalent to `-fno-hosted'.
+
+ *Note Language Standards Supported by GCC: Standards, for details
+ of freestanding and hosted environments.
+
+`-fopenmp'
+ Enable handling of OpenMP directives `#pragma omp' in C/C++ and
+ `!$omp' in Fortran. When `-fopenmp' is specified, the compiler
+ generates parallel code according to the OpenMP Application
+ Program Interface v2.5 `http://www.openmp.org/'. This option
+ implies `-pthread', and thus is only supported on targets that
+ have support for `-pthread'.
+
+`-fms-extensions'
+ Accept some non-standard constructs used in Microsoft header files.
+
+ Some cases of unnamed fields in structures and unions are only
+ accepted with this option. *Note Unnamed struct/union fields
+ within structs/unions: Unnamed Fields, for details.
+
+`-trigraphs'
+ Support ISO C trigraphs. The `-ansi' option (and `-std' options
+ for strict ISO C conformance) implies `-trigraphs'.
+
+`-no-integrated-cpp'
+ Performs a compilation in two passes: preprocessing and compiling.
+ This option allows a user supplied "cc1", "cc1plus", or "cc1obj"
+ via the `-B' option. The user supplied compilation step can then
+ add in an additional preprocessing step after normal preprocessing
+ but before compiling. The default is to use the integrated cpp
+ (internal cpp)
+
+ The semantics of this option will change if "cc1", "cc1plus", and
+ "cc1obj" are merged.
+
+`-traditional'
+`-traditional-cpp'
+ Formerly, these options caused GCC to attempt to emulate a
+ pre-standard C compiler. They are now only supported with the
+ `-E' switch. The preprocessor continues to support a pre-standard
+ mode. See the GNU CPP manual for details.
+
+`-fcond-mismatch'
+ Allow conditional expressions with mismatched types in the second
+ and third arguments. The value of such an expression is void.
+ This option is not supported for C++.
+
+`-flax-vector-conversions'
+ Allow implicit conversions between vectors with differing numbers
+ of elements and/or incompatible element types. This option should
+ not be used for new code.
+
+`-funsigned-char'
+ Let the type `char' be unsigned, like `unsigned char'.
+
+ Each kind of machine has a default for what `char' should be. It
+ is either like `unsigned char' by default or like `signed char' by
+ default.
+
+ Ideally, a portable program should always use `signed char' or
+ `unsigned char' when it depends on the signedness of an object.
+ But many programs have been written to use plain `char' and expect
+ it to be signed, or expect it to be unsigned, depending on the
+ machines they were written for. This option, and its inverse, let
+ you make such a program work with the opposite default.
+
+ The type `char' is always a distinct type from each of `signed
+ char' or `unsigned char', even though its behavior is always just
+ like one of those two.
+
+`-fsigned-char'
+ Let the type `char' be signed, like `signed char'.
+
+ Note that this is equivalent to `-fno-unsigned-char', which is the
+ negative form of `-funsigned-char'. Likewise, the option
+ `-fno-signed-char' is equivalent to `-funsigned-char'.
+
+`-fsigned-bitfields'
+`-funsigned-bitfields'
+`-fno-signed-bitfields'
+`-fno-unsigned-bitfields'
+ These options control whether a bit-field is signed or unsigned,
+ when the declaration does not use either `signed' or `unsigned'.
+ By default, such a bit-field is signed, because this is
+ consistent: the basic integer types such as `int' are signed types.
+
+
+File: gcc.info, Node: C++ Dialect Options, Next: Objective-C and Objective-C++ Dialect Options, Prev: C Dialect Options, Up: Invoking GCC
+
+3.5 Options Controlling C++ Dialect
+===================================
+
+This section describes the command-line options that are only meaningful
+for C++ programs; but you can also use most of the GNU compiler options
+regardless of what language your program is in. For example, you might
+compile a file `firstClass.C' like this:
+
+ g++ -g -frepo -O -c firstClass.C
+
+In this example, only `-frepo' is an option meant only for C++
+programs; you can use the other options with any language supported by
+GCC.
+
+ Here is a list of options that are _only_ for compiling C++ programs:
+
+`-fabi-version=N'
+ Use version N of the C++ ABI. Version 2 is the version of the C++
+ ABI that first appeared in G++ 3.4. Version 1 is the version of
+ the C++ ABI that first appeared in G++ 3.2. Version 0 will always
+ be the version that conforms most closely to the C++ ABI
+ specification. Therefore, the ABI obtained using version 0 will
+ change as ABI bugs are fixed.
+
+ The default is version 2.
+
+`-fno-access-control'
+ Turn off all access checking. This switch is mainly useful for
+ working around bugs in the access control code.
+
+`-fcheck-new'
+ Check that the pointer returned by `operator new' is non-null
+ before attempting to modify the storage allocated. This check is
+ normally unnecessary because the C++ standard specifies that
+ `operator new' will only return `0' if it is declared `throw()',
+ in which case the compiler will always check the return value even
+ without this option. In all other cases, when `operator new' has
+ a non-empty exception specification, memory exhaustion is
+ signalled by throwing `std::bad_alloc'. See also `new (nothrow)'.
+
+`-fconserve-space'
+ Put uninitialized or runtime-initialized global variables into the
+ common segment, as C does. This saves space in the executable at
+ the cost of not diagnosing duplicate definitions. If you compile
+ with this flag and your program mysteriously crashes after
+ `main()' has completed, you may have an object that is being
+ destroyed twice because two definitions were merged.
+
+ This option is no longer useful on most targets, now that support
+ has been added for putting variables into BSS without making them
+ common.
+
+`-fno-deduce-init-list'
+ Disable deduction of a template type parameter as
+ std::initializer_list from a brace-enclosed initializer list, i.e.
+
+ template <class T> auto forward(T t) -> decltype (realfn (t))
+ {
+ return realfn (t);
+ }
+
+ void f()
+ {
+ forward({1,2}); // call forward<std::initializer_list<int>>
+ }
+
+ This option is present because this deduction is an extension to
+ the current specification in the C++0x working draft, and there was
+ some concern about potential overload resolution problems.
+
+`-ffriend-injection'
+ Inject friend functions into the enclosing namespace, so that they
+ are visible outside the scope of the class in which they are
+ declared. Friend functions were documented to work this way in
+ the old Annotated C++ Reference Manual, and versions of G++ before
+ 4.1 always worked that way. However, in ISO C++ a friend function
+ which is not declared in an enclosing scope can only be found
+ using argument dependent lookup. This option causes friends to be
+ injected as they were in earlier releases.
+
+ This option is for compatibility, and may be removed in a future
+ release of G++.
+
+`-fno-elide-constructors'
+ The C++ standard allows an implementation to omit creating a
+ temporary which is only used to initialize another object of the
+ same type. Specifying this option disables that optimization, and
+ forces G++ to call the copy constructor in all cases.
+
+`-fno-enforce-eh-specs'
+ Don't generate code to check for violation of exception
+ specifications at runtime. This option violates the C++ standard,
+ but may be useful for reducing code size in production builds,
+ much like defining `NDEBUG'. This does not give user code
+ permission to throw exceptions in violation of the exception
+ specifications; the compiler will still optimize based on the
+ specifications, so throwing an unexpected exception will result in
+ undefined behavior.
+
+`-ffor-scope'
+`-fno-for-scope'
+ If `-ffor-scope' is specified, the scope of variables declared in
+ a for-init-statement is limited to the `for' loop itself, as
+ specified by the C++ standard. If `-fno-for-scope' is specified,
+ the scope of variables declared in a for-init-statement extends to
+ the end of the enclosing scope, as was the case in old versions of
+ G++, and other (traditional) implementations of C++.
+
+ The default if neither flag is given to follow the standard, but
+ to allow and give a warning for old-style code that would
+ otherwise be invalid, or have different behavior.
+
+`-fno-gnu-keywords'
+ Do not recognize `typeof' as a keyword, so that code can use this
+ word as an identifier. You can use the keyword `__typeof__'
+ instead. `-ansi' implies `-fno-gnu-keywords'.
+
+`-fno-implicit-templates'
+ Never emit code for non-inline templates which are instantiated
+ implicitly (i.e. by use); only emit code for explicit
+ instantiations. *Note Template Instantiation::, for more
+ information.
+
+`-fno-implicit-inline-templates'
+ Don't emit code for implicit instantiations of inline templates,
+ either. The default is to handle inlines differently so that
+ compiles with and without optimization will need the same set of
+ explicit instantiations.
+
+`-fno-implement-inlines'
+ To save space, do not emit out-of-line copies of inline functions
+ controlled by `#pragma implementation'. This will cause linker
+ errors if these functions are not inlined everywhere they are
+ called.
+
+`-fms-extensions'
+ Disable pedantic warnings about constructs used in MFC, such as
+ implicit int and getting a pointer to member function via
+ non-standard syntax.
+
+`-fno-nonansi-builtins'
+ Disable built-in declarations of functions that are not mandated by
+ ANSI/ISO C. These include `ffs', `alloca', `_exit', `index',
+ `bzero', `conjf', and other related functions.
+
+`-fno-operator-names'
+ Do not treat the operator name keywords `and', `bitand', `bitor',
+ `compl', `not', `or' and `xor' as synonyms as keywords.
+
+`-fno-optional-diags'
+ Disable diagnostics that the standard says a compiler does not
+ need to issue. Currently, the only such diagnostic issued by G++
+ is the one for a name having multiple meanings within a class.
+
+`-fpermissive'
+ Downgrade some diagnostics about nonconformant code from errors to
+ warnings. Thus, using `-fpermissive' will allow some
+ nonconforming code to compile.
+
+`-frepo'
+ Enable automatic template instantiation at link time. This option
+ also implies `-fno-implicit-templates'. *Note Template
+ Instantiation::, for more information.
+
+`-fno-rtti'
+ Disable generation of information about every class with virtual
+ functions for use by the C++ runtime type identification features
+ (`dynamic_cast' and `typeid'). If you don't use those parts of
+ the language, you can save some space by using this flag. Note
+ that exception handling uses the same information, but it will
+ generate it as needed. The `dynamic_cast' operator can still be
+ used for casts that do not require runtime type information, i.e.
+ casts to `void *' or to unambiguous base classes.
+
+`-fstats'
+ Emit statistics about front-end processing at the end of the
+ compilation. This information is generally only useful to the G++
+ development team.
+
+`-ftemplate-depth-N'
+ Set the maximum instantiation depth for template classes to N. A
+ limit on the template instantiation depth is needed to detect
+ endless recursions during template class instantiation. ANSI/ISO
+ C++ conforming programs must not rely on a maximum depth greater
+ than 17.
+
+`-fno-threadsafe-statics'
+ Do not emit the extra code to use the routines specified in the C++
+ ABI for thread-safe initialization of local statics. You can use
+ this option to reduce code size slightly in code that doesn't need
+ to be thread-safe.
+
+`-fuse-cxa-atexit'
+ Register destructors for objects with static storage duration with
+ the `__cxa_atexit' function rather than the `atexit' function.
+ This option is required for fully standards-compliant handling of
+ static destructors, but will only work if your C library supports
+ `__cxa_atexit'.
+
+`-fno-use-cxa-get-exception-ptr'
+ Don't use the `__cxa_get_exception_ptr' runtime routine. This
+ will cause `std::uncaught_exception' to be incorrect, but is
+ necessary if the runtime routine is not available.
+
+`-fvisibility-inlines-hidden'
+ This switch declares that the user does not attempt to compare
+ pointers to inline methods where the addresses of the two functions
+ were taken in different shared objects.
+
+ The effect of this is that GCC may, effectively, mark inline
+ methods with `__attribute__ ((visibility ("hidden")))' so that
+ they do not appear in the export table of a DSO and do not require
+ a PLT indirection when used within the DSO. Enabling this option
+ can have a dramatic effect on load and link times of a DSO as it
+ massively reduces the size of the dynamic export table when the
+ library makes heavy use of templates.
+
+ The behavior of this switch is not quite the same as marking the
+ methods as hidden directly, because it does not affect static
+ variables local to the function or cause the compiler to deduce
+ that the function is defined in only one shared object.
+
+ You may mark a method as having a visibility explicitly to negate
+ the effect of the switch for that method. For example, if you do
+ want to compare pointers to a particular inline method, you might
+ mark it as having default visibility. Marking the enclosing class
+ with explicit visibility will have no effect.
+
+ Explicitly instantiated inline methods are unaffected by this
+ option as their linkage might otherwise cross a shared library
+ boundary. *Note Template Instantiation::.
+
+`-fvisibility-ms-compat'
+ This flag attempts to use visibility settings to make GCC's C++
+ linkage model compatible with that of Microsoft Visual Studio.
+
+ The flag makes these changes to GCC's linkage model:
+
+ 1. It sets the default visibility to `hidden', like
+ `-fvisibility=hidden'.
+
+ 2. Types, but not their members, are not hidden by default.
+
+ 3. The One Definition Rule is relaxed for types without explicit
+ visibility specifications which are defined in more than one
+ different shared object: those declarations are permitted if
+ they would have been permitted when this option was not used.
+
+ In new code it is better to use `-fvisibility=hidden' and export
+ those classes which are intended to be externally visible.
+ Unfortunately it is possible for code to rely, perhaps
+ accidentally, on the Visual Studio behavior.
+
+ Among the consequences of these changes are that static data
+ members of the same type with the same name but defined in
+ different shared objects will be different, so changing one will
+ not change the other; and that pointers to function members
+ defined in different shared objects may not compare equal. When
+ this flag is given, it is a violation of the ODR to define types
+ with the same name differently.
+
+`-fno-weak'
+ Do not use weak symbol support, even if it is provided by the
+ linker. By default, G++ will use weak symbols if they are
+ available. This option exists only for testing, and should not be
+ used by end-users; it will result in inferior code and has no
+ benefits. This option may be removed in a future release of G++.
+
+`-nostdinc++'
+ Do not search for header files in the standard directories
+ specific to C++, but do still search the other standard
+ directories. (This option is used when building the C++ library.)
+
+ In addition, these optimization, warning, and code generation options
+have meanings only for C++ programs:
+
+`-fno-default-inline'
+ Do not assume `inline' for functions defined inside a class scope.
+ *Note Options That Control Optimization: Optimize Options. Note
+ that these functions will have linkage like inline functions; they
+ just won't be inlined by default.
+
+`-Wabi (C, Objective-C, C++ and Objective-C++ only)'
+ Warn when G++ generates code that is probably not compatible with
+ the vendor-neutral C++ ABI. Although an effort has been made to
+ warn about all such cases, there are probably some cases that are
+ not warned about, even though G++ is generating incompatible code.
+ There may also be cases where warnings are emitted even though
+ the code that is generated will be compatible.
+
+ You should rewrite your code to avoid these warnings if you are
+ concerned about the fact that code generated by G++ may not be
+ binary compatible with code generated by other compilers.
+
+ The known incompatibilities at this point include:
+
+ * Incorrect handling of tail-padding for bit-fields. G++ may
+ attempt to pack data into the same byte as a base class. For
+ example:
+
+ struct A { virtual void f(); int f1 : 1; };
+ struct B : public A { int f2 : 1; };
+
+ In this case, G++ will place `B::f2' into the same byte
+ as`A::f1'; other compilers will not. You can avoid this
+ problem by explicitly padding `A' so that its size is a
+ multiple of the byte size on your platform; that will cause
+ G++ and other compilers to layout `B' identically.
+
+ * Incorrect handling of tail-padding for virtual bases. G++
+ does not use tail padding when laying out virtual bases. For
+ example:
+
+ struct A { virtual void f(); char c1; };
+ struct B { B(); char c2; };
+ struct C : public A, public virtual B {};
+
+ In this case, G++ will not place `B' into the tail-padding for
+ `A'; other compilers will. You can avoid this problem by
+ explicitly padding `A' so that its size is a multiple of its
+ alignment (ignoring virtual base classes); that will cause
+ G++ and other compilers to layout `C' identically.
+
+ * Incorrect handling of bit-fields with declared widths greater
+ than that of their underlying types, when the bit-fields
+ appear in a union. For example:
+
+ union U { int i : 4096; };
+
+ Assuming that an `int' does not have 4096 bits, G++ will make
+ the union too small by the number of bits in an `int'.
+
+ * Empty classes can be placed at incorrect offsets. For
+ example:
+
+ struct A {};
+
+ struct B {
+ A a;
+ virtual void f ();
+ };
+
+ struct C : public B, public A {};
+
+ G++ will place the `A' base class of `C' at a nonzero offset;
+ it should be placed at offset zero. G++ mistakenly believes
+ that the `A' data member of `B' is already at offset zero.
+
+ * Names of template functions whose types involve `typename' or
+ template template parameters can be mangled incorrectly.
+
+ template <typename Q>
+ void f(typename Q::X) {}
+
+ template <template <typename> class Q>
+ void f(typename Q<int>::X) {}
+
+ Instantiations of these templates may be mangled incorrectly.
+
+
+ It also warns psABI related changes. The known psABI changes at
+ this point include:
+
+ * For SYSV/x86-64, when passing union with long double, it is
+ changed to pass in memory as specified in psABI. For example:
+
+ union U {
+ long double ld;
+ int i;
+ };
+
+ `union U' will always be passed in memory.
+
+
+`-Wctor-dtor-privacy (C++ and Objective-C++ only)'
+ Warn when a class seems unusable because all the constructors or
+ destructors in that class are private, and it has neither friends
+ nor public static member functions.
+
+`-Wnon-virtual-dtor (C++ and Objective-C++ only)'
+ Warn when a class has virtual functions and accessible non-virtual
+ destructor, in which case it would be possible but unsafe to delete
+ an instance of a derived class through a pointer to the base class.
+ This warning is also enabled if -Weffc++ is specified.
+
+`-Wreorder (C++ and Objective-C++ only)'
+ Warn when the order of member initializers given in the code does
+ not match the order in which they must be executed. For instance:
+
+ struct A {
+ int i;
+ int j;
+ A(): j (0), i (1) { }
+ };
+
+ The compiler will rearrange the member initializers for `i' and
+ `j' to match the declaration order of the members, emitting a
+ warning to that effect. This warning is enabled by `-Wall'.
+
+ The following `-W...' options are not affected by `-Wall'.
+
+`-Weffc++ (C++ and Objective-C++ only)'
+ Warn about violations of the following style guidelines from Scott
+ Meyers' `Effective C++' book:
+
+ * Item 11: Define a copy constructor and an assignment
+ operator for classes with dynamically allocated memory.
+
+ * Item 12: Prefer initialization to assignment in constructors.
+
+ * Item 14: Make destructors virtual in base classes.
+
+ * Item 15: Have `operator=' return a reference to `*this'.
+
+ * Item 23: Don't try to return a reference when you must
+ return an object.
+
+
+ Also warn about violations of the following style guidelines from
+ Scott Meyers' `More Effective C++' book:
+
+ * Item 6: Distinguish between prefix and postfix forms of
+ increment and decrement operators.
+
+ * Item 7: Never overload `&&', `||', or `,'.
+
+
+ When selecting this option, be aware that the standard library
+ headers do not obey all of these guidelines; use `grep -v' to
+ filter out those warnings.
+
+`-Wstrict-null-sentinel (C++ and Objective-C++ only)'
+ Warn also about the use of an uncasted `NULL' as sentinel. When
+ compiling only with GCC this is a valid sentinel, as `NULL' is
+ defined to `__null'. Although it is a null pointer constant not a
+ null pointer, it is guaranteed to be of the same size as a
+ pointer. But this use is not portable across different compilers.
+
+`-Wno-non-template-friend (C++ and Objective-C++ only)'
+ Disable warnings when non-templatized friend functions are declared
+ within a template. Since the advent of explicit template
+ specification support in G++, if the name of the friend is an
+ unqualified-id (i.e., `friend foo(int)'), the C++ language
+ specification demands that the friend declare or define an
+ ordinary, nontemplate function. (Section 14.5.3). Before G++
+ implemented explicit specification, unqualified-ids could be
+ interpreted as a particular specialization of a templatized
+ function. Because this non-conforming behavior is no longer the
+ default behavior for G++, `-Wnon-template-friend' allows the
+ compiler to check existing code for potential trouble spots and is
+ on by default. This new compiler behavior can be turned off with
+ `-Wno-non-template-friend' which keeps the conformant compiler code
+ but disables the helpful warning.
+
+`-Wold-style-cast (C++ and Objective-C++ only)'
+ Warn if an old-style (C-style) cast to a non-void type is used
+ within a C++ program. The new-style casts (`dynamic_cast',
+ `static_cast', `reinterpret_cast', and `const_cast') are less
+ vulnerable to unintended effects and much easier to search for.
+
+`-Woverloaded-virtual (C++ and Objective-C++ only)'
+ Warn when a function declaration hides virtual functions from a
+ base class. For example, in:
+
+ struct A {
+ virtual void f();
+ };
+
+ struct B: public A {
+ void f(int);
+ };
+
+ the `A' class version of `f' is hidden in `B', and code like:
+
+ B* b;
+ b->f();
+
+ will fail to compile.
+
+`-Wno-pmf-conversions (C++ and Objective-C++ only)'
+ Disable the diagnostic for converting a bound pointer to member
+ function to a plain pointer.
+
+`-Wsign-promo (C++ and Objective-C++ only)'
+ Warn when overload resolution chooses a promotion from unsigned or
+ enumerated type to a signed type, over a conversion to an unsigned
+ type of the same size. Previous versions of G++ would try to
+ preserve unsignedness, but the standard mandates the current
+ behavior.
+
+ struct A {
+ operator int ();
+ A& operator = (int);
+ };
+
+ main ()
+ {
+ A a,b;
+ a = b;
+ }
+
+ In this example, G++ will synthesize a default `A& operator =
+ (const A&);', while cfront will use the user-defined `operator ='.
+
+
+File: gcc.info, Node: Objective-C and Objective-C++ Dialect Options, Next: Language Independent Options, Prev: C++ Dialect Options, Up: Invoking GCC
+
+3.6 Options Controlling Objective-C and Objective-C++ Dialects
+==============================================================
+
+(NOTE: This manual does not describe the Objective-C and Objective-C++
+languages themselves. See *Note Language Standards Supported by GCC:
+Standards, for references.)
+
+ This section describes the command-line options that are only
+meaningful for Objective-C and Objective-C++ programs, but you can also
+use most of the language-independent GNU compiler options. For
+example, you might compile a file `some_class.m' like this:
+
+ gcc -g -fgnu-runtime -O -c some_class.m
+
+In this example, `-fgnu-runtime' is an option meant only for
+Objective-C and Objective-C++ programs; you can use the other options
+with any language supported by GCC.
+
+ Note that since Objective-C is an extension of the C language,
+Objective-C compilations may also use options specific to the C
+front-end (e.g., `-Wtraditional'). Similarly, Objective-C++
+compilations may use C++-specific options (e.g., `-Wabi').
+
+ Here is a list of options that are _only_ for compiling Objective-C
+and Objective-C++ programs:
+
+`-fconstant-string-class=CLASS-NAME'
+ Use CLASS-NAME as the name of the class to instantiate for each
+ literal string specified with the syntax `@"..."'. The default
+ class name is `NXConstantString' if the GNU runtime is being used,
+ and `NSConstantString' if the NeXT runtime is being used (see
+ below). The `-fconstant-cfstrings' option, if also present, will
+ override the `-fconstant-string-class' setting and cause `@"..."'
+ literals to be laid out as constant CoreFoundation strings.
+
+`-fgnu-runtime'
+ Generate object code compatible with the standard GNU Objective-C
+ runtime. This is the default for most types of systems.
+
+`-fnext-runtime'
+ Generate output compatible with the NeXT runtime. This is the
+ default for NeXT-based systems, including Darwin and Mac OS X.
+ The macro `__NEXT_RUNTIME__' is predefined if (and only if) this
+ option is used.
+
+`-fno-nil-receivers'
+ Assume that all Objective-C message dispatches (e.g., `[receiver
+ message:arg]') in this translation unit ensure that the receiver
+ is not `nil'. This allows for more efficient entry points in the
+ runtime to be used. Currently, this option is only available in
+ conjunction with the NeXT runtime on Mac OS X 10.3 and later.
+
+`-fobjc-call-cxx-cdtors'
+ For each Objective-C class, check if any of its instance variables
+ is a C++ object with a non-trivial default constructor. If so,
+ synthesize a special `- (id) .cxx_construct' instance method that
+ will run non-trivial default constructors on any such instance
+ variables, in order, and then return `self'. Similarly, check if
+ any instance variable is a C++ object with a non-trivial
+ destructor, and if so, synthesize a special `- (void)
+ .cxx_destruct' method that will run all such default destructors,
+ in reverse order.
+
+ The `- (id) .cxx_construct' and/or `- (void) .cxx_destruct' methods
+ thusly generated will only operate on instance variables declared
+ in the current Objective-C class, and not those inherited from
+ superclasses. It is the responsibility of the Objective-C runtime
+ to invoke all such methods in an object's inheritance hierarchy.
+ The `- (id) .cxx_construct' methods will be invoked by the runtime
+ immediately after a new object instance is allocated; the `-
+ (void) .cxx_destruct' methods will be invoked immediately before
+ the runtime deallocates an object instance.
+
+ As of this writing, only the NeXT runtime on Mac OS X 10.4 and
+ later has support for invoking the `- (id) .cxx_construct' and `-
+ (void) .cxx_destruct' methods.
+
+`-fobjc-direct-dispatch'
+ Allow fast jumps to the message dispatcher. On Darwin this is
+ accomplished via the comm page.
+
+`-fobjc-exceptions'
+ Enable syntactic support for structured exception handling in
+ Objective-C, similar to what is offered by C++ and Java. This
+ option is unavailable in conjunction with the NeXT runtime on Mac
+ OS X 10.2 and earlier.
+
+ @try {
+ ...
+ @throw expr;
+ ...
+ }
+ @catch (AnObjCClass *exc) {
+ ...
+ @throw expr;
+ ...
+ @throw;
+ ...
+ }
+ @catch (AnotherClass *exc) {
+ ...
+ }
+ @catch (id allOthers) {
+ ...
+ }
+ @finally {
+ ...
+ @throw expr;
+ ...
+ }
+
+ The `@throw' statement may appear anywhere in an Objective-C or
+ Objective-C++ program; when used inside of a `@catch' block, the
+ `@throw' may appear without an argument (as shown above), in which
+ case the object caught by the `@catch' will be rethrown.
+
+ Note that only (pointers to) Objective-C objects may be thrown and
+ caught using this scheme. When an object is thrown, it will be
+ caught by the nearest `@catch' clause capable of handling objects
+ of that type, analogously to how `catch' blocks work in C++ and
+ Java. A `@catch(id ...)' clause (as shown above) may also be
+ provided to catch any and all Objective-C exceptions not caught by
+ previous `@catch' clauses (if any).
+
+ The `@finally' clause, if present, will be executed upon exit from
+ the immediately preceding `@try ... @catch' section. This will
+ happen regardless of whether any exceptions are thrown, caught or
+ rethrown inside the `@try ... @catch' section, analogously to the
+ behavior of the `finally' clause in Java.
+
+ There are several caveats to using the new exception mechanism:
+
+ * Although currently designed to be binary compatible with
+ `NS_HANDLER'-style idioms provided by the `NSException'
+ class, the new exceptions can only be used on Mac OS X 10.3
+ (Panther) and later systems, due to additional functionality
+ needed in the (NeXT) Objective-C runtime.
+
+ * As mentioned above, the new exceptions do not support handling
+ types other than Objective-C objects. Furthermore, when
+ used from Objective-C++, the Objective-C exception model does
+ not interoperate with C++ exceptions at this time. This
+ means you cannot `@throw' an exception from Objective-C and
+ `catch' it in C++, or vice versa (i.e., `throw ... @catch').
+
+ The `-fobjc-exceptions' switch also enables the use of
+ synchronization blocks for thread-safe execution:
+
+ @synchronized (ObjCClass *guard) {
+ ...
+ }
+
+ Upon entering the `@synchronized' block, a thread of execution
+ shall first check whether a lock has been placed on the
+ corresponding `guard' object by another thread. If it has, the
+ current thread shall wait until the other thread relinquishes its
+ lock. Once `guard' becomes available, the current thread will
+ place its own lock on it, execute the code contained in the
+ `@synchronized' block, and finally relinquish the lock (thereby
+ making `guard' available to other threads).
+
+ Unlike Java, Objective-C does not allow for entire methods to be
+ marked `@synchronized'. Note that throwing exceptions out of
+ `@synchronized' blocks is allowed, and will cause the guarding
+ object to be unlocked properly.
+
+`-fobjc-gc'
+ Enable garbage collection (GC) in Objective-C and Objective-C++
+ programs.
+
+`-freplace-objc-classes'
+ Emit a special marker instructing `ld(1)' not to statically link in
+ the resulting object file, and allow `dyld(1)' to load it in at
+ run time instead. This is used in conjunction with the
+ Fix-and-Continue debugging mode, where the object file in question
+ may be recompiled and dynamically reloaded in the course of
+ program execution, without the need to restart the program itself.
+ Currently, Fix-and-Continue functionality is only available in
+ conjunction with the NeXT runtime on Mac OS X 10.3 and later.
+
+`-fzero-link'
+ When compiling for the NeXT runtime, the compiler ordinarily
+ replaces calls to `objc_getClass("...")' (when the name of the
+ class is known at compile time) with static class references that
+ get initialized at load time, which improves run-time performance.
+ Specifying the `-fzero-link' flag suppresses this behavior and
+ causes calls to `objc_getClass("...")' to be retained. This is
+ useful in Zero-Link debugging mode, since it allows for individual
+ class implementations to be modified during program execution.
+
+`-gen-decls'
+ Dump interface declarations for all classes seen in the source
+ file to a file named `SOURCENAME.decl'.
+
+`-Wassign-intercept (Objective-C and Objective-C++ only)'
+ Warn whenever an Objective-C assignment is being intercepted by the
+ garbage collector.
+
+`-Wno-protocol (Objective-C and Objective-C++ only)'
+ If a class is declared to implement a protocol, a warning is
+ issued for every method in the protocol that is not implemented by
+ the class. The default behavior is to issue a warning for every
+ method not explicitly implemented in the class, even if a method
+ implementation is inherited from the superclass. If you use the
+ `-Wno-protocol' option, then methods inherited from the superclass
+ are considered to be implemented, and no warning is issued for
+ them.
+
+`-Wselector (Objective-C and Objective-C++ only)'
+ Warn if multiple methods of different types for the same selector
+ are found during compilation. The check is performed on the list
+ of methods in the final stage of compilation. Additionally, a
+ check is performed for each selector appearing in a
+ `@selector(...)' expression, and a corresponding method for that
+ selector has been found during compilation. Because these checks
+ scan the method table only at the end of compilation, these
+ warnings are not produced if the final stage of compilation is not
+ reached, for example because an error is found during compilation,
+ or because the `-fsyntax-only' option is being used.
+
+`-Wstrict-selector-match (Objective-C and Objective-C++ only)'
+ Warn if multiple methods with differing argument and/or return
+ types are found for a given selector when attempting to send a
+ message using this selector to a receiver of type `id' or `Class'.
+ When this flag is off (which is the default behavior), the
+ compiler will omit such warnings if any differences found are
+ confined to types which share the same size and alignment.
+
+`-Wundeclared-selector (Objective-C and Objective-C++ only)'
+ Warn if a `@selector(...)' expression referring to an undeclared
+ selector is found. A selector is considered undeclared if no
+ method with that name has been declared before the
+ `@selector(...)' expression, either explicitly in an `@interface'
+ or `@protocol' declaration, or implicitly in an `@implementation'
+ section. This option always performs its checks as soon as a
+ `@selector(...)' expression is found, while `-Wselector' only
+ performs its checks in the final stage of compilation. This also
+ enforces the coding style convention that methods and selectors
+ must be declared before being used.
+
+`-print-objc-runtime-info'
+ Generate C header describing the largest structure that is passed
+ by value, if any.
+
+
+
+File: gcc.info, Node: Language Independent Options, Next: Warning Options, Prev: Objective-C and Objective-C++ Dialect Options, Up: Invoking GCC
+
+3.7 Options to Control Diagnostic Messages Formatting
+=====================================================
+
+Traditionally, diagnostic messages have been formatted irrespective of
+the output device's aspect (e.g. its width, ...). The options described
+below can be used to control the diagnostic messages formatting
+algorithm, e.g. how many characters per line, how often source location
+information should be reported. Right now, only the C++ front end can
+honor these options. However it is expected, in the near future, that
+the remaining front ends would be able to digest them correctly.
+
+`-fmessage-length=N'
+ Try to format error messages so that they fit on lines of about N
+ characters. The default is 72 characters for `g++' and 0 for the
+ rest of the front ends supported by GCC. If N is zero, then no
+ line-wrapping will be done; each error message will appear on a
+ single line.
+
+`-fdiagnostics-show-location=once'
+ Only meaningful in line-wrapping mode. Instructs the diagnostic
+ messages reporter to emit _once_ source location information; that
+ is, in case the message is too long to fit on a single physical
+ line and has to be wrapped, the source location won't be emitted
+ (as prefix) again, over and over, in subsequent continuation
+ lines. This is the default behavior.
+
+`-fdiagnostics-show-location=every-line'
+ Only meaningful in line-wrapping mode. Instructs the diagnostic
+ messages reporter to emit the same source location information (as
+ prefix) for physical lines that result from the process of breaking
+ a message which is too long to fit on a single line.
+
+`-fdiagnostics-show-option'
+ This option instructs the diagnostic machinery to add text to each
+ diagnostic emitted, which indicates which command line option
+ directly controls that diagnostic, when such an option is known to
+ the diagnostic machinery.
+
+`-Wcoverage-mismatch'
+ Warn if feedback profiles do not match when using the
+ `-fprofile-use' option. If a source file was changed between
+ `-fprofile-gen' and `-fprofile-use', the files with the profile
+ feedback can fail to match the source file and GCC can not use the
+ profile feedback information. By default, GCC emits an error
+ message in this case. The option `-Wcoverage-mismatch' emits a
+ warning instead of an error. GCC does not use appropriate
+ feedback profiles, so using this option can result in poorly
+ optimized code. This option is useful only in the case of very
+ minor changes such as bug fixes to an existing code-base.
+
+
+
+File: gcc.info, Node: Warning Options, Next: Debugging Options, Prev: Language Independent Options, Up: Invoking GCC
+
+3.8 Options to Request or Suppress Warnings
+===========================================
+
+Warnings are diagnostic messages that report constructions which are
+not inherently erroneous but which are risky or suggest there may have
+been an error.
+
+ The following language-independent options do not enable specific
+warnings but control the kinds of diagnostics produced by GCC.
+
+`-fsyntax-only'
+ Check the code for syntax errors, but don't do anything beyond
+ that.
+
+`-w'
+ Inhibit all warning messages.
+
+`-Werror'
+ Make all warnings into errors.
+
+`-Werror='
+ Make the specified warning into an error. The specifier for a
+ warning is appended, for example `-Werror=switch' turns the
+ warnings controlled by `-Wswitch' into errors. This switch takes a
+ negative form, to be used to negate `-Werror' for specific
+ warnings, for example `-Wno-error=switch' makes `-Wswitch'
+ warnings not be errors, even when `-Werror' is in effect. You can
+ use the `-fdiagnostics-show-option' option to have each
+ controllable warning amended with the option which controls it, to
+ determine what to use with this option.
+
+ Note that specifying `-Werror='FOO automatically implies `-W'FOO.
+ However, `-Wno-error='FOO does not imply anything.
+
+`-Wfatal-errors'
+ This option causes the compiler to abort compilation on the first
+ error occurred rather than trying to keep going and printing
+ further error messages.
+
+
+ You can request many specific warnings with options beginning `-W',
+for example `-Wimplicit' to request warnings on implicit declarations.
+Each of these specific warning options also has a negative form
+beginning `-Wno-' to turn off warnings; for example, `-Wno-implicit'.
+This manual lists only one of the two forms, whichever is not the
+default. For further, language-specific options also refer to *Note
+C++ Dialect Options:: and *Note Objective-C and Objective-C++ Dialect
+Options::.
+
+`-pedantic'
+ Issue all the warnings demanded by strict ISO C and ISO C++;
+ reject all programs that use forbidden extensions, and some other
+ programs that do not follow ISO C and ISO C++. For ISO C, follows
+ the version of the ISO C standard specified by any `-std' option
+ used.
+
+ Valid ISO C and ISO C++ programs should compile properly with or
+ without this option (though a rare few will require `-ansi' or a
+ `-std' option specifying the required version of ISO C). However,
+ without this option, certain GNU extensions and traditional C and
+ C++ features are supported as well. With this option, they are
+ rejected.
+
+ `-pedantic' does not cause warning messages for use of the
+ alternate keywords whose names begin and end with `__'. Pedantic
+ warnings are also disabled in the expression that follows
+ `__extension__'. However, only system header files should use
+ these escape routes; application programs should avoid them.
+ *Note Alternate Keywords::.
+
+ Some users try to use `-pedantic' to check programs for strict ISO
+ C conformance. They soon find that it does not do quite what they
+ want: it finds some non-ISO practices, but not all--only those for
+ which ISO C _requires_ a diagnostic, and some others for which
+ diagnostics have been added.
+
+ A feature to report any failure to conform to ISO C might be
+ useful in some instances, but would require considerable
+ additional work and would be quite different from `-pedantic'. We
+ don't have plans to support such a feature in the near future.
+
+ Where the standard specified with `-std' represents a GNU extended
+ dialect of C, such as `gnu89' or `gnu99', there is a corresponding
+ "base standard", the version of ISO C on which the GNU extended
+ dialect is based. Warnings from `-pedantic' are given where they
+ are required by the base standard. (It would not make sense for
+ such warnings to be given only for features not in the specified
+ GNU C dialect, since by definition the GNU dialects of C include
+ all features the compiler supports with the given option, and
+ there would be nothing to warn about.)
+
+`-pedantic-errors'
+ Like `-pedantic', except that errors are produced rather than
+ warnings.
+
+`-Wall'
+ This enables all the warnings about constructions that some users
+ consider questionable, and that are easy to avoid (or modify to
+ prevent the warning), even in conjunction with macros. This also
+ enables some language-specific warnings described in *Note C++
+ Dialect Options:: and *Note Objective-C and Objective-C++ Dialect
+ Options::.
+
+ `-Wall' turns on the following warning flags:
+
+ -Waddress
+ -Warray-bounds (only with `-O2')
+ -Wc++0x-compat
+ -Wchar-subscripts
+ -Wimplicit-int
+ -Wimplicit-function-declaration
+ -Wcomment
+ -Wformat
+ -Wmain (only for C/ObjC and unless `-ffreestanding')
+ -Wmissing-braces
+ -Wnonnull
+ -Wparentheses
+ -Wpointer-sign
+ -Wreorder
+ -Wreturn-type
+ -Wsequence-point
+ -Wsign-compare (only in C++)
+ -Wstrict-aliasing
+ -Wstrict-overflow=1
+ -Wswitch
+ -Wtrigraphs
+ -Wuninitialized
+ -Wunknown-pragmas
+ -Wunused-function
+ -Wunused-label
+ -Wunused-value
+ -Wunused-variable
+ -Wvolatile-register-var
+
+ Note that some warning flags are not implied by `-Wall'. Some of
+ them warn about constructions that users generally do not consider
+ questionable, but which occasionally you might wish to check for;
+ others warn about constructions that are necessary or hard to
+ avoid in some cases, and there is no simple way to modify the code
+ to suppress the warning. Some of them are enabled by `-Wextra' but
+ many of them must be enabled individually.
+
+`-Wextra'
+ This enables some extra warning flags that are not enabled by
+ `-Wall'. (This option used to be called `-W'. The older name is
+ still supported, but the newer name is more descriptive.)
+
+ -Wclobbered
+ -Wempty-body
+ -Wignored-qualifiers
+ -Wmissing-field-initializers
+ -Wmissing-parameter-type (C only)
+ -Wold-style-declaration (C only)
+ -Woverride-init
+ -Wsign-compare
+ -Wtype-limits
+ -Wuninitialized
+ -Wunused-parameter (only with `-Wunused' or `-Wall')
+
+ The option `-Wextra' also prints warning messages for the
+ following cases:
+
+ * A pointer is compared against integer zero with `<', `<=',
+ `>', or `>='.
+
+ * (C++ only) An enumerator and a non-enumerator both appear in a
+ conditional expression.
+
+ * (C++ only) Ambiguous virtual bases.
+
+ * (C++ only) Subscripting an array which has been declared
+ `register'.
+
+ * (C++ only) Taking the address of a variable which has been
+ declared `register'.
+
+ * (C++ only) A base class is not initialized in a derived
+ class' copy constructor.
+
+
+`-Wchar-subscripts'
+ Warn if an array subscript has type `char'. This is a common cause
+ of error, as programmers often forget that this type is signed on
+ some machines. This warning is enabled by `-Wall'.
+
+`-Wcomment'
+ Warn whenever a comment-start sequence `/*' appears in a `/*'
+ comment, or whenever a Backslash-Newline appears in a `//' comment.
+ This warning is enabled by `-Wall'.
+
+`-Wformat'
+ Check calls to `printf' and `scanf', etc., to make sure that the
+ arguments supplied have types appropriate to the format string
+ specified, and that the conversions specified in the format string
+ make sense. This includes standard functions, and others
+ specified by format attributes (*note Function Attributes::), in
+ the `printf', `scanf', `strftime' and `strfmon' (an X/Open
+ extension, not in the C standard) families (or other
+ target-specific families). Which functions are checked without
+ format attributes having been specified depends on the standard
+ version selected, and such checks of functions without the
+ attribute specified are disabled by `-ffreestanding' or
+ `-fno-builtin'.
+
+ The formats are checked against the format features supported by
+ GNU libc version 2.2. These include all ISO C90 and C99 features,
+ as well as features from the Single Unix Specification and some
+ BSD and GNU extensions. Other library implementations may not
+ support all these features; GCC does not support warning about
+ features that go beyond a particular library's limitations.
+ However, if `-pedantic' is used with `-Wformat', warnings will be
+ given about format features not in the selected standard version
+ (but not for `strfmon' formats, since those are not in any version
+ of the C standard). *Note Options Controlling C Dialect: C
+ Dialect Options.
+
+ Since `-Wformat' also checks for null format arguments for several
+ functions, `-Wformat' also implies `-Wnonnull'.
+
+ `-Wformat' is included in `-Wall'. For more control over some
+ aspects of format checking, the options `-Wformat-y2k',
+ `-Wno-format-extra-args', `-Wno-format-zero-length',
+ `-Wformat-nonliteral', `-Wformat-security', and `-Wformat=2' are
+ available, but are not included in `-Wall'.
+
+`-Wformat-y2k'
+ If `-Wformat' is specified, also warn about `strftime' formats
+ which may yield only a two-digit year.
+
+`-Wno-format-contains-nul'
+ If `-Wformat' is specified, do not warn about format strings that
+ contain NUL bytes.
+
+`-Wno-format-extra-args'
+ If `-Wformat' is specified, do not warn about excess arguments to a
+ `printf' or `scanf' format function. The C standard specifies
+ that such arguments are ignored.
+
+ Where the unused arguments lie between used arguments that are
+ specified with `$' operand number specifications, normally
+ warnings are still given, since the implementation could not know
+ what type to pass to `va_arg' to skip the unused arguments.
+ However, in the case of `scanf' formats, this option will suppress
+ the warning if the unused arguments are all pointers, since the
+ Single Unix Specification says that such unused arguments are
+ allowed.
+
+`-Wno-format-zero-length (C and Objective-C only)'
+ If `-Wformat' is specified, do not warn about zero-length formats.
+ The C standard specifies that zero-length formats are allowed.
+
+`-Wformat-nonliteral'
+ If `-Wformat' is specified, also warn if the format string is not a
+ string literal and so cannot be checked, unless the format function
+ takes its format arguments as a `va_list'.
+
+`-Wformat-security'
+ If `-Wformat' is specified, also warn about uses of format
+ functions that represent possible security problems. At present,
+ this warns about calls to `printf' and `scanf' functions where the
+ format string is not a string literal and there are no format
+ arguments, as in `printf (foo);'. This may be a security hole if
+ the format string came from untrusted input and contains `%n'.
+ (This is currently a subset of what `-Wformat-nonliteral' warns
+ about, but in future warnings may be added to `-Wformat-security'
+ that are not included in `-Wformat-nonliteral'.)
+
+`-Wformat=2'
+ Enable `-Wformat' plus format checks not included in `-Wformat'.
+ Currently equivalent to `-Wformat -Wformat-nonliteral
+ -Wformat-security -Wformat-y2k'.
+
+`-Wnonnull (C and Objective-C only)'
+ Warn about passing a null pointer for arguments marked as
+ requiring a non-null value by the `nonnull' function attribute.
+
+ `-Wnonnull' is included in `-Wall' and `-Wformat'. It can be
+ disabled with the `-Wno-nonnull' option.
+
+`-Winit-self (C, C++, Objective-C and Objective-C++ only)'
+ Warn about uninitialized variables which are initialized with
+ themselves. Note this option can only be used with the
+ `-Wuninitialized' option.
+
+ For example, GCC will warn about `i' being uninitialized in the
+ following snippet only when `-Winit-self' has been specified:
+ int f()
+ {
+ int i = i;
+ return i;
+ }
+
+`-Wimplicit-int (C and Objective-C only)'
+ Warn when a declaration does not specify a type. This warning is
+ enabled by `-Wall'.
+
+`-Wimplicit-function-declaration (C and Objective-C only)'
+ Give a warning whenever a function is used before being declared.
+ In C99 mode (`-std=c99' or `-std=gnu99'), this warning is enabled
+ by default and it is made into an error by `-pedantic-errors'.
+ This warning is also enabled by `-Wall'.
+
+`-Wimplicit'
+ Same as `-Wimplicit-int' and `-Wimplicit-function-declaration'.
+ This warning is enabled by `-Wall'.
+
+`-Wignored-qualifiers (C and C++ only)'
+ Warn if the return type of a function has a type qualifier such as
+ `const'. For ISO C such a type qualifier has no effect, since the
+ value returned by a function is not an lvalue. For C++, the
+ warning is only emitted for scalar types or `void'. ISO C
+ prohibits qualified `void' return types on function definitions,
+ so such return types always receive a warning even without this
+ option.
+
+ This warning is also enabled by `-Wextra'.
+
+`-Wmain'
+ Warn if the type of `main' is suspicious. `main' should be a
+ function with external linkage, returning int, taking either zero
+ arguments, two, or three arguments of appropriate types. This
+ warning is enabled by default in C++ and is enabled by either
+ `-Wall' or `-pedantic'.
+
+`-Wmissing-braces'
+ Warn if an aggregate or union initializer is not fully bracketed.
+ In the following example, the initializer for `a' is not fully
+ bracketed, but that for `b' is fully bracketed.
+
+ int a[2][2] = { 0, 1, 2, 3 };
+ int b[2][2] = { { 0, 1 }, { 2, 3 } };
+
+ This warning is enabled by `-Wall'.
+
+`-Wmissing-include-dirs (C, C++, Objective-C and Objective-C++ only)'
+ Warn if a user-supplied include directory does not exist.
+
+`-Wparentheses'
+ Warn if parentheses are omitted in certain contexts, such as when
+ there is an assignment in a context where a truth value is
+ expected, or when operators are nested whose precedence people
+ often get confused about.
+
+ Also warn if a comparison like `x<=y<=z' appears; this is
+ equivalent to `(x<=y ? 1 : 0) <= z', which is a different
+ interpretation from that of ordinary mathematical notation.
+
+ Also warn about constructions where there may be confusion to which
+ `if' statement an `else' branch belongs. Here is an example of
+ such a case:
+
+ {
+ if (a)
+ if (b)
+ foo ();
+ else
+ bar ();
+ }
+
+ In C/C++, every `else' branch belongs to the innermost possible
+ `if' statement, which in this example is `if (b)'. This is often
+ not what the programmer expected, as illustrated in the above
+ example by indentation the programmer chose. When there is the
+ potential for this confusion, GCC will issue a warning when this
+ flag is specified. To eliminate the warning, add explicit braces
+ around the innermost `if' statement so there is no way the `else'
+ could belong to the enclosing `if'. The resulting code would look
+ like this:
+
+ {
+ if (a)
+ {
+ if (b)
+ foo ();
+ else
+ bar ();
+ }
+ }
+
+ This warning is enabled by `-Wall'.
+
+`-Wsequence-point'
+ Warn about code that may have undefined semantics because of
+ violations of sequence point rules in the C and C++ standards.
+
+ The C and C++ standards defines the order in which expressions in
+ a C/C++ program are evaluated in terms of "sequence points", which
+ represent a partial ordering between the execution of parts of the
+ program: those executed before the sequence point, and those
+ executed after it. These occur after the evaluation of a full
+ expression (one which is not part of a larger expression), after
+ the evaluation of the first operand of a `&&', `||', `? :' or `,'
+ (comma) operator, before a function is called (but after the
+ evaluation of its arguments and the expression denoting the called
+ function), and in certain other places. Other than as expressed
+ by the sequence point rules, the order of evaluation of
+ subexpressions of an expression is not specified. All these rules
+ describe only a partial order rather than a total order, since,
+ for example, if two functions are called within one expression
+ with no sequence point between them, the order in which the
+ functions are called is not specified. However, the standards
+ committee have ruled that function calls do not overlap.
+
+ It is not specified when between sequence points modifications to
+ the values of objects take effect. Programs whose behavior
+ depends on this have undefined behavior; the C and C++ standards
+ specify that "Between the previous and next sequence point an
+ object shall have its stored value modified at most once by the
+ evaluation of an expression. Furthermore, the prior value shall
+ be read only to determine the value to be stored.". If a program
+ breaks these rules, the results on any particular implementation
+ are entirely unpredictable.
+
+ Examples of code with undefined behavior are `a = a++;', `a[n] =
+ b[n++]' and `a[i++] = i;'. Some more complicated cases are not
+ diagnosed by this option, and it may give an occasional false
+ positive result, but in general it has been found fairly effective
+ at detecting this sort of problem in programs.
+
+ The standard is worded confusingly, therefore there is some debate
+ over the precise meaning of the sequence point rules in subtle
+ cases. Links to discussions of the problem, including proposed
+ formal definitions, may be found on the GCC readings page, at
+ `http://gcc.gnu.org/readings.html'.
+
+ This warning is enabled by `-Wall' for C and C++.
+
+`-Wreturn-type'
+ Warn whenever a function is defined with a return-type that
+ defaults to `int'. Also warn about any `return' statement with no
+ return-value in a function whose return-type is not `void'
+ (falling off the end of the function body is considered returning
+ without a value), and about a `return' statement with a expression
+ in a function whose return-type is `void'.
+
+ For C++, a function without return type always produces a
+ diagnostic message, even when `-Wno-return-type' is specified.
+ The only exceptions are `main' and functions defined in system
+ headers.
+
+ This warning is enabled by `-Wall'.
+
+`-Wswitch'
+ Warn whenever a `switch' statement has an index of enumerated type
+ and lacks a `case' for one or more of the named codes of that
+ enumeration. (The presence of a `default' label prevents this
+ warning.) `case' labels outside the enumeration range also
+ provoke warnings when this option is used. This warning is
+ enabled by `-Wall'.
+
+`-Wswitch-default'
+ Warn whenever a `switch' statement does not have a `default' case.
+
+`-Wswitch-enum'
+ Warn whenever a `switch' statement has an index of enumerated type
+ and lacks a `case' for one or more of the named codes of that
+ enumeration. `case' labels outside the enumeration range also
+ provoke warnings when this option is used.
+
+`-Wsync-nand (C and C++ only)'
+ Warn when `__sync_fetch_and_nand' and `__sync_nand_and_fetch'
+ built-in functions are used. These functions changed semantics in
+ GCC 4.4.
+
+`-Wtrigraphs'
+ Warn if any trigraphs are encountered that might change the
+ meaning of the program (trigraphs within comments are not warned
+ about). This warning is enabled by `-Wall'.
+
+`-Wunused-function'
+ Warn whenever a static function is declared but not defined or a
+ non-inline static function is unused. This warning is enabled by
+ `-Wall'.
+
+`-Wunused-label'
+ Warn whenever a label is declared but not used. This warning is
+ enabled by `-Wall'.
+
+ To suppress this warning use the `unused' attribute (*note
+ Variable Attributes::).
+
+`-Wunused-parameter'
+ Warn whenever a function parameter is unused aside from its
+ declaration.
+
+ To suppress this warning use the `unused' attribute (*note
+ Variable Attributes::).
+
+`-Wunused-variable'
+ Warn whenever a local variable or non-constant static variable is
+ unused aside from its declaration. This warning is enabled by
+ `-Wall'.
+
+ To suppress this warning use the `unused' attribute (*note
+ Variable Attributes::).
+
+`-Wunused-value'
+ Warn whenever a statement computes a result that is explicitly not
+ used. To suppress this warning cast the unused expression to
+ `void'. This includes an expression-statement or the left-hand
+ side of a comma expression that contains no side effects. For
+ example, an expression such as `x[i,j]' will cause a warning, while
+ `x[(void)i,j]' will not.
+
+ This warning is enabled by `-Wall'.
+
+`-Wunused'
+ All the above `-Wunused' options combined.
+
+ In order to get a warning about an unused function parameter, you
+ must either specify `-Wextra -Wunused' (note that `-Wall' implies
+ `-Wunused'), or separately specify `-Wunused-parameter'.
+
+`-Wuninitialized'
+ Warn if an automatic variable is used without first being
+ initialized or if a variable may be clobbered by a `setjmp' call.
+ In C++, warn if a non-static reference or non-static `const' member
+ appears in a class without constructors.
+
+ If you want to warn about code which uses the uninitialized value
+ of the variable in its own initializer, use the `-Winit-self'
+ option.
+
+ These warnings occur for individual uninitialized or clobbered
+ elements of structure, union or array variables as well as for
+ variables which are uninitialized or clobbered as a whole. They do
+ not occur for variables or elements declared `volatile'. Because
+ these warnings depend on optimization, the exact variables or
+ elements for which there are warnings will depend on the precise
+ optimization options and version of GCC used.
+
+ Note that there may be no warning about a variable that is used
+ only to compute a value that itself is never used, because such
+ computations may be deleted by data flow analysis before the
+ warnings are printed.
+
+ These warnings are made optional because GCC is not smart enough
+ to see all the reasons why the code might be correct despite
+ appearing to have an error. Here is one example of how this can
+ happen:
+
+ {
+ int x;
+ switch (y)
+ {
+ case 1: x = 1;
+ break;
+ case 2: x = 4;
+ break;
+ case 3: x = 5;
+ }
+ foo (x);
+ }
+
+ If the value of `y' is always 1, 2 or 3, then `x' is always
+ initialized, but GCC doesn't know this. Here is another common
+ case:
+
+ {
+ int save_y;
+ if (change_y) save_y = y, y = new_y;
+ ...
+ if (change_y) y = save_y;
+ }
+
+ This has no bug because `save_y' is used only if it is set.
+
+ This option also warns when a non-volatile automatic variable
+ might be changed by a call to `longjmp'. These warnings as well
+ are possible only in optimizing compilation.
+
+ The compiler sees only the calls to `setjmp'. It cannot know
+ where `longjmp' will be called; in fact, a signal handler could
+ call it at any point in the code. As a result, you may get a
+ warning even when there is in fact no problem because `longjmp'
+ cannot in fact be called at the place which would cause a problem.
+
+ Some spurious warnings can be avoided if you declare all the
+ functions you use that never return as `noreturn'. *Note Function
+ Attributes::.
+
+ This warning is enabled by `-Wall' or `-Wextra'.
+
+`-Wunknown-pragmas'
+ Warn when a #pragma directive is encountered which is not
+ understood by GCC. If this command line option is used, warnings
+ will even be issued for unknown pragmas in system header files.
+ This is not the case if the warnings were only enabled by the
+ `-Wall' command line option.
+
+`-Wno-pragmas'
+ Do not warn about misuses of pragmas, such as incorrect parameters,
+ invalid syntax, or conflicts between pragmas. See also
+ `-Wunknown-pragmas'.
+
+`-Wstrict-aliasing'
+ This option is only active when `-fstrict-aliasing' is active. It
+ warns about code which might break the strict aliasing rules that
+ the compiler is using for optimization. The warning does not
+ catch all cases, but does attempt to catch the more common
+ pitfalls. It is included in `-Wall'. It is equivalent to
+ `-Wstrict-aliasing=3'
+
+`-Wstrict-aliasing=n'
+ This option is only active when `-fstrict-aliasing' is active. It
+ warns about code which might break the strict aliasing rules that
+ the compiler is using for optimization. Higher levels correspond
+ to higher accuracy (fewer false positives). Higher levels also
+ correspond to more effort, similar to the way -O works.
+ `-Wstrict-aliasing' is equivalent to `-Wstrict-aliasing=n', with
+ n=3.
+
+ Level 1: Most aggressive, quick, least accurate. Possibly useful
+ when higher levels do not warn but -fstrict-aliasing still breaks
+ the code, as it has very few false negatives. However, it has
+ many false positives. Warns for all pointer conversions between
+ possibly incompatible types, even if never dereferenced. Runs in
+ the frontend only.
+
+ Level 2: Aggressive, quick, not too precise. May still have many
+ false positives (not as many as level 1 though), and few false
+ negatives (but possibly more than level 1). Unlike level 1, it
+ only warns when an address is taken. Warns about incomplete
+ types. Runs in the frontend only.
+
+ Level 3 (default for `-Wstrict-aliasing'): Should have very few
+ false positives and few false negatives. Slightly slower than
+ levels 1 or 2 when optimization is enabled. Takes care of the
+ common punn+dereference pattern in the frontend:
+ `*(int*)&some_float'. If optimization is enabled, it also runs in
+ the backend, where it deals with multiple statement cases using
+ flow-sensitive points-to information. Only warns when the
+ converted pointer is dereferenced. Does not warn about incomplete
+ types.
+
+`-Wstrict-overflow'
+`-Wstrict-overflow=N'
+ This option is only active when `-fstrict-overflow' is active. It
+ warns about cases where the compiler optimizes based on the
+ assumption that signed overflow does not occur. Note that it does
+ not warn about all cases where the code might overflow: it only
+ warns about cases where the compiler implements some optimization.
+ Thus this warning depends on the optimization level.
+
+ An optimization which assumes that signed overflow does not occur
+ is perfectly safe if the values of the variables involved are such
+ that overflow never does, in fact, occur. Therefore this warning
+ can easily give a false positive: a warning about code which is not
+ actually a problem. To help focus on important issues, several
+ warning levels are defined. No warnings are issued for the use of
+ undefined signed overflow when estimating how many iterations a
+ loop will require, in particular when determining whether a loop
+ will be executed at all.
+
+ `-Wstrict-overflow=1'
+ Warn about cases which are both questionable and easy to
+ avoid. For example: `x + 1 > x'; with `-fstrict-overflow',
+ the compiler will simplify this to `1'. This level of
+ `-Wstrict-overflow' is enabled by `-Wall'; higher levels are
+ not, and must be explicitly requested.
+
+ `-Wstrict-overflow=2'
+ Also warn about other cases where a comparison is simplified
+ to a constant. For example: `abs (x) >= 0'. This can only be
+ simplified when `-fstrict-overflow' is in effect, because
+ `abs (INT_MIN)' overflows to `INT_MIN', which is less than
+ zero. `-Wstrict-overflow' (with no level) is the same as
+ `-Wstrict-overflow=2'.
+
+ `-Wstrict-overflow=3'
+ Also warn about other cases where a comparison is simplified.
+ For example: `x + 1 > 1' will be simplified to `x > 0'.
+
+ `-Wstrict-overflow=4'
+ Also warn about other simplifications not covered by the
+ above cases. For example: `(x * 10) / 5' will be simplified
+ to `x * 2'.
+
+ `-Wstrict-overflow=5'
+ Also warn about cases where the compiler reduces the
+ magnitude of a constant involved in a comparison. For
+ example: `x + 2 > y' will be simplified to `x + 1 >= y'.
+ This is reported only at the highest warning level because
+ this simplification applies to many comparisons, so this
+ warning level will give a very large number of false
+ positives.
+
+`-Warray-bounds'
+ This option is only active when `-ftree-vrp' is active (default
+ for -O2 and above). It warns about subscripts to arrays that are
+ always out of bounds. This warning is enabled by `-Wall'.
+
+`-Wno-div-by-zero'
+ Do not warn about compile-time integer division by zero. Floating
+ point division by zero is not warned about, as it can be a
+ legitimate way of obtaining infinities and NaNs.
+
+`-Wsystem-headers'
+ Print warning messages for constructs found in system header files.
+ Warnings from system headers are normally suppressed, on the
+ assumption that they usually do not indicate real problems and
+ would only make the compiler output harder to read. Using this
+ command line option tells GCC to emit warnings from system headers
+ as if they occurred in user code. However, note that using
+ `-Wall' in conjunction with this option will _not_ warn about
+ unknown pragmas in system headers--for that, `-Wunknown-pragmas'
+ must also be used.
+
+`-Wfloat-equal'
+ Warn if floating point values are used in equality comparisons.
+
+ The idea behind this is that sometimes it is convenient (for the
+ programmer) to consider floating-point values as approximations to
+ infinitely precise real numbers. If you are doing this, then you
+ need to compute (by analyzing the code, or in some other way) the
+ maximum or likely maximum error that the computation introduces,
+ and allow for it when performing comparisons (and when producing
+ output, but that's a different problem). In particular, instead
+ of testing for equality, you would check to see whether the two
+ values have ranges that overlap; and this is done with the
+ relational operators, so equality comparisons are probably
+ mistaken.
+
+`-Wtraditional (C and Objective-C only)'
+ Warn about certain constructs that behave differently in
+ traditional and ISO C. Also warn about ISO C constructs that have
+ no traditional C equivalent, and/or problematic constructs which
+ should be avoided.
+
+ * Macro parameters that appear within string literals in the
+ macro body. In traditional C macro replacement takes place
+ within string literals, but does not in ISO C.
+
+ * In traditional C, some preprocessor directives did not exist.
+ Traditional preprocessors would only consider a line to be a
+ directive if the `#' appeared in column 1 on the line.
+ Therefore `-Wtraditional' warns about directives that
+ traditional C understands but would ignore because the `#'
+ does not appear as the first character on the line. It also
+ suggests you hide directives like `#pragma' not understood by
+ traditional C by indenting them. Some traditional
+ implementations would not recognize `#elif', so it suggests
+ avoiding it altogether.
+
+ * A function-like macro that appears without arguments.
+
+ * The unary plus operator.
+
+ * The `U' integer constant suffix, or the `F' or `L' floating
+ point constant suffixes. (Traditional C does support the `L'
+ suffix on integer constants.) Note, these suffixes appear in
+ macros defined in the system headers of most modern systems,
+ e.g. the `_MIN'/`_MAX' macros in `<limits.h>'. Use of these
+ macros in user code might normally lead to spurious warnings,
+ however GCC's integrated preprocessor has enough context to
+ avoid warning in these cases.
+
+ * A function declared external in one block and then used after
+ the end of the block.
+
+ * A `switch' statement has an operand of type `long'.
+
+ * A non-`static' function declaration follows a `static' one.
+ This construct is not accepted by some traditional C
+ compilers.
+
+ * The ISO type of an integer constant has a different width or
+ signedness from its traditional type. This warning is only
+ issued if the base of the constant is ten. I.e. hexadecimal
+ or octal values, which typically represent bit patterns, are
+ not warned about.
+
+ * Usage of ISO string concatenation is detected.
+
+ * Initialization of automatic aggregates.
+
+ * Identifier conflicts with labels. Traditional C lacks a
+ separate namespace for labels.
+
+ * Initialization of unions. If the initializer is zero, the
+ warning is omitted. This is done under the assumption that
+ the zero initializer in user code appears conditioned on e.g.
+ `__STDC__' to avoid missing initializer warnings and relies
+ on default initialization to zero in the traditional C case.
+
+ * Conversions by prototypes between fixed/floating point values
+ and vice versa. The absence of these prototypes when
+ compiling with traditional C would cause serious problems.
+ This is a subset of the possible conversion warnings, for the
+ full set use `-Wtraditional-conversion'.
+
+ * Use of ISO C style function definitions. This warning
+ intentionally is _not_ issued for prototype declarations or
+ variadic functions because these ISO C features will appear
+ in your code when using libiberty's traditional C
+ compatibility macros, `PARAMS' and `VPARAMS'. This warning
+ is also bypassed for nested functions because that feature is
+ already a GCC extension and thus not relevant to traditional
+ C compatibility.
+
+`-Wtraditional-conversion (C and Objective-C only)'
+ Warn if a prototype causes a type conversion that is different
+ from what would happen to the same argument in the absence of a
+ prototype. This includes conversions of fixed point to floating
+ and vice versa, and conversions changing the width or signedness
+ of a fixed point argument except when the same as the default
+ promotion.
+
+`-Wdeclaration-after-statement (C and Objective-C only)'
+ Warn when a declaration is found after a statement in a block.
+ This construct, known from C++, was introduced with ISO C99 and is
+ by default allowed in GCC. It is not supported by ISO C90 and was
+ not supported by GCC versions before GCC 3.0. *Note Mixed
+ Declarations::.
+
+`-Wundef'
+ Warn if an undefined identifier is evaluated in an `#if' directive.
+
+`-Wno-endif-labels'
+ Do not warn whenever an `#else' or an `#endif' are followed by
+ text.
+
+`-Wshadow'
+ Warn whenever a local variable shadows another local variable,
+ parameter or global variable or whenever a built-in function is
+ shadowed.
+
+`-Wlarger-than=LEN'
+ Warn whenever an object of larger than LEN bytes is defined.
+
+`-Wframe-larger-than=LEN'
+ Warn if the size of a function frame is larger than LEN bytes.
+ The computation done to determine the stack frame size is
+ approximate and not conservative. The actual requirements may be
+ somewhat greater than LEN even if you do not get a warning. In
+ addition, any space allocated via `alloca', variable-length
+ arrays, or related constructs is not included by the compiler when
+ determining whether or not to issue a warning.
+
+`-Wunsafe-loop-optimizations'
+ Warn if the loop cannot be optimized because the compiler could not
+ assume anything on the bounds of the loop indices. With
+ `-funsafe-loop-optimizations' warn if the compiler made such
+ assumptions.
+
+`-Wno-pedantic-ms-format (MinGW targets only)'
+ Disables the warnings about non-ISO `printf' / `scanf' format
+ width specifiers `I32', `I64', and `I' used on Windows targets
+ depending on the MS runtime, when you are using the options
+ `-Wformat' and `-pedantic' without gnu-extensions.
+
+`-Wpointer-arith'
+ Warn about anything that depends on the "size of" a function type
+ or of `void'. GNU C assigns these types a size of 1, for
+ convenience in calculations with `void *' pointers and pointers to
+ functions. In C++, warn also when an arithmetic operation involves
+ `NULL'. This warning is also enabled by `-pedantic'.
+
+`-Wtype-limits'
+ Warn if a comparison is always true or always false due to the
+ limited range of the data type, but do not warn for constant
+ expressions. For example, warn if an unsigned variable is
+ compared against zero with `<' or `>='. This warning is also
+ enabled by `-Wextra'.
+
+`-Wbad-function-cast (C and Objective-C only)'
+ Warn whenever a function call is cast to a non-matching type. For
+ example, warn if `int malloc()' is cast to `anything *'.
+
+`-Wc++-compat (C and Objective-C only)'
+ Warn about ISO C constructs that are outside of the common subset
+ of ISO C and ISO C++, e.g. request for implicit conversion from
+ `void *' to a pointer to non-`void' type.
+
+`-Wc++0x-compat (C++ and Objective-C++ only)'
+ Warn about C++ constructs whose meaning differs between ISO C++
+ 1998 and ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will
+ become keywords in ISO C++ 200x. This warning is enabled by
+ `-Wall'.
+
+`-Wcast-qual'
+ Warn whenever a pointer is cast so as to remove a type qualifier
+ from the target type. For example, warn if a `const char *' is
+ cast to an ordinary `char *'.
+
+`-Wcast-align'
+ Warn whenever a pointer is cast such that the required alignment
+ of the target is increased. For example, warn if a `char *' is
+ cast to an `int *' on machines where integers can only be accessed
+ at two- or four-byte boundaries.
+
+`-Wwrite-strings'
+ When compiling C, give string constants the type `const
+ char[LENGTH]' so that copying the address of one into a
+ non-`const' `char *' pointer will get a warning. These warnings
+ will help you find at compile time code that can try to write into
+ a string constant, but only if you have been very careful about
+ using `const' in declarations and prototypes. Otherwise, it will
+ just be a nuisance. This is why we did not make `-Wall' request
+ these warnings.
+
+ When compiling C++, warn about the deprecated conversion from
+ string literals to `char *'. This warning is enabled by default
+ for C++ programs.
+
+`-Wclobbered'
+ Warn for variables that might be changed by `longjmp' or `vfork'.
+ This warning is also enabled by `-Wextra'.
+
+`-Wconversion'
+ Warn for implicit conversions that may alter a value. This includes
+ conversions between real and integer, like `abs (x)' when `x' is
+ `double'; conversions between signed and unsigned, like `unsigned
+ ui = -1'; and conversions to smaller types, like `sqrtf (M_PI)'.
+ Do not warn for explicit casts like `abs ((int) x)' and `ui =
+ (unsigned) -1', or if the value is not changed by the conversion
+ like in `abs (2.0)'. Warnings about conversions between signed
+ and unsigned integers can be disabled by using
+ `-Wno-sign-conversion'.
+
+ For C++, also warn for conversions between `NULL' and non-pointer
+ types; confusing overload resolution for user-defined conversions;
+ and conversions that will never use a type conversion operator:
+ conversions to `void', the same type, a base class or a reference
+ to them. Warnings about conversions between signed and unsigned
+ integers are disabled by default in C++ unless `-Wsign-conversion'
+ is explicitly enabled.
+
+`-Wempty-body'
+ Warn if an empty body occurs in an `if', `else' or `do while'
+ statement. This warning is also enabled by `-Wextra'.
+
+`-Wenum-compare (C++ and Objective-C++ only)'
+ Warn about a comparison between values of different enum types.
+ This warning is enabled by default.
+
+`-Wsign-compare'
+ Warn when a comparison between signed and unsigned values could
+ produce an incorrect result when the signed value is converted to
+ unsigned. This warning is also enabled by `-Wextra'; to get the
+ other warnings of `-Wextra' without this warning, use `-Wextra
+ -Wno-sign-compare'.
+
+`-Wsign-conversion'
+ Warn for implicit conversions that may change the sign of an
+ integer value, like assigning a signed integer expression to an
+ unsigned integer variable. An explicit cast silences the warning.
+ In C, this option is enabled also by `-Wconversion'.
+
+`-Waddress'
+ Warn about suspicious uses of memory addresses. These include using
+ the address of a function in a conditional expression, such as
+ `void func(void); if (func)', and comparisons against the memory
+ address of a string literal, such as `if (x == "abc")'. Such uses
+ typically indicate a programmer error: the address of a function
+ always evaluates to true, so their use in a conditional usually
+ indicate that the programmer forgot the parentheses in a function
+ call; and comparisons against string literals result in unspecified
+ behavior and are not portable in C, so they usually indicate that
+ the programmer intended to use `strcmp'. This warning is enabled
+ by `-Wall'.
+
+`-Wlogical-op'
+ Warn about suspicious uses of logical operators in expressions.
+ This includes using logical operators in contexts where a bit-wise
+ operator is likely to be expected.
+
+`-Waggregate-return'
+ Warn if any functions that return structures or unions are defined
+ or called. (In languages where you can return an array, this also
+ elicits a warning.)
+
+`-Wno-attributes'
+ Do not warn if an unexpected `__attribute__' is used, such as
+ unrecognized attributes, function attributes applied to variables,
+ etc. This will not stop errors for incorrect use of supported
+ attributes.
+
+`-Wno-builtin-macro-redefined'
+ Do not warn if certain built-in macros are redefined. This
+ suppresses warnings for redefinition of `__TIMESTAMP__',
+ `__TIME__', `__DATE__', `__FILE__', and `__BASE_FILE__'.
+
+`-Wstrict-prototypes (C and Objective-C only)'
+ Warn if a function is declared or defined without specifying the
+ argument types. (An old-style function definition is permitted
+ without a warning if preceded by a declaration which specifies the
+ argument types.)
+
+`-Wold-style-declaration (C and Objective-C only)'
+ Warn for obsolescent usages, according to the C Standard, in a
+ declaration. For example, warn if storage-class specifiers like
+ `static' are not the first things in a declaration. This warning
+ is also enabled by `-Wextra'.
+
+`-Wold-style-definition (C and Objective-C only)'
+ Warn if an old-style function definition is used. A warning is
+ given even if there is a previous prototype.
+
+`-Wmissing-parameter-type (C and Objective-C only)'
+ A function parameter is declared without a type specifier in
+ K&R-style functions:
+
+ void foo(bar) { }
+
+ This warning is also enabled by `-Wextra'.
+
+`-Wmissing-prototypes (C and Objective-C only)'
+ Warn if a global function is defined without a previous prototype
+ declaration. This warning is issued even if the definition itself
+ provides a prototype. The aim is to detect global functions that
+ fail to be declared in header files.
+
+`-Wmissing-declarations'
+ Warn if a global function is defined without a previous
+ declaration. Do so even if the definition itself provides a
+ prototype. Use this option to detect global functions that are
+ not declared in header files. In C++, no warnings are issued for
+ function templates, or for inline functions, or for functions in
+ anonymous namespaces.
+
+`-Wmissing-field-initializers'
+ Warn if a structure's initializer has some fields missing. For
+ example, the following code would cause such a warning, because
+ `x.h' is implicitly zero:
+
+ struct s { int f, g, h; };
+ struct s x = { 3, 4 };
+
+ This option does not warn about designated initializers, so the
+ following modification would not trigger a warning:
+
+ struct s { int f, g, h; };
+ struct s x = { .f = 3, .g = 4 };
+
+ This warning is included in `-Wextra'. To get other `-Wextra'
+ warnings without this one, use `-Wextra
+ -Wno-missing-field-initializers'.
+
+`-Wmissing-noreturn'
+ Warn about functions which might be candidates for attribute
+ `noreturn'. Note these are only possible candidates, not absolute
+ ones. Care should be taken to manually verify functions actually
+ do not ever return before adding the `noreturn' attribute,
+ otherwise subtle code generation bugs could be introduced. You
+ will not get a warning for `main' in hosted C environments.
+
+`-Wmissing-format-attribute'
+ Warn about function pointers which might be candidates for `format'
+ attributes. Note these are only possible candidates, not absolute
+ ones. GCC will guess that function pointers with `format'
+ attributes that are used in assignment, initialization, parameter
+ passing or return statements should have a corresponding `format'
+ attribute in the resulting type. I.e. the left-hand side of the
+ assignment or initialization, the type of the parameter variable,
+ or the return type of the containing function respectively should
+ also have a `format' attribute to avoid the warning.
+
+ GCC will also warn about function definitions which might be
+ candidates for `format' attributes. Again, these are only
+ possible candidates. GCC will guess that `format' attributes
+ might be appropriate for any function that calls a function like
+ `vprintf' or `vscanf', but this might not always be the case, and
+ some functions for which `format' attributes are appropriate may
+ not be detected.
+
+`-Wno-multichar'
+ Do not warn if a multicharacter constant (`'FOOF'') is used.
+ Usually they indicate a typo in the user's code, as they have
+ implementation-defined values, and should not be used in portable
+ code.
+
+`-Wnormalized=<none|id|nfc|nfkc>'
+ In ISO C and ISO C++, two identifiers are different if they are
+ different sequences of characters. However, sometimes when
+ characters outside the basic ASCII character set are used, you can
+ have two different character sequences that look the same. To
+ avoid confusion, the ISO 10646 standard sets out some
+ "normalization rules" which when applied ensure that two sequences
+ that look the same are turned into the same sequence. GCC can
+ warn you if you are using identifiers which have not been
+ normalized; this option controls that warning.
+
+ There are four levels of warning that GCC supports. The default is
+ `-Wnormalized=nfc', which warns about any identifier which is not
+ in the ISO 10646 "C" normalized form, "NFC". NFC is the
+ recommended form for most uses.
+
+ Unfortunately, there are some characters which ISO C and ISO C++
+ allow in identifiers that when turned into NFC aren't allowable as
+ identifiers. That is, there's no way to use these symbols in
+ portable ISO C or C++ and have all your identifiers in NFC.
+ `-Wnormalized=id' suppresses the warning for these characters. It
+ is hoped that future versions of the standards involved will
+ correct this, which is why this option is not the default.
+
+ You can switch the warning off for all characters by writing
+ `-Wnormalized=none'. You would only want to do this if you were
+ using some other normalization scheme (like "D"), because
+ otherwise you can easily create bugs that are literally impossible
+ to see.
+
+ Some characters in ISO 10646 have distinct meanings but look
+ identical in some fonts or display methodologies, especially once
+ formatting has been applied. For instance `\u207F', "SUPERSCRIPT
+ LATIN SMALL LETTER N", will display just like a regular `n' which
+ has been placed in a superscript. ISO 10646 defines the "NFKC"
+ normalization scheme to convert all these into a standard form as
+ well, and GCC will warn if your code is not in NFKC if you use
+ `-Wnormalized=nfkc'. This warning is comparable to warning about
+ every identifier that contains the letter O because it might be
+ confused with the digit 0, and so is not the default, but may be
+ useful as a local coding convention if the programming environment
+ is unable to be fixed to display these characters distinctly.
+
+`-Wno-deprecated'
+ Do not warn about usage of deprecated features. *Note Deprecated
+ Features::.
+
+`-Wno-deprecated-declarations'
+ Do not warn about uses of functions (*note Function Attributes::),
+ variables (*note Variable Attributes::), and types (*note Type
+ Attributes::) marked as deprecated by using the `deprecated'
+ attribute.
+
+`-Wno-overflow'
+ Do not warn about compile-time overflow in constant expressions.
+
+`-Woverride-init (C and Objective-C only)'
+ Warn if an initialized field without side effects is overridden
+ when using designated initializers (*note Designated Initializers:
+ Designated Inits.).
+
+ This warning is included in `-Wextra'. To get other `-Wextra'
+ warnings without this one, use `-Wextra -Wno-override-init'.
+
+`-Wpacked'
+ Warn if a structure is given the packed attribute, but the packed
+ attribute has no effect on the layout or size of the structure.
+ Such structures may be mis-aligned for little benefit. For
+ instance, in this code, the variable `f.x' in `struct bar' will be
+ misaligned even though `struct bar' does not itself have the
+ packed attribute:
+
+ struct foo {
+ int x;
+ char a, b, c, d;
+ } __attribute__((packed));
+ struct bar {
+ char z;
+ struct foo f;
+ };
+
+`-Wpacked-bitfield-compat'
+ The 4.1, 4.2 and 4.3 series of GCC ignore the `packed' attribute
+ on bit-fields of type `char'. This has been fixed in GCC 4.4 but
+ the change can lead to differences in the structure layout. GCC
+ informs you when the offset of such a field has changed in GCC 4.4.
+ For example there is no longer a 4-bit padding between field `a'
+ and `b' in this structure:
+
+ struct foo
+ {
+ char a:4;
+ char b:8;
+ } __attribute__ ((packed));
+
+ This warning is enabled by default. Use
+ `-Wno-packed-bitfield-compat' to disable this warning.
+
+`-Wpadded'
+ Warn if padding is included in a structure, either to align an
+ element of the structure or to align the whole structure.
+ Sometimes when this happens it is possible to rearrange the fields
+ of the structure to reduce the padding and so make the structure
+ smaller.
+
+`-Wredundant-decls'
+ Warn if anything is declared more than once in the same scope,
+ even in cases where multiple declaration is valid and changes
+ nothing.
+
+`-Wnested-externs (C and Objective-C only)'
+ Warn if an `extern' declaration is encountered within a function.
+
+`-Wunreachable-code'
+ Warn if the compiler detects that code will never be executed.
+
+ This option is intended to warn when the compiler detects that at
+ least a whole line of source code will never be executed, because
+ some condition is never satisfied or because it is after a
+ procedure that never returns.
+
+ It is possible for this option to produce a warning even though
+ there are circumstances under which part of the affected line can
+ be executed, so care should be taken when removing
+ apparently-unreachable code.
+
+ For instance, when a function is inlined, a warning may mean that
+ the line is unreachable in only one inlined copy of the function.
+
+ This option is not made part of `-Wall' because in a debugging
+ version of a program there is often substantial code which checks
+ correct functioning of the program and is, hopefully, unreachable
+ because the program does work. Another common use of unreachable
+ code is to provide behavior which is selectable at compile-time.
+
+`-Winline'
+ Warn if a function can not be inlined and it was declared as
+ inline. Even with this option, the compiler will not warn about
+ failures to inline functions declared in system headers.
+
+ The compiler uses a variety of heuristics to determine whether or
+ not to inline a function. For example, the compiler takes into
+ account the size of the function being inlined and the amount of
+ inlining that has already been done in the current function.
+ Therefore, seemingly insignificant changes in the source program
+ can cause the warnings produced by `-Winline' to appear or
+ disappear.
+
+`-Wno-invalid-offsetof (C++ and Objective-C++ only)'
+ Suppress warnings from applying the `offsetof' macro to a non-POD
+ type. According to the 1998 ISO C++ standard, applying `offsetof'
+ to a non-POD type is undefined. In existing C++ implementations,
+ however, `offsetof' typically gives meaningful results even when
+ applied to certain kinds of non-POD types. (Such as a simple
+ `struct' that fails to be a POD type only by virtue of having a
+ constructor.) This flag is for users who are aware that they are
+ writing nonportable code and who have deliberately chosen to
+ ignore the warning about it.
+
+ The restrictions on `offsetof' may be relaxed in a future version
+ of the C++ standard.
+
+`-Wno-int-to-pointer-cast (C and Objective-C only)'
+ Suppress warnings from casts to pointer type of an integer of a
+ different size.
+
+`-Wno-pointer-to-int-cast (C and Objective-C only)'
+ Suppress warnings from casts from a pointer to an integer type of a
+ different size.
+
+`-Winvalid-pch'
+ Warn if a precompiled header (*note Precompiled Headers::) is
+ found in the search path but can't be used.
+
+`-Wlong-long'
+ Warn if `long long' type is used. This is default. To inhibit
+ the warning messages, use `-Wno-long-long'. Flags `-Wlong-long'
+ and `-Wno-long-long' are taken into account only when `-pedantic'
+ flag is used.
+
+`-Wvariadic-macros'
+ Warn if variadic macros are used in pedantic ISO C90 mode, or the
+ GNU alternate syntax when in pedantic ISO C99 mode. This is
+ default. To inhibit the warning messages, use
+ `-Wno-variadic-macros'.
+
+`-Wvla'
+ Warn if variable length array is used in the code. `-Wno-vla'
+ will prevent the `-pedantic' warning of the variable length array.
+
+`-Wvolatile-register-var'
+ Warn if a register variable is declared volatile. The volatile
+ modifier does not inhibit all optimizations that may eliminate
+ reads and/or writes to register variables. This warning is
+ enabled by `-Wall'.
+
+`-Wdisabled-optimization'
+ Warn if a requested optimization pass is disabled. This warning
+ does not generally indicate that there is anything wrong with your
+ code; it merely indicates that GCC's optimizers were unable to
+ handle the code effectively. Often, the problem is that your code
+ is too big or too complex; GCC will refuse to optimize programs
+ when the optimization itself is likely to take inordinate amounts
+ of time.
+
+`-Wpointer-sign (C and Objective-C only)'
+ Warn for pointer argument passing or assignment with different
+ signedness. This option is only supported for C and Objective-C.
+ It is implied by `-Wall' and by `-pedantic', which can be disabled
+ with `-Wno-pointer-sign'.
+
+`-Wstack-protector'
+ This option is only active when `-fstack-protector' is active. It
+ warns about functions that will not be protected against stack
+ smashing.
+
+`-Wno-mudflap'
+ Suppress warnings about constructs that cannot be instrumented by
+ `-fmudflap'.
+
+`-Woverlength-strings'
+ Warn about string constants which are longer than the "minimum
+ maximum" length specified in the C standard. Modern compilers
+ generally allow string constants which are much longer than the
+ standard's minimum limit, but very portable programs should avoid
+ using longer strings.
+
+ The limit applies _after_ string constant concatenation, and does
+ not count the trailing NUL. In C89, the limit was 509 characters;
+ in C99, it was raised to 4095. C++98 does not specify a normative
+ minimum maximum, so we do not diagnose overlength strings in C++.
+
+ This option is implied by `-pedantic', and can be disabled with
+ `-Wno-overlength-strings'.
+
+
+File: gcc.info, Node: Debugging Options, Next: Optimize Options, Prev: Warning Options, Up: Invoking GCC
+
+3.9 Options for Debugging Your Program or GCC
+=============================================
+
+GCC has various special options that are used for debugging either your
+program or GCC:
+
+`-g'
+ Produce debugging information in the operating system's native
+ format (stabs, COFF, XCOFF, or DWARF 2). GDB can work with this
+ debugging information.
+
+ On most systems that use stabs format, `-g' enables use of extra
+ debugging information that only GDB can use; this extra information
+ makes debugging work better in GDB but will probably make other
+ debuggers crash or refuse to read the program. If you want to
+ control for certain whether to generate the extra information, use
+ `-gstabs+', `-gstabs', `-gxcoff+', `-gxcoff', or `-gvms' (see
+ below).
+
+ GCC allows you to use `-g' with `-O'. The shortcuts taken by
+ optimized code may occasionally produce surprising results: some
+ variables you declared may not exist at all; flow of control may
+ briefly move where you did not expect it; some statements may not
+ be executed because they compute constant results or their values
+ were already at hand; some statements may execute in different
+ places because they were moved out of loops.
+
+ Nevertheless it proves possible to debug optimized output. This
+ makes it reasonable to use the optimizer for programs that might
+ have bugs.
+
+ The following options are useful when GCC is generated with the
+ capability for more than one debugging format.
+
+`-ggdb'
+ Produce debugging information for use by GDB. This means to use
+ the most expressive format available (DWARF 2, stabs, or the
+ native format if neither of those are supported), including GDB
+ extensions if at all possible.
+
+`-gstabs'
+ Produce debugging information in stabs format (if that is
+ supported), without GDB extensions. This is the format used by
+ DBX on most BSD systems. On MIPS, Alpha and System V Release 4
+ systems this option produces stabs debugging output which is not
+ understood by DBX or SDB. On System V Release 4 systems this
+ option requires the GNU assembler.
+
+`-feliminate-unused-debug-symbols'
+ Produce debugging information in stabs format (if that is
+ supported), for only symbols that are actually used.
+
+`-femit-class-debug-always'
+ Instead of emitting debugging information for a C++ class in only
+ one object file, emit it in all object files using the class.
+ This option should be used only with debuggers that are unable to
+ handle the way GCC normally emits debugging information for
+ classes because using this option will increase the size of
+ debugging information by as much as a factor of two.
+
+`-gstabs+'
+ Produce debugging information in stabs format (if that is
+ supported), using GNU extensions understood only by the GNU
+ debugger (GDB). The use of these extensions is likely to make
+ other debuggers crash or refuse to read the program.
+
+`-gcoff'
+ Produce debugging information in COFF format (if that is
+ supported). This is the format used by SDB on most System V
+ systems prior to System V Release 4.
+
+`-gxcoff'
+ Produce debugging information in XCOFF format (if that is
+ supported). This is the format used by the DBX debugger on IBM
+ RS/6000 systems.
+
+`-gxcoff+'
+ Produce debugging information in XCOFF format (if that is
+ supported), using GNU extensions understood only by the GNU
+ debugger (GDB). The use of these extensions is likely to make
+ other debuggers crash or refuse to read the program, and may cause
+ assemblers other than the GNU assembler (GAS) to fail with an
+ error.
+
+`-gdwarf-2'
+ Produce debugging information in DWARF version 2 format (if that is
+ supported). This is the format used by DBX on IRIX 6. With this
+ option, GCC uses features of DWARF version 3 when they are useful;
+ version 3 is upward compatible with version 2, but may still cause
+ problems for older debuggers.
+
+`-gvms'
+ Produce debugging information in VMS debug format (if that is
+ supported). This is the format used by DEBUG on VMS systems.
+
+`-gLEVEL'
+`-ggdbLEVEL'
+`-gstabsLEVEL'
+`-gcoffLEVEL'
+`-gxcoffLEVEL'
+`-gvmsLEVEL'
+ Request debugging information and also use LEVEL to specify how
+ much information. The default level is 2.
+
+ Level 0 produces no debug information at all. Thus, `-g0' negates
+ `-g'.
+
+ Level 1 produces minimal information, enough for making backtraces
+ in parts of the program that you don't plan to debug. This
+ includes descriptions of functions and external variables, but no
+ information about local variables and no line numbers.
+
+ Level 3 includes extra information, such as all the macro
+ definitions present in the program. Some debuggers support macro
+ expansion when you use `-g3'.
+
+ `-gdwarf-2' does not accept a concatenated debug level, because
+ GCC used to support an option `-gdwarf' that meant to generate
+ debug information in version 1 of the DWARF format (which is very
+ different from version 2), and it would have been too confusing.
+ That debug format is long obsolete, but the option cannot be
+ changed now. Instead use an additional `-gLEVEL' option to change
+ the debug level for DWARF2.
+
+`-feliminate-dwarf2-dups'
+ Compress DWARF2 debugging information by eliminating duplicated
+ information about each symbol. This option only makes sense when
+ generating DWARF2 debugging information with `-gdwarf-2'.
+
+`-femit-struct-debug-baseonly'
+ Emit debug information for struct-like types only when the base
+ name of the compilation source file matches the base name of file
+ in which the struct was defined.
+
+ This option substantially reduces the size of debugging
+ information, but at significant potential loss in type information
+ to the debugger. See `-femit-struct-debug-reduced' for a less
+ aggressive option. See `-femit-struct-debug-detailed' for more
+ detailed control.
+
+ This option works only with DWARF 2.
+
+`-femit-struct-debug-reduced'
+ Emit debug information for struct-like types only when the base
+ name of the compilation source file matches the base name of file
+ in which the type was defined, unless the struct is a template or
+ defined in a system header.
+
+ This option significantly reduces the size of debugging
+ information, with some potential loss in type information to the
+ debugger. See `-femit-struct-debug-baseonly' for a more
+ aggressive option. See `-femit-struct-debug-detailed' for more
+ detailed control.
+
+ This option works only with DWARF 2.
+
+`-femit-struct-debug-detailed[=SPEC-LIST]'
+ Specify the struct-like types for which the compiler will generate
+ debug information. The intent is to reduce duplicate struct debug
+ information between different object files within the same program.
+
+ This option is a detailed version of `-femit-struct-debug-reduced'
+ and `-femit-struct-debug-baseonly', which will serve for most
+ needs.
+
+ A specification has the syntax
+ [`dir:'|`ind:'][`ord:'|`gen:'](`any'|`sys'|`base'|`none')
+
+ The optional first word limits the specification to structs that
+ are used directly (`dir:') or used indirectly (`ind:'). A struct
+ type is used directly when it is the type of a variable, member.
+ Indirect uses arise through pointers to structs. That is, when
+ use of an incomplete struct would be legal, the use is indirect.
+ An example is `struct one direct; struct two * indirect;'.
+
+ The optional second word limits the specification to ordinary
+ structs (`ord:') or generic structs (`gen:'). Generic structs are
+ a bit complicated to explain. For C++, these are non-explicit
+ specializations of template classes, or non-template classes
+ within the above. Other programming languages have generics, but
+ `-femit-struct-debug-detailed' does not yet implement them.
+
+ The third word specifies the source files for those structs for
+ which the compiler will emit debug information. The values `none'
+ and `any' have the normal meaning. The value `base' means that
+ the base of name of the file in which the type declaration appears
+ must match the base of the name of the main compilation file. In
+ practice, this means that types declared in `foo.c' and `foo.h'
+ will have debug information, but types declared in other header
+ will not. The value `sys' means those types satisfying `base' or
+ declared in system or compiler headers.
+
+ You may need to experiment to determine the best settings for your
+ application.
+
+ The default is `-femit-struct-debug-detailed=all'.
+
+ This option works only with DWARF 2.
+
+`-fno-merge-debug-strings'
+ Direct the linker to not merge together strings in the debugging
+ information which are identical in different object files.
+ Merging is not supported by all assemblers or linkers. Merging
+ decreases the size of the debug information in the output file at
+ the cost of increasing link processing time. Merging is enabled
+ by default.
+
+`-fdebug-prefix-map=OLD=NEW'
+ When compiling files in directory `OLD', record debugging
+ information describing them as in `NEW' instead.
+
+`-fno-dwarf2-cfi-asm'
+ Emit DWARF 2 unwind info as compiler generated `.eh_frame' section
+ instead of using GAS `.cfi_*' directives.
+
+`-p'
+ Generate extra code to write profile information suitable for the
+ analysis program `prof'. You must use this option when compiling
+ the source files you want data about, and you must also use it when
+ linking.
+
+`-pg'
+ Generate extra code to write profile information suitable for the
+ analysis program `gprof'. You must use this option when compiling
+ the source files you want data about, and you must also use it when
+ linking.
+
+`-Q'
+ Makes the compiler print out each function name as it is compiled,
+ and print some statistics about each pass when it finishes.
+
+`-ftime-report'
+ Makes the compiler print some statistics about the time consumed
+ by each pass when it finishes.
+
+`-fmem-report'
+ Makes the compiler print some statistics about permanent memory
+ allocation when it finishes.
+
+`-fpre-ipa-mem-report'
+
+`-fpost-ipa-mem-report'
+ Makes the compiler print some statistics about permanent memory
+ allocation before or after interprocedural optimization.
+
+`-fprofile-arcs'
+ Add code so that program flow "arcs" are instrumented. During
+ execution the program records how many times each branch and call
+ is executed and how many times it is taken or returns. When the
+ compiled program exits it saves this data to a file called
+ `AUXNAME.gcda' for each source file. The data may be used for
+ profile-directed optimizations (`-fbranch-probabilities'), or for
+ test coverage analysis (`-ftest-coverage'). Each object file's
+ AUXNAME is generated from the name of the output file, if
+ explicitly specified and it is not the final executable, otherwise
+ it is the basename of the source file. In both cases any suffix
+ is removed (e.g. `foo.gcda' for input file `dir/foo.c', or
+ `dir/foo.gcda' for output file specified as `-o dir/foo.o').
+ *Note Cross-profiling::.
+
+`--coverage'
+ This option is used to compile and link code instrumented for
+ coverage analysis. The option is a synonym for `-fprofile-arcs'
+ `-ftest-coverage' (when compiling) and `-lgcov' (when linking).
+ See the documentation for those options for more details.
+
+ * Compile the source files with `-fprofile-arcs' plus
+ optimization and code generation options. For test coverage
+ analysis, use the additional `-ftest-coverage' option. You
+ do not need to profile every source file in a program.
+
+ * Link your object files with `-lgcov' or `-fprofile-arcs' (the
+ latter implies the former).
+
+ * Run the program on a representative workload to generate the
+ arc profile information. This may be repeated any number of
+ times. You can run concurrent instances of your program, and
+ provided that the file system supports locking, the data
+ files will be correctly updated. Also `fork' calls are
+ detected and correctly handled (double counting will not
+ happen).
+
+ * For profile-directed optimizations, compile the source files
+ again with the same optimization and code generation options
+ plus `-fbranch-probabilities' (*note Options that Control
+ Optimization: Optimize Options.).
+
+ * For test coverage analysis, use `gcov' to produce human
+ readable information from the `.gcno' and `.gcda' files.
+ Refer to the `gcov' documentation for further information.
+
+
+ With `-fprofile-arcs', for each function of your program GCC
+ creates a program flow graph, then finds a spanning tree for the
+ graph. Only arcs that are not on the spanning tree have to be
+ instrumented: the compiler adds code to count the number of times
+ that these arcs are executed. When an arc is the only exit or
+ only entrance to a block, the instrumentation code can be added to
+ the block; otherwise, a new basic block must be created to hold
+ the instrumentation code.
+
+`-ftest-coverage'
+ Produce a notes file that the `gcov' code-coverage utility (*note
+ `gcov'--a Test Coverage Program: Gcov.) can use to show program
+ coverage. Each source file's note file is called `AUXNAME.gcno'.
+ Refer to the `-fprofile-arcs' option above for a description of
+ AUXNAME and instructions on how to generate test coverage data.
+ Coverage data will match the source files more closely, if you do
+ not optimize.
+
+`-fdbg-cnt-list'
+ Print the name and the counter upperbound for all debug counters.
+
+`-fdbg-cnt=COUNTER-VALUE-LIST'
+ Set the internal debug counter upperbound. COUNTER-VALUE-LIST is a
+ comma-separated list of NAME:VALUE pairs which sets the upperbound
+ of each debug counter NAME to VALUE. All debug counters have the
+ initial upperbound of UINT_MAX, thus dbg_cnt() returns true always
+ unless the upperbound is set by this option. e.g. With
+ -fdbg-cnt=dce:10,tail_call:0 dbg_cnt(dce) will return true only
+ for first 10 invocations and dbg_cnt(tail_call) will return false
+ always.
+
+`-dLETTERS'
+`-fdump-rtl-PASS'
+ Says to make debugging dumps during compilation at times specified
+ by LETTERS. This is used for debugging the RTL-based passes of
+ the compiler. The file names for most of the dumps are made by
+ appending a pass number and a word to the DUMPNAME. DUMPNAME is
+ generated from the name of the output file, if explicitly
+ specified and it is not an executable, otherwise it is the
+ basename of the source file. These switches may have different
+ effects when `-E' is used for preprocessing.
+
+ Debug dumps can be enabled with a `-fdump-rtl' switch or some `-d'
+ option LETTERS. Here are the possible letters for use in PASS and
+ LETTERS, and their meanings:
+
+ `-fdump-rtl-alignments'
+ Dump after branch alignments have been computed.
+
+ `-fdump-rtl-asmcons'
+ Dump after fixing rtl statements that have unsatisfied in/out
+ constraints.
+
+ `-fdump-rtl-auto_inc_dec'
+ Dump after auto-inc-dec discovery. This pass is only run on
+ architectures that have auto inc or auto dec instructions.
+
+ `-fdump-rtl-barriers'
+ Dump after cleaning up the barrier instructions.
+
+ `-fdump-rtl-bbpart'
+ Dump after partitioning hot and cold basic blocks.
+
+ `-fdump-rtl-bbro'
+ Dump after block reordering.
+
+ `-fdump-rtl-btl1'
+ `-fdump-rtl-btl2'
+ `-fdump-rtl-btl1' and `-fdump-rtl-btl2' enable dumping after
+ the two branch target load optimization passes.
+
+ `-fdump-rtl-bypass'
+ Dump after jump bypassing and control flow optimizations.
+
+ `-fdump-rtl-combine'
+ Dump after the RTL instruction combination pass.
+
+ `-fdump-rtl-compgotos'
+ Dump after duplicating the computed gotos.
+
+ `-fdump-rtl-ce1'
+ `-fdump-rtl-ce2'
+ `-fdump-rtl-ce3'
+ `-fdump-rtl-ce1', `-fdump-rtl-ce2', and `-fdump-rtl-ce3'
+ enable dumping after the three if conversion passes.
+
+ `-fdump-rtl-cprop_hardreg'
+ Dump after hard register copy propagation.
+
+ `-fdump-rtl-csa'
+ Dump after combining stack adjustments.
+
+ `-fdump-rtl-cse1'
+ `-fdump-rtl-cse2'
+ `-fdump-rtl-cse1' and `-fdump-rtl-cse2' enable dumping after
+ the two common sub-expression elimination passes.
+
+ `-fdump-rtl-dce'
+ Dump after the standalone dead code elimination passes.
+
+ `-fdump-rtl-dbr'
+ Dump after delayed branch scheduling.
+
+ `-fdump-rtl-dce1'
+ `-fdump-rtl-dce2'
+ `-fdump-rtl-dce1' and `-fdump-rtl-dce2' enable dumping after
+ the two dead store elimination passes.
+
+ `-fdump-rtl-eh'
+ Dump after finalization of EH handling code.
+
+ `-fdump-rtl-eh_ranges'
+ Dump after conversion of EH handling range regions.
+
+ `-fdump-rtl-expand'
+ Dump after RTL generation.
+
+ `-fdump-rtl-fwprop1'
+ `-fdump-rtl-fwprop2'
+ `-fdump-rtl-fwprop1' and `-fdump-rtl-fwprop2' enable dumping
+ after the two forward propagation passes.
+
+ `-fdump-rtl-gcse1'
+ `-fdump-rtl-gcse2'
+ `-fdump-rtl-gcse1' and `-fdump-rtl-gcse2' enable dumping
+ after global common subexpression elimination.
+
+ `-fdump-rtl-init-regs'
+ Dump after the initialization of the registers.
+
+ `-fdump-rtl-initvals'
+ Dump after the computation of the initial value sets.
+
+ `-fdump-rtl-into_cfglayout'
+ Dump after converting to cfglayout mode.
+
+ `-fdump-rtl-ira'
+ Dump after iterated register allocation.
+
+ `-fdump-rtl-jump'
+ Dump after the second jump optimization.
+
+ `-fdump-rtl-loop2'
+ `-fdump-rtl-loop2' enables dumping after the rtl loop
+ optimization passes.
+
+ `-fdump-rtl-mach'
+ Dump after performing the machine dependent reorganization
+ pass, if that pass exists.
+
+ `-fdump-rtl-mode_sw'
+ Dump after removing redundant mode switches.
+
+ `-fdump-rtl-rnreg'
+ Dump after register renumbering.
+
+ `-fdump-rtl-outof_cfglayout'
+ Dump after converting from cfglayout mode.
+
+ `-fdump-rtl-peephole2'
+ Dump after the peephole pass.
+
+ `-fdump-rtl-postreload'
+ Dump after post-reload optimizations.
+
+ `-fdump-rtl-pro_and_epilogue'
+ Dump after generating the function pro and epilogues.
+
+ `-fdump-rtl-regmove'
+ Dump after the register move pass.
+
+ `-fdump-rtl-sched1'
+ `-fdump-rtl-sched2'
+ `-fdump-rtl-sched1' and `-fdump-rtl-sched2' enable dumping
+ after the basic block scheduling passes.
+
+ `-fdump-rtl-see'
+ Dump after sign extension elimination.
+
+ `-fdump-rtl-seqabstr'
+ Dump after common sequence discovery.
+
+ `-fdump-rtl-shorten'
+ Dump after shortening branches.
+
+ `-fdump-rtl-sibling'
+ Dump after sibling call optimizations.
+
+ `-fdump-rtl-split1'
+ `-fdump-rtl-split2'
+ `-fdump-rtl-split3'
+ `-fdump-rtl-split4'
+ `-fdump-rtl-split5'
+ `-fdump-rtl-split1', `-fdump-rtl-split2',
+ `-fdump-rtl-split3', `-fdump-rtl-split4' and
+ `-fdump-rtl-split5' enable dumping after five rounds of
+ instruction splitting.
+
+ `-fdump-rtl-sms'
+ Dump after modulo scheduling. This pass is only run on some
+ architectures.
+
+ `-fdump-rtl-stack'
+ Dump after conversion from GCC's "flat register file"
+ registers to the x87's stack-like registers. This pass is
+ only run on x86 variants.
+
+ `-fdump-rtl-subreg1'
+ `-fdump-rtl-subreg2'
+ `-fdump-rtl-subreg1' and `-fdump-rtl-subreg2' enable dumping
+ after the two subreg expansion passes.
+
+ `-fdump-rtl-unshare'
+ Dump after all rtl has been unshared.
+
+ `-fdump-rtl-vartrack'
+ Dump after variable tracking.
+
+ `-fdump-rtl-vregs'
+ Dump after converting virtual registers to hard registers.
+
+ `-fdump-rtl-web'
+ Dump after live range splitting.
+
+ `-fdump-rtl-regclass'
+ `-fdump-rtl-subregs_of_mode_init'
+ `-fdump-rtl-subregs_of_mode_finish'
+ `-fdump-rtl-dfinit'
+ `-fdump-rtl-dfinish'
+ These dumps are defined but always produce empty files.
+
+ `-fdump-rtl-all'
+ Produce all the dumps listed above.
+
+ `-dA'
+ Annotate the assembler output with miscellaneous debugging
+ information.
+
+ `-dD'
+ Dump all macro definitions, at the end of preprocessing, in
+ addition to normal output.
+
+ `-dH'
+ Produce a core dump whenever an error occurs.
+
+ `-dm'
+ Print statistics on memory usage, at the end of the run, to
+ standard error.
+
+ `-dp'
+ Annotate the assembler output with a comment indicating which
+ pattern and alternative was used. The length of each
+ instruction is also printed.
+
+ `-dP'
+ Dump the RTL in the assembler output as a comment before each
+ instruction. Also turns on `-dp' annotation.
+
+ `-dv'
+ For each of the other indicated dump files
+ (`-fdump-rtl-PASS'), dump a representation of the control
+ flow graph suitable for viewing with VCG to `FILE.PASS.vcg'.
+
+ `-dx'
+ Just generate RTL for a function instead of compiling it.
+ Usually used with `-fdump-rtl-expand'.
+
+ `-dy'
+ Dump debugging information during parsing, to standard error.
+
+`-fdump-noaddr'
+ When doing debugging dumps, suppress address output. This makes
+ it more feasible to use diff on debugging dumps for compiler
+ invocations with different compiler binaries and/or different text
+ / bss / data / heap / stack / dso start locations.
+
+`-fdump-unnumbered'
+ When doing debugging dumps, suppress instruction numbers and
+ address output. This makes it more feasible to use diff on
+ debugging dumps for compiler invocations with different options,
+ in particular with and without `-g'.
+
+`-fdump-translation-unit (C++ only)'
+`-fdump-translation-unit-OPTIONS (C++ only)'
+ Dump a representation of the tree structure for the entire
+ translation unit to a file. The file name is made by appending
+ `.tu' to the source file name. If the `-OPTIONS' form is used,
+ OPTIONS controls the details of the dump as described for the
+ `-fdump-tree' options.
+
+`-fdump-class-hierarchy (C++ only)'
+`-fdump-class-hierarchy-OPTIONS (C++ only)'
+ Dump a representation of each class's hierarchy and virtual
+ function table layout to a file. The file name is made by
+ appending `.class' to the source file name. If the `-OPTIONS'
+ form is used, OPTIONS controls the details of the dump as
+ described for the `-fdump-tree' options.
+
+`-fdump-ipa-SWITCH'
+ Control the dumping at various stages of inter-procedural analysis
+ language tree to a file. The file name is generated by appending
+ a switch specific suffix to the source file name. The following
+ dumps are possible:
+
+ `all'
+ Enables all inter-procedural analysis dumps.
+
+ `cgraph'
+ Dumps information about call-graph optimization, unused
+ function removal, and inlining decisions.
+
+ `inline'
+ Dump after function inlining.
+
+
+`-fdump-statistics-OPTION'
+ Enable and control dumping of pass statistics in a separate file.
+ The file name is generated by appending a suffix ending in
+ `.statistics' to the source file name. If the `-OPTION' form is
+ used, `-stats' will cause counters to be summed over the whole
+ compilation unit while `-details' will dump every event as the
+ passes generate them. The default with no option is to sum
+ counters for each function compiled.
+
+`-fdump-tree-SWITCH'
+`-fdump-tree-SWITCH-OPTIONS'
+ Control the dumping at various stages of processing the
+ intermediate language tree to a file. The file name is generated
+ by appending a switch specific suffix to the source file name. If
+ the `-OPTIONS' form is used, OPTIONS is a list of `-' separated
+ options that control the details of the dump. Not all options are
+ applicable to all dumps, those which are not meaningful will be
+ ignored. The following options are available
+
+ `address'
+ Print the address of each node. Usually this is not
+ meaningful as it changes according to the environment and
+ source file. Its primary use is for tying up a dump file
+ with a debug environment.
+
+ `slim'
+ Inhibit dumping of members of a scope or body of a function
+ merely because that scope has been reached. Only dump such
+ items when they are directly reachable by some other path.
+ When dumping pretty-printed trees, this option inhibits
+ dumping the bodies of control structures.
+
+ `raw'
+ Print a raw representation of the tree. By default, trees are
+ pretty-printed into a C-like representation.
+
+ `details'
+ Enable more detailed dumps (not honored by every dump option).
+
+ `stats'
+ Enable dumping various statistics about the pass (not honored
+ by every dump option).
+
+ `blocks'
+ Enable showing basic block boundaries (disabled in raw dumps).
+
+ `vops'
+ Enable showing virtual operands for every statement.
+
+ `lineno'
+ Enable showing line numbers for statements.
+
+ `uid'
+ Enable showing the unique ID (`DECL_UID') for each variable.
+
+ `verbose'
+ Enable showing the tree dump for each statement.
+
+ `all'
+ Turn on all options, except `raw', `slim', `verbose' and
+ `lineno'.
+
+ The following tree dumps are possible:
+ `original'
+ Dump before any tree based optimization, to `FILE.original'.
+
+ `optimized'
+ Dump after all tree based optimization, to `FILE.optimized'.
+
+ `gimple'
+ Dump each function before and after the gimplification pass
+ to a file. The file name is made by appending `.gimple' to
+ the source file name.
+
+ `cfg'
+ Dump the control flow graph of each function to a file. The
+ file name is made by appending `.cfg' to the source file name.
+
+ `vcg'
+ Dump the control flow graph of each function to a file in VCG
+ format. The file name is made by appending `.vcg' to the
+ source file name. Note that if the file contains more than
+ one function, the generated file cannot be used directly by
+ VCG. You will need to cut and paste each function's graph
+ into its own separate file first.
+
+ `ch'
+ Dump each function after copying loop headers. The file name
+ is made by appending `.ch' to the source file name.
+
+ `ssa'
+ Dump SSA related information to a file. The file name is
+ made by appending `.ssa' to the source file name.
+
+ `alias'
+ Dump aliasing information for each function. The file name
+ is made by appending `.alias' to the source file name.
+
+ `ccp'
+ Dump each function after CCP. The file name is made by
+ appending `.ccp' to the source file name.
+
+ `storeccp'
+ Dump each function after STORE-CCP. The file name is made by
+ appending `.storeccp' to the source file name.
+
+ `pre'
+ Dump trees after partial redundancy elimination. The file
+ name is made by appending `.pre' to the source file name.
+
+ `fre'
+ Dump trees after full redundancy elimination. The file name
+ is made by appending `.fre' to the source file name.
+
+ `copyprop'
+ Dump trees after copy propagation. The file name is made by
+ appending `.copyprop' to the source file name.
+
+ `store_copyprop'
+ Dump trees after store copy-propagation. The file name is
+ made by appending `.store_copyprop' to the source file name.
+
+ `dce'
+ Dump each function after dead code elimination. The file
+ name is made by appending `.dce' to the source file name.
+
+ `mudflap'
+ Dump each function after adding mudflap instrumentation. The
+ file name is made by appending `.mudflap' to the source file
+ name.
+
+ `sra'
+ Dump each function after performing scalar replacement of
+ aggregates. The file name is made by appending `.sra' to the
+ source file name.
+
+ `sink'
+ Dump each function after performing code sinking. The file
+ name is made by appending `.sink' to the source file name.
+
+ `dom'
+ Dump each function after applying dominator tree
+ optimizations. The file name is made by appending `.dom' to
+ the source file name.
+
+ `dse'
+ Dump each function after applying dead store elimination.
+ The file name is made by appending `.dse' to the source file
+ name.
+
+ `phiopt'
+ Dump each function after optimizing PHI nodes into
+ straightline code. The file name is made by appending
+ `.phiopt' to the source file name.
+
+ `forwprop'
+ Dump each function after forward propagating single use
+ variables. The file name is made by appending `.forwprop' to
+ the source file name.
+
+ `copyrename'
+ Dump each function after applying the copy rename
+ optimization. The file name is made by appending
+ `.copyrename' to the source file name.
+
+ `nrv'
+ Dump each function after applying the named return value
+ optimization on generic trees. The file name is made by
+ appending `.nrv' to the source file name.
+
+ `vect'
+ Dump each function after applying vectorization of loops.
+ The file name is made by appending `.vect' to the source file
+ name.
+
+ `vrp'
+ Dump each function after Value Range Propagation (VRP). The
+ file name is made by appending `.vrp' to the source file name.
+
+ `all'
+ Enable all the available tree dumps with the flags provided
+ in this option.
+
+`-ftree-vectorizer-verbose=N'
+ This option controls the amount of debugging output the vectorizer
+ prints. This information is written to standard error, unless
+ `-fdump-tree-all' or `-fdump-tree-vect' is specified, in which
+ case it is output to the usual dump listing file, `.vect'. For
+ N=0 no diagnostic information is reported. If N=1 the vectorizer
+ reports each loop that got vectorized, and the total number of
+ loops that got vectorized. If N=2 the vectorizer also reports
+ non-vectorized loops that passed the first analysis phase
+ (vect_analyze_loop_form) - i.e. countable, inner-most, single-bb,
+ single-entry/exit loops. This is the same verbosity level that
+ `-fdump-tree-vect-stats' uses. Higher verbosity levels mean
+ either more information dumped for each reported loop, or same
+ amount of information reported for more loops: If N=3, alignment
+ related information is added to the reports. If N=4,
+ data-references related information (e.g. memory dependences,
+ memory access-patterns) is added to the reports. If N=5, the
+ vectorizer reports also non-vectorized inner-most loops that did
+ not pass the first analysis phase (i.e., may not be countable, or
+ may have complicated control-flow). If N=6, the vectorizer
+ reports also non-vectorized nested loops. For N=7, all the
+ information the vectorizer generates during its analysis and
+ transformation is reported. This is the same verbosity level that
+ `-fdump-tree-vect-details' uses.
+
+`-frandom-seed=STRING'
+ This option provides a seed that GCC uses when it would otherwise
+ use random numbers. It is used to generate certain symbol names
+ that have to be different in every compiled file. It is also used
+ to place unique stamps in coverage data files and the object files
+ that produce them. You can use the `-frandom-seed' option to
+ produce reproducibly identical object files.
+
+ The STRING should be different for every file you compile.
+
+`-fsched-verbose=N'
+ On targets that use instruction scheduling, this option controls
+ the amount of debugging output the scheduler prints. This
+ information is written to standard error, unless
+ `-fdump-rtl-sched1' or `-fdump-rtl-sched2' is specified, in which
+ case it is output to the usual dump listing file, `.sched' or
+ `.sched2' respectively. However for N greater than nine, the
+ output is always printed to standard error.
+
+ For N greater than zero, `-fsched-verbose' outputs the same
+ information as `-fdump-rtl-sched1' and `-fdump-rtl-sched2'. For N
+ greater than one, it also output basic block probabilities,
+ detailed ready list information and unit/insn info. For N greater
+ than two, it includes RTL at abort point, control-flow and regions
+ info. And for N over four, `-fsched-verbose' also includes
+ dependence info.
+
+`-save-temps'
+ Store the usual "temporary" intermediate files permanently; place
+ them in the current directory and name them based on the source
+ file. Thus, compiling `foo.c' with `-c -save-temps' would produce
+ files `foo.i' and `foo.s', as well as `foo.o'. This creates a
+ preprocessed `foo.i' output file even though the compiler now
+ normally uses an integrated preprocessor.
+
+ When used in combination with the `-x' command line option,
+ `-save-temps' is sensible enough to avoid over writing an input
+ source file with the same extension as an intermediate file. The
+ corresponding intermediate file may be obtained by renaming the
+ source file before using `-save-temps'.
+
+`-time'
+ Report the CPU time taken by each subprocess in the compilation
+ sequence. For C source files, this is the compiler proper and
+ assembler (plus the linker if linking is done). The output looks
+ like this:
+
+ # cc1 0.12 0.01
+ # as 0.00 0.01
+
+ The first number on each line is the "user time", that is time
+ spent executing the program itself. The second number is "system
+ time", time spent executing operating system routines on behalf of
+ the program. Both numbers are in seconds.
+
+`-fvar-tracking'
+ Run variable tracking pass. It computes where variables are
+ stored at each position in code. Better debugging information is
+ then generated (if the debugging information format supports this
+ information).
+
+ It is enabled by default when compiling with optimization (`-Os',
+ `-O', `-O2', ...), debugging information (`-g') and the debug info
+ format supports it.
+
+`-print-file-name=LIBRARY'
+ Print the full absolute name of the library file LIBRARY that
+ would be used when linking--and don't do anything else. With this
+ option, GCC does not compile or link anything; it just prints the
+ file name.
+
+`-print-multi-directory'
+ Print the directory name corresponding to the multilib selected by
+ any other switches present in the command line. This directory is
+ supposed to exist in `GCC_EXEC_PREFIX'.
+
+`-print-multi-lib'
+ Print the mapping from multilib directory names to compiler
+ switches that enable them. The directory name is separated from
+ the switches by `;', and each switch starts with an `@' instead of
+ the `-', without spaces between multiple switches. This is
+ supposed to ease shell-processing.
+
+`-print-prog-name=PROGRAM'
+ Like `-print-file-name', but searches for a program such as `cpp'.
+
+`-print-libgcc-file-name'
+ Same as `-print-file-name=libgcc.a'.
+
+ This is useful when you use `-nostdlib' or `-nodefaultlibs' but
+ you do want to link with `libgcc.a'. You can do
+
+ gcc -nostdlib FILES... `gcc -print-libgcc-file-name`
+
+`-print-search-dirs'
+ Print the name of the configured installation directory and a list
+ of program and library directories `gcc' will search--and don't do
+ anything else.
+
+ This is useful when `gcc' prints the error message `installation
+ problem, cannot exec cpp0: No such file or directory'. To resolve
+ this you either need to put `cpp0' and the other compiler
+ components where `gcc' expects to find them, or you can set the
+ environment variable `GCC_EXEC_PREFIX' to the directory where you
+ installed them. Don't forget the trailing `/'. *Note Environment
+ Variables::.
+
+`-print-sysroot'
+ Print the target sysroot directory that will be used during
+ compilation. This is the target sysroot specified either at
+ configure time or using the `--sysroot' option, possibly with an
+ extra suffix that depends on compilation options. If no target
+ sysroot is specified, the option prints nothing.
+
+`-print-sysroot-headers-suffix'
+ Print the suffix added to the target sysroot when searching for
+ headers, or give an error if the compiler is not configured with
+ such a suffix--and don't do anything else.
+
+`-dumpmachine'
+ Print the compiler's target machine (for example,
+ `i686-pc-linux-gnu')--and don't do anything else.
+
+`-dumpversion'
+ Print the compiler version (for example, `3.0')--and don't do
+ anything else.
+
+`-dumpspecs'
+ Print the compiler's built-in specs--and don't do anything else.
+ (This is used when GCC itself is being built.) *Note Spec Files::.
+
+`-feliminate-unused-debug-types'
+ Normally, when producing DWARF2 output, GCC will emit debugging
+ information for all types declared in a compilation unit,
+ regardless of whether or not they are actually used in that
+ compilation unit. Sometimes this is useful, such as if, in the
+ debugger, you want to cast a value to a type that is not actually
+ used in your program (but is declared). More often, however, this
+ results in a significant amount of wasted space. With this
+ option, GCC will avoid producing debug symbol output for types
+ that are nowhere used in the source file being compiled.
+
+
+File: gcc.info, Node: Optimize Options, Next: Preprocessor Options, Prev: Debugging Options, Up: Invoking GCC
+
+3.10 Options That Control Optimization
+======================================
+
+These options control various sorts of optimizations.
+
+ Without any optimization option, the compiler's goal is to reduce the
+cost of compilation and to make debugging produce the expected results.
+Statements are independent: if you stop the program with a breakpoint
+between statements, you can then assign a new value to any variable or
+change the program counter to any other statement in the function and
+get exactly the results you would expect from the source code.
+
+ Turning on optimization flags makes the compiler attempt to improve
+the performance and/or code size at the expense of compilation time and
+possibly the ability to debug the program.
+
+ The compiler performs optimization based on the knowledge it has of the
+program. Compiling multiple files at once to a single output file mode
+allows the compiler to use information gained from all of the files
+when compiling each of them.
+
+ Not all optimizations are controlled directly by a flag. Only
+optimizations that have a flag are listed.
+
+`-O'
+`-O1'
+ Optimize. Optimizing compilation takes somewhat more time, and a
+ lot more memory for a large function.
+
+ With `-O', the compiler tries to reduce code size and execution
+ time, without performing any optimizations that take a great deal
+ of compilation time.
+
+ `-O' turns on the following optimization flags:
+ -fauto-inc-dec
+ -fcprop-registers
+ -fdce
+ -fdefer-pop
+ -fdelayed-branch
+ -fdse
+ -fguess-branch-probability
+ -fif-conversion2
+ -fif-conversion
+ -finline-small-functions
+ -fipa-pure-const
+ -fipa-reference
+ -fmerge-constants
+ -fsplit-wide-types
+ -ftree-builtin-call-dce
+ -ftree-ccp
+ -ftree-ch
+ -ftree-copyrename
+ -ftree-dce
+ -ftree-dominator-opts
+ -ftree-dse
+ -ftree-fre
+ -ftree-sra
+ -ftree-ter
+ -funit-at-a-time
+
+ `-O' also turns on `-fomit-frame-pointer' on machines where doing
+ so does not interfere with debugging.
+
+`-O2'
+ Optimize even more. GCC performs nearly all supported
+ optimizations that do not involve a space-speed tradeoff. As
+ compared to `-O', this option increases both compilation time and
+ the performance of the generated code.
+
+ `-O2' turns on all optimization flags specified by `-O'. It also
+ turns on the following optimization flags:
+ -fthread-jumps
+ -falign-functions -falign-jumps
+ -falign-loops -falign-labels
+ -fcaller-saves
+ -fcrossjumping
+ -fcse-follow-jumps -fcse-skip-blocks
+ -fdelete-null-pointer-checks
+ -fexpensive-optimizations
+ -fgcse -fgcse-lm
+ -findirect-inlining
+ -foptimize-sibling-calls
+ -fpeephole2
+ -fregmove
+ -freorder-blocks -freorder-functions
+ -frerun-cse-after-loop
+ -fsched-interblock -fsched-spec
+ -fschedule-insns -fschedule-insns2
+ -fstrict-aliasing -fstrict-overflow
+ -ftree-switch-conversion
+ -ftree-pre
+ -ftree-vrp
+
+ Please note the warning under `-fgcse' about invoking `-O2' on
+ programs that use computed gotos.
+
+`-O3'
+ Optimize yet more. `-O3' turns on all optimizations specified by
+ `-O2' and also turns on the `-finline-functions',
+ `-funswitch-loops', `-fpredictive-commoning',
+ `-fgcse-after-reload' and `-ftree-vectorize' options.
+
+`-O0'
+ Reduce compilation time and make debugging produce the expected
+ results. This is the default.
+
+`-Os'
+ Optimize for size. `-Os' enables all `-O2' optimizations that do
+ not typically increase code size. It also performs further
+ optimizations designed to reduce code size.
+
+ `-Os' disables the following optimization flags:
+ -falign-functions -falign-jumps -falign-loops
+ -falign-labels -freorder-blocks -freorder-blocks-and-partition
+ -fprefetch-loop-arrays -ftree-vect-loop-version
+
+ If you use multiple `-O' options, with or without level numbers,
+ the last such option is the one that is effective.
+
+ Options of the form `-fFLAG' specify machine-independent flags. Most
+flags have both positive and negative forms; the negative form of
+`-ffoo' would be `-fno-foo'. In the table below, only one of the forms
+is listed--the one you typically will use. You can figure out the
+other form by either removing `no-' or adding it.
+
+ The following options control specific optimizations. They are either
+activated by `-O' options or are related to ones that are. You can use
+the following flags in the rare cases when "fine-tuning" of
+optimizations to be performed is desired.
+
+`-fno-default-inline'
+ Do not make member functions inline by default merely because they
+ are defined inside the class scope (C++ only). Otherwise, when
+ you specify `-O', member functions defined inside class scope are
+ compiled inline by default; i.e., you don't need to add `inline'
+ in front of the member function name.
+
+`-fno-defer-pop'
+ Always pop the arguments to each function call as soon as that
+ function returns. For machines which must pop arguments after a
+ function call, the compiler normally lets arguments accumulate on
+ the stack for several function calls and pops them all at once.
+
+ Disabled at levels `-O', `-O2', `-O3', `-Os'.
+
+`-fforward-propagate'
+ Perform a forward propagation pass on RTL. The pass tries to
+ combine two instructions and checks if the result can be
+ simplified. If loop unrolling is active, two passes are performed
+ and the second is scheduled after loop unrolling.
+
+ This option is enabled by default at optimization levels `-O2',
+ `-O3', `-Os'.
+
+`-fomit-frame-pointer'
+ Don't keep the frame pointer in a register for functions that
+ don't need one. This avoids the instructions to save, set up and
+ restore frame pointers; it also makes an extra register available
+ in many functions. *It also makes debugging impossible on some
+ machines.*
+
+ On some machines, such as the VAX, this flag has no effect, because
+ the standard calling sequence automatically handles the frame
+ pointer and nothing is saved by pretending it doesn't exist. The
+ machine-description macro `FRAME_POINTER_REQUIRED' controls
+ whether a target machine supports this flag. *Note Register
+ Usage: (gccint)Registers.
+
+ Enabled at levels `-O', `-O2', `-O3', `-Os'.
+
+`-foptimize-sibling-calls'
+ Optimize sibling and tail recursive calls.
+
+ Enabled at levels `-O2', `-O3', `-Os'.
+
+`-fno-inline'
+ Don't pay attention to the `inline' keyword. Normally this option
+ is used to keep the compiler from expanding any functions inline.
+ Note that if you are not optimizing, no functions can be expanded
+ inline.
+
+`-finline-small-functions'
+ Integrate functions into their callers when their body is smaller
+ than expected function call code (so overall size of program gets
+ smaller). The compiler heuristically decides which functions are
+ simple enough to be worth integrating in this way.
+
+ Enabled at level `-O2'.
+
+`-findirect-inlining'
+ Inline also indirect calls that are discovered to be known at
+ compile time thanks to previous inlining. This option has any
+ effect only when inlining itself is turned on by the
+ `-finline-functions' or `-finline-small-functions' options.
+
+ Enabled at level `-O2'.
+
+`-finline-functions'
+ Integrate all simple functions into their callers. The compiler
+ heuristically decides which functions are simple enough to be worth
+ integrating in this way.
+
+ If all calls to a given function are integrated, and the function
+ is declared `static', then the function is normally not output as
+ assembler code in its own right.
+
+ Enabled at level `-O3'.
+
+`-finline-functions-called-once'
+ Consider all `static' functions called once for inlining into their
+ caller even if they are not marked `inline'. If a call to a given
+ function is integrated, then the function is not output as
+ assembler code in its own right.
+
+ Enabled at levels `-O1', `-O2', `-O3' and `-Os'.
+
+`-fearly-inlining'
+ Inline functions marked by `always_inline' and functions whose
+ body seems smaller than the function call overhead early before
+ doing `-fprofile-generate' instrumentation and real inlining pass.
+ Doing so makes profiling significantly cheaper and usually
+ inlining faster on programs having large chains of nested wrapper
+ functions.
+
+ Enabled by default.
+
+`-finline-limit=N'
+ By default, GCC limits the size of functions that can be inlined.
+ This flag allows coarse control of this limit. N is the size of
+ functions that can be inlined in number of pseudo instructions.
+
+ Inlining is actually controlled by a number of parameters, which
+ may be specified individually by using `--param NAME=VALUE'. The
+ `-finline-limit=N' option sets some of these parameters as follows:
+
+ `max-inline-insns-single'
+ is set to N/2.
+
+ `max-inline-insns-auto'
+ is set to N/2.
+
+ See below for a documentation of the individual parameters
+ controlling inlining and for the defaults of these parameters.
+
+ _Note:_ there may be no value to `-finline-limit' that results in
+ default behavior.
+
+ _Note:_ pseudo instruction represents, in this particular context,
+ an abstract measurement of function's size. In no way does it
+ represent a count of assembly instructions and as such its exact
+ meaning might change from one release to an another.
+
+`-fkeep-inline-functions'
+ In C, emit `static' functions that are declared `inline' into the
+ object file, even if the function has been inlined into all of its
+ callers. This switch does not affect functions using the `extern
+ inline' extension in GNU C89. In C++, emit any and all inline
+ functions into the object file.
+
+`-fkeep-static-consts'
+ Emit variables declared `static const' when optimization isn't
+ turned on, even if the variables aren't referenced.
+
+ GCC enables this option by default. If you want to force the
+ compiler to check if the variable was referenced, regardless of
+ whether or not optimization is turned on, use the
+ `-fno-keep-static-consts' option.
+
+`-fmerge-constants'
+ Attempt to merge identical constants (string constants and
+ floating point constants) across compilation units.
+
+ This option is the default for optimized compilation if the
+ assembler and linker support it. Use `-fno-merge-constants' to
+ inhibit this behavior.
+
+ Enabled at levels `-O', `-O2', `-O3', `-Os'.
+
+`-fmerge-all-constants'
+ Attempt to merge identical constants and identical variables.
+
+ This option implies `-fmerge-constants'. In addition to
+ `-fmerge-constants' this considers e.g. even constant initialized
+ arrays or initialized constant variables with integral or floating
+ point types. Languages like C or C++ require each variable,
+ including multiple instances of the same variable in recursive
+ calls, to have distinct locations, so using this option will
+ result in non-conforming behavior.
+
+`-fmodulo-sched'
+ Perform swing modulo scheduling immediately before the first
+ scheduling pass. This pass looks at innermost loops and reorders
+ their instructions by overlapping different iterations.
+
+`-fmodulo-sched-allow-regmoves'
+ Perform more aggressive SMS based modulo scheduling with register
+ moves allowed. By setting this flag certain anti-dependences
+ edges will be deleted which will trigger the generation of
+ reg-moves based on the life-range analysis. This option is
+ effective only with `-fmodulo-sched' enabled.
+
+`-fno-branch-count-reg'
+ Do not use "decrement and branch" instructions on a count register,
+ but instead generate a sequence of instructions that decrement a
+ register, compare it against zero, then branch based upon the
+ result. This option is only meaningful on architectures that
+ support such instructions, which include x86, PowerPC, IA-64 and
+ S/390.
+
+ The default is `-fbranch-count-reg'.
+
+`-fno-function-cse'
+ Do not put function addresses in registers; make each instruction
+ that calls a constant function contain the function's address
+ explicitly.
+
+ This option results in less efficient code, but some strange hacks
+ that alter the assembler output may be confused by the
+ optimizations performed when this option is not used.
+
+ The default is `-ffunction-cse'
+
+`-fno-zero-initialized-in-bss'
+ If the target supports a BSS section, GCC by default puts
+ variables that are initialized to zero into BSS. This can save
+ space in the resulting code.
+
+ This option turns off this behavior because some programs
+ explicitly rely on variables going to the data section. E.g., so
+ that the resulting executable can find the beginning of that
+ section and/or make assumptions based on that.
+
+ The default is `-fzero-initialized-in-bss'.
+
+`-fmudflap -fmudflapth -fmudflapir'
+ For front-ends that support it (C and C++), instrument all risky
+ pointer/array dereferencing operations, some standard library
+ string/heap functions, and some other associated constructs with
+ range/validity tests. Modules so instrumented should be immune to
+ buffer overflows, invalid heap use, and some other classes of C/C++
+ programming errors. The instrumentation relies on a separate
+ runtime library (`libmudflap'), which will be linked into a
+ program if `-fmudflap' is given at link time. Run-time behavior
+ of the instrumented program is controlled by the `MUDFLAP_OPTIONS'
+ environment variable. See `env MUDFLAP_OPTIONS=-help a.out' for
+ its options.
+
+ Use `-fmudflapth' instead of `-fmudflap' to compile and to link if
+ your program is multi-threaded. Use `-fmudflapir', in addition to
+ `-fmudflap' or `-fmudflapth', if instrumentation should ignore
+ pointer reads. This produces less instrumentation (and therefore
+ faster execution) and still provides some protection against
+ outright memory corrupting writes, but allows erroneously read
+ data to propagate within a program.
+
+`-fthread-jumps'
+ Perform optimizations where we check to see if a jump branches to a
+ location where another comparison subsumed by the first is found.
+ If so, the first branch is redirected to either the destination of
+ the second branch or a point immediately following it, depending
+ on whether the condition is known to be true or false.
+
+ Enabled at levels `-O2', `-O3', `-Os'.
+
+`-fsplit-wide-types'
+ When using a type that occupies multiple registers, such as `long
+ long' on a 32-bit system, split the registers apart and allocate
+ them independently. This normally generates better code for those
+ types, but may make debugging more difficult.
+
+ Enabled at levels `-O', `-O2', `-O3', `-Os'.
+
+`-fcse-follow-jumps'
+ In common subexpression elimination (CSE), scan through jump
+ instructions when the target of the jump is not reached by any
+ other path. For example, when CSE encounters an `if' statement
+ with an `else' clause, CSE will follow the jump when the condition
+ tested is false.
+
+ Enabled at levels `-O2', `-O3', `-Os'.
+
+`-fcse-skip-blocks'
+ This is similar to `-fcse-follow-jumps', but causes CSE to follow
+ jumps which conditionally skip over blocks. When CSE encounters a
+ simple `if' statement with no else clause, `-fcse-skip-blocks'
+ causes CSE to follow the jump around the body of the `if'.
+
+ Enabled at levels `-O2', `-O3', `-Os'.
+
+`-frerun-cse-after-loop'
+ Re-run common subexpression elimination after loop optimizations
+ has been performed.
+
+ Enabled at levels `-O2', `-O3', `-Os'.
+
+`-fgcse'
+ Perform a global common subexpression elimination pass. This pass
+ also performs global constant and copy propagation.
+
+ _Note:_ When compiling a program using computed gotos, a GCC
+ extension, you may get better runtime performance if you disable
+ the global common subexpression elimination pass by adding
+ `-fno-gcse' to the command line.
+
+ Enabled at levels `-O2', `-O3', `-Os'.
+
+`-fgcse-lm'
+ When `-fgcse-lm' is enabled, global common subexpression
+ elimination will attempt to move loads which are only killed by
+ stores into themselves. This allows a loop containing a
+ load/store sequence to be changed to a load outside the loop, and
+ a copy/store within the loop.
+
+ Enabled by default when gcse is enabled.
+
+`-fgcse-sm'
+ When `-fgcse-sm' is enabled, a store motion pass is run after
+ global common subexpression elimination. This pass will attempt
+ to move stores out of loops. When used in conjunction with
+ `-fgcse-lm', loops containing a load/store sequence can be changed
+ to a load before the loop and a store after the loop.
+
+ Not enabled at any optimization level.
+
+`-fgcse-las'
+ When `-fgcse-las' is enabled, the global common subexpression
+ elimination pass eliminates redundant loads that come after stores
+ to the same memory location (both partial and full redundancies).
+
+ Not enabled at any optimization level.
+
+`-fgcse-after-reload'
+ When `-fgcse-after-reload' is enabled, a redundant load elimination
+ pass is performed after reload. The purpose of this pass is to
+ cleanup redundant spilling.
+
+`-funsafe-loop-optimizations'
+ If given, the loop optimizer will assume that loop indices do not
+ overflow, and that the loops with nontrivial exit condition are not
+ infinite. This enables a wider range of loop optimizations even if
+ the loop optimizer itself cannot prove that these assumptions are
+ valid. Using `-Wunsafe-loop-optimizations', the compiler will
+ warn you if it finds this kind of loop.
+
+`-fcrossjumping'
+ Perform cross-jumping transformation. This transformation unifies
+ equivalent code and save code size. The resulting code may or may
+ not perform better than without cross-jumping.
+
+ Enabled at levels `-O2', `-O3', `-Os'.
+
+`-fauto-inc-dec'
+ Combine increments or decrements of addresses with memory accesses.
+ This pass is always skipped on architectures that do not have
+ instructions to support this. Enabled by default at `-O' and
+ higher on architectures that support this.
+
+`-fdce'
+ Perform dead code elimination (DCE) on RTL. Enabled by default at
+ `-O' and higher.
+
+`-fdse'
+ Perform dead store elimination (DSE) on RTL. Enabled by default
+ at `-O' and higher.
+
+`-fif-conversion'
+ Attempt to transform conditional jumps into branch-less
+ equivalents. This include use of conditional moves, min, max, set
+ flags and abs instructions, and some tricks doable by standard
+ arithmetics. The use of conditional execution on chips where it
+ is available is controlled by `if-conversion2'.
+
+ Enabled at levels `-O', `-O2', `-O3', `-Os'.
+
+`-fif-conversion2'
+ Use conditional execution (where available) to transform
+ conditional jumps into branch-less equivalents.
+
+ Enabled at levels `-O', `-O2', `-O3', `-Os'.
+
+`-fdelete-null-pointer-checks'
+ Use global dataflow analysis to identify and eliminate useless
+ checks for null pointers. The compiler assumes that dereferencing
+ a null pointer would have halted the program. If a pointer is
+ checked after it has already been dereferenced, it cannot be null.
+
+ In some environments, this assumption is not true, and programs can
+ safely dereference null pointers. Use
+ `-fno-delete-null-pointer-checks' to disable this optimization for
+ programs which depend on that behavior.
+
+ Enabled at levels `-O2', `-O3', `-Os'.
+
+`-fexpensive-optimizations'
+ Perform a number of minor optimizations that are relatively
+ expensive.
+
+ Enabled at levels `-O2', `-O3', `-Os'.
+
+`-foptimize-register-move'
+`-fregmove'
+ Attempt to reassign register numbers in move instructions and as
+ operands of other simple instructions in order to maximize the
+ amount of register tying. This is especially helpful on machines
+ with two-operand instructions.
+
+ Note `-fregmove' and `-foptimize-register-move' are the same
+ optimization.
+
+ Enabled at levels `-O2', `-O3', `-Os'.
+
+`-fira-algorithm=ALGORITHM'
+ Use specified coloring algorithm for the integrated register
+ allocator. The ALGORITHM argument should be `priority' or `CB'.
+ The first algorithm specifies Chow's priority coloring, the second
+ one specifies Chaitin-Briggs coloring. The second algorithm can
+ be unimplemented for some architectures. If it is implemented, it
+ is the default because Chaitin-Briggs coloring as a rule generates
+ a better code.
+
+`-fira-region=REGION'
+ Use specified regions for the integrated register allocator. The
+ REGION argument should be one of `all', `mixed', or `one'. The
+ first value means using all loops as register allocation regions,
+ the second value which is the default means using all loops except
+ for loops with small register pressure as the regions, and third
+ one means using all function as a single region. The first value
+ can give best result for machines with small size and irregular
+ register set, the third one results in faster and generates decent
+ code and the smallest size code, and the default value usually
+ give the best results in most cases and for most architectures.
+
+`-fira-coalesce'
+ Do optimistic register coalescing. This option might be
+ profitable for architectures with big regular register files.
+
+`-fno-ira-share-save-slots'
+ Switch off sharing stack slots used for saving call used hard
+ registers living through a call. Each hard register will get a
+ separate stack slot and as a result function stack frame will be
+ bigger.
+
+`-fno-ira-share-spill-slots'
+ Switch off sharing stack slots allocated for pseudo-registers.
+ Each pseudo-register which did not get a hard register will get a
+ separate stack slot and as a result function stack frame will be
+ bigger.
+
+`-fira-verbose=N'
+ Set up how verbose dump file for the integrated register allocator
+ will be. Default value is 5. If the value is greater or equal to
+ 10, the dump file will be stderr as if the value were N minus 10.
+
+`-fdelayed-branch'
+ If supported for the target machine, attempt to reorder
+ instructions to exploit instruction slots available after delayed
+ branch instructions.
+
+ Enabled at levels `-O', `-O2', `-O3', `-Os'.
+
+`-fschedule-insns'
+ If supported for the target machine, attempt to reorder
+ instructions to eliminate execution stalls due to required data
+ being unavailable. This helps machines that have slow floating
+ point or memory load instructions by allowing other instructions
+ to be issued until the result of the load or floating point
+ instruction is required.
+
+ Enabled at levels `-O2', `-O3', `-Os'.
+
+`-fschedule-insns2'
+ Similar to `-fschedule-insns', but requests an additional pass of
+ instruction scheduling after register allocation has been done.
+ This is especially useful on machines with a relatively small
+ number of registers and where memory load instructions take more
+ than one cycle.
+
+ Enabled at levels `-O2', `-O3', `-Os'.
+
+`-fno-sched-interblock'
+ Don't schedule instructions across basic blocks. This is normally
+ enabled by default when scheduling before register allocation, i.e.
+ with `-fschedule-insns' or at `-O2' or higher.
+
+`-fno-sched-spec'
+ Don't allow speculative motion of non-load instructions. This is
+ normally enabled by default when scheduling before register
+ allocation, i.e. with `-fschedule-insns' or at `-O2' or higher.
+
+`-fsched-spec-load'
+ Allow speculative motion of some load instructions. This only
+ makes sense when scheduling before register allocation, i.e. with
+ `-fschedule-insns' or at `-O2' or higher.
+
+`-fsched-spec-load-dangerous'
+ Allow speculative motion of more load instructions. This only
+ makes sense when scheduling before register allocation, i.e. with
+ `-fschedule-insns' or at `-O2' or higher.
+
+`-fsched-stalled-insns'
+`-fsched-stalled-insns=N'
+ Define how many insns (if any) can be moved prematurely from the
+ queue of stalled insns into the ready list, during the second
+ scheduling pass. `-fno-sched-stalled-insns' means that no insns
+ will be moved prematurely, `-fsched-stalled-insns=0' means there
+ is no limit on how many queued insns can be moved prematurely.
+ `-fsched-stalled-insns' without a value is equivalent to
+ `-fsched-stalled-insns=1'.
+
+`-fsched-stalled-insns-dep'
+`-fsched-stalled-insns-dep=N'
+ Define how many insn groups (cycles) will be examined for a
+ dependency on a stalled insn that is candidate for premature
+ removal from the queue of stalled insns. This has an effect only
+ during the second scheduling pass, and only if
+ `-fsched-stalled-insns' is used. `-fno-sched-stalled-insns-dep'
+ is equivalent to `-fsched-stalled-insns-dep=0'.
+ `-fsched-stalled-insns-dep' without a value is equivalent to
+ `-fsched-stalled-insns-dep=1'.
+
+`-fsched2-use-superblocks'
+ When scheduling after register allocation, do use superblock
+ scheduling algorithm. Superblock scheduling allows motion across
+ basic block boundaries resulting on faster schedules. This option
+ is experimental, as not all machine descriptions used by GCC model
+ the CPU closely enough to avoid unreliable results from the
+ algorithm.
+
+ This only makes sense when scheduling after register allocation,
+ i.e. with `-fschedule-insns2' or at `-O2' or higher.
+
+`-fsched2-use-traces'
+ Use `-fsched2-use-superblocks' algorithm when scheduling after
+ register allocation and additionally perform code duplication in
+ order to increase the size of superblocks using tracer pass. See
+ `-ftracer' for details on trace formation.
+
+ This mode should produce faster but significantly longer programs.
+ Also without `-fbranch-probabilities' the traces constructed may
+ not match the reality and hurt the performance. This only makes
+ sense when scheduling after register allocation, i.e. with
+ `-fschedule-insns2' or at `-O2' or higher.
+
+`-fsee'
+ Eliminate redundant sign extension instructions and move the
+ non-redundant ones to optimal placement using lazy code motion
+ (LCM).
+
+`-freschedule-modulo-scheduled-loops'
+ The modulo scheduling comes before the traditional scheduling, if
+ a loop was modulo scheduled we may want to prevent the later
+ scheduling passes from changing its schedule, we use this option
+ to control that.
+
+`-fselective-scheduling'
+ Schedule instructions using selective scheduling algorithm.
+ Selective scheduling runs instead of the first scheduler pass.
+
+`-fselective-scheduling2'
+ Schedule instructions using selective scheduling algorithm.
+ Selective scheduling runs instead of the second scheduler pass.
+
+`-fsel-sched-pipelining'
+ Enable software pipelining of innermost loops during selective
+ scheduling. This option has no effect until one of
+ `-fselective-scheduling' or `-fselective-scheduling2' is turned on.
+
+`-fsel-sched-pipelining-outer-loops'
+ When pipelining loops during selective scheduling, also pipeline
+ outer loops. This option has no effect until
+ `-fsel-sched-pipelining' is turned on.
+
+`-fcaller-saves'
+ Enable values to be allocated in registers that will be clobbered
+ by function calls, by emitting extra instructions to save and
+ restore the registers around such calls. Such allocation is done
+ only when it seems to result in better code than would otherwise
+ be produced.
+
+ This option is always enabled by default on certain machines,
+ usually those which have no call-preserved registers to use
+ instead.
+
+ Enabled at levels `-O2', `-O3', `-Os'.
+
+`-fconserve-stack'
+ Attempt to minimize stack usage. The compiler will attempt to use
+ less stack space, even if that makes the program slower. This
+ option implies setting the `large-stack-frame' parameter to 100
+ and the `large-stack-frame-growth' parameter to 400.
+
+`-ftree-reassoc'
+ Perform reassociation on trees. This flag is enabled by default
+ at `-O' and higher.
+
+`-ftree-pre'
+ Perform partial redundancy elimination (PRE) on trees. This flag
+ is enabled by default at `-O2' and `-O3'.
+
+`-ftree-fre'
+ Perform full redundancy elimination (FRE) on trees. The difference
+ between FRE and PRE is that FRE only considers expressions that
+ are computed on all paths leading to the redundant computation.
+ This analysis is faster than PRE, though it exposes fewer
+ redundancies. This flag is enabled by default at `-O' and higher.
+
+`-ftree-copy-prop'
+ Perform copy propagation on trees. This pass eliminates
+ unnecessary copy operations. This flag is enabled by default at
+ `-O' and higher.
+
+`-fipa-pure-const'
+ Discover which functions are pure or constant. Enabled by default
+ at `-O' and higher.
+
+`-fipa-reference'
+ Discover which static variables do not escape cannot escape the
+ compilation unit. Enabled by default at `-O' and higher.
+
+`-fipa-struct-reorg'
+ Perform structure reorganization optimization, that change C-like
+ structures layout in order to better utilize spatial locality.
+ This transformation is affective for programs containing arrays of
+ structures. Available in two compilation modes: profile-based
+ (enabled with `-fprofile-generate') or static (which uses built-in
+ heuristics). Require `-fipa-type-escape' to provide the safety of
+ this transformation. It works only in whole program mode, so it
+ requires `-fwhole-program' and `-combine' to be enabled.
+ Structures considered `cold' by this transformation are not
+ affected (see `--param struct-reorg-cold-struct-ratio=VALUE').
+
+ With this flag, the program debug info reflects a new structure
+ layout.
+
+`-fipa-pta'
+ Perform interprocedural pointer analysis. This option is
+ experimental and does not affect generated code.
+
+`-fipa-cp'
+ Perform interprocedural constant propagation. This optimization
+ analyzes the program to determine when values passed to functions
+ are constants and then optimizes accordingly. This optimization
+ can substantially increase performance if the application has
+ constants passed to functions. This flag is enabled by default at
+ `-O2', `-Os' and `-O3'.
+
+`-fipa-cp-clone'
+ Perform function cloning to make interprocedural constant
+ propagation stronger. When enabled, interprocedural constant
+ propagation will perform function cloning when externally visible
+ function can be called with constant arguments. Because this
+ optimization can create multiple copies of functions, it may
+ significantly increase code size (see `--param
+ ipcp-unit-growth=VALUE'). This flag is enabled by default at
+ `-O3'.
+
+`-fipa-matrix-reorg'
+ Perform matrix flattening and transposing. Matrix flattening
+ tries to replace a m-dimensional matrix with its equivalent
+ n-dimensional matrix, where n < m. This reduces the level of
+ indirection needed for accessing the elements of the matrix. The
+ second optimization is matrix transposing that attempts to change
+ the order of the matrix's dimensions in order to improve cache
+ locality. Both optimizations need the `-fwhole-program' flag.
+ Transposing is enabled only if profiling information is available.
+
+`-ftree-sink'
+ Perform forward store motion on trees. This flag is enabled by
+ default at `-O' and higher.
+
+`-ftree-ccp'
+ Perform sparse conditional constant propagation (CCP) on trees.
+ This pass only operates on local scalar variables and is enabled
+ by default at `-O' and higher.
+
+`-ftree-switch-conversion'
+ Perform conversion of simple initializations in a switch to
+ initializations from a scalar array. This flag is enabled by
+ default at `-O2' and higher.
+
+`-ftree-dce'
+ Perform dead code elimination (DCE) on trees. This flag is
+ enabled by default at `-O' and higher.
+
+`-ftree-builtin-call-dce'
+ Perform conditional dead code elimination (DCE) for calls to
+ builtin functions that may set `errno' but are otherwise
+ side-effect free. This flag is enabled by default at `-O2' and
+ higher if `-Os' is not also specified.
+
+`-ftree-dominator-opts'
+ Perform a variety of simple scalar cleanups (constant/copy
+ propagation, redundancy elimination, range propagation and
+ expression simplification) based on a dominator tree traversal.
+ This also performs jump threading (to reduce jumps to jumps). This
+ flag is enabled by default at `-O' and higher.
+
+`-ftree-dse'
+ Perform dead store elimination (DSE) on trees. A dead store is a
+ store into a memory location which will later be overwritten by
+ another store without any intervening loads. In this case the
+ earlier store can be deleted. This flag is enabled by default at
+ `-O' and higher.
+
+`-ftree-ch'
+ Perform loop header copying on trees. This is beneficial since it
+ increases effectiveness of code motion optimizations. It also
+ saves one jump. This flag is enabled by default at `-O' and
+ higher. It is not enabled for `-Os', since it usually increases
+ code size.
+
+`-ftree-loop-optimize'
+ Perform loop optimizations on trees. This flag is enabled by
+ default at `-O' and higher.
+
+`-ftree-loop-linear'
+ Perform linear loop transformations on tree. This flag can
+ improve cache performance and allow further loop optimizations to
+ take place.
+
+`-floop-interchange'
+ Perform loop interchange transformations on loops. Interchanging
+ two nested loops switches the inner and outer loops. For example,
+ given a loop like:
+ DO J = 1, M
+ DO I = 1, N
+ A(J, I) = A(J, I) * C
+ ENDDO
+ ENDDO
+ loop interchange will transform the loop as if the user had
+ written:
+ DO I = 1, N
+ DO J = 1, M
+ A(J, I) = A(J, I) * C
+ ENDDO
+ ENDDO
+ which can be beneficial when `N' is larger than the caches,
+ because in Fortran, the elements of an array are stored in memory
+ contiguously by column, and the original loop iterates over rows,
+ potentially creating at each access a cache miss. This
+ optimization applies to all the languages supported by GCC and is
+ not limited to Fortran. To use this code transformation, GCC has
+ to be configured with `--with-ppl' and `--with-cloog' to enable the
+ Graphite loop transformation infrastructure.
+
+`-floop-strip-mine'
+ Perform loop strip mining transformations on loops. Strip mining
+ splits a loop into two nested loops. The outer loop has strides
+ equal to the strip size and the inner loop has strides of the
+ original loop within a strip. For example, given a loop like:
+ DO I = 1, N
+ A(I) = A(I) + C
+ ENDDO
+ loop strip mining will transform the loop as if the user had
+ written:
+ DO II = 1, N, 4
+ DO I = II, min (II + 3, N)
+ A(I) = A(I) + C
+ ENDDO
+ ENDDO
+ This optimization applies to all the languages supported by GCC
+ and is not limited to Fortran. To use this code transformation,
+ GCC has to be configured with `--with-ppl' and `--with-cloog' to
+ enable the Graphite loop transformation infrastructure.
+
+`-floop-block'
+ Perform loop blocking transformations on loops. Blocking strip
+ mines each loop in the loop nest such that the memory accesses of
+ the element loops fit inside caches. For example, given a loop
+ like:
+ DO I = 1, N
+ DO J = 1, M
+ A(J, I) = B(I) + C(J)
+ ENDDO
+ ENDDO
+ loop blocking will transform the loop as if the user had written:
+ DO II = 1, N, 64
+ DO JJ = 1, M, 64
+ DO I = II, min (II + 63, N)
+ DO J = JJ, min (JJ + 63, M)
+ A(J, I) = B(I) + C(J)
+ ENDDO
+ ENDDO
+ ENDDO
+ ENDDO
+ which can be beneficial when `M' is larger than the caches,
+ because the innermost loop will iterate over a smaller amount of
+ data that can be kept in the caches. This optimization applies to
+ all the languages supported by GCC and is not limited to Fortran.
+ To use this code transformation, GCC has to be configured with
+ `--with-ppl' and `--with-cloog' to enable the Graphite loop
+ transformation infrastructure.
+
+`-fcheck-data-deps'
+ Compare the results of several data dependence analyzers. This
+ option is used for debugging the data dependence analyzers.
+
+`-ftree-loop-distribution'
+ Perform loop distribution. This flag can improve cache
+ performance on big loop bodies and allow further loop
+ optimizations, like parallelization or vectorization, to take
+ place. For example, the loop
+ DO I = 1, N
+ A(I) = B(I) + C
+ D(I) = E(I) * F
+ ENDDO
+ is transformed to
+ DO I = 1, N
+ A(I) = B(I) + C
+ ENDDO
+ DO I = 1, N
+ D(I) = E(I) * F
+ ENDDO
+
+`-ftree-loop-im'
+ Perform loop invariant motion on trees. This pass moves only
+ invariants that would be hard to handle at RTL level (function
+ calls, operations that expand to nontrivial sequences of insns).
+ With `-funswitch-loops' it also moves operands of conditions that
+ are invariant out of the loop, so that we can use just trivial
+ invariantness analysis in loop unswitching. The pass also includes
+ store motion.
+
+`-ftree-loop-ivcanon'
+ Create a canonical counter for number of iterations in the loop
+ for that determining number of iterations requires complicated
+ analysis. Later optimizations then may determine the number
+ easily. Useful especially in connection with unrolling.
+
+`-fivopts'
+ Perform induction variable optimizations (strength reduction,
+ induction variable merging and induction variable elimination) on
+ trees.
+
+`-ftree-parallelize-loops=n'
+ Parallelize loops, i.e., split their iteration space to run in n
+ threads. This is only possible for loops whose iterations are
+ independent and can be arbitrarily reordered. The optimization is
+ only profitable on multiprocessor machines, for loops that are
+ CPU-intensive, rather than constrained e.g. by memory bandwidth.
+ This option implies `-pthread', and thus is only supported on
+ targets that have support for `-pthread'.
+
+`-ftree-sra'
+ Perform scalar replacement of aggregates. This pass replaces
+ structure references with scalars to prevent committing structures
+ to memory too early. This flag is enabled by default at `-O' and
+ higher.
+
+`-ftree-copyrename'
+ Perform copy renaming on trees. This pass attempts to rename
+ compiler temporaries to other variables at copy locations, usually
+ resulting in variable names which more closely resemble the
+ original variables. This flag is enabled by default at `-O' and
+ higher.
+
+`-ftree-ter'
+ Perform temporary expression replacement during the SSA->normal
+ phase. Single use/single def temporaries are replaced at their
+ use location with their defining expression. This results in
+ non-GIMPLE code, but gives the expanders much more complex trees
+ to work on resulting in better RTL generation. This is enabled by
+ default at `-O' and higher.
+
+`-ftree-vectorize'
+ Perform loop vectorization on trees. This flag is enabled by
+ default at `-O3'.
+
+`-ftree-vect-loop-version'
+ Perform loop versioning when doing loop vectorization on trees.
+ When a loop appears to be vectorizable except that data alignment
+ or data dependence cannot be determined at compile time then
+ vectorized and non-vectorized versions of the loop are generated
+ along with runtime checks for alignment or dependence to control
+ which version is executed. This option is enabled by default
+ except at level `-Os' where it is disabled.
+
+`-fvect-cost-model'
+ Enable cost model for vectorization.
+
+`-ftree-vrp'
+ Perform Value Range Propagation on trees. This is similar to the
+ constant propagation pass, but instead of values, ranges of values
+ are propagated. This allows the optimizers to remove unnecessary
+ range checks like array bound checks and null pointer checks.
+ This is enabled by default at `-O2' and higher. Null pointer check
+ elimination is only done if `-fdelete-null-pointer-checks' is
+ enabled.
+
+`-ftracer'
+ Perform tail duplication to enlarge superblock size. This
+ transformation simplifies the control flow of the function
+ allowing other optimizations to do better job.
+
+`-funroll-loops'
+ Unroll loops whose number of iterations can be determined at
+ compile time or upon entry to the loop. `-funroll-loops' implies
+ `-frerun-cse-after-loop'. This option makes code larger, and may
+ or may not make it run faster.
+
+`-funroll-all-loops'
+ Unroll all loops, even if their number of iterations is uncertain
+ when the loop is entered. This usually makes programs run more
+ slowly. `-funroll-all-loops' implies the same options as
+ `-funroll-loops',
+
+`-fsplit-ivs-in-unroller'
+ Enables expressing of values of induction variables in later
+ iterations of the unrolled loop using the value in the first
+ iteration. This breaks long dependency chains, thus improving
+ efficiency of the scheduling passes.
+
+ Combination of `-fweb' and CSE is often sufficient to obtain the
+ same effect. However in cases the loop body is more complicated
+ than a single basic block, this is not reliable. It also does not
+ work at all on some of the architectures due to restrictions in
+ the CSE pass.
+
+ This optimization is enabled by default.
+
+`-fvariable-expansion-in-unroller'
+ With this option, the compiler will create multiple copies of some
+ local variables when unrolling a loop which can result in superior
+ code.
+
+`-fpredictive-commoning'
+ Perform predictive commoning optimization, i.e., reusing
+ computations (especially memory loads and stores) performed in
+ previous iterations of loops.
+
+ This option is enabled at level `-O3'.
+
+`-fprefetch-loop-arrays'
+ If supported by the target machine, generate instructions to
+ prefetch memory to improve the performance of loops that access
+ large arrays.
+
+ This option may generate better or worse code; results are highly
+ dependent on the structure of loops within the source code.
+
+ Disabled at level `-Os'.
+
+`-fno-peephole'
+`-fno-peephole2'
+ Disable any machine-specific peephole optimizations. The
+ difference between `-fno-peephole' and `-fno-peephole2' is in how
+ they are implemented in the compiler; some targets use one, some
+ use the other, a few use both.
+
+ `-fpeephole' is enabled by default. `-fpeephole2' enabled at
+ levels `-O2', `-O3', `-Os'.
+
+`-fno-guess-branch-probability'
+ Do not guess branch probabilities using heuristics.
+
+ GCC will use heuristics to guess branch probabilities if they are
+ not provided by profiling feedback (`-fprofile-arcs'). These
+ heuristics are based on the control flow graph. If some branch
+ probabilities are specified by `__builtin_expect', then the
+ heuristics will be used to guess branch probabilities for the rest
+ of the control flow graph, taking the `__builtin_expect' info into
+ account. The interactions between the heuristics and
+ `__builtin_expect' can be complex, and in some cases, it may be
+ useful to disable the heuristics so that the effects of
+ `__builtin_expect' are easier to understand.
+
+ The default is `-fguess-branch-probability' at levels `-O', `-O2',
+ `-O3', `-Os'.
+
+`-freorder-blocks'
+ Reorder basic blocks in the compiled function in order to reduce
+ number of taken branches and improve code locality.
+
+ Enabled at levels `-O2', `-O3'.
+
+`-freorder-blocks-and-partition'
+ In addition to reordering basic blocks in the compiled function,
+ in order to reduce number of taken branches, partitions hot and
+ cold basic blocks into separate sections of the assembly and .o
+ files, to improve paging and cache locality performance.
+
+ This optimization is automatically turned off in the presence of
+ exception handling, for linkonce sections, for functions with a
+ user-defined section attribute and on any architecture that does
+ not support named sections.
+
+`-freorder-functions'
+ Reorder functions in the object file in order to improve code
+ locality. This is implemented by using special subsections
+ `.text.hot' for most frequently executed functions and
+ `.text.unlikely' for unlikely executed functions. Reordering is
+ done by the linker so object file format must support named
+ sections and linker must place them in a reasonable way.
+
+ Also profile feedback must be available in to make this option
+ effective. See `-fprofile-arcs' for details.
+
+ Enabled at levels `-O2', `-O3', `-Os'.
+
+`-fstrict-aliasing'
+ Allow the compiler to assume the strictest aliasing rules
+ applicable to the language being compiled. For C (and C++), this
+ activates optimizations based on the type of expressions. In
+ particular, an object of one type is assumed never to reside at
+ the same address as an object of a different type, unless the
+ types are almost the same. For example, an `unsigned int' can
+ alias an `int', but not a `void*' or a `double'. A character type
+ may alias any other type.
+
+ Pay special attention to code like this:
+ union a_union {
+ int i;
+ double d;
+ };
+
+ int f() {
+ union a_union t;
+ t.d = 3.0;
+ return t.i;
+ }
+ The practice of reading from a different union member than the one
+ most recently written to (called "type-punning") is common. Even
+ with `-fstrict-aliasing', type-punning is allowed, provided the
+ memory is accessed through the union type. So, the code above
+ will work as expected. *Note Structures unions enumerations and
+ bit-fields implementation::. However, this code might not:
+ int f() {
+ union a_union t;
+ int* ip;
+ t.d = 3.0;
+ ip = &t.i;
+ return *ip;
+ }
+
+ Similarly, access by taking the address, casting the resulting
+ pointer and dereferencing the result has undefined behavior, even
+ if the cast uses a union type, e.g.:
+ int f() {
+ double d = 3.0;
+ return ((union a_union *) &d)->i;
+ }
+
+ The `-fstrict-aliasing' option is enabled at levels `-O2', `-O3',
+ `-Os'.
+
+`-fstrict-overflow'
+ Allow the compiler to assume strict signed overflow rules,
+ depending on the language being compiled. For C (and C++) this
+ means that overflow when doing arithmetic with signed numbers is
+ undefined, which means that the compiler may assume that it will
+ not happen. This permits various optimizations. For example, the
+ compiler will assume that an expression like `i + 10 > i' will
+ always be true for signed `i'. This assumption is only valid if
+ signed overflow is undefined, as the expression is false if `i +
+ 10' overflows when using twos complement arithmetic. When this
+ option is in effect any attempt to determine whether an operation
+ on signed numbers will overflow must be written carefully to not
+ actually involve overflow.
+
+ This option also allows the compiler to assume strict pointer
+ semantics: given a pointer to an object, if adding an offset to
+ that pointer does not produce a pointer to the same object, the
+ addition is undefined. This permits the compiler to conclude that
+ `p + u > p' is always true for a pointer `p' and unsigned integer
+ `u'. This assumption is only valid because pointer wraparound is
+ undefined, as the expression is false if `p + u' overflows using
+ twos complement arithmetic.
+
+ See also the `-fwrapv' option. Using `-fwrapv' means that integer
+ signed overflow is fully defined: it wraps. When `-fwrapv' is
+ used, there is no difference between `-fstrict-overflow' and
+ `-fno-strict-overflow' for integers. With `-fwrapv' certain types
+ of overflow are permitted. For example, if the compiler gets an
+ overflow when doing arithmetic on constants, the overflowed value
+ can still be used with `-fwrapv', but not otherwise.
+
+ The `-fstrict-overflow' option is enabled at levels `-O2', `-O3',
+ `-Os'.
+
+`-falign-functions'
+`-falign-functions=N'
+ Align the start of functions to the next power-of-two greater than
+ N, skipping up to N bytes. For instance, `-falign-functions=32'
+ aligns functions to the next 32-byte boundary, but
+ `-falign-functions=24' would align to the next 32-byte boundary
+ only if this can be done by skipping 23 bytes or less.
+
+ `-fno-align-functions' and `-falign-functions=1' are equivalent
+ and mean that functions will not be aligned.
+
+ Some assemblers only support this flag when N is a power of two;
+ in that case, it is rounded up.
+
+ If N is not specified or is zero, use a machine-dependent default.
+
+ Enabled at levels `-O2', `-O3'.
+
+`-falign-labels'
+`-falign-labels=N'
+ Align all branch targets to a power-of-two boundary, skipping up to
+ N bytes like `-falign-functions'. This option can easily make
+ code slower, because it must insert dummy operations for when the
+ branch target is reached in the usual flow of the code.
+
+ `-fno-align-labels' and `-falign-labels=1' are equivalent and mean
+ that labels will not be aligned.
+
+ If `-falign-loops' or `-falign-jumps' are applicable and are
+ greater than this value, then their values are used instead.
+
+ If N is not specified or is zero, use a machine-dependent default
+ which is very likely to be `1', meaning no alignment.
+
+ Enabled at levels `-O2', `-O3'.
+
+`-falign-loops'
+`-falign-loops=N'
+ Align loops to a power-of-two boundary, skipping up to N bytes
+ like `-falign-functions'. The hope is that the loop will be
+ executed many times, which will make up for any execution of the
+ dummy operations.
+
+ `-fno-align-loops' and `-falign-loops=1' are equivalent and mean
+ that loops will not be aligned.
+
+ If N is not specified or is zero, use a machine-dependent default.
+
+ Enabled at levels `-O2', `-O3'.
+
+`-falign-jumps'
+`-falign-jumps=N'
+ Align branch targets to a power-of-two boundary, for branch targets
+ where the targets can only be reached by jumping, skipping up to N
+ bytes like `-falign-functions'. In this case, no dummy operations
+ need be executed.
+
+ `-fno-align-jumps' and `-falign-jumps=1' are equivalent and mean
+ that loops will not be aligned.
+
+ If N is not specified or is zero, use a machine-dependent default.
+
+ Enabled at levels `-O2', `-O3'.
+
+`-funit-at-a-time'
+ This option is left for compatibility reasons. `-funit-at-a-time'
+ has no effect, while `-fno-unit-at-a-time' implies
+ `-fno-toplevel-reorder' and `-fno-section-anchors'.
+
+ Enabled by default.
+
+`-fno-toplevel-reorder'
+ Do not reorder top-level functions, variables, and `asm'
+ statements. Output them in the same order that they appear in the
+ input file. When this option is used, unreferenced static
+ variables will not be removed. This option is intended to support
+ existing code which relies on a particular ordering. For new
+ code, it is better to use attributes.
+
+ Enabled at level `-O0'. When disabled explicitly, it also imply
+ `-fno-section-anchors' that is otherwise enabled at `-O0' on some
+ targets.
+
+`-fweb'
+ Constructs webs as commonly used for register allocation purposes
+ and assign each web individual pseudo register. This allows the
+ register allocation pass to operate on pseudos directly, but also
+ strengthens several other optimization passes, such as CSE, loop
+ optimizer and trivial dead code remover. It can, however, make
+ debugging impossible, since variables will no longer stay in a
+ "home register".
+
+ Enabled by default with `-funroll-loops'.
+
+`-fwhole-program'
+ Assume that the current compilation unit represents whole program
+ being compiled. All public functions and variables with the
+ exception of `main' and those merged by attribute
+ `externally_visible' become static functions and in a affect gets
+ more aggressively optimized by interprocedural optimizers. While
+ this option is equivalent to proper use of `static' keyword for
+ programs consisting of single file, in combination with option
+ `--combine' this flag can be used to compile most of smaller scale
+ C programs since the functions and variables become local for the
+ whole combined compilation unit, not for the single source file
+ itself.
+
+ This option is not supported for Fortran programs.
+
+`-fcprop-registers'
+ After register allocation and post-register allocation instruction
+ splitting, we perform a copy-propagation pass to try to reduce
+ scheduling dependencies and occasionally eliminate the copy.
+
+ Enabled at levels `-O', `-O2', `-O3', `-Os'.
+
+`-fprofile-correction'
+ Profiles collected using an instrumented binary for multi-threaded
+ programs may be inconsistent due to missed counter updates. When
+ this option is specified, GCC will use heuristics to correct or
+ smooth out such inconsistencies. By default, GCC will emit an
+ error message when an inconsistent profile is detected.
+
+`-fprofile-dir=PATH'
+ Set the directory to search the profile data files in to PATH.
+ This option affects only the profile data generated by
+ `-fprofile-generate', `-ftest-coverage', `-fprofile-arcs' and used
+ by `-fprofile-use' and `-fbranch-probabilities' and its related
+ options. By default, GCC will use the current directory as PATH
+ thus the profile data file will appear in the same directory as
+ the object file.
+
+`-fprofile-generate'
+`-fprofile-generate=PATH'
+ Enable options usually used for instrumenting application to
+ produce profile useful for later recompilation with profile
+ feedback based optimization. You must use `-fprofile-generate'
+ both when compiling and when linking your program.
+
+ The following options are enabled: `-fprofile-arcs',
+ `-fprofile-values', `-fvpt'.
+
+ If PATH is specified, GCC will look at the PATH to find the
+ profile feedback data files. See `-fprofile-dir'.
+
+`-fprofile-use'
+`-fprofile-use=PATH'
+ Enable profile feedback directed optimizations, and optimizations
+ generally profitable only with profile feedback available.
+
+ The following options are enabled: `-fbranch-probabilities',
+ `-fvpt', `-funroll-loops', `-fpeel-loops', `-ftracer'
+
+ By default, GCC emits an error message if the feedback profiles do
+ not match the source code. This error can be turned into a
+ warning by using `-Wcoverage-mismatch'. Note this may result in
+ poorly optimized code.
+
+ If PATH is specified, GCC will look at the PATH to find the
+ profile feedback data files. See `-fprofile-dir'.
+
+ The following options control compiler behavior regarding floating
+point arithmetic. These options trade off between speed and
+correctness. All must be specifically enabled.
+
+`-ffloat-store'
+ Do not store floating point variables in registers, and inhibit
+ other options that might change whether a floating point value is
+ taken from a register or memory.
+
+ This option prevents undesirable excess precision on machines such
+ as the 68000 where the floating registers (of the 68881) keep more
+ precision than a `double' is supposed to have. Similarly for the
+ x86 architecture. For most programs, the excess precision does
+ only good, but a few programs rely on the precise definition of
+ IEEE floating point. Use `-ffloat-store' for such programs, after
+ modifying them to store all pertinent intermediate computations
+ into variables.
+
+`-ffast-math'
+ Sets `-fno-math-errno', `-funsafe-math-optimizations',
+ `-ffinite-math-only', `-fno-rounding-math', `-fno-signaling-nans'
+ and `-fcx-limited-range'.
+
+ This option causes the preprocessor macro `__FAST_MATH__' to be
+ defined.
+
+ This option is not turned on by any `-O' option since it can
+ result in incorrect output for programs which depend on an exact
+ implementation of IEEE or ISO rules/specifications for math
+ functions. It may, however, yield faster code for programs that do
+ not require the guarantees of these specifications.
+
+`-fno-math-errno'
+ Do not set ERRNO after calling math functions that are executed
+ with a single instruction, e.g., sqrt. A program that relies on
+ IEEE exceptions for math error handling may want to use this flag
+ for speed while maintaining IEEE arithmetic compatibility.
+
+ This option is not turned on by any `-O' option since it can
+ result in incorrect output for programs which depend on an exact
+ implementation of IEEE or ISO rules/specifications for math
+ functions. It may, however, yield faster code for programs that do
+ not require the guarantees of these specifications.
+
+ The default is `-fmath-errno'.
+
+ On Darwin systems, the math library never sets `errno'. There is
+ therefore no reason for the compiler to consider the possibility
+ that it might, and `-fno-math-errno' is the default.
+
+`-funsafe-math-optimizations'
+ Allow optimizations for floating-point arithmetic that (a) assume
+ that arguments and results are valid and (b) may violate IEEE or
+ ANSI standards. When used at link-time, it may include libraries
+ or startup files that change the default FPU control word or other
+ similar optimizations.
+
+ This option is not turned on by any `-O' option since it can
+ result in incorrect output for programs which depend on an exact
+ implementation of IEEE or ISO rules/specifications for math
+ functions. It may, however, yield faster code for programs that do
+ not require the guarantees of these specifications. Enables
+ `-fno-signed-zeros', `-fno-trapping-math', `-fassociative-math'
+ and `-freciprocal-math'.
+
+ The default is `-fno-unsafe-math-optimizations'.
+
+`-fassociative-math'
+ Allow re-association of operands in series of floating-point
+ operations. This violates the ISO C and C++ language standard by
+ possibly changing computation result. NOTE: re-ordering may
+ change the sign of zero as well as ignore NaNs and inhibit or
+ create underflow or overflow (and thus cannot be used on a code
+ which relies on rounding behavior like `(x + 2**52) - 2**52)'.
+ May also reorder floating-point comparisons and thus may not be
+ used when ordered comparisons are required. This option requires
+ that both `-fno-signed-zeros' and `-fno-trapping-math' be in
+ effect. Moreover, it doesn't make much sense with
+ `-frounding-math'.
+
+ The default is `-fno-associative-math'.
+
+`-freciprocal-math'
+ Allow the reciprocal of a value to be used instead of dividing by
+ the value if this enables optimizations. For example `x / y' can
+ be replaced with `x * (1/y)' which is useful if `(1/y)' is subject
+ to common subexpression elimination. Note that this loses
+ precision and increases the number of flops operating on the value.
+
+ The default is `-fno-reciprocal-math'.
+
+`-ffinite-math-only'
+ Allow optimizations for floating-point arithmetic that assume that
+ arguments and results are not NaNs or +-Infs.
+
+ This option is not turned on by any `-O' option since it can
+ result in incorrect output for programs which depend on an exact
+ implementation of IEEE or ISO rules/specifications for math
+ functions. It may, however, yield faster code for programs that do
+ not require the guarantees of these specifications.
+
+ The default is `-fno-finite-math-only'.
+
+`-fno-signed-zeros'
+ Allow optimizations for floating point arithmetic that ignore the
+ signedness of zero. IEEE arithmetic specifies the behavior of
+ distinct +0.0 and -0.0 values, which then prohibits simplification
+ of expressions such as x+0.0 or 0.0*x (even with
+ `-ffinite-math-only'). This option implies that the sign of a
+ zero result isn't significant.
+
+ The default is `-fsigned-zeros'.
+
+`-fno-trapping-math'
+ Compile code assuming that floating-point operations cannot
+ generate user-visible traps. These traps include division by
+ zero, overflow, underflow, inexact result and invalid operation.
+ This option requires that `-fno-signaling-nans' be in effect.
+ Setting this option may allow faster code if one relies on
+ "non-stop" IEEE arithmetic, for example.
+
+ This option should never be turned on by any `-O' option since it
+ can result in incorrect output for programs which depend on an
+ exact implementation of IEEE or ISO rules/specifications for math
+ functions.
+
+ The default is `-ftrapping-math'.
+
+`-frounding-math'
+ Disable transformations and optimizations that assume default
+ floating point rounding behavior. This is round-to-zero for all
+ floating point to integer conversions, and round-to-nearest for
+ all other arithmetic truncations. This option should be specified
+ for programs that change the FP rounding mode dynamically, or that
+ may be executed with a non-default rounding mode. This option
+ disables constant folding of floating point expressions at
+ compile-time (which may be affected by rounding mode) and
+ arithmetic transformations that are unsafe in the presence of
+ sign-dependent rounding modes.
+
+ The default is `-fno-rounding-math'.
+
+ This option is experimental and does not currently guarantee to
+ disable all GCC optimizations that are affected by rounding mode.
+ Future versions of GCC may provide finer control of this setting
+ using C99's `FENV_ACCESS' pragma. This command line option will
+ be used to specify the default state for `FENV_ACCESS'.
+
+`-frtl-abstract-sequences'
+ It is a size optimization method. This option is to find identical
+ sequences of code, which can be turned into pseudo-procedures and
+ then replace all occurrences with calls to the newly created
+ subroutine. It is kind of an opposite of `-finline-functions'.
+ This optimization runs at RTL level.
+
+`-fsignaling-nans'
+ Compile code assuming that IEEE signaling NaNs may generate
+ user-visible traps during floating-point operations. Setting this
+ option disables optimizations that may change the number of
+ exceptions visible with signaling NaNs. This option implies
+ `-ftrapping-math'.
+
+ This option causes the preprocessor macro `__SUPPORT_SNAN__' to be
+ defined.
+
+ The default is `-fno-signaling-nans'.
+
+ This option is experimental and does not currently guarantee to
+ disable all GCC optimizations that affect signaling NaN behavior.
+
+`-fsingle-precision-constant'
+ Treat floating point constant as single precision constant instead
+ of implicitly converting it to double precision constant.
+
+`-fcx-limited-range'
+ When enabled, this option states that a range reduction step is not
+ needed when performing complex division. Also, there is no
+ checking whether the result of a complex multiplication or
+ division is `NaN + I*NaN', with an attempt to rescue the situation
+ in that case. The default is `-fno-cx-limited-range', but is
+ enabled by `-ffast-math'.
+
+ This option controls the default setting of the ISO C99
+ `CX_LIMITED_RANGE' pragma. Nevertheless, the option applies to
+ all languages.
+
+`-fcx-fortran-rules'
+ Complex multiplication and division follow Fortran rules. Range
+ reduction is done as part of complex division, but there is no
+ checking whether the result of a complex multiplication or
+ division is `NaN + I*NaN', with an attempt to rescue the situation
+ in that case.
+
+ The default is `-fno-cx-fortran-rules'.
+
+
+ The following options control optimizations that may improve
+performance, but are not enabled by any `-O' options. This section
+includes experimental options that may produce broken code.
+
+`-fbranch-probabilities'
+ After running a program compiled with `-fprofile-arcs' (*note
+ Options for Debugging Your Program or `gcc': Debugging Options.),
+ you can compile it a second time using `-fbranch-probabilities',
+ to improve optimizations based on the number of times each branch
+ was taken. When the program compiled with `-fprofile-arcs' exits
+ it saves arc execution counts to a file called `SOURCENAME.gcda'
+ for each source file. The information in this data file is very
+ dependent on the structure of the generated code, so you must use
+ the same source code and the same optimization options for both
+ compilations.
+
+ With `-fbranch-probabilities', GCC puts a `REG_BR_PROB' note on
+ each `JUMP_INSN' and `CALL_INSN'. These can be used to improve
+ optimization. Currently, they are only used in one place: in
+ `reorg.c', instead of guessing which path a branch is mostly to
+ take, the `REG_BR_PROB' values are used to exactly determine which
+ path is taken more often.
+
+`-fprofile-values'
+ If combined with `-fprofile-arcs', it adds code so that some data
+ about values of expressions in the program is gathered.
+
+ With `-fbranch-probabilities', it reads back the data gathered
+ from profiling values of expressions and adds `REG_VALUE_PROFILE'
+ notes to instructions for their later usage in optimizations.
+
+ Enabled with `-fprofile-generate' and `-fprofile-use'.
+
+`-fvpt'
+ If combined with `-fprofile-arcs', it instructs the compiler to add
+ a code to gather information about values of expressions.
+
+ With `-fbranch-probabilities', it reads back the data gathered and
+ actually performs the optimizations based on them. Currently the
+ optimizations include specialization of division operation using
+ the knowledge about the value of the denominator.
+
+`-frename-registers'
+ Attempt to avoid false dependencies in scheduled code by making use
+ of registers left over after register allocation. This
+ optimization will most benefit processors with lots of registers.
+ Depending on the debug information format adopted by the target,
+ however, it can make debugging impossible, since variables will no
+ longer stay in a "home register".
+
+ Enabled by default with `-funroll-loops'.
+
+`-ftracer'
+ Perform tail duplication to enlarge superblock size. This
+ transformation simplifies the control flow of the function
+ allowing other optimizations to do better job.
+
+ Enabled with `-fprofile-use'.
+
+`-funroll-loops'
+ Unroll loops whose number of iterations can be determined at
+ compile time or upon entry to the loop. `-funroll-loops' implies
+ `-frerun-cse-after-loop', `-fweb' and `-frename-registers'. It
+ also turns on complete loop peeling (i.e. complete removal of
+ loops with small constant number of iterations). This option
+ makes code larger, and may or may not make it run faster.
+
+ Enabled with `-fprofile-use'.
+
+`-funroll-all-loops'
+ Unroll all loops, even if their number of iterations is uncertain
+ when the loop is entered. This usually makes programs run more
+ slowly. `-funroll-all-loops' implies the same options as
+ `-funroll-loops'.
+
+`-fpeel-loops'
+ Peels the loops for that there is enough information that they do
+ not roll much (from profile feedback). It also turns on complete
+ loop peeling (i.e. complete removal of loops with small constant
+ number of iterations).
+
+ Enabled with `-fprofile-use'.
+
+`-fmove-loop-invariants'
+ Enables the loop invariant motion pass in the RTL loop optimizer.
+ Enabled at level `-O1'
+
+`-funswitch-loops'
+ Move branches with loop invariant conditions out of the loop, with
+ duplicates of the loop on both branches (modified according to
+ result of the condition).
+
+`-ffunction-sections'
+`-fdata-sections'
+ Place each function or data item into its own section in the output
+ file if the target supports arbitrary sections. The name of the
+ function or the name of the data item determines the section's name
+ in the output file.
+
+ Use these options on systems where the linker can perform
+ optimizations to improve locality of reference in the instruction
+ space. Most systems using the ELF object format and SPARC
+ processors running Solaris 2 have linkers with such optimizations.
+ AIX may have these optimizations in the future.
+
+ Only use these options when there are significant benefits from
+ doing so. When you specify these options, the assembler and
+ linker will create larger object and executable files and will
+ also be slower. You will not be able to use `gprof' on all
+ systems if you specify this option and you may have problems with
+ debugging if you specify both this option and `-g'.
+
+`-fbranch-target-load-optimize'
+ Perform branch target register load optimization before prologue /
+ epilogue threading. The use of target registers can typically be
+ exposed only during reload, thus hoisting loads out of loops and
+ doing inter-block scheduling needs a separate optimization pass.
+
+`-fbranch-target-load-optimize2'
+ Perform branch target register load optimization after prologue /
+ epilogue threading.
+
+`-fbtr-bb-exclusive'
+ When performing branch target register load optimization, don't
+ reuse branch target registers in within any basic block.
+
+`-fstack-protector'
+ Emit extra code to check for buffer overflows, such as stack
+ smashing attacks. This is done by adding a guard variable to
+ functions with vulnerable objects. This includes functions that
+ call alloca, and functions with buffers larger than 8 bytes. The
+ guards are initialized when a function is entered and then checked
+ when the function exits. If a guard check fails, an error message
+ is printed and the program exits.
+
+`-fstack-protector-all'
+ Like `-fstack-protector' except that all functions are protected.
+
+`-fsection-anchors'
+ Try to reduce the number of symbolic address calculations by using
+ shared "anchor" symbols to address nearby objects. This
+ transformation can help to reduce the number of GOT entries and
+ GOT accesses on some targets.
+
+ For example, the implementation of the following function `foo':
+
+ static int a, b, c;
+ int foo (void) { return a + b + c; }
+
+ would usually calculate the addresses of all three variables, but
+ if you compile it with `-fsection-anchors', it will access the
+ variables from a common anchor point instead. The effect is
+ similar to the following pseudocode (which isn't valid C):
+
+ int foo (void)
+ {
+ register int *xr = &x;
+ return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
+ }
+
+ Not all targets support this option.
+
+`--param NAME=VALUE'
+ In some places, GCC uses various constants to control the amount of
+ optimization that is done. For example, GCC will not inline
+ functions that contain more that a certain number of instructions.
+ You can control some of these constants on the command-line using
+ the `--param' option.
+
+ The names of specific parameters, and the meaning of the values,
+ are tied to the internals of the compiler, and are subject to
+ change without notice in future releases.
+
+ In each case, the VALUE is an integer. The allowable choices for
+ NAME are given in the following table:
+
+ `sra-max-structure-size'
+ The maximum structure size, in bytes, at which the scalar
+ replacement of aggregates (SRA) optimization will perform
+ block copies. The default value, 0, implies that GCC will
+ select the most appropriate size itself.
+
+ `sra-field-structure-ratio'
+ The threshold ratio (as a percentage) between instantiated
+ fields and the complete structure size. We say that if the
+ ratio of the number of bytes in instantiated fields to the
+ number of bytes in the complete structure exceeds this
+ parameter, then block copies are not used. The default is 75.
+
+ `struct-reorg-cold-struct-ratio'
+ The threshold ratio (as a percentage) between a structure
+ frequency and the frequency of the hottest structure in the
+ program. This parameter is used by struct-reorg optimization
+ enabled by `-fipa-struct-reorg'. We say that if the ratio of
+ a structure frequency, calculated by profiling, to the
+ hottest structure frequency in the program is less than this
+ parameter, then structure reorganization is not applied to
+ this structure. The default is 10.
+
+ `predictable-branch-cost-outcome'
+ When branch is predicted to be taken with probability lower
+ than this threshold (in percent), then it is considered well
+ predictable. The default is 10.
+
+ `max-crossjump-edges'
+ The maximum number of incoming edges to consider for
+ crossjumping. The algorithm used by `-fcrossjumping' is
+ O(N^2) in the number of edges incoming to each block.
+ Increasing values mean more aggressive optimization, making
+ the compile time increase with probably small improvement in
+ executable size.
+
+ `min-crossjump-insns'
+ The minimum number of instructions which must be matched at
+ the end of two blocks before crossjumping will be performed
+ on them. This value is ignored in the case where all
+ instructions in the block being crossjumped from are matched.
+ The default value is 5.
+
+ `max-grow-copy-bb-insns'
+ The maximum code size expansion factor when copying basic
+ blocks instead of jumping. The expansion is relative to a
+ jump instruction. The default value is 8.
+
+ `max-goto-duplication-insns'
+ The maximum number of instructions to duplicate to a block
+ that jumps to a computed goto. To avoid O(N^2) behavior in a
+ number of passes, GCC factors computed gotos early in the
+ compilation process, and unfactors them as late as possible.
+ Only computed jumps at the end of a basic blocks with no more
+ than max-goto-duplication-insns are unfactored. The default
+ value is 8.
+
+ `max-delay-slot-insn-search'
+ The maximum number of instructions to consider when looking
+ for an instruction to fill a delay slot. If more than this
+ arbitrary number of instructions is searched, the time
+ savings from filling the delay slot will be minimal so stop
+ searching. Increasing values mean more aggressive
+ optimization, making the compile time increase with probably
+ small improvement in executable run time.
+
+ `max-delay-slot-live-search'
+ When trying to fill delay slots, the maximum number of
+ instructions to consider when searching for a block with
+ valid live register information. Increasing this arbitrarily
+ chosen value means more aggressive optimization, increasing
+ the compile time. This parameter should be removed when the
+ delay slot code is rewritten to maintain the control-flow
+ graph.
+
+ `max-gcse-memory'
+ The approximate maximum amount of memory that will be
+ allocated in order to perform the global common subexpression
+ elimination optimization. If more memory than specified is
+ required, the optimization will not be done.
+
+ `max-gcse-passes'
+ The maximum number of passes of GCSE to run. The default is
+ 1.
+
+ `max-pending-list-length'
+ The maximum number of pending dependencies scheduling will
+ allow before flushing the current state and starting over.
+ Large functions with few branches or calls can create
+ excessively large lists which needlessly consume memory and
+ resources.
+
+ `max-inline-insns-single'
+ Several parameters control the tree inliner used in gcc.
+ This number sets the maximum number of instructions (counted
+ in GCC's internal representation) in a single function that
+ the tree inliner will consider for inlining. This only
+ affects functions declared inline and methods implemented in
+ a class declaration (C++). The default value is 450.
+
+ `max-inline-insns-auto'
+ When you use `-finline-functions' (included in `-O3'), a lot
+ of functions that would otherwise not be considered for
+ inlining by the compiler will be investigated. To those
+ functions, a different (more restrictive) limit compared to
+ functions declared inline can be applied. The default value
+ is 90.
+
+ `large-function-insns'
+ The limit specifying really large functions. For functions
+ larger than this limit after inlining, inlining is
+ constrained by `--param large-function-growth'. This
+ parameter is useful primarily to avoid extreme compilation
+ time caused by non-linear algorithms used by the backend.
+ The default value is 2700.
+
+ `large-function-growth'
+ Specifies maximal growth of large function caused by inlining
+ in percents. The default value is 100 which limits large
+ function growth to 2.0 times the original size.
+
+ `large-unit-insns'
+ The limit specifying large translation unit. Growth caused
+ by inlining of units larger than this limit is limited by
+ `--param inline-unit-growth'. For small units this might be
+ too tight (consider unit consisting of function A that is
+ inline and B that just calls A three time. If B is small
+ relative to A, the growth of unit is 300\% and yet such
+ inlining is very sane. For very large units consisting of
+ small inlineable functions however the overall unit growth
+ limit is needed to avoid exponential explosion of code size.
+ Thus for smaller units, the size is increased to `--param
+ large-unit-insns' before applying `--param
+ inline-unit-growth'. The default is 10000
+
+ `inline-unit-growth'
+ Specifies maximal overall growth of the compilation unit
+ caused by inlining. The default value is 30 which limits
+ unit growth to 1.3 times the original size.
+
+ `ipcp-unit-growth'
+ Specifies maximal overall growth of the compilation unit
+ caused by interprocedural constant propagation. The default
+ value is 10 which limits unit growth to 1.1 times the
+ original size.
+
+ `large-stack-frame'
+ The limit specifying large stack frames. While inlining the
+ algorithm is trying to not grow past this limit too much.
+ Default value is 256 bytes.
+
+ `large-stack-frame-growth'
+ Specifies maximal growth of large stack frames caused by
+ inlining in percents. The default value is 1000 which limits
+ large stack frame growth to 11 times the original size.
+
+ `max-inline-insns-recursive'
+ `max-inline-insns-recursive-auto'
+ Specifies maximum number of instructions out-of-line copy of
+ self recursive inline function can grow into by performing
+ recursive inlining.
+
+ For functions declared inline `--param
+ max-inline-insns-recursive' is taken into account. For
+ function not declared inline, recursive inlining happens only
+ when `-finline-functions' (included in `-O3') is enabled and
+ `--param max-inline-insns-recursive-auto' is used. The
+ default value is 450.
+
+ `max-inline-recursive-depth'
+ `max-inline-recursive-depth-auto'
+ Specifies maximum recursion depth used by the recursive
+ inlining.
+
+ For functions declared inline `--param
+ max-inline-recursive-depth' is taken into account. For
+ function not declared inline, recursive inlining happens only
+ when `-finline-functions' (included in `-O3') is enabled and
+ `--param max-inline-recursive-depth-auto' is used. The
+ default value is 8.
+
+ `min-inline-recursive-probability'
+ Recursive inlining is profitable only for function having
+ deep recursion in average and can hurt for function having
+ little recursion depth by increasing the prologue size or
+ complexity of function body to other optimizers.
+
+ When profile feedback is available (see `-fprofile-generate')
+ the actual recursion depth can be guessed from probability
+ that function will recurse via given call expression. This
+ parameter limits inlining only to call expression whose
+ probability exceeds given threshold (in percents). The
+ default value is 10.
+
+ `inline-call-cost'
+ Specify cost of call instruction relative to simple
+ arithmetics operations (having cost of 1). Increasing this
+ cost disqualifies inlining of non-leaf functions and at the
+ same time increases size of leaf function that is believed to
+ reduce function size by being inlined. In effect it
+ increases amount of inlining for code having large
+ abstraction penalty (many functions that just pass the
+ arguments to other functions) and decrease inlining for code
+ with low abstraction penalty. The default value is 12.
+
+ `min-vect-loop-bound'
+ The minimum number of iterations under which a loop will not
+ get vectorized when `-ftree-vectorize' is used. The number
+ of iterations after vectorization needs to be greater than
+ the value specified by this option to allow vectorization.
+ The default value is 0.
+
+ `max-unrolled-insns'
+ The maximum number of instructions that a loop should have if
+ that loop is unrolled, and if the loop is unrolled, it
+ determines how many times the loop code is unrolled.
+
+ `max-average-unrolled-insns'
+ The maximum number of instructions biased by probabilities of
+ their execution that a loop should have if that loop is
+ unrolled, and if the loop is unrolled, it determines how many
+ times the loop code is unrolled.
+
+ `max-unroll-times'
+ The maximum number of unrollings of a single loop.
+
+ `max-peeled-insns'
+ The maximum number of instructions that a loop should have if
+ that loop is peeled, and if the loop is peeled, it determines
+ how many times the loop code is peeled.
+
+ `max-peel-times'
+ The maximum number of peelings of a single loop.
+
+ `max-completely-peeled-insns'
+ The maximum number of insns of a completely peeled loop.
+
+ `max-completely-peel-times'
+ The maximum number of iterations of a loop to be suitable for
+ complete peeling.
+
+ `max-unswitch-insns'
+ The maximum number of insns of an unswitched loop.
+
+ `max-unswitch-level'
+ The maximum number of branches unswitched in a single loop.
+
+ `lim-expensive'
+ The minimum cost of an expensive expression in the loop
+ invariant motion.
+
+ `iv-consider-all-candidates-bound'
+ Bound on number of candidates for induction variables below
+ that all candidates are considered for each use in induction
+ variable optimizations. Only the most relevant candidates
+ are considered if there are more candidates, to avoid
+ quadratic time complexity.
+
+ `iv-max-considered-uses'
+ The induction variable optimizations give up on loops that
+ contain more induction variable uses.
+
+ `iv-always-prune-cand-set-bound'
+ If number of candidates in the set is smaller than this value,
+ we always try to remove unnecessary ivs from the set during
+ its optimization when a new iv is added to the set.
+
+ `scev-max-expr-size'
+ Bound on size of expressions used in the scalar evolutions
+ analyzer. Large expressions slow the analyzer.
+
+ `omega-max-vars'
+ The maximum number of variables in an Omega constraint system.
+ The default value is 128.
+
+ `omega-max-geqs'
+ The maximum number of inequalities in an Omega constraint
+ system. The default value is 256.
+
+ `omega-max-eqs'
+ The maximum number of equalities in an Omega constraint
+ system. The default value is 128.
+
+ `omega-max-wild-cards'
+ The maximum number of wildcard variables that the Omega
+ solver will be able to insert. The default value is 18.
+
+ `omega-hash-table-size'
+ The size of the hash table in the Omega solver. The default
+ value is 550.
+
+ `omega-max-keys'
+ The maximal number of keys used by the Omega solver. The
+ default value is 500.
+
+ `omega-eliminate-redundant-constraints'
+ When set to 1, use expensive methods to eliminate all
+ redundant constraints. The default value is 0.
+
+ `vect-max-version-for-alignment-checks'
+ The maximum number of runtime checks that can be performed
+ when doing loop versioning for alignment in the vectorizer.
+ See option ftree-vect-loop-version for more information.
+
+ `vect-max-version-for-alias-checks'
+ The maximum number of runtime checks that can be performed
+ when doing loop versioning for alias in the vectorizer. See
+ option ftree-vect-loop-version for more information.
+
+ `max-iterations-to-track'
+ The maximum number of iterations of a loop the brute force
+ algorithm for analysis of # of iterations of the loop tries
+ to evaluate.
+
+ `hot-bb-count-fraction'
+ Select fraction of the maximal count of repetitions of basic
+ block in program given basic block needs to have to be
+ considered hot.
+
+ `hot-bb-frequency-fraction'
+ Select fraction of the maximal frequency of executions of
+ basic block in function given basic block needs to have to be
+ considered hot
+
+ `max-predicted-iterations'
+ The maximum number of loop iterations we predict statically.
+ This is useful in cases where function contain single loop
+ with known bound and other loop with unknown. We predict the
+ known number of iterations correctly, while the unknown
+ number of iterations average to roughly 10. This means that
+ the loop without bounds would appear artificially cold
+ relative to the other one.
+
+ `align-threshold'
+ Select fraction of the maximal frequency of executions of
+ basic block in function given basic block will get aligned.
+
+ `align-loop-iterations'
+ A loop expected to iterate at lest the selected number of
+ iterations will get aligned.
+
+ `tracer-dynamic-coverage'
+ `tracer-dynamic-coverage-feedback'
+ This value is used to limit superblock formation once the
+ given percentage of executed instructions is covered. This
+ limits unnecessary code size expansion.
+
+ The `tracer-dynamic-coverage-feedback' is used only when
+ profile feedback is available. The real profiles (as opposed
+ to statically estimated ones) are much less balanced allowing
+ the threshold to be larger value.
+
+ `tracer-max-code-growth'
+ Stop tail duplication once code growth has reached given
+ percentage. This is rather hokey argument, as most of the
+ duplicates will be eliminated later in cross jumping, so it
+ may be set to much higher values than is the desired code
+ growth.
+
+ `tracer-min-branch-ratio'
+ Stop reverse growth when the reverse probability of best edge
+ is less than this threshold (in percent).
+
+ `tracer-min-branch-ratio'
+ `tracer-min-branch-ratio-feedback'
+ Stop forward growth if the best edge do have probability
+ lower than this threshold.
+
+ Similarly to `tracer-dynamic-coverage' two values are
+ present, one for compilation for profile feedback and one for
+ compilation without. The value for compilation with profile
+ feedback needs to be more conservative (higher) in order to
+ make tracer effective.
+
+ `max-cse-path-length'
+ Maximum number of basic blocks on path that cse considers.
+ The default is 10.
+
+ `max-cse-insns'
+ The maximum instructions CSE process before flushing. The
+ default is 1000.
+
+ `max-aliased-vops'
+ Maximum number of virtual operands per function allowed to
+ represent aliases before triggering the alias partitioning
+ heuristic. Alias partitioning reduces compile times and
+ memory consumption needed for aliasing at the expense of
+ precision loss in alias information. The default value for
+ this parameter is 100 for -O1, 500 for -O2 and 1000 for -O3.
+
+ Notice that if a function contains more memory statements
+ than the value of this parameter, it is not really possible
+ to achieve this reduction. In this case, the compiler will
+ use the number of memory statements as the value for
+ `max-aliased-vops'.
+
+ `avg-aliased-vops'
+ Average number of virtual operands per statement allowed to
+ represent aliases before triggering the alias partitioning
+ heuristic. This works in conjunction with
+ `max-aliased-vops'. If a function contains more than
+ `max-aliased-vops' virtual operators, then memory symbols
+ will be grouped into memory partitions until either the total
+ number of virtual operators is below `max-aliased-vops' or
+ the average number of virtual operators per memory statement
+ is below `avg-aliased-vops'. The default value for this
+ parameter is 1 for -O1 and -O2, and 3 for -O3.
+
+ `ggc-min-expand'
+ GCC uses a garbage collector to manage its own memory
+ allocation. This parameter specifies the minimum percentage
+ by which the garbage collector's heap should be allowed to
+ expand between collections. Tuning this may improve
+ compilation speed; it has no effect on code generation.
+
+ The default is 30% + 70% * (RAM/1GB) with an upper bound of
+ 100% when RAM >= 1GB. If `getrlimit' is available, the
+ notion of "RAM" is the smallest of actual RAM and
+ `RLIMIT_DATA' or `RLIMIT_AS'. If GCC is not able to
+ calculate RAM on a particular platform, the lower bound of
+ 30% is used. Setting this parameter and `ggc-min-heapsize'
+ to zero causes a full collection to occur at every
+ opportunity. This is extremely slow, but can be useful for
+ debugging.
+
+ `ggc-min-heapsize'
+ Minimum size of the garbage collector's heap before it begins
+ bothering to collect garbage. The first collection occurs
+ after the heap expands by `ggc-min-expand'% beyond
+ `ggc-min-heapsize'. Again, tuning this may improve
+ compilation speed, and has no effect on code generation.
+
+ The default is the smaller of RAM/8, RLIMIT_RSS, or a limit
+ which tries to ensure that RLIMIT_DATA or RLIMIT_AS are not
+ exceeded, but with a lower bound of 4096 (four megabytes) and
+ an upper bound of 131072 (128 megabytes). If GCC is not able
+ to calculate RAM on a particular platform, the lower bound is
+ used. Setting this parameter very large effectively disables
+ garbage collection. Setting this parameter and
+ `ggc-min-expand' to zero causes a full collection to occur at
+ every opportunity.
+
+ `max-reload-search-insns'
+ The maximum number of instruction reload should look backward
+ for equivalent register. Increasing values mean more
+ aggressive optimization, making the compile time increase
+ with probably slightly better performance. The default value
+ is 100.
+
+ `max-cselib-memory-locations'
+ The maximum number of memory locations cselib should take
+ into account. Increasing values mean more aggressive
+ optimization, making the compile time increase with probably
+ slightly better performance. The default value is 500.
+
+ `reorder-blocks-duplicate'
+ `reorder-blocks-duplicate-feedback'
+ Used by basic block reordering pass to decide whether to use
+ unconditional branch or duplicate the code on its
+ destination. Code is duplicated when its estimated size is
+ smaller than this value multiplied by the estimated size of
+ unconditional jump in the hot spots of the program.
+
+ The `reorder-block-duplicate-feedback' is used only when
+ profile feedback is available and may be set to higher values
+ than `reorder-block-duplicate' since information about the
+ hot spots is more accurate.
+
+ `max-sched-ready-insns'
+ The maximum number of instructions ready to be issued the
+ scheduler should consider at any given time during the first
+ scheduling pass. Increasing values mean more thorough
+ searches, making the compilation time increase with probably
+ little benefit. The default value is 100.
+
+ `max-sched-region-blocks'
+ The maximum number of blocks in a region to be considered for
+ interblock scheduling. The default value is 10.
+
+ `max-pipeline-region-blocks'
+ The maximum number of blocks in a region to be considered for
+ pipelining in the selective scheduler. The default value is
+ 15.
+
+ `max-sched-region-insns'
+ The maximum number of insns in a region to be considered for
+ interblock scheduling. The default value is 100.
+
+ `max-pipeline-region-insns'
+ The maximum number of insns in a region to be considered for
+ pipelining in the selective scheduler. The default value is
+ 200.
+
+ `min-spec-prob'
+ The minimum probability (in percents) of reaching a source
+ block for interblock speculative scheduling. The default
+ value is 40.
+
+ `max-sched-extend-regions-iters'
+ The maximum number of iterations through CFG to extend
+ regions. 0 - disable region extension, N - do at most N
+ iterations. The default value is 0.
+
+ `max-sched-insn-conflict-delay'
+ The maximum conflict delay for an insn to be considered for
+ speculative motion. The default value is 3.
+
+ `sched-spec-prob-cutoff'
+ The minimal probability of speculation success (in percents),
+ so that speculative insn will be scheduled. The default
+ value is 40.
+
+ `sched-mem-true-dep-cost'
+ Minimal distance (in CPU cycles) between store and load
+ targeting same memory locations. The default value is 1.
+
+ `selsched-max-lookahead'
+ The maximum size of the lookahead window of selective
+ scheduling. It is a depth of search for available
+ instructions. The default value is 50.
+
+ `selsched-max-sched-times'
+ The maximum number of times that an instruction will be
+ scheduled during selective scheduling. This is the limit on
+ the number of iterations through which the instruction may be
+ pipelined. The default value is 2.
+
+ `selsched-max-insns-to-rename'
+ The maximum number of best instructions in the ready list
+ that are considered for renaming in the selective scheduler.
+ The default value is 2.
+
+ `max-last-value-rtl'
+ The maximum size measured as number of RTLs that can be
+ recorded in an expression in combiner for a pseudo register
+ as last known value of that register. The default is 10000.
+
+ `integer-share-limit'
+ Small integer constants can use a shared data structure,
+ reducing the compiler's memory usage and increasing its
+ speed. This sets the maximum value of a shared integer
+ constant. The default value is 256.
+
+ `min-virtual-mappings'
+ Specifies the minimum number of virtual mappings in the
+ incremental SSA updater that should be registered to trigger
+ the virtual mappings heuristic defined by
+ virtual-mappings-ratio. The default value is 100.
+
+ `virtual-mappings-ratio'
+ If the number of virtual mappings is virtual-mappings-ratio
+ bigger than the number of virtual symbols to be updated, then
+ the incremental SSA updater switches to a full update for
+ those symbols. The default ratio is 3.
+
+ `ssp-buffer-size'
+ The minimum size of buffers (i.e. arrays) that will receive
+ stack smashing protection when `-fstack-protection' is used.
+
+ `max-jump-thread-duplication-stmts'
+ Maximum number of statements allowed in a block that needs to
+ be duplicated when threading jumps.
+
+ `max-fields-for-field-sensitive'
+ Maximum number of fields in a structure we will treat in a
+ field sensitive manner during pointer analysis. The default
+ is zero for -O0, and -O1 and 100 for -Os, -O2, and -O3.
+
+ `prefetch-latency'
+ Estimate on average number of instructions that are executed
+ before prefetch finishes. The distance we prefetch ahead is
+ proportional to this constant. Increasing this number may
+ also lead to less streams being prefetched (see
+ `simultaneous-prefetches').
+
+ `simultaneous-prefetches'
+ Maximum number of prefetches that can run at the same time.
+
+ `l1-cache-line-size'
+ The size of cache line in L1 cache, in bytes.
+
+ `l1-cache-size'
+ The size of L1 cache, in kilobytes.
+
+ `l2-cache-size'
+ The size of L2 cache, in kilobytes.
+
+ `use-canonical-types'
+ Whether the compiler should use the "canonical" type system.
+ By default, this should always be 1, which uses a more
+ efficient internal mechanism for comparing types in C++ and
+ Objective-C++. However, if bugs in the canonical type system
+ are causing compilation failures, set this value to 0 to
+ disable canonical types.
+
+ `switch-conversion-max-branch-ratio'
+ Switch initialization conversion will refuse to create arrays
+ that are bigger than `switch-conversion-max-branch-ratio'
+ times the number of branches in the switch.
+
+ `max-partial-antic-length'
+ Maximum length of the partial antic set computed during the
+ tree partial redundancy elimination optimization
+ (`-ftree-pre') when optimizing at `-O3' and above. For some
+ sorts of source code the enhanced partial redundancy
+ elimination optimization can run away, consuming all of the
+ memory available on the host machine. This parameter sets a
+ limit on the length of the sets that are computed, which
+ prevents the runaway behavior. Setting a value of 0 for this
+ parameter will allow an unlimited set length.
+
+ `sccvn-max-scc-size'
+ Maximum size of a strongly connected component (SCC) during
+ SCCVN processing. If this limit is hit, SCCVN processing for
+ the whole function will not be done and optimizations
+ depending on it will be disabled. The default maximum SCC
+ size is 10000.
+
+ `ira-max-loops-num'
+ IRA uses a regional register allocation by default. If a
+ function contains loops more than number given by the
+ parameter, only at most given number of the most frequently
+ executed loops will form regions for the regional register
+ allocation. The default value of the parameter is 100.
+
+ `ira-max-conflict-table-size'
+ Although IRA uses a sophisticated algorithm of compression
+ conflict table, the table can be still big for huge
+ functions. If the conflict table for a function could be
+ more than size in MB given by the parameter, the conflict
+ table is not built and faster, simpler, and lower quality
+ register allocation algorithm will be used. The algorithm do
+ not use pseudo-register conflicts. The default value of the
+ parameter is 2000.
+
+ `loop-invariant-max-bbs-in-loop'
+ Loop invariant motion can be very expensive, both in compile
+ time and in amount of needed compile time memory, with very
+ large loops. Loops with more basic blocks than this
+ parameter won't have loop invariant motion optimization
+ performed on them. The default value of the parameter is
+ 1000 for -O1 and 10000 for -O2 and above.
+
+
+
+File: gcc.info, Node: Preprocessor Options, Next: Assembler Options, Prev: Optimize Options, Up: Invoking GCC
+
+3.11 Options Controlling the Preprocessor
+=========================================
+
+These options control the C preprocessor, which is run on each C source
+file before actual compilation.
+
+ If you use the `-E' option, nothing is done except preprocessing.
+Some of these options make sense only together with `-E' because they
+cause the preprocessor output to be unsuitable for actual compilation.
+
+ You can use `-Wp,OPTION' to bypass the compiler driver and pass
+ OPTION directly through to the preprocessor. If OPTION contains
+ commas, it is split into multiple options at the commas. However,
+ many options are modified, translated or interpreted by the
+ compiler driver before being passed to the preprocessor, and `-Wp'
+ forcibly bypasses this phase. The preprocessor's direct interface
+ is undocumented and subject to change, so whenever possible you
+ should avoid using `-Wp' and let the driver handle the options
+ instead.
+
+`-Xpreprocessor OPTION'
+ Pass OPTION as an option to the preprocessor. You can use this to
+ supply system-specific preprocessor options which GCC does not
+ know how to recognize.
+
+ If you want to pass an option that takes an argument, you must use
+ `-Xpreprocessor' twice, once for the option and once for the
+ argument.
+
+`-D NAME'
+ Predefine NAME as a macro, with definition `1'.
+
+`-D NAME=DEFINITION'
+ The contents of DEFINITION are tokenized and processed as if they
+ appeared during translation phase three in a `#define' directive.
+ In particular, the definition will be truncated by embedded
+ newline characters.
+
+ If you are invoking the preprocessor from a shell or shell-like
+ program you may need to use the shell's quoting syntax to protect
+ characters such as spaces that have a meaning in the shell syntax.
+
+ If you wish to define a function-like macro on the command line,
+ write its argument list with surrounding parentheses before the
+ equals sign (if any). Parentheses are meaningful to most shells,
+ so you will need to quote the option. With `sh' and `csh',
+ `-D'NAME(ARGS...)=DEFINITION'' works.
+
+ `-D' and `-U' options are processed in the order they are given on
+ the command line. All `-imacros FILE' and `-include FILE' options
+ are processed after all `-D' and `-U' options.
+
+`-U NAME'
+ Cancel any previous definition of NAME, either built in or
+ provided with a `-D' option.
+
+`-undef'
+ Do not predefine any system-specific or GCC-specific macros. The
+ standard predefined macros remain defined.
+
+`-I DIR'
+ Add the directory DIR to the list of directories to be searched
+ for header files. Directories named by `-I' are searched before
+ the standard system include directories. If the directory DIR is
+ a standard system include directory, the option is ignored to
+ ensure that the default search order for system directories and
+ the special treatment of system headers are not defeated . If DIR
+ begins with `=', then the `=' will be replaced by the sysroot
+ prefix; see `--sysroot' and `-isysroot'.
+
+`-o FILE'
+ Write output to FILE. This is the same as specifying FILE as the
+ second non-option argument to `cpp'. `gcc' has a different
+ interpretation of a second non-option argument, so you must use
+ `-o' to specify the output file.
+
+`-Wall'
+ Turns on all optional warnings which are desirable for normal code.
+ At present this is `-Wcomment', `-Wtrigraphs', `-Wmultichar' and a
+ warning about integer promotion causing a change of sign in `#if'
+ expressions. Note that many of the preprocessor's warnings are on
+ by default and have no options to control them.
+
+`-Wcomment'
+`-Wcomments'
+ Warn whenever a comment-start sequence `/*' appears in a `/*'
+ comment, or whenever a backslash-newline appears in a `//' comment.
+ (Both forms have the same effect.)
+
+`-Wtrigraphs'
+ Most trigraphs in comments cannot affect the meaning of the
+ program. However, a trigraph that would form an escaped newline
+ (`??/' at the end of a line) can, by changing where the comment
+ begins or ends. Therefore, only trigraphs that would form escaped
+ newlines produce warnings inside a comment.
+
+ This option is implied by `-Wall'. If `-Wall' is not given, this
+ option is still enabled unless trigraphs are enabled. To get
+ trigraph conversion without warnings, but get the other `-Wall'
+ warnings, use `-trigraphs -Wall -Wno-trigraphs'.
+
+`-Wtraditional'
+ Warn about certain constructs that behave differently in
+ traditional and ISO C. Also warn about ISO C constructs that have
+ no traditional C equivalent, and problematic constructs which
+ should be avoided.
+
+`-Wundef'
+ Warn whenever an identifier which is not a macro is encountered in
+ an `#if' directive, outside of `defined'. Such identifiers are
+ replaced with zero.
+
+`-Wunused-macros'
+ Warn about macros defined in the main file that are unused. A
+ macro is "used" if it is expanded or tested for existence at least
+ once. The preprocessor will also warn if the macro has not been
+ used at the time it is redefined or undefined.
+
+ Built-in macros, macros defined on the command line, and macros
+ defined in include files are not warned about.
+
+ _Note:_ If a macro is actually used, but only used in skipped
+ conditional blocks, then CPP will report it as unused. To avoid
+ the warning in such a case, you might improve the scope of the
+ macro's definition by, for example, moving it into the first
+ skipped block. Alternatively, you could provide a dummy use with
+ something like:
+
+ #if defined the_macro_causing_the_warning
+ #endif
+
+`-Wendif-labels'
+ Warn whenever an `#else' or an `#endif' are followed by text.
+ This usually happens in code of the form
+
+ #if FOO
+ ...
+ #else FOO
+ ...
+ #endif FOO
+
+ The second and third `FOO' should be in comments, but often are not
+ in older programs. This warning is on by default.
+
+`-Werror'
+ Make all warnings into hard errors. Source code which triggers
+ warnings will be rejected.
+
+`-Wsystem-headers'
+ Issue warnings for code in system headers. These are normally
+ unhelpful in finding bugs in your own code, therefore suppressed.
+ If you are responsible for the system library, you may want to see
+ them.
+
+`-w'
+ Suppress all warnings, including those which GNU CPP issues by
+ default.
+
+`-pedantic'
+ Issue all the mandatory diagnostics listed in the C standard.
+ Some of them are left out by default, since they trigger
+ frequently on harmless code.
+
+`-pedantic-errors'
+ Issue all the mandatory diagnostics, and make all mandatory
+ diagnostics into errors. This includes mandatory diagnostics that
+ GCC issues without `-pedantic' but treats as warnings.
+
+`-M'
+ Instead of outputting the result of preprocessing, output a rule
+ suitable for `make' describing the dependencies of the main source
+ file. The preprocessor outputs one `make' rule containing the
+ object file name for that source file, a colon, and the names of
+ all the included files, including those coming from `-include' or
+ `-imacros' command line options.
+
+ Unless specified explicitly (with `-MT' or `-MQ'), the object file
+ name consists of the name of the source file with any suffix
+ replaced with object file suffix and with any leading directory
+ parts removed. If there are many included files then the rule is
+ split into several lines using `\'-newline. The rule has no
+ commands.
+
+ This option does not suppress the preprocessor's debug output,
+ such as `-dM'. To avoid mixing such debug output with the
+ dependency rules you should explicitly specify the dependency
+ output file with `-MF', or use an environment variable like
+ `DEPENDENCIES_OUTPUT' (*note Environment Variables::). Debug
+ output will still be sent to the regular output stream as normal.
+
+ Passing `-M' to the driver implies `-E', and suppresses warnings
+ with an implicit `-w'.
+
+`-MM'
+ Like `-M' but do not mention header files that are found in system
+ header directories, nor header files that are included, directly
+ or indirectly, from such a header.
+
+ This implies that the choice of angle brackets or double quotes in
+ an `#include' directive does not in itself determine whether that
+ header will appear in `-MM' dependency output. This is a slight
+ change in semantics from GCC versions 3.0 and earlier.
+
+`-MF FILE'
+ When used with `-M' or `-MM', specifies a file to write the
+ dependencies to. If no `-MF' switch is given the preprocessor
+ sends the rules to the same place it would have sent preprocessed
+ output.
+
+ When used with the driver options `-MD' or `-MMD', `-MF' overrides
+ the default dependency output file.
+
+`-MG'
+ In conjunction with an option such as `-M' requesting dependency
+ generation, `-MG' assumes missing header files are generated files
+ and adds them to the dependency list without raising an error.
+ The dependency filename is taken directly from the `#include'
+ directive without prepending any path. `-MG' also suppresses
+ preprocessed output, as a missing header file renders this useless.
+
+ This feature is used in automatic updating of makefiles.
+
+`-MP'
+ This option instructs CPP to add a phony target for each dependency
+ other than the main file, causing each to depend on nothing. These
+ dummy rules work around errors `make' gives if you remove header
+ files without updating the `Makefile' to match.
+
+ This is typical output:
+
+ test.o: test.c test.h
+
+ test.h:
+
+`-MT TARGET'
+ Change the target of the rule emitted by dependency generation. By
+ default CPP takes the name of the main input file, deletes any
+ directory components and any file suffix such as `.c', and appends
+ the platform's usual object suffix. The result is the target.
+
+ An `-MT' option will set the target to be exactly the string you
+ specify. If you want multiple targets, you can specify them as a
+ single argument to `-MT', or use multiple `-MT' options.
+
+ For example, `-MT '$(objpfx)foo.o'' might give
+
+ $(objpfx)foo.o: foo.c
+
+`-MQ TARGET'
+ Same as `-MT', but it quotes any characters which are special to
+ Make. `-MQ '$(objpfx)foo.o'' gives
+
+ $$(objpfx)foo.o: foo.c
+
+ The default target is automatically quoted, as if it were given
+ with `-MQ'.
+
+`-MD'
+ `-MD' is equivalent to `-M -MF FILE', except that `-E' is not
+ implied. The driver determines FILE based on whether an `-o'
+ option is given. If it is, the driver uses its argument but with
+ a suffix of `.d', otherwise it takes the name of the input file,
+ removes any directory components and suffix, and applies a `.d'
+ suffix.
+
+ If `-MD' is used in conjunction with `-E', any `-o' switch is
+ understood to specify the dependency output file (*note -MF:
+ dashMF.), but if used without `-E', each `-o' is understood to
+ specify a target object file.
+
+ Since `-E' is not implied, `-MD' can be used to generate a
+ dependency output file as a side-effect of the compilation process.
+
+`-MMD'
+ Like `-MD' except mention only user header files, not system
+ header files.
+
+`-fpch-deps'
+ When using precompiled headers (*note Precompiled Headers::), this
+ flag will cause the dependency-output flags to also list the files
+ from the precompiled header's dependencies. If not specified only
+ the precompiled header would be listed and not the files that were
+ used to create it because those files are not consulted when a
+ precompiled header is used.
+
+`-fpch-preprocess'
+ This option allows use of a precompiled header (*note Precompiled
+ Headers::) together with `-E'. It inserts a special `#pragma',
+ `#pragma GCC pch_preprocess "<filename>"' in the output to mark
+ the place where the precompiled header was found, and its
+ filename. When `-fpreprocessed' is in use, GCC recognizes this
+ `#pragma' and loads the PCH.
+
+ This option is off by default, because the resulting preprocessed
+ output is only really suitable as input to GCC. It is switched on
+ by `-save-temps'.
+
+ You should not write this `#pragma' in your own code, but it is
+ safe to edit the filename if the PCH file is available in a
+ different location. The filename may be absolute or it may be
+ relative to GCC's current directory.
+
+`-x c'
+`-x c++'
+`-x objective-c'
+`-x assembler-with-cpp'
+ Specify the source language: C, C++, Objective-C, or assembly.
+ This has nothing to do with standards conformance or extensions;
+ it merely selects which base syntax to expect. If you give none
+ of these options, cpp will deduce the language from the extension
+ of the source file: `.c', `.cc', `.m', or `.S'. Some other common
+ extensions for C++ and assembly are also recognized. If cpp does
+ not recognize the extension, it will treat the file as C; this is
+ the most generic mode.
+
+ _Note:_ Previous versions of cpp accepted a `-lang' option which
+ selected both the language and the standards conformance level.
+ This option has been removed, because it conflicts with the `-l'
+ option.
+
+`-std=STANDARD'
+`-ansi'
+ Specify the standard to which the code should conform. Currently
+ CPP knows about C and C++ standards; others may be added in the
+ future.
+
+ STANDARD may be one of:
+ `iso9899:1990'
+ `c89'
+ The ISO C standard from 1990. `c89' is the customary
+ shorthand for this version of the standard.
+
+ The `-ansi' option is equivalent to `-std=c89'.
+
+ `iso9899:199409'
+ The 1990 C standard, as amended in 1994.
+
+ `iso9899:1999'
+ `c99'
+ `iso9899:199x'
+ `c9x'
+ The revised ISO C standard, published in December 1999.
+ Before publication, this was known as C9X.
+
+ `gnu89'
+ The 1990 C standard plus GNU extensions. This is the default.
+
+ `gnu99'
+ `gnu9x'
+ The 1999 C standard plus GNU extensions.
+
+ `c++98'
+ The 1998 ISO C++ standard plus amendments.
+
+ `gnu++98'
+ The same as `-std=c++98' plus GNU extensions. This is the
+ default for C++ code.
+
+`-I-'
+ Split the include path. Any directories specified with `-I'
+ options before `-I-' are searched only for headers requested with
+ `#include "FILE"'; they are not searched for `#include <FILE>'.
+ If additional directories are specified with `-I' options after
+ the `-I-', those directories are searched for all `#include'
+ directives.
+
+ In addition, `-I-' inhibits the use of the directory of the current
+ file directory as the first search directory for `#include "FILE"'.
+ This option has been deprecated.
+
+`-nostdinc'
+ Do not search the standard system directories for header files.
+ Only the directories you have specified with `-I' options (and the
+ directory of the current file, if appropriate) are searched.
+
+`-nostdinc++'
+ Do not search for header files in the C++-specific standard
+ directories, but do still search the other standard directories.
+ (This option is used when building the C++ library.)
+
+`-include FILE'
+ Process FILE as if `#include "file"' appeared as the first line of
+ the primary source file. However, the first directory searched
+ for FILE is the preprocessor's working directory _instead of_ the
+ directory containing the main source file. If not found there, it
+ is searched for in the remainder of the `#include "..."' search
+ chain as normal.
+
+ If multiple `-include' options are given, the files are included
+ in the order they appear on the command line.
+
+`-imacros FILE'
+ Exactly like `-include', except that any output produced by
+ scanning FILE is thrown away. Macros it defines remain defined.
+ This allows you to acquire all the macros from a header without
+ also processing its declarations.
+
+ All files specified by `-imacros' are processed before all files
+ specified by `-include'.
+
+`-idirafter DIR'
+ Search DIR for header files, but do it _after_ all directories
+ specified with `-I' and the standard system directories have been
+ exhausted. DIR is treated as a system include directory. If DIR
+ begins with `=', then the `=' will be replaced by the sysroot
+ prefix; see `--sysroot' and `-isysroot'.
+
+`-iprefix PREFIX'
+ Specify PREFIX as the prefix for subsequent `-iwithprefix'
+ options. If the prefix represents a directory, you should include
+ the final `/'.
+
+`-iwithprefix DIR'
+`-iwithprefixbefore DIR'
+ Append DIR to the prefix specified previously with `-iprefix', and
+ add the resulting directory to the include search path.
+ `-iwithprefixbefore' puts it in the same place `-I' would;
+ `-iwithprefix' puts it where `-idirafter' would.
+
+`-isysroot DIR'
+ This option is like the `--sysroot' option, but applies only to
+ header files. See the `--sysroot' option for more information.
+
+`-imultilib DIR'
+ Use DIR as a subdirectory of the directory containing
+ target-specific C++ headers.
+
+`-isystem DIR'
+ Search DIR for header files, after all directories specified by
+ `-I' but before the standard system directories. Mark it as a
+ system directory, so that it gets the same special treatment as is
+ applied to the standard system directories. If DIR begins with
+ `=', then the `=' will be replaced by the sysroot prefix; see
+ `--sysroot' and `-isysroot'.
+
+`-iquote DIR'
+ Search DIR only for header files requested with `#include "FILE"';
+ they are not searched for `#include <FILE>', before all
+ directories specified by `-I' and before the standard system
+ directories. If DIR begins with `=', then the `=' will be replaced
+ by the sysroot prefix; see `--sysroot' and `-isysroot'.
+
+`-fdirectives-only'
+ When preprocessing, handle directives, but do not expand macros.
+
+ The option's behavior depends on the `-E' and `-fpreprocessed'
+ options.
+
+ With `-E', preprocessing is limited to the handling of directives
+ such as `#define', `#ifdef', and `#error'. Other preprocessor
+ operations, such as macro expansion and trigraph conversion are
+ not performed. In addition, the `-dD' option is implicitly
+ enabled.
+
+ With `-fpreprocessed', predefinition of command line and most
+ builtin macros is disabled. Macros such as `__LINE__', which are
+ contextually dependent, are handled normally. This enables
+ compilation of files previously preprocessed with `-E
+ -fdirectives-only'.
+
+ With both `-E' and `-fpreprocessed', the rules for
+ `-fpreprocessed' take precedence. This enables full preprocessing
+ of files previously preprocessed with `-E -fdirectives-only'.
+
+`-fdollars-in-identifiers'
+ Accept `$' in identifiers.
+
+`-fextended-identifiers'
+ Accept universal character names in identifiers. This option is
+ experimental; in a future version of GCC, it will be enabled by
+ default for C99 and C++.
+
+`-fpreprocessed'
+ Indicate to the preprocessor that the input file has already been
+ preprocessed. This suppresses things like macro expansion,
+ trigraph conversion, escaped newline splicing, and processing of
+ most directives. The preprocessor still recognizes and removes
+ comments, so that you can pass a file preprocessed with `-C' to
+ the compiler without problems. In this mode the integrated
+ preprocessor is little more than a tokenizer for the front ends.
+
+ `-fpreprocessed' is implicit if the input file has one of the
+ extensions `.i', `.ii' or `.mi'. These are the extensions that
+ GCC uses for preprocessed files created by `-save-temps'.
+
+`-ftabstop=WIDTH'
+ Set the distance between tab stops. This helps the preprocessor
+ report correct column numbers in warnings or errors, even if tabs
+ appear on the line. If the value is less than 1 or greater than
+ 100, the option is ignored. The default is 8.
+
+`-fexec-charset=CHARSET'
+ Set the execution character set, used for string and character
+ constants. The default is UTF-8. CHARSET can be any encoding
+ supported by the system's `iconv' library routine.
+
+`-fwide-exec-charset=CHARSET'
+ Set the wide execution character set, used for wide string and
+ character constants. The default is UTF-32 or UTF-16, whichever
+ corresponds to the width of `wchar_t'. As with `-fexec-charset',
+ CHARSET can be any encoding supported by the system's `iconv'
+ library routine; however, you will have problems with encodings
+ that do not fit exactly in `wchar_t'.
+
+`-finput-charset=CHARSET'
+ Set the input character set, used for translation from the
+ character set of the input file to the source character set used
+ by GCC. If the locale does not specify, or GCC cannot get this
+ information from the locale, the default is UTF-8. This can be
+ overridden by either the locale or this command line option.
+ Currently the command line option takes precedence if there's a
+ conflict. CHARSET can be any encoding supported by the system's
+ `iconv' library routine.
+
+`-fworking-directory'
+ Enable generation of linemarkers in the preprocessor output that
+ will let the compiler know the current working directory at the
+ time of preprocessing. When this option is enabled, the
+ preprocessor will emit, after the initial linemarker, a second
+ linemarker with the current working directory followed by two
+ slashes. GCC will use this directory, when it's present in the
+ preprocessed input, as the directory emitted as the current
+ working directory in some debugging information formats. This
+ option is implicitly enabled if debugging information is enabled,
+ but this can be inhibited with the negated form
+ `-fno-working-directory'. If the `-P' flag is present in the
+ command line, this option has no effect, since no `#line'
+ directives are emitted whatsoever.
+
+`-fno-show-column'
+ Do not print column numbers in diagnostics. This may be necessary
+ if diagnostics are being scanned by a program that does not
+ understand the column numbers, such as `dejagnu'.
+
+`-A PREDICATE=ANSWER'
+ Make an assertion with the predicate PREDICATE and answer ANSWER.
+ This form is preferred to the older form `-A PREDICATE(ANSWER)',
+ which is still supported, because it does not use shell special
+ characters.
+
+`-A -PREDICATE=ANSWER'
+ Cancel an assertion with the predicate PREDICATE and answer ANSWER.
+
+`-dCHARS'
+ CHARS is a sequence of one or more of the following characters,
+ and must not be preceded by a space. Other characters are
+ interpreted by the compiler proper, or reserved for future
+ versions of GCC, and so are silently ignored. If you specify
+ characters whose behavior conflicts, the result is undefined.
+
+ `M'
+ Instead of the normal output, generate a list of `#define'
+ directives for all the macros defined during the execution of
+ the preprocessor, including predefined macros. This gives
+ you a way of finding out what is predefined in your version
+ of the preprocessor. Assuming you have no file `foo.h', the
+ command
+
+ touch foo.h; cpp -dM foo.h
+
+ will show all the predefined macros.
+
+ If you use `-dM' without the `-E' option, `-dM' is
+ interpreted as a synonym for `-fdump-rtl-mach'. *Note
+ Debugging Options: (gcc)Debugging Options.
+
+ `D'
+ Like `M' except in two respects: it does _not_ include the
+ predefined macros, and it outputs _both_ the `#define'
+ directives and the result of preprocessing. Both kinds of
+ output go to the standard output file.
+
+ `N'
+ Like `D', but emit only the macro names, not their expansions.
+
+ `I'
+ Output `#include' directives in addition to the result of
+ preprocessing.
+
+ `U'
+ Like `D' except that only macros that are expanded, or whose
+ definedness is tested in preprocessor directives, are output;
+ the output is delayed until the use or test of the macro; and
+ `#undef' directives are also output for macros tested but
+ undefined at the time.
+
+`-P'
+ Inhibit generation of linemarkers in the output from the
+ preprocessor. This might be useful when running the preprocessor
+ on something that is not C code, and will be sent to a program
+ which might be confused by the linemarkers.
+
+`-C'
+ Do not discard comments. All comments are passed through to the
+ output file, except for comments in processed directives, which
+ are deleted along with the directive.
+
+ You should be prepared for side effects when using `-C'; it causes
+ the preprocessor to treat comments as tokens in their own right.
+ For example, comments appearing at the start of what would be a
+ directive line have the effect of turning that line into an
+ ordinary source line, since the first token on the line is no
+ longer a `#'.
+
+`-CC'
+ Do not discard comments, including during macro expansion. This is
+ like `-C', except that comments contained within macros are also
+ passed through to the output file where the macro is expanded.
+
+ In addition to the side-effects of the `-C' option, the `-CC'
+ option causes all C++-style comments inside a macro to be
+ converted to C-style comments. This is to prevent later use of
+ that macro from inadvertently commenting out the remainder of the
+ source line.
+
+ The `-CC' option is generally used to support lint comments.
+
+`-traditional-cpp'
+ Try to imitate the behavior of old-fashioned C preprocessors, as
+ opposed to ISO C preprocessors.
+
+`-trigraphs'
+ Process trigraph sequences. These are three-character sequences,
+ all starting with `??', that are defined by ISO C to stand for
+ single characters. For example, `??/' stands for `\', so `'??/n''
+ is a character constant for a newline. By default, GCC ignores
+ trigraphs, but in standard-conforming modes it converts them. See
+ the `-std' and `-ansi' options.
+
+ The nine trigraphs and their replacements are
+
+ Trigraph: ??( ??) ??< ??> ??= ??/ ??' ??! ??-
+ Replacement: [ ] { } # \ ^ | ~
+
+`-remap'
+ Enable special code to work around file systems which only permit
+ very short file names, such as MS-DOS.
+
+`--help'
+`--target-help'
+ Print text describing all the command line options instead of
+ preprocessing anything.
+
+`-v'
+ Verbose mode. Print out GNU CPP's version number at the beginning
+ of execution, and report the final form of the include path.
+
+`-H'
+ Print the name of each header file used, in addition to other
+ normal activities. Each name is indented to show how deep in the
+ `#include' stack it is. Precompiled header files are also
+ printed, even if they are found to be invalid; an invalid
+ precompiled header file is printed with `...x' and a valid one
+ with `...!' .
+
+`-version'
+`--version'
+ Print out GNU CPP's version number. With one dash, proceed to
+ preprocess as normal. With two dashes, exit immediately.
+
+
+File: gcc.info, Node: Assembler Options, Next: Link Options, Prev: Preprocessor Options, Up: Invoking GCC
+
+3.12 Passing Options to the Assembler
+=====================================
+
+You can pass options to the assembler.
+
+`-Wa,OPTION'
+ Pass OPTION as an option to the assembler. If OPTION contains
+ commas, it is split into multiple options at the commas.
+
+`-Xassembler OPTION'
+ Pass OPTION as an option to the assembler. You can use this to
+ supply system-specific assembler options which GCC does not know
+ how to recognize.
+
+ If you want to pass an option that takes an argument, you must use
+ `-Xassembler' twice, once for the option and once for the argument.
+
+
+
+File: gcc.info, Node: Link Options, Next: Directory Options, Prev: Assembler Options, Up: Invoking GCC
+
+3.13 Options for Linking
+========================
+
+These options come into play when the compiler links object files into
+an executable output file. They are meaningless if the compiler is not
+doing a link step.
+
+`OBJECT-FILE-NAME'
+ A file name that does not end in a special recognized suffix is
+ considered to name an object file or library. (Object files are
+ distinguished from libraries by the linker according to the file
+ contents.) If linking is done, these object files are used as
+ input to the linker.
+
+`-c'
+`-S'
+`-E'
+ If any of these options is used, then the linker is not run, and
+ object file names should not be used as arguments. *Note Overall
+ Options::.
+
+`-lLIBRARY'
+`-l LIBRARY'
+ Search the library named LIBRARY when linking. (The second
+ alternative with the library as a separate argument is only for
+ POSIX compliance and is not recommended.)
+
+ It makes a difference where in the command you write this option;
+ the linker searches and processes libraries and object files in
+ the order they are specified. Thus, `foo.o -lz bar.o' searches
+ library `z' after file `foo.o' but before `bar.o'. If `bar.o'
+ refers to functions in `z', those functions may not be loaded.
+
+ The linker searches a standard list of directories for the library,
+ which is actually a file named `libLIBRARY.a'. The linker then
+ uses this file as if it had been specified precisely by name.
+
+ The directories searched include several standard system
+ directories plus any that you specify with `-L'.
+
+ Normally the files found this way are library files--archive files
+ whose members are object files. The linker handles an archive
+ file by scanning through it for members which define symbols that
+ have so far been referenced but not defined. But if the file that
+ is found is an ordinary object file, it is linked in the usual
+ fashion. The only difference between using an `-l' option and
+ specifying a file name is that `-l' surrounds LIBRARY with `lib'
+ and `.a' and searches several directories.
+
+`-lobjc'
+ You need this special case of the `-l' option in order to link an
+ Objective-C or Objective-C++ program.
+
+`-nostartfiles'
+ Do not use the standard system startup files when linking. The
+ standard system libraries are used normally, unless `-nostdlib' or
+ `-nodefaultlibs' is used.
+
+`-nodefaultlibs'
+ Do not use the standard system libraries when linking. Only the
+ libraries you specify will be passed to the linker. The standard
+ startup files are used normally, unless `-nostartfiles' is used.
+ The compiler may generate calls to `memcmp', `memset', `memcpy'
+ and `memmove'. These entries are usually resolved by entries in
+ libc. These entry points should be supplied through some other
+ mechanism when this option is specified.
+
+`-nostdlib'
+ Do not use the standard system startup files or libraries when
+ linking. No startup files and only the libraries you specify will
+ be passed to the linker. The compiler may generate calls to
+ `memcmp', `memset', `memcpy' and `memmove'. These entries are
+ usually resolved by entries in libc. These entry points should be
+ supplied through some other mechanism when this option is
+ specified.
+
+ One of the standard libraries bypassed by `-nostdlib' and
+ `-nodefaultlibs' is `libgcc.a', a library of internal subroutines
+ that GCC uses to overcome shortcomings of particular machines, or
+ special needs for some languages. (*Note Interfacing to GCC
+ Output: (gccint)Interface, for more discussion of `libgcc.a'.) In
+ most cases, you need `libgcc.a' even when you want to avoid other
+ standard libraries. In other words, when you specify `-nostdlib'
+ or `-nodefaultlibs' you should usually specify `-lgcc' as well.
+ This ensures that you have no unresolved references to internal GCC
+ library subroutines. (For example, `__main', used to ensure C++
+ constructors will be called; *note `collect2': (gccint)Collect2.)
+
+`-pie'
+ Produce a position independent executable on targets which support
+ it. For predictable results, you must also specify the same set
+ of options that were used to generate code (`-fpie', `-fPIE', or
+ model suboptions) when you specify this option.
+
+`-rdynamic'
+ Pass the flag `-export-dynamic' to the ELF linker, on targets that
+ support it. This instructs the linker to add all symbols, not only
+ used ones, to the dynamic symbol table. This option is needed for
+ some uses of `dlopen' or to allow obtaining backtraces from within
+ a program.
+
+`-s'
+ Remove all symbol table and relocation information from the
+ executable.
+
+`-static'
+ On systems that support dynamic linking, this prevents linking
+ with the shared libraries. On other systems, this option has no
+ effect.
+
+`-shared'
+ Produce a shared object which can then be linked with other
+ objects to form an executable. Not all systems support this
+ option. For predictable results, you must also specify the same
+ set of options that were used to generate code (`-fpic', `-fPIC',
+ or model suboptions) when you specify this option.(1)
+
+`-shared-libgcc'
+`-static-libgcc'
+ On systems that provide `libgcc' as a shared library, these options
+ force the use of either the shared or static version respectively.
+ If no shared version of `libgcc' was built when the compiler was
+ configured, these options have no effect.
+
+ There are several situations in which an application should use the
+ shared `libgcc' instead of the static version. The most common of
+ these is when the application wishes to throw and catch exceptions
+ across different shared libraries. In that case, each of the
+ libraries as well as the application itself should use the shared
+ `libgcc'.
+
+ Therefore, the G++ and GCJ drivers automatically add
+ `-shared-libgcc' whenever you build a shared library or a main
+ executable, because C++ and Java programs typically use
+ exceptions, so this is the right thing to do.
+
+ If, instead, you use the GCC driver to create shared libraries,
+ you may find that they will not always be linked with the shared
+ `libgcc'. If GCC finds, at its configuration time, that you have
+ a non-GNU linker or a GNU linker that does not support option
+ `--eh-frame-hdr', it will link the shared version of `libgcc' into
+ shared libraries by default. Otherwise, it will take advantage of
+ the linker and optimize away the linking with the shared version
+ of `libgcc', linking with the static version of libgcc by default.
+ This allows exceptions to propagate through such shared
+ libraries, without incurring relocation costs at library load time.
+
+ However, if a library or main executable is supposed to throw or
+ catch exceptions, you must link it using the G++ or GCJ driver, as
+ appropriate for the languages used in the program, or using the
+ option `-shared-libgcc', such that it is linked with the shared
+ `libgcc'.
+
+`-symbolic'
+ Bind references to global symbols when building a shared object.
+ Warn about any unresolved references (unless overridden by the
+ link editor option `-Xlinker -z -Xlinker defs'). Only a few
+ systems support this option.
+
+`-T SCRIPT'
+ Use SCRIPT as the linker script. This option is supported by most
+ systems using the GNU linker. On some targets, such as bare-board
+ targets without an operating system, the `-T' option may be
+ required when linking to avoid references to undefined symbols.
+
+`-Xlinker OPTION'
+ Pass OPTION as an option to the linker. You can use this to
+ supply system-specific linker options which GCC does not know how
+ to recognize.
+
+ If you want to pass an option that takes a separate argument, you
+ must use `-Xlinker' twice, once for the option and once for the
+ argument. For example, to pass `-assert definitions', you must
+ write `-Xlinker -assert -Xlinker definitions'. It does not work
+ to write `-Xlinker "-assert definitions"', because this passes the
+ entire string as a single argument, which is not what the linker
+ expects.
+
+ When using the GNU linker, it is usually more convenient to pass
+ arguments to linker options using the `OPTION=VALUE' syntax than
+ as separate arguments. For example, you can specify `-Xlinker
+ -Map=output.map' rather than `-Xlinker -Map -Xlinker output.map'.
+ Other linkers may not support this syntax for command-line options.
+
+`-Wl,OPTION'
+ Pass OPTION as an option to the linker. If OPTION contains
+ commas, it is split into multiple options at the commas. You can
+ use this syntax to pass an argument to the option. For example,
+ `-Wl,-Map,output.map' passes `-Map output.map' to the linker.
+ When using the GNU linker, you can also get the same effect with
+ `-Wl,-Map=output.map'.
+
+`-u SYMBOL'
+ Pretend the symbol SYMBOL is undefined, to force linking of
+ library modules to define it. You can use `-u' multiple times with
+ different symbols to force loading of additional library modules.
+
+ ---------- Footnotes ----------
+
+ (1) On some systems, `gcc -shared' needs to build supplementary stub
+code for constructors to work. On multi-libbed systems, `gcc -shared'
+must select the correct support libraries to link against. Failing to
+supply the correct flags may lead to subtle defects. Supplying them in
+cases where they are not necessary is innocuous.
+
+
+File: gcc.info, Node: Directory Options, Next: Spec Files, Prev: Link Options, Up: Invoking GCC
+
+3.14 Options for Directory Search
+=================================
+
+These options specify directories to search for header files, for
+libraries and for parts of the compiler:
+
+`-IDIR'
+ Add the directory DIR to the head of the list of directories to be
+ searched for header files. This can be used to override a system
+ header file, substituting your own version, since these
+ directories are searched before the system header file
+ directories. However, you should not use this option to add
+ directories that contain vendor-supplied system header files (use
+ `-isystem' for that). If you use more than one `-I' option, the
+ directories are scanned in left-to-right order; the standard
+ system directories come after.
+
+ If a standard system include directory, or a directory specified
+ with `-isystem', is also specified with `-I', the `-I' option will
+ be ignored. The directory will still be searched but as a system
+ directory at its normal position in the system include chain.
+ This is to ensure that GCC's procedure to fix buggy system headers
+ and the ordering for the include_next directive are not
+ inadvertently changed. If you really need to change the search
+ order for system directories, use the `-nostdinc' and/or
+ `-isystem' options.
+
+`-iquoteDIR'
+ Add the directory DIR to the head of the list of directories to be
+ searched for header files only for the case of `#include "FILE"';
+ they are not searched for `#include <FILE>', otherwise just like
+ `-I'.
+
+`-LDIR'
+ Add directory DIR to the list of directories to be searched for
+ `-l'.
+
+`-BPREFIX'
+ This option specifies where to find the executables, libraries,
+ include files, and data files of the compiler itself.
+
+ The compiler driver program runs one or more of the subprograms
+ `cpp', `cc1', `as' and `ld'. It tries PREFIX as a prefix for each
+ program it tries to run, both with and without `MACHINE/VERSION/'
+ (*note Target Options::).
+
+ For each subprogram to be run, the compiler driver first tries the
+ `-B' prefix, if any. If that name is not found, or if `-B' was
+ not specified, the driver tries two standard prefixes, which are
+ `/usr/lib/gcc/' and `/usr/local/lib/gcc/'. If neither of those
+ results in a file name that is found, the unmodified program name
+ is searched for using the directories specified in your `PATH'
+ environment variable.
+
+ The compiler will check to see if the path provided by the `-B'
+ refers to a directory, and if necessary it will add a directory
+ separator character at the end of the path.
+
+ `-B' prefixes that effectively specify directory names also apply
+ to libraries in the linker, because the compiler translates these
+ options into `-L' options for the linker. They also apply to
+ includes files in the preprocessor, because the compiler
+ translates these options into `-isystem' options for the
+ preprocessor. In this case, the compiler appends `include' to the
+ prefix.
+
+ The run-time support file `libgcc.a' can also be searched for using
+ the `-B' prefix, if needed. If it is not found there, the two
+ standard prefixes above are tried, and that is all. The file is
+ left out of the link if it is not found by those means.
+
+ Another way to specify a prefix much like the `-B' prefix is to use
+ the environment variable `GCC_EXEC_PREFIX'. *Note Environment
+ Variables::.
+
+ As a special kludge, if the path provided by `-B' is
+ `[dir/]stageN/', where N is a number in the range 0 to 9, then it
+ will be replaced by `[dir/]include'. This is to help with
+ boot-strapping the compiler.
+
+`-specs=FILE'
+ Process FILE after the compiler reads in the standard `specs'
+ file, in order to override the defaults that the `gcc' driver
+ program uses when determining what switches to pass to `cc1',
+ `cc1plus', `as', `ld', etc. More than one `-specs=FILE' can be
+ specified on the command line, and they are processed in order,
+ from left to right.
+
+`--sysroot=DIR'
+ Use DIR as the logical root directory for headers and libraries.
+ For example, if the compiler would normally search for headers in
+ `/usr/include' and libraries in `/usr/lib', it will instead search
+ `DIR/usr/include' and `DIR/usr/lib'.
+
+ If you use both this option and the `-isysroot' option, then the
+ `--sysroot' option will apply to libraries, but the `-isysroot'
+ option will apply to header files.
+
+ The GNU linker (beginning with version 2.16) has the necessary
+ support for this option. If your linker does not support this
+ option, the header file aspect of `--sysroot' will still work, but
+ the library aspect will not.
+
+`-I-'
+ This option has been deprecated. Please use `-iquote' instead for
+ `-I' directories before the `-I-' and remove the `-I-'. Any
+ directories you specify with `-I' options before the `-I-' option
+ are searched only for the case of `#include "FILE"'; they are not
+ searched for `#include <FILE>'.
+
+ If additional directories are specified with `-I' options after
+ the `-I-', these directories are searched for all `#include'
+ directives. (Ordinarily _all_ `-I' directories are used this way.)
+
+ In addition, the `-I-' option inhibits the use of the current
+ directory (where the current input file came from) as the first
+ search directory for `#include "FILE"'. There is no way to
+ override this effect of `-I-'. With `-I.' you can specify
+ searching the directory which was current when the compiler was
+ invoked. That is not exactly the same as what the preprocessor
+ does by default, but it is often satisfactory.
+
+ `-I-' does not inhibit the use of the standard system directories
+ for header files. Thus, `-I-' and `-nostdinc' are independent.
+
+
+File: gcc.info, Node: Spec Files, Next: Target Options, Prev: Directory Options, Up: Invoking GCC
+
+3.15 Specifying subprocesses and the switches to pass to them
+=============================================================
+
+`gcc' is a driver program. It performs its job by invoking a sequence
+of other programs to do the work of compiling, assembling and linking.
+GCC interprets its command-line parameters and uses these to deduce
+which programs it should invoke, and which command-line options it
+ought to place on their command lines. This behavior is controlled by
+"spec strings". In most cases there is one spec string for each
+program that GCC can invoke, but a few programs have multiple spec
+strings to control their behavior. The spec strings built into GCC can
+be overridden by using the `-specs=' command-line switch to specify a
+spec file.
+
+ "Spec files" are plaintext files that are used to construct spec
+strings. They consist of a sequence of directives separated by blank
+lines. The type of directive is determined by the first non-whitespace
+character on the line and it can be one of the following:
+
+`%COMMAND'
+ Issues a COMMAND to the spec file processor. The commands that can
+ appear here are:
+
+ `%include <FILE>'
+ Search for FILE and insert its text at the current point in
+ the specs file.
+
+ `%include_noerr <FILE>'
+ Just like `%include', but do not generate an error message if
+ the include file cannot be found.
+
+ `%rename OLD_NAME NEW_NAME'
+ Rename the spec string OLD_NAME to NEW_NAME.
+
+
+`*[SPEC_NAME]:'
+ This tells the compiler to create, override or delete the named
+ spec string. All lines after this directive up to the next
+ directive or blank line are considered to be the text for the spec
+ string. If this results in an empty string then the spec will be
+ deleted. (Or, if the spec did not exist, then nothing will
+ happened.) Otherwise, if the spec does not currently exist a new
+ spec will be created. If the spec does exist then its contents
+ will be overridden by the text of this directive, unless the first
+ character of that text is the `+' character, in which case the
+ text will be appended to the spec.
+
+`[SUFFIX]:'
+ Creates a new `[SUFFIX] spec' pair. All lines after this directive
+ and up to the next directive or blank line are considered to make
+ up the spec string for the indicated suffix. When the compiler
+ encounters an input file with the named suffix, it will processes
+ the spec string in order to work out how to compile that file.
+ For example:
+
+ .ZZ:
+ z-compile -input %i
+
+ This says that any input file whose name ends in `.ZZ' should be
+ passed to the program `z-compile', which should be invoked with the
+ command-line switch `-input' and with the result of performing the
+ `%i' substitution. (See below.)
+
+ As an alternative to providing a spec string, the text that
+ follows a suffix directive can be one of the following:
+
+ `@LANGUAGE'
+ This says that the suffix is an alias for a known LANGUAGE.
+ This is similar to using the `-x' command-line switch to GCC
+ to specify a language explicitly. For example:
+
+ .ZZ:
+ @c++
+
+ Says that .ZZ files are, in fact, C++ source files.
+
+ `#NAME'
+ This causes an error messages saying:
+
+ NAME compiler not installed on this system.
+
+ GCC already has an extensive list of suffixes built into it. This
+ directive will add an entry to the end of the list of suffixes, but
+ since the list is searched from the end backwards, it is
+ effectively possible to override earlier entries using this
+ technique.
+
+
+ GCC has the following spec strings built into it. Spec files can
+override these strings or create their own. Note that individual
+targets can also add their own spec strings to this list.
+
+ asm Options to pass to the assembler
+ asm_final Options to pass to the assembler post-processor
+ cpp Options to pass to the C preprocessor
+ cc1 Options to pass to the C compiler
+ cc1plus Options to pass to the C++ compiler
+ endfile Object files to include at the end of the link
+ link Options to pass to the linker
+ lib Libraries to include on the command line to the linker
+ libgcc Decides which GCC support library to pass to the linker
+ linker Sets the name of the linker
+ predefines Defines to be passed to the C preprocessor
+ signed_char Defines to pass to CPP to say whether `char' is signed
+ by default
+ startfile Object files to include at the start of the link
+
+ Here is a small example of a spec file:
+
+ %rename lib old_lib
+
+ *lib:
+ --start-group -lgcc -lc -leval1 --end-group %(old_lib)
+
+ This example renames the spec called `lib' to `old_lib' and then
+overrides the previous definition of `lib' with a new one. The new
+definition adds in some extra command-line options before including the
+text of the old definition.
+
+ "Spec strings" are a list of command-line options to be passed to their
+corresponding program. In addition, the spec strings can contain
+`%'-prefixed sequences to substitute variable text or to conditionally
+insert text into the command line. Using these constructs it is
+possible to generate quite complex command lines.
+
+ Here is a table of all defined `%'-sequences for spec strings. Note
+that spaces are not generated automatically around the results of
+expanding these sequences. Therefore you can concatenate them together
+or combine them with constant text in a single argument.
+
+`%%'
+ Substitute one `%' into the program name or argument.
+
+`%i'
+ Substitute the name of the input file being processed.
+
+`%b'
+ Substitute the basename of the input file being processed. This
+ is the substring up to (and not including) the last period and not
+ including the directory.
+
+`%B'
+ This is the same as `%b', but include the file suffix (text after
+ the last period).
+
+`%d'
+ Marks the argument containing or following the `%d' as a temporary
+ file name, so that that file will be deleted if GCC exits
+ successfully. Unlike `%g', this contributes no text to the
+ argument.
+
+`%gSUFFIX'
+ Substitute a file name that has suffix SUFFIX and is chosen once
+ per compilation, and mark the argument in the same way as `%d'.
+ To reduce exposure to denial-of-service attacks, the file name is
+ now chosen in a way that is hard to predict even when previously
+ chosen file names are known. For example, `%g.s ... %g.o ... %g.s'
+ might turn into `ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s'. SUFFIX
+ matches the regexp `[.A-Za-z]*' or the special string `%O', which
+ is treated exactly as if `%O' had been preprocessed. Previously,
+ `%g' was simply substituted with a file name chosen once per
+ compilation, without regard to any appended suffix (which was
+ therefore treated just like ordinary text), making such attacks
+ more likely to succeed.
+
+`%uSUFFIX'
+ Like `%g', but generates a new temporary file name even if
+ `%uSUFFIX' was already seen.
+
+`%USUFFIX'
+ Substitutes the last file name generated with `%uSUFFIX',
+ generating a new one if there is no such last file name. In the
+ absence of any `%uSUFFIX', this is just like `%gSUFFIX', except
+ they don't share the same suffix _space_, so `%g.s ... %U.s ...
+ %g.s ... %U.s' would involve the generation of two distinct file
+ names, one for each `%g.s' and another for each `%U.s'.
+ Previously, `%U' was simply substituted with a file name chosen
+ for the previous `%u', without regard to any appended suffix.
+
+`%jSUFFIX'
+ Substitutes the name of the `HOST_BIT_BUCKET', if any, and if it is
+ writable, and if save-temps is off; otherwise, substitute the name
+ of a temporary file, just like `%u'. This temporary file is not
+ meant for communication between processes, but rather as a junk
+ disposal mechanism.
+
+`%|SUFFIX'
+`%mSUFFIX'
+ Like `%g', except if `-pipe' is in effect. In that case `%|'
+ substitutes a single dash and `%m' substitutes nothing at all.
+ These are the two most common ways to instruct a program that it
+ should read from standard input or write to standard output. If
+ you need something more elaborate you can use an `%{pipe:`X'}'
+ construct: see for example `f/lang-specs.h'.
+
+`%.SUFFIX'
+ Substitutes .SUFFIX for the suffixes of a matched switch's args
+ when it is subsequently output with `%*'. SUFFIX is terminated by
+ the next space or %.
+
+`%w'
+ Marks the argument containing or following the `%w' as the
+ designated output file of this compilation. This puts the argument
+ into the sequence of arguments that `%o' will substitute later.
+
+`%o'
+ Substitutes the names of all the output files, with spaces
+ automatically placed around them. You should write spaces around
+ the `%o' as well or the results are undefined. `%o' is for use in
+ the specs for running the linker. Input files whose names have no
+ recognized suffix are not compiled at all, but they are included
+ among the output files, so they will be linked.
+
+`%O'
+ Substitutes the suffix for object files. Note that this is
+ handled specially when it immediately follows `%g, %u, or %U',
+ because of the need for those to form complete file names. The
+ handling is such that `%O' is treated exactly as if it had already
+ been substituted, except that `%g, %u, and %U' do not currently
+ support additional SUFFIX characters following `%O' as they would
+ following, for example, `.o'.
+
+`%p'
+ Substitutes the standard macro predefinitions for the current
+ target machine. Use this when running `cpp'.
+
+`%P'
+ Like `%p', but puts `__' before and after the name of each
+ predefined macro, except for macros that start with `__' or with
+ `_L', where L is an uppercase letter. This is for ISO C.
+
+`%I'
+ Substitute any of `-iprefix' (made from `GCC_EXEC_PREFIX'),
+ `-isysroot' (made from `TARGET_SYSTEM_ROOT'), `-isystem' (made
+ from `COMPILER_PATH' and `-B' options) and `-imultilib' as
+ necessary.
+
+`%s'
+ Current argument is the name of a library or startup file of some
+ sort. Search for that file in a standard list of directories and
+ substitute the full name found.
+
+`%eSTR'
+ Print STR as an error message. STR is terminated by a newline.
+ Use this when inconsistent options are detected.
+
+`%(NAME)'
+ Substitute the contents of spec string NAME at this point.
+
+`%[NAME]'
+ Like `%(...)' but put `__' around `-D' arguments.
+
+`%x{OPTION}'
+ Accumulate an option for `%X'.
+
+`%X'
+ Output the accumulated linker options specified by `-Wl' or a `%x'
+ spec string.
+
+`%Y'
+ Output the accumulated assembler options specified by `-Wa'.
+
+`%Z'
+ Output the accumulated preprocessor options specified by `-Wp'.
+
+`%a'
+ Process the `asm' spec. This is used to compute the switches to
+ be passed to the assembler.
+
+`%A'
+ Process the `asm_final' spec. This is a spec string for passing
+ switches to an assembler post-processor, if such a program is
+ needed.
+
+`%l'
+ Process the `link' spec. This is the spec for computing the
+ command line passed to the linker. Typically it will make use of
+ the `%L %G %S %D and %E' sequences.
+
+`%D'
+ Dump out a `-L' option for each directory that GCC believes might
+ contain startup files. If the target supports multilibs then the
+ current multilib directory will be prepended to each of these
+ paths.
+
+`%L'
+ Process the `lib' spec. This is a spec string for deciding which
+ libraries should be included on the command line to the linker.
+
+`%G'
+ Process the `libgcc' spec. This is a spec string for deciding
+ which GCC support library should be included on the command line
+ to the linker.
+
+`%S'
+ Process the `startfile' spec. This is a spec for deciding which
+ object files should be the first ones passed to the linker.
+ Typically this might be a file named `crt0.o'.
+
+`%E'
+ Process the `endfile' spec. This is a spec string that specifies
+ the last object files that will be passed to the linker.
+
+`%C'
+ Process the `cpp' spec. This is used to construct the arguments
+ to be passed to the C preprocessor.
+
+`%1'
+ Process the `cc1' spec. This is used to construct the options to
+ be passed to the actual C compiler (`cc1').
+
+`%2'
+ Process the `cc1plus' spec. This is used to construct the options
+ to be passed to the actual C++ compiler (`cc1plus').
+
+`%*'
+ Substitute the variable part of a matched option. See below.
+ Note that each comma in the substituted string is replaced by a
+ single space.
+
+`%<`S''
+ Remove all occurrences of `-S' from the command line. Note--this
+ command is position dependent. `%' commands in the spec string
+ before this one will see `-S', `%' commands in the spec string
+ after this one will not.
+
+`%:FUNCTION(ARGS)'
+ Call the named function FUNCTION, passing it ARGS. ARGS is first
+ processed as a nested spec string, then split into an argument
+ vector in the usual fashion. The function returns a string which
+ is processed as if it had appeared literally as part of the
+ current spec.
+
+ The following built-in spec functions are provided:
+
+ ``getenv''
+ The `getenv' spec function takes two arguments: an environment
+ variable name and a string. If the environment variable is
+ not defined, a fatal error is issued. Otherwise, the return
+ value is the value of the environment variable concatenated
+ with the string. For example, if `TOPDIR' is defined as
+ `/path/to/top', then:
+
+ %:getenv(TOPDIR /include)
+
+ expands to `/path/to/top/include'.
+
+ ``if-exists''
+ The `if-exists' spec function takes one argument, an absolute
+ pathname to a file. If the file exists, `if-exists' returns
+ the pathname. Here is a small example of its usage:
+
+ *startfile:
+ crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
+
+ ``if-exists-else''
+ The `if-exists-else' spec function is similar to the
+ `if-exists' spec function, except that it takes two
+ arguments. The first argument is an absolute pathname to a
+ file. If the file exists, `if-exists-else' returns the
+ pathname. If it does not exist, it returns the second
+ argument. This way, `if-exists-else' can be used to select
+ one file or another, based on the existence of the first.
+ Here is a small example of its usage:
+
+ *startfile:
+ crt0%O%s %:if-exists(crti%O%s) \
+ %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
+
+ ``replace-outfile''
+ The `replace-outfile' spec function takes two arguments. It
+ looks for the first argument in the outfiles array and
+ replaces it with the second argument. Here is a small
+ example of its usage:
+
+ %{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)}
+
+ ``print-asm-header''
+ The `print-asm-header' function takes no arguments and simply
+ prints a banner like:
+
+ Assembler options
+ =================
+
+ Use "-Wa,OPTION" to pass "OPTION" to the assembler.
+
+ It is used to separate compiler options from assembler options
+ in the `--target-help' output.
+
+`%{`S'}'
+ Substitutes the `-S' switch, if that switch was given to GCC. If
+ that switch was not specified, this substitutes nothing. Note that
+ the leading dash is omitted when specifying this option, and it is
+ automatically inserted if the substitution is performed. Thus the
+ spec string `%{foo}' would match the command-line option `-foo'
+ and would output the command line option `-foo'.
+
+`%W{`S'}'
+ Like %{`S'} but mark last argument supplied within as a file to be
+ deleted on failure.
+
+`%{`S'*}'
+ Substitutes all the switches specified to GCC whose names start
+ with `-S', but which also take an argument. This is used for
+ switches like `-o', `-D', `-I', etc. GCC considers `-o foo' as
+ being one switch whose names starts with `o'. %{o*} would
+ substitute this text, including the space. Thus two arguments
+ would be generated.
+
+`%{`S'*&`T'*}'
+ Like %{`S'*}, but preserve order of `S' and `T' options (the order
+ of `S' and `T' in the spec is not significant). There can be any
+ number of ampersand-separated variables; for each the wild card is
+ optional. Useful for CPP as `%{D*&U*&A*}'.
+
+`%{`S':`X'}'
+ Substitutes `X', if the `-S' switch was given to GCC.
+
+`%{!`S':`X'}'
+ Substitutes `X', if the `-S' switch was _not_ given to GCC.
+
+`%{`S'*:`X'}'
+ Substitutes `X' if one or more switches whose names start with
+ `-S' are specified to GCC. Normally `X' is substituted only once,
+ no matter how many such switches appeared. However, if `%*'
+ appears somewhere in `X', then `X' will be substituted once for
+ each matching switch, with the `%*' replaced by the part of that
+ switch that matched the `*'.
+
+`%{.`S':`X'}'
+ Substitutes `X', if processing a file with suffix `S'.
+
+`%{!.`S':`X'}'
+ Substitutes `X', if _not_ processing a file with suffix `S'.
+
+`%{,`S':`X'}'
+ Substitutes `X', if processing a file for language `S'.
+
+`%{!,`S':`X'}'
+ Substitutes `X', if not processing a file for language `S'.
+
+`%{`S'|`P':`X'}'
+ Substitutes `X' if either `-S' or `-P' was given to GCC. This may
+ be combined with `!', `.', `,', and `*' sequences as well,
+ although they have a stronger binding than the `|'. If `%*'
+ appears in `X', all of the alternatives must be starred, and only
+ the first matching alternative is substituted.
+
+ For example, a spec string like this:
+
+ %{.c:-foo} %{!.c:-bar} %{.c|d:-baz} %{!.c|d:-boggle}
+
+ will output the following command-line options from the following
+ input command-line options:
+
+ fred.c -foo -baz
+ jim.d -bar -boggle
+ -d fred.c -foo -baz -boggle
+ -d jim.d -bar -baz -boggle
+
+`%{S:X; T:Y; :D}'
+ If `S' was given to GCC, substitutes `X'; else if `T' was given to
+ GCC, substitutes `Y'; else substitutes `D'. There can be as many
+ clauses as you need. This may be combined with `.', `,', `!',
+ `|', and `*' as needed.
+
+
+ The conditional text `X' in a %{`S':`X'} or similar construct may
+contain other nested `%' constructs or spaces, or even newlines. They
+are processed as usual, as described above. Trailing white space in
+`X' is ignored. White space may also appear anywhere on the left side
+of the colon in these constructs, except between `.' or `*' and the
+corresponding word.
+
+ The `-O', `-f', `-m', and `-W' switches are handled specifically in
+these constructs. If another value of `-O' or the negated form of a
+`-f', `-m', or `-W' switch is found later in the command line, the
+earlier switch value is ignored, except with {`S'*} where `S' is just
+one letter, which passes all matching options.
+
+ The character `|' at the beginning of the predicate text is used to
+indicate that a command should be piped to the following command, but
+only if `-pipe' is specified.
+
+ It is built into GCC which switches take arguments and which do not.
+(You might think it would be useful to generalize this to allow each
+compiler's spec to say which switches take arguments. But this cannot
+be done in a consistent fashion. GCC cannot even decide which input
+files have been specified without knowing which switches take arguments,
+and it must know which input files to compile in order to tell which
+compilers to run).
+
+ GCC also knows implicitly that arguments starting in `-l' are to be
+treated as compiler output files, and passed to the linker in their
+proper position among the other output files.
+
+
+File: gcc.info, Node: Target Options, Next: Submodel Options, Prev: Spec Files, Up: Invoking GCC
+
+3.16 Specifying Target Machine and Compiler Version
+===================================================
+
+The usual way to run GCC is to run the executable called `gcc', or
+`<machine>-gcc' when cross-compiling, or `<machine>-gcc-<version>' to
+run a version other than the one that was installed last. Sometimes
+this is inconvenient, so GCC provides options that will switch to
+another cross-compiler or version.
+
+`-b MACHINE'
+ The argument MACHINE specifies the target machine for compilation.
+
+ The value to use for MACHINE is the same as was specified as the
+ machine type when configuring GCC as a cross-compiler. For
+ example, if a cross-compiler was configured with `configure
+ arm-elf', meaning to compile for an arm processor with elf
+ binaries, then you would specify `-b arm-elf' to run that cross
+ compiler. Because there are other options beginning with `-b', the
+ configuration must contain a hyphen, or `-b' alone should be one
+ argument followed by the configuration in the next argument.
+
+`-V VERSION'
+ The argument VERSION specifies which version of GCC to run. This
+ is useful when multiple versions are installed. For example,
+ VERSION might be `4.0', meaning to run GCC version 4.0.
+
+ The `-V' and `-b' options work by running the
+`<machine>-gcc-<version>' executable, so there's no real reason to use
+them if you can just run that directly.
+
+
+File: gcc.info, Node: Submodel Options, Next: Code Gen Options, Prev: Target Options, Up: Invoking GCC
+
+3.17 Hardware Models and Configurations
+=======================================
+
+Earlier we discussed the standard option `-b' which chooses among
+different installed compilers for completely different target machines,
+such as VAX vs. 68000 vs. 80386.
+
+ In addition, each of these target machine types can have its own
+special options, starting with `-m', to choose among various hardware
+models or configurations--for example, 68010 vs 68020, floating
+coprocessor or none. A single installed version of the compiler can
+compile for any model or configuration, according to the options
+specified.
+
+ Some configurations of the compiler also support additional special
+options, usually for compatibility with other compilers on the same
+platform.
+
+* Menu:
+
+* ARC Options::
+* ARM Options::
+* AVR Options::
+* Blackfin Options::
+* CRIS Options::
+* CRX Options::
+* Darwin Options::
+* DEC Alpha Options::
+* DEC Alpha/VMS Options::
+* FR30 Options::
+* FRV Options::
+* GNU/Linux Options::
+* H8/300 Options::
+* HPPA Options::
+* i386 and x86-64 Options::
+* i386 and x86-64 Windows Options::
+* IA-64 Options::
+* M32C Options::
+* M32R/D Options::
+* M680x0 Options::
+* M68hc1x Options::
+* MCore Options::
+* MIPS Options::
+* MMIX Options::
+* MN10300 Options::
+* PDP-11 Options::
+* picoChip Options::
+* PowerPC Options::
+* RS/6000 and PowerPC Options::
+* S/390 and zSeries Options::
+* Score Options::
+* SH Options::
+* SPARC Options::
+* SPU Options::
+* System V Options::
+* V850 Options::
+* VAX Options::
+* VxWorks Options::
+* x86-64 Options::
+* Xstormy16 Options::
+* Xtensa Options::
+* zSeries Options::
+
+
+File: gcc.info, Node: ARC Options, Next: ARM Options, Up: Submodel Options
+
+3.17.1 ARC Options
+------------------
+
+These options are defined for ARC implementations:
+
+`-EL'
+ Compile code for little endian mode. This is the default.
+
+`-EB'
+ Compile code for big endian mode.
+
+`-mmangle-cpu'
+ Prepend the name of the cpu to all public symbol names. In
+ multiple-processor systems, there are many ARC variants with
+ different instruction and register set characteristics. This flag
+ prevents code compiled for one cpu to be linked with code compiled
+ for another. No facility exists for handling variants that are
+ "almost identical". This is an all or nothing option.
+
+`-mcpu=CPU'
+ Compile code for ARC variant CPU. Which variants are supported
+ depend on the configuration. All variants support `-mcpu=base',
+ this is the default.
+
+`-mtext=TEXT-SECTION'
+`-mdata=DATA-SECTION'
+`-mrodata=READONLY-DATA-SECTION'
+ Put functions, data, and readonly data in TEXT-SECTION,
+ DATA-SECTION, and READONLY-DATA-SECTION respectively by default.
+ This can be overridden with the `section' attribute. *Note
+ Variable Attributes::.
+
+`-mfix-cortex-m3-ldrd'
+ Some Cortex-M3 cores can cause data corruption when `ldrd'
+ instructions with overlapping destination and base registers are
+ used. This option avoids generating these instructions. This
+ option is enabled by default when `-mcpu=cortex-m3' is specified.
+
+
+
+File: gcc.info, Node: ARM Options, Next: AVR Options, Prev: ARC Options, Up: Submodel Options
+
+3.17.2 ARM Options
+------------------
+
+These `-m' options are defined for Advanced RISC Machines (ARM)
+architectures:
+
+`-mabi=NAME'
+ Generate code for the specified ABI. Permissible values are:
+ `apcs-gnu', `atpcs', `aapcs', `aapcs-linux' and `iwmmxt'.
+
+`-mapcs-frame'
+ Generate a stack frame that is compliant with the ARM Procedure
+ Call Standard for all functions, even if this is not strictly
+ necessary for correct execution of the code. Specifying
+ `-fomit-frame-pointer' with this option will cause the stack
+ frames not to be generated for leaf functions. The default is
+ `-mno-apcs-frame'.
+
+`-mapcs'
+ This is a synonym for `-mapcs-frame'.
+
+`-mthumb-interwork'
+ Generate code which supports calling between the ARM and Thumb
+ instruction sets. Without this option the two instruction sets
+ cannot be reliably used inside one program. The default is
+ `-mno-thumb-interwork', since slightly larger code is generated
+ when `-mthumb-interwork' is specified.
+
+`-mno-sched-prolog'
+ Prevent the reordering of instructions in the function prolog, or
+ the merging of those instruction with the instructions in the
+ function's body. This means that all functions will start with a
+ recognizable set of instructions (or in fact one of a choice from
+ a small set of different function prologues), and this information
+ can be used to locate the start if functions inside an executable
+ piece of code. The default is `-msched-prolog'.
+
+`-mfloat-abi=NAME'
+ Specifies which floating-point ABI to use. Permissible values
+ are: `soft', `softfp' and `hard'.
+
+ Specifying `soft' causes GCC to generate output containing library
+ calls for floating-point operations. `softfp' allows the
+ generation of code using hardware floating-point instructions, but
+ still uses the soft-float calling conventions. `hard' allows
+ generation of floating-point instructions and uses FPU-specific
+ calling conventions.
+
+ Using `-mfloat-abi=hard' with VFP coprocessors is not supported.
+ Use `-mfloat-abi=softfp' with the appropriate `-mfpu' option to
+ allow the compiler to generate code that makes use of the hardware
+ floating-point capabilities for these CPUs.
+
+ The default depends on the specific target configuration. Note
+ that the hard-float and soft-float ABIs are not link-compatible;
+ you must compile your entire program with the same ABI, and link
+ with a compatible set of libraries.
+
+`-mhard-float'
+ Equivalent to `-mfloat-abi=hard'.
+
+`-msoft-float'
+ Equivalent to `-mfloat-abi=soft'.
+
+`-mlittle-endian'
+ Generate code for a processor running in little-endian mode. This
+ is the default for all standard configurations.
+
+`-mbig-endian'
+ Generate code for a processor running in big-endian mode; the
+ default is to compile code for a little-endian processor.
+
+`-mwords-little-endian'
+ This option only applies when generating code for big-endian
+ processors. Generate code for a little-endian word order but a
+ big-endian byte order. That is, a byte order of the form
+ `32107654'. Note: this option should only be used if you require
+ compatibility with code for big-endian ARM processors generated by
+ versions of the compiler prior to 2.8.
+
+`-mcpu=NAME'
+ This specifies the name of the target ARM processor. GCC uses
+ this name to determine what kind of instructions it can emit when
+ generating assembly code. Permissible names are: `arm2', `arm250',
+ `arm3', `arm6', `arm60', `arm600', `arm610', `arm620', `arm7',
+ `arm7m', `arm7d', `arm7dm', `arm7di', `arm7dmi', `arm70', `arm700',
+ `arm700i', `arm710', `arm710c', `arm7100', `arm720', `arm7500',
+ `arm7500fe', `arm7tdmi', `arm7tdmi-s', `arm710t', `arm720t',
+ `arm740t', `strongarm', `strongarm110', `strongarm1100',
+ `strongarm1110', `arm8', `arm810', `arm9', `arm9e', `arm920',
+ `arm920t', `arm922t', `arm946e-s', `arm966e-s', `arm968e-s',
+ `arm926ej-s', `arm940t', `arm9tdmi', `arm10tdmi', `arm1020t',
+ `arm1026ej-s', `arm10e', `arm1020e', `arm1022e', `arm1136j-s',
+ `arm1136jf-s', `mpcore', `mpcorenovfp', `arm1156t2-s',
+ `arm1176jz-s', `arm1176jzf-s', `cortex-a8', `cortex-a9',
+ `cortex-r4', `cortex-r4f', `cortex-m3', `cortex-m1', `xscale',
+ `iwmmxt', `iwmmxt2', `ep9312'.
+
+`-mtune=NAME'
+ This option is very similar to the `-mcpu=' option, except that
+ instead of specifying the actual target processor type, and hence
+ restricting which instructions can be used, it specifies that GCC
+ should tune the performance of the code as if the target were of
+ the type specified in this option, but still choosing the
+ instructions that it will generate based on the cpu specified by a
+ `-mcpu=' option. For some ARM implementations better performance
+ can be obtained by using this option.
+
+`-march=NAME'
+ This specifies the name of the target ARM architecture. GCC uses
+ this name to determine what kind of instructions it can emit when
+ generating assembly code. This option can be used in conjunction
+ with or instead of the `-mcpu=' option. Permissible names are:
+ `armv2', `armv2a', `armv3', `armv3m', `armv4', `armv4t', `armv5',
+ `armv5t', `armv5e', `armv5te', `armv6', `armv6j', `armv6t2',
+ `armv6z', `armv6zk', `armv6-m', `armv7', `armv7-a', `armv7-r',
+ `armv7-m', `iwmmxt', `iwmmxt2', `ep9312'.
+
+`-mfpu=NAME'
+`-mfpe=NUMBER'
+`-mfp=NUMBER'
+ This specifies what floating point hardware (or hardware
+ emulation) is available on the target. Permissible names are:
+ `fpa', `fpe2', `fpe3', `maverick', `vfp', `vfpv3', `vfpv3-d16' and
+ `neon'. `-mfp' and `-mfpe' are synonyms for `-mfpu'=`fpe'NUMBER,
+ for compatibility with older versions of GCC.
+
+ If `-msoft-float' is specified this specifies the format of
+ floating point values.
+
+`-mstructure-size-boundary=N'
+ The size of all structures and unions will be rounded up to a
+ multiple of the number of bits set by this option. Permissible
+ values are 8, 32 and 64. The default value varies for different
+ toolchains. For the COFF targeted toolchain the default value is
+ 8. A value of 64 is only allowed if the underlying ABI supports
+ it.
+
+ Specifying the larger number can produce faster, more efficient
+ code, but can also increase the size of the program. Different
+ values are potentially incompatible. Code compiled with one value
+ cannot necessarily expect to work with code or libraries compiled
+ with another value, if they exchange information using structures
+ or unions.
+
+`-mabort-on-noreturn'
+ Generate a call to the function `abort' at the end of a `noreturn'
+ function. It will be executed if the function tries to return.
+
+`-mlong-calls'
+`-mno-long-calls'
+ Tells the compiler to perform function calls by first loading the
+ address of the function into a register and then performing a
+ subroutine call on this register. This switch is needed if the
+ target function will lie outside of the 64 megabyte addressing
+ range of the offset based version of subroutine call instruction.
+
+ Even if this switch is enabled, not all function calls will be
+ turned into long calls. The heuristic is that static functions,
+ functions which have the `short-call' attribute, functions that
+ are inside the scope of a `#pragma no_long_calls' directive and
+ functions whose definitions have already been compiled within the
+ current compilation unit, will not be turned into long calls. The
+ exception to this rule is that weak function definitions,
+ functions with the `long-call' attribute or the `section'
+ attribute, and functions that are within the scope of a `#pragma
+ long_calls' directive, will always be turned into long calls.
+
+ This feature is not enabled by default. Specifying
+ `-mno-long-calls' will restore the default behavior, as will
+ placing the function calls within the scope of a `#pragma
+ long_calls_off' directive. Note these switches have no effect on
+ how the compiler generates code to handle function calls via
+ function pointers.
+
+`-msingle-pic-base'
+ Treat the register used for PIC addressing as read-only, rather
+ than loading it in the prologue for each function. The run-time
+ system is responsible for initializing this register with an
+ appropriate value before execution begins.
+
+`-mpic-register=REG'
+ Specify the register to be used for PIC addressing. The default
+ is R10 unless stack-checking is enabled, when R9 is used.
+
+`-mcirrus-fix-invalid-insns'
+ Insert NOPs into the instruction stream to in order to work around
+ problems with invalid Maverick instruction combinations. This
+ option is only valid if the `-mcpu=ep9312' option has been used to
+ enable generation of instructions for the Cirrus Maverick floating
+ point co-processor. This option is not enabled by default, since
+ the problem is only present in older Maverick implementations.
+ The default can be re-enabled by use of the
+ `-mno-cirrus-fix-invalid-insns' switch.
+
+`-mpoke-function-name'
+ Write the name of each function into the text section, directly
+ preceding the function prologue. The generated code is similar to
+ this:
+
+ t0
+ .ascii "arm_poke_function_name", 0
+ .align
+ t1
+ .word 0xff000000 + (t1 - t0)
+ arm_poke_function_name
+ mov ip, sp
+ stmfd sp!, {fp, ip, lr, pc}
+ sub fp, ip, #4
+
+ When performing a stack backtrace, code can inspect the value of
+ `pc' stored at `fp + 0'. If the trace function then looks at
+ location `pc - 12' and the top 8 bits are set, then we know that
+ there is a function name embedded immediately preceding this
+ location and has length `((pc[-3]) & 0xff000000)'.
+
+`-mthumb'
+ Generate code for the Thumb instruction set. The default is to
+ use the 32-bit ARM instruction set. This option automatically
+ enables either 16-bit Thumb-1 or mixed 16/32-bit Thumb-2
+ instructions based on the `-mcpu=NAME' and `-march=NAME' options.
+
+`-mtpcs-frame'
+ Generate a stack frame that is compliant with the Thumb Procedure
+ Call Standard for all non-leaf functions. (A leaf function is one
+ that does not call any other functions.) The default is
+ `-mno-tpcs-frame'.
+
+`-mtpcs-leaf-frame'
+ Generate a stack frame that is compliant with the Thumb Procedure
+ Call Standard for all leaf functions. (A leaf function is one
+ that does not call any other functions.) The default is
+ `-mno-apcs-leaf-frame'.
+
+`-mcallee-super-interworking'
+ Gives all externally visible functions in the file being compiled
+ an ARM instruction set header which switches to Thumb mode before
+ executing the rest of the function. This allows these functions
+ to be called from non-interworking code.
+
+`-mcaller-super-interworking'
+ Allows calls via function pointers (including virtual functions) to
+ execute correctly regardless of whether the target code has been
+ compiled for interworking or not. There is a small overhead in
+ the cost of executing a function pointer if this option is enabled.
+
+`-mtp=NAME'
+ Specify the access model for the thread local storage pointer.
+ The valid models are `soft', which generates calls to
+ `__aeabi_read_tp', `cp15', which fetches the thread pointer from
+ `cp15' directly (supported in the arm6k architecture), and `auto',
+ which uses the best available method for the selected processor.
+ The default setting is `auto'.
+
+`-mword-relocations'
+ Only generate absolute relocations on word sized values (i.e.
+ R_ARM_ABS32). This is enabled by default on targets (uClinux,
+ SymbianOS) where the runtime loader imposes this restriction, and
+ when `-fpic' or `-fPIC' is specified.
+
+
+
+File: gcc.info, Node: AVR Options, Next: Blackfin Options, Prev: ARM Options, Up: Submodel Options
+
+3.17.3 AVR Options
+------------------
+
+These options are defined for AVR implementations:
+
+`-mmcu=MCU'
+ Specify ATMEL AVR instruction set or MCU type.
+
+ Instruction set avr1 is for the minimal AVR core, not supported by
+ the C compiler, only for assembler programs (MCU types: at90s1200,
+ attiny10, attiny11, attiny12, attiny15, attiny28).
+
+ Instruction set avr2 (default) is for the classic AVR core with up
+ to 8K program memory space (MCU types: at90s2313, at90s2323,
+ attiny22, at90s2333, at90s2343, at90s4414, at90s4433, at90s4434,
+ at90s8515, at90c8534, at90s8535).
+
+ Instruction set avr3 is for the classic AVR core with up to 128K
+ program memory space (MCU types: atmega103, atmega603, at43usb320,
+ at76c711).
+
+ Instruction set avr4 is for the enhanced AVR core with up to 8K
+ program memory space (MCU types: atmega8, atmega83, atmega85).
+
+ Instruction set avr5 is for the enhanced AVR core with up to 128K
+ program memory space (MCU types: atmega16, atmega161, atmega163,
+ atmega32, atmega323, atmega64, atmega128, at43usb355, at94k).
+
+`-msize'
+ Output instruction sizes to the asm file.
+
+`-mno-interrupts'
+ Generated code is not compatible with hardware interrupts. Code
+ size will be smaller.
+
+`-mcall-prologues'
+ Functions prologues/epilogues expanded as call to appropriate
+ subroutines. Code size will be smaller.
+
+`-mno-tablejump'
+ Do not generate tablejump insns which sometimes increase code size.
+ The option is now deprecated in favor of the equivalent
+ `-fno-jump-tables'
+
+`-mtiny-stack'
+ Change only the low 8 bits of the stack pointer.
+
+`-mint8'
+ Assume int to be 8 bit integer. This affects the sizes of all
+ types: A char will be 1 byte, an int will be 1 byte, an long will
+ be 2 bytes and long long will be 4 bytes. Please note that this
+ option does not comply to the C standards, but it will provide you
+ with smaller code size.
+
+
+File: gcc.info, Node: Blackfin Options, Next: CRIS Options, Prev: AVR Options, Up: Submodel Options
+
+3.17.4 Blackfin Options
+-----------------------
+
+`-mcpu=CPU[-SIREVISION]'
+ Specifies the name of the target Blackfin processor. Currently,
+ CPU can be one of `bf512', `bf514', `bf516', `bf518', `bf522',
+ `bf523', `bf524', `bf525', `bf526', `bf527', `bf531', `bf532',
+ `bf533', `bf534', `bf536', `bf537', `bf538', `bf539', `bf542',
+ `bf544', `bf547', `bf548', `bf549', `bf561'. The optional
+ SIREVISION specifies the silicon revision of the target Blackfin
+ processor. Any workarounds available for the targeted silicon
+ revision will be enabled. If SIREVISION is `none', no workarounds
+ are enabled. If SIREVISION is `any', all workarounds for the
+ targeted processor will be enabled. The `__SILICON_REVISION__'
+ macro is defined to two hexadecimal digits representing the major
+ and minor numbers in the silicon revision. If SIREVISION is
+ `none', the `__SILICON_REVISION__' is not defined. If SIREVISION
+ is `any', the `__SILICON_REVISION__' is defined to be `0xffff'.
+ If this optional SIREVISION is not used, GCC assumes the latest
+ known silicon revision of the targeted Blackfin processor.
+
+ Support for `bf561' is incomplete. For `bf561', Only the
+ processor macro is defined. Without this option, `bf532' is used
+ as the processor by default. The corresponding predefined
+ processor macros for CPU is to be defined. And for `bfin-elf'
+ toolchain, this causes the hardware BSP provided by libgloss to be
+ linked in if `-msim' is not given.
+
+`-msim'
+ Specifies that the program will be run on the simulator. This
+ causes the simulator BSP provided by libgloss to be linked in.
+ This option has effect only for `bfin-elf' toolchain. Certain
+ other options, such as `-mid-shared-library' and `-mfdpic', imply
+ `-msim'.
+
+`-momit-leaf-frame-pointer'
+ Don't keep the frame pointer in a register for leaf functions.
+ This avoids the instructions to save, set up and restore frame
+ pointers and makes an extra register available in leaf functions.
+ The option `-fomit-frame-pointer' removes the frame pointer for
+ all functions which might make debugging harder.
+
+`-mspecld-anomaly'
+ When enabled, the compiler will ensure that the generated code
+ does not contain speculative loads after jump instructions. If
+ this option is used, `__WORKAROUND_SPECULATIVE_LOADS' is defined.
+
+`-mno-specld-anomaly'
+ Don't generate extra code to prevent speculative loads from
+ occurring.
+
+`-mcsync-anomaly'
+ When enabled, the compiler will ensure that the generated code
+ does not contain CSYNC or SSYNC instructions too soon after
+ conditional branches. If this option is used,
+ `__WORKAROUND_SPECULATIVE_SYNCS' is defined.
+
+`-mno-csync-anomaly'
+ Don't generate extra code to prevent CSYNC or SSYNC instructions
+ from occurring too soon after a conditional branch.
+
+`-mlow-64k'
+ When enabled, the compiler is free to take advantage of the
+ knowledge that the entire program fits into the low 64k of memory.
+
+`-mno-low-64k'
+ Assume that the program is arbitrarily large. This is the default.
+
+`-mstack-check-l1'
+ Do stack checking using information placed into L1 scratchpad
+ memory by the uClinux kernel.
+
+`-mid-shared-library'
+ Generate code that supports shared libraries via the library ID
+ method. This allows for execute in place and shared libraries in
+ an environment without virtual memory management. This option
+ implies `-fPIC'. With a `bfin-elf' target, this option implies
+ `-msim'.
+
+`-mno-id-shared-library'
+ Generate code that doesn't assume ID based shared libraries are
+ being used. This is the default.
+
+`-mleaf-id-shared-library'
+ Generate code that supports shared libraries via the library ID
+ method, but assumes that this library or executable won't link
+ against any other ID shared libraries. That allows the compiler
+ to use faster code for jumps and calls.
+
+`-mno-leaf-id-shared-library'
+ Do not assume that the code being compiled won't link against any
+ ID shared libraries. Slower code will be generated for jump and
+ call insns.
+
+`-mshared-library-id=n'
+ Specified the identification number of the ID based shared library
+ being compiled. Specifying a value of 0 will generate more
+ compact code, specifying other values will force the allocation of
+ that number to the current library but is no more space or time
+ efficient than omitting this option.
+
+`-msep-data'
+ Generate code that allows the data segment to be located in a
+ different area of memory from the text segment. This allows for
+ execute in place in an environment without virtual memory
+ management by eliminating relocations against the text section.
+
+`-mno-sep-data'
+ Generate code that assumes that the data segment follows the text
+ segment. This is the default.
+
+`-mlong-calls'
+`-mno-long-calls'
+ Tells the compiler to perform function calls by first loading the
+ address of the function into a register and then performing a
+ subroutine call on this register. This switch is needed if the
+ target function will lie outside of the 24 bit addressing range of
+ the offset based version of subroutine call instruction.
+
+ This feature is not enabled by default. Specifying
+ `-mno-long-calls' will restore the default behavior. Note these
+ switches have no effect on how the compiler generates code to
+ handle function calls via function pointers.
+
+`-mfast-fp'
+ Link with the fast floating-point library. This library relaxes
+ some of the IEEE floating-point standard's rules for checking
+ inputs against Not-a-Number (NAN), in the interest of performance.
+
+`-minline-plt'
+ Enable inlining of PLT entries in function calls to functions that
+ are not known to bind locally. It has no effect without `-mfdpic'.
+
+`-mmulticore'
+ Build standalone application for multicore Blackfin processor.
+ Proper start files and link scripts will be used to support
+ multicore. This option defines `__BFIN_MULTICORE'. It can only be
+ used with `-mcpu=bf561[-SIREVISION]'. It can be used with
+ `-mcorea' or `-mcoreb'. If it's used without `-mcorea' or
+ `-mcoreb', single application/dual core programming model is used.
+ In this model, the main function of Core B should be named as
+ coreb_main. If it's used with `-mcorea' or `-mcoreb', one
+ application per core programming model is used. If this option is
+ not used, single core application programming model is used.
+
+`-mcorea'
+ Build standalone application for Core A of BF561 when using one
+ application per core programming model. Proper start files and
+ link scripts will be used to support Core A. This option defines
+ `__BFIN_COREA'. It must be used with `-mmulticore'.
+
+`-mcoreb'
+ Build standalone application for Core B of BF561 when using one
+ application per core programming model. Proper start files and
+ link scripts will be used to support Core B. This option defines
+ `__BFIN_COREB'. When this option is used, coreb_main should be
+ used instead of main. It must be used with `-mmulticore'.
+
+`-msdram'
+ Build standalone application for SDRAM. Proper start files and
+ link scripts will be used to put the application into SDRAM.
+ Loader should initialize SDRAM before loading the application into
+ SDRAM. This option defines `__BFIN_SDRAM'.
+
+`-micplb'
+ Assume that ICPLBs are enabled at runtime. This has an effect on
+ certain anomaly workarounds. For Linux targets, the default is to
+ assume ICPLBs are enabled; for standalone applications the default
+ is off.
+
+
+File: gcc.info, Node: CRIS Options, Next: CRX Options, Prev: Blackfin Options, Up: Submodel Options
+
+3.17.5 CRIS Options
+-------------------
+
+These options are defined specifically for the CRIS ports.
+
+`-march=ARCHITECTURE-TYPE'
+`-mcpu=ARCHITECTURE-TYPE'
+ Generate code for the specified architecture. The choices for
+ ARCHITECTURE-TYPE are `v3', `v8' and `v10' for respectively
+ ETRAX 4, ETRAX 100, and ETRAX 100 LX. Default is `v0' except for
+ cris-axis-linux-gnu, where the default is `v10'.
+
+`-mtune=ARCHITECTURE-TYPE'
+ Tune to ARCHITECTURE-TYPE everything applicable about the generated
+ code, except for the ABI and the set of available instructions.
+ The choices for ARCHITECTURE-TYPE are the same as for
+ `-march=ARCHITECTURE-TYPE'.
+
+`-mmax-stack-frame=N'
+ Warn when the stack frame of a function exceeds N bytes.
+
+`-metrax4'
+`-metrax100'
+ The options `-metrax4' and `-metrax100' are synonyms for
+ `-march=v3' and `-march=v8' respectively.
+
+`-mmul-bug-workaround'
+`-mno-mul-bug-workaround'
+ Work around a bug in the `muls' and `mulu' instructions for CPU
+ models where it applies. This option is active by default.
+
+`-mpdebug'
+ Enable CRIS-specific verbose debug-related information in the
+ assembly code. This option also has the effect to turn off the
+ `#NO_APP' formatted-code indicator to the assembler at the
+ beginning of the assembly file.
+
+`-mcc-init'
+ Do not use condition-code results from previous instruction;
+ always emit compare and test instructions before use of condition
+ codes.
+
+`-mno-side-effects'
+ Do not emit instructions with side-effects in addressing modes
+ other than post-increment.
+
+`-mstack-align'
+`-mno-stack-align'
+`-mdata-align'
+`-mno-data-align'
+`-mconst-align'
+`-mno-const-align'
+ These options (no-options) arranges (eliminate arrangements) for
+ the stack-frame, individual data and constants to be aligned for
+ the maximum single data access size for the chosen CPU model. The
+ default is to arrange for 32-bit alignment. ABI details such as
+ structure layout are not affected by these options.
+
+`-m32-bit'
+`-m16-bit'
+`-m8-bit'
+ Similar to the stack- data- and const-align options above, these
+ options arrange for stack-frame, writable data and constants to
+ all be 32-bit, 16-bit or 8-bit aligned. The default is 32-bit
+ alignment.
+
+`-mno-prologue-epilogue'
+`-mprologue-epilogue'
+ With `-mno-prologue-epilogue', the normal function prologue and
+ epilogue that sets up the stack-frame are omitted and no return
+ instructions or return sequences are generated in the code. Use
+ this option only together with visual inspection of the compiled
+ code: no warnings or errors are generated when call-saved
+ registers must be saved, or storage for local variable needs to be
+ allocated.
+
+`-mno-gotplt'
+`-mgotplt'
+ With `-fpic' and `-fPIC', don't generate (do generate) instruction
+ sequences that load addresses for functions from the PLT part of
+ the GOT rather than (traditional on other architectures) calls to
+ the PLT. The default is `-mgotplt'.
+
+`-melf'
+ Legacy no-op option only recognized with the cris-axis-elf and
+ cris-axis-linux-gnu targets.
+
+`-mlinux'
+ Legacy no-op option only recognized with the cris-axis-linux-gnu
+ target.
+
+`-sim'
+ This option, recognized for the cris-axis-elf arranges to link
+ with input-output functions from a simulator library. Code,
+ initialized data and zero-initialized data are allocated
+ consecutively.
+
+`-sim2'
+ Like `-sim', but pass linker options to locate initialized data at
+ 0x40000000 and zero-initialized data at 0x80000000.
+
+
+File: gcc.info, Node: CRX Options, Next: Darwin Options, Prev: CRIS Options, Up: Submodel Options
+
+3.17.6 CRX Options
+------------------
+
+These options are defined specifically for the CRX ports.
+
+`-mmac'
+ Enable the use of multiply-accumulate instructions. Disabled by
+ default.
+
+`-mpush-args'
+ Push instructions will be used to pass outgoing arguments when
+ functions are called. Enabled by default.
+
+
+File: gcc.info, Node: Darwin Options, Next: DEC Alpha Options, Prev: CRX Options, Up: Submodel Options
+
+3.17.7 Darwin Options
+---------------------
+
+These options are defined for all architectures running the Darwin
+operating system.
+
+ FSF GCC on Darwin does not create "fat" object files; it will create
+an object file for the single architecture that it was built to target.
+Apple's GCC on Darwin does create "fat" files if multiple `-arch'
+options are used; it does so by running the compiler or linker multiple
+times and joining the results together with `lipo'.
+
+ The subtype of the file created (like `ppc7400' or `ppc970' or `i686')
+is determined by the flags that specify the ISA that GCC is targetting,
+like `-mcpu' or `-march'. The `-force_cpusubtype_ALL' option can be
+used to override this.
+
+ The Darwin tools vary in their behavior when presented with an ISA
+mismatch. The assembler, `as', will only permit instructions to be
+used that are valid for the subtype of the file it is generating, so
+you cannot put 64-bit instructions in an `ppc750' object file. The
+linker for shared libraries, `/usr/bin/libtool', will fail and print an
+error if asked to create a shared library with a less restrictive
+subtype than its input files (for instance, trying to put a `ppc970'
+object file in a `ppc7400' library). The linker for executables, `ld',
+will quietly give the executable the most restrictive subtype of any of
+its input files.
+
+`-FDIR'
+ Add the framework directory DIR to the head of the list of
+ directories to be searched for header files. These directories are
+ interleaved with those specified by `-I' options and are scanned
+ in a left-to-right order.
+
+ A framework directory is a directory with frameworks in it. A
+ framework is a directory with a `"Headers"' and/or
+ `"PrivateHeaders"' directory contained directly in it that ends in
+ `".framework"'. The name of a framework is the name of this
+ directory excluding the `".framework"'. Headers associated with
+ the framework are found in one of those two directories, with
+ `"Headers"' being searched first. A subframework is a framework
+ directory that is in a framework's `"Frameworks"' directory.
+ Includes of subframework headers can only appear in a header of a
+ framework that contains the subframework, or in a sibling
+ subframework header. Two subframeworks are siblings if they occur
+ in the same framework. A subframework should not have the same
+ name as a framework, a warning will be issued if this is violated.
+ Currently a subframework cannot have subframeworks, in the
+ future, the mechanism may be extended to support this. The
+ standard frameworks can be found in `"/System/Library/Frameworks"'
+ and `"/Library/Frameworks"'. An example include looks like
+ `#include <Framework/header.h>', where `Framework' denotes the
+ name of the framework and header.h is found in the
+ `"PrivateHeaders"' or `"Headers"' directory.
+
+`-iframeworkDIR'
+ Like `-F' except the directory is a treated as a system directory.
+ The main difference between this `-iframework' and `-F' is that
+ with `-iframework' the compiler does not warn about constructs
+ contained within header files found via DIR. This option is valid
+ only for the C family of languages.
+
+`-gused'
+ Emit debugging information for symbols that are used. For STABS
+ debugging format, this enables `-feliminate-unused-debug-symbols'.
+ This is by default ON.
+
+`-gfull'
+ Emit debugging information for all symbols and types.
+
+`-mmacosx-version-min=VERSION'
+ The earliest version of MacOS X that this executable will run on
+ is VERSION. Typical values of VERSION include `10.1', `10.2', and
+ `10.3.9'.
+
+ If the compiler was built to use the system's headers by default,
+ then the default for this option is the system version on which the
+ compiler is running, otherwise the default is to make choices which
+ are compatible with as many systems and code bases as possible.
+
+`-mkernel'
+ Enable kernel development mode. The `-mkernel' option sets
+ `-static', `-fno-common', `-fno-cxa-atexit', `-fno-exceptions',
+ `-fno-non-call-exceptions', `-fapple-kext', `-fno-weak' and
+ `-fno-rtti' where applicable. This mode also sets `-mno-altivec',
+ `-msoft-float', `-fno-builtin' and `-mlong-branch' for PowerPC
+ targets.
+
+`-mone-byte-bool'
+ Override the defaults for `bool' so that `sizeof(bool)==1'. By
+ default `sizeof(bool)' is `4' when compiling for Darwin/PowerPC
+ and `1' when compiling for Darwin/x86, so this option has no
+ effect on x86.
+
+ *Warning:* The `-mone-byte-bool' switch causes GCC to generate
+ code that is not binary compatible with code generated without
+ that switch. Using this switch may require recompiling all other
+ modules in a program, including system libraries. Use this switch
+ to conform to a non-default data model.
+
+`-mfix-and-continue'
+`-ffix-and-continue'
+`-findirect-data'
+ Generate code suitable for fast turn around development. Needed to
+ enable gdb to dynamically load `.o' files into already running
+ programs. `-findirect-data' and `-ffix-and-continue' are provided
+ for backwards compatibility.
+
+`-all_load'
+ Loads all members of static archive libraries. See man ld(1) for
+ more information.
+
+`-arch_errors_fatal'
+ Cause the errors having to do with files that have the wrong
+ architecture to be fatal.
+
+`-bind_at_load'
+ Causes the output file to be marked such that the dynamic linker
+ will bind all undefined references when the file is loaded or
+ launched.
+
+`-bundle'
+ Produce a Mach-o bundle format file. See man ld(1) for more
+ information.
+
+`-bundle_loader EXECUTABLE'
+ This option specifies the EXECUTABLE that will be loading the build
+ output file being linked. See man ld(1) for more information.
+
+`-dynamiclib'
+ When passed this option, GCC will produce a dynamic library
+ instead of an executable when linking, using the Darwin `libtool'
+ command.
+
+`-force_cpusubtype_ALL'
+ This causes GCC's output file to have the ALL subtype, instead of
+ one controlled by the `-mcpu' or `-march' option.
+
+`-allowable_client CLIENT_NAME'
+`-client_name'
+`-compatibility_version'
+`-current_version'
+`-dead_strip'
+`-dependency-file'
+`-dylib_file'
+`-dylinker_install_name'
+`-dynamic'
+`-exported_symbols_list'
+`-filelist'
+`-flat_namespace'
+`-force_flat_namespace'
+`-headerpad_max_install_names'
+`-image_base'
+`-init'
+`-install_name'
+`-keep_private_externs'
+`-multi_module'
+`-multiply_defined'
+`-multiply_defined_unused'
+`-noall_load'
+`-no_dead_strip_inits_and_terms'
+`-nofixprebinding'
+`-nomultidefs'
+`-noprebind'
+`-noseglinkedit'
+`-pagezero_size'
+`-prebind'
+`-prebind_all_twolevel_modules'
+`-private_bundle'
+`-read_only_relocs'
+`-sectalign'
+`-sectobjectsymbols'
+`-whyload'
+`-seg1addr'
+`-sectcreate'
+`-sectobjectsymbols'
+`-sectorder'
+`-segaddr'
+`-segs_read_only_addr'
+`-segs_read_write_addr'
+`-seg_addr_table'
+`-seg_addr_table_filename'
+`-seglinkedit'
+`-segprot'
+`-segs_read_only_addr'
+`-segs_read_write_addr'
+`-single_module'
+`-static'
+`-sub_library'
+`-sub_umbrella'
+`-twolevel_namespace'
+`-umbrella'
+`-undefined'
+`-unexported_symbols_list'
+`-weak_reference_mismatches'
+`-whatsloaded'
+ These options are passed to the Darwin linker. The Darwin linker
+ man page describes them in detail.
+
+
+File: gcc.info, Node: DEC Alpha Options, Next: DEC Alpha/VMS Options, Prev: Darwin Options, Up: Submodel Options
+
+3.17.8 DEC Alpha Options
+------------------------
+
+These `-m' options are defined for the DEC Alpha implementations:
+
+`-mno-soft-float'
+`-msoft-float'
+ Use (do not use) the hardware floating-point instructions for
+ floating-point operations. When `-msoft-float' is specified,
+ functions in `libgcc.a' will be used to perform floating-point
+ operations. Unless they are replaced by routines that emulate the
+ floating-point operations, or compiled in such a way as to call
+ such emulations routines, these routines will issue floating-point
+ operations. If you are compiling for an Alpha without
+ floating-point operations, you must ensure that the library is
+ built so as not to call them.
+
+ Note that Alpha implementations without floating-point operations
+ are required to have floating-point registers.
+
+`-mfp-reg'
+`-mno-fp-regs'
+ Generate code that uses (does not use) the floating-point register
+ set. `-mno-fp-regs' implies `-msoft-float'. If the floating-point
+ register set is not used, floating point operands are passed in
+ integer registers as if they were integers and floating-point
+ results are passed in `$0' instead of `$f0'. This is a
+ non-standard calling sequence, so any function with a
+ floating-point argument or return value called by code compiled
+ with `-mno-fp-regs' must also be compiled with that option.
+
+ A typical use of this option is building a kernel that does not
+ use, and hence need not save and restore, any floating-point
+ registers.
+
+`-mieee'
+ The Alpha architecture implements floating-point hardware
+ optimized for maximum performance. It is mostly compliant with
+ the IEEE floating point standard. However, for full compliance,
+ software assistance is required. This option generates code fully
+ IEEE compliant code _except_ that the INEXACT-FLAG is not
+ maintained (see below). If this option is turned on, the
+ preprocessor macro `_IEEE_FP' is defined during compilation. The
+ resulting code is less efficient but is able to correctly support
+ denormalized numbers and exceptional IEEE values such as
+ not-a-number and plus/minus infinity. Other Alpha compilers call
+ this option `-ieee_with_no_inexact'.
+
+`-mieee-with-inexact'
+ This is like `-mieee' except the generated code also maintains the
+ IEEE INEXACT-FLAG. Turning on this option causes the generated
+ code to implement fully-compliant IEEE math. In addition to
+ `_IEEE_FP', `_IEEE_FP_EXACT' is defined as a preprocessor macro.
+ On some Alpha implementations the resulting code may execute
+ significantly slower than the code generated by default. Since
+ there is very little code that depends on the INEXACT-FLAG, you
+ should normally not specify this option. Other Alpha compilers
+ call this option `-ieee_with_inexact'.
+
+`-mfp-trap-mode=TRAP-MODE'
+ This option controls what floating-point related traps are enabled.
+ Other Alpha compilers call this option `-fptm TRAP-MODE'. The
+ trap mode can be set to one of four values:
+
+ `n'
+ This is the default (normal) setting. The only traps that
+ are enabled are the ones that cannot be disabled in software
+ (e.g., division by zero trap).
+
+ `u'
+ In addition to the traps enabled by `n', underflow traps are
+ enabled as well.
+
+ `su'
+ Like `u', but the instructions are marked to be safe for
+ software completion (see Alpha architecture manual for
+ details).
+
+ `sui'
+ Like `su', but inexact traps are enabled as well.
+
+`-mfp-rounding-mode=ROUNDING-MODE'
+ Selects the IEEE rounding mode. Other Alpha compilers call this
+ option `-fprm ROUNDING-MODE'. The ROUNDING-MODE can be one of:
+
+ `n'
+ Normal IEEE rounding mode. Floating point numbers are
+ rounded towards the nearest machine number or towards the
+ even machine number in case of a tie.
+
+ `m'
+ Round towards minus infinity.
+
+ `c'
+ Chopped rounding mode. Floating point numbers are rounded
+ towards zero.
+
+ `d'
+ Dynamic rounding mode. A field in the floating point control
+ register (FPCR, see Alpha architecture reference manual)
+ controls the rounding mode in effect. The C library
+ initializes this register for rounding towards plus infinity.
+ Thus, unless your program modifies the FPCR, `d' corresponds
+ to round towards plus infinity.
+
+`-mtrap-precision=TRAP-PRECISION'
+ In the Alpha architecture, floating point traps are imprecise.
+ This means without software assistance it is impossible to recover
+ from a floating trap and program execution normally needs to be
+ terminated. GCC can generate code that can assist operating
+ system trap handlers in determining the exact location that caused
+ a floating point trap. Depending on the requirements of an
+ application, different levels of precisions can be selected:
+
+ `p'
+ Program precision. This option is the default and means a
+ trap handler can only identify which program caused a
+ floating point exception.
+
+ `f'
+ Function precision. The trap handler can determine the
+ function that caused a floating point exception.
+
+ `i'
+ Instruction precision. The trap handler can determine the
+ exact instruction that caused a floating point exception.
+
+ Other Alpha compilers provide the equivalent options called
+ `-scope_safe' and `-resumption_safe'.
+
+`-mieee-conformant'
+ This option marks the generated code as IEEE conformant. You must
+ not use this option unless you also specify `-mtrap-precision=i'
+ and either `-mfp-trap-mode=su' or `-mfp-trap-mode=sui'. Its only
+ effect is to emit the line `.eflag 48' in the function prologue of
+ the generated assembly file. Under DEC Unix, this has the effect
+ that IEEE-conformant math library routines will be linked in.
+
+`-mbuild-constants'
+ Normally GCC examines a 32- or 64-bit integer constant to see if
+ it can construct it from smaller constants in two or three
+ instructions. If it cannot, it will output the constant as a
+ literal and generate code to load it from the data segment at
+ runtime.
+
+ Use this option to require GCC to construct _all_ integer constants
+ using code, even if it takes more instructions (the maximum is
+ six).
+
+ You would typically use this option to build a shared library
+ dynamic loader. Itself a shared library, it must relocate itself
+ in memory before it can find the variables and constants in its
+ own data segment.
+
+`-malpha-as'
+`-mgas'
+ Select whether to generate code to be assembled by the
+ vendor-supplied assembler (`-malpha-as') or by the GNU assembler
+ `-mgas'.
+
+`-mbwx'
+`-mno-bwx'
+`-mcix'
+`-mno-cix'
+`-mfix'
+`-mno-fix'
+`-mmax'
+`-mno-max'
+ Indicate whether GCC should generate code to use the optional BWX,
+ CIX, FIX and MAX instruction sets. The default is to use the
+ instruction sets supported by the CPU type specified via `-mcpu='
+ option or that of the CPU on which GCC was built if none was
+ specified.
+
+`-mfloat-vax'
+`-mfloat-ieee'
+ Generate code that uses (does not use) VAX F and G floating point
+ arithmetic instead of IEEE single and double precision.
+
+`-mexplicit-relocs'
+`-mno-explicit-relocs'
+ Older Alpha assemblers provided no way to generate symbol
+ relocations except via assembler macros. Use of these macros does
+ not allow optimal instruction scheduling. GNU binutils as of
+ version 2.12 supports a new syntax that allows the compiler to
+ explicitly mark which relocations should apply to which
+ instructions. This option is mostly useful for debugging, as GCC
+ detects the capabilities of the assembler when it is built and
+ sets the default accordingly.
+
+`-msmall-data'
+`-mlarge-data'
+ When `-mexplicit-relocs' is in effect, static data is accessed via
+ "gp-relative" relocations. When `-msmall-data' is used, objects 8
+ bytes long or smaller are placed in a "small data area" (the
+ `.sdata' and `.sbss' sections) and are accessed via 16-bit
+ relocations off of the `$gp' register. This limits the size of
+ the small data area to 64KB, but allows the variables to be
+ directly accessed via a single instruction.
+
+ The default is `-mlarge-data'. With this option the data area is
+ limited to just below 2GB. Programs that require more than 2GB of
+ data must use `malloc' or `mmap' to allocate the data in the heap
+ instead of in the program's data segment.
+
+ When generating code for shared libraries, `-fpic' implies
+ `-msmall-data' and `-fPIC' implies `-mlarge-data'.
+
+`-msmall-text'
+`-mlarge-text'
+ When `-msmall-text' is used, the compiler assumes that the code of
+ the entire program (or shared library) fits in 4MB, and is thus
+ reachable with a branch instruction. When `-msmall-data' is used,
+ the compiler can assume that all local symbols share the same
+ `$gp' value, and thus reduce the number of instructions required
+ for a function call from 4 to 1.
+
+ The default is `-mlarge-text'.
+
+`-mcpu=CPU_TYPE'
+ Set the instruction set and instruction scheduling parameters for
+ machine type CPU_TYPE. You can specify either the `EV' style name
+ or the corresponding chip number. GCC supports scheduling
+ parameters for the EV4, EV5 and EV6 family of processors and will
+ choose the default values for the instruction set from the
+ processor you specify. If you do not specify a processor type,
+ GCC will default to the processor on which the compiler was built.
+
+ Supported values for CPU_TYPE are
+
+ `ev4'
+ `ev45'
+ `21064'
+ Schedules as an EV4 and has no instruction set extensions.
+
+ `ev5'
+ `21164'
+ Schedules as an EV5 and has no instruction set extensions.
+
+ `ev56'
+ `21164a'
+ Schedules as an EV5 and supports the BWX extension.
+
+ `pca56'
+ `21164pc'
+ `21164PC'
+ Schedules as an EV5 and supports the BWX and MAX extensions.
+
+ `ev6'
+ `21264'
+ Schedules as an EV6 and supports the BWX, FIX, and MAX
+ extensions.
+
+ `ev67'
+ `21264a'
+ Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX
+ extensions.
+
+ Native Linux/GNU toolchains also support the value `native', which
+ selects the best architecture option for the host processor.
+ `-mcpu=native' has no effect if GCC does not recognize the
+ processor.
+
+`-mtune=CPU_TYPE'
+ Set only the instruction scheduling parameters for machine type
+ CPU_TYPE. The instruction set is not changed.
+
+ Native Linux/GNU toolchains also support the value `native', which
+ selects the best architecture option for the host processor.
+ `-mtune=native' has no effect if GCC does not recognize the
+ processor.
+
+`-mmemory-latency=TIME'
+ Sets the latency the scheduler should assume for typical memory
+ references as seen by the application. This number is highly
+ dependent on the memory access patterns used by the application
+ and the size of the external cache on the machine.
+
+ Valid options for TIME are
+
+ `NUMBER'
+ A decimal number representing clock cycles.
+
+ `L1'
+ `L2'
+ `L3'
+ `main'
+ The compiler contains estimates of the number of clock cycles
+ for "typical" EV4 & EV5 hardware for the Level 1, 2 & 3 caches
+ (also called Dcache, Scache, and Bcache), as well as to main
+ memory. Note that L3 is only valid for EV5.
+
+
+
+File: gcc.info, Node: DEC Alpha/VMS Options, Next: FR30 Options, Prev: DEC Alpha Options, Up: Submodel Options
+
+3.17.9 DEC Alpha/VMS Options
+----------------------------
+
+These `-m' options are defined for the DEC Alpha/VMS implementations:
+
+`-mvms-return-codes'
+ Return VMS condition codes from main. The default is to return
+ POSIX style condition (e.g. error) codes.
+
+
+File: gcc.info, Node: FR30 Options, Next: FRV Options, Prev: DEC Alpha/VMS Options, Up: Submodel Options
+
+3.17.10 FR30 Options
+--------------------
+
+These options are defined specifically for the FR30 port.
+
+`-msmall-model'
+ Use the small address space model. This can produce smaller code,
+ but it does assume that all symbolic values and addresses will fit
+ into a 20-bit range.
+
+`-mno-lsim'
+ Assume that run-time support has been provided and so there is no
+ need to include the simulator library (`libsim.a') on the linker
+ command line.
+
+
+
+File: gcc.info, Node: FRV Options, Next: GNU/Linux Options, Prev: FR30 Options, Up: Submodel Options
+
+3.17.11 FRV Options
+-------------------
+
+`-mgpr-32'
+ Only use the first 32 general purpose registers.
+
+`-mgpr-64'
+ Use all 64 general purpose registers.
+
+`-mfpr-32'
+ Use only the first 32 floating point registers.
+
+`-mfpr-64'
+ Use all 64 floating point registers
+
+`-mhard-float'
+ Use hardware instructions for floating point operations.
+
+`-msoft-float'
+ Use library routines for floating point operations.
+
+`-malloc-cc'
+ Dynamically allocate condition code registers.
+
+`-mfixed-cc'
+ Do not try to dynamically allocate condition code registers, only
+ use `icc0' and `fcc0'.
+
+`-mdword'
+ Change ABI to use double word insns.
+
+`-mno-dword'
+ Do not use double word instructions.
+
+`-mdouble'
+ Use floating point double instructions.
+
+`-mno-double'
+ Do not use floating point double instructions.
+
+`-mmedia'
+ Use media instructions.
+
+`-mno-media'
+ Do not use media instructions.
+
+`-mmuladd'
+ Use multiply and add/subtract instructions.
+
+`-mno-muladd'
+ Do not use multiply and add/subtract instructions.
+
+`-mfdpic'
+ Select the FDPIC ABI, that uses function descriptors to represent
+ pointers to functions. Without any PIC/PIE-related options, it
+ implies `-fPIE'. With `-fpic' or `-fpie', it assumes GOT entries
+ and small data are within a 12-bit range from the GOT base
+ address; with `-fPIC' or `-fPIE', GOT offsets are computed with 32
+ bits. With a `bfin-elf' target, this option implies `-msim'.
+
+`-minline-plt'
+ Enable inlining of PLT entries in function calls to functions that
+ are not known to bind locally. It has no effect without `-mfdpic'.
+ It's enabled by default if optimizing for speed and compiling for
+ shared libraries (i.e., `-fPIC' or `-fpic'), or when an
+ optimization option such as `-O3' or above is present in the
+ command line.
+
+`-mTLS'
+ Assume a large TLS segment when generating thread-local code.
+
+`-mtls'
+ Do not assume a large TLS segment when generating thread-local
+ code.
+
+`-mgprel-ro'
+ Enable the use of `GPREL' relocations in the FDPIC ABI for data
+ that is known to be in read-only sections. It's enabled by
+ default, except for `-fpic' or `-fpie': even though it may help
+ make the global offset table smaller, it trades 1 instruction for
+ 4. With `-fPIC' or `-fPIE', it trades 3 instructions for 4, one
+ of which may be shared by multiple symbols, and it avoids the need
+ for a GOT entry for the referenced symbol, so it's more likely to
+ be a win. If it is not, `-mno-gprel-ro' can be used to disable it.
+
+`-multilib-library-pic'
+ Link with the (library, not FD) pic libraries. It's implied by
+ `-mlibrary-pic', as well as by `-fPIC' and `-fpic' without
+ `-mfdpic'. You should never have to use it explicitly.
+
+`-mlinked-fp'
+ Follow the EABI requirement of always creating a frame pointer
+ whenever a stack frame is allocated. This option is enabled by
+ default and can be disabled with `-mno-linked-fp'.
+
+`-mlong-calls'
+ Use indirect addressing to call functions outside the current
+ compilation unit. This allows the functions to be placed anywhere
+ within the 32-bit address space.
+
+`-malign-labels'
+ Try to align labels to an 8-byte boundary by inserting nops into
+ the previous packet. This option only has an effect when VLIW
+ packing is enabled. It doesn't create new packets; it merely adds
+ nops to existing ones.
+
+`-mlibrary-pic'
+ Generate position-independent EABI code.
+
+`-macc-4'
+ Use only the first four media accumulator registers.
+
+`-macc-8'
+ Use all eight media accumulator registers.
+
+`-mpack'
+ Pack VLIW instructions.
+
+`-mno-pack'
+ Do not pack VLIW instructions.
+
+`-mno-eflags'
+ Do not mark ABI switches in e_flags.
+
+`-mcond-move'
+ Enable the use of conditional-move instructions (default).
+
+ This switch is mainly for debugging the compiler and will likely
+ be removed in a future version.
+
+`-mno-cond-move'
+ Disable the use of conditional-move instructions.
+
+ This switch is mainly for debugging the compiler and will likely
+ be removed in a future version.
+
+`-mscc'
+ Enable the use of conditional set instructions (default).
+
+ This switch is mainly for debugging the compiler and will likely
+ be removed in a future version.
+
+`-mno-scc'
+ Disable the use of conditional set instructions.
+
+ This switch is mainly for debugging the compiler and will likely
+ be removed in a future version.
+
+`-mcond-exec'
+ Enable the use of conditional execution (default).
+
+ This switch is mainly for debugging the compiler and will likely
+ be removed in a future version.
+
+`-mno-cond-exec'
+ Disable the use of conditional execution.
+
+ This switch is mainly for debugging the compiler and will likely
+ be removed in a future version.
+
+`-mvliw-branch'
+ Run a pass to pack branches into VLIW instructions (default).
+
+ This switch is mainly for debugging the compiler and will likely
+ be removed in a future version.
+
+`-mno-vliw-branch'
+ Do not run a pass to pack branches into VLIW instructions.
+
+ This switch is mainly for debugging the compiler and will likely
+ be removed in a future version.
+
+`-mmulti-cond-exec'
+ Enable optimization of `&&' and `||' in conditional execution
+ (default).
+
+ This switch is mainly for debugging the compiler and will likely
+ be removed in a future version.
+
+`-mno-multi-cond-exec'
+ Disable optimization of `&&' and `||' in conditional execution.
+
+ This switch is mainly for debugging the compiler and will likely
+ be removed in a future version.
+
+`-mnested-cond-exec'
+ Enable nested conditional execution optimizations (default).
+
+ This switch is mainly for debugging the compiler and will likely
+ be removed in a future version.
+
+`-mno-nested-cond-exec'
+ Disable nested conditional execution optimizations.
+
+ This switch is mainly for debugging the compiler and will likely
+ be removed in a future version.
+
+`-moptimize-membar'
+ This switch removes redundant `membar' instructions from the
+ compiler generated code. It is enabled by default.
+
+`-mno-optimize-membar'
+ This switch disables the automatic removal of redundant `membar'
+ instructions from the generated code.
+
+`-mtomcat-stats'
+ Cause gas to print out tomcat statistics.
+
+`-mcpu=CPU'
+ Select the processor type for which to generate code. Possible
+ values are `frv', `fr550', `tomcat', `fr500', `fr450', `fr405',
+ `fr400', `fr300' and `simple'.
+
+
+
+File: gcc.info, Node: GNU/Linux Options, Next: H8/300 Options, Prev: FRV Options, Up: Submodel Options
+
+3.17.12 GNU/Linux Options
+-------------------------
+
+These `-m' options are defined for GNU/Linux targets:
+
+`-mglibc'
+ Use the GNU C library instead of uClibc. This is the default
+ except on `*-*-linux-*uclibc*' targets.
+
+`-muclibc'
+ Use uClibc instead of the GNU C library. This is the default on
+ `*-*-linux-*uclibc*' targets.
+
+
+File: gcc.info, Node: H8/300 Options, Next: HPPA Options, Prev: GNU/Linux Options, Up: Submodel Options
+
+3.17.13 H8/300 Options
+----------------------
+
+These `-m' options are defined for the H8/300 implementations:
+
+`-mrelax'
+ Shorten some address references at link time, when possible; uses
+ the linker option `-relax'. *Note `ld' and the H8/300:
+ (ld)H8/300, for a fuller description.
+
+`-mh'
+ Generate code for the H8/300H.
+
+`-ms'
+ Generate code for the H8S.
+
+`-mn'
+ Generate code for the H8S and H8/300H in the normal mode. This
+ switch must be used either with `-mh' or `-ms'.
+
+`-ms2600'
+ Generate code for the H8S/2600. This switch must be used with
+ `-ms'.
+
+`-mint32'
+ Make `int' data 32 bits by default.
+
+`-malign-300'
+ On the H8/300H and H8S, use the same alignment rules as for the
+ H8/300. The default for the H8/300H and H8S is to align longs and
+ floats on 4 byte boundaries. `-malign-300' causes them to be
+ aligned on 2 byte boundaries. This option has no effect on the
+ H8/300.
+
+
+File: gcc.info, Node: HPPA Options, Next: i386 and x86-64 Options, Prev: H8/300 Options, Up: Submodel Options
+
+3.17.14 HPPA Options
+--------------------
+
+These `-m' options are defined for the HPPA family of computers:
+
+`-march=ARCHITECTURE-TYPE'
+ Generate code for the specified architecture. The choices for
+ ARCHITECTURE-TYPE are `1.0' for PA 1.0, `1.1' for PA 1.1, and
+ `2.0' for PA 2.0 processors. Refer to `/usr/lib/sched.models' on
+ an HP-UX system to determine the proper architecture option for
+ your machine. Code compiled for lower numbered architectures will
+ run on higher numbered architectures, but not the other way around.
+
+`-mpa-risc-1-0'
+`-mpa-risc-1-1'
+`-mpa-risc-2-0'
+ Synonyms for `-march=1.0', `-march=1.1', and `-march=2.0'
+ respectively.
+
+`-mbig-switch'
+ Generate code suitable for big switch tables. Use this option
+ only if the assembler/linker complain about out of range branches
+ within a switch table.
+
+`-mjump-in-delay'
+ Fill delay slots of function calls with unconditional jump
+ instructions by modifying the return pointer for the function call
+ to be the target of the conditional jump.
+
+`-mdisable-fpregs'
+ Prevent floating point registers from being used in any manner.
+ This is necessary for compiling kernels which perform lazy context
+ switching of floating point registers. If you use this option and
+ attempt to perform floating point operations, the compiler will
+ abort.
+
+`-mdisable-indexing'
+ Prevent the compiler from using indexing address modes. This
+ avoids some rather obscure problems when compiling MIG generated
+ code under MACH.
+
+`-mno-space-regs'
+ Generate code that assumes the target has no space registers.
+ This allows GCC to generate faster indirect calls and use unscaled
+ index address modes.
+
+ Such code is suitable for level 0 PA systems and kernels.
+
+`-mfast-indirect-calls'
+ Generate code that assumes calls never cross space boundaries.
+ This allows GCC to emit code which performs faster indirect calls.
+
+ This option will not work in the presence of shared libraries or
+ nested functions.
+
+`-mfixed-range=REGISTER-RANGE'
+ Generate code treating the given register range as fixed registers.
+ A fixed register is one that the register allocator can not use.
+ This is useful when compiling kernel code. A register range is
+ specified as two registers separated by a dash. Multiple register
+ ranges can be specified separated by a comma.
+
+`-mlong-load-store'
+ Generate 3-instruction load and store sequences as sometimes
+ required by the HP-UX 10 linker. This is equivalent to the `+k'
+ option to the HP compilers.
+
+`-mportable-runtime'
+ Use the portable calling conventions proposed by HP for ELF
+ systems.
+
+`-mgas'
+ Enable the use of assembler directives only GAS understands.
+
+`-mschedule=CPU-TYPE'
+ Schedule code according to the constraints for the machine type
+ CPU-TYPE. The choices for CPU-TYPE are `700' `7100', `7100LC',
+ `7200', `7300' and `8000'. Refer to `/usr/lib/sched.models' on an
+ HP-UX system to determine the proper scheduling option for your
+ machine. The default scheduling is `8000'.
+
+`-mlinker-opt'
+ Enable the optimization pass in the HP-UX linker. Note this makes
+ symbolic debugging impossible. It also triggers a bug in the
+ HP-UX 8 and HP-UX 9 linkers in which they give bogus error
+ messages when linking some programs.
+
+`-msoft-float'
+ Generate output containing library calls for floating point.
+ *Warning:* the requisite libraries are not available for all HPPA
+ targets. Normally the facilities of the machine's usual C
+ compiler are used, but this cannot be done directly in
+ cross-compilation. You must make your own arrangements to provide
+ suitable library functions for cross-compilation.
+
+ `-msoft-float' changes the calling convention in the output file;
+ therefore, it is only useful if you compile _all_ of a program with
+ this option. In particular, you need to compile `libgcc.a', the
+ library that comes with GCC, with `-msoft-float' in order for this
+ to work.
+
+`-msio'
+ Generate the predefine, `_SIO', for server IO. The default is
+ `-mwsio'. This generates the predefines, `__hp9000s700',
+ `__hp9000s700__' and `_WSIO', for workstation IO. These options
+ are available under HP-UX and HI-UX.
+
+`-mgnu-ld'
+ Use GNU ld specific options. This passes `-shared' to ld when
+ building a shared library. It is the default when GCC is
+ configured, explicitly or implicitly, with the GNU linker. This
+ option does not have any affect on which ld is called, it only
+ changes what parameters are passed to that ld. The ld that is
+ called is determined by the `--with-ld' configure option, GCC's
+ program search path, and finally by the user's `PATH'. The linker
+ used by GCC can be printed using `which `gcc
+ -print-prog-name=ld`'. This option is only available on the 64
+ bit HP-UX GCC, i.e. configured with `hppa*64*-*-hpux*'.
+
+`-mhp-ld'
+ Use HP ld specific options. This passes `-b' to ld when building
+ a shared library and passes `+Accept TypeMismatch' to ld on all
+ links. It is the default when GCC is configured, explicitly or
+ implicitly, with the HP linker. This option does not have any
+ affect on which ld is called, it only changes what parameters are
+ passed to that ld. The ld that is called is determined by the
+ `--with-ld' configure option, GCC's program search path, and
+ finally by the user's `PATH'. The linker used by GCC can be
+ printed using `which `gcc -print-prog-name=ld`'. This option is
+ only available on the 64 bit HP-UX GCC, i.e. configured with
+ `hppa*64*-*-hpux*'.
+
+`-mlong-calls'
+ Generate code that uses long call sequences. This ensures that a
+ call is always able to reach linker generated stubs. The default
+ is to generate long calls only when the distance from the call
+ site to the beginning of the function or translation unit, as the
+ case may be, exceeds a predefined limit set by the branch type
+ being used. The limits for normal calls are 7,600,000 and 240,000
+ bytes, respectively for the PA 2.0 and PA 1.X architectures.
+ Sibcalls are always limited at 240,000 bytes.
+
+ Distances are measured from the beginning of functions when using
+ the `-ffunction-sections' option, or when using the `-mgas' and
+ `-mno-portable-runtime' options together under HP-UX with the SOM
+ linker.
+
+ It is normally not desirable to use this option as it will degrade
+ performance. However, it may be useful in large applications,
+ particularly when partial linking is used to build the application.
+
+ The types of long calls used depends on the capabilities of the
+ assembler and linker, and the type of code being generated. The
+ impact on systems that support long absolute calls, and long pic
+ symbol-difference or pc-relative calls should be relatively small.
+ However, an indirect call is used on 32-bit ELF systems in pic code
+ and it is quite long.
+
+`-munix=UNIX-STD'
+ Generate compiler predefines and select a startfile for the
+ specified UNIX standard. The choices for UNIX-STD are `93', `95'
+ and `98'. `93' is supported on all HP-UX versions. `95' is
+ available on HP-UX 10.10 and later. `98' is available on HP-UX
+ 11.11 and later. The default values are `93' for HP-UX 10.00,
+ `95' for HP-UX 10.10 though to 11.00, and `98' for HP-UX 11.11 and
+ later.
+
+ `-munix=93' provides the same predefines as GCC 3.3 and 3.4.
+ `-munix=95' provides additional predefines for `XOPEN_UNIX' and
+ `_XOPEN_SOURCE_EXTENDED', and the startfile `unix95.o'.
+ `-munix=98' provides additional predefines for `_XOPEN_UNIX',
+ `_XOPEN_SOURCE_EXTENDED', `_INCLUDE__STDC_A1_SOURCE' and
+ `_INCLUDE_XOPEN_SOURCE_500', and the startfile `unix98.o'.
+
+ It is _important_ to note that this option changes the interfaces
+ for various library routines. It also affects the operational
+ behavior of the C library. Thus, _extreme_ care is needed in
+ using this option.
+
+ Library code that is intended to operate with more than one UNIX
+ standard must test, set and restore the variable
+ __XPG4_EXTENDED_MASK as appropriate. Most GNU software doesn't
+ provide this capability.
+
+`-nolibdld'
+ Suppress the generation of link options to search libdld.sl when
+ the `-static' option is specified on HP-UX 10 and later.
+
+`-static'
+ The HP-UX implementation of setlocale in libc has a dependency on
+ libdld.sl. There isn't an archive version of libdld.sl. Thus,
+ when the `-static' option is specified, special link options are
+ needed to resolve this dependency.
+
+ On HP-UX 10 and later, the GCC driver adds the necessary options to
+ link with libdld.sl when the `-static' option is specified. This
+ causes the resulting binary to be dynamic. On the 64-bit port,
+ the linkers generate dynamic binaries by default in any case. The
+ `-nolibdld' option can be used to prevent the GCC driver from
+ adding these link options.
+
+`-threads'
+ Add support for multithreading with the "dce thread" library under
+ HP-UX. This option sets flags for both the preprocessor and
+ linker.
+
+
+File: gcc.info, Node: i386 and x86-64 Options, Next: i386 and x86-64 Windows Options, Prev: HPPA Options, Up: Submodel Options
+
+3.17.15 Intel 386 and AMD x86-64 Options
+----------------------------------------
+
+These `-m' options are defined for the i386 and x86-64 family of
+computers:
+
+`-mtune=CPU-TYPE'
+ Tune to CPU-TYPE everything applicable about the generated code,
+ except for the ABI and the set of available instructions. The
+ choices for CPU-TYPE are:
+ _generic_
+ Produce code optimized for the most common IA32/AMD64/EM64T
+ processors. If you know the CPU on which your code will run,
+ then you should use the corresponding `-mtune' option instead
+ of `-mtune=generic'. But, if you do not know exactly what
+ CPU users of your application will have, then you should use
+ this option.
+
+ As new processors are deployed in the marketplace, the
+ behavior of this option will change. Therefore, if you
+ upgrade to a newer version of GCC, the code generated option
+ will change to reflect the processors that were most common
+ when that version of GCC was released.
+
+ There is no `-march=generic' option because `-march'
+ indicates the instruction set the compiler can use, and there
+ is no generic instruction set applicable to all processors.
+ In contrast, `-mtune' indicates the processor (or, in this
+ case, collection of processors) for which the code is
+ optimized.
+
+ _native_
+ This selects the CPU to tune for at compilation time by
+ determining the processor type of the compiling machine.
+ Using `-mtune=native' will produce code optimized for the
+ local machine under the constraints of the selected
+ instruction set. Using `-march=native' will enable all
+ instruction subsets supported by the local machine (hence the
+ result might not run on different machines).
+
+ _i386_
+ Original Intel's i386 CPU.
+
+ _i486_
+ Intel's i486 CPU. (No scheduling is implemented for this
+ chip.)
+
+ _i586, pentium_
+ Intel Pentium CPU with no MMX support.
+
+ _pentium-mmx_
+ Intel PentiumMMX CPU based on Pentium core with MMX
+ instruction set support.
+
+ _pentiumpro_
+ Intel PentiumPro CPU.
+
+ _i686_
+ Same as `generic', but when used as `march' option, PentiumPro
+ instruction set will be used, so the code will run on all
+ i686 family chips.
+
+ _pentium2_
+ Intel Pentium2 CPU based on PentiumPro core with MMX
+ instruction set support.
+
+ _pentium3, pentium3m_
+ Intel Pentium3 CPU based on PentiumPro core with MMX and SSE
+ instruction set support.
+
+ _pentium-m_
+ Low power version of Intel Pentium3 CPU with MMX, SSE and
+ SSE2 instruction set support. Used by Centrino notebooks.
+
+ _pentium4, pentium4m_
+ Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set
+ support.
+
+ _prescott_
+ Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2
+ and SSE3 instruction set support.
+
+ _nocona_
+ Improved version of Intel Pentium4 CPU with 64-bit
+ extensions, MMX, SSE, SSE2 and SSE3 instruction set support.
+
+ _core2_
+ Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3
+ and SSSE3 instruction set support.
+
+ _k6_
+ AMD K6 CPU with MMX instruction set support.
+
+ _k6-2, k6-3_
+ Improved versions of AMD K6 CPU with MMX and 3dNOW!
+ instruction set support.
+
+ _athlon, athlon-tbird_
+ AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE
+ prefetch instructions support.
+
+ _athlon-4, athlon-xp, athlon-mp_
+ Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and
+ full SSE instruction set support.
+
+ _k8, opteron, athlon64, athlon-fx_
+ AMD K8 core based CPUs with x86-64 instruction set support.
+ (This supersets MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and
+ 64-bit instruction set extensions.)
+
+ _k8-sse3, opteron-sse3, athlon64-sse3_
+ Improved versions of k8, opteron and athlon64 with SSE3
+ instruction set support.
+
+ _amdfam10, barcelona_
+ AMD Family 10h core based CPUs with x86-64 instruction set
+ support. (This supersets MMX, SSE, SSE2, SSE3, SSE4A,
+ 3dNOW!, enhanced 3dNOW!, ABM and 64-bit instruction set
+ extensions.)
+
+ _winchip-c6_
+ IDT Winchip C6 CPU, dealt in same way as i486 with additional
+ MMX instruction set support.
+
+ _winchip2_
+ IDT Winchip2 CPU, dealt in same way as i486 with additional
+ MMX and 3dNOW! instruction set support.
+
+ _c3_
+ Via C3 CPU with MMX and 3dNOW! instruction set support. (No
+ scheduling is implemented for this chip.)
+
+ _c3-2_
+ Via C3-2 CPU with MMX and SSE instruction set support. (No
+ scheduling is implemented for this chip.)
+
+ _geode_
+ Embedded AMD CPU with MMX and 3dNOW! instruction set support.
+
+ While picking a specific CPU-TYPE will schedule things
+ appropriately for that particular chip, the compiler will not
+ generate any code that does not run on the i386 without the
+ `-march=CPU-TYPE' option being used.
+
+`-march=CPU-TYPE'
+ Generate instructions for the machine type CPU-TYPE. The choices
+ for CPU-TYPE are the same as for `-mtune'. Moreover, specifying
+ `-march=CPU-TYPE' implies `-mtune=CPU-TYPE'.
+
+`-mcpu=CPU-TYPE'
+ A deprecated synonym for `-mtune'.
+
+`-mfpmath=UNIT'
+ Generate floating point arithmetics for selected unit UNIT. The
+ choices for UNIT are:
+
+ `387'
+ Use the standard 387 floating point coprocessor present
+ majority of chips and emulated otherwise. Code compiled with
+ this option will run almost everywhere. The temporary
+ results are computed in 80bit precision instead of precision
+ specified by the type resulting in slightly different results
+ compared to most of other chips. See `-ffloat-store' for
+ more detailed description.
+
+ This is the default choice for i386 compiler.
+
+ `sse'
+ Use scalar floating point instructions present in the SSE
+ instruction set. This instruction set is supported by
+ Pentium3 and newer chips, in the AMD line by Athlon-4,
+ Athlon-xp and Athlon-mp chips. The earlier version of SSE
+ instruction set supports only single precision arithmetics,
+ thus the double and extended precision arithmetics is still
+ done using 387. Later version, present only in Pentium4 and
+ the future AMD x86-64 chips supports double precision
+ arithmetics too.
+
+ For the i386 compiler, you need to use `-march=CPU-TYPE',
+ `-msse' or `-msse2' switches to enable SSE extensions and
+ make this option effective. For the x86-64 compiler, these
+ extensions are enabled by default.
+
+ The resulting code should be considerably faster in the
+ majority of cases and avoid the numerical instability
+ problems of 387 code, but may break some existing code that
+ expects temporaries to be 80bit.
+
+ This is the default choice for the x86-64 compiler.
+
+ `sse,387'
+ `sse+387'
+ `both'
+ Attempt to utilize both instruction sets at once. This
+ effectively double the amount of available registers and on
+ chips with separate execution units for 387 and SSE the
+ execution resources too. Use this option with care, as it is
+ still experimental, because the GCC register allocator does
+ not model separate functional units well resulting in
+ instable performance.
+
+`-masm=DIALECT'
+ Output asm instructions using selected DIALECT. Supported choices
+ are `intel' or `att' (the default one). Darwin does not support
+ `intel'.
+
+`-mieee-fp'
+`-mno-ieee-fp'
+ Control whether or not the compiler uses IEEE floating point
+ comparisons. These handle correctly the case where the result of a
+ comparison is unordered.
+
+`-msoft-float'
+ Generate output containing library calls for floating point.
+ *Warning:* the requisite libraries are not part of GCC. Normally
+ the facilities of the machine's usual C compiler are used, but
+ this can't be done directly in cross-compilation. You must make
+ your own arrangements to provide suitable library functions for
+ cross-compilation.
+
+ On machines where a function returns floating point results in the
+ 80387 register stack, some floating point opcodes may be emitted
+ even if `-msoft-float' is used.
+
+`-mno-fp-ret-in-387'
+ Do not use the FPU registers for return values of functions.
+
+ The usual calling convention has functions return values of types
+ `float' and `double' in an FPU register, even if there is no FPU.
+ The idea is that the operating system should emulate an FPU.
+
+ The option `-mno-fp-ret-in-387' causes such values to be returned
+ in ordinary CPU registers instead.
+
+`-mno-fancy-math-387'
+ Some 387 emulators do not support the `sin', `cos' and `sqrt'
+ instructions for the 387. Specify this option to avoid generating
+ those instructions. This option is the default on FreeBSD,
+ OpenBSD and NetBSD. This option is overridden when `-march'
+ indicates that the target cpu will always have an FPU and so the
+ instruction will not need emulation. As of revision 2.6.1, these
+ instructions are not generated unless you also use the
+ `-funsafe-math-optimizations' switch.
+
+`-malign-double'
+`-mno-align-double'
+ Control whether GCC aligns `double', `long double', and `long
+ long' variables on a two word boundary or a one word boundary.
+ Aligning `double' variables on a two word boundary will produce
+ code that runs somewhat faster on a `Pentium' at the expense of
+ more memory.
+
+ On x86-64, `-malign-double' is enabled by default.
+
+ *Warning:* if you use the `-malign-double' switch, structures
+ containing the above types will be aligned differently than the
+ published application binary interface specifications for the 386
+ and will not be binary compatible with structures in code compiled
+ without that switch.
+
+`-m96bit-long-double'
+`-m128bit-long-double'
+ These switches control the size of `long double' type. The i386
+ application binary interface specifies the size to be 96 bits, so
+ `-m96bit-long-double' is the default in 32 bit mode.
+
+ Modern architectures (Pentium and newer) would prefer `long double'
+ to be aligned to an 8 or 16 byte boundary. In arrays or structures
+ conforming to the ABI, this would not be possible. So specifying a
+ `-m128bit-long-double' will align `long double' to a 16 byte
+ boundary by padding the `long double' with an additional 32 bit
+ zero.
+
+ In the x86-64 compiler, `-m128bit-long-double' is the default
+ choice as its ABI specifies that `long double' is to be aligned on
+ 16 byte boundary.
+
+ Notice that neither of these options enable any extra precision
+ over the x87 standard of 80 bits for a `long double'.
+
+ *Warning:* if you override the default value for your target ABI,
+ the structures and arrays containing `long double' variables will
+ change their size as well as function calling convention for
+ function taking `long double' will be modified. Hence they will
+ not be binary compatible with arrays or structures in code
+ compiled without that switch.
+
+`-mlarge-data-threshold=NUMBER'
+ When `-mcmodel=medium' is specified, the data greater than
+ THRESHOLD are placed in large data section. This value must be the
+ same across all object linked into the binary and defaults to
+ 65535.
+
+`-mrtd'
+ Use a different function-calling convention, in which functions
+ that take a fixed number of arguments return with the `ret' NUM
+ instruction, which pops their arguments while returning. This
+ saves one instruction in the caller since there is no need to pop
+ the arguments there.
+
+ You can specify that an individual function is called with this
+ calling sequence with the function attribute `stdcall'. You can
+ also override the `-mrtd' option by using the function attribute
+ `cdecl'. *Note Function Attributes::.
+
+ *Warning:* this calling convention is incompatible with the one
+ normally used on Unix, so you cannot use it if you need to call
+ libraries compiled with the Unix compiler.
+
+ Also, you must provide function prototypes for all functions that
+ take variable numbers of arguments (including `printf'); otherwise
+ incorrect code will be generated for calls to those functions.
+
+ In addition, seriously incorrect code will result if you call a
+ function with too many arguments. (Normally, extra arguments are
+ harmlessly ignored.)
+
+`-mregparm=NUM'
+ Control how many registers are used to pass integer arguments. By
+ default, no registers are used to pass arguments, and at most 3
+ registers can be used. You can control this behavior for a
+ specific function by using the function attribute `regparm'.
+ *Note Function Attributes::.
+
+ *Warning:* if you use this switch, and NUM is nonzero, then you
+ must build all modules with the same value, including any
+ libraries. This includes the system libraries and startup modules.
+
+`-msseregparm'
+ Use SSE register passing conventions for float and double arguments
+ and return values. You can control this behavior for a specific
+ function by using the function attribute `sseregparm'. *Note
+ Function Attributes::.
+
+ *Warning:* if you use this switch then you must build all modules
+ with the same value, including any libraries. This includes the
+ system libraries and startup modules.
+
+`-mpc32'
+`-mpc64'
+`-mpc80'
+ Set 80387 floating-point precision to 32, 64 or 80 bits. When
+ `-mpc32' is specified, the significands of results of
+ floating-point operations are rounded to 24 bits (single
+ precision); `-mpc64' rounds the significands of results of
+ floating-point operations to 53 bits (double precision) and
+ `-mpc80' rounds the significands of results of floating-point
+ operations to 64 bits (extended double precision), which is the
+ default. When this option is used, floating-point operations in
+ higher precisions are not available to the programmer without
+ setting the FPU control word explicitly.
+
+ Setting the rounding of floating-point operations to less than the
+ default 80 bits can speed some programs by 2% or more. Note that
+ some mathematical libraries assume that extended precision (80
+ bit) floating-point operations are enabled by default; routines in
+ such libraries could suffer significant loss of accuracy,
+ typically through so-called "catastrophic cancellation", when this
+ option is used to set the precision to less than extended
+ precision.
+
+`-mstackrealign'
+ Realign the stack at entry. On the Intel x86, the `-mstackrealign'
+ option will generate an alternate prologue and epilogue that
+ realigns the runtime stack if necessary. This supports mixing
+ legacy codes that keep a 4-byte aligned stack with modern codes
+ that keep a 16-byte stack for SSE compatibility. See also the
+ attribute `force_align_arg_pointer', applicable to individual
+ functions.
+
+`-mpreferred-stack-boundary=NUM'
+ Attempt to keep the stack boundary aligned to a 2 raised to NUM
+ byte boundary. If `-mpreferred-stack-boundary' is not specified,
+ the default is 4 (16 bytes or 128 bits).
+
+`-mincoming-stack-boundary=NUM'
+ Assume the incoming stack is aligned to a 2 raised to NUM byte
+ boundary. If `-mincoming-stack-boundary' is not specified, the
+ one specified by `-mpreferred-stack-boundary' will be used.
+
+ On Pentium and PentiumPro, `double' and `long double' values
+ should be aligned to an 8 byte boundary (see `-malign-double') or
+ suffer significant run time performance penalties. On Pentium
+ III, the Streaming SIMD Extension (SSE) data type `__m128' may not
+ work properly if it is not 16 byte aligned.
+
+ To ensure proper alignment of this values on the stack, the stack
+ boundary must be as aligned as that required by any value stored
+ on the stack. Further, every function must be generated such that
+ it keeps the stack aligned. Thus calling a function compiled with
+ a higher preferred stack boundary from a function compiled with a
+ lower preferred stack boundary will most likely misalign the
+ stack. It is recommended that libraries that use callbacks always
+ use the default setting.
+
+ This extra alignment does consume extra stack space, and generally
+ increases code size. Code that is sensitive to stack space usage,
+ such as embedded systems and operating system kernels, may want to
+ reduce the preferred alignment to `-mpreferred-stack-boundary=2'.
+
+`-mmmx'
+`-mno-mmx'
+`-msse'
+`-mno-sse'
+`-msse2'
+`-mno-sse2'
+`-msse3'
+`-mno-sse3'
+`-mssse3'
+`-mno-ssse3'
+`-msse4.1'
+`-mno-sse4.1'
+`-msse4.2'
+`-mno-sse4.2'
+`-msse4'
+`-mno-sse4'
+`-mavx'
+`-mno-avx'
+`-maes'
+`-mno-aes'
+`-mpclmul'
+`-mno-pclmul'
+`-msse4a'
+`-mno-sse4a'
+`-msse5'
+`-mno-sse5'
+`-m3dnow'
+`-mno-3dnow'
+`-mpopcnt'
+`-mno-popcnt'
+`-mabm'
+`-mno-abm'
+ These switches enable or disable the use of instructions in the
+ MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, SSE4A,
+ SSE5, ABM or 3DNow! extended instruction sets. These extensions
+ are also available as built-in functions: see *Note X86 Built-in
+ Functions::, for details of the functions enabled and disabled by
+ these switches.
+
+ To have SSE/SSE2 instructions generated automatically from
+ floating-point code (as opposed to 387 instructions), see
+ `-mfpmath=sse'.
+
+ GCC depresses SSEx instructions when `-mavx' is used. Instead, it
+ generates new AVX instructions or AVX equivalence for all SSEx
+ instructions when needed.
+
+ These options will enable GCC to use these extended instructions in
+ generated code, even without `-mfpmath=sse'. Applications which
+ perform runtime CPU detection must compile separate files for each
+ supported architecture, using the appropriate flags. In
+ particular, the file containing the CPU detection code should be
+ compiled without these options.
+
+`-mcld'
+ This option instructs GCC to emit a `cld' instruction in the
+ prologue of functions that use string instructions. String
+ instructions depend on the DF flag to select between autoincrement
+ or autodecrement mode. While the ABI specifies the DF flag to be
+ cleared on function entry, some operating systems violate this
+ specification by not clearing the DF flag in their exception
+ dispatchers. The exception handler can be invoked with the DF flag
+ set which leads to wrong direction mode, when string instructions
+ are used. This option can be enabled by default on 32-bit x86
+ targets by configuring GCC with the `--enable-cld' configure
+ option. Generation of `cld' instructions can be suppressed with
+ the `-mno-cld' compiler option in this case.
+
+`-mcx16'
+ This option will enable GCC to use CMPXCHG16B instruction in
+ generated code. CMPXCHG16B allows for atomic operations on
+ 128-bit double quadword (or oword) data types. This is useful for
+ high resolution counters that could be updated by multiple
+ processors (or cores). This instruction is generated as part of
+ atomic built-in functions: see *Note Atomic Builtins:: for details.
+
+`-msahf'
+ This option will enable GCC to use SAHF instruction in generated
+ 64-bit code. Early Intel CPUs with Intel 64 lacked LAHF and SAHF
+ instructions supported by AMD64 until introduction of Pentium 4 G1
+ step in December 2005. LAHF and SAHF are load and store
+ instructions, respectively, for certain status flags. In 64-bit
+ mode, SAHF instruction is used to optimize `fmod', `drem' or
+ `remainder' built-in functions: see *Note Other Builtins:: for
+ details.
+
+`-mrecip'
+ This option will enable GCC to use RCPSS and RSQRTSS instructions
+ (and their vectorized variants RCPPS and RSQRTPS) with an
+ additional Newton-Raphson step to increase precision instead of
+ DIVSS and SQRTSS (and their vectorized variants) for single
+ precision floating point arguments. These instructions are
+ generated only when `-funsafe-math-optimizations' is enabled
+ together with `-finite-math-only' and `-fno-trapping-math'. Note
+ that while the throughput of the sequence is higher than the
+ throughput of the non-reciprocal instruction, the precision of the
+ sequence can be decreased by up to 2 ulp (i.e. the inverse of 1.0
+ equals 0.99999994).
+
+`-mveclibabi=TYPE'
+ Specifies the ABI type to use for vectorizing intrinsics using an
+ external library. Supported types are `svml' for the Intel short
+ vector math library and `acml' for the AMD math core library style
+ of interfacing. GCC will currently emit calls to `vmldExp2',
+ `vmldLn2', `vmldLog102', `vmldLog102', `vmldPow2', `vmldTanh2',
+ `vmldTan2', `vmldAtan2', `vmldAtanh2', `vmldCbrt2', `vmldSinh2',
+ `vmldSin2', `vmldAsinh2', `vmldAsin2', `vmldCosh2', `vmldCos2',
+ `vmldAcosh2', `vmldAcos2', `vmlsExp4', `vmlsLn4', `vmlsLog104',
+ `vmlsLog104', `vmlsPow4', `vmlsTanh4', `vmlsTan4', `vmlsAtan4',
+ `vmlsAtanh4', `vmlsCbrt4', `vmlsSinh4', `vmlsSin4', `vmlsAsinh4',
+ `vmlsAsin4', `vmlsCosh4', `vmlsCos4', `vmlsAcosh4' and `vmlsAcos4'
+ for corresponding function type when `-mveclibabi=svml' is used
+ and `__vrd2_sin', `__vrd2_cos', `__vrd2_exp', `__vrd2_log',
+ `__vrd2_log2', `__vrd2_log10', `__vrs4_sinf', `__vrs4_cosf',
+ `__vrs4_expf', `__vrs4_logf', `__vrs4_log2f', `__vrs4_log10f' and
+ `__vrs4_powf' for corresponding function type when
+ `-mveclibabi=acml' is used. Both `-ftree-vectorize' and
+ `-funsafe-math-optimizations' have to be enabled. A SVML or ACML
+ ABI compatible library will have to be specified at link time.
+
+`-mpush-args'
+`-mno-push-args'
+ Use PUSH operations to store outgoing parameters. This method is
+ shorter and usually equally fast as method using SUB/MOV
+ operations and is enabled by default. In some cases disabling it
+ may improve performance because of improved scheduling and reduced
+ dependencies.
+
+`-maccumulate-outgoing-args'
+ If enabled, the maximum amount of space required for outgoing
+ arguments will be computed in the function prologue. This is
+ faster on most modern CPUs because of reduced dependencies,
+ improved scheduling and reduced stack usage when preferred stack
+ boundary is not equal to 2. The drawback is a notable increase in
+ code size. This switch implies `-mno-push-args'.
+
+`-mthreads'
+ Support thread-safe exception handling on `Mingw32'. Code that
+ relies on thread-safe exception handling must compile and link all
+ code with the `-mthreads' option. When compiling, `-mthreads'
+ defines `-D_MT'; when linking, it links in a special thread helper
+ library `-lmingwthrd' which cleans up per thread exception
+ handling data.
+
+`-mno-align-stringops'
+ Do not align destination of inlined string operations. This
+ switch reduces code size and improves performance in case the
+ destination is already aligned, but GCC doesn't know about it.
+
+`-minline-all-stringops'
+ By default GCC inlines string operations only when destination is
+ known to be aligned at least to 4 byte boundary. This enables
+ more inlining, increase code size, but may improve performance of
+ code that depends on fast memcpy, strlen and memset for short
+ lengths.
+
+`-minline-stringops-dynamically'
+ For string operation of unknown size, inline runtime checks so for
+ small blocks inline code is used, while for large blocks library
+ call is used.
+
+`-mstringop-strategy=ALG'
+ Overwrite internal decision heuristic about particular algorithm
+ to inline string operation with. The allowed values are
+ `rep_byte', `rep_4byte', `rep_8byte' for expanding using i386
+ `rep' prefix of specified size, `byte_loop', `loop',
+ `unrolled_loop' for expanding inline loop, `libcall' for always
+ expanding library call.
+
+`-momit-leaf-frame-pointer'
+ Don't keep the frame pointer in a register for leaf functions.
+ This avoids the instructions to save, set up and restore frame
+ pointers and makes an extra register available in leaf functions.
+ The option `-fomit-frame-pointer' removes the frame pointer for
+ all functions which might make debugging harder.
+
+`-mtls-direct-seg-refs'
+`-mno-tls-direct-seg-refs'
+ Controls whether TLS variables may be accessed with offsets from
+ the TLS segment register (`%gs' for 32-bit, `%fs' for 64-bit), or
+ whether the thread base pointer must be added. Whether or not this
+ is legal depends on the operating system, and whether it maps the
+ segment to cover the entire TLS area.
+
+ For systems that use GNU libc, the default is on.
+
+`-mfused-madd'
+`-mno-fused-madd'
+ Enable automatic generation of fused floating point multiply-add
+ instructions if the ISA supports such instructions. The
+ -mfused-madd option is on by default. The fused multiply-add
+ instructions have a different rounding behavior compared to
+ executing a multiply followed by an add.
+
+`-msse2avx'
+`-mno-sse2avx'
+ Specify that the assembler should encode SSE instructions with VEX
+ prefix. The option `-mavx' turns this on by default.
+
+ These `-m' switches are supported in addition to the above on AMD
+x86-64 processors in 64-bit environments.
+
+`-m32'
+`-m64'
+ Generate code for a 32-bit or 64-bit environment. The 32-bit
+ environment sets int, long and pointer to 32 bits and generates
+ code that runs on any i386 system. The 64-bit environment sets
+ int to 32 bits and long and pointer to 64 bits and generates code
+ for AMD's x86-64 architecture. For darwin only the -m64 option
+ turns off the `-fno-pic' and `-mdynamic-no-pic' options.
+
+`-mno-red-zone'
+ Do not use a so called red zone for x86-64 code. The red zone is
+ mandated by the x86-64 ABI, it is a 128-byte area beyond the
+ location of the stack pointer that will not be modified by signal
+ or interrupt handlers and therefore can be used for temporary data
+ without adjusting the stack pointer. The flag `-mno-red-zone'
+ disables this red zone.
+
+`-mcmodel=small'
+ Generate code for the small code model: the program and its
+ symbols must be linked in the lower 2 GB of the address space.
+ Pointers are 64 bits. Programs can be statically or dynamically
+ linked. This is the default code model.
+
+`-mcmodel=kernel'
+ Generate code for the kernel code model. The kernel runs in the
+ negative 2 GB of the address space. This model has to be used for
+ Linux kernel code.
+
+`-mcmodel=medium'
+ Generate code for the medium model: The program is linked in the
+ lower 2 GB of the address space. Small symbols are also placed
+ there. Symbols with sizes larger than `-mlarge-data-threshold'
+ are put into large data or bss sections and can be located above
+ 2GB. Programs can be statically or dynamically linked.
+
+`-mcmodel=large'
+ Generate code for the large model: This model makes no assumptions
+ about addresses and sizes of sections.
+
+
+File: gcc.info, Node: IA-64 Options, Next: M32C Options, Prev: i386 and x86-64 Windows Options, Up: Submodel Options
+
+3.17.16 IA-64 Options
+---------------------
+
+These are the `-m' options defined for the Intel IA-64 architecture.
+
+`-mbig-endian'
+ Generate code for a big endian target. This is the default for
+ HP-UX.
+
+`-mlittle-endian'
+ Generate code for a little endian target. This is the default for
+ AIX5 and GNU/Linux.
+
+`-mgnu-as'
+`-mno-gnu-as'
+ Generate (or don't) code for the GNU assembler. This is the
+ default.
+
+`-mgnu-ld'
+`-mno-gnu-ld'
+ Generate (or don't) code for the GNU linker. This is the default.
+
+`-mno-pic'
+ Generate code that does not use a global pointer register. The
+ result is not position independent code, and violates the IA-64
+ ABI.
+
+`-mvolatile-asm-stop'
+`-mno-volatile-asm-stop'
+ Generate (or don't) a stop bit immediately before and after
+ volatile asm statements.
+
+`-mregister-names'
+`-mno-register-names'
+ Generate (or don't) `in', `loc', and `out' register names for the
+ stacked registers. This may make assembler output more readable.
+
+`-mno-sdata'
+`-msdata'
+ Disable (or enable) optimizations that use the small data section.
+ This may be useful for working around optimizer bugs.
+
+`-mconstant-gp'
+ Generate code that uses a single constant global pointer value.
+ This is useful when compiling kernel code.
+
+`-mauto-pic'
+ Generate code that is self-relocatable. This implies
+ `-mconstant-gp'. This is useful when compiling firmware code.
+
+`-minline-float-divide-min-latency'
+ Generate code for inline divides of floating point values using
+ the minimum latency algorithm.
+
+`-minline-float-divide-max-throughput'
+ Generate code for inline divides of floating point values using
+ the maximum throughput algorithm.
+
+`-minline-int-divide-min-latency'
+ Generate code for inline divides of integer values using the
+ minimum latency algorithm.
+
+`-minline-int-divide-max-throughput'
+ Generate code for inline divides of integer values using the
+ maximum throughput algorithm.
+
+`-minline-sqrt-min-latency'
+ Generate code for inline square roots using the minimum latency
+ algorithm.
+
+`-minline-sqrt-max-throughput'
+ Generate code for inline square roots using the maximum throughput
+ algorithm.
+
+`-mno-dwarf2-asm'
+`-mdwarf2-asm'
+ Don't (or do) generate assembler code for the DWARF2 line number
+ debugging info. This may be useful when not using the GNU
+ assembler.
+
+`-mearly-stop-bits'
+`-mno-early-stop-bits'
+ Allow stop bits to be placed earlier than immediately preceding the
+ instruction that triggered the stop bit. This can improve
+ instruction scheduling, but does not always do so.
+
+`-mfixed-range=REGISTER-RANGE'
+ Generate code treating the given register range as fixed registers.
+ A fixed register is one that the register allocator can not use.
+ This is useful when compiling kernel code. A register range is
+ specified as two registers separated by a dash. Multiple register
+ ranges can be specified separated by a comma.
+
+`-mtls-size=TLS-SIZE'
+ Specify bit size of immediate TLS offsets. Valid values are 14,
+ 22, and 64.
+
+`-mtune=CPU-TYPE'
+ Tune the instruction scheduling for a particular CPU, Valid values
+ are itanium, itanium1, merced, itanium2, and mckinley.
+
+`-mt'
+`-pthread'
+ Add support for multithreading using the POSIX threads library.
+ This option sets flags for both the preprocessor and linker. It
+ does not affect the thread safety of object code produced by the
+ compiler or that of libraries supplied with it. These are HP-UX
+ specific flags.
+
+`-milp32'
+`-mlp64'
+ Generate code for a 32-bit or 64-bit environment. The 32-bit
+ environment sets int, long and pointer to 32 bits. The 64-bit
+ environment sets int to 32 bits and long and pointer to 64 bits.
+ These are HP-UX specific flags.
+
+`-mno-sched-br-data-spec'
+`-msched-br-data-spec'
+ (Dis/En)able data speculative scheduling before reload. This will
+ result in generation of the ld.a instructions and the
+ corresponding check instructions (ld.c / chk.a). The default is
+ 'disable'.
+
+`-msched-ar-data-spec'
+`-mno-sched-ar-data-spec'
+ (En/Dis)able data speculative scheduling after reload. This will
+ result in generation of the ld.a instructions and the
+ corresponding check instructions (ld.c / chk.a). The default is
+ 'enable'.
+
+`-mno-sched-control-spec'
+`-msched-control-spec'
+ (Dis/En)able control speculative scheduling. This feature is
+ available only during region scheduling (i.e. before reload).
+ This will result in generation of the ld.s instructions and the
+ corresponding check instructions chk.s . The default is 'disable'.
+
+`-msched-br-in-data-spec'
+`-mno-sched-br-in-data-spec'
+ (En/Dis)able speculative scheduling of the instructions that are
+ dependent on the data speculative loads before reload. This is
+ effective only with `-msched-br-data-spec' enabled. The default
+ is 'enable'.
+
+`-msched-ar-in-data-spec'
+`-mno-sched-ar-in-data-spec'
+ (En/Dis)able speculative scheduling of the instructions that are
+ dependent on the data speculative loads after reload. This is
+ effective only with `-msched-ar-data-spec' enabled. The default
+ is 'enable'.
+
+`-msched-in-control-spec'
+`-mno-sched-in-control-spec'
+ (En/Dis)able speculative scheduling of the instructions that are
+ dependent on the control speculative loads. This is effective
+ only with `-msched-control-spec' enabled. The default is 'enable'.
+
+`-msched-ldc'
+`-mno-sched-ldc'
+ (En/Dis)able use of simple data speculation checks ld.c . If
+ disabled, only chk.a instructions will be emitted to check data
+ speculative loads. The default is 'enable'.
+
+`-mno-sched-control-ldc'
+`-msched-control-ldc'
+ (Dis/En)able use of ld.c instructions to check control speculative
+ loads. If enabled, in case of control speculative load with no
+ speculatively scheduled dependent instructions this load will be
+ emitted as ld.sa and ld.c will be used to check it. The default
+ is 'disable'.
+
+`-mno-sched-spec-verbose'
+`-msched-spec-verbose'
+ (Dis/En)able printing of the information about speculative motions.
+
+`-mno-sched-prefer-non-data-spec-insns'
+`-msched-prefer-non-data-spec-insns'
+ If enabled, data speculative instructions will be chosen for
+ schedule only if there are no other choices at the moment. This
+ will make the use of the data speculation much more conservative.
+ The default is 'disable'.
+
+`-mno-sched-prefer-non-control-spec-insns'
+`-msched-prefer-non-control-spec-insns'
+ If enabled, control speculative instructions will be chosen for
+ schedule only if there are no other choices at the moment. This
+ will make the use of the control speculation much more
+ conservative. The default is 'disable'.
+
+`-mno-sched-count-spec-in-critical-path'
+`-msched-count-spec-in-critical-path'
+ If enabled, speculative dependencies will be considered during
+ computation of the instructions priorities. This will make the
+ use of the speculation a bit more conservative. The default is
+ 'disable'.
+
+
+
+File: gcc.info, Node: M32C Options, Next: M32R/D Options, Prev: IA-64 Options, Up: Submodel Options
+
+3.17.17 M32C Options
+--------------------
+
+`-mcpu=NAME'
+ Select the CPU for which code is generated. NAME may be one of
+ `r8c' for the R8C/Tiny series, `m16c' for the M16C (up to /60)
+ series, `m32cm' for the M16C/80 series, or `m32c' for the M32C/80
+ series.
+
+`-msim'
+ Specifies that the program will be run on the simulator. This
+ causes an alternate runtime library to be linked in which
+ supports, for example, file I/O. You must not use this option
+ when generating programs that will run on real hardware; you must
+ provide your own runtime library for whatever I/O functions are
+ needed.
+
+`-memregs=NUMBER'
+ Specifies the number of memory-based pseudo-registers GCC will use
+ during code generation. These pseudo-registers will be used like
+ real registers, so there is a tradeoff between GCC's ability to
+ fit the code into available registers, and the performance penalty
+ of using memory instead of registers. Note that all modules in a
+ program must be compiled with the same value for this option.
+ Because of that, you must not use this option with the default
+ runtime libraries gcc builds.
+
+
+
+File: gcc.info, Node: M32R/D Options, Next: M680x0 Options, Prev: M32C Options, Up: Submodel Options
+
+3.17.18 M32R/D Options
+----------------------
+
+These `-m' options are defined for Renesas M32R/D architectures:
+
+`-m32r2'
+ Generate code for the M32R/2.
+
+`-m32rx'
+ Generate code for the M32R/X.
+
+`-m32r'
+ Generate code for the M32R. This is the default.
+
+`-mmodel=small'
+ Assume all objects live in the lower 16MB of memory (so that their
+ addresses can be loaded with the `ld24' instruction), and assume
+ all subroutines are reachable with the `bl' instruction. This is
+ the default.
+
+ The addressability of a particular object can be set with the
+ `model' attribute.
+
+`-mmodel=medium'
+ Assume objects may be anywhere in the 32-bit address space (the
+ compiler will generate `seth/add3' instructions to load their
+ addresses), and assume all subroutines are reachable with the `bl'
+ instruction.
+
+`-mmodel=large'
+ Assume objects may be anywhere in the 32-bit address space (the
+ compiler will generate `seth/add3' instructions to load their
+ addresses), and assume subroutines may not be reachable with the
+ `bl' instruction (the compiler will generate the much slower
+ `seth/add3/jl' instruction sequence).
+
+`-msdata=none'
+ Disable use of the small data area. Variables will be put into
+ one of `.data', `bss', or `.rodata' (unless the `section'
+ attribute has been specified). This is the default.
+
+ The small data area consists of sections `.sdata' and `.sbss'.
+ Objects may be explicitly put in the small data area with the
+ `section' attribute using one of these sections.
+
+`-msdata=sdata'
+ Put small global and static data in the small data area, but do not
+ generate special code to reference them.
+
+`-msdata=use'
+ Put small global and static data in the small data area, and
+ generate special instructions to reference them.
+
+`-G NUM'
+ Put global and static objects less than or equal to NUM bytes into
+ the small data or bss sections instead of the normal data or bss
+ sections. The default value of NUM is 8. The `-msdata' option
+ must be set to one of `sdata' or `use' for this option to have any
+ effect.
+
+ All modules should be compiled with the same `-G NUM' value.
+ Compiling with different values of NUM may or may not work; if it
+ doesn't the linker will give an error message--incorrect code will
+ not be generated.
+
+`-mdebug'
+ Makes the M32R specific code in the compiler display some
+ statistics that might help in debugging programs.
+
+`-malign-loops'
+ Align all loops to a 32-byte boundary.
+
+`-mno-align-loops'
+ Do not enforce a 32-byte alignment for loops. This is the default.
+
+`-missue-rate=NUMBER'
+ Issue NUMBER instructions per cycle. NUMBER can only be 1 or 2.
+
+`-mbranch-cost=NUMBER'
+ NUMBER can only be 1 or 2. If it is 1 then branches will be
+ preferred over conditional code, if it is 2, then the opposite will
+ apply.
+
+`-mflush-trap=NUMBER'
+ Specifies the trap number to use to flush the cache. The default
+ is 12. Valid numbers are between 0 and 15 inclusive.
+
+`-mno-flush-trap'
+ Specifies that the cache cannot be flushed by using a trap.
+
+`-mflush-func=NAME'
+ Specifies the name of the operating system function to call to
+ flush the cache. The default is __flush_cache_, but a function
+ call will only be used if a trap is not available.
+
+`-mno-flush-func'
+ Indicates that there is no OS function for flushing the cache.
+
+
+
+File: gcc.info, Node: M680x0 Options, Next: M68hc1x Options, Prev: M32R/D Options, Up: Submodel Options
+
+3.17.19 M680x0 Options
+----------------------
+
+These are the `-m' options defined for M680x0 and ColdFire processors.
+The default settings depend on which architecture was selected when the
+compiler was configured; the defaults for the most common choices are
+given below.
+
+`-march=ARCH'
+ Generate code for a specific M680x0 or ColdFire instruction set
+ architecture. Permissible values of ARCH for M680x0 architectures
+ are: `68000', `68010', `68020', `68030', `68040', `68060' and
+ `cpu32'. ColdFire architectures are selected according to
+ Freescale's ISA classification and the permissible values are:
+ `isaa', `isaaplus', `isab' and `isac'.
+
+ gcc defines a macro `__mcfARCH__' whenever it is generating code
+ for a ColdFire target. The ARCH in this macro is one of the
+ `-march' arguments given above.
+
+ When used together, `-march' and `-mtune' select code that runs on
+ a family of similar processors but that is optimized for a
+ particular microarchitecture.
+
+`-mcpu=CPU'
+ Generate code for a specific M680x0 or ColdFire processor. The
+ M680x0 CPUs are: `68000', `68010', `68020', `68030', `68040',
+ `68060', `68302', `68332' and `cpu32'. The ColdFire CPUs are
+ given by the table below, which also classifies the CPUs into
+ families:
+
+ *Family* *`-mcpu' arguments*
+ `51qe' `51qe'
+ `5206' `5202' `5204' `5206'
+ `5206e' `5206e'
+ `5208' `5207' `5208'
+ `5211a' `5210a' `5211a'
+ `5213' `5211' `5212' `5213'
+ `5216' `5214' `5216'
+ `52235' `52230' `52231' `52232' `52233' `52234' `52235'
+ `5225' `5224' `5225'
+ `5235' `5232' `5233' `5234' `5235' `523x'
+ `5249' `5249'
+ `5250' `5250'
+ `5271' `5270' `5271'
+ `5272' `5272'
+ `5275' `5274' `5275'
+ `5282' `5280' `5281' `5282' `528x'
+ `5307' `5307'
+ `5329' `5327' `5328' `5329' `532x'
+ `5373' `5372' `5373' `537x'
+ `5407' `5407'
+ `5475' `5470' `5471' `5472' `5473' `5474' `5475' `547x'
+ `5480' `5481' `5482' `5483' `5484' `5485'
+
+ `-mcpu=CPU' overrides `-march=ARCH' if ARCH is compatible with
+ CPU. Other combinations of `-mcpu' and `-march' are rejected.
+
+ gcc defines the macro `__mcf_cpu_CPU' when ColdFire target CPU is
+ selected. It also defines `__mcf_family_FAMILY', where the value
+ of FAMILY is given by the table above.
+
+`-mtune=TUNE'
+ Tune the code for a particular microarchitecture, within the
+ constraints set by `-march' and `-mcpu'. The M680x0
+ microarchitectures are: `68000', `68010', `68020', `68030',
+ `68040', `68060' and `cpu32'. The ColdFire microarchitectures
+ are: `cfv1', `cfv2', `cfv3', `cfv4' and `cfv4e'.
+
+ You can also use `-mtune=68020-40' for code that needs to run
+ relatively well on 68020, 68030 and 68040 targets.
+ `-mtune=68020-60' is similar but includes 68060 targets as well.
+ These two options select the same tuning decisions as `-m68020-40'
+ and `-m68020-60' respectively.
+
+ gcc defines the macros `__mcARCH' and `__mcARCH__' when tuning for
+ 680x0 architecture ARCH. It also defines `mcARCH' unless either
+ `-ansi' or a non-GNU `-std' option is used. If gcc is tuning for
+ a range of architectures, as selected by `-mtune=68020-40' or
+ `-mtune=68020-60', it defines the macros for every architecture in
+ the range.
+
+ gcc also defines the macro `__mUARCH__' when tuning for ColdFire
+ microarchitecture UARCH, where UARCH is one of the arguments given
+ above.
+
+`-m68000'
+`-mc68000'
+ Generate output for a 68000. This is the default when the
+ compiler is configured for 68000-based systems. It is equivalent
+ to `-march=68000'.
+
+ Use this option for microcontrollers with a 68000 or EC000 core,
+ including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
+
+`-m68010'
+ Generate output for a 68010. This is the default when the
+ compiler is configured for 68010-based systems. It is equivalent
+ to `-march=68010'.
+
+`-m68020'
+`-mc68020'
+ Generate output for a 68020. This is the default when the
+ compiler is configured for 68020-based systems. It is equivalent
+ to `-march=68020'.
+
+`-m68030'
+ Generate output for a 68030. This is the default when the
+ compiler is configured for 68030-based systems. It is equivalent
+ to `-march=68030'.
+
+`-m68040'
+ Generate output for a 68040. This is the default when the
+ compiler is configured for 68040-based systems. It is equivalent
+ to `-march=68040'.
+
+ This option inhibits the use of 68881/68882 instructions that have
+ to be emulated by software on the 68040. Use this option if your
+ 68040 does not have code to emulate those instructions.
+
+`-m68060'
+ Generate output for a 68060. This is the default when the
+ compiler is configured for 68060-based systems. It is equivalent
+ to `-march=68060'.
+
+ This option inhibits the use of 68020 and 68881/68882 instructions
+ that have to be emulated by software on the 68060. Use this
+ option if your 68060 does not have code to emulate those
+ instructions.
+
+`-mcpu32'
+ Generate output for a CPU32. This is the default when the
+ compiler is configured for CPU32-based systems. It is equivalent
+ to `-march=cpu32'.
+
+ Use this option for microcontrollers with a CPU32 or CPU32+ core,
+ including the 68330, 68331, 68332, 68333, 68334, 68336, 68340,
+ 68341, 68349 and 68360.
+
+`-m5200'
+ Generate output for a 520X ColdFire CPU. This is the default when
+ the compiler is configured for 520X-based systems. It is
+ equivalent to `-mcpu=5206', and is now deprecated in favor of that
+ option.
+
+ Use this option for microcontroller with a 5200 core, including
+ the MCF5202, MCF5203, MCF5204 and MCF5206.
+
+`-m5206e'
+ Generate output for a 5206e ColdFire CPU. The option is now
+ deprecated in favor of the equivalent `-mcpu=5206e'.
+
+`-m528x'
+ Generate output for a member of the ColdFire 528X family. The
+ option is now deprecated in favor of the equivalent `-mcpu=528x'.
+
+`-m5307'
+ Generate output for a ColdFire 5307 CPU. The option is now
+ deprecated in favor of the equivalent `-mcpu=5307'.
+
+`-m5407'
+ Generate output for a ColdFire 5407 CPU. The option is now
+ deprecated in favor of the equivalent `-mcpu=5407'.
+
+`-mcfv4e'
+ Generate output for a ColdFire V4e family CPU (e.g. 547x/548x).
+ This includes use of hardware floating point instructions. The
+ option is equivalent to `-mcpu=547x', and is now deprecated in
+ favor of that option.
+
+`-m68020-40'
+ Generate output for a 68040, without using any of the new
+ instructions. This results in code which can run relatively
+ efficiently on either a 68020/68881 or a 68030 or a 68040. The
+ generated code does use the 68881 instructions that are emulated
+ on the 68040.
+
+ The option is equivalent to `-march=68020' `-mtune=68020-40'.
+
+`-m68020-60'
+ Generate output for a 68060, without using any of the new
+ instructions. This results in code which can run relatively
+ efficiently on either a 68020/68881 or a 68030 or a 68040. The
+ generated code does use the 68881 instructions that are emulated
+ on the 68060.
+
+ The option is equivalent to `-march=68020' `-mtune=68020-60'.
+
+`-mhard-float'
+`-m68881'
+ Generate floating-point instructions. This is the default for
+ 68020 and above, and for ColdFire devices that have an FPU. It
+ defines the macro `__HAVE_68881__' on M680x0 targets and
+ `__mcffpu__' on ColdFire targets.
+
+`-msoft-float'
+ Do not generate floating-point instructions; use library calls
+ instead. This is the default for 68000, 68010, and 68832 targets.
+ It is also the default for ColdFire devices that have no FPU.
+
+`-mdiv'
+`-mno-div'
+ Generate (do not generate) ColdFire hardware divide and remainder
+ instructions. If `-march' is used without `-mcpu', the default is
+ "on" for ColdFire architectures and "off" for M680x0
+ architectures. Otherwise, the default is taken from the target CPU
+ (either the default CPU, or the one specified by `-mcpu'). For
+ example, the default is "off" for `-mcpu=5206' and "on" for
+ `-mcpu=5206e'.
+
+ gcc defines the macro `__mcfhwdiv__' when this option is enabled.
+
+`-mshort'
+ Consider type `int' to be 16 bits wide, like `short int'.
+ Additionally, parameters passed on the stack are also aligned to a
+ 16-bit boundary even on targets whose API mandates promotion to
+ 32-bit.
+
+`-mno-short'
+ Do not consider type `int' to be 16 bits wide. This is the
+ default.
+
+`-mnobitfield'
+`-mno-bitfield'
+ Do not use the bit-field instructions. The `-m68000', `-mcpu32'
+ and `-m5200' options imply `-mnobitfield'.
+
+`-mbitfield'
+ Do use the bit-field instructions. The `-m68020' option implies
+ `-mbitfield'. This is the default if you use a configuration
+ designed for a 68020.
+
+`-mrtd'
+ Use a different function-calling convention, in which functions
+ that take a fixed number of arguments return with the `rtd'
+ instruction, which pops their arguments while returning. This
+ saves one instruction in the caller since there is no need to pop
+ the arguments there.
+
+ This calling convention is incompatible with the one normally used
+ on Unix, so you cannot use it if you need to call libraries
+ compiled with the Unix compiler.
+
+ Also, you must provide function prototypes for all functions that
+ take variable numbers of arguments (including `printf'); otherwise
+ incorrect code will be generated for calls to those functions.
+
+ In addition, seriously incorrect code will result if you call a
+ function with too many arguments. (Normally, extra arguments are
+ harmlessly ignored.)
+
+ The `rtd' instruction is supported by the 68010, 68020, 68030,
+ 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
+
+`-mno-rtd'
+ Do not use the calling conventions selected by `-mrtd'. This is
+ the default.
+
+`-malign-int'
+`-mno-align-int'
+ Control whether GCC aligns `int', `long', `long long', `float',
+ `double', and `long double' variables on a 32-bit boundary
+ (`-malign-int') or a 16-bit boundary (`-mno-align-int'). Aligning
+ variables on 32-bit boundaries produces code that runs somewhat
+ faster on processors with 32-bit busses at the expense of more
+ memory.
+
+ *Warning:* if you use the `-malign-int' switch, GCC will align
+ structures containing the above types differently than most
+ published application binary interface specifications for the m68k.
+
+`-mpcrel'
+ Use the pc-relative addressing mode of the 68000 directly, instead
+ of using a global offset table. At present, this option implies
+ `-fpic', allowing at most a 16-bit offset for pc-relative
+ addressing. `-fPIC' is not presently supported with `-mpcrel',
+ though this could be supported for 68020 and higher processors.
+
+`-mno-strict-align'
+`-mstrict-align'
+ Do not (do) assume that unaligned memory references will be
+ handled by the system.
+
+`-msep-data'
+ Generate code that allows the data segment to be located in a
+ different area of memory from the text segment. This allows for
+ execute in place in an environment without virtual memory
+ management. This option implies `-fPIC'.
+
+`-mno-sep-data'
+ Generate code that assumes that the data segment follows the text
+ segment. This is the default.
+
+`-mid-shared-library'
+ Generate code that supports shared libraries via the library ID
+ method. This allows for execute in place and shared libraries in
+ an environment without virtual memory management. This option
+ implies `-fPIC'.
+
+`-mno-id-shared-library'
+ Generate code that doesn't assume ID based shared libraries are
+ being used. This is the default.
+
+`-mshared-library-id=n'
+ Specified the identification number of the ID based shared library
+ being compiled. Specifying a value of 0 will generate more
+ compact code, specifying other values will force the allocation of
+ that number to the current library but is no more space or time
+ efficient than omitting this option.
+
+`-mxgot'
+`-mno-xgot'
+ When generating position-independent code for ColdFire, generate
+ code that works if the GOT has more than 8192 entries. This code
+ is larger and slower than code generated without this option. On
+ M680x0 processors, this option is not needed; `-fPIC' suffices.
+
+ GCC normally uses a single instruction to load values from the GOT.
+ While this is relatively efficient, it only works if the GOT is
+ smaller than about 64k. Anything larger causes the linker to
+ report an error such as:
+
+ relocation truncated to fit: R_68K_GOT16O foobar
+
+ If this happens, you should recompile your code with `-mxgot'. It
+ should then work with very large GOTs. However, code generated
+ with `-mxgot' is less efficient, since it takes 4 instructions to
+ fetch the value of a global symbol.
+
+ Note that some linkers, including newer versions of the GNU linker,
+ can create multiple GOTs and sort GOT entries. If you have such a
+ linker, you should only need to use `-mxgot' when compiling a
+ single object file that accesses more than 8192 GOT entries. Very
+ few do.
+
+ These options have no effect unless GCC is generating
+ position-independent code.
+
+
+
+File: gcc.info, Node: M68hc1x Options, Next: MCore Options, Prev: M680x0 Options, Up: Submodel Options
+
+3.17.20 M68hc1x Options
+-----------------------
+
+These are the `-m' options defined for the 68hc11 and 68hc12
+microcontrollers. The default values for these options depends on
+which style of microcontroller was selected when the compiler was
+configured; the defaults for the most common choices are given below.
+
+`-m6811'
+`-m68hc11'
+ Generate output for a 68HC11. This is the default when the
+ compiler is configured for 68HC11-based systems.
+
+`-m6812'
+`-m68hc12'
+ Generate output for a 68HC12. This is the default when the
+ compiler is configured for 68HC12-based systems.
+
+`-m68S12'
+`-m68hcs12'
+ Generate output for a 68HCS12.
+
+`-mauto-incdec'
+ Enable the use of 68HC12 pre and post auto-increment and
+ auto-decrement addressing modes.
+
+`-minmax'
+`-nominmax'
+ Enable the use of 68HC12 min and max instructions.
+
+`-mlong-calls'
+`-mno-long-calls'
+ Treat all calls as being far away (near). If calls are assumed to
+ be far away, the compiler will use the `call' instruction to call
+ a function and the `rtc' instruction for returning.
+
+`-mshort'
+ Consider type `int' to be 16 bits wide, like `short int'.
+
+`-msoft-reg-count=COUNT'
+ Specify the number of pseudo-soft registers which are used for the
+ code generation. The maximum number is 32. Using more pseudo-soft
+ register may or may not result in better code depending on the
+ program. The default is 4 for 68HC11 and 2 for 68HC12.
+
+
+
+File: gcc.info, Node: MCore Options, Next: MIPS Options, Prev: M68hc1x Options, Up: Submodel Options
+
+3.17.21 MCore Options
+---------------------
+
+These are the `-m' options defined for the Motorola M*Core processors.
+
+`-mhardlit'
+`-mno-hardlit'
+ Inline constants into the code stream if it can be done in two
+ instructions or less.
+
+`-mdiv'
+`-mno-div'
+ Use the divide instruction. (Enabled by default).
+
+`-mrelax-immediate'
+`-mno-relax-immediate'
+ Allow arbitrary sized immediates in bit operations.
+
+`-mwide-bitfields'
+`-mno-wide-bitfields'
+ Always treat bit-fields as int-sized.
+
+`-m4byte-functions'
+`-mno-4byte-functions'
+ Force all functions to be aligned to a four byte boundary.
+
+`-mcallgraph-data'
+`-mno-callgraph-data'
+ Emit callgraph information.
+
+`-mslow-bytes'
+`-mno-slow-bytes'
+ Prefer word access when reading byte quantities.
+
+`-mlittle-endian'
+`-mbig-endian'
+ Generate code for a little endian target.
+
+`-m210'
+`-m340'
+ Generate code for the 210 processor.
+
+`-mno-lsim'
+ Assume that run-time support has been provided and so omit the
+ simulator library (`libsim.a)' from the linker command line.
+
+`-mstack-increment=SIZE'
+ Set the maximum amount for a single stack increment operation.
+ Large values can increase the speed of programs which contain
+ functions that need a large amount of stack space, but they can
+ also trigger a segmentation fault if the stack is extended too
+ much. The default value is 0x1000.
+
+
+
+File: gcc.info, Node: MIPS Options, Next: MMIX Options, Prev: MCore Options, Up: Submodel Options
+
+3.17.22 MIPS Options
+--------------------
+
+`-EB'
+ Generate big-endian code.
+
+`-EL'
+ Generate little-endian code. This is the default for `mips*el-*-*'
+ configurations.
+
+`-march=ARCH'
+ Generate code that will run on ARCH, which can be the name of a
+ generic MIPS ISA, or the name of a particular processor. The ISA
+ names are: `mips1', `mips2', `mips3', `mips4', `mips32',
+ `mips32r2', `mips64' and `mips64r2'. The processor names are:
+ `4kc', `4km', `4kp', `4ksc', `4kec', `4kem', `4kep', `4ksd',
+ `5kc', `5kf', `20kc', `24kc', `24kf2_1', `24kf1_1', `24kec',
+ `24kef2_1', `24kef1_1', `34kc', `34kf2_1', `34kf1_1', `74kc',
+ `74kf2_1', `74kf1_1', `74kf3_2', `loongson2e', `loongson2f', `m4k',
+ `octeon', `orion', `r2000', `r3000', `r3900', `r4000', `r4400',
+ `r4600', `r4650', `r6000', `r8000', `rm7000', `rm9000', `r10000',
+ `r12000', `r14000', `r16000', `sb1', `sr71000', `vr4100',
+ `vr4111', `vr4120', `vr4130', `vr4300', `vr5000', `vr5400',
+ `vr5500' and `xlr'. The special value `from-abi' selects the most
+ compatible architecture for the selected ABI (that is, `mips1' for
+ 32-bit ABIs and `mips3' for 64-bit ABIs).
+
+ Native Linux/GNU toolchains also support the value `native', which
+ selects the best architecture option for the host processor.
+ `-march=native' has no effect if GCC does not recognize the
+ processor.
+
+ In processor names, a final `000' can be abbreviated as `k' (for
+ example, `-march=r2k'). Prefixes are optional, and `vr' may be
+ written `r'.
+
+ Names of the form `Nf2_1' refer to processors with FPUs clocked at
+ half the rate of the core, names of the form `Nf1_1' refer to
+ processors with FPUs clocked at the same rate as the core, and
+ names of the form `Nf3_2' refer to processors with FPUs clocked a
+ ratio of 3:2 with respect to the core. For compatibility reasons,
+ `Nf' is accepted as a synonym for `Nf2_1' while `Nx' and `Bfx' are
+ accepted as synonyms for `Nf1_1'.
+
+ GCC defines two macros based on the value of this option. The
+ first is `_MIPS_ARCH', which gives the name of target
+ architecture, as a string. The second has the form
+ `_MIPS_ARCH_FOO', where FOO is the capitalized value of
+ `_MIPS_ARCH'. For example, `-march=r2000' will set `_MIPS_ARCH'
+ to `"r2000"' and define the macro `_MIPS_ARCH_R2000'.
+
+ Note that the `_MIPS_ARCH' macro uses the processor names given
+ above. In other words, it will have the full prefix and will not
+ abbreviate `000' as `k'. In the case of `from-abi', the macro
+ names the resolved architecture (either `"mips1"' or `"mips3"').
+ It names the default architecture when no `-march' option is given.
+
+`-mtune=ARCH'
+ Optimize for ARCH. Among other things, this option controls the
+ way instructions are scheduled, and the perceived cost of
+ arithmetic operations. The list of ARCH values is the same as for
+ `-march'.
+
+ When this option is not used, GCC will optimize for the processor
+ specified by `-march'. By using `-march' and `-mtune' together,
+ it is possible to generate code that will run on a family of
+ processors, but optimize the code for one particular member of
+ that family.
+
+ `-mtune' defines the macros `_MIPS_TUNE' and `_MIPS_TUNE_FOO',
+ which work in the same way as the `-march' ones described above.
+
+`-mips1'
+ Equivalent to `-march=mips1'.
+
+`-mips2'
+ Equivalent to `-march=mips2'.
+
+`-mips3'
+ Equivalent to `-march=mips3'.
+
+`-mips4'
+ Equivalent to `-march=mips4'.
+
+`-mips32'
+ Equivalent to `-march=mips32'.
+
+`-mips32r2'
+ Equivalent to `-march=mips32r2'.
+
+`-mips64'
+ Equivalent to `-march=mips64'.
+
+`-mips64r2'
+ Equivalent to `-march=mips64r2'.
+
+`-mips16'
+`-mno-mips16'
+ Generate (do not generate) MIPS16 code. If GCC is targetting a
+ MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE.
+
+ MIPS16 code generation can also be controlled on a per-function
+ basis by means of `mips16' and `nomips16' attributes. *Note
+ Function Attributes::, for more information.
+
+`-mflip-mips16'
+ Generate MIPS16 code on alternating functions. This option is
+ provided for regression testing of mixed MIPS16/non-MIPS16 code
+ generation, and is not intended for ordinary use in compiling user
+ code.
+
+`-minterlink-mips16'
+`-mno-interlink-mips16'
+ Require (do not require) that non-MIPS16 code be link-compatible
+ with MIPS16 code.
+
+ For example, non-MIPS16 code cannot jump directly to MIPS16 code;
+ it must either use a call or an indirect jump.
+ `-minterlink-mips16' therefore disables direct jumps unless GCC
+ knows that the target of the jump is not MIPS16.
+
+`-mabi=32'
+`-mabi=o64'
+`-mabi=n32'
+`-mabi=64'
+`-mabi=eabi'
+ Generate code for the given ABI.
+
+ Note that the EABI has a 32-bit and a 64-bit variant. GCC normally
+ generates 64-bit code when you select a 64-bit architecture, but
+ you can use `-mgp32' to get 32-bit code instead.
+
+ For information about the O64 ABI, see
+ `http://gcc.gnu.org/projects/mipso64-abi.html'.
+
+ GCC supports a variant of the o32 ABI in which floating-point
+ registers are 64 rather than 32 bits wide. You can select this
+ combination with `-mabi=32' `-mfp64'. This ABI relies on the
+ `mthc1' and `mfhc1' instructions and is therefore only supported
+ for MIPS32R2 processors.
+
+ The register assignments for arguments and return values remain the
+ same, but each scalar value is passed in a single 64-bit register
+ rather than a pair of 32-bit registers. For example, scalar
+ floating-point values are returned in `$f0' only, not a
+ `$f0'/`$f1' pair. The set of call-saved registers also remains
+ the same, but all 64 bits are saved.
+
+`-mabicalls'
+`-mno-abicalls'
+ Generate (do not generate) code that is suitable for SVR4-style
+ dynamic objects. `-mabicalls' is the default for SVR4-based
+ systems.
+
+`-mshared'
+`-mno-shared'
+ Generate (do not generate) code that is fully position-independent,
+ and that can therefore be linked into shared libraries. This
+ option only affects `-mabicalls'.
+
+ All `-mabicalls' code has traditionally been position-independent,
+ regardless of options like `-fPIC' and `-fpic'. However, as an
+ extension, the GNU toolchain allows executables to use absolute
+ accesses for locally-binding symbols. It can also use shorter GP
+ initialization sequences and generate direct calls to
+ locally-defined functions. This mode is selected by `-mno-shared'.
+
+ `-mno-shared' depends on binutils 2.16 or higher and generates
+ objects that can only be linked by the GNU linker. However, the
+ option does not affect the ABI of the final executable; it only
+ affects the ABI of relocatable objects. Using `-mno-shared' will
+ generally make executables both smaller and quicker.
+
+ `-mshared' is the default.
+
+`-mplt'
+`-mno-plt'
+ Assume (do not assume) that the static and dynamic linkers support
+ PLTs and copy relocations. This option only affects `-mno-shared
+ -mabicalls'. For the n64 ABI, this option has no effect without
+ `-msym32'.
+
+ You can make `-mplt' the default by configuring GCC with
+ `--with-mips-plt'. The default is `-mno-plt' otherwise.
+
+`-mxgot'
+`-mno-xgot'
+ Lift (do not lift) the usual restrictions on the size of the global
+ offset table.
+
+ GCC normally uses a single instruction to load values from the GOT.
+ While this is relatively efficient, it will only work if the GOT
+ is smaller than about 64k. Anything larger will cause the linker
+ to report an error such as:
+
+ relocation truncated to fit: R_MIPS_GOT16 foobar
+
+ If this happens, you should recompile your code with `-mxgot'. It
+ should then work with very large GOTs, although it will also be
+ less efficient, since it will take three instructions to fetch the
+ value of a global symbol.
+
+ Note that some linkers can create multiple GOTs. If you have such
+ a linker, you should only need to use `-mxgot' when a single object
+ file accesses more than 64k's worth of GOT entries. Very few do.
+
+ These options have no effect unless GCC is generating position
+ independent code.
+
+`-mgp32'
+ Assume that general-purpose registers are 32 bits wide.
+
+`-mgp64'
+ Assume that general-purpose registers are 64 bits wide.
+
+`-mfp32'
+ Assume that floating-point registers are 32 bits wide.
+
+`-mfp64'
+ Assume that floating-point registers are 64 bits wide.
+
+`-mhard-float'
+ Use floating-point coprocessor instructions.
+
+`-msoft-float'
+ Do not use floating-point coprocessor instructions. Implement
+ floating-point calculations using library calls instead.
+
+`-msingle-float'
+ Assume that the floating-point coprocessor only supports
+ single-precision operations.
+
+`-mdouble-float'
+ Assume that the floating-point coprocessor supports
+ double-precision operations. This is the default.
+
+`-mllsc'
+`-mno-llsc'
+ Use (do not use) `ll', `sc', and `sync' instructions to implement
+ atomic memory built-in functions. When neither option is
+ specified, GCC will use the instructions if the target architecture
+ supports them.
+
+ `-mllsc' is useful if the runtime environment can emulate the
+ instructions and `-mno-llsc' can be useful when compiling for
+ nonstandard ISAs. You can make either option the default by
+ configuring GCC with `--with-llsc' and `--without-llsc'
+ respectively. `--with-llsc' is the default for some
+ configurations; see the installation documentation for details.
+
+`-mdsp'
+`-mno-dsp'
+ Use (do not use) revision 1 of the MIPS DSP ASE. *Note MIPS DSP
+ Built-in Functions::. This option defines the preprocessor macro
+ `__mips_dsp'. It also defines `__mips_dsp_rev' to 1.
+
+`-mdspr2'
+`-mno-dspr2'
+ Use (do not use) revision 2 of the MIPS DSP ASE. *Note MIPS DSP
+ Built-in Functions::. This option defines the preprocessor macros
+ `__mips_dsp' and `__mips_dspr2'. It also defines `__mips_dsp_rev'
+ to 2.
+
+`-msmartmips'
+`-mno-smartmips'
+ Use (do not use) the MIPS SmartMIPS ASE.
+
+`-mpaired-single'
+`-mno-paired-single'
+ Use (do not use) paired-single floating-point instructions. *Note
+ MIPS Paired-Single Support::. This option requires hardware
+ floating-point support to be enabled.
+
+`-mdmx'
+`-mno-mdmx'
+ Use (do not use) MIPS Digital Media Extension instructions. This
+ option can only be used when generating 64-bit code and requires
+ hardware floating-point support to be enabled.
+
+`-mips3d'
+`-mno-mips3d'
+ Use (do not use) the MIPS-3D ASE. *Note MIPS-3D Built-in
+ Functions::. The option `-mips3d' implies `-mpaired-single'.
+
+`-mmt'
+`-mno-mt'
+ Use (do not use) MT Multithreading instructions.
+
+`-mlong64'
+ Force `long' types to be 64 bits wide. See `-mlong32' for an
+ explanation of the default and the way that the pointer size is
+ determined.
+
+`-mlong32'
+ Force `long', `int', and pointer types to be 32 bits wide.
+
+ The default size of `int's, `long's and pointers depends on the
+ ABI. All the supported ABIs use 32-bit `int's. The n64 ABI uses
+ 64-bit `long's, as does the 64-bit EABI; the others use 32-bit
+ `long's. Pointers are the same size as `long's, or the same size
+ as integer registers, whichever is smaller.
+
+`-msym32'
+`-mno-sym32'
+ Assume (do not assume) that all symbols have 32-bit values,
+ regardless of the selected ABI. This option is useful in
+ combination with `-mabi=64' and `-mno-abicalls' because it allows
+ GCC to generate shorter and faster references to symbolic
+ addresses.
+
+`-G NUM'
+ Put definitions of externally-visible data in a small data section
+ if that data is no bigger than NUM bytes. GCC can then access the
+ data more efficiently; see `-mgpopt' for details.
+
+ The default `-G' option depends on the configuration.
+
+`-mlocal-sdata'
+`-mno-local-sdata'
+ Extend (do not extend) the `-G' behavior to local data too, such
+ as to static variables in C. `-mlocal-sdata' is the default for
+ all configurations.
+
+ If the linker complains that an application is using too much
+ small data, you might want to try rebuilding the less
+ performance-critical parts with `-mno-local-sdata'. You might
+ also want to build large libraries with `-mno-local-sdata', so
+ that the libraries leave more room for the main program.
+
+`-mextern-sdata'
+`-mno-extern-sdata'
+ Assume (do not assume) that externally-defined data will be in a
+ small data section if that data is within the `-G' limit.
+ `-mextern-sdata' is the default for all configurations.
+
+ If you compile a module MOD with `-mextern-sdata' `-G NUM'
+ `-mgpopt', and MOD references a variable VAR that is no bigger
+ than NUM bytes, you must make sure that VAR is placed in a small
+ data section. If VAR is defined by another module, you must
+ either compile that module with a high-enough `-G' setting or
+ attach a `section' attribute to VAR's definition. If VAR is
+ common, you must link the application with a high-enough `-G'
+ setting.
+
+ The easiest way of satisfying these restrictions is to compile and
+ link every module with the same `-G' option. However, you may
+ wish to build a library that supports several different small data
+ limits. You can do this by compiling the library with the highest
+ supported `-G' setting and additionally using `-mno-extern-sdata'
+ to stop the library from making assumptions about
+ externally-defined data.
+
+`-mgpopt'
+`-mno-gpopt'
+ Use (do not use) GP-relative accesses for symbols that are known
+ to be in a small data section; see `-G', `-mlocal-sdata' and
+ `-mextern-sdata'. `-mgpopt' is the default for all configurations.
+
+ `-mno-gpopt' is useful for cases where the `$gp' register might
+ not hold the value of `_gp'. For example, if the code is part of
+ a library that might be used in a boot monitor, programs that call
+ boot monitor routines will pass an unknown value in `$gp'. (In
+ such situations, the boot monitor itself would usually be compiled
+ with `-G0'.)
+
+ `-mno-gpopt' implies `-mno-local-sdata' and `-mno-extern-sdata'.
+
+`-membedded-data'
+`-mno-embedded-data'
+ Allocate variables to the read-only data section first if
+ possible, then next in the small data section if possible,
+ otherwise in data. This gives slightly slower code than the
+ default, but reduces the amount of RAM required when executing,
+ and thus may be preferred for some embedded systems.
+
+`-muninit-const-in-rodata'
+`-mno-uninit-const-in-rodata'
+ Put uninitialized `const' variables in the read-only data section.
+ This option is only meaningful in conjunction with
+ `-membedded-data'.
+
+`-mcode-readable=SETTING'
+ Specify whether GCC may generate code that reads from executable
+ sections. There are three possible settings:
+
+ `-mcode-readable=yes'
+ Instructions may freely access executable sections. This is
+ the default setting.
+
+ `-mcode-readable=pcrel'
+ MIPS16 PC-relative load instructions can access executable
+ sections, but other instructions must not do so. This option
+ is useful on 4KSc and 4KSd processors when the code TLBs have
+ the Read Inhibit bit set. It is also useful on processors
+ that can be configured to have a dual instruction/data SRAM
+ interface and that, like the M4K, automatically redirect
+ PC-relative loads to the instruction RAM.
+
+ `-mcode-readable=no'
+ Instructions must not access executable sections. This
+ option can be useful on targets that are configured to have a
+ dual instruction/data SRAM interface but that (unlike the
+ M4K) do not automatically redirect PC-relative loads to the
+ instruction RAM.
+
+`-msplit-addresses'
+`-mno-split-addresses'
+ Enable (disable) use of the `%hi()' and `%lo()' assembler
+ relocation operators. This option has been superseded by
+ `-mexplicit-relocs' but is retained for backwards compatibility.
+
+`-mexplicit-relocs'
+`-mno-explicit-relocs'
+ Use (do not use) assembler relocation operators when dealing with
+ symbolic addresses. The alternative, selected by
+ `-mno-explicit-relocs', is to use assembler macros instead.
+
+ `-mexplicit-relocs' is the default if GCC was configured to use an
+ assembler that supports relocation operators.
+
+`-mcheck-zero-division'
+`-mno-check-zero-division'
+ Trap (do not trap) on integer division by zero.
+
+ The default is `-mcheck-zero-division'.
+
+`-mdivide-traps'
+`-mdivide-breaks'
+ MIPS systems check for division by zero by generating either a
+ conditional trap or a break instruction. Using traps results in
+ smaller code, but is only supported on MIPS II and later. Also,
+ some versions of the Linux kernel have a bug that prevents trap
+ from generating the proper signal (`SIGFPE'). Use
+ `-mdivide-traps' to allow conditional traps on architectures that
+ support them and `-mdivide-breaks' to force the use of breaks.
+
+ The default is usually `-mdivide-traps', but this can be
+ overridden at configure time using `--with-divide=breaks'.
+ Divide-by-zero checks can be completely disabled using
+ `-mno-check-zero-division'.
+
+`-mmemcpy'
+`-mno-memcpy'
+ Force (do not force) the use of `memcpy()' for non-trivial block
+ moves. The default is `-mno-memcpy', which allows GCC to inline
+ most constant-sized copies.
+
+`-mlong-calls'
+`-mno-long-calls'
+ Disable (do not disable) use of the `jal' instruction. Calling
+ functions using `jal' is more efficient but requires the caller
+ and callee to be in the same 256 megabyte segment.
+
+ This option has no effect on abicalls code. The default is
+ `-mno-long-calls'.
+
+`-mmad'
+`-mno-mad'
+ Enable (disable) use of the `mad', `madu' and `mul' instructions,
+ as provided by the R4650 ISA.
+
+`-mfused-madd'
+`-mno-fused-madd'
+ Enable (disable) use of the floating point multiply-accumulate
+ instructions, when they are available. The default is
+ `-mfused-madd'.
+
+ When multiply-accumulate instructions are used, the intermediate
+ product is calculated to infinite precision and is not subject to
+ the FCSR Flush to Zero bit. This may be undesirable in some
+ circumstances.
+
+`-nocpp'
+ Tell the MIPS assembler to not run its preprocessor over user
+ assembler files (with a `.s' suffix) when assembling them.
+
+`-mfix-r4000'
+`-mno-fix-r4000'
+ Work around certain R4000 CPU errata:
+ - A double-word or a variable shift may give an incorrect
+ result if executed immediately after starting an integer
+ division.
+
+ - A double-word or a variable shift may give an incorrect
+ result if executed while an integer multiplication is in
+ progress.
+
+ - An integer division may give an incorrect result if started
+ in a delay slot of a taken branch or a jump.
+
+`-mfix-r4400'
+`-mno-fix-r4400'
+ Work around certain R4400 CPU errata:
+ - A double-word or a variable shift may give an incorrect
+ result if executed immediately after starting an integer
+ division.
+
+`-mfix-r10000'
+`-mno-fix-r10000'
+ Work around certain R10000 errata:
+ - `ll'/`sc' sequences may not behave atomically on revisions
+ prior to 3.0. They may deadlock on revisions 2.6 and earlier.
+
+ This option can only be used if the target architecture supports
+ branch-likely instructions. `-mfix-r10000' is the default when
+ `-march=r10000' is used; `-mno-fix-r10000' is the default
+ otherwise.
+
+`-mfix-vr4120'
+`-mno-fix-vr4120'
+ Work around certain VR4120 errata:
+ - `dmultu' does not always produce the correct result.
+
+ - `div' and `ddiv' do not always produce the correct result if
+ one of the operands is negative.
+ The workarounds for the division errata rely on special functions
+ in `libgcc.a'. At present, these functions are only provided by
+ the `mips64vr*-elf' configurations.
+
+ Other VR4120 errata require a nop to be inserted between certain
+ pairs of instructions. These errata are handled by the assembler,
+ not by GCC itself.
+
+`-mfix-vr4130'
+ Work around the VR4130 `mflo'/`mfhi' errata. The workarounds are
+ implemented by the assembler rather than by GCC, although GCC will
+ avoid using `mflo' and `mfhi' if the VR4130 `macc', `macchi',
+ `dmacc' and `dmacchi' instructions are available instead.
+
+`-mfix-sb1'
+`-mno-fix-sb1'
+ Work around certain SB-1 CPU core errata. (This flag currently
+ works around the SB-1 revision 2 "F1" and "F2" floating point
+ errata.)
+
+`-mr10k-cache-barrier=SETTING'
+ Specify whether GCC should insert cache barriers to avoid the
+ side-effects of speculation on R10K processors.
+
+ In common with many processors, the R10K tries to predict the
+ outcome of a conditional branch and speculatively executes
+ instructions from the "taken" branch. It later aborts these
+ instructions if the predicted outcome was wrong. However, on the
+ R10K, even aborted instructions can have side effects.
+
+ This problem only affects kernel stores and, depending on the
+ system, kernel loads. As an example, a speculatively-executed
+ store may load the target memory into cache and mark the cache
+ line as dirty, even if the store itself is later aborted. If a
+ DMA operation writes to the same area of memory before the "dirty"
+ line is flushed, the cached data will overwrite the DMA-ed data.
+ See the R10K processor manual for a full description, including
+ other potential problems.
+
+ One workaround is to insert cache barrier instructions before
+ every memory access that might be speculatively executed and that
+ might have side effects even if aborted.
+ `-mr10k-cache-barrier=SETTING' controls GCC's implementation of
+ this workaround. It assumes that aborted accesses to any byte in
+ the following regions will not have side effects:
+
+ 1. the memory occupied by the current function's stack frame;
+
+ 2. the memory occupied by an incoming stack argument;
+
+ 3. the memory occupied by an object with a link-time-constant
+ address.
+
+ It is the kernel's responsibility to ensure that speculative
+ accesses to these regions are indeed safe.
+
+ If the input program contains a function declaration such as:
+
+ void foo (void);
+
+ then the implementation of `foo' must allow `j foo' and `jal foo'
+ to be executed speculatively. GCC honors this restriction for
+ functions it compiles itself. It expects non-GCC functions (such
+ as hand-written assembly code) to do the same.
+
+ The option has three forms:
+
+ `-mr10k-cache-barrier=load-store'
+ Insert a cache barrier before a load or store that might be
+ speculatively executed and that might have side effects even
+ if aborted.
+
+ `-mr10k-cache-barrier=store'
+ Insert a cache barrier before a store that might be
+ speculatively executed and that might have side effects even
+ if aborted.
+
+ `-mr10k-cache-barrier=none'
+ Disable the insertion of cache barriers. This is the default
+ setting.
+
+`-mflush-func=FUNC'
+`-mno-flush-func'
+ Specifies the function to call to flush the I and D caches, or to
+ not call any such function. If called, the function must take the
+ same arguments as the common `_flush_func()', that is, the address
+ of the memory range for which the cache is being flushed, the size
+ of the memory range, and the number 3 (to flush both caches). The
+ default depends on the target GCC was configured for, but commonly
+ is either `_flush_func' or `__cpu_flush'.
+
+`mbranch-cost=NUM'
+ Set the cost of branches to roughly NUM "simple" instructions.
+ This cost is only a heuristic and is not guaranteed to produce
+ consistent results across releases. A zero cost redundantly
+ selects the default, which is based on the `-mtune' setting.
+
+`-mbranch-likely'
+`-mno-branch-likely'
+ Enable or disable use of Branch Likely instructions, regardless of
+ the default for the selected architecture. By default, Branch
+ Likely instructions may be generated if they are supported by the
+ selected architecture. An exception is for the MIPS32 and MIPS64
+ architectures and processors which implement those architectures;
+ for those, Branch Likely instructions will not be generated by
+ default because the MIPS32 and MIPS64 architectures specifically
+ deprecate their use.
+
+`-mfp-exceptions'
+`-mno-fp-exceptions'
+ Specifies whether FP exceptions are enabled. This affects how we
+ schedule FP instructions for some processors. The default is that
+ FP exceptions are enabled.
+
+ For instance, on the SB-1, if FP exceptions are disabled, and we
+ are emitting 64-bit code, then we can use both FP pipes.
+ Otherwise, we can only use one FP pipe.
+
+`-mvr4130-align'
+`-mno-vr4130-align'
+ The VR4130 pipeline is two-way superscalar, but can only issue two
+ instructions together if the first one is 8-byte aligned. When
+ this option is enabled, GCC will align pairs of instructions that
+ it thinks should execute in parallel.
+
+ This option only has an effect when optimizing for the VR4130. It
+ normally makes code faster, but at the expense of making it bigger.
+ It is enabled by default at optimization level `-O3'.
+
+
+File: gcc.info, Node: MMIX Options, Next: MN10300 Options, Prev: MIPS Options, Up: Submodel Options
+
+3.17.23 MMIX Options
+--------------------
+
+These options are defined for the MMIX:
+
+`-mlibfuncs'
+`-mno-libfuncs'
+ Specify that intrinsic library functions are being compiled,
+ passing all values in registers, no matter the size.
+
+`-mepsilon'
+`-mno-epsilon'
+ Generate floating-point comparison instructions that compare with
+ respect to the `rE' epsilon register.
+
+`-mabi=mmixware'
+`-mabi=gnu'
+ Generate code that passes function parameters and return values
+ that (in the called function) are seen as registers `$0' and up,
+ as opposed to the GNU ABI which uses global registers `$231' and
+ up.
+
+`-mzero-extend'
+`-mno-zero-extend'
+ When reading data from memory in sizes shorter than 64 bits, use
+ (do not use) zero-extending load instructions by default, rather
+ than sign-extending ones.
+
+`-mknuthdiv'
+`-mno-knuthdiv'
+ Make the result of a division yielding a remainder have the same
+ sign as the divisor. With the default, `-mno-knuthdiv', the sign
+ of the remainder follows the sign of the dividend. Both methods
+ are arithmetically valid, the latter being almost exclusively used.
+
+`-mtoplevel-symbols'
+`-mno-toplevel-symbols'
+ Prepend (do not prepend) a `:' to all global symbols, so the
+ assembly code can be used with the `PREFIX' assembly directive.
+
+`-melf'
+ Generate an executable in the ELF format, rather than the default
+ `mmo' format used by the `mmix' simulator.
+
+`-mbranch-predict'
+`-mno-branch-predict'
+ Use (do not use) the probable-branch instructions, when static
+ branch prediction indicates a probable branch.
+
+`-mbase-addresses'
+`-mno-base-addresses'
+ Generate (do not generate) code that uses _base addresses_. Using
+ a base address automatically generates a request (handled by the
+ assembler and the linker) for a constant to be set up in a global
+ register. The register is used for one or more base address
+ requests within the range 0 to 255 from the value held in the
+ register. The generally leads to short and fast code, but the
+ number of different data items that can be addressed is limited.
+ This means that a program that uses lots of static data may
+ require `-mno-base-addresses'.
+
+`-msingle-exit'
+`-mno-single-exit'
+ Force (do not force) generated code to have a single exit point in
+ each function.
+
+
+File: gcc.info, Node: MN10300 Options, Next: PDP-11 Options, Prev: MMIX Options, Up: Submodel Options
+
+3.17.24 MN10300 Options
+-----------------------
+
+These `-m' options are defined for Matsushita MN10300 architectures:
+
+`-mmult-bug'
+ Generate code to avoid bugs in the multiply instructions for the
+ MN10300 processors. This is the default.
+
+`-mno-mult-bug'
+ Do not generate code to avoid bugs in the multiply instructions
+ for the MN10300 processors.
+
+`-mam33'
+ Generate code which uses features specific to the AM33 processor.
+
+`-mno-am33'
+ Do not generate code which uses features specific to the AM33
+ processor. This is the default.
+
+`-mreturn-pointer-on-d0'
+ When generating a function which returns a pointer, return the
+ pointer in both `a0' and `d0'. Otherwise, the pointer is returned
+ only in a0, and attempts to call such functions without a prototype
+ would result in errors. Note that this option is on by default;
+ use `-mno-return-pointer-on-d0' to disable it.
+
+`-mno-crt0'
+ Do not link in the C run-time initialization object file.
+
+`-mrelax'
+ Indicate to the linker that it should perform a relaxation
+ optimization pass to shorten branches, calls and absolute memory
+ addresses. This option only has an effect when used on the
+ command line for the final link step.
+
+ This option makes symbolic debugging impossible.
+
+
+File: gcc.info, Node: PDP-11 Options, Next: picoChip Options, Prev: MN10300 Options, Up: Submodel Options
+
+3.17.25 PDP-11 Options
+----------------------
+
+These options are defined for the PDP-11:
+
+`-mfpu'
+ Use hardware FPP floating point. This is the default. (FIS
+ floating point on the PDP-11/40 is not supported.)
+
+`-msoft-float'
+ Do not use hardware floating point.
+
+`-mac0'
+ Return floating-point results in ac0 (fr0 in Unix assembler
+ syntax).
+
+`-mno-ac0'
+ Return floating-point results in memory. This is the default.
+
+`-m40'
+ Generate code for a PDP-11/40.
+
+`-m45'
+ Generate code for a PDP-11/45. This is the default.
+
+`-m10'
+ Generate code for a PDP-11/10.
+
+`-mbcopy-builtin'
+ Use inline `movmemhi' patterns for copying memory. This is the
+ default.
+
+`-mbcopy'
+ Do not use inline `movmemhi' patterns for copying memory.
+
+`-mint16'
+`-mno-int32'
+ Use 16-bit `int'. This is the default.
+
+`-mint32'
+`-mno-int16'
+ Use 32-bit `int'.
+
+`-mfloat64'
+`-mno-float32'
+ Use 64-bit `float'. This is the default.
+
+`-mfloat32'
+`-mno-float64'
+ Use 32-bit `float'.
+
+`-mabshi'
+ Use `abshi2' pattern. This is the default.
+
+`-mno-abshi'
+ Do not use `abshi2' pattern.
+
+`-mbranch-expensive'
+ Pretend that branches are expensive. This is for experimenting
+ with code generation only.
+
+`-mbranch-cheap'
+ Do not pretend that branches are expensive. This is the default.
+
+`-msplit'
+ Generate code for a system with split I&D.
+
+`-mno-split'
+ Generate code for a system without split I&D. This is the default.
+
+`-munix-asm'
+ Use Unix assembler syntax. This is the default when configured for
+ `pdp11-*-bsd'.
+
+`-mdec-asm'
+ Use DEC assembler syntax. This is the default when configured for
+ any PDP-11 target other than `pdp11-*-bsd'.
+
+
+File: gcc.info, Node: picoChip Options, Next: PowerPC Options, Prev: PDP-11 Options, Up: Submodel Options
+
+3.17.26 picoChip Options
+------------------------
+
+These `-m' options are defined for picoChip implementations:
+
+`-mae=AE_TYPE'
+ Set the instruction set, register set, and instruction scheduling
+ parameters for array element type AE_TYPE. Supported values for
+ AE_TYPE are `ANY', `MUL', and `MAC'.
+
+ `-mae=ANY' selects a completely generic AE type. Code generated
+ with this option will run on any of the other AE types. The code
+ will not be as efficient as it would be if compiled for a specific
+ AE type, and some types of operation (e.g., multiplication) will
+ not work properly on all types of AE.
+
+ `-mae=MUL' selects a MUL AE type. This is the most useful AE type
+ for compiled code, and is the default.
+
+ `-mae=MAC' selects a DSP-style MAC AE. Code compiled with this
+ option may suffer from poor performance of byte (char)
+ manipulation, since the DSP AE does not provide hardware support
+ for byte load/stores.
+
+`-msymbol-as-address'
+ Enable the compiler to directly use a symbol name as an address in
+ a load/store instruction, without first loading it into a
+ register. Typically, the use of this option will generate larger
+ programs, which run faster than when the option isn't used.
+ However, the results vary from program to program, so it is left
+ as a user option, rather than being permanently enabled.
+
+`-mno-inefficient-warnings'
+ Disables warnings about the generation of inefficient code. These
+ warnings can be generated, for example, when compiling code which
+ performs byte-level memory operations on the MAC AE type. The MAC
+ AE has no hardware support for byte-level memory operations, so
+ all byte load/stores must be synthesized from word load/store
+ operations. This is inefficient and a warning will be generated
+ indicating to the programmer that they should rewrite the code to
+ avoid byte operations, or to target an AE type which has the
+ necessary hardware support. This option enables the warning to be
+ turned off.
+
+
+
+File: gcc.info, Node: PowerPC Options, Next: RS/6000 and PowerPC Options, Prev: picoChip Options, Up: Submodel Options
+
+3.17.27 PowerPC Options
+-----------------------
+
+These are listed under *Note RS/6000 and PowerPC Options::.
+
+
+File: gcc.info, Node: RS/6000 and PowerPC Options, Next: S/390 and zSeries Options, Prev: PowerPC Options, Up: Submodel Options
+
+3.17.28 IBM RS/6000 and PowerPC Options
+---------------------------------------
+
+These `-m' options are defined for the IBM RS/6000 and PowerPC:
+`-mpower'
+`-mno-power'
+`-mpower2'
+`-mno-power2'
+`-mpowerpc'
+`-mno-powerpc'
+`-mpowerpc-gpopt'
+`-mno-powerpc-gpopt'
+`-mpowerpc-gfxopt'
+`-mno-powerpc-gfxopt'
+`-mpowerpc64'
+`-mno-powerpc64'
+`-mmfcrf'
+`-mno-mfcrf'
+`-mpopcntb'
+`-mno-popcntb'
+`-mfprnd'
+`-mno-fprnd'
+`-mcmpb'
+`-mno-cmpb'
+`-mmfpgpr'
+`-mno-mfpgpr'
+`-mhard-dfp'
+`-mno-hard-dfp'
+ GCC supports two related instruction set architectures for the
+ RS/6000 and PowerPC. The "POWER" instruction set are those
+ instructions supported by the `rios' chip set used in the original
+ RS/6000 systems and the "PowerPC" instruction set is the
+ architecture of the Freescale MPC5xx, MPC6xx, MPC8xx
+ microprocessors, and the IBM 4xx, 6xx, and follow-on
+ microprocessors.
+
+ Neither architecture is a subset of the other. However there is a
+ large common subset of instructions supported by both. An MQ
+ register is included in processors supporting the POWER
+ architecture.
+
+ You use these options to specify which instructions are available
+ on the processor you are using. The default value of these
+ options is determined when configuring GCC. Specifying the
+ `-mcpu=CPU_TYPE' overrides the specification of these options. We
+ recommend you use the `-mcpu=CPU_TYPE' option rather than the
+ options listed above.
+
+ The `-mpower' option allows GCC to generate instructions that are
+ found only in the POWER architecture and to use the MQ register.
+ Specifying `-mpower2' implies `-power' and also allows GCC to
+ generate instructions that are present in the POWER2 architecture
+ but not the original POWER architecture.
+
+ The `-mpowerpc' option allows GCC to generate instructions that
+ are found only in the 32-bit subset of the PowerPC architecture.
+ Specifying `-mpowerpc-gpopt' implies `-mpowerpc' and also allows
+ GCC to use the optional PowerPC architecture instructions in the
+ General Purpose group, including floating-point square root.
+ Specifying `-mpowerpc-gfxopt' implies `-mpowerpc' and also allows
+ GCC to use the optional PowerPC architecture instructions in the
+ Graphics group, including floating-point select.
+
+ The `-mmfcrf' option allows GCC to generate the move from
+ condition register field instruction implemented on the POWER4
+ processor and other processors that support the PowerPC V2.01
+ architecture. The `-mpopcntb' option allows GCC to generate the
+ popcount and double precision FP reciprocal estimate instruction
+ implemented on the POWER5 processor and other processors that
+ support the PowerPC V2.02 architecture. The `-mfprnd' option
+ allows GCC to generate the FP round to integer instructions
+ implemented on the POWER5+ processor and other processors that
+ support the PowerPC V2.03 architecture. The `-mcmpb' option
+ allows GCC to generate the compare bytes instruction implemented
+ on the POWER6 processor and other processors that support the
+ PowerPC V2.05 architecture. The `-mmfpgpr' option allows GCC to
+ generate the FP move to/from general purpose register instructions
+ implemented on the POWER6X processor and other processors that
+ support the extended PowerPC V2.05 architecture. The `-mhard-dfp'
+ option allows GCC to generate the decimal floating point
+ instructions implemented on some POWER processors.
+
+ The `-mpowerpc64' option allows GCC to generate the additional
+ 64-bit instructions that are found in the full PowerPC64
+ architecture and to treat GPRs as 64-bit, doubleword quantities.
+ GCC defaults to `-mno-powerpc64'.
+
+ If you specify both `-mno-power' and `-mno-powerpc', GCC will use
+ only the instructions in the common subset of both architectures
+ plus some special AIX common-mode calls, and will not use the MQ
+ register. Specifying both `-mpower' and `-mpowerpc' permits GCC
+ to use any instruction from either architecture and to allow use
+ of the MQ register; specify this for the Motorola MPC601.
+
+`-mnew-mnemonics'
+`-mold-mnemonics'
+ Select which mnemonics to use in the generated assembler code.
+ With `-mnew-mnemonics', GCC uses the assembler mnemonics defined
+ for the PowerPC architecture. With `-mold-mnemonics' it uses the
+ assembler mnemonics defined for the POWER architecture.
+ Instructions defined in only one architecture have only one
+ mnemonic; GCC uses that mnemonic irrespective of which of these
+ options is specified.
+
+ GCC defaults to the mnemonics appropriate for the architecture in
+ use. Specifying `-mcpu=CPU_TYPE' sometimes overrides the value of
+ these option. Unless you are building a cross-compiler, you
+ should normally not specify either `-mnew-mnemonics' or
+ `-mold-mnemonics', but should instead accept the default.
+
+`-mcpu=CPU_TYPE'
+ Set architecture type, register usage, choice of mnemonics, and
+ instruction scheduling parameters for machine type CPU_TYPE.
+ Supported values for CPU_TYPE are `401', `403', `405', `405fp',
+ `440', `440fp', `464', `464fp', `505', `601', `602', `603',
+ `603e', `604', `604e', `620', `630', `740', `7400', `7450', `750',
+ `801', `821', `823', `860', `970', `8540', `e300c2', `e300c3',
+ `e500mc', `ec603e', `G3', `G4', `G5', `power', `power2', `power3',
+ `power4', `power5', `power5+', `power6', `power6x', `power7'
+ `common', `powerpc', `powerpc64', `rios', `rios1', `rios2', `rsc',
+ and `rs64'.
+
+ `-mcpu=common' selects a completely generic processor. Code
+ generated under this option will run on any POWER or PowerPC
+ processor. GCC will use only the instructions in the common
+ subset of both architectures, and will not use the MQ register.
+ GCC assumes a generic processor model for scheduling purposes.
+
+ `-mcpu=power', `-mcpu=power2', `-mcpu=powerpc', and
+ `-mcpu=powerpc64' specify generic POWER, POWER2, pure 32-bit
+ PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
+ types, with an appropriate, generic processor model assumed for
+ scheduling purposes.
+
+ The other options specify a specific processor. Code generated
+ under those options will run best on that processor, and may not
+ run at all on others.
+
+ The `-mcpu' options automatically enable or disable the following
+ options:
+
+ -maltivec -mfprnd -mhard-float -mmfcrf -mmultiple
+ -mnew-mnemonics -mpopcntb -mpower -mpower2 -mpowerpc64
+ -mpowerpc-gpopt -mpowerpc-gfxopt -msingle-float -mdouble-float
+ -msimple-fpu -mstring -mmulhw -mdlmzb -mmfpgpr
+
+ The particular options set for any particular CPU will vary between
+ compiler versions, depending on what setting seems to produce
+ optimal code for that CPU; it doesn't necessarily reflect the
+ actual hardware's capabilities. If you wish to set an individual
+ option to a particular value, you may specify it after the `-mcpu'
+ option, like `-mcpu=970 -mno-altivec'.
+
+ On AIX, the `-maltivec' and `-mpowerpc64' options are not enabled
+ or disabled by the `-mcpu' option at present because AIX does not
+ have full support for these options. You may still enable or
+ disable them individually if you're sure it'll work in your
+ environment.
+
+`-mtune=CPU_TYPE'
+ Set the instruction scheduling parameters for machine type
+ CPU_TYPE, but do not set the architecture type, register usage, or
+ choice of mnemonics, as `-mcpu=CPU_TYPE' would. The same values
+ for CPU_TYPE are used for `-mtune' as for `-mcpu'. If both are
+ specified, the code generated will use the architecture,
+ registers, and mnemonics set by `-mcpu', but the scheduling
+ parameters set by `-mtune'.
+
+`-mswdiv'
+`-mno-swdiv'
+ Generate code to compute division as reciprocal estimate and
+ iterative refinement, creating opportunities for increased
+ throughput. This feature requires: optional PowerPC Graphics
+ instruction set for single precision and FRE instruction for
+ double precision, assuming divides cannot generate user-visible
+ traps, and the domain values not include Infinities, denormals or
+ zero denominator.
+
+`-maltivec'
+`-mno-altivec'
+ Generate code that uses (does not use) AltiVec instructions, and
+ also enable the use of built-in functions that allow more direct
+ access to the AltiVec instruction set. You may also need to set
+ `-mabi=altivec' to adjust the current ABI with AltiVec ABI
+ enhancements.
+
+`-mvrsave'
+`-mno-vrsave'
+ Generate VRSAVE instructions when generating AltiVec code.
+
+`-mgen-cell-microcode'
+ Generate Cell microcode instructions
+
+`-mwarn-cell-microcode'
+ Warning when a Cell microcode instruction is going to emitted. An
+ example of a Cell microcode instruction is a variable shift.
+
+`-msecure-plt'
+ Generate code that allows ld and ld.so to build executables and
+ shared libraries with non-exec .plt and .got sections. This is a
+ PowerPC 32-bit SYSV ABI option.
+
+`-mbss-plt'
+ Generate code that uses a BSS .plt section that ld.so fills in, and
+ requires .plt and .got sections that are both writable and
+ executable. This is a PowerPC 32-bit SYSV ABI option.
+
+`-misel'
+`-mno-isel'
+ This switch enables or disables the generation of ISEL
+ instructions.
+
+`-misel=YES/NO'
+ This switch has been deprecated. Use `-misel' and `-mno-isel'
+ instead.
+
+`-mspe'
+`-mno-spe'
+ This switch enables or disables the generation of SPE simd
+ instructions.
+
+`-mpaired'
+`-mno-paired'
+ This switch enables or disables the generation of PAIRED simd
+ instructions.
+
+`-mspe=YES/NO'
+ This option has been deprecated. Use `-mspe' and `-mno-spe'
+ instead.
+
+`-mfloat-gprs=YES/SINGLE/DOUBLE/NO'
+`-mfloat-gprs'
+ This switch enables or disables the generation of floating point
+ operations on the general purpose registers for architectures that
+ support it.
+
+ The argument YES or SINGLE enables the use of single-precision
+ floating point operations.
+
+ The argument DOUBLE enables the use of single and double-precision
+ floating point operations.
+
+ The argument NO disables floating point operations on the general
+ purpose registers.
+
+ This option is currently only available on the MPC854x.
+
+`-m32'
+`-m64'
+ Generate code for 32-bit or 64-bit environments of Darwin and SVR4
+ targets (including GNU/Linux). The 32-bit environment sets int,
+ long and pointer to 32 bits and generates code that runs on any
+ PowerPC variant. The 64-bit environment sets int to 32 bits and
+ long and pointer to 64 bits, and generates code for PowerPC64, as
+ for `-mpowerpc64'.
+
+`-mfull-toc'
+`-mno-fp-in-toc'
+`-mno-sum-in-toc'
+`-mminimal-toc'
+ Modify generation of the TOC (Table Of Contents), which is created
+ for every executable file. The `-mfull-toc' option is selected by
+ default. In that case, GCC will allocate at least one TOC entry
+ for each unique non-automatic variable reference in your program.
+ GCC will also place floating-point constants in the TOC. However,
+ only 16,384 entries are available in the TOC.
+
+ If you receive a linker error message that saying you have
+ overflowed the available TOC space, you can reduce the amount of
+ TOC space used with the `-mno-fp-in-toc' and `-mno-sum-in-toc'
+ options. `-mno-fp-in-toc' prevents GCC from putting floating-point
+ constants in the TOC and `-mno-sum-in-toc' forces GCC to generate
+ code to calculate the sum of an address and a constant at run-time
+ instead of putting that sum into the TOC. You may specify one or
+ both of these options. Each causes GCC to produce very slightly
+ slower and larger code at the expense of conserving TOC space.
+
+ If you still run out of space in the TOC even when you specify
+ both of these options, specify `-mminimal-toc' instead. This
+ option causes GCC to make only one TOC entry for every file. When
+ you specify this option, GCC will produce code that is slower and
+ larger but which uses extremely little TOC space. You may wish to
+ use this option only on files that contain less frequently
+ executed code.
+
+`-maix64'
+`-maix32'
+ Enable 64-bit AIX ABI and calling convention: 64-bit pointers,
+ 64-bit `long' type, and the infrastructure needed to support them.
+ Specifying `-maix64' implies `-mpowerpc64' and `-mpowerpc', while
+ `-maix32' disables the 64-bit ABI and implies `-mno-powerpc64'.
+ GCC defaults to `-maix32'.
+
+`-mxl-compat'
+`-mno-xl-compat'
+ Produce code that conforms more closely to IBM XL compiler
+ semantics when using AIX-compatible ABI. Pass floating-point
+ arguments to prototyped functions beyond the register save area
+ (RSA) on the stack in addition to argument FPRs. Do not assume
+ that most significant double in 128-bit long double value is
+ properly rounded when comparing values and converting to double.
+ Use XL symbol names for long double support routines.
+
+ The AIX calling convention was extended but not initially
+ documented to handle an obscure K&R C case of calling a function
+ that takes the address of its arguments with fewer arguments than
+ declared. IBM XL compilers access floating point arguments which
+ do not fit in the RSA from the stack when a subroutine is compiled
+ without optimization. Because always storing floating-point
+ arguments on the stack is inefficient and rarely needed, this
+ option is not enabled by default and only is necessary when
+ calling subroutines compiled by IBM XL compilers without
+ optimization.
+
+`-mpe'
+ Support "IBM RS/6000 SP" "Parallel Environment" (PE). Link an
+ application written to use message passing with special startup
+ code to enable the application to run. The system must have PE
+ installed in the standard location (`/usr/lpp/ppe.poe/'), or the
+ `specs' file must be overridden with the `-specs=' option to
+ specify the appropriate directory location. The Parallel
+ Environment does not support threads, so the `-mpe' option and the
+ `-pthread' option are incompatible.
+
+`-malign-natural'
+`-malign-power'
+ On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
+ `-malign-natural' overrides the ABI-defined alignment of larger
+ types, such as floating-point doubles, on their natural size-based
+ boundary. The option `-malign-power' instructs GCC to follow the
+ ABI-specified alignment rules. GCC defaults to the standard
+ alignment defined in the ABI.
+
+ On 64-bit Darwin, natural alignment is the default, and
+ `-malign-power' is not supported.
+
+`-msoft-float'
+`-mhard-float'
+ Generate code that does not use (uses) the floating-point register
+ set. Software floating point emulation is provided if you use the
+ `-msoft-float' option, and pass the option to GCC when linking.
+
+`-msingle-float'
+`-mdouble-float'
+ Generate code for single or double-precision floating point
+ operations. `-mdouble-float' implies `-msingle-float'.
+
+`-msimple-fpu'
+ Do not generate sqrt and div instructions for hardware floating
+ point unit.
+
+`-mfpu'
+ Specify type of floating point unit. Valid values are SP_LITE
+ (equivalent to -msingle-float -msimple-fpu), DP_LITE (equivalent
+ to -mdouble-float -msimple-fpu), SP_FULL (equivalent to
+ -msingle-float), and DP_FULL (equivalent to -mdouble-float).
+
+`-mxilinx-fpu'
+ Perform optimizations for floating point unit on Xilinx PPC
+ 405/440.
+
+`-mmultiple'
+`-mno-multiple'
+ Generate code that uses (does not use) the load multiple word
+ instructions and the store multiple word instructions. These
+ instructions are generated by default on POWER systems, and not
+ generated on PowerPC systems. Do not use `-mmultiple' on little
+ endian PowerPC systems, since those instructions do not work when
+ the processor is in little endian mode. The exceptions are PPC740
+ and PPC750 which permit the instructions usage in little endian
+ mode.
+
+`-mstring'
+`-mno-string'
+ Generate code that uses (does not use) the load string instructions
+ and the store string word instructions to save multiple registers
+ and do small block moves. These instructions are generated by
+ default on POWER systems, and not generated on PowerPC systems.
+ Do not use `-mstring' on little endian PowerPC systems, since those
+ instructions do not work when the processor is in little endian
+ mode. The exceptions are PPC740 and PPC750 which permit the
+ instructions usage in little endian mode.
+
+`-mupdate'
+`-mno-update'
+ Generate code that uses (does not use) the load or store
+ instructions that update the base register to the address of the
+ calculated memory location. These instructions are generated by
+ default. If you use `-mno-update', there is a small window
+ between the time that the stack pointer is updated and the address
+ of the previous frame is stored, which means code that walks the
+ stack frame across interrupts or signals may get corrupted data.
+
+`-mavoid-indexed-addresses'
+
+`-mno-avoid-indexed-addresses'
+ Generate code that tries to avoid (not avoid) the use of indexed
+ load or store instructions. These instructions can incur a
+ performance penalty on Power6 processors in certain situations,
+ such as when stepping through large arrays that cross a 16M
+ boundary. This option is enabled by default when targetting
+ Power6 and disabled otherwise.
+
+`-mfused-madd'
+`-mno-fused-madd'
+ Generate code that uses (does not use) the floating point multiply
+ and accumulate instructions. These instructions are generated by
+ default if hardware floating is used.
+
+`-mmulhw'
+`-mno-mulhw'
+ Generate code that uses (does not use) the half-word multiply and
+ multiply-accumulate instructions on the IBM 405, 440 and 464
+ processors. These instructions are generated by default when
+ targetting those processors.
+
+`-mdlmzb'
+`-mno-dlmzb'
+ Generate code that uses (does not use) the string-search `dlmzb'
+ instruction on the IBM 405, 440 and 464 processors. This
+ instruction is generated by default when targetting those
+ processors.
+
+`-mno-bit-align'
+`-mbit-align'
+ On System V.4 and embedded PowerPC systems do not (do) force
+ structures and unions that contain bit-fields to be aligned to the
+ base type of the bit-field.
+
+ For example, by default a structure containing nothing but 8
+ `unsigned' bit-fields of length 1 would be aligned to a 4 byte
+ boundary and have a size of 4 bytes. By using `-mno-bit-align',
+ the structure would be aligned to a 1 byte boundary and be one
+ byte in size.
+
+`-mno-strict-align'
+`-mstrict-align'
+ On System V.4 and embedded PowerPC systems do not (do) assume that
+ unaligned memory references will be handled by the system.
+
+`-mrelocatable'
+`-mno-relocatable'
+ On embedded PowerPC systems generate code that allows (does not
+ allow) the program to be relocated to a different address at
+ runtime. If you use `-mrelocatable' on any module, all objects
+ linked together must be compiled with `-mrelocatable' or
+ `-mrelocatable-lib'.
+
+`-mrelocatable-lib'
+`-mno-relocatable-lib'
+ On embedded PowerPC systems generate code that allows (does not
+ allow) the program to be relocated to a different address at
+ runtime. Modules compiled with `-mrelocatable-lib' can be linked
+ with either modules compiled without `-mrelocatable' and
+ `-mrelocatable-lib' or with modules compiled with the
+ `-mrelocatable' options.
+
+`-mno-toc'
+`-mtoc'
+ On System V.4 and embedded PowerPC systems do not (do) assume that
+ register 2 contains a pointer to a global area pointing to the
+ addresses used in the program.
+
+`-mlittle'
+`-mlittle-endian'
+ On System V.4 and embedded PowerPC systems compile code for the
+ processor in little endian mode. The `-mlittle-endian' option is
+ the same as `-mlittle'.
+
+`-mbig'
+`-mbig-endian'
+ On System V.4 and embedded PowerPC systems compile code for the
+ processor in big endian mode. The `-mbig-endian' option is the
+ same as `-mbig'.
+
+`-mdynamic-no-pic'
+ On Darwin and Mac OS X systems, compile code so that it is not
+ relocatable, but that its external references are relocatable. The
+ resulting code is suitable for applications, but not shared
+ libraries.
+
+`-mprioritize-restricted-insns=PRIORITY'
+ This option controls the priority that is assigned to
+ dispatch-slot restricted instructions during the second scheduling
+ pass. The argument PRIORITY takes the value 0/1/2 to assign
+ NO/HIGHEST/SECOND-HIGHEST priority to dispatch slot restricted
+ instructions.
+
+`-msched-costly-dep=DEPENDENCE_TYPE'
+ This option controls which dependences are considered costly by
+ the target during instruction scheduling. The argument
+ DEPENDENCE_TYPE takes one of the following values: NO: no
+ dependence is costly, ALL: all dependences are costly,
+ TRUE_STORE_TO_LOAD: a true dependence from store to load is costly,
+ STORE_TO_LOAD: any dependence from store to load is costly,
+ NUMBER: any dependence which latency >= NUMBER is costly.
+
+`-minsert-sched-nops=SCHEME'
+ This option controls which nop insertion scheme will be used during
+ the second scheduling pass. The argument SCHEME takes one of the
+ following values: NO: Don't insert nops. PAD: Pad with nops any
+ dispatch group which has vacant issue slots, according to the
+ scheduler's grouping. REGROUP_EXACT: Insert nops to force costly
+ dependent insns into separate groups. Insert exactly as many nops
+ as needed to force an insn to a new group, according to the
+ estimated processor grouping. NUMBER: Insert nops to force costly
+ dependent insns into separate groups. Insert NUMBER nops to force
+ an insn to a new group.
+
+`-mcall-sysv'
+ On System V.4 and embedded PowerPC systems compile code using
+ calling conventions that adheres to the March 1995 draft of the
+ System V Application Binary Interface, PowerPC processor
+ supplement. This is the default unless you configured GCC using
+ `powerpc-*-eabiaix'.
+
+`-mcall-sysv-eabi'
+ Specify both `-mcall-sysv' and `-meabi' options.
+
+`-mcall-sysv-noeabi'
+ Specify both `-mcall-sysv' and `-mno-eabi' options.
+
+`-mcall-solaris'
+ On System V.4 and embedded PowerPC systems compile code for the
+ Solaris operating system.
+
+`-mcall-linux'
+ On System V.4 and embedded PowerPC systems compile code for the
+ Linux-based GNU system.
+
+`-mcall-gnu'
+ On System V.4 and embedded PowerPC systems compile code for the
+ Hurd-based GNU system.
+
+`-mcall-netbsd'
+ On System V.4 and embedded PowerPC systems compile code for the
+ NetBSD operating system.
+
+`-maix-struct-return'
+ Return all structures in memory (as specified by the AIX ABI).
+
+`-msvr4-struct-return'
+ Return structures smaller than 8 bytes in registers (as specified
+ by the SVR4 ABI).
+
+`-mabi=ABI-TYPE'
+ Extend the current ABI with a particular extension, or remove such
+ extension. Valid values are ALTIVEC, NO-ALTIVEC, SPE, NO-SPE,
+ IBMLONGDOUBLE, IEEELONGDOUBLE.
+
+`-mabi=spe'
+ Extend the current ABI with SPE ABI extensions. This does not
+ change the default ABI, instead it adds the SPE ABI extensions to
+ the current ABI.
+
+`-mabi=no-spe'
+ Disable Booke SPE ABI extensions for the current ABI.
+
+`-mabi=ibmlongdouble'
+ Change the current ABI to use IBM extended precision long double.
+ This is a PowerPC 32-bit SYSV ABI option.
+
+`-mabi=ieeelongdouble'
+ Change the current ABI to use IEEE extended precision long double.
+ This is a PowerPC 32-bit Linux ABI option.
+
+`-mprototype'
+`-mno-prototype'
+ On System V.4 and embedded PowerPC systems assume that all calls to
+ variable argument functions are properly prototyped. Otherwise,
+ the compiler must insert an instruction before every non
+ prototyped call to set or clear bit 6 of the condition code
+ register (CR) to indicate whether floating point values were
+ passed in the floating point registers in case the function takes
+ a variable arguments. With `-mprototype', only calls to
+ prototyped variable argument functions will set or clear the bit.
+
+`-msim'
+ On embedded PowerPC systems, assume that the startup module is
+ called `sim-crt0.o' and that the standard C libraries are
+ `libsim.a' and `libc.a'. This is the default for
+ `powerpc-*-eabisim' configurations.
+
+`-mmvme'
+ On embedded PowerPC systems, assume that the startup module is
+ called `crt0.o' and the standard C libraries are `libmvme.a' and
+ `libc.a'.
+
+`-mads'
+ On embedded PowerPC systems, assume that the startup module is
+ called `crt0.o' and the standard C libraries are `libads.a' and
+ `libc.a'.
+
+`-myellowknife'
+ On embedded PowerPC systems, assume that the startup module is
+ called `crt0.o' and the standard C libraries are `libyk.a' and
+ `libc.a'.
+
+`-mvxworks'
+ On System V.4 and embedded PowerPC systems, specify that you are
+ compiling for a VxWorks system.
+
+`-memb'
+ On embedded PowerPC systems, set the PPC_EMB bit in the ELF flags
+ header to indicate that `eabi' extended relocations are used.
+
+`-meabi'
+`-mno-eabi'
+ On System V.4 and embedded PowerPC systems do (do not) adhere to
+ the Embedded Applications Binary Interface (eabi) which is a set of
+ modifications to the System V.4 specifications. Selecting `-meabi'
+ means that the stack is aligned to an 8 byte boundary, a function
+ `__eabi' is called to from `main' to set up the eabi environment,
+ and the `-msdata' option can use both `r2' and `r13' to point to
+ two separate small data areas. Selecting `-mno-eabi' means that
+ the stack is aligned to a 16 byte boundary, do not call an
+ initialization function from `main', and the `-msdata' option will
+ only use `r13' to point to a single small data area. The `-meabi'
+ option is on by default if you configured GCC using one of the
+ `powerpc*-*-eabi*' options.
+
+`-msdata=eabi'
+ On System V.4 and embedded PowerPC systems, put small initialized
+ `const' global and static data in the `.sdata2' section, which is
+ pointed to by register `r2'. Put small initialized non-`const'
+ global and static data in the `.sdata' section, which is pointed
+ to by register `r13'. Put small uninitialized global and static
+ data in the `.sbss' section, which is adjacent to the `.sdata'
+ section. The `-msdata=eabi' option is incompatible with the
+ `-mrelocatable' option. The `-msdata=eabi' option also sets the
+ `-memb' option.
+
+`-msdata=sysv'
+ On System V.4 and embedded PowerPC systems, put small global and
+ static data in the `.sdata' section, which is pointed to by
+ register `r13'. Put small uninitialized global and static data in
+ the `.sbss' section, which is adjacent to the `.sdata' section.
+ The `-msdata=sysv' option is incompatible with the `-mrelocatable'
+ option.
+
+`-msdata=default'
+`-msdata'
+ On System V.4 and embedded PowerPC systems, if `-meabi' is used,
+ compile code the same as `-msdata=eabi', otherwise compile code the
+ same as `-msdata=sysv'.
+
+`-msdata=data'
+ On System V.4 and embedded PowerPC systems, put small global data
+ in the `.sdata' section. Put small uninitialized global data in
+ the `.sbss' section. Do not use register `r13' to address small
+ data however. This is the default behavior unless other `-msdata'
+ options are used.
+
+`-msdata=none'
+`-mno-sdata'
+ On embedded PowerPC systems, put all initialized global and static
+ data in the `.data' section, and all uninitialized data in the
+ `.bss' section.
+
+`-G NUM'
+ On embedded PowerPC systems, put global and static items less than
+ or equal to NUM bytes into the small data or bss sections instead
+ of the normal data or bss section. By default, NUM is 8. The `-G
+ NUM' switch is also passed to the linker. All modules should be
+ compiled with the same `-G NUM' value.
+
+`-mregnames'
+`-mno-regnames'
+ On System V.4 and embedded PowerPC systems do (do not) emit
+ register names in the assembly language output using symbolic
+ forms.
+
+`-mlongcall'
+`-mno-longcall'
+ By default assume that all calls are far away so that a longer more
+ expensive calling sequence is required. This is required for calls
+ further than 32 megabytes (33,554,432 bytes) from the current
+ location. A short call will be generated if the compiler knows
+ the call cannot be that far away. This setting can be overridden
+ by the `shortcall' function attribute, or by `#pragma longcall(0)'.
+
+ Some linkers are capable of detecting out-of-range calls and
+ generating glue code on the fly. On these systems, long calls are
+ unnecessary and generate slower code. As of this writing, the AIX
+ linker can do this, as can the GNU linker for PowerPC/64. It is
+ planned to add this feature to the GNU linker for 32-bit PowerPC
+ systems as well.
+
+ On Darwin/PPC systems, `#pragma longcall' will generate "jbsr
+ callee, L42", plus a "branch island" (glue code). The two target
+ addresses represent the callee and the "branch island". The
+ Darwin/PPC linker will prefer the first address and generate a "bl
+ callee" if the PPC "bl" instruction will reach the callee directly;
+ otherwise, the linker will generate "bl L42" to call the "branch
+ island". The "branch island" is appended to the body of the
+ calling function; it computes the full 32-bit address of the callee
+ and jumps to it.
+
+ On Mach-O (Darwin) systems, this option directs the compiler emit
+ to the glue for every direct call, and the Darwin linker decides
+ whether to use or discard it.
+
+ In the future, we may cause GCC to ignore all longcall
+ specifications when the linker is known to generate glue.
+
+`-pthread'
+ Adds support for multithreading with the "pthreads" library. This
+ option sets flags for both the preprocessor and linker.
+
+
+
+File: gcc.info, Node: S/390 and zSeries Options, Next: Score Options, Prev: RS/6000 and PowerPC Options, Up: Submodel Options
+
+3.17.29 S/390 and zSeries Options
+---------------------------------
+
+These are the `-m' options defined for the S/390 and zSeries
+architecture.
+
+`-mhard-float'
+`-msoft-float'
+ Use (do not use) the hardware floating-point instructions and
+ registers for floating-point operations. When `-msoft-float' is
+ specified, functions in `libgcc.a' will be used to perform
+ floating-point operations. When `-mhard-float' is specified, the
+ compiler generates IEEE floating-point instructions. This is the
+ default.
+
+`-mhard-dfp'
+`-mno-hard-dfp'
+ Use (do not use) the hardware decimal-floating-point instructions
+ for decimal-floating-point operations. When `-mno-hard-dfp' is
+ specified, functions in `libgcc.a' will be used to perform
+ decimal-floating-point operations. When `-mhard-dfp' is
+ specified, the compiler generates decimal-floating-point hardware
+ instructions. This is the default for `-march=z9-ec' or higher.
+
+`-mlong-double-64'
+`-mlong-double-128'
+ These switches control the size of `long double' type. A size of
+ 64bit makes the `long double' type equivalent to the `double'
+ type. This is the default.
+
+`-mbackchain'
+`-mno-backchain'
+ Store (do not store) the address of the caller's frame as
+ backchain pointer into the callee's stack frame. A backchain may
+ be needed to allow debugging using tools that do not understand
+ DWARF-2 call frame information. When `-mno-packed-stack' is in
+ effect, the backchain pointer is stored at the bottom of the stack
+ frame; when `-mpacked-stack' is in effect, the backchain is placed
+ into the topmost word of the 96/160 byte register save area.
+
+ In general, code compiled with `-mbackchain' is call-compatible
+ with code compiled with `-mmo-backchain'; however, use of the
+ backchain for debugging purposes usually requires that the whole
+ binary is built with `-mbackchain'. Note that the combination of
+ `-mbackchain', `-mpacked-stack' and `-mhard-float' is not
+ supported. In order to build a linux kernel use `-msoft-float'.
+
+ The default is to not maintain the backchain.
+
+`-mpacked-stack'
+`-mno-packed-stack'
+ Use (do not use) the packed stack layout. When
+ `-mno-packed-stack' is specified, the compiler uses the all fields
+ of the 96/160 byte register save area only for their default
+ purpose; unused fields still take up stack space. When
+ `-mpacked-stack' is specified, register save slots are densely
+ packed at the top of the register save area; unused space is
+ reused for other purposes, allowing for more efficient use of the
+ available stack space. However, when `-mbackchain' is also in
+ effect, the topmost word of the save area is always used to store
+ the backchain, and the return address register is always saved two
+ words below the backchain.
+
+ As long as the stack frame backchain is not used, code generated
+ with `-mpacked-stack' is call-compatible with code generated with
+ `-mno-packed-stack'. Note that some non-FSF releases of GCC 2.95
+ for S/390 or zSeries generated code that uses the stack frame
+ backchain at run time, not just for debugging purposes. Such code
+ is not call-compatible with code compiled with `-mpacked-stack'.
+ Also, note that the combination of `-mbackchain', `-mpacked-stack'
+ and `-mhard-float' is not supported. In order to build a linux
+ kernel use `-msoft-float'.
+
+ The default is to not use the packed stack layout.
+
+`-msmall-exec'
+`-mno-small-exec'
+ Generate (or do not generate) code using the `bras' instruction to
+ do subroutine calls. This only works reliably if the total
+ executable size does not exceed 64k. The default is to use the
+ `basr' instruction instead, which does not have this limitation.
+
+`-m64'
+`-m31'
+ When `-m31' is specified, generate code compliant to the GNU/Linux
+ for S/390 ABI. When `-m64' is specified, generate code compliant
+ to the GNU/Linux for zSeries ABI. This allows GCC in particular
+ to generate 64-bit instructions. For the `s390' targets, the
+ default is `-m31', while the `s390x' targets default to `-m64'.
+
+`-mzarch'
+`-mesa'
+ When `-mzarch' is specified, generate code using the instructions
+ available on z/Architecture. When `-mesa' is specified, generate
+ code using the instructions available on ESA/390. Note that
+ `-mesa' is not possible with `-m64'. When generating code
+ compliant to the GNU/Linux for S/390 ABI, the default is `-mesa'.
+ When generating code compliant to the GNU/Linux for zSeries ABI,
+ the default is `-mzarch'.
+
+`-mmvcle'
+`-mno-mvcle'
+ Generate (or do not generate) code using the `mvcle' instruction
+ to perform block moves. When `-mno-mvcle' is specified, use a
+ `mvc' loop instead. This is the default unless optimizing for
+ size.
+
+`-mdebug'
+`-mno-debug'
+ Print (or do not print) additional debug information when
+ compiling. The default is to not print debug information.
+
+`-march=CPU-TYPE'
+ Generate code that will run on CPU-TYPE, which is the name of a
+ system representing a certain processor type. Possible values for
+ CPU-TYPE are `g5', `g6', `z900', `z990', `z9-109', `z9-ec' and
+ `z10'. When generating code using the instructions available on
+ z/Architecture, the default is `-march=z900'. Otherwise, the
+ default is `-march=g5'.
+
+`-mtune=CPU-TYPE'
+ Tune to CPU-TYPE everything applicable about the generated code,
+ except for the ABI and the set of available instructions. The
+ list of CPU-TYPE values is the same as for `-march'. The default
+ is the value used for `-march'.
+
+`-mtpf-trace'
+`-mno-tpf-trace'
+ Generate code that adds (does not add) in TPF OS specific branches
+ to trace routines in the operating system. This option is off by
+ default, even when compiling for the TPF OS.
+
+`-mfused-madd'
+`-mno-fused-madd'
+ Generate code that uses (does not use) the floating point multiply
+ and accumulate instructions. These instructions are generated by
+ default if hardware floating point is used.
+
+`-mwarn-framesize=FRAMESIZE'
+ Emit a warning if the current function exceeds the given frame
+ size. Because this is a compile time check it doesn't need to be
+ a real problem when the program runs. It is intended to identify
+ functions which most probably cause a stack overflow. It is
+ useful to be used in an environment with limited stack size e.g.
+ the linux kernel.
+
+`-mwarn-dynamicstack'
+ Emit a warning if the function calls alloca or uses dynamically
+ sized arrays. This is generally a bad idea with a limited stack
+ size.
+
+`-mstack-guard=STACK-GUARD'
+`-mstack-size=STACK-SIZE'
+ If these options are provided the s390 back end emits additional
+ instructions in the function prologue which trigger a trap if the
+ stack size is STACK-GUARD bytes above the STACK-SIZE (remember
+ that the stack on s390 grows downward). If the STACK-GUARD option
+ is omitted the smallest power of 2 larger than the frame size of
+ the compiled function is chosen. These options are intended to be
+ used to help debugging stack overflow problems. The additionally
+ emitted code causes only little overhead and hence can also be
+ used in production like systems without greater performance
+ degradation. The given values have to be exact powers of 2 and
+ STACK-SIZE has to be greater than STACK-GUARD without exceeding
+ 64k. In order to be efficient the extra code makes the assumption
+ that the stack starts at an address aligned to the value given by
+ STACK-SIZE. The STACK-GUARD option can only be used in
+ conjunction with STACK-SIZE.
+
+
+File: gcc.info, Node: Score Options, Next: SH Options, Prev: S/390 and zSeries Options, Up: Submodel Options
+
+3.17.30 Score Options
+---------------------
+
+These options are defined for Score implementations:
+
+`-meb'
+ Compile code for big endian mode. This is the default.
+
+`-mel'
+ Compile code for little endian mode.
+
+`-mnhwloop'
+ Disable generate bcnz instruction.
+
+`-muls'
+ Enable generate unaligned load and store instruction.
+
+`-mmac'
+ Enable the use of multiply-accumulate instructions. Disabled by
+ default.
+
+`-mscore5'
+ Specify the SCORE5 as the target architecture.
+
+`-mscore5u'
+ Specify the SCORE5U of the target architecture.
+
+`-mscore7'
+ Specify the SCORE7 as the target architecture. This is the default.
+
+`-mscore7d'
+ Specify the SCORE7D as the target architecture.
+
+
+File: gcc.info, Node: SH Options, Next: SPARC Options, Prev: Score Options, Up: Submodel Options
+
+3.17.31 SH Options
+------------------
+
+These `-m' options are defined for the SH implementations:
+
+`-m1'
+ Generate code for the SH1.
+
+`-m2'
+ Generate code for the SH2.
+
+`-m2e'
+ Generate code for the SH2e.
+
+`-m3'
+ Generate code for the SH3.
+
+`-m3e'
+ Generate code for the SH3e.
+
+`-m4-nofpu'
+ Generate code for the SH4 without a floating-point unit.
+
+`-m4-single-only'
+ Generate code for the SH4 with a floating-point unit that only
+ supports single-precision arithmetic.
+
+`-m4-single'
+ Generate code for the SH4 assuming the floating-point unit is in
+ single-precision mode by default.
+
+`-m4'
+ Generate code for the SH4.
+
+`-m4a-nofpu'
+ Generate code for the SH4al-dsp, or for a SH4a in such a way that
+ the floating-point unit is not used.
+
+`-m4a-single-only'
+ Generate code for the SH4a, in such a way that no double-precision
+ floating point operations are used.
+
+`-m4a-single'
+ Generate code for the SH4a assuming the floating-point unit is in
+ single-precision mode by default.
+
+`-m4a'
+ Generate code for the SH4a.
+
+`-m4al'
+ Same as `-m4a-nofpu', except that it implicitly passes `-dsp' to
+ the assembler. GCC doesn't generate any DSP instructions at the
+ moment.
+
+`-mb'
+ Compile code for the processor in big endian mode.
+
+`-ml'
+ Compile code for the processor in little endian mode.
+
+`-mdalign'
+ Align doubles at 64-bit boundaries. Note that this changes the
+ calling conventions, and thus some functions from the standard C
+ library will not work unless you recompile it first with
+ `-mdalign'.
+
+`-mrelax'
+ Shorten some address references at link time, when possible; uses
+ the linker option `-relax'.
+
+`-mbigtable'
+ Use 32-bit offsets in `switch' tables. The default is to use
+ 16-bit offsets.
+
+`-mbitops'
+ Enable the use of bit manipulation instructions on SH2A.
+
+`-mfmovd'
+ Enable the use of the instruction `fmovd'.
+
+`-mhitachi'
+ Comply with the calling conventions defined by Renesas.
+
+`-mrenesas'
+ Comply with the calling conventions defined by Renesas.
+
+`-mno-renesas'
+ Comply with the calling conventions defined for GCC before the
+ Renesas conventions were available. This option is the default
+ for all targets of the SH toolchain except for `sh-symbianelf'.
+
+`-mnomacsave'
+ Mark the `MAC' register as call-clobbered, even if `-mhitachi' is
+ given.
+
+`-mieee'
+ Increase IEEE-compliance of floating-point code. At the moment,
+ this is equivalent to `-fno-finite-math-only'. When generating 16
+ bit SH opcodes, getting IEEE-conforming results for comparisons of
+ NANs / infinities incurs extra overhead in every floating point
+ comparison, therefore the default is set to `-ffinite-math-only'.
+
+`-minline-ic_invalidate'
+ Inline code to invalidate instruction cache entries after setting
+ up nested function trampolines. This option has no effect if
+ -musermode is in effect and the selected code generation option
+ (e.g. -m4) does not allow the use of the icbi instruction. If the
+ selected code generation option does not allow the use of the icbi
+ instruction, and -musermode is not in effect, the inlined code will
+ manipulate the instruction cache address array directly with an
+ associative write. This not only requires privileged mode, but it
+ will also fail if the cache line had been mapped via the TLB and
+ has become unmapped.
+
+`-misize'
+ Dump instruction size and location in the assembly code.
+
+`-mpadstruct'
+ This option is deprecated. It pads structures to multiple of 4
+ bytes, which is incompatible with the SH ABI.
+
+`-mspace'
+ Optimize for space instead of speed. Implied by `-Os'.
+
+`-mprefergot'
+ When generating position-independent code, emit function calls
+ using the Global Offset Table instead of the Procedure Linkage
+ Table.
+
+`-musermode'
+ Don't generate privileged mode only code; implies
+ -mno-inline-ic_invalidate if the inlined code would not work in
+ user mode. This is the default when the target is `sh-*-linux*'.
+
+`-multcost=NUMBER'
+ Set the cost to assume for a multiply insn.
+
+`-mdiv=STRATEGY'
+ Set the division strategy to use for SHmedia code. STRATEGY must
+ be one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l,
+ inv:call, inv:call2, inv:fp . "fp" performs the operation in
+ floating point. This has a very high latency, but needs only a
+ few instructions, so it might be a good choice if your code has
+ enough easily exploitable ILP to allow the compiler to schedule
+ the floating point instructions together with other instructions.
+ Division by zero causes a floating point exception. "inv" uses
+ integer operations to calculate the inverse of the divisor, and
+ then multiplies the dividend with the inverse. This strategy
+ allows cse and hoisting of the inverse calculation. Division by
+ zero calculates an unspecified result, but does not trap.
+ "inv:minlat" is a variant of "inv" where if no cse / hoisting
+ opportunities have been found, or if the entire operation has been
+ hoisted to the same place, the last stages of the inverse
+ calculation are intertwined with the final multiply to reduce the
+ overall latency, at the expense of using a few more instructions,
+ and thus offering fewer scheduling opportunities with other code.
+ "call" calls a library function that usually implements the
+ inv:minlat strategy. This gives high code density for
+ m5-*media-nofpu compilations. "call2" uses a different entry
+ point of the same library function, where it assumes that a
+ pointer to a lookup table has already been set up, which exposes
+ the pointer load to cse / code hoisting optimizations.
+ "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm
+ for initial code generation, but if the code stays unoptimized,
+ revert to the "call", "call2", or "fp" strategies, respectively.
+ Note that the potentially-trapping side effect of division by zero
+ is carried by a separate instruction, so it is possible that all
+ the integer instructions are hoisted out, but the marker for the
+ side effect stays where it is. A recombination to fp operations
+ or a call is not possible in that case. "inv20u" and "inv20l" are
+ variants of the "inv:minlat" strategy. In the case that the
+ inverse calculation was nor separated from the multiply, they speed
+ up division where the dividend fits into 20 bits (plus sign where
+ applicable), by inserting a test to skip a number of operations in
+ this case; this test slows down the case of larger dividends.
+ inv20u assumes the case of a such a small dividend to be unlikely,
+ and inv20l assumes it to be likely.
+
+`-mdivsi3_libfunc=NAME'
+ Set the name of the library function used for 32 bit signed
+ division to NAME. This only affect the name used in the call and
+ inv:call division strategies, and the compiler will still expect
+ the same sets of input/output/clobbered registers as if this
+ option was not present.
+
+`-mfixed-range=REGISTER-RANGE'
+ Generate code treating the given register range as fixed registers.
+ A fixed register is one that the register allocator can not use.
+ This is useful when compiling kernel code. A register range is
+ specified as two registers separated by a dash. Multiple register
+ ranges can be specified separated by a comma.
+
+`-madjust-unroll'
+ Throttle unrolling to avoid thrashing target registers. This
+ option only has an effect if the gcc code base supports the
+ TARGET_ADJUST_UNROLL_MAX target hook.
+
+`-mindexed-addressing'
+ Enable the use of the indexed addressing mode for
+ SHmedia32/SHcompact. This is only safe if the hardware and/or OS
+ implement 32 bit wrap-around semantics for the indexed addressing
+ mode. The architecture allows the implementation of processors
+ with 64 bit MMU, which the OS could use to get 32 bit addressing,
+ but since no current hardware implementation supports this or any
+ other way to make the indexed addressing mode safe to use in the
+ 32 bit ABI, the default is -mno-indexed-addressing.
+
+`-mgettrcost=NUMBER'
+ Set the cost assumed for the gettr instruction to NUMBER. The
+ default is 2 if `-mpt-fixed' is in effect, 100 otherwise.
+
+`-mpt-fixed'
+ Assume pt* instructions won't trap. This will generally generate
+ better scheduled code, but is unsafe on current hardware. The
+ current architecture definition says that ptabs and ptrel trap
+ when the target anded with 3 is 3. This has the unintentional
+ effect of making it unsafe to schedule ptabs / ptrel before a
+ branch, or hoist it out of a loop. For example,
+ __do_global_ctors, a part of libgcc that runs constructors at
+ program startup, calls functions in a list which is delimited by
+ -1. With the -mpt-fixed option, the ptabs will be done before
+ testing against -1. That means that all the constructors will be
+ run a bit quicker, but when the loop comes to the end of the list,
+ the program crashes because ptabs loads -1 into a target register.
+ Since this option is unsafe for any hardware implementing the
+ current architecture specification, the default is -mno-pt-fixed.
+ Unless the user specifies a specific cost with `-mgettrcost',
+ -mno-pt-fixed also implies `-mgettrcost=100'; this deters register
+ allocation using target registers for storing ordinary integers.
+
+`-minvalid-symbols'
+ Assume symbols might be invalid. Ordinary function symbols
+ generated by the compiler will always be valid to load with
+ movi/shori/ptabs or movi/shori/ptrel, but with assembler and/or
+ linker tricks it is possible to generate symbols that will cause
+ ptabs / ptrel to trap. This option is only meaningful when
+ `-mno-pt-fixed' is in effect. It will then prevent
+ cross-basic-block cse, hoisting and most scheduling of symbol
+ loads. The default is `-mno-invalid-symbols'.
+
+
+File: gcc.info, Node: SPARC Options, Next: SPU Options, Prev: SH Options, Up: Submodel Options
+
+3.17.32 SPARC Options
+---------------------
+
+These `-m' options are supported on the SPARC:
+
+`-mno-app-regs'
+`-mapp-regs'
+ Specify `-mapp-regs' to generate output using the global registers
+ 2 through 4, which the SPARC SVR4 ABI reserves for applications.
+ This is the default.
+
+ To be fully SVR4 ABI compliant at the cost of some performance
+ loss, specify `-mno-app-regs'. You should compile libraries and
+ system software with this option.
+
+`-mfpu'
+`-mhard-float'
+ Generate output containing floating point instructions. This is
+ the default.
+
+`-mno-fpu'
+`-msoft-float'
+ Generate output containing library calls for floating point.
+ *Warning:* the requisite libraries are not available for all SPARC
+ targets. Normally the facilities of the machine's usual C
+ compiler are used, but this cannot be done directly in
+ cross-compilation. You must make your own arrangements to provide
+ suitable library functions for cross-compilation. The embedded
+ targets `sparc-*-aout' and `sparclite-*-*' do provide software
+ floating point support.
+
+ `-msoft-float' changes the calling convention in the output file;
+ therefore, it is only useful if you compile _all_ of a program with
+ this option. In particular, you need to compile `libgcc.a', the
+ library that comes with GCC, with `-msoft-float' in order for this
+ to work.
+
+`-mhard-quad-float'
+ Generate output containing quad-word (long double) floating point
+ instructions.
+
+`-msoft-quad-float'
+ Generate output containing library calls for quad-word (long
+ double) floating point instructions. The functions called are
+ those specified in the SPARC ABI. This is the default.
+
+ As of this writing, there are no SPARC implementations that have
+ hardware support for the quad-word floating point instructions.
+ They all invoke a trap handler for one of these instructions, and
+ then the trap handler emulates the effect of the instruction.
+ Because of the trap handler overhead, this is much slower than
+ calling the ABI library routines. Thus the `-msoft-quad-float'
+ option is the default.
+
+`-mno-unaligned-doubles'
+`-munaligned-doubles'
+ Assume that doubles have 8 byte alignment. This is the default.
+
+ With `-munaligned-doubles', GCC assumes that doubles have 8 byte
+ alignment only if they are contained in another type, or if they
+ have an absolute address. Otherwise, it assumes they have 4 byte
+ alignment. Specifying this option avoids some rare compatibility
+ problems with code generated by other compilers. It is not the
+ default because it results in a performance loss, especially for
+ floating point code.
+
+`-mno-faster-structs'
+`-mfaster-structs'
+ With `-mfaster-structs', the compiler assumes that structures
+ should have 8 byte alignment. This enables the use of pairs of
+ `ldd' and `std' instructions for copies in structure assignment,
+ in place of twice as many `ld' and `st' pairs. However, the use
+ of this changed alignment directly violates the SPARC ABI. Thus,
+ it's intended only for use on targets where the developer
+ acknowledges that their resulting code will not be directly in
+ line with the rules of the ABI.
+
+`-mimpure-text'
+ `-mimpure-text', used in addition to `-shared', tells the compiler
+ to not pass `-z text' to the linker when linking a shared object.
+ Using this option, you can link position-dependent code into a
+ shared object.
+
+ `-mimpure-text' suppresses the "relocations remain against
+ allocatable but non-writable sections" linker error message.
+ However, the necessary relocations will trigger copy-on-write, and
+ the shared object is not actually shared across processes.
+ Instead of using `-mimpure-text', you should compile all source
+ code with `-fpic' or `-fPIC'.
+
+ This option is only available on SunOS and Solaris.
+
+`-mcpu=CPU_TYPE'
+ Set the instruction set, register set, and instruction scheduling
+ parameters for machine type CPU_TYPE. Supported values for
+ CPU_TYPE are `v7', `cypress', `v8', `supersparc', `sparclite',
+ `f930', `f934', `hypersparc', `sparclite86x', `sparclet',
+ `tsc701', `v9', `ultrasparc', `ultrasparc3', `niagara' and
+ `niagara2'.
+
+ Default instruction scheduling parameters are used for values that
+ select an architecture and not an implementation. These are `v7',
+ `v8', `sparclite', `sparclet', `v9'.
+
+ Here is a list of each supported architecture and their supported
+ implementations.
+
+ v7: cypress
+ v8: supersparc, hypersparc
+ sparclite: f930, f934, sparclite86x
+ sparclet: tsc701
+ v9: ultrasparc, ultrasparc3, niagara, niagara2
+
+ By default (unless configured otherwise), GCC generates code for
+ the V7 variant of the SPARC architecture. With `-mcpu=cypress',
+ the compiler additionally optimizes it for the Cypress CY7C602
+ chip, as used in the SPARCStation/SPARCServer 3xx series. This is
+ also appropriate for the older SPARCStation 1, 2, IPX etc.
+
+ With `-mcpu=v8', GCC generates code for the V8 variant of the SPARC
+ architecture. The only difference from V7 code is that the
+ compiler emits the integer multiply and integer divide
+ instructions which exist in SPARC-V8 but not in SPARC-V7. With
+ `-mcpu=supersparc', the compiler additionally optimizes it for the
+ SuperSPARC chip, as used in the SPARCStation 10, 1000 and 2000
+ series.
+
+ With `-mcpu=sparclite', GCC generates code for the SPARClite
+ variant of the SPARC architecture. This adds the integer
+ multiply, integer divide step and scan (`ffs') instructions which
+ exist in SPARClite but not in SPARC-V7. With `-mcpu=f930', the
+ compiler additionally optimizes it for the Fujitsu MB86930 chip,
+ which is the original SPARClite, with no FPU. With `-mcpu=f934',
+ the compiler additionally optimizes it for the Fujitsu MB86934
+ chip, which is the more recent SPARClite with FPU.
+
+ With `-mcpu=sparclet', GCC generates code for the SPARClet variant
+ of the SPARC architecture. This adds the integer multiply,
+ multiply/accumulate, integer divide step and scan (`ffs')
+ instructions which exist in SPARClet but not in SPARC-V7. With
+ `-mcpu=tsc701', the compiler additionally optimizes it for the
+ TEMIC SPARClet chip.
+
+ With `-mcpu=v9', GCC generates code for the V9 variant of the SPARC
+ architecture. This adds 64-bit integer and floating-point move
+ instructions, 3 additional floating-point condition code registers
+ and conditional move instructions. With `-mcpu=ultrasparc', the
+ compiler additionally optimizes it for the Sun UltraSPARC I/II/IIi
+ chips. With `-mcpu=ultrasparc3', the compiler additionally
+ optimizes it for the Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+
+ chips. With `-mcpu=niagara', the compiler additionally optimizes
+ it for Sun UltraSPARC T1 chips. With `-mcpu=niagara2', the
+ compiler additionally optimizes it for Sun UltraSPARC T2 chips.
+
+`-mtune=CPU_TYPE'
+ Set the instruction scheduling parameters for machine type
+ CPU_TYPE, but do not set the instruction set or register set that
+ the option `-mcpu=CPU_TYPE' would.
+
+ The same values for `-mcpu=CPU_TYPE' can be used for
+ `-mtune=CPU_TYPE', but the only useful values are those that
+ select a particular cpu implementation. Those are `cypress',
+ `supersparc', `hypersparc', `f930', `f934', `sparclite86x',
+ `tsc701', `ultrasparc', `ultrasparc3', `niagara', and `niagara2'.
+
+`-mv8plus'
+`-mno-v8plus'
+ With `-mv8plus', GCC generates code for the SPARC-V8+ ABI. The
+ difference from the V8 ABI is that the global and out registers are
+ considered 64-bit wide. This is enabled by default on Solaris in
+ 32-bit mode for all SPARC-V9 processors.
+
+`-mvis'
+`-mno-vis'
+ With `-mvis', GCC generates code that takes advantage of the
+ UltraSPARC Visual Instruction Set extensions. The default is
+ `-mno-vis'.
+
+ These `-m' options are supported in addition to the above on SPARC-V9
+processors in 64-bit environments:
+
+`-mlittle-endian'
+ Generate code for a processor running in little-endian mode. It
+ is only available for a few configurations and most notably not on
+ Solaris and Linux.
+
+`-m32'
+`-m64'
+ Generate code for a 32-bit or 64-bit environment. The 32-bit
+ environment sets int, long and pointer to 32 bits. The 64-bit
+ environment sets int to 32 bits and long and pointer to 64 bits.
+
+`-mcmodel=medlow'
+ Generate code for the Medium/Low code model: 64-bit addresses,
+ programs must be linked in the low 32 bits of memory. Programs
+ can be statically or dynamically linked.
+
+`-mcmodel=medmid'
+ Generate code for the Medium/Middle code model: 64-bit addresses,
+ programs must be linked in the low 44 bits of memory, the text and
+ data segments must be less than 2GB in size and the data segment
+ must be located within 2GB of the text segment.
+
+`-mcmodel=medany'
+ Generate code for the Medium/Anywhere code model: 64-bit
+ addresses, programs may be linked anywhere in memory, the text and
+ data segments must be less than 2GB in size and the data segment
+ must be located within 2GB of the text segment.
+
+`-mcmodel=embmedany'
+ Generate code for the Medium/Anywhere code model for embedded
+ systems: 64-bit addresses, the text and data segments must be less
+ than 2GB in size, both starting anywhere in memory (determined at
+ link time). The global register %g4 points to the base of the
+ data segment. Programs are statically linked and PIC is not
+ supported.
+
+`-mstack-bias'
+`-mno-stack-bias'
+ With `-mstack-bias', GCC assumes that the stack pointer, and frame
+ pointer if present, are offset by -2047 which must be added back
+ when making stack frame references. This is the default in 64-bit
+ mode. Otherwise, assume no such offset is present.
+
+ These switches are supported in addition to the above on Solaris:
+
+`-threads'
+ Add support for multithreading using the Solaris threads library.
+ This option sets flags for both the preprocessor and linker. This
+ option does not affect the thread safety of object code produced
+ by the compiler or that of libraries supplied with it.
+
+`-pthreads'
+ Add support for multithreading using the POSIX threads library.
+ This option sets flags for both the preprocessor and linker. This
+ option does not affect the thread safety of object code produced
+ by the compiler or that of libraries supplied with it.
+
+`-pthread'
+ This is a synonym for `-pthreads'.
+
+
+File: gcc.info, Node: SPU Options, Next: System V Options, Prev: SPARC Options, Up: Submodel Options
+
+3.17.33 SPU Options
+-------------------
+
+These `-m' options are supported on the SPU:
+
+`-mwarn-reloc'
+`-merror-reloc'
+ The loader for SPU does not handle dynamic relocations. By
+ default, GCC will give an error when it generates code that
+ requires a dynamic relocation. `-mno-error-reloc' disables the
+ error, `-mwarn-reloc' will generate a warning instead.
+
+`-msafe-dma'
+`-munsafe-dma'
+ Instructions which initiate or test completion of DMA must not be
+ reordered with respect to loads and stores of the memory which is
+ being accessed. Users typically address this problem using the
+ volatile keyword, but that can lead to inefficient code in places
+ where the memory is known to not change. Rather than mark the
+ memory as volatile we treat the DMA instructions as potentially
+ effecting all memory. With `-munsafe-dma' users must use the
+ volatile keyword to protect memory accesses.
+
+`-mbranch-hints'
+ By default, GCC will generate a branch hint instruction to avoid
+ pipeline stalls for always taken or probably taken branches. A
+ hint will not be generated closer than 8 instructions away from
+ its branch. There is little reason to disable them, except for
+ debugging purposes, or to make an object a little bit smaller.
+
+`-msmall-mem'
+`-mlarge-mem'
+ By default, GCC generates code assuming that addresses are never
+ larger than 18 bits. With `-mlarge-mem' code is generated that
+ assumes a full 32 bit address.
+
+`-mstdmain'
+ By default, GCC links against startup code that assumes the
+ SPU-style main function interface (which has an unconventional
+ parameter list). With `-mstdmain', GCC will link your program
+ against startup code that assumes a C99-style interface to `main',
+ including a local copy of `argv' strings.
+
+`-mfixed-range=REGISTER-RANGE'
+ Generate code treating the given register range as fixed registers.
+ A fixed register is one that the register allocator can not use.
+ This is useful when compiling kernel code. A register range is
+ specified as two registers separated by a dash. Multiple register
+ ranges can be specified separated by a comma.
+
+`-mdual-nops'
+`-mdual-nops=N'
+ By default, GCC will insert nops to increase dual issue when it
+ expects it to increase performance. N can be a value from 0 to
+ 10. A smaller N will insert fewer nops. 10 is the default, 0 is
+ the same as `-mno-dual-nops'. Disabled with `-Os'.
+
+`-mhint-max-nops=N'
+ Maximum number of nops to insert for a branch hint. A branch hint
+ must be at least 8 instructions away from the branch it is
+ effecting. GCC will insert up to N nops to enforce this,
+ otherwise it will not generate the branch hint.
+
+`-mhint-max-distance=N'
+ The encoding of the branch hint instruction limits the hint to be
+ within 256 instructions of the branch it is effecting. By
+ default, GCC makes sure it is within 125.
+
+`-msafe-hints'
+ Work around a hardware bug which causes the SPU to stall
+ indefinitely. By default, GCC will insert the `hbrp' instruction
+ to make sure this stall won't happen.
+
+
+
+File: gcc.info, Node: System V Options, Next: V850 Options, Prev: SPU Options, Up: Submodel Options
+
+3.17.34 Options for System V
+----------------------------
+
+These additional options are available on System V Release 4 for
+compatibility with other compilers on those systems:
+
+`-G'
+ Create a shared object. It is recommended that `-symbolic' or
+ `-shared' be used instead.
+
+`-Qy'
+ Identify the versions of each tool used by the compiler, in a
+ `.ident' assembler directive in the output.
+
+`-Qn'
+ Refrain from adding `.ident' directives to the output file (this is
+ the default).
+
+`-YP,DIRS'
+ Search the directories DIRS, and no others, for libraries
+ specified with `-l'.
+
+`-Ym,DIR'
+ Look in the directory DIR to find the M4 preprocessor. The
+ assembler uses this option.
+
+
+File: gcc.info, Node: V850 Options, Next: VAX Options, Prev: System V Options, Up: Submodel Options
+
+3.17.35 V850 Options
+--------------------
+
+These `-m' options are defined for V850 implementations:
+
+`-mlong-calls'
+`-mno-long-calls'
+ Treat all calls as being far away (near). If calls are assumed to
+ be far away, the compiler will always load the functions address
+ up into a register, and call indirect through the pointer.
+
+`-mno-ep'
+`-mep'
+ Do not optimize (do optimize) basic blocks that use the same index
+ pointer 4 or more times to copy pointer into the `ep' register, and
+ use the shorter `sld' and `sst' instructions. The `-mep' option
+ is on by default if you optimize.
+
+`-mno-prolog-function'
+`-mprolog-function'
+ Do not use (do use) external functions to save and restore
+ registers at the prologue and epilogue of a function. The
+ external functions are slower, but use less code space if more
+ than one function saves the same number of registers. The
+ `-mprolog-function' option is on by default if you optimize.
+
+`-mspace'
+ Try to make the code as small as possible. At present, this just
+ turns on the `-mep' and `-mprolog-function' options.
+
+`-mtda=N'
+ Put static or global variables whose size is N bytes or less into
+ the tiny data area that register `ep' points to. The tiny data
+ area can hold up to 256 bytes in total (128 bytes for byte
+ references).
+
+`-msda=N'
+ Put static or global variables whose size is N bytes or less into
+ the small data area that register `gp' points to. The small data
+ area can hold up to 64 kilobytes.
+
+`-mzda=N'
+ Put static or global variables whose size is N bytes or less into
+ the first 32 kilobytes of memory.
+
+`-mv850'
+ Specify that the target processor is the V850.
+
+`-mbig-switch'
+ Generate code suitable for big switch tables. Use this option
+ only if the assembler/linker complain about out of range branches
+ within a switch table.
+
+`-mapp-regs'
+ This option will cause r2 and r5 to be used in the code generated
+ by the compiler. This setting is the default.
+
+`-mno-app-regs'
+ This option will cause r2 and r5 to be treated as fixed registers.
+
+`-mv850e1'
+ Specify that the target processor is the V850E1. The preprocessor
+ constants `__v850e1__' and `__v850e__' will be defined if this
+ option is used.
+
+`-mv850e'
+ Specify that the target processor is the V850E. The preprocessor
+ constant `__v850e__' will be defined if this option is used.
+
+ If neither `-mv850' nor `-mv850e' nor `-mv850e1' are defined then
+ a default target processor will be chosen and the relevant
+ `__v850*__' preprocessor constant will be defined.
+
+ The preprocessor constants `__v850' and `__v851__' are always
+ defined, regardless of which processor variant is the target.
+
+`-mdisable-callt'
+ This option will suppress generation of the CALLT instruction for
+ the v850e and v850e1 flavors of the v850 architecture. The
+ default is `-mno-disable-callt' which allows the CALLT instruction
+ to be used.
+
+
+
+File: gcc.info, Node: VAX Options, Next: VxWorks Options, Prev: V850 Options, Up: Submodel Options
+
+3.17.36 VAX Options
+-------------------
+
+These `-m' options are defined for the VAX:
+
+`-munix'
+ Do not output certain jump instructions (`aobleq' and so on) that
+ the Unix assembler for the VAX cannot handle across long ranges.
+
+`-mgnu'
+ Do output those jump instructions, on the assumption that you will
+ assemble with the GNU assembler.
+
+`-mg'
+ Output code for g-format floating point numbers instead of
+ d-format.
+
+
+File: gcc.info, Node: VxWorks Options, Next: x86-64 Options, Prev: VAX Options, Up: Submodel Options
+
+3.17.37 VxWorks Options
+-----------------------
+
+The options in this section are defined for all VxWorks targets.
+Options specific to the target hardware are listed with the other
+options for that target.
+
+`-mrtp'
+ GCC can generate code for both VxWorks kernels and real time
+ processes (RTPs). This option switches from the former to the
+ latter. It also defines the preprocessor macro `__RTP__'.
+
+`-non-static'
+ Link an RTP executable against shared libraries rather than static
+ libraries. The options `-static' and `-shared' can also be used
+ for RTPs (*note Link Options::); `-static' is the default.
+
+`-Bstatic'
+`-Bdynamic'
+ These options are passed down to the linker. They are defined for
+ compatibility with Diab.
+
+`-Xbind-lazy'
+ Enable lazy binding of function calls. This option is equivalent
+ to `-Wl,-z,now' and is defined for compatibility with Diab.
+
+`-Xbind-now'
+ Disable lazy binding of function calls. This option is the
+ default and is defined for compatibility with Diab.
+
+
+File: gcc.info, Node: x86-64 Options, Next: Xstormy16 Options, Prev: VxWorks Options, Up: Submodel Options
+
+3.17.38 x86-64 Options
+----------------------
+
+These are listed under *Note i386 and x86-64 Options::.
+
+
+File: gcc.info, Node: i386 and x86-64 Windows Options, Next: IA-64 Options, Prev: i386 and x86-64 Options, Up: Submodel Options
+
+3.17.39 i386 and x86-64 Windows Options
+---------------------------------------
+
+These additional options are available for Windows targets:
+
+`-mconsole'
+ This option is available for Cygwin and MinGW targets. It
+ specifies that a console application is to be generated, by
+ instructing the linker to set the PE header subsystem type
+ required for console applications. This is the default behaviour
+ for Cygwin and MinGW targets.
+
+`-mcygwin'
+ This option is available for Cygwin targets. It specifies that
+ the Cygwin internal interface is to be used for predefined
+ preprocessor macros, C runtime libraries and related linker paths
+ and options. For Cygwin targets this is the default behaviour.
+ This option is deprecated and will be removed in a future release.
+
+`-mno-cygwin'
+ This option is available for Cygwin targets. It specifies that
+ the MinGW internal interface is to be used instead of Cygwin's, by
+ setting MinGW-related predefined macros and linker paths and
+ default library options. This option is deprecated and will be
+ removed in a future release.
+
+`-mdll'
+ This option is available for Cygwin and MinGW targets. It
+ specifies that a DLL - a dynamic link library - is to be
+ generated, enabling the selection of the required runtime startup
+ object and entry point.
+
+`-mnop-fun-dllimport'
+ This option is available for Cygwin and MinGW targets. It
+ specifies that the dllimport attribute should be ignored.
+
+`-mthread'
+ This option is available for MinGW targets. It specifies that
+ MinGW-specific thread support is to be used.
+
+`-mwin32'
+ This option is available for Cygwin and MinGW targets. It
+ specifies that the typical Windows pre-defined macros are to be
+ set in the pre-processor, but does not influence the choice of
+ runtime library/startup code.
+
+`-mwindows'
+ This option is available for Cygwin and MinGW targets. It
+ specifies that a GUI application is to be generated by instructing
+ the linker to set the PE header subsystem type appropriately.
+
+ See also under *Note i386 and x86-64 Options:: for standard options.
+
+
+File: gcc.info, Node: Xstormy16 Options, Next: Xtensa Options, Prev: x86-64 Options, Up: Submodel Options
+
+3.17.40 Xstormy16 Options
+-------------------------
+
+These options are defined for Xstormy16:
+
+`-msim'
+ Choose startup files and linker script suitable for the simulator.
+
+
+File: gcc.info, Node: Xtensa Options, Next: zSeries Options, Prev: Xstormy16 Options, Up: Submodel Options
+
+3.17.41 Xtensa Options
+----------------------
+
+These options are supported for Xtensa targets:
+
+`-mconst16'
+`-mno-const16'
+ Enable or disable use of `CONST16' instructions for loading
+ constant values. The `CONST16' instruction is currently not a
+ standard option from Tensilica. When enabled, `CONST16'
+ instructions are always used in place of the standard `L32R'
+ instructions. The use of `CONST16' is enabled by default only if
+ the `L32R' instruction is not available.
+
+`-mfused-madd'
+`-mno-fused-madd'
+ Enable or disable use of fused multiply/add and multiply/subtract
+ instructions in the floating-point option. This has no effect if
+ the floating-point option is not also enabled. Disabling fused
+ multiply/add and multiply/subtract instructions forces the
+ compiler to use separate instructions for the multiply and
+ add/subtract operations. This may be desirable in some cases
+ where strict IEEE 754-compliant results are required: the fused
+ multiply add/subtract instructions do not round the intermediate
+ result, thereby producing results with _more_ bits of precision
+ than specified by the IEEE standard. Disabling fused multiply
+ add/subtract instructions also ensures that the program output is
+ not sensitive to the compiler's ability to combine multiply and
+ add/subtract operations.
+
+`-mserialize-volatile'
+`-mno-serialize-volatile'
+ When this option is enabled, GCC inserts `MEMW' instructions before
+ `volatile' memory references to guarantee sequential consistency.
+ The default is `-mserialize-volatile'. Use
+ `-mno-serialize-volatile' to omit the `MEMW' instructions.
+
+`-mtext-section-literals'
+`-mno-text-section-literals'
+ Control the treatment of literal pools. The default is
+ `-mno-text-section-literals', which places literals in a separate
+ section in the output file. This allows the literal pool to be
+ placed in a data RAM/ROM, and it also allows the linker to combine
+ literal pools from separate object files to remove redundant
+ literals and improve code size. With `-mtext-section-literals',
+ the literals are interspersed in the text section in order to keep
+ them as close as possible to their references. This may be
+ necessary for large assembly files.
+
+`-mtarget-align'
+`-mno-target-align'
+ When this option is enabled, GCC instructs the assembler to
+ automatically align instructions to reduce branch penalties at the
+ expense of some code density. The assembler attempts to widen
+ density instructions to align branch targets and the instructions
+ following call instructions. If there are not enough preceding
+ safe density instructions to align a target, no widening will be
+ performed. The default is `-mtarget-align'. These options do not
+ affect the treatment of auto-aligned instructions like `LOOP',
+ which the assembler will always align, either by widening density
+ instructions or by inserting no-op instructions.
+
+`-mlongcalls'
+`-mno-longcalls'
+ When this option is enabled, GCC instructs the assembler to
+ translate direct calls to indirect calls unless it can determine
+ that the target of a direct call is in the range allowed by the
+ call instruction. This translation typically occurs for calls to
+ functions in other source files. Specifically, the assembler
+ translates a direct `CALL' instruction into an `L32R' followed by
+ a `CALLX' instruction. The default is `-mno-longcalls'. This
+ option should be used in programs where the call target can
+ potentially be out of range. This option is implemented in the
+ assembler, not the compiler, so the assembly code generated by GCC
+ will still show direct call instructions--look at the disassembled
+ object code to see the actual instructions. Note that the
+ assembler will use an indirect call for every cross-file call, not
+ just those that really will be out of range.
+
+
+File: gcc.info, Node: zSeries Options, Prev: Xtensa Options, Up: Submodel Options
+
+3.17.42 zSeries Options
+-----------------------
+
+These are listed under *Note S/390 and zSeries Options::.
+
+
+File: gcc.info, Node: Code Gen Options, Next: Environment Variables, Prev: Submodel Options, Up: Invoking GCC
+
+3.18 Options for Code Generation Conventions
+============================================
+
+These machine-independent options control the interface conventions
+used in code generation.
+
+ Most of them have both positive and negative forms; the negative form
+of `-ffoo' would be `-fno-foo'. In the table below, only one of the
+forms is listed--the one which is not the default. You can figure out
+the other form by either removing `no-' or adding it.
+
+`-fbounds-check'
+ For front-ends that support it, generate additional code to check
+ that indices used to access arrays are within the declared range.
+ This is currently only supported by the Java and Fortran
+ front-ends, where this option defaults to true and false
+ respectively.
+
+`-ftrapv'
+ This option generates traps for signed overflow on addition,
+ subtraction, multiplication operations.
+
+`-fwrapv'
+ This option instructs the compiler to assume that signed arithmetic
+ overflow of addition, subtraction and multiplication wraps around
+ using twos-complement representation. This flag enables some
+ optimizations and disables others. This option is enabled by
+ default for the Java front-end, as required by the Java language
+ specification.
+
+`-fexceptions'
+ Enable exception handling. Generates extra code needed to
+ propagate exceptions. For some targets, this implies GCC will
+ generate frame unwind information for all functions, which can
+ produce significant data size overhead, although it does not
+ affect execution. If you do not specify this option, GCC will
+ enable it by default for languages like C++ which normally require
+ exception handling, and disable it for languages like C that do
+ not normally require it. However, you may need to enable this
+ option when compiling C code that needs to interoperate properly
+ with exception handlers written in C++. You may also wish to
+ disable this option if you are compiling older C++ programs that
+ don't use exception handling.
+
+`-fnon-call-exceptions'
+ Generate code that allows trapping instructions to throw
+ exceptions. Note that this requires platform-specific runtime
+ support that does not exist everywhere. Moreover, it only allows
+ _trapping_ instructions to throw exceptions, i.e. memory
+ references or floating point instructions. It does not allow
+ exceptions to be thrown from arbitrary signal handlers such as
+ `SIGALRM'.
+
+`-funwind-tables'
+ Similar to `-fexceptions', except that it will just generate any
+ needed static data, but will not affect the generated code in any
+ other way. You will normally not enable this option; instead, a
+ language processor that needs this handling would enable it on
+ your behalf.
+
+`-fasynchronous-unwind-tables'
+ Generate unwind table in dwarf2 format, if supported by target
+ machine. The table is exact at each instruction boundary, so it
+ can be used for stack unwinding from asynchronous events (such as
+ debugger or garbage collector).
+
+`-fpcc-struct-return'
+ Return "short" `struct' and `union' values in memory like longer
+ ones, rather than in registers. This convention is less
+ efficient, but it has the advantage of allowing intercallability
+ between GCC-compiled files and files compiled with other
+ compilers, particularly the Portable C Compiler (pcc).
+
+ The precise convention for returning structures in memory depends
+ on the target configuration macros.
+
+ Short structures and unions are those whose size and alignment
+ match that of some integer type.
+
+ *Warning:* code compiled with the `-fpcc-struct-return' switch is
+ not binary compatible with code compiled with the
+ `-freg-struct-return' switch. Use it to conform to a non-default
+ application binary interface.
+
+`-freg-struct-return'
+ Return `struct' and `union' values in registers when possible.
+ This is more efficient for small structures than
+ `-fpcc-struct-return'.
+
+ If you specify neither `-fpcc-struct-return' nor
+ `-freg-struct-return', GCC defaults to whichever convention is
+ standard for the target. If there is no standard convention, GCC
+ defaults to `-fpcc-struct-return', except on targets where GCC is
+ the principal compiler. In those cases, we can choose the
+ standard, and we chose the more efficient register return
+ alternative.
+
+ *Warning:* code compiled with the `-freg-struct-return' switch is
+ not binary compatible with code compiled with the
+ `-fpcc-struct-return' switch. Use it to conform to a non-default
+ application binary interface.
+
+`-fshort-enums'
+ Allocate to an `enum' type only as many bytes as it needs for the
+ declared range of possible values. Specifically, the `enum' type
+ will be equivalent to the smallest integer type which has enough
+ room.
+
+ *Warning:* the `-fshort-enums' switch causes GCC to generate code
+ that is not binary compatible with code generated without that
+ switch. Use it to conform to a non-default application binary
+ interface.
+
+`-fshort-double'
+ Use the same size for `double' as for `float'.
+
+ *Warning:* the `-fshort-double' switch causes GCC to generate code
+ that is not binary compatible with code generated without that
+ switch. Use it to conform to a non-default application binary
+ interface.
+
+`-fshort-wchar'
+ Override the underlying type for `wchar_t' to be `short unsigned
+ int' instead of the default for the target. This option is useful
+ for building programs to run under WINE.
+
+ *Warning:* the `-fshort-wchar' switch causes GCC to generate code
+ that is not binary compatible with code generated without that
+ switch. Use it to conform to a non-default application binary
+ interface.
+
+`-fno-common'
+ In C code, controls the placement of uninitialized global
+ variables. Unix C compilers have traditionally permitted multiple
+ definitions of such variables in different compilation units by
+ placing the variables in a common block. This is the behavior
+ specified by `-fcommon', and is the default for GCC on most
+ targets. On the other hand, this behavior is not required by ISO
+ C, and on some targets may carry a speed or code size penalty on
+ variable references. The `-fno-common' option specifies that the
+ compiler should place uninitialized global variables in the data
+ section of the object file, rather than generating them as common
+ blocks. This has the effect that if the same variable is declared
+ (without `extern') in two different compilations, you will get a
+ multiple-definition error when you link them. In this case, you
+ must compile with `-fcommon' instead. Compiling with
+ `-fno-common' is useful on targets for which it provides better
+ performance, or if you wish to verify that the program will work
+ on other systems which always treat uninitialized variable
+ declarations this way.
+
+`-fno-ident'
+ Ignore the `#ident' directive.
+
+`-finhibit-size-directive'
+ Don't output a `.size' assembler directive, or anything else that
+ would cause trouble if the function is split in the middle, and the
+ two halves are placed at locations far apart in memory. This
+ option is used when compiling `crtstuff.c'; you should not need to
+ use it for anything else.
+
+`-fverbose-asm'
+ Put extra commentary information in the generated assembly code to
+ make it more readable. This option is generally only of use to
+ those who actually need to read the generated assembly code
+ (perhaps while debugging the compiler itself).
+
+ `-fno-verbose-asm', the default, causes the extra information to
+ be omitted and is useful when comparing two assembler files.
+
+`-frecord-gcc-switches'
+ This switch causes the command line that was used to invoke the
+ compiler to be recorded into the object file that is being created.
+ This switch is only implemented on some targets and the exact
+ format of the recording is target and binary file format
+ dependent, but it usually takes the form of a section containing
+ ASCII text. This switch is related to the `-fverbose-asm' switch,
+ but that switch only records information in the assembler output
+ file as comments, so it never reaches the object file.
+
+`-fpic'
+ Generate position-independent code (PIC) suitable for use in a
+ shared library, if supported for the target machine. Such code
+ accesses all constant addresses through a global offset table
+ (GOT). The dynamic loader resolves the GOT entries when the
+ program starts (the dynamic loader is not part of GCC; it is part
+ of the operating system). If the GOT size for the linked
+ executable exceeds a machine-specific maximum size, you get an
+ error message from the linker indicating that `-fpic' does not
+ work; in that case, recompile with `-fPIC' instead. (These
+ maximums are 8k on the SPARC and 32k on the m68k and RS/6000. The
+ 386 has no such limit.)
+
+ Position-independent code requires special support, and therefore
+ works only on certain machines. For the 386, GCC supports PIC for
+ System V but not for the Sun 386i. Code generated for the IBM
+ RS/6000 is always position-independent.
+
+ When this flag is set, the macros `__pic__' and `__PIC__' are
+ defined to 1.
+
+`-fPIC'
+ If supported for the target machine, emit position-independent
+ code, suitable for dynamic linking and avoiding any limit on the
+ size of the global offset table. This option makes a difference
+ on the m68k, PowerPC and SPARC.
+
+ Position-independent code requires special support, and therefore
+ works only on certain machines.
+
+ When this flag is set, the macros `__pic__' and `__PIC__' are
+ defined to 2.
+
+`-fpie'
+`-fPIE'
+ These options are similar to `-fpic' and `-fPIC', but generated
+ position independent code can be only linked into executables.
+ Usually these options are used when `-pie' GCC option will be used
+ during linking.
+
+ `-fpie' and `-fPIE' both define the macros `__pie__' and
+ `__PIE__'. The macros have the value 1 for `-fpie' and 2 for
+ `-fPIE'.
+
+`-fno-jump-tables'
+ Do not use jump tables for switch statements even where it would be
+ more efficient than other code generation strategies. This option
+ is of use in conjunction with `-fpic' or `-fPIC' for building code
+ which forms part of a dynamic linker and cannot reference the
+ address of a jump table. On some targets, jump tables do not
+ require a GOT and this option is not needed.
+
+`-ffixed-REG'
+ Treat the register named REG as a fixed register; generated code
+ should never refer to it (except perhaps as a stack pointer, frame
+ pointer or in some other fixed role).
+
+ REG must be the name of a register. The register names accepted
+ are machine-specific and are defined in the `REGISTER_NAMES' macro
+ in the machine description macro file.
+
+ This flag does not have a negative form, because it specifies a
+ three-way choice.
+
+`-fcall-used-REG'
+ Treat the register named REG as an allocable register that is
+ clobbered by function calls. It may be allocated for temporaries
+ or variables that do not live across a call. Functions compiled
+ this way will not save and restore the register REG.
+
+ It is an error to used this flag with the frame pointer or stack
+ pointer. Use of this flag for other registers that have fixed
+ pervasive roles in the machine's execution model will produce
+ disastrous results.
+
+ This flag does not have a negative form, because it specifies a
+ three-way choice.
+
+`-fcall-saved-REG'
+ Treat the register named REG as an allocable register saved by
+ functions. It may be allocated even for temporaries or variables
+ that live across a call. Functions compiled this way will save
+ and restore the register REG if they use it.
+
+ It is an error to used this flag with the frame pointer or stack
+ pointer. Use of this flag for other registers that have fixed
+ pervasive roles in the machine's execution model will produce
+ disastrous results.
+
+ A different sort of disaster will result from the use of this flag
+ for a register in which function values may be returned.
+
+ This flag does not have a negative form, because it specifies a
+ three-way choice.
+
+`-fpack-struct[=N]'
+ Without a value specified, pack all structure members together
+ without holes. When a value is specified (which must be a small
+ power of two), pack structure members according to this value,
+ representing the maximum alignment (that is, objects with default
+ alignment requirements larger than this will be output potentially
+ unaligned at the next fitting location.
+
+ *Warning:* the `-fpack-struct' switch causes GCC to generate code
+ that is not binary compatible with code generated without that
+ switch. Additionally, it makes the code suboptimal. Use it to
+ conform to a non-default application binary interface.
+
+`-finstrument-functions'
+ Generate instrumentation calls for entry and exit to functions.
+ Just after function entry and just before function exit, the
+ following profiling functions will be called with the address of
+ the current function and its call site. (On some platforms,
+ `__builtin_return_address' does not work beyond the current
+ function, so the call site information may not be available to the
+ profiling functions otherwise.)
+
+ void __cyg_profile_func_enter (void *this_fn,
+ void *call_site);
+ void __cyg_profile_func_exit (void *this_fn,
+ void *call_site);
+
+ The first argument is the address of the start of the current
+ function, which may be looked up exactly in the symbol table.
+
+ This instrumentation is also done for functions expanded inline in
+ other functions. The profiling calls will indicate where,
+ conceptually, the inline function is entered and exited. This
+ means that addressable versions of such functions must be
+ available. If all your uses of a function are expanded inline,
+ this may mean an additional expansion of code size. If you use
+ `extern inline' in your C code, an addressable version of such
+ functions must be provided. (This is normally the case anyways,
+ but if you get lucky and the optimizer always expands the
+ functions inline, you might have gotten away without providing
+ static copies.)
+
+ A function may be given the attribute `no_instrument_function', in
+ which case this instrumentation will not be done. This can be
+ used, for example, for the profiling functions listed above,
+ high-priority interrupt routines, and any functions from which the
+ profiling functions cannot safely be called (perhaps signal
+ handlers, if the profiling routines generate output or allocate
+ memory).
+
+`-finstrument-functions-exclude-file-list=FILE,FILE,...'
+ Set the list of functions that are excluded from instrumentation
+ (see the description of `-finstrument-functions'). If the file
+ that contains a function definition matches with one of FILE, then
+ that function is not instrumented. The match is done on
+ substrings: if the FILE parameter is a substring of the file name,
+ it is considered to be a match.
+
+ For example,
+ `-finstrument-functions-exclude-file-list=/bits/stl,include/sys'
+ will exclude any inline function defined in files whose pathnames
+ contain `/bits/stl' or `include/sys'.
+
+ If, for some reason, you want to include letter `','' in one of
+ SYM, write `'\,''. For example,
+ `-finstrument-functions-exclude-file-list='\,\,tmp'' (note the
+ single quote surrounding the option).
+
+`-finstrument-functions-exclude-function-list=SYM,SYM,...'
+ This is similar to `-finstrument-functions-exclude-file-list', but
+ this option sets the list of function names to be excluded from
+ instrumentation. The function name to be matched is its
+ user-visible name, such as `vector<int> blah(const vector<int>
+ &)', not the internal mangled name (e.g.,
+ `_Z4blahRSt6vectorIiSaIiEE'). The match is done on substrings: if
+ the SYM parameter is a substring of the function name, it is
+ considered to be a match.
+
+`-fstack-check'
+ Generate code to verify that you do not go beyond the boundary of
+ the stack. You should specify this flag if you are running in an
+ environment with multiple threads, but only rarely need to specify
+ it in a single-threaded environment since stack overflow is
+ automatically detected on nearly all systems if there is only one
+ stack.
+
+ Note that this switch does not actually cause checking to be done;
+ the operating system or the language runtime must do that. The
+ switch causes generation of code to ensure that they see the stack
+ being extended.
+
+ You can additionally specify a string parameter: `no' means no
+ checking, `generic' means force the use of old-style checking,
+ `specific' means use the best checking method and is equivalent to
+ bare `-fstack-check'.
+
+ Old-style checking is a generic mechanism that requires no specific
+ target support in the compiler but comes with the following
+ drawbacks:
+
+ 1. Modified allocation strategy for large objects: they will
+ always be allocated dynamically if their size exceeds a fixed
+ threshold.
+
+ 2. Fixed limit on the size of the static frame of functions:
+ when it is topped by a particular function, stack checking is
+ not reliable and a warning is issued by the compiler.
+
+ 3. Inefficiency: because of both the modified allocation
+ strategy and the generic implementation, the performances of
+ the code are hampered.
+
+ Note that old-style stack checking is also the fallback method for
+ `specific' if no target support has been added in the compiler.
+
+`-fstack-limit-register=REG'
+`-fstack-limit-symbol=SYM'
+`-fno-stack-limit'
+ Generate code to ensure that the stack does not grow beyond a
+ certain value, either the value of a register or the address of a
+ symbol. If the stack would grow beyond the value, a signal is
+ raised. For most targets, the signal is raised before the stack
+ overruns the boundary, so it is possible to catch the signal
+ without taking special precautions.
+
+ For instance, if the stack starts at absolute address `0x80000000'
+ and grows downwards, you can use the flags
+ `-fstack-limit-symbol=__stack_limit' and
+ `-Wl,--defsym,__stack_limit=0x7ffe0000' to enforce a stack limit
+ of 128KB. Note that this may only work with the GNU linker.
+
+`-fargument-alias'
+`-fargument-noalias'
+`-fargument-noalias-global'
+`-fargument-noalias-anything'
+ Specify the possible relationships among parameters and between
+ parameters and global data.
+
+ `-fargument-alias' specifies that arguments (parameters) may alias
+ each other and may alias global storage.
+ `-fargument-noalias' specifies that arguments do not alias each
+ other, but may alias global storage.
+ `-fargument-noalias-global' specifies that arguments do not alias
+ each other and do not alias global storage.
+ `-fargument-noalias-anything' specifies that arguments do not
+ alias any other storage.
+
+ Each language will automatically use whatever option is required by
+ the language standard. You should not need to use these options
+ yourself.
+
+`-fleading-underscore'
+ This option and its counterpart, `-fno-leading-underscore',
+ forcibly change the way C symbols are represented in the object
+ file. One use is to help link with legacy assembly code.
+
+ *Warning:* the `-fleading-underscore' switch causes GCC to
+ generate code that is not binary compatible with code generated
+ without that switch. Use it to conform to a non-default
+ application binary interface. Not all targets provide complete
+ support for this switch.
+
+`-ftls-model=MODEL'
+ Alter the thread-local storage model to be used (*note
+ Thread-Local::). The MODEL argument should be one of
+ `global-dynamic', `local-dynamic', `initial-exec' or `local-exec'.
+
+ The default without `-fpic' is `initial-exec'; with `-fpic' the
+ default is `global-dynamic'.
+
+`-fvisibility=DEFAULT|INTERNAL|HIDDEN|PROTECTED'
+ Set the default ELF image symbol visibility to the specified
+ option--all symbols will be marked with this unless overridden
+ within the code. Using this feature can very substantially
+ improve linking and load times of shared object libraries, produce
+ more optimized code, provide near-perfect API export and prevent
+ symbol clashes. It is *strongly* recommended that you use this in
+ any shared objects you distribute.
+
+ Despite the nomenclature, `default' always means public ie;
+ available to be linked against from outside the shared object.
+ `protected' and `internal' are pretty useless in real-world usage
+ so the only other commonly used option will be `hidden'. The
+ default if `-fvisibility' isn't specified is `default', i.e., make
+ every symbol public--this causes the same behavior as previous
+ versions of GCC.
+
+ A good explanation of the benefits offered by ensuring ELF symbols
+ have the correct visibility is given by "How To Write Shared
+ Libraries" by Ulrich Drepper (which can be found at
+ `http://people.redhat.com/~drepper/')--however a superior solution
+ made possible by this option to marking things hidden when the
+ default is public is to make the default hidden and mark things
+ public. This is the norm with DLL's on Windows and with
+ `-fvisibility=hidden' and `__attribute__
+ ((visibility("default")))' instead of `__declspec(dllexport)' you
+ get almost identical semantics with identical syntax. This is a
+ great boon to those working with cross-platform projects.
+
+ For those adding visibility support to existing code, you may find
+ `#pragma GCC visibility' of use. This works by you enclosing the
+ declarations you wish to set visibility for with (for example)
+ `#pragma GCC visibility push(hidden)' and `#pragma GCC visibility
+ pop'. Bear in mind that symbol visibility should be viewed *as
+ part of the API interface contract* and thus all new code should
+ always specify visibility when it is not the default ie;
+ declarations only for use within the local DSO should *always* be
+ marked explicitly as hidden as so to avoid PLT indirection
+ overheads--making this abundantly clear also aids readability and
+ self-documentation of the code. Note that due to ISO C++
+ specification requirements, operator new and operator delete must
+ always be of default visibility.
+
+ Be aware that headers from outside your project, in particular
+ system headers and headers from any other library you use, may not
+ be expecting to be compiled with visibility other than the
+ default. You may need to explicitly say `#pragma GCC visibility
+ push(default)' before including any such headers.
+
+ `extern' declarations are not affected by `-fvisibility', so a lot
+ of code can be recompiled with `-fvisibility=hidden' with no
+ modifications. However, this means that calls to `extern'
+ functions with no explicit visibility will use the PLT, so it is
+ more effective to use `__attribute ((visibility))' and/or `#pragma
+ GCC visibility' to tell the compiler which `extern' declarations
+ should be treated as hidden.
+
+ Note that `-fvisibility' does affect C++ vague linkage entities.
+ This means that, for instance, an exception class that will be
+ thrown between DSOs must be explicitly marked with default
+ visibility so that the `type_info' nodes will be unified between
+ the DSOs.
+
+ An overview of these techniques, their benefits and how to use them
+ is at `http://gcc.gnu.org/wiki/Visibility'.
+
+
+
+File: gcc.info, Node: Environment Variables, Next: Precompiled Headers, Prev: Code Gen Options, Up: Invoking GCC
+
+3.19 Environment Variables Affecting GCC
+========================================
+
+This section describes several environment variables that affect how GCC
+operates. Some of them work by specifying directories or prefixes to
+use when searching for various kinds of files. Some are used to
+specify other aspects of the compilation environment.
+
+ Note that you can also specify places to search using options such as
+`-B', `-I' and `-L' (*note Directory Options::). These take precedence
+over places specified using environment variables, which in turn take
+precedence over those specified by the configuration of GCC. *Note
+Controlling the Compilation Driver `gcc': (gccint)Driver.
+
+`LANG'
+`LC_CTYPE'
+`LC_MESSAGES'
+`LC_ALL'
+ These environment variables control the way that GCC uses
+ localization information that allow GCC to work with different
+ national conventions. GCC inspects the locale categories
+ `LC_CTYPE' and `LC_MESSAGES' if it has been configured to do so.
+ These locale categories can be set to any value supported by your
+ installation. A typical value is `en_GB.UTF-8' for English in the
+ United Kingdom encoded in UTF-8.
+
+ The `LC_CTYPE' environment variable specifies character
+ classification. GCC uses it to determine the character boundaries
+ in a string; this is needed for some multibyte encodings that
+ contain quote and escape characters that would otherwise be
+ interpreted as a string end or escape.
+
+ The `LC_MESSAGES' environment variable specifies the language to
+ use in diagnostic messages.
+
+ If the `LC_ALL' environment variable is set, it overrides the value
+ of `LC_CTYPE' and `LC_MESSAGES'; otherwise, `LC_CTYPE' and
+ `LC_MESSAGES' default to the value of the `LANG' environment
+ variable. If none of these variables are set, GCC defaults to
+ traditional C English behavior.
+
+`TMPDIR'
+ If `TMPDIR' is set, it specifies the directory to use for temporary
+ files. GCC uses temporary files to hold the output of one stage of
+ compilation which is to be used as input to the next stage: for
+ example, the output of the preprocessor, which is the input to the
+ compiler proper.
+
+`GCC_EXEC_PREFIX'
+ If `GCC_EXEC_PREFIX' is set, it specifies a prefix to use in the
+ names of the subprograms executed by the compiler. No slash is
+ added when this prefix is combined with the name of a subprogram,
+ but you can specify a prefix that ends with a slash if you wish.
+
+ If `GCC_EXEC_PREFIX' is not set, GCC will attempt to figure out an
+ appropriate prefix to use based on the pathname it was invoked
+ with.
+
+ If GCC cannot find the subprogram using the specified prefix, it
+ tries looking in the usual places for the subprogram.
+
+ The default value of `GCC_EXEC_PREFIX' is `PREFIX/lib/gcc/' where
+ PREFIX is the prefix to the installed compiler. In many cases
+ PREFIX is the value of `prefix' when you ran the `configure'
+ script.
+
+ Other prefixes specified with `-B' take precedence over this
+ prefix.
+
+ This prefix is also used for finding files such as `crt0.o' that
+ are used for linking.
+
+ In addition, the prefix is used in an unusual way in finding the
+ directories to search for header files. For each of the standard
+ directories whose name normally begins with `/usr/local/lib/gcc'
+ (more precisely, with the value of `GCC_INCLUDE_DIR'), GCC tries
+ replacing that beginning with the specified prefix to produce an
+ alternate directory name. Thus, with `-Bfoo/', GCC will search
+ `foo/bar' where it would normally search `/usr/local/lib/bar'.
+ These alternate directories are searched first; the standard
+ directories come next. If a standard directory begins with the
+ configured PREFIX then the value of PREFIX is replaced by
+ `GCC_EXEC_PREFIX' when looking for header files.
+
+`COMPILER_PATH'
+ The value of `COMPILER_PATH' is a colon-separated list of
+ directories, much like `PATH'. GCC tries the directories thus
+ specified when searching for subprograms, if it can't find the
+ subprograms using `GCC_EXEC_PREFIX'.
+
+`LIBRARY_PATH'
+ The value of `LIBRARY_PATH' is a colon-separated list of
+ directories, much like `PATH'. When configured as a native
+ compiler, GCC tries the directories thus specified when searching
+ for special linker files, if it can't find them using
+ `GCC_EXEC_PREFIX'. Linking using GCC also uses these directories
+ when searching for ordinary libraries for the `-l' option (but
+ directories specified with `-L' come first).
+
+`LANG'
+ This variable is used to pass locale information to the compiler.
+ One way in which this information is used is to determine the
+ character set to be used when character literals, string literals
+ and comments are parsed in C and C++. When the compiler is
+ configured to allow multibyte characters, the following values for
+ `LANG' are recognized:
+
+ `C-JIS'
+ Recognize JIS characters.
+
+ `C-SJIS'
+ Recognize SJIS characters.
+
+ `C-EUCJP'
+ Recognize EUCJP characters.
+
+ If `LANG' is not defined, or if it has some other value, then the
+ compiler will use mblen and mbtowc as defined by the default
+ locale to recognize and translate multibyte characters.
+
+Some additional environments variables affect the behavior of the
+preprocessor.
+
+`CPATH'
+`C_INCLUDE_PATH'
+`CPLUS_INCLUDE_PATH'
+`OBJC_INCLUDE_PATH'
+ Each variable's value is a list of directories separated by a
+ special character, much like `PATH', in which to look for header
+ files. The special character, `PATH_SEPARATOR', is
+ target-dependent and determined at GCC build time. For Microsoft
+ Windows-based targets it is a semicolon, and for almost all other
+ targets it is a colon.
+
+ `CPATH' specifies a list of directories to be searched as if
+ specified with `-I', but after any paths given with `-I' options
+ on the command line. This environment variable is used regardless
+ of which language is being preprocessed.
+
+ The remaining environment variables apply only when preprocessing
+ the particular language indicated. Each specifies a list of
+ directories to be searched as if specified with `-isystem', but
+ after any paths given with `-isystem' options on the command line.
+
+ In all these variables, an empty element instructs the compiler to
+ search its current working directory. Empty elements can appear
+ at the beginning or end of a path. For instance, if the value of
+ `CPATH' is `:/special/include', that has the same effect as
+ `-I. -I/special/include'.
+
+`DEPENDENCIES_OUTPUT'
+ If this variable is set, its value specifies how to output
+ dependencies for Make based on the non-system header files
+ processed by the compiler. System header files are ignored in the
+ dependency output.
+
+ The value of `DEPENDENCIES_OUTPUT' can be just a file name, in
+ which case the Make rules are written to that file, guessing the
+ target name from the source file name. Or the value can have the
+ form `FILE TARGET', in which case the rules are written to file
+ FILE using TARGET as the target name.
+
+ In other words, this environment variable is equivalent to
+ combining the options `-MM' and `-MF' (*note Preprocessor
+ Options::), with an optional `-MT' switch too.
+
+`SUNPRO_DEPENDENCIES'
+ This variable is the same as `DEPENDENCIES_OUTPUT' (see above),
+ except that system header files are not ignored, so it implies
+ `-M' rather than `-MM'. However, the dependence on the main input
+ file is omitted. *Note Preprocessor Options::.
+
+
+File: gcc.info, Node: Precompiled Headers, Next: Running Protoize, Prev: Environment Variables, Up: Invoking GCC
+
+3.20 Using Precompiled Headers
+==============================
+
+Often large projects have many header files that are included in every
+source file. The time the compiler takes to process these header files
+over and over again can account for nearly all of the time required to
+build the project. To make builds faster, GCC allows users to
+`precompile' a header file; then, if builds can use the precompiled
+header file they will be much faster.
+
+ To create a precompiled header file, simply compile it as you would any
+other file, if necessary using the `-x' option to make the driver treat
+it as a C or C++ header file. You will probably want to use a tool
+like `make' to keep the precompiled header up-to-date when the headers
+it contains change.
+
+ A precompiled header file will be searched for when `#include' is seen
+in the compilation. As it searches for the included file (*note Search
+Path: (cpp)Search Path.) the compiler looks for a precompiled header in
+each directory just before it looks for the include file in that
+directory. The name searched for is the name specified in the
+`#include' with `.gch' appended. If the precompiled header file can't
+be used, it is ignored.
+
+ For instance, if you have `#include "all.h"', and you have `all.h.gch'
+in the same directory as `all.h', then the precompiled header file will
+be used if possible, and the original header will be used otherwise.
+
+ Alternatively, you might decide to put the precompiled header file in a
+directory and use `-I' to ensure that directory is searched before (or
+instead of) the directory containing the original header. Then, if you
+want to check that the precompiled header file is always used, you can
+put a file of the same name as the original header in this directory
+containing an `#error' command.
+
+ This also works with `-include'. So yet another way to use
+precompiled headers, good for projects not designed with precompiled
+header files in mind, is to simply take most of the header files used by
+a project, include them from another header file, precompile that header
+file, and `-include' the precompiled header. If the header files have
+guards against multiple inclusion, they will be skipped because they've
+already been included (in the precompiled header).
+
+ If you need to precompile the same header file for different
+languages, targets, or compiler options, you can instead make a
+_directory_ named like `all.h.gch', and put each precompiled header in
+the directory, perhaps using `-o'. It doesn't matter what you call the
+files in the directory, every precompiled header in the directory will
+be considered. The first precompiled header encountered in the
+directory that is valid for this compilation will be used; they're
+searched in no particular order.
+
+ There are many other possibilities, limited only by your imagination,
+good sense, and the constraints of your build system.
+
+ A precompiled header file can be used only when these conditions apply:
+
+ * Only one precompiled header can be used in a particular
+ compilation.
+
+ * A precompiled header can't be used once the first C token is seen.
+ You can have preprocessor directives before a precompiled header;
+ you can even include a precompiled header from inside another
+ header, so long as there are no C tokens before the `#include'.
+
+ * The precompiled header file must be produced for the same language
+ as the current compilation. You can't use a C precompiled header
+ for a C++ compilation.
+
+ * The precompiled header file must have been produced by the same
+ compiler binary as the current compilation is using.
+
+ * Any macros defined before the precompiled header is included must
+ either be defined in the same way as when the precompiled header
+ was generated, or must not affect the precompiled header, which
+ usually means that they don't appear in the precompiled header at
+ all.
+
+ The `-D' option is one way to define a macro before a precompiled
+ header is included; using a `#define' can also do it. There are
+ also some options that define macros implicitly, like `-O' and
+ `-Wdeprecated'; the same rule applies to macros defined this way.
+
+ * If debugging information is output when using the precompiled
+ header, using `-g' or similar, the same kind of debugging
+ information must have been output when building the precompiled
+ header. However, a precompiled header built using `-g' can be
+ used in a compilation when no debugging information is being
+ output.
+
+ * The same `-m' options must generally be used when building and
+ using the precompiled header. *Note Submodel Options::, for any
+ cases where this rule is relaxed.
+
+ * Each of the following options must be the same when building and
+ using the precompiled header:
+
+ -fexceptions
+
+ * Some other command-line options starting with `-f', `-p', or `-O'
+ must be defined in the same way as when the precompiled header was
+ generated. At present, it's not clear which options are safe to
+ change and which are not; the safest choice is to use exactly the
+ same options when generating and using the precompiled header.
+ The following are known to be safe:
+
+ -fmessage-length= -fpreprocessed -fsched-interblock
+ -fsched-spec -fsched-spec-load -fsched-spec-load-dangerous
+ -fsched-verbose=<number> -fschedule-insns -fvisibility=
+ -pedantic-errors
+
+
+ For all of these except the last, the compiler will automatically
+ignore the precompiled header if the conditions aren't met. If you
+find an option combination that doesn't work and doesn't cause the
+precompiled header to be ignored, please consider filing a bug report,
+see *Note Bugs::.
+
+ If you do use differing options when generating and using the
+precompiled header, the actual behavior will be a mixture of the
+behavior for the options. For instance, if you use `-g' to generate
+the precompiled header but not when using it, you may or may not get
+debugging information for routines in the precompiled header.
+
+
+File: gcc.info, Node: Running Protoize, Prev: Precompiled Headers, Up: Invoking GCC
+
+3.21 Running Protoize
+=====================
+
+The program `protoize' is an optional part of GCC. You can use it to
+add prototypes to a program, thus converting the program to ISO C in
+one respect. The companion program `unprotoize' does the reverse: it
+removes argument types from any prototypes that are found.
+
+ When you run these programs, you must specify a set of source files as
+command line arguments. The conversion programs start out by compiling
+these files to see what functions they define. The information gathered
+about a file FOO is saved in a file named `FOO.X'.
+
+ After scanning comes actual conversion. The specified files are all
+eligible to be converted; any files they include (whether sources or
+just headers) are eligible as well.
+
+ But not all the eligible files are converted. By default, `protoize'
+and `unprotoize' convert only source and header files in the current
+directory. You can specify additional directories whose files should
+be converted with the `-d DIRECTORY' option. You can also specify
+particular files to exclude with the `-x FILE' option. A file is
+converted if it is eligible, its directory name matches one of the
+specified directory names, and its name within the directory has not
+been excluded.
+
+ Basic conversion with `protoize' consists of rewriting most function
+definitions and function declarations to specify the types of the
+arguments. The only ones not rewritten are those for varargs functions.
+
+ `protoize' optionally inserts prototype declarations at the beginning
+of the source file, to make them available for any calls that precede
+the function's definition. Or it can insert prototype declarations
+with block scope in the blocks where undeclared functions are called.
+
+ Basic conversion with `unprotoize' consists of rewriting most function
+declarations to remove any argument types, and rewriting function
+definitions to the old-style pre-ISO form.
+
+ Both conversion programs print a warning for any function declaration
+or definition that they can't convert. You can suppress these warnings
+with `-q'.
+
+ The output from `protoize' or `unprotoize' replaces the original
+source file. The original file is renamed to a name ending with
+`.save' (for DOS, the saved filename ends in `.sav' without the
+original `.c' suffix). If the `.save' (`.sav' for DOS) file already
+exists, then the source file is simply discarded.
+
+ `protoize' and `unprotoize' both depend on GCC itself to scan the
+program and collect information about the functions it uses. So
+neither of these programs will work until GCC is installed.
+
+ Here is a table of the options you can use with `protoize' and
+`unprotoize'. Each option works with both programs unless otherwise
+stated.
+
+`-B DIRECTORY'
+ Look for the file `SYSCALLS.c.X' in DIRECTORY, instead of the
+ usual directory (normally `/usr/local/lib'). This file contains
+ prototype information about standard system functions. This option
+ applies only to `protoize'.
+
+`-c COMPILATION-OPTIONS'
+ Use COMPILATION-OPTIONS as the options when running `gcc' to
+ produce the `.X' files. The special option `-aux-info' is always
+ passed in addition, to tell `gcc' to write a `.X' file.
+
+ Note that the compilation options must be given as a single
+ argument to `protoize' or `unprotoize'. If you want to specify
+ several `gcc' options, you must quote the entire set of
+ compilation options to make them a single word in the shell.
+
+ There are certain `gcc' arguments that you cannot use, because they
+ would produce the wrong kind of output. These include `-g', `-O',
+ `-c', `-S', and `-o' If you include these in the
+ COMPILATION-OPTIONS, they are ignored.
+
+`-C'
+ Rename files to end in `.C' (`.cc' for DOS-based file systems)
+ instead of `.c'. This is convenient if you are converting a C
+ program to C++. This option applies only to `protoize'.
+
+`-g'
+ Add explicit global declarations. This means inserting explicit
+ declarations at the beginning of each source file for each function
+ that is called in the file and was not declared. These
+ declarations precede the first function definition that contains a
+ call to an undeclared function. This option applies only to
+ `protoize'.
+
+`-i STRING'
+ Indent old-style parameter declarations with the string STRING.
+ This option applies only to `protoize'.
+
+ `unprotoize' converts prototyped function definitions to old-style
+ function definitions, where the arguments are declared between the
+ argument list and the initial `{'. By default, `unprotoize' uses
+ five spaces as the indentation. If you want to indent with just
+ one space instead, use `-i " "'.
+
+`-k'
+ Keep the `.X' files. Normally, they are deleted after conversion
+ is finished.
+
+`-l'
+ Add explicit local declarations. `protoize' with `-l' inserts a
+ prototype declaration for each function in each block which calls
+ the function without any declaration. This option applies only to
+ `protoize'.
+
+`-n'
+ Make no real changes. This mode just prints information about the
+ conversions that would have been done without `-n'.
+
+`-N'
+ Make no `.save' files. The original files are simply deleted.
+ Use this option with caution.
+
+`-p PROGRAM'
+ Use the program PROGRAM as the compiler. Normally, the name `gcc'
+ is used.
+
+`-q'
+ Work quietly. Most warnings are suppressed.
+
+`-v'
+ Print the version number, just like `-v' for `gcc'.
+
+ If you need special compiler options to compile one of your program's
+source files, then you should generate that file's `.X' file specially,
+by running `gcc' on that source file with the appropriate options and
+the option `-aux-info'. Then run `protoize' on the entire set of
+files. `protoize' will use the existing `.X' file because it is newer
+than the source file. For example:
+
+ gcc -Dfoo=bar file1.c -aux-info file1.X
+ protoize *.c
+
+You need to include the special files along with the rest in the
+`protoize' command, even though their `.X' files already exist, because
+otherwise they won't get converted.
+
+ *Note Protoize Caveats::, for more information on how to use
+`protoize' successfully.
+
+
+File: gcc.info, Node: C Implementation, Next: C Extensions, Prev: Invoking GCC, Up: Top
+
+4 C Implementation-defined behavior
+***********************************
+
+A conforming implementation of ISO C is required to document its choice
+of behavior in each of the areas that are designated "implementation
+defined". The following lists all such areas, along with the section
+numbers from the ISO/IEC 9899:1990 and ISO/IEC 9899:1999 standards.
+Some areas are only implementation-defined in one version of the
+standard.
+
+ Some choices depend on the externally determined ABI for the platform
+(including standard character encodings) which GCC follows; these are
+listed as "determined by ABI" below. *Note Binary Compatibility:
+Compatibility, and `http://gcc.gnu.org/readings.html'. Some choices
+are documented in the preprocessor manual. *Note
+Implementation-defined behavior: (cpp)Implementation-defined behavior.
+Some choices are made by the library and operating system (or other
+environment when compiling for a freestanding environment); refer to
+their documentation for details.
+
+* Menu:
+
+* Translation implementation::
+* Environment implementation::
+* Identifiers implementation::
+* Characters implementation::
+* Integers implementation::
+* Floating point implementation::
+* Arrays and pointers implementation::
+* Hints implementation::
+* Structures unions enumerations and bit-fields implementation::
+* Qualifiers implementation::
+* Declarators implementation::
+* Statements implementation::
+* Preprocessing directives implementation::
+* Library functions implementation::
+* Architecture implementation::
+* Locale-specific behavior implementation::
+
+
+File: gcc.info, Node: Translation implementation, Next: Environment implementation, Up: C Implementation
+
+4.1 Translation
+===============
+
+ * `How a diagnostic is identified (C90 3.7, C99 3.10, C90 and C99
+ 5.1.1.3).'
+
+ Diagnostics consist of all the output sent to stderr by GCC.
+
+ * `Whether each nonempty sequence of white-space characters other
+ than new-line is retained or replaced by one space character in
+ translation phase 3 (C90 and C99 5.1.1.2).'
+
+ *Note Implementation-defined behavior: (cpp)Implementation-defined
+ behavior.
+
+
+
+File: gcc.info, Node: Environment implementation, Next: Identifiers implementation, Prev: Translation implementation, Up: C Implementation
+
+4.2 Environment
+===============
+
+The behavior of most of these points are dependent on the implementation
+of the C library, and are not defined by GCC itself.
+
+ * `The mapping between physical source file multibyte characters and
+ the source character set in translation phase 1 (C90 and C99
+ 5.1.1.2).'
+
+ *Note Implementation-defined behavior: (cpp)Implementation-defined
+ behavior.
+
+
+
+File: gcc.info, Node: Identifiers implementation, Next: Characters implementation, Prev: Environment implementation, Up: C Implementation
+
+4.3 Identifiers
+===============
+
+ * `Which additional multibyte characters may appear in identifiers
+ and their correspondence to universal character names (C99 6.4.2).'
+
+ *Note Implementation-defined behavior: (cpp)Implementation-defined
+ behavior.
+
+ * `The number of significant initial characters in an identifier
+ (C90 6.1.2, C90 and C99 5.2.4.1, C99 6.4.2).'
+
+ For internal names, all characters are significant. For external
+ names, the number of significant characters are defined by the
+ linker; for almost all targets, all characters are significant.
+
+ * `Whether case distinctions are significant in an identifier with
+ external linkage (C90 6.1.2).'
+
+ This is a property of the linker. C99 requires that case
+ distinctions are always significant in identifiers with external
+ linkage and systems without this property are not supported by GCC.
+
+
+
+File: gcc.info, Node: Characters implementation, Next: Integers implementation, Prev: Identifiers implementation, Up: C Implementation
+
+4.4 Characters
+==============
+
+ * `The number of bits in a byte (C90 3.4, C99 3.6).'
+
+ Determined by ABI.
+
+ * `The values of the members of the execution character set (C90 and
+ C99 5.2.1).'
+
+ Determined by ABI.
+
+ * `The unique value of the member of the execution character set
+ produced for each of the standard alphabetic escape sequences (C90
+ and C99 5.2.2).'
+
+ Determined by ABI.
+
+ * `The value of a `char' object into which has been stored any
+ character other than a member of the basic execution character set
+ (C90 6.1.2.5, C99 6.2.5).'
+
+ Determined by ABI.
+
+ * `Which of `signed char' or `unsigned char' has the same range,
+ representation, and behavior as "plain" `char' (C90 6.1.2.5, C90
+ 6.2.1.1, C99 6.2.5, C99 6.3.1.1).'
+
+ Determined by ABI. The options `-funsigned-char' and
+ `-fsigned-char' change the default. *Note Options Controlling C
+ Dialect: C Dialect Options.
+
+ * `The mapping of members of the source character set (in character
+ constants and string literals) to members of the execution
+ character set (C90 6.1.3.4, C99 6.4.4.4, C90 and C99 5.1.1.2).'
+
+ Determined by ABI.
+
+ * `The value of an integer character constant containing more than
+ one character or containing a character or escape sequence that
+ does not map to a single-byte execution character (C90 6.1.3.4,
+ C99 6.4.4.4).'
+
+ *Note Implementation-defined behavior: (cpp)Implementation-defined
+ behavior.
+
+ * `The value of a wide character constant containing more than one
+ multibyte character, or containing a multibyte character or escape
+ sequence not represented in the extended execution character set
+ (C90 6.1.3.4, C99 6.4.4.4).'
+
+ *Note Implementation-defined behavior: (cpp)Implementation-defined
+ behavior.
+
+ * `The current locale used to convert a wide character constant
+ consisting of a single multibyte character that maps to a member
+ of the extended execution character set into a corresponding wide
+ character code (C90 6.1.3.4, C99 6.4.4.4).'
+
+ *Note Implementation-defined behavior: (cpp)Implementation-defined
+ behavior.
+
+ * `The current locale used to convert a wide string literal into
+ corresponding wide character codes (C90 6.1.4, C99 6.4.5).'
+
+ *Note Implementation-defined behavior: (cpp)Implementation-defined
+ behavior.
+
+ * `The value of a string literal containing a multibyte character or
+ escape sequence not represented in the execution character set
+ (C90 6.1.4, C99 6.4.5).'
+
+ *Note Implementation-defined behavior: (cpp)Implementation-defined
+ behavior.
+
+
+File: gcc.info, Node: Integers implementation, Next: Floating point implementation, Prev: Characters implementation, Up: C Implementation
+
+4.5 Integers
+============
+
+ * `Any extended integer types that exist in the implementation (C99
+ 6.2.5).'
+
+ GCC does not support any extended integer types.
+
+ * `Whether signed integer types are represented using sign and
+ magnitude, two's complement, or one's complement, and whether the
+ extraordinary value is a trap representation or an ordinary value
+ (C99 6.2.6.2).'
+
+ GCC supports only two's complement integer types, and all bit
+ patterns are ordinary values.
+
+ * `The rank of any extended integer type relative to another extended
+ integer type with the same precision (C99 6.3.1.1).'
+
+ GCC does not support any extended integer types.
+
+ * `The result of, or the signal raised by, converting an integer to a
+ signed integer type when the value cannot be represented in an
+ object of that type (C90 6.2.1.2, C99 6.3.1.3).'
+
+ For conversion to a type of width N, the value is reduced modulo
+ 2^N to be within range of the type; no signal is raised.
+
+ * `The results of some bitwise operations on signed integers (C90
+ 6.3, C99 6.5).'
+
+ Bitwise operators act on the representation of the value including
+ both the sign and value bits, where the sign bit is considered
+ immediately above the highest-value value bit. Signed `>>' acts
+ on negative numbers by sign extension.
+
+ GCC does not use the latitude given in C99 only to treat certain
+ aspects of signed `<<' as undefined, but this is subject to change.
+
+ * `The sign of the remainder on integer division (C90 6.3.5).'
+
+ GCC always follows the C99 requirement that the result of division
+ is truncated towards zero.
+
+
+
+File: gcc.info, Node: Floating point implementation, Next: Arrays and pointers implementation, Prev: Integers implementation, Up: C Implementation
+
+4.6 Floating point
+==================
+
+ * `The accuracy of the floating-point operations and of the library
+ functions in `<math.h>' and `<complex.h>' that return
+ floating-point results (C90 and C99 5.2.4.2.2).'
+
+ The accuracy is unknown.
+
+ * `The rounding behaviors characterized by non-standard values of
+ `FLT_ROUNDS' (C90 and C99 5.2.4.2.2).'
+
+ GCC does not use such values.
+
+ * `The evaluation methods characterized by non-standard negative
+ values of `FLT_EVAL_METHOD' (C99 5.2.4.2.2).'
+
+ GCC does not use such values.
+
+ * `The direction of rounding when an integer is converted to a
+ floating-point number that cannot exactly represent the original
+ value (C90 6.2.1.3, C99 6.3.1.4).'
+
+ C99 Annex F is followed.
+
+ * `The direction of rounding when a floating-point number is
+ converted to a narrower floating-point number (C90 6.2.1.4, C99
+ 6.3.1.5).'
+
+ C99 Annex F is followed.
+
+ * `How the nearest representable value or the larger or smaller
+ representable value immediately adjacent to the nearest
+ representable value is chosen for certain floating constants (C90
+ 6.1.3.1, C99 6.4.4.2).'
+
+ C99 Annex F is followed.
+
+ * `Whether and how floating expressions are contracted when not
+ disallowed by the `FP_CONTRACT' pragma (C99 6.5).'
+
+ Expressions are currently only contracted if
+ `-funsafe-math-optimizations' or `-ffast-math' are used. This is
+ subject to change.
+
+ * `The default state for the `FENV_ACCESS' pragma (C99 7.6.1).'
+
+ This pragma is not implemented, but the default is to "off" unless
+ `-frounding-math' is used in which case it is "on".
+
+ * `Additional floating-point exceptions, rounding modes,
+ environments, and classifications, and their macro names (C99 7.6,
+ C99 7.12).'
+
+ This is dependent on the implementation of the C library, and is
+ not defined by GCC itself.
+
+ * `The default state for the `FP_CONTRACT' pragma (C99 7.12.2).'
+
+ This pragma is not implemented. Expressions are currently only
+ contracted if `-funsafe-math-optimizations' or `-ffast-math' are
+ used. This is subject to change.
+
+ * `Whether the "inexact" floating-point exception can be raised when
+ the rounded result actually does equal the mathematical result in
+ an IEC 60559 conformant implementation (C99 F.9).'
+
+ This is dependent on the implementation of the C library, and is
+ not defined by GCC itself.
+
+ * `Whether the "underflow" (and "inexact") floating-point exception
+ can be raised when a result is tiny but not inexact in an IEC
+ 60559 conformant implementation (C99 F.9).'
+
+ This is dependent on the implementation of the C library, and is
+ not defined by GCC itself.
+
+
+
+File: gcc.info, Node: Arrays and pointers implementation, Next: Hints implementation, Prev: Floating point implementation, Up: C Implementation
+
+4.7 Arrays and pointers
+=======================
+
+ * `The result of converting a pointer to an integer or vice versa
+ (C90 6.3.4, C99 6.3.2.3).'
+
+ A cast from pointer to integer discards most-significant bits if
+ the pointer representation is larger than the integer type,
+ sign-extends(1) if the pointer representation is smaller than the
+ integer type, otherwise the bits are unchanged.
+
+ A cast from integer to pointer discards most-significant bits if
+ the pointer representation is smaller than the integer type,
+ extends according to the signedness of the integer type if the
+ pointer representation is larger than the integer type, otherwise
+ the bits are unchanged.
+
+ When casting from pointer to integer and back again, the resulting
+ pointer must reference the same object as the original pointer,
+ otherwise the behavior is undefined. That is, one may not use
+ integer arithmetic to avoid the undefined behavior of pointer
+ arithmetic as proscribed in C99 6.5.6/8.
+
+ * `The size of the result of subtracting two pointers to elements of
+ the same array (C90 6.3.6, C99 6.5.6).'
+
+ The value is as specified in the standard and the type is
+ determined by the ABI.
+
+
+ ---------- Footnotes ----------
+
+ (1) Future versions of GCC may zero-extend, or use a target-defined
+`ptr_extend' pattern. Do not rely on sign extension.
+
+
+File: gcc.info, Node: Hints implementation, Next: Structures unions enumerations and bit-fields implementation, Prev: Arrays and pointers implementation, Up: C Implementation
+
+4.8 Hints
+=========
+
+ * `The extent to which suggestions made by using the `register'
+ storage-class specifier are effective (C90 6.5.1, C99 6.7.1).'
+
+ The `register' specifier affects code generation only in these
+ ways:
+
+ * When used as part of the register variable extension, see
+ *Note Explicit Reg Vars::.
+
+ * When `-O0' is in use, the compiler allocates distinct stack
+ memory for all variables that do not have the `register'
+ storage-class specifier; if `register' is specified, the
+ variable may have a shorter lifespan than the code would
+ indicate and may never be placed in memory.
+
+ * On some rare x86 targets, `setjmp' doesn't save the registers
+ in all circumstances. In those cases, GCC doesn't allocate
+ any variables in registers unless they are marked `register'.
+
+
+ * `The extent to which suggestions made by using the inline function
+ specifier are effective (C99 6.7.4).'
+
+ GCC will not inline any functions if the `-fno-inline' option is
+ used or if `-O0' is used. Otherwise, GCC may still be unable to
+ inline a function for many reasons; the `-Winline' option may be
+ used to determine if a function has not been inlined and why not.
+
+
+
+File: gcc.info, Node: Structures unions enumerations and bit-fields implementation, Next: Qualifiers implementation, Prev: Hints implementation, Up: C Implementation
+
+4.9 Structures, unions, enumerations, and bit-fields
+====================================================
+
+ * `A member of a union object is accessed using a member of a
+ different type (C90 6.3.2.3).'
+
+ The relevant bytes of the representation of the object are treated
+ as an object of the type used for the access. *Note
+ Type-punning::. This may be a trap representation.
+
+ * `Whether a "plain" `int' bit-field is treated as a `signed int'
+ bit-field or as an `unsigned int' bit-field (C90 6.5.2, C90
+ 6.5.2.1, C99 6.7.2, C99 6.7.2.1).'
+
+ By default it is treated as `signed int' but this may be changed
+ by the `-funsigned-bitfields' option.
+
+ * `Allowable bit-field types other than `_Bool', `signed int', and
+ `unsigned int' (C99 6.7.2.1).'
+
+ No other types are permitted in strictly conforming mode.
+
+ * `Whether a bit-field can straddle a storage-unit boundary (C90
+ 6.5.2.1, C99 6.7.2.1).'
+
+ Determined by ABI.
+
+ * `The order of allocation of bit-fields within a unit (C90 6.5.2.1,
+ C99 6.7.2.1).'
+
+ Determined by ABI.
+
+ * `The alignment of non-bit-field members of structures (C90
+ 6.5.2.1, C99 6.7.2.1).'
+
+ Determined by ABI.
+
+ * `The integer type compatible with each enumerated type (C90
+ 6.5.2.2, C99 6.7.2.2).'
+
+ Normally, the type is `unsigned int' if there are no negative
+ values in the enumeration, otherwise `int'. If `-fshort-enums' is
+ specified, then if there are negative values it is the first of
+ `signed char', `short' and `int' that can represent all the
+ values, otherwise it is the first of `unsigned char', `unsigned
+ short' and `unsigned int' that can represent all the values.
+
+ On some targets, `-fshort-enums' is the default; this is
+ determined by the ABI.
+
+
+
+File: gcc.info, Node: Qualifiers implementation, Next: Declarators implementation, Prev: Structures unions enumerations and bit-fields implementation, Up: C Implementation
+
+4.10 Qualifiers
+===============
+
+ * `What constitutes an access to an object that has
+ volatile-qualified type (C90 6.5.3, C99 6.7.3).'
+
+ Such an object is normally accessed by pointers and used for
+ accessing hardware. In most expressions, it is intuitively
+ obvious what is a read and what is a write. For example
+
+ volatile int *dst = SOMEVALUE;
+ volatile int *src = SOMEOTHERVALUE;
+ *dst = *src;
+
+ will cause a read of the volatile object pointed to by SRC and
+ store the value into the volatile object pointed to by DST. There
+ is no guarantee that these reads and writes are atomic, especially
+ for objects larger than `int'.
+
+ However, if the volatile storage is not being modified, and the
+ value of the volatile storage is not used, then the situation is
+ less obvious. For example
+
+ volatile int *src = SOMEVALUE;
+ *src;
+
+ According to the C standard, such an expression is an rvalue whose
+ type is the unqualified version of its original type, i.e. `int'.
+ Whether GCC interprets this as a read of the volatile object being
+ pointed to or only as a request to evaluate the expression for its
+ side-effects depends on this type.
+
+ If it is a scalar type, or on most targets an aggregate type whose
+ only member object is of a scalar type, or a union type whose
+ member objects are of scalar types, the expression is interpreted
+ by GCC as a read of the volatile object; in the other cases, the
+ expression is only evaluated for its side-effects.
+
+
+
+File: gcc.info, Node: Declarators implementation, Next: Statements implementation, Prev: Qualifiers implementation, Up: C Implementation
+
+4.11 Declarators
+================
+
+ * `The maximum number of declarators that may modify an arithmetic,
+ structure or union type (C90 6.5.4).'
+
+ GCC is only limited by available memory.
+
+
+
+File: gcc.info, Node: Statements implementation, Next: Preprocessing directives implementation, Prev: Declarators implementation, Up: C Implementation
+
+4.12 Statements
+===============
+
+ * `The maximum number of `case' values in a `switch' statement (C90
+ 6.6.4.2).'
+
+ GCC is only limited by available memory.
+
+
+
+File: gcc.info, Node: Preprocessing directives implementation, Next: Library functions implementation, Prev: Statements implementation, Up: C Implementation
+
+4.13 Preprocessing directives
+=============================
+
+*Note Implementation-defined behavior: (cpp)Implementation-defined
+behavior, for details of these aspects of implementation-defined
+behavior.
+
+ * `How sequences in both forms of header names are mapped to headers
+ or external source file names (C90 6.1.7, C99 6.4.7).'
+
+ * `Whether the value of a character constant in a constant expression
+ that controls conditional inclusion matches the value of the same
+ character constant in the execution character set (C90 6.8.1, C99
+ 6.10.1).'
+
+ * `Whether the value of a single-character character constant in a
+ constant expression that controls conditional inclusion may have a
+ negative value (C90 6.8.1, C99 6.10.1).'
+
+ * `The places that are searched for an included `<>' delimited
+ header, and how the places are specified or the header is
+ identified (C90 6.8.2, C99 6.10.2).'
+
+ * `How the named source file is searched for in an included `""'
+ delimited header (C90 6.8.2, C99 6.10.2).'
+
+ * `The method by which preprocessing tokens (possibly resulting from
+ macro expansion) in a `#include' directive are combined into a
+ header name (C90 6.8.2, C99 6.10.2).'
+
+ * `The nesting limit for `#include' processing (C90 6.8.2, C99
+ 6.10.2).'
+
+ * `Whether the `#' operator inserts a `\' character before the `\'
+ character that begins a universal character name in a character
+ constant or string literal (C99 6.10.3.2).'
+
+ * `The behavior on each recognized non-`STDC #pragma' directive (C90
+ 6.8.6, C99 6.10.6).'
+
+ *Note Pragmas: (cpp)Pragmas, for details of pragmas accepted by
+ GCC on all targets. *Note Pragmas Accepted by GCC: Pragmas, for
+ details of target-specific pragmas.
+
+ * `The definitions for `__DATE__' and `__TIME__' when respectively,
+ the date and time of translation are not available (C90 6.8.8, C99
+ 6.10.8).'
+
+
+
+File: gcc.info, Node: Library functions implementation, Next: Architecture implementation, Prev: Preprocessing directives implementation, Up: C Implementation
+
+4.14 Library functions
+======================
+
+The behavior of most of these points are dependent on the implementation
+of the C library, and are not defined by GCC itself.
+
+ * `The null pointer constant to which the macro `NULL' expands (C90
+ 7.1.6, C99 7.17).'
+
+ In `<stddef.h>', `NULL' expands to `((void *)0)'. GCC does not
+ provide the other headers which define `NULL' and some library
+ implementations may use other definitions in those headers.
+
+
+
+File: gcc.info, Node: Architecture implementation, Next: Locale-specific behavior implementation, Prev: Library functions implementation, Up: C Implementation
+
+4.15 Architecture
+=================
+
+ * `The values or expressions assigned to the macros specified in the
+ headers `<float.h>', `<limits.h>', and `<stdint.h>' (C90 and C99
+ 5.2.4.2, C99 7.18.2, C99 7.18.3).'
+
+ Determined by ABI.
+
+ * `The number, order, and encoding of bytes in any object (when not
+ explicitly specified in this International Standard) (C99
+ 6.2.6.1).'
+
+ Determined by ABI.
+
+ * `The value of the result of the `sizeof' operator (C90 6.3.3.4,
+ C99 6.5.3.4).'
+
+ Determined by ABI.
+
+
+
+File: gcc.info, Node: Locale-specific behavior implementation, Prev: Architecture implementation, Up: C Implementation
+
+4.16 Locale-specific behavior
+=============================
+
+The behavior of these points are dependent on the implementation of the
+C library, and are not defined by GCC itself.
+
+
+File: gcc.info, Node: C Extensions, Next: C++ Extensions, Prev: C Implementation, Up: Top
+
+5 Extensions to the C Language Family
+*************************************
+
+GNU C provides several language features not found in ISO standard C.
+(The `-pedantic' option directs GCC to print a warning message if any
+of these features is used.) To test for the availability of these
+features in conditional compilation, check for a predefined macro
+`__GNUC__', which is always defined under GCC.
+
+ These extensions are available in C and Objective-C. Most of them are
+also available in C++. *Note Extensions to the C++ Language: C++
+Extensions, for extensions that apply _only_ to C++.
+
+ Some features that are in ISO C99 but not C89 or C++ are also, as
+extensions, accepted by GCC in C89 mode and in C++.
+
+* Menu:
+
+* Statement Exprs:: Putting statements and declarations inside expressions.
+* Local Labels:: Labels local to a block.
+* Labels as Values:: Getting pointers to labels, and computed gotos.
+* Nested Functions:: As in Algol and Pascal, lexical scoping of functions.
+* Constructing Calls:: Dispatching a call to another function.
+* Typeof:: `typeof': referring to the type of an expression.
+* Conditionals:: Omitting the middle operand of a `?:' expression.
+* Long Long:: Double-word integers---`long long int'.
+* Complex:: Data types for complex numbers.
+* Floating Types:: Additional Floating Types.
+* Decimal Float:: Decimal Floating Types.
+* Hex Floats:: Hexadecimal floating-point constants.
+* Fixed-Point:: Fixed-Point Types.
+* Zero Length:: Zero-length arrays.
+* Variable Length:: Arrays whose length is computed at run time.
+* Empty Structures:: Structures with no members.
+* Variadic Macros:: Macros with a variable number of arguments.
+* Escaped Newlines:: Slightly looser rules for escaped newlines.
+* Subscripting:: Any array can be subscripted, even if not an lvalue.
+* Pointer Arith:: Arithmetic on `void'-pointers and function pointers.
+* Initializers:: Non-constant initializers.
+* Compound Literals:: Compound literals give structures, unions
+ or arrays as values.
+* Designated Inits:: Labeling elements of initializers.
+* Cast to Union:: Casting to union type from any member of the union.
+* Case Ranges:: `case 1 ... 9' and such.
+* Mixed Declarations:: Mixing declarations and code.
+* Function Attributes:: Declaring that functions have no side effects,
+ or that they can never return.
+* Attribute Syntax:: Formal syntax for attributes.
+* Function Prototypes:: Prototype declarations and old-style definitions.
+* C++ Comments:: C++ comments are recognized.
+* Dollar Signs:: Dollar sign is allowed in identifiers.
+* Character Escapes:: `\e' stands for the character <ESC>.
+* Variable Attributes:: Specifying attributes of variables.
+* Type Attributes:: Specifying attributes of types.
+* Alignment:: Inquiring about the alignment of a type or variable.
+* Inline:: Defining inline functions (as fast as macros).
+* Extended Asm:: Assembler instructions with C expressions as operands.
+ (With them you can define ``built-in'' functions.)
+* Constraints:: Constraints for asm operands
+* Asm Labels:: Specifying the assembler name to use for a C symbol.
+* Explicit Reg Vars:: Defining variables residing in specified registers.
+* Alternate Keywords:: `__const__', `__asm__', etc., for header files.
+* Incomplete Enums:: `enum foo;', with details to follow.
+* Function Names:: Printable strings which are the name of the current
+ function.
+* Return Address:: Getting the return or frame address of a function.
+* Vector Extensions:: Using vector instructions through built-in functions.
+* Offsetof:: Special syntax for implementing `offsetof'.
+* Atomic Builtins:: Built-in functions for atomic memory access.
+* Object Size Checking:: Built-in functions for limited buffer overflow
+ checking.
+* Other Builtins:: Other built-in functions.
+* Target Builtins:: Built-in functions specific to particular targets.
+* Target Format Checks:: Format checks specific to particular targets.
+* Pragmas:: Pragmas accepted by GCC.
+* Unnamed Fields:: Unnamed struct/union fields within structs/unions.
+* Thread-Local:: Per-thread variables.
+* Binary constants:: Binary constants using the `0b' prefix.
+
+
+File: gcc.info, Node: Statement Exprs, Next: Local Labels, Up: C Extensions
+
+5.1 Statements and Declarations in Expressions
+==============================================
+
+A compound statement enclosed in parentheses may appear as an expression
+in GNU C. This allows you to use loops, switches, and local variables
+within an expression.
+
+ Recall that a compound statement is a sequence of statements surrounded
+by braces; in this construct, parentheses go around the braces. For
+example:
+
+ ({ int y = foo (); int z;
+ if (y > 0) z = y;
+ else z = - y;
+ z; })
+
+is a valid (though slightly more complex than necessary) expression for
+the absolute value of `foo ()'.
+
+ The last thing in the compound statement should be an expression
+followed by a semicolon; the value of this subexpression serves as the
+value of the entire construct. (If you use some other kind of statement
+last within the braces, the construct has type `void', and thus
+effectively no value.)
+
+ This feature is especially useful in making macro definitions "safe"
+(so that they evaluate each operand exactly once). For example, the
+"maximum" function is commonly defined as a macro in standard C as
+follows:
+
+ #define max(a,b) ((a) > (b) ? (a) : (b))
+
+But this definition computes either A or B twice, with bad results if
+the operand has side effects. In GNU C, if you know the type of the
+operands (here taken as `int'), you can define the macro safely as
+follows:
+
+ #define maxint(a,b) \
+ ({int _a = (a), _b = (b); _a > _b ? _a : _b; })
+
+ Embedded statements are not allowed in constant expressions, such as
+the value of an enumeration constant, the width of a bit-field, or the
+initial value of a static variable.
+
+ If you don't know the type of the operand, you can still do this, but
+you must use `typeof' (*note Typeof::).
+
+ In G++, the result value of a statement expression undergoes array and
+function pointer decay, and is returned by value to the enclosing
+expression. For instance, if `A' is a class, then
+
+ A a;
+
+ ({a;}).Foo ()
+
+will construct a temporary `A' object to hold the result of the
+statement expression, and that will be used to invoke `Foo'. Therefore
+the `this' pointer observed by `Foo' will not be the address of `a'.
+
+ Any temporaries created within a statement within a statement
+expression will be destroyed at the statement's end. This makes
+statement expressions inside macros slightly different from function
+calls. In the latter case temporaries introduced during argument
+evaluation will be destroyed at the end of the statement that includes
+the function call. In the statement expression case they will be
+destroyed during the statement expression. For instance,
+
+ #define macro(a) ({__typeof__(a) b = (a); b + 3; })
+ template<typename T> T function(T a) { T b = a; return b + 3; }
+
+ void foo ()
+ {
+ macro (X ());
+ function (X ());
+ }
+
+will have different places where temporaries are destroyed. For the
+`macro' case, the temporary `X' will be destroyed just after the
+initialization of `b'. In the `function' case that temporary will be
+destroyed when the function returns.
+
+ These considerations mean that it is probably a bad idea to use
+statement-expressions of this form in header files that are designed to
+work with C++. (Note that some versions of the GNU C Library contained
+header files using statement-expression that lead to precisely this
+bug.)
+
+ Jumping into a statement expression with `goto' or using a `switch'
+statement outside the statement expression with a `case' or `default'
+label inside the statement expression is not permitted. Jumping into a
+statement expression with a computed `goto' (*note Labels as Values::)
+yields undefined behavior. Jumping out of a statement expression is
+permitted, but if the statement expression is part of a larger
+expression then it is unspecified which other subexpressions of that
+expression have been evaluated except where the language definition
+requires certain subexpressions to be evaluated before or after the
+statement expression. In any case, as with a function call the
+evaluation of a statement expression is not interleaved with the
+evaluation of other parts of the containing expression. For example,
+
+ foo (), (({ bar1 (); goto a; 0; }) + bar2 ()), baz();
+
+will call `foo' and `bar1' and will not call `baz' but may or may not
+call `bar2'. If `bar2' is called, it will be called after `foo' and
+before `bar1'
+
+
+File: gcc.info, Node: Local Labels, Next: Labels as Values, Prev: Statement Exprs, Up: C Extensions
+
+5.2 Locally Declared Labels
+===========================
+
+GCC allows you to declare "local labels" in any nested block scope. A
+local label is just like an ordinary label, but you can only reference
+it (with a `goto' statement, or by taking its address) within the block
+in which it was declared.
+
+ A local label declaration looks like this:
+
+ __label__ LABEL;
+
+or
+
+ __label__ LABEL1, LABEL2, /* ... */;
+
+ Local label declarations must come at the beginning of the block,
+before any ordinary declarations or statements.
+
+ The label declaration defines the label _name_, but does not define
+the label itself. You must do this in the usual way, with `LABEL:',
+within the statements of the statement expression.
+
+ The local label feature is useful for complex macros. If a macro
+contains nested loops, a `goto' can be useful for breaking out of them.
+However, an ordinary label whose scope is the whole function cannot be
+used: if the macro can be expanded several times in one function, the
+label will be multiply defined in that function. A local label avoids
+this problem. For example:
+
+ #define SEARCH(value, array, target) \
+ do { \
+ __label__ found; \
+ typeof (target) _SEARCH_target = (target); \
+ typeof (*(array)) *_SEARCH_array = (array); \
+ int i, j; \
+ int value; \
+ for (i = 0; i < max; i++) \
+ for (j = 0; j < max; j++) \
+ if (_SEARCH_array[i][j] == _SEARCH_target) \
+ { (value) = i; goto found; } \
+ (value) = -1; \
+ found:; \
+ } while (0)
+
+ This could also be written using a statement-expression:
+
+ #define SEARCH(array, target) \
+ ({ \
+ __label__ found; \
+ typeof (target) _SEARCH_target = (target); \
+ typeof (*(array)) *_SEARCH_array = (array); \
+ int i, j; \
+ int value; \
+ for (i = 0; i < max; i++) \
+ for (j = 0; j < max; j++) \
+ if (_SEARCH_array[i][j] == _SEARCH_target) \
+ { value = i; goto found; } \
+ value = -1; \
+ found: \
+ value; \
+ })
+
+ Local label declarations also make the labels they declare visible to
+nested functions, if there are any. *Note Nested Functions::, for
+details.
+
+
+File: gcc.info, Node: Labels as Values, Next: Nested Functions, Prev: Local Labels, Up: C Extensions
+
+5.3 Labels as Values
+====================
+
+You can get the address of a label defined in the current function (or
+a containing function) with the unary operator `&&'. The value has
+type `void *'. This value is a constant and can be used wherever a
+constant of that type is valid. For example:
+
+ void *ptr;
+ /* ... */
+ ptr = &&foo;
+
+ To use these values, you need to be able to jump to one. This is done
+with the computed goto statement(1), `goto *EXP;'. For example,
+
+ goto *ptr;
+
+Any expression of type `void *' is allowed.
+
+ One way of using these constants is in initializing a static array that
+will serve as a jump table:
+
+ static void *array[] = { &&foo, &&bar, &&hack };
+
+ Then you can select a label with indexing, like this:
+
+ goto *array[i];
+
+Note that this does not check whether the subscript is in bounds--array
+indexing in C never does that.
+
+ Such an array of label values serves a purpose much like that of the
+`switch' statement. The `switch' statement is cleaner, so use that
+rather than an array unless the problem does not fit a `switch'
+statement very well.
+
+ Another use of label values is in an interpreter for threaded code.
+The labels within the interpreter function can be stored in the
+threaded code for super-fast dispatching.
+
+ You may not use this mechanism to jump to code in a different function.
+If you do that, totally unpredictable things will happen. The best way
+to avoid this is to store the label address only in automatic variables
+and never pass it as an argument.
+
+ An alternate way to write the above example is
+
+ static const int array[] = { &&foo - &&foo, &&bar - &&foo,
+ &&hack - &&foo };
+ goto *(&&foo + array[i]);
+
+This is more friendly to code living in shared libraries, as it reduces
+the number of dynamic relocations that are needed, and by consequence,
+allows the data to be read-only.
+
+ The `&&foo' expressions for the same label might have different values
+if the containing function is inlined or cloned. If a program relies on
+them being always the same, `__attribute__((__noinline__))' should be
+used to prevent inlining. If `&&foo' is used in a static variable
+initializer, inlining is forbidden.
+
+ ---------- Footnotes ----------
+
+ (1) The analogous feature in Fortran is called an assigned goto, but
+that name seems inappropriate in C, where one can do more than simply
+store label addresses in label variables.
+
+
+File: gcc.info, Node: Nested Functions, Next: Constructing Calls, Prev: Labels as Values, Up: C Extensions
+
+5.4 Nested Functions
+====================
+
+A "nested function" is a function defined inside another function.
+(Nested functions are not supported for GNU C++.) The nested function's
+name is local to the block where it is defined. For example, here we
+define a nested function named `square', and call it twice:
+
+ foo (double a, double b)
+ {
+ double square (double z) { return z * z; }
+
+ return square (a) + square (b);
+ }
+
+ The nested function can access all the variables of the containing
+function that are visible at the point of its definition. This is
+called "lexical scoping". For example, here we show a nested function
+which uses an inherited variable named `offset':
+
+ bar (int *array, int offset, int size)
+ {
+ int access (int *array, int index)
+ { return array[index + offset]; }
+ int i;
+ /* ... */
+ for (i = 0; i < size; i++)
+ /* ... */ access (array, i) /* ... */
+ }
+
+ Nested function definitions are permitted within functions in the
+places where variable definitions are allowed; that is, in any block,
+mixed with the other declarations and statements in the block.
+
+ It is possible to call the nested function from outside the scope of
+its name by storing its address or passing the address to another
+function:
+
+ hack (int *array, int size)
+ {
+ void store (int index, int value)
+ { array[index] = value; }
+
+ intermediate (store, size);
+ }
+
+ Here, the function `intermediate' receives the address of `store' as
+an argument. If `intermediate' calls `store', the arguments given to
+`store' are used to store into `array'. But this technique works only
+so long as the containing function (`hack', in this example) does not
+exit.
+
+ If you try to call the nested function through its address after the
+containing function has exited, all hell will break loose. If you try
+to call it after a containing scope level has exited, and if it refers
+to some of the variables that are no longer in scope, you may be lucky,
+but it's not wise to take the risk. If, however, the nested function
+does not refer to anything that has gone out of scope, you should be
+safe.
+
+ GCC implements taking the address of a nested function using a
+technique called "trampolines". A paper describing them is available as
+
+`http://people.debian.org/~aaronl/Usenix88-lexic.pdf'.
+
+ A nested function can jump to a label inherited from a containing
+function, provided the label was explicitly declared in the containing
+function (*note Local Labels::). Such a jump returns instantly to the
+containing function, exiting the nested function which did the `goto'
+and any intermediate functions as well. Here is an example:
+
+ bar (int *array, int offset, int size)
+ {
+ __label__ failure;
+ int access (int *array, int index)
+ {
+ if (index > size)
+ goto failure;
+ return array[index + offset];
+ }
+ int i;
+ /* ... */
+ for (i = 0; i < size; i++)
+ /* ... */ access (array, i) /* ... */
+ /* ... */
+ return 0;
+
+ /* Control comes here from `access'
+ if it detects an error. */
+ failure:
+ return -1;
+ }
+
+ A nested function always has no linkage. Declaring one with `extern'
+or `static' is erroneous. If you need to declare the nested function
+before its definition, use `auto' (which is otherwise meaningless for
+function declarations).
+
+ bar (int *array, int offset, int size)
+ {
+ __label__ failure;
+ auto int access (int *, int);
+ /* ... */
+ int access (int *array, int index)
+ {
+ if (index > size)
+ goto failure;
+ return array[index + offset];
+ }
+ /* ... */
+ }
+
+
+File: gcc.info, Node: Constructing Calls, Next: Typeof, Prev: Nested Functions, Up: C Extensions
+
+5.5 Constructing Function Calls
+===============================
+
+Using the built-in functions described below, you can record the
+arguments a function received, and call another function with the same
+arguments, without knowing the number or types of the arguments.
+
+ You can also record the return value of that function call, and later
+return that value, without knowing what data type the function tried to
+return (as long as your caller expects that data type).
+
+ However, these built-in functions may interact badly with some
+sophisticated features or other extensions of the language. It is,
+therefore, not recommended to use them outside very simple functions
+acting as mere forwarders for their arguments.
+
+ -- Built-in Function: void * __builtin_apply_args ()
+ This built-in function returns a pointer to data describing how to
+ perform a call with the same arguments as were passed to the
+ current function.
+
+ The function saves the arg pointer register, structure value
+ address, and all registers that might be used to pass arguments to
+ a function into a block of memory allocated on the stack. Then it
+ returns the address of that block.
+
+ -- Built-in Function: void * __builtin_apply (void (*FUNCTION)(), void
+ *ARGUMENTS, size_t SIZE)
+ This built-in function invokes FUNCTION with a copy of the
+ parameters described by ARGUMENTS and SIZE.
+
+ The value of ARGUMENTS should be the value returned by
+ `__builtin_apply_args'. The argument SIZE specifies the size of
+ the stack argument data, in bytes.
+
+ This function returns a pointer to data describing how to return
+ whatever value was returned by FUNCTION. The data is saved in a
+ block of memory allocated on the stack.
+
+ It is not always simple to compute the proper value for SIZE. The
+ value is used by `__builtin_apply' to compute the amount of data
+ that should be pushed on the stack and copied from the incoming
+ argument area.
+
+ -- Built-in Function: void __builtin_return (void *RESULT)
+ This built-in function returns the value described by RESULT from
+ the containing function. You should specify, for RESULT, a value
+ returned by `__builtin_apply'.
+
+ -- Built-in Function: __builtin_va_arg_pack ()
+ This built-in function represents all anonymous arguments of an
+ inline function. It can be used only in inline functions which
+ will be always inlined, never compiled as a separate function,
+ such as those using `__attribute__ ((__always_inline__))' or
+ `__attribute__ ((__gnu_inline__))' extern inline functions. It
+ must be only passed as last argument to some other function with
+ variable arguments. This is useful for writing small wrapper
+ inlines for variable argument functions, when using preprocessor
+ macros is undesirable. For example:
+ extern int myprintf (FILE *f, const char *format, ...);
+ extern inline __attribute__ ((__gnu_inline__)) int
+ myprintf (FILE *f, const char *format, ...)
+ {
+ int r = fprintf (f, "myprintf: ");
+ if (r < 0)
+ return r;
+ int s = fprintf (f, format, __builtin_va_arg_pack ());
+ if (s < 0)
+ return s;
+ return r + s;
+ }
+
+ -- Built-in Function: __builtin_va_arg_pack_len ()
+ This built-in function returns the number of anonymous arguments of
+ an inline function. It can be used only in inline functions which
+ will be always inlined, never compiled as a separate function, such
+ as those using `__attribute__ ((__always_inline__))' or
+ `__attribute__ ((__gnu_inline__))' extern inline functions. For
+ example following will do link or runtime checking of open
+ arguments for optimized code:
+ #ifdef __OPTIMIZE__
+ extern inline __attribute__((__gnu_inline__)) int
+ myopen (const char *path, int oflag, ...)
+ {
+ if (__builtin_va_arg_pack_len () > 1)
+ warn_open_too_many_arguments ();
+
+ if (__builtin_constant_p (oflag))
+ {
+ if ((oflag & O_CREAT) != 0 && __builtin_va_arg_pack_len () < 1)
+ {
+ warn_open_missing_mode ();
+ return __open_2 (path, oflag);
+ }
+ return open (path, oflag, __builtin_va_arg_pack ());
+ }
+
+ if (__builtin_va_arg_pack_len () < 1)
+ return __open_2 (path, oflag);
+
+ return open (path, oflag, __builtin_va_arg_pack ());
+ }
+ #endif
+
+
+File: gcc.info, Node: Typeof, Next: Conditionals, Prev: Constructing Calls, Up: C Extensions
+
+5.6 Referring to a Type with `typeof'
+=====================================
+
+Another way to refer to the type of an expression is with `typeof'.
+The syntax of using of this keyword looks like `sizeof', but the
+construct acts semantically like a type name defined with `typedef'.
+
+ There are two ways of writing the argument to `typeof': with an
+expression or with a type. Here is an example with an expression:
+
+ typeof (x[0](1))
+
+This assumes that `x' is an array of pointers to functions; the type
+described is that of the values of the functions.
+
+ Here is an example with a typename as the argument:
+
+ typeof (int *)
+
+Here the type described is that of pointers to `int'.
+
+ If you are writing a header file that must work when included in ISO C
+programs, write `__typeof__' instead of `typeof'. *Note Alternate
+Keywords::.
+
+ A `typeof'-construct can be used anywhere a typedef name could be
+used. For example, you can use it in a declaration, in a cast, or
+inside of `sizeof' or `typeof'.
+
+ `typeof' is often useful in conjunction with the
+statements-within-expressions feature. Here is how the two together can
+be used to define a safe "maximum" macro that operates on any
+arithmetic type and evaluates each of its arguments exactly once:
+
+ #define max(a,b) \
+ ({ typeof (a) _a = (a); \
+ typeof (b) _b = (b); \
+ _a > _b ? _a : _b; })
+
+ The reason for using names that start with underscores for the local
+variables is to avoid conflicts with variable names that occur within
+the expressions that are substituted for `a' and `b'. Eventually we
+hope to design a new form of declaration syntax that allows you to
+declare variables whose scopes start only after their initializers;
+this will be a more reliable way to prevent such conflicts.
+
+Some more examples of the use of `typeof':
+
+ * This declares `y' with the type of what `x' points to.
+
+ typeof (*x) y;
+
+ * This declares `y' as an array of such values.
+
+ typeof (*x) y[4];
+
+ * This declares `y' as an array of pointers to characters:
+
+ typeof (typeof (char *)[4]) y;
+
+ It is equivalent to the following traditional C declaration:
+
+ char *y[4];
+
+ To see the meaning of the declaration using `typeof', and why it
+ might be a useful way to write, rewrite it with these macros:
+
+ #define pointer(T) typeof(T *)
+ #define array(T, N) typeof(T [N])
+
+ Now the declaration can be rewritten this way:
+
+ array (pointer (char), 4) y;
+
+ Thus, `array (pointer (char), 4)' is the type of arrays of 4
+ pointers to `char'.
+
+ _Compatibility Note:_ In addition to `typeof', GCC 2 supported a more
+limited extension which permitted one to write
+
+ typedef T = EXPR;
+
+with the effect of declaring T to have the type of the expression EXPR.
+This extension does not work with GCC 3 (versions between 3.0 and 3.2
+will crash; 3.2.1 and later give an error). Code which relies on it
+should be rewritten to use `typeof':
+
+ typedef typeof(EXPR) T;
+
+This will work with all versions of GCC.
+
+
+File: gcc.info, Node: Conditionals, Next: Long Long, Prev: Typeof, Up: C Extensions
+
+5.7 Conditionals with Omitted Operands
+======================================
+
+The middle operand in a conditional expression may be omitted. Then if
+the first operand is nonzero, its value is the value of the conditional
+expression.
+
+ Therefore, the expression
+
+ x ? : y
+
+has the value of `x' if that is nonzero; otherwise, the value of `y'.
+
+ This example is perfectly equivalent to
+
+ x ? x : y
+
+In this simple case, the ability to omit the middle operand is not
+especially useful. When it becomes useful is when the first operand
+does, or may (if it is a macro argument), contain a side effect. Then
+repeating the operand in the middle would perform the side effect
+twice. Omitting the middle operand uses the value already computed
+without the undesirable effects of recomputing it.
+
+
+File: gcc.info, Node: Long Long, Next: Complex, Prev: Conditionals, Up: C Extensions
+
+5.8 Double-Word Integers
+========================
+
+ISO C99 supports data types for integers that are at least 64 bits wide,
+and as an extension GCC supports them in C89 mode and in C++. Simply
+write `long long int' for a signed integer, or `unsigned long long int'
+for an unsigned integer. To make an integer constant of type `long
+long int', add the suffix `LL' to the integer. To make an integer
+constant of type `unsigned long long int', add the suffix `ULL' to the
+integer.
+
+ You can use these types in arithmetic like any other integer types.
+Addition, subtraction, and bitwise boolean operations on these types
+are open-coded on all types of machines. Multiplication is open-coded
+if the machine supports fullword-to-doubleword a widening multiply
+instruction. Division and shifts are open-coded only on machines that
+provide special support. The operations that are not open-coded use
+special library routines that come with GCC.
+
+ There may be pitfalls when you use `long long' types for function
+arguments, unless you declare function prototypes. If a function
+expects type `int' for its argument, and you pass a value of type `long
+long int', confusion will result because the caller and the subroutine
+will disagree about the number of bytes for the argument. Likewise, if
+the function expects `long long int' and you pass `int'. The best way
+to avoid such problems is to use prototypes.
+
+
+File: gcc.info, Node: Complex, Next: Floating Types, Prev: Long Long, Up: C Extensions
+
+5.9 Complex Numbers
+===================
+
+ISO C99 supports complex floating data types, and as an extension GCC
+supports them in C89 mode and in C++, and supports complex integer data
+types which are not part of ISO C99. You can declare complex types
+using the keyword `_Complex'. As an extension, the older GNU keyword
+`__complex__' is also supported.
+
+ For example, `_Complex double x;' declares `x' as a variable whose
+real part and imaginary part are both of type `double'. `_Complex
+short int y;' declares `y' to have real and imaginary parts of type
+`short int'; this is not likely to be useful, but it shows that the set
+of complex types is complete.
+
+ To write a constant with a complex data type, use the suffix `i' or
+`j' (either one; they are equivalent). For example, `2.5fi' has type
+`_Complex float' and `3i' has type `_Complex int'. Such a constant
+always has a pure imaginary value, but you can form any complex value
+you like by adding one to a real constant. This is a GNU extension; if
+you have an ISO C99 conforming C library (such as GNU libc), and want
+to construct complex constants of floating type, you should include
+`<complex.h>' and use the macros `I' or `_Complex_I' instead.
+
+ To extract the real part of a complex-valued expression EXP, write
+`__real__ EXP'. Likewise, use `__imag__' to extract the imaginary
+part. This is a GNU extension; for values of floating type, you should
+use the ISO C99 functions `crealf', `creal', `creall', `cimagf',
+`cimag' and `cimagl', declared in `<complex.h>' and also provided as
+built-in functions by GCC.
+
+ The operator `~' performs complex conjugation when used on a value
+with a complex type. This is a GNU extension; for values of floating
+type, you should use the ISO C99 functions `conjf', `conj' and `conjl',
+declared in `<complex.h>' and also provided as built-in functions by
+GCC.
+
+ GCC can allocate complex automatic variables in a noncontiguous
+fashion; it's even possible for the real part to be in a register while
+the imaginary part is on the stack (or vice-versa). Only the DWARF2
+debug info format can represent this, so use of DWARF2 is recommended.
+If you are using the stabs debug info format, GCC describes a
+noncontiguous complex variable as if it were two separate variables of
+noncomplex type. If the variable's actual name is `foo', the two
+fictitious variables are named `foo$real' and `foo$imag'. You can
+examine and set these two fictitious variables with your debugger.
+
+
+File: gcc.info, Node: Floating Types, Next: Decimal Float, Prev: Complex, Up: C Extensions
+
+5.10 Additional Floating Types
+==============================
+
+As an extension, the GNU C compiler supports additional floating types,
+`__float80' and `__float128' to support 80bit (`XFmode') and 128 bit
+(`TFmode') floating types. Support for additional types includes the
+arithmetic operators: add, subtract, multiply, divide; unary arithmetic
+operators; relational operators; equality operators; and conversions to
+and from integer and other floating types. Use a suffix `w' or `W' in
+a literal constant of type `__float80' and `q' or `Q' for `_float128'.
+You can declare complex types using the corresponding internal complex
+type, `XCmode' for `__float80' type and `TCmode' for `__float128' type:
+
+ typedef _Complex float __attribute__((mode(TC))) _Complex128;
+ typedef _Complex float __attribute__((mode(XC))) _Complex80;
+
+ Not all targets support additional floating point types. `__float80'
+and `__float128' types are supported on i386, x86_64 and ia64 targets.
+
+
+File: gcc.info, Node: Decimal Float, Next: Hex Floats, Prev: Floating Types, Up: C Extensions
+
+5.11 Decimal Floating Types
+===========================
+
+As an extension, the GNU C compiler supports decimal floating types as
+defined in the N1312 draft of ISO/IEC WDTR24732. Support for decimal
+floating types in GCC will evolve as the draft technical report changes.
+Calling conventions for any target might also change. Not all targets
+support decimal floating types.
+
+ The decimal floating types are `_Decimal32', `_Decimal64', and
+`_Decimal128'. They use a radix of ten, unlike the floating types
+`float', `double', and `long double' whose radix is not specified by
+the C standard but is usually two.
+
+ Support for decimal floating types includes the arithmetic operators
+add, subtract, multiply, divide; unary arithmetic operators; relational
+operators; equality operators; and conversions to and from integer and
+other floating types. Use a suffix `df' or `DF' in a literal constant
+of type `_Decimal32', `dd' or `DD' for `_Decimal64', and `dl' or `DL'
+for `_Decimal128'.
+
+ GCC support of decimal float as specified by the draft technical report
+is incomplete:
+
+ * Pragma `FLOAT_CONST_DECIMAL64' is not supported, nor is the `d'
+ suffix for literal constants of type `double'.
+
+ * When the value of a decimal floating type cannot be represented in
+ the integer type to which it is being converted, the result is
+ undefined rather than the result value specified by the draft
+ technical report.
+
+ * GCC does not provide the C library functionality associated with
+ `math.h', `fenv.h', `stdio.h', `stdlib.h', and `wchar.h', which
+ must come from a separate C library implementation. Because of
+ this the GNU C compiler does not define macro `__STDC_DEC_FP__' to
+ indicate that the implementation conforms to the technical report.
+
+ Types `_Decimal32', `_Decimal64', and `_Decimal128' are supported by
+the DWARF2 debug information format.
+
+
+File: gcc.info, Node: Hex Floats, Next: Fixed-Point, Prev: Decimal Float, Up: C Extensions
+
+5.12 Hex Floats
+===============
+
+ISO C99 supports floating-point numbers written not only in the usual
+decimal notation, such as `1.55e1', but also numbers such as `0x1.fp3'
+written in hexadecimal format. As a GNU extension, GCC supports this
+in C89 mode (except in some cases when strictly conforming) and in C++.
+In that format the `0x' hex introducer and the `p' or `P' exponent
+field are mandatory. The exponent is a decimal number that indicates
+the power of 2 by which the significant part will be multiplied. Thus
+`0x1.f' is 1 15/16, `p3' multiplies it by 8, and the value of `0x1.fp3'
+is the same as `1.55e1'.
+
+ Unlike for floating-point numbers in the decimal notation the exponent
+is always required in the hexadecimal notation. Otherwise the compiler
+would not be able to resolve the ambiguity of, e.g., `0x1.f'. This
+could mean `1.0f' or `1.9375' since `f' is also the extension for
+floating-point constants of type `float'.
+
+
+File: gcc.info, Node: Fixed-Point, Next: Zero Length, Prev: Hex Floats, Up: C Extensions
+
+5.13 Fixed-Point Types
+======================
+
+As an extension, the GNU C compiler supports fixed-point types as
+defined in the N1169 draft of ISO/IEC DTR 18037. Support for
+fixed-point types in GCC will evolve as the draft technical report
+changes. Calling conventions for any target might also change. Not
+all targets support fixed-point types.
+
+ The fixed-point types are `short _Fract', `_Fract', `long _Fract',
+`long long _Fract', `unsigned short _Fract', `unsigned _Fract',
+`unsigned long _Fract', `unsigned long long _Fract', `_Sat short
+_Fract', `_Sat _Fract', `_Sat long _Fract', `_Sat long long _Fract',
+`_Sat unsigned short _Fract', `_Sat unsigned _Fract', `_Sat unsigned
+long _Fract', `_Sat unsigned long long _Fract', `short _Accum',
+`_Accum', `long _Accum', `long long _Accum', `unsigned short _Accum',
+`unsigned _Accum', `unsigned long _Accum', `unsigned long long _Accum',
+`_Sat short _Accum', `_Sat _Accum', `_Sat long _Accum', `_Sat long long
+_Accum', `_Sat unsigned short _Accum', `_Sat unsigned _Accum', `_Sat
+unsigned long _Accum', `_Sat unsigned long long _Accum'.
+
+ Fixed-point data values contain fractional and optional integral parts.
+The format of fixed-point data varies and depends on the target machine.
+
+ Support for fixed-point types includes:
+ * prefix and postfix increment and decrement operators (`++', `--')
+
+ * unary arithmetic operators (`+', `-', `!')
+
+ * binary arithmetic operators (`+', `-', `*', `/')
+
+ * binary shift operators (`<<', `>>')
+
+ * relational operators (`<', `<=', `>=', `>')
+
+ * equality operators (`==', `!=')
+
+ * assignment operators (`+=', `-=', `*=', `/=', `<<=', `>>=')
+
+ * conversions to and from integer, floating-point, or fixed-point
+ types
+
+ Use a suffix in a fixed-point literal constant:
+ * `hr' or `HR' for `short _Fract' and `_Sat short _Fract'
+
+ * `r' or `R' for `_Fract' and `_Sat _Fract'
+
+ * `lr' or `LR' for `long _Fract' and `_Sat long _Fract'
+
+ * `llr' or `LLR' for `long long _Fract' and `_Sat long long _Fract'
+
+ * `uhr' or `UHR' for `unsigned short _Fract' and `_Sat unsigned
+ short _Fract'
+
+ * `ur' or `UR' for `unsigned _Fract' and `_Sat unsigned _Fract'
+
+ * `ulr' or `ULR' for `unsigned long _Fract' and `_Sat unsigned long
+ _Fract'
+
+ * `ullr' or `ULLR' for `unsigned long long _Fract' and `_Sat
+ unsigned long long _Fract'
+
+ * `hk' or `HK' for `short _Accum' and `_Sat short _Accum'
+
+ * `k' or `K' for `_Accum' and `_Sat _Accum'
+
+ * `lk' or `LK' for `long _Accum' and `_Sat long _Accum'
+
+ * `llk' or `LLK' for `long long _Accum' and `_Sat long long _Accum'
+
+ * `uhk' or `UHK' for `unsigned short _Accum' and `_Sat unsigned
+ short _Accum'
+
+ * `uk' or `UK' for `unsigned _Accum' and `_Sat unsigned _Accum'
+
+ * `ulk' or `ULK' for `unsigned long _Accum' and `_Sat unsigned long
+ _Accum'
+
+ * `ullk' or `ULLK' for `unsigned long long _Accum' and `_Sat
+ unsigned long long _Accum'
+
+ GCC support of fixed-point types as specified by the draft technical
+report is incomplete:
+
+ * Pragmas to control overflow and rounding behaviors are not
+ implemented.
+
+ Fixed-point types are supported by the DWARF2 debug information format.
+
+
+File: gcc.info, Node: Zero Length, Next: Variable Length, Prev: Fixed-Point, Up: C Extensions
+
+5.14 Arrays of Length Zero
+==========================
+
+Zero-length arrays are allowed in GNU C. They are very useful as the
+last element of a structure which is really a header for a
+variable-length object:
+
+ struct line {
+ int length;
+ char contents[0];
+ };
+
+ struct line *thisline = (struct line *)
+ malloc (sizeof (struct line) + this_length);
+ thisline->length = this_length;
+
+ In ISO C90, you would have to give `contents' a length of 1, which
+means either you waste space or complicate the argument to `malloc'.
+
+ In ISO C99, you would use a "flexible array member", which is slightly
+different in syntax and semantics:
+
+ * Flexible array members are written as `contents[]' without the `0'.
+
+ * Flexible array members have incomplete type, and so the `sizeof'
+ operator may not be applied. As a quirk of the original
+ implementation of zero-length arrays, `sizeof' evaluates to zero.
+
+ * Flexible array members may only appear as the last member of a
+ `struct' that is otherwise non-empty.
+
+ * A structure containing a flexible array member, or a union
+ containing such a structure (possibly recursively), may not be a
+ member of a structure or an element of an array. (However, these
+ uses are permitted by GCC as extensions.)
+
+ GCC versions before 3.0 allowed zero-length arrays to be statically
+initialized, as if they were flexible arrays. In addition to those
+cases that were useful, it also allowed initializations in situations
+that would corrupt later data. Non-empty initialization of zero-length
+arrays is now treated like any case where there are more initializer
+elements than the array holds, in that a suitable warning about "excess
+elements in array" is given, and the excess elements (all of them, in
+this case) are ignored.
+
+ Instead GCC allows static initialization of flexible array members.
+This is equivalent to defining a new structure containing the original
+structure followed by an array of sufficient size to contain the data.
+I.e. in the following, `f1' is constructed as if it were declared like
+`f2'.
+
+ struct f1 {
+ int x; int y[];
+ } f1 = { 1, { 2, 3, 4 } };
+
+ struct f2 {
+ struct f1 f1; int data[3];
+ } f2 = { { 1 }, { 2, 3, 4 } };
+
+The convenience of this extension is that `f1' has the desired type,
+eliminating the need to consistently refer to `f2.f1'.
+
+ This has symmetry with normal static arrays, in that an array of
+unknown size is also written with `[]'.
+
+ Of course, this extension only makes sense if the extra data comes at
+the end of a top-level object, as otherwise we would be overwriting
+data at subsequent offsets. To avoid undue complication and confusion
+with initialization of deeply nested arrays, we simply disallow any
+non-empty initialization except when the structure is the top-level
+object. For example:
+
+ struct foo { int x; int y[]; };
+ struct bar { struct foo z; };
+
+ struct foo a = { 1, { 2, 3, 4 } }; // Valid.
+ struct bar b = { { 1, { 2, 3, 4 } } }; // Invalid.
+ struct bar c = { { 1, { } } }; // Valid.
+ struct foo d[1] = { { 1 { 2, 3, 4 } } }; // Invalid.
+
+
+File: gcc.info, Node: Empty Structures, Next: Variadic Macros, Prev: Variable Length, Up: C Extensions
+
+5.15 Structures With No Members
+===============================
+
+GCC permits a C structure to have no members:
+
+ struct empty {
+ };
+
+ The structure will have size zero. In C++, empty structures are part
+of the language. G++ treats empty structures as if they had a single
+member of type `char'.
+
+
+File: gcc.info, Node: Variable Length, Next: Empty Structures, Prev: Zero Length, Up: C Extensions
+
+5.16 Arrays of Variable Length
+==============================
+
+Variable-length automatic arrays are allowed in ISO C99, and as an
+extension GCC accepts them in C89 mode and in C++. (However, GCC's
+implementation of variable-length arrays does not yet conform in detail
+to the ISO C99 standard.) These arrays are declared like any other
+automatic arrays, but with a length that is not a constant expression.
+The storage is allocated at the point of declaration and deallocated
+when the brace-level is exited. For example:
+
+ FILE *
+ concat_fopen (char *s1, char *s2, char *mode)
+ {
+ char str[strlen (s1) + strlen (s2) + 1];
+ strcpy (str, s1);
+ strcat (str, s2);
+ return fopen (str, mode);
+ }
+
+ Jumping or breaking out of the scope of the array name deallocates the
+storage. Jumping into the scope is not allowed; you get an error
+message for it.
+
+ You can use the function `alloca' to get an effect much like
+variable-length arrays. The function `alloca' is available in many
+other C implementations (but not in all). On the other hand,
+variable-length arrays are more elegant.
+
+ There are other differences between these two methods. Space allocated
+with `alloca' exists until the containing _function_ returns. The
+space for a variable-length array is deallocated as soon as the array
+name's scope ends. (If you use both variable-length arrays and
+`alloca' in the same function, deallocation of a variable-length array
+will also deallocate anything more recently allocated with `alloca'.)
+
+ You can also use variable-length arrays as arguments to functions:
+
+ struct entry
+ tester (int len, char data[len][len])
+ {
+ /* ... */
+ }
+
+ The length of an array is computed once when the storage is allocated
+and is remembered for the scope of the array in case you access it with
+`sizeof'.
+
+ If you want to pass the array first and the length afterward, you can
+use a forward declaration in the parameter list--another GNU extension.
+
+ struct entry
+ tester (int len; char data[len][len], int len)
+ {
+ /* ... */
+ }
+
+ The `int len' before the semicolon is a "parameter forward
+declaration", and it serves the purpose of making the name `len' known
+when the declaration of `data' is parsed.
+
+ You can write any number of such parameter forward declarations in the
+parameter list. They can be separated by commas or semicolons, but the
+last one must end with a semicolon, which is followed by the "real"
+parameter declarations. Each forward declaration must match a "real"
+declaration in parameter name and data type. ISO C99 does not support
+parameter forward declarations.
+
+
+File: gcc.info, Node: Variadic Macros, Next: Escaped Newlines, Prev: Empty Structures, Up: C Extensions
+
+5.17 Macros with a Variable Number of Arguments.
+================================================
+
+In the ISO C standard of 1999, a macro can be declared to accept a
+variable number of arguments much as a function can. The syntax for
+defining the macro is similar to that of a function. Here is an
+example:
+
+ #define debug(format, ...) fprintf (stderr, format, __VA_ARGS__)
+
+ Here `...' is a "variable argument". In the invocation of such a
+macro, it represents the zero or more tokens until the closing
+parenthesis that ends the invocation, including any commas. This set of
+tokens replaces the identifier `__VA_ARGS__' in the macro body wherever
+it appears. See the CPP manual for more information.
+
+ GCC has long supported variadic macros, and used a different syntax
+that allowed you to give a name to the variable arguments just like any
+other argument. Here is an example:
+
+ #define debug(format, args...) fprintf (stderr, format, args)
+
+ This is in all ways equivalent to the ISO C example above, but arguably
+more readable and descriptive.
+
+ GNU CPP has two further variadic macro extensions, and permits them to
+be used with either of the above forms of macro definition.
+
+ In standard C, you are not allowed to leave the variable argument out
+entirely; but you are allowed to pass an empty argument. For example,
+this invocation is invalid in ISO C, because there is no comma after
+the string:
+
+ debug ("A message")
+
+ GNU CPP permits you to completely omit the variable arguments in this
+way. In the above examples, the compiler would complain, though since
+the expansion of the macro still has the extra comma after the format
+string.
+
+ To help solve this problem, CPP behaves specially for variable
+arguments used with the token paste operator, `##'. If instead you
+write
+
+ #define debug(format, ...) fprintf (stderr, format, ## __VA_ARGS__)
+
+ and if the variable arguments are omitted or empty, the `##' operator
+causes the preprocessor to remove the comma before it. If you do
+provide some variable arguments in your macro invocation, GNU CPP does
+not complain about the paste operation and instead places the variable
+arguments after the comma. Just like any other pasted macro argument,
+these arguments are not macro expanded.
+
+
+File: gcc.info, Node: Escaped Newlines, Next: Subscripting, Prev: Variadic Macros, Up: C Extensions
+
+5.18 Slightly Looser Rules for Escaped Newlines
+===============================================
+
+Recently, the preprocessor has relaxed its treatment of escaped
+newlines. Previously, the newline had to immediately follow a
+backslash. The current implementation allows whitespace in the form of
+spaces, horizontal and vertical tabs, and form feeds between the
+backslash and the subsequent newline. The preprocessor issues a
+warning, but treats it as a valid escaped newline and combines the two
+lines to form a single logical line. This works within comments and
+tokens, as well as between tokens. Comments are _not_ treated as
+whitespace for the purposes of this relaxation, since they have not yet
+been replaced with spaces.
+
+
+File: gcc.info, Node: Subscripting, Next: Pointer Arith, Prev: Escaped Newlines, Up: C Extensions
+
+5.19 Non-Lvalue Arrays May Have Subscripts
+==========================================
+
+In ISO C99, arrays that are not lvalues still decay to pointers, and
+may be subscripted, although they may not be modified or used after the
+next sequence point and the unary `&' operator may not be applied to
+them. As an extension, GCC allows such arrays to be subscripted in C89
+mode, though otherwise they do not decay to pointers outside C99 mode.
+For example, this is valid in GNU C though not valid in C89:
+
+ struct foo {int a[4];};
+
+ struct foo f();
+
+ bar (int index)
+ {
+ return f().a[index];
+ }
+
+
+File: gcc.info, Node: Pointer Arith, Next: Initializers, Prev: Subscripting, Up: C Extensions
+
+5.20 Arithmetic on `void'- and Function-Pointers
+================================================
+
+In GNU C, addition and subtraction operations are supported on pointers
+to `void' and on pointers to functions. This is done by treating the
+size of a `void' or of a function as 1.
+
+ A consequence of this is that `sizeof' is also allowed on `void' and
+on function types, and returns 1.
+
+ The option `-Wpointer-arith' requests a warning if these extensions
+are used.
+
+
+File: gcc.info, Node: Initializers, Next: Compound Literals, Prev: Pointer Arith, Up: C Extensions
+
+5.21 Non-Constant Initializers
+==============================
+
+As in standard C++ and ISO C99, the elements of an aggregate
+initializer for an automatic variable are not required to be constant
+expressions in GNU C. Here is an example of an initializer with
+run-time varying elements:
+
+ foo (float f, float g)
+ {
+ float beat_freqs[2] = { f-g, f+g };
+ /* ... */
+ }
+
+
+File: gcc.info, Node: Compound Literals, Next: Designated Inits, Prev: Initializers, Up: C Extensions
+
+5.22 Compound Literals
+======================
+
+ISO C99 supports compound literals. A compound literal looks like a
+cast containing an initializer. Its value is an object of the type
+specified in the cast, containing the elements specified in the
+initializer; it is an lvalue. As an extension, GCC supports compound
+literals in C89 mode and in C++.
+
+ Usually, the specified type is a structure. Assume that `struct foo'
+and `structure' are declared as shown:
+
+ struct foo {int a; char b[2];} structure;
+
+Here is an example of constructing a `struct foo' with a compound
+literal:
+
+ structure = ((struct foo) {x + y, 'a', 0});
+
+This is equivalent to writing the following:
+
+ {
+ struct foo temp = {x + y, 'a', 0};
+ structure = temp;
+ }
+
+ You can also construct an array. If all the elements of the compound
+literal are (made up of) simple constant expressions, suitable for use
+in initializers of objects of static storage duration, then the compound
+literal can be coerced to a pointer to its first element and used in
+such an initializer, as shown here:
+
+ char **foo = (char *[]) { "x", "y", "z" };
+
+ Compound literals for scalar types and union types are is also
+allowed, but then the compound literal is equivalent to a cast.
+
+ As a GNU extension, GCC allows initialization of objects with static
+storage duration by compound literals (which is not possible in ISO
+C99, because the initializer is not a constant). It is handled as if
+the object was initialized only with the bracket enclosed list if the
+types of the compound literal and the object match. The initializer
+list of the compound literal must be constant. If the object being
+initialized has array type of unknown size, the size is determined by
+compound literal size.
+
+ static struct foo x = (struct foo) {1, 'a', 'b'};
+ static int y[] = (int []) {1, 2, 3};
+ static int z[] = (int [3]) {1};
+
+The above lines are equivalent to the following:
+ static struct foo x = {1, 'a', 'b'};
+ static int y[] = {1, 2, 3};
+ static int z[] = {1, 0, 0};
+
+
+File: gcc.info, Node: Designated Inits, Next: Cast to Union, Prev: Compound Literals, Up: C Extensions
+
+5.23 Designated Initializers
+============================
+
+Standard C89 requires the elements of an initializer to appear in a
+fixed order, the same as the order of the elements in the array or
+structure being initialized.
+
+ In ISO C99 you can give the elements in any order, specifying the array
+indices or structure field names they apply to, and GNU C allows this as
+an extension in C89 mode as well. This extension is not implemented in
+GNU C++.
+
+ To specify an array index, write `[INDEX] =' before the element value.
+For example,
+
+ int a[6] = { [4] = 29, [2] = 15 };
+
+is equivalent to
+
+ int a[6] = { 0, 0, 15, 0, 29, 0 };
+
+The index values must be constant expressions, even if the array being
+initialized is automatic.
+
+ An alternative syntax for this which has been obsolete since GCC 2.5
+but GCC still accepts is to write `[INDEX]' before the element value,
+with no `='.
+
+ To initialize a range of elements to the same value, write `[FIRST ...
+LAST] = VALUE'. This is a GNU extension. For example,
+
+ int widths[] = { [0 ... 9] = 1, [10 ... 99] = 2, [100] = 3 };
+
+If the value in it has side-effects, the side-effects will happen only
+once, not for each initialized field by the range initializer.
+
+Note that the length of the array is the highest value specified plus
+one.
+
+ In a structure initializer, specify the name of a field to initialize
+with `.FIELDNAME =' before the element value. For example, given the
+following structure,
+
+ struct point { int x, y; };
+
+the following initialization
+
+ struct point p = { .y = yvalue, .x = xvalue };
+
+is equivalent to
+
+ struct point p = { xvalue, yvalue };
+
+ Another syntax which has the same meaning, obsolete since GCC 2.5, is
+`FIELDNAME:', as shown here:
+
+ struct point p = { y: yvalue, x: xvalue };
+
+ The `[INDEX]' or `.FIELDNAME' is known as a "designator". You can
+also use a designator (or the obsolete colon syntax) when initializing
+a union, to specify which element of the union should be used. For
+example,
+
+ union foo { int i; double d; };
+
+ union foo f = { .d = 4 };
+
+will convert 4 to a `double' to store it in the union using the second
+element. By contrast, casting 4 to type `union foo' would store it
+into the union as the integer `i', since it is an integer. (*Note Cast
+to Union::.)
+
+ You can combine this technique of naming elements with ordinary C
+initialization of successive elements. Each initializer element that
+does not have a designator applies to the next consecutive element of
+the array or structure. For example,
+
+ int a[6] = { [1] = v1, v2, [4] = v4 };
+
+is equivalent to
+
+ int a[6] = { 0, v1, v2, 0, v4, 0 };
+
+ Labeling the elements of an array initializer is especially useful
+when the indices are characters or belong to an `enum' type. For
+example:
+
+ int whitespace[256]
+ = { [' '] = 1, ['\t'] = 1, ['\h'] = 1,
+ ['\f'] = 1, ['\n'] = 1, ['\r'] = 1 };
+
+ You can also write a series of `.FIELDNAME' and `[INDEX]' designators
+before an `=' to specify a nested subobject to initialize; the list is
+taken relative to the subobject corresponding to the closest
+surrounding brace pair. For example, with the `struct point'
+declaration above:
+
+ struct point ptarray[10] = { [2].y = yv2, [2].x = xv2, [0].x = xv0 };
+
+If the same field is initialized multiple times, it will have value from
+the last initialization. If any such overridden initialization has
+side-effect, it is unspecified whether the side-effect happens or not.
+Currently, GCC will discard them and issue a warning.
+
+
+File: gcc.info, Node: Case Ranges, Next: Mixed Declarations, Prev: Cast to Union, Up: C Extensions
+
+5.24 Case Ranges
+================
+
+You can specify a range of consecutive values in a single `case' label,
+like this:
+
+ case LOW ... HIGH:
+
+This has the same effect as the proper number of individual `case'
+labels, one for each integer value from LOW to HIGH, inclusive.
+
+ This feature is especially useful for ranges of ASCII character codes:
+
+ case 'A' ... 'Z':
+
+ *Be careful:* Write spaces around the `...', for otherwise it may be
+parsed wrong when you use it with integer values. For example, write
+this:
+
+ case 1 ... 5:
+
+rather than this:
+
+ case 1...5:
+
+
+File: gcc.info, Node: Cast to Union, Next: Case Ranges, Prev: Designated Inits, Up: C Extensions
+
+5.25 Cast to a Union Type
+=========================
+
+A cast to union type is similar to other casts, except that the type
+specified is a union type. You can specify the type either with `union
+TAG' or with a typedef name. A cast to union is actually a constructor
+though, not a cast, and hence does not yield an lvalue like normal
+casts. (*Note Compound Literals::.)
+
+ The types that may be cast to the union type are those of the members
+of the union. Thus, given the following union and variables:
+
+ union foo { int i; double d; };
+ int x;
+ double y;
+
+both `x' and `y' can be cast to type `union foo'.
+
+ Using the cast as the right-hand side of an assignment to a variable of
+union type is equivalent to storing in a member of the union:
+
+ union foo u;
+ /* ... */
+ u = (union foo) x == u.i = x
+ u = (union foo) y == u.d = y
+
+ You can also use the union cast as a function argument:
+
+ void hack (union foo);
+ /* ... */
+ hack ((union foo) x);
+
+
+File: gcc.info, Node: Mixed Declarations, Next: Function Attributes, Prev: Case Ranges, Up: C Extensions
+
+5.26 Mixed Declarations and Code
+================================
+
+ISO C99 and ISO C++ allow declarations and code to be freely mixed
+within compound statements. As an extension, GCC also allows this in
+C89 mode. For example, you could do:
+
+ int i;
+ /* ... */
+ i++;
+ int j = i + 2;
+
+ Each identifier is visible from where it is declared until the end of
+the enclosing block.
+
+
+File: gcc.info, Node: Function Attributes, Next: Attribute Syntax, Prev: Mixed Declarations, Up: C Extensions
+
+5.27 Declaring Attributes of Functions
+======================================
+
+In GNU C, you declare certain things about functions called in your
+program which help the compiler optimize function calls and check your
+code more carefully.
+
+ The keyword `__attribute__' allows you to specify special attributes
+when making a declaration. This keyword is followed by an attribute
+specification inside double parentheses. The following attributes are
+currently defined for functions on all targets: `aligned',
+`alloc_size', `noreturn', `returns_twice', `noinline', `always_inline',
+`flatten', `pure', `const', `nothrow', `sentinel', `format',
+`format_arg', `no_instrument_function', `section', `constructor',
+`destructor', `used', `unused', `deprecated', `weak', `malloc',
+`alias', `warn_unused_result', `nonnull', `gnu_inline',
+`externally_visible', `hot', `cold', `artificial', `error' and
+`warning'. Several other attributes are defined for functions on
+particular target systems. Other attributes, including `section' are
+supported for variables declarations (*note Variable Attributes::) and
+for types (*note Type Attributes::).
+
+ You may also specify attributes with `__' preceding and following each
+keyword. This allows you to use them in header files without being
+concerned about a possible macro of the same name. For example, you
+may use `__noreturn__' instead of `noreturn'.
+
+ *Note Attribute Syntax::, for details of the exact syntax for using
+attributes.
+
+`alias ("TARGET")'
+ The `alias' attribute causes the declaration to be emitted as an
+ alias for another symbol, which must be specified. For instance,
+
+ void __f () { /* Do something. */; }
+ void f () __attribute__ ((weak, alias ("__f")));
+
+ defines `f' to be a weak alias for `__f'. In C++, the mangled
+ name for the target must be used. It is an error if `__f' is not
+ defined in the same translation unit.
+
+ Not all target machines support this attribute.
+
+`aligned (ALIGNMENT)'
+ This attribute specifies a minimum alignment for the function,
+ measured in bytes.
+
+ You cannot use this attribute to decrease the alignment of a
+ function, only to increase it. However, when you explicitly
+ specify a function alignment this will override the effect of the
+ `-falign-functions' (*note Optimize Options::) option for this
+ function.
+
+ Note that the effectiveness of `aligned' attributes may be limited
+ by inherent limitations in your linker. On many systems, the
+ linker is only able to arrange for functions to be aligned up to a
+ certain maximum alignment. (For some linkers, the maximum
+ supported alignment may be very very small.) See your linker
+ documentation for further information.
+
+ The `aligned' attribute can also be used for variables and fields
+ (*note Variable Attributes::.)
+
+`alloc_size'
+ The `alloc_size' attribute is used to tell the compiler that the
+ function return value points to memory, where the size is given by
+ one or two of the functions parameters. GCC uses this information
+ to improve the correctness of `__builtin_object_size'.
+
+ The function parameter(s) denoting the allocated size are
+ specified by one or two integer arguments supplied to the
+ attribute. The allocated size is either the value of the single
+ function argument specified or the product of the two function
+ arguments specified. Argument numbering starts at one.
+
+ For instance,
+
+ void* my_calloc(size_t, size_t) __attribute__((alloc_size(1,2)))
+ void my_realloc(void*, size_t) __attribute__((alloc_size(2)))
+
+ declares that my_calloc will return memory of the size given by
+ the product of parameter 1 and 2 and that my_realloc will return
+ memory of the size given by parameter 2.
+
+`always_inline'
+ Generally, functions are not inlined unless optimization is
+ specified. For functions declared inline, this attribute inlines
+ the function even if no optimization level was specified.
+
+`gnu_inline'
+ This attribute should be used with a function which is also
+ declared with the `inline' keyword. It directs GCC to treat the
+ function as if it were defined in gnu89 mode even when compiling
+ in C99 or gnu99 mode.
+
+ If the function is declared `extern', then this definition of the
+ function is used only for inlining. In no case is the function
+ compiled as a standalone function, not even if you take its address
+ explicitly. Such an address becomes an external reference, as if
+ you had only declared the function, and had not defined it. This
+ has almost the effect of a macro. The way to use this is to put a
+ function definition in a header file with this attribute, and put
+ another copy of the function, without `extern', in a library file.
+ The definition in the header file will cause most calls to the
+ function to be inlined. If any uses of the function remain, they
+ will refer to the single copy in the library. Note that the two
+ definitions of the functions need not be precisely the same,
+ although if they do not have the same effect your program may
+ behave oddly.
+
+ In C, if the function is neither `extern' nor `static', then the
+ function is compiled as a standalone function, as well as being
+ inlined where possible.
+
+ This is how GCC traditionally handled functions declared `inline'.
+ Since ISO C99 specifies a different semantics for `inline', this
+ function attribute is provided as a transition measure and as a
+ useful feature in its own right. This attribute is available in
+ GCC 4.1.3 and later. It is available if either of the
+ preprocessor macros `__GNUC_GNU_INLINE__' or
+ `__GNUC_STDC_INLINE__' are defined. *Note An Inline Function is
+ As Fast As a Macro: Inline.
+
+ In C++, this attribute does not depend on `extern' in any way, but
+ it still requires the `inline' keyword to enable its special
+ behavior.
+
+`artificial'
+ This attribute is useful for small inline wrappers which if
+ possible should appear during debugging as a unit, depending on
+ the debug info format it will either mean marking the function as
+ artificial or using the caller location for all instructions
+ within the inlined body.
+
+`flatten'
+ Generally, inlining into a function is limited. For a function
+ marked with this attribute, every call inside this function will
+ be inlined, if possible. Whether the function itself is
+ considered for inlining depends on its size and the current
+ inlining parameters.
+
+`error ("MESSAGE")'
+ If this attribute is used on a function declaration and a call to
+ such a function is not eliminated through dead code elimination or
+ other optimizations, an error which will include MESSAGE will be
+ diagnosed. This is useful for compile time checking, especially
+ together with `__builtin_constant_p' and inline functions where
+ checking the inline function arguments is not possible through
+ `extern char [(condition) ? 1 : -1];' tricks. While it is
+ possible to leave the function undefined and thus invoke a link
+ failure, when using this attribute the problem will be diagnosed
+ earlier and with exact location of the call even in presence of
+ inline functions or when not emitting debugging information.
+
+`warning ("MESSAGE")'
+ If this attribute is used on a function declaration and a call to
+ such a function is not eliminated through dead code elimination or
+ other optimizations, a warning which will include MESSAGE will be
+ diagnosed. This is useful for compile time checking, especially
+ together with `__builtin_constant_p' and inline functions. While
+ it is possible to define the function with a message in
+ `.gnu.warning*' section, when using this attribute the problem
+ will be diagnosed earlier and with exact location of the call even
+ in presence of inline functions or when not emitting debugging
+ information.
+
+`cdecl'
+ On the Intel 386, the `cdecl' attribute causes the compiler to
+ assume that the calling function will pop off the stack space used
+ to pass arguments. This is useful to override the effects of the
+ `-mrtd' switch.
+
+`const'
+ Many functions do not examine any values except their arguments,
+ and have no effects except the return value. Basically this is
+ just slightly more strict class than the `pure' attribute below,
+ since function is not allowed to read global memory.
+
+ Note that a function that has pointer arguments and examines the
+ data pointed to must _not_ be declared `const'. Likewise, a
+ function that calls a non-`const' function usually must not be
+ `const'. It does not make sense for a `const' function to return
+ `void'.
+
+ The attribute `const' is not implemented in GCC versions earlier
+ than 2.5. An alternative way to declare that a function has no
+ side effects, which works in the current version and in some older
+ versions, is as follows:
+
+ typedef int intfn ();
+
+ extern const intfn square;
+
+ This approach does not work in GNU C++ from 2.6.0 on, since the
+ language specifies that the `const' must be attached to the return
+ value.
+
+`constructor'
+`destructor'
+`constructor (PRIORITY)'
+`destructor (PRIORITY)'
+ The `constructor' attribute causes the function to be called
+ automatically before execution enters `main ()'. Similarly, the
+ `destructor' attribute causes the function to be called
+ automatically after `main ()' has completed or `exit ()' has been
+ called. Functions with these attributes are useful for
+ initializing data that will be used implicitly during the
+ execution of the program.
+
+ You may provide an optional integer priority to control the order
+ in which constructor and destructor functions are run. A
+ constructor with a smaller priority number runs before a
+ constructor with a larger priority number; the opposite
+ relationship holds for destructors. So, if you have a constructor
+ that allocates a resource and a destructor that deallocates the
+ same resource, both functions typically have the same priority.
+ The priorities for constructor and destructor functions are the
+ same as those specified for namespace-scope C++ objects (*note C++
+ Attributes::).
+
+ These attributes are not currently implemented for Objective-C.
+
+`deprecated'
+ The `deprecated' attribute results in a warning if the function is
+ used anywhere in the source file. This is useful when identifying
+ functions that are expected to be removed in a future version of a
+ program. The warning also includes the location of the declaration
+ of the deprecated function, to enable users to easily find further
+ information about why the function is deprecated, or what they
+ should do instead. Note that the warnings only occurs for uses:
+
+ int old_fn () __attribute__ ((deprecated));
+ int old_fn ();
+ int (*fn_ptr)() = old_fn;
+
+ results in a warning on line 3 but not line 2.
+
+ The `deprecated' attribute can also be used for variables and
+ types (*note Variable Attributes::, *note Type Attributes::.)
+
+`dllexport'
+ On Microsoft Windows targets and Symbian OS targets the
+ `dllexport' attribute causes the compiler to provide a global
+ pointer to a pointer in a DLL, so that it can be referenced with
+ the `dllimport' attribute. On Microsoft Windows targets, the
+ pointer name is formed by combining `_imp__' and the function or
+ variable name.
+
+ You can use `__declspec(dllexport)' as a synonym for
+ `__attribute__ ((dllexport))' for compatibility with other
+ compilers.
+
+ On systems that support the `visibility' attribute, this attribute
+ also implies "default" visibility. It is an error to explicitly
+ specify any other visibility.
+
+ Currently, the `dllexport' attribute is ignored for inlined
+ functions, unless the `-fkeep-inline-functions' flag has been
+ used. The attribute is also ignored for undefined symbols.
+
+ When applied to C++ classes, the attribute marks defined
+ non-inlined member functions and static data members as exports.
+ Static consts initialized in-class are not marked unless they are
+ also defined out-of-class.
+
+ For Microsoft Windows targets there are alternative methods for
+ including the symbol in the DLL's export table such as using a
+ `.def' file with an `EXPORTS' section or, with GNU ld, using the
+ `--export-all' linker flag.
+
+`dllimport'
+ On Microsoft Windows and Symbian OS targets, the `dllimport'
+ attribute causes the compiler to reference a function or variable
+ via a global pointer to a pointer that is set up by the DLL
+ exporting the symbol. The attribute implies `extern'. On
+ Microsoft Windows targets, the pointer name is formed by combining
+ `_imp__' and the function or variable name.
+
+ You can use `__declspec(dllimport)' as a synonym for
+ `__attribute__ ((dllimport))' for compatibility with other
+ compilers.
+
+ On systems that support the `visibility' attribute, this attribute
+ also implies "default" visibility. It is an error to explicitly
+ specify any other visibility.
+
+ Currently, the attribute is ignored for inlined functions. If the
+ attribute is applied to a symbol _definition_, an error is
+ reported. If a symbol previously declared `dllimport' is later
+ defined, the attribute is ignored in subsequent references, and a
+ warning is emitted. The attribute is also overridden by a
+ subsequent declaration as `dllexport'.
+
+ When applied to C++ classes, the attribute marks non-inlined
+ member functions and static data members as imports. However, the
+ attribute is ignored for virtual methods to allow creation of
+ vtables using thunks.
+
+ On the SH Symbian OS target the `dllimport' attribute also has
+ another affect--it can cause the vtable and run-time type
+ information for a class to be exported. This happens when the
+ class has a dllimport'ed constructor or a non-inline, non-pure
+ virtual function and, for either of those two conditions, the
+ class also has a inline constructor or destructor and has a key
+ function that is defined in the current translation unit.
+
+ For Microsoft Windows based targets the use of the `dllimport'
+ attribute on functions is not necessary, but provides a small
+ performance benefit by eliminating a thunk in the DLL. The use of
+ the `dllimport' attribute on imported variables was required on
+ older versions of the GNU linker, but can now be avoided by
+ passing the `--enable-auto-import' switch to the GNU linker. As
+ with functions, using the attribute for a variable eliminates a
+ thunk in the DLL.
+
+ One drawback to using this attribute is that a pointer to a
+ _variable_ marked as `dllimport' cannot be used as a constant
+ address. However, a pointer to a _function_ with the `dllimport'
+ attribute can be used as a constant initializer; in this case, the
+ address of a stub function in the import lib is referenced. On
+ Microsoft Windows targets, the attribute can be disabled for
+ functions by setting the `-mnop-fun-dllimport' flag.
+
+`eightbit_data'
+ Use this attribute on the H8/300, H8/300H, and H8S to indicate
+ that the specified variable should be placed into the eight bit
+ data section. The compiler will generate more efficient code for
+ certain operations on data in the eight bit data area. Note the
+ eight bit data area is limited to 256 bytes of data.
+
+ You must use GAS and GLD from GNU binutils version 2.7 or later for
+ this attribute to work correctly.
+
+`exception_handler'
+ Use this attribute on the Blackfin to indicate that the specified
+ function is an exception handler. The compiler will generate
+ function entry and exit sequences suitable for use in an exception
+ handler when this attribute is present.
+
+`externally_visible'
+ This attribute, attached to a global variable or function,
+ nullifies the effect of the `-fwhole-program' command-line option,
+ so the object remains visible outside the current compilation unit.
+
+`far'
+ On 68HC11 and 68HC12 the `far' attribute causes the compiler to
+ use a calling convention that takes care of switching memory banks
+ when entering and leaving a function. This calling convention is
+ also the default when using the `-mlong-calls' option.
+
+ On 68HC12 the compiler will use the `call' and `rtc' instructions
+ to call and return from a function.
+
+ On 68HC11 the compiler will generate a sequence of instructions to
+ invoke a board-specific routine to switch the memory bank and call
+ the real function. The board-specific routine simulates a `call'.
+ At the end of a function, it will jump to a board-specific routine
+ instead of using `rts'. The board-specific return routine
+ simulates the `rtc'.
+
+`fastcall'
+ On the Intel 386, the `fastcall' attribute causes the compiler to
+ pass the first argument (if of integral type) in the register ECX
+ and the second argument (if of integral type) in the register EDX.
+ Subsequent and other typed arguments are passed on the stack.
+ The called function will pop the arguments off the stack. If the
+ number of arguments is variable all arguments are pushed on the
+ stack.
+
+`format (ARCHETYPE, STRING-INDEX, FIRST-TO-CHECK)'
+ The `format' attribute specifies that a function takes `printf',
+ `scanf', `strftime' or `strfmon' style arguments which should be
+ type-checked against a format string. For example, the
+ declaration:
+
+ extern int
+ my_printf (void *my_object, const char *my_format, ...)
+ __attribute__ ((format (printf, 2, 3)));
+
+ causes the compiler to check the arguments in calls to `my_printf'
+ for consistency with the `printf' style format string argument
+ `my_format'.
+
+ The parameter ARCHETYPE determines how the format string is
+ interpreted, and should be `printf', `scanf', `strftime',
+ `gnu_printf', `gnu_scanf', `gnu_strftime' or `strfmon'. (You can
+ also use `__printf__', `__scanf__', `__strftime__' or
+ `__strfmon__'.) On MinGW targets, `ms_printf', `ms_scanf', and
+ `ms_strftime' are also present. ARCHTYPE values such as `printf'
+ refer to the formats accepted by the system's C run-time library,
+ while `gnu_' values always refer to the formats accepted by the
+ GNU C Library. On Microsoft Windows targets, `ms_' values refer
+ to the formats accepted by the `msvcrt.dll' library. The
+ parameter STRING-INDEX specifies which argument is the format
+ string argument (starting from 1), while FIRST-TO-CHECK is the
+ number of the first argument to check against the format string.
+ For functions where the arguments are not available to be checked
+ (such as `vprintf'), specify the third parameter as zero. In this
+ case the compiler only checks the format string for consistency.
+ For `strftime' formats, the third parameter is required to be zero.
+ Since non-static C++ methods have an implicit `this' argument, the
+ arguments of such methods should be counted from two, not one, when
+ giving values for STRING-INDEX and FIRST-TO-CHECK.
+
+ In the example above, the format string (`my_format') is the second
+ argument of the function `my_print', and the arguments to check
+ start with the third argument, so the correct parameters for the
+ format attribute are 2 and 3.
+
+ The `format' attribute allows you to identify your own functions
+ which take format strings as arguments, so that GCC can check the
+ calls to these functions for errors. The compiler always (unless
+ `-ffreestanding' or `-fno-builtin' is used) checks formats for the
+ standard library functions `printf', `fprintf', `sprintf',
+ `scanf', `fscanf', `sscanf', `strftime', `vprintf', `vfprintf' and
+ `vsprintf' whenever such warnings are requested (using
+ `-Wformat'), so there is no need to modify the header file
+ `stdio.h'. In C99 mode, the functions `snprintf', `vsnprintf',
+ `vscanf', `vfscanf' and `vsscanf' are also checked. Except in
+ strictly conforming C standard modes, the X/Open function
+ `strfmon' is also checked as are `printf_unlocked' and
+ `fprintf_unlocked'. *Note Options Controlling C Dialect: C
+ Dialect Options.
+
+ The target may provide additional types of format checks. *Note
+ Format Checks Specific to Particular Target Machines: Target
+ Format Checks.
+
+`format_arg (STRING-INDEX)'
+ The `format_arg' attribute specifies that a function takes a format
+ string for a `printf', `scanf', `strftime' or `strfmon' style
+ function and modifies it (for example, to translate it into
+ another language), so the result can be passed to a `printf',
+ `scanf', `strftime' or `strfmon' style function (with the
+ remaining arguments to the format function the same as they would
+ have been for the unmodified string). For example, the
+ declaration:
+
+ extern char *
+ my_dgettext (char *my_domain, const char *my_format)
+ __attribute__ ((format_arg (2)));
+
+ causes the compiler to check the arguments in calls to a `printf',
+ `scanf', `strftime' or `strfmon' type function, whose format
+ string argument is a call to the `my_dgettext' function, for
+ consistency with the format string argument `my_format'. If the
+ `format_arg' attribute had not been specified, all the compiler
+ could tell in such calls to format functions would be that the
+ format string argument is not constant; this would generate a
+ warning when `-Wformat-nonliteral' is used, but the calls could
+ not be checked without the attribute.
+
+ The parameter STRING-INDEX specifies which argument is the format
+ string argument (starting from one). Since non-static C++ methods
+ have an implicit `this' argument, the arguments of such methods
+ should be counted from two.
+
+ The `format-arg' attribute allows you to identify your own
+ functions which modify format strings, so that GCC can check the
+ calls to `printf', `scanf', `strftime' or `strfmon' type function
+ whose operands are a call to one of your own function. The
+ compiler always treats `gettext', `dgettext', and `dcgettext' in
+ this manner except when strict ISO C support is requested by
+ `-ansi' or an appropriate `-std' option, or `-ffreestanding' or
+ `-fno-builtin' is used. *Note Options Controlling C Dialect: C
+ Dialect Options.
+
+`function_vector'
+ Use this attribute on the H8/300, H8/300H, and H8S to indicate
+ that the specified function should be called through the function
+ vector. Calling a function through the function vector will
+ reduce code size, however; the function vector has a limited size
+ (maximum 128 entries on the H8/300 and 64 entries on the H8/300H
+ and H8S) and shares space with the interrupt vector.
+
+ In SH2A target, this attribute declares a function to be called
+ using the TBR relative addressing mode. The argument to this
+ attribute is the entry number of the same function in a vector
+ table containing all the TBR relative addressable functions. For
+ the successful jump, register TBR should contain the start address
+ of this TBR relative vector table. In the startup routine of the
+ user application, user needs to care of this TBR register
+ initialization. The TBR relative vector table can have at max 256
+ function entries. The jumps to these functions will be generated
+ using a SH2A specific, non delayed branch instruction JSR/N
+ @(disp8,TBR). You must use GAS and GLD from GNU binutils version
+ 2.7 or later for this attribute to work correctly.
+
+ Please refer the example of M16C target, to see the use of this
+ attribute while declaring a function,
+
+ In an application, for a function being called once, this
+ attribute will save at least 8 bytes of code; and if other
+ successive calls are being made to the same function, it will save
+ 2 bytes of code per each of these calls.
+
+ On M16C/M32C targets, the `function_vector' attribute declares a
+ special page subroutine call function. Use of this attribute
+ reduces the code size by 2 bytes for each call generated to the
+ subroutine. The argument to the attribute is the vector number
+ entry from the special page vector table which contains the 16
+ low-order bits of the subroutine's entry address. Each vector
+ table has special page number (18 to 255) which are used in `jsrs'
+ instruction. Jump addresses of the routines are generated by
+ adding 0x0F0000 (in case of M16C targets) or 0xFF0000 (in case of
+ M32C targets), to the 2 byte addresses set in the vector table.
+ Therefore you need to ensure that all the special page vector
+ routines should get mapped within the address range 0x0F0000 to
+ 0x0FFFFF (for M16C) and 0xFF0000 to 0xFFFFFF (for M32C).
+
+ In the following example 2 bytes will be saved for each call to
+ function `foo'.
+
+ void foo (void) __attribute__((function_vector(0x18)));
+ void foo (void)
+ {
+ }
+
+ void bar (void)
+ {
+ foo();
+ }
+
+ If functions are defined in one file and are called in another
+ file, then be sure to write this declaration in both files.
+
+ This attribute is ignored for R8C target.
+
+`interrupt'
+ Use this attribute on the ARM, AVR, CRX, M32C, M32R/D, m68k, and
+ Xstormy16 ports to indicate that the specified function is an
+ interrupt handler. The compiler will generate function entry and
+ exit sequences suitable for use in an interrupt handler when this
+ attribute is present.
+
+ Note, interrupt handlers for the Blackfin, H8/300, H8/300H, H8S,
+ and SH processors can be specified via the `interrupt_handler'
+ attribute.
+
+ Note, on the AVR, interrupts will be enabled inside the function.
+
+ Note, for the ARM, you can specify the kind of interrupt to be
+ handled by adding an optional parameter to the interrupt attribute
+ like this:
+
+ void f () __attribute__ ((interrupt ("IRQ")));
+
+ Permissible values for this parameter are: IRQ, FIQ, SWI, ABORT
+ and UNDEF.
+
+ On ARMv7-M the interrupt type is ignored, and the attribute means
+ the function may be called with a word aligned stack pointer.
+
+`interrupt_handler'
+ Use this attribute on the Blackfin, m68k, H8/300, H8/300H, H8S,
+ and SH to indicate that the specified function is an interrupt
+ handler. The compiler will generate function entry and exit
+ sequences suitable for use in an interrupt handler when this
+ attribute is present.
+
+`interrupt_thread'
+ Use this attribute on fido, a subarchitecture of the m68k, to
+ indicate that the specified function is an interrupt handler that
+ is designed to run as a thread. The compiler omits generate
+ prologue/epilogue sequences and replaces the return instruction
+ with a `sleep' instruction. This attribute is available only on
+ fido.
+
+`isr'
+ Use this attribute on ARM to write Interrupt Service Routines.
+ This is an alias to the `interrupt' attribute above.
+
+`kspisusp'
+ When used together with `interrupt_handler', `exception_handler'
+ or `nmi_handler', code will be generated to load the stack pointer
+ from the USP register in the function prologue.
+
+`l1_text'
+ This attribute specifies a function to be placed into L1
+ Instruction SRAM. The function will be put into a specific section
+ named `.l1.text'. With `-mfdpic', function calls with a such
+ function as the callee or caller will use inlined PLT.
+
+`long_call/short_call'
+ This attribute specifies how a particular function is called on
+ ARM. Both attributes override the `-mlong-calls' (*note ARM
+ Options::) command line switch and `#pragma long_calls' settings.
+ The `long_call' attribute indicates that the function might be far
+ away from the call site and require a different (more expensive)
+ calling sequence. The `short_call' attribute always places the
+ offset to the function from the call site into the `BL'
+ instruction directly.
+
+`longcall/shortcall'
+ On the Blackfin, RS/6000 and PowerPC, the `longcall' attribute
+ indicates that the function might be far away from the call site
+ and require a different (more expensive) calling sequence. The
+ `shortcall' attribute indicates that the function is always close
+ enough for the shorter calling sequence to be used. These
+ attributes override both the `-mlongcall' switch and, on the
+ RS/6000 and PowerPC, the `#pragma longcall' setting.
+
+ *Note RS/6000 and PowerPC Options::, for more information on
+ whether long calls are necessary.
+
+`long_call/near/far'
+ These attributes specify how a particular function is called on
+ MIPS. The attributes override the `-mlong-calls' (*note MIPS
+ Options::) command-line switch. The `long_call' and `far'
+ attributes are synonyms, and cause the compiler to always call the
+ function by first loading its address into a register, and then
+ using the contents of that register. The `near' attribute has the
+ opposite effect; it specifies that non-PIC calls should be made
+ using the more efficient `jal' instruction.
+
+`malloc'
+ The `malloc' attribute is used to tell the compiler that a function
+ may be treated as if any non-`NULL' pointer it returns cannot
+ alias any other pointer valid when the function returns. This
+ will often improve optimization. Standard functions with this
+ property include `malloc' and `calloc'. `realloc'-like functions
+ have this property as long as the old pointer is never referred to
+ (including comparing it to the new pointer) after the function
+ returns a non-`NULL' value.
+
+`mips16/nomips16'
+ On MIPS targets, you can use the `mips16' and `nomips16' function
+ attributes to locally select or turn off MIPS16 code generation.
+ A function with the `mips16' attribute is emitted as MIPS16 code,
+ while MIPS16 code generation is disabled for functions with the
+ `nomips16' attribute. These attributes override the `-mips16' and
+ `-mno-mips16' options on the command line (*note MIPS Options::).
+
+ When compiling files containing mixed MIPS16 and non-MIPS16 code,
+ the preprocessor symbol `__mips16' reflects the setting on the
+ command line, not that within individual functions. Mixed MIPS16
+ and non-MIPS16 code may interact badly with some GCC extensions
+ such as `__builtin_apply' (*note Constructing Calls::).
+
+`model (MODEL-NAME)'
+ On the M32R/D, use this attribute to set the addressability of an
+ object, and of the code generated for a function. The identifier
+ MODEL-NAME is one of `small', `medium', or `large', representing
+ each of the code models.
+
+ Small model objects live in the lower 16MB of memory (so that their
+ addresses can be loaded with the `ld24' instruction), and are
+ callable with the `bl' instruction.
+
+ Medium model objects may live anywhere in the 32-bit address space
+ (the compiler will generate `seth/add3' instructions to load their
+ addresses), and are callable with the `bl' instruction.
+
+ Large model objects may live anywhere in the 32-bit address space
+ (the compiler will generate `seth/add3' instructions to load their
+ addresses), and may not be reachable with the `bl' instruction
+ (the compiler will generate the much slower `seth/add3/jl'
+ instruction sequence).
+
+ On IA-64, use this attribute to set the addressability of an
+ object. At present, the only supported identifier for MODEL-NAME
+ is `small', indicating addressability via "small" (22-bit)
+ addresses (so that their addresses can be loaded with the `addl'
+ instruction). Caveat: such addressing is by definition not
+ position independent and hence this attribute must not be used for
+ objects defined by shared libraries.
+
+`ms_abi/sysv_abi'
+ On 64-bit x86_64-*-* targets, you can use an ABI attribute to
+ indicate which calling convention should be used for a function.
+ The `ms_abi' attribute tells the compiler to use the Microsoft
+ ABI, while the `sysv_abi' attribute tells the compiler to use the
+ ABI used on GNU/Linux and other systems. The default is to use
+ the Microsoft ABI when targeting Windows. On all other systems,
+ the default is the AMD ABI.
+
+ Note, This feature is currently sorried out for Windows targets
+ trying to
+
+`naked'
+ Use this attribute on the ARM, AVR, IP2K and SPU ports to indicate
+ that the specified function does not need prologue/epilogue
+ sequences generated by the compiler. It is up to the programmer
+ to provide these sequences. The only statements that can be safely
+ included in naked functions are `asm' statements that do not have
+ operands. All other statements, including declarations of local
+ variables, `if' statements, and so forth, should be avoided.
+ Naked functions should be used to implement the body of an
+ assembly function, while allowing the compiler to construct the
+ requisite function declaration for the assembler.
+
+`near'
+ On 68HC11 and 68HC12 the `near' attribute causes the compiler to
+ use the normal calling convention based on `jsr' and `rts'. This
+ attribute can be used to cancel the effect of the `-mlong-calls'
+ option.
+
+`nesting'
+ Use this attribute together with `interrupt_handler',
+ `exception_handler' or `nmi_handler' to indicate that the function
+ entry code should enable nested interrupts or exceptions.
+
+`nmi_handler'
+ Use this attribute on the Blackfin to indicate that the specified
+ function is an NMI handler. The compiler will generate function
+ entry and exit sequences suitable for use in an NMI handler when
+ this attribute is present.
+
+`no_instrument_function'
+ If `-finstrument-functions' is given, profiling function calls will
+ be generated at entry and exit of most user-compiled functions.
+ Functions with this attribute will not be so instrumented.
+
+`noinline'
+ This function attribute prevents a function from being considered
+ for inlining. If the function does not have side-effects, there
+ are optimizations other than inlining that causes function calls
+ to be optimized away, although the function call is live. To keep
+ such calls from being optimized away, put
+ asm ("");
+ (*note Extended Asm::) in the called function, to serve as a
+ special side-effect.
+
+`nonnull (ARG-INDEX, ...)'
+ The `nonnull' attribute specifies that some function parameters
+ should be non-null pointers. For instance, the declaration:
+
+ extern void *
+ my_memcpy (void *dest, const void *src, size_t len)
+ __attribute__((nonnull (1, 2)));
+
+ causes the compiler to check that, in calls to `my_memcpy',
+ arguments DEST and SRC are non-null. If the compiler determines
+ that a null pointer is passed in an argument slot marked as
+ non-null, and the `-Wnonnull' option is enabled, a warning is
+ issued. The compiler may also choose to make optimizations based
+ on the knowledge that certain function arguments will not be null.
+
+ If no argument index list is given to the `nonnull' attribute, all
+ pointer arguments are marked as non-null. To illustrate, the
+ following declaration is equivalent to the previous example:
+
+ extern void *
+ my_memcpy (void *dest, const void *src, size_t len)
+ __attribute__((nonnull));
+
+`noreturn'
+ A few standard library functions, such as `abort' and `exit',
+ cannot return. GCC knows this automatically. Some programs define
+ their own functions that never return. You can declare them
+ `noreturn' to tell the compiler this fact. For example,
+
+ void fatal () __attribute__ ((noreturn));
+
+ void
+ fatal (/* ... */)
+ {
+ /* ... */ /* Print error message. */ /* ... */
+ exit (1);
+ }
+
+ The `noreturn' keyword tells the compiler to assume that `fatal'
+ cannot return. It can then optimize without regard to what would
+ happen if `fatal' ever did return. This makes slightly better
+ code. More importantly, it helps avoid spurious warnings of
+ uninitialized variables.
+
+ The `noreturn' keyword does not affect the exceptional path when
+ that applies: a `noreturn'-marked function may still return to the
+ caller by throwing an exception or calling `longjmp'.
+
+ Do not assume that registers saved by the calling function are
+ restored before calling the `noreturn' function.
+
+ It does not make sense for a `noreturn' function to have a return
+ type other than `void'.
+
+ The attribute `noreturn' is not implemented in GCC versions
+ earlier than 2.5. An alternative way to declare that a function
+ does not return, which works in the current version and in some
+ older versions, is as follows:
+
+ typedef void voidfn ();
+
+ volatile voidfn fatal;
+
+ This approach does not work in GNU C++.
+
+`nothrow'
+ The `nothrow' attribute is used to inform the compiler that a
+ function cannot throw an exception. For example, most functions in
+ the standard C library can be guaranteed not to throw an exception
+ with the notable exceptions of `qsort' and `bsearch' that take
+ function pointer arguments. The `nothrow' attribute is not
+ implemented in GCC versions earlier than 3.3.
+
+`optimize'
+ The `optimize' attribute is used to specify that a function is to
+ be compiled with different optimization options than specified on
+ the command line. Arguments can either be numbers or strings.
+ Numbers are assumed to be an optimization level. Strings that
+ begin with `O' are assumed to be an optimization option, while
+ other options are assumed to be used with a `-f' prefix. You can
+ also use the `#pragma GCC optimize' pragma to set the optimization
+ options that affect more than one function. *Note Function
+ Specific Option Pragmas::, for details about the `#pragma GCC
+ optimize' pragma.
+
+ This can be used for instance to have frequently executed functions
+ compiled with more aggressive optimization options that produce
+ faster and larger code, while other functions can be called with
+ less aggressive options.
+
+`pure'
+ Many functions have no effects except the return value and their
+ return value depends only on the parameters and/or global
+ variables. Such a function can be subject to common subexpression
+ elimination and loop optimization just as an arithmetic operator
+ would be. These functions should be declared with the attribute
+ `pure'. For example,
+
+ int square (int) __attribute__ ((pure));
+
+ says that the hypothetical function `square' is safe to call fewer
+ times than the program says.
+
+ Some of common examples of pure functions are `strlen' or `memcmp'.
+ Interesting non-pure functions are functions with infinite loops
+ or those depending on volatile memory or other system resource,
+ that may change between two consecutive calls (such as `feof' in a
+ multithreading environment).
+
+ The attribute `pure' is not implemented in GCC versions earlier
+ than 2.96.
+
+`hot'
+ The `hot' attribute is used to inform the compiler that a function
+ is a hot spot of the compiled program. The function is optimized
+ more aggressively and on many target it is placed into special
+ subsection of the text section so all hot functions appears close
+ together improving locality.
+
+ When profile feedback is available, via `-fprofile-use', hot
+ functions are automatically detected and this attribute is ignored.
+
+ The `hot' attribute is not implemented in GCC versions earlier
+ than 4.3.
+
+`cold'
+ The `cold' attribute is used to inform the compiler that a
+ function is unlikely executed. The function is optimized for size
+ rather than speed and on many targets it is placed into special
+ subsection of the text section so all cold functions appears close
+ together improving code locality of non-cold parts of program.
+ The paths leading to call of cold functions within code are marked
+ as unlikely by the branch prediction mechanism. It is thus useful
+ to mark functions used to handle unlikely conditions, such as
+ `perror', as cold to improve optimization of hot functions that do
+ call marked functions in rare occasions.
+
+ When profile feedback is available, via `-fprofile-use', hot
+ functions are automatically detected and this attribute is ignored.
+
+ The `cold' attribute is not implemented in GCC versions earlier
+ than 4.3.
+
+`regparm (NUMBER)'
+ On the Intel 386, the `regparm' attribute causes the compiler to
+ pass arguments number one to NUMBER if they are of integral type
+ in registers EAX, EDX, and ECX instead of on the stack. Functions
+ that take a variable number of arguments will continue to be
+ passed all of their arguments on the stack.
+
+ Beware that on some ELF systems this attribute is unsuitable for
+ global functions in shared libraries with lazy binding (which is
+ the default). Lazy binding will send the first call via resolving
+ code in the loader, which might assume EAX, EDX and ECX can be
+ clobbered, as per the standard calling conventions. Solaris 8 is
+ affected by this. GNU systems with GLIBC 2.1 or higher, and
+ FreeBSD, are believed to be safe since the loaders there save EAX,
+ EDX and ECX. (Lazy binding can be disabled with the linker or the
+ loader if desired, to avoid the problem.)
+
+`sseregparm'
+ On the Intel 386 with SSE support, the `sseregparm' attribute
+ causes the compiler to pass up to 3 floating point arguments in
+ SSE registers instead of on the stack. Functions that take a
+ variable number of arguments will continue to pass all of their
+ floating point arguments on the stack.
+
+`force_align_arg_pointer'
+ On the Intel x86, the `force_align_arg_pointer' attribute may be
+ applied to individual function definitions, generating an alternate
+ prologue and epilogue that realigns the runtime stack if necessary.
+ This supports mixing legacy codes that run with a 4-byte aligned
+ stack with modern codes that keep a 16-byte stack for SSE
+ compatibility.
+
+`resbank'
+ On the SH2A target, this attribute enables the high-speed register
+ saving and restoration using a register bank for
+ `interrupt_handler' routines. Saving to the bank is performed
+ automatically after the CPU accepts an interrupt that uses a
+ register bank.
+
+ The nineteen 32-bit registers comprising general register R0 to
+ R14, control register GBR, and system registers MACH, MACL, and PR
+ and the vector table address offset are saved into a register
+ bank. Register banks are stacked in first-in last-out (FILO)
+ sequence. Restoration from the bank is executed by issuing a
+ RESBANK instruction.
+
+`returns_twice'
+ The `returns_twice' attribute tells the compiler that a function
+ may return more than one time. The compiler will ensure that all
+ registers are dead before calling such a function and will emit a
+ warning about the variables that may be clobbered after the second
+ return from the function. Examples of such functions are `setjmp'
+ and `vfork'. The `longjmp'-like counterpart of such function, if
+ any, might need to be marked with the `noreturn' attribute.
+
+`saveall'
+ Use this attribute on the Blackfin, H8/300, H8/300H, and H8S to
+ indicate that all registers except the stack pointer should be
+ saved in the prologue regardless of whether they are used or not.
+
+`section ("SECTION-NAME")'
+ Normally, the compiler places the code it generates in the `text'
+ section. Sometimes, however, you need additional sections, or you
+ need certain particular functions to appear in special sections.
+ The `section' attribute specifies that a function lives in a
+ particular section. For example, the declaration:
+
+ extern void foobar (void) __attribute__ ((section ("bar")));
+
+ puts the function `foobar' in the `bar' section.
+
+ Some file formats do not support arbitrary sections so the
+ `section' attribute is not available on all platforms. If you
+ need to map the entire contents of a module to a particular
+ section, consider using the facilities of the linker instead.
+
+`sentinel'
+ This function attribute ensures that a parameter in a function
+ call is an explicit `NULL'. The attribute is only valid on
+ variadic functions. By default, the sentinel is located at
+ position zero, the last parameter of the function call. If an
+ optional integer position argument P is supplied to the attribute,
+ the sentinel must be located at position P counting backwards from
+ the end of the argument list.
+
+ __attribute__ ((sentinel))
+ is equivalent to
+ __attribute__ ((sentinel(0)))
+
+ The attribute is automatically set with a position of 0 for the
+ built-in functions `execl' and `execlp'. The built-in function
+ `execle' has the attribute set with a position of 1.
+
+ A valid `NULL' in this context is defined as zero with any pointer
+ type. If your system defines the `NULL' macro with an integer type
+ then you need to add an explicit cast. GCC replaces `stddef.h'
+ with a copy that redefines NULL appropriately.
+
+ The warnings for missing or incorrect sentinels are enabled with
+ `-Wformat'.
+
+`short_call'
+ See long_call/short_call.
+
+`shortcall'
+ See longcall/shortcall.
+
+`signal'
+ Use this attribute on the AVR to indicate that the specified
+ function is a signal handler. The compiler will generate function
+ entry and exit sequences suitable for use in a signal handler when
+ this attribute is present. Interrupts will be disabled inside the
+ function.
+
+`sp_switch'
+ Use this attribute on the SH to indicate an `interrupt_handler'
+ function should switch to an alternate stack. It expects a string
+ argument that names a global variable holding the address of the
+ alternate stack.
+
+ void *alt_stack;
+ void f () __attribute__ ((interrupt_handler,
+ sp_switch ("alt_stack")));
+
+`stdcall'
+ On the Intel 386, the `stdcall' attribute causes the compiler to
+ assume that the called function will pop off the stack space used
+ to pass arguments, unless it takes a variable number of arguments.
+
+`syscall_linkage'
+ This attribute is used to modify the IA64 calling convention by
+ marking all input registers as live at all function exits. This
+ makes it possible to restart a system call after an interrupt
+ without having to save/restore the input registers. This also
+ prevents kernel data from leaking into application code.
+
+`target'
+ The `target' attribute is used to specify that a function is to be
+ compiled with different target options than specified on the
+ command line. This can be used for instance to have functions
+ compiled with a different ISA (instruction set architecture) than
+ the default. You can also use the `#pragma GCC target' pragma to
+ set more than one function to be compiled with specific target
+ options. *Note Function Specific Option Pragmas::, for details
+ about the `#pragma GCC target' pragma.
+
+ For instance on a 386, you could compile one function with
+ `target("sse4.1,arch=core2")' and another with
+ `target("sse4a,arch=amdfam10")' that would be equivalent to
+ compiling the first function with `-msse4.1' and `-march=core2'
+ options, and the second function with `-msse4a' and
+ `-march=amdfam10' options. It is up to the user to make sure that
+ a function is only invoked on a machine that supports the
+ particular ISA it was compiled for (for example by using `cpuid'
+ on 386 to determine what feature bits and architecture family are
+ used).
+
+ int core2_func (void) __attribute__ ((__target__ ("arch=core2")));
+ int sse3_func (void) __attribute__ ((__target__ ("sse3")));
+
+ On the 386, the following options are allowed:
+
+ `abm'
+ `no-abm'
+ Enable/disable the generation of the advanced bit
+ instructions.
+
+ `aes'
+ `no-aes'
+ Enable/disable the generation of the AES instructions.
+
+ `mmx'
+ `no-mmx'
+ Enable/disable the generation of the MMX instructions.
+
+ `pclmul'
+ `no-pclmul'
+ Enable/disable the generation of the PCLMUL instructions.
+
+ `popcnt'
+ `no-popcnt'
+ Enable/disable the generation of the POPCNT instruction.
+
+ `sse'
+ `no-sse'
+ Enable/disable the generation of the SSE instructions.
+
+ `sse2'
+ `no-sse2'
+ Enable/disable the generation of the SSE2 instructions.
+
+ `sse3'
+ `no-sse3'
+ Enable/disable the generation of the SSE3 instructions.
+
+ `sse4'
+ `no-sse4'
+ Enable/disable the generation of the SSE4 instructions (both
+ SSE4.1 and SSE4.2).
+
+ `sse4.1'
+ `no-sse4.1'
+ Enable/disable the generation of the sse4.1 instructions.
+
+ `sse4.2'
+ `no-sse4.2'
+ Enable/disable the generation of the sse4.2 instructions.
+
+ `sse4a'
+ `no-sse4a'
+ Enable/disable the generation of the SSE4A instructions.
+
+ `sse5'
+ `no-sse5'
+ Enable/disable the generation of the SSE5 instructions.
+
+ `ssse3'
+ `no-ssse3'
+ Enable/disable the generation of the SSSE3 instructions.
+
+ `cld'
+ `no-cld'
+ Enable/disable the generation of the CLD before string moves.
+
+ `fancy-math-387'
+ `no-fancy-math-387'
+ Enable/disable the generation of the `sin', `cos', and `sqrt'
+ instructions on the 387 floating point unit.
+
+ `fused-madd'
+ `no-fused-madd'
+ Enable/disable the generation of the fused multiply/add
+ instructions.
+
+ `ieee-fp'
+ `no-ieee-fp'
+ Enable/disable the generation of floating point that depends
+ on IEEE arithmetic.
+
+ `inline-all-stringops'
+ `no-inline-all-stringops'
+ Enable/disable inlining of string operations.
+
+ `inline-stringops-dynamically'
+ `no-inline-stringops-dynamically'
+ Enable/disable the generation of the inline code to do small
+ string operations and calling the library routines for large
+ operations.
+
+ `align-stringops'
+ `no-align-stringops'
+ Do/do not align destination of inlined string operations.
+
+ `recip'
+ `no-recip'
+ Enable/disable the generation of RCPSS, RCPPS, RSQRTSS and
+ RSQRTPS instructions followed an additional Newton-Raphson
+ step instead of doing a floating point division.
+
+ `arch=ARCH'
+ Specify the architecture to generate code for in compiling
+ the function.
+
+ `tune=TUNE'
+ Specify the architecture to tune for in compiling the
+ function.
+
+ `fpmath=FPMATH'
+ Specify which floating point unit to use. The
+ `target("fpmath=sse,387")' option must be specified as
+ `target("fpmath=sse+387")' because the comma would separate
+ different options.
+
+ On the 386, you can use either multiple strings to specify multiple
+ options, or you can separate the option with a comma (`,').
+
+ On the 386, the inliner will not inline a function that has
+ different target options than the caller, unless the callee has a
+ subset of the target options of the caller. For example a
+ function declared with `target("sse5")' can inline a function with
+ `target("sse2")', since `-msse5' implies `-msse2'.
+
+ The `target' attribute is not implemented in GCC versions earlier
+ than 4.4, and at present only the 386 uses it.
+
+`tiny_data'
+ Use this attribute on the H8/300H and H8S to indicate that the
+ specified variable should be placed into the tiny data section.
+ The compiler will generate more efficient code for loads and stores
+ on data in the tiny data section. Note the tiny data area is
+ limited to slightly under 32kbytes of data.
+
+`trap_exit'
+ Use this attribute on the SH for an `interrupt_handler' to return
+ using `trapa' instead of `rte'. This attribute expects an integer
+ argument specifying the trap number to be used.
+
+`unused'
+ This attribute, attached to a function, means that the function is
+ meant to be possibly unused. GCC will not produce a warning for
+ this function.
+
+`used'
+ This attribute, attached to a function, means that code must be
+ emitted for the function even if it appears that the function is
+ not referenced. This is useful, for example, when the function is
+ referenced only in inline assembly.
+
+`version_id'
+ This IA64 HP-UX attribute, attached to a global variable or
+ function, renames a symbol to contain a version string, thus
+ allowing for function level versioning. HP-UX system header files
+ may use version level functioning for some system calls.
+
+ extern int foo () __attribute__((version_id ("20040821")));
+
+ Calls to FOO will be mapped to calls to FOO{20040821}.
+
+`visibility ("VISIBILITY_TYPE")'
+ This attribute affects the linkage of the declaration to which it
+ is attached. There are four supported VISIBILITY_TYPE values:
+ default, hidden, protected or internal visibility.
+
+ void __attribute__ ((visibility ("protected")))
+ f () { /* Do something. */; }
+ int i __attribute__ ((visibility ("hidden")));
+
+ The possible values of VISIBILITY_TYPE correspond to the
+ visibility settings in the ELF gABI.
+
+ "default"
+ Default visibility is the normal case for the object file
+ format. This value is available for the visibility attribute
+ to override other options that may change the assumed
+ visibility of entities.
+
+ On ELF, default visibility means that the declaration is
+ visible to other modules and, in shared libraries, means that
+ the declared entity may be overridden.
+
+ On Darwin, default visibility means that the declaration is
+ visible to other modules.
+
+ Default visibility corresponds to "external linkage" in the
+ language.
+
+ "hidden"
+ Hidden visibility indicates that the entity declared will
+ have a new form of linkage, which we'll call "hidden
+ linkage". Two declarations of an object with hidden linkage
+ refer to the same object if they are in the same shared
+ object.
+
+ "internal"
+ Internal visibility is like hidden visibility, but with
+ additional processor specific semantics. Unless otherwise
+ specified by the psABI, GCC defines internal visibility to
+ mean that a function is _never_ called from another module.
+ Compare this with hidden functions which, while they cannot
+ be referenced directly by other modules, can be referenced
+ indirectly via function pointers. By indicating that a
+ function cannot be called from outside the module, GCC may
+ for instance omit the load of a PIC register since it is known
+ that the calling function loaded the correct value.
+
+ "protected"
+ Protected visibility is like default visibility except that it
+ indicates that references within the defining module will
+ bind to the definition in that module. That is, the declared
+ entity cannot be overridden by another module.
+
+
+ All visibilities are supported on many, but not all, ELF targets
+ (supported when the assembler supports the `.visibility'
+ pseudo-op). Default visibility is supported everywhere. Hidden
+ visibility is supported on Darwin targets.
+
+ The visibility attribute should be applied only to declarations
+ which would otherwise have external linkage. The attribute should
+ be applied consistently, so that the same entity should not be
+ declared with different settings of the attribute.
+
+ In C++, the visibility attribute applies to types as well as
+ functions and objects, because in C++ types have linkage. A class
+ must not have greater visibility than its non-static data member
+ types and bases, and class members default to the visibility of
+ their class. Also, a declaration without explicit visibility is
+ limited to the visibility of its type.
+
+ In C++, you can mark member functions and static member variables
+ of a class with the visibility attribute. This is useful if you
+ know a particular method or static member variable should only be
+ used from one shared object; then you can mark it hidden while the
+ rest of the class has default visibility. Care must be taken to
+ avoid breaking the One Definition Rule; for example, it is usually
+ not useful to mark an inline method as hidden without marking the
+ whole class as hidden.
+
+ A C++ namespace declaration can also have the visibility attribute.
+ This attribute applies only to the particular namespace body, not
+ to other definitions of the same namespace; it is equivalent to
+ using `#pragma GCC visibility' before and after the namespace
+ definition (*note Visibility Pragmas::).
+
+ In C++, if a template argument has limited visibility, this
+ restriction is implicitly propagated to the template instantiation.
+ Otherwise, template instantiations and specializations default to
+ the visibility of their template.
+
+ If both the template and enclosing class have explicit visibility,
+ the visibility from the template is used.
+
+`warn_unused_result'
+ The `warn_unused_result' attribute causes a warning to be emitted
+ if a caller of the function with this attribute does not use its
+ return value. This is useful for functions where not checking the
+ result is either a security problem or always a bug, such as
+ `realloc'.
+
+ int fn () __attribute__ ((warn_unused_result));
+ int foo ()
+ {
+ if (fn () < 0) return -1;
+ fn ();
+ return 0;
+ }
+
+ results in warning on line 5.
+
+`weak'
+ The `weak' attribute causes the declaration to be emitted as a weak
+ symbol rather than a global. This is primarily useful in defining
+ library functions which can be overridden in user code, though it
+ can also be used with non-function declarations. Weak symbols are
+ supported for ELF targets, and also for a.out targets when using
+ the GNU assembler and linker.
+
+`weakref'
+`weakref ("TARGET")'
+ The `weakref' attribute marks a declaration as a weak reference.
+ Without arguments, it should be accompanied by an `alias' attribute
+ naming the target symbol. Optionally, the TARGET may be given as
+ an argument to `weakref' itself. In either case, `weakref'
+ implicitly marks the declaration as `weak'. Without a TARGET,
+ given as an argument to `weakref' or to `alias', `weakref' is
+ equivalent to `weak'.
+
+ static int x() __attribute__ ((weakref ("y")));
+ /* is equivalent to... */
+ static int x() __attribute__ ((weak, weakref, alias ("y")));
+ /* and to... */
+ static int x() __attribute__ ((weakref));
+ static int x() __attribute__ ((alias ("y")));
+
+ A weak reference is an alias that does not by itself require a
+ definition to be given for the target symbol. If the target
+ symbol is only referenced through weak references, then the
+ becomes a `weak' undefined symbol. If it is directly referenced,
+ however, then such strong references prevail, and a definition
+ will be required for the symbol, not necessarily in the same
+ translation unit.
+
+ The effect is equivalent to moving all references to the alias to a
+ separate translation unit, renaming the alias to the aliased
+ symbol, declaring it as weak, compiling the two separate
+ translation units and performing a reloadable link on them.
+
+ At present, a declaration to which `weakref' is attached can only
+ be `static'.
+
+
+ You can specify multiple attributes in a declaration by separating them
+by commas within the double parentheses or by immediately following an
+attribute declaration with another attribute declaration.
+
+ Some people object to the `__attribute__' feature, suggesting that ISO
+C's `#pragma' should be used instead. At the time `__attribute__' was
+designed, there were two reasons for not doing this.
+
+ 1. It is impossible to generate `#pragma' commands from a macro.
+
+ 2. There is no telling what the same `#pragma' might mean in another
+ compiler.
+
+ These two reasons applied to almost any application that might have
+been proposed for `#pragma'. It was basically a mistake to use
+`#pragma' for _anything_.
+
+ The ISO C99 standard includes `_Pragma', which now allows pragmas to
+be generated from macros. In addition, a `#pragma GCC' namespace is
+now in use for GCC-specific pragmas. However, it has been found
+convenient to use `__attribute__' to achieve a natural attachment of
+attributes to their corresponding declarations, whereas `#pragma GCC'
+is of use for constructs that do not naturally form part of the
+grammar. *Note Miscellaneous Preprocessing Directives: (cpp)Other
+Directives.
+
+
+File: gcc.info, Node: Attribute Syntax, Next: Function Prototypes, Prev: Function Attributes, Up: C Extensions
+
+5.28 Attribute Syntax
+=====================
+
+This section describes the syntax with which `__attribute__' may be
+used, and the constructs to which attribute specifiers bind, for the C
+language. Some details may vary for C++ and Objective-C. Because of
+infelicities in the grammar for attributes, some forms described here
+may not be successfully parsed in all cases.
+
+ There are some problems with the semantics of attributes in C++. For
+example, there are no manglings for attributes, although they may affect
+code generation, so problems may arise when attributed types are used in
+conjunction with templates or overloading. Similarly, `typeid' does
+not distinguish between types with different attributes. Support for
+attributes in C++ may be restricted in future to attributes on
+declarations only, but not on nested declarators.
+
+ *Note Function Attributes::, for details of the semantics of attributes
+applying to functions. *Note Variable Attributes::, for details of the
+semantics of attributes applying to variables. *Note Type Attributes::,
+for details of the semantics of attributes applying to structure, union
+and enumerated types.
+
+ An "attribute specifier" is of the form `__attribute__
+((ATTRIBUTE-LIST))'. An "attribute list" is a possibly empty
+comma-separated sequence of "attributes", where each attribute is one
+of the following:
+
+ * Empty. Empty attributes are ignored.
+
+ * A word (which may be an identifier such as `unused', or a reserved
+ word such as `const').
+
+ * A word, followed by, in parentheses, parameters for the attribute.
+ These parameters take one of the following forms:
+
+ * An identifier. For example, `mode' attributes use this form.
+
+ * An identifier followed by a comma and a non-empty
+ comma-separated list of expressions. For example, `format'
+ attributes use this form.
+
+ * A possibly empty comma-separated list of expressions. For
+ example, `format_arg' attributes use this form with the list
+ being a single integer constant expression, and `alias'
+ attributes use this form with the list being a single string
+ constant.
+
+ An "attribute specifier list" is a sequence of one or more attribute
+specifiers, not separated by any other tokens.
+
+ In GNU C, an attribute specifier list may appear after the colon
+following a label, other than a `case' or `default' label. The only
+attribute it makes sense to use after a label is `unused'. This
+feature is intended for code generated by programs which contains labels
+that may be unused but which is compiled with `-Wall'. It would not
+normally be appropriate to use in it human-written code, though it
+could be useful in cases where the code that jumps to the label is
+contained within an `#ifdef' conditional. GNU C++ does not permit such
+placement of attribute lists, as it is permissible for a declaration,
+which could begin with an attribute list, to be labelled in C++.
+Declarations cannot be labelled in C90 or C99, so the ambiguity does
+not arise there.
+
+ An attribute specifier list may appear as part of a `struct', `union'
+or `enum' specifier. It may go either immediately after the `struct',
+`union' or `enum' keyword, or after the closing brace. The former
+syntax is preferred. Where attribute specifiers follow the closing
+brace, they are considered to relate to the structure, union or
+enumerated type defined, not to any enclosing declaration the type
+specifier appears in, and the type defined is not complete until after
+the attribute specifiers.
+
+ Otherwise, an attribute specifier appears as part of a declaration,
+counting declarations of unnamed parameters and type names, and relates
+to that declaration (which may be nested in another declaration, for
+example in the case of a parameter declaration), or to a particular
+declarator within a declaration. Where an attribute specifier is
+applied to a parameter declared as a function or an array, it should
+apply to the function or array rather than the pointer to which the
+parameter is implicitly converted, but this is not yet correctly
+implemented.
+
+ Any list of specifiers and qualifiers at the start of a declaration may
+contain attribute specifiers, whether or not such a list may in that
+context contain storage class specifiers. (Some attributes, however,
+are essentially in the nature of storage class specifiers, and only make
+sense where storage class specifiers may be used; for example,
+`section'.) There is one necessary limitation to this syntax: the
+first old-style parameter declaration in a function definition cannot
+begin with an attribute specifier, because such an attribute applies to
+the function instead by syntax described below (which, however, is not
+yet implemented in this case). In some other cases, attribute
+specifiers are permitted by this grammar but not yet supported by the
+compiler. All attribute specifiers in this place relate to the
+declaration as a whole. In the obsolescent usage where a type of `int'
+is implied by the absence of type specifiers, such a list of specifiers
+and qualifiers may be an attribute specifier list with no other
+specifiers or qualifiers.
+
+ At present, the first parameter in a function prototype must have some
+type specifier which is not an attribute specifier; this resolves an
+ambiguity in the interpretation of `void f(int (__attribute__((foo))
+x))', but is subject to change. At present, if the parentheses of a
+function declarator contain only attributes then those attributes are
+ignored, rather than yielding an error or warning or implying a single
+parameter of type int, but this is subject to change.
+
+ An attribute specifier list may appear immediately before a declarator
+(other than the first) in a comma-separated list of declarators in a
+declaration of more than one identifier using a single list of
+specifiers and qualifiers. Such attribute specifiers apply only to the
+identifier before whose declarator they appear. For example, in
+
+ __attribute__((noreturn)) void d0 (void),
+ __attribute__((format(printf, 1, 2))) d1 (const char *, ...),
+ d2 (void)
+
+the `noreturn' attribute applies to all the functions declared; the
+`format' attribute only applies to `d1'.
+
+ An attribute specifier list may appear immediately before the comma,
+`=' or semicolon terminating the declaration of an identifier other
+than a function definition. Such attribute specifiers apply to the
+declared object or function. Where an assembler name for an object or
+function is specified (*note Asm Labels::), the attribute must follow
+the `asm' specification.
+
+ An attribute specifier list may, in future, be permitted to appear
+after the declarator in a function definition (before any old-style
+parameter declarations or the function body).
+
+ Attribute specifiers may be mixed with type qualifiers appearing inside
+the `[]' of a parameter array declarator, in the C99 construct by which
+such qualifiers are applied to the pointer to which the array is
+implicitly converted. Such attribute specifiers apply to the pointer,
+not to the array, but at present this is not implemented and they are
+ignored.
+
+ An attribute specifier list may appear at the start of a nested
+declarator. At present, there are some limitations in this usage: the
+attributes correctly apply to the declarator, but for most individual
+attributes the semantics this implies are not implemented. When
+attribute specifiers follow the `*' of a pointer declarator, they may
+be mixed with any type qualifiers present. The following describes the
+formal semantics of this syntax. It will make the most sense if you
+are familiar with the formal specification of declarators in the ISO C
+standard.
+
+ Consider (as in C99 subclause 6.7.5 paragraph 4) a declaration `T D1',
+where `T' contains declaration specifiers that specify a type TYPE
+(such as `int') and `D1' is a declarator that contains an identifier
+IDENT. The type specified for IDENT for derived declarators whose type
+does not include an attribute specifier is as in the ISO C standard.
+
+ If `D1' has the form `( ATTRIBUTE-SPECIFIER-LIST D )', and the
+declaration `T D' specifies the type "DERIVED-DECLARATOR-TYPE-LIST
+TYPE" for IDENT, then `T D1' specifies the type
+"DERIVED-DECLARATOR-TYPE-LIST ATTRIBUTE-SPECIFIER-LIST TYPE" for IDENT.
+
+ If `D1' has the form `* TYPE-QUALIFIER-AND-ATTRIBUTE-SPECIFIER-LIST
+D', and the declaration `T D' specifies the type
+"DERIVED-DECLARATOR-TYPE-LIST TYPE" for IDENT, then `T D1' specifies
+the type "DERIVED-DECLARATOR-TYPE-LIST
+TYPE-QUALIFIER-AND-ATTRIBUTE-SPECIFIER-LIST TYPE" for IDENT.
+
+ For example,
+
+ void (__attribute__((noreturn)) ****f) (void);
+
+specifies the type "pointer to pointer to pointer to pointer to
+non-returning function returning `void'". As another example,
+
+ char *__attribute__((aligned(8))) *f;
+
+specifies the type "pointer to 8-byte-aligned pointer to `char'". Note
+again that this does not work with most attributes; for example, the
+usage of `aligned' and `noreturn' attributes given above is not yet
+supported.
+
+ For compatibility with existing code written for compiler versions that
+did not implement attributes on nested declarators, some laxity is
+allowed in the placing of attributes. If an attribute that only applies
+to types is applied to a declaration, it will be treated as applying to
+the type of that declaration. If an attribute that only applies to
+declarations is applied to the type of a declaration, it will be treated
+as applying to that declaration; and, for compatibility with code
+placing the attributes immediately before the identifier declared, such
+an attribute applied to a function return type will be treated as
+applying to the function type, and such an attribute applied to an array
+element type will be treated as applying to the array type. If an
+attribute that only applies to function types is applied to a
+pointer-to-function type, it will be treated as applying to the pointer
+target type; if such an attribute is applied to a function return type
+that is not a pointer-to-function type, it will be treated as applying
+to the function type.
+
+
+File: gcc.info, Node: Function Prototypes, Next: C++ Comments, Prev: Attribute Syntax, Up: C Extensions
+
+5.29 Prototypes and Old-Style Function Definitions
+==================================================
+
+GNU C extends ISO C to allow a function prototype to override a later
+old-style non-prototype definition. Consider the following example:
+
+ /* Use prototypes unless the compiler is old-fashioned. */
+ #ifdef __STDC__
+ #define P(x) x
+ #else
+ #define P(x) ()
+ #endif
+
+ /* Prototype function declaration. */
+ int isroot P((uid_t));
+
+ /* Old-style function definition. */
+ int
+ isroot (x) /* ??? lossage here ??? */
+ uid_t x;
+ {
+ return x == 0;
+ }
+
+ Suppose the type `uid_t' happens to be `short'. ISO C does not allow
+this example, because subword arguments in old-style non-prototype
+definitions are promoted. Therefore in this example the function
+definition's argument is really an `int', which does not match the
+prototype argument type of `short'.
+
+ This restriction of ISO C makes it hard to write code that is portable
+to traditional C compilers, because the programmer does not know
+whether the `uid_t' type is `short', `int', or `long'. Therefore, in
+cases like these GNU C allows a prototype to override a later old-style
+definition. More precisely, in GNU C, a function prototype argument
+type overrides the argument type specified by a later old-style
+definition if the former type is the same as the latter type before
+promotion. Thus in GNU C the above example is equivalent to the
+following:
+
+ int isroot (uid_t);
+
+ int
+ isroot (uid_t x)
+ {
+ return x == 0;
+ }
+
+GNU C++ does not support old-style function definitions, so this
+extension is irrelevant.
+
+
+File: gcc.info, Node: C++ Comments, Next: Dollar Signs, Prev: Function Prototypes, Up: C Extensions
+
+5.30 C++ Style Comments
+=======================
+
+In GNU C, you may use C++ style comments, which start with `//' and
+continue until the end of the line. Many other C implementations allow
+such comments, and they are included in the 1999 C standard. However,
+C++ style comments are not recognized if you specify an `-std' option
+specifying a version of ISO C before C99, or `-ansi' (equivalent to
+`-std=c89').
+
+
+File: gcc.info, Node: Dollar Signs, Next: Character Escapes, Prev: C++ Comments, Up: C Extensions
+
+5.31 Dollar Signs in Identifier Names
+=====================================
+
+In GNU C, you may normally use dollar signs in identifier names. This
+is because many traditional C implementations allow such identifiers.
+However, dollar signs in identifiers are not supported on a few target
+machines, typically because the target assembler does not allow them.
+
+
+File: gcc.info, Node: Character Escapes, Next: Variable Attributes, Prev: Dollar Signs, Up: C Extensions
+
+5.32 The Character <ESC> in Constants
+=====================================
+
+You can use the sequence `\e' in a string or character constant to
+stand for the ASCII character <ESC>.
+
+
+File: gcc.info, Node: Alignment, Next: Inline, Prev: Type Attributes, Up: C Extensions
+
+5.33 Inquiring on Alignment of Types or Variables
+=================================================
+
+The keyword `__alignof__' allows you to inquire about how an object is
+aligned, or the minimum alignment usually required by a type. Its
+syntax is just like `sizeof'.
+
+ For example, if the target machine requires a `double' value to be
+aligned on an 8-byte boundary, then `__alignof__ (double)' is 8. This
+is true on many RISC machines. On more traditional machine designs,
+`__alignof__ (double)' is 4 or even 2.
+
+ Some machines never actually require alignment; they allow reference
+to any data type even at an odd address. For these machines,
+`__alignof__' reports the smallest alignment that GCC will give the
+data type, usually as mandated by the target ABI.
+
+ If the operand of `__alignof__' is an lvalue rather than a type, its
+value is the required alignment for its type, taking into account any
+minimum alignment specified with GCC's `__attribute__' extension (*note
+Variable Attributes::). For example, after this declaration:
+
+ struct foo { int x; char y; } foo1;
+
+the value of `__alignof__ (foo1.y)' is 1, even though its actual
+alignment is probably 2 or 4, the same as `__alignof__ (int)'.
+
+ It is an error to ask for the alignment of an incomplete type.
+
+
+File: gcc.info, Node: Variable Attributes, Next: Type Attributes, Prev: Character Escapes, Up: C Extensions
+
+5.34 Specifying Attributes of Variables
+=======================================
+
+The keyword `__attribute__' allows you to specify special attributes of
+variables or structure fields. This keyword is followed by an
+attribute specification inside double parentheses. Some attributes are
+currently defined generically for variables. Other attributes are
+defined for variables on particular target systems. Other attributes
+are available for functions (*note Function Attributes::) and for types
+(*note Type Attributes::). Other front ends might define more
+attributes (*note Extensions to the C++ Language: C++ Extensions.).
+
+ You may also specify attributes with `__' preceding and following each
+keyword. This allows you to use them in header files without being
+concerned about a possible macro of the same name. For example, you
+may use `__aligned__' instead of `aligned'.
+
+ *Note Attribute Syntax::, for details of the exact syntax for using
+attributes.
+
+`aligned (ALIGNMENT)'
+ This attribute specifies a minimum alignment for the variable or
+ structure field, measured in bytes. For example, the declaration:
+
+ int x __attribute__ ((aligned (16))) = 0;
+
+ causes the compiler to allocate the global variable `x' on a
+ 16-byte boundary. On a 68040, this could be used in conjunction
+ with an `asm' expression to access the `move16' instruction which
+ requires 16-byte aligned operands.
+
+ You can also specify the alignment of structure fields. For
+ example, to create a double-word aligned `int' pair, you could
+ write:
+
+ struct foo { int x[2] __attribute__ ((aligned (8))); };
+
+ This is an alternative to creating a union with a `double' member
+ that forces the union to be double-word aligned.
+
+ As in the preceding examples, you can explicitly specify the
+ alignment (in bytes) that you wish the compiler to use for a given
+ variable or structure field. Alternatively, you can leave out the
+ alignment factor and just ask the compiler to align a variable or
+ field to the default alignment for the target architecture you are
+ compiling for. The default alignment is sufficient for all scalar
+ types, but may not be enough for all vector types on a target
+ which supports vector operations. The default alignment is fixed
+ for a particular target ABI.
+
+ Gcc also provides a target specific macro `__BIGGEST_ALIGNMENT__',
+ which is the largest alignment ever used for any data type on the
+ target machine you are compiling for. For example, you could
+ write:
+
+ short array[3] __attribute__ ((aligned (__BIGGEST_ALIGNMENT__)));
+
+ The compiler automatically sets the alignment for the declared
+ variable or field to `__BIGGEST_ALIGNMENT__'. Doing this can
+ often make copy operations more efficient, because the compiler can
+ use whatever instructions copy the biggest chunks of memory when
+ performing copies to or from the variables or fields that you have
+ aligned this way. Note that the value of `__BIGGEST_ALIGNMENT__'
+ may change depending on command line options.
+
+ When used on a struct, or struct member, the `aligned' attribute
+ can only increase the alignment; in order to decrease it, the
+ `packed' attribute must be specified as well. When used as part
+ of a typedef, the `aligned' attribute can both increase and
+ decrease alignment, and specifying the `packed' attribute will
+ generate a warning.
+
+ Note that the effectiveness of `aligned' attributes may be limited
+ by inherent limitations in your linker. On many systems, the
+ linker is only able to arrange for variables to be aligned up to a
+ certain maximum alignment. (For some linkers, the maximum
+ supported alignment may be very very small.) If your linker is
+ only able to align variables up to a maximum of 8 byte alignment,
+ then specifying `aligned(16)' in an `__attribute__' will still
+ only provide you with 8 byte alignment. See your linker
+ documentation for further information.
+
+ The `aligned' attribute can also be used for functions (*note
+ Function Attributes::.)
+
+`cleanup (CLEANUP_FUNCTION)'
+ The `cleanup' attribute runs a function when the variable goes out
+ of scope. This attribute can only be applied to auto function
+ scope variables; it may not be applied to parameters or variables
+ with static storage duration. The function must take one
+ parameter, a pointer to a type compatible with the variable. The
+ return value of the function (if any) is ignored.
+
+ If `-fexceptions' is enabled, then CLEANUP_FUNCTION will be run
+ during the stack unwinding that happens during the processing of
+ the exception. Note that the `cleanup' attribute does not allow
+ the exception to be caught, only to perform an action. It is
+ undefined what happens if CLEANUP_FUNCTION does not return
+ normally.
+
+`common'
+`nocommon'
+ The `common' attribute requests GCC to place a variable in
+ "common" storage. The `nocommon' attribute requests the
+ opposite--to allocate space for it directly.
+
+ These attributes override the default chosen by the `-fno-common'
+ and `-fcommon' flags respectively.
+
+`deprecated'
+ The `deprecated' attribute results in a warning if the variable is
+ used anywhere in the source file. This is useful when identifying
+ variables that are expected to be removed in a future version of a
+ program. The warning also includes the location of the declaration
+ of the deprecated variable, to enable users to easily find further
+ information about why the variable is deprecated, or what they
+ should do instead. Note that the warning only occurs for uses:
+
+ extern int old_var __attribute__ ((deprecated));
+ extern int old_var;
+ int new_fn () { return old_var; }
+
+ results in a warning on line 3 but not line 2.
+
+ The `deprecated' attribute can also be used for functions and
+ types (*note Function Attributes::, *note Type Attributes::.)
+
+`mode (MODE)'
+ This attribute specifies the data type for the
+ declaration--whichever type corresponds to the mode MODE. This in
+ effect lets you request an integer or floating point type
+ according to its width.
+
+ You may also specify a mode of `byte' or `__byte__' to indicate
+ the mode corresponding to a one-byte integer, `word' or `__word__'
+ for the mode of a one-word integer, and `pointer' or `__pointer__'
+ for the mode used to represent pointers.
+
+`packed'
+ The `packed' attribute specifies that a variable or structure field
+ should have the smallest possible alignment--one byte for a
+ variable, and one bit for a field, unless you specify a larger
+ value with the `aligned' attribute.
+
+ Here is a structure in which the field `x' is packed, so that it
+ immediately follows `a':
+
+ struct foo
+ {
+ char a;
+ int x[2] __attribute__ ((packed));
+ };
+
+ _Note:_ The 4.1, 4.2 and 4.3 series of GCC ignore the `packed'
+ attribute on bit-fields of type `char'. This has been fixed in
+ GCC 4.4 but the change can lead to differences in the structure
+ layout. See the documentation of `-Wpacked-bitfield-compat' for
+ more information.
+
+`section ("SECTION-NAME")'
+ Normally, the compiler places the objects it generates in sections
+ like `data' and `bss'. Sometimes, however, you need additional
+ sections, or you need certain particular variables to appear in
+ special sections, for example to map to special hardware. The
+ `section' attribute specifies that a variable (or function) lives
+ in a particular section. For example, this small program uses
+ several specific section names:
+
+ struct duart a __attribute__ ((section ("DUART_A"))) = { 0 };
+ struct duart b __attribute__ ((section ("DUART_B"))) = { 0 };
+ char stack[10000] __attribute__ ((section ("STACK"))) = { 0 };
+ int init_data __attribute__ ((section ("INITDATA")));
+
+ main()
+ {
+ /* Initialize stack pointer */
+ init_sp (stack + sizeof (stack));
+
+ /* Initialize initialized data */
+ memcpy (&init_data, &data, &edata - &data);
+
+ /* Turn on the serial ports */
+ init_duart (&a);
+ init_duart (&b);
+ }
+
+ Use the `section' attribute with _global_ variables and not
+ _local_ variables, as shown in the example.
+
+ You may use the `section' attribute with initialized or
+ uninitialized global variables but the linker requires each object
+ be defined once, with the exception that uninitialized variables
+ tentatively go in the `common' (or `bss') section and can be
+ multiply "defined". Using the `section' attribute will change
+ what section the variable goes into and may cause the linker to
+ issue an error if an uninitialized variable has multiple
+ definitions. You can force a variable to be initialized with the
+ `-fno-common' flag or the `nocommon' attribute.
+
+ Some file formats do not support arbitrary sections so the
+ `section' attribute is not available on all platforms. If you
+ need to map the entire contents of a module to a particular
+ section, consider using the facilities of the linker instead.
+
+`shared'
+ On Microsoft Windows, in addition to putting variable definitions
+ in a named section, the section can also be shared among all
+ running copies of an executable or DLL. For example, this small
+ program defines shared data by putting it in a named section
+ `shared' and marking the section shareable:
+
+ int foo __attribute__((section ("shared"), shared)) = 0;
+
+ int
+ main()
+ {
+ /* Read and write foo. All running
+ copies see the same value. */
+ return 0;
+ }
+
+ You may only use the `shared' attribute along with `section'
+ attribute with a fully initialized global definition because of
+ the way linkers work. See `section' attribute for more
+ information.
+
+ The `shared' attribute is only available on Microsoft Windows.
+
+`tls_model ("TLS_MODEL")'
+ The `tls_model' attribute sets thread-local storage model (*note
+ Thread-Local::) of a particular `__thread' variable, overriding
+ `-ftls-model=' command line switch on a per-variable basis. The
+ TLS_MODEL argument should be one of `global-dynamic',
+ `local-dynamic', `initial-exec' or `local-exec'.
+
+ Not all targets support this attribute.
+
+`unused'
+ This attribute, attached to a variable, means that the variable is
+ meant to be possibly unused. GCC will not produce a warning for
+ this variable.
+
+`used'
+ This attribute, attached to a variable, means that the variable
+ must be emitted even if it appears that the variable is not
+ referenced.
+
+`vector_size (BYTES)'
+ This attribute specifies the vector size for the variable,
+ measured in bytes. For example, the declaration:
+
+ int foo __attribute__ ((vector_size (16)));
+
+ causes the compiler to set the mode for `foo', to be 16 bytes,
+ divided into `int' sized units. Assuming a 32-bit int (a vector of
+ 4 units of 4 bytes), the corresponding mode of `foo' will be V4SI.
+
+ This attribute is only applicable to integral and float scalars,
+ although arrays, pointers, and function return values are allowed
+ in conjunction with this construct.
+
+ Aggregates with this attribute are invalid, even if they are of
+ the same size as a corresponding scalar. For example, the
+ declaration:
+
+ struct S { int a; };
+ struct S __attribute__ ((vector_size (16))) foo;
+
+ is invalid even if the size of the structure is the same as the
+ size of the `int'.
+
+`selectany'
+ The `selectany' attribute causes an initialized global variable to
+ have link-once semantics. When multiple definitions of the
+ variable are encountered by the linker, the first is selected and
+ the remainder are discarded. Following usage by the Microsoft
+ compiler, the linker is told _not_ to warn about size or content
+ differences of the multiple definitions.
+
+ Although the primary usage of this attribute is for POD types, the
+ attribute can also be applied to global C++ objects that are
+ initialized by a constructor. In this case, the static
+ initialization and destruction code for the object is emitted in
+ each translation defining the object, but the calls to the
+ constructor and destructor are protected by a link-once guard
+ variable.
+
+ The `selectany' attribute is only available on Microsoft Windows
+ targets. You can use `__declspec (selectany)' as a synonym for
+ `__attribute__ ((selectany))' for compatibility with other
+ compilers.
+
+`weak'
+ The `weak' attribute is described in *Note Function Attributes::.
+
+`dllimport'
+ The `dllimport' attribute is described in *Note Function
+ Attributes::.
+
+`dllexport'
+ The `dllexport' attribute is described in *Note Function
+ Attributes::.
+
+
+5.34.1 Blackfin Variable Attributes
+-----------------------------------
+
+Three attributes are currently defined for the Blackfin.
+
+`l1_data'
+
+`l1_data_A'
+
+`l1_data_B'
+ Use these attributes on the Blackfin to place the variable into L1
+ Data SRAM. Variables with `l1_data' attribute will be put into
+ the specific section named `.l1.data'. Those with `l1_data_A'
+ attribute will be put into the specific section named
+ `.l1.data.A'. Those with `l1_data_B' attribute will be put into
+ the specific section named `.l1.data.B'.
+
+5.34.2 M32R/D Variable Attributes
+---------------------------------
+
+One attribute is currently defined for the M32R/D.
+
+`model (MODEL-NAME)'
+ Use this attribute on the M32R/D to set the addressability of an
+ object. The identifier MODEL-NAME is one of `small', `medium', or
+ `large', representing each of the code models.
+
+ Small model objects live in the lower 16MB of memory (so that their
+ addresses can be loaded with the `ld24' instruction).
+
+ Medium and large model objects may live anywhere in the 32-bit
+ address space (the compiler will generate `seth/add3' instructions
+ to load their addresses).
+
+5.34.3 i386 Variable Attributes
+-------------------------------
+
+Two attributes are currently defined for i386 configurations:
+`ms_struct' and `gcc_struct'
+
+`ms_struct'
+`gcc_struct'
+ If `packed' is used on a structure, or if bit-fields are used it
+ may be that the Microsoft ABI packs them differently than GCC
+ would normally pack them. Particularly when moving packed data
+ between functions compiled with GCC and the native Microsoft
+ compiler (either via function call or as data in a file), it may
+ be necessary to access either format.
+
+ Currently `-m[no-]ms-bitfields' is provided for the Microsoft
+ Windows X86 compilers to match the native Microsoft compiler.
+
+ The Microsoft structure layout algorithm is fairly simple with the
+ exception of the bitfield packing:
+
+ The padding and alignment of members of structures and whether a
+ bit field can straddle a storage-unit boundary
+
+ 1. Structure members are stored sequentially in the order in
+ which they are declared: the first member has the lowest
+ memory address and the last member the highest.
+
+ 2. Every data object has an alignment-requirement. The
+ alignment-requirement for all data except structures, unions,
+ and arrays is either the size of the object or the current
+ packing size (specified with either the aligned attribute or
+ the pack pragma), whichever is less. For structures, unions,
+ and arrays, the alignment-requirement is the largest
+ alignment-requirement of its members. Every object is
+ allocated an offset so that:
+
+ offset % alignment-requirement == 0
+
+ 3. Adjacent bit fields are packed into the same 1-, 2-, or
+ 4-byte allocation unit if the integral types are the same
+ size and if the next bit field fits into the current
+ allocation unit without crossing the boundary imposed by the
+ common alignment requirements of the bit fields.
+
+ Handling of zero-length bitfields:
+
+ MSVC interprets zero-length bitfields in the following ways:
+
+ 1. If a zero-length bitfield is inserted between two bitfields
+ that would normally be coalesced, the bitfields will not be
+ coalesced.
+
+ For example:
+
+ struct
+ {
+ unsigned long bf_1 : 12;
+ unsigned long : 0;
+ unsigned long bf_2 : 12;
+ } t1;
+
+ The size of `t1' would be 8 bytes with the zero-length
+ bitfield. If the zero-length bitfield were removed, `t1''s
+ size would be 4 bytes.
+
+ 2. If a zero-length bitfield is inserted after a bitfield,
+ `foo', and the alignment of the zero-length bitfield is
+ greater than the member that follows it, `bar', `bar' will be
+ aligned as the type of the zero-length bitfield.
+
+ For example:
+
+ struct
+ {
+ char foo : 4;
+ short : 0;
+ char bar;
+ } t2;
+
+ struct
+ {
+ char foo : 4;
+ short : 0;
+ double bar;
+ } t3;
+
+ For `t2', `bar' will be placed at offset 2, rather than
+ offset 1. Accordingly, the size of `t2' will be 4. For
+ `t3', the zero-length bitfield will not affect the alignment
+ of `bar' or, as a result, the size of the structure.
+
+ Taking this into account, it is important to note the
+ following:
+
+ 1. If a zero-length bitfield follows a normal bitfield, the
+ type of the zero-length bitfield may affect the
+ alignment of the structure as whole. For example, `t2'
+ has a size of 4 bytes, since the zero-length bitfield
+ follows a normal bitfield, and is of type short.
+
+ 2. Even if a zero-length bitfield is not followed by a
+ normal bitfield, it may still affect the alignment of
+ the structure:
+
+ struct
+ {
+ char foo : 6;
+ long : 0;
+ } t4;
+
+ Here, `t4' will take up 4 bytes.
+
+ 3. Zero-length bitfields following non-bitfield members are
+ ignored:
+
+ struct
+ {
+ char foo;
+ long : 0;
+ char bar;
+ } t5;
+
+ Here, `t5' will take up 2 bytes.
+
+5.34.4 PowerPC Variable Attributes
+----------------------------------
+
+Three attributes currently are defined for PowerPC configurations:
+`altivec', `ms_struct' and `gcc_struct'.
+
+ For full documentation of the struct attributes please see the
+documentation in *Note i386 Variable Attributes::.
+
+ For documentation of `altivec' attribute please see the documentation
+in *Note PowerPC Type Attributes::.
+
+5.34.5 SPU Variable Attributes
+------------------------------
+
+The SPU supports the `spu_vector' attribute for variables. For
+documentation of this attribute please see the documentation in *Note
+SPU Type Attributes::.
+
+5.34.6 Xstormy16 Variable Attributes
+------------------------------------
+
+One attribute is currently defined for xstormy16 configurations:
+`below100'.
+
+`below100'
+ If a variable has the `below100' attribute (`BELOW100' is allowed
+ also), GCC will place the variable in the first 0x100 bytes of
+ memory and use special opcodes to access it. Such variables will
+ be placed in either the `.bss_below100' section or the
+ `.data_below100' section.
+
+
+5.34.7 AVR Variable Attributes
+------------------------------
+
+`progmem'
+ The `progmem' attribute is used on the AVR to place data in the
+ Program Memory address space. The AVR is a Harvard Architecture
+ processor and data normally resides in the Data Memory address
+ space.
+
+
+File: gcc.info, Node: Type Attributes, Next: Alignment, Prev: Variable Attributes, Up: C Extensions
+
+5.35 Specifying Attributes of Types
+===================================
+
+The keyword `__attribute__' allows you to specify special attributes of
+`struct' and `union' types when you define such types. This keyword is
+followed by an attribute specification inside double parentheses.
+Seven attributes are currently defined for types: `aligned', `packed',
+`transparent_union', `unused', `deprecated', `visibility', and
+`may_alias'. Other attributes are defined for functions (*note
+Function Attributes::) and for variables (*note Variable Attributes::).
+
+ You may also specify any one of these attributes with `__' preceding
+and following its keyword. This allows you to use these attributes in
+header files without being concerned about a possible macro of the same
+name. For example, you may use `__aligned__' instead of `aligned'.
+
+ You may specify type attributes in an enum, struct or union type
+declaration or definition, or for other types in a `typedef'
+declaration.
+
+ For an enum, struct or union type, you may specify attributes either
+between the enum, struct or union tag and the name of the type, or just
+past the closing curly brace of the _definition_. The former syntax is
+preferred.
+
+ *Note Attribute Syntax::, for details of the exact syntax for using
+attributes.
+
+`aligned (ALIGNMENT)'
+ This attribute specifies a minimum alignment (in bytes) for
+ variables of the specified type. For example, the declarations:
+
+ struct S { short f[3]; } __attribute__ ((aligned (8)));
+ typedef int more_aligned_int __attribute__ ((aligned (8)));
+
+ force the compiler to insure (as far as it can) that each variable
+ whose type is `struct S' or `more_aligned_int' will be allocated
+ and aligned _at least_ on a 8-byte boundary. On a SPARC, having
+ all variables of type `struct S' aligned to 8-byte boundaries
+ allows the compiler to use the `ldd' and `std' (doubleword load and
+ store) instructions when copying one variable of type `struct S' to
+ another, thus improving run-time efficiency.
+
+ Note that the alignment of any given `struct' or `union' type is
+ required by the ISO C standard to be at least a perfect multiple of
+ the lowest common multiple of the alignments of all of the members
+ of the `struct' or `union' in question. This means that you _can_
+ effectively adjust the alignment of a `struct' or `union' type by
+ attaching an `aligned' attribute to any one of the members of such
+ a type, but the notation illustrated in the example above is a
+ more obvious, intuitive, and readable way to request the compiler
+ to adjust the alignment of an entire `struct' or `union' type.
+
+ As in the preceding example, you can explicitly specify the
+ alignment (in bytes) that you wish the compiler to use for a given
+ `struct' or `union' type. Alternatively, you can leave out the
+ alignment factor and just ask the compiler to align a type to the
+ maximum useful alignment for the target machine you are compiling
+ for. For example, you could write:
+
+ struct S { short f[3]; } __attribute__ ((aligned));
+
+ Whenever you leave out the alignment factor in an `aligned'
+ attribute specification, the compiler automatically sets the
+ alignment for the type to the largest alignment which is ever used
+ for any data type on the target machine you are compiling for.
+ Doing this can often make copy operations more efficient, because
+ the compiler can use whatever instructions copy the biggest chunks
+ of memory when performing copies to or from the variables which
+ have types that you have aligned this way.
+
+ In the example above, if the size of each `short' is 2 bytes, then
+ the size of the entire `struct S' type is 6 bytes. The smallest
+ power of two which is greater than or equal to that is 8, so the
+ compiler sets the alignment for the entire `struct S' type to 8
+ bytes.
+
+ Note that although you can ask the compiler to select a
+ time-efficient alignment for a given type and then declare only
+ individual stand-alone objects of that type, the compiler's
+ ability to select a time-efficient alignment is primarily useful
+ only when you plan to create arrays of variables having the
+ relevant (efficiently aligned) type. If you declare or use arrays
+ of variables of an efficiently-aligned type, then it is likely
+ that your program will also be doing pointer arithmetic (or
+ subscripting, which amounts to the same thing) on pointers to the
+ relevant type, and the code that the compiler generates for these
+ pointer arithmetic operations will often be more efficient for
+ efficiently-aligned types than for other types.
+
+ The `aligned' attribute can only increase the alignment; but you
+ can decrease it by specifying `packed' as well. See below.
+
+ Note that the effectiveness of `aligned' attributes may be limited
+ by inherent limitations in your linker. On many systems, the
+ linker is only able to arrange for variables to be aligned up to a
+ certain maximum alignment. (For some linkers, the maximum
+ supported alignment may be very very small.) If your linker is
+ only able to align variables up to a maximum of 8 byte alignment,
+ then specifying `aligned(16)' in an `__attribute__' will still
+ only provide you with 8 byte alignment. See your linker
+ documentation for further information.
+
+`packed'
+ This attribute, attached to `struct' or `union' type definition,
+ specifies that each member (other than zero-width bitfields) of
+ the structure or union is placed to minimize the memory required.
+ When attached to an `enum' definition, it indicates that the
+ smallest integral type should be used.
+
+ Specifying this attribute for `struct' and `union' types is
+ equivalent to specifying the `packed' attribute on each of the
+ structure or union members. Specifying the `-fshort-enums' flag
+ on the line is equivalent to specifying the `packed' attribute on
+ all `enum' definitions.
+
+ In the following example `struct my_packed_struct''s members are
+ packed closely together, but the internal layout of its `s' member
+ is not packed--to do that, `struct my_unpacked_struct' would need
+ to be packed too.
+
+ struct my_unpacked_struct
+ {
+ char c;
+ int i;
+ };
+
+ struct __attribute__ ((__packed__)) my_packed_struct
+ {
+ char c;
+ int i;
+ struct my_unpacked_struct s;
+ };
+
+ You may only specify this attribute on the definition of a `enum',
+ `struct' or `union', not on a `typedef' which does not also define
+ the enumerated type, structure or union.
+
+`transparent_union'
+ This attribute, attached to a `union' type definition, indicates
+ that any function parameter having that union type causes calls to
+ that function to be treated in a special way.
+
+ First, the argument corresponding to a transparent union type can
+ be of any type in the union; no cast is required. Also, if the
+ union contains a pointer type, the corresponding argument can be a
+ null pointer constant or a void pointer expression; and if the
+ union contains a void pointer type, the corresponding argument can
+ be any pointer expression. If the union member type is a pointer,
+ qualifiers like `const' on the referenced type must be respected,
+ just as with normal pointer conversions.
+
+ Second, the argument is passed to the function using the calling
+ conventions of the first member of the transparent union, not the
+ calling conventions of the union itself. All members of the union
+ must have the same machine representation; this is necessary for
+ this argument passing to work properly.
+
+ Transparent unions are designed for library functions that have
+ multiple interfaces for compatibility reasons. For example,
+ suppose the `wait' function must accept either a value of type
+ `int *' to comply with Posix, or a value of type `union wait *' to
+ comply with the 4.1BSD interface. If `wait''s parameter were
+ `void *', `wait' would accept both kinds of arguments, but it
+ would also accept any other pointer type and this would make
+ argument type checking less useful. Instead, `<sys/wait.h>' might
+ define the interface as follows:
+
+ typedef union __attribute__ ((__transparent_union__))
+ {
+ int *__ip;
+ union wait *__up;
+ } wait_status_ptr_t;
+
+ pid_t wait (wait_status_ptr_t);
+
+ This interface allows either `int *' or `union wait *' arguments
+ to be passed, using the `int *' calling convention. The program
+ can call `wait' with arguments of either type:
+
+ int w1 () { int w; return wait (&w); }
+ int w2 () { union wait w; return wait (&w); }
+
+ With this interface, `wait''s implementation might look like this:
+
+ pid_t wait (wait_status_ptr_t p)
+ {
+ return waitpid (-1, p.__ip, 0);
+ }
+
+`unused'
+ When attached to a type (including a `union' or a `struct'), this
+ attribute means that variables of that type are meant to appear
+ possibly unused. GCC will not produce a warning for any variables
+ of that type, even if the variable appears to do nothing. This is
+ often the case with lock or thread classes, which are usually
+ defined and then not referenced, but contain constructors and
+ destructors that have nontrivial bookkeeping functions.
+
+`deprecated'
+ The `deprecated' attribute results in a warning if the type is
+ used anywhere in the source file. This is useful when identifying
+ types that are expected to be removed in a future version of a
+ program. If possible, the warning also includes the location of
+ the declaration of the deprecated type, to enable users to easily
+ find further information about why the type is deprecated, or what
+ they should do instead. Note that the warnings only occur for
+ uses and then only if the type is being applied to an identifier
+ that itself is not being declared as deprecated.
+
+ typedef int T1 __attribute__ ((deprecated));
+ T1 x;
+ typedef T1 T2;
+ T2 y;
+ typedef T1 T3 __attribute__ ((deprecated));
+ T3 z __attribute__ ((deprecated));
+
+ results in a warning on line 2 and 3 but not lines 4, 5, or 6. No
+ warning is issued for line 4 because T2 is not explicitly
+ deprecated. Line 5 has no warning because T3 is explicitly
+ deprecated. Similarly for line 6.
+
+ The `deprecated' attribute can also be used for functions and
+ variables (*note Function Attributes::, *note Variable
+ Attributes::.)
+
+`may_alias'
+ Accesses through pointers to types with this attribute are not
+ subject to type-based alias analysis, but are instead assumed to
+ be able to alias any other type of objects. In the context of
+ 6.5/7 an lvalue expression dereferencing such a pointer is treated
+ like having a character type. See `-fstrict-aliasing' for more
+ information on aliasing issues. This extension exists to support
+ some vector APIs, in which pointers to one vector type are
+ permitted to alias pointers to a different vector type.
+
+ Note that an object of a type with this attribute does not have any
+ special semantics.
+
+ Example of use:
+
+ typedef short __attribute__((__may_alias__)) short_a;
+
+ int
+ main (void)
+ {
+ int a = 0x12345678;
+ short_a *b = (short_a *) &a;
+
+ b[1] = 0;
+
+ if (a == 0x12345678)
+ abort();
+
+ exit(0);
+ }
+
+ If you replaced `short_a' with `short' in the variable
+ declaration, the above program would abort when compiled with
+ `-fstrict-aliasing', which is on by default at `-O2' or above in
+ recent GCC versions.
+
+`visibility'
+ In C++, attribute visibility (*note Function Attributes::) can
+ also be applied to class, struct, union and enum types. Unlike
+ other type attributes, the attribute must appear between the
+ initial keyword and the name of the type; it cannot appear after
+ the body of the type.
+
+ Note that the type visibility is applied to vague linkage entities
+ associated with the class (vtable, typeinfo node, etc.). In
+ particular, if a class is thrown as an exception in one shared
+ object and caught in another, the class must have default
+ visibility. Otherwise the two shared objects will be unable to
+ use the same typeinfo node and exception handling will break.
+
+
+5.35.1 ARM Type Attributes
+--------------------------
+
+On those ARM targets that support `dllimport' (such as Symbian OS), you
+can use the `notshared' attribute to indicate that the virtual table
+and other similar data for a class should not be exported from a DLL.
+For example:
+
+ class __declspec(notshared) C {
+ public:
+ __declspec(dllimport) C();
+ virtual void f();
+ }
+
+ __declspec(dllexport)
+ C::C() {}
+
+ In this code, `C::C' is exported from the current DLL, but the virtual
+table for `C' is not exported. (You can use `__attribute__' instead of
+`__declspec' if you prefer, but most Symbian OS code uses `__declspec'.)
+
+5.35.2 i386 Type Attributes
+---------------------------
+
+Two attributes are currently defined for i386 configurations:
+`ms_struct' and `gcc_struct'.
+
+`ms_struct'
+`gcc_struct'
+ If `packed' is used on a structure, or if bit-fields are used it
+ may be that the Microsoft ABI packs them differently than GCC
+ would normally pack them. Particularly when moving packed data
+ between functions compiled with GCC and the native Microsoft
+ compiler (either via function call or as data in a file), it may
+ be necessary to access either format.
+
+ Currently `-m[no-]ms-bitfields' is provided for the Microsoft
+ Windows X86 compilers to match the native Microsoft compiler.
+
+ To specify multiple attributes, separate them by commas within the
+double parentheses: for example, `__attribute__ ((aligned (16),
+packed))'.
+
+5.35.3 PowerPC Type Attributes
+------------------------------
+
+Three attributes currently are defined for PowerPC configurations:
+`altivec', `ms_struct' and `gcc_struct'.
+
+ For full documentation of the `ms_struct' and `gcc_struct' attributes
+please see the documentation in *Note i386 Type Attributes::.
+
+ The `altivec' attribute allows one to declare AltiVec vector data
+types supported by the AltiVec Programming Interface Manual. The
+attribute requires an argument to specify one of three vector types:
+`vector__', `pixel__' (always followed by unsigned short), and `bool__'
+(always followed by unsigned).
+
+ __attribute__((altivec(vector__)))
+ __attribute__((altivec(pixel__))) unsigned short
+ __attribute__((altivec(bool__))) unsigned
+
+ These attributes mainly are intended to support the `__vector',
+`__pixel', and `__bool' AltiVec keywords.
+
+5.35.4 SPU Type Attributes
+--------------------------
+
+The SPU supports the `spu_vector' attribute for types. This attribute
+allows one to declare vector data types supported by the
+Sony/Toshiba/IBM SPU Language Extensions Specification. It is intended
+to support the `__vector' keyword.
+
+
+File: gcc.info, Node: Inline, Next: Extended Asm, Prev: Alignment, Up: C Extensions
+
+5.36 An Inline Function is As Fast As a Macro
+=============================================
+
+By declaring a function inline, you can direct GCC to make calls to
+that function faster. One way GCC can achieve this is to integrate
+that function's code into the code for its callers. This makes
+execution faster by eliminating the function-call overhead; in
+addition, if any of the actual argument values are constant, their
+known values may permit simplifications at compile time so that not all
+of the inline function's code needs to be included. The effect on code
+size is less predictable; object code may be larger or smaller with
+function inlining, depending on the particular case. You can also
+direct GCC to try to integrate all "simple enough" functions into their
+callers with the option `-finline-functions'.
+
+ GCC implements three different semantics of declaring a function
+inline. One is available with `-std=gnu89' or `-fgnu89-inline' or when
+`gnu_inline' attribute is present on all inline declarations, another
+when `-std=c99' or `-std=gnu99' (without `-fgnu89-inline'), and the
+third is used when compiling C++.
+
+ To declare a function inline, use the `inline' keyword in its
+declaration, like this:
+
+ static inline int
+ inc (int *a)
+ {
+ (*a)++;
+ }
+
+ If you are writing a header file to be included in ISO C89 programs,
+write `__inline__' instead of `inline'. *Note Alternate Keywords::.
+
+ The three types of inlining behave similarly in two important cases:
+when the `inline' keyword is used on a `static' function, like the
+example above, and when a function is first declared without using the
+`inline' keyword and then is defined with `inline', like this:
+
+ extern int inc (int *a);
+ inline int
+ inc (int *a)
+ {
+ (*a)++;
+ }
+
+ In both of these common cases, the program behaves the same as if you
+had not used the `inline' keyword, except for its speed.
+
+ When a function is both inline and `static', if all calls to the
+function are integrated into the caller, and the function's address is
+never used, then the function's own assembler code is never referenced.
+In this case, GCC does not actually output assembler code for the
+function, unless you specify the option `-fkeep-inline-functions'.
+Some calls cannot be integrated for various reasons (in particular,
+calls that precede the function's definition cannot be integrated, and
+neither can recursive calls within the definition). If there is a
+nonintegrated call, then the function is compiled to assembler code as
+usual. The function must also be compiled as usual if the program
+refers to its address, because that can't be inlined.
+
+ Note that certain usages in a function definition can make it
+unsuitable for inline substitution. Among these usages are: use of
+varargs, use of alloca, use of variable sized data types (*note
+Variable Length::), use of computed goto (*note Labels as Values::),
+use of nonlocal goto, and nested functions (*note Nested Functions::).
+Using `-Winline' will warn when a function marked `inline' could not be
+substituted, and will give the reason for the failure.
+
+ As required by ISO C++, GCC considers member functions defined within
+the body of a class to be marked inline even if they are not explicitly
+declared with the `inline' keyword. You can override this with
+`-fno-default-inline'; *note Options Controlling C++ Dialect: C++
+Dialect Options.
+
+ GCC does not inline any functions when not optimizing unless you
+specify the `always_inline' attribute for the function, like this:
+
+ /* Prototype. */
+ inline void foo (const char) __attribute__((always_inline));
+
+ The remainder of this section is specific to GNU C89 inlining.
+
+ When an inline function is not `static', then the compiler must assume
+that there may be calls from other source files; since a global symbol
+can be defined only once in any program, the function must not be
+defined in the other source files, so the calls therein cannot be
+integrated. Therefore, a non-`static' inline function is always
+compiled on its own in the usual fashion.
+
+ If you specify both `inline' and `extern' in the function definition,
+then the definition is used only for inlining. In no case is the
+function compiled on its own, not even if you refer to its address
+explicitly. Such an address becomes an external reference, as if you
+had only declared the function, and had not defined it.
+
+ This combination of `inline' and `extern' has almost the effect of a
+macro. The way to use it is to put a function definition in a header
+file with these keywords, and put another copy of the definition
+(lacking `inline' and `extern') in a library file. The definition in
+the header file will cause most calls to the function to be inlined.
+If any uses of the function remain, they will refer to the single copy
+in the library.
+
+
+File: gcc.info, Node: Extended Asm, Next: Constraints, Prev: Inline, Up: C Extensions
+
+5.37 Assembler Instructions with C Expression Operands
+======================================================
+
+In an assembler instruction using `asm', you can specify the operands
+of the instruction using C expressions. This means you need not guess
+which registers or memory locations will contain the data you want to
+use.
+
+ You must specify an assembler instruction template much like what
+appears in a machine description, plus an operand constraint string for
+each operand.
+
+ For example, here is how to use the 68881's `fsinx' instruction:
+
+ asm ("fsinx %1,%0" : "=f" (result) : "f" (angle));
+
+Here `angle' is the C expression for the input operand while `result'
+is that of the output operand. Each has `"f"' as its operand
+constraint, saying that a floating point register is required. The `='
+in `=f' indicates that the operand is an output; all output operands'
+constraints must use `='. The constraints use the same language used
+in the machine description (*note Constraints::).
+
+ Each operand is described by an operand-constraint string followed by
+the C expression in parentheses. A colon separates the assembler
+template from the first output operand and another separates the last
+output operand from the first input, if any. Commas separate the
+operands within each group. The total number of operands is currently
+limited to 30; this limitation may be lifted in some future version of
+GCC.
+
+ If there are no output operands but there are input operands, you must
+place two consecutive colons surrounding the place where the output
+operands would go.
+
+ As of GCC version 3.1, it is also possible to specify input and output
+operands using symbolic names which can be referenced within the
+assembler code. These names are specified inside square brackets
+preceding the constraint string, and can be referenced inside the
+assembler code using `%[NAME]' instead of a percentage sign followed by
+the operand number. Using named operands the above example could look
+like:
+
+ asm ("fsinx %[angle],%[output]"
+ : [output] "=f" (result)
+ : [angle] "f" (angle));
+
+Note that the symbolic operand names have no relation whatsoever to
+other C identifiers. You may use any name you like, even those of
+existing C symbols, but you must ensure that no two operands within the
+same assembler construct use the same symbolic name.
+
+ Output operand expressions must be lvalues; the compiler can check
+this. The input operands need not be lvalues. The compiler cannot
+check whether the operands have data types that are reasonable for the
+instruction being executed. It does not parse the assembler instruction
+template and does not know what it means or even whether it is valid
+assembler input. The extended `asm' feature is most often used for
+machine instructions the compiler itself does not know exist. If the
+output expression cannot be directly addressed (for example, it is a
+bit-field), your constraint must allow a register. In that case, GCC
+will use the register as the output of the `asm', and then store that
+register into the output.
+
+ The ordinary output operands must be write-only; GCC will assume that
+the values in these operands before the instruction are dead and need
+not be generated. Extended asm supports input-output or read-write
+operands. Use the constraint character `+' to indicate such an operand
+and list it with the output operands. You should only use read-write
+operands when the constraints for the operand (or the operand in which
+only some of the bits are to be changed) allow a register.
+
+ You may, as an alternative, logically split its function into two
+separate operands, one input operand and one write-only output operand.
+The connection between them is expressed by constraints which say they
+need to be in the same location when the instruction executes. You can
+use the same C expression for both operands, or different expressions.
+For example, here we write the (fictitious) `combine' instruction with
+`bar' as its read-only source operand and `foo' as its read-write
+destination:
+
+ asm ("combine %2,%0" : "=r" (foo) : "0" (foo), "g" (bar));
+
+The constraint `"0"' for operand 1 says that it must occupy the same
+location as operand 0. A number in constraint is allowed only in an
+input operand and it must refer to an output operand.
+
+ Only a number in the constraint can guarantee that one operand will be
+in the same place as another. The mere fact that `foo' is the value of
+both operands is not enough to guarantee that they will be in the same
+place in the generated assembler code. The following would not work
+reliably:
+
+ asm ("combine %2,%0" : "=r" (foo) : "r" (foo), "g" (bar));
+
+ Various optimizations or reloading could cause operands 0 and 1 to be
+in different registers; GCC knows no reason not to do so. For example,
+the compiler might find a copy of the value of `foo' in one register and
+use it for operand 1, but generate the output operand 0 in a different
+register (copying it afterward to `foo''s own address). Of course,
+since the register for operand 1 is not even mentioned in the assembler
+code, the result will not work, but GCC can't tell that.
+
+ As of GCC version 3.1, one may write `[NAME]' instead of the operand
+number for a matching constraint. For example:
+
+ asm ("cmoveq %1,%2,%[result]"
+ : [result] "=r"(result)
+ : "r" (test), "r"(new), "[result]"(old));
+
+ Sometimes you need to make an `asm' operand be a specific register,
+but there's no matching constraint letter for that register _by
+itself_. To force the operand into that register, use a local variable
+for the operand and specify the register in the variable declaration.
+*Note Explicit Reg Vars::. Then for the `asm' operand, use any
+register constraint letter that matches the register:
+
+ register int *p1 asm ("r0") = ...;
+ register int *p2 asm ("r1") = ...;
+ register int *result asm ("r0");
+ asm ("sysint" : "=r" (result) : "0" (p1), "r" (p2));
+
+ In the above example, beware that a register that is call-clobbered by
+the target ABI will be overwritten by any function call in the
+assignment, including library calls for arithmetic operators. Also a
+register may be clobbered when generating some operations, like
+variable shift, memory copy or memory move on x86. Assuming it is a
+call-clobbered register, this may happen to `r0' above by the
+assignment to `p2'. If you have to use such a register, use temporary
+variables for expressions between the register assignment and use:
+
+ int t1 = ...;
+ register int *p1 asm ("r0") = ...;
+ register int *p2 asm ("r1") = t1;
+ register int *result asm ("r0");
+ asm ("sysint" : "=r" (result) : "0" (p1), "r" (p2));
+
+ Some instructions clobber specific hard registers. To describe this,
+write a third colon after the input operands, followed by the names of
+the clobbered hard registers (given as strings). Here is a realistic
+example for the VAX:
+
+ asm volatile ("movc3 %0,%1,%2"
+ : /* no outputs */
+ : "g" (from), "g" (to), "g" (count)
+ : "r0", "r1", "r2", "r3", "r4", "r5");
+
+ You may not write a clobber description in a way that overlaps with an
+input or output operand. For example, you may not have an operand
+describing a register class with one member if you mention that register
+in the clobber list. Variables declared to live in specific registers
+(*note Explicit Reg Vars::), and used as asm input or output operands
+must have no part mentioned in the clobber description. There is no
+way for you to specify that an input operand is modified without also
+specifying it as an output operand. Note that if all the output
+operands you specify are for this purpose (and hence unused), you will
+then also need to specify `volatile' for the `asm' construct, as
+described below, to prevent GCC from deleting the `asm' statement as
+unused.
+
+ If you refer to a particular hardware register from the assembler code,
+you will probably have to list the register after the third colon to
+tell the compiler the register's value is modified. In some assemblers,
+the register names begin with `%'; to produce one `%' in the assembler
+code, you must write `%%' in the input.
+
+ If your assembler instruction can alter the condition code register,
+add `cc' to the list of clobbered registers. GCC on some machines
+represents the condition codes as a specific hardware register; `cc'
+serves to name this register. On other machines, the condition code is
+handled differently, and specifying `cc' has no effect. But it is
+valid no matter what the machine.
+
+ If your assembler instructions access memory in an unpredictable
+fashion, add `memory' to the list of clobbered registers. This will
+cause GCC to not keep memory values cached in registers across the
+assembler instruction and not optimize stores or loads to that memory.
+You will also want to add the `volatile' keyword if the memory affected
+is not listed in the inputs or outputs of the `asm', as the `memory'
+clobber does not count as a side-effect of the `asm'. If you know how
+large the accessed memory is, you can add it as input or output but if
+this is not known, you should add `memory'. As an example, if you
+access ten bytes of a string, you can use a memory input like:
+
+ {"m"( ({ struct { char x[10]; } *p = (void *)ptr ; *p; }) )}.
+
+ Note that in the following example the memory input is necessary,
+otherwise GCC might optimize the store to `x' away:
+ int foo ()
+ {
+ int x = 42;
+ int *y = &x;
+ int result;
+ asm ("magic stuff accessing an 'int' pointed to by '%1'"
+ "=&d" (r) : "a" (y), "m" (*y));
+ return result;
+ }
+
+ You can put multiple assembler instructions together in a single `asm'
+template, separated by the characters normally used in assembly code
+for the system. A combination that works in most places is a newline
+to break the line, plus a tab character to move to the instruction field
+(written as `\n\t'). Sometimes semicolons can be used, if the
+assembler allows semicolons as a line-breaking character. Note that
+some assembler dialects use semicolons to start a comment. The input
+operands are guaranteed not to use any of the clobbered registers, and
+neither will the output operands' addresses, so you can read and write
+the clobbered registers as many times as you like. Here is an example
+of multiple instructions in a template; it assumes the subroutine
+`_foo' accepts arguments in registers 9 and 10:
+
+ asm ("movl %0,r9\n\tmovl %1,r10\n\tcall _foo"
+ : /* no outputs */
+ : "g" (from), "g" (to)
+ : "r9", "r10");
+
+ Unless an output operand has the `&' constraint modifier, GCC may
+allocate it in the same register as an unrelated input operand, on the
+assumption the inputs are consumed before the outputs are produced.
+This assumption may be false if the assembler code actually consists of
+more than one instruction. In such a case, use `&' for each output
+operand that may not overlap an input. *Note Modifiers::.
+
+ If you want to test the condition code produced by an assembler
+instruction, you must include a branch and a label in the `asm'
+construct, as follows:
+
+ asm ("clr %0\n\tfrob %1\n\tbeq 0f\n\tmov #1,%0\n0:"
+ : "g" (result)
+ : "g" (input));
+
+This assumes your assembler supports local labels, as the GNU assembler
+and most Unix assemblers do.
+
+ Speaking of labels, jumps from one `asm' to another are not supported.
+The compiler's optimizers do not know about these jumps, and therefore
+they cannot take account of them when deciding how to optimize.
+
+ Usually the most convenient way to use these `asm' instructions is to
+encapsulate them in macros that look like functions. For example,
+
+ #define sin(x) \
+ ({ double __value, __arg = (x); \
+ asm ("fsinx %1,%0": "=f" (__value): "f" (__arg)); \
+ __value; })
+
+Here the variable `__arg' is used to make sure that the instruction
+operates on a proper `double' value, and to accept only those arguments
+`x' which can convert automatically to a `double'.
+
+ Another way to make sure the instruction operates on the correct data
+type is to use a cast in the `asm'. This is different from using a
+variable `__arg' in that it converts more different types. For
+example, if the desired type were `int', casting the argument to `int'
+would accept a pointer with no complaint, while assigning the argument
+to an `int' variable named `__arg' would warn about using a pointer
+unless the caller explicitly casts it.
+
+ If an `asm' has output operands, GCC assumes for optimization purposes
+the instruction has no side effects except to change the output
+operands. This does not mean instructions with a side effect cannot be
+used, but you must be careful, because the compiler may eliminate them
+if the output operands aren't used, or move them out of loops, or
+replace two with one if they constitute a common subexpression. Also,
+if your instruction does have a side effect on a variable that otherwise
+appears not to change, the old value of the variable may be reused later
+if it happens to be found in a register.
+
+ You can prevent an `asm' instruction from being deleted by writing the
+keyword `volatile' after the `asm'. For example:
+
+ #define get_and_set_priority(new) \
+ ({ int __old; \
+ asm volatile ("get_and_set_priority %0, %1" \
+ : "=g" (__old) : "g" (new)); \
+ __old; })
+
+The `volatile' keyword indicates that the instruction has important
+side-effects. GCC will not delete a volatile `asm' if it is reachable.
+(The instruction can still be deleted if GCC can prove that
+control-flow will never reach the location of the instruction.) Note
+that even a volatile `asm' instruction can be moved relative to other
+code, including across jump instructions. For example, on many targets
+there is a system register which can be set to control the rounding
+mode of floating point operations. You might try setting it with a
+volatile `asm', like this PowerPC example:
+
+ asm volatile("mtfsf 255,%0" : : "f" (fpenv));
+ sum = x + y;
+
+This will not work reliably, as the compiler may move the addition back
+before the volatile `asm'. To make it work you need to add an
+artificial dependency to the `asm' referencing a variable in the code
+you don't want moved, for example:
+
+ asm volatile ("mtfsf 255,%1" : "=X"(sum): "f"(fpenv));
+ sum = x + y;
+
+ Similarly, you can't expect a sequence of volatile `asm' instructions
+to remain perfectly consecutive. If you want consecutive output, use a
+single `asm'. Also, GCC will perform some optimizations across a
+volatile `asm' instruction; GCC does not "forget everything" when it
+encounters a volatile `asm' instruction the way some other compilers do.
+
+ An `asm' instruction without any output operands will be treated
+identically to a volatile `asm' instruction.
+
+ It is a natural idea to look for a way to give access to the condition
+code left by the assembler instruction. However, when we attempted to
+implement this, we found no way to make it work reliably. The problem
+is that output operands might need reloading, which would result in
+additional following "store" instructions. On most machines, these
+instructions would alter the condition code before there was time to
+test it. This problem doesn't arise for ordinary "test" and "compare"
+instructions because they don't have any output operands.
+
+ For reasons similar to those described above, it is not possible to
+give an assembler instruction access to the condition code left by
+previous instructions.
+
+ If you are writing a header file that should be includable in ISO C
+programs, write `__asm__' instead of `asm'. *Note Alternate Keywords::.
+
+5.37.1 Size of an `asm'
+-----------------------
+
+Some targets require that GCC track the size of each instruction used in
+order to generate correct code. Because the final length of an `asm'
+is only known by the assembler, GCC must make an estimate as to how big
+it will be. The estimate is formed by counting the number of
+statements in the pattern of the `asm' and multiplying that by the
+length of the longest instruction on that processor. Statements in the
+`asm' are identified by newline characters and whatever statement
+separator characters are supported by the assembler; on most processors
+this is the ``;'' character.
+
+ Normally, GCC's estimate is perfectly adequate to ensure that correct
+code is generated, but it is possible to confuse the compiler if you use
+pseudo instructions or assembler macros that expand into multiple real
+instructions or if you use assembler directives that expand to more
+space in the object file than would be needed for a single instruction.
+If this happens then the assembler will produce a diagnostic saying that
+a label is unreachable.
+
+5.37.2 i386 floating point asm operands
+---------------------------------------
+
+There are several rules on the usage of stack-like regs in asm_operands
+insns. These rules apply only to the operands that are stack-like regs:
+
+ 1. Given a set of input regs that die in an asm_operands, it is
+ necessary to know which are implicitly popped by the asm, and
+ which must be explicitly popped by gcc.
+
+ An input reg that is implicitly popped by the asm must be
+ explicitly clobbered, unless it is constrained to match an output
+ operand.
+
+ 2. For any input reg that is implicitly popped by an asm, it is
+ necessary to know how to adjust the stack to compensate for the
+ pop. If any non-popped input is closer to the top of the
+ reg-stack than the implicitly popped reg, it would not be possible
+ to know what the stack looked like--it's not clear how the rest of
+ the stack "slides up".
+
+ All implicitly popped input regs must be closer to the top of the
+ reg-stack than any input that is not implicitly popped.
+
+ It is possible that if an input dies in an insn, reload might use
+ the input reg for an output reload. Consider this example:
+
+ asm ("foo" : "=t" (a) : "f" (b));
+
+ This asm says that input B is not popped by the asm, and that the
+ asm pushes a result onto the reg-stack, i.e., the stack is one
+ deeper after the asm than it was before. But, it is possible that
+ reload will think that it can use the same reg for both the input
+ and the output, if input B dies in this insn.
+
+ If any input operand uses the `f' constraint, all output reg
+ constraints must use the `&' earlyclobber.
+
+ The asm above would be written as
+
+ asm ("foo" : "=&t" (a) : "f" (b));
+
+ 3. Some operands need to be in particular places on the stack. All
+ output operands fall in this category--there is no other way to
+ know which regs the outputs appear in unless the user indicates
+ this in the constraints.
+
+ Output operands must specifically indicate which reg an output
+ appears in after an asm. `=f' is not allowed: the operand
+ constraints must select a class with a single reg.
+
+ 4. Output operands may not be "inserted" between existing stack regs.
+ Since no 387 opcode uses a read/write operand, all output operands
+ are dead before the asm_operands, and are pushed by the
+ asm_operands. It makes no sense to push anywhere but the top of
+ the reg-stack.
+
+ Output operands must start at the top of the reg-stack: output
+ operands may not "skip" a reg.
+
+ 5. Some asm statements may need extra stack space for internal
+ calculations. This can be guaranteed by clobbering stack registers
+ unrelated to the inputs and outputs.
+
+
+ Here are a couple of reasonable asms to want to write. This asm takes
+one input, which is internally popped, and produces two outputs.
+
+ asm ("fsincos" : "=t" (cos), "=u" (sin) : "0" (inp));
+
+ This asm takes two inputs, which are popped by the `fyl2xp1' opcode,
+and replaces them with one output. The user must code the `st(1)'
+clobber for reg-stack.c to know that `fyl2xp1' pops both inputs.
+
+ asm ("fyl2xp1" : "=t" (result) : "0" (x), "u" (y) : "st(1)");
+
+
+File: gcc.info, Node: Constraints, Next: Asm Labels, Prev: Extended Asm, Up: C Extensions
+
+5.38 Constraints for `asm' Operands
+===================================
+
+Here are specific details on what constraint letters you can use with
+`asm' operands. Constraints can say whether an operand may be in a
+register, and which kinds of register; whether the operand can be a
+memory reference, and which kinds of address; whether the operand may
+be an immediate constant, and which possible values it may have.
+Constraints can also require two operands to match.
+
+* Menu:
+
+* Simple Constraints:: Basic use of constraints.
+* Multi-Alternative:: When an insn has two alternative constraint-patterns.
+* Modifiers:: More precise control over effects of constraints.
+* Machine Constraints:: Special constraints for some particular machines.
+
+
+File: gcc.info, Node: Simple Constraints, Next: Multi-Alternative, Up: Constraints
+
+5.38.1 Simple Constraints
+-------------------------
+
+The simplest kind of constraint is a string full of letters, each of
+which describes one kind of operand that is permitted. Here are the
+letters that are allowed:
+
+whitespace
+ Whitespace characters are ignored and can be inserted at any
+ position except the first. This enables each alternative for
+ different operands to be visually aligned in the machine
+ description even if they have different number of constraints and
+ modifiers.
+
+`m'
+ A memory operand is allowed, with any kind of address that the
+ machine supports in general. Note that the letter used for the
+ general memory constraint can be re-defined by a back end using
+ the `TARGET_MEM_CONSTRAINT' macro.
+
+`o'
+ A memory operand is allowed, but only if the address is
+ "offsettable". This means that adding a small integer (actually,
+ the width in bytes of the operand, as determined by its machine
+ mode) may be added to the address and the result is also a valid
+ memory address.
+
+ For example, an address which is constant is offsettable; so is an
+ address that is the sum of a register and a constant (as long as a
+ slightly larger constant is also within the range of
+ address-offsets supported by the machine); but an autoincrement or
+ autodecrement address is not offsettable. More complicated
+ indirect/indexed addresses may or may not be offsettable depending
+ on the other addressing modes that the machine supports.
+
+ Note that in an output operand which can be matched by another
+ operand, the constraint letter `o' is valid only when accompanied
+ by both `<' (if the target machine has predecrement addressing)
+ and `>' (if the target machine has preincrement addressing).
+
+`V'
+ A memory operand that is not offsettable. In other words,
+ anything that would fit the `m' constraint but not the `o'
+ constraint.
+
+`<'
+ A memory operand with autodecrement addressing (either
+ predecrement or postdecrement) is allowed.
+
+`>'
+ A memory operand with autoincrement addressing (either
+ preincrement or postincrement) is allowed.
+
+`r'
+ A register operand is allowed provided that it is in a general
+ register.
+
+`i'
+ An immediate integer operand (one with constant value) is allowed.
+ This includes symbolic constants whose values will be known only at
+ assembly time or later.
+
+`n'
+ An immediate integer operand with a known numeric value is allowed.
+ Many systems cannot support assembly-time constants for operands
+ less than a word wide. Constraints for these operands should use
+ `n' rather than `i'.
+
+`I', `J', `K', ... `P'
+ Other letters in the range `I' through `P' may be defined in a
+ machine-dependent fashion to permit immediate integer operands with
+ explicit integer values in specified ranges. For example, on the
+ 68000, `I' is defined to stand for the range of values 1 to 8.
+ This is the range permitted as a shift count in the shift
+ instructions.
+
+`E'
+ An immediate floating operand (expression code `const_double') is
+ allowed, but only if the target floating point format is the same
+ as that of the host machine (on which the compiler is running).
+
+`F'
+ An immediate floating operand (expression code `const_double' or
+ `const_vector') is allowed.
+
+`G', `H'
+ `G' and `H' may be defined in a machine-dependent fashion to
+ permit immediate floating operands in particular ranges of values.
+
+`s'
+ An immediate integer operand whose value is not an explicit
+ integer is allowed.
+
+ This might appear strange; if an insn allows a constant operand
+ with a value not known at compile time, it certainly must allow
+ any known value. So why use `s' instead of `i'? Sometimes it
+ allows better code to be generated.
+
+ For example, on the 68000 in a fullword instruction it is possible
+ to use an immediate operand; but if the immediate value is between
+ -128 and 127, better code results from loading the value into a
+ register and using the register. This is because the load into
+ the register can be done with a `moveq' instruction. We arrange
+ for this to happen by defining the letter `K' to mean "any integer
+ outside the range -128 to 127", and then specifying `Ks' in the
+ operand constraints.
+
+`g'
+ Any register, memory or immediate integer operand is allowed,
+ except for registers that are not general registers.
+
+`X'
+ Any operand whatsoever is allowed.
+
+`0', `1', `2', ... `9'
+ An operand that matches the specified operand number is allowed.
+ If a digit is used together with letters within the same
+ alternative, the digit should come last.
+
+ This number is allowed to be more than a single digit. If multiple
+ digits are encountered consecutively, they are interpreted as a
+ single decimal integer. There is scant chance for ambiguity,
+ since to-date it has never been desirable that `10' be interpreted
+ as matching either operand 1 _or_ operand 0. Should this be
+ desired, one can use multiple alternatives instead.
+
+ This is called a "matching constraint" and what it really means is
+ that the assembler has only a single operand that fills two roles
+ which `asm' distinguishes. For example, an add instruction uses
+ two input operands and an output operand, but on most CISC
+ machines an add instruction really has only two operands, one of
+ them an input-output operand:
+
+ addl #35,r12
+
+ Matching constraints are used in these circumstances. More
+ precisely, the two operands that match must include one input-only
+ operand and one output-only operand. Moreover, the digit must be a
+ smaller number than the number of the operand that uses it in the
+ constraint.
+
+`p'
+ An operand that is a valid memory address is allowed. This is for
+ "load address" and "push address" instructions.
+
+ `p' in the constraint must be accompanied by `address_operand' as
+ the predicate in the `match_operand'. This predicate interprets
+ the mode specified in the `match_operand' as the mode of the memory
+ reference for which the address would be valid.
+
+OTHER-LETTERS
+ Other letters can be defined in machine-dependent fashion to stand
+ for particular classes of registers or other arbitrary operand
+ types. `d', `a' and `f' are defined on the 68000/68020 to stand
+ for data, address and floating point registers.
+
+
+File: gcc.info, Node: Multi-Alternative, Next: Modifiers, Prev: Simple Constraints, Up: Constraints
+
+5.38.2 Multiple Alternative Constraints
+---------------------------------------
+
+Sometimes a single instruction has multiple alternative sets of possible
+operands. For example, on the 68000, a logical-or instruction can
+combine register or an immediate value into memory, or it can combine
+any kind of operand into a register; but it cannot combine one memory
+location into another.
+
+ These constraints are represented as multiple alternatives. An
+alternative can be described by a series of letters for each operand.
+The overall constraint for an operand is made from the letters for this
+operand from the first alternative, a comma, the letters for this
+operand from the second alternative, a comma, and so on until the last
+alternative.
+
+ If all the operands fit any one alternative, the instruction is valid.
+Otherwise, for each alternative, the compiler counts how many
+instructions must be added to copy the operands so that that
+alternative applies. The alternative requiring the least copying is
+chosen. If two alternatives need the same amount of copying, the one
+that comes first is chosen. These choices can be altered with the `?'
+and `!' characters:
+
+`?'
+ Disparage slightly the alternative that the `?' appears in, as a
+ choice when no alternative applies exactly. The compiler regards
+ this alternative as one unit more costly for each `?' that appears
+ in it.
+
+`!'
+ Disparage severely the alternative that the `!' appears in. This
+ alternative can still be used if it fits without reloading, but if
+ reloading is needed, some other alternative will be used.
+
+
+File: gcc.info, Node: Modifiers, Next: Machine Constraints, Prev: Multi-Alternative, Up: Constraints
+
+5.38.3 Constraint Modifier Characters
+-------------------------------------
+
+Here are constraint modifier characters.
+
+`='
+ Means that this operand is write-only for this instruction: the
+ previous value is discarded and replaced by output data.
+
+`+'
+ Means that this operand is both read and written by the
+ instruction.
+
+ When the compiler fixes up the operands to satisfy the constraints,
+ it needs to know which operands are inputs to the instruction and
+ which are outputs from it. `=' identifies an output; `+'
+ identifies an operand that is both input and output; all other
+ operands are assumed to be input only.
+
+ If you specify `=' or `+' in a constraint, you put it in the first
+ character of the constraint string.
+
+`&'
+ Means (in a particular alternative) that this operand is an
+ "earlyclobber" operand, which is modified before the instruction is
+ finished using the input operands. Therefore, this operand may
+ not lie in a register that is used as an input operand or as part
+ of any memory address.
+
+ `&' applies only to the alternative in which it is written. In
+ constraints with multiple alternatives, sometimes one alternative
+ requires `&' while others do not. See, for example, the `movdf'
+ insn of the 68000.
+
+ An input operand can be tied to an earlyclobber operand if its only
+ use as an input occurs before the early result is written. Adding
+ alternatives of this form often allows GCC to produce better code
+ when only some of the inputs can be affected by the earlyclobber.
+ See, for example, the `mulsi3' insn of the ARM.
+
+ `&' does not obviate the need to write `='.
+
+`%'
+ Declares the instruction to be commutative for this operand and the
+ following operand. This means that the compiler may interchange
+ the two operands if that is the cheapest way to make all operands
+ fit the constraints. GCC can only handle one commutative pair in
+ an asm; if you use more, the compiler may fail. Note that you
+ need not use the modifier if the two alternatives are strictly
+ identical; this would only waste time in the reload pass. The
+ modifier is not operational after register allocation, so the
+ result of `define_peephole2' and `define_split's performed after
+ reload cannot rely on `%' to make the intended insn match.
+
+`#'
+ Says that all following characters, up to the next comma, are to be
+ ignored as a constraint. They are significant only for choosing
+ register preferences.
+
+`*'
+ Says that the following character should be ignored when choosing
+ register preferences. `*' has no effect on the meaning of the
+ constraint as a constraint, and no effect on reloading.
+
+
+
+File: gcc.info, Node: Machine Constraints, Prev: Modifiers, Up: Constraints
+
+5.38.4 Constraints for Particular Machines
+------------------------------------------
+
+Whenever possible, you should use the general-purpose constraint letters
+in `asm' arguments, since they will convey meaning more readily to
+people reading your code. Failing that, use the constraint letters
+that usually have very similar meanings across architectures. The most
+commonly used constraints are `m' and `r' (for memory and
+general-purpose registers respectively; *note Simple Constraints::), and
+`I', usually the letter indicating the most common immediate-constant
+format.
+
+ Each architecture defines additional constraints. These constraints
+are used by the compiler itself for instruction generation, as well as
+for `asm' statements; therefore, some of the constraints are not
+particularly useful for `asm'. Here is a summary of some of the
+machine-dependent constraints available on some particular machines; it
+includes both constraints that are useful for `asm' and constraints
+that aren't. The compiler source file mentioned in the table heading
+for each architecture is the definitive reference for the meanings of
+that architecture's constraints.
+
+_ARM family--`config/arm/arm.h'_
+
+ `f'
+ Floating-point register
+
+ `w'
+ VFP floating-point register
+
+ `F'
+ One of the floating-point constants 0.0, 0.5, 1.0, 2.0, 3.0,
+ 4.0, 5.0 or 10.0
+
+ `G'
+ Floating-point constant that would satisfy the constraint `F'
+ if it were negated
+
+ `I'
+ Integer that is valid as an immediate operand in a data
+ processing instruction. That is, an integer in the range 0
+ to 255 rotated by a multiple of 2
+
+ `J'
+ Integer in the range -4095 to 4095
+
+ `K'
+ Integer that satisfies constraint `I' when inverted (ones
+ complement)
+
+ `L'
+ Integer that satisfies constraint `I' when negated (twos
+ complement)
+
+ `M'
+ Integer in the range 0 to 32
+
+ `Q'
+ A memory reference where the exact address is in a single
+ register (``m'' is preferable for `asm' statements)
+
+ `R'
+ An item in the constant pool
+
+ `S'
+ A symbol in the text segment of the current file
+
+ `Uv'
+ A memory reference suitable for VFP load/store insns
+ (reg+constant offset)
+
+ `Uy'
+ A memory reference suitable for iWMMXt load/store
+ instructions.
+
+ `Uq'
+ A memory reference suitable for the ARMv4 ldrsb instruction.
+
+_AVR family--`config/avr/constraints.md'_
+
+ `l'
+ Registers from r0 to r15
+
+ `a'
+ Registers from r16 to r23
+
+ `d'
+ Registers from r16 to r31
+
+ `w'
+ Registers from r24 to r31. These registers can be used in
+ `adiw' command
+
+ `e'
+ Pointer register (r26-r31)
+
+ `b'
+ Base pointer register (r28-r31)
+
+ `q'
+ Stack pointer register (SPH:SPL)
+
+ `t'
+ Temporary register r0
+
+ `x'
+ Register pair X (r27:r26)
+
+ `y'
+ Register pair Y (r29:r28)
+
+ `z'
+ Register pair Z (r31:r30)
+
+ `I'
+ Constant greater than -1, less than 64
+
+ `J'
+ Constant greater than -64, less than 1
+
+ `K'
+ Constant integer 2
+
+ `L'
+ Constant integer 0
+
+ `M'
+ Constant that fits in 8 bits
+
+ `N'
+ Constant integer -1
+
+ `O'
+ Constant integer 8, 16, or 24
+
+ `P'
+ Constant integer 1
+
+ `G'
+ A floating point constant 0.0
+
+ `R'
+ Integer constant in the range -6 ... 5.
+
+ `Q'
+ A memory address based on Y or Z pointer with displacement.
+
+_CRX Architecture--`config/crx/crx.h'_
+
+ `b'
+ Registers from r0 to r14 (registers without stack pointer)
+
+ `l'
+ Register r16 (64-bit accumulator lo register)
+
+ `h'
+ Register r17 (64-bit accumulator hi register)
+
+ `k'
+ Register pair r16-r17. (64-bit accumulator lo-hi pair)
+
+ `I'
+ Constant that fits in 3 bits
+
+ `J'
+ Constant that fits in 4 bits
+
+ `K'
+ Constant that fits in 5 bits
+
+ `L'
+ Constant that is one of -1, 4, -4, 7, 8, 12, 16, 20, 32, 48
+
+ `G'
+ Floating point constant that is legal for store immediate
+
+_Hewlett-Packard PA-RISC--`config/pa/pa.h'_
+
+ `a'
+ General register 1
+
+ `f'
+ Floating point register
+
+ `q'
+ Shift amount register
+
+ `x'
+ Floating point register (deprecated)
+
+ `y'
+ Upper floating point register (32-bit), floating point
+ register (64-bit)
+
+ `Z'
+ Any register
+
+ `I'
+ Signed 11-bit integer constant
+
+ `J'
+ Signed 14-bit integer constant
+
+ `K'
+ Integer constant that can be deposited with a `zdepi'
+ instruction
+
+ `L'
+ Signed 5-bit integer constant
+
+ `M'
+ Integer constant 0
+
+ `N'
+ Integer constant that can be loaded with a `ldil' instruction
+
+ `O'
+ Integer constant whose value plus one is a power of 2
+
+ `P'
+ Integer constant that can be used for `and' operations in
+ `depi' and `extru' instructions
+
+ `S'
+ Integer constant 31
+
+ `U'
+ Integer constant 63
+
+ `G'
+ Floating-point constant 0.0
+
+ `A'
+ A `lo_sum' data-linkage-table memory operand
+
+ `Q'
+ A memory operand that can be used as the destination operand
+ of an integer store instruction
+
+ `R'
+ A scaled or unscaled indexed memory operand
+
+ `T'
+ A memory operand for floating-point loads and stores
+
+ `W'
+ A register indirect memory operand
+
+_picoChip family--`picochip.h'_
+
+ `k'
+ Stack register.
+
+ `f'
+ Pointer register. A register which can be used to access
+ memory without supplying an offset. Any other register can
+ be used to access memory, but will need a constant offset.
+ In the case of the offset being zero, it is more efficient to
+ use a pointer register, since this reduces code size.
+
+ `t'
+ A twin register. A register which may be paired with an
+ adjacent register to create a 32-bit register.
+
+ `a'
+ Any absolute memory address (e.g., symbolic constant, symbolic
+ constant + offset).
+
+ `I'
+ 4-bit signed integer.
+
+ `J'
+ 4-bit unsigned integer.
+
+ `K'
+ 8-bit signed integer.
+
+ `M'
+ Any constant whose absolute value is no greater than 4-bits.
+
+ `N'
+ 10-bit signed integer
+
+ `O'
+ 16-bit signed integer.
+
+
+_PowerPC and IBM RS6000--`config/rs6000/rs6000.h'_
+
+ `b'
+ Address base register
+
+ `f'
+ Floating point register
+
+ `v'
+ Vector register
+
+ `h'
+ `MQ', `CTR', or `LINK' register
+
+ `q'
+ `MQ' register
+
+ `c'
+ `CTR' register
+
+ `l'
+ `LINK' register
+
+ `x'
+ `CR' register (condition register) number 0
+
+ `y'
+ `CR' register (condition register)
+
+ `z'
+ `FPMEM' stack memory for FPR-GPR transfers
+
+ `I'
+ Signed 16-bit constant
+
+ `J'
+ Unsigned 16-bit constant shifted left 16 bits (use `L'
+ instead for `SImode' constants)
+
+ `K'
+ Unsigned 16-bit constant
+
+ `L'
+ Signed 16-bit constant shifted left 16 bits
+
+ `M'
+ Constant larger than 31
+
+ `N'
+ Exact power of 2
+
+ `O'
+ Zero
+
+ `P'
+ Constant whose negation is a signed 16-bit constant
+
+ `G'
+ Floating point constant that can be loaded into a register
+ with one instruction per word
+
+ `H'
+ Integer/Floating point constant that can be loaded into a
+ register using three instructions
+
+ `Q'
+ Memory operand that is an offset from a register (`m' is
+ preferable for `asm' statements)
+
+ `Z'
+ Memory operand that is an indexed or indirect from a register
+ (`m' is preferable for `asm' statements)
+
+ `R'
+ AIX TOC entry
+
+ `a'
+ Address operand that is an indexed or indirect from a
+ register (`p' is preferable for `asm' statements)
+
+ `S'
+ Constant suitable as a 64-bit mask operand
+
+ `T'
+ Constant suitable as a 32-bit mask operand
+
+ `U'
+ System V Release 4 small data area reference
+
+ `t'
+ AND masks that can be performed by two rldic{l, r}
+ instructions
+
+ `W'
+ Vector constant that does not require memory
+
+
+_Intel 386--`config/i386/constraints.md'_
+
+ `R'
+ Legacy register--the eight integer registers available on all
+ i386 processors (`a', `b', `c', `d', `si', `di', `bp', `sp').
+
+ `q'
+ Any register accessible as `Rl'. In 32-bit mode, `a', `b',
+ `c', and `d'; in 64-bit mode, any integer register.
+
+ `Q'
+ Any register accessible as `Rh': `a', `b', `c', and `d'.
+
+ `a'
+ The `a' register.
+
+ `b'
+ The `b' register.
+
+ `c'
+ The `c' register.
+
+ `d'
+ The `d' register.
+
+ `S'
+ The `si' register.
+
+ `D'
+ The `di' register.
+
+ `A'
+ The `a' and `d' registers, as a pair (for instructions that
+ return half the result in one and half in the other).
+
+ `f'
+ Any 80387 floating-point (stack) register.
+
+ `t'
+ Top of 80387 floating-point stack (`%st(0)').
+
+ `u'
+ Second from top of 80387 floating-point stack (`%st(1)').
+
+ `y'
+ Any MMX register.
+
+ `x'
+ Any SSE register.
+
+ `Yz'
+ First SSE register (`%xmm0').
+
+ `I'
+ Integer constant in the range 0 ... 31, for 32-bit shifts.
+
+ `J'
+ Integer constant in the range 0 ... 63, for 64-bit shifts.
+
+ `K'
+ Signed 8-bit integer constant.
+
+ `L'
+ `0xFF' or `0xFFFF', for andsi as a zero-extending move.
+
+ `M'
+ 0, 1, 2, or 3 (shifts for the `lea' instruction).
+
+ `N'
+ Unsigned 8-bit integer constant (for `in' and `out'
+ instructions).
+
+ `G'
+ Standard 80387 floating point constant.
+
+ `C'
+ Standard SSE floating point constant.
+
+ `e'
+ 32-bit signed integer constant, or a symbolic reference known
+ to fit that range (for immediate operands in sign-extending
+ x86-64 instructions).
+
+ `Z'
+ 32-bit unsigned integer constant, or a symbolic reference
+ known to fit that range (for immediate operands in
+ zero-extending x86-64 instructions).
+
+
+_Intel IA-64--`config/ia64/ia64.h'_
+
+ `a'
+ General register `r0' to `r3' for `addl' instruction
+
+ `b'
+ Branch register
+
+ `c'
+ Predicate register (`c' as in "conditional")
+
+ `d'
+ Application register residing in M-unit
+
+ `e'
+ Application register residing in I-unit
+
+ `f'
+ Floating-point register
+
+ `m'
+ Memory operand. Remember that `m' allows postincrement and
+ postdecrement which require printing with `%Pn' on IA-64.
+ Use `S' to disallow postincrement and postdecrement.
+
+ `G'
+ Floating-point constant 0.0 or 1.0
+
+ `I'
+ 14-bit signed integer constant
+
+ `J'
+ 22-bit signed integer constant
+
+ `K'
+ 8-bit signed integer constant for logical instructions
+
+ `L'
+ 8-bit adjusted signed integer constant for compare pseudo-ops
+
+ `M'
+ 6-bit unsigned integer constant for shift counts
+
+ `N'
+ 9-bit signed integer constant for load and store
+ postincrements
+
+ `O'
+ The constant zero
+
+ `P'
+ 0 or -1 for `dep' instruction
+
+ `Q'
+ Non-volatile memory for floating-point loads and stores
+
+ `R'
+ Integer constant in the range 1 to 4 for `shladd' instruction
+
+ `S'
+ Memory operand except postincrement and postdecrement
+
+_FRV--`config/frv/frv.h'_
+
+ `a'
+ Register in the class `ACC_REGS' (`acc0' to `acc7').
+
+ `b'
+ Register in the class `EVEN_ACC_REGS' (`acc0' to `acc7').
+
+ `c'
+ Register in the class `CC_REGS' (`fcc0' to `fcc3' and `icc0'
+ to `icc3').
+
+ `d'
+ Register in the class `GPR_REGS' (`gr0' to `gr63').
+
+ `e'
+ Register in the class `EVEN_REGS' (`gr0' to `gr63'). Odd
+ registers are excluded not in the class but through the use
+ of a machine mode larger than 4 bytes.
+
+ `f'
+ Register in the class `FPR_REGS' (`fr0' to `fr63').
+
+ `h'
+ Register in the class `FEVEN_REGS' (`fr0' to `fr63'). Odd
+ registers are excluded not in the class but through the use
+ of a machine mode larger than 4 bytes.
+
+ `l'
+ Register in the class `LR_REG' (the `lr' register).
+
+ `q'
+ Register in the class `QUAD_REGS' (`gr2' to `gr63').
+ Register numbers not divisible by 4 are excluded not in the
+ class but through the use of a machine mode larger than 8
+ bytes.
+
+ `t'
+ Register in the class `ICC_REGS' (`icc0' to `icc3').
+
+ `u'
+ Register in the class `FCC_REGS' (`fcc0' to `fcc3').
+
+ `v'
+ Register in the class `ICR_REGS' (`cc4' to `cc7').
+
+ `w'
+ Register in the class `FCR_REGS' (`cc0' to `cc3').
+
+ `x'
+ Register in the class `QUAD_FPR_REGS' (`fr0' to `fr63').
+ Register numbers not divisible by 4 are excluded not in the
+ class but through the use of a machine mode larger than 8
+ bytes.
+
+ `z'
+ Register in the class `SPR_REGS' (`lcr' and `lr').
+
+ `A'
+ Register in the class `QUAD_ACC_REGS' (`acc0' to `acc7').
+
+ `B'
+ Register in the class `ACCG_REGS' (`accg0' to `accg7').
+
+ `C'
+ Register in the class `CR_REGS' (`cc0' to `cc7').
+
+ `G'
+ Floating point constant zero
+
+ `I'
+ 6-bit signed integer constant
+
+ `J'
+ 10-bit signed integer constant
+
+ `L'
+ 16-bit signed integer constant
+
+ `M'
+ 16-bit unsigned integer constant
+
+ `N'
+ 12-bit signed integer constant that is negative--i.e. in the
+ range of -2048 to -1
+
+ `O'
+ Constant zero
+
+ `P'
+ 12-bit signed integer constant that is greater than
+ zero--i.e. in the range of 1 to 2047.
+
+
+_Blackfin family--`config/bfin/constraints.md'_
+
+ `a'
+ P register
+
+ `d'
+ D register
+
+ `z'
+ A call clobbered P register.
+
+ `qN'
+ A single register. If N is in the range 0 to 7, the
+ corresponding D register. If it is `A', then the register P0.
+
+ `D'
+ Even-numbered D register
+
+ `W'
+ Odd-numbered D register
+
+ `e'
+ Accumulator register.
+
+ `A'
+ Even-numbered accumulator register.
+
+ `B'
+ Odd-numbered accumulator register.
+
+ `b'
+ I register
+
+ `v'
+ B register
+
+ `f'
+ M register
+
+ `c'
+ Registers used for circular buffering, i.e. I, B, or L
+ registers.
+
+ `C'
+ The CC register.
+
+ `t'
+ LT0 or LT1.
+
+ `k'
+ LC0 or LC1.
+
+ `u'
+ LB0 or LB1.
+
+ `x'
+ Any D, P, B, M, I or L register.
+
+ `y'
+ Additional registers typically used only in prologues and
+ epilogues: RETS, RETN, RETI, RETX, RETE, ASTAT, SEQSTAT and
+ USP.
+
+ `w'
+ Any register except accumulators or CC.
+
+ `Ksh'
+ Signed 16 bit integer (in the range -32768 to 32767)
+
+ `Kuh'
+ Unsigned 16 bit integer (in the range 0 to 65535)
+
+ `Ks7'
+ Signed 7 bit integer (in the range -64 to 63)
+
+ `Ku7'
+ Unsigned 7 bit integer (in the range 0 to 127)
+
+ `Ku5'
+ Unsigned 5 bit integer (in the range 0 to 31)
+
+ `Ks4'
+ Signed 4 bit integer (in the range -8 to 7)
+
+ `Ks3'
+ Signed 3 bit integer (in the range -3 to 4)
+
+ `Ku3'
+ Unsigned 3 bit integer (in the range 0 to 7)
+
+ `PN'
+ Constant N, where N is a single-digit constant in the range 0
+ to 4.
+
+ `PA'
+ An integer equal to one of the MACFLAG_XXX constants that is
+ suitable for use with either accumulator.
+
+ `PB'
+ An integer equal to one of the MACFLAG_XXX constants that is
+ suitable for use only with accumulator A1.
+
+ `M1'
+ Constant 255.
+
+ `M2'
+ Constant 65535.
+
+ `J'
+ An integer constant with exactly a single bit set.
+
+ `L'
+ An integer constant with all bits set except exactly one.
+
+ `H'
+
+ `Q'
+ Any SYMBOL_REF.
+
+_M32C--`config/m32c/m32c.c'_
+
+ `Rsp'
+ `Rfb'
+ `Rsb'
+ `$sp', `$fb', `$sb'.
+
+ `Rcr'
+ Any control register, when they're 16 bits wide (nothing if
+ control registers are 24 bits wide)
+
+ `Rcl'
+ Any control register, when they're 24 bits wide.
+
+ `R0w'
+ `R1w'
+ `R2w'
+ `R3w'
+ $r0, $r1, $r2, $r3.
+
+ `R02'
+ $r0 or $r2, or $r2r0 for 32 bit values.
+
+ `R13'
+ $r1 or $r3, or $r3r1 for 32 bit values.
+
+ `Rdi'
+ A register that can hold a 64 bit value.
+
+ `Rhl'
+ $r0 or $r1 (registers with addressable high/low bytes)
+
+ `R23'
+ $r2 or $r3
+
+ `Raa'
+ Address registers
+
+ `Raw'
+ Address registers when they're 16 bits wide.
+
+ `Ral'
+ Address registers when they're 24 bits wide.
+
+ `Rqi'
+ Registers that can hold QI values.
+
+ `Rad'
+ Registers that can be used with displacements ($a0, $a1, $sb).
+
+ `Rsi'
+ Registers that can hold 32 bit values.
+
+ `Rhi'
+ Registers that can hold 16 bit values.
+
+ `Rhc'
+ Registers chat can hold 16 bit values, including all control
+ registers.
+
+ `Rra'
+ $r0 through R1, plus $a0 and $a1.
+
+ `Rfl'
+ The flags register.
+
+ `Rmm'
+ The memory-based pseudo-registers $mem0 through $mem15.
+
+ `Rpi'
+ Registers that can hold pointers (16 bit registers for r8c,
+ m16c; 24 bit registers for m32cm, m32c).
+
+ `Rpa'
+ Matches multiple registers in a PARALLEL to form a larger
+ register. Used to match function return values.
+
+ `Is3'
+ -8 ... 7
+
+ `IS1'
+ -128 ... 127
+
+ `IS2'
+ -32768 ... 32767
+
+ `IU2'
+ 0 ... 65535
+
+ `In4'
+ -8 ... -1 or 1 ... 8
+
+ `In5'
+ -16 ... -1 or 1 ... 16
+
+ `In6'
+ -32 ... -1 or 1 ... 32
+
+ `IM2'
+ -65536 ... -1
+
+ `Ilb'
+ An 8 bit value with exactly one bit set.
+
+ `Ilw'
+ A 16 bit value with exactly one bit set.
+
+ `Sd'
+ The common src/dest memory addressing modes.
+
+ `Sa'
+ Memory addressed using $a0 or $a1.
+
+ `Si'
+ Memory addressed with immediate addresses.
+
+ `Ss'
+ Memory addressed using the stack pointer ($sp).
+
+ `Sf'
+ Memory addressed using the frame base register ($fb).
+
+ `Ss'
+ Memory addressed using the small base register ($sb).
+
+ `S1'
+ $r1h
+
+_MIPS--`config/mips/constraints.md'_
+
+ `d'
+ An address register. This is equivalent to `r' unless
+ generating MIPS16 code.
+
+ `f'
+ A floating-point register (if available).
+
+ `h'
+ Formerly the `hi' register. This constraint is no longer
+ supported.
+
+ `l'
+ The `lo' register. Use this register to store values that are
+ no bigger than a word.
+
+ `x'
+ The concatenated `hi' and `lo' registers. Use this register
+ to store doubleword values.
+
+ `c'
+ A register suitable for use in an indirect jump. This will
+ always be `$25' for `-mabicalls'.
+
+ `v'
+ Register `$3'. Do not use this constraint in new code; it is
+ retained only for compatibility with glibc.
+
+ `y'
+ Equivalent to `r'; retained for backwards compatibility.
+
+ `z'
+ A floating-point condition code register.
+
+ `I'
+ A signed 16-bit constant (for arithmetic instructions).
+
+ `J'
+ Integer zero.
+
+ `K'
+ An unsigned 16-bit constant (for logic instructions).
+
+ `L'
+ A signed 32-bit constant in which the lower 16 bits are zero.
+ Such constants can be loaded using `lui'.
+
+ `M'
+ A constant that cannot be loaded using `lui', `addiu' or
+ `ori'.
+
+ `N'
+ A constant in the range -65535 to -1 (inclusive).
+
+ `O'
+ A signed 15-bit constant.
+
+ `P'
+ A constant in the range 1 to 65535 (inclusive).
+
+ `G'
+ Floating-point zero.
+
+ `R'
+ An address that can be used in a non-macro load or store.
+
+_Motorola 680x0--`config/m68k/constraints.md'_
+
+ `a'
+ Address register
+
+ `d'
+ Data register
+
+ `f'
+ 68881 floating-point register, if available
+
+ `I'
+ Integer in the range 1 to 8
+
+ `J'
+ 16-bit signed number
+
+ `K'
+ Signed number whose magnitude is greater than 0x80
+
+ `L'
+ Integer in the range -8 to -1
+
+ `M'
+ Signed number whose magnitude is greater than 0x100
+
+ `N'
+ Range 24 to 31, rotatert:SI 8 to 1 expressed as rotate
+
+ `O'
+ 16 (for rotate using swap)
+
+ `P'
+ Range 8 to 15, rotatert:HI 8 to 1 expressed as rotate
+
+ `R'
+ Numbers that mov3q can handle
+
+ `G'
+ Floating point constant that is not a 68881 constant
+
+ `S'
+ Operands that satisfy 'm' when -mpcrel is in effect
+
+ `T'
+ Operands that satisfy 's' when -mpcrel is not in effect
+
+ `Q'
+ Address register indirect addressing mode
+
+ `U'
+ Register offset addressing
+
+ `W'
+ const_call_operand
+
+ `Cs'
+ symbol_ref or const
+
+ `Ci'
+ const_int
+
+ `C0'
+ const_int 0
+
+ `Cj'
+ Range of signed numbers that don't fit in 16 bits
+
+ `Cmvq'
+ Integers valid for mvq
+
+ `Capsw'
+ Integers valid for a moveq followed by a swap
+
+ `Cmvz'
+ Integers valid for mvz
+
+ `Cmvs'
+ Integers valid for mvs
+
+ `Ap'
+ push_operand
+
+ `Ac'
+ Non-register operands allowed in clr
+
+
+_Motorola 68HC11 & 68HC12 families--`config/m68hc11/m68hc11.h'_
+
+ `a'
+ Register `a'
+
+ `b'
+ Register `b'
+
+ `d'
+ Register `d'
+
+ `q'
+ An 8-bit register
+
+ `t'
+ Temporary soft register _.tmp
+
+ `u'
+ A soft register _.d1 to _.d31
+
+ `w'
+ Stack pointer register
+
+ `x'
+ Register `x'
+
+ `y'
+ Register `y'
+
+ `z'
+ Pseudo register `z' (replaced by `x' or `y' at the end)
+
+ `A'
+ An address register: x, y or z
+
+ `B'
+ An address register: x or y
+
+ `D'
+ Register pair (x:d) to form a 32-bit value
+
+ `L'
+ Constants in the range -65536 to 65535
+
+ `M'
+ Constants whose 16-bit low part is zero
+
+ `N'
+ Constant integer 1 or -1
+
+ `O'
+ Constant integer 16
+
+ `P'
+ Constants in the range -8 to 2
+
+
+_SPARC--`config/sparc/sparc.h'_
+
+ `f'
+ Floating-point register on the SPARC-V8 architecture and
+ lower floating-point register on the SPARC-V9 architecture.
+
+ `e'
+ Floating-point register. It is equivalent to `f' on the
+ SPARC-V8 architecture and contains both lower and upper
+ floating-point registers on the SPARC-V9 architecture.
+
+ `c'
+ Floating-point condition code register.
+
+ `d'
+ Lower floating-point register. It is only valid on the
+ SPARC-V9 architecture when the Visual Instruction Set is
+ available.
+
+ `b'
+ Floating-point register. It is only valid on the SPARC-V9
+ architecture when the Visual Instruction Set is available.
+
+ `h'
+ 64-bit global or out register for the SPARC-V8+ architecture.
+
+ `D'
+ A vector constant
+
+ `I'
+ Signed 13-bit constant
+
+ `J'
+ Zero
+
+ `K'
+ 32-bit constant with the low 12 bits clear (a constant that
+ can be loaded with the `sethi' instruction)
+
+ `L'
+ A constant in the range supported by `movcc' instructions
+
+ `M'
+ A constant in the range supported by `movrcc' instructions
+
+ `N'
+ Same as `K', except that it verifies that bits that are not
+ in the lower 32-bit range are all zero. Must be used instead
+ of `K' for modes wider than `SImode'
+
+ `O'
+ The constant 4096
+
+ `G'
+ Floating-point zero
+
+ `H'
+ Signed 13-bit constant, sign-extended to 32 or 64 bits
+
+ `Q'
+ Floating-point constant whose integral representation can be
+ moved into an integer register using a single sethi
+ instruction
+
+ `R'
+ Floating-point constant whose integral representation can be
+ moved into an integer register using a single mov instruction
+
+ `S'
+ Floating-point constant whose integral representation can be
+ moved into an integer register using a high/lo_sum
+ instruction sequence
+
+ `T'
+ Memory address aligned to an 8-byte boundary
+
+ `U'
+ Even register
+
+ `W'
+ Memory address for `e' constraint registers
+
+ `Y'
+ Vector zero
+
+
+_SPU--`config/spu/spu.h'_
+
+ `a'
+ An immediate which can be loaded with the il/ila/ilh/ilhu
+ instructions. const_int is treated as a 64 bit value.
+
+ `c'
+ An immediate for and/xor/or instructions. const_int is
+ treated as a 64 bit value.
+
+ `d'
+ An immediate for the `iohl' instruction. const_int is
+ treated as a 64 bit value.
+
+ `f'
+ An immediate which can be loaded with `fsmbi'.
+
+ `A'
+ An immediate which can be loaded with the il/ila/ilh/ilhu
+ instructions. const_int is treated as a 32 bit value.
+
+ `B'
+ An immediate for most arithmetic instructions. const_int is
+ treated as a 32 bit value.
+
+ `C'
+ An immediate for and/xor/or instructions. const_int is
+ treated as a 32 bit value.
+
+ `D'
+ An immediate for the `iohl' instruction. const_int is
+ treated as a 32 bit value.
+
+ `I'
+ A constant in the range [-64, 63] for shift/rotate
+ instructions.
+
+ `J'
+ An unsigned 7-bit constant for conversion/nop/channel
+ instructions.
+
+ `K'
+ A signed 10-bit constant for most arithmetic instructions.
+
+ `M'
+ A signed 16 bit immediate for `stop'.
+
+ `N'
+ An unsigned 16-bit constant for `iohl' and `fsmbi'.
+
+ `O'
+ An unsigned 7-bit constant whose 3 least significant bits are
+ 0.
+
+ `P'
+ An unsigned 3-bit constant for 16-byte rotates and shifts
+
+ `R'
+ Call operand, reg, for indirect calls
+
+ `S'
+ Call operand, symbol, for relative calls.
+
+ `T'
+ Call operand, const_int, for absolute calls.
+
+ `U'
+ An immediate which can be loaded with the il/ila/ilh/ilhu
+ instructions. const_int is sign extended to 128 bit.
+
+ `W'
+ An immediate for shift and rotate instructions. const_int is
+ treated as a 32 bit value.
+
+ `Y'
+ An immediate for and/xor/or instructions. const_int is sign
+ extended as a 128 bit.
+
+ `Z'
+ An immediate for the `iohl' instruction. const_int is sign
+ extended to 128 bit.
+
+
+_S/390 and zSeries--`config/s390/s390.h'_
+
+ `a'
+ Address register (general purpose register except r0)
+
+ `c'
+ Condition code register
+
+ `d'
+ Data register (arbitrary general purpose register)
+
+ `f'
+ Floating-point register
+
+ `I'
+ Unsigned 8-bit constant (0-255)
+
+ `J'
+ Unsigned 12-bit constant (0-4095)
+
+ `K'
+ Signed 16-bit constant (-32768-32767)
+
+ `L'
+ Value appropriate as displacement.
+ `(0..4095)'
+ for short displacement
+
+ `(-524288..524287)'
+ for long displacement
+
+ `M'
+ Constant integer with a value of 0x7fffffff.
+
+ `N'
+ Multiple letter constraint followed by 4 parameter letters.
+ `0..9:'
+ number of the part counting from most to least
+ significant
+
+ `H,Q:'
+ mode of the part
+
+ `D,S,H:'
+ mode of the containing operand
+
+ `0,F:'
+ value of the other parts (F--all bits set)
+ The constraint matches if the specified part of a constant
+ has a value different from its other parts.
+
+ `Q'
+ Memory reference without index register and with short
+ displacement.
+
+ `R'
+ Memory reference with index register and short displacement.
+
+ `S'
+ Memory reference without index register but with long
+ displacement.
+
+ `T'
+ Memory reference with index register and long displacement.
+
+ `U'
+ Pointer with short displacement.
+
+ `W'
+ Pointer with long displacement.
+
+ `Y'
+ Shift count operand.
+
+
+_Score family--`config/score/score.h'_
+
+ `d'
+ Registers from r0 to r32.
+
+ `e'
+ Registers from r0 to r16.
+
+ `t'
+ r8--r11 or r22--r27 registers.
+
+ `h'
+ hi register.
+
+ `l'
+ lo register.
+
+ `x'
+ hi + lo register.
+
+ `q'
+ cnt register.
+
+ `y'
+ lcb register.
+
+ `z'
+ scb register.
+
+ `a'
+ cnt + lcb + scb register.
+
+ `c'
+ cr0--cr15 register.
+
+ `b'
+ cp1 registers.
+
+ `f'
+ cp2 registers.
+
+ `i'
+ cp3 registers.
+
+ `j'
+ cp1 + cp2 + cp3 registers.
+
+ `I'
+ High 16-bit constant (32-bit constant with 16 LSBs zero).
+
+ `J'
+ Unsigned 5 bit integer (in the range 0 to 31).
+
+ `K'
+ Unsigned 16 bit integer (in the range 0 to 65535).
+
+ `L'
+ Signed 16 bit integer (in the range -32768 to 32767).
+
+ `M'
+ Unsigned 14 bit integer (in the range 0 to 16383).
+
+ `N'
+ Signed 14 bit integer (in the range -8192 to 8191).
+
+ `Z'
+ Any SYMBOL_REF.
+
+_Xstormy16--`config/stormy16/stormy16.h'_
+
+ `a'
+ Register r0.
+
+ `b'
+ Register r1.
+
+ `c'
+ Register r2.
+
+ `d'
+ Register r8.
+
+ `e'
+ Registers r0 through r7.
+
+ `t'
+ Registers r0 and r1.
+
+ `y'
+ The carry register.
+
+ `z'
+ Registers r8 and r9.
+
+ `I'
+ A constant between 0 and 3 inclusive.
+
+ `J'
+ A constant that has exactly one bit set.
+
+ `K'
+ A constant that has exactly one bit clear.
+
+ `L'
+ A constant between 0 and 255 inclusive.
+
+ `M'
+ A constant between -255 and 0 inclusive.
+
+ `N'
+ A constant between -3 and 0 inclusive.
+
+ `O'
+ A constant between 1 and 4 inclusive.
+
+ `P'
+ A constant between -4 and -1 inclusive.
+
+ `Q'
+ A memory reference that is a stack push.
+
+ `R'
+ A memory reference that is a stack pop.
+
+ `S'
+ A memory reference that refers to a constant address of known
+ value.
+
+ `T'
+ The register indicated by Rx (not implemented yet).
+
+ `U'
+ A constant that is not between 2 and 15 inclusive.
+
+ `Z'
+ The constant 0.
+
+
+_Xtensa--`config/xtensa/constraints.md'_
+
+ `a'
+ General-purpose 32-bit register
+
+ `b'
+ One-bit boolean register
+
+ `A'
+ MAC16 40-bit accumulator register
+
+ `I'
+ Signed 12-bit integer constant, for use in MOVI instructions
+
+ `J'
+ Signed 8-bit integer constant, for use in ADDI instructions
+
+ `K'
+ Integer constant valid for BccI instructions
+
+ `L'
+ Unsigned constant valid for BccUI instructions
+
+
+
+
+File: gcc.info, Node: Asm Labels, Next: Explicit Reg Vars, Prev: Constraints, Up: C Extensions
+
+5.39 Controlling Names Used in Assembler Code
+=============================================
+
+You can specify the name to be used in the assembler code for a C
+function or variable by writing the `asm' (or `__asm__') keyword after
+the declarator as follows:
+
+ int foo asm ("myfoo") = 2;
+
+This specifies that the name to be used for the variable `foo' in the
+assembler code should be `myfoo' rather than the usual `_foo'.
+
+ On systems where an underscore is normally prepended to the name of a C
+function or variable, this feature allows you to define names for the
+linker that do not start with an underscore.
+
+ It does not make sense to use this feature with a non-static local
+variable since such variables do not have assembler names. If you are
+trying to put the variable in a particular register, see *Note Explicit
+Reg Vars::. GCC presently accepts such code with a warning, but will
+probably be changed to issue an error, rather than a warning, in the
+future.
+
+ You cannot use `asm' in this way in a function _definition_; but you
+can get the same effect by writing a declaration for the function
+before its definition and putting `asm' there, like this:
+
+ extern func () asm ("FUNC");
+
+ func (x, y)
+ int x, y;
+ /* ... */
+
+ It is up to you to make sure that the assembler names you choose do not
+conflict with any other assembler symbols. Also, you must not use a
+register name; that would produce completely invalid assembler code.
+GCC does not as yet have the ability to store static variables in
+registers. Perhaps that will be added.
+
+
+File: gcc.info, Node: Explicit Reg Vars, Next: Alternate Keywords, Prev: Asm Labels, Up: C Extensions
+
+5.40 Variables in Specified Registers
+=====================================
+
+GNU C allows you to put a few global variables into specified hardware
+registers. You can also specify the register in which an ordinary
+register variable should be allocated.
+
+ * Global register variables reserve registers throughout the program.
+ This may be useful in programs such as programming language
+ interpreters which have a couple of global variables that are
+ accessed very often.
+
+ * Local register variables in specific registers do not reserve the
+ registers, except at the point where they are used as input or
+ output operands in an `asm' statement and the `asm' statement
+ itself is not deleted. The compiler's data flow analysis is
+ capable of determining where the specified registers contain live
+ values, and where they are available for other uses. Stores into
+ local register variables may be deleted when they appear to be
+ dead according to dataflow analysis. References to local register
+ variables may be deleted or moved or simplified.
+
+ These local variables are sometimes convenient for use with the
+ extended `asm' feature (*note Extended Asm::), if you want to
+ write one output of the assembler instruction directly into a
+ particular register. (This will work provided the register you
+ specify fits the constraints specified for that operand in the
+ `asm'.)
+
+* Menu:
+
+* Global Reg Vars::
+* Local Reg Vars::
+
+
+File: gcc.info, Node: Global Reg Vars, Next: Local Reg Vars, Up: Explicit Reg Vars
+
+5.40.1 Defining Global Register Variables
+-----------------------------------------
+
+You can define a global register variable in GNU C like this:
+
+ register int *foo asm ("a5");
+
+Here `a5' is the name of the register which should be used. Choose a
+register which is normally saved and restored by function calls on your
+machine, so that library routines will not clobber it.
+
+ Naturally the register name is cpu-dependent, so you would need to
+conditionalize your program according to cpu type. The register `a5'
+would be a good choice on a 68000 for a variable of pointer type. On
+machines with register windows, be sure to choose a "global" register
+that is not affected magically by the function call mechanism.
+
+ In addition, operating systems on one type of cpu may differ in how
+they name the registers; then you would need additional conditionals.
+For example, some 68000 operating systems call this register `%a5'.
+
+ Eventually there may be a way of asking the compiler to choose a
+register automatically, but first we need to figure out how it should
+choose and how to enable you to guide the choice. No solution is
+evident.
+
+ Defining a global register variable in a certain register reserves that
+register entirely for this use, at least within the current compilation.
+The register will not be allocated for any other purpose in the
+functions in the current compilation. The register will not be saved
+and restored by these functions. Stores into this register are never
+deleted even if they would appear to be dead, but references may be
+deleted or moved or simplified.
+
+ It is not safe to access the global register variables from signal
+handlers, or from more than one thread of control, because the system
+library routines may temporarily use the register for other things
+(unless you recompile them specially for the task at hand).
+
+ It is not safe for one function that uses a global register variable to
+call another such function `foo' by way of a third function `lose' that
+was compiled without knowledge of this variable (i.e. in a different
+source file in which the variable wasn't declared). This is because
+`lose' might save the register and put some other value there. For
+example, you can't expect a global register variable to be available in
+the comparison-function that you pass to `qsort', since `qsort' might
+have put something else in that register. (If you are prepared to
+recompile `qsort' with the same global register variable, you can solve
+this problem.)
+
+ If you want to recompile `qsort' or other source files which do not
+actually use your global register variable, so that they will not use
+that register for any other purpose, then it suffices to specify the
+compiler option `-ffixed-REG'. You need not actually add a global
+register declaration to their source code.
+
+ A function which can alter the value of a global register variable
+cannot safely be called from a function compiled without this variable,
+because it could clobber the value the caller expects to find there on
+return. Therefore, the function which is the entry point into the part
+of the program that uses the global register variable must explicitly
+save and restore the value which belongs to its caller.
+
+ On most machines, `longjmp' will restore to each global register
+variable the value it had at the time of the `setjmp'. On some
+machines, however, `longjmp' will not change the value of global
+register variables. To be portable, the function that called `setjmp'
+should make other arrangements to save the values of the global register
+variables, and to restore them in a `longjmp'. This way, the same
+thing will happen regardless of what `longjmp' does.
+
+ All global register variable declarations must precede all function
+definitions. If such a declaration could appear after function
+definitions, the declaration would be too late to prevent the register
+from being used for other purposes in the preceding functions.
+
+ Global register variables may not have initial values, because an
+executable file has no means to supply initial contents for a register.
+
+ On the SPARC, there are reports that g3 ... g7 are suitable registers,
+but certain library functions, such as `getwd', as well as the
+subroutines for division and remainder, modify g3 and g4. g1 and g2
+are local temporaries.
+
+ On the 68000, a2 ... a5 should be suitable, as should d2 ... d7. Of
+course, it will not do to use more than a few of those.
+
+
+File: gcc.info, Node: Local Reg Vars, Prev: Global Reg Vars, Up: Explicit Reg Vars
+
+5.40.2 Specifying Registers for Local Variables
+-----------------------------------------------
+
+You can define a local register variable with a specified register like
+this:
+
+ register int *foo asm ("a5");
+
+Here `a5' is the name of the register which should be used. Note that
+this is the same syntax used for defining global register variables,
+but for a local variable it would appear within a function.
+
+ Naturally the register name is cpu-dependent, but this is not a
+problem, since specific registers are most often useful with explicit
+assembler instructions (*note Extended Asm::). Both of these things
+generally require that you conditionalize your program according to cpu
+type.
+
+ In addition, operating systems on one type of cpu may differ in how
+they name the registers; then you would need additional conditionals.
+For example, some 68000 operating systems call this register `%a5'.
+
+ Defining such a register variable does not reserve the register; it
+remains available for other uses in places where flow control determines
+the variable's value is not live.
+
+ This option does not guarantee that GCC will generate code that has
+this variable in the register you specify at all times. You may not
+code an explicit reference to this register in the _assembler
+instruction template_ part of an `asm' statement and assume it will
+always refer to this variable. However, using the variable as an `asm'
+_operand_ guarantees that the specified register is used for the
+operand.
+
+ Stores into local register variables may be deleted when they appear
+to be dead according to dataflow analysis. References to local
+register variables may be deleted or moved or simplified.
+
+ As for global register variables, it's recommended that you choose a
+register which is normally saved and restored by function calls on your
+machine, so that library routines will not clobber it. A common
+pitfall is to initialize multiple call-clobbered registers with
+arbitrary expressions, where a function call or library call for an
+arithmetic operator will overwrite a register value from a previous
+assignment, for example `r0' below:
+ register int *p1 asm ("r0") = ...;
+ register int *p2 asm ("r1") = ...;
+ In those cases, a solution is to use a temporary variable for each
+arbitrary expression. *Note Example of asm with clobbered asm reg::.
+
+
+File: gcc.info, Node: Alternate Keywords, Next: Incomplete Enums, Prev: Explicit Reg Vars, Up: C Extensions
+
+5.41 Alternate Keywords
+=======================
+
+`-ansi' and the various `-std' options disable certain keywords. This
+causes trouble when you want to use GNU C extensions, or a
+general-purpose header file that should be usable by all programs,
+including ISO C programs. The keywords `asm', `typeof' and `inline'
+are not available in programs compiled with `-ansi' or `-std' (although
+`inline' can be used in a program compiled with `-std=c99'). The ISO
+C99 keyword `restrict' is only available when `-std=gnu99' (which will
+eventually be the default) or `-std=c99' (or the equivalent
+`-std=iso9899:1999') is used.
+
+ The way to solve these problems is to put `__' at the beginning and
+end of each problematical keyword. For example, use `__asm__' instead
+of `asm', and `__inline__' instead of `inline'.
+
+ Other C compilers won't accept these alternative keywords; if you want
+to compile with another compiler, you can define the alternate keywords
+as macros to replace them with the customary keywords. It looks like
+this:
+
+ #ifndef __GNUC__
+ #define __asm__ asm
+ #endif
+
+ `-pedantic' and other options cause warnings for many GNU C extensions.
+You can prevent such warnings within one expression by writing
+`__extension__' before the expression. `__extension__' has no effect
+aside from this.
+
+
+File: gcc.info, Node: Incomplete Enums, Next: Function Names, Prev: Alternate Keywords, Up: C Extensions
+
+5.42 Incomplete `enum' Types
+============================
+
+You can define an `enum' tag without specifying its possible values.
+This results in an incomplete type, much like what you get if you write
+`struct foo' without describing the elements. A later declaration
+which does specify the possible values completes the type.
+
+ You can't allocate variables or storage using the type while it is
+incomplete. However, you can work with pointers to that type.
+
+ This extension may not be very useful, but it makes the handling of
+`enum' more consistent with the way `struct' and `union' are handled.
+
+ This extension is not supported by GNU C++.
+
+
+File: gcc.info, Node: Function Names, Next: Return Address, Prev: Incomplete Enums, Up: C Extensions
+
+5.43 Function Names as Strings
+==============================
+
+GCC provides three magic variables which hold the name of the current
+function, as a string. The first of these is `__func__', which is part
+of the C99 standard:
+
+ The identifier `__func__' is implicitly declared by the translator as
+if, immediately following the opening brace of each function
+definition, the declaration
+
+ static const char __func__[] = "function-name";
+
+appeared, where function-name is the name of the lexically-enclosing
+function. This name is the unadorned name of the function.
+
+ `__FUNCTION__' is another name for `__func__'. Older versions of GCC
+recognize only this name. However, it is not standardized. For
+maximum portability, we recommend you use `__func__', but provide a
+fallback definition with the preprocessor:
+
+ #if __STDC_VERSION__ < 199901L
+ # if __GNUC__ >= 2
+ # define __func__ __FUNCTION__
+ # else
+ # define __func__ "<unknown>"
+ # endif
+ #endif
+
+ In C, `__PRETTY_FUNCTION__' is yet another name for `__func__'.
+However, in C++, `__PRETTY_FUNCTION__' contains the type signature of
+the function as well as its bare name. For example, this program:
+
+ extern "C" {
+ extern int printf (char *, ...);
+ }
+
+ class a {
+ public:
+ void sub (int i)
+ {
+ printf ("__FUNCTION__ = %s\n", __FUNCTION__);
+ printf ("__PRETTY_FUNCTION__ = %s\n", __PRETTY_FUNCTION__);
+ }
+ };
+
+ int
+ main (void)
+ {
+ a ax;
+ ax.sub (0);
+ return 0;
+ }
+
+gives this output:
+
+ __FUNCTION__ = sub
+ __PRETTY_FUNCTION__ = void a::sub(int)
+
+ These identifiers are not preprocessor macros. In GCC 3.3 and
+earlier, in C only, `__FUNCTION__' and `__PRETTY_FUNCTION__' were
+treated as string literals; they could be used to initialize `char'
+arrays, and they could be concatenated with other string literals. GCC
+3.4 and later treat them as variables, like `__func__'. In C++,
+`__FUNCTION__' and `__PRETTY_FUNCTION__' have always been variables.
+
+
+File: gcc.info, Node: Return Address, Next: Vector Extensions, Prev: Function Names, Up: C Extensions
+
+5.44 Getting the Return or Frame Address of a Function
+======================================================
+
+These functions may be used to get information about the callers of a
+function.
+
+ -- Built-in Function: void * __builtin_return_address (unsigned int
+ LEVEL)
+ This function returns the return address of the current function,
+ or of one of its callers. The LEVEL argument is number of frames
+ to scan up the call stack. A value of `0' yields the return
+ address of the current function, a value of `1' yields the return
+ address of the caller of the current function, and so forth. When
+ inlining the expected behavior is that the function will return
+ the address of the function that will be returned to. To work
+ around this behavior use the `noinline' function attribute.
+
+ The LEVEL argument must be a constant integer.
+
+ On some machines it may be impossible to determine the return
+ address of any function other than the current one; in such cases,
+ or when the top of the stack has been reached, this function will
+ return `0' or a random value. In addition,
+ `__builtin_frame_address' may be used to determine if the top of
+ the stack has been reached.
+
+ This function should only be used with a nonzero argument for
+ debugging purposes.
+
+ -- Built-in Function: void * __builtin_frame_address (unsigned int
+ LEVEL)
+ This function is similar to `__builtin_return_address', but it
+ returns the address of the function frame rather than the return
+ address of the function. Calling `__builtin_frame_address' with a
+ value of `0' yields the frame address of the current function, a
+ value of `1' yields the frame address of the caller of the current
+ function, and so forth.
+
+ The frame is the area on the stack which holds local variables and
+ saved registers. The frame address is normally the address of the
+ first word pushed on to the stack by the function. However, the
+ exact definition depends upon the processor and the calling
+ convention. If the processor has a dedicated frame pointer
+ register, and the function has a frame, then
+ `__builtin_frame_address' will return the value of the frame
+ pointer register.
+
+ On some machines it may be impossible to determine the frame
+ address of any function other than the current one; in such cases,
+ or when the top of the stack has been reached, this function will
+ return `0' if the first frame pointer is properly initialized by
+ the startup code.
+
+ This function should only be used with a nonzero argument for
+ debugging purposes.
+
+
+File: gcc.info, Node: Vector Extensions, Next: Offsetof, Prev: Return Address, Up: C Extensions
+
+5.45 Using vector instructions through built-in functions
+=========================================================
+
+On some targets, the instruction set contains SIMD vector instructions
+that operate on multiple values contained in one large register at the
+same time. For example, on the i386 the MMX, 3Dnow! and SSE extensions
+can be used this way.
+
+ The first step in using these extensions is to provide the necessary
+data types. This should be done using an appropriate `typedef':
+
+ typedef int v4si __attribute__ ((vector_size (16)));
+
+ The `int' type specifies the base type, while the attribute specifies
+the vector size for the variable, measured in bytes. For example, the
+declaration above causes the compiler to set the mode for the `v4si'
+type to be 16 bytes wide and divided into `int' sized units. For a
+32-bit `int' this means a vector of 4 units of 4 bytes, and the
+corresponding mode of `foo' will be V4SI.
+
+ The `vector_size' attribute is only applicable to integral and float
+scalars, although arrays, pointers, and function return values are
+allowed in conjunction with this construct.
+
+ All the basic integer types can be used as base types, both as signed
+and as unsigned: `char', `short', `int', `long', `long long'. In
+addition, `float' and `double' can be used to build floating-point
+vector types.
+
+ Specifying a combination that is not valid for the current architecture
+will cause GCC to synthesize the instructions using a narrower mode.
+For example, if you specify a variable of type `V4SI' and your
+architecture does not allow for this specific SIMD type, GCC will
+produce code that uses 4 `SIs'.
+
+ The types defined in this manner can be used with a subset of normal C
+operations. Currently, GCC will allow using the following operators on
+these types: `+, -, *, /, unary minus, ^, |, &, ~'.
+
+ The operations behave like C++ `valarrays'. Addition is defined as
+the addition of the corresponding elements of the operands. For
+example, in the code below, each of the 4 elements in A will be added
+to the corresponding 4 elements in B and the resulting vector will be
+stored in C.
+
+ typedef int v4si __attribute__ ((vector_size (16)));
+
+ v4si a, b, c;
+
+ c = a + b;
+
+ Subtraction, multiplication, division, and the logical operations
+operate in a similar manner. Likewise, the result of using the unary
+minus or complement operators on a vector type is a vector whose
+elements are the negative or complemented values of the corresponding
+elements in the operand.
+
+ You can declare variables and use them in function calls and returns,
+as well as in assignments and some casts. You can specify a vector
+type as a return type for a function. Vector types can also be used as
+function arguments. It is possible to cast from one vector type to
+another, provided they are of the same size (in fact, you can also cast
+vectors to and from other datatypes of the same size).
+
+ You cannot operate between vectors of different lengths or different
+signedness without a cast.
+
+ A port that supports hardware vector operations, usually provides a set
+of built-in functions that can be used to operate on vectors. For
+example, a function to add two vectors and multiply the result by a
+third could look like this:
+
+ v4si f (v4si a, v4si b, v4si c)
+ {
+ v4si tmp = __builtin_addv4si (a, b);
+ return __builtin_mulv4si (tmp, c);
+ }
+
+
+File: gcc.info, Node: Offsetof, Next: Atomic Builtins, Prev: Vector Extensions, Up: C Extensions
+
+5.46 Offsetof
+=============
+
+GCC implements for both C and C++ a syntactic extension to implement
+the `offsetof' macro.
+
+ primary:
+ "__builtin_offsetof" "(" `typename' "," offsetof_member_designator ")"
+
+ offsetof_member_designator:
+ `identifier'
+ | offsetof_member_designator "." `identifier'
+ | offsetof_member_designator "[" `expr' "]"
+
+ This extension is sufficient such that
+
+ #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
+
+ is a suitable definition of the `offsetof' macro. In C++, TYPE may be
+dependent. In either case, MEMBER may consist of a single identifier,
+or a sequence of member accesses and array references.
+
+
+File: gcc.info, Node: Atomic Builtins, Next: Object Size Checking, Prev: Offsetof, Up: C Extensions
+
+5.47 Built-in functions for atomic memory access
+================================================
+
+The following builtins are intended to be compatible with those
+described in the `Intel Itanium Processor-specific Application Binary
+Interface', section 7.4. As such, they depart from the normal GCC
+practice of using the "__builtin_" prefix, and further that they are
+overloaded such that they work on multiple types.
+
+ The definition given in the Intel documentation allows only for the
+use of the types `int', `long', `long long' as well as their unsigned
+counterparts. GCC will allow any integral scalar or pointer type that
+is 1, 2, 4 or 8 bytes in length.
+
+ Not all operations are supported by all target processors. If a
+particular operation cannot be implemented on the target processor, a
+warning will be generated and a call an external function will be
+generated. The external function will carry the same name as the
+builtin, with an additional suffix `_N' where N is the size of the data
+type.
+
+ In most cases, these builtins are considered a "full barrier". That
+is, no memory operand will be moved across the operation, either
+forward or backward. Further, instructions will be issued as necessary
+to prevent the processor from speculating loads across the operation
+and from queuing stores after the operation.
+
+ All of the routines are described in the Intel documentation to take
+"an optional list of variables protected by the memory barrier". It's
+not clear what is meant by that; it could mean that _only_ the
+following variables are protected, or it could mean that these variables
+should in addition be protected. At present GCC ignores this list and
+protects all variables which are globally accessible. If in the future
+we make some use of this list, an empty list will continue to mean all
+globally accessible variables.
+
+`TYPE __sync_fetch_and_add (TYPE *ptr, TYPE value, ...)'
+`TYPE __sync_fetch_and_sub (TYPE *ptr, TYPE value, ...)'
+`TYPE __sync_fetch_and_or (TYPE *ptr, TYPE value, ...)'
+`TYPE __sync_fetch_and_and (TYPE *ptr, TYPE value, ...)'
+`TYPE __sync_fetch_and_xor (TYPE *ptr, TYPE value, ...)'
+`TYPE __sync_fetch_and_nand (TYPE *ptr, TYPE value, ...)'
+ These builtins perform the operation suggested by the name, and
+ returns the value that had previously been in memory. That is,
+
+ { tmp = *ptr; *ptr OP= value; return tmp; }
+ { tmp = *ptr; *ptr = ~(tmp & value); return tmp; } // nand
+
+ _Note:_ GCC 4.4 and later implement `__sync_fetch_and_nand'
+ builtin as `*ptr = ~(tmp & value)' instead of `*ptr = ~tmp &
+ value'.
+
+`TYPE __sync_add_and_fetch (TYPE *ptr, TYPE value, ...)'
+`TYPE __sync_sub_and_fetch (TYPE *ptr, TYPE value, ...)'
+`TYPE __sync_or_and_fetch (TYPE *ptr, TYPE value, ...)'
+`TYPE __sync_and_and_fetch (TYPE *ptr, TYPE value, ...)'
+`TYPE __sync_xor_and_fetch (TYPE *ptr, TYPE value, ...)'
+`TYPE __sync_nand_and_fetch (TYPE *ptr, TYPE value, ...)'
+ These builtins perform the operation suggested by the name, and
+ return the new value. That is,
+
+ { *ptr OP= value; return *ptr; }
+ { *ptr = ~(*ptr & value); return *ptr; } // nand
+
+ _Note:_ GCC 4.4 and later implement `__sync_nand_and_fetch'
+ builtin as `*ptr = ~(*ptr & value)' instead of `*ptr = ~*ptr &
+ value'.
+
+`bool __sync_bool_compare_and_swap (TYPE *ptr, TYPE oldval TYPE newval, ...)'
+`TYPE __sync_val_compare_and_swap (TYPE *ptr, TYPE oldval TYPE newval, ...)'
+ These builtins perform an atomic compare and swap. That is, if
+ the current value of `*PTR' is OLDVAL, then write NEWVAL into
+ `*PTR'.
+
+ The "bool" version returns true if the comparison is successful and
+ NEWVAL was written. The "val" version returns the contents of
+ `*PTR' before the operation.
+
+`__sync_synchronize (...)'
+ This builtin issues a full memory barrier.
+
+`TYPE __sync_lock_test_and_set (TYPE *ptr, TYPE value, ...)'
+ This builtin, as described by Intel, is not a traditional
+ test-and-set operation, but rather an atomic exchange operation.
+ It writes VALUE into `*PTR', and returns the previous contents of
+ `*PTR'.
+
+ Many targets have only minimal support for such locks, and do not
+ support a full exchange operation. In this case, a target may
+ support reduced functionality here by which the _only_ valid value
+ to store is the immediate constant 1. The exact value actually
+ stored in `*PTR' is implementation defined.
+
+ This builtin is not a full barrier, but rather an "acquire
+ barrier". This means that references after the builtin cannot
+ move to (or be speculated to) before the builtin, but previous
+ memory stores may not be globally visible yet, and previous memory
+ loads may not yet be satisfied.
+
+`void __sync_lock_release (TYPE *ptr, ...)'
+ This builtin releases the lock acquired by
+ `__sync_lock_test_and_set'. Normally this means writing the
+ constant 0 to `*PTR'.
+
+ This builtin is not a full barrier, but rather a "release barrier".
+ This means that all previous memory stores are globally visible,
+ and all previous memory loads have been satisfied, but following
+ memory reads are not prevented from being speculated to before the
+ barrier.
+
+
+File: gcc.info, Node: Object Size Checking, Next: Other Builtins, Prev: Atomic Builtins, Up: C Extensions
+
+5.48 Object Size Checking Builtins
+==================================
+
+GCC implements a limited buffer overflow protection mechanism that can
+prevent some buffer overflow attacks.
+
+ -- Built-in Function: size_t __builtin_object_size (void * PTR, int
+ TYPE)
+ is a built-in construct that returns a constant number of bytes
+ from PTR to the end of the object PTR pointer points to (if known
+ at compile time). `__builtin_object_size' never evaluates its
+ arguments for side-effects. If there are any side-effects in
+ them, it returns `(size_t) -1' for TYPE 0 or 1 and `(size_t) 0'
+ for TYPE 2 or 3. If there are multiple objects PTR can point to
+ and all of them are known at compile time, the returned number is
+ the maximum of remaining byte counts in those objects if TYPE & 2
+ is 0 and minimum if nonzero. If it is not possible to determine
+ which objects PTR points to at compile time,
+ `__builtin_object_size' should return `(size_t) -1' for TYPE 0 or
+ 1 and `(size_t) 0' for TYPE 2 or 3.
+
+ TYPE is an integer constant from 0 to 3. If the least significant
+ bit is clear, objects are whole variables, if it is set, a closest
+ surrounding subobject is considered the object a pointer points to.
+ The second bit determines if maximum or minimum of remaining bytes
+ is computed.
+
+ struct V { char buf1[10]; int b; char buf2[10]; } var;
+ char *p = &var.buf1[1], *q = &var.b;
+
+ /* Here the object p points to is var. */
+ assert (__builtin_object_size (p, 0) == sizeof (var) - 1);
+ /* The subobject p points to is var.buf1. */
+ assert (__builtin_object_size (p, 1) == sizeof (var.buf1) - 1);
+ /* The object q points to is var. */
+ assert (__builtin_object_size (q, 0)
+ == (char *) (&var + 1) - (char *) &var.b);
+ /* The subobject q points to is var.b. */
+ assert (__builtin_object_size (q, 1) == sizeof (var.b));
+
+ There are built-in functions added for many common string operation
+functions, e.g., for `memcpy' `__builtin___memcpy_chk' built-in is
+provided. This built-in has an additional last argument, which is the
+number of bytes remaining in object the DEST argument points to or
+`(size_t) -1' if the size is not known.
+
+ The built-in functions are optimized into the normal string functions
+like `memcpy' if the last argument is `(size_t) -1' or if it is known
+at compile time that the destination object will not be overflown. If
+the compiler can determine at compile time the object will be always
+overflown, it issues a warning.
+
+ The intended use can be e.g.
+
+ #undef memcpy
+ #define bos0(dest) __builtin_object_size (dest, 0)
+ #define memcpy(dest, src, n) \
+ __builtin___memcpy_chk (dest, src, n, bos0 (dest))
+
+ char *volatile p;
+ char buf[10];
+ /* It is unknown what object p points to, so this is optimized
+ into plain memcpy - no checking is possible. */
+ memcpy (p, "abcde", n);
+ /* Destination is known and length too. It is known at compile
+ time there will be no overflow. */
+ memcpy (&buf[5], "abcde", 5);
+ /* Destination is known, but the length is not known at compile time.
+ This will result in __memcpy_chk call that can check for overflow
+ at runtime. */
+ memcpy (&buf[5], "abcde", n);
+ /* Destination is known and it is known at compile time there will
+ be overflow. There will be a warning and __memcpy_chk call that
+ will abort the program at runtime. */
+ memcpy (&buf[6], "abcde", 5);
+
+ Such built-in functions are provided for `memcpy', `mempcpy',
+`memmove', `memset', `strcpy', `stpcpy', `strncpy', `strcat' and
+`strncat'.
+
+ There are also checking built-in functions for formatted output
+functions.
+ int __builtin___sprintf_chk (char *s, int flag, size_t os, const char *fmt, ...);
+ int __builtin___snprintf_chk (char *s, size_t maxlen, int flag, size_t os,
+ const char *fmt, ...);
+ int __builtin___vsprintf_chk (char *s, int flag, size_t os, const char *fmt,
+ va_list ap);
+ int __builtin___vsnprintf_chk (char *s, size_t maxlen, int flag, size_t os,
+ const char *fmt, va_list ap);
+
+ The added FLAG argument is passed unchanged to `__sprintf_chk' etc.
+functions and can contain implementation specific flags on what
+additional security measures the checking function might take, such as
+handling `%n' differently.
+
+ The OS argument is the object size S points to, like in the other
+built-in functions. There is a small difference in the behavior
+though, if OS is `(size_t) -1', the built-in functions are optimized
+into the non-checking functions only if FLAG is 0, otherwise the
+checking function is called with OS argument set to `(size_t) -1'.
+
+ In addition to this, there are checking built-in functions
+`__builtin___printf_chk', `__builtin___vprintf_chk',
+`__builtin___fprintf_chk' and `__builtin___vfprintf_chk'. These have
+just one additional argument, FLAG, right before format string FMT. If
+the compiler is able to optimize them to `fputc' etc. functions, it
+will, otherwise the checking function should be called and the FLAG
+argument passed to it.
+
+
+File: gcc.info, Node: Other Builtins, Next: Target Builtins, Prev: Object Size Checking, Up: C Extensions
+
+5.49 Other built-in functions provided by GCC
+=============================================
+
+GCC provides a large number of built-in functions other than the ones
+mentioned above. Some of these are for internal use in the processing
+of exceptions or variable-length argument lists and will not be
+documented here because they may change from time to time; we do not
+recommend general use of these functions.
+
+ The remaining functions are provided for optimization purposes.
+
+ GCC includes built-in versions of many of the functions in the standard
+C library. The versions prefixed with `__builtin_' will always be
+treated as having the same meaning as the C library function even if you
+specify the `-fno-builtin' option. (*note C Dialect Options::) Many of
+these functions are only optimized in certain cases; if they are not
+optimized in a particular case, a call to the library function will be
+emitted.
+
+ Outside strict ISO C mode (`-ansi', `-std=c89' or `-std=c99'), the
+functions `_exit', `alloca', `bcmp', `bzero', `dcgettext', `dgettext',
+`dremf', `dreml', `drem', `exp10f', `exp10l', `exp10', `ffsll', `ffsl',
+`ffs', `fprintf_unlocked', `fputs_unlocked', `gammaf', `gammal',
+`gamma', `gammaf_r', `gammal_r', `gamma_r', `gettext', `index',
+`isascii', `j0f', `j0l', `j0', `j1f', `j1l', `j1', `jnf', `jnl', `jn',
+`lgammaf_r', `lgammal_r', `lgamma_r', `mempcpy', `pow10f', `pow10l',
+`pow10', `printf_unlocked', `rindex', `scalbf', `scalbl', `scalb',
+`signbit', `signbitf', `signbitl', `signbitd32', `signbitd64',
+`signbitd128', `significandf', `significandl', `significand', `sincosf',
+`sincosl', `sincos', `stpcpy', `stpncpy', `strcasecmp', `strdup',
+`strfmon', `strncasecmp', `strndup', `toascii', `y0f', `y0l', `y0',
+`y1f', `y1l', `y1', `ynf', `ynl' and `yn' may be handled as built-in
+functions. All these functions have corresponding versions prefixed
+with `__builtin_', which may be used even in strict C89 mode.
+
+ The ISO C99 functions `_Exit', `acoshf', `acoshl', `acosh', `asinhf',
+`asinhl', `asinh', `atanhf', `atanhl', `atanh', `cabsf', `cabsl',
+`cabs', `cacosf', `cacoshf', `cacoshl', `cacosh', `cacosl', `cacos',
+`cargf', `cargl', `carg', `casinf', `casinhf', `casinhl', `casinh',
+`casinl', `casin', `catanf', `catanhf', `catanhl', `catanh', `catanl',
+`catan', `cbrtf', `cbrtl', `cbrt', `ccosf', `ccoshf', `ccoshl',
+`ccosh', `ccosl', `ccos', `cexpf', `cexpl', `cexp', `cimagf', `cimagl',
+`cimag', `clogf', `clogl', `clog', `conjf', `conjl', `conj',
+`copysignf', `copysignl', `copysign', `cpowf', `cpowl', `cpow',
+`cprojf', `cprojl', `cproj', `crealf', `creall', `creal', `csinf',
+`csinhf', `csinhl', `csinh', `csinl', `csin', `csqrtf', `csqrtl',
+`csqrt', `ctanf', `ctanhf', `ctanhl', `ctanh', `ctanl', `ctan',
+`erfcf', `erfcl', `erfc', `erff', `erfl', `erf', `exp2f', `exp2l',
+`exp2', `expm1f', `expm1l', `expm1', `fdimf', `fdiml', `fdim', `fmaf',
+`fmal', `fmaxf', `fmaxl', `fmax', `fma', `fminf', `fminl', `fmin',
+`hypotf', `hypotl', `hypot', `ilogbf', `ilogbl', `ilogb', `imaxabs',
+`isblank', `iswblank', `lgammaf', `lgammal', `lgamma', `llabs',
+`llrintf', `llrintl', `llrint', `llroundf', `llroundl', `llround',
+`log1pf', `log1pl', `log1p', `log2f', `log2l', `log2', `logbf',
+`logbl', `logb', `lrintf', `lrintl', `lrint', `lroundf', `lroundl',
+`lround', `nearbyintf', `nearbyintl', `nearbyint', `nextafterf',
+`nextafterl', `nextafter', `nexttowardf', `nexttowardl', `nexttoward',
+`remainderf', `remainderl', `remainder', `remquof', `remquol',
+`remquo', `rintf', `rintl', `rint', `roundf', `roundl', `round',
+`scalblnf', `scalblnl', `scalbln', `scalbnf', `scalbnl', `scalbn',
+`snprintf', `tgammaf', `tgammal', `tgamma', `truncf', `truncl', `trunc',
+`vfscanf', `vscanf', `vsnprintf' and `vsscanf' are handled as built-in
+functions except in strict ISO C90 mode (`-ansi' or `-std=c89').
+
+ There are also built-in versions of the ISO C99 functions `acosf',
+`acosl', `asinf', `asinl', `atan2f', `atan2l', `atanf', `atanl',
+`ceilf', `ceill', `cosf', `coshf', `coshl', `cosl', `expf', `expl',
+`fabsf', `fabsl', `floorf', `floorl', `fmodf', `fmodl', `frexpf',
+`frexpl', `ldexpf', `ldexpl', `log10f', `log10l', `logf', `logl',
+`modfl', `modf', `powf', `powl', `sinf', `sinhf', `sinhl', `sinl',
+`sqrtf', `sqrtl', `tanf', `tanhf', `tanhl' and `tanl' that are
+recognized in any mode since ISO C90 reserves these names for the
+purpose to which ISO C99 puts them. All these functions have
+corresponding versions prefixed with `__builtin_'.
+
+ The ISO C94 functions `iswalnum', `iswalpha', `iswcntrl', `iswdigit',
+`iswgraph', `iswlower', `iswprint', `iswpunct', `iswspace', `iswupper',
+`iswxdigit', `towlower' and `towupper' are handled as built-in functions
+except in strict ISO C90 mode (`-ansi' or `-std=c89').
+
+ The ISO C90 functions `abort', `abs', `acos', `asin', `atan2', `atan',
+`calloc', `ceil', `cosh', `cos', `exit', `exp', `fabs', `floor', `fmod',
+`fprintf', `fputs', `frexp', `fscanf', `isalnum', `isalpha', `iscntrl',
+`isdigit', `isgraph', `islower', `isprint', `ispunct', `isspace',
+`isupper', `isxdigit', `tolower', `toupper', `labs', `ldexp', `log10',
+`log', `malloc', `memchr', `memcmp', `memcpy', `memset', `modf', `pow',
+`printf', `putchar', `puts', `scanf', `sinh', `sin', `snprintf',
+`sprintf', `sqrt', `sscanf', `strcat', `strchr', `strcmp', `strcpy',
+`strcspn', `strlen', `strncat', `strncmp', `strncpy', `strpbrk',
+`strrchr', `strspn', `strstr', `tanh', `tan', `vfprintf', `vprintf' and
+`vsprintf' are all recognized as built-in functions unless
+`-fno-builtin' is specified (or `-fno-builtin-FUNCTION' is specified
+for an individual function). All of these functions have corresponding
+versions prefixed with `__builtin_'.
+
+ GCC provides built-in versions of the ISO C99 floating point comparison
+macros that avoid raising exceptions for unordered operands. They have
+the same names as the standard macros ( `isgreater', `isgreaterequal',
+`isless', `islessequal', `islessgreater', and `isunordered') , with
+`__builtin_' prefixed. We intend for a library implementor to be able
+to simply `#define' each standard macro to its built-in equivalent. In
+the same fashion, GCC provides `fpclassify', `isfinite', `isinf_sign'
+and `isnormal' built-ins used with `__builtin_' prefixed. The `isinf'
+and `isnan' builtins appear both with and without the `__builtin_'
+prefix.
+
+ -- Built-in Function: int __builtin_types_compatible_p (TYPE1, TYPE2)
+ You can use the built-in function `__builtin_types_compatible_p' to
+ determine whether two types are the same.
+
+ This built-in function returns 1 if the unqualified versions of the
+ types TYPE1 and TYPE2 (which are types, not expressions) are
+ compatible, 0 otherwise. The result of this built-in function can
+ be used in integer constant expressions.
+
+ This built-in function ignores top level qualifiers (e.g., `const',
+ `volatile'). For example, `int' is equivalent to `const int'.
+
+ The type `int[]' and `int[5]' are compatible. On the other hand,
+ `int' and `char *' are not compatible, even if the size of their
+ types, on the particular architecture are the same. Also, the
+ amount of pointer indirection is taken into account when
+ determining similarity. Consequently, `short *' is not similar to
+ `short **'. Furthermore, two types that are typedefed are
+ considered compatible if their underlying types are compatible.
+
+ An `enum' type is not considered to be compatible with another
+ `enum' type even if both are compatible with the same integer
+ type; this is what the C standard specifies. For example, `enum
+ {foo, bar}' is not similar to `enum {hot, dog}'.
+
+ You would typically use this function in code whose execution
+ varies depending on the arguments' types. For example:
+
+ #define foo(x) \
+ ({ \
+ typeof (x) tmp = (x); \
+ if (__builtin_types_compatible_p (typeof (x), long double)) \
+ tmp = foo_long_double (tmp); \
+ else if (__builtin_types_compatible_p (typeof (x), double)) \
+ tmp = foo_double (tmp); \
+ else if (__builtin_types_compatible_p (typeof (x), float)) \
+ tmp = foo_float (tmp); \
+ else \
+ abort (); \
+ tmp; \
+ })
+
+ _Note:_ This construct is only available for C.
+
+
+ -- Built-in Function: TYPE __builtin_choose_expr (CONST_EXP, EXP1,
+ EXP2)
+ You can use the built-in function `__builtin_choose_expr' to
+ evaluate code depending on the value of a constant expression.
+ This built-in function returns EXP1 if CONST_EXP, which is a
+ constant expression that must be able to be determined at compile
+ time, is nonzero. Otherwise it returns 0.
+
+ This built-in function is analogous to the `? :' operator in C,
+ except that the expression returned has its type unaltered by
+ promotion rules. Also, the built-in function does not evaluate
+ the expression that was not chosen. For example, if CONST_EXP
+ evaluates to true, EXP2 is not evaluated even if it has
+ side-effects.
+
+ This built-in function can return an lvalue if the chosen argument
+ is an lvalue.
+
+ If EXP1 is returned, the return type is the same as EXP1's type.
+ Similarly, if EXP2 is returned, its return type is the same as
+ EXP2.
+
+ Example:
+
+ #define foo(x) \
+ __builtin_choose_expr ( \
+ __builtin_types_compatible_p (typeof (x), double), \
+ foo_double (x), \
+ __builtin_choose_expr ( \
+ __builtin_types_compatible_p (typeof (x), float), \
+ foo_float (x), \
+ /* The void expression results in a compile-time error \
+ when assigning the result to something. */ \
+ (void)0))
+
+ _Note:_ This construct is only available for C. Furthermore, the
+ unused expression (EXP1 or EXP2 depending on the value of
+ CONST_EXP) may still generate syntax errors. This may change in
+ future revisions.
+
+
+ -- Built-in Function: int __builtin_constant_p (EXP)
+ You can use the built-in function `__builtin_constant_p' to
+ determine if a value is known to be constant at compile-time and
+ hence that GCC can perform constant-folding on expressions
+ involving that value. The argument of the function is the value
+ to test. The function returns the integer 1 if the argument is
+ known to be a compile-time constant and 0 if it is not known to be
+ a compile-time constant. A return of 0 does not indicate that the
+ value is _not_ a constant, but merely that GCC cannot prove it is
+ a constant with the specified value of the `-O' option.
+
+ You would typically use this function in an embedded application
+ where memory was a critical resource. If you have some complex
+ calculation, you may want it to be folded if it involves
+ constants, but need to call a function if it does not. For
+ example:
+
+ #define Scale_Value(X) \
+ (__builtin_constant_p (X) \
+ ? ((X) * SCALE + OFFSET) : Scale (X))
+
+ You may use this built-in function in either a macro or an inline
+ function. However, if you use it in an inlined function and pass
+ an argument of the function as the argument to the built-in, GCC
+ will never return 1 when you call the inline function with a
+ string constant or compound literal (*note Compound Literals::)
+ and will not return 1 when you pass a constant numeric value to
+ the inline function unless you specify the `-O' option.
+
+ You may also use `__builtin_constant_p' in initializers for static
+ data. For instance, you can write
+
+ static const int table[] = {
+ __builtin_constant_p (EXPRESSION) ? (EXPRESSION) : -1,
+ /* ... */
+ };
+
+ This is an acceptable initializer even if EXPRESSION is not a
+ constant expression. GCC must be more conservative about
+ evaluating the built-in in this case, because it has no
+ opportunity to perform optimization.
+
+ Previous versions of GCC did not accept this built-in in data
+ initializers. The earliest version where it is completely safe is
+ 3.0.1.
+
+ -- Built-in Function: long __builtin_expect (long EXP, long C)
+ You may use `__builtin_expect' to provide the compiler with branch
+ prediction information. In general, you should prefer to use
+ actual profile feedback for this (`-fprofile-arcs'), as
+ programmers are notoriously bad at predicting how their programs
+ actually perform. However, there are applications in which this
+ data is hard to collect.
+
+ The return value is the value of EXP, which should be an integral
+ expression. The semantics of the built-in are that it is expected
+ that EXP == C. For example:
+
+ if (__builtin_expect (x, 0))
+ foo ();
+
+ would indicate that we do not expect to call `foo', since we
+ expect `x' to be zero. Since you are limited to integral
+ expressions for EXP, you should use constructions such as
+
+ if (__builtin_expect (ptr != NULL, 1))
+ error ();
+
+ when testing pointer or floating-point values.
+
+ -- Built-in Function: void __builtin_trap (void)
+ This function causes the program to exit abnormally. GCC
+ implements this function by using a target-dependent mechanism
+ (such as intentionally executing an illegal instruction) or by
+ calling `abort'. The mechanism used may vary from release to
+ release so you should not rely on any particular implementation.
+
+ -- Built-in Function: void __builtin___clear_cache (char *BEGIN, char
+ *END)
+ This function is used to flush the processor's instruction cache
+ for the region of memory between BEGIN inclusive and END
+ exclusive. Some targets require that the instruction cache be
+ flushed, after modifying memory containing code, in order to obtain
+ deterministic behavior.
+
+ If the target does not require instruction cache flushes,
+ `__builtin___clear_cache' has no effect. Otherwise either
+ instructions are emitted in-line to clear the instruction cache or
+ a call to the `__clear_cache' function in libgcc is made.
+
+ -- Built-in Function: void __builtin_prefetch (const void *ADDR, ...)
+ This function is used to minimize cache-miss latency by moving
+ data into a cache before it is accessed. You can insert calls to
+ `__builtin_prefetch' into code for which you know addresses of
+ data in memory that is likely to be accessed soon. If the target
+ supports them, data prefetch instructions will be generated. If
+ the prefetch is done early enough before the access then the data
+ will be in the cache by the time it is accessed.
+
+ The value of ADDR is the address of the memory to prefetch. There
+ are two optional arguments, RW and LOCALITY. The value of RW is a
+ compile-time constant one or zero; one means that the prefetch is
+ preparing for a write to the memory address and zero, the default,
+ means that the prefetch is preparing for a read. The value
+ LOCALITY must be a compile-time constant integer between zero and
+ three. A value of zero means that the data has no temporal
+ locality, so it need not be left in the cache after the access. A
+ value of three means that the data has a high degree of temporal
+ locality and should be left in all levels of cache possible.
+ Values of one and two mean, respectively, a low or moderate degree
+ of temporal locality. The default is three.
+
+ for (i = 0; i < n; i++)
+ {
+ a[i] = a[i] + b[i];
+ __builtin_prefetch (&a[i+j], 1, 1);
+ __builtin_prefetch (&b[i+j], 0, 1);
+ /* ... */
+ }
+
+ Data prefetch does not generate faults if ADDR is invalid, but the
+ address expression itself must be valid. For example, a prefetch
+ of `p->next' will not fault if `p->next' is not a valid address,
+ but evaluation will fault if `p' is not a valid address.
+
+ If the target does not support data prefetch, the address
+ expression is evaluated if it includes side effects but no other
+ code is generated and GCC does not issue a warning.
+
+ -- Built-in Function: double __builtin_huge_val (void)
+ Returns a positive infinity, if supported by the floating-point
+ format, else `DBL_MAX'. This function is suitable for
+ implementing the ISO C macro `HUGE_VAL'.
+
+ -- Built-in Function: float __builtin_huge_valf (void)
+ Similar to `__builtin_huge_val', except the return type is `float'.
+
+ -- Built-in Function: long double __builtin_huge_vall (void)
+ Similar to `__builtin_huge_val', except the return type is `long
+ double'.
+
+ -- Built-in Function: int __builtin_fpclassify (int, int, int, int,
+ int, ...)
+ This built-in implements the C99 fpclassify functionality. The
+ first five int arguments should be the target library's notion of
+ the possible FP classes and are used for return values. They must
+ be constant values and they must appear in this order: `FP_NAN',
+ `FP_INFINITE', `FP_NORMAL', `FP_SUBNORMAL' and `FP_ZERO'. The
+ ellipsis is for exactly one floating point value to classify. GCC
+ treats the last argument as type-generic, which means it does not
+ do default promotion from float to double.
+
+ -- Built-in Function: double __builtin_inf (void)
+ Similar to `__builtin_huge_val', except a warning is generated if
+ the target floating-point format does not support infinities.
+
+ -- Built-in Function: _Decimal32 __builtin_infd32 (void)
+ Similar to `__builtin_inf', except the return type is `_Decimal32'.
+
+ -- Built-in Function: _Decimal64 __builtin_infd64 (void)
+ Similar to `__builtin_inf', except the return type is `_Decimal64'.
+
+ -- Built-in Function: _Decimal128 __builtin_infd128 (void)
+ Similar to `__builtin_inf', except the return type is
+ `_Decimal128'.
+
+ -- Built-in Function: float __builtin_inff (void)
+ Similar to `__builtin_inf', except the return type is `float'.
+ This function is suitable for implementing the ISO C99 macro
+ `INFINITY'.
+
+ -- Built-in Function: long double __builtin_infl (void)
+ Similar to `__builtin_inf', except the return type is `long
+ double'.
+
+ -- Built-in Function: int __builtin_isinf_sign (...)
+ Similar to `isinf', except the return value will be negative for
+ an argument of `-Inf'. Note while the parameter list is an
+ ellipsis, this function only accepts exactly one floating point
+ argument. GCC treats this parameter as type-generic, which means
+ it does not do default promotion from float to double.
+
+ -- Built-in Function: double __builtin_nan (const char *str)
+ This is an implementation of the ISO C99 function `nan'.
+
+ Since ISO C99 defines this function in terms of `strtod', which we
+ do not implement, a description of the parsing is in order. The
+ string is parsed as by `strtol'; that is, the base is recognized by
+ leading `0' or `0x' prefixes. The number parsed is placed in the
+ significand such that the least significant bit of the number is
+ at the least significant bit of the significand. The number is
+ truncated to fit the significand field provided. The significand
+ is forced to be a quiet NaN.
+
+ This function, if given a string literal all of which would have
+ been consumed by strtol, is evaluated early enough that it is
+ considered a compile-time constant.
+
+ -- Built-in Function: _Decimal32 __builtin_nand32 (const char *str)
+ Similar to `__builtin_nan', except the return type is `_Decimal32'.
+
+ -- Built-in Function: _Decimal64 __builtin_nand64 (const char *str)
+ Similar to `__builtin_nan', except the return type is `_Decimal64'.
+
+ -- Built-in Function: _Decimal128 __builtin_nand128 (const char *str)
+ Similar to `__builtin_nan', except the return type is
+ `_Decimal128'.
+
+ -- Built-in Function: float __builtin_nanf (const char *str)
+ Similar to `__builtin_nan', except the return type is `float'.
+
+ -- Built-in Function: long double __builtin_nanl (const char *str)
+ Similar to `__builtin_nan', except the return type is `long
+ double'.
+
+ -- Built-in Function: double __builtin_nans (const char *str)
+ Similar to `__builtin_nan', except the significand is forced to be
+ a signaling NaN. The `nans' function is proposed by WG14 N965.
+
+ -- Built-in Function: float __builtin_nansf (const char *str)
+ Similar to `__builtin_nans', except the return type is `float'.
+
+ -- Built-in Function: long double __builtin_nansl (const char *str)
+ Similar to `__builtin_nans', except the return type is `long
+ double'.
+
+ -- Built-in Function: int __builtin_ffs (unsigned int x)
+ Returns one plus the index of the least significant 1-bit of X, or
+ if X is zero, returns zero.
+
+ -- Built-in Function: int __builtin_clz (unsigned int x)
+ Returns the number of leading 0-bits in X, starting at the most
+ significant bit position. If X is 0, the result is undefined.
+
+ -- Built-in Function: int __builtin_ctz (unsigned int x)
+ Returns the number of trailing 0-bits in X, starting at the least
+ significant bit position. If X is 0, the result is undefined.
+
+ -- Built-in Function: int __builtin_popcount (unsigned int x)
+ Returns the number of 1-bits in X.
+
+ -- Built-in Function: int __builtin_parity (unsigned int x)
+ Returns the parity of X, i.e. the number of 1-bits in X modulo 2.
+
+ -- Built-in Function: int __builtin_ffsl (unsigned long)
+ Similar to `__builtin_ffs', except the argument type is `unsigned
+ long'.
+
+ -- Built-in Function: int __builtin_clzl (unsigned long)
+ Similar to `__builtin_clz', except the argument type is `unsigned
+ long'.
+
+ -- Built-in Function: int __builtin_ctzl (unsigned long)
+ Similar to `__builtin_ctz', except the argument type is `unsigned
+ long'.
+
+ -- Built-in Function: int __builtin_popcountl (unsigned long)
+ Similar to `__builtin_popcount', except the argument type is
+ `unsigned long'.
+
+ -- Built-in Function: int __builtin_parityl (unsigned long)
+ Similar to `__builtin_parity', except the argument type is
+ `unsigned long'.
+
+ -- Built-in Function: int __builtin_ffsll (unsigned long long)
+ Similar to `__builtin_ffs', except the argument type is `unsigned
+ long long'.
+
+ -- Built-in Function: int __builtin_clzll (unsigned long long)
+ Similar to `__builtin_clz', except the argument type is `unsigned
+ long long'.
+
+ -- Built-in Function: int __builtin_ctzll (unsigned long long)
+ Similar to `__builtin_ctz', except the argument type is `unsigned
+ long long'.
+
+ -- Built-in Function: int __builtin_popcountll (unsigned long long)
+ Similar to `__builtin_popcount', except the argument type is
+ `unsigned long long'.
+
+ -- Built-in Function: int __builtin_parityll (unsigned long long)
+ Similar to `__builtin_parity', except the argument type is
+ `unsigned long long'.
+
+ -- Built-in Function: double __builtin_powi (double, int)
+ Returns the first argument raised to the power of the second.
+ Unlike the `pow' function no guarantees about precision and
+ rounding are made.
+
+ -- Built-in Function: float __builtin_powif (float, int)
+ Similar to `__builtin_powi', except the argument and return types
+ are `float'.
+
+ -- Built-in Function: long double __builtin_powil (long double, int)
+ Similar to `__builtin_powi', except the argument and return types
+ are `long double'.
+
+ -- Built-in Function: int32_t __builtin_bswap32 (int32_t x)
+ Returns X with the order of the bytes reversed; for example,
+ `0xaabbccdd' becomes `0xddccbbaa'. Byte here always means exactly
+ 8 bits.
+
+ -- Built-in Function: int64_t __builtin_bswap64 (int64_t x)
+ Similar to `__builtin_bswap32', except the argument and return
+ types are 64-bit.
+
+
+File: gcc.info, Node: Target Builtins, Next: Target Format Checks, Prev: Other Builtins, Up: C Extensions
+
+5.50 Built-in Functions Specific to Particular Target Machines
+==============================================================
+
+On some target machines, GCC supports many built-in functions specific
+to those machines. Generally these generate calls to specific machine
+instructions, but allow the compiler to schedule those calls.
+
+* Menu:
+
+* Alpha Built-in Functions::
+* ARM iWMMXt Built-in Functions::
+* ARM NEON Intrinsics::
+* Blackfin Built-in Functions::
+* FR-V Built-in Functions::
+* X86 Built-in Functions::
+* MIPS DSP Built-in Functions::
+* MIPS Paired-Single Support::
+* MIPS Loongson Built-in Functions::
+* Other MIPS Built-in Functions::
+* picoChip Built-in Functions::
+* PowerPC AltiVec Built-in Functions::
+* SPARC VIS Built-in Functions::
+* SPU Built-in Functions::
+
+
+File: gcc.info, Node: Alpha Built-in Functions, Next: ARM iWMMXt Built-in Functions, Up: Target Builtins
+
+5.50.1 Alpha Built-in Functions
+-------------------------------
+
+These built-in functions are available for the Alpha family of
+processors, depending on the command-line switches used.
+
+ The following built-in functions are always available. They all
+generate the machine instruction that is part of the name.
+
+ long __builtin_alpha_implver (void)
+ long __builtin_alpha_rpcc (void)
+ long __builtin_alpha_amask (long)
+ long __builtin_alpha_cmpbge (long, long)
+ long __builtin_alpha_extbl (long, long)
+ long __builtin_alpha_extwl (long, long)
+ long __builtin_alpha_extll (long, long)
+ long __builtin_alpha_extql (long, long)
+ long __builtin_alpha_extwh (long, long)
+ long __builtin_alpha_extlh (long, long)
+ long __builtin_alpha_extqh (long, long)
+ long __builtin_alpha_insbl (long, long)
+ long __builtin_alpha_inswl (long, long)
+ long __builtin_alpha_insll (long, long)
+ long __builtin_alpha_insql (long, long)
+ long __builtin_alpha_inswh (long, long)
+ long __builtin_alpha_inslh (long, long)
+ long __builtin_alpha_insqh (long, long)
+ long __builtin_alpha_mskbl (long, long)
+ long __builtin_alpha_mskwl (long, long)
+ long __builtin_alpha_mskll (long, long)
+ long __builtin_alpha_mskql (long, long)
+ long __builtin_alpha_mskwh (long, long)
+ long __builtin_alpha_msklh (long, long)
+ long __builtin_alpha_mskqh (long, long)
+ long __builtin_alpha_umulh (long, long)
+ long __builtin_alpha_zap (long, long)
+ long __builtin_alpha_zapnot (long, long)
+
+ The following built-in functions are always with `-mmax' or
+`-mcpu=CPU' where CPU is `pca56' or later. They all generate the
+machine instruction that is part of the name.
+
+ long __builtin_alpha_pklb (long)
+ long __builtin_alpha_pkwb (long)
+ long __builtin_alpha_unpkbl (long)
+ long __builtin_alpha_unpkbw (long)
+ long __builtin_alpha_minub8 (long, long)
+ long __builtin_alpha_minsb8 (long, long)
+ long __builtin_alpha_minuw4 (long, long)
+ long __builtin_alpha_minsw4 (long, long)
+ long __builtin_alpha_maxub8 (long, long)
+ long __builtin_alpha_maxsb8 (long, long)
+ long __builtin_alpha_maxuw4 (long, long)
+ long __builtin_alpha_maxsw4 (long, long)
+ long __builtin_alpha_perr (long, long)
+
+ The following built-in functions are always with `-mcix' or
+`-mcpu=CPU' where CPU is `ev67' or later. They all generate the
+machine instruction that is part of the name.
+
+ long __builtin_alpha_cttz (long)
+ long __builtin_alpha_ctlz (long)
+ long __builtin_alpha_ctpop (long)
+
+ The following builtins are available on systems that use the OSF/1
+PALcode. Normally they invoke the `rduniq' and `wruniq' PAL calls, but
+when invoked with `-mtls-kernel', they invoke `rdval' and `wrval'.
+
+ void *__builtin_thread_pointer (void)
+ void __builtin_set_thread_pointer (void *)
+
+
+File: gcc.info, Node: ARM iWMMXt Built-in Functions, Next: ARM NEON Intrinsics, Prev: Alpha Built-in Functions, Up: Target Builtins
+
+5.50.2 ARM iWMMXt Built-in Functions
+------------------------------------
+
+These built-in functions are available for the ARM family of processors
+when the `-mcpu=iwmmxt' switch is used:
+
+ typedef int v2si __attribute__ ((vector_size (8)));
+ typedef short v4hi __attribute__ ((vector_size (8)));
+ typedef char v8qi __attribute__ ((vector_size (8)));
+
+ int __builtin_arm_getwcx (int)
+ void __builtin_arm_setwcx (int, int)
+ int __builtin_arm_textrmsb (v8qi, int)
+ int __builtin_arm_textrmsh (v4hi, int)
+ int __builtin_arm_textrmsw (v2si, int)
+ int __builtin_arm_textrmub (v8qi, int)
+ int __builtin_arm_textrmuh (v4hi, int)
+ int __builtin_arm_textrmuw (v2si, int)
+ v8qi __builtin_arm_tinsrb (v8qi, int)
+ v4hi __builtin_arm_tinsrh (v4hi, int)
+ v2si __builtin_arm_tinsrw (v2si, int)
+ long long __builtin_arm_tmia (long long, int, int)
+ long long __builtin_arm_tmiabb (long long, int, int)
+ long long __builtin_arm_tmiabt (long long, int, int)
+ long long __builtin_arm_tmiaph (long long, int, int)
+ long long __builtin_arm_tmiatb (long long, int, int)
+ long long __builtin_arm_tmiatt (long long, int, int)
+ int __builtin_arm_tmovmskb (v8qi)
+ int __builtin_arm_tmovmskh (v4hi)
+ int __builtin_arm_tmovmskw (v2si)
+ long long __builtin_arm_waccb (v8qi)
+ long long __builtin_arm_wacch (v4hi)
+ long long __builtin_arm_waccw (v2si)
+ v8qi __builtin_arm_waddb (v8qi, v8qi)
+ v8qi __builtin_arm_waddbss (v8qi, v8qi)
+ v8qi __builtin_arm_waddbus (v8qi, v8qi)
+ v4hi __builtin_arm_waddh (v4hi, v4hi)
+ v4hi __builtin_arm_waddhss (v4hi, v4hi)
+ v4hi __builtin_arm_waddhus (v4hi, v4hi)
+ v2si __builtin_arm_waddw (v2si, v2si)
+ v2si __builtin_arm_waddwss (v2si, v2si)
+ v2si __builtin_arm_waddwus (v2si, v2si)
+ v8qi __builtin_arm_walign (v8qi, v8qi, int)
+ long long __builtin_arm_wand(long long, long long)
+ long long __builtin_arm_wandn (long long, long long)
+ v8qi __builtin_arm_wavg2b (v8qi, v8qi)
+ v8qi __builtin_arm_wavg2br (v8qi, v8qi)
+ v4hi __builtin_arm_wavg2h (v4hi, v4hi)
+ v4hi __builtin_arm_wavg2hr (v4hi, v4hi)
+ v8qi __builtin_arm_wcmpeqb (v8qi, v8qi)
+ v4hi __builtin_arm_wcmpeqh (v4hi, v4hi)
+ v2si __builtin_arm_wcmpeqw (v2si, v2si)
+ v8qi __builtin_arm_wcmpgtsb (v8qi, v8qi)
+ v4hi __builtin_arm_wcmpgtsh (v4hi, v4hi)
+ v2si __builtin_arm_wcmpgtsw (v2si, v2si)
+ v8qi __builtin_arm_wcmpgtub (v8qi, v8qi)
+ v4hi __builtin_arm_wcmpgtuh (v4hi, v4hi)
+ v2si __builtin_arm_wcmpgtuw (v2si, v2si)
+ long long __builtin_arm_wmacs (long long, v4hi, v4hi)
+ long long __builtin_arm_wmacsz (v4hi, v4hi)
+ long long __builtin_arm_wmacu (long long, v4hi, v4hi)
+ long long __builtin_arm_wmacuz (v4hi, v4hi)
+ v4hi __builtin_arm_wmadds (v4hi, v4hi)
+ v4hi __builtin_arm_wmaddu (v4hi, v4hi)
+ v8qi __builtin_arm_wmaxsb (v8qi, v8qi)
+ v4hi __builtin_arm_wmaxsh (v4hi, v4hi)
+ v2si __builtin_arm_wmaxsw (v2si, v2si)
+ v8qi __builtin_arm_wmaxub (v8qi, v8qi)
+ v4hi __builtin_arm_wmaxuh (v4hi, v4hi)
+ v2si __builtin_arm_wmaxuw (v2si, v2si)
+ v8qi __builtin_arm_wminsb (v8qi, v8qi)
+ v4hi __builtin_arm_wminsh (v4hi, v4hi)
+ v2si __builtin_arm_wminsw (v2si, v2si)
+ v8qi __builtin_arm_wminub (v8qi, v8qi)
+ v4hi __builtin_arm_wminuh (v4hi, v4hi)
+ v2si __builtin_arm_wminuw (v2si, v2si)
+ v4hi __builtin_arm_wmulsm (v4hi, v4hi)
+ v4hi __builtin_arm_wmulul (v4hi, v4hi)
+ v4hi __builtin_arm_wmulum (v4hi, v4hi)
+ long long __builtin_arm_wor (long long, long long)
+ v2si __builtin_arm_wpackdss (long long, long long)
+ v2si __builtin_arm_wpackdus (long long, long long)
+ v8qi __builtin_arm_wpackhss (v4hi, v4hi)
+ v8qi __builtin_arm_wpackhus (v4hi, v4hi)
+ v4hi __builtin_arm_wpackwss (v2si, v2si)
+ v4hi __builtin_arm_wpackwus (v2si, v2si)
+ long long __builtin_arm_wrord (long long, long long)
+ long long __builtin_arm_wrordi (long long, int)
+ v4hi __builtin_arm_wrorh (v4hi, long long)
+ v4hi __builtin_arm_wrorhi (v4hi, int)
+ v2si __builtin_arm_wrorw (v2si, long long)
+ v2si __builtin_arm_wrorwi (v2si, int)
+ v2si __builtin_arm_wsadb (v8qi, v8qi)
+ v2si __builtin_arm_wsadbz (v8qi, v8qi)
+ v2si __builtin_arm_wsadh (v4hi, v4hi)
+ v2si __builtin_arm_wsadhz (v4hi, v4hi)
+ v4hi __builtin_arm_wshufh (v4hi, int)
+ long long __builtin_arm_wslld (long long, long long)
+ long long __builtin_arm_wslldi (long long, int)
+ v4hi __builtin_arm_wsllh (v4hi, long long)
+ v4hi __builtin_arm_wsllhi (v4hi, int)
+ v2si __builtin_arm_wsllw (v2si, long long)
+ v2si __builtin_arm_wsllwi (v2si, int)
+ long long __builtin_arm_wsrad (long long, long long)
+ long long __builtin_arm_wsradi (long long, int)
+ v4hi __builtin_arm_wsrah (v4hi, long long)
+ v4hi __builtin_arm_wsrahi (v4hi, int)
+ v2si __builtin_arm_wsraw (v2si, long long)
+ v2si __builtin_arm_wsrawi (v2si, int)
+ long long __builtin_arm_wsrld (long long, long long)
+ long long __builtin_arm_wsrldi (long long, int)
+ v4hi __builtin_arm_wsrlh (v4hi, long long)
+ v4hi __builtin_arm_wsrlhi (v4hi, int)
+ v2si __builtin_arm_wsrlw (v2si, long long)
+ v2si __builtin_arm_wsrlwi (v2si, int)
+ v8qi __builtin_arm_wsubb (v8qi, v8qi)
+ v8qi __builtin_arm_wsubbss (v8qi, v8qi)
+ v8qi __builtin_arm_wsubbus (v8qi, v8qi)
+ v4hi __builtin_arm_wsubh (v4hi, v4hi)
+ v4hi __builtin_arm_wsubhss (v4hi, v4hi)
+ v4hi __builtin_arm_wsubhus (v4hi, v4hi)
+ v2si __builtin_arm_wsubw (v2si, v2si)
+ v2si __builtin_arm_wsubwss (v2si, v2si)
+ v2si __builtin_arm_wsubwus (v2si, v2si)
+ v4hi __builtin_arm_wunpckehsb (v8qi)
+ v2si __builtin_arm_wunpckehsh (v4hi)
+ long long __builtin_arm_wunpckehsw (v2si)
+ v4hi __builtin_arm_wunpckehub (v8qi)
+ v2si __builtin_arm_wunpckehuh (v4hi)
+ long long __builtin_arm_wunpckehuw (v2si)
+ v4hi __builtin_arm_wunpckelsb (v8qi)
+ v2si __builtin_arm_wunpckelsh (v4hi)
+ long long __builtin_arm_wunpckelsw (v2si)
+ v4hi __builtin_arm_wunpckelub (v8qi)
+ v2si __builtin_arm_wunpckeluh (v4hi)
+ long long __builtin_arm_wunpckeluw (v2si)
+ v8qi __builtin_arm_wunpckihb (v8qi, v8qi)
+ v4hi __builtin_arm_wunpckihh (v4hi, v4hi)
+ v2si __builtin_arm_wunpckihw (v2si, v2si)
+ v8qi __builtin_arm_wunpckilb (v8qi, v8qi)
+ v4hi __builtin_arm_wunpckilh (v4hi, v4hi)
+ v2si __builtin_arm_wunpckilw (v2si, v2si)
+ long long __builtin_arm_wxor (long long, long long)
+ long long __builtin_arm_wzero ()
+
+
+File: gcc.info, Node: ARM NEON Intrinsics, Next: Blackfin Built-in Functions, Prev: ARM iWMMXt Built-in Functions, Up: Target Builtins
+
+5.50.3 ARM NEON Intrinsics
+--------------------------
+
+These built-in intrinsics for the ARM Advanced SIMD extension are
+available when the `-mfpu=neon' switch is used:
+
+5.50.3.1 Addition
+.................
+
+ * uint32x2_t vadd_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vadd.i32 D0, D0, D0'
+
+ * uint16x4_t vadd_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vadd.i16 D0, D0, D0'
+
+ * uint8x8_t vadd_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vadd.i8 D0, D0, D0'
+
+ * int32x2_t vadd_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vadd.i32 D0, D0, D0'
+
+ * int16x4_t vadd_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vadd.i16 D0, D0, D0'
+
+ * int8x8_t vadd_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vadd.i8 D0, D0, D0'
+
+ * uint64x1_t vadd_u64 (uint64x1_t, uint64x1_t)
+ _Form of expected instruction(s):_ `vadd.i64 D0, D0, D0'
+
+ * int64x1_t vadd_s64 (int64x1_t, int64x1_t)
+ _Form of expected instruction(s):_ `vadd.i64 D0, D0, D0'
+
+ * float32x2_t vadd_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vadd.f32 D0, D0, D0'
+
+ * uint32x4_t vaddq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vadd.i32 Q0, Q0, Q0'
+
+ * uint16x8_t vaddq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vadd.i16 Q0, Q0, Q0'
+
+ * uint8x16_t vaddq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vadd.i8 Q0, Q0, Q0'
+
+ * int32x4_t vaddq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vadd.i32 Q0, Q0, Q0'
+
+ * int16x8_t vaddq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vadd.i16 Q0, Q0, Q0'
+
+ * int8x16_t vaddq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vadd.i8 Q0, Q0, Q0'
+
+ * uint64x2_t vaddq_u64 (uint64x2_t, uint64x2_t)
+ _Form of expected instruction(s):_ `vadd.i64 Q0, Q0, Q0'
+
+ * int64x2_t vaddq_s64 (int64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `vadd.i64 Q0, Q0, Q0'
+
+ * float32x4_t vaddq_f32 (float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vadd.f32 Q0, Q0, Q0'
+
+ * uint64x2_t vaddl_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vaddl.u32 Q0, D0, D0'
+
+ * uint32x4_t vaddl_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vaddl.u16 Q0, D0, D0'
+
+ * uint16x8_t vaddl_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vaddl.u8 Q0, D0, D0'
+
+ * int64x2_t vaddl_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vaddl.s32 Q0, D0, D0'
+
+ * int32x4_t vaddl_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vaddl.s16 Q0, D0, D0'
+
+ * int16x8_t vaddl_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vaddl.s8 Q0, D0, D0'
+
+ * uint64x2_t vaddw_u32 (uint64x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vaddw.u32 Q0, Q0, D0'
+
+ * uint32x4_t vaddw_u16 (uint32x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vaddw.u16 Q0, Q0, D0'
+
+ * uint16x8_t vaddw_u8 (uint16x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vaddw.u8 Q0, Q0, D0'
+
+ * int64x2_t vaddw_s32 (int64x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vaddw.s32 Q0, Q0, D0'
+
+ * int32x4_t vaddw_s16 (int32x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vaddw.s16 Q0, Q0, D0'
+
+ * int16x8_t vaddw_s8 (int16x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vaddw.s8 Q0, Q0, D0'
+
+ * uint32x2_t vhadd_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vhadd.u32 D0, D0, D0'
+
+ * uint16x4_t vhadd_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vhadd.u16 D0, D0, D0'
+
+ * uint8x8_t vhadd_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vhadd.u8 D0, D0, D0'
+
+ * int32x2_t vhadd_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vhadd.s32 D0, D0, D0'
+
+ * int16x4_t vhadd_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vhadd.s16 D0, D0, D0'
+
+ * int8x8_t vhadd_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vhadd.s8 D0, D0, D0'
+
+ * uint32x4_t vhaddq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vhadd.u32 Q0, Q0, Q0'
+
+ * uint16x8_t vhaddq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vhadd.u16 Q0, Q0, Q0'
+
+ * uint8x16_t vhaddq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vhadd.u8 Q0, Q0, Q0'
+
+ * int32x4_t vhaddq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vhadd.s32 Q0, Q0, Q0'
+
+ * int16x8_t vhaddq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vhadd.s16 Q0, Q0, Q0'
+
+ * int8x16_t vhaddq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vhadd.s8 Q0, Q0, Q0'
+
+ * uint32x2_t vrhadd_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vrhadd.u32 D0, D0, D0'
+
+ * uint16x4_t vrhadd_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vrhadd.u16 D0, D0, D0'
+
+ * uint8x8_t vrhadd_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vrhadd.u8 D0, D0, D0'
+
+ * int32x2_t vrhadd_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vrhadd.s32 D0, D0, D0'
+
+ * int16x4_t vrhadd_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vrhadd.s16 D0, D0, D0'
+
+ * int8x8_t vrhadd_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vrhadd.s8 D0, D0, D0'
+
+ * uint32x4_t vrhaddq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vrhadd.u32 Q0, Q0, Q0'
+
+ * uint16x8_t vrhaddq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vrhadd.u16 Q0, Q0, Q0'
+
+ * uint8x16_t vrhaddq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vrhadd.u8 Q0, Q0, Q0'
+
+ * int32x4_t vrhaddq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vrhadd.s32 Q0, Q0, Q0'
+
+ * int16x8_t vrhaddq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vrhadd.s16 Q0, Q0, Q0'
+
+ * int8x16_t vrhaddq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vrhadd.s8 Q0, Q0, Q0'
+
+ * uint32x2_t vqadd_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vqadd.u32 D0, D0, D0'
+
+ * uint16x4_t vqadd_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vqadd.u16 D0, D0, D0'
+
+ * uint8x8_t vqadd_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vqadd.u8 D0, D0, D0'
+
+ * int32x2_t vqadd_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vqadd.s32 D0, D0, D0'
+
+ * int16x4_t vqadd_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vqadd.s16 D0, D0, D0'
+
+ * int8x8_t vqadd_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vqadd.s8 D0, D0, D0'
+
+ * uint64x1_t vqadd_u64 (uint64x1_t, uint64x1_t)
+ _Form of expected instruction(s):_ `vqadd.u64 D0, D0, D0'
+
+ * int64x1_t vqadd_s64 (int64x1_t, int64x1_t)
+ _Form of expected instruction(s):_ `vqadd.s64 D0, D0, D0'
+
+ * uint32x4_t vqaddq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vqadd.u32 Q0, Q0, Q0'
+
+ * uint16x8_t vqaddq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vqadd.u16 Q0, Q0, Q0'
+
+ * uint8x16_t vqaddq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vqadd.u8 Q0, Q0, Q0'
+
+ * int32x4_t vqaddq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vqadd.s32 Q0, Q0, Q0'
+
+ * int16x8_t vqaddq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vqadd.s16 Q0, Q0, Q0'
+
+ * int8x16_t vqaddq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vqadd.s8 Q0, Q0, Q0'
+
+ * uint64x2_t vqaddq_u64 (uint64x2_t, uint64x2_t)
+ _Form of expected instruction(s):_ `vqadd.u64 Q0, Q0, Q0'
+
+ * int64x2_t vqaddq_s64 (int64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `vqadd.s64 Q0, Q0, Q0'
+
+ * uint32x2_t vaddhn_u64 (uint64x2_t, uint64x2_t)
+ _Form of expected instruction(s):_ `vaddhn.i64 D0, Q0, Q0'
+
+ * uint16x4_t vaddhn_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vaddhn.i32 D0, Q0, Q0'
+
+ * uint8x8_t vaddhn_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vaddhn.i16 D0, Q0, Q0'
+
+ * int32x2_t vaddhn_s64 (int64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `vaddhn.i64 D0, Q0, Q0'
+
+ * int16x4_t vaddhn_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vaddhn.i32 D0, Q0, Q0'
+
+ * int8x8_t vaddhn_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vaddhn.i16 D0, Q0, Q0'
+
+ * uint32x2_t vraddhn_u64 (uint64x2_t, uint64x2_t)
+ _Form of expected instruction(s):_ `vraddhn.i64 D0, Q0, Q0'
+
+ * uint16x4_t vraddhn_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vraddhn.i32 D0, Q0, Q0'
+
+ * uint8x8_t vraddhn_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vraddhn.i16 D0, Q0, Q0'
+
+ * int32x2_t vraddhn_s64 (int64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `vraddhn.i64 D0, Q0, Q0'
+
+ * int16x4_t vraddhn_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vraddhn.i32 D0, Q0, Q0'
+
+ * int8x8_t vraddhn_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vraddhn.i16 D0, Q0, Q0'
+
+5.50.3.2 Multiplication
+.......................
+
+ * uint32x2_t vmul_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vmul.i32 D0, D0, D0'
+
+ * uint16x4_t vmul_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vmul.i16 D0, D0, D0'
+
+ * uint8x8_t vmul_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vmul.i8 D0, D0, D0'
+
+ * int32x2_t vmul_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vmul.i32 D0, D0, D0'
+
+ * int16x4_t vmul_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vmul.i16 D0, D0, D0'
+
+ * int8x8_t vmul_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vmul.i8 D0, D0, D0'
+
+ * float32x2_t vmul_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vmul.f32 D0, D0, D0'
+
+ * poly8x8_t vmul_p8 (poly8x8_t, poly8x8_t)
+ _Form of expected instruction(s):_ `vmul.p8 D0, D0, D0'
+
+ * uint32x4_t vmulq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vmul.i32 Q0, Q0, Q0'
+
+ * uint16x8_t vmulq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vmul.i16 Q0, Q0, Q0'
+
+ * uint8x16_t vmulq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vmul.i8 Q0, Q0, Q0'
+
+ * int32x4_t vmulq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vmul.i32 Q0, Q0, Q0'
+
+ * int16x8_t vmulq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vmul.i16 Q0, Q0, Q0'
+
+ * int8x16_t vmulq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vmul.i8 Q0, Q0, Q0'
+
+ * float32x4_t vmulq_f32 (float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vmul.f32 Q0, Q0, Q0'
+
+ * poly8x16_t vmulq_p8 (poly8x16_t, poly8x16_t)
+ _Form of expected instruction(s):_ `vmul.p8 Q0, Q0, Q0'
+
+ * int32x2_t vqdmulh_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vqdmulh.s32 D0, D0, D0'
+
+ * int16x4_t vqdmulh_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vqdmulh.s16 D0, D0, D0'
+
+ * int32x4_t vqdmulhq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vqdmulh.s32 Q0, Q0, Q0'
+
+ * int16x8_t vqdmulhq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vqdmulh.s16 Q0, Q0, Q0'
+
+ * int32x2_t vqrdmulh_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vqrdmulh.s32 D0, D0, D0'
+
+ * int16x4_t vqrdmulh_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vqrdmulh.s16 D0, D0, D0'
+
+ * int32x4_t vqrdmulhq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vqrdmulh.s32 Q0, Q0, Q0'
+
+ * int16x8_t vqrdmulhq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vqrdmulh.s16 Q0, Q0, Q0'
+
+ * uint64x2_t vmull_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vmull.u32 Q0, D0, D0'
+
+ * uint32x4_t vmull_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vmull.u16 Q0, D0, D0'
+
+ * uint16x8_t vmull_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vmull.u8 Q0, D0, D0'
+
+ * int64x2_t vmull_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vmull.s32 Q0, D0, D0'
+
+ * int32x4_t vmull_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vmull.s16 Q0, D0, D0'
+
+ * int16x8_t vmull_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vmull.s8 Q0, D0, D0'
+
+ * poly16x8_t vmull_p8 (poly8x8_t, poly8x8_t)
+ _Form of expected instruction(s):_ `vmull.p8 Q0, D0, D0'
+
+ * int64x2_t vqdmull_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vqdmull.s32 Q0, D0, D0'
+
+ * int32x4_t vqdmull_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vqdmull.s16 Q0, D0, D0'
+
+5.50.3.3 Multiply-accumulate
+............................
+
+ * uint32x2_t vmla_u32 (uint32x2_t, uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vmla.i32 D0, D0, D0'
+
+ * uint16x4_t vmla_u16 (uint16x4_t, uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vmla.i16 D0, D0, D0'
+
+ * uint8x8_t vmla_u8 (uint8x8_t, uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vmla.i8 D0, D0, D0'
+
+ * int32x2_t vmla_s32 (int32x2_t, int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vmla.i32 D0, D0, D0'
+
+ * int16x4_t vmla_s16 (int16x4_t, int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vmla.i16 D0, D0, D0'
+
+ * int8x8_t vmla_s8 (int8x8_t, int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vmla.i8 D0, D0, D0'
+
+ * float32x2_t vmla_f32 (float32x2_t, float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vmla.f32 D0, D0, D0'
+
+ * uint32x4_t vmlaq_u32 (uint32x4_t, uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vmla.i32 Q0, Q0, Q0'
+
+ * uint16x8_t vmlaq_u16 (uint16x8_t, uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vmla.i16 Q0, Q0, Q0'
+
+ * uint8x16_t vmlaq_u8 (uint8x16_t, uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vmla.i8 Q0, Q0, Q0'
+
+ * int32x4_t vmlaq_s32 (int32x4_t, int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vmla.i32 Q0, Q0, Q0'
+
+ * int16x8_t vmlaq_s16 (int16x8_t, int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vmla.i16 Q0, Q0, Q0'
+
+ * int8x16_t vmlaq_s8 (int8x16_t, int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vmla.i8 Q0, Q0, Q0'
+
+ * float32x4_t vmlaq_f32 (float32x4_t, float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vmla.f32 Q0, Q0, Q0'
+
+ * uint64x2_t vmlal_u32 (uint64x2_t, uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vmlal.u32 Q0, D0, D0'
+
+ * uint32x4_t vmlal_u16 (uint32x4_t, uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vmlal.u16 Q0, D0, D0'
+
+ * uint16x8_t vmlal_u8 (uint16x8_t, uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vmlal.u8 Q0, D0, D0'
+
+ * int64x2_t vmlal_s32 (int64x2_t, int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vmlal.s32 Q0, D0, D0'
+
+ * int32x4_t vmlal_s16 (int32x4_t, int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vmlal.s16 Q0, D0, D0'
+
+ * int16x8_t vmlal_s8 (int16x8_t, int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vmlal.s8 Q0, D0, D0'
+
+ * int64x2_t vqdmlal_s32 (int64x2_t, int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vqdmlal.s32 Q0, D0, D0'
+
+ * int32x4_t vqdmlal_s16 (int32x4_t, int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vqdmlal.s16 Q0, D0, D0'
+
+5.50.3.4 Multiply-subtract
+..........................
+
+ * uint32x2_t vmls_u32 (uint32x2_t, uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vmls.i32 D0, D0, D0'
+
+ * uint16x4_t vmls_u16 (uint16x4_t, uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vmls.i16 D0, D0, D0'
+
+ * uint8x8_t vmls_u8 (uint8x8_t, uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vmls.i8 D0, D0, D0'
+
+ * int32x2_t vmls_s32 (int32x2_t, int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vmls.i32 D0, D0, D0'
+
+ * int16x4_t vmls_s16 (int16x4_t, int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vmls.i16 D0, D0, D0'
+
+ * int8x8_t vmls_s8 (int8x8_t, int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vmls.i8 D0, D0, D0'
+
+ * float32x2_t vmls_f32 (float32x2_t, float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vmls.f32 D0, D0, D0'
+
+ * uint32x4_t vmlsq_u32 (uint32x4_t, uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vmls.i32 Q0, Q0, Q0'
+
+ * uint16x8_t vmlsq_u16 (uint16x8_t, uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vmls.i16 Q0, Q0, Q0'
+
+ * uint8x16_t vmlsq_u8 (uint8x16_t, uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vmls.i8 Q0, Q0, Q0'
+
+ * int32x4_t vmlsq_s32 (int32x4_t, int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vmls.i32 Q0, Q0, Q0'
+
+ * int16x8_t vmlsq_s16 (int16x8_t, int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vmls.i16 Q0, Q0, Q0'
+
+ * int8x16_t vmlsq_s8 (int8x16_t, int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vmls.i8 Q0, Q0, Q0'
+
+ * float32x4_t vmlsq_f32 (float32x4_t, float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vmls.f32 Q0, Q0, Q0'
+
+ * uint64x2_t vmlsl_u32 (uint64x2_t, uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vmlsl.u32 Q0, D0, D0'
+
+ * uint32x4_t vmlsl_u16 (uint32x4_t, uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vmlsl.u16 Q0, D0, D0'
+
+ * uint16x8_t vmlsl_u8 (uint16x8_t, uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vmlsl.u8 Q0, D0, D0'
+
+ * int64x2_t vmlsl_s32 (int64x2_t, int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vmlsl.s32 Q0, D0, D0'
+
+ * int32x4_t vmlsl_s16 (int32x4_t, int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vmlsl.s16 Q0, D0, D0'
+
+ * int16x8_t vmlsl_s8 (int16x8_t, int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vmlsl.s8 Q0, D0, D0'
+
+ * int64x2_t vqdmlsl_s32 (int64x2_t, int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vqdmlsl.s32 Q0, D0, D0'
+
+ * int32x4_t vqdmlsl_s16 (int32x4_t, int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vqdmlsl.s16 Q0, D0, D0'
+
+5.50.3.5 Subtraction
+....................
+
+ * uint32x2_t vsub_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vsub.i32 D0, D0, D0'
+
+ * uint16x4_t vsub_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vsub.i16 D0, D0, D0'
+
+ * uint8x8_t vsub_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vsub.i8 D0, D0, D0'
+
+ * int32x2_t vsub_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vsub.i32 D0, D0, D0'
+
+ * int16x4_t vsub_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vsub.i16 D0, D0, D0'
+
+ * int8x8_t vsub_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vsub.i8 D0, D0, D0'
+
+ * uint64x1_t vsub_u64 (uint64x1_t, uint64x1_t)
+ _Form of expected instruction(s):_ `vsub.i64 D0, D0, D0'
+
+ * int64x1_t vsub_s64 (int64x1_t, int64x1_t)
+ _Form of expected instruction(s):_ `vsub.i64 D0, D0, D0'
+
+ * float32x2_t vsub_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vsub.f32 D0, D0, D0'
+
+ * uint32x4_t vsubq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vsub.i32 Q0, Q0, Q0'
+
+ * uint16x8_t vsubq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vsub.i16 Q0, Q0, Q0'
+
+ * uint8x16_t vsubq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vsub.i8 Q0, Q0, Q0'
+
+ * int32x4_t vsubq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vsub.i32 Q0, Q0, Q0'
+
+ * int16x8_t vsubq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vsub.i16 Q0, Q0, Q0'
+
+ * int8x16_t vsubq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vsub.i8 Q0, Q0, Q0'
+
+ * uint64x2_t vsubq_u64 (uint64x2_t, uint64x2_t)
+ _Form of expected instruction(s):_ `vsub.i64 Q0, Q0, Q0'
+
+ * int64x2_t vsubq_s64 (int64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `vsub.i64 Q0, Q0, Q0'
+
+ * float32x4_t vsubq_f32 (float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vsub.f32 Q0, Q0, Q0'
+
+ * uint64x2_t vsubl_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vsubl.u32 Q0, D0, D0'
+
+ * uint32x4_t vsubl_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vsubl.u16 Q0, D0, D0'
+
+ * uint16x8_t vsubl_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vsubl.u8 Q0, D0, D0'
+
+ * int64x2_t vsubl_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vsubl.s32 Q0, D0, D0'
+
+ * int32x4_t vsubl_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vsubl.s16 Q0, D0, D0'
+
+ * int16x8_t vsubl_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vsubl.s8 Q0, D0, D0'
+
+ * uint64x2_t vsubw_u32 (uint64x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vsubw.u32 Q0, Q0, D0'
+
+ * uint32x4_t vsubw_u16 (uint32x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vsubw.u16 Q0, Q0, D0'
+
+ * uint16x8_t vsubw_u8 (uint16x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vsubw.u8 Q0, Q0, D0'
+
+ * int64x2_t vsubw_s32 (int64x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vsubw.s32 Q0, Q0, D0'
+
+ * int32x4_t vsubw_s16 (int32x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vsubw.s16 Q0, Q0, D0'
+
+ * int16x8_t vsubw_s8 (int16x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vsubw.s8 Q0, Q0, D0'
+
+ * uint32x2_t vhsub_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vhsub.u32 D0, D0, D0'
+
+ * uint16x4_t vhsub_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vhsub.u16 D0, D0, D0'
+
+ * uint8x8_t vhsub_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vhsub.u8 D0, D0, D0'
+
+ * int32x2_t vhsub_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vhsub.s32 D0, D0, D0'
+
+ * int16x4_t vhsub_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vhsub.s16 D0, D0, D0'
+
+ * int8x8_t vhsub_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vhsub.s8 D0, D0, D0'
+
+ * uint32x4_t vhsubq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vhsub.u32 Q0, Q0, Q0'
+
+ * uint16x8_t vhsubq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vhsub.u16 Q0, Q0, Q0'
+
+ * uint8x16_t vhsubq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vhsub.u8 Q0, Q0, Q0'
+
+ * int32x4_t vhsubq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vhsub.s32 Q0, Q0, Q0'
+
+ * int16x8_t vhsubq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vhsub.s16 Q0, Q0, Q0'
+
+ * int8x16_t vhsubq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vhsub.s8 Q0, Q0, Q0'
+
+ * uint32x2_t vqsub_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vqsub.u32 D0, D0, D0'
+
+ * uint16x4_t vqsub_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vqsub.u16 D0, D0, D0'
+
+ * uint8x8_t vqsub_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vqsub.u8 D0, D0, D0'
+
+ * int32x2_t vqsub_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vqsub.s32 D0, D0, D0'
+
+ * int16x4_t vqsub_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vqsub.s16 D0, D0, D0'
+
+ * int8x8_t vqsub_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vqsub.s8 D0, D0, D0'
+
+ * uint64x1_t vqsub_u64 (uint64x1_t, uint64x1_t)
+ _Form of expected instruction(s):_ `vqsub.u64 D0, D0, D0'
+
+ * int64x1_t vqsub_s64 (int64x1_t, int64x1_t)
+ _Form of expected instruction(s):_ `vqsub.s64 D0, D0, D0'
+
+ * uint32x4_t vqsubq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vqsub.u32 Q0, Q0, Q0'
+
+ * uint16x8_t vqsubq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vqsub.u16 Q0, Q0, Q0'
+
+ * uint8x16_t vqsubq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vqsub.u8 Q0, Q0, Q0'
+
+ * int32x4_t vqsubq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vqsub.s32 Q0, Q0, Q0'
+
+ * int16x8_t vqsubq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vqsub.s16 Q0, Q0, Q0'
+
+ * int8x16_t vqsubq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vqsub.s8 Q0, Q0, Q0'
+
+ * uint64x2_t vqsubq_u64 (uint64x2_t, uint64x2_t)
+ _Form of expected instruction(s):_ `vqsub.u64 Q0, Q0, Q0'
+
+ * int64x2_t vqsubq_s64 (int64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `vqsub.s64 Q0, Q0, Q0'
+
+ * uint32x2_t vsubhn_u64 (uint64x2_t, uint64x2_t)
+ _Form of expected instruction(s):_ `vsubhn.i64 D0, Q0, Q0'
+
+ * uint16x4_t vsubhn_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vsubhn.i32 D0, Q0, Q0'
+
+ * uint8x8_t vsubhn_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vsubhn.i16 D0, Q0, Q0'
+
+ * int32x2_t vsubhn_s64 (int64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `vsubhn.i64 D0, Q0, Q0'
+
+ * int16x4_t vsubhn_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vsubhn.i32 D0, Q0, Q0'
+
+ * int8x8_t vsubhn_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vsubhn.i16 D0, Q0, Q0'
+
+ * uint32x2_t vrsubhn_u64 (uint64x2_t, uint64x2_t)
+ _Form of expected instruction(s):_ `vrsubhn.i64 D0, Q0, Q0'
+
+ * uint16x4_t vrsubhn_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vrsubhn.i32 D0, Q0, Q0'
+
+ * uint8x8_t vrsubhn_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vrsubhn.i16 D0, Q0, Q0'
+
+ * int32x2_t vrsubhn_s64 (int64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `vrsubhn.i64 D0, Q0, Q0'
+
+ * int16x4_t vrsubhn_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vrsubhn.i32 D0, Q0, Q0'
+
+ * int8x8_t vrsubhn_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vrsubhn.i16 D0, Q0, Q0'
+
+5.50.3.6 Comparison (equal-to)
+..............................
+
+ * uint32x2_t vceq_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vceq.i32 D0, D0, D0'
+
+ * uint16x4_t vceq_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vceq.i16 D0, D0, D0'
+
+ * uint8x8_t vceq_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vceq.i8 D0, D0, D0'
+
+ * uint32x2_t vceq_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vceq.i32 D0, D0, D0'
+
+ * uint16x4_t vceq_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vceq.i16 D0, D0, D0'
+
+ * uint8x8_t vceq_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vceq.i8 D0, D0, D0'
+
+ * uint32x2_t vceq_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vceq.f32 D0, D0, D0'
+
+ * uint8x8_t vceq_p8 (poly8x8_t, poly8x8_t)
+ _Form of expected instruction(s):_ `vceq.i8 D0, D0, D0'
+
+ * uint32x4_t vceqq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vceq.i32 Q0, Q0, Q0'
+
+ * uint16x8_t vceqq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vceq.i16 Q0, Q0, Q0'
+
+ * uint8x16_t vceqq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vceq.i8 Q0, Q0, Q0'
+
+ * uint32x4_t vceqq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vceq.i32 Q0, Q0, Q0'
+
+ * uint16x8_t vceqq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vceq.i16 Q0, Q0, Q0'
+
+ * uint8x16_t vceqq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vceq.i8 Q0, Q0, Q0'
+
+ * uint32x4_t vceqq_f32 (float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vceq.f32 Q0, Q0, Q0'
+
+ * uint8x16_t vceqq_p8 (poly8x16_t, poly8x16_t)
+ _Form of expected instruction(s):_ `vceq.i8 Q0, Q0, Q0'
+
+5.50.3.7 Comparison (greater-than-or-equal-to)
+..............................................
+
+ * uint32x2_t vcge_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vcge.u32 D0, D0, D0'
+
+ * uint16x4_t vcge_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vcge.u16 D0, D0, D0'
+
+ * uint8x8_t vcge_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vcge.u8 D0, D0, D0'
+
+ * uint32x2_t vcge_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vcge.s32 D0, D0, D0'
+
+ * uint16x4_t vcge_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vcge.s16 D0, D0, D0'
+
+ * uint8x8_t vcge_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vcge.s8 D0, D0, D0'
+
+ * uint32x2_t vcge_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vcge.f32 D0, D0, D0'
+
+ * uint32x4_t vcgeq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vcge.u32 Q0, Q0, Q0'
+
+ * uint16x8_t vcgeq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vcge.u16 Q0, Q0, Q0'
+
+ * uint8x16_t vcgeq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vcge.u8 Q0, Q0, Q0'
+
+ * uint32x4_t vcgeq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vcge.s32 Q0, Q0, Q0'
+
+ * uint16x8_t vcgeq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vcge.s16 Q0, Q0, Q0'
+
+ * uint8x16_t vcgeq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vcge.s8 Q0, Q0, Q0'
+
+ * uint32x4_t vcgeq_f32 (float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vcge.f32 Q0, Q0, Q0'
+
+5.50.3.8 Comparison (less-than-or-equal-to)
+...........................................
+
+ * uint32x2_t vcle_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vcge.u32 D0, D0, D0'
+
+ * uint16x4_t vcle_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vcge.u16 D0, D0, D0'
+
+ * uint8x8_t vcle_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vcge.u8 D0, D0, D0'
+
+ * uint32x2_t vcle_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vcge.s32 D0, D0, D0'
+
+ * uint16x4_t vcle_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vcge.s16 D0, D0, D0'
+
+ * uint8x8_t vcle_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vcge.s8 D0, D0, D0'
+
+ * uint32x2_t vcle_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vcge.f32 D0, D0, D0'
+
+ * uint32x4_t vcleq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vcge.u32 Q0, Q0, Q0'
+
+ * uint16x8_t vcleq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vcge.u16 Q0, Q0, Q0'
+
+ * uint8x16_t vcleq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vcge.u8 Q0, Q0, Q0'
+
+ * uint32x4_t vcleq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vcge.s32 Q0, Q0, Q0'
+
+ * uint16x8_t vcleq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vcge.s16 Q0, Q0, Q0'
+
+ * uint8x16_t vcleq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vcge.s8 Q0, Q0, Q0'
+
+ * uint32x4_t vcleq_f32 (float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vcge.f32 Q0, Q0, Q0'
+
+5.50.3.9 Comparison (greater-than)
+..................................
+
+ * uint32x2_t vcgt_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vcgt.u32 D0, D0, D0'
+
+ * uint16x4_t vcgt_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vcgt.u16 D0, D0, D0'
+
+ * uint8x8_t vcgt_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vcgt.u8 D0, D0, D0'
+
+ * uint32x2_t vcgt_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vcgt.s32 D0, D0, D0'
+
+ * uint16x4_t vcgt_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vcgt.s16 D0, D0, D0'
+
+ * uint8x8_t vcgt_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vcgt.s8 D0, D0, D0'
+
+ * uint32x2_t vcgt_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vcgt.f32 D0, D0, D0'
+
+ * uint32x4_t vcgtq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vcgt.u32 Q0, Q0, Q0'
+
+ * uint16x8_t vcgtq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vcgt.u16 Q0, Q0, Q0'
+
+ * uint8x16_t vcgtq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vcgt.u8 Q0, Q0, Q0'
+
+ * uint32x4_t vcgtq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vcgt.s32 Q0, Q0, Q0'
+
+ * uint16x8_t vcgtq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vcgt.s16 Q0, Q0, Q0'
+
+ * uint8x16_t vcgtq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vcgt.s8 Q0, Q0, Q0'
+
+ * uint32x4_t vcgtq_f32 (float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vcgt.f32 Q0, Q0, Q0'
+
+5.50.3.10 Comparison (less-than)
+................................
+
+ * uint32x2_t vclt_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vcgt.u32 D0, D0, D0'
+
+ * uint16x4_t vclt_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vcgt.u16 D0, D0, D0'
+
+ * uint8x8_t vclt_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vcgt.u8 D0, D0, D0'
+
+ * uint32x2_t vclt_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vcgt.s32 D0, D0, D0'
+
+ * uint16x4_t vclt_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vcgt.s16 D0, D0, D0'
+
+ * uint8x8_t vclt_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vcgt.s8 D0, D0, D0'
+
+ * uint32x2_t vclt_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vcgt.f32 D0, D0, D0'
+
+ * uint32x4_t vcltq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vcgt.u32 Q0, Q0, Q0'
+
+ * uint16x8_t vcltq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vcgt.u16 Q0, Q0, Q0'
+
+ * uint8x16_t vcltq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vcgt.u8 Q0, Q0, Q0'
+
+ * uint32x4_t vcltq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vcgt.s32 Q0, Q0, Q0'
+
+ * uint16x8_t vcltq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vcgt.s16 Q0, Q0, Q0'
+
+ * uint8x16_t vcltq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vcgt.s8 Q0, Q0, Q0'
+
+ * uint32x4_t vcltq_f32 (float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vcgt.f32 Q0, Q0, Q0'
+
+5.50.3.11 Comparison (absolute greater-than-or-equal-to)
+........................................................
+
+ * uint32x2_t vcage_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vacge.f32 D0, D0, D0'
+
+ * uint32x4_t vcageq_f32 (float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vacge.f32 Q0, Q0, Q0'
+
+5.50.3.12 Comparison (absolute less-than-or-equal-to)
+.....................................................
+
+ * uint32x2_t vcale_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vacge.f32 D0, D0, D0'
+
+ * uint32x4_t vcaleq_f32 (float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vacge.f32 Q0, Q0, Q0'
+
+5.50.3.13 Comparison (absolute greater-than)
+............................................
+
+ * uint32x2_t vcagt_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vacgt.f32 D0, D0, D0'
+
+ * uint32x4_t vcagtq_f32 (float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vacgt.f32 Q0, Q0, Q0'
+
+5.50.3.14 Comparison (absolute less-than)
+.........................................
+
+ * uint32x2_t vcalt_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vacgt.f32 D0, D0, D0'
+
+ * uint32x4_t vcaltq_f32 (float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vacgt.f32 Q0, Q0, Q0'
+
+5.50.3.15 Test bits
+...................
+
+ * uint32x2_t vtst_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vtst.32 D0, D0, D0'
+
+ * uint16x4_t vtst_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vtst.16 D0, D0, D0'
+
+ * uint8x8_t vtst_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vtst.8 D0, D0, D0'
+
+ * uint32x2_t vtst_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vtst.32 D0, D0, D0'
+
+ * uint16x4_t vtst_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vtst.16 D0, D0, D0'
+
+ * uint8x8_t vtst_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vtst.8 D0, D0, D0'
+
+ * uint8x8_t vtst_p8 (poly8x8_t, poly8x8_t)
+ _Form of expected instruction(s):_ `vtst.8 D0, D0, D0'
+
+ * uint32x4_t vtstq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vtst.32 Q0, Q0, Q0'
+
+ * uint16x8_t vtstq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vtst.16 Q0, Q0, Q0'
+
+ * uint8x16_t vtstq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vtst.8 Q0, Q0, Q0'
+
+ * uint32x4_t vtstq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vtst.32 Q0, Q0, Q0'
+
+ * uint16x8_t vtstq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vtst.16 Q0, Q0, Q0'
+
+ * uint8x16_t vtstq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vtst.8 Q0, Q0, Q0'
+
+ * uint8x16_t vtstq_p8 (poly8x16_t, poly8x16_t)
+ _Form of expected instruction(s):_ `vtst.8 Q0, Q0, Q0'
+
+5.50.3.16 Absolute difference
+.............................
+
+ * uint32x2_t vabd_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vabd.u32 D0, D0, D0'
+
+ * uint16x4_t vabd_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vabd.u16 D0, D0, D0'
+
+ * uint8x8_t vabd_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vabd.u8 D0, D0, D0'
+
+ * int32x2_t vabd_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vabd.s32 D0, D0, D0'
+
+ * int16x4_t vabd_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vabd.s16 D0, D0, D0'
+
+ * int8x8_t vabd_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vabd.s8 D0, D0, D0'
+
+ * float32x2_t vabd_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vabd.f32 D0, D0, D0'
+
+ * uint32x4_t vabdq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vabd.u32 Q0, Q0, Q0'
+
+ * uint16x8_t vabdq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vabd.u16 Q0, Q0, Q0'
+
+ * uint8x16_t vabdq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vabd.u8 Q0, Q0, Q0'
+
+ * int32x4_t vabdq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vabd.s32 Q0, Q0, Q0'
+
+ * int16x8_t vabdq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vabd.s16 Q0, Q0, Q0'
+
+ * int8x16_t vabdq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vabd.s8 Q0, Q0, Q0'
+
+ * float32x4_t vabdq_f32 (float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vabd.f32 Q0, Q0, Q0'
+
+ * uint64x2_t vabdl_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vabdl.u32 Q0, D0, D0'
+
+ * uint32x4_t vabdl_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vabdl.u16 Q0, D0, D0'
+
+ * uint16x8_t vabdl_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vabdl.u8 Q0, D0, D0'
+
+ * int64x2_t vabdl_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vabdl.s32 Q0, D0, D0'
+
+ * int32x4_t vabdl_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vabdl.s16 Q0, D0, D0'
+
+ * int16x8_t vabdl_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vabdl.s8 Q0, D0, D0'
+
+5.50.3.17 Absolute difference and accumulate
+............................................
+
+ * uint32x2_t vaba_u32 (uint32x2_t, uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vaba.u32 D0, D0, D0'
+
+ * uint16x4_t vaba_u16 (uint16x4_t, uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vaba.u16 D0, D0, D0'
+
+ * uint8x8_t vaba_u8 (uint8x8_t, uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vaba.u8 D0, D0, D0'
+
+ * int32x2_t vaba_s32 (int32x2_t, int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vaba.s32 D0, D0, D0'
+
+ * int16x4_t vaba_s16 (int16x4_t, int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vaba.s16 D0, D0, D0'
+
+ * int8x8_t vaba_s8 (int8x8_t, int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vaba.s8 D0, D0, D0'
+
+ * uint32x4_t vabaq_u32 (uint32x4_t, uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vaba.u32 Q0, Q0, Q0'
+
+ * uint16x8_t vabaq_u16 (uint16x8_t, uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vaba.u16 Q0, Q0, Q0'
+
+ * uint8x16_t vabaq_u8 (uint8x16_t, uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vaba.u8 Q0, Q0, Q0'
+
+ * int32x4_t vabaq_s32 (int32x4_t, int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vaba.s32 Q0, Q0, Q0'
+
+ * int16x8_t vabaq_s16 (int16x8_t, int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vaba.s16 Q0, Q0, Q0'
+
+ * int8x16_t vabaq_s8 (int8x16_t, int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vaba.s8 Q0, Q0, Q0'
+
+ * uint64x2_t vabal_u32 (uint64x2_t, uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vabal.u32 Q0, D0, D0'
+
+ * uint32x4_t vabal_u16 (uint32x4_t, uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vabal.u16 Q0, D0, D0'
+
+ * uint16x8_t vabal_u8 (uint16x8_t, uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vabal.u8 Q0, D0, D0'
+
+ * int64x2_t vabal_s32 (int64x2_t, int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vabal.s32 Q0, D0, D0'
+
+ * int32x4_t vabal_s16 (int32x4_t, int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vabal.s16 Q0, D0, D0'
+
+ * int16x8_t vabal_s8 (int16x8_t, int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vabal.s8 Q0, D0, D0'
+
+5.50.3.18 Maximum
+.................
+
+ * uint32x2_t vmax_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vmax.u32 D0, D0, D0'
+
+ * uint16x4_t vmax_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vmax.u16 D0, D0, D0'
+
+ * uint8x8_t vmax_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vmax.u8 D0, D0, D0'
+
+ * int32x2_t vmax_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vmax.s32 D0, D0, D0'
+
+ * int16x4_t vmax_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vmax.s16 D0, D0, D0'
+
+ * int8x8_t vmax_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vmax.s8 D0, D0, D0'
+
+ * float32x2_t vmax_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vmax.f32 D0, D0, D0'
+
+ * uint32x4_t vmaxq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vmax.u32 Q0, Q0, Q0'
+
+ * uint16x8_t vmaxq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vmax.u16 Q0, Q0, Q0'
+
+ * uint8x16_t vmaxq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vmax.u8 Q0, Q0, Q0'
+
+ * int32x4_t vmaxq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vmax.s32 Q0, Q0, Q0'
+
+ * int16x8_t vmaxq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vmax.s16 Q0, Q0, Q0'
+
+ * int8x16_t vmaxq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vmax.s8 Q0, Q0, Q0'
+
+ * float32x4_t vmaxq_f32 (float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vmax.f32 Q0, Q0, Q0'
+
+5.50.3.19 Minimum
+.................
+
+ * uint32x2_t vmin_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vmin.u32 D0, D0, D0'
+
+ * uint16x4_t vmin_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vmin.u16 D0, D0, D0'
+
+ * uint8x8_t vmin_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vmin.u8 D0, D0, D0'
+
+ * int32x2_t vmin_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vmin.s32 D0, D0, D0'
+
+ * int16x4_t vmin_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vmin.s16 D0, D0, D0'
+
+ * int8x8_t vmin_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vmin.s8 D0, D0, D0'
+
+ * float32x2_t vmin_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vmin.f32 D0, D0, D0'
+
+ * uint32x4_t vminq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vmin.u32 Q0, Q0, Q0'
+
+ * uint16x8_t vminq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vmin.u16 Q0, Q0, Q0'
+
+ * uint8x16_t vminq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vmin.u8 Q0, Q0, Q0'
+
+ * int32x4_t vminq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vmin.s32 Q0, Q0, Q0'
+
+ * int16x8_t vminq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vmin.s16 Q0, Q0, Q0'
+
+ * int8x16_t vminq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vmin.s8 Q0, Q0, Q0'
+
+ * float32x4_t vminq_f32 (float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vmin.f32 Q0, Q0, Q0'
+
+5.50.3.20 Pairwise add
+......................
+
+ * uint32x2_t vpadd_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vpadd.i32 D0, D0, D0'
+
+ * uint16x4_t vpadd_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vpadd.i16 D0, D0, D0'
+
+ * uint8x8_t vpadd_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vpadd.i8 D0, D0, D0'
+
+ * int32x2_t vpadd_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vpadd.i32 D0, D0, D0'
+
+ * int16x4_t vpadd_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vpadd.i16 D0, D0, D0'
+
+ * int8x8_t vpadd_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vpadd.i8 D0, D0, D0'
+
+ * float32x2_t vpadd_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vpadd.f32 D0, D0, D0'
+
+ * uint64x1_t vpaddl_u32 (uint32x2_t)
+ _Form of expected instruction(s):_ `vpaddl.u32 D0, D0'
+
+ * uint32x2_t vpaddl_u16 (uint16x4_t)
+ _Form of expected instruction(s):_ `vpaddl.u16 D0, D0'
+
+ * uint16x4_t vpaddl_u8 (uint8x8_t)
+ _Form of expected instruction(s):_ `vpaddl.u8 D0, D0'
+
+ * int64x1_t vpaddl_s32 (int32x2_t)
+ _Form of expected instruction(s):_ `vpaddl.s32 D0, D0'
+
+ * int32x2_t vpaddl_s16 (int16x4_t)
+ _Form of expected instruction(s):_ `vpaddl.s16 D0, D0'
+
+ * int16x4_t vpaddl_s8 (int8x8_t)
+ _Form of expected instruction(s):_ `vpaddl.s8 D0, D0'
+
+ * uint64x2_t vpaddlq_u32 (uint32x4_t)
+ _Form of expected instruction(s):_ `vpaddl.u32 Q0, Q0'
+
+ * uint32x4_t vpaddlq_u16 (uint16x8_t)
+ _Form of expected instruction(s):_ `vpaddl.u16 Q0, Q0'
+
+ * uint16x8_t vpaddlq_u8 (uint8x16_t)
+ _Form of expected instruction(s):_ `vpaddl.u8 Q0, Q0'
+
+ * int64x2_t vpaddlq_s32 (int32x4_t)
+ _Form of expected instruction(s):_ `vpaddl.s32 Q0, Q0'
+
+ * int32x4_t vpaddlq_s16 (int16x8_t)
+ _Form of expected instruction(s):_ `vpaddl.s16 Q0, Q0'
+
+ * int16x8_t vpaddlq_s8 (int8x16_t)
+ _Form of expected instruction(s):_ `vpaddl.s8 Q0, Q0'
+
+5.50.3.21 Pairwise add, single_opcode widen and accumulate
+..........................................................
+
+ * uint64x1_t vpadal_u32 (uint64x1_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vpadal.u32 D0, D0'
+
+ * uint32x2_t vpadal_u16 (uint32x2_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vpadal.u16 D0, D0'
+
+ * uint16x4_t vpadal_u8 (uint16x4_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vpadal.u8 D0, D0'
+
+ * int64x1_t vpadal_s32 (int64x1_t, int32x2_t)
+ _Form of expected instruction(s):_ `vpadal.s32 D0, D0'
+
+ * int32x2_t vpadal_s16 (int32x2_t, int16x4_t)
+ _Form of expected instruction(s):_ `vpadal.s16 D0, D0'
+
+ * int16x4_t vpadal_s8 (int16x4_t, int8x8_t)
+ _Form of expected instruction(s):_ `vpadal.s8 D0, D0'
+
+ * uint64x2_t vpadalq_u32 (uint64x2_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vpadal.u32 Q0, Q0'
+
+ * uint32x4_t vpadalq_u16 (uint32x4_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vpadal.u16 Q0, Q0'
+
+ * uint16x8_t vpadalq_u8 (uint16x8_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vpadal.u8 Q0, Q0'
+
+ * int64x2_t vpadalq_s32 (int64x2_t, int32x4_t)
+ _Form of expected instruction(s):_ `vpadal.s32 Q0, Q0'
+
+ * int32x4_t vpadalq_s16 (int32x4_t, int16x8_t)
+ _Form of expected instruction(s):_ `vpadal.s16 Q0, Q0'
+
+ * int16x8_t vpadalq_s8 (int16x8_t, int8x16_t)
+ _Form of expected instruction(s):_ `vpadal.s8 Q0, Q0'
+
+5.50.3.22 Folding maximum
+.........................
+
+ * uint32x2_t vpmax_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vpmax.u32 D0, D0, D0'
+
+ * uint16x4_t vpmax_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vpmax.u16 D0, D0, D0'
+
+ * uint8x8_t vpmax_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vpmax.u8 D0, D0, D0'
+
+ * int32x2_t vpmax_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vpmax.s32 D0, D0, D0'
+
+ * int16x4_t vpmax_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vpmax.s16 D0, D0, D0'
+
+ * int8x8_t vpmax_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vpmax.s8 D0, D0, D0'
+
+ * float32x2_t vpmax_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vpmax.f32 D0, D0, D0'
+
+5.50.3.23 Folding minimum
+.........................
+
+ * uint32x2_t vpmin_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vpmin.u32 D0, D0, D0'
+
+ * uint16x4_t vpmin_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vpmin.u16 D0, D0, D0'
+
+ * uint8x8_t vpmin_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vpmin.u8 D0, D0, D0'
+
+ * int32x2_t vpmin_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vpmin.s32 D0, D0, D0'
+
+ * int16x4_t vpmin_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vpmin.s16 D0, D0, D0'
+
+ * int8x8_t vpmin_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vpmin.s8 D0, D0, D0'
+
+ * float32x2_t vpmin_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vpmin.f32 D0, D0, D0'
+
+5.50.3.24 Reciprocal step
+.........................
+
+ * float32x2_t vrecps_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vrecps.f32 D0, D0, D0'
+
+ * float32x4_t vrecpsq_f32 (float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vrecps.f32 Q0, Q0, Q0'
+
+ * float32x2_t vrsqrts_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vrsqrts.f32 D0, D0, D0'
+
+ * float32x4_t vrsqrtsq_f32 (float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vrsqrts.f32 Q0, Q0, Q0'
+
+5.50.3.25 Vector shift left
+...........................
+
+ * uint32x2_t vshl_u32 (uint32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vshl.u32 D0, D0, D0'
+
+ * uint16x4_t vshl_u16 (uint16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vshl.u16 D0, D0, D0'
+
+ * uint8x8_t vshl_u8 (uint8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vshl.u8 D0, D0, D0'
+
+ * int32x2_t vshl_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vshl.s32 D0, D0, D0'
+
+ * int16x4_t vshl_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vshl.s16 D0, D0, D0'
+
+ * int8x8_t vshl_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vshl.s8 D0, D0, D0'
+
+ * uint64x1_t vshl_u64 (uint64x1_t, int64x1_t)
+ _Form of expected instruction(s):_ `vshl.u64 D0, D0, D0'
+
+ * int64x1_t vshl_s64 (int64x1_t, int64x1_t)
+ _Form of expected instruction(s):_ `vshl.s64 D0, D0, D0'
+
+ * uint32x4_t vshlq_u32 (uint32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vshl.u32 Q0, Q0, Q0'
+
+ * uint16x8_t vshlq_u16 (uint16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vshl.u16 Q0, Q0, Q0'
+
+ * uint8x16_t vshlq_u8 (uint8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vshl.u8 Q0, Q0, Q0'
+
+ * int32x4_t vshlq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vshl.s32 Q0, Q0, Q0'
+
+ * int16x8_t vshlq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vshl.s16 Q0, Q0, Q0'
+
+ * int8x16_t vshlq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vshl.s8 Q0, Q0, Q0'
+
+ * uint64x2_t vshlq_u64 (uint64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `vshl.u64 Q0, Q0, Q0'
+
+ * int64x2_t vshlq_s64 (int64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `vshl.s64 Q0, Q0, Q0'
+
+ * uint32x2_t vrshl_u32 (uint32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vrshl.u32 D0, D0, D0'
+
+ * uint16x4_t vrshl_u16 (uint16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vrshl.u16 D0, D0, D0'
+
+ * uint8x8_t vrshl_u8 (uint8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vrshl.u8 D0, D0, D0'
+
+ * int32x2_t vrshl_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vrshl.s32 D0, D0, D0'
+
+ * int16x4_t vrshl_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vrshl.s16 D0, D0, D0'
+
+ * int8x8_t vrshl_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vrshl.s8 D0, D0, D0'
+
+ * uint64x1_t vrshl_u64 (uint64x1_t, int64x1_t)
+ _Form of expected instruction(s):_ `vrshl.u64 D0, D0, D0'
+
+ * int64x1_t vrshl_s64 (int64x1_t, int64x1_t)
+ _Form of expected instruction(s):_ `vrshl.s64 D0, D0, D0'
+
+ * uint32x4_t vrshlq_u32 (uint32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vrshl.u32 Q0, Q0, Q0'
+
+ * uint16x8_t vrshlq_u16 (uint16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vrshl.u16 Q0, Q0, Q0'
+
+ * uint8x16_t vrshlq_u8 (uint8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vrshl.u8 Q0, Q0, Q0'
+
+ * int32x4_t vrshlq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vrshl.s32 Q0, Q0, Q0'
+
+ * int16x8_t vrshlq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vrshl.s16 Q0, Q0, Q0'
+
+ * int8x16_t vrshlq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vrshl.s8 Q0, Q0, Q0'
+
+ * uint64x2_t vrshlq_u64 (uint64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `vrshl.u64 Q0, Q0, Q0'
+
+ * int64x2_t vrshlq_s64 (int64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `vrshl.s64 Q0, Q0, Q0'
+
+ * uint32x2_t vqshl_u32 (uint32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vqshl.u32 D0, D0, D0'
+
+ * uint16x4_t vqshl_u16 (uint16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vqshl.u16 D0, D0, D0'
+
+ * uint8x8_t vqshl_u8 (uint8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vqshl.u8 D0, D0, D0'
+
+ * int32x2_t vqshl_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vqshl.s32 D0, D0, D0'
+
+ * int16x4_t vqshl_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vqshl.s16 D0, D0, D0'
+
+ * int8x8_t vqshl_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vqshl.s8 D0, D0, D0'
+
+ * uint64x1_t vqshl_u64 (uint64x1_t, int64x1_t)
+ _Form of expected instruction(s):_ `vqshl.u64 D0, D0, D0'
+
+ * int64x1_t vqshl_s64 (int64x1_t, int64x1_t)
+ _Form of expected instruction(s):_ `vqshl.s64 D0, D0, D0'
+
+ * uint32x4_t vqshlq_u32 (uint32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vqshl.u32 Q0, Q0, Q0'
+
+ * uint16x8_t vqshlq_u16 (uint16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vqshl.u16 Q0, Q0, Q0'
+
+ * uint8x16_t vqshlq_u8 (uint8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vqshl.u8 Q0, Q0, Q0'
+
+ * int32x4_t vqshlq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vqshl.s32 Q0, Q0, Q0'
+
+ * int16x8_t vqshlq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vqshl.s16 Q0, Q0, Q0'
+
+ * int8x16_t vqshlq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vqshl.s8 Q0, Q0, Q0'
+
+ * uint64x2_t vqshlq_u64 (uint64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `vqshl.u64 Q0, Q0, Q0'
+
+ * int64x2_t vqshlq_s64 (int64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `vqshl.s64 Q0, Q0, Q0'
+
+ * uint32x2_t vqrshl_u32 (uint32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vqrshl.u32 D0, D0, D0'
+
+ * uint16x4_t vqrshl_u16 (uint16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vqrshl.u16 D0, D0, D0'
+
+ * uint8x8_t vqrshl_u8 (uint8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vqrshl.u8 D0, D0, D0'
+
+ * int32x2_t vqrshl_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vqrshl.s32 D0, D0, D0'
+
+ * int16x4_t vqrshl_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vqrshl.s16 D0, D0, D0'
+
+ * int8x8_t vqrshl_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vqrshl.s8 D0, D0, D0'
+
+ * uint64x1_t vqrshl_u64 (uint64x1_t, int64x1_t)
+ _Form of expected instruction(s):_ `vqrshl.u64 D0, D0, D0'
+
+ * int64x1_t vqrshl_s64 (int64x1_t, int64x1_t)
+ _Form of expected instruction(s):_ `vqrshl.s64 D0, D0, D0'
+
+ * uint32x4_t vqrshlq_u32 (uint32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vqrshl.u32 Q0, Q0, Q0'
+
+ * uint16x8_t vqrshlq_u16 (uint16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vqrshl.u16 Q0, Q0, Q0'
+
+ * uint8x16_t vqrshlq_u8 (uint8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vqrshl.u8 Q0, Q0, Q0'
+
+ * int32x4_t vqrshlq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vqrshl.s32 Q0, Q0, Q0'
+
+ * int16x8_t vqrshlq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vqrshl.s16 Q0, Q0, Q0'
+
+ * int8x16_t vqrshlq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vqrshl.s8 Q0, Q0, Q0'
+
+ * uint64x2_t vqrshlq_u64 (uint64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `vqrshl.u64 Q0, Q0, Q0'
+
+ * int64x2_t vqrshlq_s64 (int64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `vqrshl.s64 Q0, Q0, Q0'
+
+5.50.3.26 Vector shift left by constant
+.......................................
+
+ * uint32x2_t vshl_n_u32 (uint32x2_t, const int)
+ _Form of expected instruction(s):_ `vshl.i32 D0, D0, #0'
+
+ * uint16x4_t vshl_n_u16 (uint16x4_t, const int)
+ _Form of expected instruction(s):_ `vshl.i16 D0, D0, #0'
+
+ * uint8x8_t vshl_n_u8 (uint8x8_t, const int)
+ _Form of expected instruction(s):_ `vshl.i8 D0, D0, #0'
+
+ * int32x2_t vshl_n_s32 (int32x2_t, const int)
+ _Form of expected instruction(s):_ `vshl.i32 D0, D0, #0'
+
+ * int16x4_t vshl_n_s16 (int16x4_t, const int)
+ _Form of expected instruction(s):_ `vshl.i16 D0, D0, #0'
+
+ * int8x8_t vshl_n_s8 (int8x8_t, const int)
+ _Form of expected instruction(s):_ `vshl.i8 D0, D0, #0'
+
+ * uint64x1_t vshl_n_u64 (uint64x1_t, const int)
+ _Form of expected instruction(s):_ `vshl.i64 D0, D0, #0'
+
+ * int64x1_t vshl_n_s64 (int64x1_t, const int)
+ _Form of expected instruction(s):_ `vshl.i64 D0, D0, #0'
+
+ * uint32x4_t vshlq_n_u32 (uint32x4_t, const int)
+ _Form of expected instruction(s):_ `vshl.i32 Q0, Q0, #0'
+
+ * uint16x8_t vshlq_n_u16 (uint16x8_t, const int)
+ _Form of expected instruction(s):_ `vshl.i16 Q0, Q0, #0'
+
+ * uint8x16_t vshlq_n_u8 (uint8x16_t, const int)
+ _Form of expected instruction(s):_ `vshl.i8 Q0, Q0, #0'
+
+ * int32x4_t vshlq_n_s32 (int32x4_t, const int)
+ _Form of expected instruction(s):_ `vshl.i32 Q0, Q0, #0'
+
+ * int16x8_t vshlq_n_s16 (int16x8_t, const int)
+ _Form of expected instruction(s):_ `vshl.i16 Q0, Q0, #0'
+
+ * int8x16_t vshlq_n_s8 (int8x16_t, const int)
+ _Form of expected instruction(s):_ `vshl.i8 Q0, Q0, #0'
+
+ * uint64x2_t vshlq_n_u64 (uint64x2_t, const int)
+ _Form of expected instruction(s):_ `vshl.i64 Q0, Q0, #0'
+
+ * int64x2_t vshlq_n_s64 (int64x2_t, const int)
+ _Form of expected instruction(s):_ `vshl.i64 Q0, Q0, #0'
+
+ * uint32x2_t vqshl_n_u32 (uint32x2_t, const int)
+ _Form of expected instruction(s):_ `vqshl.u32 D0, D0, #0'
+
+ * uint16x4_t vqshl_n_u16 (uint16x4_t, const int)
+ _Form of expected instruction(s):_ `vqshl.u16 D0, D0, #0'
+
+ * uint8x8_t vqshl_n_u8 (uint8x8_t, const int)
+ _Form of expected instruction(s):_ `vqshl.u8 D0, D0, #0'
+
+ * int32x2_t vqshl_n_s32 (int32x2_t, const int)
+ _Form of expected instruction(s):_ `vqshl.s32 D0, D0, #0'
+
+ * int16x4_t vqshl_n_s16 (int16x4_t, const int)
+ _Form of expected instruction(s):_ `vqshl.s16 D0, D0, #0'
+
+ * int8x8_t vqshl_n_s8 (int8x8_t, const int)
+ _Form of expected instruction(s):_ `vqshl.s8 D0, D0, #0'
+
+ * uint64x1_t vqshl_n_u64 (uint64x1_t, const int)
+ _Form of expected instruction(s):_ `vqshl.u64 D0, D0, #0'
+
+ * int64x1_t vqshl_n_s64 (int64x1_t, const int)
+ _Form of expected instruction(s):_ `vqshl.s64 D0, D0, #0'
+
+ * uint32x4_t vqshlq_n_u32 (uint32x4_t, const int)
+ _Form of expected instruction(s):_ `vqshl.u32 Q0, Q0, #0'
+
+ * uint16x8_t vqshlq_n_u16 (uint16x8_t, const int)
+ _Form of expected instruction(s):_ `vqshl.u16 Q0, Q0, #0'
+
+ * uint8x16_t vqshlq_n_u8 (uint8x16_t, const int)
+ _Form of expected instruction(s):_ `vqshl.u8 Q0, Q0, #0'
+
+ * int32x4_t vqshlq_n_s32 (int32x4_t, const int)
+ _Form of expected instruction(s):_ `vqshl.s32 Q0, Q0, #0'
+
+ * int16x8_t vqshlq_n_s16 (int16x8_t, const int)
+ _Form of expected instruction(s):_ `vqshl.s16 Q0, Q0, #0'
+
+ * int8x16_t vqshlq_n_s8 (int8x16_t, const int)
+ _Form of expected instruction(s):_ `vqshl.s8 Q0, Q0, #0'
+
+ * uint64x2_t vqshlq_n_u64 (uint64x2_t, const int)
+ _Form of expected instruction(s):_ `vqshl.u64 Q0, Q0, #0'
+
+ * int64x2_t vqshlq_n_s64 (int64x2_t, const int)
+ _Form of expected instruction(s):_ `vqshl.s64 Q0, Q0, #0'
+
+ * uint64x1_t vqshlu_n_s64 (int64x1_t, const int)
+ _Form of expected instruction(s):_ `vqshlu.s64 D0, D0, #0'
+
+ * uint32x2_t vqshlu_n_s32 (int32x2_t, const int)
+ _Form of expected instruction(s):_ `vqshlu.s32 D0, D0, #0'
+
+ * uint16x4_t vqshlu_n_s16 (int16x4_t, const int)
+ _Form of expected instruction(s):_ `vqshlu.s16 D0, D0, #0'
+
+ * uint8x8_t vqshlu_n_s8 (int8x8_t, const int)
+ _Form of expected instruction(s):_ `vqshlu.s8 D0, D0, #0'
+
+ * uint64x2_t vqshluq_n_s64 (int64x2_t, const int)
+ _Form of expected instruction(s):_ `vqshlu.s64 Q0, Q0, #0'
+
+ * uint32x4_t vqshluq_n_s32 (int32x4_t, const int)
+ _Form of expected instruction(s):_ `vqshlu.s32 Q0, Q0, #0'
+
+ * uint16x8_t vqshluq_n_s16 (int16x8_t, const int)
+ _Form of expected instruction(s):_ `vqshlu.s16 Q0, Q0, #0'
+
+ * uint8x16_t vqshluq_n_s8 (int8x16_t, const int)
+ _Form of expected instruction(s):_ `vqshlu.s8 Q0, Q0, #0'
+
+ * uint64x2_t vshll_n_u32 (uint32x2_t, const int)
+ _Form of expected instruction(s):_ `vshll.u32 Q0, D0, #0'
+
+ * uint32x4_t vshll_n_u16 (uint16x4_t, const int)
+ _Form of expected instruction(s):_ `vshll.u16 Q0, D0, #0'
+
+ * uint16x8_t vshll_n_u8 (uint8x8_t, const int)
+ _Form of expected instruction(s):_ `vshll.u8 Q0, D0, #0'
+
+ * int64x2_t vshll_n_s32 (int32x2_t, const int)
+ _Form of expected instruction(s):_ `vshll.s32 Q0, D0, #0'
+
+ * int32x4_t vshll_n_s16 (int16x4_t, const int)
+ _Form of expected instruction(s):_ `vshll.s16 Q0, D0, #0'
+
+ * int16x8_t vshll_n_s8 (int8x8_t, const int)
+ _Form of expected instruction(s):_ `vshll.s8 Q0, D0, #0'
+
+5.50.3.27 Vector shift right by constant
+........................................
+
+ * uint32x2_t vshr_n_u32 (uint32x2_t, const int)
+ _Form of expected instruction(s):_ `vshr.u32 D0, D0, #0'
+
+ * uint16x4_t vshr_n_u16 (uint16x4_t, const int)
+ _Form of expected instruction(s):_ `vshr.u16 D0, D0, #0'
+
+ * uint8x8_t vshr_n_u8 (uint8x8_t, const int)
+ _Form of expected instruction(s):_ `vshr.u8 D0, D0, #0'
+
+ * int32x2_t vshr_n_s32 (int32x2_t, const int)
+ _Form of expected instruction(s):_ `vshr.s32 D0, D0, #0'
+
+ * int16x4_t vshr_n_s16 (int16x4_t, const int)
+ _Form of expected instruction(s):_ `vshr.s16 D0, D0, #0'
+
+ * int8x8_t vshr_n_s8 (int8x8_t, const int)
+ _Form of expected instruction(s):_ `vshr.s8 D0, D0, #0'
+
+ * uint64x1_t vshr_n_u64 (uint64x1_t, const int)
+ _Form of expected instruction(s):_ `vshr.u64 D0, D0, #0'
+
+ * int64x1_t vshr_n_s64 (int64x1_t, const int)
+ _Form of expected instruction(s):_ `vshr.s64 D0, D0, #0'
+
+ * uint32x4_t vshrq_n_u32 (uint32x4_t, const int)
+ _Form of expected instruction(s):_ `vshr.u32 Q0, Q0, #0'
+
+ * uint16x8_t vshrq_n_u16 (uint16x8_t, const int)
+ _Form of expected instruction(s):_ `vshr.u16 Q0, Q0, #0'
+
+ * uint8x16_t vshrq_n_u8 (uint8x16_t, const int)
+ _Form of expected instruction(s):_ `vshr.u8 Q0, Q0, #0'
+
+ * int32x4_t vshrq_n_s32 (int32x4_t, const int)
+ _Form of expected instruction(s):_ `vshr.s32 Q0, Q0, #0'
+
+ * int16x8_t vshrq_n_s16 (int16x8_t, const int)
+ _Form of expected instruction(s):_ `vshr.s16 Q0, Q0, #0'
+
+ * int8x16_t vshrq_n_s8 (int8x16_t, const int)
+ _Form of expected instruction(s):_ `vshr.s8 Q0, Q0, #0'
+
+ * uint64x2_t vshrq_n_u64 (uint64x2_t, const int)
+ _Form of expected instruction(s):_ `vshr.u64 Q0, Q0, #0'
+
+ * int64x2_t vshrq_n_s64 (int64x2_t, const int)
+ _Form of expected instruction(s):_ `vshr.s64 Q0, Q0, #0'
+
+ * uint32x2_t vrshr_n_u32 (uint32x2_t, const int)
+ _Form of expected instruction(s):_ `vrshr.u32 D0, D0, #0'
+
+ * uint16x4_t vrshr_n_u16 (uint16x4_t, const int)
+ _Form of expected instruction(s):_ `vrshr.u16 D0, D0, #0'
+
+ * uint8x8_t vrshr_n_u8 (uint8x8_t, const int)
+ _Form of expected instruction(s):_ `vrshr.u8 D0, D0, #0'
+
+ * int32x2_t vrshr_n_s32 (int32x2_t, const int)
+ _Form of expected instruction(s):_ `vrshr.s32 D0, D0, #0'
+
+ * int16x4_t vrshr_n_s16 (int16x4_t, const int)
+ _Form of expected instruction(s):_ `vrshr.s16 D0, D0, #0'
+
+ * int8x8_t vrshr_n_s8 (int8x8_t, const int)
+ _Form of expected instruction(s):_ `vrshr.s8 D0, D0, #0'
+
+ * uint64x1_t vrshr_n_u64 (uint64x1_t, const int)
+ _Form of expected instruction(s):_ `vrshr.u64 D0, D0, #0'
+
+ * int64x1_t vrshr_n_s64 (int64x1_t, const int)
+ _Form of expected instruction(s):_ `vrshr.s64 D0, D0, #0'
+
+ * uint32x4_t vrshrq_n_u32 (uint32x4_t, const int)
+ _Form of expected instruction(s):_ `vrshr.u32 Q0, Q0, #0'
+
+ * uint16x8_t vrshrq_n_u16 (uint16x8_t, const int)
+ _Form of expected instruction(s):_ `vrshr.u16 Q0, Q0, #0'
+
+ * uint8x16_t vrshrq_n_u8 (uint8x16_t, const int)
+ _Form of expected instruction(s):_ `vrshr.u8 Q0, Q0, #0'
+
+ * int32x4_t vrshrq_n_s32 (int32x4_t, const int)
+ _Form of expected instruction(s):_ `vrshr.s32 Q0, Q0, #0'
+
+ * int16x8_t vrshrq_n_s16 (int16x8_t, const int)
+ _Form of expected instruction(s):_ `vrshr.s16 Q0, Q0, #0'
+
+ * int8x16_t vrshrq_n_s8 (int8x16_t, const int)
+ _Form of expected instruction(s):_ `vrshr.s8 Q0, Q0, #0'
+
+ * uint64x2_t vrshrq_n_u64 (uint64x2_t, const int)
+ _Form of expected instruction(s):_ `vrshr.u64 Q0, Q0, #0'
+
+ * int64x2_t vrshrq_n_s64 (int64x2_t, const int)
+ _Form of expected instruction(s):_ `vrshr.s64 Q0, Q0, #0'
+
+ * uint32x2_t vshrn_n_u64 (uint64x2_t, const int)
+ _Form of expected instruction(s):_ `vshrn.i64 D0, Q0, #0'
+
+ * uint16x4_t vshrn_n_u32 (uint32x4_t, const int)
+ _Form of expected instruction(s):_ `vshrn.i32 D0, Q0, #0'
+
+ * uint8x8_t vshrn_n_u16 (uint16x8_t, const int)
+ _Form of expected instruction(s):_ `vshrn.i16 D0, Q0, #0'
+
+ * int32x2_t vshrn_n_s64 (int64x2_t, const int)
+ _Form of expected instruction(s):_ `vshrn.i64 D0, Q0, #0'
+
+ * int16x4_t vshrn_n_s32 (int32x4_t, const int)
+ _Form of expected instruction(s):_ `vshrn.i32 D0, Q0, #0'
+
+ * int8x8_t vshrn_n_s16 (int16x8_t, const int)
+ _Form of expected instruction(s):_ `vshrn.i16 D0, Q0, #0'
+
+ * uint32x2_t vrshrn_n_u64 (uint64x2_t, const int)
+ _Form of expected instruction(s):_ `vrshrn.i64 D0, Q0, #0'
+
+ * uint16x4_t vrshrn_n_u32 (uint32x4_t, const int)
+ _Form of expected instruction(s):_ `vrshrn.i32 D0, Q0, #0'
+
+ * uint8x8_t vrshrn_n_u16 (uint16x8_t, const int)
+ _Form of expected instruction(s):_ `vrshrn.i16 D0, Q0, #0'
+
+ * int32x2_t vrshrn_n_s64 (int64x2_t, const int)
+ _Form of expected instruction(s):_ `vrshrn.i64 D0, Q0, #0'
+
+ * int16x4_t vrshrn_n_s32 (int32x4_t, const int)
+ _Form of expected instruction(s):_ `vrshrn.i32 D0, Q0, #0'
+
+ * int8x8_t vrshrn_n_s16 (int16x8_t, const int)
+ _Form of expected instruction(s):_ `vrshrn.i16 D0, Q0, #0'
+
+ * uint32x2_t vqshrn_n_u64 (uint64x2_t, const int)
+ _Form of expected instruction(s):_ `vqshrn.u64 D0, Q0, #0'
+
+ * uint16x4_t vqshrn_n_u32 (uint32x4_t, const int)
+ _Form of expected instruction(s):_ `vqshrn.u32 D0, Q0, #0'
+
+ * uint8x8_t vqshrn_n_u16 (uint16x8_t, const int)
+ _Form of expected instruction(s):_ `vqshrn.u16 D0, Q0, #0'
+
+ * int32x2_t vqshrn_n_s64 (int64x2_t, const int)
+ _Form of expected instruction(s):_ `vqshrn.s64 D0, Q0, #0'
+
+ * int16x4_t vqshrn_n_s32 (int32x4_t, const int)
+ _Form of expected instruction(s):_ `vqshrn.s32 D0, Q0, #0'
+
+ * int8x8_t vqshrn_n_s16 (int16x8_t, const int)
+ _Form of expected instruction(s):_ `vqshrn.s16 D0, Q0, #0'
+
+ * uint32x2_t vqrshrn_n_u64 (uint64x2_t, const int)
+ _Form of expected instruction(s):_ `vqrshrn.u64 D0, Q0, #0'
+
+ * uint16x4_t vqrshrn_n_u32 (uint32x4_t, const int)
+ _Form of expected instruction(s):_ `vqrshrn.u32 D0, Q0, #0'
+
+ * uint8x8_t vqrshrn_n_u16 (uint16x8_t, const int)
+ _Form of expected instruction(s):_ `vqrshrn.u16 D0, Q0, #0'
+
+ * int32x2_t vqrshrn_n_s64 (int64x2_t, const int)
+ _Form of expected instruction(s):_ `vqrshrn.s64 D0, Q0, #0'
+
+ * int16x4_t vqrshrn_n_s32 (int32x4_t, const int)
+ _Form of expected instruction(s):_ `vqrshrn.s32 D0, Q0, #0'
+
+ * int8x8_t vqrshrn_n_s16 (int16x8_t, const int)
+ _Form of expected instruction(s):_ `vqrshrn.s16 D0, Q0, #0'
+
+ * uint32x2_t vqshrun_n_s64 (int64x2_t, const int)
+ _Form of expected instruction(s):_ `vqshrun.s64 D0, Q0, #0'
+
+ * uint16x4_t vqshrun_n_s32 (int32x4_t, const int)
+ _Form of expected instruction(s):_ `vqshrun.s32 D0, Q0, #0'
+
+ * uint8x8_t vqshrun_n_s16 (int16x8_t, const int)
+ _Form of expected instruction(s):_ `vqshrun.s16 D0, Q0, #0'
+
+ * uint32x2_t vqrshrun_n_s64 (int64x2_t, const int)
+ _Form of expected instruction(s):_ `vqrshrun.s64 D0, Q0, #0'
+
+ * uint16x4_t vqrshrun_n_s32 (int32x4_t, const int)
+ _Form of expected instruction(s):_ `vqrshrun.s32 D0, Q0, #0'
+
+ * uint8x8_t vqrshrun_n_s16 (int16x8_t, const int)
+ _Form of expected instruction(s):_ `vqrshrun.s16 D0, Q0, #0'
+
+5.50.3.28 Vector shift right by constant and accumulate
+.......................................................
+
+ * uint32x2_t vsra_n_u32 (uint32x2_t, uint32x2_t, const int)
+ _Form of expected instruction(s):_ `vsra.u32 D0, D0, #0'
+
+ * uint16x4_t vsra_n_u16 (uint16x4_t, uint16x4_t, const int)
+ _Form of expected instruction(s):_ `vsra.u16 D0, D0, #0'
+
+ * uint8x8_t vsra_n_u8 (uint8x8_t, uint8x8_t, const int)
+ _Form of expected instruction(s):_ `vsra.u8 D0, D0, #0'
+
+ * int32x2_t vsra_n_s32 (int32x2_t, int32x2_t, const int)
+ _Form of expected instruction(s):_ `vsra.s32 D0, D0, #0'
+
+ * int16x4_t vsra_n_s16 (int16x4_t, int16x4_t, const int)
+ _Form of expected instruction(s):_ `vsra.s16 D0, D0, #0'
+
+ * int8x8_t vsra_n_s8 (int8x8_t, int8x8_t, const int)
+ _Form of expected instruction(s):_ `vsra.s8 D0, D0, #0'
+
+ * uint64x1_t vsra_n_u64 (uint64x1_t, uint64x1_t, const int)
+ _Form of expected instruction(s):_ `vsra.u64 D0, D0, #0'
+
+ * int64x1_t vsra_n_s64 (int64x1_t, int64x1_t, const int)
+ _Form of expected instruction(s):_ `vsra.s64 D0, D0, #0'
+
+ * uint32x4_t vsraq_n_u32 (uint32x4_t, uint32x4_t, const int)
+ _Form of expected instruction(s):_ `vsra.u32 Q0, Q0, #0'
+
+ * uint16x8_t vsraq_n_u16 (uint16x8_t, uint16x8_t, const int)
+ _Form of expected instruction(s):_ `vsra.u16 Q0, Q0, #0'
+
+ * uint8x16_t vsraq_n_u8 (uint8x16_t, uint8x16_t, const int)
+ _Form of expected instruction(s):_ `vsra.u8 Q0, Q0, #0'
+
+ * int32x4_t vsraq_n_s32 (int32x4_t, int32x4_t, const int)
+ _Form of expected instruction(s):_ `vsra.s32 Q0, Q0, #0'
+
+ * int16x8_t vsraq_n_s16 (int16x8_t, int16x8_t, const int)
+ _Form of expected instruction(s):_ `vsra.s16 Q0, Q0, #0'
+
+ * int8x16_t vsraq_n_s8 (int8x16_t, int8x16_t, const int)
+ _Form of expected instruction(s):_ `vsra.s8 Q0, Q0, #0'
+
+ * uint64x2_t vsraq_n_u64 (uint64x2_t, uint64x2_t, const int)
+ _Form of expected instruction(s):_ `vsra.u64 Q0, Q0, #0'
+
+ * int64x2_t vsraq_n_s64 (int64x2_t, int64x2_t, const int)
+ _Form of expected instruction(s):_ `vsra.s64 Q0, Q0, #0'
+
+ * uint32x2_t vrsra_n_u32 (uint32x2_t, uint32x2_t, const int)
+ _Form of expected instruction(s):_ `vrsra.u32 D0, D0, #0'
+
+ * uint16x4_t vrsra_n_u16 (uint16x4_t, uint16x4_t, const int)
+ _Form of expected instruction(s):_ `vrsra.u16 D0, D0, #0'
+
+ * uint8x8_t vrsra_n_u8 (uint8x8_t, uint8x8_t, const int)
+ _Form of expected instruction(s):_ `vrsra.u8 D0, D0, #0'
+
+ * int32x2_t vrsra_n_s32 (int32x2_t, int32x2_t, const int)
+ _Form of expected instruction(s):_ `vrsra.s32 D0, D0, #0'
+
+ * int16x4_t vrsra_n_s16 (int16x4_t, int16x4_t, const int)
+ _Form of expected instruction(s):_ `vrsra.s16 D0, D0, #0'
+
+ * int8x8_t vrsra_n_s8 (int8x8_t, int8x8_t, const int)
+ _Form of expected instruction(s):_ `vrsra.s8 D0, D0, #0'
+
+ * uint64x1_t vrsra_n_u64 (uint64x1_t, uint64x1_t, const int)
+ _Form of expected instruction(s):_ `vrsra.u64 D0, D0, #0'
+
+ * int64x1_t vrsra_n_s64 (int64x1_t, int64x1_t, const int)
+ _Form of expected instruction(s):_ `vrsra.s64 D0, D0, #0'
+
+ * uint32x4_t vrsraq_n_u32 (uint32x4_t, uint32x4_t, const int)
+ _Form of expected instruction(s):_ `vrsra.u32 Q0, Q0, #0'
+
+ * uint16x8_t vrsraq_n_u16 (uint16x8_t, uint16x8_t, const int)
+ _Form of expected instruction(s):_ `vrsra.u16 Q0, Q0, #0'
+
+ * uint8x16_t vrsraq_n_u8 (uint8x16_t, uint8x16_t, const int)
+ _Form of expected instruction(s):_ `vrsra.u8 Q0, Q0, #0'
+
+ * int32x4_t vrsraq_n_s32 (int32x4_t, int32x4_t, const int)
+ _Form of expected instruction(s):_ `vrsra.s32 Q0, Q0, #0'
+
+ * int16x8_t vrsraq_n_s16 (int16x8_t, int16x8_t, const int)
+ _Form of expected instruction(s):_ `vrsra.s16 Q0, Q0, #0'
+
+ * int8x16_t vrsraq_n_s8 (int8x16_t, int8x16_t, const int)
+ _Form of expected instruction(s):_ `vrsra.s8 Q0, Q0, #0'
+
+ * uint64x2_t vrsraq_n_u64 (uint64x2_t, uint64x2_t, const int)
+ _Form of expected instruction(s):_ `vrsra.u64 Q0, Q0, #0'
+
+ * int64x2_t vrsraq_n_s64 (int64x2_t, int64x2_t, const int)
+ _Form of expected instruction(s):_ `vrsra.s64 Q0, Q0, #0'
+
+5.50.3.29 Vector shift right and insert
+.......................................
+
+ * uint32x2_t vsri_n_u32 (uint32x2_t, uint32x2_t, const int)
+ _Form of expected instruction(s):_ `vsri.32 D0, D0, #0'
+
+ * uint16x4_t vsri_n_u16 (uint16x4_t, uint16x4_t, const int)
+ _Form of expected instruction(s):_ `vsri.16 D0, D0, #0'
+
+ * uint8x8_t vsri_n_u8 (uint8x8_t, uint8x8_t, const int)
+ _Form of expected instruction(s):_ `vsri.8 D0, D0, #0'
+
+ * int32x2_t vsri_n_s32 (int32x2_t, int32x2_t, const int)
+ _Form of expected instruction(s):_ `vsri.32 D0, D0, #0'
+
+ * int16x4_t vsri_n_s16 (int16x4_t, int16x4_t, const int)
+ _Form of expected instruction(s):_ `vsri.16 D0, D0, #0'
+
+ * int8x8_t vsri_n_s8 (int8x8_t, int8x8_t, const int)
+ _Form of expected instruction(s):_ `vsri.8 D0, D0, #0'
+
+ * uint64x1_t vsri_n_u64 (uint64x1_t, uint64x1_t, const int)
+ _Form of expected instruction(s):_ `vsri.64 D0, D0, #0'
+
+ * int64x1_t vsri_n_s64 (int64x1_t, int64x1_t, const int)
+ _Form of expected instruction(s):_ `vsri.64 D0, D0, #0'
+
+ * poly16x4_t vsri_n_p16 (poly16x4_t, poly16x4_t, const int)
+ _Form of expected instruction(s):_ `vsri.16 D0, D0, #0'
+
+ * poly8x8_t vsri_n_p8 (poly8x8_t, poly8x8_t, const int)
+ _Form of expected instruction(s):_ `vsri.8 D0, D0, #0'
+
+ * uint32x4_t vsriq_n_u32 (uint32x4_t, uint32x4_t, const int)
+ _Form of expected instruction(s):_ `vsri.32 Q0, Q0, #0'
+
+ * uint16x8_t vsriq_n_u16 (uint16x8_t, uint16x8_t, const int)
+ _Form of expected instruction(s):_ `vsri.16 Q0, Q0, #0'
+
+ * uint8x16_t vsriq_n_u8 (uint8x16_t, uint8x16_t, const int)
+ _Form of expected instruction(s):_ `vsri.8 Q0, Q0, #0'
+
+ * int32x4_t vsriq_n_s32 (int32x4_t, int32x4_t, const int)
+ _Form of expected instruction(s):_ `vsri.32 Q0, Q0, #0'
+
+ * int16x8_t vsriq_n_s16 (int16x8_t, int16x8_t, const int)
+ _Form of expected instruction(s):_ `vsri.16 Q0, Q0, #0'
+
+ * int8x16_t vsriq_n_s8 (int8x16_t, int8x16_t, const int)
+ _Form of expected instruction(s):_ `vsri.8 Q0, Q0, #0'
+
+ * uint64x2_t vsriq_n_u64 (uint64x2_t, uint64x2_t, const int)
+ _Form of expected instruction(s):_ `vsri.64 Q0, Q0, #0'
+
+ * int64x2_t vsriq_n_s64 (int64x2_t, int64x2_t, const int)
+ _Form of expected instruction(s):_ `vsri.64 Q0, Q0, #0'
+
+ * poly16x8_t vsriq_n_p16 (poly16x8_t, poly16x8_t, const int)
+ _Form of expected instruction(s):_ `vsri.16 Q0, Q0, #0'
+
+ * poly8x16_t vsriq_n_p8 (poly8x16_t, poly8x16_t, const int)
+ _Form of expected instruction(s):_ `vsri.8 Q0, Q0, #0'
+
+5.50.3.30 Vector shift left and insert
+......................................
+
+ * uint32x2_t vsli_n_u32 (uint32x2_t, uint32x2_t, const int)
+ _Form of expected instruction(s):_ `vsli.32 D0, D0, #0'
+
+ * uint16x4_t vsli_n_u16 (uint16x4_t, uint16x4_t, const int)
+ _Form of expected instruction(s):_ `vsli.16 D0, D0, #0'
+
+ * uint8x8_t vsli_n_u8 (uint8x8_t, uint8x8_t, const int)
+ _Form of expected instruction(s):_ `vsli.8 D0, D0, #0'
+
+ * int32x2_t vsli_n_s32 (int32x2_t, int32x2_t, const int)
+ _Form of expected instruction(s):_ `vsli.32 D0, D0, #0'
+
+ * int16x4_t vsli_n_s16 (int16x4_t, int16x4_t, const int)
+ _Form of expected instruction(s):_ `vsli.16 D0, D0, #0'
+
+ * int8x8_t vsli_n_s8 (int8x8_t, int8x8_t, const int)
+ _Form of expected instruction(s):_ `vsli.8 D0, D0, #0'
+
+ * uint64x1_t vsli_n_u64 (uint64x1_t, uint64x1_t, const int)
+ _Form of expected instruction(s):_ `vsli.64 D0, D0, #0'
+
+ * int64x1_t vsli_n_s64 (int64x1_t, int64x1_t, const int)
+ _Form of expected instruction(s):_ `vsli.64 D0, D0, #0'
+
+ * poly16x4_t vsli_n_p16 (poly16x4_t, poly16x4_t, const int)
+ _Form of expected instruction(s):_ `vsli.16 D0, D0, #0'
+
+ * poly8x8_t vsli_n_p8 (poly8x8_t, poly8x8_t, const int)
+ _Form of expected instruction(s):_ `vsli.8 D0, D0, #0'
+
+ * uint32x4_t vsliq_n_u32 (uint32x4_t, uint32x4_t, const int)
+ _Form of expected instruction(s):_ `vsli.32 Q0, Q0, #0'
+
+ * uint16x8_t vsliq_n_u16 (uint16x8_t, uint16x8_t, const int)
+ _Form of expected instruction(s):_ `vsli.16 Q0, Q0, #0'
+
+ * uint8x16_t vsliq_n_u8 (uint8x16_t, uint8x16_t, const int)
+ _Form of expected instruction(s):_ `vsli.8 Q0, Q0, #0'
+
+ * int32x4_t vsliq_n_s32 (int32x4_t, int32x4_t, const int)
+ _Form of expected instruction(s):_ `vsli.32 Q0, Q0, #0'
+
+ * int16x8_t vsliq_n_s16 (int16x8_t, int16x8_t, const int)
+ _Form of expected instruction(s):_ `vsli.16 Q0, Q0, #0'
+
+ * int8x16_t vsliq_n_s8 (int8x16_t, int8x16_t, const int)
+ _Form of expected instruction(s):_ `vsli.8 Q0, Q0, #0'
+
+ * uint64x2_t vsliq_n_u64 (uint64x2_t, uint64x2_t, const int)
+ _Form of expected instruction(s):_ `vsli.64 Q0, Q0, #0'
+
+ * int64x2_t vsliq_n_s64 (int64x2_t, int64x2_t, const int)
+ _Form of expected instruction(s):_ `vsli.64 Q0, Q0, #0'
+
+ * poly16x8_t vsliq_n_p16 (poly16x8_t, poly16x8_t, const int)
+ _Form of expected instruction(s):_ `vsli.16 Q0, Q0, #0'
+
+ * poly8x16_t vsliq_n_p8 (poly8x16_t, poly8x16_t, const int)
+ _Form of expected instruction(s):_ `vsli.8 Q0, Q0, #0'
+
+5.50.3.31 Absolute value
+........................
+
+ * float32x2_t vabs_f32 (float32x2_t)
+ _Form of expected instruction(s):_ `vabs.f32 D0, D0'
+
+ * int32x2_t vabs_s32 (int32x2_t)
+ _Form of expected instruction(s):_ `vabs.s32 D0, D0'
+
+ * int16x4_t vabs_s16 (int16x4_t)
+ _Form of expected instruction(s):_ `vabs.s16 D0, D0'
+
+ * int8x8_t vabs_s8 (int8x8_t)
+ _Form of expected instruction(s):_ `vabs.s8 D0, D0'
+
+ * float32x4_t vabsq_f32 (float32x4_t)
+ _Form of expected instruction(s):_ `vabs.f32 Q0, Q0'
+
+ * int32x4_t vabsq_s32 (int32x4_t)
+ _Form of expected instruction(s):_ `vabs.s32 Q0, Q0'
+
+ * int16x8_t vabsq_s16 (int16x8_t)
+ _Form of expected instruction(s):_ `vabs.s16 Q0, Q0'
+
+ * int8x16_t vabsq_s8 (int8x16_t)
+ _Form of expected instruction(s):_ `vabs.s8 Q0, Q0'
+
+ * int32x2_t vqabs_s32 (int32x2_t)
+ _Form of expected instruction(s):_ `vqabs.s32 D0, D0'
+
+ * int16x4_t vqabs_s16 (int16x4_t)
+ _Form of expected instruction(s):_ `vqabs.s16 D0, D0'
+
+ * int8x8_t vqabs_s8 (int8x8_t)
+ _Form of expected instruction(s):_ `vqabs.s8 D0, D0'
+
+ * int32x4_t vqabsq_s32 (int32x4_t)
+ _Form of expected instruction(s):_ `vqabs.s32 Q0, Q0'
+
+ * int16x8_t vqabsq_s16 (int16x8_t)
+ _Form of expected instruction(s):_ `vqabs.s16 Q0, Q0'
+
+ * int8x16_t vqabsq_s8 (int8x16_t)
+ _Form of expected instruction(s):_ `vqabs.s8 Q0, Q0'
+
+5.50.3.32 Negation
+..................
+
+ * float32x2_t vneg_f32 (float32x2_t)
+ _Form of expected instruction(s):_ `vneg.f32 D0, D0'
+
+ * int32x2_t vneg_s32 (int32x2_t)
+ _Form of expected instruction(s):_ `vneg.s32 D0, D0'
+
+ * int16x4_t vneg_s16 (int16x4_t)
+ _Form of expected instruction(s):_ `vneg.s16 D0, D0'
+
+ * int8x8_t vneg_s8 (int8x8_t)
+ _Form of expected instruction(s):_ `vneg.s8 D0, D0'
+
+ * float32x4_t vnegq_f32 (float32x4_t)
+ _Form of expected instruction(s):_ `vneg.f32 Q0, Q0'
+
+ * int32x4_t vnegq_s32 (int32x4_t)
+ _Form of expected instruction(s):_ `vneg.s32 Q0, Q0'
+
+ * int16x8_t vnegq_s16 (int16x8_t)
+ _Form of expected instruction(s):_ `vneg.s16 Q0, Q0'
+
+ * int8x16_t vnegq_s8 (int8x16_t)
+ _Form of expected instruction(s):_ `vneg.s8 Q0, Q0'
+
+ * int32x2_t vqneg_s32 (int32x2_t)
+ _Form of expected instruction(s):_ `vqneg.s32 D0, D0'
+
+ * int16x4_t vqneg_s16 (int16x4_t)
+ _Form of expected instruction(s):_ `vqneg.s16 D0, D0'
+
+ * int8x8_t vqneg_s8 (int8x8_t)
+ _Form of expected instruction(s):_ `vqneg.s8 D0, D0'
+
+ * int32x4_t vqnegq_s32 (int32x4_t)
+ _Form of expected instruction(s):_ `vqneg.s32 Q0, Q0'
+
+ * int16x8_t vqnegq_s16 (int16x8_t)
+ _Form of expected instruction(s):_ `vqneg.s16 Q0, Q0'
+
+ * int8x16_t vqnegq_s8 (int8x16_t)
+ _Form of expected instruction(s):_ `vqneg.s8 Q0, Q0'
+
+5.50.3.33 Bitwise not
+.....................
+
+ * uint32x2_t vmvn_u32 (uint32x2_t)
+ _Form of expected instruction(s):_ `vmvn D0, D0'
+
+ * uint16x4_t vmvn_u16 (uint16x4_t)
+ _Form of expected instruction(s):_ `vmvn D0, D0'
+
+ * uint8x8_t vmvn_u8 (uint8x8_t)
+ _Form of expected instruction(s):_ `vmvn D0, D0'
+
+ * int32x2_t vmvn_s32 (int32x2_t)
+ _Form of expected instruction(s):_ `vmvn D0, D0'
+
+ * int16x4_t vmvn_s16 (int16x4_t)
+ _Form of expected instruction(s):_ `vmvn D0, D0'
+
+ * int8x8_t vmvn_s8 (int8x8_t)
+ _Form of expected instruction(s):_ `vmvn D0, D0'
+
+ * poly8x8_t vmvn_p8 (poly8x8_t)
+ _Form of expected instruction(s):_ `vmvn D0, D0'
+
+ * uint32x4_t vmvnq_u32 (uint32x4_t)
+ _Form of expected instruction(s):_ `vmvn Q0, Q0'
+
+ * uint16x8_t vmvnq_u16 (uint16x8_t)
+ _Form of expected instruction(s):_ `vmvn Q0, Q0'
+
+ * uint8x16_t vmvnq_u8 (uint8x16_t)
+ _Form of expected instruction(s):_ `vmvn Q0, Q0'
+
+ * int32x4_t vmvnq_s32 (int32x4_t)
+ _Form of expected instruction(s):_ `vmvn Q0, Q0'
+
+ * int16x8_t vmvnq_s16 (int16x8_t)
+ _Form of expected instruction(s):_ `vmvn Q0, Q0'
+
+ * int8x16_t vmvnq_s8 (int8x16_t)
+ _Form of expected instruction(s):_ `vmvn Q0, Q0'
+
+ * poly8x16_t vmvnq_p8 (poly8x16_t)
+ _Form of expected instruction(s):_ `vmvn Q0, Q0'
+
+5.50.3.34 Count leading sign bits
+.................................
+
+ * int32x2_t vcls_s32 (int32x2_t)
+ _Form of expected instruction(s):_ `vcls.s32 D0, D0'
+
+ * int16x4_t vcls_s16 (int16x4_t)
+ _Form of expected instruction(s):_ `vcls.s16 D0, D0'
+
+ * int8x8_t vcls_s8 (int8x8_t)
+ _Form of expected instruction(s):_ `vcls.s8 D0, D0'
+
+ * int32x4_t vclsq_s32 (int32x4_t)
+ _Form of expected instruction(s):_ `vcls.s32 Q0, Q0'
+
+ * int16x8_t vclsq_s16 (int16x8_t)
+ _Form of expected instruction(s):_ `vcls.s16 Q0, Q0'
+
+ * int8x16_t vclsq_s8 (int8x16_t)
+ _Form of expected instruction(s):_ `vcls.s8 Q0, Q0'
+
+5.50.3.35 Count leading zeros
+.............................
+
+ * uint32x2_t vclz_u32 (uint32x2_t)
+ _Form of expected instruction(s):_ `vclz.i32 D0, D0'
+
+ * uint16x4_t vclz_u16 (uint16x4_t)
+ _Form of expected instruction(s):_ `vclz.i16 D0, D0'
+
+ * uint8x8_t vclz_u8 (uint8x8_t)
+ _Form of expected instruction(s):_ `vclz.i8 D0, D0'
+
+ * int32x2_t vclz_s32 (int32x2_t)
+ _Form of expected instruction(s):_ `vclz.i32 D0, D0'
+
+ * int16x4_t vclz_s16 (int16x4_t)
+ _Form of expected instruction(s):_ `vclz.i16 D0, D0'
+
+ * int8x8_t vclz_s8 (int8x8_t)
+ _Form of expected instruction(s):_ `vclz.i8 D0, D0'
+
+ * uint32x4_t vclzq_u32 (uint32x4_t)
+ _Form of expected instruction(s):_ `vclz.i32 Q0, Q0'
+
+ * uint16x8_t vclzq_u16 (uint16x8_t)
+ _Form of expected instruction(s):_ `vclz.i16 Q0, Q0'
+
+ * uint8x16_t vclzq_u8 (uint8x16_t)
+ _Form of expected instruction(s):_ `vclz.i8 Q0, Q0'
+
+ * int32x4_t vclzq_s32 (int32x4_t)
+ _Form of expected instruction(s):_ `vclz.i32 Q0, Q0'
+
+ * int16x8_t vclzq_s16 (int16x8_t)
+ _Form of expected instruction(s):_ `vclz.i16 Q0, Q0'
+
+ * int8x16_t vclzq_s8 (int8x16_t)
+ _Form of expected instruction(s):_ `vclz.i8 Q0, Q0'
+
+5.50.3.36 Count number of set bits
+..................................
+
+ * uint8x8_t vcnt_u8 (uint8x8_t)
+ _Form of expected instruction(s):_ `vcnt.8 D0, D0'
+
+ * int8x8_t vcnt_s8 (int8x8_t)
+ _Form of expected instruction(s):_ `vcnt.8 D0, D0'
+
+ * poly8x8_t vcnt_p8 (poly8x8_t)
+ _Form of expected instruction(s):_ `vcnt.8 D0, D0'
+
+ * uint8x16_t vcntq_u8 (uint8x16_t)
+ _Form of expected instruction(s):_ `vcnt.8 Q0, Q0'
+
+ * int8x16_t vcntq_s8 (int8x16_t)
+ _Form of expected instruction(s):_ `vcnt.8 Q0, Q0'
+
+ * poly8x16_t vcntq_p8 (poly8x16_t)
+ _Form of expected instruction(s):_ `vcnt.8 Q0, Q0'
+
+5.50.3.37 Reciprocal estimate
+.............................
+
+ * float32x2_t vrecpe_f32 (float32x2_t)
+ _Form of expected instruction(s):_ `vrecpe.f32 D0, D0'
+
+ * uint32x2_t vrecpe_u32 (uint32x2_t)
+ _Form of expected instruction(s):_ `vrecpe.u32 D0, D0'
+
+ * float32x4_t vrecpeq_f32 (float32x4_t)
+ _Form of expected instruction(s):_ `vrecpe.f32 Q0, Q0'
+
+ * uint32x4_t vrecpeq_u32 (uint32x4_t)
+ _Form of expected instruction(s):_ `vrecpe.u32 Q0, Q0'
+
+5.50.3.38 Reciprocal square-root estimate
+.........................................
+
+ * float32x2_t vrsqrte_f32 (float32x2_t)
+ _Form of expected instruction(s):_ `vrsqrte.f32 D0, D0'
+
+ * uint32x2_t vrsqrte_u32 (uint32x2_t)
+ _Form of expected instruction(s):_ `vrsqrte.u32 D0, D0'
+
+ * float32x4_t vrsqrteq_f32 (float32x4_t)
+ _Form of expected instruction(s):_ `vrsqrte.f32 Q0, Q0'
+
+ * uint32x4_t vrsqrteq_u32 (uint32x4_t)
+ _Form of expected instruction(s):_ `vrsqrte.u32 Q0, Q0'
+
+5.50.3.39 Get lanes from a vector
+.................................
+
+ * uint32_t vget_lane_u32 (uint32x2_t, const int)
+ _Form of expected instruction(s):_ `vmov.u32 R0, D0[0]'
+
+ * uint16_t vget_lane_u16 (uint16x4_t, const int)
+ _Form of expected instruction(s):_ `vmov.u16 R0, D0[0]'
+
+ * uint8_t vget_lane_u8 (uint8x8_t, const int)
+ _Form of expected instruction(s):_ `vmov.u8 R0, D0[0]'
+
+ * int32_t vget_lane_s32 (int32x2_t, const int)
+ _Form of expected instruction(s):_ `vmov.s32 R0, D0[0]'
+
+ * int16_t vget_lane_s16 (int16x4_t, const int)
+ _Form of expected instruction(s):_ `vmov.s16 R0, D0[0]'
+
+ * int8_t vget_lane_s8 (int8x8_t, const int)
+ _Form of expected instruction(s):_ `vmov.s8 R0, D0[0]'
+
+ * float32_t vget_lane_f32 (float32x2_t, const int)
+ _Form of expected instruction(s):_ `vmov.f32 R0, D0[0]'
+
+ * poly16_t vget_lane_p16 (poly16x4_t, const int)
+ _Form of expected instruction(s):_ `vmov.u16 R0, D0[0]'
+
+ * poly8_t vget_lane_p8 (poly8x8_t, const int)
+ _Form of expected instruction(s):_ `vmov.u8 R0, D0[0]'
+
+ * uint64_t vget_lane_u64 (uint64x1_t, const int)
+ _Form of expected instruction(s):_ `vmov R0, R0, D0'
+
+ * int64_t vget_lane_s64 (int64x1_t, const int)
+ _Form of expected instruction(s):_ `vmov R0, R0, D0'
+
+ * uint32_t vgetq_lane_u32 (uint32x4_t, const int)
+ _Form of expected instruction(s):_ `vmov.u32 R0, D0[0]'
+
+ * uint16_t vgetq_lane_u16 (uint16x8_t, const int)
+ _Form of expected instruction(s):_ `vmov.u16 R0, D0[0]'
+
+ * uint8_t vgetq_lane_u8 (uint8x16_t, const int)
+ _Form of expected instruction(s):_ `vmov.u8 R0, D0[0]'
+
+ * int32_t vgetq_lane_s32 (int32x4_t, const int)
+ _Form of expected instruction(s):_ `vmov.s32 R0, D0[0]'
+
+ * int16_t vgetq_lane_s16 (int16x8_t, const int)
+ _Form of expected instruction(s):_ `vmov.s16 R0, D0[0]'
+
+ * int8_t vgetq_lane_s8 (int8x16_t, const int)
+ _Form of expected instruction(s):_ `vmov.s8 R0, D0[0]'
+
+ * float32_t vgetq_lane_f32 (float32x4_t, const int)
+ _Form of expected instruction(s):_ `vmov.f32 R0, D0[0]'
+
+ * poly16_t vgetq_lane_p16 (poly16x8_t, const int)
+ _Form of expected instruction(s):_ `vmov.u16 R0, D0[0]'
+
+ * poly8_t vgetq_lane_p8 (poly8x16_t, const int)
+ _Form of expected instruction(s):_ `vmov.u8 R0, D0[0]'
+
+ * uint64_t vgetq_lane_u64 (uint64x2_t, const int)
+ _Form of expected instruction(s):_ `vmov R0, R0, D0'
+
+ * int64_t vgetq_lane_s64 (int64x2_t, const int)
+ _Form of expected instruction(s):_ `vmov R0, R0, D0'
+
+5.50.3.40 Set lanes in a vector
+...............................
+
+ * uint32x2_t vset_lane_u32 (uint32_t, uint32x2_t, const int)
+ _Form of expected instruction(s):_ `vmov.32 D0[0], R0'
+
+ * uint16x4_t vset_lane_u16 (uint16_t, uint16x4_t, const int)
+ _Form of expected instruction(s):_ `vmov.16 D0[0], R0'
+
+ * uint8x8_t vset_lane_u8 (uint8_t, uint8x8_t, const int)
+ _Form of expected instruction(s):_ `vmov.8 D0[0], R0'
+
+ * int32x2_t vset_lane_s32 (int32_t, int32x2_t, const int)
+ _Form of expected instruction(s):_ `vmov.32 D0[0], R0'
+
+ * int16x4_t vset_lane_s16 (int16_t, int16x4_t, const int)
+ _Form of expected instruction(s):_ `vmov.16 D0[0], R0'
+
+ * int8x8_t vset_lane_s8 (int8_t, int8x8_t, const int)
+ _Form of expected instruction(s):_ `vmov.8 D0[0], R0'
+
+ * float32x2_t vset_lane_f32 (float32_t, float32x2_t, const int)
+ _Form of expected instruction(s):_ `vmov.32 D0[0], R0'
+
+ * poly16x4_t vset_lane_p16 (poly16_t, poly16x4_t, const int)
+ _Form of expected instruction(s):_ `vmov.16 D0[0], R0'
+
+ * poly8x8_t vset_lane_p8 (poly8_t, poly8x8_t, const int)
+ _Form of expected instruction(s):_ `vmov.8 D0[0], R0'
+
+ * uint64x1_t vset_lane_u64 (uint64_t, uint64x1_t, const int)
+ _Form of expected instruction(s):_ `vmov D0, R0, R0'
+
+ * int64x1_t vset_lane_s64 (int64_t, int64x1_t, const int)
+ _Form of expected instruction(s):_ `vmov D0, R0, R0'
+
+ * uint32x4_t vsetq_lane_u32 (uint32_t, uint32x4_t, const int)
+ _Form of expected instruction(s):_ `vmov.32 D0[0], R0'
+
+ * uint16x8_t vsetq_lane_u16 (uint16_t, uint16x8_t, const int)
+ _Form of expected instruction(s):_ `vmov.16 D0[0], R0'
+
+ * uint8x16_t vsetq_lane_u8 (uint8_t, uint8x16_t, const int)
+ _Form of expected instruction(s):_ `vmov.8 D0[0], R0'
+
+ * int32x4_t vsetq_lane_s32 (int32_t, int32x4_t, const int)
+ _Form of expected instruction(s):_ `vmov.32 D0[0], R0'
+
+ * int16x8_t vsetq_lane_s16 (int16_t, int16x8_t, const int)
+ _Form of expected instruction(s):_ `vmov.16 D0[0], R0'
+
+ * int8x16_t vsetq_lane_s8 (int8_t, int8x16_t, const int)
+ _Form of expected instruction(s):_ `vmov.8 D0[0], R0'
+
+ * float32x4_t vsetq_lane_f32 (float32_t, float32x4_t, const int)
+ _Form of expected instruction(s):_ `vmov.32 D0[0], R0'
+
+ * poly16x8_t vsetq_lane_p16 (poly16_t, poly16x8_t, const int)
+ _Form of expected instruction(s):_ `vmov.16 D0[0], R0'
+
+ * poly8x16_t vsetq_lane_p8 (poly8_t, poly8x16_t, const int)
+ _Form of expected instruction(s):_ `vmov.8 D0[0], R0'
+
+ * uint64x2_t vsetq_lane_u64 (uint64_t, uint64x2_t, const int)
+ _Form of expected instruction(s):_ `vmov D0, R0, R0'
+
+ * int64x2_t vsetq_lane_s64 (int64_t, int64x2_t, const int)
+ _Form of expected instruction(s):_ `vmov D0, R0, R0'
+
+5.50.3.41 Create vector from literal bit pattern
+................................................
+
+ * uint32x2_t vcreate_u32 (uint64_t)
+
+ * uint16x4_t vcreate_u16 (uint64_t)
+
+ * uint8x8_t vcreate_u8 (uint64_t)
+
+ * int32x2_t vcreate_s32 (uint64_t)
+
+ * int16x4_t vcreate_s16 (uint64_t)
+
+ * int8x8_t vcreate_s8 (uint64_t)
+
+ * uint64x1_t vcreate_u64 (uint64_t)
+
+ * int64x1_t vcreate_s64 (uint64_t)
+
+ * float32x2_t vcreate_f32 (uint64_t)
+
+ * poly16x4_t vcreate_p16 (uint64_t)
+
+ * poly8x8_t vcreate_p8 (uint64_t)
+
+5.50.3.42 Set all lanes to the same value
+.........................................
+
+ * uint32x2_t vdup_n_u32 (uint32_t)
+ _Form of expected instruction(s):_ `vdup.32 D0, R0'
+
+ * uint16x4_t vdup_n_u16 (uint16_t)
+ _Form of expected instruction(s):_ `vdup.16 D0, R0'
+
+ * uint8x8_t vdup_n_u8 (uint8_t)
+ _Form of expected instruction(s):_ `vdup.8 D0, R0'
+
+ * int32x2_t vdup_n_s32 (int32_t)
+ _Form of expected instruction(s):_ `vdup.32 D0, R0'
+
+ * int16x4_t vdup_n_s16 (int16_t)
+ _Form of expected instruction(s):_ `vdup.16 D0, R0'
+
+ * int8x8_t vdup_n_s8 (int8_t)
+ _Form of expected instruction(s):_ `vdup.8 D0, R0'
+
+ * float32x2_t vdup_n_f32 (float32_t)
+ _Form of expected instruction(s):_ `vdup.32 D0, R0'
+
+ * poly16x4_t vdup_n_p16 (poly16_t)
+ _Form of expected instruction(s):_ `vdup.16 D0, R0'
+
+ * poly8x8_t vdup_n_p8 (poly8_t)
+ _Form of expected instruction(s):_ `vdup.8 D0, R0'
+
+ * uint64x1_t vdup_n_u64 (uint64_t)
+ _Form of expected instruction(s):_ `vmov D0, R0, R0'
+
+ * int64x1_t vdup_n_s64 (int64_t)
+ _Form of expected instruction(s):_ `vmov D0, R0, R0'
+
+ * uint32x4_t vdupq_n_u32 (uint32_t)
+ _Form of expected instruction(s):_ `vdup.32 Q0, R0'
+
+ * uint16x8_t vdupq_n_u16 (uint16_t)
+ _Form of expected instruction(s):_ `vdup.16 Q0, R0'
+
+ * uint8x16_t vdupq_n_u8 (uint8_t)
+ _Form of expected instruction(s):_ `vdup.8 Q0, R0'
+
+ * int32x4_t vdupq_n_s32 (int32_t)
+ _Form of expected instruction(s):_ `vdup.32 Q0, R0'
+
+ * int16x8_t vdupq_n_s16 (int16_t)
+ _Form of expected instruction(s):_ `vdup.16 Q0, R0'
+
+ * int8x16_t vdupq_n_s8 (int8_t)
+ _Form of expected instruction(s):_ `vdup.8 Q0, R0'
+
+ * float32x4_t vdupq_n_f32 (float32_t)
+ _Form of expected instruction(s):_ `vdup.32 Q0, R0'
+
+ * poly16x8_t vdupq_n_p16 (poly16_t)
+ _Form of expected instruction(s):_ `vdup.16 Q0, R0'
+
+ * poly8x16_t vdupq_n_p8 (poly8_t)
+ _Form of expected instruction(s):_ `vdup.8 Q0, R0'
+
+ * uint64x2_t vdupq_n_u64 (uint64_t)
+ _Form of expected instruction(s):_ `vmov D0, R0, R0'
+
+ * int64x2_t vdupq_n_s64 (int64_t)
+ _Form of expected instruction(s):_ `vmov D0, R0, R0'
+
+ * uint32x2_t vmov_n_u32 (uint32_t)
+ _Form of expected instruction(s):_ `vdup.32 D0, R0'
+
+ * uint16x4_t vmov_n_u16 (uint16_t)
+ _Form of expected instruction(s):_ `vdup.16 D0, R0'
+
+ * uint8x8_t vmov_n_u8 (uint8_t)
+ _Form of expected instruction(s):_ `vdup.8 D0, R0'
+
+ * int32x2_t vmov_n_s32 (int32_t)
+ _Form of expected instruction(s):_ `vdup.32 D0, R0'
+
+ * int16x4_t vmov_n_s16 (int16_t)
+ _Form of expected instruction(s):_ `vdup.16 D0, R0'
+
+ * int8x8_t vmov_n_s8 (int8_t)
+ _Form of expected instruction(s):_ `vdup.8 D0, R0'
+
+ * float32x2_t vmov_n_f32 (float32_t)
+ _Form of expected instruction(s):_ `vdup.32 D0, R0'
+
+ * poly16x4_t vmov_n_p16 (poly16_t)
+ _Form of expected instruction(s):_ `vdup.16 D0, R0'
+
+ * poly8x8_t vmov_n_p8 (poly8_t)
+ _Form of expected instruction(s):_ `vdup.8 D0, R0'
+
+ * uint64x1_t vmov_n_u64 (uint64_t)
+ _Form of expected instruction(s):_ `vmov D0, R0, R0'
+
+ * int64x1_t vmov_n_s64 (int64_t)
+ _Form of expected instruction(s):_ `vmov D0, R0, R0'
+
+ * uint32x4_t vmovq_n_u32 (uint32_t)
+ _Form of expected instruction(s):_ `vdup.32 Q0, R0'
+
+ * uint16x8_t vmovq_n_u16 (uint16_t)
+ _Form of expected instruction(s):_ `vdup.16 Q0, R0'
+
+ * uint8x16_t vmovq_n_u8 (uint8_t)
+ _Form of expected instruction(s):_ `vdup.8 Q0, R0'
+
+ * int32x4_t vmovq_n_s32 (int32_t)
+ _Form of expected instruction(s):_ `vdup.32 Q0, R0'
+
+ * int16x8_t vmovq_n_s16 (int16_t)
+ _Form of expected instruction(s):_ `vdup.16 Q0, R0'
+
+ * int8x16_t vmovq_n_s8 (int8_t)
+ _Form of expected instruction(s):_ `vdup.8 Q0, R0'
+
+ * float32x4_t vmovq_n_f32 (float32_t)
+ _Form of expected instruction(s):_ `vdup.32 Q0, R0'
+
+ * poly16x8_t vmovq_n_p16 (poly16_t)
+ _Form of expected instruction(s):_ `vdup.16 Q0, R0'
+
+ * poly8x16_t vmovq_n_p8 (poly8_t)
+ _Form of expected instruction(s):_ `vdup.8 Q0, R0'
+
+ * uint64x2_t vmovq_n_u64 (uint64_t)
+ _Form of expected instruction(s):_ `vmov D0, R0, R0'
+
+ * int64x2_t vmovq_n_s64 (int64_t)
+ _Form of expected instruction(s):_ `vmov D0, R0, R0'
+
+ * uint32x2_t vdup_lane_u32 (uint32x2_t, const int)
+ _Form of expected instruction(s):_ `vdup.32 D0, D0[0]'
+
+ * uint16x4_t vdup_lane_u16 (uint16x4_t, const int)
+ _Form of expected instruction(s):_ `vdup.16 D0, D0[0]'
+
+ * uint8x8_t vdup_lane_u8 (uint8x8_t, const int)
+ _Form of expected instruction(s):_ `vdup.8 D0, D0[0]'
+
+ * int32x2_t vdup_lane_s32 (int32x2_t, const int)
+ _Form of expected instruction(s):_ `vdup.32 D0, D0[0]'
+
+ * int16x4_t vdup_lane_s16 (int16x4_t, const int)
+ _Form of expected instruction(s):_ `vdup.16 D0, D0[0]'
+
+ * int8x8_t vdup_lane_s8 (int8x8_t, const int)
+ _Form of expected instruction(s):_ `vdup.8 D0, D0[0]'
+
+ * float32x2_t vdup_lane_f32 (float32x2_t, const int)
+ _Form of expected instruction(s):_ `vdup.32 D0, D0[0]'
+
+ * poly16x4_t vdup_lane_p16 (poly16x4_t, const int)
+ _Form of expected instruction(s):_ `vdup.16 D0, D0[0]'
+
+ * poly8x8_t vdup_lane_p8 (poly8x8_t, const int)
+ _Form of expected instruction(s):_ `vdup.8 D0, D0[0]'
+
+ * uint64x1_t vdup_lane_u64 (uint64x1_t, const int)
+
+ * int64x1_t vdup_lane_s64 (int64x1_t, const int)
+
+ * uint32x4_t vdupq_lane_u32 (uint32x2_t, const int)
+ _Form of expected instruction(s):_ `vdup.32 Q0, D0[0]'
+
+ * uint16x8_t vdupq_lane_u16 (uint16x4_t, const int)
+ _Form of expected instruction(s):_ `vdup.16 Q0, D0[0]'
+
+ * uint8x16_t vdupq_lane_u8 (uint8x8_t, const int)
+ _Form of expected instruction(s):_ `vdup.8 Q0, D0[0]'
+
+ * int32x4_t vdupq_lane_s32 (int32x2_t, const int)
+ _Form of expected instruction(s):_ `vdup.32 Q0, D0[0]'
+
+ * int16x8_t vdupq_lane_s16 (int16x4_t, const int)
+ _Form of expected instruction(s):_ `vdup.16 Q0, D0[0]'
+
+ * int8x16_t vdupq_lane_s8 (int8x8_t, const int)
+ _Form of expected instruction(s):_ `vdup.8 Q0, D0[0]'
+
+ * float32x4_t vdupq_lane_f32 (float32x2_t, const int)
+ _Form of expected instruction(s):_ `vdup.32 Q0, D0[0]'
+
+ * poly16x8_t vdupq_lane_p16 (poly16x4_t, const int)
+ _Form of expected instruction(s):_ `vdup.16 Q0, D0[0]'
+
+ * poly8x16_t vdupq_lane_p8 (poly8x8_t, const int)
+ _Form of expected instruction(s):_ `vdup.8 Q0, D0[0]'
+
+ * uint64x2_t vdupq_lane_u64 (uint64x1_t, const int)
+
+ * int64x2_t vdupq_lane_s64 (int64x1_t, const int)
+
+5.50.3.43 Combining vectors
+...........................
+
+ * uint32x4_t vcombine_u32 (uint32x2_t, uint32x2_t)
+
+ * uint16x8_t vcombine_u16 (uint16x4_t, uint16x4_t)
+
+ * uint8x16_t vcombine_u8 (uint8x8_t, uint8x8_t)
+
+ * int32x4_t vcombine_s32 (int32x2_t, int32x2_t)
+
+ * int16x8_t vcombine_s16 (int16x4_t, int16x4_t)
+
+ * int8x16_t vcombine_s8 (int8x8_t, int8x8_t)
+
+ * uint64x2_t vcombine_u64 (uint64x1_t, uint64x1_t)
+
+ * int64x2_t vcombine_s64 (int64x1_t, int64x1_t)
+
+ * float32x4_t vcombine_f32 (float32x2_t, float32x2_t)
+
+ * poly16x8_t vcombine_p16 (poly16x4_t, poly16x4_t)
+
+ * poly8x16_t vcombine_p8 (poly8x8_t, poly8x8_t)
+
+5.50.3.44 Splitting vectors
+...........................
+
+ * uint32x2_t vget_high_u32 (uint32x4_t)
+
+ * uint16x4_t vget_high_u16 (uint16x8_t)
+
+ * uint8x8_t vget_high_u8 (uint8x16_t)
+
+ * int32x2_t vget_high_s32 (int32x4_t)
+
+ * int16x4_t vget_high_s16 (int16x8_t)
+
+ * int8x8_t vget_high_s8 (int8x16_t)
+
+ * uint64x1_t vget_high_u64 (uint64x2_t)
+
+ * int64x1_t vget_high_s64 (int64x2_t)
+
+ * float32x2_t vget_high_f32 (float32x4_t)
+
+ * poly16x4_t vget_high_p16 (poly16x8_t)
+
+ * poly8x8_t vget_high_p8 (poly8x16_t)
+
+ * uint32x2_t vget_low_u32 (uint32x4_t)
+ _Form of expected instruction(s):_ `vmov D0, D0'
+
+ * uint16x4_t vget_low_u16 (uint16x8_t)
+ _Form of expected instruction(s):_ `vmov D0, D0'
+
+ * uint8x8_t vget_low_u8 (uint8x16_t)
+ _Form of expected instruction(s):_ `vmov D0, D0'
+
+ * int32x2_t vget_low_s32 (int32x4_t)
+ _Form of expected instruction(s):_ `vmov D0, D0'
+
+ * int16x4_t vget_low_s16 (int16x8_t)
+ _Form of expected instruction(s):_ `vmov D0, D0'
+
+ * int8x8_t vget_low_s8 (int8x16_t)
+ _Form of expected instruction(s):_ `vmov D0, D0'
+
+ * uint64x1_t vget_low_u64 (uint64x2_t)
+ _Form of expected instruction(s):_ `vmov D0, D0'
+
+ * int64x1_t vget_low_s64 (int64x2_t)
+ _Form of expected instruction(s):_ `vmov D0, D0'
+
+ * float32x2_t vget_low_f32 (float32x4_t)
+ _Form of expected instruction(s):_ `vmov D0, D0'
+
+ * poly16x4_t vget_low_p16 (poly16x8_t)
+ _Form of expected instruction(s):_ `vmov D0, D0'
+
+ * poly8x8_t vget_low_p8 (poly8x16_t)
+ _Form of expected instruction(s):_ `vmov D0, D0'
+
+5.50.3.45 Conversions
+.....................
+
+ * float32x2_t vcvt_f32_u32 (uint32x2_t)
+ _Form of expected instruction(s):_ `vcvt.f32.u32 D0, D0'
+
+ * float32x2_t vcvt_f32_s32 (int32x2_t)
+ _Form of expected instruction(s):_ `vcvt.f32.s32 D0, D0'
+
+ * uint32x2_t vcvt_u32_f32 (float32x2_t)
+ _Form of expected instruction(s):_ `vcvt.u32.f32 D0, D0'
+
+ * int32x2_t vcvt_s32_f32 (float32x2_t)
+ _Form of expected instruction(s):_ `vcvt.s32.f32 D0, D0'
+
+ * float32x4_t vcvtq_f32_u32 (uint32x4_t)
+ _Form of expected instruction(s):_ `vcvt.f32.u32 Q0, Q0'
+
+ * float32x4_t vcvtq_f32_s32 (int32x4_t)
+ _Form of expected instruction(s):_ `vcvt.f32.s32 Q0, Q0'
+
+ * uint32x4_t vcvtq_u32_f32 (float32x4_t)
+ _Form of expected instruction(s):_ `vcvt.u32.f32 Q0, Q0'
+
+ * int32x4_t vcvtq_s32_f32 (float32x4_t)
+ _Form of expected instruction(s):_ `vcvt.s32.f32 Q0, Q0'
+
+ * float32x2_t vcvt_n_f32_u32 (uint32x2_t, const int)
+ _Form of expected instruction(s):_ `vcvt.f32.u32 D0, D0, #0'
+
+ * float32x2_t vcvt_n_f32_s32 (int32x2_t, const int)
+ _Form of expected instruction(s):_ `vcvt.f32.s32 D0, D0, #0'
+
+ * uint32x2_t vcvt_n_u32_f32 (float32x2_t, const int)
+ _Form of expected instruction(s):_ `vcvt.u32.f32 D0, D0, #0'
+
+ * int32x2_t vcvt_n_s32_f32 (float32x2_t, const int)
+ _Form of expected instruction(s):_ `vcvt.s32.f32 D0, D0, #0'
+
+ * float32x4_t vcvtq_n_f32_u32 (uint32x4_t, const int)
+ _Form of expected instruction(s):_ `vcvt.f32.u32 Q0, Q0, #0'
+
+ * float32x4_t vcvtq_n_f32_s32 (int32x4_t, const int)
+ _Form of expected instruction(s):_ `vcvt.f32.s32 Q0, Q0, #0'
+
+ * uint32x4_t vcvtq_n_u32_f32 (float32x4_t, const int)
+ _Form of expected instruction(s):_ `vcvt.u32.f32 Q0, Q0, #0'
+
+ * int32x4_t vcvtq_n_s32_f32 (float32x4_t, const int)
+ _Form of expected instruction(s):_ `vcvt.s32.f32 Q0, Q0, #0'
+
+5.50.3.46 Move, single_opcode narrowing
+.......................................
+
+ * uint32x2_t vmovn_u64 (uint64x2_t)
+ _Form of expected instruction(s):_ `vmovn.i64 D0, Q0'
+
+ * uint16x4_t vmovn_u32 (uint32x4_t)
+ _Form of expected instruction(s):_ `vmovn.i32 D0, Q0'
+
+ * uint8x8_t vmovn_u16 (uint16x8_t)
+ _Form of expected instruction(s):_ `vmovn.i16 D0, Q0'
+
+ * int32x2_t vmovn_s64 (int64x2_t)
+ _Form of expected instruction(s):_ `vmovn.i64 D0, Q0'
+
+ * int16x4_t vmovn_s32 (int32x4_t)
+ _Form of expected instruction(s):_ `vmovn.i32 D0, Q0'
+
+ * int8x8_t vmovn_s16 (int16x8_t)
+ _Form of expected instruction(s):_ `vmovn.i16 D0, Q0'
+
+ * uint32x2_t vqmovn_u64 (uint64x2_t)
+ _Form of expected instruction(s):_ `vqmovn.u64 D0, Q0'
+
+ * uint16x4_t vqmovn_u32 (uint32x4_t)
+ _Form of expected instruction(s):_ `vqmovn.u32 D0, Q0'
+
+ * uint8x8_t vqmovn_u16 (uint16x8_t)
+ _Form of expected instruction(s):_ `vqmovn.u16 D0, Q0'
+
+ * int32x2_t vqmovn_s64 (int64x2_t)
+ _Form of expected instruction(s):_ `vqmovn.s64 D0, Q0'
+
+ * int16x4_t vqmovn_s32 (int32x4_t)
+ _Form of expected instruction(s):_ `vqmovn.s32 D0, Q0'
+
+ * int8x8_t vqmovn_s16 (int16x8_t)
+ _Form of expected instruction(s):_ `vqmovn.s16 D0, Q0'
+
+ * uint32x2_t vqmovun_s64 (int64x2_t)
+ _Form of expected instruction(s):_ `vqmovun.s64 D0, Q0'
+
+ * uint16x4_t vqmovun_s32 (int32x4_t)
+ _Form of expected instruction(s):_ `vqmovun.s32 D0, Q0'
+
+ * uint8x8_t vqmovun_s16 (int16x8_t)
+ _Form of expected instruction(s):_ `vqmovun.s16 D0, Q0'
+
+5.50.3.47 Move, single_opcode long
+..................................
+
+ * uint64x2_t vmovl_u32 (uint32x2_t)
+ _Form of expected instruction(s):_ `vmovl.u32 Q0, D0'
+
+ * uint32x4_t vmovl_u16 (uint16x4_t)
+ _Form of expected instruction(s):_ `vmovl.u16 Q0, D0'
+
+ * uint16x8_t vmovl_u8 (uint8x8_t)
+ _Form of expected instruction(s):_ `vmovl.u8 Q0, D0'
+
+ * int64x2_t vmovl_s32 (int32x2_t)
+ _Form of expected instruction(s):_ `vmovl.s32 Q0, D0'
+
+ * int32x4_t vmovl_s16 (int16x4_t)
+ _Form of expected instruction(s):_ `vmovl.s16 Q0, D0'
+
+ * int16x8_t vmovl_s8 (int8x8_t)
+ _Form of expected instruction(s):_ `vmovl.s8 Q0, D0'
+
+5.50.3.48 Table lookup
+......................
+
+ * poly8x8_t vtbl1_p8 (poly8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vtbl.8 D0, {D0}, D0'
+
+ * int8x8_t vtbl1_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vtbl.8 D0, {D0}, D0'
+
+ * uint8x8_t vtbl1_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vtbl.8 D0, {D0}, D0'
+
+ * poly8x8_t vtbl2_p8 (poly8x8x2_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vtbl.8 D0, {D0, D1}, D0'
+
+ * int8x8_t vtbl2_s8 (int8x8x2_t, int8x8_t)
+ _Form of expected instruction(s):_ `vtbl.8 D0, {D0, D1}, D0'
+
+ * uint8x8_t vtbl2_u8 (uint8x8x2_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vtbl.8 D0, {D0, D1}, D0'
+
+ * poly8x8_t vtbl3_p8 (poly8x8x3_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vtbl.8 D0, {D0, D1, D2}, D0'
+
+ * int8x8_t vtbl3_s8 (int8x8x3_t, int8x8_t)
+ _Form of expected instruction(s):_ `vtbl.8 D0, {D0, D1, D2}, D0'
+
+ * uint8x8_t vtbl3_u8 (uint8x8x3_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vtbl.8 D0, {D0, D1, D2}, D0'
+
+ * poly8x8_t vtbl4_p8 (poly8x8x4_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vtbl.8 D0, {D0, D1, D2, D3},
+ D0'
+
+ * int8x8_t vtbl4_s8 (int8x8x4_t, int8x8_t)
+ _Form of expected instruction(s):_ `vtbl.8 D0, {D0, D1, D2, D3},
+ D0'
+
+ * uint8x8_t vtbl4_u8 (uint8x8x4_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vtbl.8 D0, {D0, D1, D2, D3},
+ D0'
+
+5.50.3.49 Extended table lookup
+...............................
+
+ * poly8x8_t vtbx1_p8 (poly8x8_t, poly8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vtbx.8 D0, {D0}, D0'
+
+ * int8x8_t vtbx1_s8 (int8x8_t, int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vtbx.8 D0, {D0}, D0'
+
+ * uint8x8_t vtbx1_u8 (uint8x8_t, uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vtbx.8 D0, {D0}, D0'
+
+ * poly8x8_t vtbx2_p8 (poly8x8_t, poly8x8x2_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vtbx.8 D0, {D0, D1}, D0'
+
+ * int8x8_t vtbx2_s8 (int8x8_t, int8x8x2_t, int8x8_t)
+ _Form of expected instruction(s):_ `vtbx.8 D0, {D0, D1}, D0'
+
+ * uint8x8_t vtbx2_u8 (uint8x8_t, uint8x8x2_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vtbx.8 D0, {D0, D1}, D0'
+
+ * poly8x8_t vtbx3_p8 (poly8x8_t, poly8x8x3_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vtbx.8 D0, {D0, D1, D2}, D0'
+
+ * int8x8_t vtbx3_s8 (int8x8_t, int8x8x3_t, int8x8_t)
+ _Form of expected instruction(s):_ `vtbx.8 D0, {D0, D1, D2}, D0'
+
+ * uint8x8_t vtbx3_u8 (uint8x8_t, uint8x8x3_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vtbx.8 D0, {D0, D1, D2}, D0'
+
+ * poly8x8_t vtbx4_p8 (poly8x8_t, poly8x8x4_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vtbx.8 D0, {D0, D1, D2, D3},
+ D0'
+
+ * int8x8_t vtbx4_s8 (int8x8_t, int8x8x4_t, int8x8_t)
+ _Form of expected instruction(s):_ `vtbx.8 D0, {D0, D1, D2, D3},
+ D0'
+
+ * uint8x8_t vtbx4_u8 (uint8x8_t, uint8x8x4_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vtbx.8 D0, {D0, D1, D2, D3},
+ D0'
+
+5.50.3.50 Multiply, lane
+........................
+
+ * float32x2_t vmul_lane_f32 (float32x2_t, float32x2_t, const int)
+ _Form of expected instruction(s):_ `vmul.f32 D0, D0, D0[0]'
+
+ * uint32x2_t vmul_lane_u32 (uint32x2_t, uint32x2_t, const int)
+ _Form of expected instruction(s):_ `vmul.i32 D0, D0, D0[0]'
+
+ * uint16x4_t vmul_lane_u16 (uint16x4_t, uint16x4_t, const int)
+ _Form of expected instruction(s):_ `vmul.i16 D0, D0, D0[0]'
+
+ * int32x2_t vmul_lane_s32 (int32x2_t, int32x2_t, const int)
+ _Form of expected instruction(s):_ `vmul.i32 D0, D0, D0[0]'
+
+ * int16x4_t vmul_lane_s16 (int16x4_t, int16x4_t, const int)
+ _Form of expected instruction(s):_ `vmul.i16 D0, D0, D0[0]'
+
+ * float32x4_t vmulq_lane_f32 (float32x4_t, float32x2_t, const int)
+ _Form of expected instruction(s):_ `vmul.f32 Q0, Q0, D0[0]'
+
+ * uint32x4_t vmulq_lane_u32 (uint32x4_t, uint32x2_t, const int)
+ _Form of expected instruction(s):_ `vmul.i32 Q0, Q0, D0[0]'
+
+ * uint16x8_t vmulq_lane_u16 (uint16x8_t, uint16x4_t, const int)
+ _Form of expected instruction(s):_ `vmul.i16 Q0, Q0, D0[0]'
+
+ * int32x4_t vmulq_lane_s32 (int32x4_t, int32x2_t, const int)
+ _Form of expected instruction(s):_ `vmul.i32 Q0, Q0, D0[0]'
+
+ * int16x8_t vmulq_lane_s16 (int16x8_t, int16x4_t, const int)
+ _Form of expected instruction(s):_ `vmul.i16 Q0, Q0, D0[0]'
+
+5.50.3.51 Long multiply, lane
+.............................
+
+ * uint64x2_t vmull_lane_u32 (uint32x2_t, uint32x2_t, const int)
+ _Form of expected instruction(s):_ `vmull.u32 Q0, D0, D0[0]'
+
+ * uint32x4_t vmull_lane_u16 (uint16x4_t, uint16x4_t, const int)
+ _Form of expected instruction(s):_ `vmull.u16 Q0, D0, D0[0]'
+
+ * int64x2_t vmull_lane_s32 (int32x2_t, int32x2_t, const int)
+ _Form of expected instruction(s):_ `vmull.s32 Q0, D0, D0[0]'
+
+ * int32x4_t vmull_lane_s16 (int16x4_t, int16x4_t, const int)
+ _Form of expected instruction(s):_ `vmull.s16 Q0, D0, D0[0]'
+
+5.50.3.52 Saturating doubling long multiply, lane
+.................................................
+
+ * int64x2_t vqdmull_lane_s32 (int32x2_t, int32x2_t, const int)
+ _Form of expected instruction(s):_ `vqdmull.s32 Q0, D0, D0[0]'
+
+ * int32x4_t vqdmull_lane_s16 (int16x4_t, int16x4_t, const int)
+ _Form of expected instruction(s):_ `vqdmull.s16 Q0, D0, D0[0]'
+
+5.50.3.53 Saturating doubling multiply high, lane
+.................................................
+
+ * int32x4_t vqdmulhq_lane_s32 (int32x4_t, int32x2_t, const int)
+ _Form of expected instruction(s):_ `vqdmulh.s32 Q0, Q0, D0[0]'
+
+ * int16x8_t vqdmulhq_lane_s16 (int16x8_t, int16x4_t, const int)
+ _Form of expected instruction(s):_ `vqdmulh.s16 Q0, Q0, D0[0]'
+
+ * int32x2_t vqdmulh_lane_s32 (int32x2_t, int32x2_t, const int)
+ _Form of expected instruction(s):_ `vqdmulh.s32 D0, D0, D0[0]'
+
+ * int16x4_t vqdmulh_lane_s16 (int16x4_t, int16x4_t, const int)
+ _Form of expected instruction(s):_ `vqdmulh.s16 D0, D0, D0[0]'
+
+ * int32x4_t vqrdmulhq_lane_s32 (int32x4_t, int32x2_t, const int)
+ _Form of expected instruction(s):_ `vqrdmulh.s32 Q0, Q0, D0[0]'
+
+ * int16x8_t vqrdmulhq_lane_s16 (int16x8_t, int16x4_t, const int)
+ _Form of expected instruction(s):_ `vqrdmulh.s16 Q0, Q0, D0[0]'
+
+ * int32x2_t vqrdmulh_lane_s32 (int32x2_t, int32x2_t, const int)
+ _Form of expected instruction(s):_ `vqrdmulh.s32 D0, D0, D0[0]'
+
+ * int16x4_t vqrdmulh_lane_s16 (int16x4_t, int16x4_t, const int)
+ _Form of expected instruction(s):_ `vqrdmulh.s16 D0, D0, D0[0]'
+
+5.50.3.54 Multiply-accumulate, lane
+...................................
+
+ * float32x2_t vmla_lane_f32 (float32x2_t, float32x2_t, float32x2_t,
+ const int)
+ _Form of expected instruction(s):_ `vmla.f32 D0, D0, D0[0]'
+
+ * uint32x2_t vmla_lane_u32 (uint32x2_t, uint32x2_t, uint32x2_t,
+ const int)
+ _Form of expected instruction(s):_ `vmla.i32 D0, D0, D0[0]'
+
+ * uint16x4_t vmla_lane_u16 (uint16x4_t, uint16x4_t, uint16x4_t,
+ const int)
+ _Form of expected instruction(s):_ `vmla.i16 D0, D0, D0[0]'
+
+ * int32x2_t vmla_lane_s32 (int32x2_t, int32x2_t, int32x2_t, const
+ int)
+ _Form of expected instruction(s):_ `vmla.i32 D0, D0, D0[0]'
+
+ * int16x4_t vmla_lane_s16 (int16x4_t, int16x4_t, int16x4_t, const
+ int)
+ _Form of expected instruction(s):_ `vmla.i16 D0, D0, D0[0]'
+
+ * float32x4_t vmlaq_lane_f32 (float32x4_t, float32x4_t, float32x2_t,
+ const int)
+ _Form of expected instruction(s):_ `vmla.f32 Q0, Q0, D0[0]'
+
+ * uint32x4_t vmlaq_lane_u32 (uint32x4_t, uint32x4_t, uint32x2_t,
+ const int)
+ _Form of expected instruction(s):_ `vmla.i32 Q0, Q0, D0[0]'
+
+ * uint16x8_t vmlaq_lane_u16 (uint16x8_t, uint16x8_t, uint16x4_t,
+ const int)
+ _Form of expected instruction(s):_ `vmla.i16 Q0, Q0, D0[0]'
+
+ * int32x4_t vmlaq_lane_s32 (int32x4_t, int32x4_t, int32x2_t, const
+ int)
+ _Form of expected instruction(s):_ `vmla.i32 Q0, Q0, D0[0]'
+
+ * int16x8_t vmlaq_lane_s16 (int16x8_t, int16x8_t, int16x4_t, const
+ int)
+ _Form of expected instruction(s):_ `vmla.i16 Q0, Q0, D0[0]'
+
+ * uint64x2_t vmlal_lane_u32 (uint64x2_t, uint32x2_t, uint32x2_t,
+ const int)
+ _Form of expected instruction(s):_ `vmlal.u32 Q0, D0, D0[0]'
+
+ * uint32x4_t vmlal_lane_u16 (uint32x4_t, uint16x4_t, uint16x4_t,
+ const int)
+ _Form of expected instruction(s):_ `vmlal.u16 Q0, D0, D0[0]'
+
+ * int64x2_t vmlal_lane_s32 (int64x2_t, int32x2_t, int32x2_t, const
+ int)
+ _Form of expected instruction(s):_ `vmlal.s32 Q0, D0, D0[0]'
+
+ * int32x4_t vmlal_lane_s16 (int32x4_t, int16x4_t, int16x4_t, const
+ int)
+ _Form of expected instruction(s):_ `vmlal.s16 Q0, D0, D0[0]'
+
+ * int64x2_t vqdmlal_lane_s32 (int64x2_t, int32x2_t, int32x2_t, const
+ int)
+ _Form of expected instruction(s):_ `vqdmlal.s32 Q0, D0, D0[0]'
+
+ * int32x4_t vqdmlal_lane_s16 (int32x4_t, int16x4_t, int16x4_t, const
+ int)
+ _Form of expected instruction(s):_ `vqdmlal.s16 Q0, D0, D0[0]'
+
+5.50.3.55 Multiply-subtract, lane
+.................................
+
+ * float32x2_t vmls_lane_f32 (float32x2_t, float32x2_t, float32x2_t,
+ const int)
+ _Form of expected instruction(s):_ `vmls.f32 D0, D0, D0[0]'
+
+ * uint32x2_t vmls_lane_u32 (uint32x2_t, uint32x2_t, uint32x2_t,
+ const int)
+ _Form of expected instruction(s):_ `vmls.i32 D0, D0, D0[0]'
+
+ * uint16x4_t vmls_lane_u16 (uint16x4_t, uint16x4_t, uint16x4_t,
+ const int)
+ _Form of expected instruction(s):_ `vmls.i16 D0, D0, D0[0]'
+
+ * int32x2_t vmls_lane_s32 (int32x2_t, int32x2_t, int32x2_t, const
+ int)
+ _Form of expected instruction(s):_ `vmls.i32 D0, D0, D0[0]'
+
+ * int16x4_t vmls_lane_s16 (int16x4_t, int16x4_t, int16x4_t, const
+ int)
+ _Form of expected instruction(s):_ `vmls.i16 D0, D0, D0[0]'
+
+ * float32x4_t vmlsq_lane_f32 (float32x4_t, float32x4_t, float32x2_t,
+ const int)
+ _Form of expected instruction(s):_ `vmls.f32 Q0, Q0, D0[0]'
+
+ * uint32x4_t vmlsq_lane_u32 (uint32x4_t, uint32x4_t, uint32x2_t,
+ const int)
+ _Form of expected instruction(s):_ `vmls.i32 Q0, Q0, D0[0]'
+
+ * uint16x8_t vmlsq_lane_u16 (uint16x8_t, uint16x8_t, uint16x4_t,
+ const int)
+ _Form of expected instruction(s):_ `vmls.i16 Q0, Q0, D0[0]'
+
+ * int32x4_t vmlsq_lane_s32 (int32x4_t, int32x4_t, int32x2_t, const
+ int)
+ _Form of expected instruction(s):_ `vmls.i32 Q0, Q0, D0[0]'
+
+ * int16x8_t vmlsq_lane_s16 (int16x8_t, int16x8_t, int16x4_t, const
+ int)
+ _Form of expected instruction(s):_ `vmls.i16 Q0, Q0, D0[0]'
+
+ * uint64x2_t vmlsl_lane_u32 (uint64x2_t, uint32x2_t, uint32x2_t,
+ const int)
+ _Form of expected instruction(s):_ `vmlsl.u32 Q0, D0, D0[0]'
+
+ * uint32x4_t vmlsl_lane_u16 (uint32x4_t, uint16x4_t, uint16x4_t,
+ const int)
+ _Form of expected instruction(s):_ `vmlsl.u16 Q0, D0, D0[0]'
+
+ * int64x2_t vmlsl_lane_s32 (int64x2_t, int32x2_t, int32x2_t, const
+ int)
+ _Form of expected instruction(s):_ `vmlsl.s32 Q0, D0, D0[0]'
+
+ * int32x4_t vmlsl_lane_s16 (int32x4_t, int16x4_t, int16x4_t, const
+ int)
+ _Form of expected instruction(s):_ `vmlsl.s16 Q0, D0, D0[0]'
+
+ * int64x2_t vqdmlsl_lane_s32 (int64x2_t, int32x2_t, int32x2_t, const
+ int)
+ _Form of expected instruction(s):_ `vqdmlsl.s32 Q0, D0, D0[0]'
+
+ * int32x4_t vqdmlsl_lane_s16 (int32x4_t, int16x4_t, int16x4_t, const
+ int)
+ _Form of expected instruction(s):_ `vqdmlsl.s16 Q0, D0, D0[0]'
+
+5.50.3.56 Vector multiply by scalar
+...................................
+
+ * float32x2_t vmul_n_f32 (float32x2_t, float32_t)
+ _Form of expected instruction(s):_ `vmul.f32 D0, D0, D0[0]'
+
+ * uint32x2_t vmul_n_u32 (uint32x2_t, uint32_t)
+ _Form of expected instruction(s):_ `vmul.i32 D0, D0, D0[0]'
+
+ * uint16x4_t vmul_n_u16 (uint16x4_t, uint16_t)
+ _Form of expected instruction(s):_ `vmul.i16 D0, D0, D0[0]'
+
+ * int32x2_t vmul_n_s32 (int32x2_t, int32_t)
+ _Form of expected instruction(s):_ `vmul.i32 D0, D0, D0[0]'
+
+ * int16x4_t vmul_n_s16 (int16x4_t, int16_t)
+ _Form of expected instruction(s):_ `vmul.i16 D0, D0, D0[0]'
+
+ * float32x4_t vmulq_n_f32 (float32x4_t, float32_t)
+ _Form of expected instruction(s):_ `vmul.f32 Q0, Q0, D0[0]'
+
+ * uint32x4_t vmulq_n_u32 (uint32x4_t, uint32_t)
+ _Form of expected instruction(s):_ `vmul.i32 Q0, Q0, D0[0]'
+
+ * uint16x8_t vmulq_n_u16 (uint16x8_t, uint16_t)
+ _Form of expected instruction(s):_ `vmul.i16 Q0, Q0, D0[0]'
+
+ * int32x4_t vmulq_n_s32 (int32x4_t, int32_t)
+ _Form of expected instruction(s):_ `vmul.i32 Q0, Q0, D0[0]'
+
+ * int16x8_t vmulq_n_s16 (int16x8_t, int16_t)
+ _Form of expected instruction(s):_ `vmul.i16 Q0, Q0, D0[0]'
+
+5.50.3.57 Vector long multiply by scalar
+........................................
+
+ * uint64x2_t vmull_n_u32 (uint32x2_t, uint32_t)
+ _Form of expected instruction(s):_ `vmull.u32 Q0, D0, D0[0]'
+
+ * uint32x4_t vmull_n_u16 (uint16x4_t, uint16_t)
+ _Form of expected instruction(s):_ `vmull.u16 Q0, D0, D0[0]'
+
+ * int64x2_t vmull_n_s32 (int32x2_t, int32_t)
+ _Form of expected instruction(s):_ `vmull.s32 Q0, D0, D0[0]'
+
+ * int32x4_t vmull_n_s16 (int16x4_t, int16_t)
+ _Form of expected instruction(s):_ `vmull.s16 Q0, D0, D0[0]'
+
+5.50.3.58 Vector saturating doubling long multiply by scalar
+............................................................
+
+ * int64x2_t vqdmull_n_s32 (int32x2_t, int32_t)
+ _Form of expected instruction(s):_ `vqdmull.s32 Q0, D0, D0[0]'
+
+ * int32x4_t vqdmull_n_s16 (int16x4_t, int16_t)
+ _Form of expected instruction(s):_ `vqdmull.s16 Q0, D0, D0[0]'
+
+5.50.3.59 Vector saturating doubling multiply high by scalar
+............................................................
+
+ * int32x4_t vqdmulhq_n_s32 (int32x4_t, int32_t)
+ _Form of expected instruction(s):_ `vqdmulh.s32 Q0, Q0, D0[0]'
+
+ * int16x8_t vqdmulhq_n_s16 (int16x8_t, int16_t)
+ _Form of expected instruction(s):_ `vqdmulh.s16 Q0, Q0, D0[0]'
+
+ * int32x2_t vqdmulh_n_s32 (int32x2_t, int32_t)
+ _Form of expected instruction(s):_ `vqdmulh.s32 D0, D0, D0[0]'
+
+ * int16x4_t vqdmulh_n_s16 (int16x4_t, int16_t)
+ _Form of expected instruction(s):_ `vqdmulh.s16 D0, D0, D0[0]'
+
+ * int32x4_t vqrdmulhq_n_s32 (int32x4_t, int32_t)
+ _Form of expected instruction(s):_ `vqrdmulh.s32 Q0, Q0, D0[0]'
+
+ * int16x8_t vqrdmulhq_n_s16 (int16x8_t, int16_t)
+ _Form of expected instruction(s):_ `vqrdmulh.s16 Q0, Q0, D0[0]'
+
+ * int32x2_t vqrdmulh_n_s32 (int32x2_t, int32_t)
+ _Form of expected instruction(s):_ `vqrdmulh.s32 D0, D0, D0[0]'
+
+ * int16x4_t vqrdmulh_n_s16 (int16x4_t, int16_t)
+ _Form of expected instruction(s):_ `vqrdmulh.s16 D0, D0, D0[0]'
+
+5.50.3.60 Vector multiply-accumulate by scalar
+..............................................
+
+ * float32x2_t vmla_n_f32 (float32x2_t, float32x2_t, float32_t)
+ _Form of expected instruction(s):_ `vmla.f32 D0, D0, D0[0]'
+
+ * uint32x2_t vmla_n_u32 (uint32x2_t, uint32x2_t, uint32_t)
+ _Form of expected instruction(s):_ `vmla.i32 D0, D0, D0[0]'
+
+ * uint16x4_t vmla_n_u16 (uint16x4_t, uint16x4_t, uint16_t)
+ _Form of expected instruction(s):_ `vmla.i16 D0, D0, D0[0]'
+
+ * int32x2_t vmla_n_s32 (int32x2_t, int32x2_t, int32_t)
+ _Form of expected instruction(s):_ `vmla.i32 D0, D0, D0[0]'
+
+ * int16x4_t vmla_n_s16 (int16x4_t, int16x4_t, int16_t)
+ _Form of expected instruction(s):_ `vmla.i16 D0, D0, D0[0]'
+
+ * float32x4_t vmlaq_n_f32 (float32x4_t, float32x4_t, float32_t)
+ _Form of expected instruction(s):_ `vmla.f32 Q0, Q0, D0[0]'
+
+ * uint32x4_t vmlaq_n_u32 (uint32x4_t, uint32x4_t, uint32_t)
+ _Form of expected instruction(s):_ `vmla.i32 Q0, Q0, D0[0]'
+
+ * uint16x8_t vmlaq_n_u16 (uint16x8_t, uint16x8_t, uint16_t)
+ _Form of expected instruction(s):_ `vmla.i16 Q0, Q0, D0[0]'
+
+ * int32x4_t vmlaq_n_s32 (int32x4_t, int32x4_t, int32_t)
+ _Form of expected instruction(s):_ `vmla.i32 Q0, Q0, D0[0]'
+
+ * int16x8_t vmlaq_n_s16 (int16x8_t, int16x8_t, int16_t)
+ _Form of expected instruction(s):_ `vmla.i16 Q0, Q0, D0[0]'
+
+ * uint64x2_t vmlal_n_u32 (uint64x2_t, uint32x2_t, uint32_t)
+ _Form of expected instruction(s):_ `vmlal.u32 Q0, D0, D0[0]'
+
+ * uint32x4_t vmlal_n_u16 (uint32x4_t, uint16x4_t, uint16_t)
+ _Form of expected instruction(s):_ `vmlal.u16 Q0, D0, D0[0]'
+
+ * int64x2_t vmlal_n_s32 (int64x2_t, int32x2_t, int32_t)
+ _Form of expected instruction(s):_ `vmlal.s32 Q0, D0, D0[0]'
+
+ * int32x4_t vmlal_n_s16 (int32x4_t, int16x4_t, int16_t)
+ _Form of expected instruction(s):_ `vmlal.s16 Q0, D0, D0[0]'
+
+ * int64x2_t vqdmlal_n_s32 (int64x2_t, int32x2_t, int32_t)
+ _Form of expected instruction(s):_ `vqdmlal.s32 Q0, D0, D0[0]'
+
+ * int32x4_t vqdmlal_n_s16 (int32x4_t, int16x4_t, int16_t)
+ _Form of expected instruction(s):_ `vqdmlal.s16 Q0, D0, D0[0]'
+
+5.50.3.61 Vector multiply-subtract by scalar
+............................................
+
+ * float32x2_t vmls_n_f32 (float32x2_t, float32x2_t, float32_t)
+ _Form of expected instruction(s):_ `vmls.f32 D0, D0, D0[0]'
+
+ * uint32x2_t vmls_n_u32 (uint32x2_t, uint32x2_t, uint32_t)
+ _Form of expected instruction(s):_ `vmls.i32 D0, D0, D0[0]'
+
+ * uint16x4_t vmls_n_u16 (uint16x4_t, uint16x4_t, uint16_t)
+ _Form of expected instruction(s):_ `vmls.i16 D0, D0, D0[0]'
+
+ * int32x2_t vmls_n_s32 (int32x2_t, int32x2_t, int32_t)
+ _Form of expected instruction(s):_ `vmls.i32 D0, D0, D0[0]'
+
+ * int16x4_t vmls_n_s16 (int16x4_t, int16x4_t, int16_t)
+ _Form of expected instruction(s):_ `vmls.i16 D0, D0, D0[0]'
+
+ * float32x4_t vmlsq_n_f32 (float32x4_t, float32x4_t, float32_t)
+ _Form of expected instruction(s):_ `vmls.f32 Q0, Q0, D0[0]'
+
+ * uint32x4_t vmlsq_n_u32 (uint32x4_t, uint32x4_t, uint32_t)
+ _Form of expected instruction(s):_ `vmls.i32 Q0, Q0, D0[0]'
+
+ * uint16x8_t vmlsq_n_u16 (uint16x8_t, uint16x8_t, uint16_t)
+ _Form of expected instruction(s):_ `vmls.i16 Q0, Q0, D0[0]'
+
+ * int32x4_t vmlsq_n_s32 (int32x4_t, int32x4_t, int32_t)
+ _Form of expected instruction(s):_ `vmls.i32 Q0, Q0, D0[0]'
+
+ * int16x8_t vmlsq_n_s16 (int16x8_t, int16x8_t, int16_t)
+ _Form of expected instruction(s):_ `vmls.i16 Q0, Q0, D0[0]'
+
+ * uint64x2_t vmlsl_n_u32 (uint64x2_t, uint32x2_t, uint32_t)
+ _Form of expected instruction(s):_ `vmlsl.u32 Q0, D0, D0[0]'
+
+ * uint32x4_t vmlsl_n_u16 (uint32x4_t, uint16x4_t, uint16_t)
+ _Form of expected instruction(s):_ `vmlsl.u16 Q0, D0, D0[0]'
+
+ * int64x2_t vmlsl_n_s32 (int64x2_t, int32x2_t, int32_t)
+ _Form of expected instruction(s):_ `vmlsl.s32 Q0, D0, D0[0]'
+
+ * int32x4_t vmlsl_n_s16 (int32x4_t, int16x4_t, int16_t)
+ _Form of expected instruction(s):_ `vmlsl.s16 Q0, D0, D0[0]'
+
+ * int64x2_t vqdmlsl_n_s32 (int64x2_t, int32x2_t, int32_t)
+ _Form of expected instruction(s):_ `vqdmlsl.s32 Q0, D0, D0[0]'
+
+ * int32x4_t vqdmlsl_n_s16 (int32x4_t, int16x4_t, int16_t)
+ _Form of expected instruction(s):_ `vqdmlsl.s16 Q0, D0, D0[0]'
+
+5.50.3.62 Vector extract
+........................
+
+ * uint32x2_t vext_u32 (uint32x2_t, uint32x2_t, const int)
+ _Form of expected instruction(s):_ `vext.32 D0, D0, D0, #0'
+
+ * uint16x4_t vext_u16 (uint16x4_t, uint16x4_t, const int)
+ _Form of expected instruction(s):_ `vext.16 D0, D0, D0, #0'
+
+ * uint8x8_t vext_u8 (uint8x8_t, uint8x8_t, const int)
+ _Form of expected instruction(s):_ `vext.8 D0, D0, D0, #0'
+
+ * int32x2_t vext_s32 (int32x2_t, int32x2_t, const int)
+ _Form of expected instruction(s):_ `vext.32 D0, D0, D0, #0'
+
+ * int16x4_t vext_s16 (int16x4_t, int16x4_t, const int)
+ _Form of expected instruction(s):_ `vext.16 D0, D0, D0, #0'
+
+ * int8x8_t vext_s8 (int8x8_t, int8x8_t, const int)
+ _Form of expected instruction(s):_ `vext.8 D0, D0, D0, #0'
+
+ * uint64x1_t vext_u64 (uint64x1_t, uint64x1_t, const int)
+ _Form of expected instruction(s):_ `vext.64 D0, D0, D0, #0'
+
+ * int64x1_t vext_s64 (int64x1_t, int64x1_t, const int)
+ _Form of expected instruction(s):_ `vext.64 D0, D0, D0, #0'
+
+ * float32x2_t vext_f32 (float32x2_t, float32x2_t, const int)
+ _Form of expected instruction(s):_ `vext.32 D0, D0, D0, #0'
+
+ * poly16x4_t vext_p16 (poly16x4_t, poly16x4_t, const int)
+ _Form of expected instruction(s):_ `vext.16 D0, D0, D0, #0'
+
+ * poly8x8_t vext_p8 (poly8x8_t, poly8x8_t, const int)
+ _Form of expected instruction(s):_ `vext.8 D0, D0, D0, #0'
+
+ * uint32x4_t vextq_u32 (uint32x4_t, uint32x4_t, const int)
+ _Form of expected instruction(s):_ `vext.32 Q0, Q0, Q0, #0'
+
+ * uint16x8_t vextq_u16 (uint16x8_t, uint16x8_t, const int)
+ _Form of expected instruction(s):_ `vext.16 Q0, Q0, Q0, #0'
+
+ * uint8x16_t vextq_u8 (uint8x16_t, uint8x16_t, const int)
+ _Form of expected instruction(s):_ `vext.8 Q0, Q0, Q0, #0'
+
+ * int32x4_t vextq_s32 (int32x4_t, int32x4_t, const int)
+ _Form of expected instruction(s):_ `vext.32 Q0, Q0, Q0, #0'
+
+ * int16x8_t vextq_s16 (int16x8_t, int16x8_t, const int)
+ _Form of expected instruction(s):_ `vext.16 Q0, Q0, Q0, #0'
+
+ * int8x16_t vextq_s8 (int8x16_t, int8x16_t, const int)
+ _Form of expected instruction(s):_ `vext.8 Q0, Q0, Q0, #0'
+
+ * uint64x2_t vextq_u64 (uint64x2_t, uint64x2_t, const int)
+ _Form of expected instruction(s):_ `vext.64 Q0, Q0, Q0, #0'
+
+ * int64x2_t vextq_s64 (int64x2_t, int64x2_t, const int)
+ _Form of expected instruction(s):_ `vext.64 Q0, Q0, Q0, #0'
+
+ * float32x4_t vextq_f32 (float32x4_t, float32x4_t, const int)
+ _Form of expected instruction(s):_ `vext.32 Q0, Q0, Q0, #0'
+
+ * poly16x8_t vextq_p16 (poly16x8_t, poly16x8_t, const int)
+ _Form of expected instruction(s):_ `vext.16 Q0, Q0, Q0, #0'
+
+ * poly8x16_t vextq_p8 (poly8x16_t, poly8x16_t, const int)
+ _Form of expected instruction(s):_ `vext.8 Q0, Q0, Q0, #0'
+
+5.50.3.63 Reverse elements
+..........................
+
+ * uint32x2_t vrev64_u32 (uint32x2_t)
+ _Form of expected instruction(s):_ `vrev64.32 D0, D0'
+
+ * uint16x4_t vrev64_u16 (uint16x4_t)
+ _Form of expected instruction(s):_ `vrev64.16 D0, D0'
+
+ * uint8x8_t vrev64_u8 (uint8x8_t)
+ _Form of expected instruction(s):_ `vrev64.8 D0, D0'
+
+ * int32x2_t vrev64_s32 (int32x2_t)
+ _Form of expected instruction(s):_ `vrev64.32 D0, D0'
+
+ * int16x4_t vrev64_s16 (int16x4_t)
+ _Form of expected instruction(s):_ `vrev64.16 D0, D0'
+
+ * int8x8_t vrev64_s8 (int8x8_t)
+ _Form of expected instruction(s):_ `vrev64.8 D0, D0'
+
+ * float32x2_t vrev64_f32 (float32x2_t)
+ _Form of expected instruction(s):_ `vrev64.32 D0, D0'
+
+ * poly16x4_t vrev64_p16 (poly16x4_t)
+ _Form of expected instruction(s):_ `vrev64.16 D0, D0'
+
+ * poly8x8_t vrev64_p8 (poly8x8_t)
+ _Form of expected instruction(s):_ `vrev64.8 D0, D0'
+
+ * uint32x4_t vrev64q_u32 (uint32x4_t)
+ _Form of expected instruction(s):_ `vrev64.32 Q0, Q0'
+
+ * uint16x8_t vrev64q_u16 (uint16x8_t)
+ _Form of expected instruction(s):_ `vrev64.16 Q0, Q0'
+
+ * uint8x16_t vrev64q_u8 (uint8x16_t)
+ _Form of expected instruction(s):_ `vrev64.8 Q0, Q0'
+
+ * int32x4_t vrev64q_s32 (int32x4_t)
+ _Form of expected instruction(s):_ `vrev64.32 Q0, Q0'
+
+ * int16x8_t vrev64q_s16 (int16x8_t)
+ _Form of expected instruction(s):_ `vrev64.16 Q0, Q0'
+
+ * int8x16_t vrev64q_s8 (int8x16_t)
+ _Form of expected instruction(s):_ `vrev64.8 Q0, Q0'
+
+ * float32x4_t vrev64q_f32 (float32x4_t)
+ _Form of expected instruction(s):_ `vrev64.32 Q0, Q0'
+
+ * poly16x8_t vrev64q_p16 (poly16x8_t)
+ _Form of expected instruction(s):_ `vrev64.16 Q0, Q0'
+
+ * poly8x16_t vrev64q_p8 (poly8x16_t)
+ _Form of expected instruction(s):_ `vrev64.8 Q0, Q0'
+
+ * uint16x4_t vrev32_u16 (uint16x4_t)
+ _Form of expected instruction(s):_ `vrev32.16 D0, D0'
+
+ * int16x4_t vrev32_s16 (int16x4_t)
+ _Form of expected instruction(s):_ `vrev32.16 D0, D0'
+
+ * uint8x8_t vrev32_u8 (uint8x8_t)
+ _Form of expected instruction(s):_ `vrev32.8 D0, D0'
+
+ * int8x8_t vrev32_s8 (int8x8_t)
+ _Form of expected instruction(s):_ `vrev32.8 D0, D0'
+
+ * poly16x4_t vrev32_p16 (poly16x4_t)
+ _Form of expected instruction(s):_ `vrev32.16 D0, D0'
+
+ * poly8x8_t vrev32_p8 (poly8x8_t)
+ _Form of expected instruction(s):_ `vrev32.8 D0, D0'
+
+ * uint16x8_t vrev32q_u16 (uint16x8_t)
+ _Form of expected instruction(s):_ `vrev32.16 Q0, Q0'
+
+ * int16x8_t vrev32q_s16 (int16x8_t)
+ _Form of expected instruction(s):_ `vrev32.16 Q0, Q0'
+
+ * uint8x16_t vrev32q_u8 (uint8x16_t)
+ _Form of expected instruction(s):_ `vrev32.8 Q0, Q0'
+
+ * int8x16_t vrev32q_s8 (int8x16_t)
+ _Form of expected instruction(s):_ `vrev32.8 Q0, Q0'
+
+ * poly16x8_t vrev32q_p16 (poly16x8_t)
+ _Form of expected instruction(s):_ `vrev32.16 Q0, Q0'
+
+ * poly8x16_t vrev32q_p8 (poly8x16_t)
+ _Form of expected instruction(s):_ `vrev32.8 Q0, Q0'
+
+ * uint8x8_t vrev16_u8 (uint8x8_t)
+ _Form of expected instruction(s):_ `vrev16.8 D0, D0'
+
+ * int8x8_t vrev16_s8 (int8x8_t)
+ _Form of expected instruction(s):_ `vrev16.8 D0, D0'
+
+ * poly8x8_t vrev16_p8 (poly8x8_t)
+ _Form of expected instruction(s):_ `vrev16.8 D0, D0'
+
+ * uint8x16_t vrev16q_u8 (uint8x16_t)
+ _Form of expected instruction(s):_ `vrev16.8 Q0, Q0'
+
+ * int8x16_t vrev16q_s8 (int8x16_t)
+ _Form of expected instruction(s):_ `vrev16.8 Q0, Q0'
+
+ * poly8x16_t vrev16q_p8 (poly8x16_t)
+ _Form of expected instruction(s):_ `vrev16.8 Q0, Q0'
+
+5.50.3.64 Bit selection
+.......................
+
+ * uint32x2_t vbsl_u32 (uint32x2_t, uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vbsl D0, D0, D0' _or_ `vbit
+ D0, D0, D0' _or_ `vbif D0, D0, D0'
+
+ * uint16x4_t vbsl_u16 (uint16x4_t, uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vbsl D0, D0, D0' _or_ `vbit
+ D0, D0, D0' _or_ `vbif D0, D0, D0'
+
+ * uint8x8_t vbsl_u8 (uint8x8_t, uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vbsl D0, D0, D0' _or_ `vbit
+ D0, D0, D0' _or_ `vbif D0, D0, D0'
+
+ * int32x2_t vbsl_s32 (uint32x2_t, int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vbsl D0, D0, D0' _or_ `vbit
+ D0, D0, D0' _or_ `vbif D0, D0, D0'
+
+ * int16x4_t vbsl_s16 (uint16x4_t, int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vbsl D0, D0, D0' _or_ `vbit
+ D0, D0, D0' _or_ `vbif D0, D0, D0'
+
+ * int8x8_t vbsl_s8 (uint8x8_t, int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vbsl D0, D0, D0' _or_ `vbit
+ D0, D0, D0' _or_ `vbif D0, D0, D0'
+
+ * uint64x1_t vbsl_u64 (uint64x1_t, uint64x1_t, uint64x1_t)
+ _Form of expected instruction(s):_ `vbsl D0, D0, D0' _or_ `vbit
+ D0, D0, D0' _or_ `vbif D0, D0, D0'
+
+ * int64x1_t vbsl_s64 (uint64x1_t, int64x1_t, int64x1_t)
+ _Form of expected instruction(s):_ `vbsl D0, D0, D0' _or_ `vbit
+ D0, D0, D0' _or_ `vbif D0, D0, D0'
+
+ * float32x2_t vbsl_f32 (uint32x2_t, float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vbsl D0, D0, D0' _or_ `vbit
+ D0, D0, D0' _or_ `vbif D0, D0, D0'
+
+ * poly16x4_t vbsl_p16 (uint16x4_t, poly16x4_t, poly16x4_t)
+ _Form of expected instruction(s):_ `vbsl D0, D0, D0' _or_ `vbit
+ D0, D0, D0' _or_ `vbif D0, D0, D0'
+
+ * poly8x8_t vbsl_p8 (uint8x8_t, poly8x8_t, poly8x8_t)
+ _Form of expected instruction(s):_ `vbsl D0, D0, D0' _or_ `vbit
+ D0, D0, D0' _or_ `vbif D0, D0, D0'
+
+ * uint32x4_t vbslq_u32 (uint32x4_t, uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vbsl Q0, Q0, Q0' _or_ `vbit
+ Q0, Q0, Q0' _or_ `vbif Q0, Q0, Q0'
+
+ * uint16x8_t vbslq_u16 (uint16x8_t, uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vbsl Q0, Q0, Q0' _or_ `vbit
+ Q0, Q0, Q0' _or_ `vbif Q0, Q0, Q0'
+
+ * uint8x16_t vbslq_u8 (uint8x16_t, uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vbsl Q0, Q0, Q0' _or_ `vbit
+ Q0, Q0, Q0' _or_ `vbif Q0, Q0, Q0'
+
+ * int32x4_t vbslq_s32 (uint32x4_t, int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vbsl Q0, Q0, Q0' _or_ `vbit
+ Q0, Q0, Q0' _or_ `vbif Q0, Q0, Q0'
+
+ * int16x8_t vbslq_s16 (uint16x8_t, int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vbsl Q0, Q0, Q0' _or_ `vbit
+ Q0, Q0, Q0' _or_ `vbif Q0, Q0, Q0'
+
+ * int8x16_t vbslq_s8 (uint8x16_t, int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vbsl Q0, Q0, Q0' _or_ `vbit
+ Q0, Q0, Q0' _or_ `vbif Q0, Q0, Q0'
+
+ * uint64x2_t vbslq_u64 (uint64x2_t, uint64x2_t, uint64x2_t)
+ _Form of expected instruction(s):_ `vbsl Q0, Q0, Q0' _or_ `vbit
+ Q0, Q0, Q0' _or_ `vbif Q0, Q0, Q0'
+
+ * int64x2_t vbslq_s64 (uint64x2_t, int64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `vbsl Q0, Q0, Q0' _or_ `vbit
+ Q0, Q0, Q0' _or_ `vbif Q0, Q0, Q0'
+
+ * float32x4_t vbslq_f32 (uint32x4_t, float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vbsl Q0, Q0, Q0' _or_ `vbit
+ Q0, Q0, Q0' _or_ `vbif Q0, Q0, Q0'
+
+ * poly16x8_t vbslq_p16 (uint16x8_t, poly16x8_t, poly16x8_t)
+ _Form of expected instruction(s):_ `vbsl Q0, Q0, Q0' _or_ `vbit
+ Q0, Q0, Q0' _or_ `vbif Q0, Q0, Q0'
+
+ * poly8x16_t vbslq_p8 (uint8x16_t, poly8x16_t, poly8x16_t)
+ _Form of expected instruction(s):_ `vbsl Q0, Q0, Q0' _or_ `vbit
+ Q0, Q0, Q0' _or_ `vbif Q0, Q0, Q0'
+
+5.50.3.65 Transpose elements
+............................
+
+ * uint32x2x2_t vtrn_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vtrn.32 D0, D1'
+
+ * uint16x4x2_t vtrn_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vtrn.16 D0, D1'
+
+ * uint8x8x2_t vtrn_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vtrn.8 D0, D1'
+
+ * int32x2x2_t vtrn_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vtrn.32 D0, D1'
+
+ * int16x4x2_t vtrn_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vtrn.16 D0, D1'
+
+ * int8x8x2_t vtrn_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vtrn.8 D0, D1'
+
+ * float32x2x2_t vtrn_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vtrn.32 D0, D1'
+
+ * poly16x4x2_t vtrn_p16 (poly16x4_t, poly16x4_t)
+ _Form of expected instruction(s):_ `vtrn.16 D0, D1'
+
+ * poly8x8x2_t vtrn_p8 (poly8x8_t, poly8x8_t)
+ _Form of expected instruction(s):_ `vtrn.8 D0, D1'
+
+ * uint32x4x2_t vtrnq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vtrn.32 Q0, Q1'
+
+ * uint16x8x2_t vtrnq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vtrn.16 Q0, Q1'
+
+ * uint8x16x2_t vtrnq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vtrn.8 Q0, Q1'
+
+ * int32x4x2_t vtrnq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vtrn.32 Q0, Q1'
+
+ * int16x8x2_t vtrnq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vtrn.16 Q0, Q1'
+
+ * int8x16x2_t vtrnq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vtrn.8 Q0, Q1'
+
+ * float32x4x2_t vtrnq_f32 (float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vtrn.32 Q0, Q1'
+
+ * poly16x8x2_t vtrnq_p16 (poly16x8_t, poly16x8_t)
+ _Form of expected instruction(s):_ `vtrn.16 Q0, Q1'
+
+ * poly8x16x2_t vtrnq_p8 (poly8x16_t, poly8x16_t)
+ _Form of expected instruction(s):_ `vtrn.8 Q0, Q1'
+
+5.50.3.66 Zip elements
+......................
+
+ * uint32x2x2_t vzip_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vzip.32 D0, D1'
+
+ * uint16x4x2_t vzip_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vzip.16 D0, D1'
+
+ * uint8x8x2_t vzip_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vzip.8 D0, D1'
+
+ * int32x2x2_t vzip_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vzip.32 D0, D1'
+
+ * int16x4x2_t vzip_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vzip.16 D0, D1'
+
+ * int8x8x2_t vzip_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vzip.8 D0, D1'
+
+ * float32x2x2_t vzip_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vzip.32 D0, D1'
+
+ * poly16x4x2_t vzip_p16 (poly16x4_t, poly16x4_t)
+ _Form of expected instruction(s):_ `vzip.16 D0, D1'
+
+ * poly8x8x2_t vzip_p8 (poly8x8_t, poly8x8_t)
+ _Form of expected instruction(s):_ `vzip.8 D0, D1'
+
+ * uint32x4x2_t vzipq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vzip.32 Q0, Q1'
+
+ * uint16x8x2_t vzipq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vzip.16 Q0, Q1'
+
+ * uint8x16x2_t vzipq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vzip.8 Q0, Q1'
+
+ * int32x4x2_t vzipq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vzip.32 Q0, Q1'
+
+ * int16x8x2_t vzipq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vzip.16 Q0, Q1'
+
+ * int8x16x2_t vzipq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vzip.8 Q0, Q1'
+
+ * float32x4x2_t vzipq_f32 (float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vzip.32 Q0, Q1'
+
+ * poly16x8x2_t vzipq_p16 (poly16x8_t, poly16x8_t)
+ _Form of expected instruction(s):_ `vzip.16 Q0, Q1'
+
+ * poly8x16x2_t vzipq_p8 (poly8x16_t, poly8x16_t)
+ _Form of expected instruction(s):_ `vzip.8 Q0, Q1'
+
+5.50.3.67 Unzip elements
+........................
+
+ * uint32x2x2_t vuzp_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vuzp.32 D0, D1'
+
+ * uint16x4x2_t vuzp_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vuzp.16 D0, D1'
+
+ * uint8x8x2_t vuzp_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vuzp.8 D0, D1'
+
+ * int32x2x2_t vuzp_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vuzp.32 D0, D1'
+
+ * int16x4x2_t vuzp_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vuzp.16 D0, D1'
+
+ * int8x8x2_t vuzp_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vuzp.8 D0, D1'
+
+ * float32x2x2_t vuzp_f32 (float32x2_t, float32x2_t)
+ _Form of expected instruction(s):_ `vuzp.32 D0, D1'
+
+ * poly16x4x2_t vuzp_p16 (poly16x4_t, poly16x4_t)
+ _Form of expected instruction(s):_ `vuzp.16 D0, D1'
+
+ * poly8x8x2_t vuzp_p8 (poly8x8_t, poly8x8_t)
+ _Form of expected instruction(s):_ `vuzp.8 D0, D1'
+
+ * uint32x4x2_t vuzpq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vuzp.32 Q0, Q1'
+
+ * uint16x8x2_t vuzpq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vuzp.16 Q0, Q1'
+
+ * uint8x16x2_t vuzpq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vuzp.8 Q0, Q1'
+
+ * int32x4x2_t vuzpq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vuzp.32 Q0, Q1'
+
+ * int16x8x2_t vuzpq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vuzp.16 Q0, Q1'
+
+ * int8x16x2_t vuzpq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vuzp.8 Q0, Q1'
+
+ * float32x4x2_t vuzpq_f32 (float32x4_t, float32x4_t)
+ _Form of expected instruction(s):_ `vuzp.32 Q0, Q1'
+
+ * poly16x8x2_t vuzpq_p16 (poly16x8_t, poly16x8_t)
+ _Form of expected instruction(s):_ `vuzp.16 Q0, Q1'
+
+ * poly8x16x2_t vuzpq_p8 (poly8x16_t, poly8x16_t)
+ _Form of expected instruction(s):_ `vuzp.8 Q0, Q1'
+
+5.50.3.68 Element/structure loads, VLD1 variants
+................................................
+
+ * uint32x2_t vld1_u32 (const uint32_t *)
+ _Form of expected instruction(s):_ `vld1.32 {D0}, [R0]'
+
+ * uint16x4_t vld1_u16 (const uint16_t *)
+ _Form of expected instruction(s):_ `vld1.16 {D0}, [R0]'
+
+ * uint8x8_t vld1_u8 (const uint8_t *)
+ _Form of expected instruction(s):_ `vld1.8 {D0}, [R0]'
+
+ * int32x2_t vld1_s32 (const int32_t *)
+ _Form of expected instruction(s):_ `vld1.32 {D0}, [R0]'
+
+ * int16x4_t vld1_s16 (const int16_t *)
+ _Form of expected instruction(s):_ `vld1.16 {D0}, [R0]'
+
+ * int8x8_t vld1_s8 (const int8_t *)
+ _Form of expected instruction(s):_ `vld1.8 {D0}, [R0]'
+
+ * uint64x1_t vld1_u64 (const uint64_t *)
+ _Form of expected instruction(s):_ `vld1.64 {D0}, [R0]'
+
+ * int64x1_t vld1_s64 (const int64_t *)
+ _Form of expected instruction(s):_ `vld1.64 {D0}, [R0]'
+
+ * float32x2_t vld1_f32 (const float32_t *)
+ _Form of expected instruction(s):_ `vld1.32 {D0}, [R0]'
+
+ * poly16x4_t vld1_p16 (const poly16_t *)
+ _Form of expected instruction(s):_ `vld1.16 {D0}, [R0]'
+
+ * poly8x8_t vld1_p8 (const poly8_t *)
+ _Form of expected instruction(s):_ `vld1.8 {D0}, [R0]'
+
+ * uint32x4_t vld1q_u32 (const uint32_t *)
+ _Form of expected instruction(s):_ `vld1.32 {D0, D1}, [R0]'
+
+ * uint16x8_t vld1q_u16 (const uint16_t *)
+ _Form of expected instruction(s):_ `vld1.16 {D0, D1}, [R0]'
+
+ * uint8x16_t vld1q_u8 (const uint8_t *)
+ _Form of expected instruction(s):_ `vld1.8 {D0, D1}, [R0]'
+
+ * int32x4_t vld1q_s32 (const int32_t *)
+ _Form of expected instruction(s):_ `vld1.32 {D0, D1}, [R0]'
+
+ * int16x8_t vld1q_s16 (const int16_t *)
+ _Form of expected instruction(s):_ `vld1.16 {D0, D1}, [R0]'
+
+ * int8x16_t vld1q_s8 (const int8_t *)
+ _Form of expected instruction(s):_ `vld1.8 {D0, D1}, [R0]'
+
+ * uint64x2_t vld1q_u64 (const uint64_t *)
+ _Form of expected instruction(s):_ `vld1.64 {D0, D1}, [R0]'
+
+ * int64x2_t vld1q_s64 (const int64_t *)
+ _Form of expected instruction(s):_ `vld1.64 {D0, D1}, [R0]'
+
+ * float32x4_t vld1q_f32 (const float32_t *)
+ _Form of expected instruction(s):_ `vld1.32 {D0, D1}, [R0]'
+
+ * poly16x8_t vld1q_p16 (const poly16_t *)
+ _Form of expected instruction(s):_ `vld1.16 {D0, D1}, [R0]'
+
+ * poly8x16_t vld1q_p8 (const poly8_t *)
+ _Form of expected instruction(s):_ `vld1.8 {D0, D1}, [R0]'
+
+ * uint32x2_t vld1_lane_u32 (const uint32_t *, uint32x2_t, const int)
+ _Form of expected instruction(s):_ `vld1.32 {D0[0]}, [R0]'
+
+ * uint16x4_t vld1_lane_u16 (const uint16_t *, uint16x4_t, const int)
+ _Form of expected instruction(s):_ `vld1.16 {D0[0]}, [R0]'
+
+ * uint8x8_t vld1_lane_u8 (const uint8_t *, uint8x8_t, const int)
+ _Form of expected instruction(s):_ `vld1.8 {D0[0]}, [R0]'
+
+ * int32x2_t vld1_lane_s32 (const int32_t *, int32x2_t, const int)
+ _Form of expected instruction(s):_ `vld1.32 {D0[0]}, [R0]'
+
+ * int16x4_t vld1_lane_s16 (const int16_t *, int16x4_t, const int)
+ _Form of expected instruction(s):_ `vld1.16 {D0[0]}, [R0]'
+
+ * int8x8_t vld1_lane_s8 (const int8_t *, int8x8_t, const int)
+ _Form of expected instruction(s):_ `vld1.8 {D0[0]}, [R0]'
+
+ * float32x2_t vld1_lane_f32 (const float32_t *, float32x2_t, const
+ int)
+ _Form of expected instruction(s):_ `vld1.32 {D0[0]}, [R0]'
+
+ * poly16x4_t vld1_lane_p16 (const poly16_t *, poly16x4_t, const int)
+ _Form of expected instruction(s):_ `vld1.16 {D0[0]}, [R0]'
+
+ * poly8x8_t vld1_lane_p8 (const poly8_t *, poly8x8_t, const int)
+ _Form of expected instruction(s):_ `vld1.8 {D0[0]}, [R0]'
+
+ * uint64x1_t vld1_lane_u64 (const uint64_t *, uint64x1_t, const int)
+ _Form of expected instruction(s):_ `vld1.64 {D0}, [R0]'
+
+ * int64x1_t vld1_lane_s64 (const int64_t *, int64x1_t, const int)
+ _Form of expected instruction(s):_ `vld1.64 {D0}, [R0]'
+
+ * uint32x4_t vld1q_lane_u32 (const uint32_t *, uint32x4_t, const int)
+ _Form of expected instruction(s):_ `vld1.32 {D0[0]}, [R0]'
+
+ * uint16x8_t vld1q_lane_u16 (const uint16_t *, uint16x8_t, const int)
+ _Form of expected instruction(s):_ `vld1.16 {D0[0]}, [R0]'
+
+ * uint8x16_t vld1q_lane_u8 (const uint8_t *, uint8x16_t, const int)
+ _Form of expected instruction(s):_ `vld1.8 {D0[0]}, [R0]'
+
+ * int32x4_t vld1q_lane_s32 (const int32_t *, int32x4_t, const int)
+ _Form of expected instruction(s):_ `vld1.32 {D0[0]}, [R0]'
+
+ * int16x8_t vld1q_lane_s16 (const int16_t *, int16x8_t, const int)
+ _Form of expected instruction(s):_ `vld1.16 {D0[0]}, [R0]'
+
+ * int8x16_t vld1q_lane_s8 (const int8_t *, int8x16_t, const int)
+ _Form of expected instruction(s):_ `vld1.8 {D0[0]}, [R0]'
+
+ * float32x4_t vld1q_lane_f32 (const float32_t *, float32x4_t, const
+ int)
+ _Form of expected instruction(s):_ `vld1.32 {D0[0]}, [R0]'
+
+ * poly16x8_t vld1q_lane_p16 (const poly16_t *, poly16x8_t, const int)
+ _Form of expected instruction(s):_ `vld1.16 {D0[0]}, [R0]'
+
+ * poly8x16_t vld1q_lane_p8 (const poly8_t *, poly8x16_t, const int)
+ _Form of expected instruction(s):_ `vld1.8 {D0[0]}, [R0]'
+
+ * uint64x2_t vld1q_lane_u64 (const uint64_t *, uint64x2_t, const int)
+ _Form of expected instruction(s):_ `vld1.64 {D0}, [R0]'
+
+ * int64x2_t vld1q_lane_s64 (const int64_t *, int64x2_t, const int)
+ _Form of expected instruction(s):_ `vld1.64 {D0}, [R0]'
+
+ * uint32x2_t vld1_dup_u32 (const uint32_t *)
+ _Form of expected instruction(s):_ `vld1.32 {D0[]}, [R0]'
+
+ * uint16x4_t vld1_dup_u16 (const uint16_t *)
+ _Form of expected instruction(s):_ `vld1.16 {D0[]}, [R0]'
+
+ * uint8x8_t vld1_dup_u8 (const uint8_t *)
+ _Form of expected instruction(s):_ `vld1.8 {D0[]}, [R0]'
+
+ * int32x2_t vld1_dup_s32 (const int32_t *)
+ _Form of expected instruction(s):_ `vld1.32 {D0[]}, [R0]'
+
+ * int16x4_t vld1_dup_s16 (const int16_t *)
+ _Form of expected instruction(s):_ `vld1.16 {D0[]}, [R0]'
+
+ * int8x8_t vld1_dup_s8 (const int8_t *)
+ _Form of expected instruction(s):_ `vld1.8 {D0[]}, [R0]'
+
+ * float32x2_t vld1_dup_f32 (const float32_t *)
+ _Form of expected instruction(s):_ `vld1.32 {D0[]}, [R0]'
+
+ * poly16x4_t vld1_dup_p16 (const poly16_t *)
+ _Form of expected instruction(s):_ `vld1.16 {D0[]}, [R0]'
+
+ * poly8x8_t vld1_dup_p8 (const poly8_t *)
+ _Form of expected instruction(s):_ `vld1.8 {D0[]}, [R0]'
+
+ * uint64x1_t vld1_dup_u64 (const uint64_t *)
+ _Form of expected instruction(s):_ `vld1.64 {D0}, [R0]'
+
+ * int64x1_t vld1_dup_s64 (const int64_t *)
+ _Form of expected instruction(s):_ `vld1.64 {D0}, [R0]'
+
+ * uint32x4_t vld1q_dup_u32 (const uint32_t *)
+ _Form of expected instruction(s):_ `vld1.32 {D0[], D1[]}, [R0]'
+
+ * uint16x8_t vld1q_dup_u16 (const uint16_t *)
+ _Form of expected instruction(s):_ `vld1.16 {D0[], D1[]}, [R0]'
+
+ * uint8x16_t vld1q_dup_u8 (const uint8_t *)
+ _Form of expected instruction(s):_ `vld1.8 {D0[], D1[]}, [R0]'
+
+ * int32x4_t vld1q_dup_s32 (const int32_t *)
+ _Form of expected instruction(s):_ `vld1.32 {D0[], D1[]}, [R0]'
+
+ * int16x8_t vld1q_dup_s16 (const int16_t *)
+ _Form of expected instruction(s):_ `vld1.16 {D0[], D1[]}, [R0]'
+
+ * int8x16_t vld1q_dup_s8 (const int8_t *)
+ _Form of expected instruction(s):_ `vld1.8 {D0[], D1[]}, [R0]'
+
+ * float32x4_t vld1q_dup_f32 (const float32_t *)
+ _Form of expected instruction(s):_ `vld1.32 {D0[], D1[]}, [R0]'
+
+ * poly16x8_t vld1q_dup_p16 (const poly16_t *)
+ _Form of expected instruction(s):_ `vld1.16 {D0[], D1[]}, [R0]'
+
+ * poly8x16_t vld1q_dup_p8 (const poly8_t *)
+ _Form of expected instruction(s):_ `vld1.8 {D0[], D1[]}, [R0]'
+
+ * uint64x2_t vld1q_dup_u64 (const uint64_t *)
+ _Form of expected instruction(s):_ `vld1.64 {D0, D1}, [R0]'
+
+ * int64x2_t vld1q_dup_s64 (const int64_t *)
+ _Form of expected instruction(s):_ `vld1.64 {D0, D1}, [R0]'
+
+5.50.3.69 Element/structure stores, VST1 variants
+.................................................
+
+ * void vst1_u32 (uint32_t *, uint32x2_t)
+ _Form of expected instruction(s):_ `vst1.32 {D0}, [R0]'
+
+ * void vst1_u16 (uint16_t *, uint16x4_t)
+ _Form of expected instruction(s):_ `vst1.16 {D0}, [R0]'
+
+ * void vst1_u8 (uint8_t *, uint8x8_t)
+ _Form of expected instruction(s):_ `vst1.8 {D0}, [R0]'
+
+ * void vst1_s32 (int32_t *, int32x2_t)
+ _Form of expected instruction(s):_ `vst1.32 {D0}, [R0]'
+
+ * void vst1_s16 (int16_t *, int16x4_t)
+ _Form of expected instruction(s):_ `vst1.16 {D0}, [R0]'
+
+ * void vst1_s8 (int8_t *, int8x8_t)
+ _Form of expected instruction(s):_ `vst1.8 {D0}, [R0]'
+
+ * void vst1_u64 (uint64_t *, uint64x1_t)
+ _Form of expected instruction(s):_ `vst1.64 {D0}, [R0]'
+
+ * void vst1_s64 (int64_t *, int64x1_t)
+ _Form of expected instruction(s):_ `vst1.64 {D0}, [R0]'
+
+ * void vst1_f32 (float32_t *, float32x2_t)
+ _Form of expected instruction(s):_ `vst1.32 {D0}, [R0]'
+
+ * void vst1_p16 (poly16_t *, poly16x4_t)
+ _Form of expected instruction(s):_ `vst1.16 {D0}, [R0]'
+
+ * void vst1_p8 (poly8_t *, poly8x8_t)
+ _Form of expected instruction(s):_ `vst1.8 {D0}, [R0]'
+
+ * void vst1q_u32 (uint32_t *, uint32x4_t)
+ _Form of expected instruction(s):_ `vst1.32 {D0, D1}, [R0]'
+
+ * void vst1q_u16 (uint16_t *, uint16x8_t)
+ _Form of expected instruction(s):_ `vst1.16 {D0, D1}, [R0]'
+
+ * void vst1q_u8 (uint8_t *, uint8x16_t)
+ _Form of expected instruction(s):_ `vst1.8 {D0, D1}, [R0]'
+
+ * void vst1q_s32 (int32_t *, int32x4_t)
+ _Form of expected instruction(s):_ `vst1.32 {D0, D1}, [R0]'
+
+ * void vst1q_s16 (int16_t *, int16x8_t)
+ _Form of expected instruction(s):_ `vst1.16 {D0, D1}, [R0]'
+
+ * void vst1q_s8 (int8_t *, int8x16_t)
+ _Form of expected instruction(s):_ `vst1.8 {D0, D1}, [R0]'
+
+ * void vst1q_u64 (uint64_t *, uint64x2_t)
+ _Form of expected instruction(s):_ `vst1.64 {D0, D1}, [R0]'
+
+ * void vst1q_s64 (int64_t *, int64x2_t)
+ _Form of expected instruction(s):_ `vst1.64 {D0, D1}, [R0]'
+
+ * void vst1q_f32 (float32_t *, float32x4_t)
+ _Form of expected instruction(s):_ `vst1.32 {D0, D1}, [R0]'
+
+ * void vst1q_p16 (poly16_t *, poly16x8_t)
+ _Form of expected instruction(s):_ `vst1.16 {D0, D1}, [R0]'
+
+ * void vst1q_p8 (poly8_t *, poly8x16_t)
+ _Form of expected instruction(s):_ `vst1.8 {D0, D1}, [R0]'
+
+ * void vst1_lane_u32 (uint32_t *, uint32x2_t, const int)
+ _Form of expected instruction(s):_ `vst1.32 {D0[0]}, [R0]'
+
+ * void vst1_lane_u16 (uint16_t *, uint16x4_t, const int)
+ _Form of expected instruction(s):_ `vst1.16 {D0[0]}, [R0]'
+
+ * void vst1_lane_u8 (uint8_t *, uint8x8_t, const int)
+ _Form of expected instruction(s):_ `vst1.8 {D0[0]}, [R0]'
+
+ * void vst1_lane_s32 (int32_t *, int32x2_t, const int)
+ _Form of expected instruction(s):_ `vst1.32 {D0[0]}, [R0]'
+
+ * void vst1_lane_s16 (int16_t *, int16x4_t, const int)
+ _Form of expected instruction(s):_ `vst1.16 {D0[0]}, [R0]'
+
+ * void vst1_lane_s8 (int8_t *, int8x8_t, const int)
+ _Form of expected instruction(s):_ `vst1.8 {D0[0]}, [R0]'
+
+ * void vst1_lane_f32 (float32_t *, float32x2_t, const int)
+ _Form of expected instruction(s):_ `vst1.32 {D0[0]}, [R0]'
+
+ * void vst1_lane_p16 (poly16_t *, poly16x4_t, const int)
+ _Form of expected instruction(s):_ `vst1.16 {D0[0]}, [R0]'
+
+ * void vst1_lane_p8 (poly8_t *, poly8x8_t, const int)
+ _Form of expected instruction(s):_ `vst1.8 {D0[0]}, [R0]'
+
+ * void vst1_lane_s64 (int64_t *, int64x1_t, const int)
+ _Form of expected instruction(s):_ `vst1.64 {D0}, [R0]'
+
+ * void vst1_lane_u64 (uint64_t *, uint64x1_t, const int)
+ _Form of expected instruction(s):_ `vst1.64 {D0}, [R0]'
+
+ * void vst1q_lane_u32 (uint32_t *, uint32x4_t, const int)
+ _Form of expected instruction(s):_ `vst1.32 {D0[0]}, [R0]'
+
+ * void vst1q_lane_u16 (uint16_t *, uint16x8_t, const int)
+ _Form of expected instruction(s):_ `vst1.16 {D0[0]}, [R0]'
+
+ * void vst1q_lane_u8 (uint8_t *, uint8x16_t, const int)
+ _Form of expected instruction(s):_ `vst1.8 {D0[0]}, [R0]'
+
+ * void vst1q_lane_s32 (int32_t *, int32x4_t, const int)
+ _Form of expected instruction(s):_ `vst1.32 {D0[0]}, [R0]'
+
+ * void vst1q_lane_s16 (int16_t *, int16x8_t, const int)
+ _Form of expected instruction(s):_ `vst1.16 {D0[0]}, [R0]'
+
+ * void vst1q_lane_s8 (int8_t *, int8x16_t, const int)
+ _Form of expected instruction(s):_ `vst1.8 {D0[0]}, [R0]'
+
+ * void vst1q_lane_f32 (float32_t *, float32x4_t, const int)
+ _Form of expected instruction(s):_ `vst1.32 {D0[0]}, [R0]'
+
+ * void vst1q_lane_p16 (poly16_t *, poly16x8_t, const int)
+ _Form of expected instruction(s):_ `vst1.16 {D0[0]}, [R0]'
+
+ * void vst1q_lane_p8 (poly8_t *, poly8x16_t, const int)
+ _Form of expected instruction(s):_ `vst1.8 {D0[0]}, [R0]'
+
+ * void vst1q_lane_s64 (int64_t *, int64x2_t, const int)
+ _Form of expected instruction(s):_ `vst1.64 {D0}, [R0]'
+
+ * void vst1q_lane_u64 (uint64_t *, uint64x2_t, const int)
+ _Form of expected instruction(s):_ `vst1.64 {D0}, [R0]'
+
+5.50.3.70 Element/structure loads, VLD2 variants
+................................................
+
+ * uint32x2x2_t vld2_u32 (const uint32_t *)
+ _Form of expected instruction(s):_ `vld2.32 {D0, D1}, [R0]'
+
+ * uint16x4x2_t vld2_u16 (const uint16_t *)
+ _Form of expected instruction(s):_ `vld2.16 {D0, D1}, [R0]'
+
+ * uint8x8x2_t vld2_u8 (const uint8_t *)
+ _Form of expected instruction(s):_ `vld2.8 {D0, D1}, [R0]'
+
+ * int32x2x2_t vld2_s32 (const int32_t *)
+ _Form of expected instruction(s):_ `vld2.32 {D0, D1}, [R0]'
+
+ * int16x4x2_t vld2_s16 (const int16_t *)
+ _Form of expected instruction(s):_ `vld2.16 {D0, D1}, [R0]'
+
+ * int8x8x2_t vld2_s8 (const int8_t *)
+ _Form of expected instruction(s):_ `vld2.8 {D0, D1}, [R0]'
+
+ * float32x2x2_t vld2_f32 (const float32_t *)
+ _Form of expected instruction(s):_ `vld2.32 {D0, D1}, [R0]'
+
+ * poly16x4x2_t vld2_p16 (const poly16_t *)
+ _Form of expected instruction(s):_ `vld2.16 {D0, D1}, [R0]'
+
+ * poly8x8x2_t vld2_p8 (const poly8_t *)
+ _Form of expected instruction(s):_ `vld2.8 {D0, D1}, [R0]'
+
+ * uint64x1x2_t vld2_u64 (const uint64_t *)
+ _Form of expected instruction(s):_ `vld1.64 {D0, D1}, [R0]'
+
+ * int64x1x2_t vld2_s64 (const int64_t *)
+ _Form of expected instruction(s):_ `vld1.64 {D0, D1}, [R0]'
+
+ * uint32x4x2_t vld2q_u32 (const uint32_t *)
+ _Form of expected instruction(s):_ `vld2.32 {D0, D1}, [R0]'
+
+ * uint16x8x2_t vld2q_u16 (const uint16_t *)
+ _Form of expected instruction(s):_ `vld2.16 {D0, D1}, [R0]'
+
+ * uint8x16x2_t vld2q_u8 (const uint8_t *)
+ _Form of expected instruction(s):_ `vld2.8 {D0, D1}, [R0]'
+
+ * int32x4x2_t vld2q_s32 (const int32_t *)
+ _Form of expected instruction(s):_ `vld2.32 {D0, D1}, [R0]'
+
+ * int16x8x2_t vld2q_s16 (const int16_t *)
+ _Form of expected instruction(s):_ `vld2.16 {D0, D1}, [R0]'
+
+ * int8x16x2_t vld2q_s8 (const int8_t *)
+ _Form of expected instruction(s):_ `vld2.8 {D0, D1}, [R0]'
+
+ * float32x4x2_t vld2q_f32 (const float32_t *)
+ _Form of expected instruction(s):_ `vld2.32 {D0, D1}, [R0]'
+
+ * poly16x8x2_t vld2q_p16 (const poly16_t *)
+ _Form of expected instruction(s):_ `vld2.16 {D0, D1}, [R0]'
+
+ * poly8x16x2_t vld2q_p8 (const poly8_t *)
+ _Form of expected instruction(s):_ `vld2.8 {D0, D1}, [R0]'
+
+ * uint32x2x2_t vld2_lane_u32 (const uint32_t *, uint32x2x2_t, const
+ int)
+ _Form of expected instruction(s):_ `vld2.32 {D0[0], D1[0]}, [R0]'
+
+ * uint16x4x2_t vld2_lane_u16 (const uint16_t *, uint16x4x2_t, const
+ int)
+ _Form of expected instruction(s):_ `vld2.16 {D0[0], D1[0]}, [R0]'
+
+ * uint8x8x2_t vld2_lane_u8 (const uint8_t *, uint8x8x2_t, const int)
+ _Form of expected instruction(s):_ `vld2.8 {D0[0], D1[0]}, [R0]'
+
+ * int32x2x2_t vld2_lane_s32 (const int32_t *, int32x2x2_t, const int)
+ _Form of expected instruction(s):_ `vld2.32 {D0[0], D1[0]}, [R0]'
+
+ * int16x4x2_t vld2_lane_s16 (const int16_t *, int16x4x2_t, const int)
+ _Form of expected instruction(s):_ `vld2.16 {D0[0], D1[0]}, [R0]'
+
+ * int8x8x2_t vld2_lane_s8 (const int8_t *, int8x8x2_t, const int)
+ _Form of expected instruction(s):_ `vld2.8 {D0[0], D1[0]}, [R0]'
+
+ * float32x2x2_t vld2_lane_f32 (const float32_t *, float32x2x2_t,
+ const int)
+ _Form of expected instruction(s):_ `vld2.32 {D0[0], D1[0]}, [R0]'
+
+ * poly16x4x2_t vld2_lane_p16 (const poly16_t *, poly16x4x2_t, const
+ int)
+ _Form of expected instruction(s):_ `vld2.16 {D0[0], D1[0]}, [R0]'
+
+ * poly8x8x2_t vld2_lane_p8 (const poly8_t *, poly8x8x2_t, const int)
+ _Form of expected instruction(s):_ `vld2.8 {D0[0], D1[0]}, [R0]'
+
+ * int32x4x2_t vld2q_lane_s32 (const int32_t *, int32x4x2_t, const
+ int)
+ _Form of expected instruction(s):_ `vld2.32 {D0[0], D1[0]}, [R0]'
+
+ * int16x8x2_t vld2q_lane_s16 (const int16_t *, int16x8x2_t, const
+ int)
+ _Form of expected instruction(s):_ `vld2.16 {D0[0], D1[0]}, [R0]'
+
+ * uint32x4x2_t vld2q_lane_u32 (const uint32_t *, uint32x4x2_t, const
+ int)
+ _Form of expected instruction(s):_ `vld2.32 {D0[0], D1[0]}, [R0]'
+
+ * uint16x8x2_t vld2q_lane_u16 (const uint16_t *, uint16x8x2_t, const
+ int)
+ _Form of expected instruction(s):_ `vld2.16 {D0[0], D1[0]}, [R0]'
+
+ * float32x4x2_t vld2q_lane_f32 (const float32_t *, float32x4x2_t,
+ const int)
+ _Form of expected instruction(s):_ `vld2.32 {D0[0], D1[0]}, [R0]'
+
+ * poly16x8x2_t vld2q_lane_p16 (const poly16_t *, poly16x8x2_t, const
+ int)
+ _Form of expected instruction(s):_ `vld2.16 {D0[0], D1[0]}, [R0]'
+
+ * uint32x2x2_t vld2_dup_u32 (const uint32_t *)
+ _Form of expected instruction(s):_ `vld2.32 {D0[], D1[]}, [R0]'
+
+ * uint16x4x2_t vld2_dup_u16 (const uint16_t *)
+ _Form of expected instruction(s):_ `vld2.16 {D0[], D1[]}, [R0]'
+
+ * uint8x8x2_t vld2_dup_u8 (const uint8_t *)
+ _Form of expected instruction(s):_ `vld2.8 {D0[], D1[]}, [R0]'
+
+ * int32x2x2_t vld2_dup_s32 (const int32_t *)
+ _Form of expected instruction(s):_ `vld2.32 {D0[], D1[]}, [R0]'
+
+ * int16x4x2_t vld2_dup_s16 (const int16_t *)
+ _Form of expected instruction(s):_ `vld2.16 {D0[], D1[]}, [R0]'
+
+ * int8x8x2_t vld2_dup_s8 (const int8_t *)
+ _Form of expected instruction(s):_ `vld2.8 {D0[], D1[]}, [R0]'
+
+ * float32x2x2_t vld2_dup_f32 (const float32_t *)
+ _Form of expected instruction(s):_ `vld2.32 {D0[], D1[]}, [R0]'
+
+ * poly16x4x2_t vld2_dup_p16 (const poly16_t *)
+ _Form of expected instruction(s):_ `vld2.16 {D0[], D1[]}, [R0]'
+
+ * poly8x8x2_t vld2_dup_p8 (const poly8_t *)
+ _Form of expected instruction(s):_ `vld2.8 {D0[], D1[]}, [R0]'
+
+ * uint64x1x2_t vld2_dup_u64 (const uint64_t *)
+ _Form of expected instruction(s):_ `vld1.64 {D0, D1}, [R0]'
+
+ * int64x1x2_t vld2_dup_s64 (const int64_t *)
+ _Form of expected instruction(s):_ `vld1.64 {D0, D1}, [R0]'
+
+5.50.3.71 Element/structure stores, VST2 variants
+.................................................
+
+ * void vst2_u32 (uint32_t *, uint32x2x2_t)
+ _Form of expected instruction(s):_ `vst2.32 {D0, D1}, [R0]'
+
+ * void vst2_u16 (uint16_t *, uint16x4x2_t)
+ _Form of expected instruction(s):_ `vst2.16 {D0, D1}, [R0]'
+
+ * void vst2_u8 (uint8_t *, uint8x8x2_t)
+ _Form of expected instruction(s):_ `vst2.8 {D0, D1}, [R0]'
+
+ * void vst2_s32 (int32_t *, int32x2x2_t)
+ _Form of expected instruction(s):_ `vst2.32 {D0, D1}, [R0]'
+
+ * void vst2_s16 (int16_t *, int16x4x2_t)
+ _Form of expected instruction(s):_ `vst2.16 {D0, D1}, [R0]'
+
+ * void vst2_s8 (int8_t *, int8x8x2_t)
+ _Form of expected instruction(s):_ `vst2.8 {D0, D1}, [R0]'
+
+ * void vst2_f32 (float32_t *, float32x2x2_t)
+ _Form of expected instruction(s):_ `vst2.32 {D0, D1}, [R0]'
+
+ * void vst2_p16 (poly16_t *, poly16x4x2_t)
+ _Form of expected instruction(s):_ `vst2.16 {D0, D1}, [R0]'
+
+ * void vst2_p8 (poly8_t *, poly8x8x2_t)
+ _Form of expected instruction(s):_ `vst2.8 {D0, D1}, [R0]'
+
+ * void vst2_u64 (uint64_t *, uint64x1x2_t)
+ _Form of expected instruction(s):_ `vst1.64 {D0, D1}, [R0]'
+
+ * void vst2_s64 (int64_t *, int64x1x2_t)
+ _Form of expected instruction(s):_ `vst1.64 {D0, D1}, [R0]'
+
+ * void vst2q_u32 (uint32_t *, uint32x4x2_t)
+ _Form of expected instruction(s):_ `vst2.32 {D0, D1}, [R0]'
+
+ * void vst2q_u16 (uint16_t *, uint16x8x2_t)
+ _Form of expected instruction(s):_ `vst2.16 {D0, D1}, [R0]'
+
+ * void vst2q_u8 (uint8_t *, uint8x16x2_t)
+ _Form of expected instruction(s):_ `vst2.8 {D0, D1}, [R0]'
+
+ * void vst2q_s32 (int32_t *, int32x4x2_t)
+ _Form of expected instruction(s):_ `vst2.32 {D0, D1}, [R0]'
+
+ * void vst2q_s16 (int16_t *, int16x8x2_t)
+ _Form of expected instruction(s):_ `vst2.16 {D0, D1}, [R0]'
+
+ * void vst2q_s8 (int8_t *, int8x16x2_t)
+ _Form of expected instruction(s):_ `vst2.8 {D0, D1}, [R0]'
+
+ * void vst2q_f32 (float32_t *, float32x4x2_t)
+ _Form of expected instruction(s):_ `vst2.32 {D0, D1}, [R0]'
+
+ * void vst2q_p16 (poly16_t *, poly16x8x2_t)
+ _Form of expected instruction(s):_ `vst2.16 {D0, D1}, [R0]'
+
+ * void vst2q_p8 (poly8_t *, poly8x16x2_t)
+ _Form of expected instruction(s):_ `vst2.8 {D0, D1}, [R0]'
+
+ * void vst2_lane_u32 (uint32_t *, uint32x2x2_t, const int)
+ _Form of expected instruction(s):_ `vst2.32 {D0[0], D1[0]}, [R0]'
+
+ * void vst2_lane_u16 (uint16_t *, uint16x4x2_t, const int)
+ _Form of expected instruction(s):_ `vst2.16 {D0[0], D1[0]}, [R0]'
+
+ * void vst2_lane_u8 (uint8_t *, uint8x8x2_t, const int)
+ _Form of expected instruction(s):_ `vst2.8 {D0[0], D1[0]}, [R0]'
+
+ * void vst2_lane_s32 (int32_t *, int32x2x2_t, const int)
+ _Form of expected instruction(s):_ `vst2.32 {D0[0], D1[0]}, [R0]'
+
+ * void vst2_lane_s16 (int16_t *, int16x4x2_t, const int)
+ _Form of expected instruction(s):_ `vst2.16 {D0[0], D1[0]}, [R0]'
+
+ * void vst2_lane_s8 (int8_t *, int8x8x2_t, const int)
+ _Form of expected instruction(s):_ `vst2.8 {D0[0], D1[0]}, [R0]'
+
+ * void vst2_lane_f32 (float32_t *, float32x2x2_t, const int)
+ _Form of expected instruction(s):_ `vst2.32 {D0[0], D1[0]}, [R0]'
+
+ * void vst2_lane_p16 (poly16_t *, poly16x4x2_t, const int)
+ _Form of expected instruction(s):_ `vst2.16 {D0[0], D1[0]}, [R0]'
+
+ * void vst2_lane_p8 (poly8_t *, poly8x8x2_t, const int)
+ _Form of expected instruction(s):_ `vst2.8 {D0[0], D1[0]}, [R0]'
+
+ * void vst2q_lane_s32 (int32_t *, int32x4x2_t, const int)
+ _Form of expected instruction(s):_ `vst2.32 {D0[0], D1[0]}, [R0]'
+
+ * void vst2q_lane_s16 (int16_t *, int16x8x2_t, const int)
+ _Form of expected instruction(s):_ `vst2.16 {D0[0], D1[0]}, [R0]'
+
+ * void vst2q_lane_u32 (uint32_t *, uint32x4x2_t, const int)
+ _Form of expected instruction(s):_ `vst2.32 {D0[0], D1[0]}, [R0]'
+
+ * void vst2q_lane_u16 (uint16_t *, uint16x8x2_t, const int)
+ _Form of expected instruction(s):_ `vst2.16 {D0[0], D1[0]}, [R0]'
+
+ * void vst2q_lane_f32 (float32_t *, float32x4x2_t, const int)
+ _Form of expected instruction(s):_ `vst2.32 {D0[0], D1[0]}, [R0]'
+
+ * void vst2q_lane_p16 (poly16_t *, poly16x8x2_t, const int)
+ _Form of expected instruction(s):_ `vst2.16 {D0[0], D1[0]}, [R0]'
+
+5.50.3.72 Element/structure loads, VLD3 variants
+................................................
+
+ * uint32x2x3_t vld3_u32 (const uint32_t *)
+ _Form of expected instruction(s):_ `vld3.32 {D0, D1, D2}, [R0]'
+
+ * uint16x4x3_t vld3_u16 (const uint16_t *)
+ _Form of expected instruction(s):_ `vld3.16 {D0, D1, D2}, [R0]'
+
+ * uint8x8x3_t vld3_u8 (const uint8_t *)
+ _Form of expected instruction(s):_ `vld3.8 {D0, D1, D2}, [R0]'
+
+ * int32x2x3_t vld3_s32 (const int32_t *)
+ _Form of expected instruction(s):_ `vld3.32 {D0, D1, D2}, [R0]'
+
+ * int16x4x3_t vld3_s16 (const int16_t *)
+ _Form of expected instruction(s):_ `vld3.16 {D0, D1, D2}, [R0]'
+
+ * int8x8x3_t vld3_s8 (const int8_t *)
+ _Form of expected instruction(s):_ `vld3.8 {D0, D1, D2}, [R0]'
+
+ * float32x2x3_t vld3_f32 (const float32_t *)
+ _Form of expected instruction(s):_ `vld3.32 {D0, D1, D2}, [R0]'
+
+ * poly16x4x3_t vld3_p16 (const poly16_t *)
+ _Form of expected instruction(s):_ `vld3.16 {D0, D1, D2}, [R0]'
+
+ * poly8x8x3_t vld3_p8 (const poly8_t *)
+ _Form of expected instruction(s):_ `vld3.8 {D0, D1, D2}, [R0]'
+
+ * uint64x1x3_t vld3_u64 (const uint64_t *)
+ _Form of expected instruction(s):_ `vld1.64 {D0, D1, D2}, [R0]'
+
+ * int64x1x3_t vld3_s64 (const int64_t *)
+ _Form of expected instruction(s):_ `vld1.64 {D0, D1, D2}, [R0]'
+
+ * uint32x4x3_t vld3q_u32 (const uint32_t *)
+ _Form of expected instruction(s):_ `vld3.32 {D0, D1, D2}, [R0]'
+
+ * uint16x8x3_t vld3q_u16 (const uint16_t *)
+ _Form of expected instruction(s):_ `vld3.16 {D0, D1, D2}, [R0]'
+
+ * uint8x16x3_t vld3q_u8 (const uint8_t *)
+ _Form of expected instruction(s):_ `vld3.8 {D0, D1, D2}, [R0]'
+
+ * int32x4x3_t vld3q_s32 (const int32_t *)
+ _Form of expected instruction(s):_ `vld3.32 {D0, D1, D2}, [R0]'
+
+ * int16x8x3_t vld3q_s16 (const int16_t *)
+ _Form of expected instruction(s):_ `vld3.16 {D0, D1, D2}, [R0]'
+
+ * int8x16x3_t vld3q_s8 (const int8_t *)
+ _Form of expected instruction(s):_ `vld3.8 {D0, D1, D2}, [R0]'
+
+ * float32x4x3_t vld3q_f32 (const float32_t *)
+ _Form of expected instruction(s):_ `vld3.32 {D0, D1, D2}, [R0]'
+
+ * poly16x8x3_t vld3q_p16 (const poly16_t *)
+ _Form of expected instruction(s):_ `vld3.16 {D0, D1, D2}, [R0]'
+
+ * poly8x16x3_t vld3q_p8 (const poly8_t *)
+ _Form of expected instruction(s):_ `vld3.8 {D0, D1, D2}, [R0]'
+
+ * uint32x2x3_t vld3_lane_u32 (const uint32_t *, uint32x2x3_t, const
+ int)
+ _Form of expected instruction(s):_ `vld3.32 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * uint16x4x3_t vld3_lane_u16 (const uint16_t *, uint16x4x3_t, const
+ int)
+ _Form of expected instruction(s):_ `vld3.16 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * uint8x8x3_t vld3_lane_u8 (const uint8_t *, uint8x8x3_t, const int)
+ _Form of expected instruction(s):_ `vld3.8 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * int32x2x3_t vld3_lane_s32 (const int32_t *, int32x2x3_t, const int)
+ _Form of expected instruction(s):_ `vld3.32 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * int16x4x3_t vld3_lane_s16 (const int16_t *, int16x4x3_t, const int)
+ _Form of expected instruction(s):_ `vld3.16 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * int8x8x3_t vld3_lane_s8 (const int8_t *, int8x8x3_t, const int)
+ _Form of expected instruction(s):_ `vld3.8 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * float32x2x3_t vld3_lane_f32 (const float32_t *, float32x2x3_t,
+ const int)
+ _Form of expected instruction(s):_ `vld3.32 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * poly16x4x3_t vld3_lane_p16 (const poly16_t *, poly16x4x3_t, const
+ int)
+ _Form of expected instruction(s):_ `vld3.16 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * poly8x8x3_t vld3_lane_p8 (const poly8_t *, poly8x8x3_t, const int)
+ _Form of expected instruction(s):_ `vld3.8 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * int32x4x3_t vld3q_lane_s32 (const int32_t *, int32x4x3_t, const
+ int)
+ _Form of expected instruction(s):_ `vld3.32 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * int16x8x3_t vld3q_lane_s16 (const int16_t *, int16x8x3_t, const
+ int)
+ _Form of expected instruction(s):_ `vld3.16 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * uint32x4x3_t vld3q_lane_u32 (const uint32_t *, uint32x4x3_t, const
+ int)
+ _Form of expected instruction(s):_ `vld3.32 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * uint16x8x3_t vld3q_lane_u16 (const uint16_t *, uint16x8x3_t, const
+ int)
+ _Form of expected instruction(s):_ `vld3.16 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * float32x4x3_t vld3q_lane_f32 (const float32_t *, float32x4x3_t,
+ const int)
+ _Form of expected instruction(s):_ `vld3.32 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * poly16x8x3_t vld3q_lane_p16 (const poly16_t *, poly16x8x3_t, const
+ int)
+ _Form of expected instruction(s):_ `vld3.16 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * uint32x2x3_t vld3_dup_u32 (const uint32_t *)
+ _Form of expected instruction(s):_ `vld3.32 {D0[], D1[], D2[]},
+ [R0]'
+
+ * uint16x4x3_t vld3_dup_u16 (const uint16_t *)
+ _Form of expected instruction(s):_ `vld3.16 {D0[], D1[], D2[]},
+ [R0]'
+
+ * uint8x8x3_t vld3_dup_u8 (const uint8_t *)
+ _Form of expected instruction(s):_ `vld3.8 {D0[], D1[], D2[]},
+ [R0]'
+
+ * int32x2x3_t vld3_dup_s32 (const int32_t *)
+ _Form of expected instruction(s):_ `vld3.32 {D0[], D1[], D2[]},
+ [R0]'
+
+ * int16x4x3_t vld3_dup_s16 (const int16_t *)
+ _Form of expected instruction(s):_ `vld3.16 {D0[], D1[], D2[]},
+ [R0]'
+
+ * int8x8x3_t vld3_dup_s8 (const int8_t *)
+ _Form of expected instruction(s):_ `vld3.8 {D0[], D1[], D2[]},
+ [R0]'
+
+ * float32x2x3_t vld3_dup_f32 (const float32_t *)
+ _Form of expected instruction(s):_ `vld3.32 {D0[], D1[], D2[]},
+ [R0]'
+
+ * poly16x4x3_t vld3_dup_p16 (const poly16_t *)
+ _Form of expected instruction(s):_ `vld3.16 {D0[], D1[], D2[]},
+ [R0]'
+
+ * poly8x8x3_t vld3_dup_p8 (const poly8_t *)
+ _Form of expected instruction(s):_ `vld3.8 {D0[], D1[], D2[]},
+ [R0]'
+
+ * uint64x1x3_t vld3_dup_u64 (const uint64_t *)
+ _Form of expected instruction(s):_ `vld1.64 {D0, D1, D2}, [R0]'
+
+ * int64x1x3_t vld3_dup_s64 (const int64_t *)
+ _Form of expected instruction(s):_ `vld1.64 {D0, D1, D2}, [R0]'
+
+5.50.3.73 Element/structure stores, VST3 variants
+.................................................
+
+ * void vst3_u32 (uint32_t *, uint32x2x3_t)
+ _Form of expected instruction(s):_ `vst3.32 {D0, D1, D2, D3}, [R0]'
+
+ * void vst3_u16 (uint16_t *, uint16x4x3_t)
+ _Form of expected instruction(s):_ `vst3.16 {D0, D1, D2, D3}, [R0]'
+
+ * void vst3_u8 (uint8_t *, uint8x8x3_t)
+ _Form of expected instruction(s):_ `vst3.8 {D0, D1, D2, D3}, [R0]'
+
+ * void vst3_s32 (int32_t *, int32x2x3_t)
+ _Form of expected instruction(s):_ `vst3.32 {D0, D1, D2, D3}, [R0]'
+
+ * void vst3_s16 (int16_t *, int16x4x3_t)
+ _Form of expected instruction(s):_ `vst3.16 {D0, D1, D2, D3}, [R0]'
+
+ * void vst3_s8 (int8_t *, int8x8x3_t)
+ _Form of expected instruction(s):_ `vst3.8 {D0, D1, D2, D3}, [R0]'
+
+ * void vst3_f32 (float32_t *, float32x2x3_t)
+ _Form of expected instruction(s):_ `vst3.32 {D0, D1, D2, D3}, [R0]'
+
+ * void vst3_p16 (poly16_t *, poly16x4x3_t)
+ _Form of expected instruction(s):_ `vst3.16 {D0, D1, D2, D3}, [R0]'
+
+ * void vst3_p8 (poly8_t *, poly8x8x3_t)
+ _Form of expected instruction(s):_ `vst3.8 {D0, D1, D2, D3}, [R0]'
+
+ * void vst3_u64 (uint64_t *, uint64x1x3_t)
+ _Form of expected instruction(s):_ `vst1.64 {D0, D1, D2, D3}, [R0]'
+
+ * void vst3_s64 (int64_t *, int64x1x3_t)
+ _Form of expected instruction(s):_ `vst1.64 {D0, D1, D2, D3}, [R0]'
+
+ * void vst3q_u32 (uint32_t *, uint32x4x3_t)
+ _Form of expected instruction(s):_ `vst3.32 {D0, D1, D2}, [R0]'
+
+ * void vst3q_u16 (uint16_t *, uint16x8x3_t)
+ _Form of expected instruction(s):_ `vst3.16 {D0, D1, D2}, [R0]'
+
+ * void vst3q_u8 (uint8_t *, uint8x16x3_t)
+ _Form of expected instruction(s):_ `vst3.8 {D0, D1, D2}, [R0]'
+
+ * void vst3q_s32 (int32_t *, int32x4x3_t)
+ _Form of expected instruction(s):_ `vst3.32 {D0, D1, D2}, [R0]'
+
+ * void vst3q_s16 (int16_t *, int16x8x3_t)
+ _Form of expected instruction(s):_ `vst3.16 {D0, D1, D2}, [R0]'
+
+ * void vst3q_s8 (int8_t *, int8x16x3_t)
+ _Form of expected instruction(s):_ `vst3.8 {D0, D1, D2}, [R0]'
+
+ * void vst3q_f32 (float32_t *, float32x4x3_t)
+ _Form of expected instruction(s):_ `vst3.32 {D0, D1, D2}, [R0]'
+
+ * void vst3q_p16 (poly16_t *, poly16x8x3_t)
+ _Form of expected instruction(s):_ `vst3.16 {D0, D1, D2}, [R0]'
+
+ * void vst3q_p8 (poly8_t *, poly8x16x3_t)
+ _Form of expected instruction(s):_ `vst3.8 {D0, D1, D2}, [R0]'
+
+ * void vst3_lane_u32 (uint32_t *, uint32x2x3_t, const int)
+ _Form of expected instruction(s):_ `vst3.32 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * void vst3_lane_u16 (uint16_t *, uint16x4x3_t, const int)
+ _Form of expected instruction(s):_ `vst3.16 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * void vst3_lane_u8 (uint8_t *, uint8x8x3_t, const int)
+ _Form of expected instruction(s):_ `vst3.8 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * void vst3_lane_s32 (int32_t *, int32x2x3_t, const int)
+ _Form of expected instruction(s):_ `vst3.32 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * void vst3_lane_s16 (int16_t *, int16x4x3_t, const int)
+ _Form of expected instruction(s):_ `vst3.16 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * void vst3_lane_s8 (int8_t *, int8x8x3_t, const int)
+ _Form of expected instruction(s):_ `vst3.8 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * void vst3_lane_f32 (float32_t *, float32x2x3_t, const int)
+ _Form of expected instruction(s):_ `vst3.32 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * void vst3_lane_p16 (poly16_t *, poly16x4x3_t, const int)
+ _Form of expected instruction(s):_ `vst3.16 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * void vst3_lane_p8 (poly8_t *, poly8x8x3_t, const int)
+ _Form of expected instruction(s):_ `vst3.8 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * void vst3q_lane_s32 (int32_t *, int32x4x3_t, const int)
+ _Form of expected instruction(s):_ `vst3.32 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * void vst3q_lane_s16 (int16_t *, int16x8x3_t, const int)
+ _Form of expected instruction(s):_ `vst3.16 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * void vst3q_lane_u32 (uint32_t *, uint32x4x3_t, const int)
+ _Form of expected instruction(s):_ `vst3.32 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * void vst3q_lane_u16 (uint16_t *, uint16x8x3_t, const int)
+ _Form of expected instruction(s):_ `vst3.16 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * void vst3q_lane_f32 (float32_t *, float32x4x3_t, const int)
+ _Form of expected instruction(s):_ `vst3.32 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+ * void vst3q_lane_p16 (poly16_t *, poly16x8x3_t, const int)
+ _Form of expected instruction(s):_ `vst3.16 {D0[0], D1[0], D2[0]},
+ [R0]'
+
+5.50.3.74 Element/structure loads, VLD4 variants
+................................................
+
+ * uint32x2x4_t vld4_u32 (const uint32_t *)
+ _Form of expected instruction(s):_ `vld4.32 {D0, D1, D2, D3}, [R0]'
+
+ * uint16x4x4_t vld4_u16 (const uint16_t *)
+ _Form of expected instruction(s):_ `vld4.16 {D0, D1, D2, D3}, [R0]'
+
+ * uint8x8x4_t vld4_u8 (const uint8_t *)
+ _Form of expected instruction(s):_ `vld4.8 {D0, D1, D2, D3}, [R0]'
+
+ * int32x2x4_t vld4_s32 (const int32_t *)
+ _Form of expected instruction(s):_ `vld4.32 {D0, D1, D2, D3}, [R0]'
+
+ * int16x4x4_t vld4_s16 (const int16_t *)
+ _Form of expected instruction(s):_ `vld4.16 {D0, D1, D2, D3}, [R0]'
+
+ * int8x8x4_t vld4_s8 (const int8_t *)
+ _Form of expected instruction(s):_ `vld4.8 {D0, D1, D2, D3}, [R0]'
+
+ * float32x2x4_t vld4_f32 (const float32_t *)
+ _Form of expected instruction(s):_ `vld4.32 {D0, D1, D2, D3}, [R0]'
+
+ * poly16x4x4_t vld4_p16 (const poly16_t *)
+ _Form of expected instruction(s):_ `vld4.16 {D0, D1, D2, D3}, [R0]'
+
+ * poly8x8x4_t vld4_p8 (const poly8_t *)
+ _Form of expected instruction(s):_ `vld4.8 {D0, D1, D2, D3}, [R0]'
+
+ * uint64x1x4_t vld4_u64 (const uint64_t *)
+ _Form of expected instruction(s):_ `vld1.64 {D0, D1, D2, D3}, [R0]'
+
+ * int64x1x4_t vld4_s64 (const int64_t *)
+ _Form of expected instruction(s):_ `vld1.64 {D0, D1, D2, D3}, [R0]'
+
+ * uint32x4x4_t vld4q_u32 (const uint32_t *)
+ _Form of expected instruction(s):_ `vld4.32 {D0, D1, D2, D3}, [R0]'
+
+ * uint16x8x4_t vld4q_u16 (const uint16_t *)
+ _Form of expected instruction(s):_ `vld4.16 {D0, D1, D2, D3}, [R0]'
+
+ * uint8x16x4_t vld4q_u8 (const uint8_t *)
+ _Form of expected instruction(s):_ `vld4.8 {D0, D1, D2, D3}, [R0]'
+
+ * int32x4x4_t vld4q_s32 (const int32_t *)
+ _Form of expected instruction(s):_ `vld4.32 {D0, D1, D2, D3}, [R0]'
+
+ * int16x8x4_t vld4q_s16 (const int16_t *)
+ _Form of expected instruction(s):_ `vld4.16 {D0, D1, D2, D3}, [R0]'
+
+ * int8x16x4_t vld4q_s8 (const int8_t *)
+ _Form of expected instruction(s):_ `vld4.8 {D0, D1, D2, D3}, [R0]'
+
+ * float32x4x4_t vld4q_f32 (const float32_t *)
+ _Form of expected instruction(s):_ `vld4.32 {D0, D1, D2, D3}, [R0]'
+
+ * poly16x8x4_t vld4q_p16 (const poly16_t *)
+ _Form of expected instruction(s):_ `vld4.16 {D0, D1, D2, D3}, [R0]'
+
+ * poly8x16x4_t vld4q_p8 (const poly8_t *)
+ _Form of expected instruction(s):_ `vld4.8 {D0, D1, D2, D3}, [R0]'
+
+ * uint32x2x4_t vld4_lane_u32 (const uint32_t *, uint32x2x4_t, const
+ int)
+ _Form of expected instruction(s):_ `vld4.32 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * uint16x4x4_t vld4_lane_u16 (const uint16_t *, uint16x4x4_t, const
+ int)
+ _Form of expected instruction(s):_ `vld4.16 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * uint8x8x4_t vld4_lane_u8 (const uint8_t *, uint8x8x4_t, const int)
+ _Form of expected instruction(s):_ `vld4.8 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * int32x2x4_t vld4_lane_s32 (const int32_t *, int32x2x4_t, const int)
+ _Form of expected instruction(s):_ `vld4.32 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * int16x4x4_t vld4_lane_s16 (const int16_t *, int16x4x4_t, const int)
+ _Form of expected instruction(s):_ `vld4.16 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * int8x8x4_t vld4_lane_s8 (const int8_t *, int8x8x4_t, const int)
+ _Form of expected instruction(s):_ `vld4.8 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * float32x2x4_t vld4_lane_f32 (const float32_t *, float32x2x4_t,
+ const int)
+ _Form of expected instruction(s):_ `vld4.32 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * poly16x4x4_t vld4_lane_p16 (const poly16_t *, poly16x4x4_t, const
+ int)
+ _Form of expected instruction(s):_ `vld4.16 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * poly8x8x4_t vld4_lane_p8 (const poly8_t *, poly8x8x4_t, const int)
+ _Form of expected instruction(s):_ `vld4.8 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * int32x4x4_t vld4q_lane_s32 (const int32_t *, int32x4x4_t, const
+ int)
+ _Form of expected instruction(s):_ `vld4.32 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * int16x8x4_t vld4q_lane_s16 (const int16_t *, int16x8x4_t, const
+ int)
+ _Form of expected instruction(s):_ `vld4.16 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * uint32x4x4_t vld4q_lane_u32 (const uint32_t *, uint32x4x4_t, const
+ int)
+ _Form of expected instruction(s):_ `vld4.32 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * uint16x8x4_t vld4q_lane_u16 (const uint16_t *, uint16x8x4_t, const
+ int)
+ _Form of expected instruction(s):_ `vld4.16 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * float32x4x4_t vld4q_lane_f32 (const float32_t *, float32x4x4_t,
+ const int)
+ _Form of expected instruction(s):_ `vld4.32 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * poly16x8x4_t vld4q_lane_p16 (const poly16_t *, poly16x8x4_t, const
+ int)
+ _Form of expected instruction(s):_ `vld4.16 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * uint32x2x4_t vld4_dup_u32 (const uint32_t *)
+ _Form of expected instruction(s):_ `vld4.32 {D0[], D1[], D2[],
+ D3[]}, [R0]'
+
+ * uint16x4x4_t vld4_dup_u16 (const uint16_t *)
+ _Form of expected instruction(s):_ `vld4.16 {D0[], D1[], D2[],
+ D3[]}, [R0]'
+
+ * uint8x8x4_t vld4_dup_u8 (const uint8_t *)
+ _Form of expected instruction(s):_ `vld4.8 {D0[], D1[], D2[],
+ D3[]}, [R0]'
+
+ * int32x2x4_t vld4_dup_s32 (const int32_t *)
+ _Form of expected instruction(s):_ `vld4.32 {D0[], D1[], D2[],
+ D3[]}, [R0]'
+
+ * int16x4x4_t vld4_dup_s16 (const int16_t *)
+ _Form of expected instruction(s):_ `vld4.16 {D0[], D1[], D2[],
+ D3[]}, [R0]'
+
+ * int8x8x4_t vld4_dup_s8 (const int8_t *)
+ _Form of expected instruction(s):_ `vld4.8 {D0[], D1[], D2[],
+ D3[]}, [R0]'
+
+ * float32x2x4_t vld4_dup_f32 (const float32_t *)
+ _Form of expected instruction(s):_ `vld4.32 {D0[], D1[], D2[],
+ D3[]}, [R0]'
+
+ * poly16x4x4_t vld4_dup_p16 (const poly16_t *)
+ _Form of expected instruction(s):_ `vld4.16 {D0[], D1[], D2[],
+ D3[]}, [R0]'
+
+ * poly8x8x4_t vld4_dup_p8 (const poly8_t *)
+ _Form of expected instruction(s):_ `vld4.8 {D0[], D1[], D2[],
+ D3[]}, [R0]'
+
+ * uint64x1x4_t vld4_dup_u64 (const uint64_t *)
+ _Form of expected instruction(s):_ `vld1.64 {D0, D1, D2, D3}, [R0]'
+
+ * int64x1x4_t vld4_dup_s64 (const int64_t *)
+ _Form of expected instruction(s):_ `vld1.64 {D0, D1, D2, D3}, [R0]'
+
+5.50.3.75 Element/structure stores, VST4 variants
+.................................................
+
+ * void vst4_u32 (uint32_t *, uint32x2x4_t)
+ _Form of expected instruction(s):_ `vst4.32 {D0, D1, D2, D3}, [R0]'
+
+ * void vst4_u16 (uint16_t *, uint16x4x4_t)
+ _Form of expected instruction(s):_ `vst4.16 {D0, D1, D2, D3}, [R0]'
+
+ * void vst4_u8 (uint8_t *, uint8x8x4_t)
+ _Form of expected instruction(s):_ `vst4.8 {D0, D1, D2, D3}, [R0]'
+
+ * void vst4_s32 (int32_t *, int32x2x4_t)
+ _Form of expected instruction(s):_ `vst4.32 {D0, D1, D2, D3}, [R0]'
+
+ * void vst4_s16 (int16_t *, int16x4x4_t)
+ _Form of expected instruction(s):_ `vst4.16 {D0, D1, D2, D3}, [R0]'
+
+ * void vst4_s8 (int8_t *, int8x8x4_t)
+ _Form of expected instruction(s):_ `vst4.8 {D0, D1, D2, D3}, [R0]'
+
+ * void vst4_f32 (float32_t *, float32x2x4_t)
+ _Form of expected instruction(s):_ `vst4.32 {D0, D1, D2, D3}, [R0]'
+
+ * void vst4_p16 (poly16_t *, poly16x4x4_t)
+ _Form of expected instruction(s):_ `vst4.16 {D0, D1, D2, D3}, [R0]'
+
+ * void vst4_p8 (poly8_t *, poly8x8x4_t)
+ _Form of expected instruction(s):_ `vst4.8 {D0, D1, D2, D3}, [R0]'
+
+ * void vst4_u64 (uint64_t *, uint64x1x4_t)
+ _Form of expected instruction(s):_ `vst1.64 {D0, D1, D2, D3}, [R0]'
+
+ * void vst4_s64 (int64_t *, int64x1x4_t)
+ _Form of expected instruction(s):_ `vst1.64 {D0, D1, D2, D3}, [R0]'
+
+ * void vst4q_u32 (uint32_t *, uint32x4x4_t)
+ _Form of expected instruction(s):_ `vst4.32 {D0, D1, D2, D3}, [R0]'
+
+ * void vst4q_u16 (uint16_t *, uint16x8x4_t)
+ _Form of expected instruction(s):_ `vst4.16 {D0, D1, D2, D3}, [R0]'
+
+ * void vst4q_u8 (uint8_t *, uint8x16x4_t)
+ _Form of expected instruction(s):_ `vst4.8 {D0, D1, D2, D3}, [R0]'
+
+ * void vst4q_s32 (int32_t *, int32x4x4_t)
+ _Form of expected instruction(s):_ `vst4.32 {D0, D1, D2, D3}, [R0]'
+
+ * void vst4q_s16 (int16_t *, int16x8x4_t)
+ _Form of expected instruction(s):_ `vst4.16 {D0, D1, D2, D3}, [R0]'
+
+ * void vst4q_s8 (int8_t *, int8x16x4_t)
+ _Form of expected instruction(s):_ `vst4.8 {D0, D1, D2, D3}, [R0]'
+
+ * void vst4q_f32 (float32_t *, float32x4x4_t)
+ _Form of expected instruction(s):_ `vst4.32 {D0, D1, D2, D3}, [R0]'
+
+ * void vst4q_p16 (poly16_t *, poly16x8x4_t)
+ _Form of expected instruction(s):_ `vst4.16 {D0, D1, D2, D3}, [R0]'
+
+ * void vst4q_p8 (poly8_t *, poly8x16x4_t)
+ _Form of expected instruction(s):_ `vst4.8 {D0, D1, D2, D3}, [R0]'
+
+ * void vst4_lane_u32 (uint32_t *, uint32x2x4_t, const int)
+ _Form of expected instruction(s):_ `vst4.32 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * void vst4_lane_u16 (uint16_t *, uint16x4x4_t, const int)
+ _Form of expected instruction(s):_ `vst4.16 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * void vst4_lane_u8 (uint8_t *, uint8x8x4_t, const int)
+ _Form of expected instruction(s):_ `vst4.8 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * void vst4_lane_s32 (int32_t *, int32x2x4_t, const int)
+ _Form of expected instruction(s):_ `vst4.32 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * void vst4_lane_s16 (int16_t *, int16x4x4_t, const int)
+ _Form of expected instruction(s):_ `vst4.16 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * void vst4_lane_s8 (int8_t *, int8x8x4_t, const int)
+ _Form of expected instruction(s):_ `vst4.8 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * void vst4_lane_f32 (float32_t *, float32x2x4_t, const int)
+ _Form of expected instruction(s):_ `vst4.32 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * void vst4_lane_p16 (poly16_t *, poly16x4x4_t, const int)
+ _Form of expected instruction(s):_ `vst4.16 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * void vst4_lane_p8 (poly8_t *, poly8x8x4_t, const int)
+ _Form of expected instruction(s):_ `vst4.8 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * void vst4q_lane_s32 (int32_t *, int32x4x4_t, const int)
+ _Form of expected instruction(s):_ `vst4.32 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * void vst4q_lane_s16 (int16_t *, int16x8x4_t, const int)
+ _Form of expected instruction(s):_ `vst4.16 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * void vst4q_lane_u32 (uint32_t *, uint32x4x4_t, const int)
+ _Form of expected instruction(s):_ `vst4.32 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * void vst4q_lane_u16 (uint16_t *, uint16x8x4_t, const int)
+ _Form of expected instruction(s):_ `vst4.16 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * void vst4q_lane_f32 (float32_t *, float32x4x4_t, const int)
+ _Form of expected instruction(s):_ `vst4.32 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+ * void vst4q_lane_p16 (poly16_t *, poly16x8x4_t, const int)
+ _Form of expected instruction(s):_ `vst4.16 {D0[0], D1[0], D2[0],
+ D3[0]}, [R0]'
+
+5.50.3.76 Logical operations (AND)
+..................................
+
+ * uint32x2_t vand_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vand D0, D0, D0'
+
+ * uint16x4_t vand_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vand D0, D0, D0'
+
+ * uint8x8_t vand_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vand D0, D0, D0'
+
+ * int32x2_t vand_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vand D0, D0, D0'
+
+ * int16x4_t vand_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vand D0, D0, D0'
+
+ * int8x8_t vand_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vand D0, D0, D0'
+
+ * uint64x1_t vand_u64 (uint64x1_t, uint64x1_t)
+ _Form of expected instruction(s):_ `vand D0, D0, D0'
+
+ * int64x1_t vand_s64 (int64x1_t, int64x1_t)
+ _Form of expected instruction(s):_ `vand D0, D0, D0'
+
+ * uint32x4_t vandq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vand Q0, Q0, Q0'
+
+ * uint16x8_t vandq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vand Q0, Q0, Q0'
+
+ * uint8x16_t vandq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vand Q0, Q0, Q0'
+
+ * int32x4_t vandq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vand Q0, Q0, Q0'
+
+ * int16x8_t vandq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vand Q0, Q0, Q0'
+
+ * int8x16_t vandq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vand Q0, Q0, Q0'
+
+ * uint64x2_t vandq_u64 (uint64x2_t, uint64x2_t)
+ _Form of expected instruction(s):_ `vand Q0, Q0, Q0'
+
+ * int64x2_t vandq_s64 (int64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `vand Q0, Q0, Q0'
+
+5.50.3.77 Logical operations (OR)
+.................................
+
+ * uint32x2_t vorr_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vorr D0, D0, D0'
+
+ * uint16x4_t vorr_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vorr D0, D0, D0'
+
+ * uint8x8_t vorr_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vorr D0, D0, D0'
+
+ * int32x2_t vorr_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vorr D0, D0, D0'
+
+ * int16x4_t vorr_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vorr D0, D0, D0'
+
+ * int8x8_t vorr_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vorr D0, D0, D0'
+
+ * uint64x1_t vorr_u64 (uint64x1_t, uint64x1_t)
+ _Form of expected instruction(s):_ `vorr D0, D0, D0'
+
+ * int64x1_t vorr_s64 (int64x1_t, int64x1_t)
+ _Form of expected instruction(s):_ `vorr D0, D0, D0'
+
+ * uint32x4_t vorrq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vorr Q0, Q0, Q0'
+
+ * uint16x8_t vorrq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vorr Q0, Q0, Q0'
+
+ * uint8x16_t vorrq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vorr Q0, Q0, Q0'
+
+ * int32x4_t vorrq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vorr Q0, Q0, Q0'
+
+ * int16x8_t vorrq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vorr Q0, Q0, Q0'
+
+ * int8x16_t vorrq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vorr Q0, Q0, Q0'
+
+ * uint64x2_t vorrq_u64 (uint64x2_t, uint64x2_t)
+ _Form of expected instruction(s):_ `vorr Q0, Q0, Q0'
+
+ * int64x2_t vorrq_s64 (int64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `vorr Q0, Q0, Q0'
+
+5.50.3.78 Logical operations (exclusive OR)
+...........................................
+
+ * uint32x2_t veor_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `veor D0, D0, D0'
+
+ * uint16x4_t veor_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `veor D0, D0, D0'
+
+ * uint8x8_t veor_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `veor D0, D0, D0'
+
+ * int32x2_t veor_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `veor D0, D0, D0'
+
+ * int16x4_t veor_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `veor D0, D0, D0'
+
+ * int8x8_t veor_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `veor D0, D0, D0'
+
+ * uint64x1_t veor_u64 (uint64x1_t, uint64x1_t)
+ _Form of expected instruction(s):_ `veor D0, D0, D0'
+
+ * int64x1_t veor_s64 (int64x1_t, int64x1_t)
+ _Form of expected instruction(s):_ `veor D0, D0, D0'
+
+ * uint32x4_t veorq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `veor Q0, Q0, Q0'
+
+ * uint16x8_t veorq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `veor Q0, Q0, Q0'
+
+ * uint8x16_t veorq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `veor Q0, Q0, Q0'
+
+ * int32x4_t veorq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `veor Q0, Q0, Q0'
+
+ * int16x8_t veorq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `veor Q0, Q0, Q0'
+
+ * int8x16_t veorq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `veor Q0, Q0, Q0'
+
+ * uint64x2_t veorq_u64 (uint64x2_t, uint64x2_t)
+ _Form of expected instruction(s):_ `veor Q0, Q0, Q0'
+
+ * int64x2_t veorq_s64 (int64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `veor Q0, Q0, Q0'
+
+5.50.3.79 Logical operations (AND-NOT)
+......................................
+
+ * uint32x2_t vbic_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vbic D0, D0, D0'
+
+ * uint16x4_t vbic_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vbic D0, D0, D0'
+
+ * uint8x8_t vbic_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vbic D0, D0, D0'
+
+ * int32x2_t vbic_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vbic D0, D0, D0'
+
+ * int16x4_t vbic_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vbic D0, D0, D0'
+
+ * int8x8_t vbic_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vbic D0, D0, D0'
+
+ * uint64x1_t vbic_u64 (uint64x1_t, uint64x1_t)
+ _Form of expected instruction(s):_ `vbic D0, D0, D0'
+
+ * int64x1_t vbic_s64 (int64x1_t, int64x1_t)
+ _Form of expected instruction(s):_ `vbic D0, D0, D0'
+
+ * uint32x4_t vbicq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vbic Q0, Q0, Q0'
+
+ * uint16x8_t vbicq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vbic Q0, Q0, Q0'
+
+ * uint8x16_t vbicq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vbic Q0, Q0, Q0'
+
+ * int32x4_t vbicq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vbic Q0, Q0, Q0'
+
+ * int16x8_t vbicq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vbic Q0, Q0, Q0'
+
+ * int8x16_t vbicq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vbic Q0, Q0, Q0'
+
+ * uint64x2_t vbicq_u64 (uint64x2_t, uint64x2_t)
+ _Form of expected instruction(s):_ `vbic Q0, Q0, Q0'
+
+ * int64x2_t vbicq_s64 (int64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `vbic Q0, Q0, Q0'
+
+5.50.3.80 Logical operations (OR-NOT)
+.....................................
+
+ * uint32x2_t vorn_u32 (uint32x2_t, uint32x2_t)
+ _Form of expected instruction(s):_ `vorn D0, D0, D0'
+
+ * uint16x4_t vorn_u16 (uint16x4_t, uint16x4_t)
+ _Form of expected instruction(s):_ `vorn D0, D0, D0'
+
+ * uint8x8_t vorn_u8 (uint8x8_t, uint8x8_t)
+ _Form of expected instruction(s):_ `vorn D0, D0, D0'
+
+ * int32x2_t vorn_s32 (int32x2_t, int32x2_t)
+ _Form of expected instruction(s):_ `vorn D0, D0, D0'
+
+ * int16x4_t vorn_s16 (int16x4_t, int16x4_t)
+ _Form of expected instruction(s):_ `vorn D0, D0, D0'
+
+ * int8x8_t vorn_s8 (int8x8_t, int8x8_t)
+ _Form of expected instruction(s):_ `vorn D0, D0, D0'
+
+ * uint64x1_t vorn_u64 (uint64x1_t, uint64x1_t)
+ _Form of expected instruction(s):_ `vorn D0, D0, D0'
+
+ * int64x1_t vorn_s64 (int64x1_t, int64x1_t)
+ _Form of expected instruction(s):_ `vorn D0, D0, D0'
+
+ * uint32x4_t vornq_u32 (uint32x4_t, uint32x4_t)
+ _Form of expected instruction(s):_ `vorn Q0, Q0, Q0'
+
+ * uint16x8_t vornq_u16 (uint16x8_t, uint16x8_t)
+ _Form of expected instruction(s):_ `vorn Q0, Q0, Q0'
+
+ * uint8x16_t vornq_u8 (uint8x16_t, uint8x16_t)
+ _Form of expected instruction(s):_ `vorn Q0, Q0, Q0'
+
+ * int32x4_t vornq_s32 (int32x4_t, int32x4_t)
+ _Form of expected instruction(s):_ `vorn Q0, Q0, Q0'
+
+ * int16x8_t vornq_s16 (int16x8_t, int16x8_t)
+ _Form of expected instruction(s):_ `vorn Q0, Q0, Q0'
+
+ * int8x16_t vornq_s8 (int8x16_t, int8x16_t)
+ _Form of expected instruction(s):_ `vorn Q0, Q0, Q0'
+
+ * uint64x2_t vornq_u64 (uint64x2_t, uint64x2_t)
+ _Form of expected instruction(s):_ `vorn Q0, Q0, Q0'
+
+ * int64x2_t vornq_s64 (int64x2_t, int64x2_t)
+ _Form of expected instruction(s):_ `vorn Q0, Q0, Q0'
+
+5.50.3.81 Reinterpret casts
+...........................
+
+ * poly8x8_t vreinterpret_p8_u32 (uint32x2_t)
+
+ * poly8x8_t vreinterpret_p8_u16 (uint16x4_t)
+
+ * poly8x8_t vreinterpret_p8_u8 (uint8x8_t)
+
+ * poly8x8_t vreinterpret_p8_s32 (int32x2_t)
+
+ * poly8x8_t vreinterpret_p8_s16 (int16x4_t)
+
+ * poly8x8_t vreinterpret_p8_s8 (int8x8_t)
+
+ * poly8x8_t vreinterpret_p8_u64 (uint64x1_t)
+
+ * poly8x8_t vreinterpret_p8_s64 (int64x1_t)
+
+ * poly8x8_t vreinterpret_p8_f32 (float32x2_t)
+
+ * poly8x8_t vreinterpret_p8_p16 (poly16x4_t)
+
+ * poly8x16_t vreinterpretq_p8_u32 (uint32x4_t)
+
+ * poly8x16_t vreinterpretq_p8_u16 (uint16x8_t)
+
+ * poly8x16_t vreinterpretq_p8_u8 (uint8x16_t)
+
+ * poly8x16_t vreinterpretq_p8_s32 (int32x4_t)
+
+ * poly8x16_t vreinterpretq_p8_s16 (int16x8_t)
+
+ * poly8x16_t vreinterpretq_p8_s8 (int8x16_t)
+
+ * poly8x16_t vreinterpretq_p8_u64 (uint64x2_t)
+
+ * poly8x16_t vreinterpretq_p8_s64 (int64x2_t)
+
+ * poly8x16_t vreinterpretq_p8_f32 (float32x4_t)
+
+ * poly8x16_t vreinterpretq_p8_p16 (poly16x8_t)
+
+ * poly16x4_t vreinterpret_p16_u32 (uint32x2_t)
+
+ * poly16x4_t vreinterpret_p16_u16 (uint16x4_t)
+
+ * poly16x4_t vreinterpret_p16_u8 (uint8x8_t)
+
+ * poly16x4_t vreinterpret_p16_s32 (int32x2_t)
+
+ * poly16x4_t vreinterpret_p16_s16 (int16x4_t)
+
+ * poly16x4_t vreinterpret_p16_s8 (int8x8_t)
+
+ * poly16x4_t vreinterpret_p16_u64 (uint64x1_t)
+
+ * poly16x4_t vreinterpret_p16_s64 (int64x1_t)
+
+ * poly16x4_t vreinterpret_p16_f32 (float32x2_t)
+
+ * poly16x4_t vreinterpret_p16_p8 (poly8x8_t)
+
+ * poly16x8_t vreinterpretq_p16_u32 (uint32x4_t)
+
+ * poly16x8_t vreinterpretq_p16_u16 (uint16x8_t)
+
+ * poly16x8_t vreinterpretq_p16_u8 (uint8x16_t)
+
+ * poly16x8_t vreinterpretq_p16_s32 (int32x4_t)
+
+ * poly16x8_t vreinterpretq_p16_s16 (int16x8_t)
+
+ * poly16x8_t vreinterpretq_p16_s8 (int8x16_t)
+
+ * poly16x8_t vreinterpretq_p16_u64 (uint64x2_t)
+
+ * poly16x8_t vreinterpretq_p16_s64 (int64x2_t)
+
+ * poly16x8_t vreinterpretq_p16_f32 (float32x4_t)
+
+ * poly16x8_t vreinterpretq_p16_p8 (poly8x16_t)
+
+ * float32x2_t vreinterpret_f32_u32 (uint32x2_t)
+
+ * float32x2_t vreinterpret_f32_u16 (uint16x4_t)
+
+ * float32x2_t vreinterpret_f32_u8 (uint8x8_t)
+
+ * float32x2_t vreinterpret_f32_s32 (int32x2_t)
+
+ * float32x2_t vreinterpret_f32_s16 (int16x4_t)
+
+ * float32x2_t vreinterpret_f32_s8 (int8x8_t)
+
+ * float32x2_t vreinterpret_f32_u64 (uint64x1_t)
+
+ * float32x2_t vreinterpret_f32_s64 (int64x1_t)
+
+ * float32x2_t vreinterpret_f32_p16 (poly16x4_t)
+
+ * float32x2_t vreinterpret_f32_p8 (poly8x8_t)
+
+ * float32x4_t vreinterpretq_f32_u32 (uint32x4_t)
+
+ * float32x4_t vreinterpretq_f32_u16 (uint16x8_t)
+
+ * float32x4_t vreinterpretq_f32_u8 (uint8x16_t)
+
+ * float32x4_t vreinterpretq_f32_s32 (int32x4_t)
+
+ * float32x4_t vreinterpretq_f32_s16 (int16x8_t)
+
+ * float32x4_t vreinterpretq_f32_s8 (int8x16_t)
+
+ * float32x4_t vreinterpretq_f32_u64 (uint64x2_t)
+
+ * float32x4_t vreinterpretq_f32_s64 (int64x2_t)
+
+ * float32x4_t vreinterpretq_f32_p16 (poly16x8_t)
+
+ * float32x4_t vreinterpretq_f32_p8 (poly8x16_t)
+
+ * int64x1_t vreinterpret_s64_u32 (uint32x2_t)
+
+ * int64x1_t vreinterpret_s64_u16 (uint16x4_t)
+
+ * int64x1_t vreinterpret_s64_u8 (uint8x8_t)
+
+ * int64x1_t vreinterpret_s64_s32 (int32x2_t)
+
+ * int64x1_t vreinterpret_s64_s16 (int16x4_t)
+
+ * int64x1_t vreinterpret_s64_s8 (int8x8_t)
+
+ * int64x1_t vreinterpret_s64_u64 (uint64x1_t)
+
+ * int64x1_t vreinterpret_s64_f32 (float32x2_t)
+
+ * int64x1_t vreinterpret_s64_p16 (poly16x4_t)
+
+ * int64x1_t vreinterpret_s64_p8 (poly8x8_t)
+
+ * int64x2_t vreinterpretq_s64_u32 (uint32x4_t)
+
+ * int64x2_t vreinterpretq_s64_u16 (uint16x8_t)
+
+ * int64x2_t vreinterpretq_s64_u8 (uint8x16_t)
+
+ * int64x2_t vreinterpretq_s64_s32 (int32x4_t)
+
+ * int64x2_t vreinterpretq_s64_s16 (int16x8_t)
+
+ * int64x2_t vreinterpretq_s64_s8 (int8x16_t)
+
+ * int64x2_t vreinterpretq_s64_u64 (uint64x2_t)
+
+ * int64x2_t vreinterpretq_s64_f32 (float32x4_t)
+
+ * int64x2_t vreinterpretq_s64_p16 (poly16x8_t)
+
+ * int64x2_t vreinterpretq_s64_p8 (poly8x16_t)
+
+ * uint64x1_t vreinterpret_u64_u32 (uint32x2_t)
+
+ * uint64x1_t vreinterpret_u64_u16 (uint16x4_t)
+
+ * uint64x1_t vreinterpret_u64_u8 (uint8x8_t)
+
+ * uint64x1_t vreinterpret_u64_s32 (int32x2_t)
+
+ * uint64x1_t vreinterpret_u64_s16 (int16x4_t)
+
+ * uint64x1_t vreinterpret_u64_s8 (int8x8_t)
+
+ * uint64x1_t vreinterpret_u64_s64 (int64x1_t)
+
+ * uint64x1_t vreinterpret_u64_f32 (float32x2_t)
+
+ * uint64x1_t vreinterpret_u64_p16 (poly16x4_t)
+
+ * uint64x1_t vreinterpret_u64_p8 (poly8x8_t)
+
+ * uint64x2_t vreinterpretq_u64_u32 (uint32x4_t)
+
+ * uint64x2_t vreinterpretq_u64_u16 (uint16x8_t)
+
+ * uint64x2_t vreinterpretq_u64_u8 (uint8x16_t)
+
+ * uint64x2_t vreinterpretq_u64_s32 (int32x4_t)
+
+ * uint64x2_t vreinterpretq_u64_s16 (int16x8_t)
+
+ * uint64x2_t vreinterpretq_u64_s8 (int8x16_t)
+
+ * uint64x2_t vreinterpretq_u64_s64 (int64x2_t)
+
+ * uint64x2_t vreinterpretq_u64_f32 (float32x4_t)
+
+ * uint64x2_t vreinterpretq_u64_p16 (poly16x8_t)
+
+ * uint64x2_t vreinterpretq_u64_p8 (poly8x16_t)
+
+ * int8x8_t vreinterpret_s8_u32 (uint32x2_t)
+
+ * int8x8_t vreinterpret_s8_u16 (uint16x4_t)
+
+ * int8x8_t vreinterpret_s8_u8 (uint8x8_t)
+
+ * int8x8_t vreinterpret_s8_s32 (int32x2_t)
+
+ * int8x8_t vreinterpret_s8_s16 (int16x4_t)
+
+ * int8x8_t vreinterpret_s8_u64 (uint64x1_t)
+
+ * int8x8_t vreinterpret_s8_s64 (int64x1_t)
+
+ * int8x8_t vreinterpret_s8_f32 (float32x2_t)
+
+ * int8x8_t vreinterpret_s8_p16 (poly16x4_t)
+
+ * int8x8_t vreinterpret_s8_p8 (poly8x8_t)
+
+ * int8x16_t vreinterpretq_s8_u32 (uint32x4_t)
+
+ * int8x16_t vreinterpretq_s8_u16 (uint16x8_t)
+
+ * int8x16_t vreinterpretq_s8_u8 (uint8x16_t)
+
+ * int8x16_t vreinterpretq_s8_s32 (int32x4_t)
+
+ * int8x16_t vreinterpretq_s8_s16 (int16x8_t)
+
+ * int8x16_t vreinterpretq_s8_u64 (uint64x2_t)
+
+ * int8x16_t vreinterpretq_s8_s64 (int64x2_t)
+
+ * int8x16_t vreinterpretq_s8_f32 (float32x4_t)
+
+ * int8x16_t vreinterpretq_s8_p16 (poly16x8_t)
+
+ * int8x16_t vreinterpretq_s8_p8 (poly8x16_t)
+
+ * int16x4_t vreinterpret_s16_u32 (uint32x2_t)
+
+ * int16x4_t vreinterpret_s16_u16 (uint16x4_t)
+
+ * int16x4_t vreinterpret_s16_u8 (uint8x8_t)
+
+ * int16x4_t vreinterpret_s16_s32 (int32x2_t)
+
+ * int16x4_t vreinterpret_s16_s8 (int8x8_t)
+
+ * int16x4_t vreinterpret_s16_u64 (uint64x1_t)
+
+ * int16x4_t vreinterpret_s16_s64 (int64x1_t)
+
+ * int16x4_t vreinterpret_s16_f32 (float32x2_t)
+
+ * int16x4_t vreinterpret_s16_p16 (poly16x4_t)
+
+ * int16x4_t vreinterpret_s16_p8 (poly8x8_t)
+
+ * int16x8_t vreinterpretq_s16_u32 (uint32x4_t)
+
+ * int16x8_t vreinterpretq_s16_u16 (uint16x8_t)
+
+ * int16x8_t vreinterpretq_s16_u8 (uint8x16_t)
+
+ * int16x8_t vreinterpretq_s16_s32 (int32x4_t)
+
+ * int16x8_t vreinterpretq_s16_s8 (int8x16_t)
+
+ * int16x8_t vreinterpretq_s16_u64 (uint64x2_t)
+
+ * int16x8_t vreinterpretq_s16_s64 (int64x2_t)
+
+ * int16x8_t vreinterpretq_s16_f32 (float32x4_t)
+
+ * int16x8_t vreinterpretq_s16_p16 (poly16x8_t)
+
+ * int16x8_t vreinterpretq_s16_p8 (poly8x16_t)
+
+ * int32x2_t vreinterpret_s32_u32 (uint32x2_t)
+
+ * int32x2_t vreinterpret_s32_u16 (uint16x4_t)
+
+ * int32x2_t vreinterpret_s32_u8 (uint8x8_t)
+
+ * int32x2_t vreinterpret_s32_s16 (int16x4_t)
+
+ * int32x2_t vreinterpret_s32_s8 (int8x8_t)
+
+ * int32x2_t vreinterpret_s32_u64 (uint64x1_t)
+
+ * int32x2_t vreinterpret_s32_s64 (int64x1_t)
+
+ * int32x2_t vreinterpret_s32_f32 (float32x2_t)
+
+ * int32x2_t vreinterpret_s32_p16 (poly16x4_t)
+
+ * int32x2_t vreinterpret_s32_p8 (poly8x8_t)
+
+ * int32x4_t vreinterpretq_s32_u32 (uint32x4_t)
+
+ * int32x4_t vreinterpretq_s32_u16 (uint16x8_t)
+
+ * int32x4_t vreinterpretq_s32_u8 (uint8x16_t)
+
+ * int32x4_t vreinterpretq_s32_s16 (int16x8_t)
+
+ * int32x4_t vreinterpretq_s32_s8 (int8x16_t)
+
+ * int32x4_t vreinterpretq_s32_u64 (uint64x2_t)
+
+ * int32x4_t vreinterpretq_s32_s64 (int64x2_t)
+
+ * int32x4_t vreinterpretq_s32_f32 (float32x4_t)
+
+ * int32x4_t vreinterpretq_s32_p16 (poly16x8_t)
+
+ * int32x4_t vreinterpretq_s32_p8 (poly8x16_t)
+
+ * uint8x8_t vreinterpret_u8_u32 (uint32x2_t)
+
+ * uint8x8_t vreinterpret_u8_u16 (uint16x4_t)
+
+ * uint8x8_t vreinterpret_u8_s32 (int32x2_t)
+
+ * uint8x8_t vreinterpret_u8_s16 (int16x4_t)
+
+ * uint8x8_t vreinterpret_u8_s8 (int8x8_t)
+
+ * uint8x8_t vreinterpret_u8_u64 (uint64x1_t)
+
+ * uint8x8_t vreinterpret_u8_s64 (int64x1_t)
+
+ * uint8x8_t vreinterpret_u8_f32 (float32x2_t)
+
+ * uint8x8_t vreinterpret_u8_p16 (poly16x4_t)
+
+ * uint8x8_t vreinterpret_u8_p8 (poly8x8_t)
+
+ * uint8x16_t vreinterpretq_u8_u32 (uint32x4_t)
+
+ * uint8x16_t vreinterpretq_u8_u16 (uint16x8_t)
+
+ * uint8x16_t vreinterpretq_u8_s32 (int32x4_t)
+
+ * uint8x16_t vreinterpretq_u8_s16 (int16x8_t)
+
+ * uint8x16_t vreinterpretq_u8_s8 (int8x16_t)
+
+ * uint8x16_t vreinterpretq_u8_u64 (uint64x2_t)
+
+ * uint8x16_t vreinterpretq_u8_s64 (int64x2_t)
+
+ * uint8x16_t vreinterpretq_u8_f32 (float32x4_t)
+
+ * uint8x16_t vreinterpretq_u8_p16 (poly16x8_t)
+
+ * uint8x16_t vreinterpretq_u8_p8 (poly8x16_t)
+
+ * uint16x4_t vreinterpret_u16_u32 (uint32x2_t)
+
+ * uint16x4_t vreinterpret_u16_u8 (uint8x8_t)
+
+ * uint16x4_t vreinterpret_u16_s32 (int32x2_t)
+
+ * uint16x4_t vreinterpret_u16_s16 (int16x4_t)
+
+ * uint16x4_t vreinterpret_u16_s8 (int8x8_t)
+
+ * uint16x4_t vreinterpret_u16_u64 (uint64x1_t)
+
+ * uint16x4_t vreinterpret_u16_s64 (int64x1_t)
+
+ * uint16x4_t vreinterpret_u16_f32 (float32x2_t)
+
+ * uint16x4_t vreinterpret_u16_p16 (poly16x4_t)
+
+ * uint16x4_t vreinterpret_u16_p8 (poly8x8_t)
+
+ * uint16x8_t vreinterpretq_u16_u32 (uint32x4_t)
+
+ * uint16x8_t vreinterpretq_u16_u8 (uint8x16_t)
+
+ * uint16x8_t vreinterpretq_u16_s32 (int32x4_t)
+
+ * uint16x8_t vreinterpretq_u16_s16 (int16x8_t)
+
+ * uint16x8_t vreinterpretq_u16_s8 (int8x16_t)
+
+ * uint16x8_t vreinterpretq_u16_u64 (uint64x2_t)
+
+ * uint16x8_t vreinterpretq_u16_s64 (int64x2_t)
+
+ * uint16x8_t vreinterpretq_u16_f32 (float32x4_t)
+
+ * uint16x8_t vreinterpretq_u16_p16 (poly16x8_t)
+
+ * uint16x8_t vreinterpretq_u16_p8 (poly8x16_t)
+
+ * uint32x2_t vreinterpret_u32_u16 (uint16x4_t)
+
+ * uint32x2_t vreinterpret_u32_u8 (uint8x8_t)
+
+ * uint32x2_t vreinterpret_u32_s32 (int32x2_t)
+
+ * uint32x2_t vreinterpret_u32_s16 (int16x4_t)
+
+ * uint32x2_t vreinterpret_u32_s8 (int8x8_t)
+
+ * uint32x2_t vreinterpret_u32_u64 (uint64x1_t)
+
+ * uint32x2_t vreinterpret_u32_s64 (int64x1_t)
+
+ * uint32x2_t vreinterpret_u32_f32 (float32x2_t)
+
+ * uint32x2_t vreinterpret_u32_p16 (poly16x4_t)
+
+ * uint32x2_t vreinterpret_u32_p8 (poly8x8_t)
+
+ * uint32x4_t vreinterpretq_u32_u16 (uint16x8_t)
+
+ * uint32x4_t vreinterpretq_u32_u8 (uint8x16_t)
+
+ * uint32x4_t vreinterpretq_u32_s32 (int32x4_t)
+
+ * uint32x4_t vreinterpretq_u32_s16 (int16x8_t)
+
+ * uint32x4_t vreinterpretq_u32_s8 (int8x16_t)
+
+ * uint32x4_t vreinterpretq_u32_u64 (uint64x2_t)
+
+ * uint32x4_t vreinterpretq_u32_s64 (int64x2_t)
+
+ * uint32x4_t vreinterpretq_u32_f32 (float32x4_t)
+
+ * uint32x4_t vreinterpretq_u32_p16 (poly16x8_t)
+
+ * uint32x4_t vreinterpretq_u32_p8 (poly8x16_t)
+
+
+File: gcc.info, Node: Blackfin Built-in Functions, Next: FR-V Built-in Functions, Prev: ARM NEON Intrinsics, Up: Target Builtins
+
+5.50.4 Blackfin Built-in Functions
+----------------------------------
+
+Currently, there are two Blackfin-specific built-in functions. These
+are used for generating `CSYNC' and `SSYNC' machine insns without using
+inline assembly; by using these built-in functions the compiler can
+automatically add workarounds for hardware errata involving these
+instructions. These functions are named as follows:
+
+ void __builtin_bfin_csync (void)
+ void __builtin_bfin_ssync (void)
+
+
+File: gcc.info, Node: FR-V Built-in Functions, Next: X86 Built-in Functions, Prev: Blackfin Built-in Functions, Up: Target Builtins
+
+5.50.5 FR-V Built-in Functions
+------------------------------
+
+GCC provides many FR-V-specific built-in functions. In general, these
+functions are intended to be compatible with those described by `FR-V
+Family, Softune C/C++ Compiler Manual (V6), Fujitsu Semiconductor'.
+The two exceptions are `__MDUNPACKH' and `__MBTOHE', the gcc forms of
+which pass 128-bit values by pointer rather than by value.
+
+ Most of the functions are named after specific FR-V instructions.
+Such functions are said to be "directly mapped" and are summarized here
+in tabular form.
+
+* Menu:
+
+* Argument Types::
+* Directly-mapped Integer Functions::
+* Directly-mapped Media Functions::
+* Raw read/write Functions::
+* Other Built-in Functions::
+
+
+File: gcc.info, Node: Argument Types, Next: Directly-mapped Integer Functions, Up: FR-V Built-in Functions
+
+5.50.5.1 Argument Types
+.......................
+
+The arguments to the built-in functions can be divided into three
+groups: register numbers, compile-time constants and run-time values.
+In order to make this classification clear at a glance, the arguments
+and return values are given the following pseudo types:
+
+Pseudo type Real C type Constant? Description
+`uh' `unsigned short' No an unsigned halfword
+`uw1' `unsigned int' No an unsigned word
+`sw1' `int' No a signed word
+`uw2' `unsigned long long' No an unsigned doubleword
+`sw2' `long long' No a signed doubleword
+`const' `int' Yes an integer constant
+`acc' `int' Yes an ACC register number
+`iacc' `int' Yes an IACC register number
+
+ These pseudo types are not defined by GCC, they are simply a notational
+convenience used in this manual.
+
+ Arguments of type `uh', `uw1', `sw1', `uw2' and `sw2' are evaluated at
+run time. They correspond to register operands in the underlying FR-V
+instructions.
+
+ `const' arguments represent immediate operands in the underlying FR-V
+instructions. They must be compile-time constants.
+
+ `acc' arguments are evaluated at compile time and specify the number
+of an accumulator register. For example, an `acc' argument of 2 will
+select the ACC2 register.
+
+ `iacc' arguments are similar to `acc' arguments but specify the number
+of an IACC register. See *note Other Built-in Functions:: for more
+details.
+
+
+File: gcc.info, Node: Directly-mapped Integer Functions, Next: Directly-mapped Media Functions, Prev: Argument Types, Up: FR-V Built-in Functions
+
+5.50.5.2 Directly-mapped Integer Functions
+..........................................
+
+The functions listed below map directly to FR-V I-type instructions.
+
+Function prototype Example usage Assembly output
+`sw1 __ADDSS (sw1, sw1)' `C = __ADDSS (A, B)' `ADDSS A,B,C'
+`sw1 __SCAN (sw1, sw1)' `C = __SCAN (A, B)' `SCAN A,B,C'
+`sw1 __SCUTSS (sw1)' `B = __SCUTSS (A)' `SCUTSS A,B'
+`sw1 __SLASS (sw1, sw1)' `C = __SLASS (A, B)' `SLASS A,B,C'
+`void __SMASS (sw1, sw1)' `__SMASS (A, B)' `SMASS A,B'
+`void __SMSSS (sw1, sw1)' `__SMSSS (A, B)' `SMSSS A,B'
+`void __SMU (sw1, sw1)' `__SMU (A, B)' `SMU A,B'
+`sw2 __SMUL (sw1, sw1)' `C = __SMUL (A, B)' `SMUL A,B,C'
+`sw1 __SUBSS (sw1, sw1)' `C = __SUBSS (A, B)' `SUBSS A,B,C'
+`uw2 __UMUL (uw1, uw1)' `C = __UMUL (A, B)' `UMUL A,B,C'
+
+
+File: gcc.info, Node: Directly-mapped Media Functions, Next: Raw read/write Functions, Prev: Directly-mapped Integer Functions, Up: FR-V Built-in Functions
+
+5.50.5.3 Directly-mapped Media Functions
+........................................
+
+The functions listed below map directly to FR-V M-type instructions.
+
+Function prototype Example usage Assembly output
+`uw1 __MABSHS (sw1)' `B = __MABSHS (A)' `MABSHS A,B'
+`void __MADDACCS (acc, acc)' `__MADDACCS (B, A)' `MADDACCS A,B'
+`sw1 __MADDHSS (sw1, sw1)' `C = __MADDHSS (A, B)' `MADDHSS A,B,C'
+`uw1 __MADDHUS (uw1, uw1)' `C = __MADDHUS (A, B)' `MADDHUS A,B,C'
+`uw1 __MAND (uw1, uw1)' `C = __MAND (A, B)' `MAND A,B,C'
+`void __MASACCS (acc, acc)' `__MASACCS (B, A)' `MASACCS A,B'
+`uw1 __MAVEH (uw1, uw1)' `C = __MAVEH (A, B)' `MAVEH A,B,C'
+`uw2 __MBTOH (uw1)' `B = __MBTOH (A)' `MBTOH A,B'
+`void __MBTOHE (uw1 *, uw1)' `__MBTOHE (&B, A)' `MBTOHE A,B'
+`void __MCLRACC (acc)' `__MCLRACC (A)' `MCLRACC A'
+`void __MCLRACCA (void)' `__MCLRACCA ()' `MCLRACCA'
+`uw1 __Mcop1 (uw1, uw1)' `C = __Mcop1 (A, B)' `Mcop1 A,B,C'
+`uw1 __Mcop2 (uw1, uw1)' `C = __Mcop2 (A, B)' `Mcop2 A,B,C'
+`uw1 __MCPLHI (uw2, const)' `C = __MCPLHI (A, B)' `MCPLHI A,#B,C'
+`uw1 __MCPLI (uw2, const)' `C = __MCPLI (A, B)' `MCPLI A,#B,C'
+`void __MCPXIS (acc, sw1, sw1)' `__MCPXIS (C, A, B)' `MCPXIS A,B,C'
+`void __MCPXIU (acc, uw1, uw1)' `__MCPXIU (C, A, B)' `MCPXIU A,B,C'
+`void __MCPXRS (acc, sw1, sw1)' `__MCPXRS (C, A, B)' `MCPXRS A,B,C'
+`void __MCPXRU (acc, uw1, uw1)' `__MCPXRU (C, A, B)' `MCPXRU A,B,C'
+`uw1 __MCUT (acc, uw1)' `C = __MCUT (A, B)' `MCUT A,B,C'
+`uw1 __MCUTSS (acc, sw1)' `C = __MCUTSS (A, B)' `MCUTSS A,B,C'
+`void __MDADDACCS (acc, acc)' `__MDADDACCS (B, A)' `MDADDACCS A,B'
+`void __MDASACCS (acc, acc)' `__MDASACCS (B, A)' `MDASACCS A,B'
+`uw2 __MDCUTSSI (acc, const)' `C = __MDCUTSSI (A, B)' `MDCUTSSI A,#B,C'
+`uw2 __MDPACKH (uw2, uw2)' `C = __MDPACKH (A, B)' `MDPACKH A,B,C'
+`uw2 __MDROTLI (uw2, const)' `C = __MDROTLI (A, B)' `MDROTLI A,#B,C'
+`void __MDSUBACCS (acc, acc)' `__MDSUBACCS (B, A)' `MDSUBACCS A,B'
+`void __MDUNPACKH (uw1 *, uw2)' `__MDUNPACKH (&B, A)' `MDUNPACKH A,B'
+`uw2 __MEXPDHD (uw1, const)' `C = __MEXPDHD (A, B)' `MEXPDHD A,#B,C'
+`uw1 __MEXPDHW (uw1, const)' `C = __MEXPDHW (A, B)' `MEXPDHW A,#B,C'
+`uw1 __MHDSETH (uw1, const)' `C = __MHDSETH (A, B)' `MHDSETH A,#B,C'
+`sw1 __MHDSETS (const)' `B = __MHDSETS (A)' `MHDSETS #A,B'
+`uw1 __MHSETHIH (uw1, const)' `B = __MHSETHIH (B, A)' `MHSETHIH #A,B'
+`sw1 __MHSETHIS (sw1, const)' `B = __MHSETHIS (B, A)' `MHSETHIS #A,B'
+`uw1 __MHSETLOH (uw1, const)' `B = __MHSETLOH (B, A)' `MHSETLOH #A,B'
+`sw1 __MHSETLOS (sw1, const)' `B = __MHSETLOS (B, A)' `MHSETLOS #A,B'
+`uw1 __MHTOB (uw2)' `B = __MHTOB (A)' `MHTOB A,B'
+`void __MMACHS (acc, sw1, sw1)' `__MMACHS (C, A, B)' `MMACHS A,B,C'
+`void __MMACHU (acc, uw1, uw1)' `__MMACHU (C, A, B)' `MMACHU A,B,C'
+`void __MMRDHS (acc, sw1, sw1)' `__MMRDHS (C, A, B)' `MMRDHS A,B,C'
+`void __MMRDHU (acc, uw1, uw1)' `__MMRDHU (C, A, B)' `MMRDHU A,B,C'
+`void __MMULHS (acc, sw1, sw1)' `__MMULHS (C, A, B)' `MMULHS A,B,C'
+`void __MMULHU (acc, uw1, uw1)' `__MMULHU (C, A, B)' `MMULHU A,B,C'
+`void __MMULXHS (acc, sw1, sw1)' `__MMULXHS (C, A, B)' `MMULXHS A,B,C'
+`void __MMULXHU (acc, uw1, uw1)' `__MMULXHU (C, A, B)' `MMULXHU A,B,C'
+`uw1 __MNOT (uw1)' `B = __MNOT (A)' `MNOT A,B'
+`uw1 __MOR (uw1, uw1)' `C = __MOR (A, B)' `MOR A,B,C'
+`uw1 __MPACKH (uh, uh)' `C = __MPACKH (A, B)' `MPACKH A,B,C'
+`sw2 __MQADDHSS (sw2, sw2)' `C = __MQADDHSS (A, B)' `MQADDHSS A,B,C'
+`uw2 __MQADDHUS (uw2, uw2)' `C = __MQADDHUS (A, B)' `MQADDHUS A,B,C'
+`void __MQCPXIS (acc, sw2, sw2)' `__MQCPXIS (C, A, B)' `MQCPXIS A,B,C'
+`void __MQCPXIU (acc, uw2, uw2)' `__MQCPXIU (C, A, B)' `MQCPXIU A,B,C'
+`void __MQCPXRS (acc, sw2, sw2)' `__MQCPXRS (C, A, B)' `MQCPXRS A,B,C'
+`void __MQCPXRU (acc, uw2, uw2)' `__MQCPXRU (C, A, B)' `MQCPXRU A,B,C'
+`sw2 __MQLCLRHS (sw2, sw2)' `C = __MQLCLRHS (A, B)' `MQLCLRHS A,B,C'
+`sw2 __MQLMTHS (sw2, sw2)' `C = __MQLMTHS (A, B)' `MQLMTHS A,B,C'
+`void __MQMACHS (acc, sw2, sw2)' `__MQMACHS (C, A, B)' `MQMACHS A,B,C'
+`void __MQMACHU (acc, uw2, uw2)' `__MQMACHU (C, A, B)' `MQMACHU A,B,C'
+`void __MQMACXHS (acc, sw2, `__MQMACXHS (C, A, B)' `MQMACXHS A,B,C'
+sw2)'
+`void __MQMULHS (acc, sw2, sw2)' `__MQMULHS (C, A, B)' `MQMULHS A,B,C'
+`void __MQMULHU (acc, uw2, uw2)' `__MQMULHU (C, A, B)' `MQMULHU A,B,C'
+`void __MQMULXHS (acc, sw2, `__MQMULXHS (C, A, B)' `MQMULXHS A,B,C'
+sw2)'
+`void __MQMULXHU (acc, uw2, `__MQMULXHU (C, A, B)' `MQMULXHU A,B,C'
+uw2)'
+`sw2 __MQSATHS (sw2, sw2)' `C = __MQSATHS (A, B)' `MQSATHS A,B,C'
+`uw2 __MQSLLHI (uw2, int)' `C = __MQSLLHI (A, B)' `MQSLLHI A,B,C'
+`sw2 __MQSRAHI (sw2, int)' `C = __MQSRAHI (A, B)' `MQSRAHI A,B,C'
+`sw2 __MQSUBHSS (sw2, sw2)' `C = __MQSUBHSS (A, B)' `MQSUBHSS A,B,C'
+`uw2 __MQSUBHUS (uw2, uw2)' `C = __MQSUBHUS (A, B)' `MQSUBHUS A,B,C'
+`void __MQXMACHS (acc, sw2, `__MQXMACHS (C, A, B)' `MQXMACHS A,B,C'
+sw2)'
+`void __MQXMACXHS (acc, sw2, `__MQXMACXHS (C, A, B)' `MQXMACXHS A,B,C'
+sw2)'
+`uw1 __MRDACC (acc)' `B = __MRDACC (A)' `MRDACC A,B'
+`uw1 __MRDACCG (acc)' `B = __MRDACCG (A)' `MRDACCG A,B'
+`uw1 __MROTLI (uw1, const)' `C = __MROTLI (A, B)' `MROTLI A,#B,C'
+`uw1 __MROTRI (uw1, const)' `C = __MROTRI (A, B)' `MROTRI A,#B,C'
+`sw1 __MSATHS (sw1, sw1)' `C = __MSATHS (A, B)' `MSATHS A,B,C'
+`uw1 __MSATHU (uw1, uw1)' `C = __MSATHU (A, B)' `MSATHU A,B,C'
+`uw1 __MSLLHI (uw1, const)' `C = __MSLLHI (A, B)' `MSLLHI A,#B,C'
+`sw1 __MSRAHI (sw1, const)' `C = __MSRAHI (A, B)' `MSRAHI A,#B,C'
+`uw1 __MSRLHI (uw1, const)' `C = __MSRLHI (A, B)' `MSRLHI A,#B,C'
+`void __MSUBACCS (acc, acc)' `__MSUBACCS (B, A)' `MSUBACCS A,B'
+`sw1 __MSUBHSS (sw1, sw1)' `C = __MSUBHSS (A, B)' `MSUBHSS A,B,C'
+`uw1 __MSUBHUS (uw1, uw1)' `C = __MSUBHUS (A, B)' `MSUBHUS A,B,C'
+`void __MTRAP (void)' `__MTRAP ()' `MTRAP'
+`uw2 __MUNPACKH (uw1)' `B = __MUNPACKH (A)' `MUNPACKH A,B'
+`uw1 __MWCUT (uw2, uw1)' `C = __MWCUT (A, B)' `MWCUT A,B,C'
+`void __MWTACC (acc, uw1)' `__MWTACC (B, A)' `MWTACC A,B'
+`void __MWTACCG (acc, uw1)' `__MWTACCG (B, A)' `MWTACCG A,B'
+`uw1 __MXOR (uw1, uw1)' `C = __MXOR (A, B)' `MXOR A,B,C'
+
+
+File: gcc.info, Node: Raw read/write Functions, Next: Other Built-in Functions, Prev: Directly-mapped Media Functions, Up: FR-V Built-in Functions
+
+5.50.5.4 Raw read/write Functions
+.................................
+
+This sections describes built-in functions related to read and write
+instructions to access memory. These functions generate `membar'
+instructions to flush the I/O load and stores where appropriate, as
+described in Fujitsu's manual described above.
+
+`unsigned char __builtin_read8 (void *DATA)'
+
+`unsigned short __builtin_read16 (void *DATA)'
+
+`unsigned long __builtin_read32 (void *DATA)'
+
+`unsigned long long __builtin_read64 (void *DATA)'
+
+`void __builtin_write8 (void *DATA, unsigned char DATUM)'
+
+`void __builtin_write16 (void *DATA, unsigned short DATUM)'
+
+`void __builtin_write32 (void *DATA, unsigned long DATUM)'
+
+`void __builtin_write64 (void *DATA, unsigned long long DATUM)'
+
+
+File: gcc.info, Node: Other Built-in Functions, Prev: Raw read/write Functions, Up: FR-V Built-in Functions
+
+5.50.5.5 Other Built-in Functions
+.................................
+
+This section describes built-in functions that are not named after a
+specific FR-V instruction.
+
+`sw2 __IACCreadll (iacc REG)'
+ Return the full 64-bit value of IACC0. The REG argument is
+ reserved for future expansion and must be 0.
+
+`sw1 __IACCreadl (iacc REG)'
+ Return the value of IACC0H if REG is 0 and IACC0L if REG is 1.
+ Other values of REG are rejected as invalid.
+
+`void __IACCsetll (iacc REG, sw2 X)'
+ Set the full 64-bit value of IACC0 to X. The REG argument is
+ reserved for future expansion and must be 0.
+
+`void __IACCsetl (iacc REG, sw1 X)'
+ Set IACC0H to X if REG is 0 and IACC0L to X if REG is 1. Other
+ values of REG are rejected as invalid.
+
+`void __data_prefetch0 (const void *X)'
+ Use the `dcpl' instruction to load the contents of address X into
+ the data cache.
+
+`void __data_prefetch (const void *X)'
+ Use the `nldub' instruction to load the contents of address X into
+ the data cache. The instruction will be issued in slot I1.
+
+
+File: gcc.info, Node: X86 Built-in Functions, Next: MIPS DSP Built-in Functions, Prev: FR-V Built-in Functions, Up: Target Builtins
+
+5.50.6 X86 Built-in Functions
+-----------------------------
+
+These built-in functions are available for the i386 and x86-64 family
+of computers, depending on the command-line switches used.
+
+ Note that, if you specify command-line switches such as `-msse', the
+compiler could use the extended instruction sets even if the built-ins
+are not used explicitly in the program. For this reason, applications
+which perform runtime CPU detection must compile separate files for each
+supported architecture, using the appropriate flags. In particular,
+the file containing the CPU detection code should be compiled without
+these options.
+
+ The following machine modes are available for use with MMX built-in
+functions (*note Vector Extensions::): `V2SI' for a vector of two
+32-bit integers, `V4HI' for a vector of four 16-bit integers, and
+`V8QI' for a vector of eight 8-bit integers. Some of the built-in
+functions operate on MMX registers as a whole 64-bit entity, these use
+`V1DI' as their mode.
+
+ If 3Dnow extensions are enabled, `V2SF' is used as a mode for a vector
+of two 32-bit floating point values.
+
+ If SSE extensions are enabled, `V4SF' is used for a vector of four
+32-bit floating point values. Some instructions use a vector of four
+32-bit integers, these use `V4SI'. Finally, some instructions operate
+on an entire vector register, interpreting it as a 128-bit integer,
+these use mode `TI'.
+
+ In 64-bit mode, the x86-64 family of processors uses additional
+built-in functions for efficient use of `TF' (`__float128') 128-bit
+floating point and `TC' 128-bit complex floating point values.
+
+ The following floating point built-in functions are available in 64-bit
+mode. All of them implement the function that is part of the name.
+
+ __float128 __builtin_fabsq (__float128)
+ __float128 __builtin_copysignq (__float128, __float128)
+
+ The following floating point built-in functions are made available in
+the 64-bit mode.
+
+`__float128 __builtin_infq (void)'
+ Similar to `__builtin_inf', except the return type is `__float128'.
+
+ The following built-in functions are made available by `-mmmx'. All
+of them generate the machine instruction that is part of the name.
+
+ v8qi __builtin_ia32_paddb (v8qi, v8qi)
+ v4hi __builtin_ia32_paddw (v4hi, v4hi)
+ v2si __builtin_ia32_paddd (v2si, v2si)
+ v8qi __builtin_ia32_psubb (v8qi, v8qi)
+ v4hi __builtin_ia32_psubw (v4hi, v4hi)
+ v2si __builtin_ia32_psubd (v2si, v2si)
+ v8qi __builtin_ia32_paddsb (v8qi, v8qi)
+ v4hi __builtin_ia32_paddsw (v4hi, v4hi)
+ v8qi __builtin_ia32_psubsb (v8qi, v8qi)
+ v4hi __builtin_ia32_psubsw (v4hi, v4hi)
+ v8qi __builtin_ia32_paddusb (v8qi, v8qi)
+ v4hi __builtin_ia32_paddusw (v4hi, v4hi)
+ v8qi __builtin_ia32_psubusb (v8qi, v8qi)
+ v4hi __builtin_ia32_psubusw (v4hi, v4hi)
+ v4hi __builtin_ia32_pmullw (v4hi, v4hi)
+ v4hi __builtin_ia32_pmulhw (v4hi, v4hi)
+ di __builtin_ia32_pand (di, di)
+ di __builtin_ia32_pandn (di,di)
+ di __builtin_ia32_por (di, di)
+ di __builtin_ia32_pxor (di, di)
+ v8qi __builtin_ia32_pcmpeqb (v8qi, v8qi)
+ v4hi __builtin_ia32_pcmpeqw (v4hi, v4hi)
+ v2si __builtin_ia32_pcmpeqd (v2si, v2si)
+ v8qi __builtin_ia32_pcmpgtb (v8qi, v8qi)
+ v4hi __builtin_ia32_pcmpgtw (v4hi, v4hi)
+ v2si __builtin_ia32_pcmpgtd (v2si, v2si)
+ v8qi __builtin_ia32_punpckhbw (v8qi, v8qi)
+ v4hi __builtin_ia32_punpckhwd (v4hi, v4hi)
+ v2si __builtin_ia32_punpckhdq (v2si, v2si)
+ v8qi __builtin_ia32_punpcklbw (v8qi, v8qi)
+ v4hi __builtin_ia32_punpcklwd (v4hi, v4hi)
+ v2si __builtin_ia32_punpckldq (v2si, v2si)
+ v8qi __builtin_ia32_packsswb (v4hi, v4hi)
+ v4hi __builtin_ia32_packssdw (v2si, v2si)
+ v8qi __builtin_ia32_packuswb (v4hi, v4hi)
+
+ v4hi __builtin_ia32_psllw (v4hi, v4hi)
+ v2si __builtin_ia32_pslld (v2si, v2si)
+ v1di __builtin_ia32_psllq (v1di, v1di)
+ v4hi __builtin_ia32_psrlw (v4hi, v4hi)
+ v2si __builtin_ia32_psrld (v2si, v2si)
+ v1di __builtin_ia32_psrlq (v1di, v1di)
+ v4hi __builtin_ia32_psraw (v4hi, v4hi)
+ v2si __builtin_ia32_psrad (v2si, v2si)
+ v4hi __builtin_ia32_psllwi (v4hi, int)
+ v2si __builtin_ia32_pslldi (v2si, int)
+ v1di __builtin_ia32_psllqi (v1di, int)
+ v4hi __builtin_ia32_psrlwi (v4hi, int)
+ v2si __builtin_ia32_psrldi (v2si, int)
+ v1di __builtin_ia32_psrlqi (v1di, int)
+ v4hi __builtin_ia32_psrawi (v4hi, int)
+ v2si __builtin_ia32_psradi (v2si, int)
+
+ The following built-in functions are made available either with
+`-msse', or with a combination of `-m3dnow' and `-march=athlon'. All
+of them generate the machine instruction that is part of the name.
+
+ v4hi __builtin_ia32_pmulhuw (v4hi, v4hi)
+ v8qi __builtin_ia32_pavgb (v8qi, v8qi)
+ v4hi __builtin_ia32_pavgw (v4hi, v4hi)
+ v1di __builtin_ia32_psadbw (v8qi, v8qi)
+ v8qi __builtin_ia32_pmaxub (v8qi, v8qi)
+ v4hi __builtin_ia32_pmaxsw (v4hi, v4hi)
+ v8qi __builtin_ia32_pminub (v8qi, v8qi)
+ v4hi __builtin_ia32_pminsw (v4hi, v4hi)
+ int __builtin_ia32_pextrw (v4hi, int)
+ v4hi __builtin_ia32_pinsrw (v4hi, int, int)
+ int __builtin_ia32_pmovmskb (v8qi)
+ void __builtin_ia32_maskmovq (v8qi, v8qi, char *)
+ void __builtin_ia32_movntq (di *, di)
+ void __builtin_ia32_sfence (void)
+
+ The following built-in functions are available when `-msse' is used.
+All of them generate the machine instruction that is part of the name.
+
+ int __builtin_ia32_comieq (v4sf, v4sf)
+ int __builtin_ia32_comineq (v4sf, v4sf)
+ int __builtin_ia32_comilt (v4sf, v4sf)
+ int __builtin_ia32_comile (v4sf, v4sf)
+ int __builtin_ia32_comigt (v4sf, v4sf)
+ int __builtin_ia32_comige (v4sf, v4sf)
+ int __builtin_ia32_ucomieq (v4sf, v4sf)
+ int __builtin_ia32_ucomineq (v4sf, v4sf)
+ int __builtin_ia32_ucomilt (v4sf, v4sf)
+ int __builtin_ia32_ucomile (v4sf, v4sf)
+ int __builtin_ia32_ucomigt (v4sf, v4sf)
+ int __builtin_ia32_ucomige (v4sf, v4sf)
+ v4sf __builtin_ia32_addps (v4sf, v4sf)
+ v4sf __builtin_ia32_subps (v4sf, v4sf)
+ v4sf __builtin_ia32_mulps (v4sf, v4sf)
+ v4sf __builtin_ia32_divps (v4sf, v4sf)
+ v4sf __builtin_ia32_addss (v4sf, v4sf)
+ v4sf __builtin_ia32_subss (v4sf, v4sf)
+ v4sf __builtin_ia32_mulss (v4sf, v4sf)
+ v4sf __builtin_ia32_divss (v4sf, v4sf)
+ v4si __builtin_ia32_cmpeqps (v4sf, v4sf)
+ v4si __builtin_ia32_cmpltps (v4sf, v4sf)
+ v4si __builtin_ia32_cmpleps (v4sf, v4sf)
+ v4si __builtin_ia32_cmpgtps (v4sf, v4sf)
+ v4si __builtin_ia32_cmpgeps (v4sf, v4sf)
+ v4si __builtin_ia32_cmpunordps (v4sf, v4sf)
+ v4si __builtin_ia32_cmpneqps (v4sf, v4sf)
+ v4si __builtin_ia32_cmpnltps (v4sf, v4sf)
+ v4si __builtin_ia32_cmpnleps (v4sf, v4sf)
+ v4si __builtin_ia32_cmpngtps (v4sf, v4sf)
+ v4si __builtin_ia32_cmpngeps (v4sf, v4sf)
+ v4si __builtin_ia32_cmpordps (v4sf, v4sf)
+ v4si __builtin_ia32_cmpeqss (v4sf, v4sf)
+ v4si __builtin_ia32_cmpltss (v4sf, v4sf)
+ v4si __builtin_ia32_cmpless (v4sf, v4sf)
+ v4si __builtin_ia32_cmpunordss (v4sf, v4sf)
+ v4si __builtin_ia32_cmpneqss (v4sf, v4sf)
+ v4si __builtin_ia32_cmpnlts (v4sf, v4sf)
+ v4si __builtin_ia32_cmpnless (v4sf, v4sf)
+ v4si __builtin_ia32_cmpordss (v4sf, v4sf)
+ v4sf __builtin_ia32_maxps (v4sf, v4sf)
+ v4sf __builtin_ia32_maxss (v4sf, v4sf)
+ v4sf __builtin_ia32_minps (v4sf, v4sf)
+ v4sf __builtin_ia32_minss (v4sf, v4sf)
+ v4sf __builtin_ia32_andps (v4sf, v4sf)
+ v4sf __builtin_ia32_andnps (v4sf, v4sf)
+ v4sf __builtin_ia32_orps (v4sf, v4sf)
+ v4sf __builtin_ia32_xorps (v4sf, v4sf)
+ v4sf __builtin_ia32_movss (v4sf, v4sf)
+ v4sf __builtin_ia32_movhlps (v4sf, v4sf)
+ v4sf __builtin_ia32_movlhps (v4sf, v4sf)
+ v4sf __builtin_ia32_unpckhps (v4sf, v4sf)
+ v4sf __builtin_ia32_unpcklps (v4sf, v4sf)
+ v4sf __builtin_ia32_cvtpi2ps (v4sf, v2si)
+ v4sf __builtin_ia32_cvtsi2ss (v4sf, int)
+ v2si __builtin_ia32_cvtps2pi (v4sf)
+ int __builtin_ia32_cvtss2si (v4sf)
+ v2si __builtin_ia32_cvttps2pi (v4sf)
+ int __builtin_ia32_cvttss2si (v4sf)
+ v4sf __builtin_ia32_rcpps (v4sf)
+ v4sf __builtin_ia32_rsqrtps (v4sf)
+ v4sf __builtin_ia32_sqrtps (v4sf)
+ v4sf __builtin_ia32_rcpss (v4sf)
+ v4sf __builtin_ia32_rsqrtss (v4sf)
+ v4sf __builtin_ia32_sqrtss (v4sf)
+ v4sf __builtin_ia32_shufps (v4sf, v4sf, int)
+ void __builtin_ia32_movntps (float *, v4sf)
+ int __builtin_ia32_movmskps (v4sf)
+
+ The following built-in functions are available when `-msse' is used.
+
+`v4sf __builtin_ia32_loadaps (float *)'
+ Generates the `movaps' machine instruction as a load from memory.
+
+`void __builtin_ia32_storeaps (float *, v4sf)'
+ Generates the `movaps' machine instruction as a store to memory.
+
+`v4sf __builtin_ia32_loadups (float *)'
+ Generates the `movups' machine instruction as a load from memory.
+
+`void __builtin_ia32_storeups (float *, v4sf)'
+ Generates the `movups' machine instruction as a store to memory.
+
+`v4sf __builtin_ia32_loadsss (float *)'
+ Generates the `movss' machine instruction as a load from memory.
+
+`void __builtin_ia32_storess (float *, v4sf)'
+ Generates the `movss' machine instruction as a store to memory.
+
+`v4sf __builtin_ia32_loadhps (v4sf, const v2sf *)'
+ Generates the `movhps' machine instruction as a load from memory.
+
+`v4sf __builtin_ia32_loadlps (v4sf, const v2sf *)'
+ Generates the `movlps' machine instruction as a load from memory
+
+`void __builtin_ia32_storehps (v2sf *, v4sf)'
+ Generates the `movhps' machine instruction as a store to memory.
+
+`void __builtin_ia32_storelps (v2sf *, v4sf)'
+ Generates the `movlps' machine instruction as a store to memory.
+
+ The following built-in functions are available when `-msse2' is used.
+All of them generate the machine instruction that is part of the name.
+
+ int __builtin_ia32_comisdeq (v2df, v2df)
+ int __builtin_ia32_comisdlt (v2df, v2df)
+ int __builtin_ia32_comisdle (v2df, v2df)
+ int __builtin_ia32_comisdgt (v2df, v2df)
+ int __builtin_ia32_comisdge (v2df, v2df)
+ int __builtin_ia32_comisdneq (v2df, v2df)
+ int __builtin_ia32_ucomisdeq (v2df, v2df)
+ int __builtin_ia32_ucomisdlt (v2df, v2df)
+ int __builtin_ia32_ucomisdle (v2df, v2df)
+ int __builtin_ia32_ucomisdgt (v2df, v2df)
+ int __builtin_ia32_ucomisdge (v2df, v2df)
+ int __builtin_ia32_ucomisdneq (v2df, v2df)
+ v2df __builtin_ia32_cmpeqpd (v2df, v2df)
+ v2df __builtin_ia32_cmpltpd (v2df, v2df)
+ v2df __builtin_ia32_cmplepd (v2df, v2df)
+ v2df __builtin_ia32_cmpgtpd (v2df, v2df)
+ v2df __builtin_ia32_cmpgepd (v2df, v2df)
+ v2df __builtin_ia32_cmpunordpd (v2df, v2df)
+ v2df __builtin_ia32_cmpneqpd (v2df, v2df)
+ v2df __builtin_ia32_cmpnltpd (v2df, v2df)
+ v2df __builtin_ia32_cmpnlepd (v2df, v2df)
+ v2df __builtin_ia32_cmpngtpd (v2df, v2df)
+ v2df __builtin_ia32_cmpngepd (v2df, v2df)
+ v2df __builtin_ia32_cmpordpd (v2df, v2df)
+ v2df __builtin_ia32_cmpeqsd (v2df, v2df)
+ v2df __builtin_ia32_cmpltsd (v2df, v2df)
+ v2df __builtin_ia32_cmplesd (v2df, v2df)
+ v2df __builtin_ia32_cmpunordsd (v2df, v2df)
+ v2df __builtin_ia32_cmpneqsd (v2df, v2df)
+ v2df __builtin_ia32_cmpnltsd (v2df, v2df)
+ v2df __builtin_ia32_cmpnlesd (v2df, v2df)
+ v2df __builtin_ia32_cmpordsd (v2df, v2df)
+ v2di __builtin_ia32_paddq (v2di, v2di)
+ v2di __builtin_ia32_psubq (v2di, v2di)
+ v2df __builtin_ia32_addpd (v2df, v2df)
+ v2df __builtin_ia32_subpd (v2df, v2df)
+ v2df __builtin_ia32_mulpd (v2df, v2df)
+ v2df __builtin_ia32_divpd (v2df, v2df)
+ v2df __builtin_ia32_addsd (v2df, v2df)
+ v2df __builtin_ia32_subsd (v2df, v2df)
+ v2df __builtin_ia32_mulsd (v2df, v2df)
+ v2df __builtin_ia32_divsd (v2df, v2df)
+ v2df __builtin_ia32_minpd (v2df, v2df)
+ v2df __builtin_ia32_maxpd (v2df, v2df)
+ v2df __builtin_ia32_minsd (v2df, v2df)
+ v2df __builtin_ia32_maxsd (v2df, v2df)
+ v2df __builtin_ia32_andpd (v2df, v2df)
+ v2df __builtin_ia32_andnpd (v2df, v2df)
+ v2df __builtin_ia32_orpd (v2df, v2df)
+ v2df __builtin_ia32_xorpd (v2df, v2df)
+ v2df __builtin_ia32_movsd (v2df, v2df)
+ v2df __builtin_ia32_unpckhpd (v2df, v2df)
+ v2df __builtin_ia32_unpcklpd (v2df, v2df)
+ v16qi __builtin_ia32_paddb128 (v16qi, v16qi)
+ v8hi __builtin_ia32_paddw128 (v8hi, v8hi)
+ v4si __builtin_ia32_paddd128 (v4si, v4si)
+ v2di __builtin_ia32_paddq128 (v2di, v2di)
+ v16qi __builtin_ia32_psubb128 (v16qi, v16qi)
+ v8hi __builtin_ia32_psubw128 (v8hi, v8hi)
+ v4si __builtin_ia32_psubd128 (v4si, v4si)
+ v2di __builtin_ia32_psubq128 (v2di, v2di)
+ v8hi __builtin_ia32_pmullw128 (v8hi, v8hi)
+ v8hi __builtin_ia32_pmulhw128 (v8hi, v8hi)
+ v2di __builtin_ia32_pand128 (v2di, v2di)
+ v2di __builtin_ia32_pandn128 (v2di, v2di)
+ v2di __builtin_ia32_por128 (v2di, v2di)
+ v2di __builtin_ia32_pxor128 (v2di, v2di)
+ v16qi __builtin_ia32_pavgb128 (v16qi, v16qi)
+ v8hi __builtin_ia32_pavgw128 (v8hi, v8hi)
+ v16qi __builtin_ia32_pcmpeqb128 (v16qi, v16qi)
+ v8hi __builtin_ia32_pcmpeqw128 (v8hi, v8hi)
+ v4si __builtin_ia32_pcmpeqd128 (v4si, v4si)
+ v16qi __builtin_ia32_pcmpgtb128 (v16qi, v16qi)
+ v8hi __builtin_ia32_pcmpgtw128 (v8hi, v8hi)
+ v4si __builtin_ia32_pcmpgtd128 (v4si, v4si)
+ v16qi __builtin_ia32_pmaxub128 (v16qi, v16qi)
+ v8hi __builtin_ia32_pmaxsw128 (v8hi, v8hi)
+ v16qi __builtin_ia32_pminub128 (v16qi, v16qi)
+ v8hi __builtin_ia32_pminsw128 (v8hi, v8hi)
+ v16qi __builtin_ia32_punpckhbw128 (v16qi, v16qi)
+ v8hi __builtin_ia32_punpckhwd128 (v8hi, v8hi)
+ v4si __builtin_ia32_punpckhdq128 (v4si, v4si)
+ v2di __builtin_ia32_punpckhqdq128 (v2di, v2di)
+ v16qi __builtin_ia32_punpcklbw128 (v16qi, v16qi)
+ v8hi __builtin_ia32_punpcklwd128 (v8hi, v8hi)
+ v4si __builtin_ia32_punpckldq128 (v4si, v4si)
+ v2di __builtin_ia32_punpcklqdq128 (v2di, v2di)
+ v16qi __builtin_ia32_packsswb128 (v8hi, v8hi)
+ v8hi __builtin_ia32_packssdw128 (v4si, v4si)
+ v16qi __builtin_ia32_packuswb128 (v8hi, v8hi)
+ v8hi __builtin_ia32_pmulhuw128 (v8hi, v8hi)
+ void __builtin_ia32_maskmovdqu (v16qi, v16qi)
+ v2df __builtin_ia32_loadupd (double *)
+ void __builtin_ia32_storeupd (double *, v2df)
+ v2df __builtin_ia32_loadhpd (v2df, double const *)
+ v2df __builtin_ia32_loadlpd (v2df, double const *)
+ int __builtin_ia32_movmskpd (v2df)
+ int __builtin_ia32_pmovmskb128 (v16qi)
+ void __builtin_ia32_movnti (int *, int)
+ void __builtin_ia32_movntpd (double *, v2df)
+ void __builtin_ia32_movntdq (v2df *, v2df)
+ v4si __builtin_ia32_pshufd (v4si, int)
+ v8hi __builtin_ia32_pshuflw (v8hi, int)
+ v8hi __builtin_ia32_pshufhw (v8hi, int)
+ v2di __builtin_ia32_psadbw128 (v16qi, v16qi)
+ v2df __builtin_ia32_sqrtpd (v2df)
+ v2df __builtin_ia32_sqrtsd (v2df)
+ v2df __builtin_ia32_shufpd (v2df, v2df, int)
+ v2df __builtin_ia32_cvtdq2pd (v4si)
+ v4sf __builtin_ia32_cvtdq2ps (v4si)
+ v4si __builtin_ia32_cvtpd2dq (v2df)
+ v2si __builtin_ia32_cvtpd2pi (v2df)
+ v4sf __builtin_ia32_cvtpd2ps (v2df)
+ v4si __builtin_ia32_cvttpd2dq (v2df)
+ v2si __builtin_ia32_cvttpd2pi (v2df)
+ v2df __builtin_ia32_cvtpi2pd (v2si)
+ int __builtin_ia32_cvtsd2si (v2df)
+ int __builtin_ia32_cvttsd2si (v2df)
+ long long __builtin_ia32_cvtsd2si64 (v2df)
+ long long __builtin_ia32_cvttsd2si64 (v2df)
+ v4si __builtin_ia32_cvtps2dq (v4sf)
+ v2df __builtin_ia32_cvtps2pd (v4sf)
+ v4si __builtin_ia32_cvttps2dq (v4sf)
+ v2df __builtin_ia32_cvtsi2sd (v2df, int)
+ v2df __builtin_ia32_cvtsi642sd (v2df, long long)
+ v4sf __builtin_ia32_cvtsd2ss (v4sf, v2df)
+ v2df __builtin_ia32_cvtss2sd (v2df, v4sf)
+ void __builtin_ia32_clflush (const void *)
+ void __builtin_ia32_lfence (void)
+ void __builtin_ia32_mfence (void)
+ v16qi __builtin_ia32_loaddqu (const char *)
+ void __builtin_ia32_storedqu (char *, v16qi)
+ v1di __builtin_ia32_pmuludq (v2si, v2si)
+ v2di __builtin_ia32_pmuludq128 (v4si, v4si)
+ v8hi __builtin_ia32_psllw128 (v8hi, v8hi)
+ v4si __builtin_ia32_pslld128 (v4si, v4si)
+ v2di __builtin_ia32_psllq128 (v2di, v2di)
+ v8hi __builtin_ia32_psrlw128 (v8hi, v8hi)
+ v4si __builtin_ia32_psrld128 (v4si, v4si)
+ v2di __builtin_ia32_psrlq128 (v2di, v2di)
+ v8hi __builtin_ia32_psraw128 (v8hi, v8hi)
+ v4si __builtin_ia32_psrad128 (v4si, v4si)
+ v2di __builtin_ia32_pslldqi128 (v2di, int)
+ v8hi __builtin_ia32_psllwi128 (v8hi, int)
+ v4si __builtin_ia32_pslldi128 (v4si, int)
+ v2di __builtin_ia32_psllqi128 (v2di, int)
+ v2di __builtin_ia32_psrldqi128 (v2di, int)
+ v8hi __builtin_ia32_psrlwi128 (v8hi, int)
+ v4si __builtin_ia32_psrldi128 (v4si, int)
+ v2di __builtin_ia32_psrlqi128 (v2di, int)
+ v8hi __builtin_ia32_psrawi128 (v8hi, int)
+ v4si __builtin_ia32_psradi128 (v4si, int)
+ v4si __builtin_ia32_pmaddwd128 (v8hi, v8hi)
+ v2di __builtin_ia32_movq128 (v2di)
+
+ The following built-in functions are available when `-msse3' is used.
+All of them generate the machine instruction that is part of the name.
+
+ v2df __builtin_ia32_addsubpd (v2df, v2df)
+ v4sf __builtin_ia32_addsubps (v4sf, v4sf)
+ v2df __builtin_ia32_haddpd (v2df, v2df)
+ v4sf __builtin_ia32_haddps (v4sf, v4sf)
+ v2df __builtin_ia32_hsubpd (v2df, v2df)
+ v4sf __builtin_ia32_hsubps (v4sf, v4sf)
+ v16qi __builtin_ia32_lddqu (char const *)
+ void __builtin_ia32_monitor (void *, unsigned int, unsigned int)
+ v2df __builtin_ia32_movddup (v2df)
+ v4sf __builtin_ia32_movshdup (v4sf)
+ v4sf __builtin_ia32_movsldup (v4sf)
+ void __builtin_ia32_mwait (unsigned int, unsigned int)
+
+ The following built-in functions are available when `-msse3' is used.
+
+`v2df __builtin_ia32_loadddup (double const *)'
+ Generates the `movddup' machine instruction as a load from memory.
+
+ The following built-in functions are available when `-mssse3' is used.
+All of them generate the machine instruction that is part of the name
+with MMX registers.
+
+ v2si __builtin_ia32_phaddd (v2si, v2si)
+ v4hi __builtin_ia32_phaddw (v4hi, v4hi)
+ v4hi __builtin_ia32_phaddsw (v4hi, v4hi)
+ v2si __builtin_ia32_phsubd (v2si, v2si)
+ v4hi __builtin_ia32_phsubw (v4hi, v4hi)
+ v4hi __builtin_ia32_phsubsw (v4hi, v4hi)
+ v4hi __builtin_ia32_pmaddubsw (v8qi, v8qi)
+ v4hi __builtin_ia32_pmulhrsw (v4hi, v4hi)
+ v8qi __builtin_ia32_pshufb (v8qi, v8qi)
+ v8qi __builtin_ia32_psignb (v8qi, v8qi)
+ v2si __builtin_ia32_psignd (v2si, v2si)
+ v4hi __builtin_ia32_psignw (v4hi, v4hi)
+ v1di __builtin_ia32_palignr (v1di, v1di, int)
+ v8qi __builtin_ia32_pabsb (v8qi)
+ v2si __builtin_ia32_pabsd (v2si)
+ v4hi __builtin_ia32_pabsw (v4hi)
+
+ The following built-in functions are available when `-mssse3' is used.
+All of them generate the machine instruction that is part of the name
+with SSE registers.
+
+ v4si __builtin_ia32_phaddd128 (v4si, v4si)
+ v8hi __builtin_ia32_phaddw128 (v8hi, v8hi)
+ v8hi __builtin_ia32_phaddsw128 (v8hi, v8hi)
+ v4si __builtin_ia32_phsubd128 (v4si, v4si)
+ v8hi __builtin_ia32_phsubw128 (v8hi, v8hi)
+ v8hi __builtin_ia32_phsubsw128 (v8hi, v8hi)
+ v8hi __builtin_ia32_pmaddubsw128 (v16qi, v16qi)
+ v8hi __builtin_ia32_pmulhrsw128 (v8hi, v8hi)
+ v16qi __builtin_ia32_pshufb128 (v16qi, v16qi)
+ v16qi __builtin_ia32_psignb128 (v16qi, v16qi)
+ v4si __builtin_ia32_psignd128 (v4si, v4si)
+ v8hi __builtin_ia32_psignw128 (v8hi, v8hi)
+ v2di __builtin_ia32_palignr128 (v2di, v2di, int)
+ v16qi __builtin_ia32_pabsb128 (v16qi)
+ v4si __builtin_ia32_pabsd128 (v4si)
+ v8hi __builtin_ia32_pabsw128 (v8hi)
+
+ The following built-in functions are available when `-msse4.1' is
+used. All of them generate the machine instruction that is part of the
+name.
+
+ v2df __builtin_ia32_blendpd (v2df, v2df, const int)
+ v4sf __builtin_ia32_blendps (v4sf, v4sf, const int)
+ v2df __builtin_ia32_blendvpd (v2df, v2df, v2df)
+ v4sf __builtin_ia32_blendvps (v4sf, v4sf, v4sf)
+ v2df __builtin_ia32_dppd (v2df, v2df, const int)
+ v4sf __builtin_ia32_dpps (v4sf, v4sf, const int)
+ v4sf __builtin_ia32_insertps128 (v4sf, v4sf, const int)
+ v2di __builtin_ia32_movntdqa (v2di *);
+ v16qi __builtin_ia32_mpsadbw128 (v16qi, v16qi, const int)
+ v8hi __builtin_ia32_packusdw128 (v4si, v4si)
+ v16qi __builtin_ia32_pblendvb128 (v16qi, v16qi, v16qi)
+ v8hi __builtin_ia32_pblendw128 (v8hi, v8hi, const int)
+ v2di __builtin_ia32_pcmpeqq (v2di, v2di)
+ v8hi __builtin_ia32_phminposuw128 (v8hi)
+ v16qi __builtin_ia32_pmaxsb128 (v16qi, v16qi)
+ v4si __builtin_ia32_pmaxsd128 (v4si, v4si)
+ v4si __builtin_ia32_pmaxud128 (v4si, v4si)
+ v8hi __builtin_ia32_pmaxuw128 (v8hi, v8hi)
+ v16qi __builtin_ia32_pminsb128 (v16qi, v16qi)
+ v4si __builtin_ia32_pminsd128 (v4si, v4si)
+ v4si __builtin_ia32_pminud128 (v4si, v4si)
+ v8hi __builtin_ia32_pminuw128 (v8hi, v8hi)
+ v4si __builtin_ia32_pmovsxbd128 (v16qi)
+ v2di __builtin_ia32_pmovsxbq128 (v16qi)
+ v8hi __builtin_ia32_pmovsxbw128 (v16qi)
+ v2di __builtin_ia32_pmovsxdq128 (v4si)
+ v4si __builtin_ia32_pmovsxwd128 (v8hi)
+ v2di __builtin_ia32_pmovsxwq128 (v8hi)
+ v4si __builtin_ia32_pmovzxbd128 (v16qi)
+ v2di __builtin_ia32_pmovzxbq128 (v16qi)
+ v8hi __builtin_ia32_pmovzxbw128 (v16qi)
+ v2di __builtin_ia32_pmovzxdq128 (v4si)
+ v4si __builtin_ia32_pmovzxwd128 (v8hi)
+ v2di __builtin_ia32_pmovzxwq128 (v8hi)
+ v2di __builtin_ia32_pmuldq128 (v4si, v4si)
+ v4si __builtin_ia32_pmulld128 (v4si, v4si)
+ int __builtin_ia32_ptestc128 (v2di, v2di)
+ int __builtin_ia32_ptestnzc128 (v2di, v2di)
+ int __builtin_ia32_ptestz128 (v2di, v2di)
+ v2df __builtin_ia32_roundpd (v2df, const int)
+ v4sf __builtin_ia32_roundps (v4sf, const int)
+ v2df __builtin_ia32_roundsd (v2df, v2df, const int)
+ v4sf __builtin_ia32_roundss (v4sf, v4sf, const int)
+
+ The following built-in functions are available when `-msse4.1' is used.
+
+`v4sf __builtin_ia32_vec_set_v4sf (v4sf, float, const int)'
+ Generates the `insertps' machine instruction.
+
+`int __builtin_ia32_vec_ext_v16qi (v16qi, const int)'
+ Generates the `pextrb' machine instruction.
+
+`v16qi __builtin_ia32_vec_set_v16qi (v16qi, int, const int)'
+ Generates the `pinsrb' machine instruction.
+
+`v4si __builtin_ia32_vec_set_v4si (v4si, int, const int)'
+ Generates the `pinsrd' machine instruction.
+
+`v2di __builtin_ia32_vec_set_v2di (v2di, long long, const int)'
+ Generates the `pinsrq' machine instruction in 64bit mode.
+
+ The following built-in functions are changed to generate new SSE4.1
+instructions when `-msse4.1' is used.
+
+`float __builtin_ia32_vec_ext_v4sf (v4sf, const int)'
+ Generates the `extractps' machine instruction.
+
+`int __builtin_ia32_vec_ext_v4si (v4si, const int)'
+ Generates the `pextrd' machine instruction.
+
+`long long __builtin_ia32_vec_ext_v2di (v2di, const int)'
+ Generates the `pextrq' machine instruction in 64bit mode.
+
+ The following built-in functions are available when `-msse4.2' is
+used. All of them generate the machine instruction that is part of the
+name.
+
+ v16qi __builtin_ia32_pcmpestrm128 (v16qi, int, v16qi, int, const int)
+ int __builtin_ia32_pcmpestri128 (v16qi, int, v16qi, int, const int)
+ int __builtin_ia32_pcmpestria128 (v16qi, int, v16qi, int, const int)
+ int __builtin_ia32_pcmpestric128 (v16qi, int, v16qi, int, const int)
+ int __builtin_ia32_pcmpestrio128 (v16qi, int, v16qi, int, const int)
+ int __builtin_ia32_pcmpestris128 (v16qi, int, v16qi, int, const int)
+ int __builtin_ia32_pcmpestriz128 (v16qi, int, v16qi, int, const int)
+ v16qi __builtin_ia32_pcmpistrm128 (v16qi, v16qi, const int)
+ int __builtin_ia32_pcmpistri128 (v16qi, v16qi, const int)
+ int __builtin_ia32_pcmpistria128 (v16qi, v16qi, const int)
+ int __builtin_ia32_pcmpistric128 (v16qi, v16qi, const int)
+ int __builtin_ia32_pcmpistrio128 (v16qi, v16qi, const int)
+ int __builtin_ia32_pcmpistris128 (v16qi, v16qi, const int)
+ int __builtin_ia32_pcmpistriz128 (v16qi, v16qi, const int)
+ v2di __builtin_ia32_pcmpgtq (v2di, v2di)
+
+ The following built-in functions are available when `-msse4.2' is used.
+
+`unsigned int __builtin_ia32_crc32qi (unsigned int, unsigned char)'
+ Generates the `crc32b' machine instruction.
+
+`unsigned int __builtin_ia32_crc32hi (unsigned int, unsigned short)'
+ Generates the `crc32w' machine instruction.
+
+`unsigned int __builtin_ia32_crc32si (unsigned int, unsigned int)'
+ Generates the `crc32l' machine instruction.
+
+`unsigned long long __builtin_ia32_crc32di (unsigned long long, unsigned long long)'
+ Generates the `crc32q' machine instruction.
+
+ The following built-in functions are changed to generate new SSE4.2
+instructions when `-msse4.2' is used.
+
+`int __builtin_popcount (unsigned int)'
+ Generates the `popcntl' machine instruction.
+
+`int __builtin_popcountl (unsigned long)'
+ Generates the `popcntl' or `popcntq' machine instruction,
+ depending on the size of `unsigned long'.
+
+`int __builtin_popcountll (unsigned long long)'
+ Generates the `popcntq' machine instruction.
+
+ The following built-in functions are available when `-mavx' is used.
+All of them generate the machine instruction that is part of the name.
+
+ v4df __builtin_ia32_addpd256 (v4df,v4df)
+ v8sf __builtin_ia32_addps256 (v8sf,v8sf)
+ v4df __builtin_ia32_addsubpd256 (v4df,v4df)
+ v8sf __builtin_ia32_addsubps256 (v8sf,v8sf)
+ v4df __builtin_ia32_andnpd256 (v4df,v4df)
+ v8sf __builtin_ia32_andnps256 (v8sf,v8sf)
+ v4df __builtin_ia32_andpd256 (v4df,v4df)
+ v8sf __builtin_ia32_andps256 (v8sf,v8sf)
+ v4df __builtin_ia32_blendpd256 (v4df,v4df,int)
+ v8sf __builtin_ia32_blendps256 (v8sf,v8sf,int)
+ v4df __builtin_ia32_blendvpd256 (v4df,v4df,v4df)
+ v8sf __builtin_ia32_blendvps256 (v8sf,v8sf,v8sf)
+ v2df __builtin_ia32_cmppd (v2df,v2df,int)
+ v4df __builtin_ia32_cmppd256 (v4df,v4df,int)
+ v4sf __builtin_ia32_cmpps (v4sf,v4sf,int)
+ v8sf __builtin_ia32_cmpps256 (v8sf,v8sf,int)
+ v2df __builtin_ia32_cmpsd (v2df,v2df,int)
+ v4sf __builtin_ia32_cmpss (v4sf,v4sf,int)
+ v4df __builtin_ia32_cvtdq2pd256 (v4si)
+ v8sf __builtin_ia32_cvtdq2ps256 (v8si)
+ v4si __builtin_ia32_cvtpd2dq256 (v4df)
+ v4sf __builtin_ia32_cvtpd2ps256 (v4df)
+ v8si __builtin_ia32_cvtps2dq256 (v8sf)
+ v4df __builtin_ia32_cvtps2pd256 (v4sf)
+ v4si __builtin_ia32_cvttpd2dq256 (v4df)
+ v8si __builtin_ia32_cvttps2dq256 (v8sf)
+ v4df __builtin_ia32_divpd256 (v4df,v4df)
+ v8sf __builtin_ia32_divps256 (v8sf,v8sf)
+ v8sf __builtin_ia32_dpps256 (v8sf,v8sf,int)
+ v4df __builtin_ia32_haddpd256 (v4df,v4df)
+ v8sf __builtin_ia32_haddps256 (v8sf,v8sf)
+ v4df __builtin_ia32_hsubpd256 (v4df,v4df)
+ v8sf __builtin_ia32_hsubps256 (v8sf,v8sf)
+ v32qi __builtin_ia32_lddqu256 (pcchar)
+ v32qi __builtin_ia32_loaddqu256 (pcchar)
+ v4df __builtin_ia32_loadupd256 (pcdouble)
+ v8sf __builtin_ia32_loadups256 (pcfloat)
+ v2df __builtin_ia32_maskloadpd (pcv2df,v2df)
+ v4df __builtin_ia32_maskloadpd256 (pcv4df,v4df)
+ v4sf __builtin_ia32_maskloadps (pcv4sf,v4sf)
+ v8sf __builtin_ia32_maskloadps256 (pcv8sf,v8sf)
+ void __builtin_ia32_maskstorepd (pv2df,v2df,v2df)
+ void __builtin_ia32_maskstorepd256 (pv4df,v4df,v4df)
+ void __builtin_ia32_maskstoreps (pv4sf,v4sf,v4sf)
+ void __builtin_ia32_maskstoreps256 (pv8sf,v8sf,v8sf)
+ v4df __builtin_ia32_maxpd256 (v4df,v4df)
+ v8sf __builtin_ia32_maxps256 (v8sf,v8sf)
+ v4df __builtin_ia32_minpd256 (v4df,v4df)
+ v8sf __builtin_ia32_minps256 (v8sf,v8sf)
+ v4df __builtin_ia32_movddup256 (v4df)
+ int __builtin_ia32_movmskpd256 (v4df)
+ int __builtin_ia32_movmskps256 (v8sf)
+ v8sf __builtin_ia32_movshdup256 (v8sf)
+ v8sf __builtin_ia32_movsldup256 (v8sf)
+ v4df __builtin_ia32_mulpd256 (v4df,v4df)
+ v8sf __builtin_ia32_mulps256 (v8sf,v8sf)
+ v4df __builtin_ia32_orpd256 (v4df,v4df)
+ v8sf __builtin_ia32_orps256 (v8sf,v8sf)
+ v2df __builtin_ia32_pd_pd256 (v4df)
+ v4df __builtin_ia32_pd256_pd (v2df)
+ v4sf __builtin_ia32_ps_ps256 (v8sf)
+ v8sf __builtin_ia32_ps256_ps (v4sf)
+ int __builtin_ia32_ptestc256 (v4di,v4di,ptest)
+ int __builtin_ia32_ptestnzc256 (v4di,v4di,ptest)
+ int __builtin_ia32_ptestz256 (v4di,v4di,ptest)
+ v8sf __builtin_ia32_rcpps256 (v8sf)
+ v4df __builtin_ia32_roundpd256 (v4df,int)
+ v8sf __builtin_ia32_roundps256 (v8sf,int)
+ v8sf __builtin_ia32_rsqrtps_nr256 (v8sf)
+ v8sf __builtin_ia32_rsqrtps256 (v8sf)
+ v4df __builtin_ia32_shufpd256 (v4df,v4df,int)
+ v8sf __builtin_ia32_shufps256 (v8sf,v8sf,int)
+ v4si __builtin_ia32_si_si256 (v8si)
+ v8si __builtin_ia32_si256_si (v4si)
+ v4df __builtin_ia32_sqrtpd256 (v4df)
+ v8sf __builtin_ia32_sqrtps_nr256 (v8sf)
+ v8sf __builtin_ia32_sqrtps256 (v8sf)
+ void __builtin_ia32_storedqu256 (pchar,v32qi)
+ void __builtin_ia32_storeupd256 (pdouble,v4df)
+ void __builtin_ia32_storeups256 (pfloat,v8sf)
+ v4df __builtin_ia32_subpd256 (v4df,v4df)
+ v8sf __builtin_ia32_subps256 (v8sf,v8sf)
+ v4df __builtin_ia32_unpckhpd256 (v4df,v4df)
+ v8sf __builtin_ia32_unpckhps256 (v8sf,v8sf)
+ v4df __builtin_ia32_unpcklpd256 (v4df,v4df)
+ v8sf __builtin_ia32_unpcklps256 (v8sf,v8sf)
+ v4df __builtin_ia32_vbroadcastf128_pd256 (pcv2df)
+ v8sf __builtin_ia32_vbroadcastf128_ps256 (pcv4sf)
+ v4df __builtin_ia32_vbroadcastsd256 (pcdouble)
+ v4sf __builtin_ia32_vbroadcastss (pcfloat)
+ v8sf __builtin_ia32_vbroadcastss256 (pcfloat)
+ v2df __builtin_ia32_vextractf128_pd256 (v4df,int)
+ v4sf __builtin_ia32_vextractf128_ps256 (v8sf,int)
+ v4si __builtin_ia32_vextractf128_si256 (v8si,int)
+ v4df __builtin_ia32_vinsertf128_pd256 (v4df,v2df,int)
+ v8sf __builtin_ia32_vinsertf128_ps256 (v8sf,v4sf,int)
+ v8si __builtin_ia32_vinsertf128_si256 (v8si,v4si,int)
+ v4df __builtin_ia32_vperm2f128_pd256 (v4df,v4df,int)
+ v8sf __builtin_ia32_vperm2f128_ps256 (v8sf,v8sf,int)
+ v8si __builtin_ia32_vperm2f128_si256 (v8si,v8si,int)
+ v2df __builtin_ia32_vpermil2pd (v2df,v2df,v2di,int)
+ v4df __builtin_ia32_vpermil2pd256 (v4df,v4df,v4di,int)
+ v4sf __builtin_ia32_vpermil2ps (v4sf,v4sf,v4si,int)
+ v8sf __builtin_ia32_vpermil2ps256 (v8sf,v8sf,v8si,int)
+ v2df __builtin_ia32_vpermilpd (v2df,int)
+ v4df __builtin_ia32_vpermilpd256 (v4df,int)
+ v4sf __builtin_ia32_vpermilps (v4sf,int)
+ v8sf __builtin_ia32_vpermilps256 (v8sf,int)
+ v2df __builtin_ia32_vpermilvarpd (v2df,v2di)
+ v4df __builtin_ia32_vpermilvarpd256 (v4df,v4di)
+ v4sf __builtin_ia32_vpermilvarps (v4sf,v4si)
+ v8sf __builtin_ia32_vpermilvarps256 (v8sf,v8si)
+ int __builtin_ia32_vtestcpd (v2df,v2df,ptest)
+ int __builtin_ia32_vtestcpd256 (v4df,v4df,ptest)
+ int __builtin_ia32_vtestcps (v4sf,v4sf,ptest)
+ int __builtin_ia32_vtestcps256 (v8sf,v8sf,ptest)
+ int __builtin_ia32_vtestnzcpd (v2df,v2df,ptest)
+ int __builtin_ia32_vtestnzcpd256 (v4df,v4df,ptest)
+ int __builtin_ia32_vtestnzcps (v4sf,v4sf,ptest)
+ int __builtin_ia32_vtestnzcps256 (v8sf,v8sf,ptest)
+ int __builtin_ia32_vtestzpd (v2df,v2df,ptest)
+ int __builtin_ia32_vtestzpd256 (v4df,v4df,ptest)
+ int __builtin_ia32_vtestzps (v4sf,v4sf,ptest)
+ int __builtin_ia32_vtestzps256 (v8sf,v8sf,ptest)
+ void __builtin_ia32_vzeroall (void)
+ void __builtin_ia32_vzeroupper (void)
+ v4df __builtin_ia32_xorpd256 (v4df,v4df)
+ v8sf __builtin_ia32_xorps256 (v8sf,v8sf)
+
+ The following built-in functions are available when `-maes' is used.
+All of them generate the machine instruction that is part of the name.
+
+ v2di __builtin_ia32_aesenc128 (v2di, v2di)
+ v2di __builtin_ia32_aesenclast128 (v2di, v2di)
+ v2di __builtin_ia32_aesdec128 (v2di, v2di)
+ v2di __builtin_ia32_aesdeclast128 (v2di, v2di)
+ v2di __builtin_ia32_aeskeygenassist128 (v2di, const int)
+ v2di __builtin_ia32_aesimc128 (v2di)
+
+ The following built-in function is available when `-mpclmul' is used.
+
+`v2di __builtin_ia32_pclmulqdq128 (v2di, v2di, const int)'
+ Generates the `pclmulqdq' machine instruction.
+
+ The following built-in functions are available when `-msse4a' is used.
+All of them generate the machine instruction that is part of the name.
+
+ void __builtin_ia32_movntsd (double *, v2df)
+ void __builtin_ia32_movntss (float *, v4sf)
+ v2di __builtin_ia32_extrq (v2di, v16qi)
+ v2di __builtin_ia32_extrqi (v2di, const unsigned int, const unsigned int)
+ v2di __builtin_ia32_insertq (v2di, v2di)
+ v2di __builtin_ia32_insertqi (v2di, v2di, const unsigned int, const unsigned int)
+
+ The following built-in functions are available when `-msse5' is used.
+All of them generate the machine instruction that is part of the name
+with MMX registers.
+
+ v2df __builtin_ia32_comeqpd (v2df, v2df)
+ v2df __builtin_ia32_comeqps (v2df, v2df)
+ v4sf __builtin_ia32_comeqsd (v4sf, v4sf)
+ v4sf __builtin_ia32_comeqss (v4sf, v4sf)
+ v2df __builtin_ia32_comfalsepd (v2df, v2df)
+ v2df __builtin_ia32_comfalseps (v2df, v2df)
+ v4sf __builtin_ia32_comfalsesd (v4sf, v4sf)
+ v4sf __builtin_ia32_comfalsess (v4sf, v4sf)
+ v2df __builtin_ia32_comgepd (v2df, v2df)
+ v2df __builtin_ia32_comgeps (v2df, v2df)
+ v4sf __builtin_ia32_comgesd (v4sf, v4sf)
+ v4sf __builtin_ia32_comgess (v4sf, v4sf)
+ v2df __builtin_ia32_comgtpd (v2df, v2df)
+ v2df __builtin_ia32_comgtps (v2df, v2df)
+ v4sf __builtin_ia32_comgtsd (v4sf, v4sf)
+ v4sf __builtin_ia32_comgtss (v4sf, v4sf)
+ v2df __builtin_ia32_comlepd (v2df, v2df)
+ v2df __builtin_ia32_comleps (v2df, v2df)
+ v4sf __builtin_ia32_comlesd (v4sf, v4sf)
+ v4sf __builtin_ia32_comless (v4sf, v4sf)
+ v2df __builtin_ia32_comltpd (v2df, v2df)
+ v2df __builtin_ia32_comltps (v2df, v2df)
+ v4sf __builtin_ia32_comltsd (v4sf, v4sf)
+ v4sf __builtin_ia32_comltss (v4sf, v4sf)
+ v2df __builtin_ia32_comnepd (v2df, v2df)
+ v2df __builtin_ia32_comneps (v2df, v2df)
+ v4sf __builtin_ia32_comnesd (v4sf, v4sf)
+ v4sf __builtin_ia32_comness (v4sf, v4sf)
+ v2df __builtin_ia32_comordpd (v2df, v2df)
+ v2df __builtin_ia32_comordps (v2df, v2df)
+ v4sf __builtin_ia32_comordsd (v4sf, v4sf)
+ v4sf __builtin_ia32_comordss (v4sf, v4sf)
+ v2df __builtin_ia32_comtruepd (v2df, v2df)
+ v2df __builtin_ia32_comtrueps (v2df, v2df)
+ v4sf __builtin_ia32_comtruesd (v4sf, v4sf)
+ v4sf __builtin_ia32_comtruess (v4sf, v4sf)
+ v2df __builtin_ia32_comueqpd (v2df, v2df)
+ v2df __builtin_ia32_comueqps (v2df, v2df)
+ v4sf __builtin_ia32_comueqsd (v4sf, v4sf)
+ v4sf __builtin_ia32_comueqss (v4sf, v4sf)
+ v2df __builtin_ia32_comugepd (v2df, v2df)
+ v2df __builtin_ia32_comugeps (v2df, v2df)
+ v4sf __builtin_ia32_comugesd (v4sf, v4sf)
+ v4sf __builtin_ia32_comugess (v4sf, v4sf)
+ v2df __builtin_ia32_comugtpd (v2df, v2df)
+ v2df __builtin_ia32_comugtps (v2df, v2df)
+ v4sf __builtin_ia32_comugtsd (v4sf, v4sf)
+ v4sf __builtin_ia32_comugtss (v4sf, v4sf)
+ v2df __builtin_ia32_comulepd (v2df, v2df)
+ v2df __builtin_ia32_comuleps (v2df, v2df)
+ v4sf __builtin_ia32_comulesd (v4sf, v4sf)
+ v4sf __builtin_ia32_comuless (v4sf, v4sf)
+ v2df __builtin_ia32_comultpd (v2df, v2df)
+ v2df __builtin_ia32_comultps (v2df, v2df)
+ v4sf __builtin_ia32_comultsd (v4sf, v4sf)
+ v4sf __builtin_ia32_comultss (v4sf, v4sf)
+ v2df __builtin_ia32_comunepd (v2df, v2df)
+ v2df __builtin_ia32_comuneps (v2df, v2df)
+ v4sf __builtin_ia32_comunesd (v4sf, v4sf)
+ v4sf __builtin_ia32_comuness (v4sf, v4sf)
+ v2df __builtin_ia32_comunordpd (v2df, v2df)
+ v2df __builtin_ia32_comunordps (v2df, v2df)
+ v4sf __builtin_ia32_comunordsd (v4sf, v4sf)
+ v4sf __builtin_ia32_comunordss (v4sf, v4sf)
+ v2df __builtin_ia32_fmaddpd (v2df, v2df, v2df)
+ v4sf __builtin_ia32_fmaddps (v4sf, v4sf, v4sf)
+ v2df __builtin_ia32_fmaddsd (v2df, v2df, v2df)
+ v4sf __builtin_ia32_fmaddss (v4sf, v4sf, v4sf)
+ v2df __builtin_ia32_fmsubpd (v2df, v2df, v2df)
+ v4sf __builtin_ia32_fmsubps (v4sf, v4sf, v4sf)
+ v2df __builtin_ia32_fmsubsd (v2df, v2df, v2df)
+ v4sf __builtin_ia32_fmsubss (v4sf, v4sf, v4sf)
+ v2df __builtin_ia32_fnmaddpd (v2df, v2df, v2df)
+ v4sf __builtin_ia32_fnmaddps (v4sf, v4sf, v4sf)
+ v2df __builtin_ia32_fnmaddsd (v2df, v2df, v2df)
+ v4sf __builtin_ia32_fnmaddss (v4sf, v4sf, v4sf)
+ v2df __builtin_ia32_fnmsubpd (v2df, v2df, v2df)
+ v4sf __builtin_ia32_fnmsubps (v4sf, v4sf, v4sf)
+ v2df __builtin_ia32_fnmsubsd (v2df, v2df, v2df)
+ v4sf __builtin_ia32_fnmsubss (v4sf, v4sf, v4sf)
+ v2df __builtin_ia32_frczpd (v2df)
+ v4sf __builtin_ia32_frczps (v4sf)
+ v2df __builtin_ia32_frczsd (v2df, v2df)
+ v4sf __builtin_ia32_frczss (v4sf, v4sf)
+ v2di __builtin_ia32_pcmov (v2di, v2di, v2di)
+ v2di __builtin_ia32_pcmov_v2di (v2di, v2di, v2di)
+ v4si __builtin_ia32_pcmov_v4si (v4si, v4si, v4si)
+ v8hi __builtin_ia32_pcmov_v8hi (v8hi, v8hi, v8hi)
+ v16qi __builtin_ia32_pcmov_v16qi (v16qi, v16qi, v16qi)
+ v2df __builtin_ia32_pcmov_v2df (v2df, v2df, v2df)
+ v4sf __builtin_ia32_pcmov_v4sf (v4sf, v4sf, v4sf)
+ v16qi __builtin_ia32_pcomeqb (v16qi, v16qi)
+ v8hi __builtin_ia32_pcomeqw (v8hi, v8hi)
+ v4si __builtin_ia32_pcomeqd (v4si, v4si)
+ v2di __builtin_ia32_pcomeqq (v2di, v2di)
+ v16qi __builtin_ia32_pcomequb (v16qi, v16qi)
+ v4si __builtin_ia32_pcomequd (v4si, v4si)
+ v2di __builtin_ia32_pcomequq (v2di, v2di)
+ v8hi __builtin_ia32_pcomequw (v8hi, v8hi)
+ v8hi __builtin_ia32_pcomeqw (v8hi, v8hi)
+ v16qi __builtin_ia32_pcomfalseb (v16qi, v16qi)
+ v4si __builtin_ia32_pcomfalsed (v4si, v4si)
+ v2di __builtin_ia32_pcomfalseq (v2di, v2di)
+ v16qi __builtin_ia32_pcomfalseub (v16qi, v16qi)
+ v4si __builtin_ia32_pcomfalseud (v4si, v4si)
+ v2di __builtin_ia32_pcomfalseuq (v2di, v2di)
+ v8hi __builtin_ia32_pcomfalseuw (v8hi, v8hi)
+ v8hi __builtin_ia32_pcomfalsew (v8hi, v8hi)
+ v16qi __builtin_ia32_pcomgeb (v16qi, v16qi)
+ v4si __builtin_ia32_pcomged (v4si, v4si)
+ v2di __builtin_ia32_pcomgeq (v2di, v2di)
+ v16qi __builtin_ia32_pcomgeub (v16qi, v16qi)
+ v4si __builtin_ia32_pcomgeud (v4si, v4si)
+ v2di __builtin_ia32_pcomgeuq (v2di, v2di)
+ v8hi __builtin_ia32_pcomgeuw (v8hi, v8hi)
+ v8hi __builtin_ia32_pcomgew (v8hi, v8hi)
+ v16qi __builtin_ia32_pcomgtb (v16qi, v16qi)
+ v4si __builtin_ia32_pcomgtd (v4si, v4si)
+ v2di __builtin_ia32_pcomgtq (v2di, v2di)
+ v16qi __builtin_ia32_pcomgtub (v16qi, v16qi)
+ v4si __builtin_ia32_pcomgtud (v4si, v4si)
+ v2di __builtin_ia32_pcomgtuq (v2di, v2di)
+ v8hi __builtin_ia32_pcomgtuw (v8hi, v8hi)
+ v8hi __builtin_ia32_pcomgtw (v8hi, v8hi)
+ v16qi __builtin_ia32_pcomleb (v16qi, v16qi)
+ v4si __builtin_ia32_pcomled (v4si, v4si)
+ v2di __builtin_ia32_pcomleq (v2di, v2di)
+ v16qi __builtin_ia32_pcomleub (v16qi, v16qi)
+ v4si __builtin_ia32_pcomleud (v4si, v4si)
+ v2di __builtin_ia32_pcomleuq (v2di, v2di)
+ v8hi __builtin_ia32_pcomleuw (v8hi, v8hi)
+ v8hi __builtin_ia32_pcomlew (v8hi, v8hi)
+ v16qi __builtin_ia32_pcomltb (v16qi, v16qi)
+ v4si __builtin_ia32_pcomltd (v4si, v4si)
+ v2di __builtin_ia32_pcomltq (v2di, v2di)
+ v16qi __builtin_ia32_pcomltub (v16qi, v16qi)
+ v4si __builtin_ia32_pcomltud (v4si, v4si)
+ v2di __builtin_ia32_pcomltuq (v2di, v2di)
+ v8hi __builtin_ia32_pcomltuw (v8hi, v8hi)
+ v8hi __builtin_ia32_pcomltw (v8hi, v8hi)
+ v16qi __builtin_ia32_pcomneb (v16qi, v16qi)
+ v4si __builtin_ia32_pcomned (v4si, v4si)
+ v2di __builtin_ia32_pcomneq (v2di, v2di)
+ v16qi __builtin_ia32_pcomneub (v16qi, v16qi)
+ v4si __builtin_ia32_pcomneud (v4si, v4si)
+ v2di __builtin_ia32_pcomneuq (v2di, v2di)
+ v8hi __builtin_ia32_pcomneuw (v8hi, v8hi)
+ v8hi __builtin_ia32_pcomnew (v8hi, v8hi)
+ v16qi __builtin_ia32_pcomtrueb (v16qi, v16qi)
+ v4si __builtin_ia32_pcomtrued (v4si, v4si)
+ v2di __builtin_ia32_pcomtrueq (v2di, v2di)
+ v16qi __builtin_ia32_pcomtrueub (v16qi, v16qi)
+ v4si __builtin_ia32_pcomtrueud (v4si, v4si)
+ v2di __builtin_ia32_pcomtrueuq (v2di, v2di)
+ v8hi __builtin_ia32_pcomtrueuw (v8hi, v8hi)
+ v8hi __builtin_ia32_pcomtruew (v8hi, v8hi)
+ v4df __builtin_ia32_permpd (v2df, v2df, v16qi)
+ v4sf __builtin_ia32_permps (v4sf, v4sf, v16qi)
+ v4si __builtin_ia32_phaddbd (v16qi)
+ v2di __builtin_ia32_phaddbq (v16qi)
+ v8hi __builtin_ia32_phaddbw (v16qi)
+ v2di __builtin_ia32_phadddq (v4si)
+ v4si __builtin_ia32_phaddubd (v16qi)
+ v2di __builtin_ia32_phaddubq (v16qi)
+ v8hi __builtin_ia32_phaddubw (v16qi)
+ v2di __builtin_ia32_phaddudq (v4si)
+ v4si __builtin_ia32_phadduwd (v8hi)
+ v2di __builtin_ia32_phadduwq (v8hi)
+ v4si __builtin_ia32_phaddwd (v8hi)
+ v2di __builtin_ia32_phaddwq (v8hi)
+ v8hi __builtin_ia32_phsubbw (v16qi)
+ v2di __builtin_ia32_phsubdq (v4si)
+ v4si __builtin_ia32_phsubwd (v8hi)
+ v4si __builtin_ia32_pmacsdd (v4si, v4si, v4si)
+ v2di __builtin_ia32_pmacsdqh (v4si, v4si, v2di)
+ v2di __builtin_ia32_pmacsdql (v4si, v4si, v2di)
+ v4si __builtin_ia32_pmacssdd (v4si, v4si, v4si)
+ v2di __builtin_ia32_pmacssdqh (v4si, v4si, v2di)
+ v2di __builtin_ia32_pmacssdql (v4si, v4si, v2di)
+ v4si __builtin_ia32_pmacsswd (v8hi, v8hi, v4si)
+ v8hi __builtin_ia32_pmacssww (v8hi, v8hi, v8hi)
+ v4si __builtin_ia32_pmacswd (v8hi, v8hi, v4si)
+ v8hi __builtin_ia32_pmacsww (v8hi, v8hi, v8hi)
+ v4si __builtin_ia32_pmadcsswd (v8hi, v8hi, v4si)
+ v4si __builtin_ia32_pmadcswd (v8hi, v8hi, v4si)
+ v16qi __builtin_ia32_pperm (v16qi, v16qi, v16qi)
+ v16qi __builtin_ia32_protb (v16qi, v16qi)
+ v4si __builtin_ia32_protd (v4si, v4si)
+ v2di __builtin_ia32_protq (v2di, v2di)
+ v8hi __builtin_ia32_protw (v8hi, v8hi)
+ v16qi __builtin_ia32_pshab (v16qi, v16qi)
+ v4si __builtin_ia32_pshad (v4si, v4si)
+ v2di __builtin_ia32_pshaq (v2di, v2di)
+ v8hi __builtin_ia32_pshaw (v8hi, v8hi)
+ v16qi __builtin_ia32_pshlb (v16qi, v16qi)
+ v4si __builtin_ia32_pshld (v4si, v4si)
+ v2di __builtin_ia32_pshlq (v2di, v2di)
+ v8hi __builtin_ia32_pshlw (v8hi, v8hi)
+
+ The following builtin-in functions are available when `-msse5' is
+used. The second argument must be an integer constant and generate the
+machine instruction that is part of the name with the `_imm' suffix
+removed.
+
+ v16qi __builtin_ia32_protb_imm (v16qi, int)
+ v4si __builtin_ia32_protd_imm (v4si, int)
+ v2di __builtin_ia32_protq_imm (v2di, int)
+ v8hi __builtin_ia32_protw_imm (v8hi, int)
+
+ The following built-in functions are available when `-m3dnow' is used.
+All of them generate the machine instruction that is part of the name.
+
+ void __builtin_ia32_femms (void)
+ v8qi __builtin_ia32_pavgusb (v8qi, v8qi)
+ v2si __builtin_ia32_pf2id (v2sf)
+ v2sf __builtin_ia32_pfacc (v2sf, v2sf)
+ v2sf __builtin_ia32_pfadd (v2sf, v2sf)
+ v2si __builtin_ia32_pfcmpeq (v2sf, v2sf)
+ v2si __builtin_ia32_pfcmpge (v2sf, v2sf)
+ v2si __builtin_ia32_pfcmpgt (v2sf, v2sf)
+ v2sf __builtin_ia32_pfmax (v2sf, v2sf)
+ v2sf __builtin_ia32_pfmin (v2sf, v2sf)
+ v2sf __builtin_ia32_pfmul (v2sf, v2sf)
+ v2sf __builtin_ia32_pfrcp (v2sf)
+ v2sf __builtin_ia32_pfrcpit1 (v2sf, v2sf)
+ v2sf __builtin_ia32_pfrcpit2 (v2sf, v2sf)
+ v2sf __builtin_ia32_pfrsqrt (v2sf)
+ v2sf __builtin_ia32_pfrsqrtit1 (v2sf, v2sf)
+ v2sf __builtin_ia32_pfsub (v2sf, v2sf)
+ v2sf __builtin_ia32_pfsubr (v2sf, v2sf)
+ v2sf __builtin_ia32_pi2fd (v2si)
+ v4hi __builtin_ia32_pmulhrw (v4hi, v4hi)
+
+ The following built-in functions are available when both `-m3dnow' and
+`-march=athlon' are used. All of them generate the machine instruction
+that is part of the name.
+
+ v2si __builtin_ia32_pf2iw (v2sf)
+ v2sf __builtin_ia32_pfnacc (v2sf, v2sf)
+ v2sf __builtin_ia32_pfpnacc (v2sf, v2sf)
+ v2sf __builtin_ia32_pi2fw (v2si)
+ v2sf __builtin_ia32_pswapdsf (v2sf)
+ v2si __builtin_ia32_pswapdsi (v2si)
+
+
+File: gcc.info, Node: MIPS DSP Built-in Functions, Next: MIPS Paired-Single Support, Prev: X86 Built-in Functions, Up: Target Builtins
+
+5.50.7 MIPS DSP Built-in Functions
+----------------------------------
+
+The MIPS DSP Application-Specific Extension (ASE) includes new
+instructions that are designed to improve the performance of DSP and
+media applications. It provides instructions that operate on packed
+8-bit/16-bit integer data, Q7, Q15 and Q31 fractional data.
+
+ GCC supports MIPS DSP operations using both the generic vector
+extensions (*note Vector Extensions::) and a collection of
+MIPS-specific built-in functions. Both kinds of support are enabled by
+the `-mdsp' command-line option.
+
+ Revision 2 of the ASE was introduced in the second half of 2006. This
+revision adds extra instructions to the original ASE, but is otherwise
+backwards-compatible with it. You can select revision 2 using the
+command-line option `-mdspr2'; this option implies `-mdsp'.
+
+ The SCOUNT and POS bits of the DSP control register are global. The
+WRDSP, EXTPDP, EXTPDPV and MTHLIP instructions modify the SCOUNT and
+POS bits. During optimization, the compiler will not delete these
+instructions and it will not delete calls to functions containing these
+instructions.
+
+ At present, GCC only provides support for operations on 32-bit
+vectors. The vector type associated with 8-bit integer data is usually
+called `v4i8', the vector type associated with Q7 is usually called
+`v4q7', the vector type associated with 16-bit integer data is usually
+called `v2i16', and the vector type associated with Q15 is usually
+called `v2q15'. They can be defined in C as follows:
+
+ typedef signed char v4i8 __attribute__ ((vector_size(4)));
+ typedef signed char v4q7 __attribute__ ((vector_size(4)));
+ typedef short v2i16 __attribute__ ((vector_size(4)));
+ typedef short v2q15 __attribute__ ((vector_size(4)));
+
+ `v4i8', `v4q7', `v2i16' and `v2q15' values are initialized in the same
+way as aggregates. For example:
+
+ v4i8 a = {1, 2, 3, 4};
+ v4i8 b;
+ b = (v4i8) {5, 6, 7, 8};
+
+ v2q15 c = {0x0fcb, 0x3a75};
+ v2q15 d;
+ d = (v2q15) {0.1234 * 0x1.0p15, 0.4567 * 0x1.0p15};
+
+ _Note:_ The CPU's endianness determines the order in which values are
+packed. On little-endian targets, the first value is the least
+significant and the last value is the most significant. The opposite
+order applies to big-endian targets. For example, the code above will
+set the lowest byte of `a' to `1' on little-endian targets and `4' on
+big-endian targets.
+
+ _Note:_ Q7, Q15 and Q31 values must be initialized with their integer
+representation. As shown in this example, the integer representation
+of a Q7 value can be obtained by multiplying the fractional value by
+`0x1.0p7'. The equivalent for Q15 values is to multiply by `0x1.0p15'.
+The equivalent for Q31 values is to multiply by `0x1.0p31'.
+
+ The table below lists the `v4i8' and `v2q15' operations for which
+hardware support exists. `a' and `b' are `v4i8' values, and `c' and
+`d' are `v2q15' values.
+
+C code MIPS instruction
+`a + b' `addu.qb'
+`c + d' `addq.ph'
+`a - b' `subu.qb'
+`c - d' `subq.ph'
+
+ The table below lists the `v2i16' operation for which hardware support
+exists for the DSP ASE REV 2. `e' and `f' are `v2i16' values.
+
+C code MIPS instruction
+`e * f' `mul.ph'
+
+ It is easier to describe the DSP built-in functions if we first define
+the following types:
+
+ typedef int q31;
+ typedef int i32;
+ typedef unsigned int ui32;
+ typedef long long a64;
+
+ `q31' and `i32' are actually the same as `int', but we use `q31' to
+indicate a Q31 fractional value and `i32' to indicate a 32-bit integer
+value. Similarly, `a64' is the same as `long long', but we use `a64'
+to indicate values that will be placed in one of the four DSP
+accumulators (`$ac0', `$ac1', `$ac2' or `$ac3').
+
+ Also, some built-in functions prefer or require immediate numbers as
+parameters, because the corresponding DSP instructions accept both
+immediate numbers and register operands, or accept immediate numbers
+only. The immediate parameters are listed as follows.
+
+ imm0_3: 0 to 3.
+ imm0_7: 0 to 7.
+ imm0_15: 0 to 15.
+ imm0_31: 0 to 31.
+ imm0_63: 0 to 63.
+ imm0_255: 0 to 255.
+ imm_n32_31: -32 to 31.
+ imm_n512_511: -512 to 511.
+
+ The following built-in functions map directly to a particular MIPS DSP
+instruction. Please refer to the architecture specification for
+details on what each instruction does.
+
+ v2q15 __builtin_mips_addq_ph (v2q15, v2q15)
+ v2q15 __builtin_mips_addq_s_ph (v2q15, v2q15)
+ q31 __builtin_mips_addq_s_w (q31, q31)
+ v4i8 __builtin_mips_addu_qb (v4i8, v4i8)
+ v4i8 __builtin_mips_addu_s_qb (v4i8, v4i8)
+ v2q15 __builtin_mips_subq_ph (v2q15, v2q15)
+ v2q15 __builtin_mips_subq_s_ph (v2q15, v2q15)
+ q31 __builtin_mips_subq_s_w (q31, q31)
+ v4i8 __builtin_mips_subu_qb (v4i8, v4i8)
+ v4i8 __builtin_mips_subu_s_qb (v4i8, v4i8)
+ i32 __builtin_mips_addsc (i32, i32)
+ i32 __builtin_mips_addwc (i32, i32)
+ i32 __builtin_mips_modsub (i32, i32)
+ i32 __builtin_mips_raddu_w_qb (v4i8)
+ v2q15 __builtin_mips_absq_s_ph (v2q15)
+ q31 __builtin_mips_absq_s_w (q31)
+ v4i8 __builtin_mips_precrq_qb_ph (v2q15, v2q15)
+ v2q15 __builtin_mips_precrq_ph_w (q31, q31)
+ v2q15 __builtin_mips_precrq_rs_ph_w (q31, q31)
+ v4i8 __builtin_mips_precrqu_s_qb_ph (v2q15, v2q15)
+ q31 __builtin_mips_preceq_w_phl (v2q15)
+ q31 __builtin_mips_preceq_w_phr (v2q15)
+ v2q15 __builtin_mips_precequ_ph_qbl (v4i8)
+ v2q15 __builtin_mips_precequ_ph_qbr (v4i8)
+ v2q15 __builtin_mips_precequ_ph_qbla (v4i8)
+ v2q15 __builtin_mips_precequ_ph_qbra (v4i8)
+ v2q15 __builtin_mips_preceu_ph_qbl (v4i8)
+ v2q15 __builtin_mips_preceu_ph_qbr (v4i8)
+ v2q15 __builtin_mips_preceu_ph_qbla (v4i8)
+ v2q15 __builtin_mips_preceu_ph_qbra (v4i8)
+ v4i8 __builtin_mips_shll_qb (v4i8, imm0_7)
+ v4i8 __builtin_mips_shll_qb (v4i8, i32)
+ v2q15 __builtin_mips_shll_ph (v2q15, imm0_15)
+ v2q15 __builtin_mips_shll_ph (v2q15, i32)
+ v2q15 __builtin_mips_shll_s_ph (v2q15, imm0_15)
+ v2q15 __builtin_mips_shll_s_ph (v2q15, i32)
+ q31 __builtin_mips_shll_s_w (q31, imm0_31)
+ q31 __builtin_mips_shll_s_w (q31, i32)
+ v4i8 __builtin_mips_shrl_qb (v4i8, imm0_7)
+ v4i8 __builtin_mips_shrl_qb (v4i8, i32)
+ v2q15 __builtin_mips_shra_ph (v2q15, imm0_15)
+ v2q15 __builtin_mips_shra_ph (v2q15, i32)
+ v2q15 __builtin_mips_shra_r_ph (v2q15, imm0_15)
+ v2q15 __builtin_mips_shra_r_ph (v2q15, i32)
+ q31 __builtin_mips_shra_r_w (q31, imm0_31)
+ q31 __builtin_mips_shra_r_w (q31, i32)
+ v2q15 __builtin_mips_muleu_s_ph_qbl (v4i8, v2q15)
+ v2q15 __builtin_mips_muleu_s_ph_qbr (v4i8, v2q15)
+ v2q15 __builtin_mips_mulq_rs_ph (v2q15, v2q15)
+ q31 __builtin_mips_muleq_s_w_phl (v2q15, v2q15)
+ q31 __builtin_mips_muleq_s_w_phr (v2q15, v2q15)
+ a64 __builtin_mips_dpau_h_qbl (a64, v4i8, v4i8)
+ a64 __builtin_mips_dpau_h_qbr (a64, v4i8, v4i8)
+ a64 __builtin_mips_dpsu_h_qbl (a64, v4i8, v4i8)
+ a64 __builtin_mips_dpsu_h_qbr (a64, v4i8, v4i8)
+ a64 __builtin_mips_dpaq_s_w_ph (a64, v2q15, v2q15)
+ a64 __builtin_mips_dpaq_sa_l_w (a64, q31, q31)
+ a64 __builtin_mips_dpsq_s_w_ph (a64, v2q15, v2q15)
+ a64 __builtin_mips_dpsq_sa_l_w (a64, q31, q31)
+ a64 __builtin_mips_mulsaq_s_w_ph (a64, v2q15, v2q15)
+ a64 __builtin_mips_maq_s_w_phl (a64, v2q15, v2q15)
+ a64 __builtin_mips_maq_s_w_phr (a64, v2q15, v2q15)
+ a64 __builtin_mips_maq_sa_w_phl (a64, v2q15, v2q15)
+ a64 __builtin_mips_maq_sa_w_phr (a64, v2q15, v2q15)
+ i32 __builtin_mips_bitrev (i32)
+ i32 __builtin_mips_insv (i32, i32)
+ v4i8 __builtin_mips_repl_qb (imm0_255)
+ v4i8 __builtin_mips_repl_qb (i32)
+ v2q15 __builtin_mips_repl_ph (imm_n512_511)
+ v2q15 __builtin_mips_repl_ph (i32)
+ void __builtin_mips_cmpu_eq_qb (v4i8, v4i8)
+ void __builtin_mips_cmpu_lt_qb (v4i8, v4i8)
+ void __builtin_mips_cmpu_le_qb (v4i8, v4i8)
+ i32 __builtin_mips_cmpgu_eq_qb (v4i8, v4i8)
+ i32 __builtin_mips_cmpgu_lt_qb (v4i8, v4i8)
+ i32 __builtin_mips_cmpgu_le_qb (v4i8, v4i8)
+ void __builtin_mips_cmp_eq_ph (v2q15, v2q15)
+ void __builtin_mips_cmp_lt_ph (v2q15, v2q15)
+ void __builtin_mips_cmp_le_ph (v2q15, v2q15)
+ v4i8 __builtin_mips_pick_qb (v4i8, v4i8)
+ v2q15 __builtin_mips_pick_ph (v2q15, v2q15)
+ v2q15 __builtin_mips_packrl_ph (v2q15, v2q15)
+ i32 __builtin_mips_extr_w (a64, imm0_31)
+ i32 __builtin_mips_extr_w (a64, i32)
+ i32 __builtin_mips_extr_r_w (a64, imm0_31)
+ i32 __builtin_mips_extr_s_h (a64, i32)
+ i32 __builtin_mips_extr_rs_w (a64, imm0_31)
+ i32 __builtin_mips_extr_rs_w (a64, i32)
+ i32 __builtin_mips_extr_s_h (a64, imm0_31)
+ i32 __builtin_mips_extr_r_w (a64, i32)
+ i32 __builtin_mips_extp (a64, imm0_31)
+ i32 __builtin_mips_extp (a64, i32)
+ i32 __builtin_mips_extpdp (a64, imm0_31)
+ i32 __builtin_mips_extpdp (a64, i32)
+ a64 __builtin_mips_shilo (a64, imm_n32_31)
+ a64 __builtin_mips_shilo (a64, i32)
+ a64 __builtin_mips_mthlip (a64, i32)
+ void __builtin_mips_wrdsp (i32, imm0_63)
+ i32 __builtin_mips_rddsp (imm0_63)
+ i32 __builtin_mips_lbux (void *, i32)
+ i32 __builtin_mips_lhx (void *, i32)
+ i32 __builtin_mips_lwx (void *, i32)
+ i32 __builtin_mips_bposge32 (void)
+
+ The following built-in functions map directly to a particular MIPS DSP
+REV 2 instruction. Please refer to the architecture specification for
+details on what each instruction does.
+
+ v4q7 __builtin_mips_absq_s_qb (v4q7);
+ v2i16 __builtin_mips_addu_ph (v2i16, v2i16);
+ v2i16 __builtin_mips_addu_s_ph (v2i16, v2i16);
+ v4i8 __builtin_mips_adduh_qb (v4i8, v4i8);
+ v4i8 __builtin_mips_adduh_r_qb (v4i8, v4i8);
+ i32 __builtin_mips_append (i32, i32, imm0_31);
+ i32 __builtin_mips_balign (i32, i32, imm0_3);
+ i32 __builtin_mips_cmpgdu_eq_qb (v4i8, v4i8);
+ i32 __builtin_mips_cmpgdu_lt_qb (v4i8, v4i8);
+ i32 __builtin_mips_cmpgdu_le_qb (v4i8, v4i8);
+ a64 __builtin_mips_dpa_w_ph (a64, v2i16, v2i16);
+ a64 __builtin_mips_dps_w_ph (a64, v2i16, v2i16);
+ a64 __builtin_mips_madd (a64, i32, i32);
+ a64 __builtin_mips_maddu (a64, ui32, ui32);
+ a64 __builtin_mips_msub (a64, i32, i32);
+ a64 __builtin_mips_msubu (a64, ui32, ui32);
+ v2i16 __builtin_mips_mul_ph (v2i16, v2i16);
+ v2i16 __builtin_mips_mul_s_ph (v2i16, v2i16);
+ q31 __builtin_mips_mulq_rs_w (q31, q31);
+ v2q15 __builtin_mips_mulq_s_ph (v2q15, v2q15);
+ q31 __builtin_mips_mulq_s_w (q31, q31);
+ a64 __builtin_mips_mulsa_w_ph (a64, v2i16, v2i16);
+ a64 __builtin_mips_mult (i32, i32);
+ a64 __builtin_mips_multu (ui32, ui32);
+ v4i8 __builtin_mips_precr_qb_ph (v2i16, v2i16);
+ v2i16 __builtin_mips_precr_sra_ph_w (i32, i32, imm0_31);
+ v2i16 __builtin_mips_precr_sra_r_ph_w (i32, i32, imm0_31);
+ i32 __builtin_mips_prepend (i32, i32, imm0_31);
+ v4i8 __builtin_mips_shra_qb (v4i8, imm0_7);
+ v4i8 __builtin_mips_shra_r_qb (v4i8, imm0_7);
+ v4i8 __builtin_mips_shra_qb (v4i8, i32);
+ v4i8 __builtin_mips_shra_r_qb (v4i8, i32);
+ v2i16 __builtin_mips_shrl_ph (v2i16, imm0_15);
+ v2i16 __builtin_mips_shrl_ph (v2i16, i32);
+ v2i16 __builtin_mips_subu_ph (v2i16, v2i16);
+ v2i16 __builtin_mips_subu_s_ph (v2i16, v2i16);
+ v4i8 __builtin_mips_subuh_qb (v4i8, v4i8);
+ v4i8 __builtin_mips_subuh_r_qb (v4i8, v4i8);
+ v2q15 __builtin_mips_addqh_ph (v2q15, v2q15);
+ v2q15 __builtin_mips_addqh_r_ph (v2q15, v2q15);
+ q31 __builtin_mips_addqh_w (q31, q31);
+ q31 __builtin_mips_addqh_r_w (q31, q31);
+ v2q15 __builtin_mips_subqh_ph (v2q15, v2q15);
+ v2q15 __builtin_mips_subqh_r_ph (v2q15, v2q15);
+ q31 __builtin_mips_subqh_w (q31, q31);
+ q31 __builtin_mips_subqh_r_w (q31, q31);
+ a64 __builtin_mips_dpax_w_ph (a64, v2i16, v2i16);
+ a64 __builtin_mips_dpsx_w_ph (a64, v2i16, v2i16);
+ a64 __builtin_mips_dpaqx_s_w_ph (a64, v2q15, v2q15);
+ a64 __builtin_mips_dpaqx_sa_w_ph (a64, v2q15, v2q15);
+ a64 __builtin_mips_dpsqx_s_w_ph (a64, v2q15, v2q15);
+ a64 __builtin_mips_dpsqx_sa_w_ph (a64, v2q15, v2q15);
+
+
+File: gcc.info, Node: MIPS Paired-Single Support, Next: MIPS Loongson Built-in Functions, Prev: MIPS DSP Built-in Functions, Up: Target Builtins
+
+5.50.8 MIPS Paired-Single Support
+---------------------------------
+
+The MIPS64 architecture includes a number of instructions that operate
+on pairs of single-precision floating-point values. Each pair is
+packed into a 64-bit floating-point register, with one element being
+designated the "upper half" and the other being designated the "lower
+half".
+
+ GCC supports paired-single operations using both the generic vector
+extensions (*note Vector Extensions::) and a collection of
+MIPS-specific built-in functions. Both kinds of support are enabled by
+the `-mpaired-single' command-line option.
+
+ The vector type associated with paired-single values is usually called
+`v2sf'. It can be defined in C as follows:
+
+ typedef float v2sf __attribute__ ((vector_size (8)));
+
+ `v2sf' values are initialized in the same way as aggregates. For
+example:
+
+ v2sf a = {1.5, 9.1};
+ v2sf b;
+ float e, f;
+ b = (v2sf) {e, f};
+
+ _Note:_ The CPU's endianness determines which value is stored in the
+upper half of a register and which value is stored in the lower half.
+On little-endian targets, the first value is the lower one and the
+second value is the upper one. The opposite order applies to
+big-endian targets. For example, the code above will set the lower
+half of `a' to `1.5' on little-endian targets and `9.1' on big-endian
+targets.
+
+
+File: gcc.info, Node: MIPS Loongson Built-in Functions, Next: Other MIPS Built-in Functions, Prev: MIPS Paired-Single Support, Up: Target Builtins
+
+5.50.9 MIPS Loongson Built-in Functions
+---------------------------------------
+
+GCC provides intrinsics to access the SIMD instructions provided by the
+ST Microelectronics Loongson-2E and -2F processors. These intrinsics,
+available after inclusion of the `loongson.h' header file, operate on
+the following 64-bit vector types:
+
+ * `uint8x8_t', a vector of eight unsigned 8-bit integers;
+
+ * `uint16x4_t', a vector of four unsigned 16-bit integers;
+
+ * `uint32x2_t', a vector of two unsigned 32-bit integers;
+
+ * `int8x8_t', a vector of eight signed 8-bit integers;
+
+ * `int16x4_t', a vector of four signed 16-bit integers;
+
+ * `int32x2_t', a vector of two signed 32-bit integers.
+
+ The intrinsics provided are listed below; each is named after the
+machine instruction to which it corresponds, with suffixes added as
+appropriate to distinguish intrinsics that expand to the same machine
+instruction yet have different argument types. Refer to the
+architecture documentation for a description of the functionality of
+each instruction.
+
+ int16x4_t packsswh (int32x2_t s, int32x2_t t);
+ int8x8_t packsshb (int16x4_t s, int16x4_t t);
+ uint8x8_t packushb (uint16x4_t s, uint16x4_t t);
+ uint32x2_t paddw_u (uint32x2_t s, uint32x2_t t);
+ uint16x4_t paddh_u (uint16x4_t s, uint16x4_t t);
+ uint8x8_t paddb_u (uint8x8_t s, uint8x8_t t);
+ int32x2_t paddw_s (int32x2_t s, int32x2_t t);
+ int16x4_t paddh_s (int16x4_t s, int16x4_t t);
+ int8x8_t paddb_s (int8x8_t s, int8x8_t t);
+ uint64_t paddd_u (uint64_t s, uint64_t t);
+ int64_t paddd_s (int64_t s, int64_t t);
+ int16x4_t paddsh (int16x4_t s, int16x4_t t);
+ int8x8_t paddsb (int8x8_t s, int8x8_t t);
+ uint16x4_t paddush (uint16x4_t s, uint16x4_t t);
+ uint8x8_t paddusb (uint8x8_t s, uint8x8_t t);
+ uint64_t pandn_ud (uint64_t s, uint64_t t);
+ uint32x2_t pandn_uw (uint32x2_t s, uint32x2_t t);
+ uint16x4_t pandn_uh (uint16x4_t s, uint16x4_t t);
+ uint8x8_t pandn_ub (uint8x8_t s, uint8x8_t t);
+ int64_t pandn_sd (int64_t s, int64_t t);
+ int32x2_t pandn_sw (int32x2_t s, int32x2_t t);
+ int16x4_t pandn_sh (int16x4_t s, int16x4_t t);
+ int8x8_t pandn_sb (int8x8_t s, int8x8_t t);
+ uint16x4_t pavgh (uint16x4_t s, uint16x4_t t);
+ uint8x8_t pavgb (uint8x8_t s, uint8x8_t t);
+ uint32x2_t pcmpeqw_u (uint32x2_t s, uint32x2_t t);
+ uint16x4_t pcmpeqh_u (uint16x4_t s, uint16x4_t t);
+ uint8x8_t pcmpeqb_u (uint8x8_t s, uint8x8_t t);
+ int32x2_t pcmpeqw_s (int32x2_t s, int32x2_t t);
+ int16x4_t pcmpeqh_s (int16x4_t s, int16x4_t t);
+ int8x8_t pcmpeqb_s (int8x8_t s, int8x8_t t);
+ uint32x2_t pcmpgtw_u (uint32x2_t s, uint32x2_t t);
+ uint16x4_t pcmpgth_u (uint16x4_t s, uint16x4_t t);
+ uint8x8_t pcmpgtb_u (uint8x8_t s, uint8x8_t t);
+ int32x2_t pcmpgtw_s (int32x2_t s, int32x2_t t);
+ int16x4_t pcmpgth_s (int16x4_t s, int16x4_t t);
+ int8x8_t pcmpgtb_s (int8x8_t s, int8x8_t t);
+ uint16x4_t pextrh_u (uint16x4_t s, int field);
+ int16x4_t pextrh_s (int16x4_t s, int field);
+ uint16x4_t pinsrh_0_u (uint16x4_t s, uint16x4_t t);
+ uint16x4_t pinsrh_1_u (uint16x4_t s, uint16x4_t t);
+ uint16x4_t pinsrh_2_u (uint16x4_t s, uint16x4_t t);
+ uint16x4_t pinsrh_3_u (uint16x4_t s, uint16x4_t t);
+ int16x4_t pinsrh_0_s (int16x4_t s, int16x4_t t);
+ int16x4_t pinsrh_1_s (int16x4_t s, int16x4_t t);
+ int16x4_t pinsrh_2_s (int16x4_t s, int16x4_t t);
+ int16x4_t pinsrh_3_s (int16x4_t s, int16x4_t t);
+ int32x2_t pmaddhw (int16x4_t s, int16x4_t t);
+ int16x4_t pmaxsh (int16x4_t s, int16x4_t t);
+ uint8x8_t pmaxub (uint8x8_t s, uint8x8_t t);
+ int16x4_t pminsh (int16x4_t s, int16x4_t t);
+ uint8x8_t pminub (uint8x8_t s, uint8x8_t t);
+ uint8x8_t pmovmskb_u (uint8x8_t s);
+ int8x8_t pmovmskb_s (int8x8_t s);
+ uint16x4_t pmulhuh (uint16x4_t s, uint16x4_t t);
+ int16x4_t pmulhh (int16x4_t s, int16x4_t t);
+ int16x4_t pmullh (int16x4_t s, int16x4_t t);
+ int64_t pmuluw (uint32x2_t s, uint32x2_t t);
+ uint8x8_t pasubub (uint8x8_t s, uint8x8_t t);
+ uint16x4_t biadd (uint8x8_t s);
+ uint16x4_t psadbh (uint8x8_t s, uint8x8_t t);
+ uint16x4_t pshufh_u (uint16x4_t dest, uint16x4_t s, uint8_t order);
+ int16x4_t pshufh_s (int16x4_t dest, int16x4_t s, uint8_t order);
+ uint16x4_t psllh_u (uint16x4_t s, uint8_t amount);
+ int16x4_t psllh_s (int16x4_t s, uint8_t amount);
+ uint32x2_t psllw_u (uint32x2_t s, uint8_t amount);
+ int32x2_t psllw_s (int32x2_t s, uint8_t amount);
+ uint16x4_t psrlh_u (uint16x4_t s, uint8_t amount);
+ int16x4_t psrlh_s (int16x4_t s, uint8_t amount);
+ uint32x2_t psrlw_u (uint32x2_t s, uint8_t amount);
+ int32x2_t psrlw_s (int32x2_t s, uint8_t amount);
+ uint16x4_t psrah_u (uint16x4_t s, uint8_t amount);
+ int16x4_t psrah_s (int16x4_t s, uint8_t amount);
+ uint32x2_t psraw_u (uint32x2_t s, uint8_t amount);
+ int32x2_t psraw_s (int32x2_t s, uint8_t amount);
+ uint32x2_t psubw_u (uint32x2_t s, uint32x2_t t);
+ uint16x4_t psubh_u (uint16x4_t s, uint16x4_t t);
+ uint8x8_t psubb_u (uint8x8_t s, uint8x8_t t);
+ int32x2_t psubw_s (int32x2_t s, int32x2_t t);
+ int16x4_t psubh_s (int16x4_t s, int16x4_t t);
+ int8x8_t psubb_s (int8x8_t s, int8x8_t t);
+ uint64_t psubd_u (uint64_t s, uint64_t t);
+ int64_t psubd_s (int64_t s, int64_t t);
+ int16x4_t psubsh (int16x4_t s, int16x4_t t);
+ int8x8_t psubsb (int8x8_t s, int8x8_t t);
+ uint16x4_t psubush (uint16x4_t s, uint16x4_t t);
+ uint8x8_t psubusb (uint8x8_t s, uint8x8_t t);
+ uint32x2_t punpckhwd_u (uint32x2_t s, uint32x2_t t);
+ uint16x4_t punpckhhw_u (uint16x4_t s, uint16x4_t t);
+ uint8x8_t punpckhbh_u (uint8x8_t s, uint8x8_t t);
+ int32x2_t punpckhwd_s (int32x2_t s, int32x2_t t);
+ int16x4_t punpckhhw_s (int16x4_t s, int16x4_t t);
+ int8x8_t punpckhbh_s (int8x8_t s, int8x8_t t);
+ uint32x2_t punpcklwd_u (uint32x2_t s, uint32x2_t t);
+ uint16x4_t punpcklhw_u (uint16x4_t s, uint16x4_t t);
+ uint8x8_t punpcklbh_u (uint8x8_t s, uint8x8_t t);
+ int32x2_t punpcklwd_s (int32x2_t s, int32x2_t t);
+ int16x4_t punpcklhw_s (int16x4_t s, int16x4_t t);
+ int8x8_t punpcklbh_s (int8x8_t s, int8x8_t t);
+
+* Menu:
+
+* Paired-Single Arithmetic::
+* Paired-Single Built-in Functions::
+* MIPS-3D Built-in Functions::
+
+
+File: gcc.info, Node: Paired-Single Arithmetic, Next: Paired-Single Built-in Functions, Up: MIPS Loongson Built-in Functions
+
+5.50.9.1 Paired-Single Arithmetic
+.................................
+
+The table below lists the `v2sf' operations for which hardware support
+exists. `a', `b' and `c' are `v2sf' values and `x' is an integral
+value.
+
+C code MIPS instruction
+`a + b' `add.ps'
+`a - b' `sub.ps'
+`-a' `neg.ps'
+`a * b' `mul.ps'
+`a * b + c' `madd.ps'
+`a * b - c' `msub.ps'
+`-(a * b + c)' `nmadd.ps'
+`-(a * b - c)' `nmsub.ps'
+`x ? a : b' `movn.ps'/`movz.ps'
+
+ Note that the multiply-accumulate instructions can be disabled using
+the command-line option `-mno-fused-madd'.
+
+
+File: gcc.info, Node: Paired-Single Built-in Functions, Next: MIPS-3D Built-in Functions, Prev: Paired-Single Arithmetic, Up: MIPS Loongson Built-in Functions
+
+5.50.9.2 Paired-Single Built-in Functions
+.........................................
+
+The following paired-single functions map directly to a particular MIPS
+instruction. Please refer to the architecture specification for
+details on what each instruction does.
+
+`v2sf __builtin_mips_pll_ps (v2sf, v2sf)'
+ Pair lower lower (`pll.ps').
+
+`v2sf __builtin_mips_pul_ps (v2sf, v2sf)'
+ Pair upper lower (`pul.ps').
+
+`v2sf __builtin_mips_plu_ps (v2sf, v2sf)'
+ Pair lower upper (`plu.ps').
+
+`v2sf __builtin_mips_puu_ps (v2sf, v2sf)'
+ Pair upper upper (`puu.ps').
+
+`v2sf __builtin_mips_cvt_ps_s (float, float)'
+ Convert pair to paired single (`cvt.ps.s').
+
+`float __builtin_mips_cvt_s_pl (v2sf)'
+ Convert pair lower to single (`cvt.s.pl').
+
+`float __builtin_mips_cvt_s_pu (v2sf)'
+ Convert pair upper to single (`cvt.s.pu').
+
+`v2sf __builtin_mips_abs_ps (v2sf)'
+ Absolute value (`abs.ps').
+
+`v2sf __builtin_mips_alnv_ps (v2sf, v2sf, int)'
+ Align variable (`alnv.ps').
+
+ _Note:_ The value of the third parameter must be 0 or 4 modulo 8,
+ otherwise the result will be unpredictable. Please read the
+ instruction description for details.
+
+ The following multi-instruction functions are also available. In each
+case, COND can be any of the 16 floating-point conditions: `f', `un',
+`eq', `ueq', `olt', `ult', `ole', `ule', `sf', `ngle', `seq', `ngl',
+`lt', `nge', `le' or `ngt'.
+
+`v2sf __builtin_mips_movt_c_COND_ps (v2sf A, v2sf B, v2sf C, v2sf D)'
+`v2sf __builtin_mips_movf_c_COND_ps (v2sf A, v2sf B, v2sf C, v2sf D)'
+ Conditional move based on floating point comparison (`c.COND.ps',
+ `movt.ps'/`movf.ps').
+
+ The `movt' functions return the value X computed by:
+
+ c.COND.ps CC,A,B
+ mov.ps X,C
+ movt.ps X,D,CC
+
+ The `movf' functions are similar but use `movf.ps' instead of
+ `movt.ps'.
+
+`int __builtin_mips_upper_c_COND_ps (v2sf A, v2sf B)'
+`int __builtin_mips_lower_c_COND_ps (v2sf A, v2sf B)'
+ Comparison of two paired-single values (`c.COND.ps',
+ `bc1t'/`bc1f').
+
+ These functions compare A and B using `c.COND.ps' and return
+ either the upper or lower half of the result. For example:
+
+ v2sf a, b;
+ if (__builtin_mips_upper_c_eq_ps (a, b))
+ upper_halves_are_equal ();
+ else
+ upper_halves_are_unequal ();
+
+ if (__builtin_mips_lower_c_eq_ps (a, b))
+ lower_halves_are_equal ();
+ else
+ lower_halves_are_unequal ();
+
+
+File: gcc.info, Node: MIPS-3D Built-in Functions, Prev: Paired-Single Built-in Functions, Up: MIPS Loongson Built-in Functions
+
+5.50.9.3 MIPS-3D Built-in Functions
+...................................
+
+The MIPS-3D Application-Specific Extension (ASE) includes additional
+paired-single instructions that are designed to improve the performance
+of 3D graphics operations. Support for these instructions is controlled
+by the `-mips3d' command-line option.
+
+ The functions listed below map directly to a particular MIPS-3D
+instruction. Please refer to the architecture specification for more
+details on what each instruction does.
+
+`v2sf __builtin_mips_addr_ps (v2sf, v2sf)'
+ Reduction add (`addr.ps').
+
+`v2sf __builtin_mips_mulr_ps (v2sf, v2sf)'
+ Reduction multiply (`mulr.ps').
+
+`v2sf __builtin_mips_cvt_pw_ps (v2sf)'
+ Convert paired single to paired word (`cvt.pw.ps').
+
+`v2sf __builtin_mips_cvt_ps_pw (v2sf)'
+ Convert paired word to paired single (`cvt.ps.pw').
+
+`float __builtin_mips_recip1_s (float)'
+`double __builtin_mips_recip1_d (double)'
+`v2sf __builtin_mips_recip1_ps (v2sf)'
+ Reduced precision reciprocal (sequence step 1) (`recip1.FMT').
+
+`float __builtin_mips_recip2_s (float, float)'
+`double __builtin_mips_recip2_d (double, double)'
+`v2sf __builtin_mips_recip2_ps (v2sf, v2sf)'
+ Reduced precision reciprocal (sequence step 2) (`recip2.FMT').
+
+`float __builtin_mips_rsqrt1_s (float)'
+`double __builtin_mips_rsqrt1_d (double)'
+`v2sf __builtin_mips_rsqrt1_ps (v2sf)'
+ Reduced precision reciprocal square root (sequence step 1)
+ (`rsqrt1.FMT').
+
+`float __builtin_mips_rsqrt2_s (float, float)'
+`double __builtin_mips_rsqrt2_d (double, double)'
+`v2sf __builtin_mips_rsqrt2_ps (v2sf, v2sf)'
+ Reduced precision reciprocal square root (sequence step 2)
+ (`rsqrt2.FMT').
+
+ The following multi-instruction functions are also available. In each
+case, COND can be any of the 16 floating-point conditions: `f', `un',
+`eq', `ueq', `olt', `ult', `ole', `ule', `sf', `ngle', `seq', `ngl',
+`lt', `nge', `le' or `ngt'.
+
+`int __builtin_mips_cabs_COND_s (float A, float B)'
+`int __builtin_mips_cabs_COND_d (double A, double B)'
+ Absolute comparison of two scalar values (`cabs.COND.FMT',
+ `bc1t'/`bc1f').
+
+ These functions compare A and B using `cabs.COND.s' or
+ `cabs.COND.d' and return the result as a boolean value. For
+ example:
+
+ float a, b;
+ if (__builtin_mips_cabs_eq_s (a, b))
+ true ();
+ else
+ false ();
+
+`int __builtin_mips_upper_cabs_COND_ps (v2sf A, v2sf B)'
+`int __builtin_mips_lower_cabs_COND_ps (v2sf A, v2sf B)'
+ Absolute comparison of two paired-single values (`cabs.COND.ps',
+ `bc1t'/`bc1f').
+
+ These functions compare A and B using `cabs.COND.ps' and return
+ either the upper or lower half of the result. For example:
+
+ v2sf a, b;
+ if (__builtin_mips_upper_cabs_eq_ps (a, b))
+ upper_halves_are_equal ();
+ else
+ upper_halves_are_unequal ();
+
+ if (__builtin_mips_lower_cabs_eq_ps (a, b))
+ lower_halves_are_equal ();
+ else
+ lower_halves_are_unequal ();
+
+`v2sf __builtin_mips_movt_cabs_COND_ps (v2sf A, v2sf B, v2sf C, v2sf D)'
+`v2sf __builtin_mips_movf_cabs_COND_ps (v2sf A, v2sf B, v2sf C, v2sf D)'
+ Conditional move based on absolute comparison (`cabs.COND.ps',
+ `movt.ps'/`movf.ps').
+
+ The `movt' functions return the value X computed by:
+
+ cabs.COND.ps CC,A,B
+ mov.ps X,C
+ movt.ps X,D,CC
+
+ The `movf' functions are similar but use `movf.ps' instead of
+ `movt.ps'.
+
+`int __builtin_mips_any_c_COND_ps (v2sf A, v2sf B)'
+`int __builtin_mips_all_c_COND_ps (v2sf A, v2sf B)'
+`int __builtin_mips_any_cabs_COND_ps (v2sf A, v2sf B)'
+`int __builtin_mips_all_cabs_COND_ps (v2sf A, v2sf B)'
+ Comparison of two paired-single values (`c.COND.ps'/`cabs.COND.ps',
+ `bc1any2t'/`bc1any2f').
+
+ These functions compare A and B using `c.COND.ps' or
+ `cabs.COND.ps'. The `any' forms return true if either result is
+ true and the `all' forms return true if both results are true.
+ For example:
+
+ v2sf a, b;
+ if (__builtin_mips_any_c_eq_ps (a, b))
+ one_is_true ();
+ else
+ both_are_false ();
+
+ if (__builtin_mips_all_c_eq_ps (a, b))
+ both_are_true ();
+ else
+ one_is_false ();
+
+`int __builtin_mips_any_c_COND_4s (v2sf A, v2sf B, v2sf C, v2sf D)'
+`int __builtin_mips_all_c_COND_4s (v2sf A, v2sf B, v2sf C, v2sf D)'
+`int __builtin_mips_any_cabs_COND_4s (v2sf A, v2sf B, v2sf C, v2sf D)'
+`int __builtin_mips_all_cabs_COND_4s (v2sf A, v2sf B, v2sf C, v2sf D)'
+ Comparison of four paired-single values
+ (`c.COND.ps'/`cabs.COND.ps', `bc1any4t'/`bc1any4f').
+
+ These functions use `c.COND.ps' or `cabs.COND.ps' to compare A
+ with B and to compare C with D. The `any' forms return true if
+ any of the four results are true and the `all' forms return true
+ if all four results are true. For example:
+
+ v2sf a, b, c, d;
+ if (__builtin_mips_any_c_eq_4s (a, b, c, d))
+ some_are_true ();
+ else
+ all_are_false ();
+
+ if (__builtin_mips_all_c_eq_4s (a, b, c, d))
+ all_are_true ();
+ else
+ some_are_false ();
+
+
+File: gcc.info, Node: picoChip Built-in Functions, Next: PowerPC AltiVec Built-in Functions, Prev: Other MIPS Built-in Functions, Up: Target Builtins
+
+5.50.10 picoChip Built-in Functions
+-----------------------------------
+
+GCC provides an interface to selected machine instructions from the
+picoChip instruction set.
+
+`int __builtin_sbc (int VALUE)'
+ Sign bit count. Return the number of consecutive bits in VALUE
+ which have the same value as the sign-bit. The result is the
+ number of leading sign bits minus one, giving the number of
+ redundant sign bits in VALUE.
+
+`int __builtin_byteswap (int VALUE)'
+ Byte swap. Return the result of swapping the upper and lower
+ bytes of VALUE.
+
+`int __builtin_brev (int VALUE)'
+ Bit reversal. Return the result of reversing the bits in VALUE.
+ Bit 15 is swapped with bit 0, bit 14 is swapped with bit 1, and so
+ on.
+
+`int __builtin_adds (int X, int Y)'
+ Saturating addition. Return the result of adding X and Y, storing
+ the value 32767 if the result overflows.
+
+`int __builtin_subs (int X, int Y)'
+ Saturating subtraction. Return the result of subtracting Y from
+ X, storing the value -32768 if the result overflows.
+
+`void __builtin_halt (void)'
+ Halt. The processor will stop execution. This built-in is useful
+ for implementing assertions.
+
+
+
+File: gcc.info, Node: Other MIPS Built-in Functions, Next: picoChip Built-in Functions, Prev: MIPS Loongson Built-in Functions, Up: Target Builtins
+
+5.50.11 Other MIPS Built-in Functions
+-------------------------------------
+
+GCC provides other MIPS-specific built-in functions:
+
+`void __builtin_mips_cache (int OP, const volatile void *ADDR)'
+ Insert a `cache' instruction with operands OP and ADDR. GCC
+ defines the preprocessor macro `___GCC_HAVE_BUILTIN_MIPS_CACHE'
+ when this function is available.
+
+
+File: gcc.info, Node: PowerPC AltiVec Built-in Functions, Next: SPARC VIS Built-in Functions, Prev: picoChip Built-in Functions, Up: Target Builtins
+
+5.50.12 PowerPC AltiVec Built-in Functions
+------------------------------------------
+
+GCC provides an interface for the PowerPC family of processors to access
+the AltiVec operations described in Motorola's AltiVec Programming
+Interface Manual. The interface is made available by including
+`<altivec.h>' and using `-maltivec' and `-mabi=altivec'. The interface
+supports the following vector types.
+
+ vector unsigned char
+ vector signed char
+ vector bool char
+
+ vector unsigned short
+ vector signed short
+ vector bool short
+ vector pixel
+
+ vector unsigned int
+ vector signed int
+ vector bool int
+ vector float
+
+ GCC's implementation of the high-level language interface available
+from C and C++ code differs from Motorola's documentation in several
+ways.
+
+ * A vector constant is a list of constant expressions within curly
+ braces.
+
+ * A vector initializer requires no cast if the vector constant is of
+ the same type as the variable it is initializing.
+
+ * If `signed' or `unsigned' is omitted, the signedness of the vector
+ type is the default signedness of the base type. The default
+ varies depending on the operating system, so a portable program
+ should always specify the signedness.
+
+ * Compiling with `-maltivec' adds keywords `__vector', `vector',
+ `__pixel', `pixel', `__bool' and `bool'. When compiling ISO C,
+ the context-sensitive substitution of the keywords `vector',
+ `pixel' and `bool' is disabled. To use them, you must include
+ `<altivec.h>' instead.
+
+ * GCC allows using a `typedef' name as the type specifier for a
+ vector type.
+
+ * For C, overloaded functions are implemented with macros so the
+ following does not work:
+
+ vec_add ((vector signed int){1, 2, 3, 4}, foo);
+
+ Since `vec_add' is a macro, the vector constant in the example is
+ treated as four separate arguments. Wrap the entire argument in
+ parentheses for this to work.
+
+ _Note:_ Only the `<altivec.h>' interface is supported. Internally,
+GCC uses built-in functions to achieve the functionality in the
+aforementioned header file, but they are not supported and are subject
+to change without notice.
+
+ The following interfaces are supported for the generic and specific
+AltiVec operations and the AltiVec predicates. In cases where there is
+a direct mapping between generic and specific operations, only the
+generic names are shown here, although the specific operations can also
+be used.
+
+ Arguments that are documented as `const int' require literal integral
+values within the range required for that operation.
+
+ vector signed char vec_abs (vector signed char);
+ vector signed short vec_abs (vector signed short);
+ vector signed int vec_abs (vector signed int);
+ vector float vec_abs (vector float);
+
+ vector signed char vec_abss (vector signed char);
+ vector signed short vec_abss (vector signed short);
+ vector signed int vec_abss (vector signed int);
+
+ vector signed char vec_add (vector bool char, vector signed char);
+ vector signed char vec_add (vector signed char, vector bool char);
+ vector signed char vec_add (vector signed char, vector signed char);
+ vector unsigned char vec_add (vector bool char, vector unsigned char);
+ vector unsigned char vec_add (vector unsigned char, vector bool char);
+ vector unsigned char vec_add (vector unsigned char,
+ vector unsigned char);
+ vector signed short vec_add (vector bool short, vector signed short);
+ vector signed short vec_add (vector signed short, vector bool short);
+ vector signed short vec_add (vector signed short, vector signed short);
+ vector unsigned short vec_add (vector bool short,
+ vector unsigned short);
+ vector unsigned short vec_add (vector unsigned short,
+ vector bool short);
+ vector unsigned short vec_add (vector unsigned short,
+ vector unsigned short);
+ vector signed int vec_add (vector bool int, vector signed int);
+ vector signed int vec_add (vector signed int, vector bool int);
+ vector signed int vec_add (vector signed int, vector signed int);
+ vector unsigned int vec_add (vector bool int, vector unsigned int);
+ vector unsigned int vec_add (vector unsigned int, vector bool int);
+ vector unsigned int vec_add (vector unsigned int, vector unsigned int);
+ vector float vec_add (vector float, vector float);
+
+ vector float vec_vaddfp (vector float, vector float);
+
+ vector signed int vec_vadduwm (vector bool int, vector signed int);
+ vector signed int vec_vadduwm (vector signed int, vector bool int);
+ vector signed int vec_vadduwm (vector signed int, vector signed int);
+ vector unsigned int vec_vadduwm (vector bool int, vector unsigned int);
+ vector unsigned int vec_vadduwm (vector unsigned int, vector bool int);
+ vector unsigned int vec_vadduwm (vector unsigned int,
+ vector unsigned int);
+
+ vector signed short vec_vadduhm (vector bool short,
+ vector signed short);
+ vector signed short vec_vadduhm (vector signed short,
+ vector bool short);
+ vector signed short vec_vadduhm (vector signed short,
+ vector signed short);
+ vector unsigned short vec_vadduhm (vector bool short,
+ vector unsigned short);
+ vector unsigned short vec_vadduhm (vector unsigned short,
+ vector bool short);
+ vector unsigned short vec_vadduhm (vector unsigned short,
+ vector unsigned short);
+
+ vector signed char vec_vaddubm (vector bool char, vector signed char);
+ vector signed char vec_vaddubm (vector signed char, vector bool char);
+ vector signed char vec_vaddubm (vector signed char, vector signed char);
+ vector unsigned char vec_vaddubm (vector bool char,
+ vector unsigned char);
+ vector unsigned char vec_vaddubm (vector unsigned char,
+ vector bool char);
+ vector unsigned char vec_vaddubm (vector unsigned char,
+ vector unsigned char);
+
+ vector unsigned int vec_addc (vector unsigned int, vector unsigned int);
+
+ vector unsigned char vec_adds (vector bool char, vector unsigned char);
+ vector unsigned char vec_adds (vector unsigned char, vector bool char);
+ vector unsigned char vec_adds (vector unsigned char,
+ vector unsigned char);
+ vector signed char vec_adds (vector bool char, vector signed char);
+ vector signed char vec_adds (vector signed char, vector bool char);
+ vector signed char vec_adds (vector signed char, vector signed char);
+ vector unsigned short vec_adds (vector bool short,
+ vector unsigned short);
+ vector unsigned short vec_adds (vector unsigned short,
+ vector bool short);
+ vector unsigned short vec_adds (vector unsigned short,
+ vector unsigned short);
+ vector signed short vec_adds (vector bool short, vector signed short);
+ vector signed short vec_adds (vector signed short, vector bool short);
+ vector signed short vec_adds (vector signed short, vector signed short);
+ vector unsigned int vec_adds (vector bool int, vector unsigned int);
+ vector unsigned int vec_adds (vector unsigned int, vector bool int);
+ vector unsigned int vec_adds (vector unsigned int, vector unsigned int);
+ vector signed int vec_adds (vector bool int, vector signed int);
+ vector signed int vec_adds (vector signed int, vector bool int);
+ vector signed int vec_adds (vector signed int, vector signed int);
+
+ vector signed int vec_vaddsws (vector bool int, vector signed int);
+ vector signed int vec_vaddsws (vector signed int, vector bool int);
+ vector signed int vec_vaddsws (vector signed int, vector signed int);
+
+ vector unsigned int vec_vadduws (vector bool int, vector unsigned int);
+ vector unsigned int vec_vadduws (vector unsigned int, vector bool int);
+ vector unsigned int vec_vadduws (vector unsigned int,
+ vector unsigned int);
+
+ vector signed short vec_vaddshs (vector bool short,
+ vector signed short);
+ vector signed short vec_vaddshs (vector signed short,
+ vector bool short);
+ vector signed short vec_vaddshs (vector signed short,
+ vector signed short);
+
+ vector unsigned short vec_vadduhs (vector bool short,
+ vector unsigned short);
+ vector unsigned short vec_vadduhs (vector unsigned short,
+ vector bool short);
+ vector unsigned short vec_vadduhs (vector unsigned short,
+ vector unsigned short);
+
+ vector signed char vec_vaddsbs (vector bool char, vector signed char);
+ vector signed char vec_vaddsbs (vector signed char, vector bool char);
+ vector signed char vec_vaddsbs (vector signed char, vector signed char);
+
+ vector unsigned char vec_vaddubs (vector bool char,
+ vector unsigned char);
+ vector unsigned char vec_vaddubs (vector unsigned char,
+ vector bool char);
+ vector unsigned char vec_vaddubs (vector unsigned char,
+ vector unsigned char);
+
+ vector float vec_and (vector float, vector float);
+ vector float vec_and (vector float, vector bool int);
+ vector float vec_and (vector bool int, vector float);
+ vector bool int vec_and (vector bool int, vector bool int);
+ vector signed int vec_and (vector bool int, vector signed int);
+ vector signed int vec_and (vector signed int, vector bool int);
+ vector signed int vec_and (vector signed int, vector signed int);
+ vector unsigned int vec_and (vector bool int, vector unsigned int);
+ vector unsigned int vec_and (vector unsigned int, vector bool int);
+ vector unsigned int vec_and (vector unsigned int, vector unsigned int);
+ vector bool short vec_and (vector bool short, vector bool short);
+ vector signed short vec_and (vector bool short, vector signed short);
+ vector signed short vec_and (vector signed short, vector bool short);
+ vector signed short vec_and (vector signed short, vector signed short);
+ vector unsigned short vec_and (vector bool short,
+ vector unsigned short);
+ vector unsigned short vec_and (vector unsigned short,
+ vector bool short);
+ vector unsigned short vec_and (vector unsigned short,
+ vector unsigned short);
+ vector signed char vec_and (vector bool char, vector signed char);
+ vector bool char vec_and (vector bool char, vector bool char);
+ vector signed char vec_and (vector signed char, vector bool char);
+ vector signed char vec_and (vector signed char, vector signed char);
+ vector unsigned char vec_and (vector bool char, vector unsigned char);
+ vector unsigned char vec_and (vector unsigned char, vector bool char);
+ vector unsigned char vec_and (vector unsigned char,
+ vector unsigned char);
+
+ vector float vec_andc (vector float, vector float);
+ vector float vec_andc (vector float, vector bool int);
+ vector float vec_andc (vector bool int, vector float);
+ vector bool int vec_andc (vector bool int, vector bool int);
+ vector signed int vec_andc (vector bool int, vector signed int);
+ vector signed int vec_andc (vector signed int, vector bool int);
+ vector signed int vec_andc (vector signed int, vector signed int);
+ vector unsigned int vec_andc (vector bool int, vector unsigned int);
+ vector unsigned int vec_andc (vector unsigned int, vector bool int);
+ vector unsigned int vec_andc (vector unsigned int, vector unsigned int);
+ vector bool short vec_andc (vector bool short, vector bool short);
+ vector signed short vec_andc (vector bool short, vector signed short);
+ vector signed short vec_andc (vector signed short, vector bool short);
+ vector signed short vec_andc (vector signed short, vector signed short);
+ vector unsigned short vec_andc (vector bool short,
+ vector unsigned short);
+ vector unsigned short vec_andc (vector unsigned short,
+ vector bool short);
+ vector unsigned short vec_andc (vector unsigned short,
+ vector unsigned short);
+ vector signed char vec_andc (vector bool char, vector signed char);
+ vector bool char vec_andc (vector bool char, vector bool char);
+ vector signed char vec_andc (vector signed char, vector bool char);
+ vector signed char vec_andc (vector signed char, vector signed char);
+ vector unsigned char vec_andc (vector bool char, vector unsigned char);
+ vector unsigned char vec_andc (vector unsigned char, vector bool char);
+ vector unsigned char vec_andc (vector unsigned char,
+ vector unsigned char);
+
+ vector unsigned char vec_avg (vector unsigned char,
+ vector unsigned char);
+ vector signed char vec_avg (vector signed char, vector signed char);
+ vector unsigned short vec_avg (vector unsigned short,
+ vector unsigned short);
+ vector signed short vec_avg (vector signed short, vector signed short);
+ vector unsigned int vec_avg (vector unsigned int, vector unsigned int);
+ vector signed int vec_avg (vector signed int, vector signed int);
+
+ vector signed int vec_vavgsw (vector signed int, vector signed int);
+
+ vector unsigned int vec_vavguw (vector unsigned int,
+ vector unsigned int);
+
+ vector signed short vec_vavgsh (vector signed short,
+ vector signed short);
+
+ vector unsigned short vec_vavguh (vector unsigned short,
+ vector unsigned short);
+
+ vector signed char vec_vavgsb (vector signed char, vector signed char);
+
+ vector unsigned char vec_vavgub (vector unsigned char,
+ vector unsigned char);
+
+ vector float vec_ceil (vector float);
+
+ vector signed int vec_cmpb (vector float, vector float);
+
+ vector bool char vec_cmpeq (vector signed char, vector signed char);
+ vector bool char vec_cmpeq (vector unsigned char, vector unsigned char);
+ vector bool short vec_cmpeq (vector signed short, vector signed short);
+ vector bool short vec_cmpeq (vector unsigned short,
+ vector unsigned short);
+ vector bool int vec_cmpeq (vector signed int, vector signed int);
+ vector bool int vec_cmpeq (vector unsigned int, vector unsigned int);
+ vector bool int vec_cmpeq (vector float, vector float);
+
+ vector bool int vec_vcmpeqfp (vector float, vector float);
+
+ vector bool int vec_vcmpequw (vector signed int, vector signed int);
+ vector bool int vec_vcmpequw (vector unsigned int, vector unsigned int);
+
+ vector bool short vec_vcmpequh (vector signed short,
+ vector signed short);
+ vector bool short vec_vcmpequh (vector unsigned short,
+ vector unsigned short);
+
+ vector bool char vec_vcmpequb (vector signed char, vector signed char);
+ vector bool char vec_vcmpequb (vector unsigned char,
+ vector unsigned char);
+
+ vector bool int vec_cmpge (vector float, vector float);
+
+ vector bool char vec_cmpgt (vector unsigned char, vector unsigned char);
+ vector bool char vec_cmpgt (vector signed char, vector signed char);
+ vector bool short vec_cmpgt (vector unsigned short,
+ vector unsigned short);
+ vector bool short vec_cmpgt (vector signed short, vector signed short);
+ vector bool int vec_cmpgt (vector unsigned int, vector unsigned int);
+ vector bool int vec_cmpgt (vector signed int, vector signed int);
+ vector bool int vec_cmpgt (vector float, vector float);
+
+ vector bool int vec_vcmpgtfp (vector float, vector float);
+
+ vector bool int vec_vcmpgtsw (vector signed int, vector signed int);
+
+ vector bool int vec_vcmpgtuw (vector unsigned int, vector unsigned int);
+
+ vector bool short vec_vcmpgtsh (vector signed short,
+ vector signed short);
+
+ vector bool short vec_vcmpgtuh (vector unsigned short,
+ vector unsigned short);
+
+ vector bool char vec_vcmpgtsb (vector signed char, vector signed char);
+
+ vector bool char vec_vcmpgtub (vector unsigned char,
+ vector unsigned char);
+
+ vector bool int vec_cmple (vector float, vector float);
+
+ vector bool char vec_cmplt (vector unsigned char, vector unsigned char);
+ vector bool char vec_cmplt (vector signed char, vector signed char);
+ vector bool short vec_cmplt (vector unsigned short,
+ vector unsigned short);
+ vector bool short vec_cmplt (vector signed short, vector signed short);
+ vector bool int vec_cmplt (vector unsigned int, vector unsigned int);
+ vector bool int vec_cmplt (vector signed int, vector signed int);
+ vector bool int vec_cmplt (vector float, vector float);
+
+ vector float vec_ctf (vector unsigned int, const int);
+ vector float vec_ctf (vector signed int, const int);
+
+ vector float vec_vcfsx (vector signed int, const int);
+
+ vector float vec_vcfux (vector unsigned int, const int);
+
+ vector signed int vec_cts (vector float, const int);
+
+ vector unsigned int vec_ctu (vector float, const int);
+
+ void vec_dss (const int);
+
+ void vec_dssall (void);
+
+ void vec_dst (const vector unsigned char *, int, const int);
+ void vec_dst (const vector signed char *, int, const int);
+ void vec_dst (const vector bool char *, int, const int);
+ void vec_dst (const vector unsigned short *, int, const int);
+ void vec_dst (const vector signed short *, int, const int);
+ void vec_dst (const vector bool short *, int, const int);
+ void vec_dst (const vector pixel *, int, const int);
+ void vec_dst (const vector unsigned int *, int, const int);
+ void vec_dst (const vector signed int *, int, const int);
+ void vec_dst (const vector bool int *, int, const int);
+ void vec_dst (const vector float *, int, const int);
+ void vec_dst (const unsigned char *, int, const int);
+ void vec_dst (const signed char *, int, const int);
+ void vec_dst (const unsigned short *, int, const int);
+ void vec_dst (const short *, int, const int);
+ void vec_dst (const unsigned int *, int, const int);
+ void vec_dst (const int *, int, const int);
+ void vec_dst (const unsigned long *, int, const int);
+ void vec_dst (const long *, int, const int);
+ void vec_dst (const float *, int, const int);
+
+ void vec_dstst (const vector unsigned char *, int, const int);
+ void vec_dstst (const vector signed char *, int, const int);
+ void vec_dstst (const vector bool char *, int, const int);
+ void vec_dstst (const vector unsigned short *, int, const int);
+ void vec_dstst (const vector signed short *, int, const int);
+ void vec_dstst (const vector bool short *, int, const int);
+ void vec_dstst (const vector pixel *, int, const int);
+ void vec_dstst (const vector unsigned int *, int, const int);
+ void vec_dstst (const vector signed int *, int, const int);
+ void vec_dstst (const vector bool int *, int, const int);
+ void vec_dstst (const vector float *, int, const int);
+ void vec_dstst (const unsigned char *, int, const int);
+ void vec_dstst (const signed char *, int, const int);
+ void vec_dstst (const unsigned short *, int, const int);
+ void vec_dstst (const short *, int, const int);
+ void vec_dstst (const unsigned int *, int, const int);
+ void vec_dstst (const int *, int, const int);
+ void vec_dstst (const unsigned long *, int, const int);
+ void vec_dstst (const long *, int, const int);
+ void vec_dstst (const float *, int, const int);
+
+ void vec_dststt (const vector unsigned char *, int, const int);
+ void vec_dststt (const vector signed char *, int, const int);
+ void vec_dststt (const vector bool char *, int, const int);
+ void vec_dststt (const vector unsigned short *, int, const int);
+ void vec_dststt (const vector signed short *, int, const int);
+ void vec_dststt (const vector bool short *, int, const int);
+ void vec_dststt (const vector pixel *, int, const int);
+ void vec_dststt (const vector unsigned int *, int, const int);
+ void vec_dststt (const vector signed int *, int, const int);
+ void vec_dststt (const vector bool int *, int, const int);
+ void vec_dststt (const vector float *, int, const int);
+ void vec_dststt (const unsigned char *, int, const int);
+ void vec_dststt (const signed char *, int, const int);
+ void vec_dststt (const unsigned short *, int, const int);
+ void vec_dststt (const short *, int, const int);
+ void vec_dststt (const unsigned int *, int, const int);
+ void vec_dststt (const int *, int, const int);
+ void vec_dststt (const unsigned long *, int, const int);
+ void vec_dststt (const long *, int, const int);
+ void vec_dststt (const float *, int, const int);
+
+ void vec_dstt (const vector unsigned char *, int, const int);
+ void vec_dstt (const vector signed char *, int, const int);
+ void vec_dstt (const vector bool char *, int, const int);
+ void vec_dstt (const vector unsigned short *, int, const int);
+ void vec_dstt (const vector signed short *, int, const int);
+ void vec_dstt (const vector bool short *, int, const int);
+ void vec_dstt (const vector pixel *, int, const int);
+ void vec_dstt (const vector unsigned int *, int, const int);
+ void vec_dstt (const vector signed int *, int, const int);
+ void vec_dstt (const vector bool int *, int, const int);
+ void vec_dstt (const vector float *, int, const int);
+ void vec_dstt (const unsigned char *, int, const int);
+ void vec_dstt (const signed char *, int, const int);
+ void vec_dstt (const unsigned short *, int, const int);
+ void vec_dstt (const short *, int, const int);
+ void vec_dstt (const unsigned int *, int, const int);
+ void vec_dstt (const int *, int, const int);
+ void vec_dstt (const unsigned long *, int, const int);
+ void vec_dstt (const long *, int, const int);
+ void vec_dstt (const float *, int, const int);
+
+ vector float vec_expte (vector float);
+
+ vector float vec_floor (vector float);
+
+ vector float vec_ld (int, const vector float *);
+ vector float vec_ld (int, const float *);
+ vector bool int vec_ld (int, const vector bool int *);
+ vector signed int vec_ld (int, const vector signed int *);
+ vector signed int vec_ld (int, const int *);
+ vector signed int vec_ld (int, const long *);
+ vector unsigned int vec_ld (int, const vector unsigned int *);
+ vector unsigned int vec_ld (int, const unsigned int *);
+ vector unsigned int vec_ld (int, const unsigned long *);
+ vector bool short vec_ld (int, const vector bool short *);
+ vector pixel vec_ld (int, const vector pixel *);
+ vector signed short vec_ld (int, const vector signed short *);
+ vector signed short vec_ld (int, const short *);
+ vector unsigned short vec_ld (int, const vector unsigned short *);
+ vector unsigned short vec_ld (int, const unsigned short *);
+ vector bool char vec_ld (int, const vector bool char *);
+ vector signed char vec_ld (int, const vector signed char *);
+ vector signed char vec_ld (int, const signed char *);
+ vector unsigned char vec_ld (int, const vector unsigned char *);
+ vector unsigned char vec_ld (int, const unsigned char *);
+
+ vector signed char vec_lde (int, const signed char *);
+ vector unsigned char vec_lde (int, const unsigned char *);
+ vector signed short vec_lde (int, const short *);
+ vector unsigned short vec_lde (int, const unsigned short *);
+ vector float vec_lde (int, const float *);
+ vector signed int vec_lde (int, const int *);
+ vector unsigned int vec_lde (int, const unsigned int *);
+ vector signed int vec_lde (int, const long *);
+ vector unsigned int vec_lde (int, const unsigned long *);
+
+ vector float vec_lvewx (int, float *);
+ vector signed int vec_lvewx (int, int *);
+ vector unsigned int vec_lvewx (int, unsigned int *);
+ vector signed int vec_lvewx (int, long *);
+ vector unsigned int vec_lvewx (int, unsigned long *);
+
+ vector signed short vec_lvehx (int, short *);
+ vector unsigned short vec_lvehx (int, unsigned short *);
+
+ vector signed char vec_lvebx (int, char *);
+ vector unsigned char vec_lvebx (int, unsigned char *);
+
+ vector float vec_ldl (int, const vector float *);
+ vector float vec_ldl (int, const float *);
+ vector bool int vec_ldl (int, const vector bool int *);
+ vector signed int vec_ldl (int, const vector signed int *);
+ vector signed int vec_ldl (int, const int *);
+ vector signed int vec_ldl (int, const long *);
+ vector unsigned int vec_ldl (int, const vector unsigned int *);
+ vector unsigned int vec_ldl (int, const unsigned int *);
+ vector unsigned int vec_ldl (int, const unsigned long *);
+ vector bool short vec_ldl (int, const vector bool short *);
+ vector pixel vec_ldl (int, const vector pixel *);
+ vector signed short vec_ldl (int, const vector signed short *);
+ vector signed short vec_ldl (int, const short *);
+ vector unsigned short vec_ldl (int, const vector unsigned short *);
+ vector unsigned short vec_ldl (int, const unsigned short *);
+ vector bool char vec_ldl (int, const vector bool char *);
+ vector signed char vec_ldl (int, const vector signed char *);
+ vector signed char vec_ldl (int, const signed char *);
+ vector unsigned char vec_ldl (int, const vector unsigned char *);
+ vector unsigned char vec_ldl (int, const unsigned char *);
+
+ vector float vec_loge (vector float);
+
+ vector unsigned char vec_lvsl (int, const volatile unsigned char *);
+ vector unsigned char vec_lvsl (int, const volatile signed char *);
+ vector unsigned char vec_lvsl (int, const volatile unsigned short *);
+ vector unsigned char vec_lvsl (int, const volatile short *);
+ vector unsigned char vec_lvsl (int, const volatile unsigned int *);
+ vector unsigned char vec_lvsl (int, const volatile int *);
+ vector unsigned char vec_lvsl (int, const volatile unsigned long *);
+ vector unsigned char vec_lvsl (int, const volatile long *);
+ vector unsigned char vec_lvsl (int, const volatile float *);
+
+ vector unsigned char vec_lvsr (int, const volatile unsigned char *);
+ vector unsigned char vec_lvsr (int, const volatile signed char *);
+ vector unsigned char vec_lvsr (int, const volatile unsigned short *);
+ vector unsigned char vec_lvsr (int, const volatile short *);
+ vector unsigned char vec_lvsr (int, const volatile unsigned int *);
+ vector unsigned char vec_lvsr (int, const volatile int *);
+ vector unsigned char vec_lvsr (int, const volatile unsigned long *);
+ vector unsigned char vec_lvsr (int, const volatile long *);
+ vector unsigned char vec_lvsr (int, const volatile float *);
+
+ vector float vec_madd (vector float, vector float, vector float);
+
+ vector signed short vec_madds (vector signed short,
+ vector signed short,
+ vector signed short);
+
+ vector unsigned char vec_max (vector bool char, vector unsigned char);
+ vector unsigned char vec_max (vector unsigned char, vector bool char);
+ vector unsigned char vec_max (vector unsigned char,
+ vector unsigned char);
+ vector signed char vec_max (vector bool char, vector signed char);
+ vector signed char vec_max (vector signed char, vector bool char);
+ vector signed char vec_max (vector signed char, vector signed char);
+ vector unsigned short vec_max (vector bool short,
+ vector unsigned short);
+ vector unsigned short vec_max (vector unsigned short,
+ vector bool short);
+ vector unsigned short vec_max (vector unsigned short,
+ vector unsigned short);
+ vector signed short vec_max (vector bool short, vector signed short);
+ vector signed short vec_max (vector signed short, vector bool short);
+ vector signed short vec_max (vector signed short, vector signed short);
+ vector unsigned int vec_max (vector bool int, vector unsigned int);
+ vector unsigned int vec_max (vector unsigned int, vector bool int);
+ vector unsigned int vec_max (vector unsigned int, vector unsigned int);
+ vector signed int vec_max (vector bool int, vector signed int);
+ vector signed int vec_max (vector signed int, vector bool int);
+ vector signed int vec_max (vector signed int, vector signed int);
+ vector float vec_max (vector float, vector float);
+
+ vector float vec_vmaxfp (vector float, vector float);
+
+ vector signed int vec_vmaxsw (vector bool int, vector signed int);
+ vector signed int vec_vmaxsw (vector signed int, vector bool int);
+ vector signed int vec_vmaxsw (vector signed int, vector signed int);
+
+ vector unsigned int vec_vmaxuw (vector bool int, vector unsigned int);
+ vector unsigned int vec_vmaxuw (vector unsigned int, vector bool int);
+ vector unsigned int vec_vmaxuw (vector unsigned int,
+ vector unsigned int);
+
+ vector signed short vec_vmaxsh (vector bool short, vector signed short);
+ vector signed short vec_vmaxsh (vector signed short, vector bool short);
+ vector signed short vec_vmaxsh (vector signed short,
+ vector signed short);
+
+ vector unsigned short vec_vmaxuh (vector bool short,
+ vector unsigned short);
+ vector unsigned short vec_vmaxuh (vector unsigned short,
+ vector bool short);
+ vector unsigned short vec_vmaxuh (vector unsigned short,
+ vector unsigned short);
+
+ vector signed char vec_vmaxsb (vector bool char, vector signed char);
+ vector signed char vec_vmaxsb (vector signed char, vector bool char);
+ vector signed char vec_vmaxsb (vector signed char, vector signed char);
+
+ vector unsigned char vec_vmaxub (vector bool char,
+ vector unsigned char);
+ vector unsigned char vec_vmaxub (vector unsigned char,
+ vector bool char);
+ vector unsigned char vec_vmaxub (vector unsigned char,
+ vector unsigned char);
+
+ vector bool char vec_mergeh (vector bool char, vector bool char);
+ vector signed char vec_mergeh (vector signed char, vector signed char);
+ vector unsigned char vec_mergeh (vector unsigned char,
+ vector unsigned char);
+ vector bool short vec_mergeh (vector bool short, vector bool short);
+ vector pixel vec_mergeh (vector pixel, vector pixel);
+ vector signed short vec_mergeh (vector signed short,
+ vector signed short);
+ vector unsigned short vec_mergeh (vector unsigned short,
+ vector unsigned short);
+ vector float vec_mergeh (vector float, vector float);
+ vector bool int vec_mergeh (vector bool int, vector bool int);
+ vector signed int vec_mergeh (vector signed int, vector signed int);
+ vector unsigned int vec_mergeh (vector unsigned int,
+ vector unsigned int);
+
+ vector float vec_vmrghw (vector float, vector float);
+ vector bool int vec_vmrghw (vector bool int, vector bool int);
+ vector signed int vec_vmrghw (vector signed int, vector signed int);
+ vector unsigned int vec_vmrghw (vector unsigned int,
+ vector unsigned int);
+
+ vector bool short vec_vmrghh (vector bool short, vector bool short);
+ vector signed short vec_vmrghh (vector signed short,
+ vector signed short);
+ vector unsigned short vec_vmrghh (vector unsigned short,
+ vector unsigned short);
+ vector pixel vec_vmrghh (vector pixel, vector pixel);
+
+ vector bool char vec_vmrghb (vector bool char, vector bool char);
+ vector signed char vec_vmrghb (vector signed char, vector signed char);
+ vector unsigned char vec_vmrghb (vector unsigned char,
+ vector unsigned char);
+
+ vector bool char vec_mergel (vector bool char, vector bool char);
+ vector signed char vec_mergel (vector signed char, vector signed char);
+ vector unsigned char vec_mergel (vector unsigned char,
+ vector unsigned char);
+ vector bool short vec_mergel (vector bool short, vector bool short);
+ vector pixel vec_mergel (vector pixel, vector pixel);
+ vector signed short vec_mergel (vector signed short,
+ vector signed short);
+ vector unsigned short vec_mergel (vector unsigned short,
+ vector unsigned short);
+ vector float vec_mergel (vector float, vector float);
+ vector bool int vec_mergel (vector bool int, vector bool int);
+ vector signed int vec_mergel (vector signed int, vector signed int);
+ vector unsigned int vec_mergel (vector unsigned int,
+ vector unsigned int);
+
+ vector float vec_vmrglw (vector float, vector float);
+ vector signed int vec_vmrglw (vector signed int, vector signed int);
+ vector unsigned int vec_vmrglw (vector unsigned int,
+ vector unsigned int);
+ vector bool int vec_vmrglw (vector bool int, vector bool int);
+
+ vector bool short vec_vmrglh (vector bool short, vector bool short);
+ vector signed short vec_vmrglh (vector signed short,
+ vector signed short);
+ vector unsigned short vec_vmrglh (vector unsigned short,
+ vector unsigned short);
+ vector pixel vec_vmrglh (vector pixel, vector pixel);
+
+ vector bool char vec_vmrglb (vector bool char, vector bool char);
+ vector signed char vec_vmrglb (vector signed char, vector signed char);
+ vector unsigned char vec_vmrglb (vector unsigned char,
+ vector unsigned char);
+
+ vector unsigned short vec_mfvscr (void);
+
+ vector unsigned char vec_min (vector bool char, vector unsigned char);
+ vector unsigned char vec_min (vector unsigned char, vector bool char);
+ vector unsigned char vec_min (vector unsigned char,
+ vector unsigned char);
+ vector signed char vec_min (vector bool char, vector signed char);
+ vector signed char vec_min (vector signed char, vector bool char);
+ vector signed char vec_min (vector signed char, vector signed char);
+ vector unsigned short vec_min (vector bool short,
+ vector unsigned short);
+ vector unsigned short vec_min (vector unsigned short,
+ vector bool short);
+ vector unsigned short vec_min (vector unsigned short,
+ vector unsigned short);
+ vector signed short vec_min (vector bool short, vector signed short);
+ vector signed short vec_min (vector signed short, vector bool short);
+ vector signed short vec_min (vector signed short, vector signed short);
+ vector unsigned int vec_min (vector bool int, vector unsigned int);
+ vector unsigned int vec_min (vector unsigned int, vector bool int);
+ vector unsigned int vec_min (vector unsigned int, vector unsigned int);
+ vector signed int vec_min (vector bool int, vector signed int);
+ vector signed int vec_min (vector signed int, vector bool int);
+ vector signed int vec_min (vector signed int, vector signed int);
+ vector float vec_min (vector float, vector float);
+
+ vector float vec_vminfp (vector float, vector float);
+
+ vector signed int vec_vminsw (vector bool int, vector signed int);
+ vector signed int vec_vminsw (vector signed int, vector bool int);
+ vector signed int vec_vminsw (vector signed int, vector signed int);
+
+ vector unsigned int vec_vminuw (vector bool int, vector unsigned int);
+ vector unsigned int vec_vminuw (vector unsigned int, vector bool int);
+ vector unsigned int vec_vminuw (vector unsigned int,
+ vector unsigned int);
+
+ vector signed short vec_vminsh (vector bool short, vector signed short);
+ vector signed short vec_vminsh (vector signed short, vector bool short);
+ vector signed short vec_vminsh (vector signed short,
+ vector signed short);
+
+ vector unsigned short vec_vminuh (vector bool short,
+ vector unsigned short);
+ vector unsigned short vec_vminuh (vector unsigned short,
+ vector bool short);
+ vector unsigned short vec_vminuh (vector unsigned short,
+ vector unsigned short);
+
+ vector signed char vec_vminsb (vector bool char, vector signed char);
+ vector signed char vec_vminsb (vector signed char, vector bool char);
+ vector signed char vec_vminsb (vector signed char, vector signed char);
+
+ vector unsigned char vec_vminub (vector bool char,
+ vector unsigned char);
+ vector unsigned char vec_vminub (vector unsigned char,
+ vector bool char);
+ vector unsigned char vec_vminub (vector unsigned char,
+ vector unsigned char);
+
+ vector signed short vec_mladd (vector signed short,
+ vector signed short,
+ vector signed short);
+ vector signed short vec_mladd (vector signed short,
+ vector unsigned short,
+ vector unsigned short);
+ vector signed short vec_mladd (vector unsigned short,
+ vector signed short,
+ vector signed short);
+ vector unsigned short vec_mladd (vector unsigned short,
+ vector unsigned short,
+ vector unsigned short);
+
+ vector signed short vec_mradds (vector signed short,
+ vector signed short,
+ vector signed short);
+
+ vector unsigned int vec_msum (vector unsigned char,
+ vector unsigned char,
+ vector unsigned int);
+ vector signed int vec_msum (vector signed char,
+ vector unsigned char,
+ vector signed int);
+ vector unsigned int vec_msum (vector unsigned short,
+ vector unsigned short,
+ vector unsigned int);
+ vector signed int vec_msum (vector signed short,
+ vector signed short,
+ vector signed int);
+
+ vector signed int vec_vmsumshm (vector signed short,
+ vector signed short,
+ vector signed int);
+
+ vector unsigned int vec_vmsumuhm (vector unsigned short,
+ vector unsigned short,
+ vector unsigned int);
+
+ vector signed int vec_vmsummbm (vector signed char,
+ vector unsigned char,
+ vector signed int);
+
+ vector unsigned int vec_vmsumubm (vector unsigned char,
+ vector unsigned char,
+ vector unsigned int);
+
+ vector unsigned int vec_msums (vector unsigned short,
+ vector unsigned short,
+ vector unsigned int);
+ vector signed int vec_msums (vector signed short,
+ vector signed short,
+ vector signed int);
+
+ vector signed int vec_vmsumshs (vector signed short,
+ vector signed short,
+ vector signed int);
+
+ vector unsigned int vec_vmsumuhs (vector unsigned short,
+ vector unsigned short,
+ vector unsigned int);
+
+ void vec_mtvscr (vector signed int);
+ void vec_mtvscr (vector unsigned int);
+ void vec_mtvscr (vector bool int);
+ void vec_mtvscr (vector signed short);
+ void vec_mtvscr (vector unsigned short);
+ void vec_mtvscr (vector bool short);
+ void vec_mtvscr (vector pixel);
+ void vec_mtvscr (vector signed char);
+ void vec_mtvscr (vector unsigned char);
+ void vec_mtvscr (vector bool char);
+
+ vector unsigned short vec_mule (vector unsigned char,
+ vector unsigned char);
+ vector signed short vec_mule (vector signed char,
+ vector signed char);
+ vector unsigned int vec_mule (vector unsigned short,
+ vector unsigned short);
+ vector signed int vec_mule (vector signed short, vector signed short);
+
+ vector signed int vec_vmulesh (vector signed short,
+ vector signed short);
+
+ vector unsigned int vec_vmuleuh (vector unsigned short,
+ vector unsigned short);
+
+ vector signed short vec_vmulesb (vector signed char,
+ vector signed char);
+
+ vector unsigned short vec_vmuleub (vector unsigned char,
+ vector unsigned char);
+
+ vector unsigned short vec_mulo (vector unsigned char,
+ vector unsigned char);
+ vector signed short vec_mulo (vector signed char, vector signed char);
+ vector unsigned int vec_mulo (vector unsigned short,
+ vector unsigned short);
+ vector signed int vec_mulo (vector signed short, vector signed short);
+
+ vector signed int vec_vmulosh (vector signed short,
+ vector signed short);
+
+ vector unsigned int vec_vmulouh (vector unsigned short,
+ vector unsigned short);
+
+ vector signed short vec_vmulosb (vector signed char,
+ vector signed char);
+
+ vector unsigned short vec_vmuloub (vector unsigned char,
+ vector unsigned char);
+
+ vector float vec_nmsub (vector float, vector float, vector float);
+
+ vector float vec_nor (vector float, vector float);
+ vector signed int vec_nor (vector signed int, vector signed int);
+ vector unsigned int vec_nor (vector unsigned int, vector unsigned int);
+ vector bool int vec_nor (vector bool int, vector bool int);
+ vector signed short vec_nor (vector signed short, vector signed short);
+ vector unsigned short vec_nor (vector unsigned short,
+ vector unsigned short);
+ vector bool short vec_nor (vector bool short, vector bool short);
+ vector signed char vec_nor (vector signed char, vector signed char);
+ vector unsigned char vec_nor (vector unsigned char,
+ vector unsigned char);
+ vector bool char vec_nor (vector bool char, vector bool char);
+
+ vector float vec_or (vector float, vector float);
+ vector float vec_or (vector float, vector bool int);
+ vector float vec_or (vector bool int, vector float);
+ vector bool int vec_or (vector bool int, vector bool int);
+ vector signed int vec_or (vector bool int, vector signed int);
+ vector signed int vec_or (vector signed int, vector bool int);
+ vector signed int vec_or (vector signed int, vector signed int);
+ vector unsigned int vec_or (vector bool int, vector unsigned int);
+ vector unsigned int vec_or (vector unsigned int, vector bool int);
+ vector unsigned int vec_or (vector unsigned int, vector unsigned int);
+ vector bool short vec_or (vector bool short, vector bool short);
+ vector signed short vec_or (vector bool short, vector signed short);
+ vector signed short vec_or (vector signed short, vector bool short);
+ vector signed short vec_or (vector signed short, vector signed short);
+ vector unsigned short vec_or (vector bool short, vector unsigned short);
+ vector unsigned short vec_or (vector unsigned short, vector bool short);
+ vector unsigned short vec_or (vector unsigned short,
+ vector unsigned short);
+ vector signed char vec_or (vector bool char, vector signed char);
+ vector bool char vec_or (vector bool char, vector bool char);
+ vector signed char vec_or (vector signed char, vector bool char);
+ vector signed char vec_or (vector signed char, vector signed char);
+ vector unsigned char vec_or (vector bool char, vector unsigned char);
+ vector unsigned char vec_or (vector unsigned char, vector bool char);
+ vector unsigned char vec_or (vector unsigned char,
+ vector unsigned char);
+
+ vector signed char vec_pack (vector signed short, vector signed short);
+ vector unsigned char vec_pack (vector unsigned short,
+ vector unsigned short);
+ vector bool char vec_pack (vector bool short, vector bool short);
+ vector signed short vec_pack (vector signed int, vector signed int);
+ vector unsigned short vec_pack (vector unsigned int,
+ vector unsigned int);
+ vector bool short vec_pack (vector bool int, vector bool int);
+
+ vector bool short vec_vpkuwum (vector bool int, vector bool int);
+ vector signed short vec_vpkuwum (vector signed int, vector signed int);
+ vector unsigned short vec_vpkuwum (vector unsigned int,
+ vector unsigned int);
+
+ vector bool char vec_vpkuhum (vector bool short, vector bool short);
+ vector signed char vec_vpkuhum (vector signed short,
+ vector signed short);
+ vector unsigned char vec_vpkuhum (vector unsigned short,
+ vector unsigned short);
+
+ vector pixel vec_packpx (vector unsigned int, vector unsigned int);
+
+ vector unsigned char vec_packs (vector unsigned short,
+ vector unsigned short);
+ vector signed char vec_packs (vector signed short, vector signed short);
+ vector unsigned short vec_packs (vector unsigned int,
+ vector unsigned int);
+ vector signed short vec_packs (vector signed int, vector signed int);
+
+ vector signed short vec_vpkswss (vector signed int, vector signed int);
+
+ vector unsigned short vec_vpkuwus (vector unsigned int,
+ vector unsigned int);
+
+ vector signed char vec_vpkshss (vector signed short,
+ vector signed short);
+
+ vector unsigned char vec_vpkuhus (vector unsigned short,
+ vector unsigned short);
+
+ vector unsigned char vec_packsu (vector unsigned short,
+ vector unsigned short);
+ vector unsigned char vec_packsu (vector signed short,
+ vector signed short);
+ vector unsigned short vec_packsu (vector unsigned int,
+ vector unsigned int);
+ vector unsigned short vec_packsu (vector signed int, vector signed int);
+
+ vector unsigned short vec_vpkswus (vector signed int,
+ vector signed int);
+
+ vector unsigned char vec_vpkshus (vector signed short,
+ vector signed short);
+
+ vector float vec_perm (vector float,
+ vector float,
+ vector unsigned char);
+ vector signed int vec_perm (vector signed int,
+ vector signed int,
+ vector unsigned char);
+ vector unsigned int vec_perm (vector unsigned int,
+ vector unsigned int,
+ vector unsigned char);
+ vector bool int vec_perm (vector bool int,
+ vector bool int,
+ vector unsigned char);
+ vector signed short vec_perm (vector signed short,
+ vector signed short,
+ vector unsigned char);
+ vector unsigned short vec_perm (vector unsigned short,
+ vector unsigned short,
+ vector unsigned char);
+ vector bool short vec_perm (vector bool short,
+ vector bool short,
+ vector unsigned char);
+ vector pixel vec_perm (vector pixel,
+ vector pixel,
+ vector unsigned char);
+ vector signed char vec_perm (vector signed char,
+ vector signed char,
+ vector unsigned char);
+ vector unsigned char vec_perm (vector unsigned char,
+ vector unsigned char,
+ vector unsigned char);
+ vector bool char vec_perm (vector bool char,
+ vector bool char,
+ vector unsigned char);
+
+ vector float vec_re (vector float);
+
+ vector signed char vec_rl (vector signed char,
+ vector unsigned char);
+ vector unsigned char vec_rl (vector unsigned char,
+ vector unsigned char);
+ vector signed short vec_rl (vector signed short, vector unsigned short);
+ vector unsigned short vec_rl (vector unsigned short,
+ vector unsigned short);
+ vector signed int vec_rl (vector signed int, vector unsigned int);
+ vector unsigned int vec_rl (vector unsigned int, vector unsigned int);
+
+ vector signed int vec_vrlw (vector signed int, vector unsigned int);
+ vector unsigned int vec_vrlw (vector unsigned int, vector unsigned int);
+
+ vector signed short vec_vrlh (vector signed short,
+ vector unsigned short);
+ vector unsigned short vec_vrlh (vector unsigned short,
+ vector unsigned short);
+
+ vector signed char vec_vrlb (vector signed char, vector unsigned char);
+ vector unsigned char vec_vrlb (vector unsigned char,
+ vector unsigned char);
+
+ vector float vec_round (vector float);
+
+ vector float vec_rsqrte (vector float);
+
+ vector float vec_sel (vector float, vector float, vector bool int);
+ vector float vec_sel (vector float, vector float, vector unsigned int);
+ vector signed int vec_sel (vector signed int,
+ vector signed int,
+ vector bool int);
+ vector signed int vec_sel (vector signed int,
+ vector signed int,
+ vector unsigned int);
+ vector unsigned int vec_sel (vector unsigned int,
+ vector unsigned int,
+ vector bool int);
+ vector unsigned int vec_sel (vector unsigned int,
+ vector unsigned int,
+ vector unsigned int);
+ vector bool int vec_sel (vector bool int,
+ vector bool int,
+ vector bool int);
+ vector bool int vec_sel (vector bool int,
+ vector bool int,
+ vector unsigned int);
+ vector signed short vec_sel (vector signed short,
+ vector signed short,
+ vector bool short);
+ vector signed short vec_sel (vector signed short,
+ vector signed short,
+ vector unsigned short);
+ vector unsigned short vec_sel (vector unsigned short,
+ vector unsigned short,
+ vector bool short);
+ vector unsigned short vec_sel (vector unsigned short,
+ vector unsigned short,
+ vector unsigned short);
+ vector bool short vec_sel (vector bool short,
+ vector bool short,
+ vector bool short);
+ vector bool short vec_sel (vector bool short,
+ vector bool short,
+ vector unsigned short);
+ vector signed char vec_sel (vector signed char,
+ vector signed char,
+ vector bool char);
+ vector signed char vec_sel (vector signed char,
+ vector signed char,
+ vector unsigned char);
+ vector unsigned char vec_sel (vector unsigned char,
+ vector unsigned char,
+ vector bool char);
+ vector unsigned char vec_sel (vector unsigned char,
+ vector unsigned char,
+ vector unsigned char);
+ vector bool char vec_sel (vector bool char,
+ vector bool char,
+ vector bool char);
+ vector bool char vec_sel (vector bool char,
+ vector bool char,
+ vector unsigned char);
+
+ vector signed char vec_sl (vector signed char,
+ vector unsigned char);
+ vector unsigned char vec_sl (vector unsigned char,
+ vector unsigned char);
+ vector signed short vec_sl (vector signed short, vector unsigned short);
+ vector unsigned short vec_sl (vector unsigned short,
+ vector unsigned short);
+ vector signed int vec_sl (vector signed int, vector unsigned int);
+ vector unsigned int vec_sl (vector unsigned int, vector unsigned int);
+
+ vector signed int vec_vslw (vector signed int, vector unsigned int);
+ vector unsigned int vec_vslw (vector unsigned int, vector unsigned int);
+
+ vector signed short vec_vslh (vector signed short,
+ vector unsigned short);
+ vector unsigned short vec_vslh (vector unsigned short,
+ vector unsigned short);
+
+ vector signed char vec_vslb (vector signed char, vector unsigned char);
+ vector unsigned char vec_vslb (vector unsigned char,
+ vector unsigned char);
+
+ vector float vec_sld (vector float, vector float, const int);
+ vector signed int vec_sld (vector signed int,
+ vector signed int,
+ const int);
+ vector unsigned int vec_sld (vector unsigned int,
+ vector unsigned int,
+ const int);
+ vector bool int vec_sld (vector bool int,
+ vector bool int,
+ const int);
+ vector signed short vec_sld (vector signed short,
+ vector signed short,
+ const int);
+ vector unsigned short vec_sld (vector unsigned short,
+ vector unsigned short,
+ const int);
+ vector bool short vec_sld (vector bool short,
+ vector bool short,
+ const int);
+ vector pixel vec_sld (vector pixel,
+ vector pixel,
+ const int);
+ vector signed char vec_sld (vector signed char,
+ vector signed char,
+ const int);
+ vector unsigned char vec_sld (vector unsigned char,
+ vector unsigned char,
+ const int);
+ vector bool char vec_sld (vector bool char,
+ vector bool char,
+ const int);
+
+ vector signed int vec_sll (vector signed int,
+ vector unsigned int);
+ vector signed int vec_sll (vector signed int,
+ vector unsigned short);
+ vector signed int vec_sll (vector signed int,
+ vector unsigned char);
+ vector unsigned int vec_sll (vector unsigned int,
+ vector unsigned int);
+ vector unsigned int vec_sll (vector unsigned int,
+ vector unsigned short);
+ vector unsigned int vec_sll (vector unsigned int,
+ vector unsigned char);
+ vector bool int vec_sll (vector bool int,
+ vector unsigned int);
+ vector bool int vec_sll (vector bool int,
+ vector unsigned short);
+ vector bool int vec_sll (vector bool int,
+ vector unsigned char);
+ vector signed short vec_sll (vector signed short,
+ vector unsigned int);
+ vector signed short vec_sll (vector signed short,
+ vector unsigned short);
+ vector signed short vec_sll (vector signed short,
+ vector unsigned char);
+ vector unsigned short vec_sll (vector unsigned short,
+ vector unsigned int);
+ vector unsigned short vec_sll (vector unsigned short,
+ vector unsigned short);
+ vector unsigned short vec_sll (vector unsigned short,
+ vector unsigned char);
+ vector bool short vec_sll (vector bool short, vector unsigned int);
+ vector bool short vec_sll (vector bool short, vector unsigned short);
+ vector bool short vec_sll (vector bool short, vector unsigned char);
+ vector pixel vec_sll (vector pixel, vector unsigned int);
+ vector pixel vec_sll (vector pixel, vector unsigned short);
+ vector pixel vec_sll (vector pixel, vector unsigned char);
+ vector signed char vec_sll (vector signed char, vector unsigned int);
+ vector signed char vec_sll (vector signed char, vector unsigned short);
+ vector signed char vec_sll (vector signed char, vector unsigned char);
+ vector unsigned char vec_sll (vector unsigned char,
+ vector unsigned int);
+ vector unsigned char vec_sll (vector unsigned char,
+ vector unsigned short);
+ vector unsigned char vec_sll (vector unsigned char,
+ vector unsigned char);
+ vector bool char vec_sll (vector bool char, vector unsigned int);
+ vector bool char vec_sll (vector bool char, vector unsigned short);
+ vector bool char vec_sll (vector bool char, vector unsigned char);
+
+ vector float vec_slo (vector float, vector signed char);
+ vector float vec_slo (vector float, vector unsigned char);
+ vector signed int vec_slo (vector signed int, vector signed char);
+ vector signed int vec_slo (vector signed int, vector unsigned char);
+ vector unsigned int vec_slo (vector unsigned int, vector signed char);
+ vector unsigned int vec_slo (vector unsigned int, vector unsigned char);
+ vector signed short vec_slo (vector signed short, vector signed char);
+ vector signed short vec_slo (vector signed short, vector unsigned char);
+ vector unsigned short vec_slo (vector unsigned short,
+ vector signed char);
+ vector unsigned short vec_slo (vector unsigned short,
+ vector unsigned char);
+ vector pixel vec_slo (vector pixel, vector signed char);
+ vector pixel vec_slo (vector pixel, vector unsigned char);
+ vector signed char vec_slo (vector signed char, vector signed char);
+ vector signed char vec_slo (vector signed char, vector unsigned char);
+ vector unsigned char vec_slo (vector unsigned char, vector signed char);
+ vector unsigned char vec_slo (vector unsigned char,
+ vector unsigned char);
+
+ vector signed char vec_splat (vector signed char, const int);
+ vector unsigned char vec_splat (vector unsigned char, const int);
+ vector bool char vec_splat (vector bool char, const int);
+ vector signed short vec_splat (vector signed short, const int);
+ vector unsigned short vec_splat (vector unsigned short, const int);
+ vector bool short vec_splat (vector bool short, const int);
+ vector pixel vec_splat (vector pixel, const int);
+ vector float vec_splat (vector float, const int);
+ vector signed int vec_splat (vector signed int, const int);
+ vector unsigned int vec_splat (vector unsigned int, const int);
+ vector bool int vec_splat (vector bool int, const int);
+
+ vector float vec_vspltw (vector float, const int);
+ vector signed int vec_vspltw (vector signed int, const int);
+ vector unsigned int vec_vspltw (vector unsigned int, const int);
+ vector bool int vec_vspltw (vector bool int, const int);
+
+ vector bool short vec_vsplth (vector bool short, const int);
+ vector signed short vec_vsplth (vector signed short, const int);
+ vector unsigned short vec_vsplth (vector unsigned short, const int);
+ vector pixel vec_vsplth (vector pixel, const int);
+
+ vector signed char vec_vspltb (vector signed char, const int);
+ vector unsigned char vec_vspltb (vector unsigned char, const int);
+ vector bool char vec_vspltb (vector bool char, const int);
+
+ vector signed char vec_splat_s8 (const int);
+
+ vector signed short vec_splat_s16 (const int);
+
+ vector signed int vec_splat_s32 (const int);
+
+ vector unsigned char vec_splat_u8 (const int);
+
+ vector unsigned short vec_splat_u16 (const int);
+
+ vector unsigned int vec_splat_u32 (const int);
+
+ vector signed char vec_sr (vector signed char, vector unsigned char);
+ vector unsigned char vec_sr (vector unsigned char,
+ vector unsigned char);
+ vector signed short vec_sr (vector signed short,
+ vector unsigned short);
+ vector unsigned short vec_sr (vector unsigned short,
+ vector unsigned short);
+ vector signed int vec_sr (vector signed int, vector unsigned int);
+ vector unsigned int vec_sr (vector unsigned int, vector unsigned int);
+
+ vector signed int vec_vsrw (vector signed int, vector unsigned int);
+ vector unsigned int vec_vsrw (vector unsigned int, vector unsigned int);
+
+ vector signed short vec_vsrh (vector signed short,
+ vector unsigned short);
+ vector unsigned short vec_vsrh (vector unsigned short,
+ vector unsigned short);
+
+ vector signed char vec_vsrb (vector signed char, vector unsigned char);
+ vector unsigned char vec_vsrb (vector unsigned char,
+ vector unsigned char);
+
+ vector signed char vec_sra (vector signed char, vector unsigned char);
+ vector unsigned char vec_sra (vector unsigned char,
+ vector unsigned char);
+ vector signed short vec_sra (vector signed short,
+ vector unsigned short);
+ vector unsigned short vec_sra (vector unsigned short,
+ vector unsigned short);
+ vector signed int vec_sra (vector signed int, vector unsigned int);
+ vector unsigned int vec_sra (vector unsigned int, vector unsigned int);
+
+ vector signed int vec_vsraw (vector signed int, vector unsigned int);
+ vector unsigned int vec_vsraw (vector unsigned int,
+ vector unsigned int);
+
+ vector signed short vec_vsrah (vector signed short,
+ vector unsigned short);
+ vector unsigned short vec_vsrah (vector unsigned short,
+ vector unsigned short);
+
+ vector signed char vec_vsrab (vector signed char, vector unsigned char);
+ vector unsigned char vec_vsrab (vector unsigned char,
+ vector unsigned char);
+
+ vector signed int vec_srl (vector signed int, vector unsigned int);
+ vector signed int vec_srl (vector signed int, vector unsigned short);
+ vector signed int vec_srl (vector signed int, vector unsigned char);
+ vector unsigned int vec_srl (vector unsigned int, vector unsigned int);
+ vector unsigned int vec_srl (vector unsigned int,
+ vector unsigned short);
+ vector unsigned int vec_srl (vector unsigned int, vector unsigned char);
+ vector bool int vec_srl (vector bool int, vector unsigned int);
+ vector bool int vec_srl (vector bool int, vector unsigned short);
+ vector bool int vec_srl (vector bool int, vector unsigned char);
+ vector signed short vec_srl (vector signed short, vector unsigned int);
+ vector signed short vec_srl (vector signed short,
+ vector unsigned short);
+ vector signed short vec_srl (vector signed short, vector unsigned char);
+ vector unsigned short vec_srl (vector unsigned short,
+ vector unsigned int);
+ vector unsigned short vec_srl (vector unsigned short,
+ vector unsigned short);
+ vector unsigned short vec_srl (vector unsigned short,
+ vector unsigned char);
+ vector bool short vec_srl (vector bool short, vector unsigned int);
+ vector bool short vec_srl (vector bool short, vector unsigned short);
+ vector bool short vec_srl (vector bool short, vector unsigned char);
+ vector pixel vec_srl (vector pixel, vector unsigned int);
+ vector pixel vec_srl (vector pixel, vector unsigned short);
+ vector pixel vec_srl (vector pixel, vector unsigned char);
+ vector signed char vec_srl (vector signed char, vector unsigned int);
+ vector signed char vec_srl (vector signed char, vector unsigned short);
+ vector signed char vec_srl (vector signed char, vector unsigned char);
+ vector unsigned char vec_srl (vector unsigned char,
+ vector unsigned int);
+ vector unsigned char vec_srl (vector unsigned char,
+ vector unsigned short);
+ vector unsigned char vec_srl (vector unsigned char,
+ vector unsigned char);
+ vector bool char vec_srl (vector bool char, vector unsigned int);
+ vector bool char vec_srl (vector bool char, vector unsigned short);
+ vector bool char vec_srl (vector bool char, vector unsigned char);
+
+ vector float vec_sro (vector float, vector signed char);
+ vector float vec_sro (vector float, vector unsigned char);
+ vector signed int vec_sro (vector signed int, vector signed char);
+ vector signed int vec_sro (vector signed int, vector unsigned char);
+ vector unsigned int vec_sro (vector unsigned int, vector signed char);
+ vector unsigned int vec_sro (vector unsigned int, vector unsigned char);
+ vector signed short vec_sro (vector signed short, vector signed char);
+ vector signed short vec_sro (vector signed short, vector unsigned char);
+ vector unsigned short vec_sro (vector unsigned short,
+ vector signed char);
+ vector unsigned short vec_sro (vector unsigned short,
+ vector unsigned char);
+ vector pixel vec_sro (vector pixel, vector signed char);
+ vector pixel vec_sro (vector pixel, vector unsigned char);
+ vector signed char vec_sro (vector signed char, vector signed char);
+ vector signed char vec_sro (vector signed char, vector unsigned char);
+ vector unsigned char vec_sro (vector unsigned char, vector signed char);
+ vector unsigned char vec_sro (vector unsigned char,
+ vector unsigned char);
+
+ void vec_st (vector float, int, vector float *);
+ void vec_st (vector float, int, float *);
+ void vec_st (vector signed int, int, vector signed int *);
+ void vec_st (vector signed int, int, int *);
+ void vec_st (vector unsigned int, int, vector unsigned int *);
+ void vec_st (vector unsigned int, int, unsigned int *);
+ void vec_st (vector bool int, int, vector bool int *);
+ void vec_st (vector bool int, int, unsigned int *);
+ void vec_st (vector bool int, int, int *);
+ void vec_st (vector signed short, int, vector signed short *);
+ void vec_st (vector signed short, int, short *);
+ void vec_st (vector unsigned short, int, vector unsigned short *);
+ void vec_st (vector unsigned short, int, unsigned short *);
+ void vec_st (vector bool short, int, vector bool short *);
+ void vec_st (vector bool short, int, unsigned short *);
+ void vec_st (vector pixel, int, vector pixel *);
+ void vec_st (vector pixel, int, unsigned short *);
+ void vec_st (vector pixel, int, short *);
+ void vec_st (vector bool short, int, short *);
+ void vec_st (vector signed char, int, vector signed char *);
+ void vec_st (vector signed char, int, signed char *);
+ void vec_st (vector unsigned char, int, vector unsigned char *);
+ void vec_st (vector unsigned char, int, unsigned char *);
+ void vec_st (vector bool char, int, vector bool char *);
+ void vec_st (vector bool char, int, unsigned char *);
+ void vec_st (vector bool char, int, signed char *);
+
+ void vec_ste (vector signed char, int, signed char *);
+ void vec_ste (vector unsigned char, int, unsigned char *);
+ void vec_ste (vector bool char, int, signed char *);
+ void vec_ste (vector bool char, int, unsigned char *);
+ void vec_ste (vector signed short, int, short *);
+ void vec_ste (vector unsigned short, int, unsigned short *);
+ void vec_ste (vector bool short, int, short *);
+ void vec_ste (vector bool short, int, unsigned short *);
+ void vec_ste (vector pixel, int, short *);
+ void vec_ste (vector pixel, int, unsigned short *);
+ void vec_ste (vector float, int, float *);
+ void vec_ste (vector signed int, int, int *);
+ void vec_ste (vector unsigned int, int, unsigned int *);
+ void vec_ste (vector bool int, int, int *);
+ void vec_ste (vector bool int, int, unsigned int *);
+
+ void vec_stvewx (vector float, int, float *);
+ void vec_stvewx (vector signed int, int, int *);
+ void vec_stvewx (vector unsigned int, int, unsigned int *);
+ void vec_stvewx (vector bool int, int, int *);
+ void vec_stvewx (vector bool int, int, unsigned int *);
+
+ void vec_stvehx (vector signed short, int, short *);
+ void vec_stvehx (vector unsigned short, int, unsigned short *);
+ void vec_stvehx (vector bool short, int, short *);
+ void vec_stvehx (vector bool short, int, unsigned short *);
+ void vec_stvehx (vector pixel, int, short *);
+ void vec_stvehx (vector pixel, int, unsigned short *);
+
+ void vec_stvebx (vector signed char, int, signed char *);
+ void vec_stvebx (vector unsigned char, int, unsigned char *);
+ void vec_stvebx (vector bool char, int, signed char *);
+ void vec_stvebx (vector bool char, int, unsigned char *);
+
+ void vec_stl (vector float, int, vector float *);
+ void vec_stl (vector float, int, float *);
+ void vec_stl (vector signed int, int, vector signed int *);
+ void vec_stl (vector signed int, int, int *);
+ void vec_stl (vector unsigned int, int, vector unsigned int *);
+ void vec_stl (vector unsigned int, int, unsigned int *);
+ void vec_stl (vector bool int, int, vector bool int *);
+ void vec_stl (vector bool int, int, unsigned int *);
+ void vec_stl (vector bool int, int, int *);
+ void vec_stl (vector signed short, int, vector signed short *);
+ void vec_stl (vector signed short, int, short *);
+ void vec_stl (vector unsigned short, int, vector unsigned short *);
+ void vec_stl (vector unsigned short, int, unsigned short *);
+ void vec_stl (vector bool short, int, vector bool short *);
+ void vec_stl (vector bool short, int, unsigned short *);
+ void vec_stl (vector bool short, int, short *);
+ void vec_stl (vector pixel, int, vector pixel *);
+ void vec_stl (vector pixel, int, unsigned short *);
+ void vec_stl (vector pixel, int, short *);
+ void vec_stl (vector signed char, int, vector signed char *);
+ void vec_stl (vector signed char, int, signed char *);
+ void vec_stl (vector unsigned char, int, vector unsigned char *);
+ void vec_stl (vector unsigned char, int, unsigned char *);
+ void vec_stl (vector bool char, int, vector bool char *);
+ void vec_stl (vector bool char, int, unsigned char *);
+ void vec_stl (vector bool char, int, signed char *);
+
+ vector signed char vec_sub (vector bool char, vector signed char);
+ vector signed char vec_sub (vector signed char, vector bool char);
+ vector signed char vec_sub (vector signed char, vector signed char);
+ vector unsigned char vec_sub (vector bool char, vector unsigned char);
+ vector unsigned char vec_sub (vector unsigned char, vector bool char);
+ vector unsigned char vec_sub (vector unsigned char,
+ vector unsigned char);
+ vector signed short vec_sub (vector bool short, vector signed short);
+ vector signed short vec_sub (vector signed short, vector bool short);
+ vector signed short vec_sub (vector signed short, vector signed short);
+ vector unsigned short vec_sub (vector bool short,
+ vector unsigned short);
+ vector unsigned short vec_sub (vector unsigned short,
+ vector bool short);
+ vector unsigned short vec_sub (vector unsigned short,
+ vector unsigned short);
+ vector signed int vec_sub (vector bool int, vector signed int);
+ vector signed int vec_sub (vector signed int, vector bool int);
+ vector signed int vec_sub (vector signed int, vector signed int);
+ vector unsigned int vec_sub (vector bool int, vector unsigned int);
+ vector unsigned int vec_sub (vector unsigned int, vector bool int);
+ vector unsigned int vec_sub (vector unsigned int, vector unsigned int);
+ vector float vec_sub (vector float, vector float);
+
+ vector float vec_vsubfp (vector float, vector float);
+
+ vector signed int vec_vsubuwm (vector bool int, vector signed int);
+ vector signed int vec_vsubuwm (vector signed int, vector bool int);
+ vector signed int vec_vsubuwm (vector signed int, vector signed int);
+ vector unsigned int vec_vsubuwm (vector bool int, vector unsigned int);
+ vector unsigned int vec_vsubuwm (vector unsigned int, vector bool int);
+ vector unsigned int vec_vsubuwm (vector unsigned int,
+ vector unsigned int);
+
+ vector signed short vec_vsubuhm (vector bool short,
+ vector signed short);
+ vector signed short vec_vsubuhm (vector signed short,
+ vector bool short);
+ vector signed short vec_vsubuhm (vector signed short,
+ vector signed short);
+ vector unsigned short vec_vsubuhm (vector bool short,
+ vector unsigned short);
+ vector unsigned short vec_vsubuhm (vector unsigned short,
+ vector bool short);
+ vector unsigned short vec_vsubuhm (vector unsigned short,
+ vector unsigned short);
+
+ vector signed char vec_vsububm (vector bool char, vector signed char);
+ vector signed char vec_vsububm (vector signed char, vector bool char);
+ vector signed char vec_vsububm (vector signed char, vector signed char);
+ vector unsigned char vec_vsububm (vector bool char,
+ vector unsigned char);
+ vector unsigned char vec_vsububm (vector unsigned char,
+ vector bool char);
+ vector unsigned char vec_vsububm (vector unsigned char,
+ vector unsigned char);
+
+ vector unsigned int vec_subc (vector unsigned int, vector unsigned int);
+
+ vector unsigned char vec_subs (vector bool char, vector unsigned char);
+ vector unsigned char vec_subs (vector unsigned char, vector bool char);
+ vector unsigned char vec_subs (vector unsigned char,
+ vector unsigned char);
+ vector signed char vec_subs (vector bool char, vector signed char);
+ vector signed char vec_subs (vector signed char, vector bool char);
+ vector signed char vec_subs (vector signed char, vector signed char);
+ vector unsigned short vec_subs (vector bool short,
+ vector unsigned short);
+ vector unsigned short vec_subs (vector unsigned short,
+ vector bool short);
+ vector unsigned short vec_subs (vector unsigned short,
+ vector unsigned short);
+ vector signed short vec_subs (vector bool short, vector signed short);
+ vector signed short vec_subs (vector signed short, vector bool short);
+ vector signed short vec_subs (vector signed short, vector signed short);
+ vector unsigned int vec_subs (vector bool int, vector unsigned int);
+ vector unsigned int vec_subs (vector unsigned int, vector bool int);
+ vector unsigned int vec_subs (vector unsigned int, vector unsigned int);
+ vector signed int vec_subs (vector bool int, vector signed int);
+ vector signed int vec_subs (vector signed int, vector bool int);
+ vector signed int vec_subs (vector signed int, vector signed int);
+
+ vector signed int vec_vsubsws (vector bool int, vector signed int);
+ vector signed int vec_vsubsws (vector signed int, vector bool int);
+ vector signed int vec_vsubsws (vector signed int, vector signed int);
+
+ vector unsigned int vec_vsubuws (vector bool int, vector unsigned int);
+ vector unsigned int vec_vsubuws (vector unsigned int, vector bool int);
+ vector unsigned int vec_vsubuws (vector unsigned int,
+ vector unsigned int);
+
+ vector signed short vec_vsubshs (vector bool short,
+ vector signed short);
+ vector signed short vec_vsubshs (vector signed short,
+ vector bool short);
+ vector signed short vec_vsubshs (vector signed short,
+ vector signed short);
+
+ vector unsigned short vec_vsubuhs (vector bool short,
+ vector unsigned short);
+ vector unsigned short vec_vsubuhs (vector unsigned short,
+ vector bool short);
+ vector unsigned short vec_vsubuhs (vector unsigned short,
+ vector unsigned short);
+
+ vector signed char vec_vsubsbs (vector bool char, vector signed char);
+ vector signed char vec_vsubsbs (vector signed char, vector bool char);
+ vector signed char vec_vsubsbs (vector signed char, vector signed char);
+
+ vector unsigned char vec_vsububs (vector bool char,
+ vector unsigned char);
+ vector unsigned char vec_vsububs (vector unsigned char,
+ vector bool char);
+ vector unsigned char vec_vsububs (vector unsigned char,
+ vector unsigned char);
+
+ vector unsigned int vec_sum4s (vector unsigned char,
+ vector unsigned int);
+ vector signed int vec_sum4s (vector signed char, vector signed int);
+ vector signed int vec_sum4s (vector signed short, vector signed int);
+
+ vector signed int vec_vsum4shs (vector signed short, vector signed int);
+
+ vector signed int vec_vsum4sbs (vector signed char, vector signed int);
+
+ vector unsigned int vec_vsum4ubs (vector unsigned char,
+ vector unsigned int);
+
+ vector signed int vec_sum2s (vector signed int, vector signed int);
+
+ vector signed int vec_sums (vector signed int, vector signed int);
+
+ vector float vec_trunc (vector float);
+
+ vector signed short vec_unpackh (vector signed char);
+ vector bool short vec_unpackh (vector bool char);
+ vector signed int vec_unpackh (vector signed short);
+ vector bool int vec_unpackh (vector bool short);
+ vector unsigned int vec_unpackh (vector pixel);
+
+ vector bool int vec_vupkhsh (vector bool short);
+ vector signed int vec_vupkhsh (vector signed short);
+
+ vector unsigned int vec_vupkhpx (vector pixel);
+
+ vector bool short vec_vupkhsb (vector bool char);
+ vector signed short vec_vupkhsb (vector signed char);
+
+ vector signed short vec_unpackl (vector signed char);
+ vector bool short vec_unpackl (vector bool char);
+ vector unsigned int vec_unpackl (vector pixel);
+ vector signed int vec_unpackl (vector signed short);
+ vector bool int vec_unpackl (vector bool short);
+
+ vector unsigned int vec_vupklpx (vector pixel);
+
+ vector bool int vec_vupklsh (vector bool short);
+ vector signed int vec_vupklsh (vector signed short);
+
+ vector bool short vec_vupklsb (vector bool char);
+ vector signed short vec_vupklsb (vector signed char);
+
+ vector float vec_xor (vector float, vector float);
+ vector float vec_xor (vector float, vector bool int);
+ vector float vec_xor (vector bool int, vector float);
+ vector bool int vec_xor (vector bool int, vector bool int);
+ vector signed int vec_xor (vector bool int, vector signed int);
+ vector signed int vec_xor (vector signed int, vector bool int);
+ vector signed int vec_xor (vector signed int, vector signed int);
+ vector unsigned int vec_xor (vector bool int, vector unsigned int);
+ vector unsigned int vec_xor (vector unsigned int, vector bool int);
+ vector unsigned int vec_xor (vector unsigned int, vector unsigned int);
+ vector bool short vec_xor (vector bool short, vector bool short);
+ vector signed short vec_xor (vector bool short, vector signed short);
+ vector signed short vec_xor (vector signed short, vector bool short);
+ vector signed short vec_xor (vector signed short, vector signed short);
+ vector unsigned short vec_xor (vector bool short,
+ vector unsigned short);
+ vector unsigned short vec_xor (vector unsigned short,
+ vector bool short);
+ vector unsigned short vec_xor (vector unsigned short,
+ vector unsigned short);
+ vector signed char vec_xor (vector bool char, vector signed char);
+ vector bool char vec_xor (vector bool char, vector bool char);
+ vector signed char vec_xor (vector signed char, vector bool char);
+ vector signed char vec_xor (vector signed char, vector signed char);
+ vector unsigned char vec_xor (vector bool char, vector unsigned char);
+ vector unsigned char vec_xor (vector unsigned char, vector bool char);
+ vector unsigned char vec_xor (vector unsigned char,
+ vector unsigned char);
+
+ int vec_all_eq (vector signed char, vector bool char);
+ int vec_all_eq (vector signed char, vector signed char);
+ int vec_all_eq (vector unsigned char, vector bool char);
+ int vec_all_eq (vector unsigned char, vector unsigned char);
+ int vec_all_eq (vector bool char, vector bool char);
+ int vec_all_eq (vector bool char, vector unsigned char);
+ int vec_all_eq (vector bool char, vector signed char);
+ int vec_all_eq (vector signed short, vector bool short);
+ int vec_all_eq (vector signed short, vector signed short);
+ int vec_all_eq (vector unsigned short, vector bool short);
+ int vec_all_eq (vector unsigned short, vector unsigned short);
+ int vec_all_eq (vector bool short, vector bool short);
+ int vec_all_eq (vector bool short, vector unsigned short);
+ int vec_all_eq (vector bool short, vector signed short);
+ int vec_all_eq (vector pixel, vector pixel);
+ int vec_all_eq (vector signed int, vector bool int);
+ int vec_all_eq (vector signed int, vector signed int);
+ int vec_all_eq (vector unsigned int, vector bool int);
+ int vec_all_eq (vector unsigned int, vector unsigned int);
+ int vec_all_eq (vector bool int, vector bool int);
+ int vec_all_eq (vector bool int, vector unsigned int);
+ int vec_all_eq (vector bool int, vector signed int);
+ int vec_all_eq (vector float, vector float);
+
+ int vec_all_ge (vector bool char, vector unsigned char);
+ int vec_all_ge (vector unsigned char, vector bool char);
+ int vec_all_ge (vector unsigned char, vector unsigned char);
+ int vec_all_ge (vector bool char, vector signed char);
+ int vec_all_ge (vector signed char, vector bool char);
+ int vec_all_ge (vector signed char, vector signed char);
+ int vec_all_ge (vector bool short, vector unsigned short);
+ int vec_all_ge (vector unsigned short, vector bool short);
+ int vec_all_ge (vector unsigned short, vector unsigned short);
+ int vec_all_ge (vector signed short, vector signed short);
+ int vec_all_ge (vector bool short, vector signed short);
+ int vec_all_ge (vector signed short, vector bool short);
+ int vec_all_ge (vector bool int, vector unsigned int);
+ int vec_all_ge (vector unsigned int, vector bool int);
+ int vec_all_ge (vector unsigned int, vector unsigned int);
+ int vec_all_ge (vector bool int, vector signed int);
+ int vec_all_ge (vector signed int, vector bool int);
+ int vec_all_ge (vector signed int, vector signed int);
+ int vec_all_ge (vector float, vector float);
+
+ int vec_all_gt (vector bool char, vector unsigned char);
+ int vec_all_gt (vector unsigned char, vector bool char);
+ int vec_all_gt (vector unsigned char, vector unsigned char);
+ int vec_all_gt (vector bool char, vector signed char);
+ int vec_all_gt (vector signed char, vector bool char);
+ int vec_all_gt (vector signed char, vector signed char);
+ int vec_all_gt (vector bool short, vector unsigned short);
+ int vec_all_gt (vector unsigned short, vector bool short);
+ int vec_all_gt (vector unsigned short, vector unsigned short);
+ int vec_all_gt (vector bool short, vector signed short);
+ int vec_all_gt (vector signed short, vector bool short);
+ int vec_all_gt (vector signed short, vector signed short);
+ int vec_all_gt (vector bool int, vector unsigned int);
+ int vec_all_gt (vector unsigned int, vector bool int);
+ int vec_all_gt (vector unsigned int, vector unsigned int);
+ int vec_all_gt (vector bool int, vector signed int);
+ int vec_all_gt (vector signed int, vector bool int);
+ int vec_all_gt (vector signed int, vector signed int);
+ int vec_all_gt (vector float, vector float);
+
+ int vec_all_in (vector float, vector float);
+
+ int vec_all_le (vector bool char, vector unsigned char);
+ int vec_all_le (vector unsigned char, vector bool char);
+ int vec_all_le (vector unsigned char, vector unsigned char);
+ int vec_all_le (vector bool char, vector signed char);
+ int vec_all_le (vector signed char, vector bool char);
+ int vec_all_le (vector signed char, vector signed char);
+ int vec_all_le (vector bool short, vector unsigned short);
+ int vec_all_le (vector unsigned short, vector bool short);
+ int vec_all_le (vector unsigned short, vector unsigned short);
+ int vec_all_le (vector bool short, vector signed short);
+ int vec_all_le (vector signed short, vector bool short);
+ int vec_all_le (vector signed short, vector signed short);
+ int vec_all_le (vector bool int, vector unsigned int);
+ int vec_all_le (vector unsigned int, vector bool int);
+ int vec_all_le (vector unsigned int, vector unsigned int);
+ int vec_all_le (vector bool int, vector signed int);
+ int vec_all_le (vector signed int, vector bool int);
+ int vec_all_le (vector signed int, vector signed int);
+ int vec_all_le (vector float, vector float);
+
+ int vec_all_lt (vector bool char, vector unsigned char);
+ int vec_all_lt (vector unsigned char, vector bool char);
+ int vec_all_lt (vector unsigned char, vector unsigned char);
+ int vec_all_lt (vector bool char, vector signed char);
+ int vec_all_lt (vector signed char, vector bool char);
+ int vec_all_lt (vector signed char, vector signed char);
+ int vec_all_lt (vector bool short, vector unsigned short);
+ int vec_all_lt (vector unsigned short, vector bool short);
+ int vec_all_lt (vector unsigned short, vector unsigned short);
+ int vec_all_lt (vector bool short, vector signed short);
+ int vec_all_lt (vector signed short, vector bool short);
+ int vec_all_lt (vector signed short, vector signed short);
+ int vec_all_lt (vector bool int, vector unsigned int);
+ int vec_all_lt (vector unsigned int, vector bool int);
+ int vec_all_lt (vector unsigned int, vector unsigned int);
+ int vec_all_lt (vector bool int, vector signed int);
+ int vec_all_lt (vector signed int, vector bool int);
+ int vec_all_lt (vector signed int, vector signed int);
+ int vec_all_lt (vector float, vector float);
+
+ int vec_all_nan (vector float);
+
+ int vec_all_ne (vector signed char, vector bool char);
+ int vec_all_ne (vector signed char, vector signed char);
+ int vec_all_ne (vector unsigned char, vector bool char);
+ int vec_all_ne (vector unsigned char, vector unsigned char);
+ int vec_all_ne (vector bool char, vector bool char);
+ int vec_all_ne (vector bool char, vector unsigned char);
+ int vec_all_ne (vector bool char, vector signed char);
+ int vec_all_ne (vector signed short, vector bool short);
+ int vec_all_ne (vector signed short, vector signed short);
+ int vec_all_ne (vector unsigned short, vector bool short);
+ int vec_all_ne (vector unsigned short, vector unsigned short);
+ int vec_all_ne (vector bool short, vector bool short);
+ int vec_all_ne (vector bool short, vector unsigned short);
+ int vec_all_ne (vector bool short, vector signed short);
+ int vec_all_ne (vector pixel, vector pixel);
+ int vec_all_ne (vector signed int, vector bool int);
+ int vec_all_ne (vector signed int, vector signed int);
+ int vec_all_ne (vector unsigned int, vector bool int);
+ int vec_all_ne (vector unsigned int, vector unsigned int);
+ int vec_all_ne (vector bool int, vector bool int);
+ int vec_all_ne (vector bool int, vector unsigned int);
+ int vec_all_ne (vector bool int, vector signed int);
+ int vec_all_ne (vector float, vector float);
+
+ int vec_all_nge (vector float, vector float);
+
+ int vec_all_ngt (vector float, vector float);
+
+ int vec_all_nle (vector float, vector float);
+
+ int vec_all_nlt (vector float, vector float);
+
+ int vec_all_numeric (vector float);
+
+ int vec_any_eq (vector signed char, vector bool char);
+ int vec_any_eq (vector signed char, vector signed char);
+ int vec_any_eq (vector unsigned char, vector bool char);
+ int vec_any_eq (vector unsigned char, vector unsigned char);
+ int vec_any_eq (vector bool char, vector bool char);
+ int vec_any_eq (vector bool char, vector unsigned char);
+ int vec_any_eq (vector bool char, vector signed char);
+ int vec_any_eq (vector signed short, vector bool short);
+ int vec_any_eq (vector signed short, vector signed short);
+ int vec_any_eq (vector unsigned short, vector bool short);
+ int vec_any_eq (vector unsigned short, vector unsigned short);
+ int vec_any_eq (vector bool short, vector bool short);
+ int vec_any_eq (vector bool short, vector unsigned short);
+ int vec_any_eq (vector bool short, vector signed short);
+ int vec_any_eq (vector pixel, vector pixel);
+ int vec_any_eq (vector signed int, vector bool int);
+ int vec_any_eq (vector signed int, vector signed int);
+ int vec_any_eq (vector unsigned int, vector bool int);
+ int vec_any_eq (vector unsigned int, vector unsigned int);
+ int vec_any_eq (vector bool int, vector bool int);
+ int vec_any_eq (vector bool int, vector unsigned int);
+ int vec_any_eq (vector bool int, vector signed int);
+ int vec_any_eq (vector float, vector float);
+
+ int vec_any_ge (vector signed char, vector bool char);
+ int vec_any_ge (vector unsigned char, vector bool char);
+ int vec_any_ge (vector unsigned char, vector unsigned char);
+ int vec_any_ge (vector signed char, vector signed char);
+ int vec_any_ge (vector bool char, vector unsigned char);
+ int vec_any_ge (vector bool char, vector signed char);
+ int vec_any_ge (vector unsigned short, vector bool short);
+ int vec_any_ge (vector unsigned short, vector unsigned short);
+ int vec_any_ge (vector signed short, vector signed short);
+ int vec_any_ge (vector signed short, vector bool short);
+ int vec_any_ge (vector bool short, vector unsigned short);
+ int vec_any_ge (vector bool short, vector signed short);
+ int vec_any_ge (vector signed int, vector bool int);
+ int vec_any_ge (vector unsigned int, vector bool int);
+ int vec_any_ge (vector unsigned int, vector unsigned int);
+ int vec_any_ge (vector signed int, vector signed int);
+ int vec_any_ge (vector bool int, vector unsigned int);
+ int vec_any_ge (vector bool int, vector signed int);
+ int vec_any_ge (vector float, vector float);
+
+ int vec_any_gt (vector bool char, vector unsigned char);
+ int vec_any_gt (vector unsigned char, vector bool char);
+ int vec_any_gt (vector unsigned char, vector unsigned char);
+ int vec_any_gt (vector bool char, vector signed char);
+ int vec_any_gt (vector signed char, vector bool char);
+ int vec_any_gt (vector signed char, vector signed char);
+ int vec_any_gt (vector bool short, vector unsigned short);
+ int vec_any_gt (vector unsigned short, vector bool short);
+ int vec_any_gt (vector unsigned short, vector unsigned short);
+ int vec_any_gt (vector bool short, vector signed short);
+ int vec_any_gt (vector signed short, vector bool short);
+ int vec_any_gt (vector signed short, vector signed short);
+ int vec_any_gt (vector bool int, vector unsigned int);
+ int vec_any_gt (vector unsigned int, vector bool int);
+ int vec_any_gt (vector unsigned int, vector unsigned int);
+ int vec_any_gt (vector bool int, vector signed int);
+ int vec_any_gt (vector signed int, vector bool int);
+ int vec_any_gt (vector signed int, vector signed int);
+ int vec_any_gt (vector float, vector float);
+
+ int vec_any_le (vector bool char, vector unsigned char);
+ int vec_any_le (vector unsigned char, vector bool char);
+ int vec_any_le (vector unsigned char, vector unsigned char);
+ int vec_any_le (vector bool char, vector signed char);
+ int vec_any_le (vector signed char, vector bool char);
+ int vec_any_le (vector signed char, vector signed char);
+ int vec_any_le (vector bool short, vector unsigned short);
+ int vec_any_le (vector unsigned short, vector bool short);
+ int vec_any_le (vector unsigned short, vector unsigned short);
+ int vec_any_le (vector bool short, vector signed short);
+ int vec_any_le (vector signed short, vector bool short);
+ int vec_any_le (vector signed short, vector signed short);
+ int vec_any_le (vector bool int, vector unsigned int);
+ int vec_any_le (vector unsigned int, vector bool int);
+ int vec_any_le (vector unsigned int, vector unsigned int);
+ int vec_any_le (vector bool int, vector signed int);
+ int vec_any_le (vector signed int, vector bool int);
+ int vec_any_le (vector signed int, vector signed int);
+ int vec_any_le (vector float, vector float);
+
+ int vec_any_lt (vector bool char, vector unsigned char);
+ int vec_any_lt (vector unsigned char, vector bool char);
+ int vec_any_lt (vector unsigned char, vector unsigned char);
+ int vec_any_lt (vector bool char, vector signed char);
+ int vec_any_lt (vector signed char, vector bool char);
+ int vec_any_lt (vector signed char, vector signed char);
+ int vec_any_lt (vector bool short, vector unsigned short);
+ int vec_any_lt (vector unsigned short, vector bool short);
+ int vec_any_lt (vector unsigned short, vector unsigned short);
+ int vec_any_lt (vector bool short, vector signed short);
+ int vec_any_lt (vector signed short, vector bool short);
+ int vec_any_lt (vector signed short, vector signed short);
+ int vec_any_lt (vector bool int, vector unsigned int);
+ int vec_any_lt (vector unsigned int, vector bool int);
+ int vec_any_lt (vector unsigned int, vector unsigned int);
+ int vec_any_lt (vector bool int, vector signed int);
+ int vec_any_lt (vector signed int, vector bool int);
+ int vec_any_lt (vector signed int, vector signed int);
+ int vec_any_lt (vector float, vector float);
+
+ int vec_any_nan (vector float);
+
+ int vec_any_ne (vector signed char, vector bool char);
+ int vec_any_ne (vector signed char, vector signed char);
+ int vec_any_ne (vector unsigned char, vector bool char);
+ int vec_any_ne (vector unsigned char, vector unsigned char);
+ int vec_any_ne (vector bool char, vector bool char);
+ int vec_any_ne (vector bool char, vector unsigned char);
+ int vec_any_ne (vector bool char, vector signed char);
+ int vec_any_ne (vector signed short, vector bool short);
+ int vec_any_ne (vector signed short, vector signed short);
+ int vec_any_ne (vector unsigned short, vector bool short);
+ int vec_any_ne (vector unsigned short, vector unsigned short);
+ int vec_any_ne (vector bool short, vector bool short);
+ int vec_any_ne (vector bool short, vector unsigned short);
+ int vec_any_ne (vector bool short, vector signed short);
+ int vec_any_ne (vector pixel, vector pixel);
+ int vec_any_ne (vector signed int, vector bool int);
+ int vec_any_ne (vector signed int, vector signed int);
+ int vec_any_ne (vector unsigned int, vector bool int);
+ int vec_any_ne (vector unsigned int, vector unsigned int);
+ int vec_any_ne (vector bool int, vector bool int);
+ int vec_any_ne (vector bool int, vector unsigned int);
+ int vec_any_ne (vector bool int, vector signed int);
+ int vec_any_ne (vector float, vector float);
+
+ int vec_any_nge (vector float, vector float);
+
+ int vec_any_ngt (vector float, vector float);
+
+ int vec_any_nle (vector float, vector float);
+
+ int vec_any_nlt (vector float, vector float);
+
+ int vec_any_numeric (vector float);
+
+ int vec_any_out (vector float, vector float);
+
+
+File: gcc.info, Node: SPARC VIS Built-in Functions, Next: SPU Built-in Functions, Prev: PowerPC AltiVec Built-in Functions, Up: Target Builtins
+
+5.50.13 SPARC VIS Built-in Functions
+------------------------------------
+
+GCC supports SIMD operations on the SPARC using both the generic vector
+extensions (*note Vector Extensions::) as well as built-in functions for
+the SPARC Visual Instruction Set (VIS). When you use the `-mvis'
+switch, the VIS extension is exposed as the following built-in
+functions:
+
+ typedef int v2si __attribute__ ((vector_size (8)));
+ typedef short v4hi __attribute__ ((vector_size (8)));
+ typedef short v2hi __attribute__ ((vector_size (4)));
+ typedef char v8qi __attribute__ ((vector_size (8)));
+ typedef char v4qi __attribute__ ((vector_size (4)));
+
+ void * __builtin_vis_alignaddr (void *, long);
+ int64_t __builtin_vis_faligndatadi (int64_t, int64_t);
+ v2si __builtin_vis_faligndatav2si (v2si, v2si);
+ v4hi __builtin_vis_faligndatav4hi (v4si, v4si);
+ v8qi __builtin_vis_faligndatav8qi (v8qi, v8qi);
+
+ v4hi __builtin_vis_fexpand (v4qi);
+
+ v4hi __builtin_vis_fmul8x16 (v4qi, v4hi);
+ v4hi __builtin_vis_fmul8x16au (v4qi, v4hi);
+ v4hi __builtin_vis_fmul8x16al (v4qi, v4hi);
+ v4hi __builtin_vis_fmul8sux16 (v8qi, v4hi);
+ v4hi __builtin_vis_fmul8ulx16 (v8qi, v4hi);
+ v2si __builtin_vis_fmuld8sux16 (v4qi, v2hi);
+ v2si __builtin_vis_fmuld8ulx16 (v4qi, v2hi);
+
+ v4qi __builtin_vis_fpack16 (v4hi);
+ v8qi __builtin_vis_fpack32 (v2si, v2si);
+ v2hi __builtin_vis_fpackfix (v2si);
+ v8qi __builtin_vis_fpmerge (v4qi, v4qi);
+
+ int64_t __builtin_vis_pdist (v8qi, v8qi, int64_t);
+
+
+File: gcc.info, Node: SPU Built-in Functions, Prev: SPARC VIS Built-in Functions, Up: Target Builtins
+
+5.50.14 SPU Built-in Functions
+------------------------------
+
+GCC provides extensions for the SPU processor as described in the
+Sony/Toshiba/IBM SPU Language Extensions Specification, which can be
+found at `http://cell.scei.co.jp/' or
+`http://www.ibm.com/developerworks/power/cell/'. GCC's implementation
+differs in several ways.
+
+ * The optional extension of specifying vector constants in
+ parentheses is not supported.
+
+ * A vector initializer requires no cast if the vector constant is of
+ the same type as the variable it is initializing.
+
+ * If `signed' or `unsigned' is omitted, the signedness of the vector
+ type is the default signedness of the base type. The default
+ varies depending on the operating system, so a portable program
+ should always specify the signedness.
+
+ * By default, the keyword `__vector' is added. The macro `vector' is
+ defined in `<spu_intrinsics.h>' and can be undefined.
+
+ * GCC allows using a `typedef' name as the type specifier for a
+ vector type.
+
+ * For C, overloaded functions are implemented with macros so the
+ following does not work:
+
+ spu_add ((vector signed int){1, 2, 3, 4}, foo);
+
+ Since `spu_add' is a macro, the vector constant in the example is
+ treated as four separate arguments. Wrap the entire argument in
+ parentheses for this to work.
+
+ * The extended version of `__builtin_expect' is not supported.
+
+
+ _Note:_ Only the interface described in the aforementioned
+specification is supported. Internally, GCC uses built-in functions to
+implement the required functionality, but these are not supported and
+are subject to change without notice.
+
+
+File: gcc.info, Node: Target Format Checks, Next: Pragmas, Prev: Target Builtins, Up: C Extensions
+
+5.51 Format Checks Specific to Particular Target Machines
+=========================================================
+
+For some target machines, GCC supports additional options to the format
+attribute (*note Declaring Attributes of Functions: Function
+Attributes.).
+
+* Menu:
+
+* Solaris Format Checks::
+
+
+File: gcc.info, Node: Solaris Format Checks, Up: Target Format Checks
+
+5.51.1 Solaris Format Checks
+----------------------------
+
+Solaris targets support the `cmn_err' (or `__cmn_err__') format check.
+`cmn_err' accepts a subset of the standard `printf' conversions, and
+the two-argument `%b' conversion for displaying bit-fields. See the
+Solaris man page for `cmn_err' for more information.
+
+
+File: gcc.info, Node: Pragmas, Next: Unnamed Fields, Prev: Target Format Checks, Up: C Extensions
+
+5.52 Pragmas Accepted by GCC
+============================
+
+GCC supports several types of pragmas, primarily in order to compile
+code originally written for other compilers. Note that in general we
+do not recommend the use of pragmas; *Note Function Attributes::, for
+further explanation.
+
+* Menu:
+
+* ARM Pragmas::
+* M32C Pragmas::
+* RS/6000 and PowerPC Pragmas::
+* Darwin Pragmas::
+* Solaris Pragmas::
+* Symbol-Renaming Pragmas::
+* Structure-Packing Pragmas::
+* Weak Pragmas::
+* Diagnostic Pragmas::
+* Visibility Pragmas::
+* Push/Pop Macro Pragmas::
+* Function Specific Option Pragmas::
+
+
+File: gcc.info, Node: ARM Pragmas, Next: M32C Pragmas, Up: Pragmas
+
+5.52.1 ARM Pragmas
+------------------
+
+The ARM target defines pragmas for controlling the default addition of
+`long_call' and `short_call' attributes to functions. *Note Function
+Attributes::, for information about the effects of these attributes.
+
+`long_calls'
+ Set all subsequent functions to have the `long_call' attribute.
+
+`no_long_calls'
+ Set all subsequent functions to have the `short_call' attribute.
+
+`long_calls_off'
+ Do not affect the `long_call' or `short_call' attributes of
+ subsequent functions.
+
+
+File: gcc.info, Node: M32C Pragmas, Next: RS/6000 and PowerPC Pragmas, Prev: ARM Pragmas, Up: Pragmas
+
+5.52.2 M32C Pragmas
+-------------------
+
+`memregs NUMBER'
+ Overrides the command line option `-memregs=' for the current
+ file. Use with care! This pragma must be before any function in
+ the file, and mixing different memregs values in different objects
+ may make them incompatible. This pragma is useful when a
+ performance-critical function uses a memreg for temporary values,
+ as it may allow you to reduce the number of memregs used.
+
+
+
+File: gcc.info, Node: RS/6000 and PowerPC Pragmas, Next: Darwin Pragmas, Prev: M32C Pragmas, Up: Pragmas
+
+5.52.3 RS/6000 and PowerPC Pragmas
+----------------------------------
+
+The RS/6000 and PowerPC targets define one pragma for controlling
+whether or not the `longcall' attribute is added to function
+declarations by default. This pragma overrides the `-mlongcall'
+option, but not the `longcall' and `shortcall' attributes. *Note
+RS/6000 and PowerPC Options::, for more information about when long
+calls are and are not necessary.
+
+`longcall (1)'
+ Apply the `longcall' attribute to all subsequent function
+ declarations.
+
+`longcall (0)'
+ Do not apply the `longcall' attribute to subsequent function
+ declarations.
+
+
+File: gcc.info, Node: Darwin Pragmas, Next: Solaris Pragmas, Prev: RS/6000 and PowerPC Pragmas, Up: Pragmas
+
+5.52.4 Darwin Pragmas
+---------------------
+
+The following pragmas are available for all architectures running the
+Darwin operating system. These are useful for compatibility with other
+Mac OS compilers.
+
+`mark TOKENS...'
+ This pragma is accepted, but has no effect.
+
+`options align=ALIGNMENT'
+ This pragma sets the alignment of fields in structures. The
+ values of ALIGNMENT may be `mac68k', to emulate m68k alignment, or
+ `power', to emulate PowerPC alignment. Uses of this pragma nest
+ properly; to restore the previous setting, use `reset' for the
+ ALIGNMENT.
+
+`segment TOKENS...'
+ This pragma is accepted, but has no effect.
+
+`unused (VAR [, VAR]...)'
+ This pragma declares variables to be possibly unused. GCC will not
+ produce warnings for the listed variables. The effect is similar
+ to that of the `unused' attribute, except that this pragma may
+ appear anywhere within the variables' scopes.
+
+
+File: gcc.info, Node: Solaris Pragmas, Next: Symbol-Renaming Pragmas, Prev: Darwin Pragmas, Up: Pragmas
+
+5.52.5 Solaris Pragmas
+----------------------
+
+The Solaris target supports `#pragma redefine_extname' (*note
+Symbol-Renaming Pragmas::). It also supports additional `#pragma'
+directives for compatibility with the system compiler.
+
+`align ALIGNMENT (VARIABLE [, VARIABLE]...)'
+ Increase the minimum alignment of each VARIABLE to ALIGNMENT.
+ This is the same as GCC's `aligned' attribute *note Variable
+ Attributes::). Macro expansion occurs on the arguments to this
+ pragma when compiling C and Objective-C. It does not currently
+ occur when compiling C++, but this is a bug which may be fixed in
+ a future release.
+
+`fini (FUNCTION [, FUNCTION]...)'
+ This pragma causes each listed FUNCTION to be called after main,
+ or during shared module unloading, by adding a call to the `.fini'
+ section.
+
+`init (FUNCTION [, FUNCTION]...)'
+ This pragma causes each listed FUNCTION to be called during
+ initialization (before `main') or during shared module loading, by
+ adding a call to the `.init' section.
+
+
+
+File: gcc.info, Node: Symbol-Renaming Pragmas, Next: Structure-Packing Pragmas, Prev: Solaris Pragmas, Up: Pragmas
+
+5.52.6 Symbol-Renaming Pragmas
+------------------------------
+
+For compatibility with the Solaris and Tru64 UNIX system headers, GCC
+supports two `#pragma' directives which change the name used in
+assembly for a given declaration. These pragmas are only available on
+platforms whose system headers need them. To get this effect on all
+platforms supported by GCC, use the asm labels extension (*note Asm
+Labels::).
+
+`redefine_extname OLDNAME NEWNAME'
+ This pragma gives the C function OLDNAME the assembly symbol
+ NEWNAME. The preprocessor macro `__PRAGMA_REDEFINE_EXTNAME' will
+ be defined if this pragma is available (currently only on Solaris).
+
+`extern_prefix STRING'
+ This pragma causes all subsequent external function and variable
+ declarations to have STRING prepended to their assembly symbols.
+ This effect may be terminated with another `extern_prefix' pragma
+ whose argument is an empty string. The preprocessor macro
+ `__PRAGMA_EXTERN_PREFIX' will be defined if this pragma is
+ available (currently only on Tru64 UNIX).
+
+ These pragmas and the asm labels extension interact in a complicated
+manner. Here are some corner cases you may want to be aware of.
+
+ 1. Both pragmas silently apply only to declarations with external
+ linkage. Asm labels do not have this restriction.
+
+ 2. In C++, both pragmas silently apply only to declarations with "C"
+ linkage. Again, asm labels do not have this restriction.
+
+ 3. If any of the three ways of changing the assembly name of a
+ declaration is applied to a declaration whose assembly name has
+ already been determined (either by a previous use of one of these
+ features, or because the compiler needed the assembly name in
+ order to generate code), and the new name is different, a warning
+ issues and the name does not change.
+
+ 4. The OLDNAME used by `#pragma redefine_extname' is always the
+ C-language name.
+
+ 5. If `#pragma extern_prefix' is in effect, and a declaration occurs
+ with an asm label attached, the prefix is silently ignored for
+ that declaration.
+
+ 6. If `#pragma extern_prefix' and `#pragma redefine_extname' apply to
+ the same declaration, whichever triggered first wins, and a
+ warning issues if they contradict each other. (We would like to
+ have `#pragma redefine_extname' always win, for consistency with
+ asm labels, but if `#pragma extern_prefix' triggers first we have
+ no way of knowing that that happened.)
+
+
+File: gcc.info, Node: Structure-Packing Pragmas, Next: Weak Pragmas, Prev: Symbol-Renaming Pragmas, Up: Pragmas
+
+5.52.7 Structure-Packing Pragmas
+--------------------------------
+
+For compatibility with Microsoft Windows compilers, GCC supports a set
+of `#pragma' directives which change the maximum alignment of members
+of structures (other than zero-width bitfields), unions, and classes
+subsequently defined. The N value below always is required to be a
+small power of two and specifies the new alignment in bytes.
+
+ 1. `#pragma pack(N)' simply sets the new alignment.
+
+ 2. `#pragma pack()' sets the alignment to the one that was in effect
+ when compilation started (see also command line option
+ `-fpack-struct[=<n>]' *note Code Gen Options::).
+
+ 3. `#pragma pack(push[,N])' pushes the current alignment setting on
+ an internal stack and then optionally sets the new alignment.
+
+ 4. `#pragma pack(pop)' restores the alignment setting to the one
+ saved at the top of the internal stack (and removes that stack
+ entry). Note that `#pragma pack([N])' does not influence this
+ internal stack; thus it is possible to have `#pragma pack(push)'
+ followed by multiple `#pragma pack(N)' instances and finalized by
+ a single `#pragma pack(pop)'.
+
+ Some targets, e.g. i386 and powerpc, support the `ms_struct' `#pragma'
+which lays out a structure as the documented `__attribute__
+((ms_struct))'.
+ 1. `#pragma ms_struct on' turns on the layout for structures declared.
+
+ 2. `#pragma ms_struct off' turns off the layout for structures
+ declared.
+
+ 3. `#pragma ms_struct reset' goes back to the default layout.
+
+
+File: gcc.info, Node: Weak Pragmas, Next: Diagnostic Pragmas, Prev: Structure-Packing Pragmas, Up: Pragmas
+
+5.52.8 Weak Pragmas
+-------------------
+
+For compatibility with SVR4, GCC supports a set of `#pragma' directives
+for declaring symbols to be weak, and defining weak aliases.
+
+`#pragma weak SYMBOL'
+ This pragma declares SYMBOL to be weak, as if the declaration had
+ the attribute of the same name. The pragma may appear before or
+ after the declaration of SYMBOL, but must appear before either its
+ first use or its definition. It is not an error for SYMBOL to
+ never be defined at all.
+
+`#pragma weak SYMBOL1 = SYMBOL2'
+ This pragma declares SYMBOL1 to be a weak alias of SYMBOL2. It is
+ an error if SYMBOL2 is not defined in the current translation unit.
+
+
+File: gcc.info, Node: Diagnostic Pragmas, Next: Visibility Pragmas, Prev: Weak Pragmas, Up: Pragmas
+
+5.52.9 Diagnostic Pragmas
+-------------------------
+
+GCC allows the user to selectively enable or disable certain types of
+diagnostics, and change the kind of the diagnostic. For example, a
+project's policy might require that all sources compile with `-Werror'
+but certain files might have exceptions allowing specific types of
+warnings. Or, a project might selectively enable diagnostics and treat
+them as errors depending on which preprocessor macros are defined.
+
+`#pragma GCC diagnostic KIND OPTION'
+ Modifies the disposition of a diagnostic. Note that not all
+ diagnostics are modifiable; at the moment only warnings (normally
+ controlled by `-W...') can be controlled, and not all of them.
+ Use `-fdiagnostics-show-option' to determine which diagnostics are
+ controllable and which option controls them.
+
+ KIND is `error' to treat this diagnostic as an error, `warning' to
+ treat it like a warning (even if `-Werror' is in effect), or
+ `ignored' if the diagnostic is to be ignored. OPTION is a double
+ quoted string which matches the command line option.
+
+ #pragma GCC diagnostic warning "-Wformat"
+ #pragma GCC diagnostic error "-Wformat"
+ #pragma GCC diagnostic ignored "-Wformat"
+
+ Note that these pragmas override any command line options. Also,
+ while it is syntactically valid to put these pragmas anywhere in
+ your sources, the only supported location for them is before any
+ data or functions are defined. Doing otherwise may result in
+ unpredictable results depending on how the optimizer manages your
+ sources. If the same option is listed multiple times, the last
+ one specified is the one that is in effect. This pragma is not
+ intended to be a general purpose replacement for command line
+ options, but for implementing strict control over project policies.
+
+
+ GCC also offers a simple mechanism for printing messages during
+compilation.
+
+`#pragma message STRING'
+ Prints STRING as a compiler message on compilation. The message
+ is informational only, and is neither a compilation warning nor an
+ error.
+
+ #pragma message "Compiling " __FILE__ "..."
+
+ STRING may be parenthesized, and is printed with location
+ information. For example,
+
+ #define DO_PRAGMA(x) _Pragma (#x)
+ #define TODO(x) DO_PRAGMA(message ("TODO - " #x))
+
+ TODO(Remember to fix this)
+
+ prints `/tmp/file.c:4: note: #pragma message: TODO - Remember to
+ fix this'.
+
+
+
+File: gcc.info, Node: Visibility Pragmas, Next: Push/Pop Macro Pragmas, Prev: Diagnostic Pragmas, Up: Pragmas
+
+5.52.10 Visibility Pragmas
+--------------------------
+
+`#pragma GCC visibility push(VISIBILITY)'
+`#pragma GCC visibility pop'
+ This pragma allows the user to set the visibility for multiple
+ declarations without having to give each a visibility attribute
+ *Note Function Attributes::, for more information about visibility
+ and the attribute syntax.
+
+ In C++, `#pragma GCC visibility' affects only namespace-scope
+ declarations. Class members and template specializations are not
+ affected; if you want to override the visibility for a particular
+ member or instantiation, you must use an attribute.
+
+
+
+File: gcc.info, Node: Push/Pop Macro Pragmas, Next: Function Specific Option Pragmas, Prev: Visibility Pragmas, Up: Pragmas
+
+5.52.11 Push/Pop Macro Pragmas
+------------------------------
+
+For compatibility with Microsoft Windows compilers, GCC supports
+`#pragma push_macro("MACRO_NAME")' and `#pragma
+pop_macro("MACRO_NAME")'.
+
+`#pragma push_macro("MACRO_NAME")'
+ This pragma saves the value of the macro named as MACRO_NAME to
+ the top of the stack for this macro.
+
+`#pragma pop_macro("MACRO_NAME")'
+ This pragma sets the value of the macro named as MACRO_NAME to the
+ value on top of the stack for this macro. If the stack for
+ MACRO_NAME is empty, the value of the macro remains unchanged.
+
+ For example:
+
+ #define X 1
+ #pragma push_macro("X")
+ #undef X
+ #define X -1
+ #pragma pop_macro("X")
+ int x [X];
+
+ In this example, the definition of X as 1 is saved by `#pragma
+push_macro' and restored by `#pragma pop_macro'.
+
+
+File: gcc.info, Node: Function Specific Option Pragmas, Prev: Push/Pop Macro Pragmas, Up: Pragmas
+
+5.52.12 Function Specific Option Pragmas
+----------------------------------------
+
+`#pragma GCC target ("STRING"...)'
+ This pragma allows you to set target specific options for functions
+ defined later in the source file. One or more strings can be
+ specified. Each function that is defined after this point will be
+ as if `attribute((target("STRING")))' was specified for that
+ function. The parenthesis around the options is optional. *Note
+ Function Attributes::, for more information about the `target'
+ attribute and the attribute syntax.
+
+ The `#pragma GCC target' pragma is not implemented in GCC versions
+ earlier than 4.4, and is currently only implemented for the 386
+ and x86_64 backends.
+
+`#pragma GCC optimize ("STRING"...)'
+ This pragma allows you to set global optimization options for
+ functions defined later in the source file. One or more strings
+ can be specified. Each function that is defined after this point
+ will be as if `attribute((optimize("STRING")))' was specified for
+ that function. The parenthesis around the options is optional.
+ *Note Function Attributes::, for more information about the
+ `optimize' attribute and the attribute syntax.
+
+ The `#pragma GCC optimize' pragma is not implemented in GCC
+ versions earlier than 4.4.
+
+`#pragma GCC push_options'
+`#pragma GCC pop_options'
+ These pragmas maintain a stack of the current target and
+ optimization options. It is intended for include files where you
+ temporarily want to switch to using a different `#pragma GCC
+ target' or `#pragma GCC optimize' and then to pop back to the
+ previous options.
+
+ The `#pragma GCC push_options' and `#pragma GCC pop_options'
+ pragmas are not implemented in GCC versions earlier than 4.4.
+
+`#pragma GCC reset_options'
+ This pragma clears the current `#pragma GCC target' and `#pragma
+ GCC optimize' to use the default switches as specified on the
+ command line.
+
+ The `#pragma GCC reset_options' pragma is not implemented in GCC
+ versions earlier than 4.4.
+
+
+File: gcc.info, Node: Unnamed Fields, Next: Thread-Local, Prev: Pragmas, Up: C Extensions
+
+5.53 Unnamed struct/union fields within structs/unions
+======================================================
+
+For compatibility with other compilers, GCC allows you to define a
+structure or union that contains, as fields, structures and unions
+without names. For example:
+
+ struct {
+ int a;
+ union {
+ int b;
+ float c;
+ };
+ int d;
+ } foo;
+
+ In this example, the user would be able to access members of the
+unnamed union with code like `foo.b'. Note that only unnamed structs
+and unions are allowed, you may not have, for example, an unnamed `int'.
+
+ You must never create such structures that cause ambiguous field
+definitions. For example, this structure:
+
+ struct {
+ int a;
+ struct {
+ int a;
+ };
+ } foo;
+
+ It is ambiguous which `a' is being referred to with `foo.a'. Such
+constructs are not supported and must be avoided. In the future, such
+constructs may be detected and treated as compilation errors.
+
+ Unless `-fms-extensions' is used, the unnamed field must be a
+structure or union definition without a tag (for example, `struct { int
+a; };'). If `-fms-extensions' is used, the field may also be a
+definition with a tag such as `struct foo { int a; };', a reference to
+a previously defined structure or union such as `struct foo;', or a
+reference to a `typedef' name for a previously defined structure or
+union type.
+
+
+File: gcc.info, Node: Thread-Local, Next: Binary constants, Prev: Unnamed Fields, Up: C Extensions
+
+5.54 Thread-Local Storage
+=========================
+
+Thread-local storage (TLS) is a mechanism by which variables are
+allocated such that there is one instance of the variable per extant
+thread. The run-time model GCC uses to implement this originates in
+the IA-64 processor-specific ABI, but has since been migrated to other
+processors as well. It requires significant support from the linker
+(`ld'), dynamic linker (`ld.so'), and system libraries (`libc.so' and
+`libpthread.so'), so it is not available everywhere.
+
+ At the user level, the extension is visible with a new storage class
+keyword: `__thread'. For example:
+
+ __thread int i;
+ extern __thread struct state s;
+ static __thread char *p;
+
+ The `__thread' specifier may be used alone, with the `extern' or
+`static' specifiers, but with no other storage class specifier. When
+used with `extern' or `static', `__thread' must appear immediately
+after the other storage class specifier.
+
+ The `__thread' specifier may be applied to any global, file-scoped
+static, function-scoped static, or static data member of a class. It
+may not be applied to block-scoped automatic or non-static data member.
+
+ When the address-of operator is applied to a thread-local variable, it
+is evaluated at run-time and returns the address of the current thread's
+instance of that variable. An address so obtained may be used by any
+thread. When a thread terminates, any pointers to thread-local
+variables in that thread become invalid.
+
+ No static initialization may refer to the address of a thread-local
+variable.
+
+ In C++, if an initializer is present for a thread-local variable, it
+must be a CONSTANT-EXPRESSION, as defined in 5.19.2 of the ANSI/ISO C++
+standard.
+
+ See ELF Handling For Thread-Local Storage
+(http://people.redhat.com/drepper/tls.pdf) for a detailed explanation of
+the four thread-local storage addressing models, and how the run-time
+is expected to function.
+
+* Menu:
+
+* C99 Thread-Local Edits::
+* C++98 Thread-Local Edits::
+
+
+File: gcc.info, Node: C99 Thread-Local Edits, Next: C++98 Thread-Local Edits, Up: Thread-Local
+
+5.54.1 ISO/IEC 9899:1999 Edits for Thread-Local Storage
+-------------------------------------------------------
+
+The following are a set of changes to ISO/IEC 9899:1999 (aka C99) that
+document the exact semantics of the language extension.
+
+ * `5.1.2 Execution environments'
+
+ Add new text after paragraph 1
+
+ Within either execution environment, a "thread" is a flow of
+ control within a program. It is implementation defined
+ whether or not there may be more than one thread associated
+ with a program. It is implementation defined how threads
+ beyond the first are created, the name and type of the
+ function called at thread startup, and how threads may be
+ terminated. However, objects with thread storage duration
+ shall be initialized before thread startup.
+
+ * `6.2.4 Storage durations of objects'
+
+ Add new text before paragraph 3
+
+ An object whose identifier is declared with the storage-class
+ specifier `__thread' has "thread storage duration". Its
+ lifetime is the entire execution of the thread, and its
+ stored value is initialized only once, prior to thread
+ startup.
+
+ * `6.4.1 Keywords'
+
+ Add `__thread'.
+
+ * `6.7.1 Storage-class specifiers'
+
+ Add `__thread' to the list of storage class specifiers in
+ paragraph 1.
+
+ Change paragraph 2 to
+
+ With the exception of `__thread', at most one storage-class
+ specifier may be given [...]. The `__thread' specifier may
+ be used alone, or immediately following `extern' or `static'.
+
+ Add new text after paragraph 6
+
+ The declaration of an identifier for a variable that has
+ block scope that specifies `__thread' shall also specify
+ either `extern' or `static'.
+
+ The `__thread' specifier shall be used only with variables.
+
+
+File: gcc.info, Node: C++98 Thread-Local Edits, Prev: C99 Thread-Local Edits, Up: Thread-Local
+
+5.54.2 ISO/IEC 14882:1998 Edits for Thread-Local Storage
+--------------------------------------------------------
+
+The following are a set of changes to ISO/IEC 14882:1998 (aka C++98)
+that document the exact semantics of the language extension.
+
+ * [intro.execution]
+
+ New text after paragraph 4
+
+ A "thread" is a flow of control within the abstract machine.
+ It is implementation defined whether or not there may be more
+ than one thread.
+
+ New text after paragraph 7
+
+ It is unspecified whether additional action must be taken to
+ ensure when and whether side effects are visible to other
+ threads.
+
+ * [lex.key]
+
+ Add `__thread'.
+
+ * [basic.start.main]
+
+ Add after paragraph 5
+
+ The thread that begins execution at the `main' function is
+ called the "main thread". It is implementation defined how
+ functions beginning threads other than the main thread are
+ designated or typed. A function so designated, as well as
+ the `main' function, is called a "thread startup function".
+ It is implementation defined what happens if a thread startup
+ function returns. It is implementation defined what happens
+ to other threads when any thread calls `exit'.
+
+ * [basic.start.init]
+
+ Add after paragraph 4
+
+ The storage for an object of thread storage duration shall be
+ statically initialized before the first statement of the
+ thread startup function. An object of thread storage
+ duration shall not require dynamic initialization.
+
+ * [basic.start.term]
+
+ Add after paragraph 3
+
+ The type of an object with thread storage duration shall not
+ have a non-trivial destructor, nor shall it be an array type
+ whose elements (directly or indirectly) have non-trivial
+ destructors.
+
+ * [basic.stc]
+
+ Add "thread storage duration" to the list in paragraph 1.
+
+ Change paragraph 2
+
+ Thread, static, and automatic storage durations are
+ associated with objects introduced by declarations [...].
+
+ Add `__thread' to the list of specifiers in paragraph 3.
+
+ * [basic.stc.thread]
+
+ New section before [basic.stc.static]
+
+ The keyword `__thread' applied to a non-local object gives the
+ object thread storage duration.
+
+ A local variable or class data member declared both `static'
+ and `__thread' gives the variable or member thread storage
+ duration.
+
+ * [basic.stc.static]
+
+ Change paragraph 1
+
+ All objects which have neither thread storage duration,
+ dynamic storage duration nor are local [...].
+
+ * [dcl.stc]
+
+ Add `__thread' to the list in paragraph 1.
+
+ Change paragraph 1
+
+ With the exception of `__thread', at most one
+ STORAGE-CLASS-SPECIFIER shall appear in a given
+ DECL-SPECIFIER-SEQ. The `__thread' specifier may be used
+ alone, or immediately following the `extern' or `static'
+ specifiers. [...]
+
+ Add after paragraph 5
+
+ The `__thread' specifier can be applied only to the names of
+ objects and to anonymous unions.
+
+ * [class.mem]
+
+ Add after paragraph 6
+
+ Non-`static' members shall not be `__thread'.
+
+
+File: gcc.info, Node: Binary constants, Prev: Thread-Local, Up: C Extensions
+
+5.55 Binary constants using the `0b' prefix
+===========================================
+
+Integer constants can be written as binary constants, consisting of a
+sequence of `0' and `1' digits, prefixed by `0b' or `0B'. This is
+particularly useful in environments that operate a lot on the bit-level
+(like microcontrollers).
+
+ The following statements are identical:
+
+ i = 42;
+ i = 0x2a;
+ i = 052;
+ i = 0b101010;
+
+ The type of these constants follows the same rules as for octal or
+hexadecimal integer constants, so suffixes like `L' or `UL' can be
+applied.
+
+
+File: gcc.info, Node: C++ Extensions, Next: Objective-C, Prev: C Extensions, Up: Top
+
+6 Extensions to the C++ Language
+********************************
+
+The GNU compiler provides these extensions to the C++ language (and you
+can also use most of the C language extensions in your C++ programs).
+If you want to write code that checks whether these features are
+available, you can test for the GNU compiler the same way as for C
+programs: check for a predefined macro `__GNUC__'. You can also use
+`__GNUG__' to test specifically for GNU C++ (*note Predefined Macros:
+(cpp)Common Predefined Macros.).
+
+* Menu:
+
+* Volatiles:: What constitutes an access to a volatile object.
+* Restricted Pointers:: C99 restricted pointers and references.
+* Vague Linkage:: Where G++ puts inlines, vtables and such.
+* C++ Interface:: You can use a single C++ header file for both
+ declarations and definitions.
+* Template Instantiation:: Methods for ensuring that exactly one copy of
+ each needed template instantiation is emitted.
+* Bound member functions:: You can extract a function pointer to the
+ method denoted by a `->*' or `.*' expression.
+* C++ Attributes:: Variable, function, and type attributes for C++ only.
+* Namespace Association:: Strong using-directives for namespace association.
+* Type Traits:: Compiler support for type traits
+* Java Exceptions:: Tweaking exception handling to work with Java.
+* Deprecated Features:: Things will disappear from g++.
+* Backwards Compatibility:: Compatibilities with earlier definitions of C++.
+
+
+File: gcc.info, Node: Volatiles, Next: Restricted Pointers, Up: C++ Extensions
+
+6.1 When is a Volatile Object Accessed?
+=======================================
+
+Both the C and C++ standard have the concept of volatile objects. These
+are normally accessed by pointers and used for accessing hardware. The
+standards encourage compilers to refrain from optimizations concerning
+accesses to volatile objects. The C standard leaves it implementation
+defined as to what constitutes a volatile access. The C++ standard
+omits to specify this, except to say that C++ should behave in a
+similar manner to C with respect to volatiles, where possible. The
+minimum either standard specifies is that at a sequence point all
+previous accesses to volatile objects have stabilized and no subsequent
+accesses have occurred. Thus an implementation is free to reorder and
+combine volatile accesses which occur between sequence points, but
+cannot do so for accesses across a sequence point. The use of
+volatiles does not allow you to violate the restriction on updating
+objects multiple times within a sequence point.
+
+ *Note Volatile qualifier and the C compiler: Qualifiers implementation.
+
+ The behavior differs slightly between C and C++ in the non-obvious
+cases:
+
+ volatile int *src = SOMEVALUE;
+ *src;
+
+ With C, such expressions are rvalues, and GCC interprets this either
+as a read of the volatile object being pointed to or only as request to
+evaluate the side-effects. The C++ standard specifies that such
+expressions do not undergo lvalue to rvalue conversion, and that the
+type of the dereferenced object may be incomplete. The C++ standard
+does not specify explicitly that it is this lvalue to rvalue conversion
+which may be responsible for causing an access. However, there is
+reason to believe that it is, because otherwise certain simple
+expressions become undefined. However, because it would surprise most
+programmers, G++ treats dereferencing a pointer to volatile object of
+complete type when the value is unused as GCC would do for an
+equivalent type in C. When the object has incomplete type, G++ issues
+a warning; if you wish to force an error, you must force a conversion
+to rvalue with, for instance, a static cast.
+
+ When using a reference to volatile, G++ does not treat equivalent
+expressions as accesses to volatiles, but instead issues a warning that
+no volatile is accessed. The rationale for this is that otherwise it
+becomes difficult to determine where volatile access occur, and not
+possible to ignore the return value from functions returning volatile
+references. Again, if you wish to force a read, cast the reference to
+an rvalue.
+
+
+File: gcc.info, Node: Restricted Pointers, Next: Vague Linkage, Prev: Volatiles, Up: C++ Extensions
+
+6.2 Restricting Pointer Aliasing
+================================
+
+As with the C front end, G++ understands the C99 feature of restricted
+pointers, specified with the `__restrict__', or `__restrict' type
+qualifier. Because you cannot compile C++ by specifying the `-std=c99'
+language flag, `restrict' is not a keyword in C++.
+
+ In addition to allowing restricted pointers, you can specify restricted
+references, which indicate that the reference is not aliased in the
+local context.
+
+ void fn (int *__restrict__ rptr, int &__restrict__ rref)
+ {
+ /* ... */
+ }
+
+In the body of `fn', RPTR points to an unaliased integer and RREF
+refers to a (different) unaliased integer.
+
+ You may also specify whether a member function's THIS pointer is
+unaliased by using `__restrict__' as a member function qualifier.
+
+ void T::fn () __restrict__
+ {
+ /* ... */
+ }
+
+Within the body of `T::fn', THIS will have the effective definition `T
+*__restrict__ const this'. Notice that the interpretation of a
+`__restrict__' member function qualifier is different to that of
+`const' or `volatile' qualifier, in that it is applied to the pointer
+rather than the object. This is consistent with other compilers which
+implement restricted pointers.
+
+ As with all outermost parameter qualifiers, `__restrict__' is ignored
+in function definition matching. This means you only need to specify
+`__restrict__' in a function definition, rather than in a function
+prototype as well.
+
+
+File: gcc.info, Node: Vague Linkage, Next: C++ Interface, Prev: Restricted Pointers, Up: C++ Extensions
+
+6.3 Vague Linkage
+=================
+
+There are several constructs in C++ which require space in the object
+file but are not clearly tied to a single translation unit. We say that
+these constructs have "vague linkage". Typically such constructs are
+emitted wherever they are needed, though sometimes we can be more
+clever.
+
+Inline Functions
+ Inline functions are typically defined in a header file which can
+ be included in many different compilations. Hopefully they can
+ usually be inlined, but sometimes an out-of-line copy is
+ necessary, if the address of the function is taken or if inlining
+ fails. In general, we emit an out-of-line copy in all translation
+ units where one is needed. As an exception, we only emit inline
+ virtual functions with the vtable, since it will always require a
+ copy.
+
+ Local static variables and string constants used in an inline
+ function are also considered to have vague linkage, since they
+ must be shared between all inlined and out-of-line instances of
+ the function.
+
+VTables
+ C++ virtual functions are implemented in most compilers using a
+ lookup table, known as a vtable. The vtable contains pointers to
+ the virtual functions provided by a class, and each object of the
+ class contains a pointer to its vtable (or vtables, in some
+ multiple-inheritance situations). If the class declares any
+ non-inline, non-pure virtual functions, the first one is chosen as
+ the "key method" for the class, and the vtable is only emitted in
+ the translation unit where the key method is defined.
+
+ _Note:_ If the chosen key method is later defined as inline, the
+ vtable will still be emitted in every translation unit which
+ defines it. Make sure that any inline virtuals are declared
+ inline in the class body, even if they are not defined there.
+
+type_info objects
+ C++ requires information about types to be written out in order to
+ implement `dynamic_cast', `typeid' and exception handling. For
+ polymorphic classes (classes with virtual functions), the type_info
+ object is written out along with the vtable so that `dynamic_cast'
+ can determine the dynamic type of a class object at runtime. For
+ all other types, we write out the type_info object when it is
+ used: when applying `typeid' to an expression, throwing an object,
+ or referring to a type in a catch clause or exception
+ specification.
+
+Template Instantiations
+ Most everything in this section also applies to template
+ instantiations, but there are other options as well. *Note
+ Where's the Template?: Template Instantiation.
+
+
+ When used with GNU ld version 2.8 or later on an ELF system such as
+GNU/Linux or Solaris 2, or on Microsoft Windows, duplicate copies of
+these constructs will be discarded at link time. This is known as
+COMDAT support.
+
+ On targets that don't support COMDAT, but do support weak symbols, GCC
+will use them. This way one copy will override all the others, but the
+unused copies will still take up space in the executable.
+
+ For targets which do not support either COMDAT or weak symbols, most
+entities with vague linkage will be emitted as local symbols to avoid
+duplicate definition errors from the linker. This will not happen for
+local statics in inlines, however, as having multiple copies will
+almost certainly break things.
+
+ *Note Declarations and Definitions in One Header: C++ Interface, for
+another way to control placement of these constructs.
+
+
+File: gcc.info, Node: C++ Interface, Next: Template Instantiation, Prev: Vague Linkage, Up: C++ Extensions
+
+6.4 #pragma interface and implementation
+========================================
+
+`#pragma interface' and `#pragma implementation' provide the user with
+a way of explicitly directing the compiler to emit entities with vague
+linkage (and debugging information) in a particular translation unit.
+
+ _Note:_ As of GCC 2.7.2, these `#pragma's are not useful in most
+cases, because of COMDAT support and the "key method" heuristic
+mentioned in *Note Vague Linkage::. Using them can actually cause your
+program to grow due to unnecessary out-of-line copies of inline
+functions. Currently (3.4) the only benefit of these `#pragma's is
+reduced duplication of debugging information, and that should be
+addressed soon on DWARF 2 targets with the use of COMDAT groups.
+
+`#pragma interface'
+`#pragma interface "SUBDIR/OBJECTS.h"'
+ Use this directive in _header files_ that define object classes,
+ to save space in most of the object files that use those classes.
+ Normally, local copies of certain information (backup copies of
+ inline member functions, debugging information, and the internal
+ tables that implement virtual functions) must be kept in each
+ object file that includes class definitions. You can use this
+ pragma to avoid such duplication. When a header file containing
+ `#pragma interface' is included in a compilation, this auxiliary
+ information will not be generated (unless the main input source
+ file itself uses `#pragma implementation'). Instead, the object
+ files will contain references to be resolved at link time.
+
+ The second form of this directive is useful for the case where you
+ have multiple headers with the same name in different directories.
+ If you use this form, you must specify the same string to `#pragma
+ implementation'.
+
+`#pragma implementation'
+`#pragma implementation "OBJECTS.h"'
+ Use this pragma in a _main input file_, when you want full output
+ from included header files to be generated (and made globally
+ visible). The included header file, in turn, should use `#pragma
+ interface'. Backup copies of inline member functions, debugging
+ information, and the internal tables used to implement virtual
+ functions are all generated in implementation files.
+
+ If you use `#pragma implementation' with no argument, it applies to
+ an include file with the same basename(1) as your source file.
+ For example, in `allclass.cc', giving just `#pragma implementation'
+ by itself is equivalent to `#pragma implementation "allclass.h"'.
+
+ In versions of GNU C++ prior to 2.6.0 `allclass.h' was treated as
+ an implementation file whenever you would include it from
+ `allclass.cc' even if you never specified `#pragma
+ implementation'. This was deemed to be more trouble than it was
+ worth, however, and disabled.
+
+ Use the string argument if you want a single implementation file to
+ include code from multiple header files. (You must also use
+ `#include' to include the header file; `#pragma implementation'
+ only specifies how to use the file--it doesn't actually include
+ it.)
+
+ There is no way to split up the contents of a single header file
+ into multiple implementation files.
+
+ `#pragma implementation' and `#pragma interface' also have an effect
+on function inlining.
+
+ If you define a class in a header file marked with `#pragma
+interface', the effect on an inline function defined in that class is
+similar to an explicit `extern' declaration--the compiler emits no code
+at all to define an independent version of the function. Its
+definition is used only for inlining with its callers.
+
+ Conversely, when you include the same header file in a main source file
+that declares it as `#pragma implementation', the compiler emits code
+for the function itself; this defines a version of the function that
+can be found via pointers (or by callers compiled without inlining).
+If all calls to the function can be inlined, you can avoid emitting the
+function by compiling with `-fno-implement-inlines'. If any calls were
+not inlined, you will get linker errors.
+
+ ---------- Footnotes ----------
+
+ (1) A file's "basename" was the name stripped of all leading path
+information and of trailing suffixes, such as `.h' or `.C' or `.cc'.
+
+
+File: gcc.info, Node: Template Instantiation, Next: Bound member functions, Prev: C++ Interface, Up: C++ Extensions
+
+6.5 Where's the Template?
+=========================
+
+C++ templates are the first language feature to require more
+intelligence from the environment than one usually finds on a UNIX
+system. Somehow the compiler and linker have to make sure that each
+template instance occurs exactly once in the executable if it is needed,
+and not at all otherwise. There are two basic approaches to this
+problem, which are referred to as the Borland model and the Cfront
+model.
+
+Borland model
+ Borland C++ solved the template instantiation problem by adding
+ the code equivalent of common blocks to their linker; the compiler
+ emits template instances in each translation unit that uses them,
+ and the linker collapses them together. The advantage of this
+ model is that the linker only has to consider the object files
+ themselves; there is no external complexity to worry about. This
+ disadvantage is that compilation time is increased because the
+ template code is being compiled repeatedly. Code written for this
+ model tends to include definitions of all templates in the header
+ file, since they must be seen to be instantiated.
+
+Cfront model
+ The AT&T C++ translator, Cfront, solved the template instantiation
+ problem by creating the notion of a template repository, an
+ automatically maintained place where template instances are
+ stored. A more modern version of the repository works as follows:
+ As individual object files are built, the compiler places any
+ template definitions and instantiations encountered in the
+ repository. At link time, the link wrapper adds in the objects in
+ the repository and compiles any needed instances that were not
+ previously emitted. The advantages of this model are more optimal
+ compilation speed and the ability to use the system linker; to
+ implement the Borland model a compiler vendor also needs to
+ replace the linker. The disadvantages are vastly increased
+ complexity, and thus potential for error; for some code this can be
+ just as transparent, but in practice it can been very difficult to
+ build multiple programs in one directory and one program in
+ multiple directories. Code written for this model tends to
+ separate definitions of non-inline member templates into a
+ separate file, which should be compiled separately.
+
+ When used with GNU ld version 2.8 or later on an ELF system such as
+GNU/Linux or Solaris 2, or on Microsoft Windows, G++ supports the
+Borland model. On other systems, G++ implements neither automatic
+model.
+
+ A future version of G++ will support a hybrid model whereby the
+compiler will emit any instantiations for which the template definition
+is included in the compile, and store template definitions and
+instantiation context information into the object file for the rest.
+The link wrapper will extract that information as necessary and invoke
+the compiler to produce the remaining instantiations. The linker will
+then combine duplicate instantiations.
+
+ In the mean time, you have the following options for dealing with
+template instantiations:
+
+ 1. Compile your template-using code with `-frepo'. The compiler will
+ generate files with the extension `.rpo' listing all of the
+ template instantiations used in the corresponding object files
+ which could be instantiated there; the link wrapper, `collect2',
+ will then update the `.rpo' files to tell the compiler where to
+ place those instantiations and rebuild any affected object files.
+ The link-time overhead is negligible after the first pass, as the
+ compiler will continue to place the instantiations in the same
+ files.
+
+ This is your best option for application code written for the
+ Borland model, as it will just work. Code written for the Cfront
+ model will need to be modified so that the template definitions
+ are available at one or more points of instantiation; usually this
+ is as simple as adding `#include <tmethods.cc>' to the end of each
+ template header.
+
+ For library code, if you want the library to provide all of the
+ template instantiations it needs, just try to link all of its
+ object files together; the link will fail, but cause the
+ instantiations to be generated as a side effect. Be warned,
+ however, that this may cause conflicts if multiple libraries try
+ to provide the same instantiations. For greater control, use
+ explicit instantiation as described in the next option.
+
+ 2. Compile your code with `-fno-implicit-templates' to disable the
+ implicit generation of template instances, and explicitly
+ instantiate all the ones you use. This approach requires more
+ knowledge of exactly which instances you need than do the others,
+ but it's less mysterious and allows greater control. You can
+ scatter the explicit instantiations throughout your program,
+ perhaps putting them in the translation units where the instances
+ are used or the translation units that define the templates
+ themselves; you can put all of the explicit instantiations you
+ need into one big file; or you can create small files like
+
+ #include "Foo.h"
+ #include "Foo.cc"
+
+ template class Foo<int>;
+ template ostream& operator <<
+ (ostream&, const Foo<int>&);
+
+ for each of the instances you need, and create a template
+ instantiation library from those.
+
+ If you are using Cfront-model code, you can probably get away with
+ not using `-fno-implicit-templates' when compiling files that don't
+ `#include' the member template definitions.
+
+ If you use one big file to do the instantiations, you may want to
+ compile it without `-fno-implicit-templates' so you get all of the
+ instances required by your explicit instantiations (but not by any
+ other files) without having to specify them as well.
+
+ G++ has extended the template instantiation syntax given in the ISO
+ standard to allow forward declaration of explicit instantiations
+ (with `extern'), instantiation of the compiler support data for a
+ template class (i.e. the vtable) without instantiating any of its
+ members (with `inline'), and instantiation of only the static data
+ members of a template class, without the support data or member
+ functions (with (`static'):
+
+ extern template int max (int, int);
+ inline template class Foo<int>;
+ static template class Foo<int>;
+
+ 3. Do nothing. Pretend G++ does implement automatic instantiation
+ management. Code written for the Borland model will work fine, but
+ each translation unit will contain instances of each of the
+ templates it uses. In a large program, this can lead to an
+ unacceptable amount of code duplication.
+
+
+File: gcc.info, Node: Bound member functions, Next: C++ Attributes, Prev: Template Instantiation, Up: C++ Extensions
+
+6.6 Extracting the function pointer from a bound pointer to member function
+===========================================================================
+
+In C++, pointer to member functions (PMFs) are implemented using a wide
+pointer of sorts to handle all the possible call mechanisms; the PMF
+needs to store information about how to adjust the `this' pointer, and
+if the function pointed to is virtual, where to find the vtable, and
+where in the vtable to look for the member function. If you are using
+PMFs in an inner loop, you should really reconsider that decision. If
+that is not an option, you can extract the pointer to the function that
+would be called for a given object/PMF pair and call it directly inside
+the inner loop, to save a bit of time.
+
+ Note that you will still be paying the penalty for the call through a
+function pointer; on most modern architectures, such a call defeats the
+branch prediction features of the CPU. This is also true of normal
+virtual function calls.
+
+ The syntax for this extension is
+
+ extern A a;
+ extern int (A::*fp)();
+ typedef int (*fptr)(A *);
+
+ fptr p = (fptr)(a.*fp);
+
+ For PMF constants (i.e. expressions of the form `&Klasse::Member'), no
+object is needed to obtain the address of the function. They can be
+converted to function pointers directly:
+
+ fptr p1 = (fptr)(&A::foo);
+
+ You must specify `-Wno-pmf-conversions' to use this extension.
+
+
+File: gcc.info, Node: C++ Attributes, Next: Namespace Association, Prev: Bound member functions, Up: C++ Extensions
+
+6.7 C++-Specific Variable, Function, and Type Attributes
+========================================================
+
+Some attributes only make sense for C++ programs.
+
+`init_priority (PRIORITY)'
+ In Standard C++, objects defined at namespace scope are guaranteed
+ to be initialized in an order in strict accordance with that of
+ their definitions _in a given translation unit_. No guarantee is
+ made for initializations across translation units. However, GNU
+ C++ allows users to control the order of initialization of objects
+ defined at namespace scope with the `init_priority' attribute by
+ specifying a relative PRIORITY, a constant integral expression
+ currently bounded between 101 and 65535 inclusive. Lower numbers
+ indicate a higher priority.
+
+ In the following example, `A' would normally be created before
+ `B', but the `init_priority' attribute has reversed that order:
+
+ Some_Class A __attribute__ ((init_priority (2000)));
+ Some_Class B __attribute__ ((init_priority (543)));
+
+ Note that the particular values of PRIORITY do not matter; only
+ their relative ordering.
+
+`java_interface'
+ This type attribute informs C++ that the class is a Java
+ interface. It may only be applied to classes declared within an
+ `extern "Java"' block. Calls to methods declared in this
+ interface will be dispatched using GCJ's interface table
+ mechanism, instead of regular virtual table dispatch.
+
+
+ See also *Note Namespace Association::.
+
+
+File: gcc.info, Node: Namespace Association, Next: Type Traits, Prev: C++ Attributes, Up: C++ Extensions
+
+6.8 Namespace Association
+=========================
+
+*Caution:* The semantics of this extension are not fully defined.
+Users should refrain from using this extension as its semantics may
+change subtly over time. It is possible that this extension will be
+removed in future versions of G++.
+
+ A using-directive with `__attribute ((strong))' is stronger than a
+normal using-directive in two ways:
+
+ * Templates from the used namespace can be specialized and explicitly
+ instantiated as though they were members of the using namespace.
+
+ * The using namespace is considered an associated namespace of all
+ templates in the used namespace for purposes of argument-dependent
+ name lookup.
+
+ The used namespace must be nested within the using namespace so that
+normal unqualified lookup works properly.
+
+ This is useful for composing a namespace transparently from
+implementation namespaces. For example:
+
+ namespace std {
+ namespace debug {
+ template <class T> struct A { };
+ }
+ using namespace debug __attribute ((__strong__));
+ template <> struct A<int> { }; // ok to specialize
+
+ template <class T> void f (A<T>);
+ }
+
+ int main()
+ {
+ f (std::A<float>()); // lookup finds std::f
+ f (std::A<int>());
+ }
+
+
+File: gcc.info, Node: Type Traits, Next: Java Exceptions, Prev: Namespace Association, Up: C++ Extensions
+
+6.9 Type Traits
+===============
+
+The C++ front-end implements syntactic extensions that allow to
+determine at compile time various characteristics of a type (or of a
+pair of types).
+
+`__has_nothrow_assign (type)'
+ If `type' is const qualified or is a reference type then the trait
+ is false. Otherwise if `__has_trivial_assign (type)' is true then
+ the trait is true, else if `type' is a cv class or union type with
+ copy assignment operators that are known not to throw an exception
+ then the trait is true, else it is false. Requires: `type' shall
+ be a complete type, an array type of unknown bound, or is a `void'
+ type.
+
+`__has_nothrow_copy (type)'
+ If `__has_trivial_copy (type)' is true then the trait is true,
+ else if `type' is a cv class or union type with copy constructors
+ that are known not to throw an exception then the trait is true,
+ else it is false. Requires: `type' shall be a complete type, an
+ array type of unknown bound, or is a `void' type.
+
+`__has_nothrow_constructor (type)'
+ If `__has_trivial_constructor (type)' is true then the trait is
+ true, else if `type' is a cv class or union type (or array
+ thereof) with a default constructor that is known not to throw an
+ exception then the trait is true, else it is false. Requires:
+ `type' shall be a complete type, an array type of unknown bound,
+ or is a `void' type.
+
+`__has_trivial_assign (type)'
+ If `type' is const qualified or is a reference type then the trait
+ is false. Otherwise if `__is_pod (type)' is true then the trait is
+ true, else if `type' is a cv class or union type with a trivial
+ copy assignment ([class.copy]) then the trait is true, else it is
+ false. Requires: `type' shall be a complete type, an array type
+ of unknown bound, or is a `void' type.
+
+`__has_trivial_copy (type)'
+ If `__is_pod (type)' is true or `type' is a reference type then
+ the trait is true, else if `type' is a cv class or union type with
+ a trivial copy constructor ([class.copy]) then the trait is true,
+ else it is false. Requires: `type' shall be a complete type, an
+ array type of unknown bound, or is a `void' type.
+
+`__has_trivial_constructor (type)'
+ If `__is_pod (type)' is true then the trait is true, else if
+ `type' is a cv class or union type (or array thereof) with a
+ trivial default constructor ([class.ctor]) then the trait is true,
+ else it is false. Requires: `type' shall be a complete type, an
+ array type of unknown bound, or is a `void' type.
+
+`__has_trivial_destructor (type)'
+ If `__is_pod (type)' is true or `type' is a reference type then
+ the trait is true, else if `type' is a cv class or union type (or
+ array thereof) with a trivial destructor ([class.dtor]) then the
+ trait is true, else it is false. Requires: `type' shall be a
+ complete type, an array type of unknown bound, or is a `void' type.
+
+`__has_virtual_destructor (type)'
+ If `type' is a class type with a virtual destructor ([class.dtor])
+ then the trait is true, else it is false. Requires: `type' shall
+ be a complete type, an array type of unknown bound, or is a `void'
+ type.
+
+`__is_abstract (type)'
+ If `type' is an abstract class ([class.abstract]) then the trait
+ is true, else it is false. Requires: `type' shall be a complete
+ type, an array type of unknown bound, or is a `void' type.
+
+`__is_base_of (base_type, derived_type)'
+ If `base_type' is a base class of `derived_type' ([class.derived])
+ then the trait is true, otherwise it is false. Top-level cv
+ qualifications of `base_type' and `derived_type' are ignored. For
+ the purposes of this trait, a class type is considered is own
+ base. Requires: if `__is_class (base_type)' and `__is_class
+ (derived_type)' are true and `base_type' and `derived_type' are
+ not the same type (disregarding cv-qualifiers), `derived_type'
+ shall be a complete type. Diagnostic is produced if this
+ requirement is not met.
+
+`__is_class (type)'
+ If `type' is a cv class type, and not a union type
+ ([basic.compound]) the trait is true, else it is false.
+
+`__is_empty (type)'
+ If `__is_class (type)' is false then the trait is false.
+ Otherwise `type' is considered empty if and only if: `type' has no
+ non-static data members, or all non-static data members, if any,
+ are bit-fields of length 0, and `type' has no virtual members, and
+ `type' has no virtual base classes, and `type' has no base classes
+ `base_type' for which `__is_empty (base_type)' is false.
+ Requires: `type' shall be a complete type, an array type of
+ unknown bound, or is a `void' type.
+
+`__is_enum (type)'
+ If `type' is a cv enumeration type ([basic.compound]) the trait is
+ true, else it is false.
+
+`__is_pod (type)'
+ If `type' is a cv POD type ([basic.types]) then the trait is true,
+ else it is false. Requires: `type' shall be a complete type, an
+ array type of unknown bound, or is a `void' type.
+
+`__is_polymorphic (type)'
+ If `type' is a polymorphic class ([class.virtual]) then the trait
+ is true, else it is false. Requires: `type' shall be a complete
+ type, an array type of unknown bound, or is a `void' type.
+
+`__is_union (type)'
+ If `type' is a cv union type ([basic.compound]) the trait is true,
+ else it is false.
+
+
+
+File: gcc.info, Node: Java Exceptions, Next: Deprecated Features, Prev: Type Traits, Up: C++ Extensions
+
+6.10 Java Exceptions
+====================
+
+The Java language uses a slightly different exception handling model
+from C++. Normally, GNU C++ will automatically detect when you are
+writing C++ code that uses Java exceptions, and handle them
+appropriately. However, if C++ code only needs to execute destructors
+when Java exceptions are thrown through it, GCC will guess incorrectly.
+Sample problematic code is:
+
+ struct S { ~S(); };
+ extern void bar(); // is written in Java, and may throw exceptions
+ void foo()
+ {
+ S s;
+ bar();
+ }
+
+The usual effect of an incorrect guess is a link failure, complaining of
+a missing routine called `__gxx_personality_v0'.
+
+ You can inform the compiler that Java exceptions are to be used in a
+translation unit, irrespective of what it might think, by writing
+`#pragma GCC java_exceptions' at the head of the file. This `#pragma'
+must appear before any functions that throw or catch exceptions, or run
+destructors when exceptions are thrown through them.
+
+ You cannot mix Java and C++ exceptions in the same translation unit.
+It is believed to be safe to throw a C++ exception from one file through
+another file compiled for the Java exception model, or vice versa, but
+there may be bugs in this area.
+
+
+File: gcc.info, Node: Deprecated Features, Next: Backwards Compatibility, Prev: Java Exceptions, Up: C++ Extensions
+
+6.11 Deprecated Features
+========================
+
+In the past, the GNU C++ compiler was extended to experiment with new
+features, at a time when the C++ language was still evolving. Now that
+the C++ standard is complete, some of those features are superseded by
+superior alternatives. Using the old features might cause a warning in
+some cases that the feature will be dropped in the future. In other
+cases, the feature might be gone already.
+
+ While the list below is not exhaustive, it documents some of the
+options that are now deprecated:
+
+`-fexternal-templates'
+`-falt-external-templates'
+ These are two of the many ways for G++ to implement template
+ instantiation. *Note Template Instantiation::. The C++ standard
+ clearly defines how template definitions have to be organized
+ across implementation units. G++ has an implicit instantiation
+ mechanism that should work just fine for standard-conforming code.
+
+`-fstrict-prototype'
+`-fno-strict-prototype'
+ Previously it was possible to use an empty prototype parameter
+ list to indicate an unspecified number of parameters (like C),
+ rather than no parameters, as C++ demands. This feature has been
+ removed, except where it is required for backwards compatibility.
+ *Note Backwards Compatibility::.
+
+ G++ allows a virtual function returning `void *' to be overridden by
+one returning a different pointer type. This extension to the
+covariant return type rules is now deprecated and will be removed from a
+future version.
+
+ The G++ minimum and maximum operators (`<?' and `>?') and their
+compound forms (`<?=') and `>?=') have been deprecated and are now
+removed from G++. Code using these operators should be modified to use
+`std::min' and `std::max' instead.
+
+ The named return value extension has been deprecated, and is now
+removed from G++.
+
+ The use of initializer lists with new expressions has been deprecated,
+and is now removed from G++.
+
+ Floating and complex non-type template parameters have been deprecated,
+and are now removed from G++.
+
+ The implicit typename extension has been deprecated and is now removed
+from G++.
+
+ The use of default arguments in function pointers, function typedefs
+and other places where they are not permitted by the standard is
+deprecated and will be removed from a future version of G++.
+
+ G++ allows floating-point literals to appear in integral constant
+expressions, e.g. ` enum E { e = int(2.2 * 3.7) } ' This extension is
+deprecated and will be removed from a future version.
+
+ G++ allows static data members of const floating-point type to be
+declared with an initializer in a class definition. The standard only
+allows initializers for static members of const integral types and const
+enumeration types so this extension has been deprecated and will be
+removed from a future version.
+
+
+File: gcc.info, Node: Backwards Compatibility, Prev: Deprecated Features, Up: C++ Extensions
+
+6.12 Backwards Compatibility
+============================
+
+Now that there is a definitive ISO standard C++, G++ has a specification
+to adhere to. The C++ language evolved over time, and features that
+used to be acceptable in previous drafts of the standard, such as the
+ARM [Annotated C++ Reference Manual], are no longer accepted. In order
+to allow compilation of C++ written to such drafts, G++ contains some
+backwards compatibilities. _All such backwards compatibility features
+are liable to disappear in future versions of G++._ They should be
+considered deprecated. *Note Deprecated Features::.
+
+`For scope'
+ If a variable is declared at for scope, it used to remain in scope
+ until the end of the scope which contained the for statement
+ (rather than just within the for scope). G++ retains this, but
+ issues a warning, if such a variable is accessed outside the for
+ scope.
+
+`Implicit C language'
+ Old C system header files did not contain an `extern "C" {...}'
+ scope to set the language. On such systems, all header files are
+ implicitly scoped inside a C language scope. Also, an empty
+ prototype `()' will be treated as an unspecified number of
+ arguments, rather than no arguments, as C++ demands.
+
+
+File: gcc.info, Node: Objective-C, Next: Compatibility, Prev: C++ Extensions, Up: Top
+
+7 GNU Objective-C runtime features
+**********************************
+
+This document is meant to describe some of the GNU Objective-C runtime
+features. It is not intended to teach you Objective-C, there are
+several resources on the Internet that present the language. Questions
+and comments about this document to Ovidiu Predescu <ovidiu@cup.hp.com>.
+
+* Menu:
+
+* Executing code before main::
+* Type encoding::
+* Garbage Collection::
+* Constant string objects::
+* compatibility_alias::
+
+
+File: gcc.info, Node: Executing code before main, Next: Type encoding, Prev: Objective-C, Up: Objective-C
+
+7.1 `+load': Executing code before main
+=======================================
+
+The GNU Objective-C runtime provides a way that allows you to execute
+code before the execution of the program enters the `main' function.
+The code is executed on a per-class and a per-category basis, through a
+special class method `+load'.
+
+ This facility is very useful if you want to initialize global variables
+which can be accessed by the program directly, without sending a message
+to the class first. The usual way to initialize global variables, in
+the `+initialize' method, might not be useful because `+initialize' is
+only called when the first message is sent to a class object, which in
+some cases could be too late.
+
+ Suppose for example you have a `FileStream' class that declares
+`Stdin', `Stdout' and `Stderr' as global variables, like below:
+
+
+ FileStream *Stdin = nil;
+ FileStream *Stdout = nil;
+ FileStream *Stderr = nil;
+
+ @implementation FileStream
+
+ + (void)initialize
+ {
+ Stdin = [[FileStream new] initWithFd:0];
+ Stdout = [[FileStream new] initWithFd:1];
+ Stderr = [[FileStream new] initWithFd:2];
+ }
+
+ /* Other methods here */
+ @end
+
+ In this example, the initialization of `Stdin', `Stdout' and `Stderr'
+in `+initialize' occurs too late. The programmer can send a message to
+one of these objects before the variables are actually initialized,
+thus sending messages to the `nil' object. The `+initialize' method
+which actually initializes the global variables is not invoked until
+the first message is sent to the class object. The solution would
+require these variables to be initialized just before entering `main'.
+
+ The correct solution of the above problem is to use the `+load' method
+instead of `+initialize':
+
+
+ @implementation FileStream
+
+ + (void)load
+ {
+ Stdin = [[FileStream new] initWithFd:0];
+ Stdout = [[FileStream new] initWithFd:1];
+ Stderr = [[FileStream new] initWithFd:2];
+ }
+
+ /* Other methods here */
+ @end
+
+ The `+load' is a method that is not overridden by categories. If a
+class and a category of it both implement `+load', both methods are
+invoked. This allows some additional initializations to be performed in
+a category.
+
+ This mechanism is not intended to be a replacement for `+initialize'.
+You should be aware of its limitations when you decide to use it
+instead of `+initialize'.
+
+* Menu:
+
+* What you can and what you cannot do in +load::
+
+
+File: gcc.info, Node: What you can and what you cannot do in +load, Prev: Executing code before main, Up: Executing code before main
+
+7.1.1 What you can and what you cannot do in `+load'
+----------------------------------------------------
+
+The `+load' implementation in the GNU runtime guarantees you the
+following things:
+
+ * you can write whatever C code you like;
+
+ * you can send messages to Objective-C constant strings (`@"this is a
+ constant string"');
+
+ * you can allocate and send messages to objects whose class is
+ implemented in the same file;
+
+ * the `+load' implementation of all super classes of a class are
+ executed before the `+load' of that class is executed;
+
+ * the `+load' implementation of a class is executed before the
+ `+load' implementation of any category.
+
+
+ In particular, the following things, even if they can work in a
+particular case, are not guaranteed:
+
+ * allocation of or sending messages to arbitrary objects;
+
+ * allocation of or sending messages to objects whose classes have a
+ category implemented in the same file;
+
+
+ You should make no assumptions about receiving `+load' in sibling
+classes when you write `+load' of a class. The order in which sibling
+classes receive `+load' is not guaranteed.
+
+ The order in which `+load' and `+initialize' are called could be
+problematic if this matters. If you don't allocate objects inside
+`+load', it is guaranteed that `+load' is called before `+initialize'.
+If you create an object inside `+load' the `+initialize' method of
+object's class is invoked even if `+load' was not invoked. Note if you
+explicitly call `+load' on a class, `+initialize' will be called first.
+To avoid possible problems try to implement only one of these methods.
+
+ The `+load' method is also invoked when a bundle is dynamically loaded
+into your running program. This happens automatically without any
+intervening operation from you. When you write bundles and you need to
+write `+load' you can safely create and send messages to objects whose
+classes already exist in the running program. The same restrictions as
+above apply to classes defined in bundle.
+
+
+File: gcc.info, Node: Type encoding, Next: Garbage Collection, Prev: Executing code before main, Up: Objective-C
+
+7.2 Type encoding
+=================
+
+The Objective-C compiler generates type encodings for all the types.
+These type encodings are used at runtime to find out information about
+selectors and methods and about objects and classes.
+
+ The types are encoded in the following way:
+
+`_Bool' `B'
+`char' `c'
+`unsigned char' `C'
+`short' `s'
+`unsigned short' `S'
+`int' `i'
+`unsigned int' `I'
+`long' `l'
+`unsigned long' `L'
+`long long' `q'
+`unsigned long `Q'
+long'
+`float' `f'
+`double' `d'
+`void' `v'
+`id' `@'
+`Class' `#'
+`SEL' `:'
+`char*' `*'
+unknown type `?'
+Complex types `j' followed by the inner type. For example
+ `_Complex double' is encoded as "jd".
+bit-fields `b' followed by the starting position of the
+ bit-field, the type of the bit-field and the size of
+ the bit-field (the bit-fields encoding was changed
+ from the NeXT's compiler encoding, see below)
+
+ The encoding of bit-fields has changed to allow bit-fields to be
+properly handled by the runtime functions that compute sizes and
+alignments of types that contain bit-fields. The previous encoding
+contained only the size of the bit-field. Using only this information
+it is not possible to reliably compute the size occupied by the
+bit-field. This is very important in the presence of the Boehm's
+garbage collector because the objects are allocated using the typed
+memory facility available in this collector. The typed memory
+allocation requires information about where the pointers are located
+inside the object.
+
+ The position in the bit-field is the position, counting in bits, of the
+bit closest to the beginning of the structure.
+
+ The non-atomic types are encoded as follows:
+
+pointers `^' followed by the pointed type.
+arrays `[' followed by the number of elements in the array
+ followed by the type of the elements followed by `]'
+structures `{' followed by the name of the structure (or `?' if the
+ structure is unnamed), the `=' sign, the type of the
+ members and by `}'
+unions `(' followed by the name of the structure (or `?' if the
+ union is unnamed), the `=' sign, the type of the members
+ followed by `)'
+
+ Here are some types and their encodings, as they are generated by the
+compiler on an i386 machine:
+
+
+Objective-C type Compiler encoding
+ int a[10]; `[10i]'
+ struct { `{?=i[3f]b128i3b131i2c}'
+ int i;
+ float f[3];
+ int a:3;
+ int b:2;
+ char c;
+ }
+
+
+ In addition to the types the compiler also encodes the type
+specifiers. The table below describes the encoding of the current
+Objective-C type specifiers:
+
+
+Specifier Encoding
+`const' `r'
+`in' `n'
+`inout' `N'
+`out' `o'
+`bycopy' `O'
+`oneway' `V'
+
+
+ The type specifiers are encoded just before the type. Unlike types
+however, the type specifiers are only encoded when they appear in method
+argument types.
+
+
+File: gcc.info, Node: Garbage Collection, Next: Constant string objects, Prev: Type encoding, Up: Objective-C
+
+7.3 Garbage Collection
+======================
+
+Support for a new memory management policy has been added by using a
+powerful conservative garbage collector, known as the
+Boehm-Demers-Weiser conservative garbage collector. It is available
+from `http://www.hpl.hp.com/personal/Hans_Boehm/gc/'.
+
+ To enable the support for it you have to configure the compiler using
+an additional argument, `--enable-objc-gc'. You need to have garbage
+collector installed before building the compiler. This will build an
+additional runtime library which has several enhancements to support
+the garbage collector. The new library has a new name, `libobjc_gc.a'
+to not conflict with the non-garbage-collected library.
+
+ When the garbage collector is used, the objects are allocated using the
+so-called typed memory allocation mechanism available in the
+Boehm-Demers-Weiser collector. This mode requires precise information
+on where pointers are located inside objects. This information is
+computed once per class, immediately after the class has been
+initialized.
+
+ There is a new runtime function `class_ivar_set_gcinvisible()' which
+can be used to declare a so-called "weak pointer" reference. Such a
+pointer is basically hidden for the garbage collector; this can be
+useful in certain situations, especially when you want to keep track of
+the allocated objects, yet allow them to be collected. This kind of
+pointers can only be members of objects, you cannot declare a global
+pointer as a weak reference. Every type which is a pointer type can be
+declared a weak pointer, including `id', `Class' and `SEL'.
+
+ Here is an example of how to use this feature. Suppose you want to
+implement a class whose instances hold a weak pointer reference; the
+following class does this:
+
+
+ @interface WeakPointer : Object
+ {
+ const void* weakPointer;
+ }
+
+ - initWithPointer:(const void*)p;
+ - (const void*)weakPointer;
+ @end
+
+
+ @implementation WeakPointer
+
+ + (void)initialize
+ {
+ class_ivar_set_gcinvisible (self, "weakPointer", YES);
+ }
+
+ - initWithPointer:(const void*)p
+ {
+ weakPointer = p;
+ return self;
+ }
+
+ - (const void*)weakPointer
+ {
+ return weakPointer;
+ }
+
+ @end
+
+ Weak pointers are supported through a new type character specifier
+represented by the `!' character. The `class_ivar_set_gcinvisible()'
+function adds or removes this specifier to the string type description
+of the instance variable named as argument.
+
+
+File: gcc.info, Node: Constant string objects, Next: compatibility_alias, Prev: Garbage Collection, Up: Objective-C
+
+7.4 Constant string objects
+===========================
+
+GNU Objective-C provides constant string objects that are generated
+directly by the compiler. You declare a constant string object by
+prefixing a C constant string with the character `@':
+
+ id myString = @"this is a constant string object";
+
+ The constant string objects are by default instances of the
+`NXConstantString' class which is provided by the GNU Objective-C
+runtime. To get the definition of this class you must include the
+`objc/NXConstStr.h' header file.
+
+ User defined libraries may want to implement their own constant string
+class. To be able to support them, the GNU Objective-C compiler
+provides a new command line options
+`-fconstant-string-class=CLASS-NAME'. The provided class should adhere
+to a strict structure, the same as `NXConstantString''s structure:
+
+
+ @interface MyConstantStringClass
+ {
+ Class isa;
+ char *c_string;
+ unsigned int len;
+ }
+ @end
+
+ `NXConstantString' inherits from `Object'; user class libraries may
+choose to inherit the customized constant string class from a different
+class than `Object'. There is no requirement in the methods the
+constant string class has to implement, but the final ivar layout of
+the class must be the compatible with the given structure.
+
+ When the compiler creates the statically allocated constant string
+object, the `c_string' field will be filled by the compiler with the
+string; the `length' field will be filled by the compiler with the
+string length; the `isa' pointer will be filled with `NULL' by the
+compiler, and it will later be fixed up automatically at runtime by the
+GNU Objective-C runtime library to point to the class which was set by
+the `-fconstant-string-class' option when the object file is loaded (if
+you wonder how it works behind the scenes, the name of the class to
+use, and the list of static objects to fixup, are stored by the
+compiler in the object file in a place where the GNU runtime library
+will find them at runtime).
+
+ As a result, when a file is compiled with the
+`-fconstant-string-class' option, all the constant string objects will
+be instances of the class specified as argument to this option. It is
+possible to have multiple compilation units referring to different
+constant string classes, neither the compiler nor the linker impose any
+restrictions in doing this.
+
+
+File: gcc.info, Node: compatibility_alias, Prev: Constant string objects, Up: Objective-C
+
+7.5 compatibility_alias
+=======================
+
+This is a feature of the Objective-C compiler rather than of the
+runtime, anyway since it is documented nowhere and its existence was
+forgotten, we are documenting it here.
+
+ The keyword `@compatibility_alias' allows you to define a class name
+as equivalent to another class name. For example:
+
+ @compatibility_alias WOApplication GSWApplication;
+
+ tells the compiler that each time it encounters `WOApplication' as a
+class name, it should replace it with `GSWApplication' (that is,
+`WOApplication' is just an alias for `GSWApplication').
+
+ There are some constraints on how this can be used--
+
+ * `WOApplication' (the alias) must not be an existing class;
+
+ * `GSWApplication' (the real class) must be an existing class.
+
+
+
+File: gcc.info, Node: Compatibility, Next: Gcov, Prev: Objective-C, Up: Top
+
+8 Binary Compatibility
+**********************
+
+Binary compatibility encompasses several related concepts:
+
+"application binary interface (ABI)"
+ The set of runtime conventions followed by all of the tools that
+ deal with binary representations of a program, including
+ compilers, assemblers, linkers, and language runtime support.
+ Some ABIs are formal with a written specification, possibly
+ designed by multiple interested parties. Others are simply the
+ way things are actually done by a particular set of tools.
+
+"ABI conformance"
+ A compiler conforms to an ABI if it generates code that follows
+ all of the specifications enumerated by that ABI. A library
+ conforms to an ABI if it is implemented according to that ABI. An
+ application conforms to an ABI if it is built using tools that
+ conform to that ABI and does not contain source code that
+ specifically changes behavior specified by the ABI.
+
+"calling conventions"
+ Calling conventions are a subset of an ABI that specify of how
+ arguments are passed and function results are returned.
+
+"interoperability"
+ Different sets of tools are interoperable if they generate files
+ that can be used in the same program. The set of tools includes
+ compilers, assemblers, linkers, libraries, header files, startup
+ files, and debuggers. Binaries produced by different sets of
+ tools are not interoperable unless they implement the same ABI.
+ This applies to different versions of the same tools as well as
+ tools from different vendors.
+
+"intercallability"
+ Whether a function in a binary built by one set of tools can call a
+ function in a binary built by a different set of tools is a subset
+ of interoperability.
+
+"implementation-defined features"
+ Language standards include lists of implementation-defined
+ features whose behavior can vary from one implementation to
+ another. Some of these features are normally covered by a
+ platform's ABI and others are not. The features that are not
+ covered by an ABI generally affect how a program behaves, but not
+ intercallability.
+
+"compatibility"
+ Conformance to the same ABI and the same behavior of
+ implementation-defined features are both relevant for
+ compatibility.
+
+ The application binary interface implemented by a C or C++ compiler
+affects code generation and runtime support for:
+
+ * size and alignment of data types
+
+ * layout of structured types
+
+ * calling conventions
+
+ * register usage conventions
+
+ * interfaces for runtime arithmetic support
+
+ * object file formats
+
+ In addition, the application binary interface implemented by a C++
+compiler affects code generation and runtime support for:
+ * name mangling
+
+ * exception handling
+
+ * invoking constructors and destructors
+
+ * layout, alignment, and padding of classes
+
+ * layout and alignment of virtual tables
+
+ Some GCC compilation options cause the compiler to generate code that
+does not conform to the platform's default ABI. Other options cause
+different program behavior for implementation-defined features that are
+not covered by an ABI. These options are provided for consistency with
+other compilers that do not follow the platform's default ABI or the
+usual behavior of implementation-defined features for the platform. Be
+very careful about using such options.
+
+ Most platforms have a well-defined ABI that covers C code, but ABIs
+that cover C++ functionality are not yet common.
+
+ Starting with GCC 3.2, GCC binary conventions for C++ are based on a
+written, vendor-neutral C++ ABI that was designed to be specific to
+64-bit Itanium but also includes generic specifications that apply to
+any platform. This C++ ABI is also implemented by other compiler
+vendors on some platforms, notably GNU/Linux and BSD systems. We have
+tried hard to provide a stable ABI that will be compatible with future
+GCC releases, but it is possible that we will encounter problems that
+make this difficult. Such problems could include different
+interpretations of the C++ ABI by different vendors, bugs in the ABI, or
+bugs in the implementation of the ABI in different compilers. GCC's
+`-Wabi' switch warns when G++ generates code that is probably not
+compatible with the C++ ABI.
+
+ The C++ library used with a C++ compiler includes the Standard C++
+Library, with functionality defined in the C++ Standard, plus language
+runtime support. The runtime support is included in a C++ ABI, but
+there is no formal ABI for the Standard C++ Library. Two
+implementations of that library are interoperable if one follows the
+de-facto ABI of the other and if they are both built with the same
+compiler, or with compilers that conform to the same ABI for C++
+compiler and runtime support.
+
+ When G++ and another C++ compiler conform to the same C++ ABI, but the
+implementations of the Standard C++ Library that they normally use do
+not follow the same ABI for the Standard C++ Library, object files
+built with those compilers can be used in the same program only if they
+use the same C++ library. This requires specifying the location of the
+C++ library header files when invoking the compiler whose usual library
+is not being used. The location of GCC's C++ header files depends on
+how the GCC build was configured, but can be seen by using the G++ `-v'
+option. With default configuration options for G++ 3.3 the compile
+line for a different C++ compiler needs to include
+
+ -IGCC_INSTALL_DIRECTORY/include/c++/3.3
+
+ Similarly, compiling code with G++ that must use a C++ library other
+than the GNU C++ library requires specifying the location of the header
+files for that other library.
+
+ The most straightforward way to link a program to use a particular C++
+library is to use a C++ driver that specifies that C++ library by
+default. The `g++' driver, for example, tells the linker where to find
+GCC's C++ library (`libstdc++') plus the other libraries and startup
+files it needs, in the proper order.
+
+ If a program must use a different C++ library and it's not possible to
+do the final link using a C++ driver that uses that library by default,
+it is necessary to tell `g++' the location and name of that library.
+It might also be necessary to specify different startup files and other
+runtime support libraries, and to suppress the use of GCC's support
+libraries with one or more of the options `-nostdlib', `-nostartfiles',
+and `-nodefaultlibs'.
+
+
+File: gcc.info, Node: Gcov, Next: Trouble, Prev: Compatibility, Up: Top
+
+9 `gcov'--a Test Coverage Program
+*********************************
+
+`gcov' is a tool you can use in conjunction with GCC to test code
+coverage in your programs.
+
+* Menu:
+
+* Gcov Intro:: Introduction to gcov.
+* Invoking Gcov:: How to use gcov.
+* Gcov and Optimization:: Using gcov with GCC optimization.
+* Gcov Data Files:: The files used by gcov.
+* Cross-profiling:: Data file relocation.
+
+
+File: gcc.info, Node: Gcov Intro, Next: Invoking Gcov, Up: Gcov
+
+9.1 Introduction to `gcov'
+==========================
+
+`gcov' is a test coverage program. Use it in concert with GCC to
+analyze your programs to help create more efficient, faster running
+code and to discover untested parts of your program. You can use
+`gcov' as a profiling tool to help discover where your optimization
+efforts will best affect your code. You can also use `gcov' along with
+the other profiling tool, `gprof', to assess which parts of your code
+use the greatest amount of computing time.
+
+ Profiling tools help you analyze your code's performance. Using a
+profiler such as `gcov' or `gprof', you can find out some basic
+performance statistics, such as:
+
+ * how often each line of code executes
+
+ * what lines of code are actually executed
+
+ * how much computing time each section of code uses
+
+ Once you know these things about how your code works when compiled, you
+can look at each module to see which modules should be optimized.
+`gcov' helps you determine where to work on optimization.
+
+ Software developers also use coverage testing in concert with
+testsuites, to make sure software is actually good enough for a release.
+Testsuites can verify that a program works as expected; a coverage
+program tests to see how much of the program is exercised by the
+testsuite. Developers can then determine what kinds of test cases need
+to be added to the testsuites to create both better testing and a better
+final product.
+
+ You should compile your code without optimization if you plan to use
+`gcov' because the optimization, by combining some lines of code into
+one function, may not give you as much information as you need to look
+for `hot spots' where the code is using a great deal of computer time.
+Likewise, because `gcov' accumulates statistics by line (at the lowest
+resolution), it works best with a programming style that places only
+one statement on each line. If you use complicated macros that expand
+to loops or to other control structures, the statistics are less
+helpful--they only report on the line where the macro call appears. If
+your complex macros behave like functions, you can replace them with
+inline functions to solve this problem.
+
+ `gcov' creates a logfile called `SOURCEFILE.gcov' which indicates how
+many times each line of a source file `SOURCEFILE.c' has executed. You
+can use these logfiles along with `gprof' to aid in fine-tuning the
+performance of your programs. `gprof' gives timing information you can
+use along with the information you get from `gcov'.
+
+ `gcov' works only on code compiled with GCC. It is not compatible
+with any other profiling or test coverage mechanism.
+
+
+File: gcc.info, Node: Invoking Gcov, Next: Gcov and Optimization, Prev: Gcov Intro, Up: Gcov
+
+9.2 Invoking `gcov'
+===================
+
+ gcov [OPTIONS] SOURCEFILES
+
+ `gcov' accepts the following options:
+
+`-h'
+`--help'
+ Display help about using `gcov' (on the standard output), and exit
+ without doing any further processing.
+
+`-v'
+`--version'
+ Display the `gcov' version number (on the standard output), and
+ exit without doing any further processing.
+
+`-a'
+`--all-blocks'
+ Write individual execution counts for every basic block. Normally
+ gcov outputs execution counts only for the main blocks of a line.
+ With this option you can determine if blocks within a single line
+ are not being executed.
+
+`-b'
+`--branch-probabilities'
+ Write branch frequencies to the output file, and write branch
+ summary info to the standard output. This option allows you to
+ see how often each branch in your program was taken.
+ Unconditional branches will not be shown, unless the `-u' option
+ is given.
+
+`-c'
+`--branch-counts'
+ Write branch frequencies as the number of branches taken, rather
+ than the percentage of branches taken.
+
+`-n'
+`--no-output'
+ Do not create the `gcov' output file.
+
+`-l'
+`--long-file-names'
+ Create long file names for included source files. For example, if
+ the header file `x.h' contains code, and was included in the file
+ `a.c', then running `gcov' on the file `a.c' will produce an
+ output file called `a.c##x.h.gcov' instead of `x.h.gcov'. This
+ can be useful if `x.h' is included in multiple source files. If
+ you use the `-p' option, both the including and included file
+ names will be complete path names.
+
+`-p'
+`--preserve-paths'
+ Preserve complete path information in the names of generated
+ `.gcov' files. Without this option, just the filename component is
+ used. With this option, all directories are used, with `/'
+ characters translated to `#' characters, `.' directory components
+ removed and `..' components renamed to `^'. This is useful if
+ sourcefiles are in several different directories. It also affects
+ the `-l' option.
+
+`-f'
+`--function-summaries'
+ Output summaries for each function in addition to the file level
+ summary.
+
+`-o DIRECTORY|FILE'
+`--object-directory DIRECTORY'
+`--object-file FILE'
+ Specify either the directory containing the gcov data files, or the
+ object path name. The `.gcno', and `.gcda' data files are
+ searched for using this option. If a directory is specified, the
+ data files are in that directory and named after the source file
+ name, without its extension. If a file is specified here, the
+ data files are named after that file, without its extension. If
+ this option is not supplied, it defaults to the current directory.
+
+`-u'
+`--unconditional-branches'
+ When branch probabilities are given, include those of
+ unconditional branches. Unconditional branches are normally not
+ interesting.
+
+
+ `gcov' should be run with the current directory the same as that when
+you invoked the compiler. Otherwise it will not be able to locate the
+source files. `gcov' produces files called `MANGLEDNAME.gcov' in the
+current directory. These contain the coverage information of the
+source file they correspond to. One `.gcov' file is produced for each
+source file containing code, which was compiled to produce the data
+files. The MANGLEDNAME part of the output file name is usually simply
+the source file name, but can be something more complicated if the `-l'
+or `-p' options are given. Refer to those options for details.
+
+ The `.gcov' files contain the `:' separated fields along with program
+source code. The format is
+
+ EXECUTION_COUNT:LINE_NUMBER:SOURCE LINE TEXT
+
+ Additional block information may succeed each line, when requested by
+command line option. The EXECUTION_COUNT is `-' for lines containing
+no code and `#####' for lines which were never executed. Some lines of
+information at the start have LINE_NUMBER of zero.
+
+ The preamble lines are of the form
+
+ -:0:TAG:VALUE
+
+ The ordering and number of these preamble lines will be augmented as
+`gcov' development progresses -- do not rely on them remaining
+unchanged. Use TAG to locate a particular preamble line.
+
+ The additional block information is of the form
+
+ TAG INFORMATION
+
+ The INFORMATION is human readable, but designed to be simple enough
+for machine parsing too.
+
+ When printing percentages, 0% and 100% are only printed when the values
+are _exactly_ 0% and 100% respectively. Other values which would
+conventionally be rounded to 0% or 100% are instead printed as the
+nearest non-boundary value.
+
+ When using `gcov', you must first compile your program with two
+special GCC options: `-fprofile-arcs -ftest-coverage'. This tells the
+compiler to generate additional information needed by gcov (basically a
+flow graph of the program) and also includes additional code in the
+object files for generating the extra profiling information needed by
+gcov. These additional files are placed in the directory where the
+object file is located.
+
+ Running the program will cause profile output to be generated. For
+each source file compiled with `-fprofile-arcs', an accompanying
+`.gcda' file will be placed in the object file directory.
+
+ Running `gcov' with your program's source file names as arguments will
+now produce a listing of the code along with frequency of execution for
+each line. For example, if your program is called `tmp.c', this is
+what you see when you use the basic `gcov' facility:
+
+ $ gcc -fprofile-arcs -ftest-coverage tmp.c
+ $ a.out
+ $ gcov tmp.c
+ 90.00% of 10 source lines executed in file tmp.c
+ Creating tmp.c.gcov.
+
+ The file `tmp.c.gcov' contains output from `gcov'. Here is a sample:
+
+ -: 0:Source:tmp.c
+ -: 0:Graph:tmp.gcno
+ -: 0:Data:tmp.gcda
+ -: 0:Runs:1
+ -: 0:Programs:1
+ -: 1:#include <stdio.h>
+ -: 2:
+ -: 3:int main (void)
+ 1: 4:{
+ 1: 5: int i, total;
+ -: 6:
+ 1: 7: total = 0;
+ -: 8:
+ 11: 9: for (i = 0; i < 10; i++)
+ 10: 10: total += i;
+ -: 11:
+ 1: 12: if (total != 45)
+ #####: 13: printf ("Failure\n");
+ -: 14: else
+ 1: 15: printf ("Success\n");
+ 1: 16: return 0;
+ -: 17:}
+
+ When you use the `-a' option, you will get individual block counts,
+and the output looks like this:
+
+ -: 0:Source:tmp.c
+ -: 0:Graph:tmp.gcno
+ -: 0:Data:tmp.gcda
+ -: 0:Runs:1
+ -: 0:Programs:1
+ -: 1:#include <stdio.h>
+ -: 2:
+ -: 3:int main (void)
+ 1: 4:{
+ 1: 4-block 0
+ 1: 5: int i, total;
+ -: 6:
+ 1: 7: total = 0;
+ -: 8:
+ 11: 9: for (i = 0; i < 10; i++)
+ 11: 9-block 0
+ 10: 10: total += i;
+ 10: 10-block 0
+ -: 11:
+ 1: 12: if (total != 45)
+ 1: 12-block 0
+ #####: 13: printf ("Failure\n");
+ $$$$$: 13-block 0
+ -: 14: else
+ 1: 15: printf ("Success\n");
+ 1: 15-block 0
+ 1: 16: return 0;
+ 1: 16-block 0
+ -: 17:}
+
+ In this mode, each basic block is only shown on one line - the last
+line of the block. A multi-line block will only contribute to the
+execution count of that last line, and other lines will not be shown to
+contain code, unless previous blocks end on those lines. The total
+execution count of a line is shown and subsequent lines show the
+execution counts for individual blocks that end on that line. After
+each block, the branch and call counts of the block will be shown, if
+the `-b' option is given.
+
+ Because of the way GCC instruments calls, a call count can be shown
+after a line with no individual blocks. As you can see, line 13
+contains a basic block that was not executed.
+
+ When you use the `-b' option, your output looks like this:
+
+ $ gcov -b tmp.c
+ 90.00% of 10 source lines executed in file tmp.c
+ 80.00% of 5 branches executed in file tmp.c
+ 80.00% of 5 branches taken at least once in file tmp.c
+ 50.00% of 2 calls executed in file tmp.c
+ Creating tmp.c.gcov.
+
+ Here is a sample of a resulting `tmp.c.gcov' file:
+
+ -: 0:Source:tmp.c
+ -: 0:Graph:tmp.gcno
+ -: 0:Data:tmp.gcda
+ -: 0:Runs:1
+ -: 0:Programs:1
+ -: 1:#include <stdio.h>
+ -: 2:
+ -: 3:int main (void)
+ function main called 1 returned 1 blocks executed 75%
+ 1: 4:{
+ 1: 5: int i, total;
+ -: 6:
+ 1: 7: total = 0;
+ -: 8:
+ 11: 9: for (i = 0; i < 10; i++)
+ branch 0 taken 91% (fallthrough)
+ branch 1 taken 9%
+ 10: 10: total += i;
+ -: 11:
+ 1: 12: if (total != 45)
+ branch 0 taken 0% (fallthrough)
+ branch 1 taken 100%
+ #####: 13: printf ("Failure\n");
+ call 0 never executed
+ -: 14: else
+ 1: 15: printf ("Success\n");
+ call 0 called 1 returned 100%
+ 1: 16: return 0;
+ -: 17:}
+
+ For each function, a line is printed showing how many times the
+function is called, how many times it returns and what percentage of the
+function's blocks were executed.
+
+ For each basic block, a line is printed after the last line of the
+basic block describing the branch or call that ends the basic block.
+There can be multiple branches and calls listed for a single source
+line if there are multiple basic blocks that end on that line. In this
+case, the branches and calls are each given a number. There is no
+simple way to map these branches and calls back to source constructs.
+In general, though, the lowest numbered branch or call will correspond
+to the leftmost construct on the source line.
+
+ For a branch, if it was executed at least once, then a percentage
+indicating the number of times the branch was taken divided by the
+number of times the branch was executed will be printed. Otherwise, the
+message "never executed" is printed.
+
+ For a call, if it was executed at least once, then a percentage
+indicating the number of times the call returned divided by the number
+of times the call was executed will be printed. This will usually be
+100%, but may be less for functions that call `exit' or `longjmp', and
+thus may not return every time they are called.
+
+ The execution counts are cumulative. If the example program were
+executed again without removing the `.gcda' file, the count for the
+number of times each line in the source was executed would be added to
+the results of the previous run(s). This is potentially useful in
+several ways. For example, it could be used to accumulate data over a
+number of program runs as part of a test verification suite, or to
+provide more accurate long-term information over a large number of
+program runs.
+
+ The data in the `.gcda' files is saved immediately before the program
+exits. For each source file compiled with `-fprofile-arcs', the
+profiling code first attempts to read in an existing `.gcda' file; if
+the file doesn't match the executable (differing number of basic block
+counts) it will ignore the contents of the file. It then adds in the
+new execution counts and finally writes the data to the file.
+
+
+File: gcc.info, Node: Gcov and Optimization, Next: Gcov Data Files, Prev: Invoking Gcov, Up: Gcov
+
+9.3 Using `gcov' with GCC Optimization
+======================================
+
+If you plan to use `gcov' to help optimize your code, you must first
+compile your program with two special GCC options: `-fprofile-arcs
+-ftest-coverage'. Aside from that, you can use any other GCC options;
+but if you want to prove that every single line in your program was
+executed, you should not compile with optimization at the same time.
+On some machines the optimizer can eliminate some simple code lines by
+combining them with other lines. For example, code like this:
+
+ if (a != b)
+ c = 1;
+ else
+ c = 0;
+
+can be compiled into one instruction on some machines. In this case,
+there is no way for `gcov' to calculate separate execution counts for
+each line because there isn't separate code for each line. Hence the
+`gcov' output looks like this if you compiled the program with
+optimization:
+
+ 100: 12:if (a != b)
+ 100: 13: c = 1;
+ 100: 14:else
+ 100: 15: c = 0;
+
+ The output shows that this block of code, combined by optimization,
+executed 100 times. In one sense this result is correct, because there
+was only one instruction representing all four of these lines. However,
+the output does not indicate how many times the result was 0 and how
+many times the result was 1.
+
+ Inlineable functions can create unexpected line counts. Line counts
+are shown for the source code of the inlineable function, but what is
+shown depends on where the function is inlined, or if it is not inlined
+at all.
+
+ If the function is not inlined, the compiler must emit an out of line
+copy of the function, in any object file that needs it. If `fileA.o'
+and `fileB.o' both contain out of line bodies of a particular
+inlineable function, they will also both contain coverage counts for
+that function. When `fileA.o' and `fileB.o' are linked together, the
+linker will, on many systems, select one of those out of line bodies
+for all calls to that function, and remove or ignore the other.
+Unfortunately, it will not remove the coverage counters for the unused
+function body. Hence when instrumented, all but one use of that
+function will show zero counts.
+
+ If the function is inlined in several places, the block structure in
+each location might not be the same. For instance, a condition might
+now be calculable at compile time in some instances. Because the
+coverage of all the uses of the inline function will be shown for the
+same source lines, the line counts themselves might seem inconsistent.
+
+
+File: gcc.info, Node: Gcov Data Files, Next: Cross-profiling, Prev: Gcov and Optimization, Up: Gcov
+
+9.4 Brief description of `gcov' data files
+==========================================
+
+`gcov' uses two files for profiling. The names of these files are
+derived from the original _object_ file by substituting the file suffix
+with either `.gcno', or `.gcda'. All of these files are placed in the
+same directory as the object file, and contain data stored in a
+platform-independent format.
+
+ The `.gcno' file is generated when the source file is compiled with
+the GCC `-ftest-coverage' option. It contains information to
+reconstruct the basic block graphs and assign source line numbers to
+blocks.
+
+ The `.gcda' file is generated when a program containing object files
+built with the GCC `-fprofile-arcs' option is executed. A separate
+`.gcda' file is created for each object file compiled with this option.
+It contains arc transition counts, and some summary information.
+
+ The full details of the file format is specified in `gcov-io.h', and
+functions provided in that header file should be used to access the
+coverage files.
+
+
+File: gcc.info, Node: Cross-profiling, Prev: Gcov Data Files, Up: Gcov
+
+9.5 Data file relocation to support cross-profiling
+===================================================
+
+Running the program will cause profile output to be generated. For each
+source file compiled with `-fprofile-arcs', an accompanying `.gcda'
+file will be placed in the object file directory. That implicitly
+requires running the program on the same system as it was built or
+having the same absolute directory structure on the target system. The
+program will try to create the needed directory structure, if it is not
+already present.
+
+ To support cross-profiling, a program compiled with `-fprofile-arcs'
+can relocate the data files based on two environment variables:
+
+ * GCOV_PREFIX contains the prefix to add to the absolute paths in
+ the object file. Prefix must be absolute as well, otherwise its
+ value is ignored. The default is no prefix.
+
+ * GCOV_PREFIX_STRIP indicates the how many initial directory names
+ to strip off the hardwired absolute paths. Default value is 0.
+
+ _Note:_ GCOV_PREFIX_STRIP has no effect if GCOV_PREFIX is
+ undefined, empty or non-absolute.
+
+ For example, if the object file `/user/build/foo.o' was built with
+`-fprofile-arcs', the final executable will try to create the data file
+`/user/build/foo.gcda' when running on the target system. This will
+fail if the corresponding directory does not exist and it is unable to
+create it. This can be overcome by, for example, setting the
+environment as `GCOV_PREFIX=/target/run' and `GCOV_PREFIX_STRIP=1'.
+Such a setting will name the data file `/target/run/build/foo.gcda'.
+
+ You must move the data files to the expected directory tree in order to
+use them for profile directed optimizations (`--use-profile'), or to
+use the `gcov' tool.
+
+
+File: gcc.info, Node: Trouble, Next: Bugs, Prev: Gcov, Up: Top
+
+10 Known Causes of Trouble with GCC
+***********************************
+
+This section describes known problems that affect users of GCC. Most
+of these are not GCC bugs per se--if they were, we would fix them. But
+the result for a user may be like the result of a bug.
+
+ Some of these problems are due to bugs in other software, some are
+missing features that are too much work to add, and some are places
+where people's opinions differ as to what is best.
+
+* Menu:
+
+* Actual Bugs:: Bugs we will fix later.
+* Cross-Compiler Problems:: Common problems of cross compiling with GCC.
+* Interoperation:: Problems using GCC with other compilers,
+ and with certain linkers, assemblers and debuggers.
+* Incompatibilities:: GCC is incompatible with traditional C.
+* Fixed Headers:: GCC uses corrected versions of system header files.
+ This is necessary, but doesn't always work smoothly.
+* Standard Libraries:: GCC uses the system C library, which might not be
+ compliant with the ISO C standard.
+* Disappointments:: Regrettable things we can't change, but not quite bugs.
+* C++ Misunderstandings:: Common misunderstandings with GNU C++.
+* Protoize Caveats:: Things to watch out for when using `protoize'.
+* Non-bugs:: Things we think are right, but some others disagree.
+* Warnings and Errors:: Which problems in your code get warnings,
+ and which get errors.
+
+
+File: gcc.info, Node: Actual Bugs, Next: Cross-Compiler Problems, Up: Trouble
+
+10.1 Actual Bugs We Haven't Fixed Yet
+=====================================
+
+ * The `fixincludes' script interacts badly with automounters; if the
+ directory of system header files is automounted, it tends to be
+ unmounted while `fixincludes' is running. This would seem to be a
+ bug in the automounter. We don't know any good way to work around
+ it.
+
+ * The `fixproto' script will sometimes add prototypes for the
+ `sigsetjmp' and `siglongjmp' functions that reference the
+ `jmp_buf' type before that type is defined. To work around this,
+ edit the offending file and place the typedef in front of the
+ prototypes.
+
+
+File: gcc.info, Node: Cross-Compiler Problems, Next: Interoperation, Prev: Actual Bugs, Up: Trouble
+
+10.2 Cross-Compiler Problems
+============================
+
+You may run into problems with cross compilation on certain machines,
+for several reasons.
+
+ * At present, the program `mips-tfile' which adds debug support to
+ object files on MIPS systems does not work in a cross compile
+ environment.
+
+
+File: gcc.info, Node: Interoperation, Next: Incompatibilities, Prev: Cross-Compiler Problems, Up: Trouble
+
+10.3 Interoperation
+===================
+
+This section lists various difficulties encountered in using GCC
+together with other compilers or with the assemblers, linkers,
+libraries and debuggers on certain systems.
+
+ * On many platforms, GCC supports a different ABI for C++ than do
+ other compilers, so the object files compiled by GCC cannot be
+ used with object files generated by another C++ compiler.
+
+ An area where the difference is most apparent is name mangling.
+ The use of different name mangling is intentional, to protect you
+ from more subtle problems. Compilers differ as to many internal
+ details of C++ implementation, including: how class instances are
+ laid out, how multiple inheritance is implemented, and how virtual
+ function calls are handled. If the name encoding were made the
+ same, your programs would link against libraries provided from
+ other compilers--but the programs would then crash when run.
+ Incompatible libraries are then detected at link time, rather than
+ at run time.
+
+ * On some BSD systems, including some versions of Ultrix, use of
+ profiling causes static variable destructors (currently used only
+ in C++) not to be run.
+
+ * On some SGI systems, when you use `-lgl_s' as an option, it gets
+ translated magically to `-lgl_s -lX11_s -lc_s'. Naturally, this
+ does not happen when you use GCC. You must specify all three
+ options explicitly.
+
+ * On a SPARC, GCC aligns all values of type `double' on an 8-byte
+ boundary, and it expects every `double' to be so aligned. The Sun
+ compiler usually gives `double' values 8-byte alignment, with one
+ exception: function arguments of type `double' may not be aligned.
+
+ As a result, if a function compiled with Sun CC takes the address
+ of an argument of type `double' and passes this pointer of type
+ `double *' to a function compiled with GCC, dereferencing the
+ pointer may cause a fatal signal.
+
+ One way to solve this problem is to compile your entire program
+ with GCC. Another solution is to modify the function that is
+ compiled with Sun CC to copy the argument into a local variable;
+ local variables are always properly aligned. A third solution is
+ to modify the function that uses the pointer to dereference it via
+ the following function `access_double' instead of directly with
+ `*':
+
+ inline double
+ access_double (double *unaligned_ptr)
+ {
+ union d2i { double d; int i[2]; };
+
+ union d2i *p = (union d2i *) unaligned_ptr;
+ union d2i u;
+
+ u.i[0] = p->i[0];
+ u.i[1] = p->i[1];
+
+ return u.d;
+ }
+
+ Storing into the pointer can be done likewise with the same union.
+
+ * On Solaris, the `malloc' function in the `libmalloc.a' library may
+ allocate memory that is only 4 byte aligned. Since GCC on the
+ SPARC assumes that doubles are 8 byte aligned, this may result in a
+ fatal signal if doubles are stored in memory allocated by the
+ `libmalloc.a' library.
+
+ The solution is to not use the `libmalloc.a' library. Use instead
+ `malloc' and related functions from `libc.a'; they do not have
+ this problem.
+
+ * On the HP PA machine, ADB sometimes fails to work on functions
+ compiled with GCC. Specifically, it fails to work on functions
+ that use `alloca' or variable-size arrays. This is because GCC
+ doesn't generate HP-UX unwind descriptors for such functions. It
+ may even be impossible to generate them.
+
+ * Debugging (`-g') is not supported on the HP PA machine, unless you
+ use the preliminary GNU tools.
+
+ * Taking the address of a label may generate errors from the HP-UX
+ PA assembler. GAS for the PA does not have this problem.
+
+ * Using floating point parameters for indirect calls to static
+ functions will not work when using the HP assembler. There simply
+ is no way for GCC to specify what registers hold arguments for
+ static functions when using the HP assembler. GAS for the PA does
+ not have this problem.
+
+ * In extremely rare cases involving some very large functions you may
+ receive errors from the HP linker complaining about an out of
+ bounds unconditional branch offset. This used to occur more often
+ in previous versions of GCC, but is now exceptionally rare. If
+ you should run into it, you can work around by making your
+ function smaller.
+
+ * GCC compiled code sometimes emits warnings from the HP-UX
+ assembler of the form:
+
+ (warning) Use of GR3 when
+ frame >= 8192 may cause conflict.
+
+ These warnings are harmless and can be safely ignored.
+
+ * In extremely rare cases involving some very large functions you may
+ receive errors from the AIX Assembler complaining about a
+ displacement that is too large. If you should run into it, you
+ can work around by making your function smaller.
+
+ * The `libstdc++.a' library in GCC relies on the SVR4 dynamic linker
+ semantics which merges global symbols between libraries and
+ applications, especially necessary for C++ streams functionality.
+ This is not the default behavior of AIX shared libraries and
+ dynamic linking. `libstdc++.a' is built on AIX with
+ "runtime-linking" enabled so that symbol merging can occur. To
+ utilize this feature, the application linked with `libstdc++.a'
+ must include the `-Wl,-brtl' flag on the link line. G++ cannot
+ impose this because this option may interfere with the semantics
+ of the user program and users may not always use `g++' to link his
+ or her application. Applications are not required to use the
+ `-Wl,-brtl' flag on the link line--the rest of the `libstdc++.a'
+ library which is not dependent on the symbol merging semantics
+ will continue to function correctly.
+
+ * An application can interpose its own definition of functions for
+ functions invoked by `libstdc++.a' with "runtime-linking" enabled
+ on AIX. To accomplish this the application must be linked with
+ "runtime-linking" option and the functions explicitly must be
+ exported by the application (`-Wl,-brtl,-bE:exportfile').
+
+ * AIX on the RS/6000 provides support (NLS) for environments outside
+ of the United States. Compilers and assemblers use NLS to support
+ locale-specific representations of various objects including
+ floating-point numbers (`.' vs `,' for separating decimal
+ fractions). There have been problems reported where the library
+ linked with GCC does not produce the same floating-point formats
+ that the assembler accepts. If you have this problem, set the
+ `LANG' environment variable to `C' or `En_US'.
+
+ * Even if you specify `-fdollars-in-identifiers', you cannot
+ successfully use `$' in identifiers on the RS/6000 due to a
+ restriction in the IBM assembler. GAS supports these identifiers.
+
+
+
+File: gcc.info, Node: Incompatibilities, Next: Fixed Headers, Prev: Interoperation, Up: Trouble
+
+10.4 Incompatibilities of GCC
+=============================
+
+There are several noteworthy incompatibilities between GNU C and K&R
+(non-ISO) versions of C.
+
+ * GCC normally makes string constants read-only. If several
+ identical-looking string constants are used, GCC stores only one
+ copy of the string.
+
+ One consequence is that you cannot call `mktemp' with a string
+ constant argument. The function `mktemp' always alters the string
+ its argument points to.
+
+ Another consequence is that `sscanf' does not work on some very
+ old systems when passed a string constant as its format control
+ string or input. This is because `sscanf' incorrectly tries to
+ write into the string constant. Likewise `fscanf' and `scanf'.
+
+ The solution to these problems is to change the program to use
+ `char'-array variables with initialization strings for these
+ purposes instead of string constants.
+
+ * `-2147483648' is positive.
+
+ This is because 2147483648 cannot fit in the type `int', so
+ (following the ISO C rules) its data type is `unsigned long int'.
+ Negating this value yields 2147483648 again.
+
+ * GCC does not substitute macro arguments when they appear inside of
+ string constants. For example, the following macro in GCC
+
+ #define foo(a) "a"
+
+ will produce output `"a"' regardless of what the argument A is.
+
+ * When you use `setjmp' and `longjmp', the only automatic variables
+ guaranteed to remain valid are those declared `volatile'. This is
+ a consequence of automatic register allocation. Consider this
+ function:
+
+ jmp_buf j;
+
+ foo ()
+ {
+ int a, b;
+
+ a = fun1 ();
+ if (setjmp (j))
+ return a;
+
+ a = fun2 ();
+ /* `longjmp (j)' may occur in `fun3'. */
+ return a + fun3 ();
+ }
+
+ Here `a' may or may not be restored to its first value when the
+ `longjmp' occurs. If `a' is allocated in a register, then its
+ first value is restored; otherwise, it keeps the last value stored
+ in it.
+
+ If you use the `-W' option with the `-O' option, you will get a
+ warning when GCC thinks such a problem might be possible.
+
+ * Programs that use preprocessing directives in the middle of macro
+ arguments do not work with GCC. For example, a program like this
+ will not work:
+
+ foobar (
+ #define luser
+ hack)
+
+ ISO C does not permit such a construct.
+
+ * K&R compilers allow comments to cross over an inclusion boundary
+ (i.e. started in an include file and ended in the including file).
+
+ * Declarations of external variables and functions within a block
+ apply only to the block containing the declaration. In other
+ words, they have the same scope as any other declaration in the
+ same place.
+
+ In some other C compilers, a `extern' declaration affects all the
+ rest of the file even if it happens within a block.
+
+ * In traditional C, you can combine `long', etc., with a typedef
+ name, as shown here:
+
+ typedef int foo;
+ typedef long foo bar;
+
+ In ISO C, this is not allowed: `long' and other type modifiers
+ require an explicit `int'.
+
+ * PCC allows typedef names to be used as function parameters.
+
+ * Traditional C allows the following erroneous pair of declarations
+ to appear together in a given scope:
+
+ typedef int foo;
+ typedef foo foo;
+
+ * GCC treats all characters of identifiers as significant.
+ According to K&R-1 (2.2), "No more than the first eight characters
+ are significant, although more may be used.". Also according to
+ K&R-1 (2.2), "An identifier is a sequence of letters and digits;
+ the first character must be a letter. The underscore _ counts as
+ a letter.", but GCC also allows dollar signs in identifiers.
+
+ * PCC allows whitespace in the middle of compound assignment
+ operators such as `+='. GCC, following the ISO standard, does not
+ allow this.
+
+ * GCC complains about unterminated character constants inside of
+ preprocessing conditionals that fail. Some programs have English
+ comments enclosed in conditionals that are guaranteed to fail; if
+ these comments contain apostrophes, GCC will probably report an
+ error. For example, this code would produce an error:
+
+ #if 0
+ You can't expect this to work.
+ #endif
+
+ The best solution to such a problem is to put the text into an
+ actual C comment delimited by `/*...*/'.
+
+ * Many user programs contain the declaration `long time ();'. In the
+ past, the system header files on many systems did not actually
+ declare `time', so it did not matter what type your program
+ declared it to return. But in systems with ISO C headers, `time'
+ is declared to return `time_t', and if that is not the same as
+ `long', then `long time ();' is erroneous.
+
+ The solution is to change your program to use appropriate system
+ headers (`<time.h>' on systems with ISO C headers) and not to
+ declare `time' if the system header files declare it, or failing
+ that to use `time_t' as the return type of `time'.
+
+ * When compiling functions that return `float', PCC converts it to a
+ double. GCC actually returns a `float'. If you are concerned
+ with PCC compatibility, you should declare your functions to return
+ `double'; you might as well say what you mean.
+
+ * When compiling functions that return structures or unions, GCC
+ output code normally uses a method different from that used on most
+ versions of Unix. As a result, code compiled with GCC cannot call
+ a structure-returning function compiled with PCC, and vice versa.
+
+ The method used by GCC is as follows: a structure or union which is
+ 1, 2, 4 or 8 bytes long is returned like a scalar. A structure or
+ union with any other size is stored into an address supplied by
+ the caller (usually in a special, fixed register, but on some
+ machines it is passed on the stack). The target hook
+ `TARGET_STRUCT_VALUE_RTX' tells GCC where to pass this address.
+
+ By contrast, PCC on most target machines returns structures and
+ unions of any size by copying the data into an area of static
+ storage, and then returning the address of that storage as if it
+ were a pointer value. The caller must copy the data from that
+ memory area to the place where the value is wanted. GCC does not
+ use this method because it is slower and nonreentrant.
+
+ On some newer machines, PCC uses a reentrant convention for all
+ structure and union returning. GCC on most of these machines uses
+ a compatible convention when returning structures and unions in
+ memory, but still returns small structures and unions in registers.
+
+ You can tell GCC to use a compatible convention for all structure
+ and union returning with the option `-fpcc-struct-return'.
+
+ * GCC complains about program fragments such as `0x74ae-0x4000'
+ which appear to be two hexadecimal constants separated by the minus
+ operator. Actually, this string is a single "preprocessing token".
+ Each such token must correspond to one token in C. Since this
+ does not, GCC prints an error message. Although it may appear
+ obvious that what is meant is an operator and two values, the ISO
+ C standard specifically requires that this be treated as erroneous.
+
+ A "preprocessing token" is a "preprocessing number" if it begins
+ with a digit and is followed by letters, underscores, digits,
+ periods and `e+', `e-', `E+', `E-', `p+', `p-', `P+', or `P-'
+ character sequences. (In strict C89 mode, the sequences `p+',
+ `p-', `P+' and `P-' cannot appear in preprocessing numbers.)
+
+ To make the above program fragment valid, place whitespace in
+ front of the minus sign. This whitespace will end the
+ preprocessing number.
+
+
+File: gcc.info, Node: Fixed Headers, Next: Standard Libraries, Prev: Incompatibilities, Up: Trouble
+
+10.5 Fixed Header Files
+=======================
+
+GCC needs to install corrected versions of some system header files.
+This is because most target systems have some header files that won't
+work with GCC unless they are changed. Some have bugs, some are
+incompatible with ISO C, and some depend on special features of other
+compilers.
+
+ Installing GCC automatically creates and installs the fixed header
+files, by running a program called `fixincludes'. Normally, you don't
+need to pay attention to this. But there are cases where it doesn't do
+the right thing automatically.
+
+ * If you update the system's header files, such as by installing a
+ new system version, the fixed header files of GCC are not
+ automatically updated. They can be updated using the `mkheaders'
+ script installed in `LIBEXECDIR/gcc/TARGET/VERSION/install-tools/'.
+
+ * On some systems, header file directories contain machine-specific
+ symbolic links in certain places. This makes it possible to share
+ most of the header files among hosts running the same version of
+ the system on different machine models.
+
+ The programs that fix the header files do not understand this
+ special way of using symbolic links; therefore, the directory of
+ fixed header files is good only for the machine model used to
+ build it.
+
+ It is possible to make separate sets of fixed header files for the
+ different machine models, and arrange a structure of symbolic
+ links so as to use the proper set, but you'll have to do this by
+ hand.
+
+
+File: gcc.info, Node: Standard Libraries, Next: Disappointments, Prev: Fixed Headers, Up: Trouble
+
+10.6 Standard Libraries
+=======================
+
+GCC by itself attempts to be a conforming freestanding implementation.
+*Note Language Standards Supported by GCC: Standards, for details of
+what this means. Beyond the library facilities required of such an
+implementation, the rest of the C library is supplied by the vendor of
+the operating system. If that C library doesn't conform to the C
+standards, then your programs might get warnings (especially when using
+`-Wall') that you don't expect.
+
+ For example, the `sprintf' function on SunOS 4.1.3 returns `char *'
+while the C standard says that `sprintf' returns an `int'. The
+`fixincludes' program could make the prototype for this function match
+the Standard, but that would be wrong, since the function will still
+return `char *'.
+
+ If you need a Standard compliant library, then you need to find one, as
+GCC does not provide one. The GNU C library (called `glibc') provides
+ISO C, POSIX, BSD, SystemV and X/Open compatibility for GNU/Linux and
+HURD-based GNU systems; no recent version of it supports other systems,
+though some very old versions did. Version 2.2 of the GNU C library
+includes nearly complete C99 support. You could also ask your
+operating system vendor if newer libraries are available.
+
+
+File: gcc.info, Node: Disappointments, Next: C++ Misunderstandings, Prev: Standard Libraries, Up: Trouble
+
+10.7 Disappointments and Misunderstandings
+==========================================
+
+These problems are perhaps regrettable, but we don't know any practical
+way around them.
+
+ * Certain local variables aren't recognized by debuggers when you
+ compile with optimization.
+
+ This occurs because sometimes GCC optimizes the variable out of
+ existence. There is no way to tell the debugger how to compute the
+ value such a variable "would have had", and it is not clear that
+ would be desirable anyway. So GCC simply does not mention the
+ eliminated variable when it writes debugging information.
+
+ You have to expect a certain amount of disagreement between the
+ executable and your source code, when you use optimization.
+
+ * Users often think it is a bug when GCC reports an error for code
+ like this:
+
+ int foo (struct mumble *);
+
+ struct mumble { ... };
+
+ int foo (struct mumble *x)
+ { ... }
+
+ This code really is erroneous, because the scope of `struct
+ mumble' in the prototype is limited to the argument list
+ containing it. It does not refer to the `struct mumble' defined
+ with file scope immediately below--they are two unrelated types
+ with similar names in different scopes.
+
+ But in the definition of `foo', the file-scope type is used
+ because that is available to be inherited. Thus, the definition
+ and the prototype do not match, and you get an error.
+
+ This behavior may seem silly, but it's what the ISO standard
+ specifies. It is easy enough for you to make your code work by
+ moving the definition of `struct mumble' above the prototype.
+ It's not worth being incompatible with ISO C just to avoid an
+ error for the example shown above.
+
+ * Accesses to bit-fields even in volatile objects works by accessing
+ larger objects, such as a byte or a word. You cannot rely on what
+ size of object is accessed in order to read or write the
+ bit-field; it may even vary for a given bit-field according to the
+ precise usage.
+
+ If you care about controlling the amount of memory that is
+ accessed, use volatile but do not use bit-fields.
+
+ * GCC comes with shell scripts to fix certain known problems in
+ system header files. They install corrected copies of various
+ header files in a special directory where only GCC will normally
+ look for them. The scripts adapt to various systems by searching
+ all the system header files for the problem cases that we know
+ about.
+
+ If new system header files are installed, nothing automatically
+ arranges to update the corrected header files. They can be
+ updated using the `mkheaders' script installed in
+ `LIBEXECDIR/gcc/TARGET/VERSION/install-tools/'.
+
+ * On 68000 and x86 systems, for instance, you can get paradoxical
+ results if you test the precise values of floating point numbers.
+ For example, you can find that a floating point value which is not
+ a NaN is not equal to itself. This results from the fact that the
+ floating point registers hold a few more bits of precision than
+ fit in a `double' in memory. Compiled code moves values between
+ memory and floating point registers at its convenience, and moving
+ them into memory truncates them.
+
+ You can partially avoid this problem by using the `-ffloat-store'
+ option (*note Optimize Options::).
+
+ * On AIX and other platforms without weak symbol support, templates
+ need to be instantiated explicitly and symbols for static members
+ of templates will not be generated.
+
+ * On AIX, GCC scans object files and library archives for static
+ constructors and destructors when linking an application before the
+ linker prunes unreferenced symbols. This is necessary to prevent
+ the AIX linker from mistakenly assuming that static constructor or
+ destructor are unused and removing them before the scanning can
+ occur. All static constructors and destructors found will be
+ referenced even though the modules in which they occur may not be
+ used by the program. This may lead to both increased executable
+ size and unexpected symbol references.
+
+
+File: gcc.info, Node: C++ Misunderstandings, Next: Protoize Caveats, Prev: Disappointments, Up: Trouble
+
+10.8 Common Misunderstandings with GNU C++
+==========================================
+
+C++ is a complex language and an evolving one, and its standard
+definition (the ISO C++ standard) was only recently completed. As a
+result, your C++ compiler may occasionally surprise you, even when its
+behavior is correct. This section discusses some areas that frequently
+give rise to questions of this sort.
+
+* Menu:
+
+* Static Definitions:: Static member declarations are not definitions
+* Name lookup:: Name lookup, templates, and accessing members of base classes
+* Temporaries:: Temporaries may vanish before you expect
+* Copy Assignment:: Copy Assignment operators copy virtual bases twice
+
+
+File: gcc.info, Node: Static Definitions, Next: Name lookup, Up: C++ Misunderstandings
+
+10.8.1 Declare _and_ Define Static Members
+------------------------------------------
+
+When a class has static data members, it is not enough to _declare_ the
+static member; you must also _define_ it. For example:
+
+ class Foo
+ {
+ ...
+ void method();
+ static int bar;
+ };
+
+ This declaration only establishes that the class `Foo' has an `int'
+named `Foo::bar', and a member function named `Foo::method'. But you
+still need to define _both_ `method' and `bar' elsewhere. According to
+the ISO standard, you must supply an initializer in one (and only one)
+source file, such as:
+
+ int Foo::bar = 0;
+
+ Other C++ compilers may not correctly implement the standard behavior.
+As a result, when you switch to `g++' from one of these compilers, you
+may discover that a program that appeared to work correctly in fact
+does not conform to the standard: `g++' reports as undefined symbols
+any static data members that lack definitions.
+
+
+File: gcc.info, Node: Name lookup, Next: Temporaries, Prev: Static Definitions, Up: C++ Misunderstandings
+
+10.8.2 Name lookup, templates, and accessing members of base classes
+--------------------------------------------------------------------
+
+The C++ standard prescribes that all names that are not dependent on
+template parameters are bound to their present definitions when parsing
+a template function or class.(1) Only names that are dependent are
+looked up at the point of instantiation. For example, consider
+
+ void foo(double);
+
+ struct A {
+ template <typename T>
+ void f () {
+ foo (1); // 1
+ int i = N; // 2
+ T t;
+ t.bar(); // 3
+ foo (t); // 4
+ }
+
+ static const int N;
+ };
+
+ Here, the names `foo' and `N' appear in a context that does not depend
+on the type of `T'. The compiler will thus require that they are
+defined in the context of use in the template, not only before the
+point of instantiation, and will here use `::foo(double)' and `A::N',
+respectively. In particular, it will convert the integer value to a
+`double' when passing it to `::foo(double)'.
+
+ Conversely, `bar' and the call to `foo' in the fourth marked line are
+used in contexts that do depend on the type of `T', so they are only
+looked up at the point of instantiation, and you can provide
+declarations for them after declaring the template, but before
+instantiating it. In particular, if you instantiate `A::f<int>', the
+last line will call an overloaded `::foo(int)' if one was provided,
+even if after the declaration of `struct A'.
+
+ This distinction between lookup of dependent and non-dependent names is
+called two-stage (or dependent) name lookup. G++ implements it since
+version 3.4.
+
+ Two-stage name lookup sometimes leads to situations with behavior
+different from non-template codes. The most common is probably this:
+
+ template <typename T> struct Base {
+ int i;
+ };
+
+ template <typename T> struct Derived : public Base<T> {
+ int get_i() { return i; }
+ };
+
+ In `get_i()', `i' is not used in a dependent context, so the compiler
+will look for a name declared at the enclosing namespace scope (which
+is the global scope here). It will not look into the base class, since
+that is dependent and you may declare specializations of `Base' even
+after declaring `Derived', so the compiler can't really know what `i'
+would refer to. If there is no global variable `i', then you will get
+an error message.
+
+ In order to make it clear that you want the member of the base class,
+you need to defer lookup until instantiation time, at which the base
+class is known. For this, you need to access `i' in a dependent
+context, by either using `this->i' (remember that `this' is of type
+`Derived<T>*', so is obviously dependent), or using `Base<T>::i'.
+Alternatively, `Base<T>::i' might be brought into scope by a
+`using'-declaration.
+
+ Another, similar example involves calling member functions of a base
+class:
+
+ template <typename T> struct Base {
+ int f();
+ };
+
+ template <typename T> struct Derived : Base<T> {
+ int g() { return f(); };
+ };
+
+ Again, the call to `f()' is not dependent on template arguments (there
+are no arguments that depend on the type `T', and it is also not
+otherwise specified that the call should be in a dependent context).
+Thus a global declaration of such a function must be available, since
+the one in the base class is not visible until instantiation time. The
+compiler will consequently produce the following error message:
+
+ x.cc: In member function `int Derived<T>::g()':
+ x.cc:6: error: there are no arguments to `f' that depend on a template
+ parameter, so a declaration of `f' must be available
+ x.cc:6: error: (if you use `-fpermissive', G++ will accept your code, but
+ allowing the use of an undeclared name is deprecated)
+
+ To make the code valid either use `this->f()', or `Base<T>::f()'.
+Using the `-fpermissive' flag will also let the compiler accept the
+code, by marking all function calls for which no declaration is visible
+at the time of definition of the template for later lookup at
+instantiation time, as if it were a dependent call. We do not
+recommend using `-fpermissive' to work around invalid code, and it will
+also only catch cases where functions in base classes are called, not
+where variables in base classes are used (as in the example above).
+
+ Note that some compilers (including G++ versions prior to 3.4) get
+these examples wrong and accept above code without an error. Those
+compilers do not implement two-stage name lookup correctly.
+
+ ---------- Footnotes ----------
+
+ (1) The C++ standard just uses the term "dependent" for names that
+depend on the type or value of template parameters. This shorter term
+will also be used in the rest of this section.
+
+
+File: gcc.info, Node: Temporaries, Next: Copy Assignment, Prev: Name lookup, Up: C++ Misunderstandings
+
+10.8.3 Temporaries May Vanish Before You Expect
+-----------------------------------------------
+
+It is dangerous to use pointers or references to _portions_ of a
+temporary object. The compiler may very well delete the object before
+you expect it to, leaving a pointer to garbage. The most common place
+where this problem crops up is in classes like string classes,
+especially ones that define a conversion function to type `char *' or
+`const char *'--which is one reason why the standard `string' class
+requires you to call the `c_str' member function. However, any class
+that returns a pointer to some internal structure is potentially
+subject to this problem.
+
+ For example, a program may use a function `strfunc' that returns
+`string' objects, and another function `charfunc' that operates on
+pointers to `char':
+
+ string strfunc ();
+ void charfunc (const char *);
+
+ void
+ f ()
+ {
+ const char *p = strfunc().c_str();
+ ...
+ charfunc (p);
+ ...
+ charfunc (p);
+ }
+
+In this situation, it may seem reasonable to save a pointer to the C
+string returned by the `c_str' member function and use that rather than
+call `c_str' repeatedly. However, the temporary string created by the
+call to `strfunc' is destroyed after `p' is initialized, at which point
+`p' is left pointing to freed memory.
+
+ Code like this may run successfully under some other compilers,
+particularly obsolete cfront-based compilers that delete temporaries
+along with normal local variables. However, the GNU C++ behavior is
+standard-conforming, so if your program depends on late destruction of
+temporaries it is not portable.
+
+ The safe way to write such code is to give the temporary a name, which
+forces it to remain until the end of the scope of the name. For
+example:
+
+ const string& tmp = strfunc ();
+ charfunc (tmp.c_str ());
+
+
+File: gcc.info, Node: Copy Assignment, Prev: Temporaries, Up: C++ Misunderstandings
+
+10.8.4 Implicit Copy-Assignment for Virtual Bases
+-------------------------------------------------
+
+When a base class is virtual, only one subobject of the base class
+belongs to each full object. Also, the constructors and destructors are
+invoked only once, and called from the most-derived class. However,
+such objects behave unspecified when being assigned. For example:
+
+ struct Base{
+ char *name;
+ Base(char *n) : name(strdup(n)){}
+ Base& operator= (const Base& other){
+ free (name);
+ name = strdup (other.name);
+ }
+ };
+
+ struct A:virtual Base{
+ int val;
+ A():Base("A"){}
+ };
+
+ struct B:virtual Base{
+ int bval;
+ B():Base("B"){}
+ };
+
+ struct Derived:public A, public B{
+ Derived():Base("Derived"){}
+ };
+
+ void func(Derived &d1, Derived &d2)
+ {
+ d1 = d2;
+ }
+
+ The C++ standard specifies that `Base::Base' is only called once when
+constructing or copy-constructing a Derived object. It is unspecified
+whether `Base::operator=' is called more than once when the implicit
+copy-assignment for Derived objects is invoked (as it is inside `func'
+in the example).
+
+ G++ implements the "intuitive" algorithm for copy-assignment: assign
+all direct bases, then assign all members. In that algorithm, the
+virtual base subobject can be encountered more than once. In the
+example, copying proceeds in the following order: `val', `name' (via
+`strdup'), `bval', and `name' again.
+
+ If application code relies on copy-assignment, a user-defined
+copy-assignment operator removes any uncertainties. With such an
+operator, the application can define whether and how the virtual base
+subobject is assigned.
+
+
+File: gcc.info, Node: Protoize Caveats, Next: Non-bugs, Prev: C++ Misunderstandings, Up: Trouble
+
+10.9 Caveats of using `protoize'
+================================
+
+The conversion programs `protoize' and `unprotoize' can sometimes
+change a source file in a way that won't work unless you rearrange it.
+
+ * `protoize' can insert references to a type name or type tag before
+ the definition, or in a file where they are not defined.
+
+ If this happens, compiler error messages should show you where the
+ new references are, so fixing the file by hand is straightforward.
+
+ * There are some C constructs which `protoize' cannot figure out.
+ For example, it can't determine argument types for declaring a
+ pointer-to-function variable; this you must do by hand. `protoize'
+ inserts a comment containing `???' each time it finds such a
+ variable; so you can find all such variables by searching for this
+ string. ISO C does not require declaring the argument types of
+ pointer-to-function types.
+
+ * Using `unprotoize' can easily introduce bugs. If the program
+ relied on prototypes to bring about conversion of arguments, these
+ conversions will not take place in the program without prototypes.
+ One case in which you can be sure `unprotoize' is safe is when you
+ are removing prototypes that were made with `protoize'; if the
+ program worked before without any prototypes, it will work again
+ without them.
+
+ You can find all the places where this problem might occur by
+ compiling the program with the `-Wtraditional-conversion' option.
+ It prints a warning whenever an argument is converted.
+
+ * Both conversion programs can be confused if there are macro calls
+ in and around the text to be converted. In other words, the
+ standard syntax for a declaration or definition must not result
+ from expanding a macro. This problem is inherent in the design of
+ C and cannot be fixed. If only a few functions have confusing
+ macro calls, you can easily convert them manually.
+
+ * `protoize' cannot get the argument types for a function whose
+ definition was not actually compiled due to preprocessing
+ conditionals. When this happens, `protoize' changes nothing in
+ regard to such a function. `protoize' tries to detect such
+ instances and warn about them.
+
+ You can generally work around this problem by using `protoize' step
+ by step, each time specifying a different set of `-D' options for
+ compilation, until all of the functions have been converted.
+ There is no automatic way to verify that you have got them all,
+ however.
+
+ * Confusion may result if there is an occasion to convert a function
+ declaration or definition in a region of source code where there
+ is more than one formal parameter list present. Thus, attempts to
+ convert code containing multiple (conditionally compiled) versions
+ of a single function header (in the same vicinity) may not produce
+ the desired (or expected) results.
+
+ If you plan on converting source files which contain such code, it
+ is recommended that you first make sure that each conditionally
+ compiled region of source code which contains an alternative
+ function header also contains at least one additional follower
+ token (past the final right parenthesis of the function header).
+ This should circumvent the problem.
+
+ * `unprotoize' can become confused when trying to convert a function
+ definition or declaration which contains a declaration for a
+ pointer-to-function formal argument which has the same name as the
+ function being defined or declared. We recommend you avoid such
+ choices of formal parameter names.
+
+ * You might also want to correct some of the indentation by hand and
+ break long lines. (The conversion programs don't write lines
+ longer than eighty characters in any case.)
+
+
+File: gcc.info, Node: Non-bugs, Next: Warnings and Errors, Prev: Protoize Caveats, Up: Trouble
+
+10.10 Certain Changes We Don't Want to Make
+===========================================
+
+This section lists changes that people frequently request, but which we
+do not make because we think GCC is better without them.
+
+ * Checking the number and type of arguments to a function which has
+ an old-fashioned definition and no prototype.
+
+ Such a feature would work only occasionally--only for calls that
+ appear in the same file as the called function, following the
+ definition. The only way to check all calls reliably is to add a
+ prototype for the function. But adding a prototype eliminates the
+ motivation for this feature. So the feature is not worthwhile.
+
+ * Warning about using an expression whose type is signed as a shift
+ count.
+
+ Shift count operands are probably signed more often than unsigned.
+ Warning about this would cause far more annoyance than good.
+
+ * Warning about assigning a signed value to an unsigned variable.
+
+ Such assignments must be very common; warning about them would
+ cause more annoyance than good.
+
+ * Warning when a non-void function value is ignored.
+
+ C contains many standard functions that return a value that most
+ programs choose to ignore. One obvious example is `printf'.
+ Warning about this practice only leads the defensive programmer to
+ clutter programs with dozens of casts to `void'. Such casts are
+ required so frequently that they become visual noise. Writing
+ those casts becomes so automatic that they no longer convey useful
+ information about the intentions of the programmer. For functions
+ where the return value should never be ignored, use the
+ `warn_unused_result' function attribute (*note Function
+ Attributes::).
+
+ * Making `-fshort-enums' the default.
+
+ This would cause storage layout to be incompatible with most other
+ C compilers. And it doesn't seem very important, given that you
+ can get the same result in other ways. The case where it matters
+ most is when the enumeration-valued object is inside a structure,
+ and in that case you can specify a field width explicitly.
+
+ * Making bit-fields unsigned by default on particular machines where
+ "the ABI standard" says to do so.
+
+ The ISO C standard leaves it up to the implementation whether a
+ bit-field declared plain `int' is signed or not. This in effect
+ creates two alternative dialects of C.
+
+ The GNU C compiler supports both dialects; you can specify the
+ signed dialect with `-fsigned-bitfields' and the unsigned dialect
+ with `-funsigned-bitfields'. However, this leaves open the
+ question of which dialect to use by default.
+
+ Currently, the preferred dialect makes plain bit-fields signed,
+ because this is simplest. Since `int' is the same as `signed int'
+ in every other context, it is cleanest for them to be the same in
+ bit-fields as well.
+
+ Some computer manufacturers have published Application Binary
+ Interface standards which specify that plain bit-fields should be
+ unsigned. It is a mistake, however, to say anything about this
+ issue in an ABI. This is because the handling of plain bit-fields
+ distinguishes two dialects of C. Both dialects are meaningful on
+ every type of machine. Whether a particular object file was
+ compiled using signed bit-fields or unsigned is of no concern to
+ other object files, even if they access the same bit-fields in the
+ same data structures.
+
+ A given program is written in one or the other of these two
+ dialects. The program stands a chance to work on most any machine
+ if it is compiled with the proper dialect. It is unlikely to work
+ at all if compiled with the wrong dialect.
+
+ Many users appreciate the GNU C compiler because it provides an
+ environment that is uniform across machines. These users would be
+ inconvenienced if the compiler treated plain bit-fields
+ differently on certain machines.
+
+ Occasionally users write programs intended only for a particular
+ machine type. On these occasions, the users would benefit if the
+ GNU C compiler were to support by default the same dialect as the
+ other compilers on that machine. But such applications are rare.
+ And users writing a program to run on more than one type of
+ machine cannot possibly benefit from this kind of compatibility.
+
+ This is why GCC does and will treat plain bit-fields in the same
+ fashion on all types of machines (by default).
+
+ There are some arguments for making bit-fields unsigned by default
+ on all machines. If, for example, this becomes a universal de
+ facto standard, it would make sense for GCC to go along with it.
+ This is something to be considered in the future.
+
+ (Of course, users strongly concerned about portability should
+ indicate explicitly in each bit-field whether it is signed or not.
+ In this way, they write programs which have the same meaning in
+ both C dialects.)
+
+ * Undefining `__STDC__' when `-ansi' is not used.
+
+ Currently, GCC defines `__STDC__' unconditionally. This provides
+ good results in practice.
+
+ Programmers normally use conditionals on `__STDC__' to ask whether
+ it is safe to use certain features of ISO C, such as function
+ prototypes or ISO token concatenation. Since plain `gcc' supports
+ all the features of ISO C, the correct answer to these questions is
+ "yes".
+
+ Some users try to use `__STDC__' to check for the availability of
+ certain library facilities. This is actually incorrect usage in
+ an ISO C program, because the ISO C standard says that a conforming
+ freestanding implementation should define `__STDC__' even though it
+ does not have the library facilities. `gcc -ansi -pedantic' is a
+ conforming freestanding implementation, and it is therefore
+ required to define `__STDC__', even though it does not come with
+ an ISO C library.
+
+ Sometimes people say that defining `__STDC__' in a compiler that
+ does not completely conform to the ISO C standard somehow violates
+ the standard. This is illogical. The standard is a standard for
+ compilers that claim to support ISO C, such as `gcc -ansi'--not
+ for other compilers such as plain `gcc'. Whatever the ISO C
+ standard says is relevant to the design of plain `gcc' without
+ `-ansi' only for pragmatic reasons, not as a requirement.
+
+ GCC normally defines `__STDC__' to be 1, and in addition defines
+ `__STRICT_ANSI__' if you specify the `-ansi' option, or a `-std'
+ option for strict conformance to some version of ISO C. On some
+ hosts, system include files use a different convention, where
+ `__STDC__' is normally 0, but is 1 if the user specifies strict
+ conformance to the C Standard. GCC follows the host convention
+ when processing system include files, but when processing user
+ files it follows the usual GNU C convention.
+
+ * Undefining `__STDC__' in C++.
+
+ Programs written to compile with C++-to-C translators get the
+ value of `__STDC__' that goes with the C compiler that is
+ subsequently used. These programs must test `__STDC__' to
+ determine what kind of C preprocessor that compiler uses: whether
+ they should concatenate tokens in the ISO C fashion or in the
+ traditional fashion.
+
+ These programs work properly with GNU C++ if `__STDC__' is defined.
+ They would not work otherwise.
+
+ In addition, many header files are written to provide prototypes
+ in ISO C but not in traditional C. Many of these header files can
+ work without change in C++ provided `__STDC__' is defined. If
+ `__STDC__' is not defined, they will all fail, and will all need
+ to be changed to test explicitly for C++ as well.
+
+ * Deleting "empty" loops.
+
+ Historically, GCC has not deleted "empty" loops under the
+ assumption that the most likely reason you would put one in a
+ program is to have a delay, so deleting them will not make real
+ programs run any faster.
+
+ However, the rationale here is that optimization of a nonempty loop
+ cannot produce an empty one. This held for carefully written C
+ compiled with less powerful optimizers but is not always the case
+ for carefully written C++ or with more powerful optimizers. Thus
+ GCC will remove operations from loops whenever it can determine
+ those operations are not externally visible (apart from the time
+ taken to execute them, of course). In case the loop can be proved
+ to be finite, GCC will also remove the loop itself.
+
+ Be aware of this when performing timing tests, for instance the
+ following loop can be completely removed, provided
+ `some_expression' can provably not change any global state.
+
+ {
+ int sum = 0;
+ int ix;
+
+ for (ix = 0; ix != 10000; ix++)
+ sum += some_expression;
+ }
+
+ Even though `sum' is accumulated in the loop, no use is made of
+ that summation, so the accumulation can be removed.
+
+ * Making side effects happen in the same order as in some other
+ compiler.
+
+ It is never safe to depend on the order of evaluation of side
+ effects. For example, a function call like this may very well
+ behave differently from one compiler to another:
+
+ void func (int, int);
+
+ int i = 2;
+ func (i++, i++);
+
+ There is no guarantee (in either the C or the C++ standard language
+ definitions) that the increments will be evaluated in any
+ particular order. Either increment might happen first. `func'
+ might get the arguments `2, 3', or it might get `3, 2', or even
+ `2, 2'.
+
+ * Making certain warnings into errors by default.
+
+ Some ISO C testsuites report failure when the compiler does not
+ produce an error message for a certain program.
+
+ ISO C requires a "diagnostic" message for certain kinds of invalid
+ programs, but a warning is defined by GCC to count as a
+ diagnostic. If GCC produces a warning but not an error, that is
+ correct ISO C support. If testsuites call this "failure", they
+ should be run with the GCC option `-pedantic-errors', which will
+ turn these warnings into errors.
+
+
+
+File: gcc.info, Node: Warnings and Errors, Prev: Non-bugs, Up: Trouble
+
+10.11 Warning Messages and Error Messages
+=========================================
+
+The GNU compiler can produce two kinds of diagnostics: errors and
+warnings. Each kind has a different purpose:
+
+ "Errors" report problems that make it impossible to compile your
+ program. GCC reports errors with the source file name and line
+ number where the problem is apparent.
+
+ "Warnings" report other unusual conditions in your code that _may_
+ indicate a problem, although compilation can (and does) proceed.
+ Warning messages also report the source file name and line number,
+ but include the text `warning:' to distinguish them from error
+ messages.
+
+ Warnings may indicate danger points where you should check to make sure
+that your program really does what you intend; or the use of obsolete
+features; or the use of nonstandard features of GNU C or C++. Many
+warnings are issued only if you ask for them, with one of the `-W'
+options (for instance, `-Wall' requests a variety of useful warnings).
+
+ GCC always tries to compile your program if possible; it never
+gratuitously rejects a program whose meaning is clear merely because
+(for instance) it fails to conform to a standard. In some cases,
+however, the C and C++ standards specify that certain extensions are
+forbidden, and a diagnostic _must_ be issued by a conforming compiler.
+The `-pedantic' option tells GCC to issue warnings in such cases;
+`-pedantic-errors' says to make them errors instead. This does not
+mean that _all_ non-ISO constructs get warnings or errors.
+
+ *Note Options to Request or Suppress Warnings: Warning Options, for
+more detail on these and related command-line options.
+
+
+File: gcc.info, Node: Bugs, Next: Service, Prev: Trouble, Up: Top
+
+11 Reporting Bugs
+*****************
+
+Your bug reports play an essential role in making GCC reliable.
+
+ When you encounter a problem, the first thing to do is to see if it is
+already known. *Note Trouble::. If it isn't known, then you should
+report the problem.
+
+* Menu:
+
+* Criteria: Bug Criteria. Have you really found a bug?
+* Reporting: Bug Reporting. How to report a bug effectively.
+* Known: Trouble. Known problems.
+* Help: Service. Where to ask for help.
+
+
+File: gcc.info, Node: Bug Criteria, Next: Bug Reporting, Up: Bugs
+
+11.1 Have You Found a Bug?
+==========================
+
+If you are not sure whether you have found a bug, here are some
+guidelines:
+
+ * If the compiler gets a fatal signal, for any input whatever, that
+ is a compiler bug. Reliable compilers never crash.
+
+ * If the compiler produces invalid assembly code, for any input
+ whatever (except an `asm' statement), that is a compiler bug,
+ unless the compiler reports errors (not just warnings) which would
+ ordinarily prevent the assembler from being run.
+
+ * If the compiler produces valid assembly code that does not
+ correctly execute the input source code, that is a compiler bug.
+
+ However, you must double-check to make sure, because you may have a
+ program whose behavior is undefined, which happened by chance to
+ give the desired results with another C or C++ compiler.
+
+ For example, in many nonoptimizing compilers, you can write `x;'
+ at the end of a function instead of `return x;', with the same
+ results. But the value of the function is undefined if `return'
+ is omitted; it is not a bug when GCC produces different results.
+
+ Problems often result from expressions with two increment
+ operators, as in `f (*p++, *p++)'. Your previous compiler might
+ have interpreted that expression the way you intended; GCC might
+ interpret it another way. Neither compiler is wrong. The bug is
+ in your code.
+
+ After you have localized the error to a single source line, it
+ should be easy to check for these things. If your program is
+ correct and well defined, you have found a compiler bug.
+
+ * If the compiler produces an error message for valid input, that is
+ a compiler bug.
+
+ * If the compiler does not produce an error message for invalid
+ input, that is a compiler bug. However, you should note that your
+ idea of "invalid input" might be someone else's idea of "an
+ extension" or "support for traditional practice".
+
+ * If you are an experienced user of one of the languages GCC
+ supports, your suggestions for improvement of GCC are welcome in
+ any case.
+
+
+File: gcc.info, Node: Bug Reporting, Prev: Bug Criteria, Up: Bugs
+
+11.2 How and where to Report Bugs
+=================================
+
+Bugs should be reported to the bug database at
+`http://bugs.buildroot.net/'.
+
+
+File: gcc.info, Node: Service, Next: Contributing, Prev: Bugs, Up: Top
+
+12 How To Get Help with GCC
+***************************
+
+If you need help installing, using or changing GCC, there are two ways
+to find it:
+
+ * Send a message to a suitable network mailing list. First try
+ <gcc-help@gcc.gnu.org> (for help installing or using GCC), and if
+ that brings no response, try <gcc@gcc.gnu.org>. For help changing
+ GCC, ask <gcc@gcc.gnu.org>. If you think you have found a bug in
+ GCC, please report it following the instructions at *note Bug
+ Reporting::.
+
+ * Look in the service directory for someone who might help you for a
+ fee. The service directory is found at
+ `http://www.fsf.org/resources/service'.
+
+ For further information, see `http://gcc.gnu.org/faq.html#support'.
+
+
+File: gcc.info, Node: Contributing, Next: Funding, Prev: Service, Up: Top
+
+13 Contributing to GCC Development
+**********************************
+
+If you would like to help pretest GCC releases to assure they work well,
+current development sources are available by SVN (see
+`http://gcc.gnu.org/svn.html'). Source and binary snapshots are also
+available for FTP; see `http://gcc.gnu.org/snapshots.html'.
+
+ If you would like to work on improvements to GCC, please read the
+advice at these URLs:
+
+ `http://gcc.gnu.org/contribute.html'
+ `http://gcc.gnu.org/contributewhy.html'
+
+for information on how to make useful contributions and avoid
+duplication of effort. Suggested projects are listed at
+`http://gcc.gnu.org/projects/'.
+
+
+File: gcc.info, Node: Funding, Next: GNU Project, Prev: Contributing, Up: Top
+
+Funding Free Software
+*********************
+
+If you want to have more free software a few years from now, it makes
+sense for you to help encourage people to contribute funds for its
+development. The most effective approach known is to encourage
+commercial redistributors to donate.
+
+ Users of free software systems can boost the pace of development by
+encouraging for-a-fee distributors to donate part of their selling price
+to free software developers--the Free Software Foundation, and others.
+
+ The way to convince distributors to do this is to demand it and expect
+it from them. So when you compare distributors, judge them partly by
+how much they give to free software development. Show distributors
+they must compete to be the one who gives the most.
+
+ To make this approach work, you must insist on numbers that you can
+compare, such as, "We will donate ten dollars to the Frobnitz project
+for each disk sold." Don't be satisfied with a vague promise, such as
+"A portion of the profits are donated," since it doesn't give a basis
+for comparison.
+
+ Even a precise fraction "of the profits from this disk" is not very
+meaningful, since creative accounting and unrelated business decisions
+can greatly alter what fraction of the sales price counts as profit.
+If the price you pay is $50, ten percent of the profit is probably less
+than a dollar; it might be a few cents, or nothing at all.
+
+ Some redistributors do development work themselves. This is useful
+too; but to keep everyone honest, you need to inquire how much they do,
+and what kind. Some kinds of development make much more long-term
+difference than others. For example, maintaining a separate version of
+a program contributes very little; maintaining the standard version of a
+program for the whole community contributes much. Easy new ports
+contribute little, since someone else would surely do them; difficult
+ports such as adding a new CPU to the GNU Compiler Collection
+contribute more; major new features or packages contribute the most.
+
+ By establishing the idea that supporting further development is "the
+proper thing to do" when distributing free software for a fee, we can
+assure a steady flow of resources into making more free software.
+
+ Copyright (C) 1994 Free Software Foundation, Inc.
+ Verbatim copying and redistribution of this section is permitted
+ without royalty; alteration is not permitted.
+
+
+File: gcc.info, Node: GNU Project, Next: Copying, Prev: Funding, Up: Top
+
+The GNU Project and GNU/Linux
+*****************************
+
+The GNU Project was launched in 1984 to develop a complete Unix-like
+operating system which is free software: the GNU system. (GNU is a
+recursive acronym for "GNU's Not Unix"; it is pronounced "guh-NEW".)
+Variants of the GNU operating system, which use the kernel Linux, are
+now widely used; though these systems are often referred to as "Linux",
+they are more accurately called GNU/Linux systems.
+
+ For more information, see:
+ `http://www.gnu.org/'
+ `http://www.gnu.org/gnu/linux-and-gnu.html'
+
+
+File: gcc.info, Node: Copying, Next: GNU Free Documentation License, Prev: GNU Project, Up: Top
+
+GNU General Public License
+**************************
+
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. `http://fsf.org/'
+
+ Everyone is permitted to copy and distribute verbatim copies of this
+ license document, but changing it is not allowed.
+
+Preamble
+========
+
+The GNU General Public License is a free, copyleft license for software
+and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program-to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you
+have certain responsibilities if you distribute copies of the software,
+or if you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the
+manufacturer can do so. This is fundamentally incompatible with the
+aim of protecting users' freedom to change the software. The
+systematic pattern of such abuse occurs in the area of products for
+individuals to use, which is precisely where it is most unacceptable.
+Therefore, we have designed this version of the GPL to prohibit the
+practice for those products. If such problems arise substantially in
+other domains, we stand ready to extend this provision to those domains
+in future versions of the GPL, as needed to protect the freedom of
+users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+TERMS AND CONDITIONS
+====================
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public
+ License.
+
+ "Copyright" also means copyright-like laws that apply to other
+ kinds of works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+ License. Each licensee is addressed as "you". "Licensees" and
+ "recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the
+ work in a fashion requiring copyright permission, other than the
+ making of an exact copy. The resulting work is called a "modified
+ version" of the earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work
+ based on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+ permission, would make you directly or secondarily liable for
+ infringement under applicable copyright law, except executing it
+ on a computer or modifying a private copy. Propagation includes
+ copying, distribution (with or without modification), making
+ available to the public, and in some countries other activities as
+ well.
+
+ To "convey" a work means any kind of propagation that enables other
+ parties to make or receive copies. Mere interaction with a user
+ through a computer network, with no transfer of a copy, is not
+ conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+ to the extent that it includes a convenient and prominently visible
+ feature that (1) displays an appropriate copyright notice, and (2)
+ tells the user that there is no warranty for the work (except to
+ the extent that warranties are provided), that licensees may
+ convey the work under this License, and how to view a copy of this
+ License. If the interface presents a list of user commands or
+ options, such as a menu, a prominent item in the list meets this
+ criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+ for making modifications to it. "Object code" means any
+ non-source form of a work.
+
+ A "Standard Interface" means an interface that either is an
+ official standard defined by a recognized standards body, or, in
+ the case of interfaces specified for a particular programming
+ language, one that is widely used among developers working in that
+ language.
+
+ The "System Libraries" of an executable work include anything,
+ other than the work as a whole, that (a) is included in the normal
+ form of packaging a Major Component, but which is not part of that
+ Major Component, and (b) serves only to enable use of the work
+ with that Major Component, or to implement a Standard Interface
+ for which an implementation is available to the public in source
+ code form. A "Major Component", in this context, means a major
+ essential component (kernel, window system, and so on) of the
+ specific operating system (if any) on which the executable work
+ runs, or a compiler used to produce the work, or an object code
+ interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+ the source code needed to generate, install, and (for an executable
+ work) run the object code and to modify the work, including
+ scripts to control those activities. However, it does not include
+ the work's System Libraries, or general-purpose tools or generally
+ available free programs which are used unmodified in performing
+ those activities but which are not part of the work. For example,
+ Corresponding Source includes interface definition files
+ associated with source files for the work, and the source code for
+ shared libraries and dynamically linked subprograms that the work
+ is specifically designed to require, such as by intimate data
+ communication or control flow between those subprograms and other
+ parts of the work.
+
+ The Corresponding Source need not include anything that users can
+ regenerate automatically from other parts of the Corresponding
+ Source.
+
+ The Corresponding Source for a work in source code form is that
+ same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+ copyright on the Program, and are irrevocable provided the stated
+ conditions are met. This License explicitly affirms your unlimited
+ permission to run the unmodified Program. The output from running
+ a covered work is covered by this License only if the output,
+ given its content, constitutes a covered work. This License
+ acknowledges your rights of fair use or other equivalent, as
+ provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+ convey, without conditions so long as your license otherwise
+ remains in force. You may convey covered works to others for the
+ sole purpose of having them make modifications exclusively for
+ you, or provide you with facilities for running those works,
+ provided that you comply with the terms of this License in
+ conveying all material for which you do not control copyright.
+ Those thus making or running the covered works for you must do so
+ exclusively on your behalf, under your direction and control, on
+ terms that prohibit them from making any copies of your
+ copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+ the conditions stated below. Sublicensing is not allowed; section
+ 10 makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+ measure under any applicable law fulfilling obligations under
+ article 11 of the WIPO copyright treaty adopted on 20 December
+ 1996, or similar laws prohibiting or restricting circumvention of
+ such measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+ circumvention of technological measures to the extent such
+ circumvention is effected by exercising rights under this License
+ with respect to the covered work, and you disclaim any intention
+ to limit operation or modification of the work as a means of
+ enforcing, against the work's users, your or third parties' legal
+ rights to forbid circumvention of technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+ receive it, in any medium, provided that you conspicuously and
+ appropriately publish on each copy an appropriate copyright notice;
+ keep intact all notices stating that this License and any
+ non-permissive terms added in accord with section 7 apply to the
+ code; keep intact all notices of the absence of any warranty; and
+ give all recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+ and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+ produce it from the Program, in the form of source code under the
+ terms of section 4, provided that you also meet all of these
+ conditions:
+
+ a. The work must carry prominent notices stating that you
+ modified it, and giving a relevant date.
+
+ b. The work must carry prominent notices stating that it is
+ released under this License and any conditions added under
+ section 7. This requirement modifies the requirement in
+ section 4 to "keep intact all notices".
+
+ c. You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable
+ section 7 additional terms, to the whole of the work, and all
+ its parts, regardless of how they are packaged. This License
+ gives no permission to license the work in any other way, but
+ it does not invalidate such permission if you have separately
+ received it.
+
+ d. If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has
+ interactive interfaces that do not display Appropriate Legal
+ Notices, your work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+ works, which are not by their nature extensions of the covered
+ work, and which are not combined with it such as to form a larger
+ program, in or on a volume of a storage or distribution medium, is
+ called an "aggregate" if the compilation and its resulting
+ copyright are not used to limit the access or legal rights of the
+ compilation's users beyond what the individual works permit.
+ Inclusion of a covered work in an aggregate does not cause this
+ License to apply to the other parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+ of sections 4 and 5, provided that you also convey the
+ machine-readable Corresponding Source under the terms of this
+ License, in one of these ways:
+
+ a. Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b. Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for
+ as long as you offer spare parts or customer support for that
+ product model, to give anyone who possesses the object code
+ either (1) a copy of the Corresponding Source for all the
+ software in the product that is covered by this License, on a
+ durable physical medium customarily used for software
+ interchange, for a price no more than your reasonable cost of
+ physically performing this conveying of source, or (2) access
+ to copy the Corresponding Source from a network server at no
+ charge.
+
+ c. Convey individual copies of the object code with a copy of
+ the written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially,
+ and only if you received the object code with such an offer,
+ in accord with subsection 6b.
+
+ d. Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access
+ to the Corresponding Source in the same way through the same
+ place at no further charge. You need not require recipients
+ to copy the Corresponding Source along with the object code.
+ If the place to copy the object code is a network server, the
+ Corresponding Source may be on a different server (operated
+ by you or a third party) that supports equivalent copying
+ facilities, provided you maintain clear directions next to
+ the object code saying where to find the Corresponding Source.
+ Regardless of what server hosts the Corresponding Source, you
+ remain obligated to ensure that it is available for as long
+ as needed to satisfy these requirements.
+
+ e. Convey the object code using peer-to-peer transmission,
+ provided you inform other peers where the object code and
+ Corresponding Source of the work are being offered to the
+ general public at no charge under subsection 6d.
+
+
+ A separable portion of the object code, whose source code is
+ excluded from the Corresponding Source as a System Library, need
+ not be included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means
+ any tangible personal property which is normally used for personal,
+ family, or household purposes, or (2) anything designed or sold for
+ incorporation into a dwelling. In determining whether a product
+ is a consumer product, doubtful cases shall be resolved in favor of
+ coverage. For a particular product received by a particular user,
+ "normally used" refers to a typical or common use of that class of
+ product, regardless of the status of the particular user or of the
+ way in which the particular user actually uses, or expects or is
+ expected to use, the product. A product is a consumer product
+ regardless of whether the product has substantial commercial,
+ industrial or non-consumer uses, unless such uses represent the
+ only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+ procedures, authorization keys, or other information required to
+ install and execute modified versions of a covered work in that
+ User Product from a modified version of its Corresponding Source.
+ The information must suffice to ensure that the continued
+ functioning of the modified object code is in no case prevented or
+ interfered with solely because modification has been made.
+
+ If you convey an object code work under this section in, or with,
+ or specifically for use in, a User Product, and the conveying
+ occurs as part of a transaction in which the right of possession
+ and use of the User Product is transferred to the recipient in
+ perpetuity or for a fixed term (regardless of how the transaction
+ is characterized), the Corresponding Source conveyed under this
+ section must be accompanied by the Installation Information. But
+ this requirement does not apply if neither you nor any third party
+ retains the ability to install modified object code on the User
+ Product (for example, the work has been installed in ROM).
+
+ The requirement to provide Installation Information does not
+ include a requirement to continue to provide support service,
+ warranty, or updates for a work that has been modified or
+ installed by the recipient, or for the User Product in which it
+ has been modified or installed. Access to a network may be denied
+ when the modification itself materially and adversely affects the
+ operation of the network or violates the rules and protocols for
+ communication across the network.
+
+ Corresponding Source conveyed, and Installation Information
+ provided, in accord with this section must be in a format that is
+ publicly documented (and with an implementation available to the
+ public in source code form), and must require no special password
+ or key for unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of
+ this License by making exceptions from one or more of its
+ conditions. Additional permissions that are applicable to the
+ entire Program shall be treated as though they were included in
+ this License, to the extent that they are valid under applicable
+ law. If additional permissions apply only to part of the Program,
+ that part may be used separately under those permissions, but the
+ entire Program remains governed by this License without regard to
+ the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+ remove any additional permissions from that copy, or from any part
+ of it. (Additional permissions may be written to require their own
+ removal in certain cases when you modify the work.) You may place
+ additional permissions on material, added by you to a covered work,
+ for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material
+ you add to a covered work, you may (if authorized by the copyright
+ holders of that material) supplement the terms of this License
+ with terms:
+
+ a. Disclaiming warranty or limiting liability differently from
+ the terms of sections 15 and 16 of this License; or
+
+ b. Requiring preservation of specified reasonable legal notices
+ or author attributions in that material or in the Appropriate
+ Legal Notices displayed by works containing it; or
+
+ c. Prohibiting misrepresentation of the origin of that material,
+ or requiring that modified versions of such material be
+ marked in reasonable ways as different from the original
+ version; or
+
+ d. Limiting the use for publicity purposes of names of licensors
+ or authors of the material; or
+
+ e. Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f. Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified
+ versions of it) with contractual assumptions of liability to
+ the recipient, for any liability that these contractual
+ assumptions directly impose on those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+ restrictions" within the meaning of section 10. If the Program as
+ you received it, or any part of it, contains a notice stating that
+ it is governed by this License along with a term that is a further
+ restriction, you may remove that term. If a license document
+ contains a further restriction but permits relicensing or
+ conveying under this License, you may add to a covered work
+ material governed by the terms of that license document, provided
+ that the further restriction does not survive such relicensing or
+ conveying.
+
+ If you add terms to a covered work in accord with this section, you
+ must place, in the relevant source files, a statement of the
+ additional terms that apply to those files, or a notice indicating
+ where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in
+ the form of a separately written license, or stated as exceptions;
+ the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+ provided under this License. Any attempt otherwise to propagate or
+ modify it is void, and will automatically terminate your rights
+ under this License (including any patent licenses granted under
+ the third paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+ license from a particular copyright holder is reinstated (a)
+ provisionally, unless and until the copyright holder explicitly
+ and finally terminates your license, and (b) permanently, if the
+ copyright holder fails to notify you of the violation by some
+ reasonable means prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+ reinstated permanently if the copyright holder notifies you of the
+ violation by some reasonable means, this is the first time you have
+ received notice of violation of this License (for any work) from
+ that copyright holder, and you cure the violation prior to 30 days
+ after your receipt of the notice.
+
+ Termination of your rights under this section does not terminate
+ the licenses of parties who have received copies or rights from
+ you under this License. If your rights have been terminated and
+ not permanently reinstated, you do not qualify to receive new
+ licenses for the same material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+ run a copy of the Program. Ancillary propagation of a covered work
+ occurring solely as a consequence of using peer-to-peer
+ transmission to receive a copy likewise does not require
+ acceptance. However, nothing other than this License grants you
+ permission to propagate or modify any covered work. These actions
+ infringe copyright if you do not accept this License. Therefore,
+ by modifying or propagating a covered work, you indicate your
+ acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+ receives a license from the original licensors, to run, modify and
+ propagate that work, subject to this License. You are not
+ responsible for enforcing compliance by third parties with this
+ License.
+
+ An "entity transaction" is a transaction transferring control of an
+ organization, or substantially all assets of one, or subdividing an
+ organization, or merging organizations. If propagation of a
+ covered work results from an entity transaction, each party to that
+ transaction who receives a copy of the work also receives whatever
+ licenses to the work the party's predecessor in interest had or
+ could give under the previous paragraph, plus a right to
+ possession of the Corresponding Source of the work from the
+ predecessor in interest, if the predecessor has it or can get it
+ with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+ rights granted or affirmed under this License. For example, you
+ may not impose a license fee, royalty, or other charge for
+ exercise of rights granted under this License, and you may not
+ initiate litigation (including a cross-claim or counterclaim in a
+ lawsuit) alleging that any patent claim is infringed by making,
+ using, selling, offering for sale, or importing the Program or any
+ portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+ License of the Program or a work on which the Program is based.
+ The work thus licensed is called the contributor's "contributor
+ version".
+
+ A contributor's "essential patent claims" are all patent claims
+ owned or controlled by the contributor, whether already acquired or
+ hereafter acquired, that would be infringed by some manner,
+ permitted by this License, of making, using, or selling its
+ contributor version, but do not include claims that would be
+ infringed only as a consequence of further modification of the
+ contributor version. For purposes of this definition, "control"
+ includes the right to grant patent sublicenses in a manner
+ consistent with the requirements of this License.
+
+ Each contributor grants you a non-exclusive, worldwide,
+ royalty-free patent license under the contributor's essential
+ patent claims, to make, use, sell, offer for sale, import and
+ otherwise run, modify and propagate the contents of its
+ contributor version.
+
+ In the following three paragraphs, a "patent license" is any
+ express agreement or commitment, however denominated, not to
+ enforce a patent (such as an express permission to practice a
+ patent or covenant not to sue for patent infringement). To
+ "grant" such a patent license to a party means to make such an
+ agreement or commitment not to enforce a patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent
+ license, and the Corresponding Source of the work is not available
+ for anyone to copy, free of charge and under the terms of this
+ License, through a publicly available network server or other
+ readily accessible means, then you must either (1) cause the
+ Corresponding Source to be so available, or (2) arrange to deprive
+ yourself of the benefit of the patent license for this particular
+ work, or (3) arrange, in a manner consistent with the requirements
+ of this License, to extend the patent license to downstream
+ recipients. "Knowingly relying" means you have actual knowledge
+ that, but for the patent license, your conveying the covered work
+ in a country, or your recipient's use of the covered work in a
+ country, would infringe one or more identifiable patents in that
+ country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+ arrangement, you convey, or propagate by procuring conveyance of, a
+ covered work, and grant a patent license to some of the parties
+ receiving the covered work authorizing them to use, propagate,
+ modify or convey a specific copy of the covered work, then the
+ patent license you grant is automatically extended to all
+ recipients of the covered work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+ the scope of its coverage, prohibits the exercise of, or is
+ conditioned on the non-exercise of one or more of the rights that
+ are specifically granted under this License. You may not convey a
+ covered work if you are a party to an arrangement with a third
+ party that is in the business of distributing software, under
+ which you make payment to the third party based on the extent of
+ your activity of conveying the work, and under which the third
+ party grants, to any of the parties who would receive the covered
+ work from you, a discriminatory patent license (a) in connection
+ with copies of the covered work conveyed by you (or copies made
+ from those copies), or (b) primarily for and in connection with
+ specific products or compilations that contain the covered work,
+ unless you entered into that arrangement, or that patent license
+ was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+ any implied license or other defenses to infringement that may
+ otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order,
+ agreement or otherwise) that contradict the conditions of this
+ License, they do not excuse you from the conditions of this
+ License. If you cannot convey a covered work so as to satisfy
+ simultaneously your obligations under this License and any other
+ pertinent obligations, then as a consequence you may not convey it
+ at all. For example, if you agree to terms that obligate you to
+ collect a royalty for further conveying from those to whom you
+ convey the Program, the only way you could satisfy both those
+ terms and this License would be to refrain entirely from conveying
+ the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+ permission to link or combine any covered work with a work licensed
+ under version 3 of the GNU Affero General Public License into a
+ single combined work, and to convey the resulting work. The terms
+ of this License will continue to apply to the part which is the
+ covered work, but the special requirements of the GNU Affero
+ General Public License, section 13, concerning interaction through
+ a network will apply to the combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new
+ versions of the GNU General Public License from time to time.
+ Such new versions will be similar in spirit to the present
+ version, but may differ in detail to address new problems or
+ concerns.
+
+ Each version is given a distinguishing version number. If the
+ Program specifies that a certain numbered version of the GNU
+ General Public License "or any later version" applies to it, you
+ have the option of following the terms and conditions either of
+ that numbered version or of any later version published by the
+ Free Software Foundation. If the Program does not specify a
+ version number of the GNU General Public License, you may choose
+ any version ever published by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+ versions of the GNU General Public License can be used, that
+ proxy's public statement of acceptance of a version permanently
+ authorizes you to choose that version for the Program.
+
+ Later license versions may give you additional or different
+ permissions. However, no additional obligations are imposed on any
+ author or copyright holder as a result of your choosing to follow a
+ later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE
+ COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS"
+ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE
+ RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.
+ SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
+ NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+ WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES
+ AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU
+ FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+ CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
+ THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
+ BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
+ THE POSSIBILITY OF SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+ above cannot be given local legal effect according to their terms,
+ reviewing courts shall apply local law that most closely
+ approximates an absolute waiver of all civil liability in
+ connection with the Program, unless a warranty or assumption of
+ liability accompanies a copy of the Program in return for a fee.
+
+
+END OF TERMS AND CONDITIONS
+===========================
+
+How to Apply These Terms to Your New Programs
+=============================================
+
+If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these
+terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
+ Copyright (C) YEAR NAME OF AUTHOR
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or (at
+ your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see `http://www.gnu.org/licenses/'.
+
+ Also add information on how to contact you by electronic and paper
+mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ PROGRAM Copyright (C) YEAR NAME OF AUTHOR
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+ The hypothetical commands `show w' and `show c' should show the
+appropriate parts of the General Public License. Of course, your
+program's commands might be different; for a GUI interface, you would
+use an "about box".
+
+ You should also get your employer (if you work as a programmer) or
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. For more information on this, and how to apply and follow
+the GNU GPL, see `http://www.gnu.org/licenses/'.
+
+ The GNU General Public License does not permit incorporating your
+program into proprietary programs. If your program is a subroutine
+library, you may consider it more useful to permit linking proprietary
+applications with the library. If this is what you want to do, use the
+GNU Lesser General Public License instead of this License. But first,
+please read `http://www.gnu.org/philosophy/why-not-lgpl.html'.
+
+
+File: gcc.info, Node: GNU Free Documentation License, Next: Contributors, Prev: Copying, Up: Top
+
+GNU Free Documentation License
+******************************
+
+ Version 1.2, November 2002
+
+ Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ 0. PREAMBLE
+
+ The purpose of this License is to make a manual, textbook, or other
+ functional and useful document "free" in the sense of freedom: to
+ assure everyone the effective freedom to copy and redistribute it,
+ with or without modifying it, either commercially or
+ noncommercially. Secondarily, this License preserves for the
+ author and publisher a way to get credit for their work, while not
+ being considered responsible for modifications made by others.
+
+ This License is a kind of "copyleft", which means that derivative
+ works of the document must themselves be free in the same sense.
+ It complements the GNU General Public License, which is a copyleft
+ license designed for free software.
+
+ We have designed this License in order to use it for manuals for
+ free software, because free software needs free documentation: a
+ free program should come with manuals providing the same freedoms
+ that the software does. But this License is not limited to
+ software manuals; it can be used for any textual work, regardless
+ of subject matter or whether it is published as a printed book.
+ We recommend this License principally for works whose purpose is
+ instruction or reference.
+
+ 1. APPLICABILITY AND DEFINITIONS
+
+ This License applies to any manual or other work, in any medium,
+ that contains a notice placed by the copyright holder saying it
+ can be distributed under the terms of this License. Such a notice
+ grants a world-wide, royalty-free license, unlimited in duration,
+ to use that work under the conditions stated herein. The
+ "Document", below, refers to any such manual or work. Any member
+ of the public is a licensee, and is addressed as "you". You
+ accept the license if you copy, modify or distribute the work in a
+ way requiring permission under copyright law.
+
+ A "Modified Version" of the Document means any work containing the
+ Document or a portion of it, either copied verbatim, or with
+ modifications and/or translated into another language.
+
+ A "Secondary Section" is a named appendix or a front-matter section
+ of the Document that deals exclusively with the relationship of the
+ publishers or authors of the Document to the Document's overall
+ subject (or to related matters) and contains nothing that could
+ fall directly within that overall subject. (Thus, if the Document
+ is in part a textbook of mathematics, a Secondary Section may not
+ explain any mathematics.) The relationship could be a matter of
+ historical connection with the subject or with related matters, or
+ of legal, commercial, philosophical, ethical or political position
+ regarding them.
+
+ The "Invariant Sections" are certain Secondary Sections whose
+ titles are designated, as being those of Invariant Sections, in
+ the notice that says that the Document is released under this
+ License. If a section does not fit the above definition of
+ Secondary then it is not allowed to be designated as Invariant.
+ The Document may contain zero Invariant Sections. If the Document
+ does not identify any Invariant Sections then there are none.
+
+ The "Cover Texts" are certain short passages of text that are
+ listed, as Front-Cover Texts or Back-Cover Texts, in the notice
+ that says that the Document is released under this License. A
+ Front-Cover Text may be at most 5 words, and a Back-Cover Text may
+ be at most 25 words.
+
+ A "Transparent" copy of the Document means a machine-readable copy,
+ represented in a format whose specification is available to the
+ general public, that is suitable for revising the document
+ straightforwardly with generic text editors or (for images
+ composed of pixels) generic paint programs or (for drawings) some
+ widely available drawing editor, and that is suitable for input to
+ text formatters or for automatic translation to a variety of
+ formats suitable for input to text formatters. A copy made in an
+ otherwise Transparent file format whose markup, or absence of
+ markup, has been arranged to thwart or discourage subsequent
+ modification by readers is not Transparent. An image format is
+ not Transparent if used for any substantial amount of text. A
+ copy that is not "Transparent" is called "Opaque".
+
+ Examples of suitable formats for Transparent copies include plain
+ ASCII without markup, Texinfo input format, LaTeX input format,
+ SGML or XML using a publicly available DTD, and
+ standard-conforming simple HTML, PostScript or PDF designed for
+ human modification. Examples of transparent image formats include
+ PNG, XCF and JPG. Opaque formats include proprietary formats that
+ can be read and edited only by proprietary word processors, SGML or
+ XML for which the DTD and/or processing tools are not generally
+ available, and the machine-generated HTML, PostScript or PDF
+ produced by some word processors for output purposes only.
+
+ The "Title Page" means, for a printed book, the title page itself,
+ plus such following pages as are needed to hold, legibly, the
+ material this License requires to appear in the title page. For
+ works in formats which do not have any title page as such, "Title
+ Page" means the text near the most prominent appearance of the
+ work's title, preceding the beginning of the body of the text.
+
+ A section "Entitled XYZ" means a named subunit of the Document
+ whose title either is precisely XYZ or contains XYZ in parentheses
+ following text that translates XYZ in another language. (Here XYZ
+ stands for a specific section name mentioned below, such as
+ "Acknowledgements", "Dedications", "Endorsements", or "History".)
+ To "Preserve the Title" of such a section when you modify the
+ Document means that it remains a section "Entitled XYZ" according
+ to this definition.
+
+ The Document may include Warranty Disclaimers next to the notice
+ which states that this License applies to the Document. These
+ Warranty Disclaimers are considered to be included by reference in
+ this License, but only as regards disclaiming warranties: any other
+ implication that these Warranty Disclaimers may have is void and
+ has no effect on the meaning of this License.
+
+ 2. VERBATIM COPYING
+
+ You may copy and distribute the Document in any medium, either
+ commercially or noncommercially, provided that this License, the
+ copyright notices, and the license notice saying this License
+ applies to the Document are reproduced in all copies, and that you
+ add no other conditions whatsoever to those of this License. You
+ may not use technical measures to obstruct or control the reading
+ or further copying of the copies you make or distribute. However,
+ you may accept compensation in exchange for copies. If you
+ distribute a large enough number of copies you must also follow
+ the conditions in section 3.
+
+ You may also lend copies, under the same conditions stated above,
+ and you may publicly display copies.
+
+ 3. COPYING IN QUANTITY
+
+ If you publish printed copies (or copies in media that commonly
+ have printed covers) of the Document, numbering more than 100, and
+ the Document's license notice requires Cover Texts, you must
+ enclose the copies in covers that carry, clearly and legibly, all
+ these Cover Texts: Front-Cover Texts on the front cover, and
+ Back-Cover Texts on the back cover. Both covers must also clearly
+ and legibly identify you as the publisher of these copies. The
+ front cover must present the full title with all words of the
+ title equally prominent and visible. You may add other material
+ on the covers in addition. Copying with changes limited to the
+ covers, as long as they preserve the title of the Document and
+ satisfy these conditions, can be treated as verbatim copying in
+ other respects.
+
+ If the required texts for either cover are too voluminous to fit
+ legibly, you should put the first ones listed (as many as fit
+ reasonably) on the actual cover, and continue the rest onto
+ adjacent pages.
+
+ If you publish or distribute Opaque copies of the Document
+ numbering more than 100, you must either include a
+ machine-readable Transparent copy along with each Opaque copy, or
+ state in or with each Opaque copy a computer-network location from
+ which the general network-using public has access to download
+ using public-standard network protocols a complete Transparent
+ copy of the Document, free of added material. If you use the
+ latter option, you must take reasonably prudent steps, when you
+ begin distribution of Opaque copies in quantity, to ensure that
+ this Transparent copy will remain thus accessible at the stated
+ location until at least one year after the last time you
+ distribute an Opaque copy (directly or through your agents or
+ retailers) of that edition to the public.
+
+ It is requested, but not required, that you contact the authors of
+ the Document well before redistributing any large number of
+ copies, to give them a chance to provide you with an updated
+ version of the Document.
+
+ 4. MODIFICATIONS
+
+ You may copy and distribute a Modified Version of the Document
+ under the conditions of sections 2 and 3 above, provided that you
+ release the Modified Version under precisely this License, with
+ the Modified Version filling the role of the Document, thus
+ licensing distribution and modification of the Modified Version to
+ whoever possesses a copy of it. In addition, you must do these
+ things in the Modified Version:
+
+ A. Use in the Title Page (and on the covers, if any) a title
+ distinct from that of the Document, and from those of
+ previous versions (which should, if there were any, be listed
+ in the History section of the Document). You may use the
+ same title as a previous version if the original publisher of
+ that version gives permission.
+
+ B. List on the Title Page, as authors, one or more persons or
+ entities responsible for authorship of the modifications in
+ the Modified Version, together with at least five of the
+ principal authors of the Document (all of its principal
+ authors, if it has fewer than five), unless they release you
+ from this requirement.
+
+ C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+
+ D. Preserve all the copyright notices of the Document.
+
+ E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+
+ F. Include, immediately after the copyright notices, a license
+ notice giving the public permission to use the Modified
+ Version under the terms of this License, in the form shown in
+ the Addendum below.
+
+ G. Preserve in that license notice the full lists of Invariant
+ Sections and required Cover Texts given in the Document's
+ license notice.
+
+ H. Include an unaltered copy of this License.
+
+ I. Preserve the section Entitled "History", Preserve its Title,
+ and add to it an item stating at least the title, year, new
+ authors, and publisher of the Modified Version as given on
+ the Title Page. If there is no section Entitled "History" in
+ the Document, create one stating the title, year, authors,
+ and publisher of the Document as given on its Title Page,
+ then add an item describing the Modified Version as stated in
+ the previous sentence.
+
+ J. Preserve the network location, if any, given in the Document
+ for public access to a Transparent copy of the Document, and
+ likewise the network locations given in the Document for
+ previous versions it was based on. These may be placed in
+ the "History" section. You may omit a network location for a
+ work that was published at least four years before the
+ Document itself, or if the original publisher of the version
+ it refers to gives permission.
+
+ K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the
+ section all the substance and tone of each of the contributor
+ acknowledgements and/or dedications given therein.
+
+ L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section
+ titles.
+
+ M. Delete any section Entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+
+ N. Do not retitle any existing section to be Entitled
+ "Endorsements" or to conflict in title with any Invariant
+ Section.
+
+ O. Preserve any Warranty Disclaimers.
+
+ If the Modified Version includes new front-matter sections or
+ appendices that qualify as Secondary Sections and contain no
+ material copied from the Document, you may at your option
+ designate some or all of these sections as invariant. To do this,
+ add their titles to the list of Invariant Sections in the Modified
+ Version's license notice. These titles must be distinct from any
+ other section titles.
+
+ You may add a section Entitled "Endorsements", provided it contains
+ nothing but endorsements of your Modified Version by various
+ parties--for example, statements of peer review or that the text
+ has been approved by an organization as the authoritative
+ definition of a standard.
+
+ You may add a passage of up to five words as a Front-Cover Text,
+ and a passage of up to 25 words as a Back-Cover Text, to the end
+ of the list of Cover Texts in the Modified Version. Only one
+ passage of Front-Cover Text and one of Back-Cover Text may be
+ added by (or through arrangements made by) any one entity. If the
+ Document already includes a cover text for the same cover,
+ previously added by you or by arrangement made by the same entity
+ you are acting on behalf of, you may not add another; but you may
+ replace the old one, on explicit permission from the previous
+ publisher that added the old one.
+
+ The author(s) and publisher(s) of the Document do not by this
+ License give permission to use their names for publicity for or to
+ assert or imply endorsement of any Modified Version.
+
+ 5. COMBINING DOCUMENTS
+
+ You may combine the Document with other documents released under
+ this License, under the terms defined in section 4 above for
+ modified versions, provided that you include in the combination
+ all of the Invariant Sections of all of the original documents,
+ unmodified, and list them all as Invariant Sections of your
+ combined work in its license notice, and that you preserve all
+ their Warranty Disclaimers.
+
+ The combined work need only contain one copy of this License, and
+ multiple identical Invariant Sections may be replaced with a single
+ copy. If there are multiple Invariant Sections with the same name
+ but different contents, make the title of each such section unique
+ by adding at the end of it, in parentheses, the name of the
+ original author or publisher of that section if known, or else a
+ unique number. Make the same adjustment to the section titles in
+ the list of Invariant Sections in the license notice of the
+ combined work.
+
+ In the combination, you must combine any sections Entitled
+ "History" in the various original documents, forming one section
+ Entitled "History"; likewise combine any sections Entitled
+ "Acknowledgements", and any sections Entitled "Dedications". You
+ must delete all sections Entitled "Endorsements."
+
+ 6. COLLECTIONS OF DOCUMENTS
+
+ You may make a collection consisting of the Document and other
+ documents released under this License, and replace the individual
+ copies of this License in the various documents with a single copy
+ that is included in the collection, provided that you follow the
+ rules of this License for verbatim copying of each of the
+ documents in all other respects.
+
+ You may extract a single document from such a collection, and
+ distribute it individually under this License, provided you insert
+ a copy of this License into the extracted document, and follow
+ this License in all other respects regarding verbatim copying of
+ that document.
+
+ 7. AGGREGATION WITH INDEPENDENT WORKS
+
+ A compilation of the Document or its derivatives with other
+ separate and independent documents or works, in or on a volume of
+ a storage or distribution medium, is called an "aggregate" if the
+ copyright resulting from the compilation is not used to limit the
+ legal rights of the compilation's users beyond what the individual
+ works permit. When the Document is included in an aggregate, this
+ License does not apply to the other works in the aggregate which
+ are not themselves derivative works of the Document.
+
+ If the Cover Text requirement of section 3 is applicable to these
+ copies of the Document, then if the Document is less than one half
+ of the entire aggregate, the Document's Cover Texts may be placed
+ on covers that bracket the Document within the aggregate, or the
+ electronic equivalent of covers if the Document is in electronic
+ form. Otherwise they must appear on printed covers that bracket
+ the whole aggregate.
+
+ 8. TRANSLATION
+
+ Translation is considered a kind of modification, so you may
+ distribute translations of the Document under the terms of section
+ 4. Replacing Invariant Sections with translations requires special
+ permission from their copyright holders, but you may include
+ translations of some or all Invariant Sections in addition to the
+ original versions of these Invariant Sections. You may include a
+ translation of this License, and all the license notices in the
+ Document, and any Warranty Disclaimers, provided that you also
+ include the original English version of this License and the
+ original versions of those notices and disclaimers. In case of a
+ disagreement between the translation and the original version of
+ this License or a notice or disclaimer, the original version will
+ prevail.
+
+ If a section in the Document is Entitled "Acknowledgements",
+ "Dedications", or "History", the requirement (section 4) to
+ Preserve its Title (section 1) will typically require changing the
+ actual title.
+
+ 9. TERMINATION
+
+ You may not copy, modify, sublicense, or distribute the Document
+ except as expressly provided for under this License. Any other
+ attempt to copy, modify, sublicense or distribute the Document is
+ void, and will automatically terminate your rights under this
+ License. However, parties who have received copies, or rights,
+ from you under this License will not have their licenses
+ terminated so long as such parties remain in full compliance.
+
+ 10. FUTURE REVISIONS OF THIS LICENSE
+
+ The Free Software Foundation may publish new, revised versions of
+ the GNU Free Documentation License from time to time. Such new
+ versions will be similar in spirit to the present version, but may
+ differ in detail to address new problems or concerns. See
+ `http://www.gnu.org/copyleft/'.
+
+ Each version of the License is given a distinguishing version
+ number. If the Document specifies that a particular numbered
+ version of this License "or any later version" applies to it, you
+ have the option of following the terms and conditions either of
+ that specified version or of any later version that has been
+ published (not as a draft) by the Free Software Foundation. If
+ the Document does not specify a version number of this License,
+ you may choose any version ever published (not as a draft) by the
+ Free Software Foundation.
+
+ADDENDUM: How to use this License for your documents
+====================================================
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and license
+notices just after the title page:
+
+ Copyright (C) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.2
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+ Texts. A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
+
+ If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with
+ the Front-Cover Texts being LIST, and with the Back-Cover Texts
+ being LIST.
+
+ If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+ If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License, to
+permit their use in free software.
+
+
+File: gcc.info, Node: Contributors, Next: Option Index, Prev: GNU Free Documentation License, Up: Top
+
+Contributors to GCC
+*******************
+
+The GCC project would like to thank its many contributors. Without
+them the project would not have been nearly as successful as it has
+been. Any omissions in this list are accidental. Feel free to contact
+<law@redhat.com> or <gerald@pfeifer.com> if you have been left out or
+some of your contributions are not listed. Please keep this list in
+alphabetical order.
+
+ * Analog Devices helped implement the support for complex data types
+ and iterators.
+
+ * John David Anglin for threading-related fixes and improvements to
+ libstdc++-v3, and the HP-UX port.
+
+ * James van Artsdalen wrote the code that makes efficient use of the
+ Intel 80387 register stack.
+
+ * Abramo and Roberto Bagnara for the SysV68 Motorola 3300 Delta
+ Series port.
+
+ * Alasdair Baird for various bug fixes.
+
+ * Giovanni Bajo for analyzing lots of complicated C++ problem
+ reports.
+
+ * Peter Barada for his work to improve code generation for new
+ ColdFire cores.
+
+ * Gerald Baumgartner added the signature extension to the C++ front
+ end.
+
+ * Godmar Back for his Java improvements and encouragement.
+
+ * Scott Bambrough for help porting the Java compiler.
+
+ * Wolfgang Bangerth for processing tons of bug reports.
+
+ * Jon Beniston for his Microsoft Windows port of Java.
+
+ * Daniel Berlin for better DWARF2 support, faster/better
+ optimizations, improved alias analysis, plus migrating GCC to
+ Bugzilla.
+
+ * Geoff Berry for his Java object serialization work and various
+ patches.
+
+ * Uros Bizjak for the implementation of x87 math built-in functions
+ and for various middle end and i386 back end improvements and bug
+ fixes.
+
+ * Eric Blake for helping to make GCJ and libgcj conform to the
+ specifications.
+
+ * Janne Blomqvist for contributions to GNU Fortran.
+
+ * Segher Boessenkool for various fixes.
+
+ * Hans-J. Boehm for his garbage collector, IA-64 libffi port, and
+ other Java work.
+
+ * Neil Booth for work on cpplib, lang hooks, debug hooks and other
+ miscellaneous clean-ups.
+
+ * Steven Bosscher for integrating the GNU Fortran front end into GCC
+ and for contributing to the tree-ssa branch.
+
+ * Eric Botcazou for fixing middle- and backend bugs left and right.
+
+ * Per Bothner for his direction via the steering committee and
+ various improvements to the infrastructure for supporting new
+ languages. Chill front end implementation. Initial
+ implementations of cpplib, fix-header, config.guess, libio, and
+ past C++ library (libg++) maintainer. Dreaming up, designing and
+ implementing much of GCJ.
+
+ * Devon Bowen helped port GCC to the Tahoe.
+
+ * Don Bowman for mips-vxworks contributions.
+
+ * Dave Brolley for work on cpplib and Chill.
+
+ * Paul Brook for work on the ARM architecture and maintaining GNU
+ Fortran.
+
+ * Robert Brown implemented the support for Encore 32000 systems.
+
+ * Christian Bruel for improvements to local store elimination.
+
+ * Herman A.J. ten Brugge for various fixes.
+
+ * Joerg Brunsmann for Java compiler hacking and help with the GCJ
+ FAQ.
+
+ * Joe Buck for his direction via the steering committee.
+
+ * Craig Burley for leadership of the G77 Fortran effort.
+
+ * Stephan Buys for contributing Doxygen notes for libstdc++.
+
+ * Paolo Carlini for libstdc++ work: lots of efficiency improvements
+ to the C++ strings, streambufs and formatted I/O, hard detective
+ work on the frustrating localization issues, and keeping up with
+ the problem reports.
+
+ * John Carr for his alias work, SPARC hacking, infrastructure
+ improvements, previous contributions to the steering committee,
+ loop optimizations, etc.
+
+ * Stephane Carrez for 68HC11 and 68HC12 ports.
+
+ * Steve Chamberlain for support for the Renesas SH and H8 processors
+ and the PicoJava processor, and for GCJ config fixes.
+
+ * Glenn Chambers for help with the GCJ FAQ.
+
+ * John-Marc Chandonia for various libgcj patches.
+
+ * Scott Christley for his Objective-C contributions.
+
+ * Eric Christopher for his Java porting help and clean-ups.
+
+ * Branko Cibej for more warning contributions.
+
+ * The GNU Classpath project for all of their merged runtime code.
+
+ * Nick Clifton for arm, mcore, fr30, v850, m32r work, `--help', and
+ other random hacking.
+
+ * Michael Cook for libstdc++ cleanup patches to reduce warnings.
+
+ * R. Kelley Cook for making GCC buildable from a read-only directory
+ as well as other miscellaneous build process and documentation
+ clean-ups.
+
+ * Ralf Corsepius for SH testing and minor bug fixing.
+
+ * Stan Cox for care and feeding of the x86 port and lots of behind
+ the scenes hacking.
+
+ * Alex Crain provided changes for the 3b1.
+
+ * Ian Dall for major improvements to the NS32k port.
+
+ * Paul Dale for his work to add uClinux platform support to the m68k
+ backend.
+
+ * Dario Dariol contributed the four varieties of sample programs
+ that print a copy of their source.
+
+ * Russell Davidson for fstream and stringstream fixes in libstdc++.
+
+ * Bud Davis for work on the G77 and GNU Fortran compilers.
+
+ * Mo DeJong for GCJ and libgcj bug fixes.
+
+ * DJ Delorie for the DJGPP port, build and libiberty maintenance,
+ various bug fixes, and the M32C port.
+
+ * Arnaud Desitter for helping to debug GNU Fortran.
+
+ * Gabriel Dos Reis for contributions to G++, contributions and
+ maintenance of GCC diagnostics infrastructure, libstdc++-v3,
+ including `valarray<>', `complex<>', maintaining the numerics
+ library (including that pesky `<limits>' :-) and keeping
+ up-to-date anything to do with numbers.
+
+ * Ulrich Drepper for his work on glibc, testing of GCC using glibc,
+ ISO C99 support, CFG dumping support, etc., plus support of the
+ C++ runtime libraries including for all kinds of C interface
+ issues, contributing and maintaining `complex<>', sanity checking
+ and disbursement, configuration architecture, libio maintenance,
+ and early math work.
+
+ * Zdenek Dvorak for a new loop unroller and various fixes.
+
+ * Richard Earnshaw for his ongoing work with the ARM.
+
+ * David Edelsohn for his direction via the steering committee,
+ ongoing work with the RS6000/PowerPC port, help cleaning up Haifa
+ loop changes, doing the entire AIX port of libstdc++ with his bare
+ hands, and for ensuring GCC properly keeps working on AIX.
+
+ * Kevin Ediger for the floating point formatting of num_put::do_put
+ in libstdc++.
+
+ * Phil Edwards for libstdc++ work including configuration hackery,
+ documentation maintainer, chief breaker of the web pages, the
+ occasional iostream bug fix, and work on shared library symbol
+ versioning.
+
+ * Paul Eggert for random hacking all over GCC.
+
+ * Mark Elbrecht for various DJGPP improvements, and for libstdc++
+ configuration support for locales and fstream-related fixes.
+
+ * Vadim Egorov for libstdc++ fixes in strings, streambufs, and
+ iostreams.
+
+ * Christian Ehrhardt for dealing with bug reports.
+
+ * Ben Elliston for his work to move the Objective-C runtime into its
+ own subdirectory and for his work on autoconf.
+
+ * Revital Eres for work on the PowerPC 750CL port.
+
+ * Marc Espie for OpenBSD support.
+
+ * Doug Evans for much of the global optimization framework, arc,
+ m32r, and SPARC work.
+
+ * Christopher Faylor for his work on the Cygwin port and for caring
+ and feeding the gcc.gnu.org box and saving its users tons of spam.
+
+ * Fred Fish for BeOS support and Ada fixes.
+
+ * Ivan Fontes Garcia for the Portuguese translation of the GCJ FAQ.
+
+ * Peter Gerwinski for various bug fixes and the Pascal front end.
+
+ * Kaveh R. Ghazi for his direction via the steering committee,
+ amazing work to make `-W -Wall -W* -Werror' useful, and
+ continuously testing GCC on a plethora of platforms. Kaveh
+ extends his gratitude to the CAIP Center at Rutgers University for
+ providing him with computing resources to work on Free Software
+ since the late 1980s.
+
+ * John Gilmore for a donation to the FSF earmarked improving GNU
+ Java.
+
+ * Judy Goldberg for c++ contributions.
+
+ * Torbjorn Granlund for various fixes and the c-torture testsuite,
+ multiply- and divide-by-constant optimization, improved long long
+ support, improved leaf function register allocation, and his
+ direction via the steering committee.
+
+ * Anthony Green for his `-Os' contributions and Java front end work.
+
+ * Stu Grossman for gdb hacking, allowing GCJ developers to debug
+ Java code.
+
+ * Michael K. Gschwind contributed the port to the PDP-11.
+
+ * Ron Guilmette implemented the `protoize' and `unprotoize' tools,
+ the support for Dwarf symbolic debugging information, and much of
+ the support for System V Release 4. He has also worked heavily on
+ the Intel 386 and 860 support.
+
+ * Mostafa Hagog for Swing Modulo Scheduling (SMS) and post reload
+ GCSE.
+
+ * Bruno Haible for improvements in the runtime overhead for EH, new
+ warnings and assorted bug fixes.
+
+ * Andrew Haley for his amazing Java compiler and library efforts.
+
+ * Chris Hanson assisted in making GCC work on HP-UX for the 9000
+ series 300.
+
+ * Michael Hayes for various thankless work he's done trying to get
+ the c30/c40 ports functional. Lots of loop and unroll
+ improvements and fixes.
+
+ * Dara Hazeghi for wading through myriads of target-specific bug
+ reports.
+
+ * Kate Hedstrom for staking the G77 folks with an initial testsuite.
+
+ * Richard Henderson for his ongoing SPARC, alpha, ia32, and ia64
+ work, loop opts, and generally fixing lots of old problems we've
+ ignored for years, flow rewrite and lots of further stuff,
+ including reviewing tons of patches.
+
+ * Aldy Hernandez for working on the PowerPC port, SIMD support, and
+ various fixes.
+
+ * Nobuyuki Hikichi of Software Research Associates, Tokyo,
+ contributed the support for the Sony NEWS machine.
+
+ * Kazu Hirata for caring and feeding the Renesas H8/300 port and
+ various fixes.
+
+ * Katherine Holcomb for work on GNU Fortran.
+
+ * Manfred Hollstein for his ongoing work to keep the m88k alive, lots
+ of testing and bug fixing, particularly of GCC configury code.
+
+ * Steve Holmgren for MachTen patches.
+
+ * Jan Hubicka for his x86 port improvements.
+
+ * Falk Hueffner for working on C and optimization bug reports.
+
+ * Bernardo Innocenti for his m68k work, including merging of
+ ColdFire improvements and uClinux support.
+
+ * Christian Iseli for various bug fixes.
+
+ * Kamil Iskra for general m68k hacking.
+
+ * Lee Iverson for random fixes and MIPS testing.
+
+ * Andreas Jaeger for testing and benchmarking of GCC and various bug
+ fixes.
+
+ * Jakub Jelinek for his SPARC work and sibling call optimizations as
+ well as lots of bug fixes and test cases, and for improving the
+ Java build system.
+
+ * Janis Johnson for ia64 testing and fixes, her quality improvement
+ sidetracks, and web page maintenance.
+
+ * Kean Johnston for SCO OpenServer support and various fixes.
+
+ * Tim Josling for the sample language treelang based originally on
+ Richard Kenner's "toy" language.
+
+ * Nicolai Josuttis for additional libstdc++ documentation.
+
+ * Klaus Kaempf for his ongoing work to make alpha-vms a viable
+ target.
+
+ * Steven G. Kargl for work on GNU Fortran.
+
+ * David Kashtan of SRI adapted GCC to VMS.
+
+ * Ryszard Kabatek for many, many libstdc++ bug fixes and
+ optimizations of strings, especially member functions, and for
+ auto_ptr fixes.
+
+ * Geoffrey Keating for his ongoing work to make the PPC work for
+ GNU/Linux and his automatic regression tester.
+
+ * Brendan Kehoe for his ongoing work with G++ and for a lot of early
+ work in just about every part of libstdc++.
+
+ * Oliver M. Kellogg of Deutsche Aerospace contributed the port to the
+ MIL-STD-1750A.
+
+ * Richard Kenner of the New York University Ultracomputer Research
+ Laboratory wrote the machine descriptions for the AMD 29000, the
+ DEC Alpha, the IBM RT PC, and the IBM RS/6000 as well as the
+ support for instruction attributes. He also made changes to
+ better support RISC processors including changes to common
+ subexpression elimination, strength reduction, function calling
+ sequence handling, and condition code support, in addition to
+ generalizing the code for frame pointer elimination and delay slot
+ scheduling. Richard Kenner was also the head maintainer of GCC
+ for several years.
+
+ * Mumit Khan for various contributions to the Cygwin and Mingw32
+ ports and maintaining binary releases for Microsoft Windows hosts,
+ and for massive libstdc++ porting work to Cygwin/Mingw32.
+
+ * Robin Kirkham for cpu32 support.
+
+ * Mark Klein for PA improvements.
+
+ * Thomas Koenig for various bug fixes.
+
+ * Bruce Korb for the new and improved fixincludes code.
+
+ * Benjamin Kosnik for his G++ work and for leading the libstdc++-v3
+ effort.
+
+ * Charles LaBrec contributed the support for the Integrated Solutions
+ 68020 system.
+
+ * Asher Langton and Mike Kumbera for contributing Cray pointer
+ support to GNU Fortran, and for other GNU Fortran improvements.
+
+ * Jeff Law for his direction via the steering committee,
+ coordinating the entire egcs project and GCC 2.95, rolling out
+ snapshots and releases, handling merges from GCC2, reviewing tons
+ of patches that might have fallen through the cracks else, and
+ random but extensive hacking.
+
+ * Marc Lehmann for his direction via the steering committee and
+ helping with analysis and improvements of x86 performance.
+
+ * Victor Leikehman for work on GNU Fortran.
+
+ * Ted Lemon wrote parts of the RTL reader and printer.
+
+ * Kriang Lerdsuwanakij for C++ improvements including template as
+ template parameter support, and many C++ fixes.
+
+ * Warren Levy for tremendous work on libgcj (Java Runtime Library)
+ and random work on the Java front end.
+
+ * Alain Lichnewsky ported GCC to the MIPS CPU.
+
+ * Oskar Liljeblad for hacking on AWT and his many Java bug reports
+ and patches.
+
+ * Robert Lipe for OpenServer support, new testsuites, testing, etc.
+
+ * Chen Liqin for various S+core related fixes/improvement, and for
+ maintaining the S+core port.
+
+ * Weiwen Liu for testing and various bug fixes.
+
+ * Manuel Lo'pez-Iba'n~ez for improving `-Wconversion' and many other
+ diagnostics fixes and improvements.
+
+ * Dave Love for his ongoing work with the Fortran front end and
+ runtime libraries.
+
+ * Martin von Lo"wis for internal consistency checking infrastructure,
+ various C++ improvements including namespace support, and tons of
+ assistance with libstdc++/compiler merges.
+
+ * H.J. Lu for his previous contributions to the steering committee,
+ many x86 bug reports, prototype patches, and keeping the GNU/Linux
+ ports working.
+
+ * Greg McGary for random fixes and (someday) bounded pointers.
+
+ * Andrew MacLeod for his ongoing work in building a real EH system,
+ various code generation improvements, work on the global
+ optimizer, etc.
+
+ * Vladimir Makarov for hacking some ugly i960 problems, PowerPC
+ hacking improvements to compile-time performance, overall
+ knowledge and direction in the area of instruction scheduling, and
+ design and implementation of the automaton based instruction
+ scheduler.
+
+ * Bob Manson for his behind the scenes work on dejagnu.
+
+ * Philip Martin for lots of libstdc++ string and vector iterator
+ fixes and improvements, and string clean up and testsuites.
+
+ * All of the Mauve project contributors, for Java test code.
+
+ * Bryce McKinlay for numerous GCJ and libgcj fixes and improvements.
+
+ * Adam Megacz for his work on the Microsoft Windows port of GCJ.
+
+ * Michael Meissner for LRS framework, ia32, m32r, v850, m88k, MIPS,
+ powerpc, haifa, ECOFF debug support, and other assorted hacking.
+
+ * Jason Merrill for his direction via the steering committee and
+ leading the G++ effort.
+
+ * Martin Michlmayr for testing GCC on several architectures using the
+ entire Debian archive.
+
+ * David Miller for his direction via the steering committee, lots of
+ SPARC work, improvements in jump.c and interfacing with the Linux
+ kernel developers.
+
+ * Gary Miller ported GCC to Charles River Data Systems machines.
+
+ * Alfred Minarik for libstdc++ string and ios bug fixes, and turning
+ the entire libstdc++ testsuite namespace-compatible.
+
+ * Mark Mitchell for his direction via the steering committee,
+ mountains of C++ work, load/store hoisting out of loops, alias
+ analysis improvements, ISO C `restrict' support, and serving as
+ release manager for GCC 3.x.
+
+ * Alan Modra for various GNU/Linux bits and testing.
+
+ * Toon Moene for his direction via the steering committee, Fortran
+ maintenance, and his ongoing work to make us make Fortran run fast.
+
+ * Jason Molenda for major help in the care and feeding of all the
+ services on the gcc.gnu.org (formerly egcs.cygnus.com)
+ machine--mail, web services, ftp services, etc etc. Doing all
+ this work on scrap paper and the backs of envelopes would have
+ been... difficult.
+
+ * Catherine Moore for fixing various ugly problems we have sent her
+ way, including the haifa bug which was killing the Alpha & PowerPC
+ Linux kernels.
+
+ * Mike Moreton for his various Java patches.
+
+ * David Mosberger-Tang for various Alpha improvements, and for the
+ initial IA-64 port.
+
+ * Stephen Moshier contributed the floating point emulator that
+ assists in cross-compilation and permits support for floating
+ point numbers wider than 64 bits and for ISO C99 support.
+
+ * Bill Moyer for his behind the scenes work on various issues.
+
+ * Philippe De Muyter for his work on the m68k port.
+
+ * Joseph S. Myers for his work on the PDP-11 port, format checking
+ and ISO C99 support, and continuous emphasis on (and contributions
+ to) documentation.
+
+ * Nathan Myers for his work on libstdc++-v3: architecture and
+ authorship through the first three snapshots, including
+ implementation of locale infrastructure, string, shadow C headers,
+ and the initial project documentation (DESIGN, CHECKLIST, and so
+ forth). Later, more work on MT-safe string and shadow headers.
+
+ * Felix Natter for documentation on porting libstdc++.
+
+ * Nathanael Nerode for cleaning up the configuration/build process.
+
+ * NeXT, Inc. donated the front end that supports the Objective-C
+ language.
+
+ * Hans-Peter Nilsson for the CRIS and MMIX ports, improvements to
+ the search engine setup, various documentation fixes and other
+ small fixes.
+
+ * Geoff Noer for his work on getting cygwin native builds working.
+
+ * Diego Novillo for his work on Tree SSA, OpenMP, SPEC performance
+ tracking web pages, GIMPLE tuples, and assorted fixes.
+
+ * David O'Brien for the FreeBSD/alpha, FreeBSD/AMD x86-64,
+ FreeBSD/ARM, FreeBSD/PowerPC, and FreeBSD/SPARC64 ports and
+ related infrastructure improvements.
+
+ * Alexandre Oliva for various build infrastructure improvements,
+ scripts and amazing testing work, including keeping libtool issues
+ sane and happy.
+
+ * Stefan Olsson for work on mt_alloc.
+
+ * Melissa O'Neill for various NeXT fixes.
+
+ * Rainer Orth for random MIPS work, including improvements to GCC's
+ o32 ABI support, improvements to dejagnu's MIPS support, Java
+ configuration clean-ups and porting work, etc.
+
+ * Hartmut Penner for work on the s390 port.
+
+ * Paul Petersen wrote the machine description for the Alliant FX/8.
+
+ * Alexandre Petit-Bianco for implementing much of the Java compiler
+ and continued Java maintainership.
+
+ * Matthias Pfaller for major improvements to the NS32k port.
+
+ * Gerald Pfeifer for his direction via the steering committee,
+ pointing out lots of problems we need to solve, maintenance of the
+ web pages, and taking care of documentation maintenance in general.
+
+ * Andrew Pinski for processing bug reports by the dozen.
+
+ * Ovidiu Predescu for his work on the Objective-C front end and
+ runtime libraries.
+
+ * Jerry Quinn for major performance improvements in C++ formatted
+ I/O.
+
+ * Ken Raeburn for various improvements to checker, MIPS ports and
+ various cleanups in the compiler.
+
+ * Rolf W. Rasmussen for hacking on AWT.
+
+ * David Reese of Sun Microsystems contributed to the Solaris on
+ PowerPC port.
+
+ * Volker Reichelt for keeping up with the problem reports.
+
+ * Joern Rennecke for maintaining the sh port, loop, regmove & reload
+ hacking.
+
+ * Loren J. Rittle for improvements to libstdc++-v3 including the
+ FreeBSD port, threading fixes, thread-related configury changes,
+ critical threading documentation, and solutions to really tricky
+ I/O problems, as well as keeping GCC properly working on FreeBSD
+ and continuous testing.
+
+ * Craig Rodrigues for processing tons of bug reports.
+
+ * Ola Ro"nnerup for work on mt_alloc.
+
+ * Gavin Romig-Koch for lots of behind the scenes MIPS work.
+
+ * David Ronis inspired and encouraged Craig to rewrite the G77
+ documentation in texinfo format by contributing a first pass at a
+ translation of the old `g77-0.5.16/f/DOC' file.
+
+ * Ken Rose for fixes to GCC's delay slot filling code.
+
+ * Paul Rubin wrote most of the preprocessor.
+
+ * Pe'tur Runo'lfsson for major performance improvements in C++
+ formatted I/O and large file support in C++ filebuf.
+
+ * Chip Salzenberg for libstdc++ patches and improvements to locales,
+ traits, Makefiles, libio, libtool hackery, and "long long" support.
+
+ * Juha Sarlin for improvements to the H8 code generator.
+
+ * Greg Satz assisted in making GCC work on HP-UX for the 9000 series
+ 300.
+
+ * Roger Sayle for improvements to constant folding and GCC's RTL
+ optimizers as well as for fixing numerous bugs.
+
+ * Bradley Schatz for his work on the GCJ FAQ.
+
+ * Peter Schauer wrote the code to allow debugging to work on the
+ Alpha.
+
+ * William Schelter did most of the work on the Intel 80386 support.
+
+ * Tobias Schlu"ter for work on GNU Fortran.
+
+ * Bernd Schmidt for various code generation improvements and major
+ work in the reload pass as well a serving as release manager for
+ GCC 2.95.3.
+
+ * Peter Schmid for constant testing of libstdc++--especially
+ application testing, going above and beyond what was requested for
+ the release criteria--and libstdc++ header file tweaks.
+
+ * Jason Schroeder for jcf-dump patches.
+
+ * Andreas Schwab for his work on the m68k port.
+
+ * Lars Segerlund for work on GNU Fortran.
+
+ * Joel Sherrill for his direction via the steering committee, RTEMS
+ contributions and RTEMS testing.
+
+ * Nathan Sidwell for many C++ fixes/improvements.
+
+ * Jeffrey Siegal for helping RMS with the original design of GCC,
+ some code which handles the parse tree and RTL data structures,
+ constant folding and help with the original VAX & m68k ports.
+
+ * Kenny Simpson for prompting libstdc++ fixes due to defect reports
+ from the LWG (thereby keeping GCC in line with updates from the
+ ISO).
+
+ * Franz Sirl for his ongoing work with making the PPC port stable
+ for GNU/Linux.
+
+ * Andrey Slepuhin for assorted AIX hacking.
+
+ * Trevor Smigiel for contributing the SPU port.
+
+ * Christopher Smith did the port for Convex machines.
+
+ * Danny Smith for his major efforts on the Mingw (and Cygwin) ports.
+
+ * Randy Smith finished the Sun FPA support.
+
+ * Scott Snyder for queue, iterator, istream, and string fixes and
+ libstdc++ testsuite entries. Also for providing the patch to G77
+ to add rudimentary support for `INTEGER*1', `INTEGER*2', and
+ `LOGICAL*1'.
+
+ * Brad Spencer for contributions to the GLIBCPP_FORCE_NEW technique.
+
+ * Richard Stallman, for writing the original GCC and launching the
+ GNU project.
+
+ * Jan Stein of the Chalmers Computer Society provided support for
+ Genix, as well as part of the 32000 machine description.
+
+ * Nigel Stephens for various mips16 related fixes/improvements.
+
+ * Jonathan Stone wrote the machine description for the Pyramid
+ computer.
+
+ * Graham Stott for various infrastructure improvements.
+
+ * John Stracke for his Java HTTP protocol fixes.
+
+ * Mike Stump for his Elxsi port, G++ contributions over the years
+ and more recently his vxworks contributions
+
+ * Jeff Sturm for Java porting help, bug fixes, and encouragement.
+
+ * Shigeya Suzuki for this fixes for the bsdi platforms.
+
+ * Ian Lance Taylor for his mips16 work, general configury hacking,
+ fixincludes, etc.
+
+ * Holger Teutsch provided the support for the Clipper CPU.
+
+ * Gary Thomas for his ongoing work to make the PPC work for
+ GNU/Linux.
+
+ * Philipp Thomas for random bug fixes throughout the compiler
+
+ * Jason Thorpe for thread support in libstdc++ on NetBSD.
+
+ * Kresten Krab Thorup wrote the run time support for the Objective-C
+ language and the fantastic Java bytecode interpreter.
+
+ * Michael Tiemann for random bug fixes, the first instruction
+ scheduler, initial C++ support, function integration, NS32k, SPARC
+ and M88k machine description work, delay slot scheduling.
+
+ * Andreas Tobler for his work porting libgcj to Darwin.
+
+ * Teemu Torma for thread safe exception handling support.
+
+ * Leonard Tower wrote parts of the parser, RTL generator, and RTL
+ definitions, and of the VAX machine description.
+
+ * Daniel Towner and Hariharan Sandanagobalane contributed and
+ maintain the picoChip port.
+
+ * Tom Tromey for internationalization support and for his many Java
+ contributions and libgcj maintainership.
+
+ * Lassi Tuura for improvements to config.guess to determine HP
+ processor types.
+
+ * Petter Urkedal for libstdc++ CXXFLAGS, math, and algorithms fixes.
+
+ * Andy Vaught for the design and initial implementation of the GNU
+ Fortran front end.
+
+ * Brent Verner for work with the libstdc++ cshadow files and their
+ associated configure steps.
+
+ * Todd Vierling for contributions for NetBSD ports.
+
+ * Jonathan Wakely for contributing libstdc++ Doxygen notes and XHTML
+ guidance.
+
+ * Dean Wakerley for converting the install documentation from HTML
+ to texinfo in time for GCC 3.0.
+
+ * Krister Walfridsson for random bug fixes.
+
+ * Feng Wang for contributions to GNU Fortran.
+
+ * Stephen M. Webb for time and effort on making libstdc++ shadow
+ files work with the tricky Solaris 8+ headers, and for pushing the
+ build-time header tree.
+
+ * John Wehle for various improvements for the x86 code generator,
+ related infrastructure improvements to help x86 code generation,
+ value range propagation and other work, WE32k port.
+
+ * Ulrich Weigand for work on the s390 port.
+
+ * Zack Weinberg for major work on cpplib and various other bug fixes.
+
+ * Matt Welsh for help with Linux Threads support in GCJ.
+
+ * Urban Widmark for help fixing java.io.
+
+ * Mark Wielaard for new Java library code and his work integrating
+ with Classpath.
+
+ * Dale Wiles helped port GCC to the Tahoe.
+
+ * Bob Wilson from Tensilica, Inc. for the Xtensa port.
+
+ * Jim Wilson for his direction via the steering committee, tackling
+ hard problems in various places that nobody else wanted to work
+ on, strength reduction and other loop optimizations.
+
+ * Paul Woegerer and Tal Agmon for the CRX port.
+
+ * Carlo Wood for various fixes.
+
+ * Tom Wood for work on the m88k port.
+
+ * Canqun Yang for work on GNU Fortran.
+
+ * Masanobu Yuhara of Fujitsu Laboratories implemented the machine
+ description for the Tron architecture (specifically, the Gmicro).
+
+ * Kevin Zachmann helped port GCC to the Tahoe.
+
+ * Ayal Zaks for Swing Modulo Scheduling (SMS).
+
+ * Xiaoqiang Zhang for work on GNU Fortran.
+
+ * Gilles Zunino for help porting Java to Irix.
+
+
+ The following people are recognized for their contributions to GNAT,
+the Ada front end of GCC:
+ * Bernard Banner
+
+ * Romain Berrendonner
+
+ * Geert Bosch
+
+ * Emmanuel Briot
+
+ * Joel Brobecker
+
+ * Ben Brosgol
+
+ * Vincent Celier
+
+ * Arnaud Charlet
+
+ * Chien Chieng
+
+ * Cyrille Comar
+
+ * Cyrille Crozes
+
+ * Robert Dewar
+
+ * Gary Dismukes
+
+ * Robert Duff
+
+ * Ed Falis
+
+ * Ramon Fernandez
+
+ * Sam Figueroa
+
+ * Vasiliy Fofanov
+
+ * Michael Friess
+
+ * Franco Gasperoni
+
+ * Ted Giering
+
+ * Matthew Gingell
+
+ * Laurent Guerby
+
+ * Jerome Guitton
+
+ * Olivier Hainque
+
+ * Jerome Hugues
+
+ * Hristian Kirtchev
+
+ * Jerome Lambourg
+
+ * Bruno Leclerc
+
+ * Albert Lee
+
+ * Sean McNeil
+
+ * Javier Miranda
+
+ * Laurent Nana
+
+ * Pascal Obry
+
+ * Dong-Ik Oh
+
+ * Laurent Pautet
+
+ * Brett Porter
+
+ * Thomas Quinot
+
+ * Nicolas Roche
+
+ * Pat Rogers
+
+ * Jose Ruiz
+
+ * Douglas Rupp
+
+ * Sergey Rybin
+
+ * Gail Schenker
+
+ * Ed Schonberg
+
+ * Nicolas Setton
+
+ * Samuel Tardieu
+
+
+ The following people are recognized for their contributions of new
+features, bug reports, testing and integration of classpath/libgcj for
+GCC version 4.1:
+ * Lillian Angel for `JTree' implementation and lots Free Swing
+ additions and bug fixes.
+
+ * Wolfgang Baer for `GapContent' bug fixes.
+
+ * Anthony Balkissoon for `JList', Free Swing 1.5 updates and mouse
+ event fixes, lots of Free Swing work including `JTable' editing.
+
+ * Stuart Ballard for RMI constant fixes.
+
+ * Goffredo Baroncelli for `HTTPURLConnection' fixes.
+
+ * Gary Benson for `MessageFormat' fixes.
+
+ * Daniel Bonniot for `Serialization' fixes.
+
+ * Chris Burdess for lots of gnu.xml and http protocol fixes, `StAX'
+ and `DOM xml:id' support.
+
+ * Ka-Hing Cheung for `TreePath' and `TreeSelection' fixes.
+
+ * Archie Cobbs for build fixes, VM interface updates,
+ `URLClassLoader' updates.
+
+ * Kelley Cook for build fixes.
+
+ * Martin Cordova for Suggestions for better `SocketTimeoutException'.
+
+ * David Daney for `BitSet' bug fixes, `HttpURLConnection' rewrite
+ and improvements.
+
+ * Thomas Fitzsimmons for lots of upgrades to the gtk+ AWT and Cairo
+ 2D support. Lots of imageio framework additions, lots of AWT and
+ Free Swing bug fixes.
+
+ * Jeroen Frijters for `ClassLoader' and nio cleanups, serialization
+ fixes, better `Proxy' support, bug fixes and IKVM integration.
+
+ * Santiago Gala for `AccessControlContext' fixes.
+
+ * Nicolas Geoffray for `VMClassLoader' and `AccessController'
+ improvements.
+
+ * David Gilbert for `basic' and `metal' icon and plaf support and
+ lots of documenting, Lots of Free Swing and metal theme additions.
+ `MetalIconFactory' implementation.
+
+ * Anthony Green for `MIDI' framework, `ALSA' and `DSSI' providers.
+
+ * Andrew Haley for `Serialization' and `URLClassLoader' fixes, gcj
+ build speedups.
+
+ * Kim Ho for `JFileChooser' implementation.
+
+ * Andrew John Hughes for `Locale' and net fixes, URI RFC2986
+ updates, `Serialization' fixes, `Properties' XML support and
+ generic branch work, VMIntegration guide update.
+
+ * Bastiaan Huisman for `TimeZone' bug fixing.
+
+ * Andreas Jaeger for mprec updates.
+
+ * Paul Jenner for better `-Werror' support.
+
+ * Ito Kazumitsu for `NetworkInterface' implementation and updates.
+
+ * Roman Kennke for `BoxLayout', `GrayFilter' and `SplitPane', plus
+ bug fixes all over. Lots of Free Swing work including styled text.
+
+ * Simon Kitching for `String' cleanups and optimization suggestions.
+
+ * Michael Koch for configuration fixes, `Locale' updates, bug and
+ build fixes.
+
+ * Guilhem Lavaux for configuration, thread and channel fixes and
+ Kaffe integration. JCL native `Pointer' updates. Logger bug fixes.
+
+ * David Lichteblau for JCL support library global/local reference
+ cleanups.
+
+ * Aaron Luchko for JDWP updates and documentation fixes.
+
+ * Ziga Mahkovec for `Graphics2D' upgraded to Cairo 0.5 and new regex
+ features.
+
+ * Sven de Marothy for BMP imageio support, CSS and `TextLayout'
+ fixes. `GtkImage' rewrite, 2D, awt, free swing and date/time fixes
+ and implementing the Qt4 peers.
+
+ * Casey Marshall for crypto algorithm fixes, `FileChannel' lock,
+ `SystemLogger' and `FileHandler' rotate implementations, NIO
+ `FileChannel.map' support, security and policy updates.
+
+ * Bryce McKinlay for RMI work.
+
+ * Audrius Meskauskas for lots of Free Corba, RMI and HTML work plus
+ testing and documenting.
+
+ * Kalle Olavi Niemitalo for build fixes.
+
+ * Rainer Orth for build fixes.
+
+ * Andrew Overholt for `File' locking fixes.
+
+ * Ingo Proetel for `Image', `Logger' and `URLClassLoader' updates.
+
+ * Olga Rodimina for `MenuSelectionManager' implementation.
+
+ * Jan Roehrich for `BasicTreeUI' and `JTree' fixes.
+
+ * Julian Scheid for documentation updates and gjdoc support.
+
+ * Christian Schlichtherle for zip fixes and cleanups.
+
+ * Robert Schuster for documentation updates and beans fixes,
+ `TreeNode' enumerations and `ActionCommand' and various fixes, XML
+ and URL, AWT and Free Swing bug fixes.
+
+ * Keith Seitz for lots of JDWP work.
+
+ * Christian Thalinger for 64-bit cleanups, Configuration and VM
+ interface fixes and `CACAO' integration, `fdlibm' updates.
+
+ * Gael Thomas for `VMClassLoader' boot packages support suggestions.
+
+ * Andreas Tobler for Darwin and Solaris testing and fixing, `Qt4'
+ support for Darwin/OS X, `Graphics2D' support, `gtk+' updates.
+
+ * Dalibor Topic for better `DEBUG' support, build cleanups and Kaffe
+ integration. `Qt4' build infrastructure, `SHA1PRNG' and
+ `GdkPixbugDecoder' updates.
+
+ * Tom Tromey for Eclipse integration, generics work, lots of bug
+ fixes and gcj integration including coordinating The Big Merge.
+
+ * Mark Wielaard for bug fixes, packaging and release management,
+ `Clipboard' implementation, system call interrupts and network
+ timeouts and `GdkPixpufDecoder' fixes.
+
+
+ In addition to the above, all of which also contributed time and
+energy in testing GCC, we would like to thank the following for their
+contributions to testing:
+
+ * Michael Abd-El-Malek
+
+ * Thomas Arend
+
+ * Bonzo Armstrong
+
+ * Steven Ashe
+
+ * Chris Baldwin
+
+ * David Billinghurst
+
+ * Jim Blandy
+
+ * Stephane Bortzmeyer
+
+ * Horst von Brand
+
+ * Frank Braun
+
+ * Rodney Brown
+
+ * Sidney Cadot
+
+ * Bradford Castalia
+
+ * Robert Clark
+
+ * Jonathan Corbet
+
+ * Ralph Doncaster
+
+ * Richard Emberson
+
+ * Levente Farkas
+
+ * Graham Fawcett
+
+ * Mark Fernyhough
+
+ * Robert A. French
+
+ * Jo"rgen Freyh
+
+ * Mark K. Gardner
+
+ * Charles-Antoine Gauthier
+
+ * Yung Shing Gene
+
+ * David Gilbert
+
+ * Simon Gornall
+
+ * Fred Gray
+
+ * John Griffin
+
+ * Patrik Hagglund
+
+ * Phil Hargett
+
+ * Amancio Hasty
+
+ * Takafumi Hayashi
+
+ * Bryan W. Headley
+
+ * Kevin B. Hendricks
+
+ * Joep Jansen
+
+ * Christian Joensson
+
+ * Michel Kern
+
+ * David Kidd
+
+ * Tobias Kuipers
+
+ * Anand Krishnaswamy
+
+ * A. O. V. Le Blanc
+
+ * llewelly
+
+ * Damon Love
+
+ * Brad Lucier
+
+ * Matthias Klose
+
+ * Martin Knoblauch
+
+ * Rick Lutowski
+
+ * Jesse Macnish
+
+ * Stefan Morrell
+
+ * Anon A. Mous
+
+ * Matthias Mueller
+
+ * Pekka Nikander
+
+ * Rick Niles
+
+ * Jon Olson
+
+ * Magnus Persson
+
+ * Chris Pollard
+
+ * Richard Polton
+
+ * Derk Reefman
+
+ * David Rees
+
+ * Paul Reilly
+
+ * Tom Reilly
+
+ * Torsten Rueger
+
+ * Danny Sadinoff
+
+ * Marc Schifer
+
+ * Erik Schnetter
+
+ * Wayne K. Schroll
+
+ * David Schuler
+
+ * Vin Shelton
+
+ * Tim Souder
+
+ * Adam Sulmicki
+
+ * Bill Thorson
+
+ * George Talbot
+
+ * Pedro A. M. Vazquez
+
+ * Gregory Warnes
+
+ * Ian Watson
+
+ * David E. Young
+
+ * And many others
+
+ And finally we'd like to thank everyone who uses the compiler, provides
+feedback and generally reminds us why we're doing this work in the first
+place.
+
+
+File: gcc.info, Node: Option Index, Next: Keyword Index, Prev: Contributors, Up: Top
+
+Option Index
+************
+
+GCC's command line options are indexed here without any initial `-' or
+`--'. Where an option has both positive and negative forms (such as
+`-fOPTION' and `-fno-OPTION'), relevant entries in the manual are
+indexed under the most appropriate form; it may sometimes be useful to
+look up both forms.
+
+
+* Menu:
+
+* ###: Overall Options. (line 204)
+* -fdump-statistics: Debugging Options. (line 611)
+* A: Preprocessor Options.
+ (line 538)
+* all_load: Darwin Options. (line 112)
+* allowable_client: Darwin Options. (line 199)
+* ansi <1>: Non-bugs. (line 107)
+* ansi <2>: Other Builtins. (line 22)
+* ansi <3>: Preprocessor Options.
+ (line 325)
+* ansi <4>: C Dialect Options. (line 11)
+* ansi: Standards. (line 16)
+* arch_errors_fatal: Darwin Options. (line 116)
+* aux-info: C Dialect Options. (line 140)
+* b: Target Options. (line 13)
+* B: Directory Options. (line 41)
+* bcopy-builtin: PDP-11 Options. (line 32)
+* Bdynamic: VxWorks Options. (line 22)
+* bind_at_load: Darwin Options. (line 120)
+* Bstatic: VxWorks Options. (line 22)
+* bundle: Darwin Options. (line 125)
+* bundle_loader: Darwin Options. (line 129)
+* c: Link Options. (line 20)
+* C: Preprocessor Options.
+ (line 596)
+* c: Overall Options. (line 159)
+* client_name: Darwin Options. (line 199)
+* combine: Overall Options. (line 215)
+* compatibility_version: Darwin Options. (line 199)
+* coverage: Debugging Options. (line 264)
+* current_version: Darwin Options. (line 199)
+* D: Preprocessor Options.
+ (line 33)
+* d: Debugging Options. (line 328)
+* dA: Debugging Options. (line 530)
+* dD <1>: Preprocessor Options.
+ (line 570)
+* dD: Debugging Options. (line 534)
+* dead_strip: Darwin Options. (line 199)
+* dependency-file: Darwin Options. (line 199)
+* dH: Debugging Options. (line 538)
+* dI: Preprocessor Options.
+ (line 579)
+* dM: Preprocessor Options.
+ (line 554)
+* dm: Debugging Options. (line 541)
+* dN: Preprocessor Options.
+ (line 576)
+* dP: Debugging Options. (line 550)
+* dp: Debugging Options. (line 545)
+* dU: Preprocessor Options.
+ (line 583)
+* dumpmachine: Debugging Options. (line 938)
+* dumpspecs: Debugging Options. (line 946)
+* dumpversion: Debugging Options. (line 942)
+* dv: Debugging Options. (line 554)
+* dx: Debugging Options. (line 559)
+* dy: Debugging Options. (line 563)
+* dylib_file: Darwin Options. (line 199)
+* dylinker_install_name: Darwin Options. (line 199)
+* dynamic: Darwin Options. (line 199)
+* dynamiclib: Darwin Options. (line 133)
+* E <1>: Link Options. (line 20)
+* E: Overall Options. (line 180)
+* EB <1>: MIPS Options. (line 7)
+* EB: ARC Options. (line 12)
+* EL <1>: MIPS Options. (line 10)
+* EL: ARC Options. (line 9)
+* exported_symbols_list: Darwin Options. (line 199)
+* F: Darwin Options. (line 32)
+* fabi-version: C++ Dialect Options.
+ (line 20)
+* falign-functions: Optimize Options. (line 1184)
+* falign-jumps: Optimize Options. (line 1234)
+* falign-labels: Optimize Options. (line 1202)
+* falign-loops: Optimize Options. (line 1220)
+* fargument-alias: Code Gen Options. (line 413)
+* fargument-noalias: Code Gen Options. (line 413)
+* fargument-noalias-anything: Code Gen Options. (line 413)
+* fargument-noalias-global: Code Gen Options. (line 413)
+* fassociative-math: Optimize Options. (line 1411)
+* fasynchronous-unwind-tables: Code Gen Options. (line 64)
+* fauto-inc-dec: Optimize Options. (line 455)
+* fbounds-check: Code Gen Options. (line 15)
+* fbranch-probabilities: Optimize Options. (line 1544)
+* fbranch-target-load-optimize: Optimize Options. (line 1652)
+* fbranch-target-load-optimize2: Optimize Options. (line 1658)
+* fbtr-bb-exclusive: Optimize Options. (line 1662)
+* fcall-saved: Code Gen Options. (line 262)
+* fcall-used: Code Gen Options. (line 248)
+* fcaller-saves: Optimize Options. (line 676)
+* fcheck-data-deps: Optimize Options. (line 897)
+* fcheck-new: C++ Dialect Options.
+ (line 34)
+* fcommon: Variable Attributes.
+ (line 105)
+* fcond-mismatch: C Dialect Options. (line 258)
+* fconserve-space: C++ Dialect Options.
+ (line 44)
+* fconserve-stack: Optimize Options. (line 689)
+* fconstant-string-class: Objective-C and Objective-C++ Dialect Options.
+ (line 30)
+* fcprop-registers: Optimize Options. (line 1292)
+* fcrossjumping: Optimize Options. (line 448)
+* fcse-follow-jumps: Optimize Options. (line 376)
+* fcse-skip-blocks: Optimize Options. (line 385)
+* fcx-fortran-rules: Optimize Options. (line 1530)
+* fcx-limited-range: Optimize Options. (line 1518)
+* fdata-sections: Optimize Options. (line 1633)
+* fdbg-cnt: Debugging Options. (line 317)
+* fdbg-cnt-list: Debugging Options. (line 314)
+* fdce: Optimize Options. (line 461)
+* fdebug-prefix-map: Debugging Options. (line 211)
+* fdelayed-branch: Optimize Options. (line 557)
+* fdelete-null-pointer-checks: Optimize Options. (line 484)
+* fdiagnostics-show-location: Language Independent Options.
+ (line 21)
+* fdiagnostics-show-option: Language Independent Options.
+ (line 36)
+* fdirectives-only: Preprocessor Options.
+ (line 446)
+* fdollars-in-identifiers <1>: Interoperation. (line 146)
+* fdollars-in-identifiers: Preprocessor Options.
+ (line 468)
+* fdse: Optimize Options. (line 465)
+* fdump-class-hierarchy: Debugging Options. (line 587)
+* fdump-ipa: Debugging Options. (line 594)
+* fdump-noaddr: Debugging Options. (line 566)
+* fdump-rtl-alignments: Debugging Options. (line 342)
+* fdump-rtl-all: Debugging Options. (line 527)
+* fdump-rtl-asmcons: Debugging Options. (line 345)
+* fdump-rtl-auto_inc_dec: Debugging Options. (line 349)
+* fdump-rtl-barriers: Debugging Options. (line 353)
+* fdump-rtl-bbpart: Debugging Options. (line 356)
+* fdump-rtl-bbro: Debugging Options. (line 359)
+* fdump-rtl-btl2: Debugging Options. (line 363)
+* fdump-rtl-bypass: Debugging Options. (line 367)
+* fdump-rtl-ce1: Debugging Options. (line 378)
+* fdump-rtl-ce2: Debugging Options. (line 378)
+* fdump-rtl-ce3: Debugging Options. (line 378)
+* fdump-rtl-combine: Debugging Options. (line 370)
+* fdump-rtl-compgotos: Debugging Options. (line 373)
+* fdump-rtl-cprop_hardreg: Debugging Options. (line 382)
+* fdump-rtl-csa: Debugging Options. (line 385)
+* fdump-rtl-cse1: Debugging Options. (line 389)
+* fdump-rtl-cse2: Debugging Options. (line 389)
+* fdump-rtl-dbr: Debugging Options. (line 396)
+* fdump-rtl-dce: Debugging Options. (line 393)
+* fdump-rtl-dce1: Debugging Options. (line 400)
+* fdump-rtl-dce2: Debugging Options. (line 400)
+* fdump-rtl-dfinish: Debugging Options. (line 524)
+* fdump-rtl-dfinit: Debugging Options. (line 524)
+* fdump-rtl-eh: Debugging Options. (line 404)
+* fdump-rtl-eh_ranges: Debugging Options. (line 407)
+* fdump-rtl-expand: Debugging Options. (line 410)
+* fdump-rtl-fwprop1: Debugging Options. (line 414)
+* fdump-rtl-fwprop2: Debugging Options. (line 414)
+* fdump-rtl-gcse1: Debugging Options. (line 419)
+* fdump-rtl-gcse2: Debugging Options. (line 419)
+* fdump-rtl-init-regs: Debugging Options. (line 423)
+* fdump-rtl-initvals: Debugging Options. (line 426)
+* fdump-rtl-into_cfglayout: Debugging Options. (line 429)
+* fdump-rtl-ira: Debugging Options. (line 432)
+* fdump-rtl-jump: Debugging Options. (line 435)
+* fdump-rtl-loop2: Debugging Options. (line 438)
+* fdump-rtl-mach: Debugging Options. (line 442)
+* fdump-rtl-mode_sw: Debugging Options. (line 446)
+* fdump-rtl-outof_cfglayout: Debugging Options. (line 452)
+* fdump-rtl-peephole2: Debugging Options. (line 455)
+* fdump-rtl-postreload: Debugging Options. (line 458)
+* fdump-rtl-pro_and_epilogue: Debugging Options. (line 461)
+* fdump-rtl-regclass: Debugging Options. (line 524)
+* fdump-rtl-regmove: Debugging Options. (line 464)
+* fdump-rtl-rnreg: Debugging Options. (line 449)
+* fdump-rtl-sched1: Debugging Options. (line 468)
+* fdump-rtl-sched2: Debugging Options. (line 468)
+* fdump-rtl-see: Debugging Options. (line 472)
+* fdump-rtl-seqabstr: Debugging Options. (line 475)
+* fdump-rtl-shorten: Debugging Options. (line 478)
+* fdump-rtl-sibling: Debugging Options. (line 481)
+* fdump-rtl-sms: Debugging Options. (line 494)
+* fdump-rtl-split1: Debugging Options. (line 488)
+* fdump-rtl-split2: Debugging Options. (line 488)
+* fdump-rtl-split3: Debugging Options. (line 488)
+* fdump-rtl-split4: Debugging Options. (line 488)
+* fdump-rtl-split5: Debugging Options. (line 488)
+* fdump-rtl-stack: Debugging Options. (line 498)
+* fdump-rtl-subreg1: Debugging Options. (line 504)
+* fdump-rtl-subreg2: Debugging Options. (line 504)
+* fdump-rtl-subregs_of_mode_finish: Debugging Options. (line 524)
+* fdump-rtl-subregs_of_mode_init: Debugging Options. (line 524)
+* fdump-rtl-unshare: Debugging Options. (line 508)
+* fdump-rtl-vartrack: Debugging Options. (line 511)
+* fdump-rtl-vregs: Debugging Options. (line 514)
+* fdump-rtl-web: Debugging Options. (line 517)
+* fdump-translation-unit: Debugging Options. (line 579)
+* fdump-tree: Debugging Options. (line 621)
+* fdump-tree-alias: Debugging Options. (line 705)
+* fdump-tree-all: Debugging Options. (line 790)
+* fdump-tree-ccp: Debugging Options. (line 709)
+* fdump-tree-cfg: Debugging Options. (line 685)
+* fdump-tree-ch: Debugging Options. (line 697)
+* fdump-tree-copyprop: Debugging Options. (line 725)
+* fdump-tree-copyrename: Debugging Options. (line 771)
+* fdump-tree-dce: Debugging Options. (line 733)
+* fdump-tree-dom: Debugging Options. (line 751)
+* fdump-tree-dse: Debugging Options. (line 756)
+* fdump-tree-forwprop: Debugging Options. (line 766)
+* fdump-tree-fre: Debugging Options. (line 721)
+* fdump-tree-gimple: Debugging Options. (line 680)
+* fdump-tree-mudflap: Debugging Options. (line 737)
+* fdump-tree-nrv: Debugging Options. (line 776)
+* fdump-tree-phiopt: Debugging Options. (line 761)
+* fdump-tree-pre: Debugging Options. (line 717)
+* fdump-tree-sink: Debugging Options. (line 747)
+* fdump-tree-sra: Debugging Options. (line 742)
+* fdump-tree-ssa: Debugging Options. (line 701)
+* fdump-tree-store_copyprop: Debugging Options. (line 729)
+* fdump-tree-storeccp: Debugging Options. (line 713)
+* fdump-tree-vcg: Debugging Options. (line 689)
+* fdump-tree-vect: Debugging Options. (line 781)
+* fdump-tree-vrp: Debugging Options. (line 786)
+* fdump-unnumbered: Debugging Options. (line 572)
+* fdwarf2-cfi-asm: Debugging Options. (line 215)
+* fearly-inlining: Optimize Options. (line 220)
+* feliminate-dwarf2-dups: Debugging Options. (line 128)
+* feliminate-unused-debug-symbols: Debugging Options. (line 52)
+* feliminate-unused-debug-types: Debugging Options. (line 950)
+* fexceptions: Code Gen Options. (line 34)
+* fexec-charset: Preprocessor Options.
+ (line 495)
+* fexpensive-optimizations: Optimize Options. (line 497)
+* fextended-identifiers: Preprocessor Options.
+ (line 471)
+* ffast-math: Optimize Options. (line 1362)
+* ffinite-math-only: Optimize Options. (line 1435)
+* ffix-and-continue: Darwin Options. (line 106)
+* ffixed: Code Gen Options. (line 236)
+* ffloat-store <1>: Disappointments. (line 77)
+* ffloat-store: Optimize Options. (line 1348)
+* ffor-scope: C++ Dialect Options.
+ (line 104)
+* fforward-propagate: Optimize Options. (line 149)
+* ffreestanding <1>: Function Attributes.
+ (line 412)
+* ffreestanding <2>: Warning Options. (line 194)
+* ffreestanding <3>: C Dialect Options. (line 211)
+* ffreestanding: Standards. (line 84)
+* ffriend-injection: C++ Dialect Options.
+ (line 74)
+* ffunction-sections: Optimize Options. (line 1633)
+* fgcse: Optimize Options. (line 399)
+* fgcse-after-reload: Optimize Options. (line 435)
+* fgcse-las: Optimize Options. (line 428)
+* fgcse-lm: Optimize Options. (line 410)
+* fgcse-sm: Optimize Options. (line 419)
+* fgnu-runtime: Objective-C and Objective-C++ Dialect Options.
+ (line 39)
+* fgnu89-inline: C Dialect Options. (line 120)
+* fhosted: C Dialect Options. (line 204)
+* fif-conversion: Optimize Options. (line 469)
+* fif-conversion2: Optimize Options. (line 478)
+* filelist: Darwin Options. (line 199)
+* findirect-data: Darwin Options. (line 106)
+* findirect-inlining: Optimize Options. (line 193)
+* finhibit-size-directive: Code Gen Options. (line 158)
+* finline-functions: Optimize Options. (line 201)
+* finline-functions-called-once: Optimize Options. (line 212)
+* finline-limit: Optimize Options. (line 230)
+* finline-small-functions: Optimize Options. (line 185)
+* finput-charset: Preprocessor Options.
+ (line 508)
+* finstrument-functions <1>: Function Attributes.
+ (line 712)
+* finstrument-functions: Code Gen Options. (line 292)
+* finstrument-functions-exclude-file-list: Code Gen Options. (line 329)
+* finstrument-functions-exclude-function-list: Code Gen Options.
+ (line 347)
+* fipa-cp: Optimize Options. (line 742)
+* fipa-cp-clone: Optimize Options. (line 750)
+* fipa-matrix-reorg: Optimize Options. (line 760)
+* fipa-pta: Optimize Options. (line 738)
+* fipa-pure-const: Optimize Options. (line 715)
+* fipa-reference: Optimize Options. (line 719)
+* fipa-struct-reorg: Optimize Options. (line 723)
+* fira-coalesce: Optimize Options. (line 536)
+* fira-verbose: Optimize Options. (line 552)
+* fivopts: Optimize Options. (line 933)
+* fkeep-inline-functions <1>: Inline. (line 51)
+* fkeep-inline-functions: Optimize Options. (line 256)
+* fkeep-static-consts: Optimize Options. (line 263)
+* flat_namespace: Darwin Options. (line 199)
+* flax-vector-conversions: C Dialect Options. (line 263)
+* fleading-underscore: Code Gen Options. (line 430)
+* fmem-report: Debugging Options. (line 239)
+* fmerge-all-constants: Optimize Options. (line 282)
+* fmerge-constants: Optimize Options. (line 272)
+* fmerge-debug-strings: Debugging Options. (line 203)
+* fmessage-length: Language Independent Options.
+ (line 15)
+* fmodulo-sched: Optimize Options. (line 293)
+* fmodulo-sched-allow-regmoves: Optimize Options. (line 298)
+* fmove-loop-invariants: Optimize Options. (line 1623)
+* fms-extensions <1>: Unnamed Fields. (line 37)
+* fms-extensions <2>: C++ Dialect Options.
+ (line 139)
+* fms-extensions: C Dialect Options. (line 229)
+* fmudflap: Optimize Options. (line 338)
+* fmudflapir: Optimize Options. (line 338)
+* fmudflapth: Optimize Options. (line 338)
+* fnext-runtime: Objective-C and Objective-C++ Dialect Options.
+ (line 43)
+* fno-access-control: C++ Dialect Options.
+ (line 30)
+* fno-asm: C Dialect Options. (line 156)
+* fno-branch-count-reg: Optimize Options. (line 305)
+* fno-builtin <1>: Other Builtins. (line 14)
+* fno-builtin <2>: Function Attributes.
+ (line 412)
+* fno-builtin <3>: Warning Options. (line 194)
+* fno-builtin: C Dialect Options. (line 170)
+* fno-common <1>: Variable Attributes.
+ (line 105)
+* fno-common: Code Gen Options. (line 135)
+* fno-deduce-init-list: C++ Dialect Options.
+ (line 56)
+* fno-default-inline <1>: Inline. (line 71)
+* fno-default-inline <2>: Optimize Options. (line 134)
+* fno-default-inline: C++ Dialect Options.
+ (line 280)
+* fno-defer-pop: Optimize Options. (line 141)
+* fno-dwarf2-cfi-asm: Debugging Options. (line 215)
+* fno-elide-constructors: C++ Dialect Options.
+ (line 87)
+* fno-enforce-eh-specs: C++ Dialect Options.
+ (line 93)
+* fno-for-scope: C++ Dialect Options.
+ (line 104)
+* fno-function-cse: Optimize Options. (line 315)
+* fno-gnu-keywords: C++ Dialect Options.
+ (line 116)
+* fno-guess-branch-probability: Optimize Options. (line 1056)
+* fno-ident: Code Gen Options. (line 155)
+* fno-implement-inlines <1>: C++ Interface. (line 75)
+* fno-implement-inlines: C++ Dialect Options.
+ (line 133)
+* fno-implicit-inline-templates: C++ Dialect Options.
+ (line 127)
+* fno-implicit-templates <1>: Template Instantiation.
+ (line 87)
+* fno-implicit-templates: C++ Dialect Options.
+ (line 121)
+* fno-inline: Optimize Options. (line 179)
+* fno-ira-share-save-slots: Optimize Options. (line 540)
+* fno-ira-share-spill-slots: Optimize Options. (line 546)
+* fno-jump-tables: Code Gen Options. (line 228)
+* fno-math-errno: Optimize Options. (line 1376)
+* fno-merge-debug-strings: Debugging Options. (line 203)
+* fno-nil-receivers: Objective-C and Objective-C++ Dialect Options.
+ (line 49)
+* fno-nonansi-builtins: C++ Dialect Options.
+ (line 144)
+* fno-operator-names: C++ Dialect Options.
+ (line 149)
+* fno-optional-diags: C++ Dialect Options.
+ (line 153)
+* fno-peephole: Optimize Options. (line 1047)
+* fno-peephole2: Optimize Options. (line 1047)
+* fno-rtti: C++ Dialect Options.
+ (line 168)
+* fno-sched-interblock: Optimize Options. (line 583)
+* fno-sched-spec: Optimize Options. (line 588)
+* fno-show-column: Preprocessor Options.
+ (line 533)
+* fno-signed-bitfields: C Dialect Options. (line 296)
+* fno-signed-zeros: Optimize Options. (line 1447)
+* fno-stack-limit: Code Gen Options. (line 396)
+* fno-threadsafe-statics: C++ Dialect Options.
+ (line 190)
+* fno-toplevel-reorder: Optimize Options. (line 1254)
+* fno-trapping-math: Optimize Options. (line 1457)
+* fno-unsigned-bitfields: C Dialect Options. (line 296)
+* fno-use-cxa-get-exception-ptr: C++ Dialect Options.
+ (line 203)
+* fno-weak: C++ Dialect Options.
+ (line 265)
+* fno-working-directory: Preprocessor Options.
+ (line 518)
+* fno-zero-initialized-in-bss: Optimize Options. (line 326)
+* fnon-call-exceptions: Code Gen Options. (line 48)
+* fobjc-call-cxx-cdtors: Objective-C and Objective-C++ Dialect Options.
+ (line 56)
+* fobjc-direct-dispatch: Objective-C and Objective-C++ Dialect Options.
+ (line 81)
+* fobjc-exceptions: Objective-C and Objective-C++ Dialect Options.
+ (line 85)
+* fobjc-gc: Objective-C and Objective-C++ Dialect Options.
+ (line 170)
+* fomit-frame-pointer: Optimize Options. (line 158)
+* fopenmp: C Dialect Options. (line 221)
+* foptimize-register-move: Optimize Options. (line 504)
+* foptimize-sibling-calls: Optimize Options. (line 174)
+* force_cpusubtype_ALL: Darwin Options. (line 138)
+* force_flat_namespace: Darwin Options. (line 199)
+* fpack-struct: Code Gen Options. (line 279)
+* fpcc-struct-return <1>: Incompatibilities. (line 170)
+* fpcc-struct-return: Code Gen Options. (line 70)
+* fpch-deps: Preprocessor Options.
+ (line 281)
+* fpch-preprocess: Preprocessor Options.
+ (line 289)
+* fpeel-loops: Optimize Options. (line 1615)
+* fpermissive: C++ Dialect Options.
+ (line 158)
+* fPIC: Code Gen Options. (line 205)
+* fpic: Code Gen Options. (line 184)
+* fPIE: Code Gen Options. (line 218)
+* fpie: Code Gen Options. (line 218)
+* fpost-ipa-mem-report: Debugging Options. (line 245)
+* fpre-ipa-mem-report: Debugging Options. (line 243)
+* fpredictive-commoning: Optimize Options. (line 1029)
+* fprefetch-loop-arrays: Optimize Options. (line 1036)
+* fpreprocessed: Preprocessor Options.
+ (line 476)
+* fprofile-arcs <1>: Other Builtins. (line 242)
+* fprofile-arcs: Debugging Options. (line 249)
+* fprofile-correction: Optimize Options. (line 1299)
+* fprofile-dir: Optimize Options. (line 1306)
+* fprofile-generate: Optimize Options. (line 1316)
+* fprofile-use: Optimize Options. (line 1329)
+* fprofile-values: Optimize Options. (line 1563)
+* frandom-string: Debugging Options. (line 819)
+* freciprocal-math: Optimize Options. (line 1426)
+* frecord-gcc-switches: Code Gen Options. (line 174)
+* freg-struct-return: Code Gen Options. (line 88)
+* fregmove: Optimize Options. (line 504)
+* frename-registers: Optimize Options. (line 1582)
+* freorder-blocks: Optimize Options. (line 1073)
+* freorder-blocks-and-partition: Optimize Options. (line 1079)
+* freorder-functions: Optimize Options. (line 1090)
+* freplace-objc-classes: Objective-C and Objective-C++ Dialect Options.
+ (line 174)
+* frepo <1>: Template Instantiation.
+ (line 62)
+* frepo: C++ Dialect Options.
+ (line 163)
+* frerun-cse-after-loop: Optimize Options. (line 393)
+* freschedule-modulo-scheduled-loops: Optimize Options. (line 652)
+* frounding-math: Optimize Options. (line 1472)
+* frtl-abstract-sequences: Optimize Options. (line 1492)
+* fsched-spec-load: Optimize Options. (line 593)
+* fsched-spec-load-dangerous: Optimize Options. (line 598)
+* fsched-stalled-insns: Optimize Options. (line 604)
+* fsched-stalled-insns-dep: Optimize Options. (line 614)
+* fsched-verbose: Debugging Options. (line 829)
+* fsched2-use-superblocks: Optimize Options. (line 624)
+* fsched2-use-traces: Optimize Options. (line 635)
+* fschedule-insns: Optimize Options. (line 564)
+* fschedule-insns2: Optimize Options. (line 574)
+* fsection-anchors: Optimize Options. (line 1678)
+* fsee: Optimize Options. (line 647)
+* fsel-sched-pipelining: Optimize Options. (line 666)
+* fsel-sched-pipelining-outer-loops: Optimize Options. (line 671)
+* fselective-scheduling: Optimize Options. (line 658)
+* fselective-scheduling2: Optimize Options. (line 662)
+* fshort-double: Code Gen Options. (line 117)
+* fshort-enums <1>: Non-bugs. (line 42)
+* fshort-enums <2>: Type Attributes. (line 113)
+* fshort-enums <3>: Structures unions enumerations and bit-fields implementation.
+ (line 43)
+* fshort-enums: Code Gen Options. (line 106)
+* fshort-wchar: Code Gen Options. (line 125)
+* fsignaling-nans: Optimize Options. (line 1499)
+* fsigned-bitfields <1>: Non-bugs. (line 57)
+* fsigned-bitfields: C Dialect Options. (line 296)
+* fsigned-char <1>: Characters implementation.
+ (line 31)
+* fsigned-char: C Dialect Options. (line 286)
+* fsingle-precision-constant: Optimize Options. (line 1514)
+* fsplit-ivs-in-unroller: Optimize Options. (line 1010)
+* fsplit-wide-types: Optimize Options. (line 368)
+* fstack-check: Code Gen Options. (line 357)
+* fstack-limit-register: Code Gen Options. (line 396)
+* fstack-limit-symbol: Code Gen Options. (line 396)
+* fstack-protector: Optimize Options. (line 1666)
+* fstack-protector-all: Optimize Options. (line 1675)
+* fstats: C++ Dialect Options.
+ (line 178)
+* fstrict-aliasing: Optimize Options. (line 1103)
+* fstrict-overflow: Optimize Options. (line 1149)
+* fsyntax-only: Warning Options. (line 14)
+* ftabstop: Preprocessor Options.
+ (line 489)
+* ftemplate-depth: C++ Dialect Options.
+ (line 183)
+* ftest-coverage: Debugging Options. (line 305)
+* fthread-jumps: Optimize Options. (line 359)
+* ftime-report: Debugging Options. (line 235)
+* ftls-model: Code Gen Options. (line 441)
+* ftracer: Optimize Options. (line 993)
+* ftrapv: Code Gen Options. (line 22)
+* ftree-builtin-call-dce: Optimize Options. (line 788)
+* ftree-ccp: Optimize Options. (line 774)
+* ftree-ch: Optimize Options. (line 808)
+* ftree-copy-prop: Optimize Options. (line 710)
+* ftree-copyrename: Optimize Options. (line 953)
+* ftree-dce: Optimize Options. (line 784)
+* ftree-dominator-opts: Optimize Options. (line 794)
+* ftree-dse: Optimize Options. (line 801)
+* ftree-fre: Optimize Options. (line 703)
+* ftree-loop-im: Optimize Options. (line 918)
+* ftree-loop-ivcanon: Optimize Options. (line 927)
+* ftree-loop-linear: Optimize Options. (line 819)
+* ftree-loop-optimize: Optimize Options. (line 815)
+* ftree-parallelize-loops: Optimize Options. (line 938)
+* ftree-pre: Optimize Options. (line 699)
+* ftree-reassoc: Optimize Options. (line 695)
+* ftree-sink: Optimize Options. (line 770)
+* ftree-sra: Optimize Options. (line 947)
+* ftree-ter: Optimize Options. (line 960)
+* ftree-vect-loop-version: Optimize Options. (line 972)
+* ftree-vectorize: Optimize Options. (line 968)
+* ftree-vectorizer-verbose: Debugging Options. (line 794)
+* ftree-vrp: Optimize Options. (line 984)
+* funit-at-a-time: Optimize Options. (line 1247)
+* funroll-all-loops: Optimize Options. (line 1004)
+* funroll-loops: Optimize Options. (line 998)
+* funsafe-loop-optimizations: Optimize Options. (line 440)
+* funsafe-math-optimizations: Optimize Options. (line 1394)
+* funsigned-bitfields <1>: Non-bugs. (line 57)
+* funsigned-bitfields <2>: Structures unions enumerations and bit-fields implementation.
+ (line 17)
+* funsigned-bitfields: C Dialect Options. (line 296)
+* funsigned-char <1>: Characters implementation.
+ (line 31)
+* funsigned-char: C Dialect Options. (line 268)
+* funswitch-loops: Optimize Options. (line 1627)
+* funwind-tables: Code Gen Options. (line 57)
+* fuse-cxa-atexit: C++ Dialect Options.
+ (line 196)
+* fvar-tracking: Debugging Options. (line 874)
+* fvariable-expansion-in-unroller: Optimize Options. (line 1024)
+* fvect-cost-model: Optimize Options. (line 981)
+* fverbose-asm: Code Gen Options. (line 165)
+* fvisibility: Code Gen Options. (line 449)
+* fvisibility-inlines-hidden: C++ Dialect Options.
+ (line 208)
+* fvisibility-ms-compat: C++ Dialect Options.
+ (line 236)
+* fvpt: Optimize Options. (line 1573)
+* fweb: Optimize Options. (line 1266)
+* fwhole-program: Optimize Options. (line 1277)
+* fwide-exec-charset: Preprocessor Options.
+ (line 500)
+* fworking-directory: Preprocessor Options.
+ (line 518)
+* fwrapv: Code Gen Options. (line 26)
+* fzero-link: Objective-C and Objective-C++ Dialect Options.
+ (line 184)
+* G <1>: System V Options. (line 10)
+* G <2>: RS/6000 and PowerPC Options.
+ (line 663)
+* G <3>: MIPS Options. (line 314)
+* G: M32R/D Options. (line 57)
+* g: Debugging Options. (line 10)
+* gcoff: Debugging Options. (line 70)
+* gdwarf-2: Debugging Options. (line 88)
+* gen-decls: Objective-C and Objective-C++ Dialect Options.
+ (line 194)
+* gfull: Darwin Options. (line 71)
+* ggdb: Debugging Options. (line 38)
+* gnu-ld: HPPA Options. (line 111)
+* gstabs: Debugging Options. (line 44)
+* gstabs+: Debugging Options. (line 64)
+* gused: Darwin Options. (line 66)
+* gvms: Debugging Options. (line 95)
+* gxcoff: Debugging Options. (line 75)
+* gxcoff+: Debugging Options. (line 80)
+* H: Preprocessor Options.
+ (line 651)
+* headerpad_max_install_names: Darwin Options. (line 199)
+* help <1>: Preprocessor Options.
+ (line 643)
+* help: Overall Options. (line 231)
+* hp-ld: HPPA Options. (line 123)
+* I <1>: Directory Options. (line 10)
+* I: Preprocessor Options.
+ (line 64)
+* I- <1>: Directory Options. (line 107)
+* I-: Preprocessor Options.
+ (line 362)
+* idirafter: Preprocessor Options.
+ (line 404)
+* iframework: Darwin Options. (line 59)
+* imacros: Preprocessor Options.
+ (line 395)
+* image_base: Darwin Options. (line 199)
+* imultilib: Preprocessor Options.
+ (line 427)
+* include: Preprocessor Options.
+ (line 384)
+* init: Darwin Options. (line 199)
+* install_name: Darwin Options. (line 199)
+* iprefix: Preprocessor Options.
+ (line 411)
+* iquote <1>: Directory Options. (line 31)
+* iquote: Preprocessor Options.
+ (line 439)
+* isysroot: Preprocessor Options.
+ (line 423)
+* isystem: Preprocessor Options.
+ (line 431)
+* iwithprefix: Preprocessor Options.
+ (line 417)
+* iwithprefixbefore: Preprocessor Options.
+ (line 417)
+* keep_private_externs: Darwin Options. (line 199)
+* L: Directory Options. (line 37)
+* l: Link Options. (line 26)
+* lobjc: Link Options. (line 53)
+* M: Preprocessor Options.
+ (line 172)
+* m1: SH Options. (line 9)
+* m10: PDP-11 Options. (line 29)
+* m128bit-long-double: i386 and x86-64 Options.
+ (line 265)
+* m16-bit: CRIS Options. (line 64)
+* m2: SH Options. (line 12)
+* m210: MCore Options. (line 43)
+* m3: SH Options. (line 18)
+* m31: S/390 and zSeries Options.
+ (line 87)
+* m32 <1>: SPARC Options. (line 191)
+* m32 <2>: RS/6000 and PowerPC Options.
+ (line 252)
+* m32: i386 and x86-64 Options.
+ (line 607)
+* m32-bit: CRIS Options. (line 64)
+* m32r: M32R/D Options. (line 15)
+* m32r2: M32R/D Options. (line 9)
+* m32rx: M32R/D Options. (line 12)
+* m340: MCore Options. (line 43)
+* m3dnow: i386 and x86-64 Options.
+ (line 435)
+* m3e: SH Options. (line 21)
+* m4: SH Options. (line 35)
+* m4-nofpu: SH Options. (line 24)
+* m4-single: SH Options. (line 31)
+* m4-single-only: SH Options. (line 27)
+* m40: PDP-11 Options. (line 23)
+* m45: PDP-11 Options. (line 26)
+* m4a: SH Options. (line 50)
+* m4a-nofpu: SH Options. (line 38)
+* m4a-single: SH Options. (line 46)
+* m4a-single-only: SH Options. (line 42)
+* m4al: SH Options. (line 53)
+* m4byte-functions: MCore Options. (line 27)
+* m5200: M680x0 Options. (line 143)
+* m5206e: M680x0 Options. (line 152)
+* m528x: M680x0 Options. (line 156)
+* m5307: M680x0 Options. (line 160)
+* m5407: M680x0 Options. (line 164)
+* m64 <1>: SPARC Options. (line 191)
+* m64 <2>: S/390 and zSeries Options.
+ (line 87)
+* m64 <3>: RS/6000 and PowerPC Options.
+ (line 252)
+* m64: i386 and x86-64 Options.
+ (line 607)
+* m68000: M680x0 Options. (line 91)
+* m68010: M680x0 Options. (line 99)
+* m68020: M680x0 Options. (line 105)
+* m68020-40: M680x0 Options. (line 174)
+* m68020-60: M680x0 Options. (line 183)
+* m68030: M680x0 Options. (line 110)
+* m68040: M680x0 Options. (line 115)
+* m68060: M680x0 Options. (line 124)
+* m6811: M68hc1x Options. (line 13)
+* m6812: M68hc1x Options. (line 18)
+* m68881: M680x0 Options. (line 193)
+* m68hc11: M68hc1x Options. (line 13)
+* m68hc12: M68hc1x Options. (line 18)
+* m68hcs12: M68hc1x Options. (line 23)
+* m68S12: M68hc1x Options. (line 23)
+* m8-bit: CRIS Options. (line 64)
+* m96bit-long-double: i386 and x86-64 Options.
+ (line 265)
+* mabi <1>: RS/6000 and PowerPC Options.
+ (line 549)
+* mabi: ARM Options. (line 10)
+* mabi-mmixware: MMIX Options. (line 20)
+* mabi=32: MIPS Options. (line 129)
+* mabi=64: MIPS Options. (line 129)
+* mabi=eabi: MIPS Options. (line 129)
+* mabi=gnu: MMIX Options. (line 20)
+* mabi=ibmlongdouble: RS/6000 and PowerPC Options.
+ (line 562)
+* mabi=ieeelongdouble: RS/6000 and PowerPC Options.
+ (line 566)
+* mabi=n32: MIPS Options. (line 129)
+* mabi=no-spe: RS/6000 and PowerPC Options.
+ (line 559)
+* mabi=o64: MIPS Options. (line 129)
+* mabi=spe: RS/6000 and PowerPC Options.
+ (line 554)
+* mabicalls: MIPS Options. (line 153)
+* mabort-on-noreturn: ARM Options. (line 149)
+* mabshi: PDP-11 Options. (line 55)
+* mac0: PDP-11 Options. (line 16)
+* macc-4: FRV Options. (line 113)
+* macc-8: FRV Options. (line 116)
+* maccumulate-outgoing-args: i386 and x86-64 Options.
+ (line 532)
+* madjust-unroll: SH Options. (line 196)
+* mads: RS/6000 and PowerPC Options.
+ (line 592)
+* maix-struct-return: RS/6000 and PowerPC Options.
+ (line 542)
+* maix32: RS/6000 and PowerPC Options.
+ (line 290)
+* maix64: RS/6000 and PowerPC Options.
+ (line 290)
+* malign-300: H8/300 Options. (line 31)
+* malign-double: i386 and x86-64 Options.
+ (line 249)
+* malign-int: M680x0 Options. (line 263)
+* malign-labels: FRV Options. (line 104)
+* malign-loops: M32R/D Options. (line 73)
+* malign-natural: RS/6000 and PowerPC Options.
+ (line 329)
+* malign-power: RS/6000 and PowerPC Options.
+ (line 329)
+* malloc-cc: FRV Options. (line 25)
+* malpha-as: DEC Alpha Options. (line 159)
+* maltivec: RS/6000 and PowerPC Options.
+ (line 183)
+* mam33: MN10300 Options. (line 17)
+* mapcs: ARM Options. (line 22)
+* mapcs-frame: ARM Options. (line 14)
+* mapp-regs <1>: V850 Options. (line 57)
+* mapp-regs: SPARC Options. (line 10)
+* march <1>: S/390 and zSeries Options.
+ (line 116)
+* march <2>: MIPS Options. (line 14)
+* march <3>: M680x0 Options. (line 12)
+* march <4>: i386 and x86-64 Options.
+ (line 148)
+* march <5>: HPPA Options. (line 9)
+* march <6>: CRIS Options. (line 10)
+* march: ARM Options. (line 112)
+* masm=DIALECT: i386 and x86-64 Options.
+ (line 205)
+* mauto-incdec: M68hc1x Options. (line 26)
+* mauto-pic: IA-64 Options. (line 50)
+* mavoid-indexed-addresses: RS/6000 and PowerPC Options.
+ (line 399)
+* mb: SH Options. (line 58)
+* mbackchain: S/390 and zSeries Options.
+ (line 35)
+* mbase-addresses: MMIX Options. (line 54)
+* mbcopy: PDP-11 Options. (line 36)
+* mbig: RS/6000 and PowerPC Options.
+ (line 474)
+* mbig-endian <1>: RS/6000 and PowerPC Options.
+ (line 474)
+* mbig-endian <2>: MCore Options. (line 39)
+* mbig-endian <3>: IA-64 Options. (line 9)
+* mbig-endian: ARM Options. (line 72)
+* mbig-switch <1>: V850 Options. (line 52)
+* mbig-switch: HPPA Options. (line 23)
+* mbigtable: SH Options. (line 74)
+* mbit-align: RS/6000 and PowerPC Options.
+ (line 428)
+* mbitfield: M680x0 Options. (line 231)
+* mbitops: SH Options. (line 78)
+* mbranch-cheap: PDP-11 Options. (line 65)
+* mbranch-cost: MIPS Options. (line 610)
+* mbranch-cost=NUMBER: M32R/D Options. (line 82)
+* mbranch-expensive: PDP-11 Options. (line 61)
+* mbranch-hints: SPU Options. (line 27)
+* mbranch-likely: MIPS Options. (line 617)
+* mbranch-predict: MMIX Options. (line 49)
+* mbss-plt: RS/6000 and PowerPC Options.
+ (line 206)
+* mbuild-constants: DEC Alpha Options. (line 142)
+* mbwx: DEC Alpha Options. (line 171)
+* mc68000: M680x0 Options. (line 91)
+* mc68020: M680x0 Options. (line 105)
+* mcall-gnu: RS/6000 and PowerPC Options.
+ (line 534)
+* mcall-linux: RS/6000 and PowerPC Options.
+ (line 530)
+* mcall-netbsd: RS/6000 and PowerPC Options.
+ (line 538)
+* mcall-prologues: AVR Options. (line 39)
+* mcall-solaris: RS/6000 and PowerPC Options.
+ (line 526)
+* mcall-sysv: RS/6000 and PowerPC Options.
+ (line 513)
+* mcall-sysv-eabi: RS/6000 and PowerPC Options.
+ (line 520)
+* mcall-sysv-noeabi: RS/6000 and PowerPC Options.
+ (line 523)
+* mcallee-super-interworking: ARM Options. (line 238)
+* mcaller-super-interworking: ARM Options. (line 244)
+* mcallgraph-data: MCore Options. (line 31)
+* mcc-init: CRIS Options. (line 41)
+* mcfv4e: M680x0 Options. (line 168)
+* mcheck-zero-division: MIPS Options. (line 425)
+* mcirrus-fix-invalid-insns: ARM Options. (line 189)
+* mcix: DEC Alpha Options. (line 171)
+* mcld: i386 and x86-64 Options.
+ (line 458)
+* mcmodel=embmedany: SPARC Options. (line 213)
+* mcmodel=kernel: i386 and x86-64 Options.
+ (line 629)
+* mcmodel=large: i386 and x86-64 Options.
+ (line 641)
+* mcmodel=medany: SPARC Options. (line 207)
+* mcmodel=medium: i386 and x86-64 Options.
+ (line 634)
+* mcmodel=medlow: SPARC Options. (line 196)
+* mcmodel=medmid: SPARC Options. (line 201)
+* mcmodel=small: i386 and x86-64 Options.
+ (line 623)
+* mcmpb: RS/6000 and PowerPC Options.
+ (line 31)
+* mcode-readable: MIPS Options. (line 385)
+* mcond-exec: FRV Options. (line 152)
+* mcond-move: FRV Options. (line 128)
+* mconsole: i386 and x86-64 Windows Options.
+ (line 9)
+* mconst-align: CRIS Options. (line 55)
+* mconst16: Xtensa Options. (line 10)
+* mconstant-gp: IA-64 Options. (line 46)
+* mcorea: Blackfin Options. (line 149)
+* mcoreb: Blackfin Options. (line 155)
+* mcpu <1>: SPARC Options. (line 96)
+* mcpu <2>: RS/6000 and PowerPC Options.
+ (line 114)
+* mcpu <3>: picoChip Options. (line 9)
+* mcpu <4>: M680x0 Options. (line 28)
+* mcpu <5>: i386 and x86-64 Options.
+ (line 153)
+* mcpu <6>: FRV Options. (line 212)
+* mcpu <7>: DEC Alpha Options. (line 223)
+* mcpu <8>: CRIS Options. (line 10)
+* mcpu <9>: ARM Options. (line 84)
+* mcpu: ARC Options. (line 23)
+* mcpu32: M680x0 Options. (line 134)
+* mcpu= <1>: M32C Options. (line 7)
+* mcpu=: Blackfin Options. (line 7)
+* mcsync-anomaly: Blackfin Options. (line 55)
+* mcx16: i386 and x86-64 Options.
+ (line 472)
+* mcygwin: i386 and x86-64 Windows Options.
+ (line 16)
+* MD: Preprocessor Options.
+ (line 261)
+* mdalign: SH Options. (line 64)
+* mdata: ARC Options. (line 30)
+* mdata-align: CRIS Options. (line 55)
+* mdebug <1>: S/390 and zSeries Options.
+ (line 112)
+* mdebug: M32R/D Options. (line 69)
+* mdec-asm: PDP-11 Options. (line 78)
+* mdisable-callt: V850 Options. (line 80)
+* mdisable-fpregs: HPPA Options. (line 33)
+* mdisable-indexing: HPPA Options. (line 40)
+* mdiv <1>: MCore Options. (line 15)
+* mdiv: M680x0 Options. (line 205)
+* mdiv=STRATEGY: SH Options. (line 141)
+* mdivide-breaks: MIPS Options. (line 431)
+* mdivide-traps: MIPS Options. (line 431)
+* mdivsi3_libfunc=NAME: SH Options. (line 182)
+* mdll: i386 and x86-64 Windows Options.
+ (line 30)
+* mdlmzb: RS/6000 and PowerPC Options.
+ (line 421)
+* mdmx: MIPS Options. (line 278)
+* mdouble: FRV Options. (line 38)
+* mdouble-float <1>: RS/6000 and PowerPC Options.
+ (line 347)
+* mdouble-float: MIPS Options. (line 236)
+* mdsp: MIPS Options. (line 255)
+* mdspr2: MIPS Options. (line 261)
+* mdual-nops: SPU Options. (line 55)
+* mdwarf2-asm: IA-64 Options. (line 79)
+* mdword: FRV Options. (line 32)
+* mdynamic-no-pic: RS/6000 and PowerPC Options.
+ (line 479)
+* meabi: RS/6000 and PowerPC Options.
+ (line 611)
+* mearly-stop-bits: IA-64 Options. (line 85)
+* meb: Score Options. (line 9)
+* mel: Score Options. (line 12)
+* melf <1>: MMIX Options. (line 44)
+* melf: CRIS Options. (line 87)
+* memb: RS/6000 and PowerPC Options.
+ (line 606)
+* membedded-data: MIPS Options. (line 372)
+* memregs=: M32C Options. (line 21)
+* mep: V850 Options. (line 16)
+* mepsilon: MMIX Options. (line 15)
+* merror-reloc: SPU Options. (line 10)
+* mesa: S/390 and zSeries Options.
+ (line 95)
+* metrax100: CRIS Options. (line 26)
+* metrax4: CRIS Options. (line 26)
+* mexplicit-relocs <1>: MIPS Options. (line 416)
+* mexplicit-relocs: DEC Alpha Options. (line 184)
+* mextern-sdata: MIPS Options. (line 334)
+* MF: Preprocessor Options.
+ (line 207)
+* mfast-fp: Blackfin Options. (line 128)
+* mfast-indirect-calls: HPPA Options. (line 52)
+* mfaster-structs: SPARC Options. (line 71)
+* mfdpic: FRV Options. (line 56)
+* mfix: DEC Alpha Options. (line 171)
+* mfix-and-continue: Darwin Options. (line 106)
+* mfix-cortex-m3-ldrd: ARC Options. (line 36)
+* mfix-r10000: MIPS Options. (line 502)
+* mfix-r4000: MIPS Options. (line 481)
+* mfix-r4400: MIPS Options. (line 495)
+* mfix-sb1: MIPS Options. (line 534)
+* mfix-vr4120: MIPS Options. (line 513)
+* mfix-vr4130: MIPS Options. (line 527)
+* mfixed-cc: FRV Options. (line 28)
+* mfixed-range <1>: SPU Options. (line 47)
+* mfixed-range <2>: SH Options. (line 189)
+* mfixed-range <3>: IA-64 Options. (line 90)
+* mfixed-range: HPPA Options. (line 59)
+* mflip-mips16: MIPS Options. (line 109)
+* mfloat-abi: ARM Options. (line 41)
+* mfloat-gprs: RS/6000 and PowerPC Options.
+ (line 235)
+* mfloat-ieee: DEC Alpha Options. (line 179)
+* mfloat-vax: DEC Alpha Options. (line 179)
+* mfloat32: PDP-11 Options. (line 52)
+* mfloat64: PDP-11 Options. (line 48)
+* mflush-func: MIPS Options. (line 601)
+* mflush-func=NAME: M32R/D Options. (line 94)
+* mflush-trap=NUMBER: M32R/D Options. (line 87)
+* mfmovd: SH Options. (line 81)
+* mfp: ARM Options. (line 124)
+* mfp-exceptions: MIPS Options. (line 628)
+* mfp-reg: DEC Alpha Options. (line 25)
+* mfp-rounding-mode: DEC Alpha Options. (line 85)
+* mfp-trap-mode: DEC Alpha Options. (line 63)
+* mfp32: MIPS Options. (line 219)
+* mfp64: MIPS Options. (line 222)
+* mfpe: ARM Options. (line 124)
+* mfpr-32: FRV Options. (line 13)
+* mfpr-64: FRV Options. (line 16)
+* mfprnd: RS/6000 and PowerPC Options.
+ (line 31)
+* mfpu <1>: SPARC Options. (line 20)
+* mfpu <2>: RS/6000 and PowerPC Options.
+ (line 355)
+* mfpu <3>: PDP-11 Options. (line 9)
+* mfpu: ARM Options. (line 124)
+* mfull-toc: RS/6000 and PowerPC Options.
+ (line 263)
+* mfused-madd <1>: Xtensa Options. (line 19)
+* mfused-madd <2>: S/390 and zSeries Options.
+ (line 137)
+* mfused-madd <3>: RS/6000 and PowerPC Options.
+ (line 408)
+* mfused-madd <4>: MIPS Options. (line 466)
+* mfused-madd: i386 and x86-64 Options.
+ (line 591)
+* mg: VAX Options. (line 17)
+* MG: Preprocessor Options.
+ (line 216)
+* mgas <1>: HPPA Options. (line 75)
+* mgas: DEC Alpha Options. (line 159)
+* mgen-cell-microcode: RS/6000 and PowerPC Options.
+ (line 194)
+* mgettrcost=NUMBER: SH Options. (line 211)
+* mglibc: GNU/Linux Options. (line 9)
+* mgnu: VAX Options. (line 13)
+* mgnu-as: IA-64 Options. (line 18)
+* mgnu-ld: IA-64 Options. (line 23)
+* mgotplt: CRIS Options. (line 81)
+* mgp32: MIPS Options. (line 213)
+* mgp64: MIPS Options. (line 216)
+* mgpopt: MIPS Options. (line 357)
+* mgpr-32: FRV Options. (line 7)
+* mgpr-64: FRV Options. (line 10)
+* mgprel-ro: FRV Options. (line 79)
+* mh: H8/300 Options. (line 14)
+* mhard-dfp <1>: S/390 and zSeries Options.
+ (line 20)
+* mhard-dfp: RS/6000 and PowerPC Options.
+ (line 31)
+* mhard-float <1>: SPARC Options. (line 20)
+* mhard-float <2>: S/390 and zSeries Options.
+ (line 11)
+* mhard-float <3>: RS/6000 and PowerPC Options.
+ (line 341)
+* mhard-float <4>: MIPS Options. (line 225)
+* mhard-float <5>: M680x0 Options. (line 193)
+* mhard-float <6>: FRV Options. (line 19)
+* mhard-float: ARM Options. (line 62)
+* mhard-quad-float: SPARC Options. (line 41)
+* mhardlit: MCore Options. (line 10)
+* mhint-max-distance: SPU Options. (line 67)
+* mhint-max-nops: SPU Options. (line 61)
+* mhitachi: SH Options. (line 84)
+* micplb: Blackfin Options. (line 168)
+* mid-shared-library: Blackfin Options. (line 76)
+* mieee <1>: SH Options. (line 99)
+* mieee: DEC Alpha Options. (line 39)
+* mieee-conformant: DEC Alpha Options. (line 134)
+* mieee-fp: i386 and x86-64 Options.
+ (line 211)
+* mieee-with-inexact: DEC Alpha Options. (line 52)
+* milp32: IA-64 Options. (line 114)
+* mimpure-text: SPARC Options. (line 81)
+* mincoming-stack-boundary: i386 and x86-64 Options.
+ (line 379)
+* mindexed-addressing: SH Options. (line 201)
+* minline-all-stringops: i386 and x86-64 Options.
+ (line 553)
+* minline-float-divide-max-throughput: IA-64 Options. (line 58)
+* minline-float-divide-min-latency: IA-64 Options. (line 54)
+* minline-ic_invalidate: SH Options. (line 106)
+* minline-int-divide-max-throughput: IA-64 Options. (line 66)
+* minline-int-divide-min-latency: IA-64 Options. (line 62)
+* minline-plt <1>: FRV Options. (line 64)
+* minline-plt: Blackfin Options. (line 133)
+* minline-sqrt-max-throughput: IA-64 Options. (line 74)
+* minline-sqrt-min-latency: IA-64 Options. (line 70)
+* minline-stringops-dynamically: i386 and x86-64 Options.
+ (line 560)
+* minmax: M68hc1x Options. (line 31)
+* minsert-sched-nops: RS/6000 and PowerPC Options.
+ (line 501)
+* mint16: PDP-11 Options. (line 40)
+* mint32 <1>: PDP-11 Options. (line 44)
+* mint32: H8/300 Options. (line 28)
+* mint8: AVR Options. (line 51)
+* minterlink-mips16: MIPS Options. (line 116)
+* minvalid-symbols: SH Options. (line 234)
+* mips1: MIPS Options. (line 76)
+* mips16: MIPS Options. (line 101)
+* mips2: MIPS Options. (line 79)
+* mips3: MIPS Options. (line 82)
+* mips32: MIPS Options. (line 88)
+* mips32r2: MIPS Options. (line 91)
+* mips3d: MIPS Options. (line 284)
+* mips4: MIPS Options. (line 85)
+* mips64: MIPS Options. (line 94)
+* mips64r2: MIPS Options. (line 97)
+* misel: RS/6000 and PowerPC Options.
+ (line 212)
+* misize: SH Options. (line 118)
+* missue-rate=NUMBER: M32R/D Options. (line 79)
+* mjump-in-delay: HPPA Options. (line 28)
+* mkernel: Darwin Options. (line 84)
+* mknuthdiv: MMIX Options. (line 33)
+* ml: SH Options. (line 61)
+* mlarge-data: DEC Alpha Options. (line 195)
+* mlarge-data-threshold=NUMBER: i386 and x86-64 Options.
+ (line 291)
+* mlarge-mem: SPU Options. (line 35)
+* mlarge-text: DEC Alpha Options. (line 213)
+* mleaf-id-shared-library: Blackfin Options. (line 87)
+* mlibfuncs: MMIX Options. (line 10)
+* mlibrary-pic: FRV Options. (line 110)
+* mlinked-fp: FRV Options. (line 94)
+* mlinker-opt: HPPA Options. (line 85)
+* mlinux: CRIS Options. (line 91)
+* mlittle: RS/6000 and PowerPC Options.
+ (line 468)
+* mlittle-endian <1>: SPARC Options. (line 185)
+* mlittle-endian <2>: RS/6000 and PowerPC Options.
+ (line 468)
+* mlittle-endian <3>: MCore Options. (line 39)
+* mlittle-endian <4>: IA-64 Options. (line 13)
+* mlittle-endian: ARM Options. (line 68)
+* mllsc: MIPS Options. (line 241)
+* mlocal-sdata: MIPS Options. (line 322)
+* mlong-calls <1>: V850 Options. (line 10)
+* mlong-calls <2>: MIPS Options. (line 452)
+* mlong-calls <3>: M68hc1x Options. (line 35)
+* mlong-calls <4>: FRV Options. (line 99)
+* mlong-calls <5>: Blackfin Options. (line 116)
+* mlong-calls: ARM Options. (line 154)
+* mlong-double-128: S/390 and zSeries Options.
+ (line 29)
+* mlong-double-64: S/390 and zSeries Options.
+ (line 29)
+* mlong-load-store: HPPA Options. (line 66)
+* mlong32: MIPS Options. (line 297)
+* mlong64: MIPS Options. (line 292)
+* mlongcall: RS/6000 and PowerPC Options.
+ (line 677)
+* mlongcalls: Xtensa Options. (line 67)
+* mlow-64k: Blackfin Options. (line 65)
+* mlp64: IA-64 Options. (line 114)
+* MM: Preprocessor Options.
+ (line 197)
+* mmac <1>: Score Options. (line 21)
+* mmac: CRX Options. (line 9)
+* mmad: MIPS Options. (line 461)
+* mmangle-cpu: ARC Options. (line 15)
+* mmax: DEC Alpha Options. (line 171)
+* mmax-stack-frame: CRIS Options. (line 22)
+* mmcu: AVR Options. (line 9)
+* MMD: Preprocessor Options.
+ (line 277)
+* mmedia: FRV Options. (line 44)
+* mmemcpy: MIPS Options. (line 446)
+* mmemory-latency: DEC Alpha Options. (line 276)
+* mmfcrf: RS/6000 and PowerPC Options.
+ (line 31)
+* mmfpgpr: RS/6000 and PowerPC Options.
+ (line 31)
+* mminimal-toc: RS/6000 and PowerPC Options.
+ (line 263)
+* mmmx: i386 and x86-64 Options.
+ (line 435)
+* mmodel=large: M32R/D Options. (line 33)
+* mmodel=medium: M32R/D Options. (line 27)
+* mmodel=small: M32R/D Options. (line 18)
+* mmt: MIPS Options. (line 289)
+* mmul-bug-workaround: CRIS Options. (line 31)
+* mmuladd: FRV Options. (line 50)
+* mmulhw: RS/6000 and PowerPC Options.
+ (line 414)
+* mmult-bug: MN10300 Options. (line 9)
+* mmulti-cond-exec: FRV Options. (line 176)
+* mmulticore: Blackfin Options. (line 137)
+* mmultiple: RS/6000 and PowerPC Options.
+ (line 366)
+* mmvcle: S/390 and zSeries Options.
+ (line 105)
+* mmvme: RS/6000 and PowerPC Options.
+ (line 587)
+* mn: H8/300 Options. (line 20)
+* mnested-cond-exec: FRV Options. (line 189)
+* mnew-mnemonics: RS/6000 and PowerPC Options.
+ (line 99)
+* mnhwloop: Score Options. (line 15)
+* mno-3dnow: i386 and x86-64 Options.
+ (line 435)
+* mno-4byte-functions: MCore Options. (line 27)
+* mno-abicalls: MIPS Options. (line 153)
+* mno-abshi: PDP-11 Options. (line 58)
+* mno-ac0: PDP-11 Options. (line 20)
+* mno-align-double: i386 and x86-64 Options.
+ (line 249)
+* mno-align-int: M680x0 Options. (line 263)
+* mno-align-loops: M32R/D Options. (line 76)
+* mno-align-stringops: i386 and x86-64 Options.
+ (line 548)
+* mno-altivec: RS/6000 and PowerPC Options.
+ (line 183)
+* mno-am33: MN10300 Options. (line 20)
+* mno-app-regs <1>: V850 Options. (line 61)
+* mno-app-regs: SPARC Options. (line 10)
+* mno-avoid-indexed-addresses: RS/6000 and PowerPC Options.
+ (line 399)
+* mno-backchain: S/390 and zSeries Options.
+ (line 35)
+* mno-base-addresses: MMIX Options. (line 54)
+* mno-bit-align: RS/6000 and PowerPC Options.
+ (line 428)
+* mno-bitfield: M680x0 Options. (line 227)
+* mno-branch-likely: MIPS Options. (line 617)
+* mno-branch-predict: MMIX Options. (line 49)
+* mno-bwx: DEC Alpha Options. (line 171)
+* mno-callgraph-data: MCore Options. (line 31)
+* mno-check-zero-division: MIPS Options. (line 425)
+* mno-cirrus-fix-invalid-insns: ARM Options. (line 189)
+* mno-cix: DEC Alpha Options. (line 171)
+* mno-cmpb: RS/6000 and PowerPC Options.
+ (line 31)
+* mno-cond-exec: FRV Options. (line 158)
+* mno-cond-move: FRV Options. (line 134)
+* mno-const-align: CRIS Options. (line 55)
+* mno-const16: Xtensa Options. (line 10)
+* mno-crt0: MN10300 Options. (line 31)
+* mno-csync-anomaly: Blackfin Options. (line 61)
+* mno-cygwin: i386 and x86-64 Windows Options.
+ (line 23)
+* mno-data-align: CRIS Options. (line 55)
+* mno-debug: S/390 and zSeries Options.
+ (line 112)
+* mno-div <1>: MCore Options. (line 15)
+* mno-div: M680x0 Options. (line 205)
+* mno-dlmzb: RS/6000 and PowerPC Options.
+ (line 421)
+* mno-double: FRV Options. (line 41)
+* mno-dsp: MIPS Options. (line 255)
+* mno-dspr2: MIPS Options. (line 261)
+* mno-dwarf2-asm: IA-64 Options. (line 79)
+* mno-dword: FRV Options. (line 35)
+* mno-eabi: RS/6000 and PowerPC Options.
+ (line 611)
+* mno-early-stop-bits: IA-64 Options. (line 85)
+* mno-eflags: FRV Options. (line 125)
+* mno-embedded-data: MIPS Options. (line 372)
+* mno-ep: V850 Options. (line 16)
+* mno-epsilon: MMIX Options. (line 15)
+* mno-explicit-relocs <1>: MIPS Options. (line 416)
+* mno-explicit-relocs: DEC Alpha Options. (line 184)
+* mno-extern-sdata: MIPS Options. (line 334)
+* mno-fancy-math-387: i386 and x86-64 Options.
+ (line 238)
+* mno-faster-structs: SPARC Options. (line 71)
+* mno-fix: DEC Alpha Options. (line 171)
+* mno-fix-r10000: MIPS Options. (line 502)
+* mno-fix-r4000: MIPS Options. (line 481)
+* mno-fix-r4400: MIPS Options. (line 495)
+* mno-float32: PDP-11 Options. (line 48)
+* mno-float64: PDP-11 Options. (line 52)
+* mno-flush-func: M32R/D Options. (line 99)
+* mno-flush-trap: M32R/D Options. (line 91)
+* mno-fp-in-toc: RS/6000 and PowerPC Options.
+ (line 263)
+* mno-fp-regs: DEC Alpha Options. (line 25)
+* mno-fp-ret-in-387: i386 and x86-64 Options.
+ (line 228)
+* mno-fprnd: RS/6000 and PowerPC Options.
+ (line 31)
+* mno-fpu: SPARC Options. (line 25)
+* mno-fused-madd <1>: Xtensa Options. (line 19)
+* mno-fused-madd <2>: S/390 and zSeries Options.
+ (line 137)
+* mno-fused-madd <3>: RS/6000 and PowerPC Options.
+ (line 408)
+* mno-fused-madd: MIPS Options. (line 466)
+* mno-gnu-as: IA-64 Options. (line 18)
+* mno-gnu-ld: IA-64 Options. (line 23)
+* mno-gotplt: CRIS Options. (line 81)
+* mno-gpopt: MIPS Options. (line 357)
+* mno-hard-dfp <1>: S/390 and zSeries Options.
+ (line 20)
+* mno-hard-dfp: RS/6000 and PowerPC Options.
+ (line 31)
+* mno-hardlit: MCore Options. (line 10)
+* mno-id-shared-library: Blackfin Options. (line 83)
+* mno-ieee-fp: i386 and x86-64 Options.
+ (line 211)
+* mno-int16: PDP-11 Options. (line 44)
+* mno-int32: PDP-11 Options. (line 40)
+* mno-interlink-mips16: MIPS Options. (line 116)
+* mno-interrupts: AVR Options. (line 35)
+* mno-isel: RS/6000 and PowerPC Options.
+ (line 212)
+* mno-knuthdiv: MMIX Options. (line 33)
+* mno-leaf-id-shared-library: Blackfin Options. (line 93)
+* mno-libfuncs: MMIX Options. (line 10)
+* mno-llsc: MIPS Options. (line 241)
+* mno-local-sdata: MIPS Options. (line 322)
+* mno-long-calls <1>: V850 Options. (line 10)
+* mno-long-calls <2>: MIPS Options. (line 452)
+* mno-long-calls <3>: M68hc1x Options. (line 35)
+* mno-long-calls <4>: HPPA Options. (line 136)
+* mno-long-calls <5>: Blackfin Options. (line 116)
+* mno-long-calls: ARM Options. (line 154)
+* mno-longcall: RS/6000 and PowerPC Options.
+ (line 677)
+* mno-longcalls: Xtensa Options. (line 67)
+* mno-low-64k: Blackfin Options. (line 69)
+* mno-lsim: FR30 Options. (line 14)
+* mno-mad: MIPS Options. (line 461)
+* mno-max: DEC Alpha Options. (line 171)
+* mno-mdmx: MIPS Options. (line 278)
+* mno-media: FRV Options. (line 47)
+* mno-memcpy: MIPS Options. (line 446)
+* mno-mfcrf: RS/6000 and PowerPC Options.
+ (line 31)
+* mno-mfpgpr: RS/6000 and PowerPC Options.
+ (line 31)
+* mno-mips16: MIPS Options. (line 101)
+* mno-mips3d: MIPS Options. (line 284)
+* mno-mmx: i386 and x86-64 Options.
+ (line 435)
+* mno-mt: MIPS Options. (line 289)
+* mno-mul-bug-workaround: CRIS Options. (line 31)
+* mno-muladd: FRV Options. (line 53)
+* mno-mulhw: RS/6000 and PowerPC Options.
+ (line 414)
+* mno-mult-bug: MN10300 Options. (line 13)
+* mno-multi-cond-exec: FRV Options. (line 183)
+* mno-multiple: RS/6000 and PowerPC Options.
+ (line 366)
+* mno-mvcle: S/390 and zSeries Options.
+ (line 105)
+* mno-nested-cond-exec: FRV Options. (line 195)
+* mno-optimize-membar: FRV Options. (line 205)
+* mno-pack: FRV Options. (line 122)
+* mno-packed-stack: S/390 and zSeries Options.
+ (line 54)
+* mno-paired: RS/6000 and PowerPC Options.
+ (line 226)
+* mno-paired-single: MIPS Options. (line 272)
+* mno-pic: IA-64 Options. (line 26)
+* mno-plt: MIPS Options. (line 180)
+* mno-popcntb: RS/6000 and PowerPC Options.
+ (line 31)
+* mno-power: RS/6000 and PowerPC Options.
+ (line 31)
+* mno-power2: RS/6000 and PowerPC Options.
+ (line 31)
+* mno-powerpc: RS/6000 and PowerPC Options.
+ (line 31)
+* mno-powerpc-gfxopt: RS/6000 and PowerPC Options.
+ (line 31)
+* mno-powerpc-gpopt: RS/6000 and PowerPC Options.
+ (line 31)
+* mno-powerpc64: RS/6000 and PowerPC Options.
+ (line 31)
+* mno-prolog-function: V850 Options. (line 23)
+* mno-prologue-epilogue: CRIS Options. (line 71)
+* mno-prototype: RS/6000 and PowerPC Options.
+ (line 571)
+* mno-push-args: i386 and x86-64 Options.
+ (line 525)
+* mno-register-names: IA-64 Options. (line 37)
+* mno-regnames: RS/6000 and PowerPC Options.
+ (line 671)
+* mno-relax-immediate: MCore Options. (line 19)
+* mno-relocatable: RS/6000 and PowerPC Options.
+ (line 445)
+* mno-relocatable-lib: RS/6000 and PowerPC Options.
+ (line 453)
+* mno-rtd: M680x0 Options. (line 258)
+* mno-scc: FRV Options. (line 146)
+* mno-sched-ar-data-spec: IA-64 Options. (line 128)
+* mno-sched-ar-in-data-spec: IA-64 Options. (line 149)
+* mno-sched-br-data-spec: IA-64 Options. (line 121)
+* mno-sched-br-in-data-spec: IA-64 Options. (line 142)
+* mno-sched-control-ldc: IA-64 Options. (line 168)
+* mno-sched-control-spec: IA-64 Options. (line 135)
+* mno-sched-count-spec-in-critical-path: IA-64 Options. (line 194)
+* mno-sched-in-control-spec: IA-64 Options. (line 156)
+* mno-sched-ldc: IA-64 Options. (line 162)
+* mno-sched-prefer-non-control-spec-insns: IA-64 Options. (line 187)
+* mno-sched-prefer-non-data-spec-insns: IA-64 Options. (line 180)
+* mno-sched-prolog: ARM Options. (line 32)
+* mno-sched-spec-verbose: IA-64 Options. (line 176)
+* mno-sdata <1>: RS/6000 and PowerPC Options.
+ (line 658)
+* mno-sdata: IA-64 Options. (line 42)
+* mno-sep-data: Blackfin Options. (line 111)
+* mno-serialize-volatile: Xtensa Options. (line 35)
+* mno-short: M680x0 Options. (line 222)
+* mno-side-effects: CRIS Options. (line 46)
+* mno-single-exit: MMIX Options. (line 66)
+* mno-slow-bytes: MCore Options. (line 35)
+* mno-small-exec: S/390 and zSeries Options.
+ (line 80)
+* mno-smartmips: MIPS Options. (line 268)
+* mno-soft-float: DEC Alpha Options. (line 10)
+* mno-space-regs: HPPA Options. (line 45)
+* mno-spe: RS/6000 and PowerPC Options.
+ (line 221)
+* mno-specld-anomaly: Blackfin Options. (line 51)
+* mno-split: PDP-11 Options. (line 71)
+* mno-split-addresses: MIPS Options. (line 410)
+* mno-sse: i386 and x86-64 Options.
+ (line 435)
+* mno-stack-align: CRIS Options. (line 55)
+* mno-stack-bias: SPARC Options. (line 222)
+* mno-strict-align <1>: RS/6000 and PowerPC Options.
+ (line 440)
+* mno-strict-align: M680x0 Options. (line 283)
+* mno-string: RS/6000 and PowerPC Options.
+ (line 377)
+* mno-sum-in-toc: RS/6000 and PowerPC Options.
+ (line 263)
+* mno-swdiv: RS/6000 and PowerPC Options.
+ (line 173)
+* mno-sym32: MIPS Options. (line 307)
+* mno-tablejump: AVR Options. (line 43)
+* mno-target-align: Xtensa Options. (line 54)
+* mno-text-section-literals: Xtensa Options. (line 42)
+* mno-toc: RS/6000 and PowerPC Options.
+ (line 462)
+* mno-toplevel-symbols: MMIX Options. (line 40)
+* mno-tpf-trace: S/390 and zSeries Options.
+ (line 131)
+* mno-unaligned-doubles: SPARC Options. (line 59)
+* mno-uninit-const-in-rodata: MIPS Options. (line 380)
+* mno-update: RS/6000 and PowerPC Options.
+ (line 388)
+* mno-v8plus: SPARC Options. (line 170)
+* mno-vis: SPARC Options. (line 177)
+* mno-vliw-branch: FRV Options. (line 170)
+* mno-volatile-asm-stop: IA-64 Options. (line 32)
+* mno-vrsave: RS/6000 and PowerPC Options.
+ (line 191)
+* mno-wide-bitfields: MCore Options. (line 23)
+* mno-xgot <1>: MIPS Options. (line 190)
+* mno-xgot: M680x0 Options. (line 315)
+* mno-xl-compat: RS/6000 and PowerPC Options.
+ (line 298)
+* mno-zero-extend: MMIX Options. (line 27)
+* mnobitfield: M680x0 Options. (line 227)
+* mnomacsave: SH Options. (line 95)
+* mnominmax: M68hc1x Options. (line 31)
+* mnop-fun-dllimport: i386 and x86-64 Windows Options.
+ (line 36)
+* mold-mnemonics: RS/6000 and PowerPC Options.
+ (line 99)
+* momit-leaf-frame-pointer <1>: i386 and x86-64 Options.
+ (line 573)
+* momit-leaf-frame-pointer: Blackfin Options. (line 39)
+* mone-byte-bool: Darwin Options. (line 92)
+* moptimize-membar: FRV Options. (line 201)
+* MP: Preprocessor Options.
+ (line 226)
+* mpa-risc-1-0: HPPA Options. (line 19)
+* mpa-risc-1-1: HPPA Options. (line 19)
+* mpa-risc-2-0: HPPA Options. (line 19)
+* mpack: FRV Options. (line 119)
+* mpacked-stack: S/390 and zSeries Options.
+ (line 54)
+* mpadstruct: SH Options. (line 121)
+* mpaired: RS/6000 and PowerPC Options.
+ (line 226)
+* mpaired-single: MIPS Options. (line 272)
+* mpc32: i386 and x86-64 Options.
+ (line 344)
+* mpc64: i386 and x86-64 Options.
+ (line 344)
+* mpc80: i386 and x86-64 Options.
+ (line 344)
+* mpcrel: M680x0 Options. (line 275)
+* mpdebug: CRIS Options. (line 35)
+* mpe: RS/6000 and PowerPC Options.
+ (line 318)
+* mpic-register: ARM Options. (line 185)
+* mplt: MIPS Options. (line 180)
+* mpoke-function-name: ARM Options. (line 199)
+* mpopcntb: RS/6000 and PowerPC Options.
+ (line 31)
+* mportable-runtime: HPPA Options. (line 71)
+* mpower: RS/6000 and PowerPC Options.
+ (line 31)
+* mpower2: RS/6000 and PowerPC Options.
+ (line 31)
+* mpowerpc: RS/6000 and PowerPC Options.
+ (line 31)
+* mpowerpc-gfxopt: RS/6000 and PowerPC Options.
+ (line 31)
+* mpowerpc-gpopt: RS/6000 and PowerPC Options.
+ (line 31)
+* mpowerpc64: RS/6000 and PowerPC Options.
+ (line 31)
+* mprefergot: SH Options. (line 128)
+* mpreferred-stack-boundary: i386 and x86-64 Options.
+ (line 374)
+* mprioritize-restricted-insns: RS/6000 and PowerPC Options.
+ (line 485)
+* mprolog-function: V850 Options. (line 23)
+* mprologue-epilogue: CRIS Options. (line 71)
+* mprototype: RS/6000 and PowerPC Options.
+ (line 571)
+* mpt-fixed: SH Options. (line 215)
+* mpush-args <1>: i386 and x86-64 Options.
+ (line 525)
+* mpush-args: CRX Options. (line 13)
+* MQ: Preprocessor Options.
+ (line 252)
+* mr10k-cache-barrier: MIPS Options. (line 539)
+* mrecip: i386 and x86-64 Options.
+ (line 490)
+* mregister-names: IA-64 Options. (line 37)
+* mregnames: RS/6000 and PowerPC Options.
+ (line 671)
+* mregparm: i386 and x86-64 Options.
+ (line 321)
+* mrelax <1>: SH Options. (line 70)
+* mrelax <2>: MN10300 Options. (line 34)
+* mrelax: H8/300 Options. (line 9)
+* mrelax-immediate: MCore Options. (line 19)
+* mrelocatable: RS/6000 and PowerPC Options.
+ (line 445)
+* mrelocatable-lib: RS/6000 and PowerPC Options.
+ (line 453)
+* mreturn-pointer-on-d0: MN10300 Options. (line 24)
+* mrodata: ARC Options. (line 30)
+* mrtd <1>: Function Attributes.
+ (line 170)
+* mrtd <2>: M680x0 Options. (line 236)
+* mrtd: i386 and x86-64 Options.
+ (line 297)
+* mrtp: VxWorks Options. (line 11)
+* ms: H8/300 Options. (line 17)
+* ms2600: H8/300 Options. (line 24)
+* msafe-dma: SPU Options. (line 17)
+* msafe-hints: SPU Options. (line 72)
+* msahf: i386 and x86-64 Options.
+ (line 480)
+* mscc: FRV Options. (line 140)
+* msched-ar-data-spec: IA-64 Options. (line 128)
+* msched-ar-in-data-spec: IA-64 Options. (line 149)
+* msched-br-data-spec: IA-64 Options. (line 121)
+* msched-br-in-data-spec: IA-64 Options. (line 142)
+* msched-control-ldc: IA-64 Options. (line 168)
+* msched-control-spec: IA-64 Options. (line 135)
+* msched-costly-dep: RS/6000 and PowerPC Options.
+ (line 492)
+* msched-count-spec-in-critical-path: IA-64 Options. (line 194)
+* msched-in-control-spec: IA-64 Options. (line 156)
+* msched-ldc: IA-64 Options. (line 162)
+* msched-prefer-non-control-spec-insns: IA-64 Options. (line 187)
+* msched-prefer-non-data-spec-insns: IA-64 Options. (line 180)
+* msched-spec-verbose: IA-64 Options. (line 176)
+* mschedule: HPPA Options. (line 78)
+* mscore5: Score Options. (line 25)
+* mscore5u: Score Options. (line 28)
+* mscore7: Score Options. (line 31)
+* mscore7d: Score Options. (line 34)
+* msda: V850 Options. (line 40)
+* msdata <1>: RS/6000 and PowerPC Options.
+ (line 645)
+* msdata: IA-64 Options. (line 42)
+* msdata=data: RS/6000 and PowerPC Options.
+ (line 650)
+* msdata=default: RS/6000 and PowerPC Options.
+ (line 645)
+* msdata=eabi: RS/6000 and PowerPC Options.
+ (line 625)
+* msdata=none <1>: RS/6000 and PowerPC Options.
+ (line 658)
+* msdata=none: M32R/D Options. (line 40)
+* msdata=sdata: M32R/D Options. (line 49)
+* msdata=sysv: RS/6000 and PowerPC Options.
+ (line 636)
+* msdata=use: M32R/D Options. (line 53)
+* msdram: Blackfin Options. (line 162)
+* msecure-plt: RS/6000 and PowerPC Options.
+ (line 201)
+* msep-data: Blackfin Options. (line 105)
+* mserialize-volatile: Xtensa Options. (line 35)
+* mshared-library-id: Blackfin Options. (line 98)
+* mshort <1>: M68hc1x Options. (line 40)
+* mshort: M680x0 Options. (line 216)
+* msim <1>: Xstormy16 Options. (line 9)
+* msim <2>: RS/6000 and PowerPC Options.
+ (line 581)
+* msim <3>: M32C Options. (line 13)
+* msim: Blackfin Options. (line 32)
+* msimple-fpu: RS/6000 and PowerPC Options.
+ (line 351)
+* msingle-exit: MMIX Options. (line 66)
+* msingle-float <1>: RS/6000 and PowerPC Options.
+ (line 347)
+* msingle-float: MIPS Options. (line 232)
+* msingle-pic-base: ARM Options. (line 179)
+* msio: HPPA Options. (line 105)
+* msize: AVR Options. (line 32)
+* mslow-bytes: MCore Options. (line 35)
+* msmall-data: DEC Alpha Options. (line 195)
+* msmall-exec: S/390 and zSeries Options.
+ (line 80)
+* msmall-mem: SPU Options. (line 35)
+* msmall-model: FR30 Options. (line 9)
+* msmall-text: DEC Alpha Options. (line 213)
+* msmartmips: MIPS Options. (line 268)
+* msoft-float <1>: SPARC Options. (line 25)
+* msoft-float <2>: S/390 and zSeries Options.
+ (line 11)
+* msoft-float <3>: RS/6000 and PowerPC Options.
+ (line 341)
+* msoft-float <4>: PDP-11 Options. (line 13)
+* msoft-float <5>: MIPS Options. (line 228)
+* msoft-float <6>: M680x0 Options. (line 199)
+* msoft-float <7>: i386 and x86-64 Options.
+ (line 216)
+* msoft-float <8>: HPPA Options. (line 91)
+* msoft-float <9>: FRV Options. (line 22)
+* msoft-float <10>: DEC Alpha Options. (line 10)
+* msoft-float: ARM Options. (line 65)
+* msoft-quad-float: SPARC Options. (line 45)
+* msoft-reg-count: M68hc1x Options. (line 43)
+* mspace <1>: V850 Options. (line 30)
+* mspace: SH Options. (line 125)
+* mspe: RS/6000 and PowerPC Options.
+ (line 221)
+* mspecld-anomaly: Blackfin Options. (line 46)
+* msplit: PDP-11 Options. (line 68)
+* msplit-addresses: MIPS Options. (line 410)
+* msse: i386 and x86-64 Options.
+ (line 435)
+* msse2avx: i386 and x86-64 Options.
+ (line 599)
+* msseregparm: i386 and x86-64 Options.
+ (line 332)
+* mstack-align: CRIS Options. (line 55)
+* mstack-bias: SPARC Options. (line 222)
+* mstack-check-l1: Blackfin Options. (line 72)
+* mstack-guard: S/390 and zSeries Options.
+ (line 156)
+* mstack-increment: MCore Options. (line 50)
+* mstack-size: S/390 and zSeries Options.
+ (line 156)
+* mstackrealign: i386 and x86-64 Options.
+ (line 365)
+* mstdmain: SPU Options. (line 40)
+* mstrict-align <1>: RS/6000 and PowerPC Options.
+ (line 440)
+* mstrict-align: M680x0 Options. (line 283)
+* mstring: RS/6000 and PowerPC Options.
+ (line 377)
+* mstringop-strategy=ALG: i386 and x86-64 Options.
+ (line 565)
+* mstructure-size-boundary: ARM Options. (line 134)
+* msvr4-struct-return: RS/6000 and PowerPC Options.
+ (line 545)
+* mswdiv: RS/6000 and PowerPC Options.
+ (line 173)
+* msym32: MIPS Options. (line 307)
+* mt: IA-64 Options. (line 106)
+* MT: Preprocessor Options.
+ (line 238)
+* mtarget-align: Xtensa Options. (line 54)
+* mtda: V850 Options. (line 34)
+* mtext: ARC Options. (line 30)
+* mtext-section-literals: Xtensa Options. (line 42)
+* mthread: i386 and x86-64 Windows Options.
+ (line 40)
+* mthreads: i386 and x86-64 Options.
+ (line 540)
+* mthumb: ARM Options. (line 220)
+* mthumb-interwork: ARM Options. (line 25)
+* mtiny-stack: AVR Options. (line 48)
+* mtls-direct-seg-refs: i386 and x86-64 Options.
+ (line 581)
+* mtls-size: IA-64 Options. (line 97)
+* mtoc: RS/6000 and PowerPC Options.
+ (line 462)
+* mtomcat-stats: FRV Options. (line 209)
+* mtoplevel-symbols: MMIX Options. (line 40)
+* mtp: ARM Options. (line 250)
+* mtpcs-frame: ARM Options. (line 226)
+* mtpcs-leaf-frame: ARM Options. (line 232)
+* mtpf-trace: S/390 and zSeries Options.
+ (line 131)
+* mtrap-precision: DEC Alpha Options. (line 109)
+* mtune <1>: SPARC Options. (line 158)
+* mtune <2>: S/390 and zSeries Options.
+ (line 124)
+* mtune <3>: RS/6000 and PowerPC Options.
+ (line 163)
+* mtune <4>: MIPS Options. (line 61)
+* mtune <5>: M680x0 Options. (line 66)
+* mtune <6>: IA-64 Options. (line 101)
+* mtune <7>: i386 and x86-64 Options.
+ (line 10)
+* mtune <8>: DEC Alpha Options. (line 267)
+* mtune <9>: CRIS Options. (line 16)
+* mtune: ARM Options. (line 102)
+* muclibc: GNU/Linux Options. (line 13)
+* muls: Score Options. (line 18)
+* multcost=NUMBER: SH Options. (line 138)
+* multi_module: Darwin Options. (line 199)
+* multilib-library-pic: FRV Options. (line 89)
+* multiply_defined: Darwin Options. (line 199)
+* multiply_defined_unused: Darwin Options. (line 199)
+* munaligned-doubles: SPARC Options. (line 59)
+* muninit-const-in-rodata: MIPS Options. (line 380)
+* munix: VAX Options. (line 9)
+* munix-asm: PDP-11 Options. (line 74)
+* munsafe-dma: SPU Options. (line 17)
+* mupdate: RS/6000 and PowerPC Options.
+ (line 388)
+* musermode: SH Options. (line 133)
+* mv850: V850 Options. (line 49)
+* mv850e: V850 Options. (line 69)
+* mv850e1: V850 Options. (line 64)
+* mv8plus: SPARC Options. (line 170)
+* mveclibabi: i386 and x86-64 Options.
+ (line 503)
+* mvis: SPARC Options. (line 177)
+* mvliw-branch: FRV Options. (line 164)
+* mvms-return-codes: DEC Alpha/VMS Options.
+ (line 9)
+* mvolatile-asm-stop: IA-64 Options. (line 32)
+* mvr4130-align: MIPS Options. (line 638)
+* mvrsave: RS/6000 and PowerPC Options.
+ (line 191)
+* mvxworks: RS/6000 and PowerPC Options.
+ (line 602)
+* mwarn-cell-microcode: RS/6000 and PowerPC Options.
+ (line 197)
+* mwarn-dynamicstack: S/390 and zSeries Options.
+ (line 150)
+* mwarn-framesize: S/390 and zSeries Options.
+ (line 142)
+* mwarn-reloc: SPU Options. (line 10)
+* mwide-bitfields: MCore Options. (line 23)
+* mwin32: i386 and x86-64 Windows Options.
+ (line 44)
+* mwindows: i386 and x86-64 Windows Options.
+ (line 50)
+* mword-relocations: ARM Options. (line 258)
+* mwords-little-endian: ARM Options. (line 76)
+* mxgot <1>: MIPS Options. (line 190)
+* mxgot: M680x0 Options. (line 315)
+* mxilinx-fpu: RS/6000 and PowerPC Options.
+ (line 361)
+* mxl-compat: RS/6000 and PowerPC Options.
+ (line 298)
+* myellowknife: RS/6000 and PowerPC Options.
+ (line 597)
+* mzarch: S/390 and zSeries Options.
+ (line 95)
+* mzda: V850 Options. (line 45)
+* mzero-extend: MMIX Options. (line 27)
+* no-integrated-cpp: C Dialect Options. (line 240)
+* no-lsim: MCore Options. (line 46)
+* no-red-zone: i386 and x86-64 Options.
+ (line 615)
+* no_dead_strip_inits_and_terms: Darwin Options. (line 199)
+* noall_load: Darwin Options. (line 199)
+* nocpp: MIPS Options. (line 476)
+* nodefaultlibs: Link Options. (line 62)
+* nofixprebinding: Darwin Options. (line 199)
+* nolibdld: HPPA Options. (line 188)
+* nomultidefs: Darwin Options. (line 199)
+* non-static: VxWorks Options. (line 16)
+* noprebind: Darwin Options. (line 199)
+* noseglinkedit: Darwin Options. (line 199)
+* nostartfiles: Link Options. (line 57)
+* nostdinc: Preprocessor Options.
+ (line 374)
+* nostdinc++ <1>: Preprocessor Options.
+ (line 379)
+* nostdinc++: C++ Dialect Options.
+ (line 272)
+* nostdlib: Link Options. (line 71)
+* o: Preprocessor Options.
+ (line 74)
+* O: Optimize Options. (line 29)
+* o: Overall Options. (line 187)
+* O0: Optimize Options. (line 106)
+* O1: Optimize Options. (line 29)
+* O2: Optimize Options. (line 67)
+* O3: Optimize Options. (line 100)
+* Os: Optimize Options. (line 110)
+* P: Preprocessor Options.
+ (line 590)
+* p: Debugging Options. (line 219)
+* pagezero_size: Darwin Options. (line 199)
+* param: Optimize Options. (line 1702)
+* pass-exit-codes: Overall Options. (line 145)
+* pedantic <1>: Warnings and Errors.
+ (line 25)
+* pedantic <2>: Alternate Keywords. (line 29)
+* pedantic <3>: C Extensions. (line 6)
+* pedantic <4>: Preprocessor Options.
+ (line 162)
+* pedantic <5>: Warning Options. (line 53)
+* pedantic: Standards. (line 16)
+* pedantic-errors <1>: Warnings and Errors.
+ (line 25)
+* pedantic-errors <2>: Non-bugs. (line 216)
+* pedantic-errors <3>: Preprocessor Options.
+ (line 167)
+* pedantic-errors <4>: Warning Options. (line 95)
+* pedantic-errors: Standards. (line 16)
+* pg: Debugging Options. (line 225)
+* pie: Link Options. (line 92)
+* pipe: Overall Options. (line 209)
+* prebind: Darwin Options. (line 199)
+* prebind_all_twolevel_modules: Darwin Options. (line 199)
+* preprocessor: Preprocessor Options.
+ (line 24)
+* print-file-name: Debugging Options. (line 884)
+* print-libgcc-file-name: Debugging Options. (line 905)
+* print-multi-directory: Debugging Options. (line 890)
+* print-multi-lib: Debugging Options. (line 895)
+* print-objc-runtime-info: Objective-C and Objective-C++ Dialect Options.
+ (line 244)
+* print-prog-name: Debugging Options. (line 902)
+* print-search-dirs: Debugging Options. (line 913)
+* print-sysroot: Debugging Options. (line 926)
+* print-sysroot-headers-suffix: Debugging Options. (line 933)
+* private_bundle: Darwin Options. (line 199)
+* pthread <1>: SPARC Options. (line 242)
+* pthread <2>: RS/6000 and PowerPC Options.
+ (line 709)
+* pthread: IA-64 Options. (line 106)
+* pthreads: SPARC Options. (line 236)
+* Q: Debugging Options. (line 231)
+* Qn: System V Options. (line 18)
+* Qy: System V Options. (line 14)
+* rdynamic: Link Options. (line 98)
+* read_only_relocs: Darwin Options. (line 199)
+* remap: Preprocessor Options.
+ (line 638)
+* s: Link Options. (line 105)
+* S <1>: Link Options. (line 20)
+* S: Overall Options. (line 170)
+* save-temps: Debugging Options. (line 846)
+* sectalign: Darwin Options. (line 199)
+* sectcreate: Darwin Options. (line 199)
+* sectobjectsymbols: Darwin Options. (line 199)
+* sectorder: Darwin Options. (line 199)
+* seg1addr: Darwin Options. (line 199)
+* seg_addr_table: Darwin Options. (line 199)
+* seg_addr_table_filename: Darwin Options. (line 199)
+* segaddr: Darwin Options. (line 199)
+* seglinkedit: Darwin Options. (line 199)
+* segprot: Darwin Options. (line 199)
+* segs_read_only_addr: Darwin Options. (line 199)
+* segs_read_write_addr: Darwin Options. (line 199)
+* shared: Link Options. (line 114)
+* shared-libgcc: Link Options. (line 122)
+* sim: CRIS Options. (line 95)
+* sim2: CRIS Options. (line 101)
+* single_module: Darwin Options. (line 199)
+* specs: Directory Options. (line 84)
+* static <1>: HPPA Options. (line 192)
+* static <2>: Darwin Options. (line 199)
+* static: Link Options. (line 109)
+* static-libgcc: Link Options. (line 122)
+* std <1>: Non-bugs. (line 107)
+* std <2>: Other Builtins. (line 22)
+* std <3>: C Dialect Options. (line 47)
+* std: Standards. (line 16)
+* std=: Preprocessor Options.
+ (line 325)
+* sub_library: Darwin Options. (line 199)
+* sub_umbrella: Darwin Options. (line 199)
+* symbolic: Link Options. (line 157)
+* sysroot: Directory Options. (line 92)
+* T: Link Options. (line 163)
+* target-help <1>: Preprocessor Options.
+ (line 643)
+* target-help: Overall Options. (line 240)
+* threads <1>: SPARC Options. (line 230)
+* threads: HPPA Options. (line 205)
+* time: Debugging Options. (line 860)
+* tls: FRV Options. (line 75)
+* TLS: FRV Options. (line 72)
+* traditional <1>: Incompatibilities. (line 6)
+* traditional: C Dialect Options. (line 252)
+* traditional-cpp <1>: Preprocessor Options.
+ (line 621)
+* traditional-cpp: C Dialect Options. (line 252)
+* trigraphs <1>: Preprocessor Options.
+ (line 625)
+* trigraphs: C Dialect Options. (line 236)
+* twolevel_namespace: Darwin Options. (line 199)
+* u: Link Options. (line 196)
+* U: Preprocessor Options.
+ (line 56)
+* umbrella: Darwin Options. (line 199)
+* undef: Preprocessor Options.
+ (line 60)
+* undefined: Darwin Options. (line 199)
+* unexported_symbols_list: Darwin Options. (line 199)
+* V: Target Options. (line 25)
+* v <1>: Preprocessor Options.
+ (line 647)
+* v: Overall Options. (line 198)
+* version <1>: Preprocessor Options.
+ (line 660)
+* version: Overall Options. (line 348)
+* W: Incompatibilities. (line 64)
+* w: Preprocessor Options.
+ (line 158)
+* W: Warning Options. (line 146)
+* w: Warning Options. (line 18)
+* Wa: Assembler Options. (line 9)
+* Wabi: C++ Dialect Options.
+ (line 286)
+* Waddress: Warning Options. (line 953)
+* Waggregate-return: Warning Options. (line 971)
+* Wall <1>: Standard Libraries. (line 6)
+* Wall <2>: Preprocessor Options.
+ (line 80)
+* Wall: Warning Options. (line 99)
+* Warray-bounds: Warning Options. (line 691)
+* Wassign-intercept: Objective-C and Objective-C++ Dialect Options.
+ (line 198)
+* Wattributes: Warning Options. (line 976)
+* Wbad-function-cast: Warning Options. (line 869)
+* Wbuiltin-macro-redefined: Warning Options. (line 982)
+* Wcast-align: Warning Options. (line 889)
+* Wcast-qual: Warning Options. (line 884)
+* Wchar-subscripts: Warning Options. (line 184)
+* Wclobbered: Warning Options. (line 909)
+* Wcomment <1>: Preprocessor Options.
+ (line 88)
+* Wcomment: Warning Options. (line 189)
+* Wcomments: Preprocessor Options.
+ (line 88)
+* Wconversion: Warning Options. (line 913)
+* Wcoverage-mismatch: Language Independent Options.
+ (line 42)
+* Wctor-dtor-privacy: C++ Dialect Options.
+ (line 378)
+* Wdeclaration-after-statement: Warning Options. (line 812)
+* Wdeprecated: Warning Options. (line 1119)
+* Wdeprecated-declarations: Warning Options. (line 1123)
+* Wdisabled-optimization: Warning Options. (line 1272)
+* Wdiv-by-zero: Warning Options. (line 696)
+* weak_reference_mismatches: Darwin Options. (line 199)
+* Weffc++: C++ Dialect Options.
+ (line 405)
+* Wempty-body: Warning Options. (line 932)
+* Wendif-labels <1>: Preprocessor Options.
+ (line 135)
+* Wendif-labels: Warning Options. (line 822)
+* Wenum-compare: Warning Options. (line 936)
+* Werror <1>: Preprocessor Options.
+ (line 148)
+* Werror: Warning Options. (line 21)
+* Werror=: Warning Options. (line 24)
+* Wextra: Warning Options. (line 146)
+* Wfatal-errors: Warning Options. (line 38)
+* Wfloat-equal: Warning Options. (line 712)
+* Wformat <1>: Function Attributes.
+ (line 373)
+* Wformat: Warning Options. (line 194)
+* Wformat-contains-nul: Warning Options. (line 233)
+* Wformat-extra-args: Warning Options. (line 237)
+* Wformat-nonliteral <1>: Function Attributes.
+ (line 432)
+* Wformat-nonliteral: Warning Options. (line 255)
+* Wformat-security: Warning Options. (line 260)
+* Wformat-y2k: Warning Options. (line 229)
+* Wformat-zero-length: Warning Options. (line 251)
+* Wformat=2: Warning Options. (line 271)
+* Wframe-larger-than: Warning Options. (line 834)
+* whatsloaded: Darwin Options. (line 199)
+* whyload: Darwin Options. (line 199)
+* Wignored-qualifiers: Warning Options. (line 310)
+* Wimplicit: Warning Options. (line 306)
+* Wimplicit-function-declaration: Warning Options. (line 300)
+* Wimplicit-int: Warning Options. (line 296)
+* Winit-self: Warning Options. (line 283)
+* Winline <1>: Inline. (line 63)
+* Winline: Warning Options. (line 1211)
+* Wint-to-pointer-cast: Warning Options. (line 1238)
+* Winvalid-offsetof: Warning Options. (line 1224)
+* Winvalid-pch: Warning Options. (line 1246)
+* Wl: Link Options. (line 188)
+* Wlarger-than-LEN: Warning Options. (line 831)
+* Wlarger-than=LEN: Warning Options. (line 831)
+* Wlogical-op: Warning Options. (line 966)
+* Wlong-long: Warning Options. (line 1250)
+* Wmain: Warning Options. (line 321)
+* Wmissing-braces: Warning Options. (line 328)
+* Wmissing-declarations: Warning Options. (line 1017)
+* Wmissing-field-initializers: Warning Options. (line 1025)
+* Wmissing-format-attribute: Warning Options. (line 1051)
+* Wmissing-include-dirs: Warning Options. (line 338)
+* Wmissing-noreturn: Warning Options. (line 1043)
+* Wmissing-parameter-type: Warning Options. (line 1003)
+* Wmissing-prototypes: Warning Options. (line 1011)
+* Wmultichar: Warning Options. (line 1070)
+* Wnested-externs: Warning Options. (line 1186)
+* Wno-abi: C++ Dialect Options.
+ (line 286)
+* Wno-address: Warning Options. (line 953)
+* Wno-aggregate-return: Warning Options. (line 971)
+* Wno-all: Warning Options. (line 99)
+* Wno-array-bounds: Warning Options. (line 691)
+* Wno-assign-intercept: Objective-C and Objective-C++ Dialect Options.
+ (line 198)
+* Wno-attributes: Warning Options. (line 976)
+* Wno-bad-function-cast: Warning Options. (line 869)
+* Wno-builtin-macro-redefined: Warning Options. (line 982)
+* Wno-cast-align: Warning Options. (line 889)
+* Wno-cast-qual: Warning Options. (line 884)
+* Wno-char-subscripts: Warning Options. (line 184)
+* Wno-clobbered: Warning Options. (line 909)
+* Wno-comment: Warning Options. (line 189)
+* Wno-conversion: Warning Options. (line 913)
+* Wno-ctor-dtor-privacy: C++ Dialect Options.
+ (line 378)
+* Wno-declaration-after-statement: Warning Options. (line 812)
+* Wno-deprecated: Warning Options. (line 1119)
+* Wno-deprecated-declarations: Warning Options. (line 1123)
+* Wno-disabled-optimization: Warning Options. (line 1272)
+* Wno-div-by-zero: Warning Options. (line 696)
+* Wno-effc++: C++ Dialect Options.
+ (line 405)
+* Wno-empty-body: Warning Options. (line 932)
+* Wno-endif-labels: Warning Options. (line 822)
+* Wno-enum-compare: Warning Options. (line 936)
+* Wno-error: Warning Options. (line 21)
+* Wno-error=: Warning Options. (line 24)
+* Wno-extra: Warning Options. (line 146)
+* Wno-fatal-errors: Warning Options. (line 38)
+* Wno-float-equal: Warning Options. (line 712)
+* Wno-format: Warning Options. (line 194)
+* Wno-format-contains-nul: Warning Options. (line 233)
+* Wno-format-extra-args: Warning Options. (line 237)
+* Wno-format-nonliteral: Warning Options. (line 255)
+* Wno-format-security: Warning Options. (line 260)
+* Wno-format-y2k: Warning Options. (line 229)
+* Wno-format-zero-length: Warning Options. (line 251)
+* Wno-format=2: Warning Options. (line 271)
+* Wno-ignored-qualifiers: Warning Options. (line 310)
+* Wno-implicit: Warning Options. (line 306)
+* Wno-implicit-function-declaration: Warning Options. (line 300)
+* Wno-implicit-int: Warning Options. (line 296)
+* Wno-init-self: Warning Options. (line 283)
+* Wno-inline: Warning Options. (line 1211)
+* Wno-int-to-pointer-cast: Warning Options. (line 1238)
+* Wno-invalid-offsetof: Warning Options. (line 1224)
+* Wno-invalid-pch: Warning Options. (line 1246)
+* Wno-logical-op: Warning Options. (line 966)
+* Wno-long-long: Warning Options. (line 1250)
+* Wno-main: Warning Options. (line 321)
+* Wno-missing-braces: Warning Options. (line 328)
+* Wno-missing-declarations: Warning Options. (line 1017)
+* Wno-missing-field-initializers: Warning Options. (line 1025)
+* Wno-missing-format-attribute: Warning Options. (line 1051)
+* Wno-missing-include-dirs: Warning Options. (line 338)
+* Wno-missing-noreturn: Warning Options. (line 1043)
+* Wno-missing-parameter-type: Warning Options. (line 1003)
+* Wno-missing-prototypes: Warning Options. (line 1011)
+* Wno-mudflap: Warning Options. (line 1292)
+* Wno-multichar: Warning Options. (line 1070)
+* Wno-nested-externs: Warning Options. (line 1186)
+* Wno-non-template-friend: C++ Dialect Options.
+ (line 442)
+* Wno-non-virtual-dtor: C++ Dialect Options.
+ (line 383)
+* Wno-nonnull: Warning Options. (line 276)
+* Wno-old-style-cast: C++ Dialect Options.
+ (line 458)
+* Wno-old-style-declaration: Warning Options. (line 993)
+* Wno-old-style-definition: Warning Options. (line 999)
+* Wno-overflow: Warning Options. (line 1129)
+* Wno-overlength-strings: Warning Options. (line 1296)
+* Wno-overloaded-virtual: C++ Dialect Options.
+ (line 464)
+* Wno-override-init: Warning Options. (line 1132)
+* Wno-packed: Warning Options. (line 1140)
+* Wno-packed-bitfield-compat: Warning Options. (line 1157)
+* Wno-padded: Warning Options. (line 1174)
+* Wno-parentheses: Warning Options. (line 341)
+* Wno-pedantic-ms-format: Warning Options. (line 849)
+* Wno-pmf-conversions <1>: Bound member functions.
+ (line 35)
+* Wno-pmf-conversions: C++ Dialect Options.
+ (line 483)
+* Wno-pointer-arith: Warning Options. (line 855)
+* Wno-pointer-sign: Warning Options. (line 1281)
+* Wno-pointer-to-int-cast: Warning Options. (line 1242)
+* Wno-pragmas: Warning Options. (line 594)
+* Wno-protocol: Objective-C and Objective-C++ Dialect Options.
+ (line 202)
+* Wno-redundant-decls: Warning Options. (line 1181)
+* Wno-reorder: C++ Dialect Options.
+ (line 389)
+* Wno-return-type: Warning Options. (line 431)
+* Wno-selector: Objective-C and Objective-C++ Dialect Options.
+ (line 212)
+* Wno-sequence-point: Warning Options. (line 385)
+* Wno-shadow: Warning Options. (line 826)
+* Wno-sign-compare: Warning Options. (line 940)
+* Wno-sign-conversion: Warning Options. (line 947)
+* Wno-sign-promo: C++ Dialect Options.
+ (line 487)
+* Wno-stack-protector: Warning Options. (line 1287)
+* Wno-strict-aliasing: Warning Options. (line 599)
+* Wno-strict-aliasing=n: Warning Options. (line 607)
+* Wno-strict-null-sentinel: C++ Dialect Options.
+ (line 435)
+* Wno-strict-overflow: Warning Options. (line 640)
+* Wno-strict-prototypes: Warning Options. (line 987)
+* Wno-strict-selector-match: Objective-C and Objective-C++ Dialect Options.
+ (line 224)
+* Wno-switch: Warning Options. (line 446)
+* Wno-switch-default: Warning Options. (line 454)
+* Wno-switch-enum: Warning Options. (line 457)
+* Wno-sync-nand: Warning Options. (line 463)
+* Wno-system-headers: Warning Options. (line 701)
+* Wno-traditional: Warning Options. (line 727)
+* Wno-traditional-conversion: Warning Options. (line 804)
+* Wno-trigraphs: Warning Options. (line 468)
+* Wno-type-limits: Warning Options. (line 862)
+* Wno-undeclared-selector: Objective-C and Objective-C++ Dialect Options.
+ (line 232)
+* Wno-undef: Warning Options. (line 819)
+* Wno-uninitialized: Warning Options. (line 517)
+* Wno-unknown-pragmas: Warning Options. (line 587)
+* Wno-unreachable-code: Warning Options. (line 1189)
+* Wno-unsafe-loop-optimizations: Warning Options. (line 843)
+* Wno-unused: Warning Options. (line 510)
+* Wno-unused-function: Warning Options. (line 473)
+* Wno-unused-label: Warning Options. (line 478)
+* Wno-unused-parameter: Warning Options. (line 485)
+* Wno-unused-value: Warning Options. (line 500)
+* Wno-unused-variable: Warning Options. (line 492)
+* Wno-variadic-macros: Warning Options. (line 1256)
+* Wno-vla: Warning Options. (line 1262)
+* Wno-volatile-register-var: Warning Options. (line 1266)
+* Wno-write-strings: Warning Options. (line 895)
+* Wnon-template-friend: C++ Dialect Options.
+ (line 442)
+* Wnon-virtual-dtor: C++ Dialect Options.
+ (line 383)
+* Wnonnull: Warning Options. (line 276)
+* Wnormalized=: Warning Options. (line 1076)
+* Wold-style-cast: C++ Dialect Options.
+ (line 458)
+* Wold-style-declaration: Warning Options. (line 993)
+* Wold-style-definition: Warning Options. (line 999)
+* Woverflow: Warning Options. (line 1129)
+* Woverlength-strings: Warning Options. (line 1296)
+* Woverloaded-virtual: C++ Dialect Options.
+ (line 464)
+* Woverride-init: Warning Options. (line 1132)
+* Wp: Preprocessor Options.
+ (line 13)
+* Wpacked: Warning Options. (line 1140)
+* Wpacked-bitfield-compat: Warning Options. (line 1157)
+* Wpadded: Warning Options. (line 1174)
+* Wparentheses: Warning Options. (line 341)
+* Wpedantic-ms-format: Warning Options. (line 849)
+* Wpmf-conversions: C++ Dialect Options.
+ (line 483)
+* Wpointer-arith <1>: Pointer Arith. (line 13)
+* Wpointer-arith: Warning Options. (line 855)
+* Wpointer-sign: Warning Options. (line 1281)
+* Wpointer-to-int-cast: Warning Options. (line 1242)
+* Wpragmas: Warning Options. (line 594)
+* Wprotocol: Objective-C and Objective-C++ Dialect Options.
+ (line 202)
+* wrapper: Overall Options. (line 351)
+* Wredundant-decls: Warning Options. (line 1181)
+* Wreorder: C++ Dialect Options.
+ (line 389)
+* Wreturn-type: Warning Options. (line 431)
+* Wselector: Objective-C and Objective-C++ Dialect Options.
+ (line 212)
+* Wsequence-point: Warning Options. (line 385)
+* Wshadow: Warning Options. (line 826)
+* Wsign-compare: Warning Options. (line 940)
+* Wsign-conversion: Warning Options. (line 947)
+* Wsign-promo: C++ Dialect Options.
+ (line 487)
+* Wstack-protector: Warning Options. (line 1287)
+* Wstrict-aliasing: Warning Options. (line 599)
+* Wstrict-aliasing=n: Warning Options. (line 607)
+* Wstrict-null-sentinel: C++ Dialect Options.
+ (line 435)
+* Wstrict-overflow: Warning Options. (line 640)
+* Wstrict-prototypes: Warning Options. (line 987)
+* Wstrict-selector-match: Objective-C and Objective-C++ Dialect Options.
+ (line 224)
+* Wswitch: Warning Options. (line 446)
+* Wswitch-default: Warning Options. (line 454)
+* Wswitch-enum: Warning Options. (line 457)
+* Wsync-nand: Warning Options. (line 463)
+* Wsystem-headers <1>: Preprocessor Options.
+ (line 152)
+* Wsystem-headers: Warning Options. (line 701)
+* Wtraditional <1>: Preprocessor Options.
+ (line 105)
+* Wtraditional: Warning Options. (line 727)
+* Wtraditional-conversion <1>: Protoize Caveats. (line 31)
+* Wtraditional-conversion: Warning Options. (line 804)
+* Wtrigraphs <1>: Preprocessor Options.
+ (line 93)
+* Wtrigraphs: Warning Options. (line 468)
+* Wtype-limits: Warning Options. (line 862)
+* Wundeclared-selector: Objective-C and Objective-C++ Dialect Options.
+ (line 232)
+* Wundef <1>: Preprocessor Options.
+ (line 111)
+* Wundef: Warning Options. (line 819)
+* Wuninitialized: Warning Options. (line 517)
+* Wunknown-pragmas: Warning Options. (line 587)
+* Wunreachable-code: Warning Options. (line 1189)
+* Wunsafe-loop-optimizations: Warning Options. (line 843)
+* Wunused: Warning Options. (line 510)
+* Wunused-function: Warning Options. (line 473)
+* Wunused-label: Warning Options. (line 478)
+* Wunused-macros: Preprocessor Options.
+ (line 116)
+* Wunused-parameter: Warning Options. (line 485)
+* Wunused-value: Warning Options. (line 500)
+* Wunused-variable: Warning Options. (line 492)
+* Wvariadic-macros: Warning Options. (line 1256)
+* Wvla: Warning Options. (line 1262)
+* Wvolatile-register-var: Warning Options. (line 1266)
+* Wwrite-strings: Warning Options. (line 895)
+* x <1>: Preprocessor Options.
+ (line 309)
+* x: Overall Options. (line 122)
+* Xassembler: Assembler Options. (line 13)
+* Xbind-lazy: VxWorks Options. (line 26)
+* Xbind-now: VxWorks Options. (line 30)
+* Xlinker: Link Options. (line 169)
+* Ym: System V Options. (line 26)
+* YP: System V Options. (line 22)
+
+
+File: gcc.info, Node: Keyword Index, Prev: Option Index, Up: Top
+
+Keyword Index
+*************
+
+
+* Menu:
+
+* ! in constraint: Multi-Alternative. (line 33)
+* # in constraint: Modifiers. (line 57)
+* #pragma: Pragmas. (line 6)
+* #pragma implementation: C++ Interface. (line 39)
+* #pragma implementation, implied: C++ Interface. (line 46)
+* #pragma interface: C++ Interface. (line 20)
+* #pragma, reason for not using: Function Attributes.
+ (line 1344)
+* $: Dollar Signs. (line 6)
+* % in constraint: Modifiers. (line 45)
+* %include: Spec Files. (line 27)
+* %include_noerr: Spec Files. (line 31)
+* %rename: Spec Files. (line 35)
+* & in constraint: Modifiers. (line 25)
+* ': Incompatibilities. (line 116)
+* (: Constructing Calls. (line 53)
+* * in constraint: Modifiers. (line 62)
+* + in constraint: Modifiers. (line 12)
+* -lgcc, use with -nodefaultlibs: Link Options. (line 79)
+* -lgcc, use with -nostdlib: Link Options. (line 79)
+* -nodefaultlibs and unresolved references: Link Options. (line 79)
+* -nostdlib and unresolved references: Link Options. (line 79)
+* .sdata/.sdata2 references (PowerPC): RS/6000 and PowerPC Options.
+ (line 663)
+* //: C++ Comments. (line 6)
+* 0 in constraint: Simple Constraints. (line 117)
+* < in constraint: Simple Constraints. (line 48)
+* = in constraint: Modifiers. (line 8)
+* > in constraint: Simple Constraints. (line 52)
+* ? in constraint: Multi-Alternative. (line 27)
+* ?: extensions: Conditionals. (line 6)
+* ?: side effect: Conditionals. (line 20)
+* _ in variables in macros: Typeof. (line 42)
+* __builtin___clear_cache: Other Builtins. (line 274)
+* __builtin___fprintf_chk: Object Size Checking.
+ (line 6)
+* __builtin___memcpy_chk: Object Size Checking.
+ (line 6)
+* __builtin___memmove_chk: Object Size Checking.
+ (line 6)
+* __builtin___mempcpy_chk: Object Size Checking.
+ (line 6)
+* __builtin___memset_chk: Object Size Checking.
+ (line 6)
+* __builtin___printf_chk: Object Size Checking.
+ (line 6)
+* __builtin___snprintf_chk: Object Size Checking.
+ (line 6)
+* __builtin___sprintf_chk: Object Size Checking.
+ (line 6)
+* __builtin___stpcpy_chk: Object Size Checking.
+ (line 6)
+* __builtin___strcat_chk: Object Size Checking.
+ (line 6)
+* __builtin___strcpy_chk: Object Size Checking.
+ (line 6)
+* __builtin___strncat_chk: Object Size Checking.
+ (line 6)
+* __builtin___strncpy_chk: Object Size Checking.
+ (line 6)
+* __builtin___vfprintf_chk: Object Size Checking.
+ (line 6)
+* __builtin___vprintf_chk: Object Size Checking.
+ (line 6)
+* __builtin___vsnprintf_chk: Object Size Checking.
+ (line 6)
+* __builtin___vsprintf_chk: Object Size Checking.
+ (line 6)
+* __builtin_apply: Constructing Calls. (line 31)
+* __builtin_apply_args: Constructing Calls. (line 20)
+* __builtin_bswap32: Other Builtins. (line 493)
+* __builtin_bswap64: Other Builtins. (line 498)
+* __builtin_choose_expr: Other Builtins. (line 156)
+* __builtin_clz: Other Builtins. (line 426)
+* __builtin_clzl: Other Builtins. (line 444)
+* __builtin_clzll: Other Builtins. (line 464)
+* __builtin_constant_p: Other Builtins. (line 196)
+* __builtin_ctz: Other Builtins. (line 430)
+* __builtin_ctzl: Other Builtins. (line 448)
+* __builtin_ctzll: Other Builtins. (line 468)
+* __builtin_expect: Other Builtins. (line 242)
+* __builtin_ffs: Other Builtins. (line 422)
+* __builtin_ffsl: Other Builtins. (line 440)
+* __builtin_ffsll: Other Builtins. (line 460)
+* __builtin_fpclassify: Other Builtins. (line 6)
+* __builtin_frame_address: Return Address. (line 34)
+* __builtin_huge_val: Other Builtins. (line 325)
+* __builtin_huge_valf: Other Builtins. (line 330)
+* __builtin_huge_vall: Other Builtins. (line 333)
+* __builtin_inf: Other Builtins. (line 348)
+* __builtin_infd128: Other Builtins. (line 358)
+* __builtin_infd32: Other Builtins. (line 352)
+* __builtin_infd64: Other Builtins. (line 355)
+* __builtin_inff: Other Builtins. (line 362)
+* __builtin_infl: Other Builtins. (line 367)
+* __builtin_isfinite: Other Builtins. (line 6)
+* __builtin_isgreater: Other Builtins. (line 6)
+* __builtin_isgreaterequal: Other Builtins. (line 6)
+* __builtin_isinf_sign: Other Builtins. (line 6)
+* __builtin_isless: Other Builtins. (line 6)
+* __builtin_islessequal: Other Builtins. (line 6)
+* __builtin_islessgreater: Other Builtins. (line 6)
+* __builtin_isnormal: Other Builtins. (line 6)
+* __builtin_isunordered: Other Builtins. (line 6)
+* __builtin_nan: Other Builtins. (line 378)
+* __builtin_nand128: Other Builtins. (line 400)
+* __builtin_nand32: Other Builtins. (line 394)
+* __builtin_nand64: Other Builtins. (line 397)
+* __builtin_nanf: Other Builtins. (line 404)
+* __builtin_nanl: Other Builtins. (line 407)
+* __builtin_nans: Other Builtins. (line 411)
+* __builtin_nansf: Other Builtins. (line 415)
+* __builtin_nansl: Other Builtins. (line 418)
+* __builtin_object_size: Object Size Checking.
+ (line 6)
+* __builtin_offsetof: Offsetof. (line 6)
+* __builtin_parity: Other Builtins. (line 437)
+* __builtin_parityl: Other Builtins. (line 456)
+* __builtin_parityll: Other Builtins. (line 476)
+* __builtin_popcount: Other Builtins. (line 434)
+* __builtin_popcountl: Other Builtins. (line 452)
+* __builtin_popcountll: Other Builtins. (line 472)
+* __builtin_powi: Other Builtins. (line 6)
+* __builtin_powif: Other Builtins. (line 6)
+* __builtin_powil: Other Builtins. (line 6)
+* __builtin_prefetch: Other Builtins. (line 286)
+* __builtin_return: Constructing Calls. (line 48)
+* __builtin_return_address: Return Address. (line 11)
+* __builtin_trap: Other Builtins. (line 266)
+* __builtin_types_compatible_p: Other Builtins. (line 110)
+* __complex__ keyword: Complex. (line 6)
+* __declspec(dllexport): Function Attributes.
+ (line 244)
+* __declspec(dllimport): Function Attributes.
+ (line 274)
+* __extension__: Alternate Keywords. (line 29)
+* __float128 data type: Floating Types. (line 6)
+* __float80 data type: Floating Types. (line 6)
+* __func__ identifier: Function Names. (line 6)
+* __FUNCTION__ identifier: Function Names. (line 6)
+* __imag__ keyword: Complex. (line 27)
+* __PRETTY_FUNCTION__ identifier: Function Names. (line 6)
+* __real__ keyword: Complex. (line 27)
+* __STDC_HOSTED__: Standards. (line 13)
+* __sync_add_and_fetch: Atomic Builtins. (line 61)
+* __sync_and_and_fetch: Atomic Builtins. (line 61)
+* __sync_bool_compare_and_swap: Atomic Builtins. (line 73)
+* __sync_fetch_and_add: Atomic Builtins. (line 45)
+* __sync_fetch_and_and: Atomic Builtins. (line 45)
+* __sync_fetch_and_nand: Atomic Builtins. (line 45)
+* __sync_fetch_and_or: Atomic Builtins. (line 45)
+* __sync_fetch_and_sub: Atomic Builtins. (line 45)
+* __sync_fetch_and_xor: Atomic Builtins. (line 45)
+* __sync_lock_release: Atomic Builtins. (line 103)
+* __sync_lock_test_and_set: Atomic Builtins. (line 85)
+* __sync_nand_and_fetch: Atomic Builtins. (line 61)
+* __sync_or_and_fetch: Atomic Builtins. (line 61)
+* __sync_sub_and_fetch: Atomic Builtins. (line 61)
+* __sync_synchronize: Atomic Builtins. (line 82)
+* __sync_val_compare_and_swap: Atomic Builtins. (line 73)
+* __sync_xor_and_fetch: Atomic Builtins. (line 61)
+* __thread: Thread-Local. (line 6)
+* _Accum data type: Fixed-Point. (line 6)
+* _Complex keyword: Complex. (line 6)
+* _Decimal128 data type: Decimal Float. (line 6)
+* _Decimal32 data type: Decimal Float. (line 6)
+* _Decimal64 data type: Decimal Float. (line 6)
+* _exit: Other Builtins. (line 6)
+* _Exit: Other Builtins. (line 6)
+* _Fract data type: Fixed-Point. (line 6)
+* _Sat data type: Fixed-Point. (line 6)
+* ABI: Compatibility. (line 6)
+* abort: Other Builtins. (line 6)
+* abs: Other Builtins. (line 6)
+* accessing volatiles: Volatiles. (line 6)
+* acos: Other Builtins. (line 6)
+* acosf: Other Builtins. (line 6)
+* acosh: Other Builtins. (line 6)
+* acoshf: Other Builtins. (line 6)
+* acoshl: Other Builtins. (line 6)
+* acosl: Other Builtins. (line 6)
+* Ada: G++ and GCC. (line 6)
+* additional floating types: Floating Types. (line 6)
+* address constraints: Simple Constraints. (line 144)
+* address of a label: Labels as Values. (line 6)
+* address_operand: Simple Constraints. (line 148)
+* alias attribute: Function Attributes.
+ (line 34)
+* aliasing of parameters: Code Gen Options. (line 409)
+* aligned attribute <1>: Type Attributes. (line 31)
+* aligned attribute <2>: Variable Attributes.
+ (line 23)
+* aligned attribute: Function Attributes.
+ (line 47)
+* alignment: Alignment. (line 6)
+* alloc_size attribute: Function Attributes.
+ (line 67)
+* alloca: Other Builtins. (line 6)
+* alloca vs variable-length arrays: Variable Length. (line 27)
+* Allow nesting in an interrupt handler on the Blackfin processor.: Function Attributes.
+ (line 701)
+* alternate keywords: Alternate Keywords. (line 6)
+* always_inline function attribute: Function Attributes.
+ (line 88)
+* AMD x86-64 Options: i386 and x86-64 Options.
+ (line 6)
+* AMD1: Standards. (line 13)
+* ANSI C: Standards. (line 13)
+* ANSI C standard: Standards. (line 13)
+* ANSI C89: Standards. (line 13)
+* ANSI support: C Dialect Options. (line 10)
+* ANSI X3.159-1989: Standards. (line 13)
+* apostrophes: Incompatibilities. (line 116)
+* application binary interface: Compatibility. (line 6)
+* ARC Options: ARC Options. (line 6)
+* ARM [Annotated C++ Reference Manual]: Backwards Compatibility.
+ (line 6)
+* ARM options: ARM Options. (line 6)
+* arrays of length zero: Zero Length. (line 6)
+* arrays of variable length: Variable Length. (line 6)
+* arrays, non-lvalue: Subscripting. (line 6)
+* artificial function attribute: Function Attributes.
+ (line 131)
+* asin: Other Builtins. (line 6)
+* asinf: Other Builtins. (line 6)
+* asinh: Other Builtins. (line 6)
+* asinhf: Other Builtins. (line 6)
+* asinhl: Other Builtins. (line 6)
+* asinl: Other Builtins. (line 6)
+* asm constraints: Constraints. (line 6)
+* asm expressions: Extended Asm. (line 6)
+* assembler instructions: Extended Asm. (line 6)
+* assembler names for identifiers: Asm Labels. (line 6)
+* assembly code, invalid: Bug Criteria. (line 12)
+* atan: Other Builtins. (line 6)
+* atan2: Other Builtins. (line 6)
+* atan2f: Other Builtins. (line 6)
+* atan2l: Other Builtins. (line 6)
+* atanf: Other Builtins. (line 6)
+* atanh: Other Builtins. (line 6)
+* atanhf: Other Builtins. (line 6)
+* atanhl: Other Builtins. (line 6)
+* atanl: Other Builtins. (line 6)
+* attribute of types: Type Attributes. (line 6)
+* attribute of variables: Variable Attributes.
+ (line 6)
+* attribute syntax: Attribute Syntax. (line 6)
+* autoincrement/decrement addressing: Simple Constraints. (line 30)
+* automatic inline for C++ member fns: Inline. (line 71)
+* AVR Options: AVR Options. (line 6)
+* Backwards Compatibility: Backwards Compatibility.
+ (line 6)
+* base class members: Name lookup. (line 6)
+* bcmp: Other Builtins. (line 6)
+* below100 attribute: Variable Attributes.
+ (line 492)
+* binary compatibility: Compatibility. (line 6)
+* Binary constants using the 0b prefix: Binary constants. (line 6)
+* Blackfin Options: Blackfin Options. (line 6)
+* bound pointer to member function: Bound member functions.
+ (line 6)
+* bounds checking: Optimize Options. (line 338)
+* bug criteria: Bug Criteria. (line 6)
+* bugs: Bugs. (line 6)
+* bugs, known: Trouble. (line 6)
+* built-in functions <1>: Other Builtins. (line 6)
+* built-in functions: C Dialect Options. (line 170)
+* bzero: Other Builtins. (line 6)
+* C compilation options: Invoking GCC. (line 17)
+* C intermediate output, nonexistent: G++ and GCC. (line 35)
+* C language extensions: C Extensions. (line 6)
+* C language, traditional: C Dialect Options. (line 250)
+* C standard: Standards. (line 13)
+* C standards: Standards. (line 13)
+* c++: Invoking G++. (line 14)
+* C++: G++ and GCC. (line 30)
+* C++ comments: C++ Comments. (line 6)
+* C++ compilation options: Invoking GCC. (line 23)
+* C++ interface and implementation headers: C++ Interface. (line 6)
+* C++ language extensions: C++ Extensions. (line 6)
+* C++ member fns, automatically inline: Inline. (line 71)
+* C++ misunderstandings: C++ Misunderstandings.
+ (line 6)
+* C++ options, command line: C++ Dialect Options.
+ (line 6)
+* C++ pragmas, effect on inlining: C++ Interface. (line 66)
+* C++ source file suffixes: Invoking G++. (line 6)
+* C++ static data, declaring and defining: Static Definitions.
+ (line 6)
+* C89: Standards. (line 13)
+* C90: Standards. (line 13)
+* C94: Standards. (line 13)
+* C95: Standards. (line 13)
+* C99: Standards. (line 13)
+* C9X: Standards. (line 13)
+* C_INCLUDE_PATH: Environment Variables.
+ (line 127)
+* cabs: Other Builtins. (line 6)
+* cabsf: Other Builtins. (line 6)
+* cabsl: Other Builtins. (line 6)
+* cacos: Other Builtins. (line 6)
+* cacosf: Other Builtins. (line 6)
+* cacosh: Other Builtins. (line 6)
+* cacoshf: Other Builtins. (line 6)
+* cacoshl: Other Builtins. (line 6)
+* cacosl: Other Builtins. (line 6)
+* calling functions through the function vector on H8/300, M16C, M32C and SH2A processors: Function Attributes.
+ (line 471)
+* calloc: Other Builtins. (line 6)
+* carg: Other Builtins. (line 6)
+* cargf: Other Builtins. (line 6)
+* cargl: Other Builtins. (line 6)
+* case labels in initializers: Designated Inits. (line 6)
+* case ranges: Case Ranges. (line 6)
+* casin: Other Builtins. (line 6)
+* casinf: Other Builtins. (line 6)
+* casinh: Other Builtins. (line 6)
+* casinhf: Other Builtins. (line 6)
+* casinhl: Other Builtins. (line 6)
+* casinl: Other Builtins. (line 6)
+* cast to a union: Cast to Union. (line 6)
+* catan: Other Builtins. (line 6)
+* catanf: Other Builtins. (line 6)
+* catanh: Other Builtins. (line 6)
+* catanhf: Other Builtins. (line 6)
+* catanhl: Other Builtins. (line 6)
+* catanl: Other Builtins. (line 6)
+* cbrt: Other Builtins. (line 6)
+* cbrtf: Other Builtins. (line 6)
+* cbrtl: Other Builtins. (line 6)
+* ccos: Other Builtins. (line 6)
+* ccosf: Other Builtins. (line 6)
+* ccosh: Other Builtins. (line 6)
+* ccoshf: Other Builtins. (line 6)
+* ccoshl: Other Builtins. (line 6)
+* ccosl: Other Builtins. (line 6)
+* ceil: Other Builtins. (line 6)
+* ceilf: Other Builtins. (line 6)
+* ceill: Other Builtins. (line 6)
+* cexp: Other Builtins. (line 6)
+* cexpf: Other Builtins. (line 6)
+* cexpl: Other Builtins. (line 6)
+* character set, execution: Preprocessor Options.
+ (line 495)
+* character set, input: Preprocessor Options.
+ (line 508)
+* character set, input normalization: Warning Options. (line 1076)
+* character set, wide execution: Preprocessor Options.
+ (line 500)
+* cimag: Other Builtins. (line 6)
+* cimagf: Other Builtins. (line 6)
+* cimagl: Other Builtins. (line 6)
+* cleanup attribute: Variable Attributes.
+ (line 89)
+* clog: Other Builtins. (line 6)
+* clogf: Other Builtins. (line 6)
+* clogl: Other Builtins. (line 6)
+* COBOL: G++ and GCC. (line 23)
+* code generation conventions: Code Gen Options. (line 6)
+* code, mixed with declarations: Mixed Declarations. (line 6)
+* cold function attribute: Function Attributes.
+ (line 852)
+* command options: Invoking GCC. (line 6)
+* comments, C++ style: C++ Comments. (line 6)
+* common attribute: Variable Attributes.
+ (line 105)
+* comparison of signed and unsigned values, warning: Warning Options.
+ (line 940)
+* compiler bugs, reporting: Bug Reporting. (line 6)
+* compiler compared to C++ preprocessor: G++ and GCC. (line 35)
+* compiler options, C++: C++ Dialect Options.
+ (line 6)
+* compiler options, Objective-C and Objective-C++: Objective-C and Objective-C++ Dialect Options.
+ (line 6)
+* compiler version, specifying: Target Options. (line 6)
+* COMPILER_PATH: Environment Variables.
+ (line 88)
+* complex conjugation: Complex. (line 34)
+* complex numbers: Complex. (line 6)
+* compound literals: Compound Literals. (line 6)
+* computed gotos: Labels as Values. (line 6)
+* conditional expressions, extensions: Conditionals. (line 6)
+* conflicting types: Disappointments. (line 21)
+* conj: Other Builtins. (line 6)
+* conjf: Other Builtins. (line 6)
+* conjl: Other Builtins. (line 6)
+* const applied to function: Function Attributes.
+ (line 6)
+* const function attribute: Function Attributes.
+ (line 176)
+* constants in constraints: Simple Constraints. (line 60)
+* constraint modifier characters: Modifiers. (line 6)
+* constraint, matching: Simple Constraints. (line 129)
+* constraints, asm: Constraints. (line 6)
+* constraints, machine specific: Machine Constraints.
+ (line 6)
+* constructing calls: Constructing Calls. (line 6)
+* constructor expressions: Compound Literals. (line 6)
+* constructor function attribute: Function Attributes.
+ (line 204)
+* contributors: Contributors. (line 6)
+* copysign: Other Builtins. (line 6)
+* copysignf: Other Builtins. (line 6)
+* copysignl: Other Builtins. (line 6)
+* core dump: Bug Criteria. (line 9)
+* cos: Other Builtins. (line 6)
+* cosf: Other Builtins. (line 6)
+* cosh: Other Builtins. (line 6)
+* coshf: Other Builtins. (line 6)
+* coshl: Other Builtins. (line 6)
+* cosl: Other Builtins. (line 6)
+* CPATH: Environment Variables.
+ (line 126)
+* CPLUS_INCLUDE_PATH: Environment Variables.
+ (line 128)
+* cpow: Other Builtins. (line 6)
+* cpowf: Other Builtins. (line 6)
+* cpowl: Other Builtins. (line 6)
+* cproj: Other Builtins. (line 6)
+* cprojf: Other Builtins. (line 6)
+* cprojl: Other Builtins. (line 6)
+* creal: Other Builtins. (line 6)
+* crealf: Other Builtins. (line 6)
+* creall: Other Builtins. (line 6)
+* CRIS Options: CRIS Options. (line 6)
+* cross compiling: Target Options. (line 6)
+* CRX Options: CRX Options. (line 6)
+* csin: Other Builtins. (line 6)
+* csinf: Other Builtins. (line 6)
+* csinh: Other Builtins. (line 6)
+* csinhf: Other Builtins. (line 6)
+* csinhl: Other Builtins. (line 6)
+* csinl: Other Builtins. (line 6)
+* csqrt: Other Builtins. (line 6)
+* csqrtf: Other Builtins. (line 6)
+* csqrtl: Other Builtins. (line 6)
+* ctan: Other Builtins. (line 6)
+* ctanf: Other Builtins. (line 6)
+* ctanh: Other Builtins. (line 6)
+* ctanhf: Other Builtins. (line 6)
+* ctanhl: Other Builtins. (line 6)
+* ctanl: Other Builtins. (line 6)
+* Darwin options: Darwin Options. (line 6)
+* dcgettext: Other Builtins. (line 6)
+* DD integer suffix: Decimal Float. (line 6)
+* dd integer suffix: Decimal Float. (line 6)
+* deallocating variable length arrays: Variable Length. (line 23)
+* debugging information options: Debugging Options. (line 6)
+* decimal floating types: Decimal Float. (line 6)
+* declaration scope: Incompatibilities. (line 80)
+* declarations inside expressions: Statement Exprs. (line 6)
+* declarations, mixed with code: Mixed Declarations. (line 6)
+* declaring attributes of functions: Function Attributes.
+ (line 6)
+* declaring static data in C++: Static Definitions. (line 6)
+* defining static data in C++: Static Definitions. (line 6)
+* dependencies for make as output: Environment Variables.
+ (line 154)
+* dependencies, make: Preprocessor Options.
+ (line 172)
+* DEPENDENCIES_OUTPUT: Environment Variables.
+ (line 153)
+* dependent name lookup: Name lookup. (line 6)
+* deprecated attribute: Variable Attributes.
+ (line 113)
+* deprecated attribute.: Function Attributes.
+ (line 226)
+* designated initializers: Designated Inits. (line 6)
+* designator lists: Designated Inits. (line 94)
+* designators: Designated Inits. (line 61)
+* destructor function attribute: Function Attributes.
+ (line 204)
+* DF integer suffix: Decimal Float. (line 6)
+* df integer suffix: Decimal Float. (line 6)
+* dgettext: Other Builtins. (line 6)
+* diagnostic messages: Language Independent Options.
+ (line 6)
+* dialect options: C Dialect Options. (line 6)
+* digits in constraint: Simple Constraints. (line 117)
+* directory options: Directory Options. (line 6)
+* DL integer suffix: Decimal Float. (line 6)
+* dl integer suffix: Decimal Float. (line 6)
+* dollar signs in identifier names: Dollar Signs. (line 6)
+* double-word arithmetic: Long Long. (line 6)
+* downward funargs: Nested Functions. (line 6)
+* drem: Other Builtins. (line 6)
+* dremf: Other Builtins. (line 6)
+* dreml: Other Builtins. (line 6)
+* E in constraint: Simple Constraints. (line 79)
+* earlyclobber operand: Modifiers. (line 25)
+* eight bit data on the H8/300, H8/300H, and H8S: Function Attributes.
+ (line 327)
+* empty structures: Empty Structures. (line 6)
+* environment variables: Environment Variables.
+ (line 6)
+* erf: Other Builtins. (line 6)
+* erfc: Other Builtins. (line 6)
+* erfcf: Other Builtins. (line 6)
+* erfcl: Other Builtins. (line 6)
+* erff: Other Builtins. (line 6)
+* erfl: Other Builtins. (line 6)
+* error function attribute: Function Attributes.
+ (line 145)
+* error messages: Warnings and Errors.
+ (line 6)
+* escaped newlines: Escaped Newlines. (line 6)
+* exception handler functions on the Blackfin processor: Function Attributes.
+ (line 337)
+* exclamation point: Multi-Alternative. (line 33)
+* exit: Other Builtins. (line 6)
+* exp: Other Builtins. (line 6)
+* exp10: Other Builtins. (line 6)
+* exp10f: Other Builtins. (line 6)
+* exp10l: Other Builtins. (line 6)
+* exp2: Other Builtins. (line 6)
+* exp2f: Other Builtins. (line 6)
+* exp2l: Other Builtins. (line 6)
+* expf: Other Builtins. (line 6)
+* expl: Other Builtins. (line 6)
+* explicit register variables: Explicit Reg Vars. (line 6)
+* expm1: Other Builtins. (line 6)
+* expm1f: Other Builtins. (line 6)
+* expm1l: Other Builtins. (line 6)
+* expressions containing statements: Statement Exprs. (line 6)
+* expressions, constructor: Compound Literals. (line 6)
+* extended asm: Extended Asm. (line 6)
+* extensible constraints: Simple Constraints. (line 153)
+* extensions, ?:: Conditionals. (line 6)
+* extensions, C language: C Extensions. (line 6)
+* extensions, C++ language: C++ Extensions. (line 6)
+* external declaration scope: Incompatibilities. (line 80)
+* externally_visible attribute.: Function Attributes.
+ (line 343)
+* F in constraint: Simple Constraints. (line 84)
+* fabs: Other Builtins. (line 6)
+* fabsf: Other Builtins. (line 6)
+* fabsl: Other Builtins. (line 6)
+* fatal signal: Bug Criteria. (line 9)
+* fdim: Other Builtins. (line 6)
+* fdimf: Other Builtins. (line 6)
+* fdiml: Other Builtins. (line 6)
+* FDL, GNU Free Documentation License: GNU Free Documentation License.
+ (line 6)
+* ffs: Other Builtins. (line 6)
+* file name suffix: Overall Options. (line 14)
+* file names: Link Options. (line 10)
+* fixed-point types: Fixed-Point. (line 6)
+* flatten function attribute: Function Attributes.
+ (line 138)
+* flexible array members: Zero Length. (line 6)
+* float as function value type: Incompatibilities. (line 141)
+* floating point precision <1>: Disappointments. (line 68)
+* floating point precision: Optimize Options. (line 1352)
+* floor: Other Builtins. (line 6)
+* floorf: Other Builtins. (line 6)
+* floorl: Other Builtins. (line 6)
+* fma: Other Builtins. (line 6)
+* fmaf: Other Builtins. (line 6)
+* fmal: Other Builtins. (line 6)
+* fmax: Other Builtins. (line 6)
+* fmaxf: Other Builtins. (line 6)
+* fmaxl: Other Builtins. (line 6)
+* fmin: Other Builtins. (line 6)
+* fminf: Other Builtins. (line 6)
+* fminl: Other Builtins. (line 6)
+* fmod: Other Builtins. (line 6)
+* fmodf: Other Builtins. (line 6)
+* fmodl: Other Builtins. (line 6)
+* force_align_arg_pointer attribute: Function Attributes.
+ (line 894)
+* format function attribute: Function Attributes.
+ (line 373)
+* format_arg function attribute: Function Attributes.
+ (line 432)
+* Fortran: G++ and GCC. (line 6)
+* forwarding calls: Constructing Calls. (line 6)
+* fprintf: Other Builtins. (line 6)
+* fprintf_unlocked: Other Builtins. (line 6)
+* fputs: Other Builtins. (line 6)
+* fputs_unlocked: Other Builtins. (line 6)
+* FR30 Options: FR30 Options. (line 6)
+* freestanding environment: Standards. (line 13)
+* freestanding implementation: Standards. (line 13)
+* frexp: Other Builtins. (line 6)
+* frexpf: Other Builtins. (line 6)
+* frexpl: Other Builtins. (line 6)
+* FRV Options: FRV Options. (line 6)
+* fscanf: Other Builtins. (line 6)
+* fscanf, and constant strings: Incompatibilities. (line 17)
+* function addressability on the M32R/D: Function Attributes.
+ (line 643)
+* function attributes: Function Attributes.
+ (line 6)
+* function pointers, arithmetic: Pointer Arith. (line 6)
+* function prototype declarations: Function Prototypes.
+ (line 6)
+* function without a prologue/epilogue code: Function Attributes.
+ (line 683)
+* function, size of pointer to: Pointer Arith. (line 6)
+* functions called via pointer on the RS/6000 and PowerPC: Function Attributes.
+ (line 597)
+* functions in arbitrary sections: Function Attributes.
+ (line 6)
+* functions that are passed arguments in registers on the 386: Function Attributes.
+ (line 6)
+* functions that behave like malloc: Function Attributes.
+ (line 6)
+* functions that do not pop the argument stack on the 386: Function Attributes.
+ (line 6)
+* functions that do pop the argument stack on the 386: Function Attributes.
+ (line 170)
+* functions that have different compilation options on the 386: Function Attributes.
+ (line 6)
+* functions that have different optimization options: Function Attributes.
+ (line 6)
+* functions that have no side effects: Function Attributes.
+ (line 6)
+* functions that never return: Function Attributes.
+ (line 6)
+* functions that pop the argument stack on the 386: Function Attributes.
+ (line 6)
+* functions that return more than once: Function Attributes.
+ (line 6)
+* functions which do not handle memory bank switching on 68HC11/68HC12: Function Attributes.
+ (line 695)
+* functions which handle memory bank switching: Function Attributes.
+ (line 348)
+* functions with non-null pointer arguments: Function Attributes.
+ (line 6)
+* functions with printf, scanf, strftime or strfmon style arguments: Function Attributes.
+ (line 6)
+* g in constraint: Simple Constraints. (line 110)
+* G in constraint: Simple Constraints. (line 88)
+* g++: Invoking G++. (line 14)
+* G++: G++ and GCC. (line 30)
+* gamma: Other Builtins. (line 6)
+* gamma_r: Other Builtins. (line 6)
+* gammaf: Other Builtins. (line 6)
+* gammaf_r: Other Builtins. (line 6)
+* gammal: Other Builtins. (line 6)
+* gammal_r: Other Builtins. (line 6)
+* GCC: G++ and GCC. (line 6)
+* GCC command options: Invoking GCC. (line 6)
+* GCC_EXEC_PREFIX: Environment Variables.
+ (line 52)
+* gcc_struct: Type Attributes. (line 309)
+* gcc_struct attribute: Variable Attributes.
+ (line 349)
+* gcov: Debugging Options. (line 263)
+* gettext: Other Builtins. (line 6)
+* global offset table: Code Gen Options. (line 184)
+* global register after longjmp: Global Reg Vars. (line 66)
+* global register variables: Global Reg Vars. (line 6)
+* GNAT: G++ and GCC. (line 30)
+* GNU C Compiler: G++ and GCC. (line 6)
+* GNU Compiler Collection: G++ and GCC. (line 6)
+* gnu_inline function attribute: Function Attributes.
+ (line 93)
+* goto with computed label: Labels as Values. (line 6)
+* gprof: Debugging Options. (line 224)
+* grouping options: Invoking GCC. (line 26)
+* H in constraint: Simple Constraints. (line 88)
+* hardware models and configurations, specifying: Submodel Options.
+ (line 6)
+* hex floats: Hex Floats. (line 6)
+* HK fixed-suffix: Fixed-Point. (line 6)
+* hk fixed-suffix: Fixed-Point. (line 6)
+* hosted environment <1>: C Dialect Options. (line 204)
+* hosted environment: Standards. (line 13)
+* hosted implementation: Standards. (line 13)
+* hot function attribute: Function Attributes.
+ (line 839)
+* HPPA Options: HPPA Options. (line 6)
+* HR fixed-suffix: Fixed-Point. (line 6)
+* hr fixed-suffix: Fixed-Point. (line 6)
+* hypot: Other Builtins. (line 6)
+* hypotf: Other Builtins. (line 6)
+* hypotl: Other Builtins. (line 6)
+* I in constraint: Simple Constraints. (line 71)
+* i in constraint: Simple Constraints. (line 60)
+* i386 and x86-64 Windows Options: i386 and x86-64 Windows Options.
+ (line 6)
+* i386 Options: i386 and x86-64 Options.
+ (line 6)
+* IA-64 Options: IA-64 Options. (line 6)
+* IBM RS/6000 and PowerPC Options: RS/6000 and PowerPC Options.
+ (line 6)
+* identifier names, dollar signs in: Dollar Signs. (line 6)
+* identifiers, names in assembler code: Asm Labels. (line 6)
+* ilogb: Other Builtins. (line 6)
+* ilogbf: Other Builtins. (line 6)
+* ilogbl: Other Builtins. (line 6)
+* imaxabs: Other Builtins. (line 6)
+* implementation-defined behavior, C language: C Implementation.
+ (line 6)
+* implied #pragma implementation: C++ Interface. (line 46)
+* incompatibilities of GCC: Incompatibilities. (line 6)
+* increment operators: Bug Criteria. (line 17)
+* index: Other Builtins. (line 6)
+* indirect calls on ARM: Function Attributes.
+ (line 587)
+* indirect calls on MIPS: Function Attributes.
+ (line 609)
+* init_priority attribute: C++ Attributes. (line 9)
+* initializations in expressions: Compound Literals. (line 6)
+* initializers with labeled elements: Designated Inits. (line 6)
+* initializers, non-constant: Initializers. (line 6)
+* inline automatic for C++ member fns: Inline. (line 71)
+* inline functions: Inline. (line 6)
+* inline functions, omission of: Inline. (line 51)
+* inlining and C++ pragmas: C++ Interface. (line 66)
+* installation trouble: Trouble. (line 6)
+* integrating function code: Inline. (line 6)
+* Intel 386 Options: i386 and x86-64 Options.
+ (line 6)
+* interface and implementation headers, C++: C++ Interface. (line 6)
+* intermediate C version, nonexistent: G++ and GCC. (line 35)
+* interrupt handler functions: Function Attributes.
+ (line 532)
+* interrupt handler functions on the Blackfin, m68k, H8/300 and SH processors: Function Attributes.
+ (line 557)
+* interrupt service routines on ARM: Function Attributes.
+ (line 572)
+* interrupt thread functions on fido: Function Attributes.
+ (line 564)
+* introduction: Top. (line 6)
+* invalid assembly code: Bug Criteria. (line 12)
+* invalid input: Bug Criteria. (line 42)
+* invoking g++: Invoking G++. (line 22)
+* isalnum: Other Builtins. (line 6)
+* isalpha: Other Builtins. (line 6)
+* isascii: Other Builtins. (line 6)
+* isblank: Other Builtins. (line 6)
+* iscntrl: Other Builtins. (line 6)
+* isdigit: Other Builtins. (line 6)
+* isgraph: Other Builtins. (line 6)
+* islower: Other Builtins. (line 6)
+* ISO 9899: Standards. (line 13)
+* ISO C: Standards. (line 13)
+* ISO C standard: Standards. (line 13)
+* ISO C90: Standards. (line 13)
+* ISO C94: Standards. (line 13)
+* ISO C95: Standards. (line 13)
+* ISO C99: Standards. (line 13)
+* ISO C9X: Standards. (line 13)
+* ISO support: C Dialect Options. (line 10)
+* ISO/IEC 9899: Standards. (line 13)
+* isprint: Other Builtins. (line 6)
+* ispunct: Other Builtins. (line 6)
+* isspace: Other Builtins. (line 6)
+* isupper: Other Builtins. (line 6)
+* iswalnum: Other Builtins. (line 6)
+* iswalpha: Other Builtins. (line 6)
+* iswblank: Other Builtins. (line 6)
+* iswcntrl: Other Builtins. (line 6)
+* iswdigit: Other Builtins. (line 6)
+* iswgraph: Other Builtins. (line 6)
+* iswlower: Other Builtins. (line 6)
+* iswprint: Other Builtins. (line 6)
+* iswpunct: Other Builtins. (line 6)
+* iswspace: Other Builtins. (line 6)
+* iswupper: Other Builtins. (line 6)
+* iswxdigit: Other Builtins. (line 6)
+* isxdigit: Other Builtins. (line 6)
+* j0: Other Builtins. (line 6)
+* j0f: Other Builtins. (line 6)
+* j0l: Other Builtins. (line 6)
+* j1: Other Builtins. (line 6)
+* j1f: Other Builtins. (line 6)
+* j1l: Other Builtins. (line 6)
+* Java: G++ and GCC. (line 6)
+* java_interface attribute: C++ Attributes. (line 29)
+* jn: Other Builtins. (line 6)
+* jnf: Other Builtins. (line 6)
+* jnl: Other Builtins. (line 6)
+* K fixed-suffix: Fixed-Point. (line 6)
+* k fixed-suffix: Fixed-Point. (line 6)
+* keywords, alternate: Alternate Keywords. (line 6)
+* known causes of trouble: Trouble. (line 6)
+* l1_data variable attribute: Variable Attributes.
+ (line 317)
+* l1_data_A variable attribute: Variable Attributes.
+ (line 317)
+* l1_data_B variable attribute: Variable Attributes.
+ (line 317)
+* l1_text function attribute: Function Attributes.
+ (line 581)
+* labeled elements in initializers: Designated Inits. (line 6)
+* labels as values: Labels as Values. (line 6)
+* labs: Other Builtins. (line 6)
+* LANG: Environment Variables.
+ (line 21)
+* language dialect options: C Dialect Options. (line 6)
+* LC_ALL: Environment Variables.
+ (line 21)
+* LC_CTYPE: Environment Variables.
+ (line 21)
+* LC_MESSAGES: Environment Variables.
+ (line 21)
+* ldexp: Other Builtins. (line 6)
+* ldexpf: Other Builtins. (line 6)
+* ldexpl: Other Builtins. (line 6)
+* length-zero arrays: Zero Length. (line 6)
+* lgamma: Other Builtins. (line 6)
+* lgamma_r: Other Builtins. (line 6)
+* lgammaf: Other Builtins. (line 6)
+* lgammaf_r: Other Builtins. (line 6)
+* lgammal: Other Builtins. (line 6)
+* lgammal_r: Other Builtins. (line 6)
+* Libraries: Link Options. (line 24)
+* LIBRARY_PATH: Environment Variables.
+ (line 94)
+* link options: Link Options. (line 6)
+* linker script: Link Options. (line 163)
+* LK fixed-suffix: Fixed-Point. (line 6)
+* lk fixed-suffix: Fixed-Point. (line 6)
+* LL integer suffix: Long Long. (line 6)
+* llabs: Other Builtins. (line 6)
+* LLK fixed-suffix: Fixed-Point. (line 6)
+* llk fixed-suffix: Fixed-Point. (line 6)
+* LLR fixed-suffix: Fixed-Point. (line 6)
+* llr fixed-suffix: Fixed-Point. (line 6)
+* llrint: Other Builtins. (line 6)
+* llrintf: Other Builtins. (line 6)
+* llrintl: Other Builtins. (line 6)
+* llround: Other Builtins. (line 6)
+* llroundf: Other Builtins. (line 6)
+* llroundl: Other Builtins. (line 6)
+* load address instruction: Simple Constraints. (line 144)
+* local labels: Local Labels. (line 6)
+* local variables in macros: Typeof. (line 42)
+* local variables, specifying registers: Local Reg Vars. (line 6)
+* locale: Environment Variables.
+ (line 21)
+* locale definition: Environment Variables.
+ (line 103)
+* log: Other Builtins. (line 6)
+* log10: Other Builtins. (line 6)
+* log10f: Other Builtins. (line 6)
+* log10l: Other Builtins. (line 6)
+* log1p: Other Builtins. (line 6)
+* log1pf: Other Builtins. (line 6)
+* log1pl: Other Builtins. (line 6)
+* log2: Other Builtins. (line 6)
+* log2f: Other Builtins. (line 6)
+* log2l: Other Builtins. (line 6)
+* logb: Other Builtins. (line 6)
+* logbf: Other Builtins. (line 6)
+* logbl: Other Builtins. (line 6)
+* logf: Other Builtins. (line 6)
+* logl: Other Builtins. (line 6)
+* long long data types: Long Long. (line 6)
+* longjmp: Global Reg Vars. (line 66)
+* longjmp incompatibilities: Incompatibilities. (line 39)
+* longjmp warnings: Warning Options. (line 570)
+* LR fixed-suffix: Fixed-Point. (line 6)
+* lr fixed-suffix: Fixed-Point. (line 6)
+* lrint: Other Builtins. (line 6)
+* lrintf: Other Builtins. (line 6)
+* lrintl: Other Builtins. (line 6)
+* lround: Other Builtins. (line 6)
+* lroundf: Other Builtins. (line 6)
+* lroundl: Other Builtins. (line 6)
+* m in constraint: Simple Constraints. (line 17)
+* M32C options: M32C Options. (line 6)
+* M32R/D options: M32R/D Options. (line 6)
+* M680x0 options: M680x0 Options. (line 6)
+* M68hc1x options: M68hc1x Options. (line 6)
+* machine dependent options: Submodel Options. (line 6)
+* machine specific constraints: Machine Constraints.
+ (line 6)
+* macro with variable arguments: Variadic Macros. (line 6)
+* macros containing asm: Extended Asm. (line 241)
+* macros, inline alternative: Inline. (line 6)
+* macros, local labels: Local Labels. (line 6)
+* macros, local variables in: Typeof. (line 42)
+* macros, statements in expressions: Statement Exprs. (line 6)
+* macros, types of arguments: Typeof. (line 6)
+* make: Preprocessor Options.
+ (line 172)
+* malloc: Other Builtins. (line 6)
+* malloc attribute: Function Attributes.
+ (line 619)
+* matching constraint: Simple Constraints. (line 129)
+* MCore options: MCore Options. (line 6)
+* member fns, automatically inline: Inline. (line 71)
+* memchr: Other Builtins. (line 6)
+* memcmp: Other Builtins. (line 6)
+* memcpy: Other Builtins. (line 6)
+* memory references in constraints: Simple Constraints. (line 17)
+* mempcpy: Other Builtins. (line 6)
+* memset: Other Builtins. (line 6)
+* Mercury: G++ and GCC. (line 23)
+* message formatting: Language Independent Options.
+ (line 6)
+* messages, warning: Warning Options. (line 6)
+* messages, warning and error: Warnings and Errors.
+ (line 6)
+* middle-operands, omitted: Conditionals. (line 6)
+* MIPS options: MIPS Options. (line 6)
+* mips16 attribute: Function Attributes.
+ (line 629)
+* misunderstandings in C++: C++ Misunderstandings.
+ (line 6)
+* mixed declarations and code: Mixed Declarations. (line 6)
+* mktemp, and constant strings: Incompatibilities. (line 13)
+* MMIX Options: MMIX Options. (line 6)
+* MN10300 options: MN10300 Options. (line 6)
+* mode attribute: Variable Attributes.
+ (line 131)
+* modf: Other Builtins. (line 6)
+* modff: Other Builtins. (line 6)
+* modfl: Other Builtins. (line 6)
+* modifiers in constraints: Modifiers. (line 6)
+* ms_abi attribute: Function Attributes.
+ (line 671)
+* ms_struct: Type Attributes. (line 309)
+* ms_struct attribute: Variable Attributes.
+ (line 349)
+* mudflap: Optimize Options. (line 338)
+* multiple alternative constraints: Multi-Alternative. (line 6)
+* multiprecision arithmetic: Long Long. (line 6)
+* n in constraint: Simple Constraints. (line 65)
+* names used in assembler code: Asm Labels. (line 6)
+* naming convention, implementation headers: C++ Interface. (line 46)
+* nearbyint: Other Builtins. (line 6)
+* nearbyintf: Other Builtins. (line 6)
+* nearbyintl: Other Builtins. (line 6)
+* nested functions: Nested Functions. (line 6)
+* newlines (escaped): Escaped Newlines. (line 6)
+* nextafter: Other Builtins. (line 6)
+* nextafterf: Other Builtins. (line 6)
+* nextafterl: Other Builtins. (line 6)
+* nexttoward: Other Builtins. (line 6)
+* nexttowardf: Other Builtins. (line 6)
+* nexttowardl: Other Builtins. (line 6)
+* NFC: Warning Options. (line 1076)
+* NFKC: Warning Options. (line 1076)
+* NMI handler functions on the Blackfin processor: Function Attributes.
+ (line 706)
+* no_instrument_function function attribute: Function Attributes.
+ (line 712)
+* nocommon attribute: Variable Attributes.
+ (line 105)
+* noinline function attribute: Function Attributes.
+ (line 717)
+* nomips16 attribute: Function Attributes.
+ (line 629)
+* non-constant initializers: Initializers. (line 6)
+* non-static inline function: Inline. (line 85)
+* nonnull function attribute: Function Attributes.
+ (line 727)
+* noreturn function attribute: Function Attributes.
+ (line 750)
+* nothrow function attribute: Function Attributes.
+ (line 792)
+* o in constraint: Simple Constraints. (line 23)
+* OBJC_INCLUDE_PATH: Environment Variables.
+ (line 129)
+* Objective-C <1>: Standards. (line 153)
+* Objective-C: G++ and GCC. (line 6)
+* Objective-C and Objective-C++ options, command line: Objective-C and Objective-C++ Dialect Options.
+ (line 6)
+* Objective-C++ <1>: Standards. (line 153)
+* Objective-C++: G++ and GCC. (line 6)
+* offsettable address: Simple Constraints. (line 23)
+* old-style function definitions: Function Prototypes.
+ (line 6)
+* omitted middle-operands: Conditionals. (line 6)
+* open coding: Inline. (line 6)
+* openmp parallel: C Dialect Options. (line 221)
+* operand constraints, asm: Constraints. (line 6)
+* optimize function attribute: Function Attributes.
+ (line 800)
+* optimize options: Optimize Options. (line 6)
+* options to control diagnostics formatting: Language Independent Options.
+ (line 6)
+* options to control warnings: Warning Options. (line 6)
+* options, C++: C++ Dialect Options.
+ (line 6)
+* options, code generation: Code Gen Options. (line 6)
+* options, debugging: Debugging Options. (line 6)
+* options, dialect: C Dialect Options. (line 6)
+* options, directory search: Directory Options. (line 6)
+* options, GCC command: Invoking GCC. (line 6)
+* options, grouping: Invoking GCC. (line 26)
+* options, linking: Link Options. (line 6)
+* options, Objective-C and Objective-C++: Objective-C and Objective-C++ Dialect Options.
+ (line 6)
+* options, optimization: Optimize Options. (line 6)
+* options, order: Invoking GCC. (line 30)
+* options, preprocessor: Preprocessor Options.
+ (line 6)
+* order of evaluation, side effects: Non-bugs. (line 196)
+* order of options: Invoking GCC. (line 30)
+* other register constraints: Simple Constraints. (line 153)
+* output file option: Overall Options. (line 186)
+* overloaded virtual fn, warning: C++ Dialect Options.
+ (line 464)
+* p in constraint: Simple Constraints. (line 144)
+* packed attribute: Variable Attributes.
+ (line 142)
+* parameter forward declaration: Variable Length. (line 60)
+* parameters, aliased: Code Gen Options. (line 409)
+* Pascal: G++ and GCC. (line 23)
+* PDP-11 Options: PDP-11 Options. (line 6)
+* PIC: Code Gen Options. (line 184)
+* picoChip options: picoChip Options. (line 6)
+* pmf: Bound member functions.
+ (line 6)
+* pointer arguments: Function Attributes.
+ (line 181)
+* pointer to member function: Bound member functions.
+ (line 6)
+* portions of temporary objects, pointers to: Temporaries. (line 6)
+* pow: Other Builtins. (line 6)
+* pow10: Other Builtins. (line 6)
+* pow10f: Other Builtins. (line 6)
+* pow10l: Other Builtins. (line 6)
+* PowerPC options: PowerPC Options. (line 6)
+* powf: Other Builtins. (line 6)
+* powl: Other Builtins. (line 6)
+* pragma GCC optimize: Function Specific Option Pragmas.
+ (line 20)
+* pragma GCC pop_options: Function Specific Option Pragmas.
+ (line 33)
+* pragma GCC push_options: Function Specific Option Pragmas.
+ (line 33)
+* pragma GCC reset_options: Function Specific Option Pragmas.
+ (line 43)
+* pragma GCC target: Function Specific Option Pragmas.
+ (line 7)
+* pragma, align: Solaris Pragmas. (line 11)
+* pragma, diagnostic: Diagnostic Pragmas. (line 14)
+* pragma, extern_prefix: Symbol-Renaming Pragmas.
+ (line 19)
+* pragma, fini: Solaris Pragmas. (line 19)
+* pragma, init: Solaris Pragmas. (line 24)
+* pragma, long_calls: ARM Pragmas. (line 11)
+* pragma, long_calls_off: ARM Pragmas. (line 17)
+* pragma, longcall: RS/6000 and PowerPC Pragmas.
+ (line 14)
+* pragma, mark: Darwin Pragmas. (line 11)
+* pragma, memregs: M32C Pragmas. (line 7)
+* pragma, no_long_calls: ARM Pragmas. (line 14)
+* pragma, options align: Darwin Pragmas. (line 14)
+* pragma, pop_macro: Push/Pop Macro Pragmas.
+ (line 15)
+* pragma, push_macro: Push/Pop Macro Pragmas.
+ (line 11)
+* pragma, reason for not using: Function Attributes.
+ (line 1344)
+* pragma, redefine_extname: Symbol-Renaming Pragmas.
+ (line 14)
+* pragma, segment: Darwin Pragmas. (line 21)
+* pragma, unused: Darwin Pragmas. (line 24)
+* pragma, visibility: Visibility Pragmas. (line 8)
+* pragma, weak: Weak Pragmas. (line 10)
+* pragmas: Pragmas. (line 6)
+* pragmas in C++, effect on inlining: C++ Interface. (line 66)
+* pragmas, interface and implementation: C++ Interface. (line 6)
+* pragmas, warning of unknown: Warning Options. (line 587)
+* precompiled headers: Precompiled Headers.
+ (line 6)
+* preprocessing numbers: Incompatibilities. (line 173)
+* preprocessing tokens: Incompatibilities. (line 173)
+* preprocessor options: Preprocessor Options.
+ (line 6)
+* printf: Other Builtins. (line 6)
+* printf_unlocked: Other Builtins. (line 6)
+* prof: Debugging Options. (line 218)
+* progmem variable attribute: Variable Attributes.
+ (line 503)
+* promotion of formal parameters: Function Prototypes.
+ (line 6)
+* pure function attribute: Function Attributes.
+ (line 817)
+* push address instruction: Simple Constraints. (line 144)
+* putchar: Other Builtins. (line 6)
+* puts: Other Builtins. (line 6)
+* Q floating point suffix: Floating Types. (line 6)
+* q floating point suffix: Floating Types. (line 6)
+* qsort, and global register variables: Global Reg Vars. (line 42)
+* question mark: Multi-Alternative. (line 27)
+* R fixed-suffix: Fixed-Point. (line 6)
+* r fixed-suffix: Fixed-Point. (line 6)
+* r in constraint: Simple Constraints. (line 56)
+* ranges in case statements: Case Ranges. (line 6)
+* read-only strings: Incompatibilities. (line 9)
+* register variable after longjmp: Global Reg Vars. (line 66)
+* registers: Extended Asm. (line 6)
+* registers for local variables: Local Reg Vars. (line 6)
+* registers in constraints: Simple Constraints. (line 56)
+* registers, global allocation: Explicit Reg Vars. (line 6)
+* registers, global variables in: Global Reg Vars. (line 6)
+* regparm attribute: Function Attributes.
+ (line 870)
+* relocation truncated to fit (ColdFire): M680x0 Options. (line 325)
+* relocation truncated to fit (MIPS): MIPS Options. (line 198)
+* remainder: Other Builtins. (line 6)
+* remainderf: Other Builtins. (line 6)
+* remainderl: Other Builtins. (line 6)
+* remquo: Other Builtins. (line 6)
+* remquof: Other Builtins. (line 6)
+* remquol: Other Builtins. (line 6)
+* reordering, warning: C++ Dialect Options.
+ (line 389)
+* reporting bugs: Bugs. (line 6)
+* resbank attribute: Function Attributes.
+ (line 902)
+* rest argument (in macro): Variadic Macros. (line 6)
+* restricted pointers: Restricted Pointers.
+ (line 6)
+* restricted references: Restricted Pointers.
+ (line 6)
+* restricted this pointer: Restricted Pointers.
+ (line 6)
+* returns_twice attribute: Function Attributes.
+ (line 916)
+* rindex: Other Builtins. (line 6)
+* rint: Other Builtins. (line 6)
+* rintf: Other Builtins. (line 6)
+* rintl: Other Builtins. (line 6)
+* round: Other Builtins. (line 6)
+* roundf: Other Builtins. (line 6)
+* roundl: Other Builtins. (line 6)
+* RS/6000 and PowerPC Options: RS/6000 and PowerPC Options.
+ (line 6)
+* RTTI: Vague Linkage. (line 43)
+* run-time options: Code Gen Options. (line 6)
+* s in constraint: Simple Constraints. (line 92)
+* S/390 and zSeries Options: S/390 and zSeries Options.
+ (line 6)
+* save all registers on the Blackfin, H8/300, H8/300H, and H8S: Function Attributes.
+ (line 925)
+* scalb: Other Builtins. (line 6)
+* scalbf: Other Builtins. (line 6)
+* scalbl: Other Builtins. (line 6)
+* scalbln: Other Builtins. (line 6)
+* scalblnf: Other Builtins. (line 6)
+* scalbn: Other Builtins. (line 6)
+* scalbnf: Other Builtins. (line 6)
+* scanf, and constant strings: Incompatibilities. (line 17)
+* scanfnl: Other Builtins. (line 6)
+* scope of a variable length array: Variable Length. (line 23)
+* scope of declaration: Disappointments. (line 21)
+* scope of external declarations: Incompatibilities. (line 80)
+* Score Options: Score Options. (line 6)
+* search path: Directory Options. (line 6)
+* section function attribute: Function Attributes.
+ (line 930)
+* section variable attribute: Variable Attributes.
+ (line 163)
+* sentinel function attribute: Function Attributes.
+ (line 946)
+* setjmp: Global Reg Vars. (line 66)
+* setjmp incompatibilities: Incompatibilities. (line 39)
+* shared strings: Incompatibilities. (line 9)
+* shared variable attribute: Variable Attributes.
+ (line 208)
+* side effect in ?:: Conditionals. (line 20)
+* side effects, macro argument: Statement Exprs. (line 35)
+* side effects, order of evaluation: Non-bugs. (line 196)
+* signal handler functions on the AVR processors: Function Attributes.
+ (line 977)
+* signbit: Other Builtins. (line 6)
+* signbitd128: Other Builtins. (line 6)
+* signbitd32: Other Builtins. (line 6)
+* signbitd64: Other Builtins. (line 6)
+* signbitf: Other Builtins. (line 6)
+* signbitl: Other Builtins. (line 6)
+* signed and unsigned values, comparison warning: Warning Options.
+ (line 940)
+* significand: Other Builtins. (line 6)
+* significandf: Other Builtins. (line 6)
+* significandl: Other Builtins. (line 6)
+* simple constraints: Simple Constraints. (line 6)
+* sin: Other Builtins. (line 6)
+* sincos: Other Builtins. (line 6)
+* sincosf: Other Builtins. (line 6)
+* sincosl: Other Builtins. (line 6)
+* sinf: Other Builtins. (line 6)
+* sinh: Other Builtins. (line 6)
+* sinhf: Other Builtins. (line 6)
+* sinhl: Other Builtins. (line 6)
+* sinl: Other Builtins. (line 6)
+* sizeof: Typeof. (line 6)
+* smaller data references: M32R/D Options. (line 57)
+* smaller data references (PowerPC): RS/6000 and PowerPC Options.
+ (line 663)
+* snprintf: Other Builtins. (line 6)
+* SPARC options: SPARC Options. (line 6)
+* Spec Files: Spec Files. (line 6)
+* specified registers: Explicit Reg Vars. (line 6)
+* specifying compiler version and target machine: Target Options.
+ (line 6)
+* specifying hardware config: Submodel Options. (line 6)
+* specifying machine version: Target Options. (line 6)
+* specifying registers for local variables: Local Reg Vars. (line 6)
+* speed of compilation: Precompiled Headers.
+ (line 6)
+* sprintf: Other Builtins. (line 6)
+* SPU options: SPU Options. (line 6)
+* sqrt: Other Builtins. (line 6)
+* sqrtf: Other Builtins. (line 6)
+* sqrtl: Other Builtins. (line 6)
+* sscanf: Other Builtins. (line 6)
+* sscanf, and constant strings: Incompatibilities. (line 17)
+* sseregparm attribute: Function Attributes.
+ (line 887)
+* statements inside expressions: Statement Exprs. (line 6)
+* static data in C++, declaring and defining: Static Definitions.
+ (line 6)
+* stpcpy: Other Builtins. (line 6)
+* stpncpy: Other Builtins. (line 6)
+* strcasecmp: Other Builtins. (line 6)
+* strcat: Other Builtins. (line 6)
+* strchr: Other Builtins. (line 6)
+* strcmp: Other Builtins. (line 6)
+* strcpy: Other Builtins. (line 6)
+* strcspn: Other Builtins. (line 6)
+* strdup: Other Builtins. (line 6)
+* strfmon: Other Builtins. (line 6)
+* strftime: Other Builtins. (line 6)
+* string constants: Incompatibilities. (line 9)
+* strlen: Other Builtins. (line 6)
+* strncasecmp: Other Builtins. (line 6)
+* strncat: Other Builtins. (line 6)
+* strncmp: Other Builtins. (line 6)
+* strncpy: Other Builtins. (line 6)
+* strndup: Other Builtins. (line 6)
+* strpbrk: Other Builtins. (line 6)
+* strrchr: Other Builtins. (line 6)
+* strspn: Other Builtins. (line 6)
+* strstr: Other Builtins. (line 6)
+* struct: Unnamed Fields. (line 6)
+* structures: Incompatibilities. (line 146)
+* structures, constructor expression: Compound Literals. (line 6)
+* submodel options: Submodel Options. (line 6)
+* subscripting: Subscripting. (line 6)
+* subscripting and function values: Subscripting. (line 6)
+* suffixes for C++ source: Invoking G++. (line 6)
+* SUNPRO_DEPENDENCIES: Environment Variables.
+ (line 169)
+* suppressing warnings: Warning Options. (line 6)
+* surprises in C++: C++ Misunderstandings.
+ (line 6)
+* syntax checking: Warning Options. (line 13)
+* syscall_linkage attribute: Function Attributes.
+ (line 999)
+* system headers, warnings from: Warning Options. (line 701)
+* sysv_abi attribute: Function Attributes.
+ (line 671)
+* tan: Other Builtins. (line 6)
+* tanf: Other Builtins. (line 6)
+* tanh: Other Builtins. (line 6)
+* tanhf: Other Builtins. (line 6)
+* tanhl: Other Builtins. (line 6)
+* tanl: Other Builtins. (line 6)
+* target function attribute: Function Attributes.
+ (line 1006)
+* target machine, specifying: Target Options. (line 6)
+* target options: Target Options. (line 6)
+* target("abm") attribute: Function Attributes.
+ (line 1033)
+* target("aes") attribute: Function Attributes.
+ (line 1038)
+* target("align-stringops") attribute: Function Attributes.
+ (line 1120)
+* target("arch=ARCH") attribute: Function Attributes.
+ (line 1129)
+* target("cld") attribute: Function Attributes.
+ (line 1091)
+* target("fancy-math-387") attribute: Function Attributes.
+ (line 1095)
+* target("fpmath=FPMATH") attribute: Function Attributes.
+ (line 1137)
+* target("fused-madd") attribute: Function Attributes.
+ (line 1100)
+* target("ieee-fp") attribute: Function Attributes.
+ (line 1105)
+* target("inline-all-stringops") attribute: Function Attributes.
+ (line 1110)
+* target("inline-stringops-dynamically") attribute: Function Attributes.
+ (line 1114)
+* target("mmx") attribute: Function Attributes.
+ (line 1042)
+* target("pclmul") attribute: Function Attributes.
+ (line 1046)
+* target("popcnt") attribute: Function Attributes.
+ (line 1050)
+* target("recip") attribute: Function Attributes.
+ (line 1124)
+* target("sse") attribute: Function Attributes.
+ (line 1054)
+* target("sse2") attribute: Function Attributes.
+ (line 1058)
+* target("sse3") attribute: Function Attributes.
+ (line 1062)
+* target("sse4") attribute: Function Attributes.
+ (line 1066)
+* target("sse4.1") attribute: Function Attributes.
+ (line 1071)
+* target("sse4.2") attribute: Function Attributes.
+ (line 1075)
+* target("sse4a") attribute: Function Attributes.
+ (line 1079)
+* target("sse5") attribute: Function Attributes.
+ (line 1083)
+* target("ssse3") attribute: Function Attributes.
+ (line 1087)
+* target("tune=TUNE") attribute: Function Attributes.
+ (line 1133)
+* TC1: Standards. (line 13)
+* TC2: Standards. (line 13)
+* TC3: Standards. (line 13)
+* Technical Corrigenda: Standards. (line 13)
+* Technical Corrigendum 1: Standards. (line 13)
+* Technical Corrigendum 2: Standards. (line 13)
+* Technical Corrigendum 3: Standards. (line 13)
+* template instantiation: Template Instantiation.
+ (line 6)
+* temporaries, lifetime of: Temporaries. (line 6)
+* tgamma: Other Builtins. (line 6)
+* tgammaf: Other Builtins. (line 6)
+* tgammal: Other Builtins. (line 6)
+* Thread-Local Storage: Thread-Local. (line 6)
+* thunks: Nested Functions. (line 6)
+* tiny data section on the H8/300H and H8S: Function Attributes.
+ (line 1155)
+* TLS: Thread-Local. (line 6)
+* tls_model attribute: Variable Attributes.
+ (line 232)
+* TMPDIR: Environment Variables.
+ (line 45)
+* toascii: Other Builtins. (line 6)
+* tolower: Other Builtins. (line 6)
+* toupper: Other Builtins. (line 6)
+* towlower: Other Builtins. (line 6)
+* towupper: Other Builtins. (line 6)
+* traditional C language: C Dialect Options. (line 250)
+* trunc: Other Builtins. (line 6)
+* truncf: Other Builtins. (line 6)
+* truncl: Other Builtins. (line 6)
+* two-stage name lookup: Name lookup. (line 6)
+* type alignment: Alignment. (line 6)
+* type attributes: Type Attributes. (line 6)
+* type_info: Vague Linkage. (line 43)
+* typedef names as function parameters: Incompatibilities. (line 97)
+* typeof: Typeof. (line 6)
+* UHK fixed-suffix: Fixed-Point. (line 6)
+* uhk fixed-suffix: Fixed-Point. (line 6)
+* UHR fixed-suffix: Fixed-Point. (line 6)
+* uhr fixed-suffix: Fixed-Point. (line 6)
+* UK fixed-suffix: Fixed-Point. (line 6)
+* uk fixed-suffix: Fixed-Point. (line 6)
+* ULK fixed-suffix: Fixed-Point. (line 6)
+* ulk fixed-suffix: Fixed-Point. (line 6)
+* ULL integer suffix: Long Long. (line 6)
+* ULLK fixed-suffix: Fixed-Point. (line 6)
+* ullk fixed-suffix: Fixed-Point. (line 6)
+* ULLR fixed-suffix: Fixed-Point. (line 6)
+* ullr fixed-suffix: Fixed-Point. (line 6)
+* ULR fixed-suffix: Fixed-Point. (line 6)
+* ulr fixed-suffix: Fixed-Point. (line 6)
+* undefined behavior: Bug Criteria. (line 17)
+* undefined function value: Bug Criteria. (line 17)
+* underscores in variables in macros: Typeof. (line 42)
+* union: Unnamed Fields. (line 6)
+* union, casting to a: Cast to Union. (line 6)
+* unions: Incompatibilities. (line 146)
+* unknown pragmas, warning: Warning Options. (line 587)
+* unresolved references and -nodefaultlibs: Link Options. (line 79)
+* unresolved references and -nostdlib: Link Options. (line 79)
+* unused attribute.: Function Attributes.
+ (line 1167)
+* UR fixed-suffix: Fixed-Point. (line 6)
+* ur fixed-suffix: Fixed-Point. (line 6)
+* used attribute.: Function Attributes.
+ (line 1172)
+* User stack pointer in interrupts on the Blackfin: Function Attributes.
+ (line 576)
+* V in constraint: Simple Constraints. (line 43)
+* V850 Options: V850 Options. (line 6)
+* vague linkage: Vague Linkage. (line 6)
+* value after longjmp: Global Reg Vars. (line 66)
+* variable addressability on the IA-64: Function Attributes.
+ (line 643)
+* variable addressability on the M32R/D: Variable Attributes.
+ (line 330)
+* variable alignment: Alignment. (line 6)
+* variable attributes: Variable Attributes.
+ (line 6)
+* variable number of arguments: Variadic Macros. (line 6)
+* variable-length array scope: Variable Length. (line 23)
+* variable-length arrays: Variable Length. (line 6)
+* variables in specified registers: Explicit Reg Vars. (line 6)
+* variables, local, in macros: Typeof. (line 42)
+* variadic macros: Variadic Macros. (line 6)
+* VAX options: VAX Options. (line 6)
+* version_id attribute: Function Attributes.
+ (line 1178)
+* vfprintf: Other Builtins. (line 6)
+* vfscanf: Other Builtins. (line 6)
+* visibility attribute: Function Attributes.
+ (line 1188)
+* VLAs: Variable Length. (line 6)
+* void pointers, arithmetic: Pointer Arith. (line 6)
+* void, size of pointer to: Pointer Arith. (line 6)
+* volatile access: Volatiles. (line 6)
+* volatile applied to function: Function Attributes.
+ (line 6)
+* volatile read: Volatiles. (line 6)
+* volatile write: Volatiles. (line 6)
+* vprintf: Other Builtins. (line 6)
+* vscanf: Other Builtins. (line 6)
+* vsnprintf: Other Builtins. (line 6)
+* vsprintf: Other Builtins. (line 6)
+* vsscanf: Other Builtins. (line 6)
+* vtable: Vague Linkage. (line 28)
+* VxWorks Options: VxWorks Options. (line 6)
+* W floating point suffix: Floating Types. (line 6)
+* w floating point suffix: Floating Types. (line 6)
+* warn_unused_result attribute: Function Attributes.
+ (line 1282)
+* warning for comparison of signed and unsigned values: Warning Options.
+ (line 940)
+* warning for overloaded virtual fn: C++ Dialect Options.
+ (line 464)
+* warning for reordering of member initializers: C++ Dialect Options.
+ (line 389)
+* warning for unknown pragmas: Warning Options. (line 587)
+* warning function attribute: Function Attributes.
+ (line 158)
+* warning messages: Warning Options. (line 6)
+* warnings from system headers: Warning Options. (line 701)
+* warnings vs errors: Warnings and Errors.
+ (line 6)
+* weak attribute: Function Attributes.
+ (line 1299)
+* weakref attribute: Function Attributes.
+ (line 1308)
+* whitespace: Incompatibilities. (line 112)
+* X in constraint: Simple Constraints. (line 114)
+* X3.159-1989: Standards. (line 13)
+* x86-64 options: x86-64 Options. (line 6)
+* x86-64 Options: i386 and x86-64 Options.
+ (line 6)
+* Xstormy16 Options: Xstormy16 Options. (line 6)
+* Xtensa Options: Xtensa Options. (line 6)
+* y0: Other Builtins. (line 6)
+* y0f: Other Builtins. (line 6)
+* y0l: Other Builtins. (line 6)
+* y1: Other Builtins. (line 6)
+* y1f: Other Builtins. (line 6)
+* y1l: Other Builtins. (line 6)
+* yn: Other Builtins. (line 6)
+* ynf: Other Builtins. (line 6)
+* ynl: Other Builtins. (line 6)
+* zero-length arrays: Zero Length. (line 6)
+* zero-size structures: Empty Structures. (line 6)
+* zSeries options: zSeries Options. (line 6)
+
+
+
+Tag Table:
+Node: Top2110
+Node: G++ and GCC3825
+Node: Standards5890
+Node: Invoking GCC14865
+Node: Option Summary18694
+Node: Overall Options51337
+Node: Invoking G++65172
+Node: C Dialect Options66695
+Node: C++ Dialect Options80586
+Node: Objective-C and Objective-C++ Dialect Options102180
+Node: Language Independent Options113961
+Node: Warning Options116731
+Node: Debugging Options175078
+Node: Optimize Options213897
+Ref: Type-punning260698
+Node: Preprocessor Options317109
+Ref: Wtrigraphs321194
+Ref: dashMF325942
+Ref: fdollars-in-identifiers336461
+Node: Assembler Options345022
+Node: Link Options345727
+Ref: Link Options-Footnote-1355197
+Node: Directory Options355531
+Node: Spec Files361593
+Node: Target Options381932
+Node: Submodel Options383450
+Node: ARC Options385149
+Node: ARM Options386636
+Node: AVR Options398870
+Node: Blackfin Options400959
+Node: CRIS Options408851
+Node: CRX Options412592
+Node: Darwin Options413017
+Node: DEC Alpha Options420510
+Node: DEC Alpha/VMS Options432426
+Node: FR30 Options432812
+Node: FRV Options433387
+Node: GNU/Linux Options440104
+Node: H8/300 Options440562
+Node: HPPA Options441629
+Node: i386 and x86-64 Options451129
+Node: IA-64 Options479114
+Node: M32C Options486439
+Node: M32R/D Options487730
+Node: M680x0 Options491317
+Node: M68hc1x Options505137
+Node: MCore Options506705
+Node: MIPS Options508213
+Node: MMIX Options534248
+Node: MN10300 Options536730
+Node: PDP-11 Options538152
+Node: picoChip Options539992
+Node: PowerPC Options542191
+Node: RS/6000 and PowerPC Options542427
+Node: S/390 and zSeries Options573174
+Node: Score Options581122
+Node: SH Options581950
+Node: SPARC Options592228
+Node: SPU Options603201
+Node: System V Options606489
+Node: V850 Options607312
+Node: VAX Options610452
+Node: VxWorks Options611000
+Node: x86-64 Options612155
+Node: i386 and x86-64 Windows Options612373
+Node: Xstormy16 Options614692
+Node: Xtensa Options614981
+Node: zSeries Options619128
+Node: Code Gen Options619324
+Node: Environment Variables643903
+Node: Precompiled Headers651799
+Node: Running Protoize658025
+Node: C Implementation664362
+Node: Translation implementation666025
+Node: Environment implementation666599
+Node: Identifiers implementation667149
+Node: Characters implementation668203
+Node: Integers implementation671009
+Node: Floating point implementation672834
+Node: Arrays and pointers implementation675763
+Ref: Arrays and pointers implementation-Footnote-1677198
+Node: Hints implementation677322
+Node: Structures unions enumerations and bit-fields implementation678788
+Node: Qualifiers implementation680774
+Node: Declarators implementation682546
+Node: Statements implementation682888
+Node: Preprocessing directives implementation683215
+Node: Library functions implementation685320
+Node: Architecture implementation685960
+Node: Locale-specific behavior implementation686663
+Node: C Extensions686968
+Node: Statement Exprs691579
+Node: Local Labels696092
+Node: Labels as Values699071
+Ref: Labels as Values-Footnote-1701444
+Node: Nested Functions701627
+Node: Constructing Calls705521
+Node: Typeof710244
+Node: Conditionals713410
+Node: Long Long714301
+Node: Complex715802
+Node: Floating Types718372
+Node: Decimal Float719451
+Node: Hex Floats721440
+Node: Fixed-Point722481
+Node: Zero Length725766
+Node: Empty Structures729044
+Node: Variable Length729460
+Node: Variadic Macros732227
+Node: Escaped Newlines734609
+Node: Subscripting735448
+Node: Pointer Arith736171
+Node: Initializers736739
+Node: Compound Literals737235
+Node: Designated Inits739410
+Node: Case Ranges743065
+Node: Cast to Union743748
+Node: Mixed Declarations744844
+Node: Function Attributes745350
+Node: Attribute Syntax807965
+Node: Function Prototypes818235
+Node: C++ Comments820016
+Node: Dollar Signs820535
+Node: Character Escapes821000
+Node: Alignment821294
+Node: Variable Attributes822668
+Ref: i386 Variable Attributes837258
+Node: Type Attributes843243
+Ref: i386 Type Attributes856864
+Ref: PowerPC Type Attributes857704
+Ref: SPU Type Attributes858566
+Node: Inline858857
+Node: Extended Asm863804
+Ref: Example of asm with clobbered asm reg869890
+Node: Constraints884109
+Node: Simple Constraints884959
+Node: Multi-Alternative891630
+Node: Modifiers893347
+Node: Machine Constraints896241
+Node: Asm Labels928454
+Node: Explicit Reg Vars930130
+Node: Global Reg Vars931738
+Node: Local Reg Vars936288
+Node: Alternate Keywords938729
+Node: Incomplete Enums940157
+Node: Function Names940914
+Node: Return Address943076
+Node: Vector Extensions945873
+Node: Offsetof949375
+Node: Atomic Builtins950189
+Node: Object Size Checking955567
+Node: Other Builtins960995
+Node: Target Builtins985803
+Node: Alpha Built-in Functions986697
+Node: ARM iWMMXt Built-in Functions989696
+Node: ARM NEON Intrinsics996415
+Node: Blackfin Built-in Functions1204253
+Node: FR-V Built-in Functions1204867
+Node: Argument Types1205726
+Node: Directly-mapped Integer Functions1207482
+Node: Directly-mapped Media Functions1208564
+Node: Raw read/write Functions1215596
+Node: Other Built-in Functions1216508
+Node: X86 Built-in Functions1217697
+Node: MIPS DSP Built-in Functions1262137
+Node: MIPS Paired-Single Support1274584
+Node: MIPS Loongson Built-in Functions1276085
+Node: Paired-Single Arithmetic1282603
+Node: Paired-Single Built-in Functions1283549
+Node: MIPS-3D Built-in Functions1286219
+Node: picoChip Built-in Functions1291594
+Node: Other MIPS Built-in Functions1292956
+Node: PowerPC AltiVec Built-in Functions1293480
+Node: SPARC VIS Built-in Functions1394904
+Node: SPU Built-in Functions1396596
+Node: Target Format Checks1398378
+Node: Solaris Format Checks1398785
+Node: Pragmas1399182
+Node: ARM Pragmas1399876
+Node: M32C Pragmas1400479
+Node: RS/6000 and PowerPC Pragmas1401055
+Node: Darwin Pragmas1401797
+Node: Solaris Pragmas1402864
+Node: Symbol-Renaming Pragmas1404025
+Node: Structure-Packing Pragmas1406647
+Node: Weak Pragmas1408299
+Node: Diagnostic Pragmas1409101
+Node: Visibility Pragmas1411735
+Node: Push/Pop Macro Pragmas1412487
+Node: Function Specific Option Pragmas1413460
+Node: Unnamed Fields1415675
+Node: Thread-Local1417185
+Node: C99 Thread-Local Edits1419294
+Node: C++98 Thread-Local Edits1421306
+Node: Binary constants1424751
+Node: C++ Extensions1425422
+Node: Volatiles1427064
+Node: Restricted Pointers1429740
+Node: Vague Linkage1431334
+Node: C++ Interface1434990
+Ref: C++ Interface-Footnote-11439287
+Node: Template Instantiation1439424
+Node: Bound member functions1446436
+Node: C++ Attributes1447979
+Node: Namespace Association1449637
+Node: Type Traits1451051
+Node: Java Exceptions1456598
+Node: Deprecated Features1457995
+Node: Backwards Compatibility1460960
+Node: Objective-C1462318
+Node: Executing code before main1462899
+Node: What you can and what you cannot do in +load1465505
+Node: Type encoding1467672
+Node: Garbage Collection1471059
+Node: Constant string objects1473683
+Node: compatibility_alias1476191
+Node: Compatibility1477069
+Node: Gcov1483636
+Node: Gcov Intro1484167
+Node: Invoking Gcov1486883
+Node: Gcov and Optimization1498744
+Node: Gcov Data Files1501397
+Node: Cross-profiling1502535
+Node: Trouble1504361
+Node: Actual Bugs1505917
+Node: Cross-Compiler Problems1506657
+Node: Interoperation1507071
+Node: Incompatibilities1514208
+Node: Fixed Headers1522358
+Node: Standard Libraries1524021
+Node: Disappointments1525393
+Node: C++ Misunderstandings1529751
+Node: Static Definitions1530570
+Node: Name lookup1531623
+Ref: Name lookup-Footnote-11536401
+Node: Temporaries1536588
+Node: Copy Assignment1538564
+Node: Protoize Caveats1540371
+Node: Non-bugs1544344
+Node: Warnings and Errors1554848
+Node: Bugs1556612
+Node: Bug Criteria1557176
+Node: Bug Reporting1559386
+Node: Service1559605
+Node: Contributing1560424
+Node: Funding1561164
+Node: GNU Project1563653
+Node: Copying1564299
+Node: GNU Free Documentation License1601827
+Node: Contributors1624233
+Node: Option Index1660560
+Node: Keyword Index1819728
+
+End Tag Table
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/info/gccinstall.info b/uclibc-crosstools-gcc-4.4.2-1/usr/info/gccinstall.info
new file mode 100644
index 0000000..f43ae92
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/info/gccinstall.info
@@ -0,0 +1,4234 @@
+This is doc/gccinstall.info, produced by makeinfo version 4.9 from
+/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/gcc-4.4.2/gcc/doc/install.texi.
+
+ Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free
+Software Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, the Front-Cover texts being (a) (see below), and
+with the Back-Cover Texts being (b) (see below). A copy of the license
+is included in the section entitled "GNU Free Documentation License".
+
+ (a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+ (b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+software. Copies published by the Free Software Foundation raise
+funds for GNU development.
+
+ Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free
+Software Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, the Front-Cover texts being (a) (see below), and
+with the Back-Cover Texts being (b) (see below). A copy of the license
+is included in the section entitled "GNU Free Documentation License".
+
+ (a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+ (b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+software. Copies published by the Free Software Foundation raise
+funds for GNU development.
+
+INFO-DIR-SECTION Software development
+START-INFO-DIR-ENTRY
+* gccinstall: (gccinstall). Installing the GNU Compiler Collection.
+END-INFO-DIR-ENTRY
+
+
+File: gccinstall.info, Node: Top, Up: (dir)
+
+* Menu:
+
+* Installing GCC:: This document describes the generic installation
+ procedure for GCC as well as detailing some target
+ specific installation instructions.
+
+* Specific:: Host/target specific installation notes for GCC.
+* Binaries:: Where to get pre-compiled binaries.
+
+* Old:: Old installation documentation.
+
+* GNU Free Documentation License:: How you can copy and share this manual.
+* Concept Index:: This index has two entries.
+
+
+File: gccinstall.info, Node: Installing GCC, Next: Binaries, Up: Top
+
+1 Installing GCC
+****************
+
+ The latest version of this document is always available at
+http://gcc.gnu.org/install/.
+
+ This document describes the generic installation procedure for GCC
+as well as detailing some target specific installation instructions.
+
+ GCC includes several components that previously were separate
+distributions with their own installation instructions. This document
+supersedes all package specific installation instructions.
+
+ _Before_ starting the build/install procedure please check the *Note
+host/target specific installation notes: Specific. We recommend you
+browse the entire generic installation instructions before you proceed.
+
+ Lists of successful builds for released versions of GCC are
+available at `http://gcc.gnu.org/buildstat.html'. These lists are
+updated as new information becomes available.
+
+ The installation procedure itself is broken into five steps.
+
+* Menu:
+
+* Prerequisites::
+* Downloading the source::
+* Configuration::
+* Building::
+* Testing:: (optional)
+* Final install::
+
+ Please note that GCC does not support `make uninstall' and probably
+won't do so in the near future as this would open a can of worms.
+Instead, we suggest that you install GCC into a directory of its own
+and simply remove that directory when you do not need that specific
+version of GCC any longer, and, if shared libraries are installed there
+as well, no more binaries exist that use them.
+
+
+File: gccinstall.info, Node: Prerequisites, Next: Downloading the source, Up: Installing GCC
+
+2 Prerequisites
+***************
+
+ GCC requires that various tools and packages be available for use in
+the build procedure. Modifying GCC sources requires additional tools
+described below.
+
+Tools/packages necessary for building GCC
+=========================================
+
+ISO C90 compiler
+ Necessary to bootstrap GCC, although versions of GCC prior to 3.4
+ also allow bootstrapping with a traditional (K&R) C compiler.
+
+ To build all languages in a cross-compiler or other configuration
+ where 3-stage bootstrap is not performed, you need to start with
+ an existing GCC binary (version 2.95 or later) because source code
+ for language frontends other than C might use GCC extensions.
+
+GNAT
+ In order to build the Ada compiler (GNAT) you must already have
+ GNAT installed because portions of the Ada frontend are written in
+ Ada (with GNAT extensions.) Refer to the Ada installation
+ instructions for more specific information.
+
+A "working" POSIX compatible shell, or GNU bash
+ Necessary when running `configure' because some `/bin/sh' shells
+ have bugs and may crash when configuring the target libraries. In
+ other cases, `/bin/sh' or `ksh' have disastrous corner-case
+ performance problems. This can cause target `configure' runs to
+ literally take days to complete in some cases.
+
+ So on some platforms `/bin/ksh' is sufficient, on others it isn't.
+ See the host/target specific instructions for your platform, or
+ use `bash' to be sure. Then set `CONFIG_SHELL' in your
+ environment to your "good" shell prior to running
+ `configure'/`make'.
+
+ `zsh' is not a fully compliant POSIX shell and will not work when
+ configuring GCC.
+
+A POSIX or SVR4 awk
+ Necessary for creating some of the generated source files for GCC.
+ If in doubt, use a recent GNU awk version, as some of the older
+ ones are broken. GNU awk version 3.1.5 is known to work.
+
+GNU binutils
+ Necessary in some circumstances, optional in others. See the
+ host/target specific instructions for your platform for the exact
+ requirements.
+
+gzip version 1.2.4 (or later) or
+bzip2 version 1.0.2 (or later)
+ Necessary to uncompress GCC `tar' files when source code is
+ obtained via FTP mirror sites.
+
+GNU make version 3.80 (or later)
+ You must have GNU make installed to build GCC.
+
+GNU tar version 1.14 (or later)
+ Necessary (only on some platforms) to untar the source code. Many
+ systems' `tar' programs will also work, only try GNU `tar' if you
+ have problems.
+
+GNU Multiple Precision Library (GMP) version 4.1 (or later)
+ Necessary to build GCC. If you do not have it installed in your
+ library search path, you will have to configure with the
+ `--with-gmp' configure option. See also `--with-gmp-lib' and
+ `--with-gmp-include'. Alternatively, if a GMP source distribution
+ is found in a subdirectory of your GCC sources named `gmp', it
+ will be built together with GCC.
+
+MPFR Library version 2.3.2 (or later)
+ Necessary to build GCC. It can be downloaded from
+ `http://www.mpfr.org/'. The version of MPFR that is bundled with
+ GMP 4.1.x contains numerous bugs. Although GCC may appear to
+ function with the buggy versions of MPFR, there are a few bugs
+ that will not be fixed when using this version. It is strongly
+ recommended to upgrade to the recommended version of MPFR.
+
+ The `--with-mpfr' configure option should be used if your MPFR
+ Library is not installed in your default library search path. See
+ also `--with-mpfr-lib' and `--with-mpfr-include'. Alternatively,
+ if a MPFR source distribution is found in a subdirectory of your
+ GCC sources named `mpfr', it will be built together with GCC.
+
+Parma Polyhedra Library (PPL) version 0.10
+ Necessary to build GCC with the Graphite loop optimizations. It
+ can be downloaded from `http://www.cs.unipr.it/ppl/Download/'.
+
+ The `--with-ppl' configure option should be used if PPL is not
+ installed in your default library search path.
+
+CLooG-PPL version 0.15
+ Necessary to build GCC with the Graphite loop optimizations. It
+ can be downloaded from `ftp://gcc.gnu.org/pub/gcc/infrastructure/'.
+ The code in `cloog-ppl-0.15.tar.gz' comes from a branch of CLooG
+ available from `http://repo.or.cz/w/cloog-ppl.git'. CLooG-PPL
+ should be configured with `--with-ppl'.
+
+ The `--with-cloog' configure option should be used if CLooG is not
+ installed in your default library search path.
+
+`jar', or InfoZIP (`zip' and `unzip')
+ Necessary to build libgcj, the GCJ runtime.
+
+
+Tools/packages necessary for modifying GCC
+==========================================
+
+autoconf version 2.59
+GNU m4 version 1.4 (or later)
+ Necessary when modifying `configure.ac', `aclocal.m4', etc. to
+ regenerate `configure' and `config.in' files.
+
+automake version 1.9.6
+ Necessary when modifying a `Makefile.am' file to regenerate its
+ associated `Makefile.in'.
+
+ Much of GCC does not use automake, so directly edit the
+ `Makefile.in' file. Specifically this applies to the `gcc',
+ `intl', `libcpp', `libiberty', `libobjc' directories as well as
+ any of their subdirectories.
+
+ For directories that use automake, GCC requires the latest release
+ in the 1.9.x series, which is currently 1.9.6. When regenerating
+ a directory to a newer version, please update all the directories
+ using an older 1.9.x to the latest released version.
+
+gettext version 0.14.5 (or later)
+ Needed to regenerate `gcc.pot'.
+
+gperf version 2.7.2 (or later)
+ Necessary when modifying `gperf' input files, e.g.
+ `gcc/cp/cfns.gperf' to regenerate its associated header file, e.g.
+ `gcc/cp/cfns.h'.
+
+DejaGnu 1.4.4
+Expect
+Tcl
+ Necessary to run the GCC testsuite; see the section on testing for
+ details.
+
+autogen version 5.5.4 (or later) and
+guile version 1.4.1 (or later)
+ Necessary to regenerate `fixinc/fixincl.x' from
+ `fixinc/inclhack.def' and `fixinc/*.tpl'.
+
+ Necessary to run `make check' for `fixinc'.
+
+ Necessary to regenerate the top level `Makefile.in' file from
+ `Makefile.tpl' and `Makefile.def'.
+
+Flex version 2.5.4 (or later)
+ Necessary when modifying `*.l' files.
+
+ Necessary to build GCC during development because the generated
+ output files are not included in the SVN repository. They are
+ included in releases.
+
+Texinfo version 4.7 (or later)
+ Necessary for running `makeinfo' when modifying `*.texi' files to
+ test your changes.
+
+ Necessary for running `make dvi' or `make pdf' to create printable
+ documentation in DVI or PDF format. Texinfo version 4.8 or later
+ is required for `make pdf'.
+
+ Necessary to build GCC documentation during development because the
+ generated output files are not included in the SVN repository.
+ They are included in releases.
+
+TeX (any working version)
+ Necessary for running `texi2dvi' and `texi2pdf', which are used
+ when running `make dvi' or `make pdf' to create DVI or PDF files,
+ respectively.
+
+SVN (any version)
+SSH (any version)
+ Necessary to access the SVN repository. Public releases and weekly
+ snapshots of the development sources are also available via FTP.
+
+Perl version 5.6.1 (or later)
+ Necessary when regenerating `Makefile' dependencies in libiberty.
+ Necessary when regenerating `libiberty/functions.texi'. Necessary
+ when generating manpages from Texinfo manuals. Necessary when
+ targetting Darwin, building libstdc++, and not using
+ `--disable-symvers'. Used by various scripts to generate some
+ files included in SVN (mainly Unicode-related and rarely changing)
+ from source tables.
+
+GNU diffutils version 2.7 (or later)
+ Useful when submitting patches for the GCC source code.
+
+patch version 2.5.4 (or later)
+ Necessary when applying patches, created with `diff', to one's own
+ sources.
+
+ecj1
+gjavah
+ If you wish to modify `.java' files in libjava, you will need to
+ configure with `--enable-java-maintainer-mode', and you will need
+ to have executables named `ecj1' and `gjavah' in your path. The
+ `ecj1' executable should run the Eclipse Java compiler via the
+ GCC-specific entry point. You can download a suitable jar from
+ `ftp://sourceware.org/pub/java/', or by running the script
+ `contrib/download_ecj'.
+
+antlr.jar version 2.7.1 (or later)
+antlr binary
+ If you wish to build the `gjdoc' binary in libjava, you will need
+ to have a `antlr.jar' library available. The library is searched
+ in system locations but can be configured with `--with-antlr-jar='
+ instead. When configuring with `--enable-java-maintainer-mode',
+ you will need to have one of the executables named `cantlr',
+ `runantlr' or `antlr' in your path.
+
+
+
+File: gccinstall.info, Node: Downloading the source, Next: Configuration, Prev: Prerequisites, Up: Installing GCC
+
+3 Downloading GCC
+*****************
+
+ GCC is distributed via SVN and FTP tarballs compressed with `gzip' or
+`bzip2'. It is possible to download a full distribution or specific
+components.
+
+ Please refer to the releases web page for information on how to
+obtain GCC.
+
+ The full distribution includes the C, C++, Objective-C, Fortran,
+Java, and Ada (in the case of GCC 3.1 and later) compilers. The full
+distribution also includes runtime libraries for C++, Objective-C,
+Fortran, and Java. In GCC 3.0 and later versions, the GNU compiler
+testsuites are also included in the full distribution.
+
+ If you choose to download specific components, you must download the
+core GCC distribution plus any language specific distributions you wish
+to use. The core distribution includes the C language front end as
+well as the shared components. Each language has a tarball which
+includes the language front end as well as the language runtime (when
+appropriate).
+
+ Unpack the core distribution as well as any language specific
+distributions in the same directory.
+
+ If you also intend to build binutils (either to upgrade an existing
+installation or for use in place of the corresponding tools of your
+OS), unpack the binutils distribution either in the same directory or a
+separate one. In the latter case, add symbolic links to any components
+of the binutils you intend to build alongside the compiler (`bfd',
+`binutils', `gas', `gprof', `ld', `opcodes', ...) to the directory
+containing the GCC sources.
+
+ Likewise, the GMP and MPFR libraries can be automatically built
+together with GCC. Unpack the GMP and/or MPFR source distributions in
+the directory containing the GCC sources and rename their directories to
+`gmp' and `mpfr', respectively (or use symbolic links with the same
+name).
+
+
+File: gccinstall.info, Node: Configuration, Next: Building, Prev: Downloading the source, Up: Installing GCC
+
+4 Installing GCC: Configuration
+*******************************
+
+ Like most GNU software, GCC must be configured before it can be
+built. This document describes the recommended configuration procedure
+for both native and cross targets.
+
+ We use SRCDIR to refer to the toplevel source directory for GCC; we
+use OBJDIR to refer to the toplevel build/object directory.
+
+ If you obtained the sources via SVN, SRCDIR must refer to the top
+`gcc' directory, the one where the `MAINTAINERS' can be found, and not
+its `gcc' subdirectory, otherwise the build will fail.
+
+ If either SRCDIR or OBJDIR is located on an automounted NFS file
+system, the shell's built-in `pwd' command will return temporary
+pathnames. Using these can lead to various sorts of build problems.
+To avoid this issue, set the `PWDCMD' environment variable to an
+automounter-aware `pwd' command, e.g., `pawd' or `amq -w', during the
+configuration and build phases.
+
+ First, we *highly* recommend that GCC be built into a separate
+directory than the sources which does *not* reside within the source
+tree. This is how we generally build GCC; building where SRCDIR ==
+OBJDIR should still work, but doesn't get extensive testing; building
+where OBJDIR is a subdirectory of SRCDIR is unsupported.
+
+ If you have previously built GCC in the same directory for a
+different target machine, do `make distclean' to delete all files that
+might be invalid. One of the files this deletes is `Makefile'; if
+`make distclean' complains that `Makefile' does not exist or issues a
+message like "don't know how to make distclean" it probably means that
+the directory is already suitably clean. However, with the recommended
+method of building in a separate OBJDIR, you should simply use a
+different OBJDIR for each target.
+
+ Second, when configuring a native system, either `cc' or `gcc' must
+be in your path or you must set `CC' in your environment before running
+configure. Otherwise the configuration scripts may fail.
+
+ To configure GCC:
+
+ % mkdir OBJDIR
+ % cd OBJDIR
+ % SRCDIR/configure [OPTIONS] [TARGET]
+
+Distributor options
+===================
+
+If you will be distributing binary versions of GCC, with modifications
+to the source code, you should use the options described in this
+section to make clear that your version contains modifications.
+
+`--with-pkgversion=VERSION'
+ Specify a string that identifies your package. You may wish to
+ include a build number or build date. This version string will be
+ included in the output of `gcc --version'. This suffix does not
+ replace the default version string, only the `GCC' part.
+
+ The default value is `GCC'.
+
+`--with-bugurl=URL'
+ Specify the URL that users should visit if they wish to report a
+ bug. You are of course welcome to forward bugs reported to you to
+ the FSF, if you determine that they are not bugs in your
+ modifications.
+
+ The default value refers to the FSF's GCC bug tracker.
+
+
+Target specification
+====================
+
+ * GCC has code to correctly determine the correct value for TARGET
+ for nearly all native systems. Therefore, we highly recommend you
+ not provide a configure target when configuring a native compiler.
+
+ * TARGET must be specified as `--target=TARGET' when configuring a
+ cross compiler; examples of valid targets would be m68k-coff,
+ sh-elf, etc.
+
+ * Specifying just TARGET instead of `--target=TARGET' implies that
+ the host defaults to TARGET.
+
+Options specification
+=====================
+
+Use OPTIONS to override several configure time options for GCC. A list
+of supported OPTIONS follows; `configure --help' may list other
+options, but those not listed below may not work and should not
+normally be used.
+
+ Note that each `--enable' option has a corresponding `--disable'
+option and that each `--with' option has a corresponding `--without'
+option.
+
+`--prefix=DIRNAME'
+ Specify the toplevel installation directory. This is the
+ recommended way to install the tools into a directory other than
+ the default. The toplevel installation directory defaults to
+ `/usr/local'.
+
+ We *highly* recommend against DIRNAME being the same or a
+ subdirectory of OBJDIR or vice versa. If specifying a directory
+ beneath a user's home directory tree, some shells will not expand
+ DIRNAME correctly if it contains the `~' metacharacter; use
+ `$HOME' instead.
+
+ The following standard `autoconf' options are supported. Normally
+ you should not need to use these options.
+ `--exec-prefix=DIRNAME'
+ Specify the toplevel installation directory for
+ architecture-dependent files. The default is `PREFIX'.
+
+ `--bindir=DIRNAME'
+ Specify the installation directory for the executables called
+ by users (such as `gcc' and `g++'). The default is
+ `EXEC-PREFIX/bin'.
+
+ `--libdir=DIRNAME'
+ Specify the installation directory for object code libraries
+ and internal data files of GCC. The default is
+ `EXEC-PREFIX/lib'.
+
+ `--libexecdir=DIRNAME'
+ Specify the installation directory for internal executables
+ of GCC. The default is `EXEC-PREFIX/libexec'.
+
+ `--with-slibdir=DIRNAME'
+ Specify the installation directory for the shared libgcc
+ library. The default is `LIBDIR'.
+
+ `--infodir=DIRNAME'
+ Specify the installation directory for documentation in info
+ format. The default is `PREFIX/info'.
+
+ `--datadir=DIRNAME'
+ Specify the installation directory for some
+ architecture-independent data files referenced by GCC. The
+ default is `PREFIX/share'.
+
+ `--mandir=DIRNAME'
+ Specify the installation directory for manual pages. The
+ default is `PREFIX/man'. (Note that the manual pages are
+ only extracts from the full GCC manuals, which are provided
+ in Texinfo format. The manpages are derived by an automatic
+ conversion process from parts of the full manual.)
+
+ `--with-gxx-include-dir=DIRNAME'
+ Specify the installation directory for G++ header files. The
+ default is `PREFIX/include/c++/VERSION'.
+
+
+`--program-prefix=PREFIX'
+ GCC supports some transformations of the names of its programs when
+ installing them. This option prepends PREFIX to the names of
+ programs to install in BINDIR (see above). For example, specifying
+ `--program-prefix=foo-' would result in `gcc' being installed as
+ `/usr/local/bin/foo-gcc'.
+
+`--program-suffix=SUFFIX'
+ Appends SUFFIX to the names of programs to install in BINDIR (see
+ above). For example, specifying `--program-suffix=-3.1' would
+ result in `gcc' being installed as `/usr/local/bin/gcc-3.1'.
+
+`--program-transform-name=PATTERN'
+ Applies the `sed' script PATTERN to be applied to the names of
+ programs to install in BINDIR (see above). PATTERN has to consist
+ of one or more basic `sed' editing commands, separated by
+ semicolons. For example, if you want the `gcc' program name to be
+ transformed to the installed program `/usr/local/bin/myowngcc' and
+ the `g++' program name to be transformed to
+ `/usr/local/bin/gspecial++' without changing other program names,
+ you could use the pattern
+ `--program-transform-name='s/^gcc$/myowngcc/; s/^g++$/gspecial++/''
+ to achieve this effect.
+
+ All three options can be combined and used together, resulting in
+ more complex conversion patterns. As a basic rule, PREFIX (and
+ SUFFIX) are prepended (appended) before further transformations
+ can happen with a special transformation script PATTERN.
+
+ As currently implemented, this option only takes effect for native
+ builds; cross compiler binaries' names are not transformed even
+ when a transformation is explicitly asked for by one of these
+ options.
+
+ For native builds, some of the installed programs are also
+ installed with the target alias in front of their name, as in
+ `i686-pc-linux-gnu-gcc'. All of the above transformations happen
+ before the target alias is prepended to the name--so, specifying
+ `--program-prefix=foo-' and `program-suffix=-3.1', the resulting
+ binary would be installed as
+ `/usr/local/bin/i686-pc-linux-gnu-foo-gcc-3.1'.
+
+ As a last shortcoming, none of the installed Ada programs are
+ transformed yet, which will be fixed in some time.
+
+`--with-local-prefix=DIRNAME'
+ Specify the installation directory for local include files. The
+ default is `/usr/local'. Specify this option if you want the
+ compiler to search directory `DIRNAME/include' for locally
+ installed header files _instead_ of `/usr/local/include'.
+
+ You should specify `--with-local-prefix' *only* if your site has a
+ different convention (not `/usr/local') for where to put
+ site-specific files.
+
+ The default value for `--with-local-prefix' is `/usr/local'
+ regardless of the value of `--prefix'. Specifying `--prefix' has
+ no effect on which directory GCC searches for local header files.
+ This may seem counterintuitive, but actually it is logical.
+
+ The purpose of `--prefix' is to specify where to _install GCC_.
+ The local header files in `/usr/local/include'--if you put any in
+ that directory--are not part of GCC. They are part of other
+ programs--perhaps many others. (GCC installs its own header files
+ in another directory which is based on the `--prefix' value.)
+
+ Both the local-prefix include directory and the GCC-prefix include
+ directory are part of GCC's "system include" directories.
+ Although these two directories are not fixed, they need to be
+ searched in the proper order for the correct processing of the
+ include_next directive. The local-prefix include directory is
+ searched before the GCC-prefix include directory. Another
+ characteristic of system include directories is that pedantic
+ warnings are turned off for headers in these directories.
+
+ Some autoconf macros add `-I DIRECTORY' options to the compiler
+ command line, to ensure that directories containing installed
+ packages' headers are searched. When DIRECTORY is one of GCC's
+ system include directories, GCC will ignore the option so that
+ system directories continue to be processed in the correct order.
+ This may result in a search order different from what was
+ specified but the directory will still be searched.
+
+ GCC automatically searches for ordinary libraries using
+ `GCC_EXEC_PREFIX'. Thus, when the same installation prefix is
+ used for both GCC and packages, GCC will automatically search for
+ both headers and libraries. This provides a configuration that is
+ easy to use. GCC behaves in a manner similar to that when it is
+ installed as a system compiler in `/usr'.
+
+ Sites that need to install multiple versions of GCC may not want to
+ use the above simple configuration. It is possible to use the
+ `--program-prefix', `--program-suffix' and
+ `--program-transform-name' options to install multiple versions
+ into a single directory, but it may be simpler to use different
+ prefixes and the `--with-local-prefix' option to specify the
+ location of the site-specific files for each version. It will
+ then be necessary for users to specify explicitly the location of
+ local site libraries (e.g., with `LIBRARY_PATH').
+
+ The same value can be used for both `--with-local-prefix' and
+ `--prefix' provided it is not `/usr'. This can be used to avoid
+ the default search of `/usr/local/include'.
+
+ *Do not* specify `/usr' as the `--with-local-prefix'! The
+ directory you use for `--with-local-prefix' *must not* contain any
+ of the system's standard header files. If it did contain them,
+ certain programs would be miscompiled (including GNU Emacs, on
+ certain targets), because this would override and nullify the
+ header file corrections made by the `fixincludes' script.
+
+ Indications are that people who use this option use it based on
+ mistaken ideas of what it is for. People use it as if it
+ specified where to install part of GCC. Perhaps they make this
+ assumption because installing GCC creates the directory.
+
+`--enable-shared[=PACKAGE[,...]]'
+ Build shared versions of libraries, if shared libraries are
+ supported on the target platform. Unlike GCC 2.95.x and earlier,
+ shared libraries are enabled by default on all platforms that
+ support shared libraries.
+
+ If a list of packages is given as an argument, build shared
+ libraries only for the listed packages. For other packages, only
+ static libraries will be built. Package names currently
+ recognized in the GCC tree are `libgcc' (also known as `gcc'),
+ `libstdc++' (not `libstdc++-v3'), `libffi', `zlib', `boehm-gc',
+ `ada', `libada', `libjava' and `libobjc'. Note `libiberty' does
+ not support shared libraries at all.
+
+ Use `--disable-shared' to build only static libraries. Note that
+ `--disable-shared' does not accept a list of package names as
+ argument, only `--enable-shared' does.
+
+`--with-gnu-as'
+ Specify that the compiler should assume that the assembler it
+ finds is the GNU assembler. However, this does not modify the
+ rules to find an assembler and will result in confusion if the
+ assembler found is not actually the GNU assembler. (Confusion may
+ also result if the compiler finds the GNU assembler but has not
+ been configured with `--with-gnu-as'.) If you have more than one
+ assembler installed on your system, you may want to use this
+ option in connection with `--with-as=PATHNAME' or
+ `--with-build-time-tools=PATHNAME'.
+
+ The following systems are the only ones where it makes a difference
+ whether you use the GNU assembler. On any other system,
+ `--with-gnu-as' has no effect.
+
+ * `hppa1.0-ANY-ANY'
+
+ * `hppa1.1-ANY-ANY'
+
+ * `sparc-sun-solaris2.ANY'
+
+ * `sparc64-ANY-solaris2.ANY'
+
+`--with-as=PATHNAME'
+ Specify that the compiler should use the assembler pointed to by
+ PATHNAME, rather than the one found by the standard rules to find
+ an assembler, which are:
+ * Unless GCC is being built with a cross compiler, check the
+ `LIBEXEC/gcc/TARGET/VERSION' directory. LIBEXEC defaults to
+ `EXEC-PREFIX/libexec'; EXEC-PREFIX defaults to PREFIX, which
+ defaults to `/usr/local' unless overridden by the
+ `--prefix=PATHNAME' switch described above. TARGET is the
+ target system triple, such as `sparc-sun-solaris2.7', and
+ VERSION denotes the GCC version, such as 3.0.
+
+ * If the target system is the same that you are building on,
+ check operating system specific directories (e.g.
+ `/usr/ccs/bin' on Sun Solaris 2).
+
+ * Check in the `PATH' for a tool whose name is prefixed by the
+ target system triple.
+
+ * Check in the `PATH' for a tool whose name is not prefixed by
+ the target system triple, if the host and target system
+ triple are the same (in other words, we use a host tool if it
+ can be used for the target as well).
+
+ You may want to use `--with-as' if no assembler is installed in
+ the directories listed above, or if you have multiple assemblers
+ installed and want to choose one that is not found by the above
+ rules.
+
+`--with-gnu-ld'
+ Same as `--with-gnu-as' but for the linker.
+
+`--with-ld=PATHNAME'
+ Same as `--with-as' but for the linker.
+
+`--with-stabs'
+ Specify that stabs debugging information should be used instead of
+ whatever format the host normally uses. Normally GCC uses the
+ same debug format as the host system.
+
+ On MIPS based systems and on Alphas, you must specify whether you
+ want GCC to create the normal ECOFF debugging format, or to use
+ BSD-style stabs passed through the ECOFF symbol table. The normal
+ ECOFF debug format cannot fully handle languages other than C.
+ BSD stabs format can handle other languages, but it only works
+ with the GNU debugger GDB.
+
+ Normally, GCC uses the ECOFF debugging format by default; if you
+ prefer BSD stabs, specify `--with-stabs' when you configure GCC.
+
+ No matter which default you choose when you configure GCC, the user
+ can use the `-gcoff' and `-gstabs+' options to specify explicitly
+ the debug format for a particular compilation.
+
+ `--with-stabs' is meaningful on the ISC system on the 386, also, if
+ `--with-gas' is used. It selects use of stabs debugging
+ information embedded in COFF output. This kind of debugging
+ information supports C++ well; ordinary COFF debugging information
+ does not.
+
+ `--with-stabs' is also meaningful on 386 systems running SVR4. It
+ selects use of stabs debugging information embedded in ELF output.
+ The C++ compiler currently (2.6.0) does not support the DWARF
+ debugging information normally used on 386 SVR4 platforms; stabs
+ provide a workable alternative. This requires gas and gdb, as the
+ normal SVR4 tools can not generate or interpret stabs.
+
+`--disable-multilib'
+ Specify that multiple target libraries to support different target
+ variants, calling conventions, etc. should not be built. The
+ default is to build a predefined set of them.
+
+ Some targets provide finer-grained control over which multilibs
+ are built (e.g., `--disable-softfloat'):
+ `arc-*-elf*'
+ biendian.
+
+ `arm-*-*'
+ fpu, 26bit, underscore, interwork, biendian, nofmult.
+
+ `m68*-*-*'
+ softfloat, m68881, m68000, m68020.
+
+ `mips*-*-*'
+ single-float, biendian, softfloat.
+
+ `powerpc*-*-*, rs6000*-*-*'
+ aix64, pthread, softfloat, powercpu, powerpccpu, powerpcos,
+ biendian, sysv, aix.
+
+
+`--enable-threads'
+ Specify that the target supports threads. This affects the
+ Objective-C compiler and runtime library, and exception handling
+ for other languages like C++ and Java. On some systems, this is
+ the default.
+
+ In general, the best (and, in many cases, the only known) threading
+ model available will be configured for use. Beware that on some
+ systems, GCC has not been taught what threading models are
+ generally available for the system. In this case,
+ `--enable-threads' is an alias for `--enable-threads=single'.
+
+`--disable-threads'
+ Specify that threading support should be disabled for the system.
+ This is an alias for `--enable-threads=single'.
+
+`--enable-threads=LIB'
+ Specify that LIB is the thread support library. This affects the
+ Objective-C compiler and runtime library, and exception handling
+ for other languages like C++ and Java. The possibilities for LIB
+ are:
+
+ `aix'
+ AIX thread support.
+
+ `dce'
+ DCE thread support.
+
+ `gnat'
+ Ada tasking support. For non-Ada programs, this setting is
+ equivalent to `single'. When used in conjunction with the
+ Ada run time, it causes GCC to use the same thread primitives
+ as Ada uses. This option is necessary when using both Ada
+ and the back end exception handling, which is the default for
+ most Ada targets.
+
+ `mach'
+ Generic MACH thread support, known to work on NeXTSTEP.
+ (Please note that the file needed to support this
+ configuration, `gthr-mach.h', is missing and thus this
+ setting will cause a known bootstrap failure.)
+
+ `no'
+ This is an alias for `single'.
+
+ `posix'
+ Generic POSIX/Unix98 thread support.
+
+ `posix95'
+ Generic POSIX/Unix95 thread support.
+
+ `rtems'
+ RTEMS thread support.
+
+ `single'
+ Disable thread support, should work for all platforms.
+
+ `solaris'
+ Sun Solaris 2 thread support.
+
+ `vxworks'
+ VxWorks thread support.
+
+ `win32'
+ Microsoft Win32 API thread support.
+
+ `nks'
+ Novell Kernel Services thread support.
+
+`--enable-tls'
+ Specify that the target supports TLS (Thread Local Storage).
+ Usually configure can correctly determine if TLS is supported. In
+ cases where it guesses incorrectly, TLS can be explicitly enabled
+ or disabled with `--enable-tls' or `--disable-tls'. This can
+ happen if the assembler supports TLS but the C library does not,
+ or if the assumptions made by the configure test are incorrect.
+
+`--disable-tls'
+ Specify that the target does not support TLS. This is an alias
+ for `--enable-tls=no'.
+
+`--with-cpu=CPU'
+`--with-cpu-32=CPU'
+`--with-cpu-64=CPU'
+ Specify which cpu variant the compiler should generate code for by
+ default. CPU will be used as the default value of the `-mcpu='
+ switch. This option is only supported on some targets, including
+ ARM, i386, M68k, PowerPC, and SPARC. The `--with-cpu-32' and
+ `--with-cpu-64' options specify separate default CPUs for 32-bit
+ and 64-bit modes; these options are only supported for i386 and
+ x86-64.
+
+`--with-schedule=CPU'
+`--with-arch=CPU'
+`--with-arch-32=CPU'
+`--with-arch-64=CPU'
+`--with-tune=CPU'
+`--with-tune-32=CPU'
+`--with-tune-64=CPU'
+`--with-abi=ABI'
+`--with-fpu=TYPE'
+`--with-float=TYPE'
+ These configure options provide default values for the
+ `-mschedule=', `-march=', `-mtune=', `-mabi=', and `-mfpu='
+ options and for `-mhard-float' or `-msoft-float'. As with
+ `--with-cpu', which switches will be accepted and acceptable values
+ of the arguments depend on the target.
+
+`--with-mode=MODE'
+ Specify if the compiler should default to `-marm' or `-mthumb'.
+ This option is only supported on ARM targets.
+
+`--with-divide=TYPE'
+ Specify how the compiler should generate code for checking for
+ division by zero. This option is only supported on the MIPS
+ target. The possibilities for TYPE are:
+ `traps'
+ Division by zero checks use conditional traps (this is the
+ default on systems that support conditional traps).
+
+ `breaks'
+ Division by zero checks use the break instruction.
+
+`--with-llsc'
+ On MIPS targets, make `-mllsc' the default when no `-mno-lsc'
+ option is passed. This is the default for Linux-based targets, as
+ the kernel will emulate them if the ISA does not provide them.
+
+`--without-llsc'
+ On MIPS targets, make `-mno-llsc' the default when no `-mllsc'
+ option is passed.
+
+`--with-mips-plt'
+ On MIPS targets, make use of copy relocations and PLTs. These
+ features are extensions to the traditional SVR4-based MIPS ABIs
+ and require support from GNU binutils and the runtime C library.
+
+`--enable-__cxa_atexit'
+ Define if you want to use __cxa_atexit, rather than atexit, to
+ register C++ destructors for local statics and global objects.
+ This is essential for fully standards-compliant handling of
+ destructors, but requires __cxa_atexit in libc. This option is
+ currently only available on systems with GNU libc. When enabled,
+ this will cause `-fuse-cxa-atexit' to be passed by default.
+
+`--enable-target-optspace'
+ Specify that target libraries should be optimized for code space
+ instead of code speed. This is the default for the m32r platform.
+
+`--disable-cpp'
+ Specify that a user visible `cpp' program should not be installed.
+
+`--with-cpp-install-dir=DIRNAME'
+ Specify that the user visible `cpp' program should be installed in
+ `PREFIX/DIRNAME/cpp', in addition to BINDIR.
+
+`--enable-initfini-array'
+ Force the use of sections `.init_array' and `.fini_array' (instead
+ of `.init' and `.fini') for constructors and destructors. Option
+ `--disable-initfini-array' has the opposite effect. If neither
+ option is specified, the configure script will try to guess
+ whether the `.init_array' and `.fini_array' sections are supported
+ and, if they are, use them.
+
+`--enable-maintainer-mode'
+ The build rules that regenerate the GCC master message catalog
+ `gcc.pot' are normally disabled. This is because it can only be
+ rebuilt if the complete source tree is present. If you have
+ changed the sources and want to rebuild the catalog, configuring
+ with `--enable-maintainer-mode' will enable this. Note that you
+ need a recent version of the `gettext' tools to do so.
+
+`--disable-bootstrap'
+ For a native build, the default configuration is to perform a
+ 3-stage bootstrap of the compiler when `make' is invoked, testing
+ that GCC can compile itself correctly. If you want to disable
+ this process, you can configure with `--disable-bootstrap'.
+
+`--enable-bootstrap'
+ In special cases, you may want to perform a 3-stage build even if
+ the target and host triplets are different. This could happen
+ when the host can run code compiled for the target (e.g. host is
+ i686-linux, target is i486-linux). Starting from GCC 4.2, to do
+ this you have to configure explicitly with `--enable-bootstrap'.
+
+`--enable-generated-files-in-srcdir'
+ Neither the .c and .h files that are generated from Bison and flex
+ nor the info manuals and man pages that are built from the .texi
+ files are present in the SVN development tree. When building GCC
+ from that development tree, or from one of our snapshots, those
+ generated files are placed in your build directory, which allows
+ for the source to be in a readonly directory.
+
+ If you configure with `--enable-generated-files-in-srcdir' then
+ those generated files will go into the source directory. This is
+ mainly intended for generating release or prerelease tarballs of
+ the GCC sources, since it is not a requirement that the users of
+ source releases to have flex, Bison, or makeinfo.
+
+`--enable-version-specific-runtime-libs'
+ Specify that runtime libraries should be installed in the compiler
+ specific subdirectory (`LIBDIR/gcc') rather than the usual places.
+ In addition, `libstdc++''s include files will be installed into
+ `LIBDIR' unless you overruled it by using
+ `--with-gxx-include-dir=DIRNAME'. Using this option is
+ particularly useful if you intend to use several versions of GCC in
+ parallel. This is currently supported by `libgfortran',
+ `libjava', `libmudflap', `libstdc++', and `libobjc'.
+
+`--enable-languages=LANG1,LANG2,...'
+ Specify that only a particular subset of compilers and their
+ runtime libraries should be built. For a list of valid values for
+ LANGN you can issue the following command in the `gcc' directory
+ of your GCC source tree:
+ grep language= */config-lang.in
+ Currently, you can use any of the following: `all', `ada', `c',
+ `c++', `fortran', `java', `objc', `obj-c++'. Building the Ada
+ compiler has special requirements, see below. If you do not pass
+ this flag, or specify the option `all', then all default languages
+ available in the `gcc' sub-tree will be configured. Ada and
+ Objective-C++ are not default languages; the rest are.
+ Re-defining `LANGUAGES' when calling `make' *does not* work
+ anymore, as those language sub-directories might not have been
+ configured!
+
+`--enable-stage1-languages=LANG1,LANG2,...'
+ Specify that a particular subset of compilers and their runtime
+ libraries should be built with the system C compiler during stage
+ 1 of the bootstrap process, rather than only in later stages with
+ the bootstrapped C compiler. The list of valid values is the same
+ as for `--enable-languages', and the option `all' will select all
+ of the languages enabled by `--enable-languages'. This option is
+ primarily useful for GCC development; for instance, when a
+ development version of the compiler cannot bootstrap due to
+ compiler bugs, or when one is debugging front ends other than the
+ C front end. When this option is used, one can then build the
+ target libraries for the specified languages with the stage-1
+ compiler by using `make stage1-bubble all-target', or run the
+ testsuite on the stage-1 compiler for the specified languages
+ using `make stage1-start check-gcc'.
+
+`--disable-libada'
+ Specify that the run-time libraries and tools used by GNAT should
+ not be built. This can be useful for debugging, or for
+ compatibility with previous Ada build procedures, when it was
+ required to explicitly do a `make -C gcc gnatlib_and_tools'.
+
+`--disable-libssp'
+ Specify that the run-time libraries for stack smashing protection
+ should not be built.
+
+`--disable-libgomp'
+ Specify that the run-time libraries used by GOMP should not be
+ built.
+
+`--with-dwarf2'
+ Specify that the compiler should use DWARF 2 debugging information
+ as the default.
+
+`--enable-targets=all'
+`--enable-targets=TARGET_LIST'
+ Some GCC targets, e.g. powerpc64-linux, build bi-arch compilers.
+ These are compilers that are able to generate either 64-bit or
+ 32-bit code. Typically, the corresponding 32-bit target, e.g.
+ powerpc-linux for powerpc64-linux, only generates 32-bit code.
+ This option enables the 32-bit target to be a bi-arch compiler,
+ which is useful when you want a bi-arch compiler that defaults to
+ 32-bit, and you are building a bi-arch or multi-arch binutils in a
+ combined tree. Currently, this option only affects sparc-linux,
+ powerpc-linux and x86-linux.
+
+`--enable-secureplt'
+ This option enables `-msecure-plt' by default for powerpc-linux.
+ *Note RS/6000 and PowerPC Options: (gcc)RS/6000 and PowerPC
+ Options,
+
+`--enable-cld'
+ This option enables `-mcld' by default for 32-bit x86 targets.
+ *Note i386 and x86-64 Options: (gcc)i386 and x86-64 Options,
+
+`--enable-win32-registry'
+`--enable-win32-registry=KEY'
+`--disable-win32-registry'
+ The `--enable-win32-registry' option enables Microsoft
+ Windows-hosted GCC to look up installations paths in the registry
+ using the following key:
+
+ `HKEY_LOCAL_MACHINE\SOFTWARE\Free Software Foundation\KEY'
+
+ KEY defaults to GCC version number, and can be overridden by the
+ `--enable-win32-registry=KEY' option. Vendors and distributors
+ who use custom installers are encouraged to provide a different
+ key, perhaps one comprised of vendor name and GCC version number,
+ to avoid conflict with existing installations. This feature is
+ enabled by default, and can be disabled by
+ `--disable-win32-registry' option. This option has no effect on
+ the other hosts.
+
+`--nfp'
+ Specify that the machine does not have a floating point unit. This
+ option only applies to `m68k-sun-sunosN'. On any other system,
+ `--nfp' has no effect.
+
+`--enable-werror'
+`--disable-werror'
+`--enable-werror=yes'
+`--enable-werror=no'
+ When you specify this option, it controls whether certain files in
+ the compiler are built with `-Werror' in bootstrap stage2 and
+ later. If you don't specify it, `-Werror' is turned on for the
+ main development trunk. However it defaults to off for release
+ branches and final releases. The specific files which get
+ `-Werror' are controlled by the Makefiles.
+
+`--enable-checking'
+`--enable-checking=LIST'
+ When you specify this option, the compiler is built to perform
+ internal consistency checks of the requested complexity. This
+ does not change the generated code, but adds error checking within
+ the compiler. This will slow down the compiler and may only work
+ properly if you are building the compiler with GCC. This is `yes'
+ by default when building from SVN or snapshots, but `release' for
+ releases. The default for building the stage1 compiler is `yes'.
+ More control over the checks may be had by specifying LIST. The
+ categories of checks available are `yes' (most common checks
+ `assert,misc,tree,gc,rtlflag,runtime'), `no' (no checks at all),
+ `all' (all but `valgrind'), `release' (cheapest checks
+ `assert,runtime') or `none' (same as `no'). Individual checks can
+ be enabled with these flags `assert', `df', `fold', `gc', `gcac'
+ `misc', `rtl', `rtlflag', `runtime', `tree', and `valgrind'.
+
+ The `valgrind' check requires the external `valgrind' simulator,
+ available from `http://valgrind.org/'. The `df', `rtl', `gcac'
+ and `valgrind' checks are very expensive. To disable all
+ checking, `--disable-checking' or `--enable-checking=none' must be
+ explicitly requested. Disabling assertions will make the compiler
+ and runtime slightly faster but increase the risk of undetected
+ internal errors causing wrong code to be generated.
+
+`--disable-stage1-checking'
+
+`--enable-stage1-checking'
+`--enable-stage1-checking=LIST'
+ If no `--enable-checking' option is specified the stage1 compiler
+ will be built with `yes' checking enabled, otherwise the stage1
+ checking flags are the same as specified by `--enable-checking'.
+ To build the stage1 compiler with different checking options use
+ `--enable-stage1-checking'. The list of checking options is the
+ same as for `--enable-checking'. If your system is too slow or
+ too small to bootstrap a released compiler with checking for
+ stage1 enabled, you can use `--disable-stage1-checking' to disable
+ checking for the stage1 compiler.
+
+`--enable-coverage'
+`--enable-coverage=LEVEL'
+ With this option, the compiler is built to collect self coverage
+ information, every time it is run. This is for internal
+ development purposes, and only works when the compiler is being
+ built with gcc. The LEVEL argument controls whether the compiler
+ is built optimized or not, values are `opt' and `noopt'. For
+ coverage analysis you want to disable optimization, for
+ performance analysis you want to enable optimization. When
+ coverage is enabled, the default level is without optimization.
+
+`--enable-gather-detailed-mem-stats'
+ When this option is specified more detailed information on memory
+ allocation is gathered. This information is printed when using
+ `-fmem-report'.
+
+`--with-gc'
+`--with-gc=CHOICE'
+ With this option you can specify the garbage collector
+ implementation used during the compilation process. CHOICE can be
+ one of `page' and `zone', where `page' is the default.
+
+`--enable-nls'
+`--disable-nls'
+ The `--enable-nls' option enables Native Language Support (NLS),
+ which lets GCC output diagnostics in languages other than American
+ English. Native Language Support is enabled by default if not
+ doing a canadian cross build. The `--disable-nls' option disables
+ NLS.
+
+`--with-included-gettext'
+ If NLS is enabled, the `--with-included-gettext' option causes the
+ build procedure to prefer its copy of GNU `gettext'.
+
+`--with-catgets'
+ If NLS is enabled, and if the host lacks `gettext' but has the
+ inferior `catgets' interface, the GCC build procedure normally
+ ignores `catgets' and instead uses GCC's copy of the GNU `gettext'
+ library. The `--with-catgets' option causes the build procedure
+ to use the host's `catgets' in this situation.
+
+`--with-libiconv-prefix=DIR'
+ Search for libiconv header files in `DIR/include' and libiconv
+ library files in `DIR/lib'.
+
+`--enable-obsolete'
+ Enable configuration for an obsoleted system. If you attempt to
+ configure GCC for a system (build, host, or target) which has been
+ obsoleted, and you do not specify this flag, configure will halt
+ with an error message.
+
+ All support for systems which have been obsoleted in one release
+ of GCC is removed entirely in the next major release, unless
+ someone steps forward to maintain the port.
+
+`--enable-decimal-float'
+`--enable-decimal-float=yes'
+`--enable-decimal-float=no'
+`--enable-decimal-float=bid'
+`--enable-decimal-float=dpd'
+`--disable-decimal-float'
+ Enable (or disable) support for the C decimal floating point
+ extension that is in the IEEE 754-2008 standard. This is enabled
+ by default only on PowerPC, i386, and x86_64 GNU/Linux systems.
+ Other systems may also support it, but require the user to
+ specifically enable it. You can optionally control which decimal
+ floating point format is used (either `bid' or `dpd'). The `bid'
+ (binary integer decimal) format is default on i386 and x86_64
+ systems, and the `dpd' (densely packed decimal) format is default
+ on PowerPC systems.
+
+`--enable-fixed-point'
+`--disable-fixed-point'
+ Enable (or disable) support for C fixed-point arithmetic. This
+ option is enabled by default for some targets (such as MIPS) which
+ have hardware-support for fixed-point operations. On other
+ targets, you may enable this option manually.
+
+`--with-long-double-128'
+ Specify if `long double' type should be 128-bit by default on
+ selected GNU/Linux architectures. If using
+ `--without-long-double-128', `long double' will be by default
+ 64-bit, the same as `double' type. When neither of these
+ configure options are used, the default will be 128-bit `long
+ double' when built against GNU C Library 2.4 and later, 64-bit
+ `long double' otherwise.
+
+`--with-gmp=PATHNAME'
+`--with-gmp-include=PATHNAME'
+`--with-gmp-lib=PATHNAME'
+`--with-mpfr=PATHNAME'
+`--with-mpfr-include=PATHNAME'
+`--with-mpfr-lib=PATHNAME'
+ If you do not have GMP (the GNU Multiple Precision library) and the
+ MPFR Libraries installed in a standard location and you want to
+ build GCC, you can explicitly specify the directory where they are
+ installed (`--with-gmp=GMPINSTALLDIR',
+ `--with-mpfr=MPFRINSTALLDIR'). The `--with-gmp=GMPINSTALLDIR'
+ option is shorthand for `--with-gmp-lib=GMPINSTALLDIR/lib' and
+ `--with-gmp-include=GMPINSTALLDIR/include'. Likewise the
+ `--with-mpfr=MPFRINSTALLDIR' option is shorthand for
+ `--with-mpfr-lib=MPFRINSTALLDIR/lib' and
+ `--with-mpfr-include=MPFRINSTALLDIR/include'. If these shorthand
+ assumptions are not correct, you can use the explicit include and
+ lib options directly.
+
+`--with-ppl=PATHNAME'
+`--with-ppl-include=PATHNAME'
+`--with-ppl-lib=PATHNAME'
+`--with-cloog=PATHNAME'
+`--with-cloog-include=PATHNAME'
+`--with-cloog-lib=PATHNAME'
+ If you do not have PPL (the Parma Polyhedra Library) and the CLooG
+ libraries installed in a standard location and you want to build
+ GCC, you can explicitly specify the directory where they are
+ installed (`--with-ppl=PPLINSTALLDIR',
+ `--with-cloog=CLOOGINSTALLDIR'). The `--with-ppl=PPLINSTALLDIR'
+ option is shorthand for `--with-ppl-lib=PPLINSTALLDIR/lib' and
+ `--with-ppl-include=PPLINSTALLDIR/include'. Likewise the
+ `--with-cloog=CLOOGINSTALLDIR' option is shorthand for
+ `--with-cloog-lib=CLOOGINSTALLDIR/lib' and
+ `--with-cloog-include=CLOOGINSTALLDIR/include'. If these
+ shorthand assumptions are not correct, you can use the explicit
+ include and lib options directly.
+
+`--with-host-libstdcxx=LINKER-ARGS'
+ If you are linking with a static copy of PPL, you can use this
+ option to specify how the linker should find the standard C++
+ library used internally by PPL. Typical values of LINKER-ARGS
+ might be `-lstdc++' or `-Wl,-Bstatic,-lstdc++,-Bdynamic -lm'. If
+ you are linking with a shared copy of PPL, you probably do not
+ need this option; shared library dependencies will cause the
+ linker to search for the standard C++ library automatically.
+
+`--with-debug-prefix-map=MAP'
+ Convert source directory names using `-fdebug-prefix-map' when
+ building runtime libraries. `MAP' is a space-separated list of
+ maps of the form `OLD=NEW'.
+
+
+Cross-Compiler-Specific Options
+-------------------------------
+
+The following options only apply to building cross compilers.
+`--with-sysroot'
+`--with-sysroot=DIR'
+ Tells GCC to consider DIR as the root of a tree that contains a
+ (subset of) the root filesystem of the target operating system.
+ Target system headers, libraries and run-time object files will be
+ searched in there. The specified directory is not copied into the
+ install tree, unlike the options `--with-headers' and
+ `--with-libs' that this option obsoletes. The default value, in
+ case `--with-sysroot' is not given an argument, is
+ `${gcc_tooldir}/sys-root'. If the specified directory is a
+ subdirectory of `${exec_prefix}', then it will be found relative to
+ the GCC binaries if the installation tree is moved.
+
+`--with-build-sysroot'
+`--with-build-sysroot=DIR'
+ Tells GCC to consider DIR as the system root (see
+ `--with-sysroot') while building target libraries, instead of the
+ directory specified with `--with-sysroot'. This option is only
+ useful when you are already using `--with-sysroot'. You can use
+ `--with-build-sysroot' when you are configuring with `--prefix'
+ set to a directory that is different from the one in which you are
+ installing GCC and your target libraries.
+
+ This option affects the system root for the compiler used to build
+ target libraries (which runs on the build system); it does not
+ affect the compiler which is used to build GCC itself.
+
+`--with-headers'
+`--with-headers=DIR'
+ Deprecated in favor of `--with-sysroot'. Specifies that target
+ headers are available when building a cross compiler. The DIR
+ argument specifies a directory which has the target include files.
+ These include files will be copied into the `gcc' install
+ directory. _This option with the DIR argument is required_ when
+ building a cross compiler, if `PREFIX/TARGET/sys-include' doesn't
+ pre-exist. If `PREFIX/TARGET/sys-include' does pre-exist, the DIR
+ argument may be omitted. `fixincludes' will be run on these files
+ to make them compatible with GCC.
+
+`--without-headers'
+ Tells GCC not use any target headers from a libc when building a
+ cross compiler. When crossing to GNU/Linux, you need the headers
+ so GCC can build the exception handling for libgcc.
+
+`--with-libs'
+`--with-libs=``DIR1 DIR2 ... DIRN'''
+ Deprecated in favor of `--with-sysroot'. Specifies a list of
+ directories which contain the target runtime libraries. These
+ libraries will be copied into the `gcc' install directory. If the
+ directory list is omitted, this option has no effect.
+
+`--with-newlib'
+ Specifies that `newlib' is being used as the target C library.
+ This causes `__eprintf' to be omitted from `libgcc.a' on the
+ assumption that it will be provided by `newlib'.
+
+`--with-build-time-tools=DIR'
+ Specifies where to find the set of target tools (assembler,
+ linker, etc.) that will be used while building GCC itself. This
+ option can be useful if the directory layouts are different
+ between the system you are building GCC on, and the system where
+ you will deploy it.
+
+ For example, on a `ia64-hp-hpux' system, you may have the GNU
+ assembler and linker in `/usr/bin', and the native tools in a
+ different path, and build a toolchain that expects to find the
+ native tools in `/usr/bin'.
+
+ When you use this option, you should ensure that DIR includes
+ `ar', `as', `ld', `nm', `ranlib' and `strip' if necessary, and
+ possibly `objdump'. Otherwise, GCC may use an inconsistent set of
+ tools.
+
+Java-Specific Options
+---------------------
+
+The following option applies to the build of the Java front end.
+
+`--disable-libgcj'
+ Specify that the run-time libraries used by GCJ should not be
+ built. This is useful in case you intend to use GCJ with some
+ other run-time, or you're going to install it separately, or it
+ just happens not to build on your particular machine. In general,
+ if the Java front end is enabled, the GCJ libraries will be
+ enabled too, unless they're known to not work on the target
+ platform. If GCJ is enabled but `libgcj' isn't built, you may
+ need to port it; in this case, before modifying the top-level
+ `configure.in' so that `libgcj' is enabled by default on this
+ platform, you may use `--enable-libgcj' to override the default.
+
+
+ The following options apply to building `libgcj'.
+
+General Options
+...............
+
+`--enable-java-maintainer-mode'
+ By default the `libjava' build will not attempt to compile the
+ `.java' source files to `.class'. Instead, it will use the
+ `.class' files from the source tree. If you use this option you
+ must have executables named `ecj1' and `gjavah' in your path for
+ use by the build. You must use this option if you intend to
+ modify any `.java' files in `libjava'.
+
+`--with-java-home=DIRNAME'
+ This `libjava' option overrides the default value of the
+ `java.home' system property. It is also used to set
+ `sun.boot.class.path' to `DIRNAME/lib/rt.jar'. By default
+ `java.home' is set to `PREFIX' and `sun.boot.class.path' to
+ `DATADIR/java/libgcj-VERSION.jar'.
+
+`--with-ecj-jar=FILENAME'
+ This option can be used to specify the location of an external jar
+ file containing the Eclipse Java compiler. A specially modified
+ version of this compiler is used by `gcj' to parse `.java' source
+ files. If this option is given, the `libjava' build will create
+ and install an `ecj1' executable which uses this jar file at
+ runtime.
+
+ If this option is not given, but an `ecj.jar' file is found in the
+ topmost source tree at configure time, then the `libgcj' build
+ will create and install `ecj1', and will also install the
+ discovered `ecj.jar' into a suitable place in the install tree.
+
+ If `ecj1' is not installed, then the user will have to supply one
+ on his path in order for `gcj' to properly parse `.java' source
+ files. A suitable jar is available from
+ `ftp://sourceware.org/pub/java/'.
+
+`--disable-getenv-properties'
+ Don't set system properties from `GCJ_PROPERTIES'.
+
+`--enable-hash-synchronization'
+ Use a global hash table for monitor locks. Ordinarily, `libgcj''s
+ `configure' script automatically makes the correct choice for this
+ option for your platform. Only use this if you know you need the
+ library to be configured differently.
+
+`--enable-interpreter'
+ Enable the Java interpreter. The interpreter is automatically
+ enabled by default on all platforms that support it. This option
+ is really only useful if you want to disable the interpreter
+ (using `--disable-interpreter').
+
+`--disable-java-net'
+ Disable java.net. This disables the native part of java.net only,
+ using non-functional stubs for native method implementations.
+
+`--disable-jvmpi'
+ Disable JVMPI support.
+
+`--disable-libgcj-bc'
+ Disable BC ABI compilation of certain parts of libgcj. By default,
+ some portions of libgcj are compiled with `-findirect-dispatch'
+ and `-fno-indirect-classes', allowing them to be overridden at
+ run-time.
+
+ If `--disable-libgcj-bc' is specified, libgcj is built without
+ these options. This allows the compile-time linker to resolve
+ dependencies when statically linking to libgcj. However it makes
+ it impossible to override the affected portions of libgcj at
+ run-time.
+
+`--enable-reduced-reflection'
+ Build most of libgcj with `-freduced-reflection'. This reduces
+ the size of libgcj at the expense of not being able to do accurate
+ reflection on the classes it contains. This option is safe if you
+ know that code using libgcj will never use reflection on the
+ standard runtime classes in libgcj (including using serialization,
+ RMI or CORBA).
+
+`--with-ecos'
+ Enable runtime eCos target support.
+
+`--without-libffi'
+ Don't use `libffi'. This will disable the interpreter and JNI
+ support as well, as these require `libffi' to work.
+
+`--enable-libgcj-debug'
+ Enable runtime debugging code.
+
+`--enable-libgcj-multifile'
+ If specified, causes all `.java' source files to be compiled into
+ `.class' files in one invocation of `gcj'. This can speed up
+ build time, but is more resource-intensive. If this option is
+ unspecified or disabled, `gcj' is invoked once for each `.java'
+ file to compile into a `.class' file.
+
+`--with-libiconv-prefix=DIR'
+ Search for libiconv in `DIR/include' and `DIR/lib'.
+
+`--enable-sjlj-exceptions'
+ Force use of the `setjmp'/`longjmp'-based scheme for exceptions.
+ `configure' ordinarily picks the correct value based on the
+ platform. Only use this option if you are sure you need a
+ different setting.
+
+`--with-system-zlib'
+ Use installed `zlib' rather than that included with GCC.
+
+`--with-win32-nlsapi=ansi, unicows or unicode'
+ Indicates how MinGW `libgcj' translates between UNICODE characters
+ and the Win32 API.
+
+`--enable-java-home'
+ If enabled, this creates a JPackage compatible SDK environment
+ during install. Note that if -enable-java-home is used,
+ -with-arch-directory=ARCH must also be specified.
+
+`--with-arch-directory=ARCH'
+ Specifies the name to use for the `jre/lib/ARCH' directory in the
+ SDK environment created when -enable-java-home is passed. Typical
+ names for this directory include i386, amd64, ia64, etc.
+
+`--with-os-directory=DIR'
+ Specifies the OS directory for the SDK include directory. This is
+ set to auto detect, and is typically 'linux'.
+
+`--with-origin-name=NAME'
+ Specifies the JPackage origin name. This defaults to the 'gcj' in
+ java-1.5.0-gcj.
+
+`--with-arch-suffix=SUFFIX'
+ Specifies the suffix for the sdk directory. Defaults to the empty
+ string. Examples include '.x86_64' in
+ 'java-1.5.0-gcj-1.5.0.0.x86_64'.
+
+`--with-jvm-root-dir=DIR'
+ Specifies where to install the SDK. Default is $(prefix)/lib/jvm.
+
+`--with-jvm-jar-dir=DIR'
+ Specifies where to install jars. Default is
+ $(prefix)/lib/jvm-exports.
+
+`--with-python-dir=DIR'
+ Specifies where to install the Python modules used for
+ aot-compile. DIR should not include the prefix used in
+ installation. For example, if the Python modules are to be
+ installed in /usr/lib/python2.5/site-packages, then
+ -with-python-dir=/lib/python2.5/site-packages should be passed. If
+ this is not specified, then the Python modules are installed in
+ $(prefix)/share/python.
+
+`--enable-aot-compile-rpm'
+ Adds aot-compile-rpm to the list of installed scripts.
+
+ `ansi'
+ Use the single-byte `char' and the Win32 A functions natively,
+ translating to and from UNICODE when using these functions.
+ If unspecified, this is the default.
+
+ `unicows'
+ Use the `WCHAR' and Win32 W functions natively. Adds
+ `-lunicows' to `libgcj.spec' to link with `libunicows'.
+ `unicows.dll' needs to be deployed on Microsoft Windows 9X
+ machines running built executables. `libunicows.a', an
+ open-source import library around Microsoft's `unicows.dll',
+ is obtained from `http://libunicows.sourceforge.net/', which
+ also gives details on getting `unicows.dll' from Microsoft.
+
+ `unicode'
+ Use the `WCHAR' and Win32 W functions natively. Does _not_
+ add `-lunicows' to `libgcj.spec'. The built executables will
+ only run on Microsoft Windows NT and above.
+
+AWT-Specific Options
+....................
+
+`--with-x'
+ Use the X Window System.
+
+`--enable-java-awt=PEER(S)'
+ Specifies the AWT peer library or libraries to build alongside
+ `libgcj'. If this option is unspecified or disabled, AWT will be
+ non-functional. Current valid values are `gtk' and `xlib'.
+ Multiple libraries should be separated by a comma (i.e.
+ `--enable-java-awt=gtk,xlib').
+
+`--enable-gtk-cairo'
+ Build the cairo Graphics2D implementation on GTK.
+
+`--enable-java-gc=TYPE'
+ Choose garbage collector. Defaults to `boehm' if unspecified.
+
+`--disable-gtktest'
+ Do not try to compile and run a test GTK+ program.
+
+`--disable-glibtest'
+ Do not try to compile and run a test GLIB program.
+
+`--with-libart-prefix=PFX'
+ Prefix where libart is installed (optional).
+
+`--with-libart-exec-prefix=PFX'
+ Exec prefix where libart is installed (optional).
+
+`--disable-libarttest'
+ Do not try to compile and run a test libart program.
+
+
+
+File: gccinstall.info, Node: Building, Next: Testing, Prev: Configuration, Up: Installing GCC
+
+5 Building
+**********
+
+ Now that GCC is configured, you are ready to build the compiler and
+runtime libraries.
+
+ Some commands executed when making the compiler may fail (return a
+nonzero status) and be ignored by `make'. These failures, which are
+often due to files that were not found, are expected, and can safely be
+ignored.
+
+ It is normal to have compiler warnings when compiling certain files.
+Unless you are a GCC developer, you can generally ignore these warnings
+unless they cause compilation to fail. Developers should attempt to fix
+any warnings encountered, however they can temporarily continue past
+warnings-as-errors by specifying the configure flag `--disable-werror'.
+
+ On certain old systems, defining certain environment variables such
+as `CC' can interfere with the functioning of `make'.
+
+ If you encounter seemingly strange errors when trying to build the
+compiler in a directory other than the source directory, it could be
+because you have previously configured the compiler in the source
+directory. Make sure you have done all the necessary preparations.
+
+ If you build GCC on a BSD system using a directory stored in an old
+System V file system, problems may occur in running `fixincludes' if the
+System V file system doesn't support symbolic links. These problems
+result in a failure to fix the declaration of `size_t' in
+`sys/types.h'. If you find that `size_t' is a signed type and that
+type mismatches occur, this could be the cause.
+
+ The solution is not to use such a directory for building GCC.
+
+ Similarly, when building from SVN or snapshots, or if you modify
+`*.l' files, you need the Flex lexical analyzer generator installed.
+If you do not modify `*.l' files, releases contain the Flex-generated
+files and you do not need Flex installed to build them. There is still
+one Flex-based lexical analyzer (part of the build machinery, not of
+GCC itself) that is used even if you only build the C front end.
+
+ When building from SVN or snapshots, or if you modify Texinfo
+documentation, you need version 4.7 or later of Texinfo installed if you
+want Info documentation to be regenerated. Releases contain Info
+documentation pre-built for the unmodified documentation in the release.
+
+5.1 Building a native compiler
+==============================
+
+For a native build, the default configuration is to perform a 3-stage
+bootstrap of the compiler when `make' is invoked. This will build the
+entire GCC system and ensure that it compiles itself correctly. It can
+be disabled with the `--disable-bootstrap' parameter to `configure',
+but bootstrapping is suggested because the compiler will be tested more
+completely and could also have better performance.
+
+ The bootstrapping process will complete the following steps:
+
+ * Build tools necessary to build the compiler.
+
+ * Perform a 3-stage bootstrap of the compiler. This includes
+ building three times the target tools for use by the compiler such
+ as binutils (bfd, binutils, gas, gprof, ld, and opcodes) if they
+ have been individually linked or moved into the top level GCC
+ source tree before configuring.
+
+ * Perform a comparison test of the stage2 and stage3 compilers.
+
+ * Build runtime libraries using the stage3 compiler from the
+ previous step.
+
+
+ If you are short on disk space you might consider `make
+bootstrap-lean' instead. The sequence of compilation is the same
+described above, but object files from the stage1 and stage2 of the
+3-stage bootstrap of the compiler are deleted as soon as they are no
+longer needed.
+
+ If you wish to use non-default GCC flags when compiling the stage2
+and stage3 compilers, set `BOOT_CFLAGS' on the command line when doing
+`make'. For example, if you want to save additional space during the
+bootstrap and in the final installation as well, you can build the
+compiler binaries without debugging information as in the following
+example. This will save roughly 40% of disk space both for the
+bootstrap and the final installation. (Libraries will still contain
+debugging information.)
+
+ make BOOT_CFLAGS='-O' bootstrap
+
+ You can place non-default optimization flags into `BOOT_CFLAGS'; they
+are less well tested here than the default of `-g -O2', but should
+still work. In a few cases, you may find that you need to specify
+special flags such as `-msoft-float' here to complete the bootstrap; or,
+if the native compiler miscompiles the stage1 compiler, you may need to
+work around this, by choosing `BOOT_CFLAGS' to avoid the parts of the
+stage1 compiler that were miscompiled, or by using `make bootstrap4' to
+increase the number of stages of bootstrap.
+
+ `BOOT_CFLAGS' does not apply to bootstrapped target libraries.
+Since these are always compiled with the compiler currently being
+bootstrapped, you can use `CFLAGS_FOR_TARGET' to modify their
+compilation flags, as for non-bootstrapped target libraries. Again, if
+the native compiler miscompiles the stage1 compiler, you may need to
+work around this by avoiding non-working parts of the stage1 compiler.
+Use `STAGE1_LIBCFLAGS' to this end.
+
+ If you used the flag `--enable-languages=...' to restrict the
+compilers to be built, only those you've actually enabled will be
+built. This will of course only build those runtime libraries, for
+which the particular compiler has been built. Please note, that
+re-defining `LANGUAGES' when calling `make' *does not* work anymore!
+
+ If the comparison of stage2 and stage3 fails, this normally indicates
+that the stage2 compiler has compiled GCC incorrectly, and is therefore
+a potentially serious bug which you should investigate and report. (On
+a few systems, meaningful comparison of object files is impossible; they
+always appear "different". If you encounter this problem, you will
+need to disable comparison in the `Makefile'.)
+
+ If you do not want to bootstrap your compiler, you can configure with
+`--disable-bootstrap'. In particular cases, you may want to bootstrap
+your compiler even if the target system is not the same as the one you
+are building on: for example, you could build a
+`powerpc-unknown-linux-gnu' toolchain on a
+`powerpc64-unknown-linux-gnu' host. In this case, pass
+`--enable-bootstrap' to the configure script.
+
+5.2 Building a cross compiler
+=============================
+
+When building a cross compiler, it is not generally possible to do a
+3-stage bootstrap of the compiler. This makes for an interesting
+problem as parts of GCC can only be built with GCC.
+
+ To build a cross compiler, we first recommend building and
+installing a native compiler. You can then use the native GCC compiler
+to build the cross compiler. The installed native compiler needs to be
+GCC version 2.95 or later.
+
+ If the cross compiler is to be built with support for the Java
+programming language and the ability to compile .java source files is
+desired, the installed native compiler used to build the cross compiler
+needs to be the same GCC version as the cross compiler. In addition
+the cross compiler needs to be configured with `--with-ecj-jar=...'.
+
+ Assuming you have already installed a native copy of GCC and
+configured your cross compiler, issue the command `make', which
+performs the following steps:
+
+ * Build host tools necessary to build the compiler.
+
+ * Build target tools for use by the compiler such as binutils (bfd,
+ binutils, gas, gprof, ld, and opcodes) if they have been
+ individually linked or moved into the top level GCC source tree
+ before configuring.
+
+ * Build the compiler (single stage only).
+
+ * Build runtime libraries using the compiler from the previous step.
+
+ Note that if an error occurs in any step the make process will exit.
+
+ If you are not building GNU binutils in the same source tree as GCC,
+you will need a cross-assembler and cross-linker installed before
+configuring GCC. Put them in the directory `PREFIX/TARGET/bin'. Here
+is a table of the tools you should put in this directory:
+
+`as'
+ This should be the cross-assembler.
+
+`ld'
+ This should be the cross-linker.
+
+`ar'
+ This should be the cross-archiver: a program which can manipulate
+ archive files (linker libraries) in the target machine's format.
+
+`ranlib'
+ This should be a program to construct a symbol table in an archive
+ file.
+
+ The installation of GCC will find these programs in that directory,
+and copy or link them to the proper place to for the cross-compiler to
+find them when run later.
+
+ The easiest way to provide these files is to build the Binutils
+package. Configure it with the same `--host' and `--target' options
+that you use for configuring GCC, then build and install them. They
+install their executables automatically into the proper directory.
+Alas, they do not support all the targets that GCC supports.
+
+ If you are not building a C library in the same source tree as GCC,
+you should also provide the target libraries and headers before
+configuring GCC, specifying the directories with `--with-sysroot' or
+`--with-headers' and `--with-libs'. Many targets also require "start
+files" such as `crt0.o' and `crtn.o' which are linked into each
+executable. There may be several alternatives for `crt0.o', for use
+with profiling or other compilation options. Check your target's
+definition of `STARTFILE_SPEC' to find out what start files it uses.
+
+5.3 Building in parallel
+========================
+
+GNU Make 3.79 and above, which is necessary to build GCC, support
+building in parallel. To activate this, you can use `make -j 2'
+instead of `make'. You can also specify a bigger number, and in most
+cases using a value greater than the number of processors in your
+machine will result in fewer and shorter I/O latency hits, thus
+improving overall throughput; this is especially true for slow drives
+and network filesystems.
+
+5.4 Building the Ada compiler
+=============================
+
+In order to build GNAT, the Ada compiler, you need a working GNAT
+compiler (GCC version 3.4 or later). This includes GNAT tools such as
+`gnatmake' and `gnatlink', since the Ada front end is written in Ada and
+uses some GNAT-specific extensions.
+
+ In order to build a cross compiler, it is suggested to install the
+new compiler as native first, and then use it to build the cross
+compiler.
+
+ `configure' does not test whether the GNAT installation works and
+has a sufficiently recent version; if too old a GNAT version is
+installed, the build will fail unless `--enable-languages' is used to
+disable building the Ada front end.
+
+ `ADA_INCLUDE_PATH' and `ADA_OBJECT_PATH' environment variables must
+not be set when building the Ada compiler, the Ada tools, or the Ada
+runtime libraries. You can check that your build environment is clean
+by verifying that `gnatls -v' lists only one explicit path in each
+section.
+
+5.5 Building with profile feedback
+==================================
+
+It is possible to use profile feedback to optimize the compiler itself.
+This should result in a faster compiler binary. Experiments done on
+x86 using gcc 3.3 showed approximately 7 percent speedup on compiling C
+programs. To bootstrap the compiler with profile feedback, use `make
+profiledbootstrap'.
+
+ When `make profiledbootstrap' is run, it will first build a `stage1'
+compiler. This compiler is used to build a `stageprofile' compiler
+instrumented to collect execution counts of instruction and branch
+probabilities. Then runtime libraries are compiled with profile
+collected. Finally a `stagefeedback' compiler is built using the
+information collected.
+
+ Unlike standard bootstrap, several additional restrictions apply.
+The compiler used to build `stage1' needs to support a 64-bit integral
+type. It is recommended to only use GCC for this. Also parallel make
+is currently not supported since collisions in profile collecting may
+occur.
+
+
+File: gccinstall.info, Node: Testing, Next: Final install, Prev: Building, Up: Installing GCC
+
+6 Installing GCC: Testing
+*************************
+
+ Before you install GCC, we encourage you to run the testsuites and to
+compare your results with results from a similar configuration that have
+been submitted to the gcc-testresults mailing list. Some of these
+archived results are linked from the build status lists at
+`http://gcc.gnu.org/buildstat.html', although not everyone who reports
+a successful build runs the testsuites and submits the results. This
+step is optional and may require you to download additional software,
+but it can give you confidence in your new GCC installation or point out
+problems before you install and start using your new GCC.
+
+ First, you must have downloaded the testsuites. These are part of
+the full distribution, but if you downloaded the "core" compiler plus
+any front ends, you must download the testsuites separately.
+
+ Second, you must have the testing tools installed. This includes
+DejaGnu, Tcl, and Expect; the DejaGnu site has links to these.
+
+ If the directories where `runtest' and `expect' were installed are
+not in the `PATH', you may need to set the following environment
+variables appropriately, as in the following example (which assumes
+that DejaGnu has been installed under `/usr/local'):
+
+ TCL_LIBRARY = /usr/local/share/tcl8.0
+ DEJAGNULIBS = /usr/local/share/dejagnu
+
+ (On systems such as Cygwin, these paths are required to be actual
+paths, not mounts or links; presumably this is due to some lack of
+portability in the DejaGnu code.)
+
+ Finally, you can run the testsuite (which may take a long time):
+ cd OBJDIR; make -k check
+
+ This will test various components of GCC, such as compiler front
+ends and runtime libraries. While running the testsuite, DejaGnu might
+emit some harmless messages resembling `WARNING: Couldn't find the
+global config file.' or `WARNING: Couldn't find tool init file' that
+can be ignored.
+
+ If you are testing a cross-compiler, you may want to run the
+testsuite on a simulator as described at
+`http://gcc.gnu.org/simtest-howto.html'.
+
+6.1 How can you run the testsuite on selected tests?
+====================================================
+
+In order to run sets of tests selectively, there are targets `make
+check-gcc' and `make check-g++' in the `gcc' subdirectory of the object
+directory. You can also just run `make check' in a subdirectory of the
+object directory.
+
+ A more selective way to just run all `gcc' execute tests in the
+testsuite is to use
+
+ make check-gcc RUNTESTFLAGS="execute.exp OTHER-OPTIONS"
+
+ Likewise, in order to run only the `g++' "old-deja" tests in the
+testsuite with filenames matching `9805*', you would use
+
+ make check-g++ RUNTESTFLAGS="old-deja.exp=9805* OTHER-OPTIONS"
+
+ The `*.exp' files are located in the testsuite directories of the GCC
+source, the most important ones being `compile.exp', `execute.exp',
+`dg.exp' and `old-deja.exp'. To get a list of the possible `*.exp'
+files, pipe the output of `make check' into a file and look at the
+`Running ... .exp' lines.
+
+6.2 Passing options and running multiple testsuites
+===================================================
+
+You can pass multiple options to the testsuite using the
+`--target_board' option of DejaGNU, either passed as part of
+`RUNTESTFLAGS', or directly to `runtest' if you prefer to work outside
+the makefiles. For example,
+
+ make check-g++ RUNTESTFLAGS="--target_board=unix/-O3/-fmerge-constants"
+
+ will run the standard `g++' testsuites ("unix" is the target name
+for a standard native testsuite situation), passing `-O3
+-fmerge-constants' to the compiler on every test, i.e., slashes
+separate options.
+
+ You can run the testsuites multiple times using combinations of
+options with a syntax similar to the brace expansion of popular shells:
+
+ ..."--target_board=arm-sim\{-mhard-float,-msoft-float\}\{-O1,-O2,-O3,\}"
+
+ (Note the empty option caused by the trailing comma in the final
+group.) The following will run each testsuite eight times using the
+`arm-sim' target, as if you had specified all possible combinations
+yourself:
+
+ --target_board=arm-sim/-mhard-float/-O1
+ --target_board=arm-sim/-mhard-float/-O2
+ --target_board=arm-sim/-mhard-float/-O3
+ --target_board=arm-sim/-mhard-float
+ --target_board=arm-sim/-msoft-float/-O1
+ --target_board=arm-sim/-msoft-float/-O2
+ --target_board=arm-sim/-msoft-float/-O3
+ --target_board=arm-sim/-msoft-float
+
+ They can be combined as many times as you wish, in arbitrary ways.
+This list:
+
+ ..."--target_board=unix/-Wextra\{-O3,-fno-strength\}\{-fomit-frame,\}"
+
+ will generate four combinations, all involving `-Wextra'.
+
+ The disadvantage to this method is that the testsuites are run in
+serial, which is a waste on multiprocessor systems. For users with GNU
+Make and a shell which performs brace expansion, you can run the
+testsuites in parallel by having the shell perform the combinations and
+`make' do the parallel runs. Instead of using `--target_board', use a
+special makefile target:
+
+ make -jN check-TESTSUITE//TEST-TARGET/OPTION1/OPTION2/...
+
+ For example,
+
+ make -j3 check-gcc//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu}
+
+ will run three concurrent "make-gcc" testsuites, eventually testing
+all ten combinations as described above. Note that this is currently
+only supported in the `gcc' subdirectory. (To see how this works, try
+typing `echo' before the example given here.)
+
+6.3 Additional testing for Java Class Libraries
+===============================================
+
+The Java runtime tests can be executed via `make check' in the
+`TARGET/libjava/testsuite' directory in the build tree.
+
+ The Mauve Project provides a suite of tests for the Java Class
+Libraries. This suite can be run as part of libgcj testing by placing
+the Mauve tree within the libjava testsuite at
+`libjava/testsuite/libjava.mauve/mauve', or by specifying the location
+of that tree when invoking `make', as in `make MAUVEDIR=~/mauve check'.
+
+6.4 How to interpret test results
+=================================
+
+The result of running the testsuite are various `*.sum' and `*.log'
+files in the testsuite subdirectories. The `*.log' files contain a
+detailed log of the compiler invocations and the corresponding results,
+the `*.sum' files summarize the results. These summaries contain
+status codes for all tests:
+
+ * PASS: the test passed as expected
+
+ * XPASS: the test unexpectedly passed
+
+ * FAIL: the test unexpectedly failed
+
+ * XFAIL: the test failed as expected
+
+ * UNSUPPORTED: the test is not supported on this platform
+
+ * ERROR: the testsuite detected an error
+
+ * WARNING: the testsuite detected a possible problem
+
+ It is normal for some tests to report unexpected failures. At the
+current time the testing harness does not allow fine grained control
+over whether or not a test is expected to fail. This problem should be
+fixed in future releases.
+
+6.5 Submitting test results
+===========================
+
+If you want to report the results to the GCC project, use the
+`contrib/test_summary' shell script. Start it in the OBJDIR with
+
+ SRCDIR/contrib/test_summary -p your_commentary.txt \
+ -m gcc-testresults@gcc.gnu.org |sh
+
+ This script uses the `Mail' program to send the results, so make
+sure it is in your `PATH'. The file `your_commentary.txt' is prepended
+to the testsuite summary and should contain any special remarks you
+have on your results or your build environment. Please do not edit the
+testsuite result block or the subject line, as these messages may be
+automatically processed.
+
+
+File: gccinstall.info, Node: Final install, Prev: Testing, Up: Installing GCC
+
+7 Installing GCC: Final installation
+************************************
+
+ Now that GCC has been built (and optionally tested), you can install
+it with
+ cd OBJDIR; make install
+
+ We strongly recommend to install into a target directory where there
+is no previous version of GCC present. Also, the GNAT runtime should
+not be stripped, as this would break certain features of the debugger
+that depend on this debugging information (catching Ada exceptions for
+instance).
+
+ That step completes the installation of GCC; user level binaries can
+be found in `PREFIX/bin' where PREFIX is the value you specified with
+the `--prefix' to configure (or `/usr/local' by default). (If you
+specified `--bindir', that directory will be used instead; otherwise,
+if you specified `--exec-prefix', `EXEC-PREFIX/bin' will be used.)
+Headers for the C++ and Java libraries are installed in
+`PREFIX/include'; libraries in `LIBDIR' (normally `PREFIX/lib');
+internal parts of the compiler in `LIBDIR/gcc' and `LIBEXECDIR/gcc';
+documentation in info format in `INFODIR' (normally `PREFIX/info').
+
+ When installing cross-compilers, GCC's executables are not only
+installed into `BINDIR', that is, `EXEC-PREFIX/bin', but additionally
+into `EXEC-PREFIX/TARGET-ALIAS/bin', if that directory exists.
+Typically, such "tooldirs" hold target-specific binutils, including
+assembler and linker.
+
+ Installation into a temporary staging area or into a `chroot' jail
+can be achieved with the command
+
+ make DESTDIR=PATH-TO-ROOTDIR install
+
+where PATH-TO-ROOTDIR is the absolute path of a directory relative to
+which all installation paths will be interpreted. Note that the
+directory specified by `DESTDIR' need not exist yet; it will be created
+if necessary.
+
+ There is a subtle point with tooldirs and `DESTDIR': If you relocate
+a cross-compiler installation with e.g. `DESTDIR=ROOTDIR', then the
+directory `ROOTDIR/EXEC-PREFIX/TARGET-ALIAS/bin' will be filled with
+duplicated GCC executables only if it already exists, it will not be
+created otherwise. This is regarded as a feature, not as a bug,
+because it gives slightly more control to the packagers using the
+`DESTDIR' feature.
+
+ If you are bootstrapping a released version of GCC then please
+quickly review the build status page for your release, available from
+`http://gcc.gnu.org/buildstat.html'. If your system is not listed for
+the version of GCC that you built, send a note to <gcc@gcc.gnu.org>
+indicating that you successfully built and installed GCC. Include the
+following information:
+
+ * Output from running `SRCDIR/config.guess'. Do not send that file
+ itself, just the one-line output from running it.
+
+ * The output of `gcc -v' for your newly installed `gcc'. This tells
+ us which version of GCC you built and the options you passed to
+ configure.
+
+ * Whether you enabled all languages or a subset of them. If you
+ used a full distribution then this information is part of the
+ configure options in the output of `gcc -v', but if you downloaded
+ the "core" compiler plus additional front ends then it isn't
+ apparent which ones you built unless you tell us about it.
+
+ * If the build was for GNU/Linux, also include:
+ * The distribution name and version (e.g., Red Hat 7.1 or
+ Debian 2.2.3); this information should be available from
+ `/etc/issue'.
+
+ * The version of the Linux kernel, available from `uname
+ --version' or `uname -a'.
+
+ * The version of glibc you used; for RPM-based systems like Red
+ Hat, Mandrake, and SuSE type `rpm -q glibc' to get the glibc
+ version, and on systems like Debian and Progeny use `dpkg -l
+ libc6'.
+ For other systems, you can include similar information if you
+ think it is relevant.
+
+ * Any other information that you think would be useful to people
+ building GCC on the same configuration. The new entry in the
+ build status list will include a link to the archived copy of your
+ message.
+
+ We'd also like to know if the *Note host/target specific
+installation notes: Specific. didn't include your host/target
+information or if that information is incomplete or out of date. Send
+a note to <gcc@gcc.gnu.org> detailing how the information should be
+changed.
+
+ If you find a bug, please report it following the bug reporting
+guidelines.
+
+ If you want to print the GCC manuals, do `cd OBJDIR; make dvi'. You
+will need to have `texi2dvi' (version at least 4.7) and TeX installed.
+This creates a number of `.dvi' files in subdirectories of `OBJDIR';
+these may be converted for printing with programs such as `dvips'.
+Alternately, by using `make pdf' in place of `make dvi', you can create
+documentation in the form of `.pdf' files; this requires `texi2pdf',
+which is included with Texinfo version 4.8 and later. You can also buy
+printed manuals from the Free Software Foundation, though such manuals
+may not be for the most recent version of GCC.
+
+ If you would like to generate online HTML documentation, do `cd
+OBJDIR; make html' and HTML will be generated for the gcc manuals in
+`OBJDIR/gcc/HTML'.
+
+
+File: gccinstall.info, Node: Binaries, Next: Specific, Prev: Installing GCC, Up: Top
+
+8 Installing GCC: Binaries
+**************************
+
+ We are often asked about pre-compiled versions of GCC. While we
+cannot provide these for all platforms, below you'll find links to
+binaries for various platforms where creating them by yourself is not
+easy due to various reasons.
+
+ Please note that we did not create these binaries, nor do we support
+them. If you have any problems installing them, please contact their
+makers.
+
+ * AIX:
+ * Bull's Freeware and Shareware Archive for AIX;
+
+ * Hudson Valley Community College Open Source Software for IBM
+ System p;
+
+ * AIX 5L and 6 Open Source Packages.
+
+ * DOS--DJGPP.
+
+ * Renesas H8/300[HS]--GNU Development Tools for the Renesas
+ H8/300[HS] Series.
+
+ * HP-UX:
+ * HP-UX Porting Center;
+
+ * Binaries for HP-UX 11.00 at Aachen University of Technology.
+
+ * Motorola 68HC11/68HC12--GNU Development Tools for the Motorola
+ 68HC11/68HC12.
+
+ * SCO OpenServer/Unixware.
+
+ * Solaris 2 (SPARC, Intel)--Sunfreeware.
+
+ * SGI--SGI Freeware.
+
+ * Microsoft Windows:
+ * The Cygwin project;
+
+ * The MinGW project.
+
+ * The Written Word offers binaries for AIX 4.3.3, 5.1 and 5.2, IRIX
+ 6.5, Tru64 UNIX 4.0D and 5.1, GNU/Linux (i386), HP-UX 10.20,
+ 11.00, and 11.11, and Solaris/SPARC 2.5.1, 2.6, 7, 8, 9 and 10.
+
+ * OpenPKG offers binaries for quite a number of platforms.
+
+ * The GFortran Wiki has links to GNU Fortran binaries for several
+ platforms.
+
+ In addition to those specific offerings, you can get a binary
+distribution CD-ROM from the Free Software Foundation. It contains
+binaries for a number of platforms, and includes not only GCC, but
+other stuff as well. The current CD does not contain the latest
+version of GCC, but it should allow bootstrapping the compiler. An
+updated version of that disk is in the works.
+
+
+File: gccinstall.info, Node: Specific, Next: Old, Prev: Binaries, Up: Top
+
+9 Host/target specific installation notes for GCC
+*************************************************
+
+ Please read this document carefully _before_ installing the GNU
+Compiler Collection on your machine.
+
+ Note that this list of install notes is _not_ a list of supported
+hosts or targets. Not all supported hosts and targets are listed here,
+only the ones that require host-specific or target-specific information
+are.
+
+alpha*-*-*
+==========
+
+This section contains general configuration information for all
+alpha-based platforms using ELF (in particular, ignore this section for
+DEC OSF/1, Digital UNIX and Tru64 UNIX). In addition to reading this
+section, please read all other sections that match your target.
+
+ We require binutils 2.11.2 or newer. Previous binutils releases had
+a number of problems with DWARF 2 debugging information, not the least
+of which is incorrect linking of shared libraries.
+
+alpha*-dec-osf*
+===============
+
+Systems using processors that implement the DEC Alpha architecture and
+are running the DEC/Compaq Unix (DEC OSF/1, Digital UNIX, or Compaq
+Tru64 UNIX) operating system, for example the DEC Alpha AXP systems.
+
+ As of GCC 3.2, versions before `alpha*-dec-osf4' are no longer
+supported. (These are the versions which identify themselves as DEC
+OSF/1.)
+
+ In Digital Unix V4.0, virtual memory exhausted bootstrap failures
+may be fixed by configuring with `--with-gc=simple', reconfiguring
+Kernel Virtual Memory and Swap parameters per the `/usr/sbin/sys_check'
+Tuning Suggestions, or applying the patch in
+`http://gcc.gnu.org/ml/gcc/2002-08/msg00822.html'.
+
+ In Tru64 UNIX V5.1, Compaq introduced a new assembler that does not
+currently (2001-06-13) work with `mips-tfile'. As a workaround, we
+need to use the old assembler, invoked via the barely documented
+`-oldas' option. To bootstrap GCC, you either need to use the Compaq C
+Compiler:
+
+ % CC=cc SRCDIR/configure [OPTIONS] [TARGET]
+
+ or you can use a copy of GCC 2.95.3 or higher built on Tru64 UNIX
+V4.0:
+
+ % CC=gcc -Wa,-oldas SRCDIR/configure [OPTIONS] [TARGET]
+
+ As of GNU binutils 2.11.2, neither GNU `as' nor GNU `ld' are
+supported on Tru64 UNIX, so you must not configure GCC with
+`--with-gnu-as' or `--with-gnu-ld'.
+
+ GCC writes a `.verstamp' directive to the assembler output file
+unless it is built as a cross-compiler. It gets the version to use from
+the system header file `/usr/include/stamp.h'. If you install a new
+version of DEC Unix, you should rebuild GCC to pick up the new version
+stamp.
+
+ `make compare' may fail on old versions of DEC Unix unless you add
+`-save-temps' to `BOOT_CFLAGS'. On these systems, the name of the
+assembler input file is stored in the object file, and that makes
+comparison fail if it differs between the `stage1' and `stage2'
+compilations. The option `-save-temps' forces a fixed name to be used
+for the assembler input file, instead of a randomly chosen name in
+`/tmp'. Do not add `-save-temps' unless the comparisons fail without
+that option. If you add `-save-temps', you will have to manually
+delete the `.i' and `.s' files after each series of compilations.
+
+ GCC now supports both the native (ECOFF) debugging format used by DBX
+and GDB and an encapsulated STABS format for use only with GDB. See the
+discussion of the `--with-stabs' option of `configure' above for more
+information on these formats and how to select them.
+
+ There is a bug in DEC's assembler that produces incorrect line
+numbers for ECOFF format when the `.align' directive is used. To work
+around this problem, GCC will not emit such alignment directives while
+writing ECOFF format debugging information even if optimization is
+being performed. Unfortunately, this has the very undesirable
+side-effect that code addresses when `-O' is specified are different
+depending on whether or not `-g' is also specified.
+
+ To avoid this behavior, specify `-gstabs+' and use GDB instead of
+DBX. DEC is now aware of this problem with the assembler and hopes to
+provide a fix shortly.
+
+arc-*-elf
+=========
+
+Argonaut ARC processor. This configuration is intended for embedded
+systems.
+
+arm-*-elf
+=========
+
+ARM-family processors. Subtargets that use the ELF object format
+require GNU binutils 2.13 or newer. Such subtargets include:
+`arm-*-freebsd', `arm-*-netbsdelf', `arm-*-*linux' and `arm-*-rtems'.
+
+arm-*-coff
+==========
+
+ARM-family processors. Note that there are two different varieties of
+PE format subtarget supported: `arm-wince-pe' and `arm-pe' as well as a
+standard COFF target `arm-*-coff'.
+
+arm-*-aout
+==========
+
+ARM-family processors. These targets support the AOUT file format:
+`arm-*-aout', `arm-*-netbsd'.
+
+avr
+===
+
+ATMEL AVR-family micro controllers. These are used in embedded
+applications. There are no standard Unix configurations. *Note AVR
+Options: (gcc)AVR Options, for the list of supported MCU types.
+
+ Use `configure --target=avr --enable-languages="c"' to configure GCC.
+
+ Further installation notes and other useful information about AVR
+tools can also be obtained from:
+
+ * http://www.nongnu.org/avr/
+
+ * http://www.amelek.gda.pl/avr/
+
+ We _strongly_ recommend using binutils 2.13 or newer.
+
+ The following error:
+ Error: register required
+
+ indicates that you should upgrade to a newer version of the binutils.
+
+Blackfin
+========
+
+The Blackfin processor, an Analog Devices DSP. *Note Blackfin Options:
+(gcc)Blackfin Options,
+
+ More information, and a version of binutils with support for this
+processor, is available at `http://blackfin.uclinux.org'
+
+CRIS
+====
+
+CRIS is the CPU architecture in Axis Communications ETRAX
+system-on-a-chip series. These are used in embedded applications.
+
+ *Note CRIS Options: (gcc)CRIS Options, for a list of CRIS-specific
+options.
+
+ There are a few different CRIS targets:
+`cris-axis-elf'
+ Mainly for monolithic embedded systems. Includes a multilib for
+ the `v10' core used in `ETRAX 100 LX'.
+
+`cris-axis-linux-gnu'
+ A GNU/Linux port for the CRIS architecture, currently targeting
+ `ETRAX 100 LX' by default.
+
+ For `cris-axis-elf' you need binutils 2.11 or newer. For
+`cris-axis-linux-gnu' you need binutils 2.12 or newer.
+
+ Pre-packaged tools can be obtained from
+`ftp://ftp.axis.com/pub/axis/tools/cris/compiler-kit/'. More
+information about this platform is available at
+`http://developer.axis.com/'.
+
+CRX
+===
+
+The CRX CompactRISC architecture is a low-power 32-bit architecture with
+fast context switching and architectural extensibility features.
+
+ *Note CRX Options: (gcc)CRX Options,
+
+ Use `configure --target=crx-elf --enable-languages=c,c++' to
+configure GCC for building a CRX cross-compiler. The option
+`--target=crx-elf' is also used to build the `newlib' C library for CRX.
+
+ It is also possible to build libstdc++-v3 for the CRX architecture.
+This needs to be done in a separate step with the following configure
+settings: `gcc/libstdc++-v3/configure --host=crx-elf --with-newlib
+--enable-sjlj-exceptions --enable-cxx-flags='-fexceptions -frtti''
+
+DOS
+===
+
+Please have a look at the binaries page.
+
+ You cannot install GCC by itself on MSDOS; it will not compile under
+any MSDOS compiler except itself. You need to get the complete
+compilation package DJGPP, which includes binaries as well as sources,
+and includes all the necessary compilation tools and libraries.
+
+*-*-freebsd*
+============
+
+The version of binutils installed in `/usr/bin' probably works with
+this release of GCC. However, on FreeBSD 4, bootstrapping against the
+latest FSF binutils is known to improve overall testsuite results; and,
+on FreeBSD/alpha, using binutils 2.14 or later is required to build
+libjava.
+
+ Support for FreeBSD 1 was discontinued in GCC 3.2.
+
+ Support for FreeBSD 2 will be discontinued after GCC 3.4. The
+following was true for GCC 3.1 but the current status is unknown. For
+FreeBSD 2 or any mutant a.out versions of FreeBSD 3: All configuration
+support and files as shipped with GCC 2.95 are still in place. FreeBSD
+2.2.7 has been known to bootstrap completely; however, it is unknown
+which version of binutils was used (it is assumed that it was the
+system copy in `/usr/bin') and C++ EH failures were noted.
+
+ For FreeBSD using the ELF file format: DWARF 2 debugging is now the
+default for all CPU architectures. It had been the default on
+FreeBSD/alpha since its inception. You may use `-gstabs' instead of
+`-g', if you really want the old debugging format. There are no known
+issues with mixing object files and libraries with different debugging
+formats. Otherwise, this release of GCC should now match more of the
+configuration used in the stock FreeBSD configuration of GCC. In
+particular, `--enable-threads' is now configured by default. However,
+as a general user, do not attempt to replace the system compiler with
+this release. Known to bootstrap and check with good results on
+FreeBSD 4.9-STABLE and 5-CURRENT. In the past, known to bootstrap and
+check with good results on FreeBSD 3.0, 3.4, 4.0, 4.2, 4.3, 4.4, 4.5,
+4.8-STABLE.
+
+ In principle, `--enable-threads' is now compatible with
+`--enable-libgcj' on FreeBSD. However, it has only been built and
+tested on `i386-*-freebsd[45]' and `alpha-*-freebsd[45]'. The static
+library may be incorrectly built (symbols are missing at link time).
+There is a rare timing-based startup hang (probably involves an
+assumption about the thread library). Multi-threaded boehm-gc
+(required for libjava) exposes severe threaded signal-handling bugs on
+FreeBSD before 4.5-RELEASE. Other CPU architectures supported by
+FreeBSD will require additional configuration tuning in, at the very
+least, both boehm-gc and libffi.
+
+ Shared `libgcc_s.so' is now built and installed by default.
+
+h8300-hms
+=========
+
+Renesas H8/300 series of processors.
+
+ Please have a look at the binaries page.
+
+ The calling convention and structure layout has changed in release
+2.6. All code must be recompiled. The calling convention now passes
+the first three arguments in function calls in registers. Structures
+are no longer a multiple of 2 bytes.
+
+hppa*-hp-hpux*
+==============
+
+Support for HP-UX version 9 and older was discontinued in GCC 3.4.
+
+ We require using gas/binutils on all hppa platforms. Version 2.19 or
+later is recommended.
+
+ It may be helpful to configure GCC with the `--with-gnu-as' and
+`--with-as=...' options to ensure that GCC can find GAS.
+
+ The HP assembler should not be used with GCC. It is rarely tested
+and may not work. It shouldn't be used with any languages other than C
+due to its many limitations.
+
+ Specifically, `-g' does not work (HP-UX uses a peculiar debugging
+format which GCC does not know about). It also inserts timestamps into
+each object file it creates, causing the 3-stage comparison test to
+fail during a bootstrap. You should be able to continue by saying
+`make all-host all-target' after getting the failure from `make'.
+
+ Various GCC features are not supported. For example, it does not
+support weak symbols or alias definitions. As a result, explicit
+template instantiations are required when using C++. This makes it
+difficult if not impossible to build many C++ applications.
+
+ There are two default scheduling models for instructions. These are
+PROCESSOR_7100LC and PROCESSOR_8000. They are selected from the pa-risc
+architecture specified for the target machine when configuring.
+PROCESSOR_8000 is the default. PROCESSOR_7100LC is selected when the
+target is a `hppa1*' machine.
+
+ The PROCESSOR_8000 model is not well suited to older processors.
+Thus, it is important to completely specify the machine architecture
+when configuring if you want a model other than PROCESSOR_8000. The
+macro TARGET_SCHED_DEFAULT can be defined in BOOT_CFLAGS if a different
+default scheduling model is desired.
+
+ As of GCC 4.0, GCC uses the UNIX 95 namespace for HP-UX 10.10
+through 11.00, and the UNIX 98 namespace for HP-UX 11.11 and later.
+This namespace change might cause problems when bootstrapping with an
+earlier version of GCC or the HP compiler as essentially the same
+namespace is required for an entire build. This problem can be avoided
+in a number of ways. With HP cc, `UNIX_STD' can be set to `95' or
+`98'. Another way is to add an appropriate set of predefines to `CC'.
+The description for the `munix=' option contains a list of the
+predefines used with each standard.
+
+ More specific information to `hppa*-hp-hpux*' targets follows.
+
+hppa*-hp-hpux10
+===============
+
+For hpux10.20, we _highly_ recommend you pick up the latest sed patch
+`PHCO_19798' from HP. HP has two sites which provide patches free of
+charge:
+
+ * `http://us.itrc.hp.com/service/home/home.do' US, Canada,
+ Asia-Pacific, and Latin-America.
+
+ * `http://europe.itrc.hp.com/service/home/home.do' Europe.
+
+ The C++ ABI has changed incompatibly in GCC 4.0. COMDAT subspaces
+are used for one-only code and data. This resolves many of the previous
+problems in using C++ on this target. However, the ABI is not
+compatible with the one implemented under HP-UX 11 using secondary
+definitions.
+
+hppa*-hp-hpux11
+===============
+
+GCC 3.0 and up support HP-UX 11. GCC 2.95.x is not supported and cannot
+be used to compile GCC 3.0 and up.
+
+ The libffi and libjava libraries haven't been ported to 64-bit HP-UX
+and don't build.
+
+ Refer to binaries for information about obtaining precompiled GCC
+binaries for HP-UX. Precompiled binaries must be obtained to build the
+Ada language as it can't be bootstrapped using C. Ada is only
+available for the 32-bit PA-RISC runtime.
+
+ Starting with GCC 3.4 an ISO C compiler is required to bootstrap.
+The bundled compiler supports only traditional C; you will need either
+HP's unbundled compiler, or a binary distribution of GCC.
+
+ It is possible to build GCC 3.3 starting with the bundled HP
+compiler, but the process requires several steps. GCC 3.3 can then be
+used to build later versions. The fastjar program contains ISO C code
+and can't be built with the HP bundled compiler. This problem can be
+avoided by not building the Java language. For example, use the
+`--enable-languages="c,c++,f77,objc"' option in your configure command.
+
+ There are several possible approaches to building the distribution.
+Binutils can be built first using the HP tools. Then, the GCC
+distribution can be built. The second approach is to build GCC first
+using the HP tools, then build binutils, then rebuild GCC. There have
+been problems with various binary distributions, so it is best not to
+start from a binary distribution.
+
+ On 64-bit capable systems, there are two distinct targets. Different
+installation prefixes must be used if both are to be installed on the
+same system. The `hppa[1-2]*-hp-hpux11*' target generates code for the
+32-bit PA-RISC runtime architecture and uses the HP linker. The
+`hppa64-hp-hpux11*' target generates 64-bit code for the PA-RISC 2.0
+architecture.
+
+ The script config.guess now selects the target type based on the
+compiler detected during configuration. You must define `PATH' or `CC'
+so that configure finds an appropriate compiler for the initial
+bootstrap. When `CC' is used, the definition should contain the
+options that are needed whenever `CC' is used.
+
+ Specifically, options that determine the runtime architecture must be
+in `CC' to correctly select the target for the build. It is also
+convenient to place many other compiler options in `CC'. For example,
+`CC="cc -Ac +DA2.0W -Wp,-H16376 -D_CLASSIC_TYPES -D_HPUX_SOURCE"' can
+be used to bootstrap the GCC 3.3 branch with the HP compiler in 64-bit
+K&R/bundled mode. The `+DA2.0W' option will result in the automatic
+selection of the `hppa64-hp-hpux11*' target. The macro definition
+table of cpp needs to be increased for a successful build with the HP
+compiler. _CLASSIC_TYPES and _HPUX_SOURCE need to be defined when
+building with the bundled compiler, or when using the `-Ac' option.
+These defines aren't necessary with `-Ae'.
+
+ It is best to explicitly configure the `hppa64-hp-hpux11*' target
+with the `--with-ld=...' option. This overrides the standard search
+for ld. The two linkers supported on this target require different
+commands. The default linker is determined during configuration. As a
+result, it's not possible to switch linkers in the middle of a GCC
+build. This has been reported to sometimes occur in unified builds of
+binutils and GCC.
+
+ A recent linker patch must be installed for the correct operation of
+GCC 3.3 and later. `PHSS_26559' and `PHSS_24304' are the oldest linker
+patches that are known to work. They are for HP-UX 11.00 and 11.11,
+respectively. `PHSS_24303', the companion to `PHSS_24304', might be
+usable but it hasn't been tested. These patches have been superseded.
+Consult the HP patch database to obtain the currently recommended
+linker patch for your system.
+
+ The patches are necessary for the support of weak symbols on the
+32-bit port, and for the running of initializers and finalizers. Weak
+symbols are implemented using SOM secondary definition symbols. Prior
+to HP-UX 11, there are bugs in the linker support for secondary symbols.
+The patches correct a problem of linker core dumps creating shared
+libraries containing secondary symbols, as well as various other
+linking issues involving secondary symbols.
+
+ GCC 3.3 uses the ELF DT_INIT_ARRAY and DT_FINI_ARRAY capabilities to
+run initializers and finalizers on the 64-bit port. The 32-bit port
+uses the linker `+init' and `+fini' options for the same purpose. The
+patches correct various problems with the +init/+fini options,
+including program core dumps. Binutils 2.14 corrects a problem on the
+64-bit port resulting from HP's non-standard use of the .init and .fini
+sections for array initializers and finalizers.
+
+ Although the HP and GNU linkers are both supported for the
+`hppa64-hp-hpux11*' target, it is strongly recommended that the HP
+linker be used for link editing on this target.
+
+ At this time, the GNU linker does not support the creation of long
+branch stubs. As a result, it can't successfully link binaries
+containing branch offsets larger than 8 megabytes. In addition, there
+are problems linking shared libraries, linking executables with
+`-static', and with dwarf2 unwind and exception support. It also
+doesn't provide stubs for internal calls to global functions in shared
+libraries, so these calls can't be overloaded.
+
+ The HP dynamic loader does not support GNU symbol versioning, so
+symbol versioning is not supported. It may be necessary to disable
+symbol versioning with `--disable-symvers' when using GNU ld.
+
+ POSIX threads are the default. The optional DCE thread library is
+not supported, so `--enable-threads=dce' does not work.
+
+*-*-linux-gnu
+=============
+
+Versions of libstdc++-v3 starting with 3.2.1 require bug fixes present
+in glibc 2.2.5 and later. More information is available in the
+libstdc++-v3 documentation.
+
+i?86-*-linux*
+=============
+
+As of GCC 3.3, binutils 2.13.1 or later is required for this platform.
+See bug 10877 for more information.
+
+ If you receive Signal 11 errors when building on GNU/Linux, then it
+is possible you have a hardware problem. Further information on this
+can be found on www.bitwizard.nl.
+
+i?86-*-solaris2.10
+==================
+
+Use this for Solaris 10 or later on x86 and x86-64 systems. This
+configuration is supported by GCC 4.0 and later versions only.
+
+ It is recommended that you configure GCC to use the GNU assembler in
+`/usr/sfw/bin/gas' but the Sun linker, using the options `--with-gnu-as
+--with-as=/usr/sfw/bin/gas --without-gnu-ld --with-ld=/usr/ccs/bin/ld'.
+
+ia64-*-linux
+============
+
+IA-64 processor (also known as IPF, or Itanium Processor Family)
+running GNU/Linux.
+
+ If you are using the installed system libunwind library with
+`--with-system-libunwind', then you must use libunwind 0.98 or later.
+
+ None of the following versions of GCC has an ABI that is compatible
+with any of the other versions in this list, with the exception that
+Red Hat 2.96 and Trillian 000171 are compatible with each other: 3.1,
+3.0.2, 3.0.1, 3.0, Red Hat 2.96, and Trillian 000717. This primarily
+affects C++ programs and programs that create shared libraries. GCC
+3.1 or later is recommended for compiling linux, the kernel. As of
+version 3.1 GCC is believed to be fully ABI compliant, and hence no
+more major ABI changes are expected.
+
+ia64-*-hpux*
+============
+
+Building GCC on this target requires the GNU Assembler. The bundled HP
+assembler will not work. To prevent GCC from using the wrong assembler,
+the option `--with-gnu-as' may be necessary.
+
+ The GCC libunwind library has not been ported to HPUX. This means
+that for GCC versions 3.2.3 and earlier, `--enable-libunwind-exceptions'
+is required to build GCC. For GCC 3.3 and later, this is the default.
+For gcc 3.4.3 and later, `--enable-libunwind-exceptions' is removed and
+the system libunwind library will always be used.
+
+*-ibm-aix*
+==========
+
+Support for AIX version 3 and older was discontinued in GCC 3.4.
+
+ "out of memory" bootstrap failures may indicate a problem with
+process resource limits (ulimit). Hard limits are configured in the
+`/etc/security/limits' system configuration file.
+
+ To speed up the configuration phases of bootstrapping and installing
+GCC, one may use GNU Bash instead of AIX `/bin/sh', e.g.,
+
+ % CONFIG_SHELL=/opt/freeware/bin/bash
+ % export CONFIG_SHELL
+
+ and then proceed as described in the build instructions, where we
+strongly recommend specifying an absolute path to invoke
+SRCDIR/configure.
+
+ Because GCC on AIX is built as a 32-bit executable by default,
+(although it can generate 64-bit programs) the GMP and MPFR libraries
+required by gfortran must be 32-bit libraries. Building GMP and MPFR
+as static archive libraries works better than shared libraries.
+
+ Errors involving `alloca' when building GCC generally are due to an
+incorrect definition of `CC' in the Makefile or mixing files compiled
+with the native C compiler and GCC. During the stage1 phase of the
+build, the native AIX compiler *must* be invoked as `cc' (not `xlc').
+Once `configure' has been informed of `xlc', one needs to use `make
+distclean' to remove the configure cache files and ensure that `CC'
+environment variable does not provide a definition that will confuse
+`configure'. If this error occurs during stage2 or later, then the
+problem most likely is the version of Make (see above).
+
+ The native `as' and `ld' are recommended for bootstrapping on AIX 4
+and required for bootstrapping on AIX 5L. The GNU Assembler reports
+that it supports WEAK symbols on AIX 4, which causes GCC to try to
+utilize weak symbol functionality although it is not supported. The GNU
+Assembler and Linker do not support AIX 5L sufficiently to bootstrap
+GCC. The native AIX tools do interoperate with GCC.
+
+ Building `libstdc++.a' requires a fix for an AIX Assembler bug APAR
+IY26685 (AIX 4.3) or APAR IY25528 (AIX 5.1). It also requires a fix
+for another AIX Assembler bug and a co-dependent AIX Archiver fix
+referenced as APAR IY53606 (AIX 5.2) or a APAR IY54774 (AIX 5.1)
+
+ `libstdc++' in GCC 3.4 increments the major version number of the
+shared object and GCC installation places the `libstdc++.a' shared
+library in a common location which will overwrite the and GCC 3.3
+version of the shared library. Applications either need to be
+re-linked against the new shared library or the GCC 3.1 and GCC 3.3
+versions of the `libstdc++' shared object needs to be available to the
+AIX runtime loader. The GCC 3.1 `libstdc++.so.4', if present, and GCC
+3.3 `libstdc++.so.5' shared objects can be installed for runtime
+dynamic loading using the following steps to set the `F_LOADONLY' flag
+in the shared object for _each_ multilib `libstdc++.a' installed:
+
+ Extract the shared objects from the currently installed
+`libstdc++.a' archive:
+ % ar -x libstdc++.a libstdc++.so.4 libstdc++.so.5
+
+ Enable the `F_LOADONLY' flag so that the shared object will be
+available for runtime dynamic loading, but not linking:
+ % strip -e libstdc++.so.4 libstdc++.so.5
+
+ Archive the runtime-only shared object in the GCC 3.4 `libstdc++.a'
+archive:
+ % ar -q libstdc++.a libstdc++.so.4 libstdc++.so.5
+
+ Linking executables and shared libraries may produce warnings of
+duplicate symbols. The assembly files generated by GCC for AIX always
+have included multiple symbol definitions for certain global variable
+and function declarations in the original program. The warnings should
+not prevent the linker from producing a correct library or runnable
+executable.
+
+ AIX 4.3 utilizes a "large format" archive to support both 32-bit and
+64-bit object modules. The routines provided in AIX 4.3.0 and AIX 4.3.1
+to parse archive libraries did not handle the new format correctly.
+These routines are used by GCC and result in error messages during
+linking such as "not a COFF file". The version of the routines shipped
+with AIX 4.3.1 should work for a 32-bit environment. The `-g' option
+of the archive command may be used to create archives of 32-bit objects
+using the original "small format". A correct version of the routines
+is shipped with AIX 4.3.2 and above.
+
+ Some versions of the AIX binder (linker) can fail with a relocation
+overflow severe error when the `-bbigtoc' option is used to link
+GCC-produced object files into an executable that overflows the TOC. A
+fix for APAR IX75823 (OVERFLOW DURING LINK WHEN USING GCC AND -BBIGTOC)
+is available from IBM Customer Support and from its
+techsupport.services.ibm.com website as PTF U455193.
+
+ The AIX 4.3.2.1 linker (bos.rte.bind_cmds Level 4.3.2.1) will dump
+core with a segmentation fault when invoked by any version of GCC. A
+fix for APAR IX87327 is available from IBM Customer Support and from its
+techsupport.services.ibm.com website as PTF U461879. This fix is
+incorporated in AIX 4.3.3 and above.
+
+ The initial assembler shipped with AIX 4.3.0 generates incorrect
+object files. A fix for APAR IX74254 (64BIT DISASSEMBLED OUTPUT FROM
+COMPILER FAILS TO ASSEMBLE/BIND) is available from IBM Customer Support
+and from its techsupport.services.ibm.com website as PTF U453956. This
+fix is incorporated in AIX 4.3.1 and above.
+
+ AIX provides National Language Support (NLS). Compilers and
+assemblers use NLS to support locale-specific representations of
+various data formats including floating-point numbers (e.g., `.' vs
+`,' for separating decimal fractions). There have been problems
+reported where GCC does not produce the same floating-point formats
+that the assembler expects. If one encounters this problem, set the
+`LANG' environment variable to `C' or `En_US'.
+
+ By default, GCC for AIX 4.1 and above produces code that can be used
+on both Power or PowerPC processors.
+
+ A default can be specified with the `-mcpu=CPU_TYPE' switch and
+using the configure option `--with-cpu-CPU_TYPE'.
+
+iq2000-*-elf
+============
+
+Vitesse IQ2000 processors. These are used in embedded applications.
+There are no standard Unix configurations.
+
+m32c-*-elf
+==========
+
+Renesas M32C processor. This configuration is intended for embedded
+systems.
+
+m32r-*-elf
+==========
+
+Renesas M32R processor. This configuration is intended for embedded
+systems.
+
+m6811-elf
+=========
+
+Motorola 68HC11 family micro controllers. These are used in embedded
+applications. There are no standard Unix configurations.
+
+m6812-elf
+=========
+
+Motorola 68HC12 family micro controllers. These are used in embedded
+applications. There are no standard Unix configurations.
+
+m68k-*-*
+========
+
+By default, `m68k-*-aout', `m68k-*-coff*', `m68k-*-elf*',
+`m68k-*-rtems', `m68k-*-uclinux' and `m68k-*-linux' build libraries
+for both M680x0 and ColdFire processors. If you only need the M680x0
+libraries, you can omit the ColdFire ones by passing `--with-arch=m68k'
+to `configure'. Alternatively, you can omit the M680x0 libraries by
+passing `--with-arch=cf' to `configure'. These targets default to 5206
+or 5475 code as appropriate for the target system when configured with
+`--with-arch=cf' and 68020 code otherwise.
+
+ The `m68k-*-netbsd' and `m68k-*-openbsd' targets also support the
+`--with-arch' option. They will generate ColdFire CFV4e code when
+configured with `--with-arch=cf' and 68020 code otherwise.
+
+ You can override the default processors listed above by configuring
+with `--with-cpu=TARGET'. This TARGET can either be a `-mcpu' argument
+or one of the following values: `m68000', `m68010', `m68020', `m68030',
+`m68040', `m68060', `m68020-40' and `m68020-60'.
+
+m68k-*-uclinux
+==============
+
+GCC 4.3 changed the uClinux configuration so that it uses the
+`m68k-linux-gnu' ABI rather than the `m68k-elf' ABI. It also added
+improved support for C++ and flat shared libraries, both of which were
+ABI changes. However, you can still use the original ABI by
+configuring for `m68k-uclinuxoldabi' or `m68k-VENDOR-uclinuxoldabi'.
+
+mips-*-*
+========
+
+If on a MIPS system you get an error message saying "does not have gp
+sections for all it's [sic] sectons [sic]", don't worry about it. This
+happens whenever you use GAS with the MIPS linker, but there is not
+really anything wrong, and it is okay to use the output file. You can
+stop such warnings by installing the GNU linker.
+
+ It would be nice to extend GAS to produce the gp tables, but they are
+optional, and there should not be a warning about their absence.
+
+ The libstdc++ atomic locking routines for MIPS targets requires MIPS
+II and later. A patch went in just after the GCC 3.3 release to make
+`mips*-*-*' use the generic implementation instead. You can also
+configure for `mipsel-elf' as a workaround. The `mips*-*-linux*'
+target continues to use the MIPS II routines. More work on this is
+expected in future releases.
+
+ The built-in `__sync_*' functions are available on MIPS II and later
+systems and others that support the `ll', `sc' and `sync' instructions.
+This can be overridden by passing `--with-llsc' or `--without-llsc'
+when configuring GCC. Since the Linux kernel emulates these
+instructions if they are missing, the default for `mips*-*-linux*'
+targets is `--with-llsc'. The `--with-llsc' and `--without-llsc'
+configure options may be overridden at compile time by passing the
+`-mllsc' or `-mno-llsc' options to the compiler.
+
+ MIPS systems check for division by zero (unless
+`-mno-check-zero-division' is passed to the compiler) by generating
+either a conditional trap or a break instruction. Using trap results
+in smaller code, but is only supported on MIPS II and later. Also,
+some versions of the Linux kernel have a bug that prevents trap from
+generating the proper signal (`SIGFPE'). To enable the use of break,
+use the `--with-divide=breaks' `configure' option when configuring GCC.
+The default is to use traps on systems that support them.
+
+ Cross-compilers for the MIPS as target using the MIPS assembler
+currently do not work, because the auxiliary programs `mips-tdump.c'
+and `mips-tfile.c' can't be compiled on anything but a MIPS. It does
+work to cross compile for a MIPS if you use the GNU assembler and
+linker.
+
+ The assembler from GNU binutils 2.17 and earlier has a bug in the way
+it sorts relocations for REL targets (o32, o64, EABI). This can cause
+bad code to be generated for simple C++ programs. Also the linker from
+GNU binutils versions prior to 2.17 has a bug which causes the runtime
+linker stubs in very large programs, like `libgcj.so', to be
+incorrectly generated. GNU Binutils 2.18 and later (and snapshots made
+after Nov. 9, 2006) should be free from both of these problems.
+
+mips-sgi-irix5
+==============
+
+In order to compile GCC on an SGI running IRIX 5, the `compiler_dev.hdr'
+subsystem must be installed from the IDO CD-ROM supplied by SGI. It is
+also available for download from
+`ftp://ftp.sgi.com/sgi/IRIX5.3/iris-development-option-5.3.tardist'.
+
+ If you use the MIPS C compiler to bootstrap, it may be necessary to
+increase its table size for switch statements with the `-Wf,-XNg1500'
+option. If you use the `-O2' optimization option, you also need to use
+`-Olimit 3000'.
+
+ To enable debugging under IRIX 5, you must use GNU binutils 2.15 or
+later, and use the `--with-gnu-ld' `configure' option when configuring
+GCC. You need to use GNU `ar' and `nm', also distributed with GNU
+binutils.
+
+ Some users have reported that `/bin/sh' will hang during bootstrap.
+This problem can be avoided by running the commands:
+
+ % CONFIG_SHELL=/bin/ksh
+ % export CONFIG_SHELL
+
+ before starting the build.
+
+mips-sgi-irix6
+==============
+
+If you are using SGI's MIPSpro `cc' as your bootstrap compiler, you must
+ensure that the N32 ABI is in use. To test this, compile a simple C
+file with `cc' and then run `file' on the resulting object file. The
+output should look like:
+
+ test.o: ELF N32 MSB ...
+
+ If you see:
+
+ test.o: ELF 32-bit MSB ...
+
+ or
+
+ test.o: ELF 64-bit MSB ...
+
+ then your version of `cc' uses the O32 or N64 ABI by default. You
+should set the environment variable `CC' to `cc -n32' before
+configuring GCC.
+
+ If you want the resulting `gcc' to run on old 32-bit systems with
+the MIPS R4400 CPU, you need to ensure that only code for the `mips3'
+instruction set architecture (ISA) is generated. While GCC 3.x does
+this correctly, both GCC 2.95 and SGI's MIPSpro `cc' may change the ISA
+depending on the machine where GCC is built. Using one of them as the
+bootstrap compiler may result in `mips4' code, which won't run at all
+on `mips3'-only systems. For the test program above, you should see:
+
+ test.o: ELF N32 MSB mips-3 ...
+
+ If you get:
+
+ test.o: ELF N32 MSB mips-4 ...
+
+ instead, you should set the environment variable `CC' to `cc -n32
+-mips3' or `gcc -mips3' respectively before configuring GCC.
+
+ MIPSpro C 7.4 may cause bootstrap failures, due to a bug when
+inlining `memcmp'. Either add `-U__INLINE_INTRINSICS' to the `CC'
+environment variable as a workaround or upgrade to MIPSpro C 7.4.1m.
+
+ GCC on IRIX 6 is usually built to support the N32, O32 and N64 ABIs.
+If you build GCC on a system that doesn't have the N64 libraries
+installed or cannot run 64-bit binaries, you need to configure with
+`--disable-multilib' so GCC doesn't try to use them. This will disable
+building the O32 libraries, too. Look for `/usr/lib64/libc.so.1' to
+see if you have the 64-bit libraries installed.
+
+ To enable debugging for the O32 ABI, you must use GNU `as' from GNU
+binutils 2.15 or later. You may also use GNU `ld', but this is not
+required and currently causes some problems with Ada.
+
+ The `--enable-libgcj' option is disabled by default: IRIX 6 uses a
+very low default limit (20480) for the command line length. Although
+`libtool' contains a workaround for this problem, at least the N64
+`libgcj' is known not to build despite this, running into an internal
+error of the native `ld'. A sure fix is to increase this limit
+(`ncargs') to its maximum of 262144 bytes. If you have root access,
+you can use the `systune' command to do this.
+
+ `wchar_t' support in `libstdc++' is not available for old IRIX 6.5.x
+releases, x < 19. The problem cannot be autodetected and in order to
+build GCC for such targets you need to configure with
+`--disable-wchar_t'.
+
+ See `http://freeware.sgi.com/' for more information about using GCC
+on IRIX platforms.
+
+powerpc-*-*
+===========
+
+You can specify a default version for the `-mcpu=CPU_TYPE' switch by
+using the configure option `--with-cpu-CPU_TYPE'.
+
+ You will need binutils 2.15 or newer for a working GCC.
+
+powerpc-*-darwin*
+=================
+
+PowerPC running Darwin (Mac OS X kernel).
+
+ Pre-installed versions of Mac OS X may not include any developer
+tools, meaning that you will not be able to build GCC from source. Tool
+binaries are available at
+`http://developer.apple.com/darwin/projects/compiler/' (free
+registration required).
+
+ This version of GCC requires at least cctools-590.36. The
+cctools-590.36 package referenced from
+`http://gcc.gnu.org/ml/gcc/2006-03/msg00507.html' will not work on
+systems older than 10.3.9 (aka darwin7.9.0).
+
+powerpc-*-elf
+=============
+
+PowerPC system in big endian mode, running System V.4.
+
+powerpc*-*-linux-gnu*
+=====================
+
+PowerPC system in big endian mode running Linux.
+
+powerpc-*-netbsd*
+=================
+
+PowerPC system in big endian mode running NetBSD.
+
+powerpc-*-eabisim
+=================
+
+Embedded PowerPC system in big endian mode for use in running under the
+PSIM simulator.
+
+powerpc-*-eabi
+==============
+
+Embedded PowerPC system in big endian mode.
+
+powerpcle-*-elf
+===============
+
+PowerPC system in little endian mode, running System V.4.
+
+powerpcle-*-eabisim
+===================
+
+Embedded PowerPC system in little endian mode for use in running under
+the PSIM simulator.
+
+powerpcle-*-eabi
+================
+
+Embedded PowerPC system in little endian mode.
+
+s390-*-linux*
+=============
+
+S/390 system running GNU/Linux for S/390.
+
+s390x-*-linux*
+==============
+
+zSeries system (64-bit) running GNU/Linux for zSeries.
+
+s390x-ibm-tpf*
+==============
+
+zSeries system (64-bit) running TPF. This platform is supported as
+cross-compilation target only.
+
+*-*-solaris2*
+=============
+
+Sun does not ship a C compiler with Solaris 2. To bootstrap and install
+GCC you first have to install a pre-built compiler, see the binaries
+page for details.
+
+ The Solaris 2 `/bin/sh' will often fail to configure `libstdc++-v3',
+`boehm-gc' or `libjava'. We therefore recommend using the following
+initial sequence of commands
+
+ % CONFIG_SHELL=/bin/ksh
+ % export CONFIG_SHELL
+
+ and proceed as described in the configure instructions. In addition
+we strongly recommend specifying an absolute path to invoke
+SRCDIR/configure.
+
+ Solaris 2 comes with a number of optional OS packages. Some of these
+are needed to use GCC fully, namely `SUNWarc', `SUNWbtool', `SUNWesu',
+`SUNWhea', `SUNWlibm', `SUNWsprot', and `SUNWtoo'. If you did not
+install all optional packages when installing Solaris 2, you will need
+to verify that the packages that GCC needs are installed.
+
+ To check whether an optional package is installed, use the `pkginfo'
+command. To add an optional package, use the `pkgadd' command. For
+further details, see the Solaris 2 documentation.
+
+ Trying to use the linker and other tools in `/usr/ucb' to install
+GCC has been observed to cause trouble. For example, the linker may
+hang indefinitely. The fix is to remove `/usr/ucb' from your `PATH'.
+
+ The build process works more smoothly with the legacy Sun tools so,
+if you have `/usr/xpg4/bin' in your `PATH', we recommend that you place
+`/usr/bin' before `/usr/xpg4/bin' for the duration of the build.
+
+ We recommend the use of GNU binutils 2.14 or later, or the vendor
+tools (Sun `as', Sun `ld'). Note that your mileage may vary if you use
+a combination of the GNU tools and the Sun tools: while the combination
+GNU `as' + Sun `ld' should reasonably work, the reverse combination Sun
+`as' + GNU `ld' is known to cause memory corruption at runtime in some
+cases for C++ programs.
+
+ The stock GNU binutils 2.15 release is broken on this platform
+because of a single bug. It has been fixed on the 2.15 branch in the
+CVS repository. You can obtain a working version by checking out the
+binutils-2_15-branch from the CVS repository or applying the patch
+`http://sourceware.org/ml/binutils-cvs/2004-09/msg00036.html' to the
+release.
+
+ We recommend the use of GNU binutils 2.16 or later in conjunction
+with GCC 4.x, or the vendor tools (Sun `as', Sun `ld'). However, for
+Solaris 10 and above, an additional patch is required in order for the
+GNU linker to be able to cope with a new flavor of shared libraries.
+You can obtain a working version by checking out the
+binutils-2_16-branch from the CVS repository or applying the patch
+`http://sourceware.org/ml/binutils-cvs/2005-07/msg00122.html' to the
+release.
+
+ Sun bug 4296832 turns up when compiling X11 headers with GCC 2.95 or
+newer: `g++' will complain that types are missing. These headers
+assume that omitting the type means `int'; this assumption worked for
+C89 but is wrong for C++, and is now wrong for C99 also.
+
+ `g++' accepts such (invalid) constructs with the option
+`-fpermissive'; it will assume that any missing type is `int' (as
+defined by C89).
+
+ There are patches for Solaris 7 (108376-21 or newer for SPARC,
+108377-20 for Intel), and Solaris 8 (108652-24 or newer for SPARC,
+108653-22 for Intel) that fix this bug.
+
+ Sun bug 4927647 sometimes causes random spurious testsuite failures
+related to missing diagnostic output. This bug doesn't affect GCC
+itself, rather it is a kernel bug triggered by the `expect' program
+which is used only by the GCC testsuite driver. When the bug causes
+the `expect' program to miss anticipated output, extra testsuite
+failures appear.
+
+ There are patches for Solaris 8 (117350-12 or newer for SPARC,
+117351-12 or newer for Intel) and Solaris 9 (117171-11 or newer for
+SPARC, 117172-11 or newer for Intel) that address this problem.
+
+sparc-sun-solaris2*
+===================
+
+When GCC is configured to use binutils 2.14 or later the binaries
+produced are smaller than the ones produced using Sun's native tools;
+this difference is quite significant for binaries containing debugging
+information.
+
+ Starting with Solaris 7, the operating system is capable of executing
+64-bit SPARC V9 binaries. GCC 3.1 and later properly supports this;
+the `-m64' option enables 64-bit code generation. However, if all you
+want is code tuned for the UltraSPARC CPU, you should try the
+`-mtune=ultrasparc' option instead, which produces code that, unlike
+full 64-bit code, can still run on non-UltraSPARC machines.
+
+ When configuring on a Solaris 7 or later system that is running a
+kernel that supports only 32-bit binaries, one must configure with
+`--disable-multilib', since we will not be able to build the 64-bit
+target libraries.
+
+ GCC 3.3 and GCC 3.4 trigger code generation bugs in earlier versions
+of the GNU compiler (especially GCC 3.0.x versions), which lead to the
+miscompilation of the stage1 compiler and the subsequent failure of the
+bootstrap process. A workaround is to use GCC 3.2.3 as an intermediary
+stage, i.e. to bootstrap that compiler with the base compiler and then
+use it to bootstrap the final compiler.
+
+ GCC 3.4 triggers a code generation bug in versions 5.4 (Sun ONE
+Studio 7) and 5.5 (Sun ONE Studio 8) of the Sun compiler, which causes
+a bootstrap failure in form of a miscompilation of the stage1 compiler
+by the Sun compiler. This is Sun bug 4974440. This is fixed with
+patch 112760-07.
+
+ GCC 3.4 changed the default debugging format from STABS to DWARF-2
+for 32-bit code on Solaris 7 and later. If you use the Sun assembler,
+this change apparently runs afoul of Sun bug 4910101 (which is
+referenced as a x86-only problem by Sun, probably because they do not
+use DWARF-2). A symptom of the problem is that you cannot compile C++
+programs like `groff' 1.19.1 without getting messages similar to the
+following:
+
+ ld: warning: relocation error: R_SPARC_UA32: ...
+ external symbolic relocation against non-allocatable section
+ .debug_info cannot be processed at runtime: relocation ignored.
+
+ To work around this problem, compile with `-gstabs+' instead of
+plain `-g'.
+
+ When configuring the GNU Multiple Precision Library (GMP) or the MPFR
+library on a Solaris 7 or later system, the canonical target triplet
+must be specified as the `build' parameter on the configure line. This
+triplet can be obtained by invoking ./config.guess in the toplevel
+source directory of GCC (and not that of GMP or MPFR). For example on
+a Solaris 7 system:
+
+ % ./configure --build=sparc-sun-solaris2.7 --prefix=xxx
+
+sparc-sun-solaris2.7
+====================
+
+Sun patch 107058-01 (1999-01-13) for Solaris 7/SPARC triggers a bug in
+the dynamic linker. This problem (Sun bug 4210064) affects GCC 2.8 and
+later, including all EGCS releases. Sun formerly recommended 107058-01
+for all Solaris 7 users, but around 1999-09-01 it started to recommend
+it only for people who use Sun's compilers.
+
+ Here are some workarounds to this problem:
+ * Do not install Sun patch 107058-01 until after Sun releases a
+ complete patch for bug 4210064. This is the simplest course to
+ take, unless you must also use Sun's C compiler. Unfortunately
+ 107058-01 is preinstalled on some new Solaris 7-based hosts, so
+ you may have to back it out.
+
+ * Copy the original, unpatched Solaris 7 `/usr/ccs/bin/as' into
+ `/usr/local/libexec/gcc/sparc-sun-solaris2.7/3.4/as', adjusting
+ the latter name to fit your local conventions and software version
+ numbers.
+
+ * Install Sun patch 106950-03 (1999-05-25) or later. Nobody with
+ both 107058-01 and 106950-03 installed has reported the bug with
+ GCC and Sun's dynamic linker. This last course of action is
+ riskiest, for two reasons. First, you must install 106950 on all
+ hosts that run code generated by GCC; it doesn't suffice to
+ install it only on the hosts that run GCC itself. Second, Sun
+ says that 106950-03 is only a partial fix for bug 4210064, but Sun
+ doesn't know whether the partial fix is adequate for GCC.
+ Revision -08 or later should fix the bug. The current (as of
+ 2004-05-23) revision is -24, and is included in the Solaris 7
+ Recommended Patch Cluster.
+
+ GCC 3.3 triggers a bug in version 5.0 Alpha 03/27/98 of the Sun
+assembler, which causes a bootstrap failure when linking the 64-bit
+shared version of libgcc. A typical error message is:
+
+ ld: fatal: relocation error: R_SPARC_32: file libgcc/sparcv9/_muldi3.o:
+ symbol <unknown>: offset 0xffffffff7ec133e7 is non-aligned.
+
+ This bug has been fixed in the final 5.0 version of the assembler.
+
+ A similar problem was reported for version Sun WorkShop 6 99/08/18
+of the Sun assembler, which causes a bootstrap failure with GCC 4.0.0:
+
+ ld: fatal: relocation error: R_SPARC_DISP32:
+ file .libs/libstdc++.lax/libsupc++convenience.a/vterminate.o:
+ symbol <unknown>: offset 0xfccd33ad is non-aligned
+
+ This bug has been fixed in more recent revisions of the assembler.
+
+sparc-*-linux*
+==============
+
+GCC versions 3.0 and higher require binutils 2.11.2 and glibc 2.2.4 or
+newer on this platform. All earlier binutils and glibc releases
+mishandled unaligned relocations on `sparc-*-*' targets.
+
+sparc64-*-solaris2*
+===================
+
+When configuring the GNU Multiple Precision Library (GMP) or the MPFR
+library, the canonical target triplet must be specified as the `build'
+parameter on the configure line. For example on a Solaris 7 system:
+
+ % ./configure --build=sparc64-sun-solaris2.7 --prefix=xxx
+
+ The following compiler flags must be specified in the configure step
+in order to bootstrap this target with the Sun compiler:
+
+ % CC="cc -xarch=v9 -xildoff" SRCDIR/configure [OPTIONS] [TARGET]
+
+ `-xarch=v9' specifies the SPARC-V9 architecture to the Sun toolchain
+and `-xildoff' turns off the incremental linker.
+
+sparcv9-*-solaris2*
+===================
+
+This is a synonym for sparc64-*-solaris2*.
+
+*-*-vxworks*
+============
+
+Support for VxWorks is in flux. At present GCC supports _only_ the
+very recent VxWorks 5.5 (aka Tornado 2.2) release, and only on PowerPC.
+We welcome patches for other architectures supported by VxWorks 5.5.
+Support for VxWorks AE would also be welcome; we believe this is merely
+a matter of writing an appropriate "configlette" (see below). We are
+not interested in supporting older, a.out or COFF-based, versions of
+VxWorks in GCC 3.
+
+ VxWorks comes with an older version of GCC installed in
+`$WIND_BASE/host'; we recommend you do not overwrite it. Choose an
+installation PREFIX entirely outside $WIND_BASE. Before running
+`configure', create the directories `PREFIX' and `PREFIX/bin'. Link or
+copy the appropriate assembler, linker, etc. into `PREFIX/bin', and set
+your PATH to include that directory while running both `configure' and
+`make'.
+
+ You must give `configure' the `--with-headers=$WIND_BASE/target/h'
+switch so that it can find the VxWorks system headers. Since VxWorks
+is a cross compilation target only, you must also specify
+`--target=TARGET'. `configure' will attempt to create the directory
+`PREFIX/TARGET/sys-include' and copy files into it; make sure the user
+running `configure' has sufficient privilege to do so.
+
+ GCC's exception handling runtime requires a special "configlette"
+module, `contrib/gthr_supp_vxw_5x.c'. Follow the instructions in that
+file to add the module to your kernel build. (Future versions of
+VxWorks will incorporate this module.)
+
+x86_64-*-*, amd64-*-*
+=====================
+
+GCC supports the x86-64 architecture implemented by the AMD64 processor
+(amd64-*-* is an alias for x86_64-*-*) on GNU/Linux, FreeBSD and NetBSD.
+On GNU/Linux the default is a bi-arch compiler which is able to generate
+both 64-bit x86-64 and 32-bit x86 code (via the `-m32' switch).
+
+xtensa*-*-elf
+=============
+
+This target is intended for embedded Xtensa systems using the `newlib'
+C library. It uses ELF but does not support shared objects.
+Designed-defined instructions specified via the Tensilica Instruction
+Extension (TIE) language are only supported through inline assembly.
+
+ The Xtensa configuration information must be specified prior to
+building GCC. The `include/xtensa-config.h' header file contains the
+configuration information. If you created your own Xtensa
+configuration with the Xtensa Processor Generator, the downloaded files
+include a customized copy of this header file, which you can use to
+replace the default header file.
+
+xtensa*-*-linux*
+================
+
+This target is for Xtensa systems running GNU/Linux. It supports ELF
+shared objects and the GNU C library (glibc). It also generates
+position-independent code (PIC) regardless of whether the `-fpic' or
+`-fPIC' options are used. In other respects, this target is the same
+as the `xtensa*-*-elf' target.
+
+Microsoft Windows
+=================
+
+Intel 16-bit versions
+---------------------
+
+The 16-bit versions of Microsoft Windows, such as Windows 3.1, are not
+supported.
+
+ However, the 32-bit port has limited support for Microsoft Windows
+3.11 in the Win32s environment, as a target only. See below.
+
+Intel 32-bit versions
+---------------------
+
+The 32-bit versions of Windows, including Windows 95, Windows NT,
+Windows XP, and Windows Vista, are supported by several different target
+platforms. These targets differ in which Windows subsystem they target
+and which C libraries are used.
+
+ * Cygwin *-*-cygwin: Cygwin provides a user-space Linux API
+ emulation layer in the Win32 subsystem.
+
+ * Interix *-*-interix: The Interix subsystem provides native support
+ for POSIX.
+
+ * MinGW *-*-mingw: MinGW is a native GCC port for the Win32
+ subsystem that provides a subset of POSIX.
+
+ * MKS i386-pc-mks: NuTCracker from MKS. See
+ `http://www.mkssoftware.com/' for more information.
+
+Intel 64-bit versions
+---------------------
+
+GCC contains support for x86-64 using the mingw-w64 runtime library,
+available from `http://mingw-w64.sourceforge.net/'. This library
+should be used with the target triple x86_64-pc-mingw32.
+
+ Presently Windows for Itanium is not supported.
+
+Windows CE
+----------
+
+Windows CE is supported as a target only on ARM (arm-wince-pe), Hitachi
+SuperH (sh-wince-pe), and MIPS (mips-wince-pe).
+
+Other Windows Platforms
+-----------------------
+
+GCC no longer supports Windows NT on the Alpha or PowerPC.
+
+ GCC no longer supports the Windows POSIX subsystem. However, it does
+support the Interix subsystem. See above.
+
+ Old target names including *-*-winnt and *-*-windowsnt are no longer
+used.
+
+ PW32 (i386-pc-pw32) support was never completed, and the project
+seems to be inactive. See `http://pw32.sourceforge.net/' for more
+information.
+
+ UWIN support has been removed due to a lack of maintenance.
+
+*-*-cygwin
+==========
+
+Ports of GCC are included with the Cygwin environment.
+
+ GCC will build under Cygwin without modification; it does not build
+with Microsoft's C++ compiler and there are no plans to make it do so.
+
+ Cygwin can be compiled with i?86-pc-cygwin.
+
+*-*-interix
+===========
+
+The Interix target is used by OpenNT, Interix, Services For UNIX (SFU),
+and Subsystem for UNIX-based Applications (SUA). Applications compiled
+with this target run in the Interix subsystem, which is separate from
+the Win32 subsystem. This target was last known to work in GCC 3.3.
+
+ For more information, see `http://www.interix.com/'.
+
+*-*-mingw32
+===========
+
+GCC will build with and support only MinGW runtime 3.12 and later.
+Earlier versions of headers are incompatible with the new default
+semantics of `extern inline' in `-std=c99' and `-std=gnu99' modes.
+
+OS/2
+====
+
+GCC does not currently support OS/2. However, Andrew Zabolotny has been
+working on a generic OS/2 port with pgcc. The current code can be found
+at http://www.goof.com/pcg/os2/.
+
+Older systems
+=============
+
+GCC contains support files for many older (1980s and early 1990s) Unix
+variants. For the most part, support for these systems has not been
+deliberately removed, but it has not been maintained for several years
+and may suffer from bitrot.
+
+ Starting with GCC 3.1, each release has a list of "obsoleted"
+systems. Support for these systems is still present in that release,
+but `configure' will fail unless the `--enable-obsolete' option is
+given. Unless a maintainer steps forward, support for these systems
+will be removed from the next release of GCC.
+
+ Support for old systems as hosts for GCC can cause problems if the
+workarounds for compiler, library and operating system bugs affect the
+cleanliness or maintainability of the rest of GCC. In some cases, to
+bring GCC up on such a system, if still possible with current GCC, may
+require first installing an old version of GCC which did work on that
+system, and using it to compile a more recent GCC, to avoid bugs in the
+vendor compiler. Old releases of GCC 1 and GCC 2 are available in the
+`old-releases' directory on the GCC mirror sites. Header bugs may
+generally be avoided using `fixincludes', but bugs or deficiencies in
+libraries and the operating system may still cause problems.
+
+ Support for older systems as targets for cross-compilation is less
+problematic than support for them as hosts for GCC; if an enthusiast
+wishes to make such a target work again (including resurrecting any of
+the targets that never worked with GCC 2, starting from the last
+version before they were removed), patches following the usual
+requirements would be likely to be accepted, since they should not
+affect the support for more modern targets.
+
+ For some systems, old versions of GNU binutils may also be useful,
+and are available from `pub/binutils/old-releases' on sourceware.org
+mirror sites.
+
+ Some of the information on specific systems above relates to such
+older systems, but much of the information about GCC on such systems
+(which may no longer be applicable to current GCC) is to be found in
+the GCC texinfo manual.
+
+all ELF targets (SVR4, Solaris 2, etc.)
+=======================================
+
+C++ support is significantly better on ELF targets if you use the GNU
+linker; duplicate copies of inlines, vtables and template
+instantiations will be discarded automatically.
+
+
+File: gccinstall.info, Node: Old, Next: GNU Free Documentation License, Prev: Specific, Up: Top
+
+10 Old installation documentation
+*********************************
+
+ Note most of this information is out of date and superseded by the
+previous chapters of this manual. It is provided for historical
+reference only, because of a lack of volunteers to merge it into the
+main manual.
+
+* Menu:
+
+* Configurations:: Configurations Supported by GCC.
+
+ Here is the procedure for installing GCC on a GNU or Unix system.
+
+ 1. If you have chosen a configuration for GCC which requires other GNU
+ tools (such as GAS or the GNU linker) instead of the standard
+ system tools, install the required tools in the build directory
+ under the names `as', `ld' or whatever is appropriate.
+
+ Alternatively, you can do subsequent compilation using a value of
+ the `PATH' environment variable such that the necessary GNU tools
+ come before the standard system tools.
+
+ 2. Specify the host, build and target machine configurations. You do
+ this when you run the `configure' script.
+
+ The "build" machine is the system which you are using, the "host"
+ machine is the system where you want to run the resulting compiler
+ (normally the build machine), and the "target" machine is the
+ system for which you want the compiler to generate code.
+
+ If you are building a compiler to produce code for the machine it
+ runs on (a native compiler), you normally do not need to specify
+ any operands to `configure'; it will try to guess the type of
+ machine you are on and use that as the build, host and target
+ machines. So you don't need to specify a configuration when
+ building a native compiler unless `configure' cannot figure out
+ what your configuration is or guesses wrong.
+
+ In those cases, specify the build machine's "configuration name"
+ with the `--host' option; the host and target will default to be
+ the same as the host machine.
+
+ Here is an example:
+
+ ./configure --host=sparc-sun-sunos4.1
+
+ A configuration name may be canonical or it may be more or less
+ abbreviated.
+
+ A canonical configuration name has three parts, separated by
+ dashes. It looks like this: `CPU-COMPANY-SYSTEM'. (The three
+ parts may themselves contain dashes; `configure' can figure out
+ which dashes serve which purpose.) For example,
+ `m68k-sun-sunos4.1' specifies a Sun 3.
+
+ You can also replace parts of the configuration by nicknames or
+ aliases. For example, `sun3' stands for `m68k-sun', so
+ `sun3-sunos4.1' is another way to specify a Sun 3.
+
+ You can specify a version number after any of the system types,
+ and some of the CPU types. In most cases, the version is
+ irrelevant, and will be ignored. So you might as well specify the
+ version if you know it.
+
+ See *Note Configurations::, for a list of supported configuration
+ names and notes on many of the configurations. You should check
+ the notes in that section before proceeding any further with the
+ installation of GCC.
+
+
+
+File: gccinstall.info, Node: Configurations, Up: Old
+
+10.1 Configurations Supported by GCC
+====================================
+
+ Here are the possible CPU types:
+
+ 1750a, a29k, alpha, arm, avr, cN, clipper, dsp16xx, elxsi, fr30,
+ h8300, hppa1.0, hppa1.1, i370, i386, i486, i586, i686, i786, i860,
+ i960, ip2k, m32r, m68000, m68k, m6811, m6812, m88k, mcore, mips,
+ mipsel, mips64, mips64el, mn10200, mn10300, ns32k, pdp11, powerpc,
+ powerpcle, romp, rs6000, sh, sparc, sparclite, sparc64, v850, vax,
+ we32k.
+
+ Here are the recognized company names. As you can see, customary
+abbreviations are used rather than the longer official names.
+
+ acorn, alliant, altos, apollo, apple, att, bull, cbm, convergent,
+ convex, crds, dec, dg, dolphin, elxsi, encore, harris, hitachi,
+ hp, ibm, intergraph, isi, mips, motorola, ncr, next, ns, omron,
+ plexus, sequent, sgi, sony, sun, tti, unicom, wrs.
+
+ The company name is meaningful only to disambiguate when the rest of
+the information supplied is insufficient. You can omit it, writing
+just `CPU-SYSTEM', if it is not needed. For example, `vax-ultrix4.2'
+is equivalent to `vax-dec-ultrix4.2'.
+
+ Here is a list of system types:
+
+ 386bsd, aix, acis, amigaos, aos, aout, aux, bosx, bsd, clix, coff,
+ ctix, cxux, dgux, dynix, ebmon, ecoff, elf, esix, freebsd, hms,
+ genix, gnu, linux, linux-gnu, hiux, hpux, iris, irix, isc, luna,
+ lynxos, mach, minix, msdos, mvs, netbsd, newsos, nindy, ns, osf,
+ osfrose, ptx, riscix, riscos, rtu, sco, sim, solaris, sunos, sym,
+ sysv, udi, ultrix, unicos, uniplus, unos, vms, vsta, vxworks,
+ winnt, xenix.
+
+You can omit the system type; then `configure' guesses the operating
+system from the CPU and company.
+
+ You can add a version number to the system type; this may or may not
+make a difference. For example, you can write `bsd4.3' or `bsd4.4' to
+distinguish versions of BSD. In practice, the version number is most
+needed for `sysv3' and `sysv4', which are often treated differently.
+
+ `linux-gnu' is the canonical name for the GNU/Linux target; however
+GCC will also accept `linux'. The version of the kernel in use is not
+relevant on these systems. A suffix such as `libc1' or `aout'
+distinguishes major versions of the C library; all of the suffixed
+versions are obsolete.
+
+ If you specify an impossible combination such as `i860-dg-vms', then
+you may get an error message from `configure', or it may ignore part of
+the information and do the best it can with the rest. `configure'
+always prints the canonical name for the alternative that it used. GCC
+does not support all possible alternatives.
+
+ Often a particular model of machine has a name. Many machine names
+are recognized as aliases for CPU/company combinations. Thus, the
+machine name `sun3', mentioned above, is an alias for `m68k-sun'.
+Sometimes we accept a company name as a machine name, when the name is
+popularly used for a particular machine. Here is a table of the known
+machine names:
+
+ 3300, 3b1, 3bN, 7300, altos3068, altos, apollo68, att-7300,
+ balance, convex-cN, crds, decstation-3100, decstation, delta,
+ encore, fx2800, gmicro, hp7NN, hp8NN, hp9k2NN, hp9k3NN, hp9k7NN,
+ hp9k8NN, iris4d, iris, isi68, m3230, magnum, merlin, miniframe,
+ mmax, news-3600, news800, news, next, pbd, pc532, pmax, powerpc,
+ powerpcle, ps2, risc-news, rtpc, sun2, sun386i, sun386, sun3,
+ sun4, symmetry, tower-32, tower.
+
+Remember that a machine name specifies both the cpu type and the company
+name. If you want to install your own homemade configuration files,
+you can use `local' as the company name to access them. If you use
+configuration `CPU-local', the configuration name without the cpu prefix
+is used to form the configuration file names.
+
+ Thus, if you specify `m68k-local', configuration uses files
+`m68k.md', `local.h', `m68k.c', `xm-local.h', `t-local', and `x-local',
+all in the directory `config/m68k'.
+
+
+File: gccinstall.info, Node: GNU Free Documentation License, Next: Concept Index, Prev: Old, Up: Top
+
+GNU Free Documentation License
+******************************
+
+ Version 1.2, November 2002
+
+ Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ 0. PREAMBLE
+
+ The purpose of this License is to make a manual, textbook, or other
+ functional and useful document "free" in the sense of freedom: to
+ assure everyone the effective freedom to copy and redistribute it,
+ with or without modifying it, either commercially or
+ noncommercially. Secondarily, this License preserves for the
+ author and publisher a way to get credit for their work, while not
+ being considered responsible for modifications made by others.
+
+ This License is a kind of "copyleft", which means that derivative
+ works of the document must themselves be free in the same sense.
+ It complements the GNU General Public License, which is a copyleft
+ license designed for free software.
+
+ We have designed this License in order to use it for manuals for
+ free software, because free software needs free documentation: a
+ free program should come with manuals providing the same freedoms
+ that the software does. But this License is not limited to
+ software manuals; it can be used for any textual work, regardless
+ of subject matter or whether it is published as a printed book.
+ We recommend this License principally for works whose purpose is
+ instruction or reference.
+
+ 1. APPLICABILITY AND DEFINITIONS
+
+ This License applies to any manual or other work, in any medium,
+ that contains a notice placed by the copyright holder saying it
+ can be distributed under the terms of this License. Such a notice
+ grants a world-wide, royalty-free license, unlimited in duration,
+ to use that work under the conditions stated herein. The
+ "Document", below, refers to any such manual or work. Any member
+ of the public is a licensee, and is addressed as "you". You
+ accept the license if you copy, modify or distribute the work in a
+ way requiring permission under copyright law.
+
+ A "Modified Version" of the Document means any work containing the
+ Document or a portion of it, either copied verbatim, or with
+ modifications and/or translated into another language.
+
+ A "Secondary Section" is a named appendix or a front-matter section
+ of the Document that deals exclusively with the relationship of the
+ publishers or authors of the Document to the Document's overall
+ subject (or to related matters) and contains nothing that could
+ fall directly within that overall subject. (Thus, if the Document
+ is in part a textbook of mathematics, a Secondary Section may not
+ explain any mathematics.) The relationship could be a matter of
+ historical connection with the subject or with related matters, or
+ of legal, commercial, philosophical, ethical or political position
+ regarding them.
+
+ The "Invariant Sections" are certain Secondary Sections whose
+ titles are designated, as being those of Invariant Sections, in
+ the notice that says that the Document is released under this
+ License. If a section does not fit the above definition of
+ Secondary then it is not allowed to be designated as Invariant.
+ The Document may contain zero Invariant Sections. If the Document
+ does not identify any Invariant Sections then there are none.
+
+ The "Cover Texts" are certain short passages of text that are
+ listed, as Front-Cover Texts or Back-Cover Texts, in the notice
+ that says that the Document is released under this License. A
+ Front-Cover Text may be at most 5 words, and a Back-Cover Text may
+ be at most 25 words.
+
+ A "Transparent" copy of the Document means a machine-readable copy,
+ represented in a format whose specification is available to the
+ general public, that is suitable for revising the document
+ straightforwardly with generic text editors or (for images
+ composed of pixels) generic paint programs or (for drawings) some
+ widely available drawing editor, and that is suitable for input to
+ text formatters or for automatic translation to a variety of
+ formats suitable for input to text formatters. A copy made in an
+ otherwise Transparent file format whose markup, or absence of
+ markup, has been arranged to thwart or discourage subsequent
+ modification by readers is not Transparent. An image format is
+ not Transparent if used for any substantial amount of text. A
+ copy that is not "Transparent" is called "Opaque".
+
+ Examples of suitable formats for Transparent copies include plain
+ ASCII without markup, Texinfo input format, LaTeX input format,
+ SGML or XML using a publicly available DTD, and
+ standard-conforming simple HTML, PostScript or PDF designed for
+ human modification. Examples of transparent image formats include
+ PNG, XCF and JPG. Opaque formats include proprietary formats that
+ can be read and edited only by proprietary word processors, SGML or
+ XML for which the DTD and/or processing tools are not generally
+ available, and the machine-generated HTML, PostScript or PDF
+ produced by some word processors for output purposes only.
+
+ The "Title Page" means, for a printed book, the title page itself,
+ plus such following pages as are needed to hold, legibly, the
+ material this License requires to appear in the title page. For
+ works in formats which do not have any title page as such, "Title
+ Page" means the text near the most prominent appearance of the
+ work's title, preceding the beginning of the body of the text.
+
+ A section "Entitled XYZ" means a named subunit of the Document
+ whose title either is precisely XYZ or contains XYZ in parentheses
+ following text that translates XYZ in another language. (Here XYZ
+ stands for a specific section name mentioned below, such as
+ "Acknowledgements", "Dedications", "Endorsements", or "History".)
+ To "Preserve the Title" of such a section when you modify the
+ Document means that it remains a section "Entitled XYZ" according
+ to this definition.
+
+ The Document may include Warranty Disclaimers next to the notice
+ which states that this License applies to the Document. These
+ Warranty Disclaimers are considered to be included by reference in
+ this License, but only as regards disclaiming warranties: any other
+ implication that these Warranty Disclaimers may have is void and
+ has no effect on the meaning of this License.
+
+ 2. VERBATIM COPYING
+
+ You may copy and distribute the Document in any medium, either
+ commercially or noncommercially, provided that this License, the
+ copyright notices, and the license notice saying this License
+ applies to the Document are reproduced in all copies, and that you
+ add no other conditions whatsoever to those of this License. You
+ may not use technical measures to obstruct or control the reading
+ or further copying of the copies you make or distribute. However,
+ you may accept compensation in exchange for copies. If you
+ distribute a large enough number of copies you must also follow
+ the conditions in section 3.
+
+ You may also lend copies, under the same conditions stated above,
+ and you may publicly display copies.
+
+ 3. COPYING IN QUANTITY
+
+ If you publish printed copies (or copies in media that commonly
+ have printed covers) of the Document, numbering more than 100, and
+ the Document's license notice requires Cover Texts, you must
+ enclose the copies in covers that carry, clearly and legibly, all
+ these Cover Texts: Front-Cover Texts on the front cover, and
+ Back-Cover Texts on the back cover. Both covers must also clearly
+ and legibly identify you as the publisher of these copies. The
+ front cover must present the full title with all words of the
+ title equally prominent and visible. You may add other material
+ on the covers in addition. Copying with changes limited to the
+ covers, as long as they preserve the title of the Document and
+ satisfy these conditions, can be treated as verbatim copying in
+ other respects.
+
+ If the required texts for either cover are too voluminous to fit
+ legibly, you should put the first ones listed (as many as fit
+ reasonably) on the actual cover, and continue the rest onto
+ adjacent pages.
+
+ If you publish or distribute Opaque copies of the Document
+ numbering more than 100, you must either include a
+ machine-readable Transparent copy along with each Opaque copy, or
+ state in or with each Opaque copy a computer-network location from
+ which the general network-using public has access to download
+ using public-standard network protocols a complete Transparent
+ copy of the Document, free of added material. If you use the
+ latter option, you must take reasonably prudent steps, when you
+ begin distribution of Opaque copies in quantity, to ensure that
+ this Transparent copy will remain thus accessible at the stated
+ location until at least one year after the last time you
+ distribute an Opaque copy (directly or through your agents or
+ retailers) of that edition to the public.
+
+ It is requested, but not required, that you contact the authors of
+ the Document well before redistributing any large number of
+ copies, to give them a chance to provide you with an updated
+ version of the Document.
+
+ 4. MODIFICATIONS
+
+ You may copy and distribute a Modified Version of the Document
+ under the conditions of sections 2 and 3 above, provided that you
+ release the Modified Version under precisely this License, with
+ the Modified Version filling the role of the Document, thus
+ licensing distribution and modification of the Modified Version to
+ whoever possesses a copy of it. In addition, you must do these
+ things in the Modified Version:
+
+ A. Use in the Title Page (and on the covers, if any) a title
+ distinct from that of the Document, and from those of
+ previous versions (which should, if there were any, be listed
+ in the History section of the Document). You may use the
+ same title as a previous version if the original publisher of
+ that version gives permission.
+
+ B. List on the Title Page, as authors, one or more persons or
+ entities responsible for authorship of the modifications in
+ the Modified Version, together with at least five of the
+ principal authors of the Document (all of its principal
+ authors, if it has fewer than five), unless they release you
+ from this requirement.
+
+ C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+
+ D. Preserve all the copyright notices of the Document.
+
+ E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+
+ F. Include, immediately after the copyright notices, a license
+ notice giving the public permission to use the Modified
+ Version under the terms of this License, in the form shown in
+ the Addendum below.
+
+ G. Preserve in that license notice the full lists of Invariant
+ Sections and required Cover Texts given in the Document's
+ license notice.
+
+ H. Include an unaltered copy of this License.
+
+ I. Preserve the section Entitled "History", Preserve its Title,
+ and add to it an item stating at least the title, year, new
+ authors, and publisher of the Modified Version as given on
+ the Title Page. If there is no section Entitled "History" in
+ the Document, create one stating the title, year, authors,
+ and publisher of the Document as given on its Title Page,
+ then add an item describing the Modified Version as stated in
+ the previous sentence.
+
+ J. Preserve the network location, if any, given in the Document
+ for public access to a Transparent copy of the Document, and
+ likewise the network locations given in the Document for
+ previous versions it was based on. These may be placed in
+ the "History" section. You may omit a network location for a
+ work that was published at least four years before the
+ Document itself, or if the original publisher of the version
+ it refers to gives permission.
+
+ K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the
+ section all the substance and tone of each of the contributor
+ acknowledgements and/or dedications given therein.
+
+ L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section
+ titles.
+
+ M. Delete any section Entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+
+ N. Do not retitle any existing section to be Entitled
+ "Endorsements" or to conflict in title with any Invariant
+ Section.
+
+ O. Preserve any Warranty Disclaimers.
+
+ If the Modified Version includes new front-matter sections or
+ appendices that qualify as Secondary Sections and contain no
+ material copied from the Document, you may at your option
+ designate some or all of these sections as invariant. To do this,
+ add their titles to the list of Invariant Sections in the Modified
+ Version's license notice. These titles must be distinct from any
+ other section titles.
+
+ You may add a section Entitled "Endorsements", provided it contains
+ nothing but endorsements of your Modified Version by various
+ parties--for example, statements of peer review or that the text
+ has been approved by an organization as the authoritative
+ definition of a standard.
+
+ You may add a passage of up to five words as a Front-Cover Text,
+ and a passage of up to 25 words as a Back-Cover Text, to the end
+ of the list of Cover Texts in the Modified Version. Only one
+ passage of Front-Cover Text and one of Back-Cover Text may be
+ added by (or through arrangements made by) any one entity. If the
+ Document already includes a cover text for the same cover,
+ previously added by you or by arrangement made by the same entity
+ you are acting on behalf of, you may not add another; but you may
+ replace the old one, on explicit permission from the previous
+ publisher that added the old one.
+
+ The author(s) and publisher(s) of the Document do not by this
+ License give permission to use their names for publicity for or to
+ assert or imply endorsement of any Modified Version.
+
+ 5. COMBINING DOCUMENTS
+
+ You may combine the Document with other documents released under
+ this License, under the terms defined in section 4 above for
+ modified versions, provided that you include in the combination
+ all of the Invariant Sections of all of the original documents,
+ unmodified, and list them all as Invariant Sections of your
+ combined work in its license notice, and that you preserve all
+ their Warranty Disclaimers.
+
+ The combined work need only contain one copy of this License, and
+ multiple identical Invariant Sections may be replaced with a single
+ copy. If there are multiple Invariant Sections with the same name
+ but different contents, make the title of each such section unique
+ by adding at the end of it, in parentheses, the name of the
+ original author or publisher of that section if known, or else a
+ unique number. Make the same adjustment to the section titles in
+ the list of Invariant Sections in the license notice of the
+ combined work.
+
+ In the combination, you must combine any sections Entitled
+ "History" in the various original documents, forming one section
+ Entitled "History"; likewise combine any sections Entitled
+ "Acknowledgements", and any sections Entitled "Dedications". You
+ must delete all sections Entitled "Endorsements."
+
+ 6. COLLECTIONS OF DOCUMENTS
+
+ You may make a collection consisting of the Document and other
+ documents released under this License, and replace the individual
+ copies of this License in the various documents with a single copy
+ that is included in the collection, provided that you follow the
+ rules of this License for verbatim copying of each of the
+ documents in all other respects.
+
+ You may extract a single document from such a collection, and
+ distribute it individually under this License, provided you insert
+ a copy of this License into the extracted document, and follow
+ this License in all other respects regarding verbatim copying of
+ that document.
+
+ 7. AGGREGATION WITH INDEPENDENT WORKS
+
+ A compilation of the Document or its derivatives with other
+ separate and independent documents or works, in or on a volume of
+ a storage or distribution medium, is called an "aggregate" if the
+ copyright resulting from the compilation is not used to limit the
+ legal rights of the compilation's users beyond what the individual
+ works permit. When the Document is included in an aggregate, this
+ License does not apply to the other works in the aggregate which
+ are not themselves derivative works of the Document.
+
+ If the Cover Text requirement of section 3 is applicable to these
+ copies of the Document, then if the Document is less than one half
+ of the entire aggregate, the Document's Cover Texts may be placed
+ on covers that bracket the Document within the aggregate, or the
+ electronic equivalent of covers if the Document is in electronic
+ form. Otherwise they must appear on printed covers that bracket
+ the whole aggregate.
+
+ 8. TRANSLATION
+
+ Translation is considered a kind of modification, so you may
+ distribute translations of the Document under the terms of section
+ 4. Replacing Invariant Sections with translations requires special
+ permission from their copyright holders, but you may include
+ translations of some or all Invariant Sections in addition to the
+ original versions of these Invariant Sections. You may include a
+ translation of this License, and all the license notices in the
+ Document, and any Warranty Disclaimers, provided that you also
+ include the original English version of this License and the
+ original versions of those notices and disclaimers. In case of a
+ disagreement between the translation and the original version of
+ this License or a notice or disclaimer, the original version will
+ prevail.
+
+ If a section in the Document is Entitled "Acknowledgements",
+ "Dedications", or "History", the requirement (section 4) to
+ Preserve its Title (section 1) will typically require changing the
+ actual title.
+
+ 9. TERMINATION
+
+ You may not copy, modify, sublicense, or distribute the Document
+ except as expressly provided for under this License. Any other
+ attempt to copy, modify, sublicense or distribute the Document is
+ void, and will automatically terminate your rights under this
+ License. However, parties who have received copies, or rights,
+ from you under this License will not have their licenses
+ terminated so long as such parties remain in full compliance.
+
+ 10. FUTURE REVISIONS OF THIS LICENSE
+
+ The Free Software Foundation may publish new, revised versions of
+ the GNU Free Documentation License from time to time. Such new
+ versions will be similar in spirit to the present version, but may
+ differ in detail to address new problems or concerns. See
+ `http://www.gnu.org/copyleft/'.
+
+ Each version of the License is given a distinguishing version
+ number. If the Document specifies that a particular numbered
+ version of this License "or any later version" applies to it, you
+ have the option of following the terms and conditions either of
+ that specified version or of any later version that has been
+ published (not as a draft) by the Free Software Foundation. If
+ the Document does not specify a version number of this License,
+ you may choose any version ever published (not as a draft) by the
+ Free Software Foundation.
+
+ADDENDUM: How to use this License for your documents
+====================================================
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and license
+notices just after the title page:
+
+ Copyright (C) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.2
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+ Texts. A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
+
+ If you have Invariant Sections, Front-Cover Texts and Back-Cover
+Texts, replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with
+ the Front-Cover Texts being LIST, and with the Back-Cover Texts
+ being LIST.
+
+ If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+ If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License, to
+permit their use in free software.
+
+
+File: gccinstall.info, Node: Concept Index, Prev: GNU Free Documentation License, Up: Top
+
+Concept Index
+*************
+
+
+* Menu:
+
+* Binaries: Binaries. (line 6)
+* Configuration: Configuration. (line 6)
+* configurations supported by GCC: Configurations. (line 6)
+* Downloading GCC: Downloading the source.
+ (line 6)
+* Downloading the Source: Downloading the source.
+ (line 6)
+* FDL, GNU Free Documentation License: GNU Free Documentation License.
+ (line 6)
+* Host specific installation: Specific. (line 6)
+* Installing GCC: Binaries: Binaries. (line 6)
+* Installing GCC: Building: Building. (line 6)
+* Installing GCC: Configuration: Configuration. (line 6)
+* Installing GCC: Testing: Testing. (line 6)
+* Prerequisites: Prerequisites. (line 6)
+* Specific: Specific. (line 6)
+* Specific installation notes: Specific. (line 6)
+* Target specific installation: Specific. (line 6)
+* Target specific installation notes: Specific. (line 6)
+* Testing: Testing. (line 6)
+* Testsuite: Testing. (line 6)
+
+
+
+Tag Table:
+Node: Top1989
+Node: Installing GCC2547
+Node: Prerequisites4062
+Node: Downloading the source13067
+Node: Configuration14988
+Ref: with-gnu-as28405
+Ref: with-as29303
+Ref: with-gnu-ld30716
+Node: Building67873
+Node: Testing79816
+Node: Final install87596
+Node: Binaries92826
+Node: Specific94799
+Ref: alpha-x-x95305
+Ref: alpha-dec-osf95794
+Ref: arc-x-elf98917
+Ref: arm-x-elf99017
+Ref: arm-x-coff99237
+Ref: arm-x-aout99439
+Ref: avr99561
+Ref: bfin100203
+Ref: cris100445
+Ref: crx101261
+Ref: dos101924
+Ref: x-x-freebsd102247
+Ref: h8300-hms104630
+Ref: hppa-hp-hpux104982
+Ref: hppa-hp-hpux10107353
+Ref: hppa-hp-hpux11107986
+Ref: x-x-linux-gnu113645
+Ref: ix86-x-linux113838
+Ref: ix86-x-solaris210114151
+Ref: ia64-x-linux114537
+Ref: ia64-x-hpux115307
+Ref: x-ibm-aix115862
+Ref: iq2000-x-elf121845
+Ref: m32c-x-elf121985
+Ref: m32r-x-elf122087
+Ref: m6811-elf122189
+Ref: m6812-elf122339
+Ref: m68k-x-x122489
+Ref: m68k-x-uclinux123494
+Ref: mips-x-x123857
+Ref: mips-sgi-irix5126534
+Ref: mips-sgi-irix6127482
+Ref: powerpc-x-x130289
+Ref: powerpc-x-darwin130494
+Ref: powerpc-x-elf131041
+Ref: powerpc-x-linux-gnu131126
+Ref: powerpc-x-netbsd131221
+Ref: powerpc-x-eabisim131309
+Ref: powerpc-x-eabi131435
+Ref: powerpcle-x-elf131511
+Ref: powerpcle-x-eabisim131603
+Ref: powerpcle-x-eabi131736
+Ref: s390-x-linux131819
+Ref: s390x-x-linux131891
+Ref: s390x-ibm-tpf131978
+Ref: x-x-solaris2132109
+Ref: sparc-sun-solaris2135986
+Ref: sparc-sun-solaris27138707
+Ref: sparc-x-linux141171
+Ref: sparc64-x-solaris2141396
+Ref: sparcv9-x-solaris2142041
+Ref: x-x-vxworks142126
+Ref: x86-64-x-x143648
+Ref: xtensa-x-elf143976
+Ref: xtensa-x-linux144647
+Ref: windows144988
+Ref: x-x-cygwin146943
+Ref: x-x-interix147213
+Ref: x-x-mingw32147579
+Ref: os2147805
+Ref: older147996
+Ref: elf150113
+Node: Old150371
+Node: Configurations153508
+Node: GNU Free Documentation License157490
+Node: Concept Index179906
+
+End Tag Table
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/info/gccint.info b/uclibc-crosstools-gcc-4.4.2-1/usr/info/gccint.info
new file mode 100644
index 0000000..01418b5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/info/gccint.info
@@ -0,0 +1,43962 @@
+This is doc/gccint.info, produced by makeinfo version 4.9 from
+/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/gcc-4.4.2/gcc/doc/gccint.texi.
+
+ Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free
+Software Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being "Funding Free Software", the Front-Cover Texts
+being (a) (see below), and with the Back-Cover Texts being (b) (see
+below). A copy of the license is included in the section entitled "GNU
+Free Documentation License".
+
+ (a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+ (b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+software. Copies published by the Free Software Foundation raise
+funds for GNU development.
+
+INFO-DIR-SECTION Software development
+START-INFO-DIR-ENTRY
+* gccint: (gccint). Internals of the GNU Compiler Collection.
+END-INFO-DIR-ENTRY
+ This file documents the internals of the GNU compilers.
+
+ Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free
+Software Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being "Funding Free Software", the Front-Cover Texts
+being (a) (see below), and with the Back-Cover Texts being (b) (see
+below). A copy of the license is included in the section entitled "GNU
+Free Documentation License".
+
+ (a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+ (b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+software. Copies published by the Free Software Foundation raise
+funds for GNU development.
+
+
+
+File: gccint.info, Node: Top, Next: Contributing, Up: (DIR)
+
+Introduction
+************
+
+This manual documents the internals of the GNU compilers, including how
+to port them to new targets and some information about how to write
+front ends for new languages. It corresponds to the compilers
+(Buildroot 2010.02-git) version 4.4.2. The use of the GNU compilers is
+documented in a separate manual. *Note Introduction: (gcc)Top.
+
+ This manual is mainly a reference manual rather than a tutorial. It
+discusses how to contribute to GCC (*note Contributing::), the
+characteristics of the machines supported by GCC as hosts and targets
+(*note Portability::), how GCC relates to the ABIs on such systems
+(*note Interface::), and the characteristics of the languages for which
+GCC front ends are written (*note Languages::). It then describes the
+GCC source tree structure and build system, some of the interfaces to
+GCC front ends, and how support for a target system is implemented in
+GCC.
+
+ Additional tutorial information is linked to from
+`http://gcc.gnu.org/readings.html'.
+
+* Menu:
+
+* Contributing:: How to contribute to testing and developing GCC.
+* Portability:: Goals of GCC's portability features.
+* Interface:: Function-call interface of GCC output.
+* Libgcc:: Low-level runtime library used by GCC.
+* Languages:: Languages for which GCC front ends are written.
+* Source Tree:: GCC source tree structure and build system.
+* Options:: Option specification files.
+* Passes:: Order of passes, what they do, and what each file is for.
+* Trees:: The source representation used by the C and C++ front ends.
+* GENERIC:: Language-independent representation generated by Front Ends
+* GIMPLE:: Tuple representation used by Tree SSA optimizers
+* Tree SSA:: Analysis and optimization of GIMPLE
+* RTL:: Machine-dependent low-level intermediate representation.
+* Control Flow:: Maintaining and manipulating the control flow graph.
+* Loop Analysis and Representation:: Analysis and representation of loops
+* Machine Desc:: How to write machine description instruction patterns.
+* Target Macros:: How to write the machine description C macros and functions.
+* Host Config:: Writing the `xm-MACHINE.h' file.
+* Fragments:: Writing the `t-TARGET' and `x-HOST' files.
+* Collect2:: How `collect2' works; how it finds `ld'.
+* Header Dirs:: Understanding the standard header file directories.
+* Type Information:: GCC's memory management; generating type information.
+
+* Funding:: How to help assure funding for free software.
+* GNU Project:: The GNU Project and GNU/Linux.
+
+* Copying:: GNU General Public License says
+ how you can copy and share GCC.
+* GNU Free Documentation License:: How you can copy and share this manual.
+* Contributors:: People who have contributed to GCC.
+
+* Option Index:: Index to command line options.
+* Concept Index:: Index of concepts and symbol names.
+
+
+File: gccint.info, Node: Contributing, Next: Portability, Prev: Top, Up: Top
+
+1 Contributing to GCC Development
+*********************************
+
+If you would like to help pretest GCC releases to assure they work well,
+current development sources are available by SVN (see
+`http://gcc.gnu.org/svn.html'). Source and binary snapshots are also
+available for FTP; see `http://gcc.gnu.org/snapshots.html'.
+
+ If you would like to work on improvements to GCC, please read the
+advice at these URLs:
+
+ `http://gcc.gnu.org/contribute.html'
+ `http://gcc.gnu.org/contributewhy.html'
+
+for information on how to make useful contributions and avoid
+duplication of effort. Suggested projects are listed at
+`http://gcc.gnu.org/projects/'.
+
+
+File: gccint.info, Node: Portability, Next: Interface, Prev: Contributing, Up: Top
+
+2 GCC and Portability
+*********************
+
+GCC itself aims to be portable to any machine where `int' is at least a
+32-bit type. It aims to target machines with a flat (non-segmented)
+byte addressed data address space (the code address space can be
+separate). Target ABIs may have 8, 16, 32 or 64-bit `int' type. `char'
+can be wider than 8 bits.
+
+ GCC gets most of the information about the target machine from a
+machine description which gives an algebraic formula for each of the
+machine's instructions. This is a very clean way to describe the
+target. But when the compiler needs information that is difficult to
+express in this fashion, ad-hoc parameters have been defined for
+machine descriptions. The purpose of portability is to reduce the
+total work needed on the compiler; it was not of interest for its own
+sake.
+
+ GCC does not contain machine dependent code, but it does contain code
+that depends on machine parameters such as endianness (whether the most
+significant byte has the highest or lowest address of the bytes in a
+word) and the availability of autoincrement addressing. In the
+RTL-generation pass, it is often necessary to have multiple strategies
+for generating code for a particular kind of syntax tree, strategies
+that are usable for different combinations of parameters. Often, not
+all possible cases have been addressed, but only the common ones or
+only the ones that have been encountered. As a result, a new target
+may require additional strategies. You will know if this happens
+because the compiler will call `abort'. Fortunately, the new
+strategies can be added in a machine-independent fashion, and will
+affect only the target machines that need them.
+
+
+File: gccint.info, Node: Interface, Next: Libgcc, Prev: Portability, Up: Top
+
+3 Interfacing to GCC Output
+***************************
+
+GCC is normally configured to use the same function calling convention
+normally in use on the target system. This is done with the
+machine-description macros described (*note Target Macros::).
+
+ However, returning of structure and union values is done differently on
+some target machines. As a result, functions compiled with PCC
+returning such types cannot be called from code compiled with GCC, and
+vice versa. This does not cause trouble often because few Unix library
+routines return structures or unions.
+
+ GCC code returns structures and unions that are 1, 2, 4 or 8 bytes
+long in the same registers used for `int' or `double' return values.
+(GCC typically allocates variables of such types in registers also.)
+Structures and unions of other sizes are returned by storing them into
+an address passed by the caller (usually in a register). The target
+hook `TARGET_STRUCT_VALUE_RTX' tells GCC where to pass this address.
+
+ By contrast, PCC on most target machines returns structures and unions
+of any size by copying the data into an area of static storage, and then
+returning the address of that storage as if it were a pointer value.
+The caller must copy the data from that memory area to the place where
+the value is wanted. This is slower than the method used by GCC, and
+fails to be reentrant.
+
+ On some target machines, such as RISC machines and the 80386, the
+standard system convention is to pass to the subroutine the address of
+where to return the value. On these machines, GCC has been configured
+to be compatible with the standard compiler, when this method is used.
+It may not be compatible for structures of 1, 2, 4 or 8 bytes.
+
+ GCC uses the system's standard convention for passing arguments. On
+some machines, the first few arguments are passed in registers; in
+others, all are passed on the stack. It would be possible to use
+registers for argument passing on any machine, and this would probably
+result in a significant speedup. But the result would be complete
+incompatibility with code that follows the standard convention. So this
+change is practical only if you are switching to GCC as the sole C
+compiler for the system. We may implement register argument passing on
+certain machines once we have a complete GNU system so that we can
+compile the libraries with GCC.
+
+ On some machines (particularly the SPARC), certain types of arguments
+are passed "by invisible reference". This means that the value is
+stored in memory, and the address of the memory location is passed to
+the subroutine.
+
+ If you use `longjmp', beware of automatic variables. ISO C says that
+automatic variables that are not declared `volatile' have undefined
+values after a `longjmp'. And this is all GCC promises to do, because
+it is very difficult to restore register variables correctly, and one
+of GCC's features is that it can put variables in registers without
+your asking it to.
+
+
+File: gccint.info, Node: Libgcc, Next: Languages, Prev: Interface, Up: Top
+
+4 The GCC low-level runtime library
+***********************************
+
+GCC provides a low-level runtime library, `libgcc.a' or `libgcc_s.so.1'
+on some platforms. GCC generates calls to routines in this library
+automatically, whenever it needs to perform some operation that is too
+complicated to emit inline code for.
+
+ Most of the routines in `libgcc' handle arithmetic operations that the
+target processor cannot perform directly. This includes integer
+multiply and divide on some machines, and all floating-point and
+fixed-point operations on other machines. `libgcc' also includes
+routines for exception handling, and a handful of miscellaneous
+operations.
+
+ Some of these routines can be defined in mostly machine-independent C.
+Others must be hand-written in assembly language for each processor
+that needs them.
+
+ GCC will also generate calls to C library routines, such as `memcpy'
+and `memset', in some cases. The set of routines that GCC may possibly
+use is documented in *Note Other Builtins: (gcc)Other Builtins.
+
+ These routines take arguments and return values of a specific machine
+mode, not a specific C type. *Note Machine Modes::, for an explanation
+of this concept. For illustrative purposes, in this chapter the
+floating point type `float' is assumed to correspond to `SFmode';
+`double' to `DFmode'; and `long double' to both `TFmode' and `XFmode'.
+Similarly, the integer types `int' and `unsigned int' correspond to
+`SImode'; `long' and `unsigned long' to `DImode'; and `long long' and
+`unsigned long long' to `TImode'.
+
+* Menu:
+
+* Integer library routines::
+* Soft float library routines::
+* Decimal float library routines::
+* Fixed-point fractional library routines::
+* Exception handling routines::
+* Miscellaneous routines::
+
+
+File: gccint.info, Node: Integer library routines, Next: Soft float library routines, Up: Libgcc
+
+4.1 Routines for integer arithmetic
+===================================
+
+The integer arithmetic routines are used on platforms that don't provide
+hardware support for arithmetic operations on some modes.
+
+4.1.1 Arithmetic functions
+--------------------------
+
+ -- Runtime Function: int __ashlsi3 (int A, int B)
+ -- Runtime Function: long __ashldi3 (long A, int B)
+ -- Runtime Function: long long __ashlti3 (long long A, int B)
+ These functions return the result of shifting A left by B bits.
+
+ -- Runtime Function: int __ashrsi3 (int A, int B)
+ -- Runtime Function: long __ashrdi3 (long A, int B)
+ -- Runtime Function: long long __ashrti3 (long long A, int B)
+ These functions return the result of arithmetically shifting A
+ right by B bits.
+
+ -- Runtime Function: int __divsi3 (int A, int B)
+ -- Runtime Function: long __divdi3 (long A, long B)
+ -- Runtime Function: long long __divti3 (long long A, long long B)
+ These functions return the quotient of the signed division of A and
+ B.
+
+ -- Runtime Function: int __lshrsi3 (int A, int B)
+ -- Runtime Function: long __lshrdi3 (long A, int B)
+ -- Runtime Function: long long __lshrti3 (long long A, int B)
+ These functions return the result of logically shifting A right by
+ B bits.
+
+ -- Runtime Function: int __modsi3 (int A, int B)
+ -- Runtime Function: long __moddi3 (long A, long B)
+ -- Runtime Function: long long __modti3 (long long A, long long B)
+ These functions return the remainder of the signed division of A
+ and B.
+
+ -- Runtime Function: int __mulsi3 (int A, int B)
+ -- Runtime Function: long __muldi3 (long A, long B)
+ -- Runtime Function: long long __multi3 (long long A, long long B)
+ These functions return the product of A and B.
+
+ -- Runtime Function: long __negdi2 (long A)
+ -- Runtime Function: long long __negti2 (long long A)
+ These functions return the negation of A.
+
+ -- Runtime Function: unsigned int __udivsi3 (unsigned int A, unsigned
+ int B)
+ -- Runtime Function: unsigned long __udivdi3 (unsigned long A,
+ unsigned long B)
+ -- Runtime Function: unsigned long long __udivti3 (unsigned long long
+ A, unsigned long long B)
+ These functions return the quotient of the unsigned division of A
+ and B.
+
+ -- Runtime Function: unsigned long __udivmoddi3 (unsigned long A,
+ unsigned long B, unsigned long *C)
+ -- Runtime Function: unsigned long long __udivti3 (unsigned long long
+ A, unsigned long long B, unsigned long long *C)
+ These functions calculate both the quotient and remainder of the
+ unsigned division of A and B. The return value is the quotient,
+ and the remainder is placed in variable pointed to by C.
+
+ -- Runtime Function: unsigned int __umodsi3 (unsigned int A, unsigned
+ int B)
+ -- Runtime Function: unsigned long __umoddi3 (unsigned long A,
+ unsigned long B)
+ -- Runtime Function: unsigned long long __umodti3 (unsigned long long
+ A, unsigned long long B)
+ These functions return the remainder of the unsigned division of A
+ and B.
+
+4.1.2 Comparison functions
+--------------------------
+
+The following functions implement integral comparisons. These functions
+implement a low-level compare, upon which the higher level comparison
+operators (such as less than and greater than or equal to) can be
+constructed. The returned values lie in the range zero to two, to allow
+the high-level operators to be implemented by testing the returned
+result using either signed or unsigned comparison.
+
+ -- Runtime Function: int __cmpdi2 (long A, long B)
+ -- Runtime Function: int __cmpti2 (long long A, long long B)
+ These functions perform a signed comparison of A and B. If A is
+ less than B, they return 0; if A is greater than B, they return 2;
+ and if A and B are equal they return 1.
+
+ -- Runtime Function: int __ucmpdi2 (unsigned long A, unsigned long B)
+ -- Runtime Function: int __ucmpti2 (unsigned long long A, unsigned
+ long long B)
+ These functions perform an unsigned comparison of A and B. If A
+ is less than B, they return 0; if A is greater than B, they return
+ 2; and if A and B are equal they return 1.
+
+4.1.3 Trapping arithmetic functions
+-----------------------------------
+
+The following functions implement trapping arithmetic. These functions
+call the libc function `abort' upon signed arithmetic overflow.
+
+ -- Runtime Function: int __absvsi2 (int A)
+ -- Runtime Function: long __absvdi2 (long A)
+ These functions return the absolute value of A.
+
+ -- Runtime Function: int __addvsi3 (int A, int B)
+ -- Runtime Function: long __addvdi3 (long A, long B)
+ These functions return the sum of A and B; that is `A + B'.
+
+ -- Runtime Function: int __mulvsi3 (int A, int B)
+ -- Runtime Function: long __mulvdi3 (long A, long B)
+ The functions return the product of A and B; that is `A * B'.
+
+ -- Runtime Function: int __negvsi2 (int A)
+ -- Runtime Function: long __negvdi2 (long A)
+ These functions return the negation of A; that is `-A'.
+
+ -- Runtime Function: int __subvsi3 (int A, int B)
+ -- Runtime Function: long __subvdi3 (long A, long B)
+ These functions return the difference between B and A; that is `A
+ - B'.
+
+4.1.4 Bit operations
+--------------------
+
+ -- Runtime Function: int __clzsi2 (int A)
+ -- Runtime Function: int __clzdi2 (long A)
+ -- Runtime Function: int __clzti2 (long long A)
+ These functions return the number of leading 0-bits in A, starting
+ at the most significant bit position. If A is zero, the result is
+ undefined.
+
+ -- Runtime Function: int __ctzsi2 (int A)
+ -- Runtime Function: int __ctzdi2 (long A)
+ -- Runtime Function: int __ctzti2 (long long A)
+ These functions return the number of trailing 0-bits in A, starting
+ at the least significant bit position. If A is zero, the result is
+ undefined.
+
+ -- Runtime Function: int __ffsdi2 (long A)
+ -- Runtime Function: int __ffsti2 (long long A)
+ These functions return the index of the least significant 1-bit in
+ A, or the value zero if A is zero. The least significant bit is
+ index one.
+
+ -- Runtime Function: int __paritysi2 (int A)
+ -- Runtime Function: int __paritydi2 (long A)
+ -- Runtime Function: int __parityti2 (long long A)
+ These functions return the value zero if the number of bits set in
+ A is even, and the value one otherwise.
+
+ -- Runtime Function: int __popcountsi2 (int A)
+ -- Runtime Function: int __popcountdi2 (long A)
+ -- Runtime Function: int __popcountti2 (long long A)
+ These functions return the number of bits set in A.
+
+ -- Runtime Function: int32_t __bswapsi2 (int32_t A)
+ -- Runtime Function: int64_t __bswapdi2 (int64_t A)
+ These functions return the A byteswapped.
+
+
+File: gccint.info, Node: Soft float library routines, Next: Decimal float library routines, Prev: Integer library routines, Up: Libgcc
+
+4.2 Routines for floating point emulation
+=========================================
+
+The software floating point library is used on machines which do not
+have hardware support for floating point. It is also used whenever
+`-msoft-float' is used to disable generation of floating point
+instructions. (Not all targets support this switch.)
+
+ For compatibility with other compilers, the floating point emulation
+routines can be renamed with the `DECLARE_LIBRARY_RENAMES' macro (*note
+Library Calls::). In this section, the default names are used.
+
+ Presently the library does not support `XFmode', which is used for
+`long double' on some architectures.
+
+4.2.1 Arithmetic functions
+--------------------------
+
+ -- Runtime Function: float __addsf3 (float A, float B)
+ -- Runtime Function: double __adddf3 (double A, double B)
+ -- Runtime Function: long double __addtf3 (long double A, long double
+ B)
+ -- Runtime Function: long double __addxf3 (long double A, long double
+ B)
+ These functions return the sum of A and B.
+
+ -- Runtime Function: float __subsf3 (float A, float B)
+ -- Runtime Function: double __subdf3 (double A, double B)
+ -- Runtime Function: long double __subtf3 (long double A, long double
+ B)
+ -- Runtime Function: long double __subxf3 (long double A, long double
+ B)
+ These functions return the difference between B and A; that is,
+ A - B.
+
+ -- Runtime Function: float __mulsf3 (float A, float B)
+ -- Runtime Function: double __muldf3 (double A, double B)
+ -- Runtime Function: long double __multf3 (long double A, long double
+ B)
+ -- Runtime Function: long double __mulxf3 (long double A, long double
+ B)
+ These functions return the product of A and B.
+
+ -- Runtime Function: float __divsf3 (float A, float B)
+ -- Runtime Function: double __divdf3 (double A, double B)
+ -- Runtime Function: long double __divtf3 (long double A, long double
+ B)
+ -- Runtime Function: long double __divxf3 (long double A, long double
+ B)
+ These functions return the quotient of A and B; that is, A / B.
+
+ -- Runtime Function: float __negsf2 (float A)
+ -- Runtime Function: double __negdf2 (double A)
+ -- Runtime Function: long double __negtf2 (long double A)
+ -- Runtime Function: long double __negxf2 (long double A)
+ These functions return the negation of A. They simply flip the
+ sign bit, so they can produce negative zero and negative NaN.
+
+4.2.2 Conversion functions
+--------------------------
+
+ -- Runtime Function: double __extendsfdf2 (float A)
+ -- Runtime Function: long double __extendsftf2 (float A)
+ -- Runtime Function: long double __extendsfxf2 (float A)
+ -- Runtime Function: long double __extenddftf2 (double A)
+ -- Runtime Function: long double __extenddfxf2 (double A)
+ These functions extend A to the wider mode of their return type.
+
+ -- Runtime Function: double __truncxfdf2 (long double A)
+ -- Runtime Function: double __trunctfdf2 (long double A)
+ -- Runtime Function: float __truncxfsf2 (long double A)
+ -- Runtime Function: float __trunctfsf2 (long double A)
+ -- Runtime Function: float __truncdfsf2 (double A)
+ These functions truncate A to the narrower mode of their return
+ type, rounding toward zero.
+
+ -- Runtime Function: int __fixsfsi (float A)
+ -- Runtime Function: int __fixdfsi (double A)
+ -- Runtime Function: int __fixtfsi (long double A)
+ -- Runtime Function: int __fixxfsi (long double A)
+ These functions convert A to a signed integer, rounding toward
+ zero.
+
+ -- Runtime Function: long __fixsfdi (float A)
+ -- Runtime Function: long __fixdfdi (double A)
+ -- Runtime Function: long __fixtfdi (long double A)
+ -- Runtime Function: long __fixxfdi (long double A)
+ These functions convert A to a signed long, rounding toward zero.
+
+ -- Runtime Function: long long __fixsfti (float A)
+ -- Runtime Function: long long __fixdfti (double A)
+ -- Runtime Function: long long __fixtfti (long double A)
+ -- Runtime Function: long long __fixxfti (long double A)
+ These functions convert A to a signed long long, rounding toward
+ zero.
+
+ -- Runtime Function: unsigned int __fixunssfsi (float A)
+ -- Runtime Function: unsigned int __fixunsdfsi (double A)
+ -- Runtime Function: unsigned int __fixunstfsi (long double A)
+ -- Runtime Function: unsigned int __fixunsxfsi (long double A)
+ These functions convert A to an unsigned integer, rounding toward
+ zero. Negative values all become zero.
+
+ -- Runtime Function: unsigned long __fixunssfdi (float A)
+ -- Runtime Function: unsigned long __fixunsdfdi (double A)
+ -- Runtime Function: unsigned long __fixunstfdi (long double A)
+ -- Runtime Function: unsigned long __fixunsxfdi (long double A)
+ These functions convert A to an unsigned long, rounding toward
+ zero. Negative values all become zero.
+
+ -- Runtime Function: unsigned long long __fixunssfti (float A)
+ -- Runtime Function: unsigned long long __fixunsdfti (double A)
+ -- Runtime Function: unsigned long long __fixunstfti (long double A)
+ -- Runtime Function: unsigned long long __fixunsxfti (long double A)
+ These functions convert A to an unsigned long long, rounding
+ toward zero. Negative values all become zero.
+
+ -- Runtime Function: float __floatsisf (int I)
+ -- Runtime Function: double __floatsidf (int I)
+ -- Runtime Function: long double __floatsitf (int I)
+ -- Runtime Function: long double __floatsixf (int I)
+ These functions convert I, a signed integer, to floating point.
+
+ -- Runtime Function: float __floatdisf (long I)
+ -- Runtime Function: double __floatdidf (long I)
+ -- Runtime Function: long double __floatditf (long I)
+ -- Runtime Function: long double __floatdixf (long I)
+ These functions convert I, a signed long, to floating point.
+
+ -- Runtime Function: float __floattisf (long long I)
+ -- Runtime Function: double __floattidf (long long I)
+ -- Runtime Function: long double __floattitf (long long I)
+ -- Runtime Function: long double __floattixf (long long I)
+ These functions convert I, a signed long long, to floating point.
+
+ -- Runtime Function: float __floatunsisf (unsigned int I)
+ -- Runtime Function: double __floatunsidf (unsigned int I)
+ -- Runtime Function: long double __floatunsitf (unsigned int I)
+ -- Runtime Function: long double __floatunsixf (unsigned int I)
+ These functions convert I, an unsigned integer, to floating point.
+
+ -- Runtime Function: float __floatundisf (unsigned long I)
+ -- Runtime Function: double __floatundidf (unsigned long I)
+ -- Runtime Function: long double __floatunditf (unsigned long I)
+ -- Runtime Function: long double __floatundixf (unsigned long I)
+ These functions convert I, an unsigned long, to floating point.
+
+ -- Runtime Function: float __floatuntisf (unsigned long long I)
+ -- Runtime Function: double __floatuntidf (unsigned long long I)
+ -- Runtime Function: long double __floatuntitf (unsigned long long I)
+ -- Runtime Function: long double __floatuntixf (unsigned long long I)
+ These functions convert I, an unsigned long long, to floating
+ point.
+
+4.2.3 Comparison functions
+--------------------------
+
+There are two sets of basic comparison functions.
+
+ -- Runtime Function: int __cmpsf2 (float A, float B)
+ -- Runtime Function: int __cmpdf2 (double A, double B)
+ -- Runtime Function: int __cmptf2 (long double A, long double B)
+ These functions calculate a <=> b. That is, if A is less than B,
+ they return -1; if A is greater than B, they return 1; and if A
+ and B are equal they return 0. If either argument is NaN they
+ return 1, but you should not rely on this; if NaN is a
+ possibility, use one of the higher-level comparison functions.
+
+ -- Runtime Function: int __unordsf2 (float A, float B)
+ -- Runtime Function: int __unorddf2 (double A, double B)
+ -- Runtime Function: int __unordtf2 (long double A, long double B)
+ These functions return a nonzero value if either argument is NaN,
+ otherwise 0.
+
+ There is also a complete group of higher level functions which
+correspond directly to comparison operators. They implement the ISO C
+semantics for floating-point comparisons, taking NaN into account. Pay
+careful attention to the return values defined for each set. Under the
+hood, all of these routines are implemented as
+
+ if (__unordXf2 (a, b))
+ return E;
+ return __cmpXf2 (a, b);
+
+where E is a constant chosen to give the proper behavior for NaN.
+Thus, the meaning of the return value is different for each set. Do
+not rely on this implementation; only the semantics documented below
+are guaranteed.
+
+ -- Runtime Function: int __eqsf2 (float A, float B)
+ -- Runtime Function: int __eqdf2 (double A, double B)
+ -- Runtime Function: int __eqtf2 (long double A, long double B)
+ These functions return zero if neither argument is NaN, and A and
+ B are equal.
+
+ -- Runtime Function: int __nesf2 (float A, float B)
+ -- Runtime Function: int __nedf2 (double A, double B)
+ -- Runtime Function: int __netf2 (long double A, long double B)
+ These functions return a nonzero value if either argument is NaN,
+ or if A and B are unequal.
+
+ -- Runtime Function: int __gesf2 (float A, float B)
+ -- Runtime Function: int __gedf2 (double A, double B)
+ -- Runtime Function: int __getf2 (long double A, long double B)
+ These functions return a value greater than or equal to zero if
+ neither argument is NaN, and A is greater than or equal to B.
+
+ -- Runtime Function: int __ltsf2 (float A, float B)
+ -- Runtime Function: int __ltdf2 (double A, double B)
+ -- Runtime Function: int __lttf2 (long double A, long double B)
+ These functions return a value less than zero if neither argument
+ is NaN, and A is strictly less than B.
+
+ -- Runtime Function: int __lesf2 (float A, float B)
+ -- Runtime Function: int __ledf2 (double A, double B)
+ -- Runtime Function: int __letf2 (long double A, long double B)
+ These functions return a value less than or equal to zero if
+ neither argument is NaN, and A is less than or equal to B.
+
+ -- Runtime Function: int __gtsf2 (float A, float B)
+ -- Runtime Function: int __gtdf2 (double A, double B)
+ -- Runtime Function: int __gttf2 (long double A, long double B)
+ These functions return a value greater than zero if neither
+ argument is NaN, and A is strictly greater than B.
+
+4.2.4 Other floating-point functions
+------------------------------------
+
+ -- Runtime Function: float __powisf2 (float A, int B)
+ -- Runtime Function: double __powidf2 (double A, int B)
+ -- Runtime Function: long double __powitf2 (long double A, int B)
+ -- Runtime Function: long double __powixf2 (long double A, int B)
+ These functions convert raise A to the power B.
+
+ -- Runtime Function: complex float __mulsc3 (float A, float B, float
+ C, float D)
+ -- Runtime Function: complex double __muldc3 (double A, double B,
+ double C, double D)
+ -- Runtime Function: complex long double __multc3 (long double A, long
+ double B, long double C, long double D)
+ -- Runtime Function: complex long double __mulxc3 (long double A, long
+ double B, long double C, long double D)
+ These functions return the product of A + iB and C + iD, following
+ the rules of C99 Annex G.
+
+ -- Runtime Function: complex float __divsc3 (float A, float B, float
+ C, float D)
+ -- Runtime Function: complex double __divdc3 (double A, double B,
+ double C, double D)
+ -- Runtime Function: complex long double __divtc3 (long double A, long
+ double B, long double C, long double D)
+ -- Runtime Function: complex long double __divxc3 (long double A, long
+ double B, long double C, long double D)
+ These functions return the quotient of A + iB and C + iD (i.e., (A
+ + iB) / (C + iD)), following the rules of C99 Annex G.
+
+
+File: gccint.info, Node: Decimal float library routines, Next: Fixed-point fractional library routines, Prev: Soft float library routines, Up: Libgcc
+
+4.3 Routines for decimal floating point emulation
+=================================================
+
+The software decimal floating point library implements IEEE 754-2008
+decimal floating point arithmetic and is only activated on selected
+targets.
+
+ The software decimal floating point library supports either DPD
+(Densely Packed Decimal) or BID (Binary Integer Decimal) encoding as
+selected at configure time.
+
+4.3.1 Arithmetic functions
+--------------------------
+
+ -- Runtime Function: _Decimal32 __dpd_addsd3 (_Decimal32 A, _Decimal32
+ B)
+ -- Runtime Function: _Decimal32 __bid_addsd3 (_Decimal32 A, _Decimal32
+ B)
+ -- Runtime Function: _Decimal64 __dpd_adddd3 (_Decimal64 A, _Decimal64
+ B)
+ -- Runtime Function: _Decimal64 __bid_adddd3 (_Decimal64 A, _Decimal64
+ B)
+ -- Runtime Function: _Decimal128 __dpd_addtd3 (_Decimal128 A,
+ _Decimal128 B)
+ -- Runtime Function: _Decimal128 __bid_addtd3 (_Decimal128 A,
+ _Decimal128 B)
+ These functions return the sum of A and B.
+
+ -- Runtime Function: _Decimal32 __dpd_subsd3 (_Decimal32 A, _Decimal32
+ B)
+ -- Runtime Function: _Decimal32 __bid_subsd3 (_Decimal32 A, _Decimal32
+ B)
+ -- Runtime Function: _Decimal64 __dpd_subdd3 (_Decimal64 A, _Decimal64
+ B)
+ -- Runtime Function: _Decimal64 __bid_subdd3 (_Decimal64 A, _Decimal64
+ B)
+ -- Runtime Function: _Decimal128 __dpd_subtd3 (_Decimal128 A,
+ _Decimal128 B)
+ -- Runtime Function: _Decimal128 __bid_subtd3 (_Decimal128 A,
+ _Decimal128 B)
+ These functions return the difference between B and A; that is,
+ A - B.
+
+ -- Runtime Function: _Decimal32 __dpd_mulsd3 (_Decimal32 A, _Decimal32
+ B)
+ -- Runtime Function: _Decimal32 __bid_mulsd3 (_Decimal32 A, _Decimal32
+ B)
+ -- Runtime Function: _Decimal64 __dpd_muldd3 (_Decimal64 A, _Decimal64
+ B)
+ -- Runtime Function: _Decimal64 __bid_muldd3 (_Decimal64 A, _Decimal64
+ B)
+ -- Runtime Function: _Decimal128 __dpd_multd3 (_Decimal128 A,
+ _Decimal128 B)
+ -- Runtime Function: _Decimal128 __bid_multd3 (_Decimal128 A,
+ _Decimal128 B)
+ These functions return the product of A and B.
+
+ -- Runtime Function: _Decimal32 __dpd_divsd3 (_Decimal32 A, _Decimal32
+ B)
+ -- Runtime Function: _Decimal32 __bid_divsd3 (_Decimal32 A, _Decimal32
+ B)
+ -- Runtime Function: _Decimal64 __dpd_divdd3 (_Decimal64 A, _Decimal64
+ B)
+ -- Runtime Function: _Decimal64 __bid_divdd3 (_Decimal64 A, _Decimal64
+ B)
+ -- Runtime Function: _Decimal128 __dpd_divtd3 (_Decimal128 A,
+ _Decimal128 B)
+ -- Runtime Function: _Decimal128 __bid_divtd3 (_Decimal128 A,
+ _Decimal128 B)
+ These functions return the quotient of A and B; that is, A / B.
+
+ -- Runtime Function: _Decimal32 __dpd_negsd2 (_Decimal32 A)
+ -- Runtime Function: _Decimal32 __bid_negsd2 (_Decimal32 A)
+ -- Runtime Function: _Decimal64 __dpd_negdd2 (_Decimal64 A)
+ -- Runtime Function: _Decimal64 __bid_negdd2 (_Decimal64 A)
+ -- Runtime Function: _Decimal128 __dpd_negtd2 (_Decimal128 A)
+ -- Runtime Function: _Decimal128 __bid_negtd2 (_Decimal128 A)
+ These functions return the negation of A. They simply flip the
+ sign bit, so they can produce negative zero and negative NaN.
+
+4.3.2 Conversion functions
+--------------------------
+
+ -- Runtime Function: _Decimal64 __dpd_extendsddd2 (_Decimal32 A)
+ -- Runtime Function: _Decimal64 __bid_extendsddd2 (_Decimal32 A)
+ -- Runtime Function: _Decimal128 __dpd_extendsdtd2 (_Decimal32 A)
+ -- Runtime Function: _Decimal128 __bid_extendsdtd2 (_Decimal32 A)
+ -- Runtime Function: _Decimal128 __dpd_extendddtd2 (_Decimal64 A)
+ -- Runtime Function: _Decimal128 __bid_extendddtd2 (_Decimal64 A)
+ -- Runtime Function: _Decimal32 __dpd_truncddsd2 (_Decimal64 A)
+ -- Runtime Function: _Decimal32 __bid_truncddsd2 (_Decimal64 A)
+ -- Runtime Function: _Decimal32 __dpd_trunctdsd2 (_Decimal128 A)
+ -- Runtime Function: _Decimal32 __bid_trunctdsd2 (_Decimal128 A)
+ -- Runtime Function: _Decimal64 __dpd_trunctddd2 (_Decimal128 A)
+ -- Runtime Function: _Decimal64 __bid_trunctddd2 (_Decimal128 A)
+ These functions convert the value A from one decimal floating type
+ to another.
+
+ -- Runtime Function: _Decimal64 __dpd_extendsfdd (float A)
+ -- Runtime Function: _Decimal64 __bid_extendsfdd (float A)
+ -- Runtime Function: _Decimal128 __dpd_extendsftd (float A)
+ -- Runtime Function: _Decimal128 __bid_extendsftd (float A)
+ -- Runtime Function: _Decimal128 __dpd_extenddftd (double A)
+ -- Runtime Function: _Decimal128 __bid_extenddftd (double A)
+ -- Runtime Function: _Decimal128 __dpd_extendxftd (long double A)
+ -- Runtime Function: _Decimal128 __bid_extendxftd (long double A)
+ -- Runtime Function: _Decimal32 __dpd_truncdfsd (double A)
+ -- Runtime Function: _Decimal32 __bid_truncdfsd (double A)
+ -- Runtime Function: _Decimal32 __dpd_truncxfsd (long double A)
+ -- Runtime Function: _Decimal32 __bid_truncxfsd (long double A)
+ -- Runtime Function: _Decimal32 __dpd_trunctfsd (long double A)
+ -- Runtime Function: _Decimal32 __bid_trunctfsd (long double A)
+ -- Runtime Function: _Decimal64 __dpd_truncxfdd (long double A)
+ -- Runtime Function: _Decimal64 __bid_truncxfdd (long double A)
+ -- Runtime Function: _Decimal64 __dpd_trunctfdd (long double A)
+ -- Runtime Function: _Decimal64 __bid_trunctfdd (long double A)
+ These functions convert the value of A from a binary floating type
+ to a decimal floating type of a different size.
+
+ -- Runtime Function: float __dpd_truncddsf (_Decimal64 A)
+ -- Runtime Function: float __bid_truncddsf (_Decimal64 A)
+ -- Runtime Function: float __dpd_trunctdsf (_Decimal128 A)
+ -- Runtime Function: float __bid_trunctdsf (_Decimal128 A)
+ -- Runtime Function: double __dpd_extendsddf (_Decimal32 A)
+ -- Runtime Function: double __bid_extendsddf (_Decimal32 A)
+ -- Runtime Function: double __dpd_trunctddf (_Decimal128 A)
+ -- Runtime Function: double __bid_trunctddf (_Decimal128 A)
+ -- Runtime Function: long double __dpd_extendsdxf (_Decimal32 A)
+ -- Runtime Function: long double __bid_extendsdxf (_Decimal32 A)
+ -- Runtime Function: long double __dpd_extendddxf (_Decimal64 A)
+ -- Runtime Function: long double __bid_extendddxf (_Decimal64 A)
+ -- Runtime Function: long double __dpd_trunctdxf (_Decimal128 A)
+ -- Runtime Function: long double __bid_trunctdxf (_Decimal128 A)
+ -- Runtime Function: long double __dpd_extendsdtf (_Decimal32 A)
+ -- Runtime Function: long double __bid_extendsdtf (_Decimal32 A)
+ -- Runtime Function: long double __dpd_extendddtf (_Decimal64 A)
+ -- Runtime Function: long double __bid_extendddtf (_Decimal64 A)
+ These functions convert the value of A from a decimal floating type
+ to a binary floating type of a different size.
+
+ -- Runtime Function: _Decimal32 __dpd_extendsfsd (float A)
+ -- Runtime Function: _Decimal32 __bid_extendsfsd (float A)
+ -- Runtime Function: _Decimal64 __dpd_extenddfdd (double A)
+ -- Runtime Function: _Decimal64 __bid_extenddfdd (double A)
+ -- Runtime Function: _Decimal128 __dpd_extendtftd (long double A)
+ -- Runtime Function: _Decimal128 __bid_extendtftd (long double A)
+ -- Runtime Function: float __dpd_truncsdsf (_Decimal32 A)
+ -- Runtime Function: float __bid_truncsdsf (_Decimal32 A)
+ -- Runtime Function: double __dpd_truncdddf (_Decimal64 A)
+ -- Runtime Function: double __bid_truncdddf (_Decimal64 A)
+ -- Runtime Function: long double __dpd_trunctdtf (_Decimal128 A)
+ -- Runtime Function: long double __bid_trunctdtf (_Decimal128 A)
+ These functions convert the value of A between decimal and binary
+ floating types of the same size.
+
+ -- Runtime Function: int __dpd_fixsdsi (_Decimal32 A)
+ -- Runtime Function: int __bid_fixsdsi (_Decimal32 A)
+ -- Runtime Function: int __dpd_fixddsi (_Decimal64 A)
+ -- Runtime Function: int __bid_fixddsi (_Decimal64 A)
+ -- Runtime Function: int __dpd_fixtdsi (_Decimal128 A)
+ -- Runtime Function: int __bid_fixtdsi (_Decimal128 A)
+ These functions convert A to a signed integer.
+
+ -- Runtime Function: long __dpd_fixsddi (_Decimal32 A)
+ -- Runtime Function: long __bid_fixsddi (_Decimal32 A)
+ -- Runtime Function: long __dpd_fixdddi (_Decimal64 A)
+ -- Runtime Function: long __bid_fixdddi (_Decimal64 A)
+ -- Runtime Function: long __dpd_fixtddi (_Decimal128 A)
+ -- Runtime Function: long __bid_fixtddi (_Decimal128 A)
+ These functions convert A to a signed long.
+
+ -- Runtime Function: unsigned int __dpd_fixunssdsi (_Decimal32 A)
+ -- Runtime Function: unsigned int __bid_fixunssdsi (_Decimal32 A)
+ -- Runtime Function: unsigned int __dpd_fixunsddsi (_Decimal64 A)
+ -- Runtime Function: unsigned int __bid_fixunsddsi (_Decimal64 A)
+ -- Runtime Function: unsigned int __dpd_fixunstdsi (_Decimal128 A)
+ -- Runtime Function: unsigned int __bid_fixunstdsi (_Decimal128 A)
+ These functions convert A to an unsigned integer. Negative values
+ all become zero.
+
+ -- Runtime Function: unsigned long __dpd_fixunssddi (_Decimal32 A)
+ -- Runtime Function: unsigned long __bid_fixunssddi (_Decimal32 A)
+ -- Runtime Function: unsigned long __dpd_fixunsdddi (_Decimal64 A)
+ -- Runtime Function: unsigned long __bid_fixunsdddi (_Decimal64 A)
+ -- Runtime Function: unsigned long __dpd_fixunstddi (_Decimal128 A)
+ -- Runtime Function: unsigned long __bid_fixunstddi (_Decimal128 A)
+ These functions convert A to an unsigned long. Negative values
+ all become zero.
+
+ -- Runtime Function: _Decimal32 __dpd_floatsisd (int I)
+ -- Runtime Function: _Decimal32 __bid_floatsisd (int I)
+ -- Runtime Function: _Decimal64 __dpd_floatsidd (int I)
+ -- Runtime Function: _Decimal64 __bid_floatsidd (int I)
+ -- Runtime Function: _Decimal128 __dpd_floatsitd (int I)
+ -- Runtime Function: _Decimal128 __bid_floatsitd (int I)
+ These functions convert I, a signed integer, to decimal floating
+ point.
+
+ -- Runtime Function: _Decimal32 __dpd_floatdisd (long I)
+ -- Runtime Function: _Decimal32 __bid_floatdisd (long I)
+ -- Runtime Function: _Decimal64 __dpd_floatdidd (long I)
+ -- Runtime Function: _Decimal64 __bid_floatdidd (long I)
+ -- Runtime Function: _Decimal128 __dpd_floatditd (long I)
+ -- Runtime Function: _Decimal128 __bid_floatditd (long I)
+ These functions convert I, a signed long, to decimal floating
+ point.
+
+ -- Runtime Function: _Decimal32 __dpd_floatunssisd (unsigned int I)
+ -- Runtime Function: _Decimal32 __bid_floatunssisd (unsigned int I)
+ -- Runtime Function: _Decimal64 __dpd_floatunssidd (unsigned int I)
+ -- Runtime Function: _Decimal64 __bid_floatunssidd (unsigned int I)
+ -- Runtime Function: _Decimal128 __dpd_floatunssitd (unsigned int I)
+ -- Runtime Function: _Decimal128 __bid_floatunssitd (unsigned int I)
+ These functions convert I, an unsigned integer, to decimal
+ floating point.
+
+ -- Runtime Function: _Decimal32 __dpd_floatunsdisd (unsigned long I)
+ -- Runtime Function: _Decimal32 __bid_floatunsdisd (unsigned long I)
+ -- Runtime Function: _Decimal64 __dpd_floatunsdidd (unsigned long I)
+ -- Runtime Function: _Decimal64 __bid_floatunsdidd (unsigned long I)
+ -- Runtime Function: _Decimal128 __dpd_floatunsditd (unsigned long I)
+ -- Runtime Function: _Decimal128 __bid_floatunsditd (unsigned long I)
+ These functions convert I, an unsigned long, to decimal floating
+ point.
+
+4.3.3 Comparison functions
+--------------------------
+
+ -- Runtime Function: int __dpd_unordsd2 (_Decimal32 A, _Decimal32 B)
+ -- Runtime Function: int __bid_unordsd2 (_Decimal32 A, _Decimal32 B)
+ -- Runtime Function: int __dpd_unorddd2 (_Decimal64 A, _Decimal64 B)
+ -- Runtime Function: int __bid_unorddd2 (_Decimal64 A, _Decimal64 B)
+ -- Runtime Function: int __dpd_unordtd2 (_Decimal128 A, _Decimal128 B)
+ -- Runtime Function: int __bid_unordtd2 (_Decimal128 A, _Decimal128 B)
+ These functions return a nonzero value if either argument is NaN,
+ otherwise 0.
+
+ There is also a complete group of higher level functions which
+correspond directly to comparison operators. They implement the ISO C
+semantics for floating-point comparisons, taking NaN into account. Pay
+careful attention to the return values defined for each set. Under the
+hood, all of these routines are implemented as
+
+ if (__bid_unordXd2 (a, b))
+ return E;
+ return __bid_cmpXd2 (a, b);
+
+where E is a constant chosen to give the proper behavior for NaN.
+Thus, the meaning of the return value is different for each set. Do
+not rely on this implementation; only the semantics documented below
+are guaranteed.
+
+ -- Runtime Function: int __dpd_eqsd2 (_Decimal32 A, _Decimal32 B)
+ -- Runtime Function: int __bid_eqsd2 (_Decimal32 A, _Decimal32 B)
+ -- Runtime Function: int __dpd_eqdd2 (_Decimal64 A, _Decimal64 B)
+ -- Runtime Function: int __bid_eqdd2 (_Decimal64 A, _Decimal64 B)
+ -- Runtime Function: int __dpd_eqtd2 (_Decimal128 A, _Decimal128 B)
+ -- Runtime Function: int __bid_eqtd2 (_Decimal128 A, _Decimal128 B)
+ These functions return zero if neither argument is NaN, and A and
+ B are equal.
+
+ -- Runtime Function: int __dpd_nesd2 (_Decimal32 A, _Decimal32 B)
+ -- Runtime Function: int __bid_nesd2 (_Decimal32 A, _Decimal32 B)
+ -- Runtime Function: int __dpd_nedd2 (_Decimal64 A, _Decimal64 B)
+ -- Runtime Function: int __bid_nedd2 (_Decimal64 A, _Decimal64 B)
+ -- Runtime Function: int __dpd_netd2 (_Decimal128 A, _Decimal128 B)
+ -- Runtime Function: int __bid_netd2 (_Decimal128 A, _Decimal128 B)
+ These functions return a nonzero value if either argument is NaN,
+ or if A and B are unequal.
+
+ -- Runtime Function: int __dpd_gesd2 (_Decimal32 A, _Decimal32 B)
+ -- Runtime Function: int __bid_gesd2 (_Decimal32 A, _Decimal32 B)
+ -- Runtime Function: int __dpd_gedd2 (_Decimal64 A, _Decimal64 B)
+ -- Runtime Function: int __bid_gedd2 (_Decimal64 A, _Decimal64 B)
+ -- Runtime Function: int __dpd_getd2 (_Decimal128 A, _Decimal128 B)
+ -- Runtime Function: int __bid_getd2 (_Decimal128 A, _Decimal128 B)
+ These functions return a value greater than or equal to zero if
+ neither argument is NaN, and A is greater than or equal to B.
+
+ -- Runtime Function: int __dpd_ltsd2 (_Decimal32 A, _Decimal32 B)
+ -- Runtime Function: int __bid_ltsd2 (_Decimal32 A, _Decimal32 B)
+ -- Runtime Function: int __dpd_ltdd2 (_Decimal64 A, _Decimal64 B)
+ -- Runtime Function: int __bid_ltdd2 (_Decimal64 A, _Decimal64 B)
+ -- Runtime Function: int __dpd_lttd2 (_Decimal128 A, _Decimal128 B)
+ -- Runtime Function: int __bid_lttd2 (_Decimal128 A, _Decimal128 B)
+ These functions return a value less than zero if neither argument
+ is NaN, and A is strictly less than B.
+
+ -- Runtime Function: int __dpd_lesd2 (_Decimal32 A, _Decimal32 B)
+ -- Runtime Function: int __bid_lesd2 (_Decimal32 A, _Decimal32 B)
+ -- Runtime Function: int __dpd_ledd2 (_Decimal64 A, _Decimal64 B)
+ -- Runtime Function: int __bid_ledd2 (_Decimal64 A, _Decimal64 B)
+ -- Runtime Function: int __dpd_letd2 (_Decimal128 A, _Decimal128 B)
+ -- Runtime Function: int __bid_letd2 (_Decimal128 A, _Decimal128 B)
+ These functions return a value less than or equal to zero if
+ neither argument is NaN, and A is less than or equal to B.
+
+ -- Runtime Function: int __dpd_gtsd2 (_Decimal32 A, _Decimal32 B)
+ -- Runtime Function: int __bid_gtsd2 (_Decimal32 A, _Decimal32 B)
+ -- Runtime Function: int __dpd_gtdd2 (_Decimal64 A, _Decimal64 B)
+ -- Runtime Function: int __bid_gtdd2 (_Decimal64 A, _Decimal64 B)
+ -- Runtime Function: int __dpd_gttd2 (_Decimal128 A, _Decimal128 B)
+ -- Runtime Function: int __bid_gttd2 (_Decimal128 A, _Decimal128 B)
+ These functions return a value greater than zero if neither
+ argument is NaN, and A is strictly greater than B.
+
+
+File: gccint.info, Node: Fixed-point fractional library routines, Next: Exception handling routines, Prev: Decimal float library routines, Up: Libgcc
+
+4.4 Routines for fixed-point fractional emulation
+=================================================
+
+The software fixed-point library implements fixed-point fractional
+arithmetic, and is only activated on selected targets.
+
+ For ease of comprehension `fract' is an alias for the `_Fract' type,
+`accum' an alias for `_Accum', and `sat' an alias for `_Sat'.
+
+ For illustrative purposes, in this section the fixed-point fractional
+type `short fract' is assumed to correspond to machine mode `QQmode';
+`unsigned short fract' to `UQQmode'; `fract' to `HQmode';
+`unsigned fract' to `UHQmode'; `long fract' to `SQmode';
+`unsigned long fract' to `USQmode'; `long long fract' to `DQmode'; and
+`unsigned long long fract' to `UDQmode'. Similarly the fixed-point
+accumulator type `short accum' corresponds to `HAmode';
+`unsigned short accum' to `UHAmode'; `accum' to `SAmode';
+`unsigned accum' to `USAmode'; `long accum' to `DAmode';
+`unsigned long accum' to `UDAmode'; `long long accum' to `TAmode'; and
+`unsigned long long accum' to `UTAmode'.
+
+4.4.1 Arithmetic functions
+--------------------------
+
+ -- Runtime Function: short fract __addqq3 (short fract A, short fract
+ B)
+ -- Runtime Function: fract __addhq3 (fract A, fract B)
+ -- Runtime Function: long fract __addsq3 (long fract A, long fract B)
+ -- Runtime Function: long long fract __adddq3 (long long fract A, long
+ long fract B)
+ -- Runtime Function: unsigned short fract __adduqq3 (unsigned short
+ fract A, unsigned short fract B)
+ -- Runtime Function: unsigned fract __adduhq3 (unsigned fract A,
+ unsigned fract B)
+ -- Runtime Function: unsigned long fract __addusq3 (unsigned long
+ fract A, unsigned long fract B)
+ -- Runtime Function: unsigned long long fract __addudq3 (unsigned long
+ long fract A, unsigned long long fract B)
+ -- Runtime Function: short accum __addha3 (short accum A, short accum
+ B)
+ -- Runtime Function: accum __addsa3 (accum A, accum B)
+ -- Runtime Function: long accum __addda3 (long accum A, long accum B)
+ -- Runtime Function: long long accum __addta3 (long long accum A, long
+ long accum B)
+ -- Runtime Function: unsigned short accum __adduha3 (unsigned short
+ accum A, unsigned short accum B)
+ -- Runtime Function: unsigned accum __addusa3 (unsigned accum A,
+ unsigned accum B)
+ -- Runtime Function: unsigned long accum __adduda3 (unsigned long
+ accum A, unsigned long accum B)
+ -- Runtime Function: unsigned long long accum __adduta3 (unsigned long
+ long accum A, unsigned long long accum B)
+ These functions return the sum of A and B.
+
+ -- Runtime Function: short fract __ssaddqq3 (short fract A, short
+ fract B)
+ -- Runtime Function: fract __ssaddhq3 (fract A, fract B)
+ -- Runtime Function: long fract __ssaddsq3 (long fract A, long fract B)
+ -- Runtime Function: long long fract __ssadddq3 (long long fract A,
+ long long fract B)
+ -- Runtime Function: short accum __ssaddha3 (short accum A, short
+ accum B)
+ -- Runtime Function: accum __ssaddsa3 (accum A, accum B)
+ -- Runtime Function: long accum __ssaddda3 (long accum A, long accum B)
+ -- Runtime Function: long long accum __ssaddta3 (long long accum A,
+ long long accum B)
+ These functions return the sum of A and B with signed saturation.
+
+ -- Runtime Function: unsigned short fract __usadduqq3 (unsigned short
+ fract A, unsigned short fract B)
+ -- Runtime Function: unsigned fract __usadduhq3 (unsigned fract A,
+ unsigned fract B)
+ -- Runtime Function: unsigned long fract __usaddusq3 (unsigned long
+ fract A, unsigned long fract B)
+ -- Runtime Function: unsigned long long fract __usaddudq3 (unsigned
+ long long fract A, unsigned long long fract B)
+ -- Runtime Function: unsigned short accum __usadduha3 (unsigned short
+ accum A, unsigned short accum B)
+ -- Runtime Function: unsigned accum __usaddusa3 (unsigned accum A,
+ unsigned accum B)
+ -- Runtime Function: unsigned long accum __usadduda3 (unsigned long
+ accum A, unsigned long accum B)
+ -- Runtime Function: unsigned long long accum __usadduta3 (unsigned
+ long long accum A, unsigned long long accum B)
+ These functions return the sum of A and B with unsigned saturation.
+
+ -- Runtime Function: short fract __subqq3 (short fract A, short fract
+ B)
+ -- Runtime Function: fract __subhq3 (fract A, fract B)
+ -- Runtime Function: long fract __subsq3 (long fract A, long fract B)
+ -- Runtime Function: long long fract __subdq3 (long long fract A, long
+ long fract B)
+ -- Runtime Function: unsigned short fract __subuqq3 (unsigned short
+ fract A, unsigned short fract B)
+ -- Runtime Function: unsigned fract __subuhq3 (unsigned fract A,
+ unsigned fract B)
+ -- Runtime Function: unsigned long fract __subusq3 (unsigned long
+ fract A, unsigned long fract B)
+ -- Runtime Function: unsigned long long fract __subudq3 (unsigned long
+ long fract A, unsigned long long fract B)
+ -- Runtime Function: short accum __subha3 (short accum A, short accum
+ B)
+ -- Runtime Function: accum __subsa3 (accum A, accum B)
+ -- Runtime Function: long accum __subda3 (long accum A, long accum B)
+ -- Runtime Function: long long accum __subta3 (long long accum A, long
+ long accum B)
+ -- Runtime Function: unsigned short accum __subuha3 (unsigned short
+ accum A, unsigned short accum B)
+ -- Runtime Function: unsigned accum __subusa3 (unsigned accum A,
+ unsigned accum B)
+ -- Runtime Function: unsigned long accum __subuda3 (unsigned long
+ accum A, unsigned long accum B)
+ -- Runtime Function: unsigned long long accum __subuta3 (unsigned long
+ long accum A, unsigned long long accum B)
+ These functions return the difference of A and B; that is, `A - B'.
+
+ -- Runtime Function: short fract __sssubqq3 (short fract A, short
+ fract B)
+ -- Runtime Function: fract __sssubhq3 (fract A, fract B)
+ -- Runtime Function: long fract __sssubsq3 (long fract A, long fract B)
+ -- Runtime Function: long long fract __sssubdq3 (long long fract A,
+ long long fract B)
+ -- Runtime Function: short accum __sssubha3 (short accum A, short
+ accum B)
+ -- Runtime Function: accum __sssubsa3 (accum A, accum B)
+ -- Runtime Function: long accum __sssubda3 (long accum A, long accum B)
+ -- Runtime Function: long long accum __sssubta3 (long long accum A,
+ long long accum B)
+ These functions return the difference of A and B with signed
+ saturation; that is, `A - B'.
+
+ -- Runtime Function: unsigned short fract __ussubuqq3 (unsigned short
+ fract A, unsigned short fract B)
+ -- Runtime Function: unsigned fract __ussubuhq3 (unsigned fract A,
+ unsigned fract B)
+ -- Runtime Function: unsigned long fract __ussubusq3 (unsigned long
+ fract A, unsigned long fract B)
+ -- Runtime Function: unsigned long long fract __ussubudq3 (unsigned
+ long long fract A, unsigned long long fract B)
+ -- Runtime Function: unsigned short accum __ussubuha3 (unsigned short
+ accum A, unsigned short accum B)
+ -- Runtime Function: unsigned accum __ussubusa3 (unsigned accum A,
+ unsigned accum B)
+ -- Runtime Function: unsigned long accum __ussubuda3 (unsigned long
+ accum A, unsigned long accum B)
+ -- Runtime Function: unsigned long long accum __ussubuta3 (unsigned
+ long long accum A, unsigned long long accum B)
+ These functions return the difference of A and B with unsigned
+ saturation; that is, `A - B'.
+
+ -- Runtime Function: short fract __mulqq3 (short fract A, short fract
+ B)
+ -- Runtime Function: fract __mulhq3 (fract A, fract B)
+ -- Runtime Function: long fract __mulsq3 (long fract A, long fract B)
+ -- Runtime Function: long long fract __muldq3 (long long fract A, long
+ long fract B)
+ -- Runtime Function: unsigned short fract __muluqq3 (unsigned short
+ fract A, unsigned short fract B)
+ -- Runtime Function: unsigned fract __muluhq3 (unsigned fract A,
+ unsigned fract B)
+ -- Runtime Function: unsigned long fract __mulusq3 (unsigned long
+ fract A, unsigned long fract B)
+ -- Runtime Function: unsigned long long fract __muludq3 (unsigned long
+ long fract A, unsigned long long fract B)
+ -- Runtime Function: short accum __mulha3 (short accum A, short accum
+ B)
+ -- Runtime Function: accum __mulsa3 (accum A, accum B)
+ -- Runtime Function: long accum __mulda3 (long accum A, long accum B)
+ -- Runtime Function: long long accum __multa3 (long long accum A, long
+ long accum B)
+ -- Runtime Function: unsigned short accum __muluha3 (unsigned short
+ accum A, unsigned short accum B)
+ -- Runtime Function: unsigned accum __mulusa3 (unsigned accum A,
+ unsigned accum B)
+ -- Runtime Function: unsigned long accum __muluda3 (unsigned long
+ accum A, unsigned long accum B)
+ -- Runtime Function: unsigned long long accum __muluta3 (unsigned long
+ long accum A, unsigned long long accum B)
+ These functions return the product of A and B.
+
+ -- Runtime Function: short fract __ssmulqq3 (short fract A, short
+ fract B)
+ -- Runtime Function: fract __ssmulhq3 (fract A, fract B)
+ -- Runtime Function: long fract __ssmulsq3 (long fract A, long fract B)
+ -- Runtime Function: long long fract __ssmuldq3 (long long fract A,
+ long long fract B)
+ -- Runtime Function: short accum __ssmulha3 (short accum A, short
+ accum B)
+ -- Runtime Function: accum __ssmulsa3 (accum A, accum B)
+ -- Runtime Function: long accum __ssmulda3 (long accum A, long accum B)
+ -- Runtime Function: long long accum __ssmulta3 (long long accum A,
+ long long accum B)
+ These functions return the product of A and B with signed
+ saturation.
+
+ -- Runtime Function: unsigned short fract __usmuluqq3 (unsigned short
+ fract A, unsigned short fract B)
+ -- Runtime Function: unsigned fract __usmuluhq3 (unsigned fract A,
+ unsigned fract B)
+ -- Runtime Function: unsigned long fract __usmulusq3 (unsigned long
+ fract A, unsigned long fract B)
+ -- Runtime Function: unsigned long long fract __usmuludq3 (unsigned
+ long long fract A, unsigned long long fract B)
+ -- Runtime Function: unsigned short accum __usmuluha3 (unsigned short
+ accum A, unsigned short accum B)
+ -- Runtime Function: unsigned accum __usmulusa3 (unsigned accum A,
+ unsigned accum B)
+ -- Runtime Function: unsigned long accum __usmuluda3 (unsigned long
+ accum A, unsigned long accum B)
+ -- Runtime Function: unsigned long long accum __usmuluta3 (unsigned
+ long long accum A, unsigned long long accum B)
+ These functions return the product of A and B with unsigned
+ saturation.
+
+ -- Runtime Function: short fract __divqq3 (short fract A, short fract
+ B)
+ -- Runtime Function: fract __divhq3 (fract A, fract B)
+ -- Runtime Function: long fract __divsq3 (long fract A, long fract B)
+ -- Runtime Function: long long fract __divdq3 (long long fract A, long
+ long fract B)
+ -- Runtime Function: short accum __divha3 (short accum A, short accum
+ B)
+ -- Runtime Function: accum __divsa3 (accum A, accum B)
+ -- Runtime Function: long accum __divda3 (long accum A, long accum B)
+ -- Runtime Function: long long accum __divta3 (long long accum A, long
+ long accum B)
+ These functions return the quotient of the signed division of A
+ and B.
+
+ -- Runtime Function: unsigned short fract __udivuqq3 (unsigned short
+ fract A, unsigned short fract B)
+ -- Runtime Function: unsigned fract __udivuhq3 (unsigned fract A,
+ unsigned fract B)
+ -- Runtime Function: unsigned long fract __udivusq3 (unsigned long
+ fract A, unsigned long fract B)
+ -- Runtime Function: unsigned long long fract __udivudq3 (unsigned
+ long long fract A, unsigned long long fract B)
+ -- Runtime Function: unsigned short accum __udivuha3 (unsigned short
+ accum A, unsigned short accum B)
+ -- Runtime Function: unsigned accum __udivusa3 (unsigned accum A,
+ unsigned accum B)
+ -- Runtime Function: unsigned long accum __udivuda3 (unsigned long
+ accum A, unsigned long accum B)
+ -- Runtime Function: unsigned long long accum __udivuta3 (unsigned
+ long long accum A, unsigned long long accum B)
+ These functions return the quotient of the unsigned division of A
+ and B.
+
+ -- Runtime Function: short fract __ssdivqq3 (short fract A, short
+ fract B)
+ -- Runtime Function: fract __ssdivhq3 (fract A, fract B)
+ -- Runtime Function: long fract __ssdivsq3 (long fract A, long fract B)
+ -- Runtime Function: long long fract __ssdivdq3 (long long fract A,
+ long long fract B)
+ -- Runtime Function: short accum __ssdivha3 (short accum A, short
+ accum B)
+ -- Runtime Function: accum __ssdivsa3 (accum A, accum B)
+ -- Runtime Function: long accum __ssdivda3 (long accum A, long accum B)
+ -- Runtime Function: long long accum __ssdivta3 (long long accum A,
+ long long accum B)
+ These functions return the quotient of the signed division of A
+ and B with signed saturation.
+
+ -- Runtime Function: unsigned short fract __usdivuqq3 (unsigned short
+ fract A, unsigned short fract B)
+ -- Runtime Function: unsigned fract __usdivuhq3 (unsigned fract A,
+ unsigned fract B)
+ -- Runtime Function: unsigned long fract __usdivusq3 (unsigned long
+ fract A, unsigned long fract B)
+ -- Runtime Function: unsigned long long fract __usdivudq3 (unsigned
+ long long fract A, unsigned long long fract B)
+ -- Runtime Function: unsigned short accum __usdivuha3 (unsigned short
+ accum A, unsigned short accum B)
+ -- Runtime Function: unsigned accum __usdivusa3 (unsigned accum A,
+ unsigned accum B)
+ -- Runtime Function: unsigned long accum __usdivuda3 (unsigned long
+ accum A, unsigned long accum B)
+ -- Runtime Function: unsigned long long accum __usdivuta3 (unsigned
+ long long accum A, unsigned long long accum B)
+ These functions return the quotient of the unsigned division of A
+ and B with unsigned saturation.
+
+ -- Runtime Function: short fract __negqq2 (short fract A)
+ -- Runtime Function: fract __neghq2 (fract A)
+ -- Runtime Function: long fract __negsq2 (long fract A)
+ -- Runtime Function: long long fract __negdq2 (long long fract A)
+ -- Runtime Function: unsigned short fract __neguqq2 (unsigned short
+ fract A)
+ -- Runtime Function: unsigned fract __neguhq2 (unsigned fract A)
+ -- Runtime Function: unsigned long fract __negusq2 (unsigned long
+ fract A)
+ -- Runtime Function: unsigned long long fract __negudq2 (unsigned long
+ long fract A)
+ -- Runtime Function: short accum __negha2 (short accum A)
+ -- Runtime Function: accum __negsa2 (accum A)
+ -- Runtime Function: long accum __negda2 (long accum A)
+ -- Runtime Function: long long accum __negta2 (long long accum A)
+ -- Runtime Function: unsigned short accum __neguha2 (unsigned short
+ accum A)
+ -- Runtime Function: unsigned accum __negusa2 (unsigned accum A)
+ -- Runtime Function: unsigned long accum __neguda2 (unsigned long
+ accum A)
+ -- Runtime Function: unsigned long long accum __neguta2 (unsigned long
+ long accum A)
+ These functions return the negation of A.
+
+ -- Runtime Function: short fract __ssnegqq2 (short fract A)
+ -- Runtime Function: fract __ssneghq2 (fract A)
+ -- Runtime Function: long fract __ssnegsq2 (long fract A)
+ -- Runtime Function: long long fract __ssnegdq2 (long long fract A)
+ -- Runtime Function: short accum __ssnegha2 (short accum A)
+ -- Runtime Function: accum __ssnegsa2 (accum A)
+ -- Runtime Function: long accum __ssnegda2 (long accum A)
+ -- Runtime Function: long long accum __ssnegta2 (long long accum A)
+ These functions return the negation of A with signed saturation.
+
+ -- Runtime Function: unsigned short fract __usneguqq2 (unsigned short
+ fract A)
+ -- Runtime Function: unsigned fract __usneguhq2 (unsigned fract A)
+ -- Runtime Function: unsigned long fract __usnegusq2 (unsigned long
+ fract A)
+ -- Runtime Function: unsigned long long fract __usnegudq2 (unsigned
+ long long fract A)
+ -- Runtime Function: unsigned short accum __usneguha2 (unsigned short
+ accum A)
+ -- Runtime Function: unsigned accum __usnegusa2 (unsigned accum A)
+ -- Runtime Function: unsigned long accum __usneguda2 (unsigned long
+ accum A)
+ -- Runtime Function: unsigned long long accum __usneguta2 (unsigned
+ long long accum A)
+ These functions return the negation of A with unsigned saturation.
+
+ -- Runtime Function: short fract __ashlqq3 (short fract A, int B)
+ -- Runtime Function: fract __ashlhq3 (fract A, int B)
+ -- Runtime Function: long fract __ashlsq3 (long fract A, int B)
+ -- Runtime Function: long long fract __ashldq3 (long long fract A, int
+ B)
+ -- Runtime Function: unsigned short fract __ashluqq3 (unsigned short
+ fract A, int B)
+ -- Runtime Function: unsigned fract __ashluhq3 (unsigned fract A, int
+ B)
+ -- Runtime Function: unsigned long fract __ashlusq3 (unsigned long
+ fract A, int B)
+ -- Runtime Function: unsigned long long fract __ashludq3 (unsigned
+ long long fract A, int B)
+ -- Runtime Function: short accum __ashlha3 (short accum A, int B)
+ -- Runtime Function: accum __ashlsa3 (accum A, int B)
+ -- Runtime Function: long accum __ashlda3 (long accum A, int B)
+ -- Runtime Function: long long accum __ashlta3 (long long accum A, int
+ B)
+ -- Runtime Function: unsigned short accum __ashluha3 (unsigned short
+ accum A, int B)
+ -- Runtime Function: unsigned accum __ashlusa3 (unsigned accum A, int
+ B)
+ -- Runtime Function: unsigned long accum __ashluda3 (unsigned long
+ accum A, int B)
+ -- Runtime Function: unsigned long long accum __ashluta3 (unsigned
+ long long accum A, int B)
+ These functions return the result of shifting A left by B bits.
+
+ -- Runtime Function: short fract __ashrqq3 (short fract A, int B)
+ -- Runtime Function: fract __ashrhq3 (fract A, int B)
+ -- Runtime Function: long fract __ashrsq3 (long fract A, int B)
+ -- Runtime Function: long long fract __ashrdq3 (long long fract A, int
+ B)
+ -- Runtime Function: short accum __ashrha3 (short accum A, int B)
+ -- Runtime Function: accum __ashrsa3 (accum A, int B)
+ -- Runtime Function: long accum __ashrda3 (long accum A, int B)
+ -- Runtime Function: long long accum __ashrta3 (long long accum A, int
+ B)
+ These functions return the result of arithmetically shifting A
+ right by B bits.
+
+ -- Runtime Function: unsigned short fract __lshruqq3 (unsigned short
+ fract A, int B)
+ -- Runtime Function: unsigned fract __lshruhq3 (unsigned fract A, int
+ B)
+ -- Runtime Function: unsigned long fract __lshrusq3 (unsigned long
+ fract A, int B)
+ -- Runtime Function: unsigned long long fract __lshrudq3 (unsigned
+ long long fract A, int B)
+ -- Runtime Function: unsigned short accum __lshruha3 (unsigned short
+ accum A, int B)
+ -- Runtime Function: unsigned accum __lshrusa3 (unsigned accum A, int
+ B)
+ -- Runtime Function: unsigned long accum __lshruda3 (unsigned long
+ accum A, int B)
+ -- Runtime Function: unsigned long long accum __lshruta3 (unsigned
+ long long accum A, int B)
+ These functions return the result of logically shifting A right by
+ B bits.
+
+ -- Runtime Function: fract __ssashlhq3 (fract A, int B)
+ -- Runtime Function: long fract __ssashlsq3 (long fract A, int B)
+ -- Runtime Function: long long fract __ssashldq3 (long long fract A,
+ int B)
+ -- Runtime Function: short accum __ssashlha3 (short accum A, int B)
+ -- Runtime Function: accum __ssashlsa3 (accum A, int B)
+ -- Runtime Function: long accum __ssashlda3 (long accum A, int B)
+ -- Runtime Function: long long accum __ssashlta3 (long long accum A,
+ int B)
+ These functions return the result of shifting A left by B bits
+ with signed saturation.
+
+ -- Runtime Function: unsigned short fract __usashluqq3 (unsigned short
+ fract A, int B)
+ -- Runtime Function: unsigned fract __usashluhq3 (unsigned fract A,
+ int B)
+ -- Runtime Function: unsigned long fract __usashlusq3 (unsigned long
+ fract A, int B)
+ -- Runtime Function: unsigned long long fract __usashludq3 (unsigned
+ long long fract A, int B)
+ -- Runtime Function: unsigned short accum __usashluha3 (unsigned short
+ accum A, int B)
+ -- Runtime Function: unsigned accum __usashlusa3 (unsigned accum A,
+ int B)
+ -- Runtime Function: unsigned long accum __usashluda3 (unsigned long
+ accum A, int B)
+ -- Runtime Function: unsigned long long accum __usashluta3 (unsigned
+ long long accum A, int B)
+ These functions return the result of shifting A left by B bits
+ with unsigned saturation.
+
+4.4.2 Comparison functions
+--------------------------
+
+The following functions implement fixed-point comparisons. These
+functions implement a low-level compare, upon which the higher level
+comparison operators (such as less than and greater than or equal to)
+can be constructed. The returned values lie in the range zero to two,
+to allow the high-level operators to be implemented by testing the
+returned result using either signed or unsigned comparison.
+
+ -- Runtime Function: int __cmpqq2 (short fract A, short fract B)
+ -- Runtime Function: int __cmphq2 (fract A, fract B)
+ -- Runtime Function: int __cmpsq2 (long fract A, long fract B)
+ -- Runtime Function: int __cmpdq2 (long long fract A, long long fract
+ B)
+ -- Runtime Function: int __cmpuqq2 (unsigned short fract A, unsigned
+ short fract B)
+ -- Runtime Function: int __cmpuhq2 (unsigned fract A, unsigned fract B)
+ -- Runtime Function: int __cmpusq2 (unsigned long fract A, unsigned
+ long fract B)
+ -- Runtime Function: int __cmpudq2 (unsigned long long fract A,
+ unsigned long long fract B)
+ -- Runtime Function: int __cmpha2 (short accum A, short accum B)
+ -- Runtime Function: int __cmpsa2 (accum A, accum B)
+ -- Runtime Function: int __cmpda2 (long accum A, long accum B)
+ -- Runtime Function: int __cmpta2 (long long accum A, long long accum
+ B)
+ -- Runtime Function: int __cmpuha2 (unsigned short accum A, unsigned
+ short accum B)
+ -- Runtime Function: int __cmpusa2 (unsigned accum A, unsigned accum B)
+ -- Runtime Function: int __cmpuda2 (unsigned long accum A, unsigned
+ long accum B)
+ -- Runtime Function: int __cmputa2 (unsigned long long accum A,
+ unsigned long long accum B)
+ These functions perform a signed or unsigned comparison of A and B
+ (depending on the selected machine mode). If A is less than B,
+ they return 0; if A is greater than B, they return 2; and if A and
+ B are equal they return 1.
+
+4.4.3 Conversion functions
+--------------------------
+
+ -- Runtime Function: fract __fractqqhq2 (short fract A)
+ -- Runtime Function: long fract __fractqqsq2 (short fract A)
+ -- Runtime Function: long long fract __fractqqdq2 (short fract A)
+ -- Runtime Function: short accum __fractqqha (short fract A)
+ -- Runtime Function: accum __fractqqsa (short fract A)
+ -- Runtime Function: long accum __fractqqda (short fract A)
+ -- Runtime Function: long long accum __fractqqta (short fract A)
+ -- Runtime Function: unsigned short fract __fractqquqq (short fract A)
+ -- Runtime Function: unsigned fract __fractqquhq (short fract A)
+ -- Runtime Function: unsigned long fract __fractqqusq (short fract A)
+ -- Runtime Function: unsigned long long fract __fractqqudq (short
+ fract A)
+ -- Runtime Function: unsigned short accum __fractqquha (short fract A)
+ -- Runtime Function: unsigned accum __fractqqusa (short fract A)
+ -- Runtime Function: unsigned long accum __fractqquda (short fract A)
+ -- Runtime Function: unsigned long long accum __fractqquta (short
+ fract A)
+ -- Runtime Function: signed char __fractqqqi (short fract A)
+ -- Runtime Function: short __fractqqhi (short fract A)
+ -- Runtime Function: int __fractqqsi (short fract A)
+ -- Runtime Function: long __fractqqdi (short fract A)
+ -- Runtime Function: long long __fractqqti (short fract A)
+ -- Runtime Function: float __fractqqsf (short fract A)
+ -- Runtime Function: double __fractqqdf (short fract A)
+ -- Runtime Function: short fract __fracthqqq2 (fract A)
+ -- Runtime Function: long fract __fracthqsq2 (fract A)
+ -- Runtime Function: long long fract __fracthqdq2 (fract A)
+ -- Runtime Function: short accum __fracthqha (fract A)
+ -- Runtime Function: accum __fracthqsa (fract A)
+ -- Runtime Function: long accum __fracthqda (fract A)
+ -- Runtime Function: long long accum __fracthqta (fract A)
+ -- Runtime Function: unsigned short fract __fracthquqq (fract A)
+ -- Runtime Function: unsigned fract __fracthquhq (fract A)
+ -- Runtime Function: unsigned long fract __fracthqusq (fract A)
+ -- Runtime Function: unsigned long long fract __fracthqudq (fract A)
+ -- Runtime Function: unsigned short accum __fracthquha (fract A)
+ -- Runtime Function: unsigned accum __fracthqusa (fract A)
+ -- Runtime Function: unsigned long accum __fracthquda (fract A)
+ -- Runtime Function: unsigned long long accum __fracthquta (fract A)
+ -- Runtime Function: signed char __fracthqqi (fract A)
+ -- Runtime Function: short __fracthqhi (fract A)
+ -- Runtime Function: int __fracthqsi (fract A)
+ -- Runtime Function: long __fracthqdi (fract A)
+ -- Runtime Function: long long __fracthqti (fract A)
+ -- Runtime Function: float __fracthqsf (fract A)
+ -- Runtime Function: double __fracthqdf (fract A)
+ -- Runtime Function: short fract __fractsqqq2 (long fract A)
+ -- Runtime Function: fract __fractsqhq2 (long fract A)
+ -- Runtime Function: long long fract __fractsqdq2 (long fract A)
+ -- Runtime Function: short accum __fractsqha (long fract A)
+ -- Runtime Function: accum __fractsqsa (long fract A)
+ -- Runtime Function: long accum __fractsqda (long fract A)
+ -- Runtime Function: long long accum __fractsqta (long fract A)
+ -- Runtime Function: unsigned short fract __fractsquqq (long fract A)
+ -- Runtime Function: unsigned fract __fractsquhq (long fract A)
+ -- Runtime Function: unsigned long fract __fractsqusq (long fract A)
+ -- Runtime Function: unsigned long long fract __fractsqudq (long fract
+ A)
+ -- Runtime Function: unsigned short accum __fractsquha (long fract A)
+ -- Runtime Function: unsigned accum __fractsqusa (long fract A)
+ -- Runtime Function: unsigned long accum __fractsquda (long fract A)
+ -- Runtime Function: unsigned long long accum __fractsquta (long fract
+ A)
+ -- Runtime Function: signed char __fractsqqi (long fract A)
+ -- Runtime Function: short __fractsqhi (long fract A)
+ -- Runtime Function: int __fractsqsi (long fract A)
+ -- Runtime Function: long __fractsqdi (long fract A)
+ -- Runtime Function: long long __fractsqti (long fract A)
+ -- Runtime Function: float __fractsqsf (long fract A)
+ -- Runtime Function: double __fractsqdf (long fract A)
+ -- Runtime Function: short fract __fractdqqq2 (long long fract A)
+ -- Runtime Function: fract __fractdqhq2 (long long fract A)
+ -- Runtime Function: long fract __fractdqsq2 (long long fract A)
+ -- Runtime Function: short accum __fractdqha (long long fract A)
+ -- Runtime Function: accum __fractdqsa (long long fract A)
+ -- Runtime Function: long accum __fractdqda (long long fract A)
+ -- Runtime Function: long long accum __fractdqta (long long fract A)
+ -- Runtime Function: unsigned short fract __fractdquqq (long long
+ fract A)
+ -- Runtime Function: unsigned fract __fractdquhq (long long fract A)
+ -- Runtime Function: unsigned long fract __fractdqusq (long long fract
+ A)
+ -- Runtime Function: unsigned long long fract __fractdqudq (long long
+ fract A)
+ -- Runtime Function: unsigned short accum __fractdquha (long long
+ fract A)
+ -- Runtime Function: unsigned accum __fractdqusa (long long fract A)
+ -- Runtime Function: unsigned long accum __fractdquda (long long fract
+ A)
+ -- Runtime Function: unsigned long long accum __fractdquta (long long
+ fract A)
+ -- Runtime Function: signed char __fractdqqi (long long fract A)
+ -- Runtime Function: short __fractdqhi (long long fract A)
+ -- Runtime Function: int __fractdqsi (long long fract A)
+ -- Runtime Function: long __fractdqdi (long long fract A)
+ -- Runtime Function: long long __fractdqti (long long fract A)
+ -- Runtime Function: float __fractdqsf (long long fract A)
+ -- Runtime Function: double __fractdqdf (long long fract A)
+ -- Runtime Function: short fract __fracthaqq (short accum A)
+ -- Runtime Function: fract __fracthahq (short accum A)
+ -- Runtime Function: long fract __fracthasq (short accum A)
+ -- Runtime Function: long long fract __fracthadq (short accum A)
+ -- Runtime Function: accum __fracthasa2 (short accum A)
+ -- Runtime Function: long accum __fracthada2 (short accum A)
+ -- Runtime Function: long long accum __fracthata2 (short accum A)
+ -- Runtime Function: unsigned short fract __fracthauqq (short accum A)
+ -- Runtime Function: unsigned fract __fracthauhq (short accum A)
+ -- Runtime Function: unsigned long fract __fracthausq (short accum A)
+ -- Runtime Function: unsigned long long fract __fracthaudq (short
+ accum A)
+ -- Runtime Function: unsigned short accum __fracthauha (short accum A)
+ -- Runtime Function: unsigned accum __fracthausa (short accum A)
+ -- Runtime Function: unsigned long accum __fracthauda (short accum A)
+ -- Runtime Function: unsigned long long accum __fracthauta (short
+ accum A)
+ -- Runtime Function: signed char __fracthaqi (short accum A)
+ -- Runtime Function: short __fracthahi (short accum A)
+ -- Runtime Function: int __fracthasi (short accum A)
+ -- Runtime Function: long __fracthadi (short accum A)
+ -- Runtime Function: long long __fracthati (short accum A)
+ -- Runtime Function: float __fracthasf (short accum A)
+ -- Runtime Function: double __fracthadf (short accum A)
+ -- Runtime Function: short fract __fractsaqq (accum A)
+ -- Runtime Function: fract __fractsahq (accum A)
+ -- Runtime Function: long fract __fractsasq (accum A)
+ -- Runtime Function: long long fract __fractsadq (accum A)
+ -- Runtime Function: short accum __fractsaha2 (accum A)
+ -- Runtime Function: long accum __fractsada2 (accum A)
+ -- Runtime Function: long long accum __fractsata2 (accum A)
+ -- Runtime Function: unsigned short fract __fractsauqq (accum A)
+ -- Runtime Function: unsigned fract __fractsauhq (accum A)
+ -- Runtime Function: unsigned long fract __fractsausq (accum A)
+ -- Runtime Function: unsigned long long fract __fractsaudq (accum A)
+ -- Runtime Function: unsigned short accum __fractsauha (accum A)
+ -- Runtime Function: unsigned accum __fractsausa (accum A)
+ -- Runtime Function: unsigned long accum __fractsauda (accum A)
+ -- Runtime Function: unsigned long long accum __fractsauta (accum A)
+ -- Runtime Function: signed char __fractsaqi (accum A)
+ -- Runtime Function: short __fractsahi (accum A)
+ -- Runtime Function: int __fractsasi (accum A)
+ -- Runtime Function: long __fractsadi (accum A)
+ -- Runtime Function: long long __fractsati (accum A)
+ -- Runtime Function: float __fractsasf (accum A)
+ -- Runtime Function: double __fractsadf (accum A)
+ -- Runtime Function: short fract __fractdaqq (long accum A)
+ -- Runtime Function: fract __fractdahq (long accum A)
+ -- Runtime Function: long fract __fractdasq (long accum A)
+ -- Runtime Function: long long fract __fractdadq (long accum A)
+ -- Runtime Function: short accum __fractdaha2 (long accum A)
+ -- Runtime Function: accum __fractdasa2 (long accum A)
+ -- Runtime Function: long long accum __fractdata2 (long accum A)
+ -- Runtime Function: unsigned short fract __fractdauqq (long accum A)
+ -- Runtime Function: unsigned fract __fractdauhq (long accum A)
+ -- Runtime Function: unsigned long fract __fractdausq (long accum A)
+ -- Runtime Function: unsigned long long fract __fractdaudq (long accum
+ A)
+ -- Runtime Function: unsigned short accum __fractdauha (long accum A)
+ -- Runtime Function: unsigned accum __fractdausa (long accum A)
+ -- Runtime Function: unsigned long accum __fractdauda (long accum A)
+ -- Runtime Function: unsigned long long accum __fractdauta (long accum
+ A)
+ -- Runtime Function: signed char __fractdaqi (long accum A)
+ -- Runtime Function: short __fractdahi (long accum A)
+ -- Runtime Function: int __fractdasi (long accum A)
+ -- Runtime Function: long __fractdadi (long accum A)
+ -- Runtime Function: long long __fractdati (long accum A)
+ -- Runtime Function: float __fractdasf (long accum A)
+ -- Runtime Function: double __fractdadf (long accum A)
+ -- Runtime Function: short fract __fracttaqq (long long accum A)
+ -- Runtime Function: fract __fracttahq (long long accum A)
+ -- Runtime Function: long fract __fracttasq (long long accum A)
+ -- Runtime Function: long long fract __fracttadq (long long accum A)
+ -- Runtime Function: short accum __fracttaha2 (long long accum A)
+ -- Runtime Function: accum __fracttasa2 (long long accum A)
+ -- Runtime Function: long accum __fracttada2 (long long accum A)
+ -- Runtime Function: unsigned short fract __fracttauqq (long long
+ accum A)
+ -- Runtime Function: unsigned fract __fracttauhq (long long accum A)
+ -- Runtime Function: unsigned long fract __fracttausq (long long accum
+ A)
+ -- Runtime Function: unsigned long long fract __fracttaudq (long long
+ accum A)
+ -- Runtime Function: unsigned short accum __fracttauha (long long
+ accum A)
+ -- Runtime Function: unsigned accum __fracttausa (long long accum A)
+ -- Runtime Function: unsigned long accum __fracttauda (long long accum
+ A)
+ -- Runtime Function: unsigned long long accum __fracttauta (long long
+ accum A)
+ -- Runtime Function: signed char __fracttaqi (long long accum A)
+ -- Runtime Function: short __fracttahi (long long accum A)
+ -- Runtime Function: int __fracttasi (long long accum A)
+ -- Runtime Function: long __fracttadi (long long accum A)
+ -- Runtime Function: long long __fracttati (long long accum A)
+ -- Runtime Function: float __fracttasf (long long accum A)
+ -- Runtime Function: double __fracttadf (long long accum A)
+ -- Runtime Function: short fract __fractuqqqq (unsigned short fract A)
+ -- Runtime Function: fract __fractuqqhq (unsigned short fract A)
+ -- Runtime Function: long fract __fractuqqsq (unsigned short fract A)
+ -- Runtime Function: long long fract __fractuqqdq (unsigned short
+ fract A)
+ -- Runtime Function: short accum __fractuqqha (unsigned short fract A)
+ -- Runtime Function: accum __fractuqqsa (unsigned short fract A)
+ -- Runtime Function: long accum __fractuqqda (unsigned short fract A)
+ -- Runtime Function: long long accum __fractuqqta (unsigned short
+ fract A)
+ -- Runtime Function: unsigned fract __fractuqquhq2 (unsigned short
+ fract A)
+ -- Runtime Function: unsigned long fract __fractuqqusq2 (unsigned
+ short fract A)
+ -- Runtime Function: unsigned long long fract __fractuqqudq2 (unsigned
+ short fract A)
+ -- Runtime Function: unsigned short accum __fractuqquha (unsigned
+ short fract A)
+ -- Runtime Function: unsigned accum __fractuqqusa (unsigned short
+ fract A)
+ -- Runtime Function: unsigned long accum __fractuqquda (unsigned short
+ fract A)
+ -- Runtime Function: unsigned long long accum __fractuqquta (unsigned
+ short fract A)
+ -- Runtime Function: signed char __fractuqqqi (unsigned short fract A)
+ -- Runtime Function: short __fractuqqhi (unsigned short fract A)
+ -- Runtime Function: int __fractuqqsi (unsigned short fract A)
+ -- Runtime Function: long __fractuqqdi (unsigned short fract A)
+ -- Runtime Function: long long __fractuqqti (unsigned short fract A)
+ -- Runtime Function: float __fractuqqsf (unsigned short fract A)
+ -- Runtime Function: double __fractuqqdf (unsigned short fract A)
+ -- Runtime Function: short fract __fractuhqqq (unsigned fract A)
+ -- Runtime Function: fract __fractuhqhq (unsigned fract A)
+ -- Runtime Function: long fract __fractuhqsq (unsigned fract A)
+ -- Runtime Function: long long fract __fractuhqdq (unsigned fract A)
+ -- Runtime Function: short accum __fractuhqha (unsigned fract A)
+ -- Runtime Function: accum __fractuhqsa (unsigned fract A)
+ -- Runtime Function: long accum __fractuhqda (unsigned fract A)
+ -- Runtime Function: long long accum __fractuhqta (unsigned fract A)
+ -- Runtime Function: unsigned short fract __fractuhquqq2 (unsigned
+ fract A)
+ -- Runtime Function: unsigned long fract __fractuhqusq2 (unsigned
+ fract A)
+ -- Runtime Function: unsigned long long fract __fractuhqudq2 (unsigned
+ fract A)
+ -- Runtime Function: unsigned short accum __fractuhquha (unsigned
+ fract A)
+ -- Runtime Function: unsigned accum __fractuhqusa (unsigned fract A)
+ -- Runtime Function: unsigned long accum __fractuhquda (unsigned fract
+ A)
+ -- Runtime Function: unsigned long long accum __fractuhquta (unsigned
+ fract A)
+ -- Runtime Function: signed char __fractuhqqi (unsigned fract A)
+ -- Runtime Function: short __fractuhqhi (unsigned fract A)
+ -- Runtime Function: int __fractuhqsi (unsigned fract A)
+ -- Runtime Function: long __fractuhqdi (unsigned fract A)
+ -- Runtime Function: long long __fractuhqti (unsigned fract A)
+ -- Runtime Function: float __fractuhqsf (unsigned fract A)
+ -- Runtime Function: double __fractuhqdf (unsigned fract A)
+ -- Runtime Function: short fract __fractusqqq (unsigned long fract A)
+ -- Runtime Function: fract __fractusqhq (unsigned long fract A)
+ -- Runtime Function: long fract __fractusqsq (unsigned long fract A)
+ -- Runtime Function: long long fract __fractusqdq (unsigned long fract
+ A)
+ -- Runtime Function: short accum __fractusqha (unsigned long fract A)
+ -- Runtime Function: accum __fractusqsa (unsigned long fract A)
+ -- Runtime Function: long accum __fractusqda (unsigned long fract A)
+ -- Runtime Function: long long accum __fractusqta (unsigned long fract
+ A)
+ -- Runtime Function: unsigned short fract __fractusquqq2 (unsigned
+ long fract A)
+ -- Runtime Function: unsigned fract __fractusquhq2 (unsigned long
+ fract A)
+ -- Runtime Function: unsigned long long fract __fractusqudq2 (unsigned
+ long fract A)
+ -- Runtime Function: unsigned short accum __fractusquha (unsigned long
+ fract A)
+ -- Runtime Function: unsigned accum __fractusqusa (unsigned long fract
+ A)
+ -- Runtime Function: unsigned long accum __fractusquda (unsigned long
+ fract A)
+ -- Runtime Function: unsigned long long accum __fractusquta (unsigned
+ long fract A)
+ -- Runtime Function: signed char __fractusqqi (unsigned long fract A)
+ -- Runtime Function: short __fractusqhi (unsigned long fract A)
+ -- Runtime Function: int __fractusqsi (unsigned long fract A)
+ -- Runtime Function: long __fractusqdi (unsigned long fract A)
+ -- Runtime Function: long long __fractusqti (unsigned long fract A)
+ -- Runtime Function: float __fractusqsf (unsigned long fract A)
+ -- Runtime Function: double __fractusqdf (unsigned long fract A)
+ -- Runtime Function: short fract __fractudqqq (unsigned long long
+ fract A)
+ -- Runtime Function: fract __fractudqhq (unsigned long long fract A)
+ -- Runtime Function: long fract __fractudqsq (unsigned long long fract
+ A)
+ -- Runtime Function: long long fract __fractudqdq (unsigned long long
+ fract A)
+ -- Runtime Function: short accum __fractudqha (unsigned long long
+ fract A)
+ -- Runtime Function: accum __fractudqsa (unsigned long long fract A)
+ -- Runtime Function: long accum __fractudqda (unsigned long long fract
+ A)
+ -- Runtime Function: long long accum __fractudqta (unsigned long long
+ fract A)
+ -- Runtime Function: unsigned short fract __fractudquqq2 (unsigned
+ long long fract A)
+ -- Runtime Function: unsigned fract __fractudquhq2 (unsigned long long
+ fract A)
+ -- Runtime Function: unsigned long fract __fractudqusq2 (unsigned long
+ long fract A)
+ -- Runtime Function: unsigned short accum __fractudquha (unsigned long
+ long fract A)
+ -- Runtime Function: unsigned accum __fractudqusa (unsigned long long
+ fract A)
+ -- Runtime Function: unsigned long accum __fractudquda (unsigned long
+ long fract A)
+ -- Runtime Function: unsigned long long accum __fractudquta (unsigned
+ long long fract A)
+ -- Runtime Function: signed char __fractudqqi (unsigned long long
+ fract A)
+ -- Runtime Function: short __fractudqhi (unsigned long long fract A)
+ -- Runtime Function: int __fractudqsi (unsigned long long fract A)
+ -- Runtime Function: long __fractudqdi (unsigned long long fract A)
+ -- Runtime Function: long long __fractudqti (unsigned long long fract
+ A)
+ -- Runtime Function: float __fractudqsf (unsigned long long fract A)
+ -- Runtime Function: double __fractudqdf (unsigned long long fract A)
+ -- Runtime Function: short fract __fractuhaqq (unsigned short accum A)
+ -- Runtime Function: fract __fractuhahq (unsigned short accum A)
+ -- Runtime Function: long fract __fractuhasq (unsigned short accum A)
+ -- Runtime Function: long long fract __fractuhadq (unsigned short
+ accum A)
+ -- Runtime Function: short accum __fractuhaha (unsigned short accum A)
+ -- Runtime Function: accum __fractuhasa (unsigned short accum A)
+ -- Runtime Function: long accum __fractuhada (unsigned short accum A)
+ -- Runtime Function: long long accum __fractuhata (unsigned short
+ accum A)
+ -- Runtime Function: unsigned short fract __fractuhauqq (unsigned
+ short accum A)
+ -- Runtime Function: unsigned fract __fractuhauhq (unsigned short
+ accum A)
+ -- Runtime Function: unsigned long fract __fractuhausq (unsigned short
+ accum A)
+ -- Runtime Function: unsigned long long fract __fractuhaudq (unsigned
+ short accum A)
+ -- Runtime Function: unsigned accum __fractuhausa2 (unsigned short
+ accum A)
+ -- Runtime Function: unsigned long accum __fractuhauda2 (unsigned
+ short accum A)
+ -- Runtime Function: unsigned long long accum __fractuhauta2 (unsigned
+ short accum A)
+ -- Runtime Function: signed char __fractuhaqi (unsigned short accum A)
+ -- Runtime Function: short __fractuhahi (unsigned short accum A)
+ -- Runtime Function: int __fractuhasi (unsigned short accum A)
+ -- Runtime Function: long __fractuhadi (unsigned short accum A)
+ -- Runtime Function: long long __fractuhati (unsigned short accum A)
+ -- Runtime Function: float __fractuhasf (unsigned short accum A)
+ -- Runtime Function: double __fractuhadf (unsigned short accum A)
+ -- Runtime Function: short fract __fractusaqq (unsigned accum A)
+ -- Runtime Function: fract __fractusahq (unsigned accum A)
+ -- Runtime Function: long fract __fractusasq (unsigned accum A)
+ -- Runtime Function: long long fract __fractusadq (unsigned accum A)
+ -- Runtime Function: short accum __fractusaha (unsigned accum A)
+ -- Runtime Function: accum __fractusasa (unsigned accum A)
+ -- Runtime Function: long accum __fractusada (unsigned accum A)
+ -- Runtime Function: long long accum __fractusata (unsigned accum A)
+ -- Runtime Function: unsigned short fract __fractusauqq (unsigned
+ accum A)
+ -- Runtime Function: unsigned fract __fractusauhq (unsigned accum A)
+ -- Runtime Function: unsigned long fract __fractusausq (unsigned accum
+ A)
+ -- Runtime Function: unsigned long long fract __fractusaudq (unsigned
+ accum A)
+ -- Runtime Function: unsigned short accum __fractusauha2 (unsigned
+ accum A)
+ -- Runtime Function: unsigned long accum __fractusauda2 (unsigned
+ accum A)
+ -- Runtime Function: unsigned long long accum __fractusauta2 (unsigned
+ accum A)
+ -- Runtime Function: signed char __fractusaqi (unsigned accum A)
+ -- Runtime Function: short __fractusahi (unsigned accum A)
+ -- Runtime Function: int __fractusasi (unsigned accum A)
+ -- Runtime Function: long __fractusadi (unsigned accum A)
+ -- Runtime Function: long long __fractusati (unsigned accum A)
+ -- Runtime Function: float __fractusasf (unsigned accum A)
+ -- Runtime Function: double __fractusadf (unsigned accum A)
+ -- Runtime Function: short fract __fractudaqq (unsigned long accum A)
+ -- Runtime Function: fract __fractudahq (unsigned long accum A)
+ -- Runtime Function: long fract __fractudasq (unsigned long accum A)
+ -- Runtime Function: long long fract __fractudadq (unsigned long accum
+ A)
+ -- Runtime Function: short accum __fractudaha (unsigned long accum A)
+ -- Runtime Function: accum __fractudasa (unsigned long accum A)
+ -- Runtime Function: long accum __fractudada (unsigned long accum A)
+ -- Runtime Function: long long accum __fractudata (unsigned long accum
+ A)
+ -- Runtime Function: unsigned short fract __fractudauqq (unsigned long
+ accum A)
+ -- Runtime Function: unsigned fract __fractudauhq (unsigned long accum
+ A)
+ -- Runtime Function: unsigned long fract __fractudausq (unsigned long
+ accum A)
+ -- Runtime Function: unsigned long long fract __fractudaudq (unsigned
+ long accum A)
+ -- Runtime Function: unsigned short accum __fractudauha2 (unsigned
+ long accum A)
+ -- Runtime Function: unsigned accum __fractudausa2 (unsigned long
+ accum A)
+ -- Runtime Function: unsigned long long accum __fractudauta2 (unsigned
+ long accum A)
+ -- Runtime Function: signed char __fractudaqi (unsigned long accum A)
+ -- Runtime Function: short __fractudahi (unsigned long accum A)
+ -- Runtime Function: int __fractudasi (unsigned long accum A)
+ -- Runtime Function: long __fractudadi (unsigned long accum A)
+ -- Runtime Function: long long __fractudati (unsigned long accum A)
+ -- Runtime Function: float __fractudasf (unsigned long accum A)
+ -- Runtime Function: double __fractudadf (unsigned long accum A)
+ -- Runtime Function: short fract __fractutaqq (unsigned long long
+ accum A)
+ -- Runtime Function: fract __fractutahq (unsigned long long accum A)
+ -- Runtime Function: long fract __fractutasq (unsigned long long accum
+ A)
+ -- Runtime Function: long long fract __fractutadq (unsigned long long
+ accum A)
+ -- Runtime Function: short accum __fractutaha (unsigned long long
+ accum A)
+ -- Runtime Function: accum __fractutasa (unsigned long long accum A)
+ -- Runtime Function: long accum __fractutada (unsigned long long accum
+ A)
+ -- Runtime Function: long long accum __fractutata (unsigned long long
+ accum A)
+ -- Runtime Function: unsigned short fract __fractutauqq (unsigned long
+ long accum A)
+ -- Runtime Function: unsigned fract __fractutauhq (unsigned long long
+ accum A)
+ -- Runtime Function: unsigned long fract __fractutausq (unsigned long
+ long accum A)
+ -- Runtime Function: unsigned long long fract __fractutaudq (unsigned
+ long long accum A)
+ -- Runtime Function: unsigned short accum __fractutauha2 (unsigned
+ long long accum A)
+ -- Runtime Function: unsigned accum __fractutausa2 (unsigned long long
+ accum A)
+ -- Runtime Function: unsigned long accum __fractutauda2 (unsigned long
+ long accum A)
+ -- Runtime Function: signed char __fractutaqi (unsigned long long
+ accum A)
+ -- Runtime Function: short __fractutahi (unsigned long long accum A)
+ -- Runtime Function: int __fractutasi (unsigned long long accum A)
+ -- Runtime Function: long __fractutadi (unsigned long long accum A)
+ -- Runtime Function: long long __fractutati (unsigned long long accum
+ A)
+ -- Runtime Function: float __fractutasf (unsigned long long accum A)
+ -- Runtime Function: double __fractutadf (unsigned long long accum A)
+ -- Runtime Function: short fract __fractqiqq (signed char A)
+ -- Runtime Function: fract __fractqihq (signed char A)
+ -- Runtime Function: long fract __fractqisq (signed char A)
+ -- Runtime Function: long long fract __fractqidq (signed char A)
+ -- Runtime Function: short accum __fractqiha (signed char A)
+ -- Runtime Function: accum __fractqisa (signed char A)
+ -- Runtime Function: long accum __fractqida (signed char A)
+ -- Runtime Function: long long accum __fractqita (signed char A)
+ -- Runtime Function: unsigned short fract __fractqiuqq (signed char A)
+ -- Runtime Function: unsigned fract __fractqiuhq (signed char A)
+ -- Runtime Function: unsigned long fract __fractqiusq (signed char A)
+ -- Runtime Function: unsigned long long fract __fractqiudq (signed
+ char A)
+ -- Runtime Function: unsigned short accum __fractqiuha (signed char A)
+ -- Runtime Function: unsigned accum __fractqiusa (signed char A)
+ -- Runtime Function: unsigned long accum __fractqiuda (signed char A)
+ -- Runtime Function: unsigned long long accum __fractqiuta (signed
+ char A)
+ -- Runtime Function: short fract __fracthiqq (short A)
+ -- Runtime Function: fract __fracthihq (short A)
+ -- Runtime Function: long fract __fracthisq (short A)
+ -- Runtime Function: long long fract __fracthidq (short A)
+ -- Runtime Function: short accum __fracthiha (short A)
+ -- Runtime Function: accum __fracthisa (short A)
+ -- Runtime Function: long accum __fracthida (short A)
+ -- Runtime Function: long long accum __fracthita (short A)
+ -- Runtime Function: unsigned short fract __fracthiuqq (short A)
+ -- Runtime Function: unsigned fract __fracthiuhq (short A)
+ -- Runtime Function: unsigned long fract __fracthiusq (short A)
+ -- Runtime Function: unsigned long long fract __fracthiudq (short A)
+ -- Runtime Function: unsigned short accum __fracthiuha (short A)
+ -- Runtime Function: unsigned accum __fracthiusa (short A)
+ -- Runtime Function: unsigned long accum __fracthiuda (short A)
+ -- Runtime Function: unsigned long long accum __fracthiuta (short A)
+ -- Runtime Function: short fract __fractsiqq (int A)
+ -- Runtime Function: fract __fractsihq (int A)
+ -- Runtime Function: long fract __fractsisq (int A)
+ -- Runtime Function: long long fract __fractsidq (int A)
+ -- Runtime Function: short accum __fractsiha (int A)
+ -- Runtime Function: accum __fractsisa (int A)
+ -- Runtime Function: long accum __fractsida (int A)
+ -- Runtime Function: long long accum __fractsita (int A)
+ -- Runtime Function: unsigned short fract __fractsiuqq (int A)
+ -- Runtime Function: unsigned fract __fractsiuhq (int A)
+ -- Runtime Function: unsigned long fract __fractsiusq (int A)
+ -- Runtime Function: unsigned long long fract __fractsiudq (int A)
+ -- Runtime Function: unsigned short accum __fractsiuha (int A)
+ -- Runtime Function: unsigned accum __fractsiusa (int A)
+ -- Runtime Function: unsigned long accum __fractsiuda (int A)
+ -- Runtime Function: unsigned long long accum __fractsiuta (int A)
+ -- Runtime Function: short fract __fractdiqq (long A)
+ -- Runtime Function: fract __fractdihq (long A)
+ -- Runtime Function: long fract __fractdisq (long A)
+ -- Runtime Function: long long fract __fractdidq (long A)
+ -- Runtime Function: short accum __fractdiha (long A)
+ -- Runtime Function: accum __fractdisa (long A)
+ -- Runtime Function: long accum __fractdida (long A)
+ -- Runtime Function: long long accum __fractdita (long A)
+ -- Runtime Function: unsigned short fract __fractdiuqq (long A)
+ -- Runtime Function: unsigned fract __fractdiuhq (long A)
+ -- Runtime Function: unsigned long fract __fractdiusq (long A)
+ -- Runtime Function: unsigned long long fract __fractdiudq (long A)
+ -- Runtime Function: unsigned short accum __fractdiuha (long A)
+ -- Runtime Function: unsigned accum __fractdiusa (long A)
+ -- Runtime Function: unsigned long accum __fractdiuda (long A)
+ -- Runtime Function: unsigned long long accum __fractdiuta (long A)
+ -- Runtime Function: short fract __fracttiqq (long long A)
+ -- Runtime Function: fract __fracttihq (long long A)
+ -- Runtime Function: long fract __fracttisq (long long A)
+ -- Runtime Function: long long fract __fracttidq (long long A)
+ -- Runtime Function: short accum __fracttiha (long long A)
+ -- Runtime Function: accum __fracttisa (long long A)
+ -- Runtime Function: long accum __fracttida (long long A)
+ -- Runtime Function: long long accum __fracttita (long long A)
+ -- Runtime Function: unsigned short fract __fracttiuqq (long long A)
+ -- Runtime Function: unsigned fract __fracttiuhq (long long A)
+ -- Runtime Function: unsigned long fract __fracttiusq (long long A)
+ -- Runtime Function: unsigned long long fract __fracttiudq (long long
+ A)
+ -- Runtime Function: unsigned short accum __fracttiuha (long long A)
+ -- Runtime Function: unsigned accum __fracttiusa (long long A)
+ -- Runtime Function: unsigned long accum __fracttiuda (long long A)
+ -- Runtime Function: unsigned long long accum __fracttiuta (long long
+ A)
+ -- Runtime Function: short fract __fractsfqq (float A)
+ -- Runtime Function: fract __fractsfhq (float A)
+ -- Runtime Function: long fract __fractsfsq (float A)
+ -- Runtime Function: long long fract __fractsfdq (float A)
+ -- Runtime Function: short accum __fractsfha (float A)
+ -- Runtime Function: accum __fractsfsa (float A)
+ -- Runtime Function: long accum __fractsfda (float A)
+ -- Runtime Function: long long accum __fractsfta (float A)
+ -- Runtime Function: unsigned short fract __fractsfuqq (float A)
+ -- Runtime Function: unsigned fract __fractsfuhq (float A)
+ -- Runtime Function: unsigned long fract __fractsfusq (float A)
+ -- Runtime Function: unsigned long long fract __fractsfudq (float A)
+ -- Runtime Function: unsigned short accum __fractsfuha (float A)
+ -- Runtime Function: unsigned accum __fractsfusa (float A)
+ -- Runtime Function: unsigned long accum __fractsfuda (float A)
+ -- Runtime Function: unsigned long long accum __fractsfuta (float A)
+ -- Runtime Function: short fract __fractdfqq (double A)
+ -- Runtime Function: fract __fractdfhq (double A)
+ -- Runtime Function: long fract __fractdfsq (double A)
+ -- Runtime Function: long long fract __fractdfdq (double A)
+ -- Runtime Function: short accum __fractdfha (double A)
+ -- Runtime Function: accum __fractdfsa (double A)
+ -- Runtime Function: long accum __fractdfda (double A)
+ -- Runtime Function: long long accum __fractdfta (double A)
+ -- Runtime Function: unsigned short fract __fractdfuqq (double A)
+ -- Runtime Function: unsigned fract __fractdfuhq (double A)
+ -- Runtime Function: unsigned long fract __fractdfusq (double A)
+ -- Runtime Function: unsigned long long fract __fractdfudq (double A)
+ -- Runtime Function: unsigned short accum __fractdfuha (double A)
+ -- Runtime Function: unsigned accum __fractdfusa (double A)
+ -- Runtime Function: unsigned long accum __fractdfuda (double A)
+ -- Runtime Function: unsigned long long accum __fractdfuta (double A)
+ These functions convert from fractional and signed non-fractionals
+ to fractionals and signed non-fractionals, without saturation.
+
+ -- Runtime Function: fract __satfractqqhq2 (short fract A)
+ -- Runtime Function: long fract __satfractqqsq2 (short fract A)
+ -- Runtime Function: long long fract __satfractqqdq2 (short fract A)
+ -- Runtime Function: short accum __satfractqqha (short fract A)
+ -- Runtime Function: accum __satfractqqsa (short fract A)
+ -- Runtime Function: long accum __satfractqqda (short fract A)
+ -- Runtime Function: long long accum __satfractqqta (short fract A)
+ -- Runtime Function: unsigned short fract __satfractqquqq (short fract
+ A)
+ -- Runtime Function: unsigned fract __satfractqquhq (short fract A)
+ -- Runtime Function: unsigned long fract __satfractqqusq (short fract
+ A)
+ -- Runtime Function: unsigned long long fract __satfractqqudq (short
+ fract A)
+ -- Runtime Function: unsigned short accum __satfractqquha (short fract
+ A)
+ -- Runtime Function: unsigned accum __satfractqqusa (short fract A)
+ -- Runtime Function: unsigned long accum __satfractqquda (short fract
+ A)
+ -- Runtime Function: unsigned long long accum __satfractqquta (short
+ fract A)
+ -- Runtime Function: short fract __satfracthqqq2 (fract A)
+ -- Runtime Function: long fract __satfracthqsq2 (fract A)
+ -- Runtime Function: long long fract __satfracthqdq2 (fract A)
+ -- Runtime Function: short accum __satfracthqha (fract A)
+ -- Runtime Function: accum __satfracthqsa (fract A)
+ -- Runtime Function: long accum __satfracthqda (fract A)
+ -- Runtime Function: long long accum __satfracthqta (fract A)
+ -- Runtime Function: unsigned short fract __satfracthquqq (fract A)
+ -- Runtime Function: unsigned fract __satfracthquhq (fract A)
+ -- Runtime Function: unsigned long fract __satfracthqusq (fract A)
+ -- Runtime Function: unsigned long long fract __satfracthqudq (fract A)
+ -- Runtime Function: unsigned short accum __satfracthquha (fract A)
+ -- Runtime Function: unsigned accum __satfracthqusa (fract A)
+ -- Runtime Function: unsigned long accum __satfracthquda (fract A)
+ -- Runtime Function: unsigned long long accum __satfracthquta (fract A)
+ -- Runtime Function: short fract __satfractsqqq2 (long fract A)
+ -- Runtime Function: fract __satfractsqhq2 (long fract A)
+ -- Runtime Function: long long fract __satfractsqdq2 (long fract A)
+ -- Runtime Function: short accum __satfractsqha (long fract A)
+ -- Runtime Function: accum __satfractsqsa (long fract A)
+ -- Runtime Function: long accum __satfractsqda (long fract A)
+ -- Runtime Function: long long accum __satfractsqta (long fract A)
+ -- Runtime Function: unsigned short fract __satfractsquqq (long fract
+ A)
+ -- Runtime Function: unsigned fract __satfractsquhq (long fract A)
+ -- Runtime Function: unsigned long fract __satfractsqusq (long fract A)
+ -- Runtime Function: unsigned long long fract __satfractsqudq (long
+ fract A)
+ -- Runtime Function: unsigned short accum __satfractsquha (long fract
+ A)
+ -- Runtime Function: unsigned accum __satfractsqusa (long fract A)
+ -- Runtime Function: unsigned long accum __satfractsquda (long fract A)
+ -- Runtime Function: unsigned long long accum __satfractsquta (long
+ fract A)
+ -- Runtime Function: short fract __satfractdqqq2 (long long fract A)
+ -- Runtime Function: fract __satfractdqhq2 (long long fract A)
+ -- Runtime Function: long fract __satfractdqsq2 (long long fract A)
+ -- Runtime Function: short accum __satfractdqha (long long fract A)
+ -- Runtime Function: accum __satfractdqsa (long long fract A)
+ -- Runtime Function: long accum __satfractdqda (long long fract A)
+ -- Runtime Function: long long accum __satfractdqta (long long fract A)
+ -- Runtime Function: unsigned short fract __satfractdquqq (long long
+ fract A)
+ -- Runtime Function: unsigned fract __satfractdquhq (long long fract A)
+ -- Runtime Function: unsigned long fract __satfractdqusq (long long
+ fract A)
+ -- Runtime Function: unsigned long long fract __satfractdqudq (long
+ long fract A)
+ -- Runtime Function: unsigned short accum __satfractdquha (long long
+ fract A)
+ -- Runtime Function: unsigned accum __satfractdqusa (long long fract A)
+ -- Runtime Function: unsigned long accum __satfractdquda (long long
+ fract A)
+ -- Runtime Function: unsigned long long accum __satfractdquta (long
+ long fract A)
+ -- Runtime Function: short fract __satfracthaqq (short accum A)
+ -- Runtime Function: fract __satfracthahq (short accum A)
+ -- Runtime Function: long fract __satfracthasq (short accum A)
+ -- Runtime Function: long long fract __satfracthadq (short accum A)
+ -- Runtime Function: accum __satfracthasa2 (short accum A)
+ -- Runtime Function: long accum __satfracthada2 (short accum A)
+ -- Runtime Function: long long accum __satfracthata2 (short accum A)
+ -- Runtime Function: unsigned short fract __satfracthauqq (short accum
+ A)
+ -- Runtime Function: unsigned fract __satfracthauhq (short accum A)
+ -- Runtime Function: unsigned long fract __satfracthausq (short accum
+ A)
+ -- Runtime Function: unsigned long long fract __satfracthaudq (short
+ accum A)
+ -- Runtime Function: unsigned short accum __satfracthauha (short accum
+ A)
+ -- Runtime Function: unsigned accum __satfracthausa (short accum A)
+ -- Runtime Function: unsigned long accum __satfracthauda (short accum
+ A)
+ -- Runtime Function: unsigned long long accum __satfracthauta (short
+ accum A)
+ -- Runtime Function: short fract __satfractsaqq (accum A)
+ -- Runtime Function: fract __satfractsahq (accum A)
+ -- Runtime Function: long fract __satfractsasq (accum A)
+ -- Runtime Function: long long fract __satfractsadq (accum A)
+ -- Runtime Function: short accum __satfractsaha2 (accum A)
+ -- Runtime Function: long accum __satfractsada2 (accum A)
+ -- Runtime Function: long long accum __satfractsata2 (accum A)
+ -- Runtime Function: unsigned short fract __satfractsauqq (accum A)
+ -- Runtime Function: unsigned fract __satfractsauhq (accum A)
+ -- Runtime Function: unsigned long fract __satfractsausq (accum A)
+ -- Runtime Function: unsigned long long fract __satfractsaudq (accum A)
+ -- Runtime Function: unsigned short accum __satfractsauha (accum A)
+ -- Runtime Function: unsigned accum __satfractsausa (accum A)
+ -- Runtime Function: unsigned long accum __satfractsauda (accum A)
+ -- Runtime Function: unsigned long long accum __satfractsauta (accum A)
+ -- Runtime Function: short fract __satfractdaqq (long accum A)
+ -- Runtime Function: fract __satfractdahq (long accum A)
+ -- Runtime Function: long fract __satfractdasq (long accum A)
+ -- Runtime Function: long long fract __satfractdadq (long accum A)
+ -- Runtime Function: short accum __satfractdaha2 (long accum A)
+ -- Runtime Function: accum __satfractdasa2 (long accum A)
+ -- Runtime Function: long long accum __satfractdata2 (long accum A)
+ -- Runtime Function: unsigned short fract __satfractdauqq (long accum
+ A)
+ -- Runtime Function: unsigned fract __satfractdauhq (long accum A)
+ -- Runtime Function: unsigned long fract __satfractdausq (long accum A)
+ -- Runtime Function: unsigned long long fract __satfractdaudq (long
+ accum A)
+ -- Runtime Function: unsigned short accum __satfractdauha (long accum
+ A)
+ -- Runtime Function: unsigned accum __satfractdausa (long accum A)
+ -- Runtime Function: unsigned long accum __satfractdauda (long accum A)
+ -- Runtime Function: unsigned long long accum __satfractdauta (long
+ accum A)
+ -- Runtime Function: short fract __satfracttaqq (long long accum A)
+ -- Runtime Function: fract __satfracttahq (long long accum A)
+ -- Runtime Function: long fract __satfracttasq (long long accum A)
+ -- Runtime Function: long long fract __satfracttadq (long long accum A)
+ -- Runtime Function: short accum __satfracttaha2 (long long accum A)
+ -- Runtime Function: accum __satfracttasa2 (long long accum A)
+ -- Runtime Function: long accum __satfracttada2 (long long accum A)
+ -- Runtime Function: unsigned short fract __satfracttauqq (long long
+ accum A)
+ -- Runtime Function: unsigned fract __satfracttauhq (long long accum A)
+ -- Runtime Function: unsigned long fract __satfracttausq (long long
+ accum A)
+ -- Runtime Function: unsigned long long fract __satfracttaudq (long
+ long accum A)
+ -- Runtime Function: unsigned short accum __satfracttauha (long long
+ accum A)
+ -- Runtime Function: unsigned accum __satfracttausa (long long accum A)
+ -- Runtime Function: unsigned long accum __satfracttauda (long long
+ accum A)
+ -- Runtime Function: unsigned long long accum __satfracttauta (long
+ long accum A)
+ -- Runtime Function: short fract __satfractuqqqq (unsigned short fract
+ A)
+ -- Runtime Function: fract __satfractuqqhq (unsigned short fract A)
+ -- Runtime Function: long fract __satfractuqqsq (unsigned short fract
+ A)
+ -- Runtime Function: long long fract __satfractuqqdq (unsigned short
+ fract A)
+ -- Runtime Function: short accum __satfractuqqha (unsigned short fract
+ A)
+ -- Runtime Function: accum __satfractuqqsa (unsigned short fract A)
+ -- Runtime Function: long accum __satfractuqqda (unsigned short fract
+ A)
+ -- Runtime Function: long long accum __satfractuqqta (unsigned short
+ fract A)
+ -- Runtime Function: unsigned fract __satfractuqquhq2 (unsigned short
+ fract A)
+ -- Runtime Function: unsigned long fract __satfractuqqusq2 (unsigned
+ short fract A)
+ -- Runtime Function: unsigned long long fract __satfractuqqudq2
+ (unsigned short fract A)
+ -- Runtime Function: unsigned short accum __satfractuqquha (unsigned
+ short fract A)
+ -- Runtime Function: unsigned accum __satfractuqqusa (unsigned short
+ fract A)
+ -- Runtime Function: unsigned long accum __satfractuqquda (unsigned
+ short fract A)
+ -- Runtime Function: unsigned long long accum __satfractuqquta
+ (unsigned short fract A)
+ -- Runtime Function: short fract __satfractuhqqq (unsigned fract A)
+ -- Runtime Function: fract __satfractuhqhq (unsigned fract A)
+ -- Runtime Function: long fract __satfractuhqsq (unsigned fract A)
+ -- Runtime Function: long long fract __satfractuhqdq (unsigned fract A)
+ -- Runtime Function: short accum __satfractuhqha (unsigned fract A)
+ -- Runtime Function: accum __satfractuhqsa (unsigned fract A)
+ -- Runtime Function: long accum __satfractuhqda (unsigned fract A)
+ -- Runtime Function: long long accum __satfractuhqta (unsigned fract A)
+ -- Runtime Function: unsigned short fract __satfractuhquqq2 (unsigned
+ fract A)
+ -- Runtime Function: unsigned long fract __satfractuhqusq2 (unsigned
+ fract A)
+ -- Runtime Function: unsigned long long fract __satfractuhqudq2
+ (unsigned fract A)
+ -- Runtime Function: unsigned short accum __satfractuhquha (unsigned
+ fract A)
+ -- Runtime Function: unsigned accum __satfractuhqusa (unsigned fract A)
+ -- Runtime Function: unsigned long accum __satfractuhquda (unsigned
+ fract A)
+ -- Runtime Function: unsigned long long accum __satfractuhquta
+ (unsigned fract A)
+ -- Runtime Function: short fract __satfractusqqq (unsigned long fract
+ A)
+ -- Runtime Function: fract __satfractusqhq (unsigned long fract A)
+ -- Runtime Function: long fract __satfractusqsq (unsigned long fract A)
+ -- Runtime Function: long long fract __satfractusqdq (unsigned long
+ fract A)
+ -- Runtime Function: short accum __satfractusqha (unsigned long fract
+ A)
+ -- Runtime Function: accum __satfractusqsa (unsigned long fract A)
+ -- Runtime Function: long accum __satfractusqda (unsigned long fract A)
+ -- Runtime Function: long long accum __satfractusqta (unsigned long
+ fract A)
+ -- Runtime Function: unsigned short fract __satfractusquqq2 (unsigned
+ long fract A)
+ -- Runtime Function: unsigned fract __satfractusquhq2 (unsigned long
+ fract A)
+ -- Runtime Function: unsigned long long fract __satfractusqudq2
+ (unsigned long fract A)
+ -- Runtime Function: unsigned short accum __satfractusquha (unsigned
+ long fract A)
+ -- Runtime Function: unsigned accum __satfractusqusa (unsigned long
+ fract A)
+ -- Runtime Function: unsigned long accum __satfractusquda (unsigned
+ long fract A)
+ -- Runtime Function: unsigned long long accum __satfractusquta
+ (unsigned long fract A)
+ -- Runtime Function: short fract __satfractudqqq (unsigned long long
+ fract A)
+ -- Runtime Function: fract __satfractudqhq (unsigned long long fract A)
+ -- Runtime Function: long fract __satfractudqsq (unsigned long long
+ fract A)
+ -- Runtime Function: long long fract __satfractudqdq (unsigned long
+ long fract A)
+ -- Runtime Function: short accum __satfractudqha (unsigned long long
+ fract A)
+ -- Runtime Function: accum __satfractudqsa (unsigned long long fract A)
+ -- Runtime Function: long accum __satfractudqda (unsigned long long
+ fract A)
+ -- Runtime Function: long long accum __satfractudqta (unsigned long
+ long fract A)
+ -- Runtime Function: unsigned short fract __satfractudquqq2 (unsigned
+ long long fract A)
+ -- Runtime Function: unsigned fract __satfractudquhq2 (unsigned long
+ long fract A)
+ -- Runtime Function: unsigned long fract __satfractudqusq2 (unsigned
+ long long fract A)
+ -- Runtime Function: unsigned short accum __satfractudquha (unsigned
+ long long fract A)
+ -- Runtime Function: unsigned accum __satfractudqusa (unsigned long
+ long fract A)
+ -- Runtime Function: unsigned long accum __satfractudquda (unsigned
+ long long fract A)
+ -- Runtime Function: unsigned long long accum __satfractudquta
+ (unsigned long long fract A)
+ -- Runtime Function: short fract __satfractuhaqq (unsigned short accum
+ A)
+ -- Runtime Function: fract __satfractuhahq (unsigned short accum A)
+ -- Runtime Function: long fract __satfractuhasq (unsigned short accum
+ A)
+ -- Runtime Function: long long fract __satfractuhadq (unsigned short
+ accum A)
+ -- Runtime Function: short accum __satfractuhaha (unsigned short accum
+ A)
+ -- Runtime Function: accum __satfractuhasa (unsigned short accum A)
+ -- Runtime Function: long accum __satfractuhada (unsigned short accum
+ A)
+ -- Runtime Function: long long accum __satfractuhata (unsigned short
+ accum A)
+ -- Runtime Function: unsigned short fract __satfractuhauqq (unsigned
+ short accum A)
+ -- Runtime Function: unsigned fract __satfractuhauhq (unsigned short
+ accum A)
+ -- Runtime Function: unsigned long fract __satfractuhausq (unsigned
+ short accum A)
+ -- Runtime Function: unsigned long long fract __satfractuhaudq
+ (unsigned short accum A)
+ -- Runtime Function: unsigned accum __satfractuhausa2 (unsigned short
+ accum A)
+ -- Runtime Function: unsigned long accum __satfractuhauda2 (unsigned
+ short accum A)
+ -- Runtime Function: unsigned long long accum __satfractuhauta2
+ (unsigned short accum A)
+ -- Runtime Function: short fract __satfractusaqq (unsigned accum A)
+ -- Runtime Function: fract __satfractusahq (unsigned accum A)
+ -- Runtime Function: long fract __satfractusasq (unsigned accum A)
+ -- Runtime Function: long long fract __satfractusadq (unsigned accum A)
+ -- Runtime Function: short accum __satfractusaha (unsigned accum A)
+ -- Runtime Function: accum __satfractusasa (unsigned accum A)
+ -- Runtime Function: long accum __satfractusada (unsigned accum A)
+ -- Runtime Function: long long accum __satfractusata (unsigned accum A)
+ -- Runtime Function: unsigned short fract __satfractusauqq (unsigned
+ accum A)
+ -- Runtime Function: unsigned fract __satfractusauhq (unsigned accum A)
+ -- Runtime Function: unsigned long fract __satfractusausq (unsigned
+ accum A)
+ -- Runtime Function: unsigned long long fract __satfractusaudq
+ (unsigned accum A)
+ -- Runtime Function: unsigned short accum __satfractusauha2 (unsigned
+ accum A)
+ -- Runtime Function: unsigned long accum __satfractusauda2 (unsigned
+ accum A)
+ -- Runtime Function: unsigned long long accum __satfractusauta2
+ (unsigned accum A)
+ -- Runtime Function: short fract __satfractudaqq (unsigned long accum
+ A)
+ -- Runtime Function: fract __satfractudahq (unsigned long accum A)
+ -- Runtime Function: long fract __satfractudasq (unsigned long accum A)
+ -- Runtime Function: long long fract __satfractudadq (unsigned long
+ accum A)
+ -- Runtime Function: short accum __satfractudaha (unsigned long accum
+ A)
+ -- Runtime Function: accum __satfractudasa (unsigned long accum A)
+ -- Runtime Function: long accum __satfractudada (unsigned long accum A)
+ -- Runtime Function: long long accum __satfractudata (unsigned long
+ accum A)
+ -- Runtime Function: unsigned short fract __satfractudauqq (unsigned
+ long accum A)
+ -- Runtime Function: unsigned fract __satfractudauhq (unsigned long
+ accum A)
+ -- Runtime Function: unsigned long fract __satfractudausq (unsigned
+ long accum A)
+ -- Runtime Function: unsigned long long fract __satfractudaudq
+ (unsigned long accum A)
+ -- Runtime Function: unsigned short accum __satfractudauha2 (unsigned
+ long accum A)
+ -- Runtime Function: unsigned accum __satfractudausa2 (unsigned long
+ accum A)
+ -- Runtime Function: unsigned long long accum __satfractudauta2
+ (unsigned long accum A)
+ -- Runtime Function: short fract __satfractutaqq (unsigned long long
+ accum A)
+ -- Runtime Function: fract __satfractutahq (unsigned long long accum A)
+ -- Runtime Function: long fract __satfractutasq (unsigned long long
+ accum A)
+ -- Runtime Function: long long fract __satfractutadq (unsigned long
+ long accum A)
+ -- Runtime Function: short accum __satfractutaha (unsigned long long
+ accum A)
+ -- Runtime Function: accum __satfractutasa (unsigned long long accum A)
+ -- Runtime Function: long accum __satfractutada (unsigned long long
+ accum A)
+ -- Runtime Function: long long accum __satfractutata (unsigned long
+ long accum A)
+ -- Runtime Function: unsigned short fract __satfractutauqq (unsigned
+ long long accum A)
+ -- Runtime Function: unsigned fract __satfractutauhq (unsigned long
+ long accum A)
+ -- Runtime Function: unsigned long fract __satfractutausq (unsigned
+ long long accum A)
+ -- Runtime Function: unsigned long long fract __satfractutaudq
+ (unsigned long long accum A)
+ -- Runtime Function: unsigned short accum __satfractutauha2 (unsigned
+ long long accum A)
+ -- Runtime Function: unsigned accum __satfractutausa2 (unsigned long
+ long accum A)
+ -- Runtime Function: unsigned long accum __satfractutauda2 (unsigned
+ long long accum A)
+ -- Runtime Function: short fract __satfractqiqq (signed char A)
+ -- Runtime Function: fract __satfractqihq (signed char A)
+ -- Runtime Function: long fract __satfractqisq (signed char A)
+ -- Runtime Function: long long fract __satfractqidq (signed char A)
+ -- Runtime Function: short accum __satfractqiha (signed char A)
+ -- Runtime Function: accum __satfractqisa (signed char A)
+ -- Runtime Function: long accum __satfractqida (signed char A)
+ -- Runtime Function: long long accum __satfractqita (signed char A)
+ -- Runtime Function: unsigned short fract __satfractqiuqq (signed char
+ A)
+ -- Runtime Function: unsigned fract __satfractqiuhq (signed char A)
+ -- Runtime Function: unsigned long fract __satfractqiusq (signed char
+ A)
+ -- Runtime Function: unsigned long long fract __satfractqiudq (signed
+ char A)
+ -- Runtime Function: unsigned short accum __satfractqiuha (signed char
+ A)
+ -- Runtime Function: unsigned accum __satfractqiusa (signed char A)
+ -- Runtime Function: unsigned long accum __satfractqiuda (signed char
+ A)
+ -- Runtime Function: unsigned long long accum __satfractqiuta (signed
+ char A)
+ -- Runtime Function: short fract __satfracthiqq (short A)
+ -- Runtime Function: fract __satfracthihq (short A)
+ -- Runtime Function: long fract __satfracthisq (short A)
+ -- Runtime Function: long long fract __satfracthidq (short A)
+ -- Runtime Function: short accum __satfracthiha (short A)
+ -- Runtime Function: accum __satfracthisa (short A)
+ -- Runtime Function: long accum __satfracthida (short A)
+ -- Runtime Function: long long accum __satfracthita (short A)
+ -- Runtime Function: unsigned short fract __satfracthiuqq (short A)
+ -- Runtime Function: unsigned fract __satfracthiuhq (short A)
+ -- Runtime Function: unsigned long fract __satfracthiusq (short A)
+ -- Runtime Function: unsigned long long fract __satfracthiudq (short A)
+ -- Runtime Function: unsigned short accum __satfracthiuha (short A)
+ -- Runtime Function: unsigned accum __satfracthiusa (short A)
+ -- Runtime Function: unsigned long accum __satfracthiuda (short A)
+ -- Runtime Function: unsigned long long accum __satfracthiuta (short A)
+ -- Runtime Function: short fract __satfractsiqq (int A)
+ -- Runtime Function: fract __satfractsihq (int A)
+ -- Runtime Function: long fract __satfractsisq (int A)
+ -- Runtime Function: long long fract __satfractsidq (int A)
+ -- Runtime Function: short accum __satfractsiha (int A)
+ -- Runtime Function: accum __satfractsisa (int A)
+ -- Runtime Function: long accum __satfractsida (int A)
+ -- Runtime Function: long long accum __satfractsita (int A)
+ -- Runtime Function: unsigned short fract __satfractsiuqq (int A)
+ -- Runtime Function: unsigned fract __satfractsiuhq (int A)
+ -- Runtime Function: unsigned long fract __satfractsiusq (int A)
+ -- Runtime Function: unsigned long long fract __satfractsiudq (int A)
+ -- Runtime Function: unsigned short accum __satfractsiuha (int A)
+ -- Runtime Function: unsigned accum __satfractsiusa (int A)
+ -- Runtime Function: unsigned long accum __satfractsiuda (int A)
+ -- Runtime Function: unsigned long long accum __satfractsiuta (int A)
+ -- Runtime Function: short fract __satfractdiqq (long A)
+ -- Runtime Function: fract __satfractdihq (long A)
+ -- Runtime Function: long fract __satfractdisq (long A)
+ -- Runtime Function: long long fract __satfractdidq (long A)
+ -- Runtime Function: short accum __satfractdiha (long A)
+ -- Runtime Function: accum __satfractdisa (long A)
+ -- Runtime Function: long accum __satfractdida (long A)
+ -- Runtime Function: long long accum __satfractdita (long A)
+ -- Runtime Function: unsigned short fract __satfractdiuqq (long A)
+ -- Runtime Function: unsigned fract __satfractdiuhq (long A)
+ -- Runtime Function: unsigned long fract __satfractdiusq (long A)
+ -- Runtime Function: unsigned long long fract __satfractdiudq (long A)
+ -- Runtime Function: unsigned short accum __satfractdiuha (long A)
+ -- Runtime Function: unsigned accum __satfractdiusa (long A)
+ -- Runtime Function: unsigned long accum __satfractdiuda (long A)
+ -- Runtime Function: unsigned long long accum __satfractdiuta (long A)
+ -- Runtime Function: short fract __satfracttiqq (long long A)
+ -- Runtime Function: fract __satfracttihq (long long A)
+ -- Runtime Function: long fract __satfracttisq (long long A)
+ -- Runtime Function: long long fract __satfracttidq (long long A)
+ -- Runtime Function: short accum __satfracttiha (long long A)
+ -- Runtime Function: accum __satfracttisa (long long A)
+ -- Runtime Function: long accum __satfracttida (long long A)
+ -- Runtime Function: long long accum __satfracttita (long long A)
+ -- Runtime Function: unsigned short fract __satfracttiuqq (long long A)
+ -- Runtime Function: unsigned fract __satfracttiuhq (long long A)
+ -- Runtime Function: unsigned long fract __satfracttiusq (long long A)
+ -- Runtime Function: unsigned long long fract __satfracttiudq (long
+ long A)
+ -- Runtime Function: unsigned short accum __satfracttiuha (long long A)
+ -- Runtime Function: unsigned accum __satfracttiusa (long long A)
+ -- Runtime Function: unsigned long accum __satfracttiuda (long long A)
+ -- Runtime Function: unsigned long long accum __satfracttiuta (long
+ long A)
+ -- Runtime Function: short fract __satfractsfqq (float A)
+ -- Runtime Function: fract __satfractsfhq (float A)
+ -- Runtime Function: long fract __satfractsfsq (float A)
+ -- Runtime Function: long long fract __satfractsfdq (float A)
+ -- Runtime Function: short accum __satfractsfha (float A)
+ -- Runtime Function: accum __satfractsfsa (float A)
+ -- Runtime Function: long accum __satfractsfda (float A)
+ -- Runtime Function: long long accum __satfractsfta (float A)
+ -- Runtime Function: unsigned short fract __satfractsfuqq (float A)
+ -- Runtime Function: unsigned fract __satfractsfuhq (float A)
+ -- Runtime Function: unsigned long fract __satfractsfusq (float A)
+ -- Runtime Function: unsigned long long fract __satfractsfudq (float A)
+ -- Runtime Function: unsigned short accum __satfractsfuha (float A)
+ -- Runtime Function: unsigned accum __satfractsfusa (float A)
+ -- Runtime Function: unsigned long accum __satfractsfuda (float A)
+ -- Runtime Function: unsigned long long accum __satfractsfuta (float A)
+ -- Runtime Function: short fract __satfractdfqq (double A)
+ -- Runtime Function: fract __satfractdfhq (double A)
+ -- Runtime Function: long fract __satfractdfsq (double A)
+ -- Runtime Function: long long fract __satfractdfdq (double A)
+ -- Runtime Function: short accum __satfractdfha (double A)
+ -- Runtime Function: accum __satfractdfsa (double A)
+ -- Runtime Function: long accum __satfractdfda (double A)
+ -- Runtime Function: long long accum __satfractdfta (double A)
+ -- Runtime Function: unsigned short fract __satfractdfuqq (double A)
+ -- Runtime Function: unsigned fract __satfractdfuhq (double A)
+ -- Runtime Function: unsigned long fract __satfractdfusq (double A)
+ -- Runtime Function: unsigned long long fract __satfractdfudq (double
+ A)
+ -- Runtime Function: unsigned short accum __satfractdfuha (double A)
+ -- Runtime Function: unsigned accum __satfractdfusa (double A)
+ -- Runtime Function: unsigned long accum __satfractdfuda (double A)
+ -- Runtime Function: unsigned long long accum __satfractdfuta (double
+ A)
+ The functions convert from fractional and signed non-fractionals to
+ fractionals, with saturation.
+
+ -- Runtime Function: unsigned char __fractunsqqqi (short fract A)
+ -- Runtime Function: unsigned short __fractunsqqhi (short fract A)
+ -- Runtime Function: unsigned int __fractunsqqsi (short fract A)
+ -- Runtime Function: unsigned long __fractunsqqdi (short fract A)
+ -- Runtime Function: unsigned long long __fractunsqqti (short fract A)
+ -- Runtime Function: unsigned char __fractunshqqi (fract A)
+ -- Runtime Function: unsigned short __fractunshqhi (fract A)
+ -- Runtime Function: unsigned int __fractunshqsi (fract A)
+ -- Runtime Function: unsigned long __fractunshqdi (fract A)
+ -- Runtime Function: unsigned long long __fractunshqti (fract A)
+ -- Runtime Function: unsigned char __fractunssqqi (long fract A)
+ -- Runtime Function: unsigned short __fractunssqhi (long fract A)
+ -- Runtime Function: unsigned int __fractunssqsi (long fract A)
+ -- Runtime Function: unsigned long __fractunssqdi (long fract A)
+ -- Runtime Function: unsigned long long __fractunssqti (long fract A)
+ -- Runtime Function: unsigned char __fractunsdqqi (long long fract A)
+ -- Runtime Function: unsigned short __fractunsdqhi (long long fract A)
+ -- Runtime Function: unsigned int __fractunsdqsi (long long fract A)
+ -- Runtime Function: unsigned long __fractunsdqdi (long long fract A)
+ -- Runtime Function: unsigned long long __fractunsdqti (long long
+ fract A)
+ -- Runtime Function: unsigned char __fractunshaqi (short accum A)
+ -- Runtime Function: unsigned short __fractunshahi (short accum A)
+ -- Runtime Function: unsigned int __fractunshasi (short accum A)
+ -- Runtime Function: unsigned long __fractunshadi (short accum A)
+ -- Runtime Function: unsigned long long __fractunshati (short accum A)
+ -- Runtime Function: unsigned char __fractunssaqi (accum A)
+ -- Runtime Function: unsigned short __fractunssahi (accum A)
+ -- Runtime Function: unsigned int __fractunssasi (accum A)
+ -- Runtime Function: unsigned long __fractunssadi (accum A)
+ -- Runtime Function: unsigned long long __fractunssati (accum A)
+ -- Runtime Function: unsigned char __fractunsdaqi (long accum A)
+ -- Runtime Function: unsigned short __fractunsdahi (long accum A)
+ -- Runtime Function: unsigned int __fractunsdasi (long accum A)
+ -- Runtime Function: unsigned long __fractunsdadi (long accum A)
+ -- Runtime Function: unsigned long long __fractunsdati (long accum A)
+ -- Runtime Function: unsigned char __fractunstaqi (long long accum A)
+ -- Runtime Function: unsigned short __fractunstahi (long long accum A)
+ -- Runtime Function: unsigned int __fractunstasi (long long accum A)
+ -- Runtime Function: unsigned long __fractunstadi (long long accum A)
+ -- Runtime Function: unsigned long long __fractunstati (long long
+ accum A)
+ -- Runtime Function: unsigned char __fractunsuqqqi (unsigned short
+ fract A)
+ -- Runtime Function: unsigned short __fractunsuqqhi (unsigned short
+ fract A)
+ -- Runtime Function: unsigned int __fractunsuqqsi (unsigned short
+ fract A)
+ -- Runtime Function: unsigned long __fractunsuqqdi (unsigned short
+ fract A)
+ -- Runtime Function: unsigned long long __fractunsuqqti (unsigned
+ short fract A)
+ -- Runtime Function: unsigned char __fractunsuhqqi (unsigned fract A)
+ -- Runtime Function: unsigned short __fractunsuhqhi (unsigned fract A)
+ -- Runtime Function: unsigned int __fractunsuhqsi (unsigned fract A)
+ -- Runtime Function: unsigned long __fractunsuhqdi (unsigned fract A)
+ -- Runtime Function: unsigned long long __fractunsuhqti (unsigned
+ fract A)
+ -- Runtime Function: unsigned char __fractunsusqqi (unsigned long
+ fract A)
+ -- Runtime Function: unsigned short __fractunsusqhi (unsigned long
+ fract A)
+ -- Runtime Function: unsigned int __fractunsusqsi (unsigned long fract
+ A)
+ -- Runtime Function: unsigned long __fractunsusqdi (unsigned long
+ fract A)
+ -- Runtime Function: unsigned long long __fractunsusqti (unsigned long
+ fract A)
+ -- Runtime Function: unsigned char __fractunsudqqi (unsigned long long
+ fract A)
+ -- Runtime Function: unsigned short __fractunsudqhi (unsigned long
+ long fract A)
+ -- Runtime Function: unsigned int __fractunsudqsi (unsigned long long
+ fract A)
+ -- Runtime Function: unsigned long __fractunsudqdi (unsigned long long
+ fract A)
+ -- Runtime Function: unsigned long long __fractunsudqti (unsigned long
+ long fract A)
+ -- Runtime Function: unsigned char __fractunsuhaqi (unsigned short
+ accum A)
+ -- Runtime Function: unsigned short __fractunsuhahi (unsigned short
+ accum A)
+ -- Runtime Function: unsigned int __fractunsuhasi (unsigned short
+ accum A)
+ -- Runtime Function: unsigned long __fractunsuhadi (unsigned short
+ accum A)
+ -- Runtime Function: unsigned long long __fractunsuhati (unsigned
+ short accum A)
+ -- Runtime Function: unsigned char __fractunsusaqi (unsigned accum A)
+ -- Runtime Function: unsigned short __fractunsusahi (unsigned accum A)
+ -- Runtime Function: unsigned int __fractunsusasi (unsigned accum A)
+ -- Runtime Function: unsigned long __fractunsusadi (unsigned accum A)
+ -- Runtime Function: unsigned long long __fractunsusati (unsigned
+ accum A)
+ -- Runtime Function: unsigned char __fractunsudaqi (unsigned long
+ accum A)
+ -- Runtime Function: unsigned short __fractunsudahi (unsigned long
+ accum A)
+ -- Runtime Function: unsigned int __fractunsudasi (unsigned long accum
+ A)
+ -- Runtime Function: unsigned long __fractunsudadi (unsigned long
+ accum A)
+ -- Runtime Function: unsigned long long __fractunsudati (unsigned long
+ accum A)
+ -- Runtime Function: unsigned char __fractunsutaqi (unsigned long long
+ accum A)
+ -- Runtime Function: unsigned short __fractunsutahi (unsigned long
+ long accum A)
+ -- Runtime Function: unsigned int __fractunsutasi (unsigned long long
+ accum A)
+ -- Runtime Function: unsigned long __fractunsutadi (unsigned long long
+ accum A)
+ -- Runtime Function: unsigned long long __fractunsutati (unsigned long
+ long accum A)
+ -- Runtime Function: short fract __fractunsqiqq (unsigned char A)
+ -- Runtime Function: fract __fractunsqihq (unsigned char A)
+ -- Runtime Function: long fract __fractunsqisq (unsigned char A)
+ -- Runtime Function: long long fract __fractunsqidq (unsigned char A)
+ -- Runtime Function: short accum __fractunsqiha (unsigned char A)
+ -- Runtime Function: accum __fractunsqisa (unsigned char A)
+ -- Runtime Function: long accum __fractunsqida (unsigned char A)
+ -- Runtime Function: long long accum __fractunsqita (unsigned char A)
+ -- Runtime Function: unsigned short fract __fractunsqiuqq (unsigned
+ char A)
+ -- Runtime Function: unsigned fract __fractunsqiuhq (unsigned char A)
+ -- Runtime Function: unsigned long fract __fractunsqiusq (unsigned
+ char A)
+ -- Runtime Function: unsigned long long fract __fractunsqiudq
+ (unsigned char A)
+ -- Runtime Function: unsigned short accum __fractunsqiuha (unsigned
+ char A)
+ -- Runtime Function: unsigned accum __fractunsqiusa (unsigned char A)
+ -- Runtime Function: unsigned long accum __fractunsqiuda (unsigned
+ char A)
+ -- Runtime Function: unsigned long long accum __fractunsqiuta
+ (unsigned char A)
+ -- Runtime Function: short fract __fractunshiqq (unsigned short A)
+ -- Runtime Function: fract __fractunshihq (unsigned short A)
+ -- Runtime Function: long fract __fractunshisq (unsigned short A)
+ -- Runtime Function: long long fract __fractunshidq (unsigned short A)
+ -- Runtime Function: short accum __fractunshiha (unsigned short A)
+ -- Runtime Function: accum __fractunshisa (unsigned short A)
+ -- Runtime Function: long accum __fractunshida (unsigned short A)
+ -- Runtime Function: long long accum __fractunshita (unsigned short A)
+ -- Runtime Function: unsigned short fract __fractunshiuqq (unsigned
+ short A)
+ -- Runtime Function: unsigned fract __fractunshiuhq (unsigned short A)
+ -- Runtime Function: unsigned long fract __fractunshiusq (unsigned
+ short A)
+ -- Runtime Function: unsigned long long fract __fractunshiudq
+ (unsigned short A)
+ -- Runtime Function: unsigned short accum __fractunshiuha (unsigned
+ short A)
+ -- Runtime Function: unsigned accum __fractunshiusa (unsigned short A)
+ -- Runtime Function: unsigned long accum __fractunshiuda (unsigned
+ short A)
+ -- Runtime Function: unsigned long long accum __fractunshiuta
+ (unsigned short A)
+ -- Runtime Function: short fract __fractunssiqq (unsigned int A)
+ -- Runtime Function: fract __fractunssihq (unsigned int A)
+ -- Runtime Function: long fract __fractunssisq (unsigned int A)
+ -- Runtime Function: long long fract __fractunssidq (unsigned int A)
+ -- Runtime Function: short accum __fractunssiha (unsigned int A)
+ -- Runtime Function: accum __fractunssisa (unsigned int A)
+ -- Runtime Function: long accum __fractunssida (unsigned int A)
+ -- Runtime Function: long long accum __fractunssita (unsigned int A)
+ -- Runtime Function: unsigned short fract __fractunssiuqq (unsigned
+ int A)
+ -- Runtime Function: unsigned fract __fractunssiuhq (unsigned int A)
+ -- Runtime Function: unsigned long fract __fractunssiusq (unsigned int
+ A)
+ -- Runtime Function: unsigned long long fract __fractunssiudq
+ (unsigned int A)
+ -- Runtime Function: unsigned short accum __fractunssiuha (unsigned
+ int A)
+ -- Runtime Function: unsigned accum __fractunssiusa (unsigned int A)
+ -- Runtime Function: unsigned long accum __fractunssiuda (unsigned int
+ A)
+ -- Runtime Function: unsigned long long accum __fractunssiuta
+ (unsigned int A)
+ -- Runtime Function: short fract __fractunsdiqq (unsigned long A)
+ -- Runtime Function: fract __fractunsdihq (unsigned long A)
+ -- Runtime Function: long fract __fractunsdisq (unsigned long A)
+ -- Runtime Function: long long fract __fractunsdidq (unsigned long A)
+ -- Runtime Function: short accum __fractunsdiha (unsigned long A)
+ -- Runtime Function: accum __fractunsdisa (unsigned long A)
+ -- Runtime Function: long accum __fractunsdida (unsigned long A)
+ -- Runtime Function: long long accum __fractunsdita (unsigned long A)
+ -- Runtime Function: unsigned short fract __fractunsdiuqq (unsigned
+ long A)
+ -- Runtime Function: unsigned fract __fractunsdiuhq (unsigned long A)
+ -- Runtime Function: unsigned long fract __fractunsdiusq (unsigned
+ long A)
+ -- Runtime Function: unsigned long long fract __fractunsdiudq
+ (unsigned long A)
+ -- Runtime Function: unsigned short accum __fractunsdiuha (unsigned
+ long A)
+ -- Runtime Function: unsigned accum __fractunsdiusa (unsigned long A)
+ -- Runtime Function: unsigned long accum __fractunsdiuda (unsigned
+ long A)
+ -- Runtime Function: unsigned long long accum __fractunsdiuta
+ (unsigned long A)
+ -- Runtime Function: short fract __fractunstiqq (unsigned long long A)
+ -- Runtime Function: fract __fractunstihq (unsigned long long A)
+ -- Runtime Function: long fract __fractunstisq (unsigned long long A)
+ -- Runtime Function: long long fract __fractunstidq (unsigned long
+ long A)
+ -- Runtime Function: short accum __fractunstiha (unsigned long long A)
+ -- Runtime Function: accum __fractunstisa (unsigned long long A)
+ -- Runtime Function: long accum __fractunstida (unsigned long long A)
+ -- Runtime Function: long long accum __fractunstita (unsigned long
+ long A)
+ -- Runtime Function: unsigned short fract __fractunstiuqq (unsigned
+ long long A)
+ -- Runtime Function: unsigned fract __fractunstiuhq (unsigned long
+ long A)
+ -- Runtime Function: unsigned long fract __fractunstiusq (unsigned
+ long long A)
+ -- Runtime Function: unsigned long long fract __fractunstiudq
+ (unsigned long long A)
+ -- Runtime Function: unsigned short accum __fractunstiuha (unsigned
+ long long A)
+ -- Runtime Function: unsigned accum __fractunstiusa (unsigned long
+ long A)
+ -- Runtime Function: unsigned long accum __fractunstiuda (unsigned
+ long long A)
+ -- Runtime Function: unsigned long long accum __fractunstiuta
+ (unsigned long long A)
+ These functions convert from fractionals to unsigned
+ non-fractionals; and from unsigned non-fractionals to fractionals,
+ without saturation.
+
+ -- Runtime Function: short fract __satfractunsqiqq (unsigned char A)
+ -- Runtime Function: fract __satfractunsqihq (unsigned char A)
+ -- Runtime Function: long fract __satfractunsqisq (unsigned char A)
+ -- Runtime Function: long long fract __satfractunsqidq (unsigned char
+ A)
+ -- Runtime Function: short accum __satfractunsqiha (unsigned char A)
+ -- Runtime Function: accum __satfractunsqisa (unsigned char A)
+ -- Runtime Function: long accum __satfractunsqida (unsigned char A)
+ -- Runtime Function: long long accum __satfractunsqita (unsigned char
+ A)
+ -- Runtime Function: unsigned short fract __satfractunsqiuqq (unsigned
+ char A)
+ -- Runtime Function: unsigned fract __satfractunsqiuhq (unsigned char
+ A)
+ -- Runtime Function: unsigned long fract __satfractunsqiusq (unsigned
+ char A)
+ -- Runtime Function: unsigned long long fract __satfractunsqiudq
+ (unsigned char A)
+ -- Runtime Function: unsigned short accum __satfractunsqiuha (unsigned
+ char A)
+ -- Runtime Function: unsigned accum __satfractunsqiusa (unsigned char
+ A)
+ -- Runtime Function: unsigned long accum __satfractunsqiuda (unsigned
+ char A)
+ -- Runtime Function: unsigned long long accum __satfractunsqiuta
+ (unsigned char A)
+ -- Runtime Function: short fract __satfractunshiqq (unsigned short A)
+ -- Runtime Function: fract __satfractunshihq (unsigned short A)
+ -- Runtime Function: long fract __satfractunshisq (unsigned short A)
+ -- Runtime Function: long long fract __satfractunshidq (unsigned short
+ A)
+ -- Runtime Function: short accum __satfractunshiha (unsigned short A)
+ -- Runtime Function: accum __satfractunshisa (unsigned short A)
+ -- Runtime Function: long accum __satfractunshida (unsigned short A)
+ -- Runtime Function: long long accum __satfractunshita (unsigned short
+ A)
+ -- Runtime Function: unsigned short fract __satfractunshiuqq (unsigned
+ short A)
+ -- Runtime Function: unsigned fract __satfractunshiuhq (unsigned short
+ A)
+ -- Runtime Function: unsigned long fract __satfractunshiusq (unsigned
+ short A)
+ -- Runtime Function: unsigned long long fract __satfractunshiudq
+ (unsigned short A)
+ -- Runtime Function: unsigned short accum __satfractunshiuha (unsigned
+ short A)
+ -- Runtime Function: unsigned accum __satfractunshiusa (unsigned short
+ A)
+ -- Runtime Function: unsigned long accum __satfractunshiuda (unsigned
+ short A)
+ -- Runtime Function: unsigned long long accum __satfractunshiuta
+ (unsigned short A)
+ -- Runtime Function: short fract __satfractunssiqq (unsigned int A)
+ -- Runtime Function: fract __satfractunssihq (unsigned int A)
+ -- Runtime Function: long fract __satfractunssisq (unsigned int A)
+ -- Runtime Function: long long fract __satfractunssidq (unsigned int A)
+ -- Runtime Function: short accum __satfractunssiha (unsigned int A)
+ -- Runtime Function: accum __satfractunssisa (unsigned int A)
+ -- Runtime Function: long accum __satfractunssida (unsigned int A)
+ -- Runtime Function: long long accum __satfractunssita (unsigned int A)
+ -- Runtime Function: unsigned short fract __satfractunssiuqq (unsigned
+ int A)
+ -- Runtime Function: unsigned fract __satfractunssiuhq (unsigned int A)
+ -- Runtime Function: unsigned long fract __satfractunssiusq (unsigned
+ int A)
+ -- Runtime Function: unsigned long long fract __satfractunssiudq
+ (unsigned int A)
+ -- Runtime Function: unsigned short accum __satfractunssiuha (unsigned
+ int A)
+ -- Runtime Function: unsigned accum __satfractunssiusa (unsigned int A)
+ -- Runtime Function: unsigned long accum __satfractunssiuda (unsigned
+ int A)
+ -- Runtime Function: unsigned long long accum __satfractunssiuta
+ (unsigned int A)
+ -- Runtime Function: short fract __satfractunsdiqq (unsigned long A)
+ -- Runtime Function: fract __satfractunsdihq (unsigned long A)
+ -- Runtime Function: long fract __satfractunsdisq (unsigned long A)
+ -- Runtime Function: long long fract __satfractunsdidq (unsigned long
+ A)
+ -- Runtime Function: short accum __satfractunsdiha (unsigned long A)
+ -- Runtime Function: accum __satfractunsdisa (unsigned long A)
+ -- Runtime Function: long accum __satfractunsdida (unsigned long A)
+ -- Runtime Function: long long accum __satfractunsdita (unsigned long
+ A)
+ -- Runtime Function: unsigned short fract __satfractunsdiuqq (unsigned
+ long A)
+ -- Runtime Function: unsigned fract __satfractunsdiuhq (unsigned long
+ A)
+ -- Runtime Function: unsigned long fract __satfractunsdiusq (unsigned
+ long A)
+ -- Runtime Function: unsigned long long fract __satfractunsdiudq
+ (unsigned long A)
+ -- Runtime Function: unsigned short accum __satfractunsdiuha (unsigned
+ long A)
+ -- Runtime Function: unsigned accum __satfractunsdiusa (unsigned long
+ A)
+ -- Runtime Function: unsigned long accum __satfractunsdiuda (unsigned
+ long A)
+ -- Runtime Function: unsigned long long accum __satfractunsdiuta
+ (unsigned long A)
+ -- Runtime Function: short fract __satfractunstiqq (unsigned long long
+ A)
+ -- Runtime Function: fract __satfractunstihq (unsigned long long A)
+ -- Runtime Function: long fract __satfractunstisq (unsigned long long
+ A)
+ -- Runtime Function: long long fract __satfractunstidq (unsigned long
+ long A)
+ -- Runtime Function: short accum __satfractunstiha (unsigned long long
+ A)
+ -- Runtime Function: accum __satfractunstisa (unsigned long long A)
+ -- Runtime Function: long accum __satfractunstida (unsigned long long
+ A)
+ -- Runtime Function: long long accum __satfractunstita (unsigned long
+ long A)
+ -- Runtime Function: unsigned short fract __satfractunstiuqq (unsigned
+ long long A)
+ -- Runtime Function: unsigned fract __satfractunstiuhq (unsigned long
+ long A)
+ -- Runtime Function: unsigned long fract __satfractunstiusq (unsigned
+ long long A)
+ -- Runtime Function: unsigned long long fract __satfractunstiudq
+ (unsigned long long A)
+ -- Runtime Function: unsigned short accum __satfractunstiuha (unsigned
+ long long A)
+ -- Runtime Function: unsigned accum __satfractunstiusa (unsigned long
+ long A)
+ -- Runtime Function: unsigned long accum __satfractunstiuda (unsigned
+ long long A)
+ -- Runtime Function: unsigned long long accum __satfractunstiuta
+ (unsigned long long A)
+ These functions convert from unsigned non-fractionals to
+ fractionals, with saturation.
+
+
+File: gccint.info, Node: Exception handling routines, Next: Miscellaneous routines, Prev: Fixed-point fractional library routines, Up: Libgcc
+
+4.5 Language-independent routines for exception handling
+========================================================
+
+document me!
+
+ _Unwind_DeleteException
+ _Unwind_Find_FDE
+ _Unwind_ForcedUnwind
+ _Unwind_GetGR
+ _Unwind_GetIP
+ _Unwind_GetLanguageSpecificData
+ _Unwind_GetRegionStart
+ _Unwind_GetTextRelBase
+ _Unwind_GetDataRelBase
+ _Unwind_RaiseException
+ _Unwind_Resume
+ _Unwind_SetGR
+ _Unwind_SetIP
+ _Unwind_FindEnclosingFunction
+ _Unwind_SjLj_Register
+ _Unwind_SjLj_Unregister
+ _Unwind_SjLj_RaiseException
+ _Unwind_SjLj_ForcedUnwind
+ _Unwind_SjLj_Resume
+ __deregister_frame
+ __deregister_frame_info
+ __deregister_frame_info_bases
+ __register_frame
+ __register_frame_info
+ __register_frame_info_bases
+ __register_frame_info_table
+ __register_frame_info_table_bases
+ __register_frame_table
+
+
+File: gccint.info, Node: Miscellaneous routines, Prev: Exception handling routines, Up: Libgcc
+
+4.6 Miscellaneous runtime library routines
+==========================================
+
+4.6.1 Cache control functions
+-----------------------------
+
+ -- Runtime Function: void __clear_cache (char *BEG, char *END)
+ This function clears the instruction cache between BEG and END.
+
+
+File: gccint.info, Node: Languages, Next: Source Tree, Prev: Libgcc, Up: Top
+
+5 Language Front Ends in GCC
+****************************
+
+The interface to front ends for languages in GCC, and in particular the
+`tree' structure (*note Trees::), was initially designed for C, and
+many aspects of it are still somewhat biased towards C and C-like
+languages. It is, however, reasonably well suited to other procedural
+languages, and front ends for many such languages have been written for
+GCC.
+
+ Writing a compiler as a front end for GCC, rather than compiling
+directly to assembler or generating C code which is then compiled by
+GCC, has several advantages:
+
+ * GCC front ends benefit from the support for many different target
+ machines already present in GCC.
+
+ * GCC front ends benefit from all the optimizations in GCC. Some of
+ these, such as alias analysis, may work better when GCC is
+ compiling directly from source code then when it is compiling from
+ generated C code.
+
+ * Better debugging information is generated when compiling directly
+ from source code than when going via intermediate generated C code.
+
+ Because of the advantages of writing a compiler as a GCC front end,
+GCC front ends have also been created for languages very different from
+those for which GCC was designed, such as the declarative
+logic/functional language Mercury. For these reasons, it may also be
+useful to implement compilers created for specialized purposes (for
+example, as part of a research project) as GCC front ends.
+
+
+File: gccint.info, Node: Source Tree, Next: Options, Prev: Languages, Up: Top
+
+6 Source Tree Structure and Build System
+****************************************
+
+This chapter describes the structure of the GCC source tree, and how
+GCC is built. The user documentation for building and installing GCC
+is in a separate manual (`http://gcc.gnu.org/install/'), with which it
+is presumed that you are familiar.
+
+* Menu:
+
+* Configure Terms:: Configuration terminology and history.
+* Top Level:: The top level source directory.
+* gcc Directory:: The `gcc' subdirectory.
+* Testsuites:: The GCC testsuites.
+
+
+File: gccint.info, Node: Configure Terms, Next: Top Level, Up: Source Tree
+
+6.1 Configure Terms and History
+===============================
+
+The configure and build process has a long and colorful history, and can
+be confusing to anyone who doesn't know why things are the way they are.
+While there are other documents which describe the configuration process
+in detail, here are a few things that everyone working on GCC should
+know.
+
+ There are three system names that the build knows about: the machine
+you are building on ("build"), the machine that you are building for
+("host"), and the machine that GCC will produce code for ("target").
+When you configure GCC, you specify these with `--build=', `--host=',
+and `--target='.
+
+ Specifying the host without specifying the build should be avoided, as
+`configure' may (and once did) assume that the host you specify is also
+the build, which may not be true.
+
+ If build, host, and target are all the same, this is called a
+"native". If build and host are the same but target is different, this
+is called a "cross". If build, host, and target are all different this
+is called a "canadian" (for obscure reasons dealing with Canada's
+political party and the background of the person working on the build
+at that time). If host and target are the same, but build is
+different, you are using a cross-compiler to build a native for a
+different system. Some people call this a "host-x-host", "crossed
+native", or "cross-built native". If build and target are the same,
+but host is different, you are using a cross compiler to build a cross
+compiler that produces code for the machine you're building on. This
+is rare, so there is no common way of describing it. There is a
+proposal to call this a "crossback".
+
+ If build and host are the same, the GCC you are building will also be
+used to build the target libraries (like `libstdc++'). If build and
+host are different, you must have already built and installed a cross
+compiler that will be used to build the target libraries (if you
+configured with `--target=foo-bar', this compiler will be called
+`foo-bar-gcc').
+
+ In the case of target libraries, the machine you're building for is the
+machine you specified with `--target'. So, build is the machine you're
+building on (no change there), host is the machine you're building for
+(the target libraries are built for the target, so host is the target
+you specified), and target doesn't apply (because you're not building a
+compiler, you're building libraries). The configure/make process will
+adjust these variables as needed. It also sets `$with_cross_host' to
+the original `--host' value in case you need it.
+
+ The `libiberty' support library is built up to three times: once for
+the host, once for the target (even if they are the same), and once for
+the build if build and host are different. This allows it to be used
+by all programs which are generated in the course of the build process.
+
+
+File: gccint.info, Node: Top Level, Next: gcc Directory, Prev: Configure Terms, Up: Source Tree
+
+6.2 Top Level Source Directory
+==============================
+
+The top level source directory in a GCC distribution contains several
+files and directories that are shared with other software distributions
+such as that of GNU Binutils. It also contains several subdirectories
+that contain parts of GCC and its runtime libraries:
+
+`boehm-gc'
+ The Boehm conservative garbage collector, used as part of the Java
+ runtime library.
+
+`contrib'
+ Contributed scripts that may be found useful in conjunction with
+ GCC. One of these, `contrib/texi2pod.pl', is used to generate man
+ pages from Texinfo manuals as part of the GCC build process.
+
+`fastjar'
+ An implementation of the `jar' command, used with the Java front
+ end.
+
+`fixincludes'
+ The support for fixing system headers to work with GCC. See
+ `fixincludes/README' for more information. The headers fixed by
+ this mechanism are installed in `LIBSUBDIR/include-fixed'. Along
+ with those headers, `README-fixinc' is also installed, as
+ `LIBSUBDIR/include-fixed/README'.
+
+`gcc'
+ The main sources of GCC itself (except for runtime libraries),
+ including optimizers, support for different target architectures,
+ language front ends, and testsuites. *Note The `gcc'
+ Subdirectory: gcc Directory, for details.
+
+`include'
+ Headers for the `libiberty' library.
+
+`intl'
+ GNU `libintl', from GNU `gettext', for systems which do not
+ include it in libc.
+
+`libada'
+ The Ada runtime library.
+
+`libcpp'
+ The C preprocessor library.
+
+`libgfortran'
+ The Fortran runtime library.
+
+`libffi'
+ The `libffi' library, used as part of the Java runtime library.
+
+`libiberty'
+ The `libiberty' library, used for portability and for some
+ generally useful data structures and algorithms. *Note
+ Introduction: (libiberty)Top, for more information about this
+ library.
+
+`libjava'
+ The Java runtime library.
+
+`libmudflap'
+ The `libmudflap' library, used for instrumenting pointer and array
+ dereferencing operations.
+
+`libobjc'
+ The Objective-C and Objective-C++ runtime library.
+
+`libstdc++-v3'
+ The C++ runtime library.
+
+`maintainer-scripts'
+ Scripts used by the `gccadmin' account on `gcc.gnu.org'.
+
+`zlib'
+ The `zlib' compression library, used by the Java front end and as
+ part of the Java runtime library.
+
+ The build system in the top level directory, including how recursion
+into subdirectories works and how building runtime libraries for
+multilibs is handled, is documented in a separate manual, included with
+GNU Binutils. *Note GNU configure and build system: (configure)Top,
+for details.
+
+
+File: gccint.info, Node: gcc Directory, Next: Testsuites, Prev: Top Level, Up: Source Tree
+
+6.3 The `gcc' Subdirectory
+==========================
+
+The `gcc' directory contains many files that are part of the C sources
+of GCC, other files used as part of the configuration and build
+process, and subdirectories including documentation and a testsuite.
+The files that are sources of GCC are documented in a separate chapter.
+*Note Passes and Files of the Compiler: Passes.
+
+* Menu:
+
+* Subdirectories:: Subdirectories of `gcc'.
+* Configuration:: The configuration process, and the files it uses.
+* Build:: The build system in the `gcc' directory.
+* Makefile:: Targets in `gcc/Makefile'.
+* Library Files:: Library source files and headers under `gcc/'.
+* Headers:: Headers installed by GCC.
+* Documentation:: Building documentation in GCC.
+* Front End:: Anatomy of a language front end.
+* Back End:: Anatomy of a target back end.
+
+
+File: gccint.info, Node: Subdirectories, Next: Configuration, Up: gcc Directory
+
+6.3.1 Subdirectories of `gcc'
+-----------------------------
+
+The `gcc' directory contains the following subdirectories:
+
+`LANGUAGE'
+ Subdirectories for various languages. Directories containing a
+ file `config-lang.in' are language subdirectories. The contents of
+ the subdirectories `cp' (for C++), `objc' (for Objective-C) and
+ `objcp' (for Objective-C++) are documented in this manual (*note
+ Passes and Files of the Compiler: Passes.); those for other
+ languages are not. *Note Anatomy of a Language Front End: Front
+ End, for details of the files in these directories.
+
+`config'
+ Configuration files for supported architectures and operating
+ systems. *Note Anatomy of a Target Back End: Back End, for
+ details of the files in this directory.
+
+`doc'
+ Texinfo documentation for GCC, together with automatically
+ generated man pages and support for converting the installation
+ manual to HTML. *Note Documentation::.
+
+`ginclude'
+ System headers installed by GCC, mainly those required by the C
+ standard of freestanding implementations. *Note Headers Installed
+ by GCC: Headers, for details of when these and other headers are
+ installed.
+
+`po'
+ Message catalogs with translations of messages produced by GCC into
+ various languages, `LANGUAGE.po'. This directory also contains
+ `gcc.pot', the template for these message catalogues, `exgettext',
+ a wrapper around `gettext' to extract the messages from the GCC
+ sources and create `gcc.pot', which is run by `make gcc.pot', and
+ `EXCLUDES', a list of files from which messages should not be
+ extracted.
+
+`testsuite'
+ The GCC testsuites (except for those for runtime libraries).
+ *Note Testsuites::.
+
+
+File: gccint.info, Node: Configuration, Next: Build, Prev: Subdirectories, Up: gcc Directory
+
+6.3.2 Configuration in the `gcc' Directory
+------------------------------------------
+
+The `gcc' directory is configured with an Autoconf-generated script
+`configure'. The `configure' script is generated from `configure.ac'
+and `aclocal.m4'. From the files `configure.ac' and `acconfig.h',
+Autoheader generates the file `config.in'. The file `cstamp-h.in' is
+used as a timestamp.
+
+* Menu:
+
+* Config Fragments:: Scripts used by `configure'.
+* System Config:: The `config.build', `config.host', and
+ `config.gcc' files.
+* Configuration Files:: Files created by running `configure'.
+
+
+File: gccint.info, Node: Config Fragments, Next: System Config, Up: Configuration
+
+6.3.2.1 Scripts Used by `configure'
+...................................
+
+`configure' uses some other scripts to help in its work:
+
+ * The standard GNU `config.sub' and `config.guess' files, kept in
+ the top level directory, are used.
+
+ * The file `config.gcc' is used to handle configuration specific to
+ the particular target machine. The file `config.build' is used to
+ handle configuration specific to the particular build machine.
+ The file `config.host' is used to handle configuration specific to
+ the particular host machine. (In general, these should only be
+ used for features that cannot reasonably be tested in Autoconf
+ feature tests.) *Note The `config.build'; `config.host'; and
+ `config.gcc' Files: System Config, for details of the contents of
+ these files.
+
+ * Each language subdirectory has a file `LANGUAGE/config-lang.in'
+ that is used for front-end-specific configuration. *Note The
+ Front End `config-lang.in' File: Front End Config, for details of
+ this file.
+
+ * A helper script `configure.frag' is used as part of creating the
+ output of `configure'.
+
+
+File: gccint.info, Node: System Config, Next: Configuration Files, Prev: Config Fragments, Up: Configuration
+
+6.3.2.2 The `config.build'; `config.host'; and `config.gcc' Files
+.................................................................
+
+The `config.build' file contains specific rules for particular systems
+which GCC is built on. This should be used as rarely as possible, as
+the behavior of the build system can always be detected by autoconf.
+
+ The `config.host' file contains specific rules for particular systems
+which GCC will run on. This is rarely needed.
+
+ The `config.gcc' file contains specific rules for particular systems
+which GCC will generate code for. This is usually needed.
+
+ Each file has a list of the shell variables it sets, with
+descriptions, at the top of the file.
+
+ FIXME: document the contents of these files, and what variables should
+be set to control build, host and target configuration.
+
+
+File: gccint.info, Node: Configuration Files, Prev: System Config, Up: Configuration
+
+6.3.2.3 Files Created by `configure'
+....................................
+
+Here we spell out what files will be set up by `configure' in the `gcc'
+directory. Some other files are created as temporary files in the
+configuration process, and are not used in the subsequent build; these
+are not documented.
+
+ * `Makefile' is constructed from `Makefile.in', together with the
+ host and target fragments (*note Makefile Fragments: Fragments.)
+ `t-TARGET' and `x-HOST' from `config', if any, and language
+ Makefile fragments `LANGUAGE/Make-lang.in'.
+
+ * `auto-host.h' contains information about the host machine
+ determined by `configure'. If the host machine is different from
+ the build machine, then `auto-build.h' is also created, containing
+ such information about the build machine.
+
+ * `config.status' is a script that may be run to recreate the
+ current configuration.
+
+ * `configargs.h' is a header containing details of the arguments
+ passed to `configure' to configure GCC, and of the thread model
+ used.
+
+ * `cstamp-h' is used as a timestamp.
+
+ * `fixinc/Makefile' is constructed from `fixinc/Makefile.in'.
+
+ * `gccbug', a script for reporting bugs in GCC, is constructed from
+ `gccbug.in'.
+
+ * `intl/Makefile' is constructed from `intl/Makefile.in'.
+
+ * If a language `config-lang.in' file (*note The Front End
+ `config-lang.in' File: Front End Config.) sets `outputs', then the
+ files listed in `outputs' there are also generated.
+
+ The following configuration headers are created from the Makefile,
+using `mkconfig.sh', rather than directly by `configure'. `config.h',
+`bconfig.h' and `tconfig.h' all contain the `xm-MACHINE.h' header, if
+any, appropriate to the host, build and target machines respectively,
+the configuration headers for the target, and some definitions; for the
+host and build machines, these include the autoconfigured headers
+generated by `configure'. The other configuration headers are
+determined by `config.gcc'. They also contain the typedefs for `rtx',
+`rtvec' and `tree'.
+
+ * `config.h', for use in programs that run on the host machine.
+
+ * `bconfig.h', for use in programs that run on the build machine.
+
+ * `tconfig.h', for use in programs and libraries for the target
+ machine.
+
+ * `tm_p.h', which includes the header `MACHINE-protos.h' that
+ contains prototypes for functions in the target `.c' file. FIXME:
+ why is such a separate header necessary?
+
+
+File: gccint.info, Node: Build, Next: Makefile, Prev: Configuration, Up: gcc Directory
+
+6.3.3 Build System in the `gcc' Directory
+-----------------------------------------
+
+FIXME: describe the build system, including what is built in what
+stages. Also list the various source files that are used in the build
+process but aren't source files of GCC itself and so aren't documented
+below (*note Passes::).
+
+
+File: gccint.info, Node: Makefile, Next: Library Files, Prev: Build, Up: gcc Directory
+
+6.3.4 Makefile Targets
+----------------------
+
+These targets are available from the `gcc' directory:
+
+`all'
+ This is the default target. Depending on what your
+ build/host/target configuration is, it coordinates all the things
+ that need to be built.
+
+`doc'
+ Produce info-formatted documentation and man pages. Essentially it
+ calls `make man' and `make info'.
+
+`dvi'
+ Produce DVI-formatted documentation.
+
+`pdf'
+ Produce PDF-formatted documentation.
+
+`html'
+ Produce HTML-formatted documentation.
+
+`man'
+ Generate man pages.
+
+`info'
+ Generate info-formatted pages.
+
+`mostlyclean'
+ Delete the files made while building the compiler.
+
+`clean'
+ That, and all the other files built by `make all'.
+
+`distclean'
+ That, and all the files created by `configure'.
+
+`maintainer-clean'
+ Distclean plus any file that can be generated from other files.
+ Note that additional tools may be required beyond what is normally
+ needed to build gcc.
+
+`srcextra'
+ Generates files in the source directory that do not exist in CVS
+ but should go into a release tarball. One example is
+ `gcc/java/parse.c' which is generated from the CVS source file
+ `gcc/java/parse.y'.
+
+`srcinfo'
+`srcman'
+ Copies the info-formatted and manpage documentation into the source
+ directory usually for the purpose of generating a release tarball.
+
+`install'
+ Installs gcc.
+
+`uninstall'
+ Deletes installed files.
+
+`check'
+ Run the testsuite. This creates a `testsuite' subdirectory that
+ has various `.sum' and `.log' files containing the results of the
+ testing. You can run subsets with, for example, `make check-gcc'.
+ You can specify specific tests by setting RUNTESTFLAGS to be the
+ name of the `.exp' file, optionally followed by (for some tests)
+ an equals and a file wildcard, like:
+
+ make check-gcc RUNTESTFLAGS="execute.exp=19980413-*"
+
+ Note that running the testsuite may require additional tools be
+ installed, such as TCL or dejagnu.
+
+ The toplevel tree from which you start GCC compilation is not the GCC
+directory, but rather a complex Makefile that coordinates the various
+steps of the build, including bootstrapping the compiler and using the
+new compiler to build target libraries.
+
+ When GCC is configured for a native configuration, the default action
+for `make' is to do a full three-stage bootstrap. This means that GCC
+is built three times--once with the native compiler, once with the
+native-built compiler it just built, and once with the compiler it
+built the second time. In theory, the last two should produce the same
+results, which `make compare' can check. Each stage is configured
+separately and compiled into a separate directory, to minimize problems
+due to ABI incompatibilities between the native compiler and GCC.
+
+ If you do a change, rebuilding will also start from the first stage
+and "bubble" up the change through the three stages. Each stage is
+taken from its build directory (if it had been built previously),
+rebuilt, and copied to its subdirectory. This will allow you to, for
+example, continue a bootstrap after fixing a bug which causes the
+stage2 build to crash. It does not provide as good coverage of the
+compiler as bootstrapping from scratch, but it ensures that the new
+code is syntactically correct (e.g., that you did not use GCC extensions
+by mistake), and avoids spurious bootstrap comparison failures(1).
+
+ Other targets available from the top level include:
+
+`bootstrap-lean'
+ Like `bootstrap', except that the various stages are removed once
+ they're no longer needed. This saves disk space.
+
+`bootstrap2'
+`bootstrap2-lean'
+ Performs only the first two stages of bootstrap. Unlike a
+ three-stage bootstrap, this does not perform a comparison to test
+ that the compiler is running properly. Note that the disk space
+ required by a "lean" bootstrap is approximately independent of the
+ number of stages.
+
+`stageN-bubble (N = 1...4)'
+ Rebuild all the stages up to N, with the appropriate flags,
+ "bubbling" the changes as described above.
+
+`all-stageN (N = 1...4)'
+ Assuming that stage N has already been built, rebuild it with the
+ appropriate flags. This is rarely needed.
+
+`cleanstrap'
+ Remove everything (`make clean') and rebuilds (`make bootstrap').
+
+`compare'
+ Compares the results of stages 2 and 3. This ensures that the
+ compiler is running properly, since it should produce the same
+ object files regardless of how it itself was compiled.
+
+`profiledbootstrap'
+ Builds a compiler with profiling feedback information. For more
+ information, see *Note Building with profile feedback:
+ (gccinstall)Building.
+
+`restrap'
+ Restart a bootstrap, so that everything that was not built with
+ the system compiler is rebuilt.
+
+`stageN-start (N = 1...4)'
+ For each package that is bootstrapped, rename directories so that,
+ for example, `gcc' points to the stageN GCC, compiled with the
+ stageN-1 GCC(2).
+
+ You will invoke this target if you need to test or debug the
+ stageN GCC. If you only need to execute GCC (but you need not run
+ `make' either to rebuild it or to run test suites), you should be
+ able to work directly in the `stageN-gcc' directory. This makes
+ it easier to debug multiple stages in parallel.
+
+`stage'
+ For each package that is bootstrapped, relocate its build directory
+ to indicate its stage. For example, if the `gcc' directory points
+ to the stage2 GCC, after invoking this target it will be renamed
+ to `stage2-gcc'.
+
+
+ If you wish to use non-default GCC flags when compiling the stage2 and
+stage3 compilers, set `BOOT_CFLAGS' on the command line when doing
+`make'.
+
+ Usually, the first stage only builds the languages that the compiler
+is written in: typically, C and maybe Ada. If you are debugging a
+miscompilation of a different stage2 front-end (for example, of the
+Fortran front-end), you may want to have front-ends for other languages
+in the first stage as well. To do so, set `STAGE1_LANGUAGES' on the
+command line when doing `make'.
+
+ For example, in the aforementioned scenario of debugging a Fortran
+front-end miscompilation caused by the stage1 compiler, you may need a
+command like
+
+ make stage2-bubble STAGE1_LANGUAGES=c,fortran
+
+ Alternatively, you can use per-language targets to build and test
+languages that are not enabled by default in stage1. For example,
+`make f951' will build a Fortran compiler even in the stage1 build
+directory.
+
+ ---------- Footnotes ----------
+
+ (1) Except if the compiler was buggy and miscompiled some of the files
+that were not modified. In this case, it's best to use `make restrap'.
+
+ (2) Customarily, the system compiler is also termed the `stage0' GCC.
+
+
+File: gccint.info, Node: Library Files, Next: Headers, Prev: Makefile, Up: gcc Directory
+
+6.3.5 Library Source Files and Headers under the `gcc' Directory
+----------------------------------------------------------------
+
+FIXME: list here, with explanation, all the C source files and headers
+under the `gcc' directory that aren't built into the GCC executable but
+rather are part of runtime libraries and object files, such as
+`crtstuff.c' and `unwind-dw2.c'. *Note Headers Installed by GCC:
+Headers, for more information about the `ginclude' directory.
+
+
+File: gccint.info, Node: Headers, Next: Documentation, Prev: Library Files, Up: gcc Directory
+
+6.3.6 Headers Installed by GCC
+------------------------------
+
+In general, GCC expects the system C library to provide most of the
+headers to be used with it. However, GCC will fix those headers if
+necessary to make them work with GCC, and will install some headers
+required of freestanding implementations. These headers are installed
+in `LIBSUBDIR/include'. Headers for non-C runtime libraries are also
+installed by GCC; these are not documented here. (FIXME: document them
+somewhere.)
+
+ Several of the headers GCC installs are in the `ginclude' directory.
+These headers, `iso646.h', `stdarg.h', `stdbool.h', and `stddef.h', are
+installed in `LIBSUBDIR/include', unless the target Makefile fragment
+(*note Target Fragment::) overrides this by setting `USER_H'.
+
+ In addition to these headers and those generated by fixing system
+headers to work with GCC, some other headers may also be installed in
+`LIBSUBDIR/include'. `config.gcc' may set `extra_headers'; this
+specifies additional headers under `config' to be installed on some
+systems.
+
+ GCC installs its own version of `<float.h>', from `ginclude/float.h'.
+This is done to cope with command-line options that change the
+representation of floating point numbers.
+
+ GCC also installs its own version of `<limits.h>'; this is generated
+from `glimits.h', together with `limitx.h' and `limity.h' if the system
+also has its own version of `<limits.h>'. (GCC provides its own header
+because it is required of ISO C freestanding implementations, but needs
+to include the system header from its own header as well because other
+standards such as POSIX specify additional values to be defined in
+`<limits.h>'.) The system's `<limits.h>' header is used via
+`LIBSUBDIR/include/syslimits.h', which is copied from `gsyslimits.h' if
+it does not need fixing to work with GCC; if it needs fixing,
+`syslimits.h' is the fixed copy.
+
+ GCC can also install `<tgmath.h>'. It will do this when `config.gcc'
+sets `use_gcc_tgmath' to `yes'.
+
+
+File: gccint.info, Node: Documentation, Next: Front End, Prev: Headers, Up: gcc Directory
+
+6.3.7 Building Documentation
+----------------------------
+
+The main GCC documentation is in the form of manuals in Texinfo format.
+These are installed in Info format; DVI versions may be generated by
+`make dvi', PDF versions by `make pdf', and HTML versions by `make
+html'. In addition, some man pages are generated from the Texinfo
+manuals, there are some other text files with miscellaneous
+documentation, and runtime libraries have their own documentation
+outside the `gcc' directory. FIXME: document the documentation for
+runtime libraries somewhere.
+
+* Menu:
+
+* Texinfo Manuals:: GCC manuals in Texinfo format.
+* Man Page Generation:: Generating man pages from Texinfo manuals.
+* Miscellaneous Docs:: Miscellaneous text files with documentation.
+
+
+File: gccint.info, Node: Texinfo Manuals, Next: Man Page Generation, Up: Documentation
+
+6.3.7.1 Texinfo Manuals
+.......................
+
+The manuals for GCC as a whole, and the C and C++ front ends, are in
+files `doc/*.texi'. Other front ends have their own manuals in files
+`LANGUAGE/*.texi'. Common files `doc/include/*.texi' are provided
+which may be included in multiple manuals; the following files are in
+`doc/include':
+
+`fdl.texi'
+ The GNU Free Documentation License.
+
+`funding.texi'
+ The section "Funding Free Software".
+
+`gcc-common.texi'
+ Common definitions for manuals.
+
+`gpl.texi'
+`gpl_v3.texi'
+ The GNU General Public License.
+
+`texinfo.tex'
+ A copy of `texinfo.tex' known to work with the GCC manuals.
+
+ DVI-formatted manuals are generated by `make dvi', which uses
+`texi2dvi' (via the Makefile macro `$(TEXI2DVI)'). PDF-formatted
+manuals are generated by `make pdf', which uses `texi2pdf' (via the
+Makefile macro `$(TEXI2PDF)'). HTML formatted manuals are generated by
+`make html'. Info manuals are generated by `make info' (which is run
+as part of a bootstrap); this generates the manuals in the source
+directory, using `makeinfo' via the Makefile macro `$(MAKEINFO)', and
+they are included in release distributions.
+
+ Manuals are also provided on the GCC web site, in both HTML and
+PostScript forms. This is done via the script
+`maintainer-scripts/update_web_docs'. Each manual to be provided
+online must be listed in the definition of `MANUALS' in that file; a
+file `NAME.texi' must only appear once in the source tree, and the
+output manual must have the same name as the source file. (However,
+other Texinfo files, included in manuals but not themselves the root
+files of manuals, may have names that appear more than once in the
+source tree.) The manual file `NAME.texi' should only include other
+files in its own directory or in `doc/include'. HTML manuals will be
+generated by `makeinfo --html', PostScript manuals by `texi2dvi' and
+`dvips', and PDF manuals by `texi2pdf'. All Texinfo files that are
+parts of manuals must be checked into SVN, even if they are generated
+files, for the generation of online manuals to work.
+
+ The installation manual, `doc/install.texi', is also provided on the
+GCC web site. The HTML version is generated by the script
+`doc/install.texi2html'.
+
+
+File: gccint.info, Node: Man Page Generation, Next: Miscellaneous Docs, Prev: Texinfo Manuals, Up: Documentation
+
+6.3.7.2 Man Page Generation
+...........................
+
+Because of user demand, in addition to full Texinfo manuals, man pages
+are provided which contain extracts from those manuals. These man
+pages are generated from the Texinfo manuals using
+`contrib/texi2pod.pl' and `pod2man'. (The man page for `g++',
+`cp/g++.1', just contains a `.so' reference to `gcc.1', but all the
+other man pages are generated from Texinfo manuals.)
+
+ Because many systems may not have the necessary tools installed to
+generate the man pages, they are only generated if the `configure'
+script detects that recent enough tools are installed, and the
+Makefiles allow generating man pages to fail without aborting the
+build. Man pages are also included in release distributions. They are
+generated in the source directory.
+
+ Magic comments in Texinfo files starting `@c man' control what parts
+of a Texinfo file go into a man page. Only a subset of Texinfo is
+supported by `texi2pod.pl', and it may be necessary to add support for
+more Texinfo features to this script when generating new man pages. To
+improve the man page output, some special Texinfo macros are provided
+in `doc/include/gcc-common.texi' which `texi2pod.pl' understands:
+
+`@gcctabopt'
+ Use in the form `@table @gcctabopt' for tables of options, where
+ for printed output the effect of `@code' is better than that of
+ `@option' but for man page output a different effect is wanted.
+
+`@gccoptlist'
+ Use for summary lists of options in manuals.
+
+`@gol'
+ Use at the end of each line inside `@gccoptlist'. This is
+ necessary to avoid problems with differences in how the
+ `@gccoptlist' macro is handled by different Texinfo formatters.
+
+ FIXME: describe the `texi2pod.pl' input language and magic comments in
+more detail.
+
+
+File: gccint.info, Node: Miscellaneous Docs, Prev: Man Page Generation, Up: Documentation
+
+6.3.7.3 Miscellaneous Documentation
+...................................
+
+In addition to the formal documentation that is installed by GCC, there
+are several other text files with miscellaneous documentation:
+
+`ABOUT-GCC-NLS'
+ Notes on GCC's Native Language Support. FIXME: this should be
+ part of this manual rather than a separate file.
+
+`ABOUT-NLS'
+ Notes on the Free Translation Project.
+
+`COPYING'
+ The GNU General Public License.
+
+`COPYING.LIB'
+ The GNU Lesser General Public License.
+
+`*ChangeLog*'
+`*/ChangeLog*'
+ Change log files for various parts of GCC.
+
+`LANGUAGES'
+ Details of a few changes to the GCC front-end interface. FIXME:
+ the information in this file should be part of general
+ documentation of the front-end interface in this manual.
+
+`ONEWS'
+ Information about new features in old versions of GCC. (For recent
+ versions, the information is on the GCC web site.)
+
+`README.Portability'
+ Information about portability issues when writing code in GCC.
+ FIXME: why isn't this part of this manual or of the GCC Coding
+ Conventions?
+
+ FIXME: document such files in subdirectories, at least `config', `cp',
+`objc', `testsuite'.
+
+
+File: gccint.info, Node: Front End, Next: Back End, Prev: Documentation, Up: gcc Directory
+
+6.3.8 Anatomy of a Language Front End
+-------------------------------------
+
+A front end for a language in GCC has the following parts:
+
+ * A directory `LANGUAGE' under `gcc' containing source files for
+ that front end. *Note The Front End `LANGUAGE' Directory: Front
+ End Directory, for details.
+
+ * A mention of the language in the list of supported languages in
+ `gcc/doc/install.texi'.
+
+ * A mention of the name under which the language's runtime library is
+ recognized by `--enable-shared=PACKAGE' in the documentation of
+ that option in `gcc/doc/install.texi'.
+
+ * A mention of any special prerequisites for building the front end
+ in the documentation of prerequisites in `gcc/doc/install.texi'.
+
+ * Details of contributors to that front end in
+ `gcc/doc/contrib.texi'. If the details are in that front end's
+ own manual then there should be a link to that manual's list in
+ `contrib.texi'.
+
+ * Information about support for that language in
+ `gcc/doc/frontends.texi'.
+
+ * Information about standards for that language, and the front end's
+ support for them, in `gcc/doc/standards.texi'. This may be a link
+ to such information in the front end's own manual.
+
+ * Details of source file suffixes for that language and `-x LANG'
+ options supported, in `gcc/doc/invoke.texi'.
+
+ * Entries in `default_compilers' in `gcc.c' for source file suffixes
+ for that language.
+
+ * Preferably testsuites, which may be under `gcc/testsuite' or
+ runtime library directories. FIXME: document somewhere how to
+ write testsuite harnesses.
+
+ * Probably a runtime library for the language, outside the `gcc'
+ directory. FIXME: document this further.
+
+ * Details of the directories of any runtime libraries in
+ `gcc/doc/sourcebuild.texi'.
+
+ If the front end is added to the official GCC source repository, the
+following are also necessary:
+
+ * At least one Bugzilla component for bugs in that front end and
+ runtime libraries. This category needs to be mentioned in
+ `gcc/gccbug.in', as well as being added to the Bugzilla database.
+
+ * Normally, one or more maintainers of that front end listed in
+ `MAINTAINERS'.
+
+ * Mentions on the GCC web site in `index.html' and `frontends.html',
+ with any relevant links on `readings.html'. (Front ends that are
+ not an official part of GCC may also be listed on
+ `frontends.html', with relevant links.)
+
+ * A news item on `index.html', and possibly an announcement on the
+ <gcc-announce@gcc.gnu.org> mailing list.
+
+ * The front end's manuals should be mentioned in
+ `maintainer-scripts/update_web_docs' (*note Texinfo Manuals::) and
+ the online manuals should be linked to from
+ `onlinedocs/index.html'.
+
+ * Any old releases or CVS repositories of the front end, before its
+ inclusion in GCC, should be made available on the GCC FTP site
+ `ftp://gcc.gnu.org/pub/gcc/old-releases/'.
+
+ * The release and snapshot script `maintainer-scripts/gcc_release'
+ should be updated to generate appropriate tarballs for this front
+ end. The associated `maintainer-scripts/snapshot-README' and
+ `maintainer-scripts/snapshot-index.html' files should be updated
+ to list the tarballs and diffs for this front end.
+
+ * If this front end includes its own version files that include the
+ current date, `maintainer-scripts/update_version' should be
+ updated accordingly.
+
+* Menu:
+
+* Front End Directory:: The front end `LANGUAGE' directory.
+* Front End Config:: The front end `config-lang.in' file.
+
+
+File: gccint.info, Node: Front End Directory, Next: Front End Config, Up: Front End
+
+6.3.8.1 The Front End `LANGUAGE' Directory
+..........................................
+
+A front end `LANGUAGE' directory contains the source files of that
+front end (but not of any runtime libraries, which should be outside
+the `gcc' directory). This includes documentation, and possibly some
+subsidiary programs build alongside the front end. Certain files are
+special and other parts of the compiler depend on their names:
+
+`config-lang.in'
+ This file is required in all language subdirectories. *Note The
+ Front End `config-lang.in' File: Front End Config, for details of
+ its contents
+
+`Make-lang.in'
+ This file is required in all language subdirectories. It contains
+ targets `LANG.HOOK' (where `LANG' is the setting of `language' in
+ `config-lang.in') for the following values of `HOOK', and any
+ other Makefile rules required to build those targets (which may if
+ necessary use other Makefiles specified in `outputs' in
+ `config-lang.in', although this is deprecated). It also adds any
+ testsuite targets that can use the standard rule in
+ `gcc/Makefile.in' to the variable `lang_checks'.
+
+ `all.cross'
+ `start.encap'
+ `rest.encap'
+ FIXME: exactly what goes in each of these targets?
+
+ `tags'
+ Build an `etags' `TAGS' file in the language subdirectory in
+ the source tree.
+
+ `info'
+ Build info documentation for the front end, in the build
+ directory. This target is only called by `make bootstrap' if
+ a suitable version of `makeinfo' is available, so does not
+ need to check for this, and should fail if an error occurs.
+
+ `dvi'
+ Build DVI documentation for the front end, in the build
+ directory. This should be done using `$(TEXI2DVI)', with
+ appropriate `-I' arguments pointing to directories of
+ included files.
+
+ `pdf'
+ Build PDF documentation for the front end, in the build
+ directory. This should be done using `$(TEXI2PDF)', with
+ appropriate `-I' arguments pointing to directories of
+ included files.
+
+ `html'
+ Build HTML documentation for the front end, in the build
+ directory.
+
+ `man'
+ Build generated man pages for the front end from Texinfo
+ manuals (*note Man Page Generation::), in the build
+ directory. This target is only called if the necessary tools
+ are available, but should ignore errors so as not to stop the
+ build if errors occur; man pages are optional and the tools
+ involved may be installed in a broken way.
+
+ `install-common'
+ Install everything that is part of the front end, apart from
+ the compiler executables listed in `compilers' in
+ `config-lang.in'.
+
+ `install-info'
+ Install info documentation for the front end, if it is
+ present in the source directory. This target should have
+ dependencies on info files that should be installed.
+
+ `install-man'
+ Install man pages for the front end. This target should
+ ignore errors.
+
+ `srcextra'
+ Copies its dependencies into the source directory. This
+ generally should be used for generated files such as Bison
+ output files which are not present in CVS, but should be
+ included in any release tarballs. This target will be
+ executed during a bootstrap if
+ `--enable-generated-files-in-srcdir' was specified as a
+ `configure' option.
+
+ `srcinfo'
+ `srcman'
+ Copies its dependencies into the source directory. These
+ targets will be executed during a bootstrap if
+ `--enable-generated-files-in-srcdir' was specified as a
+ `configure' option.
+
+ `uninstall'
+ Uninstall files installed by installing the compiler. This is
+ currently documented not to be supported, so the hook need
+ not do anything.
+
+ `mostlyclean'
+ `clean'
+ `distclean'
+ `maintainer-clean'
+ The language parts of the standard GNU `*clean' targets.
+ *Note Standard Targets for Users: (standards)Standard
+ Targets, for details of the standard targets. For GCC,
+ `maintainer-clean' should delete all generated files in the
+ source directory that are not checked into CVS, but should
+ not delete anything checked into CVS.
+
+ `Make-lang.in' must also define a variable `LANG_OBJS' to a list
+ of host object files that are used by that language.
+
+`lang.opt'
+ This file registers the set of switches that the front end accepts
+ on the command line, and their `--help' text. *Note Options::.
+
+`lang-specs.h'
+ This file provides entries for `default_compilers' in `gcc.c'
+ which override the default of giving an error that a compiler for
+ that language is not installed.
+
+`LANGUAGE-tree.def'
+ This file, which need not exist, defines any language-specific tree
+ codes.
+
+
+File: gccint.info, Node: Front End Config, Prev: Front End Directory, Up: Front End
+
+6.3.8.2 The Front End `config-lang.in' File
+...........................................
+
+Each language subdirectory contains a `config-lang.in' file. In
+addition the main directory contains `c-config-lang.in', which contains
+limited information for the C language. This file is a shell script
+that may define some variables describing the language:
+
+`language'
+ This definition must be present, and gives the name of the language
+ for some purposes such as arguments to `--enable-languages'.
+
+`lang_requires'
+ If defined, this variable lists (space-separated) language front
+ ends other than C that this front end requires to be enabled (with
+ the names given being their `language' settings). For example, the
+ Java front end depends on the C++ front end, so sets
+ `lang_requires=c++'.
+
+`subdir_requires'
+ If defined, this variable lists (space-separated) front end
+ directories other than C that this front end requires to be
+ present. For example, the Objective-C++ front end uses source
+ files from the C++ and Objective-C front ends, so sets
+ `subdir_requires="cp objc"'.
+
+`target_libs'
+ If defined, this variable lists (space-separated) targets in the
+ top level `Makefile' to build the runtime libraries for this
+ language, such as `target-libobjc'.
+
+`lang_dirs'
+ If defined, this variable lists (space-separated) top level
+ directories (parallel to `gcc'), apart from the runtime libraries,
+ that should not be configured if this front end is not built.
+
+`build_by_default'
+ If defined to `no', this language front end is not built unless
+ enabled in a `--enable-languages' argument. Otherwise, front ends
+ are built by default, subject to any special logic in
+ `configure.ac' (as is present to disable the Ada front end if the
+ Ada compiler is not already installed).
+
+`boot_language'
+ If defined to `yes', this front end is built in stage 1 of the
+ bootstrap. This is only relevant to front ends written in their
+ own languages.
+
+`compilers'
+ If defined, a space-separated list of compiler executables that
+ will be run by the driver. The names here will each end with
+ `\$(exeext)'.
+
+`outputs'
+ If defined, a space-separated list of files that should be
+ generated by `configure' substituting values in them. This
+ mechanism can be used to create a file `LANGUAGE/Makefile' from
+ `LANGUAGE/Makefile.in', but this is deprecated, building
+ everything from the single `gcc/Makefile' is preferred.
+
+`gtfiles'
+ If defined, a space-separated list of files that should be scanned
+ by gengtype.c to generate the garbage collection tables and
+ routines for this language. This excludes the files that are
+ common to all front ends. *Note Type Information::.
+
+
+
+File: gccint.info, Node: Back End, Prev: Front End, Up: gcc Directory
+
+6.3.9 Anatomy of a Target Back End
+----------------------------------
+
+A back end for a target architecture in GCC has the following parts:
+
+ * A directory `MACHINE' under `gcc/config', containing a machine
+ description `MACHINE.md' file (*note Machine Descriptions: Machine
+ Desc.), header files `MACHINE.h' and `MACHINE-protos.h' and a
+ source file `MACHINE.c' (*note Target Description Macros and
+ Functions: Target Macros.), possibly a target Makefile fragment
+ `t-MACHINE' (*note The Target Makefile Fragment: Target
+ Fragment.), and maybe some other files. The names of these files
+ may be changed from the defaults given by explicit specifications
+ in `config.gcc'.
+
+ * If necessary, a file `MACHINE-modes.def' in the `MACHINE'
+ directory, containing additional machine modes to represent
+ condition codes. *Note Condition Code::, for further details.
+
+ * An optional `MACHINE.opt' file in the `MACHINE' directory,
+ containing a list of target-specific options. You can also add
+ other option files using the `extra_options' variable in
+ `config.gcc'. *Note Options::.
+
+ * Entries in `config.gcc' (*note The `config.gcc' File: System
+ Config.) for the systems with this target architecture.
+
+ * Documentation in `gcc/doc/invoke.texi' for any command-line
+ options supported by this target (*note Run-time Target
+ Specification: Run-time Target.). This means both entries in the
+ summary table of options and details of the individual options.
+
+ * Documentation in `gcc/doc/extend.texi' for any target-specific
+ attributes supported (*note Defining target-specific uses of
+ `__attribute__': Target Attributes.), including where the same
+ attribute is already supported on some targets, which are
+ enumerated in the manual.
+
+ * Documentation in `gcc/doc/extend.texi' for any target-specific
+ pragmas supported.
+
+ * Documentation in `gcc/doc/extend.texi' of any target-specific
+ built-in functions supported.
+
+ * Documentation in `gcc/doc/extend.texi' of any target-specific
+ format checking styles supported.
+
+ * Documentation in `gcc/doc/md.texi' of any target-specific
+ constraint letters (*note Constraints for Particular Machines:
+ Machine Constraints.).
+
+ * A note in `gcc/doc/contrib.texi' under the person or people who
+ contributed the target support.
+
+ * Entries in `gcc/doc/install.texi' for all target triplets
+ supported with this target architecture, giving details of any
+ special notes about installation for this target, or saying that
+ there are no special notes if there are none.
+
+ * Possibly other support outside the `gcc' directory for runtime
+ libraries. FIXME: reference docs for this. The libstdc++ porting
+ manual needs to be installed as info for this to work, or to be a
+ chapter of this manual.
+
+ If the back end is added to the official GCC source repository, the
+following are also necessary:
+
+ * An entry for the target architecture in `readings.html' on the GCC
+ web site, with any relevant links.
+
+ * Details of the properties of the back end and target architecture
+ in `backends.html' on the GCC web site.
+
+ * A news item about the contribution of support for that target
+ architecture, in `index.html' on the GCC web site.
+
+ * Normally, one or more maintainers of that target listed in
+ `MAINTAINERS'. Some existing architectures may be unmaintained,
+ but it would be unusual to add support for a target that does not
+ have a maintainer when support is added.
+
+
+File: gccint.info, Node: Testsuites, Prev: gcc Directory, Up: Source Tree
+
+6.4 Testsuites
+==============
+
+GCC contains several testsuites to help maintain compiler quality.
+Most of the runtime libraries and language front ends in GCC have
+testsuites. Currently only the C language testsuites are documented
+here; FIXME: document the others.
+
+* Menu:
+
+* Test Idioms:: Idioms used in testsuite code.
+* Test Directives:: Directives used within DejaGnu tests.
+* Ada Tests:: The Ada language testsuites.
+* C Tests:: The C language testsuites.
+* libgcj Tests:: The Java library testsuites.
+* gcov Testing:: Support for testing gcov.
+* profopt Testing:: Support for testing profile-directed optimizations.
+* compat Testing:: Support for testing binary compatibility.
+* Torture Tests:: Support for torture testing using multiple options.
+
+
+File: gccint.info, Node: Test Idioms, Next: Test Directives, Up: Testsuites
+
+6.4.1 Idioms Used in Testsuite Code
+-----------------------------------
+
+In general, C testcases have a trailing `-N.c', starting with `-1.c',
+in case other testcases with similar names are added later. If the
+test is a test of some well-defined feature, it should have a name
+referring to that feature such as `FEATURE-1.c'. If it does not test a
+well-defined feature but just happens to exercise a bug somewhere in
+the compiler, and a bug report has been filed for this bug in the GCC
+bug database, `prBUG-NUMBER-1.c' is the appropriate form of name.
+Otherwise (for miscellaneous bugs not filed in the GCC bug database),
+and previously more generally, test cases are named after the date on
+which they were added. This allows people to tell at a glance whether
+a test failure is because of a recently found bug that has not yet been
+fixed, or whether it may be a regression, but does not give any other
+information about the bug or where discussion of it may be found. Some
+other language testsuites follow similar conventions.
+
+ In the `gcc.dg' testsuite, it is often necessary to test that an error
+is indeed a hard error and not just a warning--for example, where it is
+a constraint violation in the C standard, which must become an error
+with `-pedantic-errors'. The following idiom, where the first line
+shown is line LINE of the file and the line that generates the error,
+is used for this:
+
+ /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "REGEXP" "MESSAGE" { target *-*-* } LINE } */
+
+ It may be necessary to check that an expression is an integer constant
+expression and has a certain value. To check that `E' has value `V',
+an idiom similar to the following is used:
+
+ char x[((E) == (V) ? 1 : -1)];
+
+ In `gcc.dg' tests, `__typeof__' is sometimes used to make assertions
+about the types of expressions. See, for example,
+`gcc.dg/c99-condexpr-1.c'. The more subtle uses depend on the exact
+rules for the types of conditional expressions in the C standard; see,
+for example, `gcc.dg/c99-intconst-1.c'.
+
+ It is useful to be able to test that optimizations are being made
+properly. This cannot be done in all cases, but it can be done where
+the optimization will lead to code being optimized away (for example,
+where flow analysis or alias analysis should show that certain code
+cannot be called) or to functions not being called because they have
+been expanded as built-in functions. Such tests go in
+`gcc.c-torture/execute'. Where code should be optimized away, a call
+to a nonexistent function such as `link_failure ()' may be inserted; a
+definition
+
+ #ifndef __OPTIMIZE__
+ void
+ link_failure (void)
+ {
+ abort ();
+ }
+ #endif
+
+will also be needed so that linking still succeeds when the test is run
+without optimization. When all calls to a built-in function should
+have been optimized and no calls to the non-built-in version of the
+function should remain, that function may be defined as `static' to
+call `abort ()' (although redeclaring a function as static may not work
+on all targets).
+
+ All testcases must be portable. Target-specific testcases must have
+appropriate code to avoid causing failures on unsupported systems;
+unfortunately, the mechanisms for this differ by directory.
+
+ FIXME: discuss non-C testsuites here.
+
+
+File: gccint.info, Node: Test Directives, Next: Ada Tests, Prev: Test Idioms, Up: Testsuites
+
+6.4.2 Directives used within DejaGnu tests
+------------------------------------------
+
+Test directives appear within comments in a test source file and begin
+with `dg-'. Some of these are defined within DejaGnu and others are
+local to the GCC testsuite.
+
+ The order in which test directives appear in a test can be important:
+directives local to GCC sometimes override information used by the
+DejaGnu directives, which know nothing about the GCC directives, so the
+DejaGnu directives must precede GCC directives.
+
+ Several test directives include selectors which are usually preceded by
+the keyword `target' or `xfail'. A selector is: one or more target
+triplets, possibly including wildcard characters; a single
+effective-target keyword; or a logical expression. Depending on the
+context, the selector specifies whether a test is skipped and reported
+as unsupported or is expected to fail. Use `*-*-*' to match any target.
+Effective-target keywords are defined in `target-supports.exp' in the
+GCC testsuite.
+
+ A selector expression appears within curly braces and uses a single
+logical operator: one of `!', `&&', or `||'. An operand is another
+selector expression, an effective-target keyword, a single target
+triplet, or a list of target triplets within quotes or curly braces.
+For example:
+
+ { target { ! "hppa*-*-* ia64*-*-*" } }
+ { target { powerpc*-*-* && lp64 } }
+ { xfail { lp64 || vect_no_align } }
+
+`{ dg-do DO-WHAT-KEYWORD [{ target/xfail SELECTOR }] }'
+ DO-WHAT-KEYWORD specifies how the test is compiled and whether it
+ is executed. It is one of:
+
+ `preprocess'
+ Compile with `-E' to run only the preprocessor.
+
+ `compile'
+ Compile with `-S' to produce an assembly code file.
+
+ `assemble'
+ Compile with `-c' to produce a relocatable object file.
+
+ `link'
+ Compile, assemble, and link to produce an executable file.
+
+ `run'
+ Produce and run an executable file, which is expected to
+ return an exit code of 0.
+
+ The default is `compile'. That can be overridden for a set of
+ tests by redefining `dg-do-what-default' within the `.exp' file
+ for those tests.
+
+ If the directive includes the optional `{ target SELECTOR }' then
+ the test is skipped unless the target system is included in the
+ list of target triplets or matches the effective-target keyword.
+
+ If `do-what-keyword' is `run' and the directive includes the
+ optional `{ xfail SELECTOR }' and the selector is met then the
+ test is expected to fail. The `xfail' clause is ignored for other
+ values of `do-what-keyword'; those tests can use directive
+ `dg-xfail-if'.
+
+`{ dg-options OPTIONS [{ target SELECTOR }] }'
+ This DejaGnu directive provides a list of compiler options, to be
+ used if the target system matches SELECTOR, that replace the
+ default options used for this set of tests.
+
+`{ dg-add-options FEATURE ... }'
+ Add any compiler options that are needed to access certain
+ features. This directive does nothing on targets that enable the
+ features by default, or that don't provide them at all. It must
+ come after all `dg-options' directives.
+
+ The supported values of FEATURE are:
+ `c99_runtime'
+ The target's C99 runtime (both headers and libraries).
+
+ `mips16_attribute'
+ `mips16' function attributes. Only MIPS targets support this
+ feature, and only then in certain modes.
+
+`{ dg-timeout N [{target SELECTOR }] }'
+ Set the time limit for the compilation and for the execution of
+ the test to the specified number of seconds.
+
+`{ dg-timeout-factor X [{ target SELECTOR }] }'
+ Multiply the normal time limit for compilation and execution of
+ the test by the specified floating-point factor. The normal
+ timeout limit, in seconds, is found by searching the following in
+ order:
+
+ * the value defined by an earlier `dg-timeout' directive in the
+ test
+
+ * variable TOOL_TIMEOUT defined by the set of tests
+
+ * GCC,TIMEOUT set in the target board
+
+ * 300
+
+`{ dg-skip-if COMMENT { SELECTOR } { INCLUDE-OPTS } { EXCLUDE-OPTS } }'
+ Skip the test if the test system is included in SELECTOR and if
+ each of the options in INCLUDE-OPTS is in the set of options with
+ which the test would be compiled and if none of the options in
+ EXCLUDE-OPTS is in the set of options with which the test would be
+ compiled.
+
+ Use `"*"' for an empty INCLUDE-OPTS list and `""' for an empty
+ EXCLUDE-OPTS list.
+
+`{ dg-xfail-if COMMENT { SELECTOR } { INCLUDE-OPTS } { EXCLUDE-OPTS } }'
+ Expect the test to fail if the conditions (which are the same as
+ for `dg-skip-if') are met. This does not affect the execute step.
+
+`{ dg-xfail-run-if COMMENT { SELECTOR } { INCLUDE-OPTS } { EXCLUDE-OPTS } }'
+ Expect the execute step of a test to fail if the conditions (which
+ are the same as for `dg-skip-if') and `dg-xfail-if') are met.
+
+`{ dg-require-SUPPORT args }'
+ Skip the test if the target does not provide the required support;
+ see `gcc-dg.exp' in the GCC testsuite for the actual directives.
+ These directives must appear after any `dg-do' directive in the
+ test and before any `dg-additional-sources' directive. They
+ require at least one argument, which can be an empty string if the
+ specific procedure does not examine the argument.
+
+`{ dg-require-effective-target KEYWORD }'
+ Skip the test if the test target, including current multilib flags,
+ is not covered by the effective-target keyword. This directive
+ must appear after any `dg-do' directive in the test and before any
+ `dg-additional-sources' directive.
+
+`{ dg-shouldfail COMMENT { SELECTOR } { INCLUDE-OPTS } { EXCLUDE-OPTS } }'
+ Expect the test executable to return a nonzero exit status if the
+ conditions (which are the same as for `dg-skip-if') are met.
+
+`{ dg-error REGEXP [COMMENT [{ target/xfail SELECTOR } [LINE] }]] }'
+ This DejaGnu directive appears on a source line that is expected
+ to get an error message, or else specifies the source line
+ associated with the message. If there is no message for that line
+ or if the text of that message is not matched by REGEXP then the
+ check fails and COMMENT is included in the `FAIL' message. The
+ check does not look for the string `"error"' unless it is part of
+ REGEXP.
+
+`{ dg-warning REGEXP [COMMENT [{ target/xfail SELECTOR } [LINE] }]] }'
+ This DejaGnu directive appears on a source line that is expected
+ to get a warning message, or else specifies the source line
+ associated with the message. If there is no message for that line
+ or if the text of that message is not matched by REGEXP then the
+ check fails and COMMENT is included in the `FAIL' message. The
+ check does not look for the string `"warning"' unless it is part
+ of REGEXP.
+
+`{ dg-message REGEXP [COMMENT [{ target/xfail SELECTOR } [LINE] }]] }'
+ The line is expected to get a message other than an error or
+ warning. If there is no message for that line or if the text of
+ that message is not matched by REGEXP then the check fails and
+ COMMENT is included in the `FAIL' message.
+
+`{ dg-bogus REGEXP [COMMENT [{ target/xfail SELECTOR } [LINE] }]] }'
+ This DejaGnu directive appears on a source line that should not
+ get a message matching REGEXP, or else specifies the source line
+ associated with the bogus message. It is usually used with `xfail'
+ to indicate that the message is a known problem for a particular
+ set of targets.
+
+`{ dg-excess-errors COMMENT [{ target/xfail SELECTOR }] }'
+ This DejaGnu directive indicates that the test is expected to fail
+ due to compiler messages that are not handled by `dg-error',
+ `dg-warning' or `dg-bogus'. For this directive `xfail' has the
+ same effect as `target'.
+
+`{ dg-output REGEXP [{ target/xfail SELECTOR }] }'
+ This DejaGnu directive compares REGEXP to the combined output that
+ the test executable writes to `stdout' and `stderr'.
+
+`{ dg-prune-output REGEXP }'
+ Prune messages matching REGEXP from test output.
+
+`{ dg-additional-files "FILELIST" }'
+ Specify additional files, other than source files, that must be
+ copied to the system where the compiler runs.
+
+`{ dg-additional-sources "FILELIST" }'
+ Specify additional source files to appear in the compile line
+ following the main test file.
+
+`{ dg-final { LOCAL-DIRECTIVE } }'
+ This DejaGnu directive is placed within a comment anywhere in the
+ source file and is processed after the test has been compiled and
+ run. Multiple `dg-final' commands are processed in the order in
+ which they appear in the source file.
+
+ The GCC testsuite defines the following directives to be used
+ within `dg-final'.
+
+ `cleanup-coverage-files'
+ Removes coverage data files generated for this test.
+
+ `cleanup-repo-files'
+ Removes files generated for this test for `-frepo'.
+
+ `cleanup-rtl-dump SUFFIX'
+ Removes RTL dump files generated for this test.
+
+ `cleanup-tree-dump SUFFIX'
+ Removes tree dump files matching SUFFIX which were generated
+ for this test.
+
+ `cleanup-saved-temps'
+ Removes files for the current test which were kept for
+ `--save-temps'.
+
+ `scan-file FILENAME REGEXP [{ target/xfail SELECTOR }]'
+ Passes if REGEXP matches text in FILENAME.
+
+ `scan-file-not FILENAME REGEXP [{ target/xfail SELECTOR }]'
+ Passes if REGEXP does not match text in FILENAME.
+
+ `scan-hidden SYMBOL [{ target/xfail SELECTOR }]'
+ Passes if SYMBOL is defined as a hidden symbol in the test's
+ assembly output.
+
+ `scan-not-hidden SYMBOL [{ target/xfail SELECTOR }]'
+ Passes if SYMBOL is not defined as a hidden symbol in the
+ test's assembly output.
+
+ `scan-assembler-times REGEX NUM [{ target/xfail SELECTOR }]'
+ Passes if REGEX is matched exactly NUM times in the test's
+ assembler output.
+
+ `scan-assembler REGEX [{ target/xfail SELECTOR }]'
+ Passes if REGEX matches text in the test's assembler output.
+
+ `scan-assembler-not REGEX [{ target/xfail SELECTOR }]'
+ Passes if REGEX does not match text in the test's assembler
+ output.
+
+ `scan-assembler-dem REGEX [{ target/xfail SELECTOR }]'
+ Passes if REGEX matches text in the test's demangled
+ assembler output.
+
+ `scan-assembler-dem-not REGEX [{ target/xfail SELECTOR }]'
+ Passes if REGEX does not match text in the test's demangled
+ assembler output.
+
+ `scan-tree-dump-times REGEX NUM SUFFIX [{ target/xfail SELECTOR }]'
+ Passes if REGEX is found exactly NUM times in the dump file
+ with suffix SUFFIX.
+
+ `scan-tree-dump REGEX SUFFIX [{ target/xfail SELECTOR }]'
+ Passes if REGEX matches text in the dump file with suffix
+ SUFFIX.
+
+ `scan-tree-dump-not REGEX SUFFIX [{ target/xfail SELECTOR }]'
+ Passes if REGEX does not match text in the dump file with
+ suffix SUFFIX.
+
+ `scan-tree-dump-dem REGEX SUFFIX [{ target/xfail SELECTOR }]'
+ Passes if REGEX matches demangled text in the dump file with
+ suffix SUFFIX.
+
+ `scan-tree-dump-dem-not REGEX SUFFIX [{ target/xfail SELECTOR }]'
+ Passes if REGEX does not match demangled text in the dump
+ file with suffix SUFFIX.
+
+ `output-exists [{ target/xfail SELECTOR }]'
+ Passes if compiler output file exists.
+
+ `output-exists-not [{ target/xfail SELECTOR }]'
+ Passes if compiler output file does not exist.
+
+ `run-gcov SOURCEFILE'
+ Check line counts in `gcov' tests.
+
+ `run-gcov [branches] [calls] { OPTS SOURCEFILE }'
+ Check branch and/or call counts, in addition to line counts,
+ in `gcov' tests.
+
+
+File: gccint.info, Node: Ada Tests, Next: C Tests, Prev: Test Directives, Up: Testsuites
+
+6.4.3 Ada Language Testsuites
+-----------------------------
+
+The Ada testsuite includes executable tests from the ACATS 2.5
+testsuite, publicly available at
+`http://www.adaic.org/compilers/acats/2.5'
+
+ These tests are integrated in the GCC testsuite in the
+`gcc/testsuite/ada/acats' directory, and enabled automatically when
+running `make check', assuming the Ada language has been enabled when
+configuring GCC.
+
+ You can also run the Ada testsuite independently, using `make
+check-ada', or run a subset of the tests by specifying which chapter to
+run, e.g.:
+
+ $ make check-ada CHAPTERS="c3 c9"
+
+ The tests are organized by directory, each directory corresponding to
+a chapter of the Ada Reference Manual. So for example, c9 corresponds
+to chapter 9, which deals with tasking features of the language.
+
+ There is also an extra chapter called `gcc' containing a template for
+creating new executable tests.
+
+ The tests are run using two `sh' scripts: `run_acats' and
+`run_all.sh'. To run the tests using a simulator or a cross target,
+see the small customization section at the top of `run_all.sh'.
+
+ These tests are run using the build tree: they can be run without doing
+a `make install'.
+
+
+File: gccint.info, Node: C Tests, Next: libgcj Tests, Prev: Ada Tests, Up: Testsuites
+
+6.4.4 C Language Testsuites
+---------------------------
+
+GCC contains the following C language testsuites, in the
+`gcc/testsuite' directory:
+
+`gcc.dg'
+ This contains tests of particular features of the C compiler,
+ using the more modern `dg' harness. Correctness tests for various
+ compiler features should go here if possible.
+
+ Magic comments determine whether the file is preprocessed,
+ compiled, linked or run. In these tests, error and warning
+ message texts are compared against expected texts or regular
+ expressions given in comments. These tests are run with the
+ options `-ansi -pedantic' unless other options are given in the
+ test. Except as noted below they are not run with multiple
+ optimization options.
+
+`gcc.dg/compat'
+ This subdirectory contains tests for binary compatibility using
+ `compat.exp', which in turn uses the language-independent support
+ (*note Support for testing binary compatibility: compat Testing.).
+
+`gcc.dg/cpp'
+ This subdirectory contains tests of the preprocessor.
+
+`gcc.dg/debug'
+ This subdirectory contains tests for debug formats. Tests in this
+ subdirectory are run for each debug format that the compiler
+ supports.
+
+`gcc.dg/format'
+ This subdirectory contains tests of the `-Wformat' format
+ checking. Tests in this directory are run with and without
+ `-DWIDE'.
+
+`gcc.dg/noncompile'
+ This subdirectory contains tests of code that should not compile
+ and does not need any special compilation options. They are run
+ with multiple optimization options, since sometimes invalid code
+ crashes the compiler with optimization.
+
+`gcc.dg/special'
+ FIXME: describe this.
+
+`gcc.c-torture'
+ This contains particular code fragments which have historically
+ broken easily. These tests are run with multiple optimization
+ options, so tests for features which only break at some
+ optimization levels belong here. This also contains tests to
+ check that certain optimizations occur. It might be worthwhile to
+ separate the correctness tests cleanly from the code quality
+ tests, but it hasn't been done yet.
+
+`gcc.c-torture/compat'
+ FIXME: describe this.
+
+ This directory should probably not be used for new tests.
+
+`gcc.c-torture/compile'
+ This testsuite contains test cases that should compile, but do not
+ need to link or run. These test cases are compiled with several
+ different combinations of optimization options. All warnings are
+ disabled for these test cases, so this directory is not suitable if
+ you wish to test for the presence or absence of compiler warnings.
+ While special options can be set, and tests disabled on specific
+ platforms, by the use of `.x' files, mostly these test cases
+ should not contain platform dependencies. FIXME: discuss how
+ defines such as `NO_LABEL_VALUES' and `STACK_SIZE' are used.
+
+`gcc.c-torture/execute'
+ This testsuite contains test cases that should compile, link and
+ run; otherwise the same comments as for `gcc.c-torture/compile'
+ apply.
+
+`gcc.c-torture/execute/ieee'
+ This contains tests which are specific to IEEE floating point.
+
+`gcc.c-torture/unsorted'
+ FIXME: describe this.
+
+ This directory should probably not be used for new tests.
+
+`gcc.c-torture/misc-tests'
+ This directory contains C tests that require special handling.
+ Some of these tests have individual expect files, and others share
+ special-purpose expect files:
+
+ ``bprob*.c''
+ Test `-fbranch-probabilities' using `bprob.exp', which in
+ turn uses the generic, language-independent framework (*note
+ Support for testing profile-directed optimizations: profopt
+ Testing.).
+
+ ``dg-*.c''
+ Test the testsuite itself using `dg-test.exp'.
+
+ ``gcov*.c''
+ Test `gcov' output using `gcov.exp', which in turn uses the
+ language-independent support (*note Support for testing gcov:
+ gcov Testing.).
+
+ ``i386-pf-*.c''
+ Test i386-specific support for data prefetch using
+ `i386-prefetch.exp'.
+
+
+ FIXME: merge in `testsuite/README.gcc' and discuss the format of test
+cases and magic comments more.
+
+
+File: gccint.info, Node: libgcj Tests, Next: gcov Testing, Prev: C Tests, Up: Testsuites
+
+6.4.5 The Java library testsuites.
+----------------------------------
+
+Runtime tests are executed via `make check' in the
+`TARGET/libjava/testsuite' directory in the build tree. Additional
+runtime tests can be checked into this testsuite.
+
+ Regression testing of the core packages in libgcj is also covered by
+the Mauve testsuite. The Mauve Project develops tests for the Java
+Class Libraries. These tests are run as part of libgcj testing by
+placing the Mauve tree within the libjava testsuite sources at
+`libjava/testsuite/libjava.mauve/mauve', or by specifying the location
+of that tree when invoking `make', as in `make MAUVEDIR=~/mauve check'.
+
+ To detect regressions, a mechanism in `mauve.exp' compares the
+failures for a test run against the list of expected failures in
+`libjava/testsuite/libjava.mauve/xfails' from the source hierarchy.
+Update this file when adding new failing tests to Mauve, or when fixing
+bugs in libgcj that had caused Mauve test failures.
+
+ We encourage developers to contribute test cases to Mauve.
+
+
+File: gccint.info, Node: gcov Testing, Next: profopt Testing, Prev: libgcj Tests, Up: Testsuites
+
+6.4.6 Support for testing `gcov'
+--------------------------------
+
+Language-independent support for testing `gcov', and for checking that
+branch profiling produces expected values, is provided by the expect
+file `gcov.exp'. `gcov' tests also rely on procedures in `gcc.dg.exp'
+to compile and run the test program. A typical `gcov' test contains
+the following DejaGnu commands within comments:
+
+ { dg-options "-fprofile-arcs -ftest-coverage" }
+ { dg-do run { target native } }
+ { dg-final { run-gcov sourcefile } }
+
+ Checks of `gcov' output can include line counts, branch percentages,
+and call return percentages. All of these checks are requested via
+commands that appear in comments in the test's source file. Commands
+to check line counts are processed by default. Commands to check
+branch percentages and call return percentages are processed if the
+`run-gcov' command has arguments `branches' or `calls', respectively.
+For example, the following specifies checking both, as well as passing
+`-b' to `gcov':
+
+ { dg-final { run-gcov branches calls { -b sourcefile } } }
+
+ A line count command appears within a comment on the source line that
+is expected to get the specified count and has the form `count(CNT)'.
+A test should only check line counts for lines that will get the same
+count for any architecture.
+
+ Commands to check branch percentages (`branch') and call return
+percentages (`returns') are very similar to each other. A beginning
+command appears on or before the first of a range of lines that will
+report the percentage, and the ending command follows that range of
+lines. The beginning command can include a list of percentages, all of
+which are expected to be found within the range. A range is terminated
+by the next command of the same kind. A command `branch(end)' or
+`returns(end)' marks the end of a range without starting a new one.
+For example:
+
+ if (i > 10 && j > i && j < 20) /* branch(27 50 75) */
+ /* branch(end) */
+ foo (i, j);
+
+ For a call return percentage, the value specified is the percentage of
+calls reported to return. For a branch percentage, the value is either
+the expected percentage or 100 minus that value, since the direction of
+a branch can differ depending on the target or the optimization level.
+
+ Not all branches and calls need to be checked. A test should not
+check for branches that might be optimized away or replaced with
+predicated instructions. Don't check for calls inserted by the
+compiler or ones that might be inlined or optimized away.
+
+ A single test can check for combinations of line counts, branch
+percentages, and call return percentages. The command to check a line
+count must appear on the line that will report that count, but commands
+to check branch percentages and call return percentages can bracket the
+lines that report them.
+
+
+File: gccint.info, Node: profopt Testing, Next: compat Testing, Prev: gcov Testing, Up: Testsuites
+
+6.4.7 Support for testing profile-directed optimizations
+--------------------------------------------------------
+
+The file `profopt.exp' provides language-independent support for
+checking correct execution of a test built with profile-directed
+optimization. This testing requires that a test program be built and
+executed twice. The first time it is compiled to generate profile
+data, and the second time it is compiled to use the data that was
+generated during the first execution. The second execution is to
+verify that the test produces the expected results.
+
+ To check that the optimization actually generated better code, a test
+can be built and run a third time with normal optimizations to verify
+that the performance is better with the profile-directed optimizations.
+`profopt.exp' has the beginnings of this kind of support.
+
+ `profopt.exp' provides generic support for profile-directed
+optimizations. Each set of tests that uses it provides information
+about a specific optimization:
+
+`tool'
+ tool being tested, e.g., `gcc'
+
+`profile_option'
+ options used to generate profile data
+
+`feedback_option'
+ options used to optimize using that profile data
+
+`prof_ext'
+ suffix of profile data files
+
+`PROFOPT_OPTIONS'
+ list of options with which to run each test, similar to the lists
+ for torture tests
+
+
+File: gccint.info, Node: compat Testing, Next: Torture Tests, Prev: profopt Testing, Up: Testsuites
+
+6.4.8 Support for testing binary compatibility
+----------------------------------------------
+
+The file `compat.exp' provides language-independent support for binary
+compatibility testing. It supports testing interoperability of two
+compilers that follow the same ABI, or of multiple sets of compiler
+options that should not affect binary compatibility. It is intended to
+be used for testsuites that complement ABI testsuites.
+
+ A test supported by this framework has three parts, each in a separate
+source file: a main program and two pieces that interact with each
+other to split up the functionality being tested.
+
+`TESTNAME_main.SUFFIX'
+ Contains the main program, which calls a function in file
+ `TESTNAME_x.SUFFIX'.
+
+`TESTNAME_x.SUFFIX'
+ Contains at least one call to a function in `TESTNAME_y.SUFFIX'.
+
+`TESTNAME_y.SUFFIX'
+ Shares data with, or gets arguments from, `TESTNAME_x.SUFFIX'.
+
+ Within each test, the main program and one functional piece are
+compiled by the GCC under test. The other piece can be compiled by an
+alternate compiler. If no alternate compiler is specified, then all
+three source files are all compiled by the GCC under test. You can
+specify pairs of sets of compiler options. The first element of such a
+pair specifies options used with the GCC under test, and the second
+element of the pair specifies options used with the alternate compiler.
+Each test is compiled with each pair of options.
+
+ `compat.exp' defines default pairs of compiler options. These can be
+overridden by defining the environment variable `COMPAT_OPTIONS' as:
+
+ COMPAT_OPTIONS="[list [list {TST1} {ALT1}]
+ ...[list {TSTN} {ALTN}]]"
+
+ where TSTI and ALTI are lists of options, with TSTI used by the
+compiler under test and ALTI used by the alternate compiler. For
+example, with `[list [list {-g -O0} {-O3}] [list {-fpic} {-fPIC -O2}]]',
+the test is first built with `-g -O0' by the compiler under test and
+with `-O3' by the alternate compiler. The test is built a second time
+using `-fpic' by the compiler under test and `-fPIC -O2' by the
+alternate compiler.
+
+ An alternate compiler is specified by defining an environment variable
+to be the full pathname of an installed compiler; for C define
+`ALT_CC_UNDER_TEST', and for C++ define `ALT_CXX_UNDER_TEST'. These
+will be written to the `site.exp' file used by DejaGnu. The default is
+to build each test with the compiler under test using the first of each
+pair of compiler options from `COMPAT_OPTIONS'. When
+`ALT_CC_UNDER_TEST' or `ALT_CXX_UNDER_TEST' is `same', each test is
+built using the compiler under test but with combinations of the
+options from `COMPAT_OPTIONS'.
+
+ To run only the C++ compatibility suite using the compiler under test
+and another version of GCC using specific compiler options, do the
+following from `OBJDIR/gcc':
+
+ rm site.exp
+ make -k \
+ ALT_CXX_UNDER_TEST=${alt_prefix}/bin/g++ \
+ COMPAT_OPTIONS="lists as shown above" \
+ check-c++ \
+ RUNTESTFLAGS="compat.exp"
+
+ A test that fails when the source files are compiled with different
+compilers, but passes when the files are compiled with the same
+compiler, demonstrates incompatibility of the generated code or runtime
+support. A test that fails for the alternate compiler but passes for
+the compiler under test probably tests for a bug that was fixed in the
+compiler under test but is present in the alternate compiler.
+
+ The binary compatibility tests support a small number of test framework
+commands that appear within comments in a test file.
+
+`dg-require-*'
+ These commands can be used in `TESTNAME_main.SUFFIX' to skip the
+ test if specific support is not available on the target.
+
+`dg-options'
+ The specified options are used for compiling this particular source
+ file, appended to the options from `COMPAT_OPTIONS'. When this
+ command appears in `TESTNAME_main.SUFFIX' the options are also
+ used to link the test program.
+
+`dg-xfail-if'
+ This command can be used in a secondary source file to specify that
+ compilation is expected to fail for particular options on
+ particular targets.
+
+
+File: gccint.info, Node: Torture Tests, Prev: compat Testing, Up: Testsuites
+
+6.4.9 Support for torture testing using multiple options
+--------------------------------------------------------
+
+Throughout the compiler testsuite there are several directories whose
+tests are run multiple times, each with a different set of options.
+These are known as torture tests.
+`gcc/testsuite/lib/torture-options.exp' defines procedures to set up
+these lists:
+
+`torture-init'
+ Initialize use of torture lists.
+
+`set-torture-options'
+ Set lists of torture options to use for tests with and without
+ loops. Optionally combine a set of torture options with a set of
+ other options, as is done with Objective-C runtime options.
+
+`torture-finish'
+ Finalize use of torture lists.
+
+ The `.exp' file for a set of tests that use torture options must
+include calls to these three procedures if:
+
+ * It calls `gcc-dg-runtest' and overrides DG_TORTURE_OPTIONS.
+
+ * It calls ${TOOL}`-torture' or ${TOOL}`-torture-execute', where
+ TOOL is `c', `fortran', or `objc'.
+
+ * It calls `dg-pch'.
+
+ It is not necessary for a `.exp' file that calls `gcc-dg-runtest' to
+call the torture procedures if the tests should use the list in
+DG_TORTURE_OPTIONS defined in `gcc-dg.exp'.
+
+ Most uses of torture options can override the default lists by defining
+TORTURE_OPTIONS or add to the default list by defining
+ADDITIONAL_TORTURE_OPTIONS. Define these in a `.dejagnurc' file or add
+them to the `site.exp' file; for example
+
+ set ADDITIONAL_TORTURE_OPTIONS [list \
+ { -O2 -ftree-loop-linear } \
+ { -O2 -fpeel-loops } ]
+
+
+File: gccint.info, Node: Options, Next: Passes, Prev: Source Tree, Up: Top
+
+7 Option specification files
+****************************
+
+Most GCC command-line options are described by special option
+definition files, the names of which conventionally end in `.opt'.
+This chapter describes the format of these files.
+
+* Menu:
+
+* Option file format:: The general layout of the files
+* Option properties:: Supported option properties
+
+
+File: gccint.info, Node: Option file format, Next: Option properties, Up: Options
+
+7.1 Option file format
+======================
+
+Option files are a simple list of records in which each field occupies
+its own line and in which the records themselves are separated by blank
+lines. Comments may appear on their own line anywhere within the file
+and are preceded by semicolons. Whitespace is allowed before the
+semicolon.
+
+ The files can contain the following types of record:
+
+ * A language definition record. These records have two fields: the
+ string `Language' and the name of the language. Once a language
+ has been declared in this way, it can be used as an option
+ property. *Note Option properties::.
+
+ * A target specific save record to save additional information. These
+ records have two fields: the string `TargetSave', and a
+ declaration type to go in the `cl_target_option' structure.
+
+ * An option definition record. These records have the following
+ fields:
+ 1. the name of the option, with the leading "-" removed
+
+ 2. a space-separated list of option properties (*note Option
+ properties::)
+
+ 3. the help text to use for `--help' (omitted if the second field
+ contains the `Undocumented' property).
+
+ By default, all options beginning with "f", "W" or "m" are
+ implicitly assumed to take a "no-" form. This form should not be
+ listed separately. If an option beginning with one of these
+ letters does not have a "no-" form, you can use the
+ `RejectNegative' property to reject it.
+
+ The help text is automatically line-wrapped before being displayed.
+ Normally the name of the option is printed on the left-hand side of
+ the output and the help text is printed on the right. However, if
+ the help text contains a tab character, the text to the left of
+ the tab is used instead of the option's name and the text to the
+ right of the tab forms the help text. This allows you to
+ elaborate on what type of argument the option takes.
+
+ * A target mask record. These records have one field of the form
+ `Mask(X)'. The options-processing script will automatically
+ allocate a bit in `target_flags' (*note Run-time Target::) for
+ each mask name X and set the macro `MASK_X' to the appropriate
+ bitmask. It will also declare a `TARGET_X' macro that has the
+ value 1 when bit `MASK_X' is set and 0 otherwise.
+
+ They are primarily intended to declare target masks that are not
+ associated with user options, either because these masks represent
+ internal switches or because the options are not available on all
+ configurations and yet the masks always need to be defined.
+
+
+File: gccint.info, Node: Option properties, Prev: Option file format, Up: Options
+
+7.2 Option properties
+=====================
+
+The second field of an option record can specify the following
+properties:
+
+`Common'
+ The option is available for all languages and targets.
+
+`Target'
+ The option is available for all languages but is target-specific.
+
+`LANGUAGE'
+ The option is available when compiling for the given language.
+
+ It is possible to specify several different languages for the same
+ option. Each LANGUAGE must have been declared by an earlier
+ `Language' record. *Note Option file format::.
+
+`RejectNegative'
+ The option does not have a "no-" form. All options beginning with
+ "f", "W" or "m" are assumed to have a "no-" form unless this
+ property is used.
+
+`Negative(OTHERNAME)'
+ The option will turn off another option OTHERNAME, which is the
+ the option name with the leading "-" removed. This chain action
+ will propagate through the `Negative' property of the option to be
+ turned off.
+
+`Joined'
+`Separate'
+ The option takes a mandatory argument. `Joined' indicates that
+ the option and argument can be included in the same `argv' entry
+ (as with `-mflush-func=NAME', for example). `Separate' indicates
+ that the option and argument can be separate `argv' entries (as
+ with `-o'). An option is allowed to have both of these properties.
+
+`JoinedOrMissing'
+ The option takes an optional argument. If the argument is given,
+ it will be part of the same `argv' entry as the option itself.
+
+ This property cannot be used alongside `Joined' or `Separate'.
+
+`UInteger'
+ The option's argument is a non-negative integer. The option parser
+ will check and convert the argument before passing it to the
+ relevant option handler. `UInteger' should also be used on
+ options like `-falign-loops' where both `-falign-loops' and
+ `-falign-loops'=N are supported to make sure the saved options are
+ given a full integer.
+
+`Var(VAR)'
+ The state of this option should be stored in variable VAR. The
+ way that the state is stored depends on the type of option:
+
+ * If the option uses the `Mask' or `InverseMask' properties,
+ VAR is the integer variable that contains the mask.
+
+ * If the option is a normal on/off switch, VAR is an integer
+ variable that is nonzero when the option is enabled. The
+ options parser will set the variable to 1 when the positive
+ form of the option is used and 0 when the "no-" form is used.
+
+ * If the option takes an argument and has the `UInteger'
+ property, VAR is an integer variable that stores the value of
+ the argument.
+
+ * Otherwise, if the option takes an argument, VAR is a pointer
+ to the argument string. The pointer will be null if the
+ argument is optional and wasn't given.
+
+ The option-processing script will usually declare VAR in
+ `options.c' and leave it to be zero-initialized at start-up time.
+ You can modify this behavior using `VarExists' and `Init'.
+
+`Var(VAR, SET)'
+ The option controls an integer variable VAR and is active when VAR
+ equals SET. The option parser will set VAR to SET when the
+ positive form of the option is used and `!SET' when the "no-" form
+ is used.
+
+ VAR is declared in the same way as for the single-argument form
+ described above.
+
+`VarExists'
+ The variable specified by the `Var' property already exists. No
+ definition should be added to `options.c' in response to this
+ option record.
+
+ You should use this property only if the variable is declared
+ outside `options.c'.
+
+`Init(VALUE)'
+ The variable specified by the `Var' property should be statically
+ initialized to VALUE.
+
+`Mask(NAME)'
+ The option is associated with a bit in the `target_flags' variable
+ (*note Run-time Target::) and is active when that bit is set. You
+ may also specify `Var' to select a variable other than
+ `target_flags'.
+
+ The options-processing script will automatically allocate a unique
+ bit for the option. If the option is attached to `target_flags',
+ the script will set the macro `MASK_NAME' to the appropriate
+ bitmask. It will also declare a `TARGET_NAME' macro that has the
+ value 1 when the option is active and 0 otherwise. If you use
+ `Var' to attach the option to a different variable, the associated
+ macros are called `OPTION_MASK_NAME' and `OPTION_NAME'
+ respectively.
+
+ You can disable automatic bit allocation using `MaskExists'.
+
+`InverseMask(OTHERNAME)'
+`InverseMask(OTHERNAME, THISNAME)'
+ The option is the inverse of another option that has the
+ `Mask(OTHERNAME)' property. If THISNAME is given, the
+ options-processing script will declare a `TARGET_THISNAME' macro
+ that is 1 when the option is active and 0 otherwise.
+
+`MaskExists'
+ The mask specified by the `Mask' property already exists. No
+ `MASK' or `TARGET' definitions should be added to `options.h' in
+ response to this option record.
+
+ The main purpose of this property is to support synonymous options.
+ The first option should use `Mask(NAME)' and the others should use
+ `Mask(NAME) MaskExists'.
+
+`Report'
+ The state of the option should be printed by `-fverbose-asm'.
+
+`Undocumented'
+ The option is deliberately missing documentation and should not be
+ included in the `--help' output.
+
+`Condition(COND)'
+ The option should only be accepted if preprocessor condition COND
+ is true. Note that any C declarations associated with the option
+ will be present even if COND is false; COND simply controls
+ whether the option is accepted and whether it is printed in the
+ `--help' output.
+
+`Save'
+ Build the `cl_target_option' structure to hold a copy of the
+ option, add the functions `cl_target_option_save' and
+ `cl_target_option_restore' to save and restore the options.
+
+
+File: gccint.info, Node: Passes, Next: Trees, Prev: Options, Up: Top
+
+8 Passes and Files of the Compiler
+**********************************
+
+This chapter is dedicated to giving an overview of the optimization and
+code generation passes of the compiler. In the process, it describes
+some of the language front end interface, though this description is no
+where near complete.
+
+* Menu:
+
+* Parsing pass:: The language front end turns text into bits.
+* Gimplification pass:: The bits are turned into something we can optimize.
+* Pass manager:: Sequencing the optimization passes.
+* Tree SSA passes:: Optimizations on a high-level representation.
+* RTL passes:: Optimizations on a low-level representation.
+
+
+File: gccint.info, Node: Parsing pass, Next: Gimplification pass, Up: Passes
+
+8.1 Parsing pass
+================
+
+The language front end is invoked only once, via
+`lang_hooks.parse_file', to parse the entire input. The language front
+end may use any intermediate language representation deemed
+appropriate. The C front end uses GENERIC trees (CROSSREF), plus a
+double handful of language specific tree codes defined in
+`c-common.def'. The Fortran front end uses a completely different
+private representation.
+
+ At some point the front end must translate the representation used in
+the front end to a representation understood by the language-independent
+portions of the compiler. Current practice takes one of two forms.
+The C front end manually invokes the gimplifier (CROSSREF) on each
+function, and uses the gimplifier callbacks to convert the
+language-specific tree nodes directly to GIMPLE (CROSSREF) before
+passing the function off to be compiled. The Fortran front end
+converts from a private representation to GENERIC, which is later
+lowered to GIMPLE when the function is compiled. Which route to choose
+probably depends on how well GENERIC (plus extensions) can be made to
+match up with the source language and necessary parsing data structures.
+
+ BUG: Gimplification must occur before nested function lowering, and
+nested function lowering must be done by the front end before passing
+the data off to cgraph.
+
+ TODO: Cgraph should control nested function lowering. It would only
+be invoked when it is certain that the outer-most function is used.
+
+ TODO: Cgraph needs a gimplify_function callback. It should be invoked
+when (1) it is certain that the function is used, (2) warning flags
+specified by the user require some amount of compilation in order to
+honor, (3) the language indicates that semantic analysis is not
+complete until gimplification occurs. Hum... this sounds overly
+complicated. Perhaps we should just have the front end gimplify
+always; in most cases it's only one function call.
+
+ The front end needs to pass all function definitions and top level
+declarations off to the middle-end so that they can be compiled and
+emitted to the object file. For a simple procedural language, it is
+usually most convenient to do this as each top level declaration or
+definition is seen. There is also a distinction to be made between
+generating functional code and generating complete debug information.
+The only thing that is absolutely required for functional code is that
+function and data _definitions_ be passed to the middle-end. For
+complete debug information, function, data and type declarations should
+all be passed as well.
+
+ In any case, the front end needs each complete top-level function or
+data declaration, and each data definition should be passed to
+`rest_of_decl_compilation'. Each complete type definition should be
+passed to `rest_of_type_compilation'. Each function definition should
+be passed to `cgraph_finalize_function'.
+
+ TODO: I know rest_of_compilation currently has all sorts of RTL
+generation semantics. I plan to move all code generation bits (both
+Tree and RTL) to compile_function. Should we hide cgraph from the
+front ends and move back to rest_of_compilation as the official
+interface? Possibly we should rename all three interfaces such that
+the names match in some meaningful way and that is more descriptive
+than "rest_of".
+
+ The middle-end will, at its option, emit the function and data
+definitions immediately or queue them for later processing.
+
+
+File: gccint.info, Node: Gimplification pass, Next: Pass manager, Prev: Parsing pass, Up: Passes
+
+8.2 Gimplification pass
+=======================
+
+"Gimplification" is a whimsical term for the process of converting the
+intermediate representation of a function into the GIMPLE language
+(CROSSREF). The term stuck, and so words like "gimplification",
+"gimplify", "gimplifier" and the like are sprinkled throughout this
+section of code.
+
+ While a front end may certainly choose to generate GIMPLE directly if
+it chooses, this can be a moderately complex process unless the
+intermediate language used by the front end is already fairly simple.
+Usually it is easier to generate GENERIC trees plus extensions and let
+the language-independent gimplifier do most of the work.
+
+ The main entry point to this pass is `gimplify_function_tree' located
+in `gimplify.c'. From here we process the entire function gimplifying
+each statement in turn. The main workhorse for this pass is
+`gimplify_expr'. Approximately everything passes through here at least
+once, and it is from here that we invoke the `lang_hooks.gimplify_expr'
+callback.
+
+ The callback should examine the expression in question and return
+`GS_UNHANDLED' if the expression is not a language specific construct
+that requires attention. Otherwise it should alter the expression in
+some way to such that forward progress is made toward producing valid
+GIMPLE. If the callback is certain that the transformation is complete
+and the expression is valid GIMPLE, it should return `GS_ALL_DONE'.
+Otherwise it should return `GS_OK', which will cause the expression to
+be processed again. If the callback encounters an error during the
+transformation (because the front end is relying on the gimplification
+process to finish semantic checks), it should return `GS_ERROR'.
+
+
+File: gccint.info, Node: Pass manager, Next: Tree SSA passes, Prev: Gimplification pass, Up: Passes
+
+8.3 Pass manager
+================
+
+The pass manager is located in `passes.c', `tree-optimize.c' and
+`tree-pass.h'. Its job is to run all of the individual passes in the
+correct order, and take care of standard bookkeeping that applies to
+every pass.
+
+ The theory of operation is that each pass defines a structure that
+represents everything we need to know about that pass--when it should
+be run, how it should be run, what intermediate language form or
+on-the-side data structures it needs. We register the pass to be run
+in some particular order, and the pass manager arranges for everything
+to happen in the correct order.
+
+ The actuality doesn't completely live up to the theory at present.
+Command-line switches and `timevar_id_t' enumerations must still be
+defined elsewhere. The pass manager validates constraints but does not
+attempt to (re-)generate data structures or lower intermediate language
+form based on the requirements of the next pass. Nevertheless, what is
+present is useful, and a far sight better than nothing at all.
+
+ Each pass may have its own dump file (for GCC debugging purposes).
+Passes without any names, or with a name starting with a star, do not
+dump anything.
+
+ TODO: describe the global variables set up by the pass manager, and a
+brief description of how a new pass should use it. I need to look at
+what info RTL passes use first....
+
+
+File: gccint.info, Node: Tree SSA passes, Next: RTL passes, Prev: Pass manager, Up: Passes
+
+8.4 Tree SSA passes
+===================
+
+The following briefly describes the Tree optimization passes that are
+run after gimplification and what source files they are located in.
+
+ * Remove useless statements
+
+ This pass is an extremely simple sweep across the gimple code in
+ which we identify obviously dead code and remove it. Here we do
+ things like simplify `if' statements with constant conditions,
+ remove exception handling constructs surrounding code that
+ obviously cannot throw, remove lexical bindings that contain no
+ variables, and other assorted simplistic cleanups. The idea is to
+ get rid of the obvious stuff quickly rather than wait until later
+ when it's more work to get rid of it. This pass is located in
+ `tree-cfg.c' and described by `pass_remove_useless_stmts'.
+
+ * Mudflap declaration registration
+
+ If mudflap (*note -fmudflap -fmudflapth -fmudflapir: (gcc)Optimize
+ Options.) is enabled, we generate code to register some variable
+ declarations with the mudflap runtime. Specifically, the runtime
+ tracks the lifetimes of those variable declarations that have
+ their addresses taken, or whose bounds are unknown at compile time
+ (`extern'). This pass generates new exception handling constructs
+ (`try'/`finally'), and so must run before those are lowered. In
+ addition, the pass enqueues declarations of static variables whose
+ lifetimes extend to the entire program. The pass is located in
+ `tree-mudflap.c' and is described by `pass_mudflap_1'.
+
+ * OpenMP lowering
+
+ If OpenMP generation (`-fopenmp') is enabled, this pass lowers
+ OpenMP constructs into GIMPLE.
+
+ Lowering of OpenMP constructs involves creating replacement
+ expressions for local variables that have been mapped using data
+ sharing clauses, exposing the control flow of most synchronization
+ directives and adding region markers to facilitate the creation of
+ the control flow graph. The pass is located in `omp-low.c' and is
+ described by `pass_lower_omp'.
+
+ * OpenMP expansion
+
+ If OpenMP generation (`-fopenmp') is enabled, this pass expands
+ parallel regions into their own functions to be invoked by the
+ thread library. The pass is located in `omp-low.c' and is
+ described by `pass_expand_omp'.
+
+ * Lower control flow
+
+ This pass flattens `if' statements (`COND_EXPR') and moves lexical
+ bindings (`BIND_EXPR') out of line. After this pass, all `if'
+ statements will have exactly two `goto' statements in its `then'
+ and `else' arms. Lexical binding information for each statement
+ will be found in `TREE_BLOCK' rather than being inferred from its
+ position under a `BIND_EXPR'. This pass is found in
+ `gimple-low.c' and is described by `pass_lower_cf'.
+
+ * Lower exception handling control flow
+
+ This pass decomposes high-level exception handling constructs
+ (`TRY_FINALLY_EXPR' and `TRY_CATCH_EXPR') into a form that
+ explicitly represents the control flow involved. After this pass,
+ `lookup_stmt_eh_region' will return a non-negative number for any
+ statement that may have EH control flow semantics; examine
+ `tree_can_throw_internal' or `tree_can_throw_external' for exact
+ semantics. Exact control flow may be extracted from
+ `foreach_reachable_handler'. The EH region nesting tree is defined
+ in `except.h' and built in `except.c'. The lowering pass itself
+ is in `tree-eh.c' and is described by `pass_lower_eh'.
+
+ * Build the control flow graph
+
+ This pass decomposes a function into basic blocks and creates all
+ of the edges that connect them. It is located in `tree-cfg.c' and
+ is described by `pass_build_cfg'.
+
+ * Find all referenced variables
+
+ This pass walks the entire function and collects an array of all
+ variables referenced in the function, `referenced_vars'. The
+ index at which a variable is found in the array is used as a UID
+ for the variable within this function. This data is needed by the
+ SSA rewriting routines. The pass is located in `tree-dfa.c' and
+ is described by `pass_referenced_vars'.
+
+ * Enter static single assignment form
+
+ This pass rewrites the function such that it is in SSA form. After
+ this pass, all `is_gimple_reg' variables will be referenced by
+ `SSA_NAME', and all occurrences of other variables will be
+ annotated with `VDEFS' and `VUSES'; PHI nodes will have been
+ inserted as necessary for each basic block. This pass is located
+ in `tree-ssa.c' and is described by `pass_build_ssa'.
+
+ * Warn for uninitialized variables
+
+ This pass scans the function for uses of `SSA_NAME's that are fed
+ by default definition. For non-parameter variables, such uses are
+ uninitialized. The pass is run twice, before and after
+ optimization (if turned on). In the first pass we only warn for
+ uses that are positively uninitialized; in the second pass we warn
+ for uses that are possibly uninitialized. The pass is located in
+ `tree-ssa.c' and is defined by `pass_early_warn_uninitialized' and
+ `pass_late_warn_uninitialized'.
+
+ * Dead code elimination
+
+ This pass scans the function for statements without side effects
+ whose result is unused. It does not do memory life analysis, so
+ any value that is stored in memory is considered used. The pass
+ is run multiple times throughout the optimization process. It is
+ located in `tree-ssa-dce.c' and is described by `pass_dce'.
+
+ * Dominator optimizations
+
+ This pass performs trivial dominator-based copy and constant
+ propagation, expression simplification, and jump threading. It is
+ run multiple times throughout the optimization process. It it
+ located in `tree-ssa-dom.c' and is described by `pass_dominator'.
+
+ * Forward propagation of single-use variables
+
+ This pass attempts to remove redundant computation by substituting
+ variables that are used once into the expression that uses them and
+ seeing if the result can be simplified. It is located in
+ `tree-ssa-forwprop.c' and is described by `pass_forwprop'.
+
+ * Copy Renaming
+
+ This pass attempts to change the name of compiler temporaries
+ involved in copy operations such that SSA->normal can coalesce the
+ copy away. When compiler temporaries are copies of user
+ variables, it also renames the compiler temporary to the user
+ variable resulting in better use of user symbols. It is located
+ in `tree-ssa-copyrename.c' and is described by `pass_copyrename'.
+
+ * PHI node optimizations
+
+ This pass recognizes forms of PHI inputs that can be represented as
+ conditional expressions and rewrites them into straight line code.
+ It is located in `tree-ssa-phiopt.c' and is described by
+ `pass_phiopt'.
+
+ * May-alias optimization
+
+ This pass performs a flow sensitive SSA-based points-to analysis.
+ The resulting may-alias, must-alias, and escape analysis
+ information is used to promote variables from in-memory
+ addressable objects to non-aliased variables that can be renamed
+ into SSA form. We also update the `VDEF'/`VUSE' memory tags for
+ non-renameable aggregates so that we get fewer false kills. The
+ pass is located in `tree-ssa-alias.c' and is described by
+ `pass_may_alias'.
+
+ Interprocedural points-to information is located in
+ `tree-ssa-structalias.c' and described by `pass_ipa_pta'.
+
+ * Profiling
+
+ This pass rewrites the function in order to collect runtime block
+ and value profiling data. Such data may be fed back into the
+ compiler on a subsequent run so as to allow optimization based on
+ expected execution frequencies. The pass is located in
+ `predict.c' and is described by `pass_profile'.
+
+ * Lower complex arithmetic
+
+ This pass rewrites complex arithmetic operations into their
+ component scalar arithmetic operations. The pass is located in
+ `tree-complex.c' and is described by `pass_lower_complex'.
+
+ * Scalar replacement of aggregates
+
+ This pass rewrites suitable non-aliased local aggregate variables
+ into a set of scalar variables. The resulting scalar variables are
+ rewritten into SSA form, which allows subsequent optimization
+ passes to do a significantly better job with them. The pass is
+ located in `tree-sra.c' and is described by `pass_sra'.
+
+ * Dead store elimination
+
+ This pass eliminates stores to memory that are subsequently
+ overwritten by another store, without any intervening loads. The
+ pass is located in `tree-ssa-dse.c' and is described by `pass_dse'.
+
+ * Tail recursion elimination
+
+ This pass transforms tail recursion into a loop. It is located in
+ `tree-tailcall.c' and is described by `pass_tail_recursion'.
+
+ * Forward store motion
+
+ This pass sinks stores and assignments down the flowgraph closer
+ to their use point. The pass is located in `tree-ssa-sink.c' and
+ is described by `pass_sink_code'.
+
+ * Partial redundancy elimination
+
+ This pass eliminates partially redundant computations, as well as
+ performing load motion. The pass is located in `tree-ssa-pre.c'
+ and is described by `pass_pre'.
+
+ Just before partial redundancy elimination, if
+ `-funsafe-math-optimizations' is on, GCC tries to convert
+ divisions to multiplications by the reciprocal. The pass is
+ located in `tree-ssa-math-opts.c' and is described by
+ `pass_cse_reciprocal'.
+
+ * Full redundancy elimination
+
+ This is a simpler form of PRE that only eliminates redundancies
+ that occur an all paths. It is located in `tree-ssa-pre.c' and
+ described by `pass_fre'.
+
+ * Loop optimization
+
+ The main driver of the pass is placed in `tree-ssa-loop.c' and
+ described by `pass_loop'.
+
+ The optimizations performed by this pass are:
+
+ Loop invariant motion. This pass moves only invariants that would
+ be hard to handle on RTL level (function calls, operations that
+ expand to nontrivial sequences of insns). With `-funswitch-loops'
+ it also moves operands of conditions that are invariant out of the
+ loop, so that we can use just trivial invariantness analysis in
+ loop unswitching. The pass also includes store motion. The pass
+ is implemented in `tree-ssa-loop-im.c'.
+
+ Canonical induction variable creation. This pass creates a simple
+ counter for number of iterations of the loop and replaces the exit
+ condition of the loop using it, in case when a complicated
+ analysis is necessary to determine the number of iterations.
+ Later optimizations then may determine the number easily. The
+ pass is implemented in `tree-ssa-loop-ivcanon.c'.
+
+ Induction variable optimizations. This pass performs standard
+ induction variable optimizations, including strength reduction,
+ induction variable merging and induction variable elimination.
+ The pass is implemented in `tree-ssa-loop-ivopts.c'.
+
+ Loop unswitching. This pass moves the conditional jumps that are
+ invariant out of the loops. To achieve this, a duplicate of the
+ loop is created for each possible outcome of conditional jump(s).
+ The pass is implemented in `tree-ssa-loop-unswitch.c'. This pass
+ should eventually replace the RTL level loop unswitching in
+ `loop-unswitch.c', but currently the RTL level pass is not
+ completely redundant yet due to deficiencies in tree level alias
+ analysis.
+
+ The optimizations also use various utility functions contained in
+ `tree-ssa-loop-manip.c', `cfgloop.c', `cfgloopanal.c' and
+ `cfgloopmanip.c'.
+
+ Vectorization. This pass transforms loops to operate on vector
+ types instead of scalar types. Data parallelism across loop
+ iterations is exploited to group data elements from consecutive
+ iterations into a vector and operate on them in parallel.
+ Depending on available target support the loop is conceptually
+ unrolled by a factor `VF' (vectorization factor), which is the
+ number of elements operated upon in parallel in each iteration,
+ and the `VF' copies of each scalar operation are fused to form a
+ vector operation. Additional loop transformations such as peeling
+ and versioning may take place to align the number of iterations,
+ and to align the memory accesses in the loop. The pass is
+ implemented in `tree-vectorizer.c' (the main driver and general
+ utilities), `tree-vect-analyze.c' and `tree-vect-transform.c'.
+ Analysis of data references is in `tree-data-ref.c'.
+
+ Autoparallelization. This pass splits the loop iteration space to
+ run into several threads. The pass is implemented in
+ `tree-parloops.c'.
+
+ * Tree level if-conversion for vectorizer
+
+ This pass applies if-conversion to simple loops to help vectorizer.
+ We identify if convertible loops, if-convert statements and merge
+ basic blocks in one big block. The idea is to present loop in such
+ form so that vectorizer can have one to one mapping between
+ statements and available vector operations. This patch
+ re-introduces COND_EXPR at GIMPLE level. This pass is located in
+ `tree-if-conv.c' and is described by `pass_if_conversion'.
+
+ * Conditional constant propagation
+
+ This pass relaxes a lattice of values in order to identify those
+ that must be constant even in the presence of conditional branches.
+ The pass is located in `tree-ssa-ccp.c' and is described by
+ `pass_ccp'.
+
+ A related pass that works on memory loads and stores, and not just
+ register values, is located in `tree-ssa-ccp.c' and described by
+ `pass_store_ccp'.
+
+ * Conditional copy propagation
+
+ This is similar to constant propagation but the lattice of values
+ is the "copy-of" relation. It eliminates redundant copies from the
+ code. The pass is located in `tree-ssa-copy.c' and described by
+ `pass_copy_prop'.
+
+ A related pass that works on memory copies, and not just register
+ copies, is located in `tree-ssa-copy.c' and described by
+ `pass_store_copy_prop'.
+
+ * Value range propagation
+
+ This transformation is similar to constant propagation but instead
+ of propagating single constant values, it propagates known value
+ ranges. The implementation is based on Patterson's range
+ propagation algorithm (Accurate Static Branch Prediction by Value
+ Range Propagation, J. R. C. Patterson, PLDI '95). In contrast to
+ Patterson's algorithm, this implementation does not propagate
+ branch probabilities nor it uses more than a single range per SSA
+ name. This means that the current implementation cannot be used
+ for branch prediction (though adapting it would not be difficult).
+ The pass is located in `tree-vrp.c' and is described by
+ `pass_vrp'.
+
+ * Folding built-in functions
+
+ This pass simplifies built-in functions, as applicable, with
+ constant arguments or with inferable string lengths. It is
+ located in `tree-ssa-ccp.c' and is described by
+ `pass_fold_builtins'.
+
+ * Split critical edges
+
+ This pass identifies critical edges and inserts empty basic blocks
+ such that the edge is no longer critical. The pass is located in
+ `tree-cfg.c' and is described by `pass_split_crit_edges'.
+
+ * Control dependence dead code elimination
+
+ This pass is a stronger form of dead code elimination that can
+ eliminate unnecessary control flow statements. It is located in
+ `tree-ssa-dce.c' and is described by `pass_cd_dce'.
+
+ * Tail call elimination
+
+ This pass identifies function calls that may be rewritten into
+ jumps. No code transformation is actually applied here, but the
+ data and control flow problem is solved. The code transformation
+ requires target support, and so is delayed until RTL. In the
+ meantime `CALL_EXPR_TAILCALL' is set indicating the possibility.
+ The pass is located in `tree-tailcall.c' and is described by
+ `pass_tail_calls'. The RTL transformation is handled by
+ `fixup_tail_calls' in `calls.c'.
+
+ * Warn for function return without value
+
+ For non-void functions, this pass locates return statements that do
+ not specify a value and issues a warning. Such a statement may
+ have been injected by falling off the end of the function. This
+ pass is run last so that we have as much time as possible to prove
+ that the statement is not reachable. It is located in
+ `tree-cfg.c' and is described by `pass_warn_function_return'.
+
+ * Mudflap statement annotation
+
+ If mudflap is enabled, we rewrite some memory accesses with code to
+ validate that the memory access is correct. In particular,
+ expressions involving pointer dereferences (`INDIRECT_REF',
+ `ARRAY_REF', etc.) are replaced by code that checks the selected
+ address range against the mudflap runtime's database of valid
+ regions. This check includes an inline lookup into a
+ direct-mapped cache, based on shift/mask operations of the pointer
+ value, with a fallback function call into the runtime. The pass
+ is located in `tree-mudflap.c' and is described by
+ `pass_mudflap_2'.
+
+ * Leave static single assignment form
+
+ This pass rewrites the function such that it is in normal form. At
+ the same time, we eliminate as many single-use temporaries as
+ possible, so the intermediate language is no longer GIMPLE, but
+ GENERIC. The pass is located in `tree-outof-ssa.c' and is
+ described by `pass_del_ssa'.
+
+ * Merge PHI nodes that feed into one another
+
+ This is part of the CFG cleanup passes. It attempts to join PHI
+ nodes from a forwarder CFG block into another block with PHI
+ nodes. The pass is located in `tree-cfgcleanup.c' and is
+ described by `pass_merge_phi'.
+
+ * Return value optimization
+
+ If a function always returns the same local variable, and that
+ local variable is an aggregate type, then the variable is replaced
+ with the return value for the function (i.e., the function's
+ DECL_RESULT). This is equivalent to the C++ named return value
+ optimization applied to GIMPLE. The pass is located in
+ `tree-nrv.c' and is described by `pass_nrv'.
+
+ * Return slot optimization
+
+ If a function returns a memory object and is called as `var =
+ foo()', this pass tries to change the call so that the address of
+ `var' is sent to the caller to avoid an extra memory copy. This
+ pass is located in `tree-nrv.c' and is described by
+ `pass_return_slot'.
+
+ * Optimize calls to `__builtin_object_size'
+
+ This is a propagation pass similar to CCP that tries to remove
+ calls to `__builtin_object_size' when the size of the object can be
+ computed at compile-time. This pass is located in
+ `tree-object-size.c' and is described by `pass_object_sizes'.
+
+ * Loop invariant motion
+
+ This pass removes expensive loop-invariant computations out of
+ loops. The pass is located in `tree-ssa-loop.c' and described by
+ `pass_lim'.
+
+ * Loop nest optimizations
+
+ This is a family of loop transformations that works on loop nests.
+ It includes loop interchange, scaling, skewing and reversal and
+ they are all geared to the optimization of data locality in array
+ traversals and the removal of dependencies that hamper
+ optimizations such as loop parallelization and vectorization. The
+ pass is located in `tree-loop-linear.c' and described by
+ `pass_linear_transform'.
+
+ * Removal of empty loops
+
+ This pass removes loops with no code in them. The pass is located
+ in `tree-ssa-loop-ivcanon.c' and described by `pass_empty_loop'.
+
+ * Unrolling of small loops
+
+ This pass completely unrolls loops with few iterations. The pass
+ is located in `tree-ssa-loop-ivcanon.c' and described by
+ `pass_complete_unroll'.
+
+ * Predictive commoning
+
+ This pass makes the code reuse the computations from the previous
+ iterations of the loops, especially loads and stores to memory.
+ It does so by storing the values of these computations to a bank
+ of temporary variables that are rotated at the end of loop. To
+ avoid the need for this rotation, the loop is then unrolled and
+ the copies of the loop body are rewritten to use the appropriate
+ version of the temporary variable. This pass is located in
+ `tree-predcom.c' and described by `pass_predcom'.
+
+ * Array prefetching
+
+ This pass issues prefetch instructions for array references inside
+ loops. The pass is located in `tree-ssa-loop-prefetch.c' and
+ described by `pass_loop_prefetch'.
+
+ * Reassociation
+
+ This pass rewrites arithmetic expressions to enable optimizations
+ that operate on them, like redundancy elimination and
+ vectorization. The pass is located in `tree-ssa-reassoc.c' and
+ described by `pass_reassoc'.
+
+ * Optimization of `stdarg' functions
+
+ This pass tries to avoid the saving of register arguments into the
+ stack on entry to `stdarg' functions. If the function doesn't use
+ any `va_start' macros, no registers need to be saved. If
+ `va_start' macros are used, the `va_list' variables don't escape
+ the function, it is only necessary to save registers that will be
+ used in `va_arg' macros. For instance, if `va_arg' is only used
+ with integral types in the function, floating point registers
+ don't need to be saved. This pass is located in `tree-stdarg.c'
+ and described by `pass_stdarg'.
+
+
+
+File: gccint.info, Node: RTL passes, Prev: Tree SSA passes, Up: Passes
+
+8.5 RTL passes
+==============
+
+The following briefly describes the RTL generation and optimization
+passes that are run after the Tree optimization passes.
+
+ * RTL generation
+
+ The source files for RTL generation include `stmt.c', `calls.c',
+ `expr.c', `explow.c', `expmed.c', `function.c', `optabs.c' and
+ `emit-rtl.c'. Also, the file `insn-emit.c', generated from the
+ machine description by the program `genemit', is used in this
+ pass. The header file `expr.h' is used for communication within
+ this pass.
+
+ The header files `insn-flags.h' and `insn-codes.h', generated from
+ the machine description by the programs `genflags' and `gencodes',
+ tell this pass which standard names are available for use and
+ which patterns correspond to them.
+
+ * Generation of exception landing pads
+
+ This pass generates the glue that handles communication between the
+ exception handling library routines and the exception handlers
+ within the function. Entry points in the function that are
+ invoked by the exception handling library are called "landing
+ pads". The code for this pass is located in `except.c'.
+
+ * Control flow graph cleanup
+
+ This pass removes unreachable code, simplifies jumps to next,
+ jumps to jump, jumps across jumps, etc. The pass is run multiple
+ times. For historical reasons, it is occasionally referred to as
+ the "jump optimization pass". The bulk of the code for this pass
+ is in `cfgcleanup.c', and there are support routines in `cfgrtl.c'
+ and `jump.c'.
+
+ * Forward propagation of single-def values
+
+ This pass attempts to remove redundant computation by substituting
+ variables that come from a single definition, and seeing if the
+ result can be simplified. It performs copy propagation and
+ addressing mode selection. The pass is run twice, with values
+ being propagated into loops only on the second run. The code is
+ located in `fwprop.c'.
+
+ * Common subexpression elimination
+
+ This pass removes redundant computation within basic blocks, and
+ optimizes addressing modes based on cost. The pass is run twice.
+ The code for this pass is located in `cse.c'.
+
+ * Global common subexpression elimination
+
+ This pass performs two different types of GCSE depending on
+ whether you are optimizing for size or not (LCM based GCSE tends
+ to increase code size for a gain in speed, while Morel-Renvoise
+ based GCSE does not). When optimizing for size, GCSE is done
+ using Morel-Renvoise Partial Redundancy Elimination, with the
+ exception that it does not try to move invariants out of
+ loops--that is left to the loop optimization pass. If MR PRE
+ GCSE is done, code hoisting (aka unification) is also done, as
+ well as load motion. If you are optimizing for speed, LCM (lazy
+ code motion) based GCSE is done. LCM is based on the work of
+ Knoop, Ruthing, and Steffen. LCM based GCSE also does loop
+ invariant code motion. We also perform load and store motion when
+ optimizing for speed. Regardless of which type of GCSE is used,
+ the GCSE pass also performs global constant and copy propagation.
+ The source file for this pass is `gcse.c', and the LCM routines
+ are in `lcm.c'.
+
+ * Loop optimization
+
+ This pass performs several loop related optimizations. The source
+ files `cfgloopanal.c' and `cfgloopmanip.c' contain generic loop
+ analysis and manipulation code. Initialization and finalization
+ of loop structures is handled by `loop-init.c'. A loop invariant
+ motion pass is implemented in `loop-invariant.c'. Basic block
+ level optimizations--unrolling, peeling and unswitching loops--
+ are implemented in `loop-unswitch.c' and `loop-unroll.c'.
+ Replacing of the exit condition of loops by special
+ machine-dependent instructions is handled by `loop-doloop.c'.
+
+ * Jump bypassing
+
+ This pass is an aggressive form of GCSE that transforms the control
+ flow graph of a function by propagating constants into conditional
+ branch instructions. The source file for this pass is `gcse.c'.
+
+ * If conversion
+
+ This pass attempts to replace conditional branches and surrounding
+ assignments with arithmetic, boolean value producing comparison
+ instructions, and conditional move instructions. In the very last
+ invocation after reload, it will generate predicated instructions
+ when supported by the target. The code is located in `ifcvt.c'.
+
+ * Web construction
+
+ This pass splits independent uses of each pseudo-register. This
+ can improve effect of the other transformation, such as CSE or
+ register allocation. The code for this pass is located in `web.c'.
+
+ * Instruction combination
+
+ This pass attempts to combine groups of two or three instructions
+ that are related by data flow into single instructions. It
+ combines the RTL expressions for the instructions by substitution,
+ simplifies the result using algebra, and then attempts to match
+ the result against the machine description. The code is located
+ in `combine.c'.
+
+ * Register movement
+
+ This pass looks for cases where matching constraints would force an
+ instruction to need a reload, and this reload would be a
+ register-to-register move. It then attempts to change the
+ registers used by the instruction to avoid the move instruction.
+ The code is located in `regmove.c'.
+
+ * Mode switching optimization
+
+ This pass looks for instructions that require the processor to be
+ in a specific "mode" and minimizes the number of mode changes
+ required to satisfy all users. What these modes are, and what
+ they apply to are completely target-specific. The code for this
+ pass is located in `mode-switching.c'.
+
+ * Modulo scheduling
+
+ This pass looks at innermost loops and reorders their instructions
+ by overlapping different iterations. Modulo scheduling is
+ performed immediately before instruction scheduling. The code for
+ this pass is located in `modulo-sched.c'.
+
+ * Instruction scheduling
+
+ This pass looks for instructions whose output will not be
+ available by the time that it is used in subsequent instructions.
+ Memory loads and floating point instructions often have this
+ behavior on RISC machines. It re-orders instructions within a
+ basic block to try to separate the definition and use of items
+ that otherwise would cause pipeline stalls. This pass is
+ performed twice, before and after register allocation. The code
+ for this pass is located in `haifa-sched.c', `sched-deps.c',
+ `sched-ebb.c', `sched-rgn.c' and `sched-vis.c'.
+
+ * Register allocation
+
+ These passes make sure that all occurrences of pseudo registers are
+ eliminated, either by allocating them to a hard register, replacing
+ them by an equivalent expression (e.g. a constant) or by placing
+ them on the stack. This is done in several subpasses:
+
+ * Register move optimizations. This pass makes some simple RTL
+ code transformations which improve the subsequent register
+ allocation. The source file is `regmove.c'.
+
+ * The integrated register allocator (IRA). It is called
+ integrated because coalescing, register live range splitting,
+ and hard register preferencing are done on-the-fly during
+ coloring. It also has better integration with the reload
+ pass. Pseudo-registers spilled by the allocator or the
+ reload have still a chance to get hard-registers if the
+ reload evicts some pseudo-registers from hard-registers. The
+ allocator helps to choose better pseudos for spilling based
+ on their live ranges and to coalesce stack slots allocated
+ for the spilled pseudo-registers. IRA is a regional register
+ allocator which is transformed into Chaitin-Briggs allocator
+ if there is one region. By default, IRA chooses regions using
+ register pressure but the user can force it to use one region
+ or regions corresponding to all loops.
+
+ Source files of the allocator are `ira.c', `ira-build.c',
+ `ira-costs.c', `ira-conflicts.c', `ira-color.c',
+ `ira-emit.c', `ira-lives', plus header files `ira.h' and
+ `ira-int.h' used for the communication between the allocator
+ and the rest of the compiler and between the IRA files.
+
+ * Reloading. This pass renumbers pseudo registers with the
+ hardware registers numbers they were allocated. Pseudo
+ registers that did not get hard registers are replaced with
+ stack slots. Then it finds instructions that are invalid
+ because a value has failed to end up in a register, or has
+ ended up in a register of the wrong kind. It fixes up these
+ instructions by reloading the problematical values
+ temporarily into registers. Additional instructions are
+ generated to do the copying.
+
+ The reload pass also optionally eliminates the frame pointer
+ and inserts instructions to save and restore call-clobbered
+ registers around calls.
+
+ Source files are `reload.c' and `reload1.c', plus the header
+ `reload.h' used for communication between them.
+
+ * Basic block reordering
+
+ This pass implements profile guided code positioning. If profile
+ information is not available, various types of static analysis are
+ performed to make the predictions normally coming from the profile
+ feedback (IE execution frequency, branch probability, etc). It is
+ implemented in the file `bb-reorder.c', and the various prediction
+ routines are in `predict.c'.
+
+ * Variable tracking
+
+ This pass computes where the variables are stored at each position
+ in code and generates notes describing the variable locations to
+ RTL code. The location lists are then generated according to these
+ notes to debug information if the debugging information format
+ supports location lists. The code is located in `var-tracking.c'.
+
+ * Delayed branch scheduling
+
+ This optional pass attempts to find instructions that can go into
+ the delay slots of other instructions, usually jumps and calls.
+ The code for this pass is located in `reorg.c'.
+
+ * Branch shortening
+
+ On many RISC machines, branch instructions have a limited range.
+ Thus, longer sequences of instructions must be used for long
+ branches. In this pass, the compiler figures out what how far
+ each instruction will be from each other instruction, and
+ therefore whether the usual instructions, or the longer sequences,
+ must be used for each branch. The code for this pass is located
+ in `final.c'.
+
+ * Register-to-stack conversion
+
+ Conversion from usage of some hard registers to usage of a register
+ stack may be done at this point. Currently, this is supported only
+ for the floating-point registers of the Intel 80387 coprocessor.
+ The code for this pass is located in `reg-stack.c'.
+
+ * Final
+
+ This pass outputs the assembler code for the function. The source
+ files are `final.c' plus `insn-output.c'; the latter is generated
+ automatically from the machine description by the tool `genoutput'.
+ The header file `conditions.h' is used for communication between
+ these files. If mudflap is enabled, the queue of deferred
+ declarations and any addressed constants (e.g., string literals)
+ is processed by `mudflap_finish_file' into a synthetic constructor
+ function containing calls into the mudflap runtime.
+
+ * Debugging information output
+
+ This is run after final because it must output the stack slot
+ offsets for pseudo registers that did not get hard registers.
+ Source files are `dbxout.c' for DBX symbol table format,
+ `sdbout.c' for SDB symbol table format, `dwarfout.c' for DWARF
+ symbol table format, files `dwarf2out.c' and `dwarf2asm.c' for
+ DWARF2 symbol table format, and `vmsdbgout.c' for VMS debug symbol
+ table format.
+
+
+
+File: gccint.info, Node: Trees, Next: GENERIC, Prev: Passes, Up: Top
+
+9 Trees: The intermediate representation used by the C and C++ front ends
+*************************************************************************
+
+This chapter documents the internal representation used by GCC to
+represent C and C++ source programs. When presented with a C or C++
+source program, GCC parses the program, performs semantic analysis
+(including the generation of error messages), and then produces the
+internal representation described here. This representation contains a
+complete representation for the entire translation unit provided as
+input to the front end. This representation is then typically processed
+by a code-generator in order to produce machine code, but could also be
+used in the creation of source browsers, intelligent editors, automatic
+documentation generators, interpreters, and any other programs needing
+the ability to process C or C++ code.
+
+ This chapter explains the internal representation. In particular, it
+documents the internal representation for C and C++ source constructs,
+and the macros, functions, and variables that can be used to access
+these constructs. The C++ representation is largely a superset of the
+representation used in the C front end. There is only one construct
+used in C that does not appear in the C++ front end and that is the GNU
+"nested function" extension. Many of the macros documented here do not
+apply in C because the corresponding language constructs do not appear
+in C.
+
+ If you are developing a "back end", be it is a code-generator or some
+other tool, that uses this representation, you may occasionally find
+that you need to ask questions not easily answered by the functions and
+macros available here. If that situation occurs, it is quite likely
+that GCC already supports the functionality you desire, but that the
+interface is simply not documented here. In that case, you should ask
+the GCC maintainers (via mail to <gcc@gcc.gnu.org>) about documenting
+the functionality you require. Similarly, if you find yourself writing
+functions that do not deal directly with your back end, but instead
+might be useful to other people using the GCC front end, you should
+submit your patches for inclusion in GCC.
+
+* Menu:
+
+* Deficiencies:: Topics net yet covered in this document.
+* Tree overview:: All about `tree's.
+* Types:: Fundamental and aggregate types.
+* Scopes:: Namespaces and classes.
+* Functions:: Overloading, function bodies, and linkage.
+* Declarations:: Type declarations and variables.
+* Attributes:: Declaration and type attributes.
+* Expression trees:: From `typeid' to `throw'.
+
+
+File: gccint.info, Node: Deficiencies, Next: Tree overview, Up: Trees
+
+9.1 Deficiencies
+================
+
+There are many places in which this document is incomplet and incorrekt.
+It is, as of yet, only _preliminary_ documentation.
+
+
+File: gccint.info, Node: Tree overview, Next: Types, Prev: Deficiencies, Up: Trees
+
+9.2 Overview
+============
+
+The central data structure used by the internal representation is the
+`tree'. These nodes, while all of the C type `tree', are of many
+varieties. A `tree' is a pointer type, but the object to which it
+points may be of a variety of types. From this point forward, we will
+refer to trees in ordinary type, rather than in `this font', except
+when talking about the actual C type `tree'.
+
+ You can tell what kind of node a particular tree is by using the
+`TREE_CODE' macro. Many, many macros take trees as input and return
+trees as output. However, most macros require a certain kind of tree
+node as input. In other words, there is a type-system for trees, but
+it is not reflected in the C type-system.
+
+ For safety, it is useful to configure GCC with `--enable-checking'.
+Although this results in a significant performance penalty (since all
+tree types are checked at run-time), and is therefore inappropriate in a
+release version, it is extremely helpful during the development process.
+
+ Many macros behave as predicates. Many, although not all, of these
+predicates end in `_P'. Do not rely on the result type of these macros
+being of any particular type. You may, however, rely on the fact that
+the type can be compared to `0', so that statements like
+ if (TEST_P (t) && !TEST_P (y))
+ x = 1;
+ and
+ int i = (TEST_P (t) != 0);
+ are legal. Macros that return `int' values now may be changed to
+return `tree' values, or other pointers in the future. Even those that
+continue to return `int' may return multiple nonzero codes where
+previously they returned only zero and one. Therefore, you should not
+write code like
+ if (TEST_P (t) == 1)
+ as this code is not guaranteed to work correctly in the future.
+
+ You should not take the address of values returned by the macros or
+functions described here. In particular, no guarantee is given that the
+values are lvalues.
+
+ In general, the names of macros are all in uppercase, while the names
+of functions are entirely in lowercase. There are rare exceptions to
+this rule. You should assume that any macro or function whose name is
+made up entirely of uppercase letters may evaluate its arguments more
+than once. You may assume that a macro or function whose name is made
+up entirely of lowercase letters will evaluate its arguments only once.
+
+ The `error_mark_node' is a special tree. Its tree code is
+`ERROR_MARK', but since there is only ever one node with that code, the
+usual practice is to compare the tree against `error_mark_node'. (This
+test is just a test for pointer equality.) If an error has occurred
+during front-end processing the flag `errorcount' will be set. If the
+front end has encountered code it cannot handle, it will issue a
+message to the user and set `sorrycount'. When these flags are set,
+any macro or function which normally returns a tree of a particular
+kind may instead return the `error_mark_node'. Thus, if you intend to
+do any processing of erroneous code, you must be prepared to deal with
+the `error_mark_node'.
+
+ Occasionally, a particular tree slot (like an operand to an expression,
+or a particular field in a declaration) will be referred to as
+"reserved for the back end". These slots are used to store RTL when
+the tree is converted to RTL for use by the GCC back end. However, if
+that process is not taking place (e.g., if the front end is being hooked
+up to an intelligent editor), then those slots may be used by the back
+end presently in use.
+
+ If you encounter situations that do not match this documentation, such
+as tree nodes of types not mentioned here, or macros documented to
+return entities of a particular kind that instead return entities of
+some different kind, you have found a bug, either in the front end or in
+the documentation. Please report these bugs as you would any other bug.
+
+* Menu:
+
+* Macros and Functions::Macros and functions that can be used with all trees.
+* Identifiers:: The names of things.
+* Containers:: Lists and vectors.
+
+
+File: gccint.info, Node: Macros and Functions, Next: Identifiers, Up: Tree overview
+
+9.2.1 Trees
+-----------
+
+This section is not here yet.
+
+
+File: gccint.info, Node: Identifiers, Next: Containers, Prev: Macros and Functions, Up: Tree overview
+
+9.2.2 Identifiers
+-----------------
+
+An `IDENTIFIER_NODE' represents a slightly more general concept that
+the standard C or C++ concept of identifier. In particular, an
+`IDENTIFIER_NODE' may contain a `$', or other extraordinary characters.
+
+ There are never two distinct `IDENTIFIER_NODE's representing the same
+identifier. Therefore, you may use pointer equality to compare
+`IDENTIFIER_NODE's, rather than using a routine like `strcmp'.
+
+ You can use the following macros to access identifiers:
+`IDENTIFIER_POINTER'
+ The string represented by the identifier, represented as a
+ `char*'. This string is always `NUL'-terminated, and contains no
+ embedded `NUL' characters.
+
+`IDENTIFIER_LENGTH'
+ The length of the string returned by `IDENTIFIER_POINTER', not
+ including the trailing `NUL'. This value of `IDENTIFIER_LENGTH
+ (x)' is always the same as `strlen (IDENTIFIER_POINTER (x))'.
+
+`IDENTIFIER_OPNAME_P'
+ This predicate holds if the identifier represents the name of an
+ overloaded operator. In this case, you should not depend on the
+ contents of either the `IDENTIFIER_POINTER' or the
+ `IDENTIFIER_LENGTH'.
+
+`IDENTIFIER_TYPENAME_P'
+ This predicate holds if the identifier represents the name of a
+ user-defined conversion operator. In this case, the `TREE_TYPE' of
+ the `IDENTIFIER_NODE' holds the type to which the conversion
+ operator converts.
+
+
+
+File: gccint.info, Node: Containers, Prev: Identifiers, Up: Tree overview
+
+9.2.3 Containers
+----------------
+
+Two common container data structures can be represented directly with
+tree nodes. A `TREE_LIST' is a singly linked list containing two trees
+per node. These are the `TREE_PURPOSE' and `TREE_VALUE' of each node.
+(Often, the `TREE_PURPOSE' contains some kind of tag, or additional
+information, while the `TREE_VALUE' contains the majority of the
+payload. In other cases, the `TREE_PURPOSE' is simply `NULL_TREE',
+while in still others both the `TREE_PURPOSE' and `TREE_VALUE' are of
+equal stature.) Given one `TREE_LIST' node, the next node is found by
+following the `TREE_CHAIN'. If the `TREE_CHAIN' is `NULL_TREE', then
+you have reached the end of the list.
+
+ A `TREE_VEC' is a simple vector. The `TREE_VEC_LENGTH' is an integer
+(not a tree) giving the number of nodes in the vector. The nodes
+themselves are accessed using the `TREE_VEC_ELT' macro, which takes two
+arguments. The first is the `TREE_VEC' in question; the second is an
+integer indicating which element in the vector is desired. The
+elements are indexed from zero.
+
+
+File: gccint.info, Node: Types, Next: Scopes, Prev: Tree overview, Up: Trees
+
+9.3 Types
+=========
+
+All types have corresponding tree nodes. However, you should not assume
+that there is exactly one tree node corresponding to each type. There
+are often multiple nodes corresponding to the same type.
+
+ For the most part, different kinds of types have different tree codes.
+(For example, pointer types use a `POINTER_TYPE' code while arrays use
+an `ARRAY_TYPE' code.) However, pointers to member functions use the
+`RECORD_TYPE' code. Therefore, when writing a `switch' statement that
+depends on the code associated with a particular type, you should take
+care to handle pointers to member functions under the `RECORD_TYPE'
+case label.
+
+ In C++, an array type is not qualified; rather the type of the array
+elements is qualified. This situation is reflected in the intermediate
+representation. The macros described here will always examine the
+qualification of the underlying element type when applied to an array
+type. (If the element type is itself an array, then the recursion
+continues until a non-array type is found, and the qualification of this
+type is examined.) So, for example, `CP_TYPE_CONST_P' will hold of the
+type `const int ()[7]', denoting an array of seven `int's.
+
+ The following functions and macros deal with cv-qualification of types:
+`CP_TYPE_QUALS'
+ This macro returns the set of type qualifiers applied to this type.
+ This value is `TYPE_UNQUALIFIED' if no qualifiers have been
+ applied. The `TYPE_QUAL_CONST' bit is set if the type is
+ `const'-qualified. The `TYPE_QUAL_VOLATILE' bit is set if the
+ type is `volatile'-qualified. The `TYPE_QUAL_RESTRICT' bit is set
+ if the type is `restrict'-qualified.
+
+`CP_TYPE_CONST_P'
+ This macro holds if the type is `const'-qualified.
+
+`CP_TYPE_VOLATILE_P'
+ This macro holds if the type is `volatile'-qualified.
+
+`CP_TYPE_RESTRICT_P'
+ This macro holds if the type is `restrict'-qualified.
+
+`CP_TYPE_CONST_NON_VOLATILE_P'
+ This predicate holds for a type that is `const'-qualified, but
+ _not_ `volatile'-qualified; other cv-qualifiers are ignored as
+ well: only the `const'-ness is tested.
+
+`TYPE_MAIN_VARIANT'
+ This macro returns the unqualified version of a type. It may be
+ applied to an unqualified type, but it is not always the identity
+ function in that case.
+
+ A few other macros and functions are usable with all types:
+`TYPE_SIZE'
+ The number of bits required to represent the type, represented as
+ an `INTEGER_CST'. For an incomplete type, `TYPE_SIZE' will be
+ `NULL_TREE'.
+
+`TYPE_ALIGN'
+ The alignment of the type, in bits, represented as an `int'.
+
+`TYPE_NAME'
+ This macro returns a declaration (in the form of a `TYPE_DECL') for
+ the type. (Note this macro does _not_ return a `IDENTIFIER_NODE',
+ as you might expect, given its name!) You can look at the
+ `DECL_NAME' of the `TYPE_DECL' to obtain the actual name of the
+ type. The `TYPE_NAME' will be `NULL_TREE' for a type that is not
+ a built-in type, the result of a typedef, or a named class type.
+
+`CP_INTEGRAL_TYPE'
+ This predicate holds if the type is an integral type. Notice that
+ in C++, enumerations are _not_ integral types.
+
+`ARITHMETIC_TYPE_P'
+ This predicate holds if the type is an integral type (in the C++
+ sense) or a floating point type.
+
+`CLASS_TYPE_P'
+ This predicate holds for a class-type.
+
+`TYPE_BUILT_IN'
+ This predicate holds for a built-in type.
+
+`TYPE_PTRMEM_P'
+ This predicate holds if the type is a pointer to data member.
+
+`TYPE_PTR_P'
+ This predicate holds if the type is a pointer type, and the
+ pointee is not a data member.
+
+`TYPE_PTRFN_P'
+ This predicate holds for a pointer to function type.
+
+`TYPE_PTROB_P'
+ This predicate holds for a pointer to object type. Note however
+ that it does not hold for the generic pointer to object type `void
+ *'. You may use `TYPE_PTROBV_P' to test for a pointer to object
+ type as well as `void *'.
+
+`TYPE_CANONICAL'
+ This macro returns the "canonical" type for the given type node.
+ Canonical types are used to improve performance in the C++ and
+ Objective-C++ front ends by allowing efficient comparison between
+ two type nodes in `same_type_p': if the `TYPE_CANONICAL' values of
+ the types are equal, the types are equivalent; otherwise, the types
+ are not equivalent. The notion of equivalence for canonical types
+ is the same as the notion of type equivalence in the language
+ itself. For instance,
+
+ When `TYPE_CANONICAL' is `NULL_TREE', there is no canonical type
+ for the given type node. In this case, comparison between this
+ type and any other type requires the compiler to perform a deep,
+ "structural" comparison to see if the two type nodes have the same
+ form and properties.
+
+ The canonical type for a node is always the most fundamental type
+ in the equivalence class of types. For instance, `int' is its own
+ canonical type. A typedef `I' of `int' will have `int' as its
+ canonical type. Similarly, `I*' and a typedef `IP' (defined to
+ `I*') will has `int*' as their canonical type. When building a new
+ type node, be sure to set `TYPE_CANONICAL' to the appropriate
+ canonical type. If the new type is a compound type (built from
+ other types), and any of those other types require structural
+ equality, use `SET_TYPE_STRUCTURAL_EQUALITY' to ensure that the
+ new type also requires structural equality. Finally, if for some
+ reason you cannot guarantee that `TYPE_CANONICAL' will point to
+ the canonical type, use `SET_TYPE_STRUCTURAL_EQUALITY' to make
+ sure that the new type-and any type constructed based on
+ it-requires structural equality. If you suspect that the canonical
+ type system is miscomparing types, pass `--param
+ verify-canonical-types=1' to the compiler or configure with
+ `--enable-checking' to force the compiler to verify its
+ canonical-type comparisons against the structural comparisons; the
+ compiler will then print any warnings if the canonical types
+ miscompare.
+
+`TYPE_STRUCTURAL_EQUALITY_P'
+ This predicate holds when the node requires structural equality
+ checks, e.g., when `TYPE_CANONICAL' is `NULL_TREE'.
+
+`SET_TYPE_STRUCTURAL_EQUALITY'
+ This macro states that the type node it is given requires
+ structural equality checks, e.g., it sets `TYPE_CANONICAL' to
+ `NULL_TREE'.
+
+`same_type_p'
+ This predicate takes two types as input, and holds if they are the
+ same type. For example, if one type is a `typedef' for the other,
+ or both are `typedef's for the same type. This predicate also
+ holds if the two trees given as input are simply copies of one
+ another; i.e., there is no difference between them at the source
+ level, but, for whatever reason, a duplicate has been made in the
+ representation. You should never use `==' (pointer equality) to
+ compare types; always use `same_type_p' instead.
+
+ Detailed below are the various kinds of types, and the macros that can
+be used to access them. Although other kinds of types are used
+elsewhere in G++, the types described here are the only ones that you
+will encounter while examining the intermediate representation.
+
+`VOID_TYPE'
+ Used to represent the `void' type.
+
+`INTEGER_TYPE'
+ Used to represent the various integral types, including `char',
+ `short', `int', `long', and `long long'. This code is not used
+ for enumeration types, nor for the `bool' type. The
+ `TYPE_PRECISION' is the number of bits used in the representation,
+ represented as an `unsigned int'. (Note that in the general case
+ this is not the same value as `TYPE_SIZE'; suppose that there were
+ a 24-bit integer type, but that alignment requirements for the ABI
+ required 32-bit alignment. Then, `TYPE_SIZE' would be an
+ `INTEGER_CST' for 32, while `TYPE_PRECISION' would be 24.) The
+ integer type is unsigned if `TYPE_UNSIGNED' holds; otherwise, it
+ is signed.
+
+ The `TYPE_MIN_VALUE' is an `INTEGER_CST' for the smallest integer
+ that may be represented by this type. Similarly, the
+ `TYPE_MAX_VALUE' is an `INTEGER_CST' for the largest integer that
+ may be represented by this type.
+
+`REAL_TYPE'
+ Used to represent the `float', `double', and `long double' types.
+ The number of bits in the floating-point representation is given
+ by `TYPE_PRECISION', as in the `INTEGER_TYPE' case.
+
+`FIXED_POINT_TYPE'
+ Used to represent the `short _Fract', `_Fract', `long _Fract',
+ `long long _Fract', `short _Accum', `_Accum', `long _Accum', and
+ `long long _Accum' types. The number of bits in the fixed-point
+ representation is given by `TYPE_PRECISION', as in the
+ `INTEGER_TYPE' case. There may be padding bits, fractional bits
+ and integral bits. The number of fractional bits is given by
+ `TYPE_FBIT', and the number of integral bits is given by
+ `TYPE_IBIT'. The fixed-point type is unsigned if `TYPE_UNSIGNED'
+ holds; otherwise, it is signed. The fixed-point type is
+ saturating if `TYPE_SATURATING' holds; otherwise, it is not
+ saturating.
+
+`COMPLEX_TYPE'
+ Used to represent GCC built-in `__complex__' data types. The
+ `TREE_TYPE' is the type of the real and imaginary parts.
+
+`ENUMERAL_TYPE'
+ Used to represent an enumeration type. The `TYPE_PRECISION' gives
+ (as an `int'), the number of bits used to represent the type. If
+ there are no negative enumeration constants, `TYPE_UNSIGNED' will
+ hold. The minimum and maximum enumeration constants may be
+ obtained with `TYPE_MIN_VALUE' and `TYPE_MAX_VALUE', respectively;
+ each of these macros returns an `INTEGER_CST'.
+
+ The actual enumeration constants themselves may be obtained by
+ looking at the `TYPE_VALUES'. This macro will return a
+ `TREE_LIST', containing the constants. The `TREE_PURPOSE' of each
+ node will be an `IDENTIFIER_NODE' giving the name of the constant;
+ the `TREE_VALUE' will be an `INTEGER_CST' giving the value
+ assigned to that constant. These constants will appear in the
+ order in which they were declared. The `TREE_TYPE' of each of
+ these constants will be the type of enumeration type itself.
+
+`BOOLEAN_TYPE'
+ Used to represent the `bool' type.
+
+`POINTER_TYPE'
+ Used to represent pointer types, and pointer to data member types.
+ The `TREE_TYPE' gives the type to which this type points. If the
+ type is a pointer to data member type, then `TYPE_PTRMEM_P' will
+ hold. For a pointer to data member type of the form `T X::*',
+ `TYPE_PTRMEM_CLASS_TYPE' will be the type `X', while
+ `TYPE_PTRMEM_POINTED_TO_TYPE' will be the type `T'.
+
+`REFERENCE_TYPE'
+ Used to represent reference types. The `TREE_TYPE' gives the type
+ to which this type refers.
+
+`FUNCTION_TYPE'
+ Used to represent the type of non-member functions and of static
+ member functions. The `TREE_TYPE' gives the return type of the
+ function. The `TYPE_ARG_TYPES' are a `TREE_LIST' of the argument
+ types. The `TREE_VALUE' of each node in this list is the type of
+ the corresponding argument; the `TREE_PURPOSE' is an expression
+ for the default argument value, if any. If the last node in the
+ list is `void_list_node' (a `TREE_LIST' node whose `TREE_VALUE' is
+ the `void_type_node'), then functions of this type do not take
+ variable arguments. Otherwise, they do take a variable number of
+ arguments.
+
+ Note that in C (but not in C++) a function declared like `void f()'
+ is an unprototyped function taking a variable number of arguments;
+ the `TYPE_ARG_TYPES' of such a function will be `NULL'.
+
+`METHOD_TYPE'
+ Used to represent the type of a non-static member function. Like a
+ `FUNCTION_TYPE', the return type is given by the `TREE_TYPE'. The
+ type of `*this', i.e., the class of which functions of this type
+ are a member, is given by the `TYPE_METHOD_BASETYPE'. The
+ `TYPE_ARG_TYPES' is the parameter list, as for a `FUNCTION_TYPE',
+ and includes the `this' argument.
+
+`ARRAY_TYPE'
+ Used to represent array types. The `TREE_TYPE' gives the type of
+ the elements in the array. If the array-bound is present in the
+ type, the `TYPE_DOMAIN' is an `INTEGER_TYPE' whose
+ `TYPE_MIN_VALUE' and `TYPE_MAX_VALUE' will be the lower and upper
+ bounds of the array, respectively. The `TYPE_MIN_VALUE' will
+ always be an `INTEGER_CST' for zero, while the `TYPE_MAX_VALUE'
+ will be one less than the number of elements in the array, i.e.,
+ the highest value which may be used to index an element in the
+ array.
+
+`RECORD_TYPE'
+ Used to represent `struct' and `class' types, as well as pointers
+ to member functions and similar constructs in other languages.
+ `TYPE_FIELDS' contains the items contained in this type, each of
+ which can be a `FIELD_DECL', `VAR_DECL', `CONST_DECL', or
+ `TYPE_DECL'. You may not make any assumptions about the ordering
+ of the fields in the type or whether one or more of them overlap.
+ If `TYPE_PTRMEMFUNC_P' holds, then this type is a pointer-to-member
+ type. In that case, the `TYPE_PTRMEMFUNC_FN_TYPE' is a
+ `POINTER_TYPE' pointing to a `METHOD_TYPE'. The `METHOD_TYPE' is
+ the type of a function pointed to by the pointer-to-member
+ function. If `TYPE_PTRMEMFUNC_P' does not hold, this type is a
+ class type. For more information, see *note Classes::.
+
+`UNION_TYPE'
+ Used to represent `union' types. Similar to `RECORD_TYPE' except
+ that all `FIELD_DECL' nodes in `TYPE_FIELD' start at bit position
+ zero.
+
+`QUAL_UNION_TYPE'
+ Used to represent part of a variant record in Ada. Similar to
+ `UNION_TYPE' except that each `FIELD_DECL' has a `DECL_QUALIFIER'
+ field, which contains a boolean expression that indicates whether
+ the field is present in the object. The type will only have one
+ field, so each field's `DECL_QUALIFIER' is only evaluated if none
+ of the expressions in the previous fields in `TYPE_FIELDS' are
+ nonzero. Normally these expressions will reference a field in the
+ outer object using a `PLACEHOLDER_EXPR'.
+
+`UNKNOWN_TYPE'
+ This node is used to represent a type the knowledge of which is
+ insufficient for a sound processing.
+
+`OFFSET_TYPE'
+ This node is used to represent a pointer-to-data member. For a
+ data member `X::m' the `TYPE_OFFSET_BASETYPE' is `X' and the
+ `TREE_TYPE' is the type of `m'.
+
+`TYPENAME_TYPE'
+ Used to represent a construct of the form `typename T::A'. The
+ `TYPE_CONTEXT' is `T'; the `TYPE_NAME' is an `IDENTIFIER_NODE' for
+ `A'. If the type is specified via a template-id, then
+ `TYPENAME_TYPE_FULLNAME' yields a `TEMPLATE_ID_EXPR'. The
+ `TREE_TYPE' is non-`NULL' if the node is implicitly generated in
+ support for the implicit typename extension; in which case the
+ `TREE_TYPE' is a type node for the base-class.
+
+`TYPEOF_TYPE'
+ Used to represent the `__typeof__' extension. The `TYPE_FIELDS'
+ is the expression the type of which is being represented.
+
+ There are variables whose values represent some of the basic types.
+These include:
+`void_type_node'
+ A node for `void'.
+
+`integer_type_node'
+ A node for `int'.
+
+`unsigned_type_node.'
+ A node for `unsigned int'.
+
+`char_type_node.'
+ A node for `char'.
+ It may sometimes be useful to compare one of these variables with a
+type in hand, using `same_type_p'.
+
+
+File: gccint.info, Node: Scopes, Next: Functions, Prev: Types, Up: Trees
+
+9.4 Scopes
+==========
+
+The root of the entire intermediate representation is the variable
+`global_namespace'. This is the namespace specified with `::' in C++
+source code. All other namespaces, types, variables, functions, and so
+forth can be found starting with this namespace.
+
+ Besides namespaces, the other high-level scoping construct in C++ is
+the class. (Throughout this manual the term "class" is used to mean the
+types referred to in the ANSI/ISO C++ Standard as classes; these include
+types defined with the `class', `struct', and `union' keywords.)
+
+* Menu:
+
+* Namespaces:: Member functions, types, etc.
+* Classes:: Members, bases, friends, etc.
+
+
+File: gccint.info, Node: Namespaces, Next: Classes, Up: Scopes
+
+9.4.1 Namespaces
+----------------
+
+A namespace is represented by a `NAMESPACE_DECL' node.
+
+ However, except for the fact that it is distinguished as the root of
+the representation, the global namespace is no different from any other
+namespace. Thus, in what follows, we describe namespaces generally,
+rather than the global namespace in particular.
+
+ The following macros and functions can be used on a `NAMESPACE_DECL':
+
+`DECL_NAME'
+ This macro is used to obtain the `IDENTIFIER_NODE' corresponding to
+ the unqualified name of the name of the namespace (*note
+ Identifiers::). The name of the global namespace is `::', even
+ though in C++ the global namespace is unnamed. However, you
+ should use comparison with `global_namespace', rather than
+ `DECL_NAME' to determine whether or not a namespace is the global
+ one. An unnamed namespace will have a `DECL_NAME' equal to
+ `anonymous_namespace_name'. Within a single translation unit, all
+ unnamed namespaces will have the same name.
+
+`DECL_CONTEXT'
+ This macro returns the enclosing namespace. The `DECL_CONTEXT' for
+ the `global_namespace' is `NULL_TREE'.
+
+`DECL_NAMESPACE_ALIAS'
+ If this declaration is for a namespace alias, then
+ `DECL_NAMESPACE_ALIAS' is the namespace for which this one is an
+ alias.
+
+ Do not attempt to use `cp_namespace_decls' for a namespace which is
+ an alias. Instead, follow `DECL_NAMESPACE_ALIAS' links until you
+ reach an ordinary, non-alias, namespace, and call
+ `cp_namespace_decls' there.
+
+`DECL_NAMESPACE_STD_P'
+ This predicate holds if the namespace is the special `::std'
+ namespace.
+
+`cp_namespace_decls'
+ This function will return the declarations contained in the
+ namespace, including types, overloaded functions, other
+ namespaces, and so forth. If there are no declarations, this
+ function will return `NULL_TREE'. The declarations are connected
+ through their `TREE_CHAIN' fields.
+
+ Although most entries on this list will be declarations,
+ `TREE_LIST' nodes may also appear. In this case, the `TREE_VALUE'
+ will be an `OVERLOAD'. The value of the `TREE_PURPOSE' is
+ unspecified; back ends should ignore this value. As with the
+ other kinds of declarations returned by `cp_namespace_decls', the
+ `TREE_CHAIN' will point to the next declaration in this list.
+
+ For more information on the kinds of declarations that can occur
+ on this list, *Note Declarations::. Some declarations will not
+ appear on this list. In particular, no `FIELD_DECL',
+ `LABEL_DECL', or `PARM_DECL' nodes will appear here.
+
+ This function cannot be used with namespaces that have
+ `DECL_NAMESPACE_ALIAS' set.
+
+
+
+File: gccint.info, Node: Classes, Prev: Namespaces, Up: Scopes
+
+9.4.2 Classes
+-------------
+
+A class type is represented by either a `RECORD_TYPE' or a
+`UNION_TYPE'. A class declared with the `union' tag is represented by
+a `UNION_TYPE', while classes declared with either the `struct' or the
+`class' tag are represented by `RECORD_TYPE's. You can use the
+`CLASSTYPE_DECLARED_CLASS' macro to discern whether or not a particular
+type is a `class' as opposed to a `struct'. This macro will be true
+only for classes declared with the `class' tag.
+
+ Almost all non-function members are available on the `TYPE_FIELDS'
+list. Given one member, the next can be found by following the
+`TREE_CHAIN'. You should not depend in any way on the order in which
+fields appear on this list. All nodes on this list will be `DECL'
+nodes. A `FIELD_DECL' is used to represent a non-static data member, a
+`VAR_DECL' is used to represent a static data member, and a `TYPE_DECL'
+is used to represent a type. Note that the `CONST_DECL' for an
+enumeration constant will appear on this list, if the enumeration type
+was declared in the class. (Of course, the `TYPE_DECL' for the
+enumeration type will appear here as well.) There are no entries for
+base classes on this list. In particular, there is no `FIELD_DECL' for
+the "base-class portion" of an object.
+
+ The `TYPE_VFIELD' is a compiler-generated field used to point to
+virtual function tables. It may or may not appear on the `TYPE_FIELDS'
+list. However, back ends should handle the `TYPE_VFIELD' just like all
+the entries on the `TYPE_FIELDS' list.
+
+ The function members are available on the `TYPE_METHODS' list. Again,
+subsequent members are found by following the `TREE_CHAIN' field. If a
+function is overloaded, each of the overloaded functions appears; no
+`OVERLOAD' nodes appear on the `TYPE_METHODS' list. Implicitly
+declared functions (including default constructors, copy constructors,
+assignment operators, and destructors) will appear on this list as well.
+
+ Every class has an associated "binfo", which can be obtained with
+`TYPE_BINFO'. Binfos are used to represent base-classes. The binfo
+given by `TYPE_BINFO' is the degenerate case, whereby every class is
+considered to be its own base-class. The base binfos for a particular
+binfo are held in a vector, whose length is obtained with
+`BINFO_N_BASE_BINFOS'. The base binfos themselves are obtained with
+`BINFO_BASE_BINFO' and `BINFO_BASE_ITERATE'. To add a new binfo, use
+`BINFO_BASE_APPEND'. The vector of base binfos can be obtained with
+`BINFO_BASE_BINFOS', but normally you do not need to use that. The
+class type associated with a binfo is given by `BINFO_TYPE'. It is not
+always the case that `BINFO_TYPE (TYPE_BINFO (x))', because of typedefs
+and qualified types. Neither is it the case that `TYPE_BINFO
+(BINFO_TYPE (y))' is the same binfo as `y'. The reason is that if `y'
+is a binfo representing a base-class `B' of a derived class `D', then
+`BINFO_TYPE (y)' will be `B', and `TYPE_BINFO (BINFO_TYPE (y))' will be
+`B' as its own base-class, rather than as a base-class of `D'.
+
+ The access to a base type can be found with `BINFO_BASE_ACCESS'. This
+will produce `access_public_node', `access_private_node' or
+`access_protected_node'. If bases are always public,
+`BINFO_BASE_ACCESSES' may be `NULL'.
+
+ `BINFO_VIRTUAL_P' is used to specify whether the binfo is inherited
+virtually or not. The other flags, `BINFO_MARKED_P' and `BINFO_FLAG_1'
+to `BINFO_FLAG_6' can be used for language specific use.
+
+ The following macros can be used on a tree node representing a
+class-type.
+
+`LOCAL_CLASS_P'
+ This predicate holds if the class is local class _i.e._ declared
+ inside a function body.
+
+`TYPE_POLYMORPHIC_P'
+ This predicate holds if the class has at least one virtual function
+ (declared or inherited).
+
+`TYPE_HAS_DEFAULT_CONSTRUCTOR'
+ This predicate holds whenever its argument represents a class-type
+ with default constructor.
+
+`CLASSTYPE_HAS_MUTABLE'
+`TYPE_HAS_MUTABLE_P'
+ These predicates hold for a class-type having a mutable data
+ member.
+
+`CLASSTYPE_NON_POD_P'
+ This predicate holds only for class-types that are not PODs.
+
+`TYPE_HAS_NEW_OPERATOR'
+ This predicate holds for a class-type that defines `operator new'.
+
+`TYPE_HAS_ARRAY_NEW_OPERATOR'
+ This predicate holds for a class-type for which `operator new[]'
+ is defined.
+
+`TYPE_OVERLOADS_CALL_EXPR'
+ This predicate holds for class-type for which the function call
+ `operator()' is overloaded.
+
+`TYPE_OVERLOADS_ARRAY_REF'
+ This predicate holds for a class-type that overloads `operator[]'
+
+`TYPE_OVERLOADS_ARROW'
+ This predicate holds for a class-type for which `operator->' is
+ overloaded.
+
+
+
+File: gccint.info, Node: Declarations, Next: Attributes, Prev: Functions, Up: Trees
+
+9.5 Declarations
+================
+
+This section covers the various kinds of declarations that appear in the
+internal representation, except for declarations of functions
+(represented by `FUNCTION_DECL' nodes), which are described in *Note
+Functions::.
+
+* Menu:
+
+* Working with declarations:: Macros and functions that work on
+declarations.
+* Internal structure:: How declaration nodes are represented.
+
+
+File: gccint.info, Node: Working with declarations, Next: Internal structure, Up: Declarations
+
+9.5.1 Working with declarations
+-------------------------------
+
+Some macros can be used with any kind of declaration. These include:
+`DECL_NAME'
+ This macro returns an `IDENTIFIER_NODE' giving the name of the
+ entity.
+
+`TREE_TYPE'
+ This macro returns the type of the entity declared.
+
+`TREE_FILENAME'
+ This macro returns the name of the file in which the entity was
+ declared, as a `char*'. For an entity declared implicitly by the
+ compiler (like `__builtin_memcpy'), this will be the string
+ `"<internal>"'.
+
+`TREE_LINENO'
+ This macro returns the line number at which the entity was
+ declared, as an `int'.
+
+`DECL_ARTIFICIAL'
+ This predicate holds if the declaration was implicitly generated
+ by the compiler. For example, this predicate will hold of an
+ implicitly declared member function, or of the `TYPE_DECL'
+ implicitly generated for a class type. Recall that in C++ code
+ like:
+ struct S {};
+ is roughly equivalent to C code like:
+ struct S {};
+ typedef struct S S;
+ The implicitly generated `typedef' declaration is represented by a
+ `TYPE_DECL' for which `DECL_ARTIFICIAL' holds.
+
+`DECL_NAMESPACE_SCOPE_P'
+ This predicate holds if the entity was declared at a namespace
+ scope.
+
+`DECL_CLASS_SCOPE_P'
+ This predicate holds if the entity was declared at a class scope.
+
+`DECL_FUNCTION_SCOPE_P'
+ This predicate holds if the entity was declared inside a function
+ body.
+
+
+ The various kinds of declarations include:
+`LABEL_DECL'
+ These nodes are used to represent labels in function bodies. For
+ more information, see *Note Functions::. These nodes only appear
+ in block scopes.
+
+`CONST_DECL'
+ These nodes are used to represent enumeration constants. The
+ value of the constant is given by `DECL_INITIAL' which will be an
+ `INTEGER_CST' with the same type as the `TREE_TYPE' of the
+ `CONST_DECL', i.e., an `ENUMERAL_TYPE'.
+
+`RESULT_DECL'
+ These nodes represent the value returned by a function. When a
+ value is assigned to a `RESULT_DECL', that indicates that the
+ value should be returned, via bitwise copy, by the function. You
+ can use `DECL_SIZE' and `DECL_ALIGN' on a `RESULT_DECL', just as
+ with a `VAR_DECL'.
+
+`TYPE_DECL'
+ These nodes represent `typedef' declarations. The `TREE_TYPE' is
+ the type declared to have the name given by `DECL_NAME'. In some
+ cases, there is no associated name.
+
+`VAR_DECL'
+ These nodes represent variables with namespace or block scope, as
+ well as static data members. The `DECL_SIZE' and `DECL_ALIGN' are
+ analogous to `TYPE_SIZE' and `TYPE_ALIGN'. For a declaration, you
+ should always use the `DECL_SIZE' and `DECL_ALIGN' rather than the
+ `TYPE_SIZE' and `TYPE_ALIGN' given by the `TREE_TYPE', since
+ special attributes may have been applied to the variable to give
+ it a particular size and alignment. You may use the predicates
+ `DECL_THIS_STATIC' or `DECL_THIS_EXTERN' to test whether the
+ storage class specifiers `static' or `extern' were used to declare
+ a variable.
+
+ If this variable is initialized (but does not require a
+ constructor), the `DECL_INITIAL' will be an expression for the
+ initializer. The initializer should be evaluated, and a bitwise
+ copy into the variable performed. If the `DECL_INITIAL' is the
+ `error_mark_node', there is an initializer, but it is given by an
+ explicit statement later in the code; no bitwise copy is required.
+
+ GCC provides an extension that allows either automatic variables,
+ or global variables, to be placed in particular registers. This
+ extension is being used for a particular `VAR_DECL' if
+ `DECL_REGISTER' holds for the `VAR_DECL', and if
+ `DECL_ASSEMBLER_NAME' is not equal to `DECL_NAME'. In that case,
+ `DECL_ASSEMBLER_NAME' is the name of the register into which the
+ variable will be placed.
+
+`PARM_DECL'
+ Used to represent a parameter to a function. Treat these nodes
+ similarly to `VAR_DECL' nodes. These nodes only appear in the
+ `DECL_ARGUMENTS' for a `FUNCTION_DECL'.
+
+ The `DECL_ARG_TYPE' for a `PARM_DECL' is the type that will
+ actually be used when a value is passed to this function. It may
+ be a wider type than the `TREE_TYPE' of the parameter; for
+ example, the ordinary type might be `short' while the
+ `DECL_ARG_TYPE' is `int'.
+
+`FIELD_DECL'
+ These nodes represent non-static data members. The `DECL_SIZE' and
+ `DECL_ALIGN' behave as for `VAR_DECL' nodes. The position of the
+ field within the parent record is specified by a combination of
+ three attributes. `DECL_FIELD_OFFSET' is the position, counting
+ in bytes, of the `DECL_OFFSET_ALIGN'-bit sized word containing the
+ bit of the field closest to the beginning of the structure.
+ `DECL_FIELD_BIT_OFFSET' is the bit offset of the first bit of the
+ field within this word; this may be nonzero even for fields that
+ are not bit-fields, since `DECL_OFFSET_ALIGN' may be greater than
+ the natural alignment of the field's type.
+
+ If `DECL_C_BIT_FIELD' holds, this field is a bit-field. In a
+ bit-field, `DECL_BIT_FIELD_TYPE' also contains the type that was
+ originally specified for it, while DECL_TYPE may be a modified
+ type with lesser precision, according to the size of the bit field.
+
+`NAMESPACE_DECL'
+ *Note Namespaces::.
+
+`TEMPLATE_DECL'
+ These nodes are used to represent class, function, and variable
+ (static data member) templates. The
+ `DECL_TEMPLATE_SPECIALIZATIONS' are a `TREE_LIST'. The
+ `TREE_VALUE' of each node in the list is a `TEMPLATE_DECL's or
+ `FUNCTION_DECL's representing specializations (including
+ instantiations) of this template. Back ends can safely ignore
+ `TEMPLATE_DECL's, but should examine `FUNCTION_DECL' nodes on the
+ specializations list just as they would ordinary `FUNCTION_DECL'
+ nodes.
+
+ For a class template, the `DECL_TEMPLATE_INSTANTIATIONS' list
+ contains the instantiations. The `TREE_VALUE' of each node is an
+ instantiation of the class. The `DECL_TEMPLATE_SPECIALIZATIONS'
+ contains partial specializations of the class.
+
+`USING_DECL'
+ Back ends can safely ignore these nodes.
+
+
+
+File: gccint.info, Node: Internal structure, Prev: Working with declarations, Up: Declarations
+
+9.5.2 Internal structure
+------------------------
+
+`DECL' nodes are represented internally as a hierarchy of structures.
+
+* Menu:
+
+* Current structure hierarchy:: The current DECL node structure
+hierarchy.
+* Adding new DECL node types:: How to add a new DECL node to a
+frontend.
+
+
+File: gccint.info, Node: Current structure hierarchy, Next: Adding new DECL node types, Up: Internal structure
+
+9.5.2.1 Current structure hierarchy
+...................................
+
+`struct tree_decl_minimal'
+ This is the minimal structure to inherit from in order for common
+ `DECL' macros to work. The fields it contains are a unique ID,
+ source location, context, and name.
+
+`struct tree_decl_common'
+ This structure inherits from `struct tree_decl_minimal'. It
+ contains fields that most `DECL' nodes need, such as a field to
+ store alignment, machine mode, size, and attributes.
+
+`struct tree_field_decl'
+ This structure inherits from `struct tree_decl_common'. It is
+ used to represent `FIELD_DECL'.
+
+`struct tree_label_decl'
+ This structure inherits from `struct tree_decl_common'. It is
+ used to represent `LABEL_DECL'.
+
+`struct tree_translation_unit_decl'
+ This structure inherits from `struct tree_decl_common'. It is
+ used to represent `TRANSLATION_UNIT_DECL'.
+
+`struct tree_decl_with_rtl'
+ This structure inherits from `struct tree_decl_common'. It
+ contains a field to store the low-level RTL associated with a
+ `DECL' node.
+
+`struct tree_result_decl'
+ This structure inherits from `struct tree_decl_with_rtl'. It is
+ used to represent `RESULT_DECL'.
+
+`struct tree_const_decl'
+ This structure inherits from `struct tree_decl_with_rtl'. It is
+ used to represent `CONST_DECL'.
+
+`struct tree_parm_decl'
+ This structure inherits from `struct tree_decl_with_rtl'. It is
+ used to represent `PARM_DECL'.
+
+`struct tree_decl_with_vis'
+ This structure inherits from `struct tree_decl_with_rtl'. It
+ contains fields necessary to store visibility information, as well
+ as a section name and assembler name.
+
+`struct tree_var_decl'
+ This structure inherits from `struct tree_decl_with_vis'. It is
+ used to represent `VAR_DECL'.
+
+`struct tree_function_decl'
+ This structure inherits from `struct tree_decl_with_vis'. It is
+ used to represent `FUNCTION_DECL'.
+
+
+
+File: gccint.info, Node: Adding new DECL node types, Prev: Current structure hierarchy, Up: Internal structure
+
+9.5.2.2 Adding new DECL node types
+..................................
+
+Adding a new `DECL' tree consists of the following steps
+
+Add a new tree code for the `DECL' node
+ For language specific `DECL' nodes, there is a `.def' file in each
+ frontend directory where the tree code should be added. For
+ `DECL' nodes that are part of the middle-end, the code should be
+ added to `tree.def'.
+
+Create a new structure type for the `DECL' node
+ These structures should inherit from one of the existing
+ structures in the language hierarchy by using that structure as
+ the first member.
+
+ struct tree_foo_decl
+ {
+ struct tree_decl_with_vis common;
+ }
+
+ Would create a structure name `tree_foo_decl' that inherits from
+ `struct tree_decl_with_vis'.
+
+ For language specific `DECL' nodes, this new structure type should
+ go in the appropriate `.h' file. For `DECL' nodes that are part
+ of the middle-end, the structure type should go in `tree.h'.
+
+Add a member to the tree structure enumerator for the node
+ For garbage collection and dynamic checking purposes, each `DECL'
+ node structure type is required to have a unique enumerator value
+ specified with it. For language specific `DECL' nodes, this new
+ enumerator value should go in the appropriate `.def' file. For
+ `DECL' nodes that are part of the middle-end, the enumerator
+ values are specified in `treestruct.def'.
+
+Update `union tree_node'
+ In order to make your new structure type usable, it must be added
+ to `union tree_node'. For language specific `DECL' nodes, a new
+ entry should be added to the appropriate `.h' file of the form
+ struct tree_foo_decl GTY ((tag ("TS_VAR_DECL"))) foo_decl;
+ For `DECL' nodes that are part of the middle-end, the additional
+ member goes directly into `union tree_node' in `tree.h'.
+
+Update dynamic checking info
+ In order to be able to check whether accessing a named portion of
+ `union tree_node' is legal, and whether a certain `DECL' node
+ contains one of the enumerated `DECL' node structures in the
+ hierarchy, a simple lookup table is used. This lookup table needs
+ to be kept up to date with the tree structure hierarchy, or else
+ checking and containment macros will fail inappropriately.
+
+ For language specific `DECL' nodes, their is an `init_ts' function
+ in an appropriate `.c' file, which initializes the lookup table.
+ Code setting up the table for new `DECL' nodes should be added
+ there. For each `DECL' tree code and enumerator value
+ representing a member of the inheritance hierarchy, the table
+ should contain 1 if that tree code inherits (directly or
+ indirectly) from that member. Thus, a `FOO_DECL' node derived
+ from `struct decl_with_rtl', and enumerator value `TS_FOO_DECL',
+ would be set up as follows
+ tree_contains_struct[FOO_DECL][TS_FOO_DECL] = 1;
+ tree_contains_struct[FOO_DECL][TS_DECL_WRTL] = 1;
+ tree_contains_struct[FOO_DECL][TS_DECL_COMMON] = 1;
+ tree_contains_struct[FOO_DECL][TS_DECL_MINIMAL] = 1;
+
+ For `DECL' nodes that are part of the middle-end, the setup code
+ goes into `tree.c'.
+
+Add macros to access any new fields and flags
+ Each added field or flag should have a macro that is used to access
+ it, that performs appropriate checking to ensure only the right
+ type of `DECL' nodes access the field.
+
+ These macros generally take the following form
+ #define FOO_DECL_FIELDNAME(NODE) FOO_DECL_CHECK(NODE)->foo_decl.fieldname
+ However, if the structure is simply a base class for further
+ structures, something like the following should be used
+ #define BASE_STRUCT_CHECK(T) CONTAINS_STRUCT_CHECK(T, TS_BASE_STRUCT)
+ #define BASE_STRUCT_FIELDNAME(NODE) \
+ (BASE_STRUCT_CHECK(NODE)->base_struct.fieldname
+
+
+
+File: gccint.info, Node: Functions, Next: Declarations, Prev: Scopes, Up: Trees
+
+9.6 Functions
+=============
+
+A function is represented by a `FUNCTION_DECL' node. A set of
+overloaded functions is sometimes represented by a `OVERLOAD' node.
+
+ An `OVERLOAD' node is not a declaration, so none of the `DECL_' macros
+should be used on an `OVERLOAD'. An `OVERLOAD' node is similar to a
+`TREE_LIST'. Use `OVL_CURRENT' to get the function associated with an
+`OVERLOAD' node; use `OVL_NEXT' to get the next `OVERLOAD' node in the
+list of overloaded functions. The macros `OVL_CURRENT' and `OVL_NEXT'
+are actually polymorphic; you can use them to work with `FUNCTION_DECL'
+nodes as well as with overloads. In the case of a `FUNCTION_DECL',
+`OVL_CURRENT' will always return the function itself, and `OVL_NEXT'
+will always be `NULL_TREE'.
+
+ To determine the scope of a function, you can use the `DECL_CONTEXT'
+macro. This macro will return the class (either a `RECORD_TYPE' or a
+`UNION_TYPE') or namespace (a `NAMESPACE_DECL') of which the function
+is a member. For a virtual function, this macro returns the class in
+which the function was actually defined, not the base class in which
+the virtual declaration occurred.
+
+ If a friend function is defined in a class scope, the
+`DECL_FRIEND_CONTEXT' macro can be used to determine the class in which
+it was defined. For example, in
+ class C { friend void f() {} };
+ the `DECL_CONTEXT' for `f' will be the `global_namespace', but the
+`DECL_FRIEND_CONTEXT' will be the `RECORD_TYPE' for `C'.
+
+ In C, the `DECL_CONTEXT' for a function maybe another function. This
+representation indicates that the GNU nested function extension is in
+use. For details on the semantics of nested functions, see the GCC
+Manual. The nested function can refer to local variables in its
+containing function. Such references are not explicitly marked in the
+tree structure; back ends must look at the `DECL_CONTEXT' for the
+referenced `VAR_DECL'. If the `DECL_CONTEXT' for the referenced
+`VAR_DECL' is not the same as the function currently being processed,
+and neither `DECL_EXTERNAL' nor `TREE_STATIC' hold, then the reference
+is to a local variable in a containing function, and the back end must
+take appropriate action.
+
+* Menu:
+
+* Function Basics:: Function names, linkage, and so forth.
+* Function Bodies:: The statements that make up a function body.
+
+
+File: gccint.info, Node: Function Basics, Next: Function Bodies, Up: Functions
+
+9.6.1 Function Basics
+---------------------
+
+The following macros and functions can be used on a `FUNCTION_DECL':
+`DECL_MAIN_P'
+ This predicate holds for a function that is the program entry point
+ `::code'.
+
+`DECL_NAME'
+ This macro returns the unqualified name of the function, as an
+ `IDENTIFIER_NODE'. For an instantiation of a function template,
+ the `DECL_NAME' is the unqualified name of the template, not
+ something like `f<int>'. The value of `DECL_NAME' is undefined
+ when used on a constructor, destructor, overloaded operator, or
+ type-conversion operator, or any function that is implicitly
+ generated by the compiler. See below for macros that can be used
+ to distinguish these cases.
+
+`DECL_ASSEMBLER_NAME'
+ This macro returns the mangled name of the function, also an
+ `IDENTIFIER_NODE'. This name does not contain leading underscores
+ on systems that prefix all identifiers with underscores. The
+ mangled name is computed in the same way on all platforms; if
+ special processing is required to deal with the object file format
+ used on a particular platform, it is the responsibility of the
+ back end to perform those modifications. (Of course, the back end
+ should not modify `DECL_ASSEMBLER_NAME' itself.)
+
+ Using `DECL_ASSEMBLER_NAME' will cause additional memory to be
+ allocated (for the mangled name of the entity) so it should be used
+ only when emitting assembly code. It should not be used within the
+ optimizers to determine whether or not two declarations are the
+ same, even though some of the existing optimizers do use it in
+ that way. These uses will be removed over time.
+
+`DECL_EXTERNAL'
+ This predicate holds if the function is undefined.
+
+`TREE_PUBLIC'
+ This predicate holds if the function has external linkage.
+
+`DECL_LOCAL_FUNCTION_P'
+ This predicate holds if the function was declared at block scope,
+ even though it has a global scope.
+
+`DECL_ANTICIPATED'
+ This predicate holds if the function is a built-in function but its
+ prototype is not yet explicitly declared.
+
+`DECL_EXTERN_C_FUNCTION_P'
+ This predicate holds if the function is declared as an ``extern
+ "C"'' function.
+
+`DECL_LINKONCE_P'
+ This macro holds if multiple copies of this function may be
+ emitted in various translation units. It is the responsibility of
+ the linker to merge the various copies. Template instantiations
+ are the most common example of functions for which
+ `DECL_LINKONCE_P' holds; G++ instantiates needed templates in all
+ translation units which require them, and then relies on the
+ linker to remove duplicate instantiations.
+
+ FIXME: This macro is not yet implemented.
+
+`DECL_FUNCTION_MEMBER_P'
+ This macro holds if the function is a member of a class, rather
+ than a member of a namespace.
+
+`DECL_STATIC_FUNCTION_P'
+ This predicate holds if the function a static member function.
+
+`DECL_NONSTATIC_MEMBER_FUNCTION_P'
+ This macro holds for a non-static member function.
+
+`DECL_CONST_MEMFUNC_P'
+ This predicate holds for a `const'-member function.
+
+`DECL_VOLATILE_MEMFUNC_P'
+ This predicate holds for a `volatile'-member function.
+
+`DECL_CONSTRUCTOR_P'
+ This macro holds if the function is a constructor.
+
+`DECL_NONCONVERTING_P'
+ This predicate holds if the constructor is a non-converting
+ constructor.
+
+`DECL_COMPLETE_CONSTRUCTOR_P'
+ This predicate holds for a function which is a constructor for an
+ object of a complete type.
+
+`DECL_BASE_CONSTRUCTOR_P'
+ This predicate holds for a function which is a constructor for a
+ base class sub-object.
+
+`DECL_COPY_CONSTRUCTOR_P'
+ This predicate holds for a function which is a copy-constructor.
+
+`DECL_DESTRUCTOR_P'
+ This macro holds if the function is a destructor.
+
+`DECL_COMPLETE_DESTRUCTOR_P'
+ This predicate holds if the function is the destructor for an
+ object a complete type.
+
+`DECL_OVERLOADED_OPERATOR_P'
+ This macro holds if the function is an overloaded operator.
+
+`DECL_CONV_FN_P'
+ This macro holds if the function is a type-conversion operator.
+
+`DECL_GLOBAL_CTOR_P'
+ This predicate holds if the function is a file-scope initialization
+ function.
+
+`DECL_GLOBAL_DTOR_P'
+ This predicate holds if the function is a file-scope finalization
+ function.
+
+`DECL_THUNK_P'
+ This predicate holds if the function is a thunk.
+
+ These functions represent stub code that adjusts the `this' pointer
+ and then jumps to another function. When the jumped-to function
+ returns, control is transferred directly to the caller, without
+ returning to the thunk. The first parameter to the thunk is
+ always the `this' pointer; the thunk should add `THUNK_DELTA' to
+ this value. (The `THUNK_DELTA' is an `int', not an `INTEGER_CST'.)
+
+ Then, if `THUNK_VCALL_OFFSET' (an `INTEGER_CST') is nonzero the
+ adjusted `this' pointer must be adjusted again. The complete
+ calculation is given by the following pseudo-code:
+
+ this += THUNK_DELTA
+ if (THUNK_VCALL_OFFSET)
+ this += (*((ptrdiff_t **) this))[THUNK_VCALL_OFFSET]
+
+ Finally, the thunk should jump to the location given by
+ `DECL_INITIAL'; this will always be an expression for the address
+ of a function.
+
+`DECL_NON_THUNK_FUNCTION_P'
+ This predicate holds if the function is _not_ a thunk function.
+
+`GLOBAL_INIT_PRIORITY'
+ If either `DECL_GLOBAL_CTOR_P' or `DECL_GLOBAL_DTOR_P' holds, then
+ this gives the initialization priority for the function. The
+ linker will arrange that all functions for which
+ `DECL_GLOBAL_CTOR_P' holds are run in increasing order of priority
+ before `main' is called. When the program exits, all functions for
+ which `DECL_GLOBAL_DTOR_P' holds are run in the reverse order.
+
+`DECL_ARTIFICIAL'
+ This macro holds if the function was implicitly generated by the
+ compiler, rather than explicitly declared. In addition to
+ implicitly generated class member functions, this macro holds for
+ the special functions created to implement static initialization
+ and destruction, to compute run-time type information, and so
+ forth.
+
+`DECL_ARGUMENTS'
+ This macro returns the `PARM_DECL' for the first argument to the
+ function. Subsequent `PARM_DECL' nodes can be obtained by
+ following the `TREE_CHAIN' links.
+
+`DECL_RESULT'
+ This macro returns the `RESULT_DECL' for the function.
+
+`TREE_TYPE'
+ This macro returns the `FUNCTION_TYPE' or `METHOD_TYPE' for the
+ function.
+
+`TYPE_RAISES_EXCEPTIONS'
+ This macro returns the list of exceptions that a (member-)function
+ can raise. The returned list, if non `NULL', is comprised of nodes
+ whose `TREE_VALUE' represents a type.
+
+`TYPE_NOTHROW_P'
+ This predicate holds when the exception-specification of its
+ arguments is of the form ``()''.
+
+`DECL_ARRAY_DELETE_OPERATOR_P'
+ This predicate holds if the function an overloaded `operator
+ delete[]'.
+
+`DECL_FUNCTION_SPECIFIC_TARGET'
+ This macro returns a tree node that holds the target options that
+ are to be used to compile this particular function or `NULL_TREE'
+ if the function is to be compiled with the target options
+ specified on the command line.
+
+`DECL_FUNCTION_SPECIFIC_OPTIMIZATION'
+ This macro returns a tree node that holds the optimization options
+ that are to be used to compile this particular function or
+ `NULL_TREE' if the function is to be compiled with the
+ optimization options specified on the command line.
+
+
+File: gccint.info, Node: Function Bodies, Prev: Function Basics, Up: Functions
+
+9.6.2 Function Bodies
+---------------------
+
+A function that has a definition in the current translation unit will
+have a non-`NULL' `DECL_INITIAL'. However, back ends should not make
+use of the particular value given by `DECL_INITIAL'.
+
+ The `DECL_SAVED_TREE' macro will give the complete body of the
+function.
+
+9.6.2.1 Statements
+..................
+
+There are tree nodes corresponding to all of the source-level statement
+constructs, used within the C and C++ frontends. These are enumerated
+here, together with a list of the various macros that can be used to
+obtain information about them. There are a few macros that can be used
+with all statements:
+
+`STMT_IS_FULL_EXPR_P'
+ In C++, statements normally constitute "full expressions";
+ temporaries created during a statement are destroyed when the
+ statement is complete. However, G++ sometimes represents
+ expressions by statements; these statements will not have
+ `STMT_IS_FULL_EXPR_P' set. Temporaries created during such
+ statements should be destroyed when the innermost enclosing
+ statement with `STMT_IS_FULL_EXPR_P' set is exited.
+
+
+ Here is the list of the various statement nodes, and the macros used to
+access them. This documentation describes the use of these nodes in
+non-template functions (including instantiations of template functions).
+In template functions, the same nodes are used, but sometimes in
+slightly different ways.
+
+ Many of the statements have substatements. For example, a `while'
+loop will have a body, which is itself a statement. If the substatement
+is `NULL_TREE', it is considered equivalent to a statement consisting
+of a single `;', i.e., an expression statement in which the expression
+has been omitted. A substatement may in fact be a list of statements,
+connected via their `TREE_CHAIN's. So, you should always process the
+statement tree by looping over substatements, like this:
+ void process_stmt (stmt)
+ tree stmt;
+ {
+ while (stmt)
+ {
+ switch (TREE_CODE (stmt))
+ {
+ case IF_STMT:
+ process_stmt (THEN_CLAUSE (stmt));
+ /* More processing here. */
+ break;
+
+ ...
+ }
+
+ stmt = TREE_CHAIN (stmt);
+ }
+ }
+ In other words, while the `then' clause of an `if' statement in C++
+can be only one statement (although that one statement may be a
+compound statement), the intermediate representation will sometimes use
+several statements chained together.
+
+`ASM_EXPR'
+ Used to represent an inline assembly statement. For an inline
+ assembly statement like:
+ asm ("mov x, y");
+ The `ASM_STRING' macro will return a `STRING_CST' node for `"mov
+ x, y"'. If the original statement made use of the
+ extended-assembly syntax, then `ASM_OUTPUTS', `ASM_INPUTS', and
+ `ASM_CLOBBERS' will be the outputs, inputs, and clobbers for the
+ statement, represented as `STRING_CST' nodes. The
+ extended-assembly syntax looks like:
+ asm ("fsinx %1,%0" : "=f" (result) : "f" (angle));
+ The first string is the `ASM_STRING', containing the instruction
+ template. The next two strings are the output and inputs,
+ respectively; this statement has no clobbers. As this example
+ indicates, "plain" assembly statements are merely a special case
+ of extended assembly statements; they have no cv-qualifiers,
+ outputs, inputs, or clobbers. All of the strings will be
+ `NUL'-terminated, and will contain no embedded `NUL'-characters.
+
+ If the assembly statement is declared `volatile', or if the
+ statement was not an extended assembly statement, and is therefore
+ implicitly volatile, then the predicate `ASM_VOLATILE_P' will hold
+ of the `ASM_EXPR'.
+
+`BREAK_STMT'
+ Used to represent a `break' statement. There are no additional
+ fields.
+
+`CASE_LABEL_EXPR'
+ Use to represent a `case' label, range of `case' labels, or a
+ `default' label. If `CASE_LOW' is `NULL_TREE', then this is a
+ `default' label. Otherwise, if `CASE_HIGH' is `NULL_TREE', then
+ this is an ordinary `case' label. In this case, `CASE_LOW' is an
+ expression giving the value of the label. Both `CASE_LOW' and
+ `CASE_HIGH' are `INTEGER_CST' nodes. These values will have the
+ same type as the condition expression in the switch statement.
+
+ Otherwise, if both `CASE_LOW' and `CASE_HIGH' are defined, the
+ statement is a range of case labels. Such statements originate
+ with the extension that allows users to write things of the form:
+ case 2 ... 5:
+ The first value will be `CASE_LOW', while the second will be
+ `CASE_HIGH'.
+
+`CLEANUP_STMT'
+ Used to represent an action that should take place upon exit from
+ the enclosing scope. Typically, these actions are calls to
+ destructors for local objects, but back ends cannot rely on this
+ fact. If these nodes are in fact representing such destructors,
+ `CLEANUP_DECL' will be the `VAR_DECL' destroyed. Otherwise,
+ `CLEANUP_DECL' will be `NULL_TREE'. In any case, the
+ `CLEANUP_EXPR' is the expression to execute. The cleanups
+ executed on exit from a scope should be run in the reverse order
+ of the order in which the associated `CLEANUP_STMT's were
+ encountered.
+
+`CONTINUE_STMT'
+ Used to represent a `continue' statement. There are no additional
+ fields.
+
+`CTOR_STMT'
+ Used to mark the beginning (if `CTOR_BEGIN_P' holds) or end (if
+ `CTOR_END_P' holds of the main body of a constructor. See also
+ `SUBOBJECT' for more information on how to use these nodes.
+
+`DECL_STMT'
+ Used to represent a local declaration. The `DECL_STMT_DECL' macro
+ can be used to obtain the entity declared. This declaration may
+ be a `LABEL_DECL', indicating that the label declared is a local
+ label. (As an extension, GCC allows the declaration of labels
+ with scope.) In C, this declaration may be a `FUNCTION_DECL',
+ indicating the use of the GCC nested function extension. For more
+ information, *note Functions::.
+
+`DO_STMT'
+ Used to represent a `do' loop. The body of the loop is given by
+ `DO_BODY' while the termination condition for the loop is given by
+ `DO_COND'. The condition for a `do'-statement is always an
+ expression.
+
+`EMPTY_CLASS_EXPR'
+ Used to represent a temporary object of a class with no data whose
+ address is never taken. (All such objects are interchangeable.)
+ The `TREE_TYPE' represents the type of the object.
+
+`EXPR_STMT'
+ Used to represent an expression statement. Use `EXPR_STMT_EXPR' to
+ obtain the expression.
+
+`FOR_STMT'
+ Used to represent a `for' statement. The `FOR_INIT_STMT' is the
+ initialization statement for the loop. The `FOR_COND' is the
+ termination condition. The `FOR_EXPR' is the expression executed
+ right before the `FOR_COND' on each loop iteration; often, this
+ expression increments a counter. The body of the loop is given by
+ `FOR_BODY'. Note that `FOR_INIT_STMT' and `FOR_BODY' return
+ statements, while `FOR_COND' and `FOR_EXPR' return expressions.
+
+`GOTO_EXPR'
+ Used to represent a `goto' statement. The `GOTO_DESTINATION' will
+ usually be a `LABEL_DECL'. However, if the "computed goto"
+ extension has been used, the `GOTO_DESTINATION' will be an
+ arbitrary expression indicating the destination. This expression
+ will always have pointer type.
+
+`HANDLER'
+ Used to represent a C++ `catch' block. The `HANDLER_TYPE' is the
+ type of exception that will be caught by this handler; it is equal
+ (by pointer equality) to `NULL' if this handler is for all types.
+ `HANDLER_PARMS' is the `DECL_STMT' for the catch parameter, and
+ `HANDLER_BODY' is the code for the block itself.
+
+`IF_STMT'
+ Used to represent an `if' statement. The `IF_COND' is the
+ expression.
+
+ If the condition is a `TREE_LIST', then the `TREE_PURPOSE' is a
+ statement (usually a `DECL_STMT'). Each time the condition is
+ evaluated, the statement should be executed. Then, the
+ `TREE_VALUE' should be used as the conditional expression itself.
+ This representation is used to handle C++ code like this:
+
+ if (int i = 7) ...
+
+ where there is a new local variable (or variables) declared within
+ the condition.
+
+ The `THEN_CLAUSE' represents the statement given by the `then'
+ condition, while the `ELSE_CLAUSE' represents the statement given
+ by the `else' condition.
+
+`LABEL_EXPR'
+ Used to represent a label. The `LABEL_DECL' declared by this
+ statement can be obtained with the `LABEL_EXPR_LABEL' macro. The
+ `IDENTIFIER_NODE' giving the name of the label can be obtained from
+ the `LABEL_DECL' with `DECL_NAME'.
+
+`RETURN_STMT'
+ Used to represent a `return' statement. The `RETURN_EXPR' is the
+ expression returned; it will be `NULL_TREE' if the statement was
+ just
+ return;
+
+`SUBOBJECT'
+ In a constructor, these nodes are used to mark the point at which a
+ subobject of `this' is fully constructed. If, after this point, an
+ exception is thrown before a `CTOR_STMT' with `CTOR_END_P' set is
+ encountered, the `SUBOBJECT_CLEANUP' must be executed. The
+ cleanups must be executed in the reverse order in which they
+ appear.
+
+`SWITCH_STMT'
+ Used to represent a `switch' statement. The `SWITCH_STMT_COND' is
+ the expression on which the switch is occurring. See the
+ documentation for an `IF_STMT' for more information on the
+ representation used for the condition. The `SWITCH_STMT_BODY' is
+ the body of the switch statement. The `SWITCH_STMT_TYPE' is the
+ original type of switch expression as given in the source, before
+ any compiler conversions.
+
+`TRY_BLOCK'
+ Used to represent a `try' block. The body of the try block is
+ given by `TRY_STMTS'. Each of the catch blocks is a `HANDLER'
+ node. The first handler is given by `TRY_HANDLERS'. Subsequent
+ handlers are obtained by following the `TREE_CHAIN' link from one
+ handler to the next. The body of the handler is given by
+ `HANDLER_BODY'.
+
+ If `CLEANUP_P' holds of the `TRY_BLOCK', then the `TRY_HANDLERS'
+ will not be a `HANDLER' node. Instead, it will be an expression
+ that should be executed if an exception is thrown in the try
+ block. It must rethrow the exception after executing that code.
+ And, if an exception is thrown while the expression is executing,
+ `terminate' must be called.
+
+`USING_STMT'
+ Used to represent a `using' directive. The namespace is given by
+ `USING_STMT_NAMESPACE', which will be a NAMESPACE_DECL. This node
+ is needed inside template functions, to implement using directives
+ during instantiation.
+
+`WHILE_STMT'
+ Used to represent a `while' loop. The `WHILE_COND' is the
+ termination condition for the loop. See the documentation for an
+ `IF_STMT' for more information on the representation used for the
+ condition.
+
+ The `WHILE_BODY' is the body of the loop.
+
+
+
+File: gccint.info, Node: Attributes, Next: Expression trees, Prev: Declarations, Up: Trees
+
+9.7 Attributes in trees
+=======================
+
+Attributes, as specified using the `__attribute__' keyword, are
+represented internally as a `TREE_LIST'. The `TREE_PURPOSE' is the
+name of the attribute, as an `IDENTIFIER_NODE'. The `TREE_VALUE' is a
+`TREE_LIST' of the arguments of the attribute, if any, or `NULL_TREE'
+if there are no arguments; the arguments are stored as the `TREE_VALUE'
+of successive entries in the list, and may be identifiers or
+expressions. The `TREE_CHAIN' of the attribute is the next attribute
+in a list of attributes applying to the same declaration or type, or
+`NULL_TREE' if there are no further attributes in the list.
+
+ Attributes may be attached to declarations and to types; these
+attributes may be accessed with the following macros. All attributes
+are stored in this way, and many also cause other changes to the
+declaration or type or to other internal compiler data structures.
+
+ -- Tree Macro: tree DECL_ATTRIBUTES (tree DECL)
+ This macro returns the attributes on the declaration DECL.
+
+ -- Tree Macro: tree TYPE_ATTRIBUTES (tree TYPE)
+ This macro returns the attributes on the type TYPE.
+
+
+File: gccint.info, Node: Expression trees, Prev: Attributes, Up: Trees
+
+9.8 Expressions
+===============
+
+The internal representation for expressions is for the most part quite
+straightforward. However, there are a few facts that one must bear in
+mind. In particular, the expression "tree" is actually a directed
+acyclic graph. (For example there may be many references to the integer
+constant zero throughout the source program; many of these will be
+represented by the same expression node.) You should not rely on
+certain kinds of node being shared, nor should you rely on certain
+kinds of nodes being unshared.
+
+ The following macros can be used with all expression nodes:
+
+`TREE_TYPE'
+ Returns the type of the expression. This value may not be
+ precisely the same type that would be given the expression in the
+ original program.
+
+ In what follows, some nodes that one might expect to always have type
+`bool' are documented to have either integral or boolean type. At some
+point in the future, the C front end may also make use of this same
+intermediate representation, and at this point these nodes will
+certainly have integral type. The previous sentence is not meant to
+imply that the C++ front end does not or will not give these nodes
+integral type.
+
+ Below, we list the various kinds of expression nodes. Except where
+noted otherwise, the operands to an expression are accessed using the
+`TREE_OPERAND' macro. For example, to access the first operand to a
+binary plus expression `expr', use:
+
+ TREE_OPERAND (expr, 0)
+ As this example indicates, the operands are zero-indexed.
+
+ All the expressions starting with `OMP_' represent directives and
+clauses used by the OpenMP API `http://www.openmp.org/'.
+
+ The table below begins with constants, moves on to unary expressions,
+then proceeds to binary expressions, and concludes with various other
+kinds of expressions:
+
+`INTEGER_CST'
+ These nodes represent integer constants. Note that the type of
+ these constants is obtained with `TREE_TYPE'; they are not always
+ of type `int'. In particular, `char' constants are represented
+ with `INTEGER_CST' nodes. The value of the integer constant `e' is
+ given by
+ ((TREE_INT_CST_HIGH (e) << HOST_BITS_PER_WIDE_INT)
+ + TREE_INST_CST_LOW (e))
+ HOST_BITS_PER_WIDE_INT is at least thirty-two on all platforms.
+ Both `TREE_INT_CST_HIGH' and `TREE_INT_CST_LOW' return a
+ `HOST_WIDE_INT'. The value of an `INTEGER_CST' is interpreted as
+ a signed or unsigned quantity depending on the type of the
+ constant. In general, the expression given above will overflow,
+ so it should not be used to calculate the value of the constant.
+
+ The variable `integer_zero_node' is an integer constant with value
+ zero. Similarly, `integer_one_node' is an integer constant with
+ value one. The `size_zero_node' and `size_one_node' variables are
+ analogous, but have type `size_t' rather than `int'.
+
+ The function `tree_int_cst_lt' is a predicate which holds if its
+ first argument is less than its second. Both constants are
+ assumed to have the same signedness (i.e., either both should be
+ signed or both should be unsigned.) The full width of the
+ constant is used when doing the comparison; the usual rules about
+ promotions and conversions are ignored. Similarly,
+ `tree_int_cst_equal' holds if the two constants are equal. The
+ `tree_int_cst_sgn' function returns the sign of a constant. The
+ value is `1', `0', or `-1' according on whether the constant is
+ greater than, equal to, or less than zero. Again, the signedness
+ of the constant's type is taken into account; an unsigned constant
+ is never less than zero, no matter what its bit-pattern.
+
+`REAL_CST'
+ FIXME: Talk about how to obtain representations of this constant,
+ do comparisons, and so forth.
+
+`FIXED_CST'
+ These nodes represent fixed-point constants. The type of these
+ constants is obtained with `TREE_TYPE'. `TREE_FIXED_CST_PTR'
+ points to to struct fixed_value; `TREE_FIXED_CST' returns the
+ structure itself. Struct fixed_value contains `data' with the
+ size of two HOST_BITS_PER_WIDE_INT and `mode' as the associated
+ fixed-point machine mode for `data'.
+
+`COMPLEX_CST'
+ These nodes are used to represent complex number constants, that
+ is a `__complex__' whose parts are constant nodes. The
+ `TREE_REALPART' and `TREE_IMAGPART' return the real and the
+ imaginary parts respectively.
+
+`VECTOR_CST'
+ These nodes are used to represent vector constants, whose parts are
+ constant nodes. Each individual constant node is either an
+ integer or a double constant node. The first operand is a
+ `TREE_LIST' of the constant nodes and is accessed through
+ `TREE_VECTOR_CST_ELTS'.
+
+`STRING_CST'
+ These nodes represent string-constants. The `TREE_STRING_LENGTH'
+ returns the length of the string, as an `int'. The
+ `TREE_STRING_POINTER' is a `char*' containing the string itself.
+ The string may not be `NUL'-terminated, and it may contain
+ embedded `NUL' characters. Therefore, the `TREE_STRING_LENGTH'
+ includes the trailing `NUL' if it is present.
+
+ For wide string constants, the `TREE_STRING_LENGTH' is the number
+ of bytes in the string, and the `TREE_STRING_POINTER' points to an
+ array of the bytes of the string, as represented on the target
+ system (that is, as integers in the target endianness). Wide and
+ non-wide string constants are distinguished only by the `TREE_TYPE'
+ of the `STRING_CST'.
+
+ FIXME: The formats of string constants are not well-defined when
+ the target system bytes are not the same width as host system
+ bytes.
+
+`PTRMEM_CST'
+ These nodes are used to represent pointer-to-member constants. The
+ `PTRMEM_CST_CLASS' is the class type (either a `RECORD_TYPE' or
+ `UNION_TYPE' within which the pointer points), and the
+ `PTRMEM_CST_MEMBER' is the declaration for the pointed to object.
+ Note that the `DECL_CONTEXT' for the `PTRMEM_CST_MEMBER' is in
+ general different from the `PTRMEM_CST_CLASS'. For example, given:
+ struct B { int i; };
+ struct D : public B {};
+ int D::*dp = &D::i;
+ The `PTRMEM_CST_CLASS' for `&D::i' is `D', even though the
+ `DECL_CONTEXT' for the `PTRMEM_CST_MEMBER' is `B', since `B::i' is
+ a member of `B', not `D'.
+
+`VAR_DECL'
+ These nodes represent variables, including static data members.
+ For more information, *note Declarations::.
+
+`NEGATE_EXPR'
+ These nodes represent unary negation of the single operand, for
+ both integer and floating-point types. The type of negation can be
+ determined by looking at the type of the expression.
+
+ The behavior of this operation on signed arithmetic overflow is
+ controlled by the `flag_wrapv' and `flag_trapv' variables.
+
+`ABS_EXPR'
+ These nodes represent the absolute value of the single operand, for
+ both integer and floating-point types. This is typically used to
+ implement the `abs', `labs' and `llabs' builtins for integer
+ types, and the `fabs', `fabsf' and `fabsl' builtins for floating
+ point types. The type of abs operation can be determined by
+ looking at the type of the expression.
+
+ This node is not used for complex types. To represent the modulus
+ or complex abs of a complex value, use the `BUILT_IN_CABS',
+ `BUILT_IN_CABSF' or `BUILT_IN_CABSL' builtins, as used to
+ implement the C99 `cabs', `cabsf' and `cabsl' built-in functions.
+
+`BIT_NOT_EXPR'
+ These nodes represent bitwise complement, and will always have
+ integral type. The only operand is the value to be complemented.
+
+`TRUTH_NOT_EXPR'
+ These nodes represent logical negation, and will always have
+ integral (or boolean) type. The operand is the value being
+ negated. The type of the operand and that of the result are
+ always of `BOOLEAN_TYPE' or `INTEGER_TYPE'.
+
+`PREDECREMENT_EXPR'
+`PREINCREMENT_EXPR'
+`POSTDECREMENT_EXPR'
+`POSTINCREMENT_EXPR'
+ These nodes represent increment and decrement expressions. The
+ value of the single operand is computed, and the operand
+ incremented or decremented. In the case of `PREDECREMENT_EXPR' and
+ `PREINCREMENT_EXPR', the value of the expression is the value
+ resulting after the increment or decrement; in the case of
+ `POSTDECREMENT_EXPR' and `POSTINCREMENT_EXPR' is the value before
+ the increment or decrement occurs. The type of the operand, like
+ that of the result, will be either integral, boolean, or
+ floating-point.
+
+`ADDR_EXPR'
+ These nodes are used to represent the address of an object. (These
+ expressions will always have pointer or reference type.) The
+ operand may be another expression, or it may be a declaration.
+
+ As an extension, GCC allows users to take the address of a label.
+ In this case, the operand of the `ADDR_EXPR' will be a
+ `LABEL_DECL'. The type of such an expression is `void*'.
+
+ If the object addressed is not an lvalue, a temporary is created,
+ and the address of the temporary is used.
+
+`INDIRECT_REF'
+ These nodes are used to represent the object pointed to by a
+ pointer. The operand is the pointer being dereferenced; it will
+ always have pointer or reference type.
+
+`FIX_TRUNC_EXPR'
+ These nodes represent conversion of a floating-point value to an
+ integer. The single operand will have a floating-point type, while
+ the complete expression will have an integral (or boolean) type.
+ The operand is rounded towards zero.
+
+`FLOAT_EXPR'
+ These nodes represent conversion of an integral (or boolean) value
+ to a floating-point value. The single operand will have integral
+ type, while the complete expression will have a floating-point
+ type.
+
+ FIXME: How is the operand supposed to be rounded? Is this
+ dependent on `-mieee'?
+
+`COMPLEX_EXPR'
+ These nodes are used to represent complex numbers constructed from
+ two expressions of the same (integer or real) type. The first
+ operand is the real part and the second operand is the imaginary
+ part.
+
+`CONJ_EXPR'
+ These nodes represent the conjugate of their operand.
+
+`REALPART_EXPR'
+`IMAGPART_EXPR'
+ These nodes represent respectively the real and the imaginary parts
+ of complex numbers (their sole argument).
+
+`NON_LVALUE_EXPR'
+ These nodes indicate that their one and only operand is not an
+ lvalue. A back end can treat these identically to the single
+ operand.
+
+`NOP_EXPR'
+ These nodes are used to represent conversions that do not require
+ any code-generation. For example, conversion of a `char*' to an
+ `int*' does not require any code be generated; such a conversion is
+ represented by a `NOP_EXPR'. The single operand is the expression
+ to be converted. The conversion from a pointer to a reference is
+ also represented with a `NOP_EXPR'.
+
+`CONVERT_EXPR'
+ These nodes are similar to `NOP_EXPR's, but are used in those
+ situations where code may need to be generated. For example, if an
+ `int*' is converted to an `int' code may need to be generated on
+ some platforms. These nodes are never used for C++-specific
+ conversions, like conversions between pointers to different
+ classes in an inheritance hierarchy. Any adjustments that need to
+ be made in such cases are always indicated explicitly. Similarly,
+ a user-defined conversion is never represented by a
+ `CONVERT_EXPR'; instead, the function calls are made explicit.
+
+`FIXED_CONVERT_EXPR'
+ These nodes are used to represent conversions that involve
+ fixed-point values. For example, from a fixed-point value to
+ another fixed-point value, from an integer to a fixed-point value,
+ from a fixed-point value to an integer, from a floating-point
+ value to a fixed-point value, or from a fixed-point value to a
+ floating-point value.
+
+`THROW_EXPR'
+ These nodes represent `throw' expressions. The single operand is
+ an expression for the code that should be executed to throw the
+ exception. However, there is one implicit action not represented
+ in that expression; namely the call to `__throw'. This function
+ takes no arguments. If `setjmp'/`longjmp' exceptions are used, the
+ function `__sjthrow' is called instead. The normal GCC back end
+ uses the function `emit_throw' to generate this code; you can
+ examine this function to see what needs to be done.
+
+`LSHIFT_EXPR'
+`RSHIFT_EXPR'
+ These nodes represent left and right shifts, respectively. The
+ first operand is the value to shift; it will always be of integral
+ type. The second operand is an expression for the number of bits
+ by which to shift. Right shift should be treated as arithmetic,
+ i.e., the high-order bits should be zero-filled when the
+ expression has unsigned type and filled with the sign bit when the
+ expression has signed type. Note that the result is undefined if
+ the second operand is larger than or equal to the first operand's
+ type size.
+
+`BIT_IOR_EXPR'
+`BIT_XOR_EXPR'
+`BIT_AND_EXPR'
+ These nodes represent bitwise inclusive or, bitwise exclusive or,
+ and bitwise and, respectively. Both operands will always have
+ integral type.
+
+`TRUTH_ANDIF_EXPR'
+`TRUTH_ORIF_EXPR'
+ These nodes represent logical "and" and logical "or", respectively.
+ These operators are not strict; i.e., the second operand is
+ evaluated only if the value of the expression is not determined by
+ evaluation of the first operand. The type of the operands and
+ that of the result are always of `BOOLEAN_TYPE' or `INTEGER_TYPE'.
+
+`TRUTH_AND_EXPR'
+`TRUTH_OR_EXPR'
+`TRUTH_XOR_EXPR'
+ These nodes represent logical and, logical or, and logical
+ exclusive or. They are strict; both arguments are always
+ evaluated. There are no corresponding operators in C or C++, but
+ the front end will sometimes generate these expressions anyhow, if
+ it can tell that strictness does not matter. The type of the
+ operands and that of the result are always of `BOOLEAN_TYPE' or
+ `INTEGER_TYPE'.
+
+`POINTER_PLUS_EXPR'
+ This node represents pointer arithmetic. The first operand is
+ always a pointer/reference type. The second operand is always an
+ unsigned integer type compatible with sizetype. This is the only
+ binary arithmetic operand that can operate on pointer types.
+
+`PLUS_EXPR'
+`MINUS_EXPR'
+`MULT_EXPR'
+ These nodes represent various binary arithmetic operations.
+ Respectively, these operations are addition, subtraction (of the
+ second operand from the first) and multiplication. Their operands
+ may have either integral or floating type, but there will never be
+ case in which one operand is of floating type and the other is of
+ integral type.
+
+ The behavior of these operations on signed arithmetic overflow is
+ controlled by the `flag_wrapv' and `flag_trapv' variables.
+
+`RDIV_EXPR'
+ This node represents a floating point division operation.
+
+`TRUNC_DIV_EXPR'
+`FLOOR_DIV_EXPR'
+`CEIL_DIV_EXPR'
+`ROUND_DIV_EXPR'
+ These nodes represent integer division operations that return an
+ integer result. `TRUNC_DIV_EXPR' rounds towards zero,
+ `FLOOR_DIV_EXPR' rounds towards negative infinity, `CEIL_DIV_EXPR'
+ rounds towards positive infinity and `ROUND_DIV_EXPR' rounds to
+ the closest integer. Integer division in C and C++ is truncating,
+ i.e. `TRUNC_DIV_EXPR'.
+
+ The behavior of these operations on signed arithmetic overflow,
+ when dividing the minimum signed integer by minus one, is
+ controlled by the `flag_wrapv' and `flag_trapv' variables.
+
+`TRUNC_MOD_EXPR'
+`FLOOR_MOD_EXPR'
+`CEIL_MOD_EXPR'
+`ROUND_MOD_EXPR'
+ These nodes represent the integer remainder or modulus operation.
+ The integer modulus of two operands `a' and `b' is defined as `a -
+ (a/b)*b' where the division calculated using the corresponding
+ division operator. Hence for `TRUNC_MOD_EXPR' this definition
+ assumes division using truncation towards zero, i.e.
+ `TRUNC_DIV_EXPR'. Integer remainder in C and C++ uses truncating
+ division, i.e. `TRUNC_MOD_EXPR'.
+
+`EXACT_DIV_EXPR'
+ The `EXACT_DIV_EXPR' code is used to represent integer divisions
+ where the numerator is known to be an exact multiple of the
+ denominator. This allows the backend to choose between the faster
+ of `TRUNC_DIV_EXPR', `CEIL_DIV_EXPR' and `FLOOR_DIV_EXPR' for the
+ current target.
+
+`ARRAY_REF'
+ These nodes represent array accesses. The first operand is the
+ array; the second is the index. To calculate the address of the
+ memory accessed, you must scale the index by the size of the type
+ of the array elements. The type of these expressions must be the
+ type of a component of the array. The third and fourth operands
+ are used after gimplification to represent the lower bound and
+ component size but should not be used directly; call
+ `array_ref_low_bound' and `array_ref_element_size' instead.
+
+`ARRAY_RANGE_REF'
+ These nodes represent access to a range (or "slice") of an array.
+ The operands are the same as that for `ARRAY_REF' and have the same
+ meanings. The type of these expressions must be an array whose
+ component type is the same as that of the first operand. The
+ range of that array type determines the amount of data these
+ expressions access.
+
+`TARGET_MEM_REF'
+ These nodes represent memory accesses whose address directly map to
+ an addressing mode of the target architecture. The first argument
+ is `TMR_SYMBOL' and must be a `VAR_DECL' of an object with a fixed
+ address. The second argument is `TMR_BASE' and the third one is
+ `TMR_INDEX'. The fourth argument is `TMR_STEP' and must be an
+ `INTEGER_CST'. The fifth argument is `TMR_OFFSET' and must be an
+ `INTEGER_CST'. Any of the arguments may be NULL if the
+ appropriate component does not appear in the address. Address of
+ the `TARGET_MEM_REF' is determined in the following way.
+
+ &TMR_SYMBOL + TMR_BASE + TMR_INDEX * TMR_STEP + TMR_OFFSET
+
+ The sixth argument is the reference to the original memory access,
+ which is preserved for the purposes of the RTL alias analysis.
+ The seventh argument is a tag representing the results of tree
+ level alias analysis.
+
+`LT_EXPR'
+`LE_EXPR'
+`GT_EXPR'
+`GE_EXPR'
+`EQ_EXPR'
+`NE_EXPR'
+ These nodes represent the less than, less than or equal to, greater
+ than, greater than or equal to, equal, and not equal comparison
+ operators. The first and second operand with either be both of
+ integral type or both of floating type. The result type of these
+ expressions will always be of integral or boolean type. These
+ operations return the result type's zero value for false, and the
+ result type's one value for true.
+
+ For floating point comparisons, if we honor IEEE NaNs and either
+ operand is NaN, then `NE_EXPR' always returns true and the
+ remaining operators always return false. On some targets,
+ comparisons against an IEEE NaN, other than equality and
+ inequality, may generate a floating point exception.
+
+`ORDERED_EXPR'
+`UNORDERED_EXPR'
+ These nodes represent non-trapping ordered and unordered comparison
+ operators. These operations take two floating point operands and
+ determine whether they are ordered or unordered relative to each
+ other. If either operand is an IEEE NaN, their comparison is
+ defined to be unordered, otherwise the comparison is defined to be
+ ordered. The result type of these expressions will always be of
+ integral or boolean type. These operations return the result
+ type's zero value for false, and the result type's one value for
+ true.
+
+`UNLT_EXPR'
+`UNLE_EXPR'
+`UNGT_EXPR'
+`UNGE_EXPR'
+`UNEQ_EXPR'
+`LTGT_EXPR'
+ These nodes represent the unordered comparison operators. These
+ operations take two floating point operands and determine whether
+ the operands are unordered or are less than, less than or equal to,
+ greater than, greater than or equal to, or equal respectively. For
+ example, `UNLT_EXPR' returns true if either operand is an IEEE NaN
+ or the first operand is less than the second. With the possible
+ exception of `LTGT_EXPR', all of these operations are guaranteed
+ not to generate a floating point exception. The result type of
+ these expressions will always be of integral or boolean type.
+ These operations return the result type's zero value for false,
+ and the result type's one value for true.
+
+`MODIFY_EXPR'
+ These nodes represent assignment. The left-hand side is the first
+ operand; the right-hand side is the second operand. The left-hand
+ side will be a `VAR_DECL', `INDIRECT_REF', `COMPONENT_REF', or
+ other lvalue.
+
+ These nodes are used to represent not only assignment with `=' but
+ also compound assignments (like `+='), by reduction to `='
+ assignment. In other words, the representation for `i += 3' looks
+ just like that for `i = i + 3'.
+
+`INIT_EXPR'
+ These nodes are just like `MODIFY_EXPR', but are used only when a
+ variable is initialized, rather than assigned to subsequently.
+ This means that we can assume that the target of the
+ initialization is not used in computing its own value; any
+ reference to the lhs in computing the rhs is undefined.
+
+`COMPONENT_REF'
+ These nodes represent non-static data member accesses. The first
+ operand is the object (rather than a pointer to it); the second
+ operand is the `FIELD_DECL' for the data member. The third
+ operand represents the byte offset of the field, but should not be
+ used directly; call `component_ref_field_offset' instead.
+
+`COMPOUND_EXPR'
+ These nodes represent comma-expressions. The first operand is an
+ expression whose value is computed and thrown away prior to the
+ evaluation of the second operand. The value of the entire
+ expression is the value of the second operand.
+
+`COND_EXPR'
+ These nodes represent `?:' expressions. The first operand is of
+ boolean or integral type. If it evaluates to a nonzero value, the
+ second operand should be evaluated, and returned as the value of
+ the expression. Otherwise, the third operand is evaluated, and
+ returned as the value of the expression.
+
+ The second operand must have the same type as the entire
+ expression, unless it unconditionally throws an exception or calls
+ a noreturn function, in which case it should have void type. The
+ same constraints apply to the third operand. This allows array
+ bounds checks to be represented conveniently as `(i >= 0 && i <
+ 10) ? i : abort()'.
+
+ As a GNU extension, the C language front-ends allow the second
+ operand of the `?:' operator may be omitted in the source. For
+ example, `x ? : 3' is equivalent to `x ? x : 3', assuming that `x'
+ is an expression without side-effects. In the tree
+ representation, however, the second operand is always present,
+ possibly protected by `SAVE_EXPR' if the first argument does cause
+ side-effects.
+
+`CALL_EXPR'
+ These nodes are used to represent calls to functions, including
+ non-static member functions. `CALL_EXPR's are implemented as
+ expression nodes with a variable number of operands. Rather than
+ using `TREE_OPERAND' to extract them, it is preferable to use the
+ specialized accessor macros and functions that operate
+ specifically on `CALL_EXPR' nodes.
+
+ `CALL_EXPR_FN' returns a pointer to the function to call; it is
+ always an expression whose type is a `POINTER_TYPE'.
+
+ The number of arguments to the call is returned by
+ `call_expr_nargs', while the arguments themselves can be accessed
+ with the `CALL_EXPR_ARG' macro. The arguments are zero-indexed
+ and numbered left-to-right. You can iterate over the arguments
+ using `FOR_EACH_CALL_EXPR_ARG', as in:
+
+ tree call, arg;
+ call_expr_arg_iterator iter;
+ FOR_EACH_CALL_EXPR_ARG (arg, iter, call)
+ /* arg is bound to successive arguments of call. */
+ ...;
+
+ For non-static member functions, there will be an operand
+ corresponding to the `this' pointer. There will always be
+ expressions corresponding to all of the arguments, even if the
+ function is declared with default arguments and some arguments are
+ not explicitly provided at the call sites.
+
+ `CALL_EXPR's also have a `CALL_EXPR_STATIC_CHAIN' operand that is
+ used to implement nested functions. This operand is otherwise
+ null.
+
+`STMT_EXPR'
+ These nodes are used to represent GCC's statement-expression
+ extension. The statement-expression extension allows code like
+ this:
+ int f() { return ({ int j; j = 3; j + 7; }); }
+ In other words, an sequence of statements may occur where a single
+ expression would normally appear. The `STMT_EXPR' node represents
+ such an expression. The `STMT_EXPR_STMT' gives the statement
+ contained in the expression. The value of the expression is the
+ value of the last sub-statement in the body. More precisely, the
+ value is the value computed by the last statement nested inside
+ `BIND_EXPR', `TRY_FINALLY_EXPR', or `TRY_CATCH_EXPR'. For
+ example, in:
+ ({ 3; })
+ the value is `3' while in:
+ ({ if (x) { 3; } })
+ there is no value. If the `STMT_EXPR' does not yield a value,
+ it's type will be `void'.
+
+`BIND_EXPR'
+ These nodes represent local blocks. The first operand is a list of
+ variables, connected via their `TREE_CHAIN' field. These will
+ never require cleanups. The scope of these variables is just the
+ body of the `BIND_EXPR'. The body of the `BIND_EXPR' is the
+ second operand.
+
+`LOOP_EXPR'
+ These nodes represent "infinite" loops. The `LOOP_EXPR_BODY'
+ represents the body of the loop. It should be executed forever,
+ unless an `EXIT_EXPR' is encountered.
+
+`EXIT_EXPR'
+ These nodes represent conditional exits from the nearest enclosing
+ `LOOP_EXPR'. The single operand is the condition; if it is
+ nonzero, then the loop should be exited. An `EXIT_EXPR' will only
+ appear within a `LOOP_EXPR'.
+
+`CLEANUP_POINT_EXPR'
+ These nodes represent full-expressions. The single operand is an
+ expression to evaluate. Any destructor calls engendered by the
+ creation of temporaries during the evaluation of that expression
+ should be performed immediately after the expression is evaluated.
+
+`CONSTRUCTOR'
+ These nodes represent the brace-enclosed initializers for a
+ structure or array. The first operand is reserved for use by the
+ back end. The second operand is a `TREE_LIST'. If the
+ `TREE_TYPE' of the `CONSTRUCTOR' is a `RECORD_TYPE' or
+ `UNION_TYPE', then the `TREE_PURPOSE' of each node in the
+ `TREE_LIST' will be a `FIELD_DECL' and the `TREE_VALUE' of each
+ node will be the expression used to initialize that field.
+
+ If the `TREE_TYPE' of the `CONSTRUCTOR' is an `ARRAY_TYPE', then
+ the `TREE_PURPOSE' of each element in the `TREE_LIST' will be an
+ `INTEGER_CST' or a `RANGE_EXPR' of two `INTEGER_CST's. A single
+ `INTEGER_CST' indicates which element of the array (indexed from
+ zero) is being assigned to. A `RANGE_EXPR' indicates an inclusive
+ range of elements to initialize. In both cases the `TREE_VALUE'
+ is the corresponding initializer. It is re-evaluated for each
+ element of a `RANGE_EXPR'. If the `TREE_PURPOSE' is `NULL_TREE',
+ then the initializer is for the next available array element.
+
+ In the front end, you should not depend on the fields appearing in
+ any particular order. However, in the middle end, fields must
+ appear in declaration order. You should not assume that all
+ fields will be represented. Unrepresented fields will be set to
+ zero.
+
+`COMPOUND_LITERAL_EXPR'
+ These nodes represent ISO C99 compound literals. The
+ `COMPOUND_LITERAL_EXPR_DECL_STMT' is a `DECL_STMT' containing an
+ anonymous `VAR_DECL' for the unnamed object represented by the
+ compound literal; the `DECL_INITIAL' of that `VAR_DECL' is a
+ `CONSTRUCTOR' representing the brace-enclosed list of initializers
+ in the compound literal. That anonymous `VAR_DECL' can also be
+ accessed directly by the `COMPOUND_LITERAL_EXPR_DECL' macro.
+
+`SAVE_EXPR'
+ A `SAVE_EXPR' represents an expression (possibly involving
+ side-effects) that is used more than once. The side-effects should
+ occur only the first time the expression is evaluated. Subsequent
+ uses should just reuse the computed value. The first operand to
+ the `SAVE_EXPR' is the expression to evaluate. The side-effects
+ should be executed where the `SAVE_EXPR' is first encountered in a
+ depth-first preorder traversal of the expression tree.
+
+`TARGET_EXPR'
+ A `TARGET_EXPR' represents a temporary object. The first operand
+ is a `VAR_DECL' for the temporary variable. The second operand is
+ the initializer for the temporary. The initializer is evaluated
+ and, if non-void, copied (bitwise) into the temporary. If the
+ initializer is void, that means that it will perform the
+ initialization itself.
+
+ Often, a `TARGET_EXPR' occurs on the right-hand side of an
+ assignment, or as the second operand to a comma-expression which is
+ itself the right-hand side of an assignment, etc. In this case,
+ we say that the `TARGET_EXPR' is "normal"; otherwise, we say it is
+ "orphaned". For a normal `TARGET_EXPR' the temporary variable
+ should be treated as an alias for the left-hand side of the
+ assignment, rather than as a new temporary variable.
+
+ The third operand to the `TARGET_EXPR', if present, is a
+ cleanup-expression (i.e., destructor call) for the temporary. If
+ this expression is orphaned, then this expression must be executed
+ when the statement containing this expression is complete. These
+ cleanups must always be executed in the order opposite to that in
+ which they were encountered. Note that if a temporary is created
+ on one branch of a conditional operator (i.e., in the second or
+ third operand to a `COND_EXPR'), the cleanup must be run only if
+ that branch is actually executed.
+
+ See `STMT_IS_FULL_EXPR_P' for more information about running these
+ cleanups.
+
+`AGGR_INIT_EXPR'
+ An `AGGR_INIT_EXPR' represents the initialization as the return
+ value of a function call, or as the result of a constructor. An
+ `AGGR_INIT_EXPR' will only appear as a full-expression, or as the
+ second operand of a `TARGET_EXPR'. `AGGR_INIT_EXPR's have a
+ representation similar to that of `CALL_EXPR's. You can use the
+ `AGGR_INIT_EXPR_FN' and `AGGR_INIT_EXPR_ARG' macros to access the
+ function to call and the arguments to pass.
+
+ If `AGGR_INIT_VIA_CTOR_P' holds of the `AGGR_INIT_EXPR', then the
+ initialization is via a constructor call. The address of the
+ `AGGR_INIT_EXPR_SLOT' operand, which is always a `VAR_DECL', is
+ taken, and this value replaces the first argument in the argument
+ list.
+
+ In either case, the expression is void.
+
+`VA_ARG_EXPR'
+ This node is used to implement support for the C/C++ variable
+ argument-list mechanism. It represents expressions like `va_arg
+ (ap, type)'. Its `TREE_TYPE' yields the tree representation for
+ `type' and its sole argument yields the representation for `ap'.
+
+`CHANGE_DYNAMIC_TYPE_EXPR'
+ Indicates the special aliasing required by C++ placement new. It
+ has two operands: a type and a location. It means that the
+ dynamic type of the location is changing to be the specified type.
+ The alias analysis code takes this into account when doing type
+ based alias analysis.
+
+`OMP_PARALLEL'
+ Represents `#pragma omp parallel [clause1 ... clauseN]'. It has
+ four operands:
+
+ Operand `OMP_PARALLEL_BODY' is valid while in GENERIC and High
+ GIMPLE forms. It contains the body of code to be executed by all
+ the threads. During GIMPLE lowering, this operand becomes `NULL'
+ and the body is emitted linearly after `OMP_PARALLEL'.
+
+ Operand `OMP_PARALLEL_CLAUSES' is the list of clauses associated
+ with the directive.
+
+ Operand `OMP_PARALLEL_FN' is created by `pass_lower_omp', it
+ contains the `FUNCTION_DECL' for the function that will contain
+ the body of the parallel region.
+
+ Operand `OMP_PARALLEL_DATA_ARG' is also created by
+ `pass_lower_omp'. If there are shared variables to be communicated
+ to the children threads, this operand will contain the `VAR_DECL'
+ that contains all the shared values and variables.
+
+`OMP_FOR'
+ Represents `#pragma omp for [clause1 ... clauseN]'. It has 5
+ operands:
+
+ Operand `OMP_FOR_BODY' contains the loop body.
+
+ Operand `OMP_FOR_CLAUSES' is the list of clauses associated with
+ the directive.
+
+ Operand `OMP_FOR_INIT' is the loop initialization code of the form
+ `VAR = N1'.
+
+ Operand `OMP_FOR_COND' is the loop conditional expression of the
+ form `VAR {<,>,<=,>=} N2'.
+
+ Operand `OMP_FOR_INCR' is the loop index increment of the form
+ `VAR {+=,-=} INCR'.
+
+ Operand `OMP_FOR_PRE_BODY' contains side-effect code from operands
+ `OMP_FOR_INIT', `OMP_FOR_COND' and `OMP_FOR_INC'. These
+ side-effects are part of the `OMP_FOR' block but must be evaluated
+ before the start of loop body.
+
+ The loop index variable `VAR' must be a signed integer variable,
+ which is implicitly private to each thread. Bounds `N1' and `N2'
+ and the increment expression `INCR' are required to be loop
+ invariant integer expressions that are evaluated without any
+ synchronization. The evaluation order, frequency of evaluation and
+ side-effects are unspecified by the standard.
+
+`OMP_SECTIONS'
+ Represents `#pragma omp sections [clause1 ... clauseN]'.
+
+ Operand `OMP_SECTIONS_BODY' contains the sections body, which in
+ turn contains a set of `OMP_SECTION' nodes for each of the
+ concurrent sections delimited by `#pragma omp section'.
+
+ Operand `OMP_SECTIONS_CLAUSES' is the list of clauses associated
+ with the directive.
+
+`OMP_SECTION'
+ Section delimiter for `OMP_SECTIONS'.
+
+`OMP_SINGLE'
+ Represents `#pragma omp single'.
+
+ Operand `OMP_SINGLE_BODY' contains the body of code to be executed
+ by a single thread.
+
+ Operand `OMP_SINGLE_CLAUSES' is the list of clauses associated
+ with the directive.
+
+`OMP_MASTER'
+ Represents `#pragma omp master'.
+
+ Operand `OMP_MASTER_BODY' contains the body of code to be executed
+ by the master thread.
+
+`OMP_ORDERED'
+ Represents `#pragma omp ordered'.
+
+ Operand `OMP_ORDERED_BODY' contains the body of code to be
+ executed in the sequential order dictated by the loop index
+ variable.
+
+`OMP_CRITICAL'
+ Represents `#pragma omp critical [name]'.
+
+ Operand `OMP_CRITICAL_BODY' is the critical section.
+
+ Operand `OMP_CRITICAL_NAME' is an optional identifier to label the
+ critical section.
+
+`OMP_RETURN'
+ This does not represent any OpenMP directive, it is an artificial
+ marker to indicate the end of the body of an OpenMP. It is used by
+ the flow graph (`tree-cfg.c') and OpenMP region building code
+ (`omp-low.c').
+
+`OMP_CONTINUE'
+ Similarly, this instruction does not represent an OpenMP
+ directive, it is used by `OMP_FOR' and `OMP_SECTIONS' to mark the
+ place where the code needs to loop to the next iteration (in the
+ case of `OMP_FOR') or the next section (in the case of
+ `OMP_SECTIONS').
+
+ In some cases, `OMP_CONTINUE' is placed right before `OMP_RETURN'.
+ But if there are cleanups that need to occur right after the
+ looping body, it will be emitted between `OMP_CONTINUE' and
+ `OMP_RETURN'.
+
+`OMP_ATOMIC'
+ Represents `#pragma omp atomic'.
+
+ Operand 0 is the address at which the atomic operation is to be
+ performed.
+
+ Operand 1 is the expression to evaluate. The gimplifier tries
+ three alternative code generation strategies. Whenever possible,
+ an atomic update built-in is used. If that fails, a
+ compare-and-swap loop is attempted. If that also fails, a regular
+ critical section around the expression is used.
+
+`OMP_CLAUSE'
+ Represents clauses associated with one of the `OMP_' directives.
+ Clauses are represented by separate sub-codes defined in `tree.h'.
+ Clauses codes can be one of: `OMP_CLAUSE_PRIVATE',
+ `OMP_CLAUSE_SHARED', `OMP_CLAUSE_FIRSTPRIVATE',
+ `OMP_CLAUSE_LASTPRIVATE', `OMP_CLAUSE_COPYIN',
+ `OMP_CLAUSE_COPYPRIVATE', `OMP_CLAUSE_IF',
+ `OMP_CLAUSE_NUM_THREADS', `OMP_CLAUSE_SCHEDULE',
+ `OMP_CLAUSE_NOWAIT', `OMP_CLAUSE_ORDERED', `OMP_CLAUSE_DEFAULT',
+ and `OMP_CLAUSE_REDUCTION'. Each code represents the
+ corresponding OpenMP clause.
+
+ Clauses associated with the same directive are chained together
+ via `OMP_CLAUSE_CHAIN'. Those clauses that accept a list of
+ variables are restricted to exactly one, accessed with
+ `OMP_CLAUSE_VAR'. Therefore, multiple variables under the same
+ clause `C' need to be represented as multiple `C' clauses chained
+ together. This facilitates adding new clauses during compilation.
+
+`VEC_LSHIFT_EXPR'
+
+`VEC_RSHIFT_EXPR'
+ These nodes represent whole vector left and right shifts,
+ respectively. The first operand is the vector to shift; it will
+ always be of vector type. The second operand is an expression for
+ the number of bits by which to shift. Note that the result is
+ undefined if the second operand is larger than or equal to the
+ first operand's type size.
+
+`VEC_WIDEN_MULT_HI_EXPR'
+
+`VEC_WIDEN_MULT_LO_EXPR'
+ These nodes represent widening vector multiplication of the high
+ and low parts of the two input vectors, respectively. Their
+ operands are vectors that contain the same number of elements
+ (`N') of the same integral type. The result is a vector that
+ contains half as many elements, of an integral type whose size is
+ twice as wide. In the case of `VEC_WIDEN_MULT_HI_EXPR' the high
+ `N/2' elements of the two vector are multiplied to produce the
+ vector of `N/2' products. In the case of `VEC_WIDEN_MULT_LO_EXPR'
+ the low `N/2' elements of the two vector are multiplied to produce
+ the vector of `N/2' products.
+
+`VEC_UNPACK_HI_EXPR'
+
+`VEC_UNPACK_LO_EXPR'
+ These nodes represent unpacking of the high and low parts of the
+ input vector, respectively. The single operand is a vector that
+ contains `N' elements of the same integral or floating point type.
+ The result is a vector that contains half as many elements, of an
+ integral or floating point type whose size is twice as wide. In
+ the case of `VEC_UNPACK_HI_EXPR' the high `N/2' elements of the
+ vector are extracted and widened (promoted). In the case of
+ `VEC_UNPACK_LO_EXPR' the low `N/2' elements of the vector are
+ extracted and widened (promoted).
+
+`VEC_UNPACK_FLOAT_HI_EXPR'
+
+`VEC_UNPACK_FLOAT_LO_EXPR'
+ These nodes represent unpacking of the high and low parts of the
+ input vector, where the values are converted from fixed point to
+ floating point. The single operand is a vector that contains `N'
+ elements of the same integral type. The result is a vector that
+ contains half as many elements of a floating point type whose size
+ is twice as wide. In the case of `VEC_UNPACK_HI_EXPR' the high
+ `N/2' elements of the vector are extracted, converted and widened.
+ In the case of `VEC_UNPACK_LO_EXPR' the low `N/2' elements of the
+ vector are extracted, converted and widened.
+
+`VEC_PACK_TRUNC_EXPR'
+ This node represents packing of truncated elements of the two
+ input vectors into the output vector. Input operands are vectors
+ that contain the same number of elements of the same integral or
+ floating point type. The result is a vector that contains twice
+ as many elements of an integral or floating point type whose size
+ is half as wide. The elements of the two vectors are demoted and
+ merged (concatenated) to form the output vector.
+
+`VEC_PACK_SAT_EXPR'
+ This node represents packing of elements of the two input vectors
+ into the output vector using saturation. Input operands are
+ vectors that contain the same number of elements of the same
+ integral type. The result is a vector that contains twice as many
+ elements of an integral type whose size is half as wide. The
+ elements of the two vectors are demoted and merged (concatenated)
+ to form the output vector.
+
+`VEC_PACK_FIX_TRUNC_EXPR'
+ This node represents packing of elements of the two input vectors
+ into the output vector, where the values are converted from
+ floating point to fixed point. Input operands are vectors that
+ contain the same number of elements of a floating point type. The
+ result is a vector that contains twice as many elements of an
+ integral type whose size is half as wide. The elements of the two
+ vectors are merged (concatenated) to form the output vector.
+
+`VEC_EXTRACT_EVEN_EXPR'
+
+`VEC_EXTRACT_ODD_EXPR'
+ These nodes represent extracting of the even/odd elements of the
+ two input vectors, respectively. Their operands and result are
+ vectors that contain the same number of elements of the same type.
+
+`VEC_INTERLEAVE_HIGH_EXPR'
+
+`VEC_INTERLEAVE_LOW_EXPR'
+ These nodes represent merging and interleaving of the high/low
+ elements of the two input vectors, respectively. The operands and
+ the result are vectors that contain the same number of elements
+ (`N') of the same type. In the case of
+ `VEC_INTERLEAVE_HIGH_EXPR', the high `N/2' elements of the first
+ input vector are interleaved with the high `N/2' elements of the
+ second input vector. In the case of `VEC_INTERLEAVE_LOW_EXPR', the
+ low `N/2' elements of the first input vector are interleaved with
+ the low `N/2' elements of the second input vector.
+
+
+
+File: gccint.info, Node: RTL, Next: Control Flow, Prev: Tree SSA, Up: Top
+
+10 RTL Representation
+*********************
+
+The last part of the compiler work is done on a low-level intermediate
+representation called Register Transfer Language. In this language, the
+instructions to be output are described, pretty much one by one, in an
+algebraic form that describes what the instruction does.
+
+ RTL is inspired by Lisp lists. It has both an internal form, made up
+of structures that point at other structures, and a textual form that
+is used in the machine description and in printed debugging dumps. The
+textual form uses nested parentheses to indicate the pointers in the
+internal form.
+
+* Menu:
+
+* RTL Objects:: Expressions vs vectors vs strings vs integers.
+* RTL Classes:: Categories of RTL expression objects, and their structure.
+* Accessors:: Macros to access expression operands or vector elts.
+* Special Accessors:: Macros to access specific annotations on RTL.
+* Flags:: Other flags in an RTL expression.
+* Machine Modes:: Describing the size and format of a datum.
+* Constants:: Expressions with constant values.
+* Regs and Memory:: Expressions representing register contents or memory.
+* Arithmetic:: Expressions representing arithmetic on other expressions.
+* Comparisons:: Expressions representing comparison of expressions.
+* Bit-Fields:: Expressions representing bit-fields in memory or reg.
+* Vector Operations:: Expressions involving vector datatypes.
+* Conversions:: Extending, truncating, floating or fixing.
+* RTL Declarations:: Declaring volatility, constancy, etc.
+* Side Effects:: Expressions for storing in registers, etc.
+* Incdec:: Embedded side-effects for autoincrement addressing.
+* Assembler:: Representing `asm' with operands.
+* Insns:: Expression types for entire insns.
+* Calls:: RTL representation of function call insns.
+* Sharing:: Some expressions are unique; others *must* be copied.
+* Reading RTL:: Reading textual RTL from a file.
+
+
+File: gccint.info, Node: RTL Objects, Next: RTL Classes, Up: RTL
+
+10.1 RTL Object Types
+=====================
+
+RTL uses five kinds of objects: expressions, integers, wide integers,
+strings and vectors. Expressions are the most important ones. An RTL
+expression ("RTX", for short) is a C structure, but it is usually
+referred to with a pointer; a type that is given the typedef name `rtx'.
+
+ An integer is simply an `int'; their written form uses decimal digits.
+A wide integer is an integral object whose type is `HOST_WIDE_INT';
+their written form uses decimal digits.
+
+ A string is a sequence of characters. In core it is represented as a
+`char *' in usual C fashion, and it is written in C syntax as well.
+However, strings in RTL may never be null. If you write an empty
+string in a machine description, it is represented in core as a null
+pointer rather than as a pointer to a null character. In certain
+contexts, these null pointers instead of strings are valid. Within RTL
+code, strings are most commonly found inside `symbol_ref' expressions,
+but they appear in other contexts in the RTL expressions that make up
+machine descriptions.
+
+ In a machine description, strings are normally written with double
+quotes, as you would in C. However, strings in machine descriptions may
+extend over many lines, which is invalid C, and adjacent string
+constants are not concatenated as they are in C. Any string constant
+may be surrounded with a single set of parentheses. Sometimes this
+makes the machine description easier to read.
+
+ There is also a special syntax for strings, which can be useful when C
+code is embedded in a machine description. Wherever a string can
+appear, it is also valid to write a C-style brace block. The entire
+brace block, including the outermost pair of braces, is considered to be
+the string constant. Double quote characters inside the braces are not
+special. Therefore, if you write string constants in the C code, you
+need not escape each quote character with a backslash.
+
+ A vector contains an arbitrary number of pointers to expressions. The
+number of elements in the vector is explicitly present in the vector.
+The written form of a vector consists of square brackets (`[...]')
+surrounding the elements, in sequence and with whitespace separating
+them. Vectors of length zero are not created; null pointers are used
+instead.
+
+ Expressions are classified by "expression codes" (also called RTX
+codes). The expression code is a name defined in `rtl.def', which is
+also (in uppercase) a C enumeration constant. The possible expression
+codes and their meanings are machine-independent. The code of an RTX
+can be extracted with the macro `GET_CODE (X)' and altered with
+`PUT_CODE (X, NEWCODE)'.
+
+ The expression code determines how many operands the expression
+contains, and what kinds of objects they are. In RTL, unlike Lisp, you
+cannot tell by looking at an operand what kind of object it is.
+Instead, you must know from its context--from the expression code of
+the containing expression. For example, in an expression of code
+`subreg', the first operand is to be regarded as an expression and the
+second operand as an integer. In an expression of code `plus', there
+are two operands, both of which are to be regarded as expressions. In
+a `symbol_ref' expression, there is one operand, which is to be
+regarded as a string.
+
+ Expressions are written as parentheses containing the name of the
+expression type, its flags and machine mode if any, and then the
+operands of the expression (separated by spaces).
+
+ Expression code names in the `md' file are written in lowercase, but
+when they appear in C code they are written in uppercase. In this
+manual, they are shown as follows: `const_int'.
+
+ In a few contexts a null pointer is valid where an expression is
+normally wanted. The written form of this is `(nil)'.
+
+
+File: gccint.info, Node: RTL Classes, Next: Accessors, Prev: RTL Objects, Up: RTL
+
+10.2 RTL Classes and Formats
+============================
+
+The various expression codes are divided into several "classes", which
+are represented by single characters. You can determine the class of
+an RTX code with the macro `GET_RTX_CLASS (CODE)'. Currently,
+`rtl.def' defines these classes:
+
+`RTX_OBJ'
+ An RTX code that represents an actual object, such as a register
+ (`REG') or a memory location (`MEM', `SYMBOL_REF'). `LO_SUM') is
+ also included; instead, `SUBREG' and `STRICT_LOW_PART' are not in
+ this class, but in class `x'.
+
+`RTX_CONST_OBJ'
+ An RTX code that represents a constant object. `HIGH' is also
+ included in this class.
+
+`RTX_COMPARE'
+ An RTX code for a non-symmetric comparison, such as `GEU' or `LT'.
+
+`RTX_COMM_COMPARE'
+ An RTX code for a symmetric (commutative) comparison, such as `EQ'
+ or `ORDERED'.
+
+`RTX_UNARY'
+ An RTX code for a unary arithmetic operation, such as `NEG',
+ `NOT', or `ABS'. This category also includes value extension
+ (sign or zero) and conversions between integer and floating point.
+
+`RTX_COMM_ARITH'
+ An RTX code for a commutative binary operation, such as `PLUS' or
+ `AND'. `NE' and `EQ' are comparisons, so they have class `<'.
+
+`RTX_BIN_ARITH'
+ An RTX code for a non-commutative binary operation, such as
+ `MINUS', `DIV', or `ASHIFTRT'.
+
+`RTX_BITFIELD_OPS'
+ An RTX code for a bit-field operation. Currently only
+ `ZERO_EXTRACT' and `SIGN_EXTRACT'. These have three inputs and
+ are lvalues (so they can be used for insertion as well). *Note
+ Bit-Fields::.
+
+`RTX_TERNARY'
+ An RTX code for other three input operations. Currently only
+ `IF_THEN_ELSE' and `VEC_MERGE'.
+
+`RTX_INSN'
+ An RTX code for an entire instruction: `INSN', `JUMP_INSN', and
+ `CALL_INSN'. *Note Insns::.
+
+`RTX_MATCH'
+ An RTX code for something that matches in insns, such as
+ `MATCH_DUP'. These only occur in machine descriptions.
+
+`RTX_AUTOINC'
+ An RTX code for an auto-increment addressing mode, such as
+ `POST_INC'.
+
+`RTX_EXTRA'
+ All other RTX codes. This category includes the remaining codes
+ used only in machine descriptions (`DEFINE_*', etc.). It also
+ includes all the codes describing side effects (`SET', `USE',
+ `CLOBBER', etc.) and the non-insns that may appear on an insn
+ chain, such as `NOTE', `BARRIER', and `CODE_LABEL'. `SUBREG' is
+ also part of this class.
+
+ For each expression code, `rtl.def' specifies the number of contained
+objects and their kinds using a sequence of characters called the
+"format" of the expression code. For example, the format of `subreg'
+is `ei'.
+
+ These are the most commonly used format characters:
+
+`e'
+ An expression (actually a pointer to an expression).
+
+`i'
+ An integer.
+
+`w'
+ A wide integer.
+
+`s'
+ A string.
+
+`E'
+ A vector of expressions.
+
+ A few other format characters are used occasionally:
+
+`u'
+ `u' is equivalent to `e' except that it is printed differently in
+ debugging dumps. It is used for pointers to insns.
+
+`n'
+ `n' is equivalent to `i' except that it is printed differently in
+ debugging dumps. It is used for the line number or code number of
+ a `note' insn.
+
+`S'
+ `S' indicates a string which is optional. In the RTL objects in
+ core, `S' is equivalent to `s', but when the object is read, from
+ an `md' file, the string value of this operand may be omitted. An
+ omitted string is taken to be the null string.
+
+`V'
+ `V' indicates a vector which is optional. In the RTL objects in
+ core, `V' is equivalent to `E', but when the object is read from
+ an `md' file, the vector value of this operand may be omitted. An
+ omitted vector is effectively the same as a vector of no elements.
+
+`B'
+ `B' indicates a pointer to basic block structure.
+
+`0'
+ `0' means a slot whose contents do not fit any normal category.
+ `0' slots are not printed at all in dumps, and are often used in
+ special ways by small parts of the compiler.
+
+ There are macros to get the number of operands and the format of an
+expression code:
+
+`GET_RTX_LENGTH (CODE)'
+ Number of operands of an RTX of code CODE.
+
+`GET_RTX_FORMAT (CODE)'
+ The format of an RTX of code CODE, as a C string.
+
+ Some classes of RTX codes always have the same format. For example, it
+is safe to assume that all comparison operations have format `ee'.
+
+`1'
+ All codes of this class have format `e'.
+
+`<'
+`c'
+`2'
+ All codes of these classes have format `ee'.
+
+`b'
+`3'
+ All codes of these classes have format `eee'.
+
+`i'
+ All codes of this class have formats that begin with `iuueiee'.
+ *Note Insns::. Note that not all RTL objects linked onto an insn
+ chain are of class `i'.
+
+`o'
+`m'
+`x'
+ You can make no assumptions about the format of these codes.
+
+
+File: gccint.info, Node: Accessors, Next: Special Accessors, Prev: RTL Classes, Up: RTL
+
+10.3 Access to Operands
+=======================
+
+Operands of expressions are accessed using the macros `XEXP', `XINT',
+`XWINT' and `XSTR'. Each of these macros takes two arguments: an
+expression-pointer (RTX) and an operand number (counting from zero).
+Thus,
+
+ XEXP (X, 2)
+
+accesses operand 2 of expression X, as an expression.
+
+ XINT (X, 2)
+
+accesses the same operand as an integer. `XSTR', used in the same
+fashion, would access it as a string.
+
+ Any operand can be accessed as an integer, as an expression or as a
+string. You must choose the correct method of access for the kind of
+value actually stored in the operand. You would do this based on the
+expression code of the containing expression. That is also how you
+would know how many operands there are.
+
+ For example, if X is a `subreg' expression, you know that it has two
+operands which can be correctly accessed as `XEXP (X, 0)' and `XINT (X,
+1)'. If you did `XINT (X, 0)', you would get the address of the
+expression operand but cast as an integer; that might occasionally be
+useful, but it would be cleaner to write `(int) XEXP (X, 0)'. `XEXP
+(X, 1)' would also compile without error, and would return the second,
+integer operand cast as an expression pointer, which would probably
+result in a crash when accessed. Nothing stops you from writing `XEXP
+(X, 28)' either, but this will access memory past the end of the
+expression with unpredictable results.
+
+ Access to operands which are vectors is more complicated. You can use
+the macro `XVEC' to get the vector-pointer itself, or the macros
+`XVECEXP' and `XVECLEN' to access the elements and length of a vector.
+
+`XVEC (EXP, IDX)'
+ Access the vector-pointer which is operand number IDX in EXP.
+
+`XVECLEN (EXP, IDX)'
+ Access the length (number of elements) in the vector which is in
+ operand number IDX in EXP. This value is an `int'.
+
+`XVECEXP (EXP, IDX, ELTNUM)'
+ Access element number ELTNUM in the vector which is in operand
+ number IDX in EXP. This value is an RTX.
+
+ It is up to you to make sure that ELTNUM is not negative and is
+ less than `XVECLEN (EXP, IDX)'.
+
+ All the macros defined in this section expand into lvalues and
+therefore can be used to assign the operands, lengths and vector
+elements as well as to access them.
+
+
+File: gccint.info, Node: Special Accessors, Next: Flags, Prev: Accessors, Up: RTL
+
+10.4 Access to Special Operands
+===============================
+
+Some RTL nodes have special annotations associated with them.
+
+`MEM'
+
+ `MEM_ALIAS_SET (X)'
+ If 0, X is not in any alias set, and may alias anything.
+ Otherwise, X can only alias `MEM's in a conflicting alias
+ set. This value is set in a language-dependent manner in the
+ front-end, and should not be altered in the back-end. In
+ some front-ends, these numbers may correspond in some way to
+ types, or other language-level entities, but they need not,
+ and the back-end makes no such assumptions. These set
+ numbers are tested with `alias_sets_conflict_p'.
+
+ `MEM_EXPR (X)'
+ If this register is known to hold the value of some user-level
+ declaration, this is that tree node. It may also be a
+ `COMPONENT_REF', in which case this is some field reference,
+ and `TREE_OPERAND (X, 0)' contains the declaration, or
+ another `COMPONENT_REF', or null if there is no compile-time
+ object associated with the reference.
+
+ `MEM_OFFSET (X)'
+ The offset from the start of `MEM_EXPR' as a `CONST_INT' rtx.
+
+ `MEM_SIZE (X)'
+ The size in bytes of the memory reference as a `CONST_INT'
+ rtx. This is mostly relevant for `BLKmode' references as
+ otherwise the size is implied by the mode.
+
+ `MEM_ALIGN (X)'
+ The known alignment in bits of the memory reference.
+
+`REG'
+
+ `ORIGINAL_REGNO (X)'
+ This field holds the number the register "originally" had;
+ for a pseudo register turned into a hard reg this will hold
+ the old pseudo register number.
+
+ `REG_EXPR (X)'
+ If this register is known to hold the value of some user-level
+ declaration, this is that tree node.
+
+ `REG_OFFSET (X)'
+ If this register is known to hold the value of some user-level
+ declaration, this is the offset into that logical storage.
+
+`SYMBOL_REF'
+
+ `SYMBOL_REF_DECL (X)'
+ If the `symbol_ref' X was created for a `VAR_DECL' or a
+ `FUNCTION_DECL', that tree is recorded here. If this value is
+ null, then X was created by back end code generation routines,
+ and there is no associated front end symbol table entry.
+
+ `SYMBOL_REF_DECL' may also point to a tree of class `'c'',
+ that is, some sort of constant. In this case, the
+ `symbol_ref' is an entry in the per-file constant pool;
+ again, there is no associated front end symbol table entry.
+
+ `SYMBOL_REF_CONSTANT (X)'
+ If `CONSTANT_POOL_ADDRESS_P (X)' is true, this is the constant
+ pool entry for X. It is null otherwise.
+
+ `SYMBOL_REF_DATA (X)'
+ A field of opaque type used to store `SYMBOL_REF_DECL' or
+ `SYMBOL_REF_CONSTANT'.
+
+ `SYMBOL_REF_FLAGS (X)'
+ In a `symbol_ref', this is used to communicate various
+ predicates about the symbol. Some of these are common enough
+ to be computed by common code, some are specific to the
+ target. The common bits are:
+
+ `SYMBOL_FLAG_FUNCTION'
+ Set if the symbol refers to a function.
+
+ `SYMBOL_FLAG_LOCAL'
+ Set if the symbol is local to this "module". See
+ `TARGET_BINDS_LOCAL_P'.
+
+ `SYMBOL_FLAG_EXTERNAL'
+ Set if this symbol is not defined in this translation
+ unit. Note that this is not the inverse of
+ `SYMBOL_FLAG_LOCAL'.
+
+ `SYMBOL_FLAG_SMALL'
+ Set if the symbol is located in the small data section.
+ See `TARGET_IN_SMALL_DATA_P'.
+
+ `SYMBOL_REF_TLS_MODEL (X)'
+ This is a multi-bit field accessor that returns the
+ `tls_model' to be used for a thread-local storage
+ symbol. It returns zero for non-thread-local symbols.
+
+ `SYMBOL_FLAG_HAS_BLOCK_INFO'
+ Set if the symbol has `SYMBOL_REF_BLOCK' and
+ `SYMBOL_REF_BLOCK_OFFSET' fields.
+
+ `SYMBOL_FLAG_ANCHOR'
+ Set if the symbol is used as a section anchor. "Section
+ anchors" are symbols that have a known position within
+ an `object_block' and that can be used to access nearby
+ members of that block. They are used to implement
+ `-fsection-anchors'.
+
+ If this flag is set, then `SYMBOL_FLAG_HAS_BLOCK_INFO'
+ will be too.
+
+ Bits beginning with `SYMBOL_FLAG_MACH_DEP' are available for
+ the target's use.
+
+`SYMBOL_REF_BLOCK (X)'
+ If `SYMBOL_REF_HAS_BLOCK_INFO_P (X)', this is the `object_block'
+ structure to which the symbol belongs, or `NULL' if it has not
+ been assigned a block.
+
+`SYMBOL_REF_BLOCK_OFFSET (X)'
+ If `SYMBOL_REF_HAS_BLOCK_INFO_P (X)', this is the offset of X from
+ the first object in `SYMBOL_REF_BLOCK (X)'. The value is negative
+ if X has not yet been assigned to a block, or it has not been
+ given an offset within that block.
+
+
+File: gccint.info, Node: Flags, Next: Machine Modes, Prev: Special Accessors, Up: RTL
+
+10.5 Flags in an RTL Expression
+===============================
+
+RTL expressions contain several flags (one-bit bit-fields) that are
+used in certain types of expression. Most often they are accessed with
+the following macros, which expand into lvalues.
+
+`CONSTANT_POOL_ADDRESS_P (X)'
+ Nonzero in a `symbol_ref' if it refers to part of the current
+ function's constant pool. For most targets these addresses are in
+ a `.rodata' section entirely separate from the function, but for
+ some targets the addresses are close to the beginning of the
+ function. In either case GCC assumes these addresses can be
+ addressed directly, perhaps with the help of base registers.
+ Stored in the `unchanging' field and printed as `/u'.
+
+`RTL_CONST_CALL_P (X)'
+ In a `call_insn' indicates that the insn represents a call to a
+ const function. Stored in the `unchanging' field and printed as
+ `/u'.
+
+`RTL_PURE_CALL_P (X)'
+ In a `call_insn' indicates that the insn represents a call to a
+ pure function. Stored in the `return_val' field and printed as
+ `/i'.
+
+`RTL_CONST_OR_PURE_CALL_P (X)'
+ In a `call_insn', true if `RTL_CONST_CALL_P' or `RTL_PURE_CALL_P'
+ is true.
+
+`RTL_LOOPING_CONST_OR_PURE_CALL_P (X)'
+ In a `call_insn' indicates that the insn represents a possibly
+ infinite looping call to a const or pure function. Stored in the
+ `call' field and printed as `/c'. Only true if one of
+ `RTL_CONST_CALL_P' or `RTL_PURE_CALL_P' is true.
+
+`INSN_ANNULLED_BRANCH_P (X)'
+ In a `jump_insn', `call_insn', or `insn' indicates that the branch
+ is an annulling one. See the discussion under `sequence' below.
+ Stored in the `unchanging' field and printed as `/u'.
+
+`INSN_DELETED_P (X)'
+ In an `insn', `call_insn', `jump_insn', `code_label', `barrier',
+ or `note', nonzero if the insn has been deleted. Stored in the
+ `volatil' field and printed as `/v'.
+
+`INSN_FROM_TARGET_P (X)'
+ In an `insn' or `jump_insn' or `call_insn' in a delay slot of a
+ branch, indicates that the insn is from the target of the branch.
+ If the branch insn has `INSN_ANNULLED_BRANCH_P' set, this insn
+ will only be executed if the branch is taken. For annulled
+ branches with `INSN_FROM_TARGET_P' clear, the insn will be
+ executed only if the branch is not taken. When
+ `INSN_ANNULLED_BRANCH_P' is not set, this insn will always be
+ executed. Stored in the `in_struct' field and printed as `/s'.
+
+`LABEL_PRESERVE_P (X)'
+ In a `code_label' or `note', indicates that the label is
+ referenced by code or data not visible to the RTL of a given
+ function. Labels referenced by a non-local goto will have this
+ bit set. Stored in the `in_struct' field and printed as `/s'.
+
+`LABEL_REF_NONLOCAL_P (X)'
+ In `label_ref' and `reg_label' expressions, nonzero if this is a
+ reference to a non-local label. Stored in the `volatil' field and
+ printed as `/v'.
+
+`MEM_IN_STRUCT_P (X)'
+ In `mem' expressions, nonzero for reference to an entire structure,
+ union or array, or to a component of one. Zero for references to a
+ scalar variable or through a pointer to a scalar. If both this
+ flag and `MEM_SCALAR_P' are clear, then we don't know whether this
+ `mem' is in a structure or not. Both flags should never be
+ simultaneously set. Stored in the `in_struct' field and printed
+ as `/s'.
+
+`MEM_KEEP_ALIAS_SET_P (X)'
+ In `mem' expressions, 1 if we should keep the alias set for this
+ mem unchanged when we access a component. Set to 1, for example,
+ when we are already in a non-addressable component of an aggregate.
+ Stored in the `jump' field and printed as `/j'.
+
+`MEM_SCALAR_P (X)'
+ In `mem' expressions, nonzero for reference to a scalar known not
+ to be a member of a structure, union, or array. Zero for such
+ references and for indirections through pointers, even pointers
+ pointing to scalar types. If both this flag and `MEM_IN_STRUCT_P'
+ are clear, then we don't know whether this `mem' is in a structure
+ or not. Both flags should never be simultaneously set. Stored in
+ the `return_val' field and printed as `/i'.
+
+`MEM_VOLATILE_P (X)'
+ In `mem', `asm_operands', and `asm_input' expressions, nonzero for
+ volatile memory references. Stored in the `volatil' field and
+ printed as `/v'.
+
+`MEM_NOTRAP_P (X)'
+ In `mem', nonzero for memory references that will not trap.
+ Stored in the `call' field and printed as `/c'.
+
+`MEM_POINTER (X)'
+ Nonzero in a `mem' if the memory reference holds a pointer.
+ Stored in the `frame_related' field and printed as `/f'.
+
+`REG_FUNCTION_VALUE_P (X)'
+ Nonzero in a `reg' if it is the place in which this function's
+ value is going to be returned. (This happens only in a hard
+ register.) Stored in the `return_val' field and printed as `/i'.
+
+`REG_POINTER (X)'
+ Nonzero in a `reg' if the register holds a pointer. Stored in the
+ `frame_related' field and printed as `/f'.
+
+`REG_USERVAR_P (X)'
+ In a `reg', nonzero if it corresponds to a variable present in the
+ user's source code. Zero for temporaries generated internally by
+ the compiler. Stored in the `volatil' field and printed as `/v'.
+
+ The same hard register may be used also for collecting the values
+ of functions called by this one, but `REG_FUNCTION_VALUE_P' is zero
+ in this kind of use.
+
+`RTX_FRAME_RELATED_P (X)'
+ Nonzero in an `insn', `call_insn', `jump_insn', `barrier', or
+ `set' which is part of a function prologue and sets the stack
+ pointer, sets the frame pointer, or saves a register. This flag
+ should also be set on an instruction that sets up a temporary
+ register to use in place of the frame pointer. Stored in the
+ `frame_related' field and printed as `/f'.
+
+ In particular, on RISC targets where there are limits on the sizes
+ of immediate constants, it is sometimes impossible to reach the
+ register save area directly from the stack pointer. In that case,
+ a temporary register is used that is near enough to the register
+ save area, and the Canonical Frame Address, i.e., DWARF2's logical
+ frame pointer, register must (temporarily) be changed to be this
+ temporary register. So, the instruction that sets this temporary
+ register must be marked as `RTX_FRAME_RELATED_P'.
+
+ If the marked instruction is overly complex (defined in terms of
+ what `dwarf2out_frame_debug_expr' can handle), you will also have
+ to create a `REG_FRAME_RELATED_EXPR' note and attach it to the
+ instruction. This note should contain a simple expression of the
+ computation performed by this instruction, i.e., one that
+ `dwarf2out_frame_debug_expr' can handle.
+
+ This flag is required for exception handling support on targets
+ with RTL prologues.
+
+`MEM_READONLY_P (X)'
+ Nonzero in a `mem', if the memory is statically allocated and
+ read-only.
+
+ Read-only in this context means never modified during the lifetime
+ of the program, not necessarily in ROM or in write-disabled pages.
+ A common example of the later is a shared library's global offset
+ table. This table is initialized by the runtime loader, so the
+ memory is technically writable, but after control is transfered
+ from the runtime loader to the application, this memory will never
+ be subsequently modified.
+
+ Stored in the `unchanging' field and printed as `/u'.
+
+`SCHED_GROUP_P (X)'
+ During instruction scheduling, in an `insn', `call_insn' or
+ `jump_insn', indicates that the previous insn must be scheduled
+ together with this insn. This is used to ensure that certain
+ groups of instructions will not be split up by the instruction
+ scheduling pass, for example, `use' insns before a `call_insn' may
+ not be separated from the `call_insn'. Stored in the `in_struct'
+ field and printed as `/s'.
+
+`SET_IS_RETURN_P (X)'
+ For a `set', nonzero if it is for a return. Stored in the `jump'
+ field and printed as `/j'.
+
+`SIBLING_CALL_P (X)'
+ For a `call_insn', nonzero if the insn is a sibling call. Stored
+ in the `jump' field and printed as `/j'.
+
+`STRING_POOL_ADDRESS_P (X)'
+ For a `symbol_ref' expression, nonzero if it addresses this
+ function's string constant pool. Stored in the `frame_related'
+ field and printed as `/f'.
+
+`SUBREG_PROMOTED_UNSIGNED_P (X)'
+ Returns a value greater then zero for a `subreg' that has
+ `SUBREG_PROMOTED_VAR_P' nonzero if the object being referenced is
+ kept zero-extended, zero if it is kept sign-extended, and less
+ then zero if it is extended some other way via the `ptr_extend'
+ instruction. Stored in the `unchanging' field and `volatil'
+ field, printed as `/u' and `/v'. This macro may only be used to
+ get the value it may not be used to change the value. Use
+ `SUBREG_PROMOTED_UNSIGNED_SET' to change the value.
+
+`SUBREG_PROMOTED_UNSIGNED_SET (X)'
+ Set the `unchanging' and `volatil' fields in a `subreg' to reflect
+ zero, sign, or other extension. If `volatil' is zero, then
+ `unchanging' as nonzero means zero extension and as zero means
+ sign extension. If `volatil' is nonzero then some other type of
+ extension was done via the `ptr_extend' instruction.
+
+`SUBREG_PROMOTED_VAR_P (X)'
+ Nonzero in a `subreg' if it was made when accessing an object that
+ was promoted to a wider mode in accord with the `PROMOTED_MODE'
+ machine description macro (*note Storage Layout::). In this case,
+ the mode of the `subreg' is the declared mode of the object and
+ the mode of `SUBREG_REG' is the mode of the register that holds
+ the object. Promoted variables are always either sign- or
+ zero-extended to the wider mode on every assignment. Stored in
+ the `in_struct' field and printed as `/s'.
+
+`SYMBOL_REF_USED (X)'
+ In a `symbol_ref', indicates that X has been used. This is
+ normally only used to ensure that X is only declared external
+ once. Stored in the `used' field.
+
+`SYMBOL_REF_WEAK (X)'
+ In a `symbol_ref', indicates that X has been declared weak.
+ Stored in the `return_val' field and printed as `/i'.
+
+`SYMBOL_REF_FLAG (X)'
+ In a `symbol_ref', this is used as a flag for machine-specific
+ purposes. Stored in the `volatil' field and printed as `/v'.
+
+ Most uses of `SYMBOL_REF_FLAG' are historic and may be subsumed by
+ `SYMBOL_REF_FLAGS'. Certainly use of `SYMBOL_REF_FLAGS' is
+ mandatory if the target requires more than one bit of storage.
+
+ These are the fields to which the above macros refer:
+
+`call'
+ In a `mem', 1 means that the memory reference will not trap.
+
+ In a `call', 1 means that this pure or const call may possibly
+ infinite loop.
+
+ In an RTL dump, this flag is represented as `/c'.
+
+`frame_related'
+ In an `insn' or `set' expression, 1 means that it is part of a
+ function prologue and sets the stack pointer, sets the frame
+ pointer, saves a register, or sets up a temporary register to use
+ in place of the frame pointer.
+
+ In `reg' expressions, 1 means that the register holds a pointer.
+
+ In `mem' expressions, 1 means that the memory reference holds a
+ pointer.
+
+ In `symbol_ref' expressions, 1 means that the reference addresses
+ this function's string constant pool.
+
+ In an RTL dump, this flag is represented as `/f'.
+
+`in_struct'
+ In `mem' expressions, it is 1 if the memory datum referred to is
+ all or part of a structure or array; 0 if it is (or might be) a
+ scalar variable. A reference through a C pointer has 0 because
+ the pointer might point to a scalar variable. This information
+ allows the compiler to determine something about possible cases of
+ aliasing.
+
+ In `reg' expressions, it is 1 if the register has its entire life
+ contained within the test expression of some loop.
+
+ In `subreg' expressions, 1 means that the `subreg' is accessing an
+ object that has had its mode promoted from a wider mode.
+
+ In `label_ref' expressions, 1 means that the referenced label is
+ outside the innermost loop containing the insn in which the
+ `label_ref' was found.
+
+ In `code_label' expressions, it is 1 if the label may never be
+ deleted. This is used for labels which are the target of
+ non-local gotos. Such a label that would have been deleted is
+ replaced with a `note' of type `NOTE_INSN_DELETED_LABEL'.
+
+ In an `insn' during dead-code elimination, 1 means that the insn is
+ dead code.
+
+ In an `insn' or `jump_insn' during reorg for an insn in the delay
+ slot of a branch, 1 means that this insn is from the target of the
+ branch.
+
+ In an `insn' during instruction scheduling, 1 means that this insn
+ must be scheduled as part of a group together with the previous
+ insn.
+
+ In an RTL dump, this flag is represented as `/s'.
+
+`return_val'
+ In `reg' expressions, 1 means the register contains the value to
+ be returned by the current function. On machines that pass
+ parameters in registers, the same register number may be used for
+ parameters as well, but this flag is not set on such uses.
+
+ In `mem' expressions, 1 means the memory reference is to a scalar
+ known not to be a member of a structure, union, or array.
+
+ In `symbol_ref' expressions, 1 means the referenced symbol is weak.
+
+ In `call' expressions, 1 means the call is pure.
+
+ In an RTL dump, this flag is represented as `/i'.
+
+`jump'
+ In a `mem' expression, 1 means we should keep the alias set for
+ this mem unchanged when we access a component.
+
+ In a `set', 1 means it is for a return.
+
+ In a `call_insn', 1 means it is a sibling call.
+
+ In an RTL dump, this flag is represented as `/j'.
+
+`unchanging'
+ In `reg' and `mem' expressions, 1 means that the value of the
+ expression never changes.
+
+ In `subreg' expressions, it is 1 if the `subreg' references an
+ unsigned object whose mode has been promoted to a wider mode.
+
+ In an `insn' or `jump_insn' in the delay slot of a branch
+ instruction, 1 means an annulling branch should be used.
+
+ In a `symbol_ref' expression, 1 means that this symbol addresses
+ something in the per-function constant pool.
+
+ In a `call_insn' 1 means that this instruction is a call to a const
+ function.
+
+ In an RTL dump, this flag is represented as `/u'.
+
+`used'
+ This flag is used directly (without an access macro) at the end of
+ RTL generation for a function, to count the number of times an
+ expression appears in insns. Expressions that appear more than
+ once are copied, according to the rules for shared structure
+ (*note Sharing::).
+
+ For a `reg', it is used directly (without an access macro) by the
+ leaf register renumbering code to ensure that each register is only
+ renumbered once.
+
+ In a `symbol_ref', it indicates that an external declaration for
+ the symbol has already been written.
+
+`volatil'
+ In a `mem', `asm_operands', or `asm_input' expression, it is 1 if
+ the memory reference is volatile. Volatile memory references may
+ not be deleted, reordered or combined.
+
+ In a `symbol_ref' expression, it is used for machine-specific
+ purposes.
+
+ In a `reg' expression, it is 1 if the value is a user-level
+ variable. 0 indicates an internal compiler temporary.
+
+ In an `insn', 1 means the insn has been deleted.
+
+ In `label_ref' and `reg_label' expressions, 1 means a reference to
+ a non-local label.
+
+ In an RTL dump, this flag is represented as `/v'.
+
+
+File: gccint.info, Node: Machine Modes, Next: Constants, Prev: Flags, Up: RTL
+
+10.6 Machine Modes
+==================
+
+A machine mode describes a size of data object and the representation
+used for it. In the C code, machine modes are represented by an
+enumeration type, `enum machine_mode', defined in `machmode.def'. Each
+RTL expression has room for a machine mode and so do certain kinds of
+tree expressions (declarations and types, to be precise).
+
+ In debugging dumps and machine descriptions, the machine mode of an RTL
+expression is written after the expression code with a colon to separate
+them. The letters `mode' which appear at the end of each machine mode
+name are omitted. For example, `(reg:SI 38)' is a `reg' expression
+with machine mode `SImode'. If the mode is `VOIDmode', it is not
+written at all.
+
+ Here is a table of machine modes. The term "byte" below refers to an
+object of `BITS_PER_UNIT' bits (*note Storage Layout::).
+
+`BImode'
+ "Bit" mode represents a single bit, for predicate registers.
+
+`QImode'
+ "Quarter-Integer" mode represents a single byte treated as an
+ integer.
+
+`HImode'
+ "Half-Integer" mode represents a two-byte integer.
+
+`PSImode'
+ "Partial Single Integer" mode represents an integer which occupies
+ four bytes but which doesn't really use all four. On some
+ machines, this is the right mode to use for pointers.
+
+`SImode'
+ "Single Integer" mode represents a four-byte integer.
+
+`PDImode'
+ "Partial Double Integer" mode represents an integer which occupies
+ eight bytes but which doesn't really use all eight. On some
+ machines, this is the right mode to use for certain pointers.
+
+`DImode'
+ "Double Integer" mode represents an eight-byte integer.
+
+`TImode'
+ "Tetra Integer" (?) mode represents a sixteen-byte integer.
+
+`OImode'
+ "Octa Integer" (?) mode represents a thirty-two-byte integer.
+
+`QFmode'
+ "Quarter-Floating" mode represents a quarter-precision (single
+ byte) floating point number.
+
+`HFmode'
+ "Half-Floating" mode represents a half-precision (two byte)
+ floating point number.
+
+`TQFmode'
+ "Three-Quarter-Floating" (?) mode represents a
+ three-quarter-precision (three byte) floating point number.
+
+`SFmode'
+ "Single Floating" mode represents a four byte floating point
+ number. In the common case, of a processor with IEEE arithmetic
+ and 8-bit bytes, this is a single-precision IEEE floating point
+ number; it can also be used for double-precision (on processors
+ with 16-bit bytes) and single-precision VAX and IBM types.
+
+`DFmode'
+ "Double Floating" mode represents an eight byte floating point
+ number. In the common case, of a processor with IEEE arithmetic
+ and 8-bit bytes, this is a double-precision IEEE floating point
+ number.
+
+`XFmode'
+ "Extended Floating" mode represents an IEEE extended floating point
+ number. This mode only has 80 meaningful bits (ten bytes). Some
+ processors require such numbers to be padded to twelve bytes,
+ others to sixteen; this mode is used for either.
+
+`SDmode'
+ "Single Decimal Floating" mode represents a four byte decimal
+ floating point number (as distinct from conventional binary
+ floating point).
+
+`DDmode'
+ "Double Decimal Floating" mode represents an eight byte decimal
+ floating point number.
+
+`TDmode'
+ "Tetra Decimal Floating" mode represents a sixteen byte decimal
+ floating point number all 128 of whose bits are meaningful.
+
+`TFmode'
+ "Tetra Floating" mode represents a sixteen byte floating point
+ number all 128 of whose bits are meaningful. One common use is the
+ IEEE quad-precision format.
+
+`QQmode'
+ "Quarter-Fractional" mode represents a single byte treated as a
+ signed fractional number. The default format is "s.7".
+
+`HQmode'
+ "Half-Fractional" mode represents a two-byte signed fractional
+ number. The default format is "s.15".
+
+`SQmode'
+ "Single Fractional" mode represents a four-byte signed fractional
+ number. The default format is "s.31".
+
+`DQmode'
+ "Double Fractional" mode represents an eight-byte signed
+ fractional number. The default format is "s.63".
+
+`TQmode'
+ "Tetra Fractional" mode represents a sixteen-byte signed
+ fractional number. The default format is "s.127".
+
+`UQQmode'
+ "Unsigned Quarter-Fractional" mode represents a single byte
+ treated as an unsigned fractional number. The default format is
+ ".8".
+
+`UHQmode'
+ "Unsigned Half-Fractional" mode represents a two-byte unsigned
+ fractional number. The default format is ".16".
+
+`USQmode'
+ "Unsigned Single Fractional" mode represents a four-byte unsigned
+ fractional number. The default format is ".32".
+
+`UDQmode'
+ "Unsigned Double Fractional" mode represents an eight-byte unsigned
+ fractional number. The default format is ".64".
+
+`UTQmode'
+ "Unsigned Tetra Fractional" mode represents a sixteen-byte unsigned
+ fractional number. The default format is ".128".
+
+`HAmode'
+ "Half-Accumulator" mode represents a two-byte signed accumulator.
+ The default format is "s8.7".
+
+`SAmode'
+ "Single Accumulator" mode represents a four-byte signed
+ accumulator. The default format is "s16.15".
+
+`DAmode'
+ "Double Accumulator" mode represents an eight-byte signed
+ accumulator. The default format is "s32.31".
+
+`TAmode'
+ "Tetra Accumulator" mode represents a sixteen-byte signed
+ accumulator. The default format is "s64.63".
+
+`UHAmode'
+ "Unsigned Half-Accumulator" mode represents a two-byte unsigned
+ accumulator. The default format is "8.8".
+
+`USAmode'
+ "Unsigned Single Accumulator" mode represents a four-byte unsigned
+ accumulator. The default format is "16.16".
+
+`UDAmode'
+ "Unsigned Double Accumulator" mode represents an eight-byte
+ unsigned accumulator. The default format is "32.32".
+
+`UTAmode'
+ "Unsigned Tetra Accumulator" mode represents a sixteen-byte
+ unsigned accumulator. The default format is "64.64".
+
+`CCmode'
+ "Condition Code" mode represents the value of a condition code,
+ which is a machine-specific set of bits used to represent the
+ result of a comparison operation. Other machine-specific modes
+ may also be used for the condition code. These modes are not used
+ on machines that use `cc0' (see *note Condition Code::).
+
+`BLKmode'
+ "Block" mode represents values that are aggregates to which none of
+ the other modes apply. In RTL, only memory references can have
+ this mode, and only if they appear in string-move or vector
+ instructions. On machines which have no such instructions,
+ `BLKmode' will not appear in RTL.
+
+`VOIDmode'
+ Void mode means the absence of a mode or an unspecified mode. For
+ example, RTL expressions of code `const_int' have mode `VOIDmode'
+ because they can be taken to have whatever mode the context
+ requires. In debugging dumps of RTL, `VOIDmode' is expressed by
+ the absence of any mode.
+
+`QCmode, HCmode, SCmode, DCmode, XCmode, TCmode'
+ These modes stand for a complex number represented as a pair of
+ floating point values. The floating point values are in `QFmode',
+ `HFmode', `SFmode', `DFmode', `XFmode', and `TFmode', respectively.
+
+`CQImode, CHImode, CSImode, CDImode, CTImode, COImode'
+ These modes stand for a complex number represented as a pair of
+ integer values. The integer values are in `QImode', `HImode',
+ `SImode', `DImode', `TImode', and `OImode', respectively.
+
+ The machine description defines `Pmode' as a C macro which expands
+into the machine mode used for addresses. Normally this is the mode
+whose size is `BITS_PER_WORD', `SImode' on 32-bit machines.
+
+ The only modes which a machine description must support are `QImode',
+and the modes corresponding to `BITS_PER_WORD', `FLOAT_TYPE_SIZE' and
+`DOUBLE_TYPE_SIZE'. The compiler will attempt to use `DImode' for
+8-byte structures and unions, but this can be prevented by overriding
+the definition of `MAX_FIXED_MODE_SIZE'. Alternatively, you can have
+the compiler use `TImode' for 16-byte structures and unions. Likewise,
+you can arrange for the C type `short int' to avoid using `HImode'.
+
+ Very few explicit references to machine modes remain in the compiler
+and these few references will soon be removed. Instead, the machine
+modes are divided into mode classes. These are represented by the
+enumeration type `enum mode_class' defined in `machmode.h'. The
+possible mode classes are:
+
+`MODE_INT'
+ Integer modes. By default these are `BImode', `QImode', `HImode',
+ `SImode', `DImode', `TImode', and `OImode'.
+
+`MODE_PARTIAL_INT'
+ The "partial integer" modes, `PQImode', `PHImode', `PSImode' and
+ `PDImode'.
+
+`MODE_FLOAT'
+ Floating point modes. By default these are `QFmode', `HFmode',
+ `TQFmode', `SFmode', `DFmode', `XFmode' and `TFmode'.
+
+`MODE_DECIMAL_FLOAT'
+ Decimal floating point modes. By default these are `SDmode',
+ `DDmode' and `TDmode'.
+
+`MODE_FRACT'
+ Signed fractional modes. By default these are `QQmode', `HQmode',
+ `SQmode', `DQmode' and `TQmode'.
+
+`MODE_UFRACT'
+ Unsigned fractional modes. By default these are `UQQmode',
+ `UHQmode', `USQmode', `UDQmode' and `UTQmode'.
+
+`MODE_ACCUM'
+ Signed accumulator modes. By default these are `HAmode',
+ `SAmode', `DAmode' and `TAmode'.
+
+`MODE_UACCUM'
+ Unsigned accumulator modes. By default these are `UHAmode',
+ `USAmode', `UDAmode' and `UTAmode'.
+
+`MODE_COMPLEX_INT'
+ Complex integer modes. (These are not currently implemented).
+
+`MODE_COMPLEX_FLOAT'
+ Complex floating point modes. By default these are `QCmode',
+ `HCmode', `SCmode', `DCmode', `XCmode', and `TCmode'.
+
+`MODE_FUNCTION'
+ Algol or Pascal function variables including a static chain.
+ (These are not currently implemented).
+
+`MODE_CC'
+ Modes representing condition code values. These are `CCmode' plus
+ any `CC_MODE' modes listed in the `MACHINE-modes.def'. *Note Jump
+ Patterns::, also see *Note Condition Code::.
+
+`MODE_RANDOM'
+ This is a catchall mode class for modes which don't fit into the
+ above classes. Currently `VOIDmode' and `BLKmode' are in
+ `MODE_RANDOM'.
+
+ Here are some C macros that relate to machine modes:
+
+`GET_MODE (X)'
+ Returns the machine mode of the RTX X.
+
+`PUT_MODE (X, NEWMODE)'
+ Alters the machine mode of the RTX X to be NEWMODE.
+
+`NUM_MACHINE_MODES'
+ Stands for the number of machine modes available on the target
+ machine. This is one greater than the largest numeric value of any
+ machine mode.
+
+`GET_MODE_NAME (M)'
+ Returns the name of mode M as a string.
+
+`GET_MODE_CLASS (M)'
+ Returns the mode class of mode M.
+
+`GET_MODE_WIDER_MODE (M)'
+ Returns the next wider natural mode. For example, the expression
+ `GET_MODE_WIDER_MODE (QImode)' returns `HImode'.
+
+`GET_MODE_SIZE (M)'
+ Returns the size in bytes of a datum of mode M.
+
+`GET_MODE_BITSIZE (M)'
+ Returns the size in bits of a datum of mode M.
+
+`GET_MODE_IBIT (M)'
+ Returns the number of integral bits of a datum of fixed-point mode
+ M.
+
+`GET_MODE_FBIT (M)'
+ Returns the number of fractional bits of a datum of fixed-point
+ mode M.
+
+`GET_MODE_MASK (M)'
+ Returns a bitmask containing 1 for all bits in a word that fit
+ within mode M. This macro can only be used for modes whose
+ bitsize is less than or equal to `HOST_BITS_PER_INT'.
+
+`GET_MODE_ALIGNMENT (M)'
+ Return the required alignment, in bits, for an object of mode M.
+
+`GET_MODE_UNIT_SIZE (M)'
+ Returns the size in bytes of the subunits of a datum of mode M.
+ This is the same as `GET_MODE_SIZE' except in the case of complex
+ modes. For them, the unit size is the size of the real or
+ imaginary part.
+
+`GET_MODE_NUNITS (M)'
+ Returns the number of units contained in a mode, i.e.,
+ `GET_MODE_SIZE' divided by `GET_MODE_UNIT_SIZE'.
+
+`GET_CLASS_NARROWEST_MODE (C)'
+ Returns the narrowest mode in mode class C.
+
+ The global variables `byte_mode' and `word_mode' contain modes whose
+classes are `MODE_INT' and whose bitsizes are either `BITS_PER_UNIT' or
+`BITS_PER_WORD', respectively. On 32-bit machines, these are `QImode'
+and `SImode', respectively.
+
+
+File: gccint.info, Node: Constants, Next: Regs and Memory, Prev: Machine Modes, Up: RTL
+
+10.7 Constant Expression Types
+==============================
+
+The simplest RTL expressions are those that represent constant values.
+
+`(const_int I)'
+ This type of expression represents the integer value I. I is
+ customarily accessed with the macro `INTVAL' as in `INTVAL (EXP)',
+ which is equivalent to `XWINT (EXP, 0)'.
+
+ Constants generated for modes with fewer bits than `HOST_WIDE_INT'
+ must be sign extended to full width (e.g., with `gen_int_mode').
+
+ There is only one expression object for the integer value zero; it
+ is the value of the variable `const0_rtx'. Likewise, the only
+ expression for integer value one is found in `const1_rtx', the only
+ expression for integer value two is found in `const2_rtx', and the
+ only expression for integer value negative one is found in
+ `constm1_rtx'. Any attempt to create an expression of code
+ `const_int' and value zero, one, two or negative one will return
+ `const0_rtx', `const1_rtx', `const2_rtx' or `constm1_rtx' as
+ appropriate.
+
+ Similarly, there is only one object for the integer whose value is
+ `STORE_FLAG_VALUE'. It is found in `const_true_rtx'. If
+ `STORE_FLAG_VALUE' is one, `const_true_rtx' and `const1_rtx' will
+ point to the same object. If `STORE_FLAG_VALUE' is -1,
+ `const_true_rtx' and `constm1_rtx' will point to the same object.
+
+`(const_double:M I0 I1 ...)'
+ Represents either a floating-point constant of mode M or an
+ integer constant too large to fit into `HOST_BITS_PER_WIDE_INT'
+ bits but small enough to fit within twice that number of bits (GCC
+ does not provide a mechanism to represent even larger constants).
+ In the latter case, M will be `VOIDmode'.
+
+ If M is `VOIDmode', the bits of the value are stored in I0 and I1.
+ I0 is customarily accessed with the macro `CONST_DOUBLE_LOW' and
+ I1 with `CONST_DOUBLE_HIGH'.
+
+ If the constant is floating point (regardless of its precision),
+ then the number of integers used to store the value depends on the
+ size of `REAL_VALUE_TYPE' (*note Floating Point::). The integers
+ represent a floating point number, but not precisely in the target
+ machine's or host machine's floating point format. To convert
+ them to the precise bit pattern used by the target machine, use
+ the macro `REAL_VALUE_TO_TARGET_DOUBLE' and friends (*note Data
+ Output::).
+
+`(const_fixed:M ...)'
+ Represents a fixed-point constant of mode M. The operand is a
+ data structure of type `struct fixed_value' and is accessed with
+ the macro `CONST_FIXED_VALUE'. The high part of data is accessed
+ with `CONST_FIXED_VALUE_HIGH'; the low part is accessed with
+ `CONST_FIXED_VALUE_LOW'.
+
+`(const_vector:M [X0 X1 ...])'
+ Represents a vector constant. The square brackets stand for the
+ vector containing the constant elements. X0, X1 and so on are the
+ `const_int', `const_double' or `const_fixed' elements.
+
+ The number of units in a `const_vector' is obtained with the macro
+ `CONST_VECTOR_NUNITS' as in `CONST_VECTOR_NUNITS (V)'.
+
+ Individual elements in a vector constant are accessed with the
+ macro `CONST_VECTOR_ELT' as in `CONST_VECTOR_ELT (V, N)' where V
+ is the vector constant and N is the element desired.
+
+`(const_string STR)'
+ Represents a constant string with value STR. Currently this is
+ used only for insn attributes (*note Insn Attributes::) since
+ constant strings in C are placed in memory.
+
+`(symbol_ref:MODE SYMBOL)'
+ Represents the value of an assembler label for data. SYMBOL is a
+ string that describes the name of the assembler label. If it
+ starts with a `*', the label is the rest of SYMBOL not including
+ the `*'. Otherwise, the label is SYMBOL, usually prefixed with
+ `_'.
+
+ The `symbol_ref' contains a mode, which is usually `Pmode'.
+ Usually that is the only mode for which a symbol is directly valid.
+
+`(label_ref:MODE LABEL)'
+ Represents the value of an assembler label for code. It contains
+ one operand, an expression, which must be a `code_label' or a
+ `note' of type `NOTE_INSN_DELETED_LABEL' that appears in the
+ instruction sequence to identify the place where the label should
+ go.
+
+ The reason for using a distinct expression type for code label
+ references is so that jump optimization can distinguish them.
+
+ The `label_ref' contains a mode, which is usually `Pmode'.
+ Usually that is the only mode for which a label is directly valid.
+
+`(const:M EXP)'
+ Represents a constant that is the result of an assembly-time
+ arithmetic computation. The operand, EXP, is an expression that
+ contains only constants (`const_int', `symbol_ref' and `label_ref'
+ expressions) combined with `plus' and `minus'. However, not all
+ combinations are valid, since the assembler cannot do arbitrary
+ arithmetic on relocatable symbols.
+
+ M should be `Pmode'.
+
+`(high:M EXP)'
+ Represents the high-order bits of EXP, usually a `symbol_ref'.
+ The number of bits is machine-dependent and is normally the number
+ of bits specified in an instruction that initializes the high
+ order bits of a register. It is used with `lo_sum' to represent
+ the typical two-instruction sequence used in RISC machines to
+ reference a global memory location.
+
+ M should be `Pmode'.
+
+ The macro `CONST0_RTX (MODE)' refers to an expression with value 0 in
+mode MODE. If mode MODE is of mode class `MODE_INT', it returns
+`const0_rtx'. If mode MODE is of mode class `MODE_FLOAT', it returns a
+`CONST_DOUBLE' expression in mode MODE. Otherwise, it returns a
+`CONST_VECTOR' expression in mode MODE. Similarly, the macro
+`CONST1_RTX (MODE)' refers to an expression with value 1 in mode MODE
+and similarly for `CONST2_RTX'. The `CONST1_RTX' and `CONST2_RTX'
+macros are undefined for vector modes.
+
+
+File: gccint.info, Node: Regs and Memory, Next: Arithmetic, Prev: Constants, Up: RTL
+
+10.8 Registers and Memory
+=========================
+
+Here are the RTL expression types for describing access to machine
+registers and to main memory.
+
+`(reg:M N)'
+ For small values of the integer N (those that are less than
+ `FIRST_PSEUDO_REGISTER'), this stands for a reference to machine
+ register number N: a "hard register". For larger values of N, it
+ stands for a temporary value or "pseudo register". The compiler's
+ strategy is to generate code assuming an unlimited number of such
+ pseudo registers, and later convert them into hard registers or
+ into memory references.
+
+ M is the machine mode of the reference. It is necessary because
+ machines can generally refer to each register in more than one
+ mode. For example, a register may contain a full word but there
+ may be instructions to refer to it as a half word or as a single
+ byte, as well as instructions to refer to it as a floating point
+ number of various precisions.
+
+ Even for a register that the machine can access in only one mode,
+ the mode must always be specified.
+
+ The symbol `FIRST_PSEUDO_REGISTER' is defined by the machine
+ description, since the number of hard registers on the machine is
+ an invariant characteristic of the machine. Note, however, that
+ not all of the machine registers must be general registers. All
+ the machine registers that can be used for storage of data are
+ given hard register numbers, even those that can be used only in
+ certain instructions or can hold only certain types of data.
+
+ A hard register may be accessed in various modes throughout one
+ function, but each pseudo register is given a natural mode and is
+ accessed only in that mode. When it is necessary to describe an
+ access to a pseudo register using a nonnatural mode, a `subreg'
+ expression is used.
+
+ A `reg' expression with a machine mode that specifies more than
+ one word of data may actually stand for several consecutive
+ registers. If in addition the register number specifies a
+ hardware register, then it actually represents several consecutive
+ hardware registers starting with the specified one.
+
+ Each pseudo register number used in a function's RTL code is
+ represented by a unique `reg' expression.
+
+ Some pseudo register numbers, those within the range of
+ `FIRST_VIRTUAL_REGISTER' to `LAST_VIRTUAL_REGISTER' only appear
+ during the RTL generation phase and are eliminated before the
+ optimization phases. These represent locations in the stack frame
+ that cannot be determined until RTL generation for the function
+ has been completed. The following virtual register numbers are
+ defined:
+
+ `VIRTUAL_INCOMING_ARGS_REGNUM'
+ This points to the first word of the incoming arguments
+ passed on the stack. Normally these arguments are placed
+ there by the caller, but the callee may have pushed some
+ arguments that were previously passed in registers.
+
+ When RTL generation is complete, this virtual register is
+ replaced by the sum of the register given by
+ `ARG_POINTER_REGNUM' and the value of `FIRST_PARM_OFFSET'.
+
+ `VIRTUAL_STACK_VARS_REGNUM'
+ If `FRAME_GROWS_DOWNWARD' is defined to a nonzero value, this
+ points to immediately above the first variable on the stack.
+ Otherwise, it points to the first variable on the stack.
+
+ `VIRTUAL_STACK_VARS_REGNUM' is replaced with the sum of the
+ register given by `FRAME_POINTER_REGNUM' and the value
+ `STARTING_FRAME_OFFSET'.
+
+ `VIRTUAL_STACK_DYNAMIC_REGNUM'
+ This points to the location of dynamically allocated memory
+ on the stack immediately after the stack pointer has been
+ adjusted by the amount of memory desired.
+
+ This virtual register is replaced by the sum of the register
+ given by `STACK_POINTER_REGNUM' and the value
+ `STACK_DYNAMIC_OFFSET'.
+
+ `VIRTUAL_OUTGOING_ARGS_REGNUM'
+ This points to the location in the stack at which outgoing
+ arguments should be written when the stack is pre-pushed
+ (arguments pushed using push insns should always use
+ `STACK_POINTER_REGNUM').
+
+ This virtual register is replaced by the sum of the register
+ given by `STACK_POINTER_REGNUM' and the value
+ `STACK_POINTER_OFFSET'.
+
+`(subreg:M1 REG:M2 BYTENUM)'
+ `subreg' expressions are used to refer to a register in a machine
+ mode other than its natural one, or to refer to one register of a
+ multi-part `reg' that actually refers to several registers.
+
+ Each pseudo register has a natural mode. If it is necessary to
+ operate on it in a different mode, the register must be enclosed
+ in a `subreg'.
+
+ There are currently three supported types for the first operand of
+ a `subreg':
+ * pseudo registers This is the most common case. Most
+ `subreg's have pseudo `reg's as their first operand.
+
+ * mem `subreg's of `mem' were common in earlier versions of GCC
+ and are still supported. During the reload pass these are
+ replaced by plain `mem's. On machines that do not do
+ instruction scheduling, use of `subreg's of `mem' are still
+ used, but this is no longer recommended. Such `subreg's are
+ considered to be `register_operand's rather than
+ `memory_operand's before and during reload. Because of this,
+ the scheduling passes cannot properly schedule instructions
+ with `subreg's of `mem', so for machines that do scheduling,
+ `subreg's of `mem' should never be used. To support this,
+ the combine and recog passes have explicit code to inhibit
+ the creation of `subreg's of `mem' when `INSN_SCHEDULING' is
+ defined.
+
+ The use of `subreg's of `mem' after the reload pass is an area
+ that is not well understood and should be avoided. There is
+ still some code in the compiler to support this, but this
+ code has possibly rotted. This use of `subreg's is
+ discouraged and will most likely not be supported in the
+ future.
+
+ * hard registers It is seldom necessary to wrap hard registers
+ in `subreg's; such registers would normally reduce to a
+ single `reg' rtx. This use of `subreg's is discouraged and
+ may not be supported in the future.
+
+
+ `subreg's of `subreg's are not supported. Using
+ `simplify_gen_subreg' is the recommended way to avoid this problem.
+
+ `subreg's come in two distinct flavors, each having its own usage
+ and rules:
+
+ Paradoxical subregs
+ When M1 is strictly wider than M2, the `subreg' expression is
+ called "paradoxical". The canonical test for this class of
+ `subreg' is:
+
+ GET_MODE_SIZE (M1) > GET_MODE_SIZE (M2)
+
+ Paradoxical `subreg's can be used as both lvalues and rvalues.
+ When used as an lvalue, the low-order bits of the source value
+ are stored in REG and the high-order bits are discarded.
+ When used as an rvalue, the low-order bits of the `subreg' are
+ taken from REG while the high-order bits may or may not be
+ defined.
+
+ The high-order bits of rvalues are in the following
+ circumstances:
+
+ * `subreg's of `mem' When M2 is smaller than a word, the
+ macro `LOAD_EXTEND_OP', can control how the high-order
+ bits are defined.
+
+ * `subreg' of `reg's The upper bits are defined when
+ `SUBREG_PROMOTED_VAR_P' is true.
+ `SUBREG_PROMOTED_UNSIGNED_P' describes what the upper
+ bits hold. Such subregs usually represent local
+ variables, register variables and parameter pseudo
+ variables that have been promoted to a wider mode.
+
+
+ BYTENUM is always zero for a paradoxical `subreg', even on
+ big-endian targets.
+
+ For example, the paradoxical `subreg':
+
+ (set (subreg:SI (reg:HI X) 0) Y)
+
+ stores the lower 2 bytes of Y in X and discards the upper 2
+ bytes. A subsequent:
+
+ (set Z (subreg:SI (reg:HI X) 0))
+
+ would set the lower two bytes of Z to Y and set the upper two
+ bytes to an unknown value assuming `SUBREG_PROMOTED_VAR_P' is
+ false.
+
+ Normal subregs
+ When M1 is at least as narrow as M2 the `subreg' expression
+ is called "normal".
+
+ Normal `subreg's restrict consideration to certain bits of
+ REG. There are two cases. If M1 is smaller than a word, the
+ `subreg' refers to the least-significant part (or "lowpart")
+ of one word of REG. If M1 is word-sized or greater, the
+ `subreg' refers to one or more complete words.
+
+ When used as an lvalue, `subreg' is a word-based accessor.
+ Storing to a `subreg' modifies all the words of REG that
+ overlap the `subreg', but it leaves the other words of REG
+ alone.
+
+ When storing to a normal `subreg' that is smaller than a word,
+ the other bits of the referenced word are usually left in an
+ undefined state. This laxity makes it easier to generate
+ efficient code for such instructions. To represent an
+ instruction that preserves all the bits outside of those in
+ the `subreg', use `strict_low_part' or `zero_extract' around
+ the `subreg'.
+
+ BYTENUM must identify the offset of the first byte of the
+ `subreg' from the start of REG, assuming that REG is laid out
+ in memory order. The memory order of bytes is defined by two
+ target macros, `WORDS_BIG_ENDIAN' and `BYTES_BIG_ENDIAN':
+
+ * `WORDS_BIG_ENDIAN', if set to 1, says that byte number
+ zero is part of the most significant word; otherwise, it
+ is part of the least significant word.
+
+ * `BYTES_BIG_ENDIAN', if set to 1, says that byte number
+ zero is the most significant byte within a word;
+ otherwise, it is the least significant byte within a
+ word.
+
+ On a few targets, `FLOAT_WORDS_BIG_ENDIAN' disagrees with
+ `WORDS_BIG_ENDIAN'. However, most parts of the compiler treat
+ floating point values as if they had the same endianness as
+ integer values. This works because they handle them solely
+ as a collection of integer values, with no particular
+ numerical value. Only real.c and the runtime libraries care
+ about `FLOAT_WORDS_BIG_ENDIAN'.
+
+ Thus,
+
+ (subreg:HI (reg:SI X) 2)
+
+ on a `BYTES_BIG_ENDIAN', `UNITS_PER_WORD == 4' target is the
+ same as
+
+ (subreg:HI (reg:SI X) 0)
+
+ on a little-endian, `UNITS_PER_WORD == 4' target. Both
+ `subreg's access the lower two bytes of register X.
+
+
+ A `MODE_PARTIAL_INT' mode behaves as if it were as wide as the
+ corresponding `MODE_INT' mode, except that it has an unknown
+ number of undefined bits. For example:
+
+ (subreg:PSI (reg:SI 0) 0)
+
+ accesses the whole of `(reg:SI 0)', but the exact relationship
+ between the `PSImode' value and the `SImode' value is not defined.
+ If we assume `UNITS_PER_WORD <= 4', then the following two
+ `subreg's:
+
+ (subreg:PSI (reg:DI 0) 0)
+ (subreg:PSI (reg:DI 0) 4)
+
+ represent independent 4-byte accesses to the two halves of
+ `(reg:DI 0)'. Both `subreg's have an unknown number of undefined
+ bits.
+
+ If `UNITS_PER_WORD <= 2' then these two `subreg's:
+
+ (subreg:HI (reg:PSI 0) 0)
+ (subreg:HI (reg:PSI 0) 2)
+
+ represent independent 2-byte accesses that together span the whole
+ of `(reg:PSI 0)'. Storing to the first `subreg' does not affect
+ the value of the second, and vice versa. `(reg:PSI 0)' has an
+ unknown number of undefined bits, so the assignment:
+
+ (set (subreg:HI (reg:PSI 0) 0) (reg:HI 4))
+
+ does not guarantee that `(subreg:HI (reg:PSI 0) 0)' has the value
+ `(reg:HI 4)'.
+
+ The rules above apply to both pseudo REGs and hard REGs. If the
+ semantics are not correct for particular combinations of M1, M2
+ and hard REG, the target-specific code must ensure that those
+ combinations are never used. For example:
+
+ CANNOT_CHANGE_MODE_CLASS (M2, M1, CLASS)
+
+ must be true for every class CLASS that includes REG.
+
+ The first operand of a `subreg' expression is customarily accessed
+ with the `SUBREG_REG' macro and the second operand is customarily
+ accessed with the `SUBREG_BYTE' macro.
+
+ It has been several years since a platform in which
+ `BYTES_BIG_ENDIAN' not equal to `WORDS_BIG_ENDIAN' has been
+ tested. Anyone wishing to support such a platform in the future
+ may be confronted with code rot.
+
+`(scratch:M)'
+ This represents a scratch register that will be required for the
+ execution of a single instruction and not used subsequently. It is
+ converted into a `reg' by either the local register allocator or
+ the reload pass.
+
+ `scratch' is usually present inside a `clobber' operation (*note
+ Side Effects::).
+
+`(cc0)'
+ This refers to the machine's condition code register. It has no
+ operands and may not have a machine mode. There are two ways to
+ use it:
+
+ * To stand for a complete set of condition code flags. This is
+ best on most machines, where each comparison sets the entire
+ series of flags.
+
+ With this technique, `(cc0)' may be validly used in only two
+ contexts: as the destination of an assignment (in test and
+ compare instructions) and in comparison operators comparing
+ against zero (`const_int' with value zero; that is to say,
+ `const0_rtx').
+
+ * To stand for a single flag that is the result of a single
+ condition. This is useful on machines that have only a
+ single flag bit, and in which comparison instructions must
+ specify the condition to test.
+
+ With this technique, `(cc0)' may be validly used in only two
+ contexts: as the destination of an assignment (in test and
+ compare instructions) where the source is a comparison
+ operator, and as the first operand of `if_then_else' (in a
+ conditional branch).
+
+ There is only one expression object of code `cc0'; it is the value
+ of the variable `cc0_rtx'. Any attempt to create an expression of
+ code `cc0' will return `cc0_rtx'.
+
+ Instructions can set the condition code implicitly. On many
+ machines, nearly all instructions set the condition code based on
+ the value that they compute or store. It is not necessary to
+ record these actions explicitly in the RTL because the machine
+ description includes a prescription for recognizing the
+ instructions that do so (by means of the macro
+ `NOTICE_UPDATE_CC'). *Note Condition Code::. Only instructions
+ whose sole purpose is to set the condition code, and instructions
+ that use the condition code, need mention `(cc0)'.
+
+ On some machines, the condition code register is given a register
+ number and a `reg' is used instead of `(cc0)'. This is usually the
+ preferable approach if only a small subset of instructions modify
+ the condition code. Other machines store condition codes in
+ general registers; in such cases a pseudo register should be used.
+
+ Some machines, such as the SPARC and RS/6000, have two sets of
+ arithmetic instructions, one that sets and one that does not set
+ the condition code. This is best handled by normally generating
+ the instruction that does not set the condition code, and making a
+ pattern that both performs the arithmetic and sets the condition
+ code register (which would not be `(cc0)' in this case). For
+ examples, search for `addcc' and `andcc' in `sparc.md'.
+
+`(pc)'
+ This represents the machine's program counter. It has no operands
+ and may not have a machine mode. `(pc)' may be validly used only
+ in certain specific contexts in jump instructions.
+
+ There is only one expression object of code `pc'; it is the value
+ of the variable `pc_rtx'. Any attempt to create an expression of
+ code `pc' will return `pc_rtx'.
+
+ All instructions that do not jump alter the program counter
+ implicitly by incrementing it, but there is no need to mention
+ this in the RTL.
+
+`(mem:M ADDR ALIAS)'
+ This RTX represents a reference to main memory at an address
+ represented by the expression ADDR. M specifies how large a unit
+ of memory is accessed. ALIAS specifies an alias set for the
+ reference. In general two items are in different alias sets if
+ they cannot reference the same memory address.
+
+ The construct `(mem:BLK (scratch))' is considered to alias all
+ other memories. Thus it may be used as a memory barrier in
+ epilogue stack deallocation patterns.
+
+`(concatM RTX RTX)'
+ This RTX represents the concatenation of two other RTXs. This is
+ used for complex values. It should only appear in the RTL
+ attached to declarations and during RTL generation. It should not
+ appear in the ordinary insn chain.
+
+`(concatnM [RTX ...])'
+ This RTX represents the concatenation of all the RTX to make a
+ single value. Like `concat', this should only appear in
+ declarations, and not in the insn chain.
+
+
+File: gccint.info, Node: Arithmetic, Next: Comparisons, Prev: Regs and Memory, Up: RTL
+
+10.9 RTL Expressions for Arithmetic
+===================================
+
+Unless otherwise specified, all the operands of arithmetic expressions
+must be valid for mode M. An operand is valid for mode M if it has
+mode M, or if it is a `const_int' or `const_double' and M is a mode of
+class `MODE_INT'.
+
+ For commutative binary operations, constants should be placed in the
+second operand.
+
+`(plus:M X Y)'
+`(ss_plus:M X Y)'
+`(us_plus:M X Y)'
+ These three expressions all represent the sum of the values
+ represented by X and Y carried out in machine mode M. They differ
+ in their behavior on overflow of integer modes. `plus' wraps
+ round modulo the width of M; `ss_plus' saturates at the maximum
+ signed value representable in M; `us_plus' saturates at the
+ maximum unsigned value.
+
+`(lo_sum:M X Y)'
+ This expression represents the sum of X and the low-order bits of
+ Y. It is used with `high' (*note Constants::) to represent the
+ typical two-instruction sequence used in RISC machines to
+ reference a global memory location.
+
+ The number of low order bits is machine-dependent but is normally
+ the number of bits in a `Pmode' item minus the number of bits set
+ by `high'.
+
+ M should be `Pmode'.
+
+`(minus:M X Y)'
+`(ss_minus:M X Y)'
+`(us_minus:M X Y)'
+ These three expressions represent the result of subtracting Y from
+ X, carried out in mode M. Behavior on overflow is the same as for
+ the three variants of `plus' (see above).
+
+`(compare:M X Y)'
+ Represents the result of subtracting Y from X for purposes of
+ comparison. The result is computed without overflow, as if with
+ infinite precision.
+
+ Of course, machines can't really subtract with infinite precision.
+ However, they can pretend to do so when only the sign of the
+ result will be used, which is the case when the result is stored
+ in the condition code. And that is the _only_ way this kind of
+ expression may validly be used: as a value to be stored in the
+ condition codes, either `(cc0)' or a register. *Note
+ Comparisons::.
+
+ The mode M is not related to the modes of X and Y, but instead is
+ the mode of the condition code value. If `(cc0)' is used, it is
+ `VOIDmode'. Otherwise it is some mode in class `MODE_CC', often
+ `CCmode'. *Note Condition Code::. If M is `VOIDmode' or
+ `CCmode', the operation returns sufficient information (in an
+ unspecified format) so that any comparison operator can be applied
+ to the result of the `COMPARE' operation. For other modes in
+ class `MODE_CC', the operation only returns a subset of this
+ information.
+
+ Normally, X and Y must have the same mode. Otherwise, `compare'
+ is valid only if the mode of X is in class `MODE_INT' and Y is a
+ `const_int' or `const_double' with mode `VOIDmode'. The mode of X
+ determines what mode the comparison is to be done in; thus it must
+ not be `VOIDmode'.
+
+ If one of the operands is a constant, it should be placed in the
+ second operand and the comparison code adjusted as appropriate.
+
+ A `compare' specifying two `VOIDmode' constants is not valid since
+ there is no way to know in what mode the comparison is to be
+ performed; the comparison must either be folded during the
+ compilation or the first operand must be loaded into a register
+ while its mode is still known.
+
+`(neg:M X)'
+`(ss_neg:M X)'
+`(us_neg:M X)'
+ These two expressions represent the negation (subtraction from
+ zero) of the value represented by X, carried out in mode M. They
+ differ in the behavior on overflow of integer modes. In the case
+ of `neg', the negation of the operand may be a number not
+ representable in mode M, in which case it is truncated to M.
+ `ss_neg' and `us_neg' ensure that an out-of-bounds result
+ saturates to the maximum or minimum signed or unsigned value.
+
+`(mult:M X Y)'
+`(ss_mult:M X Y)'
+`(us_mult:M X Y)'
+ Represents the signed product of the values represented by X and Y
+ carried out in machine mode M. `ss_mult' and `us_mult' ensure
+ that an out-of-bounds result saturates to the maximum or minimum
+ signed or unsigned value.
+
+ Some machines support a multiplication that generates a product
+ wider than the operands. Write the pattern for this as
+
+ (mult:M (sign_extend:M X) (sign_extend:M Y))
+
+ where M is wider than the modes of X and Y, which need not be the
+ same.
+
+ For unsigned widening multiplication, use the same idiom, but with
+ `zero_extend' instead of `sign_extend'.
+
+`(div:M X Y)'
+`(ss_div:M X Y)'
+ Represents the quotient in signed division of X by Y, carried out
+ in machine mode M. If M is a floating point mode, it represents
+ the exact quotient; otherwise, the integerized quotient. `ss_div'
+ ensures that an out-of-bounds result saturates to the maximum or
+ minimum signed value.
+
+ Some machines have division instructions in which the operands and
+ quotient widths are not all the same; you should represent such
+ instructions using `truncate' and `sign_extend' as in,
+
+ (truncate:M1 (div:M2 X (sign_extend:M2 Y)))
+
+`(udiv:M X Y)'
+`(us_div:M X Y)'
+ Like `div' but represents unsigned division. `us_div' ensures
+ that an out-of-bounds result saturates to the maximum or minimum
+ unsigned value.
+
+`(mod:M X Y)'
+`(umod:M X Y)'
+ Like `div' and `udiv' but represent the remainder instead of the
+ quotient.
+
+`(smin:M X Y)'
+`(smax:M X Y)'
+ Represents the smaller (for `smin') or larger (for `smax') of X
+ and Y, interpreted as signed values in mode M. When used with
+ floating point, if both operands are zeros, or if either operand
+ is `NaN', then it is unspecified which of the two operands is
+ returned as the result.
+
+`(umin:M X Y)'
+`(umax:M X Y)'
+ Like `smin' and `smax', but the values are interpreted as unsigned
+ integers.
+
+`(not:M X)'
+ Represents the bitwise complement of the value represented by X,
+ carried out in mode M, which must be a fixed-point machine mode.
+
+`(and:M X Y)'
+ Represents the bitwise logical-and of the values represented by X
+ and Y, carried out in machine mode M, which must be a fixed-point
+ machine mode.
+
+`(ior:M X Y)'
+ Represents the bitwise inclusive-or of the values represented by X
+ and Y, carried out in machine mode M, which must be a fixed-point
+ mode.
+
+`(xor:M X Y)'
+ Represents the bitwise exclusive-or of the values represented by X
+ and Y, carried out in machine mode M, which must be a fixed-point
+ mode.
+
+`(ashift:M X C)'
+`(ss_ashift:M X C)'
+`(us_ashift:M X C)'
+ These three expressions represent the result of arithmetically
+ shifting X left by C places. They differ in their behavior on
+ overflow of integer modes. An `ashift' operation is a plain shift
+ with no special behavior in case of a change in the sign bit;
+ `ss_ashift' and `us_ashift' saturates to the minimum or maximum
+ representable value if any of the bits shifted out differs from
+ the final sign bit.
+
+ X have mode M, a fixed-point machine mode. C be a fixed-point
+ mode or be a constant with mode `VOIDmode'; which mode is
+ determined by the mode called for in the machine description entry
+ for the left-shift instruction. For example, on the VAX, the mode
+ of C is `QImode' regardless of M.
+
+`(lshiftrt:M X C)'
+`(ashiftrt:M X C)'
+ Like `ashift' but for right shift. Unlike the case for left shift,
+ these two operations are distinct.
+
+`(rotate:M X C)'
+`(rotatert:M X C)'
+ Similar but represent left and right rotate. If C is a constant,
+ use `rotate'.
+
+`(abs:M X)'
+ Represents the absolute value of X, computed in mode M.
+
+`(sqrt:M X)'
+ Represents the square root of X, computed in mode M. Most often M
+ will be a floating point mode.
+
+`(ffs:M X)'
+ Represents one plus the index of the least significant 1-bit in X,
+ represented as an integer of mode M. (The value is zero if X is
+ zero.) The mode of X need not be M; depending on the target
+ machine, various mode combinations may be valid.
+
+`(clz:M X)'
+ Represents the number of leading 0-bits in X, represented as an
+ integer of mode M, starting at the most significant bit position.
+ If X is zero, the value is determined by
+ `CLZ_DEFINED_VALUE_AT_ZERO' (*note Misc::). Note that this is one
+ of the few expressions that is not invariant under widening. The
+ mode of X will usually be an integer mode.
+
+`(ctz:M X)'
+ Represents the number of trailing 0-bits in X, represented as an
+ integer of mode M, starting at the least significant bit position.
+ If X is zero, the value is determined by
+ `CTZ_DEFINED_VALUE_AT_ZERO' (*note Misc::). Except for this case,
+ `ctz(x)' is equivalent to `ffs(X) - 1'. The mode of X will
+ usually be an integer mode.
+
+`(popcount:M X)'
+ Represents the number of 1-bits in X, represented as an integer of
+ mode M. The mode of X will usually be an integer mode.
+
+`(parity:M X)'
+ Represents the number of 1-bits modulo 2 in X, represented as an
+ integer of mode M. The mode of X will usually be an integer mode.
+
+`(bswap:M X)'
+ Represents the value X with the order of bytes reversed, carried
+ out in mode M, which must be a fixed-point machine mode.
+
+
+File: gccint.info, Node: Comparisons, Next: Bit-Fields, Prev: Arithmetic, Up: RTL
+
+10.10 Comparison Operations
+===========================
+
+Comparison operators test a relation on two operands and are considered
+to represent a machine-dependent nonzero value described by, but not
+necessarily equal to, `STORE_FLAG_VALUE' (*note Misc::) if the relation
+holds, or zero if it does not, for comparison operators whose results
+have a `MODE_INT' mode, `FLOAT_STORE_FLAG_VALUE' (*note Misc::) if the
+relation holds, or zero if it does not, for comparison operators that
+return floating-point values, and a vector of either
+`VECTOR_STORE_FLAG_VALUE' (*note Misc::) if the relation holds, or of
+zeros if it does not, for comparison operators that return vector
+results. The mode of the comparison operation is independent of the
+mode of the data being compared. If the comparison operation is being
+tested (e.g., the first operand of an `if_then_else'), the mode must be
+`VOIDmode'.
+
+ There are two ways that comparison operations may be used. The
+comparison operators may be used to compare the condition codes `(cc0)'
+against zero, as in `(eq (cc0) (const_int 0))'. Such a construct
+actually refers to the result of the preceding instruction in which the
+condition codes were set. The instruction setting the condition code
+must be adjacent to the instruction using the condition code; only
+`note' insns may separate them.
+
+ Alternatively, a comparison operation may directly compare two data
+objects. The mode of the comparison is determined by the operands; they
+must both be valid for a common machine mode. A comparison with both
+operands constant would be invalid as the machine mode could not be
+deduced from it, but such a comparison should never exist in RTL due to
+constant folding.
+
+ In the example above, if `(cc0)' were last set to `(compare X Y)', the
+comparison operation is identical to `(eq X Y)'. Usually only one style
+of comparisons is supported on a particular machine, but the combine
+pass will try to merge the operations to produce the `eq' shown in case
+it exists in the context of the particular insn involved.
+
+ Inequality comparisons come in two flavors, signed and unsigned. Thus,
+there are distinct expression codes `gt' and `gtu' for signed and
+unsigned greater-than. These can produce different results for the same
+pair of integer values: for example, 1 is signed greater-than -1 but not
+unsigned greater-than, because -1 when regarded as unsigned is actually
+`0xffffffff' which is greater than 1.
+
+ The signed comparisons are also used for floating point values.
+Floating point comparisons are distinguished by the machine modes of
+the operands.
+
+`(eq:M X Y)'
+ `STORE_FLAG_VALUE' if the values represented by X and Y are equal,
+ otherwise 0.
+
+`(ne:M X Y)'
+ `STORE_FLAG_VALUE' if the values represented by X and Y are not
+ equal, otherwise 0.
+
+`(gt:M X Y)'
+ `STORE_FLAG_VALUE' if the X is greater than Y. If they are
+ fixed-point, the comparison is done in a signed sense.
+
+`(gtu:M X Y)'
+ Like `gt' but does unsigned comparison, on fixed-point numbers
+ only.
+
+`(lt:M X Y)'
+`(ltu:M X Y)'
+ Like `gt' and `gtu' but test for "less than".
+
+`(ge:M X Y)'
+`(geu:M X Y)'
+ Like `gt' and `gtu' but test for "greater than or equal".
+
+`(le:M X Y)'
+`(leu:M X Y)'
+ Like `gt' and `gtu' but test for "less than or equal".
+
+`(if_then_else COND THEN ELSE)'
+ This is not a comparison operation but is listed here because it is
+ always used in conjunction with a comparison operation. To be
+ precise, COND is a comparison expression. This expression
+ represents a choice, according to COND, between the value
+ represented by THEN and the one represented by ELSE.
+
+ On most machines, `if_then_else' expressions are valid only to
+ express conditional jumps.
+
+`(cond [TEST1 VALUE1 TEST2 VALUE2 ...] DEFAULT)'
+ Similar to `if_then_else', but more general. Each of TEST1,
+ TEST2, ... is performed in turn. The result of this expression is
+ the VALUE corresponding to the first nonzero test, or DEFAULT if
+ none of the tests are nonzero expressions.
+
+ This is currently not valid for instruction patterns and is
+ supported only for insn attributes. *Note Insn Attributes::.
+
+
+File: gccint.info, Node: Bit-Fields, Next: Vector Operations, Prev: Comparisons, Up: RTL
+
+10.11 Bit-Fields
+================
+
+Special expression codes exist to represent bit-field instructions.
+
+`(sign_extract:M LOC SIZE POS)'
+ This represents a reference to a sign-extended bit-field contained
+ or starting in LOC (a memory or register reference). The bit-field
+ is SIZE bits wide and starts at bit POS. The compilation option
+ `BITS_BIG_ENDIAN' says which end of the memory unit POS counts
+ from.
+
+ If LOC is in memory, its mode must be a single-byte integer mode.
+ If LOC is in a register, the mode to use is specified by the
+ operand of the `insv' or `extv' pattern (*note Standard Names::)
+ and is usually a full-word integer mode, which is the default if
+ none is specified.
+
+ The mode of POS is machine-specific and is also specified in the
+ `insv' or `extv' pattern.
+
+ The mode M is the same as the mode that would be used for LOC if
+ it were a register.
+
+ A `sign_extract' can not appear as an lvalue, or part thereof, in
+ RTL.
+
+`(zero_extract:M LOC SIZE POS)'
+ Like `sign_extract' but refers to an unsigned or zero-extended
+ bit-field. The same sequence of bits are extracted, but they are
+ filled to an entire word with zeros instead of by sign-extension.
+
+ Unlike `sign_extract', this type of expressions can be lvalues in
+ RTL; they may appear on the left side of an assignment, indicating
+ insertion of a value into the specified bit-field.
+
+
+File: gccint.info, Node: Vector Operations, Next: Conversions, Prev: Bit-Fields, Up: RTL
+
+10.12 Vector Operations
+=======================
+
+All normal RTL expressions can be used with vector modes; they are
+interpreted as operating on each part of the vector independently.
+Additionally, there are a few new expressions to describe specific
+vector operations.
+
+`(vec_merge:M VEC1 VEC2 ITEMS)'
+ This describes a merge operation between two vectors. The result
+ is a vector of mode M; its elements are selected from either VEC1
+ or VEC2. Which elements are selected is described by ITEMS, which
+ is a bit mask represented by a `const_int'; a zero bit indicates
+ the corresponding element in the result vector is taken from VEC2
+ while a set bit indicates it is taken from VEC1.
+
+`(vec_select:M VEC1 SELECTION)'
+ This describes an operation that selects parts of a vector. VEC1
+ is the source vector, SELECTION is a `parallel' that contains a
+ `const_int' for each of the subparts of the result vector, giving
+ the number of the source subpart that should be stored into it.
+
+`(vec_concat:M VEC1 VEC2)'
+ Describes a vector concat operation. The result is a
+ concatenation of the vectors VEC1 and VEC2; its length is the sum
+ of the lengths of the two inputs.
+
+`(vec_duplicate:M VEC)'
+ This operation converts a small vector into a larger one by
+ duplicating the input values. The output vector mode must have
+ the same submodes as the input vector mode, and the number of
+ output parts must be an integer multiple of the number of input
+ parts.
+
+
+
+File: gccint.info, Node: Conversions, Next: RTL Declarations, Prev: Vector Operations, Up: RTL
+
+10.13 Conversions
+=================
+
+All conversions between machine modes must be represented by explicit
+conversion operations. For example, an expression which is the sum of
+a byte and a full word cannot be written as `(plus:SI (reg:QI 34)
+(reg:SI 80))' because the `plus' operation requires two operands of the
+same machine mode. Therefore, the byte-sized operand is enclosed in a
+conversion operation, as in
+
+ (plus:SI (sign_extend:SI (reg:QI 34)) (reg:SI 80))
+
+ The conversion operation is not a mere placeholder, because there may
+be more than one way of converting from a given starting mode to the
+desired final mode. The conversion operation code says how to do it.
+
+ For all conversion operations, X must not be `VOIDmode' because the
+mode in which to do the conversion would not be known. The conversion
+must either be done at compile-time or X must be placed into a register.
+
+`(sign_extend:M X)'
+ Represents the result of sign-extending the value X to machine
+ mode M. M must be a fixed-point mode and X a fixed-point value of
+ a mode narrower than M.
+
+`(zero_extend:M X)'
+ Represents the result of zero-extending the value X to machine
+ mode M. M must be a fixed-point mode and X a fixed-point value of
+ a mode narrower than M.
+
+`(float_extend:M X)'
+ Represents the result of extending the value X to machine mode M.
+ M must be a floating point mode and X a floating point value of a
+ mode narrower than M.
+
+`(truncate:M X)'
+ Represents the result of truncating the value X to machine mode M.
+ M must be a fixed-point mode and X a fixed-point value of a mode
+ wider than M.
+
+`(ss_truncate:M X)'
+ Represents the result of truncating the value X to machine mode M,
+ using signed saturation in the case of overflow. Both M and the
+ mode of X must be fixed-point modes.
+
+`(us_truncate:M X)'
+ Represents the result of truncating the value X to machine mode M,
+ using unsigned saturation in the case of overflow. Both M and the
+ mode of X must be fixed-point modes.
+
+`(float_truncate:M X)'
+ Represents the result of truncating the value X to machine mode M.
+ M must be a floating point mode and X a floating point value of a
+ mode wider than M.
+
+`(float:M X)'
+ Represents the result of converting fixed point value X, regarded
+ as signed, to floating point mode M.
+
+`(unsigned_float:M X)'
+ Represents the result of converting fixed point value X, regarded
+ as unsigned, to floating point mode M.
+
+`(fix:M X)'
+ When M is a floating-point mode, represents the result of
+ converting floating point value X (valid for mode M) to an
+ integer, still represented in floating point mode M, by rounding
+ towards zero.
+
+ When M is a fixed-point mode, represents the result of converting
+ floating point value X to mode M, regarded as signed. How
+ rounding is done is not specified, so this operation may be used
+ validly in compiling C code only for integer-valued operands.
+
+`(unsigned_fix:M X)'
+ Represents the result of converting floating point value X to
+ fixed point mode M, regarded as unsigned. How rounding is done is
+ not specified.
+
+`(fract_convert:M X)'
+ Represents the result of converting fixed-point value X to
+ fixed-point mode M, signed integer value X to fixed-point mode M,
+ floating-point value X to fixed-point mode M, fixed-point value X
+ to integer mode M regarded as signed, or fixed-point value X to
+ floating-point mode M. When overflows or underflows happen, the
+ results are undefined.
+
+`(sat_fract:M X)'
+ Represents the result of converting fixed-point value X to
+ fixed-point mode M, signed integer value X to fixed-point mode M,
+ or floating-point value X to fixed-point mode M. When overflows
+ or underflows happen, the results are saturated to the maximum or
+ the minimum.
+
+`(unsigned_fract_convert:M X)'
+ Represents the result of converting fixed-point value X to integer
+ mode M regarded as unsigned, or unsigned integer value X to
+ fixed-point mode M. When overflows or underflows happen, the
+ results are undefined.
+
+`(unsigned_sat_fract:M X)'
+ Represents the result of converting unsigned integer value X to
+ fixed-point mode M. When overflows or underflows happen, the
+ results are saturated to the maximum or the minimum.
+
+
+File: gccint.info, Node: RTL Declarations, Next: Side Effects, Prev: Conversions, Up: RTL
+
+10.14 Declarations
+==================
+
+Declaration expression codes do not represent arithmetic operations but
+rather state assertions about their operands.
+
+`(strict_low_part (subreg:M (reg:N R) 0))'
+ This expression code is used in only one context: as the
+ destination operand of a `set' expression. In addition, the
+ operand of this expression must be a non-paradoxical `subreg'
+ expression.
+
+ The presence of `strict_low_part' says that the part of the
+ register which is meaningful in mode N, but is not part of mode M,
+ is not to be altered. Normally, an assignment to such a subreg is
+ allowed to have undefined effects on the rest of the register when
+ M is less than a word.
+
+
+File: gccint.info, Node: Side Effects, Next: Incdec, Prev: RTL Declarations, Up: RTL
+
+10.15 Side Effect Expressions
+=============================
+
+The expression codes described so far represent values, not actions.
+But machine instructions never produce values; they are meaningful only
+for their side effects on the state of the machine. Special expression
+codes are used to represent side effects.
+
+ The body of an instruction is always one of these side effect codes;
+the codes described above, which represent values, appear only as the
+operands of these.
+
+`(set LVAL X)'
+ Represents the action of storing the value of X into the place
+ represented by LVAL. LVAL must be an expression representing a
+ place that can be stored in: `reg' (or `subreg', `strict_low_part'
+ or `zero_extract'), `mem', `pc', `parallel', or `cc0'.
+
+ If LVAL is a `reg', `subreg' or `mem', it has a machine mode; then
+ X must be valid for that mode.
+
+ If LVAL is a `reg' whose machine mode is less than the full width
+ of the register, then it means that the part of the register
+ specified by the machine mode is given the specified value and the
+ rest of the register receives an undefined value. Likewise, if
+ LVAL is a `subreg' whose machine mode is narrower than the mode of
+ the register, the rest of the register can be changed in an
+ undefined way.
+
+ If LVAL is a `strict_low_part' of a subreg, then the part of the
+ register specified by the machine mode of the `subreg' is given
+ the value X and the rest of the register is not changed.
+
+ If LVAL is a `zero_extract', then the referenced part of the
+ bit-field (a memory or register reference) specified by the
+ `zero_extract' is given the value X and the rest of the bit-field
+ is not changed. Note that `sign_extract' can not appear in LVAL.
+
+ If LVAL is `(cc0)', it has no machine mode, and X may be either a
+ `compare' expression or a value that may have any mode. The
+ latter case represents a "test" instruction. The expression `(set
+ (cc0) (reg:M N))' is equivalent to `(set (cc0) (compare (reg:M N)
+ (const_int 0)))'. Use the former expression to save space during
+ the compilation.
+
+ If LVAL is a `parallel', it is used to represent the case of a
+ function returning a structure in multiple registers. Each element
+ of the `parallel' is an `expr_list' whose first operand is a `reg'
+ and whose second operand is a `const_int' representing the offset
+ (in bytes) into the structure at which the data in that register
+ corresponds. The first element may be null to indicate that the
+ structure is also passed partly in memory.
+
+ If LVAL is `(pc)', we have a jump instruction, and the
+ possibilities for X are very limited. It may be a `label_ref'
+ expression (unconditional jump). It may be an `if_then_else'
+ (conditional jump), in which case either the second or the third
+ operand must be `(pc)' (for the case which does not jump) and the
+ other of the two must be a `label_ref' (for the case which does
+ jump). X may also be a `mem' or `(plus:SI (pc) Y)', where Y may
+ be a `reg' or a `mem'; these unusual patterns are used to
+ represent jumps through branch tables.
+
+ If LVAL is neither `(cc0)' nor `(pc)', the mode of LVAL must not
+ be `VOIDmode' and the mode of X must be valid for the mode of LVAL.
+
+ LVAL is customarily accessed with the `SET_DEST' macro and X with
+ the `SET_SRC' macro.
+
+`(return)'
+ As the sole expression in a pattern, represents a return from the
+ current function, on machines where this can be done with one
+ instruction, such as VAXen. On machines where a multi-instruction
+ "epilogue" must be executed in order to return from the function,
+ returning is done by jumping to a label which precedes the
+ epilogue, and the `return' expression code is never used.
+
+ Inside an `if_then_else' expression, represents the value to be
+ placed in `pc' to return to the caller.
+
+ Note that an insn pattern of `(return)' is logically equivalent to
+ `(set (pc) (return))', but the latter form is never used.
+
+`(call FUNCTION NARGS)'
+ Represents a function call. FUNCTION is a `mem' expression whose
+ address is the address of the function to be called. NARGS is an
+ expression which can be used for two purposes: on some machines it
+ represents the number of bytes of stack argument; on others, it
+ represents the number of argument registers.
+
+ Each machine has a standard machine mode which FUNCTION must have.
+ The machine description defines macro `FUNCTION_MODE' to expand
+ into the requisite mode name. The purpose of this mode is to
+ specify what kind of addressing is allowed, on machines where the
+ allowed kinds of addressing depend on the machine mode being
+ addressed.
+
+`(clobber X)'
+ Represents the storing or possible storing of an unpredictable,
+ undescribed value into X, which must be a `reg', `scratch',
+ `parallel' or `mem' expression.
+
+ One place this is used is in string instructions that store
+ standard values into particular hard registers. It may not be
+ worth the trouble to describe the values that are stored, but it
+ is essential to inform the compiler that the registers will be
+ altered, lest it attempt to keep data in them across the string
+ instruction.
+
+ If X is `(mem:BLK (const_int 0))' or `(mem:BLK (scratch))', it
+ means that all memory locations must be presumed clobbered. If X
+ is a `parallel', it has the same meaning as a `parallel' in a
+ `set' expression.
+
+ Note that the machine description classifies certain hard
+ registers as "call-clobbered". All function call instructions are
+ assumed by default to clobber these registers, so there is no need
+ to use `clobber' expressions to indicate this fact. Also, each
+ function call is assumed to have the potential to alter any memory
+ location, unless the function is declared `const'.
+
+ If the last group of expressions in a `parallel' are each a
+ `clobber' expression whose arguments are `reg' or `match_scratch'
+ (*note RTL Template::) expressions, the combiner phase can add the
+ appropriate `clobber' expressions to an insn it has constructed
+ when doing so will cause a pattern to be matched.
+
+ This feature can be used, for example, on a machine that whose
+ multiply and add instructions don't use an MQ register but which
+ has an add-accumulate instruction that does clobber the MQ
+ register. Similarly, a combined instruction might require a
+ temporary register while the constituent instructions might not.
+
+ When a `clobber' expression for a register appears inside a
+ `parallel' with other side effects, the register allocator
+ guarantees that the register is unoccupied both before and after
+ that insn if it is a hard register clobber. For pseudo-register
+ clobber, the register allocator and the reload pass do not assign
+ the same hard register to the clobber and the input operands if
+ there is an insn alternative containing the `&' constraint (*note
+ Modifiers::) for the clobber and the hard register is in register
+ classes of the clobber in the alternative. You can clobber either
+ a specific hard register, a pseudo register, or a `scratch'
+ expression; in the latter two cases, GCC will allocate a hard
+ register that is available there for use as a temporary.
+
+ For instructions that require a temporary register, you should use
+ `scratch' instead of a pseudo-register because this will allow the
+ combiner phase to add the `clobber' when required. You do this by
+ coding (`clobber' (`match_scratch' ...)). If you do clobber a
+ pseudo register, use one which appears nowhere else--generate a
+ new one each time. Otherwise, you may confuse CSE.
+
+ There is one other known use for clobbering a pseudo register in a
+ `parallel': when one of the input operands of the insn is also
+ clobbered by the insn. In this case, using the same pseudo
+ register in the clobber and elsewhere in the insn produces the
+ expected results.
+
+`(use X)'
+ Represents the use of the value of X. It indicates that the value
+ in X at this point in the program is needed, even though it may
+ not be apparent why this is so. Therefore, the compiler will not
+ attempt to delete previous instructions whose only effect is to
+ store a value in X. X must be a `reg' expression.
+
+ In some situations, it may be tempting to add a `use' of a
+ register in a `parallel' to describe a situation where the value
+ of a special register will modify the behavior of the instruction.
+ An hypothetical example might be a pattern for an addition that can
+ either wrap around or use saturating addition depending on the
+ value of a special control register:
+
+ (parallel [(set (reg:SI 2) (unspec:SI [(reg:SI 3)
+ (reg:SI 4)] 0))
+ (use (reg:SI 1))])
+
+ This will not work, several of the optimizers only look at
+ expressions locally; it is very likely that if you have multiple
+ insns with identical inputs to the `unspec', they will be
+ optimized away even if register 1 changes in between.
+
+ This means that `use' can _only_ be used to describe that the
+ register is live. You should think twice before adding `use'
+ statements, more often you will want to use `unspec' instead. The
+ `use' RTX is most commonly useful to describe that a fixed
+ register is implicitly used in an insn. It is also safe to use in
+ patterns where the compiler knows for other reasons that the result
+ of the whole pattern is variable, such as `movmemM' or `call'
+ patterns.
+
+ During the reload phase, an insn that has a `use' as pattern can
+ carry a reg_equal note. These `use' insns will be deleted before
+ the reload phase exits.
+
+ During the delayed branch scheduling phase, X may be an insn.
+ This indicates that X previously was located at this place in the
+ code and its data dependencies need to be taken into account.
+ These `use' insns will be deleted before the delayed branch
+ scheduling phase exits.
+
+`(parallel [X0 X1 ...])'
+ Represents several side effects performed in parallel. The square
+ brackets stand for a vector; the operand of `parallel' is a vector
+ of expressions. X0, X1 and so on are individual side effect
+ expressions--expressions of code `set', `call', `return',
+ `clobber' or `use'.
+
+ "In parallel" means that first all the values used in the
+ individual side-effects are computed, and second all the actual
+ side-effects are performed. For example,
+
+ (parallel [(set (reg:SI 1) (mem:SI (reg:SI 1)))
+ (set (mem:SI (reg:SI 1)) (reg:SI 1))])
+
+ says unambiguously that the values of hard register 1 and the
+ memory location addressed by it are interchanged. In both places
+ where `(reg:SI 1)' appears as a memory address it refers to the
+ value in register 1 _before_ the execution of the insn.
+
+ It follows that it is _incorrect_ to use `parallel' and expect the
+ result of one `set' to be available for the next one. For
+ example, people sometimes attempt to represent a jump-if-zero
+ instruction this way:
+
+ (parallel [(set (cc0) (reg:SI 34))
+ (set (pc) (if_then_else
+ (eq (cc0) (const_int 0))
+ (label_ref ...)
+ (pc)))])
+
+ But this is incorrect, because it says that the jump condition
+ depends on the condition code value _before_ this instruction, not
+ on the new value that is set by this instruction.
+
+ Peephole optimization, which takes place together with final
+ assembly code output, can produce insns whose patterns consist of
+ a `parallel' whose elements are the operands needed to output the
+ resulting assembler code--often `reg', `mem' or constant
+ expressions. This would not be well-formed RTL at any other stage
+ in compilation, but it is ok then because no further optimization
+ remains to be done. However, the definition of the macro
+ `NOTICE_UPDATE_CC', if any, must deal with such insns if you
+ define any peephole optimizations.
+
+`(cond_exec [COND EXPR])'
+ Represents a conditionally executed expression. The EXPR is
+ executed only if the COND is nonzero. The COND expression must
+ not have side-effects, but the EXPR may very well have
+ side-effects.
+
+`(sequence [INSNS ...])'
+ Represents a sequence of insns. Each of the INSNS that appears in
+ the vector is suitable for appearing in the chain of insns, so it
+ must be an `insn', `jump_insn', `call_insn', `code_label',
+ `barrier' or `note'.
+
+ A `sequence' RTX is never placed in an actual insn during RTL
+ generation. It represents the sequence of insns that result from a
+ `define_expand' _before_ those insns are passed to `emit_insn' to
+ insert them in the chain of insns. When actually inserted, the
+ individual sub-insns are separated out and the `sequence' is
+ forgotten.
+
+ After delay-slot scheduling is completed, an insn and all the
+ insns that reside in its delay slots are grouped together into a
+ `sequence'. The insn requiring the delay slot is the first insn
+ in the vector; subsequent insns are to be placed in the delay slot.
+
+ `INSN_ANNULLED_BRANCH_P' is set on an insn in a delay slot to
+ indicate that a branch insn should be used that will conditionally
+ annul the effect of the insns in the delay slots. In such a case,
+ `INSN_FROM_TARGET_P' indicates that the insn is from the target of
+ the branch and should be executed only if the branch is taken;
+ otherwise the insn should be executed only if the branch is not
+ taken. *Note Delay Slots::.
+
+ These expression codes appear in place of a side effect, as the body of
+an insn, though strictly speaking they do not always describe side
+effects as such:
+
+`(asm_input S)'
+ Represents literal assembler code as described by the string S.
+
+`(unspec [OPERANDS ...] INDEX)'
+`(unspec_volatile [OPERANDS ...] INDEX)'
+ Represents a machine-specific operation on OPERANDS. INDEX
+ selects between multiple machine-specific operations.
+ `unspec_volatile' is used for volatile operations and operations
+ that may trap; `unspec' is used for other operations.
+
+ These codes may appear inside a `pattern' of an insn, inside a
+ `parallel', or inside an expression.
+
+`(addr_vec:M [LR0 LR1 ...])'
+ Represents a table of jump addresses. The vector elements LR0,
+ etc., are `label_ref' expressions. The mode M specifies how much
+ space is given to each address; normally M would be `Pmode'.
+
+`(addr_diff_vec:M BASE [LR0 LR1 ...] MIN MAX FLAGS)'
+ Represents a table of jump addresses expressed as offsets from
+ BASE. The vector elements LR0, etc., are `label_ref' expressions
+ and so is BASE. The mode M specifies how much space is given to
+ each address-difference. MIN and MAX are set up by branch
+ shortening and hold a label with a minimum and a maximum address,
+ respectively. FLAGS indicates the relative position of BASE, MIN
+ and MAX to the containing insn and of MIN and MAX to BASE. See
+ rtl.def for details.
+
+`(prefetch:M ADDR RW LOCALITY)'
+ Represents prefetch of memory at address ADDR. Operand RW is 1 if
+ the prefetch is for data to be written, 0 otherwise; targets that
+ do not support write prefetches should treat this as a normal
+ prefetch. Operand LOCALITY specifies the amount of temporal
+ locality; 0 if there is none or 1, 2, or 3 for increasing levels
+ of temporal locality; targets that do not support locality hints
+ should ignore this.
+
+ This insn is used to minimize cache-miss latency by moving data
+ into a cache before it is accessed. It should use only
+ non-faulting data prefetch instructions.
+
+
+File: gccint.info, Node: Incdec, Next: Assembler, Prev: Side Effects, Up: RTL
+
+10.16 Embedded Side-Effects on Addresses
+========================================
+
+Six special side-effect expression codes appear as memory addresses.
+
+`(pre_dec:M X)'
+ Represents the side effect of decrementing X by a standard amount
+ and represents also the value that X has after being decremented.
+ X must be a `reg' or `mem', but most machines allow only a `reg'.
+ M must be the machine mode for pointers on the machine in use.
+ The amount X is decremented by is the length in bytes of the
+ machine mode of the containing memory reference of which this
+ expression serves as the address. Here is an example of its use:
+
+ (mem:DF (pre_dec:SI (reg:SI 39)))
+
+ This says to decrement pseudo register 39 by the length of a
+ `DFmode' value and use the result to address a `DFmode' value.
+
+`(pre_inc:M X)'
+ Similar, but specifies incrementing X instead of decrementing it.
+
+`(post_dec:M X)'
+ Represents the same side effect as `pre_dec' but a different
+ value. The value represented here is the value X has before being
+ decremented.
+
+`(post_inc:M X)'
+ Similar, but specifies incrementing X instead of decrementing it.
+
+`(post_modify:M X Y)'
+ Represents the side effect of setting X to Y and represents X
+ before X is modified. X must be a `reg' or `mem', but most
+ machines allow only a `reg'. M must be the machine mode for
+ pointers on the machine in use.
+
+ The expression Y must be one of three forms: `(plus:M X Z)',
+ `(minus:M X Z)', or `(plus:M X I)', where Z is an index register
+ and I is a constant.
+
+ Here is an example of its use:
+
+ (mem:SF (post_modify:SI (reg:SI 42) (plus (reg:SI 42)
+ (reg:SI 48))))
+
+ This says to modify pseudo register 42 by adding the contents of
+ pseudo register 48 to it, after the use of what ever 42 points to.
+
+`(pre_modify:M X EXPR)'
+ Similar except side effects happen before the use.
+
+ These embedded side effect expressions must be used with care.
+Instruction patterns may not use them. Until the `flow' pass of the
+compiler, they may occur only to represent pushes onto the stack. The
+`flow' pass finds cases where registers are incremented or decremented
+in one instruction and used as an address shortly before or after;
+these cases are then transformed to use pre- or post-increment or
+-decrement.
+
+ If a register used as the operand of these expressions is used in
+another address in an insn, the original value of the register is used.
+Uses of the register outside of an address are not permitted within the
+same insn as a use in an embedded side effect expression because such
+insns behave differently on different machines and hence must be treated
+as ambiguous and disallowed.
+
+ An instruction that can be represented with an embedded side effect
+could also be represented using `parallel' containing an additional
+`set' to describe how the address register is altered. This is not
+done because machines that allow these operations at all typically
+allow them wherever a memory address is called for. Describing them as
+additional parallel stores would require doubling the number of entries
+in the machine description.
+
+
+File: gccint.info, Node: Assembler, Next: Insns, Prev: Incdec, Up: RTL
+
+10.17 Assembler Instructions as Expressions
+===========================================
+
+The RTX code `asm_operands' represents a value produced by a
+user-specified assembler instruction. It is used to represent an `asm'
+statement with arguments. An `asm' statement with a single output
+operand, like this:
+
+ asm ("foo %1,%2,%0" : "=a" (outputvar) : "g" (x + y), "di" (*z));
+
+is represented using a single `asm_operands' RTX which represents the
+value that is stored in `outputvar':
+
+ (set RTX-FOR-OUTPUTVAR
+ (asm_operands "foo %1,%2,%0" "a" 0
+ [RTX-FOR-ADDITION-RESULT RTX-FOR-*Z]
+ [(asm_input:M1 "g")
+ (asm_input:M2 "di")]))
+
+Here the operands of the `asm_operands' RTX are the assembler template
+string, the output-operand's constraint, the index-number of the output
+operand among the output operands specified, a vector of input operand
+RTX's, and a vector of input-operand modes and constraints. The mode
+M1 is the mode of the sum `x+y'; M2 is that of `*z'.
+
+ When an `asm' statement has multiple output values, its insn has
+several such `set' RTX's inside of a `parallel'. Each `set' contains a
+`asm_operands'; all of these share the same assembler template and
+vectors, but each contains the constraint for the respective output
+operand. They are also distinguished by the output-operand index
+number, which is 0, 1, ... for successive output operands.
+
+
+File: gccint.info, Node: Insns, Next: Calls, Prev: Assembler, Up: RTL
+
+10.18 Insns
+===========
+
+The RTL representation of the code for a function is a doubly-linked
+chain of objects called "insns". Insns are expressions with special
+codes that are used for no other purpose. Some insns are actual
+instructions; others represent dispatch tables for `switch' statements;
+others represent labels to jump to or various sorts of declarative
+information.
+
+ In addition to its own specific data, each insn must have a unique
+id-number that distinguishes it from all other insns in the current
+function (after delayed branch scheduling, copies of an insn with the
+same id-number may be present in multiple places in a function, but
+these copies will always be identical and will only appear inside a
+`sequence'), and chain pointers to the preceding and following insns.
+These three fields occupy the same position in every insn, independent
+of the expression code of the insn. They could be accessed with `XEXP'
+and `XINT', but instead three special macros are always used:
+
+`INSN_UID (I)'
+ Accesses the unique id of insn I.
+
+`PREV_INSN (I)'
+ Accesses the chain pointer to the insn preceding I. If I is the
+ first insn, this is a null pointer.
+
+`NEXT_INSN (I)'
+ Accesses the chain pointer to the insn following I. If I is the
+ last insn, this is a null pointer.
+
+ The first insn in the chain is obtained by calling `get_insns'; the
+last insn is the result of calling `get_last_insn'. Within the chain
+delimited by these insns, the `NEXT_INSN' and `PREV_INSN' pointers must
+always correspond: if INSN is not the first insn,
+
+ NEXT_INSN (PREV_INSN (INSN)) == INSN
+
+is always true and if INSN is not the last insn,
+
+ PREV_INSN (NEXT_INSN (INSN)) == INSN
+
+is always true.
+
+ After delay slot scheduling, some of the insns in the chain might be
+`sequence' expressions, which contain a vector of insns. The value of
+`NEXT_INSN' in all but the last of these insns is the next insn in the
+vector; the value of `NEXT_INSN' of the last insn in the vector is the
+same as the value of `NEXT_INSN' for the `sequence' in which it is
+contained. Similar rules apply for `PREV_INSN'.
+
+ This means that the above invariants are not necessarily true for insns
+inside `sequence' expressions. Specifically, if INSN is the first insn
+in a `sequence', `NEXT_INSN (PREV_INSN (INSN))' is the insn containing
+the `sequence' expression, as is the value of `PREV_INSN (NEXT_INSN
+(INSN))' if INSN is the last insn in the `sequence' expression. You
+can use these expressions to find the containing `sequence' expression.
+
+ Every insn has one of the following six expression codes:
+
+`insn'
+ The expression code `insn' is used for instructions that do not
+ jump and do not do function calls. `sequence' expressions are
+ always contained in insns with code `insn' even if one of those
+ insns should jump or do function calls.
+
+ Insns with code `insn' have four additional fields beyond the three
+ mandatory ones listed above. These four are described in a table
+ below.
+
+`jump_insn'
+ The expression code `jump_insn' is used for instructions that may
+ jump (or, more generally, may contain `label_ref' expressions to
+ which `pc' can be set in that instruction). If there is an
+ instruction to return from the current function, it is recorded as
+ a `jump_insn'.
+
+ `jump_insn' insns have the same extra fields as `insn' insns,
+ accessed in the same way and in addition contain a field
+ `JUMP_LABEL' which is defined once jump optimization has completed.
+
+ For simple conditional and unconditional jumps, this field contains
+ the `code_label' to which this insn will (possibly conditionally)
+ branch. In a more complex jump, `JUMP_LABEL' records one of the
+ labels that the insn refers to; other jump target labels are
+ recorded as `REG_LABEL_TARGET' notes. The exception is `addr_vec'
+ and `addr_diff_vec', where `JUMP_LABEL' is `NULL_RTX' and the only
+ way to find the labels is to scan the entire body of the insn.
+
+ Return insns count as jumps, but since they do not refer to any
+ labels, their `JUMP_LABEL' is `NULL_RTX'.
+
+`call_insn'
+ The expression code `call_insn' is used for instructions that may
+ do function calls. It is important to distinguish these
+ instructions because they imply that certain registers and memory
+ locations may be altered unpredictably.
+
+ `call_insn' insns have the same extra fields as `insn' insns,
+ accessed in the same way and in addition contain a field
+ `CALL_INSN_FUNCTION_USAGE', which contains a list (chain of
+ `expr_list' expressions) containing `use' and `clobber'
+ expressions that denote hard registers and `MEM's used or
+ clobbered by the called function.
+
+ A `MEM' generally points to a stack slots in which arguments passed
+ to the libcall by reference (*note TARGET_PASS_BY_REFERENCE:
+ Register Arguments.) are stored. If the argument is caller-copied
+ (*note TARGET_CALLEE_COPIES: Register Arguments.), the stack slot
+ will be mentioned in `CLOBBER' and `USE' entries; if it's
+ callee-copied, only a `USE' will appear, and the `MEM' may point
+ to addresses that are not stack slots.
+
+ `CLOBBER'ed registers in this list augment registers specified in
+ `CALL_USED_REGISTERS' (*note Register Basics::).
+
+`code_label'
+ A `code_label' insn represents a label that a jump insn can jump
+ to. It contains two special fields of data in addition to the
+ three standard ones. `CODE_LABEL_NUMBER' is used to hold the
+ "label number", a number that identifies this label uniquely among
+ all the labels in the compilation (not just in the current
+ function). Ultimately, the label is represented in the assembler
+ output as an assembler label, usually of the form `LN' where N is
+ the label number.
+
+ When a `code_label' appears in an RTL expression, it normally
+ appears within a `label_ref' which represents the address of the
+ label, as a number.
+
+ Besides as a `code_label', a label can also be represented as a
+ `note' of type `NOTE_INSN_DELETED_LABEL'.
+
+ The field `LABEL_NUSES' is only defined once the jump optimization
+ phase is completed. It contains the number of times this label is
+ referenced in the current function.
+
+ The field `LABEL_KIND' differentiates four different types of
+ labels: `LABEL_NORMAL', `LABEL_STATIC_ENTRY',
+ `LABEL_GLOBAL_ENTRY', and `LABEL_WEAK_ENTRY'. The only labels
+ that do not have type `LABEL_NORMAL' are "alternate entry points"
+ to the current function. These may be static (visible only in the
+ containing translation unit), global (exposed to all translation
+ units), or weak (global, but can be overridden by another symbol
+ with the same name).
+
+ Much of the compiler treats all four kinds of label identically.
+ Some of it needs to know whether or not a label is an alternate
+ entry point; for this purpose, the macro `LABEL_ALT_ENTRY_P' is
+ provided. It is equivalent to testing whether `LABEL_KIND (label)
+ == LABEL_NORMAL'. The only place that cares about the distinction
+ between static, global, and weak alternate entry points, besides
+ the front-end code that creates them, is the function
+ `output_alternate_entry_point', in `final.c'.
+
+ To set the kind of a label, use the `SET_LABEL_KIND' macro.
+
+`barrier'
+ Barriers are placed in the instruction stream when control cannot
+ flow past them. They are placed after unconditional jump
+ instructions to indicate that the jumps are unconditional and
+ after calls to `volatile' functions, which do not return (e.g.,
+ `exit'). They contain no information beyond the three standard
+ fields.
+
+`note'
+ `note' insns are used to represent additional debugging and
+ declarative information. They contain two nonstandard fields, an
+ integer which is accessed with the macro `NOTE_LINE_NUMBER' and a
+ string accessed with `NOTE_SOURCE_FILE'.
+
+ If `NOTE_LINE_NUMBER' is positive, the note represents the
+ position of a source line and `NOTE_SOURCE_FILE' is the source
+ file name that the line came from. These notes control generation
+ of line number data in the assembler output.
+
+ Otherwise, `NOTE_LINE_NUMBER' is not really a line number but a
+ code with one of the following values (and `NOTE_SOURCE_FILE' must
+ contain a null pointer):
+
+ `NOTE_INSN_DELETED'
+ Such a note is completely ignorable. Some passes of the
+ compiler delete insns by altering them into notes of this
+ kind.
+
+ `NOTE_INSN_DELETED_LABEL'
+ This marks what used to be a `code_label', but was not used
+ for other purposes than taking its address and was
+ transformed to mark that no code jumps to it.
+
+ `NOTE_INSN_BLOCK_BEG'
+ `NOTE_INSN_BLOCK_END'
+ These types of notes indicate the position of the beginning
+ and end of a level of scoping of variable names. They
+ control the output of debugging information.
+
+ `NOTE_INSN_EH_REGION_BEG'
+ `NOTE_INSN_EH_REGION_END'
+ These types of notes indicate the position of the beginning
+ and end of a level of scoping for exception handling.
+ `NOTE_BLOCK_NUMBER' identifies which `CODE_LABEL' or `note'
+ of type `NOTE_INSN_DELETED_LABEL' is associated with the
+ given region.
+
+ `NOTE_INSN_LOOP_BEG'
+ `NOTE_INSN_LOOP_END'
+ These types of notes indicate the position of the beginning
+ and end of a `while' or `for' loop. They enable the loop
+ optimizer to find loops quickly.
+
+ `NOTE_INSN_LOOP_CONT'
+ Appears at the place in a loop that `continue' statements
+ jump to.
+
+ `NOTE_INSN_LOOP_VTOP'
+ This note indicates the place in a loop where the exit test
+ begins for those loops in which the exit test has been
+ duplicated. This position becomes another virtual start of
+ the loop when considering loop invariants.
+
+ `NOTE_INSN_FUNCTION_BEG'
+ Appears at the start of the function body, after the function
+ prologue.
+
+
+ These codes are printed symbolically when they appear in debugging
+ dumps.
+
+ The machine mode of an insn is normally `VOIDmode', but some phases
+use the mode for various purposes.
+
+ The common subexpression elimination pass sets the mode of an insn to
+`QImode' when it is the first insn in a block that has already been
+processed.
+
+ The second Haifa scheduling pass, for targets that can multiple issue,
+sets the mode of an insn to `TImode' when it is believed that the
+instruction begins an issue group. That is, when the instruction
+cannot issue simultaneously with the previous. This may be relied on
+by later passes, in particular machine-dependent reorg.
+
+ Here is a table of the extra fields of `insn', `jump_insn' and
+`call_insn' insns:
+
+`PATTERN (I)'
+ An expression for the side effect performed by this insn. This
+ must be one of the following codes: `set', `call', `use',
+ `clobber', `return', `asm_input', `asm_output', `addr_vec',
+ `addr_diff_vec', `trap_if', `unspec', `unspec_volatile',
+ `parallel', `cond_exec', or `sequence'. If it is a `parallel',
+ each element of the `parallel' must be one these codes, except that
+ `parallel' expressions cannot be nested and `addr_vec' and
+ `addr_diff_vec' are not permitted inside a `parallel' expression.
+
+`INSN_CODE (I)'
+ An integer that says which pattern in the machine description
+ matches this insn, or -1 if the matching has not yet been
+ attempted.
+
+ Such matching is never attempted and this field remains -1 on an
+ insn whose pattern consists of a single `use', `clobber',
+ `asm_input', `addr_vec' or `addr_diff_vec' expression.
+
+ Matching is also never attempted on insns that result from an `asm'
+ statement. These contain at least one `asm_operands' expression.
+ The function `asm_noperands' returns a non-negative value for such
+ insns.
+
+ In the debugging output, this field is printed as a number
+ followed by a symbolic representation that locates the pattern in
+ the `md' file as some small positive or negative offset from a
+ named pattern.
+
+`LOG_LINKS (I)'
+ A list (chain of `insn_list' expressions) giving information about
+ dependencies between instructions within a basic block. Neither a
+ jump nor a label may come between the related insns. These are
+ only used by the schedulers and by combine. This is a deprecated
+ data structure. Def-use and use-def chains are now preferred.
+
+`REG_NOTES (I)'
+ A list (chain of `expr_list' and `insn_list' expressions) giving
+ miscellaneous information about the insn. It is often information
+ pertaining to the registers used in this insn.
+
+ The `LOG_LINKS' field of an insn is a chain of `insn_list'
+expressions. Each of these has two operands: the first is an insn, and
+the second is another `insn_list' expression (the next one in the
+chain). The last `insn_list' in the chain has a null pointer as second
+operand. The significant thing about the chain is which insns appear
+in it (as first operands of `insn_list' expressions). Their order is
+not significant.
+
+ This list is originally set up by the flow analysis pass; it is a null
+pointer until then. Flow only adds links for those data dependencies
+which can be used for instruction combination. For each insn, the flow
+analysis pass adds a link to insns which store into registers values
+that are used for the first time in this insn.
+
+ The `REG_NOTES' field of an insn is a chain similar to the `LOG_LINKS'
+field but it includes `expr_list' expressions in addition to
+`insn_list' expressions. There are several kinds of register notes,
+which are distinguished by the machine mode, which in a register note
+is really understood as being an `enum reg_note'. The first operand OP
+of the note is data whose meaning depends on the kind of note.
+
+ The macro `REG_NOTE_KIND (X)' returns the kind of register note. Its
+counterpart, the macro `PUT_REG_NOTE_KIND (X, NEWKIND)' sets the
+register note type of X to be NEWKIND.
+
+ Register notes are of three classes: They may say something about an
+input to an insn, they may say something about an output of an insn, or
+they may create a linkage between two insns. There are also a set of
+values that are only used in `LOG_LINKS'.
+
+ These register notes annotate inputs to an insn:
+
+`REG_DEAD'
+ The value in OP dies in this insn; that is to say, altering the
+ value immediately after this insn would not affect the future
+ behavior of the program.
+
+ It does not follow that the register OP has no useful value after
+ this insn since OP is not necessarily modified by this insn.
+ Rather, no subsequent instruction uses the contents of OP.
+
+`REG_UNUSED'
+ The register OP being set by this insn will not be used in a
+ subsequent insn. This differs from a `REG_DEAD' note, which
+ indicates that the value in an input will not be used subsequently.
+ These two notes are independent; both may be present for the same
+ register.
+
+`REG_INC'
+ The register OP is incremented (or decremented; at this level
+ there is no distinction) by an embedded side effect inside this
+ insn. This means it appears in a `post_inc', `pre_inc',
+ `post_dec' or `pre_dec' expression.
+
+`REG_NONNEG'
+ The register OP is known to have a nonnegative value when this
+ insn is reached. This is used so that decrement and branch until
+ zero instructions, such as the m68k dbra, can be matched.
+
+ The `REG_NONNEG' note is added to insns only if the machine
+ description has a `decrement_and_branch_until_zero' pattern.
+
+`REG_LABEL_OPERAND'
+ This insn uses OP, a `code_label' or a `note' of type
+ `NOTE_INSN_DELETED_LABEL', but is not a `jump_insn', or it is a
+ `jump_insn' that refers to the operand as an ordinary operand.
+ The label may still eventually be a jump target, but if so in an
+ indirect jump in a subsequent insn. The presence of this note
+ allows jump optimization to be aware that OP is, in fact, being
+ used, and flow optimization to build an accurate flow graph.
+
+`REG_LABEL_TARGET'
+ This insn is a `jump_insn' but not a `addr_vec' or
+ `addr_diff_vec'. It uses OP, a `code_label' as a direct or
+ indirect jump target. Its purpose is similar to that of
+ `REG_LABEL_OPERAND'. This note is only present if the insn has
+ multiple targets; the last label in the insn (in the highest
+ numbered insn-field) goes into the `JUMP_LABEL' field and does not
+ have a `REG_LABEL_TARGET' note. *Note JUMP_LABEL: Insns.
+
+`REG_CROSSING_JUMP'
+ This insn is an branching instruction (either an unconditional
+ jump or an indirect jump) which crosses between hot and cold
+ sections, which could potentially be very far apart in the
+ executable. The presence of this note indicates to other
+ optimizations that this branching instruction should not be
+ "collapsed" into a simpler branching construct. It is used when
+ the optimization to partition basic blocks into hot and cold
+ sections is turned on.
+
+`REG_SETJMP'
+ Appears attached to each `CALL_INSN' to `setjmp' or a related
+ function.
+
+ The following notes describe attributes of outputs of an insn:
+
+`REG_EQUIV'
+`REG_EQUAL'
+ This note is only valid on an insn that sets only one register and
+ indicates that that register will be equal to OP at run time; the
+ scope of this equivalence differs between the two types of notes.
+ The value which the insn explicitly copies into the register may
+ look different from OP, but they will be equal at run time. If the
+ output of the single `set' is a `strict_low_part' expression, the
+ note refers to the register that is contained in `SUBREG_REG' of
+ the `subreg' expression.
+
+ For `REG_EQUIV', the register is equivalent to OP throughout the
+ entire function, and could validly be replaced in all its
+ occurrences by OP. ("Validly" here refers to the data flow of the
+ program; simple replacement may make some insns invalid.) For
+ example, when a constant is loaded into a register that is never
+ assigned any other value, this kind of note is used.
+
+ When a parameter is copied into a pseudo-register at entry to a
+ function, a note of this kind records that the register is
+ equivalent to the stack slot where the parameter was passed.
+ Although in this case the register may be set by other insns, it
+ is still valid to replace the register by the stack slot
+ throughout the function.
+
+ A `REG_EQUIV' note is also used on an instruction which copies a
+ register parameter into a pseudo-register at entry to a function,
+ if there is a stack slot where that parameter could be stored.
+ Although other insns may set the pseudo-register, it is valid for
+ the compiler to replace the pseudo-register by stack slot
+ throughout the function, provided the compiler ensures that the
+ stack slot is properly initialized by making the replacement in
+ the initial copy instruction as well. This is used on machines
+ for which the calling convention allocates stack space for
+ register parameters. See `REG_PARM_STACK_SPACE' in *Note Stack
+ Arguments::.
+
+ In the case of `REG_EQUAL', the register that is set by this insn
+ will be equal to OP at run time at the end of this insn but not
+ necessarily elsewhere in the function. In this case, OP is
+ typically an arithmetic expression. For example, when a sequence
+ of insns such as a library call is used to perform an arithmetic
+ operation, this kind of note is attached to the insn that produces
+ or copies the final value.
+
+ These two notes are used in different ways by the compiler passes.
+ `REG_EQUAL' is used by passes prior to register allocation (such as
+ common subexpression elimination and loop optimization) to tell
+ them how to think of that value. `REG_EQUIV' notes are used by
+ register allocation to indicate that there is an available
+ substitute expression (either a constant or a `mem' expression for
+ the location of a parameter on the stack) that may be used in
+ place of a register if insufficient registers are available.
+
+ Except for stack homes for parameters, which are indicated by a
+ `REG_EQUIV' note and are not useful to the early optimization
+ passes and pseudo registers that are equivalent to a memory
+ location throughout their entire life, which is not detected until
+ later in the compilation, all equivalences are initially indicated
+ by an attached `REG_EQUAL' note. In the early stages of register
+ allocation, a `REG_EQUAL' note is changed into a `REG_EQUIV' note
+ if OP is a constant and the insn represents the only set of its
+ destination register.
+
+ Thus, compiler passes prior to register allocation need only check
+ for `REG_EQUAL' notes and passes subsequent to register allocation
+ need only check for `REG_EQUIV' notes.
+
+ These notes describe linkages between insns. They occur in pairs: one
+insn has one of a pair of notes that points to a second insn, which has
+the inverse note pointing back to the first insn.
+
+`REG_CC_SETTER'
+`REG_CC_USER'
+ On machines that use `cc0', the insns which set and use `cc0' set
+ and use `cc0' are adjacent. However, when branch delay slot
+ filling is done, this may no longer be true. In this case a
+ `REG_CC_USER' note will be placed on the insn setting `cc0' to
+ point to the insn using `cc0' and a `REG_CC_SETTER' note will be
+ placed on the insn using `cc0' to point to the insn setting `cc0'.
+
+ These values are only used in the `LOG_LINKS' field, and indicate the
+type of dependency that each link represents. Links which indicate a
+data dependence (a read after write dependence) do not use any code,
+they simply have mode `VOIDmode', and are printed without any
+descriptive text.
+
+`REG_DEP_TRUE'
+ This indicates a true dependence (a read after write dependence).
+
+`REG_DEP_OUTPUT'
+ This indicates an output dependence (a write after write
+ dependence).
+
+`REG_DEP_ANTI'
+ This indicates an anti dependence (a write after read dependence).
+
+
+ These notes describe information gathered from gcov profile data. They
+are stored in the `REG_NOTES' field of an insn as an `expr_list'.
+
+`REG_BR_PROB'
+ This is used to specify the ratio of branches to non-branches of a
+ branch insn according to the profile data. The value is stored as
+ a value between 0 and REG_BR_PROB_BASE; larger values indicate a
+ higher probability that the branch will be taken.
+
+`REG_BR_PRED'
+ These notes are found in JUMP insns after delayed branch scheduling
+ has taken place. They indicate both the direction and the
+ likelihood of the JUMP. The format is a bitmask of ATTR_FLAG_*
+ values.
+
+`REG_FRAME_RELATED_EXPR'
+ This is used on an RTX_FRAME_RELATED_P insn wherein the attached
+ expression is used in place of the actual insn pattern. This is
+ done in cases where the pattern is either complex or misleading.
+
+ For convenience, the machine mode in an `insn_list' or `expr_list' is
+printed using these symbolic codes in debugging dumps.
+
+ The only difference between the expression codes `insn_list' and
+`expr_list' is that the first operand of an `insn_list' is assumed to
+be an insn and is printed in debugging dumps as the insn's unique id;
+the first operand of an `expr_list' is printed in the ordinary way as
+an expression.
+
+
+File: gccint.info, Node: Calls, Next: Sharing, Prev: Insns, Up: RTL
+
+10.19 RTL Representation of Function-Call Insns
+===============================================
+
+Insns that call subroutines have the RTL expression code `call_insn'.
+These insns must satisfy special rules, and their bodies must use a
+special RTL expression code, `call'.
+
+ A `call' expression has two operands, as follows:
+
+ (call (mem:FM ADDR) NBYTES)
+
+Here NBYTES is an operand that represents the number of bytes of
+argument data being passed to the subroutine, FM is a machine mode
+(which must equal as the definition of the `FUNCTION_MODE' macro in the
+machine description) and ADDR represents the address of the subroutine.
+
+ For a subroutine that returns no value, the `call' expression as shown
+above is the entire body of the insn, except that the insn might also
+contain `use' or `clobber' expressions.
+
+ For a subroutine that returns a value whose mode is not `BLKmode', the
+value is returned in a hard register. If this register's number is R,
+then the body of the call insn looks like this:
+
+ (set (reg:M R)
+ (call (mem:FM ADDR) NBYTES))
+
+This RTL expression makes it clear (to the optimizer passes) that the
+appropriate register receives a useful value in this insn.
+
+ When a subroutine returns a `BLKmode' value, it is handled by passing
+to the subroutine the address of a place to store the value. So the
+call insn itself does not "return" any value, and it has the same RTL
+form as a call that returns nothing.
+
+ On some machines, the call instruction itself clobbers some register,
+for example to contain the return address. `call_insn' insns on these
+machines should have a body which is a `parallel' that contains both
+the `call' expression and `clobber' expressions that indicate which
+registers are destroyed. Similarly, if the call instruction requires
+some register other than the stack pointer that is not explicitly
+mentioned in its RTL, a `use' subexpression should mention that
+register.
+
+ Functions that are called are assumed to modify all registers listed in
+the configuration macro `CALL_USED_REGISTERS' (*note Register Basics::)
+and, with the exception of `const' functions and library calls, to
+modify all of memory.
+
+ Insns containing just `use' expressions directly precede the
+`call_insn' insn to indicate which registers contain inputs to the
+function. Similarly, if registers other than those in
+`CALL_USED_REGISTERS' are clobbered by the called function, insns
+containing a single `clobber' follow immediately after the call to
+indicate which registers.
+
+
+File: gccint.info, Node: Sharing, Next: Reading RTL, Prev: Calls, Up: RTL
+
+10.20 Structure Sharing Assumptions
+===================================
+
+The compiler assumes that certain kinds of RTL expressions are unique;
+there do not exist two distinct objects representing the same value.
+In other cases, it makes an opposite assumption: that no RTL expression
+object of a certain kind appears in more than one place in the
+containing structure.
+
+ These assumptions refer to a single function; except for the RTL
+objects that describe global variables and external functions, and a
+few standard objects such as small integer constants, no RTL objects
+are common to two functions.
+
+ * Each pseudo-register has only a single `reg' object to represent
+ it, and therefore only a single machine mode.
+
+ * For any symbolic label, there is only one `symbol_ref' object
+ referring to it.
+
+ * All `const_int' expressions with equal values are shared.
+
+ * There is only one `pc' expression.
+
+ * There is only one `cc0' expression.
+
+ * There is only one `const_double' expression with value 0 for each
+ floating point mode. Likewise for values 1 and 2.
+
+ * There is only one `const_vector' expression with value 0 for each
+ vector mode, be it an integer or a double constant vector.
+
+ * No `label_ref' or `scratch' appears in more than one place in the
+ RTL structure; in other words, it is safe to do a tree-walk of all
+ the insns in the function and assume that each time a `label_ref'
+ or `scratch' is seen it is distinct from all others that are seen.
+
+ * Only one `mem' object is normally created for each static variable
+ or stack slot, so these objects are frequently shared in all the
+ places they appear. However, separate but equal objects for these
+ variables are occasionally made.
+
+ * When a single `asm' statement has multiple output operands, a
+ distinct `asm_operands' expression is made for each output operand.
+ However, these all share the vector which contains the sequence of
+ input operands. This sharing is used later on to test whether two
+ `asm_operands' expressions come from the same statement, so all
+ optimizations must carefully preserve the sharing if they copy the
+ vector at all.
+
+ * No RTL object appears in more than one place in the RTL structure
+ except as described above. Many passes of the compiler rely on
+ this by assuming that they can modify RTL objects in place without
+ unwanted side-effects on other insns.
+
+ * During initial RTL generation, shared structure is freely
+ introduced. After all the RTL for a function has been generated,
+ all shared structure is copied by `unshare_all_rtl' in
+ `emit-rtl.c', after which the above rules are guaranteed to be
+ followed.
+
+ * During the combiner pass, shared structure within an insn can exist
+ temporarily. However, the shared structure is copied before the
+ combiner is finished with the insn. This is done by calling
+ `copy_rtx_if_shared', which is a subroutine of `unshare_all_rtl'.
+
+
+File: gccint.info, Node: Reading RTL, Prev: Sharing, Up: RTL
+
+10.21 Reading RTL
+=================
+
+To read an RTL object from a file, call `read_rtx'. It takes one
+argument, a stdio stream, and returns a single RTL object. This routine
+is defined in `read-rtl.c'. It is not available in the compiler
+itself, only the various programs that generate the compiler back end
+from the machine description.
+
+ People frequently have the idea of using RTL stored as text in a file
+as an interface between a language front end and the bulk of GCC. This
+idea is not feasible.
+
+ GCC was designed to use RTL internally only. Correct RTL for a given
+program is very dependent on the particular target machine. And the RTL
+does not contain all the information about the program.
+
+ The proper way to interface GCC to a new language front end is with
+the "tree" data structure, described in the files `tree.h' and
+`tree.def'. The documentation for this structure (*note Trees::) is
+incomplete.
+
+
+File: gccint.info, Node: GENERIC, Next: GIMPLE, Prev: Trees, Up: Top
+
+11 GENERIC
+**********
+
+The purpose of GENERIC is simply to provide a language-independent way
+of representing an entire function in trees. To this end, it was
+necessary to add a few new tree codes to the back end, but most
+everything was already there. If you can express it with the codes in
+`gcc/tree.def', it's GENERIC.
+
+ Early on, there was a great deal of debate about how to think about
+statements in a tree IL. In GENERIC, a statement is defined as any
+expression whose value, if any, is ignored. A statement will always
+have `TREE_SIDE_EFFECTS' set (or it will be discarded), but a
+non-statement expression may also have side effects. A `CALL_EXPR',
+for instance.
+
+ It would be possible for some local optimizations to work on the
+GENERIC form of a function; indeed, the adapted tree inliner works fine
+on GENERIC, but the current compiler performs inlining after lowering
+to GIMPLE (a restricted form described in the next section). Indeed,
+currently the frontends perform this lowering before handing off to
+`tree_rest_of_compilation', but this seems inelegant.
+
+ If necessary, a front end can use some language-dependent tree codes
+in its GENERIC representation, so long as it provides a hook for
+converting them to GIMPLE and doesn't expect them to work with any
+(hypothetical) optimizers that run before the conversion to GIMPLE. The
+intermediate representation used while parsing C and C++ looks very
+little like GENERIC, but the C and C++ gimplifier hooks are perfectly
+happy to take it as input and spit out GIMPLE.
+
+* Menu:
+
+* Statements::
+
+
+File: gccint.info, Node: Statements, Up: GENERIC
+
+11.1 Statements
+===============
+
+Most statements in GIMPLE are assignment statements, represented by
+`GIMPLE_ASSIGN'. No other C expressions can appear at statement level;
+a reference to a volatile object is converted into a `GIMPLE_ASSIGN'.
+
+ There are also several varieties of complex statements.
+
+* Menu:
+
+* Blocks::
+* Statement Sequences::
+* Empty Statements::
+* Jumps::
+* Cleanups::
+
+
+File: gccint.info, Node: Blocks, Next: Statement Sequences, Up: Statements
+
+11.1.1 Blocks
+-------------
+
+Block scopes and the variables they declare in GENERIC are expressed
+using the `BIND_EXPR' code, which in previous versions of GCC was
+primarily used for the C statement-expression extension.
+
+ Variables in a block are collected into `BIND_EXPR_VARS' in
+declaration order. Any runtime initialization is moved out of
+`DECL_INITIAL' and into a statement in the controlled block. When
+gimplifying from C or C++, this initialization replaces the `DECL_STMT'.
+
+ Variable-length arrays (VLAs) complicate this process, as their size
+often refers to variables initialized earlier in the block. To handle
+this, we currently split the block at that point, and move the VLA into
+a new, inner `BIND_EXPR'. This strategy may change in the future.
+
+ A C++ program will usually contain more `BIND_EXPR's than there are
+syntactic blocks in the source code, since several C++ constructs have
+implicit scopes associated with them. On the other hand, although the
+C++ front end uses pseudo-scopes to handle cleanups for objects with
+destructors, these don't translate into the GIMPLE form; multiple
+declarations at the same level use the same `BIND_EXPR'.
+
+
+File: gccint.info, Node: Statement Sequences, Next: Empty Statements, Prev: Blocks, Up: Statements
+
+11.1.2 Statement Sequences
+--------------------------
+
+Multiple statements at the same nesting level are collected into a
+`STATEMENT_LIST'. Statement lists are modified and traversed using the
+interface in `tree-iterator.h'.
+
+
+File: gccint.info, Node: Empty Statements, Next: Jumps, Prev: Statement Sequences, Up: Statements
+
+11.1.3 Empty Statements
+-----------------------
+
+Whenever possible, statements with no effect are discarded. But if
+they are nested within another construct which cannot be discarded for
+some reason, they are instead replaced with an empty statement,
+generated by `build_empty_stmt'. Initially, all empty statements were
+shared, after the pattern of the Java front end, but this caused a lot
+of trouble in practice.
+
+ An empty statement is represented as `(void)0'.
+
+
+File: gccint.info, Node: Jumps, Next: Cleanups, Prev: Empty Statements, Up: Statements
+
+11.1.4 Jumps
+------------
+
+Other jumps are expressed by either `GOTO_EXPR' or `RETURN_EXPR'.
+
+ The operand of a `GOTO_EXPR' must be either a label or a variable
+containing the address to jump to.
+
+ The operand of a `RETURN_EXPR' is either `NULL_TREE', `RESULT_DECL',
+or a `MODIFY_EXPR' which sets the return value. It would be nice to
+move the `MODIFY_EXPR' into a separate statement, but the special
+return semantics in `expand_return' make that difficult. It may still
+happen in the future, perhaps by moving most of that logic into
+`expand_assignment'.
+
+
+File: gccint.info, Node: Cleanups, Prev: Jumps, Up: Statements
+
+11.1.5 Cleanups
+---------------
+
+Destructors for local C++ objects and similar dynamic cleanups are
+represented in GIMPLE by a `TRY_FINALLY_EXPR'. `TRY_FINALLY_EXPR' has
+two operands, both of which are a sequence of statements to execute.
+The first sequence is executed. When it completes the second sequence
+is executed.
+
+ The first sequence may complete in the following ways:
+
+ 1. Execute the last statement in the sequence and fall off the end.
+
+ 2. Execute a goto statement (`GOTO_EXPR') to an ordinary label
+ outside the sequence.
+
+ 3. Execute a return statement (`RETURN_EXPR').
+
+ 4. Throw an exception. This is currently not explicitly represented
+ in GIMPLE.
+
+
+ The second sequence is not executed if the first sequence completes by
+calling `setjmp' or `exit' or any other function that does not return.
+The second sequence is also not executed if the first sequence
+completes via a non-local goto or a computed goto (in general the
+compiler does not know whether such a goto statement exits the first
+sequence or not, so we assume that it doesn't).
+
+ After the second sequence is executed, if it completes normally by
+falling off the end, execution continues wherever the first sequence
+would have continued, by falling off the end, or doing a goto, etc.
+
+ `TRY_FINALLY_EXPR' complicates the flow graph, since the cleanup needs
+to appear on every edge out of the controlled block; this reduces the
+freedom to move code across these edges. Therefore, the EH lowering
+pass which runs before most of the optimization passes eliminates these
+expressions by explicitly adding the cleanup to each edge. Rethrowing
+the exception is represented using `RESX_EXPR'.
+
+
+File: gccint.info, Node: GIMPLE, Next: Tree SSA, Prev: GENERIC, Up: Top
+
+12 GIMPLE
+*********
+
+GIMPLE is a three-address representation derived from GENERIC by
+breaking down GENERIC expressions into tuples of no more than 3
+operands (with some exceptions like function calls). GIMPLE was
+heavily influenced by the SIMPLE IL used by the McCAT compiler project
+at McGill University, though we have made some different choices. For
+one thing, SIMPLE doesn't support `goto'.
+
+ Temporaries are introduced to hold intermediate values needed to
+compute complex expressions. Additionally, all the control structures
+used in GENERIC are lowered into conditional jumps, lexical scopes are
+removed and exception regions are converted into an on the side
+exception region tree.
+
+ The compiler pass which converts GENERIC into GIMPLE is referred to as
+the `gimplifier'. The gimplifier works recursively, generating GIMPLE
+tuples out of the original GENERIC expressions.
+
+ One of the early implementation strategies used for the GIMPLE
+representation was to use the same internal data structures used by
+front ends to represent parse trees. This simplified implementation
+because we could leverage existing functionality and interfaces.
+However, GIMPLE is a much more restrictive representation than abstract
+syntax trees (AST), therefore it does not require the full structural
+complexity provided by the main tree data structure.
+
+ The GENERIC representation of a function is stored in the
+`DECL_SAVED_TREE' field of the associated `FUNCTION_DECL' tree node.
+It is converted to GIMPLE by a call to `gimplify_function_tree'.
+
+ If a front end wants to include language-specific tree codes in the
+tree representation which it provides to the back end, it must provide a
+definition of `LANG_HOOKS_GIMPLIFY_EXPR' which knows how to convert the
+front end trees to GIMPLE. Usually such a hook will involve much of
+the same code for expanding front end trees to RTL. This function can
+return fully lowered GIMPLE, or it can return GENERIC trees and let the
+main gimplifier lower them the rest of the way; this is often simpler.
+GIMPLE that is not fully lowered is known as "High GIMPLE" and consists
+of the IL before the pass `pass_lower_cf'. High GIMPLE contains some
+container statements like lexical scopes (represented by `GIMPLE_BIND')
+and nested expressions (e.g., `GIMPLE_TRY'), while "Low GIMPLE" exposes
+all of the implicit jumps for control and exception expressions
+directly in the IL and EH region trees.
+
+ The C and C++ front ends currently convert directly from front end
+trees to GIMPLE, and hand that off to the back end rather than first
+converting to GENERIC. Their gimplifier hooks know about all the
+`_STMT' nodes and how to convert them to GENERIC forms. There was some
+work done on a genericization pass which would run first, but the
+existence of `STMT_EXPR' meant that in order to convert all of the C
+statements into GENERIC equivalents would involve walking the entire
+tree anyway, so it was simpler to lower all the way. This might change
+in the future if someone writes an optimization pass which would work
+better with higher-level trees, but currently the optimizers all expect
+GIMPLE.
+
+ You can request to dump a C-like representation of the GIMPLE form
+with the flag `-fdump-tree-gimple'.
+
+* Menu:
+
+* Tuple representation::
+* GIMPLE instruction set::
+* GIMPLE Exception Handling::
+* Temporaries::
+* Operands::
+* Manipulating GIMPLE statements::
+* Tuple specific accessors::
+* GIMPLE sequences::
+* Sequence iterators::
+* Adding a new GIMPLE statement code::
+* Statement and operand traversals::
+
+
+File: gccint.info, Node: Tuple representation, Next: GIMPLE instruction set, Up: GIMPLE
+
+12.1 Tuple representation
+=========================
+
+GIMPLE instructions are tuples of variable size divided in two groups:
+a header describing the instruction and its locations, and a variable
+length body with all the operands. Tuples are organized into a
+hierarchy with 3 main classes of tuples.
+
+12.1.1 `gimple_statement_base' (gsbase)
+---------------------------------------
+
+This is the root of the hierarchy, it holds basic information needed by
+most GIMPLE statements. There are some fields that may not be relevant
+to every GIMPLE statement, but those were moved into the base structure
+to take advantage of holes left by other fields (thus making the
+structure more compact). The structure takes 4 words (32 bytes) on 64
+bit hosts:
+
+Field Size (bits)
+`code' 8
+`subcode' 16
+`no_warning' 1
+`visited' 1
+`nontemporal_move' 1
+`plf' 2
+`modified' 1
+`has_volatile_ops' 1
+`references_memory_p' 1
+`uid' 32
+`location' 32
+`num_ops' 32
+`bb' 64
+`block' 63
+Total size 32 bytes
+
+ * `code' Main identifier for a GIMPLE instruction.
+
+ * `subcode' Used to distinguish different variants of the same basic
+ instruction or provide flags applicable to a given code. The
+ `subcode' flags field has different uses depending on the code of
+ the instruction, but mostly it distinguishes instructions of the
+ same family. The most prominent use of this field is in
+ assignments, where subcode indicates the operation done on the RHS
+ of the assignment. For example, a = b + c is encoded as
+ `GIMPLE_ASSIGN <PLUS_EXPR, a, b, c>'.
+
+ * `no_warning' Bitflag to indicate whether a warning has already
+ been issued on this statement.
+
+ * `visited' General purpose "visited" marker. Set and cleared by
+ each pass when needed.
+
+ * `nontemporal_move' Bitflag used in assignments that represent
+ non-temporal moves. Although this bitflag is only used in
+ assignments, it was moved into the base to take advantage of the
+ bit holes left by the previous fields.
+
+ * `plf' Pass Local Flags. This 2-bit mask can be used as general
+ purpose markers by any pass. Passes are responsible for clearing
+ and setting these two flags accordingly.
+
+ * `modified' Bitflag to indicate whether the statement has been
+ modified. Used mainly by the operand scanner to determine when to
+ re-scan a statement for operands.
+
+ * `has_volatile_ops' Bitflag to indicate whether this statement
+ contains operands that have been marked volatile.
+
+ * `references_memory_p' Bitflag to indicate whether this statement
+ contains memory references (i.e., its operands are either global
+ variables, or pointer dereferences or anything that must reside in
+ memory).
+
+ * `uid' This is an unsigned integer used by passes that want to
+ assign IDs to every statement. These IDs must be assigned and used
+ by each pass.
+
+ * `location' This is a `location_t' identifier to specify source code
+ location for this statement. It is inherited from the front end.
+
+ * `num_ops' Number of operands that this statement has. This
+ specifies the size of the operand vector embedded in the tuple.
+ Only used in some tuples, but it is declared in the base tuple to
+ take advantage of the 32-bit hole left by the previous fields.
+
+ * `bb' Basic block holding the instruction.
+
+ * `block' Lexical block holding this statement. Also used for debug
+ information generation.
+
+12.1.2 `gimple_statement_with_ops'
+----------------------------------
+
+This tuple is actually split in two: `gimple_statement_with_ops_base'
+and `gimple_statement_with_ops'. This is needed to accommodate the way
+the operand vector is allocated. The operand vector is defined to be an
+array of 1 element. So, to allocate a dynamic number of operands, the
+memory allocator (`gimple_alloc') simply allocates enough memory to
+hold the structure itself plus `N - 1' operands which run "off the end"
+of the structure. For example, to allocate space for a tuple with 3
+operands, `gimple_alloc' reserves `sizeof (struct
+gimple_statement_with_ops) + 2 * sizeof (tree)' bytes.
+
+ On the other hand, several fields in this tuple need to be shared with
+the `gimple_statement_with_memory_ops' tuple. So, these common fields
+are placed in `gimple_statement_with_ops_base' which is then inherited
+from the other two tuples.
+
+`gsbase' 256
+`addresses_taken' 64
+`def_ops' 64
+`use_ops' 64
+`op' `num_ops' * 64
+Total size 56 + 8 * `num_ops' bytes
+
+ * `gsbase' Inherited from `struct gimple_statement_base'.
+
+ * `addresses_taken' Bitmap holding the UIDs of all the `VAR_DECL's
+ whose addresses are taken by this statement. For example, a
+ statement of the form `p = &b' will have the UID for symbol `b' in
+ this set.
+
+ * `def_ops' Array of pointers into the operand array indicating all
+ the slots that contain a variable written-to by the statement.
+ This array is also used for immediate use chaining. Note that it
+ would be possible to not rely on this array, but the changes
+ required to implement this are pretty invasive.
+
+ * `use_ops' Similar to `def_ops' but for variables read by the
+ statement.
+
+ * `op' Array of trees with `num_ops' slots.
+
+12.1.3 `gimple_statement_with_memory_ops'
+-----------------------------------------
+
+This tuple is essentially identical to `gimple_statement_with_ops',
+except that it contains 4 additional fields to hold vectors related
+memory stores and loads. Similar to the previous case, the structure
+is split in two to accommodate for the operand vector
+(`gimple_statement_with_memory_ops_base' and
+`gimple_statement_with_memory_ops').
+
+Field Size (bits)
+`gsbase' 256
+`addresses_taken' 64
+`def_ops' 64
+`use_ops' 64
+`vdef_ops' 64
+`vuse_ops' 64
+`stores' 64
+`loads' 64
+`op' `num_ops' * 64
+Total size 88 + 8 * `num_ops' bytes
+
+ * `vdef_ops' Similar to `def_ops' but for `VDEF' operators. There is
+ one entry per memory symbol written by this statement. This is
+ used to maintain the memory SSA use-def and def-def chains.
+
+ * `vuse_ops' Similar to `use_ops' but for `VUSE' operators. There is
+ one entry per memory symbol loaded by this statement. This is used
+ to maintain the memory SSA use-def chains.
+
+ * `stores' Bitset with all the UIDs for the symbols written-to by the
+ statement. This is different than `vdef_ops' in that all the
+ affected symbols are mentioned in this set. If memory
+ partitioning is enabled, the `vdef_ops' vector will refer to memory
+ partitions. Furthermore, no SSA information is stored in this set.
+
+ * `loads' Similar to `stores', but for memory loads. (Note that there
+ is some amount of redundancy here, it should be possible to reduce
+ memory utilization further by removing these sets).
+
+ All the other tuples are defined in terms of these three basic ones.
+Each tuple will add some fields. The main gimple type is defined to be
+the union of all these structures (`GTY' markers elided for clarity):
+
+ union gimple_statement_d
+ {
+ struct gimple_statement_base gsbase;
+ struct gimple_statement_with_ops gsops;
+ struct gimple_statement_with_memory_ops gsmem;
+ struct gimple_statement_omp omp;
+ struct gimple_statement_bind gimple_bind;
+ struct gimple_statement_catch gimple_catch;
+ struct gimple_statement_eh_filter gimple_eh_filter;
+ struct gimple_statement_phi gimple_phi;
+ struct gimple_statement_resx gimple_resx;
+ struct gimple_statement_try gimple_try;
+ struct gimple_statement_wce gimple_wce;
+ struct gimple_statement_asm gimple_asm;
+ struct gimple_statement_omp_critical gimple_omp_critical;
+ struct gimple_statement_omp_for gimple_omp_for;
+ struct gimple_statement_omp_parallel gimple_omp_parallel;
+ struct gimple_statement_omp_task gimple_omp_task;
+ struct gimple_statement_omp_sections gimple_omp_sections;
+ struct gimple_statement_omp_single gimple_omp_single;
+ struct gimple_statement_omp_continue gimple_omp_continue;
+ struct gimple_statement_omp_atomic_load gimple_omp_atomic_load;
+ struct gimple_statement_omp_atomic_store gimple_omp_atomic_store;
+ };
+
+
+File: gccint.info, Node: GIMPLE instruction set, Next: GIMPLE Exception Handling, Prev: Tuple representation, Up: GIMPLE
+
+12.2 GIMPLE instruction set
+===========================
+
+The following table briefly describes the GIMPLE instruction set.
+
+Instruction High GIMPLE Low GIMPLE
+`GIMPLE_ASM' x x
+`GIMPLE_ASSIGN' x x
+`GIMPLE_BIND' x
+`GIMPLE_CALL' x x
+`GIMPLE_CATCH' x
+`GIMPLE_CHANGE_DYNAMIC_TYPE' x x
+`GIMPLE_COND' x x
+`GIMPLE_EH_FILTER' x
+`GIMPLE_GOTO' x x
+`GIMPLE_LABEL' x x
+`GIMPLE_NOP' x x
+`GIMPLE_OMP_ATOMIC_LOAD' x x
+`GIMPLE_OMP_ATOMIC_STORE' x x
+`GIMPLE_OMP_CONTINUE' x x
+`GIMPLE_OMP_CRITICAL' x x
+`GIMPLE_OMP_FOR' x x
+`GIMPLE_OMP_MASTER' x x
+`GIMPLE_OMP_ORDERED' x x
+`GIMPLE_OMP_PARALLEL' x x
+`GIMPLE_OMP_RETURN' x x
+`GIMPLE_OMP_SECTION' x x
+`GIMPLE_OMP_SECTIONS' x x
+`GIMPLE_OMP_SECTIONS_SWITCH' x x
+`GIMPLE_OMP_SINGLE' x x
+`GIMPLE_PHI' x
+`GIMPLE_RESX' x
+`GIMPLE_RETURN' x x
+`GIMPLE_SWITCH' x x
+`GIMPLE_TRY' x
+
+
+File: gccint.info, Node: GIMPLE Exception Handling, Next: Temporaries, Prev: GIMPLE instruction set, Up: GIMPLE
+
+12.3 Exception Handling
+=======================
+
+Other exception handling constructs are represented using
+`GIMPLE_TRY_CATCH'. `GIMPLE_TRY_CATCH' has two operands. The first
+operand is a sequence of statements to execute. If executing these
+statements does not throw an exception, then the second operand is
+ignored. Otherwise, if an exception is thrown, then the second operand
+of the `GIMPLE_TRY_CATCH' is checked. The second operand may have the
+following forms:
+
+ 1. A sequence of statements to execute. When an exception occurs,
+ these statements are executed, and then the exception is rethrown.
+
+ 2. A sequence of `GIMPLE_CATCH' statements. Each `GIMPLE_CATCH' has
+ a list of applicable exception types and handler code. If the
+ thrown exception matches one of the caught types, the associated
+ handler code is executed. If the handler code falls off the
+ bottom, execution continues after the original `GIMPLE_TRY_CATCH'.
+
+ 3. An `GIMPLE_EH_FILTER' statement. This has a list of permitted
+ exception types, and code to handle a match failure. If the
+ thrown exception does not match one of the allowed types, the
+ associated match failure code is executed. If the thrown exception
+ does match, it continues unwinding the stack looking for the next
+ handler.
+
+
+ Currently throwing an exception is not directly represented in GIMPLE,
+since it is implemented by calling a function. At some point in the
+future we will want to add some way to express that the call will throw
+an exception of a known type.
+
+ Just before running the optimizers, the compiler lowers the high-level
+EH constructs above into a set of `goto's, magic labels, and EH
+regions. Continuing to unwind at the end of a cleanup is represented
+with a `GIMPLE_RESX'.
+
+
+File: gccint.info, Node: Temporaries, Next: Operands, Prev: GIMPLE Exception Handling, Up: GIMPLE
+
+12.4 Temporaries
+================
+
+When gimplification encounters a subexpression that is too complex, it
+creates a new temporary variable to hold the value of the
+subexpression, and adds a new statement to initialize it before the
+current statement. These special temporaries are known as `expression
+temporaries', and are allocated using `get_formal_tmp_var'. The
+compiler tries to always evaluate identical expressions into the same
+temporary, to simplify elimination of redundant calculations.
+
+ We can only use expression temporaries when we know that it will not
+be reevaluated before its value is used, and that it will not be
+otherwise modified(1). Other temporaries can be allocated using
+`get_initialized_tmp_var' or `create_tmp_var'.
+
+ Currently, an expression like `a = b + 5' is not reduced any further.
+We tried converting it to something like
+ T1 = b + 5;
+ a = T1;
+ but this bloated the representation for minimal benefit. However, a
+variable which must live in memory cannot appear in an expression; its
+value is explicitly loaded into a temporary first. Similarly, storing
+the value of an expression to a memory variable goes through a
+temporary.
+
+ ---------- Footnotes ----------
+
+ (1) These restrictions are derived from those in Morgan 4.8.
+
+
+File: gccint.info, Node: Operands, Next: Manipulating GIMPLE statements, Prev: Temporaries, Up: GIMPLE
+
+12.5 Operands
+=============
+
+In general, expressions in GIMPLE consist of an operation and the
+appropriate number of simple operands; these operands must either be a
+GIMPLE rvalue (`is_gimple_val'), i.e. a constant or a register
+variable. More complex operands are factored out into temporaries, so
+that
+ a = b + c + d
+ becomes
+ T1 = b + c;
+ a = T1 + d;
+
+ The same rule holds for arguments to a `GIMPLE_CALL'.
+
+ The target of an assignment is usually a variable, but can also be an
+`INDIRECT_REF' or a compound lvalue as described below.
+
+* Menu:
+
+* Compound Expressions::
+* Compound Lvalues::
+* Conditional Expressions::
+* Logical Operators::
+
+
+File: gccint.info, Node: Compound Expressions, Next: Compound Lvalues, Up: Operands
+
+12.5.1 Compound Expressions
+---------------------------
+
+The left-hand side of a C comma expression is simply moved into a
+separate statement.
+
+
+File: gccint.info, Node: Compound Lvalues, Next: Conditional Expressions, Prev: Compound Expressions, Up: Operands
+
+12.5.2 Compound Lvalues
+-----------------------
+
+Currently compound lvalues involving array and structure field
+references are not broken down; an expression like `a.b[2] = 42' is not
+reduced any further (though complex array subscripts are). This
+restriction is a workaround for limitations in later optimizers; if we
+were to convert this to
+
+ T1 = &a.b;
+ T1[2] = 42;
+
+ alias analysis would not remember that the reference to `T1[2]' came
+by way of `a.b', so it would think that the assignment could alias
+another member of `a'; this broke `struct-alias-1.c'. Future optimizer
+improvements may make this limitation unnecessary.
+
+
+File: gccint.info, Node: Conditional Expressions, Next: Logical Operators, Prev: Compound Lvalues, Up: Operands
+
+12.5.3 Conditional Expressions
+------------------------------
+
+A C `?:' expression is converted into an `if' statement with each
+branch assigning to the same temporary. So,
+
+ a = b ? c : d;
+ becomes
+ if (b == 1)
+ T1 = c;
+ else
+ T1 = d;
+ a = T1;
+
+ The GIMPLE level if-conversion pass re-introduces `?:' expression, if
+appropriate. It is used to vectorize loops with conditions using vector
+conditional operations.
+
+ Note that in GIMPLE, `if' statements are represented using
+`GIMPLE_COND', as described below.
+
+
+File: gccint.info, Node: Logical Operators, Prev: Conditional Expressions, Up: Operands
+
+12.5.4 Logical Operators
+------------------------
+
+Except when they appear in the condition operand of a `GIMPLE_COND',
+logical `and' and `or' operators are simplified as follows: `a = b &&
+c' becomes
+
+ T1 = (bool)b;
+ if (T1 == true)
+ T1 = (bool)c;
+ a = T1;
+
+ Note that `T1' in this example cannot be an expression temporary,
+because it has two different assignments.
+
+12.5.5 Manipulating operands
+----------------------------
+
+All gimple operands are of type `tree'. But only certain types of
+trees are allowed to be used as operand tuples. Basic validation is
+controlled by the function `get_gimple_rhs_class', which given a tree
+code, returns an `enum' with the following values of type `enum
+gimple_rhs_class'
+
+ * `GIMPLE_INVALID_RHS' The tree cannot be used as a GIMPLE operand.
+
+ * `GIMPLE_BINARY_RHS' The tree is a valid GIMPLE binary operation.
+
+ * `GIMPLE_UNARY_RHS' The tree is a valid GIMPLE unary operation.
+
+ * `GIMPLE_SINGLE_RHS' The tree is a single object, that cannot be
+ split into simpler operands (for instance, `SSA_NAME', `VAR_DECL',
+ `COMPONENT_REF', etc).
+
+ This operand class also acts as an escape hatch for tree nodes
+ that may be flattened out into the operand vector, but would need
+ more than two slots on the RHS. For instance, a `COND_EXPR'
+ expression of the form `(a op b) ? x : y' could be flattened out
+ on the operand vector using 4 slots, but it would also require
+ additional processing to distinguish `c = a op b' from `c = a op b
+ ? x : y'. Something similar occurs with `ASSERT_EXPR'. In time,
+ these special case tree expressions should be flattened into the
+ operand vector.
+
+ For tree nodes in the categories `GIMPLE_BINARY_RHS' and
+`GIMPLE_UNARY_RHS', they cannot be stored inside tuples directly. They
+first need to be flattened and separated into individual components.
+For instance, given the GENERIC expression
+
+ a = b + c
+
+ its tree representation is:
+
+ MODIFY_EXPR <VAR_DECL <a>, PLUS_EXPR <VAR_DECL <b>, VAR_DECL <c>>>
+
+ In this case, the GIMPLE form for this statement is logically
+identical to its GENERIC form but in GIMPLE, the `PLUS_EXPR' on the RHS
+of the assignment is not represented as a tree, instead the two
+operands are taken out of the `PLUS_EXPR' sub-tree and flattened into
+the GIMPLE tuple as follows:
+
+ GIMPLE_ASSIGN <PLUS_EXPR, VAR_DECL <a>, VAR_DECL <b>, VAR_DECL <c>>
+
+12.5.6 Operand vector allocation
+--------------------------------
+
+The operand vector is stored at the bottom of the three tuple
+structures that accept operands. This means, that depending on the code
+of a given statement, its operand vector will be at different offsets
+from the base of the structure. To access tuple operands use the
+following accessors
+
+ -- GIMPLE function: unsigned gimple_num_ops (gimple g)
+ Returns the number of operands in statement G.
+
+ -- GIMPLE function: tree gimple_op (gimple g, unsigned i)
+ Returns operand `I' from statement `G'.
+
+ -- GIMPLE function: tree *gimple_ops (gimple g)
+ Returns a pointer into the operand vector for statement `G'. This
+ is computed using an internal table called `gimple_ops_offset_'[].
+ This table is indexed by the gimple code of `G'.
+
+ When the compiler is built, this table is filled-in using the
+ sizes of the structures used by each statement code defined in
+ gimple.def. Since the operand vector is at the bottom of the
+ structure, for a gimple code `C' the offset is computed as sizeof
+ (struct-of `C') - sizeof (tree).
+
+ This mechanism adds one memory indirection to every access when
+ using `gimple_op'(), if this becomes a bottleneck, a pass can
+ choose to memoize the result from `gimple_ops'() and use that to
+ access the operands.
+
+12.5.7 Operand validation
+-------------------------
+
+When adding a new operand to a gimple statement, the operand will be
+validated according to what each tuple accepts in its operand vector.
+These predicates are called by the `gimple_<name>_set_...()'. Each
+tuple will use one of the following predicates (Note, this list is not
+exhaustive):
+
+ -- GIMPLE function: is_gimple_operand (tree t)
+ This is the most permissive of the predicates. It essentially
+ checks whether t has a `gimple_rhs_class' of `GIMPLE_SINGLE_RHS'.
+
+ -- GIMPLE function: is_gimple_val (tree t)
+ Returns true if t is a "GIMPLE value", which are all the
+ non-addressable stack variables (variables for which
+ `is_gimple_reg' returns true) and constants (expressions for which
+ `is_gimple_min_invariant' returns true).
+
+ -- GIMPLE function: is_gimple_addressable (tree t)
+ Returns true if t is a symbol or memory reference whose address
+ can be taken.
+
+ -- GIMPLE function: is_gimple_asm_val (tree t)
+ Similar to `is_gimple_val' but it also accepts hard registers.
+
+ -- GIMPLE function: is_gimple_call_addr (tree t)
+ Return true if t is a valid expression to use as the function
+ called by a `GIMPLE_CALL'.
+
+ -- GIMPLE function: is_gimple_constant (tree t)
+ Return true if t is a valid gimple constant.
+
+ -- GIMPLE function: is_gimple_min_invariant (tree t)
+ Return true if t is a valid minimal invariant. This is different
+ from constants, in that the specific value of t may not be known
+ at compile time, but it is known that it doesn't change (e.g., the
+ address of a function local variable).
+
+ -- GIMPLE function: is_gimple_min_invariant_address (tree t)
+ Return true if t is an `ADDR_EXPR' that does not change once the
+ program is running.
+
+12.5.8 Statement validation
+---------------------------
+
+ -- GIMPLE function: is_gimple_assign (gimple g)
+ Return true if the code of g is `GIMPLE_ASSIGN'.
+
+ -- GIMPLE function: is_gimple_call (gimple g)
+ Return true if the code of g is `GIMPLE_CALL'
+
+ -- GIMPLE function: gimple_assign_cast_p (gimple g)
+ Return true if g is a `GIMPLE_ASSIGN' that performs a type cast
+ operation
+
+
+File: gccint.info, Node: Manipulating GIMPLE statements, Next: Tuple specific accessors, Prev: Operands, Up: GIMPLE
+
+12.6 Manipulating GIMPLE statements
+===================================
+
+This section documents all the functions available to handle each of
+the GIMPLE instructions.
+
+12.6.1 Common accessors
+-----------------------
+
+The following are common accessors for gimple statements.
+
+ -- GIMPLE function: enum gimple_code gimple_code (gimple g)
+ Return the code for statement `G'.
+
+ -- GIMPLE function: basic_block gimple_bb (gimple g)
+ Return the basic block to which statement `G' belongs to.
+
+ -- GIMPLE function: tree gimple_block (gimple g)
+ Return the lexical scope block holding statement `G'.
+
+ -- GIMPLE function: tree gimple_expr_type (gimple stmt)
+ Return the type of the main expression computed by `STMT'. Return
+ `void_type_node' if `STMT' computes nothing. This will only return
+ something meaningful for `GIMPLE_ASSIGN', `GIMPLE_COND' and
+ `GIMPLE_CALL'. For all other tuple codes, it will return
+ `void_type_node'.
+
+ -- GIMPLE function: enum tree_code gimple_expr_code (gimple stmt)
+ Return the tree code for the expression computed by `STMT'. This
+ is only meaningful for `GIMPLE_CALL', `GIMPLE_ASSIGN' and
+ `GIMPLE_COND'. If `STMT' is `GIMPLE_CALL', it will return
+ `CALL_EXPR'. For `GIMPLE_COND', it returns the code of the
+ comparison predicate. For `GIMPLE_ASSIGN' it returns the code of
+ the operation performed by the `RHS' of the assignment.
+
+ -- GIMPLE function: void gimple_set_block (gimple g, tree block)
+ Set the lexical scope block of `G' to `BLOCK'.
+
+ -- GIMPLE function: location_t gimple_locus (gimple g)
+ Return locus information for statement `G'.
+
+ -- GIMPLE function: void gimple_set_locus (gimple g, location_t locus)
+ Set locus information for statement `G'.
+
+ -- GIMPLE function: bool gimple_locus_empty_p (gimple g)
+ Return true if `G' does not have locus information.
+
+ -- GIMPLE function: bool gimple_no_warning_p (gimple stmt)
+ Return true if no warnings should be emitted for statement `STMT'.
+
+ -- GIMPLE function: void gimple_set_visited (gimple stmt, bool
+ visited_p)
+ Set the visited status on statement `STMT' to `VISITED_P'.
+
+ -- GIMPLE function: bool gimple_visited_p (gimple stmt)
+ Return the visited status on statement `STMT'.
+
+ -- GIMPLE function: void gimple_set_plf (gimple stmt, enum plf_mask
+ plf, bool val_p)
+ Set pass local flag `PLF' on statement `STMT' to `VAL_P'.
+
+ -- GIMPLE function: unsigned int gimple_plf (gimple stmt, enum
+ plf_mask plf)
+ Return the value of pass local flag `PLF' on statement `STMT'.
+
+ -- GIMPLE function: bool gimple_has_ops (gimple g)
+ Return true if statement `G' has register or memory operands.
+
+ -- GIMPLE function: bool gimple_has_mem_ops (gimple g)
+ Return true if statement `G' has memory operands.
+
+ -- GIMPLE function: unsigned gimple_num_ops (gimple g)
+ Return the number of operands for statement `G'.
+
+ -- GIMPLE function: tree *gimple_ops (gimple g)
+ Return the array of operands for statement `G'.
+
+ -- GIMPLE function: tree gimple_op (gimple g, unsigned i)
+ Return operand `I' for statement `G'.
+
+ -- GIMPLE function: tree *gimple_op_ptr (gimple g, unsigned i)
+ Return a pointer to operand `I' for statement `G'.
+
+ -- GIMPLE function: void gimple_set_op (gimple g, unsigned i, tree op)
+ Set operand `I' of statement `G' to `OP'.
+
+ -- GIMPLE function: bitmap gimple_addresses_taken (gimple stmt)
+ Return the set of symbols that have had their address taken by
+ `STMT'.
+
+ -- GIMPLE function: struct def_optype_d *gimple_def_ops (gimple g)
+ Return the set of `DEF' operands for statement `G'.
+
+ -- GIMPLE function: void gimple_set_def_ops (gimple g, struct
+ def_optype_d *def)
+ Set `DEF' to be the set of `DEF' operands for statement `G'.
+
+ -- GIMPLE function: struct use_optype_d *gimple_use_ops (gimple g)
+ Return the set of `USE' operands for statement `G'.
+
+ -- GIMPLE function: void gimple_set_use_ops (gimple g, struct
+ use_optype_d *use)
+ Set `USE' to be the set of `USE' operands for statement `G'.
+
+ -- GIMPLE function: struct voptype_d *gimple_vuse_ops (gimple g)
+ Return the set of `VUSE' operands for statement `G'.
+
+ -- GIMPLE function: void gimple_set_vuse_ops (gimple g, struct
+ voptype_d *ops)
+ Set `OPS' to be the set of `VUSE' operands for statement `G'.
+
+ -- GIMPLE function: struct voptype_d *gimple_vdef_ops (gimple g)
+ Return the set of `VDEF' operands for statement `G'.
+
+ -- GIMPLE function: void gimple_set_vdef_ops (gimple g, struct
+ voptype_d *ops)
+ Set `OPS' to be the set of `VDEF' operands for statement `G'.
+
+ -- GIMPLE function: bitmap gimple_loaded_syms (gimple g)
+ Return the set of symbols loaded by statement `G'. Each element of
+ the set is the `DECL_UID' of the corresponding symbol.
+
+ -- GIMPLE function: bitmap gimple_stored_syms (gimple g)
+ Return the set of symbols stored by statement `G'. Each element of
+ the set is the `DECL_UID' of the corresponding symbol.
+
+ -- GIMPLE function: bool gimple_modified_p (gimple g)
+ Return true if statement `G' has operands and the modified field
+ has been set.
+
+ -- GIMPLE function: bool gimple_has_volatile_ops (gimple stmt)
+ Return true if statement `STMT' contains volatile operands.
+
+ -- GIMPLE function: void gimple_set_has_volatile_ops (gimple stmt,
+ bool volatilep)
+ Return true if statement `STMT' contains volatile operands.
+
+ -- GIMPLE function: void update_stmt (gimple s)
+ Mark statement `S' as modified, and update it.
+
+ -- GIMPLE function: void update_stmt_if_modified (gimple s)
+ Update statement `S' if it has been marked modified.
+
+ -- GIMPLE function: gimple gimple_copy (gimple stmt)
+ Return a deep copy of statement `STMT'.
+
+
+File: gccint.info, Node: Tuple specific accessors, Next: GIMPLE sequences, Prev: Manipulating GIMPLE statements, Up: GIMPLE
+
+12.7 Tuple specific accessors
+=============================
+
+* Menu:
+
+* `GIMPLE_ASM'::
+* `GIMPLE_ASSIGN'::
+* `GIMPLE_BIND'::
+* `GIMPLE_CALL'::
+* `GIMPLE_CATCH'::
+* `GIMPLE_CHANGE_DYNAMIC_TYPE'::
+* `GIMPLE_COND'::
+* `GIMPLE_EH_FILTER'::
+* `GIMPLE_LABEL'::
+* `GIMPLE_NOP'::
+* `GIMPLE_OMP_ATOMIC_LOAD'::
+* `GIMPLE_OMP_ATOMIC_STORE'::
+* `GIMPLE_OMP_CONTINUE'::
+* `GIMPLE_OMP_CRITICAL'::
+* `GIMPLE_OMP_FOR'::
+* `GIMPLE_OMP_MASTER'::
+* `GIMPLE_OMP_ORDERED'::
+* `GIMPLE_OMP_PARALLEL'::
+* `GIMPLE_OMP_RETURN'::
+* `GIMPLE_OMP_SECTION'::
+* `GIMPLE_OMP_SECTIONS'::
+* `GIMPLE_OMP_SINGLE'::
+* `GIMPLE_PHI'::
+* `GIMPLE_RESX'::
+* `GIMPLE_RETURN'::
+* `GIMPLE_SWITCH'::
+* `GIMPLE_TRY'::
+* `GIMPLE_WITH_CLEANUP_EXPR'::
+
+
+File: gccint.info, Node: `GIMPLE_ASM', Next: `GIMPLE_ASSIGN', Up: Tuple specific accessors
+
+12.7.1 `GIMPLE_ASM'
+-------------------
+
+ -- GIMPLE function: gimple gimple_build_asm (const char *string,
+ ninputs, noutputs, nclobbers, ...)
+ Build a `GIMPLE_ASM' statement. This statement is used for
+ building in-line assembly constructs. `STRING' is the assembly
+ code. `NINPUT' is the number of register inputs. `NOUTPUT' is the
+ number of register outputs. `NCLOBBERS' is the number of clobbered
+ registers. The rest of the arguments trees for each input,
+ output, and clobbered registers.
+
+ -- GIMPLE function: gimple gimple_build_asm_vec (const char *,
+ VEC(tree,gc) *, VEC(tree,gc) *, VEC(tree,gc) *)
+ Identical to gimple_build_asm, but the arguments are passed in
+ VECs.
+
+ -- GIMPLE function: gimple_asm_ninputs (gimple g)
+ Return the number of input operands for `GIMPLE_ASM' `G'.
+
+ -- GIMPLE function: gimple_asm_noutputs (gimple g)
+ Return the number of output operands for `GIMPLE_ASM' `G'.
+
+ -- GIMPLE function: gimple_asm_nclobbers (gimple g)
+ Return the number of clobber operands for `GIMPLE_ASM' `G'.
+
+ -- GIMPLE function: tree gimple_asm_input_op (gimple g, unsigned index)
+ Return input operand `INDEX' of `GIMPLE_ASM' `G'.
+
+ -- GIMPLE function: void gimple_asm_set_input_op (gimple g, unsigned
+ index, tree in_op)
+ Set `IN_OP' to be input operand `INDEX' in `GIMPLE_ASM' `G'.
+
+ -- GIMPLE function: tree gimple_asm_output_op (gimple g, unsigned
+ index)
+ Return output operand `INDEX' of `GIMPLE_ASM' `G'.
+
+ -- GIMPLE function: void gimple_asm_set_output_op (gimple g, unsigned
+ index, tree out_op)
+ Set `OUT_OP' to be output operand `INDEX' in `GIMPLE_ASM' `G'.
+
+ -- GIMPLE function: tree gimple_asm_clobber_op (gimple g, unsigned
+ index)
+ Return clobber operand `INDEX' of `GIMPLE_ASM' `G'.
+
+ -- GIMPLE function: void gimple_asm_set_clobber_op (gimple g, unsigned
+ index, tree clobber_op)
+ Set `CLOBBER_OP' to be clobber operand `INDEX' in `GIMPLE_ASM' `G'.
+
+ -- GIMPLE function: const char *gimple_asm_string (gimple g)
+ Return the string representing the assembly instruction in
+ `GIMPLE_ASM' `G'.
+
+ -- GIMPLE function: bool gimple_asm_volatile_p (gimple g)
+ Return true if `G' is an asm statement marked volatile.
+
+ -- GIMPLE function: void gimple_asm_set_volatile (gimple g)
+ Mark asm statement `G' as volatile.
+
+ -- GIMPLE function: void gimple_asm_clear_volatile (gimple g)
+ Remove volatile marker from asm statement `G'.
+
+
+File: gccint.info, Node: `GIMPLE_ASSIGN', Next: `GIMPLE_BIND', Prev: `GIMPLE_ASM', Up: Tuple specific accessors
+
+12.7.2 `GIMPLE_ASSIGN'
+----------------------
+
+ -- GIMPLE function: gimple gimple_build_assign (tree lhs, tree rhs)
+ Build a `GIMPLE_ASSIGN' statement. The left-hand side is an lvalue
+ passed in lhs. The right-hand side can be either a unary or
+ binary tree expression. The expression tree rhs will be flattened
+ and its operands assigned to the corresponding operand slots in
+ the new statement. This function is useful when you already have
+ a tree expression that you want to convert into a tuple. However,
+ try to avoid building expression trees for the sole purpose of
+ calling this function. If you already have the operands in
+ separate trees, it is better to use `gimple_build_assign_with_ops'.
+
+ -- GIMPLE function: gimple gimplify_assign (tree dst, tree src,
+ gimple_seq *seq_p)
+ Build a new `GIMPLE_ASSIGN' tuple and append it to the end of
+ `*SEQ_P'.
+
+ `DST'/`SRC' are the destination and source respectively. You can pass
+ungimplified trees in `DST' or `SRC', in which case they will be
+converted to a gimple operand if necessary.
+
+ This function returns the newly created `GIMPLE_ASSIGN' tuple.
+
+ -- GIMPLE function: gimple gimple_build_assign_with_ops (enum
+ tree_code subcode, tree lhs, tree op1, tree op2)
+ This function is similar to `gimple_build_assign', but is used to
+ build a `GIMPLE_ASSIGN' statement when the operands of the
+ right-hand side of the assignment are already split into different
+ operands.
+
+ The left-hand side is an lvalue passed in lhs. Subcode is the
+ `tree_code' for the right-hand side of the assignment. Op1 and op2
+ are the operands. If op2 is null, subcode must be a `tree_code'
+ for a unary expression.
+
+ -- GIMPLE function: enum tree_code gimple_assign_rhs_code (gimple g)
+ Return the code of the expression computed on the `RHS' of
+ assignment statement `G'.
+
+ -- GIMPLE function: enum gimple_rhs_class gimple_assign_rhs_class
+ (gimple g)
+ Return the gimple rhs class of the code for the expression
+ computed on the rhs of assignment statement `G'. This will never
+ return `GIMPLE_INVALID_RHS'.
+
+ -- GIMPLE function: tree gimple_assign_lhs (gimple g)
+ Return the `LHS' of assignment statement `G'.
+
+ -- GIMPLE function: tree *gimple_assign_lhs_ptr (gimple g)
+ Return a pointer to the `LHS' of assignment statement `G'.
+
+ -- GIMPLE function: tree gimple_assign_rhs1 (gimple g)
+ Return the first operand on the `RHS' of assignment statement `G'.
+
+ -- GIMPLE function: tree *gimple_assign_rhs1_ptr (gimple g)
+ Return the address of the first operand on the `RHS' of assignment
+ statement `G'.
+
+ -- GIMPLE function: tree gimple_assign_rhs2 (gimple g)
+ Return the second operand on the `RHS' of assignment statement `G'.
+
+ -- GIMPLE function: tree *gimple_assign_rhs2_ptr (gimple g)
+ Return the address of the second operand on the `RHS' of assignment
+ statement `G'.
+
+ -- GIMPLE function: void gimple_assign_set_lhs (gimple g, tree lhs)
+ Set `LHS' to be the `LHS' operand of assignment statement `G'.
+
+ -- GIMPLE function: void gimple_assign_set_rhs1 (gimple g, tree rhs)
+ Set `RHS' to be the first operand on the `RHS' of assignment
+ statement `G'.
+
+ -- GIMPLE function: tree gimple_assign_rhs2 (gimple g)
+ Return the second operand on the `RHS' of assignment statement `G'.
+
+ -- GIMPLE function: tree *gimple_assign_rhs2_ptr (gimple g)
+ Return a pointer to the second operand on the `RHS' of assignment
+ statement `G'.
+
+ -- GIMPLE function: void gimple_assign_set_rhs2 (gimple g, tree rhs)
+ Set `RHS' to be the second operand on the `RHS' of assignment
+ statement `G'.
+
+ -- GIMPLE function: bool gimple_assign_cast_p (gimple s)
+ Return true if `S' is an type-cast assignment.
+
+
+File: gccint.info, Node: `GIMPLE_BIND', Next: `GIMPLE_CALL', Prev: `GIMPLE_ASSIGN', Up: Tuple specific accessors
+
+12.7.3 `GIMPLE_BIND'
+--------------------
+
+ -- GIMPLE function: gimple gimple_build_bind (tree vars, gimple_seq
+ body)
+ Build a `GIMPLE_BIND' statement with a list of variables in `VARS'
+ and a body of statements in sequence `BODY'.
+
+ -- GIMPLE function: tree gimple_bind_vars (gimple g)
+ Return the variables declared in the `GIMPLE_BIND' statement `G'.
+
+ -- GIMPLE function: void gimple_bind_set_vars (gimple g, tree vars)
+ Set `VARS' to be the set of variables declared in the `GIMPLE_BIND'
+ statement `G'.
+
+ -- GIMPLE function: void gimple_bind_append_vars (gimple g, tree vars)
+ Append `VARS' to the set of variables declared in the `GIMPLE_BIND'
+ statement `G'.
+
+ -- GIMPLE function: gimple_seq gimple_bind_body (gimple g)
+ Return the GIMPLE sequence contained in the `GIMPLE_BIND' statement
+ `G'.
+
+ -- GIMPLE function: void gimple_bind_set_body (gimple g, gimple_seq
+ seq)
+ Set `SEQ' to be sequence contained in the `GIMPLE_BIND' statement
+ `G'.
+
+ -- GIMPLE function: void gimple_bind_add_stmt (gimple gs, gimple stmt)
+ Append a statement to the end of a `GIMPLE_BIND''s body.
+
+ -- GIMPLE function: void gimple_bind_add_seq (gimple gs, gimple_seq
+ seq)
+ Append a sequence of statements to the end of a `GIMPLE_BIND''s
+ body.
+
+ -- GIMPLE function: tree gimple_bind_block (gimple g)
+ Return the `TREE_BLOCK' node associated with `GIMPLE_BIND'
+ statement `G'. This is analogous to the `BIND_EXPR_BLOCK' field in
+ trees.
+
+ -- GIMPLE function: void gimple_bind_set_block (gimple g, tree block)
+ Set `BLOCK' to be the `TREE_BLOCK' node associated with
+ `GIMPLE_BIND' statement `G'.
+
+
+File: gccint.info, Node: `GIMPLE_CALL', Next: `GIMPLE_CATCH', Prev: `GIMPLE_BIND', Up: Tuple specific accessors
+
+12.7.4 `GIMPLE_CALL'
+--------------------
+
+ -- GIMPLE function: gimple gimple_build_call (tree fn, unsigned nargs,
+ ...)
+ Build a `GIMPLE_CALL' statement to function `FN'. The argument
+ `FN' must be either a `FUNCTION_DECL' or a gimple call address as
+ determined by `is_gimple_call_addr'. `NARGS' are the number of
+ arguments. The rest of the arguments follow the argument `NARGS',
+ and must be trees that are valid as rvalues in gimple (i.e., each
+ operand is validated with `is_gimple_operand').
+
+ -- GIMPLE function: gimple gimple_build_call_from_tree (tree call_expr)
+ Build a `GIMPLE_CALL' from a `CALL_EXPR' node. The arguments and
+ the function are taken from the expression directly. This routine
+ assumes that `call_expr' is already in GIMPLE form. That is, its
+ operands are GIMPLE values and the function call needs no further
+ simplification. All the call flags in `call_expr' are copied over
+ to the new `GIMPLE_CALL'.
+
+ -- GIMPLE function: gimple gimple_build_call_vec (tree fn, `VEC'(tree,
+ heap) *args)
+ Identical to `gimple_build_call' but the arguments are stored in a
+ `VEC'().
+
+ -- GIMPLE function: tree gimple_call_lhs (gimple g)
+ Return the `LHS' of call statement `G'.
+
+ -- GIMPLE function: tree *gimple_call_lhs_ptr (gimple g)
+ Return a pointer to the `LHS' of call statement `G'.
+
+ -- GIMPLE function: void gimple_call_set_lhs (gimple g, tree lhs)
+ Set `LHS' to be the `LHS' operand of call statement `G'.
+
+ -- GIMPLE function: tree gimple_call_fn (gimple g)
+ Return the tree node representing the function called by call
+ statement `G'.
+
+ -- GIMPLE function: void gimple_call_set_fn (gimple g, tree fn)
+ Set `FN' to be the function called by call statement `G'. This has
+ to be a gimple value specifying the address of the called function.
+
+ -- GIMPLE function: tree gimple_call_fndecl (gimple g)
+ If a given `GIMPLE_CALL''s callee is a `FUNCTION_DECL', return it.
+ Otherwise return `NULL'. This function is analogous to
+ `get_callee_fndecl' in `GENERIC'.
+
+ -- GIMPLE function: tree gimple_call_set_fndecl (gimple g, tree fndecl)
+ Set the called function to `FNDECL'.
+
+ -- GIMPLE function: tree gimple_call_return_type (gimple g)
+ Return the type returned by call statement `G'.
+
+ -- GIMPLE function: tree gimple_call_chain (gimple g)
+ Return the static chain for call statement `G'.
+
+ -- GIMPLE function: void gimple_call_set_chain (gimple g, tree chain)
+ Set `CHAIN' to be the static chain for call statement `G'.
+
+ -- GIMPLE function: gimple_call_num_args (gimple g)
+ Return the number of arguments used by call statement `G'.
+
+ -- GIMPLE function: tree gimple_call_arg (gimple g, unsigned index)
+ Return the argument at position `INDEX' for call statement `G'.
+ The first argument is 0.
+
+ -- GIMPLE function: tree *gimple_call_arg_ptr (gimple g, unsigned
+ index)
+ Return a pointer to the argument at position `INDEX' for call
+ statement `G'.
+
+ -- GIMPLE function: void gimple_call_set_arg (gimple g, unsigned
+ index, tree arg)
+ Set `ARG' to be the argument at position `INDEX' for call statement
+ `G'.
+
+ -- GIMPLE function: void gimple_call_set_tail (gimple s)
+ Mark call statement `S' as being a tail call (i.e., a call just
+ before the exit of a function). These calls are candidate for tail
+ call optimization.
+
+ -- GIMPLE function: bool gimple_call_tail_p (gimple s)
+ Return true if `GIMPLE_CALL' `S' is marked as a tail call.
+
+ -- GIMPLE function: void gimple_call_mark_uninlinable (gimple s)
+ Mark `GIMPLE_CALL' `S' as being uninlinable.
+
+ -- GIMPLE function: bool gimple_call_cannot_inline_p (gimple s)
+ Return true if `GIMPLE_CALL' `S' cannot be inlined.
+
+ -- GIMPLE function: bool gimple_call_noreturn_p (gimple s)
+ Return true if `S' is a noreturn call.
+
+ -- GIMPLE function: gimple gimple_call_copy_skip_args (gimple stmt,
+ bitmap args_to_skip)
+ Build a `GIMPLE_CALL' identical to `STMT' but skipping the
+ arguments in the positions marked by the set `ARGS_TO_SKIP'.
+
+
+File: gccint.info, Node: `GIMPLE_CATCH', Next: `GIMPLE_CHANGE_DYNAMIC_TYPE', Prev: `GIMPLE_CALL', Up: Tuple specific accessors
+
+12.7.5 `GIMPLE_CATCH'
+---------------------
+
+ -- GIMPLE function: gimple gimple_build_catch (tree types, gimple_seq
+ handler)
+ Build a `GIMPLE_CATCH' statement. `TYPES' are the tree types this
+ catch handles. `HANDLER' is a sequence of statements with the code
+ for the handler.
+
+ -- GIMPLE function: tree gimple_catch_types (gimple g)
+ Return the types handled by `GIMPLE_CATCH' statement `G'.
+
+ -- GIMPLE function: tree *gimple_catch_types_ptr (gimple g)
+ Return a pointer to the types handled by `GIMPLE_CATCH' statement
+ `G'.
+
+ -- GIMPLE function: gimple_seq gimple_catch_handler (gimple g)
+ Return the GIMPLE sequence representing the body of the handler of
+ `GIMPLE_CATCH' statement `G'.
+
+ -- GIMPLE function: void gimple_catch_set_types (gimple g, tree t)
+ Set `T' to be the set of types handled by `GIMPLE_CATCH' `G'.
+
+ -- GIMPLE function: void gimple_catch_set_handler (gimple g,
+ gimple_seq handler)
+ Set `HANDLER' to be the body of `GIMPLE_CATCH' `G'.
+
+
+File: gccint.info, Node: `GIMPLE_CHANGE_DYNAMIC_TYPE', Next: `GIMPLE_COND', Prev: `GIMPLE_CATCH', Up: Tuple specific accessors
+
+12.7.6 `GIMPLE_CHANGE_DYNAMIC_TYPE'
+-----------------------------------
+
+ -- GIMPLE function: gimple gimple_build_cdt (tree type, tree ptr)
+ Build a `GIMPLE_CHANGE_DYNAMIC_TYPE' statement. `TYPE' is the new
+ type for the location `PTR'.
+
+ -- GIMPLE function: tree gimple_cdt_new_type (gimple g)
+ Return the new type set by `GIMPLE_CHANGE_DYNAMIC_TYPE' statement
+ `G'.
+
+ -- GIMPLE function: tree *gimple_cdt_new_type_ptr (gimple g)
+ Return a pointer to the new type set by
+ `GIMPLE_CHANGE_DYNAMIC_TYPE' statement `G'.
+
+ -- GIMPLE function: void gimple_cdt_set_new_type (gimple g, tree
+ new_type)
+ Set `NEW_TYPE' to be the type returned by
+ `GIMPLE_CHANGE_DYNAMIC_TYPE' statement `G'.
+
+ -- GIMPLE function: tree gimple_cdt_location (gimple g)
+ Return the location affected by `GIMPLE_CHANGE_DYNAMIC_TYPE'
+ statement `G'.
+
+ -- GIMPLE function: tree *gimple_cdt_location_ptr (gimple g)
+ Return a pointer to the location affected by
+ `GIMPLE_CHANGE_DYNAMIC_TYPE' statement `G'.
+
+ -- GIMPLE function: void gimple_cdt_set_location (gimple g, tree ptr)
+ Set `PTR' to be the location affected by
+ `GIMPLE_CHANGE_DYNAMIC_TYPE' statement `G'.
+
+
+File: gccint.info, Node: `GIMPLE_COND', Next: `GIMPLE_EH_FILTER', Prev: `GIMPLE_CHANGE_DYNAMIC_TYPE', Up: Tuple specific accessors
+
+12.7.7 `GIMPLE_COND'
+--------------------
+
+ -- GIMPLE function: gimple gimple_build_cond (enum tree_code
+ pred_code, tree lhs, tree rhs, tree t_label, tree f_label)
+ Build a `GIMPLE_COND' statement. `A' `GIMPLE_COND' statement
+ compares `LHS' and `RHS' and if the condition in `PRED_CODE' is
+ true, jump to the label in `t_label', otherwise jump to the label
+ in `f_label'. `PRED_CODE' are relational operator tree codes like
+ `EQ_EXPR', `LT_EXPR', `LE_EXPR', `NE_EXPR', etc.
+
+ -- GIMPLE function: gimple gimple_build_cond_from_tree (tree cond,
+ tree t_label, tree f_label)
+ Build a `GIMPLE_COND' statement from the conditional expression
+ tree `COND'. `T_LABEL' and `F_LABEL' are as in
+ `gimple_build_cond'.
+
+ -- GIMPLE function: enum tree_code gimple_cond_code (gimple g)
+ Return the code of the predicate computed by conditional statement
+ `G'.
+
+ -- GIMPLE function: void gimple_cond_set_code (gimple g, enum
+ tree_code code)
+ Set `CODE' to be the predicate code for the conditional statement
+ `G'.
+
+ -- GIMPLE function: tree gimple_cond_lhs (gimple g)
+ Return the `LHS' of the predicate computed by conditional statement
+ `G'.
+
+ -- GIMPLE function: void gimple_cond_set_lhs (gimple g, tree lhs)
+ Set `LHS' to be the `LHS' operand of the predicate computed by
+ conditional statement `G'.
+
+ -- GIMPLE function: tree gimple_cond_rhs (gimple g)
+ Return the `RHS' operand of the predicate computed by conditional
+ `G'.
+
+ -- GIMPLE function: void gimple_cond_set_rhs (gimple g, tree rhs)
+ Set `RHS' to be the `RHS' operand of the predicate computed by
+ conditional statement `G'.
+
+ -- GIMPLE function: tree gimple_cond_true_label (gimple g)
+ Return the label used by conditional statement `G' when its
+ predicate evaluates to true.
+
+ -- GIMPLE function: void gimple_cond_set_true_label (gimple g, tree
+ label)
+ Set `LABEL' to be the label used by conditional statement `G' when
+ its predicate evaluates to true.
+
+ -- GIMPLE function: void gimple_cond_set_false_label (gimple g, tree
+ label)
+ Set `LABEL' to be the label used by conditional statement `G' when
+ its predicate evaluates to false.
+
+ -- GIMPLE function: tree gimple_cond_false_label (gimple g)
+ Return the label used by conditional statement `G' when its
+ predicate evaluates to false.
+
+ -- GIMPLE function: void gimple_cond_make_false (gimple g)
+ Set the conditional `COND_STMT' to be of the form 'if (1 == 0)'.
+
+ -- GIMPLE function: void gimple_cond_make_true (gimple g)
+ Set the conditional `COND_STMT' to be of the form 'if (1 == 1)'.
+
+
+File: gccint.info, Node: `GIMPLE_EH_FILTER', Next: `GIMPLE_LABEL', Prev: `GIMPLE_COND', Up: Tuple specific accessors
+
+12.7.8 `GIMPLE_EH_FILTER'
+-------------------------
+
+ -- GIMPLE function: gimple gimple_build_eh_filter (tree types,
+ gimple_seq failure)
+ Build a `GIMPLE_EH_FILTER' statement. `TYPES' are the filter's
+ types. `FAILURE' is a sequence with the filter's failure action.
+
+ -- GIMPLE function: tree gimple_eh_filter_types (gimple g)
+ Return the types handled by `GIMPLE_EH_FILTER' statement `G'.
+
+ -- GIMPLE function: tree *gimple_eh_filter_types_ptr (gimple g)
+ Return a pointer to the types handled by `GIMPLE_EH_FILTER'
+ statement `G'.
+
+ -- GIMPLE function: gimple_seq gimple_eh_filter_failure (gimple g)
+ Return the sequence of statement to execute when `GIMPLE_EH_FILTER'
+ statement fails.
+
+ -- GIMPLE function: void gimple_eh_filter_set_types (gimple g, tree
+ types)
+ Set `TYPES' to be the set of types handled by `GIMPLE_EH_FILTER'
+ `G'.
+
+ -- GIMPLE function: void gimple_eh_filter_set_failure (gimple g,
+ gimple_seq failure)
+ Set `FAILURE' to be the sequence of statements to execute on
+ failure for `GIMPLE_EH_FILTER' `G'.
+
+ -- GIMPLE function: bool gimple_eh_filter_must_not_throw (gimple g)
+ Return the `EH_FILTER_MUST_NOT_THROW' flag.
+
+ -- GIMPLE function: void gimple_eh_filter_set_must_not_throw (gimple
+ g, bool mntp)
+ Set the `EH_FILTER_MUST_NOT_THROW' flag.
+
+
+File: gccint.info, Node: `GIMPLE_LABEL', Next: `GIMPLE_NOP', Prev: `GIMPLE_EH_FILTER', Up: Tuple specific accessors
+
+12.7.9 `GIMPLE_LABEL'
+---------------------
+
+ -- GIMPLE function: gimple gimple_build_label (tree label)
+ Build a `GIMPLE_LABEL' statement with corresponding to the tree
+ label, `LABEL'.
+
+ -- GIMPLE function: tree gimple_label_label (gimple g)
+ Return the `LABEL_DECL' node used by `GIMPLE_LABEL' statement `G'.
+
+ -- GIMPLE function: void gimple_label_set_label (gimple g, tree label)
+ Set `LABEL' to be the `LABEL_DECL' node used by `GIMPLE_LABEL'
+ statement `G'.
+
+ -- GIMPLE function: gimple gimple_build_goto (tree dest)
+ Build a `GIMPLE_GOTO' statement to label `DEST'.
+
+ -- GIMPLE function: tree gimple_goto_dest (gimple g)
+ Return the destination of the unconditional jump `G'.
+
+ -- GIMPLE function: void gimple_goto_set_dest (gimple g, tree dest)
+ Set `DEST' to be the destination of the unconditional jump `G'.
+
+
+File: gccint.info, Node: `GIMPLE_NOP', Next: `GIMPLE_OMP_ATOMIC_LOAD', Prev: `GIMPLE_LABEL', Up: Tuple specific accessors
+
+12.7.10 `GIMPLE_NOP'
+--------------------
+
+ -- GIMPLE function: gimple gimple_build_nop (void)
+ Build a `GIMPLE_NOP' statement.
+
+ -- GIMPLE function: bool gimple_nop_p (gimple g)
+ Returns `TRUE' if statement `G' is a `GIMPLE_NOP'.
+
+
+File: gccint.info, Node: `GIMPLE_OMP_ATOMIC_LOAD', Next: `GIMPLE_OMP_ATOMIC_STORE', Prev: `GIMPLE_NOP', Up: Tuple specific accessors
+
+12.7.11 `GIMPLE_OMP_ATOMIC_LOAD'
+--------------------------------
+
+ -- GIMPLE function: gimple gimple_build_omp_atomic_load (tree lhs,
+ tree rhs)
+ Build a `GIMPLE_OMP_ATOMIC_LOAD' statement. `LHS' is the left-hand
+ side of the assignment. `RHS' is the right-hand side of the
+ assignment.
+
+ -- GIMPLE function: void gimple_omp_atomic_load_set_lhs (gimple g,
+ tree lhs)
+ Set the `LHS' of an atomic load.
+
+ -- GIMPLE function: tree gimple_omp_atomic_load_lhs (gimple g)
+ Get the `LHS' of an atomic load.
+
+ -- GIMPLE function: void gimple_omp_atomic_load_set_rhs (gimple g,
+ tree rhs)
+ Set the `RHS' of an atomic set.
+
+ -- GIMPLE function: tree gimple_omp_atomic_load_rhs (gimple g)
+ Get the `RHS' of an atomic set.
+
+
+File: gccint.info, Node: `GIMPLE_OMP_ATOMIC_STORE', Next: `GIMPLE_OMP_CONTINUE', Prev: `GIMPLE_OMP_ATOMIC_LOAD', Up: Tuple specific accessors
+
+12.7.12 `GIMPLE_OMP_ATOMIC_STORE'
+---------------------------------
+
+ -- GIMPLE function: gimple gimple_build_omp_atomic_store (tree val)
+ Build a `GIMPLE_OMP_ATOMIC_STORE' statement. `VAL' is the value to
+ be stored.
+
+ -- GIMPLE function: void gimple_omp_atomic_store_set_val (gimple g,
+ tree val)
+ Set the value being stored in an atomic store.
+
+ -- GIMPLE function: tree gimple_omp_atomic_store_val (gimple g)
+ Return the value being stored in an atomic store.
+
+
+File: gccint.info, Node: `GIMPLE_OMP_CONTINUE', Next: `GIMPLE_OMP_CRITICAL', Prev: `GIMPLE_OMP_ATOMIC_STORE', Up: Tuple specific accessors
+
+12.7.13 `GIMPLE_OMP_CONTINUE'
+-----------------------------
+
+ -- GIMPLE function: gimple gimple_build_omp_continue (tree
+ control_def, tree control_use)
+ Build a `GIMPLE_OMP_CONTINUE' statement. `CONTROL_DEF' is the
+ definition of the control variable. `CONTROL_USE' is the use of
+ the control variable.
+
+ -- GIMPLE function: tree gimple_omp_continue_control_def (gimple s)
+ Return the definition of the control variable on a
+ `GIMPLE_OMP_CONTINUE' in `S'.
+
+ -- GIMPLE function: tree gimple_omp_continue_control_def_ptr (gimple s)
+ Same as above, but return the pointer.
+
+ -- GIMPLE function: tree gimple_omp_continue_set_control_def (gimple s)
+ Set the control variable definition for a `GIMPLE_OMP_CONTINUE'
+ statement in `S'.
+
+ -- GIMPLE function: tree gimple_omp_continue_control_use (gimple s)
+ Return the use of the control variable on a `GIMPLE_OMP_CONTINUE'
+ in `S'.
+
+ -- GIMPLE function: tree gimple_omp_continue_control_use_ptr (gimple s)
+ Same as above, but return the pointer.
+
+ -- GIMPLE function: tree gimple_omp_continue_set_control_use (gimple s)
+ Set the control variable use for a `GIMPLE_OMP_CONTINUE' statement
+ in `S'.
+
+
+File: gccint.info, Node: `GIMPLE_OMP_CRITICAL', Next: `GIMPLE_OMP_FOR', Prev: `GIMPLE_OMP_CONTINUE', Up: Tuple specific accessors
+
+12.7.14 `GIMPLE_OMP_CRITICAL'
+-----------------------------
+
+ -- GIMPLE function: gimple gimple_build_omp_critical (gimple_seq body,
+ tree name)
+ Build a `GIMPLE_OMP_CRITICAL' statement. `BODY' is the sequence of
+ statements for which only one thread can execute. `NAME' is an
+ optional identifier for this critical block.
+
+ -- GIMPLE function: tree gimple_omp_critical_name (gimple g)
+ Return the name associated with `OMP_CRITICAL' statement `G'.
+
+ -- GIMPLE function: tree *gimple_omp_critical_name_ptr (gimple g)
+ Return a pointer to the name associated with `OMP' critical
+ statement `G'.
+
+ -- GIMPLE function: void gimple_omp_critical_set_name (gimple g, tree
+ name)
+ Set `NAME' to be the name associated with `OMP' critical statement
+ `G'.
+
+
+File: gccint.info, Node: `GIMPLE_OMP_FOR', Next: `GIMPLE_OMP_MASTER', Prev: `GIMPLE_OMP_CRITICAL', Up: Tuple specific accessors
+
+12.7.15 `GIMPLE_OMP_FOR'
+------------------------
+
+ -- GIMPLE function: gimple gimple_build_omp_for (gimple_seq body, tree
+ clauses, tree index, tree initial, tree final, tree incr,
+ gimple_seq pre_body, enum tree_code omp_for_cond)
+ Build a `GIMPLE_OMP_FOR' statement. `BODY' is sequence of
+ statements inside the for loop. `CLAUSES', are any of the `OMP'
+ loop construct's clauses: private, firstprivate, lastprivate,
+ reductions, ordered, schedule, and nowait. `PRE_BODY' is the
+ sequence of statements that are loop invariant. `INDEX' is the
+ index variable. `INITIAL' is the initial value of `INDEX'.
+ `FINAL' is final value of `INDEX'. OMP_FOR_COND is the predicate
+ used to compare `INDEX' and `FINAL'. `INCR' is the increment
+ expression.
+
+ -- GIMPLE function: tree gimple_omp_for_clauses (gimple g)
+ Return the clauses associated with `OMP_FOR' `G'.
+
+ -- GIMPLE function: tree *gimple_omp_for_clauses_ptr (gimple g)
+ Return a pointer to the `OMP_FOR' `G'.
+
+ -- GIMPLE function: void gimple_omp_for_set_clauses (gimple g, tree
+ clauses)
+ Set `CLAUSES' to be the list of clauses associated with `OMP_FOR'
+ `G'.
+
+ -- GIMPLE function: tree gimple_omp_for_index (gimple g)
+ Return the index variable for `OMP_FOR' `G'.
+
+ -- GIMPLE function: tree *gimple_omp_for_index_ptr (gimple g)
+ Return a pointer to the index variable for `OMP_FOR' `G'.
+
+ -- GIMPLE function: void gimple_omp_for_set_index (gimple g, tree
+ index)
+ Set `INDEX' to be the index variable for `OMP_FOR' `G'.
+
+ -- GIMPLE function: tree gimple_omp_for_initial (gimple g)
+ Return the initial value for `OMP_FOR' `G'.
+
+ -- GIMPLE function: tree *gimple_omp_for_initial_ptr (gimple g)
+ Return a pointer to the initial value for `OMP_FOR' `G'.
+
+ -- GIMPLE function: void gimple_omp_for_set_initial (gimple g, tree
+ initial)
+ Set `INITIAL' to be the initial value for `OMP_FOR' `G'.
+
+ -- GIMPLE function: tree gimple_omp_for_final (gimple g)
+ Return the final value for `OMP_FOR' `G'.
+
+ -- GIMPLE function: tree *gimple_omp_for_final_ptr (gimple g)
+ turn a pointer to the final value for `OMP_FOR' `G'.
+
+ -- GIMPLE function: void gimple_omp_for_set_final (gimple g, tree
+ final)
+ Set `FINAL' to be the final value for `OMP_FOR' `G'.
+
+ -- GIMPLE function: tree gimple_omp_for_incr (gimple g)
+ Return the increment value for `OMP_FOR' `G'.
+
+ -- GIMPLE function: tree *gimple_omp_for_incr_ptr (gimple g)
+ Return a pointer to the increment value for `OMP_FOR' `G'.
+
+ -- GIMPLE function: void gimple_omp_for_set_incr (gimple g, tree incr)
+ Set `INCR' to be the increment value for `OMP_FOR' `G'.
+
+ -- GIMPLE function: gimple_seq gimple_omp_for_pre_body (gimple g)
+ Return the sequence of statements to execute before the `OMP_FOR'
+ statement `G' starts.
+
+ -- GIMPLE function: void gimple_omp_for_set_pre_body (gimple g,
+ gimple_seq pre_body)
+ Set `PRE_BODY' to be the sequence of statements to execute before
+ the `OMP_FOR' statement `G' starts.
+
+ -- GIMPLE function: void gimple_omp_for_set_cond (gimple g, enum
+ tree_code cond)
+ Set `COND' to be the condition code for `OMP_FOR' `G'.
+
+ -- GIMPLE function: enum tree_code gimple_omp_for_cond (gimple g)
+ Return the condition code associated with `OMP_FOR' `G'.
+
+
+File: gccint.info, Node: `GIMPLE_OMP_MASTER', Next: `GIMPLE_OMP_ORDERED', Prev: `GIMPLE_OMP_FOR', Up: Tuple specific accessors
+
+12.7.16 `GIMPLE_OMP_MASTER'
+---------------------------
+
+ -- GIMPLE function: gimple gimple_build_omp_master (gimple_seq body)
+ Build a `GIMPLE_OMP_MASTER' statement. `BODY' is the sequence of
+ statements to be executed by just the master.
+
+
+File: gccint.info, Node: `GIMPLE_OMP_ORDERED', Next: `GIMPLE_OMP_PARALLEL', Prev: `GIMPLE_OMP_MASTER', Up: Tuple specific accessors
+
+12.7.17 `GIMPLE_OMP_ORDERED'
+----------------------------
+
+ -- GIMPLE function: gimple gimple_build_omp_ordered (gimple_seq body)
+ Build a `GIMPLE_OMP_ORDERED' statement.
+
+ `BODY' is the sequence of statements inside a loop that will executed
+in sequence.
+
+
+File: gccint.info, Node: `GIMPLE_OMP_PARALLEL', Next: `GIMPLE_OMP_RETURN', Prev: `GIMPLE_OMP_ORDERED', Up: Tuple specific accessors
+
+12.7.18 `GIMPLE_OMP_PARALLEL'
+-----------------------------
+
+ -- GIMPLE function: gimple gimple_build_omp_parallel (gimple_seq body,
+ tree clauses, tree child_fn, tree data_arg)
+ Build a `GIMPLE_OMP_PARALLEL' statement.
+
+ `BODY' is sequence of statements which are executed in parallel.
+`CLAUSES', are the `OMP' parallel construct's clauses. `CHILD_FN' is
+the function created for the parallel threads to execute. `DATA_ARG'
+are the shared data argument(s).
+
+ -- GIMPLE function: bool gimple_omp_parallel_combined_p (gimple g)
+ Return true if `OMP' parallel statement `G' has the
+ `GF_OMP_PARALLEL_COMBINED' flag set.
+
+ -- GIMPLE function: void gimple_omp_parallel_set_combined_p (gimple g)
+ Set the `GF_OMP_PARALLEL_COMBINED' field in `OMP' parallel
+ statement `G'.
+
+ -- GIMPLE function: gimple_seq gimple_omp_body (gimple g)
+ Return the body for the `OMP' statement `G'.
+
+ -- GIMPLE function: void gimple_omp_set_body (gimple g, gimple_seq
+ body)
+ Set `BODY' to be the body for the `OMP' statement `G'.
+
+ -- GIMPLE function: tree gimple_omp_parallel_clauses (gimple g)
+ Return the clauses associated with `OMP_PARALLEL' `G'.
+
+ -- GIMPLE function: tree *gimple_omp_parallel_clauses_ptr (gimple g)
+ Return a pointer to the clauses associated with `OMP_PARALLEL' `G'.
+
+ -- GIMPLE function: void gimple_omp_parallel_set_clauses (gimple g,
+ tree clauses)
+ Set `CLAUSES' to be the list of clauses associated with
+ `OMP_PARALLEL' `G'.
+
+ -- GIMPLE function: tree gimple_omp_parallel_child_fn (gimple g)
+ Return the child function used to hold the body of `OMP_PARALLEL'
+ `G'.
+
+ -- GIMPLE function: tree *gimple_omp_parallel_child_fn_ptr (gimple g)
+ Return a pointer to the child function used to hold the body of
+ `OMP_PARALLEL' `G'.
+
+ -- GIMPLE function: void gimple_omp_parallel_set_child_fn (gimple g,
+ tree child_fn)
+ Set `CHILD_FN' to be the child function for `OMP_PARALLEL' `G'.
+
+ -- GIMPLE function: tree gimple_omp_parallel_data_arg (gimple g)
+ Return the artificial argument used to send variables and values
+ from the parent to the children threads in `OMP_PARALLEL' `G'.
+
+ -- GIMPLE function: tree *gimple_omp_parallel_data_arg_ptr (gimple g)
+ Return a pointer to the data argument for `OMP_PARALLEL' `G'.
+
+ -- GIMPLE function: void gimple_omp_parallel_set_data_arg (gimple g,
+ tree data_arg)
+ Set `DATA_ARG' to be the data argument for `OMP_PARALLEL' `G'.
+
+ -- GIMPLE function: bool is_gimple_omp (gimple stmt)
+ Returns true when the gimple statement `STMT' is any of the OpenMP
+ types.
+
+
+File: gccint.info, Node: `GIMPLE_OMP_RETURN', Next: `GIMPLE_OMP_SECTION', Prev: `GIMPLE_OMP_PARALLEL', Up: Tuple specific accessors
+
+12.7.19 `GIMPLE_OMP_RETURN'
+---------------------------
+
+ -- GIMPLE function: gimple gimple_build_omp_return (bool wait_p)
+ Build a `GIMPLE_OMP_RETURN' statement. `WAIT_P' is true if this is
+ a non-waiting return.
+
+ -- GIMPLE function: void gimple_omp_return_set_nowait (gimple s)
+ Set the nowait flag on `GIMPLE_OMP_RETURN' statement `S'.
+
+ -- GIMPLE function: bool gimple_omp_return_nowait_p (gimple g)
+ Return true if `OMP' return statement `G' has the
+ `GF_OMP_RETURN_NOWAIT' flag set.
+
+
+File: gccint.info, Node: `GIMPLE_OMP_SECTION', Next: `GIMPLE_OMP_SECTIONS', Prev: `GIMPLE_OMP_RETURN', Up: Tuple specific accessors
+
+12.7.20 `GIMPLE_OMP_SECTION'
+----------------------------
+
+ -- GIMPLE function: gimple gimple_build_omp_section (gimple_seq body)
+ Build a `GIMPLE_OMP_SECTION' statement for a sections statement.
+
+ `BODY' is the sequence of statements in the section.
+
+ -- GIMPLE function: bool gimple_omp_section_last_p (gimple g)
+ Return true if `OMP' section statement `G' has the
+ `GF_OMP_SECTION_LAST' flag set.
+
+ -- GIMPLE function: void gimple_omp_section_set_last (gimple g)
+ Set the `GF_OMP_SECTION_LAST' flag on `G'.
+
+
+File: gccint.info, Node: `GIMPLE_OMP_SECTIONS', Next: `GIMPLE_OMP_SINGLE', Prev: `GIMPLE_OMP_SECTION', Up: Tuple specific accessors
+
+12.7.21 `GIMPLE_OMP_SECTIONS'
+-----------------------------
+
+ -- GIMPLE function: gimple gimple_build_omp_sections (gimple_seq body,
+ tree clauses)
+ Build a `GIMPLE_OMP_SECTIONS' statement. `BODY' is a sequence of
+ section statements. `CLAUSES' are any of the `OMP' sections
+ construct's clauses: private, firstprivate, lastprivate,
+ reduction, and nowait.
+
+ -- GIMPLE function: gimple gimple_build_omp_sections_switch (void)
+ Build a `GIMPLE_OMP_SECTIONS_SWITCH' statement.
+
+ -- GIMPLE function: tree gimple_omp_sections_control (gimple g)
+ Return the control variable associated with the
+ `GIMPLE_OMP_SECTIONS' in `G'.
+
+ -- GIMPLE function: tree *gimple_omp_sections_control_ptr (gimple g)
+ Return a pointer to the clauses associated with the
+ `GIMPLE_OMP_SECTIONS' in `G'.
+
+ -- GIMPLE function: void gimple_omp_sections_set_control (gimple g,
+ tree control)
+ Set `CONTROL' to be the set of clauses associated with the
+ `GIMPLE_OMP_SECTIONS' in `G'.
+
+ -- GIMPLE function: tree gimple_omp_sections_clauses (gimple g)
+ Return the clauses associated with `OMP_SECTIONS' `G'.
+
+ -- GIMPLE function: tree *gimple_omp_sections_clauses_ptr (gimple g)
+ Return a pointer to the clauses associated with `OMP_SECTIONS' `G'.
+
+ -- GIMPLE function: void gimple_omp_sections_set_clauses (gimple g,
+ tree clauses)
+ Set `CLAUSES' to be the set of clauses associated with
+ `OMP_SECTIONS' `G'.
+
+
+File: gccint.info, Node: `GIMPLE_OMP_SINGLE', Next: `GIMPLE_PHI', Prev: `GIMPLE_OMP_SECTIONS', Up: Tuple specific accessors
+
+12.7.22 `GIMPLE_OMP_SINGLE'
+---------------------------
+
+ -- GIMPLE function: gimple gimple_build_omp_single (gimple_seq body,
+ tree clauses)
+ Build a `GIMPLE_OMP_SINGLE' statement. `BODY' is the sequence of
+ statements that will be executed once. `CLAUSES' are any of the
+ `OMP' single construct's clauses: private, firstprivate,
+ copyprivate, nowait.
+
+ -- GIMPLE function: tree gimple_omp_single_clauses (gimple g)
+ Return the clauses associated with `OMP_SINGLE' `G'.
+
+ -- GIMPLE function: tree *gimple_omp_single_clauses_ptr (gimple g)
+ Return a pointer to the clauses associated with `OMP_SINGLE' `G'.
+
+ -- GIMPLE function: void gimple_omp_single_set_clauses (gimple g, tree
+ clauses)
+ Set `CLAUSES' to be the clauses associated with `OMP_SINGLE' `G'.
+
+
+File: gccint.info, Node: `GIMPLE_PHI', Next: `GIMPLE_RESX', Prev: `GIMPLE_OMP_SINGLE', Up: Tuple specific accessors
+
+12.7.23 `GIMPLE_PHI'
+--------------------
+
+ -- GIMPLE function: gimple make_phi_node (tree var, int len)
+ Build a `PHI' node with len argument slots for variable var.
+
+ -- GIMPLE function: unsigned gimple_phi_capacity (gimple g)
+ Return the maximum number of arguments supported by `GIMPLE_PHI'
+ `G'.
+
+ -- GIMPLE function: unsigned gimple_phi_num_args (gimple g)
+ Return the number of arguments in `GIMPLE_PHI' `G'. This must
+ always be exactly the number of incoming edges for the basic block
+ holding `G'.
+
+ -- GIMPLE function: tree gimple_phi_result (gimple g)
+ Return the `SSA' name created by `GIMPLE_PHI' `G'.
+
+ -- GIMPLE function: tree *gimple_phi_result_ptr (gimple g)
+ Return a pointer to the `SSA' name created by `GIMPLE_PHI' `G'.
+
+ -- GIMPLE function: void gimple_phi_set_result (gimple g, tree result)
+ Set `RESULT' to be the `SSA' name created by `GIMPLE_PHI' `G'.
+
+ -- GIMPLE function: struct phi_arg_d *gimple_phi_arg (gimple g, index)
+ Return the `PHI' argument corresponding to incoming edge `INDEX'
+ for `GIMPLE_PHI' `G'.
+
+ -- GIMPLE function: void gimple_phi_set_arg (gimple g, index, struct
+ phi_arg_d * phiarg)
+ Set `PHIARG' to be the argument corresponding to incoming edge
+ `INDEX' for `GIMPLE_PHI' `G'.
+
+
+File: gccint.info, Node: `GIMPLE_RESX', Next: `GIMPLE_RETURN', Prev: `GIMPLE_PHI', Up: Tuple specific accessors
+
+12.7.24 `GIMPLE_RESX'
+---------------------
+
+ -- GIMPLE function: gimple gimple_build_resx (int region)
+ Build a `GIMPLE_RESX' statement which is a statement. This
+ statement is a placeholder for _Unwind_Resume before we know if a
+ function call or a branch is needed. `REGION' is the exception
+ region from which control is flowing.
+
+ -- GIMPLE function: int gimple_resx_region (gimple g)
+ Return the region number for `GIMPLE_RESX' `G'.
+
+ -- GIMPLE function: void gimple_resx_set_region (gimple g, int region)
+ Set `REGION' to be the region number for `GIMPLE_RESX' `G'.
+
+
+File: gccint.info, Node: `GIMPLE_RETURN', Next: `GIMPLE_SWITCH', Prev: `GIMPLE_RESX', Up: Tuple specific accessors
+
+12.7.25 `GIMPLE_RETURN'
+-----------------------
+
+ -- GIMPLE function: gimple gimple_build_return (tree retval)
+ Build a `GIMPLE_RETURN' statement whose return value is retval.
+
+ -- GIMPLE function: tree gimple_return_retval (gimple g)
+ Return the return value for `GIMPLE_RETURN' `G'.
+
+ -- GIMPLE function: void gimple_return_set_retval (gimple g, tree
+ retval)
+ Set `RETVAL' to be the return value for `GIMPLE_RETURN' `G'.
+
+
+File: gccint.info, Node: `GIMPLE_SWITCH', Next: `GIMPLE_TRY', Prev: `GIMPLE_RETURN', Up: Tuple specific accessors
+
+12.7.26 `GIMPLE_SWITCH'
+-----------------------
+
+ -- GIMPLE function: gimple gimple_build_switch ( nlabels, tree index,
+ tree default_label, ...)
+ Build a `GIMPLE_SWITCH' statement. `NLABELS' are the number of
+ labels excluding the default label. The default label is passed
+ in `DEFAULT_LABEL'. The rest of the arguments are trees
+ representing the labels. Each label is a tree of code
+ `CASE_LABEL_EXPR'.
+
+ -- GIMPLE function: gimple gimple_build_switch_vec (tree index, tree
+ default_label, `VEC'(tree,heap) *args)
+ This function is an alternate way of building `GIMPLE_SWITCH'
+ statements. `INDEX' and `DEFAULT_LABEL' are as in
+ gimple_build_switch. `ARGS' is a vector of `CASE_LABEL_EXPR' trees
+ that contain the labels.
+
+ -- GIMPLE function: unsigned gimple_switch_num_labels (gimple g)
+ Return the number of labels associated with the switch statement
+ `G'.
+
+ -- GIMPLE function: void gimple_switch_set_num_labels (gimple g,
+ unsigned nlabels)
+ Set `NLABELS' to be the number of labels for the switch statement
+ `G'.
+
+ -- GIMPLE function: tree gimple_switch_index (gimple g)
+ Return the index variable used by the switch statement `G'.
+
+ -- GIMPLE function: void gimple_switch_set_index (gimple g, tree index)
+ Set `INDEX' to be the index variable for switch statement `G'.
+
+ -- GIMPLE function: tree gimple_switch_label (gimple g, unsigned index)
+ Return the label numbered `INDEX'. The default label is 0, followed
+ by any labels in a switch statement.
+
+ -- GIMPLE function: void gimple_switch_set_label (gimple g, unsigned
+ index, tree label)
+ Set the label number `INDEX' to `LABEL'. 0 is always the default
+ label.
+
+ -- GIMPLE function: tree gimple_switch_default_label (gimple g)
+ Return the default label for a switch statement.
+
+ -- GIMPLE function: void gimple_switch_set_default_label (gimple g,
+ tree label)
+ Set the default label for a switch statement.
+
+
+File: gccint.info, Node: `GIMPLE_TRY', Next: `GIMPLE_WITH_CLEANUP_EXPR', Prev: `GIMPLE_SWITCH', Up: Tuple specific accessors
+
+12.7.27 `GIMPLE_TRY'
+--------------------
+
+ -- GIMPLE function: gimple gimple_build_try (gimple_seq eval,
+ gimple_seq cleanup, unsigned int kind)
+ Build a `GIMPLE_TRY' statement. `EVAL' is a sequence with the
+ expression to evaluate. `CLEANUP' is a sequence of statements to
+ run at clean-up time. `KIND' is the enumeration value
+ `GIMPLE_TRY_CATCH' if this statement denotes a try/catch construct
+ or `GIMPLE_TRY_FINALLY' if this statement denotes a try/finally
+ construct.
+
+ -- GIMPLE function: enum gimple_try_flags gimple_try_kind (gimple g)
+ Return the kind of try block represented by `GIMPLE_TRY' `G'. This
+ is either `GIMPLE_TRY_CATCH' or `GIMPLE_TRY_FINALLY'.
+
+ -- GIMPLE function: bool gimple_try_catch_is_cleanup (gimple g)
+ Return the `GIMPLE_TRY_CATCH_IS_CLEANUP' flag.
+
+ -- GIMPLE function: gimple_seq gimple_try_eval (gimple g)
+ Return the sequence of statements used as the body for `GIMPLE_TRY'
+ `G'.
+
+ -- GIMPLE function: gimple_seq gimple_try_cleanup (gimple g)
+ Return the sequence of statements used as the cleanup body for
+ `GIMPLE_TRY' `G'.
+
+ -- GIMPLE function: void gimple_try_set_catch_is_cleanup (gimple g,
+ bool catch_is_cleanup)
+ Set the `GIMPLE_TRY_CATCH_IS_CLEANUP' flag.
+
+ -- GIMPLE function: void gimple_try_set_eval (gimple g, gimple_seq
+ eval)
+ Set `EVAL' to be the sequence of statements to use as the body for
+ `GIMPLE_TRY' `G'.
+
+ -- GIMPLE function: void gimple_try_set_cleanup (gimple g, gimple_seq
+ cleanup)
+ Set `CLEANUP' to be the sequence of statements to use as the
+ cleanup body for `GIMPLE_TRY' `G'.
+
+
+File: gccint.info, Node: `GIMPLE_WITH_CLEANUP_EXPR', Prev: `GIMPLE_TRY', Up: Tuple specific accessors
+
+12.7.28 `GIMPLE_WITH_CLEANUP_EXPR'
+----------------------------------
+
+ -- GIMPLE function: gimple gimple_build_wce (gimple_seq cleanup)
+ Build a `GIMPLE_WITH_CLEANUP_EXPR' statement. `CLEANUP' is the
+ clean-up expression.
+
+ -- GIMPLE function: gimple_seq gimple_wce_cleanup (gimple g)
+ Return the cleanup sequence for cleanup statement `G'.
+
+ -- GIMPLE function: void gimple_wce_set_cleanup (gimple g, gimple_seq
+ cleanup)
+ Set `CLEANUP' to be the cleanup sequence for `G'.
+
+ -- GIMPLE function: bool gimple_wce_cleanup_eh_only (gimple g)
+ Return the `CLEANUP_EH_ONLY' flag for a `WCE' tuple.
+
+ -- GIMPLE function: void gimple_wce_set_cleanup_eh_only (gimple g,
+ bool eh_only_p)
+ Set the `CLEANUP_EH_ONLY' flag for a `WCE' tuple.
+
+
+File: gccint.info, Node: GIMPLE sequences, Next: Sequence iterators, Prev: Tuple specific accessors, Up: GIMPLE
+
+12.8 GIMPLE sequences
+=====================
+
+GIMPLE sequences are the tuple equivalent of `STATEMENT_LIST''s used in
+`GENERIC'. They are used to chain statements together, and when used
+in conjunction with sequence iterators, provide a framework for
+iterating through statements.
+
+ GIMPLE sequences are of type struct `gimple_sequence', but are more
+commonly passed by reference to functions dealing with sequences. The
+type for a sequence pointer is `gimple_seq' which is the same as struct
+`gimple_sequence' *. When declaring a local sequence, you can define a
+local variable of type struct `gimple_sequence'. When declaring a
+sequence allocated on the garbage collected heap, use the function
+`gimple_seq_alloc' documented below.
+
+ There are convenience functions for iterating through sequences in the
+section entitled Sequence Iterators.
+
+ Below is a list of functions to manipulate and query sequences.
+
+ -- GIMPLE function: void gimple_seq_add_stmt (gimple_seq *seq, gimple
+ g)
+ Link a gimple statement to the end of the sequence *`SEQ' if `G' is
+ not `NULL'. If *`SEQ' is `NULL', allocate a sequence before
+ linking.
+
+ -- GIMPLE function: void gimple_seq_add_seq (gimple_seq *dest,
+ gimple_seq src)
+ Append sequence `SRC' to the end of sequence *`DEST' if `SRC' is
+ not `NULL'. If *`DEST' is `NULL', allocate a new sequence before
+ appending.
+
+ -- GIMPLE function: gimple_seq gimple_seq_deep_copy (gimple_seq src)
+ Perform a deep copy of sequence `SRC' and return the result.
+
+ -- GIMPLE function: gimple_seq gimple_seq_reverse (gimple_seq seq)
+ Reverse the order of the statements in the sequence `SEQ'. Return
+ `SEQ'.
+
+ -- GIMPLE function: gimple gimple_seq_first (gimple_seq s)
+ Return the first statement in sequence `S'.
+
+ -- GIMPLE function: gimple gimple_seq_last (gimple_seq s)
+ Return the last statement in sequence `S'.
+
+ -- GIMPLE function: void gimple_seq_set_last (gimple_seq s, gimple
+ last)
+ Set the last statement in sequence `S' to the statement in `LAST'.
+
+ -- GIMPLE function: void gimple_seq_set_first (gimple_seq s, gimple
+ first)
+ Set the first statement in sequence `S' to the statement in
+ `FIRST'.
+
+ -- GIMPLE function: void gimple_seq_init (gimple_seq s)
+ Initialize sequence `S' to an empty sequence.
+
+ -- GIMPLE function: gimple_seq gimple_seq_alloc (void)
+ Allocate a new sequence in the garbage collected store and return
+ it.
+
+ -- GIMPLE function: void gimple_seq_copy (gimple_seq dest, gimple_seq
+ src)
+ Copy the sequence `SRC' into the sequence `DEST'.
+
+ -- GIMPLE function: bool gimple_seq_empty_p (gimple_seq s)
+ Return true if the sequence `S' is empty.
+
+ -- GIMPLE function: gimple_seq bb_seq (basic_block bb)
+ Returns the sequence of statements in `BB'.
+
+ -- GIMPLE function: void set_bb_seq (basic_block bb, gimple_seq seq)
+ Sets the sequence of statements in `BB' to `SEQ'.
+
+ -- GIMPLE function: bool gimple_seq_singleton_p (gimple_seq seq)
+ Determine whether `SEQ' contains exactly one statement.
+
+
+File: gccint.info, Node: Sequence iterators, Next: Adding a new GIMPLE statement code, Prev: GIMPLE sequences, Up: GIMPLE
+
+12.9 Sequence iterators
+=======================
+
+Sequence iterators are convenience constructs for iterating through
+statements in a sequence. Given a sequence `SEQ', here is a typical
+use of gimple sequence iterators:
+
+ gimple_stmt_iterator gsi;
+
+ for (gsi = gsi_start (seq); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple g = gsi_stmt (gsi);
+ /* Do something with gimple statement `G'. */
+ }
+
+ Backward iterations are possible:
+
+ for (gsi = gsi_last (seq); !gsi_end_p (gsi); gsi_prev (&gsi))
+
+ Forward and backward iterations on basic blocks are possible with
+`gsi_start_bb' and `gsi_last_bb'.
+
+ In the documentation below we sometimes refer to enum
+`gsi_iterator_update'. The valid options for this enumeration are:
+
+ * `GSI_NEW_STMT' Only valid when a single statement is added. Move
+ the iterator to it.
+
+ * `GSI_SAME_STMT' Leave the iterator at the same statement.
+
+ * `GSI_CONTINUE_LINKING' Move iterator to whatever position is
+ suitable for linking other statements in the same direction.
+
+ Below is a list of the functions used to manipulate and use statement
+iterators.
+
+ -- GIMPLE function: gimple_stmt_iterator gsi_start (gimple_seq seq)
+ Return a new iterator pointing to the sequence `SEQ''s first
+ statement. If `SEQ' is empty, the iterator's basic block is
+ `NULL'. Use `gsi_start_bb' instead when the iterator needs to
+ always have the correct basic block set.
+
+ -- GIMPLE function: gimple_stmt_iterator gsi_start_bb (basic_block bb)
+ Return a new iterator pointing to the first statement in basic
+ block `BB'.
+
+ -- GIMPLE function: gimple_stmt_iterator gsi_last (gimple_seq seq)
+ Return a new iterator initially pointing to the last statement of
+ sequence `SEQ'. If `SEQ' is empty, the iterator's basic block is
+ `NULL'. Use `gsi_last_bb' instead when the iterator needs to
+ always have the correct basic block set.
+
+ -- GIMPLE function: gimple_stmt_iterator gsi_last_bb (basic_block bb)
+ Return a new iterator pointing to the last statement in basic
+ block `BB'.
+
+ -- GIMPLE function: bool gsi_end_p (gimple_stmt_iterator i)
+ Return `TRUE' if at the end of `I'.
+
+ -- GIMPLE function: bool gsi_one_before_end_p (gimple_stmt_iterator i)
+ Return `TRUE' if we're one statement before the end of `I'.
+
+ -- GIMPLE function: void gsi_next (gimple_stmt_iterator *i)
+ Advance the iterator to the next gimple statement.
+
+ -- GIMPLE function: void gsi_prev (gimple_stmt_iterator *i)
+ Advance the iterator to the previous gimple statement.
+
+ -- GIMPLE function: gimple gsi_stmt (gimple_stmt_iterator i)
+ Return the current stmt.
+
+ -- GIMPLE function: gimple_stmt_iterator gsi_after_labels (basic_block
+ bb)
+ Return a block statement iterator that points to the first
+ non-label statement in block `BB'.
+
+ -- GIMPLE function: gimple *gsi_stmt_ptr (gimple_stmt_iterator *i)
+ Return a pointer to the current stmt.
+
+ -- GIMPLE function: basic_block gsi_bb (gimple_stmt_iterator i)
+ Return the basic block associated with this iterator.
+
+ -- GIMPLE function: gimple_seq gsi_seq (gimple_stmt_iterator i)
+ Return the sequence associated with this iterator.
+
+ -- GIMPLE function: void gsi_remove (gimple_stmt_iterator *i, bool
+ remove_eh_info)
+ Remove the current stmt from the sequence. The iterator is
+ updated to point to the next statement. When `REMOVE_EH_INFO' is
+ true we remove the statement pointed to by iterator `I' from the
+ `EH' tables. Otherwise we do not modify the `EH' tables.
+ Generally, `REMOVE_EH_INFO' should be true when the statement is
+ going to be removed from the `IL' and not reinserted elsewhere.
+
+ -- GIMPLE function: void gsi_link_seq_before (gimple_stmt_iterator *i,
+ gimple_seq seq, enum gsi_iterator_update mode)
+ Links the sequence of statements `SEQ' before the statement pointed
+ by iterator `I'. `MODE' indicates what to do with the iterator
+ after insertion (see `enum gsi_iterator_update' above).
+
+ -- GIMPLE function: void gsi_link_before (gimple_stmt_iterator *i,
+ gimple g, enum gsi_iterator_update mode)
+ Links statement `G' before the statement pointed-to by iterator
+ `I'. Updates iterator `I' according to `MODE'.
+
+ -- GIMPLE function: void gsi_link_seq_after (gimple_stmt_iterator *i,
+ gimple_seq seq, enum gsi_iterator_update mode)
+ Links sequence `SEQ' after the statement pointed-to by iterator
+ `I'. `MODE' is as in `gsi_insert_after'.
+
+ -- GIMPLE function: void gsi_link_after (gimple_stmt_iterator *i,
+ gimple g, enum gsi_iterator_update mode)
+ Links statement `G' after the statement pointed-to by iterator `I'.
+ `MODE' is as in `gsi_insert_after'.
+
+ -- GIMPLE function: gimple_seq gsi_split_seq_after
+ (gimple_stmt_iterator i)
+ Move all statements in the sequence after `I' to a new sequence.
+ Return this new sequence.
+
+ -- GIMPLE function: gimple_seq gsi_split_seq_before
+ (gimple_stmt_iterator *i)
+ Move all statements in the sequence before `I' to a new sequence.
+ Return this new sequence.
+
+ -- GIMPLE function: void gsi_replace (gimple_stmt_iterator *i, gimple
+ stmt, bool update_eh_info)
+ Replace the statement pointed-to by `I' to `STMT'. If
+ `UPDATE_EH_INFO' is true, the exception handling information of
+ the original statement is moved to the new statement.
+
+ -- GIMPLE function: void gsi_insert_before (gimple_stmt_iterator *i,
+ gimple stmt, enum gsi_iterator_update mode)
+ Insert statement `STMT' before the statement pointed-to by iterator
+ `I', update `STMT''s basic block and scan it for new operands.
+ `MODE' specifies how to update iterator `I' after insertion (see
+ enum `gsi_iterator_update').
+
+ -- GIMPLE function: void gsi_insert_seq_before (gimple_stmt_iterator
+ *i, gimple_seq seq, enum gsi_iterator_update mode)
+ Like `gsi_insert_before', but for all the statements in `SEQ'.
+
+ -- GIMPLE function: void gsi_insert_after (gimple_stmt_iterator *i,
+ gimple stmt, enum gsi_iterator_update mode)
+ Insert statement `STMT' after the statement pointed-to by iterator
+ `I', update `STMT''s basic block and scan it for new operands.
+ `MODE' specifies how to update iterator `I' after insertion (see
+ enum `gsi_iterator_update').
+
+ -- GIMPLE function: void gsi_insert_seq_after (gimple_stmt_iterator
+ *i, gimple_seq seq, enum gsi_iterator_update mode)
+ Like `gsi_insert_after', but for all the statements in `SEQ'.
+
+ -- GIMPLE function: gimple_stmt_iterator gsi_for_stmt (gimple stmt)
+ Finds iterator for `STMT'.
+
+ -- GIMPLE function: void gsi_move_after (gimple_stmt_iterator *from,
+ gimple_stmt_iterator *to)
+ Move the statement at `FROM' so it comes right after the statement
+ at `TO'.
+
+ -- GIMPLE function: void gsi_move_before (gimple_stmt_iterator *from,
+ gimple_stmt_iterator *to)
+ Move the statement at `FROM' so it comes right before the statement
+ at `TO'.
+
+ -- GIMPLE function: void gsi_move_to_bb_end (gimple_stmt_iterator
+ *from, basic_block bb)
+ Move the statement at `FROM' to the end of basic block `BB'.
+
+ -- GIMPLE function: void gsi_insert_on_edge (edge e, gimple stmt)
+ Add `STMT' to the pending list of edge `E'. No actual insertion is
+ made until a call to `gsi_commit_edge_inserts'() is made.
+
+ -- GIMPLE function: void gsi_insert_seq_on_edge (edge e, gimple_seq
+ seq)
+ Add the sequence of statements in `SEQ' to the pending list of edge
+ `E'. No actual insertion is made until a call to
+ `gsi_commit_edge_inserts'() is made.
+
+ -- GIMPLE function: basic_block gsi_insert_on_edge_immediate (edge e,
+ gimple stmt)
+ Similar to `gsi_insert_on_edge'+`gsi_commit_edge_inserts'. If a
+ new block has to be created, it is returned.
+
+ -- GIMPLE function: void gsi_commit_one_edge_insert (edge e,
+ basic_block *new_bb)
+ Commit insertions pending at edge `E'. If a new block is created,
+ set `NEW_BB' to this block, otherwise set it to `NULL'.
+
+ -- GIMPLE function: void gsi_commit_edge_inserts (void)
+ This routine will commit all pending edge insertions, creating any
+ new basic blocks which are necessary.
+
+
+File: gccint.info, Node: Adding a new GIMPLE statement code, Next: Statement and operand traversals, Prev: Sequence iterators, Up: GIMPLE
+
+12.10 Adding a new GIMPLE statement code
+========================================
+
+The first step in adding a new GIMPLE statement code, is modifying the
+file `gimple.def', which contains all the GIMPLE codes. Then you must
+add a corresponding structure, and an entry in `union
+gimple_statement_d', both of which are located in `gimple.h'. This in
+turn, will require you to add a corresponding `GTY' tag in
+`gsstruct.def', and code to handle this tag in `gss_for_code' which is
+located in `gimple.c'.
+
+ In order for the garbage collector to know the size of the structure
+you created in `gimple.h', you need to add a case to handle your new
+GIMPLE statement in `gimple_size' which is located in `gimple.c'.
+
+ You will probably want to create a function to build the new gimple
+statement in `gimple.c'. The function should be called
+`gimple_build_<`NEW_TUPLE_NAME'>', and should return the new tuple of
+type gimple.
+
+ If your new statement requires accessors for any members or operands
+it may have, put simple inline accessors in `gimple.h' and any
+non-trivial accessors in `gimple.c' with a corresponding prototype in
+`gimple.h'.
+
+
+File: gccint.info, Node: Statement and operand traversals, Prev: Adding a new GIMPLE statement code, Up: GIMPLE
+
+12.11 Statement and operand traversals
+======================================
+
+There are two functions available for walking statements and sequences:
+`walk_gimple_stmt' and `walk_gimple_seq', accordingly, and a third
+function for walking the operands in a statement: `walk_gimple_op'.
+
+ -- GIMPLE function: tree walk_gimple_stmt (gimple_stmt_iterator *gsi,
+ walk_stmt_fn callback_stmt, walk_tree_fn callback_op, struct
+ walk_stmt_info *wi)
+ This function is used to walk the current statement in `GSI',
+ optionally using traversal state stored in `WI'. If `WI' is
+ `NULL', no state is kept during the traversal.
+
+ The callback `CALLBACK_STMT' is called. If `CALLBACK_STMT' returns
+ true, it means that the callback function has handled all the
+ operands of the statement and it is not necessary to walk its
+ operands.
+
+ If `CALLBACK_STMT' is `NULL' or it returns false, `CALLBACK_OP' is
+ called on each operand of the statement via `walk_gimple_op'. If
+ `walk_gimple_op' returns non-`NULL' for any operand, the remaining
+ operands are not scanned.
+
+ The return value is that returned by the last call to
+ `walk_gimple_op', or `NULL_TREE' if no `CALLBACK_OP' is specified.
+
+ -- GIMPLE function: tree walk_gimple_op (gimple stmt, walk_tree_fn
+ callback_op, struct walk_stmt_info *wi)
+ Use this function to walk the operands of statement `STMT'. Every
+ operand is walked via `walk_tree' with optional state information
+ in `WI'.
+
+ `CALLBACK_OP' is called on each operand of `STMT' via `walk_tree'.
+ Additional parameters to `walk_tree' must be stored in `WI'. For
+ each operand `OP', `walk_tree' is called as:
+
+ walk_tree (&`OP', `CALLBACK_OP', `WI', `WI'- `PSET')
+
+ If `CALLBACK_OP' returns non-`NULL' for an operand, the remaining
+ operands are not scanned. The return value is that returned by
+ the last call to `walk_tree', or `NULL_TREE' if no `CALLBACK_OP' is
+ specified.
+
+ -- GIMPLE function: tree walk_gimple_seq (gimple_seq seq, walk_stmt_fn
+ callback_stmt, walk_tree_fn callback_op, struct
+ walk_stmt_info *wi)
+ This function walks all the statements in the sequence `SEQ'
+ calling `walk_gimple_stmt' on each one. `WI' is as in
+ `walk_gimple_stmt'. If `walk_gimple_stmt' returns non-`NULL', the
+ walk is stopped and the value returned. Otherwise, all the
+ statements are walked and `NULL_TREE' returned.
+
+
+File: gccint.info, Node: Tree SSA, Next: RTL, Prev: GIMPLE, Up: Top
+
+13 Analysis and Optimization of GIMPLE tuples
+*********************************************
+
+GCC uses three main intermediate languages to represent the program
+during compilation: GENERIC, GIMPLE and RTL. GENERIC is a
+language-independent representation generated by each front end. It is
+used to serve as an interface between the parser and optimizer.
+GENERIC is a common representation that is able to represent programs
+written in all the languages supported by GCC.
+
+ GIMPLE and RTL are used to optimize the program. GIMPLE is used for
+target and language independent optimizations (e.g., inlining, constant
+propagation, tail call elimination, redundancy elimination, etc). Much
+like GENERIC, GIMPLE is a language independent, tree based
+representation. However, it differs from GENERIC in that the GIMPLE
+grammar is more restrictive: expressions contain no more than 3
+operands (except function calls), it has no control flow structures and
+expressions with side-effects are only allowed on the right hand side
+of assignments. See the chapter describing GENERIC and GIMPLE for more
+details.
+
+ This chapter describes the data structures and functions used in the
+GIMPLE optimizers (also known as "tree optimizers" or "middle end").
+In particular, it focuses on all the macros, data structures, functions
+and programming constructs needed to implement optimization passes for
+GIMPLE.
+
+* Menu:
+
+* Annotations:: Attributes for variables.
+* SSA Operands:: SSA names referenced by GIMPLE statements.
+* SSA:: Static Single Assignment representation.
+* Alias analysis:: Representing aliased loads and stores.
+
+
+File: gccint.info, Node: Annotations, Next: SSA Operands, Up: Tree SSA
+
+13.1 Annotations
+================
+
+The optimizers need to associate attributes with variables during the
+optimization process. For instance, we need to know whether a variable
+has aliases. All these attributes are stored in data structures called
+annotations which are then linked to the field `ann' in `struct
+tree_common'.
+
+ Presently, we define annotations for variables (`var_ann_t').
+Annotations are defined and documented in `tree-flow.h'.
+
+
+File: gccint.info, Node: SSA Operands, Next: SSA, Prev: Annotations, Up: Tree SSA
+
+13.2 SSA Operands
+=================
+
+Almost every GIMPLE statement will contain a reference to a variable or
+memory location. Since statements come in different shapes and sizes,
+their operands are going to be located at various spots inside the
+statement's tree. To facilitate access to the statement's operands,
+they are organized into lists associated inside each statement's
+annotation. Each element in an operand list is a pointer to a
+`VAR_DECL', `PARM_DECL' or `SSA_NAME' tree node. This provides a very
+convenient way of examining and replacing operands.
+
+ Data flow analysis and optimization is done on all tree nodes
+representing variables. Any node for which `SSA_VAR_P' returns nonzero
+is considered when scanning statement operands. However, not all
+`SSA_VAR_P' variables are processed in the same way. For the purposes
+of optimization, we need to distinguish between references to local
+scalar variables and references to globals, statics, structures,
+arrays, aliased variables, etc. The reason is simple, the compiler can
+gather complete data flow information for a local scalar. On the other
+hand, a global variable may be modified by a function call, it may not
+be possible to keep track of all the elements of an array or the fields
+of a structure, etc.
+
+ The operand scanner gathers two kinds of operands: "real" and
+"virtual". An operand for which `is_gimple_reg' returns true is
+considered real, otherwise it is a virtual operand. We also
+distinguish between uses and definitions. An operand is used if its
+value is loaded by the statement (e.g., the operand at the RHS of an
+assignment). If the statement assigns a new value to the operand, the
+operand is considered a definition (e.g., the operand at the LHS of an
+assignment).
+
+ Virtual and real operands also have very different data flow
+properties. Real operands are unambiguous references to the full
+object that they represent. For instance, given
+
+ {
+ int a, b;
+ a = b
+ }
+
+ Since `a' and `b' are non-aliased locals, the statement `a = b' will
+have one real definition and one real use because variable `b' is
+completely modified with the contents of variable `a'. Real definition
+are also known as "killing definitions". Similarly, the use of `a'
+reads all its bits.
+
+ In contrast, virtual operands are used with variables that can have a
+partial or ambiguous reference. This includes structures, arrays,
+globals, and aliased variables. In these cases, we have two types of
+definitions. For globals, structures, and arrays, we can determine from
+a statement whether a variable of these types has a killing definition.
+If the variable does, then the statement is marked as having a "must
+definition" of that variable. However, if a statement is only defining
+a part of the variable (i.e. a field in a structure), or if we know
+that a statement might define the variable but we cannot say for sure,
+then we mark that statement as having a "may definition". For
+instance, given
+
+ {
+ int a, b, *p;
+
+ if (...)
+ p = &a;
+ else
+ p = &b;
+ *p = 5;
+ return *p;
+ }
+
+ The assignment `*p = 5' may be a definition of `a' or `b'. If we
+cannot determine statically where `p' is pointing to at the time of the
+store operation, we create virtual definitions to mark that statement
+as a potential definition site for `a' and `b'. Memory loads are
+similarly marked with virtual use operands. Virtual operands are shown
+in tree dumps right before the statement that contains them. To
+request a tree dump with virtual operands, use the `-vops' option to
+`-fdump-tree':
+
+ {
+ int a, b, *p;
+
+ if (...)
+ p = &a;
+ else
+ p = &b;
+ # a = VDEF <a>
+ # b = VDEF <b>
+ *p = 5;
+
+ # VUSE <a>
+ # VUSE <b>
+ return *p;
+ }
+
+ Notice that `VDEF' operands have two copies of the referenced
+variable. This indicates that this is not a killing definition of that
+variable. In this case we refer to it as a "may definition" or
+"aliased store". The presence of the second copy of the variable in
+the `VDEF' operand will become important when the function is converted
+into SSA form. This will be used to link all the non-killing
+definitions to prevent optimizations from making incorrect assumptions
+about them.
+
+ Operands are updated as soon as the statement is finished via a call
+to `update_stmt'. If statement elements are changed via `SET_USE' or
+`SET_DEF', then no further action is required (i.e., those macros take
+care of updating the statement). If changes are made by manipulating
+the statement's tree directly, then a call must be made to
+`update_stmt' when complete. Calling one of the `bsi_insert' routines
+or `bsi_replace' performs an implicit call to `update_stmt'.
+
+13.2.1 Operand Iterators And Access Routines
+--------------------------------------------
+
+Operands are collected by `tree-ssa-operands.c'. They are stored
+inside each statement's annotation and can be accessed through either
+the operand iterators or an access routine.
+
+ The following access routines are available for examining operands:
+
+ 1. `SINGLE_SSA_{USE,DEF,TREE}_OPERAND': These accessors will return
+ NULL unless there is exactly one operand matching the specified
+ flags. If there is exactly one operand, the operand is returned
+ as either a `tree', `def_operand_p', or `use_operand_p'.
+
+ tree t = SINGLE_SSA_TREE_OPERAND (stmt, flags);
+ use_operand_p u = SINGLE_SSA_USE_OPERAND (stmt, SSA_ALL_VIRTUAL_USES);
+ def_operand_p d = SINGLE_SSA_DEF_OPERAND (stmt, SSA_OP_ALL_DEFS);
+
+ 2. `ZERO_SSA_OPERANDS': This macro returns true if there are no
+ operands matching the specified flags.
+
+ if (ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS))
+ return;
+
+ 3. `NUM_SSA_OPERANDS': This macro Returns the number of operands
+ matching 'flags'. This actually executes a loop to perform the
+ count, so only use this if it is really needed.
+
+ int count = NUM_SSA_OPERANDS (stmt, flags)
+
+ If you wish to iterate over some or all operands, use the
+`FOR_EACH_SSA_{USE,DEF,TREE}_OPERAND' iterator. For example, to print
+all the operands for a statement:
+
+ void
+ print_ops (tree stmt)
+ {
+ ssa_op_iter;
+ tree var;
+
+ FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_ALL_OPERANDS)
+ print_generic_expr (stderr, var, TDF_SLIM);
+ }
+
+ How to choose the appropriate iterator:
+
+ 1. Determine whether you are need to see the operand pointers, or
+ just the trees, and choose the appropriate macro:
+
+ Need Macro:
+ ---- -------
+ use_operand_p FOR_EACH_SSA_USE_OPERAND
+ def_operand_p FOR_EACH_SSA_DEF_OPERAND
+ tree FOR_EACH_SSA_TREE_OPERAND
+
+ 2. You need to declare a variable of the type you are interested in,
+ and an ssa_op_iter structure which serves as the loop controlling
+ variable.
+
+ 3. Determine which operands you wish to use, and specify the flags of
+ those you are interested in. They are documented in
+ `tree-ssa-operands.h':
+
+ #define SSA_OP_USE 0x01 /* Real USE operands. */
+ #define SSA_OP_DEF 0x02 /* Real DEF operands. */
+ #define SSA_OP_VUSE 0x04 /* VUSE operands. */
+ #define SSA_OP_VMAYUSE 0x08 /* USE portion of VDEFS. */
+ #define SSA_OP_VDEF 0x10 /* DEF portion of VDEFS. */
+
+ /* These are commonly grouped operand flags. */
+ #define SSA_OP_VIRTUAL_USES (SSA_OP_VUSE | SSA_OP_VMAYUSE)
+ #define SSA_OP_VIRTUAL_DEFS (SSA_OP_VDEF)
+ #define SSA_OP_ALL_USES (SSA_OP_VIRTUAL_USES | SSA_OP_USE)
+ #define SSA_OP_ALL_DEFS (SSA_OP_VIRTUAL_DEFS | SSA_OP_DEF)
+ #define SSA_OP_ALL_OPERANDS (SSA_OP_ALL_USES | SSA_OP_ALL_DEFS)
+
+ So if you want to look at the use pointers for all the `USE' and
+`VUSE' operands, you would do something like:
+
+ use_operand_p use_p;
+ ssa_op_iter iter;
+
+ FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, (SSA_OP_USE | SSA_OP_VUSE))
+ {
+ process_use_ptr (use_p);
+ }
+
+ The `TREE' macro is basically the same as the `USE' and `DEF' macros,
+only with the use or def dereferenced via `USE_FROM_PTR (use_p)' and
+`DEF_FROM_PTR (def_p)'. Since we aren't using operand pointers, use
+and defs flags can be mixed.
+
+ tree var;
+ ssa_op_iter iter;
+
+ FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_VUSE)
+ {
+ print_generic_expr (stderr, var, TDF_SLIM);
+ }
+
+ `VDEF's are broken into two flags, one for the `DEF' portion
+(`SSA_OP_VDEF') and one for the USE portion (`SSA_OP_VMAYUSE'). If all
+you want to look at are the `VDEF's together, there is a fourth
+iterator macro for this, which returns both a def_operand_p and a
+use_operand_p for each `VDEF' in the statement. Note that you don't
+need any flags for this one.
+
+ use_operand_p use_p;
+ def_operand_p def_p;
+ ssa_op_iter iter;
+
+ FOR_EACH_SSA_MAYDEF_OPERAND (def_p, use_p, stmt, iter)
+ {
+ my_code;
+ }
+
+ There are many examples in the code as well, as well as the
+documentation in `tree-ssa-operands.h'.
+
+ There are also a couple of variants on the stmt iterators regarding PHI
+nodes.
+
+ `FOR_EACH_PHI_ARG' Works exactly like `FOR_EACH_SSA_USE_OPERAND',
+except it works over `PHI' arguments instead of statement operands.
+
+ /* Look at every virtual PHI use. */
+ FOR_EACH_PHI_ARG (use_p, phi_stmt, iter, SSA_OP_VIRTUAL_USES)
+ {
+ my_code;
+ }
+
+ /* Look at every real PHI use. */
+ FOR_EACH_PHI_ARG (use_p, phi_stmt, iter, SSA_OP_USES)
+ my_code;
+
+ /* Look at every PHI use. */
+ FOR_EACH_PHI_ARG (use_p, phi_stmt, iter, SSA_OP_ALL_USES)
+ my_code;
+
+ `FOR_EACH_PHI_OR_STMT_{USE,DEF}' works exactly like
+`FOR_EACH_SSA_{USE,DEF}_OPERAND', except it will function on either a
+statement or a `PHI' node. These should be used when it is appropriate
+but they are not quite as efficient as the individual `FOR_EACH_PHI'
+and `FOR_EACH_SSA' routines.
+
+ FOR_EACH_PHI_OR_STMT_USE (use_operand_p, stmt, iter, flags)
+ {
+ my_code;
+ }
+
+ FOR_EACH_PHI_OR_STMT_DEF (def_operand_p, phi, iter, flags)
+ {
+ my_code;
+ }
+
+13.2.2 Immediate Uses
+---------------------
+
+Immediate use information is now always available. Using the immediate
+use iterators, you may examine every use of any `SSA_NAME'. For
+instance, to change each use of `ssa_var' to `ssa_var2' and call
+fold_stmt on each stmt after that is done:
+
+ use_operand_p imm_use_p;
+ imm_use_iterator iterator;
+ tree ssa_var, stmt;
+
+
+ FOR_EACH_IMM_USE_STMT (stmt, iterator, ssa_var)
+ {
+ FOR_EACH_IMM_USE_ON_STMT (imm_use_p, iterator)
+ SET_USE (imm_use_p, ssa_var_2);
+ fold_stmt (stmt);
+ }
+
+ There are 2 iterators which can be used. `FOR_EACH_IMM_USE_FAST' is
+used when the immediate uses are not changed, i.e., you are looking at
+the uses, but not setting them.
+
+ If they do get changed, then care must be taken that things are not
+changed under the iterators, so use the `FOR_EACH_IMM_USE_STMT' and
+`FOR_EACH_IMM_USE_ON_STMT' iterators. They attempt to preserve the
+sanity of the use list by moving all the uses for a statement into a
+controlled position, and then iterating over those uses. Then the
+optimization can manipulate the stmt when all the uses have been
+processed. This is a little slower than the FAST version since it adds
+a placeholder element and must sort through the list a bit for each
+statement. This placeholder element must be also be removed if the
+loop is terminated early. The macro `BREAK_FROM_IMM_USE_SAFE' is
+provided to do this :
+
+ FOR_EACH_IMM_USE_STMT (stmt, iterator, ssa_var)
+ {
+ if (stmt == last_stmt)
+ BREAK_FROM_SAFE_IMM_USE (iter);
+
+ FOR_EACH_IMM_USE_ON_STMT (imm_use_p, iterator)
+ SET_USE (imm_use_p, ssa_var_2);
+ fold_stmt (stmt);
+ }
+
+ There are checks in `verify_ssa' which verify that the immediate use
+list is up to date, as well as checking that an optimization didn't
+break from the loop without using this macro. It is safe to simply
+'break'; from a `FOR_EACH_IMM_USE_FAST' traverse.
+
+ Some useful functions and macros:
+ 1. `has_zero_uses (ssa_var)' : Returns true if there are no uses of
+ `ssa_var'.
+
+ 2. `has_single_use (ssa_var)' : Returns true if there is only a
+ single use of `ssa_var'.
+
+ 3. `single_imm_use (ssa_var, use_operand_p *ptr, tree *stmt)' :
+ Returns true if there is only a single use of `ssa_var', and also
+ returns the use pointer and statement it occurs in, in the second
+ and third parameters.
+
+ 4. `num_imm_uses (ssa_var)' : Returns the number of immediate uses of
+ `ssa_var'. It is better not to use this if possible since it simply
+ utilizes a loop to count the uses.
+
+ 5. `PHI_ARG_INDEX_FROM_USE (use_p)' : Given a use within a `PHI'
+ node, return the index number for the use. An assert is triggered
+ if the use isn't located in a `PHI' node.
+
+ 6. `USE_STMT (use_p)' : Return the statement a use occurs in.
+
+ Note that uses are not put into an immediate use list until their
+statement is actually inserted into the instruction stream via a
+`bsi_*' routine.
+
+ It is also still possible to utilize lazy updating of statements, but
+this should be used only when absolutely required. Both alias analysis
+and the dominator optimizations currently do this.
+
+ When lazy updating is being used, the immediate use information is out
+of date and cannot be used reliably. Lazy updating is achieved by
+simply marking statements modified via calls to `mark_stmt_modified'
+instead of `update_stmt'. When lazy updating is no longer required,
+all the modified statements must have `update_stmt' called in order to
+bring them up to date. This must be done before the optimization is
+finished, or `verify_ssa' will trigger an abort.
+
+ This is done with a simple loop over the instruction stream:
+ block_stmt_iterator bsi;
+ basic_block bb;
+ FOR_EACH_BB (bb)
+ {
+ for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ update_stmt_if_modified (bsi_stmt (bsi));
+ }
+
+
+File: gccint.info, Node: SSA, Next: Alias analysis, Prev: SSA Operands, Up: Tree SSA
+
+13.3 Static Single Assignment
+=============================
+
+Most of the tree optimizers rely on the data flow information provided
+by the Static Single Assignment (SSA) form. We implement the SSA form
+as described in `R. Cytron, J. Ferrante, B. Rosen, M. Wegman, and K.
+Zadeck. Efficiently Computing Static Single Assignment Form and the
+Control Dependence Graph. ACM Transactions on Programming Languages
+and Systems, 13(4):451-490, October 1991'.
+
+ The SSA form is based on the premise that program variables are
+assigned in exactly one location in the program. Multiple assignments
+to the same variable create new versions of that variable. Naturally,
+actual programs are seldom in SSA form initially because variables tend
+to be assigned multiple times. The compiler modifies the program
+representation so that every time a variable is assigned in the code, a
+new version of the variable is created. Different versions of the same
+variable are distinguished by subscripting the variable name with its
+version number. Variables used in the right-hand side of expressions
+are renamed so that their version number matches that of the most
+recent assignment.
+
+ We represent variable versions using `SSA_NAME' nodes. The renaming
+process in `tree-ssa.c' wraps every real and virtual operand with an
+`SSA_NAME' node which contains the version number and the statement
+that created the `SSA_NAME'. Only definitions and virtual definitions
+may create new `SSA_NAME' nodes.
+
+ Sometimes, flow of control makes it impossible to determine the most
+recent version of a variable. In these cases, the compiler inserts an
+artificial definition for that variable called "PHI function" or "PHI
+node". This new definition merges all the incoming versions of the
+variable to create a new name for it. For instance,
+
+ if (...)
+ a_1 = 5;
+ else if (...)
+ a_2 = 2;
+ else
+ a_3 = 13;
+
+ # a_4 = PHI <a_1, a_2, a_3>
+ return a_4;
+
+ Since it is not possible to determine which of the three branches will
+be taken at runtime, we don't know which of `a_1', `a_2' or `a_3' to
+use at the return statement. So, the SSA renamer creates a new version
+`a_4' which is assigned the result of "merging" `a_1', `a_2' and `a_3'.
+Hence, PHI nodes mean "one of these operands. I don't know which".
+
+ The following macros can be used to examine PHI nodes
+
+ -- Macro: PHI_RESULT (PHI)
+ Returns the `SSA_NAME' created by PHI node PHI (i.e., PHI's LHS).
+
+ -- Macro: PHI_NUM_ARGS (PHI)
+ Returns the number of arguments in PHI. This number is exactly
+ the number of incoming edges to the basic block holding PHI.
+
+ -- Macro: PHI_ARG_ELT (PHI, I)
+ Returns a tuple representing the Ith argument of PHI. Each
+ element of this tuple contains an `SSA_NAME' VAR and the incoming
+ edge through which VAR flows.
+
+ -- Macro: PHI_ARG_EDGE (PHI, I)
+ Returns the incoming edge for the Ith argument of PHI.
+
+ -- Macro: PHI_ARG_DEF (PHI, I)
+ Returns the `SSA_NAME' for the Ith argument of PHI.
+
+13.3.1 Preserving the SSA form
+------------------------------
+
+Some optimization passes make changes to the function that invalidate
+the SSA property. This can happen when a pass has added new symbols or
+changed the program so that variables that were previously aliased
+aren't anymore. Whenever something like this happens, the affected
+symbols must be renamed into SSA form again. Transformations that emit
+new code or replicate existing statements will also need to update the
+SSA form.
+
+ Since GCC implements two different SSA forms for register and virtual
+variables, keeping the SSA form up to date depends on whether you are
+updating register or virtual names. In both cases, the general idea
+behind incremental SSA updates is similar: when new SSA names are
+created, they typically are meant to replace other existing names in
+the program.
+
+ For instance, given the following code:
+
+ 1 L0:
+ 2 x_1 = PHI (0, x_5)
+ 3 if (x_1 < 10)
+ 4 if (x_1 > 7)
+ 5 y_2 = 0
+ 6 else
+ 7 y_3 = x_1 + x_7
+ 8 endif
+ 9 x_5 = x_1 + 1
+ 10 goto L0;
+ 11 endif
+
+ Suppose that we insert new names `x_10' and `x_11' (lines `4' and `8').
+
+ 1 L0:
+ 2 x_1 = PHI (0, x_5)
+ 3 if (x_1 < 10)
+ 4 x_10 = ...
+ 5 if (x_1 > 7)
+ 6 y_2 = 0
+ 7 else
+ 8 x_11 = ...
+ 9 y_3 = x_1 + x_7
+ 10 endif
+ 11 x_5 = x_1 + 1
+ 12 goto L0;
+ 13 endif
+
+ We want to replace all the uses of `x_1' with the new definitions of
+`x_10' and `x_11'. Note that the only uses that should be replaced are
+those at lines `5', `9' and `11'. Also, the use of `x_7' at line `9'
+should _not_ be replaced (this is why we cannot just mark symbol `x' for
+renaming).
+
+ Additionally, we may need to insert a PHI node at line `11' because
+that is a merge point for `x_10' and `x_11'. So the use of `x_1' at
+line `11' will be replaced with the new PHI node. The insertion of PHI
+nodes is optional. They are not strictly necessary to preserve the SSA
+form, and depending on what the caller inserted, they may not even be
+useful for the optimizers.
+
+ Updating the SSA form is a two step process. First, the pass has to
+identify which names need to be updated and/or which symbols need to be
+renamed into SSA form for the first time. When new names are
+introduced to replace existing names in the program, the mapping
+between the old and the new names are registered by calling
+`register_new_name_mapping' (note that if your pass creates new code by
+duplicating basic blocks, the call to `tree_duplicate_bb' will set up
+the necessary mappings automatically). On the other hand, if your pass
+exposes a new symbol that should be put in SSA form for the first time,
+the new symbol should be registered with `mark_sym_for_renaming'.
+
+ After the replacement mappings have been registered and new symbols
+marked for renaming, a call to `update_ssa' makes the registered
+changes. This can be done with an explicit call or by creating `TODO'
+flags in the `tree_opt_pass' structure for your pass. There are
+several `TODO' flags that control the behavior of `update_ssa':
+
+ * `TODO_update_ssa'. Update the SSA form inserting PHI nodes for
+ newly exposed symbols and virtual names marked for updating. When
+ updating real names, only insert PHI nodes for a real name `O_j'
+ in blocks reached by all the new and old definitions for `O_j'.
+ If the iterated dominance frontier for `O_j' is not pruned, we may
+ end up inserting PHI nodes in blocks that have one or more edges
+ with no incoming definition for `O_j'. This would lead to
+ uninitialized warnings for `O_j''s symbol.
+
+ * `TODO_update_ssa_no_phi'. Update the SSA form without inserting
+ any new PHI nodes at all. This is used by passes that have either
+ inserted all the PHI nodes themselves or passes that need only to
+ patch use-def and def-def chains for virtuals (e.g., DCE).
+
+ * `TODO_update_ssa_full_phi'. Insert PHI nodes everywhere they are
+ needed. No pruning of the IDF is done. This is used by passes
+ that need the PHI nodes for `O_j' even if it means that some
+ arguments will come from the default definition of `O_j''s symbol
+ (e.g., `pass_linear_transform').
+
+ WARNING: If you need to use this flag, chances are that your pass
+ may be doing something wrong. Inserting PHI nodes for an old name
+ where not all edges carry a new replacement may lead to silent
+ codegen errors or spurious uninitialized warnings.
+
+ * `TODO_update_ssa_only_virtuals'. Passes that update the SSA form
+ on their own may want to delegate the updating of virtual names to
+ the generic updater. Since FUD chains are easier to maintain,
+ this simplifies the work they need to do. NOTE: If this flag is
+ used, any OLD->NEW mappings for real names are explicitly
+ destroyed and only the symbols marked for renaming are processed.
+
+13.3.2 Preserving the virtual SSA form
+--------------------------------------
+
+The virtual SSA form is harder to preserve than the non-virtual SSA form
+mainly because the set of virtual operands for a statement may change at
+what some would consider unexpected times. In general, statement
+modifications should be bracketed between calls to `push_stmt_changes'
+and `pop_stmt_changes'. For example,
+
+ munge_stmt (tree stmt)
+ {
+ push_stmt_changes (&stmt);
+ ... rewrite STMT ...
+ pop_stmt_changes (&stmt);
+ }
+
+ The call to `push_stmt_changes' saves the current state of the
+statement operands and the call to `pop_stmt_changes' compares the
+saved state with the current one and does the appropriate symbol
+marking for the SSA renamer.
+
+ It is possible to modify several statements at a time, provided that
+`push_stmt_changes' and `pop_stmt_changes' are called in LIFO order, as
+when processing a stack of statements.
+
+ Additionally, if the pass discovers that it did not need to make
+changes to the statement after calling `push_stmt_changes', it can
+simply discard the topmost change buffer by calling
+`discard_stmt_changes'. This will avoid the expensive operand re-scan
+operation and the buffer comparison that determines if symbols need to
+be marked for renaming.
+
+13.3.3 Examining `SSA_NAME' nodes
+---------------------------------
+
+The following macros can be used to examine `SSA_NAME' nodes
+
+ -- Macro: SSA_NAME_DEF_STMT (VAR)
+ Returns the statement S that creates the `SSA_NAME' VAR. If S is
+ an empty statement (i.e., `IS_EMPTY_STMT (S)' returns `true'), it
+ means that the first reference to this variable is a USE or a VUSE.
+
+ -- Macro: SSA_NAME_VERSION (VAR)
+ Returns the version number of the `SSA_NAME' object VAR.
+
+13.3.4 Walking use-def chains
+-----------------------------
+
+ -- Tree SSA function: void walk_use_def_chains (VAR, FN, DATA)
+ Walks use-def chains starting at the `SSA_NAME' node VAR. Calls
+ function FN at each reaching definition found. Function FN takes
+ three arguments: VAR, its defining statement (DEF_STMT) and a
+ generic pointer to whatever state information that FN may want to
+ maintain (DATA). Function FN is able to stop the walk by
+ returning `true', otherwise in order to continue the walk, FN
+ should return `false'.
+
+ Note, that if DEF_STMT is a `PHI' node, the semantics are slightly
+ different. For each argument ARG of the PHI node, this function
+ will:
+
+ 1. Walk the use-def chains for ARG.
+
+ 2. Call `FN (ARG, PHI, DATA)'.
+
+ Note how the first argument to FN is no longer the original
+ variable VAR, but the PHI argument currently being examined. If
+ FN wants to get at VAR, it should call `PHI_RESULT' (PHI).
+
+13.3.5 Walking the dominator tree
+---------------------------------
+
+ -- Tree SSA function: void walk_dominator_tree (WALK_DATA, BB)
+ This function walks the dominator tree for the current CFG calling
+ a set of callback functions defined in STRUCT DOM_WALK_DATA in
+ `domwalk.h'. The call back functions you need to define give you
+ hooks to execute custom code at various points during traversal:
+
+ 1. Once to initialize any local data needed while processing BB
+ and its children. This local data is pushed into an internal
+ stack which is automatically pushed and popped as the walker
+ traverses the dominator tree.
+
+ 2. Once before traversing all the statements in the BB.
+
+ 3. Once for every statement inside BB.
+
+ 4. Once after traversing all the statements and before recursing
+ into BB's dominator children.
+
+ 5. It then recurses into all the dominator children of BB.
+
+ 6. After recursing into all the dominator children of BB it can,
+ optionally, traverse every statement in BB again (i.e.,
+ repeating steps 2 and 3).
+
+ 7. Once after walking the statements in BB and BB's dominator
+ children. At this stage, the block local data stack is
+ popped.
+
+
+File: gccint.info, Node: Alias analysis, Prev: SSA, Up: Tree SSA
+
+13.4 Alias analysis
+===================
+
+Alias analysis proceeds in 4 main phases:
+
+ 1. Structural alias analysis.
+
+ This phase walks the types for structure variables, and determines
+ which of the fields can overlap using offset and size of each
+ field. For each field, a "subvariable" called a "Structure field
+ tag" (SFT) is created, which represents that field as a separate
+ variable. All accesses that could possibly overlap with a given
+ field will have virtual operands for the SFT of that field.
+
+ struct foo
+ {
+ int a;
+ int b;
+ }
+ struct foo temp;
+ int bar (void)
+ {
+ int tmp1, tmp2, tmp3;
+ SFT.0_2 = VDEF <SFT.0_1>
+ temp.a = 5;
+ SFT.1_4 = VDEF <SFT.1_3>
+ temp.b = 6;
+
+ VUSE <SFT.1_4>
+ tmp1_5 = temp.b;
+ VUSE <SFT.0_2>
+ tmp2_6 = temp.a;
+
+ tmp3_7 = tmp1_5 + tmp2_6;
+ return tmp3_7;
+ }
+
+ If you copy the symbol tag for a variable for some reason, you
+ probably also want to copy the subvariables for that variable.
+
+ 2. Points-to and escape analysis.
+
+ This phase walks the use-def chains in the SSA web looking for
+ three things:
+
+ * Assignments of the form `P_i = &VAR'
+
+ * Assignments of the form P_i = malloc()
+
+ * Pointers and ADDR_EXPR that escape the current function.
+
+ The concept of `escaping' is the same one used in the Java world.
+ When a pointer or an ADDR_EXPR escapes, it means that it has been
+ exposed outside of the current function. So, assignment to global
+ variables, function arguments and returning a pointer are all
+ escape sites.
+
+ This is where we are currently limited. Since not everything is
+ renamed into SSA, we lose track of escape properties when a
+ pointer is stashed inside a field in a structure, for instance.
+ In those cases, we are assuming that the pointer does escape.
+
+ We use escape analysis to determine whether a variable is
+ call-clobbered. Simply put, if an ADDR_EXPR escapes, then the
+ variable is call-clobbered. If a pointer P_i escapes, then all
+ the variables pointed-to by P_i (and its memory tag) also escape.
+
+ 3. Compute flow-sensitive aliases
+
+ We have two classes of memory tags. Memory tags associated with
+ the pointed-to data type of the pointers in the program. These
+ tags are called "symbol memory tag" (SMT). The other class are
+ those associated with SSA_NAMEs, called "name memory tag" (NMT).
+ The basic idea is that when adding operands for an INDIRECT_REF
+ *P_i, we will first check whether P_i has a name tag, if it does
+ we use it, because that will have more precise aliasing
+ information. Otherwise, we use the standard symbol tag.
+
+ In this phase, we go through all the pointers we found in
+ points-to analysis and create alias sets for the name memory tags
+ associated with each pointer P_i. If P_i escapes, we mark
+ call-clobbered the variables it points to and its tag.
+
+ 4. Compute flow-insensitive aliases
+
+ This pass will compare the alias set of every symbol memory tag and
+ every addressable variable found in the program. Given a symbol
+ memory tag SMT and an addressable variable V. If the alias sets
+ of SMT and V conflict (as computed by may_alias_p), then V is
+ marked as an alias tag and added to the alias set of SMT.
+
+ Every language that wishes to perform language-specific alias
+ analysis should define a function that computes, given a `tree'
+ node, an alias set for the node. Nodes in different alias sets
+ are not allowed to alias. For an example, see the C front-end
+ function `c_get_alias_set'.
+
+ For instance, consider the following function:
+
+ foo (int i)
+ {
+ int *p, *q, a, b;
+
+ if (i > 10)
+ p = &a;
+ else
+ q = &b;
+
+ *p = 3;
+ *q = 5;
+ a = b + 2;
+ return *p;
+ }
+
+ After aliasing analysis has finished, the symbol memory tag for
+pointer `p' will have two aliases, namely variables `a' and `b'. Every
+time pointer `p' is dereferenced, we want to mark the operation as a
+potential reference to `a' and `b'.
+
+ foo (int i)
+ {
+ int *p, a, b;
+
+ if (i_2 > 10)
+ p_4 = &a;
+ else
+ p_6 = &b;
+ # p_1 = PHI <p_4(1), p_6(2)>;
+
+ # a_7 = VDEF <a_3>;
+ # b_8 = VDEF <b_5>;
+ *p_1 = 3;
+
+ # a_9 = VDEF <a_7>
+ # VUSE <b_8>
+ a_9 = b_8 + 2;
+
+ # VUSE <a_9>;
+ # VUSE <b_8>;
+ return *p_1;
+ }
+
+ In certain cases, the list of may aliases for a pointer may grow too
+large. This may cause an explosion in the number of virtual operands
+inserted in the code. Resulting in increased memory consumption and
+compilation time.
+
+ When the number of virtual operands needed to represent aliased loads
+and stores grows too large (configurable with `--param
+max-aliased-vops'), alias sets are grouped to avoid severe compile-time
+slow downs and memory consumption. The alias grouping heuristic
+proceeds as follows:
+
+ 1. Sort the list of pointers in decreasing number of contributed
+ virtual operands.
+
+ 2. Take the first pointer from the list and reverse the role of the
+ memory tag and its aliases. Usually, whenever an aliased variable
+ Vi is found to alias with a memory tag T, we add Vi to the
+ may-aliases set for T. Meaning that after alias analysis, we will
+ have:
+
+ may-aliases(T) = { V1, V2, V3, ..., Vn }
+
+ This means that every statement that references T, will get `n'
+ virtual operands for each of the Vi tags. But, when alias
+ grouping is enabled, we make T an alias tag and add it to the
+ alias set of all the Vi variables:
+
+ may-aliases(V1) = { T }
+ may-aliases(V2) = { T }
+ ...
+ may-aliases(Vn) = { T }
+
+ This has two effects: (a) statements referencing T will only get a
+ single virtual operand, and, (b) all the variables Vi will now
+ appear to alias each other. So, we lose alias precision to
+ improve compile time. But, in theory, a program with such a high
+ level of aliasing should not be very optimizable in the first
+ place.
+
+ 3. Since variables may be in the alias set of more than one memory
+ tag, the grouping done in step (2) needs to be extended to all the
+ memory tags that have a non-empty intersection with the
+ may-aliases set of tag T. For instance, if we originally had
+ these may-aliases sets:
+
+ may-aliases(T) = { V1, V2, V3 }
+ may-aliases(R) = { V2, V4 }
+
+ In step (2) we would have reverted the aliases for T as:
+
+ may-aliases(V1) = { T }
+ may-aliases(V2) = { T }
+ may-aliases(V3) = { T }
+
+ But note that now V2 is no longer aliased with R. We could add R
+ to may-aliases(V2), but we are in the process of grouping aliases
+ to reduce virtual operands so what we do is add V4 to the grouping
+ to obtain:
+
+ may-aliases(V1) = { T }
+ may-aliases(V2) = { T }
+ may-aliases(V3) = { T }
+ may-aliases(V4) = { T }
+
+ 4. If the total number of virtual operands due to aliasing is still
+ above the threshold set by max-alias-vops, go back to (2).
+
+
+File: gccint.info, Node: Loop Analysis and Representation, Next: Machine Desc, Prev: Control Flow, Up: Top
+
+14 Analysis and Representation of Loops
+***************************************
+
+GCC provides extensive infrastructure for work with natural loops, i.e.,
+strongly connected components of CFG with only one entry block. This
+chapter describes representation of loops in GCC, both on GIMPLE and in
+RTL, as well as the interfaces to loop-related analyses (induction
+variable analysis and number of iterations analysis).
+
+* Menu:
+
+* Loop representation:: Representation and analysis of loops.
+* Loop querying:: Getting information about loops.
+* Loop manipulation:: Loop manipulation functions.
+* LCSSA:: Loop-closed SSA form.
+* Scalar evolutions:: Induction variables on GIMPLE.
+* loop-iv:: Induction variables on RTL.
+* Number of iterations:: Number of iterations analysis.
+* Dependency analysis:: Data dependency analysis.
+* Lambda:: Linear loop transformations framework.
+* Omega:: A solver for linear programming problems.
+
+
+File: gccint.info, Node: Loop representation, Next: Loop querying, Up: Loop Analysis and Representation
+
+14.1 Loop representation
+========================
+
+This chapter describes the representation of loops in GCC, and functions
+that can be used to build, modify and analyze this representation. Most
+of the interfaces and data structures are declared in `cfgloop.h'. At
+the moment, loop structures are analyzed and this information is
+updated only by the optimization passes that deal with loops, but some
+efforts are being made to make it available throughout most of the
+optimization passes.
+
+ In general, a natural loop has one entry block (header) and possibly
+several back edges (latches) leading to the header from the inside of
+the loop. Loops with several latches may appear if several loops share
+a single header, or if there is a branching in the middle of the loop.
+The representation of loops in GCC however allows only loops with a
+single latch. During loop analysis, headers of such loops are split and
+forwarder blocks are created in order to disambiguate their structures.
+Heuristic based on profile information and structure of the induction
+variables in the loops is used to determine whether the latches
+correspond to sub-loops or to control flow in a single loop. This means
+that the analysis sometimes changes the CFG, and if you run it in the
+middle of an optimization pass, you must be able to deal with the new
+blocks. You may avoid CFG changes by passing
+`LOOPS_MAY_HAVE_MULTIPLE_LATCHES' flag to the loop discovery, note
+however that most other loop manipulation functions will not work
+correctly for loops with multiple latch edges (the functions that only
+query membership of blocks to loops and subloop relationships, or
+enumerate and test loop exits, can be expected to work).
+
+ Body of the loop is the set of blocks that are dominated by its header,
+and reachable from its latch against the direction of edges in CFG. The
+loops are organized in a containment hierarchy (tree) such that all the
+loops immediately contained inside loop L are the children of L in the
+tree. This tree is represented by the `struct loops' structure. The
+root of this tree is a fake loop that contains all blocks in the
+function. Each of the loops is represented in a `struct loop'
+structure. Each loop is assigned an index (`num' field of the `struct
+loop' structure), and the pointer to the loop is stored in the
+corresponding field of the `larray' vector in the loops structure. The
+indices do not have to be continuous, there may be empty (`NULL')
+entries in the `larray' created by deleting loops. Also, there is no
+guarantee on the relative order of a loop and its subloops in the
+numbering. The index of a loop never changes.
+
+ The entries of the `larray' field should not be accessed directly.
+The function `get_loop' returns the loop description for a loop with
+the given index. `number_of_loops' function returns number of loops in
+the function. To traverse all loops, use `FOR_EACH_LOOP' macro. The
+`flags' argument of the macro is used to determine the direction of
+traversal and the set of loops visited. Each loop is guaranteed to be
+visited exactly once, regardless of the changes to the loop tree, and
+the loops may be removed during the traversal. The newly created loops
+are never traversed, if they need to be visited, this must be done
+separately after their creation. The `FOR_EACH_LOOP' macro allocates
+temporary variables. If the `FOR_EACH_LOOP' loop were ended using
+break or goto, they would not be released; `FOR_EACH_LOOP_BREAK' macro
+must be used instead.
+
+ Each basic block contains the reference to the innermost loop it
+belongs to (`loop_father'). For this reason, it is only possible to
+have one `struct loops' structure initialized at the same time for each
+CFG. The global variable `current_loops' contains the `struct loops'
+structure. Many of the loop manipulation functions assume that
+dominance information is up-to-date.
+
+ The loops are analyzed through `loop_optimizer_init' function. The
+argument of this function is a set of flags represented in an integer
+bitmask. These flags specify what other properties of the loop
+structures should be calculated/enforced and preserved later:
+
+ * `LOOPS_MAY_HAVE_MULTIPLE_LATCHES': If this flag is set, no changes
+ to CFG will be performed in the loop analysis, in particular,
+ loops with multiple latch edges will not be disambiguated. If a
+ loop has multiple latches, its latch block is set to NULL. Most of
+ the loop manipulation functions will not work for loops in this
+ shape. No other flags that require CFG changes can be passed to
+ loop_optimizer_init.
+
+ * `LOOPS_HAVE_PREHEADERS': Forwarder blocks are created in such a
+ way that each loop has only one entry edge, and additionally, the
+ source block of this entry edge has only one successor. This
+ creates a natural place where the code can be moved out of the
+ loop, and ensures that the entry edge of the loop leads from its
+ immediate super-loop.
+
+ * `LOOPS_HAVE_SIMPLE_LATCHES': Forwarder blocks are created to force
+ the latch block of each loop to have only one successor. This
+ ensures that the latch of the loop does not belong to any of its
+ sub-loops, and makes manipulation with the loops significantly
+ easier. Most of the loop manipulation functions assume that the
+ loops are in this shape. Note that with this flag, the "normal"
+ loop without any control flow inside and with one exit consists of
+ two basic blocks.
+
+ * `LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS': Basic blocks and edges in
+ the strongly connected components that are not natural loops (have
+ more than one entry block) are marked with `BB_IRREDUCIBLE_LOOP'
+ and `EDGE_IRREDUCIBLE_LOOP' flags. The flag is not set for blocks
+ and edges that belong to natural loops that are in such an
+ irreducible region (but it is set for the entry and exit edges of
+ such a loop, if they lead to/from this region).
+
+ * `LOOPS_HAVE_RECORDED_EXITS': The lists of exits are recorded and
+ updated for each loop. This makes some functions (e.g.,
+ `get_loop_exit_edges') more efficient. Some functions (e.g.,
+ `single_exit') can be used only if the lists of exits are recorded.
+
+ These properties may also be computed/enforced later, using functions
+`create_preheaders', `force_single_succ_latches',
+`mark_irreducible_loops' and `record_loop_exits'.
+
+ The memory occupied by the loops structures should be freed with
+`loop_optimizer_finalize' function.
+
+ The CFG manipulation functions in general do not update loop
+structures. Specialized versions that additionally do so are provided
+for the most common tasks. On GIMPLE, `cleanup_tree_cfg_loop' function
+can be used to cleanup CFG while updating the loops structures if
+`current_loops' is set.
+
+
+File: gccint.info, Node: Loop querying, Next: Loop manipulation, Prev: Loop representation, Up: Loop Analysis and Representation
+
+14.2 Loop querying
+==================
+
+The functions to query the information about loops are declared in
+`cfgloop.h'. Some of the information can be taken directly from the
+structures. `loop_father' field of each basic block contains the
+innermost loop to that the block belongs. The most useful fields of
+loop structure (that are kept up-to-date at all times) are:
+
+ * `header', `latch': Header and latch basic blocks of the loop.
+
+ * `num_nodes': Number of basic blocks in the loop (including the
+ basic blocks of the sub-loops).
+
+ * `depth': The depth of the loop in the loops tree, i.e., the number
+ of super-loops of the loop.
+
+ * `outer', `inner', `next': The super-loop, the first sub-loop, and
+ the sibling of the loop in the loops tree.
+
+ There are other fields in the loop structures, many of them used only
+by some of the passes, or not updated during CFG changes; in general,
+they should not be accessed directly.
+
+ The most important functions to query loop structures are:
+
+ * `flow_loops_dump': Dumps the information about loops to a file.
+
+ * `verify_loop_structure': Checks consistency of the loop structures.
+
+ * `loop_latch_edge': Returns the latch edge of a loop.
+
+ * `loop_preheader_edge': If loops have preheaders, returns the
+ preheader edge of a loop.
+
+ * `flow_loop_nested_p': Tests whether loop is a sub-loop of another
+ loop.
+
+ * `flow_bb_inside_loop_p': Tests whether a basic block belongs to a
+ loop (including its sub-loops).
+
+ * `find_common_loop': Finds the common super-loop of two loops.
+
+ * `superloop_at_depth': Returns the super-loop of a loop with the
+ given depth.
+
+ * `tree_num_loop_insns', `num_loop_insns': Estimates the number of
+ insns in the loop, on GIMPLE and on RTL.
+
+ * `loop_exit_edge_p': Tests whether edge is an exit from a loop.
+
+ * `mark_loop_exit_edges': Marks all exit edges of all loops with
+ `EDGE_LOOP_EXIT' flag.
+
+ * `get_loop_body', `get_loop_body_in_dom_order',
+ `get_loop_body_in_bfs_order': Enumerates the basic blocks in the
+ loop in depth-first search order in reversed CFG, ordered by
+ dominance relation, and breath-first search order, respectively.
+
+ * `single_exit': Returns the single exit edge of the loop, or `NULL'
+ if the loop has more than one exit. You can only use this
+ function if LOOPS_HAVE_MARKED_SINGLE_EXITS property is used.
+
+ * `get_loop_exit_edges': Enumerates the exit edges of a loop.
+
+ * `just_once_each_iteration_p': Returns true if the basic block is
+ executed exactly once during each iteration of a loop (that is, it
+ does not belong to a sub-loop, and it dominates the latch of the
+ loop).
+
+
+File: gccint.info, Node: Loop manipulation, Next: LCSSA, Prev: Loop querying, Up: Loop Analysis and Representation
+
+14.3 Loop manipulation
+======================
+
+The loops tree can be manipulated using the following functions:
+
+ * `flow_loop_tree_node_add': Adds a node to the tree.
+
+ * `flow_loop_tree_node_remove': Removes a node from the tree.
+
+ * `add_bb_to_loop': Adds a basic block to a loop.
+
+ * `remove_bb_from_loops': Removes a basic block from loops.
+
+ Most low-level CFG functions update loops automatically. The following
+functions handle some more complicated cases of CFG manipulations:
+
+ * `remove_path': Removes an edge and all blocks it dominates.
+
+ * `split_loop_exit_edge': Splits exit edge of the loop, ensuring
+ that PHI node arguments remain in the loop (this ensures that
+ loop-closed SSA form is preserved). Only useful on GIMPLE.
+
+ Finally, there are some higher-level loop transformations implemented.
+While some of them are written so that they should work on non-innermost
+loops, they are mostly untested in that case, and at the moment, they
+are only reliable for the innermost loops:
+
+ * `create_iv': Creates a new induction variable. Only works on
+ GIMPLE. `standard_iv_increment_position' can be used to find a
+ suitable place for the iv increment.
+
+ * `duplicate_loop_to_header_edge',
+ `tree_duplicate_loop_to_header_edge': These functions (on RTL and
+ on GIMPLE) duplicate the body of the loop prescribed number of
+ times on one of the edges entering loop header, thus performing
+ either loop unrolling or loop peeling. `can_duplicate_loop_p'
+ (`can_unroll_loop_p' on GIMPLE) must be true for the duplicated
+ loop.
+
+ * `loop_version', `tree_ssa_loop_version': These function create a
+ copy of a loop, and a branch before them that selects one of them
+ depending on the prescribed condition. This is useful for
+ optimizations that need to verify some assumptions in runtime (one
+ of the copies of the loop is usually left unchanged, while the
+ other one is transformed in some way).
+
+ * `tree_unroll_loop': Unrolls the loop, including peeling the extra
+ iterations to make the number of iterations divisible by unroll
+ factor, updating the exit condition, and removing the exits that
+ now cannot be taken. Works only on GIMPLE.
+
+
+File: gccint.info, Node: LCSSA, Next: Scalar evolutions, Prev: Loop manipulation, Up: Loop Analysis and Representation
+
+14.4 Loop-closed SSA form
+=========================
+
+Throughout the loop optimizations on tree level, one extra condition is
+enforced on the SSA form: No SSA name is used outside of the loop in
+that it is defined. The SSA form satisfying this condition is called
+"loop-closed SSA form" - LCSSA. To enforce LCSSA, PHI nodes must be
+created at the exits of the loops for the SSA names that are used
+outside of them. Only the real operands (not virtual SSA names) are
+held in LCSSA, in order to save memory.
+
+ There are various benefits of LCSSA:
+
+ * Many optimizations (value range analysis, final value replacement)
+ are interested in the values that are defined in the loop and used
+ outside of it, i.e., exactly those for that we create new PHI
+ nodes.
+
+ * In induction variable analysis, it is not necessary to specify the
+ loop in that the analysis should be performed - the scalar
+ evolution analysis always returns the results with respect to the
+ loop in that the SSA name is defined.
+
+ * It makes updating of SSA form during loop transformations simpler.
+ Without LCSSA, operations like loop unrolling may force creation
+ of PHI nodes arbitrarily far from the loop, while in LCSSA, the
+ SSA form can be updated locally. However, since we only keep real
+ operands in LCSSA, we cannot use this advantage (we could have
+ local updating of real operands, but it is not much more efficient
+ than to use generic SSA form updating for it as well; the amount
+ of changes to SSA is the same).
+
+ However, it also means LCSSA must be updated. This is usually
+straightforward, unless you create a new value in loop and use it
+outside, or unless you manipulate loop exit edges (functions are
+provided to make these manipulations simple).
+`rewrite_into_loop_closed_ssa' is used to rewrite SSA form to LCSSA,
+and `verify_loop_closed_ssa' to check that the invariant of LCSSA is
+preserved.
+
+
+File: gccint.info, Node: Scalar evolutions, Next: loop-iv, Prev: LCSSA, Up: Loop Analysis and Representation
+
+14.5 Scalar evolutions
+======================
+
+Scalar evolutions (SCEV) are used to represent results of induction
+variable analysis on GIMPLE. They enable us to represent variables with
+complicated behavior in a simple and consistent way (we only use it to
+express values of polynomial induction variables, but it is possible to
+extend it). The interfaces to SCEV analysis are declared in
+`tree-scalar-evolution.h'. To use scalar evolutions analysis,
+`scev_initialize' must be used. To stop using SCEV, `scev_finalize'
+should be used. SCEV analysis caches results in order to save time and
+memory. This cache however is made invalid by most of the loop
+transformations, including removal of code. If such a transformation
+is performed, `scev_reset' must be called to clean the caches.
+
+ Given an SSA name, its behavior in loops can be analyzed using the
+`analyze_scalar_evolution' function. The returned SCEV however does
+not have to be fully analyzed and it may contain references to other
+SSA names defined in the loop. To resolve these (potentially
+recursive) references, `instantiate_parameters' or `resolve_mixers'
+functions must be used. `instantiate_parameters' is useful when you
+use the results of SCEV only for some analysis, and when you work with
+whole nest of loops at once. It will try replacing all SSA names by
+their SCEV in all loops, including the super-loops of the current loop,
+thus providing a complete information about the behavior of the
+variable in the loop nest. `resolve_mixers' is useful if you work with
+only one loop at a time, and if you possibly need to create code based
+on the value of the induction variable. It will only resolve the SSA
+names defined in the current loop, leaving the SSA names defined
+outside unchanged, even if their evolution in the outer loops is known.
+
+ The SCEV is a normal tree expression, except for the fact that it may
+contain several special tree nodes. One of them is `SCEV_NOT_KNOWN',
+used for SSA names whose value cannot be expressed. The other one is
+`POLYNOMIAL_CHREC'. Polynomial chrec has three arguments - base, step
+and loop (both base and step may contain further polynomial chrecs).
+Type of the expression and of base and step must be the same. A
+variable has evolution `POLYNOMIAL_CHREC(base, step, loop)' if it is
+(in the specified loop) equivalent to `x_1' in the following example
+
+ while (...)
+ {
+ x_1 = phi (base, x_2);
+ x_2 = x_1 + step;
+ }
+
+ Note that this includes the language restrictions on the operations.
+For example, if we compile C code and `x' has signed type, then the
+overflow in addition would cause undefined behavior, and we may assume
+that this does not happen. Hence, the value with this SCEV cannot
+overflow (which restricts the number of iterations of such a loop).
+
+ In many cases, one wants to restrict the attention just to affine
+induction variables. In this case, the extra expressive power of SCEV
+is not useful, and may complicate the optimizations. In this case,
+`simple_iv' function may be used to analyze a value - the result is a
+loop-invariant base and step.
+
+
+File: gccint.info, Node: loop-iv, Next: Number of iterations, Prev: Scalar evolutions, Up: Loop Analysis and Representation
+
+14.6 IV analysis on RTL
+=======================
+
+The induction variable on RTL is simple and only allows analysis of
+affine induction variables, and only in one loop at once. The interface
+is declared in `cfgloop.h'. Before analyzing induction variables in a
+loop L, `iv_analysis_loop_init' function must be called on L. After
+the analysis (possibly calling `iv_analysis_loop_init' for several
+loops) is finished, `iv_analysis_done' should be called. The following
+functions can be used to access the results of the analysis:
+
+ * `iv_analyze': Analyzes a single register used in the given insn.
+ If no use of the register in this insn is found, the following
+ insns are scanned, so that this function can be called on the insn
+ returned by get_condition.
+
+ * `iv_analyze_result': Analyzes result of the assignment in the
+ given insn.
+
+ * `iv_analyze_expr': Analyzes a more complicated expression. All
+ its operands are analyzed by `iv_analyze', and hence they must be
+ used in the specified insn or one of the following insns.
+
+ The description of the induction variable is provided in `struct
+rtx_iv'. In order to handle subregs, the representation is a bit
+complicated; if the value of the `extend' field is not `UNKNOWN', the
+value of the induction variable in the i-th iteration is
+
+ delta + mult * extend_{extend_mode} (subreg_{mode} (base + i * step)),
+
+ with the following exception: if `first_special' is true, then the
+value in the first iteration (when `i' is zero) is `delta + mult *
+base'. However, if `extend' is equal to `UNKNOWN', then
+`first_special' must be false, `delta' 0, `mult' 1 and the value in the
+i-th iteration is
+
+ subreg_{mode} (base + i * step)
+
+ The function `get_iv_value' can be used to perform these calculations.
+
+
+File: gccint.info, Node: Number of iterations, Next: Dependency analysis, Prev: loop-iv, Up: Loop Analysis and Representation
+
+14.7 Number of iterations analysis
+==================================
+
+Both on GIMPLE and on RTL, there are functions available to determine
+the number of iterations of a loop, with a similar interface. The
+number of iterations of a loop in GCC is defined as the number of
+executions of the loop latch. In many cases, it is not possible to
+determine the number of iterations unconditionally - the determined
+number is correct only if some assumptions are satisfied. The analysis
+tries to verify these conditions using the information contained in the
+program; if it fails, the conditions are returned together with the
+result. The following information and conditions are provided by the
+analysis:
+
+ * `assumptions': If this condition is false, the rest of the
+ information is invalid.
+
+ * `noloop_assumptions' on RTL, `may_be_zero' on GIMPLE: If this
+ condition is true, the loop exits in the first iteration.
+
+ * `infinite': If this condition is true, the loop is infinite. This
+ condition is only available on RTL. On GIMPLE, conditions for
+ finiteness of the loop are included in `assumptions'.
+
+ * `niter_expr' on RTL, `niter' on GIMPLE: The expression that gives
+ number of iterations. The number of iterations is defined as the
+ number of executions of the loop latch.
+
+ Both on GIMPLE and on RTL, it necessary for the induction variable
+analysis framework to be initialized (SCEV on GIMPLE, loop-iv on RTL).
+On GIMPLE, the results are stored to `struct tree_niter_desc'
+structure. Number of iterations before the loop is exited through a
+given exit can be determined using `number_of_iterations_exit'
+function. On RTL, the results are returned in `struct niter_desc'
+structure. The corresponding function is named `check_simple_exit'.
+There are also functions that pass through all the exits of a loop and
+try to find one with easy to determine number of iterations -
+`find_loop_niter' on GIMPLE and `find_simple_exit' on RTL. Finally,
+there are functions that provide the same information, but additionally
+cache it, so that repeated calls to number of iterations are not so
+costly - `number_of_latch_executions' on GIMPLE and
+`get_simple_loop_desc' on RTL.
+
+ Note that some of these functions may behave slightly differently than
+others - some of them return only the expression for the number of
+iterations, and fail if there are some assumptions. The function
+`number_of_latch_executions' works only for single-exit loops. The
+function `number_of_cond_exit_executions' can be used to determine
+number of executions of the exit condition of a single-exit loop (i.e.,
+the `number_of_latch_executions' increased by one).
+
+
+File: gccint.info, Node: Dependency analysis, Next: Lambda, Prev: Number of iterations, Up: Loop Analysis and Representation
+
+14.8 Data Dependency Analysis
+=============================
+
+The code for the data dependence analysis can be found in
+`tree-data-ref.c' and its interface and data structures are described
+in `tree-data-ref.h'. The function that computes the data dependences
+for all the array and pointer references for a given loop is
+`compute_data_dependences_for_loop'. This function is currently used
+by the linear loop transform and the vectorization passes. Before
+calling this function, one has to allocate two vectors: a first vector
+will contain the set of data references that are contained in the
+analyzed loop body, and the second vector will contain the dependence
+relations between the data references. Thus if the vector of data
+references is of size `n', the vector containing the dependence
+relations will contain `n*n' elements. However if the analyzed loop
+contains side effects, such as calls that potentially can interfere
+with the data references in the current analyzed loop, the analysis
+stops while scanning the loop body for data references, and inserts a
+single `chrec_dont_know' in the dependence relation array.
+
+ The data references are discovered in a particular order during the
+scanning of the loop body: the loop body is analyzed in execution order,
+and the data references of each statement are pushed at the end of the
+data reference array. Two data references syntactically occur in the
+program in the same order as in the array of data references. This
+syntactic order is important in some classical data dependence tests,
+and mapping this order to the elements of this array avoids costly
+queries to the loop body representation.
+
+ Three types of data references are currently handled: ARRAY_REF,
+INDIRECT_REF and COMPONENT_REF. The data structure for the data
+reference is `data_reference', where `data_reference_p' is a name of a
+pointer to the data reference structure. The structure contains the
+following elements:
+
+ * `base_object_info': Provides information about the base object of
+ the data reference and its access functions. These access functions
+ represent the evolution of the data reference in the loop relative
+ to its base, in keeping with the classical meaning of the data
+ reference access function for the support of arrays. For example,
+ for a reference `a.b[i][j]', the base object is `a.b' and the
+ access functions, one for each array subscript, are: `{i_init, +
+ i_step}_1, {j_init, +, j_step}_2'.
+
+ * `first_location_in_loop': Provides information about the first
+ location accessed by the data reference in the loop and about the
+ access function used to represent evolution relative to this
+ location. This data is used to support pointers, and is not used
+ for arrays (for which we have base objects). Pointer accesses are
+ represented as a one-dimensional access that starts from the first
+ location accessed in the loop. For example:
+
+ for1 i
+ for2 j
+ *((int *)p + i + j) = a[i][j];
+
+ The access function of the pointer access is `{0, + 4B}_for2'
+ relative to `p + i'. The access functions of the array are
+ `{i_init, + i_step}_for1' and `{j_init, +, j_step}_for2' relative
+ to `a'.
+
+ Usually, the object the pointer refers to is either unknown, or we
+ can't prove that the access is confined to the boundaries of a
+ certain object.
+
+ Two data references can be compared only if at least one of these
+ two representations has all its fields filled for both data
+ references.
+
+ The current strategy for data dependence tests is as follows: If
+ both `a' and `b' are represented as arrays, compare
+ `a.base_object' and `b.base_object'; if they are equal, apply
+ dependence tests (use access functions based on base_objects).
+ Else if both `a' and `b' are represented as pointers, compare
+ `a.first_location' and `b.first_location'; if they are equal,
+ apply dependence tests (use access functions based on first
+ location). However, if `a' and `b' are represented differently,
+ only try to prove that the bases are definitely different.
+
+ * Aliasing information.
+
+ * Alignment information.
+
+ The structure describing the relation between two data references is
+`data_dependence_relation' and the shorter name for a pointer to such a
+structure is `ddr_p'. This structure contains:
+
+ * a pointer to each data reference,
+
+ * a tree node `are_dependent' that is set to `chrec_known' if the
+ analysis has proved that there is no dependence between these two
+ data references, `chrec_dont_know' if the analysis was not able to
+ determine any useful result and potentially there could exist a
+ dependence between these data references, and `are_dependent' is
+ set to `NULL_TREE' if there exist a dependence relation between the
+ data references, and the description of this dependence relation is
+ given in the `subscripts', `dir_vects', and `dist_vects' arrays,
+
+ * a boolean that determines whether the dependence relation can be
+ represented by a classical distance vector,
+
+ * an array `subscripts' that contains a description of each
+ subscript of the data references. Given two array accesses a
+ subscript is the tuple composed of the access functions for a given
+ dimension. For example, given `A[f1][f2][f3]' and
+ `B[g1][g2][g3]', there are three subscripts: `(f1, g1), (f2, g2),
+ (f3, g3)'.
+
+ * two arrays `dir_vects' and `dist_vects' that contain classical
+ representations of the data dependences under the form of
+ direction and distance dependence vectors,
+
+ * an array of loops `loop_nest' that contains the loops to which the
+ distance and direction vectors refer to.
+
+ Several functions for pretty printing the information extracted by the
+data dependence analysis are available: `dump_ddrs' prints with a
+maximum verbosity the details of a data dependence relations array,
+`dump_dist_dir_vectors' prints only the classical distance and
+direction vectors for a data dependence relations array, and
+`dump_data_references' prints the details of the data references
+contained in a data reference array.
+
+
+File: gccint.info, Node: Lambda, Next: Omega, Prev: Dependency analysis, Up: Loop Analysis and Representation
+
+14.9 Linear loop transformations framework
+==========================================
+
+Lambda is a framework that allows transformations of loops using
+non-singular matrix based transformations of the iteration space and
+loop bounds. This allows compositions of skewing, scaling, interchange,
+and reversal transformations. These transformations are often used to
+improve cache behavior or remove inner loop dependencies to allow
+parallelization and vectorization to take place.
+
+ To perform these transformations, Lambda requires that the loopnest be
+converted into a internal form that can be matrix transformed easily.
+To do this conversion, the function `gcc_loopnest_to_lambda_loopnest'
+is provided. If the loop cannot be transformed using lambda, this
+function will return NULL.
+
+ Once a `lambda_loopnest' is obtained from the conversion function, it
+can be transformed by using `lambda_loopnest_transform', which takes a
+transformation matrix to apply. Note that it is up to the caller to
+verify that the transformation matrix is legal to apply to the loop
+(dependence respecting, etc). Lambda simply applies whatever matrix it
+is told to provide. It can be extended to make legal matrices out of
+any non-singular matrix, but this is not currently implemented.
+Legality of a matrix for a given loopnest can be verified using
+`lambda_transform_legal_p'.
+
+ Given a transformed loopnest, conversion back into gcc IR is done by
+`lambda_loopnest_to_gcc_loopnest'. This function will modify the loops
+so that they match the transformed loopnest.
+
+
+File: gccint.info, Node: Omega, Prev: Lambda, Up: Loop Analysis and Representation
+
+14.10 Omega a solver for linear programming problems
+====================================================
+
+The data dependence analysis contains several solvers triggered
+sequentially from the less complex ones to the more sophisticated. For
+ensuring the consistency of the results of these solvers, a data
+dependence check pass has been implemented based on two different
+solvers. The second method that has been integrated to GCC is based on
+the Omega dependence solver, written in the 1990's by William Pugh and
+David Wonnacott. Data dependence tests can be formulated using a
+subset of the Presburger arithmetics that can be translated to linear
+constraint systems. These linear constraint systems can then be solved
+using the Omega solver.
+
+ The Omega solver is using Fourier-Motzkin's algorithm for variable
+elimination: a linear constraint system containing `n' variables is
+reduced to a linear constraint system with `n-1' variables. The Omega
+solver can also be used for solving other problems that can be
+expressed under the form of a system of linear equalities and
+inequalities. The Omega solver is known to have an exponential worst
+case, also known under the name of "omega nightmare" in the literature,
+but in practice, the omega test is known to be efficient for the common
+data dependence tests.
+
+ The interface used by the Omega solver for describing the linear
+programming problems is described in `omega.h', and the solver is
+`omega_solve_problem'.
+
+
+File: gccint.info, Node: Control Flow, Next: Loop Analysis and Representation, Prev: RTL, Up: Top
+
+15 Control Flow Graph
+*********************
+
+A control flow graph (CFG) is a data structure built on top of the
+intermediate code representation (the RTL or `tree' instruction stream)
+abstracting the control flow behavior of a function that is being
+compiled. The CFG is a directed graph where the vertices represent
+basic blocks and edges represent possible transfer of control flow from
+one basic block to another. The data structures used to represent the
+control flow graph are defined in `basic-block.h'.
+
+* Menu:
+
+* Basic Blocks:: The definition and representation of basic blocks.
+* Edges:: Types of edges and their representation.
+* Profile information:: Representation of frequencies and probabilities.
+* Maintaining the CFG:: Keeping the control flow graph and up to date.
+* Liveness information:: Using and maintaining liveness information.
+
+
+File: gccint.info, Node: Basic Blocks, Next: Edges, Up: Control Flow
+
+15.1 Basic Blocks
+=================
+
+A basic block is a straight-line sequence of code with only one entry
+point and only one exit. In GCC, basic blocks are represented using
+the `basic_block' data type.
+
+ Two pointer members of the `basic_block' structure are the pointers
+`next_bb' and `prev_bb'. These are used to keep doubly linked chain of
+basic blocks in the same order as the underlying instruction stream.
+The chain of basic blocks is updated transparently by the provided API
+for manipulating the CFG. The macro `FOR_EACH_BB' can be used to visit
+all the basic blocks in lexicographical order. Dominator traversals
+are also possible using `walk_dominator_tree'. Given two basic blocks
+A and B, block A dominates block B if A is _always_ executed before B.
+
+ The `BASIC_BLOCK' array contains all basic blocks in an unspecified
+order. Each `basic_block' structure has a field that holds a unique
+integer identifier `index' that is the index of the block in the
+`BASIC_BLOCK' array. The total number of basic blocks in the function
+is `n_basic_blocks'. Both the basic block indices and the total number
+of basic blocks may vary during the compilation process, as passes
+reorder, create, duplicate, and destroy basic blocks. The index for
+any block should never be greater than `last_basic_block'.
+
+ Special basic blocks represent possible entry and exit points of a
+function. These blocks are called `ENTRY_BLOCK_PTR' and
+`EXIT_BLOCK_PTR'. These blocks do not contain any code, and are not
+elements of the `BASIC_BLOCK' array. Therefore they have been assigned
+unique, negative index numbers.
+
+ Each `basic_block' also contains pointers to the first instruction
+(the "head") and the last instruction (the "tail") or "end" of the
+instruction stream contained in a basic block. In fact, since the
+`basic_block' data type is used to represent blocks in both major
+intermediate representations of GCC (`tree' and RTL), there are
+pointers to the head and end of a basic block for both representations.
+
+ For RTL, these pointers are `rtx head, end'. In the RTL function
+representation, the head pointer always points either to a
+`NOTE_INSN_BASIC_BLOCK' or to a `CODE_LABEL', if present. In the RTL
+representation of a function, the instruction stream contains not only
+the "real" instructions, but also "notes". Any function that moves or
+duplicates the basic blocks needs to take care of updating of these
+notes. Many of these notes expect that the instruction stream consists
+of linear regions, making such updates difficult. The
+`NOTE_INSN_BASIC_BLOCK' note is the only kind of note that may appear
+in the instruction stream contained in a basic block. The instruction
+stream of a basic block always follows a `NOTE_INSN_BASIC_BLOCK', but
+zero or more `CODE_LABEL' nodes can precede the block note. A basic
+block ends by control flow instruction or last instruction before
+following `CODE_LABEL' or `NOTE_INSN_BASIC_BLOCK'. A `CODE_LABEL'
+cannot appear in the instruction stream of a basic block.
+
+ In addition to notes, the jump table vectors are also represented as
+"pseudo-instructions" inside the insn stream. These vectors never
+appear in the basic block and should always be placed just after the
+table jump instructions referencing them. After removing the
+table-jump it is often difficult to eliminate the code computing the
+address and referencing the vector, so cleaning up these vectors is
+postponed until after liveness analysis. Thus the jump table vectors
+may appear in the insn stream unreferenced and without any purpose.
+Before any edge is made "fall-thru", the existence of such construct in
+the way needs to be checked by calling `can_fallthru' function.
+
+ For the `tree' representation, the head and end of the basic block are
+being pointed to by the `stmt_list' field, but this special `tree'
+should never be referenced directly. Instead, at the tree level
+abstract containers and iterators are used to access statements and
+expressions in basic blocks. These iterators are called "block
+statement iterators" (BSIs). Grep for `^bsi' in the various `tree-*'
+files. The following snippet will pretty-print all the statements of
+the program in the GIMPLE representation.
+
+ FOR_EACH_BB (bb)
+ {
+ block_stmt_iterator si;
+
+ for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+ {
+ tree stmt = bsi_stmt (si);
+ print_generic_stmt (stderr, stmt, 0);
+ }
+ }
+
+
+File: gccint.info, Node: Edges, Next: Profile information, Prev: Basic Blocks, Up: Control Flow
+
+15.2 Edges
+==========
+
+Edges represent possible control flow transfers from the end of some
+basic block A to the head of another basic block B. We say that A is a
+predecessor of B, and B is a successor of A. Edges are represented in
+GCC with the `edge' data type. Each `edge' acts as a link between two
+basic blocks: the `src' member of an edge points to the predecessor
+basic block of the `dest' basic block. The members `preds' and `succs'
+of the `basic_block' data type point to type-safe vectors of edges to
+the predecessors and successors of the block.
+
+ When walking the edges in an edge vector, "edge iterators" should be
+used. Edge iterators are constructed using the `edge_iterator' data
+structure and several methods are available to operate on them:
+
+`ei_start'
+ This function initializes an `edge_iterator' that points to the
+ first edge in a vector of edges.
+
+`ei_last'
+ This function initializes an `edge_iterator' that points to the
+ last edge in a vector of edges.
+
+`ei_end_p'
+ This predicate is `true' if an `edge_iterator' represents the last
+ edge in an edge vector.
+
+`ei_one_before_end_p'
+ This predicate is `true' if an `edge_iterator' represents the
+ second last edge in an edge vector.
+
+`ei_next'
+ This function takes a pointer to an `edge_iterator' and makes it
+ point to the next edge in the sequence.
+
+`ei_prev'
+ This function takes a pointer to an `edge_iterator' and makes it
+ point to the previous edge in the sequence.
+
+`ei_edge'
+ This function returns the `edge' currently pointed to by an
+ `edge_iterator'.
+
+`ei_safe_safe'
+ This function returns the `edge' currently pointed to by an
+ `edge_iterator', but returns `NULL' if the iterator is pointing at
+ the end of the sequence. This function has been provided for
+ existing code makes the assumption that a `NULL' edge indicates
+ the end of the sequence.
+
+
+ The convenience macro `FOR_EACH_EDGE' can be used to visit all of the
+edges in a sequence of predecessor or successor edges. It must not be
+used when an element might be removed during the traversal, otherwise
+elements will be missed. Here is an example of how to use the macro:
+
+ edge e;
+ edge_iterator ei;
+
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ {
+ if (e->flags & EDGE_FALLTHRU)
+ break;
+ }
+
+ There are various reasons why control flow may transfer from one block
+to another. One possibility is that some instruction, for example a
+`CODE_LABEL', in a linearized instruction stream just always starts a
+new basic block. In this case a "fall-thru" edge links the basic block
+to the first following basic block. But there are several other
+reasons why edges may be created. The `flags' field of the `edge' data
+type is used to store information about the type of edge we are dealing
+with. Each edge is of one of the following types:
+
+_jump_
+ No type flags are set for edges corresponding to jump instructions.
+ These edges are used for unconditional or conditional jumps and in
+ RTL also for table jumps. They are the easiest to manipulate as
+ they may be freely redirected when the flow graph is not in SSA
+ form.
+
+_fall-thru_
+ Fall-thru edges are present in case where the basic block may
+ continue execution to the following one without branching. These
+ edges have the `EDGE_FALLTHRU' flag set. Unlike other types of
+ edges, these edges must come into the basic block immediately
+ following in the instruction stream. The function
+ `force_nonfallthru' is available to insert an unconditional jump
+ in the case that redirection is needed. Note that this may
+ require creation of a new basic block.
+
+_exception handling_
+ Exception handling edges represent possible control transfers from
+ a trapping instruction to an exception handler. The definition of
+ "trapping" varies. In C++, only function calls can throw, but for
+ Java, exceptions like division by zero or segmentation fault are
+ defined and thus each instruction possibly throwing this kind of
+ exception needs to be handled as control flow instruction.
+ Exception edges have the `EDGE_ABNORMAL' and `EDGE_EH' flags set.
+
+ When updating the instruction stream it is easy to change possibly
+ trapping instruction to non-trapping, by simply removing the
+ exception edge. The opposite conversion is difficult, but should
+ not happen anyway. The edges can be eliminated via
+ `purge_dead_edges' call.
+
+ In the RTL representation, the destination of an exception edge is
+ specified by `REG_EH_REGION' note attached to the insn. In case
+ of a trapping call the `EDGE_ABNORMAL_CALL' flag is set too. In
+ the `tree' representation, this extra flag is not set.
+
+ In the RTL representation, the predicate `may_trap_p' may be used
+ to check whether instruction still may trap or not. For the tree
+ representation, the `tree_could_trap_p' predicate is available,
+ but this predicate only checks for possible memory traps, as in
+ dereferencing an invalid pointer location.
+
+_sibling calls_
+ Sibling calls or tail calls terminate the function in a
+ non-standard way and thus an edge to the exit must be present.
+ `EDGE_SIBCALL' and `EDGE_ABNORMAL' are set in such case. These
+ edges only exist in the RTL representation.
+
+_computed jumps_
+ Computed jumps contain edges to all labels in the function
+ referenced from the code. All those edges have `EDGE_ABNORMAL'
+ flag set. The edges used to represent computed jumps often cause
+ compile time performance problems, since functions consisting of
+ many taken labels and many computed jumps may have _very_ dense
+ flow graphs, so these edges need to be handled with special care.
+ During the earlier stages of the compilation process, GCC tries to
+ avoid such dense flow graphs by factoring computed jumps. For
+ example, given the following series of jumps,
+
+ goto *x;
+ [ ... ]
+
+ goto *x;
+ [ ... ]
+
+ goto *x;
+ [ ... ]
+
+ factoring the computed jumps results in the following code sequence
+ which has a much simpler flow graph:
+
+ goto y;
+ [ ... ]
+
+ goto y;
+ [ ... ]
+
+ goto y;
+ [ ... ]
+
+ y:
+ goto *x;
+
+ However, the classic problem with this transformation is that it
+ has a runtime cost in there resulting code: An extra jump.
+ Therefore, the computed jumps are un-factored in the later passes
+ of the compiler. Be aware of that when you work on passes in that
+ area. There have been numerous examples already where the compile
+ time for code with unfactored computed jumps caused some serious
+ headaches.
+
+_nonlocal goto handlers_
+ GCC allows nested functions to return into caller using a `goto'
+ to a label passed to as an argument to the callee. The labels
+ passed to nested functions contain special code to cleanup after
+ function call. Such sections of code are referred to as "nonlocal
+ goto receivers". If a function contains such nonlocal goto
+ receivers, an edge from the call to the label is created with the
+ `EDGE_ABNORMAL' and `EDGE_ABNORMAL_CALL' flags set.
+
+_function entry points_
+ By definition, execution of function starts at basic block 0, so
+ there is always an edge from the `ENTRY_BLOCK_PTR' to basic block
+ 0. There is no `tree' representation for alternate entry points at
+ this moment. In RTL, alternate entry points are specified by
+ `CODE_LABEL' with `LABEL_ALTERNATE_NAME' defined. This feature is
+ currently used for multiple entry point prologues and is limited
+ to post-reload passes only. This can be used by back-ends to emit
+ alternate prologues for functions called from different contexts.
+ In future full support for multiple entry functions defined by
+ Fortran 90 needs to be implemented.
+
+_function exits_
+ In the pre-reload representation a function terminates after the
+ last instruction in the insn chain and no explicit return
+ instructions are used. This corresponds to the fall-thru edge
+ into exit block. After reload, optimal RTL epilogues are used
+ that use explicit (conditional) return instructions that are
+ represented by edges with no flags set.
+
+
+
+File: gccint.info, Node: Profile information, Next: Maintaining the CFG, Prev: Edges, Up: Control Flow
+
+15.3 Profile information
+========================
+
+In many cases a compiler must make a choice whether to trade speed in
+one part of code for speed in another, or to trade code size for code
+speed. In such cases it is useful to know information about how often
+some given block will be executed. That is the purpose for maintaining
+profile within the flow graph. GCC can handle profile information
+obtained through "profile feedback", but it can also estimate branch
+probabilities based on statics and heuristics.
+
+ The feedback based profile is produced by compiling the program with
+instrumentation, executing it on a train run and reading the numbers of
+executions of basic blocks and edges back to the compiler while
+re-compiling the program to produce the final executable. This method
+provides very accurate information about where a program spends most of
+its time on the train run. Whether it matches the average run of
+course depends on the choice of train data set, but several studies
+have shown that the behavior of a program usually changes just
+marginally over different data sets.
+
+ When profile feedback is not available, the compiler may be asked to
+attempt to predict the behavior of each branch in the program using a
+set of heuristics (see `predict.def' for details) and compute estimated
+frequencies of each basic block by propagating the probabilities over
+the graph.
+
+ Each `basic_block' contains two integer fields to represent profile
+information: `frequency' and `count'. The `frequency' is an estimation
+how often is basic block executed within a function. It is represented
+as an integer scaled in the range from 0 to `BB_FREQ_BASE'. The most
+frequently executed basic block in function is initially set to
+`BB_FREQ_BASE' and the rest of frequencies are scaled accordingly.
+During optimization, the frequency of the most frequent basic block can
+both decrease (for instance by loop unrolling) or grow (for instance by
+cross-jumping optimization), so scaling sometimes has to be performed
+multiple times.
+
+ The `count' contains hard-counted numbers of execution measured during
+training runs and is nonzero only when profile feedback is available.
+This value is represented as the host's widest integer (typically a 64
+bit integer) of the special type `gcov_type'.
+
+ Most optimization passes can use only the frequency information of a
+basic block, but a few passes may want to know hard execution counts.
+The frequencies should always match the counts after scaling, however
+during updating of the profile information numerical error may
+accumulate into quite large errors.
+
+ Each edge also contains a branch probability field: an integer in the
+range from 0 to `REG_BR_PROB_BASE'. It represents probability of
+passing control from the end of the `src' basic block to the `dest'
+basic block, i.e. the probability that control will flow along this
+edge. The `EDGE_FREQUENCY' macro is available to compute how
+frequently a given edge is taken. There is a `count' field for each
+edge as well, representing same information as for a basic block.
+
+ The basic block frequencies are not represented in the instruction
+stream, but in the RTL representation the edge frequencies are
+represented for conditional jumps (via the `REG_BR_PROB' macro) since
+they are used when instructions are output to the assembly file and the
+flow graph is no longer maintained.
+
+ The probability that control flow arrives via a given edge to its
+destination basic block is called "reverse probability" and is not
+directly represented, but it may be easily computed from frequencies of
+basic blocks.
+
+ Updating profile information is a delicate task that can unfortunately
+not be easily integrated with the CFG manipulation API. Many of the
+functions and hooks to modify the CFG, such as
+`redirect_edge_and_branch', do not have enough information to easily
+update the profile, so updating it is in the majority of cases left up
+to the caller. It is difficult to uncover bugs in the profile updating
+code, because they manifest themselves only by producing worse code,
+and checking profile consistency is not possible because of numeric
+error accumulation. Hence special attention needs to be given to this
+issue in each pass that modifies the CFG.
+
+ It is important to point out that `REG_BR_PROB_BASE' and
+`BB_FREQ_BASE' are both set low enough to be possible to compute second
+power of any frequency or probability in the flow graph, it is not
+possible to even square the `count' field, as modern CPUs are fast
+enough to execute $2^32$ operations quickly.
+
+
+File: gccint.info, Node: Maintaining the CFG, Next: Liveness information, Prev: Profile information, Up: Control Flow
+
+15.4 Maintaining the CFG
+========================
+
+An important task of each compiler pass is to keep both the control
+flow graph and all profile information up-to-date. Reconstruction of
+the control flow graph after each pass is not an option, since it may be
+very expensive and lost profile information cannot be reconstructed at
+all.
+
+ GCC has two major intermediate representations, and both use the
+`basic_block' and `edge' data types to represent control flow. Both
+representations share as much of the CFG maintenance code as possible.
+For each representation, a set of "hooks" is defined so that each
+representation can provide its own implementation of CFG manipulation
+routines when necessary. These hooks are defined in `cfghooks.h'.
+There are hooks for almost all common CFG manipulations, including
+block splitting and merging, edge redirection and creating and deleting
+basic blocks. These hooks should provide everything you need to
+maintain and manipulate the CFG in both the RTL and `tree'
+representation.
+
+ At the moment, the basic block boundaries are maintained transparently
+when modifying instructions, so there rarely is a need to move them
+manually (such as in case someone wants to output instruction outside
+basic block explicitly). Often the CFG may be better viewed as
+integral part of instruction chain, than structure built on the top of
+it. However, in principle the control flow graph for the `tree'
+representation is _not_ an integral part of the representation, in that
+a function tree may be expanded without first building a flow graph
+for the `tree' representation at all. This happens when compiling
+without any `tree' optimization enabled. When the `tree' optimizations
+are enabled and the instruction stream is rewritten in SSA form, the
+CFG is very tightly coupled with the instruction stream. In
+particular, statement insertion and removal has to be done with care.
+In fact, the whole `tree' representation can not be easily used or
+maintained without proper maintenance of the CFG simultaneously.
+
+ In the RTL representation, each instruction has a `BLOCK_FOR_INSN'
+value that represents pointer to the basic block that contains the
+instruction. In the `tree' representation, the function `bb_for_stmt'
+returns a pointer to the basic block containing the queried statement.
+
+ When changes need to be applied to a function in its `tree'
+representation, "block statement iterators" should be used. These
+iterators provide an integrated abstraction of the flow graph and the
+instruction stream. Block statement iterators are constructed using
+the `block_stmt_iterator' data structure and several modifier are
+available, including the following:
+
+`bsi_start'
+ This function initializes a `block_stmt_iterator' that points to
+ the first non-empty statement in a basic block.
+
+`bsi_last'
+ This function initializes a `block_stmt_iterator' that points to
+ the last statement in a basic block.
+
+`bsi_end_p'
+ This predicate is `true' if a `block_stmt_iterator' represents the
+ end of a basic block.
+
+`bsi_next'
+ This function takes a `block_stmt_iterator' and makes it point to
+ its successor.
+
+`bsi_prev'
+ This function takes a `block_stmt_iterator' and makes it point to
+ its predecessor.
+
+`bsi_insert_after'
+ This function inserts a statement after the `block_stmt_iterator'
+ passed in. The final parameter determines whether the statement
+ iterator is updated to point to the newly inserted statement, or
+ left pointing to the original statement.
+
+`bsi_insert_before'
+ This function inserts a statement before the `block_stmt_iterator'
+ passed in. The final parameter determines whether the statement
+ iterator is updated to point to the newly inserted statement, or
+ left pointing to the original statement.
+
+`bsi_remove'
+ This function removes the `block_stmt_iterator' passed in and
+ rechains the remaining statements in a basic block, if any.
+
+ In the RTL representation, the macros `BB_HEAD' and `BB_END' may be
+used to get the head and end `rtx' of a basic block. No abstract
+iterators are defined for traversing the insn chain, but you can just
+use `NEXT_INSN' and `PREV_INSN' instead. See *Note Insns::.
+
+ Usually a code manipulating pass simplifies the instruction stream and
+the flow of control, possibly eliminating some edges. This may for
+example happen when a conditional jump is replaced with an
+unconditional jump, but also when simplifying possibly trapping
+instruction to non-trapping while compiling Java. Updating of edges is
+not transparent and each optimization pass is required to do so
+manually. However only few cases occur in practice. The pass may call
+`purge_dead_edges' on a given basic block to remove superfluous edges,
+if any.
+
+ Another common scenario is redirection of branch instructions, but
+this is best modeled as redirection of edges in the control flow graph
+and thus use of `redirect_edge_and_branch' is preferred over more low
+level functions, such as `redirect_jump' that operate on RTL chain
+only. The CFG hooks defined in `cfghooks.h' should provide the
+complete API required for manipulating and maintaining the CFG.
+
+ It is also possible that a pass has to insert control flow instruction
+into the middle of a basic block, thus creating an entry point in the
+middle of the basic block, which is impossible by definition: The block
+must be split to make sure it only has one entry point, i.e. the head
+of the basic block. The CFG hook `split_block' may be used when an
+instruction in the middle of a basic block has to become the target of
+a jump or branch instruction.
+
+ For a global optimizer, a common operation is to split edges in the
+flow graph and insert instructions on them. In the RTL representation,
+this can be easily done using the `insert_insn_on_edge' function that
+emits an instruction "on the edge", caching it for a later
+`commit_edge_insertions' call that will take care of moving the
+inserted instructions off the edge into the instruction stream
+contained in a basic block. This includes the creation of new basic
+blocks where needed. In the `tree' representation, the equivalent
+functions are `bsi_insert_on_edge' which inserts a block statement
+iterator on an edge, and `bsi_commit_edge_inserts' which flushes the
+instruction to actual instruction stream.
+
+ While debugging the optimization pass, an `verify_flow_info' function
+may be useful to find bugs in the control flow graph updating code.
+
+ Note that at present, the representation of control flow in the `tree'
+representation is discarded before expanding to RTL. Long term the CFG
+should be maintained and "expanded" to the RTL representation along
+with the function `tree' itself.
+
+
+File: gccint.info, Node: Liveness information, Prev: Maintaining the CFG, Up: Control Flow
+
+15.5 Liveness information
+=========================
+
+Liveness information is useful to determine whether some register is
+"live" at given point of program, i.e. that it contains a value that
+may be used at a later point in the program. This information is used,
+for instance, during register allocation, as the pseudo registers only
+need to be assigned to a unique hard register or to a stack slot if
+they are live. The hard registers and stack slots may be freely reused
+for other values when a register is dead.
+
+ Liveness information is available in the back end starting with
+`pass_df_initialize' and ending with `pass_df_finish'. Three flavors
+of live analysis are available: With `LR', it is possible to determine
+at any point `P' in the function if the register may be used on some
+path from `P' to the end of the function. With `UR', it is possible to
+determine if there is a path from the beginning of the function to `P'
+that defines the variable. `LIVE' is the intersection of the `LR' and
+`UR' and a variable is live at `P' if there is both an assignment that
+reaches it from the beginning of the function and a uses that can be
+reached on some path from `P' to the end of the function.
+
+ In general `LIVE' is the most useful of the three. The macros
+`DF_[LR,UR,LIVE]_[IN,OUT]' can be used to access this information. The
+macros take a basic block number and return a bitmap that is indexed by
+the register number. This information is only guaranteed to be up to
+date after calls are made to `df_analyze'. See the file `df-core.c'
+for details on using the dataflow.
+
+ The liveness information is stored partly in the RTL instruction stream
+and partly in the flow graph. Local information is stored in the
+instruction stream: Each instruction may contain `REG_DEAD' notes
+representing that the value of a given register is no longer needed, or
+`REG_UNUSED' notes representing that the value computed by the
+instruction is never used. The second is useful for instructions
+computing multiple values at once.
+
+
+File: gccint.info, Node: Machine Desc, Next: Target Macros, Prev: Loop Analysis and Representation, Up: Top
+
+16 Machine Descriptions
+***********************
+
+A machine description has two parts: a file of instruction patterns
+(`.md' file) and a C header file of macro definitions.
+
+ The `.md' file for a target machine contains a pattern for each
+instruction that the target machine supports (or at least each
+instruction that is worth telling the compiler about). It may also
+contain comments. A semicolon causes the rest of the line to be a
+comment, unless the semicolon is inside a quoted string.
+
+ See the next chapter for information on the C header file.
+
+* Menu:
+
+* Overview:: How the machine description is used.
+* Patterns:: How to write instruction patterns.
+* Example:: An explained example of a `define_insn' pattern.
+* RTL Template:: The RTL template defines what insns match a pattern.
+* Output Template:: The output template says how to make assembler code
+ from such an insn.
+* Output Statement:: For more generality, write C code to output
+ the assembler code.
+* Predicates:: Controlling what kinds of operands can be used
+ for an insn.
+* Constraints:: Fine-tuning operand selection.
+* Standard Names:: Names mark patterns to use for code generation.
+* Pattern Ordering:: When the order of patterns makes a difference.
+* Dependent Patterns:: Having one pattern may make you need another.
+* Jump Patterns:: Special considerations for patterns for jump insns.
+* Looping Patterns:: How to define patterns for special looping insns.
+* Insn Canonicalizations::Canonicalization of Instructions
+* Expander Definitions::Generating a sequence of several RTL insns
+ for a standard operation.
+* Insn Splitting:: Splitting Instructions into Multiple Instructions.
+* Including Patterns:: Including Patterns in Machine Descriptions.
+* Peephole Definitions::Defining machine-specific peephole optimizations.
+* Insn Attributes:: Specifying the value of attributes for generated insns.
+* Conditional Execution::Generating `define_insn' patterns for
+ predication.
+* Constant Definitions::Defining symbolic constants that can be used in the
+ md file.
+* Iterators:: Using iterators to generate patterns from a template.
+
+
+File: gccint.info, Node: Overview, Next: Patterns, Up: Machine Desc
+
+16.1 Overview of How the Machine Description is Used
+====================================================
+
+There are three main conversions that happen in the compiler:
+
+ 1. The front end reads the source code and builds a parse tree.
+
+ 2. The parse tree is used to generate an RTL insn list based on named
+ instruction patterns.
+
+ 3. The insn list is matched against the RTL templates to produce
+ assembler code.
+
+
+ For the generate pass, only the names of the insns matter, from either
+a named `define_insn' or a `define_expand'. The compiler will choose
+the pattern with the right name and apply the operands according to the
+documentation later in this chapter, without regard for the RTL
+template or operand constraints. Note that the names the compiler looks
+for are hard-coded in the compiler--it will ignore unnamed patterns and
+patterns with names it doesn't know about, but if you don't provide a
+named pattern it needs, it will abort.
+
+ If a `define_insn' is used, the template given is inserted into the
+insn list. If a `define_expand' is used, one of three things happens,
+based on the condition logic. The condition logic may manually create
+new insns for the insn list, say via `emit_insn()', and invoke `DONE'.
+For certain named patterns, it may invoke `FAIL' to tell the compiler
+to use an alternate way of performing that task. If it invokes neither
+`DONE' nor `FAIL', the template given in the pattern is inserted, as if
+the `define_expand' were a `define_insn'.
+
+ Once the insn list is generated, various optimization passes convert,
+replace, and rearrange the insns in the insn list. This is where the
+`define_split' and `define_peephole' patterns get used, for example.
+
+ Finally, the insn list's RTL is matched up with the RTL templates in
+the `define_insn' patterns, and those patterns are used to emit the
+final assembly code. For this purpose, each named `define_insn' acts
+like it's unnamed, since the names are ignored.
+
+
+File: gccint.info, Node: Patterns, Next: Example, Prev: Overview, Up: Machine Desc
+
+16.2 Everything about Instruction Patterns
+==========================================
+
+Each instruction pattern contains an incomplete RTL expression, with
+pieces to be filled in later, operand constraints that restrict how the
+pieces can be filled in, and an output pattern or C code to generate
+the assembler output, all wrapped up in a `define_insn' expression.
+
+ A `define_insn' is an RTL expression containing four or five operands:
+
+ 1. An optional name. The presence of a name indicate that this
+ instruction pattern can perform a certain standard job for the
+ RTL-generation pass of the compiler. This pass knows certain
+ names and will use the instruction patterns with those names, if
+ the names are defined in the machine description.
+
+ The absence of a name is indicated by writing an empty string
+ where the name should go. Nameless instruction patterns are never
+ used for generating RTL code, but they may permit several simpler
+ insns to be combined later on.
+
+ Names that are not thus known and used in RTL-generation have no
+ effect; they are equivalent to no name at all.
+
+ For the purpose of debugging the compiler, you may also specify a
+ name beginning with the `*' character. Such a name is used only
+ for identifying the instruction in RTL dumps; it is entirely
+ equivalent to having a nameless pattern for all other purposes.
+
+ 2. The "RTL template" (*note RTL Template::) is a vector of incomplete
+ RTL expressions which show what the instruction should look like.
+ It is incomplete because it may contain `match_operand',
+ `match_operator', and `match_dup' expressions that stand for
+ operands of the instruction.
+
+ If the vector has only one element, that element is the template
+ for the instruction pattern. If the vector has multiple elements,
+ then the instruction pattern is a `parallel' expression containing
+ the elements described.
+
+ 3. A condition. This is a string which contains a C expression that
+ is the final test to decide whether an insn body matches this
+ pattern.
+
+ For a named pattern, the condition (if present) may not depend on
+ the data in the insn being matched, but only the
+ target-machine-type flags. The compiler needs to test these
+ conditions during initialization in order to learn exactly which
+ named instructions are available in a particular run.
+
+ For nameless patterns, the condition is applied only when matching
+ an individual insn, and only after the insn has matched the
+ pattern's recognition template. The insn's operands may be found
+ in the vector `operands'. For an insn where the condition has
+ once matched, it can't be used to control register allocation, for
+ example by excluding certain hard registers or hard register
+ combinations.
+
+ 4. The "output template": a string that says how to output matching
+ insns as assembler code. `%' in this string specifies where to
+ substitute the value of an operand. *Note Output Template::.
+
+ When simple substitution isn't general enough, you can specify a
+ piece of C code to compute the output. *Note Output Statement::.
+
+ 5. Optionally, a vector containing the values of attributes for insns
+ matching this pattern. *Note Insn Attributes::.
+
+
+File: gccint.info, Node: Example, Next: RTL Template, Prev: Patterns, Up: Machine Desc
+
+16.3 Example of `define_insn'
+=============================
+
+Here is an actual example of an instruction pattern, for the
+68000/68020.
+
+ (define_insn "tstsi"
+ [(set (cc0)
+ (match_operand:SI 0 "general_operand" "rm"))]
+ ""
+ "*
+ {
+ if (TARGET_68020 || ! ADDRESS_REG_P (operands[0]))
+ return \"tstl %0\";
+ return \"cmpl #0,%0\";
+ }")
+
+This can also be written using braced strings:
+
+ (define_insn "tstsi"
+ [(set (cc0)
+ (match_operand:SI 0 "general_operand" "rm"))]
+ ""
+ {
+ if (TARGET_68020 || ! ADDRESS_REG_P (operands[0]))
+ return "tstl %0";
+ return "cmpl #0,%0";
+ })
+
+ This is an instruction that sets the condition codes based on the
+value of a general operand. It has no condition, so any insn whose RTL
+description has the form shown may be handled according to this
+pattern. The name `tstsi' means "test a `SImode' value" and tells the
+RTL generation pass that, when it is necessary to test such a value, an
+insn to do so can be constructed using this pattern.
+
+ The output control string is a piece of C code which chooses which
+output template to return based on the kind of operand and the specific
+type of CPU for which code is being generated.
+
+ `"rm"' is an operand constraint. Its meaning is explained below.
+
+
+File: gccint.info, Node: RTL Template, Next: Output Template, Prev: Example, Up: Machine Desc
+
+16.4 RTL Template
+=================
+
+The RTL template is used to define which insns match the particular
+pattern and how to find their operands. For named patterns, the RTL
+template also says how to construct an insn from specified operands.
+
+ Construction involves substituting specified operands into a copy of
+the template. Matching involves determining the values that serve as
+the operands in the insn being matched. Both of these activities are
+controlled by special expression types that direct matching and
+substitution of the operands.
+
+`(match_operand:M N PREDICATE CONSTRAINT)'
+ This expression is a placeholder for operand number N of the insn.
+ When constructing an insn, operand number N will be substituted
+ at this point. When matching an insn, whatever appears at this
+ position in the insn will be taken as operand number N; but it
+ must satisfy PREDICATE or this instruction pattern will not match
+ at all.
+
+ Operand numbers must be chosen consecutively counting from zero in
+ each instruction pattern. There may be only one `match_operand'
+ expression in the pattern for each operand number. Usually
+ operands are numbered in the order of appearance in `match_operand'
+ expressions. In the case of a `define_expand', any operand numbers
+ used only in `match_dup' expressions have higher values than all
+ other operand numbers.
+
+ PREDICATE is a string that is the name of a function that accepts
+ two arguments, an expression and a machine mode. *Note
+ Predicates::. During matching, the function will be called with
+ the putative operand as the expression and M as the mode argument
+ (if M is not specified, `VOIDmode' will be used, which normally
+ causes PREDICATE to accept any mode). If it returns zero, this
+ instruction pattern fails to match. PREDICATE may be an empty
+ string; then it means no test is to be done on the operand, so
+ anything which occurs in this position is valid.
+
+ Most of the time, PREDICATE will reject modes other than M--but
+ not always. For example, the predicate `address_operand' uses M
+ as the mode of memory ref that the address should be valid for.
+ Many predicates accept `const_int' nodes even though their mode is
+ `VOIDmode'.
+
+ CONSTRAINT controls reloading and the choice of the best register
+ class to use for a value, as explained later (*note Constraints::).
+ If the constraint would be an empty string, it can be omitted.
+
+ People are often unclear on the difference between the constraint
+ and the predicate. The predicate helps decide whether a given
+ insn matches the pattern. The constraint plays no role in this
+ decision; instead, it controls various decisions in the case of an
+ insn which does match.
+
+`(match_scratch:M N CONSTRAINT)'
+ This expression is also a placeholder for operand number N and
+ indicates that operand must be a `scratch' or `reg' expression.
+
+ When matching patterns, this is equivalent to
+
+ (match_operand:M N "scratch_operand" PRED)
+
+ but, when generating RTL, it produces a (`scratch':M) expression.
+
+ If the last few expressions in a `parallel' are `clobber'
+ expressions whose operands are either a hard register or
+ `match_scratch', the combiner can add or delete them when
+ necessary. *Note Side Effects::.
+
+`(match_dup N)'
+ This expression is also a placeholder for operand number N. It is
+ used when the operand needs to appear more than once in the insn.
+
+ In construction, `match_dup' acts just like `match_operand': the
+ operand is substituted into the insn being constructed. But in
+ matching, `match_dup' behaves differently. It assumes that operand
+ number N has already been determined by a `match_operand'
+ appearing earlier in the recognition template, and it matches only
+ an identical-looking expression.
+
+ Note that `match_dup' should not be used to tell the compiler that
+ a particular register is being used for two operands (example:
+ `add' that adds one register to another; the second register is
+ both an input operand and the output operand). Use a matching
+ constraint (*note Simple Constraints::) for those. `match_dup' is
+ for the cases where one operand is used in two places in the
+ template, such as an instruction that computes both a quotient and
+ a remainder, where the opcode takes two input operands but the RTL
+ template has to refer to each of those twice; once for the
+ quotient pattern and once for the remainder pattern.
+
+`(match_operator:M N PREDICATE [OPERANDS...])'
+ This pattern is a kind of placeholder for a variable RTL expression
+ code.
+
+ When constructing an insn, it stands for an RTL expression whose
+ expression code is taken from that of operand N, and whose
+ operands are constructed from the patterns OPERANDS.
+
+ When matching an expression, it matches an expression if the
+ function PREDICATE returns nonzero on that expression _and_ the
+ patterns OPERANDS match the operands of the expression.
+
+ Suppose that the function `commutative_operator' is defined as
+ follows, to match any expression whose operator is one of the
+ commutative arithmetic operators of RTL and whose mode is MODE:
+
+ int
+ commutative_integer_operator (x, mode)
+ rtx x;
+ enum machine_mode mode;
+ {
+ enum rtx_code code = GET_CODE (x);
+ if (GET_MODE (x) != mode)
+ return 0;
+ return (GET_RTX_CLASS (code) == RTX_COMM_ARITH
+ || code == EQ || code == NE);
+ }
+
+ Then the following pattern will match any RTL expression consisting
+ of a commutative operator applied to two general operands:
+
+ (match_operator:SI 3 "commutative_operator"
+ [(match_operand:SI 1 "general_operand" "g")
+ (match_operand:SI 2 "general_operand" "g")])
+
+ Here the vector `[OPERANDS...]' contains two patterns because the
+ expressions to be matched all contain two operands.
+
+ When this pattern does match, the two operands of the commutative
+ operator are recorded as operands 1 and 2 of the insn. (This is
+ done by the two instances of `match_operand'.) Operand 3 of the
+ insn will be the entire commutative expression: use `GET_CODE
+ (operands[3])' to see which commutative operator was used.
+
+ The machine mode M of `match_operator' works like that of
+ `match_operand': it is passed as the second argument to the
+ predicate function, and that function is solely responsible for
+ deciding whether the expression to be matched "has" that mode.
+
+ When constructing an insn, argument 3 of the gen-function will
+ specify the operation (i.e. the expression code) for the
+ expression to be made. It should be an RTL expression, whose
+ expression code is copied into a new expression whose operands are
+ arguments 1 and 2 of the gen-function. The subexpressions of
+ argument 3 are not used; only its expression code matters.
+
+ When `match_operator' is used in a pattern for matching an insn,
+ it usually best if the operand number of the `match_operator' is
+ higher than that of the actual operands of the insn. This improves
+ register allocation because the register allocator often looks at
+ operands 1 and 2 of insns to see if it can do register tying.
+
+ There is no way to specify constraints in `match_operator'. The
+ operand of the insn which corresponds to the `match_operator'
+ never has any constraints because it is never reloaded as a whole.
+ However, if parts of its OPERANDS are matched by `match_operand'
+ patterns, those parts may have constraints of their own.
+
+`(match_op_dup:M N[OPERANDS...])'
+ Like `match_dup', except that it applies to operators instead of
+ operands. When constructing an insn, operand number N will be
+ substituted at this point. But in matching, `match_op_dup' behaves
+ differently. It assumes that operand number N has already been
+ determined by a `match_operator' appearing earlier in the
+ recognition template, and it matches only an identical-looking
+ expression.
+
+`(match_parallel N PREDICATE [SUBPAT...])'
+ This pattern is a placeholder for an insn that consists of a
+ `parallel' expression with a variable number of elements. This
+ expression should only appear at the top level of an insn pattern.
+
+ When constructing an insn, operand number N will be substituted at
+ this point. When matching an insn, it matches if the body of the
+ insn is a `parallel' expression with at least as many elements as
+ the vector of SUBPAT expressions in the `match_parallel', if each
+ SUBPAT matches the corresponding element of the `parallel', _and_
+ the function PREDICATE returns nonzero on the `parallel' that is
+ the body of the insn. It is the responsibility of the predicate
+ to validate elements of the `parallel' beyond those listed in the
+ `match_parallel'.
+
+ A typical use of `match_parallel' is to match load and store
+ multiple expressions, which can contain a variable number of
+ elements in a `parallel'. For example,
+
+ (define_insn ""
+ [(match_parallel 0 "load_multiple_operation"
+ [(set (match_operand:SI 1 "gpc_reg_operand" "=r")
+ (match_operand:SI 2 "memory_operand" "m"))
+ (use (reg:SI 179))
+ (clobber (reg:SI 179))])]
+ ""
+ "loadm 0,0,%1,%2")
+
+ This example comes from `a29k.md'. The function
+ `load_multiple_operation' is defined in `a29k.c' and checks that
+ subsequent elements in the `parallel' are the same as the `set' in
+ the pattern, except that they are referencing subsequent registers
+ and memory locations.
+
+ An insn that matches this pattern might look like:
+
+ (parallel
+ [(set (reg:SI 20) (mem:SI (reg:SI 100)))
+ (use (reg:SI 179))
+ (clobber (reg:SI 179))
+ (set (reg:SI 21)
+ (mem:SI (plus:SI (reg:SI 100)
+ (const_int 4))))
+ (set (reg:SI 22)
+ (mem:SI (plus:SI (reg:SI 100)
+ (const_int 8))))])
+
+`(match_par_dup N [SUBPAT...])'
+ Like `match_op_dup', but for `match_parallel' instead of
+ `match_operator'.
+
+
+
+File: gccint.info, Node: Output Template, Next: Output Statement, Prev: RTL Template, Up: Machine Desc
+
+16.5 Output Templates and Operand Substitution
+==============================================
+
+The "output template" is a string which specifies how to output the
+assembler code for an instruction pattern. Most of the template is a
+fixed string which is output literally. The character `%' is used to
+specify where to substitute an operand; it can also be used to identify
+places where different variants of the assembler require different
+syntax.
+
+ In the simplest case, a `%' followed by a digit N says to output
+operand N at that point in the string.
+
+ `%' followed by a letter and a digit says to output an operand in an
+alternate fashion. Four letters have standard, built-in meanings
+described below. The machine description macro `PRINT_OPERAND' can
+define additional letters with nonstandard meanings.
+
+ `%cDIGIT' can be used to substitute an operand that is a constant
+value without the syntax that normally indicates an immediate operand.
+
+ `%nDIGIT' is like `%cDIGIT' except that the value of the constant is
+negated before printing.
+
+ `%aDIGIT' can be used to substitute an operand as if it were a memory
+reference, with the actual operand treated as the address. This may be
+useful when outputting a "load address" instruction, because often the
+assembler syntax for such an instruction requires you to write the
+operand as if it were a memory reference.
+
+ `%lDIGIT' is used to substitute a `label_ref' into a jump instruction.
+
+ `%=' outputs a number which is unique to each instruction in the
+entire compilation. This is useful for making local labels to be
+referred to more than once in a single template that generates multiple
+assembler instructions.
+
+ `%' followed by a punctuation character specifies a substitution that
+does not use an operand. Only one case is standard: `%%' outputs a `%'
+into the assembler code. Other nonstandard cases can be defined in the
+`PRINT_OPERAND' macro. You must also define which punctuation
+characters are valid with the `PRINT_OPERAND_PUNCT_VALID_P' macro.
+
+ The template may generate multiple assembler instructions. Write the
+text for the instructions, with `\;' between them.
+
+ When the RTL contains two operands which are required by constraint to
+match each other, the output template must refer only to the
+lower-numbered operand. Matching operands are not always identical,
+and the rest of the compiler arranges to put the proper RTL expression
+for printing into the lower-numbered operand.
+
+ One use of nonstandard letters or punctuation following `%' is to
+distinguish between different assembler languages for the same machine;
+for example, Motorola syntax versus MIT syntax for the 68000. Motorola
+syntax requires periods in most opcode names, while MIT syntax does
+not. For example, the opcode `movel' in MIT syntax is `move.l' in
+Motorola syntax. The same file of patterns is used for both kinds of
+output syntax, but the character sequence `%.' is used in each place
+where Motorola syntax wants a period. The `PRINT_OPERAND' macro for
+Motorola syntax defines the sequence to output a period; the macro for
+MIT syntax defines it to do nothing.
+
+ As a special case, a template consisting of the single character `#'
+instructs the compiler to first split the insn, and then output the
+resulting instructions separately. This helps eliminate redundancy in
+the output templates. If you have a `define_insn' that needs to emit
+multiple assembler instructions, and there is an matching `define_split'
+already defined, then you can simply use `#' as the output template
+instead of writing an output template that emits the multiple assembler
+instructions.
+
+ If the macro `ASSEMBLER_DIALECT' is defined, you can use construct of
+the form `{option0|option1|option2}' in the templates. These describe
+multiple variants of assembler language syntax. *Note Instruction
+Output::.
+
+
+File: gccint.info, Node: Output Statement, Next: Predicates, Prev: Output Template, Up: Machine Desc
+
+16.6 C Statements for Assembler Output
+======================================
+
+Often a single fixed template string cannot produce correct and
+efficient assembler code for all the cases that are recognized by a
+single instruction pattern. For example, the opcodes may depend on the
+kinds of operands; or some unfortunate combinations of operands may
+require extra machine instructions.
+
+ If the output control string starts with a `@', then it is actually a
+series of templates, each on a separate line. (Blank lines and leading
+spaces and tabs are ignored.) The templates correspond to the
+pattern's constraint alternatives (*note Multi-Alternative::). For
+example, if a target machine has a two-address add instruction `addr'
+to add into a register and another `addm' to add a register to memory,
+you might write this pattern:
+
+ (define_insn "addsi3"
+ [(set (match_operand:SI 0 "general_operand" "=r,m")
+ (plus:SI (match_operand:SI 1 "general_operand" "0,0")
+ (match_operand:SI 2 "general_operand" "g,r")))]
+ ""
+ "@
+ addr %2,%0
+ addm %2,%0")
+
+ If the output control string starts with a `*', then it is not an
+output template but rather a piece of C program that should compute a
+template. It should execute a `return' statement to return the
+template-string you want. Most such templates use C string literals,
+which require doublequote characters to delimit them. To include these
+doublequote characters in the string, prefix each one with `\'.
+
+ If the output control string is written as a brace block instead of a
+double-quoted string, it is automatically assumed to be C code. In that
+case, it is not necessary to put in a leading asterisk, or to escape the
+doublequotes surrounding C string literals.
+
+ The operands may be found in the array `operands', whose C data type
+is `rtx []'.
+
+ It is very common to select different ways of generating assembler code
+based on whether an immediate operand is within a certain range. Be
+careful when doing this, because the result of `INTVAL' is an integer
+on the host machine. If the host machine has more bits in an `int'
+than the target machine has in the mode in which the constant will be
+used, then some of the bits you get from `INTVAL' will be superfluous.
+For proper results, you must carefully disregard the values of those
+bits.
+
+ It is possible to output an assembler instruction and then go on to
+output or compute more of them, using the subroutine `output_asm_insn'.
+This receives two arguments: a template-string and a vector of
+operands. The vector may be `operands', or it may be another array of
+`rtx' that you declare locally and initialize yourself.
+
+ When an insn pattern has multiple alternatives in its constraints,
+often the appearance of the assembler code is determined mostly by
+which alternative was matched. When this is so, the C code can test
+the variable `which_alternative', which is the ordinal number of the
+alternative that was actually satisfied (0 for the first, 1 for the
+second alternative, etc.).
+
+ For example, suppose there are two opcodes for storing zero, `clrreg'
+for registers and `clrmem' for memory locations. Here is how a pattern
+could use `which_alternative' to choose between them:
+
+ (define_insn ""
+ [(set (match_operand:SI 0 "general_operand" "=r,m")
+ (const_int 0))]
+ ""
+ {
+ return (which_alternative == 0
+ ? "clrreg %0" : "clrmem %0");
+ })
+
+ The example above, where the assembler code to generate was _solely_
+determined by the alternative, could also have been specified as
+follows, having the output control string start with a `@':
+
+ (define_insn ""
+ [(set (match_operand:SI 0 "general_operand" "=r,m")
+ (const_int 0))]
+ ""
+ "@
+ clrreg %0
+ clrmem %0")
+
+
+File: gccint.info, Node: Predicates, Next: Constraints, Prev: Output Statement, Up: Machine Desc
+
+16.7 Predicates
+===============
+
+A predicate determines whether a `match_operand' or `match_operator'
+expression matches, and therefore whether the surrounding instruction
+pattern will be used for that combination of operands. GCC has a
+number of machine-independent predicates, and you can define
+machine-specific predicates as needed. By convention, predicates used
+with `match_operand' have names that end in `_operand', and those used
+with `match_operator' have names that end in `_operator'.
+
+ All predicates are Boolean functions (in the mathematical sense) of
+two arguments: the RTL expression that is being considered at that
+position in the instruction pattern, and the machine mode that the
+`match_operand' or `match_operator' specifies. In this section, the
+first argument is called OP and the second argument MODE. Predicates
+can be called from C as ordinary two-argument functions; this can be
+useful in output templates or other machine-specific code.
+
+ Operand predicates can allow operands that are not actually acceptable
+to the hardware, as long as the constraints give reload the ability to
+fix them up (*note Constraints::). However, GCC will usually generate
+better code if the predicates specify the requirements of the machine
+instructions as closely as possible. Reload cannot fix up operands
+that must be constants ("immediate operands"); you must use a predicate
+that allows only constants, or else enforce the requirement in the
+extra condition.
+
+ Most predicates handle their MODE argument in a uniform manner. If
+MODE is `VOIDmode' (unspecified), then OP can have any mode. If MODE
+is anything else, then OP must have the same mode, unless OP is a
+`CONST_INT' or integer `CONST_DOUBLE'. These RTL expressions always
+have `VOIDmode', so it would be counterproductive to check that their
+mode matches. Instead, predicates that accept `CONST_INT' and/or
+integer `CONST_DOUBLE' check that the value stored in the constant will
+fit in the requested mode.
+
+ Predicates with this behavior are called "normal". `genrecog' can
+optimize the instruction recognizer based on knowledge of how normal
+predicates treat modes. It can also diagnose certain kinds of common
+errors in the use of normal predicates; for instance, it is almost
+always an error to use a normal predicate without specifying a mode.
+
+ Predicates that do something different with their MODE argument are
+called "special". The generic predicates `address_operand' and
+`pmode_register_operand' are special predicates. `genrecog' does not
+do any optimizations or diagnosis when special predicates are used.
+
+* Menu:
+
+* Machine-Independent Predicates:: Predicates available to all back ends.
+* Defining Predicates:: How to write machine-specific predicate
+ functions.
+
+
+File: gccint.info, Node: Machine-Independent Predicates, Next: Defining Predicates, Up: Predicates
+
+16.7.1 Machine-Independent Predicates
+-------------------------------------
+
+These are the generic predicates available to all back ends. They are
+defined in `recog.c'. The first category of predicates allow only
+constant, or "immediate", operands.
+
+ -- Function: immediate_operand
+ This predicate allows any sort of constant that fits in MODE. It
+ is an appropriate choice for instructions that take operands that
+ must be constant.
+
+ -- Function: const_int_operand
+ This predicate allows any `CONST_INT' expression that fits in
+ MODE. It is an appropriate choice for an immediate operand that
+ does not allow a symbol or label.
+
+ -- Function: const_double_operand
+ This predicate accepts any `CONST_DOUBLE' expression that has
+ exactly MODE. If MODE is `VOIDmode', it will also accept
+ `CONST_INT'. It is intended for immediate floating point
+ constants.
+
+The second category of predicates allow only some kind of machine
+register.
+
+ -- Function: register_operand
+ This predicate allows any `REG' or `SUBREG' expression that is
+ valid for MODE. It is often suitable for arithmetic instruction
+ operands on a RISC machine.
+
+ -- Function: pmode_register_operand
+ This is a slight variant on `register_operand' which works around
+ a limitation in the machine-description reader.
+
+ (match_operand N "pmode_register_operand" CONSTRAINT)
+
+ means exactly what
+
+ (match_operand:P N "register_operand" CONSTRAINT)
+
+ would mean, if the machine-description reader accepted `:P' mode
+ suffixes. Unfortunately, it cannot, because `Pmode' is an alias
+ for some other mode, and might vary with machine-specific options.
+ *Note Misc::.
+
+ -- Function: scratch_operand
+ This predicate allows hard registers and `SCRATCH' expressions,
+ but not pseudo-registers. It is used internally by
+ `match_scratch'; it should not be used directly.
+
+The third category of predicates allow only some kind of memory
+reference.
+
+ -- Function: memory_operand
+ This predicate allows any valid reference to a quantity of mode
+ MODE in memory, as determined by the weak form of
+ `GO_IF_LEGITIMATE_ADDRESS' (*note Addressing Modes::).
+
+ -- Function: address_operand
+ This predicate is a little unusual; it allows any operand that is a
+ valid expression for the _address_ of a quantity of mode MODE,
+ again determined by the weak form of `GO_IF_LEGITIMATE_ADDRESS'.
+ To first order, if `(mem:MODE (EXP))' is acceptable to
+ `memory_operand', then EXP is acceptable to `address_operand'.
+ Note that EXP does not necessarily have the mode MODE.
+
+ -- Function: indirect_operand
+ This is a stricter form of `memory_operand' which allows only
+ memory references with a `general_operand' as the address
+ expression. New uses of this predicate are discouraged, because
+ `general_operand' is very permissive, so it's hard to tell what an
+ `indirect_operand' does or does not allow. If a target has
+ different requirements for memory operands for different
+ instructions, it is better to define target-specific predicates
+ which enforce the hardware's requirements explicitly.
+
+ -- Function: push_operand
+ This predicate allows a memory reference suitable for pushing a
+ value onto the stack. This will be a `MEM' which refers to
+ `stack_pointer_rtx', with a side-effect in its address expression
+ (*note Incdec::); which one is determined by the `STACK_PUSH_CODE'
+ macro (*note Frame Layout::).
+
+ -- Function: pop_operand
+ This predicate allows a memory reference suitable for popping a
+ value off the stack. Again, this will be a `MEM' referring to
+ `stack_pointer_rtx', with a side-effect in its address expression.
+ However, this time `STACK_POP_CODE' is expected.
+
+The fourth category of predicates allow some combination of the above
+operands.
+
+ -- Function: nonmemory_operand
+ This predicate allows any immediate or register operand valid for
+ MODE.
+
+ -- Function: nonimmediate_operand
+ This predicate allows any register or memory operand valid for
+ MODE.
+
+ -- Function: general_operand
+ This predicate allows any immediate, register, or memory operand
+ valid for MODE.
+
+Finally, there is one generic operator predicate.
+
+ -- Function: comparison_operator
+ This predicate matches any expression which performs an arithmetic
+ comparison in MODE; that is, `COMPARISON_P' is true for the
+ expression code.
+
+
+File: gccint.info, Node: Defining Predicates, Prev: Machine-Independent Predicates, Up: Predicates
+
+16.7.2 Defining Machine-Specific Predicates
+-------------------------------------------
+
+Many machines have requirements for their operands that cannot be
+expressed precisely using the generic predicates. You can define
+additional predicates using `define_predicate' and
+`define_special_predicate' expressions. These expressions have three
+operands:
+
+ * The name of the predicate, as it will be referred to in
+ `match_operand' or `match_operator' expressions.
+
+ * An RTL expression which evaluates to true if the predicate allows
+ the operand OP, false if it does not. This expression can only use
+ the following RTL codes:
+
+ `MATCH_OPERAND'
+ When written inside a predicate expression, a `MATCH_OPERAND'
+ expression evaluates to true if the predicate it names would
+ allow OP. The operand number and constraint are ignored.
+ Due to limitations in `genrecog', you can only refer to
+ generic predicates and predicates that have already been
+ defined.
+
+ `MATCH_CODE'
+ This expression evaluates to true if OP or a specified
+ subexpression of OP has one of a given list of RTX codes.
+
+ The first operand of this expression is a string constant
+ containing a comma-separated list of RTX code names (in lower
+ case). These are the codes for which the `MATCH_CODE' will
+ be true.
+
+ The second operand is a string constant which indicates what
+ subexpression of OP to examine. If it is absent or the empty
+ string, OP itself is examined. Otherwise, the string constant
+ must be a sequence of digits and/or lowercase letters. Each
+ character indicates a subexpression to extract from the
+ current expression; for the first character this is OP, for
+ the second and subsequent characters it is the result of the
+ previous character. A digit N extracts `XEXP (E, N)'; a
+ letter L extracts `XVECEXP (E, 0, N)' where N is the
+ alphabetic ordinal of L (0 for `a', 1 for 'b', and so on).
+ The `MATCH_CODE' then examines the RTX code of the
+ subexpression extracted by the complete string. It is not
+ possible to extract components of an `rtvec' that is not at
+ position 0 within its RTX object.
+
+ `MATCH_TEST'
+ This expression has one operand, a string constant containing
+ a C expression. The predicate's arguments, OP and MODE, are
+ available with those names in the C expression. The
+ `MATCH_TEST' evaluates to true if the C expression evaluates
+ to a nonzero value. `MATCH_TEST' expressions must not have
+ side effects.
+
+ `AND'
+ `IOR'
+ `NOT'
+ `IF_THEN_ELSE'
+ The basic `MATCH_' expressions can be combined using these
+ logical operators, which have the semantics of the C operators
+ `&&', `||', `!', and `? :' respectively. As in Common Lisp,
+ you may give an `AND' or `IOR' expression an arbitrary number
+ of arguments; this has exactly the same effect as writing a
+ chain of two-argument `AND' or `IOR' expressions.
+
+ * An optional block of C code, which should execute `return true' if
+ the predicate is found to match and `return false' if it does not.
+ It must not have any side effects. The predicate arguments, OP
+ and MODE, are available with those names.
+
+ If a code block is present in a predicate definition, then the RTL
+ expression must evaluate to true _and_ the code block must execute
+ `return true' for the predicate to allow the operand. The RTL
+ expression is evaluated first; do not re-check anything in the
+ code block that was checked in the RTL expression.
+
+ The program `genrecog' scans `define_predicate' and
+`define_special_predicate' expressions to determine which RTX codes are
+possibly allowed. You should always make this explicit in the RTL
+predicate expression, using `MATCH_OPERAND' and `MATCH_CODE'.
+
+ Here is an example of a simple predicate definition, from the IA64
+machine description:
+
+ ;; True if OP is a `SYMBOL_REF' which refers to the sdata section.
+ (define_predicate "small_addr_symbolic_operand"
+ (and (match_code "symbol_ref")
+ (match_test "SYMBOL_REF_SMALL_ADDR_P (op)")))
+
+And here is another, showing the use of the C block.
+
+ ;; True if OP is a register operand that is (or could be) a GR reg.
+ (define_predicate "gr_register_operand"
+ (match_operand 0 "register_operand")
+ {
+ unsigned int regno;
+ if (GET_CODE (op) == SUBREG)
+ op = SUBREG_REG (op);
+
+ regno = REGNO (op);
+ return (regno >= FIRST_PSEUDO_REGISTER || GENERAL_REGNO_P (regno));
+ })
+
+ Predicates written with `define_predicate' automatically include a
+test that MODE is `VOIDmode', or OP has the same mode as MODE, or OP is
+a `CONST_INT' or `CONST_DOUBLE'. They do _not_ check specifically for
+integer `CONST_DOUBLE', nor do they test that the value of either kind
+of constant fits in the requested mode. This is because
+target-specific predicates that take constants usually have to do more
+stringent value checks anyway. If you need the exact same treatment of
+`CONST_INT' or `CONST_DOUBLE' that the generic predicates provide, use
+a `MATCH_OPERAND' subexpression to call `const_int_operand',
+`const_double_operand', or `immediate_operand'.
+
+ Predicates written with `define_special_predicate' do not get any
+automatic mode checks, and are treated as having special mode handling
+by `genrecog'.
+
+ The program `genpreds' is responsible for generating code to test
+predicates. It also writes a header file containing function
+declarations for all machine-specific predicates. It is not necessary
+to declare these predicates in `CPU-protos.h'.
+
+
+File: gccint.info, Node: Constraints, Next: Standard Names, Prev: Predicates, Up: Machine Desc
+
+16.8 Operand Constraints
+========================
+
+Each `match_operand' in an instruction pattern can specify constraints
+for the operands allowed. The constraints allow you to fine-tune
+matching within the set of operands allowed by the predicate.
+
+ Constraints can say whether an operand may be in a register, and which
+kinds of register; whether the operand can be a memory reference, and
+which kinds of address; whether the operand may be an immediate
+constant, and which possible values it may have. Constraints can also
+require two operands to match.
+
+* Menu:
+
+* Simple Constraints:: Basic use of constraints.
+* Multi-Alternative:: When an insn has two alternative constraint-patterns.
+* Class Preferences:: Constraints guide which hard register to put things in.
+* Modifiers:: More precise control over effects of constraints.
+* Disable Insn Alternatives:: Disable insn alternatives using the `enabled' attribute.
+* Machine Constraints:: Existing constraints for some particular machines.
+* Define Constraints:: How to define machine-specific constraints.
+* C Constraint Interface:: How to test constraints from C code.
+
+
+File: gccint.info, Node: Simple Constraints, Next: Multi-Alternative, Up: Constraints
+
+16.8.1 Simple Constraints
+-------------------------
+
+The simplest kind of constraint is a string full of letters, each of
+which describes one kind of operand that is permitted. Here are the
+letters that are allowed:
+
+whitespace
+ Whitespace characters are ignored and can be inserted at any
+ position except the first. This enables each alternative for
+ different operands to be visually aligned in the machine
+ description even if they have different number of constraints and
+ modifiers.
+
+`m'
+ A memory operand is allowed, with any kind of address that the
+ machine supports in general. Note that the letter used for the
+ general memory constraint can be re-defined by a back end using
+ the `TARGET_MEM_CONSTRAINT' macro.
+
+`o'
+ A memory operand is allowed, but only if the address is
+ "offsettable". This means that adding a small integer (actually,
+ the width in bytes of the operand, as determined by its machine
+ mode) may be added to the address and the result is also a valid
+ memory address.
+
+ For example, an address which is constant is offsettable; so is an
+ address that is the sum of a register and a constant (as long as a
+ slightly larger constant is also within the range of
+ address-offsets supported by the machine); but an autoincrement or
+ autodecrement address is not offsettable. More complicated
+ indirect/indexed addresses may or may not be offsettable depending
+ on the other addressing modes that the machine supports.
+
+ Note that in an output operand which can be matched by another
+ operand, the constraint letter `o' is valid only when accompanied
+ by both `<' (if the target machine has predecrement addressing)
+ and `>' (if the target machine has preincrement addressing).
+
+`V'
+ A memory operand that is not offsettable. In other words,
+ anything that would fit the `m' constraint but not the `o'
+ constraint.
+
+`<'
+ A memory operand with autodecrement addressing (either
+ predecrement or postdecrement) is allowed.
+
+`>'
+ A memory operand with autoincrement addressing (either
+ preincrement or postincrement) is allowed.
+
+`r'
+ A register operand is allowed provided that it is in a general
+ register.
+
+`i'
+ An immediate integer operand (one with constant value) is allowed.
+ This includes symbolic constants whose values will be known only at
+ assembly time or later.
+
+`n'
+ An immediate integer operand with a known numeric value is allowed.
+ Many systems cannot support assembly-time constants for operands
+ less than a word wide. Constraints for these operands should use
+ `n' rather than `i'.
+
+`I', `J', `K', ... `P'
+ Other letters in the range `I' through `P' may be defined in a
+ machine-dependent fashion to permit immediate integer operands with
+ explicit integer values in specified ranges. For example, on the
+ 68000, `I' is defined to stand for the range of values 1 to 8.
+ This is the range permitted as a shift count in the shift
+ instructions.
+
+`E'
+ An immediate floating operand (expression code `const_double') is
+ allowed, but only if the target floating point format is the same
+ as that of the host machine (on which the compiler is running).
+
+`F'
+ An immediate floating operand (expression code `const_double' or
+ `const_vector') is allowed.
+
+`G', `H'
+ `G' and `H' may be defined in a machine-dependent fashion to
+ permit immediate floating operands in particular ranges of values.
+
+`s'
+ An immediate integer operand whose value is not an explicit
+ integer is allowed.
+
+ This might appear strange; if an insn allows a constant operand
+ with a value not known at compile time, it certainly must allow
+ any known value. So why use `s' instead of `i'? Sometimes it
+ allows better code to be generated.
+
+ For example, on the 68000 in a fullword instruction it is possible
+ to use an immediate operand; but if the immediate value is between
+ -128 and 127, better code results from loading the value into a
+ register and using the register. This is because the load into
+ the register can be done with a `moveq' instruction. We arrange
+ for this to happen by defining the letter `K' to mean "any integer
+ outside the range -128 to 127", and then specifying `Ks' in the
+ operand constraints.
+
+`g'
+ Any register, memory or immediate integer operand is allowed,
+ except for registers that are not general registers.
+
+`X'
+ Any operand whatsoever is allowed, even if it does not satisfy
+ `general_operand'. This is normally used in the constraint of a
+ `match_scratch' when certain alternatives will not actually
+ require a scratch register.
+
+`0', `1', `2', ... `9'
+ An operand that matches the specified operand number is allowed.
+ If a digit is used together with letters within the same
+ alternative, the digit should come last.
+
+ This number is allowed to be more than a single digit. If multiple
+ digits are encountered consecutively, they are interpreted as a
+ single decimal integer. There is scant chance for ambiguity,
+ since to-date it has never been desirable that `10' be interpreted
+ as matching either operand 1 _or_ operand 0. Should this be
+ desired, one can use multiple alternatives instead.
+
+ This is called a "matching constraint" and what it really means is
+ that the assembler has only a single operand that fills two roles
+ considered separate in the RTL insn. For example, an add insn has
+ two input operands and one output operand in the RTL, but on most
+ CISC machines an add instruction really has only two operands, one
+ of them an input-output operand:
+
+ addl #35,r12
+
+ Matching constraints are used in these circumstances. More
+ precisely, the two operands that match must include one input-only
+ operand and one output-only operand. Moreover, the digit must be a
+ smaller number than the number of the operand that uses it in the
+ constraint.
+
+ For operands to match in a particular case usually means that they
+ are identical-looking RTL expressions. But in a few special cases
+ specific kinds of dissimilarity are allowed. For example, `*x' as
+ an input operand will match `*x++' as an output operand. For
+ proper results in such cases, the output template should always
+ use the output-operand's number when printing the operand.
+
+`p'
+ An operand that is a valid memory address is allowed. This is for
+ "load address" and "push address" instructions.
+
+ `p' in the constraint must be accompanied by `address_operand' as
+ the predicate in the `match_operand'. This predicate interprets
+ the mode specified in the `match_operand' as the mode of the memory
+ reference for which the address would be valid.
+
+OTHER-LETTERS
+ Other letters can be defined in machine-dependent fashion to stand
+ for particular classes of registers or other arbitrary operand
+ types. `d', `a' and `f' are defined on the 68000/68020 to stand
+ for data, address and floating point registers.
+
+ In order to have valid assembler code, each operand must satisfy its
+constraint. But a failure to do so does not prevent the pattern from
+applying to an insn. Instead, it directs the compiler to modify the
+code so that the constraint will be satisfied. Usually this is done by
+copying an operand into a register.
+
+ Contrast, therefore, the two instruction patterns that follow:
+
+ (define_insn ""
+ [(set (match_operand:SI 0 "general_operand" "=r")
+ (plus:SI (match_dup 0)
+ (match_operand:SI 1 "general_operand" "r")))]
+ ""
+ "...")
+
+which has two operands, one of which must appear in two places, and
+
+ (define_insn ""
+ [(set (match_operand:SI 0 "general_operand" "=r")
+ (plus:SI (match_operand:SI 1 "general_operand" "0")
+ (match_operand:SI 2 "general_operand" "r")))]
+ ""
+ "...")
+
+which has three operands, two of which are required by a constraint to
+be identical. If we are considering an insn of the form
+
+ (insn N PREV NEXT
+ (set (reg:SI 3)
+ (plus:SI (reg:SI 6) (reg:SI 109)))
+ ...)
+
+the first pattern would not apply at all, because this insn does not
+contain two identical subexpressions in the right place. The pattern
+would say, "That does not look like an add instruction; try other
+patterns". The second pattern would say, "Yes, that's an add
+instruction, but there is something wrong with it". It would direct
+the reload pass of the compiler to generate additional insns to make
+the constraint true. The results might look like this:
+
+ (insn N2 PREV N
+ (set (reg:SI 3) (reg:SI 6))
+ ...)
+
+ (insn N N2 NEXT
+ (set (reg:SI 3)
+ (plus:SI (reg:SI 3) (reg:SI 109)))
+ ...)
+
+ It is up to you to make sure that each operand, in each pattern, has
+constraints that can handle any RTL expression that could be present for
+that operand. (When multiple alternatives are in use, each pattern
+must, for each possible combination of operand expressions, have at
+least one alternative which can handle that combination of operands.)
+The constraints don't need to _allow_ any possible operand--when this is
+the case, they do not constrain--but they must at least point the way to
+reloading any possible operand so that it will fit.
+
+ * If the constraint accepts whatever operands the predicate permits,
+ there is no problem: reloading is never necessary for this operand.
+
+ For example, an operand whose constraints permit everything except
+ registers is safe provided its predicate rejects registers.
+
+ An operand whose predicate accepts only constant values is safe
+ provided its constraints include the letter `i'. If any possible
+ constant value is accepted, then nothing less than `i' will do; if
+ the predicate is more selective, then the constraints may also be
+ more selective.
+
+ * Any operand expression can be reloaded by copying it into a
+ register. So if an operand's constraints allow some kind of
+ register, it is certain to be safe. It need not permit all
+ classes of registers; the compiler knows how to copy a register
+ into another register of the proper class in order to make an
+ instruction valid.
+
+ * A nonoffsettable memory reference can be reloaded by copying the
+ address into a register. So if the constraint uses the letter
+ `o', all memory references are taken care of.
+
+ * A constant operand can be reloaded by allocating space in memory to
+ hold it as preinitialized data. Then the memory reference can be
+ used in place of the constant. So if the constraint uses the
+ letters `o' or `m', constant operands are not a problem.
+
+ * If the constraint permits a constant and a pseudo register used in
+ an insn was not allocated to a hard register and is equivalent to
+ a constant, the register will be replaced with the constant. If
+ the predicate does not permit a constant and the insn is
+ re-recognized for some reason, the compiler will crash. Thus the
+ predicate must always recognize any objects allowed by the
+ constraint.
+
+ If the operand's predicate can recognize registers, but the constraint
+does not permit them, it can make the compiler crash. When this
+operand happens to be a register, the reload pass will be stymied,
+because it does not know how to copy a register temporarily into memory.
+
+ If the predicate accepts a unary operator, the constraint applies to
+the operand. For example, the MIPS processor at ISA level 3 supports an
+instruction which adds two registers in `SImode' to produce a `DImode'
+result, but only if the registers are correctly sign extended. This
+predicate for the input operands accepts a `sign_extend' of an `SImode'
+register. Write the constraint to indicate the type of register that
+is required for the operand of the `sign_extend'.
+
+
+File: gccint.info, Node: Multi-Alternative, Next: Class Preferences, Prev: Simple Constraints, Up: Constraints
+
+16.8.2 Multiple Alternative Constraints
+---------------------------------------
+
+Sometimes a single instruction has multiple alternative sets of possible
+operands. For example, on the 68000, a logical-or instruction can
+combine register or an immediate value into memory, or it can combine
+any kind of operand into a register; but it cannot combine one memory
+location into another.
+
+ These constraints are represented as multiple alternatives. An
+alternative can be described by a series of letters for each operand.
+The overall constraint for an operand is made from the letters for this
+operand from the first alternative, a comma, the letters for this
+operand from the second alternative, a comma, and so on until the last
+alternative. Here is how it is done for fullword logical-or on the
+68000:
+
+ (define_insn "iorsi3"
+ [(set (match_operand:SI 0 "general_operand" "=m,d")
+ (ior:SI (match_operand:SI 1 "general_operand" "%0,0")
+ (match_operand:SI 2 "general_operand" "dKs,dmKs")))]
+ ...)
+
+ The first alternative has `m' (memory) for operand 0, `0' for operand
+1 (meaning it must match operand 0), and `dKs' for operand 2. The
+second alternative has `d' (data register) for operand 0, `0' for
+operand 1, and `dmKs' for operand 2. The `=' and `%' in the
+constraints apply to all the alternatives; their meaning is explained
+in the next section (*note Class Preferences::).
+
+ If all the operands fit any one alternative, the instruction is valid.
+Otherwise, for each alternative, the compiler counts how many
+instructions must be added to copy the operands so that that
+alternative applies. The alternative requiring the least copying is
+chosen. If two alternatives need the same amount of copying, the one
+that comes first is chosen. These choices can be altered with the `?'
+and `!' characters:
+
+`?'
+ Disparage slightly the alternative that the `?' appears in, as a
+ choice when no alternative applies exactly. The compiler regards
+ this alternative as one unit more costly for each `?' that appears
+ in it.
+
+`!'
+ Disparage severely the alternative that the `!' appears in. This
+ alternative can still be used if it fits without reloading, but if
+ reloading is needed, some other alternative will be used.
+
+ When an insn pattern has multiple alternatives in its constraints,
+often the appearance of the assembler code is determined mostly by which
+alternative was matched. When this is so, the C code for writing the
+assembler code can use the variable `which_alternative', which is the
+ordinal number of the alternative that was actually satisfied (0 for
+the first, 1 for the second alternative, etc.). *Note Output
+Statement::.
+
+
+File: gccint.info, Node: Class Preferences, Next: Modifiers, Prev: Multi-Alternative, Up: Constraints
+
+16.8.3 Register Class Preferences
+---------------------------------
+
+The operand constraints have another function: they enable the compiler
+to decide which kind of hardware register a pseudo register is best
+allocated to. The compiler examines the constraints that apply to the
+insns that use the pseudo register, looking for the machine-dependent
+letters such as `d' and `a' that specify classes of registers. The
+pseudo register is put in whichever class gets the most "votes". The
+constraint letters `g' and `r' also vote: they vote in favor of a
+general register. The machine description says which registers are
+considered general.
+
+ Of course, on some machines all registers are equivalent, and no
+register classes are defined. Then none of this complexity is relevant.
+
+
+File: gccint.info, Node: Modifiers, Next: Disable Insn Alternatives, Prev: Class Preferences, Up: Constraints
+
+16.8.4 Constraint Modifier Characters
+-------------------------------------
+
+Here are constraint modifier characters.
+
+`='
+ Means that this operand is write-only for this instruction: the
+ previous value is discarded and replaced by output data.
+
+`+'
+ Means that this operand is both read and written by the
+ instruction.
+
+ When the compiler fixes up the operands to satisfy the constraints,
+ it needs to know which operands are inputs to the instruction and
+ which are outputs from it. `=' identifies an output; `+'
+ identifies an operand that is both input and output; all other
+ operands are assumed to be input only.
+
+ If you specify `=' or `+' in a constraint, you put it in the first
+ character of the constraint string.
+
+`&'
+ Means (in a particular alternative) that this operand is an
+ "earlyclobber" operand, which is modified before the instruction is
+ finished using the input operands. Therefore, this operand may
+ not lie in a register that is used as an input operand or as part
+ of any memory address.
+
+ `&' applies only to the alternative in which it is written. In
+ constraints with multiple alternatives, sometimes one alternative
+ requires `&' while others do not. See, for example, the `movdf'
+ insn of the 68000.
+
+ An input operand can be tied to an earlyclobber operand if its only
+ use as an input occurs before the early result is written. Adding
+ alternatives of this form often allows GCC to produce better code
+ when only some of the inputs can be affected by the earlyclobber.
+ See, for example, the `mulsi3' insn of the ARM.
+
+ `&' does not obviate the need to write `='.
+
+`%'
+ Declares the instruction to be commutative for this operand and the
+ following operand. This means that the compiler may interchange
+ the two operands if that is the cheapest way to make all operands
+ fit the constraints. This is often used in patterns for addition
+ instructions that really have only two operands: the result must
+ go in one of the arguments. Here for example, is how the 68000
+ halfword-add instruction is defined:
+
+ (define_insn "addhi3"
+ [(set (match_operand:HI 0 "general_operand" "=m,r")
+ (plus:HI (match_operand:HI 1 "general_operand" "%0,0")
+ (match_operand:HI 2 "general_operand" "di,g")))]
+ ...)
+ GCC can only handle one commutative pair in an asm; if you use
+ more, the compiler may fail. Note that you need not use the
+ modifier if the two alternatives are strictly identical; this
+ would only waste time in the reload pass. The modifier is not
+ operational after register allocation, so the result of
+ `define_peephole2' and `define_split's performed after reload
+ cannot rely on `%' to make the intended insn match.
+
+`#'
+ Says that all following characters, up to the next comma, are to be
+ ignored as a constraint. They are significant only for choosing
+ register preferences.
+
+`*'
+ Says that the following character should be ignored when choosing
+ register preferences. `*' has no effect on the meaning of the
+ constraint as a constraint, and no effect on reloading.
+
+ Here is an example: the 68000 has an instruction to sign-extend a
+ halfword in a data register, and can also sign-extend a value by
+ copying it into an address register. While either kind of
+ register is acceptable, the constraints on an address-register
+ destination are less strict, so it is best if register allocation
+ makes an address register its goal. Therefore, `*' is used so
+ that the `d' constraint letter (for data register) is ignored when
+ computing register preferences.
+
+ (define_insn "extendhisi2"
+ [(set (match_operand:SI 0 "general_operand" "=*d,a")
+ (sign_extend:SI
+ (match_operand:HI 1 "general_operand" "0,g")))]
+ ...)
+
+
+File: gccint.info, Node: Machine Constraints, Next: Define Constraints, Prev: Disable Insn Alternatives, Up: Constraints
+
+16.8.5 Constraints for Particular Machines
+------------------------------------------
+
+Whenever possible, you should use the general-purpose constraint letters
+in `asm' arguments, since they will convey meaning more readily to
+people reading your code. Failing that, use the constraint letters
+that usually have very similar meanings across architectures. The most
+commonly used constraints are `m' and `r' (for memory and
+general-purpose registers respectively; *note Simple Constraints::), and
+`I', usually the letter indicating the most common immediate-constant
+format.
+
+ Each architecture defines additional constraints. These constraints
+are used by the compiler itself for instruction generation, as well as
+for `asm' statements; therefore, some of the constraints are not
+particularly useful for `asm'. Here is a summary of some of the
+machine-dependent constraints available on some particular machines; it
+includes both constraints that are useful for `asm' and constraints
+that aren't. The compiler source file mentioned in the table heading
+for each architecture is the definitive reference for the meanings of
+that architecture's constraints.
+
+_ARM family--`config/arm/arm.h'_
+
+ `f'
+ Floating-point register
+
+ `w'
+ VFP floating-point register
+
+ `F'
+ One of the floating-point constants 0.0, 0.5, 1.0, 2.0, 3.0,
+ 4.0, 5.0 or 10.0
+
+ `G'
+ Floating-point constant that would satisfy the constraint `F'
+ if it were negated
+
+ `I'
+ Integer that is valid as an immediate operand in a data
+ processing instruction. That is, an integer in the range 0
+ to 255 rotated by a multiple of 2
+
+ `J'
+ Integer in the range -4095 to 4095
+
+ `K'
+ Integer that satisfies constraint `I' when inverted (ones
+ complement)
+
+ `L'
+ Integer that satisfies constraint `I' when negated (twos
+ complement)
+
+ `M'
+ Integer in the range 0 to 32
+
+ `Q'
+ A memory reference where the exact address is in a single
+ register (``m'' is preferable for `asm' statements)
+
+ `R'
+ An item in the constant pool
+
+ `S'
+ A symbol in the text segment of the current file
+
+ `Uv'
+ A memory reference suitable for VFP load/store insns
+ (reg+constant offset)
+
+ `Uy'
+ A memory reference suitable for iWMMXt load/store
+ instructions.
+
+ `Uq'
+ A memory reference suitable for the ARMv4 ldrsb instruction.
+
+_AVR family--`config/avr/constraints.md'_
+
+ `l'
+ Registers from r0 to r15
+
+ `a'
+ Registers from r16 to r23
+
+ `d'
+ Registers from r16 to r31
+
+ `w'
+ Registers from r24 to r31. These registers can be used in
+ `adiw' command
+
+ `e'
+ Pointer register (r26-r31)
+
+ `b'
+ Base pointer register (r28-r31)
+
+ `q'
+ Stack pointer register (SPH:SPL)
+
+ `t'
+ Temporary register r0
+
+ `x'
+ Register pair X (r27:r26)
+
+ `y'
+ Register pair Y (r29:r28)
+
+ `z'
+ Register pair Z (r31:r30)
+
+ `I'
+ Constant greater than -1, less than 64
+
+ `J'
+ Constant greater than -64, less than 1
+
+ `K'
+ Constant integer 2
+
+ `L'
+ Constant integer 0
+
+ `M'
+ Constant that fits in 8 bits
+
+ `N'
+ Constant integer -1
+
+ `O'
+ Constant integer 8, 16, or 24
+
+ `P'
+ Constant integer 1
+
+ `G'
+ A floating point constant 0.0
+
+ `R'
+ Integer constant in the range -6 ... 5.
+
+ `Q'
+ A memory address based on Y or Z pointer with displacement.
+
+_CRX Architecture--`config/crx/crx.h'_
+
+ `b'
+ Registers from r0 to r14 (registers without stack pointer)
+
+ `l'
+ Register r16 (64-bit accumulator lo register)
+
+ `h'
+ Register r17 (64-bit accumulator hi register)
+
+ `k'
+ Register pair r16-r17. (64-bit accumulator lo-hi pair)
+
+ `I'
+ Constant that fits in 3 bits
+
+ `J'
+ Constant that fits in 4 bits
+
+ `K'
+ Constant that fits in 5 bits
+
+ `L'
+ Constant that is one of -1, 4, -4, 7, 8, 12, 16, 20, 32, 48
+
+ `G'
+ Floating point constant that is legal for store immediate
+
+_Hewlett-Packard PA-RISC--`config/pa/pa.h'_
+
+ `a'
+ General register 1
+
+ `f'
+ Floating point register
+
+ `q'
+ Shift amount register
+
+ `x'
+ Floating point register (deprecated)
+
+ `y'
+ Upper floating point register (32-bit), floating point
+ register (64-bit)
+
+ `Z'
+ Any register
+
+ `I'
+ Signed 11-bit integer constant
+
+ `J'
+ Signed 14-bit integer constant
+
+ `K'
+ Integer constant that can be deposited with a `zdepi'
+ instruction
+
+ `L'
+ Signed 5-bit integer constant
+
+ `M'
+ Integer constant 0
+
+ `N'
+ Integer constant that can be loaded with a `ldil' instruction
+
+ `O'
+ Integer constant whose value plus one is a power of 2
+
+ `P'
+ Integer constant that can be used for `and' operations in
+ `depi' and `extru' instructions
+
+ `S'
+ Integer constant 31
+
+ `U'
+ Integer constant 63
+
+ `G'
+ Floating-point constant 0.0
+
+ `A'
+ A `lo_sum' data-linkage-table memory operand
+
+ `Q'
+ A memory operand that can be used as the destination operand
+ of an integer store instruction
+
+ `R'
+ A scaled or unscaled indexed memory operand
+
+ `T'
+ A memory operand for floating-point loads and stores
+
+ `W'
+ A register indirect memory operand
+
+_picoChip family--`picochip.h'_
+
+ `k'
+ Stack register.
+
+ `f'
+ Pointer register. A register which can be used to access
+ memory without supplying an offset. Any other register can
+ be used to access memory, but will need a constant offset.
+ In the case of the offset being zero, it is more efficient to
+ use a pointer register, since this reduces code size.
+
+ `t'
+ A twin register. A register which may be paired with an
+ adjacent register to create a 32-bit register.
+
+ `a'
+ Any absolute memory address (e.g., symbolic constant, symbolic
+ constant + offset).
+
+ `I'
+ 4-bit signed integer.
+
+ `J'
+ 4-bit unsigned integer.
+
+ `K'
+ 8-bit signed integer.
+
+ `M'
+ Any constant whose absolute value is no greater than 4-bits.
+
+ `N'
+ 10-bit signed integer
+
+ `O'
+ 16-bit signed integer.
+
+
+_PowerPC and IBM RS6000--`config/rs6000/rs6000.h'_
+
+ `b'
+ Address base register
+
+ `f'
+ Floating point register
+
+ `v'
+ Vector register
+
+ `h'
+ `MQ', `CTR', or `LINK' register
+
+ `q'
+ `MQ' register
+
+ `c'
+ `CTR' register
+
+ `l'
+ `LINK' register
+
+ `x'
+ `CR' register (condition register) number 0
+
+ `y'
+ `CR' register (condition register)
+
+ `z'
+ `FPMEM' stack memory for FPR-GPR transfers
+
+ `I'
+ Signed 16-bit constant
+
+ `J'
+ Unsigned 16-bit constant shifted left 16 bits (use `L'
+ instead for `SImode' constants)
+
+ `K'
+ Unsigned 16-bit constant
+
+ `L'
+ Signed 16-bit constant shifted left 16 bits
+
+ `M'
+ Constant larger than 31
+
+ `N'
+ Exact power of 2
+
+ `O'
+ Zero
+
+ `P'
+ Constant whose negation is a signed 16-bit constant
+
+ `G'
+ Floating point constant that can be loaded into a register
+ with one instruction per word
+
+ `H'
+ Integer/Floating point constant that can be loaded into a
+ register using three instructions
+
+ `Q'
+ Memory operand that is an offset from a register (`m' is
+ preferable for `asm' statements)
+
+ `Z'
+ Memory operand that is an indexed or indirect from a register
+ (`m' is preferable for `asm' statements)
+
+ `R'
+ AIX TOC entry
+
+ `a'
+ Address operand that is an indexed or indirect from a
+ register (`p' is preferable for `asm' statements)
+
+ `S'
+ Constant suitable as a 64-bit mask operand
+
+ `T'
+ Constant suitable as a 32-bit mask operand
+
+ `U'
+ System V Release 4 small data area reference
+
+ `t'
+ AND masks that can be performed by two rldic{l, r}
+ instructions
+
+ `W'
+ Vector constant that does not require memory
+
+
+_Intel 386--`config/i386/constraints.md'_
+
+ `R'
+ Legacy register--the eight integer registers available on all
+ i386 processors (`a', `b', `c', `d', `si', `di', `bp', `sp').
+
+ `q'
+ Any register accessible as `Rl'. In 32-bit mode, `a', `b',
+ `c', and `d'; in 64-bit mode, any integer register.
+
+ `Q'
+ Any register accessible as `Rh': `a', `b', `c', and `d'.
+
+ `l'
+ Any register that can be used as the index in a base+index
+ memory access: that is, any general register except the stack
+ pointer.
+
+ `a'
+ The `a' register.
+
+ `b'
+ The `b' register.
+
+ `c'
+ The `c' register.
+
+ `d'
+ The `d' register.
+
+ `S'
+ The `si' register.
+
+ `D'
+ The `di' register.
+
+ `A'
+ The `a' and `d' registers, as a pair (for instructions that
+ return half the result in one and half in the other).
+
+ `f'
+ Any 80387 floating-point (stack) register.
+
+ `t'
+ Top of 80387 floating-point stack (`%st(0)').
+
+ `u'
+ Second from top of 80387 floating-point stack (`%st(1)').
+
+ `y'
+ Any MMX register.
+
+ `x'
+ Any SSE register.
+
+ `Yz'
+ First SSE register (`%xmm0').
+
+ `Y2'
+ Any SSE register, when SSE2 is enabled.
+
+ `Yi'
+ Any SSE register, when SSE2 and inter-unit moves are enabled.
+
+ `Ym'
+ Any MMX register, when inter-unit moves are enabled.
+
+ `I'
+ Integer constant in the range 0 ... 31, for 32-bit shifts.
+
+ `J'
+ Integer constant in the range 0 ... 63, for 64-bit shifts.
+
+ `K'
+ Signed 8-bit integer constant.
+
+ `L'
+ `0xFF' or `0xFFFF', for andsi as a zero-extending move.
+
+ `M'
+ 0, 1, 2, or 3 (shifts for the `lea' instruction).
+
+ `N'
+ Unsigned 8-bit integer constant (for `in' and `out'
+ instructions).
+
+ `O'
+ Integer constant in the range 0 ... 127, for 128-bit shifts.
+
+ `G'
+ Standard 80387 floating point constant.
+
+ `C'
+ Standard SSE floating point constant.
+
+ `e'
+ 32-bit signed integer constant, or a symbolic reference known
+ to fit that range (for immediate operands in sign-extending
+ x86-64 instructions).
+
+ `Z'
+ 32-bit unsigned integer constant, or a symbolic reference
+ known to fit that range (for immediate operands in
+ zero-extending x86-64 instructions).
+
+
+_Intel IA-64--`config/ia64/ia64.h'_
+
+ `a'
+ General register `r0' to `r3' for `addl' instruction
+
+ `b'
+ Branch register
+
+ `c'
+ Predicate register (`c' as in "conditional")
+
+ `d'
+ Application register residing in M-unit
+
+ `e'
+ Application register residing in I-unit
+
+ `f'
+ Floating-point register
+
+ `m'
+ Memory operand. Remember that `m' allows postincrement and
+ postdecrement which require printing with `%Pn' on IA-64.
+ Use `S' to disallow postincrement and postdecrement.
+
+ `G'
+ Floating-point constant 0.0 or 1.0
+
+ `I'
+ 14-bit signed integer constant
+
+ `J'
+ 22-bit signed integer constant
+
+ `K'
+ 8-bit signed integer constant for logical instructions
+
+ `L'
+ 8-bit adjusted signed integer constant for compare pseudo-ops
+
+ `M'
+ 6-bit unsigned integer constant for shift counts
+
+ `N'
+ 9-bit signed integer constant for load and store
+ postincrements
+
+ `O'
+ The constant zero
+
+ `P'
+ 0 or -1 for `dep' instruction
+
+ `Q'
+ Non-volatile memory for floating-point loads and stores
+
+ `R'
+ Integer constant in the range 1 to 4 for `shladd' instruction
+
+ `S'
+ Memory operand except postincrement and postdecrement
+
+_FRV--`config/frv/frv.h'_
+
+ `a'
+ Register in the class `ACC_REGS' (`acc0' to `acc7').
+
+ `b'
+ Register in the class `EVEN_ACC_REGS' (`acc0' to `acc7').
+
+ `c'
+ Register in the class `CC_REGS' (`fcc0' to `fcc3' and `icc0'
+ to `icc3').
+
+ `d'
+ Register in the class `GPR_REGS' (`gr0' to `gr63').
+
+ `e'
+ Register in the class `EVEN_REGS' (`gr0' to `gr63'). Odd
+ registers are excluded not in the class but through the use
+ of a machine mode larger than 4 bytes.
+
+ `f'
+ Register in the class `FPR_REGS' (`fr0' to `fr63').
+
+ `h'
+ Register in the class `FEVEN_REGS' (`fr0' to `fr63'). Odd
+ registers are excluded not in the class but through the use
+ of a machine mode larger than 4 bytes.
+
+ `l'
+ Register in the class `LR_REG' (the `lr' register).
+
+ `q'
+ Register in the class `QUAD_REGS' (`gr2' to `gr63').
+ Register numbers not divisible by 4 are excluded not in the
+ class but through the use of a machine mode larger than 8
+ bytes.
+
+ `t'
+ Register in the class `ICC_REGS' (`icc0' to `icc3').
+
+ `u'
+ Register in the class `FCC_REGS' (`fcc0' to `fcc3').
+
+ `v'
+ Register in the class `ICR_REGS' (`cc4' to `cc7').
+
+ `w'
+ Register in the class `FCR_REGS' (`cc0' to `cc3').
+
+ `x'
+ Register in the class `QUAD_FPR_REGS' (`fr0' to `fr63').
+ Register numbers not divisible by 4 are excluded not in the
+ class but through the use of a machine mode larger than 8
+ bytes.
+
+ `z'
+ Register in the class `SPR_REGS' (`lcr' and `lr').
+
+ `A'
+ Register in the class `QUAD_ACC_REGS' (`acc0' to `acc7').
+
+ `B'
+ Register in the class `ACCG_REGS' (`accg0' to `accg7').
+
+ `C'
+ Register in the class `CR_REGS' (`cc0' to `cc7').
+
+ `G'
+ Floating point constant zero
+
+ `I'
+ 6-bit signed integer constant
+
+ `J'
+ 10-bit signed integer constant
+
+ `L'
+ 16-bit signed integer constant
+
+ `M'
+ 16-bit unsigned integer constant
+
+ `N'
+ 12-bit signed integer constant that is negative--i.e. in the
+ range of -2048 to -1
+
+ `O'
+ Constant zero
+
+ `P'
+ 12-bit signed integer constant that is greater than
+ zero--i.e. in the range of 1 to 2047.
+
+
+_Blackfin family--`config/bfin/constraints.md'_
+
+ `a'
+ P register
+
+ `d'
+ D register
+
+ `z'
+ A call clobbered P register.
+
+ `qN'
+ A single register. If N is in the range 0 to 7, the
+ corresponding D register. If it is `A', then the register P0.
+
+ `D'
+ Even-numbered D register
+
+ `W'
+ Odd-numbered D register
+
+ `e'
+ Accumulator register.
+
+ `A'
+ Even-numbered accumulator register.
+
+ `B'
+ Odd-numbered accumulator register.
+
+ `b'
+ I register
+
+ `v'
+ B register
+
+ `f'
+ M register
+
+ `c'
+ Registers used for circular buffering, i.e. I, B, or L
+ registers.
+
+ `C'
+ The CC register.
+
+ `t'
+ LT0 or LT1.
+
+ `k'
+ LC0 or LC1.
+
+ `u'
+ LB0 or LB1.
+
+ `x'
+ Any D, P, B, M, I or L register.
+
+ `y'
+ Additional registers typically used only in prologues and
+ epilogues: RETS, RETN, RETI, RETX, RETE, ASTAT, SEQSTAT and
+ USP.
+
+ `w'
+ Any register except accumulators or CC.
+
+ `Ksh'
+ Signed 16 bit integer (in the range -32768 to 32767)
+
+ `Kuh'
+ Unsigned 16 bit integer (in the range 0 to 65535)
+
+ `Ks7'
+ Signed 7 bit integer (in the range -64 to 63)
+
+ `Ku7'
+ Unsigned 7 bit integer (in the range 0 to 127)
+
+ `Ku5'
+ Unsigned 5 bit integer (in the range 0 to 31)
+
+ `Ks4'
+ Signed 4 bit integer (in the range -8 to 7)
+
+ `Ks3'
+ Signed 3 bit integer (in the range -3 to 4)
+
+ `Ku3'
+ Unsigned 3 bit integer (in the range 0 to 7)
+
+ `PN'
+ Constant N, where N is a single-digit constant in the range 0
+ to 4.
+
+ `PA'
+ An integer equal to one of the MACFLAG_XXX constants that is
+ suitable for use with either accumulator.
+
+ `PB'
+ An integer equal to one of the MACFLAG_XXX constants that is
+ suitable for use only with accumulator A1.
+
+ `M1'
+ Constant 255.
+
+ `M2'
+ Constant 65535.
+
+ `J'
+ An integer constant with exactly a single bit set.
+
+ `L'
+ An integer constant with all bits set except exactly one.
+
+ `H'
+
+ `Q'
+ Any SYMBOL_REF.
+
+_M32C--`config/m32c/m32c.c'_
+
+ `Rsp'
+ `Rfb'
+ `Rsb'
+ `$sp', `$fb', `$sb'.
+
+ `Rcr'
+ Any control register, when they're 16 bits wide (nothing if
+ control registers are 24 bits wide)
+
+ `Rcl'
+ Any control register, when they're 24 bits wide.
+
+ `R0w'
+ `R1w'
+ `R2w'
+ `R3w'
+ $r0, $r1, $r2, $r3.
+
+ `R02'
+ $r0 or $r2, or $r2r0 for 32 bit values.
+
+ `R13'
+ $r1 or $r3, or $r3r1 for 32 bit values.
+
+ `Rdi'
+ A register that can hold a 64 bit value.
+
+ `Rhl'
+ $r0 or $r1 (registers with addressable high/low bytes)
+
+ `R23'
+ $r2 or $r3
+
+ `Raa'
+ Address registers
+
+ `Raw'
+ Address registers when they're 16 bits wide.
+
+ `Ral'
+ Address registers when they're 24 bits wide.
+
+ `Rqi'
+ Registers that can hold QI values.
+
+ `Rad'
+ Registers that can be used with displacements ($a0, $a1, $sb).
+
+ `Rsi'
+ Registers that can hold 32 bit values.
+
+ `Rhi'
+ Registers that can hold 16 bit values.
+
+ `Rhc'
+ Registers chat can hold 16 bit values, including all control
+ registers.
+
+ `Rra'
+ $r0 through R1, plus $a0 and $a1.
+
+ `Rfl'
+ The flags register.
+
+ `Rmm'
+ The memory-based pseudo-registers $mem0 through $mem15.
+
+ `Rpi'
+ Registers that can hold pointers (16 bit registers for r8c,
+ m16c; 24 bit registers for m32cm, m32c).
+
+ `Rpa'
+ Matches multiple registers in a PARALLEL to form a larger
+ register. Used to match function return values.
+
+ `Is3'
+ -8 ... 7
+
+ `IS1'
+ -128 ... 127
+
+ `IS2'
+ -32768 ... 32767
+
+ `IU2'
+ 0 ... 65535
+
+ `In4'
+ -8 ... -1 or 1 ... 8
+
+ `In5'
+ -16 ... -1 or 1 ... 16
+
+ `In6'
+ -32 ... -1 or 1 ... 32
+
+ `IM2'
+ -65536 ... -1
+
+ `Ilb'
+ An 8 bit value with exactly one bit set.
+
+ `Ilw'
+ A 16 bit value with exactly one bit set.
+
+ `Sd'
+ The common src/dest memory addressing modes.
+
+ `Sa'
+ Memory addressed using $a0 or $a1.
+
+ `Si'
+ Memory addressed with immediate addresses.
+
+ `Ss'
+ Memory addressed using the stack pointer ($sp).
+
+ `Sf'
+ Memory addressed using the frame base register ($fb).
+
+ `Ss'
+ Memory addressed using the small base register ($sb).
+
+ `S1'
+ $r1h
+
+_MIPS--`config/mips/constraints.md'_
+
+ `d'
+ An address register. This is equivalent to `r' unless
+ generating MIPS16 code.
+
+ `f'
+ A floating-point register (if available).
+
+ `h'
+ Formerly the `hi' register. This constraint is no longer
+ supported.
+
+ `l'
+ The `lo' register. Use this register to store values that are
+ no bigger than a word.
+
+ `x'
+ The concatenated `hi' and `lo' registers. Use this register
+ to store doubleword values.
+
+ `c'
+ A register suitable for use in an indirect jump. This will
+ always be `$25' for `-mabicalls'.
+
+ `v'
+ Register `$3'. Do not use this constraint in new code; it is
+ retained only for compatibility with glibc.
+
+ `y'
+ Equivalent to `r'; retained for backwards compatibility.
+
+ `z'
+ A floating-point condition code register.
+
+ `I'
+ A signed 16-bit constant (for arithmetic instructions).
+
+ `J'
+ Integer zero.
+
+ `K'
+ An unsigned 16-bit constant (for logic instructions).
+
+ `L'
+ A signed 32-bit constant in which the lower 16 bits are zero.
+ Such constants can be loaded using `lui'.
+
+ `M'
+ A constant that cannot be loaded using `lui', `addiu' or
+ `ori'.
+
+ `N'
+ A constant in the range -65535 to -1 (inclusive).
+
+ `O'
+ A signed 15-bit constant.
+
+ `P'
+ A constant in the range 1 to 65535 (inclusive).
+
+ `G'
+ Floating-point zero.
+
+ `R'
+ An address that can be used in a non-macro load or store.
+
+_Motorola 680x0--`config/m68k/constraints.md'_
+
+ `a'
+ Address register
+
+ `d'
+ Data register
+
+ `f'
+ 68881 floating-point register, if available
+
+ `I'
+ Integer in the range 1 to 8
+
+ `J'
+ 16-bit signed number
+
+ `K'
+ Signed number whose magnitude is greater than 0x80
+
+ `L'
+ Integer in the range -8 to -1
+
+ `M'
+ Signed number whose magnitude is greater than 0x100
+
+ `N'
+ Range 24 to 31, rotatert:SI 8 to 1 expressed as rotate
+
+ `O'
+ 16 (for rotate using swap)
+
+ `P'
+ Range 8 to 15, rotatert:HI 8 to 1 expressed as rotate
+
+ `R'
+ Numbers that mov3q can handle
+
+ `G'
+ Floating point constant that is not a 68881 constant
+
+ `S'
+ Operands that satisfy 'm' when -mpcrel is in effect
+
+ `T'
+ Operands that satisfy 's' when -mpcrel is not in effect
+
+ `Q'
+ Address register indirect addressing mode
+
+ `U'
+ Register offset addressing
+
+ `W'
+ const_call_operand
+
+ `Cs'
+ symbol_ref or const
+
+ `Ci'
+ const_int
+
+ `C0'
+ const_int 0
+
+ `Cj'
+ Range of signed numbers that don't fit in 16 bits
+
+ `Cmvq'
+ Integers valid for mvq
+
+ `Capsw'
+ Integers valid for a moveq followed by a swap
+
+ `Cmvz'
+ Integers valid for mvz
+
+ `Cmvs'
+ Integers valid for mvs
+
+ `Ap'
+ push_operand
+
+ `Ac'
+ Non-register operands allowed in clr
+
+
+_Motorola 68HC11 & 68HC12 families--`config/m68hc11/m68hc11.h'_
+
+ `a'
+ Register `a'
+
+ `b'
+ Register `b'
+
+ `d'
+ Register `d'
+
+ `q'
+ An 8-bit register
+
+ `t'
+ Temporary soft register _.tmp
+
+ `u'
+ A soft register _.d1 to _.d31
+
+ `w'
+ Stack pointer register
+
+ `x'
+ Register `x'
+
+ `y'
+ Register `y'
+
+ `z'
+ Pseudo register `z' (replaced by `x' or `y' at the end)
+
+ `A'
+ An address register: x, y or z
+
+ `B'
+ An address register: x or y
+
+ `D'
+ Register pair (x:d) to form a 32-bit value
+
+ `L'
+ Constants in the range -65536 to 65535
+
+ `M'
+ Constants whose 16-bit low part is zero
+
+ `N'
+ Constant integer 1 or -1
+
+ `O'
+ Constant integer 16
+
+ `P'
+ Constants in the range -8 to 2
+
+
+_SPARC--`config/sparc/sparc.h'_
+
+ `f'
+ Floating-point register on the SPARC-V8 architecture and
+ lower floating-point register on the SPARC-V9 architecture.
+
+ `e'
+ Floating-point register. It is equivalent to `f' on the
+ SPARC-V8 architecture and contains both lower and upper
+ floating-point registers on the SPARC-V9 architecture.
+
+ `c'
+ Floating-point condition code register.
+
+ `d'
+ Lower floating-point register. It is only valid on the
+ SPARC-V9 architecture when the Visual Instruction Set is
+ available.
+
+ `b'
+ Floating-point register. It is only valid on the SPARC-V9
+ architecture when the Visual Instruction Set is available.
+
+ `h'
+ 64-bit global or out register for the SPARC-V8+ architecture.
+
+ `D'
+ A vector constant
+
+ `I'
+ Signed 13-bit constant
+
+ `J'
+ Zero
+
+ `K'
+ 32-bit constant with the low 12 bits clear (a constant that
+ can be loaded with the `sethi' instruction)
+
+ `L'
+ A constant in the range supported by `movcc' instructions
+
+ `M'
+ A constant in the range supported by `movrcc' instructions
+
+ `N'
+ Same as `K', except that it verifies that bits that are not
+ in the lower 32-bit range are all zero. Must be used instead
+ of `K' for modes wider than `SImode'
+
+ `O'
+ The constant 4096
+
+ `G'
+ Floating-point zero
+
+ `H'
+ Signed 13-bit constant, sign-extended to 32 or 64 bits
+
+ `Q'
+ Floating-point constant whose integral representation can be
+ moved into an integer register using a single sethi
+ instruction
+
+ `R'
+ Floating-point constant whose integral representation can be
+ moved into an integer register using a single mov instruction
+
+ `S'
+ Floating-point constant whose integral representation can be
+ moved into an integer register using a high/lo_sum
+ instruction sequence
+
+ `T'
+ Memory address aligned to an 8-byte boundary
+
+ `U'
+ Even register
+
+ `W'
+ Memory address for `e' constraint registers
+
+ `Y'
+ Vector zero
+
+
+_SPU--`config/spu/spu.h'_
+
+ `a'
+ An immediate which can be loaded with the il/ila/ilh/ilhu
+ instructions. const_int is treated as a 64 bit value.
+
+ `c'
+ An immediate for and/xor/or instructions. const_int is
+ treated as a 64 bit value.
+
+ `d'
+ An immediate for the `iohl' instruction. const_int is
+ treated as a 64 bit value.
+
+ `f'
+ An immediate which can be loaded with `fsmbi'.
+
+ `A'
+ An immediate which can be loaded with the il/ila/ilh/ilhu
+ instructions. const_int is treated as a 32 bit value.
+
+ `B'
+ An immediate for most arithmetic instructions. const_int is
+ treated as a 32 bit value.
+
+ `C'
+ An immediate for and/xor/or instructions. const_int is
+ treated as a 32 bit value.
+
+ `D'
+ An immediate for the `iohl' instruction. const_int is
+ treated as a 32 bit value.
+
+ `I'
+ A constant in the range [-64, 63] for shift/rotate
+ instructions.
+
+ `J'
+ An unsigned 7-bit constant for conversion/nop/channel
+ instructions.
+
+ `K'
+ A signed 10-bit constant for most arithmetic instructions.
+
+ `M'
+ A signed 16 bit immediate for `stop'.
+
+ `N'
+ An unsigned 16-bit constant for `iohl' and `fsmbi'.
+
+ `O'
+ An unsigned 7-bit constant whose 3 least significant bits are
+ 0.
+
+ `P'
+ An unsigned 3-bit constant for 16-byte rotates and shifts
+
+ `R'
+ Call operand, reg, for indirect calls
+
+ `S'
+ Call operand, symbol, for relative calls.
+
+ `T'
+ Call operand, const_int, for absolute calls.
+
+ `U'
+ An immediate which can be loaded with the il/ila/ilh/ilhu
+ instructions. const_int is sign extended to 128 bit.
+
+ `W'
+ An immediate for shift and rotate instructions. const_int is
+ treated as a 32 bit value.
+
+ `Y'
+ An immediate for and/xor/or instructions. const_int is sign
+ extended as a 128 bit.
+
+ `Z'
+ An immediate for the `iohl' instruction. const_int is sign
+ extended to 128 bit.
+
+
+_S/390 and zSeries--`config/s390/s390.h'_
+
+ `a'
+ Address register (general purpose register except r0)
+
+ `c'
+ Condition code register
+
+ `d'
+ Data register (arbitrary general purpose register)
+
+ `f'
+ Floating-point register
+
+ `I'
+ Unsigned 8-bit constant (0-255)
+
+ `J'
+ Unsigned 12-bit constant (0-4095)
+
+ `K'
+ Signed 16-bit constant (-32768-32767)
+
+ `L'
+ Value appropriate as displacement.
+ `(0..4095)'
+ for short displacement
+
+ `(-524288..524287)'
+ for long displacement
+
+ `M'
+ Constant integer with a value of 0x7fffffff.
+
+ `N'
+ Multiple letter constraint followed by 4 parameter letters.
+ `0..9:'
+ number of the part counting from most to least
+ significant
+
+ `H,Q:'
+ mode of the part
+
+ `D,S,H:'
+ mode of the containing operand
+
+ `0,F:'
+ value of the other parts (F--all bits set)
+ The constraint matches if the specified part of a constant
+ has a value different from its other parts.
+
+ `Q'
+ Memory reference without index register and with short
+ displacement.
+
+ `R'
+ Memory reference with index register and short displacement.
+
+ `S'
+ Memory reference without index register but with long
+ displacement.
+
+ `T'
+ Memory reference with index register and long displacement.
+
+ `U'
+ Pointer with short displacement.
+
+ `W'
+ Pointer with long displacement.
+
+ `Y'
+ Shift count operand.
+
+
+_Score family--`config/score/score.h'_
+
+ `d'
+ Registers from r0 to r32.
+
+ `e'
+ Registers from r0 to r16.
+
+ `t'
+ r8--r11 or r22--r27 registers.
+
+ `h'
+ hi register.
+
+ `l'
+ lo register.
+
+ `x'
+ hi + lo register.
+
+ `q'
+ cnt register.
+
+ `y'
+ lcb register.
+
+ `z'
+ scb register.
+
+ `a'
+ cnt + lcb + scb register.
+
+ `c'
+ cr0--cr15 register.
+
+ `b'
+ cp1 registers.
+
+ `f'
+ cp2 registers.
+
+ `i'
+ cp3 registers.
+
+ `j'
+ cp1 + cp2 + cp3 registers.
+
+ `I'
+ High 16-bit constant (32-bit constant with 16 LSBs zero).
+
+ `J'
+ Unsigned 5 bit integer (in the range 0 to 31).
+
+ `K'
+ Unsigned 16 bit integer (in the range 0 to 65535).
+
+ `L'
+ Signed 16 bit integer (in the range -32768 to 32767).
+
+ `M'
+ Unsigned 14 bit integer (in the range 0 to 16383).
+
+ `N'
+ Signed 14 bit integer (in the range -8192 to 8191).
+
+ `Z'
+ Any SYMBOL_REF.
+
+_Xstormy16--`config/stormy16/stormy16.h'_
+
+ `a'
+ Register r0.
+
+ `b'
+ Register r1.
+
+ `c'
+ Register r2.
+
+ `d'
+ Register r8.
+
+ `e'
+ Registers r0 through r7.
+
+ `t'
+ Registers r0 and r1.
+
+ `y'
+ The carry register.
+
+ `z'
+ Registers r8 and r9.
+
+ `I'
+ A constant between 0 and 3 inclusive.
+
+ `J'
+ A constant that has exactly one bit set.
+
+ `K'
+ A constant that has exactly one bit clear.
+
+ `L'
+ A constant between 0 and 255 inclusive.
+
+ `M'
+ A constant between -255 and 0 inclusive.
+
+ `N'
+ A constant between -3 and 0 inclusive.
+
+ `O'
+ A constant between 1 and 4 inclusive.
+
+ `P'
+ A constant between -4 and -1 inclusive.
+
+ `Q'
+ A memory reference that is a stack push.
+
+ `R'
+ A memory reference that is a stack pop.
+
+ `S'
+ A memory reference that refers to a constant address of known
+ value.
+
+ `T'
+ The register indicated by Rx (not implemented yet).
+
+ `U'
+ A constant that is not between 2 and 15 inclusive.
+
+ `Z'
+ The constant 0.
+
+
+_Xtensa--`config/xtensa/constraints.md'_
+
+ `a'
+ General-purpose 32-bit register
+
+ `b'
+ One-bit boolean register
+
+ `A'
+ MAC16 40-bit accumulator register
+
+ `I'
+ Signed 12-bit integer constant, for use in MOVI instructions
+
+ `J'
+ Signed 8-bit integer constant, for use in ADDI instructions
+
+ `K'
+ Integer constant valid for BccI instructions
+
+ `L'
+ Unsigned constant valid for BccUI instructions
+
+
+
+
+File: gccint.info, Node: Disable Insn Alternatives, Next: Machine Constraints, Prev: Modifiers, Up: Constraints
+
+16.8.6 Disable insn alternatives using the `enabled' attribute
+--------------------------------------------------------------
+
+The `enabled' insn attribute may be used to disable certain insn
+alternatives for machine-specific reasons. This is useful when adding
+new instructions to an existing pattern which are only available for
+certain cpu architecture levels as specified with the `-march=' option.
+
+ If an insn alternative is disabled, then it will never be used. The
+compiler treats the constraints for the disabled alternative as
+unsatisfiable.
+
+ In order to make use of the `enabled' attribute a back end has to add
+in the machine description files:
+
+ 1. A definition of the `enabled' insn attribute. The attribute is
+ defined as usual using the `define_attr' command. This definition
+ should be based on other insn attributes and/or target flags. The
+ `enabled' attribute is a numeric attribute and should evaluate to
+ `(const_int 1)' for an enabled alternative and to `(const_int 0)'
+ otherwise.
+
+ 2. A definition of another insn attribute used to describe for what
+ reason an insn alternative might be available or not. E.g.
+ `cpu_facility' as in the example below.
+
+ 3. An assignment for the second attribute to each insn definition
+ combining instructions which are not all available under the same
+ circumstances. (Note: It obviously only makes sense for
+ definitions with more than one alternative. Otherwise the insn
+ pattern should be disabled or enabled using the insn condition.)
+
+ E.g. the following two patterns could easily be merged using the
+`enabled' attribute:
+
+
+ (define_insn "*movdi_old"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (match_operand:DI 1 "register_operand" " d"))]
+ "!TARGET_NEW"
+ "lgr %0,%1")
+
+ (define_insn "*movdi_new"
+ [(set (match_operand:DI 0 "register_operand" "=d,f,d")
+ (match_operand:DI 1 "register_operand" " d,d,f"))]
+ "TARGET_NEW"
+ "@
+ lgr %0,%1
+ ldgr %0,%1
+ lgdr %0,%1")
+
+ to:
+
+
+ (define_insn "*movdi_combined"
+ [(set (match_operand:DI 0 "register_operand" "=d,f,d")
+ (match_operand:DI 1 "register_operand" " d,d,f"))]
+ ""
+ "@
+ lgr %0,%1
+ ldgr %0,%1
+ lgdr %0,%1"
+ [(set_attr "cpu_facility" "*,new,new")])
+
+ with the `enabled' attribute defined like this:
+
+
+ (define_attr "cpu_facility" "standard,new" (const_string "standard"))
+
+ (define_attr "enabled" ""
+ (cond [(eq_attr "cpu_facility" "standard") (const_int 1)
+ (and (eq_attr "cpu_facility" "new")
+ (ne (symbol_ref "TARGET_NEW") (const_int 0)))
+ (const_int 1)]
+ (const_int 0)))
+
+
+File: gccint.info, Node: Define Constraints, Next: C Constraint Interface, Prev: Machine Constraints, Up: Constraints
+
+16.8.7 Defining Machine-Specific Constraints
+--------------------------------------------
+
+Machine-specific constraints fall into two categories: register and
+non-register constraints. Within the latter category, constraints
+which allow subsets of all possible memory or address operands should
+be specially marked, to give `reload' more information.
+
+ Machine-specific constraints can be given names of arbitrary length,
+but they must be entirely composed of letters, digits, underscores
+(`_'), and angle brackets (`< >'). Like C identifiers, they must begin
+with a letter or underscore.
+
+ In order to avoid ambiguity in operand constraint strings, no
+constraint can have a name that begins with any other constraint's
+name. For example, if `x' is defined as a constraint name, `xy' may
+not be, and vice versa. As a consequence of this rule, no constraint
+may begin with one of the generic constraint letters: `E F V X g i m n
+o p r s'.
+
+ Register constraints correspond directly to register classes. *Note
+Register Classes::. There is thus not much flexibility in their
+definitions.
+
+ -- MD Expression: define_register_constraint name regclass docstring
+ All three arguments are string constants. NAME is the name of the
+ constraint, as it will appear in `match_operand' expressions. If
+ NAME is a multi-letter constraint its length shall be the same for
+ all constraints starting with the same letter. REGCLASS can be
+ either the name of the corresponding register class (*note
+ Register Classes::), or a C expression which evaluates to the
+ appropriate register class. If it is an expression, it must have
+ no side effects, and it cannot look at the operand. The usual use
+ of expressions is to map some register constraints to `NO_REGS'
+ when the register class is not available on a given
+ subarchitecture.
+
+ DOCSTRING is a sentence documenting the meaning of the constraint.
+ Docstrings are explained further below.
+
+ Non-register constraints are more like predicates: the constraint
+definition gives a Boolean expression which indicates whether the
+constraint matches.
+
+ -- MD Expression: define_constraint name docstring exp
+ The NAME and DOCSTRING arguments are the same as for
+ `define_register_constraint', but note that the docstring comes
+ immediately after the name for these expressions. EXP is an RTL
+ expression, obeying the same rules as the RTL expressions in
+ predicate definitions. *Note Defining Predicates::, for details.
+ If it evaluates true, the constraint matches; if it evaluates
+ false, it doesn't. Constraint expressions should indicate which
+ RTL codes they might match, just like predicate expressions.
+
+ `match_test' C expressions have access to the following variables:
+
+ OP
+ The RTL object defining the operand.
+
+ MODE
+ The machine mode of OP.
+
+ IVAL
+ `INTVAL (OP)', if OP is a `const_int'.
+
+ HVAL
+ `CONST_DOUBLE_HIGH (OP)', if OP is an integer `const_double'.
+
+ LVAL
+ `CONST_DOUBLE_LOW (OP)', if OP is an integer `const_double'.
+
+ RVAL
+ `CONST_DOUBLE_REAL_VALUE (OP)', if OP is a floating-point
+ `const_double'.
+
+ The *VAL variables should only be used once another piece of the
+ expression has verified that OP is the appropriate kind of RTL
+ object.
+
+ Most non-register constraints should be defined with
+`define_constraint'. The remaining two definition expressions are only
+appropriate for constraints that should be handled specially by
+`reload' if they fail to match.
+
+ -- MD Expression: define_memory_constraint name docstring exp
+ Use this expression for constraints that match a subset of all
+ memory operands: that is, `reload' can make them match by
+ converting the operand to the form `(mem (reg X))', where X is a
+ base register (from the register class specified by
+ `BASE_REG_CLASS', *note Register Classes::).
+
+ For example, on the S/390, some instructions do not accept
+ arbitrary memory references, but only those that do not make use
+ of an index register. The constraint letter `Q' is defined to
+ represent a memory address of this type. If `Q' is defined with
+ `define_memory_constraint', a `Q' constraint can handle any memory
+ operand, because `reload' knows it can simply copy the memory
+ address into a base register if required. This is analogous to
+ the way a `o' constraint can handle any memory operand.
+
+ The syntax and semantics are otherwise identical to
+ `define_constraint'.
+
+ -- MD Expression: define_address_constraint name docstring exp
+ Use this expression for constraints that match a subset of all
+ address operands: that is, `reload' can make the constraint match
+ by converting the operand to the form `(reg X)', again with X a
+ base register.
+
+ Constraints defined with `define_address_constraint' can only be
+ used with the `address_operand' predicate, or machine-specific
+ predicates that work the same way. They are treated analogously to
+ the generic `p' constraint.
+
+ The syntax and semantics are otherwise identical to
+ `define_constraint'.
+
+ For historical reasons, names beginning with the letters `G H' are
+reserved for constraints that match only `const_double's, and names
+beginning with the letters `I J K L M N O P' are reserved for
+constraints that match only `const_int's. This may change in the
+future. For the time being, constraints with these names must be
+written in a stylized form, so that `genpreds' can tell you did it
+correctly:
+
+ (define_constraint "[GHIJKLMNOP]..."
+ "DOC..."
+ (and (match_code "const_int") ; `const_double' for G/H
+ CONDITION...)) ; usually a `match_test'
+
+ It is fine to use names beginning with other letters for constraints
+that match `const_double's or `const_int's.
+
+ Each docstring in a constraint definition should be one or more
+complete sentences, marked up in Texinfo format. _They are currently
+unused._ In the future they will be copied into the GCC manual, in
+*Note Machine Constraints::, replacing the hand-maintained tables
+currently found in that section. Also, in the future the compiler may
+use this to give more helpful diagnostics when poor choice of `asm'
+constraints causes a reload failure.
+
+ If you put the pseudo-Texinfo directive `@internal' at the beginning
+of a docstring, then (in the future) it will appear only in the
+internals manual's version of the machine-specific constraint tables.
+Use this for constraints that should not appear in `asm' statements.
+
+
+File: gccint.info, Node: C Constraint Interface, Prev: Define Constraints, Up: Constraints
+
+16.8.8 Testing constraints from C
+---------------------------------
+
+It is occasionally useful to test a constraint from C code rather than
+implicitly via the constraint string in a `match_operand'. The
+generated file `tm_p.h' declares a few interfaces for working with
+machine-specific constraints. None of these interfaces work with the
+generic constraints described in *Note Simple Constraints::. This may
+change in the future.
+
+ *Warning:* `tm_p.h' may declare other functions that operate on
+constraints, besides the ones documented here. Do not use those
+functions from machine-dependent code. They exist to implement the old
+constraint interface that machine-independent components of the
+compiler still expect. They will change or disappear in the future.
+
+ Some valid constraint names are not valid C identifiers, so there is a
+mangling scheme for referring to them from C. Constraint names that do
+not contain angle brackets or underscores are left unchanged.
+Underscores are doubled, each `<' is replaced with `_l', and each `>'
+with `_g'. Here are some examples:
+
+ *Original* *Mangled*
+ `x' `x'
+ `P42x' `P42x'
+ `P4_x' `P4__x'
+ `P4>x' `P4_gx'
+ `P4>>' `P4_g_g'
+ `P4_g>' `P4__g_g'
+
+ Throughout this section, the variable C is either a constraint in the
+abstract sense, or a constant from `enum constraint_num'; the variable
+M is a mangled constraint name (usually as part of a larger identifier).
+
+ -- Enum: constraint_num
+ For each machine-specific constraint, there is a corresponding
+ enumeration constant: `CONSTRAINT_' plus the mangled name of the
+ constraint. Functions that take an `enum constraint_num' as an
+ argument expect one of these constants.
+
+ Machine-independent constraints do not have associated constants.
+ This may change in the future.
+
+ -- Function: inline bool satisfies_constraint_M (rtx EXP)
+ For each machine-specific, non-register constraint M, there is one
+ of these functions; it returns `true' if EXP satisfies the
+ constraint. These functions are only visible if `rtl.h' was
+ included before `tm_p.h'.
+
+ -- Function: bool constraint_satisfied_p (rtx EXP, enum constraint_num
+ C)
+ Like the `satisfies_constraint_M' functions, but the constraint to
+ test is given as an argument, C. If C specifies a register
+ constraint, this function will always return `false'.
+
+ -- Function: enum reg_class regclass_for_constraint (enum
+ constraint_num C)
+ Returns the register class associated with C. If C is not a
+ register constraint, or those registers are not available for the
+ currently selected subtarget, returns `NO_REGS'.
+
+ Here is an example use of `satisfies_constraint_M'. In peephole
+optimizations (*note Peephole Definitions::), operand constraint
+strings are ignored, so if there are relevant constraints, they must be
+tested in the C condition. In the example, the optimization is applied
+if operand 2 does _not_ satisfy the `K' constraint. (This is a
+simplified version of a peephole definition from the i386 machine
+description.)
+
+ (define_peephole2
+ [(match_scratch:SI 3 "r")
+ (set (match_operand:SI 0 "register_operand" "")
+ (mult:SI (match_operand:SI 1 "memory_operand" "")
+ (match_operand:SI 2 "immediate_operand" "")))]
+
+ "!satisfies_constraint_K (operands[2])"
+
+ [(set (match_dup 3) (match_dup 1))
+ (set (match_dup 0) (mult:SI (match_dup 3) (match_dup 2)))]
+
+ "")
+
+
+File: gccint.info, Node: Standard Names, Next: Pattern Ordering, Prev: Constraints, Up: Machine Desc
+
+16.9 Standard Pattern Names For Generation
+==========================================
+
+Here is a table of the instruction names that are meaningful in the RTL
+generation pass of the compiler. Giving one of these names to an
+instruction pattern tells the RTL generation pass that it can use the
+pattern to accomplish a certain task.
+
+`movM'
+ Here M stands for a two-letter machine mode name, in lowercase.
+ This instruction pattern moves data with that machine mode from
+ operand 1 to operand 0. For example, `movsi' moves full-word data.
+
+ If operand 0 is a `subreg' with mode M of a register whose own
+ mode is wider than M, the effect of this instruction is to store
+ the specified value in the part of the register that corresponds
+ to mode M. Bits outside of M, but which are within the same
+ target word as the `subreg' are undefined. Bits which are outside
+ the target word are left unchanged.
+
+ This class of patterns is special in several ways. First of all,
+ each of these names up to and including full word size _must_ be
+ defined, because there is no other way to copy a datum from one
+ place to another. If there are patterns accepting operands in
+ larger modes, `movM' must be defined for integer modes of those
+ sizes.
+
+ Second, these patterns are not used solely in the RTL generation
+ pass. Even the reload pass can generate move insns to copy values
+ from stack slots into temporary registers. When it does so, one
+ of the operands is a hard register and the other is an operand
+ that can need to be reloaded into a register.
+
+ Therefore, when given such a pair of operands, the pattern must
+ generate RTL which needs no reloading and needs no temporary
+ registers--no registers other than the operands. For example, if
+ you support the pattern with a `define_expand', then in such a
+ case the `define_expand' mustn't call `force_reg' or any other such
+ function which might generate new pseudo registers.
+
+ This requirement exists even for subword modes on a RISC machine
+ where fetching those modes from memory normally requires several
+ insns and some temporary registers.
+
+ During reload a memory reference with an invalid address may be
+ passed as an operand. Such an address will be replaced with a
+ valid address later in the reload pass. In this case, nothing may
+ be done with the address except to use it as it stands. If it is
+ copied, it will not be replaced with a valid address. No attempt
+ should be made to make such an address into a valid address and no
+ routine (such as `change_address') that will do so may be called.
+ Note that `general_operand' will fail when applied to such an
+ address.
+
+ The global variable `reload_in_progress' (which must be explicitly
+ declared if required) can be used to determine whether such special
+ handling is required.
+
+ The variety of operands that have reloads depends on the rest of
+ the machine description, but typically on a RISC machine these can
+ only be pseudo registers that did not get hard registers, while on
+ other machines explicit memory references will get optional
+ reloads.
+
+ If a scratch register is required to move an object to or from
+ memory, it can be allocated using `gen_reg_rtx' prior to life
+ analysis.
+
+ If there are cases which need scratch registers during or after
+ reload, you must provide an appropriate secondary_reload target
+ hook.
+
+ The macro `can_create_pseudo_p' can be used to determine if it is
+ unsafe to create new pseudo registers. If this variable is
+ nonzero, then it is unsafe to call `gen_reg_rtx' to allocate a new
+ pseudo.
+
+ The constraints on a `movM' must permit moving any hard register
+ to any other hard register provided that `HARD_REGNO_MODE_OK'
+ permits mode M in both registers and `REGISTER_MOVE_COST' applied
+ to their classes returns a value of 2.
+
+ It is obligatory to support floating point `movM' instructions
+ into and out of any registers that can hold fixed point values,
+ because unions and structures (which have modes `SImode' or
+ `DImode') can be in those registers and they may have floating
+ point members.
+
+ There may also be a need to support fixed point `movM'
+ instructions in and out of floating point registers.
+ Unfortunately, I have forgotten why this was so, and I don't know
+ whether it is still true. If `HARD_REGNO_MODE_OK' rejects fixed
+ point values in floating point registers, then the constraints of
+ the fixed point `movM' instructions must be designed to avoid ever
+ trying to reload into a floating point register.
+
+`reload_inM'
+`reload_outM'
+ These named patterns have been obsoleted by the target hook
+ `secondary_reload'.
+
+ Like `movM', but used when a scratch register is required to move
+ between operand 0 and operand 1. Operand 2 describes the scratch
+ register. See the discussion of the `SECONDARY_RELOAD_CLASS'
+ macro in *note Register Classes::.
+
+ There are special restrictions on the form of the `match_operand's
+ used in these patterns. First, only the predicate for the reload
+ operand is examined, i.e., `reload_in' examines operand 1, but not
+ the predicates for operand 0 or 2. Second, there may be only one
+ alternative in the constraints. Third, only a single register
+ class letter may be used for the constraint; subsequent constraint
+ letters are ignored. As a special exception, an empty constraint
+ string matches the `ALL_REGS' register class. This may relieve
+ ports of the burden of defining an `ALL_REGS' constraint letter
+ just for these patterns.
+
+`movstrictM'
+ Like `movM' except that if operand 0 is a `subreg' with mode M of
+ a register whose natural mode is wider, the `movstrictM'
+ instruction is guaranteed not to alter any of the register except
+ the part which belongs to mode M.
+
+`movmisalignM'
+ This variant of a move pattern is designed to load or store a value
+ from a memory address that is not naturally aligned for its mode.
+ For a store, the memory will be in operand 0; for a load, the
+ memory will be in operand 1. The other operand is guaranteed not
+ to be a memory, so that it's easy to tell whether this is a load
+ or store.
+
+ This pattern is used by the autovectorizer, and when expanding a
+ `MISALIGNED_INDIRECT_REF' expression.
+
+`load_multiple'
+ Load several consecutive memory locations into consecutive
+ registers. Operand 0 is the first of the consecutive registers,
+ operand 1 is the first memory location, and operand 2 is a
+ constant: the number of consecutive registers.
+
+ Define this only if the target machine really has such an
+ instruction; do not define this if the most efficient way of
+ loading consecutive registers from memory is to do them one at a
+ time.
+
+ On some machines, there are restrictions as to which consecutive
+ registers can be stored into memory, such as particular starting or
+ ending register numbers or only a range of valid counts. For those
+ machines, use a `define_expand' (*note Expander Definitions::) and
+ make the pattern fail if the restrictions are not met.
+
+ Write the generated insn as a `parallel' with elements being a
+ `set' of one register from the appropriate memory location (you may
+ also need `use' or `clobber' elements). Use a `match_parallel'
+ (*note RTL Template::) to recognize the insn. See `rs6000.md' for
+ examples of the use of this insn pattern.
+
+`store_multiple'
+ Similar to `load_multiple', but store several consecutive registers
+ into consecutive memory locations. Operand 0 is the first of the
+ consecutive memory locations, operand 1 is the first register, and
+ operand 2 is a constant: the number of consecutive registers.
+
+`vec_setM'
+ Set given field in the vector value. Operand 0 is the vector to
+ modify, operand 1 is new value of field and operand 2 specify the
+ field index.
+
+`vec_extractM'
+ Extract given field from the vector value. Operand 1 is the
+ vector, operand 2 specify field index and operand 0 place to store
+ value into.
+
+`vec_extract_evenM'
+ Extract even elements from the input vectors (operand 1 and
+ operand 2). The even elements of operand 2 are concatenated to
+ the even elements of operand 1 in their original order. The result
+ is stored in operand 0. The output and input vectors should have
+ the same modes.
+
+`vec_extract_oddM'
+ Extract odd elements from the input vectors (operand 1 and operand
+ 2). The odd elements of operand 2 are concatenated to the odd
+ elements of operand 1 in their original order. The result is
+ stored in operand 0. The output and input vectors should have the
+ same modes.
+
+`vec_interleave_highM'
+ Merge high elements of the two input vectors into the output
+ vector. The output and input vectors should have the same modes
+ (`N' elements). The high `N/2' elements of the first input vector
+ are interleaved with the high `N/2' elements of the second input
+ vector.
+
+`vec_interleave_lowM'
+ Merge low elements of the two input vectors into the output
+ vector. The output and input vectors should have the same modes
+ (`N' elements). The low `N/2' elements of the first input vector
+ are interleaved with the low `N/2' elements of the second input
+ vector.
+
+`vec_initM'
+ Initialize the vector to given values. Operand 0 is the vector to
+ initialize and operand 1 is parallel containing values for
+ individual fields.
+
+`pushM1'
+ Output a push instruction. Operand 0 is value to push. Used only
+ when `PUSH_ROUNDING' is defined. For historical reason, this
+ pattern may be missing and in such case an `mov' expander is used
+ instead, with a `MEM' expression forming the push operation. The
+ `mov' expander method is deprecated.
+
+`addM3'
+ Add operand 2 and operand 1, storing the result in operand 0. All
+ operands must have mode M. This can be used even on two-address
+ machines, by means of constraints requiring operands 1 and 0 to be
+ the same location.
+
+`ssaddM3', `usaddM3'
+
+`subM3', `sssubM3', `ussubM3'
+
+`mulM3', `ssmulM3', `usmulM3'
+`divM3', `ssdivM3'
+`udivM3', `usdivM3'
+`modM3', `umodM3'
+`uminM3', `umaxM3'
+`andM3', `iorM3', `xorM3'
+ Similar, for other arithmetic operations.
+
+`sminM3', `smaxM3'
+ Signed minimum and maximum operations. When used with floating
+ point, if both operands are zeros, or if either operand is `NaN',
+ then it is unspecified which of the two operands is returned as
+ the result.
+
+`reduc_smin_M', `reduc_smax_M'
+ Find the signed minimum/maximum of the elements of a vector. The
+ vector is operand 1, and the scalar result is stored in the least
+ significant bits of operand 0 (also a vector). The output and
+ input vector should have the same modes.
+
+`reduc_umin_M', `reduc_umax_M'
+ Find the unsigned minimum/maximum of the elements of a vector. The
+ vector is operand 1, and the scalar result is stored in the least
+ significant bits of operand 0 (also a vector). The output and
+ input vector should have the same modes.
+
+`reduc_splus_M'
+ Compute the sum of the signed elements of a vector. The vector is
+ operand 1, and the scalar result is stored in the least
+ significant bits of operand 0 (also a vector). The output and
+ input vector should have the same modes.
+
+`reduc_uplus_M'
+ Compute the sum of the unsigned elements of a vector. The vector
+ is operand 1, and the scalar result is stored in the least
+ significant bits of operand 0 (also a vector). The output and
+ input vector should have the same modes.
+
+`sdot_prodM'
+
+`udot_prodM'
+ Compute the sum of the products of two signed/unsigned elements.
+ Operand 1 and operand 2 are of the same mode. Their product, which
+ is of a wider mode, is computed and added to operand 3. Operand 3
+ is of a mode equal or wider than the mode of the product. The
+ result is placed in operand 0, which is of the same mode as
+ operand 3.
+
+`ssum_widenM3'
+
+`usum_widenM3'
+ Operands 0 and 2 are of the same mode, which is wider than the
+ mode of operand 1. Add operand 1 to operand 2 and place the
+ widened result in operand 0. (This is used express accumulation of
+ elements into an accumulator of a wider mode.)
+
+`vec_shl_M', `vec_shr_M'
+ Whole vector left/right shift in bits. Operand 1 is a vector to
+ be shifted. Operand 2 is an integer shift amount in bits.
+ Operand 0 is where the resulting shifted vector is stored. The
+ output and input vectors should have the same modes.
+
+`vec_pack_trunc_M'
+ Narrow (demote) and merge the elements of two vectors. Operands 1
+ and 2 are vectors of the same mode having N integral or floating
+ point elements of size S. Operand 0 is the resulting vector in
+ which 2*N elements of size N/2 are concatenated after narrowing
+ them down using truncation.
+
+`vec_pack_ssat_M', `vec_pack_usat_M'
+ Narrow (demote) and merge the elements of two vectors. Operands 1
+ and 2 are vectors of the same mode having N integral elements of
+ size S. Operand 0 is the resulting vector in which the elements
+ of the two input vectors are concatenated after narrowing them
+ down using signed/unsigned saturating arithmetic.
+
+`vec_pack_sfix_trunc_M', `vec_pack_ufix_trunc_M'
+ Narrow, convert to signed/unsigned integral type and merge the
+ elements of two vectors. Operands 1 and 2 are vectors of the same
+ mode having N floating point elements of size S. Operand 0 is the
+ resulting vector in which 2*N elements of size N/2 are
+ concatenated.
+
+`vec_unpacks_hi_M', `vec_unpacks_lo_M'
+ Extract and widen (promote) the high/low part of a vector of signed
+ integral or floating point elements. The input vector (operand 1)
+ has N elements of size S. Widen (promote) the high/low elements
+ of the vector using signed or floating point extension and place
+ the resulting N/2 values of size 2*S in the output vector (operand
+ 0).
+
+`vec_unpacku_hi_M', `vec_unpacku_lo_M'
+ Extract and widen (promote) the high/low part of a vector of
+ unsigned integral elements. The input vector (operand 1) has N
+ elements of size S. Widen (promote) the high/low elements of the
+ vector using zero extension and place the resulting N/2 values of
+ size 2*S in the output vector (operand 0).
+
+`vec_unpacks_float_hi_M', `vec_unpacks_float_lo_M'
+`vec_unpacku_float_hi_M', `vec_unpacku_float_lo_M'
+ Extract, convert to floating point type and widen the high/low
+ part of a vector of signed/unsigned integral elements. The input
+ vector (operand 1) has N elements of size S. Convert the high/low
+ elements of the vector using floating point conversion and place
+ the resulting N/2 values of size 2*S in the output vector (operand
+ 0).
+
+`vec_widen_umult_hi_M', `vec_widen_umult_lo_M'
+`vec_widen_smult_hi_M', `vec_widen_smult_lo_M'
+ Signed/Unsigned widening multiplication. The two inputs (operands
+ 1 and 2) are vectors with N signed/unsigned elements of size S.
+ Multiply the high/low elements of the two vectors, and put the N/2
+ products of size 2*S in the output vector (operand 0).
+
+`mulhisi3'
+ Multiply operands 1 and 2, which have mode `HImode', and store a
+ `SImode' product in operand 0.
+
+`mulqihi3', `mulsidi3'
+ Similar widening-multiplication instructions of other widths.
+
+`umulqihi3', `umulhisi3', `umulsidi3'
+ Similar widening-multiplication instructions that do unsigned
+ multiplication.
+
+`usmulqihi3', `usmulhisi3', `usmulsidi3'
+ Similar widening-multiplication instructions that interpret the
+ first operand as unsigned and the second operand as signed, then
+ do a signed multiplication.
+
+`smulM3_highpart'
+ Perform a signed multiplication of operands 1 and 2, which have
+ mode M, and store the most significant half of the product in
+ operand 0. The least significant half of the product is discarded.
+
+`umulM3_highpart'
+ Similar, but the multiplication is unsigned.
+
+`maddMN4'
+ Multiply operands 1 and 2, sign-extend them to mode N, add operand
+ 3, and store the result in operand 0. Operands 1 and 2 have mode
+ M and operands 0 and 3 have mode N. Both modes must be integer or
+ fixed-point modes and N must be twice the size of M.
+
+ In other words, `maddMN4' is like `mulMN3' except that it also
+ adds operand 3.
+
+ These instructions are not allowed to `FAIL'.
+
+`umaddMN4'
+ Like `maddMN4', but zero-extend the multiplication operands
+ instead of sign-extending them.
+
+`ssmaddMN4'
+ Like `maddMN4', but all involved operations must be
+ signed-saturating.
+
+`usmaddMN4'
+ Like `umaddMN4', but all involved operations must be
+ unsigned-saturating.
+
+`msubMN4'
+ Multiply operands 1 and 2, sign-extend them to mode N, subtract the
+ result from operand 3, and store the result in operand 0.
+ Operands 1 and 2 have mode M and operands 0 and 3 have mode N.
+ Both modes must be integer or fixed-point modes and N must be twice
+ the size of M.
+
+ In other words, `msubMN4' is like `mulMN3' except that it also
+ subtracts the result from operand 3.
+
+ These instructions are not allowed to `FAIL'.
+
+`umsubMN4'
+ Like `msubMN4', but zero-extend the multiplication operands
+ instead of sign-extending them.
+
+`ssmsubMN4'
+ Like `msubMN4', but all involved operations must be
+ signed-saturating.
+
+`usmsubMN4'
+ Like `umsubMN4', but all involved operations must be
+ unsigned-saturating.
+
+`divmodM4'
+ Signed division that produces both a quotient and a remainder.
+ Operand 1 is divided by operand 2 to produce a quotient stored in
+ operand 0 and a remainder stored in operand 3.
+
+ For machines with an instruction that produces both a quotient and
+ a remainder, provide a pattern for `divmodM4' but do not provide
+ patterns for `divM3' and `modM3'. This allows optimization in the
+ relatively common case when both the quotient and remainder are
+ computed.
+
+ If an instruction that just produces a quotient or just a remainder
+ exists and is more efficient than the instruction that produces
+ both, write the output routine of `divmodM4' to call
+ `find_reg_note' and look for a `REG_UNUSED' note on the quotient
+ or remainder and generate the appropriate instruction.
+
+`udivmodM4'
+ Similar, but does unsigned division.
+
+`ashlM3', `ssashlM3', `usashlM3'
+ Arithmetic-shift operand 1 left by a number of bits specified by
+ operand 2, and store the result in operand 0. Here M is the mode
+ of operand 0 and operand 1; operand 2's mode is specified by the
+ instruction pattern, and the compiler will convert the operand to
+ that mode before generating the instruction. The meaning of
+ out-of-range shift counts can optionally be specified by
+ `TARGET_SHIFT_TRUNCATION_MASK'. *Note
+ TARGET_SHIFT_TRUNCATION_MASK::. Operand 2 is always a scalar type.
+
+`ashrM3', `lshrM3', `rotlM3', `rotrM3'
+ Other shift and rotate instructions, analogous to the `ashlM3'
+ instructions. Operand 2 is always a scalar type.
+
+`vashlM3', `vashrM3', `vlshrM3', `vrotlM3', `vrotrM3'
+ Vector shift and rotate instructions that take vectors as operand 2
+ instead of a scalar type.
+
+`negM2', `ssnegM2', `usnegM2'
+ Negate operand 1 and store the result in operand 0.
+
+`absM2'
+ Store the absolute value of operand 1 into operand 0.
+
+`sqrtM2'
+ Store the square root of operand 1 into operand 0.
+
+ The `sqrt' built-in function of C always uses the mode which
+ corresponds to the C data type `double' and the `sqrtf' built-in
+ function uses the mode which corresponds to the C data type
+ `float'.
+
+`fmodM3'
+ Store the remainder of dividing operand 1 by operand 2 into
+ operand 0, rounded towards zero to an integer.
+
+ The `fmod' built-in function of C always uses the mode which
+ corresponds to the C data type `double' and the `fmodf' built-in
+ function uses the mode which corresponds to the C data type
+ `float'.
+
+`remainderM3'
+ Store the remainder of dividing operand 1 by operand 2 into
+ operand 0, rounded to the nearest integer.
+
+ The `remainder' built-in function of C always uses the mode which
+ corresponds to the C data type `double' and the `remainderf'
+ built-in function uses the mode which corresponds to the C data
+ type `float'.
+
+`cosM2'
+ Store the cosine of operand 1 into operand 0.
+
+ The `cos' built-in function of C always uses the mode which
+ corresponds to the C data type `double' and the `cosf' built-in
+ function uses the mode which corresponds to the C data type
+ `float'.
+
+`sinM2'
+ Store the sine of operand 1 into operand 0.
+
+ The `sin' built-in function of C always uses the mode which
+ corresponds to the C data type `double' and the `sinf' built-in
+ function uses the mode which corresponds to the C data type
+ `float'.
+
+`expM2'
+ Store the exponential of operand 1 into operand 0.
+
+ The `exp' built-in function of C always uses the mode which
+ corresponds to the C data type `double' and the `expf' built-in
+ function uses the mode which corresponds to the C data type
+ `float'.
+
+`logM2'
+ Store the natural logarithm of operand 1 into operand 0.
+
+ The `log' built-in function of C always uses the mode which
+ corresponds to the C data type `double' and the `logf' built-in
+ function uses the mode which corresponds to the C data type
+ `float'.
+
+`powM3'
+ Store the value of operand 1 raised to the exponent operand 2 into
+ operand 0.
+
+ The `pow' built-in function of C always uses the mode which
+ corresponds to the C data type `double' and the `powf' built-in
+ function uses the mode which corresponds to the C data type
+ `float'.
+
+`atan2M3'
+ Store the arc tangent (inverse tangent) of operand 1 divided by
+ operand 2 into operand 0, using the signs of both arguments to
+ determine the quadrant of the result.
+
+ The `atan2' built-in function of C always uses the mode which
+ corresponds to the C data type `double' and the `atan2f' built-in
+ function uses the mode which corresponds to the C data type
+ `float'.
+
+`floorM2'
+ Store the largest integral value not greater than argument.
+
+ The `floor' built-in function of C always uses the mode which
+ corresponds to the C data type `double' and the `floorf' built-in
+ function uses the mode which corresponds to the C data type
+ `float'.
+
+`btruncM2'
+ Store the argument rounded to integer towards zero.
+
+ The `trunc' built-in function of C always uses the mode which
+ corresponds to the C data type `double' and the `truncf' built-in
+ function uses the mode which corresponds to the C data type
+ `float'.
+
+`roundM2'
+ Store the argument rounded to integer away from zero.
+
+ The `round' built-in function of C always uses the mode which
+ corresponds to the C data type `double' and the `roundf' built-in
+ function uses the mode which corresponds to the C data type
+ `float'.
+
+`ceilM2'
+ Store the argument rounded to integer away from zero.
+
+ The `ceil' built-in function of C always uses the mode which
+ corresponds to the C data type `double' and the `ceilf' built-in
+ function uses the mode which corresponds to the C data type
+ `float'.
+
+`nearbyintM2'
+ Store the argument rounded according to the default rounding mode
+
+ The `nearbyint' built-in function of C always uses the mode which
+ corresponds to the C data type `double' and the `nearbyintf'
+ built-in function uses the mode which corresponds to the C data
+ type `float'.
+
+`rintM2'
+ Store the argument rounded according to the default rounding mode
+ and raise the inexact exception when the result differs in value
+ from the argument
+
+ The `rint' built-in function of C always uses the mode which
+ corresponds to the C data type `double' and the `rintf' built-in
+ function uses the mode which corresponds to the C data type
+ `float'.
+
+`lrintMN2'
+ Convert operand 1 (valid for floating point mode M) to fixed point
+ mode N as a signed number according to the current rounding mode
+ and store in operand 0 (which has mode N).
+
+`lroundM2'
+ Convert operand 1 (valid for floating point mode M) to fixed point
+ mode N as a signed number rounding to nearest and away from zero
+ and store in operand 0 (which has mode N).
+
+`lfloorM2'
+ Convert operand 1 (valid for floating point mode M) to fixed point
+ mode N as a signed number rounding down and store in operand 0
+ (which has mode N).
+
+`lceilM2'
+ Convert operand 1 (valid for floating point mode M) to fixed point
+ mode N as a signed number rounding up and store in operand 0
+ (which has mode N).
+
+`copysignM3'
+ Store a value with the magnitude of operand 1 and the sign of
+ operand 2 into operand 0.
+
+ The `copysign' built-in function of C always uses the mode which
+ corresponds to the C data type `double' and the `copysignf'
+ built-in function uses the mode which corresponds to the C data
+ type `float'.
+
+`ffsM2'
+ Store into operand 0 one plus the index of the least significant
+ 1-bit of operand 1. If operand 1 is zero, store zero. M is the
+ mode of operand 0; operand 1's mode is specified by the instruction
+ pattern, and the compiler will convert the operand to that mode
+ before generating the instruction.
+
+ The `ffs' built-in function of C always uses the mode which
+ corresponds to the C data type `int'.
+
+`clzM2'
+ Store into operand 0 the number of leading 0-bits in X, starting
+ at the most significant bit position. If X is 0, the
+ `CLZ_DEFINED_VALUE_AT_ZERO' (*note Misc::) macro defines if the
+ result is undefined or has a useful value. M is the mode of
+ operand 0; operand 1's mode is specified by the instruction
+ pattern, and the compiler will convert the operand to that mode
+ before generating the instruction.
+
+`ctzM2'
+ Store into operand 0 the number of trailing 0-bits in X, starting
+ at the least significant bit position. If X is 0, the
+ `CTZ_DEFINED_VALUE_AT_ZERO' (*note Misc::) macro defines if the
+ result is undefined or has a useful value. M is the mode of
+ operand 0; operand 1's mode is specified by the instruction
+ pattern, and the compiler will convert the operand to that mode
+ before generating the instruction.
+
+`popcountM2'
+ Store into operand 0 the number of 1-bits in X. M is the mode of
+ operand 0; operand 1's mode is specified by the instruction
+ pattern, and the compiler will convert the operand to that mode
+ before generating the instruction.
+
+`parityM2'
+ Store into operand 0 the parity of X, i.e. the number of 1-bits in
+ X modulo 2. M is the mode of operand 0; operand 1's mode is
+ specified by the instruction pattern, and the compiler will convert
+ the operand to that mode before generating the instruction.
+
+`one_cmplM2'
+ Store the bitwise-complement of operand 1 into operand 0.
+
+`cmpM'
+ Compare operand 0 and operand 1, and set the condition codes. The
+ RTL pattern should look like this:
+
+ (set (cc0) (compare (match_operand:M 0 ...)
+ (match_operand:M 1 ...)))
+
+`tstM'
+ Compare operand 0 against zero, and set the condition codes. The
+ RTL pattern should look like this:
+
+ (set (cc0) (match_operand:M 0 ...))
+
+ `tstM' patterns should not be defined for machines that do not use
+ `(cc0)'. Doing so would confuse the optimizer since it would no
+ longer be clear which `set' operations were comparisons. The
+ `cmpM' patterns should be used instead.
+
+`movmemM'
+ Block move instruction. The destination and source blocks of
+ memory are the first two operands, and both are `mem:BLK's with an
+ address in mode `Pmode'.
+
+ The number of bytes to move is the third operand, in mode M.
+ Usually, you specify `word_mode' for M. However, if you can
+ generate better code knowing the range of valid lengths is smaller
+ than those representable in a full word, you should provide a
+ pattern with a mode corresponding to the range of values you can
+ handle efficiently (e.g., `QImode' for values in the range 0-127;
+ note we avoid numbers that appear negative) and also a pattern
+ with `word_mode'.
+
+ The fourth operand is the known shared alignment of the source and
+ destination, in the form of a `const_int' rtx. Thus, if the
+ compiler knows that both source and destination are word-aligned,
+ it may provide the value 4 for this operand.
+
+ Optional operands 5 and 6 specify expected alignment and size of
+ block respectively. The expected alignment differs from alignment
+ in operand 4 in a way that the blocks are not required to be
+ aligned according to it in all cases. This expected alignment is
+ also in bytes, just like operand 4. Expected size, when unknown,
+ is set to `(const_int -1)'.
+
+ Descriptions of multiple `movmemM' patterns can only be beneficial
+ if the patterns for smaller modes have fewer restrictions on their
+ first, second and fourth operands. Note that the mode M in
+ `movmemM' does not impose any restriction on the mode of
+ individually moved data units in the block.
+
+ These patterns need not give special consideration to the
+ possibility that the source and destination strings might overlap.
+
+`movstr'
+ String copy instruction, with `stpcpy' semantics. Operand 0 is an
+ output operand in mode `Pmode'. The addresses of the destination
+ and source strings are operands 1 and 2, and both are `mem:BLK's
+ with addresses in mode `Pmode'. The execution of the expansion of
+ this pattern should store in operand 0 the address in which the
+ `NUL' terminator was stored in the destination string.
+
+`setmemM'
+ Block set instruction. The destination string is the first
+ operand, given as a `mem:BLK' whose address is in mode `Pmode'.
+ The number of bytes to set is the second operand, in mode M. The
+ value to initialize the memory with is the third operand. Targets
+ that only support the clearing of memory should reject any value
+ that is not the constant 0. See `movmemM' for a discussion of the
+ choice of mode.
+
+ The fourth operand is the known alignment of the destination, in
+ the form of a `const_int' rtx. Thus, if the compiler knows that
+ the destination is word-aligned, it may provide the value 4 for
+ this operand.
+
+ Optional operands 5 and 6 specify expected alignment and size of
+ block respectively. The expected alignment differs from alignment
+ in operand 4 in a way that the blocks are not required to be
+ aligned according to it in all cases. This expected alignment is
+ also in bytes, just like operand 4. Expected size, when unknown,
+ is set to `(const_int -1)'.
+
+ The use for multiple `setmemM' is as for `movmemM'.
+
+`cmpstrnM'
+ String compare instruction, with five operands. Operand 0 is the
+ output; it has mode M. The remaining four operands are like the
+ operands of `movmemM'. The two memory blocks specified are
+ compared byte by byte in lexicographic order starting at the
+ beginning of each string. The instruction is not allowed to
+ prefetch more than one byte at a time since either string may end
+ in the first byte and reading past that may access an invalid page
+ or segment and cause a fault. The effect of the instruction is to
+ store a value in operand 0 whose sign indicates the result of the
+ comparison.
+
+`cmpstrM'
+ String compare instruction, without known maximum length. Operand
+ 0 is the output; it has mode M. The second and third operand are
+ the blocks of memory to be compared; both are `mem:BLK' with an
+ address in mode `Pmode'.
+
+ The fourth operand is the known shared alignment of the source and
+ destination, in the form of a `const_int' rtx. Thus, if the
+ compiler knows that both source and destination are word-aligned,
+ it may provide the value 4 for this operand.
+
+ The two memory blocks specified are compared byte by byte in
+ lexicographic order starting at the beginning of each string. The
+ instruction is not allowed to prefetch more than one byte at a
+ time since either string may end in the first byte and reading
+ past that may access an invalid page or segment and cause a fault.
+ The effect of the instruction is to store a value in operand 0
+ whose sign indicates the result of the comparison.
+
+`cmpmemM'
+ Block compare instruction, with five operands like the operands of
+ `cmpstrM'. The two memory blocks specified are compared byte by
+ byte in lexicographic order starting at the beginning of each
+ block. Unlike `cmpstrM' the instruction can prefetch any bytes in
+ the two memory blocks. The effect of the instruction is to store
+ a value in operand 0 whose sign indicates the result of the
+ comparison.
+
+`strlenM'
+ Compute the length of a string, with three operands. Operand 0 is
+ the result (of mode M), operand 1 is a `mem' referring to the
+ first character of the string, operand 2 is the character to
+ search for (normally zero), and operand 3 is a constant describing
+ the known alignment of the beginning of the string.
+
+`floatMN2'
+ Convert signed integer operand 1 (valid for fixed point mode M) to
+ floating point mode N and store in operand 0 (which has mode N).
+
+`floatunsMN2'
+ Convert unsigned integer operand 1 (valid for fixed point mode M)
+ to floating point mode N and store in operand 0 (which has mode N).
+
+`fixMN2'
+ Convert operand 1 (valid for floating point mode M) to fixed point
+ mode N as a signed number and store in operand 0 (which has mode
+ N). This instruction's result is defined only when the value of
+ operand 1 is an integer.
+
+ If the machine description defines this pattern, it also needs to
+ define the `ftrunc' pattern.
+
+`fixunsMN2'
+ Convert operand 1 (valid for floating point mode M) to fixed point
+ mode N as an unsigned number and store in operand 0 (which has
+ mode N). This instruction's result is defined only when the value
+ of operand 1 is an integer.
+
+`ftruncM2'
+ Convert operand 1 (valid for floating point mode M) to an integer
+ value, still represented in floating point mode M, and store it in
+ operand 0 (valid for floating point mode M).
+
+`fix_truncMN2'
+ Like `fixMN2' but works for any floating point value of mode M by
+ converting the value to an integer.
+
+`fixuns_truncMN2'
+ Like `fixunsMN2' but works for any floating point value of mode M
+ by converting the value to an integer.
+
+`truncMN2'
+ Truncate operand 1 (valid for mode M) to mode N and store in
+ operand 0 (which has mode N). Both modes must be fixed point or
+ both floating point.
+
+`extendMN2'
+ Sign-extend operand 1 (valid for mode M) to mode N and store in
+ operand 0 (which has mode N). Both modes must be fixed point or
+ both floating point.
+
+`zero_extendMN2'
+ Zero-extend operand 1 (valid for mode M) to mode N and store in
+ operand 0 (which has mode N). Both modes must be fixed point.
+
+`fractMN2'
+ Convert operand 1 of mode M to mode N and store in operand 0
+ (which has mode N). Mode M and mode N could be fixed-point to
+ fixed-point, signed integer to fixed-point, fixed-point to signed
+ integer, floating-point to fixed-point, or fixed-point to
+ floating-point. When overflows or underflows happen, the results
+ are undefined.
+
+`satfractMN2'
+ Convert operand 1 of mode M to mode N and store in operand 0
+ (which has mode N). Mode M and mode N could be fixed-point to
+ fixed-point, signed integer to fixed-point, or floating-point to
+ fixed-point. When overflows or underflows happen, the instruction
+ saturates the results to the maximum or the minimum.
+
+`fractunsMN2'
+ Convert operand 1 of mode M to mode N and store in operand 0
+ (which has mode N). Mode M and mode N could be unsigned integer
+ to fixed-point, or fixed-point to unsigned integer. When
+ overflows or underflows happen, the results are undefined.
+
+`satfractunsMN2'
+ Convert unsigned integer operand 1 of mode M to fixed-point mode N
+ and store in operand 0 (which has mode N). When overflows or
+ underflows happen, the instruction saturates the results to the
+ maximum or the minimum.
+
+`extv'
+ Extract a bit-field from operand 1 (a register or memory operand),
+ where operand 2 specifies the width in bits and operand 3 the
+ starting bit, and store it in operand 0. Operand 0 must have mode
+ `word_mode'. Operand 1 may have mode `byte_mode' or `word_mode';
+ often `word_mode' is allowed only for registers. Operands 2 and 3
+ must be valid for `word_mode'.
+
+ The RTL generation pass generates this instruction only with
+ constants for operands 2 and 3 and the constant is never zero for
+ operand 2.
+
+ The bit-field value is sign-extended to a full word integer before
+ it is stored in operand 0.
+
+`extzv'
+ Like `extv' except that the bit-field value is zero-extended.
+
+`insv'
+ Store operand 3 (which must be valid for `word_mode') into a
+ bit-field in operand 0, where operand 1 specifies the width in
+ bits and operand 2 the starting bit. Operand 0 may have mode
+ `byte_mode' or `word_mode'; often `word_mode' is allowed only for
+ registers. Operands 1 and 2 must be valid for `word_mode'.
+
+ The RTL generation pass generates this instruction only with
+ constants for operands 1 and 2 and the constant is never zero for
+ operand 1.
+
+`movMODEcc'
+ Conditionally move operand 2 or operand 3 into operand 0 according
+ to the comparison in operand 1. If the comparison is true,
+ operand 2 is moved into operand 0, otherwise operand 3 is moved.
+
+ The mode of the operands being compared need not be the same as
+ the operands being moved. Some machines, sparc64 for example,
+ have instructions that conditionally move an integer value based
+ on the floating point condition codes and vice versa.
+
+ If the machine does not have conditional move instructions, do not
+ define these patterns.
+
+`addMODEcc'
+ Similar to `movMODEcc' but for conditional addition. Conditionally
+ move operand 2 or (operands 2 + operand 3) into operand 0
+ according to the comparison in operand 1. If the comparison is
+ true, operand 2 is moved into operand 0, otherwise (operand 2 +
+ operand 3) is moved.
+
+`sCOND'
+ Store zero or nonzero in the operand according to the condition
+ codes. Value stored is nonzero iff the condition COND is true.
+ COND is the name of a comparison operation expression code, such
+ as `eq', `lt' or `leu'.
+
+ You specify the mode that the operand must have when you write the
+ `match_operand' expression. The compiler automatically sees which
+ mode you have used and supplies an operand of that mode.
+
+ The value stored for a true condition must have 1 as its low bit,
+ or else must be negative. Otherwise the instruction is not
+ suitable and you should omit it from the machine description. You
+ describe to the compiler exactly which value is stored by defining
+ the macro `STORE_FLAG_VALUE' (*note Misc::). If a description
+ cannot be found that can be used for all the `sCOND' patterns, you
+ should omit those operations from the machine description.
+
+ These operations may fail, but should do so only in relatively
+ uncommon cases; if they would fail for common cases involving
+ integer comparisons, it is best to omit these patterns.
+
+ If these operations are omitted, the compiler will usually
+ generate code that copies the constant one to the target and
+ branches around an assignment of zero to the target. If this code
+ is more efficient than the potential instructions used for the
+ `sCOND' pattern followed by those required to convert the result
+ into a 1 or a zero in `SImode', you should omit the `sCOND'
+ operations from the machine description.
+
+`bCOND'
+ Conditional branch instruction. Operand 0 is a `label_ref' that
+ refers to the label to jump to. Jump if the condition codes meet
+ condition COND.
+
+ Some machines do not follow the model assumed here where a
+ comparison instruction is followed by a conditional branch
+ instruction. In that case, the `cmpM' (and `tstM') patterns should
+ simply store the operands away and generate all the required insns
+ in a `define_expand' (*note Expander Definitions::) for the
+ conditional branch operations. All calls to expand `bCOND'
+ patterns are immediately preceded by calls to expand either a
+ `cmpM' pattern or a `tstM' pattern.
+
+ Machines that use a pseudo register for the condition code value,
+ or where the mode used for the comparison depends on the condition
+ being tested, should also use the above mechanism. *Note Jump
+ Patterns::.
+
+ The above discussion also applies to the `movMODEcc' and `sCOND'
+ patterns.
+
+`cbranchMODE4'
+ Conditional branch instruction combined with a compare instruction.
+ Operand 0 is a comparison operator. Operand 1 and operand 2 are
+ the first and second operands of the comparison, respectively.
+ Operand 3 is a `label_ref' that refers to the label to jump to.
+
+`jump'
+ A jump inside a function; an unconditional branch. Operand 0 is
+ the `label_ref' of the label to jump to. This pattern name is
+ mandatory on all machines.
+
+`call'
+ Subroutine call instruction returning no value. Operand 0 is the
+ function to call; operand 1 is the number of bytes of arguments
+ pushed as a `const_int'; operand 2 is the number of registers used
+ as operands.
+
+ On most machines, operand 2 is not actually stored into the RTL
+ pattern. It is supplied for the sake of some RISC machines which
+ need to put this information into the assembler code; they can put
+ it in the RTL instead of operand 1.
+
+ Operand 0 should be a `mem' RTX whose address is the address of the
+ function. Note, however, that this address can be a `symbol_ref'
+ expression even if it would not be a legitimate memory address on
+ the target machine. If it is also not a valid argument for a call
+ instruction, the pattern for this operation should be a
+ `define_expand' (*note Expander Definitions::) that places the
+ address into a register and uses that register in the call
+ instruction.
+
+`call_value'
+ Subroutine call instruction returning a value. Operand 0 is the
+ hard register in which the value is returned. There are three more
+ operands, the same as the three operands of the `call' instruction
+ (but with numbers increased by one).
+
+ Subroutines that return `BLKmode' objects use the `call' insn.
+
+`call_pop', `call_value_pop'
+ Similar to `call' and `call_value', except used if defined and if
+ `RETURN_POPS_ARGS' is nonzero. They should emit a `parallel' that
+ contains both the function call and a `set' to indicate the
+ adjustment made to the frame pointer.
+
+ For machines where `RETURN_POPS_ARGS' can be nonzero, the use of
+ these patterns increases the number of functions for which the
+ frame pointer can be eliminated, if desired.
+
+`untyped_call'
+ Subroutine call instruction returning a value of any type.
+ Operand 0 is the function to call; operand 1 is a memory location
+ where the result of calling the function is to be stored; operand
+ 2 is a `parallel' expression where each element is a `set'
+ expression that indicates the saving of a function return value
+ into the result block.
+
+ This instruction pattern should be defined to support
+ `__builtin_apply' on machines where special instructions are needed
+ to call a subroutine with arbitrary arguments or to save the value
+ returned. This instruction pattern is required on machines that
+ have multiple registers that can hold a return value (i.e.
+ `FUNCTION_VALUE_REGNO_P' is true for more than one register).
+
+`return'
+ Subroutine return instruction. This instruction pattern name
+ should be defined only if a single instruction can do all the work
+ of returning from a function.
+
+ Like the `movM' patterns, this pattern is also used after the RTL
+ generation phase. In this case it is to support machines where
+ multiple instructions are usually needed to return from a
+ function, but some class of functions only requires one
+ instruction to implement a return. Normally, the applicable
+ functions are those which do not need to save any registers or
+ allocate stack space.
+
+ For such machines, the condition specified in this pattern should
+ only be true when `reload_completed' is nonzero and the function's
+ epilogue would only be a single instruction. For machines with
+ register windows, the routine `leaf_function_p' may be used to
+ determine if a register window push is required.
+
+ Machines that have conditional return instructions should define
+ patterns such as
+
+ (define_insn ""
+ [(set (pc)
+ (if_then_else (match_operator
+ 0 "comparison_operator"
+ [(cc0) (const_int 0)])
+ (return)
+ (pc)))]
+ "CONDITION"
+ "...")
+
+ where CONDITION would normally be the same condition specified on
+ the named `return' pattern.
+
+`untyped_return'
+ Untyped subroutine return instruction. This instruction pattern
+ should be defined to support `__builtin_return' on machines where
+ special instructions are needed to return a value of any type.
+
+ Operand 0 is a memory location where the result of calling a
+ function with `__builtin_apply' is stored; operand 1 is a
+ `parallel' expression where each element is a `set' expression
+ that indicates the restoring of a function return value from the
+ result block.
+
+`nop'
+ No-op instruction. This instruction pattern name should always be
+ defined to output a no-op in assembler code. `(const_int 0)' will
+ do as an RTL pattern.
+
+`indirect_jump'
+ An instruction to jump to an address which is operand zero. This
+ pattern name is mandatory on all machines.
+
+`casesi'
+ Instruction to jump through a dispatch table, including bounds
+ checking. This instruction takes five operands:
+
+ 1. The index to dispatch on, which has mode `SImode'.
+
+ 2. The lower bound for indices in the table, an integer constant.
+
+ 3. The total range of indices in the table--the largest index
+ minus the smallest one (both inclusive).
+
+ 4. A label that precedes the table itself.
+
+ 5. A label to jump to if the index has a value outside the
+ bounds.
+
+ The table is a `addr_vec' or `addr_diff_vec' inside of a
+ `jump_insn'. The number of elements in the table is one plus the
+ difference between the upper bound and the lower bound.
+
+`tablejump'
+ Instruction to jump to a variable address. This is a low-level
+ capability which can be used to implement a dispatch table when
+ there is no `casesi' pattern.
+
+ This pattern requires two operands: the address or offset, and a
+ label which should immediately precede the jump table. If the
+ macro `CASE_VECTOR_PC_RELATIVE' evaluates to a nonzero value then
+ the first operand is an offset which counts from the address of
+ the table; otherwise, it is an absolute address to jump to. In
+ either case, the first operand has mode `Pmode'.
+
+ The `tablejump' insn is always the last insn before the jump table
+ it uses. Its assembler code normally has no need to use the
+ second operand, but you should incorporate it in the RTL pattern so
+ that the jump optimizer will not delete the table as unreachable
+ code.
+
+`decrement_and_branch_until_zero'
+ Conditional branch instruction that decrements a register and
+ jumps if the register is nonzero. Operand 0 is the register to
+ decrement and test; operand 1 is the label to jump to if the
+ register is nonzero. *Note Looping Patterns::.
+
+ This optional instruction pattern is only used by the combiner,
+ typically for loops reversed by the loop optimizer when strength
+ reduction is enabled.
+
+`doloop_end'
+ Conditional branch instruction that decrements a register and
+ jumps if the register is nonzero. This instruction takes five
+ operands: Operand 0 is the register to decrement and test; operand
+ 1 is the number of loop iterations as a `const_int' or
+ `const0_rtx' if this cannot be determined until run-time; operand
+ 2 is the actual or estimated maximum number of iterations as a
+ `const_int'; operand 3 is the number of enclosed loops as a
+ `const_int' (an innermost loop has a value of 1); operand 4 is the
+ label to jump to if the register is nonzero. *Note Looping
+ Patterns::.
+
+ This optional instruction pattern should be defined for machines
+ with low-overhead looping instructions as the loop optimizer will
+ try to modify suitable loops to utilize it. If nested
+ low-overhead looping is not supported, use a `define_expand'
+ (*note Expander Definitions::) and make the pattern fail if
+ operand 3 is not `const1_rtx'. Similarly, if the actual or
+ estimated maximum number of iterations is too large for this
+ instruction, make it fail.
+
+`doloop_begin'
+ Companion instruction to `doloop_end' required for machines that
+ need to perform some initialization, such as loading special
+ registers used by a low-overhead looping instruction. If
+ initialization insns do not always need to be emitted, use a
+ `define_expand' (*note Expander Definitions::) and make it fail.
+
+`canonicalize_funcptr_for_compare'
+ Canonicalize the function pointer in operand 1 and store the result
+ into operand 0.
+
+ Operand 0 is always a `reg' and has mode `Pmode'; operand 1 may be
+ a `reg', `mem', `symbol_ref', `const_int', etc and also has mode
+ `Pmode'.
+
+ Canonicalization of a function pointer usually involves computing
+ the address of the function which would be called if the function
+ pointer were used in an indirect call.
+
+ Only define this pattern if function pointers on the target machine
+ can have different values but still call the same function when
+ used in an indirect call.
+
+`save_stack_block'
+`save_stack_function'
+`save_stack_nonlocal'
+`restore_stack_block'
+`restore_stack_function'
+`restore_stack_nonlocal'
+ Most machines save and restore the stack pointer by copying it to
+ or from an object of mode `Pmode'. Do not define these patterns on
+ such machines.
+
+ Some machines require special handling for stack pointer saves and
+ restores. On those machines, define the patterns corresponding to
+ the non-standard cases by using a `define_expand' (*note Expander
+ Definitions::) that produces the required insns. The three types
+ of saves and restores are:
+
+ 1. `save_stack_block' saves the stack pointer at the start of a
+ block that allocates a variable-sized object, and
+ `restore_stack_block' restores the stack pointer when the
+ block is exited.
+
+ 2. `save_stack_function' and `restore_stack_function' do a
+ similar job for the outermost block of a function and are
+ used when the function allocates variable-sized objects or
+ calls `alloca'. Only the epilogue uses the restored stack
+ pointer, allowing a simpler save or restore sequence on some
+ machines.
+
+ 3. `save_stack_nonlocal' is used in functions that contain labels
+ branched to by nested functions. It saves the stack pointer
+ in such a way that the inner function can use
+ `restore_stack_nonlocal' to restore the stack pointer. The
+ compiler generates code to restore the frame and argument
+ pointer registers, but some machines require saving and
+ restoring additional data such as register window information
+ or stack backchains. Place insns in these patterns to save
+ and restore any such required data.
+
+ When saving the stack pointer, operand 0 is the save area and
+ operand 1 is the stack pointer. The mode used to allocate the
+ save area defaults to `Pmode' but you can override that choice by
+ defining the `STACK_SAVEAREA_MODE' macro (*note Storage Layout::).
+ You must specify an integral mode, or `VOIDmode' if no save area
+ is needed for a particular type of save (either because no save is
+ needed or because a machine-specific save area can be used).
+ Operand 0 is the stack pointer and operand 1 is the save area for
+ restore operations. If `save_stack_block' is defined, operand 0
+ must not be `VOIDmode' since these saves can be arbitrarily nested.
+
+ A save area is a `mem' that is at a constant offset from
+ `virtual_stack_vars_rtx' when the stack pointer is saved for use by
+ nonlocal gotos and a `reg' in the other two cases.
+
+`allocate_stack'
+ Subtract (or add if `STACK_GROWS_DOWNWARD' is undefined) operand 1
+ from the stack pointer to create space for dynamically allocated
+ data.
+
+ Store the resultant pointer to this space into operand 0. If you
+ are allocating space from the main stack, do this by emitting a
+ move insn to copy `virtual_stack_dynamic_rtx' to operand 0. If
+ you are allocating the space elsewhere, generate code to copy the
+ location of the space to operand 0. In the latter case, you must
+ ensure this space gets freed when the corresponding space on the
+ main stack is free.
+
+ Do not define this pattern if all that must be done is the
+ subtraction. Some machines require other operations such as stack
+ probes or maintaining the back chain. Define this pattern to emit
+ those operations in addition to updating the stack pointer.
+
+`check_stack'
+ If stack checking cannot be done on your system by probing the
+ stack with a load or store instruction (*note Stack Checking::),
+ define this pattern to perform the needed check and signaling an
+ error if the stack has overflowed. The single operand is the
+ location in the stack furthest from the current stack pointer that
+ you need to validate. Normally, on machines where this pattern is
+ needed, you would obtain the stack limit from a global or
+ thread-specific variable or register.
+
+`nonlocal_goto'
+ Emit code to generate a non-local goto, e.g., a jump from one
+ function to a label in an outer function. This pattern has four
+ arguments, each representing a value to be used in the jump. The
+ first argument is to be loaded into the frame pointer, the second
+ is the address to branch to (code to dispatch to the actual label),
+ the third is the address of a location where the stack is saved,
+ and the last is the address of the label, to be placed in the
+ location for the incoming static chain.
+
+ On most machines you need not define this pattern, since GCC will
+ already generate the correct code, which is to load the frame
+ pointer and static chain, restore the stack (using the
+ `restore_stack_nonlocal' pattern, if defined), and jump indirectly
+ to the dispatcher. You need only define this pattern if this code
+ will not work on your machine.
+
+`nonlocal_goto_receiver'
+ This pattern, if defined, contains code needed at the target of a
+ nonlocal goto after the code already generated by GCC. You will
+ not normally need to define this pattern. A typical reason why
+ you might need this pattern is if some value, such as a pointer to
+ a global table, must be restored when the frame pointer is
+ restored. Note that a nonlocal goto only occurs within a
+ unit-of-translation, so a global table pointer that is shared by
+ all functions of a given module need not be restored. There are
+ no arguments.
+
+`exception_receiver'
+ This pattern, if defined, contains code needed at the site of an
+ exception handler that isn't needed at the site of a nonlocal
+ goto. You will not normally need to define this pattern. A
+ typical reason why you might need this pattern is if some value,
+ such as a pointer to a global table, must be restored after
+ control flow is branched to the handler of an exception. There
+ are no arguments.
+
+`builtin_setjmp_setup'
+ This pattern, if defined, contains additional code needed to
+ initialize the `jmp_buf'. You will not normally need to define
+ this pattern. A typical reason why you might need this pattern is
+ if some value, such as a pointer to a global table, must be
+ restored. Though it is preferred that the pointer value be
+ recalculated if possible (given the address of a label for
+ instance). The single argument is a pointer to the `jmp_buf'.
+ Note that the buffer is five words long and that the first three
+ are normally used by the generic mechanism.
+
+`builtin_setjmp_receiver'
+ This pattern, if defined, contains code needed at the site of an
+ built-in setjmp that isn't needed at the site of a nonlocal goto.
+ You will not normally need to define this pattern. A typical
+ reason why you might need this pattern is if some value, such as a
+ pointer to a global table, must be restored. It takes one
+ argument, which is the label to which builtin_longjmp transfered
+ control; this pattern may be emitted at a small offset from that
+ label.
+
+`builtin_longjmp'
+ This pattern, if defined, performs the entire action of the
+ longjmp. You will not normally need to define this pattern unless
+ you also define `builtin_setjmp_setup'. The single argument is a
+ pointer to the `jmp_buf'.
+
+`eh_return'
+ This pattern, if defined, affects the way `__builtin_eh_return',
+ and thence the call frame exception handling library routines, are
+ built. It is intended to handle non-trivial actions needed along
+ the abnormal return path.
+
+ The address of the exception handler to which the function should
+ return is passed as operand to this pattern. It will normally
+ need to copied by the pattern to some special register or memory
+ location. If the pattern needs to determine the location of the
+ target call frame in order to do so, it may use
+ `EH_RETURN_STACKADJ_RTX', if defined; it will have already been
+ assigned.
+
+ If this pattern is not defined, the default action will be to
+ simply copy the return address to `EH_RETURN_HANDLER_RTX'. Either
+ that macro or this pattern needs to be defined if call frame
+ exception handling is to be used.
+
+`prologue'
+ This pattern, if defined, emits RTL for entry to a function. The
+ function entry is responsible for setting up the stack frame,
+ initializing the frame pointer register, saving callee saved
+ registers, etc.
+
+ Using a prologue pattern is generally preferred over defining
+ `TARGET_ASM_FUNCTION_PROLOGUE' to emit assembly code for the
+ prologue.
+
+ The `prologue' pattern is particularly useful for targets which
+ perform instruction scheduling.
+
+`epilogue'
+ This pattern emits RTL for exit from a function. The function
+ exit is responsible for deallocating the stack frame, restoring
+ callee saved registers and emitting the return instruction.
+
+ Using an epilogue pattern is generally preferred over defining
+ `TARGET_ASM_FUNCTION_EPILOGUE' to emit assembly code for the
+ epilogue.
+
+ The `epilogue' pattern is particularly useful for targets which
+ perform instruction scheduling or which have delay slots for their
+ return instruction.
+
+`sibcall_epilogue'
+ This pattern, if defined, emits RTL for exit from a function
+ without the final branch back to the calling function. This
+ pattern will be emitted before any sibling call (aka tail call)
+ sites.
+
+ The `sibcall_epilogue' pattern must not clobber any arguments used
+ for parameter passing or any stack slots for arguments passed to
+ the current function.
+
+`trap'
+ This pattern, if defined, signals an error, typically by causing
+ some kind of signal to be raised. Among other places, it is used
+ by the Java front end to signal `invalid array index' exceptions.
+
+`conditional_trap'
+ Conditional trap instruction. Operand 0 is a piece of RTL which
+ performs a comparison. Operand 1 is the trap code, an integer.
+
+ A typical `conditional_trap' pattern looks like
+
+ (define_insn "conditional_trap"
+ [(trap_if (match_operator 0 "trap_operator"
+ [(cc0) (const_int 0)])
+ (match_operand 1 "const_int_operand" "i"))]
+ ""
+ "...")
+
+`prefetch'
+ This pattern, if defined, emits code for a non-faulting data
+ prefetch instruction. Operand 0 is the address of the memory to
+ prefetch. Operand 1 is a constant 1 if the prefetch is preparing
+ for a write to the memory address, or a constant 0 otherwise.
+ Operand 2 is the expected degree of temporal locality of the data
+ and is a value between 0 and 3, inclusive; 0 means that the data
+ has no temporal locality, so it need not be left in the cache
+ after the access; 3 means that the data has a high degree of
+ temporal locality and should be left in all levels of cache
+ possible; 1 and 2 mean, respectively, a low or moderate degree of
+ temporal locality.
+
+ Targets that do not support write prefetches or locality hints can
+ ignore the values of operands 1 and 2.
+
+`blockage'
+ This pattern defines a pseudo insn that prevents the instruction
+ scheduler from moving instructions across the boundary defined by
+ the blockage insn. Normally an UNSPEC_VOLATILE pattern.
+
+`memory_barrier'
+ If the target memory model is not fully synchronous, then this
+ pattern should be defined to an instruction that orders both loads
+ and stores before the instruction with respect to loads and stores
+ after the instruction. This pattern has no operands.
+
+`sync_compare_and_swapMODE'
+ This pattern, if defined, emits code for an atomic compare-and-swap
+ operation. Operand 1 is the memory on which the atomic operation
+ is performed. Operand 2 is the "old" value to be compared against
+ the current contents of the memory location. Operand 3 is the
+ "new" value to store in the memory if the compare succeeds.
+ Operand 0 is the result of the operation; it should contain the
+ contents of the memory before the operation. If the compare
+ succeeds, this should obviously be a copy of operand 2.
+
+ This pattern must show that both operand 0 and operand 1 are
+ modified.
+
+ This pattern must issue any memory barrier instructions such that
+ all memory operations before the atomic operation occur before the
+ atomic operation and all memory operations after the atomic
+ operation occur after the atomic operation.
+
+`sync_compare_and_swap_ccMODE'
+ This pattern is just like `sync_compare_and_swapMODE', except it
+ should act as if compare part of the compare-and-swap were issued
+ via `cmpM'. This comparison will only be used with `EQ' and `NE'
+ branches and `setcc' operations.
+
+ Some targets do expose the success or failure of the
+ compare-and-swap operation via the status flags. Ideally we
+ wouldn't need a separate named pattern in order to take advantage
+ of this, but the combine pass does not handle patterns with
+ multiple sets, which is required by definition for
+ `sync_compare_and_swapMODE'.
+
+`sync_addMODE', `sync_subMODE'
+`sync_iorMODE', `sync_andMODE'
+`sync_xorMODE', `sync_nandMODE'
+ These patterns emit code for an atomic operation on memory.
+ Operand 0 is the memory on which the atomic operation is performed.
+ Operand 1 is the second operand to the binary operator.
+
+ This pattern must issue any memory barrier instructions such that
+ all memory operations before the atomic operation occur before the
+ atomic operation and all memory operations after the atomic
+ operation occur after the atomic operation.
+
+ If these patterns are not defined, the operation will be
+ constructed from a compare-and-swap operation, if defined.
+
+`sync_old_addMODE', `sync_old_subMODE'
+`sync_old_iorMODE', `sync_old_andMODE'
+`sync_old_xorMODE', `sync_old_nandMODE'
+ These patterns are emit code for an atomic operation on memory,
+ and return the value that the memory contained before the
+ operation. Operand 0 is the result value, operand 1 is the memory
+ on which the atomic operation is performed, and operand 2 is the
+ second operand to the binary operator.
+
+ This pattern must issue any memory barrier instructions such that
+ all memory operations before the atomic operation occur before the
+ atomic operation and all memory operations after the atomic
+ operation occur after the atomic operation.
+
+ If these patterns are not defined, the operation will be
+ constructed from a compare-and-swap operation, if defined.
+
+`sync_new_addMODE', `sync_new_subMODE'
+`sync_new_iorMODE', `sync_new_andMODE'
+`sync_new_xorMODE', `sync_new_nandMODE'
+ These patterns are like their `sync_old_OP' counterparts, except
+ that they return the value that exists in the memory location
+ after the operation, rather than before the operation.
+
+`sync_lock_test_and_setMODE'
+ This pattern takes two forms, based on the capabilities of the
+ target. In either case, operand 0 is the result of the operand,
+ operand 1 is the memory on which the atomic operation is
+ performed, and operand 2 is the value to set in the lock.
+
+ In the ideal case, this operation is an atomic exchange operation,
+ in which the previous value in memory operand is copied into the
+ result operand, and the value operand is stored in the memory
+ operand.
+
+ For less capable targets, any value operand that is not the
+ constant 1 should be rejected with `FAIL'. In this case the
+ target may use an atomic test-and-set bit operation. The result
+ operand should contain 1 if the bit was previously set and 0 if
+ the bit was previously clear. The true contents of the memory
+ operand are implementation defined.
+
+ This pattern must issue any memory barrier instructions such that
+ the pattern as a whole acts as an acquire barrier, that is all
+ memory operations after the pattern do not occur until the lock is
+ acquired.
+
+ If this pattern is not defined, the operation will be constructed
+ from a compare-and-swap operation, if defined.
+
+`sync_lock_releaseMODE'
+ This pattern, if defined, releases a lock set by
+ `sync_lock_test_and_setMODE'. Operand 0 is the memory that
+ contains the lock; operand 1 is the value to store in the lock.
+
+ If the target doesn't implement full semantics for
+ `sync_lock_test_and_setMODE', any value operand which is not the
+ constant 0 should be rejected with `FAIL', and the true contents
+ of the memory operand are implementation defined.
+
+ This pattern must issue any memory barrier instructions such that
+ the pattern as a whole acts as a release barrier, that is the lock
+ is released only after all previous memory operations have
+ completed.
+
+ If this pattern is not defined, then a `memory_barrier' pattern
+ will be emitted, followed by a store of the value to the memory
+ operand.
+
+`stack_protect_set'
+ This pattern, if defined, moves a `Pmode' value from the memory in
+ operand 1 to the memory in operand 0 without leaving the value in
+ a register afterward. This is to avoid leaking the value some
+ place that an attacker might use to rewrite the stack guard slot
+ after having clobbered it.
+
+ If this pattern is not defined, then a plain move pattern is
+ generated.
+
+`stack_protect_test'
+ This pattern, if defined, compares a `Pmode' value from the memory
+ in operand 1 with the memory in operand 0 without leaving the
+ value in a register afterward and branches to operand 2 if the
+ values weren't equal.
+
+ If this pattern is not defined, then a plain compare pattern and
+ conditional branch pattern is used.
+
+`clear_cache'
+ This pattern, if defined, flushes the instruction cache for a
+ region of memory. The region is bounded to by the Pmode pointers
+ in operand 0 inclusive and operand 1 exclusive.
+
+ If this pattern is not defined, a call to the library function
+ `__clear_cache' is used.
+
+
+
+File: gccint.info, Node: Pattern Ordering, Next: Dependent Patterns, Prev: Standard Names, Up: Machine Desc
+
+16.10 When the Order of Patterns Matters
+========================================
+
+Sometimes an insn can match more than one instruction pattern. Then the
+pattern that appears first in the machine description is the one used.
+Therefore, more specific patterns (patterns that will match fewer
+things) and faster instructions (those that will produce better code
+when they do match) should usually go first in the description.
+
+ In some cases the effect of ordering the patterns can be used to hide
+a pattern when it is not valid. For example, the 68000 has an
+instruction for converting a fullword to floating point and another for
+converting a byte to floating point. An instruction converting an
+integer to floating point could match either one. We put the pattern
+to convert the fullword first to make sure that one will be used rather
+than the other. (Otherwise a large integer might be generated as a
+single-byte immediate quantity, which would not work.) Instead of
+using this pattern ordering it would be possible to make the pattern
+for convert-a-byte smart enough to deal properly with any constant
+value.
+
+
+File: gccint.info, Node: Dependent Patterns, Next: Jump Patterns, Prev: Pattern Ordering, Up: Machine Desc
+
+16.11 Interdependence of Patterns
+=================================
+
+Every machine description must have a named pattern for each of the
+conditional branch names `bCOND'. The recognition template must always
+have the form
+
+ (set (pc)
+ (if_then_else (COND (cc0) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))
+
+In addition, every machine description must have an anonymous pattern
+for each of the possible reverse-conditional branches. Their templates
+look like
+
+ (set (pc)
+ (if_then_else (COND (cc0) (const_int 0))
+ (pc)
+ (label_ref (match_operand 0 "" ""))))
+
+They are necessary because jump optimization can turn direct-conditional
+branches into reverse-conditional branches.
+
+ It is often convenient to use the `match_operator' construct to reduce
+the number of patterns that must be specified for branches. For
+example,
+
+ (define_insn ""
+ [(set (pc)
+ (if_then_else (match_operator 0 "comparison_operator"
+ [(cc0) (const_int 0)])
+ (pc)
+ (label_ref (match_operand 1 "" ""))))]
+ "CONDITION"
+ "...")
+
+ In some cases machines support instructions identical except for the
+machine mode of one or more operands. For example, there may be
+"sign-extend halfword" and "sign-extend byte" instructions whose
+patterns are
+
+ (set (match_operand:SI 0 ...)
+ (extend:SI (match_operand:HI 1 ...)))
+
+ (set (match_operand:SI 0 ...)
+ (extend:SI (match_operand:QI 1 ...)))
+
+Constant integers do not specify a machine mode, so an instruction to
+extend a constant value could match either pattern. The pattern it
+actually will match is the one that appears first in the file. For
+correct results, this must be the one for the widest possible mode
+(`HImode', here). If the pattern matches the `QImode' instruction, the
+results will be incorrect if the constant value does not actually fit
+that mode.
+
+ Such instructions to extend constants are rarely generated because
+they are optimized away, but they do occasionally happen in nonoptimized
+compilations.
+
+ If a constraint in a pattern allows a constant, the reload pass may
+replace a register with a constant permitted by the constraint in some
+cases. Similarly for memory references. Because of this substitution,
+you should not provide separate patterns for increment and decrement
+instructions. Instead, they should be generated from the same pattern
+that supports register-register add insns by examining the operands and
+generating the appropriate machine instruction.
+
+
+File: gccint.info, Node: Jump Patterns, Next: Looping Patterns, Prev: Dependent Patterns, Up: Machine Desc
+
+16.12 Defining Jump Instruction Patterns
+========================================
+
+For most machines, GCC assumes that the machine has a condition code.
+A comparison insn sets the condition code, recording the results of both
+signed and unsigned comparison of the given operands. A separate branch
+insn tests the condition code and branches or not according its value.
+The branch insns come in distinct signed and unsigned flavors. Many
+common machines, such as the VAX, the 68000 and the 32000, work this
+way.
+
+ Some machines have distinct signed and unsigned compare instructions,
+and only one set of conditional branch instructions. The easiest way
+to handle these machines is to treat them just like the others until
+the final stage where assembly code is written. At this time, when
+outputting code for the compare instruction, peek ahead at the
+following branch using `next_cc0_user (insn)'. (The variable `insn'
+refers to the insn being output, in the output-writing code in an
+instruction pattern.) If the RTL says that is an unsigned branch,
+output an unsigned compare; otherwise output a signed compare. When
+the branch itself is output, you can treat signed and unsigned branches
+identically.
+
+ The reason you can do this is that GCC always generates a pair of
+consecutive RTL insns, possibly separated by `note' insns, one to set
+the condition code and one to test it, and keeps the pair inviolate
+until the end.
+
+ To go with this technique, you must define the machine-description
+macro `NOTICE_UPDATE_CC' to do `CC_STATUS_INIT'; in other words, no
+compare instruction is superfluous.
+
+ Some machines have compare-and-branch instructions and no condition
+code. A similar technique works for them. When it is time to "output"
+a compare instruction, record its operands in two static variables.
+When outputting the branch-on-condition-code instruction that follows,
+actually output a compare-and-branch instruction that uses the
+remembered operands.
+
+ It also works to define patterns for compare-and-branch instructions.
+In optimizing compilation, the pair of compare and branch instructions
+will be combined according to these patterns. But this does not happen
+if optimization is not requested. So you must use one of the solutions
+above in addition to any special patterns you define.
+
+ In many RISC machines, most instructions do not affect the condition
+code and there may not even be a separate condition code register. On
+these machines, the restriction that the definition and use of the
+condition code be adjacent insns is not necessary and can prevent
+important optimizations. For example, on the IBM RS/6000, there is a
+delay for taken branches unless the condition code register is set three
+instructions earlier than the conditional branch. The instruction
+scheduler cannot perform this optimization if it is not permitted to
+separate the definition and use of the condition code register.
+
+ On these machines, do not use `(cc0)', but instead use a register to
+represent the condition code. If there is a specific condition code
+register in the machine, use a hard register. If the condition code or
+comparison result can be placed in any general register, or if there are
+multiple condition registers, use a pseudo register.
+
+ On some machines, the type of branch instruction generated may depend
+on the way the condition code was produced; for example, on the 68k and
+SPARC, setting the condition code directly from an add or subtract
+instruction does not clear the overflow bit the way that a test
+instruction does, so a different branch instruction must be used for
+some conditional branches. For machines that use `(cc0)', the set and
+use of the condition code must be adjacent (separated only by `note'
+insns) allowing flags in `cc_status' to be used. (*Note Condition
+Code::.) Also, the comparison and branch insns can be located from
+each other by using the functions `prev_cc0_setter' and `next_cc0_user'.
+
+ However, this is not true on machines that do not use `(cc0)'. On
+those machines, no assumptions can be made about the adjacency of the
+compare and branch insns and the above methods cannot be used. Instead,
+we use the machine mode of the condition code register to record
+different formats of the condition code register.
+
+ Registers used to store the condition code value should have a mode
+that is in class `MODE_CC'. Normally, it will be `CCmode'. If
+additional modes are required (as for the add example mentioned above in
+the SPARC), define them in `MACHINE-modes.def' (*note Condition
+Code::). Also define `SELECT_CC_MODE' to choose a mode given an
+operand of a compare.
+
+ If it is known during RTL generation that a different mode will be
+required (for example, if the machine has separate compare instructions
+for signed and unsigned quantities, like most IBM processors), they can
+be specified at that time.
+
+ If the cases that require different modes would be made by instruction
+combination, the macro `SELECT_CC_MODE' determines which machine mode
+should be used for the comparison result. The patterns should be
+written using that mode. To support the case of the add on the SPARC
+discussed above, we have the pattern
+
+ (define_insn ""
+ [(set (reg:CC_NOOV 0)
+ (compare:CC_NOOV
+ (plus:SI (match_operand:SI 0 "register_operand" "%r")
+ (match_operand:SI 1 "arith_operand" "rI"))
+ (const_int 0)))]
+ ""
+ "...")
+
+ The `SELECT_CC_MODE' macro on the SPARC returns `CC_NOOVmode' for
+comparisons whose argument is a `plus'.
+
+
+File: gccint.info, Node: Looping Patterns, Next: Insn Canonicalizations, Prev: Jump Patterns, Up: Machine Desc
+
+16.13 Defining Looping Instruction Patterns
+===========================================
+
+Some machines have special jump instructions that can be utilized to
+make loops more efficient. A common example is the 68000 `dbra'
+instruction which performs a decrement of a register and a branch if the
+result was greater than zero. Other machines, in particular digital
+signal processors (DSPs), have special block repeat instructions to
+provide low-overhead loop support. For example, the TI TMS320C3x/C4x
+DSPs have a block repeat instruction that loads special registers to
+mark the top and end of a loop and to count the number of loop
+iterations. This avoids the need for fetching and executing a
+`dbra'-like instruction and avoids pipeline stalls associated with the
+jump.
+
+ GCC has three special named patterns to support low overhead looping.
+They are `decrement_and_branch_until_zero', `doloop_begin', and
+`doloop_end'. The first pattern, `decrement_and_branch_until_zero', is
+not emitted during RTL generation but may be emitted during the
+instruction combination phase. This requires the assistance of the
+loop optimizer, using information collected during strength reduction,
+to reverse a loop to count down to zero. Some targets also require the
+loop optimizer to add a `REG_NONNEG' note to indicate that the
+iteration count is always positive. This is needed if the target
+performs a signed loop termination test. For example, the 68000 uses a
+pattern similar to the following for its `dbra' instruction:
+
+ (define_insn "decrement_and_branch_until_zero"
+ [(set (pc)
+ (if_then_else
+ (ge (plus:SI (match_operand:SI 0 "general_operand" "+d*am")
+ (const_int -1))
+ (const_int 0))
+ (label_ref (match_operand 1 "" ""))
+ (pc)))
+ (set (match_dup 0)
+ (plus:SI (match_dup 0)
+ (const_int -1)))]
+ "find_reg_note (insn, REG_NONNEG, 0)"
+ "...")
+
+ Note that since the insn is both a jump insn and has an output, it must
+deal with its own reloads, hence the `m' constraints. Also note that
+since this insn is generated by the instruction combination phase
+combining two sequential insns together into an implicit parallel insn,
+the iteration counter needs to be biased by the same amount as the
+decrement operation, in this case -1. Note that the following similar
+pattern will not be matched by the combiner.
+
+ (define_insn "decrement_and_branch_until_zero"
+ [(set (pc)
+ (if_then_else
+ (ge (match_operand:SI 0 "general_operand" "+d*am")
+ (const_int 1))
+ (label_ref (match_operand 1 "" ""))
+ (pc)))
+ (set (match_dup 0)
+ (plus:SI (match_dup 0)
+ (const_int -1)))]
+ "find_reg_note (insn, REG_NONNEG, 0)"
+ "...")
+
+ The other two special looping patterns, `doloop_begin' and
+`doloop_end', are emitted by the loop optimizer for certain
+well-behaved loops with a finite number of loop iterations using
+information collected during strength reduction.
+
+ The `doloop_end' pattern describes the actual looping instruction (or
+the implicit looping operation) and the `doloop_begin' pattern is an
+optional companion pattern that can be used for initialization needed
+for some low-overhead looping instructions.
+
+ Note that some machines require the actual looping instruction to be
+emitted at the top of the loop (e.g., the TMS320C3x/C4x DSPs). Emitting
+the true RTL for a looping instruction at the top of the loop can cause
+problems with flow analysis. So instead, a dummy `doloop' insn is
+emitted at the end of the loop. The machine dependent reorg pass checks
+for the presence of this `doloop' insn and then searches back to the
+top of the loop, where it inserts the true looping insn (provided there
+are no instructions in the loop which would cause problems). Any
+additional labels can be emitted at this point. In addition, if the
+desired special iteration counter register was not allocated, this
+machine dependent reorg pass could emit a traditional compare and jump
+instruction pair.
+
+ The essential difference between the `decrement_and_branch_until_zero'
+and the `doloop_end' patterns is that the loop optimizer allocates an
+additional pseudo register for the latter as an iteration counter.
+This pseudo register cannot be used within the loop (i.e., general
+induction variables cannot be derived from it), however, in many cases
+the loop induction variable may become redundant and removed by the
+flow pass.
+
+
+File: gccint.info, Node: Insn Canonicalizations, Next: Expander Definitions, Prev: Looping Patterns, Up: Machine Desc
+
+16.14 Canonicalization of Instructions
+======================================
+
+There are often cases where multiple RTL expressions could represent an
+operation performed by a single machine instruction. This situation is
+most commonly encountered with logical, branch, and multiply-accumulate
+instructions. In such cases, the compiler attempts to convert these
+multiple RTL expressions into a single canonical form to reduce the
+number of insn patterns required.
+
+ In addition to algebraic simplifications, following canonicalizations
+are performed:
+
+ * For commutative and comparison operators, a constant is always
+ made the second operand. If a machine only supports a constant as
+ the second operand, only patterns that match a constant in the
+ second operand need be supplied.
+
+ * For associative operators, a sequence of operators will always
+ chain to the left; for instance, only the left operand of an
+ integer `plus' can itself be a `plus'. `and', `ior', `xor',
+ `plus', `mult', `smin', `smax', `umin', and `umax' are associative
+ when applied to integers, and sometimes to floating-point.
+
+ * For these operators, if only one operand is a `neg', `not',
+ `mult', `plus', or `minus' expression, it will be the first
+ operand.
+
+ * In combinations of `neg', `mult', `plus', and `minus', the `neg'
+ operations (if any) will be moved inside the operations as far as
+ possible. For instance, `(neg (mult A B))' is canonicalized as
+ `(mult (neg A) B)', but `(plus (mult (neg A) B) C)' is
+ canonicalized as `(minus A (mult B C))'.
+
+ * For the `compare' operator, a constant is always the second operand
+ on machines where `cc0' is used (*note Jump Patterns::). On other
+ machines, there are rare cases where the compiler might want to
+ construct a `compare' with a constant as the first operand.
+ However, these cases are not common enough for it to be worthwhile
+ to provide a pattern matching a constant as the first operand
+ unless the machine actually has such an instruction.
+
+ An operand of `neg', `not', `mult', `plus', or `minus' is made the
+ first operand under the same conditions as above.
+
+ * `(ltu (plus A B) B)' is converted to `(ltu (plus A B) A)'.
+ Likewise with `geu' instead of `ltu'.
+
+ * `(minus X (const_int N))' is converted to `(plus X (const_int
+ -N))'.
+
+ * Within address computations (i.e., inside `mem'), a left shift is
+ converted into the appropriate multiplication by a power of two.
+
+ * De Morgan's Law is used to move bitwise negation inside a bitwise
+ logical-and or logical-or operation. If this results in only one
+ operand being a `not' expression, it will be the first one.
+
+ A machine that has an instruction that performs a bitwise
+ logical-and of one operand with the bitwise negation of the other
+ should specify the pattern for that instruction as
+
+ (define_insn ""
+ [(set (match_operand:M 0 ...)
+ (and:M (not:M (match_operand:M 1 ...))
+ (match_operand:M 2 ...)))]
+ "..."
+ "...")
+
+ Similarly, a pattern for a "NAND" instruction should be written
+
+ (define_insn ""
+ [(set (match_operand:M 0 ...)
+ (ior:M (not:M (match_operand:M 1 ...))
+ (not:M (match_operand:M 2 ...))))]
+ "..."
+ "...")
+
+ In both cases, it is not necessary to include patterns for the many
+ logically equivalent RTL expressions.
+
+ * The only possible RTL expressions involving both bitwise
+ exclusive-or and bitwise negation are `(xor:M X Y)' and `(not:M
+ (xor:M X Y))'.
+
+ * The sum of three items, one of which is a constant, will only
+ appear in the form
+
+ (plus:M (plus:M X Y) CONSTANT)
+
+ * On machines that do not use `cc0', `(compare X (const_int 0))'
+ will be converted to X.
+
+ * Equality comparisons of a group of bits (usually a single bit)
+ with zero will be written using `zero_extract' rather than the
+ equivalent `and' or `sign_extract' operations.
+
+
+ Further canonicalization rules are defined in the function
+`commutative_operand_precedence' in `gcc/rtlanal.c'.
+
+
+File: gccint.info, Node: Expander Definitions, Next: Insn Splitting, Prev: Insn Canonicalizations, Up: Machine Desc
+
+16.15 Defining RTL Sequences for Code Generation
+================================================
+
+On some target machines, some standard pattern names for RTL generation
+cannot be handled with single insn, but a sequence of RTL insns can
+represent them. For these target machines, you can write a
+`define_expand' to specify how to generate the sequence of RTL.
+
+ A `define_expand' is an RTL expression that looks almost like a
+`define_insn'; but, unlike the latter, a `define_expand' is used only
+for RTL generation and it can produce more than one RTL insn.
+
+ A `define_expand' RTX has four operands:
+
+ * The name. Each `define_expand' must have a name, since the only
+ use for it is to refer to it by name.
+
+ * The RTL template. This is a vector of RTL expressions representing
+ a sequence of separate instructions. Unlike `define_insn', there
+ is no implicit surrounding `PARALLEL'.
+
+ * The condition, a string containing a C expression. This
+ expression is used to express how the availability of this pattern
+ depends on subclasses of target machine, selected by command-line
+ options when GCC is run. This is just like the condition of a
+ `define_insn' that has a standard name. Therefore, the condition
+ (if present) may not depend on the data in the insn being matched,
+ but only the target-machine-type flags. The compiler needs to
+ test these conditions during initialization in order to learn
+ exactly which named instructions are available in a particular run.
+
+ * The preparation statements, a string containing zero or more C
+ statements which are to be executed before RTL code is generated
+ from the RTL template.
+
+ Usually these statements prepare temporary registers for use as
+ internal operands in the RTL template, but they can also generate
+ RTL insns directly by calling routines such as `emit_insn', etc.
+ Any such insns precede the ones that come from the RTL template.
+
+ Every RTL insn emitted by a `define_expand' must match some
+`define_insn' in the machine description. Otherwise, the compiler will
+crash when trying to generate code for the insn or trying to optimize
+it.
+
+ The RTL template, in addition to controlling generation of RTL insns,
+also describes the operands that need to be specified when this pattern
+is used. In particular, it gives a predicate for each operand.
+
+ A true operand, which needs to be specified in order to generate RTL
+from the pattern, should be described with a `match_operand' in its
+first occurrence in the RTL template. This enters information on the
+operand's predicate into the tables that record such things. GCC uses
+the information to preload the operand into a register if that is
+required for valid RTL code. If the operand is referred to more than
+once, subsequent references should use `match_dup'.
+
+ The RTL template may also refer to internal "operands" which are
+temporary registers or labels used only within the sequence made by the
+`define_expand'. Internal operands are substituted into the RTL
+template with `match_dup', never with `match_operand'. The values of
+the internal operands are not passed in as arguments by the compiler
+when it requests use of this pattern. Instead, they are computed
+within the pattern, in the preparation statements. These statements
+compute the values and store them into the appropriate elements of
+`operands' so that `match_dup' can find them.
+
+ There are two special macros defined for use in the preparation
+statements: `DONE' and `FAIL'. Use them with a following semicolon, as
+a statement.
+
+`DONE'
+ Use the `DONE' macro to end RTL generation for the pattern. The
+ only RTL insns resulting from the pattern on this occasion will be
+ those already emitted by explicit calls to `emit_insn' within the
+ preparation statements; the RTL template will not be generated.
+
+`FAIL'
+ Make the pattern fail on this occasion. When a pattern fails, it
+ means that the pattern was not truly available. The calling
+ routines in the compiler will try other strategies for code
+ generation using other patterns.
+
+ Failure is currently supported only for binary (addition,
+ multiplication, shifting, etc.) and bit-field (`extv', `extzv',
+ and `insv') operations.
+
+ If the preparation falls through (invokes neither `DONE' nor `FAIL'),
+then the `define_expand' acts like a `define_insn' in that the RTL
+template is used to generate the insn.
+
+ The RTL template is not used for matching, only for generating the
+initial insn list. If the preparation statement always invokes `DONE'
+or `FAIL', the RTL template may be reduced to a simple list of
+operands, such as this example:
+
+ (define_expand "addsi3"
+ [(match_operand:SI 0 "register_operand" "")
+ (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "register_operand" "")]
+ ""
+ "
+ {
+ handle_add (operands[0], operands[1], operands[2]);
+ DONE;
+ }")
+
+ Here is an example, the definition of left-shift for the SPUR chip:
+
+ (define_expand "ashlsi3"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (ashift:SI
+ (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "nonmemory_operand" "")))]
+ ""
+ "
+
+ {
+ if (GET_CODE (operands[2]) != CONST_INT
+ || (unsigned) INTVAL (operands[2]) > 3)
+ FAIL;
+ }")
+
+This example uses `define_expand' so that it can generate an RTL insn
+for shifting when the shift-count is in the supported range of 0 to 3
+but fail in other cases where machine insns aren't available. When it
+fails, the compiler tries another strategy using different patterns
+(such as, a library call).
+
+ If the compiler were able to handle nontrivial condition-strings in
+patterns with names, then it would be possible to use a `define_insn'
+in that case. Here is another case (zero-extension on the 68000) which
+makes more use of the power of `define_expand':
+
+ (define_expand "zero_extendhisi2"
+ [(set (match_operand:SI 0 "general_operand" "")
+ (const_int 0))
+ (set (strict_low_part
+ (subreg:HI
+ (match_dup 0)
+ 0))
+ (match_operand:HI 1 "general_operand" ""))]
+ ""
+ "operands[1] = make_safe_from (operands[1], operands[0]);")
+
+Here two RTL insns are generated, one to clear the entire output operand
+and the other to copy the input operand into its low half. This
+sequence is incorrect if the input operand refers to [the old value of]
+the output operand, so the preparation statement makes sure this isn't
+so. The function `make_safe_from' copies the `operands[1]' into a
+temporary register if it refers to `operands[0]'. It does this by
+emitting another RTL insn.
+
+ Finally, a third example shows the use of an internal operand.
+Zero-extension on the SPUR chip is done by `and'-ing the result against
+a halfword mask. But this mask cannot be represented by a `const_int'
+because the constant value is too large to be legitimate on this
+machine. So it must be copied into a register with `force_reg' and
+then the register used in the `and'.
+
+ (define_expand "zero_extendhisi2"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (and:SI (subreg:SI
+ (match_operand:HI 1 "register_operand" "")
+ 0)
+ (match_dup 2)))]
+ ""
+ "operands[2]
+ = force_reg (SImode, GEN_INT (65535)); ")
+
+ _Note:_ If the `define_expand' is used to serve a standard binary or
+unary arithmetic operation or a bit-field operation, then the last insn
+it generates must not be a `code_label', `barrier' or `note'. It must
+be an `insn', `jump_insn' or `call_insn'. If you don't need a real insn
+at the end, emit an insn to copy the result of the operation into
+itself. Such an insn will generate no code, but it can avoid problems
+in the compiler.
+
+
+File: gccint.info, Node: Insn Splitting, Next: Including Patterns, Prev: Expander Definitions, Up: Machine Desc
+
+16.16 Defining How to Split Instructions
+========================================
+
+There are two cases where you should specify how to split a pattern
+into multiple insns. On machines that have instructions requiring
+delay slots (*note Delay Slots::) or that have instructions whose
+output is not available for multiple cycles (*note Processor pipeline
+description::), the compiler phases that optimize these cases need to
+be able to move insns into one-instruction delay slots. However, some
+insns may generate more than one machine instruction. These insns
+cannot be placed into a delay slot.
+
+ Often you can rewrite the single insn as a list of individual insns,
+each corresponding to one machine instruction. The disadvantage of
+doing so is that it will cause the compilation to be slower and require
+more space. If the resulting insns are too complex, it may also
+suppress some optimizations. The compiler splits the insn if there is a
+reason to believe that it might improve instruction or delay slot
+scheduling.
+
+ The insn combiner phase also splits putative insns. If three insns are
+merged into one insn with a complex expression that cannot be matched by
+some `define_insn' pattern, the combiner phase attempts to split the
+complex pattern into two insns that are recognized. Usually it can
+break the complex pattern into two patterns by splitting out some
+subexpression. However, in some other cases, such as performing an
+addition of a large constant in two insns on a RISC machine, the way to
+split the addition into two insns is machine-dependent.
+
+ The `define_split' definition tells the compiler how to split a
+complex insn into several simpler insns. It looks like this:
+
+ (define_split
+ [INSN-PATTERN]
+ "CONDITION"
+ [NEW-INSN-PATTERN-1
+ NEW-INSN-PATTERN-2
+ ...]
+ "PREPARATION-STATEMENTS")
+
+ INSN-PATTERN is a pattern that needs to be split and CONDITION is the
+final condition to be tested, as in a `define_insn'. When an insn
+matching INSN-PATTERN and satisfying CONDITION is found, it is replaced
+in the insn list with the insns given by NEW-INSN-PATTERN-1,
+NEW-INSN-PATTERN-2, etc.
+
+ The PREPARATION-STATEMENTS are similar to those statements that are
+specified for `define_expand' (*note Expander Definitions::) and are
+executed before the new RTL is generated to prepare for the generated
+code or emit some insns whose pattern is not fixed. Unlike those in
+`define_expand', however, these statements must not generate any new
+pseudo-registers. Once reload has completed, they also must not
+allocate any space in the stack frame.
+
+ Patterns are matched against INSN-PATTERN in two different
+circumstances. If an insn needs to be split for delay slot scheduling
+or insn scheduling, the insn is already known to be valid, which means
+that it must have been matched by some `define_insn' and, if
+`reload_completed' is nonzero, is known to satisfy the constraints of
+that `define_insn'. In that case, the new insn patterns must also be
+insns that are matched by some `define_insn' and, if `reload_completed'
+is nonzero, must also satisfy the constraints of those definitions.
+
+ As an example of this usage of `define_split', consider the following
+example from `a29k.md', which splits a `sign_extend' from `HImode' to
+`SImode' into a pair of shift insns:
+
+ (define_split
+ [(set (match_operand:SI 0 "gen_reg_operand" "")
+ (sign_extend:SI (match_operand:HI 1 "gen_reg_operand" "")))]
+ ""
+ [(set (match_dup 0)
+ (ashift:SI (match_dup 1)
+ (const_int 16)))
+ (set (match_dup 0)
+ (ashiftrt:SI (match_dup 0)
+ (const_int 16)))]
+ "
+ { operands[1] = gen_lowpart (SImode, operands[1]); }")
+
+ When the combiner phase tries to split an insn pattern, it is always
+the case that the pattern is _not_ matched by any `define_insn'. The
+combiner pass first tries to split a single `set' expression and then
+the same `set' expression inside a `parallel', but followed by a
+`clobber' of a pseudo-reg to use as a scratch register. In these
+cases, the combiner expects exactly two new insn patterns to be
+generated. It will verify that these patterns match some `define_insn'
+definitions, so you need not do this test in the `define_split' (of
+course, there is no point in writing a `define_split' that will never
+produce insns that match).
+
+ Here is an example of this use of `define_split', taken from
+`rs6000.md':
+
+ (define_split
+ [(set (match_operand:SI 0 "gen_reg_operand" "")
+ (plus:SI (match_operand:SI 1 "gen_reg_operand" "")
+ (match_operand:SI 2 "non_add_cint_operand" "")))]
+ ""
+ [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 3)))
+ (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 4)))]
+ "
+ {
+ int low = INTVAL (operands[2]) & 0xffff;
+ int high = (unsigned) INTVAL (operands[2]) >> 16;
+
+ if (low & 0x8000)
+ high++, low |= 0xffff0000;
+
+ operands[3] = GEN_INT (high << 16);
+ operands[4] = GEN_INT (low);
+ }")
+
+ Here the predicate `non_add_cint_operand' matches any `const_int' that
+is _not_ a valid operand of a single add insn. The add with the
+smaller displacement is written so that it can be substituted into the
+address of a subsequent operation.
+
+ An example that uses a scratch register, from the same file, generates
+an equality comparison of a register and a large constant:
+
+ (define_split
+ [(set (match_operand:CC 0 "cc_reg_operand" "")
+ (compare:CC (match_operand:SI 1 "gen_reg_operand" "")
+ (match_operand:SI 2 "non_short_cint_operand" "")))
+ (clobber (match_operand:SI 3 "gen_reg_operand" ""))]
+ "find_single_use (operands[0], insn, 0)
+ && (GET_CODE (*find_single_use (operands[0], insn, 0)) == EQ
+ || GET_CODE (*find_single_use (operands[0], insn, 0)) == NE)"
+ [(set (match_dup 3) (xor:SI (match_dup 1) (match_dup 4)))
+ (set (match_dup 0) (compare:CC (match_dup 3) (match_dup 5)))]
+ "
+ {
+ /* Get the constant we are comparing against, C, and see what it
+ looks like sign-extended to 16 bits. Then see what constant
+ could be XOR'ed with C to get the sign-extended value. */
+
+ int c = INTVAL (operands[2]);
+ int sextc = (c << 16) >> 16;
+ int xorv = c ^ sextc;
+
+ operands[4] = GEN_INT (xorv);
+ operands[5] = GEN_INT (sextc);
+ }")
+
+ To avoid confusion, don't write a single `define_split' that accepts
+some insns that match some `define_insn' as well as some insns that
+don't. Instead, write two separate `define_split' definitions, one for
+the insns that are valid and one for the insns that are not valid.
+
+ The splitter is allowed to split jump instructions into sequence of
+jumps or create new jumps in while splitting non-jump instructions. As
+the central flowgraph and branch prediction information needs to be
+updated, several restriction apply.
+
+ Splitting of jump instruction into sequence that over by another jump
+instruction is always valid, as compiler expect identical behavior of
+new jump. When new sequence contains multiple jump instructions or new
+labels, more assistance is needed. Splitter is required to create only
+unconditional jumps, or simple conditional jump instructions.
+Additionally it must attach a `REG_BR_PROB' note to each conditional
+jump. A global variable `split_branch_probability' holds the
+probability of the original branch in case it was an simple conditional
+jump, -1 otherwise. To simplify recomputing of edge frequencies, the
+new sequence is required to have only forward jumps to the newly
+created labels.
+
+ For the common case where the pattern of a define_split exactly
+matches the pattern of a define_insn, use `define_insn_and_split'. It
+looks like this:
+
+ (define_insn_and_split
+ [INSN-PATTERN]
+ "CONDITION"
+ "OUTPUT-TEMPLATE"
+ "SPLIT-CONDITION"
+ [NEW-INSN-PATTERN-1
+ NEW-INSN-PATTERN-2
+ ...]
+ "PREPARATION-STATEMENTS"
+ [INSN-ATTRIBUTES])
+
+ INSN-PATTERN, CONDITION, OUTPUT-TEMPLATE, and INSN-ATTRIBUTES are used
+as in `define_insn'. The NEW-INSN-PATTERN vector and the
+PREPARATION-STATEMENTS are used as in a `define_split'. The
+SPLIT-CONDITION is also used as in `define_split', with the additional
+behavior that if the condition starts with `&&', the condition used for
+the split will be the constructed as a logical "and" of the split
+condition with the insn condition. For example, from i386.md:
+
+ (define_insn_and_split "zero_extendhisi2_and"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (zero_extend:SI (match_operand:HI 1 "register_operand" "0")))
+ (clobber (reg:CC 17))]
+ "TARGET_ZERO_EXTEND_WITH_AND && !optimize_size"
+ "#"
+ "&& reload_completed"
+ [(parallel [(set (match_dup 0)
+ (and:SI (match_dup 0) (const_int 65535)))
+ (clobber (reg:CC 17))])]
+ ""
+ [(set_attr "type" "alu1")])
+
+ In this case, the actual split condition will be
+`TARGET_ZERO_EXTEND_WITH_AND && !optimize_size && reload_completed'.
+
+ The `define_insn_and_split' construction provides exactly the same
+functionality as two separate `define_insn' and `define_split'
+patterns. It exists for compactness, and as a maintenance tool to
+prevent having to ensure the two patterns' templates match.
+
+
+File: gccint.info, Node: Including Patterns, Next: Peephole Definitions, Prev: Insn Splitting, Up: Machine Desc
+
+16.17 Including Patterns in Machine Descriptions.
+=================================================
+
+The `include' pattern tells the compiler tools where to look for
+patterns that are in files other than in the file `.md'. This is used
+only at build time and there is no preprocessing allowed.
+
+ It looks like:
+
+
+ (include
+ PATHNAME)
+
+ For example:
+
+
+ (include "filestuff")
+
+ Where PATHNAME is a string that specifies the location of the file,
+specifies the include file to be in `gcc/config/target/filestuff'. The
+directory `gcc/config/target' is regarded as the default directory.
+
+ Machine descriptions may be split up into smaller more manageable
+subsections and placed into subdirectories.
+
+ By specifying:
+
+
+ (include "BOGUS/filestuff")
+
+ the include file is specified to be in
+`gcc/config/TARGET/BOGUS/filestuff'.
+
+ Specifying an absolute path for the include file such as;
+
+ (include "/u2/BOGUS/filestuff")
+ is permitted but is not encouraged.
+
+16.17.1 RTL Generation Tool Options for Directory Search
+--------------------------------------------------------
+
+The `-IDIR' option specifies directories to search for machine
+descriptions. For example:
+
+
+ genrecog -I/p1/abc/proc1 -I/p2/abcd/pro2 target.md
+
+ Add the directory DIR to the head of the list of directories to be
+searched for header files. This can be used to override a system
+machine definition file, substituting your own version, since these
+directories are searched before the default machine description file
+directories. If you use more than one `-I' option, the directories are
+scanned in left-to-right order; the standard default directory come
+after.
+
+
+File: gccint.info, Node: Peephole Definitions, Next: Insn Attributes, Prev: Including Patterns, Up: Machine Desc
+
+16.18 Machine-Specific Peephole Optimizers
+==========================================
+
+In addition to instruction patterns the `md' file may contain
+definitions of machine-specific peephole optimizations.
+
+ The combiner does not notice certain peephole optimizations when the
+data flow in the program does not suggest that it should try them. For
+example, sometimes two consecutive insns related in purpose can be
+combined even though the second one does not appear to use a register
+computed in the first one. A machine-specific peephole optimizer can
+detect such opportunities.
+
+ There are two forms of peephole definitions that may be used. The
+original `define_peephole' is run at assembly output time to match
+insns and substitute assembly text. Use of `define_peephole' is
+deprecated.
+
+ A newer `define_peephole2' matches insns and substitutes new insns.
+The `peephole2' pass is run after register allocation but before
+scheduling, which may result in much better code for targets that do
+scheduling.
+
+* Menu:
+
+* define_peephole:: RTL to Text Peephole Optimizers
+* define_peephole2:: RTL to RTL Peephole Optimizers
+
+
+File: gccint.info, Node: define_peephole, Next: define_peephole2, Up: Peephole Definitions
+
+16.18.1 RTL to Text Peephole Optimizers
+---------------------------------------
+
+A definition looks like this:
+
+ (define_peephole
+ [INSN-PATTERN-1
+ INSN-PATTERN-2
+ ...]
+ "CONDITION"
+ "TEMPLATE"
+ "OPTIONAL-INSN-ATTRIBUTES")
+
+The last string operand may be omitted if you are not using any
+machine-specific information in this machine description. If present,
+it must obey the same rules as in a `define_insn'.
+
+ In this skeleton, INSN-PATTERN-1 and so on are patterns to match
+consecutive insns. The optimization applies to a sequence of insns when
+INSN-PATTERN-1 matches the first one, INSN-PATTERN-2 matches the next,
+and so on.
+
+ Each of the insns matched by a peephole must also match a
+`define_insn'. Peepholes are checked only at the last stage just
+before code generation, and only optionally. Therefore, any insn which
+would match a peephole but no `define_insn' will cause a crash in code
+generation in an unoptimized compilation, or at various optimization
+stages.
+
+ The operands of the insns are matched with `match_operands',
+`match_operator', and `match_dup', as usual. What is not usual is that
+the operand numbers apply to all the insn patterns in the definition.
+So, you can check for identical operands in two insns by using
+`match_operand' in one insn and `match_dup' in the other.
+
+ The operand constraints used in `match_operand' patterns do not have
+any direct effect on the applicability of the peephole, but they will
+be validated afterward, so make sure your constraints are general enough
+to apply whenever the peephole matches. If the peephole matches but
+the constraints are not satisfied, the compiler will crash.
+
+ It is safe to omit constraints in all the operands of the peephole; or
+you can write constraints which serve as a double-check on the criteria
+previously tested.
+
+ Once a sequence of insns matches the patterns, the CONDITION is
+checked. This is a C expression which makes the final decision whether
+to perform the optimization (we do so if the expression is nonzero). If
+CONDITION is omitted (in other words, the string is empty) then the
+optimization is applied to every sequence of insns that matches the
+patterns.
+
+ The defined peephole optimizations are applied after register
+allocation is complete. Therefore, the peephole definition can check
+which operands have ended up in which kinds of registers, just by
+looking at the operands.
+
+ The way to refer to the operands in CONDITION is to write
+`operands[I]' for operand number I (as matched by `(match_operand I
+...)'). Use the variable `insn' to refer to the last of the insns
+being matched; use `prev_active_insn' to find the preceding insns.
+
+ When optimizing computations with intermediate results, you can use
+CONDITION to match only when the intermediate results are not used
+elsewhere. Use the C expression `dead_or_set_p (INSN, OP)', where INSN
+is the insn in which you expect the value to be used for the last time
+(from the value of `insn', together with use of `prev_nonnote_insn'),
+and OP is the intermediate value (from `operands[I]').
+
+ Applying the optimization means replacing the sequence of insns with
+one new insn. The TEMPLATE controls ultimate output of assembler code
+for this combined insn. It works exactly like the template of a
+`define_insn'. Operand numbers in this template are the same ones used
+in matching the original sequence of insns.
+
+ The result of a defined peephole optimizer does not need to match any
+of the insn patterns in the machine description; it does not even have
+an opportunity to match them. The peephole optimizer definition itself
+serves as the insn pattern to control how the insn is output.
+
+ Defined peephole optimizers are run as assembler code is being output,
+so the insns they produce are never combined or rearranged in any way.
+
+ Here is an example, taken from the 68000 machine description:
+
+ (define_peephole
+ [(set (reg:SI 15) (plus:SI (reg:SI 15) (const_int 4)))
+ (set (match_operand:DF 0 "register_operand" "=f")
+ (match_operand:DF 1 "register_operand" "ad"))]
+ "FP_REG_P (operands[0]) && ! FP_REG_P (operands[1])"
+ {
+ rtx xoperands[2];
+ xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
+ #ifdef MOTOROLA
+ output_asm_insn ("move.l %1,(sp)", xoperands);
+ output_asm_insn ("move.l %1,-(sp)", operands);
+ return "fmove.d (sp)+,%0";
+ #else
+ output_asm_insn ("movel %1,sp@", xoperands);
+ output_asm_insn ("movel %1,sp@-", operands);
+ return "fmoved sp@+,%0";
+ #endif
+ })
+
+ The effect of this optimization is to change
+
+ jbsr _foobar
+ addql #4,sp
+ movel d1,sp@-
+ movel d0,sp@-
+ fmoved sp@+,fp0
+
+into
+
+ jbsr _foobar
+ movel d1,sp@
+ movel d0,sp@-
+ fmoved sp@+,fp0
+
+ INSN-PATTERN-1 and so on look _almost_ like the second operand of
+`define_insn'. There is one important difference: the second operand
+of `define_insn' consists of one or more RTX's enclosed in square
+brackets. Usually, there is only one: then the same action can be
+written as an element of a `define_peephole'. But when there are
+multiple actions in a `define_insn', they are implicitly enclosed in a
+`parallel'. Then you must explicitly write the `parallel', and the
+square brackets within it, in the `define_peephole'. Thus, if an insn
+pattern looks like this,
+
+ (define_insn "divmodsi4"
+ [(set (match_operand:SI 0 "general_operand" "=d")
+ (div:SI (match_operand:SI 1 "general_operand" "0")
+ (match_operand:SI 2 "general_operand" "dmsK")))
+ (set (match_operand:SI 3 "general_operand" "=d")
+ (mod:SI (match_dup 1) (match_dup 2)))]
+ "TARGET_68020"
+ "divsl%.l %2,%3:%0")
+
+then the way to mention this insn in a peephole is as follows:
+
+ (define_peephole
+ [...
+ (parallel
+ [(set (match_operand:SI 0 "general_operand" "=d")
+ (div:SI (match_operand:SI 1 "general_operand" "0")
+ (match_operand:SI 2 "general_operand" "dmsK")))
+ (set (match_operand:SI 3 "general_operand" "=d")
+ (mod:SI (match_dup 1) (match_dup 2)))])
+ ...]
+ ...)
+
+
+File: gccint.info, Node: define_peephole2, Prev: define_peephole, Up: Peephole Definitions
+
+16.18.2 RTL to RTL Peephole Optimizers
+--------------------------------------
+
+The `define_peephole2' definition tells the compiler how to substitute
+one sequence of instructions for another sequence, what additional
+scratch registers may be needed and what their lifetimes must be.
+
+ (define_peephole2
+ [INSN-PATTERN-1
+ INSN-PATTERN-2
+ ...]
+ "CONDITION"
+ [NEW-INSN-PATTERN-1
+ NEW-INSN-PATTERN-2
+ ...]
+ "PREPARATION-STATEMENTS")
+
+ The definition is almost identical to `define_split' (*note Insn
+Splitting::) except that the pattern to match is not a single
+instruction, but a sequence of instructions.
+
+ It is possible to request additional scratch registers for use in the
+output template. If appropriate registers are not free, the pattern
+will simply not match.
+
+ Scratch registers are requested with a `match_scratch' pattern at the
+top level of the input pattern. The allocated register (initially) will
+be dead at the point requested within the original sequence. If the
+scratch is used at more than a single point, a `match_dup' pattern at
+the top level of the input pattern marks the last position in the input
+sequence at which the register must be available.
+
+ Here is an example from the IA-32 machine description:
+
+ (define_peephole2
+ [(match_scratch:SI 2 "r")
+ (parallel [(set (match_operand:SI 0 "register_operand" "")
+ (match_operator:SI 3 "arith_or_logical_operator"
+ [(match_dup 0)
+ (match_operand:SI 1 "memory_operand" "")]))
+ (clobber (reg:CC 17))])]
+ "! optimize_size && ! TARGET_READ_MODIFY"
+ [(set (match_dup 2) (match_dup 1))
+ (parallel [(set (match_dup 0)
+ (match_op_dup 3 [(match_dup 0) (match_dup 2)]))
+ (clobber (reg:CC 17))])]
+ "")
+
+This pattern tries to split a load from its use in the hopes that we'll
+be able to schedule around the memory load latency. It allocates a
+single `SImode' register of class `GENERAL_REGS' (`"r"') that needs to
+be live only at the point just before the arithmetic.
+
+ A real example requiring extended scratch lifetimes is harder to come
+by, so here's a silly made-up example:
+
+ (define_peephole2
+ [(match_scratch:SI 4 "r")
+ (set (match_operand:SI 0 "" "") (match_operand:SI 1 "" ""))
+ (set (match_operand:SI 2 "" "") (match_dup 1))
+ (match_dup 4)
+ (set (match_operand:SI 3 "" "") (match_dup 1))]
+ "/* determine 1 does not overlap 0 and 2 */"
+ [(set (match_dup 4) (match_dup 1))
+ (set (match_dup 0) (match_dup 4))
+ (set (match_dup 2) (match_dup 4))]
+ (set (match_dup 3) (match_dup 4))]
+ "")
+
+If we had not added the `(match_dup 4)' in the middle of the input
+sequence, it might have been the case that the register we chose at the
+beginning of the sequence is killed by the first or second `set'.
+
+
+File: gccint.info, Node: Insn Attributes, Next: Conditional Execution, Prev: Peephole Definitions, Up: Machine Desc
+
+16.19 Instruction Attributes
+============================
+
+In addition to describing the instruction supported by the target
+machine, the `md' file also defines a group of "attributes" and a set of
+values for each. Every generated insn is assigned a value for each
+attribute. One possible attribute would be the effect that the insn
+has on the machine's condition code. This attribute can then be used
+by `NOTICE_UPDATE_CC' to track the condition codes.
+
+* Menu:
+
+* Defining Attributes:: Specifying attributes and their values.
+* Expressions:: Valid expressions for attribute values.
+* Tagging Insns:: Assigning attribute values to insns.
+* Attr Example:: An example of assigning attributes.
+* Insn Lengths:: Computing the length of insns.
+* Constant Attributes:: Defining attributes that are constant.
+* Delay Slots:: Defining delay slots required for a machine.
+* Processor pipeline description:: Specifying information for insn scheduling.
+
+
+File: gccint.info, Node: Defining Attributes, Next: Expressions, Up: Insn Attributes
+
+16.19.1 Defining Attributes and their Values
+--------------------------------------------
+
+The `define_attr' expression is used to define each attribute required
+by the target machine. It looks like:
+
+ (define_attr NAME LIST-OF-VALUES DEFAULT)
+
+ NAME is a string specifying the name of the attribute being defined.
+
+ LIST-OF-VALUES is either a string that specifies a comma-separated
+list of values that can be assigned to the attribute, or a null string
+to indicate that the attribute takes numeric values.
+
+ DEFAULT is an attribute expression that gives the value of this
+attribute for insns that match patterns whose definition does not
+include an explicit value for this attribute. *Note Attr Example::,
+for more information on the handling of defaults. *Note Constant
+Attributes::, for information on attributes that do not depend on any
+particular insn.
+
+ For each defined attribute, a number of definitions are written to the
+`insn-attr.h' file. For cases where an explicit set of values is
+specified for an attribute, the following are defined:
+
+ * A `#define' is written for the symbol `HAVE_ATTR_NAME'.
+
+ * An enumerated class is defined for `attr_NAME' with elements of
+ the form `UPPER-NAME_UPPER-VALUE' where the attribute name and
+ value are first converted to uppercase.
+
+ * A function `get_attr_NAME' is defined that is passed an insn and
+ returns the attribute value for that insn.
+
+ For example, if the following is present in the `md' file:
+
+ (define_attr "type" "branch,fp,load,store,arith" ...)
+
+the following lines will be written to the file `insn-attr.h'.
+
+ #define HAVE_ATTR_type
+ enum attr_type {TYPE_BRANCH, TYPE_FP, TYPE_LOAD,
+ TYPE_STORE, TYPE_ARITH};
+ extern enum attr_type get_attr_type ();
+
+ If the attribute takes numeric values, no `enum' type will be defined
+and the function to obtain the attribute's value will return `int'.
+
+ There are attributes which are tied to a specific meaning. These
+attributes are not free to use for other purposes:
+
+`length'
+ The `length' attribute is used to calculate the length of emitted
+ code chunks. This is especially important when verifying branch
+ distances. *Note Insn Lengths::.
+
+`enabled'
+ The `enabled' attribute can be defined to prevent certain
+ alternatives of an insn definition from being used during code
+ generation. *Note Disable Insn Alternatives::.
+
+
+
+File: gccint.info, Node: Expressions, Next: Tagging Insns, Prev: Defining Attributes, Up: Insn Attributes
+
+16.19.2 Attribute Expressions
+-----------------------------
+
+RTL expressions used to define attributes use the codes described above
+plus a few specific to attribute definitions, to be discussed below.
+Attribute value expressions must have one of the following forms:
+
+`(const_int I)'
+ The integer I specifies the value of a numeric attribute. I must
+ be non-negative.
+
+ The value of a numeric attribute can be specified either with a
+ `const_int', or as an integer represented as a string in
+ `const_string', `eq_attr' (see below), `attr', `symbol_ref',
+ simple arithmetic expressions, and `set_attr' overrides on
+ specific instructions (*note Tagging Insns::).
+
+`(const_string VALUE)'
+ The string VALUE specifies a constant attribute value. If VALUE
+ is specified as `"*"', it means that the default value of the
+ attribute is to be used for the insn containing this expression.
+ `"*"' obviously cannot be used in the DEFAULT expression of a
+ `define_attr'.
+
+ If the attribute whose value is being specified is numeric, VALUE
+ must be a string containing a non-negative integer (normally
+ `const_int' would be used in this case). Otherwise, it must
+ contain one of the valid values for the attribute.
+
+`(if_then_else TEST TRUE-VALUE FALSE-VALUE)'
+ TEST specifies an attribute test, whose format is defined below.
+ The value of this expression is TRUE-VALUE if TEST is true,
+ otherwise it is FALSE-VALUE.
+
+`(cond [TEST1 VALUE1 ...] DEFAULT)'
+ The first operand of this expression is a vector containing an even
+ number of expressions and consisting of pairs of TEST and VALUE
+ expressions. The value of the `cond' expression is that of the
+ VALUE corresponding to the first true TEST expression. If none of
+ the TEST expressions are true, the value of the `cond' expression
+ is that of the DEFAULT expression.
+
+ TEST expressions can have one of the following forms:
+
+`(const_int I)'
+ This test is true if I is nonzero and false otherwise.
+
+`(not TEST)'
+`(ior TEST1 TEST2)'
+`(and TEST1 TEST2)'
+ These tests are true if the indicated logical function is true.
+
+`(match_operand:M N PRED CONSTRAINTS)'
+ This test is true if operand N of the insn whose attribute value
+ is being determined has mode M (this part of the test is ignored
+ if M is `VOIDmode') and the function specified by the string PRED
+ returns a nonzero value when passed operand N and mode M (this
+ part of the test is ignored if PRED is the null string).
+
+ The CONSTRAINTS operand is ignored and should be the null string.
+
+`(le ARITH1 ARITH2)'
+`(leu ARITH1 ARITH2)'
+`(lt ARITH1 ARITH2)'
+`(ltu ARITH1 ARITH2)'
+`(gt ARITH1 ARITH2)'
+`(gtu ARITH1 ARITH2)'
+`(ge ARITH1 ARITH2)'
+`(geu ARITH1 ARITH2)'
+`(ne ARITH1 ARITH2)'
+`(eq ARITH1 ARITH2)'
+ These tests are true if the indicated comparison of the two
+ arithmetic expressions is true. Arithmetic expressions are formed
+ with `plus', `minus', `mult', `div', `mod', `abs', `neg', `and',
+ `ior', `xor', `not', `ashift', `lshiftrt', and `ashiftrt'
+ expressions.
+
+ `const_int' and `symbol_ref' are always valid terms (*note Insn
+ Lengths::,for additional forms). `symbol_ref' is a string
+ denoting a C expression that yields an `int' when evaluated by the
+ `get_attr_...' routine. It should normally be a global variable.
+
+`(eq_attr NAME VALUE)'
+ NAME is a string specifying the name of an attribute.
+
+ VALUE is a string that is either a valid value for attribute NAME,
+ a comma-separated list of values, or `!' followed by a value or
+ list. If VALUE does not begin with a `!', this test is true if
+ the value of the NAME attribute of the current insn is in the list
+ specified by VALUE. If VALUE begins with a `!', this test is true
+ if the attribute's value is _not_ in the specified list.
+
+ For example,
+
+ (eq_attr "type" "load,store")
+
+ is equivalent to
+
+ (ior (eq_attr "type" "load") (eq_attr "type" "store"))
+
+ If NAME specifies an attribute of `alternative', it refers to the
+ value of the compiler variable `which_alternative' (*note Output
+ Statement::) and the values must be small integers. For example,
+
+ (eq_attr "alternative" "2,3")
+
+ is equivalent to
+
+ (ior (eq (symbol_ref "which_alternative") (const_int 2))
+ (eq (symbol_ref "which_alternative") (const_int 3)))
+
+ Note that, for most attributes, an `eq_attr' test is simplified in
+ cases where the value of the attribute being tested is known for
+ all insns matching a particular pattern. This is by far the most
+ common case.
+
+`(attr_flag NAME)'
+ The value of an `attr_flag' expression is true if the flag
+ specified by NAME is true for the `insn' currently being scheduled.
+
+ NAME is a string specifying one of a fixed set of flags to test.
+ Test the flags `forward' and `backward' to determine the direction
+ of a conditional branch. Test the flags `very_likely', `likely',
+ `very_unlikely', and `unlikely' to determine if a conditional
+ branch is expected to be taken.
+
+ If the `very_likely' flag is true, then the `likely' flag is also
+ true. Likewise for the `very_unlikely' and `unlikely' flags.
+
+ This example describes a conditional branch delay slot which can
+ be nullified for forward branches that are taken (annul-true) or
+ for backward branches which are not taken (annul-false).
+
+ (define_delay (eq_attr "type" "cbranch")
+ [(eq_attr "in_branch_delay" "true")
+ (and (eq_attr "in_branch_delay" "true")
+ (attr_flag "forward"))
+ (and (eq_attr "in_branch_delay" "true")
+ (attr_flag "backward"))])
+
+ The `forward' and `backward' flags are false if the current `insn'
+ being scheduled is not a conditional branch.
+
+ The `very_likely' and `likely' flags are true if the `insn' being
+ scheduled is not a conditional branch. The `very_unlikely' and
+ `unlikely' flags are false if the `insn' being scheduled is not a
+ conditional branch.
+
+ `attr_flag' is only used during delay slot scheduling and has no
+ meaning to other passes of the compiler.
+
+`(attr NAME)'
+ The value of another attribute is returned. This is most useful
+ for numeric attributes, as `eq_attr' and `attr_flag' produce more
+ efficient code for non-numeric attributes.
+
+
+File: gccint.info, Node: Tagging Insns, Next: Attr Example, Prev: Expressions, Up: Insn Attributes
+
+16.19.3 Assigning Attribute Values to Insns
+-------------------------------------------
+
+The value assigned to an attribute of an insn is primarily determined by
+which pattern is matched by that insn (or which `define_peephole'
+generated it). Every `define_insn' and `define_peephole' can have an
+optional last argument to specify the values of attributes for matching
+insns. The value of any attribute not specified in a particular insn
+is set to the default value for that attribute, as specified in its
+`define_attr'. Extensive use of default values for attributes permits
+the specification of the values for only one or two attributes in the
+definition of most insn patterns, as seen in the example in the next
+section.
+
+ The optional last argument of `define_insn' and `define_peephole' is a
+vector of expressions, each of which defines the value for a single
+attribute. The most general way of assigning an attribute's value is
+to use a `set' expression whose first operand is an `attr' expression
+giving the name of the attribute being set. The second operand of the
+`set' is an attribute expression (*note Expressions::) giving the value
+of the attribute.
+
+ When the attribute value depends on the `alternative' attribute (i.e.,
+which is the applicable alternative in the constraint of the insn), the
+`set_attr_alternative' expression can be used. It allows the
+specification of a vector of attribute expressions, one for each
+alternative.
+
+ When the generality of arbitrary attribute expressions is not required,
+the simpler `set_attr' expression can be used, which allows specifying
+a string giving either a single attribute value or a list of attribute
+values, one for each alternative.
+
+ The form of each of the above specifications is shown below. In each
+case, NAME is a string specifying the attribute to be set.
+
+`(set_attr NAME VALUE-STRING)'
+ VALUE-STRING is either a string giving the desired attribute value,
+ or a string containing a comma-separated list giving the values for
+ succeeding alternatives. The number of elements must match the
+ number of alternatives in the constraint of the insn pattern.
+
+ Note that it may be useful to specify `*' for some alternative, in
+ which case the attribute will assume its default value for insns
+ matching that alternative.
+
+`(set_attr_alternative NAME [VALUE1 VALUE2 ...])'
+ Depending on the alternative of the insn, the value will be one of
+ the specified values. This is a shorthand for using a `cond' with
+ tests on the `alternative' attribute.
+
+`(set (attr NAME) VALUE)'
+ The first operand of this `set' must be the special RTL expression
+ `attr', whose sole operand is a string giving the name of the
+ attribute being set. VALUE is the value of the attribute.
+
+ The following shows three different ways of representing the same
+attribute value specification:
+
+ (set_attr "type" "load,store,arith")
+
+ (set_attr_alternative "type"
+ [(const_string "load") (const_string "store")
+ (const_string "arith")])
+
+ (set (attr "type")
+ (cond [(eq_attr "alternative" "1") (const_string "load")
+ (eq_attr "alternative" "2") (const_string "store")]
+ (const_string "arith")))
+
+ The `define_asm_attributes' expression provides a mechanism to specify
+the attributes assigned to insns produced from an `asm' statement. It
+has the form:
+
+ (define_asm_attributes [ATTR-SETS])
+
+where ATTR-SETS is specified the same as for both the `define_insn' and
+the `define_peephole' expressions.
+
+ These values will typically be the "worst case" attribute values. For
+example, they might indicate that the condition code will be clobbered.
+
+ A specification for a `length' attribute is handled specially. The
+way to compute the length of an `asm' insn is to multiply the length
+specified in the expression `define_asm_attributes' by the number of
+machine instructions specified in the `asm' statement, determined by
+counting the number of semicolons and newlines in the string.
+Therefore, the value of the `length' attribute specified in a
+`define_asm_attributes' should be the maximum possible length of a
+single machine instruction.
+
+
+File: gccint.info, Node: Attr Example, Next: Insn Lengths, Prev: Tagging Insns, Up: Insn Attributes
+
+16.19.4 Example of Attribute Specifications
+-------------------------------------------
+
+The judicious use of defaulting is important in the efficient use of
+insn attributes. Typically, insns are divided into "types" and an
+attribute, customarily called `type', is used to represent this value.
+This attribute is normally used only to define the default value for
+other attributes. An example will clarify this usage.
+
+ Assume we have a RISC machine with a condition code and in which only
+full-word operations are performed in registers. Let us assume that we
+can divide all insns into loads, stores, (integer) arithmetic
+operations, floating point operations, and branches.
+
+ Here we will concern ourselves with determining the effect of an insn
+on the condition code and will limit ourselves to the following possible
+effects: The condition code can be set unpredictably (clobbered), not
+be changed, be set to agree with the results of the operation, or only
+changed if the item previously set into the condition code has been
+modified.
+
+ Here is part of a sample `md' file for such a machine:
+
+ (define_attr "type" "load,store,arith,fp,branch" (const_string "arith"))
+
+ (define_attr "cc" "clobber,unchanged,set,change0"
+ (cond [(eq_attr "type" "load")
+ (const_string "change0")
+ (eq_attr "type" "store,branch")
+ (const_string "unchanged")
+ (eq_attr "type" "arith")
+ (if_then_else (match_operand:SI 0 "" "")
+ (const_string "set")
+ (const_string "clobber"))]
+ (const_string "clobber")))
+
+ (define_insn ""
+ [(set (match_operand:SI 0 "general_operand" "=r,r,m")
+ (match_operand:SI 1 "general_operand" "r,m,r"))]
+ ""
+ "@
+ move %0,%1
+ load %0,%1
+ store %0,%1"
+ [(set_attr "type" "arith,load,store")])
+
+ Note that we assume in the above example that arithmetic operations
+performed on quantities smaller than a machine word clobber the
+condition code since they will set the condition code to a value
+corresponding to the full-word result.
+
+
+File: gccint.info, Node: Insn Lengths, Next: Constant Attributes, Prev: Attr Example, Up: Insn Attributes
+
+16.19.5 Computing the Length of an Insn
+---------------------------------------
+
+For many machines, multiple types of branch instructions are provided,
+each for different length branch displacements. In most cases, the
+assembler will choose the correct instruction to use. However, when
+the assembler cannot do so, GCC can when a special attribute, the
+`length' attribute, is defined. This attribute must be defined to have
+numeric values by specifying a null string in its `define_attr'.
+
+ In the case of the `length' attribute, two additional forms of
+arithmetic terms are allowed in test expressions:
+
+`(match_dup N)'
+ This refers to the address of operand N of the current insn, which
+ must be a `label_ref'.
+
+`(pc)'
+ This refers to the address of the _current_ insn. It might have
+ been more consistent with other usage to make this the address of
+ the _next_ insn but this would be confusing because the length of
+ the current insn is to be computed.
+
+ For normal insns, the length will be determined by value of the
+`length' attribute. In the case of `addr_vec' and `addr_diff_vec' insn
+patterns, the length is computed as the number of vectors multiplied by
+the size of each vector.
+
+ Lengths are measured in addressable storage units (bytes).
+
+ The following macros can be used to refine the length computation:
+
+`ADJUST_INSN_LENGTH (INSN, LENGTH)'
+ If defined, modifies the length assigned to instruction INSN as a
+ function of the context in which it is used. LENGTH is an lvalue
+ that contains the initially computed length of the insn and should
+ be updated with the correct length of the insn.
+
+ This macro will normally not be required. A case in which it is
+ required is the ROMP. On this machine, the size of an `addr_vec'
+ insn must be increased by two to compensate for the fact that
+ alignment may be required.
+
+ The routine that returns `get_attr_length' (the value of the `length'
+attribute) can be used by the output routine to determine the form of
+the branch instruction to be written, as the example below illustrates.
+
+ As an example of the specification of variable-length branches,
+consider the IBM 360. If we adopt the convention that a register will
+be set to the starting address of a function, we can jump to labels
+within 4k of the start using a four-byte instruction. Otherwise, we
+need a six-byte sequence to load the address from memory and then
+branch to it.
+
+ On such a machine, a pattern for a branch instruction might be
+specified as follows:
+
+ (define_insn "jump"
+ [(set (pc)
+ (label_ref (match_operand 0 "" "")))]
+ ""
+ {
+ return (get_attr_length (insn) == 4
+ ? "b %l0" : "l r15,=a(%l0); br r15");
+ }
+ [(set (attr "length")
+ (if_then_else (lt (match_dup 0) (const_int 4096))
+ (const_int 4)
+ (const_int 6)))])
+
+
+File: gccint.info, Node: Constant Attributes, Next: Delay Slots, Prev: Insn Lengths, Up: Insn Attributes
+
+16.19.6 Constant Attributes
+---------------------------
+
+A special form of `define_attr', where the expression for the default
+value is a `const' expression, indicates an attribute that is constant
+for a given run of the compiler. Constant attributes may be used to
+specify which variety of processor is used. For example,
+
+ (define_attr "cpu" "m88100,m88110,m88000"
+ (const
+ (cond [(symbol_ref "TARGET_88100") (const_string "m88100")
+ (symbol_ref "TARGET_88110") (const_string "m88110")]
+ (const_string "m88000"))))
+
+ (define_attr "memory" "fast,slow"
+ (const
+ (if_then_else (symbol_ref "TARGET_FAST_MEM")
+ (const_string "fast")
+ (const_string "slow"))))
+
+ The routine generated for constant attributes has no parameters as it
+does not depend on any particular insn. RTL expressions used to define
+the value of a constant attribute may use the `symbol_ref' form, but
+may not use either the `match_operand' form or `eq_attr' forms
+involving insn attributes.
+
+
+File: gccint.info, Node: Delay Slots, Next: Processor pipeline description, Prev: Constant Attributes, Up: Insn Attributes
+
+16.19.7 Delay Slot Scheduling
+-----------------------------
+
+The insn attribute mechanism can be used to specify the requirements for
+delay slots, if any, on a target machine. An instruction is said to
+require a "delay slot" if some instructions that are physically after
+the instruction are executed as if they were located before it.
+Classic examples are branch and call instructions, which often execute
+the following instruction before the branch or call is performed.
+
+ On some machines, conditional branch instructions can optionally
+"annul" instructions in the delay slot. This means that the
+instruction will not be executed for certain branch outcomes. Both
+instructions that annul if the branch is true and instructions that
+annul if the branch is false are supported.
+
+ Delay slot scheduling differs from instruction scheduling in that
+determining whether an instruction needs a delay slot is dependent only
+on the type of instruction being generated, not on data flow between the
+instructions. See the next section for a discussion of data-dependent
+instruction scheduling.
+
+ The requirement of an insn needing one or more delay slots is indicated
+via the `define_delay' expression. It has the following form:
+
+ (define_delay TEST
+ [DELAY-1 ANNUL-TRUE-1 ANNUL-FALSE-1
+ DELAY-2 ANNUL-TRUE-2 ANNUL-FALSE-2
+ ...])
+
+ TEST is an attribute test that indicates whether this `define_delay'
+applies to a particular insn. If so, the number of required delay
+slots is determined by the length of the vector specified as the second
+argument. An insn placed in delay slot N must satisfy attribute test
+DELAY-N. ANNUL-TRUE-N is an attribute test that specifies which insns
+may be annulled if the branch is true. Similarly, ANNUL-FALSE-N
+specifies which insns in the delay slot may be annulled if the branch
+is false. If annulling is not supported for that delay slot, `(nil)'
+should be coded.
+
+ For example, in the common case where branch and call insns require a
+single delay slot, which may contain any insn other than a branch or
+call, the following would be placed in the `md' file:
+
+ (define_delay (eq_attr "type" "branch,call")
+ [(eq_attr "type" "!branch,call") (nil) (nil)])
+
+ Multiple `define_delay' expressions may be specified. In this case,
+each such expression specifies different delay slot requirements and
+there must be no insn for which tests in two `define_delay' expressions
+are both true.
+
+ For example, if we have a machine that requires one delay slot for
+branches but two for calls, no delay slot can contain a branch or call
+insn, and any valid insn in the delay slot for the branch can be
+annulled if the branch is true, we might represent this as follows:
+
+ (define_delay (eq_attr "type" "branch")
+ [(eq_attr "type" "!branch,call")
+ (eq_attr "type" "!branch,call")
+ (nil)])
+
+ (define_delay (eq_attr "type" "call")
+ [(eq_attr "type" "!branch,call") (nil) (nil)
+ (eq_attr "type" "!branch,call") (nil) (nil)])
+
+
+File: gccint.info, Node: Processor pipeline description, Prev: Delay Slots, Up: Insn Attributes
+
+16.19.8 Specifying processor pipeline description
+-------------------------------------------------
+
+To achieve better performance, most modern processors (super-pipelined,
+superscalar RISC, and VLIW processors) have many "functional units" on
+which several instructions can be executed simultaneously. An
+instruction starts execution if its issue conditions are satisfied. If
+not, the instruction is stalled until its conditions are satisfied.
+Such "interlock (pipeline) delay" causes interruption of the fetching
+of successor instructions (or demands nop instructions, e.g. for some
+MIPS processors).
+
+ There are two major kinds of interlock delays in modern processors.
+The first one is a data dependence delay determining "instruction
+latency time". The instruction execution is not started until all
+source data have been evaluated by prior instructions (there are more
+complex cases when the instruction execution starts even when the data
+are not available but will be ready in given time after the instruction
+execution start). Taking the data dependence delays into account is
+simple. The data dependence (true, output, and anti-dependence) delay
+between two instructions is given by a constant. In most cases this
+approach is adequate. The second kind of interlock delays is a
+reservation delay. The reservation delay means that two instructions
+under execution will be in need of shared processors resources, i.e.
+buses, internal registers, and/or functional units, which are reserved
+for some time. Taking this kind of delay into account is complex
+especially for modern RISC processors.
+
+ The task of exploiting more processor parallelism is solved by an
+instruction scheduler. For a better solution to this problem, the
+instruction scheduler has to have an adequate description of the
+processor parallelism (or "pipeline description"). GCC machine
+descriptions describe processor parallelism and functional unit
+reservations for groups of instructions with the aid of "regular
+expressions".
+
+ The GCC instruction scheduler uses a "pipeline hazard recognizer" to
+figure out the possibility of the instruction issue by the processor on
+a given simulated processor cycle. The pipeline hazard recognizer is
+automatically generated from the processor pipeline description. The
+pipeline hazard recognizer generated from the machine description is
+based on a deterministic finite state automaton (DFA): the instruction
+issue is possible if there is a transition from one automaton state to
+another one. This algorithm is very fast, and furthermore, its speed
+is not dependent on processor complexity(1).
+
+ The rest of this section describes the directives that constitute an
+automaton-based processor pipeline description. The order of these
+constructions within the machine description file is not important.
+
+ The following optional construction describes names of automata
+generated and used for the pipeline hazards recognition. Sometimes the
+generated finite state automaton used by the pipeline hazard recognizer
+is large. If we use more than one automaton and bind functional units
+to the automata, the total size of the automata is usually less than
+the size of the single automaton. If there is no one such
+construction, only one finite state automaton is generated.
+
+ (define_automaton AUTOMATA-NAMES)
+
+ AUTOMATA-NAMES is a string giving names of the automata. The names
+are separated by commas. All the automata should have unique names.
+The automaton name is used in the constructions `define_cpu_unit' and
+`define_query_cpu_unit'.
+
+ Each processor functional unit used in the description of instruction
+reservations should be described by the following construction.
+
+ (define_cpu_unit UNIT-NAMES [AUTOMATON-NAME])
+
+ UNIT-NAMES is a string giving the names of the functional units
+separated by commas. Don't use name `nothing', it is reserved for
+other goals.
+
+ AUTOMATON-NAME is a string giving the name of the automaton with which
+the unit is bound. The automaton should be described in construction
+`define_automaton'. You should give "automaton-name", if there is a
+defined automaton.
+
+ The assignment of units to automata are constrained by the uses of the
+units in insn reservations. The most important constraint is: if a
+unit reservation is present on a particular cycle of an alternative for
+an insn reservation, then some unit from the same automaton must be
+present on the same cycle for the other alternatives of the insn
+reservation. The rest of the constraints are mentioned in the
+description of the subsequent constructions.
+
+ The following construction describes CPU functional units analogously
+to `define_cpu_unit'. The reservation of such units can be queried for
+an automaton state. The instruction scheduler never queries
+reservation of functional units for given automaton state. So as a
+rule, you don't need this construction. This construction could be
+used for future code generation goals (e.g. to generate VLIW insn
+templates).
+
+ (define_query_cpu_unit UNIT-NAMES [AUTOMATON-NAME])
+
+ UNIT-NAMES is a string giving names of the functional units separated
+by commas.
+
+ AUTOMATON-NAME is a string giving the name of the automaton with which
+the unit is bound.
+
+ The following construction is the major one to describe pipeline
+characteristics of an instruction.
+
+ (define_insn_reservation INSN-NAME DEFAULT_LATENCY
+ CONDITION REGEXP)
+
+ DEFAULT_LATENCY is a number giving latency time of the instruction.
+There is an important difference between the old description and the
+automaton based pipeline description. The latency time is used for all
+dependencies when we use the old description. In the automaton based
+pipeline description, the given latency time is only used for true
+dependencies. The cost of anti-dependencies is always zero and the
+cost of output dependencies is the difference between latency times of
+the producing and consuming insns (if the difference is negative, the
+cost is considered to be zero). You can always change the default
+costs for any description by using the target hook
+`TARGET_SCHED_ADJUST_COST' (*note Scheduling::).
+
+ INSN-NAME is a string giving the internal name of the insn. The
+internal names are used in constructions `define_bypass' and in the
+automaton description file generated for debugging. The internal name
+has nothing in common with the names in `define_insn'. It is a good
+practice to use insn classes described in the processor manual.
+
+ CONDITION defines what RTL insns are described by this construction.
+You should remember that you will be in trouble if CONDITION for two or
+more different `define_insn_reservation' constructions is TRUE for an
+insn. In this case what reservation will be used for the insn is not
+defined. Such cases are not checked during generation of the pipeline
+hazards recognizer because in general recognizing that two conditions
+may have the same value is quite difficult (especially if the conditions
+contain `symbol_ref'). It is also not checked during the pipeline
+hazard recognizer work because it would slow down the recognizer
+considerably.
+
+ REGEXP is a string describing the reservation of the cpu's functional
+units by the instruction. The reservations are described by a regular
+expression according to the following syntax:
+
+ regexp = regexp "," oneof
+ | oneof
+
+ oneof = oneof "|" allof
+ | allof
+
+ allof = allof "+" repeat
+ | repeat
+
+ repeat = element "*" number
+ | element
+
+ element = cpu_function_unit_name
+ | reservation_name
+ | result_name
+ | "nothing"
+ | "(" regexp ")"
+
+ * `,' is used for describing the start of the next cycle in the
+ reservation.
+
+ * `|' is used for describing a reservation described by the first
+ regular expression *or* a reservation described by the second
+ regular expression *or* etc.
+
+ * `+' is used for describing a reservation described by the first
+ regular expression *and* a reservation described by the second
+ regular expression *and* etc.
+
+ * `*' is used for convenience and simply means a sequence in which
+ the regular expression are repeated NUMBER times with cycle
+ advancing (see `,').
+
+ * `cpu_function_unit_name' denotes reservation of the named
+ functional unit.
+
+ * `reservation_name' -- see description of construction
+ `define_reservation'.
+
+ * `nothing' denotes no unit reservations.
+
+ Sometimes unit reservations for different insns contain common parts.
+In such case, you can simplify the pipeline description by describing
+the common part by the following construction
+
+ (define_reservation RESERVATION-NAME REGEXP)
+
+ RESERVATION-NAME is a string giving name of REGEXP. Functional unit
+names and reservation names are in the same name space. So the
+reservation names should be different from the functional unit names
+and can not be the reserved name `nothing'.
+
+ The following construction is used to describe exceptions in the
+latency time for given instruction pair. This is so called bypasses.
+
+ (define_bypass NUMBER OUT_INSN_NAMES IN_INSN_NAMES
+ [GUARD])
+
+ NUMBER defines when the result generated by the instructions given in
+string OUT_INSN_NAMES will be ready for the instructions given in
+string IN_INSN_NAMES. The instructions in the string are separated by
+commas.
+
+ GUARD is an optional string giving the name of a C function which
+defines an additional guard for the bypass. The function will get the
+two insns as parameters. If the function returns zero the bypass will
+be ignored for this case. The additional guard is necessary to
+recognize complicated bypasses, e.g. when the consumer is only an
+address of insn `store' (not a stored value).
+
+ The following five constructions are usually used to describe VLIW
+processors, or more precisely, to describe a placement of small
+instructions into VLIW instruction slots. They can be used for RISC
+processors, too.
+
+ (exclusion_set UNIT-NAMES UNIT-NAMES)
+ (presence_set UNIT-NAMES PATTERNS)
+ (final_presence_set UNIT-NAMES PATTERNS)
+ (absence_set UNIT-NAMES PATTERNS)
+ (final_absence_set UNIT-NAMES PATTERNS)
+
+ UNIT-NAMES is a string giving names of functional units separated by
+commas.
+
+ PATTERNS is a string giving patterns of functional units separated by
+comma. Currently pattern is one unit or units separated by
+white-spaces.
+
+ The first construction (`exclusion_set') means that each functional
+unit in the first string can not be reserved simultaneously with a unit
+whose name is in the second string and vice versa. For example, the
+construction is useful for describing processors (e.g. some SPARC
+processors) with a fully pipelined floating point functional unit which
+can execute simultaneously only single floating point insns or only
+double floating point insns.
+
+ The second construction (`presence_set') means that each functional
+unit in the first string can not be reserved unless at least one of
+pattern of units whose names are in the second string is reserved.
+This is an asymmetric relation. For example, it is useful for
+description that VLIW `slot1' is reserved after `slot0' reservation.
+We could describe it by the following construction
+
+ (presence_set "slot1" "slot0")
+
+ Or `slot1' is reserved only after `slot0' and unit `b0' reservation.
+In this case we could write
+
+ (presence_set "slot1" "slot0 b0")
+
+ The third construction (`final_presence_set') is analogous to
+`presence_set'. The difference between them is when checking is done.
+When an instruction is issued in given automaton state reflecting all
+current and planned unit reservations, the automaton state is changed.
+The first state is a source state, the second one is a result state.
+Checking for `presence_set' is done on the source state reservation,
+checking for `final_presence_set' is done on the result reservation.
+This construction is useful to describe a reservation which is actually
+two subsequent reservations. For example, if we use
+
+ (presence_set "slot1" "slot0")
+
+ the following insn will be never issued (because `slot1' requires
+`slot0' which is absent in the source state).
+
+ (define_reservation "insn_and_nop" "slot0 + slot1")
+
+ but it can be issued if we use analogous `final_presence_set'.
+
+ The forth construction (`absence_set') means that each functional unit
+in the first string can be reserved only if each pattern of units whose
+names are in the second string is not reserved. This is an asymmetric
+relation (actually `exclusion_set' is analogous to this one but it is
+symmetric). For example it might be useful in a VLIW description to
+say that `slot0' cannot be reserved after either `slot1' or `slot2'
+have been reserved. This can be described as:
+
+ (absence_set "slot0" "slot1, slot2")
+
+ Or `slot2' can not be reserved if `slot0' and unit `b0' are reserved
+or `slot1' and unit `b1' are reserved. In this case we could write
+
+ (absence_set "slot2" "slot0 b0, slot1 b1")
+
+ All functional units mentioned in a set should belong to the same
+automaton.
+
+ The last construction (`final_absence_set') is analogous to
+`absence_set' but checking is done on the result (state) reservation.
+See comments for `final_presence_set'.
+
+ You can control the generator of the pipeline hazard recognizer with
+the following construction.
+
+ (automata_option OPTIONS)
+
+ OPTIONS is a string giving options which affect the generated code.
+Currently there are the following options:
+
+ * "no-minimization" makes no minimization of the automaton. This is
+ only worth to do when we are debugging the description and need to
+ look more accurately at reservations of states.
+
+ * "time" means printing time statistics about the generation of
+ automata.
+
+ * "stats" means printing statistics about the generated automata
+ such as the number of DFA states, NDFA states and arcs.
+
+ * "v" means a generation of the file describing the result automata.
+ The file has suffix `.dfa' and can be used for the description
+ verification and debugging.
+
+ * "w" means a generation of warning instead of error for
+ non-critical errors.
+
+ * "ndfa" makes nondeterministic finite state automata. This affects
+ the treatment of operator `|' in the regular expressions. The
+ usual treatment of the operator is to try the first alternative
+ and, if the reservation is not possible, the second alternative.
+ The nondeterministic treatment means trying all alternatives, some
+ of them may be rejected by reservations in the subsequent insns.
+
+ * "progress" means output of a progress bar showing how many states
+ were generated so far for automaton being processed. This is
+ useful during debugging a DFA description. If you see too many
+ generated states, you could interrupt the generator of the pipeline
+ hazard recognizer and try to figure out a reason for generation of
+ the huge automaton.
+
+ As an example, consider a superscalar RISC machine which can issue
+three insns (two integer insns and one floating point insn) on the
+cycle but can finish only two insns. To describe this, we define the
+following functional units.
+
+ (define_cpu_unit "i0_pipeline, i1_pipeline, f_pipeline")
+ (define_cpu_unit "port0, port1")
+
+ All simple integer insns can be executed in any integer pipeline and
+their result is ready in two cycles. The simple integer insns are
+issued into the first pipeline unless it is reserved, otherwise they
+are issued into the second pipeline. Integer division and
+multiplication insns can be executed only in the second integer
+pipeline and their results are ready correspondingly in 8 and 4 cycles.
+The integer division is not pipelined, i.e. the subsequent integer
+division insn can not be issued until the current division insn
+finished. Floating point insns are fully pipelined and their results
+are ready in 3 cycles. Where the result of a floating point insn is
+used by an integer insn, an additional delay of one cycle is incurred.
+To describe all of this we could specify
+
+ (define_cpu_unit "div")
+
+ (define_insn_reservation "simple" 2 (eq_attr "type" "int")
+ "(i0_pipeline | i1_pipeline), (port0 | port1)")
+
+ (define_insn_reservation "mult" 4 (eq_attr "type" "mult")
+ "i1_pipeline, nothing*2, (port0 | port1)")
+
+ (define_insn_reservation "div" 8 (eq_attr "type" "div")
+ "i1_pipeline, div*7, div + (port0 | port1)")
+
+ (define_insn_reservation "float" 3 (eq_attr "type" "float")
+ "f_pipeline, nothing, (port0 | port1))
+
+ (define_bypass 4 "float" "simple,mult,div")
+
+ To simplify the description we could describe the following reservation
+
+ (define_reservation "finish" "port0|port1")
+
+ and use it in all `define_insn_reservation' as in the following
+construction
+
+ (define_insn_reservation "simple" 2 (eq_attr "type" "int")
+ "(i0_pipeline | i1_pipeline), finish")
+
+ ---------- Footnotes ----------
+
+ (1) However, the size of the automaton depends on processor
+complexity. To limit this effect, machine descriptions can split
+orthogonal parts of the machine description among several automata: but
+then, since each of these must be stepped independently, this does
+cause a small decrease in the algorithm's performance.
+
+
+File: gccint.info, Node: Conditional Execution, Next: Constant Definitions, Prev: Insn Attributes, Up: Machine Desc
+
+16.20 Conditional Execution
+===========================
+
+A number of architectures provide for some form of conditional
+execution, or predication. The hallmark of this feature is the ability
+to nullify most of the instructions in the instruction set. When the
+instruction set is large and not entirely symmetric, it can be quite
+tedious to describe these forms directly in the `.md' file. An
+alternative is the `define_cond_exec' template.
+
+ (define_cond_exec
+ [PREDICATE-PATTERN]
+ "CONDITION"
+ "OUTPUT-TEMPLATE")
+
+ PREDICATE-PATTERN is the condition that must be true for the insn to
+be executed at runtime and should match a relational operator. One can
+use `match_operator' to match several relational operators at once.
+Any `match_operand' operands must have no more than one alternative.
+
+ CONDITION is a C expression that must be true for the generated
+pattern to match.
+
+ OUTPUT-TEMPLATE is a string similar to the `define_insn' output
+template (*note Output Template::), except that the `*' and `@' special
+cases do not apply. This is only useful if the assembly text for the
+predicate is a simple prefix to the main insn. In order to handle the
+general case, there is a global variable `current_insn_predicate' that
+will contain the entire predicate if the current insn is predicated,
+and will otherwise be `NULL'.
+
+ When `define_cond_exec' is used, an implicit reference to the
+`predicable' instruction attribute is made. *Note Insn Attributes::.
+This attribute must be boolean (i.e. have exactly two elements in its
+LIST-OF-VALUES). Further, it must not be used with complex
+expressions. That is, the default and all uses in the insns must be a
+simple constant, not dependent on the alternative or anything else.
+
+ For each `define_insn' for which the `predicable' attribute is true, a
+new `define_insn' pattern will be generated that matches a predicated
+version of the instruction. For example,
+
+ (define_insn "addsi"
+ [(set (match_operand:SI 0 "register_operand" "r")
+ (plus:SI (match_operand:SI 1 "register_operand" "r")
+ (match_operand:SI 2 "register_operand" "r")))]
+ "TEST1"
+ "add %2,%1,%0")
+
+ (define_cond_exec
+ [(ne (match_operand:CC 0 "register_operand" "c")
+ (const_int 0))]
+ "TEST2"
+ "(%0)")
+
+generates a new pattern
+
+ (define_insn ""
+ [(cond_exec
+ (ne (match_operand:CC 3 "register_operand" "c") (const_int 0))
+ (set (match_operand:SI 0 "register_operand" "r")
+ (plus:SI (match_operand:SI 1 "register_operand" "r")
+ (match_operand:SI 2 "register_operand" "r"))))]
+ "(TEST2) && (TEST1)"
+ "(%3) add %2,%1,%0")
+
+
+File: gccint.info, Node: Constant Definitions, Next: Iterators, Prev: Conditional Execution, Up: Machine Desc
+
+16.21 Constant Definitions
+==========================
+
+Using literal constants inside instruction patterns reduces legibility
+and can be a maintenance problem.
+
+ To overcome this problem, you may use the `define_constants'
+expression. It contains a vector of name-value pairs. From that point
+on, wherever any of the names appears in the MD file, it is as if the
+corresponding value had been written instead. You may use
+`define_constants' multiple times; each appearance adds more constants
+to the table. It is an error to redefine a constant with a different
+value.
+
+ To come back to the a29k load multiple example, instead of
+
+ (define_insn ""
+ [(match_parallel 0 "load_multiple_operation"
+ [(set (match_operand:SI 1 "gpc_reg_operand" "=r")
+ (match_operand:SI 2 "memory_operand" "m"))
+ (use (reg:SI 179))
+ (clobber (reg:SI 179))])]
+ ""
+ "loadm 0,0,%1,%2")
+
+ You could write:
+
+ (define_constants [
+ (R_BP 177)
+ (R_FC 178)
+ (R_CR 179)
+ (R_Q 180)
+ ])
+
+ (define_insn ""
+ [(match_parallel 0 "load_multiple_operation"
+ [(set (match_operand:SI 1 "gpc_reg_operand" "=r")
+ (match_operand:SI 2 "memory_operand" "m"))
+ (use (reg:SI R_CR))
+ (clobber (reg:SI R_CR))])]
+ ""
+ "loadm 0,0,%1,%2")
+
+ The constants that are defined with a define_constant are also output
+in the insn-codes.h header file as #defines.
+
+
+File: gccint.info, Node: Iterators, Prev: Constant Definitions, Up: Machine Desc
+
+16.22 Iterators
+===============
+
+Ports often need to define similar patterns for more than one machine
+mode or for more than one rtx code. GCC provides some simple iterator
+facilities to make this process easier.
+
+* Menu:
+
+* Mode Iterators:: Generating variations of patterns for different modes.
+* Code Iterators:: Doing the same for codes.
+
+
+File: gccint.info, Node: Mode Iterators, Next: Code Iterators, Up: Iterators
+
+16.22.1 Mode Iterators
+----------------------
+
+Ports often need to define similar patterns for two or more different
+modes. For example:
+
+ * If a processor has hardware support for both single and double
+ floating-point arithmetic, the `SFmode' patterns tend to be very
+ similar to the `DFmode' ones.
+
+ * If a port uses `SImode' pointers in one configuration and `DImode'
+ pointers in another, it will usually have very similar `SImode'
+ and `DImode' patterns for manipulating pointers.
+
+ Mode iterators allow several patterns to be instantiated from one
+`.md' file template. They can be used with any type of rtx-based
+construct, such as a `define_insn', `define_split', or
+`define_peephole2'.
+
+* Menu:
+
+* Defining Mode Iterators:: Defining a new mode iterator.
+* Substitutions:: Combining mode iterators with substitutions
+* Examples:: Examples
+
+
+File: gccint.info, Node: Defining Mode Iterators, Next: Substitutions, Up: Mode Iterators
+
+16.22.1.1 Defining Mode Iterators
+.................................
+
+The syntax for defining a mode iterator is:
+
+ (define_mode_iterator NAME [(MODE1 "COND1") ... (MODEN "CONDN")])
+
+ This allows subsequent `.md' file constructs to use the mode suffix
+`:NAME'. Every construct that does so will be expanded N times, once
+with every use of `:NAME' replaced by `:MODE1', once with every use
+replaced by `:MODE2', and so on. In the expansion for a particular
+MODEI, every C condition will also require that CONDI be true.
+
+ For example:
+
+ (define_mode_iterator P [(SI "Pmode == SImode") (DI "Pmode == DImode")])
+
+ defines a new mode suffix `:P'. Every construct that uses `:P' will
+be expanded twice, once with every `:P' replaced by `:SI' and once with
+every `:P' replaced by `:DI'. The `:SI' version will only apply if
+`Pmode == SImode' and the `:DI' version will only apply if `Pmode ==
+DImode'.
+
+ As with other `.md' conditions, an empty string is treated as "always
+true". `(MODE "")' can also be abbreviated to `MODE'. For example:
+
+ (define_mode_iterator GPR [SI (DI "TARGET_64BIT")])
+
+ means that the `:DI' expansion only applies if `TARGET_64BIT' but that
+the `:SI' expansion has no such constraint.
+
+ Iterators are applied in the order they are defined. This can be
+significant if two iterators are used in a construct that requires
+substitutions. *Note Substitutions::.
+
+
+File: gccint.info, Node: Substitutions, Next: Examples, Prev: Defining Mode Iterators, Up: Mode Iterators
+
+16.22.1.2 Substitution in Mode Iterators
+........................................
+
+If an `.md' file construct uses mode iterators, each version of the
+construct will often need slightly different strings or modes. For
+example:
+
+ * When a `define_expand' defines several `addM3' patterns (*note
+ Standard Names::), each expander will need to use the appropriate
+ mode name for M.
+
+ * When a `define_insn' defines several instruction patterns, each
+ instruction will often use a different assembler mnemonic.
+
+ * When a `define_insn' requires operands with different modes, using
+ an iterator for one of the operand modes usually requires a
+ specific mode for the other operand(s).
+
+ GCC supports such variations through a system of "mode attributes".
+There are two standard attributes: `mode', which is the name of the
+mode in lower case, and `MODE', which is the same thing in upper case.
+You can define other attributes using:
+
+ (define_mode_attr NAME [(MODE1 "VALUE1") ... (MODEN "VALUEN")])
+
+ where NAME is the name of the attribute and VALUEI is the value
+associated with MODEI.
+
+ When GCC replaces some :ITERATOR with :MODE, it will scan each string
+and mode in the pattern for sequences of the form `<ITERATOR:ATTR>',
+where ATTR is the name of a mode attribute. If the attribute is
+defined for MODE, the whole `<...>' sequence will be replaced by the
+appropriate attribute value.
+
+ For example, suppose an `.md' file has:
+
+ (define_mode_iterator P [(SI "Pmode == SImode") (DI "Pmode == DImode")])
+ (define_mode_attr load [(SI "lw") (DI "ld")])
+
+ If one of the patterns that uses `:P' contains the string
+`"<P:load>\t%0,%1"', the `SI' version of that pattern will use
+`"lw\t%0,%1"' and the `DI' version will use `"ld\t%0,%1"'.
+
+ Here is an example of using an attribute for a mode:
+
+ (define_mode_iterator LONG [SI DI])
+ (define_mode_attr SHORT [(SI "HI") (DI "SI")])
+ (define_insn ...
+ (sign_extend:LONG (match_operand:<LONG:SHORT> ...)) ...)
+
+ The `ITERATOR:' prefix may be omitted, in which case the substitution
+will be attempted for every iterator expansion.
+
+
+File: gccint.info, Node: Examples, Prev: Substitutions, Up: Mode Iterators
+
+16.22.1.3 Mode Iterator Examples
+................................
+
+Here is an example from the MIPS port. It defines the following modes
+and attributes (among others):
+
+ (define_mode_iterator GPR [SI (DI "TARGET_64BIT")])
+ (define_mode_attr d [(SI "") (DI "d")])
+
+ and uses the following template to define both `subsi3' and `subdi3':
+
+ (define_insn "sub<mode>3"
+ [(set (match_operand:GPR 0 "register_operand" "=d")
+ (minus:GPR (match_operand:GPR 1 "register_operand" "d")
+ (match_operand:GPR 2 "register_operand" "d")))]
+ ""
+ "<d>subu\t%0,%1,%2"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "<MODE>")])
+
+ This is exactly equivalent to:
+
+ (define_insn "subsi3"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (minus:SI (match_operand:SI 1 "register_operand" "d")
+ (match_operand:SI 2 "register_operand" "d")))]
+ ""
+ "subu\t%0,%1,%2"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")])
+
+ (define_insn "subdi3"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (minus:DI (match_operand:DI 1 "register_operand" "d")
+ (match_operand:DI 2 "register_operand" "d")))]
+ ""
+ "dsubu\t%0,%1,%2"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "DI")])
+
+
+File: gccint.info, Node: Code Iterators, Prev: Mode Iterators, Up: Iterators
+
+16.22.2 Code Iterators
+----------------------
+
+Code iterators operate in a similar way to mode iterators. *Note Mode
+Iterators::.
+
+ The construct:
+
+ (define_code_iterator NAME [(CODE1 "COND1") ... (CODEN "CONDN")])
+
+ defines a pseudo rtx code NAME that can be instantiated as CODEI if
+condition CONDI is true. Each CODEI must have the same rtx format.
+*Note RTL Classes::.
+
+ As with mode iterators, each pattern that uses NAME will be expanded N
+times, once with all uses of NAME replaced by CODE1, once with all uses
+replaced by CODE2, and so on. *Note Defining Mode Iterators::.
+
+ It is possible to define attributes for codes as well as for modes.
+There are two standard code attributes: `code', the name of the code in
+lower case, and `CODE', the name of the code in upper case. Other
+attributes are defined using:
+
+ (define_code_attr NAME [(CODE1 "VALUE1") ... (CODEN "VALUEN")])
+
+ Here's an example of code iterators in action, taken from the MIPS
+port:
+
+ (define_code_iterator any_cond [unordered ordered unlt unge uneq ltgt unle ungt
+ eq ne gt ge lt le gtu geu ltu leu])
+
+ (define_expand "b<code>"
+ [(set (pc)
+ (if_then_else (any_cond:CC (cc0)
+ (const_int 0))
+ (label_ref (match_operand 0 ""))
+ (pc)))]
+ ""
+ {
+ gen_conditional_branch (operands, <CODE>);
+ DONE;
+ })
+
+ This is equivalent to:
+
+ (define_expand "bunordered"
+ [(set (pc)
+ (if_then_else (unordered:CC (cc0)
+ (const_int 0))
+ (label_ref (match_operand 0 ""))
+ (pc)))]
+ ""
+ {
+ gen_conditional_branch (operands, UNORDERED);
+ DONE;
+ })
+
+ (define_expand "bordered"
+ [(set (pc)
+ (if_then_else (ordered:CC (cc0)
+ (const_int 0))
+ (label_ref (match_operand 0 ""))
+ (pc)))]
+ ""
+ {
+ gen_conditional_branch (operands, ORDERED);
+ DONE;
+ })
+
+ ...
+
+
+File: gccint.info, Node: Target Macros, Next: Host Config, Prev: Machine Desc, Up: Top
+
+17 Target Description Macros and Functions
+******************************************
+
+In addition to the file `MACHINE.md', a machine description includes a
+C header file conventionally given the name `MACHINE.h' and a C source
+file named `MACHINE.c'. The header file defines numerous macros that
+convey the information about the target machine that does not fit into
+the scheme of the `.md' file. The file `tm.h' should be a link to
+`MACHINE.h'. The header file `config.h' includes `tm.h' and most
+compiler source files include `config.h'. The source file defines a
+variable `targetm', which is a structure containing pointers to
+functions and data relating to the target machine. `MACHINE.c' should
+also contain their definitions, if they are not defined elsewhere in
+GCC, and other functions called through the macros defined in the `.h'
+file.
+
+* Menu:
+
+* Target Structure:: The `targetm' variable.
+* Driver:: Controlling how the driver runs the compilation passes.
+* Run-time Target:: Defining `-m' options like `-m68000' and `-m68020'.
+* Per-Function Data:: Defining data structures for per-function information.
+* Storage Layout:: Defining sizes and alignments of data.
+* Type Layout:: Defining sizes and properties of basic user data types.
+* Registers:: Naming and describing the hardware registers.
+* Register Classes:: Defining the classes of hardware registers.
+* Old Constraints:: The old way to define machine-specific constraints.
+* Stack and Calling:: Defining which way the stack grows and by how much.
+* Varargs:: Defining the varargs macros.
+* Trampolines:: Code set up at run time to enter a nested function.
+* Library Calls:: Controlling how library routines are implicitly called.
+* Addressing Modes:: Defining addressing modes valid for memory operands.
+* Anchored Addresses:: Defining how `-fsection-anchors' should work.
+* Condition Code:: Defining how insns update the condition code.
+* Costs:: Defining relative costs of different operations.
+* Scheduling:: Adjusting the behavior of the instruction scheduler.
+* Sections:: Dividing storage into text, data, and other sections.
+* PIC:: Macros for position independent code.
+* Assembler Format:: Defining how to write insns and pseudo-ops to output.
+* Debugging Info:: Defining the format of debugging output.
+* Floating Point:: Handling floating point for cross-compilers.
+* Mode Switching:: Insertion of mode-switching instructions.
+* Target Attributes:: Defining target-specific uses of `__attribute__'.
+* Emulated TLS:: Emulated TLS support.
+* MIPS Coprocessors:: MIPS coprocessor support and how to customize it.
+* PCH Target:: Validity checking for precompiled headers.
+* C++ ABI:: Controlling C++ ABI changes.
+* Misc:: Everything else.
+
+
+File: gccint.info, Node: Target Structure, Next: Driver, Up: Target Macros
+
+17.1 The Global `targetm' Variable
+==================================
+
+ -- Variable: struct gcc_target targetm
+ The target `.c' file must define the global `targetm' variable
+ which contains pointers to functions and data relating to the
+ target machine. The variable is declared in `target.h';
+ `target-def.h' defines the macro `TARGET_INITIALIZER' which is
+ used to initialize the variable, and macros for the default
+ initializers for elements of the structure. The `.c' file should
+ override those macros for which the default definition is
+ inappropriate. For example:
+ #include "target.h"
+ #include "target-def.h"
+
+ /* Initialize the GCC target structure. */
+
+ #undef TARGET_COMP_TYPE_ATTRIBUTES
+ #define TARGET_COMP_TYPE_ATTRIBUTES MACHINE_comp_type_attributes
+
+ struct gcc_target targetm = TARGET_INITIALIZER;
+
+Where a macro should be defined in the `.c' file in this manner to form
+part of the `targetm' structure, it is documented below as a "Target
+Hook" with a prototype. Many macros will change in future from being
+defined in the `.h' file to being part of the `targetm' structure.
+
+
+File: gccint.info, Node: Driver, Next: Run-time Target, Prev: Target Structure, Up: Target Macros
+
+17.2 Controlling the Compilation Driver, `gcc'
+==============================================
+
+You can control the compilation driver.
+
+ -- Macro: SWITCH_TAKES_ARG (CHAR)
+ A C expression which determines whether the option `-CHAR' takes
+ arguments. The value should be the number of arguments that
+ option takes-zero, for many options.
+
+ By default, this macro is defined as `DEFAULT_SWITCH_TAKES_ARG',
+ which handles the standard options properly. You need not define
+ `SWITCH_TAKES_ARG' unless you wish to add additional options which
+ take arguments. Any redefinition should call
+ `DEFAULT_SWITCH_TAKES_ARG' and then check for additional options.
+
+ -- Macro: WORD_SWITCH_TAKES_ARG (NAME)
+ A C expression which determines whether the option `-NAME' takes
+ arguments. The value should be the number of arguments that
+ option takes-zero, for many options. This macro rather than
+ `SWITCH_TAKES_ARG' is used for multi-character option names.
+
+ By default, this macro is defined as
+ `DEFAULT_WORD_SWITCH_TAKES_ARG', which handles the standard options
+ properly. You need not define `WORD_SWITCH_TAKES_ARG' unless you
+ wish to add additional options which take arguments. Any
+ redefinition should call `DEFAULT_WORD_SWITCH_TAKES_ARG' and then
+ check for additional options.
+
+ -- Macro: SWITCH_CURTAILS_COMPILATION (CHAR)
+ A C expression which determines whether the option `-CHAR' stops
+ compilation before the generation of an executable. The value is
+ boolean, nonzero if the option does stop an executable from being
+ generated, zero otherwise.
+
+ By default, this macro is defined as
+ `DEFAULT_SWITCH_CURTAILS_COMPILATION', which handles the standard
+ options properly. You need not define
+ `SWITCH_CURTAILS_COMPILATION' unless you wish to add additional
+ options which affect the generation of an executable. Any
+ redefinition should call `DEFAULT_SWITCH_CURTAILS_COMPILATION' and
+ then check for additional options.
+
+ -- Macro: SWITCHES_NEED_SPACES
+ A string-valued C expression which enumerates the options for which
+ the linker needs a space between the option and its argument.
+
+ If this macro is not defined, the default value is `""'.
+
+ -- Macro: TARGET_OPTION_TRANSLATE_TABLE
+ If defined, a list of pairs of strings, the first of which is a
+ potential command line target to the `gcc' driver program, and the
+ second of which is a space-separated (tabs and other whitespace
+ are not supported) list of options with which to replace the first
+ option. The target defining this list is responsible for assuring
+ that the results are valid. Replacement options may not be the
+ `--opt' style, they must be the `-opt' style. It is the intention
+ of this macro to provide a mechanism for substitution that affects
+ the multilibs chosen, such as one option that enables many
+ options, some of which select multilibs. Example nonsensical
+ definition, where `-malt-abi', `-EB', and `-mspoo' cause different
+ multilibs to be chosen:
+
+ #define TARGET_OPTION_TRANSLATE_TABLE \
+ { "-fast", "-march=fast-foo -malt-abi -I/usr/fast-foo" }, \
+ { "-compat", "-EB -malign=4 -mspoo" }
+
+ -- Macro: DRIVER_SELF_SPECS
+ A list of specs for the driver itself. It should be a suitable
+ initializer for an array of strings, with no surrounding braces.
+
+ The driver applies these specs to its own command line between
+ loading default `specs' files (but not command-line specified
+ ones) and choosing the multilib directory or running any
+ subcommands. It applies them in the order given, so each spec can
+ depend on the options added by earlier ones. It is also possible
+ to remove options using `%<OPTION' in the usual way.
+
+ This macro can be useful when a port has several interdependent
+ target options. It provides a way of standardizing the command
+ line so that the other specs are easier to write.
+
+ Do not define this macro if it does not need to do anything.
+
+ -- Macro: OPTION_DEFAULT_SPECS
+ A list of specs used to support configure-time default options
+ (i.e. `--with' options) in the driver. It should be a suitable
+ initializer for an array of structures, each containing two
+ strings, without the outermost pair of surrounding braces.
+
+ The first item in the pair is the name of the default. This must
+ match the code in `config.gcc' for the target. The second item is
+ a spec to apply if a default with this name was specified. The
+ string `%(VALUE)' in the spec will be replaced by the value of the
+ default everywhere it occurs.
+
+ The driver will apply these specs to its own command line between
+ loading default `specs' files and processing `DRIVER_SELF_SPECS',
+ using the same mechanism as `DRIVER_SELF_SPECS'.
+
+ Do not define this macro if it does not need to do anything.
+
+ -- Macro: CPP_SPEC
+ A C string constant that tells the GCC driver program options to
+ pass to CPP. It can also specify how to translate options you
+ give to GCC into options for GCC to pass to the CPP.
+
+ Do not define this macro if it does not need to do anything.
+
+ -- Macro: CPLUSPLUS_CPP_SPEC
+ This macro is just like `CPP_SPEC', but is used for C++, rather
+ than C. If you do not define this macro, then the value of
+ `CPP_SPEC' (if any) will be used instead.
+
+ -- Macro: CC1_SPEC
+ A C string constant that tells the GCC driver program options to
+ pass to `cc1', `cc1plus', `f771', and the other language front
+ ends. It can also specify how to translate options you give to
+ GCC into options for GCC to pass to front ends.
+
+ Do not define this macro if it does not need to do anything.
+
+ -- Macro: CC1PLUS_SPEC
+ A C string constant that tells the GCC driver program options to
+ pass to `cc1plus'. It can also specify how to translate options
+ you give to GCC into options for GCC to pass to the `cc1plus'.
+
+ Do not define this macro if it does not need to do anything. Note
+ that everything defined in CC1_SPEC is already passed to `cc1plus'
+ so there is no need to duplicate the contents of CC1_SPEC in
+ CC1PLUS_SPEC.
+
+ -- Macro: ASM_SPEC
+ A C string constant that tells the GCC driver program options to
+ pass to the assembler. It can also specify how to translate
+ options you give to GCC into options for GCC to pass to the
+ assembler. See the file `sun3.h' for an example of this.
+
+ Do not define this macro if it does not need to do anything.
+
+ -- Macro: ASM_FINAL_SPEC
+ A C string constant that tells the GCC driver program how to run
+ any programs which cleanup after the normal assembler. Normally,
+ this is not needed. See the file `mips.h' for an example of this.
+
+ Do not define this macro if it does not need to do anything.
+
+ -- Macro: AS_NEEDS_DASH_FOR_PIPED_INPUT
+ Define this macro, with no value, if the driver should give the
+ assembler an argument consisting of a single dash, `-', to
+ instruct it to read from its standard input (which will be a pipe
+ connected to the output of the compiler proper). This argument is
+ given after any `-o' option specifying the name of the output file.
+
+ If you do not define this macro, the assembler is assumed to read
+ its standard input if given no non-option arguments. If your
+ assembler cannot read standard input at all, use a `%{pipe:%e}'
+ construct; see `mips.h' for instance.
+
+ -- Macro: LINK_SPEC
+ A C string constant that tells the GCC driver program options to
+ pass to the linker. It can also specify how to translate options
+ you give to GCC into options for GCC to pass to the linker.
+
+ Do not define this macro if it does not need to do anything.
+
+ -- Macro: LIB_SPEC
+ Another C string constant used much like `LINK_SPEC'. The
+ difference between the two is that `LIB_SPEC' is used at the end
+ of the command given to the linker.
+
+ If this macro is not defined, a default is provided that loads the
+ standard C library from the usual place. See `gcc.c'.
+
+ -- Macro: LIBGCC_SPEC
+ Another C string constant that tells the GCC driver program how
+ and when to place a reference to `libgcc.a' into the linker
+ command line. This constant is placed both before and after the
+ value of `LIB_SPEC'.
+
+ If this macro is not defined, the GCC driver provides a default
+ that passes the string `-lgcc' to the linker.
+
+ -- Macro: REAL_LIBGCC_SPEC
+ By default, if `ENABLE_SHARED_LIBGCC' is defined, the
+ `LIBGCC_SPEC' is not directly used by the driver program but is
+ instead modified to refer to different versions of `libgcc.a'
+ depending on the values of the command line flags `-static',
+ `-shared', `-static-libgcc', and `-shared-libgcc'. On targets
+ where these modifications are inappropriate, define
+ `REAL_LIBGCC_SPEC' instead. `REAL_LIBGCC_SPEC' tells the driver
+ how to place a reference to `libgcc' on the link command line,
+ but, unlike `LIBGCC_SPEC', it is used unmodified.
+
+ -- Macro: USE_LD_AS_NEEDED
+ A macro that controls the modifications to `LIBGCC_SPEC' mentioned
+ in `REAL_LIBGCC_SPEC'. If nonzero, a spec will be generated that
+ uses -as-needed and the shared libgcc in place of the static
+ exception handler library, when linking without any of `-static',
+ `-static-libgcc', or `-shared-libgcc'.
+
+ -- Macro: LINK_EH_SPEC
+ If defined, this C string constant is added to `LINK_SPEC'. When
+ `USE_LD_AS_NEEDED' is zero or undefined, it also affects the
+ modifications to `LIBGCC_SPEC' mentioned in `REAL_LIBGCC_SPEC'.
+
+ -- Macro: STARTFILE_SPEC
+ Another C string constant used much like `LINK_SPEC'. The
+ difference between the two is that `STARTFILE_SPEC' is used at the
+ very beginning of the command given to the linker.
+
+ If this macro is not defined, a default is provided that loads the
+ standard C startup file from the usual place. See `gcc.c'.
+
+ -- Macro: ENDFILE_SPEC
+ Another C string constant used much like `LINK_SPEC'. The
+ difference between the two is that `ENDFILE_SPEC' is used at the
+ very end of the command given to the linker.
+
+ Do not define this macro if it does not need to do anything.
+
+ -- Macro: THREAD_MODEL_SPEC
+ GCC `-v' will print the thread model GCC was configured to use.
+ However, this doesn't work on platforms that are multilibbed on
+ thread models, such as AIX 4.3. On such platforms, define
+ `THREAD_MODEL_SPEC' such that it evaluates to a string without
+ blanks that names one of the recognized thread models. `%*', the
+ default value of this macro, will expand to the value of
+ `thread_file' set in `config.gcc'.
+
+ -- Macro: SYSROOT_SUFFIX_SPEC
+ Define this macro to add a suffix to the target sysroot when GCC is
+ configured with a sysroot. This will cause GCC to search for
+ usr/lib, et al, within sysroot+suffix.
+
+ -- Macro: SYSROOT_HEADERS_SUFFIX_SPEC
+ Define this macro to add a headers_suffix to the target sysroot
+ when GCC is configured with a sysroot. This will cause GCC to
+ pass the updated sysroot+headers_suffix to CPP, causing it to
+ search for usr/include, et al, within sysroot+headers_suffix.
+
+ -- Macro: EXTRA_SPECS
+ Define this macro to provide additional specifications to put in
+ the `specs' file that can be used in various specifications like
+ `CC1_SPEC'.
+
+ The definition should be an initializer for an array of structures,
+ containing a string constant, that defines the specification name,
+ and a string constant that provides the specification.
+
+ Do not define this macro if it does not need to do anything.
+
+ `EXTRA_SPECS' is useful when an architecture contains several
+ related targets, which have various `..._SPECS' which are similar
+ to each other, and the maintainer would like one central place to
+ keep these definitions.
+
+ For example, the PowerPC System V.4 targets use `EXTRA_SPECS' to
+ define either `_CALL_SYSV' when the System V calling sequence is
+ used or `_CALL_AIX' when the older AIX-based calling sequence is
+ used.
+
+ The `config/rs6000/rs6000.h' target file defines:
+
+ #define EXTRA_SPECS \
+ { "cpp_sysv_default", CPP_SYSV_DEFAULT },
+
+ #define CPP_SYS_DEFAULT ""
+
+ The `config/rs6000/sysv.h' target file defines:
+ #undef CPP_SPEC
+ #define CPP_SPEC \
+ "%{posix: -D_POSIX_SOURCE } \
+ %{mcall-sysv: -D_CALL_SYSV } \
+ %{!mcall-sysv: %(cpp_sysv_default) } \
+ %{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT}"
+
+ #undef CPP_SYSV_DEFAULT
+ #define CPP_SYSV_DEFAULT "-D_CALL_SYSV"
+
+ while the `config/rs6000/eabiaix.h' target file defines
+ `CPP_SYSV_DEFAULT' as:
+
+ #undef CPP_SYSV_DEFAULT
+ #define CPP_SYSV_DEFAULT "-D_CALL_AIX"
+
+ -- Macro: LINK_LIBGCC_SPECIAL_1
+ Define this macro if the driver program should find the library
+ `libgcc.a'. If you do not define this macro, the driver program
+ will pass the argument `-lgcc' to tell the linker to do the search.
+
+ -- Macro: LINK_GCC_C_SEQUENCE_SPEC
+ The sequence in which libgcc and libc are specified to the linker.
+ By default this is `%G %L %G'.
+
+ -- Macro: LINK_COMMAND_SPEC
+ A C string constant giving the complete command line need to
+ execute the linker. When you do this, you will need to update
+ your port each time a change is made to the link command line
+ within `gcc.c'. Therefore, define this macro only if you need to
+ completely redefine the command line for invoking the linker and
+ there is no other way to accomplish the effect you need.
+ Overriding this macro may be avoidable by overriding
+ `LINK_GCC_C_SEQUENCE_SPEC' instead.
+
+ -- Macro: LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
+ A nonzero value causes `collect2' to remove duplicate
+ `-LDIRECTORY' search directories from linking commands. Do not
+ give it a nonzero value if removing duplicate search directories
+ changes the linker's semantics.
+
+ -- Macro: MULTILIB_DEFAULTS
+ Define this macro as a C expression for the initializer of an
+ array of string to tell the driver program which options are
+ defaults for this target and thus do not need to be handled
+ specially when using `MULTILIB_OPTIONS'.
+
+ Do not define this macro if `MULTILIB_OPTIONS' is not defined in
+ the target makefile fragment or if none of the options listed in
+ `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::.
+
+ -- Macro: RELATIVE_PREFIX_NOT_LINKDIR
+ Define this macro to tell `gcc' that it should only translate a
+ `-B' prefix into a `-L' linker option if the prefix indicates an
+ absolute file name.
+
+ -- Macro: MD_EXEC_PREFIX
+ If defined, this macro is an additional prefix to try after
+ `STANDARD_EXEC_PREFIX'. `MD_EXEC_PREFIX' is not searched when the
+ `-b' option is used, or the compiler is built as a cross compiler.
+ If you define `MD_EXEC_PREFIX', then be sure to add it to the
+ list of directories used to find the assembler in `configure.in'.
+
+ -- Macro: STANDARD_STARTFILE_PREFIX
+ Define this macro as a C string constant if you wish to override
+ the standard choice of `libdir' as the default prefix to try when
+ searching for startup files such as `crt0.o'.
+ `STANDARD_STARTFILE_PREFIX' is not searched when the compiler is
+ built as a cross compiler.
+
+ -- Macro: STANDARD_STARTFILE_PREFIX_1
+ Define this macro as a C string constant if you wish to override
+ the standard choice of `/lib' as a prefix to try after the default
+ prefix when searching for startup files such as `crt0.o'.
+ `STANDARD_STARTFILE_PREFIX_1' is not searched when the compiler is
+ built as a cross compiler.
+
+ -- Macro: STANDARD_STARTFILE_PREFIX_2
+ Define this macro as a C string constant if you wish to override
+ the standard choice of `/lib' as yet another prefix to try after
+ the default prefix when searching for startup files such as
+ `crt0.o'. `STANDARD_STARTFILE_PREFIX_2' is not searched when the
+ compiler is built as a cross compiler.
+
+ -- Macro: MD_STARTFILE_PREFIX
+ If defined, this macro supplies an additional prefix to try after
+ the standard prefixes. `MD_EXEC_PREFIX' is not searched when the
+ `-b' option is used, or when the compiler is built as a cross
+ compiler.
+
+ -- Macro: MD_STARTFILE_PREFIX_1
+ If defined, this macro supplies yet another prefix to try after the
+ standard prefixes. It is not searched when the `-b' option is
+ used, or when the compiler is built as a cross compiler.
+
+ -- Macro: INIT_ENVIRONMENT
+ Define this macro as a C string constant if you wish to set
+ environment variables for programs called by the driver, such as
+ the assembler and loader. The driver passes the value of this
+ macro to `putenv' to initialize the necessary environment
+ variables.
+
+ -- Macro: LOCAL_INCLUDE_DIR
+ Define this macro as a C string constant if you wish to override
+ the standard choice of `/usr/local/include' as the default prefix
+ to try when searching for local header files. `LOCAL_INCLUDE_DIR'
+ comes before `SYSTEM_INCLUDE_DIR' in the search order.
+
+ Cross compilers do not search either `/usr/local/include' or its
+ replacement.
+
+ -- Macro: MODIFY_TARGET_NAME
+ Define this macro if you wish to define command-line switches that
+ modify the default target name.
+
+ For each switch, you can include a string to be appended to the
+ first part of the configuration name or a string to be deleted
+ from the configuration name, if present. The definition should be
+ an initializer for an array of structures. Each array element
+ should have three elements: the switch name (a string constant,
+ including the initial dash), one of the enumeration codes `ADD' or
+ `DELETE' to indicate whether the string should be inserted or
+ deleted, and the string to be inserted or deleted (a string
+ constant).
+
+ For example, on a machine where `64' at the end of the
+ configuration name denotes a 64-bit target and you want the `-32'
+ and `-64' switches to select between 32- and 64-bit targets, you
+ would code
+
+ #define MODIFY_TARGET_NAME \
+ { { "-32", DELETE, "64"}, \
+ {"-64", ADD, "64"}}
+
+ -- Macro: SYSTEM_INCLUDE_DIR
+ Define this macro as a C string constant if you wish to specify a
+ system-specific directory to search for header files before the
+ standard directory. `SYSTEM_INCLUDE_DIR' comes before
+ `STANDARD_INCLUDE_DIR' in the search order.
+
+ Cross compilers do not use this macro and do not search the
+ directory specified.
+
+ -- Macro: STANDARD_INCLUDE_DIR
+ Define this macro as a C string constant if you wish to override
+ the standard choice of `/usr/include' as the default prefix to try
+ when searching for header files.
+
+ Cross compilers ignore this macro and do not search either
+ `/usr/include' or its replacement.
+
+ -- Macro: STANDARD_INCLUDE_COMPONENT
+ The "component" corresponding to `STANDARD_INCLUDE_DIR'. See
+ `INCLUDE_DEFAULTS', below, for the description of components. If
+ you do not define this macro, no component is used.
+
+ -- Macro: INCLUDE_DEFAULTS
+ Define this macro if you wish to override the entire default
+ search path for include files. For a native compiler, the default
+ search path usually consists of `GCC_INCLUDE_DIR',
+ `LOCAL_INCLUDE_DIR', `SYSTEM_INCLUDE_DIR',
+ `GPLUSPLUS_INCLUDE_DIR', and `STANDARD_INCLUDE_DIR'. In addition,
+ `GPLUSPLUS_INCLUDE_DIR' and `GCC_INCLUDE_DIR' are defined
+ automatically by `Makefile', and specify private search areas for
+ GCC. The directory `GPLUSPLUS_INCLUDE_DIR' is used only for C++
+ programs.
+
+ The definition should be an initializer for an array of structures.
+ Each array element should have four elements: the directory name (a
+ string constant), the component name (also a string constant), a
+ flag for C++-only directories, and a flag showing that the
+ includes in the directory don't need to be wrapped in `extern `C''
+ when compiling C++. Mark the end of the array with a null element.
+
+ The component name denotes what GNU package the include file is
+ part of, if any, in all uppercase letters. For example, it might
+ be `GCC' or `BINUTILS'. If the package is part of a
+ vendor-supplied operating system, code the component name as `0'.
+
+ For example, here is the definition used for VAX/VMS:
+
+ #define INCLUDE_DEFAULTS \
+ { \
+ { "GNU_GXX_INCLUDE:", "G++", 1, 1}, \
+ { "GNU_CC_INCLUDE:", "GCC", 0, 0}, \
+ { "SYS$SYSROOT:[SYSLIB.]", 0, 0, 0}, \
+ { ".", 0, 0, 0}, \
+ { 0, 0, 0, 0} \
+ }
+
+ Here is the order of prefixes tried for exec files:
+
+ 1. Any prefixes specified by the user with `-B'.
+
+ 2. The environment variable `GCC_EXEC_PREFIX' or, if `GCC_EXEC_PREFIX'
+ is not set and the compiler has not been installed in the
+ configure-time PREFIX, the location in which the compiler has
+ actually been installed.
+
+ 3. The directories specified by the environment variable
+ `COMPILER_PATH'.
+
+ 4. The macro `STANDARD_EXEC_PREFIX', if the compiler has been
+ installed in the configured-time PREFIX.
+
+ 5. The location `/usr/libexec/gcc/', but only if this is a native
+ compiler.
+
+ 6. The location `/usr/lib/gcc/', but only if this is a native
+ compiler.
+
+ 7. The macro `MD_EXEC_PREFIX', if defined, but only if this is a
+ native compiler.
+
+ Here is the order of prefixes tried for startfiles:
+
+ 1. Any prefixes specified by the user with `-B'.
+
+ 2. The environment variable `GCC_EXEC_PREFIX' or its automatically
+ determined value based on the installed toolchain location.
+
+ 3. The directories specified by the environment variable
+ `LIBRARY_PATH' (or port-specific name; native only, cross
+ compilers do not use this).
+
+ 4. The macro `STANDARD_EXEC_PREFIX', but only if the toolchain is
+ installed in the configured PREFIX or this is a native compiler.
+
+ 5. The location `/usr/lib/gcc/', but only if this is a native
+ compiler.
+
+ 6. The macro `MD_EXEC_PREFIX', if defined, but only if this is a
+ native compiler.
+
+ 7. The macro `MD_STARTFILE_PREFIX', if defined, but only if this is a
+ native compiler, or we have a target system root.
+
+ 8. The macro `MD_STARTFILE_PREFIX_1', if defined, but only if this is
+ a native compiler, or we have a target system root.
+
+ 9. The macro `STANDARD_STARTFILE_PREFIX', with any sysroot
+ modifications. If this path is relative it will be prefixed by
+ `GCC_EXEC_PREFIX' and the machine suffix or `STANDARD_EXEC_PREFIX'
+ and the machine suffix.
+
+ 10. The macro `STANDARD_STARTFILE_PREFIX_1', but only if this is a
+ native compiler, or we have a target system root. The default for
+ this macro is `/lib/'.
+
+ 11. The macro `STANDARD_STARTFILE_PREFIX_2', but only if this is a
+ native compiler, or we have a target system root. The default for
+ this macro is `/usr/lib/'.
+
+
+File: gccint.info, Node: Run-time Target, Next: Per-Function Data, Prev: Driver, Up: Target Macros
+
+17.3 Run-time Target Specification
+==================================
+
+Here are run-time target specifications.
+
+ -- Macro: TARGET_CPU_CPP_BUILTINS ()
+ This function-like macro expands to a block of code that defines
+ built-in preprocessor macros and assertions for the target CPU,
+ using the functions `builtin_define', `builtin_define_std' and
+ `builtin_assert'. When the front end calls this macro it provides
+ a trailing semicolon, and since it has finished command line
+ option processing your code can use those results freely.
+
+ `builtin_assert' takes a string in the form you pass to the
+ command-line option `-A', such as `cpu=mips', and creates the
+ assertion. `builtin_define' takes a string in the form accepted
+ by option `-D' and unconditionally defines the macro.
+
+ `builtin_define_std' takes a string representing the name of an
+ object-like macro. If it doesn't lie in the user's namespace,
+ `builtin_define_std' defines it unconditionally. Otherwise, it
+ defines a version with two leading underscores, and another version
+ with two leading and trailing underscores, and defines the original
+ only if an ISO standard was not requested on the command line. For
+ example, passing `unix' defines `__unix', `__unix__' and possibly
+ `unix'; passing `_mips' defines `__mips', `__mips__' and possibly
+ `_mips', and passing `_ABI64' defines only `_ABI64'.
+
+ You can also test for the C dialect being compiled. The variable
+ `c_language' is set to one of `clk_c', `clk_cplusplus' or
+ `clk_objective_c'. Note that if we are preprocessing assembler,
+ this variable will be `clk_c' but the function-like macro
+ `preprocessing_asm_p()' will return true, so you might want to
+ check for that first. If you need to check for strict ANSI, the
+ variable `flag_iso' can be used. The function-like macro
+ `preprocessing_trad_p()' can be used to check for traditional
+ preprocessing.
+
+ -- Macro: TARGET_OS_CPP_BUILTINS ()
+ Similarly to `TARGET_CPU_CPP_BUILTINS' but this macro is optional
+ and is used for the target operating system instead.
+
+ -- Macro: TARGET_OBJFMT_CPP_BUILTINS ()
+ Similarly to `TARGET_CPU_CPP_BUILTINS' but this macro is optional
+ and is used for the target object format. `elfos.h' uses this
+ macro to define `__ELF__', so you probably do not need to define
+ it yourself.
+
+ -- Variable: extern int target_flags
+ This variable is declared in `options.h', which is included before
+ any target-specific headers.
+
+ -- Variable: Target Hook int TARGET_DEFAULT_TARGET_FLAGS
+ This variable specifies the initial value of `target_flags'. Its
+ default setting is 0.
+
+ -- Target Hook: bool TARGET_HANDLE_OPTION (size_t CODE, const char
+ *ARG, int VALUE)
+ This hook is called whenever the user specifies one of the
+ target-specific options described by the `.opt' definition files
+ (*note Options::). It has the opportunity to do some
+ option-specific processing and should return true if the option is
+ valid. The default definition does nothing but return true.
+
+ CODE specifies the `OPT_NAME' enumeration value associated with
+ the selected option; NAME is just a rendering of the option name
+ in which non-alphanumeric characters are replaced by underscores.
+ ARG specifies the string argument and is null if no argument was
+ given. If the option is flagged as a `UInteger' (*note Option
+ properties::), VALUE is the numeric value of the argument.
+ Otherwise VALUE is 1 if the positive form of the option was used
+ and 0 if the "no-" form was.
+
+ -- Target Hook: bool TARGET_HANDLE_C_OPTION (size_t CODE, const char
+ *ARG, int VALUE)
+ This target hook is called whenever the user specifies one of the
+ target-specific C language family options described by the `.opt'
+ definition files(*note Options::). It has the opportunity to do
+ some option-specific processing and should return true if the
+ option is valid. The default definition does nothing but return
+ false.
+
+ In general, you should use `TARGET_HANDLE_OPTION' to handle
+ options. However, if processing an option requires routines that
+ are only available in the C (and related language) front ends,
+ then you should use `TARGET_HANDLE_C_OPTION' instead.
+
+ -- Macro: TARGET_VERSION
+ This macro is a C statement to print on `stderr' a string
+ describing the particular machine description choice. Every
+ machine description should define `TARGET_VERSION'. For example:
+
+ #ifdef MOTOROLA
+ #define TARGET_VERSION \
+ fprintf (stderr, " (68k, Motorola syntax)");
+ #else
+ #define TARGET_VERSION \
+ fprintf (stderr, " (68k, MIT syntax)");
+ #endif
+
+ -- Macro: OVERRIDE_OPTIONS
+ Sometimes certain combinations of command options do not make
+ sense on a particular target machine. You can define a macro
+ `OVERRIDE_OPTIONS' to take account of this. This macro, if
+ defined, is executed once just after all the command options have
+ been parsed.
+
+ Don't use this macro to turn on various extra optimizations for
+ `-O'. That is what `OPTIMIZATION_OPTIONS' is for.
+
+ -- Macro: C_COMMON_OVERRIDE_OPTIONS
+ This is similar to `OVERRIDE_OPTIONS' but is only used in the C
+ language frontends (C, Objective-C, C++, Objective-C++) and so can
+ be used to alter option flag variables which only exist in those
+ frontends.
+
+ -- Macro: OPTIMIZATION_OPTIONS (LEVEL, SIZE)
+ Some machines may desire to change what optimizations are
+ performed for various optimization levels. This macro, if
+ defined, is executed once just after the optimization level is
+ determined and before the remainder of the command options have
+ been parsed. Values set in this macro are used as the default
+ values for the other command line options.
+
+ LEVEL is the optimization level specified; 2 if `-O2' is
+ specified, 1 if `-O' is specified, and 0 if neither is specified.
+
+ SIZE is nonzero if `-Os' is specified and zero otherwise.
+
+ This macro is run once at program startup and when the optimization
+ options are changed via `#pragma GCC optimize' or by using the
+ `optimize' attribute.
+
+ *Do not examine `write_symbols' in this macro!* The debugging
+ options are not supposed to alter the generated code.
+
+ -- Target Hook: bool TARGET_HELP (void)
+ This hook is called in response to the user invoking
+ `--target-help' on the command line. It gives the target a chance
+ to display extra information on the target specific command line
+ options found in its `.opt' file.
+
+ -- Macro: CAN_DEBUG_WITHOUT_FP
+ Define this macro if debugging can be performed even without a
+ frame pointer. If this macro is defined, GCC will turn on the
+ `-fomit-frame-pointer' option whenever `-O' is specified.
+
+
+File: gccint.info, Node: Per-Function Data, Next: Storage Layout, Prev: Run-time Target, Up: Target Macros
+
+17.4 Defining data structures for per-function information.
+===========================================================
+
+If the target needs to store information on a per-function basis, GCC
+provides a macro and a couple of variables to allow this. Note, just
+using statics to store the information is a bad idea, since GCC supports
+nested functions, so you can be halfway through encoding one function
+when another one comes along.
+
+ GCC defines a data structure called `struct function' which contains
+all of the data specific to an individual function. This structure
+contains a field called `machine' whose type is `struct
+machine_function *', which can be used by targets to point to their own
+specific data.
+
+ If a target needs per-function specific data it should define the type
+`struct machine_function' and also the macro `INIT_EXPANDERS'. This
+macro should be used to initialize the function pointer
+`init_machine_status'. This pointer is explained below.
+
+ One typical use of per-function, target specific data is to create an
+RTX to hold the register containing the function's return address. This
+RTX can then be used to implement the `__builtin_return_address'
+function, for level 0.
+
+ Note--earlier implementations of GCC used a single data area to hold
+all of the per-function information. Thus when processing of a nested
+function began the old per-function data had to be pushed onto a stack,
+and when the processing was finished, it had to be popped off the
+stack. GCC used to provide function pointers called
+`save_machine_status' and `restore_machine_status' to handle the saving
+and restoring of the target specific information. Since the single
+data area approach is no longer used, these pointers are no longer
+supported.
+
+ -- Macro: INIT_EXPANDERS
+ Macro called to initialize any target specific information. This
+ macro is called once per function, before generation of any RTL
+ has begun. The intention of this macro is to allow the
+ initialization of the function pointer `init_machine_status'.
+
+ -- Variable: void (*)(struct function *) init_machine_status
+ If this function pointer is non-`NULL' it will be called once per
+ function, before function compilation starts, in order to allow the
+ target to perform any target specific initialization of the
+ `struct function' structure. It is intended that this would be
+ used to initialize the `machine' of that structure.
+
+ `struct machine_function' structures are expected to be freed by
+ GC. Generally, any memory that they reference must be allocated
+ by using `ggc_alloc', including the structure itself.
+
+
+File: gccint.info, Node: Storage Layout, Next: Type Layout, Prev: Per-Function Data, Up: Target Macros
+
+17.5 Storage Layout
+===================
+
+Note that the definitions of the macros in this table which are sizes or
+alignments measured in bits do not need to be constant. They can be C
+expressions that refer to static variables, such as the `target_flags'.
+*Note Run-time Target::.
+
+ -- Macro: BITS_BIG_ENDIAN
+ Define this macro to have the value 1 if the most significant bit
+ in a byte has the lowest number; otherwise define it to have the
+ value zero. This means that bit-field instructions count from the
+ most significant bit. If the machine has no bit-field
+ instructions, then this must still be defined, but it doesn't
+ matter which value it is defined to. This macro need not be a
+ constant.
+
+ This macro does not affect the way structure fields are packed into
+ bytes or words; that is controlled by `BYTES_BIG_ENDIAN'.
+
+ -- Macro: BYTES_BIG_ENDIAN
+ Define this macro to have the value 1 if the most significant byte
+ in a word has the lowest number. This macro need not be a
+ constant.
+
+ -- Macro: WORDS_BIG_ENDIAN
+ Define this macro to have the value 1 if, in a multiword object,
+ the most significant word has the lowest number. This applies to
+ both memory locations and registers; GCC fundamentally assumes
+ that the order of words in memory is the same as the order in
+ registers. This macro need not be a constant.
+
+ -- Macro: LIBGCC2_WORDS_BIG_ENDIAN
+ Define this macro if `WORDS_BIG_ENDIAN' is not constant. This
+ must be a constant value with the same meaning as
+ `WORDS_BIG_ENDIAN', which will be used only when compiling
+ `libgcc2.c'. Typically the value will be set based on
+ preprocessor defines.
+
+ -- Macro: FLOAT_WORDS_BIG_ENDIAN
+ Define this macro to have the value 1 if `DFmode', `XFmode' or
+ `TFmode' floating point numbers are stored in memory with the word
+ containing the sign bit at the lowest address; otherwise define it
+ to have the value 0. This macro need not be a constant.
+
+ You need not define this macro if the ordering is the same as for
+ multi-word integers.
+
+ -- Macro: BITS_PER_UNIT
+ Define this macro to be the number of bits in an addressable
+ storage unit (byte). If you do not define this macro the default
+ is 8.
+
+ -- Macro: BITS_PER_WORD
+ Number of bits in a word. If you do not define this macro, the
+ default is `BITS_PER_UNIT * UNITS_PER_WORD'.
+
+ -- Macro: MAX_BITS_PER_WORD
+ Maximum number of bits in a word. If this is undefined, the
+ default is `BITS_PER_WORD'. Otherwise, it is the constant value
+ that is the largest value that `BITS_PER_WORD' can have at
+ run-time.
+
+ -- Macro: UNITS_PER_WORD
+ Number of storage units in a word; normally the size of a
+ general-purpose register, a power of two from 1 or 8.
+
+ -- Macro: MIN_UNITS_PER_WORD
+ Minimum number of units in a word. If this is undefined, the
+ default is `UNITS_PER_WORD'. Otherwise, it is the constant value
+ that is the smallest value that `UNITS_PER_WORD' can have at
+ run-time.
+
+ -- Macro: UNITS_PER_SIMD_WORD (MODE)
+ Number of units in the vectors that the vectorizer can produce for
+ scalar mode MODE. The default is equal to `UNITS_PER_WORD',
+ because the vectorizer can do some transformations even in absence
+ of specialized SIMD hardware.
+
+ -- Macro: POINTER_SIZE
+ Width of a pointer, in bits. You must specify a value no wider
+ than the width of `Pmode'. If it is not equal to the width of
+ `Pmode', you must define `POINTERS_EXTEND_UNSIGNED'. If you do
+ not specify a value the default is `BITS_PER_WORD'.
+
+ -- Macro: POINTERS_EXTEND_UNSIGNED
+ A C expression that determines how pointers should be extended from
+ `ptr_mode' to either `Pmode' or `word_mode'. It is greater than
+ zero if pointers should be zero-extended, zero if they should be
+ sign-extended, and negative if some other sort of conversion is
+ needed. In the last case, the extension is done by the target's
+ `ptr_extend' instruction.
+
+ You need not define this macro if the `ptr_mode', `Pmode' and
+ `word_mode' are all the same width.
+
+ -- Macro: PROMOTE_MODE (M, UNSIGNEDP, TYPE)
+ A macro to update M and UNSIGNEDP when an object whose type is
+ TYPE and which has the specified mode and signedness is to be
+ stored in a register. This macro is only called when TYPE is a
+ scalar type.
+
+ On most RISC machines, which only have operations that operate on
+ a full register, define this macro to set M to `word_mode' if M is
+ an integer mode narrower than `BITS_PER_WORD'. In most cases,
+ only integer modes should be widened because wider-precision
+ floating-point operations are usually more expensive than their
+ narrower counterparts.
+
+ For most machines, the macro definition does not change UNSIGNEDP.
+ However, some machines, have instructions that preferentially
+ handle either signed or unsigned quantities of certain modes. For
+ example, on the DEC Alpha, 32-bit loads from memory and 32-bit add
+ instructions sign-extend the result to 64 bits. On such machines,
+ set UNSIGNEDP according to which kind of extension is more
+ efficient.
+
+ Do not define this macro if it would never modify M.
+
+ -- Macro: PROMOTE_FUNCTION_MODE
+ Like `PROMOTE_MODE', but is applied to outgoing function arguments
+ or function return values, as specified by
+ `TARGET_PROMOTE_FUNCTION_ARGS' and
+ `TARGET_PROMOTE_FUNCTION_RETURN', respectively.
+
+ The default is `PROMOTE_MODE'.
+
+ -- Target Hook: bool TARGET_PROMOTE_FUNCTION_ARGS (tree FNTYPE)
+ This target hook should return `true' if the promotion described by
+ `PROMOTE_FUNCTION_MODE' should be done for outgoing function
+ arguments.
+
+ -- Target Hook: bool TARGET_PROMOTE_FUNCTION_RETURN (tree FNTYPE)
+ This target hook should return `true' if the promotion described by
+ `PROMOTE_FUNCTION_MODE' should be done for the return value of
+ functions.
+
+ If this target hook returns `true', `TARGET_FUNCTION_VALUE' must
+ perform the same promotions done by `PROMOTE_FUNCTION_MODE'.
+
+ -- Macro: PARM_BOUNDARY
+ Normal alignment required for function parameters on the stack, in
+ bits. All stack parameters receive at least this much alignment
+ regardless of data type. On most machines, this is the same as the
+ size of an integer.
+
+ -- Macro: STACK_BOUNDARY
+ Define this macro to the minimum alignment enforced by hardware
+ for the stack pointer on this machine. The definition is a C
+ expression for the desired alignment (measured in bits). This
+ value is used as a default if `PREFERRED_STACK_BOUNDARY' is not
+ defined. On most machines, this should be the same as
+ `PARM_BOUNDARY'.
+
+ -- Macro: PREFERRED_STACK_BOUNDARY
+ Define this macro if you wish to preserve a certain alignment for
+ the stack pointer, greater than what the hardware enforces. The
+ definition is a C expression for the desired alignment (measured
+ in bits). This macro must evaluate to a value equal to or larger
+ than `STACK_BOUNDARY'.
+
+ -- Macro: INCOMING_STACK_BOUNDARY
+ Define this macro if the incoming stack boundary may be different
+ from `PREFERRED_STACK_BOUNDARY'. This macro must evaluate to a
+ value equal to or larger than `STACK_BOUNDARY'.
+
+ -- Macro: FUNCTION_BOUNDARY
+ Alignment required for a function entry point, in bits.
+
+ -- Macro: BIGGEST_ALIGNMENT
+ Biggest alignment that any data type can require on this machine,
+ in bits. Note that this is not the biggest alignment that is
+ supported, just the biggest alignment that, when violated, may
+ cause a fault.
+
+ -- Macro: MALLOC_ABI_ALIGNMENT
+ Alignment, in bits, a C conformant malloc implementation has to
+ provide. If not defined, the default value is `BITS_PER_WORD'.
+
+ -- Macro: ATTRIBUTE_ALIGNED_VALUE
+ Alignment used by the `__attribute__ ((aligned))' construct. If
+ not defined, the default value is `BIGGEST_ALIGNMENT'.
+
+ -- Macro: MINIMUM_ATOMIC_ALIGNMENT
+ If defined, the smallest alignment, in bits, that can be given to
+ an object that can be referenced in one operation, without
+ disturbing any nearby object. Normally, this is `BITS_PER_UNIT',
+ but may be larger on machines that don't have byte or half-word
+ store operations.
+
+ -- Macro: BIGGEST_FIELD_ALIGNMENT
+ Biggest alignment that any structure or union field can require on
+ this machine, in bits. If defined, this overrides
+ `BIGGEST_ALIGNMENT' for structure and union fields only, unless
+ the field alignment has been set by the `__attribute__ ((aligned
+ (N)))' construct.
+
+ -- Macro: ADJUST_FIELD_ALIGN (FIELD, COMPUTED)
+ An expression for the alignment of a structure field FIELD if the
+ alignment computed in the usual way (including applying of
+ `BIGGEST_ALIGNMENT' and `BIGGEST_FIELD_ALIGNMENT' to the
+ alignment) is COMPUTED. It overrides alignment only if the field
+ alignment has not been set by the `__attribute__ ((aligned (N)))'
+ construct.
+
+ -- Macro: MAX_STACK_ALIGNMENT
+ Biggest stack alignment guaranteed by the backend. Use this macro
+ to specify the maximum alignment of a variable on stack.
+
+ If not defined, the default value is `STACK_BOUNDARY'.
+
+
+ -- Macro: MAX_OFILE_ALIGNMENT
+ Biggest alignment supported by the object file format of this
+ machine. Use this macro to limit the alignment which can be
+ specified using the `__attribute__ ((aligned (N)))' construct. If
+ not defined, the default value is `BIGGEST_ALIGNMENT'.
+
+ On systems that use ELF, the default (in `config/elfos.h') is the
+ largest supported 32-bit ELF section alignment representable on a
+ 32-bit host e.g. `(((unsigned HOST_WIDEST_INT) 1 << 28) * 8)'. On
+ 32-bit ELF the largest supported section alignment in bits is
+ `(0x80000000 * 8)', but this is not representable on 32-bit hosts.
+
+ -- Macro: DATA_ALIGNMENT (TYPE, BASIC-ALIGN)
+ If defined, a C expression to compute the alignment for a variable
+ in the static store. TYPE is the data type, and BASIC-ALIGN is
+ the alignment that the object would ordinarily have. The value of
+ this macro is used instead of that alignment to align the object.
+
+ If this macro is not defined, then BASIC-ALIGN is used.
+
+ One use of this macro is to increase alignment of medium-size data
+ to make it all fit in fewer cache lines. Another is to cause
+ character arrays to be word-aligned so that `strcpy' calls that
+ copy constants to character arrays can be done inline.
+
+ -- Macro: CONSTANT_ALIGNMENT (CONSTANT, BASIC-ALIGN)
+ If defined, a C expression to compute the alignment given to a
+ constant that is being placed in memory. CONSTANT is the constant
+ and BASIC-ALIGN is the alignment that the object would ordinarily
+ have. The value of this macro is used instead of that alignment to
+ align the object.
+
+ If this macro is not defined, then BASIC-ALIGN is used.
+
+ The typical use of this macro is to increase alignment for string
+ constants to be word aligned so that `strcpy' calls that copy
+ constants can be done inline.
+
+ -- Macro: LOCAL_ALIGNMENT (TYPE, BASIC-ALIGN)
+ If defined, a C expression to compute the alignment for a variable
+ in the local store. TYPE is the data type, and BASIC-ALIGN is the
+ alignment that the object would ordinarily have. The value of this
+ macro is used instead of that alignment to align the object.
+
+ If this macro is not defined, then BASIC-ALIGN is used.
+
+ One use of this macro is to increase alignment of medium-size data
+ to make it all fit in fewer cache lines.
+
+ -- Macro: STACK_SLOT_ALIGNMENT (TYPE, MODE, BASIC-ALIGN)
+ If defined, a C expression to compute the alignment for stack slot.
+ TYPE is the data type, MODE is the widest mode available, and
+ BASIC-ALIGN is the alignment that the slot would ordinarily have.
+ The value of this macro is used instead of that alignment to align
+ the slot.
+
+ If this macro is not defined, then BASIC-ALIGN is used when TYPE
+ is `NULL'. Otherwise, `LOCAL_ALIGNMENT' will be used.
+
+ This macro is to set alignment of stack slot to the maximum
+ alignment of all possible modes which the slot may have.
+
+ -- Macro: LOCAL_DECL_ALIGNMENT (DECL)
+ If defined, a C expression to compute the alignment for a local
+ variable DECL.
+
+ If this macro is not defined, then `LOCAL_ALIGNMENT (TREE_TYPE
+ (DECL), DECL_ALIGN (DECL))' is used.
+
+ One use of this macro is to increase alignment of medium-size data
+ to make it all fit in fewer cache lines.
+
+ -- Macro: MINIMUM_ALIGNMENT (EXP, MODE, ALIGN)
+ If defined, a C expression to compute the minimum required
+ alignment for dynamic stack realignment purposes for EXP (a type
+ or decl), MODE, assuming normal alignment ALIGN.
+
+ If this macro is not defined, then ALIGN will be used.
+
+ -- Macro: EMPTY_FIELD_BOUNDARY
+ Alignment in bits to be given to a structure bit-field that
+ follows an empty field such as `int : 0;'.
+
+ If `PCC_BITFIELD_TYPE_MATTERS' is true, it overrides this macro.
+
+ -- Macro: STRUCTURE_SIZE_BOUNDARY
+ Number of bits which any structure or union's size must be a
+ multiple of. Each structure or union's size is rounded up to a
+ multiple of this.
+
+ If you do not define this macro, the default is the same as
+ `BITS_PER_UNIT'.
+
+ -- Macro: STRICT_ALIGNMENT
+ Define this macro to be the value 1 if instructions will fail to
+ work if given data not on the nominal alignment. If instructions
+ will merely go slower in that case, define this macro as 0.
+
+ -- Macro: PCC_BITFIELD_TYPE_MATTERS
+ Define this if you wish to imitate the way many other C compilers
+ handle alignment of bit-fields and the structures that contain
+ them.
+
+ The behavior is that the type written for a named bit-field (`int',
+ `short', or other integer type) imposes an alignment for the entire
+ structure, as if the structure really did contain an ordinary
+ field of that type. In addition, the bit-field is placed within
+ the structure so that it would fit within such a field, not
+ crossing a boundary for it.
+
+ Thus, on most machines, a named bit-field whose type is written as
+ `int' would not cross a four-byte boundary, and would force
+ four-byte alignment for the whole structure. (The alignment used
+ may not be four bytes; it is controlled by the other alignment
+ parameters.)
+
+ An unnamed bit-field will not affect the alignment of the
+ containing structure.
+
+ If the macro is defined, its definition should be a C expression;
+ a nonzero value for the expression enables this behavior.
+
+ Note that if this macro is not defined, or its value is zero, some
+ bit-fields may cross more than one alignment boundary. The
+ compiler can support such references if there are `insv', `extv',
+ and `extzv' insns that can directly reference memory.
+
+ The other known way of making bit-fields work is to define
+ `STRUCTURE_SIZE_BOUNDARY' as large as `BIGGEST_ALIGNMENT'. Then
+ every structure can be accessed with fullwords.
+
+ Unless the machine has bit-field instructions or you define
+ `STRUCTURE_SIZE_BOUNDARY' that way, you must define
+ `PCC_BITFIELD_TYPE_MATTERS' to have a nonzero value.
+
+ If your aim is to make GCC use the same conventions for laying out
+ bit-fields as are used by another compiler, here is how to
+ investigate what the other compiler does. Compile and run this
+ program:
+
+ struct foo1
+ {
+ char x;
+ char :0;
+ char y;
+ };
+
+ struct foo2
+ {
+ char x;
+ int :0;
+ char y;
+ };
+
+ main ()
+ {
+ printf ("Size of foo1 is %d\n",
+ sizeof (struct foo1));
+ printf ("Size of foo2 is %d\n",
+ sizeof (struct foo2));
+ exit (0);
+ }
+
+ If this prints 2 and 5, then the compiler's behavior is what you
+ would get from `PCC_BITFIELD_TYPE_MATTERS'.
+
+ -- Macro: BITFIELD_NBYTES_LIMITED
+ Like `PCC_BITFIELD_TYPE_MATTERS' except that its effect is limited
+ to aligning a bit-field within the structure.
+
+ -- Target Hook: bool TARGET_ALIGN_ANON_BITFIELD (void)
+ When `PCC_BITFIELD_TYPE_MATTERS' is true this hook will determine
+ whether unnamed bitfields affect the alignment of the containing
+ structure. The hook should return true if the structure should
+ inherit the alignment requirements of an unnamed bitfield's type.
+
+ -- Target Hook: bool TARGET_NARROW_VOLATILE_BITFIELD (void)
+ This target hook should return `true' if accesses to volatile
+ bitfields should use the narrowest mode possible. It should
+ return `false' if these accesses should use the bitfield container
+ type.
+
+ The default is `!TARGET_STRICT_ALIGN'.
+
+ -- Macro: MEMBER_TYPE_FORCES_BLK (FIELD, MODE)
+ Return 1 if a structure or array containing FIELD should be
+ accessed using `BLKMODE'.
+
+ If FIELD is the only field in the structure, MODE is its mode,
+ otherwise MODE is VOIDmode. MODE is provided in the case where
+ structures of one field would require the structure's mode to
+ retain the field's mode.
+
+ Normally, this is not needed.
+
+ -- Macro: ROUND_TYPE_ALIGN (TYPE, COMPUTED, SPECIFIED)
+ Define this macro as an expression for the alignment of a type
+ (given by TYPE as a tree node) if the alignment computed in the
+ usual way is COMPUTED and the alignment explicitly specified was
+ SPECIFIED.
+
+ The default is to use SPECIFIED if it is larger; otherwise, use
+ the smaller of COMPUTED and `BIGGEST_ALIGNMENT'
+
+ -- Macro: MAX_FIXED_MODE_SIZE
+ An integer expression for the size in bits of the largest integer
+ machine mode that should actually be used. All integer machine
+ modes of this size or smaller can be used for structures and
+ unions with the appropriate sizes. If this macro is undefined,
+ `GET_MODE_BITSIZE (DImode)' is assumed.
+
+ -- Macro: STACK_SAVEAREA_MODE (SAVE_LEVEL)
+ If defined, an expression of type `enum machine_mode' that
+ specifies the mode of the save area operand of a
+ `save_stack_LEVEL' named pattern (*note Standard Names::).
+ SAVE_LEVEL is one of `SAVE_BLOCK', `SAVE_FUNCTION', or
+ `SAVE_NONLOCAL' and selects which of the three named patterns is
+ having its mode specified.
+
+ You need not define this macro if it always returns `Pmode'. You
+ would most commonly define this macro if the `save_stack_LEVEL'
+ patterns need to support both a 32- and a 64-bit mode.
+
+ -- Macro: STACK_SIZE_MODE
+ If defined, an expression of type `enum machine_mode' that
+ specifies the mode of the size increment operand of an
+ `allocate_stack' named pattern (*note Standard Names::).
+
+ You need not define this macro if it always returns `word_mode'.
+ You would most commonly define this macro if the `allocate_stack'
+ pattern needs to support both a 32- and a 64-bit mode.
+
+ -- Target Hook: enum machine_mode TARGET_LIBGCC_CMP_RETURN_MODE ()
+ This target hook should return the mode to be used for the return
+ value of compare instructions expanded to libgcc calls. If not
+ defined `word_mode' is returned which is the right choice for a
+ majority of targets.
+
+ -- Target Hook: enum machine_mode TARGET_LIBGCC_SHIFT_COUNT_MODE ()
+ This target hook should return the mode to be used for the shift
+ count operand of shift instructions expanded to libgcc calls. If
+ not defined `word_mode' is returned which is the right choice for
+ a majority of targets.
+
+ -- Macro: ROUND_TOWARDS_ZERO
+ If defined, this macro should be true if the prevailing rounding
+ mode is towards zero.
+
+ Defining this macro only affects the way `libgcc.a' emulates
+ floating-point arithmetic.
+
+ Not defining this macro is equivalent to returning zero.
+
+ -- Macro: LARGEST_EXPONENT_IS_NORMAL (SIZE)
+ This macro should return true if floats with SIZE bits do not have
+ a NaN or infinity representation, but use the largest exponent for
+ normal numbers instead.
+
+ Defining this macro only affects the way `libgcc.a' emulates
+ floating-point arithmetic.
+
+ The default definition of this macro returns false for all sizes.
+
+ -- Target Hook: bool TARGET_VECTOR_OPAQUE_P (tree TYPE)
+ This target hook should return `true' a vector is opaque. That
+ is, if no cast is needed when copying a vector value of type TYPE
+ into another vector lvalue of the same size. Vector opaque types
+ cannot be initialized. The default is that there are no such
+ types.
+
+ -- Target Hook: bool TARGET_MS_BITFIELD_LAYOUT_P (tree RECORD_TYPE)
+ This target hook returns `true' if bit-fields in the given
+ RECORD_TYPE are to be laid out following the rules of Microsoft
+ Visual C/C++, namely: (i) a bit-field won't share the same storage
+ unit with the previous bit-field if their underlying types have
+ different sizes, and the bit-field will be aligned to the highest
+ alignment of the underlying types of itself and of the previous
+ bit-field; (ii) a zero-sized bit-field will affect the alignment of
+ the whole enclosing structure, even if it is unnamed; except that
+ (iii) a zero-sized bit-field will be disregarded unless it follows
+ another bit-field of nonzero size. If this hook returns `true',
+ other macros that control bit-field layout are ignored.
+
+ When a bit-field is inserted into a packed record, the whole size
+ of the underlying type is used by one or more same-size adjacent
+ bit-fields (that is, if its long:3, 32 bits is used in the record,
+ and any additional adjacent long bit-fields are packed into the
+ same chunk of 32 bits. However, if the size changes, a new field
+ of that size is allocated). In an unpacked record, this is the
+ same as using alignment, but not equivalent when packing.
+
+ If both MS bit-fields and `__attribute__((packed))' are used, the
+ latter will take precedence. If `__attribute__((packed))' is used
+ on a single field when MS bit-fields are in use, it will take
+ precedence for that field, but the alignment of the rest of the
+ structure may affect its placement.
+
+ -- Target Hook: bool TARGET_DECIMAL_FLOAT_SUPPORTED_P (void)
+ Returns true if the target supports decimal floating point.
+
+ -- Target Hook: bool TARGET_FIXED_POINT_SUPPORTED_P (void)
+ Returns true if the target supports fixed-point arithmetic.
+
+ -- Target Hook: void TARGET_EXPAND_TO_RTL_HOOK (void)
+ This hook is called just before expansion into rtl, allowing the
+ target to perform additional initializations or analysis before
+ the expansion. For example, the rs6000 port uses it to allocate a
+ scratch stack slot for use in copying SDmode values between memory
+ and floating point registers whenever the function being expanded
+ has any SDmode usage.
+
+ -- Target Hook: void TARGET_INSTANTIATE_DECLS (void)
+ This hook allows the backend to perform additional instantiations
+ on rtl that are not actually in any insns yet, but will be later.
+
+ -- Target Hook: const char * TARGET_MANGLE_TYPE (tree TYPE)
+ If your target defines any fundamental types, or any types your
+ target uses should be mangled differently from the default, define
+ this hook to return the appropriate encoding for these types as
+ part of a C++ mangled name. The TYPE argument is the tree
+ structure representing the type to be mangled. The hook may be
+ applied to trees which are not target-specific fundamental types;
+ it should return `NULL' for all such types, as well as arguments
+ it does not recognize. If the return value is not `NULL', it must
+ point to a statically-allocated string constant.
+
+ Target-specific fundamental types might be new fundamental types or
+ qualified versions of ordinary fundamental types. Encode new
+ fundamental types as `u N NAME', where NAME is the name used for
+ the type in source code, and N is the length of NAME in decimal.
+ Encode qualified versions of ordinary types as `U N NAME CODE',
+ where NAME is the name used for the type qualifier in source code,
+ N is the length of NAME as above, and CODE is the code used to
+ represent the unqualified version of this type. (See
+ `write_builtin_type' in `cp/mangle.c' for the list of codes.) In
+ both cases the spaces are for clarity; do not include any spaces
+ in your string.
+
+ This hook is applied to types prior to typedef resolution. If the
+ mangled name for a particular type depends only on that type's
+ main variant, you can perform typedef resolution yourself using
+ `TYPE_MAIN_VARIANT' before mangling.
+
+ The default version of this hook always returns `NULL', which is
+ appropriate for a target that does not define any new fundamental
+ types.
+
+
+File: gccint.info, Node: Type Layout, Next: Registers, Prev: Storage Layout, Up: Target Macros
+
+17.6 Layout of Source Language Data Types
+=========================================
+
+These macros define the sizes and other characteristics of the standard
+basic data types used in programs being compiled. Unlike the macros in
+the previous section, these apply to specific features of C and related
+languages, rather than to fundamental aspects of storage layout.
+
+ -- Macro: INT_TYPE_SIZE
+ A C expression for the size in bits of the type `int' on the
+ target machine. If you don't define this, the default is one word.
+
+ -- Macro: SHORT_TYPE_SIZE
+ A C expression for the size in bits of the type `short' on the
+ target machine. If you don't define this, the default is half a
+ word. (If this would be less than one storage unit, it is rounded
+ up to one unit.)
+
+ -- Macro: LONG_TYPE_SIZE
+ A C expression for the size in bits of the type `long' on the
+ target machine. If you don't define this, the default is one word.
+
+ -- Macro: ADA_LONG_TYPE_SIZE
+ On some machines, the size used for the Ada equivalent of the type
+ `long' by a native Ada compiler differs from that used by C. In
+ that situation, define this macro to be a C expression to be used
+ for the size of that type. If you don't define this, the default
+ is the value of `LONG_TYPE_SIZE'.
+
+ -- Macro: LONG_LONG_TYPE_SIZE
+ A C expression for the size in bits of the type `long long' on the
+ target machine. If you don't define this, the default is two
+ words. If you want to support GNU Ada on your machine, the value
+ of this macro must be at least 64.
+
+ -- Macro: CHAR_TYPE_SIZE
+ A C expression for the size in bits of the type `char' on the
+ target machine. If you don't define this, the default is
+ `BITS_PER_UNIT'.
+
+ -- Macro: BOOL_TYPE_SIZE
+ A C expression for the size in bits of the C++ type `bool' and C99
+ type `_Bool' on the target machine. If you don't define this, and
+ you probably shouldn't, the default is `CHAR_TYPE_SIZE'.
+
+ -- Macro: FLOAT_TYPE_SIZE
+ A C expression for the size in bits of the type `float' on the
+ target machine. If you don't define this, the default is one word.
+
+ -- Macro: DOUBLE_TYPE_SIZE
+ A C expression for the size in bits of the type `double' on the
+ target machine. If you don't define this, the default is two
+ words.
+
+ -- Macro: LONG_DOUBLE_TYPE_SIZE
+ A C expression for the size in bits of the type `long double' on
+ the target machine. If you don't define this, the default is two
+ words.
+
+ -- Macro: SHORT_FRACT_TYPE_SIZE
+ A C expression for the size in bits of the type `short _Fract' on
+ the target machine. If you don't define this, the default is
+ `BITS_PER_UNIT'.
+
+ -- Macro: FRACT_TYPE_SIZE
+ A C expression for the size in bits of the type `_Fract' on the
+ target machine. If you don't define this, the default is
+ `BITS_PER_UNIT * 2'.
+
+ -- Macro: LONG_FRACT_TYPE_SIZE
+ A C expression for the size in bits of the type `long _Fract' on
+ the target machine. If you don't define this, the default is
+ `BITS_PER_UNIT * 4'.
+
+ -- Macro: LONG_LONG_FRACT_TYPE_SIZE
+ A C expression for the size in bits of the type `long long _Fract'
+ on the target machine. If you don't define this, the default is
+ `BITS_PER_UNIT * 8'.
+
+ -- Macro: SHORT_ACCUM_TYPE_SIZE
+ A C expression for the size in bits of the type `short _Accum' on
+ the target machine. If you don't define this, the default is
+ `BITS_PER_UNIT * 2'.
+
+ -- Macro: ACCUM_TYPE_SIZE
+ A C expression for the size in bits of the type `_Accum' on the
+ target machine. If you don't define this, the default is
+ `BITS_PER_UNIT * 4'.
+
+ -- Macro: LONG_ACCUM_TYPE_SIZE
+ A C expression for the size in bits of the type `long _Accum' on
+ the target machine. If you don't define this, the default is
+ `BITS_PER_UNIT * 8'.
+
+ -- Macro: LONG_LONG_ACCUM_TYPE_SIZE
+ A C expression for the size in bits of the type `long long _Accum'
+ on the target machine. If you don't define this, the default is
+ `BITS_PER_UNIT * 16'.
+
+ -- Macro: LIBGCC2_LONG_DOUBLE_TYPE_SIZE
+ Define this macro if `LONG_DOUBLE_TYPE_SIZE' is not constant or if
+ you want routines in `libgcc2.a' for a size other than
+ `LONG_DOUBLE_TYPE_SIZE'. If you don't define this, the default is
+ `LONG_DOUBLE_TYPE_SIZE'.
+
+ -- Macro: LIBGCC2_HAS_DF_MODE
+ Define this macro if neither `LIBGCC2_DOUBLE_TYPE_SIZE' nor
+ `LIBGCC2_LONG_DOUBLE_TYPE_SIZE' is `DFmode' but you want `DFmode'
+ routines in `libgcc2.a' anyway. If you don't define this and
+ either `LIBGCC2_DOUBLE_TYPE_SIZE' or
+ `LIBGCC2_LONG_DOUBLE_TYPE_SIZE' is 64 then the default is 1,
+ otherwise it is 0.
+
+ -- Macro: LIBGCC2_HAS_XF_MODE
+ Define this macro if `LIBGCC2_LONG_DOUBLE_TYPE_SIZE' is not
+ `XFmode' but you want `XFmode' routines in `libgcc2.a' anyway. If
+ you don't define this and `LIBGCC2_LONG_DOUBLE_TYPE_SIZE' is 80
+ then the default is 1, otherwise it is 0.
+
+ -- Macro: LIBGCC2_HAS_TF_MODE
+ Define this macro if `LIBGCC2_LONG_DOUBLE_TYPE_SIZE' is not
+ `TFmode' but you want `TFmode' routines in `libgcc2.a' anyway. If
+ you don't define this and `LIBGCC2_LONG_DOUBLE_TYPE_SIZE' is 128
+ then the default is 1, otherwise it is 0.
+
+ -- Macro: SF_SIZE
+ -- Macro: DF_SIZE
+ -- Macro: XF_SIZE
+ -- Macro: TF_SIZE
+ Define these macros to be the size in bits of the mantissa of
+ `SFmode', `DFmode', `XFmode' and `TFmode' values, if the defaults
+ in `libgcc2.h' are inappropriate. By default, `FLT_MANT_DIG' is
+ used for `SF_SIZE', `LDBL_MANT_DIG' for `XF_SIZE' and `TF_SIZE',
+ and `DBL_MANT_DIG' or `LDBL_MANT_DIG' for `DF_SIZE' according to
+ whether `LIBGCC2_DOUBLE_TYPE_SIZE' or
+ `LIBGCC2_LONG_DOUBLE_TYPE_SIZE' is 64.
+
+ -- Macro: TARGET_FLT_EVAL_METHOD
+ A C expression for the value for `FLT_EVAL_METHOD' in `float.h',
+ assuming, if applicable, that the floating-point control word is
+ in its default state. If you do not define this macro the value of
+ `FLT_EVAL_METHOD' will be zero.
+
+ -- Macro: WIDEST_HARDWARE_FP_SIZE
+ A C expression for the size in bits of the widest floating-point
+ format supported by the hardware. If you define this macro, you
+ must specify a value less than or equal to the value of
+ `LONG_DOUBLE_TYPE_SIZE'. If you do not define this macro, the
+ value of `LONG_DOUBLE_TYPE_SIZE' is the default.
+
+ -- Macro: DEFAULT_SIGNED_CHAR
+ An expression whose value is 1 or 0, according to whether the type
+ `char' should be signed or unsigned by default. The user can
+ always override this default with the options `-fsigned-char' and
+ `-funsigned-char'.
+
+ -- Target Hook: bool TARGET_DEFAULT_SHORT_ENUMS (void)
+ This target hook should return true if the compiler should give an
+ `enum' type only as many bytes as it takes to represent the range
+ of possible values of that type. It should return false if all
+ `enum' types should be allocated like `int'.
+
+ The default is to return false.
+
+ -- Macro: SIZE_TYPE
+ A C expression for a string describing the name of the data type
+ to use for size values. The typedef name `size_t' is defined
+ using the contents of the string.
+
+ The string can contain more than one keyword. If so, separate
+ them with spaces, and write first any length keyword, then
+ `unsigned' if appropriate, and finally `int'. The string must
+ exactly match one of the data type names defined in the function
+ `init_decl_processing' in the file `c-decl.c'. You may not omit
+ `int' or change the order--that would cause the compiler to crash
+ on startup.
+
+ If you don't define this macro, the default is `"long unsigned
+ int"'.
+
+ -- Macro: PTRDIFF_TYPE
+ A C expression for a string describing the name of the data type
+ to use for the result of subtracting two pointers. The typedef
+ name `ptrdiff_t' is defined using the contents of the string. See
+ `SIZE_TYPE' above for more information.
+
+ If you don't define this macro, the default is `"long int"'.
+
+ -- Macro: WCHAR_TYPE
+ A C expression for a string describing the name of the data type
+ to use for wide characters. The typedef name `wchar_t' is defined
+ using the contents of the string. See `SIZE_TYPE' above for more
+ information.
+
+ If you don't define this macro, the default is `"int"'.
+
+ -- Macro: WCHAR_TYPE_SIZE
+ A C expression for the size in bits of the data type for wide
+ characters. This is used in `cpp', which cannot make use of
+ `WCHAR_TYPE'.
+
+ -- Macro: WINT_TYPE
+ A C expression for a string describing the name of the data type to
+ use for wide characters passed to `printf' and returned from
+ `getwc'. The typedef name `wint_t' is defined using the contents
+ of the string. See `SIZE_TYPE' above for more information.
+
+ If you don't define this macro, the default is `"unsigned int"'.
+
+ -- Macro: INTMAX_TYPE
+ A C expression for a string describing the name of the data type
+ that can represent any value of any standard or extended signed
+ integer type. The typedef name `intmax_t' is defined using the
+ contents of the string. See `SIZE_TYPE' above for more
+ information.
+
+ If you don't define this macro, the default is the first of
+ `"int"', `"long int"', or `"long long int"' that has as much
+ precision as `long long int'.
+
+ -- Macro: UINTMAX_TYPE
+ A C expression for a string describing the name of the data type
+ that can represent any value of any standard or extended unsigned
+ integer type. The typedef name `uintmax_t' is defined using the
+ contents of the string. See `SIZE_TYPE' above for more
+ information.
+
+ If you don't define this macro, the default is the first of
+ `"unsigned int"', `"long unsigned int"', or `"long long unsigned
+ int"' that has as much precision as `long long unsigned int'.
+
+ -- Macro: TARGET_PTRMEMFUNC_VBIT_LOCATION
+ The C++ compiler represents a pointer-to-member-function with a
+ struct that looks like:
+
+ struct {
+ union {
+ void (*fn)();
+ ptrdiff_t vtable_index;
+ };
+ ptrdiff_t delta;
+ };
+
+ The C++ compiler must use one bit to indicate whether the function
+ that will be called through a pointer-to-member-function is
+ virtual. Normally, we assume that the low-order bit of a function
+ pointer must always be zero. Then, by ensuring that the
+ vtable_index is odd, we can distinguish which variant of the union
+ is in use. But, on some platforms function pointers can be odd,
+ and so this doesn't work. In that case, we use the low-order bit
+ of the `delta' field, and shift the remainder of the `delta' field
+ to the left.
+
+ GCC will automatically make the right selection about where to
+ store this bit using the `FUNCTION_BOUNDARY' setting for your
+ platform. However, some platforms such as ARM/Thumb have
+ `FUNCTION_BOUNDARY' set such that functions always start at even
+ addresses, but the lowest bit of pointers to functions indicate
+ whether the function at that address is in ARM or Thumb mode. If
+ this is the case of your architecture, you should define this
+ macro to `ptrmemfunc_vbit_in_delta'.
+
+ In general, you should not have to define this macro. On
+ architectures in which function addresses are always even,
+ according to `FUNCTION_BOUNDARY', GCC will automatically define
+ this macro to `ptrmemfunc_vbit_in_pfn'.
+
+ -- Macro: TARGET_VTABLE_USES_DESCRIPTORS
+ Normally, the C++ compiler uses function pointers in vtables. This
+ macro allows the target to change to use "function descriptors"
+ instead. Function descriptors are found on targets for whom a
+ function pointer is actually a small data structure. Normally the
+ data structure consists of the actual code address plus a data
+ pointer to which the function's data is relative.
+
+ If vtables are used, the value of this macro should be the number
+ of words that the function descriptor occupies.
+
+ -- Macro: TARGET_VTABLE_ENTRY_ALIGN
+ By default, the vtable entries are void pointers, the so the
+ alignment is the same as pointer alignment. The value of this
+ macro specifies the alignment of the vtable entry in bits. It
+ should be defined only when special alignment is necessary. */
+
+ -- Macro: TARGET_VTABLE_DATA_ENTRY_DISTANCE
+ There are a few non-descriptor entries in the vtable at offsets
+ below zero. If these entries must be padded (say, to preserve the
+ alignment specified by `TARGET_VTABLE_ENTRY_ALIGN'), set this to
+ the number of words in each data entry.
+
+
+File: gccint.info, Node: Registers, Next: Register Classes, Prev: Type Layout, Up: Target Macros
+
+17.7 Register Usage
+===================
+
+This section explains how to describe what registers the target machine
+has, and how (in general) they can be used.
+
+ The description of which registers a specific instruction can use is
+done with register classes; see *Note Register Classes::. For
+information on using registers to access a stack frame, see *Note Frame
+Registers::. For passing values in registers, see *Note Register
+Arguments::. For returning values in registers, see *Note Scalar
+Return::.
+
+* Menu:
+
+* Register Basics:: Number and kinds of registers.
+* Allocation Order:: Order in which registers are allocated.
+* Values in Registers:: What kinds of values each reg can hold.
+* Leaf Functions:: Renumbering registers for leaf functions.
+* Stack Registers:: Handling a register stack such as 80387.
+
+
+File: gccint.info, Node: Register Basics, Next: Allocation Order, Up: Registers
+
+17.7.1 Basic Characteristics of Registers
+-----------------------------------------
+
+Registers have various characteristics.
+
+ -- Macro: FIRST_PSEUDO_REGISTER
+ Number of hardware registers known to the compiler. They receive
+ numbers 0 through `FIRST_PSEUDO_REGISTER-1'; thus, the first
+ pseudo register's number really is assigned the number
+ `FIRST_PSEUDO_REGISTER'.
+
+ -- Macro: FIXED_REGISTERS
+ An initializer that says which registers are used for fixed
+ purposes all throughout the compiled code and are therefore not
+ available for general allocation. These would include the stack
+ pointer, the frame pointer (except on machines where that can be
+ used as a general register when no frame pointer is needed), the
+ program counter on machines where that is considered one of the
+ addressable registers, and any other numbered register with a
+ standard use.
+
+ This information is expressed as a sequence of numbers, separated
+ by commas and surrounded by braces. The Nth number is 1 if
+ register N is fixed, 0 otherwise.
+
+ The table initialized from this macro, and the table initialized by
+ the following one, may be overridden at run time either
+ automatically, by the actions of the macro
+ `CONDITIONAL_REGISTER_USAGE', or by the user with the command
+ options `-ffixed-REG', `-fcall-used-REG' and `-fcall-saved-REG'.
+
+ -- Macro: CALL_USED_REGISTERS
+ Like `FIXED_REGISTERS' but has 1 for each register that is
+ clobbered (in general) by function calls as well as for fixed
+ registers. This macro therefore identifies the registers that are
+ not available for general allocation of values that must live
+ across function calls.
+
+ If a register has 0 in `CALL_USED_REGISTERS', the compiler
+ automatically saves it on function entry and restores it on
+ function exit, if the register is used within the function.
+
+ -- Macro: CALL_REALLY_USED_REGISTERS
+ Like `CALL_USED_REGISTERS' except this macro doesn't require that
+ the entire set of `FIXED_REGISTERS' be included.
+ (`CALL_USED_REGISTERS' must be a superset of `FIXED_REGISTERS').
+ This macro is optional. If not specified, it defaults to the value
+ of `CALL_USED_REGISTERS'.
+
+ -- Macro: HARD_REGNO_CALL_PART_CLOBBERED (REGNO, MODE)
+ A C expression that is nonzero if it is not permissible to store a
+ value of mode MODE in hard register number REGNO across a call
+ without some part of it being clobbered. For most machines this
+ macro need not be defined. It is only required for machines that
+ do not preserve the entire contents of a register across a call.
+
+ -- Macro: CONDITIONAL_REGISTER_USAGE
+ Zero or more C statements that may conditionally modify five
+ variables `fixed_regs', `call_used_regs', `global_regs',
+ `reg_names', and `reg_class_contents', to take into account any
+ dependence of these register sets on target flags. The first three
+ of these are of type `char []' (interpreted as Boolean vectors).
+ `global_regs' is a `const char *[]', and `reg_class_contents' is a
+ `HARD_REG_SET'. Before the macro is called, `fixed_regs',
+ `call_used_regs', `reg_class_contents', and `reg_names' have been
+ initialized from `FIXED_REGISTERS', `CALL_USED_REGISTERS',
+ `REG_CLASS_CONTENTS', and `REGISTER_NAMES', respectively.
+ `global_regs' has been cleared, and any `-ffixed-REG',
+ `-fcall-used-REG' and `-fcall-saved-REG' command options have been
+ applied.
+
+ You need not define this macro if it has no work to do.
+
+ If the usage of an entire class of registers depends on the target
+ flags, you may indicate this to GCC by using this macro to modify
+ `fixed_regs' and `call_used_regs' to 1 for each of the registers
+ in the classes which should not be used by GCC. Also define the
+ macro `REG_CLASS_FROM_LETTER' / `REG_CLASS_FROM_CONSTRAINT' to
+ return `NO_REGS' if it is called with a letter for a class that
+ shouldn't be used.
+
+ (However, if this class is not included in `GENERAL_REGS' and all
+ of the insn patterns whose constraints permit this class are
+ controlled by target switches, then GCC will automatically avoid
+ using these registers when the target switches are opposed to
+ them.)
+
+ -- Macro: INCOMING_REGNO (OUT)
+ Define this macro if the target machine has register windows.
+ This C expression returns the register number as seen by the
+ called function corresponding to the register number OUT as seen
+ by the calling function. Return OUT if register number OUT is not
+ an outbound register.
+
+ -- Macro: OUTGOING_REGNO (IN)
+ Define this macro if the target machine has register windows.
+ This C expression returns the register number as seen by the
+ calling function corresponding to the register number IN as seen
+ by the called function. Return IN if register number IN is not an
+ inbound register.
+
+ -- Macro: LOCAL_REGNO (REGNO)
+ Define this macro if the target machine has register windows.
+ This C expression returns true if the register is call-saved but
+ is in the register window. Unlike most call-saved registers, such
+ registers need not be explicitly restored on function exit or
+ during non-local gotos.
+
+ -- Macro: PC_REGNUM
+ If the program counter has a register number, define this as that
+ register number. Otherwise, do not define it.
+
+
+File: gccint.info, Node: Allocation Order, Next: Values in Registers, Prev: Register Basics, Up: Registers
+
+17.7.2 Order of Allocation of Registers
+---------------------------------------
+
+Registers are allocated in order.
+
+ -- Macro: REG_ALLOC_ORDER
+ If defined, an initializer for a vector of integers, containing the
+ numbers of hard registers in the order in which GCC should prefer
+ to use them (from most preferred to least).
+
+ If this macro is not defined, registers are used lowest numbered
+ first (all else being equal).
+
+ One use of this macro is on machines where the highest numbered
+ registers must always be saved and the save-multiple-registers
+ instruction supports only sequences of consecutive registers. On
+ such machines, define `REG_ALLOC_ORDER' to be an initializer that
+ lists the highest numbered allocable register first.
+
+ -- Macro: ORDER_REGS_FOR_LOCAL_ALLOC
+ A C statement (sans semicolon) to choose the order in which to
+ allocate hard registers for pseudo-registers local to a basic
+ block.
+
+ Store the desired register order in the array `reg_alloc_order'.
+ Element 0 should be the register to allocate first; element 1, the
+ next register; and so on.
+
+ The macro body should not assume anything about the contents of
+ `reg_alloc_order' before execution of the macro.
+
+ On most machines, it is not necessary to define this macro.
+
+ -- Macro: IRA_HARD_REGNO_ADD_COST_MULTIPLIER (REGNO)
+ In some case register allocation order is not enough for the
+ Integrated Register Allocator (IRA) to generate a good code. If
+ this macro is defined, it should return a floating point value
+ based on REGNO. The cost of using REGNO for a pseudo will be
+ increased by approximately the pseudo's usage frequency times the
+ value returned by this macro. Not defining this macro is
+ equivalent to having it always return `0.0'.
+
+ On most machines, it is not necessary to define this macro.
+
+
+File: gccint.info, Node: Values in Registers, Next: Leaf Functions, Prev: Allocation Order, Up: Registers
+
+17.7.3 How Values Fit in Registers
+----------------------------------
+
+This section discusses the macros that describe which kinds of values
+(specifically, which machine modes) each register can hold, and how many
+consecutive registers are needed for a given mode.
+
+ -- Macro: HARD_REGNO_NREGS (REGNO, MODE)
+ A C expression for the number of consecutive hard registers,
+ starting at register number REGNO, required to hold a value of mode
+ MODE. This macro must never return zero, even if a register
+ cannot hold the requested mode - indicate that with
+ HARD_REGNO_MODE_OK and/or CANNOT_CHANGE_MODE_CLASS instead.
+
+ On a machine where all registers are exactly one word, a suitable
+ definition of this macro is
+
+ #define HARD_REGNO_NREGS(REGNO, MODE) \
+ ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \
+ / UNITS_PER_WORD)
+
+ -- Macro: HARD_REGNO_NREGS_HAS_PADDING (REGNO, MODE)
+ A C expression that is nonzero if a value of mode MODE, stored in
+ memory, ends with padding that causes it to take up more space than
+ in registers starting at register number REGNO (as determined by
+ multiplying GCC's notion of the size of the register when
+ containing this mode by the number of registers returned by
+ `HARD_REGNO_NREGS'). By default this is zero.
+
+ For example, if a floating-point value is stored in three 32-bit
+ registers but takes up 128 bits in memory, then this would be
+ nonzero.
+
+ This macros only needs to be defined if there are cases where
+ `subreg_get_info' would otherwise wrongly determine that a
+ `subreg' can be represented by an offset to the register number,
+ when in fact such a `subreg' would contain some of the padding not
+ stored in registers and so not be representable.
+
+ -- Macro: HARD_REGNO_NREGS_WITH_PADDING (REGNO, MODE)
+ For values of REGNO and MODE for which
+ `HARD_REGNO_NREGS_HAS_PADDING' returns nonzero, a C expression
+ returning the greater number of registers required to hold the
+ value including any padding. In the example above, the value
+ would be four.
+
+ -- Macro: REGMODE_NATURAL_SIZE (MODE)
+ Define this macro if the natural size of registers that hold values
+ of mode MODE is not the word size. It is a C expression that
+ should give the natural size in bytes for the specified mode. It
+ is used by the register allocator to try to optimize its results.
+ This happens for example on SPARC 64-bit where the natural size of
+ floating-point registers is still 32-bit.
+
+ -- Macro: HARD_REGNO_MODE_OK (REGNO, MODE)
+ A C expression that is nonzero if it is permissible to store a
+ value of mode MODE in hard register number REGNO (or in several
+ registers starting with that one). For a machine where all
+ registers are equivalent, a suitable definition is
+
+ #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
+
+ You need not include code to check for the numbers of fixed
+ registers, because the allocation mechanism considers them to be
+ always occupied.
+
+ On some machines, double-precision values must be kept in even/odd
+ register pairs. You can implement that by defining this macro to
+ reject odd register numbers for such modes.
+
+ The minimum requirement for a mode to be OK in a register is that
+ the `movMODE' instruction pattern support moves between the
+ register and other hard register in the same class and that moving
+ a value into the register and back out not alter it.
+
+ Since the same instruction used to move `word_mode' will work for
+ all narrower integer modes, it is not necessary on any machine for
+ `HARD_REGNO_MODE_OK' to distinguish between these modes, provided
+ you define patterns `movhi', etc., to take advantage of this. This
+ is useful because of the interaction between `HARD_REGNO_MODE_OK'
+ and `MODES_TIEABLE_P'; it is very desirable for all integer modes
+ to be tieable.
+
+ Many machines have special registers for floating point arithmetic.
+ Often people assume that floating point machine modes are allowed
+ only in floating point registers. This is not true. Any
+ registers that can hold integers can safely _hold_ a floating
+ point machine mode, whether or not floating arithmetic can be done
+ on it in those registers. Integer move instructions can be used
+ to move the values.
+
+ On some machines, though, the converse is true: fixed-point machine
+ modes may not go in floating registers. This is true if the
+ floating registers normalize any value stored in them, because
+ storing a non-floating value there would garble it. In this case,
+ `HARD_REGNO_MODE_OK' should reject fixed-point machine modes in
+ floating registers. But if the floating registers do not
+ automatically normalize, if you can store any bit pattern in one
+ and retrieve it unchanged without a trap, then any machine mode
+ may go in a floating register, so you can define this macro to say
+ so.
+
+ The primary significance of special floating registers is rather
+ that they are the registers acceptable in floating point arithmetic
+ instructions. However, this is of no concern to
+ `HARD_REGNO_MODE_OK'. You handle it by writing the proper
+ constraints for those instructions.
+
+ On some machines, the floating registers are especially slow to
+ access, so that it is better to store a value in a stack frame
+ than in such a register if floating point arithmetic is not being
+ done. As long as the floating registers are not in class
+ `GENERAL_REGS', they will not be used unless some pattern's
+ constraint asks for one.
+
+ -- Macro: HARD_REGNO_RENAME_OK (FROM, TO)
+ A C expression that is nonzero if it is OK to rename a hard
+ register FROM to another hard register TO.
+
+ One common use of this macro is to prevent renaming of a register
+ to another register that is not saved by a prologue in an interrupt
+ handler.
+
+ The default is always nonzero.
+
+ -- Macro: MODES_TIEABLE_P (MODE1, MODE2)
+ A C expression that is nonzero if a value of mode MODE1 is
+ accessible in mode MODE2 without copying.
+
+ If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R,
+ MODE2)' are always the same for any R, then `MODES_TIEABLE_P
+ (MODE1, MODE2)' should be nonzero. If they differ for any R, you
+ should define this macro to return zero unless some other
+ mechanism ensures the accessibility of the value in a narrower
+ mode.
+
+ You should define this macro to return nonzero in as many cases as
+ possible since doing so will allow GCC to perform better register
+ allocation.
+
+ -- Target Hook: bool TARGET_HARD_REGNO_SCRATCH_OK (unsigned int REGNO)
+ This target hook should return `true' if it is OK to use a hard
+ register REGNO as scratch reg in peephole2.
+
+ One common use of this macro is to prevent using of a register that
+ is not saved by a prologue in an interrupt handler.
+
+ The default version of this hook always returns `true'.
+
+ -- Macro: AVOID_CCMODE_COPIES
+ Define this macro if the compiler should avoid copies to/from
+ `CCmode' registers. You should only define this macro if support
+ for copying to/from `CCmode' is incomplete.
+
+
+File: gccint.info, Node: Leaf Functions, Next: Stack Registers, Prev: Values in Registers, Up: Registers
+
+17.7.4 Handling Leaf Functions
+------------------------------
+
+On some machines, a leaf function (i.e., one which makes no calls) can
+run more efficiently if it does not make its own register window.
+Often this means it is required to receive its arguments in the
+registers where they are passed by the caller, instead of the registers
+where they would normally arrive.
+
+ The special treatment for leaf functions generally applies only when
+other conditions are met; for example, often they may use only those
+registers for its own variables and temporaries. We use the term "leaf
+function" to mean a function that is suitable for this special
+handling, so that functions with no calls are not necessarily "leaf
+functions".
+
+ GCC assigns register numbers before it knows whether the function is
+suitable for leaf function treatment. So it needs to renumber the
+registers in order to output a leaf function. The following macros
+accomplish this.
+
+ -- Macro: LEAF_REGISTERS
+ Name of a char vector, indexed by hard register number, which
+ contains 1 for a register that is allowable in a candidate for leaf
+ function treatment.
+
+ If leaf function treatment involves renumbering the registers,
+ then the registers marked here should be the ones before
+ renumbering--those that GCC would ordinarily allocate. The
+ registers which will actually be used in the assembler code, after
+ renumbering, should not be marked with 1 in this vector.
+
+ Define this macro only if the target machine offers a way to
+ optimize the treatment of leaf functions.
+
+ -- Macro: LEAF_REG_REMAP (REGNO)
+ A C expression whose value is the register number to which REGNO
+ should be renumbered, when a function is treated as a leaf
+ function.
+
+ If REGNO is a register number which should not appear in a leaf
+ function before renumbering, then the expression should yield -1,
+ which will cause the compiler to abort.
+
+ Define this macro only if the target machine offers a way to
+ optimize the treatment of leaf functions, and registers need to be
+ renumbered to do this.
+
+ `TARGET_ASM_FUNCTION_PROLOGUE' and `TARGET_ASM_FUNCTION_EPILOGUE' must
+usually treat leaf functions specially. They can test the C variable
+`current_function_is_leaf' which is nonzero for leaf functions.
+`current_function_is_leaf' is set prior to local register allocation
+and is valid for the remaining compiler passes. They can also test the
+C variable `current_function_uses_only_leaf_regs' which is nonzero for
+leaf functions which only use leaf registers.
+`current_function_uses_only_leaf_regs' is valid after all passes that
+modify the instructions have been run and is only useful if
+`LEAF_REGISTERS' is defined.
+
+
+File: gccint.info, Node: Stack Registers, Prev: Leaf Functions, Up: Registers
+
+17.7.5 Registers That Form a Stack
+----------------------------------
+
+There are special features to handle computers where some of the
+"registers" form a stack. Stack registers are normally written by
+pushing onto the stack, and are numbered relative to the top of the
+stack.
+
+ Currently, GCC can only handle one group of stack-like registers, and
+they must be consecutively numbered. Furthermore, the existing support
+for stack-like registers is specific to the 80387 floating point
+coprocessor. If you have a new architecture that uses stack-like
+registers, you will need to do substantial work on `reg-stack.c' and
+write your machine description to cooperate with it, as well as
+defining these macros.
+
+ -- Macro: STACK_REGS
+ Define this if the machine has any stack-like registers.
+
+ -- Macro: FIRST_STACK_REG
+ The number of the first stack-like register. This one is the top
+ of the stack.
+
+ -- Macro: LAST_STACK_REG
+ The number of the last stack-like register. This one is the
+ bottom of the stack.
+
+
+File: gccint.info, Node: Register Classes, Next: Old Constraints, Prev: Registers, Up: Target Macros
+
+17.8 Register Classes
+=====================
+
+On many machines, the numbered registers are not all equivalent. For
+example, certain registers may not be allowed for indexed addressing;
+certain registers may not be allowed in some instructions. These
+machine restrictions are described to the compiler using "register
+classes".
+
+ You define a number of register classes, giving each one a name and
+saying which of the registers belong to it. Then you can specify
+register classes that are allowed as operands to particular instruction
+patterns.
+
+ In general, each register will belong to several classes. In fact, one
+class must be named `ALL_REGS' and contain all the registers. Another
+class must be named `NO_REGS' and contain no registers. Often the
+union of two classes will be another class; however, this is not
+required.
+
+ One of the classes must be named `GENERAL_REGS'. There is nothing
+terribly special about the name, but the operand constraint letters `r'
+and `g' specify this class. If `GENERAL_REGS' is the same as
+`ALL_REGS', just define it as a macro which expands to `ALL_REGS'.
+
+ Order the classes so that if class X is contained in class Y then X
+has a lower class number than Y.
+
+ The way classes other than `GENERAL_REGS' are specified in operand
+constraints is through machine-dependent operand constraint letters.
+You can define such letters to correspond to various classes, then use
+them in operand constraints.
+
+ You should define a class for the union of two classes whenever some
+instruction allows both classes. For example, if an instruction allows
+either a floating point (coprocessor) register or a general register
+for a certain operand, you should define a class `FLOAT_OR_GENERAL_REGS'
+which includes both of them. Otherwise you will get suboptimal code.
+
+ You must also specify certain redundant information about the register
+classes: for each class, which classes contain it and which ones are
+contained in it; for each pair of classes, the largest class contained
+in their union.
+
+ When a value occupying several consecutive registers is expected in a
+certain class, all the registers used must belong to that class.
+Therefore, register classes cannot be used to enforce a requirement for
+a register pair to start with an even-numbered register. The way to
+specify this requirement is with `HARD_REGNO_MODE_OK'.
+
+ Register classes used for input-operands of bitwise-and or shift
+instructions have a special requirement: each such class must have, for
+each fixed-point machine mode, a subclass whose registers can transfer
+that mode to or from memory. For example, on some machines, the
+operations for single-byte values (`QImode') are limited to certain
+registers. When this is so, each register class that is used in a
+bitwise-and or shift instruction must have a subclass consisting of
+registers from which single-byte values can be loaded or stored. This
+is so that `PREFERRED_RELOAD_CLASS' can always have a possible value to
+return.
+
+ -- Data type: enum reg_class
+ An enumerated type that must be defined with all the register
+ class names as enumerated values. `NO_REGS' must be first.
+ `ALL_REGS' must be the last register class, followed by one more
+ enumerated value, `LIM_REG_CLASSES', which is not a register class
+ but rather tells how many classes there are.
+
+ Each register class has a number, which is the value of casting
+ the class name to type `int'. The number serves as an index in
+ many of the tables described below.
+
+ -- Macro: N_REG_CLASSES
+ The number of distinct register classes, defined as follows:
+
+ #define N_REG_CLASSES (int) LIM_REG_CLASSES
+
+ -- Macro: REG_CLASS_NAMES
+ An initializer containing the names of the register classes as C
+ string constants. These names are used in writing some of the
+ debugging dumps.
+
+ -- Macro: REG_CLASS_CONTENTS
+ An initializer containing the contents of the register classes, as
+ integers which are bit masks. The Nth integer specifies the
+ contents of class N. The way the integer MASK is interpreted is
+ that register R is in the class if `MASK & (1 << R)' is 1.
+
+ When the machine has more than 32 registers, an integer does not
+ suffice. Then the integers are replaced by sub-initializers,
+ braced groupings containing several integers. Each
+ sub-initializer must be suitable as an initializer for the type
+ `HARD_REG_SET' which is defined in `hard-reg-set.h'. In this
+ situation, the first integer in each sub-initializer corresponds to
+ registers 0 through 31, the second integer to registers 32 through
+ 63, and so on.
+
+ -- Macro: REGNO_REG_CLASS (REGNO)
+ A C expression whose value is a register class containing hard
+ register REGNO. In general there is more than one such class;
+ choose a class which is "minimal", meaning that no smaller class
+ also contains the register.
+
+ -- Macro: BASE_REG_CLASS
+ A macro whose definition is the name of the class to which a valid
+ base register must belong. A base register is one used in an
+ address which is the register value plus a displacement.
+
+ -- Macro: MODE_BASE_REG_CLASS (MODE)
+ This is a variation of the `BASE_REG_CLASS' macro which allows the
+ selection of a base register in a mode dependent manner. If MODE
+ is VOIDmode then it should return the same value as
+ `BASE_REG_CLASS'.
+
+ -- Macro: MODE_BASE_REG_REG_CLASS (MODE)
+ A C expression whose value is the register class to which a valid
+ base register must belong in order to be used in a base plus index
+ register address. You should define this macro if base plus index
+ addresses have different requirements than other base register
+ uses.
+
+ -- Macro: MODE_CODE_BASE_REG_CLASS (MODE, OUTER_CODE, INDEX_CODE)
+ A C expression whose value is the register class to which a valid
+ base register must belong. OUTER_CODE and INDEX_CODE define the
+ context in which the base register occurs. OUTER_CODE is the code
+ of the immediately enclosing expression (`MEM' for the top level
+ of an address, `ADDRESS' for something that occurs in an
+ `address_operand'). INDEX_CODE is the code of the corresponding
+ index expression if OUTER_CODE is `PLUS'; `SCRATCH' otherwise.
+
+ -- Macro: INDEX_REG_CLASS
+ A macro whose definition is the name of the class to which a valid
+ index register must belong. An index register is one used in an
+ address where its value is either multiplied by a scale factor or
+ added to another register (as well as added to a displacement).
+
+ -- Macro: REGNO_OK_FOR_BASE_P (NUM)
+ A C expression which is nonzero if register number NUM is suitable
+ for use as a base register in operand addresses. It may be either
+ a suitable hard register or a pseudo register that has been
+ allocated such a hard register.
+
+ -- Macro: REGNO_MODE_OK_FOR_BASE_P (NUM, MODE)
+ A C expression that is just like `REGNO_OK_FOR_BASE_P', except that
+ that expression may examine the mode of the memory reference in
+ MODE. You should define this macro if the mode of the memory
+ reference affects whether a register may be used as a base
+ register. If you define this macro, the compiler will use it
+ instead of `REGNO_OK_FOR_BASE_P'. The mode may be `VOIDmode' for
+ addresses that appear outside a `MEM', i.e., as an
+ `address_operand'.
+
+
+ -- Macro: REGNO_MODE_OK_FOR_REG_BASE_P (NUM, MODE)
+ A C expression which is nonzero if register number NUM is suitable
+ for use as a base register in base plus index operand addresses,
+ accessing memory in mode MODE. It may be either a suitable hard
+ register or a pseudo register that has been allocated such a hard
+ register. You should define this macro if base plus index
+ addresses have different requirements than other base register
+ uses.
+
+ Use of this macro is deprecated; please use the more general
+ `REGNO_MODE_CODE_OK_FOR_BASE_P'.
+
+ -- Macro: REGNO_MODE_CODE_OK_FOR_BASE_P (NUM, MODE, OUTER_CODE,
+ INDEX_CODE)
+ A C expression that is just like `REGNO_MODE_OK_FOR_BASE_P', except
+ that that expression may examine the context in which the register
+ appears in the memory reference. OUTER_CODE is the code of the
+ immediately enclosing expression (`MEM' if at the top level of the
+ address, `ADDRESS' for something that occurs in an
+ `address_operand'). INDEX_CODE is the code of the corresponding
+ index expression if OUTER_CODE is `PLUS'; `SCRATCH' otherwise.
+ The mode may be `VOIDmode' for addresses that appear outside a
+ `MEM', i.e., as an `address_operand'.
+
+ -- Macro: REGNO_OK_FOR_INDEX_P (NUM)
+ A C expression which is nonzero if register number NUM is suitable
+ for use as an index register in operand addresses. It may be
+ either a suitable hard register or a pseudo register that has been
+ allocated such a hard register.
+
+ The difference between an index register and a base register is
+ that the index register may be scaled. If an address involves the
+ sum of two registers, neither one of them scaled, then either one
+ may be labeled the "base" and the other the "index"; but whichever
+ labeling is used must fit the machine's constraints of which
+ registers may serve in each capacity. The compiler will try both
+ labelings, looking for one that is valid, and will reload one or
+ both registers only if neither labeling works.
+
+ -- Macro: PREFERRED_RELOAD_CLASS (X, CLASS)
+ A C expression that places additional restrictions on the register
+ class to use when it is necessary to copy value X into a register
+ in class CLASS. The value is a register class; perhaps CLASS, or
+ perhaps another, smaller class. On many machines, the following
+ definition is safe:
+
+ #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
+
+ Sometimes returning a more restrictive class makes better code.
+ For example, on the 68000, when X is an integer constant that is
+ in range for a `moveq' instruction, the value of this macro is
+ always `DATA_REGS' as long as CLASS includes the data registers.
+ Requiring a data register guarantees that a `moveq' will be used.
+
+ One case where `PREFERRED_RELOAD_CLASS' must not return CLASS is
+ if X is a legitimate constant which cannot be loaded into some
+ register class. By returning `NO_REGS' you can force X into a
+ memory location. For example, rs6000 can load immediate values
+ into general-purpose registers, but does not have an instruction
+ for loading an immediate value into a floating-point register, so
+ `PREFERRED_RELOAD_CLASS' returns `NO_REGS' when X is a
+ floating-point constant. If the constant can't be loaded into any
+ kind of register, code generation will be better if
+ `LEGITIMATE_CONSTANT_P' makes the constant illegitimate instead of
+ using `PREFERRED_RELOAD_CLASS'.
+
+ If an insn has pseudos in it after register allocation, reload
+ will go through the alternatives and call repeatedly
+ `PREFERRED_RELOAD_CLASS' to find the best one. Returning
+ `NO_REGS', in this case, makes reload add a `!' in front of the
+ constraint: the x86 back-end uses this feature to discourage usage
+ of 387 registers when math is done in the SSE registers (and vice
+ versa).
+
+ -- Macro: PREFERRED_OUTPUT_RELOAD_CLASS (X, CLASS)
+ Like `PREFERRED_RELOAD_CLASS', but for output reloads instead of
+ input reloads. If you don't define this macro, the default is to
+ use CLASS, unchanged.
+
+ You can also use `PREFERRED_OUTPUT_RELOAD_CLASS' to discourage
+ reload from using some alternatives, like `PREFERRED_RELOAD_CLASS'.
+
+ -- Macro: LIMIT_RELOAD_CLASS (MODE, CLASS)
+ A C expression that places additional restrictions on the register
+ class to use when it is necessary to be able to hold a value of
+ mode MODE in a reload register for which class CLASS would
+ ordinarily be used.
+
+ Unlike `PREFERRED_RELOAD_CLASS', this macro should be used when
+ there are certain modes that simply can't go in certain reload
+ classes.
+
+ The value is a register class; perhaps CLASS, or perhaps another,
+ smaller class.
+
+ Don't define this macro unless the target machine has limitations
+ which require the macro to do something nontrivial.
+
+ -- Target Hook: enum reg_class TARGET_SECONDARY_RELOAD (bool IN_P, rtx
+ X, enum reg_class RELOAD_CLASS, enum machine_mode
+ RELOAD_MODE, secondary_reload_info *SRI)
+ Many machines have some registers that cannot be copied directly
+ to or from memory or even from other types of registers. An
+ example is the `MQ' register, which on most machines, can only be
+ copied to or from general registers, but not memory. Below, we
+ shall be using the term 'intermediate register' when a move
+ operation cannot be performed directly, but has to be done by
+ copying the source into the intermediate register first, and then
+ copying the intermediate register to the destination. An
+ intermediate register always has the same mode as source and
+ destination. Since it holds the actual value being copied, reload
+ might apply optimizations to re-use an intermediate register and
+ eliding the copy from the source when it can determine that the
+ intermediate register still holds the required value.
+
+ Another kind of secondary reload is required on some machines which
+ allow copying all registers to and from memory, but require a
+ scratch register for stores to some memory locations (e.g., those
+ with symbolic address on the RT, and those with certain symbolic
+ address on the SPARC when compiling PIC). Scratch registers need
+ not have the same mode as the value being copied, and usually hold
+ a different value that that being copied. Special patterns in the
+ md file are needed to describe how the copy is performed with the
+ help of the scratch register; these patterns also describe the
+ number, register class(es) and mode(s) of the scratch register(s).
+
+ In some cases, both an intermediate and a scratch register are
+ required.
+
+ For input reloads, this target hook is called with nonzero IN_P,
+ and X is an rtx that needs to be copied to a register of class
+ RELOAD_CLASS in RELOAD_MODE. For output reloads, this target hook
+ is called with zero IN_P, and a register of class RELOAD_CLASS
+ needs to be copied to rtx X in RELOAD_MODE.
+
+ If copying a register of RELOAD_CLASS from/to X requires an
+ intermediate register, the hook `secondary_reload' should return
+ the register class required for this intermediate register. If no
+ intermediate register is required, it should return NO_REGS. If
+ more than one intermediate register is required, describe the one
+ that is closest in the copy chain to the reload register.
+
+ If scratch registers are needed, you also have to describe how to
+ perform the copy from/to the reload register to/from this closest
+ intermediate register. Or if no intermediate register is
+ required, but still a scratch register is needed, describe the
+ copy from/to the reload register to/from the reload operand X.
+
+ You do this by setting `sri->icode' to the instruction code of a
+ pattern in the md file which performs the move. Operands 0 and 1
+ are the output and input of this copy, respectively. Operands
+ from operand 2 onward are for scratch operands. These scratch
+ operands must have a mode, and a single-register-class output
+ constraint.
+
+ When an intermediate register is used, the `secondary_reload' hook
+ will be called again to determine how to copy the intermediate
+ register to/from the reload operand X, so your hook must also have
+ code to handle the register class of the intermediate operand.
+
+ X might be a pseudo-register or a `subreg' of a pseudo-register,
+ which could either be in a hard register or in memory. Use
+ `true_regnum' to find out; it will return -1 if the pseudo is in
+ memory and the hard register number if it is in a register.
+
+ Scratch operands in memory (constraint `"=m"' / `"=&m"') are
+ currently not supported. For the time being, you will have to
+ continue to use `SECONDARY_MEMORY_NEEDED' for that purpose.
+
+ `copy_cost' also uses this target hook to find out how values are
+ copied. If you want it to include some extra cost for the need to
+ allocate (a) scratch register(s), set `sri->extra_cost' to the
+ additional cost. Or if two dependent moves are supposed to have a
+ lower cost than the sum of the individual moves due to expected
+ fortuitous scheduling and/or special forwarding logic, you can set
+ `sri->extra_cost' to a negative amount.
+
+ -- Macro: SECONDARY_RELOAD_CLASS (CLASS, MODE, X)
+ -- Macro: SECONDARY_INPUT_RELOAD_CLASS (CLASS, MODE, X)
+ -- Macro: SECONDARY_OUTPUT_RELOAD_CLASS (CLASS, MODE, X)
+ These macros are obsolete, new ports should use the target hook
+ `TARGET_SECONDARY_RELOAD' instead.
+
+ These are obsolete macros, replaced by the
+ `TARGET_SECONDARY_RELOAD' target hook. Older ports still define
+ these macros to indicate to the reload phase that it may need to
+ allocate at least one register for a reload in addition to the
+ register to contain the data. Specifically, if copying X to a
+ register CLASS in MODE requires an intermediate register, you were
+ supposed to define `SECONDARY_INPUT_RELOAD_CLASS' to return the
+ largest register class all of whose registers can be used as
+ intermediate registers or scratch registers.
+
+ If copying a register CLASS in MODE to X requires an intermediate
+ or scratch register, `SECONDARY_OUTPUT_RELOAD_CLASS' was supposed
+ to be defined be defined to return the largest register class
+ required. If the requirements for input and output reloads were
+ the same, the macro `SECONDARY_RELOAD_CLASS' should have been used
+ instead of defining both macros identically.
+
+ The values returned by these macros are often `GENERAL_REGS'.
+ Return `NO_REGS' if no spare register is needed; i.e., if X can be
+ directly copied to or from a register of CLASS in MODE without
+ requiring a scratch register. Do not define this macro if it
+ would always return `NO_REGS'.
+
+ If a scratch register is required (either with or without an
+ intermediate register), you were supposed to define patterns for
+ `reload_inM' or `reload_outM', as required (*note Standard
+ Names::. These patterns, which were normally implemented with a
+ `define_expand', should be similar to the `movM' patterns, except
+ that operand 2 is the scratch register.
+
+ These patterns need constraints for the reload register and scratch
+ register that contain a single register class. If the original
+ reload register (whose class is CLASS) can meet the constraint
+ given in the pattern, the value returned by these macros is used
+ for the class of the scratch register. Otherwise, two additional
+ reload registers are required. Their classes are obtained from
+ the constraints in the insn pattern.
+
+ X might be a pseudo-register or a `subreg' of a pseudo-register,
+ which could either be in a hard register or in memory. Use
+ `true_regnum' to find out; it will return -1 if the pseudo is in
+ memory and the hard register number if it is in a register.
+
+ These macros should not be used in the case where a particular
+ class of registers can only be copied to memory and not to another
+ class of registers. In that case, secondary reload registers are
+ not needed and would not be helpful. Instead, a stack location
+ must be used to perform the copy and the `movM' pattern should use
+ memory as an intermediate storage. This case often occurs between
+ floating-point and general registers.
+
+ -- Macro: SECONDARY_MEMORY_NEEDED (CLASS1, CLASS2, M)
+ Certain machines have the property that some registers cannot be
+ copied to some other registers without using memory. Define this
+ macro on those machines to be a C expression that is nonzero if
+ objects of mode M in registers of CLASS1 can only be copied to
+ registers of class CLASS2 by storing a register of CLASS1 into
+ memory and loading that memory location into a register of CLASS2.
+
+ Do not define this macro if its value would always be zero.
+
+ -- Macro: SECONDARY_MEMORY_NEEDED_RTX (MODE)
+ Normally when `SECONDARY_MEMORY_NEEDED' is defined, the compiler
+ allocates a stack slot for a memory location needed for register
+ copies. If this macro is defined, the compiler instead uses the
+ memory location defined by this macro.
+
+ Do not define this macro if you do not define
+ `SECONDARY_MEMORY_NEEDED'.
+
+ -- Macro: SECONDARY_MEMORY_NEEDED_MODE (MODE)
+ When the compiler needs a secondary memory location to copy
+ between two registers of mode MODE, it normally allocates
+ sufficient memory to hold a quantity of `BITS_PER_WORD' bits and
+ performs the store and load operations in a mode that many bits
+ wide and whose class is the same as that of MODE.
+
+ This is right thing to do on most machines because it ensures that
+ all bits of the register are copied and prevents accesses to the
+ registers in a narrower mode, which some machines prohibit for
+ floating-point registers.
+
+ However, this default behavior is not correct on some machines,
+ such as the DEC Alpha, that store short integers in floating-point
+ registers differently than in integer registers. On those
+ machines, the default widening will not work correctly and you
+ must define this macro to suppress that widening in some cases.
+ See the file `alpha.h' for details.
+
+ Do not define this macro if you do not define
+ `SECONDARY_MEMORY_NEEDED' or if widening MODE to a mode that is
+ `BITS_PER_WORD' bits wide is correct for your machine.
+
+ -- Macro: SMALL_REGISTER_CLASSES
+ On some machines, it is risky to let hard registers live across
+ arbitrary insns. Typically, these machines have instructions that
+ require values to be in specific registers (like an accumulator),
+ and reload will fail if the required hard register is used for
+ another purpose across such an insn.
+
+ Define `SMALL_REGISTER_CLASSES' to be an expression with a nonzero
+ value on these machines. When this macro has a nonzero value, the
+ compiler will try to minimize the lifetime of hard registers.
+
+ It is always safe to define this macro with a nonzero value, but
+ if you unnecessarily define it, you will reduce the amount of
+ optimizations that can be performed in some cases. If you do not
+ define this macro with a nonzero value when it is required, the
+ compiler will run out of spill registers and print a fatal error
+ message. For most machines, you should not define this macro at
+ all.
+
+ -- Macro: CLASS_LIKELY_SPILLED_P (CLASS)
+ A C expression whose value is nonzero if pseudos that have been
+ assigned to registers of class CLASS would likely be spilled
+ because registers of CLASS are needed for spill registers.
+
+ The default value of this macro returns 1 if CLASS has exactly one
+ register and zero otherwise. On most machines, this default
+ should be used. Only define this macro to some other expression
+ if pseudos allocated by `local-alloc.c' end up in memory because
+ their hard registers were needed for spill registers. If this
+ macro returns nonzero for those classes, those pseudos will only
+ be allocated by `global.c', which knows how to reallocate the
+ pseudo to another register. If there would not be another
+ register available for reallocation, you should not change the
+ definition of this macro since the only effect of such a
+ definition would be to slow down register allocation.
+
+ -- Macro: CLASS_MAX_NREGS (CLASS, MODE)
+ A C expression for the maximum number of consecutive registers of
+ class CLASS needed to hold a value of mode MODE.
+
+ This is closely related to the macro `HARD_REGNO_NREGS'. In fact,
+ the value of the macro `CLASS_MAX_NREGS (CLASS, MODE)' should be
+ the maximum value of `HARD_REGNO_NREGS (REGNO, MODE)' for all
+ REGNO values in the class CLASS.
+
+ This macro helps control the handling of multiple-word values in
+ the reload pass.
+
+ -- Macro: CANNOT_CHANGE_MODE_CLASS (FROM, TO, CLASS)
+ If defined, a C expression that returns nonzero for a CLASS for
+ which a change from mode FROM to mode TO is invalid.
+
+ For the example, loading 32-bit integer or floating-point objects
+ into floating-point registers on the Alpha extends them to 64 bits.
+ Therefore loading a 64-bit object and then storing it as a 32-bit
+ object does not store the low-order 32 bits, as would be the case
+ for a normal register. Therefore, `alpha.h' defines
+ `CANNOT_CHANGE_MODE_CLASS' as below:
+
+ #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
+ (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \
+ ? reg_classes_intersect_p (FLOAT_REGS, (CLASS)) : 0)
+
+ -- Target Hook: const enum reg_class * TARGET_IRA_COVER_CLASSES ()
+ Return an array of cover classes for the Integrated Register
+ Allocator (IRA). Cover classes are a set of non-intersecting
+ register classes covering all hard registers used for register
+ allocation purposes. If a move between two registers in the same
+ cover class is possible, it should be cheaper than a load or store
+ of the registers. The array is terminated by a `LIM_REG_CLASSES'
+ element.
+
+ This hook is called once at compiler startup, after the
+ command-line options have been processed. It is then re-examined
+ by every call to `target_reinit'.
+
+ The default implementation returns `IRA_COVER_CLASSES', if defined,
+ otherwise there is no default implementation. You must define
+ either this macro or `IRA_COVER_CLASSES' in order to use the
+ integrated register allocator with Chaitin-Briggs coloring. If the
+ macro is not defined, the only available coloring algorithm is
+ Chow's priority coloring.
+
+ -- Macro: IRA_COVER_CLASSES
+ See the documentation for `TARGET_IRA_COVER_CLASSES'.
+
+
+File: gccint.info, Node: Old Constraints, Next: Stack and Calling, Prev: Register Classes, Up: Target Macros
+
+17.9 Obsolete Macros for Defining Constraints
+=============================================
+
+Machine-specific constraints can be defined with these macros instead
+of the machine description constructs described in *Note Define
+Constraints::. This mechanism is obsolete. New ports should not use
+it; old ports should convert to the new mechanism.
+
+ -- Macro: CONSTRAINT_LEN (CHAR, STR)
+ For the constraint at the start of STR, which starts with the
+ letter C, return the length. This allows you to have register
+ class / constant / extra constraints that are longer than a single
+ letter; you don't need to define this macro if you can do with
+ single-letter constraints only. The definition of this macro
+ should use DEFAULT_CONSTRAINT_LEN for all the characters that you
+ don't want to handle specially. There are some sanity checks in
+ genoutput.c that check the constraint lengths for the md file, so
+ you can also use this macro to help you while you are
+ transitioning from a byzantine single-letter-constraint scheme:
+ when you return a negative length for a constraint you want to
+ re-use, genoutput will complain about every instance where it is
+ used in the md file.
+
+ -- Macro: REG_CLASS_FROM_LETTER (CHAR)
+ A C expression which defines the machine-dependent operand
+ constraint letters for register classes. If CHAR is such a
+ letter, the value should be the register class corresponding to
+ it. Otherwise, the value should be `NO_REGS'. The register
+ letter `r', corresponding to class `GENERAL_REGS', will not be
+ passed to this macro; you do not need to handle it.
+
+ -- Macro: REG_CLASS_FROM_CONSTRAINT (CHAR, STR)
+ Like `REG_CLASS_FROM_LETTER', but you also get the constraint
+ string passed in STR, so that you can use suffixes to distinguish
+ between different variants.
+
+ -- Macro: CONST_OK_FOR_LETTER_P (VALUE, C)
+ A C expression that defines the machine-dependent operand
+ constraint letters (`I', `J', `K', ... `P') that specify
+ particular ranges of integer values. If C is one of those
+ letters, the expression should check that VALUE, an integer, is in
+ the appropriate range and return 1 if so, 0 otherwise. If C is
+ not one of those letters, the value should be 0 regardless of
+ VALUE.
+
+ -- Macro: CONST_OK_FOR_CONSTRAINT_P (VALUE, C, STR)
+ Like `CONST_OK_FOR_LETTER_P', but you also get the constraint
+ string passed in STR, so that you can use suffixes to distinguish
+ between different variants.
+
+ -- Macro: CONST_DOUBLE_OK_FOR_LETTER_P (VALUE, C)
+ A C expression that defines the machine-dependent operand
+ constraint letters that specify particular ranges of
+ `const_double' values (`G' or `H').
+
+ If C is one of those letters, the expression should check that
+ VALUE, an RTX of code `const_double', is in the appropriate range
+ and return 1 if so, 0 otherwise. If C is not one of those
+ letters, the value should be 0 regardless of VALUE.
+
+ `const_double' is used for all floating-point constants and for
+ `DImode' fixed-point constants. A given letter can accept either
+ or both kinds of values. It can use `GET_MODE' to distinguish
+ between these kinds.
+
+ -- Macro: CONST_DOUBLE_OK_FOR_CONSTRAINT_P (VALUE, C, STR)
+ Like `CONST_DOUBLE_OK_FOR_LETTER_P', but you also get the
+ constraint string passed in STR, so that you can use suffixes to
+ distinguish between different variants.
+
+ -- Macro: EXTRA_CONSTRAINT (VALUE, C)
+ A C expression that defines the optional machine-dependent
+ constraint letters that can be used to segregate specific types of
+ operands, usually memory references, for the target machine. Any
+ letter that is not elsewhere defined and not matched by
+ `REG_CLASS_FROM_LETTER' / `REG_CLASS_FROM_CONSTRAINT' may be used.
+ Normally this macro will not be defined.
+
+ If it is required for a particular target machine, it should
+ return 1 if VALUE corresponds to the operand type represented by
+ the constraint letter C. If C is not defined as an extra
+ constraint, the value returned should be 0 regardless of VALUE.
+
+ For example, on the ROMP, load instructions cannot have their
+ output in r0 if the memory reference contains a symbolic address.
+ Constraint letter `Q' is defined as representing a memory address
+ that does _not_ contain a symbolic address. An alternative is
+ specified with a `Q' constraint on the input and `r' on the
+ output. The next alternative specifies `m' on the input and a
+ register class that does not include r0 on the output.
+
+ -- Macro: EXTRA_CONSTRAINT_STR (VALUE, C, STR)
+ Like `EXTRA_CONSTRAINT', but you also get the constraint string
+ passed in STR, so that you can use suffixes to distinguish between
+ different variants.
+
+ -- Macro: EXTRA_MEMORY_CONSTRAINT (C, STR)
+ A C expression that defines the optional machine-dependent
+ constraint letters, amongst those accepted by `EXTRA_CONSTRAINT',
+ that should be treated like memory constraints by the reload pass.
+
+ It should return 1 if the operand type represented by the
+ constraint at the start of STR, the first letter of which is the
+ letter C, comprises a subset of all memory references including
+ all those whose address is simply a base register. This allows
+ the reload pass to reload an operand, if it does not directly
+ correspond to the operand type of C, by copying its address into a
+ base register.
+
+ For example, on the S/390, some instructions do not accept
+ arbitrary memory references, but only those that do not make use
+ of an index register. The constraint letter `Q' is defined via
+ `EXTRA_CONSTRAINT' as representing a memory address of this type.
+ If the letter `Q' is marked as `EXTRA_MEMORY_CONSTRAINT', a `Q'
+ constraint can handle any memory operand, because the reload pass
+ knows it can be reloaded by copying the memory address into a base
+ register if required. This is analogous to the way a `o'
+ constraint can handle any memory operand.
+
+ -- Macro: EXTRA_ADDRESS_CONSTRAINT (C, STR)
+ A C expression that defines the optional machine-dependent
+ constraint letters, amongst those accepted by `EXTRA_CONSTRAINT' /
+ `EXTRA_CONSTRAINT_STR', that should be treated like address
+ constraints by the reload pass.
+
+ It should return 1 if the operand type represented by the
+ constraint at the start of STR, which starts with the letter C,
+ comprises a subset of all memory addresses including all those
+ that consist of just a base register. This allows the reload pass
+ to reload an operand, if it does not directly correspond to the
+ operand type of STR, by copying it into a base register.
+
+ Any constraint marked as `EXTRA_ADDRESS_CONSTRAINT' can only be
+ used with the `address_operand' predicate. It is treated
+ analogously to the `p' constraint.
+
+
+File: gccint.info, Node: Stack and Calling, Next: Varargs, Prev: Old Constraints, Up: Target Macros
+
+17.10 Stack Layout and Calling Conventions
+==========================================
+
+This describes the stack layout and calling conventions.
+
+* Menu:
+
+* Frame Layout::
+* Exception Handling::
+* Stack Checking::
+* Frame Registers::
+* Elimination::
+* Stack Arguments::
+* Register Arguments::
+* Scalar Return::
+* Aggregate Return::
+* Caller Saves::
+* Function Entry::
+* Profiling::
+* Tail Calls::
+* Stack Smashing Protection::
+
+
+File: gccint.info, Node: Frame Layout, Next: Exception Handling, Up: Stack and Calling
+
+17.10.1 Basic Stack Layout
+--------------------------
+
+Here is the basic stack layout.
+
+ -- Macro: STACK_GROWS_DOWNWARD
+ Define this macro if pushing a word onto the stack moves the stack
+ pointer to a smaller address.
+
+ When we say, "define this macro if ...", it means that the
+ compiler checks this macro only with `#ifdef' so the precise
+ definition used does not matter.
+
+ -- Macro: STACK_PUSH_CODE
+ This macro defines the operation used when something is pushed on
+ the stack. In RTL, a push operation will be `(set (mem
+ (STACK_PUSH_CODE (reg sp))) ...)'
+
+ The choices are `PRE_DEC', `POST_DEC', `PRE_INC', and `POST_INC'.
+ Which of these is correct depends on the stack direction and on
+ whether the stack pointer points to the last item on the stack or
+ whether it points to the space for the next item on the stack.
+
+ The default is `PRE_DEC' when `STACK_GROWS_DOWNWARD' is defined,
+ which is almost always right, and `PRE_INC' otherwise, which is
+ often wrong.
+
+ -- Macro: FRAME_GROWS_DOWNWARD
+ Define this macro to nonzero value if the addresses of local
+ variable slots are at negative offsets from the frame pointer.
+
+ -- Macro: ARGS_GROW_DOWNWARD
+ Define this macro if successive arguments to a function occupy
+ decreasing addresses on the stack.
+
+ -- Macro: STARTING_FRAME_OFFSET
+ Offset from the frame pointer to the first local variable slot to
+ be allocated.
+
+ If `FRAME_GROWS_DOWNWARD', find the next slot's offset by
+ subtracting the first slot's length from `STARTING_FRAME_OFFSET'.
+ Otherwise, it is found by adding the length of the first slot to
+ the value `STARTING_FRAME_OFFSET'.
+
+ -- Macro: STACK_ALIGNMENT_NEEDED
+ Define to zero to disable final alignment of the stack during
+ reload. The nonzero default for this macro is suitable for most
+ ports.
+
+ On ports where `STARTING_FRAME_OFFSET' is nonzero or where there
+ is a register save block following the local block that doesn't
+ require alignment to `STACK_BOUNDARY', it may be beneficial to
+ disable stack alignment and do it in the backend.
+
+ -- Macro: STACK_POINTER_OFFSET
+ Offset from the stack pointer register to the first location at
+ which outgoing arguments are placed. If not specified, the
+ default value of zero is used. This is the proper value for most
+ machines.
+
+ If `ARGS_GROW_DOWNWARD', this is the offset to the location above
+ the first location at which outgoing arguments are placed.
+
+ -- Macro: FIRST_PARM_OFFSET (FUNDECL)
+ Offset from the argument pointer register to the first argument's
+ address. On some machines it may depend on the data type of the
+ function.
+
+ If `ARGS_GROW_DOWNWARD', this is the offset to the location above
+ the first argument's address.
+
+ -- Macro: STACK_DYNAMIC_OFFSET (FUNDECL)
+ Offset from the stack pointer register to an item dynamically
+ allocated on the stack, e.g., by `alloca'.
+
+ The default value for this macro is `STACK_POINTER_OFFSET' plus the
+ length of the outgoing arguments. The default is correct for most
+ machines. See `function.c' for details.
+
+ -- Macro: INITIAL_FRAME_ADDRESS_RTX
+ A C expression whose value is RTL representing the address of the
+ initial stack frame. This address is passed to `RETURN_ADDR_RTX'
+ and `DYNAMIC_CHAIN_ADDRESS'. If you don't define this macro, a
+ reasonable default value will be used. Define this macro in order
+ to make frame pointer elimination work in the presence of
+ `__builtin_frame_address (count)' and `__builtin_return_address
+ (count)' for `count' not equal to zero.
+
+ -- Macro: DYNAMIC_CHAIN_ADDRESS (FRAMEADDR)
+ A C expression whose value is RTL representing the address in a
+ stack frame where the pointer to the caller's frame is stored.
+ Assume that FRAMEADDR is an RTL expression for the address of the
+ stack frame itself.
+
+ If you don't define this macro, the default is to return the value
+ of FRAMEADDR--that is, the stack frame address is also the address
+ of the stack word that points to the previous frame.
+
+ -- Macro: SETUP_FRAME_ADDRESSES
+ If defined, a C expression that produces the machine-specific code
+ to setup the stack so that arbitrary frames can be accessed. For
+ example, on the SPARC, we must flush all of the register windows
+ to the stack before we can access arbitrary stack frames. You
+ will seldom need to define this macro.
+
+ -- Target Hook: bool TARGET_BUILTIN_SETJMP_FRAME_VALUE ()
+ This target hook should return an rtx that is used to store the
+ address of the current frame into the built in `setjmp' buffer.
+ The default value, `virtual_stack_vars_rtx', is correct for most
+ machines. One reason you may need to define this target hook is if
+ `hard_frame_pointer_rtx' is the appropriate value on your machine.
+
+ -- Macro: FRAME_ADDR_RTX (FRAMEADDR)
+ A C expression whose value is RTL representing the value of the
+ frame address for the current frame. FRAMEADDR is the frame
+ pointer of the current frame. This is used for
+ __builtin_frame_address. You need only define this macro if the
+ frame address is not the same as the frame pointer. Most machines
+ do not need to define it.
+
+ -- Macro: RETURN_ADDR_RTX (COUNT, FRAMEADDR)
+ A C expression whose value is RTL representing the value of the
+ return address for the frame COUNT steps up from the current
+ frame, after the prologue. FRAMEADDR is the frame pointer of the
+ COUNT frame, or the frame pointer of the COUNT - 1 frame if
+ `RETURN_ADDR_IN_PREVIOUS_FRAME' is defined.
+
+ The value of the expression must always be the correct address when
+ COUNT is zero, but may be `NULL_RTX' if there is no way to
+ determine the return address of other frames.
+
+ -- Macro: RETURN_ADDR_IN_PREVIOUS_FRAME
+ Define this if the return address of a particular stack frame is
+ accessed from the frame pointer of the previous stack frame.
+
+ -- Macro: INCOMING_RETURN_ADDR_RTX
+ A C expression whose value is RTL representing the location of the
+ incoming return address at the beginning of any function, before
+ the prologue. This RTL is either a `REG', indicating that the
+ return value is saved in `REG', or a `MEM' representing a location
+ in the stack.
+
+ You only need to define this macro if you want to support call
+ frame debugging information like that provided by DWARF 2.
+
+ If this RTL is a `REG', you should also define
+ `DWARF_FRAME_RETURN_COLUMN' to `DWARF_FRAME_REGNUM (REGNO)'.
+
+ -- Macro: DWARF_ALT_FRAME_RETURN_COLUMN
+ A C expression whose value is an integer giving a DWARF 2 column
+ number that may be used as an alternative return column. The
+ column must not correspond to any gcc hard register (that is, it
+ must not be in the range of `DWARF_FRAME_REGNUM').
+
+ This macro can be useful if `DWARF_FRAME_RETURN_COLUMN' is set to a
+ general register, but an alternative column needs to be used for
+ signal frames. Some targets have also used different frame return
+ columns over time.
+
+ -- Macro: DWARF_ZERO_REG
+ A C expression whose value is an integer giving a DWARF 2 register
+ number that is considered to always have the value zero. This
+ should only be defined if the target has an architected zero
+ register, and someone decided it was a good idea to use that
+ register number to terminate the stack backtrace. New ports
+ should avoid this.
+
+ -- Target Hook: void TARGET_DWARF_HANDLE_FRAME_UNSPEC (const char
+ *LABEL, rtx PATTERN, int INDEX)
+ This target hook allows the backend to emit frame-related insns
+ that contain UNSPECs or UNSPEC_VOLATILEs. The DWARF 2 call frame
+ debugging info engine will invoke it on insns of the form
+ (set (reg) (unspec [...] UNSPEC_INDEX))
+ and
+ (set (reg) (unspec_volatile [...] UNSPECV_INDEX)).
+ to let the backend emit the call frame instructions. LABEL is the
+ CFI label attached to the insn, PATTERN is the pattern of the insn
+ and INDEX is `UNSPEC_INDEX' or `UNSPECV_INDEX'.
+
+ -- Macro: INCOMING_FRAME_SP_OFFSET
+ A C expression whose value is an integer giving the offset, in
+ bytes, from the value of the stack pointer register to the top of
+ the stack frame at the beginning of any function, before the
+ prologue. The top of the frame is defined to be the value of the
+ stack pointer in the previous frame, just before the call
+ instruction.
+
+ You only need to define this macro if you want to support call
+ frame debugging information like that provided by DWARF 2.
+
+ -- Macro: ARG_POINTER_CFA_OFFSET (FUNDECL)
+ A C expression whose value is an integer giving the offset, in
+ bytes, from the argument pointer to the canonical frame address
+ (cfa). The final value should coincide with that calculated by
+ `INCOMING_FRAME_SP_OFFSET'. Which is unfortunately not usable
+ during virtual register instantiation.
+
+ The default value for this macro is `FIRST_PARM_OFFSET (fundecl)',
+ which is correct for most machines; in general, the arguments are
+ found immediately before the stack frame. Note that this is not
+ the case on some targets that save registers into the caller's
+ frame, such as SPARC and rs6000, and so such targets need to
+ define this macro.
+
+ You only need to define this macro if the default is incorrect,
+ and you want to support call frame debugging information like that
+ provided by DWARF 2.
+
+ -- Macro: FRAME_POINTER_CFA_OFFSET (FUNDECL)
+ If defined, a C expression whose value is an integer giving the
+ offset in bytes from the frame pointer to the canonical frame
+ address (cfa). The final value should coincide with that
+ calculated by `INCOMING_FRAME_SP_OFFSET'.
+
+ Normally the CFA is calculated as an offset from the argument
+ pointer, via `ARG_POINTER_CFA_OFFSET', but if the argument pointer
+ is variable due to the ABI, this may not be possible. If this
+ macro is defined, it implies that the virtual register
+ instantiation should be based on the frame pointer instead of the
+ argument pointer. Only one of `FRAME_POINTER_CFA_OFFSET' and
+ `ARG_POINTER_CFA_OFFSET' should be defined.
+
+ -- Macro: CFA_FRAME_BASE_OFFSET (FUNDECL)
+ If defined, a C expression whose value is an integer giving the
+ offset in bytes from the canonical frame address (cfa) to the
+ frame base used in DWARF 2 debug information. The default is
+ zero. A different value may reduce the size of debug information
+ on some ports.
+
+
+File: gccint.info, Node: Exception Handling, Next: Stack Checking, Prev: Frame Layout, Up: Stack and Calling
+
+17.10.2 Exception Handling Support
+----------------------------------
+
+ -- Macro: EH_RETURN_DATA_REGNO (N)
+ A C expression whose value is the Nth register number used for
+ data by exception handlers, or `INVALID_REGNUM' if fewer than N
+ registers are usable.
+
+ The exception handling library routines communicate with the
+ exception handlers via a set of agreed upon registers. Ideally
+ these registers should be call-clobbered; it is possible to use
+ call-saved registers, but may negatively impact code size. The
+ target must support at least 2 data registers, but should define 4
+ if there are enough free registers.
+
+ You must define this macro if you want to support call frame
+ exception handling like that provided by DWARF 2.
+
+ -- Macro: EH_RETURN_STACKADJ_RTX
+ A C expression whose value is RTL representing a location in which
+ to store a stack adjustment to be applied before function return.
+ This is used to unwind the stack to an exception handler's call
+ frame. It will be assigned zero on code paths that return
+ normally.
+
+ Typically this is a call-clobbered hard register that is otherwise
+ untouched by the epilogue, but could also be a stack slot.
+
+ Do not define this macro if the stack pointer is saved and restored
+ by the regular prolog and epilog code in the call frame itself; in
+ this case, the exception handling library routines will update the
+ stack location to be restored in place. Otherwise, you must define
+ this macro if you want to support call frame exception handling
+ like that provided by DWARF 2.
+
+ -- Macro: EH_RETURN_HANDLER_RTX
+ A C expression whose value is RTL representing a location in which
+ to store the address of an exception handler to which we should
+ return. It will not be assigned on code paths that return
+ normally.
+
+ Typically this is the location in the call frame at which the
+ normal return address is stored. For targets that return by
+ popping an address off the stack, this might be a memory address
+ just below the _target_ call frame rather than inside the current
+ call frame. If defined, `EH_RETURN_STACKADJ_RTX' will have already
+ been assigned, so it may be used to calculate the location of the
+ target call frame.
+
+ Some targets have more complex requirements than storing to an
+ address calculable during initial code generation. In that case
+ the `eh_return' instruction pattern should be used instead.
+
+ If you want to support call frame exception handling, you must
+ define either this macro or the `eh_return' instruction pattern.
+
+ -- Macro: RETURN_ADDR_OFFSET
+ If defined, an integer-valued C expression for which rtl will be
+ generated to add it to the exception handler address before it is
+ searched in the exception handling tables, and to subtract it
+ again from the address before using it to return to the exception
+ handler.
+
+ -- Macro: ASM_PREFERRED_EH_DATA_FORMAT (CODE, GLOBAL)
+ This macro chooses the encoding of pointers embedded in the
+ exception handling sections. If at all possible, this should be
+ defined such that the exception handling section will not require
+ dynamic relocations, and so may be read-only.
+
+ CODE is 0 for data, 1 for code labels, 2 for function pointers.
+ GLOBAL is true if the symbol may be affected by dynamic
+ relocations. The macro should return a combination of the
+ `DW_EH_PE_*' defines as found in `dwarf2.h'.
+
+ If this macro is not defined, pointers will not be encoded but
+ represented directly.
+
+ -- Macro: ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX (FILE, ENCODING, SIZE,
+ ADDR, DONE)
+ This macro allows the target to emit whatever special magic is
+ required to represent the encoding chosen by
+ `ASM_PREFERRED_EH_DATA_FORMAT'. Generic code takes care of
+ pc-relative and indirect encodings; this must be defined if the
+ target uses text-relative or data-relative encodings.
+
+ This is a C statement that branches to DONE if the format was
+ handled. ENCODING is the format chosen, SIZE is the number of
+ bytes that the format occupies, ADDR is the `SYMBOL_REF' to be
+ emitted.
+
+ -- Macro: MD_UNWIND_SUPPORT
+ A string specifying a file to be #include'd in unwind-dw2.c. The
+ file so included typically defines `MD_FALLBACK_FRAME_STATE_FOR'.
+
+ -- Macro: MD_FALLBACK_FRAME_STATE_FOR (CONTEXT, FS)
+ This macro allows the target to add CPU and operating system
+ specific code to the call-frame unwinder for use when there is no
+ unwind data available. The most common reason to implement this
+ macro is to unwind through signal frames.
+
+ This macro is called from `uw_frame_state_for' in `unwind-dw2.c',
+ `unwind-dw2-xtensa.c' and `unwind-ia64.c'. CONTEXT is an
+ `_Unwind_Context'; FS is an `_Unwind_FrameState'. Examine
+ `context->ra' for the address of the code being executed and
+ `context->cfa' for the stack pointer value. If the frame can be
+ decoded, the register save addresses should be updated in FS and
+ the macro should evaluate to `_URC_NO_REASON'. If the frame
+ cannot be decoded, the macro should evaluate to
+ `_URC_END_OF_STACK'.
+
+ For proper signal handling in Java this macro is accompanied by
+ `MAKE_THROW_FRAME', defined in `libjava/include/*-signal.h'
+ headers.
+
+ -- Macro: MD_HANDLE_UNWABI (CONTEXT, FS)
+ This macro allows the target to add operating system specific code
+ to the call-frame unwinder to handle the IA-64 `.unwabi' unwinding
+ directive, usually used for signal or interrupt frames.
+
+ This macro is called from `uw_update_context' in `unwind-ia64.c'.
+ CONTEXT is an `_Unwind_Context'; FS is an `_Unwind_FrameState'.
+ Examine `fs->unwabi' for the abi and context in the `.unwabi'
+ directive. If the `.unwabi' directive can be handled, the
+ register save addresses should be updated in FS.
+
+ -- Macro: TARGET_USES_WEAK_UNWIND_INFO
+ A C expression that evaluates to true if the target requires unwind
+ info to be given comdat linkage. Define it to be `1' if comdat
+ linkage is necessary. The default is `0'.
+
+
+File: gccint.info, Node: Stack Checking, Next: Frame Registers, Prev: Exception Handling, Up: Stack and Calling
+
+17.10.3 Specifying How Stack Checking is Done
+---------------------------------------------
+
+GCC will check that stack references are within the boundaries of the
+stack, if the option `-fstack-check' is specified, in one of three ways:
+
+ 1. If the value of the `STACK_CHECK_BUILTIN' macro is nonzero, GCC
+ will assume that you have arranged for full stack checking to be
+ done at appropriate places in the configuration files. GCC will
+ not do other special processing.
+
+ 2. If `STACK_CHECK_BUILTIN' is zero and the value of the
+ `STACK_CHECK_STATIC_BUILTIN' macro is nonzero, GCC will assume
+ that you have arranged for static stack checking (checking of the
+ static stack frame of functions) to be done at appropriate places
+ in the configuration files. GCC will only emit code to do dynamic
+ stack checking (checking on dynamic stack allocations) using the
+ third approach below.
+
+ 3. If neither of the above are true, GCC will generate code to
+ periodically "probe" the stack pointer using the values of the
+ macros defined below.
+
+ If neither STACK_CHECK_BUILTIN nor STACK_CHECK_STATIC_BUILTIN is
+defined, GCC will change its allocation strategy for large objects if
+the option `-fstack-check' is specified: they will always be allocated
+dynamically if their size exceeds `STACK_CHECK_MAX_VAR_SIZE' bytes.
+
+ -- Macro: STACK_CHECK_BUILTIN
+ A nonzero value if stack checking is done by the configuration
+ files in a machine-dependent manner. You should define this macro
+ if stack checking is require by the ABI of your machine or if you
+ would like to do stack checking in some more efficient way than
+ the generic approach. The default value of this macro is zero.
+
+ -- Macro: STACK_CHECK_STATIC_BUILTIN
+ A nonzero value if static stack checking is done by the
+ configuration files in a machine-dependent manner. You should
+ define this macro if you would like to do static stack checking in
+ some more efficient way than the generic approach. The default
+ value of this macro is zero.
+
+ -- Macro: STACK_CHECK_PROBE_INTERVAL
+ An integer representing the interval at which GCC must generate
+ stack probe instructions. You will normally define this macro to
+ be no larger than the size of the "guard pages" at the end of a
+ stack area. The default value of 4096 is suitable for most
+ systems.
+
+ -- Macro: STACK_CHECK_PROBE_LOAD
+ An integer which is nonzero if GCC should perform the stack probe
+ as a load instruction and zero if GCC should use a store
+ instruction. The default is zero, which is the most efficient
+ choice on most systems.
+
+ -- Macro: STACK_CHECK_PROTECT
+ The number of bytes of stack needed to recover from a stack
+ overflow, for languages where such a recovery is supported. The
+ default value of 75 words should be adequate for most machines.
+
+ The following macros are relevant only if neither STACK_CHECK_BUILTIN
+nor STACK_CHECK_STATIC_BUILTIN is defined; you can omit them altogether
+in the opposite case.
+
+ -- Macro: STACK_CHECK_MAX_FRAME_SIZE
+ The maximum size of a stack frame, in bytes. GCC will generate
+ probe instructions in non-leaf functions to ensure at least this
+ many bytes of stack are available. If a stack frame is larger
+ than this size, stack checking will not be reliable and GCC will
+ issue a warning. The default is chosen so that GCC only generates
+ one instruction on most systems. You should normally not change
+ the default value of this macro.
+
+ -- Macro: STACK_CHECK_FIXED_FRAME_SIZE
+ GCC uses this value to generate the above warning message. It
+ represents the amount of fixed frame used by a function, not
+ including space for any callee-saved registers, temporaries and
+ user variables. You need only specify an upper bound for this
+ amount and will normally use the default of four words.
+
+ -- Macro: STACK_CHECK_MAX_VAR_SIZE
+ The maximum size, in bytes, of an object that GCC will place in the
+ fixed area of the stack frame when the user specifies
+ `-fstack-check'. GCC computed the default from the values of the
+ above macros and you will normally not need to override that
+ default.
+
+
+File: gccint.info, Node: Frame Registers, Next: Elimination, Prev: Stack Checking, Up: Stack and Calling
+
+17.10.4 Registers That Address the Stack Frame
+----------------------------------------------
+
+This discusses registers that address the stack frame.
+
+ -- Macro: STACK_POINTER_REGNUM
+ The register number of the stack pointer register, which must also
+ be a fixed register according to `FIXED_REGISTERS'. On most
+ machines, the hardware determines which register this is.
+
+ -- Macro: FRAME_POINTER_REGNUM
+ The register number of the frame pointer register, which is used to
+ access automatic variables in the stack frame. On some machines,
+ the hardware determines which register this is. On other
+ machines, you can choose any register you wish for this purpose.
+
+ -- Macro: HARD_FRAME_POINTER_REGNUM
+ On some machines the offset between the frame pointer and starting
+ offset of the automatic variables is not known until after register
+ allocation has been done (for example, because the saved registers
+ are between these two locations). On those machines, define
+ `FRAME_POINTER_REGNUM' the number of a special, fixed register to
+ be used internally until the offset is known, and define
+ `HARD_FRAME_POINTER_REGNUM' to be the actual hard register number
+ used for the frame pointer.
+
+ You should define this macro only in the very rare circumstances
+ when it is not possible to calculate the offset between the frame
+ pointer and the automatic variables until after register
+ allocation has been completed. When this macro is defined, you
+ must also indicate in your definition of `ELIMINABLE_REGS' how to
+ eliminate `FRAME_POINTER_REGNUM' into either
+ `HARD_FRAME_POINTER_REGNUM' or `STACK_POINTER_REGNUM'.
+
+ Do not define this macro if it would be the same as
+ `FRAME_POINTER_REGNUM'.
+
+ -- Macro: ARG_POINTER_REGNUM
+ The register number of the arg pointer register, which is used to
+ access the function's argument list. On some machines, this is
+ the same as the frame pointer register. On some machines, the
+ hardware determines which register this is. On other machines,
+ you can choose any register you wish for this purpose. If this is
+ not the same register as the frame pointer register, then you must
+ mark it as a fixed register according to `FIXED_REGISTERS', or
+ arrange to be able to eliminate it (*note Elimination::).
+
+ -- Macro: RETURN_ADDRESS_POINTER_REGNUM
+ The register number of the return address pointer register, which
+ is used to access the current function's return address from the
+ stack. On some machines, the return address is not at a fixed
+ offset from the frame pointer or stack pointer or argument
+ pointer. This register can be defined to point to the return
+ address on the stack, and then be converted by `ELIMINABLE_REGS'
+ into either the frame pointer or stack pointer.
+
+ Do not define this macro unless there is no other way to get the
+ return address from the stack.
+
+ -- Macro: STATIC_CHAIN_REGNUM
+ -- Macro: STATIC_CHAIN_INCOMING_REGNUM
+ Register numbers used for passing a function's static chain
+ pointer. If register windows are used, the register number as
+ seen by the called function is `STATIC_CHAIN_INCOMING_REGNUM',
+ while the register number as seen by the calling function is
+ `STATIC_CHAIN_REGNUM'. If these registers are the same,
+ `STATIC_CHAIN_INCOMING_REGNUM' need not be defined.
+
+ The static chain register need not be a fixed register.
+
+ If the static chain is passed in memory, these macros should not be
+ defined; instead, the next two macros should be defined.
+
+ -- Macro: STATIC_CHAIN
+ -- Macro: STATIC_CHAIN_INCOMING
+ If the static chain is passed in memory, these macros provide rtx
+ giving `mem' expressions that denote where they are stored.
+ `STATIC_CHAIN' and `STATIC_CHAIN_INCOMING' give the locations as
+ seen by the calling and called functions, respectively. Often the
+ former will be at an offset from the stack pointer and the latter
+ at an offset from the frame pointer.
+
+ The variables `stack_pointer_rtx', `frame_pointer_rtx', and
+ `arg_pointer_rtx' will have been initialized prior to the use of
+ these macros and should be used to refer to those items.
+
+ If the static chain is passed in a register, the two previous
+ macros should be defined instead.
+
+ -- Macro: DWARF_FRAME_REGISTERS
+ This macro specifies the maximum number of hard registers that can
+ be saved in a call frame. This is used to size data structures
+ used in DWARF2 exception handling.
+
+ Prior to GCC 3.0, this macro was needed in order to establish a
+ stable exception handling ABI in the face of adding new hard
+ registers for ISA extensions. In GCC 3.0 and later, the EH ABI is
+ insulated from changes in the number of hard registers.
+ Nevertheless, this macro can still be used to reduce the runtime
+ memory requirements of the exception handling routines, which can
+ be substantial if the ISA contains a lot of registers that are not
+ call-saved.
+
+ If this macro is not defined, it defaults to
+ `FIRST_PSEUDO_REGISTER'.
+
+ -- Macro: PRE_GCC3_DWARF_FRAME_REGISTERS
+ This macro is similar to `DWARF_FRAME_REGISTERS', but is provided
+ for backward compatibility in pre GCC 3.0 compiled code.
+
+ If this macro is not defined, it defaults to
+ `DWARF_FRAME_REGISTERS'.
+
+ -- Macro: DWARF_REG_TO_UNWIND_COLUMN (REGNO)
+ Define this macro if the target's representation for dwarf
+ registers is different than the internal representation for unwind
+ column. Given a dwarf register, this macro should return the
+ internal unwind column number to use instead.
+
+ See the PowerPC's SPE target for an example.
+
+ -- Macro: DWARF_FRAME_REGNUM (REGNO)
+ Define this macro if the target's representation for dwarf
+ registers used in .eh_frame or .debug_frame is different from that
+ used in other debug info sections. Given a GCC hard register
+ number, this macro should return the .eh_frame register number.
+ The default is `DBX_REGISTER_NUMBER (REGNO)'.
+
+
+ -- Macro: DWARF2_FRAME_REG_OUT (REGNO, FOR_EH)
+ Define this macro to map register numbers held in the call frame
+ info that GCC has collected using `DWARF_FRAME_REGNUM' to those
+ that should be output in .debug_frame (`FOR_EH' is zero) and
+ .eh_frame (`FOR_EH' is nonzero). The default is to return `REGNO'.
+
+
+
+File: gccint.info, Node: Elimination, Next: Stack Arguments, Prev: Frame Registers, Up: Stack and Calling
+
+17.10.5 Eliminating Frame Pointer and Arg Pointer
+-------------------------------------------------
+
+This is about eliminating the frame pointer and arg pointer.
+
+ -- Macro: FRAME_POINTER_REQUIRED
+ A C expression which is nonzero if a function must have and use a
+ frame pointer. This expression is evaluated in the reload pass.
+ If its value is nonzero the function will have a frame pointer.
+
+ The expression can in principle examine the current function and
+ decide according to the facts, but on most machines the constant 0
+ or the constant 1 suffices. Use 0 when the machine allows code to
+ be generated with no frame pointer, and doing so saves some time
+ or space. Use 1 when there is no possible advantage to avoiding a
+ frame pointer.
+
+ In certain cases, the compiler does not know how to produce valid
+ code without a frame pointer. The compiler recognizes those cases
+ and automatically gives the function a frame pointer regardless of
+ what `FRAME_POINTER_REQUIRED' says. You don't need to worry about
+ them.
+
+ In a function that does not require a frame pointer, the frame
+ pointer register can be allocated for ordinary usage, unless you
+ mark it as a fixed register. See `FIXED_REGISTERS' for more
+ information.
+
+ -- Macro: INITIAL_FRAME_POINTER_OFFSET (DEPTH-VAR)
+ A C statement to store in the variable DEPTH-VAR the difference
+ between the frame pointer and the stack pointer values immediately
+ after the function prologue. The value would be computed from
+ information such as the result of `get_frame_size ()' and the
+ tables of registers `regs_ever_live' and `call_used_regs'.
+
+ If `ELIMINABLE_REGS' is defined, this macro will be not be used and
+ need not be defined. Otherwise, it must be defined even if
+ `FRAME_POINTER_REQUIRED' is defined to always be true; in that
+ case, you may set DEPTH-VAR to anything.
+
+ -- Macro: ELIMINABLE_REGS
+ If defined, this macro specifies a table of register pairs used to
+ eliminate unneeded registers that point into the stack frame. If
+ it is not defined, the only elimination attempted by the compiler
+ is to replace references to the frame pointer with references to
+ the stack pointer.
+
+ The definition of this macro is a list of structure
+ initializations, each of which specifies an original and
+ replacement register.
+
+ On some machines, the position of the argument pointer is not
+ known until the compilation is completed. In such a case, a
+ separate hard register must be used for the argument pointer.
+ This register can be eliminated by replacing it with either the
+ frame pointer or the argument pointer, depending on whether or not
+ the frame pointer has been eliminated.
+
+ In this case, you might specify:
+ #define ELIMINABLE_REGS \
+ {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
+ {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
+ {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
+
+ Note that the elimination of the argument pointer with the stack
+ pointer is specified first since that is the preferred elimination.
+
+ -- Macro: CAN_ELIMINATE (FROM-REG, TO-REG)
+ A C expression that returns nonzero if the compiler is allowed to
+ try to replace register number FROM-REG with register number
+ TO-REG. This macro need only be defined if `ELIMINABLE_REGS' is
+ defined, and will usually be the constant 1, since most of the
+ cases preventing register elimination are things that the compiler
+ already knows about.
+
+ -- Macro: INITIAL_ELIMINATION_OFFSET (FROM-REG, TO-REG, OFFSET-VAR)
+ This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It
+ specifies the initial difference between the specified pair of
+ registers. This macro must be defined if `ELIMINABLE_REGS' is
+ defined.
+
+
+File: gccint.info, Node: Stack Arguments, Next: Register Arguments, Prev: Elimination, Up: Stack and Calling
+
+17.10.6 Passing Function Arguments on the Stack
+-----------------------------------------------
+
+The macros in this section control how arguments are passed on the
+stack. See the following section for other macros that control passing
+certain arguments in registers.
+
+ -- Target Hook: bool TARGET_PROMOTE_PROTOTYPES (tree FNTYPE)
+ This target hook returns `true' if an argument declared in a
+ prototype as an integral type smaller than `int' should actually be
+ passed as an `int'. In addition to avoiding errors in certain
+ cases of mismatch, it also makes for better code on certain
+ machines. The default is to not promote prototypes.
+
+ -- Macro: PUSH_ARGS
+ A C expression. If nonzero, push insns will be used to pass
+ outgoing arguments. If the target machine does not have a push
+ instruction, set it to zero. That directs GCC to use an alternate
+ strategy: to allocate the entire argument block and then store the
+ arguments into it. When `PUSH_ARGS' is nonzero, `PUSH_ROUNDING'
+ must be defined too.
+
+ -- Macro: PUSH_ARGS_REVERSED
+ A C expression. If nonzero, function arguments will be evaluated
+ from last to first, rather than from first to last. If this macro
+ is not defined, it defaults to `PUSH_ARGS' on targets where the
+ stack and args grow in opposite directions, and 0 otherwise.
+
+ -- Macro: PUSH_ROUNDING (NPUSHED)
+ A C expression that is the number of bytes actually pushed onto the
+ stack when an instruction attempts to push NPUSHED bytes.
+
+ On some machines, the definition
+
+ #define PUSH_ROUNDING(BYTES) (BYTES)
+
+ will suffice. But on other machines, instructions that appear to
+ push one byte actually push two bytes in an attempt to maintain
+ alignment. Then the definition should be
+
+ #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1)
+
+ -- Macro: ACCUMULATE_OUTGOING_ARGS
+ A C expression. If nonzero, the maximum amount of space required
+ for outgoing arguments will be computed and placed into the
+ variable `current_function_outgoing_args_size'. No space will be
+ pushed onto the stack for each call; instead, the function
+ prologue should increase the stack frame size by this amount.
+
+ Setting both `PUSH_ARGS' and `ACCUMULATE_OUTGOING_ARGS' is not
+ proper.
+
+ -- Macro: REG_PARM_STACK_SPACE (FNDECL)
+ Define this macro if functions should assume that stack space has
+ been allocated for arguments even when their values are passed in
+ registers.
+
+ The value of this macro is the size, in bytes, of the area
+ reserved for arguments passed in registers for the function
+ represented by FNDECL, which can be zero if GCC is calling a
+ library function. The argument FNDECL can be the FUNCTION_DECL,
+ or the type itself of the function.
+
+ This space can be allocated by the caller, or be a part of the
+ machine-dependent stack frame: `OUTGOING_REG_PARM_STACK_SPACE' says
+ which.
+
+ -- Macro: OUTGOING_REG_PARM_STACK_SPACE (FNTYPE)
+ Define this to a nonzero value if it is the responsibility of the
+ caller to allocate the area reserved for arguments passed in
+ registers when calling a function of FNTYPE. FNTYPE may be NULL
+ if the function called is a library function.
+
+ If `ACCUMULATE_OUTGOING_ARGS' is defined, this macro controls
+ whether the space for these arguments counts in the value of
+ `current_function_outgoing_args_size'.
+
+ -- Macro: STACK_PARMS_IN_REG_PARM_AREA
+ Define this macro if `REG_PARM_STACK_SPACE' is defined, but the
+ stack parameters don't skip the area specified by it.
+
+ Normally, when a parameter is not passed in registers, it is
+ placed on the stack beyond the `REG_PARM_STACK_SPACE' area.
+ Defining this macro suppresses this behavior and causes the
+ parameter to be passed on the stack in its natural location.
+
+ -- Macro: RETURN_POPS_ARGS (FUNDECL, FUNTYPE, STACK-SIZE)
+ A C expression that should indicate the number of bytes of its own
+ arguments that a function pops on returning, or 0 if the function
+ pops no arguments and the caller must therefore pop them all after
+ the function returns.
+
+ FUNDECL is a C variable whose value is a tree node that describes
+ the function in question. Normally it is a node of type
+ `FUNCTION_DECL' that describes the declaration of the function.
+ From this you can obtain the `DECL_ATTRIBUTES' of the function.
+
+ FUNTYPE is a C variable whose value is a tree node that describes
+ the function in question. Normally it is a node of type
+ `FUNCTION_TYPE' that describes the data type of the function.
+ From this it is possible to obtain the data types of the value and
+ arguments (if known).
+
+ When a call to a library function is being considered, FUNDECL
+ will contain an identifier node for the library function. Thus, if
+ you need to distinguish among various library functions, you can
+ do so by their names. Note that "library function" in this
+ context means a function used to perform arithmetic, whose name is
+ known specially in the compiler and was not mentioned in the C
+ code being compiled.
+
+ STACK-SIZE is the number of bytes of arguments passed on the
+ stack. If a variable number of bytes is passed, it is zero, and
+ argument popping will always be the responsibility of the calling
+ function.
+
+ On the VAX, all functions always pop their arguments, so the
+ definition of this macro is STACK-SIZE. On the 68000, using the
+ standard calling convention, no functions pop their arguments, so
+ the value of the macro is always 0 in this case. But an
+ alternative calling convention is available in which functions
+ that take a fixed number of arguments pop them but other functions
+ (such as `printf') pop nothing (the caller pops all). When this
+ convention is in use, FUNTYPE is examined to determine whether a
+ function takes a fixed number of arguments.
+
+ -- Macro: CALL_POPS_ARGS (CUM)
+ A C expression that should indicate the number of bytes a call
+ sequence pops off the stack. It is added to the value of
+ `RETURN_POPS_ARGS' when compiling a function call.
+
+ CUM is the variable in which all arguments to the called function
+ have been accumulated.
+
+ On certain architectures, such as the SH5, a call trampoline is
+ used that pops certain registers off the stack, depending on the
+ arguments that have been passed to the function. Since this is a
+ property of the call site, not of the called function,
+ `RETURN_POPS_ARGS' is not appropriate.
+
+
+File: gccint.info, Node: Register Arguments, Next: Scalar Return, Prev: Stack Arguments, Up: Stack and Calling
+
+17.10.7 Passing Arguments in Registers
+--------------------------------------
+
+This section describes the macros which let you control how various
+types of arguments are passed in registers or how they are arranged in
+the stack.
+
+ -- Macro: FUNCTION_ARG (CUM, MODE, TYPE, NAMED)
+ A C expression that controls whether a function argument is passed
+ in a register, and which register.
+
+ The arguments are CUM, which summarizes all the previous
+ arguments; MODE, the machine mode of the argument; TYPE, the data
+ type of the argument as a tree node or 0 if that is not known
+ (which happens for C support library functions); and NAMED, which
+ is 1 for an ordinary argument and 0 for nameless arguments that
+ correspond to `...' in the called function's prototype. TYPE can
+ be an incomplete type if a syntax error has previously occurred.
+
+ The value of the expression is usually either a `reg' RTX for the
+ hard register in which to pass the argument, or zero to pass the
+ argument on the stack.
+
+ For machines like the VAX and 68000, where normally all arguments
+ are pushed, zero suffices as a definition.
+
+ The value of the expression can also be a `parallel' RTX. This is
+ used when an argument is passed in multiple locations. The mode
+ of the `parallel' should be the mode of the entire argument. The
+ `parallel' holds any number of `expr_list' pairs; each one
+ describes where part of the argument is passed. In each
+ `expr_list' the first operand must be a `reg' RTX for the hard
+ register in which to pass this part of the argument, and the mode
+ of the register RTX indicates how large this part of the argument
+ is. The second operand of the `expr_list' is a `const_int' which
+ gives the offset in bytes into the entire argument of where this
+ part starts. As a special exception the first `expr_list' in the
+ `parallel' RTX may have a first operand of zero. This indicates
+ that the entire argument is also stored on the stack.
+
+ The last time this macro is called, it is called with `MODE ==
+ VOIDmode', and its result is passed to the `call' or `call_value'
+ pattern as operands 2 and 3 respectively.
+
+ The usual way to make the ISO library `stdarg.h' work on a machine
+ where some arguments are usually passed in registers, is to cause
+ nameless arguments to be passed on the stack instead. This is done
+ by making `FUNCTION_ARG' return 0 whenever NAMED is 0.
+
+ You may use the hook `targetm.calls.must_pass_in_stack' in the
+ definition of this macro to determine if this argument is of a
+ type that must be passed in the stack. If `REG_PARM_STACK_SPACE'
+ is not defined and `FUNCTION_ARG' returns nonzero for such an
+ argument, the compiler will abort. If `REG_PARM_STACK_SPACE' is
+ defined, the argument will be computed in the stack and then
+ loaded into a register.
+
+ -- Target Hook: bool TARGET_MUST_PASS_IN_STACK (enum machine_mode
+ MODE, tree TYPE)
+ This target hook should return `true' if we should not pass TYPE
+ solely in registers. The file `expr.h' defines a definition that
+ is usually appropriate, refer to `expr.h' for additional
+ documentation.
+
+ -- Macro: FUNCTION_INCOMING_ARG (CUM, MODE, TYPE, NAMED)
+ Define this macro if the target machine has "register windows", so
+ that the register in which a function sees an arguments is not
+ necessarily the same as the one in which the caller passed the
+ argument.
+
+ For such machines, `FUNCTION_ARG' computes the register in which
+ the caller passes the value, and `FUNCTION_INCOMING_ARG' should be
+ defined in a similar fashion to tell the function being called
+ where the arguments will arrive.
+
+ If `FUNCTION_INCOMING_ARG' is not defined, `FUNCTION_ARG' serves
+ both purposes.
+
+ -- Target Hook: int TARGET_ARG_PARTIAL_BYTES (CUMULATIVE_ARGS *CUM,
+ enum machine_mode MODE, tree TYPE, bool NAMED)
+ This target hook returns the number of bytes at the beginning of an
+ argument that must be put in registers. The value must be zero for
+ arguments that are passed entirely in registers or that are
+ entirely pushed on the stack.
+
+ On some machines, certain arguments must be passed partially in
+ registers and partially in memory. On these machines, typically
+ the first few words of arguments are passed in registers, and the
+ rest on the stack. If a multi-word argument (a `double' or a
+ structure) crosses that boundary, its first few words must be
+ passed in registers and the rest must be pushed. This macro tells
+ the compiler when this occurs, and how many bytes should go in
+ registers.
+
+ `FUNCTION_ARG' for these arguments should return the first
+ register to be used by the caller for this argument; likewise
+ `FUNCTION_INCOMING_ARG', for the called function.
+
+ -- Target Hook: bool TARGET_PASS_BY_REFERENCE (CUMULATIVE_ARGS *CUM,
+ enum machine_mode MODE, tree TYPE, bool NAMED)
+ This target hook should return `true' if an argument at the
+ position indicated by CUM should be passed by reference. This
+ predicate is queried after target independent reasons for being
+ passed by reference, such as `TREE_ADDRESSABLE (type)'.
+
+ If the hook returns true, a copy of that argument is made in
+ memory and a pointer to the argument is passed instead of the
+ argument itself. The pointer is passed in whatever way is
+ appropriate for passing a pointer to that type.
+
+ -- Target Hook: bool TARGET_CALLEE_COPIES (CUMULATIVE_ARGS *CUM, enum
+ machine_mode MODE, tree TYPE, bool NAMED)
+ The function argument described by the parameters to this hook is
+ known to be passed by reference. The hook should return true if
+ the function argument should be copied by the callee instead of
+ copied by the caller.
+
+ For any argument for which the hook returns true, if it can be
+ determined that the argument is not modified, then a copy need not
+ be generated.
+
+ The default version of this hook always returns false.
+
+ -- Macro: CUMULATIVE_ARGS
+ A C type for declaring a variable that is used as the first
+ argument of `FUNCTION_ARG' and other related values. For some
+ target machines, the type `int' suffices and can hold the number
+ of bytes of argument so far.
+
+ There is no need to record in `CUMULATIVE_ARGS' anything about the
+ arguments that have been passed on the stack. The compiler has
+ other variables to keep track of that. For target machines on
+ which all arguments are passed on the stack, there is no need to
+ store anything in `CUMULATIVE_ARGS'; however, the data structure
+ must exist and should not be empty, so use `int'.
+
+ -- Macro: OVERRIDE_ABI_FORMAT (FNDECL)
+ If defined, this macro is called before generating any code for a
+ function, but after the CFUN descriptor for the function has been
+ created. The back end may use this macro to update CFUN to
+ reflect an ABI other than that which would normally be used by
+ default. If the compiler is generating code for a
+ compiler-generated function, FNDECL may be `NULL'.
+
+ -- Macro: INIT_CUMULATIVE_ARGS (CUM, FNTYPE, LIBNAME, FNDECL,
+ N_NAMED_ARGS)
+ A C statement (sans semicolon) for initializing the variable CUM
+ for the state at the beginning of the argument list. The variable
+ has type `CUMULATIVE_ARGS'. The value of FNTYPE is the tree node
+ for the data type of the function which will receive the args, or
+ 0 if the args are to a compiler support library function. For
+ direct calls that are not libcalls, FNDECL contain the declaration
+ node of the function. FNDECL is also set when
+ `INIT_CUMULATIVE_ARGS' is used to find arguments for the function
+ being compiled. N_NAMED_ARGS is set to the number of named
+ arguments, including a structure return address if it is passed as
+ a parameter, when making a call. When processing incoming
+ arguments, N_NAMED_ARGS is set to -1.
+
+ When processing a call to a compiler support library function,
+ LIBNAME identifies which one. It is a `symbol_ref' rtx which
+ contains the name of the function, as a string. LIBNAME is 0 when
+ an ordinary C function call is being processed. Thus, each time
+ this macro is called, either LIBNAME or FNTYPE is nonzero, but
+ never both of them at once.
+
+ -- Macro: INIT_CUMULATIVE_LIBCALL_ARGS (CUM, MODE, LIBNAME)
+ Like `INIT_CUMULATIVE_ARGS' but only used for outgoing libcalls,
+ it gets a `MODE' argument instead of FNTYPE, that would be `NULL'.
+ INDIRECT would always be zero, too. If this macro is not
+ defined, `INIT_CUMULATIVE_ARGS (cum, NULL_RTX, libname, 0)' is
+ used instead.
+
+ -- Macro: INIT_CUMULATIVE_INCOMING_ARGS (CUM, FNTYPE, LIBNAME)
+ Like `INIT_CUMULATIVE_ARGS' but overrides it for the purposes of
+ finding the arguments for the function being compiled. If this
+ macro is undefined, `INIT_CUMULATIVE_ARGS' is used instead.
+
+ The value passed for LIBNAME is always 0, since library routines
+ with special calling conventions are never compiled with GCC. The
+ argument LIBNAME exists for symmetry with `INIT_CUMULATIVE_ARGS'.
+
+ -- Macro: FUNCTION_ARG_ADVANCE (CUM, MODE, TYPE, NAMED)
+ A C statement (sans semicolon) to update the summarizer variable
+ CUM to advance past an argument in the argument list. The values
+ MODE, TYPE and NAMED describe that argument. Once this is done,
+ the variable CUM is suitable for analyzing the _following_
+ argument with `FUNCTION_ARG', etc.
+
+ This macro need not do anything if the argument in question was
+ passed on the stack. The compiler knows how to track the amount
+ of stack space used for arguments without any special help.
+
+ -- Macro: FUNCTION_ARG_OFFSET (MODE, TYPE)
+ If defined, a C expression that is the number of bytes to add to
+ the offset of the argument passed in memory. This is needed for
+ the SPU, which passes `char' and `short' arguments in the preferred
+ slot that is in the middle of the quad word instead of starting at
+ the top.
+
+ -- Macro: FUNCTION_ARG_PADDING (MODE, TYPE)
+ If defined, a C expression which determines whether, and in which
+ direction, to pad out an argument with extra space. The value
+ should be of type `enum direction': either `upward' to pad above
+ the argument, `downward' to pad below, or `none' to inhibit
+ padding.
+
+ The _amount_ of padding is always just enough to reach the next
+ multiple of `FUNCTION_ARG_BOUNDARY'; this macro does not control
+ it.
+
+ This macro has a default definition which is right for most
+ systems. For little-endian machines, the default is to pad
+ upward. For big-endian machines, the default is to pad downward
+ for an argument of constant size shorter than an `int', and upward
+ otherwise.
+
+ -- Macro: PAD_VARARGS_DOWN
+ If defined, a C expression which determines whether the default
+ implementation of va_arg will attempt to pad down before reading
+ the next argument, if that argument is smaller than its aligned
+ space as controlled by `PARM_BOUNDARY'. If this macro is not
+ defined, all such arguments are padded down if `BYTES_BIG_ENDIAN'
+ is true.
+
+ -- Macro: BLOCK_REG_PADDING (MODE, TYPE, FIRST)
+ Specify padding for the last element of a block move between
+ registers and memory. FIRST is nonzero if this is the only
+ element. Defining this macro allows better control of register
+ function parameters on big-endian machines, without using
+ `PARALLEL' rtl. In particular, `MUST_PASS_IN_STACK' need not test
+ padding and mode of types in registers, as there is no longer a
+ "wrong" part of a register; For example, a three byte aggregate
+ may be passed in the high part of a register if so required.
+
+ -- Macro: FUNCTION_ARG_BOUNDARY (MODE, TYPE)
+ If defined, a C expression that gives the alignment boundary, in
+ bits, of an argument with the specified mode and type. If it is
+ not defined, `PARM_BOUNDARY' is used for all arguments.
+
+ -- Macro: FUNCTION_ARG_REGNO_P (REGNO)
+ A C expression that is nonzero if REGNO is the number of a hard
+ register in which function arguments are sometimes passed. This
+ does _not_ include implicit arguments such as the static chain and
+ the structure-value address. On many machines, no registers can be
+ used for this purpose since all function arguments are pushed on
+ the stack.
+
+ -- Target Hook: bool TARGET_SPLIT_COMPLEX_ARG (tree TYPE)
+ This hook should return true if parameter of type TYPE are passed
+ as two scalar parameters. By default, GCC will attempt to pack
+ complex arguments into the target's word size. Some ABIs require
+ complex arguments to be split and treated as their individual
+ components. For example, on AIX64, complex floats should be
+ passed in a pair of floating point registers, even though a
+ complex float would fit in one 64-bit floating point register.
+
+ The default value of this hook is `NULL', which is treated as
+ always false.
+
+ -- Target Hook: tree TARGET_BUILD_BUILTIN_VA_LIST (void)
+ This hook returns a type node for `va_list' for the target. The
+ default version of the hook returns `void*'.
+
+ -- Target Hook: tree TARGET_FN_ABI_VA_LIST (tree FNDECL)
+ This hook returns the va_list type of the calling convention
+ specified by FNDECL. The default version of this hook returns
+ `va_list_type_node'.
+
+ -- Target Hook: tree TARGET_CANONICAL_VA_LIST_TYPE (tree TYPE)
+ This hook returns the va_list type of the calling convention
+ specified by the type of TYPE. If TYPE is not a valid va_list
+ type, it returns `NULL_TREE'.
+
+ -- Target Hook: tree TARGET_GIMPLIFY_VA_ARG_EXPR (tree VALIST, tree
+ TYPE, tree *PRE_P, tree *POST_P)
+ This hook performs target-specific gimplification of
+ `VA_ARG_EXPR'. The first two parameters correspond to the
+ arguments to `va_arg'; the latter two are as in
+ `gimplify.c:gimplify_expr'.
+
+ -- Target Hook: bool TARGET_VALID_POINTER_MODE (enum machine_mode MODE)
+ Define this to return nonzero if the port can handle pointers with
+ machine mode MODE. The default version of this hook returns true
+ for both `ptr_mode' and `Pmode'.
+
+ -- Target Hook: bool TARGET_SCALAR_MODE_SUPPORTED_P (enum machine_mode
+ MODE)
+ Define this to return nonzero if the port is prepared to handle
+ insns involving scalar mode MODE. For a scalar mode to be
+ considered supported, all the basic arithmetic and comparisons
+ must work.
+
+ The default version of this hook returns true for any mode
+ required to handle the basic C types (as defined by the port).
+ Included here are the double-word arithmetic supported by the code
+ in `optabs.c'.
+
+ -- Target Hook: bool TARGET_VECTOR_MODE_SUPPORTED_P (enum machine_mode
+ MODE)
+ Define this to return nonzero if the port is prepared to handle
+ insns involving vector mode MODE. At the very least, it must have
+ move patterns for this mode.
+
+
+File: gccint.info, Node: Scalar Return, Next: Aggregate Return, Prev: Register Arguments, Up: Stack and Calling
+
+17.10.8 How Scalar Function Values Are Returned
+-----------------------------------------------
+
+This section discusses the macros that control returning scalars as
+values--values that can fit in registers.
+
+ -- Target Hook: rtx TARGET_FUNCTION_VALUE (tree RET_TYPE, tree
+ FN_DECL_OR_TYPE, bool OUTGOING)
+ Define this to return an RTX representing the place where a
+ function returns or receives a value of data type RET_TYPE, a tree
+ node node representing a data type. FN_DECL_OR_TYPE is a tree node
+ representing `FUNCTION_DECL' or `FUNCTION_TYPE' of a function
+ being called. If OUTGOING is false, the hook should compute the
+ register in which the caller will see the return value.
+ Otherwise, the hook should return an RTX representing the place
+ where a function returns a value.
+
+ On many machines, only `TYPE_MODE (RET_TYPE)' is relevant.
+ (Actually, on most machines, scalar values are returned in the same
+ place regardless of mode.) The value of the expression is usually
+ a `reg' RTX for the hard register where the return value is stored.
+ The value can also be a `parallel' RTX, if the return value is in
+ multiple places. See `FUNCTION_ARG' for an explanation of the
+ `parallel' form. Note that the callee will populate every
+ location specified in the `parallel', but if the first element of
+ the `parallel' contains the whole return value, callers will use
+ that element as the canonical location and ignore the others. The
+ m68k port uses this type of `parallel' to return pointers in both
+ `%a0' (the canonical location) and `%d0'.
+
+ If `TARGET_PROMOTE_FUNCTION_RETURN' returns true, you must apply
+ the same promotion rules specified in `PROMOTE_MODE' if VALTYPE is
+ a scalar type.
+
+ If the precise function being called is known, FUNC is a tree node
+ (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This
+ makes it possible to use a different value-returning convention
+ for specific functions when all their calls are known.
+
+ Some target machines have "register windows" so that the register
+ in which a function returns its value is not the same as the one
+ in which the caller sees the value. For such machines, you should
+ return different RTX depending on OUTGOING.
+
+ `TARGET_FUNCTION_VALUE' is not used for return values with
+ aggregate data types, because these are returned in another way.
+ See `TARGET_STRUCT_VALUE_RTX' and related macros, below.
+
+ -- Macro: FUNCTION_VALUE (VALTYPE, FUNC)
+ This macro has been deprecated. Use `TARGET_FUNCTION_VALUE' for a
+ new target instead.
+
+ -- Macro: FUNCTION_OUTGOING_VALUE (VALTYPE, FUNC)
+ This macro has been deprecated. Use `TARGET_FUNCTION_VALUE' for a
+ new target instead.
+
+ -- Macro: LIBCALL_VALUE (MODE)
+ A C expression to create an RTX representing the place where a
+ library function returns a value of mode MODE.
+
+ Note that "library function" in this context means a compiler
+ support routine, used to perform arithmetic, whose name is known
+ specially by the compiler and was not mentioned in the C code being
+ compiled.
+
+ -- Macro: FUNCTION_VALUE_REGNO_P (REGNO)
+ A C expression that is nonzero if REGNO is the number of a hard
+ register in which the values of called function may come back.
+
+ A register whose use for returning values is limited to serving as
+ the second of a pair (for a value of type `double', say) need not
+ be recognized by this macro. So for most machines, this definition
+ suffices:
+
+ #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
+
+ If the machine has register windows, so that the caller and the
+ called function use different registers for the return value, this
+ macro should recognize only the caller's register numbers.
+
+ -- Macro: TARGET_ENUM_VA_LIST (IDX, PNAME, PTYPE)
+ This target macro is used in function `c_common_nodes_and_builtins'
+ to iterate through the target specific builtin types for va_list.
+ The variable IDX is used as iterator. PNAME has to be a pointer to
+ a `const char *' and PTYPE a pointer to a `tree' typed variable.
+ The arguments PNAME and PTYPE are used to store the result of this
+ macro and are set to the name of the va_list builtin type and its
+ internal type. If the return value of this macro is zero, then
+ there is no more element. Otherwise the IDX should be increased
+ for the next call of this macro to iterate through all types.
+
+ -- Macro: APPLY_RESULT_SIZE
+ Define this macro if `untyped_call' and `untyped_return' need more
+ space than is implied by `FUNCTION_VALUE_REGNO_P' for saving and
+ restoring an arbitrary return value.
+
+ -- Target Hook: bool TARGET_RETURN_IN_MSB (tree TYPE)
+ This hook should return true if values of type TYPE are returned
+ at the most significant end of a register (in other words, if they
+ are padded at the least significant end). You can assume that TYPE
+ is returned in a register; the caller is required to check this.
+
+ Note that the register provided by `TARGET_FUNCTION_VALUE' must be
+ able to hold the complete return value. For example, if a 1-, 2-
+ or 3-byte structure is returned at the most significant end of a
+ 4-byte register, `TARGET_FUNCTION_VALUE' should provide an
+ `SImode' rtx.
+
+
+File: gccint.info, Node: Aggregate Return, Next: Caller Saves, Prev: Scalar Return, Up: Stack and Calling
+
+17.10.9 How Large Values Are Returned
+-------------------------------------
+
+When a function value's mode is `BLKmode' (and in some other cases),
+the value is not returned according to `TARGET_FUNCTION_VALUE' (*note
+Scalar Return::). Instead, the caller passes the address of a block of
+memory in which the value should be stored. This address is called the
+"structure value address".
+
+ This section describes how to control returning structure values in
+memory.
+
+ -- Target Hook: bool TARGET_RETURN_IN_MEMORY (tree TYPE, tree FNTYPE)
+ This target hook should return a nonzero value to say to return the
+ function value in memory, just as large structures are always
+ returned. Here TYPE will be the data type of the value, and FNTYPE
+ will be the type of the function doing the returning, or `NULL' for
+ libcalls.
+
+ Note that values of mode `BLKmode' must be explicitly handled by
+ this function. Also, the option `-fpcc-struct-return' takes
+ effect regardless of this macro. On most systems, it is possible
+ to leave the hook undefined; this causes a default definition to
+ be used, whose value is the constant 1 for `BLKmode' values, and 0
+ otherwise.
+
+ Do not use this hook to indicate that structures and unions should
+ always be returned in memory. You should instead use
+ `DEFAULT_PCC_STRUCT_RETURN' to indicate this.
+
+ -- Macro: DEFAULT_PCC_STRUCT_RETURN
+ Define this macro to be 1 if all structure and union return values
+ must be in memory. Since this results in slower code, this should
+ be defined only if needed for compatibility with other compilers
+ or with an ABI. If you define this macro to be 0, then the
+ conventions used for structure and union return values are decided
+ by the `TARGET_RETURN_IN_MEMORY' target hook.
+
+ If not defined, this defaults to the value 1.
+
+ -- Target Hook: rtx TARGET_STRUCT_VALUE_RTX (tree FNDECL, int INCOMING)
+ This target hook should return the location of the structure value
+ address (normally a `mem' or `reg'), or 0 if the address is passed
+ as an "invisible" first argument. Note that FNDECL may be `NULL',
+ for libcalls. You do not need to define this target hook if the
+ address is always passed as an "invisible" first argument.
+
+ On some architectures the place where the structure value address
+ is found by the called function is not the same place that the
+ caller put it. This can be due to register windows, or it could
+ be because the function prologue moves it to a different place.
+ INCOMING is `1' or `2' when the location is needed in the context
+ of the called function, and `0' in the context of the caller.
+
+ If INCOMING is nonzero and the address is to be found on the
+ stack, return a `mem' which refers to the frame pointer. If
+ INCOMING is `2', the result is being used to fetch the structure
+ value address at the beginning of a function. If you need to emit
+ adjusting code, you should do it at this point.
+
+ -- Macro: PCC_STATIC_STRUCT_RETURN
+ Define this macro if the usual system convention on the target
+ machine for returning structures and unions is for the called
+ function to return the address of a static variable containing the
+ value.
+
+ Do not define this if the usual system convention is for the
+ caller to pass an address to the subroutine.
+
+ This macro has effect in `-fpcc-struct-return' mode, but it does
+ nothing when you use `-freg-struct-return' mode.
+
+
+File: gccint.info, Node: Caller Saves, Next: Function Entry, Prev: Aggregate Return, Up: Stack and Calling
+
+17.10.10 Caller-Saves Register Allocation
+-----------------------------------------
+
+If you enable it, GCC can save registers around function calls. This
+makes it possible to use call-clobbered registers to hold variables that
+must live across calls.
+
+ -- Macro: CALLER_SAVE_PROFITABLE (REFS, CALLS)
+ A C expression to determine whether it is worthwhile to consider
+ placing a pseudo-register in a call-clobbered hard register and
+ saving and restoring it around each function call. The expression
+ should be 1 when this is worth doing, and 0 otherwise.
+
+ If you don't define this macro, a default is used which is good on
+ most machines: `4 * CALLS < REFS'.
+
+ -- Macro: HARD_REGNO_CALLER_SAVE_MODE (REGNO, NREGS)
+ A C expression specifying which mode is required for saving NREGS
+ of a pseudo-register in call-clobbered hard register REGNO. If
+ REGNO is unsuitable for caller save, `VOIDmode' should be
+ returned. For most machines this macro need not be defined since
+ GCC will select the smallest suitable mode.
+
+
+File: gccint.info, Node: Function Entry, Next: Profiling, Prev: Caller Saves, Up: Stack and Calling
+
+17.10.11 Function Entry and Exit
+--------------------------------
+
+This section describes the macros that output function entry
+("prologue") and exit ("epilogue") code.
+
+ -- Target Hook: void TARGET_ASM_FUNCTION_PROLOGUE (FILE *FILE,
+ HOST_WIDE_INT SIZE)
+ If defined, a function that outputs the assembler code for entry
+ to a function. The prologue is responsible for setting up the
+ stack frame, initializing the frame pointer register, saving
+ registers that must be saved, and allocating SIZE additional bytes
+ of storage for the local variables. SIZE is an integer. FILE is
+ a stdio stream to which the assembler code should be output.
+
+ The label for the beginning of the function need not be output by
+ this macro. That has already been done when the macro is run.
+
+ To determine which registers to save, the macro can refer to the
+ array `regs_ever_live': element R is nonzero if hard register R is
+ used anywhere within the function. This implies the function
+ prologue should save register R, provided it is not one of the
+ call-used registers. (`TARGET_ASM_FUNCTION_EPILOGUE' must
+ likewise use `regs_ever_live'.)
+
+ On machines that have "register windows", the function entry code
+ does not save on the stack the registers that are in the windows,
+ even if they are supposed to be preserved by function calls;
+ instead it takes appropriate steps to "push" the register stack,
+ if any non-call-used registers are used in the function.
+
+ On machines where functions may or may not have frame-pointers, the
+ function entry code must vary accordingly; it must set up the frame
+ pointer if one is wanted, and not otherwise. To determine whether
+ a frame pointer is in wanted, the macro can refer to the variable
+ `frame_pointer_needed'. The variable's value will be 1 at run
+ time in a function that needs a frame pointer. *Note
+ Elimination::.
+
+ The function entry code is responsible for allocating any stack
+ space required for the function. This stack space consists of the
+ regions listed below. In most cases, these regions are allocated
+ in the order listed, with the last listed region closest to the
+ top of the stack (the lowest address if `STACK_GROWS_DOWNWARD' is
+ defined, and the highest address if it is not defined). You can
+ use a different order for a machine if doing so is more convenient
+ or required for compatibility reasons. Except in cases where
+ required by standard or by a debugger, there is no reason why the
+ stack layout used by GCC need agree with that used by other
+ compilers for a machine.
+
+ -- Target Hook: void TARGET_ASM_FUNCTION_END_PROLOGUE (FILE *FILE)
+ If defined, a function that outputs assembler code at the end of a
+ prologue. This should be used when the function prologue is being
+ emitted as RTL, and you have some extra assembler that needs to be
+ emitted. *Note prologue instruction pattern::.
+
+ -- Target Hook: void TARGET_ASM_FUNCTION_BEGIN_EPILOGUE (FILE *FILE)
+ If defined, a function that outputs assembler code at the start of
+ an epilogue. This should be used when the function epilogue is
+ being emitted as RTL, and you have some extra assembler that needs
+ to be emitted. *Note epilogue instruction pattern::.
+
+ -- Target Hook: void TARGET_ASM_FUNCTION_EPILOGUE (FILE *FILE,
+ HOST_WIDE_INT SIZE)
+ If defined, a function that outputs the assembler code for exit
+ from a function. The epilogue is responsible for restoring the
+ saved registers and stack pointer to their values when the
+ function was called, and returning control to the caller. This
+ macro takes the same arguments as the macro
+ `TARGET_ASM_FUNCTION_PROLOGUE', and the registers to restore are
+ determined from `regs_ever_live' and `CALL_USED_REGISTERS' in the
+ same way.
+
+ On some machines, there is a single instruction that does all the
+ work of returning from the function. On these machines, give that
+ instruction the name `return' and do not define the macro
+ `TARGET_ASM_FUNCTION_EPILOGUE' at all.
+
+ Do not define a pattern named `return' if you want the
+ `TARGET_ASM_FUNCTION_EPILOGUE' to be used. If you want the target
+ switches to control whether return instructions or epilogues are
+ used, define a `return' pattern with a validity condition that
+ tests the target switches appropriately. If the `return'
+ pattern's validity condition is false, epilogues will be used.
+
+ On machines where functions may or may not have frame-pointers, the
+ function exit code must vary accordingly. Sometimes the code for
+ these two cases is completely different. To determine whether a
+ frame pointer is wanted, the macro can refer to the variable
+ `frame_pointer_needed'. The variable's value will be 1 when
+ compiling a function that needs a frame pointer.
+
+ Normally, `TARGET_ASM_FUNCTION_PROLOGUE' and
+ `TARGET_ASM_FUNCTION_EPILOGUE' must treat leaf functions specially.
+ The C variable `current_function_is_leaf' is nonzero for such a
+ function. *Note Leaf Functions::.
+
+ On some machines, some functions pop their arguments on exit while
+ others leave that for the caller to do. For example, the 68020
+ when given `-mrtd' pops arguments in functions that take a fixed
+ number of arguments.
+
+ Your definition of the macro `RETURN_POPS_ARGS' decides which
+ functions pop their own arguments. `TARGET_ASM_FUNCTION_EPILOGUE'
+ needs to know what was decided. The variable that is called
+ `current_function_pops_args' is the number of bytes of its
+ arguments that a function should pop. *Note Scalar Return::.
+
+ * A region of `current_function_pretend_args_size' bytes of
+ uninitialized space just underneath the first argument arriving on
+ the stack. (This may not be at the very start of the allocated
+ stack region if the calling sequence has pushed anything else
+ since pushing the stack arguments. But usually, on such machines,
+ nothing else has been pushed yet, because the function prologue
+ itself does all the pushing.) This region is used on machines
+ where an argument may be passed partly in registers and partly in
+ memory, and, in some cases to support the features in `<stdarg.h>'.
+
+ * An area of memory used to save certain registers used by the
+ function. The size of this area, which may also include space for
+ such things as the return address and pointers to previous stack
+ frames, is machine-specific and usually depends on which registers
+ have been used in the function. Machines with register windows
+ often do not require a save area.
+
+ * A region of at least SIZE bytes, possibly rounded up to an
+ allocation boundary, to contain the local variables of the
+ function. On some machines, this region and the save area may
+ occur in the opposite order, with the save area closer to the top
+ of the stack.
+
+ * Optionally, when `ACCUMULATE_OUTGOING_ARGS' is defined, a region of
+ `current_function_outgoing_args_size' bytes to be used for outgoing
+ argument lists of the function. *Note Stack Arguments::.
+
+ -- Macro: EXIT_IGNORE_STACK
+ Define this macro as a C expression that is nonzero if the return
+ instruction or the function epilogue ignores the value of the stack
+ pointer; in other words, if it is safe to delete an instruction to
+ adjust the stack pointer before a return from the function. The
+ default is 0.
+
+ Note that this macro's value is relevant only for functions for
+ which frame pointers are maintained. It is never safe to delete a
+ final stack adjustment in a function that has no frame pointer,
+ and the compiler knows this regardless of `EXIT_IGNORE_STACK'.
+
+ -- Macro: EPILOGUE_USES (REGNO)
+ Define this macro as a C expression that is nonzero for registers
+ that are used by the epilogue or the `return' pattern. The stack
+ and frame pointer registers are already assumed to be used as
+ needed.
+
+ -- Macro: EH_USES (REGNO)
+ Define this macro as a C expression that is nonzero for registers
+ that are used by the exception handling mechanism, and so should
+ be considered live on entry to an exception edge.
+
+ -- Macro: DELAY_SLOTS_FOR_EPILOGUE
+ Define this macro if the function epilogue contains delay slots to
+ which instructions from the rest of the function can be "moved".
+ The definition should be a C expression whose value is an integer
+ representing the number of delay slots there.
+
+ -- Macro: ELIGIBLE_FOR_EPILOGUE_DELAY (INSN, N)
+ A C expression that returns 1 if INSN can be placed in delay slot
+ number N of the epilogue.
+
+ The argument N is an integer which identifies the delay slot now
+ being considered (since different slots may have different rules of
+ eligibility). It is never negative and is always less than the
+ number of epilogue delay slots (what `DELAY_SLOTS_FOR_EPILOGUE'
+ returns). If you reject a particular insn for a given delay slot,
+ in principle, it may be reconsidered for a subsequent delay slot.
+ Also, other insns may (at least in principle) be considered for
+ the so far unfilled delay slot.
+
+ The insns accepted to fill the epilogue delay slots are put in an
+ RTL list made with `insn_list' objects, stored in the variable
+ `current_function_epilogue_delay_list'. The insn for the first
+ delay slot comes first in the list. Your definition of the macro
+ `TARGET_ASM_FUNCTION_EPILOGUE' should fill the delay slots by
+ outputting the insns in this list, usually by calling
+ `final_scan_insn'.
+
+ You need not define this macro if you did not define
+ `DELAY_SLOTS_FOR_EPILOGUE'.
+
+ -- Target Hook: void TARGET_ASM_OUTPUT_MI_THUNK (FILE *FILE, tree
+ THUNK_FNDECL, HOST_WIDE_INT DELTA, HOST_WIDE_INT
+ VCALL_OFFSET, tree FUNCTION)
+ A function that outputs the assembler code for a thunk function,
+ used to implement C++ virtual function calls with multiple
+ inheritance. The thunk acts as a wrapper around a virtual
+ function, adjusting the implicit object parameter before handing
+ control off to the real function.
+
+ First, emit code to add the integer DELTA to the location that
+ contains the incoming first argument. Assume that this argument
+ contains a pointer, and is the one used to pass the `this' pointer
+ in C++. This is the incoming argument _before_ the function
+ prologue, e.g. `%o0' on a sparc. The addition must preserve the
+ values of all other incoming arguments.
+
+ Then, if VCALL_OFFSET is nonzero, an additional adjustment should
+ be made after adding `delta'. In particular, if P is the adjusted
+ pointer, the following adjustment should be made:
+
+ p += (*((ptrdiff_t **)p))[vcall_offset/sizeof(ptrdiff_t)]
+
+ After the additions, emit code to jump to FUNCTION, which is a
+ `FUNCTION_DECL'. This is a direct pure jump, not a call, and does
+ not touch the return address. Hence returning from FUNCTION will
+ return to whoever called the current `thunk'.
+
+ The effect must be as if FUNCTION had been called directly with
+ the adjusted first argument. This macro is responsible for
+ emitting all of the code for a thunk function;
+ `TARGET_ASM_FUNCTION_PROLOGUE' and `TARGET_ASM_FUNCTION_EPILOGUE'
+ are not invoked.
+
+ The THUNK_FNDECL is redundant. (DELTA and FUNCTION have already
+ been extracted from it.) It might possibly be useful on some
+ targets, but probably not.
+
+ If you do not define this macro, the target-independent code in
+ the C++ front end will generate a less efficient heavyweight thunk
+ that calls FUNCTION instead of jumping to it. The generic
+ approach does not support varargs.
+
+ -- Target Hook: bool TARGET_ASM_CAN_OUTPUT_MI_THUNK (tree
+ THUNK_FNDECL, HOST_WIDE_INT DELTA, HOST_WIDE_INT
+ VCALL_OFFSET, tree FUNCTION)
+ A function that returns true if TARGET_ASM_OUTPUT_MI_THUNK would
+ be able to output the assembler code for the thunk function
+ specified by the arguments it is passed, and false otherwise. In
+ the latter case, the generic approach will be used by the C++
+ front end, with the limitations previously exposed.
+
+
+File: gccint.info, Node: Profiling, Next: Tail Calls, Prev: Function Entry, Up: Stack and Calling
+
+17.10.12 Generating Code for Profiling
+--------------------------------------
+
+These macros will help you generate code for profiling.
+
+ -- Macro: FUNCTION_PROFILER (FILE, LABELNO)
+ A C statement or compound statement to output to FILE some
+ assembler code to call the profiling subroutine `mcount'.
+
+ The details of how `mcount' expects to be called are determined by
+ your operating system environment, not by GCC. To figure them out,
+ compile a small program for profiling using the system's installed
+ C compiler and look at the assembler code that results.
+
+ Older implementations of `mcount' expect the address of a counter
+ variable to be loaded into some register. The name of this
+ variable is `LP' followed by the number LABELNO, so you would
+ generate the name using `LP%d' in a `fprintf'.
+
+ -- Macro: PROFILE_HOOK
+ A C statement or compound statement to output to FILE some assembly
+ code to call the profiling subroutine `mcount' even the target does
+ not support profiling.
+
+ -- Macro: NO_PROFILE_COUNTERS
+ Define this macro to be an expression with a nonzero value if the
+ `mcount' subroutine on your system does not need a counter variable
+ allocated for each function. This is true for almost all modern
+ implementations. If you define this macro, you must not use the
+ LABELNO argument to `FUNCTION_PROFILER'.
+
+ -- Macro: PROFILE_BEFORE_PROLOGUE
+ Define this macro if the code for function profiling should come
+ before the function prologue. Normally, the profiling code comes
+ after.
+
+
+File: gccint.info, Node: Tail Calls, Next: Stack Smashing Protection, Prev: Profiling, Up: Stack and Calling
+
+17.10.13 Permitting tail calls
+------------------------------
+
+ -- Target Hook: bool TARGET_FUNCTION_OK_FOR_SIBCALL (tree DECL, tree
+ EXP)
+ True if it is ok to do sibling call optimization for the specified
+ call expression EXP. DECL will be the called function, or `NULL'
+ if this is an indirect call.
+
+ It is not uncommon for limitations of calling conventions to
+ prevent tail calls to functions outside the current unit of
+ translation, or during PIC compilation. The hook is used to
+ enforce these restrictions, as the `sibcall' md pattern can not
+ fail, or fall over to a "normal" call. The criteria for
+ successful sibling call optimization may vary greatly between
+ different architectures.
+
+ -- Target Hook: void TARGET_EXTRA_LIVE_ON_ENTRY (bitmap *REGS)
+ Add any hard registers to REGS that are live on entry to the
+ function. This hook only needs to be defined to provide registers
+ that cannot be found by examination of FUNCTION_ARG_REGNO_P, the
+ callee saved registers, STATIC_CHAIN_INCOMING_REGNUM,
+ STATIC_CHAIN_REGNUM, TARGET_STRUCT_VALUE_RTX,
+ FRAME_POINTER_REGNUM, EH_USES, FRAME_POINTER_REGNUM,
+ ARG_POINTER_REGNUM, and the PIC_OFFSET_TABLE_REGNUM.
+
+
+File: gccint.info, Node: Stack Smashing Protection, Prev: Tail Calls, Up: Stack and Calling
+
+17.10.14 Stack smashing protection
+----------------------------------
+
+ -- Target Hook: tree TARGET_STACK_PROTECT_GUARD (void)
+ This hook returns a `DECL' node for the external variable to use
+ for the stack protection guard. This variable is initialized by
+ the runtime to some random value and is used to initialize the
+ guard value that is placed at the top of the local stack frame.
+ The type of this variable must be `ptr_type_node'.
+
+ The default version of this hook creates a variable called
+ `__stack_chk_guard', which is normally defined in `libgcc2.c'.
+
+ -- Target Hook: tree TARGET_STACK_PROTECT_FAIL (void)
+ This hook returns a tree expression that alerts the runtime that
+ the stack protect guard variable has been modified. This
+ expression should involve a call to a `noreturn' function.
+
+ The default version of this hook invokes a function called
+ `__stack_chk_fail', taking no arguments. This function is
+ normally defined in `libgcc2.c'.
+
+
+File: gccint.info, Node: Varargs, Next: Trampolines, Prev: Stack and Calling, Up: Target Macros
+
+17.11 Implementing the Varargs Macros
+=====================================
+
+GCC comes with an implementation of `<varargs.h>' and `<stdarg.h>' that
+work without change on machines that pass arguments on the stack.
+Other machines require their own implementations of varargs, and the
+two machine independent header files must have conditionals to include
+it.
+
+ ISO `<stdarg.h>' differs from traditional `<varargs.h>' mainly in the
+calling convention for `va_start'. The traditional implementation
+takes just one argument, which is the variable in which to store the
+argument pointer. The ISO implementation of `va_start' takes an
+additional second argument. The user is supposed to write the last
+named argument of the function here.
+
+ However, `va_start' should not use this argument. The way to find the
+end of the named arguments is with the built-in functions described
+below.
+
+ -- Macro: __builtin_saveregs ()
+ Use this built-in function to save the argument registers in
+ memory so that the varargs mechanism can access them. Both ISO
+ and traditional versions of `va_start' must use
+ `__builtin_saveregs', unless you use
+ `TARGET_SETUP_INCOMING_VARARGS' (see below) instead.
+
+ On some machines, `__builtin_saveregs' is open-coded under the
+ control of the target hook `TARGET_EXPAND_BUILTIN_SAVEREGS'. On
+ other machines, it calls a routine written in assembler language,
+ found in `libgcc2.c'.
+
+ Code generated for the call to `__builtin_saveregs' appears at the
+ beginning of the function, as opposed to where the call to
+ `__builtin_saveregs' is written, regardless of what the code is.
+ This is because the registers must be saved before the function
+ starts to use them for its own purposes.
+
+ -- Macro: __builtin_args_info (CATEGORY)
+ Use this built-in function to find the first anonymous arguments in
+ registers.
+
+ In general, a machine may have several categories of registers
+ used for arguments, each for a particular category of data types.
+ (For example, on some machines, floating-point registers are used
+ for floating-point arguments while other arguments are passed in
+ the general registers.) To make non-varargs functions use the
+ proper calling convention, you have defined the `CUMULATIVE_ARGS'
+ data type to record how many registers in each category have been
+ used so far
+
+ `__builtin_args_info' accesses the same data structure of type
+ `CUMULATIVE_ARGS' after the ordinary argument layout is finished
+ with it, with CATEGORY specifying which word to access. Thus, the
+ value indicates the first unused register in a given category.
+
+ Normally, you would use `__builtin_args_info' in the implementation
+ of `va_start', accessing each category just once and storing the
+ value in the `va_list' object. This is because `va_list' will
+ have to update the values, and there is no way to alter the values
+ accessed by `__builtin_args_info'.
+
+ -- Macro: __builtin_next_arg (LASTARG)
+ This is the equivalent of `__builtin_args_info', for stack
+ arguments. It returns the address of the first anonymous stack
+ argument, as type `void *'. If `ARGS_GROW_DOWNWARD', it returns
+ the address of the location above the first anonymous stack
+ argument. Use it in `va_start' to initialize the pointer for
+ fetching arguments from the stack. Also use it in `va_start' to
+ verify that the second parameter LASTARG is the last named argument
+ of the current function.
+
+ -- Macro: __builtin_classify_type (OBJECT)
+ Since each machine has its own conventions for which data types are
+ passed in which kind of register, your implementation of `va_arg'
+ has to embody these conventions. The easiest way to categorize the
+ specified data type is to use `__builtin_classify_type' together
+ with `sizeof' and `__alignof__'.
+
+ `__builtin_classify_type' ignores the value of OBJECT, considering
+ only its data type. It returns an integer describing what kind of
+ type that is--integer, floating, pointer, structure, and so on.
+
+ The file `typeclass.h' defines an enumeration that you can use to
+ interpret the values of `__builtin_classify_type'.
+
+ These machine description macros help implement varargs:
+
+ -- Target Hook: rtx TARGET_EXPAND_BUILTIN_SAVEREGS (void)
+ If defined, this hook produces the machine-specific code for a
+ call to `__builtin_saveregs'. This code will be moved to the very
+ beginning of the function, before any parameter access are made.
+ The return value of this function should be an RTX that contains
+ the value to use as the return of `__builtin_saveregs'.
+
+ -- Target Hook: void TARGET_SETUP_INCOMING_VARARGS (CUMULATIVE_ARGS
+ *ARGS_SO_FAR, enum machine_mode MODE, tree TYPE, int
+ *PRETEND_ARGS_SIZE, int SECOND_TIME)
+ This target hook offers an alternative to using
+ `__builtin_saveregs' and defining the hook
+ `TARGET_EXPAND_BUILTIN_SAVEREGS'. Use it to store the anonymous
+ register arguments into the stack so that all the arguments appear
+ to have been passed consecutively on the stack. Once this is
+ done, you can use the standard implementation of varargs that
+ works for machines that pass all their arguments on the stack.
+
+ The argument ARGS_SO_FAR points to the `CUMULATIVE_ARGS' data
+ structure, containing the values that are obtained after
+ processing the named arguments. The arguments MODE and TYPE
+ describe the last named argument--its machine mode and its data
+ type as a tree node.
+
+ The target hook should do two things: first, push onto the stack
+ all the argument registers _not_ used for the named arguments, and
+ second, store the size of the data thus pushed into the
+ `int'-valued variable pointed to by PRETEND_ARGS_SIZE. The value
+ that you store here will serve as additional offset for setting up
+ the stack frame.
+
+ Because you must generate code to push the anonymous arguments at
+ compile time without knowing their data types,
+ `TARGET_SETUP_INCOMING_VARARGS' is only useful on machines that
+ have just a single category of argument register and use it
+ uniformly for all data types.
+
+ If the argument SECOND_TIME is nonzero, it means that the
+ arguments of the function are being analyzed for the second time.
+ This happens for an inline function, which is not actually
+ compiled until the end of the source file. The hook
+ `TARGET_SETUP_INCOMING_VARARGS' should not generate any
+ instructions in this case.
+
+ -- Target Hook: bool TARGET_STRICT_ARGUMENT_NAMING (CUMULATIVE_ARGS
+ *CA)
+ Define this hook to return `true' if the location where a function
+ argument is passed depends on whether or not it is a named
+ argument.
+
+ This hook controls how the NAMED argument to `FUNCTION_ARG' is set
+ for varargs and stdarg functions. If this hook returns `true',
+ the NAMED argument is always true for named arguments, and false
+ for unnamed arguments. If it returns `false', but
+ `TARGET_PRETEND_OUTGOING_VARARGS_NAMED' returns `true', then all
+ arguments are treated as named. Otherwise, all named arguments
+ except the last are treated as named.
+
+ You need not define this hook if it always returns zero.
+
+ -- Target Hook: bool TARGET_PRETEND_OUTGOING_VARARGS_NAMED
+ If you need to conditionally change ABIs so that one works with
+ `TARGET_SETUP_INCOMING_VARARGS', but the other works like neither
+ `TARGET_SETUP_INCOMING_VARARGS' nor
+ `TARGET_STRICT_ARGUMENT_NAMING' was defined, then define this hook
+ to return `true' if `TARGET_SETUP_INCOMING_VARARGS' is used,
+ `false' otherwise. Otherwise, you should not define this hook.
+
+
+File: gccint.info, Node: Trampolines, Next: Library Calls, Prev: Varargs, Up: Target Macros
+
+17.12 Trampolines for Nested Functions
+======================================
+
+A "trampoline" is a small piece of code that is created at run time
+when the address of a nested function is taken. It normally resides on
+the stack, in the stack frame of the containing function. These macros
+tell GCC how to generate code to allocate and initialize a trampoline.
+
+ The instructions in the trampoline must do two things: load a constant
+address into the static chain register, and jump to the real address of
+the nested function. On CISC machines such as the m68k, this requires
+two instructions, a move immediate and a jump. Then the two addresses
+exist in the trampoline as word-long immediate operands. On RISC
+machines, it is often necessary to load each address into a register in
+two parts. Then pieces of each address form separate immediate
+operands.
+
+ The code generated to initialize the trampoline must store the variable
+parts--the static chain value and the function address--into the
+immediate operands of the instructions. On a CISC machine, this is
+simply a matter of copying each address to a memory reference at the
+proper offset from the start of the trampoline. On a RISC machine, it
+may be necessary to take out pieces of the address and store them
+separately.
+
+ -- Macro: TRAMPOLINE_TEMPLATE (FILE)
+ A C statement to output, on the stream FILE, assembler code for a
+ block of data that contains the constant parts of a trampoline.
+ This code should not include a label--the label is taken care of
+ automatically.
+
+ If you do not define this macro, it means no template is needed
+ for the target. Do not define this macro on systems where the
+ block move code to copy the trampoline into place would be larger
+ than the code to generate it on the spot.
+
+ -- Macro: TRAMPOLINE_SECTION
+ Return the section into which the trampoline template is to be
+ placed (*note Sections::). The default value is
+ `readonly_data_section'.
+
+ -- Macro: TRAMPOLINE_SIZE
+ A C expression for the size in bytes of the trampoline, as an
+ integer.
+
+ -- Macro: TRAMPOLINE_ALIGNMENT
+ Alignment required for trampolines, in bits.
+
+ If you don't define this macro, the value of `BIGGEST_ALIGNMENT'
+ is used for aligning trampolines.
+
+ -- Macro: INITIALIZE_TRAMPOLINE (ADDR, FNADDR, STATIC_CHAIN)
+ A C statement to initialize the variable parts of a trampoline.
+ ADDR is an RTX for the address of the trampoline; FNADDR is an RTX
+ for the address of the nested function; STATIC_CHAIN is an RTX for
+ the static chain value that should be passed to the function when
+ it is called.
+
+ -- Macro: TRAMPOLINE_ADJUST_ADDRESS (ADDR)
+ A C statement that should perform any machine-specific adjustment
+ in the address of the trampoline. Its argument contains the
+ address that was passed to `INITIALIZE_TRAMPOLINE'. In case the
+ address to be used for a function call should be different from
+ the address in which the template was stored, the different
+ address should be assigned to ADDR. If this macro is not defined,
+ ADDR will be used for function calls.
+
+ If this macro is not defined, by default the trampoline is
+ allocated as a stack slot. This default is right for most
+ machines. The exceptions are machines where it is impossible to
+ execute instructions in the stack area. On such machines, you may
+ have to implement a separate stack, using this macro in
+ conjunction with `TARGET_ASM_FUNCTION_PROLOGUE' and
+ `TARGET_ASM_FUNCTION_EPILOGUE'.
+
+ FP points to a data structure, a `struct function', which
+ describes the compilation status of the immediate containing
+ function of the function which the trampoline is for. The stack
+ slot for the trampoline is in the stack frame of this containing
+ function. Other allocation strategies probably must do something
+ analogous with this information.
+
+ Implementing trampolines is difficult on many machines because they
+have separate instruction and data caches. Writing into a stack
+location fails to clear the memory in the instruction cache, so when
+the program jumps to that location, it executes the old contents.
+
+ Here are two possible solutions. One is to clear the relevant parts of
+the instruction cache whenever a trampoline is set up. The other is to
+make all trampolines identical, by having them jump to a standard
+subroutine. The former technique makes trampoline execution faster; the
+latter makes initialization faster.
+
+ To clear the instruction cache when a trampoline is initialized, define
+the following macro.
+
+ -- Macro: CLEAR_INSN_CACHE (BEG, END)
+ If defined, expands to a C expression clearing the _instruction
+ cache_ in the specified interval. The definition of this macro
+ would typically be a series of `asm' statements. Both BEG and END
+ are both pointer expressions.
+
+ The operating system may also require the stack to be made executable
+before calling the trampoline. To implement this requirement, define
+the following macro.
+
+ -- Macro: ENABLE_EXECUTE_STACK
+ Define this macro if certain operations must be performed before
+ executing code located on the stack. The macro should expand to a
+ series of C file-scope constructs (e.g. functions) and provide a
+ unique entry point named `__enable_execute_stack'. The target is
+ responsible for emitting calls to the entry point in the code, for
+ example from the `INITIALIZE_TRAMPOLINE' macro.
+
+ To use a standard subroutine, define the following macro. In addition,
+you must make sure that the instructions in a trampoline fill an entire
+cache line with identical instructions, or else ensure that the
+beginning of the trampoline code is always aligned at the same point in
+its cache line. Look in `m68k.h' as a guide.
+
+ -- Macro: TRANSFER_FROM_TRAMPOLINE
+ Define this macro if trampolines need a special subroutine to do
+ their work. The macro should expand to a series of `asm'
+ statements which will be compiled with GCC. They go in a library
+ function named `__transfer_from_trampoline'.
+
+ If you need to avoid executing the ordinary prologue code of a
+ compiled C function when you jump to the subroutine, you can do so
+ by placing a special label of your own in the assembler code. Use
+ one `asm' statement to generate an assembler label, and another to
+ make the label global. Then trampolines can use that label to
+ jump directly to your special assembler code.
+
+
+File: gccint.info, Node: Library Calls, Next: Addressing Modes, Prev: Trampolines, Up: Target Macros
+
+17.13 Implicit Calls to Library Routines
+========================================
+
+Here is an explanation of implicit calls to library routines.
+
+ -- Macro: DECLARE_LIBRARY_RENAMES
+ This macro, if defined, should expand to a piece of C code that
+ will get expanded when compiling functions for libgcc.a. It can
+ be used to provide alternate names for GCC's internal library
+ functions if there are ABI-mandated names that the compiler should
+ provide.
+
+ -- Target Hook: void TARGET_INIT_LIBFUNCS (void)
+ This hook should declare additional library routines or rename
+ existing ones, using the functions `set_optab_libfunc' and
+ `init_one_libfunc' defined in `optabs.c'. `init_optabs' calls
+ this macro after initializing all the normal library routines.
+
+ The default is to do nothing. Most ports don't need to define
+ this hook.
+
+ -- Macro: FLOAT_LIB_COMPARE_RETURNS_BOOL (MODE, COMPARISON)
+ This macro should return `true' if the library routine that
+ implements the floating point comparison operator COMPARISON in
+ mode MODE will return a boolean, and FALSE if it will return a
+ tristate.
+
+ GCC's own floating point libraries return tristates from the
+ comparison operators, so the default returns false always. Most
+ ports don't need to define this macro.
+
+ -- Macro: TARGET_LIB_INT_CMP_BIASED
+ This macro should evaluate to `true' if the integer comparison
+ functions (like `__cmpdi2') return 0 to indicate that the first
+ operand is smaller than the second, 1 to indicate that they are
+ equal, and 2 to indicate that the first operand is greater than
+ the second. If this macro evaluates to `false' the comparison
+ functions return -1, 0, and 1 instead of 0, 1, and 2. If the
+ target uses the routines in `libgcc.a', you do not need to define
+ this macro.
+
+ -- Macro: US_SOFTWARE_GOFAST
+ Define this macro if your system C library uses the US Software
+ GOFAST library to provide floating point emulation.
+
+ In addition to defining this macro, your architecture must set
+ `TARGET_INIT_LIBFUNCS' to `gofast_maybe_init_libfuncs', or else
+ call that function from its version of that hook. It is defined
+ in `config/gofast.h', which must be included by your
+ architecture's `CPU.c' file. See `sparc/sparc.c' for an example.
+
+ If this macro is defined, the
+ `TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL' target hook must return
+ false for `SFmode' and `DFmode' comparisons.
+
+ -- Macro: TARGET_EDOM
+ The value of `EDOM' on the target machine, as a C integer constant
+ expression. If you don't define this macro, GCC does not attempt
+ to deposit the value of `EDOM' into `errno' directly. Look in
+ `/usr/include/errno.h' to find the value of `EDOM' on your system.
+
+ If you do not define `TARGET_EDOM', then compiled code reports
+ domain errors by calling the library function and letting it
+ report the error. If mathematical functions on your system use
+ `matherr' when there is an error, then you should leave
+ `TARGET_EDOM' undefined so that `matherr' is used normally.
+
+ -- Macro: GEN_ERRNO_RTX
+ Define this macro as a C expression to create an rtl expression
+ that refers to the global "variable" `errno'. (On certain systems,
+ `errno' may not actually be a variable.) If you don't define this
+ macro, a reasonable default is used.
+
+ -- Macro: TARGET_C99_FUNCTIONS
+ When this macro is nonzero, GCC will implicitly optimize `sin'
+ calls into `sinf' and similarly for other functions defined by C99
+ standard. The default is zero because a number of existing
+ systems lack support for these functions in their runtime so this
+ macro needs to be redefined to one on systems that do support the
+ C99 runtime.
+
+ -- Macro: TARGET_HAS_SINCOS
+ When this macro is nonzero, GCC will implicitly optimize calls to
+ `sin' and `cos' with the same argument to a call to `sincos'. The
+ default is zero. The target has to provide the following
+ functions:
+ void sincos(double x, double *sin, double *cos);
+ void sincosf(float x, float *sin, float *cos);
+ void sincosl(long double x, long double *sin, long double *cos);
+
+ -- Macro: NEXT_OBJC_RUNTIME
+ Define this macro to generate code for Objective-C message sending
+ using the calling convention of the NeXT system. This calling
+ convention involves passing the object, the selector and the
+ method arguments all at once to the method-lookup library function.
+
+ The default calling convention passes just the object and the
+ selector to the lookup function, which returns a pointer to the
+ method.
+
+
+File: gccint.info, Node: Addressing Modes, Next: Anchored Addresses, Prev: Library Calls, Up: Target Macros
+
+17.14 Addressing Modes
+======================
+
+This is about addressing modes.
+
+ -- Macro: HAVE_PRE_INCREMENT
+ -- Macro: HAVE_PRE_DECREMENT
+ -- Macro: HAVE_POST_INCREMENT
+ -- Macro: HAVE_POST_DECREMENT
+ A C expression that is nonzero if the machine supports
+ pre-increment, pre-decrement, post-increment, or post-decrement
+ addressing respectively.
+
+ -- Macro: HAVE_PRE_MODIFY_DISP
+ -- Macro: HAVE_POST_MODIFY_DISP
+ A C expression that is nonzero if the machine supports pre- or
+ post-address side-effect generation involving constants other than
+ the size of the memory operand.
+
+ -- Macro: HAVE_PRE_MODIFY_REG
+ -- Macro: HAVE_POST_MODIFY_REG
+ A C expression that is nonzero if the machine supports pre- or
+ post-address side-effect generation involving a register
+ displacement.
+
+ -- Macro: CONSTANT_ADDRESS_P (X)
+ A C expression that is 1 if the RTX X is a constant which is a
+ valid address. On most machines, this can be defined as
+ `CONSTANT_P (X)', but a few machines are more restrictive in which
+ constant addresses are supported.
+
+ -- Macro: CONSTANT_P (X)
+ `CONSTANT_P', which is defined by target-independent code, accepts
+ integer-values expressions whose values are not explicitly known,
+ such as `symbol_ref', `label_ref', and `high' expressions and
+ `const' arithmetic expressions, in addition to `const_int' and
+ `const_double' expressions.
+
+ -- Macro: MAX_REGS_PER_ADDRESS
+ A number, the maximum number of registers that can appear in a
+ valid memory address. Note that it is up to you to specify a
+ value equal to the maximum number that `GO_IF_LEGITIMATE_ADDRESS'
+ would ever accept.
+
+ -- Macro: GO_IF_LEGITIMATE_ADDRESS (MODE, X, LABEL)
+ A C compound statement with a conditional `goto LABEL;' executed
+ if X (an RTX) is a legitimate memory address on the target machine
+ for a memory operand of mode MODE.
+
+ It usually pays to define several simpler macros to serve as
+ subroutines for this one. Otherwise it may be too complicated to
+ understand.
+
+ This macro must exist in two variants: a strict variant and a
+ non-strict one. The strict variant is used in the reload pass. It
+ must be defined so that any pseudo-register that has not been
+ allocated a hard register is considered a memory reference. In
+ contexts where some kind of register is required, a pseudo-register
+ with no hard register must be rejected.
+
+ The non-strict variant is used in other passes. It must be
+ defined to accept all pseudo-registers in every context where some
+ kind of register is required.
+
+ Compiler source files that want to use the strict variant of this
+ macro define the macro `REG_OK_STRICT'. You should use an `#ifdef
+ REG_OK_STRICT' conditional to define the strict variant in that
+ case and the non-strict variant otherwise.
+
+ Subroutines to check for acceptable registers for various purposes
+ (one for base registers, one for index registers, and so on) are
+ typically among the subroutines used to define
+ `GO_IF_LEGITIMATE_ADDRESS'. Then only these subroutine macros
+ need have two variants; the higher levels of macros may be the
+ same whether strict or not.
+
+ Normally, constant addresses which are the sum of a `symbol_ref'
+ and an integer are stored inside a `const' RTX to mark them as
+ constant. Therefore, there is no need to recognize such sums
+ specifically as legitimate addresses. Normally you would simply
+ recognize any `const' as legitimate.
+
+ Usually `PRINT_OPERAND_ADDRESS' is not prepared to handle constant
+ sums that are not marked with `const'. It assumes that a naked
+ `plus' indicates indexing. If so, then you _must_ reject such
+ naked constant sums as illegitimate addresses, so that none of
+ them will be given to `PRINT_OPERAND_ADDRESS'.
+
+ On some machines, whether a symbolic address is legitimate depends
+ on the section that the address refers to. On these machines,
+ define the target hook `TARGET_ENCODE_SECTION_INFO' to store the
+ information into the `symbol_ref', and then check for it here.
+ When you see a `const', you will have to look inside it to find the
+ `symbol_ref' in order to determine the section. *Note Assembler
+ Format::.
+
+ -- Macro: TARGET_MEM_CONSTRAINT
+ A single character to be used instead of the default `'m''
+ character for general memory addresses. This defines the
+ constraint letter which matches the memory addresses accepted by
+ `GO_IF_LEGITIMATE_ADDRESS_P'. Define this macro if you want to
+ support new address formats in your back end without changing the
+ semantics of the `'m'' constraint. This is necessary in order to
+ preserve functionality of inline assembly constructs using the
+ `'m'' constraint.
+
+ -- Macro: FIND_BASE_TERM (X)
+ A C expression to determine the base term of address X, or to
+ provide a simplified version of X from which `alias.c' can easily
+ find the base term. This macro is used in only two places:
+ `find_base_value' and `find_base_term' in `alias.c'.
+
+ It is always safe for this macro to not be defined. It exists so
+ that alias analysis can understand machine-dependent addresses.
+
+ The typical use of this macro is to handle addresses containing a
+ label_ref or symbol_ref within an UNSPEC.
+
+ -- Macro: LEGITIMIZE_ADDRESS (X, OLDX, MODE, WIN)
+ A C compound statement that attempts to replace X with a valid
+ memory address for an operand of mode MODE. WIN will be a C
+ statement label elsewhere in the code; the macro definition may use
+
+ GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN);
+
+ to avoid further processing if the address has become legitimate.
+
+ X will always be the result of a call to `break_out_memory_refs',
+ and OLDX will be the operand that was given to that function to
+ produce X.
+
+ The code generated by this macro should not alter the substructure
+ of X. If it transforms X into a more legitimate form, it should
+ assign X (which will always be a C variable) a new value.
+
+ It is not necessary for this macro to come up with a legitimate
+ address. The compiler has standard ways of doing so in all cases.
+ In fact, it is safe to omit this macro. But often a
+ machine-dependent strategy can generate better code.
+
+ -- Macro: LEGITIMIZE_RELOAD_ADDRESS (X, MODE, OPNUM, TYPE, IND_LEVELS,
+ WIN)
+ A C compound statement that attempts to replace X, which is an
+ address that needs reloading, with a valid memory address for an
+ operand of mode MODE. WIN will be a C statement label elsewhere
+ in the code. It is not necessary to define this macro, but it
+ might be useful for performance reasons.
+
+ For example, on the i386, it is sometimes possible to use a single
+ reload register instead of two by reloading a sum of two pseudo
+ registers into a register. On the other hand, for number of RISC
+ processors offsets are limited so that often an intermediate
+ address needs to be generated in order to address a stack slot.
+ By defining `LEGITIMIZE_RELOAD_ADDRESS' appropriately, the
+ intermediate addresses generated for adjacent some stack slots can
+ be made identical, and thus be shared.
+
+ _Note_: This macro should be used with caution. It is necessary
+ to know something of how reload works in order to effectively use
+ this, and it is quite easy to produce macros that build in too
+ much knowledge of reload internals.
+
+ _Note_: This macro must be able to reload an address created by a
+ previous invocation of this macro. If it fails to handle such
+ addresses then the compiler may generate incorrect code or abort.
+
+ The macro definition should use `push_reload' to indicate parts
+ that need reloading; OPNUM, TYPE and IND_LEVELS are usually
+ suitable to be passed unaltered to `push_reload'.
+
+ The code generated by this macro must not alter the substructure of
+ X. If it transforms X into a more legitimate form, it should
+ assign X (which will always be a C variable) a new value. This
+ also applies to parts that you change indirectly by calling
+ `push_reload'.
+
+ The macro definition may use `strict_memory_address_p' to test if
+ the address has become legitimate.
+
+ If you want to change only a part of X, one standard way of doing
+ this is to use `copy_rtx'. Note, however, that it unshares only a
+ single level of rtl. Thus, if the part to be changed is not at the
+ top level, you'll need to replace first the top level. It is not
+ necessary for this macro to come up with a legitimate address;
+ but often a machine-dependent strategy can generate better code.
+
+ -- Macro: GO_IF_MODE_DEPENDENT_ADDRESS (ADDR, LABEL)
+ A C statement or compound statement with a conditional `goto
+ LABEL;' executed if memory address X (an RTX) can have different
+ meanings depending on the machine mode of the memory reference it
+ is used for or if the address is valid for some modes but not
+ others.
+
+ Autoincrement and autodecrement addresses typically have
+ mode-dependent effects because the amount of the increment or
+ decrement is the size of the operand being addressed. Some
+ machines have other mode-dependent addresses. Many RISC machines
+ have no mode-dependent addresses.
+
+ You may assume that ADDR is a valid address for the machine.
+
+ -- Macro: LEGITIMATE_CONSTANT_P (X)
+ A C expression that is nonzero if X is a legitimate constant for
+ an immediate operand on the target machine. You can assume that X
+ satisfies `CONSTANT_P', so you need not check this. In fact, `1'
+ is a suitable definition for this macro on machines where anything
+ `CONSTANT_P' is valid.
+
+ -- Target Hook: rtx TARGET_DELEGITIMIZE_ADDRESS (rtx X)
+ This hook is used to undo the possibly obfuscating effects of the
+ `LEGITIMIZE_ADDRESS' and `LEGITIMIZE_RELOAD_ADDRESS' target
+ macros. Some backend implementations of these macros wrap symbol
+ references inside an `UNSPEC' rtx to represent PIC or similar
+ addressing modes. This target hook allows GCC's optimizers to
+ understand the semantics of these opaque `UNSPEC's by converting
+ them back into their original form.
+
+ -- Target Hook: bool TARGET_CANNOT_FORCE_CONST_MEM (rtx X)
+ This hook should return true if X is of a form that cannot (or
+ should not) be spilled to the constant pool. The default version
+ of this hook returns false.
+
+ The primary reason to define this hook is to prevent reload from
+ deciding that a non-legitimate constant would be better reloaded
+ from the constant pool instead of spilling and reloading a register
+ holding the constant. This restriction is often true of addresses
+ of TLS symbols for various targets.
+
+ -- Target Hook: bool TARGET_USE_BLOCKS_FOR_CONSTANT_P (enum
+ machine_mode MODE, rtx X)
+ This hook should return true if pool entries for constant X can be
+ placed in an `object_block' structure. MODE is the mode of X.
+
+ The default version returns false for all constants.
+
+ -- Target Hook: tree TARGET_BUILTIN_RECIPROCAL (enum tree_code FN,
+ bool TM_FN, bool SQRT)
+ This hook should return the DECL of a function that implements
+ reciprocal of the builtin function with builtin function code FN,
+ or `NULL_TREE' if such a function is not available. TM_FN is true
+ when FN is a code of a machine-dependent builtin function. When
+ SQRT is true, additional optimizations that apply only to the
+ reciprocal of a square root function are performed, and only
+ reciprocals of `sqrt' function are valid.
+
+ -- Target Hook: tree TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD (void)
+ This hook should return the DECL of a function F that given an
+ address ADDR as an argument returns a mask M that can be used to
+ extract from two vectors the relevant data that resides in ADDR in
+ case ADDR is not properly aligned.
+
+ The autovectorizer, when vectorizing a load operation from an
+ address ADDR that may be unaligned, will generate two vector loads
+ from the two aligned addresses around ADDR. It then generates a
+ `REALIGN_LOAD' operation to extract the relevant data from the two
+ loaded vectors. The first two arguments to `REALIGN_LOAD', V1 and
+ V2, are the two vectors, each of size VS, and the third argument,
+ OFF, defines how the data will be extracted from these two
+ vectors: if OFF is 0, then the returned vector is V2; otherwise,
+ the returned vector is composed from the last VS-OFF elements of
+ V1 concatenated to the first OFF elements of V2.
+
+ If this hook is defined, the autovectorizer will generate a call
+ to F (using the DECL tree that this hook returns) and will use the
+ return value of F as the argument OFF to `REALIGN_LOAD'.
+ Therefore, the mask M returned by F should comply with the
+ semantics expected by `REALIGN_LOAD' described above. If this
+ hook is not defined, then ADDR will be used as the argument OFF to
+ `REALIGN_LOAD', in which case the low log2(VS)-1 bits of ADDR will
+ be considered.
+
+ -- Target Hook: tree TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN (tree X)
+ This hook should return the DECL of a function F that implements
+ widening multiplication of the even elements of two input vectors
+ of type X.
+
+ If this hook is defined, the autovectorizer will use it along with
+ the `TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD' target hook when
+ vectorizing widening multiplication in cases that the order of the
+ results does not have to be preserved (e.g. used only by a
+ reduction computation). Otherwise, the `widen_mult_hi/lo' idioms
+ will be used.
+
+ -- Target Hook: tree TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD (tree X)
+ This hook should return the DECL of a function F that implements
+ widening multiplication of the odd elements of two input vectors
+ of type X.
+
+ If this hook is defined, the autovectorizer will use it along with
+ the `TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN' target hook when
+ vectorizing widening multiplication in cases that the order of the
+ results does not have to be preserved (e.g. used only by a
+ reduction computation). Otherwise, the `widen_mult_hi/lo' idioms
+ will be used.
+
+ -- Target Hook: tree TARGET_VECTORIZE_BUILTIN_CONVERSION (enum
+ tree_code CODE, tree TYPE)
+ This hook should return the DECL of a function that implements
+ conversion of the input vector of type TYPE. If TYPE is an
+ integral type, the result of the conversion is a vector of
+ floating-point type of the same size. If TYPE is a floating-point
+ type, the result of the conversion is a vector of integral type of
+ the same size. CODE specifies how the conversion is to be applied
+ (truncation, rounding, etc.).
+
+ If this hook is defined, the autovectorizer will use the
+ `TARGET_VECTORIZE_BUILTIN_CONVERSION' target hook when vectorizing
+ conversion. Otherwise, it will return `NULL_TREE'.
+
+ -- Target Hook: tree TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION
+ (enum built_in_function CODE, tree VEC_TYPE_OUT, tree
+ VEC_TYPE_IN)
+ This hook should return the decl of a function that implements the
+ vectorized variant of the builtin function with builtin function
+ code CODE or `NULL_TREE' if such a function is not available. The
+ return type of the vectorized function shall be of vector type
+ VEC_TYPE_OUT and the argument types should be VEC_TYPE_IN.
+
+
+File: gccint.info, Node: Anchored Addresses, Next: Condition Code, Prev: Addressing Modes, Up: Target Macros
+
+17.15 Anchored Addresses
+========================
+
+GCC usually addresses every static object as a separate entity. For
+example, if we have:
+
+ static int a, b, c;
+ int foo (void) { return a + b + c; }
+
+ the code for `foo' will usually calculate three separate symbolic
+addresses: those of `a', `b' and `c'. On some targets, it would be
+better to calculate just one symbolic address and access the three
+variables relative to it. The equivalent pseudocode would be something
+like:
+
+ int foo (void)
+ {
+ register int *xr = &x;
+ return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
+ }
+
+ (which isn't valid C). We refer to shared addresses like `x' as
+"section anchors". Their use is controlled by `-fsection-anchors'.
+
+ The hooks below describe the target properties that GCC needs to know
+in order to make effective use of section anchors. It won't use
+section anchors at all unless either `TARGET_MIN_ANCHOR_OFFSET' or
+`TARGET_MAX_ANCHOR_OFFSET' is set to a nonzero value.
+
+ -- Variable: Target Hook HOST_WIDE_INT TARGET_MIN_ANCHOR_OFFSET
+ The minimum offset that should be applied to a section anchor. On
+ most targets, it should be the smallest offset that can be applied
+ to a base register while still giving a legitimate address for
+ every mode. The default value is 0.
+
+ -- Variable: Target Hook HOST_WIDE_INT TARGET_MAX_ANCHOR_OFFSET
+ Like `TARGET_MIN_ANCHOR_OFFSET', but the maximum (inclusive)
+ offset that should be applied to section anchors. The default
+ value is 0.
+
+ -- Target Hook: void TARGET_ASM_OUTPUT_ANCHOR (rtx X)
+ Write the assembly code to define section anchor X, which is a
+ `SYMBOL_REF' for which `SYMBOL_REF_ANCHOR_P (X)' is true. The
+ hook is called with the assembly output position set to the
+ beginning of `SYMBOL_REF_BLOCK (X)'.
+
+ If `ASM_OUTPUT_DEF' is available, the hook's default definition
+ uses it to define the symbol as `. + SYMBOL_REF_BLOCK_OFFSET (X)'.
+ If `ASM_OUTPUT_DEF' is not available, the hook's default definition
+ is `NULL', which disables the use of section anchors altogether.
+
+ -- Target Hook: bool TARGET_USE_ANCHORS_FOR_SYMBOL_P (rtx X)
+ Return true if GCC should attempt to use anchors to access
+ `SYMBOL_REF' X. You can assume `SYMBOL_REF_HAS_BLOCK_INFO_P (X)'
+ and `!SYMBOL_REF_ANCHOR_P (X)'.
+
+ The default version is correct for most targets, but you might
+ need to intercept this hook to handle things like target-specific
+ attributes or target-specific sections.
+
+
+File: gccint.info, Node: Condition Code, Next: Costs, Prev: Anchored Addresses, Up: Target Macros
+
+17.16 Condition Code Status
+===========================
+
+This describes the condition code status.
+
+ The file `conditions.h' defines a variable `cc_status' to describe how
+the condition code was computed (in case the interpretation of the
+condition code depends on the instruction that it was set by). This
+variable contains the RTL expressions on which the condition code is
+currently based, and several standard flags.
+
+ Sometimes additional machine-specific flags must be defined in the
+machine description header file. It can also add additional
+machine-specific information by defining `CC_STATUS_MDEP'.
+
+ -- Macro: CC_STATUS_MDEP
+ C code for a data type which is used for declaring the `mdep'
+ component of `cc_status'. It defaults to `int'.
+
+ This macro is not used on machines that do not use `cc0'.
+
+ -- Macro: CC_STATUS_MDEP_INIT
+ A C expression to initialize the `mdep' field to "empty". The
+ default definition does nothing, since most machines don't use the
+ field anyway. If you want to use the field, you should probably
+ define this macro to initialize it.
+
+ This macro is not used on machines that do not use `cc0'.
+
+ -- Macro: NOTICE_UPDATE_CC (EXP, INSN)
+ A C compound statement to set the components of `cc_status'
+ appropriately for an insn INSN whose body is EXP. It is this
+ macro's responsibility to recognize insns that set the condition
+ code as a byproduct of other activity as well as those that
+ explicitly set `(cc0)'.
+
+ This macro is not used on machines that do not use `cc0'.
+
+ If there are insns that do not set the condition code but do alter
+ other machine registers, this macro must check to see whether they
+ invalidate the expressions that the condition code is recorded as
+ reflecting. For example, on the 68000, insns that store in address
+ registers do not set the condition code, which means that usually
+ `NOTICE_UPDATE_CC' can leave `cc_status' unaltered for such insns.
+ But suppose that the previous insn set the condition code based
+ on location `a4@(102)' and the current insn stores a new value in
+ `a4'. Although the condition code is not changed by this, it will
+ no longer be true that it reflects the contents of `a4@(102)'.
+ Therefore, `NOTICE_UPDATE_CC' must alter `cc_status' in this case
+ to say that nothing is known about the condition code value.
+
+ The definition of `NOTICE_UPDATE_CC' must be prepared to deal with
+ the results of peephole optimization: insns whose patterns are
+ `parallel' RTXs containing various `reg', `mem' or constants which
+ are just the operands. The RTL structure of these insns is not
+ sufficient to indicate what the insns actually do. What
+ `NOTICE_UPDATE_CC' should do when it sees one is just to run
+ `CC_STATUS_INIT'.
+
+ A possible definition of `NOTICE_UPDATE_CC' is to call a function
+ that looks at an attribute (*note Insn Attributes::) named, for
+ example, `cc'. This avoids having detailed information about
+ patterns in two places, the `md' file and in `NOTICE_UPDATE_CC'.
+
+ -- Macro: SELECT_CC_MODE (OP, X, Y)
+ Returns a mode from class `MODE_CC' to be used when comparison
+ operation code OP is applied to rtx X and Y. For example, on the
+ SPARC, `SELECT_CC_MODE' is defined as (see *note Jump Patterns::
+ for a description of the reason for this definition)
+
+ #define SELECT_CC_MODE(OP,X,Y) \
+ (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
+ ? ((OP == EQ || OP == NE) ? CCFPmode : CCFPEmode) \
+ : ((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS \
+ || GET_CODE (X) == NEG) \
+ ? CC_NOOVmode : CCmode))
+
+ You should define this macro if and only if you define extra CC
+ modes in `MACHINE-modes.def'.
+
+ -- Macro: CANONICALIZE_COMPARISON (CODE, OP0, OP1)
+ On some machines not all possible comparisons are defined, but you
+ can convert an invalid comparison into a valid one. For example,
+ the Alpha does not have a `GT' comparison, but you can use an `LT'
+ comparison instead and swap the order of the operands.
+
+ On such machines, define this macro to be a C statement to do any
+ required conversions. CODE is the initial comparison code and OP0
+ and OP1 are the left and right operands of the comparison,
+ respectively. You should modify CODE, OP0, and OP1 as required.
+
+ GCC will not assume that the comparison resulting from this macro
+ is valid but will see if the resulting insn matches a pattern in
+ the `md' file.
+
+ You need not define this macro if it would never change the
+ comparison code or operands.
+
+ -- Macro: REVERSIBLE_CC_MODE (MODE)
+ A C expression whose value is one if it is always safe to reverse a
+ comparison whose mode is MODE. If `SELECT_CC_MODE' can ever
+ return MODE for a floating-point inequality comparison, then
+ `REVERSIBLE_CC_MODE (MODE)' must be zero.
+
+ You need not define this macro if it would always returns zero or
+ if the floating-point format is anything other than
+ `IEEE_FLOAT_FORMAT'. For example, here is the definition used on
+ the SPARC, where floating-point inequality comparisons are always
+ given `CCFPEmode':
+
+ #define REVERSIBLE_CC_MODE(MODE) ((MODE) != CCFPEmode)
+
+ -- Macro: REVERSE_CONDITION (CODE, MODE)
+ A C expression whose value is reversed condition code of the CODE
+ for comparison done in CC_MODE MODE. The macro is used only in
+ case `REVERSIBLE_CC_MODE (MODE)' is nonzero. Define this macro in
+ case machine has some non-standard way how to reverse certain
+ conditionals. For instance in case all floating point conditions
+ are non-trapping, compiler may freely convert unordered compares
+ to ordered one. Then definition may look like:
+
+ #define REVERSE_CONDITION(CODE, MODE) \
+ ((MODE) != CCFPmode ? reverse_condition (CODE) \
+ : reverse_condition_maybe_unordered (CODE))
+
+ -- Macro: REVERSE_CONDEXEC_PREDICATES_P (OP1, OP2)
+ A C expression that returns true if the conditional execution
+ predicate OP1, a comparison operation, is the inverse of OP2 and
+ vice versa. Define this to return 0 if the target has conditional
+ execution predicates that cannot be reversed safely. There is no
+ need to validate that the arguments of op1 and op2 are the same,
+ this is done separately. If no expansion is specified, this macro
+ is defined as follows:
+
+ #define REVERSE_CONDEXEC_PREDICATES_P (x, y) \
+ (GET_CODE ((x)) == reversed_comparison_code ((y), NULL))
+
+ -- Target Hook: bool TARGET_FIXED_CONDITION_CODE_REGS (unsigned int *,
+ unsigned int *)
+ On targets which do not use `(cc0)', and which use a hard register
+ rather than a pseudo-register to hold condition codes, the regular
+ CSE passes are often not able to identify cases in which the hard
+ register is set to a common value. Use this hook to enable a
+ small pass which optimizes such cases. This hook should return
+ true to enable this pass, and it should set the integers to which
+ its arguments point to the hard register numbers used for
+ condition codes. When there is only one such register, as is true
+ on most systems, the integer pointed to by the second argument
+ should be set to `INVALID_REGNUM'.
+
+ The default version of this hook returns false.
+
+ -- Target Hook: enum machine_mode TARGET_CC_MODES_COMPATIBLE (enum
+ machine_mode, enum machine_mode)
+ On targets which use multiple condition code modes in class
+ `MODE_CC', it is sometimes the case that a comparison can be
+ validly done in more than one mode. On such a system, define this
+ target hook to take two mode arguments and to return a mode in
+ which both comparisons may be validly done. If there is no such
+ mode, return `VOIDmode'.
+
+ The default version of this hook checks whether the modes are the
+ same. If they are, it returns that mode. If they are different,
+ it returns `VOIDmode'.
+
+
+File: gccint.info, Node: Costs, Next: Scheduling, Prev: Condition Code, Up: Target Macros
+
+17.17 Describing Relative Costs of Operations
+=============================================
+
+These macros let you describe the relative speed of various operations
+on the target machine.
+
+ -- Macro: REGISTER_MOVE_COST (MODE, FROM, TO)
+ A C expression for the cost of moving data of mode MODE from a
+ register in class FROM to one in class TO. The classes are
+ expressed using the enumeration values such as `GENERAL_REGS'. A
+ value of 2 is the default; other values are interpreted relative to
+ that.
+
+ It is not required that the cost always equal 2 when FROM is the
+ same as TO; on some machines it is expensive to move between
+ registers if they are not general registers.
+
+ If reload sees an insn consisting of a single `set' between two
+ hard registers, and if `REGISTER_MOVE_COST' applied to their
+ classes returns a value of 2, reload does not check to ensure that
+ the constraints of the insn are met. Setting a cost of other than
+ 2 will allow reload to verify that the constraints are met. You
+ should do this if the `movM' pattern's constraints do not allow
+ such copying.
+
+ -- Macro: MEMORY_MOVE_COST (MODE, CLASS, IN)
+ A C expression for the cost of moving data of mode MODE between a
+ register of class CLASS and memory; IN is zero if the value is to
+ be written to memory, nonzero if it is to be read in. This cost
+ is relative to those in `REGISTER_MOVE_COST'. If moving between
+ registers and memory is more expensive than between two registers,
+ you should define this macro to express the relative cost.
+
+ If you do not define this macro, GCC uses a default cost of 4 plus
+ the cost of copying via a secondary reload register, if one is
+ needed. If your machine requires a secondary reload register to
+ copy between memory and a register of CLASS but the reload
+ mechanism is more complex than copying via an intermediate, define
+ this macro to reflect the actual cost of the move.
+
+ GCC defines the function `memory_move_secondary_cost' if secondary
+ reloads are needed. It computes the costs due to copying via a
+ secondary register. If your machine copies from memory using a
+ secondary register in the conventional way but the default base
+ value of 4 is not correct for your machine, define this macro to
+ add some other value to the result of that function. The
+ arguments to that function are the same as to this macro.
+
+ -- Macro: BRANCH_COST (SPEED_P, PREDICTABLE_P)
+ A C expression for the cost of a branch instruction. A value of 1
+ is the default; other values are interpreted relative to that.
+ Parameter SPEED_P is true when the branch in question should be
+ optimized for speed. When it is false, `BRANCH_COST' should be
+ returning value optimal for code size rather then performance
+ considerations. PREDICTABLE_P is true for well predictable
+ branches. On many architectures the `BRANCH_COST' can be reduced
+ then.
+
+ Here are additional macros which do not specify precise relative costs,
+but only that certain actions are more expensive than GCC would
+ordinarily expect.
+
+ -- Macro: SLOW_BYTE_ACCESS
+ Define this macro as a C expression which is nonzero if accessing
+ less than a word of memory (i.e. a `char' or a `short') is no
+ faster than accessing a word of memory, i.e., if such access
+ require more than one instruction or if there is no difference in
+ cost between byte and (aligned) word loads.
+
+ When this macro is not defined, the compiler will access a field by
+ finding the smallest containing object; when it is defined, a
+ fullword load will be used if alignment permits. Unless bytes
+ accesses are faster than word accesses, using word accesses is
+ preferable since it may eliminate subsequent memory access if
+ subsequent accesses occur to other fields in the same word of the
+ structure, but to different bytes.
+
+ -- Macro: SLOW_UNALIGNED_ACCESS (MODE, ALIGNMENT)
+ Define this macro to be the value 1 if memory accesses described
+ by the MODE and ALIGNMENT parameters have a cost many times greater
+ than aligned accesses, for example if they are emulated in a trap
+ handler.
+
+ When this macro is nonzero, the compiler will act as if
+ `STRICT_ALIGNMENT' were nonzero when generating code for block
+ moves. This can cause significantly more instructions to be
+ produced. Therefore, do not set this macro nonzero if unaligned
+ accesses only add a cycle or two to the time for a memory access.
+
+ If the value of this macro is always zero, it need not be defined.
+ If this macro is defined, it should produce a nonzero value when
+ `STRICT_ALIGNMENT' is nonzero.
+
+ -- Macro: MOVE_RATIO
+ The threshold of number of scalar memory-to-memory move insns,
+ _below_ which a sequence of insns should be generated instead of a
+ string move insn or a library call. Increasing the value will
+ always make code faster, but eventually incurs high cost in
+ increased code size.
+
+ Note that on machines where the corresponding move insn is a
+ `define_expand' that emits a sequence of insns, this macro counts
+ the number of such sequences.
+
+ If you don't define this, a reasonable default is used.
+
+ -- Macro: MOVE_BY_PIECES_P (SIZE, ALIGNMENT)
+ A C expression used to determine whether `move_by_pieces' will be
+ used to copy a chunk of memory, or whether some other block move
+ mechanism will be used. Defaults to 1 if `move_by_pieces_ninsns'
+ returns less than `MOVE_RATIO'.
+
+ -- Macro: MOVE_MAX_PIECES
+ A C expression used by `move_by_pieces' to determine the largest
+ unit a load or store used to copy memory is. Defaults to
+ `MOVE_MAX'.
+
+ -- Macro: CLEAR_RATIO
+ The threshold of number of scalar move insns, _below_ which a
+ sequence of insns should be generated to clear memory instead of a
+ string clear insn or a library call. Increasing the value will
+ always make code faster, but eventually incurs high cost in
+ increased code size.
+
+ If you don't define this, a reasonable default is used.
+
+ -- Macro: CLEAR_BY_PIECES_P (SIZE, ALIGNMENT)
+ A C expression used to determine whether `clear_by_pieces' will be
+ used to clear a chunk of memory, or whether some other block clear
+ mechanism will be used. Defaults to 1 if `move_by_pieces_ninsns'
+ returns less than `CLEAR_RATIO'.
+
+ -- Macro: SET_RATIO
+ The threshold of number of scalar move insns, _below_ which a
+ sequence of insns should be generated to set memory to a constant
+ value, instead of a block set insn or a library call. Increasing
+ the value will always make code faster, but eventually incurs high
+ cost in increased code size.
+
+ If you don't define this, it defaults to the value of `MOVE_RATIO'.
+
+ -- Macro: SET_BY_PIECES_P (SIZE, ALIGNMENT)
+ A C expression used to determine whether `store_by_pieces' will be
+ used to set a chunk of memory to a constant value, or whether some
+ other mechanism will be used. Used by `__builtin_memset' when
+ storing values other than constant zero. Defaults to 1 if
+ `move_by_pieces_ninsns' returns less than `SET_RATIO'.
+
+ -- Macro: STORE_BY_PIECES_P (SIZE, ALIGNMENT)
+ A C expression used to determine whether `store_by_pieces' will be
+ used to set a chunk of memory to a constant string value, or
+ whether some other mechanism will be used. Used by
+ `__builtin_strcpy' when called with a constant source string.
+ Defaults to 1 if `move_by_pieces_ninsns' returns less than
+ `MOVE_RATIO'.
+
+ -- Macro: USE_LOAD_POST_INCREMENT (MODE)
+ A C expression used to determine whether a load postincrement is a
+ good thing to use for a given mode. Defaults to the value of
+ `HAVE_POST_INCREMENT'.
+
+ -- Macro: USE_LOAD_POST_DECREMENT (MODE)
+ A C expression used to determine whether a load postdecrement is a
+ good thing to use for a given mode. Defaults to the value of
+ `HAVE_POST_DECREMENT'.
+
+ -- Macro: USE_LOAD_PRE_INCREMENT (MODE)
+ A C expression used to determine whether a load preincrement is a
+ good thing to use for a given mode. Defaults to the value of
+ `HAVE_PRE_INCREMENT'.
+
+ -- Macro: USE_LOAD_PRE_DECREMENT (MODE)
+ A C expression used to determine whether a load predecrement is a
+ good thing to use for a given mode. Defaults to the value of
+ `HAVE_PRE_DECREMENT'.
+
+ -- Macro: USE_STORE_POST_INCREMENT (MODE)
+ A C expression used to determine whether a store postincrement is
+ a good thing to use for a given mode. Defaults to the value of
+ `HAVE_POST_INCREMENT'.
+
+ -- Macro: USE_STORE_POST_DECREMENT (MODE)
+ A C expression used to determine whether a store postdecrement is
+ a good thing to use for a given mode. Defaults to the value of
+ `HAVE_POST_DECREMENT'.
+
+ -- Macro: USE_STORE_PRE_INCREMENT (MODE)
+ This macro is used to determine whether a store preincrement is a
+ good thing to use for a given mode. Defaults to the value of
+ `HAVE_PRE_INCREMENT'.
+
+ -- Macro: USE_STORE_PRE_DECREMENT (MODE)
+ This macro is used to determine whether a store predecrement is a
+ good thing to use for a given mode. Defaults to the value of
+ `HAVE_PRE_DECREMENT'.
+
+ -- Macro: NO_FUNCTION_CSE
+ Define this macro if it is as good or better to call a constant
+ function address than to call an address kept in a register.
+
+ -- Macro: RANGE_TEST_NON_SHORT_CIRCUIT
+ Define this macro if a non-short-circuit operation produced by
+ `fold_range_test ()' is optimal. This macro defaults to true if
+ `BRANCH_COST' is greater than or equal to the value 2.
+
+ -- Target Hook: bool TARGET_RTX_COSTS (rtx X, int CODE, int
+ OUTER_CODE, int *TOTAL)
+ This target hook describes the relative costs of RTL expressions.
+
+ The cost may depend on the precise form of the expression, which is
+ available for examination in X, and the rtx code of the expression
+ in which it is contained, found in OUTER_CODE. CODE is the
+ expression code--redundant, since it can be obtained with
+ `GET_CODE (X)'.
+
+ In implementing this hook, you can use the construct
+ `COSTS_N_INSNS (N)' to specify a cost equal to N fast instructions.
+
+ On entry to the hook, `*TOTAL' contains a default estimate for the
+ cost of the expression. The hook should modify this value as
+ necessary. Traditionally, the default costs are `COSTS_N_INSNS
+ (5)' for multiplications, `COSTS_N_INSNS (7)' for division and
+ modulus operations, and `COSTS_N_INSNS (1)' for all other
+ operations.
+
+ When optimizing for code size, i.e. when `optimize_size' is
+ nonzero, this target hook should be used to estimate the relative
+ size cost of an expression, again relative to `COSTS_N_INSNS'.
+
+ The hook returns true when all subexpressions of X have been
+ processed, and false when `rtx_cost' should recurse.
+
+ -- Target Hook: int TARGET_ADDRESS_COST (rtx ADDRESS)
+ This hook computes the cost of an addressing mode that contains
+ ADDRESS. If not defined, the cost is computed from the ADDRESS
+ expression and the `TARGET_RTX_COST' hook.
+
+ For most CISC machines, the default cost is a good approximation
+ of the true cost of the addressing mode. However, on RISC
+ machines, all instructions normally have the same length and
+ execution time. Hence all addresses will have equal costs.
+
+ In cases where more than one form of an address is known, the form
+ with the lowest cost will be used. If multiple forms have the
+ same, lowest, cost, the one that is the most complex will be used.
+
+ For example, suppose an address that is equal to the sum of a
+ register and a constant is used twice in the same basic block.
+ When this macro is not defined, the address will be computed in a
+ register and memory references will be indirect through that
+ register. On machines where the cost of the addressing mode
+ containing the sum is no higher than that of a simple indirect
+ reference, this will produce an additional instruction and
+ possibly require an additional register. Proper specification of
+ this macro eliminates this overhead for such machines.
+
+ This hook is never called with an invalid address.
+
+ On machines where an address involving more than one register is as
+ cheap as an address computation involving only one register,
+ defining `TARGET_ADDRESS_COST' to reflect this can cause two
+ registers to be live over a region of code where only one would
+ have been if `TARGET_ADDRESS_COST' were not defined in that
+ manner. This effect should be considered in the definition of
+ this macro. Equivalent costs should probably only be given to
+ addresses with different numbers of registers on machines with
+ lots of registers.
+
+
+File: gccint.info, Node: Scheduling, Next: Sections, Prev: Costs, Up: Target Macros
+
+17.18 Adjusting the Instruction Scheduler
+=========================================
+
+The instruction scheduler may need a fair amount of machine-specific
+adjustment in order to produce good code. GCC provides several target
+hooks for this purpose. It is usually enough to define just a few of
+them: try the first ones in this list first.
+
+ -- Target Hook: int TARGET_SCHED_ISSUE_RATE (void)
+ This hook returns the maximum number of instructions that can ever
+ issue at the same time on the target machine. The default is one.
+ Although the insn scheduler can define itself the possibility of
+ issue an insn on the same cycle, the value can serve as an
+ additional constraint to issue insns on the same simulated
+ processor cycle (see hooks `TARGET_SCHED_REORDER' and
+ `TARGET_SCHED_REORDER2'). This value must be constant over the
+ entire compilation. If you need it to vary depending on what the
+ instructions are, you must use `TARGET_SCHED_VARIABLE_ISSUE'.
+
+ -- Target Hook: int TARGET_SCHED_VARIABLE_ISSUE (FILE *FILE, int
+ VERBOSE, rtx INSN, int MORE)
+ This hook is executed by the scheduler after it has scheduled an
+ insn from the ready list. It should return the number of insns
+ which can still be issued in the current cycle. The default is
+ `MORE - 1' for insns other than `CLOBBER' and `USE', which
+ normally are not counted against the issue rate. You should
+ define this hook if some insns take more machine resources than
+ others, so that fewer insns can follow them in the same cycle.
+ FILE is either a null pointer, or a stdio stream to write any
+ debug output to. VERBOSE is the verbose level provided by
+ `-fsched-verbose-N'. INSN is the instruction that was scheduled.
+
+ -- Target Hook: int TARGET_SCHED_ADJUST_COST (rtx INSN, rtx LINK, rtx
+ DEP_INSN, int COST)
+ This function corrects the value of COST based on the relationship
+ between INSN and DEP_INSN through the dependence LINK. It should
+ return the new value. The default is to make no adjustment to
+ COST. This can be used for example to specify to the scheduler
+ using the traditional pipeline description that an output- or
+ anti-dependence does not incur the same cost as a data-dependence.
+ If the scheduler using the automaton based pipeline description,
+ the cost of anti-dependence is zero and the cost of
+ output-dependence is maximum of one and the difference of latency
+ times of the first and the second insns. If these values are not
+ acceptable, you could use the hook to modify them too. See also
+ *note Processor pipeline description::.
+
+ -- Target Hook: int TARGET_SCHED_ADJUST_PRIORITY (rtx INSN, int
+ PRIORITY)
+ This hook adjusts the integer scheduling priority PRIORITY of
+ INSN. It should return the new priority. Increase the priority to
+ execute INSN earlier, reduce the priority to execute INSN later.
+ Do not define this hook if you do not need to adjust the
+ scheduling priorities of insns.
+
+ -- Target Hook: int TARGET_SCHED_REORDER (FILE *FILE, int VERBOSE, rtx
+ *READY, int *N_READYP, int CLOCK)
+ This hook is executed by the scheduler after it has scheduled the
+ ready list, to allow the machine description to reorder it (for
+ example to combine two small instructions together on `VLIW'
+ machines). FILE is either a null pointer, or a stdio stream to
+ write any debug output to. VERBOSE is the verbose level provided
+ by `-fsched-verbose-N'. READY is a pointer to the ready list of
+ instructions that are ready to be scheduled. N_READYP is a
+ pointer to the number of elements in the ready list. The scheduler
+ reads the ready list in reverse order, starting with
+ READY[*N_READYP-1] and going to READY[0]. CLOCK is the timer tick
+ of the scheduler. You may modify the ready list and the number of
+ ready insns. The return value is the number of insns that can
+ issue this cycle; normally this is just `issue_rate'. See also
+ `TARGET_SCHED_REORDER2'.
+
+ -- Target Hook: int TARGET_SCHED_REORDER2 (FILE *FILE, int VERBOSE,
+ rtx *READY, int *N_READY, CLOCK)
+ Like `TARGET_SCHED_REORDER', but called at a different time. That
+ function is called whenever the scheduler starts a new cycle.
+ This one is called once per iteration over a cycle, immediately
+ after `TARGET_SCHED_VARIABLE_ISSUE'; it can reorder the ready list
+ and return the number of insns to be scheduled in the same cycle.
+ Defining this hook can be useful if there are frequent situations
+ where scheduling one insn causes other insns to become ready in
+ the same cycle. These other insns can then be taken into account
+ properly.
+
+ -- Target Hook: void TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK (rtx
+ HEAD, rtx TAIL)
+ This hook is called after evaluation forward dependencies of insns
+ in chain given by two parameter values (HEAD and TAIL
+ correspondingly) but before insns scheduling of the insn chain.
+ For example, it can be used for better insn classification if it
+ requires analysis of dependencies. This hook can use backward and
+ forward dependencies of the insn scheduler because they are already
+ calculated.
+
+ -- Target Hook: void TARGET_SCHED_INIT (FILE *FILE, int VERBOSE, int
+ MAX_READY)
+ This hook is executed by the scheduler at the beginning of each
+ block of instructions that are to be scheduled. FILE is either a
+ null pointer, or a stdio stream to write any debug output to.
+ VERBOSE is the verbose level provided by `-fsched-verbose-N'.
+ MAX_READY is the maximum number of insns in the current scheduling
+ region that can be live at the same time. This can be used to
+ allocate scratch space if it is needed, e.g. by
+ `TARGET_SCHED_REORDER'.
+
+ -- Target Hook: void TARGET_SCHED_FINISH (FILE *FILE, int VERBOSE)
+ This hook is executed by the scheduler at the end of each block of
+ instructions that are to be scheduled. It can be used to perform
+ cleanup of any actions done by the other scheduling hooks. FILE
+ is either a null pointer, or a stdio stream to write any debug
+ output to. VERBOSE is the verbose level provided by
+ `-fsched-verbose-N'.
+
+ -- Target Hook: void TARGET_SCHED_INIT_GLOBAL (FILE *FILE, int
+ VERBOSE, int OLD_MAX_UID)
+ This hook is executed by the scheduler after function level
+ initializations. FILE is either a null pointer, or a stdio stream
+ to write any debug output to. VERBOSE is the verbose level
+ provided by `-fsched-verbose-N'. OLD_MAX_UID is the maximum insn
+ uid when scheduling begins.
+
+ -- Target Hook: void TARGET_SCHED_FINISH_GLOBAL (FILE *FILE, int
+ VERBOSE)
+ This is the cleanup hook corresponding to
+ `TARGET_SCHED_INIT_GLOBAL'. FILE is either a null pointer, or a
+ stdio stream to write any debug output to. VERBOSE is the verbose
+ level provided by `-fsched-verbose-N'.
+
+ -- Target Hook: int TARGET_SCHED_DFA_PRE_CYCLE_INSN (void)
+ The hook returns an RTL insn. The automaton state used in the
+ pipeline hazard recognizer is changed as if the insn were scheduled
+ when the new simulated processor cycle starts. Usage of the hook
+ may simplify the automaton pipeline description for some VLIW
+ processors. If the hook is defined, it is used only for the
+ automaton based pipeline description. The default is not to
+ change the state when the new simulated processor cycle starts.
+
+ -- Target Hook: void TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN (void)
+ The hook can be used to initialize data used by the previous hook.
+
+ -- Target Hook: int TARGET_SCHED_DFA_POST_CYCLE_INSN (void)
+ The hook is analogous to `TARGET_SCHED_DFA_PRE_CYCLE_INSN' but used
+ to changed the state as if the insn were scheduled when the new
+ simulated processor cycle finishes.
+
+ -- Target Hook: void TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN (void)
+ The hook is analogous to `TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN' but
+ used to initialize data used by the previous hook.
+
+ -- Target Hook: void TARGET_SCHED_DFA_PRE_CYCLE_ADVANCE (void)
+ The hook to notify target that the current simulated cycle is
+ about to finish. The hook is analogous to
+ `TARGET_SCHED_DFA_PRE_CYCLE_INSN' but used to change the state in
+ more complicated situations - e.g., when advancing state on a
+ single insn is not enough.
+
+ -- Target Hook: void TARGET_SCHED_DFA_POST_CYCLE_ADVANCE (void)
+ The hook to notify target that new simulated cycle has just
+ started. The hook is analogous to
+ `TARGET_SCHED_DFA_POST_CYCLE_INSN' but used to change the state in
+ more complicated situations - e.g., when advancing state on a
+ single insn is not enough.
+
+ -- Target Hook: int TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD
+ (void)
+ This hook controls better choosing an insn from the ready insn
+ queue for the DFA-based insn scheduler. Usually the scheduler
+ chooses the first insn from the queue. If the hook returns a
+ positive value, an additional scheduler code tries all
+ permutations of `TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD
+ ()' subsequent ready insns to choose an insn whose issue will
+ result in maximal number of issued insns on the same cycle. For
+ the VLIW processor, the code could actually solve the problem of
+ packing simple insns into the VLIW insn. Of course, if the rules
+ of VLIW packing are described in the automaton.
+
+ This code also could be used for superscalar RISC processors. Let
+ us consider a superscalar RISC processor with 3 pipelines. Some
+ insns can be executed in pipelines A or B, some insns can be
+ executed only in pipelines B or C, and one insn can be executed in
+ pipeline B. The processor may issue the 1st insn into A and the
+ 2nd one into B. In this case, the 3rd insn will wait for freeing B
+ until the next cycle. If the scheduler issues the 3rd insn the
+ first, the processor could issue all 3 insns per cycle.
+
+ Actually this code demonstrates advantages of the automaton based
+ pipeline hazard recognizer. We try quickly and easy many insn
+ schedules to choose the best one.
+
+ The default is no multipass scheduling.
+
+ -- Target Hook: int
+TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD (rtx)
+ This hook controls what insns from the ready insn queue will be
+ considered for the multipass insn scheduling. If the hook returns
+ zero for insn passed as the parameter, the insn will be not chosen
+ to be issued.
+
+ The default is that any ready insns can be chosen to be issued.
+
+ -- Target Hook: int TARGET_SCHED_DFA_NEW_CYCLE (FILE *, int, rtx, int,
+ int, int *)
+ This hook is called by the insn scheduler before issuing insn
+ passed as the third parameter on given cycle. If the hook returns
+ nonzero, the insn is not issued on given processors cycle.
+ Instead of that, the processor cycle is advanced. If the value
+ passed through the last parameter is zero, the insn ready queue is
+ not sorted on the new cycle start as usually. The first parameter
+ passes file for debugging output. The second one passes the
+ scheduler verbose level of the debugging output. The forth and
+ the fifth parameter values are correspondingly processor cycle on
+ which the previous insn has been issued and the current processor
+ cycle.
+
+ -- Target Hook: bool TARGET_SCHED_IS_COSTLY_DEPENDENCE (struct dep_def
+ *_DEP, int COST, int DISTANCE)
+ This hook is used to define which dependences are considered
+ costly by the target, so costly that it is not advisable to
+ schedule the insns that are involved in the dependence too close
+ to one another. The parameters to this hook are as follows: The
+ first parameter _DEP is the dependence being evaluated. The
+ second parameter COST is the cost of the dependence, and the third
+ parameter DISTANCE is the distance in cycles between the two insns.
+ The hook returns `true' if considering the distance between the two
+ insns the dependence between them is considered costly by the
+ target, and `false' otherwise.
+
+ Defining this hook can be useful in multiple-issue out-of-order
+ machines, where (a) it's practically hopeless to predict the
+ actual data/resource delays, however: (b) there's a better chance
+ to predict the actual grouping that will be formed, and (c)
+ correctly emulating the grouping can be very important. In such
+ targets one may want to allow issuing dependent insns closer to
+ one another--i.e., closer than the dependence distance; however,
+ not in cases of "costly dependences", which this hooks allows to
+ define.
+
+ -- Target Hook: void TARGET_SCHED_H_I_D_EXTENDED (void)
+ This hook is called by the insn scheduler after emitting a new
+ instruction to the instruction stream. The hook notifies a target
+ backend to extend its per instruction data structures.
+
+ -- Target Hook: void * TARGET_SCHED_ALLOC_SCHED_CONTEXT (void)
+ Return a pointer to a store large enough to hold target scheduling
+ context.
+
+ -- Target Hook: void TARGET_SCHED_INIT_SCHED_CONTEXT (void *TC, bool
+ CLEAN_P)
+ Initialize store pointed to by TC to hold target scheduling
+ context. It CLEAN_P is true then initialize TC as if scheduler is
+ at the beginning of the block. Otherwise, make a copy of the
+ current context in TC.
+
+ -- Target Hook: void TARGET_SCHED_SET_SCHED_CONTEXT (void *TC)
+ Copy target scheduling context pointer to by TC to the current
+ context.
+
+ -- Target Hook: void TARGET_SCHED_CLEAR_SCHED_CONTEXT (void *TC)
+ Deallocate internal data in target scheduling context pointed to
+ by TC.
+
+ -- Target Hook: void TARGET_SCHED_FREE_SCHED_CONTEXT (void *TC)
+ Deallocate a store for target scheduling context pointed to by TC.
+
+ -- Target Hook: void * TARGET_SCHED_ALLOC_SCHED_CONTEXT (void)
+ Return a pointer to a store large enough to hold target scheduling
+ context.
+
+ -- Target Hook: void TARGET_SCHED_INIT_SCHED_CONTEXT (void *TC, bool
+ CLEAN_P)
+ Initialize store pointed to by TC to hold target scheduling
+ context. It CLEAN_P is true then initialize TC as if scheduler is
+ at the beginning of the block. Otherwise, make a copy of the
+ current context in TC.
+
+ -- Target Hook: void TARGET_SCHED_SET_SCHED_CONTEXT (void *TC)
+ Copy target scheduling context pointer to by TC to the current
+ context.
+
+ -- Target Hook: void TARGET_SCHED_CLEAR_SCHED_CONTEXT (void *TC)
+ Deallocate internal data in target scheduling context pointed to
+ by TC.
+
+ -- Target Hook: void TARGET_SCHED_FREE_SCHED_CONTEXT (void *TC)
+ Deallocate a store for target scheduling context pointed to by TC.
+
+ -- Target Hook: int TARGET_SCHED_SPECULATE_INSN (rtx INSN, int
+ REQUEST, rtx *NEW_PAT)
+ This hook is called by the insn scheduler when INSN has only
+ speculative dependencies and therefore can be scheduled
+ speculatively. The hook is used to check if the pattern of INSN
+ has a speculative version and, in case of successful check, to
+ generate that speculative pattern. The hook should return 1, if
+ the instruction has a speculative form, or -1, if it doesn't.
+ REQUEST describes the type of requested speculation. If the
+ return value equals 1 then NEW_PAT is assigned the generated
+ speculative pattern.
+
+ -- Target Hook: int TARGET_SCHED_NEEDS_BLOCK_P (rtx INSN)
+ This hook is called by the insn scheduler during generation of
+ recovery code for INSN. It should return nonzero, if the
+ corresponding check instruction should branch to recovery code, or
+ zero otherwise.
+
+ -- Target Hook: rtx TARGET_SCHED_GEN_CHECK (rtx INSN, rtx LABEL, int
+ MUTATE_P)
+ This hook is called by the insn scheduler to generate a pattern
+ for recovery check instruction. If MUTATE_P is zero, then INSN is
+ a speculative instruction for which the check should be generated.
+ LABEL is either a label of a basic block, where recovery code
+ should be emitted, or a null pointer, when requested check doesn't
+ branch to recovery code (a simple check). If MUTATE_P is nonzero,
+ then a pattern for a branchy check corresponding to a simple check
+ denoted by INSN should be generated. In this case LABEL can't be
+ null.
+
+ -- Target Hook: int
+TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC (rtx INSN)
+ This hook is used as a workaround for
+ `TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD' not being
+ called on the first instruction of the ready list. The hook is
+ used to discard speculative instruction that stand first in the
+ ready list from being scheduled on the current cycle. For
+ non-speculative instructions, the hook should always return
+ nonzero. For example, in the ia64 backend the hook is used to
+ cancel data speculative insns when the ALAT table is nearly full.
+
+ -- Target Hook: void TARGET_SCHED_SET_SCHED_FLAGS (unsigned int
+ *FLAGS, spec_info_t SPEC_INFO)
+ This hook is used by the insn scheduler to find out what features
+ should be enabled/used. FLAGS initially may have either the
+ SCHED_RGN or SCHED_EBB bit set. This denotes the scheduler pass
+ for which the data should be provided. The target backend should
+ modify FLAGS by modifying the bits corresponding to the following
+ features: USE_DEPS_LIST, USE_GLAT, DETACH_LIFE_INFO, and
+ DO_SPECULATION. For the DO_SPECULATION feature an additional
+ structure SPEC_INFO should be filled by the target. The structure
+ describes speculation types that can be used in the scheduler.
+
+ -- Target Hook: int TARGET_SCHED_SMS_RES_MII (struct ddg *G)
+ This hook is called by the swing modulo scheduler to calculate a
+ resource-based lower bound which is based on the resources
+ available in the machine and the resources required by each
+ instruction. The target backend can use G to calculate such
+ bound. A very simple lower bound will be used in case this hook
+ is not implemented: the total number of instructions divided by
+ the issue rate.
+
+
+File: gccint.info, Node: Sections, Next: PIC, Prev: Scheduling, Up: Target Macros
+
+17.19 Dividing the Output into Sections (Texts, Data, ...)
+==========================================================
+
+An object file is divided into sections containing different types of
+data. In the most common case, there are three sections: the "text
+section", which holds instructions and read-only data; the "data
+section", which holds initialized writable data; and the "bss section",
+which holds uninitialized data. Some systems have other kinds of
+sections.
+
+ `varasm.c' provides several well-known sections, such as
+`text_section', `data_section' and `bss_section'. The normal way of
+controlling a `FOO_section' variable is to define the associated
+`FOO_SECTION_ASM_OP' macro, as described below. The macros are only
+read once, when `varasm.c' initializes itself, so their values must be
+run-time constants. They may however depend on command-line flags.
+
+ _Note:_ Some run-time files, such `crtstuff.c', also make use of the
+`FOO_SECTION_ASM_OP' macros, and expect them to be string literals.
+
+ Some assemblers require a different string to be written every time a
+section is selected. If your assembler falls into this category, you
+should define the `TARGET_ASM_INIT_SECTIONS' hook and use
+`get_unnamed_section' to set up the sections.
+
+ You must always create a `text_section', either by defining
+`TEXT_SECTION_ASM_OP' or by initializing `text_section' in
+`TARGET_ASM_INIT_SECTIONS'. The same is true of `data_section' and
+`DATA_SECTION_ASM_OP'. If you do not create a distinct
+`readonly_data_section', the default is to reuse `text_section'.
+
+ All the other `varasm.c' sections are optional, and are null if the
+target does not provide them.
+
+ -- Macro: TEXT_SECTION_ASM_OP
+ A C expression whose value is a string, including spacing,
+ containing the assembler operation that should precede
+ instructions and read-only data. Normally `"\t.text"' is right.
+
+ -- Macro: HOT_TEXT_SECTION_NAME
+ If defined, a C string constant for the name of the section
+ containing most frequently executed functions of the program. If
+ not defined, GCC will provide a default definition if the target
+ supports named sections.
+
+ -- Macro: UNLIKELY_EXECUTED_TEXT_SECTION_NAME
+ If defined, a C string constant for the name of the section
+ containing unlikely executed functions in the program.
+
+ -- Macro: DATA_SECTION_ASM_OP
+ A C expression whose value is a string, including spacing,
+ containing the assembler operation to identify the following data
+ as writable initialized data. Normally `"\t.data"' is right.
+
+ -- Macro: SDATA_SECTION_ASM_OP
+ If defined, a C expression whose value is a string, including
+ spacing, containing the assembler operation to identify the
+ following data as initialized, writable small data.
+
+ -- Macro: READONLY_DATA_SECTION_ASM_OP
+ A C expression whose value is a string, including spacing,
+ containing the assembler operation to identify the following data
+ as read-only initialized data.
+
+ -- Macro: BSS_SECTION_ASM_OP
+ If defined, a C expression whose value is a string, including
+ spacing, containing the assembler operation to identify the
+ following data as uninitialized global data. If not defined, and
+ neither `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
+ uninitialized global data will be output in the data section if
+ `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
+ used.
+
+ -- Macro: SBSS_SECTION_ASM_OP
+ If defined, a C expression whose value is a string, including
+ spacing, containing the assembler operation to identify the
+ following data as uninitialized, writable small data.
+
+ -- Macro: INIT_SECTION_ASM_OP
+ If defined, a C expression whose value is a string, including
+ spacing, containing the assembler operation to identify the
+ following data as initialization code. If not defined, GCC will
+ assume such a section does not exist. This section has no
+ corresponding `init_section' variable; it is used entirely in
+ runtime code.
+
+ -- Macro: FINI_SECTION_ASM_OP
+ If defined, a C expression whose value is a string, including
+ spacing, containing the assembler operation to identify the
+ following data as finalization code. If not defined, GCC will
+ assume such a section does not exist. This section has no
+ corresponding `fini_section' variable; it is used entirely in
+ runtime code.
+
+ -- Macro: INIT_ARRAY_SECTION_ASM_OP
+ If defined, a C expression whose value is a string, including
+ spacing, containing the assembler operation to identify the
+ following data as part of the `.init_array' (or equivalent)
+ section. If not defined, GCC will assume such a section does not
+ exist. Do not define both this macro and `INIT_SECTION_ASM_OP'.
+
+ -- Macro: FINI_ARRAY_SECTION_ASM_OP
+ If defined, a C expression whose value is a string, including
+ spacing, containing the assembler operation to identify the
+ following data as part of the `.fini_array' (or equivalent)
+ section. If not defined, GCC will assume such a section does not
+ exist. Do not define both this macro and `FINI_SECTION_ASM_OP'.
+
+ -- Macro: CRT_CALL_STATIC_FUNCTION (SECTION_OP, FUNCTION)
+ If defined, an ASM statement that switches to a different section
+ via SECTION_OP, calls FUNCTION, and switches back to the text
+ section. This is used in `crtstuff.c' if `INIT_SECTION_ASM_OP' or
+ `FINI_SECTION_ASM_OP' to calls to initialization and finalization
+ functions from the init and fini sections. By default, this macro
+ uses a simple function call. Some ports need hand-crafted
+ assembly code to avoid dependencies on registers initialized in
+ the function prologue or to ensure that constant pools don't end
+ up too far way in the text section.
+
+ -- Macro: TARGET_LIBGCC_SDATA_SECTION
+ If defined, a string which names the section into which small
+ variables defined in crtstuff and libgcc should go. This is useful
+ when the target has options for optimizing access to small data,
+ and you want the crtstuff and libgcc routines to be conservative
+ in what they expect of your application yet liberal in what your
+ application expects. For example, for targets with a `.sdata'
+ section (like MIPS), you could compile crtstuff with `-G 0' so
+ that it doesn't require small data support from your application,
+ but use this macro to put small data into `.sdata' so that your
+ application can access these variables whether it uses small data
+ or not.
+
+ -- Macro: FORCE_CODE_SECTION_ALIGN
+ If defined, an ASM statement that aligns a code section to some
+ arbitrary boundary. This is used to force all fragments of the
+ `.init' and `.fini' sections to have to same alignment and thus
+ prevent the linker from having to add any padding.
+
+ -- Macro: JUMP_TABLES_IN_TEXT_SECTION
+ Define this macro to be an expression with a nonzero value if jump
+ tables (for `tablejump' insns) should be output in the text
+ section, along with the assembler instructions. Otherwise, the
+ readonly data section is used.
+
+ This macro is irrelevant if there is no separate readonly data
+ section.
+
+ -- Target Hook: void TARGET_ASM_INIT_SECTIONS (void)
+ Define this hook if you need to do something special to set up the
+ `varasm.c' sections, or if your target has some special sections
+ of its own that you need to create.
+
+ GCC calls this hook after processing the command line, but before
+ writing any assembly code, and before calling any of the
+ section-returning hooks described below.
+
+ -- Target Hook: TARGET_ASM_RELOC_RW_MASK (void)
+ Return a mask describing how relocations should be treated when
+ selecting sections. Bit 1 should be set if global relocations
+ should be placed in a read-write section; bit 0 should be set if
+ local relocations should be placed in a read-write section.
+
+ The default version of this function returns 3 when `-fpic' is in
+ effect, and 0 otherwise. The hook is typically redefined when the
+ target cannot support (some kinds of) dynamic relocations in
+ read-only sections even in executables.
+
+ -- Target Hook: section * TARGET_ASM_SELECT_SECTION (tree EXP, int
+ RELOC, unsigned HOST_WIDE_INT ALIGN)
+ Return the section into which EXP should be placed. You can
+ assume that EXP is either a `VAR_DECL' node or a constant of some
+ sort. RELOC indicates whether the initial value of EXP requires
+ link-time relocations. Bit 0 is set when variable contains local
+ relocations only, while bit 1 is set for global relocations.
+ ALIGN is the constant alignment in bits.
+
+ The default version of this function takes care of putting
+ read-only variables in `readonly_data_section'.
+
+ See also USE_SELECT_SECTION_FOR_FUNCTIONS.
+
+ -- Macro: USE_SELECT_SECTION_FOR_FUNCTIONS
+ Define this macro if you wish TARGET_ASM_SELECT_SECTION to be
+ called for `FUNCTION_DECL's as well as for variables and constants.
+
+ In the case of a `FUNCTION_DECL', RELOC will be zero if the
+ function has been determined to be likely to be called, and
+ nonzero if it is unlikely to be called.
+
+ -- Target Hook: void TARGET_ASM_UNIQUE_SECTION (tree DECL, int RELOC)
+ Build up a unique section name, expressed as a `STRING_CST' node,
+ and assign it to `DECL_SECTION_NAME (DECL)'. As with
+ `TARGET_ASM_SELECT_SECTION', RELOC indicates whether the initial
+ value of EXP requires link-time relocations.
+
+ The default version of this function appends the symbol name to the
+ ELF section name that would normally be used for the symbol. For
+ example, the function `foo' would be placed in `.text.foo'.
+ Whatever the actual target object format, this is often good
+ enough.
+
+ -- Target Hook: section * TARGET_ASM_FUNCTION_RODATA_SECTION (tree
+ DECL)
+ Return the readonly data section associated with
+ `DECL_SECTION_NAME (DECL)'. The default version of this function
+ selects `.gnu.linkonce.r.name' if the function's section is
+ `.gnu.linkonce.t.name', `.rodata.name' if function is in
+ `.text.name', and the normal readonly-data section otherwise.
+
+ -- Target Hook: section * TARGET_ASM_SELECT_RTX_SECTION (enum
+ machine_mode MODE, rtx X, unsigned HOST_WIDE_INT ALIGN)
+ Return the section into which a constant X, of mode MODE, should
+ be placed. You can assume that X is some kind of constant in RTL.
+ The argument MODE is redundant except in the case of a
+ `const_int' rtx. ALIGN is the constant alignment in bits.
+
+ The default version of this function takes care of putting symbolic
+ constants in `flag_pic' mode in `data_section' and everything else
+ in `readonly_data_section'.
+
+ -- Target Hook: void TARGET_MANGLE_DECL_ASSEMBLER_NAME (tree DECL,
+ tree ID)
+ Define this hook if you need to postprocess the assembler name
+ generated by target-independent code. The ID provided to this
+ hook will be the computed name (e.g., the macro `DECL_NAME' of the
+ DECL in C, or the mangled name of the DECL in C++). The return
+ value of the hook is an `IDENTIFIER_NODE' for the appropriate
+ mangled name on your target system. The default implementation of
+ this hook just returns the ID provided.
+
+ -- Target Hook: void TARGET_ENCODE_SECTION_INFO (tree DECL, rtx RTL,
+ int NEW_DECL_P)
+ Define this hook if references to a symbol or a constant must be
+ treated differently depending on something about the variable or
+ function named by the symbol (such as what section it is in).
+
+ The hook is executed immediately after rtl has been created for
+ DECL, which may be a variable or function declaration or an entry
+ in the constant pool. In either case, RTL is the rtl in question.
+ Do _not_ use `DECL_RTL (DECL)' in this hook; that field may not
+ have been initialized yet.
+
+ In the case of a constant, it is safe to assume that the rtl is a
+ `mem' whose address is a `symbol_ref'. Most decls will also have
+ this form, but that is not guaranteed. Global register variables,
+ for instance, will have a `reg' for their rtl. (Normally the
+ right thing to do with such unusual rtl is leave it alone.)
+
+ The NEW_DECL_P argument will be true if this is the first time
+ that `TARGET_ENCODE_SECTION_INFO' has been invoked on this decl.
+ It will be false for subsequent invocations, which will happen for
+ duplicate declarations. Whether or not anything must be done for
+ the duplicate declaration depends on whether the hook examines
+ `DECL_ATTRIBUTES'. NEW_DECL_P is always true when the hook is
+ called for a constant.
+
+ The usual thing for this hook to do is to record flags in the
+ `symbol_ref', using `SYMBOL_REF_FLAG' or `SYMBOL_REF_FLAGS'.
+ Historically, the name string was modified if it was necessary to
+ encode more than one bit of information, but this practice is now
+ discouraged; use `SYMBOL_REF_FLAGS'.
+
+ The default definition of this hook, `default_encode_section_info'
+ in `varasm.c', sets a number of commonly-useful bits in
+ `SYMBOL_REF_FLAGS'. Check whether the default does what you need
+ before overriding it.
+
+ -- Target Hook: const char *TARGET_STRIP_NAME_ENCODING (const char
+ *name)
+ Decode NAME and return the real name part, sans the characters
+ that `TARGET_ENCODE_SECTION_INFO' may have added.
+
+ -- Target Hook: bool TARGET_IN_SMALL_DATA_P (tree EXP)
+ Returns true if EXP should be placed into a "small data" section.
+ The default version of this hook always returns false.
+
+ -- Variable: Target Hook bool TARGET_HAVE_SRODATA_SECTION
+ Contains the value true if the target places read-only "small
+ data" into a separate section. The default value is false.
+
+ -- Target Hook: bool TARGET_BINDS_LOCAL_P (tree EXP)
+ Returns true if EXP names an object for which name resolution
+ rules must resolve to the current "module" (dynamic shared library
+ or executable image).
+
+ The default version of this hook implements the name resolution
+ rules for ELF, which has a looser model of global name binding
+ than other currently supported object file formats.
+
+ -- Variable: Target Hook bool TARGET_HAVE_TLS
+ Contains the value true if the target supports thread-local
+ storage. The default value is false.
+
+
+File: gccint.info, Node: PIC, Next: Assembler Format, Prev: Sections, Up: Target Macros
+
+17.20 Position Independent Code
+===============================
+
+This section describes macros that help implement generation of position
+independent code. Simply defining these macros is not enough to
+generate valid PIC; you must also add support to the macros
+`GO_IF_LEGITIMATE_ADDRESS' and `PRINT_OPERAND_ADDRESS', as well as
+`LEGITIMIZE_ADDRESS'. You must modify the definition of `movsi' to do
+something appropriate when the source operand contains a symbolic
+address. You may also need to alter the handling of switch statements
+so that they use relative addresses.
+
+ -- Macro: PIC_OFFSET_TABLE_REGNUM
+ The register number of the register used to address a table of
+ static data addresses in memory. In some cases this register is
+ defined by a processor's "application binary interface" (ABI).
+ When this macro is defined, RTL is generated for this register
+ once, as with the stack pointer and frame pointer registers. If
+ this macro is not defined, it is up to the machine-dependent files
+ to allocate such a register (if necessary). Note that this
+ register must be fixed when in use (e.g. when `flag_pic' is true).
+
+ -- Macro: PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
+ Define this macro if the register defined by
+ `PIC_OFFSET_TABLE_REGNUM' is clobbered by calls. Do not define
+ this macro if `PIC_OFFSET_TABLE_REGNUM' is not defined.
+
+ -- Macro: LEGITIMATE_PIC_OPERAND_P (X)
+ A C expression that is nonzero if X is a legitimate immediate
+ operand on the target machine when generating position independent
+ code. You can assume that X satisfies `CONSTANT_P', so you need
+ not check this. You can also assume FLAG_PIC is true, so you need
+ not check it either. You need not define this macro if all
+ constants (including `SYMBOL_REF') can be immediate operands when
+ generating position independent code.
+
+
+File: gccint.info, Node: Assembler Format, Next: Debugging Info, Prev: PIC, Up: Target Macros
+
+17.21 Defining the Output Assembler Language
+============================================
+
+This section describes macros whose principal purpose is to describe how
+to write instructions in assembler language--rather than what the
+instructions do.
+
+* Menu:
+
+* File Framework:: Structural information for the assembler file.
+* Data Output:: Output of constants (numbers, strings, addresses).
+* Uninitialized Data:: Output of uninitialized variables.
+* Label Output:: Output and generation of labels.
+* Initialization:: General principles of initialization
+ and termination routines.
+* Macros for Initialization::
+ Specific macros that control the handling of
+ initialization and termination routines.
+* Instruction Output:: Output of actual instructions.
+* Dispatch Tables:: Output of jump tables.
+* Exception Region Output:: Output of exception region code.
+* Alignment Output:: Pseudo ops for alignment and skipping data.
+
+
+File: gccint.info, Node: File Framework, Next: Data Output, Up: Assembler Format
+
+17.21.1 The Overall Framework of an Assembler File
+--------------------------------------------------
+
+This describes the overall framework of an assembly file.
+
+ -- Target Hook: void TARGET_ASM_FILE_START ()
+ Output to `asm_out_file' any text which the assembler expects to
+ find at the beginning of a file. The default behavior is
+ controlled by two flags, documented below. Unless your target's
+ assembler is quite unusual, if you override the default, you
+ should call `default_file_start' at some point in your target
+ hook. This lets other target files rely on these variables.
+
+ -- Target Hook: bool TARGET_ASM_FILE_START_APP_OFF
+ If this flag is true, the text of the macro `ASM_APP_OFF' will be
+ printed as the very first line in the assembly file, unless
+ `-fverbose-asm' is in effect. (If that macro has been defined to
+ the empty string, this variable has no effect.) With the normal
+ definition of `ASM_APP_OFF', the effect is to notify the GNU
+ assembler that it need not bother stripping comments or extra
+ whitespace from its input. This allows it to work a bit faster.
+
+ The default is false. You should not set it to true unless you
+ have verified that your port does not generate any extra
+ whitespace or comments that will cause GAS to issue errors in
+ NO_APP mode.
+
+ -- Target Hook: bool TARGET_ASM_FILE_START_FILE_DIRECTIVE
+ If this flag is true, `output_file_directive' will be called for
+ the primary source file, immediately after printing `ASM_APP_OFF'
+ (if that is enabled). Most ELF assemblers expect this to be done.
+ The default is false.
+
+ -- Target Hook: void TARGET_ASM_FILE_END ()
+ Output to `asm_out_file' any text which the assembler expects to
+ find at the end of a file. The default is to output nothing.
+
+ -- Function: void file_end_indicate_exec_stack ()
+ Some systems use a common convention, the `.note.GNU-stack'
+ special section, to indicate whether or not an object file relies
+ on the stack being executable. If your system uses this
+ convention, you should define `TARGET_ASM_FILE_END' to this
+ function. If you need to do other things in that hook, have your
+ hook function call this function.
+
+ -- Macro: ASM_COMMENT_START
+ A C string constant describing how to begin a comment in the target
+ assembler language. The compiler assumes that the comment will
+ end at the end of the line.
+
+ -- Macro: ASM_APP_ON
+ A C string constant for text to be output before each `asm'
+ statement or group of consecutive ones. Normally this is
+ `"#APP"', which is a comment that has no effect on most assemblers
+ but tells the GNU assembler that it must check the lines that
+ follow for all valid assembler constructs.
+
+ -- Macro: ASM_APP_OFF
+ A C string constant for text to be output after each `asm'
+ statement or group of consecutive ones. Normally this is
+ `"#NO_APP"', which tells the GNU assembler to resume making the
+ time-saving assumptions that are valid for ordinary compiler
+ output.
+
+ -- Macro: ASM_OUTPUT_SOURCE_FILENAME (STREAM, NAME)
+ A C statement to output COFF information or DWARF debugging
+ information which indicates that filename NAME is the current
+ source file to the stdio stream STREAM.
+
+ This macro need not be defined if the standard form of output for
+ the file format in use is appropriate.
+
+ -- Macro: OUTPUT_QUOTED_STRING (STREAM, STRING)
+ A C statement to output the string STRING to the stdio stream
+ STREAM. If you do not call the function `output_quoted_string' in
+ your config files, GCC will only call it to output filenames to
+ the assembler source. So you can use it to canonicalize the format
+ of the filename using this macro.
+
+ -- Macro: ASM_OUTPUT_IDENT (STREAM, STRING)
+ A C statement to output something to the assembler file to handle a
+ `#ident' directive containing the text STRING. If this macro is
+ not defined, nothing is output for a `#ident' directive.
+
+ -- Target Hook: void TARGET_ASM_NAMED_SECTION (const char *NAME,
+ unsigned int FLAGS, unsigned int ALIGN)
+ Output assembly directives to switch to section NAME. The section
+ should have attributes as specified by FLAGS, which is a bit mask
+ of the `SECTION_*' flags defined in `output.h'. If ALIGN is
+ nonzero, it contains an alignment in bytes to be used for the
+ section, otherwise some target default should be used. Only
+ targets that must specify an alignment within the section
+ directive need pay attention to ALIGN - we will still use
+ `ASM_OUTPUT_ALIGN'.
+
+ -- Target Hook: bool TARGET_HAVE_NAMED_SECTIONS
+ This flag is true if the target supports
+ `TARGET_ASM_NAMED_SECTION'.
+
+ -- Target Hook: bool TARGET_HAVE_SWITCHABLE_BSS_SECTIONS
+ This flag is true if we can create zeroed data by switching to a
+ BSS section and then using `ASM_OUTPUT_SKIP' to allocate the space.
+ This is true on most ELF targets.
+
+ -- Target Hook: unsigned int TARGET_SECTION_TYPE_FLAGS (tree DECL,
+ const char *NAME, int RELOC)
+ Choose a set of section attributes for use by
+ `TARGET_ASM_NAMED_SECTION' based on a variable or function decl, a
+ section name, and whether or not the declaration's initializer may
+ contain runtime relocations. DECL may be null, in which case
+ read-write data should be assumed.
+
+ The default version of this function handles choosing code vs data,
+ read-only vs read-write data, and `flag_pic'. You should only
+ need to override this if your target has special flags that might
+ be set via `__attribute__'.
+
+ -- Target Hook: int TARGET_ASM_RECORD_GCC_SWITCHES (print_switch_type
+ TYPE, const char * TEXT)
+ Provides the target with the ability to record the gcc command line
+ switches that have been passed to the compiler, and options that
+ are enabled. The TYPE argument specifies what is being recorded.
+ It can take the following values:
+
+ `SWITCH_TYPE_PASSED'
+ TEXT is a command line switch that has been set by the user.
+
+ `SWITCH_TYPE_ENABLED'
+ TEXT is an option which has been enabled. This might be as a
+ direct result of a command line switch, or because it is
+ enabled by default or because it has been enabled as a side
+ effect of a different command line switch. For example, the
+ `-O2' switch enables various different individual
+ optimization passes.
+
+ `SWITCH_TYPE_DESCRIPTIVE'
+ TEXT is either NULL or some descriptive text which should be
+ ignored. If TEXT is NULL then it is being used to warn the
+ target hook that either recording is starting or ending. The
+ first time TYPE is SWITCH_TYPE_DESCRIPTIVE and TEXT is NULL,
+ the warning is for start up and the second time the warning
+ is for wind down. This feature is to allow the target hook
+ to make any necessary preparations before it starts to record
+ switches and to perform any necessary tidying up after it has
+ finished recording switches.
+
+ `SWITCH_TYPE_LINE_START'
+ This option can be ignored by this target hook.
+
+ `SWITCH_TYPE_LINE_END'
+ This option can be ignored by this target hook.
+
+ The hook's return value must be zero. Other return values may be
+ supported in the future.
+
+ By default this hook is set to NULL, but an example implementation
+ is provided for ELF based targets. Called ELF_RECORD_GCC_SWITCHES,
+ it records the switches as ASCII text inside a new, string
+ mergeable section in the assembler output file. The name of the
+ new section is provided by the
+ `TARGET_ASM_RECORD_GCC_SWITCHES_SECTION' target hook.
+
+ -- Target Hook: const char * TARGET_ASM_RECORD_GCC_SWITCHES_SECTION
+ This is the name of the section that will be created by the example
+ ELF implementation of the `TARGET_ASM_RECORD_GCC_SWITCHES' target
+ hook.
+
+
+File: gccint.info, Node: Data Output, Next: Uninitialized Data, Prev: File Framework, Up: Assembler Format
+
+17.21.2 Output of Data
+----------------------
+
+ -- Target Hook: const char * TARGET_ASM_BYTE_OP
+ -- Target Hook: const char * TARGET_ASM_ALIGNED_HI_OP
+ -- Target Hook: const char * TARGET_ASM_ALIGNED_SI_OP
+ -- Target Hook: const char * TARGET_ASM_ALIGNED_DI_OP
+ -- Target Hook: const char * TARGET_ASM_ALIGNED_TI_OP
+ -- Target Hook: const char * TARGET_ASM_UNALIGNED_HI_OP
+ -- Target Hook: const char * TARGET_ASM_UNALIGNED_SI_OP
+ -- Target Hook: const char * TARGET_ASM_UNALIGNED_DI_OP
+ -- Target Hook: const char * TARGET_ASM_UNALIGNED_TI_OP
+ These hooks specify assembly directives for creating certain kinds
+ of integer object. The `TARGET_ASM_BYTE_OP' directive creates a
+ byte-sized object, the `TARGET_ASM_ALIGNED_HI_OP' one creates an
+ aligned two-byte object, and so on. Any of the hooks may be
+ `NULL', indicating that no suitable directive is available.
+
+ The compiler will print these strings at the start of a new line,
+ followed immediately by the object's initial value. In most cases,
+ the string should contain a tab, a pseudo-op, and then another tab.
+
+ -- Target Hook: bool TARGET_ASM_INTEGER (rtx X, unsigned int SIZE, int
+ ALIGNED_P)
+ The `assemble_integer' function uses this hook to output an
+ integer object. X is the object's value, SIZE is its size in
+ bytes and ALIGNED_P indicates whether it is aligned. The function
+ should return `true' if it was able to output the object. If it
+ returns false, `assemble_integer' will try to split the object
+ into smaller parts.
+
+ The default implementation of this hook will use the
+ `TARGET_ASM_BYTE_OP' family of strings, returning `false' when the
+ relevant string is `NULL'.
+
+ -- Macro: OUTPUT_ADDR_CONST_EXTRA (STREAM, X, FAIL)
+ A C statement to recognize RTX patterns that `output_addr_const'
+ can't deal with, and output assembly code to STREAM corresponding
+ to the pattern X. This may be used to allow machine-dependent
+ `UNSPEC's to appear within constants.
+
+ If `OUTPUT_ADDR_CONST_EXTRA' fails to recognize a pattern, it must
+ `goto fail', so that a standard error message is printed. If it
+ prints an error message itself, by calling, for example,
+ `output_operand_lossage', it may just complete normally.
+
+ -- Macro: ASM_OUTPUT_ASCII (STREAM, PTR, LEN)
+ A C statement to output to the stdio stream STREAM an assembler
+ instruction to assemble a string constant containing the LEN bytes
+ at PTR. PTR will be a C expression of type `char *' and LEN a C
+ expression of type `int'.
+
+ If the assembler has a `.ascii' pseudo-op as found in the Berkeley
+ Unix assembler, do not define the macro `ASM_OUTPUT_ASCII'.
+
+ -- Macro: ASM_OUTPUT_FDESC (STREAM, DECL, N)
+ A C statement to output word N of a function descriptor for DECL.
+ This must be defined if `TARGET_VTABLE_USES_DESCRIPTORS' is
+ defined, and is otherwise unused.
+
+ -- Macro: CONSTANT_POOL_BEFORE_FUNCTION
+ You may define this macro as a C expression. You should define the
+ expression to have a nonzero value if GCC should output the
+ constant pool for a function before the code for the function, or
+ a zero value if GCC should output the constant pool after the
+ function. If you do not define this macro, the usual case, GCC
+ will output the constant pool before the function.
+
+ -- Macro: ASM_OUTPUT_POOL_PROLOGUE (FILE, FUNNAME, FUNDECL, SIZE)
+ A C statement to output assembler commands to define the start of
+ the constant pool for a function. FUNNAME is a string giving the
+ name of the function. Should the return type of the function be
+ required, it can be obtained via FUNDECL. SIZE is the size, in
+ bytes, of the constant pool that will be written immediately after
+ this call.
+
+ If no constant-pool prefix is required, the usual case, this macro
+ need not be defined.
+
+ -- Macro: ASM_OUTPUT_SPECIAL_POOL_ENTRY (FILE, X, MODE, ALIGN,
+ LABELNO, JUMPTO)
+ A C statement (with or without semicolon) to output a constant in
+ the constant pool, if it needs special treatment. (This macro
+ need not do anything for RTL expressions that can be output
+ normally.)
+
+ The argument FILE is the standard I/O stream to output the
+ assembler code on. X is the RTL expression for the constant to
+ output, and MODE is the machine mode (in case X is a `const_int').
+ ALIGN is the required alignment for the value X; you should
+ output an assembler directive to force this much alignment.
+
+ The argument LABELNO is a number to use in an internal label for
+ the address of this pool entry. The definition of this macro is
+ responsible for outputting the label definition at the proper
+ place. Here is how to do this:
+
+ `(*targetm.asm_out.internal_label)' (FILE, "LC", LABELNO);
+
+ When you output a pool entry specially, you should end with a
+ `goto' to the label JUMPTO. This will prevent the same pool entry
+ from being output a second time in the usual manner.
+
+ You need not define this macro if it would do nothing.
+
+ -- Macro: ASM_OUTPUT_POOL_EPILOGUE (FILE FUNNAME FUNDECL SIZE)
+ A C statement to output assembler commands to at the end of the
+ constant pool for a function. FUNNAME is a string giving the name
+ of the function. Should the return type of the function be
+ required, you can obtain it via FUNDECL. SIZE is the size, in
+ bytes, of the constant pool that GCC wrote immediately before this
+ call.
+
+ If no constant-pool epilogue is required, the usual case, you need
+ not define this macro.
+
+ -- Macro: IS_ASM_LOGICAL_LINE_SEPARATOR (C, STR)
+ Define this macro as a C expression which is nonzero if C is used
+ as a logical line separator by the assembler. STR points to the
+ position in the string where C was found; this can be used if a
+ line separator uses multiple characters.
+
+ If you do not define this macro, the default is that only the
+ character `;' is treated as a logical line separator.
+
+ -- Target Hook: const char * TARGET_ASM_OPEN_PAREN
+ -- Target Hook: const char * TARGET_ASM_CLOSE_PAREN
+ These target hooks are C string constants, describing the syntax
+ in the assembler for grouping arithmetic expressions. If not
+ overridden, they default to normal parentheses, which is correct
+ for most assemblers.
+
+ These macros are provided by `real.h' for writing the definitions of
+`ASM_OUTPUT_DOUBLE' and the like:
+
+ -- Macro: REAL_VALUE_TO_TARGET_SINGLE (X, L)
+ -- Macro: REAL_VALUE_TO_TARGET_DOUBLE (X, L)
+ -- Macro: REAL_VALUE_TO_TARGET_LONG_DOUBLE (X, L)
+ -- Macro: REAL_VALUE_TO_TARGET_DECIMAL32 (X, L)
+ -- Macro: REAL_VALUE_TO_TARGET_DECIMAL64 (X, L)
+ -- Macro: REAL_VALUE_TO_TARGET_DECIMAL128 (X, L)
+ These translate X, of type `REAL_VALUE_TYPE', to the target's
+ floating point representation, and store its bit pattern in the
+ variable L. For `REAL_VALUE_TO_TARGET_SINGLE' and
+ `REAL_VALUE_TO_TARGET_DECIMAL32', this variable should be a simple
+ `long int'. For the others, it should be an array of `long int'.
+ The number of elements in this array is determined by the size of
+ the desired target floating point data type: 32 bits of it go in
+ each `long int' array element. Each array element holds 32 bits
+ of the result, even if `long int' is wider than 32 bits on the
+ host machine.
+
+ The array element values are designed so that you can print them
+ out using `fprintf' in the order they should appear in the target
+ machine's memory.
+
+
+File: gccint.info, Node: Uninitialized Data, Next: Label Output, Prev: Data Output, Up: Assembler Format
+
+17.21.3 Output of Uninitialized Variables
+-----------------------------------------
+
+Each of the macros in this section is used to do the whole job of
+outputting a single uninitialized variable.
+
+ -- Macro: ASM_OUTPUT_COMMON (STREAM, NAME, SIZE, ROUNDED)
+ A C statement (sans semicolon) to output to the stdio stream
+ STREAM the assembler definition of a common-label named NAME whose
+ size is SIZE bytes. The variable ROUNDED is the size rounded up
+ to whatever alignment the caller wants.
+
+ Use the expression `assemble_name (STREAM, NAME)' to output the
+ name itself; before and after that, output the additional
+ assembler syntax for defining the name, and a newline.
+
+ This macro controls how the assembler definitions of uninitialized
+ common global variables are output.
+
+ -- Macro: ASM_OUTPUT_ALIGNED_COMMON (STREAM, NAME, SIZE, ALIGNMENT)
+ Like `ASM_OUTPUT_COMMON' except takes the required alignment as a
+ separate, explicit argument. If you define this macro, it is used
+ in place of `ASM_OUTPUT_COMMON', and gives you more flexibility in
+ handling the required alignment of the variable. The alignment is
+ specified as the number of bits.
+
+ -- Macro: ASM_OUTPUT_ALIGNED_DECL_COMMON (STREAM, DECL, NAME, SIZE,
+ ALIGNMENT)
+ Like `ASM_OUTPUT_ALIGNED_COMMON' except that DECL of the variable
+ to be output, if there is one, or `NULL_TREE' if there is no
+ corresponding variable. If you define this macro, GCC will use it
+ in place of both `ASM_OUTPUT_COMMON' and
+ `ASM_OUTPUT_ALIGNED_COMMON'. Define this macro when you need to
+ see the variable's decl in order to chose what to output.
+
+ -- Macro: ASM_OUTPUT_BSS (STREAM, DECL, NAME, SIZE, ROUNDED)
+ A C statement (sans semicolon) to output to the stdio stream
+ STREAM the assembler definition of uninitialized global DECL named
+ NAME whose size is SIZE bytes. The variable ROUNDED is the size
+ rounded up to whatever alignment the caller wants.
+
+ Try to use function `asm_output_bss' defined in `varasm.c' when
+ defining this macro. If unable, use the expression `assemble_name
+ (STREAM, NAME)' to output the name itself; before and after that,
+ output the additional assembler syntax for defining the name, and
+ a newline.
+
+ There are two ways of handling global BSS. One is to define either
+ this macro or its aligned counterpart, `ASM_OUTPUT_ALIGNED_BSS'.
+ The other is to have `TARGET_ASM_SELECT_SECTION' return a
+ switchable BSS section (*note
+ TARGET_HAVE_SWITCHABLE_BSS_SECTIONS::). You do not need to do
+ both.
+
+ Some languages do not have `common' data, and require a non-common
+ form of global BSS in order to handle uninitialized globals
+ efficiently. C++ is one example of this. However, if the target
+ does not support global BSS, the front end may choose to make
+ globals common in order to save space in the object file.
+
+ -- Macro: ASM_OUTPUT_ALIGNED_BSS (STREAM, DECL, NAME, SIZE, ALIGNMENT)
+ Like `ASM_OUTPUT_BSS' except takes the required alignment as a
+ separate, explicit argument. If you define this macro, it is used
+ in place of `ASM_OUTPUT_BSS', and gives you more flexibility in
+ handling the required alignment of the variable. The alignment is
+ specified as the number of bits.
+
+ Try to use function `asm_output_aligned_bss' defined in file
+ `varasm.c' when defining this macro.
+
+ -- Macro: ASM_OUTPUT_LOCAL (STREAM, NAME, SIZE, ROUNDED)
+ A C statement (sans semicolon) to output to the stdio stream
+ STREAM the assembler definition of a local-common-label named NAME
+ whose size is SIZE bytes. The variable ROUNDED is the size
+ rounded up to whatever alignment the caller wants.
+
+ Use the expression `assemble_name (STREAM, NAME)' to output the
+ name itself; before and after that, output the additional
+ assembler syntax for defining the name, and a newline.
+
+ This macro controls how the assembler definitions of uninitialized
+ static variables are output.
+
+ -- Macro: ASM_OUTPUT_ALIGNED_LOCAL (STREAM, NAME, SIZE, ALIGNMENT)
+ Like `ASM_OUTPUT_LOCAL' except takes the required alignment as a
+ separate, explicit argument. If you define this macro, it is used
+ in place of `ASM_OUTPUT_LOCAL', and gives you more flexibility in
+ handling the required alignment of the variable. The alignment is
+ specified as the number of bits.
+
+ -- Macro: ASM_OUTPUT_ALIGNED_DECL_LOCAL (STREAM, DECL, NAME, SIZE,
+ ALIGNMENT)
+ Like `ASM_OUTPUT_ALIGNED_DECL' except that DECL of the variable to
+ be output, if there is one, or `NULL_TREE' if there is no
+ corresponding variable. If you define this macro, GCC will use it
+ in place of both `ASM_OUTPUT_DECL' and `ASM_OUTPUT_ALIGNED_DECL'.
+ Define this macro when you need to see the variable's decl in
+ order to chose what to output.
+
+
+File: gccint.info, Node: Label Output, Next: Initialization, Prev: Uninitialized Data, Up: Assembler Format
+
+17.21.4 Output and Generation of Labels
+---------------------------------------
+
+This is about outputting labels.
+
+ -- Macro: ASM_OUTPUT_LABEL (STREAM, NAME)
+ A C statement (sans semicolon) to output to the stdio stream
+ STREAM the assembler definition of a label named NAME. Use the
+ expression `assemble_name (STREAM, NAME)' to output the name
+ itself; before and after that, output the additional assembler
+ syntax for defining the name, and a newline. A default definition
+ of this macro is provided which is correct for most systems.
+
+ -- Macro: ASM_OUTPUT_INTERNAL_LABEL (STREAM, NAME)
+ Identical to `ASM_OUTPUT_LABEL', except that NAME is known to
+ refer to a compiler-generated label. The default definition uses
+ `assemble_name_raw', which is like `assemble_name' except that it
+ is more efficient.
+
+ -- Macro: SIZE_ASM_OP
+ A C string containing the appropriate assembler directive to
+ specify the size of a symbol, without any arguments. On systems
+ that use ELF, the default (in `config/elfos.h') is `"\t.size\t"';
+ on other systems, the default is not to define this macro.
+
+ Define this macro only if it is correct to use the default
+ definitions of `ASM_OUTPUT_SIZE_DIRECTIVE' and
+ `ASM_OUTPUT_MEASURED_SIZE' for your system. If you need your own
+ custom definitions of those macros, or if you do not need explicit
+ symbol sizes at all, do not define this macro.
+
+ -- Macro: ASM_OUTPUT_SIZE_DIRECTIVE (STREAM, NAME, SIZE)
+ A C statement (sans semicolon) to output to the stdio stream
+ STREAM a directive telling the assembler that the size of the
+ symbol NAME is SIZE. SIZE is a `HOST_WIDE_INT'. If you define
+ `SIZE_ASM_OP', a default definition of this macro is provided.
+
+ -- Macro: ASM_OUTPUT_MEASURED_SIZE (STREAM, NAME)
+ A C statement (sans semicolon) to output to the stdio stream
+ STREAM a directive telling the assembler to calculate the size of
+ the symbol NAME by subtracting its address from the current
+ address.
+
+ If you define `SIZE_ASM_OP', a default definition of this macro is
+ provided. The default assumes that the assembler recognizes a
+ special `.' symbol as referring to the current address, and can
+ calculate the difference between this and another symbol. If your
+ assembler does not recognize `.' or cannot do calculations with
+ it, you will need to redefine `ASM_OUTPUT_MEASURED_SIZE' to use
+ some other technique.
+
+ -- Macro: TYPE_ASM_OP
+ A C string containing the appropriate assembler directive to
+ specify the type of a symbol, without any arguments. On systems
+ that use ELF, the default (in `config/elfos.h') is `"\t.type\t"';
+ on other systems, the default is not to define this macro.
+
+ Define this macro only if it is correct to use the default
+ definition of `ASM_OUTPUT_TYPE_DIRECTIVE' for your system. If you
+ need your own custom definition of this macro, or if you do not
+ need explicit symbol types at all, do not define this macro.
+
+ -- Macro: TYPE_OPERAND_FMT
+ A C string which specifies (using `printf' syntax) the format of
+ the second operand to `TYPE_ASM_OP'. On systems that use ELF, the
+ default (in `config/elfos.h') is `"@%s"'; on other systems, the
+ default is not to define this macro.
+
+ Define this macro only if it is correct to use the default
+ definition of `ASM_OUTPUT_TYPE_DIRECTIVE' for your system. If you
+ need your own custom definition of this macro, or if you do not
+ need explicit symbol types at all, do not define this macro.
+
+ -- Macro: ASM_OUTPUT_TYPE_DIRECTIVE (STREAM, TYPE)
+ A C statement (sans semicolon) to output to the stdio stream
+ STREAM a directive telling the assembler that the type of the
+ symbol NAME is TYPE. TYPE is a C string; currently, that string
+ is always either `"function"' or `"object"', but you should not
+ count on this.
+
+ If you define `TYPE_ASM_OP' and `TYPE_OPERAND_FMT', a default
+ definition of this macro is provided.
+
+ -- Macro: ASM_DECLARE_FUNCTION_NAME (STREAM, NAME, DECL)
+ A C statement (sans semicolon) to output to the stdio stream
+ STREAM any text necessary for declaring the name NAME of a
+ function which is being defined. This macro is responsible for
+ outputting the label definition (perhaps using
+ `ASM_OUTPUT_LABEL'). The argument DECL is the `FUNCTION_DECL'
+ tree node representing the function.
+
+ If this macro is not defined, then the function name is defined in
+ the usual manner as a label (by means of `ASM_OUTPUT_LABEL').
+
+ You may wish to use `ASM_OUTPUT_TYPE_DIRECTIVE' in the definition
+ of this macro.
+
+ -- Macro: ASM_DECLARE_FUNCTION_SIZE (STREAM, NAME, DECL)
+ A C statement (sans semicolon) to output to the stdio stream
+ STREAM any text necessary for declaring the size of a function
+ which is being defined. The argument NAME is the name of the
+ function. The argument DECL is the `FUNCTION_DECL' tree node
+ representing the function.
+
+ If this macro is not defined, then the function size is not
+ defined.
+
+ You may wish to use `ASM_OUTPUT_MEASURED_SIZE' in the definition
+ of this macro.
+
+ -- Macro: ASM_DECLARE_OBJECT_NAME (STREAM, NAME, DECL)
+ A C statement (sans semicolon) to output to the stdio stream
+ STREAM any text necessary for declaring the name NAME of an
+ initialized variable which is being defined. This macro must
+ output the label definition (perhaps using `ASM_OUTPUT_LABEL').
+ The argument DECL is the `VAR_DECL' tree node representing the
+ variable.
+
+ If this macro is not defined, then the variable name is defined in
+ the usual manner as a label (by means of `ASM_OUTPUT_LABEL').
+
+ You may wish to use `ASM_OUTPUT_TYPE_DIRECTIVE' and/or
+ `ASM_OUTPUT_SIZE_DIRECTIVE' in the definition of this macro.
+
+ -- Macro: ASM_DECLARE_CONSTANT_NAME (STREAM, NAME, EXP, SIZE)
+ A C statement (sans semicolon) to output to the stdio stream
+ STREAM any text necessary for declaring the name NAME of a
+ constant which is being defined. This macro is responsible for
+ outputting the label definition (perhaps using
+ `ASM_OUTPUT_LABEL'). The argument EXP is the value of the
+ constant, and SIZE is the size of the constant in bytes. NAME
+ will be an internal label.
+
+ If this macro is not defined, then the NAME is defined in the
+ usual manner as a label (by means of `ASM_OUTPUT_LABEL').
+
+ You may wish to use `ASM_OUTPUT_TYPE_DIRECTIVE' in the definition
+ of this macro.
+
+ -- Macro: ASM_DECLARE_REGISTER_GLOBAL (STREAM, DECL, REGNO, NAME)
+ A C statement (sans semicolon) to output to the stdio stream
+ STREAM any text necessary for claiming a register REGNO for a
+ global variable DECL with name NAME.
+
+ If you don't define this macro, that is equivalent to defining it
+ to do nothing.
+
+ -- Macro: ASM_FINISH_DECLARE_OBJECT (STREAM, DECL, TOPLEVEL, ATEND)
+ A C statement (sans semicolon) to finish up declaring a variable
+ name once the compiler has processed its initializer fully and
+ thus has had a chance to determine the size of an array when
+ controlled by an initializer. This is used on systems where it's
+ necessary to declare something about the size of the object.
+
+ If you don't define this macro, that is equivalent to defining it
+ to do nothing.
+
+ You may wish to use `ASM_OUTPUT_SIZE_DIRECTIVE' and/or
+ `ASM_OUTPUT_MEASURED_SIZE' in the definition of this macro.
+
+ -- Target Hook: void TARGET_ASM_GLOBALIZE_LABEL (FILE *STREAM, const
+ char *NAME)
+ This target hook is a function to output to the stdio stream
+ STREAM some commands that will make the label NAME global; that
+ is, available for reference from other files.
+
+ The default implementation relies on a proper definition of
+ `GLOBAL_ASM_OP'.
+
+ -- Target Hook: void TARGET_ASM_GLOBALIZE_DECL_NAME (FILE *STREAM,
+ tree DECL)
+ This target hook is a function to output to the stdio stream
+ STREAM some commands that will make the name associated with DECL
+ global; that is, available for reference from other files.
+
+ The default implementation uses the TARGET_ASM_GLOBALIZE_LABEL
+ target hook.
+
+ -- Macro: ASM_WEAKEN_LABEL (STREAM, NAME)
+ A C statement (sans semicolon) to output to the stdio stream
+ STREAM some commands that will make the label NAME weak; that is,
+ available for reference from other files but only used if no other
+ definition is available. Use the expression `assemble_name
+ (STREAM, NAME)' to output the name itself; before and after that,
+ output the additional assembler syntax for making that name weak,
+ and a newline.
+
+ If you don't define this macro or `ASM_WEAKEN_DECL', GCC will not
+ support weak symbols and you should not define the `SUPPORTS_WEAK'
+ macro.
+
+ -- Macro: ASM_WEAKEN_DECL (STREAM, DECL, NAME, VALUE)
+ Combines (and replaces) the function of `ASM_WEAKEN_LABEL' and
+ `ASM_OUTPUT_WEAK_ALIAS', allowing access to the associated function
+ or variable decl. If VALUE is not `NULL', this C statement should
+ output to the stdio stream STREAM assembler code which defines
+ (equates) the weak symbol NAME to have the value VALUE. If VALUE
+ is `NULL', it should output commands to make NAME weak.
+
+ -- Macro: ASM_OUTPUT_WEAKREF (STREAM, DECL, NAME, VALUE)
+ Outputs a directive that enables NAME to be used to refer to
+ symbol VALUE with weak-symbol semantics. `decl' is the
+ declaration of `name'.
+
+ -- Macro: SUPPORTS_WEAK
+ A C expression which evaluates to true if the target supports weak
+ symbols.
+
+ If you don't define this macro, `defaults.h' provides a default
+ definition. If either `ASM_WEAKEN_LABEL' or `ASM_WEAKEN_DECL' is
+ defined, the default definition is `1'; otherwise, it is `0'.
+ Define this macro if you want to control weak symbol support with
+ a compiler flag such as `-melf'.
+
+ -- Macro: MAKE_DECL_ONE_ONLY (DECL)
+ A C statement (sans semicolon) to mark DECL to be emitted as a
+ public symbol such that extra copies in multiple translation units
+ will be discarded by the linker. Define this macro if your object
+ file format provides support for this concept, such as the `COMDAT'
+ section flags in the Microsoft Windows PE/COFF format, and this
+ support requires changes to DECL, such as putting it in a separate
+ section.
+
+ -- Macro: SUPPORTS_ONE_ONLY
+ A C expression which evaluates to true if the target supports
+ one-only semantics.
+
+ If you don't define this macro, `varasm.c' provides a default
+ definition. If `MAKE_DECL_ONE_ONLY' is defined, the default
+ definition is `1'; otherwise, it is `0'. Define this macro if you
+ want to control one-only symbol support with a compiler flag, or if
+ setting the `DECL_ONE_ONLY' flag is enough to mark a declaration to
+ be emitted as one-only.
+
+ -- Target Hook: void TARGET_ASM_ASSEMBLE_VISIBILITY (tree DECL, const
+ char *VISIBILITY)
+ This target hook is a function to output to ASM_OUT_FILE some
+ commands that will make the symbol(s) associated with DECL have
+ hidden, protected or internal visibility as specified by
+ VISIBILITY.
+
+ -- Macro: TARGET_WEAK_NOT_IN_ARCHIVE_TOC
+ A C expression that evaluates to true if the target's linker
+ expects that weak symbols do not appear in a static archive's
+ table of contents. The default is `0'.
+
+ Leaving weak symbols out of an archive's table of contents means
+ that, if a symbol will only have a definition in one translation
+ unit and will have undefined references from other translation
+ units, that symbol should not be weak. Defining this macro to be
+ nonzero will thus have the effect that certain symbols that would
+ normally be weak (explicit template instantiations, and vtables
+ for polymorphic classes with noninline key methods) will instead
+ be nonweak.
+
+ The C++ ABI requires this macro to be zero. Define this macro for
+ targets where full C++ ABI compliance is impossible and where
+ linker restrictions require weak symbols to be left out of a
+ static archive's table of contents.
+
+ -- Macro: ASM_OUTPUT_EXTERNAL (STREAM, DECL, NAME)
+ A C statement (sans semicolon) to output to the stdio stream
+ STREAM any text necessary for declaring the name of an external
+ symbol named NAME which is referenced in this compilation but not
+ defined. The value of DECL is the tree node for the declaration.
+
+ This macro need not be defined if it does not need to output
+ anything. The GNU assembler and most Unix assemblers don't
+ require anything.
+
+ -- Target Hook: void TARGET_ASM_EXTERNAL_LIBCALL (rtx SYMREF)
+ This target hook is a function to output to ASM_OUT_FILE an
+ assembler pseudo-op to declare a library function name external.
+ The name of the library function is given by SYMREF, which is a
+ `symbol_ref'.
+
+ -- Target Hook: void TARGET_ASM_MARK_DECL_PRESERVED (tree DECL)
+ This target hook is a function to output to ASM_OUT_FILE an
+ assembler directive to annotate used symbol. Darwin target use
+ .no_dead_code_strip directive.
+
+ -- Macro: ASM_OUTPUT_LABELREF (STREAM, NAME)
+ A C statement (sans semicolon) to output to the stdio stream
+ STREAM a reference in assembler syntax to a label named NAME.
+ This should add `_' to the front of the name, if that is customary
+ on your operating system, as it is in most Berkeley Unix systems.
+ This macro is used in `assemble_name'.
+
+ -- Macro: ASM_OUTPUT_SYMBOL_REF (STREAM, SYM)
+ A C statement (sans semicolon) to output a reference to
+ `SYMBOL_REF' SYM. If not defined, `assemble_name' will be used to
+ output the name of the symbol. This macro may be used to modify
+ the way a symbol is referenced depending on information encoded by
+ `TARGET_ENCODE_SECTION_INFO'.
+
+ -- Macro: ASM_OUTPUT_LABEL_REF (STREAM, BUF)
+ A C statement (sans semicolon) to output a reference to BUF, the
+ result of `ASM_GENERATE_INTERNAL_LABEL'. If not defined,
+ `assemble_name' will be used to output the name of the symbol.
+ This macro is not used by `output_asm_label', or the `%l'
+ specifier that calls it; the intention is that this macro should
+ be set when it is necessary to output a label differently when its
+ address is being taken.
+
+ -- Target Hook: void TARGET_ASM_INTERNAL_LABEL (FILE *STREAM, const
+ char *PREFIX, unsigned long LABELNO)
+ A function to output to the stdio stream STREAM a label whose name
+ is made from the string PREFIX and the number LABELNO.
+
+ It is absolutely essential that these labels be distinct from the
+ labels used for user-level functions and variables. Otherwise,
+ certain programs will have name conflicts with internal labels.
+
+ It is desirable to exclude internal labels from the symbol table
+ of the object file. Most assemblers have a naming convention for
+ labels that should be excluded; on many systems, the letter `L' at
+ the beginning of a label has this effect. You should find out what
+ convention your system uses, and follow it.
+
+ The default version of this function utilizes
+ `ASM_GENERATE_INTERNAL_LABEL'.
+
+ -- Macro: ASM_OUTPUT_DEBUG_LABEL (STREAM, PREFIX, NUM)
+ A C statement to output to the stdio stream STREAM a debug info
+ label whose name is made from the string PREFIX and the number
+ NUM. This is useful for VLIW targets, where debug info labels may
+ need to be treated differently than branch target labels. On some
+ systems, branch target labels must be at the beginning of
+ instruction bundles, but debug info labels can occur in the middle
+ of instruction bundles.
+
+ If this macro is not defined, then
+ `(*targetm.asm_out.internal_label)' will be used.
+
+ -- Macro: ASM_GENERATE_INTERNAL_LABEL (STRING, PREFIX, NUM)
+ A C statement to store into the string STRING a label whose name
+ is made from the string PREFIX and the number NUM.
+
+ This string, when output subsequently by `assemble_name', should
+ produce the output that `(*targetm.asm_out.internal_label)' would
+ produce with the same PREFIX and NUM.
+
+ If the string begins with `*', then `assemble_name' will output
+ the rest of the string unchanged. It is often convenient for
+ `ASM_GENERATE_INTERNAL_LABEL' to use `*' in this way. If the
+ string doesn't start with `*', then `ASM_OUTPUT_LABELREF' gets to
+ output the string, and may change it. (Of course,
+ `ASM_OUTPUT_LABELREF' is also part of your machine description, so
+ you should know what it does on your machine.)
+
+ -- Macro: ASM_FORMAT_PRIVATE_NAME (OUTVAR, NAME, NUMBER)
+ A C expression to assign to OUTVAR (which is a variable of type
+ `char *') a newly allocated string made from the string NAME and
+ the number NUMBER, with some suitable punctuation added. Use
+ `alloca' to get space for the string.
+
+ The string will be used as an argument to `ASM_OUTPUT_LABELREF' to
+ produce an assembler label for an internal static variable whose
+ name is NAME. Therefore, the string must be such as to result in
+ valid assembler code. The argument NUMBER is different each time
+ this macro is executed; it prevents conflicts between
+ similarly-named internal static variables in different scopes.
+
+ Ideally this string should not be a valid C identifier, to prevent
+ any conflict with the user's own symbols. Most assemblers allow
+ periods or percent signs in assembler symbols; putting at least
+ one of these between the name and the number will suffice.
+
+ If this macro is not defined, a default definition will be provided
+ which is correct for most systems.
+
+ -- Macro: ASM_OUTPUT_DEF (STREAM, NAME, VALUE)
+ A C statement to output to the stdio stream STREAM assembler code
+ which defines (equates) the symbol NAME to have the value VALUE.
+
+ If `SET_ASM_OP' is defined, a default definition is provided which
+ is correct for most systems.
+
+ -- Macro: ASM_OUTPUT_DEF_FROM_DECLS (STREAM, DECL_OF_NAME,
+ DECL_OF_VALUE)
+ A C statement to output to the stdio stream STREAM assembler code
+ which defines (equates) the symbol whose tree node is DECL_OF_NAME
+ to have the value of the tree node DECL_OF_VALUE. This macro will
+ be used in preference to `ASM_OUTPUT_DEF' if it is defined and if
+ the tree nodes are available.
+
+ If `SET_ASM_OP' is defined, a default definition is provided which
+ is correct for most systems.
+
+ -- Macro: TARGET_DEFERRED_OUTPUT_DEFS (DECL_OF_NAME, DECL_OF_VALUE)
+ A C statement that evaluates to true if the assembler code which
+ defines (equates) the symbol whose tree node is DECL_OF_NAME to
+ have the value of the tree node DECL_OF_VALUE should be emitted
+ near the end of the current compilation unit. The default is to
+ not defer output of defines. This macro affects defines output by
+ `ASM_OUTPUT_DEF' and `ASM_OUTPUT_DEF_FROM_DECLS'.
+
+ -- Macro: ASM_OUTPUT_WEAK_ALIAS (STREAM, NAME, VALUE)
+ A C statement to output to the stdio stream STREAM assembler code
+ which defines (equates) the weak symbol NAME to have the value
+ VALUE. If VALUE is `NULL', it defines NAME as an undefined weak
+ symbol.
+
+ Define this macro if the target only supports weak aliases; define
+ `ASM_OUTPUT_DEF' instead if possible.
+
+ -- Macro: OBJC_GEN_METHOD_LABEL (BUF, IS_INST, CLASS_NAME, CAT_NAME,
+ SEL_NAME)
+ Define this macro to override the default assembler names used for
+ Objective-C methods.
+
+ The default name is a unique method number followed by the name of
+ the class (e.g. `_1_Foo'). For methods in categories, the name of
+ the category is also included in the assembler name (e.g.
+ `_1_Foo_Bar').
+
+ These names are safe on most systems, but make debugging difficult
+ since the method's selector is not present in the name.
+ Therefore, particular systems define other ways of computing names.
+
+ BUF is an expression of type `char *' which gives you a buffer in
+ which to store the name; its length is as long as CLASS_NAME,
+ CAT_NAME and SEL_NAME put together, plus 50 characters extra.
+
+ The argument IS_INST specifies whether the method is an instance
+ method or a class method; CLASS_NAME is the name of the class;
+ CAT_NAME is the name of the category (or `NULL' if the method is
+ not in a category); and SEL_NAME is the name of the selector.
+
+ On systems where the assembler can handle quoted names, you can
+ use this macro to provide more human-readable names.
+
+ -- Macro: ASM_DECLARE_CLASS_REFERENCE (STREAM, NAME)
+ A C statement (sans semicolon) to output to the stdio stream
+ STREAM commands to declare that the label NAME is an Objective-C
+ class reference. This is only needed for targets whose linkers
+ have special support for NeXT-style runtimes.
+
+ -- Macro: ASM_DECLARE_UNRESOLVED_REFERENCE (STREAM, NAME)
+ A C statement (sans semicolon) to output to the stdio stream
+ STREAM commands to declare that the label NAME is an unresolved
+ Objective-C class reference. This is only needed for targets
+ whose linkers have special support for NeXT-style runtimes.
+
+
+File: gccint.info, Node: Initialization, Next: Macros for Initialization, Prev: Label Output, Up: Assembler Format
+
+17.21.5 How Initialization Functions Are Handled
+------------------------------------------------
+
+The compiled code for certain languages includes "constructors" (also
+called "initialization routines")--functions to initialize data in the
+program when the program is started. These functions need to be called
+before the program is "started"--that is to say, before `main' is
+called.
+
+ Compiling some languages generates "destructors" (also called
+"termination routines") that should be called when the program
+terminates.
+
+ To make the initialization and termination functions work, the compiler
+must output something in the assembler code to cause those functions to
+be called at the appropriate time. When you port the compiler to a new
+system, you need to specify how to do this.
+
+ There are two major ways that GCC currently supports the execution of
+initialization and termination functions. Each way has two variants.
+Much of the structure is common to all four variations.
+
+ The linker must build two lists of these functions--a list of
+initialization functions, called `__CTOR_LIST__', and a list of
+termination functions, called `__DTOR_LIST__'.
+
+ Each list always begins with an ignored function pointer (which may
+hold 0, -1, or a count of the function pointers after it, depending on
+the environment). This is followed by a series of zero or more function
+pointers to constructors (or destructors), followed by a function
+pointer containing zero.
+
+ Depending on the operating system and its executable file format,
+either `crtstuff.c' or `libgcc2.c' traverses these lists at startup
+time and exit time. Constructors are called in reverse order of the
+list; destructors in forward order.
+
+ The best way to handle static constructors works only for object file
+formats which provide arbitrarily-named sections. A section is set
+aside for a list of constructors, and another for a list of destructors.
+Traditionally these are called `.ctors' and `.dtors'. Each object file
+that defines an initialization function also puts a word in the
+constructor section to point to that function. The linker accumulates
+all these words into one contiguous `.ctors' section. Termination
+functions are handled similarly.
+
+ This method will be chosen as the default by `target-def.h' if
+`TARGET_ASM_NAMED_SECTION' is defined. A target that does not support
+arbitrary sections, but does support special designated constructor and
+destructor sections may define `CTORS_SECTION_ASM_OP' and
+`DTORS_SECTION_ASM_OP' to achieve the same effect.
+
+ When arbitrary sections are available, there are two variants,
+depending upon how the code in `crtstuff.c' is called. On systems that
+support a ".init" section which is executed at program startup, parts
+of `crtstuff.c' are compiled into that section. The program is linked
+by the `gcc' driver like this:
+
+ ld -o OUTPUT_FILE crti.o crtbegin.o ... -lgcc crtend.o crtn.o
+
+ The prologue of a function (`__init') appears in the `.init' section
+of `crti.o'; the epilogue appears in `crtn.o'. Likewise for the
+function `__fini' in the ".fini" section. Normally these files are
+provided by the operating system or by the GNU C library, but are
+provided by GCC for a few targets.
+
+ The objects `crtbegin.o' and `crtend.o' are (for most targets)
+compiled from `crtstuff.c'. They contain, among other things, code
+fragments within the `.init' and `.fini' sections that branch to
+routines in the `.text' section. The linker will pull all parts of a
+section together, which results in a complete `__init' function that
+invokes the routines we need at startup.
+
+ To use this variant, you must define the `INIT_SECTION_ASM_OP' macro
+properly.
+
+ If no init section is available, when GCC compiles any function called
+`main' (or more accurately, any function designated as a program entry
+point by the language front end calling `expand_main_function'), it
+inserts a procedure call to `__main' as the first executable code after
+the function prologue. The `__main' function is defined in `libgcc2.c'
+and runs the global constructors.
+
+ In file formats that don't support arbitrary sections, there are again
+two variants. In the simplest variant, the GNU linker (GNU `ld') and
+an `a.out' format must be used. In this case, `TARGET_ASM_CONSTRUCTOR'
+is defined to produce a `.stabs' entry of type `N_SETT', referencing
+the name `__CTOR_LIST__', and with the address of the void function
+containing the initialization code as its value. The GNU linker
+recognizes this as a request to add the value to a "set"; the values
+are accumulated, and are eventually placed in the executable as a
+vector in the format described above, with a leading (ignored) count
+and a trailing zero element. `TARGET_ASM_DESTRUCTOR' is handled
+similarly. Since no init section is available, the absence of
+`INIT_SECTION_ASM_OP' causes the compilation of `main' to call `__main'
+as above, starting the initialization process.
+
+ The last variant uses neither arbitrary sections nor the GNU linker.
+This is preferable when you want to do dynamic linking and when using
+file formats which the GNU linker does not support, such as `ECOFF'. In
+this case, `TARGET_HAVE_CTORS_DTORS' is false, initialization and
+termination functions are recognized simply by their names. This
+requires an extra program in the linkage step, called `collect2'. This
+program pretends to be the linker, for use with GCC; it does its job by
+running the ordinary linker, but also arranges to include the vectors of
+initialization and termination functions. These functions are called
+via `__main' as described above. In order to use this method,
+`use_collect2' must be defined in the target in `config.gcc'.
+
+ The following section describes the specific macros that control and
+customize the handling of initialization and termination functions.
+
+
+File: gccint.info, Node: Macros for Initialization, Next: Instruction Output, Prev: Initialization, Up: Assembler Format
+
+17.21.6 Macros Controlling Initialization Routines
+--------------------------------------------------
+
+Here are the macros that control how the compiler handles initialization
+and termination functions:
+
+ -- Macro: INIT_SECTION_ASM_OP
+ If defined, a C string constant, including spacing, for the
+ assembler operation to identify the following data as
+ initialization code. If not defined, GCC will assume such a
+ section does not exist. When you are using special sections for
+ initialization and termination functions, this macro also controls
+ how `crtstuff.c' and `libgcc2.c' arrange to run the initialization
+ functions.
+
+ -- Macro: HAS_INIT_SECTION
+ If defined, `main' will not call `__main' as described above.
+ This macro should be defined for systems that control start-up code
+ on a symbol-by-symbol basis, such as OSF/1, and should not be
+ defined explicitly for systems that support `INIT_SECTION_ASM_OP'.
+
+ -- Macro: LD_INIT_SWITCH
+ If defined, a C string constant for a switch that tells the linker
+ that the following symbol is an initialization routine.
+
+ -- Macro: LD_FINI_SWITCH
+ If defined, a C string constant for a switch that tells the linker
+ that the following symbol is a finalization routine.
+
+ -- Macro: COLLECT_SHARED_INIT_FUNC (STREAM, FUNC)
+ If defined, a C statement that will write a function that can be
+ automatically called when a shared library is loaded. The function
+ should call FUNC, which takes no arguments. If not defined, and
+ the object format requires an explicit initialization function,
+ then a function called `_GLOBAL__DI' will be generated.
+
+ This function and the following one are used by collect2 when
+ linking a shared library that needs constructors or destructors,
+ or has DWARF2 exception tables embedded in the code.
+
+ -- Macro: COLLECT_SHARED_FINI_FUNC (STREAM, FUNC)
+ If defined, a C statement that will write a function that can be
+ automatically called when a shared library is unloaded. The
+ function should call FUNC, which takes no arguments. If not
+ defined, and the object format requires an explicit finalization
+ function, then a function called `_GLOBAL__DD' will be generated.
+
+ -- Macro: INVOKE__main
+ If defined, `main' will call `__main' despite the presence of
+ `INIT_SECTION_ASM_OP'. This macro should be defined for systems
+ where the init section is not actually run automatically, but is
+ still useful for collecting the lists of constructors and
+ destructors.
+
+ -- Macro: SUPPORTS_INIT_PRIORITY
+ If nonzero, the C++ `init_priority' attribute is supported and the
+ compiler should emit instructions to control the order of
+ initialization of objects. If zero, the compiler will issue an
+ error message upon encountering an `init_priority' attribute.
+
+ -- Target Hook: bool TARGET_HAVE_CTORS_DTORS
+ This value is true if the target supports some "native" method of
+ collecting constructors and destructors to be run at startup and
+ exit. It is false if we must use `collect2'.
+
+ -- Target Hook: void TARGET_ASM_CONSTRUCTOR (rtx SYMBOL, int PRIORITY)
+ If defined, a function that outputs assembler code to arrange to
+ call the function referenced by SYMBOL at initialization time.
+
+ Assume that SYMBOL is a `SYMBOL_REF' for a function taking no
+ arguments and with no return value. If the target supports
+ initialization priorities, PRIORITY is a value between 0 and
+ `MAX_INIT_PRIORITY'; otherwise it must be `DEFAULT_INIT_PRIORITY'.
+
+ If this macro is not defined by the target, a suitable default will
+ be chosen if (1) the target supports arbitrary section names, (2)
+ the target defines `CTORS_SECTION_ASM_OP', or (3) `USE_COLLECT2'
+ is not defined.
+
+ -- Target Hook: void TARGET_ASM_DESTRUCTOR (rtx SYMBOL, int PRIORITY)
+ This is like `TARGET_ASM_CONSTRUCTOR' but used for termination
+ functions rather than initialization functions.
+
+ If `TARGET_HAVE_CTORS_DTORS' is true, the initialization routine
+generated for the generated object file will have static linkage.
+
+ If your system uses `collect2' as the means of processing
+constructors, then that program normally uses `nm' to scan an object
+file for constructor functions to be called.
+
+ On certain kinds of systems, you can define this macro to make
+`collect2' work faster (and, in some cases, make it work at all):
+
+ -- Macro: OBJECT_FORMAT_COFF
+ Define this macro if the system uses COFF (Common Object File
+ Format) object files, so that `collect2' can assume this format
+ and scan object files directly for dynamic constructor/destructor
+ functions.
+
+ This macro is effective only in a native compiler; `collect2' as
+ part of a cross compiler always uses `nm' for the target machine.
+
+ -- Macro: REAL_NM_FILE_NAME
+ Define this macro as a C string constant containing the file name
+ to use to execute `nm'. The default is to search the path
+ normally for `nm'.
+
+ If your system supports shared libraries and has a program to list
+ the dynamic dependencies of a given library or executable, you can
+ define these macros to enable support for running initialization
+ and termination functions in shared libraries:
+
+ -- Macro: LDD_SUFFIX
+ Define this macro to a C string constant containing the name of
+ the program which lists dynamic dependencies, like `"ldd"' under
+ SunOS 4.
+
+ -- Macro: PARSE_LDD_OUTPUT (PTR)
+ Define this macro to be C code that extracts filenames from the
+ output of the program denoted by `LDD_SUFFIX'. PTR is a variable
+ of type `char *' that points to the beginning of a line of output
+ from `LDD_SUFFIX'. If the line lists a dynamic dependency, the
+ code must advance PTR to the beginning of the filename on that
+ line. Otherwise, it must set PTR to `NULL'.
+
+ -- Macro: SHLIB_SUFFIX
+ Define this macro to a C string constant containing the default
+ shared library extension of the target (e.g., `".so"'). `collect2'
+ strips version information after this suffix when generating global
+ constructor and destructor names. This define is only needed on
+ targets that use `collect2' to process constructors and
+ destructors.
+
+
+File: gccint.info, Node: Instruction Output, Next: Dispatch Tables, Prev: Macros for Initialization, Up: Assembler Format
+
+17.21.7 Output of Assembler Instructions
+----------------------------------------
+
+This describes assembler instruction output.
+
+ -- Macro: REGISTER_NAMES
+ A C initializer containing the assembler's names for the machine
+ registers, each one as a C string constant. This is what
+ translates register numbers in the compiler into assembler
+ language.
+
+ -- Macro: ADDITIONAL_REGISTER_NAMES
+ If defined, a C initializer for an array of structures containing
+ a name and a register number. This macro defines additional names
+ for hard registers, thus allowing the `asm' option in declarations
+ to refer to registers using alternate names.
+
+ -- Macro: ASM_OUTPUT_OPCODE (STREAM, PTR)
+ Define this macro if you are using an unusual assembler that
+ requires different names for the machine instructions.
+
+ The definition is a C statement or statements which output an
+ assembler instruction opcode to the stdio stream STREAM. The
+ macro-operand PTR is a variable of type `char *' which points to
+ the opcode name in its "internal" form--the form that is written
+ in the machine description. The definition should output the
+ opcode name to STREAM, performing any translation you desire, and
+ increment the variable PTR to point at the end of the opcode so
+ that it will not be output twice.
+
+ In fact, your macro definition may process less than the entire
+ opcode name, or more than the opcode name; but if you want to
+ process text that includes `%'-sequences to substitute operands,
+ you must take care of the substitution yourself. Just be sure to
+ increment PTR over whatever text should not be output normally.
+
+ If you need to look at the operand values, they can be found as the
+ elements of `recog_data.operand'.
+
+ If the macro definition does nothing, the instruction is output in
+ the usual way.
+
+ -- Macro: FINAL_PRESCAN_INSN (INSN, OPVEC, NOPERANDS)
+ If defined, a C statement to be executed just prior to the output
+ of assembler code for INSN, to modify the extracted operands so
+ they will be output differently.
+
+ Here the argument OPVEC is the vector containing the operands
+ extracted from INSN, and NOPERANDS is the number of elements of
+ the vector which contain meaningful data for this insn. The
+ contents of this vector are what will be used to convert the insn
+ template into assembler code, so you can change the assembler
+ output by changing the contents of the vector.
+
+ This macro is useful when various assembler syntaxes share a single
+ file of instruction patterns; by defining this macro differently,
+ you can cause a large class of instructions to be output
+ differently (such as with rearranged operands). Naturally,
+ variations in assembler syntax affecting individual insn patterns
+ ought to be handled by writing conditional output routines in
+ those patterns.
+
+ If this macro is not defined, it is equivalent to a null statement.
+
+ -- Macro: PRINT_OPERAND (STREAM, X, CODE)
+ A C compound statement to output to stdio stream STREAM the
+ assembler syntax for an instruction operand X. X is an RTL
+ expression.
+
+ CODE is a value that can be used to specify one of several ways of
+ printing the operand. It is used when identical operands must be
+ printed differently depending on the context. CODE comes from the
+ `%' specification that was used to request printing of the
+ operand. If the specification was just `%DIGIT' then CODE is 0;
+ if the specification was `%LTR DIGIT' then CODE is the ASCII code
+ for LTR.
+
+ If X is a register, this macro should print the register's name.
+ The names can be found in an array `reg_names' whose type is `char
+ *[]'. `reg_names' is initialized from `REGISTER_NAMES'.
+
+ When the machine description has a specification `%PUNCT' (a `%'
+ followed by a punctuation character), this macro is called with a
+ null pointer for X and the punctuation character for CODE.
+
+ -- Macro: PRINT_OPERAND_PUNCT_VALID_P (CODE)
+ A C expression which evaluates to true if CODE is a valid
+ punctuation character for use in the `PRINT_OPERAND' macro. If
+ `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no
+ punctuation characters (except for the standard one, `%') are used
+ in this way.
+
+ -- Macro: PRINT_OPERAND_ADDRESS (STREAM, X)
+ A C compound statement to output to stdio stream STREAM the
+ assembler syntax for an instruction operand that is a memory
+ reference whose address is X. X is an RTL expression.
+
+ On some machines, the syntax for a symbolic address depends on the
+ section that the address refers to. On these machines, define the
+ hook `TARGET_ENCODE_SECTION_INFO' to store the information into the
+ `symbol_ref', and then check for it here. *Note Assembler
+ Format::.
+
+ -- Macro: DBR_OUTPUT_SEQEND (FILE)
+ A C statement, to be executed after all slot-filler instructions
+ have been output. If necessary, call `dbr_sequence_length' to
+ determine the number of slots filled in a sequence (zero if not
+ currently outputting a sequence), to decide how many no-ops to
+ output, or whatever.
+
+ Don't define this macro if it has nothing to do, but it is helpful
+ in reading assembly output if the extent of the delay sequence is
+ made explicit (e.g. with white space).
+
+ Note that output routines for instructions with delay slots must be
+prepared to deal with not being output as part of a sequence (i.e. when
+the scheduling pass is not run, or when no slot fillers could be
+found.) The variable `final_sequence' is null when not processing a
+sequence, otherwise it contains the `sequence' rtx being output.
+
+ -- Macro: REGISTER_PREFIX
+ -- Macro: LOCAL_LABEL_PREFIX
+ -- Macro: USER_LABEL_PREFIX
+ -- Macro: IMMEDIATE_PREFIX
+ If defined, C string expressions to be used for the `%R', `%L',
+ `%U', and `%I' options of `asm_fprintf' (see `final.c'). These
+ are useful when a single `md' file must support multiple assembler
+ formats. In that case, the various `tm.h' files can define these
+ macros differently.
+
+ -- Macro: ASM_FPRINTF_EXTENSIONS (FILE, ARGPTR, FORMAT)
+ If defined this macro should expand to a series of `case'
+ statements which will be parsed inside the `switch' statement of
+ the `asm_fprintf' function. This allows targets to define extra
+ printf formats which may useful when generating their assembler
+ statements. Note that uppercase letters are reserved for future
+ generic extensions to asm_fprintf, and so are not available to
+ target specific code. The output file is given by the parameter
+ FILE. The varargs input pointer is ARGPTR and the rest of the
+ format string, starting the character after the one that is being
+ switched upon, is pointed to by FORMAT.
+
+ -- Macro: ASSEMBLER_DIALECT
+ If your target supports multiple dialects of assembler language
+ (such as different opcodes), define this macro as a C expression
+ that gives the numeric index of the assembler language dialect to
+ use, with zero as the first variant.
+
+ If this macro is defined, you may use constructs of the form
+ `{option0|option1|option2...}'
+ in the output templates of patterns (*note Output Template::) or
+ in the first argument of `asm_fprintf'. This construct outputs
+ `option0', `option1', `option2', etc., if the value of
+ `ASSEMBLER_DIALECT' is zero, one, two, etc. Any special characters
+ within these strings retain their usual meaning. If there are
+ fewer alternatives within the braces than the value of
+ `ASSEMBLER_DIALECT', the construct outputs nothing.
+
+ If you do not define this macro, the characters `{', `|' and `}'
+ do not have any special meaning when used in templates or operands
+ to `asm_fprintf'.
+
+ Define the macros `REGISTER_PREFIX', `LOCAL_LABEL_PREFIX',
+ `USER_LABEL_PREFIX' and `IMMEDIATE_PREFIX' if you can express the
+ variations in assembler language syntax with that mechanism.
+ Define `ASSEMBLER_DIALECT' and use the `{option0|option1}' syntax
+ if the syntax variant are larger and involve such things as
+ different opcodes or operand order.
+
+ -- Macro: ASM_OUTPUT_REG_PUSH (STREAM, REGNO)
+ A C expression to output to STREAM some assembler code which will
+ push hard register number REGNO onto the stack. The code need not
+ be optimal, since this macro is used only when profiling.
+
+ -- Macro: ASM_OUTPUT_REG_POP (STREAM, REGNO)
+ A C expression to output to STREAM some assembler code which will
+ pop hard register number REGNO off of the stack. The code need
+ not be optimal, since this macro is used only when profiling.
+
+
+File: gccint.info, Node: Dispatch Tables, Next: Exception Region Output, Prev: Instruction Output, Up: Assembler Format
+
+17.21.8 Output of Dispatch Tables
+---------------------------------
+
+This concerns dispatch tables.
+
+ -- Macro: ASM_OUTPUT_ADDR_DIFF_ELT (STREAM, BODY, VALUE, REL)
+ A C statement to output to the stdio stream STREAM an assembler
+ pseudo-instruction to generate a difference between two labels.
+ VALUE and REL are the numbers of two internal labels. The
+ definitions of these labels are output using
+ `(*targetm.asm_out.internal_label)', and they must be printed in
+ the same way here. For example,
+
+ fprintf (STREAM, "\t.word L%d-L%d\n",
+ VALUE, REL)
+
+ You must provide this macro on machines where the addresses in a
+ dispatch table are relative to the table's own address. If
+ defined, GCC will also use this macro on all machines when
+ producing PIC. BODY is the body of the `ADDR_DIFF_VEC'; it is
+ provided so that the mode and flags can be read.
+
+ -- Macro: ASM_OUTPUT_ADDR_VEC_ELT (STREAM, VALUE)
+ This macro should be provided on machines where the addresses in a
+ dispatch table are absolute.
+
+ The definition should be a C statement to output to the stdio
+ stream STREAM an assembler pseudo-instruction to generate a
+ reference to a label. VALUE is the number of an internal label
+ whose definition is output using
+ `(*targetm.asm_out.internal_label)'. For example,
+
+ fprintf (STREAM, "\t.word L%d\n", VALUE)
+
+ -- Macro: ASM_OUTPUT_CASE_LABEL (STREAM, PREFIX, NUM, TABLE)
+ Define this if the label before a jump-table needs to be output
+ specially. The first three arguments are the same as for
+ `(*targetm.asm_out.internal_label)'; the fourth argument is the
+ jump-table which follows (a `jump_insn' containing an `addr_vec'
+ or `addr_diff_vec').
+
+ This feature is used on system V to output a `swbeg' statement for
+ the table.
+
+ If this macro is not defined, these labels are output with
+ `(*targetm.asm_out.internal_label)'.
+
+ -- Macro: ASM_OUTPUT_CASE_END (STREAM, NUM, TABLE)
+ Define this if something special must be output at the end of a
+ jump-table. The definition should be a C statement to be executed
+ after the assembler code for the table is written. It should write
+ the appropriate code to stdio stream STREAM. The argument TABLE
+ is the jump-table insn, and NUM is the label-number of the
+ preceding label.
+
+ If this macro is not defined, nothing special is output at the end
+ of the jump-table.
+
+ -- Target Hook: void TARGET_ASM_EMIT_UNWIND_LABEL (STREAM, DECL,
+ FOR_EH, EMPTY)
+ This target hook emits a label at the beginning of each FDE. It
+ should be defined on targets where FDEs need special labels, and it
+ should write the appropriate label, for the FDE associated with the
+ function declaration DECL, to the stdio stream STREAM. The third
+ argument, FOR_EH, is a boolean: true if this is for an exception
+ table. The fourth argument, EMPTY, is a boolean: true if this is
+ a placeholder label for an omitted FDE.
+
+ The default is that FDEs are not given nonlocal labels.
+
+ -- Target Hook: void TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL (STREAM)
+ This target hook emits a label at the beginning of the exception
+ table. It should be defined on targets where it is desirable for
+ the table to be broken up according to function.
+
+ The default is that no label is emitted.
+
+ -- Target Hook: void TARGET_UNWIND_EMIT (FILE * STREAM, rtx INSN)
+ This target hook emits and assembly directives required to unwind
+ the given instruction. This is only used when TARGET_UNWIND_INFO
+ is set.
+
+
+File: gccint.info, Node: Exception Region Output, Next: Alignment Output, Prev: Dispatch Tables, Up: Assembler Format
+
+17.21.9 Assembler Commands for Exception Regions
+------------------------------------------------
+
+This describes commands marking the start and the end of an exception
+region.
+
+ -- Macro: EH_FRAME_SECTION_NAME
+ If defined, a C string constant for the name of the section
+ containing exception handling frame unwind information. If not
+ defined, GCC will provide a default definition if the target
+ supports named sections. `crtstuff.c' uses this macro to switch
+ to the appropriate section.
+
+ You should define this symbol if your target supports DWARF 2 frame
+ unwind information and the default definition does not work.
+
+ -- Macro: EH_FRAME_IN_DATA_SECTION
+ If defined, DWARF 2 frame unwind information will be placed in the
+ data section even though the target supports named sections. This
+ might be necessary, for instance, if the system linker does garbage
+ collection and sections cannot be marked as not to be collected.
+
+ Do not define this macro unless `TARGET_ASM_NAMED_SECTION' is also
+ defined.
+
+ -- Macro: EH_TABLES_CAN_BE_READ_ONLY
+ Define this macro to 1 if your target is such that no frame unwind
+ information encoding used with non-PIC code will ever require a
+ runtime relocation, but the linker may not support merging
+ read-only and read-write sections into a single read-write section.
+
+ -- Macro: MASK_RETURN_ADDR
+ An rtx used to mask the return address found via
+ `RETURN_ADDR_RTX', so that it does not contain any extraneous set
+ bits in it.
+
+ -- Macro: DWARF2_UNWIND_INFO
+ Define this macro to 0 if your target supports DWARF 2 frame unwind
+ information, but it does not yet work with exception handling.
+ Otherwise, if your target supports this information (if it defines
+ `INCOMING_RETURN_ADDR_RTX' and either `UNALIGNED_INT_ASM_OP' or
+ `OBJECT_FORMAT_ELF'), GCC will provide a default definition of 1.
+
+ If `TARGET_UNWIND_INFO' is defined, the target specific unwinder
+ will be used in all cases. Defining this macro will enable the
+ generation of DWARF 2 frame debugging information.
+
+ If `TARGET_UNWIND_INFO' is not defined, and this macro is defined
+ to 1, the DWARF 2 unwinder will be the default exception handling
+ mechanism; otherwise, the `setjmp'/`longjmp'-based scheme will be
+ used by default.
+
+ -- Macro: TARGET_UNWIND_INFO
+ Define this macro if your target has ABI specified unwind tables.
+ Usually these will be output by `TARGET_UNWIND_EMIT'.
+
+ -- Variable: Target Hook bool TARGET_UNWIND_TABLES_DEFAULT
+ This variable should be set to `true' if the target ABI requires
+ unwinding tables even when exceptions are not used.
+
+ -- Macro: MUST_USE_SJLJ_EXCEPTIONS
+ This macro need only be defined if `DWARF2_UNWIND_INFO' is
+ runtime-variable. In that case, `except.h' cannot correctly
+ determine the corresponding definition of
+ `MUST_USE_SJLJ_EXCEPTIONS', so the target must provide it directly.
+
+ -- Macro: DONT_USE_BUILTIN_SETJMP
+ Define this macro to 1 if the `setjmp'/`longjmp'-based scheme
+ should use the `setjmp'/`longjmp' functions from the C library
+ instead of the `__builtin_setjmp'/`__builtin_longjmp' machinery.
+
+ -- Macro: DWARF_CIE_DATA_ALIGNMENT
+ This macro need only be defined if the target might save registers
+ in the function prologue at an offset to the stack pointer that is
+ not aligned to `UNITS_PER_WORD'. The definition should be the
+ negative minimum alignment if `STACK_GROWS_DOWNWARD' is defined,
+ and the positive minimum alignment otherwise. *Note SDB and
+ DWARF::. Only applicable if the target supports DWARF 2 frame
+ unwind information.
+
+ -- Variable: Target Hook bool TARGET_TERMINATE_DW2_EH_FRAME_INFO
+ Contains the value true if the target should add a zero word onto
+ the end of a Dwarf-2 frame info section when used for exception
+ handling. Default value is false if `EH_FRAME_SECTION_NAME' is
+ defined, and true otherwise.
+
+ -- Target Hook: rtx TARGET_DWARF_REGISTER_SPAN (rtx REG)
+ Given a register, this hook should return a parallel of registers
+ to represent where to find the register pieces. Define this hook
+ if the register and its mode are represented in Dwarf in
+ non-contiguous locations, or if the register should be represented
+ in more than one register in Dwarf. Otherwise, this hook should
+ return `NULL_RTX'. If not defined, the default is to return
+ `NULL_RTX'.
+
+ -- Target Hook: void TARGET_INIT_DWARF_REG_SIZES_EXTRA (tree ADDRESS)
+ If some registers are represented in Dwarf-2 unwind information in
+ multiple pieces, define this hook to fill in information about the
+ sizes of those pieces in the table used by the unwinder at runtime.
+ It will be called by `expand_builtin_init_dwarf_reg_sizes' after
+ filling in a single size corresponding to each hard register;
+ ADDRESS is the address of the table.
+
+ -- Target Hook: bool TARGET_ASM_TTYPE (rtx SYM)
+ This hook is used to output a reference from a frame unwinding
+ table to the type_info object identified by SYM. It should return
+ `true' if the reference was output. Returning `false' will cause
+ the reference to be output using the normal Dwarf2 routines.
+
+ -- Target Hook: bool TARGET_ARM_EABI_UNWINDER
+ This hook should be set to `true' on targets that use an ARM EABI
+ based unwinding library, and `false' on other targets. This
+ effects the format of unwinding tables, and how the unwinder in
+ entered after running a cleanup. The default is `false'.
+
+
+File: gccint.info, Node: Alignment Output, Prev: Exception Region Output, Up: Assembler Format
+
+17.21.10 Assembler Commands for Alignment
+-----------------------------------------
+
+This describes commands for alignment.
+
+ -- Macro: JUMP_ALIGN (LABEL)
+ The alignment (log base 2) to put in front of LABEL, which is a
+ common destination of jumps and has no fallthru incoming edge.
+
+ This macro need not be defined if you don't want any special
+ alignment to be done at such a time. Most machine descriptions do
+ not currently define the macro.
+
+ Unless it's necessary to inspect the LABEL parameter, it is better
+ to set the variable ALIGN_JUMPS in the target's
+ `OVERRIDE_OPTIONS'. Otherwise, you should try to honor the user's
+ selection in ALIGN_JUMPS in a `JUMP_ALIGN' implementation.
+
+ -- Macro: LABEL_ALIGN_AFTER_BARRIER (LABEL)
+ The alignment (log base 2) to put in front of LABEL, which follows
+ a `BARRIER'.
+
+ This macro need not be defined if you don't want any special
+ alignment to be done at such a time. Most machine descriptions do
+ not currently define the macro.
+
+ -- Macro: LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP
+ The maximum number of bytes to skip when applying
+ `LABEL_ALIGN_AFTER_BARRIER'. This works only if
+ `ASM_OUTPUT_MAX_SKIP_ALIGN' is defined.
+
+ -- Macro: LOOP_ALIGN (LABEL)
+ The alignment (log base 2) to put in front of LABEL, which follows
+ a `NOTE_INSN_LOOP_BEG' note.
+
+ This macro need not be defined if you don't want any special
+ alignment to be done at such a time. Most machine descriptions do
+ not currently define the macro.
+
+ Unless it's necessary to inspect the LABEL parameter, it is better
+ to set the variable `align_loops' in the target's
+ `OVERRIDE_OPTIONS'. Otherwise, you should try to honor the user's
+ selection in `align_loops' in a `LOOP_ALIGN' implementation.
+
+ -- Macro: LOOP_ALIGN_MAX_SKIP
+ The maximum number of bytes to skip when applying `LOOP_ALIGN'.
+ This works only if `ASM_OUTPUT_MAX_SKIP_ALIGN' is defined.
+
+ -- Macro: LABEL_ALIGN (LABEL)
+ The alignment (log base 2) to put in front of LABEL. If
+ `LABEL_ALIGN_AFTER_BARRIER' / `LOOP_ALIGN' specify a different
+ alignment, the maximum of the specified values is used.
+
+ Unless it's necessary to inspect the LABEL parameter, it is better
+ to set the variable `align_labels' in the target's
+ `OVERRIDE_OPTIONS'. Otherwise, you should try to honor the user's
+ selection in `align_labels' in a `LABEL_ALIGN' implementation.
+
+ -- Macro: LABEL_ALIGN_MAX_SKIP
+ The maximum number of bytes to skip when applying `LABEL_ALIGN'.
+ This works only if `ASM_OUTPUT_MAX_SKIP_ALIGN' is defined.
+
+ -- Macro: ASM_OUTPUT_SKIP (STREAM, NBYTES)
+ A C statement to output to the stdio stream STREAM an assembler
+ instruction to advance the location counter by NBYTES bytes.
+ Those bytes should be zero when loaded. NBYTES will be a C
+ expression of type `unsigned HOST_WIDE_INT'.
+
+ -- Macro: ASM_NO_SKIP_IN_TEXT
+ Define this macro if `ASM_OUTPUT_SKIP' should not be used in the
+ text section because it fails to put zeros in the bytes that are
+ skipped. This is true on many Unix systems, where the pseudo-op
+ to skip bytes produces no-op instructions rather than zeros when
+ used in the text section.
+
+ -- Macro: ASM_OUTPUT_ALIGN (STREAM, POWER)
+ A C statement to output to the stdio stream STREAM an assembler
+ command to advance the location counter to a multiple of 2 to the
+ POWER bytes. POWER will be a C expression of type `int'.
+
+ -- Macro: ASM_OUTPUT_ALIGN_WITH_NOP (STREAM, POWER)
+ Like `ASM_OUTPUT_ALIGN', except that the "nop" instruction is used
+ for padding, if necessary.
+
+ -- Macro: ASM_OUTPUT_MAX_SKIP_ALIGN (STREAM, POWER, MAX_SKIP)
+ A C statement to output to the stdio stream STREAM an assembler
+ command to advance the location counter to a multiple of 2 to the
+ POWER bytes, but only if MAX_SKIP or fewer bytes are needed to
+ satisfy the alignment request. POWER and MAX_SKIP will be a C
+ expression of type `int'.
+
+
+File: gccint.info, Node: Debugging Info, Next: Floating Point, Prev: Assembler Format, Up: Target Macros
+
+17.22 Controlling Debugging Information Format
+==============================================
+
+This describes how to specify debugging information.
+
+* Menu:
+
+* All Debuggers:: Macros that affect all debugging formats uniformly.
+* DBX Options:: Macros enabling specific options in DBX format.
+* DBX Hooks:: Hook macros for varying DBX format.
+* File Names and DBX:: Macros controlling output of file names in DBX format.
+* SDB and DWARF:: Macros for SDB (COFF) and DWARF formats.
+* VMS Debug:: Macros for VMS debug format.
+
+
+File: gccint.info, Node: All Debuggers, Next: DBX Options, Up: Debugging Info
+
+17.22.1 Macros Affecting All Debugging Formats
+----------------------------------------------
+
+These macros affect all debugging formats.
+
+ -- Macro: DBX_REGISTER_NUMBER (REGNO)
+ A C expression that returns the DBX register number for the
+ compiler register number REGNO. In the default macro provided,
+ the value of this expression will be REGNO itself. But sometimes
+ there are some registers that the compiler knows about and DBX
+ does not, or vice versa. In such cases, some register may need to
+ have one number in the compiler and another for DBX.
+
+ If two registers have consecutive numbers inside GCC, and they can
+ be used as a pair to hold a multiword value, then they _must_ have
+ consecutive numbers after renumbering with `DBX_REGISTER_NUMBER'.
+ Otherwise, debuggers will be unable to access such a pair, because
+ they expect register pairs to be consecutive in their own
+ numbering scheme.
+
+ If you find yourself defining `DBX_REGISTER_NUMBER' in way that
+ does not preserve register pairs, then what you must do instead is
+ redefine the actual register numbering scheme.
+
+ -- Macro: DEBUGGER_AUTO_OFFSET (X)
+ A C expression that returns the integer offset value for an
+ automatic variable having address X (an RTL expression). The
+ default computation assumes that X is based on the frame-pointer
+ and gives the offset from the frame-pointer. This is required for
+ targets that produce debugging output for DBX or COFF-style
+ debugging output for SDB and allow the frame-pointer to be
+ eliminated when the `-g' options is used.
+
+ -- Macro: DEBUGGER_ARG_OFFSET (OFFSET, X)
+ A C expression that returns the integer offset value for an
+ argument having address X (an RTL expression). The nominal offset
+ is OFFSET.
+
+ -- Macro: PREFERRED_DEBUGGING_TYPE
+ A C expression that returns the type of debugging output GCC should
+ produce when the user specifies just `-g'. Define this if you
+ have arranged for GCC to support more than one format of debugging
+ output. Currently, the allowable values are `DBX_DEBUG',
+ `SDB_DEBUG', `DWARF_DEBUG', `DWARF2_DEBUG', `XCOFF_DEBUG',
+ `VMS_DEBUG', and `VMS_AND_DWARF2_DEBUG'.
+
+ When the user specifies `-ggdb', GCC normally also uses the value
+ of this macro to select the debugging output format, but with two
+ exceptions. If `DWARF2_DEBUGGING_INFO' is defined, GCC uses the
+ value `DWARF2_DEBUG'. Otherwise, if `DBX_DEBUGGING_INFO' is
+ defined, GCC uses `DBX_DEBUG'.
+
+ The value of this macro only affects the default debugging output;
+ the user can always get a specific type of output by using
+ `-gstabs', `-gcoff', `-gdwarf-2', `-gxcoff', or `-gvms'.
+
+
+File: gccint.info, Node: DBX Options, Next: DBX Hooks, Prev: All Debuggers, Up: Debugging Info
+
+17.22.2 Specific Options for DBX Output
+---------------------------------------
+
+These are specific options for DBX output.
+
+ -- Macro: DBX_DEBUGGING_INFO
+ Define this macro if GCC should produce debugging output for DBX
+ in response to the `-g' option.
+
+ -- Macro: XCOFF_DEBUGGING_INFO
+ Define this macro if GCC should produce XCOFF format debugging
+ output in response to the `-g' option. This is a variant of DBX
+ format.
+
+ -- Macro: DEFAULT_GDB_EXTENSIONS
+ Define this macro to control whether GCC should by default generate
+ GDB's extended version of DBX debugging information (assuming
+ DBX-format debugging information is enabled at all). If you don't
+ define the macro, the default is 1: always generate the extended
+ information if there is any occasion to.
+
+ -- Macro: DEBUG_SYMS_TEXT
+ Define this macro if all `.stabs' commands should be output while
+ in the text section.
+
+ -- Macro: ASM_STABS_OP
+ A C string constant, including spacing, naming the assembler
+ pseudo op to use instead of `"\t.stabs\t"' to define an ordinary
+ debugging symbol. If you don't define this macro, `"\t.stabs\t"'
+ is used. This macro applies only to DBX debugging information
+ format.
+
+ -- Macro: ASM_STABD_OP
+ A C string constant, including spacing, naming the assembler
+ pseudo op to use instead of `"\t.stabd\t"' to define a debugging
+ symbol whose value is the current location. If you don't define
+ this macro, `"\t.stabd\t"' is used. This macro applies only to
+ DBX debugging information format.
+
+ -- Macro: ASM_STABN_OP
+ A C string constant, including spacing, naming the assembler
+ pseudo op to use instead of `"\t.stabn\t"' to define a debugging
+ symbol with no name. If you don't define this macro,
+ `"\t.stabn\t"' is used. This macro applies only to DBX debugging
+ information format.
+
+ -- Macro: DBX_NO_XREFS
+ Define this macro if DBX on your system does not support the
+ construct `xsTAGNAME'. On some systems, this construct is used to
+ describe a forward reference to a structure named TAGNAME. On
+ other systems, this construct is not supported at all.
+
+ -- Macro: DBX_CONTIN_LENGTH
+ A symbol name in DBX-format debugging information is normally
+ continued (split into two separate `.stabs' directives) when it
+ exceeds a certain length (by default, 80 characters). On some
+ operating systems, DBX requires this splitting; on others,
+ splitting must not be done. You can inhibit splitting by defining
+ this macro with the value zero. You can override the default
+ splitting-length by defining this macro as an expression for the
+ length you desire.
+
+ -- Macro: DBX_CONTIN_CHAR
+ Normally continuation is indicated by adding a `\' character to
+ the end of a `.stabs' string when a continuation follows. To use
+ a different character instead, define this macro as a character
+ constant for the character you want to use. Do not define this
+ macro if backslash is correct for your system.
+
+ -- Macro: DBX_STATIC_STAB_DATA_SECTION
+ Define this macro if it is necessary to go to the data section
+ before outputting the `.stabs' pseudo-op for a non-global static
+ variable.
+
+ -- Macro: DBX_TYPE_DECL_STABS_CODE
+ The value to use in the "code" field of the `.stabs' directive for
+ a typedef. The default is `N_LSYM'.
+
+ -- Macro: DBX_STATIC_CONST_VAR_CODE
+ The value to use in the "code" field of the `.stabs' directive for
+ a static variable located in the text section. DBX format does not
+ provide any "right" way to do this. The default is `N_FUN'.
+
+ -- Macro: DBX_REGPARM_STABS_CODE
+ The value to use in the "code" field of the `.stabs' directive for
+ a parameter passed in registers. DBX format does not provide any
+ "right" way to do this. The default is `N_RSYM'.
+
+ -- Macro: DBX_REGPARM_STABS_LETTER
+ The letter to use in DBX symbol data to identify a symbol as a
+ parameter passed in registers. DBX format does not customarily
+ provide any way to do this. The default is `'P''.
+
+ -- Macro: DBX_FUNCTION_FIRST
+ Define this macro if the DBX information for a function and its
+ arguments should precede the assembler code for the function.
+ Normally, in DBX format, the debugging information entirely
+ follows the assembler code.
+
+ -- Macro: DBX_BLOCKS_FUNCTION_RELATIVE
+ Define this macro, with value 1, if the value of a symbol
+ describing the scope of a block (`N_LBRAC' or `N_RBRAC') should be
+ relative to the start of the enclosing function. Normally, GCC
+ uses an absolute address.
+
+ -- Macro: DBX_LINES_FUNCTION_RELATIVE
+ Define this macro, with value 1, if the value of a symbol
+ indicating the current line number (`N_SLINE') should be relative
+ to the start of the enclosing function. Normally, GCC uses an
+ absolute address.
+
+ -- Macro: DBX_USE_BINCL
+ Define this macro if GCC should generate `N_BINCL' and `N_EINCL'
+ stabs for included header files, as on Sun systems. This macro
+ also directs GCC to output a type number as a pair of a file
+ number and a type number within the file. Normally, GCC does not
+ generate `N_BINCL' or `N_EINCL' stabs, and it outputs a single
+ number for a type number.
+
+
+File: gccint.info, Node: DBX Hooks, Next: File Names and DBX, Prev: DBX Options, Up: Debugging Info
+
+17.22.3 Open-Ended Hooks for DBX Format
+---------------------------------------
+
+These are hooks for DBX format.
+
+ -- Macro: DBX_OUTPUT_LBRAC (STREAM, NAME)
+ Define this macro to say how to output to STREAM the debugging
+ information for the start of a scope level for variable names. The
+ argument NAME is the name of an assembler symbol (for use with
+ `assemble_name') whose value is the address where the scope begins.
+
+ -- Macro: DBX_OUTPUT_RBRAC (STREAM, NAME)
+ Like `DBX_OUTPUT_LBRAC', but for the end of a scope level.
+
+ -- Macro: DBX_OUTPUT_NFUN (STREAM, LSCOPE_LABEL, DECL)
+ Define this macro if the target machine requires special handling
+ to output an `N_FUN' entry for the function DECL.
+
+ -- Macro: DBX_OUTPUT_SOURCE_LINE (STREAM, LINE, COUNTER)
+ A C statement to output DBX debugging information before code for
+ line number LINE of the current source file to the stdio stream
+ STREAM. COUNTER is the number of time the macro was invoked,
+ including the current invocation; it is intended to generate
+ unique labels in the assembly output.
+
+ This macro should not be defined if the default output is correct,
+ or if it can be made correct by defining
+ `DBX_LINES_FUNCTION_RELATIVE'.
+
+ -- Macro: NO_DBX_FUNCTION_END
+ Some stabs encapsulation formats (in particular ECOFF), cannot
+ handle the `.stabs "",N_FUN,,0,0,Lscope-function-1' gdb dbx
+ extension construct. On those machines, define this macro to turn
+ this feature off without disturbing the rest of the gdb extensions.
+
+ -- Macro: NO_DBX_BNSYM_ENSYM
+ Some assemblers cannot handle the `.stabd BNSYM/ENSYM,0,0' gdb dbx
+ extension construct. On those machines, define this macro to turn
+ this feature off without disturbing the rest of the gdb extensions.
+
+
+File: gccint.info, Node: File Names and DBX, Next: SDB and DWARF, Prev: DBX Hooks, Up: Debugging Info
+
+17.22.4 File Names in DBX Format
+--------------------------------
+
+This describes file names in DBX format.
+
+ -- Macro: DBX_OUTPUT_MAIN_SOURCE_FILENAME (STREAM, NAME)
+ A C statement to output DBX debugging information to the stdio
+ stream STREAM, which indicates that file NAME is the main source
+ file--the file specified as the input file for compilation. This
+ macro is called only once, at the beginning of compilation.
+
+ This macro need not be defined if the standard form of output for
+ DBX debugging information is appropriate.
+
+ It may be necessary to refer to a label equal to the beginning of
+ the text section. You can use `assemble_name (stream,
+ ltext_label_name)' to do so. If you do this, you must also set
+ the variable USED_LTEXT_LABEL_NAME to `true'.
+
+ -- Macro: NO_DBX_MAIN_SOURCE_DIRECTORY
+ Define this macro, with value 1, if GCC should not emit an
+ indication of the current directory for compilation and current
+ source language at the beginning of the file.
+
+ -- Macro: NO_DBX_GCC_MARKER
+ Define this macro, with value 1, if GCC should not emit an
+ indication that this object file was compiled by GCC. The default
+ is to emit an `N_OPT' stab at the beginning of every source file,
+ with `gcc2_compiled.' for the string and value 0.
+
+ -- Macro: DBX_OUTPUT_MAIN_SOURCE_FILE_END (STREAM, NAME)
+ A C statement to output DBX debugging information at the end of
+ compilation of the main source file NAME. Output should be
+ written to the stdio stream STREAM.
+
+ If you don't define this macro, nothing special is output at the
+ end of compilation, which is correct for most machines.
+
+ -- Macro: DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END
+ Define this macro _instead of_ defining
+ `DBX_OUTPUT_MAIN_SOURCE_FILE_END', if what needs to be output at
+ the end of compilation is a `N_SO' stab with an empty string,
+ whose value is the highest absolute text address in the file.
+
+
+File: gccint.info, Node: SDB and DWARF, Next: VMS Debug, Prev: File Names and DBX, Up: Debugging Info
+
+17.22.5 Macros for SDB and DWARF Output
+---------------------------------------
+
+Here are macros for SDB and DWARF output.
+
+ -- Macro: SDB_DEBUGGING_INFO
+ Define this macro if GCC should produce COFF-style debugging output
+ for SDB in response to the `-g' option.
+
+ -- Macro: DWARF2_DEBUGGING_INFO
+ Define this macro if GCC should produce dwarf version 2 format
+ debugging output in response to the `-g' option.
+
+ -- Target Hook: int TARGET_DWARF_CALLING_CONVENTION (tree
+ FUNCTION)
+ Define this to enable the dwarf attribute
+ `DW_AT_calling_convention' to be emitted for each function.
+ Instead of an integer return the enum value for the `DW_CC_'
+ tag.
+
+ To support optional call frame debugging information, you must also
+ define `INCOMING_RETURN_ADDR_RTX' and either set
+ `RTX_FRAME_RELATED_P' on the prologue insns if you use RTL for the
+ prologue, or call `dwarf2out_def_cfa' and `dwarf2out_reg_save' as
+ appropriate from `TARGET_ASM_FUNCTION_PROLOGUE' if you don't.
+
+ -- Macro: DWARF2_FRAME_INFO
+ Define this macro to a nonzero value if GCC should always output
+ Dwarf 2 frame information. If `DWARF2_UNWIND_INFO' (*note
+ Exception Region Output:: is nonzero, GCC will output this
+ information not matter how you define `DWARF2_FRAME_INFO'.
+
+ -- Macro: DWARF2_ASM_LINE_DEBUG_INFO
+ Define this macro to be a nonzero value if the assembler can
+ generate Dwarf 2 line debug info sections. This will result in
+ much more compact line number tables, and hence is desirable if it
+ works.
+
+ -- Macro: ASM_OUTPUT_DWARF_DELTA (STREAM, SIZE, LABEL1, LABEL2)
+ A C statement to issue assembly directives that create a difference
+ LAB1 minus LAB2, using an integer of the given SIZE.
+
+ -- Macro: ASM_OUTPUT_DWARF_OFFSET (STREAM, SIZE, LABEL, SECTION)
+ A C statement to issue assembly directives that create a
+ section-relative reference to the given LABEL, using an integer of
+ the given SIZE. The label is known to be defined in the given
+ SECTION.
+
+ -- Macro: ASM_OUTPUT_DWARF_PCREL (STREAM, SIZE, LABEL)
+ A C statement to issue assembly directives that create a
+ self-relative reference to the given LABEL, using an integer of
+ the given SIZE.
+
+ -- Target Hook: void TARGET_ASM_OUTPUT_DWARF_DTPREL (FILE *FILE, int
+ SIZE, rtx X)
+ If defined, this target hook is a function which outputs a
+ DTP-relative reference to the given TLS symbol of the specified
+ size.
+
+ -- Macro: PUT_SDB_...
+ Define these macros to override the assembler syntax for the
+ special SDB assembler directives. See `sdbout.c' for a list of
+ these macros and their arguments. If the standard syntax is used,
+ you need not define them yourself.
+
+ -- Macro: SDB_DELIM
+ Some assemblers do not support a semicolon as a delimiter, even
+ between SDB assembler directives. In that case, define this macro
+ to be the delimiter to use (usually `\n'). It is not necessary to
+ define a new set of `PUT_SDB_OP' macros if this is the only change
+ required.
+
+ -- Macro: SDB_ALLOW_UNKNOWN_REFERENCES
+ Define this macro to allow references to unknown structure, union,
+ or enumeration tags to be emitted. Standard COFF does not allow
+ handling of unknown references, MIPS ECOFF has support for it.
+
+ -- Macro: SDB_ALLOW_FORWARD_REFERENCES
+ Define this macro to allow references to structure, union, or
+ enumeration tags that have not yet been seen to be handled. Some
+ assemblers choke if forward tags are used, while some require it.
+
+ -- Macro: SDB_OUTPUT_SOURCE_LINE (STREAM, LINE)
+ A C statement to output SDB debugging information before code for
+ line number LINE of the current source file to the stdio stream
+ STREAM. The default is to emit an `.ln' directive.
+
+
+File: gccint.info, Node: VMS Debug, Prev: SDB and DWARF, Up: Debugging Info
+
+17.22.6 Macros for VMS Debug Format
+-----------------------------------
+
+Here are macros for VMS debug format.
+
+ -- Macro: VMS_DEBUGGING_INFO
+ Define this macro if GCC should produce debugging output for VMS
+ in response to the `-g' option. The default behavior for VMS is
+ to generate minimal debug info for a traceback in the absence of
+ `-g' unless explicitly overridden with `-g0'. This behavior is
+ controlled by `OPTIMIZATION_OPTIONS' and `OVERRIDE_OPTIONS'.
+
+
+File: gccint.info, Node: Floating Point, Next: Mode Switching, Prev: Debugging Info, Up: Target Macros
+
+17.23 Cross Compilation and Floating Point
+==========================================
+
+While all modern machines use twos-complement representation for
+integers, there are a variety of representations for floating point
+numbers. This means that in a cross-compiler the representation of
+floating point numbers in the compiled program may be different from
+that used in the machine doing the compilation.
+
+ Because different representation systems may offer different amounts of
+range and precision, all floating point constants must be represented in
+the target machine's format. Therefore, the cross compiler cannot
+safely use the host machine's floating point arithmetic; it must emulate
+the target's arithmetic. To ensure consistency, GCC always uses
+emulation to work with floating point values, even when the host and
+target floating point formats are identical.
+
+ The following macros are provided by `real.h' for the compiler to use.
+All parts of the compiler which generate or optimize floating-point
+calculations must use these macros. They may evaluate their operands
+more than once, so operands must not have side effects.
+
+ -- Macro: REAL_VALUE_TYPE
+ The C data type to be used to hold a floating point value in the
+ target machine's format. Typically this is a `struct' containing
+ an array of `HOST_WIDE_INT', but all code should treat it as an
+ opaque quantity.
+
+ -- Macro: int REAL_VALUES_EQUAL (REAL_VALUE_TYPE X, REAL_VALUE_TYPE Y)
+ Compares for equality the two values, X and Y. If the target
+ floating point format supports negative zeroes and/or NaNs,
+ `REAL_VALUES_EQUAL (-0.0, 0.0)' is true, and `REAL_VALUES_EQUAL
+ (NaN, NaN)' is false.
+
+ -- Macro: int REAL_VALUES_LESS (REAL_VALUE_TYPE X, REAL_VALUE_TYPE Y)
+ Tests whether X is less than Y.
+
+ -- Macro: HOST_WIDE_INT REAL_VALUE_FIX (REAL_VALUE_TYPE X)
+ Truncates X to a signed integer, rounding toward zero.
+
+ -- Macro: unsigned HOST_WIDE_INT REAL_VALUE_UNSIGNED_FIX
+ (REAL_VALUE_TYPE X)
+ Truncates X to an unsigned integer, rounding toward zero. If X is
+ negative, returns zero.
+
+ -- Macro: REAL_VALUE_TYPE REAL_VALUE_ATOF (const char *STRING, enum
+ machine_mode MODE)
+ Converts STRING into a floating point number in the target
+ machine's representation for mode MODE. This routine can handle
+ both decimal and hexadecimal floating point constants, using the
+ syntax defined by the C language for both.
+
+ -- Macro: int REAL_VALUE_NEGATIVE (REAL_VALUE_TYPE X)
+ Returns 1 if X is negative (including negative zero), 0 otherwise.
+
+ -- Macro: int REAL_VALUE_ISINF (REAL_VALUE_TYPE X)
+ Determines whether X represents infinity (positive or negative).
+
+ -- Macro: int REAL_VALUE_ISNAN (REAL_VALUE_TYPE X)
+ Determines whether X represents a "NaN" (not-a-number).
+
+ -- Macro: void REAL_ARITHMETIC (REAL_VALUE_TYPE OUTPUT, enum tree_code
+ CODE, REAL_VALUE_TYPE X, REAL_VALUE_TYPE Y)
+ Calculates an arithmetic operation on the two floating point values
+ X and Y, storing the result in OUTPUT (which must be a variable).
+
+ The operation to be performed is specified by CODE. Only the
+ following codes are supported: `PLUS_EXPR', `MINUS_EXPR',
+ `MULT_EXPR', `RDIV_EXPR', `MAX_EXPR', `MIN_EXPR'.
+
+ If `REAL_ARITHMETIC' is asked to evaluate division by zero and the
+ target's floating point format cannot represent infinity, it will
+ call `abort'. Callers should check for this situation first, using
+ `MODE_HAS_INFINITIES'. *Note Storage Layout::.
+
+ -- Macro: REAL_VALUE_TYPE REAL_VALUE_NEGATE (REAL_VALUE_TYPE X)
+ Returns the negative of the floating point value X.
+
+ -- Macro: REAL_VALUE_TYPE REAL_VALUE_ABS (REAL_VALUE_TYPE X)
+ Returns the absolute value of X.
+
+ -- Macro: REAL_VALUE_TYPE REAL_VALUE_TRUNCATE (REAL_VALUE_TYPE MODE,
+ enum machine_mode X)
+ Truncates the floating point value X to fit in MODE. The return
+ value is still a full-size `REAL_VALUE_TYPE', but it has an
+ appropriate bit pattern to be output as a floating constant whose
+ precision accords with mode MODE.
+
+ -- Macro: void REAL_VALUE_TO_INT (HOST_WIDE_INT LOW, HOST_WIDE_INT
+ HIGH, REAL_VALUE_TYPE X)
+ Converts a floating point value X into a double-precision integer
+ which is then stored into LOW and HIGH. If the value is not
+ integral, it is truncated.
+
+ -- Macro: void REAL_VALUE_FROM_INT (REAL_VALUE_TYPE X, HOST_WIDE_INT
+ LOW, HOST_WIDE_INT HIGH, enum machine_mode MODE)
+ Converts a double-precision integer found in LOW and HIGH, into a
+ floating point value which is then stored into X. The value is
+ truncated to fit in mode MODE.
+
+
+File: gccint.info, Node: Mode Switching, Next: Target Attributes, Prev: Floating Point, Up: Target Macros
+
+17.24 Mode Switching Instructions
+=================================
+
+The following macros control mode switching optimizations:
+
+ -- Macro: OPTIMIZE_MODE_SWITCHING (ENTITY)
+ Define this macro if the port needs extra instructions inserted
+ for mode switching in an optimizing compilation.
+
+ For an example, the SH4 can perform both single and double
+ precision floating point operations, but to perform a single
+ precision operation, the FPSCR PR bit has to be cleared, while for
+ a double precision operation, this bit has to be set. Changing
+ the PR bit requires a general purpose register as a scratch
+ register, hence these FPSCR sets have to be inserted before
+ reload, i.e. you can't put this into instruction emitting or
+ `TARGET_MACHINE_DEPENDENT_REORG'.
+
+ You can have multiple entities that are mode-switched, and select
+ at run time which entities actually need it.
+ `OPTIMIZE_MODE_SWITCHING' should return nonzero for any ENTITY
+ that needs mode-switching. If you define this macro, you also
+ have to define `NUM_MODES_FOR_MODE_SWITCHING', `MODE_NEEDED',
+ `MODE_PRIORITY_TO_MODE' and `EMIT_MODE_SET'. `MODE_AFTER',
+ `MODE_ENTRY', and `MODE_EXIT' are optional.
+
+ -- Macro: NUM_MODES_FOR_MODE_SWITCHING
+ If you define `OPTIMIZE_MODE_SWITCHING', you have to define this as
+ initializer for an array of integers. Each initializer element N
+ refers to an entity that needs mode switching, and specifies the
+ number of different modes that might need to be set for this
+ entity. The position of the initializer in the
+ initializer--starting counting at zero--determines the integer
+ that is used to refer to the mode-switched entity in question. In
+ macros that take mode arguments / yield a mode result, modes are
+ represented as numbers 0 ... N - 1. N is used to specify that no
+ mode switch is needed / supplied.
+
+ -- Macro: MODE_NEEDED (ENTITY, INSN)
+ ENTITY is an integer specifying a mode-switched entity. If
+ `OPTIMIZE_MODE_SWITCHING' is defined, you must define this macro to
+ return an integer value not larger than the corresponding element
+ in `NUM_MODES_FOR_MODE_SWITCHING', to denote the mode that ENTITY
+ must be switched into prior to the execution of INSN.
+
+ -- Macro: MODE_AFTER (MODE, INSN)
+ If this macro is defined, it is evaluated for every INSN during
+ mode switching. It determines the mode that an insn results in (if
+ different from the incoming mode).
+
+ -- Macro: MODE_ENTRY (ENTITY)
+ If this macro is defined, it is evaluated for every ENTITY that
+ needs mode switching. It should evaluate to an integer, which is
+ a mode that ENTITY is assumed to be switched to at function entry.
+ If `MODE_ENTRY' is defined then `MODE_EXIT' must be defined.
+
+ -- Macro: MODE_EXIT (ENTITY)
+ If this macro is defined, it is evaluated for every ENTITY that
+ needs mode switching. It should evaluate to an integer, which is
+ a mode that ENTITY is assumed to be switched to at function exit.
+ If `MODE_EXIT' is defined then `MODE_ENTRY' must be defined.
+
+ -- Macro: MODE_PRIORITY_TO_MODE (ENTITY, N)
+ This macro specifies the order in which modes for ENTITY are
+ processed. 0 is the highest priority,
+ `NUM_MODES_FOR_MODE_SWITCHING[ENTITY] - 1' the lowest. The value
+ of the macro should be an integer designating a mode for ENTITY.
+ For any fixed ENTITY, `mode_priority_to_mode' (ENTITY, N) shall be
+ a bijection in 0 ... `num_modes_for_mode_switching[ENTITY] - 1'.
+
+ -- Macro: EMIT_MODE_SET (ENTITY, MODE, HARD_REGS_LIVE)
+ Generate one or more insns to set ENTITY to MODE. HARD_REG_LIVE
+ is the set of hard registers live at the point where the insn(s)
+ are to be inserted.
+
+
+File: gccint.info, Node: Target Attributes, Next: Emulated TLS, Prev: Mode Switching, Up: Target Macros
+
+17.25 Defining target-specific uses of `__attribute__'
+======================================================
+
+Target-specific attributes may be defined for functions, data and types.
+These are described using the following target hooks; they also need to
+be documented in `extend.texi'.
+
+ -- Target Hook: const struct attribute_spec * TARGET_ATTRIBUTE_TABLE
+ If defined, this target hook points to an array of `struct
+ attribute_spec' (defined in `tree.h') specifying the machine
+ specific attributes for this target and some of the restrictions
+ on the entities to which these attributes are applied and the
+ arguments they take.
+
+ -- Target Hook: int TARGET_COMP_TYPE_ATTRIBUTES (tree TYPE1, tree
+ TYPE2)
+ If defined, this target hook is a function which returns zero if
+ the attributes on TYPE1 and TYPE2 are incompatible, one if they
+ are compatible, and two if they are nearly compatible (which
+ causes a warning to be generated). If this is not defined,
+ machine-specific attributes are supposed always to be compatible.
+
+ -- Target Hook: void TARGET_SET_DEFAULT_TYPE_ATTRIBUTES (tree TYPE)
+ If defined, this target hook is a function which assigns default
+ attributes to newly defined TYPE.
+
+ -- Target Hook: tree TARGET_MERGE_TYPE_ATTRIBUTES (tree TYPE1, tree
+ TYPE2)
+ Define this target hook if the merging of type attributes needs
+ special handling. If defined, the result is a list of the combined
+ `TYPE_ATTRIBUTES' of TYPE1 and TYPE2. It is assumed that
+ `comptypes' has already been called and returned 1. This function
+ may call `merge_attributes' to handle machine-independent merging.
+
+ -- Target Hook: tree TARGET_MERGE_DECL_ATTRIBUTES (tree OLDDECL, tree
+ NEWDECL)
+ Define this target hook if the merging of decl attributes needs
+ special handling. If defined, the result is a list of the combined
+ `DECL_ATTRIBUTES' of OLDDECL and NEWDECL. NEWDECL is a duplicate
+ declaration of OLDDECL. Examples of when this is needed are when
+ one attribute overrides another, or when an attribute is nullified
+ by a subsequent definition. This function may call
+ `merge_attributes' to handle machine-independent merging.
+
+ If the only target-specific handling you require is `dllimport'
+ for Microsoft Windows targets, you should define the macro
+ `TARGET_DLLIMPORT_DECL_ATTRIBUTES' to `1'. The compiler will then
+ define a function called `merge_dllimport_decl_attributes' which
+ can then be defined as the expansion of
+ `TARGET_MERGE_DECL_ATTRIBUTES'. You can also add
+ `handle_dll_attribute' in the attribute table for your port to
+ perform initial processing of the `dllimport' and `dllexport'
+ attributes. This is done in `i386/cygwin.h' and `i386/i386.c',
+ for example.
+
+ -- Target Hook: bool TARGET_VALID_DLLIMPORT_ATTRIBUTE_P (tree DECL)
+ DECL is a variable or function with `__attribute__((dllimport))'
+ specified. Use this hook if the target needs to add extra
+ validation checks to `handle_dll_attribute'.
+
+ -- Macro: TARGET_DECLSPEC
+ Define this macro to a nonzero value if you want to treat
+ `__declspec(X)' as equivalent to `__attribute((X))'. By default,
+ this behavior is enabled only for targets that define
+ `TARGET_DLLIMPORT_DECL_ATTRIBUTES'. The current implementation of
+ `__declspec' is via a built-in macro, but you should not rely on
+ this implementation detail.
+
+ -- Target Hook: void TARGET_INSERT_ATTRIBUTES (tree NODE, tree
+ *ATTR_PTR)
+ Define this target hook if you want to be able to add attributes
+ to a decl when it is being created. This is normally useful for
+ back ends which wish to implement a pragma by using the attributes
+ which correspond to the pragma's effect. The NODE argument is the
+ decl which is being created. The ATTR_PTR argument is a pointer
+ to the attribute list for this decl. The list itself should not
+ be modified, since it may be shared with other decls, but
+ attributes may be chained on the head of the list and `*ATTR_PTR'
+ modified to point to the new attributes, or a copy of the list may
+ be made if further changes are needed.
+
+ -- Target Hook: bool TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P (tree
+ FNDECL)
+ This target hook returns `true' if it is ok to inline FNDECL into
+ the current function, despite its having target-specific
+ attributes, `false' otherwise. By default, if a function has a
+ target specific attribute attached to it, it will not be inlined.
+
+ -- Target Hook: bool TARGET_VALID_OPTION_ATTRIBUTE_P (tree FNDECL,
+ tree NAME, tree ARGS, int FLAGS)
+ This hook is called to parse the `attribute(option("..."))', and
+ it allows the function to set different target machine compile time
+ options for the current function that might be different than the
+ options specified on the command line. The hook should return
+ `true' if the options are valid.
+
+ The hook should set the DECL_FUNCTION_SPECIFIC_TARGET field in the
+ function declaration to hold a pointer to a target specific STRUCT
+ CL_TARGET_OPTION structure.
+
+ -- Target Hook: void TARGET_OPTION_SAVE (struct cl_target_option *PTR)
+ This hook is called to save any additional target specific
+ information in the STRUCT CL_TARGET_OPTION structure for function
+ specific options. *Note Option file format::.
+
+ -- Target Hook: void TARGET_OPTION_RESTORE (struct cl_target_option
+ *PTR)
+ This hook is called to restore any additional target specific
+ information in the STRUCT CL_TARGET_OPTION structure for function
+ specific options.
+
+ -- Target Hook: void TARGET_OPTION_PRINT (struct cl_target_option *PTR)
+ This hook is called to print any additional target specific
+ information in the STRUCT CL_TARGET_OPTION structure for function
+ specific options.
+
+ -- Target Hook: bool TARGET_OPTION_PRAGMA_PARSE (target ARGS)
+ This target hook parses the options for `#pragma GCC option' to
+ set the machine specific options for functions that occur later in
+ the input stream. The options should be the same as handled by the
+ `TARGET_VALID_OPTION_ATTRIBUTE_P' hook.
+
+ -- Target Hook: bool TARGET_CAN_INLINE_P (tree CALLER, tree CALLEE)
+ This target hook returns `false' if the CALLER function cannot
+ inline CALLEE, based on target specific information. By default,
+ inlining is not allowed if the callee function has function
+ specific target options and the caller does not use the same
+ options.
+
+
+File: gccint.info, Node: Emulated TLS, Next: MIPS Coprocessors, Prev: Target Attributes, Up: Target Macros
+
+17.26 Emulating TLS
+===================
+
+For targets whose psABI does not provide Thread Local Storage via
+specific relocations and instruction sequences, an emulation layer is
+used. A set of target hooks allows this emulation layer to be
+configured for the requirements of a particular target. For instance
+the psABI may in fact specify TLS support in terms of an emulation
+layer.
+
+ The emulation layer works by creating a control object for every TLS
+object. To access the TLS object, a lookup function is provided which,
+when given the address of the control object, will return the address
+of the current thread's instance of the TLS object.
+
+ -- Target Hook: const char * TARGET_EMUTLS_GET_ADDRESS
+ Contains the name of the helper function that uses a TLS control
+ object to locate a TLS instance. The default causes libgcc's
+ emulated TLS helper function to be used.
+
+ -- Target Hook: const char * TARGET_EMUTLS_REGISTER_COMMON
+ Contains the name of the helper function that should be used at
+ program startup to register TLS objects that are implicitly
+ initialized to zero. If this is `NULL', all TLS objects will have
+ explicit initializers. The default causes libgcc's emulated TLS
+ registration function to be used.
+
+ -- Target Hook: const char * TARGET_EMUTLS_VAR_SECTION
+ Contains the name of the section in which TLS control variables
+ should be placed. The default of `NULL' allows these to be placed
+ in any section.
+
+ -- Target Hook: const char * TARGET_EMUTLS_TMPL_SECTION
+ Contains the name of the section in which TLS initializers should
+ be placed. The default of `NULL' allows these to be placed in any
+ section.
+
+ -- Target Hook: const char * TARGET_EMUTLS_VAR_PREFIX
+ Contains the prefix to be prepended to TLS control variable names.
+ The default of `NULL' uses a target-specific prefix.
+
+ -- Target Hook: const char * TARGET_EMUTLS_TMPL_PREFIX
+ Contains the prefix to be prepended to TLS initializer objects.
+ The default of `NULL' uses a target-specific prefix.
+
+ -- Target Hook: tree TARGET_EMUTLS_VAR_FIELDS (tree TYPE, tree *NAME)
+ Specifies a function that generates the FIELD_DECLs for a TLS
+ control object type. TYPE is the RECORD_TYPE the fields are for
+ and NAME should be filled with the structure tag, if the default of
+ `__emutls_object' is unsuitable. The default creates a type
+ suitable for libgcc's emulated TLS function.
+
+ -- Target Hook: tree TARGET_EMUTLS_VAR_INIT (tree VAR, tree DECL, tree
+ TMPL_ADDR)
+ Specifies a function that generates the CONSTRUCTOR to initialize a
+ TLS control object. VAR is the TLS control object, DECL is the
+ TLS object and TMPL_ADDR is the address of the initializer. The
+ default initializes libgcc's emulated TLS control object.
+
+ -- Target Hook: bool TARGET_EMUTLS_VAR_ALIGN_FIXED
+ Specifies whether the alignment of TLS control variable objects is
+ fixed and should not be increased as some backends may do to
+ optimize single objects. The default is false.
+
+ -- Target Hook: bool TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS
+ Specifies whether a DWARF `DW_OP_form_tls_address' location
+ descriptor may be used to describe emulated TLS control objects.
+
+
+File: gccint.info, Node: MIPS Coprocessors, Next: PCH Target, Prev: Emulated TLS, Up: Target Macros
+
+17.27 Defining coprocessor specifics for MIPS targets.
+======================================================
+
+The MIPS specification allows MIPS implementations to have as many as 4
+coprocessors, each with as many as 32 private registers. GCC supports
+accessing these registers and transferring values between the registers
+and memory using asm-ized variables. For example:
+
+ register unsigned int cp0count asm ("c0r1");
+ unsigned int d;
+
+ d = cp0count + 3;
+
+ ("c0r1" is the default name of register 1 in coprocessor 0; alternate
+names may be added as described below, or the default names may be
+overridden entirely in `SUBTARGET_CONDITIONAL_REGISTER_USAGE'.)
+
+ Coprocessor registers are assumed to be epilogue-used; sets to them
+will be preserved even if it does not appear that the register is used
+again later in the function.
+
+ Another note: according to the MIPS spec, coprocessor 1 (if present) is
+the FPU. One accesses COP1 registers through standard mips
+floating-point support; they are not included in this mechanism.
+
+ There is one macro used in defining the MIPS coprocessor interface
+which you may want to override in subtargets; it is described below.
+
+ -- Macro: ALL_COP_ADDITIONAL_REGISTER_NAMES
+ A comma-separated list (with leading comma) of pairs describing the
+ alternate names of coprocessor registers. The format of each
+ entry should be
+ { ALTERNATENAME, REGISTER_NUMBER}
+ Default: empty.
+
+
+File: gccint.info, Node: PCH Target, Next: C++ ABI, Prev: MIPS Coprocessors, Up: Target Macros
+
+17.28 Parameters for Precompiled Header Validity Checking
+=========================================================
+
+ -- Target Hook: void *TARGET_GET_PCH_VALIDITY (size_t *SZ)
+ This hook returns the data needed by `TARGET_PCH_VALID_P' and sets
+ `*SZ' to the size of the data in bytes.
+
+ -- Target Hook: const char *TARGET_PCH_VALID_P (const void *DATA,
+ size_t SZ)
+ This hook checks whether the options used to create a PCH file are
+ compatible with the current settings. It returns `NULL' if so and
+ a suitable error message if not. Error messages will be presented
+ to the user and must be localized using `_(MSG)'.
+
+ DATA is the data that was returned by `TARGET_GET_PCH_VALIDITY'
+ when the PCH file was created and SZ is the size of that data in
+ bytes. It's safe to assume that the data was created by the same
+ version of the compiler, so no format checking is needed.
+
+ The default definition of `default_pch_valid_p' should be suitable
+ for most targets.
+
+ -- Target Hook: const char *TARGET_CHECK_PCH_TARGET_FLAGS (int
+ PCH_FLAGS)
+ If this hook is nonnull, the default implementation of
+ `TARGET_PCH_VALID_P' will use it to check for compatible values of
+ `target_flags'. PCH_FLAGS specifies the value that `target_flags'
+ had when the PCH file was created. The return value is the same
+ as for `TARGET_PCH_VALID_P'.
+
+
+File: gccint.info, Node: C++ ABI, Next: Misc, Prev: PCH Target, Up: Target Macros
+
+17.29 C++ ABI parameters
+========================
+
+ -- Target Hook: tree TARGET_CXX_GUARD_TYPE (void)
+ Define this hook to override the integer type used for guard
+ variables. These are used to implement one-time construction of
+ static objects. The default is long_long_integer_type_node.
+
+ -- Target Hook: bool TARGET_CXX_GUARD_MASK_BIT (void)
+ This hook determines how guard variables are used. It should
+ return `false' (the default) if first byte should be used. A
+ return value of `true' indicates the least significant bit should
+ be used.
+
+ -- Target Hook: tree TARGET_CXX_GET_COOKIE_SIZE (tree TYPE)
+ This hook returns the size of the cookie to use when allocating an
+ array whose elements have the indicated TYPE. Assumes that it is
+ already known that a cookie is needed. The default is `max(sizeof
+ (size_t), alignof(type))', as defined in section 2.7 of the
+ IA64/Generic C++ ABI.
+
+ -- Target Hook: bool TARGET_CXX_COOKIE_HAS_SIZE (void)
+ This hook should return `true' if the element size should be
+ stored in array cookies. The default is to return `false'.
+
+ -- Target Hook: int TARGET_CXX_IMPORT_EXPORT_CLASS (tree TYPE, int
+ IMPORT_EXPORT)
+ If defined by a backend this hook allows the decision made to
+ export class TYPE to be overruled. Upon entry IMPORT_EXPORT will
+ contain 1 if the class is going to be exported, -1 if it is going
+ to be imported and 0 otherwise. This function should return the
+ modified value and perform any other actions necessary to support
+ the backend's targeted operating system.
+
+ -- Target Hook: bool TARGET_CXX_CDTOR_RETURNS_THIS (void)
+ This hook should return `true' if constructors and destructors
+ return the address of the object created/destroyed. The default
+ is to return `false'.
+
+ -- Target Hook: bool TARGET_CXX_KEY_METHOD_MAY_BE_INLINE (void)
+ This hook returns true if the key method for a class (i.e., the
+ method which, if defined in the current translation unit, causes
+ the virtual table to be emitted) may be an inline function. Under
+ the standard Itanium C++ ABI the key method may be an inline
+ function so long as the function is not declared inline in the
+ class definition. Under some variants of the ABI, an inline
+ function can never be the key method. The default is to return
+ `true'.
+
+ -- Target Hook: void TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY (tree
+ DECL)
+ DECL is a virtual table, virtual table table, typeinfo object, or
+ other similar implicit class data object that will be emitted with
+ external linkage in this translation unit. No ELF visibility has
+ been explicitly specified. If the target needs to specify a
+ visibility other than that of the containing class, use this hook
+ to set `DECL_VISIBILITY' and `DECL_VISIBILITY_SPECIFIED'.
+
+ -- Target Hook: bool TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT (void)
+ This hook returns true (the default) if virtual tables and other
+ similar implicit class data objects are always COMDAT if they have
+ external linkage. If this hook returns false, then class data for
+ classes whose virtual table will be emitted in only one translation
+ unit will not be COMDAT.
+
+ -- Target Hook: bool TARGET_CXX_LIBRARY_RTTI_COMDAT (void)
+ This hook returns true (the default) if the RTTI information for
+ the basic types which is defined in the C++ runtime should always
+ be COMDAT, false if it should not be COMDAT.
+
+ -- Target Hook: bool TARGET_CXX_USE_AEABI_ATEXIT (void)
+ This hook returns true if `__aeabi_atexit' (as defined by the ARM
+ EABI) should be used to register static destructors when
+ `-fuse-cxa-atexit' is in effect. The default is to return false
+ to use `__cxa_atexit'.
+
+ -- Target Hook: bool TARGET_CXX_USE_ATEXIT_FOR_CXA_ATEXIT (void)
+ This hook returns true if the target `atexit' function can be used
+ in the same manner as `__cxa_atexit' to register C++ static
+ destructors. This requires that `atexit'-registered functions in
+ shared libraries are run in the correct order when the libraries
+ are unloaded. The default is to return false.
+
+ -- Target Hook: void TARGET_CXX_ADJUST_CLASS_AT_DEFINITION (tree TYPE)
+ TYPE is a C++ class (i.e., RECORD_TYPE or UNION_TYPE) that has
+ just been defined. Use this hook to make adjustments to the class
+ (eg, tweak visibility or perform any other required target
+ modifications).
+
+
+File: gccint.info, Node: Misc, Prev: C++ ABI, Up: Target Macros
+
+17.30 Miscellaneous Parameters
+==============================
+
+Here are several miscellaneous parameters.
+
+ -- Macro: HAS_LONG_COND_BRANCH
+ Define this boolean macro to indicate whether or not your
+ architecture has conditional branches that can span all of memory.
+ It is used in conjunction with an optimization that partitions
+ hot and cold basic blocks into separate sections of the
+ executable. If this macro is set to false, gcc will convert any
+ conditional branches that attempt to cross between sections into
+ unconditional branches or indirect jumps.
+
+ -- Macro: HAS_LONG_UNCOND_BRANCH
+ Define this boolean macro to indicate whether or not your
+ architecture has unconditional branches that can span all of
+ memory. It is used in conjunction with an optimization that
+ partitions hot and cold basic blocks into separate sections of the
+ executable. If this macro is set to false, gcc will convert any
+ unconditional branches that attempt to cross between sections into
+ indirect jumps.
+
+ -- Macro: CASE_VECTOR_MODE
+ An alias for a machine mode name. This is the machine mode that
+ elements of a jump-table should have.
+
+ -- Macro: CASE_VECTOR_SHORTEN_MODE (MIN_OFFSET, MAX_OFFSET, BODY)
+ Optional: return the preferred mode for an `addr_diff_vec' when
+ the minimum and maximum offset are known. If you define this, it
+ enables extra code in branch shortening to deal with
+ `addr_diff_vec'. To make this work, you also have to define
+ `INSN_ALIGN' and make the alignment for `addr_diff_vec' explicit.
+ The BODY argument is provided so that the offset_unsigned and scale
+ flags can be updated.
+
+ -- Macro: CASE_VECTOR_PC_RELATIVE
+ Define this macro to be a C expression to indicate when jump-tables
+ should contain relative addresses. You need not define this macro
+ if jump-tables never contain relative addresses, or jump-tables
+ should contain relative addresses only when `-fPIC' or `-fPIC' is
+ in effect.
+
+ -- Macro: CASE_VALUES_THRESHOLD
+ Define this to be the smallest number of different values for
+ which it is best to use a jump-table instead of a tree of
+ conditional branches. The default is four for machines with a
+ `casesi' instruction and five otherwise. This is best for most
+ machines.
+
+ -- Macro: CASE_USE_BIT_TESTS
+ Define this macro to be a C expression to indicate whether C switch
+ statements may be implemented by a sequence of bit tests. This is
+ advantageous on processors that can efficiently implement left
+ shift of 1 by the number of bits held in a register, but
+ inappropriate on targets that would require a loop. By default,
+ this macro returns `true' if the target defines an `ashlsi3'
+ pattern, and `false' otherwise.
+
+ -- Macro: WORD_REGISTER_OPERATIONS
+ Define this macro if operations between registers with integral
+ mode smaller than a word are always performed on the entire
+ register. Most RISC machines have this property and most CISC
+ machines do not.
+
+ -- Macro: LOAD_EXTEND_OP (MEM_MODE)
+ Define this macro to be a C expression indicating when insns that
+ read memory in MEM_MODE, an integral mode narrower than a word,
+ set the bits outside of MEM_MODE to be either the sign-extension
+ or the zero-extension of the data read. Return `SIGN_EXTEND' for
+ values of MEM_MODE for which the insn sign-extends, `ZERO_EXTEND'
+ for which it zero-extends, and `UNKNOWN' for other modes.
+
+ This macro is not called with MEM_MODE non-integral or with a width
+ greater than or equal to `BITS_PER_WORD', so you may return any
+ value in this case. Do not define this macro if it would always
+ return `UNKNOWN'. On machines where this macro is defined, you
+ will normally define it as the constant `SIGN_EXTEND' or
+ `ZERO_EXTEND'.
+
+ You may return a non-`UNKNOWN' value even if for some hard
+ registers the sign extension is not performed, if for the
+ `REGNO_REG_CLASS' of these hard registers
+ `CANNOT_CHANGE_MODE_CLASS' returns nonzero when the FROM mode is
+ MEM_MODE and the TO mode is any integral mode larger than this but
+ not larger than `word_mode'.
+
+ You must return `UNKNOWN' if for some hard registers that allow
+ this mode, `CANNOT_CHANGE_MODE_CLASS' says that they cannot change
+ to `word_mode', but that they can change to another integral mode
+ that is larger then MEM_MODE but still smaller than `word_mode'.
+
+ -- Macro: SHORT_IMMEDIATES_SIGN_EXTEND
+ Define this macro if loading short immediate values into registers
+ sign extends.
+
+ -- Macro: FIXUNS_TRUNC_LIKE_FIX_TRUNC
+ Define this macro if the same instructions that convert a floating
+ point number to a signed fixed point number also convert validly
+ to an unsigned one.
+
+ -- Target Hook: int TARGET_MIN_DIVISIONS_FOR_RECIP_MUL (enum
+ machine_mode MODE)
+ When `-ffast-math' is in effect, GCC tries to optimize divisions
+ by the same divisor, by turning them into multiplications by the
+ reciprocal. This target hook specifies the minimum number of
+ divisions that should be there for GCC to perform the optimization
+ for a variable of mode MODE. The default implementation returns 3
+ if the machine has an instruction for the division, and 2 if it
+ does not.
+
+ -- Macro: MOVE_MAX
+ The maximum number of bytes that a single instruction can move
+ quickly between memory and registers or between two memory
+ locations.
+
+ -- Macro: MAX_MOVE_MAX
+ The maximum number of bytes that a single instruction can move
+ quickly between memory and registers or between two memory
+ locations. If this is undefined, the default is `MOVE_MAX'.
+ Otherwise, it is the constant value that is the largest value that
+ `MOVE_MAX' can have at run-time.
+
+ -- Macro: SHIFT_COUNT_TRUNCATED
+ A C expression that is nonzero if on this machine the number of
+ bits actually used for the count of a shift operation is equal to
+ the number of bits needed to represent the size of the object
+ being shifted. When this macro is nonzero, the compiler will
+ assume that it is safe to omit a sign-extend, zero-extend, and
+ certain bitwise `and' instructions that truncates the count of a
+ shift operation. On machines that have instructions that act on
+ bit-fields at variable positions, which may include `bit test'
+ instructions, a nonzero `SHIFT_COUNT_TRUNCATED' also enables
+ deletion of truncations of the values that serve as arguments to
+ bit-field instructions.
+
+ If both types of instructions truncate the count (for shifts) and
+ position (for bit-field operations), or if no variable-position
+ bit-field instructions exist, you should define this macro.
+
+ However, on some machines, such as the 80386 and the 680x0,
+ truncation only applies to shift operations and not the (real or
+ pretended) bit-field operations. Define `SHIFT_COUNT_TRUNCATED'
+ to be zero on such machines. Instead, add patterns to the `md'
+ file that include the implied truncation of the shift instructions.
+
+ You need not define this macro if it would always have the value
+ of zero.
+
+ -- Target Hook: int TARGET_SHIFT_TRUNCATION_MASK (enum machine_mode
+ MODE)
+ This function describes how the standard shift patterns for MODE
+ deal with shifts by negative amounts or by more than the width of
+ the mode. *Note shift patterns::.
+
+ On many machines, the shift patterns will apply a mask M to the
+ shift count, meaning that a fixed-width shift of X by Y is
+ equivalent to an arbitrary-width shift of X by Y & M. If this is
+ true for mode MODE, the function should return M, otherwise it
+ should return 0. A return value of 0 indicates that no particular
+ behavior is guaranteed.
+
+ Note that, unlike `SHIFT_COUNT_TRUNCATED', this function does
+ _not_ apply to general shift rtxes; it applies only to instructions
+ that are generated by the named shift patterns.
+
+ The default implementation of this function returns
+ `GET_MODE_BITSIZE (MODE) - 1' if `SHIFT_COUNT_TRUNCATED' and 0
+ otherwise. This definition is always safe, but if
+ `SHIFT_COUNT_TRUNCATED' is false, and some shift patterns
+ nevertheless truncate the shift count, you may get better code by
+ overriding it.
+
+ -- Macro: TRULY_NOOP_TRUNCATION (OUTPREC, INPREC)
+ A C expression which is nonzero if on this machine it is safe to
+ "convert" an integer of INPREC bits to one of OUTPREC bits (where
+ OUTPREC is smaller than INPREC) by merely operating on it as if it
+ had only OUTPREC bits.
+
+ On many machines, this expression can be 1.
+
+ When `TRULY_NOOP_TRUNCATION' returns 1 for a pair of sizes for
+ modes for which `MODES_TIEABLE_P' is 0, suboptimal code can result.
+ If this is the case, making `TRULY_NOOP_TRUNCATION' return 0 in
+ such cases may improve things.
+
+ -- Target Hook: int TARGET_MODE_REP_EXTENDED (enum machine_mode MODE,
+ enum machine_mode REP_MODE)
+ The representation of an integral mode can be such that the values
+ are always extended to a wider integral mode. Return
+ `SIGN_EXTEND' if values of MODE are represented in sign-extended
+ form to REP_MODE. Return `UNKNOWN' otherwise. (Currently, none
+ of the targets use zero-extended representation this way so unlike
+ `LOAD_EXTEND_OP', `TARGET_MODE_REP_EXTENDED' is expected to return
+ either `SIGN_EXTEND' or `UNKNOWN'. Also no target extends MODE to
+ MODE_REP so that MODE_REP is not the next widest integral mode and
+ currently we take advantage of this fact.)
+
+ Similarly to `LOAD_EXTEND_OP' you may return a non-`UNKNOWN' value
+ even if the extension is not performed on certain hard registers
+ as long as for the `REGNO_REG_CLASS' of these hard registers
+ `CANNOT_CHANGE_MODE_CLASS' returns nonzero.
+
+ Note that `TARGET_MODE_REP_EXTENDED' and `LOAD_EXTEND_OP' describe
+ two related properties. If you define `TARGET_MODE_REP_EXTENDED
+ (mode, word_mode)' you probably also want to define
+ `LOAD_EXTEND_OP (mode)' to return the same type of extension.
+
+ In order to enforce the representation of `mode',
+ `TRULY_NOOP_TRUNCATION' should return false when truncating to
+ `mode'.
+
+ -- Macro: STORE_FLAG_VALUE
+ A C expression describing the value returned by a comparison
+ operator with an integral mode and stored by a store-flag
+ instruction (`sCOND') when the condition is true. This
+ description must apply to _all_ the `sCOND' patterns and all the
+ comparison operators whose results have a `MODE_INT' mode.
+
+ A value of 1 or -1 means that the instruction implementing the
+ comparison operator returns exactly 1 or -1 when the comparison is
+ true and 0 when the comparison is false. Otherwise, the value
+ indicates which bits of the result are guaranteed to be 1 when the
+ comparison is true. This value is interpreted in the mode of the
+ comparison operation, which is given by the mode of the first
+ operand in the `sCOND' pattern. Either the low bit or the sign
+ bit of `STORE_FLAG_VALUE' be on. Presently, only those bits are
+ used by the compiler.
+
+ If `STORE_FLAG_VALUE' is neither 1 or -1, the compiler will
+ generate code that depends only on the specified bits. It can also
+ replace comparison operators with equivalent operations if they
+ cause the required bits to be set, even if the remaining bits are
+ undefined. For example, on a machine whose comparison operators
+ return an `SImode' value and where `STORE_FLAG_VALUE' is defined as
+ `0x80000000', saying that just the sign bit is relevant, the
+ expression
+
+ (ne:SI (and:SI X (const_int POWER-OF-2)) (const_int 0))
+
+ can be converted to
+
+ (ashift:SI X (const_int N))
+
+ where N is the appropriate shift count to move the bit being
+ tested into the sign bit.
+
+ There is no way to describe a machine that always sets the
+ low-order bit for a true value, but does not guarantee the value
+ of any other bits, but we do not know of any machine that has such
+ an instruction. If you are trying to port GCC to such a machine,
+ include an instruction to perform a logical-and of the result with
+ 1 in the pattern for the comparison operators and let us know at
+ <gcc@gcc.gnu.org>.
+
+ Often, a machine will have multiple instructions that obtain a
+ value from a comparison (or the condition codes). Here are rules
+ to guide the choice of value for `STORE_FLAG_VALUE', and hence the
+ instructions to be used:
+
+ * Use the shortest sequence that yields a valid definition for
+ `STORE_FLAG_VALUE'. It is more efficient for the compiler to
+ "normalize" the value (convert it to, e.g., 1 or 0) than for
+ the comparison operators to do so because there may be
+ opportunities to combine the normalization with other
+ operations.
+
+ * For equal-length sequences, use a value of 1 or -1, with -1
+ being slightly preferred on machines with expensive jumps and
+ 1 preferred on other machines.
+
+ * As a second choice, choose a value of `0x80000001' if
+ instructions exist that set both the sign and low-order bits
+ but do not define the others.
+
+ * Otherwise, use a value of `0x80000000'.
+
+ Many machines can produce both the value chosen for
+ `STORE_FLAG_VALUE' and its negation in the same number of
+ instructions. On those machines, you should also define a pattern
+ for those cases, e.g., one matching
+
+ (set A (neg:M (ne:M B C)))
+
+ Some machines can also perform `and' or `plus' operations on
+ condition code values with less instructions than the corresponding
+ `sCOND' insn followed by `and' or `plus'. On those machines,
+ define the appropriate patterns. Use the names `incscc' and
+ `decscc', respectively, for the patterns which perform `plus' or
+ `minus' operations on condition code values. See `rs6000.md' for
+ some examples. The GNU Superoptizer can be used to find such
+ instruction sequences on other machines.
+
+ If this macro is not defined, the default value, 1, is used. You
+ need not define `STORE_FLAG_VALUE' if the machine has no store-flag
+ instructions, or if the value generated by these instructions is 1.
+
+ -- Macro: FLOAT_STORE_FLAG_VALUE (MODE)
+ A C expression that gives a nonzero `REAL_VALUE_TYPE' value that is
+ returned when comparison operators with floating-point results are
+ true. Define this macro on machines that have comparison
+ operations that return floating-point values. If there are no
+ such operations, do not define this macro.
+
+ -- Macro: VECTOR_STORE_FLAG_VALUE (MODE)
+ A C expression that gives a rtx representing the nonzero true
+ element for vector comparisons. The returned rtx should be valid
+ for the inner mode of MODE which is guaranteed to be a vector
+ mode. Define this macro on machines that have vector comparison
+ operations that return a vector result. If there are no such
+ operations, do not define this macro. Typically, this macro is
+ defined as `const1_rtx' or `constm1_rtx'. This macro may return
+ `NULL_RTX' to prevent the compiler optimizing such vector
+ comparison operations for the given mode.
+
+ -- Macro: CLZ_DEFINED_VALUE_AT_ZERO (MODE, VALUE)
+ -- Macro: CTZ_DEFINED_VALUE_AT_ZERO (MODE, VALUE)
+ A C expression that indicates whether the architecture defines a
+ value for `clz' or `ctz' with a zero operand. A result of `0'
+ indicates the value is undefined. If the value is defined for
+ only the RTL expression, the macro should evaluate to `1'; if the
+ value applies also to the corresponding optab entry (which is
+ normally the case if it expands directly into the corresponding
+ RTL), then the macro should evaluate to `2'. In the cases where
+ the value is defined, VALUE should be set to this value.
+
+ If this macro is not defined, the value of `clz' or `ctz' at zero
+ is assumed to be undefined.
+
+ This macro must be defined if the target's expansion for `ffs'
+ relies on a particular value to get correct results. Otherwise it
+ is not necessary, though it may be used to optimize some corner
+ cases, and to provide a default expansion for the `ffs' optab.
+
+ Note that regardless of this macro the "definedness" of `clz' and
+ `ctz' at zero do _not_ extend to the builtin functions visible to
+ the user. Thus one may be free to adjust the value at will to
+ match the target expansion of these operations without fear of
+ breaking the API.
+
+ -- Macro: Pmode
+ An alias for the machine mode for pointers. On most machines,
+ define this to be the integer mode corresponding to the width of a
+ hardware pointer; `SImode' on 32-bit machine or `DImode' on 64-bit
+ machines. On some machines you must define this to be one of the
+ partial integer modes, such as `PSImode'.
+
+ The width of `Pmode' must be at least as large as the value of
+ `POINTER_SIZE'. If it is not equal, you must define the macro
+ `POINTERS_EXTEND_UNSIGNED' to specify how pointers are extended to
+ `Pmode'.
+
+ -- Macro: FUNCTION_MODE
+ An alias for the machine mode used for memory references to
+ functions being called, in `call' RTL expressions. On most CISC
+ machines, where an instruction can begin at any byte address, this
+ should be `QImode'. On most RISC machines, where all instructions
+ have fixed size and alignment, this should be a mode with the same
+ size and alignment as the machine instruction words - typically
+ `SImode' or `HImode'.
+
+ -- Macro: STDC_0_IN_SYSTEM_HEADERS
+ In normal operation, the preprocessor expands `__STDC__' to the
+ constant 1, to signify that GCC conforms to ISO Standard C. On
+ some hosts, like Solaris, the system compiler uses a different
+ convention, where `__STDC__' is normally 0, but is 1 if the user
+ specifies strict conformance to the C Standard.
+
+ Defining `STDC_0_IN_SYSTEM_HEADERS' makes GNU CPP follows the host
+ convention when processing system header files, but when
+ processing user files `__STDC__' will always expand to 1.
+
+ -- Macro: NO_IMPLICIT_EXTERN_C
+ Define this macro if the system header files support C++ as well
+ as C. This macro inhibits the usual method of using system header
+ files in C++, which is to pretend that the file's contents are
+ enclosed in `extern "C" {...}'.
+
+ -- Macro: REGISTER_TARGET_PRAGMAS ()
+ Define this macro if you want to implement any target-specific
+ pragmas. If defined, it is a C expression which makes a series of
+ calls to `c_register_pragma' or `c_register_pragma_with_expansion'
+ for each pragma. The macro may also do any setup required for the
+ pragmas.
+
+ The primary reason to define this macro is to provide
+ compatibility with other compilers for the same target. In
+ general, we discourage definition of target-specific pragmas for
+ GCC.
+
+ If the pragma can be implemented by attributes then you should
+ consider defining the target hook `TARGET_INSERT_ATTRIBUTES' as
+ well.
+
+ Preprocessor macros that appear on pragma lines are not expanded.
+ All `#pragma' directives that do not match any registered pragma
+ are silently ignored, unless the user specifies
+ `-Wunknown-pragmas'.
+
+ -- Function: void c_register_pragma (const char *SPACE, const char
+ *NAME, void (*CALLBACK) (struct cpp_reader *))
+ -- Function: void c_register_pragma_with_expansion (const char *SPACE,
+ const char *NAME, void (*CALLBACK) (struct cpp_reader *))
+ Each call to `c_register_pragma' or
+ `c_register_pragma_with_expansion' establishes one pragma. The
+ CALLBACK routine will be called when the preprocessor encounters a
+ pragma of the form
+
+ #pragma [SPACE] NAME ...
+
+ SPACE is the case-sensitive namespace of the pragma, or `NULL' to
+ put the pragma in the global namespace. The callback routine
+ receives PFILE as its first argument, which can be passed on to
+ cpplib's functions if necessary. You can lex tokens after the
+ NAME by calling `pragma_lex'. Tokens that are not read by the
+ callback will be silently ignored. The end of the line is
+ indicated by a token of type `CPP_EOF'. Macro expansion occurs on
+ the arguments of pragmas registered with
+ `c_register_pragma_with_expansion' but not on the arguments of
+ pragmas registered with `c_register_pragma'.
+
+ Note that the use of `pragma_lex' is specific to the C and C++
+ compilers. It will not work in the Java or Fortran compilers, or
+ any other language compilers for that matter. Thus if
+ `pragma_lex' is going to be called from target-specific code, it
+ must only be done so when building the C and C++ compilers. This
+ can be done by defining the variables `c_target_objs' and
+ `cxx_target_objs' in the target entry in the `config.gcc' file.
+ These variables should name the target-specific, language-specific
+ object file which contains the code that uses `pragma_lex'. Note
+ it will also be necessary to add a rule to the makefile fragment
+ pointed to by `tmake_file' that shows how to build this object
+ file.
+
+ -- Macro: HANDLE_SYSV_PRAGMA
+ Define this macro (to a value of 1) if you want the System V style
+ pragmas `#pragma pack(<n>)' and `#pragma weak <name> [=<value>]'
+ to be supported by gcc.
+
+ The pack pragma specifies the maximum alignment (in bytes) of
+ fields within a structure, in much the same way as the
+ `__aligned__' and `__packed__' `__attribute__'s do. A pack value
+ of zero resets the behavior to the default.
+
+ A subtlety for Microsoft Visual C/C++ style bit-field packing
+ (e.g. -mms-bitfields) for targets that support it: When a
+ bit-field is inserted into a packed record, the whole size of the
+ underlying type is used by one or more same-size adjacent
+ bit-fields (that is, if its long:3, 32 bits is used in the record,
+ and any additional adjacent long bit-fields are packed into the
+ same chunk of 32 bits. However, if the size changes, a new field
+ of that size is allocated).
+
+ If both MS bit-fields and `__attribute__((packed))' are used, the
+ latter will take precedence. If `__attribute__((packed))' is used
+ on a single field when MS bit-fields are in use, it will take
+ precedence for that field, but the alignment of the rest of the
+ structure may affect its placement.
+
+ The weak pragma only works if `SUPPORTS_WEAK' and
+ `ASM_WEAKEN_LABEL' are defined. If enabled it allows the creation
+ of specifically named weak labels, optionally with a value.
+
+ -- Macro: HANDLE_PRAGMA_PACK_PUSH_POP
+ Define this macro (to a value of 1) if you want to support the
+ Win32 style pragmas `#pragma pack(push[,N])' and `#pragma
+ pack(pop)'. The `pack(push,[N])' pragma specifies the maximum
+ alignment (in bytes) of fields within a structure, in much the
+ same way as the `__aligned__' and `__packed__' `__attribute__'s
+ do. A pack value of zero resets the behavior to the default.
+ Successive invocations of this pragma cause the previous values to
+ be stacked, so that invocations of `#pragma pack(pop)' will return
+ to the previous value.
+
+ -- Macro: HANDLE_PRAGMA_PACK_WITH_EXPANSION
+ Define this macro, as well as `HANDLE_SYSV_PRAGMA', if macros
+ should be expanded in the arguments of `#pragma pack'.
+
+ -- Macro: TARGET_DEFAULT_PACK_STRUCT
+ If your target requires a structure packing default other than 0
+ (meaning the machine default), define this macro to the necessary
+ value (in bytes). This must be a value that would also be valid
+ to use with `#pragma pack()' (that is, a small power of two).
+
+ -- Macro: HANDLE_PRAGMA_PUSH_POP_MACRO
+ Define this macro if you want to support the Win32 style pragmas
+ `#pragma push_macro(macro-name-as-string)' and `#pragma
+ pop_macro(macro-name-as-string)'. The `#pragma push_macro(
+ macro-name-as-string)' pragma saves the named macro and via
+ `#pragma pop_macro(macro-name-as-string)' it will return to the
+ previous value.
+
+ -- Macro: DOLLARS_IN_IDENTIFIERS
+ Define this macro to control use of the character `$' in
+ identifier names for the C family of languages. 0 means `$' is
+ not allowed by default; 1 means it is allowed. 1 is the default;
+ there is no need to define this macro in that case.
+
+ -- Macro: NO_DOLLAR_IN_LABEL
+ Define this macro if the assembler does not accept the character
+ `$' in label names. By default constructors and destructors in
+ G++ have `$' in the identifiers. If this macro is defined, `.' is
+ used instead.
+
+ -- Macro: NO_DOT_IN_LABEL
+ Define this macro if the assembler does not accept the character
+ `.' in label names. By default constructors and destructors in G++
+ have names that use `.'. If this macro is defined, these names
+ are rewritten to avoid `.'.
+
+ -- Macro: INSN_SETS_ARE_DELAYED (INSN)
+ Define this macro as a C expression that is nonzero if it is safe
+ for the delay slot scheduler to place instructions in the delay
+ slot of INSN, even if they appear to use a resource set or
+ clobbered in INSN. INSN is always a `jump_insn' or an `insn'; GCC
+ knows that every `call_insn' has this behavior. On machines where
+ some `insn' or `jump_insn' is really a function call and hence has
+ this behavior, you should define this macro.
+
+ You need not define this macro if it would always return zero.
+
+ -- Macro: INSN_REFERENCES_ARE_DELAYED (INSN)
+ Define this macro as a C expression that is nonzero if it is safe
+ for the delay slot scheduler to place instructions in the delay
+ slot of INSN, even if they appear to set or clobber a resource
+ referenced in INSN. INSN is always a `jump_insn' or an `insn'.
+ On machines where some `insn' or `jump_insn' is really a function
+ call and its operands are registers whose use is actually in the
+ subroutine it calls, you should define this macro. Doing so
+ allows the delay slot scheduler to move instructions which copy
+ arguments into the argument registers into the delay slot of INSN.
+
+ You need not define this macro if it would always return zero.
+
+ -- Macro: MULTIPLE_SYMBOL_SPACES
+ Define this macro as a C expression that is nonzero if, in some
+ cases, global symbols from one translation unit may not be bound
+ to undefined symbols in another translation unit without user
+ intervention. For instance, under Microsoft Windows symbols must
+ be explicitly imported from shared libraries (DLLs).
+
+ You need not define this macro if it would always evaluate to zero.
+
+ -- Target Hook: tree TARGET_MD_ASM_CLOBBERS (tree OUTPUTS, tree
+ INPUTS, tree CLOBBERS)
+ This target hook should add to CLOBBERS `STRING_CST' trees for any
+ hard regs the port wishes to automatically clobber for an asm. It
+ should return the result of the last `tree_cons' used to add a
+ clobber. The OUTPUTS, INPUTS and CLOBBER lists are the
+ corresponding parameters to the asm and may be inspected to avoid
+ clobbering a register that is an input or output of the asm. You
+ can use `tree_overlaps_hard_reg_set', declared in `tree.h', to test
+ for overlap with regards to asm-declared registers.
+
+ -- Macro: MATH_LIBRARY
+ Define this macro as a C string constant for the linker argument
+ to link in the system math library, or `""' if the target does not
+ have a separate math library.
+
+ You need only define this macro if the default of `"-lm"' is wrong.
+
+ -- Macro: LIBRARY_PATH_ENV
+ Define this macro as a C string constant for the environment
+ variable that specifies where the linker should look for libraries.
+
+ You need only define this macro if the default of `"LIBRARY_PATH"'
+ is wrong.
+
+ -- Macro: TARGET_POSIX_IO
+ Define this macro if the target supports the following POSIX file
+ functions, access, mkdir and file locking with fcntl / F_SETLKW.
+ Defining `TARGET_POSIX_IO' will enable the test coverage code to
+ use file locking when exiting a program, which avoids race
+ conditions if the program has forked. It will also create
+ directories at run-time for cross-profiling.
+
+ -- Macro: MAX_CONDITIONAL_EXECUTE
+ A C expression for the maximum number of instructions to execute
+ via conditional execution instructions instead of a branch. A
+ value of `BRANCH_COST'+1 is the default if the machine does not
+ use cc0, and 1 if it does use cc0.
+
+ -- Macro: IFCVT_MODIFY_TESTS (CE_INFO, TRUE_EXPR, FALSE_EXPR)
+ Used if the target needs to perform machine-dependent
+ modifications on the conditionals used for turning basic blocks
+ into conditionally executed code. CE_INFO points to a data
+ structure, `struct ce_if_block', which contains information about
+ the currently processed blocks. TRUE_EXPR and FALSE_EXPR are the
+ tests that are used for converting the then-block and the
+ else-block, respectively. Set either TRUE_EXPR or FALSE_EXPR to a
+ null pointer if the tests cannot be converted.
+
+ -- Macro: IFCVT_MODIFY_MULTIPLE_TESTS (CE_INFO, BB, TRUE_EXPR,
+ FALSE_EXPR)
+ Like `IFCVT_MODIFY_TESTS', but used when converting more
+ complicated if-statements into conditions combined by `and' and
+ `or' operations. BB contains the basic block that contains the
+ test that is currently being processed and about to be turned into
+ a condition.
+
+ -- Macro: IFCVT_MODIFY_INSN (CE_INFO, PATTERN, INSN)
+ A C expression to modify the PATTERN of an INSN that is to be
+ converted to conditional execution format. CE_INFO points to a
+ data structure, `struct ce_if_block', which contains information
+ about the currently processed blocks.
+
+ -- Macro: IFCVT_MODIFY_FINAL (CE_INFO)
+ A C expression to perform any final machine dependent
+ modifications in converting code to conditional execution. The
+ involved basic blocks can be found in the `struct ce_if_block'
+ structure that is pointed to by CE_INFO.
+
+ -- Macro: IFCVT_MODIFY_CANCEL (CE_INFO)
+ A C expression to cancel any machine dependent modifications in
+ converting code to conditional execution. The involved basic
+ blocks can be found in the `struct ce_if_block' structure that is
+ pointed to by CE_INFO.
+
+ -- Macro: IFCVT_INIT_EXTRA_FIELDS (CE_INFO)
+ A C expression to initialize any extra fields in a `struct
+ ce_if_block' structure, which are defined by the
+ `IFCVT_EXTRA_FIELDS' macro.
+
+ -- Macro: IFCVT_EXTRA_FIELDS
+ If defined, it should expand to a set of field declarations that
+ will be added to the `struct ce_if_block' structure. These should
+ be initialized by the `IFCVT_INIT_EXTRA_FIELDS' macro.
+
+ -- Target Hook: void TARGET_MACHINE_DEPENDENT_REORG ()
+ If non-null, this hook performs a target-specific pass over the
+ instruction stream. The compiler will run it at all optimization
+ levels, just before the point at which it normally does
+ delayed-branch scheduling.
+
+ The exact purpose of the hook varies from target to target. Some
+ use it to do transformations that are necessary for correctness,
+ such as laying out in-function constant pools or avoiding hardware
+ hazards. Others use it as an opportunity to do some
+ machine-dependent optimizations.
+
+ You need not implement the hook if it has nothing to do. The
+ default definition is null.
+
+ -- Target Hook: void TARGET_INIT_BUILTINS ()
+ Define this hook if you have any machine-specific built-in
+ functions that need to be defined. It should be a function that
+ performs the necessary setup.
+
+ Machine specific built-in functions can be useful to expand
+ special machine instructions that would otherwise not normally be
+ generated because they have no equivalent in the source language
+ (for example, SIMD vector instructions or prefetch instructions).
+
+ To create a built-in function, call the function
+ `lang_hooks.builtin_function' which is defined by the language
+ front end. You can use any type nodes set up by
+ `build_common_tree_nodes' and `build_common_tree_nodes_2'; only
+ language front ends that use those two functions will call
+ `TARGET_INIT_BUILTINS'.
+
+ -- Target Hook: rtx TARGET_EXPAND_BUILTIN (tree EXP, rtx TARGET, rtx
+ SUBTARGET, enum machine_mode MODE, int IGNORE)
+ Expand a call to a machine specific built-in function that was set
+ up by `TARGET_INIT_BUILTINS'. EXP is the expression for the
+ function call; the result should go to TARGET if that is
+ convenient, and have mode MODE if that is convenient. SUBTARGET
+ may be used as the target for computing one of EXP's operands.
+ IGNORE is nonzero if the value is to be ignored. This function
+ should return the result of the call to the built-in function.
+
+ -- Target Hook: tree TARGET_RESOLVE_OVERLOADED_BUILTIN (tree FNDECL,
+ tree ARGLIST)
+ Select a replacement for a machine specific built-in function that
+ was set up by `TARGET_INIT_BUILTINS'. This is done _before_
+ regular type checking, and so allows the target to implement a
+ crude form of function overloading. FNDECL is the declaration of
+ the built-in function. ARGLIST is the list of arguments passed to
+ the built-in function. The result is a complete expression that
+ implements the operation, usually another `CALL_EXPR'.
+
+ -- Target Hook: tree TARGET_FOLD_BUILTIN (tree FNDECL, tree ARGLIST,
+ bool IGNORE)
+ Fold a call to a machine specific built-in function that was set
+ up by `TARGET_INIT_BUILTINS'. FNDECL is the declaration of the
+ built-in function. ARGLIST is the list of arguments passed to the
+ built-in function. The result is another tree containing a
+ simplified expression for the call's result. If IGNORE is true
+ the value will be ignored.
+
+ -- Target Hook: const char * TARGET_INVALID_WITHIN_DOLOOP (rtx INSN)
+ Take an instruction in INSN and return NULL if it is valid within a
+ low-overhead loop, otherwise return a string why doloop could not
+ be applied.
+
+ Many targets use special registers for low-overhead looping. For
+ any instruction that clobbers these this function should return a
+ string indicating the reason why the doloop could not be applied.
+ By default, the RTL loop optimizer does not use a present doloop
+ pattern for loops containing function calls or branch on table
+ instructions.
+
+ -- Macro: MD_CAN_REDIRECT_BRANCH (BRANCH1, BRANCH2)
+ Take a branch insn in BRANCH1 and another in BRANCH2. Return true
+ if redirecting BRANCH1 to the destination of BRANCH2 is possible.
+
+ On some targets, branches may have a limited range. Optimizing the
+ filling of delay slots can result in branches being redirected,
+ and this may in turn cause a branch offset to overflow.
+
+ -- Target Hook: bool TARGET_COMMUTATIVE_P (rtx X, OUTER_CODE)
+ This target hook returns `true' if X is considered to be
+ commutative. Usually, this is just COMMUTATIVE_P (X), but the HP
+ PA doesn't consider PLUS to be commutative inside a MEM.
+ OUTER_CODE is the rtx code of the enclosing rtl, if known,
+ otherwise it is UNKNOWN.
+
+ -- Target Hook: rtx TARGET_ALLOCATE_INITIAL_VALUE (rtx HARD_REG)
+ When the initial value of a hard register has been copied in a
+ pseudo register, it is often not necessary to actually allocate
+ another register to this pseudo register, because the original
+ hard register or a stack slot it has been saved into can be used.
+ `TARGET_ALLOCATE_INITIAL_VALUE' is called at the start of register
+ allocation once for each hard register that had its initial value
+ copied by using `get_func_hard_reg_initial_val' or
+ `get_hard_reg_initial_val'. Possible values are `NULL_RTX', if
+ you don't want to do any special allocation, a `REG' rtx--that
+ would typically be the hard register itself, if it is known not to
+ be clobbered--or a `MEM'. If you are returning a `MEM', this is
+ only a hint for the allocator; it might decide to use another
+ register anyways. You may use `current_function_leaf_function' in
+ the hook, functions that use `REG_N_SETS', to determine if the hard
+ register in question will not be clobbered. The default value of
+ this hook is `NULL', which disables any special allocation.
+
+ -- Target Hook: int TARGET_UNSPEC_MAY_TRAP_P (const_rtx X, unsigned
+ FLAGS)
+ This target hook returns nonzero if X, an `unspec' or
+ `unspec_volatile' operation, might cause a trap. Targets can use
+ this hook to enhance precision of analysis for `unspec' and
+ `unspec_volatile' operations. You may call `may_trap_p_1' to
+ analyze inner elements of X in which case FLAGS should be passed
+ along.
+
+ -- Target Hook: void TARGET_SET_CURRENT_FUNCTION (tree DECL)
+ The compiler invokes this hook whenever it changes its current
+ function context (`cfun'). You can define this function if the
+ back end needs to perform any initialization or reset actions on a
+ per-function basis. For example, it may be used to implement
+ function attributes that affect register usage or code generation
+ patterns. The argument DECL is the declaration for the new
+ function context, and may be null to indicate that the compiler
+ has left a function context and is returning to processing at the
+ top level. The default hook function does nothing.
+
+ GCC sets `cfun' to a dummy function context during initialization
+ of some parts of the back end. The hook function is not invoked
+ in this situation; you need not worry about the hook being invoked
+ recursively, or when the back end is in a partially-initialized
+ state.
+
+ -- Macro: TARGET_OBJECT_SUFFIX
+ Define this macro to be a C string representing the suffix for
+ object files on your target machine. If you do not define this
+ macro, GCC will use `.o' as the suffix for object files.
+
+ -- Macro: TARGET_EXECUTABLE_SUFFIX
+ Define this macro to be a C string representing the suffix to be
+ automatically added to executable files on your target machine.
+ If you do not define this macro, GCC will use the null string as
+ the suffix for executable files.
+
+ -- Macro: COLLECT_EXPORT_LIST
+ If defined, `collect2' will scan the individual object files
+ specified on its command line and create an export list for the
+ linker. Define this macro for systems like AIX, where the linker
+ discards object files that are not referenced from `main' and uses
+ export lists.
+
+ -- Macro: MODIFY_JNI_METHOD_CALL (MDECL)
+ Define this macro to a C expression representing a variant of the
+ method call MDECL, if Java Native Interface (JNI) methods must be
+ invoked differently from other methods on your target. For
+ example, on 32-bit Microsoft Windows, JNI methods must be invoked
+ using the `stdcall' calling convention and this macro is then
+ defined as this expression:
+
+ build_type_attribute_variant (MDECL,
+ build_tree_list
+ (get_identifier ("stdcall"),
+ NULL))
+
+ -- Target Hook: bool TARGET_CANNOT_MODIFY_JUMPS_P (void)
+ This target hook returns `true' past the point in which new jump
+ instructions could be created. On machines that require a
+ register for every jump such as the SHmedia ISA of SH5, this point
+ would typically be reload, so this target hook should be defined
+ to a function such as:
+
+ static bool
+ cannot_modify_jumps_past_reload_p ()
+ {
+ return (reload_completed || reload_in_progress);
+ }
+
+ -- Target Hook: int TARGET_BRANCH_TARGET_REGISTER_CLASS (void)
+ This target hook returns a register class for which branch target
+ register optimizations should be applied. All registers in this
+ class should be usable interchangeably. After reload, registers
+ in this class will be re-allocated and loads will be hoisted out
+ of loops and be subjected to inter-block scheduling.
+
+ -- Target Hook: bool TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED (bool
+ AFTER_PROLOGUE_EPILOGUE_GEN)
+ Branch target register optimization will by default exclude
+ callee-saved registers that are not already live during the
+ current function; if this target hook returns true, they will be
+ included. The target code must than make sure that all target
+ registers in the class returned by
+ `TARGET_BRANCH_TARGET_REGISTER_CLASS' that might need saving are
+ saved. AFTER_PROLOGUE_EPILOGUE_GEN indicates if prologues and
+ epilogues have already been generated. Note, even if you only
+ return true when AFTER_PROLOGUE_EPILOGUE_GEN is false, you still
+ are likely to have to make special provisions in
+ `INITIAL_ELIMINATION_OFFSET' to reserve space for caller-saved
+ target registers.
+
+ -- Macro: POWI_MAX_MULTS
+ If defined, this macro is interpreted as a signed integer C
+ expression that specifies the maximum number of floating point
+ multiplications that should be emitted when expanding
+ exponentiation by an integer constant inline. When this value is
+ defined, exponentiation requiring more than this number of
+ multiplications is implemented by calling the system library's
+ `pow', `powf' or `powl' routines. The default value places no
+ upper bound on the multiplication count.
+
+ -- Macro: void TARGET_EXTRA_INCLUDES (const char *SYSROOT, const char
+ *IPREFIX, int STDINC)
+ This target hook should register any extra include files for the
+ target. The parameter STDINC indicates if normal include files
+ are present. The parameter SYSROOT is the system root directory.
+ The parameter IPREFIX is the prefix for the gcc directory.
+
+ -- Macro: void TARGET_EXTRA_PRE_INCLUDES (const char *SYSROOT, const
+ char *IPREFIX, int STDINC)
+ This target hook should register any extra include files for the
+ target before any standard headers. The parameter STDINC
+ indicates if normal include files are present. The parameter
+ SYSROOT is the system root directory. The parameter IPREFIX is
+ the prefix for the gcc directory.
+
+ -- Macro: void TARGET_OPTF (char *PATH)
+ This target hook should register special include paths for the
+ target. The parameter PATH is the include to register. On Darwin
+ systems, this is used for Framework includes, which have semantics
+ that are different from `-I'.
+
+ -- Target Hook: bool TARGET_USE_LOCAL_THUNK_ALIAS_P (tree FNDECL)
+ This target hook returns `true' if it is safe to use a local alias
+ for a virtual function FNDECL when constructing thunks, `false'
+ otherwise. By default, the hook returns `true' for all functions,
+ if a target supports aliases (i.e. defines `ASM_OUTPUT_DEF'),
+ `false' otherwise,
+
+ -- Macro: TARGET_FORMAT_TYPES
+ If defined, this macro is the name of a global variable containing
+ target-specific format checking information for the `-Wformat'
+ option. The default is to have no target-specific format checks.
+
+ -- Macro: TARGET_N_FORMAT_TYPES
+ If defined, this macro is the number of entries in
+ `TARGET_FORMAT_TYPES'.
+
+ -- Macro: TARGET_OVERRIDES_FORMAT_ATTRIBUTES
+ If defined, this macro is the name of a global variable containing
+ target-specific format overrides for the `-Wformat' option. The
+ default is to have no target-specific format overrides. If defined,
+ `TARGET_FORMAT_TYPES' must be defined, too.
+
+ -- Macro: TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT
+ If defined, this macro specifies the number of entries in
+ `TARGET_OVERRIDES_FORMAT_ATTRIBUTES'.
+
+ -- Macro: TARGET_OVERRIDES_FORMAT_INIT
+ If defined, this macro specifies the optional initialization
+ routine for target specific customizations of the system printf
+ and scanf formatter settings.
+
+ -- Target Hook: bool TARGET_RELAXED_ORDERING
+ If set to `true', means that the target's memory model does not
+ guarantee that loads which do not depend on one another will access
+ main memory in the order of the instruction stream; if ordering is
+ important, an explicit memory barrier must be used. This is true
+ of many recent processors which implement a policy of "relaxed,"
+ "weak," or "release" memory consistency, such as Alpha, PowerPC,
+ and ia64. The default is `false'.
+
+ -- Target Hook: const char *TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN
+ (tree TYPELIST, tree FUNCDECL, tree VAL)
+ If defined, this macro returns the diagnostic message when it is
+ illegal to pass argument VAL to function FUNCDECL with prototype
+ TYPELIST.
+
+ -- Target Hook: const char * TARGET_INVALID_CONVERSION (tree FROMTYPE,
+ tree TOTYPE)
+ If defined, this macro returns the diagnostic message when it is
+ invalid to convert from FROMTYPE to TOTYPE, or `NULL' if validity
+ should be determined by the front end.
+
+ -- Target Hook: const char * TARGET_INVALID_UNARY_OP (int OP, tree
+ TYPE)
+ If defined, this macro returns the diagnostic message when it is
+ invalid to apply operation OP (where unary plus is denoted by
+ `CONVERT_EXPR') to an operand of type TYPE, or `NULL' if validity
+ should be determined by the front end.
+
+ -- Target Hook: const char * TARGET_INVALID_BINARY_OP (int OP, tree
+ TYPE1, tree TYPE2)
+ If defined, this macro returns the diagnostic message when it is
+ invalid to apply operation OP to operands of types TYPE1 and
+ TYPE2, or `NULL' if validity should be determined by the front end.
+
+ -- Macro: TARGET_USE_JCR_SECTION
+ This macro determines whether to use the JCR section to register
+ Java classes. By default, TARGET_USE_JCR_SECTION is defined to 1
+ if both SUPPORTS_WEAK and TARGET_HAVE_NAMED_SECTIONS are true,
+ else 0.
+
+ -- Macro: OBJC_JBLEN
+ This macro determines the size of the objective C jump buffer for
+ the NeXT runtime. By default, OBJC_JBLEN is defined to an
+ innocuous value.
+
+ -- Macro: LIBGCC2_UNWIND_ATTRIBUTE
+ Define this macro if any target-specific attributes need to be
+ attached to the functions in `libgcc' that provide low-level
+ support for call stack unwinding. It is used in declarations in
+ `unwind-generic.h' and the associated definitions of those
+ functions.
+
+ -- Target Hook: void TARGET_UPDATE_STACK_BOUNDARY (void)
+ Define this macro to update the current function stack boundary if
+ necessary.
+
+ -- Target Hook: rtx TARGET_GET_DRAP_RTX (void)
+ Define this macro to an rtx for Dynamic Realign Argument Pointer
+ if a different argument pointer register is needed to access the
+ function's argument list when stack is aligned.
+
+ -- Target Hook: bool TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS (void)
+ When optimization is disabled, this hook indicates whether or not
+ arguments should be allocated to stack slots. Normally, GCC
+ allocates stacks slots for arguments when not optimizing in order
+ to make debugging easier. However, when a function is declared
+ with `__attribute__((naked))', there is no stack frame, and the
+ compiler cannot safely move arguments from the registers in which
+ they are passed to the stack. Therefore, this hook should return
+ true in general, but false for naked functions. The default
+ implementation always returns true.
+
+
+File: gccint.info, Node: Host Config, Next: Fragments, Prev: Target Macros, Up: Top
+
+18 Host Configuration
+*********************
+
+Most details about the machine and system on which the compiler is
+actually running are detected by the `configure' script. Some things
+are impossible for `configure' to detect; these are described in two
+ways, either by macros defined in a file named `xm-MACHINE.h' or by
+hook functions in the file specified by the OUT_HOST_HOOK_OBJ variable
+in `config.gcc'. (The intention is that very few hosts will need a
+header file but nearly every fully supported host will need to override
+some hooks.)
+
+ If you need to define only a few macros, and they have simple
+definitions, consider using the `xm_defines' variable in your
+`config.gcc' entry instead of creating a host configuration header.
+*Note System Config::.
+
+* Menu:
+
+* Host Common:: Things every host probably needs implemented.
+* Filesystem:: Your host can't have the letter `a' in filenames?
+* Host Misc:: Rare configuration options for hosts.
+
+
+File: gccint.info, Node: Host Common, Next: Filesystem, Up: Host Config
+
+18.1 Host Common
+================
+
+Some things are just not portable, even between similar operating
+systems, and are too difficult for autoconf to detect. They get
+implemented using hook functions in the file specified by the
+HOST_HOOK_OBJ variable in `config.gcc'.
+
+ -- Host Hook: void HOST_HOOKS_EXTRA_SIGNALS (void)
+ This host hook is used to set up handling for extra signals. The
+ most common thing to do in this hook is to detect stack overflow.
+
+ -- Host Hook: void * HOST_HOOKS_GT_PCH_GET_ADDRESS (size_t SIZE, int
+ FD)
+ This host hook returns the address of some space that is likely to
+ be free in some subsequent invocation of the compiler. We intend
+ to load the PCH data at this address such that the data need not
+ be relocated. The area should be able to hold SIZE bytes. If the
+ host uses `mmap', FD is an open file descriptor that can be used
+ for probing.
+
+ -- Host Hook: int HOST_HOOKS_GT_PCH_USE_ADDRESS (void * ADDRESS,
+ size_t SIZE, int FD, size_t OFFSET)
+ This host hook is called when a PCH file is about to be loaded.
+ We want to load SIZE bytes from FD at OFFSET into memory at
+ ADDRESS. The given address will be the result of a previous
+ invocation of `HOST_HOOKS_GT_PCH_GET_ADDRESS'. Return -1 if we
+ couldn't allocate SIZE bytes at ADDRESS. Return 0 if the memory
+ is allocated but the data is not loaded. Return 1 if the hook has
+ performed everything.
+
+ If the implementation uses reserved address space, free any
+ reserved space beyond SIZE, regardless of the return value. If no
+ PCH will be loaded, this hook may be called with SIZE zero, in
+ which case all reserved address space should be freed.
+
+ Do not try to handle values of ADDRESS that could not have been
+ returned by this executable; just return -1. Such values usually
+ indicate an out-of-date PCH file (built by some other GCC
+ executable), and such a PCH file won't work.
+
+ -- Host Hook: size_t HOST_HOOKS_GT_PCH_ALLOC_GRANULARITY (void);
+ This host hook returns the alignment required for allocating
+ virtual memory. Usually this is the same as getpagesize, but on
+ some hosts the alignment for reserving memory differs from the
+ pagesize for committing memory.
+
+
+File: gccint.info, Node: Filesystem, Next: Host Misc, Prev: Host Common, Up: Host Config
+
+18.2 Host Filesystem
+====================
+
+GCC needs to know a number of things about the semantics of the host
+machine's filesystem. Filesystems with Unix and MS-DOS semantics are
+automatically detected. For other systems, you can define the
+following macros in `xm-MACHINE.h'.
+
+`HAVE_DOS_BASED_FILE_SYSTEM'
+ This macro is automatically defined by `system.h' if the host file
+ system obeys the semantics defined by MS-DOS instead of Unix. DOS
+ file systems are case insensitive, file specifications may begin
+ with a drive letter, and both forward slash and backslash (`/' and
+ `\') are directory separators.
+
+`DIR_SEPARATOR'
+`DIR_SEPARATOR_2'
+ If defined, these macros expand to character constants specifying
+ separators for directory names within a file specification.
+ `system.h' will automatically give them appropriate values on Unix
+ and MS-DOS file systems. If your file system is neither of these,
+ define one or both appropriately in `xm-MACHINE.h'.
+
+ However, operating systems like VMS, where constructing a pathname
+ is more complicated than just stringing together directory names
+ separated by a special character, should not define either of these
+ macros.
+
+`PATH_SEPARATOR'
+ If defined, this macro should expand to a character constant
+ specifying the separator for elements of search paths. The default
+ value is a colon (`:'). DOS-based systems usually, but not
+ always, use semicolon (`;').
+
+`VMS'
+ Define this macro if the host system is VMS.
+
+`HOST_OBJECT_SUFFIX'
+ Define this macro to be a C string representing the suffix for
+ object files on your host machine. If you do not define this
+ macro, GCC will use `.o' as the suffix for object files.
+
+`HOST_EXECUTABLE_SUFFIX'
+ Define this macro to be a C string representing the suffix for
+ executable files on your host machine. If you do not define this
+ macro, GCC will use the null string as the suffix for executable
+ files.
+
+`HOST_BIT_BUCKET'
+ A pathname defined by the host operating system, which can be
+ opened as a file and written to, but all the information written
+ is discarded. This is commonly known as a "bit bucket" or "null
+ device". If you do not define this macro, GCC will use
+ `/dev/null' as the bit bucket. If the host does not support a bit
+ bucket, define this macro to an invalid filename.
+
+`UPDATE_PATH_HOST_CANONICALIZE (PATH)'
+ If defined, a C statement (sans semicolon) that performs
+ host-dependent canonicalization when a path used in a compilation
+ driver or preprocessor is canonicalized. PATH is a malloc-ed path
+ to be canonicalized. If the C statement does canonicalize PATH
+ into a different buffer, the old path should be freed and the new
+ buffer should have been allocated with malloc.
+
+`DUMPFILE_FORMAT'
+ Define this macro to be a C string representing the format to use
+ for constructing the index part of debugging dump file names. The
+ resultant string must fit in fifteen bytes. The full filename
+ will be the concatenation of: the prefix of the assembler file
+ name, the string resulting from applying this format to an index
+ number, and a string unique to each dump file kind, e.g. `rtl'.
+
+ If you do not define this macro, GCC will use `.%02d.'. You should
+ define this macro if using the default will create an invalid file
+ name.
+
+`DELETE_IF_ORDINARY'
+ Define this macro to be a C statement (sans semicolon) that
+ performs host-dependent removal of ordinary temp files in the
+ compilation driver.
+
+ If you do not define this macro, GCC will use the default version.
+ You should define this macro if the default version does not
+ reliably remove the temp file as, for example, on VMS which allows
+ multiple versions of a file.
+
+`HOST_LACKS_INODE_NUMBERS'
+ Define this macro if the host filesystem does not report
+ meaningful inode numbers in struct stat.
+
+
+File: gccint.info, Node: Host Misc, Prev: Filesystem, Up: Host Config
+
+18.3 Host Misc
+==============
+
+`FATAL_EXIT_CODE'
+ A C expression for the status code to be returned when the compiler
+ exits after serious errors. The default is the system-provided
+ macro `EXIT_FAILURE', or `1' if the system doesn't define that
+ macro. Define this macro only if these defaults are incorrect.
+
+`SUCCESS_EXIT_CODE'
+ A C expression for the status code to be returned when the compiler
+ exits without serious errors. (Warnings are not serious errors.)
+ The default is the system-provided macro `EXIT_SUCCESS', or `0' if
+ the system doesn't define that macro. Define this macro only if
+ these defaults are incorrect.
+
+`USE_C_ALLOCA'
+ Define this macro if GCC should use the C implementation of
+ `alloca' provided by `libiberty.a'. This only affects how some
+ parts of the compiler itself allocate memory. It does not change
+ code generation.
+
+ When GCC is built with a compiler other than itself, the C `alloca'
+ is always used. This is because most other implementations have
+ serious bugs. You should define this macro only on a system where
+ no stack-based `alloca' can possibly work. For instance, if a
+ system has a small limit on the size of the stack, GCC's builtin
+ `alloca' will not work reliably.
+
+`COLLECT2_HOST_INITIALIZATION'
+ If defined, a C statement (sans semicolon) that performs
+ host-dependent initialization when `collect2' is being initialized.
+
+`GCC_DRIVER_HOST_INITIALIZATION'
+ If defined, a C statement (sans semicolon) that performs
+ host-dependent initialization when a compilation driver is being
+ initialized.
+
+`HOST_LONG_LONG_FORMAT'
+ If defined, the string used to indicate an argument of type `long
+ long' to functions like `printf'. The default value is `"ll"'.
+
+ In addition, if `configure' generates an incorrect definition of any
+of the macros in `auto-host.h', you can override that definition in a
+host configuration header. If you need to do this, first see if it is
+possible to fix `configure'.
+
+
+File: gccint.info, Node: Fragments, Next: Collect2, Prev: Host Config, Up: Top
+
+19 Makefile Fragments
+*********************
+
+When you configure GCC using the `configure' script, it will construct
+the file `Makefile' from the template file `Makefile.in'. When it does
+this, it can incorporate makefile fragments from the `config'
+directory. These are used to set Makefile parameters that are not
+amenable to being calculated by autoconf. The list of fragments to
+incorporate is set by `config.gcc' (and occasionally `config.build' and
+`config.host'); *Note System Config::.
+
+ Fragments are named either `t-TARGET' or `x-HOST', depending on
+whether they are relevant to configuring GCC to produce code for a
+particular target, or to configuring GCC to run on a particular host.
+Here TARGET and HOST are mnemonics which usually have some relationship
+to the canonical system name, but no formal connection.
+
+ If these files do not exist, it means nothing needs to be added for a
+given target or host. Most targets need a few `t-TARGET' fragments,
+but needing `x-HOST' fragments is rare.
+
+* Menu:
+
+* Target Fragment:: Writing `t-TARGET' files.
+* Host Fragment:: Writing `x-HOST' files.
+
+
+File: gccint.info, Node: Target Fragment, Next: Host Fragment, Up: Fragments
+
+19.1 Target Makefile Fragments
+==============================
+
+Target makefile fragments can set these Makefile variables.
+
+`LIBGCC2_CFLAGS'
+ Compiler flags to use when compiling `libgcc2.c'.
+
+`LIB2FUNCS_EXTRA'
+ A list of source file names to be compiled or assembled and
+ inserted into `libgcc.a'.
+
+`Floating Point Emulation'
+ To have GCC include software floating point libraries in `libgcc.a'
+ define `FPBIT' and `DPBIT' along with a few rules as follows:
+ # We want fine grained libraries, so use the new code
+ # to build the floating point emulation libraries.
+ FPBIT = fp-bit.c
+ DPBIT = dp-bit.c
+
+
+ fp-bit.c: $(srcdir)/config/fp-bit.c
+ echo '#define FLOAT' > fp-bit.c
+ cat $(srcdir)/config/fp-bit.c >> fp-bit.c
+
+ dp-bit.c: $(srcdir)/config/fp-bit.c
+ cat $(srcdir)/config/fp-bit.c > dp-bit.c
+
+ You may need to provide additional #defines at the beginning of
+ `fp-bit.c' and `dp-bit.c' to control target endianness and other
+ options.
+
+`CRTSTUFF_T_CFLAGS'
+ Special flags used when compiling `crtstuff.c'. *Note
+ Initialization::.
+
+`CRTSTUFF_T_CFLAGS_S'
+ Special flags used when compiling `crtstuff.c' for shared linking.
+ Used if you use `crtbeginS.o' and `crtendS.o' in `EXTRA-PARTS'.
+ *Note Initialization::.
+
+`MULTILIB_OPTIONS'
+ For some targets, invoking GCC in different ways produces objects
+ that can not be linked together. For example, for some targets GCC
+ produces both big and little endian code. For these targets, you
+ must arrange for multiple versions of `libgcc.a' to be compiled,
+ one for each set of incompatible options. When GCC invokes the
+ linker, it arranges to link in the right version of `libgcc.a',
+ based on the command line options used.
+
+ The `MULTILIB_OPTIONS' macro lists the set of options for which
+ special versions of `libgcc.a' must be built. Write options that
+ are mutually incompatible side by side, separated by a slash.
+ Write options that may be used together separated by a space. The
+ build procedure will build all combinations of compatible options.
+
+ For example, if you set `MULTILIB_OPTIONS' to `m68000/m68020
+ msoft-float', `Makefile' will build special versions of `libgcc.a'
+ using the following sets of options: `-m68000', `-m68020',
+ `-msoft-float', `-m68000 -msoft-float', and `-m68020 -msoft-float'.
+
+`MULTILIB_DIRNAMES'
+ If `MULTILIB_OPTIONS' is used, this variable specifies the
+ directory names that should be used to hold the various libraries.
+ Write one element in `MULTILIB_DIRNAMES' for each element in
+ `MULTILIB_OPTIONS'. If `MULTILIB_DIRNAMES' is not used, the
+ default value will be `MULTILIB_OPTIONS', with all slashes treated
+ as spaces.
+
+ For example, if `MULTILIB_OPTIONS' is set to `m68000/m68020
+ msoft-float', then the default value of `MULTILIB_DIRNAMES' is
+ `m68000 m68020 msoft-float'. You may specify a different value if
+ you desire a different set of directory names.
+
+`MULTILIB_MATCHES'
+ Sometimes the same option may be written in two different ways.
+ If an option is listed in `MULTILIB_OPTIONS', GCC needs to know
+ about any synonyms. In that case, set `MULTILIB_MATCHES' to a
+ list of items of the form `option=option' to describe all relevant
+ synonyms. For example, `m68000=mc68000 m68020=mc68020'.
+
+`MULTILIB_EXCEPTIONS'
+ Sometimes when there are multiple sets of `MULTILIB_OPTIONS' being
+ specified, there are combinations that should not be built. In
+ that case, set `MULTILIB_EXCEPTIONS' to be all of the switch
+ exceptions in shell case syntax that should not be built.
+
+ For example the ARM processor cannot execute both hardware floating
+ point instructions and the reduced size THUMB instructions at the
+ same time, so there is no need to build libraries with both of
+ these options enabled. Therefore `MULTILIB_EXCEPTIONS' is set to:
+ *mthumb/*mhard-float*
+
+`MULTILIB_EXTRA_OPTS'
+ Sometimes it is desirable that when building multiple versions of
+ `libgcc.a' certain options should always be passed on to the
+ compiler. In that case, set `MULTILIB_EXTRA_OPTS' to be the list
+ of options to be used for all builds. If you set this, you should
+ probably set `CRTSTUFF_T_CFLAGS' to a dash followed by it.
+
+`NATIVE_SYSTEM_HEADER_DIR'
+ If the default location for system headers is not `/usr/include',
+ you must set this to the directory containing the headers. This
+ value should match the value of the `SYSTEM_INCLUDE_DIR' macro.
+
+`SPECS'
+ Unfortunately, setting `MULTILIB_EXTRA_OPTS' is not enough, since
+ it does not affect the build of target libraries, at least not the
+ build of the default multilib. One possible work-around is to use
+ `DRIVER_SELF_SPECS' to bring options from the `specs' file as if
+ they had been passed in the compiler driver command line.
+ However, you don't want to be adding these options after the
+ toolchain is installed, so you can instead tweak the `specs' file
+ that will be used during the toolchain build, while you still
+ install the original, built-in `specs'. The trick is to set
+ `SPECS' to some other filename (say `specs.install'), that will
+ then be created out of the built-in specs, and introduce a
+ `Makefile' rule to generate the `specs' file that's going to be
+ used at build time out of your `specs.install'.
+
+`T_CFLAGS'
+ These are extra flags to pass to the C compiler. They are used
+ both when building GCC, and when compiling things with the
+ just-built GCC. This variable is deprecated and should not be
+ used.
+
+
+File: gccint.info, Node: Host Fragment, Prev: Target Fragment, Up: Fragments
+
+19.2 Host Makefile Fragments
+============================
+
+The use of `x-HOST' fragments is discouraged. You should only use it
+for makefile dependencies.
+
+
+File: gccint.info, Node: Collect2, Next: Header Dirs, Prev: Fragments, Up: Top
+
+20 `collect2'
+*************
+
+GCC uses a utility called `collect2' on nearly all systems to arrange
+to call various initialization functions at start time.
+
+ The program `collect2' works by linking the program once and looking
+through the linker output file for symbols with particular names
+indicating they are constructor functions. If it finds any, it creates
+a new temporary `.c' file containing a table of them, compiles it, and
+links the program a second time including that file.
+
+ The actual calls to the constructors are carried out by a subroutine
+called `__main', which is called (automatically) at the beginning of
+the body of `main' (provided `main' was compiled with GNU CC). Calling
+`__main' is necessary, even when compiling C code, to allow linking C
+and C++ object code together. (If you use `-nostdlib', you get an
+unresolved reference to `__main', since it's defined in the standard
+GCC library. Include `-lgcc' at the end of your compiler command line
+to resolve this reference.)
+
+ The program `collect2' is installed as `ld' in the directory where the
+passes of the compiler are installed. When `collect2' needs to find
+the _real_ `ld', it tries the following file names:
+
+ * `real-ld' in the directories listed in the compiler's search
+ directories.
+
+ * `real-ld' in the directories listed in the environment variable
+ `PATH'.
+
+ * The file specified in the `REAL_LD_FILE_NAME' configuration macro,
+ if specified.
+
+ * `ld' in the compiler's search directories, except that `collect2'
+ will not execute itself recursively.
+
+ * `ld' in `PATH'.
+
+ "The compiler's search directories" means all the directories where
+`gcc' searches for passes of the compiler. This includes directories
+that you specify with `-B'.
+
+ Cross-compilers search a little differently:
+
+ * `real-ld' in the compiler's search directories.
+
+ * `TARGET-real-ld' in `PATH'.
+
+ * The file specified in the `REAL_LD_FILE_NAME' configuration macro,
+ if specified.
+
+ * `ld' in the compiler's search directories.
+
+ * `TARGET-ld' in `PATH'.
+
+ `collect2' explicitly avoids running `ld' using the file name under
+which `collect2' itself was invoked. In fact, it remembers up a list
+of such names--in case one copy of `collect2' finds another copy (or
+version) of `collect2' installed as `ld' in a second place in the
+search path.
+
+ `collect2' searches for the utilities `nm' and `strip' using the same
+algorithm as above for `ld'.
+
+
+File: gccint.info, Node: Header Dirs, Next: Type Information, Prev: Collect2, Up: Top
+
+21 Standard Header File Directories
+***********************************
+
+`GCC_INCLUDE_DIR' means the same thing for native and cross. It is
+where GCC stores its private include files, and also where GCC stores
+the fixed include files. A cross compiled GCC runs `fixincludes' on
+the header files in `$(tooldir)/include'. (If the cross compilation
+header files need to be fixed, they must be installed before GCC is
+built. If the cross compilation header files are already suitable for
+GCC, nothing special need be done).
+
+ `GPLUSPLUS_INCLUDE_DIR' means the same thing for native and cross. It
+is where `g++' looks first for header files. The C++ library installs
+only target independent header files in that directory.
+
+ `LOCAL_INCLUDE_DIR' is used only by native compilers. GCC doesn't
+install anything there. It is normally `/usr/local/include'. This is
+where local additions to a packaged system should place header files.
+
+ `CROSS_INCLUDE_DIR' is used only by cross compilers. GCC doesn't
+install anything there.
+
+ `TOOL_INCLUDE_DIR' is used for both native and cross compilers. It is
+the place for other packages to install header files that GCC will use.
+For a cross-compiler, this is the equivalent of `/usr/include'. When
+you build a cross-compiler, `fixincludes' processes any header files in
+this directory.
+
+
+File: gccint.info, Node: Type Information, Next: Funding, Prev: Header Dirs, Up: Top
+
+22 Memory Management and Type Information
+*****************************************
+
+GCC uses some fairly sophisticated memory management techniques, which
+involve determining information about GCC's data structures from GCC's
+source code and using this information to perform garbage collection and
+implement precompiled headers.
+
+ A full C parser would be too complicated for this task, so a limited
+subset of C is interpreted and special markers are used to determine
+what parts of the source to look at. All `struct' and `union'
+declarations that define data structures that are allocated under
+control of the garbage collector must be marked. All global variables
+that hold pointers to garbage-collected memory must also be marked.
+Finally, all global variables that need to be saved and restored by a
+precompiled header must be marked. (The precompiled header mechanism
+can only save static variables if they're scalar. Complex data
+structures must be allocated in garbage-collected memory to be saved in
+a precompiled header.)
+
+ The full format of a marker is
+ GTY (([OPTION] [(PARAM)], [OPTION] [(PARAM)] ...))
+ but in most cases no options are needed. The outer double parentheses
+are still necessary, though: `GTY(())'. Markers can appear:
+
+ * In a structure definition, before the open brace;
+
+ * In a global variable declaration, after the keyword `static' or
+ `extern'; and
+
+ * In a structure field definition, before the name of the field.
+
+ Here are some examples of marking simple data structures and globals.
+
+ struct TAG GTY(())
+ {
+ FIELDS...
+ };
+
+ typedef struct TAG GTY(())
+ {
+ FIELDS...
+ } *TYPENAME;
+
+ static GTY(()) struct TAG *LIST; /* points to GC memory */
+ static GTY(()) int COUNTER; /* save counter in a PCH */
+
+ The parser understands simple typedefs such as `typedef struct TAG
+*NAME;' and `typedef int NAME;'. These don't need to be marked.
+
+* Menu:
+
+* GTY Options:: What goes inside a `GTY(())'.
+* GGC Roots:: Making global variables GGC roots.
+* Files:: How the generated files work.
+* Invoking the garbage collector:: How to invoke the garbage collector.
+
+
+File: gccint.info, Node: GTY Options, Next: GGC Roots, Up: Type Information
+
+22.1 The Inside of a `GTY(())'
+==============================
+
+Sometimes the C code is not enough to fully describe the type
+structure. Extra information can be provided with `GTY' options and
+additional markers. Some options take a parameter, which may be either
+a string or a type name, depending on the parameter. If an option
+takes no parameter, it is acceptable either to omit the parameter
+entirely, or to provide an empty string as a parameter. For example,
+`GTY ((skip))' and `GTY ((skip ("")))' are equivalent.
+
+ When the parameter is a string, often it is a fragment of C code. Four
+special escapes may be used in these strings, to refer to pieces of the
+data structure being marked:
+
+`%h'
+ The current structure.
+
+`%1'
+ The structure that immediately contains the current structure.
+
+`%0'
+ The outermost structure that contains the current structure.
+
+`%a'
+ A partial expression of the form `[i1][i2]...' that indexes the
+ array item currently being marked.
+
+ For instance, suppose that you have a structure of the form
+ struct A {
+ ...
+ };
+ struct B {
+ struct A foo[12];
+ };
+ and `b' is a variable of type `struct B'. When marking `b.foo[11]',
+`%h' would expand to `b.foo[11]', `%0' and `%1' would both expand to
+`b', and `%a' would expand to `[11]'.
+
+ As in ordinary C, adjacent strings will be concatenated; this is
+helpful when you have a complicated expression.
+ GTY ((chain_next ("TREE_CODE (&%h.generic) == INTEGER_TYPE"
+ " ? TYPE_NEXT_VARIANT (&%h.generic)"
+ " : TREE_CHAIN (&%h.generic)")))
+
+ The available options are:
+
+`length ("EXPRESSION")'
+ There are two places the type machinery will need to be explicitly
+ told the length of an array. The first case is when a structure
+ ends in a variable-length array, like this:
+ struct rtvec_def GTY(()) {
+ int num_elem; /* number of elements */
+ rtx GTY ((length ("%h.num_elem"))) elem[1];
+ };
+
+ In this case, the `length' option is used to override the specified
+ array length (which should usually be `1'). The parameter of the
+ option is a fragment of C code that calculates the length.
+
+ The second case is when a structure or a global variable contains a
+ pointer to an array, like this:
+ tree *
+ GTY ((length ("%h.regno_pointer_align_length"))) regno_decl;
+ In this case, `regno_decl' has been allocated by writing something
+ like
+ x->regno_decl =
+ ggc_alloc (x->regno_pointer_align_length * sizeof (tree));
+ and the `length' provides the length of the field.
+
+ This second use of `length' also works on global variables, like:
+ static GTY((length ("reg_base_value_size")))
+ rtx *reg_base_value;
+
+`skip'
+ If `skip' is applied to a field, the type machinery will ignore it.
+ This is somewhat dangerous; the only safe use is in a union when
+ one field really isn't ever used.
+
+`desc ("EXPRESSION")'
+`tag ("CONSTANT")'
+`default'
+ The type machinery needs to be told which field of a `union' is
+ currently active. This is done by giving each field a constant
+ `tag' value, and then specifying a discriminator using `desc'.
+ The value of the expression given by `desc' is compared against
+ each `tag' value, each of which should be different. If no `tag'
+ is matched, the field marked with `default' is used if there is
+ one, otherwise no field in the union will be marked.
+
+ In the `desc' option, the "current structure" is the union that it
+ discriminates. Use `%1' to mean the structure containing it.
+ There are no escapes available to the `tag' option, since it is a
+ constant.
+
+ For example,
+ struct tree_binding GTY(())
+ {
+ struct tree_common common;
+ union tree_binding_u {
+ tree GTY ((tag ("0"))) scope;
+ struct cp_binding_level * GTY ((tag ("1"))) level;
+ } GTY ((desc ("BINDING_HAS_LEVEL_P ((tree)&%0)"))) xscope;
+ tree value;
+ };
+
+ In this example, the value of BINDING_HAS_LEVEL_P when applied to a
+ `struct tree_binding *' is presumed to be 0 or 1. If 1, the type
+ mechanism will treat the field `level' as being present and if 0,
+ will treat the field `scope' as being present.
+
+`param_is (TYPE)'
+`use_param'
+ Sometimes it's convenient to define some data structure to work on
+ generic pointers (that is, `PTR') and then use it with a specific
+ type. `param_is' specifies the real type pointed to, and
+ `use_param' says where in the generic data structure that type
+ should be put.
+
+ For instance, to have a `htab_t' that points to trees, one would
+ write the definition of `htab_t' like this:
+ typedef struct GTY(()) {
+ ...
+ void ** GTY ((use_param, ...)) entries;
+ ...
+ } htab_t;
+ and then declare variables like this:
+ static htab_t GTY ((param_is (union tree_node))) ict;
+
+`paramN_is (TYPE)'
+`use_paramN'
+ In more complicated cases, the data structure might need to work on
+ several different types, which might not necessarily all be
+ pointers. For this, `param1_is' through `param9_is' may be used to
+ specify the real type of a field identified by `use_param1' through
+ `use_param9'.
+
+`use_params'
+ When a structure contains another structure that is parameterized,
+ there's no need to do anything special, the inner structure
+ inherits the parameters of the outer one. When a structure
+ contains a pointer to a parameterized structure, the type
+ machinery won't automatically detect this (it could, it just
+ doesn't yet), so it's necessary to tell it that the pointed-to
+ structure should use the same parameters as the outer structure.
+ This is done by marking the pointer with the `use_params' option.
+
+`deletable'
+ `deletable', when applied to a global variable, indicates that when
+ garbage collection runs, there's no need to mark anything pointed
+ to by this variable, it can just be set to `NULL' instead. This
+ is used to keep a list of free structures around for re-use.
+
+`if_marked ("EXPRESSION")'
+ Suppose you want some kinds of object to be unique, and so you put
+ them in a hash table. If garbage collection marks the hash table,
+ these objects will never be freed, even if the last other
+ reference to them goes away. GGC has special handling to deal
+ with this: if you use the `if_marked' option on a global hash
+ table, GGC will call the routine whose name is the parameter to
+ the option on each hash table entry. If the routine returns
+ nonzero, the hash table entry will be marked as usual. If the
+ routine returns zero, the hash table entry will be deleted.
+
+ The routine `ggc_marked_p' can be used to determine if an element
+ has been marked already; in fact, the usual case is to use
+ `if_marked ("ggc_marked_p")'.
+
+`mark_hook ("HOOK-ROUTINE-NAME")'
+ If provided for a structure or union type, the given
+ HOOK-ROUTINE-NAME (between double-quotes) is the name of a routine
+ called when the garbage collector has just marked the data as
+ reachable. This routine should not change the data, or call any ggc
+ routine. Its only argument is a pointer to the just marked (const)
+ structure or union.
+
+`maybe_undef'
+ When applied to a field, `maybe_undef' indicates that it's OK if
+ the structure that this fields points to is never defined, so long
+ as this field is always `NULL'. This is used to avoid requiring
+ backends to define certain optional structures. It doesn't work
+ with language frontends.
+
+`nested_ptr (TYPE, "TO EXPRESSION", "FROM EXPRESSION")'
+ The type machinery expects all pointers to point to the start of an
+ object. Sometimes for abstraction purposes it's convenient to have
+ a pointer which points inside an object. So long as it's possible
+ to convert the original object to and from the pointer, such
+ pointers can still be used. TYPE is the type of the original
+ object, the TO EXPRESSION returns the pointer given the original
+ object, and the FROM EXPRESSION returns the original object given
+ the pointer. The pointer will be available using the `%h' escape.
+
+`chain_next ("EXPRESSION")'
+`chain_prev ("EXPRESSION")'
+`chain_circular ("EXPRESSION")'
+ It's helpful for the type machinery to know if objects are often
+ chained together in long lists; this lets it generate code that
+ uses less stack space by iterating along the list instead of
+ recursing down it. `chain_next' is an expression for the next
+ item in the list, `chain_prev' is an expression for the previous
+ item. For singly linked lists, use only `chain_next'; for doubly
+ linked lists, use both. The machinery requires that taking the
+ next item of the previous item gives the original item.
+ `chain_circular' is similar to `chain_next', but can be used for
+ circular single linked lists.
+
+`reorder ("FUNCTION NAME")'
+ Some data structures depend on the relative ordering of pointers.
+ If the precompiled header machinery needs to change that ordering,
+ it will call the function referenced by the `reorder' option,
+ before changing the pointers in the object that's pointed to by
+ the field the option applies to. The function must take four
+ arguments, with the signature
+ `void *, void *, gt_pointer_operator, void *'. The first
+ parameter is a pointer to the structure that contains the object
+ being updated, or the object itself if there is no containing
+ structure. The second parameter is a cookie that should be
+ ignored. The third parameter is a routine that, given a pointer,
+ will update it to its correct new value. The fourth parameter is
+ a cookie that must be passed to the second parameter.
+
+ PCH cannot handle data structures that depend on the absolute
+ values of pointers. `reorder' functions can be expensive. When
+ possible, it is better to depend on properties of the data, like
+ an ID number or the hash of a string instead.
+
+`special ("NAME")'
+ The `special' option is used to mark types that have to be dealt
+ with by special case machinery. The parameter is the name of the
+ special case. See `gengtype.c' for further details. Avoid adding
+ new special cases unless there is no other alternative.
+
+
+File: gccint.info, Node: GGC Roots, Next: Files, Prev: GTY Options, Up: Type Information
+
+22.2 Marking Roots for the Garbage Collector
+============================================
+
+In addition to keeping track of types, the type machinery also locates
+the global variables ("roots") that the garbage collector starts at.
+Roots must be declared using one of the following syntaxes:
+
+ * `extern GTY(([OPTIONS])) TYPE NAME;'
+
+ * `static GTY(([OPTIONS])) TYPE NAME;'
+ The syntax
+ * `GTY(([OPTIONS])) TYPE NAME;'
+ is _not_ accepted. There should be an `extern' declaration of such a
+variable in a header somewhere--mark that, not the definition. Or, if
+the variable is only used in one file, make it `static'.
+
+
+File: gccint.info, Node: Files, Next: Invoking the garbage collector, Prev: GGC Roots, Up: Type Information
+
+22.3 Source Files Containing Type Information
+=============================================
+
+Whenever you add `GTY' markers to a source file that previously had
+none, or create a new source file containing `GTY' markers, there are
+three things you need to do:
+
+ 1. You need to add the file to the list of source files the type
+ machinery scans. There are four cases:
+
+ a. For a back-end file, this is usually done automatically; if
+ not, you should add it to `target_gtfiles' in the appropriate
+ port's entries in `config.gcc'.
+
+ b. For files shared by all front ends, add the filename to the
+ `GTFILES' variable in `Makefile.in'.
+
+ c. For files that are part of one front end, add the filename to
+ the `gtfiles' variable defined in the appropriate
+ `config-lang.in'. For C, the file is `c-config-lang.in'.
+ Headers should appear before non-headers in this list.
+
+ d. For files that are part of some but not all front ends, add
+ the filename to the `gtfiles' variable of _all_ the front ends
+ that use it.
+
+ 2. If the file was a header file, you'll need to check that it's
+ included in the right place to be visible to the generated files.
+ For a back-end header file, this should be done automatically.
+ For a front-end header file, it needs to be included by the same
+ file that includes `gtype-LANG.h'. For other header files, it
+ needs to be included in `gtype-desc.c', which is a generated file,
+ so add it to `ifiles' in `open_base_file' in `gengtype.c'.
+
+ For source files that aren't header files, the machinery will
+ generate a header file that should be included in the source file
+ you just changed. The file will be called `gt-PATH.h' where PATH
+ is the pathname relative to the `gcc' directory with slashes
+ replaced by -, so for example the header file to be included in
+ `cp/parser.c' is called `gt-cp-parser.c'. The generated header
+ file should be included after everything else in the source file.
+ Don't forget to mention this file as a dependency in the
+ `Makefile'!
+
+
+ For language frontends, there is another file that needs to be included
+somewhere. It will be called `gtype-LANG.h', where LANG is the name of
+the subdirectory the language is contained in.
+
+
+File: gccint.info, Node: Invoking the garbage collector, Prev: Files, Up: Type Information
+
+22.4 How to invoke the garbage collector
+========================================
+
+The GCC garbage collector GGC is only invoked explicitly. In contrast
+with many other garbage collectors, it is not implicitly invoked by
+allocation routines when a lot of memory has been consumed. So the only
+way to have GGC reclaim storage it to call the `ggc_collect' function
+explicitly. This call is an expensive operation, as it may have to scan
+the entire heap. Beware that local variables (on the GCC call stack)
+are not followed by such an invocation (as many other garbage
+collectors do): you should reference all your data from static or
+external `GTY'-ed variables, and it is advised to call `ggc_collect'
+with a shallow call stack. The GGC is an exact mark and sweep garbage
+collector (so it does not scan the call stack for pointers). In
+practice GCC passes don't often call `ggc_collect' themselves, because
+it is called by the pass manager between passes.
+
+
+File: gccint.info, Node: Funding, Next: GNU Project, Prev: Type Information, Up: Top
+
+Funding Free Software
+*********************
+
+If you want to have more free software a few years from now, it makes
+sense for you to help encourage people to contribute funds for its
+development. The most effective approach known is to encourage
+commercial redistributors to donate.
+
+ Users of free software systems can boost the pace of development by
+encouraging for-a-fee distributors to donate part of their selling price
+to free software developers--the Free Software Foundation, and others.
+
+ The way to convince distributors to do this is to demand it and expect
+it from them. So when you compare distributors, judge them partly by
+how much they give to free software development. Show distributors
+they must compete to be the one who gives the most.
+
+ To make this approach work, you must insist on numbers that you can
+compare, such as, "We will donate ten dollars to the Frobnitz project
+for each disk sold." Don't be satisfied with a vague promise, such as
+"A portion of the profits are donated," since it doesn't give a basis
+for comparison.
+
+ Even a precise fraction "of the profits from this disk" is not very
+meaningful, since creative accounting and unrelated business decisions
+can greatly alter what fraction of the sales price counts as profit.
+If the price you pay is $50, ten percent of the profit is probably less
+than a dollar; it might be a few cents, or nothing at all.
+
+ Some redistributors do development work themselves. This is useful
+too; but to keep everyone honest, you need to inquire how much they do,
+and what kind. Some kinds of development make much more long-term
+difference than others. For example, maintaining a separate version of
+a program contributes very little; maintaining the standard version of a
+program for the whole community contributes much. Easy new ports
+contribute little, since someone else would surely do them; difficult
+ports such as adding a new CPU to the GNU Compiler Collection
+contribute more; major new features or packages contribute the most.
+
+ By establishing the idea that supporting further development is "the
+proper thing to do" when distributing free software for a fee, we can
+assure a steady flow of resources into making more free software.
+
+ Copyright (C) 1994 Free Software Foundation, Inc.
+ Verbatim copying and redistribution of this section is permitted
+ without royalty; alteration is not permitted.
+
+
+File: gccint.info, Node: GNU Project, Next: Copying, Prev: Funding, Up: Top
+
+The GNU Project and GNU/Linux
+*****************************
+
+The GNU Project was launched in 1984 to develop a complete Unix-like
+operating system which is free software: the GNU system. (GNU is a
+recursive acronym for "GNU's Not Unix"; it is pronounced "guh-NEW".)
+Variants of the GNU operating system, which use the kernel Linux, are
+now widely used; though these systems are often referred to as "Linux",
+they are more accurately called GNU/Linux systems.
+
+ For more information, see:
+ `http://www.gnu.org/'
+ `http://www.gnu.org/gnu/linux-and-gnu.html'
+
+
+File: gccint.info, Node: Copying, Next: GNU Free Documentation License, Prev: GNU Project, Up: Top
+
+GNU General Public License
+**************************
+
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. `http://fsf.org/'
+
+ Everyone is permitted to copy and distribute verbatim copies of this
+ license document, but changing it is not allowed.
+
+Preamble
+========
+
+The GNU General Public License is a free, copyleft license for software
+and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program-to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you
+have certain responsibilities if you distribute copies of the software,
+or if you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the
+manufacturer can do so. This is fundamentally incompatible with the
+aim of protecting users' freedom to change the software. The
+systematic pattern of such abuse occurs in the area of products for
+individuals to use, which is precisely where it is most unacceptable.
+Therefore, we have designed this version of the GPL to prohibit the
+practice for those products. If such problems arise substantially in
+other domains, we stand ready to extend this provision to those domains
+in future versions of the GPL, as needed to protect the freedom of
+users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+TERMS AND CONDITIONS
+====================
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public
+ License.
+
+ "Copyright" also means copyright-like laws that apply to other
+ kinds of works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+ License. Each licensee is addressed as "you". "Licensees" and
+ "recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the
+ work in a fashion requiring copyright permission, other than the
+ making of an exact copy. The resulting work is called a "modified
+ version" of the earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work
+ based on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+ permission, would make you directly or secondarily liable for
+ infringement under applicable copyright law, except executing it
+ on a computer or modifying a private copy. Propagation includes
+ copying, distribution (with or without modification), making
+ available to the public, and in some countries other activities as
+ well.
+
+ To "convey" a work means any kind of propagation that enables other
+ parties to make or receive copies. Mere interaction with a user
+ through a computer network, with no transfer of a copy, is not
+ conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+ to the extent that it includes a convenient and prominently visible
+ feature that (1) displays an appropriate copyright notice, and (2)
+ tells the user that there is no warranty for the work (except to
+ the extent that warranties are provided), that licensees may
+ convey the work under this License, and how to view a copy of this
+ License. If the interface presents a list of user commands or
+ options, such as a menu, a prominent item in the list meets this
+ criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+ for making modifications to it. "Object code" means any
+ non-source form of a work.
+
+ A "Standard Interface" means an interface that either is an
+ official standard defined by a recognized standards body, or, in
+ the case of interfaces specified for a particular programming
+ language, one that is widely used among developers working in that
+ language.
+
+ The "System Libraries" of an executable work include anything,
+ other than the work as a whole, that (a) is included in the normal
+ form of packaging a Major Component, but which is not part of that
+ Major Component, and (b) serves only to enable use of the work
+ with that Major Component, or to implement a Standard Interface
+ for which an implementation is available to the public in source
+ code form. A "Major Component", in this context, means a major
+ essential component (kernel, window system, and so on) of the
+ specific operating system (if any) on which the executable work
+ runs, or a compiler used to produce the work, or an object code
+ interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+ the source code needed to generate, install, and (for an executable
+ work) run the object code and to modify the work, including
+ scripts to control those activities. However, it does not include
+ the work's System Libraries, or general-purpose tools or generally
+ available free programs which are used unmodified in performing
+ those activities but which are not part of the work. For example,
+ Corresponding Source includes interface definition files
+ associated with source files for the work, and the source code for
+ shared libraries and dynamically linked subprograms that the work
+ is specifically designed to require, such as by intimate data
+ communication or control flow between those subprograms and other
+ parts of the work.
+
+ The Corresponding Source need not include anything that users can
+ regenerate automatically from other parts of the Corresponding
+ Source.
+
+ The Corresponding Source for a work in source code form is that
+ same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+ copyright on the Program, and are irrevocable provided the stated
+ conditions are met. This License explicitly affirms your unlimited
+ permission to run the unmodified Program. The output from running
+ a covered work is covered by this License only if the output,
+ given its content, constitutes a covered work. This License
+ acknowledges your rights of fair use or other equivalent, as
+ provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+ convey, without conditions so long as your license otherwise
+ remains in force. You may convey covered works to others for the
+ sole purpose of having them make modifications exclusively for
+ you, or provide you with facilities for running those works,
+ provided that you comply with the terms of this License in
+ conveying all material for which you do not control copyright.
+ Those thus making or running the covered works for you must do so
+ exclusively on your behalf, under your direction and control, on
+ terms that prohibit them from making any copies of your
+ copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+ the conditions stated below. Sublicensing is not allowed; section
+ 10 makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+ measure under any applicable law fulfilling obligations under
+ article 11 of the WIPO copyright treaty adopted on 20 December
+ 1996, or similar laws prohibiting or restricting circumvention of
+ such measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+ circumvention of technological measures to the extent such
+ circumvention is effected by exercising rights under this License
+ with respect to the covered work, and you disclaim any intention
+ to limit operation or modification of the work as a means of
+ enforcing, against the work's users, your or third parties' legal
+ rights to forbid circumvention of technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+ receive it, in any medium, provided that you conspicuously and
+ appropriately publish on each copy an appropriate copyright notice;
+ keep intact all notices stating that this License and any
+ non-permissive terms added in accord with section 7 apply to the
+ code; keep intact all notices of the absence of any warranty; and
+ give all recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+ and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+ produce it from the Program, in the form of source code under the
+ terms of section 4, provided that you also meet all of these
+ conditions:
+
+ a. The work must carry prominent notices stating that you
+ modified it, and giving a relevant date.
+
+ b. The work must carry prominent notices stating that it is
+ released under this License and any conditions added under
+ section 7. This requirement modifies the requirement in
+ section 4 to "keep intact all notices".
+
+ c. You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable
+ section 7 additional terms, to the whole of the work, and all
+ its parts, regardless of how they are packaged. This License
+ gives no permission to license the work in any other way, but
+ it does not invalidate such permission if you have separately
+ received it.
+
+ d. If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has
+ interactive interfaces that do not display Appropriate Legal
+ Notices, your work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+ works, which are not by their nature extensions of the covered
+ work, and which are not combined with it such as to form a larger
+ program, in or on a volume of a storage or distribution medium, is
+ called an "aggregate" if the compilation and its resulting
+ copyright are not used to limit the access or legal rights of the
+ compilation's users beyond what the individual works permit.
+ Inclusion of a covered work in an aggregate does not cause this
+ License to apply to the other parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+ of sections 4 and 5, provided that you also convey the
+ machine-readable Corresponding Source under the terms of this
+ License, in one of these ways:
+
+ a. Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b. Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for
+ as long as you offer spare parts or customer support for that
+ product model, to give anyone who possesses the object code
+ either (1) a copy of the Corresponding Source for all the
+ software in the product that is covered by this License, on a
+ durable physical medium customarily used for software
+ interchange, for a price no more than your reasonable cost of
+ physically performing this conveying of source, or (2) access
+ to copy the Corresponding Source from a network server at no
+ charge.
+
+ c. Convey individual copies of the object code with a copy of
+ the written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially,
+ and only if you received the object code with such an offer,
+ in accord with subsection 6b.
+
+ d. Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access
+ to the Corresponding Source in the same way through the same
+ place at no further charge. You need not require recipients
+ to copy the Corresponding Source along with the object code.
+ If the place to copy the object code is a network server, the
+ Corresponding Source may be on a different server (operated
+ by you or a third party) that supports equivalent copying
+ facilities, provided you maintain clear directions next to
+ the object code saying where to find the Corresponding Source.
+ Regardless of what server hosts the Corresponding Source, you
+ remain obligated to ensure that it is available for as long
+ as needed to satisfy these requirements.
+
+ e. Convey the object code using peer-to-peer transmission,
+ provided you inform other peers where the object code and
+ Corresponding Source of the work are being offered to the
+ general public at no charge under subsection 6d.
+
+
+ A separable portion of the object code, whose source code is
+ excluded from the Corresponding Source as a System Library, need
+ not be included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means
+ any tangible personal property which is normally used for personal,
+ family, or household purposes, or (2) anything designed or sold for
+ incorporation into a dwelling. In determining whether a product
+ is a consumer product, doubtful cases shall be resolved in favor of
+ coverage. For a particular product received by a particular user,
+ "normally used" refers to a typical or common use of that class of
+ product, regardless of the status of the particular user or of the
+ way in which the particular user actually uses, or expects or is
+ expected to use, the product. A product is a consumer product
+ regardless of whether the product has substantial commercial,
+ industrial or non-consumer uses, unless such uses represent the
+ only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+ procedures, authorization keys, or other information required to
+ install and execute modified versions of a covered work in that
+ User Product from a modified version of its Corresponding Source.
+ The information must suffice to ensure that the continued
+ functioning of the modified object code is in no case prevented or
+ interfered with solely because modification has been made.
+
+ If you convey an object code work under this section in, or with,
+ or specifically for use in, a User Product, and the conveying
+ occurs as part of a transaction in which the right of possession
+ and use of the User Product is transferred to the recipient in
+ perpetuity or for a fixed term (regardless of how the transaction
+ is characterized), the Corresponding Source conveyed under this
+ section must be accompanied by the Installation Information. But
+ this requirement does not apply if neither you nor any third party
+ retains the ability to install modified object code on the User
+ Product (for example, the work has been installed in ROM).
+
+ The requirement to provide Installation Information does not
+ include a requirement to continue to provide support service,
+ warranty, or updates for a work that has been modified or
+ installed by the recipient, or for the User Product in which it
+ has been modified or installed. Access to a network may be denied
+ when the modification itself materially and adversely affects the
+ operation of the network or violates the rules and protocols for
+ communication across the network.
+
+ Corresponding Source conveyed, and Installation Information
+ provided, in accord with this section must be in a format that is
+ publicly documented (and with an implementation available to the
+ public in source code form), and must require no special password
+ or key for unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of
+ this License by making exceptions from one or more of its
+ conditions. Additional permissions that are applicable to the
+ entire Program shall be treated as though they were included in
+ this License, to the extent that they are valid under applicable
+ law. If additional permissions apply only to part of the Program,
+ that part may be used separately under those permissions, but the
+ entire Program remains governed by this License without regard to
+ the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+ remove any additional permissions from that copy, or from any part
+ of it. (Additional permissions may be written to require their own
+ removal in certain cases when you modify the work.) You may place
+ additional permissions on material, added by you to a covered work,
+ for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material
+ you add to a covered work, you may (if authorized by the copyright
+ holders of that material) supplement the terms of this License
+ with terms:
+
+ a. Disclaiming warranty or limiting liability differently from
+ the terms of sections 15 and 16 of this License; or
+
+ b. Requiring preservation of specified reasonable legal notices
+ or author attributions in that material or in the Appropriate
+ Legal Notices displayed by works containing it; or
+
+ c. Prohibiting misrepresentation of the origin of that material,
+ or requiring that modified versions of such material be
+ marked in reasonable ways as different from the original
+ version; or
+
+ d. Limiting the use for publicity purposes of names of licensors
+ or authors of the material; or
+
+ e. Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f. Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified
+ versions of it) with contractual assumptions of liability to
+ the recipient, for any liability that these contractual
+ assumptions directly impose on those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+ restrictions" within the meaning of section 10. If the Program as
+ you received it, or any part of it, contains a notice stating that
+ it is governed by this License along with a term that is a further
+ restriction, you may remove that term. If a license document
+ contains a further restriction but permits relicensing or
+ conveying under this License, you may add to a covered work
+ material governed by the terms of that license document, provided
+ that the further restriction does not survive such relicensing or
+ conveying.
+
+ If you add terms to a covered work in accord with this section, you
+ must place, in the relevant source files, a statement of the
+ additional terms that apply to those files, or a notice indicating
+ where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in
+ the form of a separately written license, or stated as exceptions;
+ the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+ provided under this License. Any attempt otherwise to propagate or
+ modify it is void, and will automatically terminate your rights
+ under this License (including any patent licenses granted under
+ the third paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+ license from a particular copyright holder is reinstated (a)
+ provisionally, unless and until the copyright holder explicitly
+ and finally terminates your license, and (b) permanently, if the
+ copyright holder fails to notify you of the violation by some
+ reasonable means prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+ reinstated permanently if the copyright holder notifies you of the
+ violation by some reasonable means, this is the first time you have
+ received notice of violation of this License (for any work) from
+ that copyright holder, and you cure the violation prior to 30 days
+ after your receipt of the notice.
+
+ Termination of your rights under this section does not terminate
+ the licenses of parties who have received copies or rights from
+ you under this License. If your rights have been terminated and
+ not permanently reinstated, you do not qualify to receive new
+ licenses for the same material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+ run a copy of the Program. Ancillary propagation of a covered work
+ occurring solely as a consequence of using peer-to-peer
+ transmission to receive a copy likewise does not require
+ acceptance. However, nothing other than this License grants you
+ permission to propagate or modify any covered work. These actions
+ infringe copyright if you do not accept this License. Therefore,
+ by modifying or propagating a covered work, you indicate your
+ acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+ receives a license from the original licensors, to run, modify and
+ propagate that work, subject to this License. You are not
+ responsible for enforcing compliance by third parties with this
+ License.
+
+ An "entity transaction" is a transaction transferring control of an
+ organization, or substantially all assets of one, or subdividing an
+ organization, or merging organizations. If propagation of a
+ covered work results from an entity transaction, each party to that
+ transaction who receives a copy of the work also receives whatever
+ licenses to the work the party's predecessor in interest had or
+ could give under the previous paragraph, plus a right to
+ possession of the Corresponding Source of the work from the
+ predecessor in interest, if the predecessor has it or can get it
+ with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+ rights granted or affirmed under this License. For example, you
+ may not impose a license fee, royalty, or other charge for
+ exercise of rights granted under this License, and you may not
+ initiate litigation (including a cross-claim or counterclaim in a
+ lawsuit) alleging that any patent claim is infringed by making,
+ using, selling, offering for sale, or importing the Program or any
+ portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+ License of the Program or a work on which the Program is based.
+ The work thus licensed is called the contributor's "contributor
+ version".
+
+ A contributor's "essential patent claims" are all patent claims
+ owned or controlled by the contributor, whether already acquired or
+ hereafter acquired, that would be infringed by some manner,
+ permitted by this License, of making, using, or selling its
+ contributor version, but do not include claims that would be
+ infringed only as a consequence of further modification of the
+ contributor version. For purposes of this definition, "control"
+ includes the right to grant patent sublicenses in a manner
+ consistent with the requirements of this License.
+
+ Each contributor grants you a non-exclusive, worldwide,
+ royalty-free patent license under the contributor's essential
+ patent claims, to make, use, sell, offer for sale, import and
+ otherwise run, modify and propagate the contents of its
+ contributor version.
+
+ In the following three paragraphs, a "patent license" is any
+ express agreement or commitment, however denominated, not to
+ enforce a patent (such as an express permission to practice a
+ patent or covenant not to sue for patent infringement). To
+ "grant" such a patent license to a party means to make such an
+ agreement or commitment not to enforce a patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent
+ license, and the Corresponding Source of the work is not available
+ for anyone to copy, free of charge and under the terms of this
+ License, through a publicly available network server or other
+ readily accessible means, then you must either (1) cause the
+ Corresponding Source to be so available, or (2) arrange to deprive
+ yourself of the benefit of the patent license for this particular
+ work, or (3) arrange, in a manner consistent with the requirements
+ of this License, to extend the patent license to downstream
+ recipients. "Knowingly relying" means you have actual knowledge
+ that, but for the patent license, your conveying the covered work
+ in a country, or your recipient's use of the covered work in a
+ country, would infringe one or more identifiable patents in that
+ country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+ arrangement, you convey, or propagate by procuring conveyance of, a
+ covered work, and grant a patent license to some of the parties
+ receiving the covered work authorizing them to use, propagate,
+ modify or convey a specific copy of the covered work, then the
+ patent license you grant is automatically extended to all
+ recipients of the covered work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+ the scope of its coverage, prohibits the exercise of, or is
+ conditioned on the non-exercise of one or more of the rights that
+ are specifically granted under this License. You may not convey a
+ covered work if you are a party to an arrangement with a third
+ party that is in the business of distributing software, under
+ which you make payment to the third party based on the extent of
+ your activity of conveying the work, and under which the third
+ party grants, to any of the parties who would receive the covered
+ work from you, a discriminatory patent license (a) in connection
+ with copies of the covered work conveyed by you (or copies made
+ from those copies), or (b) primarily for and in connection with
+ specific products or compilations that contain the covered work,
+ unless you entered into that arrangement, or that patent license
+ was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+ any implied license or other defenses to infringement that may
+ otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order,
+ agreement or otherwise) that contradict the conditions of this
+ License, they do not excuse you from the conditions of this
+ License. If you cannot convey a covered work so as to satisfy
+ simultaneously your obligations under this License and any other
+ pertinent obligations, then as a consequence you may not convey it
+ at all. For example, if you agree to terms that obligate you to
+ collect a royalty for further conveying from those to whom you
+ convey the Program, the only way you could satisfy both those
+ terms and this License would be to refrain entirely from conveying
+ the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+ permission to link or combine any covered work with a work licensed
+ under version 3 of the GNU Affero General Public License into a
+ single combined work, and to convey the resulting work. The terms
+ of this License will continue to apply to the part which is the
+ covered work, but the special requirements of the GNU Affero
+ General Public License, section 13, concerning interaction through
+ a network will apply to the combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new
+ versions of the GNU General Public License from time to time.
+ Such new versions will be similar in spirit to the present
+ version, but may differ in detail to address new problems or
+ concerns.
+
+ Each version is given a distinguishing version number. If the
+ Program specifies that a certain numbered version of the GNU
+ General Public License "or any later version" applies to it, you
+ have the option of following the terms and conditions either of
+ that numbered version or of any later version published by the
+ Free Software Foundation. If the Program does not specify a
+ version number of the GNU General Public License, you may choose
+ any version ever published by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+ versions of the GNU General Public License can be used, that
+ proxy's public statement of acceptance of a version permanently
+ authorizes you to choose that version for the Program.
+
+ Later license versions may give you additional or different
+ permissions. However, no additional obligations are imposed on any
+ author or copyright holder as a result of your choosing to follow a
+ later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE
+ COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS"
+ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE
+ RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.
+ SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
+ NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+ WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES
+ AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU
+ FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+ CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
+ THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
+ BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
+ THE POSSIBILITY OF SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+ above cannot be given local legal effect according to their terms,
+ reviewing courts shall apply local law that most closely
+ approximates an absolute waiver of all civil liability in
+ connection with the Program, unless a warranty or assumption of
+ liability accompanies a copy of the Program in return for a fee.
+
+
+END OF TERMS AND CONDITIONS
+===========================
+
+How to Apply These Terms to Your New Programs
+=============================================
+
+If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these
+terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
+ Copyright (C) YEAR NAME OF AUTHOR
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or (at
+ your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see `http://www.gnu.org/licenses/'.
+
+ Also add information on how to contact you by electronic and paper
+mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ PROGRAM Copyright (C) YEAR NAME OF AUTHOR
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+ The hypothetical commands `show w' and `show c' should show the
+appropriate parts of the General Public License. Of course, your
+program's commands might be different; for a GUI interface, you would
+use an "about box".
+
+ You should also get your employer (if you work as a programmer) or
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. For more information on this, and how to apply and follow
+the GNU GPL, see `http://www.gnu.org/licenses/'.
+
+ The GNU General Public License does not permit incorporating your
+program into proprietary programs. If your program is a subroutine
+library, you may consider it more useful to permit linking proprietary
+applications with the library. If this is what you want to do, use the
+GNU Lesser General Public License instead of this License. But first,
+please read `http://www.gnu.org/philosophy/why-not-lgpl.html'.
+
+
+File: gccint.info, Node: GNU Free Documentation License, Next: Contributors, Prev: Copying, Up: Top
+
+GNU Free Documentation License
+******************************
+
+ Version 1.2, November 2002
+
+ Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ 0. PREAMBLE
+
+ The purpose of this License is to make a manual, textbook, or other
+ functional and useful document "free" in the sense of freedom: to
+ assure everyone the effective freedom to copy and redistribute it,
+ with or without modifying it, either commercially or
+ noncommercially. Secondarily, this License preserves for the
+ author and publisher a way to get credit for their work, while not
+ being considered responsible for modifications made by others.
+
+ This License is a kind of "copyleft", which means that derivative
+ works of the document must themselves be free in the same sense.
+ It complements the GNU General Public License, which is a copyleft
+ license designed for free software.
+
+ We have designed this License in order to use it for manuals for
+ free software, because free software needs free documentation: a
+ free program should come with manuals providing the same freedoms
+ that the software does. But this License is not limited to
+ software manuals; it can be used for any textual work, regardless
+ of subject matter or whether it is published as a printed book.
+ We recommend this License principally for works whose purpose is
+ instruction or reference.
+
+ 1. APPLICABILITY AND DEFINITIONS
+
+ This License applies to any manual or other work, in any medium,
+ that contains a notice placed by the copyright holder saying it
+ can be distributed under the terms of this License. Such a notice
+ grants a world-wide, royalty-free license, unlimited in duration,
+ to use that work under the conditions stated herein. The
+ "Document", below, refers to any such manual or work. Any member
+ of the public is a licensee, and is addressed as "you". You
+ accept the license if you copy, modify or distribute the work in a
+ way requiring permission under copyright law.
+
+ A "Modified Version" of the Document means any work containing the
+ Document or a portion of it, either copied verbatim, or with
+ modifications and/or translated into another language.
+
+ A "Secondary Section" is a named appendix or a front-matter section
+ of the Document that deals exclusively with the relationship of the
+ publishers or authors of the Document to the Document's overall
+ subject (or to related matters) and contains nothing that could
+ fall directly within that overall subject. (Thus, if the Document
+ is in part a textbook of mathematics, a Secondary Section may not
+ explain any mathematics.) The relationship could be a matter of
+ historical connection with the subject or with related matters, or
+ of legal, commercial, philosophical, ethical or political position
+ regarding them.
+
+ The "Invariant Sections" are certain Secondary Sections whose
+ titles are designated, as being those of Invariant Sections, in
+ the notice that says that the Document is released under this
+ License. If a section does not fit the above definition of
+ Secondary then it is not allowed to be designated as Invariant.
+ The Document may contain zero Invariant Sections. If the Document
+ does not identify any Invariant Sections then there are none.
+
+ The "Cover Texts" are certain short passages of text that are
+ listed, as Front-Cover Texts or Back-Cover Texts, in the notice
+ that says that the Document is released under this License. A
+ Front-Cover Text may be at most 5 words, and a Back-Cover Text may
+ be at most 25 words.
+
+ A "Transparent" copy of the Document means a machine-readable copy,
+ represented in a format whose specification is available to the
+ general public, that is suitable for revising the document
+ straightforwardly with generic text editors or (for images
+ composed of pixels) generic paint programs or (for drawings) some
+ widely available drawing editor, and that is suitable for input to
+ text formatters or for automatic translation to a variety of
+ formats suitable for input to text formatters. A copy made in an
+ otherwise Transparent file format whose markup, or absence of
+ markup, has been arranged to thwart or discourage subsequent
+ modification by readers is not Transparent. An image format is
+ not Transparent if used for any substantial amount of text. A
+ copy that is not "Transparent" is called "Opaque".
+
+ Examples of suitable formats for Transparent copies include plain
+ ASCII without markup, Texinfo input format, LaTeX input format,
+ SGML or XML using a publicly available DTD, and
+ standard-conforming simple HTML, PostScript or PDF designed for
+ human modification. Examples of transparent image formats include
+ PNG, XCF and JPG. Opaque formats include proprietary formats that
+ can be read and edited only by proprietary word processors, SGML or
+ XML for which the DTD and/or processing tools are not generally
+ available, and the machine-generated HTML, PostScript or PDF
+ produced by some word processors for output purposes only.
+
+ The "Title Page" means, for a printed book, the title page itself,
+ plus such following pages as are needed to hold, legibly, the
+ material this License requires to appear in the title page. For
+ works in formats which do not have any title page as such, "Title
+ Page" means the text near the most prominent appearance of the
+ work's title, preceding the beginning of the body of the text.
+
+ A section "Entitled XYZ" means a named subunit of the Document
+ whose title either is precisely XYZ or contains XYZ in parentheses
+ following text that translates XYZ in another language. (Here XYZ
+ stands for a specific section name mentioned below, such as
+ "Acknowledgements", "Dedications", "Endorsements", or "History".)
+ To "Preserve the Title" of such a section when you modify the
+ Document means that it remains a section "Entitled XYZ" according
+ to this definition.
+
+ The Document may include Warranty Disclaimers next to the notice
+ which states that this License applies to the Document. These
+ Warranty Disclaimers are considered to be included by reference in
+ this License, but only as regards disclaiming warranties: any other
+ implication that these Warranty Disclaimers may have is void and
+ has no effect on the meaning of this License.
+
+ 2. VERBATIM COPYING
+
+ You may copy and distribute the Document in any medium, either
+ commercially or noncommercially, provided that this License, the
+ copyright notices, and the license notice saying this License
+ applies to the Document are reproduced in all copies, and that you
+ add no other conditions whatsoever to those of this License. You
+ may not use technical measures to obstruct or control the reading
+ or further copying of the copies you make or distribute. However,
+ you may accept compensation in exchange for copies. If you
+ distribute a large enough number of copies you must also follow
+ the conditions in section 3.
+
+ You may also lend copies, under the same conditions stated above,
+ and you may publicly display copies.
+
+ 3. COPYING IN QUANTITY
+
+ If you publish printed copies (or copies in media that commonly
+ have printed covers) of the Document, numbering more than 100, and
+ the Document's license notice requires Cover Texts, you must
+ enclose the copies in covers that carry, clearly and legibly, all
+ these Cover Texts: Front-Cover Texts on the front cover, and
+ Back-Cover Texts on the back cover. Both covers must also clearly
+ and legibly identify you as the publisher of these copies. The
+ front cover must present the full title with all words of the
+ title equally prominent and visible. You may add other material
+ on the covers in addition. Copying with changes limited to the
+ covers, as long as they preserve the title of the Document and
+ satisfy these conditions, can be treated as verbatim copying in
+ other respects.
+
+ If the required texts for either cover are too voluminous to fit
+ legibly, you should put the first ones listed (as many as fit
+ reasonably) on the actual cover, and continue the rest onto
+ adjacent pages.
+
+ If you publish or distribute Opaque copies of the Document
+ numbering more than 100, you must either include a
+ machine-readable Transparent copy along with each Opaque copy, or
+ state in or with each Opaque copy a computer-network location from
+ which the general network-using public has access to download
+ using public-standard network protocols a complete Transparent
+ copy of the Document, free of added material. If you use the
+ latter option, you must take reasonably prudent steps, when you
+ begin distribution of Opaque copies in quantity, to ensure that
+ this Transparent copy will remain thus accessible at the stated
+ location until at least one year after the last time you
+ distribute an Opaque copy (directly or through your agents or
+ retailers) of that edition to the public.
+
+ It is requested, but not required, that you contact the authors of
+ the Document well before redistributing any large number of
+ copies, to give them a chance to provide you with an updated
+ version of the Document.
+
+ 4. MODIFICATIONS
+
+ You may copy and distribute a Modified Version of the Document
+ under the conditions of sections 2 and 3 above, provided that you
+ release the Modified Version under precisely this License, with
+ the Modified Version filling the role of the Document, thus
+ licensing distribution and modification of the Modified Version to
+ whoever possesses a copy of it. In addition, you must do these
+ things in the Modified Version:
+
+ A. Use in the Title Page (and on the covers, if any) a title
+ distinct from that of the Document, and from those of
+ previous versions (which should, if there were any, be listed
+ in the History section of the Document). You may use the
+ same title as a previous version if the original publisher of
+ that version gives permission.
+
+ B. List on the Title Page, as authors, one or more persons or
+ entities responsible for authorship of the modifications in
+ the Modified Version, together with at least five of the
+ principal authors of the Document (all of its principal
+ authors, if it has fewer than five), unless they release you
+ from this requirement.
+
+ C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+
+ D. Preserve all the copyright notices of the Document.
+
+ E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+
+ F. Include, immediately after the copyright notices, a license
+ notice giving the public permission to use the Modified
+ Version under the terms of this License, in the form shown in
+ the Addendum below.
+
+ G. Preserve in that license notice the full lists of Invariant
+ Sections and required Cover Texts given in the Document's
+ license notice.
+
+ H. Include an unaltered copy of this License.
+
+ I. Preserve the section Entitled "History", Preserve its Title,
+ and add to it an item stating at least the title, year, new
+ authors, and publisher of the Modified Version as given on
+ the Title Page. If there is no section Entitled "History" in
+ the Document, create one stating the title, year, authors,
+ and publisher of the Document as given on its Title Page,
+ then add an item describing the Modified Version as stated in
+ the previous sentence.
+
+ J. Preserve the network location, if any, given in the Document
+ for public access to a Transparent copy of the Document, and
+ likewise the network locations given in the Document for
+ previous versions it was based on. These may be placed in
+ the "History" section. You may omit a network location for a
+ work that was published at least four years before the
+ Document itself, or if the original publisher of the version
+ it refers to gives permission.
+
+ K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the
+ section all the substance and tone of each of the contributor
+ acknowledgements and/or dedications given therein.
+
+ L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section
+ titles.
+
+ M. Delete any section Entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+
+ N. Do not retitle any existing section to be Entitled
+ "Endorsements" or to conflict in title with any Invariant
+ Section.
+
+ O. Preserve any Warranty Disclaimers.
+
+ If the Modified Version includes new front-matter sections or
+ appendices that qualify as Secondary Sections and contain no
+ material copied from the Document, you may at your option
+ designate some or all of these sections as invariant. To do this,
+ add their titles to the list of Invariant Sections in the Modified
+ Version's license notice. These titles must be distinct from any
+ other section titles.
+
+ You may add a section Entitled "Endorsements", provided it contains
+ nothing but endorsements of your Modified Version by various
+ parties--for example, statements of peer review or that the text
+ has been approved by an organization as the authoritative
+ definition of a standard.
+
+ You may add a passage of up to five words as a Front-Cover Text,
+ and a passage of up to 25 words as a Back-Cover Text, to the end
+ of the list of Cover Texts in the Modified Version. Only one
+ passage of Front-Cover Text and one of Back-Cover Text may be
+ added by (or through arrangements made by) any one entity. If the
+ Document already includes a cover text for the same cover,
+ previously added by you or by arrangement made by the same entity
+ you are acting on behalf of, you may not add another; but you may
+ replace the old one, on explicit permission from the previous
+ publisher that added the old one.
+
+ The author(s) and publisher(s) of the Document do not by this
+ License give permission to use their names for publicity for or to
+ assert or imply endorsement of any Modified Version.
+
+ 5. COMBINING DOCUMENTS
+
+ You may combine the Document with other documents released under
+ this License, under the terms defined in section 4 above for
+ modified versions, provided that you include in the combination
+ all of the Invariant Sections of all of the original documents,
+ unmodified, and list them all as Invariant Sections of your
+ combined work in its license notice, and that you preserve all
+ their Warranty Disclaimers.
+
+ The combined work need only contain one copy of this License, and
+ multiple identical Invariant Sections may be replaced with a single
+ copy. If there are multiple Invariant Sections with the same name
+ but different contents, make the title of each such section unique
+ by adding at the end of it, in parentheses, the name of the
+ original author or publisher of that section if known, or else a
+ unique number. Make the same adjustment to the section titles in
+ the list of Invariant Sections in the license notice of the
+ combined work.
+
+ In the combination, you must combine any sections Entitled
+ "History" in the various original documents, forming one section
+ Entitled "History"; likewise combine any sections Entitled
+ "Acknowledgements", and any sections Entitled "Dedications". You
+ must delete all sections Entitled "Endorsements."
+
+ 6. COLLECTIONS OF DOCUMENTS
+
+ You may make a collection consisting of the Document and other
+ documents released under this License, and replace the individual
+ copies of this License in the various documents with a single copy
+ that is included in the collection, provided that you follow the
+ rules of this License for verbatim copying of each of the
+ documents in all other respects.
+
+ You may extract a single document from such a collection, and
+ distribute it individually under this License, provided you insert
+ a copy of this License into the extracted document, and follow
+ this License in all other respects regarding verbatim copying of
+ that document.
+
+ 7. AGGREGATION WITH INDEPENDENT WORKS
+
+ A compilation of the Document or its derivatives with other
+ separate and independent documents or works, in or on a volume of
+ a storage or distribution medium, is called an "aggregate" if the
+ copyright resulting from the compilation is not used to limit the
+ legal rights of the compilation's users beyond what the individual
+ works permit. When the Document is included in an aggregate, this
+ License does not apply to the other works in the aggregate which
+ are not themselves derivative works of the Document.
+
+ If the Cover Text requirement of section 3 is applicable to these
+ copies of the Document, then if the Document is less than one half
+ of the entire aggregate, the Document's Cover Texts may be placed
+ on covers that bracket the Document within the aggregate, or the
+ electronic equivalent of covers if the Document is in electronic
+ form. Otherwise they must appear on printed covers that bracket
+ the whole aggregate.
+
+ 8. TRANSLATION
+
+ Translation is considered a kind of modification, so you may
+ distribute translations of the Document under the terms of section
+ 4. Replacing Invariant Sections with translations requires special
+ permission from their copyright holders, but you may include
+ translations of some or all Invariant Sections in addition to the
+ original versions of these Invariant Sections. You may include a
+ translation of this License, and all the license notices in the
+ Document, and any Warranty Disclaimers, provided that you also
+ include the original English version of this License and the
+ original versions of those notices and disclaimers. In case of a
+ disagreement between the translation and the original version of
+ this License or a notice or disclaimer, the original version will
+ prevail.
+
+ If a section in the Document is Entitled "Acknowledgements",
+ "Dedications", or "History", the requirement (section 4) to
+ Preserve its Title (section 1) will typically require changing the
+ actual title.
+
+ 9. TERMINATION
+
+ You may not copy, modify, sublicense, or distribute the Document
+ except as expressly provided for under this License. Any other
+ attempt to copy, modify, sublicense or distribute the Document is
+ void, and will automatically terminate your rights under this
+ License. However, parties who have received copies, or rights,
+ from you under this License will not have their licenses
+ terminated so long as such parties remain in full compliance.
+
+ 10. FUTURE REVISIONS OF THIS LICENSE
+
+ The Free Software Foundation may publish new, revised versions of
+ the GNU Free Documentation License from time to time. Such new
+ versions will be similar in spirit to the present version, but may
+ differ in detail to address new problems or concerns. See
+ `http://www.gnu.org/copyleft/'.
+
+ Each version of the License is given a distinguishing version
+ number. If the Document specifies that a particular numbered
+ version of this License "or any later version" applies to it, you
+ have the option of following the terms and conditions either of
+ that specified version or of any later version that has been
+ published (not as a draft) by the Free Software Foundation. If
+ the Document does not specify a version number of this License,
+ you may choose any version ever published (not as a draft) by the
+ Free Software Foundation.
+
+ADDENDUM: How to use this License for your documents
+====================================================
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and license
+notices just after the title page:
+
+ Copyright (C) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.2
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+ Texts. A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
+
+ If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with
+ the Front-Cover Texts being LIST, and with the Back-Cover Texts
+ being LIST.
+
+ If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+ If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License, to
+permit their use in free software.
+
+
+File: gccint.info, Node: Contributors, Next: Option Index, Prev: GNU Free Documentation License, Up: Top
+
+Contributors to GCC
+*******************
+
+The GCC project would like to thank its many contributors. Without
+them the project would not have been nearly as successful as it has
+been. Any omissions in this list are accidental. Feel free to contact
+<law@redhat.com> or <gerald@pfeifer.com> if you have been left out or
+some of your contributions are not listed. Please keep this list in
+alphabetical order.
+
+ * Analog Devices helped implement the support for complex data types
+ and iterators.
+
+ * John David Anglin for threading-related fixes and improvements to
+ libstdc++-v3, and the HP-UX port.
+
+ * James van Artsdalen wrote the code that makes efficient use of the
+ Intel 80387 register stack.
+
+ * Abramo and Roberto Bagnara for the SysV68 Motorola 3300 Delta
+ Series port.
+
+ * Alasdair Baird for various bug fixes.
+
+ * Giovanni Bajo for analyzing lots of complicated C++ problem
+ reports.
+
+ * Peter Barada for his work to improve code generation for new
+ ColdFire cores.
+
+ * Gerald Baumgartner added the signature extension to the C++ front
+ end.
+
+ * Godmar Back for his Java improvements and encouragement.
+
+ * Scott Bambrough for help porting the Java compiler.
+
+ * Wolfgang Bangerth for processing tons of bug reports.
+
+ * Jon Beniston for his Microsoft Windows port of Java.
+
+ * Daniel Berlin for better DWARF2 support, faster/better
+ optimizations, improved alias analysis, plus migrating GCC to
+ Bugzilla.
+
+ * Geoff Berry for his Java object serialization work and various
+ patches.
+
+ * Uros Bizjak for the implementation of x87 math built-in functions
+ and for various middle end and i386 back end improvements and bug
+ fixes.
+
+ * Eric Blake for helping to make GCJ and libgcj conform to the
+ specifications.
+
+ * Janne Blomqvist for contributions to GNU Fortran.
+
+ * Segher Boessenkool for various fixes.
+
+ * Hans-J. Boehm for his garbage collector, IA-64 libffi port, and
+ other Java work.
+
+ * Neil Booth for work on cpplib, lang hooks, debug hooks and other
+ miscellaneous clean-ups.
+
+ * Steven Bosscher for integrating the GNU Fortran front end into GCC
+ and for contributing to the tree-ssa branch.
+
+ * Eric Botcazou for fixing middle- and backend bugs left and right.
+
+ * Per Bothner for his direction via the steering committee and
+ various improvements to the infrastructure for supporting new
+ languages. Chill front end implementation. Initial
+ implementations of cpplib, fix-header, config.guess, libio, and
+ past C++ library (libg++) maintainer. Dreaming up, designing and
+ implementing much of GCJ.
+
+ * Devon Bowen helped port GCC to the Tahoe.
+
+ * Don Bowman for mips-vxworks contributions.
+
+ * Dave Brolley for work on cpplib and Chill.
+
+ * Paul Brook for work on the ARM architecture and maintaining GNU
+ Fortran.
+
+ * Robert Brown implemented the support for Encore 32000 systems.
+
+ * Christian Bruel for improvements to local store elimination.
+
+ * Herman A.J. ten Brugge for various fixes.
+
+ * Joerg Brunsmann for Java compiler hacking and help with the GCJ
+ FAQ.
+
+ * Joe Buck for his direction via the steering committee.
+
+ * Craig Burley for leadership of the G77 Fortran effort.
+
+ * Stephan Buys for contributing Doxygen notes for libstdc++.
+
+ * Paolo Carlini for libstdc++ work: lots of efficiency improvements
+ to the C++ strings, streambufs and formatted I/O, hard detective
+ work on the frustrating localization issues, and keeping up with
+ the problem reports.
+
+ * John Carr for his alias work, SPARC hacking, infrastructure
+ improvements, previous contributions to the steering committee,
+ loop optimizations, etc.
+
+ * Stephane Carrez for 68HC11 and 68HC12 ports.
+
+ * Steve Chamberlain for support for the Renesas SH and H8 processors
+ and the PicoJava processor, and for GCJ config fixes.
+
+ * Glenn Chambers for help with the GCJ FAQ.
+
+ * John-Marc Chandonia for various libgcj patches.
+
+ * Scott Christley for his Objective-C contributions.
+
+ * Eric Christopher for his Java porting help and clean-ups.
+
+ * Branko Cibej for more warning contributions.
+
+ * The GNU Classpath project for all of their merged runtime code.
+
+ * Nick Clifton for arm, mcore, fr30, v850, m32r work, `--help', and
+ other random hacking.
+
+ * Michael Cook for libstdc++ cleanup patches to reduce warnings.
+
+ * R. Kelley Cook for making GCC buildable from a read-only directory
+ as well as other miscellaneous build process and documentation
+ clean-ups.
+
+ * Ralf Corsepius for SH testing and minor bug fixing.
+
+ * Stan Cox for care and feeding of the x86 port and lots of behind
+ the scenes hacking.
+
+ * Alex Crain provided changes for the 3b1.
+
+ * Ian Dall for major improvements to the NS32k port.
+
+ * Paul Dale for his work to add uClinux platform support to the m68k
+ backend.
+
+ * Dario Dariol contributed the four varieties of sample programs
+ that print a copy of their source.
+
+ * Russell Davidson for fstream and stringstream fixes in libstdc++.
+
+ * Bud Davis for work on the G77 and GNU Fortran compilers.
+
+ * Mo DeJong for GCJ and libgcj bug fixes.
+
+ * DJ Delorie for the DJGPP port, build and libiberty maintenance,
+ various bug fixes, and the M32C port.
+
+ * Arnaud Desitter for helping to debug GNU Fortran.
+
+ * Gabriel Dos Reis for contributions to G++, contributions and
+ maintenance of GCC diagnostics infrastructure, libstdc++-v3,
+ including `valarray<>', `complex<>', maintaining the numerics
+ library (including that pesky `<limits>' :-) and keeping
+ up-to-date anything to do with numbers.
+
+ * Ulrich Drepper for his work on glibc, testing of GCC using glibc,
+ ISO C99 support, CFG dumping support, etc., plus support of the
+ C++ runtime libraries including for all kinds of C interface
+ issues, contributing and maintaining `complex<>', sanity checking
+ and disbursement, configuration architecture, libio maintenance,
+ and early math work.
+
+ * Zdenek Dvorak for a new loop unroller and various fixes.
+
+ * Richard Earnshaw for his ongoing work with the ARM.
+
+ * David Edelsohn for his direction via the steering committee,
+ ongoing work with the RS6000/PowerPC port, help cleaning up Haifa
+ loop changes, doing the entire AIX port of libstdc++ with his bare
+ hands, and for ensuring GCC properly keeps working on AIX.
+
+ * Kevin Ediger for the floating point formatting of num_put::do_put
+ in libstdc++.
+
+ * Phil Edwards for libstdc++ work including configuration hackery,
+ documentation maintainer, chief breaker of the web pages, the
+ occasional iostream bug fix, and work on shared library symbol
+ versioning.
+
+ * Paul Eggert for random hacking all over GCC.
+
+ * Mark Elbrecht for various DJGPP improvements, and for libstdc++
+ configuration support for locales and fstream-related fixes.
+
+ * Vadim Egorov for libstdc++ fixes in strings, streambufs, and
+ iostreams.
+
+ * Christian Ehrhardt for dealing with bug reports.
+
+ * Ben Elliston for his work to move the Objective-C runtime into its
+ own subdirectory and for his work on autoconf.
+
+ * Revital Eres for work on the PowerPC 750CL port.
+
+ * Marc Espie for OpenBSD support.
+
+ * Doug Evans for much of the global optimization framework, arc,
+ m32r, and SPARC work.
+
+ * Christopher Faylor for his work on the Cygwin port and for caring
+ and feeding the gcc.gnu.org box and saving its users tons of spam.
+
+ * Fred Fish for BeOS support and Ada fixes.
+
+ * Ivan Fontes Garcia for the Portuguese translation of the GCJ FAQ.
+
+ * Peter Gerwinski for various bug fixes and the Pascal front end.
+
+ * Kaveh R. Ghazi for his direction via the steering committee,
+ amazing work to make `-W -Wall -W* -Werror' useful, and
+ continuously testing GCC on a plethora of platforms. Kaveh
+ extends his gratitude to the CAIP Center at Rutgers University for
+ providing him with computing resources to work on Free Software
+ since the late 1980s.
+
+ * John Gilmore for a donation to the FSF earmarked improving GNU
+ Java.
+
+ * Judy Goldberg for c++ contributions.
+
+ * Torbjorn Granlund for various fixes and the c-torture testsuite,
+ multiply- and divide-by-constant optimization, improved long long
+ support, improved leaf function register allocation, and his
+ direction via the steering committee.
+
+ * Anthony Green for his `-Os' contributions and Java front end work.
+
+ * Stu Grossman for gdb hacking, allowing GCJ developers to debug
+ Java code.
+
+ * Michael K. Gschwind contributed the port to the PDP-11.
+
+ * Ron Guilmette implemented the `protoize' and `unprotoize' tools,
+ the support for Dwarf symbolic debugging information, and much of
+ the support for System V Release 4. He has also worked heavily on
+ the Intel 386 and 860 support.
+
+ * Mostafa Hagog for Swing Modulo Scheduling (SMS) and post reload
+ GCSE.
+
+ * Bruno Haible for improvements in the runtime overhead for EH, new
+ warnings and assorted bug fixes.
+
+ * Andrew Haley for his amazing Java compiler and library efforts.
+
+ * Chris Hanson assisted in making GCC work on HP-UX for the 9000
+ series 300.
+
+ * Michael Hayes for various thankless work he's done trying to get
+ the c30/c40 ports functional. Lots of loop and unroll
+ improvements and fixes.
+
+ * Dara Hazeghi for wading through myriads of target-specific bug
+ reports.
+
+ * Kate Hedstrom for staking the G77 folks with an initial testsuite.
+
+ * Richard Henderson for his ongoing SPARC, alpha, ia32, and ia64
+ work, loop opts, and generally fixing lots of old problems we've
+ ignored for years, flow rewrite and lots of further stuff,
+ including reviewing tons of patches.
+
+ * Aldy Hernandez for working on the PowerPC port, SIMD support, and
+ various fixes.
+
+ * Nobuyuki Hikichi of Software Research Associates, Tokyo,
+ contributed the support for the Sony NEWS machine.
+
+ * Kazu Hirata for caring and feeding the Renesas H8/300 port and
+ various fixes.
+
+ * Katherine Holcomb for work on GNU Fortran.
+
+ * Manfred Hollstein for his ongoing work to keep the m88k alive, lots
+ of testing and bug fixing, particularly of GCC configury code.
+
+ * Steve Holmgren for MachTen patches.
+
+ * Jan Hubicka for his x86 port improvements.
+
+ * Falk Hueffner for working on C and optimization bug reports.
+
+ * Bernardo Innocenti for his m68k work, including merging of
+ ColdFire improvements and uClinux support.
+
+ * Christian Iseli for various bug fixes.
+
+ * Kamil Iskra for general m68k hacking.
+
+ * Lee Iverson for random fixes and MIPS testing.
+
+ * Andreas Jaeger for testing and benchmarking of GCC and various bug
+ fixes.
+
+ * Jakub Jelinek for his SPARC work and sibling call optimizations as
+ well as lots of bug fixes and test cases, and for improving the
+ Java build system.
+
+ * Janis Johnson for ia64 testing and fixes, her quality improvement
+ sidetracks, and web page maintenance.
+
+ * Kean Johnston for SCO OpenServer support and various fixes.
+
+ * Tim Josling for the sample language treelang based originally on
+ Richard Kenner's "toy" language.
+
+ * Nicolai Josuttis for additional libstdc++ documentation.
+
+ * Klaus Kaempf for his ongoing work to make alpha-vms a viable
+ target.
+
+ * Steven G. Kargl for work on GNU Fortran.
+
+ * David Kashtan of SRI adapted GCC to VMS.
+
+ * Ryszard Kabatek for many, many libstdc++ bug fixes and
+ optimizations of strings, especially member functions, and for
+ auto_ptr fixes.
+
+ * Geoffrey Keating for his ongoing work to make the PPC work for
+ GNU/Linux and his automatic regression tester.
+
+ * Brendan Kehoe for his ongoing work with G++ and for a lot of early
+ work in just about every part of libstdc++.
+
+ * Oliver M. Kellogg of Deutsche Aerospace contributed the port to the
+ MIL-STD-1750A.
+
+ * Richard Kenner of the New York University Ultracomputer Research
+ Laboratory wrote the machine descriptions for the AMD 29000, the
+ DEC Alpha, the IBM RT PC, and the IBM RS/6000 as well as the
+ support for instruction attributes. He also made changes to
+ better support RISC processors including changes to common
+ subexpression elimination, strength reduction, function calling
+ sequence handling, and condition code support, in addition to
+ generalizing the code for frame pointer elimination and delay slot
+ scheduling. Richard Kenner was also the head maintainer of GCC
+ for several years.
+
+ * Mumit Khan for various contributions to the Cygwin and Mingw32
+ ports and maintaining binary releases for Microsoft Windows hosts,
+ and for massive libstdc++ porting work to Cygwin/Mingw32.
+
+ * Robin Kirkham for cpu32 support.
+
+ * Mark Klein for PA improvements.
+
+ * Thomas Koenig for various bug fixes.
+
+ * Bruce Korb for the new and improved fixincludes code.
+
+ * Benjamin Kosnik for his G++ work and for leading the libstdc++-v3
+ effort.
+
+ * Charles LaBrec contributed the support for the Integrated Solutions
+ 68020 system.
+
+ * Asher Langton and Mike Kumbera for contributing Cray pointer
+ support to GNU Fortran, and for other GNU Fortran improvements.
+
+ * Jeff Law for his direction via the steering committee,
+ coordinating the entire egcs project and GCC 2.95, rolling out
+ snapshots and releases, handling merges from GCC2, reviewing tons
+ of patches that might have fallen through the cracks else, and
+ random but extensive hacking.
+
+ * Marc Lehmann for his direction via the steering committee and
+ helping with analysis and improvements of x86 performance.
+
+ * Victor Leikehman for work on GNU Fortran.
+
+ * Ted Lemon wrote parts of the RTL reader and printer.
+
+ * Kriang Lerdsuwanakij for C++ improvements including template as
+ template parameter support, and many C++ fixes.
+
+ * Warren Levy for tremendous work on libgcj (Java Runtime Library)
+ and random work on the Java front end.
+
+ * Alain Lichnewsky ported GCC to the MIPS CPU.
+
+ * Oskar Liljeblad for hacking on AWT and his many Java bug reports
+ and patches.
+
+ * Robert Lipe for OpenServer support, new testsuites, testing, etc.
+
+ * Chen Liqin for various S+core related fixes/improvement, and for
+ maintaining the S+core port.
+
+ * Weiwen Liu for testing and various bug fixes.
+
+ * Manuel Lo'pez-Iba'n~ez for improving `-Wconversion' and many other
+ diagnostics fixes and improvements.
+
+ * Dave Love for his ongoing work with the Fortran front end and
+ runtime libraries.
+
+ * Martin von Lo"wis for internal consistency checking infrastructure,
+ various C++ improvements including namespace support, and tons of
+ assistance with libstdc++/compiler merges.
+
+ * H.J. Lu for his previous contributions to the steering committee,
+ many x86 bug reports, prototype patches, and keeping the GNU/Linux
+ ports working.
+
+ * Greg McGary for random fixes and (someday) bounded pointers.
+
+ * Andrew MacLeod for his ongoing work in building a real EH system,
+ various code generation improvements, work on the global
+ optimizer, etc.
+
+ * Vladimir Makarov for hacking some ugly i960 problems, PowerPC
+ hacking improvements to compile-time performance, overall
+ knowledge and direction in the area of instruction scheduling, and
+ design and implementation of the automaton based instruction
+ scheduler.
+
+ * Bob Manson for his behind the scenes work on dejagnu.
+
+ * Philip Martin for lots of libstdc++ string and vector iterator
+ fixes and improvements, and string clean up and testsuites.
+
+ * All of the Mauve project contributors, for Java test code.
+
+ * Bryce McKinlay for numerous GCJ and libgcj fixes and improvements.
+
+ * Adam Megacz for his work on the Microsoft Windows port of GCJ.
+
+ * Michael Meissner for LRS framework, ia32, m32r, v850, m88k, MIPS,
+ powerpc, haifa, ECOFF debug support, and other assorted hacking.
+
+ * Jason Merrill for his direction via the steering committee and
+ leading the G++ effort.
+
+ * Martin Michlmayr for testing GCC on several architectures using the
+ entire Debian archive.
+
+ * David Miller for his direction via the steering committee, lots of
+ SPARC work, improvements in jump.c and interfacing with the Linux
+ kernel developers.
+
+ * Gary Miller ported GCC to Charles River Data Systems machines.
+
+ * Alfred Minarik for libstdc++ string and ios bug fixes, and turning
+ the entire libstdc++ testsuite namespace-compatible.
+
+ * Mark Mitchell for his direction via the steering committee,
+ mountains of C++ work, load/store hoisting out of loops, alias
+ analysis improvements, ISO C `restrict' support, and serving as
+ release manager for GCC 3.x.
+
+ * Alan Modra for various GNU/Linux bits and testing.
+
+ * Toon Moene for his direction via the steering committee, Fortran
+ maintenance, and his ongoing work to make us make Fortran run fast.
+
+ * Jason Molenda for major help in the care and feeding of all the
+ services on the gcc.gnu.org (formerly egcs.cygnus.com)
+ machine--mail, web services, ftp services, etc etc. Doing all
+ this work on scrap paper and the backs of envelopes would have
+ been... difficult.
+
+ * Catherine Moore for fixing various ugly problems we have sent her
+ way, including the haifa bug which was killing the Alpha & PowerPC
+ Linux kernels.
+
+ * Mike Moreton for his various Java patches.
+
+ * David Mosberger-Tang for various Alpha improvements, and for the
+ initial IA-64 port.
+
+ * Stephen Moshier contributed the floating point emulator that
+ assists in cross-compilation and permits support for floating
+ point numbers wider than 64 bits and for ISO C99 support.
+
+ * Bill Moyer for his behind the scenes work on various issues.
+
+ * Philippe De Muyter for his work on the m68k port.
+
+ * Joseph S. Myers for his work on the PDP-11 port, format checking
+ and ISO C99 support, and continuous emphasis on (and contributions
+ to) documentation.
+
+ * Nathan Myers for his work on libstdc++-v3: architecture and
+ authorship through the first three snapshots, including
+ implementation of locale infrastructure, string, shadow C headers,
+ and the initial project documentation (DESIGN, CHECKLIST, and so
+ forth). Later, more work on MT-safe string and shadow headers.
+
+ * Felix Natter for documentation on porting libstdc++.
+
+ * Nathanael Nerode for cleaning up the configuration/build process.
+
+ * NeXT, Inc. donated the front end that supports the Objective-C
+ language.
+
+ * Hans-Peter Nilsson for the CRIS and MMIX ports, improvements to
+ the search engine setup, various documentation fixes and other
+ small fixes.
+
+ * Geoff Noer for his work on getting cygwin native builds working.
+
+ * Diego Novillo for his work on Tree SSA, OpenMP, SPEC performance
+ tracking web pages, GIMPLE tuples, and assorted fixes.
+
+ * David O'Brien for the FreeBSD/alpha, FreeBSD/AMD x86-64,
+ FreeBSD/ARM, FreeBSD/PowerPC, and FreeBSD/SPARC64 ports and
+ related infrastructure improvements.
+
+ * Alexandre Oliva for various build infrastructure improvements,
+ scripts and amazing testing work, including keeping libtool issues
+ sane and happy.
+
+ * Stefan Olsson for work on mt_alloc.
+
+ * Melissa O'Neill for various NeXT fixes.
+
+ * Rainer Orth for random MIPS work, including improvements to GCC's
+ o32 ABI support, improvements to dejagnu's MIPS support, Java
+ configuration clean-ups and porting work, etc.
+
+ * Hartmut Penner for work on the s390 port.
+
+ * Paul Petersen wrote the machine description for the Alliant FX/8.
+
+ * Alexandre Petit-Bianco for implementing much of the Java compiler
+ and continued Java maintainership.
+
+ * Matthias Pfaller for major improvements to the NS32k port.
+
+ * Gerald Pfeifer for his direction via the steering committee,
+ pointing out lots of problems we need to solve, maintenance of the
+ web pages, and taking care of documentation maintenance in general.
+
+ * Andrew Pinski for processing bug reports by the dozen.
+
+ * Ovidiu Predescu for his work on the Objective-C front end and
+ runtime libraries.
+
+ * Jerry Quinn for major performance improvements in C++ formatted
+ I/O.
+
+ * Ken Raeburn for various improvements to checker, MIPS ports and
+ various cleanups in the compiler.
+
+ * Rolf W. Rasmussen for hacking on AWT.
+
+ * David Reese of Sun Microsystems contributed to the Solaris on
+ PowerPC port.
+
+ * Volker Reichelt for keeping up with the problem reports.
+
+ * Joern Rennecke for maintaining the sh port, loop, regmove & reload
+ hacking.
+
+ * Loren J. Rittle for improvements to libstdc++-v3 including the
+ FreeBSD port, threading fixes, thread-related configury changes,
+ critical threading documentation, and solutions to really tricky
+ I/O problems, as well as keeping GCC properly working on FreeBSD
+ and continuous testing.
+
+ * Craig Rodrigues for processing tons of bug reports.
+
+ * Ola Ro"nnerup for work on mt_alloc.
+
+ * Gavin Romig-Koch for lots of behind the scenes MIPS work.
+
+ * David Ronis inspired and encouraged Craig to rewrite the G77
+ documentation in texinfo format by contributing a first pass at a
+ translation of the old `g77-0.5.16/f/DOC' file.
+
+ * Ken Rose for fixes to GCC's delay slot filling code.
+
+ * Paul Rubin wrote most of the preprocessor.
+
+ * Pe'tur Runo'lfsson for major performance improvements in C++
+ formatted I/O and large file support in C++ filebuf.
+
+ * Chip Salzenberg for libstdc++ patches and improvements to locales,
+ traits, Makefiles, libio, libtool hackery, and "long long" support.
+
+ * Juha Sarlin for improvements to the H8 code generator.
+
+ * Greg Satz assisted in making GCC work on HP-UX for the 9000 series
+ 300.
+
+ * Roger Sayle for improvements to constant folding and GCC's RTL
+ optimizers as well as for fixing numerous bugs.
+
+ * Bradley Schatz for his work on the GCJ FAQ.
+
+ * Peter Schauer wrote the code to allow debugging to work on the
+ Alpha.
+
+ * William Schelter did most of the work on the Intel 80386 support.
+
+ * Tobias Schlu"ter for work on GNU Fortran.
+
+ * Bernd Schmidt for various code generation improvements and major
+ work in the reload pass as well a serving as release manager for
+ GCC 2.95.3.
+
+ * Peter Schmid for constant testing of libstdc++--especially
+ application testing, going above and beyond what was requested for
+ the release criteria--and libstdc++ header file tweaks.
+
+ * Jason Schroeder for jcf-dump patches.
+
+ * Andreas Schwab for his work on the m68k port.
+
+ * Lars Segerlund for work on GNU Fortran.
+
+ * Joel Sherrill for his direction via the steering committee, RTEMS
+ contributions and RTEMS testing.
+
+ * Nathan Sidwell for many C++ fixes/improvements.
+
+ * Jeffrey Siegal for helping RMS with the original design of GCC,
+ some code which handles the parse tree and RTL data structures,
+ constant folding and help with the original VAX & m68k ports.
+
+ * Kenny Simpson for prompting libstdc++ fixes due to defect reports
+ from the LWG (thereby keeping GCC in line with updates from the
+ ISO).
+
+ * Franz Sirl for his ongoing work with making the PPC port stable
+ for GNU/Linux.
+
+ * Andrey Slepuhin for assorted AIX hacking.
+
+ * Trevor Smigiel for contributing the SPU port.
+
+ * Christopher Smith did the port for Convex machines.
+
+ * Danny Smith for his major efforts on the Mingw (and Cygwin) ports.
+
+ * Randy Smith finished the Sun FPA support.
+
+ * Scott Snyder for queue, iterator, istream, and string fixes and
+ libstdc++ testsuite entries. Also for providing the patch to G77
+ to add rudimentary support for `INTEGER*1', `INTEGER*2', and
+ `LOGICAL*1'.
+
+ * Brad Spencer for contributions to the GLIBCPP_FORCE_NEW technique.
+
+ * Richard Stallman, for writing the original GCC and launching the
+ GNU project.
+
+ * Jan Stein of the Chalmers Computer Society provided support for
+ Genix, as well as part of the 32000 machine description.
+
+ * Nigel Stephens for various mips16 related fixes/improvements.
+
+ * Jonathan Stone wrote the machine description for the Pyramid
+ computer.
+
+ * Graham Stott for various infrastructure improvements.
+
+ * John Stracke for his Java HTTP protocol fixes.
+
+ * Mike Stump for his Elxsi port, G++ contributions over the years
+ and more recently his vxworks contributions
+
+ * Jeff Sturm for Java porting help, bug fixes, and encouragement.
+
+ * Shigeya Suzuki for this fixes for the bsdi platforms.
+
+ * Ian Lance Taylor for his mips16 work, general configury hacking,
+ fixincludes, etc.
+
+ * Holger Teutsch provided the support for the Clipper CPU.
+
+ * Gary Thomas for his ongoing work to make the PPC work for
+ GNU/Linux.
+
+ * Philipp Thomas for random bug fixes throughout the compiler
+
+ * Jason Thorpe for thread support in libstdc++ on NetBSD.
+
+ * Kresten Krab Thorup wrote the run time support for the Objective-C
+ language and the fantastic Java bytecode interpreter.
+
+ * Michael Tiemann for random bug fixes, the first instruction
+ scheduler, initial C++ support, function integration, NS32k, SPARC
+ and M88k machine description work, delay slot scheduling.
+
+ * Andreas Tobler for his work porting libgcj to Darwin.
+
+ * Teemu Torma for thread safe exception handling support.
+
+ * Leonard Tower wrote parts of the parser, RTL generator, and RTL
+ definitions, and of the VAX machine description.
+
+ * Daniel Towner and Hariharan Sandanagobalane contributed and
+ maintain the picoChip port.
+
+ * Tom Tromey for internationalization support and for his many Java
+ contributions and libgcj maintainership.
+
+ * Lassi Tuura for improvements to config.guess to determine HP
+ processor types.
+
+ * Petter Urkedal for libstdc++ CXXFLAGS, math, and algorithms fixes.
+
+ * Andy Vaught for the design and initial implementation of the GNU
+ Fortran front end.
+
+ * Brent Verner for work with the libstdc++ cshadow files and their
+ associated configure steps.
+
+ * Todd Vierling for contributions for NetBSD ports.
+
+ * Jonathan Wakely for contributing libstdc++ Doxygen notes and XHTML
+ guidance.
+
+ * Dean Wakerley for converting the install documentation from HTML
+ to texinfo in time for GCC 3.0.
+
+ * Krister Walfridsson for random bug fixes.
+
+ * Feng Wang for contributions to GNU Fortran.
+
+ * Stephen M. Webb for time and effort on making libstdc++ shadow
+ files work with the tricky Solaris 8+ headers, and for pushing the
+ build-time header tree.
+
+ * John Wehle for various improvements for the x86 code generator,
+ related infrastructure improvements to help x86 code generation,
+ value range propagation and other work, WE32k port.
+
+ * Ulrich Weigand for work on the s390 port.
+
+ * Zack Weinberg for major work on cpplib and various other bug fixes.
+
+ * Matt Welsh for help with Linux Threads support in GCJ.
+
+ * Urban Widmark for help fixing java.io.
+
+ * Mark Wielaard for new Java library code and his work integrating
+ with Classpath.
+
+ * Dale Wiles helped port GCC to the Tahoe.
+
+ * Bob Wilson from Tensilica, Inc. for the Xtensa port.
+
+ * Jim Wilson for his direction via the steering committee, tackling
+ hard problems in various places that nobody else wanted to work
+ on, strength reduction and other loop optimizations.
+
+ * Paul Woegerer and Tal Agmon for the CRX port.
+
+ * Carlo Wood for various fixes.
+
+ * Tom Wood for work on the m88k port.
+
+ * Canqun Yang for work on GNU Fortran.
+
+ * Masanobu Yuhara of Fujitsu Laboratories implemented the machine
+ description for the Tron architecture (specifically, the Gmicro).
+
+ * Kevin Zachmann helped port GCC to the Tahoe.
+
+ * Ayal Zaks for Swing Modulo Scheduling (SMS).
+
+ * Xiaoqiang Zhang for work on GNU Fortran.
+
+ * Gilles Zunino for help porting Java to Irix.
+
+
+ The following people are recognized for their contributions to GNAT,
+the Ada front end of GCC:
+ * Bernard Banner
+
+ * Romain Berrendonner
+
+ * Geert Bosch
+
+ * Emmanuel Briot
+
+ * Joel Brobecker
+
+ * Ben Brosgol
+
+ * Vincent Celier
+
+ * Arnaud Charlet
+
+ * Chien Chieng
+
+ * Cyrille Comar
+
+ * Cyrille Crozes
+
+ * Robert Dewar
+
+ * Gary Dismukes
+
+ * Robert Duff
+
+ * Ed Falis
+
+ * Ramon Fernandez
+
+ * Sam Figueroa
+
+ * Vasiliy Fofanov
+
+ * Michael Friess
+
+ * Franco Gasperoni
+
+ * Ted Giering
+
+ * Matthew Gingell
+
+ * Laurent Guerby
+
+ * Jerome Guitton
+
+ * Olivier Hainque
+
+ * Jerome Hugues
+
+ * Hristian Kirtchev
+
+ * Jerome Lambourg
+
+ * Bruno Leclerc
+
+ * Albert Lee
+
+ * Sean McNeil
+
+ * Javier Miranda
+
+ * Laurent Nana
+
+ * Pascal Obry
+
+ * Dong-Ik Oh
+
+ * Laurent Pautet
+
+ * Brett Porter
+
+ * Thomas Quinot
+
+ * Nicolas Roche
+
+ * Pat Rogers
+
+ * Jose Ruiz
+
+ * Douglas Rupp
+
+ * Sergey Rybin
+
+ * Gail Schenker
+
+ * Ed Schonberg
+
+ * Nicolas Setton
+
+ * Samuel Tardieu
+
+
+ The following people are recognized for their contributions of new
+features, bug reports, testing and integration of classpath/libgcj for
+GCC version 4.1:
+ * Lillian Angel for `JTree' implementation and lots Free Swing
+ additions and bug fixes.
+
+ * Wolfgang Baer for `GapContent' bug fixes.
+
+ * Anthony Balkissoon for `JList', Free Swing 1.5 updates and mouse
+ event fixes, lots of Free Swing work including `JTable' editing.
+
+ * Stuart Ballard for RMI constant fixes.
+
+ * Goffredo Baroncelli for `HTTPURLConnection' fixes.
+
+ * Gary Benson for `MessageFormat' fixes.
+
+ * Daniel Bonniot for `Serialization' fixes.
+
+ * Chris Burdess for lots of gnu.xml and http protocol fixes, `StAX'
+ and `DOM xml:id' support.
+
+ * Ka-Hing Cheung for `TreePath' and `TreeSelection' fixes.
+
+ * Archie Cobbs for build fixes, VM interface updates,
+ `URLClassLoader' updates.
+
+ * Kelley Cook for build fixes.
+
+ * Martin Cordova for Suggestions for better `SocketTimeoutException'.
+
+ * David Daney for `BitSet' bug fixes, `HttpURLConnection' rewrite
+ and improvements.
+
+ * Thomas Fitzsimmons for lots of upgrades to the gtk+ AWT and Cairo
+ 2D support. Lots of imageio framework additions, lots of AWT and
+ Free Swing bug fixes.
+
+ * Jeroen Frijters for `ClassLoader' and nio cleanups, serialization
+ fixes, better `Proxy' support, bug fixes and IKVM integration.
+
+ * Santiago Gala for `AccessControlContext' fixes.
+
+ * Nicolas Geoffray for `VMClassLoader' and `AccessController'
+ improvements.
+
+ * David Gilbert for `basic' and `metal' icon and plaf support and
+ lots of documenting, Lots of Free Swing and metal theme additions.
+ `MetalIconFactory' implementation.
+
+ * Anthony Green for `MIDI' framework, `ALSA' and `DSSI' providers.
+
+ * Andrew Haley for `Serialization' and `URLClassLoader' fixes, gcj
+ build speedups.
+
+ * Kim Ho for `JFileChooser' implementation.
+
+ * Andrew John Hughes for `Locale' and net fixes, URI RFC2986
+ updates, `Serialization' fixes, `Properties' XML support and
+ generic branch work, VMIntegration guide update.
+
+ * Bastiaan Huisman for `TimeZone' bug fixing.
+
+ * Andreas Jaeger for mprec updates.
+
+ * Paul Jenner for better `-Werror' support.
+
+ * Ito Kazumitsu for `NetworkInterface' implementation and updates.
+
+ * Roman Kennke for `BoxLayout', `GrayFilter' and `SplitPane', plus
+ bug fixes all over. Lots of Free Swing work including styled text.
+
+ * Simon Kitching for `String' cleanups and optimization suggestions.
+
+ * Michael Koch for configuration fixes, `Locale' updates, bug and
+ build fixes.
+
+ * Guilhem Lavaux for configuration, thread and channel fixes and
+ Kaffe integration. JCL native `Pointer' updates. Logger bug fixes.
+
+ * David Lichteblau for JCL support library global/local reference
+ cleanups.
+
+ * Aaron Luchko for JDWP updates and documentation fixes.
+
+ * Ziga Mahkovec for `Graphics2D' upgraded to Cairo 0.5 and new regex
+ features.
+
+ * Sven de Marothy for BMP imageio support, CSS and `TextLayout'
+ fixes. `GtkImage' rewrite, 2D, awt, free swing and date/time fixes
+ and implementing the Qt4 peers.
+
+ * Casey Marshall for crypto algorithm fixes, `FileChannel' lock,
+ `SystemLogger' and `FileHandler' rotate implementations, NIO
+ `FileChannel.map' support, security and policy updates.
+
+ * Bryce McKinlay for RMI work.
+
+ * Audrius Meskauskas for lots of Free Corba, RMI and HTML work plus
+ testing and documenting.
+
+ * Kalle Olavi Niemitalo for build fixes.
+
+ * Rainer Orth for build fixes.
+
+ * Andrew Overholt for `File' locking fixes.
+
+ * Ingo Proetel for `Image', `Logger' and `URLClassLoader' updates.
+
+ * Olga Rodimina for `MenuSelectionManager' implementation.
+
+ * Jan Roehrich for `BasicTreeUI' and `JTree' fixes.
+
+ * Julian Scheid for documentation updates and gjdoc support.
+
+ * Christian Schlichtherle for zip fixes and cleanups.
+
+ * Robert Schuster for documentation updates and beans fixes,
+ `TreeNode' enumerations and `ActionCommand' and various fixes, XML
+ and URL, AWT and Free Swing bug fixes.
+
+ * Keith Seitz for lots of JDWP work.
+
+ * Christian Thalinger for 64-bit cleanups, Configuration and VM
+ interface fixes and `CACAO' integration, `fdlibm' updates.
+
+ * Gael Thomas for `VMClassLoader' boot packages support suggestions.
+
+ * Andreas Tobler for Darwin and Solaris testing and fixing, `Qt4'
+ support for Darwin/OS X, `Graphics2D' support, `gtk+' updates.
+
+ * Dalibor Topic for better `DEBUG' support, build cleanups and Kaffe
+ integration. `Qt4' build infrastructure, `SHA1PRNG' and
+ `GdkPixbugDecoder' updates.
+
+ * Tom Tromey for Eclipse integration, generics work, lots of bug
+ fixes and gcj integration including coordinating The Big Merge.
+
+ * Mark Wielaard for bug fixes, packaging and release management,
+ `Clipboard' implementation, system call interrupts and network
+ timeouts and `GdkPixpufDecoder' fixes.
+
+
+ In addition to the above, all of which also contributed time and
+energy in testing GCC, we would like to thank the following for their
+contributions to testing:
+
+ * Michael Abd-El-Malek
+
+ * Thomas Arend
+
+ * Bonzo Armstrong
+
+ * Steven Ashe
+
+ * Chris Baldwin
+
+ * David Billinghurst
+
+ * Jim Blandy
+
+ * Stephane Bortzmeyer
+
+ * Horst von Brand
+
+ * Frank Braun
+
+ * Rodney Brown
+
+ * Sidney Cadot
+
+ * Bradford Castalia
+
+ * Robert Clark
+
+ * Jonathan Corbet
+
+ * Ralph Doncaster
+
+ * Richard Emberson
+
+ * Levente Farkas
+
+ * Graham Fawcett
+
+ * Mark Fernyhough
+
+ * Robert A. French
+
+ * Jo"rgen Freyh
+
+ * Mark K. Gardner
+
+ * Charles-Antoine Gauthier
+
+ * Yung Shing Gene
+
+ * David Gilbert
+
+ * Simon Gornall
+
+ * Fred Gray
+
+ * John Griffin
+
+ * Patrik Hagglund
+
+ * Phil Hargett
+
+ * Amancio Hasty
+
+ * Takafumi Hayashi
+
+ * Bryan W. Headley
+
+ * Kevin B. Hendricks
+
+ * Joep Jansen
+
+ * Christian Joensson
+
+ * Michel Kern
+
+ * David Kidd
+
+ * Tobias Kuipers
+
+ * Anand Krishnaswamy
+
+ * A. O. V. Le Blanc
+
+ * llewelly
+
+ * Damon Love
+
+ * Brad Lucier
+
+ * Matthias Klose
+
+ * Martin Knoblauch
+
+ * Rick Lutowski
+
+ * Jesse Macnish
+
+ * Stefan Morrell
+
+ * Anon A. Mous
+
+ * Matthias Mueller
+
+ * Pekka Nikander
+
+ * Rick Niles
+
+ * Jon Olson
+
+ * Magnus Persson
+
+ * Chris Pollard
+
+ * Richard Polton
+
+ * Derk Reefman
+
+ * David Rees
+
+ * Paul Reilly
+
+ * Tom Reilly
+
+ * Torsten Rueger
+
+ * Danny Sadinoff
+
+ * Marc Schifer
+
+ * Erik Schnetter
+
+ * Wayne K. Schroll
+
+ * David Schuler
+
+ * Vin Shelton
+
+ * Tim Souder
+
+ * Adam Sulmicki
+
+ * Bill Thorson
+
+ * George Talbot
+
+ * Pedro A. M. Vazquez
+
+ * Gregory Warnes
+
+ * Ian Watson
+
+ * David E. Young
+
+ * And many others
+
+ And finally we'd like to thank everyone who uses the compiler, provides
+feedback and generally reminds us why we're doing this work in the first
+place.
+
+
+File: gccint.info, Node: Option Index, Next: Concept Index, Prev: Contributors, Up: Top
+
+Option Index
+************
+
+GCC's command line options are indexed here without any initial `-' or
+`--'. Where an option has both positive and negative forms (such as
+`-fOPTION' and `-fno-OPTION'), relevant entries in the manual are
+indexed under the most appropriate form; it may sometimes be useful to
+look up both forms.
+
+
+* Menu:
+
+* msoft-float: Soft float library routines.
+ (line 6)
+
+
+File: gccint.info, Node: Concept Index, Prev: Option Index, Up: Top
+
+Concept Index
+*************
+
+
+* Menu:
+
+* ! in constraint: Multi-Alternative. (line 47)
+* # in constraint: Modifiers. (line 67)
+* # in template: Output Template. (line 66)
+* #pragma: Misc. (line 381)
+* % in constraint: Modifiers. (line 45)
+* % in GTY option: GTY Options. (line 18)
+* % in template: Output Template. (line 6)
+* & in constraint: Modifiers. (line 25)
+* ( <1>: Sections. (line 160)
+* ( <2>: GIMPLE_CALL. (line 63)
+* ( <3>: GIMPLE_ASM. (line 21)
+* (: Logical Operators. (line 107)
+* (nil): RTL Objects. (line 73)
+* * <1>: Host Common. (line 17)
+* *: Scheduling. (line 246)
+* * in constraint: Modifiers. (line 72)
+* * in template: Output Statement. (line 29)
+* *gimple_assign_lhs_ptr: GIMPLE_ASSIGN. (line 54)
+* *gimple_assign_rhs1_ptr: GIMPLE_ASSIGN. (line 60)
+* *gimple_assign_rhs2_ptr: GIMPLE_ASSIGN. (line 67)
+* *gimple_call_arg_ptr: GIMPLE_CALL. (line 71)
+* *gimple_call_lhs_ptr: GIMPLE_CALL. (line 32)
+* *gimple_catch_types_ptr: GIMPLE_CATCH. (line 16)
+* *gimple_cdt_location_ptr: GIMPLE_CHANGE_DYNAMIC_TYPE.
+ (line 28)
+* *gimple_cdt_new_type_ptr: GIMPLE_CHANGE_DYNAMIC_TYPE.
+ (line 15)
+* *gimple_eh_filter_types_ptr: GIMPLE_EH_FILTER. (line 15)
+* *gimple_omp_critical_name_ptr: GIMPLE_OMP_CRITICAL.
+ (line 16)
+* *gimple_omp_for_clauses_ptr: GIMPLE_OMP_FOR. (line 23)
+* *gimple_omp_for_final_ptr: GIMPLE_OMP_FOR. (line 54)
+* *gimple_omp_for_incr_ptr: GIMPLE_OMP_FOR. (line 64)
+* *gimple_omp_for_index_ptr: GIMPLE_OMP_FOR. (line 34)
+* *gimple_omp_for_initial_ptr: GIMPLE_OMP_FOR. (line 44)
+* *gimple_omp_parallel_child_fn_ptr: GIMPLE_OMP_PARALLEL.
+ (line 46)
+* *gimple_omp_parallel_clauses_ptr: GIMPLE_OMP_PARALLEL.
+ (line 34)
+* *gimple_omp_parallel_data_arg_ptr: GIMPLE_OMP_PARALLEL.
+ (line 58)
+* *gimple_omp_sections_clauses_ptr: GIMPLE_OMP_SECTIONS.
+ (line 33)
+* *gimple_omp_sections_control_ptr: GIMPLE_OMP_SECTIONS.
+ (line 21)
+* *gimple_omp_single_clauses_ptr: GIMPLE_OMP_SINGLE. (line 17)
+* *gimple_op_ptr: Manipulating GIMPLE statements.
+ (line 84)
+* *gimple_ops <1>: Manipulating GIMPLE statements.
+ (line 78)
+* *gimple_ops: Logical Operators. (line 82)
+* *gimple_phi_result_ptr: GIMPLE_PHI. (line 22)
+* *gsi_stmt_ptr: Sequence iterators. (line 80)
+* *TARGET_GET_PCH_VALIDITY: PCH Target. (line 7)
+* + in constraint: Modifiers. (line 12)
+* -fsection-anchors <1>: Anchored Addresses. (line 6)
+* -fsection-anchors: Special Accessors. (line 106)
+* /c in RTL dump: Flags. (line 234)
+* /f in RTL dump: Flags. (line 242)
+* /i in RTL dump: Flags. (line 294)
+* /j in RTL dump: Flags. (line 309)
+* /s in RTL dump: Flags. (line 258)
+* /u in RTL dump: Flags. (line 319)
+* /v in RTL dump: Flags. (line 351)
+* 0 in constraint: Simple Constraints. (line 120)
+* < in constraint: Simple Constraints. (line 48)
+* = in constraint: Modifiers. (line 8)
+* > in constraint: Simple Constraints. (line 52)
+* ? in constraint: Multi-Alternative. (line 41)
+* \: Output Template. (line 46)
+* __absvdi2: Integer library routines.
+ (line 107)
+* __absvsi2: Integer library routines.
+ (line 106)
+* __addda3: Fixed-point fractional library routines.
+ (line 45)
+* __adddf3: Soft float library routines.
+ (line 23)
+* __adddq3: Fixed-point fractional library routines.
+ (line 33)
+* __addha3: Fixed-point fractional library routines.
+ (line 43)
+* __addhq3: Fixed-point fractional library routines.
+ (line 30)
+* __addqq3: Fixed-point fractional library routines.
+ (line 29)
+* __addsa3: Fixed-point fractional library routines.
+ (line 44)
+* __addsf3: Soft float library routines.
+ (line 22)
+* __addsq3: Fixed-point fractional library routines.
+ (line 31)
+* __addta3: Fixed-point fractional library routines.
+ (line 47)
+* __addtf3: Soft float library routines.
+ (line 25)
+* __adduda3: Fixed-point fractional library routines.
+ (line 53)
+* __addudq3: Fixed-point fractional library routines.
+ (line 41)
+* __adduha3: Fixed-point fractional library routines.
+ (line 49)
+* __adduhq3: Fixed-point fractional library routines.
+ (line 37)
+* __adduqq3: Fixed-point fractional library routines.
+ (line 35)
+* __addusa3: Fixed-point fractional library routines.
+ (line 51)
+* __addusq3: Fixed-point fractional library routines.
+ (line 39)
+* __adduta3: Fixed-point fractional library routines.
+ (line 55)
+* __addvdi3: Integer library routines.
+ (line 111)
+* __addvsi3: Integer library routines.
+ (line 110)
+* __addxf3: Soft float library routines.
+ (line 27)
+* __ashlda3: Fixed-point fractional library routines.
+ (line 351)
+* __ashldi3: Integer library routines.
+ (line 14)
+* __ashldq3: Fixed-point fractional library routines.
+ (line 340)
+* __ashlha3: Fixed-point fractional library routines.
+ (line 349)
+* __ashlhq3: Fixed-point fractional library routines.
+ (line 337)
+* __ashlqq3: Fixed-point fractional library routines.
+ (line 336)
+* __ashlsa3: Fixed-point fractional library routines.
+ (line 350)
+* __ashlsi3: Integer library routines.
+ (line 13)
+* __ashlsq3: Fixed-point fractional library routines.
+ (line 338)
+* __ashlta3: Fixed-point fractional library routines.
+ (line 353)
+* __ashlti3: Integer library routines.
+ (line 15)
+* __ashluda3: Fixed-point fractional library routines.
+ (line 359)
+* __ashludq3: Fixed-point fractional library routines.
+ (line 348)
+* __ashluha3: Fixed-point fractional library routines.
+ (line 355)
+* __ashluhq3: Fixed-point fractional library routines.
+ (line 344)
+* __ashluqq3: Fixed-point fractional library routines.
+ (line 342)
+* __ashlusa3: Fixed-point fractional library routines.
+ (line 357)
+* __ashlusq3: Fixed-point fractional library routines.
+ (line 346)
+* __ashluta3: Fixed-point fractional library routines.
+ (line 361)
+* __ashrda3: Fixed-point fractional library routines.
+ (line 371)
+* __ashrdi3: Integer library routines.
+ (line 19)
+* __ashrdq3: Fixed-point fractional library routines.
+ (line 368)
+* __ashrha3: Fixed-point fractional library routines.
+ (line 369)
+* __ashrhq3: Fixed-point fractional library routines.
+ (line 365)
+* __ashrqq3: Fixed-point fractional library routines.
+ (line 364)
+* __ashrsa3: Fixed-point fractional library routines.
+ (line 370)
+* __ashrsi3: Integer library routines.
+ (line 18)
+* __ashrsq3: Fixed-point fractional library routines.
+ (line 366)
+* __ashrta3: Fixed-point fractional library routines.
+ (line 373)
+* __ashrti3: Integer library routines.
+ (line 20)
+* __bid_adddd3: Decimal float library routines.
+ (line 25)
+* __bid_addsd3: Decimal float library routines.
+ (line 21)
+* __bid_addtd3: Decimal float library routines.
+ (line 29)
+* __bid_divdd3: Decimal float library routines.
+ (line 68)
+* __bid_divsd3: Decimal float library routines.
+ (line 64)
+* __bid_divtd3: Decimal float library routines.
+ (line 72)
+* __bid_eqdd2: Decimal float library routines.
+ (line 259)
+* __bid_eqsd2: Decimal float library routines.
+ (line 257)
+* __bid_eqtd2: Decimal float library routines.
+ (line 261)
+* __bid_extendddtd2: Decimal float library routines.
+ (line 92)
+* __bid_extendddtf: Decimal float library routines.
+ (line 140)
+* __bid_extendddxf: Decimal float library routines.
+ (line 134)
+* __bid_extenddfdd: Decimal float library routines.
+ (line 147)
+* __bid_extenddftd: Decimal float library routines.
+ (line 107)
+* __bid_extendsddd2: Decimal float library routines.
+ (line 88)
+* __bid_extendsddf: Decimal float library routines.
+ (line 128)
+* __bid_extendsdtd2: Decimal float library routines.
+ (line 90)
+* __bid_extendsdtf: Decimal float library routines.
+ (line 138)
+* __bid_extendsdxf: Decimal float library routines.
+ (line 132)
+* __bid_extendsfdd: Decimal float library routines.
+ (line 103)
+* __bid_extendsfsd: Decimal float library routines.
+ (line 145)
+* __bid_extendsftd: Decimal float library routines.
+ (line 105)
+* __bid_extendtftd: Decimal float library routines.
+ (line 149)
+* __bid_extendxftd: Decimal float library routines.
+ (line 109)
+* __bid_fixdddi: Decimal float library routines.
+ (line 170)
+* __bid_fixddsi: Decimal float library routines.
+ (line 162)
+* __bid_fixsddi: Decimal float library routines.
+ (line 168)
+* __bid_fixsdsi: Decimal float library routines.
+ (line 160)
+* __bid_fixtddi: Decimal float library routines.
+ (line 172)
+* __bid_fixtdsi: Decimal float library routines.
+ (line 164)
+* __bid_fixunsdddi: Decimal float library routines.
+ (line 187)
+* __bid_fixunsddsi: Decimal float library routines.
+ (line 178)
+* __bid_fixunssddi: Decimal float library routines.
+ (line 185)
+* __bid_fixunssdsi: Decimal float library routines.
+ (line 176)
+* __bid_fixunstddi: Decimal float library routines.
+ (line 189)
+* __bid_fixunstdsi: Decimal float library routines.
+ (line 180)
+* __bid_floatdidd: Decimal float library routines.
+ (line 205)
+* __bid_floatdisd: Decimal float library routines.
+ (line 203)
+* __bid_floatditd: Decimal float library routines.
+ (line 207)
+* __bid_floatsidd: Decimal float library routines.
+ (line 196)
+* __bid_floatsisd: Decimal float library routines.
+ (line 194)
+* __bid_floatsitd: Decimal float library routines.
+ (line 198)
+* __bid_floatunsdidd: Decimal float library routines.
+ (line 223)
+* __bid_floatunsdisd: Decimal float library routines.
+ (line 221)
+* __bid_floatunsditd: Decimal float library routines.
+ (line 225)
+* __bid_floatunssidd: Decimal float library routines.
+ (line 214)
+* __bid_floatunssisd: Decimal float library routines.
+ (line 212)
+* __bid_floatunssitd: Decimal float library routines.
+ (line 216)
+* __bid_gedd2: Decimal float library routines.
+ (line 277)
+* __bid_gesd2: Decimal float library routines.
+ (line 275)
+* __bid_getd2: Decimal float library routines.
+ (line 279)
+* __bid_gtdd2: Decimal float library routines.
+ (line 304)
+* __bid_gtsd2: Decimal float library routines.
+ (line 302)
+* __bid_gttd2: Decimal float library routines.
+ (line 306)
+* __bid_ledd2: Decimal float library routines.
+ (line 295)
+* __bid_lesd2: Decimal float library routines.
+ (line 293)
+* __bid_letd2: Decimal float library routines.
+ (line 297)
+* __bid_ltdd2: Decimal float library routines.
+ (line 286)
+* __bid_ltsd2: Decimal float library routines.
+ (line 284)
+* __bid_lttd2: Decimal float library routines.
+ (line 288)
+* __bid_muldd3: Decimal float library routines.
+ (line 54)
+* __bid_mulsd3: Decimal float library routines.
+ (line 50)
+* __bid_multd3: Decimal float library routines.
+ (line 58)
+* __bid_nedd2: Decimal float library routines.
+ (line 268)
+* __bid_negdd2: Decimal float library routines.
+ (line 78)
+* __bid_negsd2: Decimal float library routines.
+ (line 76)
+* __bid_negtd2: Decimal float library routines.
+ (line 80)
+* __bid_nesd2: Decimal float library routines.
+ (line 266)
+* __bid_netd2: Decimal float library routines.
+ (line 270)
+* __bid_subdd3: Decimal float library routines.
+ (line 39)
+* __bid_subsd3: Decimal float library routines.
+ (line 35)
+* __bid_subtd3: Decimal float library routines.
+ (line 43)
+* __bid_truncdddf: Decimal float library routines.
+ (line 153)
+* __bid_truncddsd2: Decimal float library routines.
+ (line 94)
+* __bid_truncddsf: Decimal float library routines.
+ (line 124)
+* __bid_truncdfsd: Decimal float library routines.
+ (line 111)
+* __bid_truncsdsf: Decimal float library routines.
+ (line 151)
+* __bid_trunctddd2: Decimal float library routines.
+ (line 98)
+* __bid_trunctddf: Decimal float library routines.
+ (line 130)
+* __bid_trunctdsd2: Decimal float library routines.
+ (line 96)
+* __bid_trunctdsf: Decimal float library routines.
+ (line 126)
+* __bid_trunctdtf: Decimal float library routines.
+ (line 155)
+* __bid_trunctdxf: Decimal float library routines.
+ (line 136)
+* __bid_trunctfdd: Decimal float library routines.
+ (line 119)
+* __bid_trunctfsd: Decimal float library routines.
+ (line 115)
+* __bid_truncxfdd: Decimal float library routines.
+ (line 117)
+* __bid_truncxfsd: Decimal float library routines.
+ (line 113)
+* __bid_unorddd2: Decimal float library routines.
+ (line 235)
+* __bid_unordsd2: Decimal float library routines.
+ (line 233)
+* __bid_unordtd2: Decimal float library routines.
+ (line 237)
+* __bswapdi2: Integer library routines.
+ (line 162)
+* __bswapsi2: Integer library routines.
+ (line 161)
+* __builtin_args_info: Varargs. (line 42)
+* __builtin_classify_type: Varargs. (line 76)
+* __builtin_next_arg: Varargs. (line 66)
+* __builtin_saveregs: Varargs. (line 24)
+* __clear_cache: Miscellaneous routines.
+ (line 10)
+* __clzdi2: Integer library routines.
+ (line 131)
+* __clzsi2: Integer library routines.
+ (line 130)
+* __clzti2: Integer library routines.
+ (line 132)
+* __cmpda2: Fixed-point fractional library routines.
+ (line 451)
+* __cmpdf2: Soft float library routines.
+ (line 164)
+* __cmpdi2: Integer library routines.
+ (line 87)
+* __cmpdq2: Fixed-point fractional library routines.
+ (line 441)
+* __cmpha2: Fixed-point fractional library routines.
+ (line 449)
+* __cmphq2: Fixed-point fractional library routines.
+ (line 438)
+* __cmpqq2: Fixed-point fractional library routines.
+ (line 437)
+* __cmpsa2: Fixed-point fractional library routines.
+ (line 450)
+* __cmpsf2: Soft float library routines.
+ (line 163)
+* __cmpsq2: Fixed-point fractional library routines.
+ (line 439)
+* __cmpta2: Fixed-point fractional library routines.
+ (line 453)
+* __cmptf2: Soft float library routines.
+ (line 165)
+* __cmpti2: Integer library routines.
+ (line 88)
+* __cmpuda2: Fixed-point fractional library routines.
+ (line 458)
+* __cmpudq2: Fixed-point fractional library routines.
+ (line 448)
+* __cmpuha2: Fixed-point fractional library routines.
+ (line 455)
+* __cmpuhq2: Fixed-point fractional library routines.
+ (line 444)
+* __cmpuqq2: Fixed-point fractional library routines.
+ (line 443)
+* __cmpusa2: Fixed-point fractional library routines.
+ (line 456)
+* __cmpusq2: Fixed-point fractional library routines.
+ (line 446)
+* __cmputa2: Fixed-point fractional library routines.
+ (line 460)
+* __CTOR_LIST__: Initialization. (line 25)
+* __ctzdi2: Integer library routines.
+ (line 138)
+* __ctzsi2: Integer library routines.
+ (line 137)
+* __ctzti2: Integer library routines.
+ (line 139)
+* __divda3: Fixed-point fractional library routines.
+ (line 227)
+* __divdc3: Soft float library routines.
+ (line 252)
+* __divdf3: Soft float library routines.
+ (line 48)
+* __divdi3: Integer library routines.
+ (line 25)
+* __divdq3: Fixed-point fractional library routines.
+ (line 223)
+* __divha3: Fixed-point fractional library routines.
+ (line 225)
+* __divhq3: Fixed-point fractional library routines.
+ (line 220)
+* __divqq3: Fixed-point fractional library routines.
+ (line 219)
+* __divsa3: Fixed-point fractional library routines.
+ (line 226)
+* __divsc3: Soft float library routines.
+ (line 250)
+* __divsf3: Soft float library routines.
+ (line 47)
+* __divsi3: Integer library routines.
+ (line 24)
+* __divsq3: Fixed-point fractional library routines.
+ (line 221)
+* __divta3: Fixed-point fractional library routines.
+ (line 229)
+* __divtc3: Soft float library routines.
+ (line 254)
+* __divtf3: Soft float library routines.
+ (line 50)
+* __divti3: Integer library routines.
+ (line 26)
+* __divxc3: Soft float library routines.
+ (line 256)
+* __divxf3: Soft float library routines.
+ (line 52)
+* __dpd_adddd3: Decimal float library routines.
+ (line 23)
+* __dpd_addsd3: Decimal float library routines.
+ (line 19)
+* __dpd_addtd3: Decimal float library routines.
+ (line 27)
+* __dpd_divdd3: Decimal float library routines.
+ (line 66)
+* __dpd_divsd3: Decimal float library routines.
+ (line 62)
+* __dpd_divtd3: Decimal float library routines.
+ (line 70)
+* __dpd_eqdd2: Decimal float library routines.
+ (line 258)
+* __dpd_eqsd2: Decimal float library routines.
+ (line 256)
+* __dpd_eqtd2: Decimal float library routines.
+ (line 260)
+* __dpd_extendddtd2: Decimal float library routines.
+ (line 91)
+* __dpd_extendddtf: Decimal float library routines.
+ (line 139)
+* __dpd_extendddxf: Decimal float library routines.
+ (line 133)
+* __dpd_extenddfdd: Decimal float library routines.
+ (line 146)
+* __dpd_extenddftd: Decimal float library routines.
+ (line 106)
+* __dpd_extendsddd2: Decimal float library routines.
+ (line 87)
+* __dpd_extendsddf: Decimal float library routines.
+ (line 127)
+* __dpd_extendsdtd2: Decimal float library routines.
+ (line 89)
+* __dpd_extendsdtf: Decimal float library routines.
+ (line 137)
+* __dpd_extendsdxf: Decimal float library routines.
+ (line 131)
+* __dpd_extendsfdd: Decimal float library routines.
+ (line 102)
+* __dpd_extendsfsd: Decimal float library routines.
+ (line 144)
+* __dpd_extendsftd: Decimal float library routines.
+ (line 104)
+* __dpd_extendtftd: Decimal float library routines.
+ (line 148)
+* __dpd_extendxftd: Decimal float library routines.
+ (line 108)
+* __dpd_fixdddi: Decimal float library routines.
+ (line 169)
+* __dpd_fixddsi: Decimal float library routines.
+ (line 161)
+* __dpd_fixsddi: Decimal float library routines.
+ (line 167)
+* __dpd_fixsdsi: Decimal float library routines.
+ (line 159)
+* __dpd_fixtddi: Decimal float library routines.
+ (line 171)
+* __dpd_fixtdsi: Decimal float library routines.
+ (line 163)
+* __dpd_fixunsdddi: Decimal float library routines.
+ (line 186)
+* __dpd_fixunsddsi: Decimal float library routines.
+ (line 177)
+* __dpd_fixunssddi: Decimal float library routines.
+ (line 184)
+* __dpd_fixunssdsi: Decimal float library routines.
+ (line 175)
+* __dpd_fixunstddi: Decimal float library routines.
+ (line 188)
+* __dpd_fixunstdsi: Decimal float library routines.
+ (line 179)
+* __dpd_floatdidd: Decimal float library routines.
+ (line 204)
+* __dpd_floatdisd: Decimal float library routines.
+ (line 202)
+* __dpd_floatditd: Decimal float library routines.
+ (line 206)
+* __dpd_floatsidd: Decimal float library routines.
+ (line 195)
+* __dpd_floatsisd: Decimal float library routines.
+ (line 193)
+* __dpd_floatsitd: Decimal float library routines.
+ (line 197)
+* __dpd_floatunsdidd: Decimal float library routines.
+ (line 222)
+* __dpd_floatunsdisd: Decimal float library routines.
+ (line 220)
+* __dpd_floatunsditd: Decimal float library routines.
+ (line 224)
+* __dpd_floatunssidd: Decimal float library routines.
+ (line 213)
+* __dpd_floatunssisd: Decimal float library routines.
+ (line 211)
+* __dpd_floatunssitd: Decimal float library routines.
+ (line 215)
+* __dpd_gedd2: Decimal float library routines.
+ (line 276)
+* __dpd_gesd2: Decimal float library routines.
+ (line 274)
+* __dpd_getd2: Decimal float library routines.
+ (line 278)
+* __dpd_gtdd2: Decimal float library routines.
+ (line 303)
+* __dpd_gtsd2: Decimal float library routines.
+ (line 301)
+* __dpd_gttd2: Decimal float library routines.
+ (line 305)
+* __dpd_ledd2: Decimal float library routines.
+ (line 294)
+* __dpd_lesd2: Decimal float library routines.
+ (line 292)
+* __dpd_letd2: Decimal float library routines.
+ (line 296)
+* __dpd_ltdd2: Decimal float library routines.
+ (line 285)
+* __dpd_ltsd2: Decimal float library routines.
+ (line 283)
+* __dpd_lttd2: Decimal float library routines.
+ (line 287)
+* __dpd_muldd3: Decimal float library routines.
+ (line 52)
+* __dpd_mulsd3: Decimal float library routines.
+ (line 48)
+* __dpd_multd3: Decimal float library routines.
+ (line 56)
+* __dpd_nedd2: Decimal float library routines.
+ (line 267)
+* __dpd_negdd2: Decimal float library routines.
+ (line 77)
+* __dpd_negsd2: Decimal float library routines.
+ (line 75)
+* __dpd_negtd2: Decimal float library routines.
+ (line 79)
+* __dpd_nesd2: Decimal float library routines.
+ (line 265)
+* __dpd_netd2: Decimal float library routines.
+ (line 269)
+* __dpd_subdd3: Decimal float library routines.
+ (line 37)
+* __dpd_subsd3: Decimal float library routines.
+ (line 33)
+* __dpd_subtd3: Decimal float library routines.
+ (line 41)
+* __dpd_truncdddf: Decimal float library routines.
+ (line 152)
+* __dpd_truncddsd2: Decimal float library routines.
+ (line 93)
+* __dpd_truncddsf: Decimal float library routines.
+ (line 123)
+* __dpd_truncdfsd: Decimal float library routines.
+ (line 110)
+* __dpd_truncsdsf: Decimal float library routines.
+ (line 150)
+* __dpd_trunctddd2: Decimal float library routines.
+ (line 97)
+* __dpd_trunctddf: Decimal float library routines.
+ (line 129)
+* __dpd_trunctdsd2: Decimal float library routines.
+ (line 95)
+* __dpd_trunctdsf: Decimal float library routines.
+ (line 125)
+* __dpd_trunctdtf: Decimal float library routines.
+ (line 154)
+* __dpd_trunctdxf: Decimal float library routines.
+ (line 135)
+* __dpd_trunctfdd: Decimal float library routines.
+ (line 118)
+* __dpd_trunctfsd: Decimal float library routines.
+ (line 114)
+* __dpd_truncxfdd: Decimal float library routines.
+ (line 116)
+* __dpd_truncxfsd: Decimal float library routines.
+ (line 112)
+* __dpd_unorddd2: Decimal float library routines.
+ (line 234)
+* __dpd_unordsd2: Decimal float library routines.
+ (line 232)
+* __dpd_unordtd2: Decimal float library routines.
+ (line 236)
+* __DTOR_LIST__: Initialization. (line 25)
+* __eqdf2: Soft float library routines.
+ (line 194)
+* __eqsf2: Soft float library routines.
+ (line 193)
+* __eqtf2: Soft float library routines.
+ (line 195)
+* __extenddftf2: Soft float library routines.
+ (line 68)
+* __extenddfxf2: Soft float library routines.
+ (line 69)
+* __extendsfdf2: Soft float library routines.
+ (line 65)
+* __extendsftf2: Soft float library routines.
+ (line 66)
+* __extendsfxf2: Soft float library routines.
+ (line 67)
+* __ffsdi2: Integer library routines.
+ (line 144)
+* __ffsti2: Integer library routines.
+ (line 145)
+* __fixdfdi: Soft float library routines.
+ (line 88)
+* __fixdfsi: Soft float library routines.
+ (line 81)
+* __fixdfti: Soft float library routines.
+ (line 94)
+* __fixsfdi: Soft float library routines.
+ (line 87)
+* __fixsfsi: Soft float library routines.
+ (line 80)
+* __fixsfti: Soft float library routines.
+ (line 93)
+* __fixtfdi: Soft float library routines.
+ (line 89)
+* __fixtfsi: Soft float library routines.
+ (line 82)
+* __fixtfti: Soft float library routines.
+ (line 95)
+* __fixunsdfdi: Soft float library routines.
+ (line 108)
+* __fixunsdfsi: Soft float library routines.
+ (line 101)
+* __fixunsdfti: Soft float library routines.
+ (line 115)
+* __fixunssfdi: Soft float library routines.
+ (line 107)
+* __fixunssfsi: Soft float library routines.
+ (line 100)
+* __fixunssfti: Soft float library routines.
+ (line 114)
+* __fixunstfdi: Soft float library routines.
+ (line 109)
+* __fixunstfsi: Soft float library routines.
+ (line 102)
+* __fixunstfti: Soft float library routines.
+ (line 116)
+* __fixunsxfdi: Soft float library routines.
+ (line 110)
+* __fixunsxfsi: Soft float library routines.
+ (line 103)
+* __fixunsxfti: Soft float library routines.
+ (line 117)
+* __fixxfdi: Soft float library routines.
+ (line 90)
+* __fixxfsi: Soft float library routines.
+ (line 83)
+* __fixxfti: Soft float library routines.
+ (line 96)
+* __floatdidf: Soft float library routines.
+ (line 128)
+* __floatdisf: Soft float library routines.
+ (line 127)
+* __floatditf: Soft float library routines.
+ (line 129)
+* __floatdixf: Soft float library routines.
+ (line 130)
+* __floatsidf: Soft float library routines.
+ (line 122)
+* __floatsisf: Soft float library routines.
+ (line 121)
+* __floatsitf: Soft float library routines.
+ (line 123)
+* __floatsixf: Soft float library routines.
+ (line 124)
+* __floattidf: Soft float library routines.
+ (line 134)
+* __floattisf: Soft float library routines.
+ (line 133)
+* __floattitf: Soft float library routines.
+ (line 135)
+* __floattixf: Soft float library routines.
+ (line 136)
+* __floatundidf: Soft float library routines.
+ (line 146)
+* __floatundisf: Soft float library routines.
+ (line 145)
+* __floatunditf: Soft float library routines.
+ (line 147)
+* __floatundixf: Soft float library routines.
+ (line 148)
+* __floatunsidf: Soft float library routines.
+ (line 140)
+* __floatunsisf: Soft float library routines.
+ (line 139)
+* __floatunsitf: Soft float library routines.
+ (line 141)
+* __floatunsixf: Soft float library routines.
+ (line 142)
+* __floatuntidf: Soft float library routines.
+ (line 152)
+* __floatuntisf: Soft float library routines.
+ (line 151)
+* __floatuntitf: Soft float library routines.
+ (line 153)
+* __floatuntixf: Soft float library routines.
+ (line 154)
+* __fractdadf: Fixed-point fractional library routines.
+ (line 636)
+* __fractdadi: Fixed-point fractional library routines.
+ (line 633)
+* __fractdadq: Fixed-point fractional library routines.
+ (line 616)
+* __fractdaha2: Fixed-point fractional library routines.
+ (line 617)
+* __fractdahi: Fixed-point fractional library routines.
+ (line 631)
+* __fractdahq: Fixed-point fractional library routines.
+ (line 614)
+* __fractdaqi: Fixed-point fractional library routines.
+ (line 630)
+* __fractdaqq: Fixed-point fractional library routines.
+ (line 613)
+* __fractdasa2: Fixed-point fractional library routines.
+ (line 618)
+* __fractdasf: Fixed-point fractional library routines.
+ (line 635)
+* __fractdasi: Fixed-point fractional library routines.
+ (line 632)
+* __fractdasq: Fixed-point fractional library routines.
+ (line 615)
+* __fractdata2: Fixed-point fractional library routines.
+ (line 619)
+* __fractdati: Fixed-point fractional library routines.
+ (line 634)
+* __fractdauda: Fixed-point fractional library routines.
+ (line 627)
+* __fractdaudq: Fixed-point fractional library routines.
+ (line 624)
+* __fractdauha: Fixed-point fractional library routines.
+ (line 625)
+* __fractdauhq: Fixed-point fractional library routines.
+ (line 621)
+* __fractdauqq: Fixed-point fractional library routines.
+ (line 620)
+* __fractdausa: Fixed-point fractional library routines.
+ (line 626)
+* __fractdausq: Fixed-point fractional library routines.
+ (line 622)
+* __fractdauta: Fixed-point fractional library routines.
+ (line 629)
+* __fractdfda: Fixed-point fractional library routines.
+ (line 1025)
+* __fractdfdq: Fixed-point fractional library routines.
+ (line 1022)
+* __fractdfha: Fixed-point fractional library routines.
+ (line 1023)
+* __fractdfhq: Fixed-point fractional library routines.
+ (line 1020)
+* __fractdfqq: Fixed-point fractional library routines.
+ (line 1019)
+* __fractdfsa: Fixed-point fractional library routines.
+ (line 1024)
+* __fractdfsq: Fixed-point fractional library routines.
+ (line 1021)
+* __fractdfta: Fixed-point fractional library routines.
+ (line 1026)
+* __fractdfuda: Fixed-point fractional library routines.
+ (line 1033)
+* __fractdfudq: Fixed-point fractional library routines.
+ (line 1030)
+* __fractdfuha: Fixed-point fractional library routines.
+ (line 1031)
+* __fractdfuhq: Fixed-point fractional library routines.
+ (line 1028)
+* __fractdfuqq: Fixed-point fractional library routines.
+ (line 1027)
+* __fractdfusa: Fixed-point fractional library routines.
+ (line 1032)
+* __fractdfusq: Fixed-point fractional library routines.
+ (line 1029)
+* __fractdfuta: Fixed-point fractional library routines.
+ (line 1034)
+* __fractdida: Fixed-point fractional library routines.
+ (line 975)
+* __fractdidq: Fixed-point fractional library routines.
+ (line 972)
+* __fractdiha: Fixed-point fractional library routines.
+ (line 973)
+* __fractdihq: Fixed-point fractional library routines.
+ (line 970)
+* __fractdiqq: Fixed-point fractional library routines.
+ (line 969)
+* __fractdisa: Fixed-point fractional library routines.
+ (line 974)
+* __fractdisq: Fixed-point fractional library routines.
+ (line 971)
+* __fractdita: Fixed-point fractional library routines.
+ (line 976)
+* __fractdiuda: Fixed-point fractional library routines.
+ (line 983)
+* __fractdiudq: Fixed-point fractional library routines.
+ (line 980)
+* __fractdiuha: Fixed-point fractional library routines.
+ (line 981)
+* __fractdiuhq: Fixed-point fractional library routines.
+ (line 978)
+* __fractdiuqq: Fixed-point fractional library routines.
+ (line 977)
+* __fractdiusa: Fixed-point fractional library routines.
+ (line 982)
+* __fractdiusq: Fixed-point fractional library routines.
+ (line 979)
+* __fractdiuta: Fixed-point fractional library routines.
+ (line 984)
+* __fractdqda: Fixed-point fractional library routines.
+ (line 544)
+* __fractdqdf: Fixed-point fractional library routines.
+ (line 566)
+* __fractdqdi: Fixed-point fractional library routines.
+ (line 563)
+* __fractdqha: Fixed-point fractional library routines.
+ (line 542)
+* __fractdqhi: Fixed-point fractional library routines.
+ (line 561)
+* __fractdqhq2: Fixed-point fractional library routines.
+ (line 540)
+* __fractdqqi: Fixed-point fractional library routines.
+ (line 560)
+* __fractdqqq2: Fixed-point fractional library routines.
+ (line 539)
+* __fractdqsa: Fixed-point fractional library routines.
+ (line 543)
+* __fractdqsf: Fixed-point fractional library routines.
+ (line 565)
+* __fractdqsi: Fixed-point fractional library routines.
+ (line 562)
+* __fractdqsq2: Fixed-point fractional library routines.
+ (line 541)
+* __fractdqta: Fixed-point fractional library routines.
+ (line 545)
+* __fractdqti: Fixed-point fractional library routines.
+ (line 564)
+* __fractdquda: Fixed-point fractional library routines.
+ (line 557)
+* __fractdqudq: Fixed-point fractional library routines.
+ (line 552)
+* __fractdquha: Fixed-point fractional library routines.
+ (line 554)
+* __fractdquhq: Fixed-point fractional library routines.
+ (line 548)
+* __fractdquqq: Fixed-point fractional library routines.
+ (line 547)
+* __fractdqusa: Fixed-point fractional library routines.
+ (line 555)
+* __fractdqusq: Fixed-point fractional library routines.
+ (line 550)
+* __fractdquta: Fixed-point fractional library routines.
+ (line 559)
+* __fracthada2: Fixed-point fractional library routines.
+ (line 572)
+* __fracthadf: Fixed-point fractional library routines.
+ (line 590)
+* __fracthadi: Fixed-point fractional library routines.
+ (line 587)
+* __fracthadq: Fixed-point fractional library routines.
+ (line 570)
+* __fracthahi: Fixed-point fractional library routines.
+ (line 585)
+* __fracthahq: Fixed-point fractional library routines.
+ (line 568)
+* __fracthaqi: Fixed-point fractional library routines.
+ (line 584)
+* __fracthaqq: Fixed-point fractional library routines.
+ (line 567)
+* __fracthasa2: Fixed-point fractional library routines.
+ (line 571)
+* __fracthasf: Fixed-point fractional library routines.
+ (line 589)
+* __fracthasi: Fixed-point fractional library routines.
+ (line 586)
+* __fracthasq: Fixed-point fractional library routines.
+ (line 569)
+* __fracthata2: Fixed-point fractional library routines.
+ (line 573)
+* __fracthati: Fixed-point fractional library routines.
+ (line 588)
+* __fracthauda: Fixed-point fractional library routines.
+ (line 581)
+* __fracthaudq: Fixed-point fractional library routines.
+ (line 578)
+* __fracthauha: Fixed-point fractional library routines.
+ (line 579)
+* __fracthauhq: Fixed-point fractional library routines.
+ (line 575)
+* __fracthauqq: Fixed-point fractional library routines.
+ (line 574)
+* __fracthausa: Fixed-point fractional library routines.
+ (line 580)
+* __fracthausq: Fixed-point fractional library routines.
+ (line 576)
+* __fracthauta: Fixed-point fractional library routines.
+ (line 583)
+* __fracthida: Fixed-point fractional library routines.
+ (line 943)
+* __fracthidq: Fixed-point fractional library routines.
+ (line 940)
+* __fracthiha: Fixed-point fractional library routines.
+ (line 941)
+* __fracthihq: Fixed-point fractional library routines.
+ (line 938)
+* __fracthiqq: Fixed-point fractional library routines.
+ (line 937)
+* __fracthisa: Fixed-point fractional library routines.
+ (line 942)
+* __fracthisq: Fixed-point fractional library routines.
+ (line 939)
+* __fracthita: Fixed-point fractional library routines.
+ (line 944)
+* __fracthiuda: Fixed-point fractional library routines.
+ (line 951)
+* __fracthiudq: Fixed-point fractional library routines.
+ (line 948)
+* __fracthiuha: Fixed-point fractional library routines.
+ (line 949)
+* __fracthiuhq: Fixed-point fractional library routines.
+ (line 946)
+* __fracthiuqq: Fixed-point fractional library routines.
+ (line 945)
+* __fracthiusa: Fixed-point fractional library routines.
+ (line 950)
+* __fracthiusq: Fixed-point fractional library routines.
+ (line 947)
+* __fracthiuta: Fixed-point fractional library routines.
+ (line 952)
+* __fracthqda: Fixed-point fractional library routines.
+ (line 498)
+* __fracthqdf: Fixed-point fractional library routines.
+ (line 514)
+* __fracthqdi: Fixed-point fractional library routines.
+ (line 511)
+* __fracthqdq2: Fixed-point fractional library routines.
+ (line 495)
+* __fracthqha: Fixed-point fractional library routines.
+ (line 496)
+* __fracthqhi: Fixed-point fractional library routines.
+ (line 509)
+* __fracthqqi: Fixed-point fractional library routines.
+ (line 508)
+* __fracthqqq2: Fixed-point fractional library routines.
+ (line 493)
+* __fracthqsa: Fixed-point fractional library routines.
+ (line 497)
+* __fracthqsf: Fixed-point fractional library routines.
+ (line 513)
+* __fracthqsi: Fixed-point fractional library routines.
+ (line 510)
+* __fracthqsq2: Fixed-point fractional library routines.
+ (line 494)
+* __fracthqta: Fixed-point fractional library routines.
+ (line 499)
+* __fracthqti: Fixed-point fractional library routines.
+ (line 512)
+* __fracthquda: Fixed-point fractional library routines.
+ (line 506)
+* __fracthqudq: Fixed-point fractional library routines.
+ (line 503)
+* __fracthquha: Fixed-point fractional library routines.
+ (line 504)
+* __fracthquhq: Fixed-point fractional library routines.
+ (line 501)
+* __fracthquqq: Fixed-point fractional library routines.
+ (line 500)
+* __fracthqusa: Fixed-point fractional library routines.
+ (line 505)
+* __fracthqusq: Fixed-point fractional library routines.
+ (line 502)
+* __fracthquta: Fixed-point fractional library routines.
+ (line 507)
+* __fractqida: Fixed-point fractional library routines.
+ (line 925)
+* __fractqidq: Fixed-point fractional library routines.
+ (line 922)
+* __fractqiha: Fixed-point fractional library routines.
+ (line 923)
+* __fractqihq: Fixed-point fractional library routines.
+ (line 920)
+* __fractqiqq: Fixed-point fractional library routines.
+ (line 919)
+* __fractqisa: Fixed-point fractional library routines.
+ (line 924)
+* __fractqisq: Fixed-point fractional library routines.
+ (line 921)
+* __fractqita: Fixed-point fractional library routines.
+ (line 926)
+* __fractqiuda: Fixed-point fractional library routines.
+ (line 934)
+* __fractqiudq: Fixed-point fractional library routines.
+ (line 931)
+* __fractqiuha: Fixed-point fractional library routines.
+ (line 932)
+* __fractqiuhq: Fixed-point fractional library routines.
+ (line 928)
+* __fractqiuqq: Fixed-point fractional library routines.
+ (line 927)
+* __fractqiusa: Fixed-point fractional library routines.
+ (line 933)
+* __fractqiusq: Fixed-point fractional library routines.
+ (line 929)
+* __fractqiuta: Fixed-point fractional library routines.
+ (line 936)
+* __fractqqda: Fixed-point fractional library routines.
+ (line 474)
+* __fractqqdf: Fixed-point fractional library routines.
+ (line 492)
+* __fractqqdi: Fixed-point fractional library routines.
+ (line 489)
+* __fractqqdq2: Fixed-point fractional library routines.
+ (line 471)
+* __fractqqha: Fixed-point fractional library routines.
+ (line 472)
+* __fractqqhi: Fixed-point fractional library routines.
+ (line 487)
+* __fractqqhq2: Fixed-point fractional library routines.
+ (line 469)
+* __fractqqqi: Fixed-point fractional library routines.
+ (line 486)
+* __fractqqsa: Fixed-point fractional library routines.
+ (line 473)
+* __fractqqsf: Fixed-point fractional library routines.
+ (line 491)
+* __fractqqsi: Fixed-point fractional library routines.
+ (line 488)
+* __fractqqsq2: Fixed-point fractional library routines.
+ (line 470)
+* __fractqqta: Fixed-point fractional library routines.
+ (line 475)
+* __fractqqti: Fixed-point fractional library routines.
+ (line 490)
+* __fractqquda: Fixed-point fractional library routines.
+ (line 483)
+* __fractqqudq: Fixed-point fractional library routines.
+ (line 480)
+* __fractqquha: Fixed-point fractional library routines.
+ (line 481)
+* __fractqquhq: Fixed-point fractional library routines.
+ (line 477)
+* __fractqquqq: Fixed-point fractional library routines.
+ (line 476)
+* __fractqqusa: Fixed-point fractional library routines.
+ (line 482)
+* __fractqqusq: Fixed-point fractional library routines.
+ (line 478)
+* __fractqquta: Fixed-point fractional library routines.
+ (line 485)
+* __fractsada2: Fixed-point fractional library routines.
+ (line 596)
+* __fractsadf: Fixed-point fractional library routines.
+ (line 612)
+* __fractsadi: Fixed-point fractional library routines.
+ (line 609)
+* __fractsadq: Fixed-point fractional library routines.
+ (line 594)
+* __fractsaha2: Fixed-point fractional library routines.
+ (line 595)
+* __fractsahi: Fixed-point fractional library routines.
+ (line 607)
+* __fractsahq: Fixed-point fractional library routines.
+ (line 592)
+* __fractsaqi: Fixed-point fractional library routines.
+ (line 606)
+* __fractsaqq: Fixed-point fractional library routines.
+ (line 591)
+* __fractsasf: Fixed-point fractional library routines.
+ (line 611)
+* __fractsasi: Fixed-point fractional library routines.
+ (line 608)
+* __fractsasq: Fixed-point fractional library routines.
+ (line 593)
+* __fractsata2: Fixed-point fractional library routines.
+ (line 597)
+* __fractsati: Fixed-point fractional library routines.
+ (line 610)
+* __fractsauda: Fixed-point fractional library routines.
+ (line 604)
+* __fractsaudq: Fixed-point fractional library routines.
+ (line 601)
+* __fractsauha: Fixed-point fractional library routines.
+ (line 602)
+* __fractsauhq: Fixed-point fractional library routines.
+ (line 599)
+* __fractsauqq: Fixed-point fractional library routines.
+ (line 598)
+* __fractsausa: Fixed-point fractional library routines.
+ (line 603)
+* __fractsausq: Fixed-point fractional library routines.
+ (line 600)
+* __fractsauta: Fixed-point fractional library routines.
+ (line 605)
+* __fractsfda: Fixed-point fractional library routines.
+ (line 1009)
+* __fractsfdq: Fixed-point fractional library routines.
+ (line 1006)
+* __fractsfha: Fixed-point fractional library routines.
+ (line 1007)
+* __fractsfhq: Fixed-point fractional library routines.
+ (line 1004)
+* __fractsfqq: Fixed-point fractional library routines.
+ (line 1003)
+* __fractsfsa: Fixed-point fractional library routines.
+ (line 1008)
+* __fractsfsq: Fixed-point fractional library routines.
+ (line 1005)
+* __fractsfta: Fixed-point fractional library routines.
+ (line 1010)
+* __fractsfuda: Fixed-point fractional library routines.
+ (line 1017)
+* __fractsfudq: Fixed-point fractional library routines.
+ (line 1014)
+* __fractsfuha: Fixed-point fractional library routines.
+ (line 1015)
+* __fractsfuhq: Fixed-point fractional library routines.
+ (line 1012)
+* __fractsfuqq: Fixed-point fractional library routines.
+ (line 1011)
+* __fractsfusa: Fixed-point fractional library routines.
+ (line 1016)
+* __fractsfusq: Fixed-point fractional library routines.
+ (line 1013)
+* __fractsfuta: Fixed-point fractional library routines.
+ (line 1018)
+* __fractsida: Fixed-point fractional library routines.
+ (line 959)
+* __fractsidq: Fixed-point fractional library routines.
+ (line 956)
+* __fractsiha: Fixed-point fractional library routines.
+ (line 957)
+* __fractsihq: Fixed-point fractional library routines.
+ (line 954)
+* __fractsiqq: Fixed-point fractional library routines.
+ (line 953)
+* __fractsisa: Fixed-point fractional library routines.
+ (line 958)
+* __fractsisq: Fixed-point fractional library routines.
+ (line 955)
+* __fractsita: Fixed-point fractional library routines.
+ (line 960)
+* __fractsiuda: Fixed-point fractional library routines.
+ (line 967)
+* __fractsiudq: Fixed-point fractional library routines.
+ (line 964)
+* __fractsiuha: Fixed-point fractional library routines.
+ (line 965)
+* __fractsiuhq: Fixed-point fractional library routines.
+ (line 962)
+* __fractsiuqq: Fixed-point fractional library routines.
+ (line 961)
+* __fractsiusa: Fixed-point fractional library routines.
+ (line 966)
+* __fractsiusq: Fixed-point fractional library routines.
+ (line 963)
+* __fractsiuta: Fixed-point fractional library routines.
+ (line 968)
+* __fractsqda: Fixed-point fractional library routines.
+ (line 520)
+* __fractsqdf: Fixed-point fractional library routines.
+ (line 538)
+* __fractsqdi: Fixed-point fractional library routines.
+ (line 535)
+* __fractsqdq2: Fixed-point fractional library routines.
+ (line 517)
+* __fractsqha: Fixed-point fractional library routines.
+ (line 518)
+* __fractsqhi: Fixed-point fractional library routines.
+ (line 533)
+* __fractsqhq2: Fixed-point fractional library routines.
+ (line 516)
+* __fractsqqi: Fixed-point fractional library routines.
+ (line 532)
+* __fractsqqq2: Fixed-point fractional library routines.
+ (line 515)
+* __fractsqsa: Fixed-point fractional library routines.
+ (line 519)
+* __fractsqsf: Fixed-point fractional library routines.
+ (line 537)
+* __fractsqsi: Fixed-point fractional library routines.
+ (line 534)
+* __fractsqta: Fixed-point fractional library routines.
+ (line 521)
+* __fractsqti: Fixed-point fractional library routines.
+ (line 536)
+* __fractsquda: Fixed-point fractional library routines.
+ (line 529)
+* __fractsqudq: Fixed-point fractional library routines.
+ (line 526)
+* __fractsquha: Fixed-point fractional library routines.
+ (line 527)
+* __fractsquhq: Fixed-point fractional library routines.
+ (line 523)
+* __fractsquqq: Fixed-point fractional library routines.
+ (line 522)
+* __fractsqusa: Fixed-point fractional library routines.
+ (line 528)
+* __fractsqusq: Fixed-point fractional library routines.
+ (line 524)
+* __fractsquta: Fixed-point fractional library routines.
+ (line 531)
+* __fracttada2: Fixed-point fractional library routines.
+ (line 643)
+* __fracttadf: Fixed-point fractional library routines.
+ (line 664)
+* __fracttadi: Fixed-point fractional library routines.
+ (line 661)
+* __fracttadq: Fixed-point fractional library routines.
+ (line 640)
+* __fracttaha2: Fixed-point fractional library routines.
+ (line 641)
+* __fracttahi: Fixed-point fractional library routines.
+ (line 659)
+* __fracttahq: Fixed-point fractional library routines.
+ (line 638)
+* __fracttaqi: Fixed-point fractional library routines.
+ (line 658)
+* __fracttaqq: Fixed-point fractional library routines.
+ (line 637)
+* __fracttasa2: Fixed-point fractional library routines.
+ (line 642)
+* __fracttasf: Fixed-point fractional library routines.
+ (line 663)
+* __fracttasi: Fixed-point fractional library routines.
+ (line 660)
+* __fracttasq: Fixed-point fractional library routines.
+ (line 639)
+* __fracttati: Fixed-point fractional library routines.
+ (line 662)
+* __fracttauda: Fixed-point fractional library routines.
+ (line 655)
+* __fracttaudq: Fixed-point fractional library routines.
+ (line 650)
+* __fracttauha: Fixed-point fractional library routines.
+ (line 652)
+* __fracttauhq: Fixed-point fractional library routines.
+ (line 646)
+* __fracttauqq: Fixed-point fractional library routines.
+ (line 645)
+* __fracttausa: Fixed-point fractional library routines.
+ (line 653)
+* __fracttausq: Fixed-point fractional library routines.
+ (line 648)
+* __fracttauta: Fixed-point fractional library routines.
+ (line 657)
+* __fracttida: Fixed-point fractional library routines.
+ (line 991)
+* __fracttidq: Fixed-point fractional library routines.
+ (line 988)
+* __fracttiha: Fixed-point fractional library routines.
+ (line 989)
+* __fracttihq: Fixed-point fractional library routines.
+ (line 986)
+* __fracttiqq: Fixed-point fractional library routines.
+ (line 985)
+* __fracttisa: Fixed-point fractional library routines.
+ (line 990)
+* __fracttisq: Fixed-point fractional library routines.
+ (line 987)
+* __fracttita: Fixed-point fractional library routines.
+ (line 992)
+* __fracttiuda: Fixed-point fractional library routines.
+ (line 1000)
+* __fracttiudq: Fixed-point fractional library routines.
+ (line 997)
+* __fracttiuha: Fixed-point fractional library routines.
+ (line 998)
+* __fracttiuhq: Fixed-point fractional library routines.
+ (line 994)
+* __fracttiuqq: Fixed-point fractional library routines.
+ (line 993)
+* __fracttiusa: Fixed-point fractional library routines.
+ (line 999)
+* __fracttiusq: Fixed-point fractional library routines.
+ (line 995)
+* __fracttiuta: Fixed-point fractional library routines.
+ (line 1002)
+* __fractudada: Fixed-point fractional library routines.
+ (line 858)
+* __fractudadf: Fixed-point fractional library routines.
+ (line 881)
+* __fractudadi: Fixed-point fractional library routines.
+ (line 878)
+* __fractudadq: Fixed-point fractional library routines.
+ (line 855)
+* __fractudaha: Fixed-point fractional library routines.
+ (line 856)
+* __fractudahi: Fixed-point fractional library routines.
+ (line 876)
+* __fractudahq: Fixed-point fractional library routines.
+ (line 852)
+* __fractudaqi: Fixed-point fractional library routines.
+ (line 875)
+* __fractudaqq: Fixed-point fractional library routines.
+ (line 851)
+* __fractudasa: Fixed-point fractional library routines.
+ (line 857)
+* __fractudasf: Fixed-point fractional library routines.
+ (line 880)
+* __fractudasi: Fixed-point fractional library routines.
+ (line 877)
+* __fractudasq: Fixed-point fractional library routines.
+ (line 853)
+* __fractudata: Fixed-point fractional library routines.
+ (line 860)
+* __fractudati: Fixed-point fractional library routines.
+ (line 879)
+* __fractudaudq: Fixed-point fractional library routines.
+ (line 868)
+* __fractudauha2: Fixed-point fractional library routines.
+ (line 870)
+* __fractudauhq: Fixed-point fractional library routines.
+ (line 864)
+* __fractudauqq: Fixed-point fractional library routines.
+ (line 862)
+* __fractudausa2: Fixed-point fractional library routines.
+ (line 872)
+* __fractudausq: Fixed-point fractional library routines.
+ (line 866)
+* __fractudauta2: Fixed-point fractional library routines.
+ (line 874)
+* __fractudqda: Fixed-point fractional library routines.
+ (line 766)
+* __fractudqdf: Fixed-point fractional library routines.
+ (line 791)
+* __fractudqdi: Fixed-point fractional library routines.
+ (line 787)
+* __fractudqdq: Fixed-point fractional library routines.
+ (line 761)
+* __fractudqha: Fixed-point fractional library routines.
+ (line 763)
+* __fractudqhi: Fixed-point fractional library routines.
+ (line 785)
+* __fractudqhq: Fixed-point fractional library routines.
+ (line 757)
+* __fractudqqi: Fixed-point fractional library routines.
+ (line 784)
+* __fractudqqq: Fixed-point fractional library routines.
+ (line 756)
+* __fractudqsa: Fixed-point fractional library routines.
+ (line 764)
+* __fractudqsf: Fixed-point fractional library routines.
+ (line 790)
+* __fractudqsi: Fixed-point fractional library routines.
+ (line 786)
+* __fractudqsq: Fixed-point fractional library routines.
+ (line 759)
+* __fractudqta: Fixed-point fractional library routines.
+ (line 768)
+* __fractudqti: Fixed-point fractional library routines.
+ (line 789)
+* __fractudquda: Fixed-point fractional library routines.
+ (line 780)
+* __fractudquha: Fixed-point fractional library routines.
+ (line 776)
+* __fractudquhq2: Fixed-point fractional library routines.
+ (line 772)
+* __fractudquqq2: Fixed-point fractional library routines.
+ (line 770)
+* __fractudqusa: Fixed-point fractional library routines.
+ (line 778)
+* __fractudqusq2: Fixed-point fractional library routines.
+ (line 774)
+* __fractudquta: Fixed-point fractional library routines.
+ (line 782)
+* __fractuhada: Fixed-point fractional library routines.
+ (line 799)
+* __fractuhadf: Fixed-point fractional library routines.
+ (line 822)
+* __fractuhadi: Fixed-point fractional library routines.
+ (line 819)
+* __fractuhadq: Fixed-point fractional library routines.
+ (line 796)
+* __fractuhaha: Fixed-point fractional library routines.
+ (line 797)
+* __fractuhahi: Fixed-point fractional library routines.
+ (line 817)
+* __fractuhahq: Fixed-point fractional library routines.
+ (line 793)
+* __fractuhaqi: Fixed-point fractional library routines.
+ (line 816)
+* __fractuhaqq: Fixed-point fractional library routines.
+ (line 792)
+* __fractuhasa: Fixed-point fractional library routines.
+ (line 798)
+* __fractuhasf: Fixed-point fractional library routines.
+ (line 821)
+* __fractuhasi: Fixed-point fractional library routines.
+ (line 818)
+* __fractuhasq: Fixed-point fractional library routines.
+ (line 794)
+* __fractuhata: Fixed-point fractional library routines.
+ (line 801)
+* __fractuhati: Fixed-point fractional library routines.
+ (line 820)
+* __fractuhauda2: Fixed-point fractional library routines.
+ (line 813)
+* __fractuhaudq: Fixed-point fractional library routines.
+ (line 809)
+* __fractuhauhq: Fixed-point fractional library routines.
+ (line 805)
+* __fractuhauqq: Fixed-point fractional library routines.
+ (line 803)
+* __fractuhausa2: Fixed-point fractional library routines.
+ (line 811)
+* __fractuhausq: Fixed-point fractional library routines.
+ (line 807)
+* __fractuhauta2: Fixed-point fractional library routines.
+ (line 815)
+* __fractuhqda: Fixed-point fractional library routines.
+ (line 702)
+* __fractuhqdf: Fixed-point fractional library routines.
+ (line 723)
+* __fractuhqdi: Fixed-point fractional library routines.
+ (line 720)
+* __fractuhqdq: Fixed-point fractional library routines.
+ (line 699)
+* __fractuhqha: Fixed-point fractional library routines.
+ (line 700)
+* __fractuhqhi: Fixed-point fractional library routines.
+ (line 718)
+* __fractuhqhq: Fixed-point fractional library routines.
+ (line 697)
+* __fractuhqqi: Fixed-point fractional library routines.
+ (line 717)
+* __fractuhqqq: Fixed-point fractional library routines.
+ (line 696)
+* __fractuhqsa: Fixed-point fractional library routines.
+ (line 701)
+* __fractuhqsf: Fixed-point fractional library routines.
+ (line 722)
+* __fractuhqsi: Fixed-point fractional library routines.
+ (line 719)
+* __fractuhqsq: Fixed-point fractional library routines.
+ (line 698)
+* __fractuhqta: Fixed-point fractional library routines.
+ (line 703)
+* __fractuhqti: Fixed-point fractional library routines.
+ (line 721)
+* __fractuhquda: Fixed-point fractional library routines.
+ (line 714)
+* __fractuhqudq2: Fixed-point fractional library routines.
+ (line 709)
+* __fractuhquha: Fixed-point fractional library routines.
+ (line 711)
+* __fractuhquqq2: Fixed-point fractional library routines.
+ (line 705)
+* __fractuhqusa: Fixed-point fractional library routines.
+ (line 712)
+* __fractuhqusq2: Fixed-point fractional library routines.
+ (line 707)
+* __fractuhquta: Fixed-point fractional library routines.
+ (line 716)
+* __fractunsdadi: Fixed-point fractional library routines.
+ (line 1555)
+* __fractunsdahi: Fixed-point fractional library routines.
+ (line 1553)
+* __fractunsdaqi: Fixed-point fractional library routines.
+ (line 1552)
+* __fractunsdasi: Fixed-point fractional library routines.
+ (line 1554)
+* __fractunsdati: Fixed-point fractional library routines.
+ (line 1556)
+* __fractunsdida: Fixed-point fractional library routines.
+ (line 1707)
+* __fractunsdidq: Fixed-point fractional library routines.
+ (line 1704)
+* __fractunsdiha: Fixed-point fractional library routines.
+ (line 1705)
+* __fractunsdihq: Fixed-point fractional library routines.
+ (line 1702)
+* __fractunsdiqq: Fixed-point fractional library routines.
+ (line 1701)
+* __fractunsdisa: Fixed-point fractional library routines.
+ (line 1706)
+* __fractunsdisq: Fixed-point fractional library routines.
+ (line 1703)
+* __fractunsdita: Fixed-point fractional library routines.
+ (line 1708)
+* __fractunsdiuda: Fixed-point fractional library routines.
+ (line 1720)
+* __fractunsdiudq: Fixed-point fractional library routines.
+ (line 1715)
+* __fractunsdiuha: Fixed-point fractional library routines.
+ (line 1717)
+* __fractunsdiuhq: Fixed-point fractional library routines.
+ (line 1711)
+* __fractunsdiuqq: Fixed-point fractional library routines.
+ (line 1710)
+* __fractunsdiusa: Fixed-point fractional library routines.
+ (line 1718)
+* __fractunsdiusq: Fixed-point fractional library routines.
+ (line 1713)
+* __fractunsdiuta: Fixed-point fractional library routines.
+ (line 1722)
+* __fractunsdqdi: Fixed-point fractional library routines.
+ (line 1539)
+* __fractunsdqhi: Fixed-point fractional library routines.
+ (line 1537)
+* __fractunsdqqi: Fixed-point fractional library routines.
+ (line 1536)
+* __fractunsdqsi: Fixed-point fractional library routines.
+ (line 1538)
+* __fractunsdqti: Fixed-point fractional library routines.
+ (line 1541)
+* __fractunshadi: Fixed-point fractional library routines.
+ (line 1545)
+* __fractunshahi: Fixed-point fractional library routines.
+ (line 1543)
+* __fractunshaqi: Fixed-point fractional library routines.
+ (line 1542)
+* __fractunshasi: Fixed-point fractional library routines.
+ (line 1544)
+* __fractunshati: Fixed-point fractional library routines.
+ (line 1546)
+* __fractunshida: Fixed-point fractional library routines.
+ (line 1663)
+* __fractunshidq: Fixed-point fractional library routines.
+ (line 1660)
+* __fractunshiha: Fixed-point fractional library routines.
+ (line 1661)
+* __fractunshihq: Fixed-point fractional library routines.
+ (line 1658)
+* __fractunshiqq: Fixed-point fractional library routines.
+ (line 1657)
+* __fractunshisa: Fixed-point fractional library routines.
+ (line 1662)
+* __fractunshisq: Fixed-point fractional library routines.
+ (line 1659)
+* __fractunshita: Fixed-point fractional library routines.
+ (line 1664)
+* __fractunshiuda: Fixed-point fractional library routines.
+ (line 1676)
+* __fractunshiudq: Fixed-point fractional library routines.
+ (line 1671)
+* __fractunshiuha: Fixed-point fractional library routines.
+ (line 1673)
+* __fractunshiuhq: Fixed-point fractional library routines.
+ (line 1667)
+* __fractunshiuqq: Fixed-point fractional library routines.
+ (line 1666)
+* __fractunshiusa: Fixed-point fractional library routines.
+ (line 1674)
+* __fractunshiusq: Fixed-point fractional library routines.
+ (line 1669)
+* __fractunshiuta: Fixed-point fractional library routines.
+ (line 1678)
+* __fractunshqdi: Fixed-point fractional library routines.
+ (line 1529)
+* __fractunshqhi: Fixed-point fractional library routines.
+ (line 1527)
+* __fractunshqqi: Fixed-point fractional library routines.
+ (line 1526)
+* __fractunshqsi: Fixed-point fractional library routines.
+ (line 1528)
+* __fractunshqti: Fixed-point fractional library routines.
+ (line 1530)
+* __fractunsqida: Fixed-point fractional library routines.
+ (line 1641)
+* __fractunsqidq: Fixed-point fractional library routines.
+ (line 1638)
+* __fractunsqiha: Fixed-point fractional library routines.
+ (line 1639)
+* __fractunsqihq: Fixed-point fractional library routines.
+ (line 1636)
+* __fractunsqiqq: Fixed-point fractional library routines.
+ (line 1635)
+* __fractunsqisa: Fixed-point fractional library routines.
+ (line 1640)
+* __fractunsqisq: Fixed-point fractional library routines.
+ (line 1637)
+* __fractunsqita: Fixed-point fractional library routines.
+ (line 1642)
+* __fractunsqiuda: Fixed-point fractional library routines.
+ (line 1654)
+* __fractunsqiudq: Fixed-point fractional library routines.
+ (line 1649)
+* __fractunsqiuha: Fixed-point fractional library routines.
+ (line 1651)
+* __fractunsqiuhq: Fixed-point fractional library routines.
+ (line 1645)
+* __fractunsqiuqq: Fixed-point fractional library routines.
+ (line 1644)
+* __fractunsqiusa: Fixed-point fractional library routines.
+ (line 1652)
+* __fractunsqiusq: Fixed-point fractional library routines.
+ (line 1647)
+* __fractunsqiuta: Fixed-point fractional library routines.
+ (line 1656)
+* __fractunsqqdi: Fixed-point fractional library routines.
+ (line 1524)
+* __fractunsqqhi: Fixed-point fractional library routines.
+ (line 1522)
+* __fractunsqqqi: Fixed-point fractional library routines.
+ (line 1521)
+* __fractunsqqsi: Fixed-point fractional library routines.
+ (line 1523)
+* __fractunsqqti: Fixed-point fractional library routines.
+ (line 1525)
+* __fractunssadi: Fixed-point fractional library routines.
+ (line 1550)
+* __fractunssahi: Fixed-point fractional library routines.
+ (line 1548)
+* __fractunssaqi: Fixed-point fractional library routines.
+ (line 1547)
+* __fractunssasi: Fixed-point fractional library routines.
+ (line 1549)
+* __fractunssati: Fixed-point fractional library routines.
+ (line 1551)
+* __fractunssida: Fixed-point fractional library routines.
+ (line 1685)
+* __fractunssidq: Fixed-point fractional library routines.
+ (line 1682)
+* __fractunssiha: Fixed-point fractional library routines.
+ (line 1683)
+* __fractunssihq: Fixed-point fractional library routines.
+ (line 1680)
+* __fractunssiqq: Fixed-point fractional library routines.
+ (line 1679)
+* __fractunssisa: Fixed-point fractional library routines.
+ (line 1684)
+* __fractunssisq: Fixed-point fractional library routines.
+ (line 1681)
+* __fractunssita: Fixed-point fractional library routines.
+ (line 1686)
+* __fractunssiuda: Fixed-point fractional library routines.
+ (line 1698)
+* __fractunssiudq: Fixed-point fractional library routines.
+ (line 1693)
+* __fractunssiuha: Fixed-point fractional library routines.
+ (line 1695)
+* __fractunssiuhq: Fixed-point fractional library routines.
+ (line 1689)
+* __fractunssiuqq: Fixed-point fractional library routines.
+ (line 1688)
+* __fractunssiusa: Fixed-point fractional library routines.
+ (line 1696)
+* __fractunssiusq: Fixed-point fractional library routines.
+ (line 1691)
+* __fractunssiuta: Fixed-point fractional library routines.
+ (line 1700)
+* __fractunssqdi: Fixed-point fractional library routines.
+ (line 1534)
+* __fractunssqhi: Fixed-point fractional library routines.
+ (line 1532)
+* __fractunssqqi: Fixed-point fractional library routines.
+ (line 1531)
+* __fractunssqsi: Fixed-point fractional library routines.
+ (line 1533)
+* __fractunssqti: Fixed-point fractional library routines.
+ (line 1535)
+* __fractunstadi: Fixed-point fractional library routines.
+ (line 1560)
+* __fractunstahi: Fixed-point fractional library routines.
+ (line 1558)
+* __fractunstaqi: Fixed-point fractional library routines.
+ (line 1557)
+* __fractunstasi: Fixed-point fractional library routines.
+ (line 1559)
+* __fractunstati: Fixed-point fractional library routines.
+ (line 1562)
+* __fractunstida: Fixed-point fractional library routines.
+ (line 1730)
+* __fractunstidq: Fixed-point fractional library routines.
+ (line 1727)
+* __fractunstiha: Fixed-point fractional library routines.
+ (line 1728)
+* __fractunstihq: Fixed-point fractional library routines.
+ (line 1724)
+* __fractunstiqq: Fixed-point fractional library routines.
+ (line 1723)
+* __fractunstisa: Fixed-point fractional library routines.
+ (line 1729)
+* __fractunstisq: Fixed-point fractional library routines.
+ (line 1725)
+* __fractunstita: Fixed-point fractional library routines.
+ (line 1732)
+* __fractunstiuda: Fixed-point fractional library routines.
+ (line 1746)
+* __fractunstiudq: Fixed-point fractional library routines.
+ (line 1740)
+* __fractunstiuha: Fixed-point fractional library routines.
+ (line 1742)
+* __fractunstiuhq: Fixed-point fractional library routines.
+ (line 1736)
+* __fractunstiuqq: Fixed-point fractional library routines.
+ (line 1734)
+* __fractunstiusa: Fixed-point fractional library routines.
+ (line 1744)
+* __fractunstiusq: Fixed-point fractional library routines.
+ (line 1738)
+* __fractunstiuta: Fixed-point fractional library routines.
+ (line 1748)
+* __fractunsudadi: Fixed-point fractional library routines.
+ (line 1622)
+* __fractunsudahi: Fixed-point fractional library routines.
+ (line 1618)
+* __fractunsudaqi: Fixed-point fractional library routines.
+ (line 1616)
+* __fractunsudasi: Fixed-point fractional library routines.
+ (line 1620)
+* __fractunsudati: Fixed-point fractional library routines.
+ (line 1624)
+* __fractunsudqdi: Fixed-point fractional library routines.
+ (line 1596)
+* __fractunsudqhi: Fixed-point fractional library routines.
+ (line 1592)
+* __fractunsudqqi: Fixed-point fractional library routines.
+ (line 1590)
+* __fractunsudqsi: Fixed-point fractional library routines.
+ (line 1594)
+* __fractunsudqti: Fixed-point fractional library routines.
+ (line 1598)
+* __fractunsuhadi: Fixed-point fractional library routines.
+ (line 1606)
+* __fractunsuhahi: Fixed-point fractional library routines.
+ (line 1602)
+* __fractunsuhaqi: Fixed-point fractional library routines.
+ (line 1600)
+* __fractunsuhasi: Fixed-point fractional library routines.
+ (line 1604)
+* __fractunsuhati: Fixed-point fractional library routines.
+ (line 1608)
+* __fractunsuhqdi: Fixed-point fractional library routines.
+ (line 1576)
+* __fractunsuhqhi: Fixed-point fractional library routines.
+ (line 1574)
+* __fractunsuhqqi: Fixed-point fractional library routines.
+ (line 1573)
+* __fractunsuhqsi: Fixed-point fractional library routines.
+ (line 1575)
+* __fractunsuhqti: Fixed-point fractional library routines.
+ (line 1578)
+* __fractunsuqqdi: Fixed-point fractional library routines.
+ (line 1570)
+* __fractunsuqqhi: Fixed-point fractional library routines.
+ (line 1566)
+* __fractunsuqqqi: Fixed-point fractional library routines.
+ (line 1564)
+* __fractunsuqqsi: Fixed-point fractional library routines.
+ (line 1568)
+* __fractunsuqqti: Fixed-point fractional library routines.
+ (line 1572)
+* __fractunsusadi: Fixed-point fractional library routines.
+ (line 1612)
+* __fractunsusahi: Fixed-point fractional library routines.
+ (line 1610)
+* __fractunsusaqi: Fixed-point fractional library routines.
+ (line 1609)
+* __fractunsusasi: Fixed-point fractional library routines.
+ (line 1611)
+* __fractunsusati: Fixed-point fractional library routines.
+ (line 1614)
+* __fractunsusqdi: Fixed-point fractional library routines.
+ (line 1586)
+* __fractunsusqhi: Fixed-point fractional library routines.
+ (line 1582)
+* __fractunsusqqi: Fixed-point fractional library routines.
+ (line 1580)
+* __fractunsusqsi: Fixed-point fractional library routines.
+ (line 1584)
+* __fractunsusqti: Fixed-point fractional library routines.
+ (line 1588)
+* __fractunsutadi: Fixed-point fractional library routines.
+ (line 1632)
+* __fractunsutahi: Fixed-point fractional library routines.
+ (line 1628)
+* __fractunsutaqi: Fixed-point fractional library routines.
+ (line 1626)
+* __fractunsutasi: Fixed-point fractional library routines.
+ (line 1630)
+* __fractunsutati: Fixed-point fractional library routines.
+ (line 1634)
+* __fractuqqda: Fixed-point fractional library routines.
+ (line 672)
+* __fractuqqdf: Fixed-point fractional library routines.
+ (line 695)
+* __fractuqqdi: Fixed-point fractional library routines.
+ (line 692)
+* __fractuqqdq: Fixed-point fractional library routines.
+ (line 669)
+* __fractuqqha: Fixed-point fractional library routines.
+ (line 670)
+* __fractuqqhi: Fixed-point fractional library routines.
+ (line 690)
+* __fractuqqhq: Fixed-point fractional library routines.
+ (line 666)
+* __fractuqqqi: Fixed-point fractional library routines.
+ (line 689)
+* __fractuqqqq: Fixed-point fractional library routines.
+ (line 665)
+* __fractuqqsa: Fixed-point fractional library routines.
+ (line 671)
+* __fractuqqsf: Fixed-point fractional library routines.
+ (line 694)
+* __fractuqqsi: Fixed-point fractional library routines.
+ (line 691)
+* __fractuqqsq: Fixed-point fractional library routines.
+ (line 667)
+* __fractuqqta: Fixed-point fractional library routines.
+ (line 674)
+* __fractuqqti: Fixed-point fractional library routines.
+ (line 693)
+* __fractuqquda: Fixed-point fractional library routines.
+ (line 686)
+* __fractuqqudq2: Fixed-point fractional library routines.
+ (line 680)
+* __fractuqquha: Fixed-point fractional library routines.
+ (line 682)
+* __fractuqquhq2: Fixed-point fractional library routines.
+ (line 676)
+* __fractuqqusa: Fixed-point fractional library routines.
+ (line 684)
+* __fractuqqusq2: Fixed-point fractional library routines.
+ (line 678)
+* __fractuqquta: Fixed-point fractional library routines.
+ (line 688)
+* __fractusada: Fixed-point fractional library routines.
+ (line 829)
+* __fractusadf: Fixed-point fractional library routines.
+ (line 850)
+* __fractusadi: Fixed-point fractional library routines.
+ (line 847)
+* __fractusadq: Fixed-point fractional library routines.
+ (line 826)
+* __fractusaha: Fixed-point fractional library routines.
+ (line 827)
+* __fractusahi: Fixed-point fractional library routines.
+ (line 845)
+* __fractusahq: Fixed-point fractional library routines.
+ (line 824)
+* __fractusaqi: Fixed-point fractional library routines.
+ (line 844)
+* __fractusaqq: Fixed-point fractional library routines.
+ (line 823)
+* __fractusasa: Fixed-point fractional library routines.
+ (line 828)
+* __fractusasf: Fixed-point fractional library routines.
+ (line 849)
+* __fractusasi: Fixed-point fractional library routines.
+ (line 846)
+* __fractusasq: Fixed-point fractional library routines.
+ (line 825)
+* __fractusata: Fixed-point fractional library routines.
+ (line 830)
+* __fractusati: Fixed-point fractional library routines.
+ (line 848)
+* __fractusauda2: Fixed-point fractional library routines.
+ (line 841)
+* __fractusaudq: Fixed-point fractional library routines.
+ (line 837)
+* __fractusauha2: Fixed-point fractional library routines.
+ (line 839)
+* __fractusauhq: Fixed-point fractional library routines.
+ (line 833)
+* __fractusauqq: Fixed-point fractional library routines.
+ (line 832)
+* __fractusausq: Fixed-point fractional library routines.
+ (line 835)
+* __fractusauta2: Fixed-point fractional library routines.
+ (line 843)
+* __fractusqda: Fixed-point fractional library routines.
+ (line 731)
+* __fractusqdf: Fixed-point fractional library routines.
+ (line 754)
+* __fractusqdi: Fixed-point fractional library routines.
+ (line 751)
+* __fractusqdq: Fixed-point fractional library routines.
+ (line 728)
+* __fractusqha: Fixed-point fractional library routines.
+ (line 729)
+* __fractusqhi: Fixed-point fractional library routines.
+ (line 749)
+* __fractusqhq: Fixed-point fractional library routines.
+ (line 725)
+* __fractusqqi: Fixed-point fractional library routines.
+ (line 748)
+* __fractusqqq: Fixed-point fractional library routines.
+ (line 724)
+* __fractusqsa: Fixed-point fractional library routines.
+ (line 730)
+* __fractusqsf: Fixed-point fractional library routines.
+ (line 753)
+* __fractusqsi: Fixed-point fractional library routines.
+ (line 750)
+* __fractusqsq: Fixed-point fractional library routines.
+ (line 726)
+* __fractusqta: Fixed-point fractional library routines.
+ (line 733)
+* __fractusqti: Fixed-point fractional library routines.
+ (line 752)
+* __fractusquda: Fixed-point fractional library routines.
+ (line 745)
+* __fractusqudq2: Fixed-point fractional library routines.
+ (line 739)
+* __fractusquha: Fixed-point fractional library routines.
+ (line 741)
+* __fractusquhq2: Fixed-point fractional library routines.
+ (line 737)
+* __fractusquqq2: Fixed-point fractional library routines.
+ (line 735)
+* __fractusqusa: Fixed-point fractional library routines.
+ (line 743)
+* __fractusquta: Fixed-point fractional library routines.
+ (line 747)
+* __fractutada: Fixed-point fractional library routines.
+ (line 893)
+* __fractutadf: Fixed-point fractional library routines.
+ (line 918)
+* __fractutadi: Fixed-point fractional library routines.
+ (line 914)
+* __fractutadq: Fixed-point fractional library routines.
+ (line 888)
+* __fractutaha: Fixed-point fractional library routines.
+ (line 890)
+* __fractutahi: Fixed-point fractional library routines.
+ (line 912)
+* __fractutahq: Fixed-point fractional library routines.
+ (line 884)
+* __fractutaqi: Fixed-point fractional library routines.
+ (line 911)
+* __fractutaqq: Fixed-point fractional library routines.
+ (line 883)
+* __fractutasa: Fixed-point fractional library routines.
+ (line 891)
+* __fractutasf: Fixed-point fractional library routines.
+ (line 917)
+* __fractutasi: Fixed-point fractional library routines.
+ (line 913)
+* __fractutasq: Fixed-point fractional library routines.
+ (line 886)
+* __fractutata: Fixed-point fractional library routines.
+ (line 895)
+* __fractutati: Fixed-point fractional library routines.
+ (line 916)
+* __fractutauda2: Fixed-point fractional library routines.
+ (line 909)
+* __fractutaudq: Fixed-point fractional library routines.
+ (line 903)
+* __fractutauha2: Fixed-point fractional library routines.
+ (line 905)
+* __fractutauhq: Fixed-point fractional library routines.
+ (line 899)
+* __fractutauqq: Fixed-point fractional library routines.
+ (line 897)
+* __fractutausa2: Fixed-point fractional library routines.
+ (line 907)
+* __fractutausq: Fixed-point fractional library routines.
+ (line 901)
+* __gedf2: Soft float library routines.
+ (line 206)
+* __gesf2: Soft float library routines.
+ (line 205)
+* __getf2: Soft float library routines.
+ (line 207)
+* __gtdf2: Soft float library routines.
+ (line 224)
+* __gtsf2: Soft float library routines.
+ (line 223)
+* __gttf2: Soft float library routines.
+ (line 225)
+* __ledf2: Soft float library routines.
+ (line 218)
+* __lesf2: Soft float library routines.
+ (line 217)
+* __letf2: Soft float library routines.
+ (line 219)
+* __lshrdi3: Integer library routines.
+ (line 31)
+* __lshrsi3: Integer library routines.
+ (line 30)
+* __lshrti3: Integer library routines.
+ (line 32)
+* __lshruda3: Fixed-point fractional library routines.
+ (line 390)
+* __lshrudq3: Fixed-point fractional library routines.
+ (line 384)
+* __lshruha3: Fixed-point fractional library routines.
+ (line 386)
+* __lshruhq3: Fixed-point fractional library routines.
+ (line 380)
+* __lshruqq3: Fixed-point fractional library routines.
+ (line 378)
+* __lshrusa3: Fixed-point fractional library routines.
+ (line 388)
+* __lshrusq3: Fixed-point fractional library routines.
+ (line 382)
+* __lshruta3: Fixed-point fractional library routines.
+ (line 392)
+* __ltdf2: Soft float library routines.
+ (line 212)
+* __ltsf2: Soft float library routines.
+ (line 211)
+* __lttf2: Soft float library routines.
+ (line 213)
+* __main: Collect2. (line 15)
+* __moddi3: Integer library routines.
+ (line 37)
+* __modsi3: Integer library routines.
+ (line 36)
+* __modti3: Integer library routines.
+ (line 38)
+* __mulda3: Fixed-point fractional library routines.
+ (line 171)
+* __muldc3: Soft float library routines.
+ (line 241)
+* __muldf3: Soft float library routines.
+ (line 40)
+* __muldi3: Integer library routines.
+ (line 43)
+* __muldq3: Fixed-point fractional library routines.
+ (line 159)
+* __mulha3: Fixed-point fractional library routines.
+ (line 169)
+* __mulhq3: Fixed-point fractional library routines.
+ (line 156)
+* __mulqq3: Fixed-point fractional library routines.
+ (line 155)
+* __mulsa3: Fixed-point fractional library routines.
+ (line 170)
+* __mulsc3: Soft float library routines.
+ (line 239)
+* __mulsf3: Soft float library routines.
+ (line 39)
+* __mulsi3: Integer library routines.
+ (line 42)
+* __mulsq3: Fixed-point fractional library routines.
+ (line 157)
+* __multa3: Fixed-point fractional library routines.
+ (line 173)
+* __multc3: Soft float library routines.
+ (line 243)
+* __multf3: Soft float library routines.
+ (line 42)
+* __multi3: Integer library routines.
+ (line 44)
+* __muluda3: Fixed-point fractional library routines.
+ (line 179)
+* __muludq3: Fixed-point fractional library routines.
+ (line 167)
+* __muluha3: Fixed-point fractional library routines.
+ (line 175)
+* __muluhq3: Fixed-point fractional library routines.
+ (line 163)
+* __muluqq3: Fixed-point fractional library routines.
+ (line 161)
+* __mulusa3: Fixed-point fractional library routines.
+ (line 177)
+* __mulusq3: Fixed-point fractional library routines.
+ (line 165)
+* __muluta3: Fixed-point fractional library routines.
+ (line 181)
+* __mulvdi3: Integer library routines.
+ (line 115)
+* __mulvsi3: Integer library routines.
+ (line 114)
+* __mulxc3: Soft float library routines.
+ (line 245)
+* __mulxf3: Soft float library routines.
+ (line 44)
+* __nedf2: Soft float library routines.
+ (line 200)
+* __negda2: Fixed-point fractional library routines.
+ (line 299)
+* __negdf2: Soft float library routines.
+ (line 56)
+* __negdi2: Integer library routines.
+ (line 47)
+* __negdq2: Fixed-point fractional library routines.
+ (line 289)
+* __negha2: Fixed-point fractional library routines.
+ (line 297)
+* __neghq2: Fixed-point fractional library routines.
+ (line 287)
+* __negqq2: Fixed-point fractional library routines.
+ (line 286)
+* __negsa2: Fixed-point fractional library routines.
+ (line 298)
+* __negsf2: Soft float library routines.
+ (line 55)
+* __negsq2: Fixed-point fractional library routines.
+ (line 288)
+* __negta2: Fixed-point fractional library routines.
+ (line 300)
+* __negtf2: Soft float library routines.
+ (line 57)
+* __negti2: Integer library routines.
+ (line 48)
+* __neguda2: Fixed-point fractional library routines.
+ (line 305)
+* __negudq2: Fixed-point fractional library routines.
+ (line 296)
+* __neguha2: Fixed-point fractional library routines.
+ (line 302)
+* __neguhq2: Fixed-point fractional library routines.
+ (line 292)
+* __neguqq2: Fixed-point fractional library routines.
+ (line 291)
+* __negusa2: Fixed-point fractional library routines.
+ (line 303)
+* __negusq2: Fixed-point fractional library routines.
+ (line 294)
+* __neguta2: Fixed-point fractional library routines.
+ (line 307)
+* __negvdi2: Integer library routines.
+ (line 119)
+* __negvsi2: Integer library routines.
+ (line 118)
+* __negxf2: Soft float library routines.
+ (line 58)
+* __nesf2: Soft float library routines.
+ (line 199)
+* __netf2: Soft float library routines.
+ (line 201)
+* __paritydi2: Integer library routines.
+ (line 151)
+* __paritysi2: Integer library routines.
+ (line 150)
+* __parityti2: Integer library routines.
+ (line 152)
+* __popcountdi2: Integer library routines.
+ (line 157)
+* __popcountsi2: Integer library routines.
+ (line 156)
+* __popcountti2: Integer library routines.
+ (line 158)
+* __powidf2: Soft float library routines.
+ (line 233)
+* __powisf2: Soft float library routines.
+ (line 232)
+* __powitf2: Soft float library routines.
+ (line 234)
+* __powixf2: Soft float library routines.
+ (line 235)
+* __satfractdadq: Fixed-point fractional library routines.
+ (line 1153)
+* __satfractdaha2: Fixed-point fractional library routines.
+ (line 1154)
+* __satfractdahq: Fixed-point fractional library routines.
+ (line 1151)
+* __satfractdaqq: Fixed-point fractional library routines.
+ (line 1150)
+* __satfractdasa2: Fixed-point fractional library routines.
+ (line 1155)
+* __satfractdasq: Fixed-point fractional library routines.
+ (line 1152)
+* __satfractdata2: Fixed-point fractional library routines.
+ (line 1156)
+* __satfractdauda: Fixed-point fractional library routines.
+ (line 1166)
+* __satfractdaudq: Fixed-point fractional library routines.
+ (line 1162)
+* __satfractdauha: Fixed-point fractional library routines.
+ (line 1164)
+* __satfractdauhq: Fixed-point fractional library routines.
+ (line 1159)
+* __satfractdauqq: Fixed-point fractional library routines.
+ (line 1158)
+* __satfractdausa: Fixed-point fractional library routines.
+ (line 1165)
+* __satfractdausq: Fixed-point fractional library routines.
+ (line 1160)
+* __satfractdauta: Fixed-point fractional library routines.
+ (line 1168)
+* __satfractdfda: Fixed-point fractional library routines.
+ (line 1506)
+* __satfractdfdq: Fixed-point fractional library routines.
+ (line 1503)
+* __satfractdfha: Fixed-point fractional library routines.
+ (line 1504)
+* __satfractdfhq: Fixed-point fractional library routines.
+ (line 1501)
+* __satfractdfqq: Fixed-point fractional library routines.
+ (line 1500)
+* __satfractdfsa: Fixed-point fractional library routines.
+ (line 1505)
+* __satfractdfsq: Fixed-point fractional library routines.
+ (line 1502)
+* __satfractdfta: Fixed-point fractional library routines.
+ (line 1507)
+* __satfractdfuda: Fixed-point fractional library routines.
+ (line 1515)
+* __satfractdfudq: Fixed-point fractional library routines.
+ (line 1512)
+* __satfractdfuha: Fixed-point fractional library routines.
+ (line 1513)
+* __satfractdfuhq: Fixed-point fractional library routines.
+ (line 1509)
+* __satfractdfuqq: Fixed-point fractional library routines.
+ (line 1508)
+* __satfractdfusa: Fixed-point fractional library routines.
+ (line 1514)
+* __satfractdfusq: Fixed-point fractional library routines.
+ (line 1510)
+* __satfractdfuta: Fixed-point fractional library routines.
+ (line 1517)
+* __satfractdida: Fixed-point fractional library routines.
+ (line 1456)
+* __satfractdidq: Fixed-point fractional library routines.
+ (line 1453)
+* __satfractdiha: Fixed-point fractional library routines.
+ (line 1454)
+* __satfractdihq: Fixed-point fractional library routines.
+ (line 1451)
+* __satfractdiqq: Fixed-point fractional library routines.
+ (line 1450)
+* __satfractdisa: Fixed-point fractional library routines.
+ (line 1455)
+* __satfractdisq: Fixed-point fractional library routines.
+ (line 1452)
+* __satfractdita: Fixed-point fractional library routines.
+ (line 1457)
+* __satfractdiuda: Fixed-point fractional library routines.
+ (line 1464)
+* __satfractdiudq: Fixed-point fractional library routines.
+ (line 1461)
+* __satfractdiuha: Fixed-point fractional library routines.
+ (line 1462)
+* __satfractdiuhq: Fixed-point fractional library routines.
+ (line 1459)
+* __satfractdiuqq: Fixed-point fractional library routines.
+ (line 1458)
+* __satfractdiusa: Fixed-point fractional library routines.
+ (line 1463)
+* __satfractdiusq: Fixed-point fractional library routines.
+ (line 1460)
+* __satfractdiuta: Fixed-point fractional library routines.
+ (line 1465)
+* __satfractdqda: Fixed-point fractional library routines.
+ (line 1098)
+* __satfractdqha: Fixed-point fractional library routines.
+ (line 1096)
+* __satfractdqhq2: Fixed-point fractional library routines.
+ (line 1094)
+* __satfractdqqq2: Fixed-point fractional library routines.
+ (line 1093)
+* __satfractdqsa: Fixed-point fractional library routines.
+ (line 1097)
+* __satfractdqsq2: Fixed-point fractional library routines.
+ (line 1095)
+* __satfractdqta: Fixed-point fractional library routines.
+ (line 1099)
+* __satfractdquda: Fixed-point fractional library routines.
+ (line 1111)
+* __satfractdqudq: Fixed-point fractional library routines.
+ (line 1106)
+* __satfractdquha: Fixed-point fractional library routines.
+ (line 1108)
+* __satfractdquhq: Fixed-point fractional library routines.
+ (line 1102)
+* __satfractdquqq: Fixed-point fractional library routines.
+ (line 1101)
+* __satfractdqusa: Fixed-point fractional library routines.
+ (line 1109)
+* __satfractdqusq: Fixed-point fractional library routines.
+ (line 1104)
+* __satfractdquta: Fixed-point fractional library routines.
+ (line 1113)
+* __satfracthada2: Fixed-point fractional library routines.
+ (line 1119)
+* __satfracthadq: Fixed-point fractional library routines.
+ (line 1117)
+* __satfracthahq: Fixed-point fractional library routines.
+ (line 1115)
+* __satfracthaqq: Fixed-point fractional library routines.
+ (line 1114)
+* __satfracthasa2: Fixed-point fractional library routines.
+ (line 1118)
+* __satfracthasq: Fixed-point fractional library routines.
+ (line 1116)
+* __satfracthata2: Fixed-point fractional library routines.
+ (line 1120)
+* __satfracthauda: Fixed-point fractional library routines.
+ (line 1132)
+* __satfracthaudq: Fixed-point fractional library routines.
+ (line 1127)
+* __satfracthauha: Fixed-point fractional library routines.
+ (line 1129)
+* __satfracthauhq: Fixed-point fractional library routines.
+ (line 1123)
+* __satfracthauqq: Fixed-point fractional library routines.
+ (line 1122)
+* __satfracthausa: Fixed-point fractional library routines.
+ (line 1130)
+* __satfracthausq: Fixed-point fractional library routines.
+ (line 1125)
+* __satfracthauta: Fixed-point fractional library routines.
+ (line 1134)
+* __satfracthida: Fixed-point fractional library routines.
+ (line 1424)
+* __satfracthidq: Fixed-point fractional library routines.
+ (line 1421)
+* __satfracthiha: Fixed-point fractional library routines.
+ (line 1422)
+* __satfracthihq: Fixed-point fractional library routines.
+ (line 1419)
+* __satfracthiqq: Fixed-point fractional library routines.
+ (line 1418)
+* __satfracthisa: Fixed-point fractional library routines.
+ (line 1423)
+* __satfracthisq: Fixed-point fractional library routines.
+ (line 1420)
+* __satfracthita: Fixed-point fractional library routines.
+ (line 1425)
+* __satfracthiuda: Fixed-point fractional library routines.
+ (line 1432)
+* __satfracthiudq: Fixed-point fractional library routines.
+ (line 1429)
+* __satfracthiuha: Fixed-point fractional library routines.
+ (line 1430)
+* __satfracthiuhq: Fixed-point fractional library routines.
+ (line 1427)
+* __satfracthiuqq: Fixed-point fractional library routines.
+ (line 1426)
+* __satfracthiusa: Fixed-point fractional library routines.
+ (line 1431)
+* __satfracthiusq: Fixed-point fractional library routines.
+ (line 1428)
+* __satfracthiuta: Fixed-point fractional library routines.
+ (line 1433)
+* __satfracthqda: Fixed-point fractional library routines.
+ (line 1064)
+* __satfracthqdq2: Fixed-point fractional library routines.
+ (line 1061)
+* __satfracthqha: Fixed-point fractional library routines.
+ (line 1062)
+* __satfracthqqq2: Fixed-point fractional library routines.
+ (line 1059)
+* __satfracthqsa: Fixed-point fractional library routines.
+ (line 1063)
+* __satfracthqsq2: Fixed-point fractional library routines.
+ (line 1060)
+* __satfracthqta: Fixed-point fractional library routines.
+ (line 1065)
+* __satfracthquda: Fixed-point fractional library routines.
+ (line 1072)
+* __satfracthqudq: Fixed-point fractional library routines.
+ (line 1069)
+* __satfracthquha: Fixed-point fractional library routines.
+ (line 1070)
+* __satfracthquhq: Fixed-point fractional library routines.
+ (line 1067)
+* __satfracthquqq: Fixed-point fractional library routines.
+ (line 1066)
+* __satfracthqusa: Fixed-point fractional library routines.
+ (line 1071)
+* __satfracthqusq: Fixed-point fractional library routines.
+ (line 1068)
+* __satfracthquta: Fixed-point fractional library routines.
+ (line 1073)
+* __satfractqida: Fixed-point fractional library routines.
+ (line 1402)
+* __satfractqidq: Fixed-point fractional library routines.
+ (line 1399)
+* __satfractqiha: Fixed-point fractional library routines.
+ (line 1400)
+* __satfractqihq: Fixed-point fractional library routines.
+ (line 1397)
+* __satfractqiqq: Fixed-point fractional library routines.
+ (line 1396)
+* __satfractqisa: Fixed-point fractional library routines.
+ (line 1401)
+* __satfractqisq: Fixed-point fractional library routines.
+ (line 1398)
+* __satfractqita: Fixed-point fractional library routines.
+ (line 1403)
+* __satfractqiuda: Fixed-point fractional library routines.
+ (line 1415)
+* __satfractqiudq: Fixed-point fractional library routines.
+ (line 1410)
+* __satfractqiuha: Fixed-point fractional library routines.
+ (line 1412)
+* __satfractqiuhq: Fixed-point fractional library routines.
+ (line 1406)
+* __satfractqiuqq: Fixed-point fractional library routines.
+ (line 1405)
+* __satfractqiusa: Fixed-point fractional library routines.
+ (line 1413)
+* __satfractqiusq: Fixed-point fractional library routines.
+ (line 1408)
+* __satfractqiuta: Fixed-point fractional library routines.
+ (line 1417)
+* __satfractqqda: Fixed-point fractional library routines.
+ (line 1043)
+* __satfractqqdq2: Fixed-point fractional library routines.
+ (line 1040)
+* __satfractqqha: Fixed-point fractional library routines.
+ (line 1041)
+* __satfractqqhq2: Fixed-point fractional library routines.
+ (line 1038)
+* __satfractqqsa: Fixed-point fractional library routines.
+ (line 1042)
+* __satfractqqsq2: Fixed-point fractional library routines.
+ (line 1039)
+* __satfractqqta: Fixed-point fractional library routines.
+ (line 1044)
+* __satfractqquda: Fixed-point fractional library routines.
+ (line 1056)
+* __satfractqqudq: Fixed-point fractional library routines.
+ (line 1051)
+* __satfractqquha: Fixed-point fractional library routines.
+ (line 1053)
+* __satfractqquhq: Fixed-point fractional library routines.
+ (line 1047)
+* __satfractqquqq: Fixed-point fractional library routines.
+ (line 1046)
+* __satfractqqusa: Fixed-point fractional library routines.
+ (line 1054)
+* __satfractqqusq: Fixed-point fractional library routines.
+ (line 1049)
+* __satfractqquta: Fixed-point fractional library routines.
+ (line 1058)
+* __satfractsada2: Fixed-point fractional library routines.
+ (line 1140)
+* __satfractsadq: Fixed-point fractional library routines.
+ (line 1138)
+* __satfractsaha2: Fixed-point fractional library routines.
+ (line 1139)
+* __satfractsahq: Fixed-point fractional library routines.
+ (line 1136)
+* __satfractsaqq: Fixed-point fractional library routines.
+ (line 1135)
+* __satfractsasq: Fixed-point fractional library routines.
+ (line 1137)
+* __satfractsata2: Fixed-point fractional library routines.
+ (line 1141)
+* __satfractsauda: Fixed-point fractional library routines.
+ (line 1148)
+* __satfractsaudq: Fixed-point fractional library routines.
+ (line 1145)
+* __satfractsauha: Fixed-point fractional library routines.
+ (line 1146)
+* __satfractsauhq: Fixed-point fractional library routines.
+ (line 1143)
+* __satfractsauqq: Fixed-point fractional library routines.
+ (line 1142)
+* __satfractsausa: Fixed-point fractional library routines.
+ (line 1147)
+* __satfractsausq: Fixed-point fractional library routines.
+ (line 1144)
+* __satfractsauta: Fixed-point fractional library routines.
+ (line 1149)
+* __satfractsfda: Fixed-point fractional library routines.
+ (line 1490)
+* __satfractsfdq: Fixed-point fractional library routines.
+ (line 1487)
+* __satfractsfha: Fixed-point fractional library routines.
+ (line 1488)
+* __satfractsfhq: Fixed-point fractional library routines.
+ (line 1485)
+* __satfractsfqq: Fixed-point fractional library routines.
+ (line 1484)
+* __satfractsfsa: Fixed-point fractional library routines.
+ (line 1489)
+* __satfractsfsq: Fixed-point fractional library routines.
+ (line 1486)
+* __satfractsfta: Fixed-point fractional library routines.
+ (line 1491)
+* __satfractsfuda: Fixed-point fractional library routines.
+ (line 1498)
+* __satfractsfudq: Fixed-point fractional library routines.
+ (line 1495)
+* __satfractsfuha: Fixed-point fractional library routines.
+ (line 1496)
+* __satfractsfuhq: Fixed-point fractional library routines.
+ (line 1493)
+* __satfractsfuqq: Fixed-point fractional library routines.
+ (line 1492)
+* __satfractsfusa: Fixed-point fractional library routines.
+ (line 1497)
+* __satfractsfusq: Fixed-point fractional library routines.
+ (line 1494)
+* __satfractsfuta: Fixed-point fractional library routines.
+ (line 1499)
+* __satfractsida: Fixed-point fractional library routines.
+ (line 1440)
+* __satfractsidq: Fixed-point fractional library routines.
+ (line 1437)
+* __satfractsiha: Fixed-point fractional library routines.
+ (line 1438)
+* __satfractsihq: Fixed-point fractional library routines.
+ (line 1435)
+* __satfractsiqq: Fixed-point fractional library routines.
+ (line 1434)
+* __satfractsisa: Fixed-point fractional library routines.
+ (line 1439)
+* __satfractsisq: Fixed-point fractional library routines.
+ (line 1436)
+* __satfractsita: Fixed-point fractional library routines.
+ (line 1441)
+* __satfractsiuda: Fixed-point fractional library routines.
+ (line 1448)
+* __satfractsiudq: Fixed-point fractional library routines.
+ (line 1445)
+* __satfractsiuha: Fixed-point fractional library routines.
+ (line 1446)
+* __satfractsiuhq: Fixed-point fractional library routines.
+ (line 1443)
+* __satfractsiuqq: Fixed-point fractional library routines.
+ (line 1442)
+* __satfractsiusa: Fixed-point fractional library routines.
+ (line 1447)
+* __satfractsiusq: Fixed-point fractional library routines.
+ (line 1444)
+* __satfractsiuta: Fixed-point fractional library routines.
+ (line 1449)
+* __satfractsqda: Fixed-point fractional library routines.
+ (line 1079)
+* __satfractsqdq2: Fixed-point fractional library routines.
+ (line 1076)
+* __satfractsqha: Fixed-point fractional library routines.
+ (line 1077)
+* __satfractsqhq2: Fixed-point fractional library routines.
+ (line 1075)
+* __satfractsqqq2: Fixed-point fractional library routines.
+ (line 1074)
+* __satfractsqsa: Fixed-point fractional library routines.
+ (line 1078)
+* __satfractsqta: Fixed-point fractional library routines.
+ (line 1080)
+* __satfractsquda: Fixed-point fractional library routines.
+ (line 1090)
+* __satfractsqudq: Fixed-point fractional library routines.
+ (line 1086)
+* __satfractsquha: Fixed-point fractional library routines.
+ (line 1088)
+* __satfractsquhq: Fixed-point fractional library routines.
+ (line 1083)
+* __satfractsquqq: Fixed-point fractional library routines.
+ (line 1082)
+* __satfractsqusa: Fixed-point fractional library routines.
+ (line 1089)
+* __satfractsqusq: Fixed-point fractional library routines.
+ (line 1084)
+* __satfractsquta: Fixed-point fractional library routines.
+ (line 1092)
+* __satfracttada2: Fixed-point fractional library routines.
+ (line 1175)
+* __satfracttadq: Fixed-point fractional library routines.
+ (line 1172)
+* __satfracttaha2: Fixed-point fractional library routines.
+ (line 1173)
+* __satfracttahq: Fixed-point fractional library routines.
+ (line 1170)
+* __satfracttaqq: Fixed-point fractional library routines.
+ (line 1169)
+* __satfracttasa2: Fixed-point fractional library routines.
+ (line 1174)
+* __satfracttasq: Fixed-point fractional library routines.
+ (line 1171)
+* __satfracttauda: Fixed-point fractional library routines.
+ (line 1187)
+* __satfracttaudq: Fixed-point fractional library routines.
+ (line 1182)
+* __satfracttauha: Fixed-point fractional library routines.
+ (line 1184)
+* __satfracttauhq: Fixed-point fractional library routines.
+ (line 1178)
+* __satfracttauqq: Fixed-point fractional library routines.
+ (line 1177)
+* __satfracttausa: Fixed-point fractional library routines.
+ (line 1185)
+* __satfracttausq: Fixed-point fractional library routines.
+ (line 1180)
+* __satfracttauta: Fixed-point fractional library routines.
+ (line 1189)
+* __satfracttida: Fixed-point fractional library routines.
+ (line 1472)
+* __satfracttidq: Fixed-point fractional library routines.
+ (line 1469)
+* __satfracttiha: Fixed-point fractional library routines.
+ (line 1470)
+* __satfracttihq: Fixed-point fractional library routines.
+ (line 1467)
+* __satfracttiqq: Fixed-point fractional library routines.
+ (line 1466)
+* __satfracttisa: Fixed-point fractional library routines.
+ (line 1471)
+* __satfracttisq: Fixed-point fractional library routines.
+ (line 1468)
+* __satfracttita: Fixed-point fractional library routines.
+ (line 1473)
+* __satfracttiuda: Fixed-point fractional library routines.
+ (line 1481)
+* __satfracttiudq: Fixed-point fractional library routines.
+ (line 1478)
+* __satfracttiuha: Fixed-point fractional library routines.
+ (line 1479)
+* __satfracttiuhq: Fixed-point fractional library routines.
+ (line 1475)
+* __satfracttiuqq: Fixed-point fractional library routines.
+ (line 1474)
+* __satfracttiusa: Fixed-point fractional library routines.
+ (line 1480)
+* __satfracttiusq: Fixed-point fractional library routines.
+ (line 1476)
+* __satfracttiuta: Fixed-point fractional library routines.
+ (line 1483)
+* __satfractudada: Fixed-point fractional library routines.
+ (line 1351)
+* __satfractudadq: Fixed-point fractional library routines.
+ (line 1347)
+* __satfractudaha: Fixed-point fractional library routines.
+ (line 1349)
+* __satfractudahq: Fixed-point fractional library routines.
+ (line 1344)
+* __satfractudaqq: Fixed-point fractional library routines.
+ (line 1343)
+* __satfractudasa: Fixed-point fractional library routines.
+ (line 1350)
+* __satfractudasq: Fixed-point fractional library routines.
+ (line 1345)
+* __satfractudata: Fixed-point fractional library routines.
+ (line 1353)
+* __satfractudaudq: Fixed-point fractional library routines.
+ (line 1361)
+* __satfractudauha2: Fixed-point fractional library routines.
+ (line 1363)
+* __satfractudauhq: Fixed-point fractional library routines.
+ (line 1357)
+* __satfractudauqq: Fixed-point fractional library routines.
+ (line 1355)
+* __satfractudausa2: Fixed-point fractional library routines.
+ (line 1365)
+* __satfractudausq: Fixed-point fractional library routines.
+ (line 1359)
+* __satfractudauta2: Fixed-point fractional library routines.
+ (line 1367)
+* __satfractudqda: Fixed-point fractional library routines.
+ (line 1276)
+* __satfractudqdq: Fixed-point fractional library routines.
+ (line 1271)
+* __satfractudqha: Fixed-point fractional library routines.
+ (line 1273)
+* __satfractudqhq: Fixed-point fractional library routines.
+ (line 1267)
+* __satfractudqqq: Fixed-point fractional library routines.
+ (line 1266)
+* __satfractudqsa: Fixed-point fractional library routines.
+ (line 1274)
+* __satfractudqsq: Fixed-point fractional library routines.
+ (line 1269)
+* __satfractudqta: Fixed-point fractional library routines.
+ (line 1278)
+* __satfractudquda: Fixed-point fractional library routines.
+ (line 1290)
+* __satfractudquha: Fixed-point fractional library routines.
+ (line 1286)
+* __satfractudquhq2: Fixed-point fractional library routines.
+ (line 1282)
+* __satfractudquqq2: Fixed-point fractional library routines.
+ (line 1280)
+* __satfractudqusa: Fixed-point fractional library routines.
+ (line 1288)
+* __satfractudqusq2: Fixed-point fractional library routines.
+ (line 1284)
+* __satfractudquta: Fixed-point fractional library routines.
+ (line 1292)
+* __satfractuhada: Fixed-point fractional library routines.
+ (line 1304)
+* __satfractuhadq: Fixed-point fractional library routines.
+ (line 1299)
+* __satfractuhaha: Fixed-point fractional library routines.
+ (line 1301)
+* __satfractuhahq: Fixed-point fractional library routines.
+ (line 1295)
+* __satfractuhaqq: Fixed-point fractional library routines.
+ (line 1294)
+* __satfractuhasa: Fixed-point fractional library routines.
+ (line 1302)
+* __satfractuhasq: Fixed-point fractional library routines.
+ (line 1297)
+* __satfractuhata: Fixed-point fractional library routines.
+ (line 1306)
+* __satfractuhauda2: Fixed-point fractional library routines.
+ (line 1318)
+* __satfractuhaudq: Fixed-point fractional library routines.
+ (line 1314)
+* __satfractuhauhq: Fixed-point fractional library routines.
+ (line 1310)
+* __satfractuhauqq: Fixed-point fractional library routines.
+ (line 1308)
+* __satfractuhausa2: Fixed-point fractional library routines.
+ (line 1316)
+* __satfractuhausq: Fixed-point fractional library routines.
+ (line 1312)
+* __satfractuhauta2: Fixed-point fractional library routines.
+ (line 1320)
+* __satfractuhqda: Fixed-point fractional library routines.
+ (line 1224)
+* __satfractuhqdq: Fixed-point fractional library routines.
+ (line 1221)
+* __satfractuhqha: Fixed-point fractional library routines.
+ (line 1222)
+* __satfractuhqhq: Fixed-point fractional library routines.
+ (line 1219)
+* __satfractuhqqq: Fixed-point fractional library routines.
+ (line 1218)
+* __satfractuhqsa: Fixed-point fractional library routines.
+ (line 1223)
+* __satfractuhqsq: Fixed-point fractional library routines.
+ (line 1220)
+* __satfractuhqta: Fixed-point fractional library routines.
+ (line 1225)
+* __satfractuhquda: Fixed-point fractional library routines.
+ (line 1236)
+* __satfractuhqudq2: Fixed-point fractional library routines.
+ (line 1231)
+* __satfractuhquha: Fixed-point fractional library routines.
+ (line 1233)
+* __satfractuhquqq2: Fixed-point fractional library routines.
+ (line 1227)
+* __satfractuhqusa: Fixed-point fractional library routines.
+ (line 1234)
+* __satfractuhqusq2: Fixed-point fractional library routines.
+ (line 1229)
+* __satfractuhquta: Fixed-point fractional library routines.
+ (line 1238)
+* __satfractunsdida: Fixed-point fractional library routines.
+ (line 1834)
+* __satfractunsdidq: Fixed-point fractional library routines.
+ (line 1831)
+* __satfractunsdiha: Fixed-point fractional library routines.
+ (line 1832)
+* __satfractunsdihq: Fixed-point fractional library routines.
+ (line 1828)
+* __satfractunsdiqq: Fixed-point fractional library routines.
+ (line 1827)
+* __satfractunsdisa: Fixed-point fractional library routines.
+ (line 1833)
+* __satfractunsdisq: Fixed-point fractional library routines.
+ (line 1829)
+* __satfractunsdita: Fixed-point fractional library routines.
+ (line 1836)
+* __satfractunsdiuda: Fixed-point fractional library routines.
+ (line 1850)
+* __satfractunsdiudq: Fixed-point fractional library routines.
+ (line 1844)
+* __satfractunsdiuha: Fixed-point fractional library routines.
+ (line 1846)
+* __satfractunsdiuhq: Fixed-point fractional library routines.
+ (line 1840)
+* __satfractunsdiuqq: Fixed-point fractional library routines.
+ (line 1838)
+* __satfractunsdiusa: Fixed-point fractional library routines.
+ (line 1848)
+* __satfractunsdiusq: Fixed-point fractional library routines.
+ (line 1842)
+* __satfractunsdiuta: Fixed-point fractional library routines.
+ (line 1852)
+* __satfractunshida: Fixed-point fractional library routines.
+ (line 1786)
+* __satfractunshidq: Fixed-point fractional library routines.
+ (line 1783)
+* __satfractunshiha: Fixed-point fractional library routines.
+ (line 1784)
+* __satfractunshihq: Fixed-point fractional library routines.
+ (line 1780)
+* __satfractunshiqq: Fixed-point fractional library routines.
+ (line 1779)
+* __satfractunshisa: Fixed-point fractional library routines.
+ (line 1785)
+* __satfractunshisq: Fixed-point fractional library routines.
+ (line 1781)
+* __satfractunshita: Fixed-point fractional library routines.
+ (line 1788)
+* __satfractunshiuda: Fixed-point fractional library routines.
+ (line 1802)
+* __satfractunshiudq: Fixed-point fractional library routines.
+ (line 1796)
+* __satfractunshiuha: Fixed-point fractional library routines.
+ (line 1798)
+* __satfractunshiuhq: Fixed-point fractional library routines.
+ (line 1792)
+* __satfractunshiuqq: Fixed-point fractional library routines.
+ (line 1790)
+* __satfractunshiusa: Fixed-point fractional library routines.
+ (line 1800)
+* __satfractunshiusq: Fixed-point fractional library routines.
+ (line 1794)
+* __satfractunshiuta: Fixed-point fractional library routines.
+ (line 1804)
+* __satfractunsqida: Fixed-point fractional library routines.
+ (line 1760)
+* __satfractunsqidq: Fixed-point fractional library routines.
+ (line 1757)
+* __satfractunsqiha: Fixed-point fractional library routines.
+ (line 1758)
+* __satfractunsqihq: Fixed-point fractional library routines.
+ (line 1754)
+* __satfractunsqiqq: Fixed-point fractional library routines.
+ (line 1753)
+* __satfractunsqisa: Fixed-point fractional library routines.
+ (line 1759)
+* __satfractunsqisq: Fixed-point fractional library routines.
+ (line 1755)
+* __satfractunsqita: Fixed-point fractional library routines.
+ (line 1762)
+* __satfractunsqiuda: Fixed-point fractional library routines.
+ (line 1776)
+* __satfractunsqiudq: Fixed-point fractional library routines.
+ (line 1770)
+* __satfractunsqiuha: Fixed-point fractional library routines.
+ (line 1772)
+* __satfractunsqiuhq: Fixed-point fractional library routines.
+ (line 1766)
+* __satfractunsqiuqq: Fixed-point fractional library routines.
+ (line 1764)
+* __satfractunsqiusa: Fixed-point fractional library routines.
+ (line 1774)
+* __satfractunsqiusq: Fixed-point fractional library routines.
+ (line 1768)
+* __satfractunsqiuta: Fixed-point fractional library routines.
+ (line 1778)
+* __satfractunssida: Fixed-point fractional library routines.
+ (line 1811)
+* __satfractunssidq: Fixed-point fractional library routines.
+ (line 1808)
+* __satfractunssiha: Fixed-point fractional library routines.
+ (line 1809)
+* __satfractunssihq: Fixed-point fractional library routines.
+ (line 1806)
+* __satfractunssiqq: Fixed-point fractional library routines.
+ (line 1805)
+* __satfractunssisa: Fixed-point fractional library routines.
+ (line 1810)
+* __satfractunssisq: Fixed-point fractional library routines.
+ (line 1807)
+* __satfractunssita: Fixed-point fractional library routines.
+ (line 1812)
+* __satfractunssiuda: Fixed-point fractional library routines.
+ (line 1824)
+* __satfractunssiudq: Fixed-point fractional library routines.
+ (line 1819)
+* __satfractunssiuha: Fixed-point fractional library routines.
+ (line 1821)
+* __satfractunssiuhq: Fixed-point fractional library routines.
+ (line 1815)
+* __satfractunssiuqq: Fixed-point fractional library routines.
+ (line 1814)
+* __satfractunssiusa: Fixed-point fractional library routines.
+ (line 1822)
+* __satfractunssiusq: Fixed-point fractional library routines.
+ (line 1817)
+* __satfractunssiuta: Fixed-point fractional library routines.
+ (line 1826)
+* __satfractunstida: Fixed-point fractional library routines.
+ (line 1864)
+* __satfractunstidq: Fixed-point fractional library routines.
+ (line 1859)
+* __satfractunstiha: Fixed-point fractional library routines.
+ (line 1861)
+* __satfractunstihq: Fixed-point fractional library routines.
+ (line 1855)
+* __satfractunstiqq: Fixed-point fractional library routines.
+ (line 1854)
+* __satfractunstisa: Fixed-point fractional library routines.
+ (line 1862)
+* __satfractunstisq: Fixed-point fractional library routines.
+ (line 1857)
+* __satfractunstita: Fixed-point fractional library routines.
+ (line 1866)
+* __satfractunstiuda: Fixed-point fractional library routines.
+ (line 1880)
+* __satfractunstiudq: Fixed-point fractional library routines.
+ (line 1874)
+* __satfractunstiuha: Fixed-point fractional library routines.
+ (line 1876)
+* __satfractunstiuhq: Fixed-point fractional library routines.
+ (line 1870)
+* __satfractunstiuqq: Fixed-point fractional library routines.
+ (line 1868)
+* __satfractunstiusa: Fixed-point fractional library routines.
+ (line 1878)
+* __satfractunstiusq: Fixed-point fractional library routines.
+ (line 1872)
+* __satfractunstiuta: Fixed-point fractional library routines.
+ (line 1882)
+* __satfractuqqda: Fixed-point fractional library routines.
+ (line 1201)
+* __satfractuqqdq: Fixed-point fractional library routines.
+ (line 1196)
+* __satfractuqqha: Fixed-point fractional library routines.
+ (line 1198)
+* __satfractuqqhq: Fixed-point fractional library routines.
+ (line 1192)
+* __satfractuqqqq: Fixed-point fractional library routines.
+ (line 1191)
+* __satfractuqqsa: Fixed-point fractional library routines.
+ (line 1199)
+* __satfractuqqsq: Fixed-point fractional library routines.
+ (line 1194)
+* __satfractuqqta: Fixed-point fractional library routines.
+ (line 1203)
+* __satfractuqquda: Fixed-point fractional library routines.
+ (line 1215)
+* __satfractuqqudq2: Fixed-point fractional library routines.
+ (line 1209)
+* __satfractuqquha: Fixed-point fractional library routines.
+ (line 1211)
+* __satfractuqquhq2: Fixed-point fractional library routines.
+ (line 1205)
+* __satfractuqqusa: Fixed-point fractional library routines.
+ (line 1213)
+* __satfractuqqusq2: Fixed-point fractional library routines.
+ (line 1207)
+* __satfractuqquta: Fixed-point fractional library routines.
+ (line 1217)
+* __satfractusada: Fixed-point fractional library routines.
+ (line 1327)
+* __satfractusadq: Fixed-point fractional library routines.
+ (line 1324)
+* __satfractusaha: Fixed-point fractional library routines.
+ (line 1325)
+* __satfractusahq: Fixed-point fractional library routines.
+ (line 1322)
+* __satfractusaqq: Fixed-point fractional library routines.
+ (line 1321)
+* __satfractusasa: Fixed-point fractional library routines.
+ (line 1326)
+* __satfractusasq: Fixed-point fractional library routines.
+ (line 1323)
+* __satfractusata: Fixed-point fractional library routines.
+ (line 1328)
+* __satfractusauda2: Fixed-point fractional library routines.
+ (line 1339)
+* __satfractusaudq: Fixed-point fractional library routines.
+ (line 1335)
+* __satfractusauha2: Fixed-point fractional library routines.
+ (line 1337)
+* __satfractusauhq: Fixed-point fractional library routines.
+ (line 1331)
+* __satfractusauqq: Fixed-point fractional library routines.
+ (line 1330)
+* __satfractusausq: Fixed-point fractional library routines.
+ (line 1333)
+* __satfractusauta2: Fixed-point fractional library routines.
+ (line 1341)
+* __satfractusqda: Fixed-point fractional library routines.
+ (line 1248)
+* __satfractusqdq: Fixed-point fractional library routines.
+ (line 1244)
+* __satfractusqha: Fixed-point fractional library routines.
+ (line 1246)
+* __satfractusqhq: Fixed-point fractional library routines.
+ (line 1241)
+* __satfractusqqq: Fixed-point fractional library routines.
+ (line 1240)
+* __satfractusqsa: Fixed-point fractional library routines.
+ (line 1247)
+* __satfractusqsq: Fixed-point fractional library routines.
+ (line 1242)
+* __satfractusqta: Fixed-point fractional library routines.
+ (line 1250)
+* __satfractusquda: Fixed-point fractional library routines.
+ (line 1262)
+* __satfractusqudq2: Fixed-point fractional library routines.
+ (line 1256)
+* __satfractusquha: Fixed-point fractional library routines.
+ (line 1258)
+* __satfractusquhq2: Fixed-point fractional library routines.
+ (line 1254)
+* __satfractusquqq2: Fixed-point fractional library routines.
+ (line 1252)
+* __satfractusqusa: Fixed-point fractional library routines.
+ (line 1260)
+* __satfractusquta: Fixed-point fractional library routines.
+ (line 1264)
+* __satfractutada: Fixed-point fractional library routines.
+ (line 1379)
+* __satfractutadq: Fixed-point fractional library routines.
+ (line 1374)
+* __satfractutaha: Fixed-point fractional library routines.
+ (line 1376)
+* __satfractutahq: Fixed-point fractional library routines.
+ (line 1370)
+* __satfractutaqq: Fixed-point fractional library routines.
+ (line 1369)
+* __satfractutasa: Fixed-point fractional library routines.
+ (line 1377)
+* __satfractutasq: Fixed-point fractional library routines.
+ (line 1372)
+* __satfractutata: Fixed-point fractional library routines.
+ (line 1381)
+* __satfractutauda2: Fixed-point fractional library routines.
+ (line 1395)
+* __satfractutaudq: Fixed-point fractional library routines.
+ (line 1389)
+* __satfractutauha2: Fixed-point fractional library routines.
+ (line 1391)
+* __satfractutauhq: Fixed-point fractional library routines.
+ (line 1385)
+* __satfractutauqq: Fixed-point fractional library routines.
+ (line 1383)
+* __satfractutausa2: Fixed-point fractional library routines.
+ (line 1393)
+* __satfractutausq: Fixed-point fractional library routines.
+ (line 1387)
+* __ssaddda3: Fixed-point fractional library routines.
+ (line 67)
+* __ssadddq3: Fixed-point fractional library routines.
+ (line 63)
+* __ssaddha3: Fixed-point fractional library routines.
+ (line 65)
+* __ssaddhq3: Fixed-point fractional library routines.
+ (line 60)
+* __ssaddqq3: Fixed-point fractional library routines.
+ (line 59)
+* __ssaddsa3: Fixed-point fractional library routines.
+ (line 66)
+* __ssaddsq3: Fixed-point fractional library routines.
+ (line 61)
+* __ssaddta3: Fixed-point fractional library routines.
+ (line 69)
+* __ssashlda3: Fixed-point fractional library routines.
+ (line 402)
+* __ssashldq3: Fixed-point fractional library routines.
+ (line 399)
+* __ssashlha3: Fixed-point fractional library routines.
+ (line 400)
+* __ssashlhq3: Fixed-point fractional library routines.
+ (line 396)
+* __ssashlsa3: Fixed-point fractional library routines.
+ (line 401)
+* __ssashlsq3: Fixed-point fractional library routines.
+ (line 397)
+* __ssashlta3: Fixed-point fractional library routines.
+ (line 404)
+* __ssdivda3: Fixed-point fractional library routines.
+ (line 261)
+* __ssdivdq3: Fixed-point fractional library routines.
+ (line 257)
+* __ssdivha3: Fixed-point fractional library routines.
+ (line 259)
+* __ssdivhq3: Fixed-point fractional library routines.
+ (line 254)
+* __ssdivqq3: Fixed-point fractional library routines.
+ (line 253)
+* __ssdivsa3: Fixed-point fractional library routines.
+ (line 260)
+* __ssdivsq3: Fixed-point fractional library routines.
+ (line 255)
+* __ssdivta3: Fixed-point fractional library routines.
+ (line 263)
+* __ssmulda3: Fixed-point fractional library routines.
+ (line 193)
+* __ssmuldq3: Fixed-point fractional library routines.
+ (line 189)
+* __ssmulha3: Fixed-point fractional library routines.
+ (line 191)
+* __ssmulhq3: Fixed-point fractional library routines.
+ (line 186)
+* __ssmulqq3: Fixed-point fractional library routines.
+ (line 185)
+* __ssmulsa3: Fixed-point fractional library routines.
+ (line 192)
+* __ssmulsq3: Fixed-point fractional library routines.
+ (line 187)
+* __ssmulta3: Fixed-point fractional library routines.
+ (line 195)
+* __ssnegda2: Fixed-point fractional library routines.
+ (line 316)
+* __ssnegdq2: Fixed-point fractional library routines.
+ (line 313)
+* __ssnegha2: Fixed-point fractional library routines.
+ (line 314)
+* __ssneghq2: Fixed-point fractional library routines.
+ (line 311)
+* __ssnegqq2: Fixed-point fractional library routines.
+ (line 310)
+* __ssnegsa2: Fixed-point fractional library routines.
+ (line 315)
+* __ssnegsq2: Fixed-point fractional library routines.
+ (line 312)
+* __ssnegta2: Fixed-point fractional library routines.
+ (line 317)
+* __sssubda3: Fixed-point fractional library routines.
+ (line 129)
+* __sssubdq3: Fixed-point fractional library routines.
+ (line 125)
+* __sssubha3: Fixed-point fractional library routines.
+ (line 127)
+* __sssubhq3: Fixed-point fractional library routines.
+ (line 122)
+* __sssubqq3: Fixed-point fractional library routines.
+ (line 121)
+* __sssubsa3: Fixed-point fractional library routines.
+ (line 128)
+* __sssubsq3: Fixed-point fractional library routines.
+ (line 123)
+* __sssubta3: Fixed-point fractional library routines.
+ (line 131)
+* __subda3: Fixed-point fractional library routines.
+ (line 107)
+* __subdf3: Soft float library routines.
+ (line 31)
+* __subdq3: Fixed-point fractional library routines.
+ (line 95)
+* __subha3: Fixed-point fractional library routines.
+ (line 105)
+* __subhq3: Fixed-point fractional library routines.
+ (line 92)
+* __subqq3: Fixed-point fractional library routines.
+ (line 91)
+* __subsa3: Fixed-point fractional library routines.
+ (line 106)
+* __subsf3: Soft float library routines.
+ (line 30)
+* __subsq3: Fixed-point fractional library routines.
+ (line 93)
+* __subta3: Fixed-point fractional library routines.
+ (line 109)
+* __subtf3: Soft float library routines.
+ (line 33)
+* __subuda3: Fixed-point fractional library routines.
+ (line 115)
+* __subudq3: Fixed-point fractional library routines.
+ (line 103)
+* __subuha3: Fixed-point fractional library routines.
+ (line 111)
+* __subuhq3: Fixed-point fractional library routines.
+ (line 99)
+* __subuqq3: Fixed-point fractional library routines.
+ (line 97)
+* __subusa3: Fixed-point fractional library routines.
+ (line 113)
+* __subusq3: Fixed-point fractional library routines.
+ (line 101)
+* __subuta3: Fixed-point fractional library routines.
+ (line 117)
+* __subvdi3: Integer library routines.
+ (line 123)
+* __subvsi3: Integer library routines.
+ (line 122)
+* __subxf3: Soft float library routines.
+ (line 35)
+* __truncdfsf2: Soft float library routines.
+ (line 76)
+* __trunctfdf2: Soft float library routines.
+ (line 73)
+* __trunctfsf2: Soft float library routines.
+ (line 75)
+* __truncxfdf2: Soft float library routines.
+ (line 72)
+* __truncxfsf2: Soft float library routines.
+ (line 74)
+* __ucmpdi2: Integer library routines.
+ (line 93)
+* __ucmpti2: Integer library routines.
+ (line 95)
+* __udivdi3: Integer library routines.
+ (line 54)
+* __udivmoddi3: Integer library routines.
+ (line 61)
+* __udivsi3: Integer library routines.
+ (line 52)
+* __udivti3: Integer library routines.
+ (line 56)
+* __udivuda3: Fixed-point fractional library routines.
+ (line 246)
+* __udivudq3: Fixed-point fractional library routines.
+ (line 240)
+* __udivuha3: Fixed-point fractional library routines.
+ (line 242)
+* __udivuhq3: Fixed-point fractional library routines.
+ (line 236)
+* __udivuqq3: Fixed-point fractional library routines.
+ (line 234)
+* __udivusa3: Fixed-point fractional library routines.
+ (line 244)
+* __udivusq3: Fixed-point fractional library routines.
+ (line 238)
+* __udivuta3: Fixed-point fractional library routines.
+ (line 248)
+* __umoddi3: Integer library routines.
+ (line 71)
+* __umodsi3: Integer library routines.
+ (line 69)
+* __umodti3: Integer library routines.
+ (line 73)
+* __unorddf2: Soft float library routines.
+ (line 173)
+* __unordsf2: Soft float library routines.
+ (line 172)
+* __unordtf2: Soft float library routines.
+ (line 174)
+* __usadduda3: Fixed-point fractional library routines.
+ (line 85)
+* __usaddudq3: Fixed-point fractional library routines.
+ (line 79)
+* __usadduha3: Fixed-point fractional library routines.
+ (line 81)
+* __usadduhq3: Fixed-point fractional library routines.
+ (line 75)
+* __usadduqq3: Fixed-point fractional library routines.
+ (line 73)
+* __usaddusa3: Fixed-point fractional library routines.
+ (line 83)
+* __usaddusq3: Fixed-point fractional library routines.
+ (line 77)
+* __usadduta3: Fixed-point fractional library routines.
+ (line 87)
+* __usashluda3: Fixed-point fractional library routines.
+ (line 421)
+* __usashludq3: Fixed-point fractional library routines.
+ (line 415)
+* __usashluha3: Fixed-point fractional library routines.
+ (line 417)
+* __usashluhq3: Fixed-point fractional library routines.
+ (line 411)
+* __usashluqq3: Fixed-point fractional library routines.
+ (line 409)
+* __usashlusa3: Fixed-point fractional library routines.
+ (line 419)
+* __usashlusq3: Fixed-point fractional library routines.
+ (line 413)
+* __usashluta3: Fixed-point fractional library routines.
+ (line 423)
+* __usdivuda3: Fixed-point fractional library routines.
+ (line 280)
+* __usdivudq3: Fixed-point fractional library routines.
+ (line 274)
+* __usdivuha3: Fixed-point fractional library routines.
+ (line 276)
+* __usdivuhq3: Fixed-point fractional library routines.
+ (line 270)
+* __usdivuqq3: Fixed-point fractional library routines.
+ (line 268)
+* __usdivusa3: Fixed-point fractional library routines.
+ (line 278)
+* __usdivusq3: Fixed-point fractional library routines.
+ (line 272)
+* __usdivuta3: Fixed-point fractional library routines.
+ (line 282)
+* __usmuluda3: Fixed-point fractional library routines.
+ (line 212)
+* __usmuludq3: Fixed-point fractional library routines.
+ (line 206)
+* __usmuluha3: Fixed-point fractional library routines.
+ (line 208)
+* __usmuluhq3: Fixed-point fractional library routines.
+ (line 202)
+* __usmuluqq3: Fixed-point fractional library routines.
+ (line 200)
+* __usmulusa3: Fixed-point fractional library routines.
+ (line 210)
+* __usmulusq3: Fixed-point fractional library routines.
+ (line 204)
+* __usmuluta3: Fixed-point fractional library routines.
+ (line 214)
+* __usneguda2: Fixed-point fractional library routines.
+ (line 331)
+* __usnegudq2: Fixed-point fractional library routines.
+ (line 326)
+* __usneguha2: Fixed-point fractional library routines.
+ (line 328)
+* __usneguhq2: Fixed-point fractional library routines.
+ (line 322)
+* __usneguqq2: Fixed-point fractional library routines.
+ (line 321)
+* __usnegusa2: Fixed-point fractional library routines.
+ (line 329)
+* __usnegusq2: Fixed-point fractional library routines.
+ (line 324)
+* __usneguta2: Fixed-point fractional library routines.
+ (line 333)
+* __ussubuda3: Fixed-point fractional library routines.
+ (line 148)
+* __ussubudq3: Fixed-point fractional library routines.
+ (line 142)
+* __ussubuha3: Fixed-point fractional library routines.
+ (line 144)
+* __ussubuhq3: Fixed-point fractional library routines.
+ (line 138)
+* __ussubuqq3: Fixed-point fractional library routines.
+ (line 136)
+* __ussubusa3: Fixed-point fractional library routines.
+ (line 146)
+* __ussubusq3: Fixed-point fractional library routines.
+ (line 140)
+* __ussubuta3: Fixed-point fractional library routines.
+ (line 150)
+* abort: Portability. (line 21)
+* abs: Arithmetic. (line 195)
+* abs and attributes: Expressions. (line 64)
+* ABS_EXPR: Expression trees. (line 6)
+* absence_set: Processor pipeline description.
+ (line 215)
+* absM2 instruction pattern: Standard Names. (line 452)
+* absolute value: Arithmetic. (line 195)
+* access to operands: Accessors. (line 6)
+* access to special operands: Special Accessors. (line 6)
+* accessors: Accessors. (line 6)
+* ACCUM_TYPE_SIZE: Type Layout. (line 88)
+* ACCUMULATE_OUTGOING_ARGS: Stack Arguments. (line 46)
+* ACCUMULATE_OUTGOING_ARGS and stack frames: Function Entry. (line 135)
+* ADA_LONG_TYPE_SIZE: Type Layout. (line 26)
+* Adding a new GIMPLE statement code: Adding a new GIMPLE statement code.
+ (line 6)
+* ADDITIONAL_REGISTER_NAMES: Instruction Output. (line 15)
+* addM3 instruction pattern: Standard Names. (line 216)
+* addMODEcc instruction pattern: Standard Names. (line 904)
+* addr_diff_vec: Side Effects. (line 302)
+* addr_diff_vec, length of: Insn Lengths. (line 26)
+* ADDR_EXPR: Expression trees. (line 6)
+* addr_vec: Side Effects. (line 297)
+* addr_vec, length of: Insn Lengths. (line 26)
+* address constraints: Simple Constraints. (line 154)
+* address_operand <1>: Simple Constraints. (line 158)
+* address_operand: Machine-Independent Predicates.
+ (line 63)
+* addressing modes: Addressing Modes. (line 6)
+* ADJUST_FIELD_ALIGN: Storage Layout. (line 201)
+* ADJUST_INSN_LENGTH: Insn Lengths. (line 35)
+* AGGR_INIT_EXPR: Expression trees. (line 6)
+* aggregates as return values: Aggregate Return. (line 6)
+* alias: Alias analysis. (line 6)
+* ALL_COP_ADDITIONAL_REGISTER_NAMES: MIPS Coprocessors. (line 32)
+* ALL_REGS: Register Classes. (line 17)
+* allocate_stack instruction pattern: Standard Names. (line 1227)
+* alternate entry points: Insns. (line 140)
+* anchored addresses: Anchored Addresses. (line 6)
+* and: Arithmetic. (line 153)
+* and and attributes: Expressions. (line 50)
+* and, canonicalization of: Insn Canonicalizations.
+ (line 57)
+* andM3 instruction pattern: Standard Names. (line 222)
+* annotations: Annotations. (line 6)
+* APPLY_RESULT_SIZE: Scalar Return. (line 95)
+* ARG_POINTER_CFA_OFFSET: Frame Layout. (line 194)
+* ARG_POINTER_REGNUM: Frame Registers. (line 41)
+* ARG_POINTER_REGNUM and virtual registers: Regs and Memory. (line 65)
+* arg_pointer_rtx: Frame Registers. (line 85)
+* ARGS_GROW_DOWNWARD: Frame Layout. (line 35)
+* argument passing: Interface. (line 36)
+* arguments in registers: Register Arguments. (line 6)
+* arguments on stack: Stack Arguments. (line 6)
+* arithmetic library: Soft float library routines.
+ (line 6)
+* arithmetic shift: Arithmetic. (line 168)
+* arithmetic shift with signed saturation: Arithmetic. (line 168)
+* arithmetic shift with unsigned saturation: Arithmetic. (line 168)
+* arithmetic, in RTL: Arithmetic. (line 6)
+* ARITHMETIC_TYPE_P: Types. (line 76)
+* array: Types. (line 6)
+* ARRAY_RANGE_REF: Expression trees. (line 6)
+* ARRAY_REF: Expression trees. (line 6)
+* ARRAY_TYPE: Types. (line 6)
+* AS_NEEDS_DASH_FOR_PIPED_INPUT: Driver. (line 151)
+* ashift: Arithmetic. (line 168)
+* ashift and attributes: Expressions. (line 64)
+* ashiftrt: Arithmetic. (line 185)
+* ashiftrt and attributes: Expressions. (line 64)
+* ashlM3 instruction pattern: Standard Names. (line 431)
+* ashrM3 instruction pattern: Standard Names. (line 441)
+* ASM_APP_OFF: File Framework. (line 61)
+* ASM_APP_ON: File Framework. (line 54)
+* ASM_COMMENT_START: File Framework. (line 49)
+* ASM_DECLARE_CLASS_REFERENCE: Label Output. (line 436)
+* ASM_DECLARE_CONSTANT_NAME: Label Output. (line 128)
+* ASM_DECLARE_FUNCTION_NAME: Label Output. (line 87)
+* ASM_DECLARE_FUNCTION_SIZE: Label Output. (line 101)
+* ASM_DECLARE_OBJECT_NAME: Label Output. (line 114)
+* ASM_DECLARE_REGISTER_GLOBAL: Label Output. (line 143)
+* ASM_DECLARE_UNRESOLVED_REFERENCE: Label Output. (line 442)
+* ASM_FINAL_SPEC: Driver. (line 144)
+* ASM_FINISH_DECLARE_OBJECT: Label Output. (line 151)
+* ASM_FORMAT_PRIVATE_NAME: Label Output. (line 354)
+* asm_fprintf: Instruction Output. (line 123)
+* ASM_FPRINTF_EXTENSIONS: Instruction Output. (line 134)
+* ASM_GENERATE_INTERNAL_LABEL: Label Output. (line 338)
+* asm_input: Side Effects. (line 284)
+* asm_input and /v: Flags. (line 94)
+* ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX: Exception Handling. (line 82)
+* ASM_NO_SKIP_IN_TEXT: Alignment Output. (line 72)
+* asm_noperands: Insns. (line 266)
+* asm_operands and /v: Flags. (line 94)
+* asm_operands, RTL sharing: Sharing. (line 45)
+* asm_operands, usage: Assembler. (line 6)
+* ASM_OUTPUT_ADDR_DIFF_ELT: Dispatch Tables. (line 9)
+* ASM_OUTPUT_ADDR_VEC_ELT: Dispatch Tables. (line 26)
+* ASM_OUTPUT_ALIGN: Alignment Output. (line 79)
+* ASM_OUTPUT_ALIGN_WITH_NOP: Alignment Output. (line 84)
+* ASM_OUTPUT_ALIGNED_BSS: Uninitialized Data. (line 64)
+* ASM_OUTPUT_ALIGNED_COMMON: Uninitialized Data. (line 23)
+* ASM_OUTPUT_ALIGNED_DECL_COMMON: Uninitialized Data. (line 31)
+* ASM_OUTPUT_ALIGNED_DECL_LOCAL: Uninitialized Data. (line 95)
+* ASM_OUTPUT_ALIGNED_LOCAL: Uninitialized Data. (line 87)
+* ASM_OUTPUT_ASCII: Data Output. (line 50)
+* ASM_OUTPUT_BSS: Uninitialized Data. (line 39)
+* ASM_OUTPUT_CASE_END: Dispatch Tables. (line 51)
+* ASM_OUTPUT_CASE_LABEL: Dispatch Tables. (line 38)
+* ASM_OUTPUT_COMMON: Uninitialized Data. (line 10)
+* ASM_OUTPUT_DEBUG_LABEL: Label Output. (line 326)
+* ASM_OUTPUT_DEF: Label Output. (line 375)
+* ASM_OUTPUT_DEF_FROM_DECLS: Label Output. (line 383)
+* ASM_OUTPUT_DWARF_DELTA: SDB and DWARF. (line 42)
+* ASM_OUTPUT_DWARF_OFFSET: SDB and DWARF. (line 46)
+* ASM_OUTPUT_DWARF_PCREL: SDB and DWARF. (line 52)
+* ASM_OUTPUT_EXTERNAL: Label Output. (line 264)
+* ASM_OUTPUT_FDESC: Data Output. (line 59)
+* ASM_OUTPUT_IDENT: File Framework. (line 83)
+* ASM_OUTPUT_INTERNAL_LABEL: Label Output. (line 17)
+* ASM_OUTPUT_LABEL: Label Output. (line 9)
+* ASM_OUTPUT_LABEL_REF: Label Output. (line 299)
+* ASM_OUTPUT_LABELREF: Label Output. (line 285)
+* ASM_OUTPUT_LOCAL: Uninitialized Data. (line 74)
+* ASM_OUTPUT_MAX_SKIP_ALIGN: Alignment Output. (line 88)
+* ASM_OUTPUT_MEASURED_SIZE: Label Output. (line 41)
+* ASM_OUTPUT_OPCODE: Instruction Output. (line 21)
+* ASM_OUTPUT_POOL_EPILOGUE: Data Output. (line 109)
+* ASM_OUTPUT_POOL_PROLOGUE: Data Output. (line 72)
+* ASM_OUTPUT_REG_POP: Instruction Output. (line 178)
+* ASM_OUTPUT_REG_PUSH: Instruction Output. (line 173)
+* ASM_OUTPUT_SIZE_DIRECTIVE: Label Output. (line 35)
+* ASM_OUTPUT_SKIP: Alignment Output. (line 66)
+* ASM_OUTPUT_SOURCE_FILENAME: File Framework. (line 68)
+* ASM_OUTPUT_SPECIAL_POOL_ENTRY: Data Output. (line 84)
+* ASM_OUTPUT_SYMBOL_REF: Label Output. (line 292)
+* ASM_OUTPUT_TYPE_DIRECTIVE: Label Output. (line 77)
+* ASM_OUTPUT_WEAK_ALIAS: Label Output. (line 401)
+* ASM_OUTPUT_WEAKREF: Label Output. (line 203)
+* ASM_PREFERRED_EH_DATA_FORMAT: Exception Handling. (line 67)
+* ASM_SPEC: Driver. (line 136)
+* ASM_STABD_OP: DBX Options. (line 36)
+* ASM_STABN_OP: DBX Options. (line 43)
+* ASM_STABS_OP: DBX Options. (line 29)
+* ASM_WEAKEN_DECL: Label Output. (line 195)
+* ASM_WEAKEN_LABEL: Label Output. (line 182)
+* assemble_name: Label Output. (line 8)
+* assemble_name_raw: Label Output. (line 16)
+* assembler format: File Framework. (line 6)
+* assembler instructions in RTL: Assembler. (line 6)
+* ASSEMBLER_DIALECT: Instruction Output. (line 146)
+* assigning attribute values to insns: Tagging Insns. (line 6)
+* assignment operator: Function Basics. (line 6)
+* asterisk in template: Output Statement. (line 29)
+* atan2M3 instruction pattern: Standard Names. (line 522)
+* attr <1>: Tagging Insns. (line 54)
+* attr: Expressions. (line 154)
+* attr_flag: Expressions. (line 119)
+* attribute expressions: Expressions. (line 6)
+* attribute specifications: Attr Example. (line 6)
+* attribute specifications example: Attr Example. (line 6)
+* ATTRIBUTE_ALIGNED_VALUE: Storage Layout. (line 183)
+* attributes: Attributes. (line 6)
+* attributes, defining: Defining Attributes.
+ (line 6)
+* attributes, target-specific: Target Attributes. (line 6)
+* autoincrement addressing, availability: Portability. (line 21)
+* autoincrement/decrement addressing: Simple Constraints. (line 30)
+* automata_option: Processor pipeline description.
+ (line 296)
+* automaton based pipeline description: Processor pipeline description.
+ (line 6)
+* automaton based scheduler: Processor pipeline description.
+ (line 6)
+* AVOID_CCMODE_COPIES: Values in Registers.
+ (line 153)
+* backslash: Output Template. (line 46)
+* barrier: Insns. (line 160)
+* barrier and /f: Flags. (line 125)
+* barrier and /v: Flags. (line 44)
+* BASE_REG_CLASS: Register Classes. (line 107)
+* basic block: Basic Blocks. (line 6)
+* basic-block.h: Control Flow. (line 6)
+* BASIC_BLOCK: Basic Blocks. (line 19)
+* basic_block: Basic Blocks. (line 6)
+* BB_HEAD, BB_END: Maintaining the CFG.
+ (line 88)
+* bb_seq: GIMPLE sequences. (line 73)
+* bCOND instruction pattern: Standard Names. (line 941)
+* BIGGEST_ALIGNMENT: Storage Layout. (line 173)
+* BIGGEST_FIELD_ALIGNMENT: Storage Layout. (line 194)
+* BImode: Machine Modes. (line 22)
+* BIND_EXPR: Expression trees. (line 6)
+* BINFO_TYPE: Classes. (line 6)
+* bit-fields: Bit-Fields. (line 6)
+* BIT_AND_EXPR: Expression trees. (line 6)
+* BIT_IOR_EXPR: Expression trees. (line 6)
+* BIT_NOT_EXPR: Expression trees. (line 6)
+* BIT_XOR_EXPR: Expression trees. (line 6)
+* BITFIELD_NBYTES_LIMITED: Storage Layout. (line 382)
+* BITS_BIG_ENDIAN: Storage Layout. (line 12)
+* BITS_BIG_ENDIAN, effect on sign_extract: Bit-Fields. (line 8)
+* BITS_PER_UNIT: Storage Layout. (line 52)
+* BITS_PER_WORD: Storage Layout. (line 57)
+* bitwise complement: Arithmetic. (line 149)
+* bitwise exclusive-or: Arithmetic. (line 163)
+* bitwise inclusive-or: Arithmetic. (line 158)
+* bitwise logical-and: Arithmetic. (line 153)
+* BLKmode: Machine Modes. (line 183)
+* BLKmode, and function return values: Calls. (line 23)
+* block statement iterators <1>: Maintaining the CFG.
+ (line 45)
+* block statement iterators: Basic Blocks. (line 68)
+* BLOCK_FOR_INSN, bb_for_stmt: Maintaining the CFG.
+ (line 40)
+* BLOCK_REG_PADDING: Register Arguments. (line 229)
+* blockage instruction pattern: Standard Names. (line 1408)
+* Blocks: Blocks. (line 6)
+* bool <1>: Exception Region Output.
+ (line 60)
+* bool: Sections. (line 280)
+* BOOL_TYPE_SIZE: Type Layout. (line 44)
+* BOOLEAN_TYPE: Types. (line 6)
+* branch prediction: Profile information.
+ (line 24)
+* BRANCH_COST: Costs. (line 52)
+* break_out_memory_refs: Addressing Modes. (line 130)
+* BREAK_STMT: Function Bodies. (line 6)
+* bsi_commit_edge_inserts: Maintaining the CFG.
+ (line 118)
+* bsi_end_p: Maintaining the CFG.
+ (line 60)
+* bsi_insert_after: Maintaining the CFG.
+ (line 72)
+* bsi_insert_before: Maintaining the CFG.
+ (line 78)
+* bsi_insert_on_edge: Maintaining the CFG.
+ (line 118)
+* bsi_last: Maintaining the CFG.
+ (line 56)
+* bsi_next: Maintaining the CFG.
+ (line 64)
+* bsi_prev: Maintaining the CFG.
+ (line 68)
+* bsi_remove: Maintaining the CFG.
+ (line 84)
+* bsi_start: Maintaining the CFG.
+ (line 52)
+* BSS_SECTION_ASM_OP: Sections. (line 68)
+* bswap: Arithmetic. (line 232)
+* btruncM2 instruction pattern: Standard Names. (line 540)
+* builtin_longjmp instruction pattern: Standard Names. (line 1313)
+* builtin_setjmp_receiver instruction pattern: Standard Names.
+ (line 1303)
+* builtin_setjmp_setup instruction pattern: Standard Names. (line 1292)
+* byte_mode: Machine Modes. (line 336)
+* BYTES_BIG_ENDIAN: Storage Layout. (line 24)
+* BYTES_BIG_ENDIAN, effect on subreg: Regs and Memory. (line 221)
+* C statements for assembler output: Output Statement. (line 6)
+* C/C++ Internal Representation: Trees. (line 6)
+* C99 math functions, implicit usage: Library Calls. (line 76)
+* C_COMMON_OVERRIDE_OPTIONS: Run-time Target. (line 114)
+* c_register_pragma: Misc. (line 404)
+* c_register_pragma_with_expansion: Misc. (line 406)
+* call <1>: Side Effects. (line 86)
+* call: Flags. (line 234)
+* call instruction pattern: Standard Names. (line 974)
+* call usage: Calls. (line 10)
+* call, in call_insn: Flags. (line 33)
+* call, in mem: Flags. (line 99)
+* call-clobbered register: Register Basics. (line 35)
+* call-saved register: Register Basics. (line 35)
+* call-used register: Register Basics. (line 35)
+* CALL_EXPR: Expression trees. (line 6)
+* call_insn: Insns. (line 95)
+* call_insn and /c: Flags. (line 33)
+* call_insn and /f: Flags. (line 125)
+* call_insn and /i: Flags. (line 24)
+* call_insn and /j: Flags. (line 179)
+* call_insn and /s: Flags. (line 49)
+* call_insn and /u: Flags. (line 19)
+* call_insn and /u or /i: Flags. (line 29)
+* call_insn and /v: Flags. (line 44)
+* CALL_INSN_FUNCTION_USAGE: Insns. (line 101)
+* call_pop instruction pattern: Standard Names. (line 1002)
+* CALL_POPS_ARGS: Stack Arguments. (line 130)
+* CALL_REALLY_USED_REGISTERS: Register Basics. (line 46)
+* CALL_USED_REGISTERS: Register Basics. (line 35)
+* call_used_regs: Register Basics. (line 59)
+* call_value instruction pattern: Standard Names. (line 994)
+* call_value_pop instruction pattern: Standard Names. (line 1002)
+* CALLER_SAVE_PROFITABLE: Caller Saves. (line 11)
+* calling conventions: Stack and Calling. (line 6)
+* calling functions in RTL: Calls. (line 6)
+* can_create_pseudo_p: Standard Names. (line 75)
+* CAN_DEBUG_WITHOUT_FP: Run-time Target. (line 146)
+* CAN_ELIMINATE: Elimination. (line 71)
+* can_fallthru: Basic Blocks. (line 57)
+* canadian: Configure Terms. (line 6)
+* CANNOT_CHANGE_MODE_CLASS: Register Classes. (line 481)
+* CANNOT_CHANGE_MODE_CLASS and subreg semantics: Regs and Memory.
+ (line 280)
+* canonicalization of instructions: Insn Canonicalizations.
+ (line 6)
+* CANONICALIZE_COMPARISON: Condition Code. (line 84)
+* canonicalize_funcptr_for_compare instruction pattern: Standard Names.
+ (line 1158)
+* CASE_USE_BIT_TESTS: Misc. (line 54)
+* CASE_VALUES_THRESHOLD: Misc. (line 47)
+* CASE_VECTOR_MODE: Misc. (line 27)
+* CASE_VECTOR_PC_RELATIVE: Misc. (line 40)
+* CASE_VECTOR_SHORTEN_MODE: Misc. (line 31)
+* casesi instruction pattern: Standard Names. (line 1082)
+* cbranchMODE4 instruction pattern: Standard Names. (line 963)
+* cc0: Regs and Memory. (line 307)
+* cc0, RTL sharing: Sharing. (line 27)
+* cc0_rtx: Regs and Memory. (line 333)
+* CC1_SPEC: Driver. (line 118)
+* CC1PLUS_SPEC: Driver. (line 126)
+* cc_status: Condition Code. (line 8)
+* CC_STATUS_MDEP: Condition Code. (line 19)
+* CC_STATUS_MDEP_INIT: Condition Code. (line 25)
+* CCmode: Machine Modes. (line 176)
+* CDImode: Machine Modes. (line 202)
+* CEIL_DIV_EXPR: Expression trees. (line 6)
+* CEIL_MOD_EXPR: Expression trees. (line 6)
+* ceilM2 instruction pattern: Standard Names. (line 556)
+* CFA_FRAME_BASE_OFFSET: Frame Layout. (line 226)
+* CFG, Control Flow Graph: Control Flow. (line 6)
+* cfghooks.h: Maintaining the CFG.
+ (line 6)
+* cgraph_finalize_function: Parsing pass. (line 52)
+* chain_circular: GTY Options. (line 196)
+* chain_next: GTY Options. (line 196)
+* chain_prev: GTY Options. (line 196)
+* change_address: Standard Names. (line 47)
+* CHANGE_DYNAMIC_TYPE_EXPR: Expression trees. (line 6)
+* char <1>: Misc. (line 693)
+* char <2>: PCH Target. (line 12)
+* char <3>: Sections. (line 272)
+* char: GIMPLE_ASM. (line 53)
+* CHAR_TYPE_SIZE: Type Layout. (line 39)
+* check_stack instruction pattern: Standard Names. (line 1245)
+* CHImode: Machine Modes. (line 202)
+* class: Classes. (line 6)
+* class definitions, register: Register Classes. (line 6)
+* class preference constraints: Class Preferences. (line 6)
+* CLASS_LIKELY_SPILLED_P: Register Classes. (line 452)
+* CLASS_MAX_NREGS: Register Classes. (line 469)
+* CLASS_TYPE_P: Types. (line 80)
+* classes of RTX codes: RTL Classes. (line 6)
+* CLASSTYPE_DECLARED_CLASS: Classes. (line 6)
+* CLASSTYPE_HAS_MUTABLE: Classes. (line 80)
+* CLASSTYPE_NON_POD_P: Classes. (line 85)
+* CLEANUP_DECL: Function Bodies. (line 6)
+* CLEANUP_EXPR: Function Bodies. (line 6)
+* CLEANUP_POINT_EXPR: Expression trees. (line 6)
+* CLEANUP_STMT: Function Bodies. (line 6)
+* Cleanups: Cleanups. (line 6)
+* CLEAR_BY_PIECES_P: Costs. (line 130)
+* clear_cache instruction pattern: Standard Names. (line 1553)
+* CLEAR_INSN_CACHE: Trampolines. (line 100)
+* CLEAR_RATIO: Costs. (line 121)
+* clobber: Side Effects. (line 100)
+* clz: Arithmetic. (line 208)
+* CLZ_DEFINED_VALUE_AT_ZERO: Misc. (line 319)
+* clzM2 instruction pattern: Standard Names. (line 621)
+* cmpM instruction pattern: Standard Names. (line 654)
+* cmpmemM instruction pattern: Standard Names. (line 769)
+* cmpstrM instruction pattern: Standard Names. (line 750)
+* cmpstrnM instruction pattern: Standard Names. (line 738)
+* code generation RTL sequences: Expander Definitions.
+ (line 6)
+* code iterators in .md files: Code Iterators. (line 6)
+* code_label: Insns. (line 119)
+* code_label and /i: Flags. (line 59)
+* code_label and /v: Flags. (line 44)
+* CODE_LABEL_NUMBER: Insns. (line 119)
+* codes, RTL expression: RTL Objects. (line 47)
+* COImode: Machine Modes. (line 202)
+* COLLECT2_HOST_INITIALIZATION: Host Misc. (line 32)
+* COLLECT_EXPORT_LIST: Misc. (line 775)
+* COLLECT_SHARED_FINI_FUNC: Macros for Initialization.
+ (line 44)
+* COLLECT_SHARED_INIT_FUNC: Macros for Initialization.
+ (line 33)
+* commit_edge_insertions: Maintaining the CFG.
+ (line 118)
+* compare: Arithmetic. (line 43)
+* compare, canonicalization of: Insn Canonicalizations.
+ (line 37)
+* comparison_operator: Machine-Independent Predicates.
+ (line 111)
+* compiler passes and files: Passes. (line 6)
+* complement, bitwise: Arithmetic. (line 149)
+* COMPLEX_CST: Expression trees. (line 6)
+* COMPLEX_EXPR: Expression trees. (line 6)
+* COMPLEX_TYPE: Types. (line 6)
+* COMPONENT_REF: Expression trees. (line 6)
+* Compound Expressions: Compound Expressions.
+ (line 6)
+* Compound Lvalues: Compound Lvalues. (line 6)
+* COMPOUND_EXPR: Expression trees. (line 6)
+* COMPOUND_LITERAL_EXPR: Expression trees. (line 6)
+* COMPOUND_LITERAL_EXPR_DECL: Expression trees. (line 608)
+* COMPOUND_LITERAL_EXPR_DECL_STMT: Expression trees. (line 608)
+* computed jump: Edges. (line 128)
+* computing the length of an insn: Insn Lengths. (line 6)
+* concat: Regs and Memory. (line 385)
+* concatn: Regs and Memory. (line 391)
+* cond: Comparisons. (line 90)
+* cond and attributes: Expressions. (line 37)
+* cond_exec: Side Effects. (line 248)
+* COND_EXPR: Expression trees. (line 6)
+* condition code register: Regs and Memory. (line 307)
+* condition code status: Condition Code. (line 6)
+* condition codes: Comparisons. (line 20)
+* conditional execution: Conditional Execution.
+ (line 6)
+* Conditional Expressions: Conditional Expressions.
+ (line 6)
+* CONDITIONAL_REGISTER_USAGE: Register Basics. (line 60)
+* conditional_trap instruction pattern: Standard Names. (line 1379)
+* conditions, in patterns: Patterns. (line 43)
+* configuration file <1>: Host Misc. (line 6)
+* configuration file: Filesystem. (line 6)
+* configure terms: Configure Terms. (line 6)
+* CONJ_EXPR: Expression trees. (line 6)
+* const: Constants. (line 99)
+* CONST0_RTX: Constants. (line 119)
+* const0_rtx: Constants. (line 16)
+* CONST1_RTX: Constants. (line 119)
+* const1_rtx: Constants. (line 16)
+* CONST2_RTX: Constants. (line 119)
+* const2_rtx: Constants. (line 16)
+* CONST_DECL: Declarations. (line 6)
+* const_double: Constants. (line 32)
+* const_double, RTL sharing: Sharing. (line 29)
+* CONST_DOUBLE_LOW: Constants. (line 39)
+* CONST_DOUBLE_OK_FOR_CONSTRAINT_P: Old Constraints. (line 69)
+* CONST_DOUBLE_OK_FOR_LETTER_P: Old Constraints. (line 54)
+* const_double_operand: Machine-Independent Predicates.
+ (line 21)
+* const_fixed: Constants. (line 52)
+* const_int: Constants. (line 8)
+* const_int and attribute tests: Expressions. (line 47)
+* const_int and attributes: Expressions. (line 10)
+* const_int, RTL sharing: Sharing. (line 23)
+* const_int_operand: Machine-Independent Predicates.
+ (line 16)
+* CONST_OK_FOR_CONSTRAINT_P: Old Constraints. (line 49)
+* CONST_OK_FOR_LETTER_P: Old Constraints. (line 40)
+* const_string: Constants. (line 71)
+* const_string and attributes: Expressions. (line 20)
+* const_true_rtx: Constants. (line 26)
+* const_vector: Constants. (line 59)
+* const_vector, RTL sharing: Sharing. (line 32)
+* constant attributes: Constant Attributes.
+ (line 6)
+* constant definitions: Constant Definitions.
+ (line 6)
+* CONSTANT_ADDRESS_P: Addressing Modes. (line 29)
+* CONSTANT_ALIGNMENT: Storage Layout. (line 241)
+* CONSTANT_P: Addressing Modes. (line 35)
+* CONSTANT_POOL_ADDRESS_P: Flags. (line 10)
+* CONSTANT_POOL_BEFORE_FUNCTION: Data Output. (line 64)
+* constants in constraints: Simple Constraints. (line 60)
+* constm1_rtx: Constants. (line 16)
+* constraint modifier characters: Modifiers. (line 6)
+* constraint, matching: Simple Constraints. (line 132)
+* CONSTRAINT_LEN: Old Constraints. (line 12)
+* constraint_num: C Constraint Interface.
+ (line 38)
+* constraint_satisfied_p: C Constraint Interface.
+ (line 54)
+* constraints: Constraints. (line 6)
+* constraints, defining: Define Constraints. (line 6)
+* constraints, defining, obsolete method: Old Constraints. (line 6)
+* constraints, machine specific: Machine Constraints.
+ (line 6)
+* constraints, testing: C Constraint Interface.
+ (line 6)
+* CONSTRUCTOR: Expression trees. (line 6)
+* constructor: Function Basics. (line 6)
+* constructors, automatic calls: Collect2. (line 15)
+* constructors, output of: Initialization. (line 6)
+* container: Containers. (line 6)
+* CONTINUE_STMT: Function Bodies. (line 6)
+* contributors: Contributors. (line 6)
+* controlling register usage: Register Basics. (line 76)
+* controlling the compilation driver: Driver. (line 6)
+* conventions, run-time: Interface. (line 6)
+* conversions: Conversions. (line 6)
+* CONVERT_EXPR: Expression trees. (line 6)
+* copy constructor: Function Basics. (line 6)
+* copy_rtx: Addressing Modes. (line 182)
+* copy_rtx_if_shared: Sharing. (line 64)
+* copysignM3 instruction pattern: Standard Names. (line 602)
+* cosM2 instruction pattern: Standard Names. (line 481)
+* costs of instructions: Costs. (line 6)
+* CP_INTEGRAL_TYPE: Types. (line 72)
+* cp_namespace_decls: Namespaces. (line 44)
+* CP_TYPE_CONST_NON_VOLATILE_P: Types. (line 45)
+* CP_TYPE_CONST_P: Types. (line 36)
+* CP_TYPE_QUALS: Types. (line 6)
+* CP_TYPE_RESTRICT_P: Types. (line 42)
+* CP_TYPE_VOLATILE_P: Types. (line 39)
+* CPLUSPLUS_CPP_SPEC: Driver. (line 113)
+* CPP_SPEC: Driver. (line 106)
+* CQImode: Machine Modes. (line 202)
+* cross compilation and floating point: Floating Point. (line 6)
+* CRT_CALL_STATIC_FUNCTION: Sections. (line 112)
+* CRTSTUFF_T_CFLAGS: Target Fragment. (line 35)
+* CRTSTUFF_T_CFLAGS_S: Target Fragment. (line 39)
+* CSImode: Machine Modes. (line 202)
+* CTImode: Machine Modes. (line 202)
+* ctz: Arithmetic. (line 216)
+* CTZ_DEFINED_VALUE_AT_ZERO: Misc. (line 320)
+* ctzM2 instruction pattern: Standard Names. (line 630)
+* CUMULATIVE_ARGS: Register Arguments. (line 127)
+* current_function_epilogue_delay_list: Function Entry. (line 181)
+* current_function_is_leaf: Leaf Functions. (line 51)
+* current_function_outgoing_args_size: Stack Arguments. (line 45)
+* current_function_pops_args: Function Entry. (line 106)
+* current_function_pretend_args_size: Function Entry. (line 112)
+* current_function_uses_only_leaf_regs: Leaf Functions. (line 51)
+* current_insn_predicate: Conditional Execution.
+ (line 26)
+* DAmode: Machine Modes. (line 152)
+* data bypass: Processor pipeline description.
+ (line 106)
+* data dependence delays: Processor pipeline description.
+ (line 6)
+* Data Dependency Analysis: Dependency analysis.
+ (line 6)
+* data structures: Per-Function Data. (line 6)
+* DATA_ALIGNMENT: Storage Layout. (line 228)
+* DATA_SECTION_ASM_OP: Sections. (line 53)
+* DBR_OUTPUT_SEQEND: Instruction Output. (line 107)
+* dbr_sequence_length: Instruction Output. (line 106)
+* DBX_BLOCKS_FUNCTION_RELATIVE: DBX Options. (line 103)
+* DBX_CONTIN_CHAR: DBX Options. (line 66)
+* DBX_CONTIN_LENGTH: DBX Options. (line 56)
+* DBX_DEBUGGING_INFO: DBX Options. (line 9)
+* DBX_FUNCTION_FIRST: DBX Options. (line 97)
+* DBX_LINES_FUNCTION_RELATIVE: DBX Options. (line 109)
+* DBX_NO_XREFS: DBX Options. (line 50)
+* DBX_OUTPUT_LBRAC: DBX Hooks. (line 9)
+* DBX_OUTPUT_MAIN_SOURCE_FILE_END: File Names and DBX. (line 34)
+* DBX_OUTPUT_MAIN_SOURCE_FILENAME: File Names and DBX. (line 9)
+* DBX_OUTPUT_NFUN: DBX Hooks. (line 18)
+* DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END: File Names and DBX.
+ (line 42)
+* DBX_OUTPUT_RBRAC: DBX Hooks. (line 15)
+* DBX_OUTPUT_SOURCE_LINE: DBX Hooks. (line 22)
+* DBX_REGISTER_NUMBER: All Debuggers. (line 9)
+* DBX_REGPARM_STABS_CODE: DBX Options. (line 87)
+* DBX_REGPARM_STABS_LETTER: DBX Options. (line 92)
+* DBX_STATIC_CONST_VAR_CODE: DBX Options. (line 82)
+* DBX_STATIC_STAB_DATA_SECTION: DBX Options. (line 73)
+* DBX_TYPE_DECL_STABS_CODE: DBX Options. (line 78)
+* DBX_USE_BINCL: DBX Options. (line 115)
+* DCmode: Machine Modes. (line 197)
+* DDmode: Machine Modes. (line 90)
+* De Morgan's law: Insn Canonicalizations.
+ (line 57)
+* dead_or_set_p: define_peephole. (line 65)
+* DEBUG_SYMS_TEXT: DBX Options. (line 25)
+* DEBUGGER_ARG_OFFSET: All Debuggers. (line 37)
+* DEBUGGER_AUTO_OFFSET: All Debuggers. (line 28)
+* decimal float library: Decimal float library routines.
+ (line 6)
+* DECL_ALIGN: Declarations. (line 6)
+* DECL_ANTICIPATED: Function Basics. (line 48)
+* DECL_ARGUMENTS: Function Basics. (line 163)
+* DECL_ARRAY_DELETE_OPERATOR_P: Function Basics. (line 184)
+* DECL_ARTIFICIAL <1>: Function Basics. (line 6)
+* DECL_ARTIFICIAL: Working with declarations.
+ (line 24)
+* DECL_ASSEMBLER_NAME: Function Basics. (line 6)
+* DECL_ATTRIBUTES: Attributes. (line 22)
+* DECL_BASE_CONSTRUCTOR_P: Function Basics. (line 94)
+* DECL_CLASS_SCOPE_P: Working with declarations.
+ (line 41)
+* DECL_COMPLETE_CONSTRUCTOR_P: Function Basics. (line 90)
+* DECL_COMPLETE_DESTRUCTOR_P: Function Basics. (line 104)
+* DECL_CONST_MEMFUNC_P: Function Basics. (line 77)
+* DECL_CONSTRUCTOR_P: Function Basics. (line 6)
+* DECL_CONTEXT: Namespaces. (line 26)
+* DECL_CONV_FN_P: Function Basics. (line 6)
+* DECL_COPY_CONSTRUCTOR_P: Function Basics. (line 98)
+* DECL_DESTRUCTOR_P: Function Basics. (line 6)
+* DECL_EXTERN_C_FUNCTION_P: Function Basics. (line 52)
+* DECL_EXTERNAL <1>: Function Basics. (line 38)
+* DECL_EXTERNAL: Declarations. (line 6)
+* DECL_FUNCTION_MEMBER_P: Function Basics. (line 6)
+* DECL_FUNCTION_SCOPE_P: Working with declarations.
+ (line 44)
+* DECL_FUNCTION_SPECIFIC_OPTIMIZATION: Function Basics. (line 6)
+* DECL_FUNCTION_SPECIFIC_TARGET: Function Basics. (line 6)
+* DECL_GLOBAL_CTOR_P: Function Basics. (line 6)
+* DECL_GLOBAL_DTOR_P: Function Basics. (line 6)
+* DECL_INITIAL: Declarations. (line 6)
+* DECL_LINKONCE_P: Function Basics. (line 6)
+* DECL_LOCAL_FUNCTION_P: Function Basics. (line 44)
+* DECL_MAIN_P: Function Basics. (line 7)
+* DECL_NAME <1>: Function Basics. (line 6)
+* DECL_NAME <2>: Working with declarations.
+ (line 7)
+* DECL_NAME: Namespaces. (line 15)
+* DECL_NAMESPACE_ALIAS: Namespaces. (line 30)
+* DECL_NAMESPACE_SCOPE_P: Working with declarations.
+ (line 37)
+* DECL_NAMESPACE_STD_P: Namespaces. (line 40)
+* DECL_NON_THUNK_FUNCTION_P: Function Basics. (line 144)
+* DECL_NONCONVERTING_P: Function Basics. (line 86)
+* DECL_NONSTATIC_MEMBER_FUNCTION_P: Function Basics. (line 74)
+* DECL_OVERLOADED_OPERATOR_P: Function Basics. (line 6)
+* DECL_RESULT: Function Basics. (line 168)
+* DECL_SIZE: Declarations. (line 6)
+* DECL_STATIC_FUNCTION_P: Function Basics. (line 71)
+* DECL_STMT: Function Bodies. (line 6)
+* DECL_STMT_DECL: Function Bodies. (line 6)
+* DECL_THUNK_P: Function Basics. (line 122)
+* DECL_VOLATILE_MEMFUNC_P: Function Basics. (line 80)
+* declaration: Declarations. (line 6)
+* declarations, RTL: RTL Declarations. (line 6)
+* DECLARE_LIBRARY_RENAMES: Library Calls. (line 9)
+* decrement_and_branch_until_zero instruction pattern: Standard Names.
+ (line 1120)
+* def_optype_d: Manipulating GIMPLE statements.
+ (line 94)
+* default: GTY Options. (line 82)
+* default_file_start: File Framework. (line 9)
+* DEFAULT_GDB_EXTENSIONS: DBX Options. (line 18)
+* DEFAULT_PCC_STRUCT_RETURN: Aggregate Return. (line 34)
+* DEFAULT_SIGNED_CHAR: Type Layout. (line 154)
+* define_address_constraint: Define Constraints. (line 107)
+* define_asm_attributes: Tagging Insns. (line 73)
+* define_attr: Defining Attributes.
+ (line 6)
+* define_automaton: Processor pipeline description.
+ (line 53)
+* define_bypass: Processor pipeline description.
+ (line 197)
+* define_code_attr: Code Iterators. (line 6)
+* define_code_iterator: Code Iterators. (line 6)
+* define_cond_exec: Conditional Execution.
+ (line 13)
+* define_constants: Constant Definitions.
+ (line 6)
+* define_constraint: Define Constraints. (line 48)
+* define_cpu_unit: Processor pipeline description.
+ (line 68)
+* define_delay: Delay Slots. (line 25)
+* define_expand: Expander Definitions.
+ (line 11)
+* define_insn: Patterns. (line 6)
+* define_insn example: Example. (line 6)
+* define_insn_and_split: Insn Splitting. (line 170)
+* define_insn_reservation: Processor pipeline description.
+ (line 106)
+* define_memory_constraint: Define Constraints. (line 88)
+* define_mode_attr: Substitutions. (line 6)
+* define_mode_iterator: Defining Mode Iterators.
+ (line 6)
+* define_peephole: define_peephole. (line 6)
+* define_peephole2: define_peephole2. (line 6)
+* define_predicate: Defining Predicates.
+ (line 6)
+* define_query_cpu_unit: Processor pipeline description.
+ (line 90)
+* define_register_constraint: Define Constraints. (line 28)
+* define_reservation: Processor pipeline description.
+ (line 186)
+* define_special_predicate: Defining Predicates.
+ (line 6)
+* define_split: Insn Splitting. (line 32)
+* defining attributes and their values: Defining Attributes.
+ (line 6)
+* defining constraints: Define Constraints. (line 6)
+* defining constraints, obsolete method: Old Constraints. (line 6)
+* defining jump instruction patterns: Jump Patterns. (line 6)
+* defining looping instruction patterns: Looping Patterns. (line 6)
+* defining peephole optimizers: Peephole Definitions.
+ (line 6)
+* defining predicates: Defining Predicates.
+ (line 6)
+* defining RTL sequences for code generation: Expander Definitions.
+ (line 6)
+* delay slots, defining: Delay Slots. (line 6)
+* DELAY_SLOTS_FOR_EPILOGUE: Function Entry. (line 163)
+* deletable: GTY Options. (line 150)
+* DELETE_IF_ORDINARY: Filesystem. (line 79)
+* Dependent Patterns: Dependent Patterns. (line 6)
+* desc: GTY Options. (line 82)
+* destructor: Function Basics. (line 6)
+* destructors, output of: Initialization. (line 6)
+* deterministic finite state automaton: Processor pipeline description.
+ (line 6)
+* DF_SIZE: Type Layout. (line 130)
+* DFmode: Machine Modes. (line 73)
+* digits in constraint: Simple Constraints. (line 120)
+* DImode: Machine Modes. (line 45)
+* DIR_SEPARATOR: Filesystem. (line 18)
+* DIR_SEPARATOR_2: Filesystem. (line 19)
+* directory options .md: Including Patterns. (line 44)
+* disabling certain registers: Register Basics. (line 76)
+* dispatch table: Dispatch Tables. (line 8)
+* div: Arithmetic. (line 111)
+* div and attributes: Expressions. (line 64)
+* division: Arithmetic. (line 111)
+* divM3 instruction pattern: Standard Names. (line 222)
+* divmodM4 instruction pattern: Standard Names. (line 411)
+* DO_BODY: Function Bodies. (line 6)
+* DO_COND: Function Bodies. (line 6)
+* DO_STMT: Function Bodies. (line 6)
+* DOLLARS_IN_IDENTIFIERS: Misc. (line 496)
+* doloop_begin instruction pattern: Standard Names. (line 1151)
+* doloop_end instruction pattern: Standard Names. (line 1130)
+* DONE: Expander Definitions.
+ (line 74)
+* DONT_USE_BUILTIN_SETJMP: Exception Region Output.
+ (line 70)
+* DOUBLE_TYPE_SIZE: Type Layout. (line 53)
+* DQmode: Machine Modes. (line 115)
+* driver: Driver. (line 6)
+* DRIVER_SELF_SPECS: Driver. (line 71)
+* DUMPFILE_FORMAT: Filesystem. (line 67)
+* DWARF2_ASM_LINE_DEBUG_INFO: SDB and DWARF. (line 36)
+* DWARF2_DEBUGGING_INFO: SDB and DWARF. (line 13)
+* DWARF2_FRAME_INFO: SDB and DWARF. (line 30)
+* DWARF2_FRAME_REG_OUT: Frame Registers. (line 133)
+* DWARF2_UNWIND_INFO: Exception Region Output.
+ (line 40)
+* DWARF_ALT_FRAME_RETURN_COLUMN: Frame Layout. (line 152)
+* DWARF_CIE_DATA_ALIGNMENT: Exception Region Output.
+ (line 75)
+* DWARF_FRAME_REGISTERS: Frame Registers. (line 93)
+* DWARF_FRAME_REGNUM: Frame Registers. (line 125)
+* DWARF_REG_TO_UNWIND_COLUMN: Frame Registers. (line 117)
+* DWARF_ZERO_REG: Frame Layout. (line 163)
+* DYNAMIC_CHAIN_ADDRESS: Frame Layout. (line 92)
+* E in constraint: Simple Constraints. (line 79)
+* earlyclobber operand: Modifiers. (line 25)
+* edge: Edges. (line 6)
+* edge in the flow graph: Edges. (line 6)
+* edge iterators: Edges. (line 15)
+* edge splitting: Maintaining the CFG.
+ (line 118)
+* EDGE_ABNORMAL: Edges. (line 128)
+* EDGE_ABNORMAL, EDGE_ABNORMAL_CALL: Edges. (line 171)
+* EDGE_ABNORMAL, EDGE_EH: Edges. (line 96)
+* EDGE_ABNORMAL, EDGE_SIBCALL: Edges. (line 122)
+* EDGE_FALLTHRU, force_nonfallthru: Edges. (line 86)
+* EDOM, implicit usage: Library Calls. (line 58)
+* EH_FRAME_IN_DATA_SECTION: Exception Region Output.
+ (line 20)
+* EH_FRAME_SECTION_NAME: Exception Region Output.
+ (line 10)
+* eh_return instruction pattern: Standard Names. (line 1319)
+* EH_RETURN_DATA_REGNO: Exception Handling. (line 7)
+* EH_RETURN_HANDLER_RTX: Exception Handling. (line 39)
+* EH_RETURN_STACKADJ_RTX: Exception Handling. (line 22)
+* EH_TABLES_CAN_BE_READ_ONLY: Exception Region Output.
+ (line 29)
+* EH_USES: Function Entry. (line 158)
+* ei_edge: Edges. (line 43)
+* ei_end_p: Edges. (line 27)
+* ei_last: Edges. (line 23)
+* ei_next: Edges. (line 35)
+* ei_one_before_end_p: Edges. (line 31)
+* ei_prev: Edges. (line 39)
+* ei_safe_safe: Edges. (line 47)
+* ei_start: Edges. (line 19)
+* ELIGIBLE_FOR_EPILOGUE_DELAY: Function Entry. (line 169)
+* ELIMINABLE_REGS: Elimination. (line 44)
+* ELSE_CLAUSE: Function Bodies. (line 6)
+* Embedded C: Fixed-point fractional library routines.
+ (line 6)
+* EMIT_MODE_SET: Mode Switching. (line 74)
+* Empty Statements: Empty Statements. (line 6)
+* EMPTY_CLASS_EXPR: Function Bodies. (line 6)
+* EMPTY_FIELD_BOUNDARY: Storage Layout. (line 295)
+* Emulated TLS: Emulated TLS. (line 6)
+* ENABLE_EXECUTE_STACK: Trampolines. (line 110)
+* enabled: Disable Insn Alternatives.
+ (line 6)
+* ENDFILE_SPEC: Driver. (line 218)
+* endianness: Portability. (line 21)
+* ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR: Basic Blocks. (line 28)
+* enum machine_mode: Machine Modes. (line 6)
+* enum reg_class: Register Classes. (line 65)
+* ENUMERAL_TYPE: Types. (line 6)
+* epilogue: Function Entry. (line 6)
+* epilogue instruction pattern: Standard Names. (line 1351)
+* EPILOGUE_USES: Function Entry. (line 152)
+* eq: Comparisons. (line 52)
+* eq and attributes: Expressions. (line 64)
+* eq_attr: Expressions. (line 85)
+* EQ_EXPR: Expression trees. (line 6)
+* equal: Comparisons. (line 52)
+* errno, implicit usage: Library Calls. (line 70)
+* EXACT_DIV_EXPR: Expression trees. (line 6)
+* examining SSA_NAMEs: SSA. (line 218)
+* exception handling <1>: Exception Handling. (line 6)
+* exception handling: Edges. (line 96)
+* exception_receiver instruction pattern: Standard Names. (line 1283)
+* exclamation point: Multi-Alternative. (line 47)
+* exclusion_set: Processor pipeline description.
+ (line 215)
+* exclusive-or, bitwise: Arithmetic. (line 163)
+* EXIT_EXPR: Expression trees. (line 6)
+* EXIT_IGNORE_STACK: Function Entry. (line 140)
+* expander definitions: Expander Definitions.
+ (line 6)
+* expM2 instruction pattern: Standard Names. (line 497)
+* expr_list: Insns. (line 505)
+* EXPR_STMT: Function Bodies. (line 6)
+* EXPR_STMT_EXPR: Function Bodies. (line 6)
+* expression: Expression trees. (line 6)
+* expression codes: RTL Objects. (line 47)
+* extendMN2 instruction pattern: Standard Names. (line 826)
+* extensible constraints: Simple Constraints. (line 163)
+* EXTRA_ADDRESS_CONSTRAINT: Old Constraints. (line 123)
+* EXTRA_CONSTRAINT: Old Constraints. (line 74)
+* EXTRA_CONSTRAINT_STR: Old Constraints. (line 95)
+* EXTRA_MEMORY_CONSTRAINT: Old Constraints. (line 100)
+* EXTRA_SPECS: Driver. (line 245)
+* extv instruction pattern: Standard Names. (line 862)
+* extzv instruction pattern: Standard Names. (line 877)
+* F in constraint: Simple Constraints. (line 84)
+* FAIL: Expander Definitions.
+ (line 80)
+* fall-thru: Edges. (line 69)
+* FATAL_EXIT_CODE: Host Misc. (line 6)
+* FDL, GNU Free Documentation License: GNU Free Documentation License.
+ (line 6)
+* features, optional, in system conventions: Run-time Target.
+ (line 59)
+* ffs: Arithmetic. (line 202)
+* ffsM2 instruction pattern: Standard Names. (line 611)
+* FIELD_DECL: Declarations. (line 6)
+* file_end_indicate_exec_stack: File Framework. (line 41)
+* files and passes of the compiler: Passes. (line 6)
+* files, generated: Files. (line 6)
+* final_absence_set: Processor pipeline description.
+ (line 215)
+* FINAL_PRESCAN_INSN: Instruction Output. (line 46)
+* final_presence_set: Processor pipeline description.
+ (line 215)
+* final_scan_insn: Function Entry. (line 181)
+* final_sequence: Instruction Output. (line 117)
+* FIND_BASE_TERM: Addressing Modes. (line 110)
+* FINI_ARRAY_SECTION_ASM_OP: Sections. (line 105)
+* FINI_SECTION_ASM_OP: Sections. (line 90)
+* finite state automaton minimization: Processor pipeline description.
+ (line 296)
+* FIRST_PARM_OFFSET: Frame Layout. (line 67)
+* FIRST_PARM_OFFSET and virtual registers: Regs and Memory. (line 65)
+* FIRST_PSEUDO_REGISTER: Register Basics. (line 9)
+* FIRST_STACK_REG: Stack Registers. (line 23)
+* FIRST_VIRTUAL_REGISTER: Regs and Memory. (line 51)
+* fix: Conversions. (line 66)
+* FIX_TRUNC_EXPR: Expression trees. (line 6)
+* fix_truncMN2 instruction pattern: Standard Names. (line 813)
+* fixed register: Register Basics. (line 15)
+* fixed-point fractional library: Fixed-point fractional library routines.
+ (line 6)
+* FIXED_CONVERT_EXPR: Expression trees. (line 6)
+* FIXED_CST: Expression trees. (line 6)
+* FIXED_POINT_TYPE: Types. (line 6)
+* FIXED_REGISTERS: Register Basics. (line 15)
+* fixed_regs: Register Basics. (line 59)
+* fixMN2 instruction pattern: Standard Names. (line 793)
+* FIXUNS_TRUNC_LIKE_FIX_TRUNC: Misc. (line 100)
+* fixuns_truncMN2 instruction pattern: Standard Names. (line 817)
+* fixunsMN2 instruction pattern: Standard Names. (line 802)
+* flags in RTL expression: Flags. (line 6)
+* float: Conversions. (line 58)
+* FLOAT_EXPR: Expression trees. (line 6)
+* float_extend: Conversions. (line 33)
+* FLOAT_LIB_COMPARE_RETURNS_BOOL: Library Calls. (line 25)
+* FLOAT_STORE_FLAG_VALUE: Misc. (line 301)
+* float_truncate: Conversions. (line 53)
+* FLOAT_TYPE_SIZE: Type Layout. (line 49)
+* FLOAT_WORDS_BIG_ENDIAN: Storage Layout. (line 43)
+* FLOAT_WORDS_BIG_ENDIAN, (lack of) effect on subreg: Regs and Memory.
+ (line 226)
+* floating point and cross compilation: Floating Point. (line 6)
+* Floating Point Emulation: Target Fragment. (line 15)
+* floating point emulation library, US Software GOFAST: Library Calls.
+ (line 44)
+* floatMN2 instruction pattern: Standard Names. (line 785)
+* floatunsMN2 instruction pattern: Standard Names. (line 789)
+* FLOOR_DIV_EXPR: Expression trees. (line 6)
+* FLOOR_MOD_EXPR: Expression trees. (line 6)
+* floorM2 instruction pattern: Standard Names. (line 532)
+* flow-insensitive alias analysis: Alias analysis. (line 6)
+* flow-sensitive alias analysis: Alias analysis. (line 6)
+* fmodM3 instruction pattern: Standard Names. (line 463)
+* FOR_BODY: Function Bodies. (line 6)
+* FOR_COND: Function Bodies. (line 6)
+* FOR_EXPR: Function Bodies. (line 6)
+* FOR_INIT_STMT: Function Bodies. (line 6)
+* FOR_STMT: Function Bodies. (line 6)
+* FORCE_CODE_SECTION_ALIGN: Sections. (line 136)
+* force_reg: Standard Names. (line 36)
+* fract_convert: Conversions. (line 82)
+* FRACT_TYPE_SIZE: Type Layout. (line 68)
+* fractional types: Fixed-point fractional library routines.
+ (line 6)
+* fractMN2 instruction pattern: Standard Names. (line 835)
+* fractunsMN2 instruction pattern: Standard Names. (line 850)
+* frame layout: Frame Layout. (line 6)
+* FRAME_ADDR_RTX: Frame Layout. (line 116)
+* FRAME_GROWS_DOWNWARD: Frame Layout. (line 31)
+* FRAME_GROWS_DOWNWARD and virtual registers: Regs and Memory.
+ (line 69)
+* FRAME_POINTER_CFA_OFFSET: Frame Layout. (line 212)
+* frame_pointer_needed: Function Entry. (line 34)
+* FRAME_POINTER_REGNUM: Frame Registers. (line 14)
+* FRAME_POINTER_REGNUM and virtual registers: Regs and Memory.
+ (line 74)
+* FRAME_POINTER_REQUIRED: Elimination. (line 9)
+* frame_pointer_rtx: Frame Registers. (line 85)
+* frame_related: Flags. (line 242)
+* frame_related, in insn, call_insn, jump_insn, barrier, and set: Flags.
+ (line 125)
+* frame_related, in mem: Flags. (line 103)
+* frame_related, in reg: Flags. (line 112)
+* frame_related, in symbol_ref: Flags. (line 183)
+* frequency, count, BB_FREQ_BASE: Profile information.
+ (line 30)
+* ftruncM2 instruction pattern: Standard Names. (line 808)
+* function: Functions. (line 6)
+* function body: Function Bodies. (line 6)
+* function call conventions: Interface. (line 6)
+* function entry and exit: Function Entry. (line 6)
+* function entry point, alternate function entry point: Edges.
+ (line 180)
+* function-call insns: Calls. (line 6)
+* FUNCTION_ARG: Register Arguments. (line 11)
+* FUNCTION_ARG_ADVANCE: Register Arguments. (line 186)
+* FUNCTION_ARG_BOUNDARY: Register Arguments. (line 239)
+* FUNCTION_ARG_OFFSET: Register Arguments. (line 197)
+* FUNCTION_ARG_PADDING: Register Arguments. (line 204)
+* FUNCTION_ARG_REGNO_P: Register Arguments. (line 244)
+* FUNCTION_BOUNDARY: Storage Layout. (line 170)
+* FUNCTION_DECL: Functions. (line 6)
+* FUNCTION_INCOMING_ARG: Register Arguments. (line 68)
+* FUNCTION_MODE: Misc. (line 356)
+* FUNCTION_OUTGOING_VALUE: Scalar Return. (line 56)
+* FUNCTION_PROFILER: Profiling. (line 9)
+* FUNCTION_TYPE: Types. (line 6)
+* FUNCTION_VALUE: Scalar Return. (line 52)
+* FUNCTION_VALUE_REGNO_P: Scalar Return. (line 69)
+* functions, leaf: Leaf Functions. (line 6)
+* fundamental type: Types. (line 6)
+* g in constraint: Simple Constraints. (line 110)
+* G in constraint: Simple Constraints. (line 88)
+* garbage collector, invocation: Invoking the garbage collector.
+ (line 6)
+* GCC and portability: Portability. (line 6)
+* GCC_DRIVER_HOST_INITIALIZATION: Host Misc. (line 36)
+* gcov_type: Profile information.
+ (line 41)
+* ge: Comparisons. (line 72)
+* ge and attributes: Expressions. (line 64)
+* GE_EXPR: Expression trees. (line 6)
+* GEN_ERRNO_RTX: Library Calls. (line 71)
+* gencodes: RTL passes. (line 18)
+* general_operand: Machine-Independent Predicates.
+ (line 105)
+* GENERAL_REGS: Register Classes. (line 23)
+* generated files: Files. (line 6)
+* generating assembler output: Output Statement. (line 6)
+* generating insns: RTL Template. (line 6)
+* GENERIC <1>: GENERIC. (line 6)
+* GENERIC <2>: Gimplification pass.
+ (line 12)
+* GENERIC: Parsing pass. (line 6)
+* generic predicates: Machine-Independent Predicates.
+ (line 6)
+* genflags: RTL passes. (line 18)
+* get_attr: Expressions. (line 80)
+* get_attr_length: Insn Lengths. (line 46)
+* GET_CLASS_NARROWEST_MODE: Machine Modes. (line 333)
+* GET_CODE: RTL Objects. (line 47)
+* get_frame_size: Elimination. (line 31)
+* get_insns: Insns. (line 34)
+* get_last_insn: Insns. (line 34)
+* GET_MODE: Machine Modes. (line 280)
+* GET_MODE_ALIGNMENT: Machine Modes. (line 320)
+* GET_MODE_BITSIZE: Machine Modes. (line 304)
+* GET_MODE_CLASS: Machine Modes. (line 294)
+* GET_MODE_FBIT: Machine Modes. (line 311)
+* GET_MODE_IBIT: Machine Modes. (line 307)
+* GET_MODE_MASK: Machine Modes. (line 315)
+* GET_MODE_NAME: Machine Modes. (line 291)
+* GET_MODE_NUNITS: Machine Modes. (line 329)
+* GET_MODE_SIZE: Machine Modes. (line 301)
+* GET_MODE_UNIT_SIZE: Machine Modes. (line 323)
+* GET_MODE_WIDER_MODE: Machine Modes. (line 297)
+* GET_RTX_CLASS: RTL Classes. (line 6)
+* GET_RTX_FORMAT: RTL Classes. (line 130)
+* GET_RTX_LENGTH: RTL Classes. (line 127)
+* geu: Comparisons. (line 72)
+* geu and attributes: Expressions. (line 64)
+* GGC: Type Information. (line 6)
+* ggc_collect: Invoking the garbage collector.
+ (line 6)
+* GIMPLE <1>: GIMPLE. (line 6)
+* GIMPLE <2>: Gimplification pass.
+ (line 6)
+* GIMPLE: Parsing pass. (line 14)
+* GIMPLE Exception Handling: GIMPLE Exception Handling.
+ (line 6)
+* GIMPLE instruction set: GIMPLE instruction set.
+ (line 6)
+* GIMPLE sequences: GIMPLE sequences. (line 6)
+* gimple_addresses_taken: Manipulating GIMPLE statements.
+ (line 90)
+* GIMPLE_ASM: GIMPLE_ASM. (line 6)
+* gimple_asm_clear_volatile: GIMPLE_ASM. (line 63)
+* gimple_asm_clobber_op: GIMPLE_ASM. (line 46)
+* gimple_asm_input_op: GIMPLE_ASM. (line 30)
+* gimple_asm_output_op: GIMPLE_ASM. (line 38)
+* gimple_asm_set_clobber_op: GIMPLE_ASM. (line 50)
+* gimple_asm_set_input_op: GIMPLE_ASM. (line 34)
+* gimple_asm_set_output_op: GIMPLE_ASM. (line 42)
+* gimple_asm_set_volatile: GIMPLE_ASM. (line 60)
+* gimple_asm_volatile_p: GIMPLE_ASM. (line 57)
+* GIMPLE_ASSIGN: GIMPLE_ASSIGN. (line 6)
+* gimple_assign_cast_p: GIMPLE_ASSIGN. (line 89)
+* gimple_assign_lhs: GIMPLE_ASSIGN. (line 51)
+* gimple_assign_rhs1: GIMPLE_ASSIGN. (line 57)
+* gimple_assign_rhs2: GIMPLE_ASSIGN. (line 64)
+* gimple_assign_set_lhs: GIMPLE_ASSIGN. (line 71)
+* gimple_assign_set_rhs1: GIMPLE_ASSIGN. (line 74)
+* gimple_assign_set_rhs2: GIMPLE_ASSIGN. (line 85)
+* gimple_bb: Manipulating GIMPLE statements.
+ (line 18)
+* GIMPLE_BIND: GIMPLE_BIND. (line 6)
+* gimple_bind_add_seq: GIMPLE_BIND. (line 36)
+* gimple_bind_add_stmt: GIMPLE_BIND. (line 32)
+* gimple_bind_append_vars: GIMPLE_BIND. (line 19)
+* gimple_bind_block: GIMPLE_BIND. (line 40)
+* gimple_bind_body: GIMPLE_BIND. (line 23)
+* gimple_bind_set_block: GIMPLE_BIND. (line 45)
+* gimple_bind_set_body: GIMPLE_BIND. (line 28)
+* gimple_bind_set_vars: GIMPLE_BIND. (line 15)
+* gimple_bind_vars: GIMPLE_BIND. (line 12)
+* gimple_block: Manipulating GIMPLE statements.
+ (line 21)
+* gimple_build_asm: GIMPLE_ASM. (line 8)
+* gimple_build_asm_vec: GIMPLE_ASM. (line 17)
+* gimple_build_assign: GIMPLE_ASSIGN. (line 7)
+* gimple_build_assign_with_ops: GIMPLE_ASSIGN. (line 30)
+* gimple_build_bind: GIMPLE_BIND. (line 8)
+* gimple_build_call: GIMPLE_CALL. (line 8)
+* gimple_build_call_from_tree: GIMPLE_CALL. (line 16)
+* gimple_build_call_vec: GIMPLE_CALL. (line 25)
+* gimple_build_catch: GIMPLE_CATCH. (line 8)
+* gimple_build_cdt: GIMPLE_CHANGE_DYNAMIC_TYPE.
+ (line 7)
+* gimple_build_cond: GIMPLE_COND. (line 8)
+* gimple_build_cond_from_tree: GIMPLE_COND. (line 16)
+* gimple_build_eh_filter: GIMPLE_EH_FILTER. (line 8)
+* gimple_build_goto: GIMPLE_LABEL. (line 18)
+* gimple_build_label: GIMPLE_LABEL. (line 7)
+* gimple_build_nop: GIMPLE_NOP. (line 7)
+* gimple_build_omp_atomic_load: GIMPLE_OMP_ATOMIC_LOAD.
+ (line 8)
+* gimple_build_omp_atomic_store: GIMPLE_OMP_ATOMIC_STORE.
+ (line 7)
+* gimple_build_omp_continue: GIMPLE_OMP_CONTINUE.
+ (line 8)
+* gimple_build_omp_critical: GIMPLE_OMP_CRITICAL.
+ (line 8)
+* gimple_build_omp_for: GIMPLE_OMP_FOR. (line 9)
+* gimple_build_omp_master: GIMPLE_OMP_MASTER. (line 7)
+* gimple_build_omp_ordered: GIMPLE_OMP_ORDERED. (line 7)
+* gimple_build_omp_parallel: GIMPLE_OMP_PARALLEL.
+ (line 8)
+* gimple_build_omp_return: GIMPLE_OMP_RETURN. (line 7)
+* gimple_build_omp_section: GIMPLE_OMP_SECTION. (line 7)
+* gimple_build_omp_sections: GIMPLE_OMP_SECTIONS.
+ (line 8)
+* gimple_build_omp_sections_switch: GIMPLE_OMP_SECTIONS.
+ (line 14)
+* gimple_build_omp_single: GIMPLE_OMP_SINGLE. (line 8)
+* gimple_build_resx: GIMPLE_RESX. (line 7)
+* gimple_build_return: GIMPLE_RETURN. (line 7)
+* gimple_build_switch: GIMPLE_SWITCH. (line 8)
+* gimple_build_switch_vec: GIMPLE_SWITCH. (line 16)
+* gimple_build_try: GIMPLE_TRY. (line 8)
+* gimple_build_wce: GIMPLE_WITH_CLEANUP_EXPR.
+ (line 7)
+* GIMPLE_CALL: GIMPLE_CALL. (line 6)
+* gimple_call_arg: GIMPLE_CALL. (line 66)
+* gimple_call_cannot_inline_p: GIMPLE_CALL. (line 91)
+* gimple_call_chain: GIMPLE_CALL. (line 57)
+* gimple_call_copy_skip_args: GIMPLE_CALL. (line 98)
+* gimple_call_fn: GIMPLE_CALL. (line 38)
+* gimple_call_fndecl: GIMPLE_CALL. (line 46)
+* gimple_call_lhs: GIMPLE_CALL. (line 29)
+* gimple_call_mark_uninlinable: GIMPLE_CALL. (line 88)
+* gimple_call_noreturn_p: GIMPLE_CALL. (line 94)
+* gimple_call_return_type: GIMPLE_CALL. (line 54)
+* gimple_call_set_arg: GIMPLE_CALL. (line 76)
+* gimple_call_set_chain: GIMPLE_CALL. (line 60)
+* gimple_call_set_fn: GIMPLE_CALL. (line 42)
+* gimple_call_set_fndecl: GIMPLE_CALL. (line 51)
+* gimple_call_set_lhs: GIMPLE_CALL. (line 35)
+* gimple_call_set_tail: GIMPLE_CALL. (line 80)
+* gimple_call_tail_p: GIMPLE_CALL. (line 85)
+* GIMPLE_CATCH: GIMPLE_CATCH. (line 6)
+* gimple_catch_handler: GIMPLE_CATCH. (line 20)
+* gimple_catch_set_handler: GIMPLE_CATCH. (line 28)
+* gimple_catch_set_types: GIMPLE_CATCH. (line 24)
+* gimple_catch_types: GIMPLE_CATCH. (line 13)
+* gimple_cdt_location: GIMPLE_CHANGE_DYNAMIC_TYPE.
+ (line 24)
+* gimple_cdt_new_type: GIMPLE_CHANGE_DYNAMIC_TYPE.
+ (line 11)
+* gimple_cdt_set_location: GIMPLE_CHANGE_DYNAMIC_TYPE.
+ (line 32)
+* gimple_cdt_set_new_type: GIMPLE_CHANGE_DYNAMIC_TYPE.
+ (line 20)
+* GIMPLE_CHANGE_DYNAMIC_TYPE: GIMPLE_CHANGE_DYNAMIC_TYPE.
+ (line 6)
+* gimple_code: Manipulating GIMPLE statements.
+ (line 15)
+* GIMPLE_COND: GIMPLE_COND. (line 6)
+* gimple_cond_false_label: GIMPLE_COND. (line 60)
+* gimple_cond_lhs: GIMPLE_COND. (line 30)
+* gimple_cond_make_false: GIMPLE_COND. (line 64)
+* gimple_cond_make_true: GIMPLE_COND. (line 67)
+* gimple_cond_rhs: GIMPLE_COND. (line 38)
+* gimple_cond_set_code: GIMPLE_COND. (line 26)
+* gimple_cond_set_false_label: GIMPLE_COND. (line 56)
+* gimple_cond_set_lhs: GIMPLE_COND. (line 34)
+* gimple_cond_set_rhs: GIMPLE_COND. (line 42)
+* gimple_cond_set_true_label: GIMPLE_COND. (line 51)
+* gimple_cond_true_label: GIMPLE_COND. (line 46)
+* gimple_copy: Manipulating GIMPLE statements.
+ (line 147)
+* GIMPLE_EH_FILTER: GIMPLE_EH_FILTER. (line 6)
+* gimple_eh_filter_failure: GIMPLE_EH_FILTER. (line 19)
+* gimple_eh_filter_must_not_throw: GIMPLE_EH_FILTER. (line 33)
+* gimple_eh_filter_set_failure: GIMPLE_EH_FILTER. (line 29)
+* gimple_eh_filter_set_must_not_throw: GIMPLE_EH_FILTER. (line 37)
+* gimple_eh_filter_set_types: GIMPLE_EH_FILTER. (line 24)
+* gimple_eh_filter_types: GIMPLE_EH_FILTER. (line 12)
+* gimple_expr_type: Manipulating GIMPLE statements.
+ (line 24)
+* gimple_goto_dest: GIMPLE_LABEL. (line 21)
+* gimple_goto_set_dest: GIMPLE_LABEL. (line 24)
+* gimple_has_mem_ops: Manipulating GIMPLE statements.
+ (line 72)
+* gimple_has_ops: Manipulating GIMPLE statements.
+ (line 69)
+* gimple_has_volatile_ops: Manipulating GIMPLE statements.
+ (line 134)
+* GIMPLE_LABEL: GIMPLE_LABEL. (line 6)
+* gimple_label_label: GIMPLE_LABEL. (line 11)
+* gimple_label_set_label: GIMPLE_LABEL. (line 14)
+* gimple_loaded_syms: Manipulating GIMPLE statements.
+ (line 122)
+* gimple_locus: Manipulating GIMPLE statements.
+ (line 42)
+* gimple_locus_empty_p: Manipulating GIMPLE statements.
+ (line 48)
+* gimple_modified_p: Manipulating GIMPLE statements.
+ (line 130)
+* gimple_no_warning_p: Manipulating GIMPLE statements.
+ (line 51)
+* GIMPLE_NOP: GIMPLE_NOP. (line 6)
+* gimple_nop_p: GIMPLE_NOP. (line 10)
+* gimple_num_ops <1>: Manipulating GIMPLE statements.
+ (line 75)
+* gimple_num_ops: Logical Operators. (line 76)
+* GIMPLE_OMP_ATOMIC_LOAD: GIMPLE_OMP_ATOMIC_LOAD.
+ (line 6)
+* gimple_omp_atomic_load_lhs: GIMPLE_OMP_ATOMIC_LOAD.
+ (line 17)
+* gimple_omp_atomic_load_rhs: GIMPLE_OMP_ATOMIC_LOAD.
+ (line 24)
+* gimple_omp_atomic_load_set_lhs: GIMPLE_OMP_ATOMIC_LOAD.
+ (line 14)
+* gimple_omp_atomic_load_set_rhs: GIMPLE_OMP_ATOMIC_LOAD.
+ (line 21)
+* GIMPLE_OMP_ATOMIC_STORE: GIMPLE_OMP_ATOMIC_STORE.
+ (line 6)
+* gimple_omp_atomic_store_set_val: GIMPLE_OMP_ATOMIC_STORE.
+ (line 12)
+* gimple_omp_atomic_store_val: GIMPLE_OMP_ATOMIC_STORE.
+ (line 15)
+* gimple_omp_body: GIMPLE_OMP_PARALLEL.
+ (line 24)
+* GIMPLE_OMP_CONTINUE: GIMPLE_OMP_CONTINUE.
+ (line 6)
+* gimple_omp_continue_control_def: GIMPLE_OMP_CONTINUE.
+ (line 13)
+* gimple_omp_continue_control_def_ptr: GIMPLE_OMP_CONTINUE.
+ (line 17)
+* gimple_omp_continue_control_use: GIMPLE_OMP_CONTINUE.
+ (line 24)
+* gimple_omp_continue_control_use_ptr: GIMPLE_OMP_CONTINUE.
+ (line 28)
+* gimple_omp_continue_set_control_def: GIMPLE_OMP_CONTINUE.
+ (line 20)
+* gimple_omp_continue_set_control_use: GIMPLE_OMP_CONTINUE.
+ (line 31)
+* GIMPLE_OMP_CRITICAL: GIMPLE_OMP_CRITICAL.
+ (line 6)
+* gimple_omp_critical_name: GIMPLE_OMP_CRITICAL.
+ (line 13)
+* gimple_omp_critical_set_name: GIMPLE_OMP_CRITICAL.
+ (line 21)
+* GIMPLE_OMP_FOR: GIMPLE_OMP_FOR. (line 6)
+* gimple_omp_for_clauses: GIMPLE_OMP_FOR. (line 20)
+* gimple_omp_for_final: GIMPLE_OMP_FOR. (line 51)
+* gimple_omp_for_incr: GIMPLE_OMP_FOR. (line 61)
+* gimple_omp_for_index: GIMPLE_OMP_FOR. (line 31)
+* gimple_omp_for_initial: GIMPLE_OMP_FOR. (line 41)
+* gimple_omp_for_pre_body: GIMPLE_OMP_FOR. (line 70)
+* gimple_omp_for_set_clauses: GIMPLE_OMP_FOR. (line 27)
+* gimple_omp_for_set_cond: GIMPLE_OMP_FOR. (line 80)
+* gimple_omp_for_set_final: GIMPLE_OMP_FOR. (line 58)
+* gimple_omp_for_set_incr: GIMPLE_OMP_FOR. (line 67)
+* gimple_omp_for_set_index: GIMPLE_OMP_FOR. (line 38)
+* gimple_omp_for_set_initial: GIMPLE_OMP_FOR. (line 48)
+* gimple_omp_for_set_pre_body: GIMPLE_OMP_FOR. (line 75)
+* GIMPLE_OMP_MASTER: GIMPLE_OMP_MASTER. (line 6)
+* GIMPLE_OMP_ORDERED: GIMPLE_OMP_ORDERED. (line 6)
+* GIMPLE_OMP_PARALLEL: GIMPLE_OMP_PARALLEL.
+ (line 6)
+* gimple_omp_parallel_child_fn: GIMPLE_OMP_PARALLEL.
+ (line 42)
+* gimple_omp_parallel_clauses: GIMPLE_OMP_PARALLEL.
+ (line 31)
+* gimple_omp_parallel_combined_p: GIMPLE_OMP_PARALLEL.
+ (line 16)
+* gimple_omp_parallel_data_arg: GIMPLE_OMP_PARALLEL.
+ (line 54)
+* gimple_omp_parallel_set_child_fn: GIMPLE_OMP_PARALLEL.
+ (line 51)
+* gimple_omp_parallel_set_clauses: GIMPLE_OMP_PARALLEL.
+ (line 38)
+* gimple_omp_parallel_set_combined_p: GIMPLE_OMP_PARALLEL.
+ (line 20)
+* gimple_omp_parallel_set_data_arg: GIMPLE_OMP_PARALLEL.
+ (line 62)
+* GIMPLE_OMP_RETURN: GIMPLE_OMP_RETURN. (line 6)
+* gimple_omp_return_nowait_p: GIMPLE_OMP_RETURN. (line 14)
+* gimple_omp_return_set_nowait: GIMPLE_OMP_RETURN. (line 11)
+* GIMPLE_OMP_SECTION: GIMPLE_OMP_SECTION. (line 6)
+* gimple_omp_section_last_p: GIMPLE_OMP_SECTION. (line 12)
+* gimple_omp_section_set_last: GIMPLE_OMP_SECTION. (line 16)
+* GIMPLE_OMP_SECTIONS: GIMPLE_OMP_SECTIONS.
+ (line 6)
+* gimple_omp_sections_clauses: GIMPLE_OMP_SECTIONS.
+ (line 30)
+* gimple_omp_sections_control: GIMPLE_OMP_SECTIONS.
+ (line 17)
+* gimple_omp_sections_set_clauses: GIMPLE_OMP_SECTIONS.
+ (line 37)
+* gimple_omp_sections_set_control: GIMPLE_OMP_SECTIONS.
+ (line 26)
+* gimple_omp_set_body: GIMPLE_OMP_PARALLEL.
+ (line 28)
+* GIMPLE_OMP_SINGLE: GIMPLE_OMP_SINGLE. (line 6)
+* gimple_omp_single_clauses: GIMPLE_OMP_SINGLE. (line 14)
+* gimple_omp_single_set_clauses: GIMPLE_OMP_SINGLE. (line 21)
+* gimple_op <1>: Manipulating GIMPLE statements.
+ (line 81)
+* gimple_op: Logical Operators. (line 79)
+* GIMPLE_PHI: GIMPLE_PHI. (line 6)
+* gimple_phi_capacity: GIMPLE_PHI. (line 10)
+* gimple_phi_num_args: GIMPLE_PHI. (line 14)
+* gimple_phi_result: GIMPLE_PHI. (line 19)
+* gimple_phi_set_arg: GIMPLE_PHI. (line 33)
+* gimple_phi_set_result: GIMPLE_PHI. (line 25)
+* GIMPLE_RESX: GIMPLE_RESX. (line 6)
+* gimple_resx_region: GIMPLE_RESX. (line 13)
+* gimple_resx_set_region: GIMPLE_RESX. (line 16)
+* GIMPLE_RETURN: GIMPLE_RETURN. (line 6)
+* gimple_return_retval: GIMPLE_RETURN. (line 10)
+* gimple_return_set_retval: GIMPLE_RETURN. (line 14)
+* gimple_rhs_class: GIMPLE_ASSIGN. (line 46)
+* gimple_seq_add_seq: GIMPLE sequences. (line 32)
+* gimple_seq_add_stmt: GIMPLE sequences. (line 26)
+* gimple_seq_alloc: GIMPLE sequences. (line 62)
+* gimple_seq_copy: GIMPLE sequences. (line 67)
+* gimple_seq_deep_copy: GIMPLE sequences. (line 37)
+* gimple_seq_empty_p: GIMPLE sequences. (line 70)
+* gimple_seq_first: GIMPLE sequences. (line 44)
+* gimple_seq_init: GIMPLE sequences. (line 59)
+* gimple_seq_last: GIMPLE sequences. (line 47)
+* gimple_seq_reverse: GIMPLE sequences. (line 40)
+* gimple_seq_set_first: GIMPLE sequences. (line 55)
+* gimple_seq_set_last: GIMPLE sequences. (line 51)
+* gimple_seq_singleton_p: GIMPLE sequences. (line 79)
+* gimple_set_block: Manipulating GIMPLE statements.
+ (line 39)
+* gimple_set_def_ops: Manipulating GIMPLE statements.
+ (line 98)
+* gimple_set_has_volatile_ops: Manipulating GIMPLE statements.
+ (line 138)
+* gimple_set_locus: Manipulating GIMPLE statements.
+ (line 45)
+* gimple_set_op: Manipulating GIMPLE statements.
+ (line 87)
+* gimple_set_plf: Manipulating GIMPLE statements.
+ (line 62)
+* gimple_set_use_ops: Manipulating GIMPLE statements.
+ (line 105)
+* gimple_set_vdef_ops: Manipulating GIMPLE statements.
+ (line 119)
+* gimple_set_visited: Manipulating GIMPLE statements.
+ (line 55)
+* gimple_set_vuse_ops: Manipulating GIMPLE statements.
+ (line 112)
+* gimple_statement_base: Tuple representation.
+ (line 14)
+* gimple_statement_with_ops: Tuple representation.
+ (line 96)
+* gimple_stored_syms: Manipulating GIMPLE statements.
+ (line 126)
+* GIMPLE_SWITCH: GIMPLE_SWITCH. (line 6)
+* gimple_switch_default_label: GIMPLE_SWITCH. (line 46)
+* gimple_switch_index: GIMPLE_SWITCH. (line 31)
+* gimple_switch_label: GIMPLE_SWITCH. (line 37)
+* gimple_switch_num_labels: GIMPLE_SWITCH. (line 22)
+* gimple_switch_set_default_label: GIMPLE_SWITCH. (line 50)
+* gimple_switch_set_index: GIMPLE_SWITCH. (line 34)
+* gimple_switch_set_label: GIMPLE_SWITCH. (line 42)
+* gimple_switch_set_num_labels: GIMPLE_SWITCH. (line 27)
+* GIMPLE_TRY: GIMPLE_TRY. (line 6)
+* gimple_try_catch_is_cleanup: GIMPLE_TRY. (line 20)
+* gimple_try_cleanup: GIMPLE_TRY. (line 27)
+* gimple_try_eval: GIMPLE_TRY. (line 23)
+* gimple_try_flags: GIMPLE_TRY. (line 16)
+* gimple_try_set_catch_is_cleanup: GIMPLE_TRY. (line 32)
+* gimple_try_set_cleanup: GIMPLE_TRY. (line 41)
+* gimple_try_set_eval: GIMPLE_TRY. (line 36)
+* gimple_visited_p: Manipulating GIMPLE statements.
+ (line 58)
+* gimple_wce_cleanup: GIMPLE_WITH_CLEANUP_EXPR.
+ (line 11)
+* gimple_wce_cleanup_eh_only: GIMPLE_WITH_CLEANUP_EXPR.
+ (line 18)
+* gimple_wce_set_cleanup: GIMPLE_WITH_CLEANUP_EXPR.
+ (line 15)
+* gimple_wce_set_cleanup_eh_only: GIMPLE_WITH_CLEANUP_EXPR.
+ (line 22)
+* GIMPLE_WITH_CLEANUP_EXPR: GIMPLE_WITH_CLEANUP_EXPR.
+ (line 6)
+* gimplification <1>: Gimplification pass.
+ (line 6)
+* gimplification: Parsing pass. (line 14)
+* gimplifier: Parsing pass. (line 14)
+* gimplify_assign: GIMPLE_ASSIGN. (line 19)
+* gimplify_expr: Gimplification pass.
+ (line 18)
+* gimplify_function_tree: Gimplification pass.
+ (line 18)
+* GLOBAL_INIT_PRIORITY: Function Basics. (line 6)
+* global_regs: Register Basics. (line 59)
+* GO_IF_LEGITIMATE_ADDRESS: Addressing Modes. (line 48)
+* GO_IF_MODE_DEPENDENT_ADDRESS: Addressing Modes. (line 190)
+* GOFAST, floating point emulation library: Library Calls. (line 44)
+* gofast_maybe_init_libfuncs: Library Calls. (line 44)
+* greater than: Comparisons. (line 60)
+* gsi_after_labels: Sequence iterators. (line 76)
+* gsi_bb: Sequence iterators. (line 83)
+* gsi_commit_edge_inserts: Sequence iterators. (line 194)
+* gsi_commit_one_edge_insert: Sequence iterators. (line 190)
+* gsi_end_p: Sequence iterators. (line 60)
+* gsi_for_stmt: Sequence iterators. (line 157)
+* gsi_insert_after: Sequence iterators. (line 147)
+* gsi_insert_before: Sequence iterators. (line 136)
+* gsi_insert_on_edge: Sequence iterators. (line 174)
+* gsi_insert_on_edge_immediate: Sequence iterators. (line 185)
+* gsi_insert_seq_after: Sequence iterators. (line 154)
+* gsi_insert_seq_before: Sequence iterators. (line 143)
+* gsi_insert_seq_on_edge: Sequence iterators. (line 179)
+* gsi_last: Sequence iterators. (line 50)
+* gsi_last_bb: Sequence iterators. (line 56)
+* gsi_link_after: Sequence iterators. (line 115)
+* gsi_link_before: Sequence iterators. (line 105)
+* gsi_link_seq_after: Sequence iterators. (line 110)
+* gsi_link_seq_before: Sequence iterators. (line 99)
+* gsi_move_after: Sequence iterators. (line 161)
+* gsi_move_before: Sequence iterators. (line 166)
+* gsi_move_to_bb_end: Sequence iterators. (line 171)
+* gsi_next: Sequence iterators. (line 66)
+* gsi_one_before_end_p: Sequence iterators. (line 63)
+* gsi_prev: Sequence iterators. (line 69)
+* gsi_remove: Sequence iterators. (line 90)
+* gsi_replace: Sequence iterators. (line 130)
+* gsi_seq: Sequence iterators. (line 86)
+* gsi_split_seq_after: Sequence iterators. (line 120)
+* gsi_split_seq_before: Sequence iterators. (line 125)
+* gsi_start: Sequence iterators. (line 40)
+* gsi_start_bb: Sequence iterators. (line 46)
+* gsi_stmt: Sequence iterators. (line 72)
+* gt: Comparisons. (line 60)
+* gt and attributes: Expressions. (line 64)
+* GT_EXPR: Expression trees. (line 6)
+* gtu: Comparisons. (line 64)
+* gtu and attributes: Expressions. (line 64)
+* GTY: Type Information. (line 6)
+* H in constraint: Simple Constraints. (line 88)
+* HAmode: Machine Modes. (line 144)
+* HANDLE_PRAGMA_PACK_PUSH_POP: Misc. (line 467)
+* HANDLE_PRAGMA_PACK_WITH_EXPANSION: Misc. (line 478)
+* HANDLE_PRAGMA_PUSH_POP_MACRO: Misc. (line 488)
+* HANDLE_SYSV_PRAGMA: Misc. (line 438)
+* HANDLER: Function Bodies. (line 6)
+* HANDLER_BODY: Function Bodies. (line 6)
+* HANDLER_PARMS: Function Bodies. (line 6)
+* hard registers: Regs and Memory. (line 9)
+* HARD_FRAME_POINTER_REGNUM: Frame Registers. (line 20)
+* HARD_REGNO_CALL_PART_CLOBBERED: Register Basics. (line 53)
+* HARD_REGNO_CALLER_SAVE_MODE: Caller Saves. (line 20)
+* HARD_REGNO_MODE_OK: Values in Registers.
+ (line 58)
+* HARD_REGNO_NREGS: Values in Registers.
+ (line 11)
+* HARD_REGNO_NREGS_HAS_PADDING: Values in Registers.
+ (line 25)
+* HARD_REGNO_NREGS_WITH_PADDING: Values in Registers.
+ (line 43)
+* HARD_REGNO_RENAME_OK: Values in Registers.
+ (line 119)
+* HAS_INIT_SECTION: Macros for Initialization.
+ (line 19)
+* HAS_LONG_COND_BRANCH: Misc. (line 9)
+* HAS_LONG_UNCOND_BRANCH: Misc. (line 18)
+* HAVE_DOS_BASED_FILE_SYSTEM: Filesystem. (line 11)
+* HAVE_POST_DECREMENT: Addressing Modes. (line 12)
+* HAVE_POST_INCREMENT: Addressing Modes. (line 11)
+* HAVE_POST_MODIFY_DISP: Addressing Modes. (line 18)
+* HAVE_POST_MODIFY_REG: Addressing Modes. (line 24)
+* HAVE_PRE_DECREMENT: Addressing Modes. (line 10)
+* HAVE_PRE_INCREMENT: Addressing Modes. (line 9)
+* HAVE_PRE_MODIFY_DISP: Addressing Modes. (line 17)
+* HAVE_PRE_MODIFY_REG: Addressing Modes. (line 23)
+* HCmode: Machine Modes. (line 197)
+* HFmode: Machine Modes. (line 58)
+* high: Constants. (line 109)
+* HImode: Machine Modes. (line 29)
+* HImode, in insn: Insns. (line 231)
+* host configuration: Host Config. (line 6)
+* host functions: Host Common. (line 6)
+* host hooks: Host Common. (line 6)
+* host makefile fragment: Host Fragment. (line 6)
+* HOST_BIT_BUCKET: Filesystem. (line 51)
+* HOST_EXECUTABLE_SUFFIX: Filesystem. (line 45)
+* HOST_HOOKS_EXTRA_SIGNALS: Host Common. (line 12)
+* HOST_HOOKS_GT_PCH_ALLOC_GRANULARITY: Host Common. (line 45)
+* HOST_HOOKS_GT_PCH_USE_ADDRESS: Host Common. (line 26)
+* HOST_LACKS_INODE_NUMBERS: Filesystem. (line 89)
+* HOST_LONG_LONG_FORMAT: Host Misc. (line 41)
+* HOST_OBJECT_SUFFIX: Filesystem. (line 40)
+* HOST_WIDE_INT: Anchored Addresses. (line 33)
+* HOT_TEXT_SECTION_NAME: Sections. (line 43)
+* HQmode: Machine Modes. (line 107)
+* I in constraint: Simple Constraints. (line 71)
+* i in constraint: Simple Constraints. (line 60)
+* identifier: Identifiers. (line 6)
+* IDENTIFIER_LENGTH: Identifiers. (line 20)
+* IDENTIFIER_NODE: Identifiers. (line 6)
+* IDENTIFIER_OPNAME_P: Identifiers. (line 25)
+* IDENTIFIER_POINTER: Identifiers. (line 15)
+* IDENTIFIER_TYPENAME_P: Identifiers. (line 31)
+* IEEE 754-2008: Decimal float library routines.
+ (line 6)
+* IF_COND: Function Bodies. (line 6)
+* if_marked: GTY Options. (line 156)
+* IF_STMT: Function Bodies. (line 6)
+* if_then_else: Comparisons. (line 80)
+* if_then_else and attributes: Expressions. (line 32)
+* if_then_else usage: Side Effects. (line 56)
+* IFCVT_EXTRA_FIELDS: Misc. (line 627)
+* IFCVT_INIT_EXTRA_FIELDS: Misc. (line 622)
+* IFCVT_MODIFY_CANCEL: Misc. (line 616)
+* IFCVT_MODIFY_FINAL: Misc. (line 610)
+* IFCVT_MODIFY_INSN: Misc. (line 604)
+* IFCVT_MODIFY_MULTIPLE_TESTS: Misc. (line 597)
+* IFCVT_MODIFY_TESTS: Misc. (line 586)
+* IMAGPART_EXPR: Expression trees. (line 6)
+* Immediate Uses: SSA Operands. (line 274)
+* immediate_operand: Machine-Independent Predicates.
+ (line 11)
+* IMMEDIATE_PREFIX: Instruction Output. (line 127)
+* in_struct: Flags. (line 258)
+* in_struct, in code_label and note: Flags. (line 59)
+* in_struct, in insn and jump_insn and call_insn: Flags. (line 49)
+* in_struct, in insn, jump_insn and call_insn: Flags. (line 166)
+* in_struct, in mem: Flags. (line 70)
+* in_struct, in subreg: Flags. (line 205)
+* include: Including Patterns. (line 6)
+* INCLUDE_DEFAULTS: Driver. (line 430)
+* inclusive-or, bitwise: Arithmetic. (line 158)
+* INCOMING_FRAME_SP_OFFSET: Frame Layout. (line 183)
+* INCOMING_REGNO: Register Basics. (line 91)
+* INCOMING_RETURN_ADDR_RTX: Frame Layout. (line 139)
+* INCOMING_STACK_BOUNDARY: Storage Layout. (line 165)
+* INDEX_REG_CLASS: Register Classes. (line 134)
+* indirect_jump instruction pattern: Standard Names. (line 1078)
+* indirect_operand: Machine-Independent Predicates.
+ (line 71)
+* INDIRECT_REF: Expression trees. (line 6)
+* INIT_ARRAY_SECTION_ASM_OP: Sections. (line 98)
+* INIT_CUMULATIVE_ARGS: Register Arguments. (line 149)
+* INIT_CUMULATIVE_INCOMING_ARGS: Register Arguments. (line 177)
+* INIT_CUMULATIVE_LIBCALL_ARGS: Register Arguments. (line 170)
+* INIT_ENVIRONMENT: Driver. (line 369)
+* INIT_EXPANDERS: Per-Function Data. (line 39)
+* INIT_EXPR: Expression trees. (line 6)
+* init_machine_status: Per-Function Data. (line 45)
+* init_one_libfunc: Library Calls. (line 15)
+* INIT_SECTION_ASM_OP <1>: Macros for Initialization.
+ (line 10)
+* INIT_SECTION_ASM_OP: Sections. (line 82)
+* INITIAL_ELIMINATION_OFFSET: Elimination. (line 79)
+* INITIAL_FRAME_ADDRESS_RTX: Frame Layout. (line 83)
+* INITIAL_FRAME_POINTER_OFFSET: Elimination. (line 32)
+* initialization routines: Initialization. (line 6)
+* INITIALIZE_TRAMPOLINE: Trampolines. (line 55)
+* inlining: Target Attributes. (line 86)
+* insert_insn_on_edge: Maintaining the CFG.
+ (line 118)
+* insn: Insns. (line 63)
+* insn and /f: Flags. (line 125)
+* insn and /j: Flags. (line 175)
+* insn and /s: Flags. (line 49)
+* insn and /u: Flags. (line 39)
+* insn and /v: Flags. (line 44)
+* insn attributes: Insn Attributes. (line 6)
+* insn canonicalization: Insn Canonicalizations.
+ (line 6)
+* insn includes: Including Patterns. (line 6)
+* insn lengths, computing: Insn Lengths. (line 6)
+* insn splitting: Insn Splitting. (line 6)
+* insn-attr.h: Defining Attributes.
+ (line 24)
+* INSN_ANNULLED_BRANCH_P: Flags. (line 39)
+* INSN_CODE: Insns. (line 257)
+* INSN_DELETED_P: Flags. (line 44)
+* INSN_FROM_TARGET_P: Flags. (line 49)
+* insn_list: Insns. (line 505)
+* INSN_REFERENCES_ARE_DELAYED: Misc. (line 525)
+* INSN_SETS_ARE_DELAYED: Misc. (line 514)
+* INSN_UID: Insns. (line 23)
+* insns: Insns. (line 6)
+* insns, generating: RTL Template. (line 6)
+* insns, recognizing: RTL Template. (line 6)
+* instruction attributes: Insn Attributes. (line 6)
+* instruction latency time: Processor pipeline description.
+ (line 6)
+* instruction patterns: Patterns. (line 6)
+* instruction splitting: Insn Splitting. (line 6)
+* insv instruction pattern: Standard Names. (line 880)
+* int <1>: Run-time Target. (line 56)
+* int: Manipulating GIMPLE statements.
+ (line 66)
+* INT_TYPE_SIZE: Type Layout. (line 12)
+* INTEGER_CST: Expression trees. (line 6)
+* INTEGER_TYPE: Types. (line 6)
+* Interdependence of Patterns: Dependent Patterns. (line 6)
+* interfacing to GCC output: Interface. (line 6)
+* interlock delays: Processor pipeline description.
+ (line 6)
+* intermediate representation lowering: Parsing pass. (line 14)
+* INTMAX_TYPE: Type Layout. (line 213)
+* introduction: Top. (line 6)
+* INVOKE__main: Macros for Initialization.
+ (line 51)
+* ior: Arithmetic. (line 158)
+* ior and attributes: Expressions. (line 50)
+* ior, canonicalization of: Insn Canonicalizations.
+ (line 57)
+* iorM3 instruction pattern: Standard Names. (line 222)
+* IRA_COVER_CLASSES: Register Classes. (line 516)
+* IRA_HARD_REGNO_ADD_COST_MULTIPLIER: Allocation Order. (line 37)
+* IS_ASM_LOGICAL_LINE_SEPARATOR: Data Output. (line 120)
+* is_gimple_omp: GIMPLE_OMP_PARALLEL.
+ (line 65)
+* iterators in .md files: Iterators. (line 6)
+* IV analysis on GIMPLE: Scalar evolutions. (line 6)
+* IV analysis on RTL: loop-iv. (line 6)
+* jump: Flags. (line 309)
+* jump instruction pattern: Standard Names. (line 969)
+* jump instruction patterns: Jump Patterns. (line 6)
+* jump instructions and set: Side Effects. (line 56)
+* jump, in call_insn: Flags. (line 179)
+* jump, in insn: Flags. (line 175)
+* jump, in mem: Flags. (line 79)
+* JUMP_ALIGN: Alignment Output. (line 9)
+* jump_insn: Insns. (line 73)
+* jump_insn and /f: Flags. (line 125)
+* jump_insn and /s: Flags. (line 49)
+* jump_insn and /u: Flags. (line 39)
+* jump_insn and /v: Flags. (line 44)
+* JUMP_LABEL: Insns. (line 80)
+* JUMP_TABLES_IN_TEXT_SECTION: Sections. (line 142)
+* Jumps: Jumps. (line 6)
+* LABEL_ALIGN: Alignment Output. (line 52)
+* LABEL_ALIGN_AFTER_BARRIER: Alignment Output. (line 22)
+* LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP: Alignment Output. (line 30)
+* LABEL_ALIGN_MAX_SKIP: Alignment Output. (line 62)
+* LABEL_ALT_ENTRY_P: Insns. (line 140)
+* LABEL_ALTERNATE_NAME: Edges. (line 180)
+* LABEL_DECL: Declarations. (line 6)
+* LABEL_KIND: Insns. (line 140)
+* LABEL_NUSES: Insns. (line 136)
+* LABEL_PRESERVE_P: Flags. (line 59)
+* label_ref: Constants. (line 86)
+* label_ref and /v: Flags. (line 65)
+* label_ref, RTL sharing: Sharing. (line 35)
+* LABEL_REF_NONLOCAL_P: Flags. (line 65)
+* lang_hooks.gimplify_expr: Gimplification pass.
+ (line 18)
+* lang_hooks.parse_file: Parsing pass. (line 6)
+* language-independent intermediate representation: Parsing pass.
+ (line 14)
+* large return values: Aggregate Return. (line 6)
+* LARGEST_EXPONENT_IS_NORMAL: Storage Layout. (line 469)
+* LAST_STACK_REG: Stack Registers. (line 27)
+* LAST_VIRTUAL_REGISTER: Regs and Memory. (line 51)
+* lceilMN2: Standard Names. (line 597)
+* LCSSA: LCSSA. (line 6)
+* LD_FINI_SWITCH: Macros for Initialization.
+ (line 29)
+* LD_INIT_SWITCH: Macros for Initialization.
+ (line 25)
+* LDD_SUFFIX: Macros for Initialization.
+ (line 116)
+* le: Comparisons. (line 76)
+* le and attributes: Expressions. (line 64)
+* LE_EXPR: Expression trees. (line 6)
+* leaf functions: Leaf Functions. (line 6)
+* leaf_function_p: Standard Names. (line 1040)
+* LEAF_REG_REMAP: Leaf Functions. (line 39)
+* LEAF_REGISTERS: Leaf Functions. (line 25)
+* left rotate: Arithmetic. (line 190)
+* left shift: Arithmetic. (line 168)
+* LEGITIMATE_CONSTANT_P: Addressing Modes. (line 205)
+* LEGITIMATE_PIC_OPERAND_P: PIC. (line 31)
+* LEGITIMIZE_ADDRESS: Addressing Modes. (line 122)
+* LEGITIMIZE_RELOAD_ADDRESS: Addressing Modes. (line 145)
+* length: GTY Options. (line 50)
+* less than: Comparisons. (line 68)
+* less than or equal: Comparisons. (line 76)
+* leu: Comparisons. (line 76)
+* leu and attributes: Expressions. (line 64)
+* lfloorMN2: Standard Names. (line 592)
+* LIB2FUNCS_EXTRA: Target Fragment. (line 11)
+* LIB_SPEC: Driver. (line 170)
+* LIBCALL_VALUE: Scalar Return. (line 60)
+* libgcc.a: Library Calls. (line 6)
+* LIBGCC2_CFLAGS: Target Fragment. (line 8)
+* LIBGCC2_HAS_DF_MODE: Type Layout. (line 109)
+* LIBGCC2_HAS_TF_MODE: Type Layout. (line 123)
+* LIBGCC2_HAS_XF_MODE: Type Layout. (line 117)
+* LIBGCC2_LONG_DOUBLE_TYPE_SIZE: Type Layout. (line 103)
+* LIBGCC2_UNWIND_ATTRIBUTE: Misc. (line 937)
+* LIBGCC2_WORDS_BIG_ENDIAN: Storage Layout. (line 36)
+* LIBGCC_SPEC: Driver. (line 178)
+* library subroutine names: Library Calls. (line 6)
+* LIBRARY_PATH_ENV: Misc. (line 565)
+* LIMIT_RELOAD_CLASS: Register Classes. (line 239)
+* Linear loop transformations framework: Lambda. (line 6)
+* LINK_COMMAND_SPEC: Driver. (line 299)
+* LINK_EH_SPEC: Driver. (line 205)
+* LINK_ELIMINATE_DUPLICATE_LDIRECTORIES: Driver. (line 309)
+* LINK_GCC_C_SEQUENCE_SPEC: Driver. (line 295)
+* LINK_LIBGCC_SPECIAL_1: Driver. (line 290)
+* LINK_SPEC: Driver. (line 163)
+* linkage: Function Basics. (line 6)
+* list: Containers. (line 6)
+* Liveness representation: Liveness information.
+ (line 6)
+* lo_sum: Arithmetic. (line 24)
+* load address instruction: Simple Constraints. (line 154)
+* LOAD_EXTEND_OP: Misc. (line 69)
+* load_multiple instruction pattern: Standard Names. (line 137)
+* LOCAL_ALIGNMENT: Storage Layout. (line 254)
+* LOCAL_CLASS_P: Classes. (line 68)
+* LOCAL_DECL_ALIGNMENT: Storage Layout. (line 278)
+* LOCAL_INCLUDE_DIR: Driver. (line 376)
+* LOCAL_LABEL_PREFIX: Instruction Output. (line 125)
+* LOCAL_REGNO: Register Basics. (line 105)
+* LOG_LINKS: Insns. (line 276)
+* Logical Operators: Logical Operators. (line 6)
+* logical-and, bitwise: Arithmetic. (line 153)
+* logM2 instruction pattern: Standard Names. (line 505)
+* LONG_ACCUM_TYPE_SIZE: Type Layout. (line 93)
+* LONG_DOUBLE_TYPE_SIZE: Type Layout. (line 58)
+* LONG_FRACT_TYPE_SIZE: Type Layout. (line 73)
+* LONG_LONG_ACCUM_TYPE_SIZE: Type Layout. (line 98)
+* LONG_LONG_FRACT_TYPE_SIZE: Type Layout. (line 78)
+* LONG_LONG_TYPE_SIZE: Type Layout. (line 33)
+* LONG_TYPE_SIZE: Type Layout. (line 22)
+* longjmp and automatic variables: Interface. (line 52)
+* Loop analysis: Loop representation.
+ (line 6)
+* Loop manipulation: Loop manipulation. (line 6)
+* Loop querying: Loop querying. (line 6)
+* Loop representation: Loop representation.
+ (line 6)
+* Loop-closed SSA form: LCSSA. (line 6)
+* LOOP_ALIGN: Alignment Output. (line 35)
+* LOOP_ALIGN_MAX_SKIP: Alignment Output. (line 48)
+* LOOP_EXPR: Expression trees. (line 6)
+* looping instruction patterns: Looping Patterns. (line 6)
+* lowering, language-dependent intermediate representation: Parsing pass.
+ (line 14)
+* lrintMN2: Standard Names. (line 582)
+* lroundMN2: Standard Names. (line 587)
+* LSHIFT_EXPR: Expression trees. (line 6)
+* lshiftrt: Arithmetic. (line 185)
+* lshiftrt and attributes: Expressions. (line 64)
+* lshrM3 instruction pattern: Standard Names. (line 441)
+* lt: Comparisons. (line 68)
+* lt and attributes: Expressions. (line 64)
+* LT_EXPR: Expression trees. (line 6)
+* LTGT_EXPR: Expression trees. (line 6)
+* ltu: Comparisons. (line 68)
+* m in constraint: Simple Constraints. (line 17)
+* machine attributes: Target Attributes. (line 6)
+* machine description macros: Target Macros. (line 6)
+* machine descriptions: Machine Desc. (line 6)
+* machine mode conversions: Conversions. (line 6)
+* machine modes: Machine Modes. (line 6)
+* machine specific constraints: Machine Constraints.
+ (line 6)
+* machine-independent predicates: Machine-Independent Predicates.
+ (line 6)
+* machine_mode: Condition Code. (line 157)
+* macros, target description: Target Macros. (line 6)
+* maddMN4 instruction pattern: Standard Names. (line 364)
+* MAKE_DECL_ONE_ONLY: Label Output. (line 218)
+* make_phi_node: GIMPLE_PHI. (line 7)
+* make_safe_from: Expander Definitions.
+ (line 148)
+* makefile fragment: Fragments. (line 6)
+* makefile targets: Makefile. (line 6)
+* MALLOC_ABI_ALIGNMENT: Storage Layout. (line 179)
+* Manipulating GIMPLE statements: Manipulating GIMPLE statements.
+ (line 6)
+* mark_hook: GTY Options. (line 171)
+* marking roots: GGC Roots. (line 6)
+* MASK_RETURN_ADDR: Exception Region Output.
+ (line 35)
+* match_dup <1>: define_peephole2. (line 28)
+* match_dup: RTL Template. (line 73)
+* match_dup and attributes: Insn Lengths. (line 16)
+* match_op_dup: RTL Template. (line 163)
+* match_operand: RTL Template. (line 16)
+* match_operand and attributes: Expressions. (line 55)
+* match_operator: RTL Template. (line 95)
+* match_par_dup: RTL Template. (line 219)
+* match_parallel: RTL Template. (line 172)
+* match_scratch <1>: define_peephole2. (line 28)
+* match_scratch: RTL Template. (line 58)
+* matching constraint: Simple Constraints. (line 132)
+* matching operands: Output Template. (line 49)
+* math library: Soft float library routines.
+ (line 6)
+* math, in RTL: Arithmetic. (line 6)
+* MATH_LIBRARY: Misc. (line 558)
+* matherr: Library Calls. (line 58)
+* MAX_BITS_PER_WORD: Storage Layout. (line 61)
+* MAX_CONDITIONAL_EXECUTE: Misc. (line 580)
+* MAX_FIXED_MODE_SIZE: Storage Layout. (line 420)
+* MAX_MOVE_MAX: Misc. (line 120)
+* MAX_OFILE_ALIGNMENT: Storage Layout. (line 216)
+* MAX_REGS_PER_ADDRESS: Addressing Modes. (line 42)
+* MAX_STACK_ALIGNMENT: Storage Layout. (line 209)
+* maxM3 instruction pattern: Standard Names. (line 234)
+* may_trap_p, tree_could_trap_p: Edges. (line 115)
+* maybe_undef: GTY Options. (line 179)
+* mcount: Profiling. (line 12)
+* MD_CAN_REDIRECT_BRANCH: Misc. (line 705)
+* MD_EXEC_PREFIX: Driver. (line 330)
+* MD_FALLBACK_FRAME_STATE_FOR: Exception Handling. (line 98)
+* MD_HANDLE_UNWABI: Exception Handling. (line 118)
+* MD_STARTFILE_PREFIX: Driver. (line 358)
+* MD_STARTFILE_PREFIX_1: Driver. (line 364)
+* MD_UNWIND_SUPPORT: Exception Handling. (line 94)
+* mem: Regs and Memory. (line 374)
+* mem and /c: Flags. (line 99)
+* mem and /f: Flags. (line 103)
+* mem and /i: Flags. (line 85)
+* mem and /j: Flags. (line 79)
+* mem and /s: Flags. (line 70)
+* mem and /u: Flags. (line 152)
+* mem and /v: Flags. (line 94)
+* mem, RTL sharing: Sharing. (line 40)
+* MEM_ALIAS_SET: Special Accessors. (line 9)
+* MEM_ALIGN: Special Accessors. (line 36)
+* MEM_EXPR: Special Accessors. (line 20)
+* MEM_IN_STRUCT_P: Flags. (line 70)
+* MEM_KEEP_ALIAS_SET_P: Flags. (line 79)
+* MEM_NOTRAP_P: Flags. (line 99)
+* MEM_OFFSET: Special Accessors. (line 28)
+* MEM_POINTER: Flags. (line 103)
+* MEM_READONLY_P: Flags. (line 152)
+* MEM_SCALAR_P: Flags. (line 85)
+* MEM_SIZE: Special Accessors. (line 31)
+* MEM_VOLATILE_P: Flags. (line 94)
+* MEMBER_TYPE_FORCES_BLK: Storage Layout. (line 400)
+* memory reference, nonoffsettable: Simple Constraints. (line 246)
+* memory references in constraints: Simple Constraints. (line 17)
+* memory_barrier instruction pattern: Standard Names. (line 1413)
+* MEMORY_MOVE_COST: Costs. (line 29)
+* memory_operand: Machine-Independent Predicates.
+ (line 58)
+* METHOD_TYPE: Types. (line 6)
+* MIN_UNITS_PER_WORD: Storage Layout. (line 71)
+* MINIMUM_ALIGNMENT: Storage Layout. (line 288)
+* MINIMUM_ATOMIC_ALIGNMENT: Storage Layout. (line 187)
+* minM3 instruction pattern: Standard Names. (line 234)
+* minus: Arithmetic. (line 36)
+* minus and attributes: Expressions. (line 64)
+* minus, canonicalization of: Insn Canonicalizations.
+ (line 27)
+* MINUS_EXPR: Expression trees. (line 6)
+* MIPS coprocessor-definition macros: MIPS Coprocessors. (line 6)
+* mod: Arithmetic. (line 131)
+* mod and attributes: Expressions. (line 64)
+* mode classes: Machine Modes. (line 219)
+* mode iterators in .md files: Mode Iterators. (line 6)
+* mode switching: Mode Switching. (line 6)
+* MODE_ACCUM: Machine Modes. (line 249)
+* MODE_AFTER: Mode Switching. (line 49)
+* MODE_BASE_REG_CLASS: Register Classes. (line 112)
+* MODE_BASE_REG_REG_CLASS: Register Classes. (line 118)
+* MODE_CC: Machine Modes. (line 268)
+* MODE_CODE_BASE_REG_CLASS: Register Classes. (line 125)
+* MODE_COMPLEX_FLOAT: Machine Modes. (line 260)
+* MODE_COMPLEX_INT: Machine Modes. (line 257)
+* MODE_DECIMAL_FLOAT: Machine Modes. (line 237)
+* MODE_ENTRY: Mode Switching. (line 54)
+* MODE_EXIT: Mode Switching. (line 60)
+* MODE_FLOAT: Machine Modes. (line 233)
+* MODE_FRACT: Machine Modes. (line 241)
+* MODE_FUNCTION: Machine Modes. (line 264)
+* MODE_INT: Machine Modes. (line 225)
+* MODE_NEEDED: Mode Switching. (line 42)
+* MODE_PARTIAL_INT: Machine Modes. (line 229)
+* MODE_PRIORITY_TO_MODE: Mode Switching. (line 66)
+* MODE_RANDOM: Machine Modes. (line 273)
+* MODE_UACCUM: Machine Modes. (line 253)
+* MODE_UFRACT: Machine Modes. (line 245)
+* MODES_TIEABLE_P: Values in Registers.
+ (line 129)
+* modifiers in constraints: Modifiers. (line 6)
+* MODIFY_EXPR: Expression trees. (line 6)
+* MODIFY_JNI_METHOD_CALL: Misc. (line 782)
+* MODIFY_TARGET_NAME: Driver. (line 385)
+* modM3 instruction pattern: Standard Names. (line 222)
+* modulo scheduling: RTL passes. (line 131)
+* MOVE_BY_PIECES_P: Costs. (line 110)
+* MOVE_MAX: Misc. (line 115)
+* MOVE_MAX_PIECES: Costs. (line 116)
+* MOVE_RATIO: Costs. (line 97)
+* movM instruction pattern: Standard Names. (line 11)
+* movmemM instruction pattern: Standard Names. (line 672)
+* movmisalignM instruction pattern: Standard Names. (line 126)
+* movMODEcc instruction pattern: Standard Names. (line 891)
+* movstr instruction pattern: Standard Names. (line 707)
+* movstrictM instruction pattern: Standard Names. (line 120)
+* msubMN4 instruction pattern: Standard Names. (line 387)
+* mulhisi3 instruction pattern: Standard Names. (line 340)
+* mulM3 instruction pattern: Standard Names. (line 222)
+* mulqihi3 instruction pattern: Standard Names. (line 344)
+* mulsidi3 instruction pattern: Standard Names. (line 344)
+* mult: Arithmetic. (line 92)
+* mult and attributes: Expressions. (line 64)
+* mult, canonicalization of: Insn Canonicalizations.
+ (line 27)
+* MULT_EXPR: Expression trees. (line 6)
+* MULTILIB_DEFAULTS: Driver. (line 315)
+* MULTILIB_DIRNAMES: Target Fragment. (line 64)
+* MULTILIB_EXCEPTIONS: Target Fragment. (line 84)
+* MULTILIB_EXTRA_OPTS: Target Fragment. (line 96)
+* MULTILIB_MATCHES: Target Fragment. (line 77)
+* MULTILIB_OPTIONS: Target Fragment. (line 44)
+* multiple alternative constraints: Multi-Alternative. (line 6)
+* MULTIPLE_SYMBOL_SPACES: Misc. (line 538)
+* multiplication: Arithmetic. (line 92)
+* multiplication with signed saturation: Arithmetic. (line 92)
+* multiplication with unsigned saturation: Arithmetic. (line 92)
+* MUST_USE_SJLJ_EXCEPTIONS: Exception Region Output.
+ (line 64)
+* n in constraint: Simple Constraints. (line 65)
+* N_REG_CLASSES: Register Classes. (line 76)
+* name: Identifiers. (line 6)
+* named patterns and conditions: Patterns. (line 47)
+* names, pattern: Standard Names. (line 6)
+* namespace: Namespaces. (line 6)
+* namespace, class, scope: Scopes. (line 6)
+* NAMESPACE_DECL <1>: Declarations. (line 6)
+* NAMESPACE_DECL: Namespaces. (line 6)
+* NATIVE_SYSTEM_HEADER_DIR: Target Fragment. (line 103)
+* ne: Comparisons. (line 56)
+* ne and attributes: Expressions. (line 64)
+* NE_EXPR: Expression trees. (line 6)
+* nearbyintM2 instruction pattern: Standard Names. (line 564)
+* neg: Arithmetic. (line 81)
+* neg and attributes: Expressions. (line 64)
+* neg, canonicalization of: Insn Canonicalizations.
+ (line 27)
+* NEGATE_EXPR: Expression trees. (line 6)
+* negation: Arithmetic. (line 81)
+* negation with signed saturation: Arithmetic. (line 81)
+* negation with unsigned saturation: Arithmetic. (line 81)
+* negM2 instruction pattern: Standard Names. (line 449)
+* nested functions, trampolines for: Trampolines. (line 6)
+* nested_ptr: GTY Options. (line 186)
+* next_bb, prev_bb, FOR_EACH_BB: Basic Blocks. (line 10)
+* next_cc0_user: Jump Patterns. (line 64)
+* NEXT_INSN: Insns. (line 30)
+* NEXT_OBJC_RUNTIME: Library Calls. (line 94)
+* nil: RTL Objects. (line 73)
+* NO_DBX_BNSYM_ENSYM: DBX Hooks. (line 39)
+* NO_DBX_FUNCTION_END: DBX Hooks. (line 33)
+* NO_DBX_GCC_MARKER: File Names and DBX. (line 28)
+* NO_DBX_MAIN_SOURCE_DIRECTORY: File Names and DBX. (line 23)
+* NO_DOLLAR_IN_LABEL: Misc. (line 502)
+* NO_DOT_IN_LABEL: Misc. (line 508)
+* NO_FUNCTION_CSE: Costs. (line 200)
+* NO_IMPLICIT_EXTERN_C: Misc. (line 376)
+* NO_PROFILE_COUNTERS: Profiling. (line 28)
+* NO_REGS: Register Classes. (line 17)
+* NON_LVALUE_EXPR: Expression trees. (line 6)
+* nondeterministic finite state automaton: Processor pipeline description.
+ (line 296)
+* nonimmediate_operand: Machine-Independent Predicates.
+ (line 101)
+* nonlocal goto handler: Edges. (line 171)
+* nonlocal_goto instruction pattern: Standard Names. (line 1255)
+* nonlocal_goto_receiver instruction pattern: Standard Names.
+ (line 1272)
+* nonmemory_operand: Machine-Independent Predicates.
+ (line 97)
+* nonoffsettable memory reference: Simple Constraints. (line 246)
+* nop instruction pattern: Standard Names. (line 1073)
+* NOP_EXPR: Expression trees. (line 6)
+* normal predicates: Predicates. (line 31)
+* not: Arithmetic. (line 149)
+* not and attributes: Expressions. (line 50)
+* not equal: Comparisons. (line 56)
+* not, canonicalization of: Insn Canonicalizations.
+ (line 27)
+* note: Insns. (line 168)
+* note and /i: Flags. (line 59)
+* note and /v: Flags. (line 44)
+* NOTE_INSN_BASIC_BLOCK, CODE_LABEL, notes: Basic Blocks. (line 41)
+* NOTE_INSN_BLOCK_BEG: Insns. (line 193)
+* NOTE_INSN_BLOCK_END: Insns. (line 193)
+* NOTE_INSN_DELETED: Insns. (line 183)
+* NOTE_INSN_DELETED_LABEL: Insns. (line 188)
+* NOTE_INSN_EH_REGION_BEG: Insns. (line 199)
+* NOTE_INSN_EH_REGION_END: Insns. (line 199)
+* NOTE_INSN_FUNCTION_BEG: Insns. (line 223)
+* NOTE_INSN_LOOP_BEG: Insns. (line 207)
+* NOTE_INSN_LOOP_CONT: Insns. (line 213)
+* NOTE_INSN_LOOP_END: Insns. (line 207)
+* NOTE_INSN_LOOP_VTOP: Insns. (line 217)
+* NOTE_LINE_NUMBER: Insns. (line 168)
+* NOTE_SOURCE_FILE: Insns. (line 168)
+* NOTICE_UPDATE_CC: Condition Code. (line 33)
+* NUM_MACHINE_MODES: Machine Modes. (line 286)
+* NUM_MODES_FOR_MODE_SWITCHING: Mode Switching. (line 30)
+* Number of iterations analysis: Number of iterations.
+ (line 6)
+* o in constraint: Simple Constraints. (line 23)
+* OBJC_GEN_METHOD_LABEL: Label Output. (line 411)
+* OBJC_JBLEN: Misc. (line 932)
+* OBJECT_FORMAT_COFF: Macros for Initialization.
+ (line 97)
+* OFFSET_TYPE: Types. (line 6)
+* offsettable address: Simple Constraints. (line 23)
+* OImode: Machine Modes. (line 51)
+* Omega a solver for linear programming problems: Omega. (line 6)
+* OMP_ATOMIC: Expression trees. (line 6)
+* OMP_CLAUSE: Expression trees. (line 6)
+* OMP_CONTINUE: Expression trees. (line 6)
+* OMP_CRITICAL: Expression trees. (line 6)
+* OMP_FOR: Expression trees. (line 6)
+* OMP_MASTER: Expression trees. (line 6)
+* OMP_ORDERED: Expression trees. (line 6)
+* OMP_PARALLEL: Expression trees. (line 6)
+* OMP_RETURN: Expression trees. (line 6)
+* OMP_SECTION: Expression trees. (line 6)
+* OMP_SECTIONS: Expression trees. (line 6)
+* OMP_SINGLE: Expression trees. (line 6)
+* one_cmplM2 instruction pattern: Standard Names. (line 651)
+* operand access: Accessors. (line 6)
+* Operand Access Routines: SSA Operands. (line 119)
+* operand constraints: Constraints. (line 6)
+* Operand Iterators: SSA Operands. (line 119)
+* operand predicates: Predicates. (line 6)
+* operand substitution: Output Template. (line 6)
+* operands <1>: Patterns. (line 53)
+* operands: SSA Operands. (line 6)
+* Operands: Operands. (line 6)
+* operator predicates: Predicates. (line 6)
+* optc-gen.awk: Options. (line 6)
+* Optimization infrastructure for GIMPLE: Tree SSA. (line 6)
+* OPTIMIZATION_OPTIONS: Run-time Target. (line 120)
+* OPTIMIZE_MODE_SWITCHING: Mode Switching. (line 9)
+* option specification files: Options. (line 6)
+* OPTION_DEFAULT_SPECS: Driver. (line 88)
+* optional hardware or system features: Run-time Target. (line 59)
+* options, directory search: Including Patterns. (line 44)
+* order of register allocation: Allocation Order. (line 6)
+* ORDER_REGS_FOR_LOCAL_ALLOC: Allocation Order. (line 23)
+* ORDERED_EXPR: Expression trees. (line 6)
+* Ordering of Patterns: Pattern Ordering. (line 6)
+* ORIGINAL_REGNO: Special Accessors. (line 40)
+* other register constraints: Simple Constraints. (line 163)
+* OUTGOING_REG_PARM_STACK_SPACE: Stack Arguments. (line 71)
+* OUTGOING_REGNO: Register Basics. (line 98)
+* output of assembler code: File Framework. (line 6)
+* output statements: Output Statement. (line 6)
+* output templates: Output Template. (line 6)
+* OUTPUT_ADDR_CONST_EXTRA: Data Output. (line 39)
+* output_asm_insn: Output Statement. (line 53)
+* OUTPUT_QUOTED_STRING: File Framework. (line 76)
+* OVERLOAD: Functions. (line 6)
+* OVERRIDE_ABI_FORMAT: Register Arguments. (line 140)
+* OVERRIDE_OPTIONS: Run-time Target. (line 104)
+* OVL_CURRENT: Functions. (line 6)
+* OVL_NEXT: Functions. (line 6)
+* p in constraint: Simple Constraints. (line 154)
+* PAD_VARARGS_DOWN: Register Arguments. (line 221)
+* parallel: Side Effects. (line 204)
+* param_is: GTY Options. (line 114)
+* parameters, c++ abi: C++ ABI. (line 6)
+* parameters, miscellaneous: Misc. (line 6)
+* parameters, precompiled headers: PCH Target. (line 6)
+* paramN_is: GTY Options. (line 132)
+* parity: Arithmetic. (line 228)
+* parityM2 instruction pattern: Standard Names. (line 645)
+* PARM_BOUNDARY: Storage Layout. (line 144)
+* PARM_DECL: Declarations. (line 6)
+* PARSE_LDD_OUTPUT: Macros for Initialization.
+ (line 121)
+* passes and files of the compiler: Passes. (line 6)
+* passing arguments: Interface. (line 36)
+* PATH_SEPARATOR: Filesystem. (line 31)
+* PATTERN: Insns. (line 247)
+* pattern conditions: Patterns. (line 43)
+* pattern names: Standard Names. (line 6)
+* Pattern Ordering: Pattern Ordering. (line 6)
+* patterns: Patterns. (line 6)
+* pc: Regs and Memory. (line 361)
+* pc and attributes: Insn Lengths. (line 20)
+* pc, RTL sharing: Sharing. (line 25)
+* PC_REGNUM: Register Basics. (line 112)
+* pc_rtx: Regs and Memory. (line 366)
+* PCC_BITFIELD_TYPE_MATTERS: Storage Layout. (line 314)
+* PCC_STATIC_STRUCT_RETURN: Aggregate Return. (line 64)
+* PDImode: Machine Modes. (line 40)
+* peephole optimization, RTL representation: Side Effects. (line 238)
+* peephole optimizer definitions: Peephole Definitions.
+ (line 6)
+* per-function data: Per-Function Data. (line 6)
+* percent sign: Output Template. (line 6)
+* PHI nodes: SSA. (line 31)
+* phi_arg_d: GIMPLE_PHI. (line 28)
+* PHI_ARG_DEF: SSA. (line 71)
+* PHI_ARG_EDGE: SSA. (line 68)
+* PHI_ARG_ELT: SSA. (line 63)
+* PHI_NUM_ARGS: SSA. (line 59)
+* PHI_RESULT: SSA. (line 56)
+* PIC: PIC. (line 6)
+* PIC_OFFSET_TABLE_REG_CALL_CLOBBERED: PIC. (line 26)
+* PIC_OFFSET_TABLE_REGNUM: PIC. (line 16)
+* pipeline hazard recognizer: Processor pipeline description.
+ (line 6)
+* plus: Arithmetic. (line 14)
+* plus and attributes: Expressions. (line 64)
+* plus, canonicalization of: Insn Canonicalizations.
+ (line 27)
+* PLUS_EXPR: Expression trees. (line 6)
+* Pmode: Misc. (line 344)
+* pmode_register_operand: Machine-Independent Predicates.
+ (line 35)
+* pointer: Types. (line 6)
+* POINTER_PLUS_EXPR: Expression trees. (line 6)
+* POINTER_SIZE: Storage Layout. (line 83)
+* POINTER_TYPE: Types. (line 6)
+* POINTERS_EXTEND_UNSIGNED: Storage Layout. (line 89)
+* pop_operand: Machine-Independent Predicates.
+ (line 88)
+* popcount: Arithmetic. (line 224)
+* popcountM2 instruction pattern: Standard Names. (line 639)
+* portability: Portability. (line 6)
+* position independent code: PIC. (line 6)
+* post_dec: Incdec. (line 25)
+* post_inc: Incdec. (line 30)
+* post_modify: Incdec. (line 33)
+* POSTDECREMENT_EXPR: Expression trees. (line 6)
+* POSTINCREMENT_EXPR: Expression trees. (line 6)
+* POWI_MAX_MULTS: Misc. (line 830)
+* powM3 instruction pattern: Standard Names. (line 513)
+* pragma: Misc. (line 381)
+* pre_dec: Incdec. (line 8)
+* PRE_GCC3_DWARF_FRAME_REGISTERS: Frame Registers. (line 110)
+* pre_inc: Incdec. (line 22)
+* pre_modify: Incdec. (line 51)
+* PREDECREMENT_EXPR: Expression trees. (line 6)
+* predefined macros: Run-time Target. (line 6)
+* predicates: Predicates. (line 6)
+* predicates and machine modes: Predicates. (line 31)
+* predication: Conditional Execution.
+ (line 6)
+* predict.def: Profile information.
+ (line 24)
+* PREFERRED_DEBUGGING_TYPE: All Debuggers. (line 42)
+* PREFERRED_OUTPUT_RELOAD_CLASS: Register Classes. (line 231)
+* PREFERRED_RELOAD_CLASS: Register Classes. (line 196)
+* PREFERRED_STACK_BOUNDARY: Storage Layout. (line 158)
+* prefetch: Side Effects. (line 312)
+* prefetch instruction pattern: Standard Names. (line 1392)
+* PREINCREMENT_EXPR: Expression trees. (line 6)
+* presence_set: Processor pipeline description.
+ (line 215)
+* preserving SSA form: SSA. (line 76)
+* preserving virtual SSA form: SSA. (line 186)
+* prev_active_insn: define_peephole. (line 60)
+* prev_cc0_setter: Jump Patterns. (line 64)
+* PREV_INSN: Insns. (line 26)
+* PRINT_OPERAND: Instruction Output. (line 68)
+* PRINT_OPERAND_ADDRESS: Instruction Output. (line 96)
+* PRINT_OPERAND_PUNCT_VALID_P: Instruction Output. (line 89)
+* processor functional units: Processor pipeline description.
+ (line 6)
+* processor pipeline description: Processor pipeline description.
+ (line 6)
+* product: Arithmetic. (line 92)
+* profile feedback: Profile information.
+ (line 14)
+* profile representation: Profile information.
+ (line 6)
+* PROFILE_BEFORE_PROLOGUE: Profiling. (line 35)
+* PROFILE_HOOK: Profiling. (line 23)
+* profiling, code generation: Profiling. (line 6)
+* program counter: Regs and Memory. (line 362)
+* prologue: Function Entry. (line 6)
+* prologue instruction pattern: Standard Names. (line 1338)
+* PROMOTE_FUNCTION_MODE: Storage Layout. (line 123)
+* PROMOTE_MODE: Storage Layout. (line 100)
+* pseudo registers: Regs and Memory. (line 9)
+* PSImode: Machine Modes. (line 32)
+* PTRDIFF_TYPE: Type Layout. (line 184)
+* PTRMEM_CST: Expression trees. (line 6)
+* PTRMEM_CST_CLASS: Expression trees. (line 6)
+* PTRMEM_CST_MEMBER: Expression trees. (line 6)
+* purge_dead_edges <1>: Maintaining the CFG.
+ (line 93)
+* purge_dead_edges: Edges. (line 104)
+* push address instruction: Simple Constraints. (line 154)
+* PUSH_ARGS: Stack Arguments. (line 18)
+* PUSH_ARGS_REVERSED: Stack Arguments. (line 26)
+* push_operand: Machine-Independent Predicates.
+ (line 81)
+* push_reload: Addressing Modes. (line 169)
+* PUSH_ROUNDING: Stack Arguments. (line 32)
+* pushM1 instruction pattern: Standard Names. (line 209)
+* PUT_CODE: RTL Objects. (line 47)
+* PUT_MODE: Machine Modes. (line 283)
+* PUT_REG_NOTE_KIND: Insns. (line 309)
+* PUT_SDB_: SDB and DWARF. (line 63)
+* QCmode: Machine Modes. (line 197)
+* QFmode: Machine Modes. (line 54)
+* QImode: Machine Modes. (line 25)
+* QImode, in insn: Insns. (line 231)
+* QQmode: Machine Modes. (line 103)
+* qualified type: Types. (line 6)
+* querying function unit reservations: Processor pipeline description.
+ (line 90)
+* question mark: Multi-Alternative. (line 41)
+* quotient: Arithmetic. (line 111)
+* r in constraint: Simple Constraints. (line 56)
+* RANGE_TEST_NON_SHORT_CIRCUIT: Costs. (line 204)
+* RDIV_EXPR: Expression trees. (line 6)
+* READONLY_DATA_SECTION_ASM_OP: Sections. (line 63)
+* real operands: SSA Operands. (line 6)
+* REAL_ARITHMETIC: Floating Point. (line 66)
+* REAL_CST: Expression trees. (line 6)
+* REAL_LIBGCC_SPEC: Driver. (line 187)
+* REAL_NM_FILE_NAME: Macros for Initialization.
+ (line 106)
+* REAL_TYPE: Types. (line 6)
+* REAL_VALUE_ABS: Floating Point. (line 82)
+* REAL_VALUE_ATOF: Floating Point. (line 50)
+* REAL_VALUE_FIX: Floating Point. (line 41)
+* REAL_VALUE_FROM_INT: Floating Point. (line 99)
+* REAL_VALUE_ISINF: Floating Point. (line 59)
+* REAL_VALUE_ISNAN: Floating Point. (line 62)
+* REAL_VALUE_NEGATE: Floating Point. (line 79)
+* REAL_VALUE_NEGATIVE: Floating Point. (line 56)
+* REAL_VALUE_TO_INT: Floating Point. (line 93)
+* REAL_VALUE_TO_TARGET_DECIMAL128: Data Output. (line 144)
+* REAL_VALUE_TO_TARGET_DECIMAL32: Data Output. (line 142)
+* REAL_VALUE_TO_TARGET_DECIMAL64: Data Output. (line 143)
+* REAL_VALUE_TO_TARGET_DOUBLE: Data Output. (line 140)
+* REAL_VALUE_TO_TARGET_LONG_DOUBLE: Data Output. (line 141)
+* REAL_VALUE_TO_TARGET_SINGLE: Data Output. (line 139)
+* REAL_VALUE_TRUNCATE: Floating Point. (line 86)
+* REAL_VALUE_TYPE: Floating Point. (line 26)
+* REAL_VALUE_UNSIGNED_FIX: Floating Point. (line 45)
+* REAL_VALUES_EQUAL: Floating Point. (line 32)
+* REAL_VALUES_LESS: Floating Point. (line 38)
+* REALPART_EXPR: Expression trees. (line 6)
+* recog_data.operand: Instruction Output. (line 39)
+* recognizing insns: RTL Template. (line 6)
+* RECORD_TYPE <1>: Classes. (line 6)
+* RECORD_TYPE: Types. (line 6)
+* redirect_edge_and_branch: Profile information.
+ (line 71)
+* redirect_edge_and_branch, redirect_jump: Maintaining the CFG.
+ (line 103)
+* reduc_smax_M instruction pattern: Standard Names. (line 240)
+* reduc_smin_M instruction pattern: Standard Names. (line 240)
+* reduc_splus_M instruction pattern: Standard Names. (line 252)
+* reduc_umax_M instruction pattern: Standard Names. (line 246)
+* reduc_umin_M instruction pattern: Standard Names. (line 246)
+* reduc_uplus_M instruction pattern: Standard Names. (line 258)
+* reference: Types. (line 6)
+* REFERENCE_TYPE: Types. (line 6)
+* reg: Regs and Memory. (line 9)
+* reg and /f: Flags. (line 112)
+* reg and /i: Flags. (line 107)
+* reg and /v: Flags. (line 116)
+* reg, RTL sharing: Sharing. (line 17)
+* REG_ALLOC_ORDER: Allocation Order. (line 9)
+* REG_BR_PRED: Insns. (line 491)
+* REG_BR_PROB: Insns. (line 485)
+* REG_BR_PROB_BASE, BB_FREQ_BASE, count: Profile information.
+ (line 82)
+* REG_BR_PROB_BASE, EDGE_FREQUENCY: Profile information.
+ (line 52)
+* REG_CC_SETTER: Insns. (line 456)
+* REG_CC_USER: Insns. (line 456)
+* REG_CLASS_CONTENTS: Register Classes. (line 86)
+* reg_class_contents: Register Basics. (line 59)
+* REG_CLASS_FROM_CONSTRAINT: Old Constraints. (line 35)
+* REG_CLASS_FROM_LETTER: Old Constraints. (line 27)
+* REG_CLASS_NAMES: Register Classes. (line 81)
+* REG_CROSSING_JUMP: Insns. (line 368)
+* REG_DEAD: Insns. (line 320)
+* REG_DEAD, REG_UNUSED: Liveness information.
+ (line 32)
+* REG_DEP_ANTI: Insns. (line 478)
+* REG_DEP_OUTPUT: Insns. (line 474)
+* REG_DEP_TRUE: Insns. (line 471)
+* REG_EH_REGION, EDGE_ABNORMAL_CALL: Edges. (line 110)
+* REG_EQUAL: Insns. (line 384)
+* REG_EQUIV: Insns. (line 384)
+* REG_EXPR: Special Accessors. (line 46)
+* REG_FRAME_RELATED_EXPR: Insns. (line 497)
+* REG_FUNCTION_VALUE_P: Flags. (line 107)
+* REG_INC: Insns. (line 336)
+* reg_label and /v: Flags. (line 65)
+* REG_LABEL_OPERAND: Insns. (line 350)
+* REG_LABEL_TARGET: Insns. (line 359)
+* reg_names <1>: Instruction Output. (line 80)
+* reg_names: Register Basics. (line 59)
+* REG_NONNEG: Insns. (line 342)
+* REG_NOTE_KIND: Insns. (line 309)
+* REG_NOTES: Insns. (line 283)
+* REG_OFFSET: Special Accessors. (line 50)
+* REG_OK_STRICT: Addressing Modes. (line 67)
+* REG_PARM_STACK_SPACE: Stack Arguments. (line 56)
+* REG_PARM_STACK_SPACE, and FUNCTION_ARG: Register Arguments.
+ (line 52)
+* REG_POINTER: Flags. (line 112)
+* REG_SETJMP: Insns. (line 378)
+* REG_UNUSED: Insns. (line 329)
+* REG_USERVAR_P: Flags. (line 116)
+* regclass_for_constraint: C Constraint Interface.
+ (line 60)
+* register allocation order: Allocation Order. (line 6)
+* register class definitions: Register Classes. (line 6)
+* register class preference constraints: Class Preferences. (line 6)
+* register pairs: Values in Registers.
+ (line 69)
+* Register Transfer Language (RTL): RTL. (line 6)
+* register usage: Registers. (line 6)
+* REGISTER_MOVE_COST: Costs. (line 10)
+* REGISTER_NAMES: Instruction Output. (line 9)
+* register_operand: Machine-Independent Predicates.
+ (line 30)
+* REGISTER_PREFIX: Instruction Output. (line 124)
+* REGISTER_TARGET_PRAGMAS: Misc. (line 382)
+* registers arguments: Register Arguments. (line 6)
+* registers in constraints: Simple Constraints. (line 56)
+* REGMODE_NATURAL_SIZE: Values in Registers.
+ (line 50)
+* REGNO_MODE_CODE_OK_FOR_BASE_P: Register Classes. (line 170)
+* REGNO_MODE_OK_FOR_BASE_P: Register Classes. (line 146)
+* REGNO_MODE_OK_FOR_REG_BASE_P: Register Classes. (line 157)
+* REGNO_OK_FOR_BASE_P: Register Classes. (line 140)
+* REGNO_OK_FOR_INDEX_P: Register Classes. (line 181)
+* REGNO_REG_CLASS: Register Classes. (line 101)
+* regs_ever_live: Function Entry. (line 21)
+* regular expressions: Processor pipeline description.
+ (line 6)
+* relative costs: Costs. (line 6)
+* RELATIVE_PREFIX_NOT_LINKDIR: Driver. (line 325)
+* reload_completed: Standard Names. (line 1040)
+* reload_in instruction pattern: Standard Names. (line 99)
+* reload_in_progress: Standard Names. (line 57)
+* reload_out instruction pattern: Standard Names. (line 99)
+* reloading: RTL passes. (line 182)
+* remainder: Arithmetic. (line 131)
+* remainderM3 instruction pattern: Standard Names. (line 472)
+* reorder: GTY Options. (line 210)
+* representation of RTL: RTL. (line 6)
+* reservation delays: Processor pipeline description.
+ (line 6)
+* rest_of_decl_compilation: Parsing pass. (line 52)
+* rest_of_type_compilation: Parsing pass. (line 52)
+* restore_stack_block instruction pattern: Standard Names. (line 1174)
+* restore_stack_function instruction pattern: Standard Names.
+ (line 1174)
+* restore_stack_nonlocal instruction pattern: Standard Names.
+ (line 1174)
+* RESULT_DECL: Declarations. (line 6)
+* return: Side Effects. (line 72)
+* return instruction pattern: Standard Names. (line 1027)
+* return values in registers: Scalar Return. (line 6)
+* RETURN_ADDR_IN_PREVIOUS_FRAME: Frame Layout. (line 135)
+* RETURN_ADDR_OFFSET: Exception Handling. (line 60)
+* RETURN_ADDR_RTX: Frame Layout. (line 124)
+* RETURN_ADDRESS_POINTER_REGNUM: Frame Registers. (line 51)
+* RETURN_EXPR: Function Bodies. (line 6)
+* RETURN_POPS_ARGS: Stack Arguments. (line 90)
+* RETURN_STMT: Function Bodies. (line 6)
+* return_val: Flags. (line 294)
+* return_val, in call_insn: Flags. (line 24)
+* return_val, in mem: Flags. (line 85)
+* return_val, in reg: Flags. (line 107)
+* return_val, in symbol_ref: Flags. (line 220)
+* returning aggregate values: Aggregate Return. (line 6)
+* returning structures and unions: Interface. (line 10)
+* reverse probability: Profile information.
+ (line 66)
+* REVERSE_CONDEXEC_PREDICATES_P: Condition Code. (line 129)
+* REVERSE_CONDITION: Condition Code. (line 116)
+* REVERSIBLE_CC_MODE: Condition Code. (line 102)
+* right rotate: Arithmetic. (line 190)
+* right shift: Arithmetic. (line 185)
+* rintM2 instruction pattern: Standard Names. (line 572)
+* RISC: Processor pipeline description.
+ (line 6)
+* roots, marking: GGC Roots. (line 6)
+* rotate: Arithmetic. (line 190)
+* rotatert: Arithmetic. (line 190)
+* rotlM3 instruction pattern: Standard Names. (line 441)
+* rotrM3 instruction pattern: Standard Names. (line 441)
+* ROUND_DIV_EXPR: Expression trees. (line 6)
+* ROUND_MOD_EXPR: Expression trees. (line 6)
+* ROUND_TOWARDS_ZERO: Storage Layout. (line 460)
+* ROUND_TYPE_ALIGN: Storage Layout. (line 411)
+* roundM2 instruction pattern: Standard Names. (line 548)
+* RSHIFT_EXPR: Expression trees. (line 6)
+* RTL addition: Arithmetic. (line 14)
+* RTL addition with signed saturation: Arithmetic. (line 14)
+* RTL addition with unsigned saturation: Arithmetic. (line 14)
+* RTL classes: RTL Classes. (line 6)
+* RTL comparison: Arithmetic. (line 43)
+* RTL comparison operations: Comparisons. (line 6)
+* RTL constant expression types: Constants. (line 6)
+* RTL constants: Constants. (line 6)
+* RTL declarations: RTL Declarations. (line 6)
+* RTL difference: Arithmetic. (line 36)
+* RTL expression: RTL Objects. (line 6)
+* RTL expressions for arithmetic: Arithmetic. (line 6)
+* RTL format: RTL Classes. (line 71)
+* RTL format characters: RTL Classes. (line 76)
+* RTL function-call insns: Calls. (line 6)
+* RTL insn template: RTL Template. (line 6)
+* RTL integers: RTL Objects. (line 6)
+* RTL memory expressions: Regs and Memory. (line 6)
+* RTL object types: RTL Objects. (line 6)
+* RTL postdecrement: Incdec. (line 6)
+* RTL postincrement: Incdec. (line 6)
+* RTL predecrement: Incdec. (line 6)
+* RTL preincrement: Incdec. (line 6)
+* RTL register expressions: Regs and Memory. (line 6)
+* RTL representation: RTL. (line 6)
+* RTL side effect expressions: Side Effects. (line 6)
+* RTL strings: RTL Objects. (line 6)
+* RTL structure sharing assumptions: Sharing. (line 6)
+* RTL subtraction: Arithmetic. (line 36)
+* RTL subtraction with signed saturation: Arithmetic. (line 36)
+* RTL subtraction with unsigned saturation: Arithmetic. (line 36)
+* RTL sum: Arithmetic. (line 14)
+* RTL vectors: RTL Objects. (line 6)
+* RTL_CONST_CALL_P: Flags. (line 19)
+* RTL_CONST_OR_PURE_CALL_P: Flags. (line 29)
+* RTL_LOOPING_CONST_OR_PURE_CALL_P: Flags. (line 33)
+* RTL_PURE_CALL_P: Flags. (line 24)
+* RTX (See RTL): RTL Objects. (line 6)
+* RTX codes, classes of: RTL Classes. (line 6)
+* RTX_FRAME_RELATED_P: Flags. (line 125)
+* run-time conventions: Interface. (line 6)
+* run-time target specification: Run-time Target. (line 6)
+* s in constraint: Simple Constraints. (line 92)
+* same_type_p: Types. (line 148)
+* SAmode: Machine Modes. (line 148)
+* sat_fract: Conversions. (line 90)
+* satfractMN2 instruction pattern: Standard Names. (line 843)
+* satfractunsMN2 instruction pattern: Standard Names. (line 856)
+* satisfies_constraint_: C Constraint Interface.
+ (line 47)
+* SAVE_EXPR: Expression trees. (line 6)
+* save_stack_block instruction pattern: Standard Names. (line 1174)
+* save_stack_function instruction pattern: Standard Names. (line 1174)
+* save_stack_nonlocal instruction pattern: Standard Names. (line 1174)
+* SBSS_SECTION_ASM_OP: Sections. (line 77)
+* Scalar evolutions: Scalar evolutions. (line 6)
+* scalars, returned as values: Scalar Return. (line 6)
+* SCHED_GROUP_P: Flags. (line 166)
+* SCmode: Machine Modes. (line 197)
+* sCOND instruction pattern: Standard Names. (line 911)
+* scratch: Regs and Memory. (line 298)
+* scratch operands: Regs and Memory. (line 298)
+* scratch, RTL sharing: Sharing. (line 35)
+* scratch_operand: Machine-Independent Predicates.
+ (line 50)
+* SDATA_SECTION_ASM_OP: Sections. (line 58)
+* SDB_ALLOW_FORWARD_REFERENCES: SDB and DWARF. (line 81)
+* SDB_ALLOW_UNKNOWN_REFERENCES: SDB and DWARF. (line 76)
+* SDB_DEBUGGING_INFO: SDB and DWARF. (line 9)
+* SDB_DELIM: SDB and DWARF. (line 69)
+* SDB_OUTPUT_SOURCE_LINE: SDB and DWARF. (line 86)
+* SDmode: Machine Modes. (line 85)
+* sdot_prodM instruction pattern: Standard Names. (line 264)
+* search options: Including Patterns. (line 44)
+* SECONDARY_INPUT_RELOAD_CLASS: Register Classes. (line 335)
+* SECONDARY_MEMORY_NEEDED: Register Classes. (line 391)
+* SECONDARY_MEMORY_NEEDED_MODE: Register Classes. (line 410)
+* SECONDARY_MEMORY_NEEDED_RTX: Register Classes. (line 401)
+* SECONDARY_OUTPUT_RELOAD_CLASS: Register Classes. (line 336)
+* SECONDARY_RELOAD_CLASS: Register Classes. (line 334)
+* SELECT_CC_MODE: Condition Code. (line 68)
+* sequence: Side Effects. (line 254)
+* Sequence iterators: Sequence iterators. (line 6)
+* set: Side Effects. (line 15)
+* set and /f: Flags. (line 125)
+* SET_ASM_OP: Label Output. (line 378)
+* set_attr: Tagging Insns. (line 31)
+* set_attr_alternative: Tagging Insns. (line 49)
+* set_bb_seq: GIMPLE sequences. (line 76)
+* SET_BY_PIECES_P: Costs. (line 145)
+* SET_DEST: Side Effects. (line 69)
+* SET_IS_RETURN_P: Flags. (line 175)
+* SET_LABEL_KIND: Insns. (line 140)
+* set_optab_libfunc: Library Calls. (line 15)
+* SET_RATIO: Costs. (line 136)
+* SET_SRC: Side Effects. (line 69)
+* SET_TYPE_STRUCTURAL_EQUALITY: Types. (line 6)
+* setmemM instruction pattern: Standard Names. (line 715)
+* SETUP_FRAME_ADDRESSES: Frame Layout. (line 102)
+* SF_SIZE: Type Layout. (line 129)
+* SFmode: Machine Modes. (line 66)
+* sharing of RTL components: Sharing. (line 6)
+* shift: Arithmetic. (line 168)
+* SHIFT_COUNT_TRUNCATED: Misc. (line 127)
+* SHLIB_SUFFIX: Macros for Initialization.
+ (line 129)
+* SHORT_ACCUM_TYPE_SIZE: Type Layout. (line 83)
+* SHORT_FRACT_TYPE_SIZE: Type Layout. (line 63)
+* SHORT_IMMEDIATES_SIGN_EXTEND: Misc. (line 96)
+* SHORT_TYPE_SIZE: Type Layout. (line 16)
+* sibcall_epilogue instruction pattern: Standard Names. (line 1364)
+* sibling call: Edges. (line 122)
+* SIBLING_CALL_P: Flags. (line 179)
+* sign_extend: Conversions. (line 23)
+* sign_extract: Bit-Fields. (line 8)
+* sign_extract, canonicalization of: Insn Canonicalizations.
+ (line 96)
+* signed division: Arithmetic. (line 111)
+* signed division with signed saturation: Arithmetic. (line 111)
+* signed maximum: Arithmetic. (line 136)
+* signed minimum: Arithmetic. (line 136)
+* SImode: Machine Modes. (line 37)
+* simple constraints: Simple Constraints. (line 6)
+* sincos math function, implicit usage: Library Calls. (line 84)
+* sinM2 instruction pattern: Standard Names. (line 489)
+* SIZE_ASM_OP: Label Output. (line 23)
+* SIZE_TYPE: Type Layout. (line 168)
+* skip: GTY Options. (line 77)
+* SLOW_BYTE_ACCESS: Costs. (line 66)
+* SLOW_UNALIGNED_ACCESS: Costs. (line 81)
+* SMALL_REGISTER_CLASSES: Register Classes. (line 433)
+* smax: Arithmetic. (line 136)
+* smin: Arithmetic. (line 136)
+* sms, swing, software pipelining: RTL passes. (line 131)
+* smulM3_highpart instruction pattern: Standard Names. (line 356)
+* soft float library: Soft float library routines.
+ (line 6)
+* special: GTY Options. (line 230)
+* special predicates: Predicates. (line 31)
+* SPECS: Target Fragment. (line 108)
+* speed of instructions: Costs. (line 6)
+* split_block: Maintaining the CFG.
+ (line 110)
+* splitting instructions: Insn Splitting. (line 6)
+* SQmode: Machine Modes. (line 111)
+* sqrt: Arithmetic. (line 198)
+* sqrtM2 instruction pattern: Standard Names. (line 455)
+* square root: Arithmetic. (line 198)
+* ss_ashift: Arithmetic. (line 168)
+* ss_div: Arithmetic. (line 111)
+* ss_minus: Arithmetic. (line 36)
+* ss_mult: Arithmetic. (line 92)
+* ss_neg: Arithmetic. (line 81)
+* ss_plus: Arithmetic. (line 14)
+* ss_truncate: Conversions. (line 43)
+* SSA: SSA. (line 6)
+* SSA_NAME_DEF_STMT: SSA. (line 221)
+* SSA_NAME_VERSION: SSA. (line 226)
+* ssaddM3 instruction pattern: Standard Names. (line 222)
+* ssashlM3 instruction pattern: Standard Names. (line 431)
+* ssdivM3 instruction pattern: Standard Names. (line 222)
+* ssmaddMN4 instruction pattern: Standard Names. (line 379)
+* ssmsubMN4 instruction pattern: Standard Names. (line 403)
+* ssmulM3 instruction pattern: Standard Names. (line 222)
+* ssnegM2 instruction pattern: Standard Names. (line 449)
+* sssubM3 instruction pattern: Standard Names. (line 222)
+* ssum_widenM3 instruction pattern: Standard Names. (line 274)
+* stack arguments: Stack Arguments. (line 6)
+* stack frame layout: Frame Layout. (line 6)
+* stack smashing protection: Stack Smashing Protection.
+ (line 6)
+* STACK_ALIGNMENT_NEEDED: Frame Layout. (line 48)
+* STACK_BOUNDARY: Storage Layout. (line 150)
+* STACK_CHECK_BUILTIN: Stack Checking. (line 32)
+* STACK_CHECK_FIXED_FRAME_SIZE: Stack Checking. (line 77)
+* STACK_CHECK_MAX_FRAME_SIZE: Stack Checking. (line 68)
+* STACK_CHECK_MAX_VAR_SIZE: Stack Checking. (line 84)
+* STACK_CHECK_PROBE_INTERVAL: Stack Checking. (line 46)
+* STACK_CHECK_PROBE_LOAD: Stack Checking. (line 53)
+* STACK_CHECK_PROTECT: Stack Checking. (line 59)
+* STACK_CHECK_STATIC_BUILTIN: Stack Checking. (line 39)
+* STACK_DYNAMIC_OFFSET: Frame Layout. (line 75)
+* STACK_DYNAMIC_OFFSET and virtual registers: Regs and Memory.
+ (line 83)
+* STACK_GROWS_DOWNWARD: Frame Layout. (line 9)
+* STACK_PARMS_IN_REG_PARM_AREA: Stack Arguments. (line 81)
+* STACK_POINTER_OFFSET: Frame Layout. (line 58)
+* STACK_POINTER_OFFSET and virtual registers: Regs and Memory.
+ (line 93)
+* STACK_POINTER_REGNUM: Frame Registers. (line 9)
+* STACK_POINTER_REGNUM and virtual registers: Regs and Memory.
+ (line 83)
+* stack_pointer_rtx: Frame Registers. (line 85)
+* stack_protect_set instruction pattern: Standard Names. (line 1534)
+* stack_protect_test instruction pattern: Standard Names. (line 1544)
+* STACK_PUSH_CODE: Frame Layout. (line 17)
+* STACK_REGS: Stack Registers. (line 20)
+* STACK_SAVEAREA_MODE: Storage Layout. (line 427)
+* STACK_SIZE_MODE: Storage Layout. (line 439)
+* STACK_SLOT_ALIGNMENT: Storage Layout. (line 265)
+* standard pattern names: Standard Names. (line 6)
+* STANDARD_INCLUDE_COMPONENT: Driver. (line 425)
+* STANDARD_INCLUDE_DIR: Driver. (line 417)
+* STANDARD_STARTFILE_PREFIX: Driver. (line 337)
+* STANDARD_STARTFILE_PREFIX_1: Driver. (line 344)
+* STANDARD_STARTFILE_PREFIX_2: Driver. (line 351)
+* STARTFILE_SPEC: Driver. (line 210)
+* STARTING_FRAME_OFFSET: Frame Layout. (line 39)
+* STARTING_FRAME_OFFSET and virtual registers: Regs and Memory.
+ (line 74)
+* Statement and operand traversals: Statement and operand traversals.
+ (line 6)
+* Statement Sequences: Statement Sequences.
+ (line 6)
+* Statements: Statements. (line 6)
+* statements: Function Bodies. (line 6)
+* Static profile estimation: Profile information.
+ (line 24)
+* static single assignment: SSA. (line 6)
+* STATIC_CHAIN: Frame Registers. (line 77)
+* STATIC_CHAIN_INCOMING: Frame Registers. (line 78)
+* STATIC_CHAIN_INCOMING_REGNUM: Frame Registers. (line 64)
+* STATIC_CHAIN_REGNUM: Frame Registers. (line 63)
+* stdarg.h and register arguments: Register Arguments. (line 47)
+* STDC_0_IN_SYSTEM_HEADERS: Misc. (line 365)
+* STMT_EXPR: Expression trees. (line 6)
+* STMT_IS_FULL_EXPR_P: Function Bodies. (line 22)
+* storage layout: Storage Layout. (line 6)
+* STORE_BY_PIECES_P: Costs. (line 152)
+* STORE_FLAG_VALUE: Misc. (line 216)
+* store_multiple instruction pattern: Standard Names. (line 160)
+* strcpy: Storage Layout. (line 235)
+* STRICT_ALIGNMENT: Storage Layout. (line 309)
+* strict_low_part: RTL Declarations. (line 9)
+* strict_memory_address_p: Addressing Modes. (line 179)
+* STRING_CST: Expression trees. (line 6)
+* STRING_POOL_ADDRESS_P: Flags. (line 183)
+* strlenM instruction pattern: Standard Names. (line 778)
+* structure value address: Aggregate Return. (line 6)
+* STRUCTURE_SIZE_BOUNDARY: Storage Layout. (line 301)
+* structures, returning: Interface. (line 10)
+* subM3 instruction pattern: Standard Names. (line 222)
+* SUBOBJECT: Function Bodies. (line 6)
+* SUBOBJECT_CLEANUP: Function Bodies. (line 6)
+* subreg: Regs and Memory. (line 97)
+* subreg and /s: Flags. (line 205)
+* subreg and /u: Flags. (line 198)
+* subreg and /u and /v: Flags. (line 188)
+* subreg, in strict_low_part: RTL Declarations. (line 9)
+* SUBREG_BYTE: Regs and Memory. (line 289)
+* SUBREG_PROMOTED_UNSIGNED_P: Flags. (line 188)
+* SUBREG_PROMOTED_UNSIGNED_SET: Flags. (line 198)
+* SUBREG_PROMOTED_VAR_P: Flags. (line 205)
+* SUBREG_REG: Regs and Memory. (line 289)
+* SUCCESS_EXIT_CODE: Host Misc. (line 12)
+* SUPPORTS_INIT_PRIORITY: Macros for Initialization.
+ (line 58)
+* SUPPORTS_ONE_ONLY: Label Output. (line 227)
+* SUPPORTS_WEAK: Label Output. (line 208)
+* SWITCH_BODY: Function Bodies. (line 6)
+* SWITCH_COND: Function Bodies. (line 6)
+* SWITCH_CURTAILS_COMPILATION: Driver. (line 33)
+* SWITCH_STMT: Function Bodies. (line 6)
+* SWITCH_TAKES_ARG: Driver. (line 9)
+* SWITCHES_NEED_SPACES: Driver. (line 47)
+* SYMBOL_FLAG_ANCHOR: Special Accessors. (line 106)
+* SYMBOL_FLAG_EXTERNAL: Special Accessors. (line 88)
+* SYMBOL_FLAG_FUNCTION: Special Accessors. (line 81)
+* SYMBOL_FLAG_HAS_BLOCK_INFO: Special Accessors. (line 102)
+* SYMBOL_FLAG_LOCAL: Special Accessors. (line 84)
+* SYMBOL_FLAG_SMALL: Special Accessors. (line 93)
+* SYMBOL_FLAG_TLS_SHIFT: Special Accessors. (line 97)
+* symbol_ref: Constants. (line 76)
+* symbol_ref and /f: Flags. (line 183)
+* symbol_ref and /i: Flags. (line 220)
+* symbol_ref and /u: Flags. (line 10)
+* symbol_ref and /v: Flags. (line 224)
+* symbol_ref, RTL sharing: Sharing. (line 20)
+* SYMBOL_REF_ANCHOR_P: Special Accessors. (line 106)
+* SYMBOL_REF_BLOCK: Special Accessors. (line 119)
+* SYMBOL_REF_BLOCK_OFFSET: Special Accessors. (line 124)
+* SYMBOL_REF_CONSTANT: Special Accessors. (line 67)
+* SYMBOL_REF_DATA: Special Accessors. (line 71)
+* SYMBOL_REF_DECL: Special Accessors. (line 55)
+* SYMBOL_REF_EXTERNAL_P: Special Accessors. (line 88)
+* SYMBOL_REF_FLAG: Flags. (line 224)
+* SYMBOL_REF_FLAG, in TARGET_ENCODE_SECTION_INFO: Sections. (line 259)
+* SYMBOL_REF_FLAGS: Special Accessors. (line 75)
+* SYMBOL_REF_FUNCTION_P: Special Accessors. (line 81)
+* SYMBOL_REF_HAS_BLOCK_INFO_P: Special Accessors. (line 102)
+* SYMBOL_REF_LOCAL_P: Special Accessors. (line 84)
+* SYMBOL_REF_SMALL_P: Special Accessors. (line 93)
+* SYMBOL_REF_TLS_MODEL: Special Accessors. (line 97)
+* SYMBOL_REF_USED: Flags. (line 215)
+* SYMBOL_REF_WEAK: Flags. (line 220)
+* symbolic label: Sharing. (line 20)
+* sync_addMODE instruction pattern: Standard Names. (line 1450)
+* sync_andMODE instruction pattern: Standard Names. (line 1450)
+* sync_compare_and_swap_ccMODE instruction pattern: Standard Names.
+ (line 1437)
+* sync_compare_and_swapMODE instruction pattern: Standard Names.
+ (line 1419)
+* sync_iorMODE instruction pattern: Standard Names. (line 1450)
+* sync_lock_releaseMODE instruction pattern: Standard Names. (line 1515)
+* sync_lock_test_and_setMODE instruction pattern: Standard Names.
+ (line 1489)
+* sync_nandMODE instruction pattern: Standard Names. (line 1450)
+* sync_new_addMODE instruction pattern: Standard Names. (line 1482)
+* sync_new_andMODE instruction pattern: Standard Names. (line 1482)
+* sync_new_iorMODE instruction pattern: Standard Names. (line 1482)
+* sync_new_nandMODE instruction pattern: Standard Names. (line 1482)
+* sync_new_subMODE instruction pattern: Standard Names. (line 1482)
+* sync_new_xorMODE instruction pattern: Standard Names. (line 1482)
+* sync_old_addMODE instruction pattern: Standard Names. (line 1465)
+* sync_old_andMODE instruction pattern: Standard Names. (line 1465)
+* sync_old_iorMODE instruction pattern: Standard Names. (line 1465)
+* sync_old_nandMODE instruction pattern: Standard Names. (line 1465)
+* sync_old_subMODE instruction pattern: Standard Names. (line 1465)
+* sync_old_xorMODE instruction pattern: Standard Names. (line 1465)
+* sync_subMODE instruction pattern: Standard Names. (line 1450)
+* sync_xorMODE instruction pattern: Standard Names. (line 1450)
+* SYSROOT_HEADERS_SUFFIX_SPEC: Driver. (line 239)
+* SYSROOT_SUFFIX_SPEC: Driver. (line 234)
+* SYSTEM_INCLUDE_DIR: Driver. (line 408)
+* t-TARGET: Target Fragment. (line 6)
+* table jump: Basic Blocks. (line 57)
+* tablejump instruction pattern: Standard Names. (line 1102)
+* tag: GTY Options. (line 82)
+* tagging insns: Tagging Insns. (line 6)
+* tail calls: Tail Calls. (line 6)
+* TAmode: Machine Modes. (line 156)
+* target attributes: Target Attributes. (line 6)
+* target description macros: Target Macros. (line 6)
+* target functions: Target Structure. (line 6)
+* target hooks: Target Structure. (line 6)
+* target makefile fragment: Target Fragment. (line 6)
+* target specifications: Run-time Target. (line 6)
+* TARGET_ADDRESS_COST: Costs. (line 236)
+* TARGET_ALIGN_ANON_BITFIELD: Storage Layout. (line 386)
+* TARGET_ALLOCATE_INITIAL_VALUE: Misc. (line 720)
+* TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS: Misc. (line 953)
+* TARGET_ARG_PARTIAL_BYTES: Register Arguments. (line 83)
+* TARGET_ARM_EABI_UNWINDER: Exception Region Output.
+ (line 113)
+* TARGET_ASM_ALIGNED_DI_OP: Data Output. (line 10)
+* TARGET_ASM_ALIGNED_HI_OP: Data Output. (line 8)
+* TARGET_ASM_ALIGNED_SI_OP: Data Output. (line 9)
+* TARGET_ASM_ALIGNED_TI_OP: Data Output. (line 11)
+* TARGET_ASM_ASSEMBLE_VISIBILITY: Label Output. (line 239)
+* TARGET_ASM_BYTE_OP: Data Output. (line 7)
+* TARGET_ASM_CAN_OUTPUT_MI_THUNK: Function Entry. (line 237)
+* TARGET_ASM_CLOSE_PAREN: Data Output. (line 130)
+* TARGET_ASM_CONSTRUCTOR: Macros for Initialization.
+ (line 69)
+* TARGET_ASM_DESTRUCTOR: Macros for Initialization.
+ (line 83)
+* TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL: Dispatch Tables. (line 74)
+* TARGET_ASM_EMIT_UNWIND_LABEL: Dispatch Tables. (line 63)
+* TARGET_ASM_EXTERNAL_LIBCALL: Label Output. (line 274)
+* TARGET_ASM_FILE_END: File Framework. (line 37)
+* TARGET_ASM_FILE_START: File Framework. (line 9)
+* TARGET_ASM_FILE_START_APP_OFF: File Framework. (line 17)
+* TARGET_ASM_FILE_START_FILE_DIRECTIVE: File Framework. (line 31)
+* TARGET_ASM_FUNCTION_BEGIN_EPILOGUE: Function Entry. (line 61)
+* TARGET_ASM_FUNCTION_END_PROLOGUE: Function Entry. (line 55)
+* TARGET_ASM_FUNCTION_EPILOGUE: Function Entry. (line 68)
+* TARGET_ASM_FUNCTION_EPILOGUE and trampolines: Trampolines. (line 70)
+* TARGET_ASM_FUNCTION_PROLOGUE: Function Entry. (line 11)
+* TARGET_ASM_FUNCTION_PROLOGUE and trampolines: Trampolines. (line 70)
+* TARGET_ASM_FUNCTION_RODATA_SECTION: Sections. (line 206)
+* TARGET_ASM_GLOBALIZE_DECL_NAME: Label Output. (line 174)
+* TARGET_ASM_GLOBALIZE_LABEL: Label Output. (line 165)
+* TARGET_ASM_INIT_SECTIONS: Sections. (line 151)
+* TARGET_ASM_INTEGER: Data Output. (line 27)
+* TARGET_ASM_INTERNAL_LABEL: Label Output. (line 309)
+* TARGET_ASM_MARK_DECL_PRESERVED: Label Output. (line 280)
+* TARGET_ASM_NAMED_SECTION: File Framework. (line 89)
+* TARGET_ASM_OPEN_PAREN: Data Output. (line 129)
+* TARGET_ASM_OUTPUT_ANCHOR: Anchored Addresses. (line 44)
+* TARGET_ASM_OUTPUT_DWARF_DTPREL: SDB and DWARF. (line 58)
+* TARGET_ASM_OUTPUT_MI_THUNK: Function Entry. (line 195)
+* TARGET_ASM_RECORD_GCC_SWITCHES: File Framework. (line 122)
+* TARGET_ASM_RECORD_GCC_SWITCHES_SECTION: File Framework. (line 166)
+* TARGET_ASM_SELECT_RTX_SECTION: Sections. (line 214)
+* TARGET_ASM_SELECT_SECTION: Sections. (line 172)
+* TARGET_ASM_TTYPE: Exception Region Output.
+ (line 107)
+* TARGET_ASM_UNALIGNED_DI_OP: Data Output. (line 14)
+* TARGET_ASM_UNALIGNED_HI_OP: Data Output. (line 12)
+* TARGET_ASM_UNALIGNED_SI_OP: Data Output. (line 13)
+* TARGET_ASM_UNALIGNED_TI_OP: Data Output. (line 15)
+* TARGET_ASM_UNIQUE_SECTION: Sections. (line 193)
+* TARGET_ATTRIBUTE_TABLE: Target Attributes. (line 11)
+* TARGET_BINDS_LOCAL_P: Sections. (line 284)
+* TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED: Misc. (line 816)
+* TARGET_BRANCH_TARGET_REGISTER_CLASS: Misc. (line 808)
+* TARGET_BUILD_BUILTIN_VA_LIST: Register Arguments. (line 264)
+* TARGET_BUILTIN_RECIPROCAL: Addressing Modes. (line 240)
+* TARGET_BUILTIN_SETJMP_FRAME_VALUE: Frame Layout. (line 109)
+* TARGET_C99_FUNCTIONS: Library Calls. (line 77)
+* TARGET_CALLEE_COPIES: Register Arguments. (line 115)
+* TARGET_CAN_INLINE_P: Target Attributes. (line 126)
+* TARGET_CANNOT_FORCE_CONST_MEM: Addressing Modes. (line 221)
+* TARGET_CANNOT_MODIFY_JUMPS_P: Misc. (line 795)
+* TARGET_CANONICAL_VA_LIST_TYPE: Register Arguments. (line 273)
+* TARGET_COMMUTATIVE_P: Misc. (line 713)
+* TARGET_COMP_TYPE_ATTRIBUTES: Target Attributes. (line 19)
+* TARGET_CPU_CPP_BUILTINS: Run-time Target. (line 9)
+* TARGET_CXX_ADJUST_CLASS_AT_DEFINITION: C++ ABI. (line 87)
+* TARGET_CXX_CDTOR_RETURNS_THIS: C++ ABI. (line 38)
+* TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT: C++ ABI. (line 62)
+* TARGET_CXX_COOKIE_HAS_SIZE: C++ ABI. (line 25)
+* TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY: C++ ABI. (line 54)
+* TARGET_CXX_GET_COOKIE_SIZE: C++ ABI. (line 18)
+* TARGET_CXX_GUARD_MASK_BIT: C++ ABI. (line 12)
+* TARGET_CXX_GUARD_TYPE: C++ ABI. (line 7)
+* TARGET_CXX_IMPORT_EXPORT_CLASS: C++ ABI. (line 30)
+* TARGET_CXX_KEY_METHOD_MAY_BE_INLINE: C++ ABI. (line 43)
+* TARGET_CXX_LIBRARY_RTTI_COMDAT: C++ ABI. (line 69)
+* TARGET_CXX_USE_AEABI_ATEXIT: C++ ABI. (line 74)
+* TARGET_CXX_USE_ATEXIT_FOR_CXA_ATEXIT: C++ ABI. (line 80)
+* TARGET_DECIMAL_FLOAT_SUPPORTED_P: Storage Layout. (line 513)
+* TARGET_DECLSPEC: Target Attributes. (line 64)
+* TARGET_DEFAULT_PACK_STRUCT: Misc. (line 482)
+* TARGET_DEFAULT_SHORT_ENUMS: Type Layout. (line 160)
+* TARGET_DEFERRED_OUTPUT_DEFS: Label Output. (line 393)
+* TARGET_DELEGITIMIZE_ADDRESS: Addressing Modes. (line 212)
+* TARGET_DLLIMPORT_DECL_ATTRIBUTES: Target Attributes. (line 47)
+* TARGET_DWARF_CALLING_CONVENTION: SDB and DWARF. (line 18)
+* TARGET_DWARF_HANDLE_FRAME_UNSPEC: Frame Layout. (line 172)
+* TARGET_DWARF_REGISTER_SPAN: Exception Region Output.
+ (line 90)
+* TARGET_EDOM: Library Calls. (line 59)
+* TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS: Emulated TLS. (line 68)
+* TARGET_EMUTLS_GET_ADDRESS: Emulated TLS. (line 19)
+* TARGET_EMUTLS_REGISTER_COMMON: Emulated TLS. (line 24)
+* TARGET_EMUTLS_TMPL_PREFIX: Emulated TLS. (line 45)
+* TARGET_EMUTLS_TMPL_SECTION: Emulated TLS. (line 36)
+* TARGET_EMUTLS_VAR_ALIGN_FIXED: Emulated TLS. (line 63)
+* TARGET_EMUTLS_VAR_FIELDS: Emulated TLS. (line 49)
+* TARGET_EMUTLS_VAR_INIT: Emulated TLS. (line 57)
+* TARGET_EMUTLS_VAR_PREFIX: Emulated TLS. (line 41)
+* TARGET_EMUTLS_VAR_SECTION: Emulated TLS. (line 31)
+* TARGET_ENCODE_SECTION_INFO: Sections. (line 235)
+* TARGET_ENCODE_SECTION_INFO and address validation: Addressing Modes.
+ (line 91)
+* TARGET_ENCODE_SECTION_INFO usage: Instruction Output. (line 100)
+* TARGET_ENUM_VA_LIST: Scalar Return. (line 84)
+* TARGET_EXECUTABLE_SUFFIX: Misc. (line 769)
+* TARGET_EXPAND_BUILTIN: Misc. (line 665)
+* TARGET_EXPAND_BUILTIN_SAVEREGS: Varargs. (line 92)
+* TARGET_EXPAND_TO_RTL_HOOK: Storage Layout. (line 519)
+* TARGET_EXPR: Expression trees. (line 6)
+* TARGET_EXTRA_INCLUDES: Misc. (line 841)
+* TARGET_EXTRA_LIVE_ON_ENTRY: Tail Calls. (line 21)
+* TARGET_EXTRA_PRE_INCLUDES: Misc. (line 848)
+* TARGET_FIXED_CONDITION_CODE_REGS: Condition Code. (line 142)
+* TARGET_FIXED_POINT_SUPPORTED_P: Storage Layout. (line 516)
+* target_flags: Run-time Target. (line 52)
+* TARGET_FLT_EVAL_METHOD: Type Layout. (line 141)
+* TARGET_FN_ABI_VA_LIST: Register Arguments. (line 268)
+* TARGET_FOLD_BUILTIN: Misc. (line 685)
+* TARGET_FORMAT_TYPES: Misc. (line 868)
+* TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P: Target Attributes. (line 86)
+* TARGET_FUNCTION_OK_FOR_SIBCALL: Tail Calls. (line 8)
+* TARGET_FUNCTION_VALUE: Scalar Return. (line 11)
+* TARGET_GET_DRAP_RTX: Misc. (line 948)
+* TARGET_GIMPLIFY_VA_ARG_EXPR: Register Arguments. (line 279)
+* TARGET_HANDLE_C_OPTION: Run-time Target. (line 78)
+* TARGET_HANDLE_OPTION: Run-time Target. (line 61)
+* TARGET_HARD_REGNO_SCRATCH_OK: Values in Registers.
+ (line 144)
+* TARGET_HAS_SINCOS: Library Calls. (line 85)
+* TARGET_HAVE_CTORS_DTORS: Macros for Initialization.
+ (line 64)
+* TARGET_HAVE_NAMED_SECTIONS: File Framework. (line 99)
+* TARGET_HAVE_SWITCHABLE_BSS_SECTIONS: File Framework. (line 103)
+* TARGET_HELP: Run-time Target. (line 140)
+* TARGET_IN_SMALL_DATA_P: Sections. (line 276)
+* TARGET_INIT_BUILTINS: Misc. (line 647)
+* TARGET_INIT_DWARF_REG_SIZES_EXTRA: Exception Region Output.
+ (line 99)
+* TARGET_INIT_LIBFUNCS: Library Calls. (line 16)
+* TARGET_INSERT_ATTRIBUTES: Target Attributes. (line 73)
+* TARGET_INSTANTIATE_DECLS: Storage Layout. (line 527)
+* TARGET_INVALID_BINARY_OP: Misc. (line 921)
+* TARGET_INVALID_CONVERSION: Misc. (line 908)
+* TARGET_INVALID_UNARY_OP: Misc. (line 914)
+* TARGET_IRA_COVER_CLASSES: Register Classes. (line 496)
+* TARGET_LIB_INT_CMP_BIASED: Library Calls. (line 35)
+* TARGET_LIBGCC_CMP_RETURN_MODE: Storage Layout. (line 448)
+* TARGET_LIBGCC_SDATA_SECTION: Sections. (line 123)
+* TARGET_LIBGCC_SHIFT_COUNT_MODE: Storage Layout. (line 454)
+* TARGET_MACHINE_DEPENDENT_REORG: Misc. (line 632)
+* TARGET_MANGLE_DECL_ASSEMBLER_NAME: Sections. (line 225)
+* TARGET_MANGLE_TYPE: Storage Layout. (line 531)
+* TARGET_MD_ASM_CLOBBERS: Misc. (line 548)
+* TARGET_MEM_CONSTRAINT: Addressing Modes. (line 100)
+* TARGET_MEM_REF: Expression trees. (line 6)
+* TARGET_MERGE_DECL_ATTRIBUTES: Target Attributes. (line 39)
+* TARGET_MERGE_TYPE_ATTRIBUTES: Target Attributes. (line 31)
+* TARGET_MIN_DIVISIONS_FOR_RECIP_MUL: Misc. (line 106)
+* TARGET_MODE_REP_EXTENDED: Misc. (line 191)
+* TARGET_MS_BITFIELD_LAYOUT_P: Storage Layout. (line 486)
+* TARGET_MUST_PASS_IN_STACK: Register Arguments. (line 62)
+* TARGET_MUST_PASS_IN_STACK, and FUNCTION_ARG: Register Arguments.
+ (line 52)
+* TARGET_N_FORMAT_TYPES: Misc. (line 873)
+* TARGET_NARROW_VOLATILE_BITFIELD: Storage Layout. (line 392)
+* TARGET_OBJECT_SUFFIX: Misc. (line 764)
+* TARGET_OBJFMT_CPP_BUILTINS: Run-time Target. (line 46)
+* TARGET_OPTF: Misc. (line 855)
+* TARGET_OPTION_PRAGMA_PARSE: Target Attributes. (line 120)
+* TARGET_OPTION_PRINT: Target Attributes. (line 115)
+* TARGET_OPTION_RESTORE: Target Attributes. (line 110)
+* TARGET_OPTION_SAVE: Target Attributes. (line 104)
+* TARGET_OPTION_TRANSLATE_TABLE: Driver. (line 53)
+* TARGET_OS_CPP_BUILTINS: Run-time Target. (line 42)
+* TARGET_OVERRIDES_FORMAT_ATTRIBUTES: Misc. (line 877)
+* TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT: Misc. (line 883)
+* TARGET_OVERRIDES_FORMAT_INIT: Misc. (line 887)
+* TARGET_PASS_BY_REFERENCE: Register Arguments. (line 103)
+* TARGET_POSIX_IO: Misc. (line 572)
+* TARGET_PRETEND_OUTGOING_VARARGS_NAMED: Varargs. (line 152)
+* TARGET_PROMOTE_FUNCTION_ARGS: Storage Layout. (line 131)
+* TARGET_PROMOTE_FUNCTION_RETURN: Storage Layout. (line 136)
+* TARGET_PROMOTE_PROTOTYPES: Stack Arguments. (line 11)
+* TARGET_PTRMEMFUNC_VBIT_LOCATION: Type Layout. (line 235)
+* TARGET_RELAXED_ORDERING: Misc. (line 892)
+* TARGET_RESOLVE_OVERLOADED_BUILTIN: Misc. (line 675)
+* TARGET_RETURN_IN_MEMORY: Aggregate Return. (line 16)
+* TARGET_RETURN_IN_MSB: Scalar Return. (line 100)
+* TARGET_RTX_COSTS: Costs. (line 210)
+* TARGET_SCALAR_MODE_SUPPORTED_P: Register Arguments. (line 291)
+* TARGET_SCHED_ADJUST_COST: Scheduling. (line 37)
+* TARGET_SCHED_ADJUST_PRIORITY: Scheduling. (line 52)
+* TARGET_SCHED_CLEAR_SCHED_CONTEXT: Scheduling. (line 261)
+* TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK: Scheduling. (line 89)
+* TARGET_SCHED_DFA_NEW_CYCLE: Scheduling. (line 205)
+* TARGET_SCHED_DFA_POST_CYCLE_ADVANCE: Scheduling. (line 160)
+* TARGET_SCHED_DFA_POST_CYCLE_INSN: Scheduling. (line 144)
+* TARGET_SCHED_DFA_PRE_CYCLE_ADVANCE: Scheduling. (line 153)
+* TARGET_SCHED_DFA_PRE_CYCLE_INSN: Scheduling. (line 132)
+* TARGET_SCHED_FINISH: Scheduling. (line 109)
+* TARGET_SCHED_FINISH_GLOBAL: Scheduling. (line 126)
+* TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD: Scheduling.
+ (line 168)
+* TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD: Scheduling.
+ (line 196)
+* TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC: Scheduling.
+ (line 321)
+* TARGET_SCHED_FREE_SCHED_CONTEXT: Scheduling. (line 265)
+* TARGET_SCHED_GEN_CHECK: Scheduling. (line 309)
+* TARGET_SCHED_H_I_D_EXTENDED: Scheduling. (line 241)
+* TARGET_SCHED_INIT: Scheduling. (line 99)
+* TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN: Scheduling. (line 149)
+* TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN: Scheduling. (line 141)
+* TARGET_SCHED_INIT_GLOBAL: Scheduling. (line 118)
+* TARGET_SCHED_INIT_SCHED_CONTEXT: Scheduling. (line 251)
+* TARGET_SCHED_IS_COSTLY_DEPENDENCE: Scheduling. (line 219)
+* TARGET_SCHED_ISSUE_RATE: Scheduling. (line 12)
+* TARGET_SCHED_NEEDS_BLOCK_P: Scheduling. (line 302)
+* TARGET_SCHED_REORDER: Scheduling. (line 60)
+* TARGET_SCHED_REORDER2: Scheduling. (line 77)
+* TARGET_SCHED_SET_SCHED_CONTEXT: Scheduling. (line 257)
+* TARGET_SCHED_SET_SCHED_FLAGS: Scheduling. (line 332)
+* TARGET_SCHED_SMS_RES_MII: Scheduling. (line 343)
+* TARGET_SCHED_SPECULATE_INSN: Scheduling. (line 291)
+* TARGET_SCHED_VARIABLE_ISSUE: Scheduling. (line 24)
+* TARGET_SECONDARY_RELOAD: Register Classes. (line 257)
+* TARGET_SECTION_TYPE_FLAGS: File Framework. (line 109)
+* TARGET_SET_CURRENT_FUNCTION: Misc. (line 747)
+* TARGET_SET_DEFAULT_TYPE_ATTRIBUTES: Target Attributes. (line 26)
+* TARGET_SETUP_INCOMING_VARARGS: Varargs. (line 101)
+* TARGET_SHIFT_TRUNCATION_MASK: Misc. (line 154)
+* TARGET_SPLIT_COMPLEX_ARG: Register Arguments. (line 252)
+* TARGET_STACK_PROTECT_FAIL: Stack Smashing Protection.
+ (line 17)
+* TARGET_STACK_PROTECT_GUARD: Stack Smashing Protection.
+ (line 7)
+* TARGET_STRICT_ARGUMENT_NAMING: Varargs. (line 137)
+* TARGET_STRUCT_VALUE_RTX: Aggregate Return. (line 44)
+* TARGET_UNSPEC_MAY_TRAP_P: Misc. (line 739)
+* TARGET_UNWIND_EMIT: Dispatch Tables. (line 81)
+* TARGET_UNWIND_INFO: Exception Region Output.
+ (line 56)
+* TARGET_UPDATE_STACK_BOUNDARY: Misc. (line 944)
+* TARGET_USE_ANCHORS_FOR_SYMBOL_P: Anchored Addresses. (line 55)
+* TARGET_USE_BLOCKS_FOR_CONSTANT_P: Addressing Modes. (line 233)
+* TARGET_USE_JCR_SECTION: Misc. (line 926)
+* TARGET_USE_LOCAL_THUNK_ALIAS_P: Misc. (line 861)
+* TARGET_USES_WEAK_UNWIND_INFO: Exception Handling. (line 129)
+* TARGET_VALID_DLLIMPORT_ATTRIBUTE_P: Target Attributes. (line 59)
+* TARGET_VALID_OPTION_ATTRIBUTE_P: Target Attributes. (line 93)
+* TARGET_VALID_POINTER_MODE: Register Arguments. (line 285)
+* TARGET_VECTOR_MODE_SUPPORTED_P: Register Arguments. (line 303)
+* TARGET_VECTOR_OPAQUE_P: Storage Layout. (line 479)
+* TARGET_VECTORIZE_BUILTIN_CONVERSION: Addressing Modes. (line 300)
+* TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD: Addressing Modes. (line 249)
+* TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN: Addressing Modes. (line 275)
+* TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD: Addressing Modes. (line 287)
+* TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION: Addressing Modes.
+ (line 315)
+* TARGET_VERSION: Run-time Target. (line 91)
+* TARGET_VTABLE_DATA_ENTRY_DISTANCE: Type Layout. (line 288)
+* TARGET_VTABLE_ENTRY_ALIGN: Type Layout. (line 282)
+* TARGET_VTABLE_USES_DESCRIPTORS: Type Layout. (line 271)
+* TARGET_WEAK_NOT_IN_ARCHIVE_TOC: Label Output. (line 245)
+* targetm: Target Structure. (line 7)
+* targets, makefile: Makefile. (line 6)
+* TCmode: Machine Modes. (line 197)
+* TDmode: Machine Modes. (line 94)
+* TEMPLATE_DECL: Declarations. (line 6)
+* Temporaries: Temporaries. (line 6)
+* termination routines: Initialization. (line 6)
+* testing constraints: C Constraint Interface.
+ (line 6)
+* TEXT_SECTION_ASM_OP: Sections. (line 38)
+* TF_SIZE: Type Layout. (line 132)
+* TFmode: Machine Modes. (line 98)
+* THEN_CLAUSE: Function Bodies. (line 6)
+* THREAD_MODEL_SPEC: Driver. (line 225)
+* THROW_EXPR: Expression trees. (line 6)
+* THUNK_DECL: Declarations. (line 6)
+* THUNK_DELTA: Declarations. (line 6)
+* TImode: Machine Modes. (line 48)
+* TImode, in insn: Insns. (line 231)
+* tm.h macros: Target Macros. (line 6)
+* TQFmode: Machine Modes. (line 62)
+* TQmode: Machine Modes. (line 119)
+* TRAMPOLINE_ADJUST_ADDRESS: Trampolines. (line 62)
+* TRAMPOLINE_ALIGNMENT: Trampolines. (line 49)
+* TRAMPOLINE_SECTION: Trampolines. (line 40)
+* TRAMPOLINE_SIZE: Trampolines. (line 45)
+* TRAMPOLINE_TEMPLATE: Trampolines. (line 29)
+* trampolines for nested functions: Trampolines. (line 6)
+* TRANSFER_FROM_TRAMPOLINE: Trampolines. (line 124)
+* trap instruction pattern: Standard Names. (line 1374)
+* tree <1>: Macros and Functions.
+ (line 6)
+* tree: Tree overview. (line 6)
+* Tree SSA: Tree SSA. (line 6)
+* tree_code <1>: GIMPLE_OMP_FOR. (line 83)
+* tree_code <2>: GIMPLE_COND. (line 21)
+* tree_code <3>: GIMPLE_ASSIGN. (line 41)
+* tree_code: Manipulating GIMPLE statements.
+ (line 31)
+* TREE_CODE: Tree overview. (line 6)
+* TREE_FILENAME: Working with declarations.
+ (line 14)
+* tree_int_cst_equal: Expression trees. (line 6)
+* TREE_INT_CST_HIGH: Expression trees. (line 6)
+* TREE_INT_CST_LOW: Expression trees. (line 6)
+* tree_int_cst_lt: Expression trees. (line 6)
+* TREE_LINENO: Working with declarations.
+ (line 20)
+* TREE_LIST: Containers. (line 6)
+* TREE_OPERAND: Expression trees. (line 6)
+* TREE_PUBLIC: Function Basics. (line 6)
+* TREE_PURPOSE: Containers. (line 6)
+* TREE_STRING_LENGTH: Expression trees. (line 6)
+* TREE_STRING_POINTER: Expression trees. (line 6)
+* TREE_TYPE <1>: Expression trees. (line 6)
+* TREE_TYPE <2>: Function Basics. (line 171)
+* TREE_TYPE <3>: Working with declarations.
+ (line 11)
+* TREE_TYPE: Types. (line 6)
+* TREE_VALUE: Containers. (line 6)
+* TREE_VEC: Containers. (line 6)
+* TREE_VEC_ELT: Containers. (line 6)
+* TREE_VEC_LENGTH: Containers. (line 6)
+* Trees: Trees. (line 6)
+* TRULY_NOOP_TRUNCATION: Misc. (line 177)
+* TRUNC_DIV_EXPR: Expression trees. (line 6)
+* TRUNC_MOD_EXPR: Expression trees. (line 6)
+* truncate: Conversions. (line 38)
+* truncMN2 instruction pattern: Standard Names. (line 821)
+* TRUTH_AND_EXPR: Expression trees. (line 6)
+* TRUTH_ANDIF_EXPR: Expression trees. (line 6)
+* TRUTH_NOT_EXPR: Expression trees. (line 6)
+* TRUTH_OR_EXPR: Expression trees. (line 6)
+* TRUTH_ORIF_EXPR: Expression trees. (line 6)
+* TRUTH_XOR_EXPR: Expression trees. (line 6)
+* TRY_BLOCK: Function Bodies. (line 6)
+* TRY_HANDLERS: Function Bodies. (line 6)
+* TRY_STMTS: Function Bodies. (line 6)
+* tstM instruction pattern: Standard Names. (line 661)
+* Tuple specific accessors: Tuple specific accessors.
+ (line 6)
+* tuples: Tuple representation.
+ (line 6)
+* type: Types. (line 6)
+* type declaration: Declarations. (line 6)
+* TYPE_ALIGN: Types. (line 6)
+* TYPE_ARG_TYPES: Types. (line 6)
+* TYPE_ASM_OP: Label Output. (line 55)
+* TYPE_ATTRIBUTES: Attributes. (line 25)
+* TYPE_BINFO: Classes. (line 6)
+* TYPE_BUILT_IN: Types. (line 83)
+* TYPE_CANONICAL: Types. (line 6)
+* TYPE_CONTEXT: Types. (line 6)
+* TYPE_DECL: Declarations. (line 6)
+* TYPE_FIELDS <1>: Classes. (line 6)
+* TYPE_FIELDS: Types. (line 6)
+* TYPE_HAS_ARRAY_NEW_OPERATOR: Classes. (line 91)
+* TYPE_HAS_DEFAULT_CONSTRUCTOR: Classes. (line 76)
+* TYPE_HAS_MUTABLE_P: Classes. (line 81)
+* TYPE_HAS_NEW_OPERATOR: Classes. (line 88)
+* TYPE_MAIN_VARIANT: Types. (line 6)
+* TYPE_MAX_VALUE: Types. (line 6)
+* TYPE_METHOD_BASETYPE: Types. (line 6)
+* TYPE_METHODS: Classes. (line 6)
+* TYPE_MIN_VALUE: Types. (line 6)
+* TYPE_NAME: Types. (line 6)
+* TYPE_NOTHROW_P: Function Basics. (line 180)
+* TYPE_OFFSET_BASETYPE: Types. (line 6)
+* TYPE_OPERAND_FMT: Label Output. (line 66)
+* TYPE_OVERLOADS_ARRAY_REF: Classes. (line 99)
+* TYPE_OVERLOADS_ARROW: Classes. (line 102)
+* TYPE_OVERLOADS_CALL_EXPR: Classes. (line 95)
+* TYPE_POLYMORPHIC_P: Classes. (line 72)
+* TYPE_PRECISION: Types. (line 6)
+* TYPE_PTR_P: Types. (line 89)
+* TYPE_PTRFN_P: Types. (line 93)
+* TYPE_PTRMEM_P: Types. (line 6)
+* TYPE_PTROB_P: Types. (line 96)
+* TYPE_PTROBV_P: Types. (line 6)
+* TYPE_QUAL_CONST: Types. (line 6)
+* TYPE_QUAL_RESTRICT: Types. (line 6)
+* TYPE_QUAL_VOLATILE: Types. (line 6)
+* TYPE_RAISES_EXCEPTIONS: Function Basics. (line 175)
+* TYPE_SIZE: Types. (line 6)
+* TYPE_STRUCTURAL_EQUALITY_P: Types. (line 6)
+* TYPE_UNQUALIFIED: Types. (line 6)
+* TYPE_VFIELD: Classes. (line 6)
+* TYPENAME_TYPE: Types. (line 6)
+* TYPENAME_TYPE_FULLNAME: Types. (line 6)
+* TYPEOF_TYPE: Types. (line 6)
+* UDAmode: Machine Modes. (line 168)
+* udiv: Arithmetic. (line 125)
+* udivM3 instruction pattern: Standard Names. (line 222)
+* udivmodM4 instruction pattern: Standard Names. (line 428)
+* udot_prodM instruction pattern: Standard Names. (line 265)
+* UDQmode: Machine Modes. (line 136)
+* UHAmode: Machine Modes. (line 160)
+* UHQmode: Machine Modes. (line 128)
+* UINTMAX_TYPE: Type Layout. (line 224)
+* umaddMN4 instruction pattern: Standard Names. (line 375)
+* umax: Arithmetic. (line 144)
+* umaxM3 instruction pattern: Standard Names. (line 222)
+* umin: Arithmetic. (line 144)
+* uminM3 instruction pattern: Standard Names. (line 222)
+* umod: Arithmetic. (line 131)
+* umodM3 instruction pattern: Standard Names. (line 222)
+* umsubMN4 instruction pattern: Standard Names. (line 399)
+* umulhisi3 instruction pattern: Standard Names. (line 347)
+* umulM3_highpart instruction pattern: Standard Names. (line 361)
+* umulqihi3 instruction pattern: Standard Names. (line 347)
+* umulsidi3 instruction pattern: Standard Names. (line 347)
+* unchanging: Flags. (line 319)
+* unchanging, in call_insn: Flags. (line 19)
+* unchanging, in jump_insn, call_insn and insn: Flags. (line 39)
+* unchanging, in mem: Flags. (line 152)
+* unchanging, in subreg: Flags. (line 188)
+* unchanging, in symbol_ref: Flags. (line 10)
+* UNEQ_EXPR: Expression trees. (line 6)
+* UNGE_EXPR: Expression trees. (line 6)
+* UNGT_EXPR: Expression trees. (line 6)
+* UNION_TYPE <1>: Classes. (line 6)
+* UNION_TYPE: Types. (line 6)
+* unions, returning: Interface. (line 10)
+* UNITS_PER_SIMD_WORD: Storage Layout. (line 77)
+* UNITS_PER_WORD: Storage Layout. (line 67)
+* UNKNOWN_TYPE: Types. (line 6)
+* UNLE_EXPR: Expression trees. (line 6)
+* UNLIKELY_EXECUTED_TEXT_SECTION_NAME: Sections. (line 49)
+* UNLT_EXPR: Expression trees. (line 6)
+* UNORDERED_EXPR: Expression trees. (line 6)
+* unshare_all_rtl: Sharing. (line 58)
+* unsigned division: Arithmetic. (line 125)
+* unsigned division with unsigned saturation: Arithmetic. (line 125)
+* unsigned greater than: Comparisons. (line 64)
+* unsigned less than: Comparisons. (line 68)
+* unsigned minimum and maximum: Arithmetic. (line 144)
+* unsigned_fix: Conversions. (line 77)
+* unsigned_float: Conversions. (line 62)
+* unsigned_fract_convert: Conversions. (line 97)
+* unsigned_sat_fract: Conversions. (line 103)
+* unspec: Side Effects. (line 287)
+* unspec_volatile: Side Effects. (line 287)
+* untyped_call instruction pattern: Standard Names. (line 1012)
+* untyped_return instruction pattern: Standard Names. (line 1062)
+* UPDATE_PATH_HOST_CANONICALIZE (PATH): Filesystem. (line 59)
+* update_ssa: SSA. (line 76)
+* update_stmt <1>: SSA Operands. (line 6)
+* update_stmt: Manipulating GIMPLE statements.
+ (line 141)
+* update_stmt_if_modified: Manipulating GIMPLE statements.
+ (line 144)
+* UQQmode: Machine Modes. (line 123)
+* US Software GOFAST, floating point emulation library: Library Calls.
+ (line 44)
+* us_ashift: Arithmetic. (line 168)
+* us_minus: Arithmetic. (line 36)
+* us_mult: Arithmetic. (line 92)
+* us_neg: Arithmetic. (line 81)
+* us_plus: Arithmetic. (line 14)
+* US_SOFTWARE_GOFAST: Library Calls. (line 45)
+* us_truncate: Conversions. (line 48)
+* usaddM3 instruction pattern: Standard Names. (line 222)
+* USAmode: Machine Modes. (line 164)
+* usashlM3 instruction pattern: Standard Names. (line 431)
+* usdivM3 instruction pattern: Standard Names. (line 222)
+* use: Side Effects. (line 162)
+* USE_C_ALLOCA: Host Misc. (line 19)
+* USE_LD_AS_NEEDED: Driver. (line 198)
+* USE_LOAD_POST_DECREMENT: Costs. (line 165)
+* USE_LOAD_POST_INCREMENT: Costs. (line 160)
+* USE_LOAD_PRE_DECREMENT: Costs. (line 175)
+* USE_LOAD_PRE_INCREMENT: Costs. (line 170)
+* use_optype_d: Manipulating GIMPLE statements.
+ (line 101)
+* use_param: GTY Options. (line 114)
+* use_paramN: GTY Options. (line 132)
+* use_params: GTY Options. (line 140)
+* USE_SELECT_SECTION_FOR_FUNCTIONS: Sections. (line 185)
+* USE_STORE_POST_DECREMENT: Costs. (line 185)
+* USE_STORE_POST_INCREMENT: Costs. (line 180)
+* USE_STORE_PRE_DECREMENT: Costs. (line 195)
+* USE_STORE_PRE_INCREMENT: Costs. (line 190)
+* used: Flags. (line 337)
+* used, in symbol_ref: Flags. (line 215)
+* USER_LABEL_PREFIX: Instruction Output. (line 126)
+* USING_DECL: Declarations. (line 6)
+* USING_STMT: Function Bodies. (line 6)
+* usmaddMN4 instruction pattern: Standard Names. (line 383)
+* usmsubMN4 instruction pattern: Standard Names. (line 407)
+* usmulhisi3 instruction pattern: Standard Names. (line 351)
+* usmulM3 instruction pattern: Standard Names. (line 222)
+* usmulqihi3 instruction pattern: Standard Names. (line 351)
+* usmulsidi3 instruction pattern: Standard Names. (line 351)
+* usnegM2 instruction pattern: Standard Names. (line 449)
+* USQmode: Machine Modes. (line 132)
+* ussubM3 instruction pattern: Standard Names. (line 222)
+* usum_widenM3 instruction pattern: Standard Names. (line 275)
+* UTAmode: Machine Modes. (line 172)
+* UTQmode: Machine Modes. (line 140)
+* V in constraint: Simple Constraints. (line 43)
+* VA_ARG_EXPR: Expression trees. (line 6)
+* values, returned by functions: Scalar Return. (line 6)
+* VAR_DECL <1>: Expression trees. (line 6)
+* VAR_DECL: Declarations. (line 6)
+* varargs implementation: Varargs. (line 6)
+* variable: Declarations. (line 6)
+* vashlM3 instruction pattern: Standard Names. (line 445)
+* vashrM3 instruction pattern: Standard Names. (line 445)
+* vec_concat: Vector Operations. (line 25)
+* vec_duplicate: Vector Operations. (line 30)
+* VEC_EXTRACT_EVEN_EXPR: Expression trees. (line 6)
+* vec_extract_evenM instruction pattern: Standard Names. (line 176)
+* VEC_EXTRACT_ODD_EXPR: Expression trees. (line 6)
+* vec_extract_oddM instruction pattern: Standard Names. (line 183)
+* vec_extractM instruction pattern: Standard Names. (line 171)
+* vec_initM instruction pattern: Standard Names. (line 204)
+* VEC_INTERLEAVE_HIGH_EXPR: Expression trees. (line 6)
+* vec_interleave_highM instruction pattern: Standard Names. (line 190)
+* VEC_INTERLEAVE_LOW_EXPR: Expression trees. (line 6)
+* vec_interleave_lowM instruction pattern: Standard Names. (line 197)
+* VEC_LSHIFT_EXPR: Expression trees. (line 6)
+* vec_merge: Vector Operations. (line 11)
+* VEC_PACK_FIX_TRUNC_EXPR: Expression trees. (line 6)
+* VEC_PACK_SAT_EXPR: Expression trees. (line 6)
+* vec_pack_sfix_trunc_M instruction pattern: Standard Names. (line 302)
+* vec_pack_ssat_M instruction pattern: Standard Names. (line 295)
+* VEC_PACK_TRUNC_EXPR: Expression trees. (line 6)
+* vec_pack_trunc_M instruction pattern: Standard Names. (line 288)
+* vec_pack_ufix_trunc_M instruction pattern: Standard Names. (line 302)
+* vec_pack_usat_M instruction pattern: Standard Names. (line 295)
+* VEC_RSHIFT_EXPR: Expression trees. (line 6)
+* vec_select: Vector Operations. (line 19)
+* vec_setM instruction pattern: Standard Names. (line 166)
+* vec_shl_M instruction pattern: Standard Names. (line 282)
+* vec_shr_M instruction pattern: Standard Names. (line 282)
+* VEC_UNPACK_FLOAT_HI_EXPR: Expression trees. (line 6)
+* VEC_UNPACK_FLOAT_LO_EXPR: Expression trees. (line 6)
+* VEC_UNPACK_HI_EXPR: Expression trees. (line 6)
+* VEC_UNPACK_LO_EXPR: Expression trees. (line 6)
+* vec_unpacks_float_hi_M instruction pattern: Standard Names.
+ (line 324)
+* vec_unpacks_float_lo_M instruction pattern: Standard Names.
+ (line 324)
+* vec_unpacks_hi_M instruction pattern: Standard Names. (line 309)
+* vec_unpacks_lo_M instruction pattern: Standard Names. (line 309)
+* vec_unpacku_float_hi_M instruction pattern: Standard Names.
+ (line 324)
+* vec_unpacku_float_lo_M instruction pattern: Standard Names.
+ (line 324)
+* vec_unpacku_hi_M instruction pattern: Standard Names. (line 317)
+* vec_unpacku_lo_M instruction pattern: Standard Names. (line 317)
+* VEC_WIDEN_MULT_HI_EXPR: Expression trees. (line 6)
+* VEC_WIDEN_MULT_LO_EXPR: Expression trees. (line 6)
+* vec_widen_smult_hi_M instruction pattern: Standard Names. (line 333)
+* vec_widen_smult_lo_M instruction pattern: Standard Names. (line 333)
+* vec_widen_umult_hi_M instruction pattern: Standard Names. (line 333)
+* vec_widen_umult_lo__M instruction pattern: Standard Names. (line 333)
+* vector: Containers. (line 6)
+* vector operations: Vector Operations. (line 6)
+* VECTOR_CST: Expression trees. (line 6)
+* VECTOR_STORE_FLAG_VALUE: Misc. (line 308)
+* virtual operands: SSA Operands. (line 6)
+* VIRTUAL_INCOMING_ARGS_REGNUM: Regs and Memory. (line 59)
+* VIRTUAL_OUTGOING_ARGS_REGNUM: Regs and Memory. (line 87)
+* VIRTUAL_STACK_DYNAMIC_REGNUM: Regs and Memory. (line 78)
+* VIRTUAL_STACK_VARS_REGNUM: Regs and Memory. (line 69)
+* VLIW: Processor pipeline description.
+ (line 6)
+* vlshrM3 instruction pattern: Standard Names. (line 445)
+* VMS: Filesystem. (line 37)
+* VMS_DEBUGGING_INFO: VMS Debug. (line 9)
+* VOID_TYPE: Types. (line 6)
+* VOIDmode: Machine Modes. (line 190)
+* volatil: Flags. (line 351)
+* volatil, in insn, call_insn, jump_insn, code_label, barrier, and note: Flags.
+ (line 44)
+* volatil, in label_ref and reg_label: Flags. (line 65)
+* volatil, in mem, asm_operands, and asm_input: Flags. (line 94)
+* volatil, in reg: Flags. (line 116)
+* volatil, in subreg: Flags. (line 188)
+* volatil, in symbol_ref: Flags. (line 224)
+* volatile memory references: Flags. (line 352)
+* voptype_d: Manipulating GIMPLE statements.
+ (line 108)
+* voting between constraint alternatives: Class Preferences. (line 6)
+* vrotlM3 instruction pattern: Standard Names. (line 445)
+* vrotrM3 instruction pattern: Standard Names. (line 445)
+* walk_dominator_tree: SSA. (line 256)
+* walk_gimple_op: Statement and operand traversals.
+ (line 32)
+* walk_gimple_seq: Statement and operand traversals.
+ (line 50)
+* walk_gimple_stmt: Statement and operand traversals.
+ (line 13)
+* walk_use_def_chains: SSA. (line 232)
+* WCHAR_TYPE: Type Layout. (line 192)
+* WCHAR_TYPE_SIZE: Type Layout. (line 200)
+* which_alternative: Output Statement. (line 59)
+* WHILE_BODY: Function Bodies. (line 6)
+* WHILE_COND: Function Bodies. (line 6)
+* WHILE_STMT: Function Bodies. (line 6)
+* WIDEST_HARDWARE_FP_SIZE: Type Layout. (line 147)
+* WINT_TYPE: Type Layout. (line 205)
+* word_mode: Machine Modes. (line 336)
+* WORD_REGISTER_OPERATIONS: Misc. (line 63)
+* WORD_SWITCH_TAKES_ARG: Driver. (line 20)
+* WORDS_BIG_ENDIAN: Storage Layout. (line 29)
+* WORDS_BIG_ENDIAN, effect on subreg: Regs and Memory. (line 217)
+* X in constraint: Simple Constraints. (line 114)
+* x-HOST: Host Fragment. (line 6)
+* XCmode: Machine Modes. (line 197)
+* XCOFF_DEBUGGING_INFO: DBX Options. (line 13)
+* XEXP: Accessors. (line 6)
+* XF_SIZE: Type Layout. (line 131)
+* XFmode: Machine Modes. (line 79)
+* XINT: Accessors. (line 6)
+* xm-MACHINE.h <1>: Host Misc. (line 6)
+* xm-MACHINE.h: Filesystem. (line 6)
+* xor: Arithmetic. (line 163)
+* xor, canonicalization of: Insn Canonicalizations.
+ (line 84)
+* xorM3 instruction pattern: Standard Names. (line 222)
+* XSTR: Accessors. (line 6)
+* XVEC: Accessors. (line 41)
+* XVECEXP: Accessors. (line 48)
+* XVECLEN: Accessors. (line 44)
+* XWINT: Accessors. (line 6)
+* zero_extend: Conversions. (line 28)
+* zero_extendMN2 instruction pattern: Standard Names. (line 831)
+* zero_extract: Bit-Fields. (line 30)
+* zero_extract, canonicalization of: Insn Canonicalizations.
+ (line 96)
+
+
+
+Tag Table:
+Node: Top2082
+Node: Contributing5125
+Node: Portability5866
+Node: Interface7654
+Node: Libgcc10694
+Node: Integer library routines12535
+Node: Soft float library routines19374
+Node: Decimal float library routines31311
+Node: Fixed-point fractional library routines47068
+Node: Exception handling routines147466
+Node: Miscellaneous routines148573
+Node: Languages148956
+Node: Source Tree150503
+Node: Configure Terms151122
+Node: Top Level154080
+Node: gcc Directory156850
+Node: Subdirectories157819
+Node: Configuration159669
+Node: Config Fragments160389
+Node: System Config161618
+Node: Configuration Files162554
+Node: Build165129
+Node: Makefile165541
+Ref: Makefile-Footnote-1172259
+Ref: Makefile-Footnote-2172404
+Node: Library Files172476
+Node: Headers173038
+Node: Documentation175121
+Node: Texinfo Manuals175980
+Node: Man Page Generation178318
+Node: Miscellaneous Docs180233
+Node: Front End181532
+Node: Front End Directory185233
+Node: Front End Config190355
+Node: Back End193269
+Node: Testsuites196946
+Node: Test Idioms197810
+Node: Test Directives201211
+Node: Ada Tests213275
+Node: C Tests214567
+Node: libgcj Tests218922
+Node: gcov Testing220054
+Node: profopt Testing223038
+Node: compat Testing224481
+Node: Torture Tests228725
+Node: Options230357
+Node: Option file format230798
+Node: Option properties233547
+Node: Passes239603
+Node: Parsing pass240345
+Node: Gimplification pass243873
+Node: Pass manager245700
+Node: Tree SSA passes247183
+Node: RTL passes269014
+Node: Trees281357
+Node: Deficiencies284087
+Node: Tree overview284324
+Node: Macros and Functions288447
+Node: Identifiers288593
+Node: Containers290118
+Node: Types291273
+Node: Scopes306976
+Node: Namespaces307738
+Node: Classes310550
+Node: Declarations315307
+Node: Working with declarations315802
+Node: Internal structure322259
+Node: Current structure hierarchy322641
+Node: Adding new DECL node types324733
+Node: Functions328804
+Node: Function Basics331207
+Node: Function Bodies338937
+Node: Attributes350179
+Node: Expression trees351420
+Node: RTL394029
+Node: RTL Objects396147
+Node: RTL Classes400021
+Node: Accessors404973
+Node: Special Accessors407367
+Node: Flags412585
+Node: Machine Modes428453
+Node: Constants440769
+Node: Regs and Memory446798
+Node: Arithmetic464699
+Node: Comparisons474219
+Node: Bit-Fields478511
+Node: Vector Operations480063
+Node: Conversions481689
+Node: RTL Declarations486187
+Node: Side Effects487008
+Node: Incdec503331
+Node: Assembler506666
+Node: Insns508198
+Node: Calls532087
+Node: Sharing534680
+Node: Reading RTL537790
+Node: GENERIC538780
+Node: Statements540419
+Node: Blocks540864
+Node: Statement Sequences542117
+Node: Empty Statements542450
+Node: Jumps543024
+Node: Cleanups543677
+Node: GIMPLE545430
+Node: Tuple representation549051
+Node: GIMPLE instruction set557706
+Node: GIMPLE Exception Handling559374
+Node: Temporaries561289
+Ref: Temporaries-Footnote-1562608
+Node: Operands562671
+Node: Compound Expressions563445
+Node: Compound Lvalues563679
+Node: Conditional Expressions564445
+Node: Logical Operators565115
+Node: Manipulating GIMPLE statements571206
+Node: Tuple specific accessors577134
+Node: `GIMPLE_ASM'577967
+Node: `GIMPLE_ASSIGN'580572
+Node: `GIMPLE_BIND'584518
+Node: `GIMPLE_CALL'586325
+Node: `GIMPLE_CATCH'590584
+Node: `GIMPLE_CHANGE_DYNAMIC_TYPE'591742
+Node: `GIMPLE_COND'593075
+Node: `GIMPLE_EH_FILTER'595881
+Node: `GIMPLE_LABEL'597367
+Node: `GIMPLE_NOP'598342
+Node: `GIMPLE_OMP_ATOMIC_LOAD'598711
+Node: `GIMPLE_OMP_ATOMIC_STORE'599621
+Node: `GIMPLE_OMP_CONTINUE'600260
+Node: `GIMPLE_OMP_CRITICAL'601610
+Node: `GIMPLE_OMP_FOR'602546
+Node: `GIMPLE_OMP_MASTER'606056
+Node: `GIMPLE_OMP_ORDERED'606439
+Node: `GIMPLE_OMP_PARALLEL'606839
+Node: `GIMPLE_OMP_RETURN'609608
+Node: `GIMPLE_OMP_SECTION'610258
+Node: `GIMPLE_OMP_SECTIONS'610924
+Node: `GIMPLE_OMP_SINGLE'612528
+Node: `GIMPLE_PHI'613464
+Node: `GIMPLE_RESX'614877
+Node: `GIMPLE_RETURN'615596
+Node: `GIMPLE_SWITCH'616164
+Node: `GIMPLE_TRY'618294
+Node: `GIMPLE_WITH_CLEANUP_EXPR'620084
+Node: GIMPLE sequences620967
+Node: Sequence iterators624173
+Node: Adding a new GIMPLE statement code632628
+Node: Statement and operand traversals633908
+Node: Tree SSA636518
+Node: Annotations638238
+Node: SSA Operands638764
+Node: SSA653295
+Node: Alias analysis665586
+Node: Loop Analysis and Representation673042
+Node: Loop representation674223
+Node: Loop querying681143
+Node: Loop manipulation683976
+Node: LCSSA686344
+Node: Scalar evolutions688416
+Node: loop-iv691660
+Node: Number of iterations693586
+Node: Dependency analysis696395
+Node: Lambda702763
+Node: Omega704433
+Node: Control Flow705998
+Node: Basic Blocks706993
+Node: Edges711561
+Node: Profile information720123
+Node: Maintaining the CFG724809
+Node: Liveness information731691
+Node: Machine Desc733818
+Node: Overview736286
+Node: Patterns738327
+Node: Example741765
+Node: RTL Template743200
+Node: Output Template753855
+Node: Output Statement757821
+Node: Predicates761783
+Node: Machine-Independent Predicates764701
+Node: Defining Predicates769333
+Node: Constraints775298
+Node: Simple Constraints776546
+Node: Multi-Alternative788752
+Node: Class Preferences791593
+Node: Modifiers792485
+Node: Machine Constraints796617
+Node: Disable Insn Alternatives829340
+Node: Define Constraints832233
+Node: C Constraint Interface839013
+Node: Standard Names842654
+Ref: shift patterns861582
+Ref: prologue instruction pattern902600
+Ref: epilogue instruction pattern903093
+Node: Pattern Ordering912592
+Node: Dependent Patterns913828
+Node: Jump Patterns916642
+Node: Looping Patterns922338
+Node: Insn Canonicalizations927066
+Node: Expander Definitions931450
+Node: Insn Splitting939568
+Node: Including Patterns949171
+Node: Peephole Definitions950951
+Node: define_peephole952204
+Node: define_peephole2958535
+Node: Insn Attributes961602
+Node: Defining Attributes962708
+Node: Expressions965228
+Node: Tagging Insns971830
+Node: Attr Example976183
+Node: Insn Lengths978557
+Node: Constant Attributes981616
+Node: Delay Slots982785
+Node: Processor pipeline description986009
+Ref: Processor pipeline description-Footnote-11003375
+Node: Conditional Execution1003697
+Node: Constant Definitions1006550
+Node: Iterators1008145
+Node: Mode Iterators1008592
+Node: Defining Mode Iterators1009570
+Node: Substitutions1011064
+Node: Examples1013305
+Node: Code Iterators1014753
+Node: Target Macros1017010
+Node: Target Structure1020033
+Node: Driver1021302
+Node: Run-time Target1044983
+Node: Per-Function Data1052107
+Node: Storage Layout1054870
+Node: Type Layout1080284
+Node: Registers1093241
+Node: Register Basics1094215
+Node: Allocation Order1099782
+Node: Values in Registers1101803
+Node: Leaf Functions1109292
+Node: Stack Registers1112150
+Node: Register Classes1113266
+Node: Old Constraints1139978
+Node: Stack and Calling1147129
+Node: Frame Layout1147663
+Node: Exception Handling1158509
+Node: Stack Checking1164887
+Node: Frame Registers1169274
+Node: Elimination1175880
+Node: Stack Arguments1179911
+Node: Register Arguments1186714
+Node: Scalar Return1202167
+Node: Aggregate Return1207713
+Node: Caller Saves1211372
+Node: Function Entry1212550
+Node: Profiling1225165
+Node: Tail Calls1226864
+Node: Stack Smashing Protection1228231
+Node: Varargs1229343
+Node: Trampolines1237303
+Node: Library Calls1243969
+Node: Addressing Modes1248819
+Node: Anchored Addresses1264737
+Node: Condition Code1267398
+Node: Costs1275687
+Node: Scheduling1288786
+Node: Sections1307347
+Node: PIC1321997
+Node: Assembler Format1323987
+Node: File Framework1325125
+Ref: TARGET_HAVE_SWITCHABLE_BSS_SECTIONS1330031
+Node: Data Output1333297
+Node: Uninitialized Data1341056
+Node: Label Output1346127
+Node: Initialization1367794
+Node: Macros for Initialization1373756
+Node: Instruction Output1380208
+Node: Dispatch Tables1389202
+Node: Exception Region Output1392997
+Node: Alignment Output1398757
+Node: Debugging Info1402920
+Node: All Debuggers1403590
+Node: DBX Options1406445
+Node: DBX Hooks1411894
+Node: File Names and DBX1413820
+Node: SDB and DWARF1415931
+Node: VMS Debug1419923
+Node: Floating Point1420493
+Node: Mode Switching1425316
+Node: Target Attributes1429242
+Node: Emulated TLS1436006
+Node: MIPS Coprocessors1439396
+Node: PCH Target1440965
+Node: C++ ABI1442486
+Node: Misc1447105
+Ref: TARGET_SHIFT_TRUNCATION_MASK1454476
+Node: Host Config1495421
+Node: Host Common1496489
+Node: Filesystem1498868
+Node: Host Misc1502983
+Node: Fragments1505122
+Node: Target Fragment1506317
+Node: Host Fragment1512207
+Node: Collect21512447
+Node: Header Dirs1514990
+Node: Type Information1516413
+Node: GTY Options1518704
+Node: GGC Roots1529384
+Node: Files1530104
+Node: Invoking the garbage collector1532568
+Node: Funding1533621
+Node: GNU Project1536117
+Node: Copying1536766
+Node: GNU Free Documentation License1574297
+Node: Contributors1596706
+Node: Option Index1633036
+Node: Concept Index1633621
+
+End Tag Table
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/info/libgomp.info b/uclibc-crosstools-gcc-4.4.2-1/usr/info/libgomp.info
new file mode 100644
index 0000000..cd9a8aa
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/info/libgomp.info
@@ -0,0 +1,2455 @@
+This is libgomp.info, produced by makeinfo version 4.9 from
+/shared/myviews/toolchain/buildroot-4.4.2-1/output/toolchain/gcc-4.4.2/libgomp/libgomp.texi.
+
+ Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being "Funding Free Software", the Front-Cover texts
+being (a) (see below), and with the Back-Cover Texts being (b) (see
+below). A copy of the license is included in the section entitled "GNU
+Free Documentation License".
+
+ (a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+ (b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+software. Copies published by the Free Software Foundation raise
+funds for GNU development.
+
+INFO-DIR-SECTION GNU Libraries
+START-INFO-DIR-ENTRY
+* libgomp: (libgomp). GNU OpenMP runtime library
+END-INFO-DIR-ENTRY
+
+ This manual documents the GNU implementation of the OpenMP API for
+multi-platform shared-memory parallel programming in C/C++ and Fortran.
+
+ Published by the Free Software Foundation 51 Franklin Street, Fifth
+Floor Boston, MA 02110-1301 USA
+
+ Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being "Funding Free Software", the Front-Cover texts
+being (a) (see below), and with the Back-Cover Texts being (b) (see
+below). A copy of the license is included in the section entitled "GNU
+Free Documentation License".
+
+ (a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+ (b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+software. Copies published by the Free Software Foundation raise
+funds for GNU development.
+
+
+File: libgomp.info, Node: Top, Next: Enabling OpenMP, Up: (dir)
+
+Introduction
+************
+
+This manual documents the usage of libgomp, the GNU implementation of
+the OpenMP (http://www.openmp.org) Application Programming Interface
+(API) for multi-platform shared-memory parallel programming in C/C++
+and Fortran.
+
+* Menu:
+
+* Enabling OpenMP:: How to enable OpenMP for your applications.
+* Runtime Library Routines:: The OpenMP runtime application programming
+ interface.
+* Environment Variables:: Influencing runtime behavior with environment
+ variables.
+* The libgomp ABI:: Notes on the external ABI presented by libgomp.
+* Reporting Bugs:: How to report bugs in GNU OpenMP.
+* Copying:: GNU general public license says
+ how you can copy and share libgomp.
+* GNU Free Documentation License::
+ How you can copy and share this manual.
+* Funding:: How to help assure continued work for free
+ software.
+* Index:: Index of this documentation.
+
+
+File: libgomp.info, Node: Enabling OpenMP, Next: Runtime Library Routines, Prev: Top, Up: Top
+
+1 Enabling OpenMP
+*****************
+
+To activate the OpenMP extensions for C/C++ and Fortran, the
+compile-time flag `-fopenmp' must be specified. This enables the OpenMP
+directive `#pragma omp' in C/C++ and `!$omp' directives in free form,
+`c$omp', `*$omp' and `!$omp' directives in fixed form, `!$' conditional
+compilation sentinels in free form and `c$', `*$' and `!$' sentinels in
+fixed form, for Fortran. The flag also arranges for automatic linking
+of the OpenMP runtime library (*Note Runtime Library Routines::).
+
+ A complete description of all OpenMP directives accepted may be
+found in the OpenMP Application Program Interface
+(http://www.openmp.org) manual, version 3.0.
+
+
+File: libgomp.info, Node: Runtime Library Routines, Next: Environment Variables, Prev: Enabling OpenMP, Up: Top
+
+2 Runtime Library Routines
+**************************
+
+The runtime routines described here are defined by section 3 of the
+OpenMP specifications in version 3.0. The routines are structured in
+following three parts:
+
+ Control threads, processors and the parallel environment.
+
+* Menu:
+
+* omp_get_active_level:: Number of active parallel regions
+* omp_get_ancestor_thread_num:: Ancestor thread ID
+* omp_get_dynamic:: Dynamic teams setting
+* omp_get_level:: Number of parallel regions
+* omp_get_max_active_levels:: Maximal number of active regions
+* omp_get_max_threads:: Maximal number of threads of parallel region
+* omp_get_nested:: Nested parallel regions
+* omp_get_num_procs:: Number of processors online
+* omp_get_num_threads:: Size of the active team
+* omp_get_schedule:: Obtain the runtime scheduling method
+* omp_get_team_size:: Number of threads in a team
+* omp_get_thread_limit:: Maximal number of threads
+* omp_get_thread_num:: Current thread ID
+* omp_in_parallel:: Whether a parallel region is active
+* omp_set_dynamic:: Enable/disable dynamic teams
+* omp_set_max_active_levels:: Limits the number of active parallel regions
+* omp_set_nested:: Enable/disable nested parallel regions
+* omp_set_num_threads:: Set upper team size limit
+* omp_set_schedule:: Set the runtime scheduling method
+
+ Initialize, set, test, unset and destroy simple and nested locks.
+
+* Menu:
+
+* omp_init_lock:: Initialize simple lock
+* omp_set_lock:: Wait for and set simple lock
+* omp_test_lock:: Test and set simple lock if available
+* omp_unset_lock:: Unset simple lock
+* omp_destroy_lock:: Destroy simple lock
+* omp_init_nest_lock:: Initialize nested lock
+* omp_set_nest_lock:: Wait for and set simple lock
+* omp_test_nest_lock:: Test and set nested lock if available
+* omp_unset_nest_lock:: Unset nested lock
+* omp_destroy_nest_lock:: Destroy nested lock
+
+ Portable, thread-based, wall clock timer.
+
+* Menu:
+
+* omp_get_wtick:: Get timer precision.
+* omp_get_wtime:: Elapsed wall clock time.
+
+
+File: libgomp.info, Node: omp_get_active_level, Next: omp_get_ancestor_thread_num, Up: Runtime Library Routines
+
+2.1 `omp_get_active_level' - Number of parallel regions
+=======================================================
+
+_Description_:
+ This function returns the nesting level for the active parallel
+ blocks, which enclose the calling call.
+
+_C/C++_
+ _Prototype_: `int omp_get_active_level();'
+
+_Fortran_:
+ _Interface_: `integer omp_get_active_level()'
+
+_See also_:
+ *Note omp_get_level::, *Note omp_get_max_active_levels::, *Note
+ omp_set_max_active_levels::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section
+ 3.2.19.
+
+
+File: libgomp.info, Node: omp_get_ancestor_thread_num, Next: omp_get_dynamic, Prev: omp_get_active_level, Up: Runtime Library Routines
+
+2.2 `omp_get_ancestor_thread_num' - Ancestor thread ID
+======================================================
+
+_Description_:
+ This function returns the thread identification number for the
+ given nesting level of the current thread. For values of LEVEL
+ outside zero to `omp_get_level' -1 is returned; if LEVEL is
+ `omp_get_level' the result is identical to `omp_get_thread_num'.
+
+_C/C++_
+ _Prototype_: `int omp_get_ancestor_thread_num(int level);'
+
+_Fortran_:
+ _Interface_: `integer omp_ancestor_thread_num(level)'
+ `integer level'
+
+_See also_:
+ *Note omp_get_level::, *Note omp_get_thread_num::, *Note
+ omp_get_team_size::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section
+ 3.2.17.
+
+
+File: libgomp.info, Node: omp_get_dynamic, Next: omp_get_level, Prev: omp_get_ancestor_thread_num, Up: Runtime Library Routines
+
+2.3 `omp_get_dynamic' - Dynamic teams setting
+=============================================
+
+_Description_:
+ This function returns `true' if enabled, `false' otherwise. Here,
+ `true' and `false' represent their language-specific counterparts.
+
+ The dynamic team setting may be initialized at startup by the
+ `OMP_DYNAMIC' environment variable or at runtime using
+ `omp_set_dynamic'. If undefined, dynamic adjustment is disabled by
+ default.
+
+_C/C++_:
+ _Prototype_: `int omp_get_dynamic();'
+
+_Fortran_:
+ _Interface_: `logical function omp_get_dynamic()'
+
+_See also_:
+ *Note omp_set_dynamic::, *Note OMP_DYNAMIC::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 3.2.8.
+
+
+File: libgomp.info, Node: omp_get_level, Next: omp_get_max_active_levels, Prev: omp_get_dynamic, Up: Runtime Library Routines
+
+2.4 `omp_get_level' - Obtain the current nesting level
+======================================================
+
+_Description_:
+ This function returns the nesting level for the parallel blocks,
+ which enclose the calling call.
+
+_C/C++_
+ _Prototype_: `int omp_get level();'
+
+_Fortran_:
+ _Interface_: `integer omp_level()'
+
+_See also_:
+ *Note omp_get_active_level::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section
+ 3.2.16.
+
+
+File: libgomp.info, Node: omp_get_max_active_levels, Next: omp_get_max_threads, Prev: omp_get_level, Up: Runtime Library Routines
+
+2.5 `omp_set_max_active_levels' - Maximal number of active regions
+==================================================================
+
+_Description_:
+ This function obtains the maximally allowed number of nested,
+ active parallel regions.
+
+_C/C++_
+ _Prototype_: `int omp_get_max_active_levels();'
+
+_Fortran_:
+ _Interface_: `int omp_get_max_active_levels()'
+
+_See also_:
+ *Note omp_set_max_active_levels::, *Note omp_get_active_level::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section
+ 3.2.14.
+
+
+File: libgomp.info, Node: omp_get_max_threads, Next: omp_get_nested, Prev: omp_get_max_active_levels, Up: Runtime Library Routines
+
+2.6 `omp_get_max_threads' - Maximal number of threads of parallel region
+========================================================================
+
+_Description_:
+ Return the maximal number of threads used for the current parallel
+ region that does not use the clause `num_threads'.
+
+_C/C++_:
+ _Prototype_: `int omp_get_max_threads();'
+
+_Fortran_:
+ _Interface_: `integer function omp_get_max_threads()'
+
+_See also_:
+ *Note omp_set_num_threads::, *Note omp_set_dynamic::, *Note
+ omp_get_thread_limit::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 3.2.3.
+
+
+File: libgomp.info, Node: omp_get_nested, Next: omp_get_num_procs, Prev: omp_get_max_threads, Up: Runtime Library Routines
+
+2.7 `omp_get_nested' - Nested parallel regions
+==============================================
+
+_Description_:
+ This function returns `true' if nested parallel regions are
+ enabled, `false' otherwise. Here, `true' and `false' represent
+ their language-specific counterparts.
+
+ Nested parallel regions may be initialized at startup by the
+ `OMP_NESTED' environment variable or at runtime using
+ `omp_set_nested'. If undefined, nested parallel regions are
+ disabled by default.
+
+_C/C++_:
+ _Prototype_: `int omp_get_nested();'
+
+_Fortran_:
+ _Interface_: `integer function omp_get_nested()'
+
+_See also_:
+ *Note omp_set_nested::, *Note OMP_NESTED::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section
+ 3.2.10.
+
+
+File: libgomp.info, Node: omp_get_num_procs, Next: omp_get_num_threads, Prev: omp_get_nested, Up: Runtime Library Routines
+
+2.8 `omp_get_num_procs' - Number of processors online
+=====================================================
+
+_Description_:
+ Returns the number of processors online.
+
+_C/C++_:
+ _Prototype_: `int omp_get_num_procs();'
+
+_Fortran_:
+ _Interface_: `integer function omp_get_num_procs()'
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 3.2.5.
+
+
+File: libgomp.info, Node: omp_get_num_threads, Next: omp_get_schedule, Prev: omp_get_num_procs, Up: Runtime Library Routines
+
+2.9 `omp_get_num_threads' - Size of the active team
+===================================================
+
+_Description_:
+ The number of threads in the current team. In a sequential section
+ of the program `omp_get_num_threads' returns 1.
+
+ The default team size may be initialized at startup by the
+ `OMP_NUM_THREADS' environment variable. At runtime, the size of
+ the current team may be set either by the `NUM_THREADS' clause or
+ by `omp_set_num_threads'. If none of the above were used to define
+ a specific value and `OMP_DYNAMIC' is disabled, one thread per CPU
+ online is used.
+
+_C/C++_:
+ _Prototype_: `int omp_get_num_threads();'
+
+_Fortran_:
+ _Interface_: `integer function omp_get_num_threads()'
+
+_See also_:
+ *Note omp_get_max_threads::, *Note omp_set_num_threads::, *Note
+ OMP_NUM_THREADS::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 3.2.2.
+
+
+File: libgomp.info, Node: omp_get_schedule, Next: omp_get_team_size, Prev: omp_get_num_threads, Up: Runtime Library Routines
+
+2.10 `omp_get_schedule' - Obtain the runtime scheduling method
+==============================================================
+
+_Description_:
+ Obtain runtime the scheduling method. The KIND argument will be
+ set to the value `omp_sched_static', `omp_sched_dynamic',
+ `opm_sched_guided' or `auto'. The second argument, MODIFIER, is
+ set to the chunk size.
+
+_C/C++_
+ _Prototype_: `omp_schedule(omp_sched_t * kind, int *modifier);'
+
+_Fortran_:
+ _Interface_: `subroutine omp_schedule(kind, modifier)'
+ `integer(kind=omp_sched_kind) kind'
+ `integer modifier'
+
+_See also_:
+ *Note omp_set_schedule::, *Note OMP_SCHEDULE::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section
+ 3.2.12.
+
+
+File: libgomp.info, Node: omp_get_team_size, Next: omp_get_thread_limit, Prev: omp_get_schedule, Up: Runtime Library Routines
+
+2.11 `omp_get_team_size' - Number of threads in a team
+======================================================
+
+_Description_:
+ This function returns the number of threads in a thread team to
+ which either the current thread or its ancestor belongs. For
+ values of LEVEL outside zero to `omp_get_level' -1 is returned; if
+ LEVEL is zero 1 is returned and for `omp_get_level' the result is
+ identical to `omp_get_num_threads'.
+
+_C/C++_:
+ _Prototype_: `int omp_get_time_size(int level);'
+
+_Fortran_:
+ _Interface_: `integer function omp_get_team_size(level)'
+ `integer level'
+
+_See also_:
+ *Note omp_get_num_threads::, *Note omp_get_level::, *Note
+ omp_get_ancestor_thread_num::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section
+ 3.2.18.
+
+
+File: libgomp.info, Node: omp_get_thread_limit, Next: omp_get_thread_num, Prev: omp_get_team_size, Up: Runtime Library Routines
+
+2.12 `omp_get_thread_limit' - Maximal number of threads
+=======================================================
+
+_Description_:
+ Return the maximal number of threads of the program.
+
+_C/C++_:
+ _Prototype_: `int omp_get_thread_limit();'
+
+_Fortran_:
+ _Interface_: `integer function omp_get_thread_limit()'
+
+_See also_:
+ *Note omp_get_max_threads::, *Note OMP_THREAD_LIMIT::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section
+ 3.2.13.
+
+
+File: libgomp.info, Node: omp_get_thread_num, Next: omp_in_parallel, Prev: omp_get_thread_limit, Up: Runtime Library Routines
+
+2.13 `omp_get_thread_num' - Current thread ID
+=============================================
+
+_Description_:
+ Unique thread identification number within the current team. In a
+ sequential parts of the program, `omp_get_thread_num' always
+ returns 0. In parallel regions the return value varies from 0 to
+ `omp_get_num_threads'-1 inclusive. The return value of the master
+ thread of a team is always 0.
+
+_C/C++_:
+ _Prototype_: `int omp_get_thread_num();'
+
+_Fortran_:
+ _Interface_: `integer function omp_get_thread_num()'
+
+_See also_:
+ *Note omp_get_num_threads::, *Note omp_get_ancestor_thread_num::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 3.2.4.
+
+
+File: libgomp.info, Node: omp_in_parallel, Next: omp_set_dynamic, Prev: omp_get_thread_num, Up: Runtime Library Routines
+
+2.14 `omp_in_parallel' - Whether a parallel region is active
+============================================================
+
+_Description_:
+ This function returns `true' if currently running in parallel,
+ `false' otherwise. Here, `true' and `false' represent their
+ language-specific counterparts.
+
+_C/C++_:
+ _Prototype_: `int omp_in_parallel();'
+
+_Fortran_:
+ _Interface_: `logical function omp_in_parallel()'
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 3.2.6.
+
+
+File: libgomp.info, Node: omp_set_dynamic, Next: omp_set_max_active_levels, Prev: omp_in_parallel, Up: Runtime Library Routines
+
+2.15 `omp_set_dynamic' - Enable/disable dynamic teams
+=====================================================
+
+_Description_:
+ Enable or disable the dynamic adjustment of the number of threads
+ within a team. The function takes the language-specific equivalent
+ of `true' and `false', where `true' enables dynamic adjustment of
+ team sizes and `false' disables it.
+
+_C/C++_:
+ _Prototype_: `void omp_set_dynamic(int);'
+
+_Fortran_:
+ _Interface_: `subroutine omp_set_dynamic(set)'
+ `integer, intent(in) :: set'
+
+_See also_:
+ *Note OMP_DYNAMIC::, *Note omp_get_dynamic::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 3.2.7.
+
+
+File: libgomp.info, Node: omp_set_max_active_levels, Next: omp_set_nested, Prev: omp_set_dynamic, Up: Runtime Library Routines
+
+2.16 `omp_set_max_active_levels' - Limits the number of active parallel regions
+===============================================================================
+
+_Description_:
+ This function limits the maximally allowed number of nested,
+ active parallel regions.
+
+_C/C++_
+ _Prototype_: `omp_set_max_active_levels(int max_levels);'
+
+_Fortran_:
+ _Interface_: `omp_max_active_levels(max_levels)'
+ `integer max_levels'
+
+_See also_:
+ *Note omp_get_max_active_levels::, *Note omp_get_active_level::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section
+ 3.2.14.
+
+
+File: libgomp.info, Node: omp_set_nested, Next: omp_set_num_threads, Prev: omp_set_max_active_levels, Up: Runtime Library Routines
+
+2.17 `omp_set_nested' - Enable/disable nested parallel regions
+==============================================================
+
+_Description_:
+ Enable or disable nested parallel regions, i.e., whether team
+ members are allowed to create new teams. The function takes the
+ language-specific equivalent of `true' and `false', where `true'
+ enables dynamic adjustment of team sizes and `false' disables it.
+
+_C/C++_:
+ _Prototype_: `void omp_set_dynamic(int);'
+
+_Fortran_:
+ _Interface_: `subroutine omp_set_dynamic(set)'
+ `integer, intent(in) :: set'
+
+_See also_:
+ *Note OMP_NESTED::, *Note omp_get_nested::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 3.2.9.
+
+
+File: libgomp.info, Node: omp_set_num_threads, Next: omp_set_schedule, Prev: omp_set_nested, Up: Runtime Library Routines
+
+2.18 `omp_set_num_threads' - Set upper team size limit
+======================================================
+
+_Description_:
+ Specifies the number of threads used by default in subsequent
+ parallel sections, if those do not specify a `num_threads' clause.
+ The argument of `omp_set_num_threads' shall be a positive integer.
+
+_C/C++_:
+ _Prototype_: `void omp_set_num_threads(int);'
+
+_Fortran_:
+ _Interface_: `subroutine omp_set_num_threads(set)'
+ `integer, intent(in) :: set'
+
+_See also_:
+ *Note OMP_NUM_THREADS::, *Note omp_get_num_threads::, *Note
+ omp_get_max_threads::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 3.2.1.
+
+
+File: libgomp.info, Node: omp_set_schedule, Next: omp_init_lock, Prev: omp_set_num_threads, Up: Runtime Library Routines
+
+2.19 `omp_set_schedule' - Set the runtime scheduling method
+===========================================================
+
+_Description_:
+ Sets the runtime scheduling method. The KIND argument can have the
+ value `omp_sched_static', `omp_sched_dynamic', `opm_sched_guided'
+ or `omp_sched_auto'. Except for `omp_sched_auto', the chunk size
+ is set to the value of MODIFIER if positive or to the default
+ value if zero or negative. For `omp_sched_auto' the MODIFIER
+ argument is ignored.
+
+_C/C++_
+ _Prototype_: `int omp_schedule(omp_sched_t * kind, int *modifier);'
+
+_Fortran_:
+ _Interface_: `subroutine omp_schedule(kind, modifier)'
+ `integer(kind=omp_sched_kind) kind'
+ `integer modifier'
+
+_See also_:
+ *Note omp_get_schedule:: *Note OMP_SCHEDULE::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section
+ 3.2.11.
+
+
+File: libgomp.info, Node: omp_init_lock, Next: omp_set_lock, Prev: omp_set_schedule, Up: Runtime Library Routines
+
+2.20 `omp_init_lock' - Initialize simple lock
+=============================================
+
+_Description_:
+ Initialize a simple lock. After initialization, the lock is in an
+ unlocked state.
+
+_C/C++_:
+ _Prototype_: `void omp_init_lock(omp_lock_t *lock);'
+
+_Fortran_:
+ _Interface_: `subroutine omp_init_lock(lock)'
+ `integer(omp_lock_kind), intent(out) :: lock'
+
+_See also_:
+ *Note omp_destroy_lock::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 3.3.1.
+
+
+File: libgomp.info, Node: omp_set_lock, Next: omp_test_lock, Prev: omp_init_lock, Up: Runtime Library Routines
+
+2.21 `omp_set_lock' - Wait for and set simple lock
+==================================================
+
+_Description_:
+ Before setting a simple lock, the lock variable must be
+ initialized by `omp_init_lock'. The calling thread is blocked
+ until the lock is available. If the lock is already held by the
+ current thread, a deadlock occurs.
+
+_C/C++_:
+ _Prototype_: `void omp_set_lock(omp_lock_t *lock);'
+
+_Fortran_:
+ _Interface_: `subroutine omp_set_lock(lock)'
+ `integer(omp_lock_kind), intent(out) :: lock'
+
+_See also_:
+ *Note omp_init_lock::, *Note omp_test_lock::, *Note
+ omp_unset_lock::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 3.3.3.
+
+
+File: libgomp.info, Node: omp_test_lock, Next: omp_unset_lock, Prev: omp_set_lock, Up: Runtime Library Routines
+
+2.22 `omp_test_lock' - Test and set simple lock if available
+============================================================
+
+_Description_:
+ Before setting a simple lock, the lock variable must be
+ initialized by `omp_init_lock'. Contrary to `omp_set_lock',
+ `omp_test_lock' does not block if the lock is not available. This
+ function returns `true' upon success, `false' otherwise. Here,
+ `true' and `false' represent their language-specific counterparts.
+
+_C/C++_:
+ _Prototype_: `int omp_test_lock(omp_lock_t *lock);'
+
+_Fortran_:
+ _Interface_: `subroutine omp_test_lock(lock)'
+ `logical(omp_logical_kind) :: omp_test_lock'
+ `integer(omp_lock_kind), intent(out) :: lock'
+
+_See also_:
+ *Note omp_init_lock::, *Note omp_set_lock::, *Note omp_set_lock::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 3.3.5.
+
+
+File: libgomp.info, Node: omp_unset_lock, Next: omp_destroy_lock, Prev: omp_test_lock, Up: Runtime Library Routines
+
+2.23 `omp_unset_lock' - Unset simple lock
+=========================================
+
+_Description_:
+ A simple lock about to be unset must have been locked by
+ `omp_set_lock' or `omp_test_lock' before. In addition, the lock
+ must be held by the thread calling `omp_unset_lock'. Then, the
+ lock becomes unlocked. If one ore more threads attempted to set
+ the lock before, one of them is chosen to, again, set the lock for
+ itself.
+
+_C/C++_:
+ _Prototype_: `void omp_unset_lock(omp_lock_t *lock);'
+
+_Fortran_:
+ _Interface_: `subroutine omp_unset_lock(lock)'
+ `integer(omp_lock_kind), intent(out) :: lock'
+
+_See also_:
+ *Note omp_set_lock::, *Note omp_test_lock::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 3.3.4.
+
+
+File: libgomp.info, Node: omp_destroy_lock, Next: omp_init_nest_lock, Prev: omp_unset_lock, Up: Runtime Library Routines
+
+2.24 `omp_destroy_lock' - Destroy simple lock
+=============================================
+
+_Description_:
+ Destroy a simple lock. In order to be destroyed, a simple lock
+ must be in the unlocked state.
+
+_C/C++_:
+ _Prototype_: `void omp_destroy_lock(omp_lock_t *);'
+
+_Fortran_:
+ _Interface_: `subroutine omp_destroy_lock(lock)'
+ `integer(omp_lock_kind), intent(inout) :: lock'
+
+_See also_:
+ *Note omp_init_lock::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 3.3.2.
+
+
+File: libgomp.info, Node: omp_init_nest_lock, Next: omp_set_nest_lock, Prev: omp_destroy_lock, Up: Runtime Library Routines
+
+2.25 `omp_init_nest_lock' - Initialize nested lock
+==================================================
+
+_Description_:
+ Initialize a nested lock. After initialization, the lock is in an
+ unlocked state and the nesting count is set to zero.
+
+_C/C++_:
+ _Prototype_: `void omp_init_nest_lock(omp_nest_lock_t *lock);'
+
+_Fortran_:
+ _Interface_: `subroutine omp_init_nest_lock(lock)'
+ `integer(omp_nest_lock_kind), intent(out) :: lock'
+
+_See also_:
+ *Note omp_destroy_nest_lock::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 3.3.1.
+
+
+File: libgomp.info, Node: omp_set_nest_lock, Next: omp_test_nest_lock, Prev: omp_init_nest_lock, Up: Runtime Library Routines
+
+2.26 `omp_set_nest_lock' - Wait for and set simple lock
+=======================================================
+
+_Description_:
+ Before setting a nested lock, the lock variable must be
+ initialized by `omp_init_nest_lock'. The calling thread is blocked
+ until the lock is available. If the lock is already held by the
+ current thread, the nesting count for the lock in incremented.
+
+_C/C++_:
+ _Prototype_: `void omp_set_nest_lock(omp_nest_lock_t *lock);'
+
+_Fortran_:
+ _Interface_: `subroutine omp_set_nest_lock(lock)'
+ `integer(omp_nest_lock_kind), intent(out) :: lock'
+
+_See also_:
+ *Note omp_init_nest_lock::, *Note omp_unset_nest_lock::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 3.3.3.
+
+
+File: libgomp.info, Node: omp_test_nest_lock, Next: omp_unset_nest_lock, Prev: omp_set_nest_lock, Up: Runtime Library Routines
+
+2.27 `omp_test_nest_lock' - Test and set nested lock if available
+=================================================================
+
+_Description_:
+ Before setting a nested lock, the lock variable must be
+ initialized by `omp_init_nest_lock'. Contrary to
+ `omp_set_nest_lock', `omp_test_nest_lock' does not block if the
+ lock is not available. If the lock is already held by the current
+ thread, the new nesting count is returned. Otherwise, the return
+ value equals zero.
+
+_C/C++_:
+ _Prototype_: `int omp_test_nest_lock(omp_nest_lock_t *lock);'
+
+_Fortran_:
+ _Interface_: `integer function omp_test_nest_lock(lock)'
+ `integer(omp_integer_kind) :: omp_test_nest_lock'
+ `integer(omp_nest_lock_kind), intent(inout) :: lock'
+
+_See also_:
+ *Note omp_init_lock::, *Note omp_set_lock::, *Note omp_set_lock::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 3.3.5.
+
+
+File: libgomp.info, Node: omp_unset_nest_lock, Next: omp_destroy_nest_lock, Prev: omp_test_nest_lock, Up: Runtime Library Routines
+
+2.28 `omp_unset_nest_lock' - Unset nested lock
+==============================================
+
+_Description_:
+ A nested lock about to be unset must have been locked by
+ `omp_set_nested_lock' or `omp_test_nested_lock' before. In
+ addition, the lock must be held by the thread calling
+ `omp_unset_nested_lock'. If the nesting count drops to zero, the
+ lock becomes unlocked. If one ore more threads attempted to set
+ the lock before, one of them is chosen to, again, set the lock for
+ itself.
+
+_C/C++_:
+ _Prototype_: `void omp_unset_nest_lock(omp_nest_lock_t *lock);'
+
+_Fortran_:
+ _Interface_: `subroutine omp_unset_nest_lock(lock)'
+ `integer(omp_nest_lock_kind), intent(out) :: lock'
+
+_See also_:
+ *Note omp_set_nest_lock::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 3.3.4.
+
+
+File: libgomp.info, Node: omp_destroy_nest_lock, Next: omp_get_wtick, Prev: omp_unset_nest_lock, Up: Runtime Library Routines
+
+2.29 `omp_destroy_nest_lock' - Destroy nested lock
+==================================================
+
+_Description_:
+ Destroy a nested lock. In order to be destroyed, a nested lock
+ must be in the unlocked state and its nesting count must equal
+ zero.
+
+_C/C++_:
+ _Prototype_: `void omp_destroy_nest_lock(omp_nest_lock_t *);'
+
+_Fortran_:
+ _Interface_: `subroutine omp_destroy_nest_lock(lock)'
+ `integer(omp_nest_lock_kind), intent(inout) :: lock'
+
+_See also_:
+ *Note omp_init_lock::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 3.3.2.
+
+
+File: libgomp.info, Node: omp_get_wtick, Next: omp_get_wtime, Prev: omp_destroy_nest_lock, Up: Runtime Library Routines
+
+2.30 `omp_get_wtick' - Get timer precision
+==========================================
+
+_Description_:
+ Gets the timer precision, i.e., the number of seconds between two
+ successive clock ticks.
+
+_C/C++_:
+ _Prototype_: `double omp_get_wtick();'
+
+_Fortran_:
+ _Interface_: `double precision function omp_get_wtick()'
+
+_See also_:
+ *Note omp_get_wtime::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 3.4.2.
+
+
+File: libgomp.info, Node: omp_get_wtime, Prev: omp_get_wtick, Up: Runtime Library Routines
+
+2.31 `omp_get_wtime' - Elapsed wall clock time
+==============================================
+
+_Description_:
+ Elapsed wall clock time in seconds. The time is measured per
+ thread, no guarantee can bee made that two distinct threads
+ measure the same time. Time is measured from some "time in the
+ past". On POSIX compliant systems the seconds since the Epoch
+ (00:00:00 UTC, January 1, 1970) are returned.
+
+_C/C++_:
+ _Prototype_: `double omp_get_wtime();'
+
+_Fortran_:
+ _Interface_: `double precision function omp_get_wtime()'
+
+_See also_:
+ *Note omp_get_wtick::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 3.4.1.
+
+
+File: libgomp.info, Node: Environment Variables, Next: The libgomp ABI, Prev: Runtime Library Routines, Up: Top
+
+3 Environment Variables
+***********************
+
+The variables `OMP_DYNAMIC', `OMP_MAX_ACTIVE_LEVELS', `OMP_NESTED',
+`OMP_NUM_THREADS', `OMP_SCHEDULE', `OMP_STACKSIZE',`OMP_THREAD_LIMIT'
+and `OMP_WAIT_POLICY' are defined by section 4 of the OpenMP
+specifications in version 3.0, while `GOMP_CPU_AFFINITY' and
+`GOMP_STACKSIZE' are GNU extensions.
+
+* Menu:
+
+* OMP_DYNAMIC:: Dynamic adjustment of threads
+* OMP_MAX_ACTIVE_LEVELS:: Set the maximal number of nested parallel regions
+* OMP_NESTED:: Nested parallel regions
+* OMP_NUM_THREADS:: Specifies the number of threads to use
+* OMP_STACKSIZE:: Set default thread stack size
+* OMP_SCHEDULE:: How threads are scheduled
+* OMP_THREAD_LIMIT:: Set the maximal number of threads
+* OMP_WAIT_POLICY:: How waiting threads are handled
+* GOMP_CPU_AFFINITY:: Bind threads to specific CPUs
+* GOMP_STACKSIZE:: Set default thread stack size
+
+
+File: libgomp.info, Node: OMP_DYNAMIC, Next: OMP_MAX_ACTIVE_LEVELS, Up: Environment Variables
+
+3.1 `OMP_DYNAMIC' - Dynamic adjustment of threads
+=================================================
+
+_Description_:
+ Enable or disable the dynamic adjustment of the number of threads
+ within a team. The value of this environment variable shall be
+ `TRUE' or `FALSE'. If undefined, dynamic adjustment is disabled by
+ default.
+
+_See also_:
+ *Note omp_set_dynamic::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 4.3
+
+
+File: libgomp.info, Node: OMP_MAX_ACTIVE_LEVELS, Next: OMP_NESTED, Prev: OMP_DYNAMIC, Up: Environment Variables
+
+3.2 `OMP_MAX_ACTIVE_LEVELS' - Set the maximal number of nested parallel regions
+===============================================================================
+
+_Description_:
+ Specifies the initial value for the maximal number of nested
+ parallel regions. The value of this variable shall be positive
+ integer. If undefined, the number of active levels is unlimited.
+
+_See also_:
+ *Note omp_set_max_active_levels::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 4.7
+
+
+File: libgomp.info, Node: OMP_NESTED, Next: OMP_NUM_THREADS, Prev: OMP_MAX_ACTIVE_LEVELS, Up: Environment Variables
+
+3.3 `OMP_NESTED' - Nested parallel regions
+==========================================
+
+_Description_:
+ Enable or disable nested parallel regions, i.e., whether team
+ members are allowed to create new teams. The value of this
+ environment variable shall be `TRUE' or `FALSE'. If undefined,
+ nested parallel regions are disabled by default.
+
+_See also_:
+ *Note omp_set_nested::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 4.4
+
+
+File: libgomp.info, Node: OMP_NUM_THREADS, Next: OMP_STACKSIZE, Prev: OMP_NESTED, Up: Environment Variables
+
+3.4 `OMP_NUM_THREADS' - Specifies the number of threads to use
+==============================================================
+
+_Description_:
+ Specifies the default number of threads to use in parallel
+ regions. The value of this variable shall be positive integer. If
+ undefined one thread per CPU online is used.
+
+_See also_:
+ *Note omp_set_num_threads::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 4.2
+
+
+File: libgomp.info, Node: OMP_SCHEDULE, Next: OMP_THREAD_LIMIT, Prev: OMP_STACKSIZE, Up: Environment Variables
+
+3.5 `OMP_SCHEDULE' - How threads are scheduled
+==============================================
+
+_Description_:
+ Allows to specify `schedule type' and `chunk size'. The value of
+ the variable shall have the form: `type[,chunk]' where `type' is
+ one of `static', `dynamic', `guided' or `auto' The optional
+ `chunk' size shall be a positive integer. If undefined, dynamic
+ scheduling and a chunk size of 1 is used.
+
+_See also_:
+ *Note omp_set_schedule::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), sections
+ 2.5.1 and 4.1
+
+
+File: libgomp.info, Node: OMP_STACKSIZE, Next: OMP_SCHEDULE, Prev: OMP_NUM_THREADS, Up: Environment Variables
+
+3.6 `OMP_STACKSIZE' - Set default thread stack size
+===================================================
+
+_Description_:
+ Set the default thread stack size in kilobytes, unless the number
+ is suffixed by `B', `K', `M' or `G', in which case the size is,
+ respectively, in bytes, kilobytes, megabytes or gigabytes. This is
+ different from `pthread_attr_setstacksize' which gets the number
+ of bytes as an argument. If the stacksize can not be set due to
+ system constraints, an error is reported and the initial stacksize
+ is left unchanged. If undefined, the stack size is system
+ dependent.
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), sections 4.5
+
+
+File: libgomp.info, Node: OMP_THREAD_LIMIT, Next: OMP_WAIT_POLICY, Prev: OMP_SCHEDULE, Up: Environment Variables
+
+3.7 `OMP_THREAD_LIMIT' - Set the maximal number of threads
+==========================================================
+
+_Description_:
+ Specifies the number of threads to use for the whole program. The
+ value of this variable shall be positive integer. If undefined,
+ the number of threads is not limited.
+
+_See also_:
+ *Note OMP_NUM_THREADS:: *Note omp_get_thread_limit::
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), section 4.8
+
+
+File: libgomp.info, Node: OMP_WAIT_POLICY, Next: GOMP_CPU_AFFINITY, Prev: OMP_THREAD_LIMIT, Up: Environment Variables
+
+3.8 `OMP_WAIT_POLICY' - How waiting threads are handled
+=======================================================
+
+_Description_:
+ Specifies whether waiting threads should be active or passive. If
+ the value is `PASSIVE', waiting threads should not consume CPU
+ power while waiting; while the value is `ACTIVE' specifies that
+ they should.
+
+_Reference_:
+ OpenMP specifications v3.0 (http://www.openmp.org/), sections 4.6
+
+
+File: libgomp.info, Node: GOMP_CPU_AFFINITY, Next: GOMP_STACKSIZE, Prev: OMP_WAIT_POLICY, Up: Environment Variables
+
+3.9 `GOMP_CPU_AFFINITY' - Bind threads to specific CPUs
+=======================================================
+
+_Description_:
+ Binds threads to specific CPUs. The variable should contain a
+ space- or comma-separated list of CPUs. This list may contain
+ different kind of entries: either single CPU numbers in any order,
+ a range of CPUs (M-N) or a range with some stride (M-N:S). CPU
+ numbers are zero based. For example, `GOMP_CPU_AFFINITY="0 3 1-2
+ 4-15:2"' will bind the initial thread to CPU 0, the second to CPU
+ 3, the third to CPU 1, the fourth to CPU 2, the fifth to CPU 4,
+ the sixth through tenth to CPUs 6, 8, 10, 12, and 14 respectively
+ and then start assigning back from the beginning of the list.
+ `GOMP_CPU_AFFINITY=0' binds all threads to CPU 0.
+
+ There is no GNU OpenMP library routine to determine whether a CPU
+ affinity specification is in effect. As a workaround,
+ language-specific library functions, e.g., `getenv' in C or
+ `GET_ENVIRONMENT_VARIABLE' in Fortran, may be used to query the
+ setting of the `GOMP_CPU_AFFINITY' environment variable. A defined
+ CPU affinity on startup cannot be changed or disabled during the
+ runtime of the application.
+
+ If this environment variable is omitted, the host system will
+ handle the assignment of threads to CPUs.
+
+
+File: libgomp.info, Node: GOMP_STACKSIZE, Prev: GOMP_CPU_AFFINITY, Up: Environment Variables
+
+3.10 `GOMP_STACKSIZE' - Set default thread stack size
+=====================================================
+
+_Description_:
+ Set the default thread stack size in kilobytes. This is different
+ from `pthread_attr_setstacksize' which gets the number of bytes as
+ an argument. If the stacksize can not be set due to system
+ constraints, an error is reported and the initial stacksize is
+ left unchanged. If undefined, the stack size is system dependent.
+
+_See also_:
+ *Note GOMP_STACKSIZE::
+
+_Reference_:
+ GCC Patches Mailinglist
+ (http://gcc.gnu.org/ml/gcc-patches/2006-06/msg00493.html), GCC
+ Patches Mailinglist
+ (http://gcc.gnu.org/ml/gcc-patches/2006-06/msg00496.html)
+
+
+File: libgomp.info, Node: The libgomp ABI, Next: Reporting Bugs, Prev: Environment Variables, Up: Top
+
+4 The libgomp ABI
+*****************
+
+The following sections present notes on the external ABI as presented
+by libgomp. Only maintainers should need them.
+
+* Menu:
+
+* Implementing MASTER construct::
+* Implementing CRITICAL construct::
+* Implementing ATOMIC construct::
+* Implementing FLUSH construct::
+* Implementing BARRIER construct::
+* Implementing THREADPRIVATE construct::
+* Implementing PRIVATE clause::
+* Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses::
+* Implementing REDUCTION clause::
+* Implementing PARALLEL construct::
+* Implementing FOR construct::
+* Implementing ORDERED construct::
+* Implementing SECTIONS construct::
+* Implementing SINGLE construct::
+
+
+File: libgomp.info, Node: Implementing MASTER construct, Next: Implementing CRITICAL construct, Up: The libgomp ABI
+
+4.1 Implementing MASTER construct
+=================================
+
+ if (omp_get_thread_num () == 0)
+ block
+
+ Alternately, we generate two copies of the parallel subfunction and
+only include this in the version run by the master thread. Surely
+that's not worthwhile though...
+
+
+File: libgomp.info, Node: Implementing CRITICAL construct, Next: Implementing ATOMIC construct, Prev: Implementing MASTER construct, Up: The libgomp ABI
+
+4.2 Implementing CRITICAL construct
+===================================
+
+Without a specified name,
+
+ void GOMP_critical_start (void);
+ void GOMP_critical_end (void);
+
+ so that we don't get COPY relocations from libgomp to the main
+application.
+
+ With a specified name, use omp_set_lock and omp_unset_lock with name
+being transformed into a variable declared like
+
+ omp_lock_t gomp_critical_user_<name> __attribute__((common))
+
+ Ideally the ABI would specify that all zero is a valid unlocked
+state, and so we wouldn't actually need to initialize this at startup.
+
+
+File: libgomp.info, Node: Implementing ATOMIC construct, Next: Implementing FLUSH construct, Prev: Implementing CRITICAL construct, Up: The libgomp ABI
+
+4.3 Implementing ATOMIC construct
+=================================
+
+The target should implement the `__sync' builtins.
+
+ Failing that we could add
+
+ void GOMP_atomic_enter (void)
+ void GOMP_atomic_exit (void)
+
+ which reuses the regular lock code, but with yet another lock object
+private to the library.
+
+
+File: libgomp.info, Node: Implementing FLUSH construct, Next: Implementing BARRIER construct, Prev: Implementing ATOMIC construct, Up: The libgomp ABI
+
+4.4 Implementing FLUSH construct
+================================
+
+Expands to the `__sync_synchronize' builtin.
+
+
+File: libgomp.info, Node: Implementing BARRIER construct, Next: Implementing THREADPRIVATE construct, Prev: Implementing FLUSH construct, Up: The libgomp ABI
+
+4.5 Implementing BARRIER construct
+==================================
+
+ void GOMP_barrier (void)
+
+
+File: libgomp.info, Node: Implementing THREADPRIVATE construct, Next: Implementing PRIVATE clause, Prev: Implementing BARRIER construct, Up: The libgomp ABI
+
+4.6 Implementing THREADPRIVATE construct
+========================================
+
+In _most_ cases we can map this directly to `__thread'. Except that
+OMP allows constructors for C++ objects. We can either refuse to
+support this (how often is it used?) or we can implement something akin
+to .ctors.
+
+ Even more ideally, this ctor feature is handled by extensions to the
+main pthreads library. Failing that, we can have a set of entry points
+to register ctor functions to be called.
+
+
+File: libgomp.info, Node: Implementing PRIVATE clause, Next: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses, Prev: Implementing THREADPRIVATE construct, Up: The libgomp ABI
+
+4.7 Implementing PRIVATE clause
+===============================
+
+In association with a PARALLEL, or within the lexical extent of a
+PARALLEL block, the variable becomes a local variable in the parallel
+subfunction.
+
+ In association with FOR or SECTIONS blocks, create a new automatic
+variable within the current function. This preserves the semantic of
+new variable creation.
+
+
+File: libgomp.info, Node: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses, Next: Implementing REDUCTION clause, Prev: Implementing PRIVATE clause, Up: The libgomp ABI
+
+4.8 Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses
+========================================================================
+
+Seems simple enough for PARALLEL blocks. Create a private struct for
+communicating between parent and subfunction. In the parent, copy in
+values for scalar and "small" structs; copy in addresses for others
+TREE_ADDRESSABLE types. In the subfunction, copy the value into the
+local variable.
+
+ Not clear at all what to do with bare FOR or SECTION blocks. The
+only thing I can figure is that we do something like
+
+ #pragma omp for firstprivate(x) lastprivate(y)
+ for (int i = 0; i < n; ++i)
+ body;
+
+ which becomes
+
+ {
+ int x = x, y;
+
+ // for stuff
+
+ if (i == n)
+ y = y;
+ }
+
+ where the "x=x" and "y=y" assignments actually have different uids
+for the two variables, i.e. not something you could write directly in
+C. Presumably this only makes sense if the "outer" x and y are global
+variables.
+
+ COPYPRIVATE would work the same way, except the structure broadcast
+would have to happen via SINGLE machinery instead.
+
+
+File: libgomp.info, Node: Implementing REDUCTION clause, Next: Implementing PARALLEL construct, Prev: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses, Up: The libgomp ABI
+
+4.9 Implementing REDUCTION clause
+=================================
+
+The private struct mentioned in the previous section should have a
+pointer to an array of the type of the variable, indexed by the
+thread's TEAM_ID. The thread stores its final value into the array,
+and after the barrier the master thread iterates over the array to
+collect the values.
+
+
+File: libgomp.info, Node: Implementing PARALLEL construct, Next: Implementing FOR construct, Prev: Implementing REDUCTION clause, Up: The libgomp ABI
+
+4.10 Implementing PARALLEL construct
+====================================
+
+ #pragma omp parallel
+ {
+ body;
+ }
+
+ becomes
+
+ void subfunction (void *data)
+ {
+ use data;
+ body;
+ }
+
+ setup data;
+ GOMP_parallel_start (subfunction, &data, num_threads);
+ subfunction (&data);
+ GOMP_parallel_end ();
+
+ void GOMP_parallel_start (void (*fn)(void *), void *data, unsigned num_threads)
+
+ The FN argument is the subfunction to be run in parallel.
+
+ The DATA argument is a pointer to a structure used to communicate
+data in and out of the subfunction, as discussed above with respect to
+FIRSTPRIVATE et al.
+
+ The NUM_THREADS argument is 1 if an IF clause is present and false,
+or the value of the NUM_THREADS clause, if present, or 0.
+
+ The function needs to create the appropriate number of threads
+and/or launch them from the dock. It needs to create the team
+structure and assign team ids.
+
+ void GOMP_parallel_end (void)
+
+ Tears down the team and returns us to the previous
+`omp_in_parallel()' state.
+
+
+File: libgomp.info, Node: Implementing FOR construct, Next: Implementing ORDERED construct, Prev: Implementing PARALLEL construct, Up: The libgomp ABI
+
+4.11 Implementing FOR construct
+===============================
+
+ #pragma omp parallel for
+ for (i = lb; i <= ub; i++)
+ body;
+
+ becomes
+
+ void subfunction (void *data)
+ {
+ long _s0, _e0;
+ while (GOMP_loop_static_next (&_s0, &_e0))
+ {
+ long _e1 = _e0, i;
+ for (i = _s0; i < _e1; i++)
+ body;
+ }
+ GOMP_loop_end_nowait ();
+ }
+
+ GOMP_parallel_loop_static (subfunction, NULL, 0, lb, ub+1, 1, 0);
+ subfunction (NULL);
+ GOMP_parallel_end ();
+
+ #pragma omp for schedule(runtime)
+ for (i = 0; i < n; i++)
+ body;
+
+ becomes
+
+ {
+ long i, _s0, _e0;
+ if (GOMP_loop_runtime_start (0, n, 1, &_s0, &_e0))
+ do {
+ long _e1 = _e0;
+ for (i = _s0, i < _e0; i++)
+ body;
+ } while (GOMP_loop_runtime_next (&_s0, _&e0));
+ GOMP_loop_end ();
+ }
+
+ Note that while it looks like there is trickyness to propagating a
+non-constant STEP, there isn't really. We're explicitly allowed to
+evaluate it as many times as we want, and any variables involved should
+automatically be handled as PRIVATE or SHARED like any other variables.
+So the expression should remain evaluable in the subfunction. We can
+also pull it into a local variable if we like, but since its supposed
+to remain unchanged, we can also not if we like.
+
+ If we have SCHEDULE(STATIC), and no ORDERED, then we ought to be
+able to get away with no work-sharing context at all, since we can
+simply perform the arithmetic directly in each thread to divide up the
+iterations. Which would mean that we wouldn't need to call any of
+these routines.
+
+ There are separate routines for handling loops with an ORDERED
+clause. Bookkeeping for that is non-trivial...
+
+
+File: libgomp.info, Node: Implementing ORDERED construct, Next: Implementing SECTIONS construct, Prev: Implementing FOR construct, Up: The libgomp ABI
+
+4.12 Implementing ORDERED construct
+===================================
+
+ void GOMP_ordered_start (void)
+ void GOMP_ordered_end (void)
+
+
+File: libgomp.info, Node: Implementing SECTIONS construct, Next: Implementing SINGLE construct, Prev: Implementing ORDERED construct, Up: The libgomp ABI
+
+4.13 Implementing SECTIONS construct
+====================================
+
+A block as
+
+ #pragma omp sections
+ {
+ #pragma omp section
+ stmt1;
+ #pragma omp section
+ stmt2;
+ #pragma omp section
+ stmt3;
+ }
+
+ becomes
+
+ for (i = GOMP_sections_start (3); i != 0; i = GOMP_sections_next ())
+ switch (i)
+ {
+ case 1:
+ stmt1;
+ break;
+ case 2:
+ stmt2;
+ break;
+ case 3:
+ stmt3;
+ break;
+ }
+ GOMP_barrier ();
+
+
+File: libgomp.info, Node: Implementing SINGLE construct, Prev: Implementing SECTIONS construct, Up: The libgomp ABI
+
+4.14 Implementing SINGLE construct
+==================================
+
+A block like
+
+ #pragma omp single
+ {
+ body;
+ }
+
+ becomes
+
+ if (GOMP_single_start ())
+ body;
+ GOMP_barrier ();
+
+ while
+
+ #pragma omp single copyprivate(x)
+ body;
+
+ becomes
+
+ datap = GOMP_single_copy_start ();
+ if (datap == NULL)
+ {
+ body;
+ data.x = x;
+ GOMP_single_copy_end (&data);
+ }
+ else
+ x = datap->x;
+ GOMP_barrier ();
+
+
+File: libgomp.info, Node: Reporting Bugs, Next: Copying, Prev: The libgomp ABI, Up: Top
+
+5 Reporting Bugs
+****************
+
+Bugs in the GNU OpenMP implementation should be reported via bugzilla
+(http://gcc.gnu.org/bugzilla/). In all cases, please add "openmp" to
+the keywords field in the bug report.
+
+
+File: libgomp.info, Node: Copying, Next: GNU Free Documentation License, Prev: Reporting Bugs, Up: Top
+
+GNU GENERAL PUBLIC LICENSE
+**************************
+
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+Preamble
+========
+
+The licenses for most software are designed to take away your freedom
+to share and change it. By contrast, the GNU General Public License is
+intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it in
+new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software,
+and (2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+ 0. This License applies to any program or other work which contains a
+ notice placed by the copyright holder saying it may be distributed
+ under the terms of this General Public License. The "Program",
+ below, refers to any such program or work, and a "work based on
+ the Program" means either the Program or any derivative work under
+ copyright law: that is to say, a work containing the Program or a
+ portion of it, either verbatim or with modifications and/or
+ translated into another language. (Hereinafter, translation is
+ included without limitation in the term "modification".) Each
+ licensee is addressed as "you".
+
+ Activities other than copying, distribution and modification are
+ not covered by this License; they are outside its scope. The act
+ of running the Program is not restricted, and the output from the
+ Program is covered only if its contents constitute a work based on
+ the Program (independent of having been made by running the
+ Program). Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+ source code as you receive it, in any medium, provided that you
+ conspicuously and appropriately publish on each copy an appropriate
+ copyright notice and disclaimer of warranty; keep intact all the
+ notices that refer to this License and to the absence of any
+ warranty; and give any other recipients of the Program a copy of
+ this License along with the Program.
+
+ You may charge a fee for the physical act of transferring a copy,
+ and you may at your option offer warranty protection in exchange
+ for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+ of it, thus forming a work based on the Program, and copy and
+ distribute such modifications or work under the terms of Section 1
+ above, provided that you also meet all of these conditions:
+
+ a. You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b. You must cause any work that you distribute or publish, that
+ in whole or in part contains or is derived from the Program
+ or any part thereof, to be licensed as a whole at no charge
+ to all third parties under the terms of this License.
+
+ c. If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display
+ an announcement including an appropriate copyright notice and
+ a notice that there is no warranty (or else, saying that you
+ provide a warranty) and that users may redistribute the
+ program under these conditions, and telling the user how to
+ view a copy of this License. (Exception: if the Program
+ itself is interactive but does not normally print such an
+ announcement, your work based on the Program is not required
+ to print an announcement.)
+
+ These requirements apply to the modified work as a whole. If
+ identifiable sections of that work are not derived from the
+ Program, and can be reasonably considered independent and separate
+ works in themselves, then this License, and its terms, do not
+ apply to those sections when you distribute them as separate
+ works. But when you distribute the same sections as part of a
+ whole which is a work based on the Program, the distribution of
+ the whole must be on the terms of this License, whose permissions
+ for other licensees extend to the entire whole, and thus to each
+ and every part regardless of who wrote it.
+
+ Thus, it is not the intent of this section to claim rights or
+ contest your rights to work written entirely by you; rather, the
+ intent is to exercise the right to control the distribution of
+ derivative or collective works based on the Program.
+
+ In addition, mere aggregation of another work not based on the
+ Program with the Program (or with a work based on the Program) on
+ a volume of a storage or distribution medium does not bring the
+ other work under the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+ under Section 2) in object code or executable form under the terms
+ of Sections 1 and 2 above provided that you also do one of the
+ following:
+
+ a. Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of
+ Sections 1 and 2 above on a medium customarily used for
+ software interchange; or,
+
+ b. Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a
+ medium customarily used for software interchange; or,
+
+ c. Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with
+ such an offer, in accord with Subsection b above.)
+
+ The source code for a work means the preferred form of the work for
+ making modifications to it. For an executable work, complete
+ source code means all the source code for all modules it contains,
+ plus any associated interface definition files, plus the scripts
+ used to control compilation and installation of the executable.
+ However, as a special exception, the source code distributed need
+ not include anything that is normally distributed (in either
+ source or binary form) with the major components (compiler,
+ kernel, and so on) of the operating system on which the executable
+ runs, unless that component itself accompanies the executable.
+
+ If distribution of executable or object code is made by offering
+ access to copy from a designated place, then offering equivalent
+ access to copy the source code from the same place counts as
+ distribution of the source code, even though third parties are not
+ compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+ except as expressly provided under this License. Any attempt
+ otherwise to copy, modify, sublicense or distribute the Program is
+ void, and will automatically terminate your rights under this
+ License. However, parties who have received copies, or rights,
+ from you under this License will not have their licenses
+ terminated so long as such parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+ signed it. However, nothing else grants you permission to modify
+ or distribute the Program or its derivative works. These actions
+ are prohibited by law if you do not accept this License.
+ Therefore, by modifying or distributing the Program (or any work
+ based on the Program), you indicate your acceptance of this
+ License to do so, and all its terms and conditions for copying,
+ distributing or modifying the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+ Program), the recipient automatically receives a license from the
+ original licensor to copy, distribute or modify the Program
+ subject to these terms and conditions. You may not impose any
+ further restrictions on the recipients' exercise of the rights
+ granted herein. You are not responsible for enforcing compliance
+ by third parties to this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+ infringement or for any other reason (not limited to patent
+ issues), conditions are imposed on you (whether by court order,
+ agreement or otherwise) that contradict the conditions of this
+ License, they do not excuse you from the conditions of this
+ License. If you cannot distribute so as to satisfy simultaneously
+ your obligations under this License and any other pertinent
+ obligations, then as a consequence you may not distribute the
+ Program at all. For example, if a patent license would not permit
+ royalty-free redistribution of the Program by all those who
+ receive copies directly or indirectly through you, then the only
+ way you could satisfy both it and this License would be to refrain
+ entirely from distribution of the Program.
+
+ If any portion of this section is held invalid or unenforceable
+ under any particular circumstance, the balance of the section is
+ intended to apply and the section as a whole is intended to apply
+ in other circumstances.
+
+ It is not the purpose of this section to induce you to infringe any
+ patents or other property right claims or to contest validity of
+ any such claims; this section has the sole purpose of protecting
+ the integrity of the free software distribution system, which is
+ implemented by public license practices. Many people have made
+ generous contributions to the wide range of software distributed
+ through that system in reliance on consistent application of that
+ system; it is up to the author/donor to decide if he or she is
+ willing to distribute software through any other system and a
+ licensee cannot impose that choice.
+
+ This section is intended to make thoroughly clear what is believed
+ to be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+ certain countries either by patents or by copyrighted interfaces,
+ the original copyright holder who places the Program under this
+ License may add an explicit geographical distribution limitation
+ excluding those countries, so that distribution is permitted only
+ in or among countries not thus excluded. In such case, this
+ License incorporates the limitation as if written in the body of
+ this License.
+
+ 9. The Free Software Foundation may publish revised and/or new
+ versions of the General Public License from time to time. Such
+ new versions will be similar in spirit to the present version, but
+ may differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+ Program specifies a version number of this License which applies
+ to it and "any later version", you have the option of following
+ the terms and conditions either of that version or of any later
+ version published by the Free Software Foundation. If the Program
+ does not specify a version number of this License, you may choose
+ any version ever published by the Free Software Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+ programs whose distribution conditions are different, write to the
+ author to ask for permission. For software which is copyrighted
+ by the Free Software Foundation, write to the Free Software
+ Foundation; we sometimes make exceptions for this. Our decision
+ will be guided by the two goals of preserving the free status of
+ all derivatives of our free software and of promoting the sharing
+ and reuse of software generally.
+
+ NO WARRANTY
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
+ WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
+ LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
+ WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
+ NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE
+ QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
+ SERVICING, REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+ WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
+ MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
+ LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
+ INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
+ INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
+ OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
+ OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+Appendix: How to Apply These Terms to Your New Programs
+=======================================================
+
+If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these
+terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
+ Copyright (C) YEAR NAME OF AUTHOR
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+ Also add information on how to contact you by electronic and paper
+mail.
+
+ If the program is interactive, make it output a short notice like
+this when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) YEAR NAME OF AUTHOR
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
+ type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+ The hypothetical commands `show w' and `show c' should show the
+appropriate parts of the General Public License. Of course, the
+commands you use may be called something other than `show w' and `show
+c'; they could even be mouse-clicks or menu items--whatever suits your
+program.
+
+ You should also get your employer (if you work as a programmer) or
+your school, if any, to sign a "copyright disclaimer" for the program,
+if necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ SIGNATURE OF TY COON, 1 April 1989
+ Ty Coon, President of Vice
+
+ This General Public License does not permit incorporating your
+program into proprietary programs. If your program is a subroutine
+library, you may consider it more useful to permit linking proprietary
+applications with the library. If this is what you want to do, use the
+GNU Library General Public License instead of this License.
+
+
+File: libgomp.info, Node: GNU Free Documentation License, Next: Funding, Prev: Copying, Up: Top
+
+GNU Free Documentation License
+******************************
+
+ Version 1.2, November 2002
+
+ Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ 0. PREAMBLE
+
+ The purpose of this License is to make a manual, textbook, or other
+ functional and useful document "free" in the sense of freedom: to
+ assure everyone the effective freedom to copy and redistribute it,
+ with or without modifying it, either commercially or
+ noncommercially. Secondarily, this License preserves for the
+ author and publisher a way to get credit for their work, while not
+ being considered responsible for modifications made by others.
+
+ This License is a kind of "copyleft", which means that derivative
+ works of the document must themselves be free in the same sense.
+ It complements the GNU General Public License, which is a copyleft
+ license designed for free software.
+
+ We have designed this License in order to use it for manuals for
+ free software, because free software needs free documentation: a
+ free program should come with manuals providing the same freedoms
+ that the software does. But this License is not limited to
+ software manuals; it can be used for any textual work, regardless
+ of subject matter or whether it is published as a printed book.
+ We recommend this License principally for works whose purpose is
+ instruction or reference.
+
+ 1. APPLICABILITY AND DEFINITIONS
+
+ This License applies to any manual or other work, in any medium,
+ that contains a notice placed by the copyright holder saying it
+ can be distributed under the terms of this License. Such a notice
+ grants a world-wide, royalty-free license, unlimited in duration,
+ to use that work under the conditions stated herein. The
+ "Document", below, refers to any such manual or work. Any member
+ of the public is a licensee, and is addressed as "you". You
+ accept the license if you copy, modify or distribute the work in a
+ way requiring permission under copyright law.
+
+ A "Modified Version" of the Document means any work containing the
+ Document or a portion of it, either copied verbatim, or with
+ modifications and/or translated into another language.
+
+ A "Secondary Section" is a named appendix or a front-matter section
+ of the Document that deals exclusively with the relationship of the
+ publishers or authors of the Document to the Document's overall
+ subject (or to related matters) and contains nothing that could
+ fall directly within that overall subject. (Thus, if the Document
+ is in part a textbook of mathematics, a Secondary Section may not
+ explain any mathematics.) The relationship could be a matter of
+ historical connection with the subject or with related matters, or
+ of legal, commercial, philosophical, ethical or political position
+ regarding them.
+
+ The "Invariant Sections" are certain Secondary Sections whose
+ titles are designated, as being those of Invariant Sections, in
+ the notice that says that the Document is released under this
+ License. If a section does not fit the above definition of
+ Secondary then it is not allowed to be designated as Invariant.
+ The Document may contain zero Invariant Sections. If the Document
+ does not identify any Invariant Sections then there are none.
+
+ The "Cover Texts" are certain short passages of text that are
+ listed, as Front-Cover Texts or Back-Cover Texts, in the notice
+ that says that the Document is released under this License. A
+ Front-Cover Text may be at most 5 words, and a Back-Cover Text may
+ be at most 25 words.
+
+ A "Transparent" copy of the Document means a machine-readable copy,
+ represented in a format whose specification is available to the
+ general public, that is suitable for revising the document
+ straightforwardly with generic text editors or (for images
+ composed of pixels) generic paint programs or (for drawings) some
+ widely available drawing editor, and that is suitable for input to
+ text formatters or for automatic translation to a variety of
+ formats suitable for input to text formatters. A copy made in an
+ otherwise Transparent file format whose markup, or absence of
+ markup, has been arranged to thwart or discourage subsequent
+ modification by readers is not Transparent. An image format is
+ not Transparent if used for any substantial amount of text. A
+ copy that is not "Transparent" is called "Opaque".
+
+ Examples of suitable formats for Transparent copies include plain
+ ASCII without markup, Texinfo input format, LaTeX input format,
+ SGML or XML using a publicly available DTD, and
+ standard-conforming simple HTML, PostScript or PDF designed for
+ human modification. Examples of transparent image formats include
+ PNG, XCF and JPG. Opaque formats include proprietary formats that
+ can be read and edited only by proprietary word processors, SGML or
+ XML for which the DTD and/or processing tools are not generally
+ available, and the machine-generated HTML, PostScript or PDF
+ produced by some word processors for output purposes only.
+
+ The "Title Page" means, for a printed book, the title page itself,
+ plus such following pages as are needed to hold, legibly, the
+ material this License requires to appear in the title page. For
+ works in formats which do not have any title page as such, "Title
+ Page" means the text near the most prominent appearance of the
+ work's title, preceding the beginning of the body of the text.
+
+ A section "Entitled XYZ" means a named subunit of the Document
+ whose title either is precisely XYZ or contains XYZ in parentheses
+ following text that translates XYZ in another language. (Here XYZ
+ stands for a specific section name mentioned below, such as
+ "Acknowledgements", "Dedications", "Endorsements", or "History".)
+ To "Preserve the Title" of such a section when you modify the
+ Document means that it remains a section "Entitled XYZ" according
+ to this definition.
+
+ The Document may include Warranty Disclaimers next to the notice
+ which states that this License applies to the Document. These
+ Warranty Disclaimers are considered to be included by reference in
+ this License, but only as regards disclaiming warranties: any other
+ implication that these Warranty Disclaimers may have is void and
+ has no effect on the meaning of this License.
+
+ 2. VERBATIM COPYING
+
+ You may copy and distribute the Document in any medium, either
+ commercially or noncommercially, provided that this License, the
+ copyright notices, and the license notice saying this License
+ applies to the Document are reproduced in all copies, and that you
+ add no other conditions whatsoever to those of this License. You
+ may not use technical measures to obstruct or control the reading
+ or further copying of the copies you make or distribute. However,
+ you may accept compensation in exchange for copies. If you
+ distribute a large enough number of copies you must also follow
+ the conditions in section 3.
+
+ You may also lend copies, under the same conditions stated above,
+ and you may publicly display copies.
+
+ 3. COPYING IN QUANTITY
+
+ If you publish printed copies (or copies in media that commonly
+ have printed covers) of the Document, numbering more than 100, and
+ the Document's license notice requires Cover Texts, you must
+ enclose the copies in covers that carry, clearly and legibly, all
+ these Cover Texts: Front-Cover Texts on the front cover, and
+ Back-Cover Texts on the back cover. Both covers must also clearly
+ and legibly identify you as the publisher of these copies. The
+ front cover must present the full title with all words of the
+ title equally prominent and visible. You may add other material
+ on the covers in addition. Copying with changes limited to the
+ covers, as long as they preserve the title of the Document and
+ satisfy these conditions, can be treated as verbatim copying in
+ other respects.
+
+ If the required texts for either cover are too voluminous to fit
+ legibly, you should put the first ones listed (as many as fit
+ reasonably) on the actual cover, and continue the rest onto
+ adjacent pages.
+
+ If you publish or distribute Opaque copies of the Document
+ numbering more than 100, you must either include a
+ machine-readable Transparent copy along with each Opaque copy, or
+ state in or with each Opaque copy a computer-network location from
+ which the general network-using public has access to download
+ using public-standard network protocols a complete Transparent
+ copy of the Document, free of added material. If you use the
+ latter option, you must take reasonably prudent steps, when you
+ begin distribution of Opaque copies in quantity, to ensure that
+ this Transparent copy will remain thus accessible at the stated
+ location until at least one year after the last time you
+ distribute an Opaque copy (directly or through your agents or
+ retailers) of that edition to the public.
+
+ It is requested, but not required, that you contact the authors of
+ the Document well before redistributing any large number of
+ copies, to give them a chance to provide you with an updated
+ version of the Document.
+
+ 4. MODIFICATIONS
+
+ You may copy and distribute a Modified Version of the Document
+ under the conditions of sections 2 and 3 above, provided that you
+ release the Modified Version under precisely this License, with
+ the Modified Version filling the role of the Document, thus
+ licensing distribution and modification of the Modified Version to
+ whoever possesses a copy of it. In addition, you must do these
+ things in the Modified Version:
+
+ A. Use in the Title Page (and on the covers, if any) a title
+ distinct from that of the Document, and from those of
+ previous versions (which should, if there were any, be listed
+ in the History section of the Document). You may use the
+ same title as a previous version if the original publisher of
+ that version gives permission.
+
+ B. List on the Title Page, as authors, one or more persons or
+ entities responsible for authorship of the modifications in
+ the Modified Version, together with at least five of the
+ principal authors of the Document (all of its principal
+ authors, if it has fewer than five), unless they release you
+ from this requirement.
+
+ C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+
+ D. Preserve all the copyright notices of the Document.
+
+ E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+
+ F. Include, immediately after the copyright notices, a license
+ notice giving the public permission to use the Modified
+ Version under the terms of this License, in the form shown in
+ the Addendum below.
+
+ G. Preserve in that license notice the full lists of Invariant
+ Sections and required Cover Texts given in the Document's
+ license notice.
+
+ H. Include an unaltered copy of this License.
+
+ I. Preserve the section Entitled "History", Preserve its Title,
+ and add to it an item stating at least the title, year, new
+ authors, and publisher of the Modified Version as given on
+ the Title Page. If there is no section Entitled "History" in
+ the Document, create one stating the title, year, authors,
+ and publisher of the Document as given on its Title Page,
+ then add an item describing the Modified Version as stated in
+ the previous sentence.
+
+ J. Preserve the network location, if any, given in the Document
+ for public access to a Transparent copy of the Document, and
+ likewise the network locations given in the Document for
+ previous versions it was based on. These may be placed in
+ the "History" section. You may omit a network location for a
+ work that was published at least four years before the
+ Document itself, or if the original publisher of the version
+ it refers to gives permission.
+
+ K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the
+ section all the substance and tone of each of the contributor
+ acknowledgements and/or dedications given therein.
+
+ L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section
+ titles.
+
+ M. Delete any section Entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+
+ N. Do not retitle any existing section to be Entitled
+ "Endorsements" or to conflict in title with any Invariant
+ Section.
+
+ O. Preserve any Warranty Disclaimers.
+
+ If the Modified Version includes new front-matter sections or
+ appendices that qualify as Secondary Sections and contain no
+ material copied from the Document, you may at your option
+ designate some or all of these sections as invariant. To do this,
+ add their titles to the list of Invariant Sections in the Modified
+ Version's license notice. These titles must be distinct from any
+ other section titles.
+
+ You may add a section Entitled "Endorsements", provided it contains
+ nothing but endorsements of your Modified Version by various
+ parties--for example, statements of peer review or that the text
+ has been approved by an organization as the authoritative
+ definition of a standard.
+
+ You may add a passage of up to five words as a Front-Cover Text,
+ and a passage of up to 25 words as a Back-Cover Text, to the end
+ of the list of Cover Texts in the Modified Version. Only one
+ passage of Front-Cover Text and one of Back-Cover Text may be
+ added by (or through arrangements made by) any one entity. If the
+ Document already includes a cover text for the same cover,
+ previously added by you or by arrangement made by the same entity
+ you are acting on behalf of, you may not add another; but you may
+ replace the old one, on explicit permission from the previous
+ publisher that added the old one.
+
+ The author(s) and publisher(s) of the Document do not by this
+ License give permission to use their names for publicity for or to
+ assert or imply endorsement of any Modified Version.
+
+ 5. COMBINING DOCUMENTS
+
+ You may combine the Document with other documents released under
+ this License, under the terms defined in section 4 above for
+ modified versions, provided that you include in the combination
+ all of the Invariant Sections of all of the original documents,
+ unmodified, and list them all as Invariant Sections of your
+ combined work in its license notice, and that you preserve all
+ their Warranty Disclaimers.
+
+ The combined work need only contain one copy of this License, and
+ multiple identical Invariant Sections may be replaced with a single
+ copy. If there are multiple Invariant Sections with the same name
+ but different contents, make the title of each such section unique
+ by adding at the end of it, in parentheses, the name of the
+ original author or publisher of that section if known, or else a
+ unique number. Make the same adjustment to the section titles in
+ the list of Invariant Sections in the license notice of the
+ combined work.
+
+ In the combination, you must combine any sections Entitled
+ "History" in the various original documents, forming one section
+ Entitled "History"; likewise combine any sections Entitled
+ "Acknowledgements", and any sections Entitled "Dedications". You
+ must delete all sections Entitled "Endorsements."
+
+ 6. COLLECTIONS OF DOCUMENTS
+
+ You may make a collection consisting of the Document and other
+ documents released under this License, and replace the individual
+ copies of this License in the various documents with a single copy
+ that is included in the collection, provided that you follow the
+ rules of this License for verbatim copying of each of the
+ documents in all other respects.
+
+ You may extract a single document from such a collection, and
+ distribute it individually under this License, provided you insert
+ a copy of this License into the extracted document, and follow
+ this License in all other respects regarding verbatim copying of
+ that document.
+
+ 7. AGGREGATION WITH INDEPENDENT WORKS
+
+ A compilation of the Document or its derivatives with other
+ separate and independent documents or works, in or on a volume of
+ a storage or distribution medium, is called an "aggregate" if the
+ copyright resulting from the compilation is not used to limit the
+ legal rights of the compilation's users beyond what the individual
+ works permit. When the Document is included in an aggregate, this
+ License does not apply to the other works in the aggregate which
+ are not themselves derivative works of the Document.
+
+ If the Cover Text requirement of section 3 is applicable to these
+ copies of the Document, then if the Document is less than one half
+ of the entire aggregate, the Document's Cover Texts may be placed
+ on covers that bracket the Document within the aggregate, or the
+ electronic equivalent of covers if the Document is in electronic
+ form. Otherwise they must appear on printed covers that bracket
+ the whole aggregate.
+
+ 8. TRANSLATION
+
+ Translation is considered a kind of modification, so you may
+ distribute translations of the Document under the terms of section
+ 4. Replacing Invariant Sections with translations requires special
+ permission from their copyright holders, but you may include
+ translations of some or all Invariant Sections in addition to the
+ original versions of these Invariant Sections. You may include a
+ translation of this License, and all the license notices in the
+ Document, and any Warranty Disclaimers, provided that you also
+ include the original English version of this License and the
+ original versions of those notices and disclaimers. In case of a
+ disagreement between the translation and the original version of
+ this License or a notice or disclaimer, the original version will
+ prevail.
+
+ If a section in the Document is Entitled "Acknowledgements",
+ "Dedications", or "History", the requirement (section 4) to
+ Preserve its Title (section 1) will typically require changing the
+ actual title.
+
+ 9. TERMINATION
+
+ You may not copy, modify, sublicense, or distribute the Document
+ except as expressly provided for under this License. Any other
+ attempt to copy, modify, sublicense or distribute the Document is
+ void, and will automatically terminate your rights under this
+ License. However, parties who have received copies, or rights,
+ from you under this License will not have their licenses
+ terminated so long as such parties remain in full compliance.
+
+ 10. FUTURE REVISIONS OF THIS LICENSE
+
+ The Free Software Foundation may publish new, revised versions of
+ the GNU Free Documentation License from time to time. Such new
+ versions will be similar in spirit to the present version, but may
+ differ in detail to address new problems or concerns. See
+ `http://www.gnu.org/copyleft/'.
+
+ Each version of the License is given a distinguishing version
+ number. If the Document specifies that a particular numbered
+ version of this License "or any later version" applies to it, you
+ have the option of following the terms and conditions either of
+ that specified version or of any later version that has been
+ published (not as a draft) by the Free Software Foundation. If
+ the Document does not specify a version number of this License,
+ you may choose any version ever published (not as a draft) by the
+ Free Software Foundation.
+
+ADDENDUM: How to use this License for your documents
+====================================================
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and license
+notices just after the title page:
+
+ Copyright (C) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.2
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+ Texts. A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
+
+ If you have Invariant Sections, Front-Cover Texts and Back-Cover
+Texts, replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with
+ the Front-Cover Texts being LIST, and with the Back-Cover Texts
+ being LIST.
+
+ If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+ If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License, to
+permit their use in free software.
+
+
+File: libgomp.info, Node: Funding, Next: Index, Prev: GNU Free Documentation License, Up: Top
+
+Funding Free Software
+*********************
+
+If you want to have more free software a few years from now, it makes
+sense for you to help encourage people to contribute funds for its
+development. The most effective approach known is to encourage
+commercial redistributors to donate.
+
+ Users of free software systems can boost the pace of development by
+encouraging for-a-fee distributors to donate part of their selling price
+to free software developers--the Free Software Foundation, and others.
+
+ The way to convince distributors to do this is to demand it and
+expect it from them. So when you compare distributors, judge them
+partly by how much they give to free software development. Show
+distributors they must compete to be the one who gives the most.
+
+ To make this approach work, you must insist on numbers that you can
+compare, such as, "We will donate ten dollars to the Frobnitz project
+for each disk sold." Don't be satisfied with a vague promise, such as
+"A portion of the profits are donated," since it doesn't give a basis
+for comparison.
+
+ Even a precise fraction "of the profits from this disk" is not very
+meaningful, since creative accounting and unrelated business decisions
+can greatly alter what fraction of the sales price counts as profit.
+If the price you pay is $50, ten percent of the profit is probably less
+than a dollar; it might be a few cents, or nothing at all.
+
+ Some redistributors do development work themselves. This is useful
+too; but to keep everyone honest, you need to inquire how much they do,
+and what kind. Some kinds of development make much more long-term
+difference than others. For example, maintaining a separate version of
+a program contributes very little; maintaining the standard version of a
+program for the whole community contributes much. Easy new ports
+contribute little, since someone else would surely do them; difficult
+ports such as adding a new CPU to the GNU Compiler Collection
+contribute more; major new features or packages contribute the most.
+
+ By establishing the idea that supporting further development is "the
+proper thing to do" when distributing free software for a fee, we can
+assure a steady flow of resources into making more free software.
+
+ Copyright (C) 1994 Free Software Foundation, Inc.
+ Verbatim copying and redistribution of this section is permitted
+ without royalty; alteration is not permitted.
+
+
+File: libgomp.info, Node: Index, Prev: Funding, Up: Top
+
+Index
+*****
+
+
+* Menu:
+
+* Environment Variable <1>: GOMP_STACKSIZE. (line 6)
+* Environment Variable <2>: GOMP_CPU_AFFINITY. (line 6)
+* Environment Variable <3>: OMP_WAIT_POLICY. (line 6)
+* Environment Variable <4>: OMP_THREAD_LIMIT. (line 6)
+* Environment Variable <5>: OMP_STACKSIZE. (line 6)
+* Environment Variable <6>: OMP_SCHEDULE. (line 6)
+* Environment Variable <7>: OMP_NUM_THREADS. (line 6)
+* Environment Variable <8>: OMP_NESTED. (line 6)
+* Environment Variable <9>: OMP_MAX_ACTIVE_LEVELS. (line 6)
+* Environment Variable: OMP_DYNAMIC. (line 6)
+* FDL, GNU Free Documentation License: GNU Free Documentation License.
+ (line 6)
+* Implementation specific setting <1>: GOMP_STACKSIZE. (line 6)
+* Implementation specific setting <2>: OMP_SCHEDULE. (line 6)
+* Implementation specific setting <3>: OMP_NUM_THREADS. (line 6)
+* Implementation specific setting: OMP_NESTED. (line 6)
+* Introduction: Top. (line 6)
+
+
+
+Tag Table:
+Node: Top2089
+Node: Enabling OpenMP3283
+Node: Runtime Library Routines4068
+Node: omp_get_active_level6443
+Node: omp_get_ancestor_thread_num7134
+Node: omp_get_dynamic8048
+Node: omp_get_level8922
+Node: omp_get_max_active_levels9533
+Node: omp_get_max_threads10221
+Node: omp_get_nested10973
+Node: omp_get_num_procs11881
+Node: omp_get_num_threads12395
+Node: omp_get_schedule13465
+Node: omp_get_team_size14372
+Node: omp_get_thread_limit15330
+Node: omp_get_thread_num15949
+Node: omp_in_parallel16803
+Node: omp_set_dynamic17449
+Node: omp_set_max_active_levels18285
+Node: omp_set_nested19047
+Node: omp_set_num_threads19924
+Node: omp_set_schedule20762
+Node: omp_init_lock21806
+Node: omp_set_lock22456
+Node: omp_test_lock23305
+Node: omp_unset_lock24332
+Node: omp_destroy_lock25258
+Node: omp_init_nest_lock25928
+Node: omp_set_nest_lock26660
+Node: omp_test_nest_lock27569
+Node: omp_unset_nest_lock28667
+Node: omp_destroy_nest_lock29676
+Node: omp_get_wtick30424
+Node: omp_get_wtime31011
+Node: Environment Variables31794
+Node: OMP_DYNAMIC32855
+Node: OMP_MAX_ACTIVE_LEVELS33423
+Node: OMP_NESTED34060
+Node: OMP_NUM_THREADS34664
+Node: OMP_SCHEDULE35237
+Node: OMP_STACKSIZE35931
+Node: OMP_THREAD_LIMIT36756
+Node: OMP_WAIT_POLICY37349
+Node: GOMP_CPU_AFFINITY37914
+Node: GOMP_STACKSIZE39398
+Node: The libgomp ABI40208
+Node: Implementing MASTER construct41006
+Node: Implementing CRITICAL construct41419
+Node: Implementing ATOMIC construct42167
+Node: Implementing FLUSH construct42648
+Node: Implementing BARRIER construct42919
+Node: Implementing THREADPRIVATE construct43188
+Node: Implementing PRIVATE clause43840
+Node: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses44421
+Node: Implementing REDUCTION clause45736
+Node: Implementing PARALLEL construct46292
+Node: Implementing FOR construct47549
+Node: Implementing ORDERED construct49547
+Node: Implementing SECTIONS construct49853
+Node: Implementing SINGLE construct50619
+Node: Reporting Bugs51281
+Node: Copying51589
+Node: GNU Free Documentation License70799
+Node: Funding93210
+Node: Index95727
+
+End Tag Table
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/Scrt1.o b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/Scrt1.o
new file mode 100644
index 0000000..8762a00
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/Scrt1.o
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/crt1.o b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/crt1.o
new file mode 100644
index 0000000..8762a00
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/crt1.o
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/crti.o b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/crti.o
new file mode 100644
index 0000000..b891f42
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/crti.o
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/crtn.o b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/crtn.o
new file mode 100644
index 0000000..a747dad
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/crtn.o
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/crtbegin.o b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/crtbegin.o
new file mode 100644
index 0000000..efffed0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/crtbegin.o
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/crtbeginS.o b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/crtbeginS.o
new file mode 100644
index 0000000..6cf1758
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/crtbeginS.o
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/crtbeginT.o b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/crtbeginT.o
new file mode 100644
index 0000000..52b6a1c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/crtbeginT.o
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/crtend.o b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/crtend.o
new file mode 100644
index 0000000..1674219
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/crtend.o
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/crtendS.o b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/crtendS.o
new file mode 100644
index 0000000..4c83b9a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/crtendS.o
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include-fixed/README b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include-fixed/README
new file mode 100644
index 0000000..7086a77
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include-fixed/README
@@ -0,0 +1,14 @@
+This README file is copied into the directory for GCC-only header files
+when fixincludes is run by the makefile for GCC.
+
+Many of the files in this directory were automatically edited from the
+standard system header files by the fixincludes process. They are
+system-specific, and will not work on any other kind of system. They
+are also not part of GCC. The reason we have to do this is because
+GCC requires ANSI C headers and many vendors supply ANSI-incompatible
+headers.
+
+Because this is an automated process, sometimes headers get "fixed"
+that do not, strictly speaking, need a fix. As long as nothing is broken
+by the process, it is just an unfortunate collateral inconvenience.
+We would like to rectify it, if it is not "too inconvenient".
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include-fixed/features.h b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include-fixed/features.h
new file mode 100644
index 0000000..9c868ed
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include-fixed/features.h
@@ -0,0 +1,433 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "/opt/toolchains/uclibc-crosstools-gcc-4.4.2-1/usr/include/features.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+/* Copyright (C) 1991-1993,1995-2003,2004,2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _FEATURES_H
+#define _FEATURES_H 1
+
+/* This macro indicates that the installed library is uClibc. Use
+ * __UCLIBC_MAJOR__ and __UCLIBC_MINOR__ to test for the features in
+ * specific releases. */
+#define __UCLIBC__ 1
+
+/* Load up the current set of uClibc supported features along
+ * with the current uClibc major and minor version numbers.
+ * For uClibc release 0.9.26, these numbers would be:
+ * #define __UCLIBC_MAJOR__ 0
+ * #define __UCLIBC_MINOR__ 9
+ * #define __UCLIBC_SUBLEVEL__ 26
+ */
+#define __need_uClibc_config_h
+#include <bits/uClibc_config.h>
+#undef __need_uClibc_config_h
+#include <bits/uClibc_arch_features.h>
+
+/* For uClibc, always optimize for size -- this should disable
+ * a lot of expensive inlining... */
+#define __OPTIMIZE_SIZE__ 1
+
+/* These are defined by the user (or the compiler)
+ to specify the desired environment:
+
+ __STRICT_ANSI__ ISO Standard C.
+ _ISOC99_SOURCE Extensions to ISO C89 from ISO C99.
+ _POSIX_SOURCE IEEE Std 1003.1.
+ _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
+ if >=199309L, add IEEE Std 1003.1b-1993;
+ if >=199506L, add IEEE Std 1003.1c-1995;
+ if >=200112L, all of IEEE 1003.1-2004
+ _XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if
+ Single Unix conformance is wanted, to 600 for the
+ upcoming sixth revision.
+ _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions.
+ _LARGEFILE_SOURCE Some more functions for correct standard I/O.
+ _LARGEFILE64_SOURCE Additional functionality from LFS for large files.
+ _FILE_OFFSET_BITS=N Select default filesystem interface.
+ _BSD_SOURCE ISO C, POSIX, and 4.3BSD things.
+ _SVID_SOURCE ISO C, POSIX, and SVID things.
+ _ATFILE_SOURCE Additional *at interfaces.
+ _GNU_SOURCE All of the above, plus GNU extensions.
+ _REENTRANT Select additionally reentrant object.
+ _THREAD_SAFE Same as _REENTRANT, often used by other systems.
+ _FORTIFY_SOURCE If set to numeric value > 0 additional security
+ measures are defined, according to level.
+
+ The `-ansi' switch to the GNU C compiler defines __STRICT_ANSI__.
+ If none of these are defined, the default is to have _SVID_SOURCE,
+ _BSD_SOURCE, and _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to
+ 199506L. If more than one of these are defined, they accumulate.
+ For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE
+ together give you ISO C, 1003.1, and 1003.2, but nothing else.
+
+ These are defined by this file and are used by the
+ header files to decide what to declare or define:
+
+ __USE_ISOC99 Define ISO C99 things.
+ __USE_POSIX Define IEEE Std 1003.1 things.
+ __USE_POSIX2 Define IEEE Std 1003.2 things.
+ __USE_POSIX199309 Define IEEE Std 1003.1, and .1b things.
+ __USE_POSIX199506 Define IEEE Std 1003.1, .1b, .1c and .1i things.
+ __USE_XOPEN Define XPG things.
+ __USE_XOPEN_EXTENDED Define X/Open Unix things.
+ __USE_UNIX98 Define Single Unix V2 things.
+ __USE_XOPEN2K Define XPG6 things.
+ __USE_LARGEFILE Define correct standard I/O things.
+ __USE_LARGEFILE64 Define LFS things with separate names.
+ __USE_FILE_OFFSET64 Define 64bit interface as default.
+ __USE_BSD Define 4.3BSD things.
+ __USE_SVID Define SVID things.
+ __USE_MISC Define things common to BSD and System V Unix.
+ __USE_ATFILE Define *at interfaces and AT_* constants for them.
+ __USE_GNU Define GNU extensions.
+ __USE_REENTRANT Define reentrant/thread-safe *_r functions.
+ __USE_FORTIFY_LEVEL Additional security measures used, according to level.
+ __FAVOR_BSD Favor 4.3BSD things in cases of conflict.
+
+ The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are
+ defined by this file unconditionally. `__GNU_LIBRARY__' is provided
+ only for compatibility. All new code should use the other symbols
+ to test for features.
+
+ All macros listed above as possibly being defined by this file are
+ explicitly undefined if they are not explicitly defined.
+ Feature-test macros that are not defined by the user or compiler
+ but are implied by the other feature-test macros defined (or by the
+ lack of any definitions) are defined by the file. */
+
+
+/* Undefine everything, so we get a clean slate. */
+#undef __USE_ISOC99
+#undef __USE_POSIX
+#undef __USE_POSIX2
+#undef __USE_POSIX199309
+#undef __USE_POSIX199506
+#undef __USE_XOPEN
+#undef __USE_XOPEN_EXTENDED
+#undef __USE_UNIX98
+#undef __USE_XOPEN2K
+#undef __USE_LARGEFILE
+#undef __USE_LARGEFILE64
+#undef __USE_FILE_OFFSET64
+#undef __USE_BSD
+#undef __USE_SVID
+#undef __USE_MISC
+#undef __USE_ATFILE
+#undef __USE_GNU
+#undef __USE_REENTRANT
+#undef __USE_FORTIFY_LEVEL
+#undef __FAVOR_BSD
+#undef __KERNEL_STRICT_NAMES
+
+/* Suppress kernel-name space pollution unless user expressedly asks
+ for it. */
+#ifndef _LOOSE_KERNEL_NAMES
+# define __KERNEL_STRICT_NAMES
+#endif
+
+/* Always use ISO C things. */
+#define __USE_ANSI 1
+
+/* Convenience macros to test the versions of glibc and gcc.
+ Use them like this:
+ #if __GNUC_PREREQ(2,8)
+ ... code requiring gcc 2.8 or later ...
+ #endif
+ Note - they won't work for gcc1 or glibc1, since the _MINOR macros
+ were not defined then. */
+#if defined __GNUC__ && defined __GNUC_MINOR__
+# define __GNUC_PREREQ(maj, min) \
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+#else
+# define __GNUC_PREREQ(maj, min) 0
+#endif
+
+
+/* If _BSD_SOURCE was defined by the user, favor BSD over POSIX. */
+#if defined _BSD_SOURCE && \
+ !(defined _POSIX_SOURCE || defined _POSIX_C_SOURCE || \
+ defined _XOPEN_SOURCE || defined _XOPEN_SOURCE_EXTENDED || \
+ defined _GNU_SOURCE || defined _SVID_SOURCE)
+# define __FAVOR_BSD 1
+#endif
+
+/* If _GNU_SOURCE was defined by the user, turn on all the other features. */
+#ifdef _GNU_SOURCE
+# undef _ISOC99_SOURCE
+# define _ISOC99_SOURCE 1
+# undef _POSIX_SOURCE
+# define _POSIX_SOURCE 1
+# undef _POSIX_C_SOURCE
+# define _POSIX_C_SOURCE 199506L
+# undef _XOPEN_SOURCE
+# define _XOPEN_SOURCE 600
+# undef _XOPEN_SOURCE_EXTENDED
+# define _XOPEN_SOURCE_EXTENDED 1
+# ifdef __UCLIBC_HAS_LFS__
+# undef _LARGEFILE64_SOURCE
+# define _LARGEFILE64_SOURCE 1
+# endif /* __UCLIBC_HAS_LFS__ */
+# undef _BSD_SOURCE
+# define _BSD_SOURCE 1
+# undef _SVID_SOURCE
+# define _SVID_SOURCE 1
+# undef _ATFILE_SOURCE
+# define _ATFILE_SOURCE 1
+#endif
+
+/* If nothing (other than _GNU_SOURCE) is defined,
+ define _BSD_SOURCE and _SVID_SOURCE. */
+#if (!defined __STRICT_ANSI__ && !defined _ISOC99_SOURCE && \
+ !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE && \
+ !defined _XOPEN_SOURCE && !defined _XOPEN_SOURCE_EXTENDED && \
+ !defined _BSD_SOURCE && !defined _SVID_SOURCE)
+# define _BSD_SOURCE 1
+# define _SVID_SOURCE 1
+#endif
+
+/* This is to enable the ISO C99 extension. Also recognize the old macro
+ which was used prior to the standard acceptance. This macro will
+ eventually go away and the features enabled by default once the ISO C99
+ standard is widely adopted. */
+#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
+# define __USE_ISOC99 1
+#endif
+
+/* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2
+ (and IEEE Std 1003.1b-1993 unless _XOPEN_SOURCE is defined). */
+#if ((!defined __STRICT_ANSI__ || (_XOPEN_SOURCE - 0) >= 500) && \
+ !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE)
+# define _POSIX_SOURCE 1
+# if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 500
+# define _POSIX_C_SOURCE 2
+# else
+# define _POSIX_C_SOURCE 199506L
+# endif
+#endif
+
+#if defined _POSIX_SOURCE || _POSIX_C_SOURCE >= 1 || defined _XOPEN_SOURCE
+# define __USE_POSIX 1
+#endif
+
+#if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 || defined _XOPEN_SOURCE
+# define __USE_POSIX2 1
+#endif
+
+#if (_POSIX_C_SOURCE - 0) >= 199309L
+# define __USE_POSIX199309 1
+#endif
+
+#if (_POSIX_C_SOURCE - 0) >= 199506L
+# define __USE_POSIX199506 1
+#endif
+
+#if (_POSIX_C_SOURCE - 0) >= 200112L
+# define __USE_XOPEN2K 1
+#endif
+
+#ifdef _XOPEN_SOURCE
+# define __USE_XOPEN 1
+# if (_XOPEN_SOURCE - 0) >= 500
+# define __USE_XOPEN_EXTENDED 1
+# define __USE_UNIX98 1
+# undef _LARGEFILE_SOURCE
+# define _LARGEFILE_SOURCE 1
+# if (_XOPEN_SOURCE - 0) >= 600
+# define __USE_XOPEN2K 1
+# undef __USE_ISOC99
+# define __USE_ISOC99 1
+# endif
+# else
+# ifdef _XOPEN_SOURCE_EXTENDED
+# define __USE_XOPEN_EXTENDED 1
+# endif
+# endif
+#endif
+
+#ifdef _LARGEFILE_SOURCE
+# define __USE_LARGEFILE 1
+#endif
+
+#ifdef _LARGEFILE64_SOURCE
+# define __USE_LARGEFILE64 1
+#endif
+
+#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
+# define __USE_FILE_OFFSET64 1
+#endif
+
+#if defined _BSD_SOURCE || defined _SVID_SOURCE
+# define __USE_MISC 1
+#endif
+
+#ifdef _BSD_SOURCE
+# define __USE_BSD 1
+#endif
+
+#ifdef _SVID_SOURCE
+# define __USE_SVID 1
+#endif
+
+#ifdef _ATFILE_SOURCE
+# define __USE_ATFILE 1
+#endif
+
+#ifdef _GNU_SOURCE
+# define __USE_GNU 1
+#endif
+
+#if defined _REENTRANT || defined _THREAD_SAFE
+# define __USE_REENTRANT 1
+#endif
+
+/* uClibc does not support _FORTIFY_SOURCE */
+#undef _FORTIFY_SOURCE
+#if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \
+ && __GNUC_PREREQ(4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
+# if _FORTIFY_SOURCE > 1
+# define __USE_FORTIFY_LEVEL 2
+# else
+# define __USE_FORTIFY_LEVEL 1
+# endif
+#else
+# define __USE_FORTIFY_LEVEL 0
+#endif
+
+/* We do support the IEC 559 math functionality, real and complex. */
+#define __STDC_IEC_559__ 1
+#define __STDC_IEC_559_COMPLEX__ 1
+
+#ifdef __UCLIBC_HAS_WCHAR__
+/* wchar_t uses ISO 10646-1 (2nd ed., published 2000-09-15) / Unicode 3.1. */
+# define __STDC_ISO_10646__ 200009L
+#endif
+
+/* There is an unwholesomely huge amount of code out there that depends on the
+ * presence of GNU libc header files. We have GNU libc header files. So here
+ * we commit a horrible sin. At this point, we _lie_ and claim to be GNU libc
+ * to make things like /usr/include/linux/socket.h and lots of apps work as
+ * their developers intended. This is IMHO, pardonable, since these defines
+ * are not really intended to check for the presence of a particular library,
+ * but rather are used to define an _interface_. */
+#if !defined __FORCE_NOGLIBC && (!defined _LIBC || defined __FORCE_GLIBC)
+/* This macro indicates that the installed library is the GNU C Library.
+ For historic reasons the value now is 6 and this will stay from now
+ on. The use of this variable is deprecated. */
+# undef __GNU_LIBRARY__
+# define __GNU_LIBRARY__ 6
+
+/* Major and minor version number of the GNU C library package. Use
+ these macros to test for features in specific releases. */
+/* Don't do it, if you want to keep uClibc happy. */
+# define __GLIBC__ 2
+# define __GLIBC_MINOR__ 2
+#endif
+
+#define __GLIBC_PREREQ(maj, min) \
+ ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))
+
+#ifndef __UCLIBC__
+/* Decide whether a compiler supports the long long datatypes. */
+#if defined __GNUC__ \
+ || (defined __PGI && defined __i386__ ) \
+ || (defined __INTEL_COMPILER && (defined __i386__ || defined __ia64__)) \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
+# define __GLIBC_HAVE_LONG_LONG 1
+#endif
+#endif
+
+/* This is here only because every header file already includes this one. */
+#ifndef __ASSEMBLER__
+# ifndef _SYS_CDEFS_H
+# include <sys/cdefs.h>
+# endif
+
+/* If we don't have __REDIRECT, prototypes will be missing if
+ __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. */
+# if defined __USE_FILE_OFFSET64 && !defined __REDIRECT
+# define __USE_LARGEFILE 1
+# define __USE_LARGEFILE64 1
+# endif
+
+#endif /* !ASSEMBLER */
+
+/* Decide whether we can define 'extern inline' functions in headers. */
+#if __GNUC_PREREQ(2, 7) && defined __OPTIMIZE__ \
+ && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ && (defined __extern_inline || defined __GNUC_GNU_INLINE__)
+# define __USE_EXTERN_INLINES 1
+#endif
+
+
+/* Make sure users large file options agree with uClibc's configuration. */
+#ifndef __UCLIBC_HAS_LFS__
+
+/* If uClibc was built without large file support, output an error if
+ * 64-bit file offsets were requested.
+ * NOTE: This is probably incorrect on a 64-bit arch... */
+# ifdef __USE_FILE_OFFSET64
+# error It appears you have defined _FILE_OFFSET_BITS=64. Unfortunately, \
+uClibc was built without large file support enabled.
+# endif
+
+/* If uClibc was built without large file support and _LARGEFILE64_SOURCE
+ * is defined, undefine it. */
+# ifdef _LARGEFILE64_SOURCE
+# undef _LARGEFILE64_SOURCE
+# undef __USE_LARGEFILE64
+# endif
+
+/* If we're actually building uClibc with large file support,
+ * define __USE_LARGEFILE64 and __USE_LARGEFILE. */
+#elif defined _LIBC
+# undef _LARGEFILE_SOURCE
+# undef _LARGEFILE64_SOURCE
+# undef _FILE_OFFSET_BITS
+# undef __USE_LARGEFILE
+# undef __USE_LARGEFILE64
+# undef __USE_FILE_OFFSET64
+# define _LARGEFILE_SOURCE 1
+# define _LARGEFILE64_SOURCE 1
+# define __USE_LARGEFILE 1
+# define __USE_LARGEFILE64 1
+#endif
+
+/* uClibc does not support *at interfaces. */
+#undef _ATFILE_SOURCE
+#undef __USE_ATFILE
+
+#ifdef _LIBC
+# include <libc-internal.h>
+#endif
+
+#ifndef __linux__
+# define __linux__ 1
+#endif
+
+/* Disable __user, which shows up in 2.6.x include asm headers
+ * that get pulled in by signal.h */
+#define __user
+
+#endif /* features.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include-fixed/limits.h b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include-fixed/limits.h
new file mode 100644
index 0000000..30e08a7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include-fixed/limits.h
@@ -0,0 +1,125 @@
+/* This administrivia gets added to the beginning of limits.h
+ if the system has its own version of limits.h. */
+
+/* We use _GCC_LIMITS_H_ because we want this not to match
+ any macros that the system's limits.h uses for its own purposes. */
+#ifndef _GCC_LIMITS_H_ /* Terminated in limity.h. */
+#define _GCC_LIMITS_H_
+
+#ifndef _LIBC_LIMITS_H_
+/* Use "..." so that we find syslimits.h only in this same directory. */
+#include "syslimits.h"
+#endif
+#ifndef _LIMITS_H___
+#define _LIMITS_H___
+
+/* Number of bits in a `char'. */
+#undef CHAR_BIT
+#define CHAR_BIT __CHAR_BIT__
+
+/* Maximum length of a multibyte character. */
+#ifndef MB_LEN_MAX
+#define MB_LEN_MAX 1
+#endif
+
+/* Minimum and maximum values a `signed char' can hold. */
+#undef SCHAR_MIN
+#define SCHAR_MIN (-SCHAR_MAX - 1)
+#undef SCHAR_MAX
+#define SCHAR_MAX __SCHAR_MAX__
+
+/* Maximum value an `unsigned char' can hold. (Minimum is 0). */
+#undef UCHAR_MAX
+#if __SCHAR_MAX__ == __INT_MAX__
+# define UCHAR_MAX (SCHAR_MAX * 2U + 1U)
+#else
+# define UCHAR_MAX (SCHAR_MAX * 2 + 1)
+#endif
+
+/* Minimum and maximum values a `char' can hold. */
+#ifdef __CHAR_UNSIGNED__
+# undef CHAR_MIN
+# if __SCHAR_MAX__ == __INT_MAX__
+# define CHAR_MIN 0U
+# else
+# define CHAR_MIN 0
+# endif
+# undef CHAR_MAX
+# define CHAR_MAX UCHAR_MAX
+#else
+# undef CHAR_MIN
+# define CHAR_MIN SCHAR_MIN
+# undef CHAR_MAX
+# define CHAR_MAX SCHAR_MAX
+#endif
+
+/* Minimum and maximum values a `signed short int' can hold. */
+#undef SHRT_MIN
+#define SHRT_MIN (-SHRT_MAX - 1)
+#undef SHRT_MAX
+#define SHRT_MAX __SHRT_MAX__
+
+/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
+#undef USHRT_MAX
+#if __SHRT_MAX__ == __INT_MAX__
+# define USHRT_MAX (SHRT_MAX * 2U + 1U)
+#else
+# define USHRT_MAX (SHRT_MAX * 2 + 1)
+#endif
+
+/* Minimum and maximum values a `signed int' can hold. */
+#undef INT_MIN
+#define INT_MIN (-INT_MAX - 1)
+#undef INT_MAX
+#define INT_MAX __INT_MAX__
+
+/* Maximum value an `unsigned int' can hold. (Minimum is 0). */
+#undef UINT_MAX
+#define UINT_MAX (INT_MAX * 2U + 1U)
+
+/* Minimum and maximum values a `signed long int' can hold.
+ (Same as `int'). */
+#undef LONG_MIN
+#define LONG_MIN (-LONG_MAX - 1L)
+#undef LONG_MAX
+#define LONG_MAX __LONG_MAX__
+
+/* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
+#undef ULONG_MAX
+#define ULONG_MAX (LONG_MAX * 2UL + 1UL)
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+/* Minimum and maximum values a `signed long long int' can hold. */
+# undef LLONG_MIN
+# define LLONG_MIN (-LLONG_MAX - 1LL)
+# undef LLONG_MAX
+# define LLONG_MAX __LONG_LONG_MAX__
+
+/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
+# undef ULLONG_MAX
+# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
+#endif
+
+#if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
+/* Minimum and maximum values a `signed long long int' can hold. */
+# undef LONG_LONG_MIN
+# define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL)
+# undef LONG_LONG_MAX
+# define LONG_LONG_MAX __LONG_LONG_MAX__
+
+/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
+# undef ULONG_LONG_MAX
+# define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1ULL)
+#endif
+
+#endif /* _LIMITS_H___ */
+/* This administrivia gets added to the end of limits.h
+ if the system has its own version of limits.h. */
+
+#else /* not _GCC_LIMITS_H_ */
+
+#ifdef _GCC_NEXT_LIMITS_H
+#include_next <limits.h> /* recurse down to the real one */
+#endif
+
+#endif /* not _GCC_LIMITS_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include-fixed/obstack.h b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include-fixed/obstack.h
new file mode 100644
index 0000000..05fd4fb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include-fixed/obstack.h
@@ -0,0 +1,614 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "/opt/toolchains/uclibc-crosstools-gcc-4.4.2-1/usr/include/obstack.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+/* obstack.h - object stack macros
+ Copyright (C) 1988,89,90,91,92,93,94,96,97,98,99 Free Software Foundation, Inc.
+ This file is part of the GNU C Library. Its master source is NOT part of
+ the C library, however. The master source lives in /gd/gnu/lib.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Summary:
+
+All the apparent functions defined here are macros. The idea
+is that you would use these pre-tested macros to solve a
+very specific set of problems, and they would run fast.
+Caution: no side-effects in arguments please!! They may be
+evaluated MANY times!!
+
+These macros operate a stack of objects. Each object starts life
+small, and may grow to maturity. (Consider building a word syllable
+by syllable.) An object can move while it is growing. Once it has
+been "finished" it never changes address again. So the "top of the
+stack" is typically an immature growing object, while the rest of the
+stack is of mature, fixed size and fixed address objects.
+
+These routines grab large chunks of memory, using a function you
+supply, called `obstack_chunk_alloc'. On occasion, they free chunks,
+by calling `obstack_chunk_free'. You must define them and declare
+them before using any obstack macros.
+
+Each independent stack is represented by a `struct obstack'.
+Each of the obstack macros expects a pointer to such a structure
+as the first argument.
+
+One motivation for this package is the problem of growing char strings
+in symbol tables. Unless you are "fascist pig with a read-only mind"
+--Gosper's immortal quote from HAKMEM item 154, out of context--you
+would not like to put any arbitrary upper limit on the length of your
+symbols.
+
+In practice this often means you will build many short symbols and a
+few long symbols. At the time you are reading a symbol you don't know
+how long it is. One traditional method is to read a symbol into a
+buffer, realloc()ating the buffer every time you try to read a symbol
+that is longer than the buffer. This is beaut, but you still will
+want to copy the symbol from the buffer to a more permanent
+symbol-table entry say about half the time.
+
+With obstacks, you can work differently. Use one obstack for all symbol
+names. As you read a symbol, grow the name in the obstack gradually.
+When the name is complete, finalize it. Then, if the symbol exists already,
+free the newly read name.
+
+The way we do this is to take a large chunk, allocating memory from
+low addresses. When you want to build a symbol in the chunk you just
+add chars above the current "high water mark" in the chunk. When you
+have finished adding chars, because you got to the end of the symbol,
+you know how long the chars are, and you can create a new object.
+Mostly the chars will not burst over the highest address of the chunk,
+because you would typically expect a chunk to be (say) 100 times as
+long as an average object.
+
+In case that isn't clear, when we have enough chars to make up
+the object, THEY ARE ALREADY CONTIGUOUS IN THE CHUNK (guaranteed)
+so we just point to it where it lies. No moving of chars is
+needed and this is the second win: potentially long strings need
+never be explicitly shuffled. Once an object is formed, it does not
+change its address during its lifetime.
+
+When the chars burst over a chunk boundary, we allocate a larger
+chunk, and then copy the partly formed object from the end of the old
+chunk to the beginning of the new larger chunk. We then carry on
+accreting characters to the end of the object as we normally would.
+
+A special macro is provided to add a single char at a time to a
+growing object. This allows the use of register variables, which
+break the ordinary 'growth' macro.
+
+Summary:
+ We allocate large chunks.
+ We carve out one object at a time from the current chunk.
+ Once carved, an object never moves.
+ We are free to append data of any size to the currently
+ growing object.
+ Exactly one object is growing in an obstack at any one time.
+ You can run one obstack per control block.
+ You may have as many control blocks as you dare.
+ Because of the way we do it, you can `unwind' an obstack
+ back to a previous state. (You may remove objects much
+ as you would with a stack.)
+*/
+
+
+/* Don't do the contents of this file more than once. */
+
+#ifndef _OBSTACK_H
+#define _OBSTACK_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* We use subtraction of (char *) 0 instead of casting to int
+ because on word-addressable machines a simple cast to int
+ may ignore the byte-within-word field of the pointer. */
+
+#ifndef __PTR_TO_INT
+# define __PTR_TO_INT(P) ((P) - (char *) 0)
+#endif
+
+#ifndef __INT_TO_PTR
+# define __INT_TO_PTR(P) ((P) + (char *) 0)
+#endif
+
+/* We need the type of the resulting object. If __PTRDIFF_TYPE__ is
+ defined, as with GNU C, use that; that way we don't pollute the
+ namespace with <stddef.h>'s symbols. Otherwise, if <stddef.h> is
+ available, include it and use ptrdiff_t. In traditional C, long is
+ the best that we can do. */
+
+#ifdef __PTRDIFF_TYPE__
+# define PTR_INT_TYPE __PTRDIFF_TYPE__
+#else
+# ifdef HAVE_STDDEF_H
+# include <stddef.h>
+# define PTR_INT_TYPE ptrdiff_t
+# else
+# define PTR_INT_TYPE long
+# endif
+#endif
+
+#if defined _LIBC || defined HAVE_STRING_H
+# include <string.h>
+# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
+#else
+# ifdef memcpy
+# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
+# else
+# define _obstack_memcpy(To, From, N) bcopy ((From), (To), (N))
+# endif
+#endif
+
+struct _obstack_chunk /* Lives at front of each chunk. */
+{
+ char *limit; /* 1 past end of this chunk */
+ struct _obstack_chunk *prev; /* address of prior chunk or NULL */
+ char contents[4]; /* objects begin here */
+};
+
+struct obstack /* control current object in current chunk */
+{
+ long chunk_size; /* preferred size to allocate chunks in */
+ struct _obstack_chunk *chunk; /* address of current struct obstack_chunk */
+ char *object_base; /* address of object we are building */
+ char *next_free; /* where to add next char to current object */
+ char *chunk_limit; /* address of char after current chunk */
+ PTR_INT_TYPE temp; /* Temporary for some macros. */
+ int alignment_mask; /* Mask of alignment for each object. */
+#if defined __STDC__ && __STDC__
+ /* These prototypes vary based on `use_extra_arg', and we use
+ casts to the prototypeless function type in all assignments,
+ but having prototypes here quiets -Wstrict-prototypes. */
+ struct _obstack_chunk *(*chunkfun) (void *, long);
+ void (*freefun) (void *, struct _obstack_chunk *);
+ void *extra_arg; /* first arg for chunk alloc/dealloc funcs */
+#else
+ struct _obstack_chunk *(*chunkfun) (); /* User's fcn to allocate a chunk. */
+ void (*freefun) (); /* User's function to free a chunk. */
+ char *extra_arg; /* first arg for chunk alloc/dealloc funcs */
+#endif
+ unsigned use_extra_arg:1; /* chunk alloc/dealloc funcs take extra arg */
+ unsigned maybe_empty_object:1;/* There is a possibility that the current
+ chunk contains a zero-length object. This
+ prevents freeing the chunk if we allocate
+ a bigger chunk to replace it. */
+ unsigned alloc_failed:1; /* No longer used, as we now call the failed
+ handler on error, but retained for binary
+ compatibility. */
+};
+
+/* Declare the external functions we use; they are in obstack.c. */
+
+#if defined __STDC__ && __STDC__
+extern void _obstack_newchunk (struct obstack *, int);
+extern void _obstack_free (struct obstack *, void *);
+extern int _obstack_begin (struct obstack *, int, int,
+ void *(*) (long), void (*) (void *));
+extern int _obstack_begin_1 (struct obstack *, int, int,
+ void *(*) (void *, long),
+ void (*) (void *, void *), void *);
+extern int _obstack_memory_used (struct obstack *);
+#else
+extern void _obstack_newchunk ();
+extern void _obstack_free ();
+extern int _obstack_begin ();
+extern int _obstack_begin_1 ();
+extern int _obstack_memory_used ();
+#endif
+
+#if defined __STDC__ && __STDC__
+
+/* Do the function-declarations after the structs
+ but before defining the macros. */
+
+void obstack_init (struct obstack *obstack);
+
+void * obstack_alloc (struct obstack *obstack, int size);
+
+void * obstack_copy (struct obstack *obstack, const void *address, int size);
+void * obstack_copy0 (struct obstack *obstack, const void *address, int size);
+
+void obstack_free (struct obstack *obstack, void *block);
+
+void obstack_blank (struct obstack *obstack, int size);
+
+void obstack_grow (struct obstack *obstack, const void *data, int size);
+void obstack_grow0 (struct obstack *obstack, const void *data, int size);
+
+void obstack_1grow (struct obstack *obstack, int data_char);
+void obstack_ptr_grow (struct obstack *obstack, const void *data);
+void obstack_int_grow (struct obstack *obstack, int data);
+
+void * obstack_finish (struct obstack *obstack);
+
+int obstack_object_size (struct obstack *obstack);
+
+int obstack_room (struct obstack *obstack);
+void obstack_make_room (struct obstack *obstack, int size);
+void obstack_1grow_fast (struct obstack *obstack, int data_char);
+void obstack_ptr_grow_fast (struct obstack *obstack, const void *data);
+void obstack_int_grow_fast (struct obstack *obstack, int data);
+void obstack_blank_fast (struct obstack *obstack, int size);
+
+void * obstack_base (struct obstack *obstack);
+void * obstack_next_free (struct obstack *obstack);
+int obstack_alignment_mask (struct obstack *obstack);
+int obstack_chunk_size (struct obstack *obstack);
+int obstack_memory_used (struct obstack *obstack);
+
+#endif /* __STDC__ */
+
+/* Non-ANSI C cannot really support alternative functions for these macros,
+ so we do not declare them. */
+
+/* Error handler called when `obstack_chunk_alloc' failed to allocate
+ more memory. This can be set to a user defined function which
+ should either abort gracefully or use longjump - but shouldn't
+ return. The default action is to print a message and abort. */
+#if defined __STDC__ && __STDC__
+extern void (*obstack_alloc_failed_handler) (void);
+#else
+extern void (*obstack_alloc_failed_handler) ();
+#endif
+
+/* Exit value used when `print_and_abort' is used. */
+extern int obstack_exit_failure;
+
+/* Pointer to beginning of object being allocated or to be allocated next.
+ Note that this might not be the final address of the object
+ because a new chunk might be needed to hold the final size. */
+
+#define obstack_base(h) ((h)->object_base)
+
+/* Size for allocating ordinary chunks. */
+
+#define obstack_chunk_size(h) ((h)->chunk_size)
+
+/* Pointer to next byte not yet allocated in current chunk. */
+
+#define obstack_next_free(h) ((h)->next_free)
+
+/* Mask specifying low bits that should be clear in address of an object. */
+
+#define obstack_alignment_mask(h) ((h)->alignment_mask)
+
+/* To prevent prototype warnings provide complete argument list in
+ standard C version. */
+#if defined __STDC__ && __STDC__
+
+# define obstack_init(h) \
+ _obstack_begin ((h), 0, 0, \
+ (void *(*) (long)) obstack_chunk_alloc, \
+ (void (*) (void *)) obstack_chunk_free)
+
+# define obstack_begin(h, size) \
+ _obstack_begin ((h), (size), 0, \
+ (void *(*) (long)) obstack_chunk_alloc, \
+ (void (*) (void *)) obstack_chunk_free)
+
+# define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
+ _obstack_begin ((h), (size), (alignment), \
+ (void *(*) (long)) (chunkfun), \
+ (void (*) (void *)) (freefun))
+
+# define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
+ _obstack_begin_1 ((h), (size), (alignment), \
+ (void *(*) (void *, long)) (chunkfun), \
+ (void (*) (void *, void *)) (freefun), (arg))
+
+# define obstack_chunkfun(h, newchunkfun) \
+ ((h) -> chunkfun = (struct _obstack_chunk *(*)(void *, long)) (newchunkfun))
+
+# define obstack_freefun(h, newfreefun) \
+ ((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun))
+
+#else
+
+# define obstack_init(h) \
+ _obstack_begin ((h), 0, 0, \
+ (void *(*) ()) obstack_chunk_alloc, \
+ (void (*) ()) obstack_chunk_free)
+
+# define obstack_begin(h, size) \
+ _obstack_begin ((h), (size), 0, \
+ (void *(*) ()) obstack_chunk_alloc, \
+ (void (*) ()) obstack_chunk_free)
+
+# define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
+ _obstack_begin ((h), (size), (alignment), \
+ (void *(*) ()) (chunkfun), \
+ (void (*) ()) (freefun))
+
+# define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
+ _obstack_begin_1 ((h), (size), (alignment), \
+ (void *(*) ()) (chunkfun), \
+ (void (*) ()) (freefun), (arg))
+
+# define obstack_chunkfun(h, newchunkfun) \
+ ((h) -> chunkfun = (struct _obstack_chunk *(*)()) (newchunkfun))
+
+# define obstack_freefun(h, newfreefun) \
+ ((h) -> freefun = (void (*)()) (newfreefun))
+
+#endif
+
+#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = achar)
+
+#define obstack_blank_fast(h,n) ((h)->next_free += (n))
+
+#define obstack_memory_used(h) _obstack_memory_used (h)
+
+#if defined __GNUC__ && defined __STDC__ && __STDC__
+/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
+ does not implement __extension__. But that compiler doesn't define
+ __GNUC_MINOR__. */
+# if __GNUC__ < 2 || (defined __NeXT__ && __NeXT__ && !__GNUC_MINOR__)
+# define __extension__
+# endif
+
+/* For GNU C, if not -traditional,
+ we can define these macros to compute all args only once
+ without using a global variable.
+ Also, we can avoid using the `temp' slot, to make faster code. */
+
+# define obstack_object_size(OBSTACK) \
+ __extension__ \
+ ({ struct obstack *__o = (OBSTACK); \
+ (unsigned) (__o->next_free - __o->object_base); })
+
+# define obstack_room(OBSTACK) \
+ __extension__ \
+ ({ struct obstack *__o = (OBSTACK); \
+ (unsigned) (__o->chunk_limit - __o->next_free); })
+
+# define obstack_make_room(OBSTACK,length) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ int __len = (length); \
+ if (__o->chunk_limit - __o->next_free < __len) \
+ _obstack_newchunk (__o, __len); \
+ (void) 0; })
+
+# define obstack_empty_p(OBSTACK) \
+ __extension__ \
+ ({ struct obstack *__o = (OBSTACK); \
+ (__o->chunk->prev == 0 && __o->next_free - __o->chunk->contents == 0); })
+
+# define obstack_grow(OBSTACK,where,length) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ int __len = (length); \
+ if (__o->next_free + __len > __o->chunk_limit) \
+ _obstack_newchunk (__o, __len); \
+ _obstack_memcpy (__o->next_free, (where), __len); \
+ __o->next_free += __len; \
+ (void) 0; })
+
+# define obstack_grow0(OBSTACK,where,length) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ int __len = (length); \
+ if (__o->next_free + __len + 1 > __o->chunk_limit) \
+ _obstack_newchunk (__o, __len + 1); \
+ _obstack_memcpy (__o->next_free, (where), __len); \
+ __o->next_free += __len; \
+ *(__o->next_free)++ = 0; \
+ (void) 0; })
+
+# define obstack_1grow(OBSTACK,datum) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ if (__o->next_free + 1 > __o->chunk_limit) \
+ _obstack_newchunk (__o, 1); \
+ *(__o->next_free)++ = (datum); \
+ (void) 0; })
+
+/* These assume that the obstack alignment is good enough for pointers
+ or ints, and that the data added so far to the current object
+ shares that much alignment. */
+
+# define obstack_ptr_grow(OBSTACK,datum) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ if (__o->next_free + sizeof (void *) > __o->chunk_limit) \
+ _obstack_newchunk (__o, sizeof (void *)); \
+ ((*((void **)__o->next_free) = (datum)), (__o->next_free += sizeof (void *))); \
+ (void) 0; })
+
+# define obstack_int_grow(OBSTACK,datum) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ if (__o->next_free + sizeof (int) > __o->chunk_limit) \
+ _obstack_newchunk (__o, sizeof (int)); \
+ ((*((int *)__o->next_free) = (datum)), (__o->next_free += sizeof (int ))); \
+ (void) 0; })
+
+# define obstack_ptr_grow_fast(h,aptr) \
+ (((*((void **) (h)->next_free) = (aptr)), ( (h)->next_free += sizeof (void *))))
+
+# define obstack_int_grow_fast(h,aint) \
+ (((*((int *) (h)->next_free) = (aint)), ( (h)->next_free += sizeof (int ))))
+
+# define obstack_blank(OBSTACK,length) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ int __len = (length); \
+ if (__o->chunk_limit - __o->next_free < __len) \
+ _obstack_newchunk (__o, __len); \
+ __o->next_free += __len; \
+ (void) 0; })
+
+# define obstack_alloc(OBSTACK,length) \
+__extension__ \
+({ struct obstack *__h = (OBSTACK); \
+ obstack_blank (__h, (length)); \
+ obstack_finish (__h); })
+
+# define obstack_copy(OBSTACK,where,length) \
+__extension__ \
+({ struct obstack *__h = (OBSTACK); \
+ obstack_grow (__h, (where), (length)); \
+ obstack_finish (__h); })
+
+# define obstack_copy0(OBSTACK,where,length) \
+__extension__ \
+({ struct obstack *__h = (OBSTACK); \
+ obstack_grow0 (__h, (where), (length)); \
+ obstack_finish (__h); })
+
+/* The local variable is named __o1 to avoid a name conflict
+ when obstack_blank is called. */
+# define obstack_finish(OBSTACK) \
+__extension__ \
+({ struct obstack *__o1 = (OBSTACK); \
+ void *value; \
+ value = (void *) __o1->object_base; \
+ if (__o1->next_free == value) \
+ __o1->maybe_empty_object = 1; \
+ __o1->next_free \
+ = __INT_TO_PTR ((__PTR_TO_INT (__o1->next_free)+__o1->alignment_mask)\
+ & ~ (__o1->alignment_mask)); \
+ if (__o1->next_free - (char *)__o1->chunk \
+ > __o1->chunk_limit - (char *)__o1->chunk) \
+ __o1->next_free = __o1->chunk_limit; \
+ __o1->object_base = __o1->next_free; \
+ value; })
+
+# define obstack_free(OBSTACK, OBJ) \
+__extension__ \
+({ struct obstack *__o = (OBSTACK); \
+ void *__obj = (OBJ); \
+ if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \
+ __o->next_free = __o->object_base = (char *)__obj; \
+ else (obstack_free) (__o, __obj); })
+
+#else /* not __GNUC__ or not __STDC__ */
+
+# define obstack_object_size(h) \
+ (unsigned) ((h)->next_free - (h)->object_base)
+
+# define obstack_room(h) \
+ (unsigned) ((h)->chunk_limit - (h)->next_free)
+
+# define obstack_empty_p(h) \
+ ((h)->chunk->prev == 0 && (h)->next_free - (h)->chunk->contents == 0)
+
+/* Note that the call to _obstack_newchunk is enclosed in (..., 0)
+ so that we can avoid having void expressions
+ in the arms of the conditional expression.
+ Casting the third operand to void was tried before,
+ but some compilers won't accept it. */
+
+# define obstack_make_room(h,length) \
+( (h)->temp = (length), \
+ (((h)->next_free + (h)->temp > (h)->chunk_limit) \
+ ? (_obstack_newchunk ((h), (h)->temp), 0) : 0))
+
+# define obstack_grow(h,where,length) \
+( (h)->temp = (length), \
+ (((h)->next_free + (h)->temp > (h)->chunk_limit) \
+ ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
+ _obstack_memcpy ((h)->next_free, (where), (h)->temp), \
+ (h)->next_free += (h)->temp)
+
+# define obstack_grow0(h,where,length) \
+( (h)->temp = (length), \
+ (((h)->next_free + (h)->temp + 1 > (h)->chunk_limit) \
+ ? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0), \
+ _obstack_memcpy ((h)->next_free, (where), (h)->temp), \
+ (h)->next_free += (h)->temp, \
+ *((h)->next_free)++ = 0)
+
+# define obstack_1grow(h,datum) \
+( (((h)->next_free + 1 > (h)->chunk_limit) \
+ ? (_obstack_newchunk ((h), 1), 0) : 0), \
+ (*((h)->next_free)++ = (datum)))
+
+# define obstack_ptr_grow(h,datum) \
+( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \
+ ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \
+ (*((const char **) (((h)->next_free+=sizeof(char *))-sizeof(char *))) = (datum)))
+
+# define obstack_int_grow(h,datum) \
+( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \
+ ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \
+ (*((int *) (((h)->next_free+=sizeof(int))-sizeof(int))) = (datum)))
+
+# define obstack_ptr_grow_fast(h,aptr) \
+ (((*((const char **) (h)->next_free) = (aptr)), ( (h)->next_free += sizeof (const char *))))
+
+# define obstack_int_grow_fast(h,aint) \
+ (((*((int *) (h)->next_free) = (aint)), ( (h)->next_free += sizeof (int ))))
+
+# define obstack_blank(h,length) \
+( (h)->temp = (length), \
+ (((h)->chunk_limit - (h)->next_free < (h)->temp) \
+ ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
+ ((h)->next_free += (h)->temp))
+
+# define obstack_alloc(h,length) \
+ (obstack_blank ((h), (length)), obstack_finish ((h)))
+
+# define obstack_copy(h,where,length) \
+ (obstack_grow ((h), (where), (length)), obstack_finish ((h)))
+
+# define obstack_copy0(h,where,length) \
+ (obstack_grow0 ((h), (where), (length)), obstack_finish ((h)))
+
+# define obstack_finish(h) \
+( ((h)->next_free == (h)->object_base \
+ ? (((h)->maybe_empty_object = 1), 0) \
+ : 0), \
+ (h)->temp = __PTR_TO_INT ((h)->object_base), \
+ (h)->next_free \
+ = __INT_TO_PTR ((__PTR_TO_INT ((h)->next_free)+(h)->alignment_mask) \
+ & ~ ((h)->alignment_mask)), \
+ (((h)->next_free - (char *) (h)->chunk \
+ > (h)->chunk_limit - (char *) (h)->chunk) \
+ ? ((h)->next_free = (h)->chunk_limit) : 0), \
+ (h)->object_base = (h)->next_free, \
+ __INT_TO_PTR ((h)->temp))
+
+# if defined __STDC__ && __STDC__
+# define obstack_free(h,obj) \
+( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
+ (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
+ ? (int) ((h)->next_free = (h)->object_base \
+ = (h)->temp + (char *) (h)->chunk) \
+ : (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0)))
+# else
+# define obstack_free(h,obj) \
+( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
+ (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
+ ? (int) ((h)->next_free = (h)->object_base \
+ = (h)->temp + (char *) (h)->chunk) \
+ : (_obstack_free ((h), (h)->temp + (char *) (h)->chunk), 0)))
+# endif
+
+#endif /* not __GNUC__ or not __STDC__ */
+
+#ifdef __cplusplus
+} /* C++ */
+#endif
+
+#endif /* obstack.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include-fixed/syslimits.h b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include-fixed/syslimits.h
new file mode 100644
index 0000000..a362802
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include-fixed/syslimits.h
@@ -0,0 +1,8 @@
+/* syslimits.h stands for the system's own limits.h file.
+ If we can use it ok unmodified, then we install this text.
+ If fixincludes fixes it, then the fixed version is installed
+ instead of this text. */
+
+#define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */
+#include_next <limits.h>
+#undef _GCC_NEXT_LIMITS_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/float.h b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/float.h
new file mode 100644
index 0000000..9969f1c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/float.h
@@ -0,0 +1,238 @@
+/* Copyright (C) 2002, 2007, 2008, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+/*
+ * ISO C Standard: 5.2.4.2.2 Characteristics of floating types <float.h>
+ */
+
+#ifndef _FLOAT_H___
+#define _FLOAT_H___
+
+/* Radix of exponent representation, b. */
+#undef FLT_RADIX
+#define FLT_RADIX __FLT_RADIX__
+
+/* Number of base-FLT_RADIX digits in the significand, p. */
+#undef FLT_MANT_DIG
+#undef DBL_MANT_DIG
+#undef LDBL_MANT_DIG
+#define FLT_MANT_DIG __FLT_MANT_DIG__
+#define DBL_MANT_DIG __DBL_MANT_DIG__
+#define LDBL_MANT_DIG __LDBL_MANT_DIG__
+
+/* Number of decimal digits, q, such that any floating-point number with q
+ decimal digits can be rounded into a floating-point number with p radix b
+ digits and back again without change to the q decimal digits,
+
+ p * log10(b) if b is a power of 10
+ floor((p - 1) * log10(b)) otherwise
+*/
+#undef FLT_DIG
+#undef DBL_DIG
+#undef LDBL_DIG
+#define FLT_DIG __FLT_DIG__
+#define DBL_DIG __DBL_DIG__
+#define LDBL_DIG __LDBL_DIG__
+
+/* Minimum int x such that FLT_RADIX**(x-1) is a normalized float, emin */
+#undef FLT_MIN_EXP
+#undef DBL_MIN_EXP
+#undef LDBL_MIN_EXP
+#define FLT_MIN_EXP __FLT_MIN_EXP__
+#define DBL_MIN_EXP __DBL_MIN_EXP__
+#define LDBL_MIN_EXP __LDBL_MIN_EXP__
+
+/* Minimum negative integer such that 10 raised to that power is in the
+ range of normalized floating-point numbers,
+
+ ceil(log10(b) * (emin - 1))
+*/
+#undef FLT_MIN_10_EXP
+#undef DBL_MIN_10_EXP
+#undef LDBL_MIN_10_EXP
+#define FLT_MIN_10_EXP __FLT_MIN_10_EXP__
+#define DBL_MIN_10_EXP __DBL_MIN_10_EXP__
+#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__
+
+/* Maximum int x such that FLT_RADIX**(x-1) is a representable float, emax. */
+#undef FLT_MAX_EXP
+#undef DBL_MAX_EXP
+#undef LDBL_MAX_EXP
+#define FLT_MAX_EXP __FLT_MAX_EXP__
+#define DBL_MAX_EXP __DBL_MAX_EXP__
+#define LDBL_MAX_EXP __LDBL_MAX_EXP__
+
+/* Maximum integer such that 10 raised to that power is in the range of
+ representable finite floating-point numbers,
+
+ floor(log10((1 - b**-p) * b**emax))
+*/
+#undef FLT_MAX_10_EXP
+#undef DBL_MAX_10_EXP
+#undef LDBL_MAX_10_EXP
+#define FLT_MAX_10_EXP __FLT_MAX_10_EXP__
+#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__
+#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__
+
+/* Maximum representable finite floating-point number,
+
+ (1 - b**-p) * b**emax
+*/
+#undef FLT_MAX
+#undef DBL_MAX
+#undef LDBL_MAX
+#define FLT_MAX __FLT_MAX__
+#define DBL_MAX __DBL_MAX__
+#define LDBL_MAX __LDBL_MAX__
+
+/* The difference between 1 and the least value greater than 1 that is
+ representable in the given floating point type, b**1-p. */
+#undef FLT_EPSILON
+#undef DBL_EPSILON
+#undef LDBL_EPSILON
+#define FLT_EPSILON __FLT_EPSILON__
+#define DBL_EPSILON __DBL_EPSILON__
+#define LDBL_EPSILON __LDBL_EPSILON__
+
+/* Minimum normalized positive floating-point number, b**(emin - 1). */
+#undef FLT_MIN
+#undef DBL_MIN
+#undef LDBL_MIN
+#define FLT_MIN __FLT_MIN__
+#define DBL_MIN __DBL_MIN__
+#define LDBL_MIN __LDBL_MIN__
+
+/* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown. */
+/* ??? This is supposed to change with calls to fesetround in <fenv.h>. */
+#undef FLT_ROUNDS
+#define FLT_ROUNDS 1
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+/* The floating-point expression evaluation method.
+ -1 indeterminate
+ 0 evaluate all operations and constants just to the range and
+ precision of the type
+ 1 evaluate operations and constants of type float and double
+ to the range and precision of the double type, evaluate
+ long double operations and constants to the range and
+ precision of the long double type
+ 2 evaluate all operations and constants to the range and
+ precision of the long double type
+
+ ??? This ought to change with the setting of the fp control word;
+ the value provided by the compiler assumes the widest setting. */
+#undef FLT_EVAL_METHOD
+#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
+
+/* Number of decimal digits, n, such that any floating-point number in the
+ widest supported floating type with pmax radix b digits can be rounded
+ to a floating-point number with n decimal digits and back again without
+ change to the value,
+
+ pmax * log10(b) if b is a power of 10
+ ceil(1 + pmax * log10(b)) otherwise
+*/
+#undef DECIMAL_DIG
+#define DECIMAL_DIG __DECIMAL_DIG__
+
+#endif /* C99 */
+
+#ifdef __STDC_WANT_DEC_FP__
+/* Draft Technical Report 24732, extension for decimal floating-point
+ arithmetic: Characteristic of decimal floating types <float.h>. */
+
+/* Number of base-FLT_RADIX digits in the significand, p. */
+#undef DEC32_MANT_DIG
+#undef DEC64_MANT_DIG
+#undef DEC128_MANT_DIG
+#define DEC32_MANT_DIG __DEC32_MANT_DIG__
+#define DEC64_MANT_DIG __DEC64_MANT_DIG__
+#define DEC128_MANT_DIG __DEC128_MANT_DIG__
+
+/* Minimum exponent. */
+#undef DEC32_MIN_EXP
+#undef DEC64_MIN_EXP
+#undef DEC128_MIN_EXP
+#define DEC32_MIN_EXP __DEC32_MIN_EXP__
+#define DEC64_MIN_EXP __DEC64_MIN_EXP__
+#define DEC128_MIN_EXP __DEC128_MIN_EXP__
+
+/* Maximum exponent. */
+#undef DEC32_MAX_EXP
+#undef DEC64_MAX_EXP
+#undef DEC128_MAX_EXP
+#define DEC32_MAX_EXP __DEC32_MAX_EXP__
+#define DEC64_MAX_EXP __DEC64_MAX_EXP__
+#define DEC128_MAX_EXP __DEC128_MAX_EXP__
+
+/* Maximum representable finite decimal floating-point number
+ (there are 6, 15, and 33 9s after the decimal points respectively). */
+#undef DEC32_MAX
+#undef DEC64_MAX
+#undef DEC128_MAX
+#define DEC32_MAX __DEC32_MAX__
+#define DEC64_MAX __DEC64_MAX__
+#define DEC128_MAX __DEC128_MAX__
+
+/* The difference between 1 and the least value greater than 1 that is
+ representable in the given floating point type. */
+#undef DEC32_EPSILON
+#undef DEC64_EPSILON
+#undef DEC128_EPSILON
+#define DEC32_EPSILON __DEC32_EPSILON__
+#define DEC64_EPSILON __DEC64_EPSILON__
+#define DEC128_EPSILON __DEC128_EPSILON__
+
+/* Minimum normalized positive floating-point number. */
+#undef DEC32_MIN
+#undef DEC64_MIN
+#undef DEC128_MIN
+#define DEC32_MIN __DEC32_MIN__
+#define DEC64_MIN __DEC64_MIN__
+#define DEC128_MIN __DEC128_MIN__
+
+/* Minimum subnormal positive floating-point number. */
+#undef DEC32_SUBNORMAL_MIN
+#undef DEC64_SUBNORMAL_MIN
+#undef DEC128_SUBNORMAL_MIN
+#define DEC32_SUBNORMAL_MIN __DEC32_SUBNORMAL_MIN__
+#define DEC64_SUBNORMAL_MIN __DEC64_SUBNORMAL_MIN__
+#define DEC128_SUBNORMAL_MIN __DEC128_SUBNORMAL_MIN__
+
+/* The floating-point expression evaluation method.
+ -1 indeterminate
+ 0 evaluate all operations and constants just to the range and
+ precision of the type
+ 1 evaluate operations and constants of type _Decimal32
+ and _Decimal64 to the range and precision of the _Decimal64
+ type, evaluate _Decimal128 operations and constants to the
+ range and precision of the _Decimal128 type;
+ 2 evaluate all operations and constants to the range and
+ precision of the _Decimal128 type. */
+
+#undef DEC_EVAL_METHOD
+#define DEC_EVAL_METHOD __DEC_EVAL_METHOD__
+
+#endif /* __STDC_WANT_DEC_FP__ */
+
+#endif /* _FLOAT_H___ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/iso646.h b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/iso646.h
new file mode 100644
index 0000000..28ff9d1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/iso646.h
@@ -0,0 +1,45 @@
+/* Copyright (C) 1997, 1999, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+/*
+ * ISO C Standard: 7.9 Alternative spellings <iso646.h>
+ */
+
+#ifndef _ISO646_H
+#define _ISO646_H
+
+#ifndef __cplusplus
+#define and &&
+#define and_eq &=
+#define bitand &
+#define bitor |
+#define compl ~
+#define not !
+#define not_eq !=
+#define or ||
+#define or_eq |=
+#define xor ^
+#define xor_eq ^=
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/loongson.h b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/loongson.h
new file mode 100644
index 0000000..6bfd4d7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/loongson.h
@@ -0,0 +1,690 @@
+/* Intrinsics for ST Microelectronics Loongson-2E/2F SIMD operations.
+
+ Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+ Contributed by CodeSourcery.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ GCC is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _GCC_LOONGSON_H
+#define _GCC_LOONGSON_H
+
+#if !defined(__mips_loongson_vector_rev)
+# error "You must select -march=loongson2e or -march=loongson2f to use loongson.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+/* Vectors of unsigned bytes, halfwords and words. */
+typedef uint8_t uint8x8_t __attribute__((vector_size (8)));
+typedef uint16_t uint16x4_t __attribute__((vector_size (8)));
+typedef uint32_t uint32x2_t __attribute__((vector_size (8)));
+
+/* Vectors of signed bytes, halfwords and words. */
+typedef int8_t int8x8_t __attribute__((vector_size (8)));
+typedef int16_t int16x4_t __attribute__((vector_size (8)));
+typedef int32_t int32x2_t __attribute__((vector_size (8)));
+
+/* SIMD intrinsics.
+ Unless otherwise noted, calls to the functions below will expand into
+ precisely one machine instruction, modulo any moves required to
+ satisfy register allocation constraints. */
+
+/* Pack with signed saturation. */
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+packsswh (int32x2_t s, int32x2_t t)
+{
+ return __builtin_loongson_packsswh (s, t);
+}
+
+__extension__ static __inline int8x8_t __attribute__ ((__always_inline__))
+packsshb (int16x4_t s, int16x4_t t)
+{
+ return __builtin_loongson_packsshb (s, t);
+}
+
+/* Pack with unsigned saturation. */
+__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
+packushb (uint16x4_t s, uint16x4_t t)
+{
+ return __builtin_loongson_packushb (s, t);
+}
+
+/* Vector addition, treating overflow by wraparound. */
+__extension__ static __inline uint32x2_t __attribute__ ((__always_inline__))
+paddw_u (uint32x2_t s, uint32x2_t t)
+{
+ return __builtin_loongson_paddw_u (s, t);
+}
+
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+paddh_u (uint16x4_t s, uint16x4_t t)
+{
+ return __builtin_loongson_paddh_u (s, t);
+}
+
+__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
+paddb_u (uint8x8_t s, uint8x8_t t)
+{
+ return __builtin_loongson_paddb_u (s, t);
+}
+
+__extension__ static __inline int32x2_t __attribute__ ((__always_inline__))
+paddw_s (int32x2_t s, int32x2_t t)
+{
+ return __builtin_loongson_paddw_s (s, t);
+}
+
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+paddh_s (int16x4_t s, int16x4_t t)
+{
+ return __builtin_loongson_paddh_s (s, t);
+}
+
+__extension__ static __inline int8x8_t __attribute__ ((__always_inline__))
+paddb_s (int8x8_t s, int8x8_t t)
+{
+ return __builtin_loongson_paddb_s (s, t);
+}
+
+/* Addition of doubleword integers, treating overflow by wraparound. */
+__extension__ static __inline uint64_t __attribute__ ((__always_inline__))
+paddd_u (uint64_t s, uint64_t t)
+{
+ return __builtin_loongson_paddd_u (s, t);
+}
+
+__extension__ static __inline int64_t __attribute__ ((__always_inline__))
+paddd_s (int64_t s, int64_t t)
+{
+ return __builtin_loongson_paddd_s (s, t);
+}
+
+/* Vector addition, treating overflow by signed saturation. */
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+paddsh (int16x4_t s, int16x4_t t)
+{
+ return __builtin_loongson_paddsh (s, t);
+}
+
+__extension__ static __inline int8x8_t __attribute__ ((__always_inline__))
+paddsb (int8x8_t s, int8x8_t t)
+{
+ return __builtin_loongson_paddsb (s, t);
+}
+
+/* Vector addition, treating overflow by unsigned saturation. */
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+paddush (uint16x4_t s, uint16x4_t t)
+{
+ return __builtin_loongson_paddush (s, t);
+}
+
+__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
+paddusb (uint8x8_t s, uint8x8_t t)
+{
+ return __builtin_loongson_paddusb (s, t);
+}
+
+/* Logical AND NOT. */
+__extension__ static __inline uint64_t __attribute__ ((__always_inline__))
+pandn_ud (uint64_t s, uint64_t t)
+{
+ return __builtin_loongson_pandn_ud (s, t);
+}
+
+__extension__ static __inline uint32x2_t __attribute__ ((__always_inline__))
+pandn_uw (uint32x2_t s, uint32x2_t t)
+{
+ return __builtin_loongson_pandn_uw (s, t);
+}
+
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+pandn_uh (uint16x4_t s, uint16x4_t t)
+{
+ return __builtin_loongson_pandn_uh (s, t);
+}
+
+__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
+pandn_ub (uint8x8_t s, uint8x8_t t)
+{
+ return __builtin_loongson_pandn_ub (s, t);
+}
+
+__extension__ static __inline int64_t __attribute__ ((__always_inline__))
+pandn_sd (int64_t s, int64_t t)
+{
+ return __builtin_loongson_pandn_sd (s, t);
+}
+
+__extension__ static __inline int32x2_t __attribute__ ((__always_inline__))
+pandn_sw (int32x2_t s, int32x2_t t)
+{
+ return __builtin_loongson_pandn_sw (s, t);
+}
+
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+pandn_sh (int16x4_t s, int16x4_t t)
+{
+ return __builtin_loongson_pandn_sh (s, t);
+}
+
+__extension__ static __inline int8x8_t __attribute__ ((__always_inline__))
+pandn_sb (int8x8_t s, int8x8_t t)
+{
+ return __builtin_loongson_pandn_sb (s, t);
+}
+
+/* Average. */
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+pavgh (uint16x4_t s, uint16x4_t t)
+{
+ return __builtin_loongson_pavgh (s, t);
+}
+
+__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
+pavgb (uint8x8_t s, uint8x8_t t)
+{
+ return __builtin_loongson_pavgb (s, t);
+}
+
+/* Equality test. */
+__extension__ static __inline uint32x2_t __attribute__ ((__always_inline__))
+pcmpeqw_u (uint32x2_t s, uint32x2_t t)
+{
+ return __builtin_loongson_pcmpeqw_u (s, t);
+}
+
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+pcmpeqh_u (uint16x4_t s, uint16x4_t t)
+{
+ return __builtin_loongson_pcmpeqh_u (s, t);
+}
+
+__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
+pcmpeqb_u (uint8x8_t s, uint8x8_t t)
+{
+ return __builtin_loongson_pcmpeqb_u (s, t);
+}
+
+__extension__ static __inline int32x2_t __attribute__ ((__always_inline__))
+pcmpeqw_s (int32x2_t s, int32x2_t t)
+{
+ return __builtin_loongson_pcmpeqw_s (s, t);
+}
+
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+pcmpeqh_s (int16x4_t s, int16x4_t t)
+{
+ return __builtin_loongson_pcmpeqh_s (s, t);
+}
+
+__extension__ static __inline int8x8_t __attribute__ ((__always_inline__))
+pcmpeqb_s (int8x8_t s, int8x8_t t)
+{
+ return __builtin_loongson_pcmpeqb_s (s, t);
+}
+
+/* Greater-than test. */
+__extension__ static __inline uint32x2_t __attribute__ ((__always_inline__))
+pcmpgtw_u (uint32x2_t s, uint32x2_t t)
+{
+ return __builtin_loongson_pcmpgtw_u (s, t);
+}
+
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+pcmpgth_u (uint16x4_t s, uint16x4_t t)
+{
+ return __builtin_loongson_pcmpgth_u (s, t);
+}
+
+__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
+pcmpgtb_u (uint8x8_t s, uint8x8_t t)
+{
+ return __builtin_loongson_pcmpgtb_u (s, t);
+}
+
+__extension__ static __inline int32x2_t __attribute__ ((__always_inline__))
+pcmpgtw_s (int32x2_t s, int32x2_t t)
+{
+ return __builtin_loongson_pcmpgtw_s (s, t);
+}
+
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+pcmpgth_s (int16x4_t s, int16x4_t t)
+{
+ return __builtin_loongson_pcmpgth_s (s, t);
+}
+
+__extension__ static __inline int8x8_t __attribute__ ((__always_inline__))
+pcmpgtb_s (int8x8_t s, int8x8_t t)
+{
+ return __builtin_loongson_pcmpgtb_s (s, t);
+}
+
+/* Extract halfword. */
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+pextrh_u (uint16x4_t s, int field /* 0--3 */)
+{
+ return __builtin_loongson_pextrh_u (s, field);
+}
+
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+pextrh_s (int16x4_t s, int field /* 0--3 */)
+{
+ return __builtin_loongson_pextrh_s (s, field);
+}
+
+/* Insert halfword. */
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+pinsrh_0_u (uint16x4_t s, uint16x4_t t)
+{
+ return __builtin_loongson_pinsrh_0_u (s, t);
+}
+
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+pinsrh_1_u (uint16x4_t s, uint16x4_t t)
+{
+ return __builtin_loongson_pinsrh_1_u (s, t);
+}
+
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+pinsrh_2_u (uint16x4_t s, uint16x4_t t)
+{
+ return __builtin_loongson_pinsrh_2_u (s, t);
+}
+
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+pinsrh_3_u (uint16x4_t s, uint16x4_t t)
+{
+ return __builtin_loongson_pinsrh_3_u (s, t);
+}
+
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+pinsrh_0_s (int16x4_t s, int16x4_t t)
+{
+ return __builtin_loongson_pinsrh_0_s (s, t);
+}
+
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+pinsrh_1_s (int16x4_t s, int16x4_t t)
+{
+ return __builtin_loongson_pinsrh_1_s (s, t);
+}
+
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+pinsrh_2_s (int16x4_t s, int16x4_t t)
+{
+ return __builtin_loongson_pinsrh_2_s (s, t);
+}
+
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+pinsrh_3_s (int16x4_t s, int16x4_t t)
+{
+ return __builtin_loongson_pinsrh_3_s (s, t);
+}
+
+/* Multiply and add. */
+__extension__ static __inline int32x2_t __attribute__ ((__always_inline__))
+pmaddhw (int16x4_t s, int16x4_t t)
+{
+ return __builtin_loongson_pmaddhw (s, t);
+}
+
+/* Maximum of signed halfwords. */
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+pmaxsh (int16x4_t s, int16x4_t t)
+{
+ return __builtin_loongson_pmaxsh (s, t);
+}
+
+/* Maximum of unsigned bytes. */
+__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
+pmaxub (uint8x8_t s, uint8x8_t t)
+{
+ return __builtin_loongson_pmaxub (s, t);
+}
+
+/* Minimum of signed halfwords. */
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+pminsh (int16x4_t s, int16x4_t t)
+{
+ return __builtin_loongson_pminsh (s, t);
+}
+
+/* Minimum of unsigned bytes. */
+__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
+pminub (uint8x8_t s, uint8x8_t t)
+{
+ return __builtin_loongson_pminub (s, t);
+}
+
+/* Move byte mask. */
+__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
+pmovmskb_u (uint8x8_t s)
+{
+ return __builtin_loongson_pmovmskb_u (s);
+}
+
+__extension__ static __inline int8x8_t __attribute__ ((__always_inline__))
+pmovmskb_s (int8x8_t s)
+{
+ return __builtin_loongson_pmovmskb_s (s);
+}
+
+/* Multiply unsigned integers and store high result. */
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+pmulhuh (uint16x4_t s, uint16x4_t t)
+{
+ return __builtin_loongson_pmulhuh (s, t);
+}
+
+/* Multiply signed integers and store high result. */
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+pmulhh (int16x4_t s, int16x4_t t)
+{
+ return __builtin_loongson_pmulhh (s, t);
+}
+
+/* Multiply signed integers and store low result. */
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+pmullh (int16x4_t s, int16x4_t t)
+{
+ return __builtin_loongson_pmullh (s, t);
+}
+
+/* Multiply unsigned word integers. */
+__extension__ static __inline int64_t __attribute__ ((__always_inline__))
+pmuluw (uint32x2_t s, uint32x2_t t)
+{
+ return __builtin_loongson_pmuluw (s, t);
+}
+
+/* Absolute difference. */
+__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
+pasubub (uint8x8_t s, uint8x8_t t)
+{
+ return __builtin_loongson_pasubub (s, t);
+}
+
+/* Sum of unsigned byte integers. */
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+biadd (uint8x8_t s)
+{
+ return __builtin_loongson_biadd (s);
+}
+
+/* Sum of absolute differences.
+ Note that this intrinsic expands into two machine instructions:
+ PASUBUB followed by BIADD. */
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+psadbh (uint8x8_t s, uint8x8_t t)
+{
+ return __builtin_loongson_psadbh (s, t);
+}
+
+/* Shuffle halfwords. */
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+pshufh_u (uint16x4_t dest, uint16x4_t s, uint8_t order)
+{
+ return __builtin_loongson_pshufh_u (dest, s, order);
+}
+
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+pshufh_s (int16x4_t dest, int16x4_t s, uint8_t order)
+{
+ return __builtin_loongson_pshufh_s (dest, s, order);
+}
+
+/* Shift left logical. */
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+psllh_u (uint16x4_t s, uint8_t amount)
+{
+ return __builtin_loongson_psllh_u (s, amount);
+}
+
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+psllh_s (int16x4_t s, uint8_t amount)
+{
+ return __builtin_loongson_psllh_s (s, amount);
+}
+
+__extension__ static __inline uint32x2_t __attribute__ ((__always_inline__))
+psllw_u (uint32x2_t s, uint8_t amount)
+{
+ return __builtin_loongson_psllw_u (s, amount);
+}
+
+__extension__ static __inline int32x2_t __attribute__ ((__always_inline__))
+psllw_s (int32x2_t s, uint8_t amount)
+{
+ return __builtin_loongson_psllw_s (s, amount);
+}
+
+/* Shift right logical. */
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+psrlh_u (uint16x4_t s, uint8_t amount)
+{
+ return __builtin_loongson_psrlh_u (s, amount);
+}
+
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+psrlh_s (int16x4_t s, uint8_t amount)
+{
+ return __builtin_loongson_psrlh_s (s, amount);
+}
+
+__extension__ static __inline uint32x2_t __attribute__ ((__always_inline__))
+psrlw_u (uint32x2_t s, uint8_t amount)
+{
+ return __builtin_loongson_psrlw_u (s, amount);
+}
+
+__extension__ static __inline int32x2_t __attribute__ ((__always_inline__))
+psrlw_s (int32x2_t s, uint8_t amount)
+{
+ return __builtin_loongson_psrlw_s (s, amount);
+}
+
+/* Shift right arithmetic. */
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+psrah_u (uint16x4_t s, uint8_t amount)
+{
+ return __builtin_loongson_psrah_u (s, amount);
+}
+
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+psrah_s (int16x4_t s, uint8_t amount)
+{
+ return __builtin_loongson_psrah_s (s, amount);
+}
+
+__extension__ static __inline uint32x2_t __attribute__ ((__always_inline__))
+psraw_u (uint32x2_t s, uint8_t amount)
+{
+ return __builtin_loongson_psraw_u (s, amount);
+}
+
+__extension__ static __inline int32x2_t __attribute__ ((__always_inline__))
+psraw_s (int32x2_t s, uint8_t amount)
+{
+ return __builtin_loongson_psraw_s (s, amount);
+}
+
+/* Vector subtraction, treating overflow by wraparound. */
+__extension__ static __inline uint32x2_t __attribute__ ((__always_inline__))
+psubw_u (uint32x2_t s, uint32x2_t t)
+{
+ return __builtin_loongson_psubw_u (s, t);
+}
+
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+psubh_u (uint16x4_t s, uint16x4_t t)
+{
+ return __builtin_loongson_psubh_u (s, t);
+}
+
+__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
+psubb_u (uint8x8_t s, uint8x8_t t)
+{
+ return __builtin_loongson_psubb_u (s, t);
+}
+
+__extension__ static __inline int32x2_t __attribute__ ((__always_inline__))
+psubw_s (int32x2_t s, int32x2_t t)
+{
+ return __builtin_loongson_psubw_s (s, t);
+}
+
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+psubh_s (int16x4_t s, int16x4_t t)
+{
+ return __builtin_loongson_psubh_s (s, t);
+}
+
+__extension__ static __inline int8x8_t __attribute__ ((__always_inline__))
+psubb_s (int8x8_t s, int8x8_t t)
+{
+ return __builtin_loongson_psubb_s (s, t);
+}
+
+/* Subtraction of doubleword integers, treating overflow by wraparound. */
+__extension__ static __inline uint64_t __attribute__ ((__always_inline__))
+psubd_u (uint64_t s, uint64_t t)
+{
+ return __builtin_loongson_psubd_u (s, t);
+}
+
+__extension__ static __inline int64_t __attribute__ ((__always_inline__))
+psubd_s (int64_t s, int64_t t)
+{
+ return __builtin_loongson_psubd_s (s, t);
+}
+
+/* Vector subtraction, treating overflow by signed saturation. */
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+psubsh (int16x4_t s, int16x4_t t)
+{
+ return __builtin_loongson_psubsh (s, t);
+}
+
+__extension__ static __inline int8x8_t __attribute__ ((__always_inline__))
+psubsb (int8x8_t s, int8x8_t t)
+{
+ return __builtin_loongson_psubsb (s, t);
+}
+
+/* Vector subtraction, treating overflow by unsigned saturation. */
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+psubush (uint16x4_t s, uint16x4_t t)
+{
+ return __builtin_loongson_psubush (s, t);
+}
+
+__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
+psubusb (uint8x8_t s, uint8x8_t t)
+{
+ return __builtin_loongson_psubusb (s, t);
+}
+
+/* Unpack high data. */
+__extension__ static __inline uint32x2_t __attribute__ ((__always_inline__))
+punpckhwd_u (uint32x2_t s, uint32x2_t t)
+{
+ return __builtin_loongson_punpckhwd_u (s, t);
+}
+
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+punpckhhw_u (uint16x4_t s, uint16x4_t t)
+{
+ return __builtin_loongson_punpckhhw_u (s, t);
+}
+
+__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
+punpckhbh_u (uint8x8_t s, uint8x8_t t)
+{
+ return __builtin_loongson_punpckhbh_u (s, t);
+}
+
+__extension__ static __inline int32x2_t __attribute__ ((__always_inline__))
+punpckhwd_s (int32x2_t s, int32x2_t t)
+{
+ return __builtin_loongson_punpckhwd_s (s, t);
+}
+
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+punpckhhw_s (int16x4_t s, int16x4_t t)
+{
+ return __builtin_loongson_punpckhhw_s (s, t);
+}
+
+__extension__ static __inline int8x8_t __attribute__ ((__always_inline__))
+punpckhbh_s (int8x8_t s, int8x8_t t)
+{
+ return __builtin_loongson_punpckhbh_s (s, t);
+}
+
+/* Unpack low data. */
+__extension__ static __inline uint32x2_t __attribute__ ((__always_inline__))
+punpcklwd_u (uint32x2_t s, uint32x2_t t)
+{
+ return __builtin_loongson_punpcklwd_u (s, t);
+}
+
+__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__))
+punpcklhw_u (uint16x4_t s, uint16x4_t t)
+{
+ return __builtin_loongson_punpcklhw_u (s, t);
+}
+
+__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__))
+punpcklbh_u (uint8x8_t s, uint8x8_t t)
+{
+ return __builtin_loongson_punpcklbh_u (s, t);
+}
+
+__extension__ static __inline int32x2_t __attribute__ ((__always_inline__))
+punpcklwd_s (int32x2_t s, int32x2_t t)
+{
+ return __builtin_loongson_punpcklwd_s (s, t);
+}
+
+__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
+punpcklhw_s (int16x4_t s, int16x4_t t)
+{
+ return __builtin_loongson_punpcklhw_s (s, t);
+}
+
+__extension__ static __inline int8x8_t __attribute__ ((__always_inline__))
+punpcklbh_s (int8x8_t s, int8x8_t t)
+{
+ return __builtin_loongson_punpcklbh_s (s, t);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/mf-runtime.h b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/mf-runtime.h
new file mode 100644
index 0000000..4c512d5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/mf-runtime.h
@@ -0,0 +1,244 @@
+/* Implementation header for mudflap runtime library.
+ Mudflap: narrow-pointer bounds-checking by tree rewriting.
+ Copyright (C) 2002, 2003, 2004, 2005, 2009 Free Software Foundation, Inc.
+ Contributed by Frank Ch. Eigler <fche@redhat.com>
+ and Graydon Hoare <graydon@redhat.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+/* Public libmudflap declarations -*- C -*- */
+
+#ifndef MF_RUNTIME_H
+#define MF_RUNTIME_H
+
+typedef void *__mf_ptr_t;
+typedef unsigned int __mf_uintptr_t __attribute__ ((__mode__ (__pointer__)));
+typedef __SIZE_TYPE__ __mf_size_t;
+
+/* Global declarations used by instrumentation. When _MUDFLAP is
+ defined, these have been auto-declared by the compiler and we
+ should not declare them again (ideally we *would* declare them
+ again, to verify that the compiler's declarations match the
+ library's, but the C++ front end has no mechanism for allowing
+ the re-definition of a structure type). */
+#ifndef _MUDFLAP
+struct __mf_cache { __mf_uintptr_t low; __mf_uintptr_t high; };
+extern struct __mf_cache __mf_lookup_cache [];
+extern __mf_uintptr_t __mf_lc_mask;
+extern unsigned char __mf_lc_shift;
+#endif
+
+/* Multithreading support. */
+#ifdef _MUDFLAPTH
+/* extern pthread_mutex_t __mf_biglock; */
+#ifndef _REENTRANT
+#define _REENTRANT
+#endif
+#ifndef _THREAD_SAFE
+#define _THREAD_SAFE
+#endif
+#endif
+
+/* Codes to describe the type of access to check: __mf_check arg 3 */
+
+#define __MF_CHECK_READ 0
+#define __MF_CHECK_WRITE 1
+
+
+/* Codes to describe a region of memory being registered: __mf_*register arg 3 */
+
+#define __MF_TYPE_NOACCESS 0
+#define __MF_TYPE_HEAP 1
+#define __MF_TYPE_HEAP_I 2
+#define __MF_TYPE_STACK 3
+#define __MF_TYPE_STATIC 4
+#define __MF_TYPE_GUESS 5
+
+
+/* The public mudflap API */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void __mf_check (void *ptr, __mf_size_t sz, int type, const char *location)
+ __attribute((nothrow));
+extern void __mf_register (void *ptr, __mf_size_t sz, int type, const char *name)
+ __attribute((nothrow));
+extern void __mf_unregister (void *ptr, __mf_size_t sz, int type)
+ __attribute((nothrow));
+extern unsigned __mf_watch (void *ptr, __mf_size_t sz);
+extern unsigned __mf_unwatch (void *ptr, __mf_size_t sz);
+extern void __mf_report ();
+extern int __mf_set_options (const char *opts);
+
+
+/* Redirect some standard library functions to libmudflap. These are
+ done by simple #define rather than linker wrapping, since only
+ instrumented modules are meant to be affected. */
+
+#ifdef _MUDFLAP
+#pragma redefine_extname memcpy __mfwrap_memcpy
+#pragma redefine_extname memmove __mfwrap_memmove
+#pragma redefine_extname memset __mfwrap_memset
+#pragma redefine_extname memcmp __mfwrap_memcmp
+#pragma redefine_extname memchr __mfwrap_memchr
+#pragma redefine_extname memrchr __mfwrap_memrchr
+#pragma redefine_extname strcpy __mfwrap_strcpy
+#pragma redefine_extname strncpy __mfwrap_strncpy
+#pragma redefine_extname strcat __mfwrap_strcat
+#pragma redefine_extname strncat __mfwrap_strncat
+#pragma redefine_extname strcmp __mfwrap_strcmp
+#pragma redefine_extname strcasecmp __mfwrap_strcasecmp
+#pragma redefine_extname strncmp __mfwrap_strncmp
+#pragma redefine_extname strncasecmp __mfwrap_strncasecmp
+#pragma redefine_extname strdup __mfwrap_strdup
+#pragma redefine_extname strndup __mfwrap_strndup
+#pragma redefine_extname strchr __mfwrap_strchr
+#pragma redefine_extname strrchr __mfwrap_strrchr
+#pragma redefine_extname strstr __mfwrap_strstr
+#pragma redefine_extname memmem __mfwrap_memmem
+#pragma redefine_extname strlen __mfwrap_strlen
+#pragma redefine_extname strnlen __mfwrap_strnlen
+#pragma redefine_extname bzero __mfwrap_bzero
+#pragma redefine_extname bcopy __mfwrap_bcopy
+#pragma redefine_extname bcmp __mfwrap_bcmp
+#pragma redefine_extname index __mfwrap_index
+#pragma redefine_extname rindex __mfwrap_rindex
+#pragma redefine_extname asctime __mfwrap_asctime
+#pragma redefine_extname ctime __mfwrap_ctime
+#pragma redefine_extname gmtime __mfwrap_gmtime
+#pragma redefine_extname localtime __mfwrap_localtime
+#pragma redefine_extname time __mfwrap_time
+#pragma redefine_extname strerror __mfwrap_strerror
+#pragma redefine_extname fopen __mfwrap_fopen
+#pragma redefine_extname fdopen __mfwrap_fdopen
+#pragma redefine_extname freopen __mfwrap_freopen
+#pragma redefine_extname fclose __mfwrap_fclose
+#pragma redefine_extname fread __mfwrap_fread
+#pragma redefine_extname fwrite __mfwrap_fwrite
+#pragma redefine_extname fgetc __mfwrap_fgetc
+#pragma redefine_extname fgets __mfwrap_fgets
+#pragma redefine_extname getc __mfwrap_getc
+#pragma redefine_extname gets __mfwrap_gets
+#pragma redefine_extname ungetc __mfwrap_ungetc
+#pragma redefine_extname fputc __mfwrap_fputc
+#pragma redefine_extname fputs __mfwrap_fputs
+#pragma redefine_extname putc __mfwrap_putc
+#pragma redefine_extname puts __mfwrap_puts
+#pragma redefine_extname clearerr __mfwrap_clearerr
+#pragma redefine_extname feof __mfwrap_feof
+#pragma redefine_extname ferror __mfwrap_ferror
+#pragma redefine_extname fileno __mfwrap_fileno
+#pragma redefine_extname printf __mfwrap_printf
+#pragma redefine_extname fprintf __mfwrap_fprintf
+#pragma redefine_extname sprintf __mfwrap_sprintf
+#pragma redefine_extname snprintf __mfwrap_snprintf
+#pragma redefine_extname vprintf __mfwrap_vprintf
+#pragma redefine_extname vfprintf __mfwrap_vfprintf
+#pragma redefine_extname vsprintf __mfwrap_vsprintf
+#pragma redefine_extname vsnprintf __mfwrap_vsnprintf
+#pragma redefine_extname access __mfwrap_access
+#pragma redefine_extname remove __mfwrap_remove
+#pragma redefine_extname fflush __mfwrap_fflush
+#pragma redefine_extname fseek __mfwrap_fseek
+#pragma redefine_extname ftell __mfwrap_ftell
+#pragma redefine_extname rewind __mfwrap_rewind
+#pragma redefine_extname fgetpos __mfwrap_fgetpos
+#pragma redefine_extname fsetpos __mfwrap_fsetpos
+#pragma redefine_extname stat __mfwrap_stat
+#pragma redefine_extname fstat __mfwrap_fstat
+#pragma redefine_extname lstat __mfwrap_lstat
+#pragma redefine_extname mkfifo __mfwrap_mkfifo
+#pragma redefine_extname setvbuf __mfwrap_setvbuf
+#pragma redefine_extname setbuf __mfwrap_setbuf
+#pragma redefine_extname setbuffer __mfwrap_setbuffer
+#pragma redefine_extname setlinebuf __mfwrap_setlinebuf
+#pragma redefine_extname opendir __mfwrap_opendir
+#pragma redefine_extname closedir __mfwrap_closedir
+#pragma redefine_extname readdir __mfwrap_readdir
+#pragma redefine_extname recv __mfwrap_recv
+#pragma redefine_extname recvfrom __mfwrap_recvfrom
+#pragma redefine_extname recvmsg __mfwrap_recvmsg
+#pragma redefine_extname send __mfwrap_send
+#pragma redefine_extname sendto __mfwrap_sendto
+#pragma redefine_extname sendmsg __mfwrap_sendmsg
+#pragma redefine_extname setsockopt __mfwrap_setsockopt
+#pragma redefine_extname getsockopt __mfwrap_getsockopt
+#pragma redefine_extname accept __mfwrap_accept
+#pragma redefine_extname bind __mfwrap_bind
+#pragma redefine_extname connect __mfwrap_connect
+#pragma redefine_extname gethostname __mfwrap_gethostname
+#pragma redefine_extname sethostname __mfwrap_sethostname
+#pragma redefine_extname gethostbyname __mfwrap_gethostbyname
+#pragma redefine_extname wait __mfwrap_wait
+#pragma redefine_extname waitpid __mfwrap_waitpid
+#pragma redefine_extname popen __mfwrap_popen
+#pragma redefine_extname pclose __mfwrap_pclose
+#pragma redefine_extname execve __mfwrap_execve
+#pragma redefine_extname execv __mfwrap_execv
+#pragma redefine_extname execvp __mfwrap_execvp
+#pragma redefine_extname system __mfwrap_system
+#pragma redefine_extname dlopen __mfwrap_dlopen
+#pragma redefine_extname dlerror __mfwrap_dlerror
+#pragma redefine_extname dlsym __mfwrap_dlsym
+#pragma redefine_extname dlclose __mfwrap_dlclose
+#pragma redefine_extname fopen64 __mfwrap_fopen64
+#pragma redefine_extname freopen64 __mfwrap_freopen64
+#pragma redefine_extname stat64 __mfwrap_stat64
+#pragma redefine_extname fseeko64 __mfwrap_fseeko64
+#pragma redefine_extname ftello64 __mfwrap_ftello64
+#pragma redefine_extname semop __mfwrap_semop
+#pragma redefine_extname semctl __mfwrap_semctl
+#pragma redefine_extname shmctl __mfwrap_shmctl
+#pragma redefine_extname shmat __mfwrap_shmat
+#pragma redefine_extname shmdt __mfwrap_shmdt
+#pragma redefine_extname __ctype_b_loc __mfwrap___ctype_b_loc
+#pragma redefine_extname __ctype_toupper_loc __mfwrap___ctype_toupper_loc
+#pragma redefine_extname __ctype_tolower_loc __mfwrap___ctype_tolower_loc
+#pragma redefine_extname getlogin __mfwrap_getlogin
+#pragma redefine_extname cuserid __mfwrap_cuserid
+#pragma redefine_extname getpwnam __mfwrap_getpwnam
+#pragma redefine_extname getpwuid __mfwrap_getpwuid
+#pragma redefine_extname getgrnam __mfwrap_getgrnam
+#pragma redefine_extname getgrgid __mfwrap_getgrgid
+#pragma redefine_extname getservent __mfwrap_getservent
+#pragma redefine_extname getservbyname __mfwrap_getservbyname
+#pragma redefine_extname getservbyport __mfwrap_getservbyport
+#pragma redefine_extname gai_strerror __mfwrap_gai_strerror
+#pragma redefine_extname getmntent __mfwrap_getmntent
+#pragma redefine_extname inet_ntoa __mfwrap_inet_ntoa
+#pragma redefine_extname getprotoent __mfwrap_getprotoent
+#pragma redefine_extname getprotobyname __mfwrap_getprotobyname
+#pragma redefine_extname getprotobynumber __mfwrap_getprotobynumber
+
+/* Disable glibc macros. */
+#define __NO_STRING_INLINES
+
+#endif /* _MUDFLAP */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MF_RUNTIME_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/omp.h b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/omp.h
new file mode 100644
index 0000000..6102dbf
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/omp.h
@@ -0,0 +1,105 @@
+/* Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+ Contributed by Richard Henderson <rth@redhat.com>.
+
+ This file is part of the GNU OpenMP Library (libgomp).
+
+ Libgomp is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef OMP_H
+#define OMP_H 1
+
+#ifndef _LIBGOMP_OMP_LOCK_DEFINED
+#define _LIBGOMP_OMP_LOCK_DEFINED 1
+/* These two structures get edited by the libgomp build process to
+ reflect the shape of the two types. Their internals are private
+ to the library. */
+
+typedef struct
+{
+ unsigned char _x[4]
+ __attribute__((__aligned__(4)));
+} omp_lock_t;
+
+typedef struct
+{
+ unsigned char _x[12]
+ __attribute__((__aligned__(4)));
+} omp_nest_lock_t;
+#endif
+
+typedef enum omp_sched_t
+{
+ omp_sched_static = 1,
+ omp_sched_dynamic = 2,
+ omp_sched_guided = 3,
+ omp_sched_auto = 4
+} omp_sched_t;
+
+#ifdef __cplusplus
+extern "C" {
+# define __GOMP_NOTHROW throw ()
+#else
+# define __GOMP_NOTHROW __attribute__((__nothrow__))
+#endif
+
+extern void omp_set_num_threads (int) __GOMP_NOTHROW;
+extern int omp_get_num_threads (void) __GOMP_NOTHROW;
+extern int omp_get_max_threads (void) __GOMP_NOTHROW;
+extern int omp_get_thread_num (void) __GOMP_NOTHROW;
+extern int omp_get_num_procs (void) __GOMP_NOTHROW;
+
+extern int omp_in_parallel (void) __GOMP_NOTHROW;
+
+extern void omp_set_dynamic (int) __GOMP_NOTHROW;
+extern int omp_get_dynamic (void) __GOMP_NOTHROW;
+
+extern void omp_set_nested (int) __GOMP_NOTHROW;
+extern int omp_get_nested (void) __GOMP_NOTHROW;
+
+extern void omp_init_lock (omp_lock_t *) __GOMP_NOTHROW;
+extern void omp_destroy_lock (omp_lock_t *) __GOMP_NOTHROW;
+extern void omp_set_lock (omp_lock_t *) __GOMP_NOTHROW;
+extern void omp_unset_lock (omp_lock_t *) __GOMP_NOTHROW;
+extern int omp_test_lock (omp_lock_t *) __GOMP_NOTHROW;
+
+extern void omp_init_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
+extern void omp_destroy_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
+extern void omp_set_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
+extern void omp_unset_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
+extern int omp_test_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
+
+extern double omp_get_wtime (void) __GOMP_NOTHROW;
+extern double omp_get_wtick (void) __GOMP_NOTHROW;
+
+void omp_set_schedule (omp_sched_t, int) __GOMP_NOTHROW;
+void omp_get_schedule (omp_sched_t *, int *) __GOMP_NOTHROW;
+int omp_get_thread_limit (void) __GOMP_NOTHROW;
+void omp_set_max_active_levels (int) __GOMP_NOTHROW;
+int omp_get_max_active_levels (void) __GOMP_NOTHROW;
+int omp_get_level (void) __GOMP_NOTHROW;
+int omp_get_ancestor_thread_num (int) __GOMP_NOTHROW;
+int omp_get_team_size (int) __GOMP_NOTHROW;
+int omp_get_active_level (void) __GOMP_NOTHROW;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OMP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/stdarg.h b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/stdarg.h
new file mode 100644
index 0000000..54dc2e7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/stdarg.h
@@ -0,0 +1,130 @@
+/* Copyright (C) 1989, 1997, 1998, 1999, 2000, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+/*
+ * ISO C Standard: 7.15 Variable arguments <stdarg.h>
+ */
+
+#ifndef _STDARG_H
+#ifndef _ANSI_STDARG_H_
+#ifndef __need___va_list
+#define _STDARG_H
+#define _ANSI_STDARG_H_
+#endif /* not __need___va_list */
+#undef __need___va_list
+
+/* Define __gnuc_va_list. */
+
+#ifndef __GNUC_VA_LIST
+#define __GNUC_VA_LIST
+typedef __builtin_va_list __gnuc_va_list;
+#endif
+
+/* Define the standard macros for the user,
+ if this invocation was from the user program. */
+#ifdef _STDARG_H
+
+#define va_start(v,l) __builtin_va_start(v,l)
+#define va_end(v) __builtin_va_end(v)
+#define va_arg(v,l) __builtin_va_arg(v,l)
+#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L || defined(__GXX_EXPERIMENTAL_CXX0X__)
+#define va_copy(d,s) __builtin_va_copy(d,s)
+#endif
+#define __va_copy(d,s) __builtin_va_copy(d,s)
+
+/* Define va_list, if desired, from __gnuc_va_list. */
+/* We deliberately do not define va_list when called from
+ stdio.h, because ANSI C says that stdio.h is not supposed to define
+ va_list. stdio.h needs to have access to that data type,
+ but must not use that name. It should use the name __gnuc_va_list,
+ which is safe because it is reserved for the implementation. */
+
+#ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
+#undef _VA_LIST
+#endif
+
+#ifdef _BSD_VA_LIST
+#undef _BSD_VA_LIST
+#endif
+
+#if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST))
+/* SVR4.2 uses _VA_LIST for an internal alias for va_list,
+ so we must avoid testing it and setting it here.
+ SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
+ have no conflict with that. */
+#ifndef _VA_LIST_
+#define _VA_LIST_
+#ifdef __i860__
+#ifndef _VA_LIST
+#define _VA_LIST va_list
+#endif
+#endif /* __i860__ */
+typedef __gnuc_va_list va_list;
+#ifdef _SCO_DS
+#define __VA_LIST
+#endif
+#endif /* _VA_LIST_ */
+#else /* not __svr4__ || _SCO_DS */
+
+/* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
+ But on BSD NET2 we must not test or define or undef it.
+ (Note that the comments in NET 2's ansi.h
+ are incorrect for _VA_LIST_--see stdio.h!) */
+#if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT)
+/* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */
+#ifndef _VA_LIST_DEFINED
+/* The macro _VA_LIST is used in SCO Unix 3.2. */
+#ifndef _VA_LIST
+/* The macro _VA_LIST_T_H is used in the Bull dpx2 */
+#ifndef _VA_LIST_T_H
+/* The macro __va_list__ is used by BeOS. */
+#ifndef __va_list__
+typedef __gnuc_va_list va_list;
+#endif /* not __va_list__ */
+#endif /* not _VA_LIST_T_H */
+#endif /* not _VA_LIST */
+#endif /* not _VA_LIST_DEFINED */
+#if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__))
+#define _VA_LIST_
+#endif
+#ifndef _VA_LIST
+#define _VA_LIST
+#endif
+#ifndef _VA_LIST_DEFINED
+#define _VA_LIST_DEFINED
+#endif
+#ifndef _VA_LIST_T_H
+#define _VA_LIST_T_H
+#endif
+#ifndef __va_list__
+#define __va_list__
+#endif
+
+#endif /* not _VA_LIST_, except on certain systems */
+
+#endif /* not __svr4__ */
+
+#endif /* _STDARG_H */
+
+#endif /* not _ANSI_STDARG_H_ */
+#endif /* not _STDARG_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/stdbool.h b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/stdbool.h
new file mode 100644
index 0000000..4ed911f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/stdbool.h
@@ -0,0 +1,50 @@
+/* Copyright (C) 1998, 1999, 2000, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+/*
+ * ISO C Standard: 7.16 Boolean type and values <stdbool.h>
+ */
+
+#ifndef _STDBOOL_H
+#define _STDBOOL_H
+
+#ifndef __cplusplus
+
+#define bool _Bool
+#define true 1
+#define false 0
+
+#else /* __cplusplus */
+
+/* Supporting <stdbool.h> in C++ is a GCC extension. */
+#define _Bool bool
+#define bool bool
+#define false false
+#define true true
+
+#endif /* __cplusplus */
+
+/* Signal that all the definitions are present. */
+#define __bool_true_false_are_defined 1
+
+#endif /* stdbool.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/stddef.h b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/stddef.h
new file mode 100644
index 0000000..89e5b2e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/stddef.h
@@ -0,0 +1,416 @@
+/* Copyright (C) 1989, 1997, 1998, 1999, 2000, 2002, 2004, 2009
+ Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+/*
+ * ISO C Standard: 7.17 Common definitions <stddef.h>
+ */
+#if (!defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \
+ && !defined(__STDDEF_H__)) \
+ || defined(__need_wchar_t) || defined(__need_size_t) \
+ || defined(__need_ptrdiff_t) || defined(__need_NULL) \
+ || defined(__need_wint_t)
+
+/* Any one of these symbols __need_* means that GNU libc
+ wants us just to define one data type. So don't define
+ the symbols that indicate this file's entire job has been done. */
+#if (!defined(__need_wchar_t) && !defined(__need_size_t) \
+ && !defined(__need_ptrdiff_t) && !defined(__need_NULL) \
+ && !defined(__need_wint_t))
+#define _STDDEF_H
+#define _STDDEF_H_
+/* snaroff@next.com says the NeXT needs this. */
+#define _ANSI_STDDEF_H
+/* Irix 5.1 needs this. */
+#define __STDDEF_H__
+#endif
+
+#ifndef __sys_stdtypes_h
+/* This avoids lossage on SunOS but only if stdtypes.h comes first.
+ There's no way to win with the other order! Sun lossage. */
+
+/* On 4.3bsd-net2, make sure ansi.h is included, so we have
+ one less case to deal with in the following. */
+#if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__)
+#include <machine/ansi.h>
+#endif
+/* On FreeBSD 5, machine/ansi.h does not exist anymore... */
+#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
+#include <sys/_types.h>
+#endif
+
+/* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
+ defined if the corresponding type is *not* defined.
+ FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_ */
+#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_)
+#if !defined(_SIZE_T_) && !defined(_BSD_SIZE_T_)
+#define _SIZE_T
+#endif
+#if !defined(_PTRDIFF_T_) && !defined(_BSD_PTRDIFF_T_)
+#define _PTRDIFF_T
+#endif
+/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
+ instead of _WCHAR_T_. */
+#if !defined(_WCHAR_T_) && !defined(_BSD_WCHAR_T_)
+#ifndef _BSD_WCHAR_T_
+#define _WCHAR_T
+#endif
+#endif
+/* Undef _FOO_T_ if we are supposed to define foo_t. */
+#if defined (__need_ptrdiff_t) || defined (_STDDEF_H_)
+#undef _PTRDIFF_T_
+#undef _BSD_PTRDIFF_T_
+#endif
+#if defined (__need_size_t) || defined (_STDDEF_H_)
+#undef _SIZE_T_
+#undef _BSD_SIZE_T_
+#endif
+#if defined (__need_wchar_t) || defined (_STDDEF_H_)
+#undef _WCHAR_T_
+#undef _BSD_WCHAR_T_
+#endif
+#endif /* defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) */
+
+/* Sequent's header files use _PTRDIFF_T_ in some conflicting way.
+ Just ignore it. */
+#if defined (__sequent__) && defined (_PTRDIFF_T_)
+#undef _PTRDIFF_T_
+#endif
+
+/* On VxWorks, <type/vxTypesBase.h> may have defined macros like
+ _TYPE_size_t which will typedef size_t. fixincludes patched the
+ vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
+ not defined, and so that defining this macro defines _GCC_SIZE_T.
+ If we find that the macros are still defined at this point, we must
+ invoke them so that the type is defined as expected. */
+#if defined (_TYPE_ptrdiff_t) && (defined (__need_ptrdiff_t) || defined (_STDDEF_H_))
+_TYPE_ptrdiff_t;
+#undef _TYPE_ptrdiff_t
+#endif
+#if defined (_TYPE_size_t) && (defined (__need_size_t) || defined (_STDDEF_H_))
+_TYPE_size_t;
+#undef _TYPE_size_t
+#endif
+#if defined (_TYPE_wchar_t) && (defined (__need_wchar_t) || defined (_STDDEF_H_))
+_TYPE_wchar_t;
+#undef _TYPE_wchar_t
+#endif
+
+/* In case nobody has defined these types, but we aren't running under
+ GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
+ __WCHAR_TYPE__ have reasonable values. This can happen if the
+ parts of GCC is compiled by an older compiler, that actually
+ include gstddef.h, such as collect2. */
+
+/* Signed type of difference of two pointers. */
+
+/* Define this type if we are doing the whole job,
+ or if we want this type in particular. */
+#if defined (_STDDEF_H) || defined (__need_ptrdiff_t)
+#ifndef _PTRDIFF_T /* in case <sys/types.h> has defined it. */
+#ifndef _T_PTRDIFF_
+#ifndef _T_PTRDIFF
+#ifndef __PTRDIFF_T
+#ifndef _PTRDIFF_T_
+#ifndef _BSD_PTRDIFF_T_
+#ifndef ___int_ptrdiff_t_h
+#ifndef _GCC_PTRDIFF_T
+#define _PTRDIFF_T
+#define _T_PTRDIFF_
+#define _T_PTRDIFF
+#define __PTRDIFF_T
+#define _PTRDIFF_T_
+#define _BSD_PTRDIFF_T_
+#define ___int_ptrdiff_t_h
+#define _GCC_PTRDIFF_T
+#ifndef __PTRDIFF_TYPE__
+#define __PTRDIFF_TYPE__ long int
+#endif
+typedef __PTRDIFF_TYPE__ ptrdiff_t;
+#endif /* _GCC_PTRDIFF_T */
+#endif /* ___int_ptrdiff_t_h */
+#endif /* _BSD_PTRDIFF_T_ */
+#endif /* _PTRDIFF_T_ */
+#endif /* __PTRDIFF_T */
+#endif /* _T_PTRDIFF */
+#endif /* _T_PTRDIFF_ */
+#endif /* _PTRDIFF_T */
+
+/* If this symbol has done its job, get rid of it. */
+#undef __need_ptrdiff_t
+
+#endif /* _STDDEF_H or __need_ptrdiff_t. */
+
+/* Unsigned type of `sizeof' something. */
+
+/* Define this type if we are doing the whole job,
+ or if we want this type in particular. */
+#if defined (_STDDEF_H) || defined (__need_size_t)
+#ifndef __size_t__ /* BeOS */
+#ifndef __SIZE_T__ /* Cray Unicos/Mk */
+#ifndef _SIZE_T /* in case <sys/types.h> has defined it. */
+#ifndef _SYS_SIZE_T_H
+#ifndef _T_SIZE_
+#ifndef _T_SIZE
+#ifndef __SIZE_T
+#ifndef _SIZE_T_
+#ifndef _BSD_SIZE_T_
+#ifndef _SIZE_T_DEFINED_
+#ifndef _SIZE_T_DEFINED
+#ifndef _BSD_SIZE_T_DEFINED_ /* Darwin */
+#ifndef _SIZE_T_DECLARED /* FreeBSD 5 */
+#ifndef ___int_size_t_h
+#ifndef _GCC_SIZE_T
+#ifndef _SIZET_
+#ifndef __size_t
+#define __size_t__ /* BeOS */
+#define __SIZE_T__ /* Cray Unicos/Mk */
+#define _SIZE_T
+#define _SYS_SIZE_T_H
+#define _T_SIZE_
+#define _T_SIZE
+#define __SIZE_T
+#define _SIZE_T_
+#define _BSD_SIZE_T_
+#define _SIZE_T_DEFINED_
+#define _SIZE_T_DEFINED
+#define _BSD_SIZE_T_DEFINED_ /* Darwin */
+#define _SIZE_T_DECLARED /* FreeBSD 5 */
+#define ___int_size_t_h
+#define _GCC_SIZE_T
+#define _SIZET_
+#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
+/* __size_t is a typedef on FreeBSD 5!, must not trash it. */
+#else
+#define __size_t
+#endif
+#ifndef __SIZE_TYPE__
+#define __SIZE_TYPE__ long unsigned int
+#endif
+#if !(defined (__GNUG__) && defined (size_t))
+typedef __SIZE_TYPE__ size_t;
+#ifdef __BEOS__
+typedef long ssize_t;
+#endif /* __BEOS__ */
+#endif /* !(defined (__GNUG__) && defined (size_t)) */
+#endif /* __size_t */
+#endif /* _SIZET_ */
+#endif /* _GCC_SIZE_T */
+#endif /* ___int_size_t_h */
+#endif /* _SIZE_T_DECLARED */
+#endif /* _BSD_SIZE_T_DEFINED_ */
+#endif /* _SIZE_T_DEFINED */
+#endif /* _SIZE_T_DEFINED_ */
+#endif /* _BSD_SIZE_T_ */
+#endif /* _SIZE_T_ */
+#endif /* __SIZE_T */
+#endif /* _T_SIZE */
+#endif /* _T_SIZE_ */
+#endif /* _SYS_SIZE_T_H */
+#endif /* _SIZE_T */
+#endif /* __SIZE_T__ */
+#endif /* __size_t__ */
+#undef __need_size_t
+#endif /* _STDDEF_H or __need_size_t. */
+
+
+/* Wide character type.
+ Locale-writers should change this as necessary to
+ be big enough to hold unique values not between 0 and 127,
+ and not (wchar_t) -1, for each defined multibyte character. */
+
+/* Define this type if we are doing the whole job,
+ or if we want this type in particular. */
+#if defined (_STDDEF_H) || defined (__need_wchar_t)
+#ifndef __wchar_t__ /* BeOS */
+#ifndef __WCHAR_T__ /* Cray Unicos/Mk */
+#ifndef _WCHAR_T
+#ifndef _T_WCHAR_
+#ifndef _T_WCHAR
+#ifndef __WCHAR_T
+#ifndef _WCHAR_T_
+#ifndef _BSD_WCHAR_T_
+#ifndef _BSD_WCHAR_T_DEFINED_ /* Darwin */
+#ifndef _BSD_RUNE_T_DEFINED_ /* Darwin */
+#ifndef _WCHAR_T_DECLARED /* FreeBSD 5 */
+#ifndef _WCHAR_T_DEFINED_
+#ifndef _WCHAR_T_DEFINED
+#ifndef _WCHAR_T_H
+#ifndef ___int_wchar_t_h
+#ifndef __INT_WCHAR_T_H
+#ifndef _GCC_WCHAR_T
+#define __wchar_t__ /* BeOS */
+#define __WCHAR_T__ /* Cray Unicos/Mk */
+#define _WCHAR_T
+#define _T_WCHAR_
+#define _T_WCHAR
+#define __WCHAR_T
+#define _WCHAR_T_
+#define _BSD_WCHAR_T_
+#define _WCHAR_T_DEFINED_
+#define _WCHAR_T_DEFINED
+#define _WCHAR_T_H
+#define ___int_wchar_t_h
+#define __INT_WCHAR_T_H
+#define _GCC_WCHAR_T
+#define _WCHAR_T_DECLARED
+
+/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
+ instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other
+ symbols in the _FOO_T_ family, stays defined even after its
+ corresponding type is defined). If we define wchar_t, then we
+ must undef _WCHAR_T_; for BSD/386 1.1 (and perhaps others), if
+ we undef _WCHAR_T_, then we must also define rune_t, since
+ headers like runetype.h assume that if machine/ansi.h is included,
+ and _BSD_WCHAR_T_ is not defined, then rune_t is available.
+ machine/ansi.h says, "Note that _WCHAR_T_ and _RUNE_T_ must be of
+ the same type." */
+#ifdef _BSD_WCHAR_T_
+#undef _BSD_WCHAR_T_
+#ifdef _BSD_RUNE_T_
+#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
+typedef _BSD_RUNE_T_ rune_t;
+#define _BSD_WCHAR_T_DEFINED_
+#define _BSD_RUNE_T_DEFINED_ /* Darwin */
+#if defined (__FreeBSD__) && (__FreeBSD__ < 5)
+/* Why is this file so hard to maintain properly? In contrast to
+ the comment above regarding BSD/386 1.1, on FreeBSD for as long
+ as the symbol has existed, _BSD_RUNE_T_ must not stay defined or
+ redundant typedefs will occur when stdlib.h is included after this file. */
+#undef _BSD_RUNE_T_
+#endif
+#endif
+#endif
+#endif
+/* FreeBSD 5 can't be handled well using "traditional" logic above
+ since it no longer defines _BSD_RUNE_T_ yet still desires to export
+ rune_t in some cases... */
+#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
+#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
+#if __BSD_VISIBLE
+#ifndef _RUNE_T_DECLARED
+typedef __rune_t rune_t;
+#define _RUNE_T_DECLARED
+#endif
+#endif
+#endif
+#endif
+
+#ifndef __WCHAR_TYPE__
+#define __WCHAR_TYPE__ int
+#endif
+#ifndef __cplusplus
+typedef __WCHAR_TYPE__ wchar_t;
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif /* _WCHAR_T_DECLARED */
+#endif /* _BSD_RUNE_T_DEFINED_ */
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif /* __WCHAR_T__ */
+#endif /* __wchar_t__ */
+#undef __need_wchar_t
+#endif /* _STDDEF_H or __need_wchar_t. */
+
+#if defined (__need_wint_t)
+#ifndef _WINT_T
+#define _WINT_T
+
+#ifndef __WINT_TYPE__
+#define __WINT_TYPE__ unsigned int
+#endif
+typedef __WINT_TYPE__ wint_t;
+#endif
+#undef __need_wint_t
+#endif
+
+/* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
+ are already defined. */
+/* BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. */
+#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_)
+/* The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_
+ are probably typos and should be removed before 2.8 is released. */
+#ifdef _GCC_PTRDIFF_T_
+#undef _PTRDIFF_T_
+#undef _BSD_PTRDIFF_T_
+#endif
+#ifdef _GCC_SIZE_T_
+#undef _SIZE_T_
+#undef _BSD_SIZE_T_
+#endif
+#ifdef _GCC_WCHAR_T_
+#undef _WCHAR_T_
+#undef _BSD_WCHAR_T_
+#endif
+/* The following ones are the real ones. */
+#ifdef _GCC_PTRDIFF_T
+#undef _PTRDIFF_T_
+#undef _BSD_PTRDIFF_T_
+#endif
+#ifdef _GCC_SIZE_T
+#undef _SIZE_T_
+#undef _BSD_SIZE_T_
+#endif
+#ifdef _GCC_WCHAR_T
+#undef _WCHAR_T_
+#undef _BSD_WCHAR_T_
+#endif
+#endif /* _ANSI_H_ || _MACHINE_ANSI_H_ */
+
+#endif /* __sys_stdtypes_h */
+
+/* A null pointer constant. */
+
+#if defined (_STDDEF_H) || defined (__need_NULL)
+#undef NULL /* in case <stdio.h> has defined it. */
+#ifdef __GNUG__
+#define NULL __null
+#else /* G++ */
+#ifndef __cplusplus
+#define NULL ((void *)0)
+#else /* C++ */
+#define NULL 0
+#endif /* C++ */
+#endif /* G++ */
+#endif /* NULL not defined and <stddef.h> or need NULL. */
+#undef __need_NULL
+
+#ifdef _STDDEF_H
+
+/* Offset of member MEMBER in a struct of type TYPE. */
+#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
+
+#endif /* _STDDEF_H was defined this time */
+
+#endif /* !_STDDEF_H && !_STDDEF_H_ && !_ANSI_STDDEF_H && !__STDDEF_H__
+ || __need_XXX was not defined before */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/stdfix.h b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/stdfix.h
new file mode 100644
index 0000000..3c3ec00
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/stdfix.h
@@ -0,0 +1,204 @@
+/* Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+/* ISO/IEC JTC1 SC22 WG14 N1169
+ * Date: 2006-04-04
+ * ISO/IEC TR 18037
+ * Programming languages - C - Extensions to support embedded processors
+ */
+
+#ifndef _STDFIX_H
+#define _STDFIX_H
+
+/* 7.18a.1 Introduction. */
+
+#undef fract
+#undef accum
+#undef sat
+#define fract _Fract
+#define accum _Accum
+#define sat _Sat
+
+/* 7.18a.3 Precision macros. */
+
+#undef SFRACT_FBIT
+#undef SFRACT_MIN
+#undef SFRACT_MAX
+#undef SFRACT_EPSILON
+#define SFRACT_FBIT __SFRACT_FBIT__
+#define SFRACT_MIN __SFRACT_MIN__
+#define SFRACT_MAX __SFRACT_MAX__
+#define SFRACT_EPSILON __SFRACT_EPSILON__
+
+#undef USFRACT_FBIT
+#undef USFRACT_MIN
+#undef USFRACT_MAX
+#undef USFRACT_EPSILON
+#define USFRACT_FBIT __USFRACT_FBIT__
+#define USFRACT_MIN __USFRACT_MIN__ /* GCC extension. */
+#define USFRACT_MAX __USFRACT_MAX__
+#define USFRACT_EPSILON __USFRACT_EPSILON__
+
+#undef FRACT_FBIT
+#undef FRACT_MIN
+#undef FRACT_MAX
+#undef FRACT_EPSILON
+#define FRACT_FBIT __FRACT_FBIT__
+#define FRACT_MIN __FRACT_MIN__
+#define FRACT_MAX __FRACT_MAX__
+#define FRACT_EPSILON __FRACT_EPSILON__
+
+#undef UFRACT_FBIT
+#undef UFRACT_MIN
+#undef UFRACT_MAX
+#undef UFRACT_EPSILON
+#define UFRACT_FBIT __UFRACT_FBIT__
+#define UFRACT_MIN __UFRACT_MIN__ /* GCC extension. */
+#define UFRACT_MAX __UFRACT_MAX__
+#define UFRACT_EPSILON __UFRACT_EPSILON__
+
+#undef LFRACT_FBIT
+#undef LFRACT_MIN
+#undef LFRACT_MAX
+#undef LFRACT_EPSILON
+#define LFRACT_FBIT __LFRACT_FBIT__
+#define LFRACT_MIN __LFRACT_MIN__
+#define LFRACT_MAX __LFRACT_MAX__
+#define LFRACT_EPSILON __LFRACT_EPSILON__
+
+#undef ULFRACT_FBIT
+#undef ULFRACT_MIN
+#undef ULFRACT_MAX
+#undef ULFRACT_EPSILON
+#define ULFRACT_FBIT __ULFRACT_FBIT__
+#define ULFRACT_MIN __ULFRACT_MIN__ /* GCC extension. */
+#define ULFRACT_MAX __ULFRACT_MAX__
+#define ULFRACT_EPSILON __ULFRACT_EPSILON__
+
+#undef LLFRACT_FBIT
+#undef LLFRACT_MIN
+#undef LLFRACT_MAX
+#undef LLFRACT_EPSILON
+#define LLFRACT_FBIT __LLFRACT_FBIT__ /* GCC extension. */
+#define LLFRACT_MIN __LLFRACT_MIN__ /* GCC extension. */
+#define LLFRACT_MAX __LLFRACT_MAX__ /* GCC extension. */
+#define LLFRACT_EPSILON __LLFRACT_EPSILON__ /* GCC extension. */
+
+#undef ULLFRACT_FBIT
+#undef ULLFRACT_MIN
+#undef ULLFRACT_MAX
+#undef ULLFRACT_EPSILON
+#define ULLFRACT_FBIT __ULLFRACT_FBIT__ /* GCC extension. */
+#define ULLFRACT_MIN __ULLFRACT_MIN__ /* GCC extension. */
+#define ULLFRACT_MAX __ULLFRACT_MAX__ /* GCC extension. */
+#define ULLFRACT_EPSILON __ULLFRACT_EPSILON__ /* GCC extension. */
+
+#undef SACCUM_FBIT
+#undef SACCUM_IBIT
+#undef SACCUM_MIN
+#undef SACCUM_MAX
+#undef SACCUM_EPSILON
+#define SACCUM_FBIT __SACCUM_FBIT__
+#define SACCUM_IBIT __SACCUM_IBIT__
+#define SACCUM_MIN __SACCUM_MIN__
+#define SACCUM_MAX __SACCUM_MAX__
+#define SACCUM_EPSILON __SACCUM_EPSILON__
+
+#undef USACCUM_FBIT
+#undef USACCUM_IBIT
+#undef USACCUM_MIN
+#undef USACCUM_MAX
+#undef USACCUM_EPSILON
+#define USACCUM_FBIT __USACCUM_FBIT__
+#define USACCUM_IBIT __USACCUM_IBIT__
+#define USACCUM_MIN __USACCUM_MIN__ /* GCC extension. */
+#define USACCUM_MAX __USACCUM_MAX__
+#define USACCUM_EPSILON __USACCUM_EPSILON__
+
+#undef ACCUM_FBIT
+#undef ACCUM_IBIT
+#undef ACCUM_MIN
+#undef ACCUM_MAX
+#undef ACCUM_EPSILON
+#define ACCUM_FBIT __ACCUM_FBIT__
+#define ACCUM_IBIT __ACCUM_IBIT__
+#define ACCUM_MIN __ACCUM_MIN__
+#define ACCUM_MAX __ACCUM_MAX__
+#define ACCUM_EPSILON __ACCUM_EPSILON__
+
+#undef UACCUM_FBIT
+#undef UACCUM_IBIT
+#undef UACCUM_MIN
+#undef UACCUM_MAX
+#undef UACCUM_EPSILON
+#define UACCUM_FBIT __UACCUM_FBIT__
+#define UACCUM_IBIT __UACCUM_IBIT__
+#define UACCUM_MIN __UACCUM_MIN__ /* GCC extension. */
+#define UACCUM_MAX __UACCUM_MAX__
+#define UACCUM_EPSILON __UACCUM_EPSILON__
+
+#undef LACCUM_FBIT
+#undef LACCUM_IBIT
+#undef LACCUM_MIN
+#undef LACCUM_MAX
+#undef LACCUM_EPSILON
+#define LACCUM_FBIT __LACCUM_FBIT__
+#define LACCUM_IBIT __LACCUM_IBIT__
+#define LACCUM_MIN __LACCUM_MIN__
+#define LACCUM_MAX __LACCUM_MAX__
+#define LACCUM_EPSILON __LACCUM_EPSILON__
+
+#undef ULACCUM_FBIT
+#undef ULACCUM_IBIT
+#undef ULACCUM_MIN
+#undef ULACCUM_MAX
+#undef ULACCUM_EPSILON
+#define ULACCUM_FBIT __ULACCUM_FBIT__
+#define ULACCUM_IBIT __ULACCUM_IBIT__
+#define ULACCUM_MIN __ULACCUM_MIN__ /* GCC extension. */
+#define ULACCUM_MAX __ULACCUM_MAX__
+#define ULACCUM_EPSILON __ULACCUM_EPSILON__
+
+#undef LLACCUM_FBIT
+#undef LLACCUM_IBIT
+#undef LLACCUM_MIN
+#undef LLACCUM_MAX
+#undef LLACCUM_EPSILON
+#define LLACCUM_FBIT __LLACCUM_FBIT__ /* GCC extension. */
+#define LLACCUM_IBIT __LLACCUM_IBIT__ /* GCC extension. */
+#define LLACCUM_MIN __LLACCUM_MIN__ /* GCC extension. */
+#define LLACCUM_MAX __LLACCUM_MAX__ /* GCC extension. */
+#define LLACCUM_EPSILON __LLACCUM_EPSILON__ /* GCC extension. */
+
+#undef ULLACCUM_FBIT
+#undef ULLACCUM_IBIT
+#undef ULLACCUM_MIN
+#undef ULLACCUM_MAX
+#undef ULLACCUM_EPSILON
+#define ULLACCUM_FBIT __ULLACCUM_FBIT__ /* GCC extension. */
+#define ULLACCUM_IBIT __ULLACCUM_IBIT__ /* GCC extension. */
+#define ULLACCUM_MIN __ULLACCUM_MIN__ /* GCC extension. */
+#define ULLACCUM_MAX __ULLACCUM_MAX__ /* GCC extension. */
+#define ULLACCUM_EPSILON __ULLACCUM_EPSILON__ /* GCC extension. */
+
+#endif /* _STDFIX_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/unwind.h b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/unwind.h
new file mode 100644
index 0000000..4ff9017
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/unwind.h
@@ -0,0 +1,276 @@
+/* Exception handling and frame unwind runtime interface routines.
+ Copyright (C) 2001, 2003, 2004, 2006, 2008, 2009 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This is derived from the C++ ABI for IA-64. Where we diverge
+ for cross-architecture compatibility are noted with "@@@". */
+
+#ifndef _UNWIND_H
+#define _UNWIND_H
+
+#ifndef HIDE_EXPORTS
+#pragma GCC visibility push(default)
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Level 1: Base ABI */
+
+/* @@@ The IA-64 ABI uses uint64 throughout. Most places this is
+ inefficient for 32-bit and smaller machines. */
+typedef unsigned _Unwind_Word __attribute__((__mode__(__unwind_word__)));
+typedef signed _Unwind_Sword __attribute__((__mode__(__unwind_word__)));
+#if defined(__ia64__) && defined(__hpux__)
+typedef unsigned _Unwind_Ptr __attribute__((__mode__(__word__)));
+#else
+typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__)));
+#endif
+typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__)));
+
+/* @@@ The IA-64 ABI uses a 64-bit word to identify the producer and
+ consumer of an exception. We'll go along with this for now even on
+ 32-bit machines. We'll need to provide some other option for
+ 16-bit machines and for machines with > 8 bits per byte. */
+typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__)));
+
+/* The unwind interface uses reason codes in several contexts to
+ identify the reasons for failures or other actions. */
+typedef enum
+{
+ _URC_NO_REASON = 0,
+ _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
+ _URC_FATAL_PHASE2_ERROR = 2,
+ _URC_FATAL_PHASE1_ERROR = 3,
+ _URC_NORMAL_STOP = 4,
+ _URC_END_OF_STACK = 5,
+ _URC_HANDLER_FOUND = 6,
+ _URC_INSTALL_CONTEXT = 7,
+ _URC_CONTINUE_UNWIND = 8
+} _Unwind_Reason_Code;
+
+
+/* The unwind interface uses a pointer to an exception header object
+ as its representation of an exception being thrown. In general, the
+ full representation of an exception object is language- and
+ implementation-specific, but it will be prefixed by a header
+ understood by the unwind interface. */
+
+struct _Unwind_Exception;
+
+typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
+ struct _Unwind_Exception *);
+
+struct _Unwind_Exception
+{
+ _Unwind_Exception_Class exception_class;
+ _Unwind_Exception_Cleanup_Fn exception_cleanup;
+ _Unwind_Word private_1;
+ _Unwind_Word private_2;
+
+ /* @@@ The IA-64 ABI says that this structure must be double-word aligned.
+ Taking that literally does not make much sense generically. Instead we
+ provide the maximum alignment required by any type for the machine. */
+} __attribute__((__aligned__));
+
+
+/* The ACTIONS argument to the personality routine is a bitwise OR of one
+ or more of the following constants. */
+typedef int _Unwind_Action;
+
+#define _UA_SEARCH_PHASE 1
+#define _UA_CLEANUP_PHASE 2
+#define _UA_HANDLER_FRAME 4
+#define _UA_FORCE_UNWIND 8
+#define _UA_END_OF_STACK 16
+
+/* The target can override this macro to define any back-end-specific
+ attributes required for the lowest-level stack frame. */
+#ifndef LIBGCC2_UNWIND_ATTRIBUTE
+#define LIBGCC2_UNWIND_ATTRIBUTE
+#endif
+
+/* This is an opaque type used to refer to a system-specific data
+ structure used by the system unwinder. This context is created and
+ destroyed by the system, and passed to the personality routine
+ during unwinding. */
+struct _Unwind_Context;
+
+/* Raise an exception, passing along the given exception object. */
+extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_RaiseException (struct _Unwind_Exception *);
+
+/* Raise an exception for forced unwinding. */
+
+typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
+ (int, _Unwind_Action, _Unwind_Exception_Class,
+ struct _Unwind_Exception *, struct _Unwind_Context *, void *);
+
+extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_ForcedUnwind (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
+
+/* Helper to invoke the exception_cleanup routine. */
+extern void _Unwind_DeleteException (struct _Unwind_Exception *);
+
+/* Resume propagation of an existing exception. This is used after
+ e.g. executing cleanup code, and not to implement rethrowing. */
+extern void LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_Resume (struct _Unwind_Exception *);
+
+/* @@@ Resume propagation of a FORCE_UNWIND exception, or to rethrow
+ a normal exception that was handled. */
+extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *);
+
+/* @@@ Use unwind data to perform a stack backtrace. The trace callback
+ is called for every stack frame in the call chain, but no cleanup
+ actions are performed. */
+typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)
+ (struct _Unwind_Context *, void *);
+
+extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_Backtrace (_Unwind_Trace_Fn, void *);
+
+/* These functions are used for communicating information about the unwind
+ context (i.e. the unwind descriptors and the user register state) between
+ the unwind library and the personality routine and landing pad. Only
+ selected registers may be manipulated. */
+
+extern _Unwind_Word _Unwind_GetGR (struct _Unwind_Context *, int);
+extern void _Unwind_SetGR (struct _Unwind_Context *, int, _Unwind_Word);
+
+extern _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *);
+extern _Unwind_Ptr _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
+extern void _Unwind_SetIP (struct _Unwind_Context *, _Unwind_Ptr);
+
+/* @@@ Retrieve the CFA of the given context. */
+extern _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *);
+
+extern void *_Unwind_GetLanguageSpecificData (struct _Unwind_Context *);
+
+extern _Unwind_Ptr _Unwind_GetRegionStart (struct _Unwind_Context *);
+
+
+/* The personality routine is the function in the C++ (or other language)
+ runtime library which serves as an interface between the system unwind
+ library and language-specific exception handling semantics. It is
+ specific to the code fragment described by an unwind info block, and
+ it is always referenced via the pointer in the unwind info block, and
+ hence it has no ABI-specified name.
+
+ Note that this implies that two different C++ implementations can
+ use different names, and have different contents in the language
+ specific data area. Moreover, that the language specific data
+ area contains no version info because name of the function invoked
+ provides more effective versioning by detecting at link time the
+ lack of code to handle the different data format. */
+
+typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn)
+ (int, _Unwind_Action, _Unwind_Exception_Class,
+ struct _Unwind_Exception *, struct _Unwind_Context *);
+
+/* @@@ The following alternate entry points are for setjmp/longjmp
+ based unwinding. */
+
+struct SjLj_Function_Context;
+extern void _Unwind_SjLj_Register (struct SjLj_Function_Context *);
+extern void _Unwind_SjLj_Unregister (struct SjLj_Function_Context *);
+
+extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_SjLj_RaiseException (struct _Unwind_Exception *);
+extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_SjLj_ForcedUnwind (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
+extern void LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_SjLj_Resume (struct _Unwind_Exception *);
+extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_SjLj_Resume_or_Rethrow (struct _Unwind_Exception *);
+
+/* @@@ The following provide access to the base addresses for text
+ and data-relative addressing in the LDSA. In order to stay link
+ compatible with the standard ABI for IA-64, we inline these. */
+
+#ifdef __ia64__
+#include <stdlib.h>
+
+static inline _Unwind_Ptr
+_Unwind_GetDataRelBase (struct _Unwind_Context *_C)
+{
+ /* The GP is stored in R1. */
+ return _Unwind_GetGR (_C, 1);
+}
+
+static inline _Unwind_Ptr
+_Unwind_GetTextRelBase (struct _Unwind_Context *_C __attribute__ ((__unused__)))
+{
+ abort ();
+ return 0;
+}
+
+/* @@@ Retrieve the Backing Store Pointer of the given context. */
+extern _Unwind_Word _Unwind_GetBSP (struct _Unwind_Context *);
+#else
+extern _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *);
+extern _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *);
+#endif
+
+/* @@@ Given an address, return the entry point of the function that
+ contains it. */
+extern void * _Unwind_FindEnclosingFunction (void *pc);
+
+#ifndef __SIZEOF_LONG__
+ #error "__SIZEOF_LONG__ macro not defined"
+#endif
+
+#ifndef __SIZEOF_POINTER__
+ #error "__SIZEOF_POINTER__ macro not defined"
+#endif
+
+
+/* leb128 type numbers have a potentially unlimited size.
+ The target of the following definitions of _sleb128_t and _uleb128_t
+ is to have efficient data types large enough to hold the leb128 type
+ numbers used in the unwind code.
+ Mostly these types will simply be defined to long and unsigned long
+ except when a unsigned long data type on the target machine is not
+ capable of storing a pointer. */
+
+#if __SIZEOF_LONG__ >= __SIZEOF_POINTER__
+ typedef long _sleb128_t;
+ typedef unsigned long _uleb128_t;
+#elif __SIZEOF_LONG_LONG__ >= __SIZEOF_POINTER__
+ typedef long long _sleb128_t;
+ typedef unsigned long long _uleb128_t;
+#else
+# error "What type shall we use for _sleb128_t?"
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifndef HIDE_EXPORTS
+#pragma GCC visibility pop
+#endif
+
+#endif /* unwind.h */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/varargs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/varargs.h
new file mode 100644
index 0000000..4b9803e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/include/varargs.h
@@ -0,0 +1,7 @@
+#ifndef _VARARGS_H
+#define _VARARGS_H
+
+#error "GCC no longer implements <varargs.h>."
+#error "Revise your code to use <stdarg.h>."
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/fixinc_list b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/fixinc_list
new file mode 100644
index 0000000..092bc2b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/fixinc_list
@@ -0,0 +1 @@
+;
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/gsyslimits.h b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/gsyslimits.h
new file mode 100644
index 0000000..a362802
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/gsyslimits.h
@@ -0,0 +1,8 @@
+/* syslimits.h stands for the system's own limits.h file.
+ If we can use it ok unmodified, then we install this text.
+ If fixincludes fixes it, then the fixed version is installed
+ instead of this text. */
+
+#define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */
+#include_next <limits.h>
+#undef _GCC_NEXT_LIMITS_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/include/README b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/include/README
new file mode 100644
index 0000000..7086a77
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/include/README
@@ -0,0 +1,14 @@
+This README file is copied into the directory for GCC-only header files
+when fixincludes is run by the makefile for GCC.
+
+Many of the files in this directory were automatically edited from the
+standard system header files by the fixincludes process. They are
+system-specific, and will not work on any other kind of system. They
+are also not part of GCC. The reason we have to do this is because
+GCC requires ANSI C headers and many vendors supply ANSI-incompatible
+headers.
+
+Because this is an automated process, sometimes headers get "fixed"
+that do not, strictly speaking, need a fix. As long as nothing is broken
+by the process, it is just an unfortunate collateral inconvenience.
+We would like to rectify it, if it is not "too inconvenient".
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/include/limits.h b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/include/limits.h
new file mode 100644
index 0000000..30e08a7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/include/limits.h
@@ -0,0 +1,125 @@
+/* This administrivia gets added to the beginning of limits.h
+ if the system has its own version of limits.h. */
+
+/* We use _GCC_LIMITS_H_ because we want this not to match
+ any macros that the system's limits.h uses for its own purposes. */
+#ifndef _GCC_LIMITS_H_ /* Terminated in limity.h. */
+#define _GCC_LIMITS_H_
+
+#ifndef _LIBC_LIMITS_H_
+/* Use "..." so that we find syslimits.h only in this same directory. */
+#include "syslimits.h"
+#endif
+#ifndef _LIMITS_H___
+#define _LIMITS_H___
+
+/* Number of bits in a `char'. */
+#undef CHAR_BIT
+#define CHAR_BIT __CHAR_BIT__
+
+/* Maximum length of a multibyte character. */
+#ifndef MB_LEN_MAX
+#define MB_LEN_MAX 1
+#endif
+
+/* Minimum and maximum values a `signed char' can hold. */
+#undef SCHAR_MIN
+#define SCHAR_MIN (-SCHAR_MAX - 1)
+#undef SCHAR_MAX
+#define SCHAR_MAX __SCHAR_MAX__
+
+/* Maximum value an `unsigned char' can hold. (Minimum is 0). */
+#undef UCHAR_MAX
+#if __SCHAR_MAX__ == __INT_MAX__
+# define UCHAR_MAX (SCHAR_MAX * 2U + 1U)
+#else
+# define UCHAR_MAX (SCHAR_MAX * 2 + 1)
+#endif
+
+/* Minimum and maximum values a `char' can hold. */
+#ifdef __CHAR_UNSIGNED__
+# undef CHAR_MIN
+# if __SCHAR_MAX__ == __INT_MAX__
+# define CHAR_MIN 0U
+# else
+# define CHAR_MIN 0
+# endif
+# undef CHAR_MAX
+# define CHAR_MAX UCHAR_MAX
+#else
+# undef CHAR_MIN
+# define CHAR_MIN SCHAR_MIN
+# undef CHAR_MAX
+# define CHAR_MAX SCHAR_MAX
+#endif
+
+/* Minimum and maximum values a `signed short int' can hold. */
+#undef SHRT_MIN
+#define SHRT_MIN (-SHRT_MAX - 1)
+#undef SHRT_MAX
+#define SHRT_MAX __SHRT_MAX__
+
+/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
+#undef USHRT_MAX
+#if __SHRT_MAX__ == __INT_MAX__
+# define USHRT_MAX (SHRT_MAX * 2U + 1U)
+#else
+# define USHRT_MAX (SHRT_MAX * 2 + 1)
+#endif
+
+/* Minimum and maximum values a `signed int' can hold. */
+#undef INT_MIN
+#define INT_MIN (-INT_MAX - 1)
+#undef INT_MAX
+#define INT_MAX __INT_MAX__
+
+/* Maximum value an `unsigned int' can hold. (Minimum is 0). */
+#undef UINT_MAX
+#define UINT_MAX (INT_MAX * 2U + 1U)
+
+/* Minimum and maximum values a `signed long int' can hold.
+ (Same as `int'). */
+#undef LONG_MIN
+#define LONG_MIN (-LONG_MAX - 1L)
+#undef LONG_MAX
+#define LONG_MAX __LONG_MAX__
+
+/* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
+#undef ULONG_MAX
+#define ULONG_MAX (LONG_MAX * 2UL + 1UL)
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+/* Minimum and maximum values a `signed long long int' can hold. */
+# undef LLONG_MIN
+# define LLONG_MIN (-LLONG_MAX - 1LL)
+# undef LLONG_MAX
+# define LLONG_MAX __LONG_LONG_MAX__
+
+/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
+# undef ULLONG_MAX
+# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
+#endif
+
+#if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
+/* Minimum and maximum values a `signed long long int' can hold. */
+# undef LONG_LONG_MIN
+# define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL)
+# undef LONG_LONG_MAX
+# define LONG_LONG_MAX __LONG_LONG_MAX__
+
+/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
+# undef ULONG_LONG_MAX
+# define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1ULL)
+#endif
+
+#endif /* _LIMITS_H___ */
+/* This administrivia gets added to the end of limits.h
+ if the system has its own version of limits.h. */
+
+#else /* not _GCC_LIMITS_H_ */
+
+#ifdef _GCC_NEXT_LIMITS_H
+#include_next <limits.h> /* recurse down to the real one */
+#endif
+
+#endif /* not _GCC_LIMITS_H_ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/macro_list b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/macro_list
new file mode 100644
index 0000000..b709c2e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/macro_list
@@ -0,0 +1,7 @@
+LANGUAGE_C
+linux
+mips
+_mips
+MIPSEB
+R3000
+unix
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/mkheaders.conf b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/mkheaders.conf
new file mode 100644
index 0000000..1e3fde6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/install-tools/mkheaders.conf
@@ -0,0 +1,5 @@
+SYSTEM_HEADER_DIR="/opt/toolchains/uclibc-crosstools-gcc-4.4.2-1${sysroot_headers_suffix}/usr/include"
+OTHER_FIXINCLUDES_DIRS=""
+FIXPROTO_DEFINES=""
+STMP_FIXPROTO=""
+STMP_FIXINC="stmp-fixinc"
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/libgcc.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/libgcc.a
new file mode 100644
index 0000000..0f3b20c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/libgcc.a
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/libgcc_eh.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/libgcc_eh.a
new file mode 100644
index 0000000..58db8f1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/libgcc_eh.a
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/libgcov.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/libgcov.a
new file mode 100644
index 0000000..9d4a222
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/gcc/mips-linux-uclibc/4.4.2/libgcov.a
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.x b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.x
new file mode 100644
index 0000000..b6c1f48
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.x
@@ -0,0 +1,261 @@
+/* Default linker script, for normal executables */
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x0400000)); . = SEGMENT_START("text-segment", 0x0400000) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xbn b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xbn
new file mode 100644
index 0000000..f4a57e3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xbn
@@ -0,0 +1,259 @@
+/* Script for -N: mix text and data on same page; don't align data */
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x0400000)); . = SEGMENT_START("text-segment", 0x0400000) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = .;
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xc b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xc
new file mode 100644
index 0000000..3b879cd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xc
@@ -0,0 +1,264 @@
+/* Script for -z combreloc: combine and sort reloc sections */
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x0400000)); . = SEGMENT_START("text-segment", 0x0400000) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xd b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xd
new file mode 100644
index 0000000..03d25e5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xd
@@ -0,0 +1,261 @@
+/* Script for ld -pie: link position independent executable */
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xdc b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xdc
new file mode 100644
index 0000000..d114c59
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xdc
@@ -0,0 +1,264 @@
+/* Script for -pie -z combreloc: position independent executable, combine & sort relocs */
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xdw b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xdw
new file mode 100644
index 0000000..a577c66
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xdw
@@ -0,0 +1,264 @@
+/* Script for -pie -z combreloc -z now -z relro: position independent executable, combine & sort relocs */
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .got.plt : { *(.got.plt) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xn b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xn
new file mode 100644
index 0000000..ee21e03
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xn
@@ -0,0 +1,261 @@
+/* Script for -n: mix text and data on same page */
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x0400000)); . = SEGMENT_START("text-segment", 0x0400000) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xr b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xr
new file mode 100644
index 0000000..dd5cf0e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xr
@@ -0,0 +1,201 @@
+/* Script for ld -r: link without relocation */
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ /* For some reason, the Solaris linker makes bad executables
+ if gld -r is used and the intermediate file has sections starting
+ at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
+ bug. But for now assigning the zero vmas works. */
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ .interp 0 : { *(.interp) }
+ .reginfo 0 : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic 0 : { *(.dynamic) }
+ .hash 0 : { *(.hash) }
+ .gnu.hash 0 : { *(.gnu.hash) }
+ .dynsym 0 : { *(.dynsym) }
+ .dynstr 0 : { *(.dynstr) }
+ .gnu.version 0 : { *(.gnu.version) }
+ .gnu.version_d 0: { *(.gnu.version_d) }
+ .gnu.version_r 0: { *(.gnu.version_r) }
+ .rel.init 0 : { *(.rel.init) }
+ .rela.init 0 : { *(.rela.init) }
+ .rel.text 0 : { *(.rel.text) }
+ .rela.text 0 : { *(.rela.text) }
+ .rel.fini 0 : { *(.rel.fini) }
+ .rela.fini 0 : { *(.rela.fini) }
+ .rel.rodata 0 : { *(.rel.rodata) }
+ .rela.rodata 0 : { *(.rela.rodata) }
+ .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) }
+ .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }
+ .rel.data 0 : { *(.rel.data) }
+ .rela.data 0 : { *(.rela.data) }
+ .rel.tdata 0 : { *(.rel.tdata) }
+ .rela.tdata 0 : { *(.rela.tdata) }
+ .rel.tbss 0 : { *(.rel.tbss) }
+ .rela.tbss 0 : { *(.rela.tbss) }
+ .rel.ctors 0 : { *(.rel.ctors) }
+ .rela.ctors 0 : { *(.rela.ctors) }
+ .rel.dtors 0 : { *(.rel.dtors) }
+ .rela.dtors 0 : { *(.rela.dtors) }
+ .rel.got 0 : { *(.rel.got) }
+ .rela.got 0 : { *(.rela.got) }
+ .rel.dyn 0 : { *(.rel.dyn) }
+ .rel.sdata 0 : { *(.rel.sdata) }
+ .rela.sdata 0 : { *(.rela.sdata) }
+ .rel.sbss 0 : { *(.rel.sbss) }
+ .rela.sbss 0 : { *(.rela.sbss) }
+ .rel.sdata2 0 : { *(.rel.sdata2) }
+ .rela.sdata2 0 : { *(.rela.sdata2) }
+ .rel.sbss2 0 : { *(.rel.sbss2) }
+ .rela.sbss2 0 : { *(.rela.sbss2) }
+ .rel.bss 0 : { *(.rel.bss) }
+ .rela.bss 0 : { *(.rela.bss) }
+ .rel.iplt 0 :
+ {
+ *(.rel.iplt)
+ }
+ .rela.iplt 0 :
+ {
+ *(.rela.iplt)
+ }
+ .rel.plt 0 :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt 0 :
+ {
+ *(.rela.plt)
+ }
+ .init 0 :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt 0 : { *(.plt) }
+ .iplt 0 : { *(.iplt) }
+ .text 0 :
+ {
+ *(.text .stub)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0
+ .fini 0 :
+ {
+ KEEP (*(.fini))
+ } =0
+ .rodata 0 : { *(.rodata) }
+ .rodata1 0 : { *(.rodata1) }
+ .sdata2 0 :
+ {
+ *(.sdata2)
+ }
+ .sbss2 0 : { *(.sbss2) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ /* Exception handling */
+ .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata 0 : { *(.tdata) }
+ .tbss 0 : { *(.tbss) }
+ .preinit_array 0 :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array 0 :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array 0 :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .jcr 0 : { KEEP (*(.jcr)) }
+ .data 0 :
+ {
+ *(.data)
+ }
+ .data1 0 : { *(.data1) }
+ .got.plt 0 : { *(.got.plt) }
+ .got 0 : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata 0 :
+ {
+ *(.sdata)
+ }
+ .lit8 0 : { *(.lit8) }
+ .lit4 0 : { *(.lit4) }
+ .sbss 0 :
+ {
+ *(.dynsbss)
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss 0 :
+ {
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ }
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xs b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xs
new file mode 100644
index 0000000..8c2a972
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xs
@@ -0,0 +1,247 @@
+/* Script for ld --shared: link shared library */
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ *(.rel.iplt)
+ }
+ .rela.iplt :
+ {
+ *(.rela.iplt)
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xsc b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xsc
new file mode 100644
index 0000000..f4c2beb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xsc
@@ -0,0 +1,246 @@
+/* Script for --shared -z combreloc: shared library, combine & sort relocs */
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ *(.rel.iplt)
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ *(.rela.iplt)
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xsw b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xsw
new file mode 100644
index 0000000..7f4a72c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xsw
@@ -0,0 +1,246 @@
+/* Script for --shared -z combreloc -z now -z relro: shared library, combine & sort relocs */
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ *(.rel.iplt)
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ *(.rela.iplt)
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .got.plt : { *(.got.plt) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xu b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xu
new file mode 100644
index 0000000..7b4df67
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xu
@@ -0,0 +1,202 @@
+/* Script for ld -Ur: link w/out relocation, do create constructors */
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ /* For some reason, the Solaris linker makes bad executables
+ if gld -r is used and the intermediate file has sections starting
+ at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
+ bug. But for now assigning the zero vmas works. */
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ .interp 0 : { *(.interp) }
+ .reginfo 0 : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic 0 : { *(.dynamic) }
+ .hash 0 : { *(.hash) }
+ .gnu.hash 0 : { *(.gnu.hash) }
+ .dynsym 0 : { *(.dynsym) }
+ .dynstr 0 : { *(.dynstr) }
+ .gnu.version 0 : { *(.gnu.version) }
+ .gnu.version_d 0: { *(.gnu.version_d) }
+ .gnu.version_r 0: { *(.gnu.version_r) }
+ .rel.init 0 : { *(.rel.init) }
+ .rela.init 0 : { *(.rela.init) }
+ .rel.text 0 : { *(.rel.text) }
+ .rela.text 0 : { *(.rela.text) }
+ .rel.fini 0 : { *(.rel.fini) }
+ .rela.fini 0 : { *(.rela.fini) }
+ .rel.rodata 0 : { *(.rel.rodata) }
+ .rela.rodata 0 : { *(.rela.rodata) }
+ .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) }
+ .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }
+ .rel.data 0 : { *(.rel.data) }
+ .rela.data 0 : { *(.rela.data) }
+ .rel.tdata 0 : { *(.rel.tdata) }
+ .rela.tdata 0 : { *(.rela.tdata) }
+ .rel.tbss 0 : { *(.rel.tbss) }
+ .rela.tbss 0 : { *(.rela.tbss) }
+ .rel.ctors 0 : { *(.rel.ctors) }
+ .rela.ctors 0 : { *(.rela.ctors) }
+ .rel.dtors 0 : { *(.rel.dtors) }
+ .rela.dtors 0 : { *(.rela.dtors) }
+ .rel.got 0 : { *(.rel.got) }
+ .rela.got 0 : { *(.rela.got) }
+ .rel.dyn 0 : { *(.rel.dyn) }
+ .rel.sdata 0 : { *(.rel.sdata) }
+ .rela.sdata 0 : { *(.rela.sdata) }
+ .rel.sbss 0 : { *(.rel.sbss) }
+ .rela.sbss 0 : { *(.rela.sbss) }
+ .rel.sdata2 0 : { *(.rel.sdata2) }
+ .rela.sdata2 0 : { *(.rela.sdata2) }
+ .rel.sbss2 0 : { *(.rel.sbss2) }
+ .rela.sbss2 0 : { *(.rela.sbss2) }
+ .rel.bss 0 : { *(.rel.bss) }
+ .rela.bss 0 : { *(.rela.bss) }
+ .rel.iplt 0 :
+ {
+ *(.rel.iplt)
+ }
+ .rela.iplt 0 :
+ {
+ *(.rela.iplt)
+ }
+ .rel.plt 0 :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt 0 :
+ {
+ *(.rela.plt)
+ }
+ .init 0 :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt 0 : { *(.plt) }
+ .iplt 0 : { *(.iplt) }
+ .text 0 :
+ {
+ *(.text .stub)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0
+ .fini 0 :
+ {
+ KEEP (*(.fini))
+ } =0
+ .rodata 0 : { *(.rodata) }
+ .rodata1 0 : { *(.rodata1) }
+ .sdata2 0 :
+ {
+ *(.sdata2)
+ }
+ .sbss2 0 : { *(.sbss2) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ /* Exception handling */
+ .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata 0 : { *(.tdata) }
+ .tbss 0 : { *(.tbss) }
+ .preinit_array 0 :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array 0 :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array 0 :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .jcr 0 : { KEEP (*(.jcr)) }
+ .data 0 :
+ {
+ *(.data)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 0 : { *(.data1) }
+ .got.plt 0 : { *(.got.plt) }
+ .got 0 : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata 0 :
+ {
+ *(.sdata)
+ }
+ .lit8 0 : { *(.lit8) }
+ .lit4 0 : { *(.lit4) }
+ .sbss 0 :
+ {
+ *(.dynsbss)
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss 0 :
+ {
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ }
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xw b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xw
new file mode 100644
index 0000000..d7b5e13
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmip.xw
@@ -0,0 +1,264 @@
+/* Script for -z combreloc -z now -z relro: combine and sort reloc sections */
+OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x0400000)); . = SEGMENT_START("text-segment", 0x0400000) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .got.plt : { *(.got.plt) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.x b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.x
new file mode 100644
index 0000000..61b4617
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.x
@@ -0,0 +1,254 @@
+/* Default linker script, for normal executables */
+OUTPUT_FORMAT("elf32-ntradbigmips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x10000000)); . = SEGMENT_START("text-segment", 0x10000000) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xbn b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xbn
new file mode 100644
index 0000000..0f32977
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xbn
@@ -0,0 +1,252 @@
+/* Script for -N: mix text and data on same page; don't align data */
+OUTPUT_FORMAT("elf32-ntradbigmips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x10000000)); . = SEGMENT_START("text-segment", 0x10000000) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = .;
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xc b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xc
new file mode 100644
index 0000000..64b4a52
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xc
@@ -0,0 +1,257 @@
+/* Script for -z combreloc: combine and sort reloc sections */
+OUTPUT_FORMAT("elf32-ntradbigmips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x10000000)); . = SEGMENT_START("text-segment", 0x10000000) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xd b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xd
new file mode 100644
index 0000000..468583f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xd
@@ -0,0 +1,254 @@
+/* Script for ld -pie: link position independent executable */
+OUTPUT_FORMAT("elf32-ntradbigmips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xdc b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xdc
new file mode 100644
index 0000000..007029f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xdc
@@ -0,0 +1,257 @@
+/* Script for -pie -z combreloc: position independent executable, combine & sort relocs */
+OUTPUT_FORMAT("elf32-ntradbigmips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xdw b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xdw
new file mode 100644
index 0000000..1a17006
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xdw
@@ -0,0 +1,257 @@
+/* Script for -pie -z combreloc -z now -z relro: position independent executable, combine & sort relocs */
+OUTPUT_FORMAT("elf32-ntradbigmips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .got.plt : { *(.got.plt) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xn b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xn
new file mode 100644
index 0000000..da1231a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xn
@@ -0,0 +1,254 @@
+/* Script for -n: mix text and data on same page */
+OUTPUT_FORMAT("elf32-ntradbigmips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x10000000)); . = SEGMENT_START("text-segment", 0x10000000) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xr b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xr
new file mode 100644
index 0000000..1071fe5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xr
@@ -0,0 +1,194 @@
+/* Script for ld -r: link without relocation */
+OUTPUT_FORMAT("elf32-ntradbigmips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ /* For some reason, the Solaris linker makes bad executables
+ if gld -r is used and the intermediate file has sections starting
+ at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
+ bug. But for now assigning the zero vmas works. */
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ .interp 0 : { *(.interp) }
+ .reginfo 0 : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic 0 : { *(.dynamic) }
+ .hash 0 : { *(.hash) }
+ .gnu.hash 0 : { *(.gnu.hash) }
+ .dynsym 0 : { *(.dynsym) }
+ .dynstr 0 : { *(.dynstr) }
+ .gnu.version 0 : { *(.gnu.version) }
+ .gnu.version_d 0: { *(.gnu.version_d) }
+ .gnu.version_r 0: { *(.gnu.version_r) }
+ .rel.init 0 : { *(.rel.init) }
+ .rela.init 0 : { *(.rela.init) }
+ .rel.text 0 : { *(.rel.text) }
+ .rela.text 0 : { *(.rela.text) }
+ .rel.fini 0 : { *(.rel.fini) }
+ .rela.fini 0 : { *(.rela.fini) }
+ .rel.rodata 0 : { *(.rel.rodata) }
+ .rela.rodata 0 : { *(.rela.rodata) }
+ .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) }
+ .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }
+ .rel.data 0 : { *(.rel.data) }
+ .rela.data 0 : { *(.rela.data) }
+ .rel.tdata 0 : { *(.rel.tdata) }
+ .rela.tdata 0 : { *(.rela.tdata) }
+ .rel.tbss 0 : { *(.rel.tbss) }
+ .rela.tbss 0 : { *(.rela.tbss) }
+ .rel.ctors 0 : { *(.rel.ctors) }
+ .rela.ctors 0 : { *(.rela.ctors) }
+ .rel.dtors 0 : { *(.rel.dtors) }
+ .rela.dtors 0 : { *(.rela.dtors) }
+ .rel.got 0 : { *(.rel.got) }
+ .rela.got 0 : { *(.rela.got) }
+ .rel.dyn 0 : { *(.rel.dyn) }
+ .rel.sdata 0 : { *(.rel.sdata) }
+ .rela.sdata 0 : { *(.rela.sdata) }
+ .rel.sbss 0 : { *(.rel.sbss) }
+ .rela.sbss 0 : { *(.rela.sbss) }
+ .rel.sdata2 0 : { *(.rel.sdata2) }
+ .rela.sdata2 0 : { *(.rela.sdata2) }
+ .rel.sbss2 0 : { *(.rel.sbss2) }
+ .rela.sbss2 0 : { *(.rela.sbss2) }
+ .rel.bss 0 : { *(.rel.bss) }
+ .rela.bss 0 : { *(.rela.bss) }
+ .rel.iplt 0 :
+ {
+ *(.rel.iplt)
+ }
+ .rela.iplt 0 :
+ {
+ *(.rela.iplt)
+ }
+ .rel.plt 0 :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt 0 :
+ {
+ *(.rela.plt)
+ }
+ .init 0 :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt 0 : { *(.plt) }
+ .iplt 0 : { *(.iplt) }
+ .text 0 :
+ {
+ *(.text .stub)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0
+ .fini 0 :
+ {
+ KEEP (*(.fini))
+ } =0
+ .rodata 0 : { *(.rodata) }
+ .rodata1 0 : { *(.rodata1) }
+ .sdata2 0 :
+ {
+ *(.sdata2)
+ }
+ .sbss2 0 : { *(.sbss2) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ /* Exception handling */
+ .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata 0 : { *(.tdata) }
+ .tbss 0 : { *(.tbss) }
+ .preinit_array 0 :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array 0 :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array 0 :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .jcr 0 : { KEEP (*(.jcr)) }
+ .data 0 :
+ {
+ *(.data)
+ }
+ .data1 0 : { *(.data1) }
+ .got.plt 0 : { *(.got.plt) }
+ .got 0 : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata 0 :
+ {
+ *(.sdata)
+ }
+ .lit8 0 : { *(.lit8) }
+ .lit4 0 : { *(.lit4) }
+ .srdata 0 : { *(.srdata) }
+ .sbss 0 :
+ {
+ *(.dynsbss)
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss 0 :
+ {
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ }
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xs b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xs
new file mode 100644
index 0000000..2ad1c3b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xs
@@ -0,0 +1,240 @@
+/* Script for ld --shared: link shared library */
+OUTPUT_FORMAT("elf32-ntradbigmips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ *(.rel.iplt)
+ }
+ .rela.iplt :
+ {
+ *(.rela.iplt)
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xsc b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xsc
new file mode 100644
index 0000000..8758869
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xsc
@@ -0,0 +1,239 @@
+/* Script for --shared -z combreloc: shared library, combine & sort relocs */
+OUTPUT_FORMAT("elf32-ntradbigmips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ *(.rel.iplt)
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ *(.rela.iplt)
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xsw b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xsw
new file mode 100644
index 0000000..f0cf213
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xsw
@@ -0,0 +1,239 @@
+/* Script for --shared -z combreloc -z now -z relro: shared library, combine & sort relocs */
+OUTPUT_FORMAT("elf32-ntradbigmips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ *(.rel.iplt)
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ *(.rela.iplt)
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .got.plt : { *(.got.plt) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xu b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xu
new file mode 100644
index 0000000..d77c425
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xu
@@ -0,0 +1,195 @@
+/* Script for ld -Ur: link w/out relocation, do create constructors */
+OUTPUT_FORMAT("elf32-ntradbigmips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ /* For some reason, the Solaris linker makes bad executables
+ if gld -r is used and the intermediate file has sections starting
+ at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
+ bug. But for now assigning the zero vmas works. */
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ .interp 0 : { *(.interp) }
+ .reginfo 0 : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic 0 : { *(.dynamic) }
+ .hash 0 : { *(.hash) }
+ .gnu.hash 0 : { *(.gnu.hash) }
+ .dynsym 0 : { *(.dynsym) }
+ .dynstr 0 : { *(.dynstr) }
+ .gnu.version 0 : { *(.gnu.version) }
+ .gnu.version_d 0: { *(.gnu.version_d) }
+ .gnu.version_r 0: { *(.gnu.version_r) }
+ .rel.init 0 : { *(.rel.init) }
+ .rela.init 0 : { *(.rela.init) }
+ .rel.text 0 : { *(.rel.text) }
+ .rela.text 0 : { *(.rela.text) }
+ .rel.fini 0 : { *(.rel.fini) }
+ .rela.fini 0 : { *(.rela.fini) }
+ .rel.rodata 0 : { *(.rel.rodata) }
+ .rela.rodata 0 : { *(.rela.rodata) }
+ .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) }
+ .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }
+ .rel.data 0 : { *(.rel.data) }
+ .rela.data 0 : { *(.rela.data) }
+ .rel.tdata 0 : { *(.rel.tdata) }
+ .rela.tdata 0 : { *(.rela.tdata) }
+ .rel.tbss 0 : { *(.rel.tbss) }
+ .rela.tbss 0 : { *(.rela.tbss) }
+ .rel.ctors 0 : { *(.rel.ctors) }
+ .rela.ctors 0 : { *(.rela.ctors) }
+ .rel.dtors 0 : { *(.rel.dtors) }
+ .rela.dtors 0 : { *(.rela.dtors) }
+ .rel.got 0 : { *(.rel.got) }
+ .rela.got 0 : { *(.rela.got) }
+ .rel.dyn 0 : { *(.rel.dyn) }
+ .rel.sdata 0 : { *(.rel.sdata) }
+ .rela.sdata 0 : { *(.rela.sdata) }
+ .rel.sbss 0 : { *(.rel.sbss) }
+ .rela.sbss 0 : { *(.rela.sbss) }
+ .rel.sdata2 0 : { *(.rel.sdata2) }
+ .rela.sdata2 0 : { *(.rela.sdata2) }
+ .rel.sbss2 0 : { *(.rel.sbss2) }
+ .rela.sbss2 0 : { *(.rela.sbss2) }
+ .rel.bss 0 : { *(.rel.bss) }
+ .rela.bss 0 : { *(.rela.bss) }
+ .rel.iplt 0 :
+ {
+ *(.rel.iplt)
+ }
+ .rela.iplt 0 :
+ {
+ *(.rela.iplt)
+ }
+ .rel.plt 0 :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt 0 :
+ {
+ *(.rela.plt)
+ }
+ .init 0 :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt 0 : { *(.plt) }
+ .iplt 0 : { *(.iplt) }
+ .text 0 :
+ {
+ *(.text .stub)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0
+ .fini 0 :
+ {
+ KEEP (*(.fini))
+ } =0
+ .rodata 0 : { *(.rodata) }
+ .rodata1 0 : { *(.rodata1) }
+ .sdata2 0 :
+ {
+ *(.sdata2)
+ }
+ .sbss2 0 : { *(.sbss2) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ /* Exception handling */
+ .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata 0 : { *(.tdata) }
+ .tbss 0 : { *(.tbss) }
+ .preinit_array 0 :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array 0 :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array 0 :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .jcr 0 : { KEEP (*(.jcr)) }
+ .data 0 :
+ {
+ *(.data)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 0 : { *(.data1) }
+ .got.plt 0 : { *(.got.plt) }
+ .got 0 : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata 0 :
+ {
+ *(.sdata)
+ }
+ .lit8 0 : { *(.lit8) }
+ .lit4 0 : { *(.lit4) }
+ .srdata 0 : { *(.srdata) }
+ .sbss 0 :
+ {
+ *(.dynsbss)
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss 0 :
+ {
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ }
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xw b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xw
new file mode 100644
index 0000000..1b12536
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32btsmipn32.xw
@@ -0,0 +1,257 @@
+/* Script for -z combreloc -z now -z relro: combine and sort reloc sections */
+OUTPUT_FORMAT("elf32-ntradbigmips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x10000000)); . = SEGMENT_START("text-segment", 0x10000000) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .got.plt : { *(.got.plt) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.x b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.x
new file mode 100644
index 0000000..9ee5caf
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.x
@@ -0,0 +1,261 @@
+/* Default linker script, for normal executables */
+OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x0400000)); . = SEGMENT_START("text-segment", 0x0400000) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xbn b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xbn
new file mode 100644
index 0000000..add0473
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xbn
@@ -0,0 +1,259 @@
+/* Script for -N: mix text and data on same page; don't align data */
+OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x0400000)); . = SEGMENT_START("text-segment", 0x0400000) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = .;
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xc b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xc
new file mode 100644
index 0000000..d90bf1e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xc
@@ -0,0 +1,264 @@
+/* Script for -z combreloc: combine and sort reloc sections */
+OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x0400000)); . = SEGMENT_START("text-segment", 0x0400000) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xd b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xd
new file mode 100644
index 0000000..854dd81
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xd
@@ -0,0 +1,261 @@
+/* Script for ld -pie: link position independent executable */
+OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xdc b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xdc
new file mode 100644
index 0000000..b80357c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xdc
@@ -0,0 +1,264 @@
+/* Script for -pie -z combreloc: position independent executable, combine & sort relocs */
+OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xdw b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xdw
new file mode 100644
index 0000000..df8857c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xdw
@@ -0,0 +1,264 @@
+/* Script for -pie -z combreloc -z now -z relro: position independent executable, combine & sort relocs */
+OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .got.plt : { *(.got.plt) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xn b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xn
new file mode 100644
index 0000000..10ea08e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xn
@@ -0,0 +1,261 @@
+/* Script for -n: mix text and data on same page */
+OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x0400000)); . = SEGMENT_START("text-segment", 0x0400000) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xr b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xr
new file mode 100644
index 0000000..0f43c9c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xr
@@ -0,0 +1,201 @@
+/* Script for ld -r: link without relocation */
+OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ /* For some reason, the Solaris linker makes bad executables
+ if gld -r is used and the intermediate file has sections starting
+ at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
+ bug. But for now assigning the zero vmas works. */
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ .interp 0 : { *(.interp) }
+ .reginfo 0 : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic 0 : { *(.dynamic) }
+ .hash 0 : { *(.hash) }
+ .gnu.hash 0 : { *(.gnu.hash) }
+ .dynsym 0 : { *(.dynsym) }
+ .dynstr 0 : { *(.dynstr) }
+ .gnu.version 0 : { *(.gnu.version) }
+ .gnu.version_d 0: { *(.gnu.version_d) }
+ .gnu.version_r 0: { *(.gnu.version_r) }
+ .rel.init 0 : { *(.rel.init) }
+ .rela.init 0 : { *(.rela.init) }
+ .rel.text 0 : { *(.rel.text) }
+ .rela.text 0 : { *(.rela.text) }
+ .rel.fini 0 : { *(.rel.fini) }
+ .rela.fini 0 : { *(.rela.fini) }
+ .rel.rodata 0 : { *(.rel.rodata) }
+ .rela.rodata 0 : { *(.rela.rodata) }
+ .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) }
+ .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }
+ .rel.data 0 : { *(.rel.data) }
+ .rela.data 0 : { *(.rela.data) }
+ .rel.tdata 0 : { *(.rel.tdata) }
+ .rela.tdata 0 : { *(.rela.tdata) }
+ .rel.tbss 0 : { *(.rel.tbss) }
+ .rela.tbss 0 : { *(.rela.tbss) }
+ .rel.ctors 0 : { *(.rel.ctors) }
+ .rela.ctors 0 : { *(.rela.ctors) }
+ .rel.dtors 0 : { *(.rel.dtors) }
+ .rela.dtors 0 : { *(.rela.dtors) }
+ .rel.got 0 : { *(.rel.got) }
+ .rela.got 0 : { *(.rela.got) }
+ .rel.dyn 0 : { *(.rel.dyn) }
+ .rel.sdata 0 : { *(.rel.sdata) }
+ .rela.sdata 0 : { *(.rela.sdata) }
+ .rel.sbss 0 : { *(.rel.sbss) }
+ .rela.sbss 0 : { *(.rela.sbss) }
+ .rel.sdata2 0 : { *(.rel.sdata2) }
+ .rela.sdata2 0 : { *(.rela.sdata2) }
+ .rel.sbss2 0 : { *(.rel.sbss2) }
+ .rela.sbss2 0 : { *(.rela.sbss2) }
+ .rel.bss 0 : { *(.rel.bss) }
+ .rela.bss 0 : { *(.rela.bss) }
+ .rel.iplt 0 :
+ {
+ *(.rel.iplt)
+ }
+ .rela.iplt 0 :
+ {
+ *(.rela.iplt)
+ }
+ .rel.plt 0 :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt 0 :
+ {
+ *(.rela.plt)
+ }
+ .init 0 :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt 0 : { *(.plt) }
+ .iplt 0 : { *(.iplt) }
+ .text 0 :
+ {
+ *(.text .stub)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0
+ .fini 0 :
+ {
+ KEEP (*(.fini))
+ } =0
+ .rodata 0 : { *(.rodata) }
+ .rodata1 0 : { *(.rodata1) }
+ .sdata2 0 :
+ {
+ *(.sdata2)
+ }
+ .sbss2 0 : { *(.sbss2) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ /* Exception handling */
+ .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata 0 : { *(.tdata) }
+ .tbss 0 : { *(.tbss) }
+ .preinit_array 0 :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array 0 :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array 0 :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .jcr 0 : { KEEP (*(.jcr)) }
+ .data 0 :
+ {
+ *(.data)
+ }
+ .data1 0 : { *(.data1) }
+ .got.plt 0 : { *(.got.plt) }
+ .got 0 : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata 0 :
+ {
+ *(.sdata)
+ }
+ .lit8 0 : { *(.lit8) }
+ .lit4 0 : { *(.lit4) }
+ .sbss 0 :
+ {
+ *(.dynsbss)
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss 0 :
+ {
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ }
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xs b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xs
new file mode 100644
index 0000000..d6a963a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xs
@@ -0,0 +1,247 @@
+/* Script for ld --shared: link shared library */
+OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ *(.rel.iplt)
+ }
+ .rela.iplt :
+ {
+ *(.rela.iplt)
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xsc b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xsc
new file mode 100644
index 0000000..e7ddc0a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xsc
@@ -0,0 +1,246 @@
+/* Script for --shared -z combreloc: shared library, combine & sort relocs */
+OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ *(.rel.iplt)
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ *(.rela.iplt)
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xsw b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xsw
new file mode 100644
index 0000000..a006342
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xsw
@@ -0,0 +1,246 @@
+/* Script for --shared -z combreloc -z now -z relro: shared library, combine & sort relocs */
+OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ *(.rel.iplt)
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ *(.rela.iplt)
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .got.plt : { *(.got.plt) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xu b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xu
new file mode 100644
index 0000000..984422a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xu
@@ -0,0 +1,202 @@
+/* Script for ld -Ur: link w/out relocation, do create constructors */
+OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ /* For some reason, the Solaris linker makes bad executables
+ if gld -r is used and the intermediate file has sections starting
+ at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
+ bug. But for now assigning the zero vmas works. */
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ .interp 0 : { *(.interp) }
+ .reginfo 0 : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic 0 : { *(.dynamic) }
+ .hash 0 : { *(.hash) }
+ .gnu.hash 0 : { *(.gnu.hash) }
+ .dynsym 0 : { *(.dynsym) }
+ .dynstr 0 : { *(.dynstr) }
+ .gnu.version 0 : { *(.gnu.version) }
+ .gnu.version_d 0: { *(.gnu.version_d) }
+ .gnu.version_r 0: { *(.gnu.version_r) }
+ .rel.init 0 : { *(.rel.init) }
+ .rela.init 0 : { *(.rela.init) }
+ .rel.text 0 : { *(.rel.text) }
+ .rela.text 0 : { *(.rela.text) }
+ .rel.fini 0 : { *(.rel.fini) }
+ .rela.fini 0 : { *(.rela.fini) }
+ .rel.rodata 0 : { *(.rel.rodata) }
+ .rela.rodata 0 : { *(.rela.rodata) }
+ .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) }
+ .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }
+ .rel.data 0 : { *(.rel.data) }
+ .rela.data 0 : { *(.rela.data) }
+ .rel.tdata 0 : { *(.rel.tdata) }
+ .rela.tdata 0 : { *(.rela.tdata) }
+ .rel.tbss 0 : { *(.rel.tbss) }
+ .rela.tbss 0 : { *(.rela.tbss) }
+ .rel.ctors 0 : { *(.rel.ctors) }
+ .rela.ctors 0 : { *(.rela.ctors) }
+ .rel.dtors 0 : { *(.rel.dtors) }
+ .rela.dtors 0 : { *(.rela.dtors) }
+ .rel.got 0 : { *(.rel.got) }
+ .rela.got 0 : { *(.rela.got) }
+ .rel.dyn 0 : { *(.rel.dyn) }
+ .rel.sdata 0 : { *(.rel.sdata) }
+ .rela.sdata 0 : { *(.rela.sdata) }
+ .rel.sbss 0 : { *(.rel.sbss) }
+ .rela.sbss 0 : { *(.rela.sbss) }
+ .rel.sdata2 0 : { *(.rel.sdata2) }
+ .rela.sdata2 0 : { *(.rela.sdata2) }
+ .rel.sbss2 0 : { *(.rel.sbss2) }
+ .rela.sbss2 0 : { *(.rela.sbss2) }
+ .rel.bss 0 : { *(.rel.bss) }
+ .rela.bss 0 : { *(.rela.bss) }
+ .rel.iplt 0 :
+ {
+ *(.rel.iplt)
+ }
+ .rela.iplt 0 :
+ {
+ *(.rela.iplt)
+ }
+ .rel.plt 0 :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt 0 :
+ {
+ *(.rela.plt)
+ }
+ .init 0 :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt 0 : { *(.plt) }
+ .iplt 0 : { *(.iplt) }
+ .text 0 :
+ {
+ *(.text .stub)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0
+ .fini 0 :
+ {
+ KEEP (*(.fini))
+ } =0
+ .rodata 0 : { *(.rodata) }
+ .rodata1 0 : { *(.rodata1) }
+ .sdata2 0 :
+ {
+ *(.sdata2)
+ }
+ .sbss2 0 : { *(.sbss2) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ /* Exception handling */
+ .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata 0 : { *(.tdata) }
+ .tbss 0 : { *(.tbss) }
+ .preinit_array 0 :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array 0 :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array 0 :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .jcr 0 : { KEEP (*(.jcr)) }
+ .data 0 :
+ {
+ *(.data)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 0 : { *(.data1) }
+ .got.plt 0 : { *(.got.plt) }
+ .got 0 : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata 0 :
+ {
+ *(.sdata)
+ }
+ .lit8 0 : { *(.lit8) }
+ .lit4 0 : { *(.lit4) }
+ .sbss 0 :
+ {
+ *(.dynsbss)
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss 0 :
+ {
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ }
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xw b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xw
new file mode 100644
index 0000000..c1b20fa
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmip.xw
@@ -0,0 +1,264 @@
+/* Script for -z combreloc -z now -z relro: combine and sort reloc sections */
+OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradbigmips",
+ "elf32-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x0400000)); . = SEGMENT_START("text-segment", 0x0400000) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .got.plt : { *(.got.plt) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.x b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.x
new file mode 100644
index 0000000..561552e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.x
@@ -0,0 +1,254 @@
+/* Default linker script, for normal executables */
+OUTPUT_FORMAT("elf32-ntradlittlemips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x10000000)); . = SEGMENT_START("text-segment", 0x10000000) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xbn b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xbn
new file mode 100644
index 0000000..37bfa08
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xbn
@@ -0,0 +1,252 @@
+/* Script for -N: mix text and data on same page; don't align data */
+OUTPUT_FORMAT("elf32-ntradlittlemips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x10000000)); . = SEGMENT_START("text-segment", 0x10000000) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = .;
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xc b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xc
new file mode 100644
index 0000000..4106687
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xc
@@ -0,0 +1,257 @@
+/* Script for -z combreloc: combine and sort reloc sections */
+OUTPUT_FORMAT("elf32-ntradlittlemips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x10000000)); . = SEGMENT_START("text-segment", 0x10000000) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xd b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xd
new file mode 100644
index 0000000..84117f0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xd
@@ -0,0 +1,254 @@
+/* Script for ld -pie: link position independent executable */
+OUTPUT_FORMAT("elf32-ntradlittlemips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xdc b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xdc
new file mode 100644
index 0000000..2ba0526
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xdc
@@ -0,0 +1,257 @@
+/* Script for -pie -z combreloc: position independent executable, combine & sort relocs */
+OUTPUT_FORMAT("elf32-ntradlittlemips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xdw b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xdw
new file mode 100644
index 0000000..8907ef6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xdw
@@ -0,0 +1,257 @@
+/* Script for -pie -z combreloc -z now -z relro: position independent executable, combine & sort relocs */
+OUTPUT_FORMAT("elf32-ntradlittlemips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .got.plt : { *(.got.plt) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xn b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xn
new file mode 100644
index 0000000..4ca0ed2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xn
@@ -0,0 +1,254 @@
+/* Script for -n: mix text and data on same page */
+OUTPUT_FORMAT("elf32-ntradlittlemips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x10000000)); . = SEGMENT_START("text-segment", 0x10000000) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xr b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xr
new file mode 100644
index 0000000..ceac4b0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xr
@@ -0,0 +1,194 @@
+/* Script for ld -r: link without relocation */
+OUTPUT_FORMAT("elf32-ntradlittlemips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ /* For some reason, the Solaris linker makes bad executables
+ if gld -r is used and the intermediate file has sections starting
+ at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
+ bug. But for now assigning the zero vmas works. */
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ .interp 0 : { *(.interp) }
+ .reginfo 0 : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic 0 : { *(.dynamic) }
+ .hash 0 : { *(.hash) }
+ .gnu.hash 0 : { *(.gnu.hash) }
+ .dynsym 0 : { *(.dynsym) }
+ .dynstr 0 : { *(.dynstr) }
+ .gnu.version 0 : { *(.gnu.version) }
+ .gnu.version_d 0: { *(.gnu.version_d) }
+ .gnu.version_r 0: { *(.gnu.version_r) }
+ .rel.init 0 : { *(.rel.init) }
+ .rela.init 0 : { *(.rela.init) }
+ .rel.text 0 : { *(.rel.text) }
+ .rela.text 0 : { *(.rela.text) }
+ .rel.fini 0 : { *(.rel.fini) }
+ .rela.fini 0 : { *(.rela.fini) }
+ .rel.rodata 0 : { *(.rel.rodata) }
+ .rela.rodata 0 : { *(.rela.rodata) }
+ .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) }
+ .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }
+ .rel.data 0 : { *(.rel.data) }
+ .rela.data 0 : { *(.rela.data) }
+ .rel.tdata 0 : { *(.rel.tdata) }
+ .rela.tdata 0 : { *(.rela.tdata) }
+ .rel.tbss 0 : { *(.rel.tbss) }
+ .rela.tbss 0 : { *(.rela.tbss) }
+ .rel.ctors 0 : { *(.rel.ctors) }
+ .rela.ctors 0 : { *(.rela.ctors) }
+ .rel.dtors 0 : { *(.rel.dtors) }
+ .rela.dtors 0 : { *(.rela.dtors) }
+ .rel.got 0 : { *(.rel.got) }
+ .rela.got 0 : { *(.rela.got) }
+ .rel.dyn 0 : { *(.rel.dyn) }
+ .rel.sdata 0 : { *(.rel.sdata) }
+ .rela.sdata 0 : { *(.rela.sdata) }
+ .rel.sbss 0 : { *(.rel.sbss) }
+ .rela.sbss 0 : { *(.rela.sbss) }
+ .rel.sdata2 0 : { *(.rel.sdata2) }
+ .rela.sdata2 0 : { *(.rela.sdata2) }
+ .rel.sbss2 0 : { *(.rel.sbss2) }
+ .rela.sbss2 0 : { *(.rela.sbss2) }
+ .rel.bss 0 : { *(.rel.bss) }
+ .rela.bss 0 : { *(.rela.bss) }
+ .rel.iplt 0 :
+ {
+ *(.rel.iplt)
+ }
+ .rela.iplt 0 :
+ {
+ *(.rela.iplt)
+ }
+ .rel.plt 0 :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt 0 :
+ {
+ *(.rela.plt)
+ }
+ .init 0 :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt 0 : { *(.plt) }
+ .iplt 0 : { *(.iplt) }
+ .text 0 :
+ {
+ *(.text .stub)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0
+ .fini 0 :
+ {
+ KEEP (*(.fini))
+ } =0
+ .rodata 0 : { *(.rodata) }
+ .rodata1 0 : { *(.rodata1) }
+ .sdata2 0 :
+ {
+ *(.sdata2)
+ }
+ .sbss2 0 : { *(.sbss2) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ /* Exception handling */
+ .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata 0 : { *(.tdata) }
+ .tbss 0 : { *(.tbss) }
+ .preinit_array 0 :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array 0 :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array 0 :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .jcr 0 : { KEEP (*(.jcr)) }
+ .data 0 :
+ {
+ *(.data)
+ }
+ .data1 0 : { *(.data1) }
+ .got.plt 0 : { *(.got.plt) }
+ .got 0 : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata 0 :
+ {
+ *(.sdata)
+ }
+ .lit8 0 : { *(.lit8) }
+ .lit4 0 : { *(.lit4) }
+ .srdata 0 : { *(.srdata) }
+ .sbss 0 :
+ {
+ *(.dynsbss)
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss 0 :
+ {
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ }
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xs b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xs
new file mode 100644
index 0000000..868cf4c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xs
@@ -0,0 +1,240 @@
+/* Script for ld --shared: link shared library */
+OUTPUT_FORMAT("elf32-ntradlittlemips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ *(.rel.iplt)
+ }
+ .rela.iplt :
+ {
+ *(.rela.iplt)
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xsc b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xsc
new file mode 100644
index 0000000..c405bde
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xsc
@@ -0,0 +1,239 @@
+/* Script for --shared -z combreloc: shared library, combine & sort relocs */
+OUTPUT_FORMAT("elf32-ntradlittlemips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ *(.rel.iplt)
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ *(.rela.iplt)
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xsw b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xsw
new file mode 100644
index 0000000..4c87ca0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xsw
@@ -0,0 +1,239 @@
+/* Script for --shared -z combreloc -z now -z relro: shared library, combine & sort relocs */
+OUTPUT_FORMAT("elf32-ntradlittlemips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ *(.rel.iplt)
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ *(.rela.iplt)
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .got.plt : { *(.got.plt) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xu b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xu
new file mode 100644
index 0000000..1321072
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xu
@@ -0,0 +1,195 @@
+/* Script for ld -Ur: link w/out relocation, do create constructors */
+OUTPUT_FORMAT("elf32-ntradlittlemips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ /* For some reason, the Solaris linker makes bad executables
+ if gld -r is used and the intermediate file has sections starting
+ at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
+ bug. But for now assigning the zero vmas works. */
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ .interp 0 : { *(.interp) }
+ .reginfo 0 : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic 0 : { *(.dynamic) }
+ .hash 0 : { *(.hash) }
+ .gnu.hash 0 : { *(.gnu.hash) }
+ .dynsym 0 : { *(.dynsym) }
+ .dynstr 0 : { *(.dynstr) }
+ .gnu.version 0 : { *(.gnu.version) }
+ .gnu.version_d 0: { *(.gnu.version_d) }
+ .gnu.version_r 0: { *(.gnu.version_r) }
+ .rel.init 0 : { *(.rel.init) }
+ .rela.init 0 : { *(.rela.init) }
+ .rel.text 0 : { *(.rel.text) }
+ .rela.text 0 : { *(.rela.text) }
+ .rel.fini 0 : { *(.rel.fini) }
+ .rela.fini 0 : { *(.rela.fini) }
+ .rel.rodata 0 : { *(.rel.rodata) }
+ .rela.rodata 0 : { *(.rela.rodata) }
+ .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) }
+ .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }
+ .rel.data 0 : { *(.rel.data) }
+ .rela.data 0 : { *(.rela.data) }
+ .rel.tdata 0 : { *(.rel.tdata) }
+ .rela.tdata 0 : { *(.rela.tdata) }
+ .rel.tbss 0 : { *(.rel.tbss) }
+ .rela.tbss 0 : { *(.rela.tbss) }
+ .rel.ctors 0 : { *(.rel.ctors) }
+ .rela.ctors 0 : { *(.rela.ctors) }
+ .rel.dtors 0 : { *(.rel.dtors) }
+ .rela.dtors 0 : { *(.rela.dtors) }
+ .rel.got 0 : { *(.rel.got) }
+ .rela.got 0 : { *(.rela.got) }
+ .rel.dyn 0 : { *(.rel.dyn) }
+ .rel.sdata 0 : { *(.rel.sdata) }
+ .rela.sdata 0 : { *(.rela.sdata) }
+ .rel.sbss 0 : { *(.rel.sbss) }
+ .rela.sbss 0 : { *(.rela.sbss) }
+ .rel.sdata2 0 : { *(.rel.sdata2) }
+ .rela.sdata2 0 : { *(.rela.sdata2) }
+ .rel.sbss2 0 : { *(.rel.sbss2) }
+ .rela.sbss2 0 : { *(.rela.sbss2) }
+ .rel.bss 0 : { *(.rel.bss) }
+ .rela.bss 0 : { *(.rela.bss) }
+ .rel.iplt 0 :
+ {
+ *(.rel.iplt)
+ }
+ .rela.iplt 0 :
+ {
+ *(.rela.iplt)
+ }
+ .rel.plt 0 :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt 0 :
+ {
+ *(.rela.plt)
+ }
+ .init 0 :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt 0 : { *(.plt) }
+ .iplt 0 : { *(.iplt) }
+ .text 0 :
+ {
+ *(.text .stub)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0
+ .fini 0 :
+ {
+ KEEP (*(.fini))
+ } =0
+ .rodata 0 : { *(.rodata) }
+ .rodata1 0 : { *(.rodata1) }
+ .sdata2 0 :
+ {
+ *(.sdata2)
+ }
+ .sbss2 0 : { *(.sbss2) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ /* Exception handling */
+ .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata 0 : { *(.tdata) }
+ .tbss 0 : { *(.tbss) }
+ .preinit_array 0 :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array 0 :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array 0 :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .jcr 0 : { KEEP (*(.jcr)) }
+ .data 0 :
+ {
+ *(.data)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 0 : { *(.data1) }
+ .got.plt 0 : { *(.got.plt) }
+ .got 0 : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata 0 :
+ {
+ *(.sdata)
+ }
+ .lit8 0 : { *(.lit8) }
+ .lit4 0 : { *(.lit4) }
+ .srdata 0 : { *(.srdata) }
+ .sbss 0 :
+ {
+ *(.dynsbss)
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss 0 :
+ {
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ }
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xw b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xw
new file mode 100644
index 0000000..5ef3f53
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf32ltsmipn32.xw
@@ -0,0 +1,257 @@
+/* Script for -z combreloc -z now -z relro: combine and sort reloc sections */
+OUTPUT_FORMAT("elf32-ntradlittlemips", "elf32-ntradbigmips",
+ "elf32-ntradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x10000000)); . = SEGMENT_START("text-segment", 0x10000000) + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .reginfo : { *(.reginfo) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .got.plt : { *(.got.plt) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 32 / 8 : 1);
+ }
+ . = ALIGN(32 / 8);
+ . = ALIGN(32 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.x b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.x
new file mode 100644
index 0000000..da41b3d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.x
@@ -0,0 +1,253 @@
+/* Default linker script, for normal executables */
+OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x120000000)); . = SEGMENT_START("text-segment", 0x120000000) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xbn b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xbn
new file mode 100644
index 0000000..60d56a3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xbn
@@ -0,0 +1,251 @@
+/* Script for -N: mix text and data on same page; don't align data */
+OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x120000000)); . = SEGMENT_START("text-segment", 0x120000000) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = .;
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xc b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xc
new file mode 100644
index 0000000..8ef39dc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xc
@@ -0,0 +1,256 @@
+/* Script for -z combreloc: combine and sort reloc sections */
+OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x120000000)); . = SEGMENT_START("text-segment", 0x120000000) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xd b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xd
new file mode 100644
index 0000000..21cbb2e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xd
@@ -0,0 +1,253 @@
+/* Script for ld -pie: link position independent executable */
+OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xdc b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xdc
new file mode 100644
index 0000000..87319e1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xdc
@@ -0,0 +1,256 @@
+/* Script for -pie -z combreloc: position independent executable, combine & sort relocs */
+OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xdw b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xdw
new file mode 100644
index 0000000..3dcd70c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xdw
@@ -0,0 +1,256 @@
+/* Script for -pie -z combreloc -z now -z relro: position independent executable, combine & sort relocs */
+OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .got.plt : { *(.got.plt) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xn b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xn
new file mode 100644
index 0000000..b13c506
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xn
@@ -0,0 +1,253 @@
+/* Script for -n: mix text and data on same page */
+OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x120000000)); . = SEGMENT_START("text-segment", 0x120000000) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xr b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xr
new file mode 100644
index 0000000..4c43646
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xr
@@ -0,0 +1,193 @@
+/* Script for ld -r: link without relocation */
+OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ /* For some reason, the Solaris linker makes bad executables
+ if gld -r is used and the intermediate file has sections starting
+ at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
+ bug. But for now assigning the zero vmas works. */
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic 0 : { *(.dynamic) }
+ .hash 0 : { *(.hash) }
+ .gnu.hash 0 : { *(.gnu.hash) }
+ .dynsym 0 : { *(.dynsym) }
+ .dynstr 0 : { *(.dynstr) }
+ .gnu.version 0 : { *(.gnu.version) }
+ .gnu.version_d 0: { *(.gnu.version_d) }
+ .gnu.version_r 0: { *(.gnu.version_r) }
+ .rel.init 0 : { *(.rel.init) }
+ .rela.init 0 : { *(.rela.init) }
+ .rel.text 0 : { *(.rel.text) }
+ .rela.text 0 : { *(.rela.text) }
+ .rel.fini 0 : { *(.rel.fini) }
+ .rela.fini 0 : { *(.rela.fini) }
+ .rel.rodata 0 : { *(.rel.rodata) }
+ .rela.rodata 0 : { *(.rela.rodata) }
+ .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) }
+ .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }
+ .rel.data 0 : { *(.rel.data) }
+ .rela.data 0 : { *(.rela.data) }
+ .rel.tdata 0 : { *(.rel.tdata) }
+ .rela.tdata 0 : { *(.rela.tdata) }
+ .rel.tbss 0 : { *(.rel.tbss) }
+ .rela.tbss 0 : { *(.rela.tbss) }
+ .rel.ctors 0 : { *(.rel.ctors) }
+ .rela.ctors 0 : { *(.rela.ctors) }
+ .rel.dtors 0 : { *(.rel.dtors) }
+ .rela.dtors 0 : { *(.rela.dtors) }
+ .rel.got 0 : { *(.rel.got) }
+ .rela.got 0 : { *(.rela.got) }
+ .rel.dyn 0 : { *(.rel.dyn) }
+ .rel.sdata 0 : { *(.rel.sdata) }
+ .rela.sdata 0 : { *(.rela.sdata) }
+ .rel.sbss 0 : { *(.rel.sbss) }
+ .rela.sbss 0 : { *(.rela.sbss) }
+ .rel.sdata2 0 : { *(.rel.sdata2) }
+ .rela.sdata2 0 : { *(.rela.sdata2) }
+ .rel.sbss2 0 : { *(.rel.sbss2) }
+ .rela.sbss2 0 : { *(.rela.sbss2) }
+ .rel.bss 0 : { *(.rel.bss) }
+ .rela.bss 0 : { *(.rela.bss) }
+ .rel.iplt 0 :
+ {
+ *(.rel.iplt)
+ }
+ .rela.iplt 0 :
+ {
+ *(.rela.iplt)
+ }
+ .rel.plt 0 :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt 0 :
+ {
+ *(.rela.plt)
+ }
+ .init 0 :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt 0 : { *(.plt) }
+ .iplt 0 : { *(.iplt) }
+ .text 0 :
+ {
+ *(.text .stub)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0
+ .fini 0 :
+ {
+ KEEP (*(.fini))
+ } =0
+ .rodata 0 : { *(.rodata) }
+ .rodata1 0 : { *(.rodata1) }
+ .sdata2 0 :
+ {
+ *(.sdata2)
+ }
+ .sbss2 0 : { *(.sbss2) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ /* Exception handling */
+ .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata 0 : { *(.tdata) }
+ .tbss 0 : { *(.tbss) }
+ .preinit_array 0 :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array 0 :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array 0 :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .jcr 0 : { KEEP (*(.jcr)) }
+ .data 0 :
+ {
+ *(.data)
+ }
+ .data1 0 : { *(.data1) }
+ .got.plt 0 : { *(.got.plt) }
+ .got 0 : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata 0 :
+ {
+ *(.sdata)
+ }
+ .lit8 0 : { *(.lit8) }
+ .lit4 0 : { *(.lit4) }
+ .srdata 0 : { *(.srdata) }
+ .sbss 0 :
+ {
+ *(.dynsbss)
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss 0 :
+ {
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ }
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xs b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xs
new file mode 100644
index 0000000..87a3f6f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xs
@@ -0,0 +1,240 @@
+/* Script for ld --shared: link shared library */
+OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ *(.rel.iplt)
+ }
+ .rela.iplt :
+ {
+ *(.rela.iplt)
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xsc b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xsc
new file mode 100644
index 0000000..4753bb6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xsc
@@ -0,0 +1,239 @@
+/* Script for --shared -z combreloc: shared library, combine & sort relocs */
+OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ *(.rel.iplt)
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ *(.rela.iplt)
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xsw b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xsw
new file mode 100644
index 0000000..95b90c8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xsw
@@ -0,0 +1,239 @@
+/* Script for --shared -z combreloc -z now -z relro: shared library, combine & sort relocs */
+OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ *(.rel.iplt)
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ *(.rela.iplt)
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .got.plt : { *(.got.plt) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xu b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xu
new file mode 100644
index 0000000..c1f660d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xu
@@ -0,0 +1,194 @@
+/* Script for ld -Ur: link w/out relocation, do create constructors */
+OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ /* For some reason, the Solaris linker makes bad executables
+ if gld -r is used and the intermediate file has sections starting
+ at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
+ bug. But for now assigning the zero vmas works. */
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic 0 : { *(.dynamic) }
+ .hash 0 : { *(.hash) }
+ .gnu.hash 0 : { *(.gnu.hash) }
+ .dynsym 0 : { *(.dynsym) }
+ .dynstr 0 : { *(.dynstr) }
+ .gnu.version 0 : { *(.gnu.version) }
+ .gnu.version_d 0: { *(.gnu.version_d) }
+ .gnu.version_r 0: { *(.gnu.version_r) }
+ .rel.init 0 : { *(.rel.init) }
+ .rela.init 0 : { *(.rela.init) }
+ .rel.text 0 : { *(.rel.text) }
+ .rela.text 0 : { *(.rela.text) }
+ .rel.fini 0 : { *(.rel.fini) }
+ .rela.fini 0 : { *(.rela.fini) }
+ .rel.rodata 0 : { *(.rel.rodata) }
+ .rela.rodata 0 : { *(.rela.rodata) }
+ .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) }
+ .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }
+ .rel.data 0 : { *(.rel.data) }
+ .rela.data 0 : { *(.rela.data) }
+ .rel.tdata 0 : { *(.rel.tdata) }
+ .rela.tdata 0 : { *(.rela.tdata) }
+ .rel.tbss 0 : { *(.rel.tbss) }
+ .rela.tbss 0 : { *(.rela.tbss) }
+ .rel.ctors 0 : { *(.rel.ctors) }
+ .rela.ctors 0 : { *(.rela.ctors) }
+ .rel.dtors 0 : { *(.rel.dtors) }
+ .rela.dtors 0 : { *(.rela.dtors) }
+ .rel.got 0 : { *(.rel.got) }
+ .rela.got 0 : { *(.rela.got) }
+ .rel.dyn 0 : { *(.rel.dyn) }
+ .rel.sdata 0 : { *(.rel.sdata) }
+ .rela.sdata 0 : { *(.rela.sdata) }
+ .rel.sbss 0 : { *(.rel.sbss) }
+ .rela.sbss 0 : { *(.rela.sbss) }
+ .rel.sdata2 0 : { *(.rel.sdata2) }
+ .rela.sdata2 0 : { *(.rela.sdata2) }
+ .rel.sbss2 0 : { *(.rel.sbss2) }
+ .rela.sbss2 0 : { *(.rela.sbss2) }
+ .rel.bss 0 : { *(.rel.bss) }
+ .rela.bss 0 : { *(.rela.bss) }
+ .rel.iplt 0 :
+ {
+ *(.rel.iplt)
+ }
+ .rela.iplt 0 :
+ {
+ *(.rela.iplt)
+ }
+ .rel.plt 0 :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt 0 :
+ {
+ *(.rela.plt)
+ }
+ .init 0 :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt 0 : { *(.plt) }
+ .iplt 0 : { *(.iplt) }
+ .text 0 :
+ {
+ *(.text .stub)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0
+ .fini 0 :
+ {
+ KEEP (*(.fini))
+ } =0
+ .rodata 0 : { *(.rodata) }
+ .rodata1 0 : { *(.rodata1) }
+ .sdata2 0 :
+ {
+ *(.sdata2)
+ }
+ .sbss2 0 : { *(.sbss2) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ /* Exception handling */
+ .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata 0 : { *(.tdata) }
+ .tbss 0 : { *(.tbss) }
+ .preinit_array 0 :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array 0 :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array 0 :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .jcr 0 : { KEEP (*(.jcr)) }
+ .data 0 :
+ {
+ *(.data)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 0 : { *(.data1) }
+ .got.plt 0 : { *(.got.plt) }
+ .got 0 : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata 0 :
+ {
+ *(.sdata)
+ }
+ .lit8 0 : { *(.lit8) }
+ .lit4 0 : { *(.lit4) }
+ .srdata 0 : { *(.srdata) }
+ .sbss 0 :
+ {
+ *(.dynsbss)
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss 0 :
+ {
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ }
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xw b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xw
new file mode 100644
index 0000000..2d89785
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64btsmip.xw
@@ -0,0 +1,256 @@
+/* Script for -z combreloc -z now -z relro: combine and sort reloc sections */
+OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x120000000)); . = SEGMENT_START("text-segment", 0x120000000) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .got.plt : { *(.got.plt) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.x b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.x
new file mode 100644
index 0000000..5de11af
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.x
@@ -0,0 +1,253 @@
+/* Default linker script, for normal executables */
+OUTPUT_FORMAT("elf64-tradlittlemips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x120000000)); . = SEGMENT_START("text-segment", 0x120000000) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xbn b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xbn
new file mode 100644
index 0000000..2fd1e5a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xbn
@@ -0,0 +1,251 @@
+/* Script for -N: mix text and data on same page; don't align data */
+OUTPUT_FORMAT("elf64-tradlittlemips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x120000000)); . = SEGMENT_START("text-segment", 0x120000000) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = .;
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xc b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xc
new file mode 100644
index 0000000..9a63006
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xc
@@ -0,0 +1,256 @@
+/* Script for -z combreloc: combine and sort reloc sections */
+OUTPUT_FORMAT("elf64-tradlittlemips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x120000000)); . = SEGMENT_START("text-segment", 0x120000000) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xd b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xd
new file mode 100644
index 0000000..cb66ab2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xd
@@ -0,0 +1,253 @@
+/* Script for ld -pie: link position independent executable */
+OUTPUT_FORMAT("elf64-tradlittlemips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xdc b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xdc
new file mode 100644
index 0000000..4e42c1c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xdc
@@ -0,0 +1,256 @@
+/* Script for -pie -z combreloc: position independent executable, combine & sort relocs */
+OUTPUT_FORMAT("elf64-tradlittlemips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xdw b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xdw
new file mode 100644
index 0000000..1d8ee64
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xdw
@@ -0,0 +1,256 @@
+/* Script for -pie -z combreloc -z now -z relro: position independent executable, combine & sort relocs */
+OUTPUT_FORMAT("elf64-tradlittlemips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .got.plt : { *(.got.plt) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xn b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xn
new file mode 100644
index 0000000..7c7963f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xn
@@ -0,0 +1,253 @@
+/* Script for -n: mix text and data on same page */
+OUTPUT_FORMAT("elf64-tradlittlemips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x120000000)); . = SEGMENT_START("text-segment", 0x120000000) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ }
+ .rela.iplt :
+ {
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xr b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xr
new file mode 100644
index 0000000..2d4bec3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xr
@@ -0,0 +1,193 @@
+/* Script for ld -r: link without relocation */
+OUTPUT_FORMAT("elf64-tradlittlemips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ /* For some reason, the Solaris linker makes bad executables
+ if gld -r is used and the intermediate file has sections starting
+ at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
+ bug. But for now assigning the zero vmas works. */
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic 0 : { *(.dynamic) }
+ .hash 0 : { *(.hash) }
+ .gnu.hash 0 : { *(.gnu.hash) }
+ .dynsym 0 : { *(.dynsym) }
+ .dynstr 0 : { *(.dynstr) }
+ .gnu.version 0 : { *(.gnu.version) }
+ .gnu.version_d 0: { *(.gnu.version_d) }
+ .gnu.version_r 0: { *(.gnu.version_r) }
+ .rel.init 0 : { *(.rel.init) }
+ .rela.init 0 : { *(.rela.init) }
+ .rel.text 0 : { *(.rel.text) }
+ .rela.text 0 : { *(.rela.text) }
+ .rel.fini 0 : { *(.rel.fini) }
+ .rela.fini 0 : { *(.rela.fini) }
+ .rel.rodata 0 : { *(.rel.rodata) }
+ .rela.rodata 0 : { *(.rela.rodata) }
+ .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) }
+ .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }
+ .rel.data 0 : { *(.rel.data) }
+ .rela.data 0 : { *(.rela.data) }
+ .rel.tdata 0 : { *(.rel.tdata) }
+ .rela.tdata 0 : { *(.rela.tdata) }
+ .rel.tbss 0 : { *(.rel.tbss) }
+ .rela.tbss 0 : { *(.rela.tbss) }
+ .rel.ctors 0 : { *(.rel.ctors) }
+ .rela.ctors 0 : { *(.rela.ctors) }
+ .rel.dtors 0 : { *(.rel.dtors) }
+ .rela.dtors 0 : { *(.rela.dtors) }
+ .rel.got 0 : { *(.rel.got) }
+ .rela.got 0 : { *(.rela.got) }
+ .rel.dyn 0 : { *(.rel.dyn) }
+ .rel.sdata 0 : { *(.rel.sdata) }
+ .rela.sdata 0 : { *(.rela.sdata) }
+ .rel.sbss 0 : { *(.rel.sbss) }
+ .rela.sbss 0 : { *(.rela.sbss) }
+ .rel.sdata2 0 : { *(.rel.sdata2) }
+ .rela.sdata2 0 : { *(.rela.sdata2) }
+ .rel.sbss2 0 : { *(.rel.sbss2) }
+ .rela.sbss2 0 : { *(.rela.sbss2) }
+ .rel.bss 0 : { *(.rel.bss) }
+ .rela.bss 0 : { *(.rela.bss) }
+ .rel.iplt 0 :
+ {
+ *(.rel.iplt)
+ }
+ .rela.iplt 0 :
+ {
+ *(.rela.iplt)
+ }
+ .rel.plt 0 :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt 0 :
+ {
+ *(.rela.plt)
+ }
+ .init 0 :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt 0 : { *(.plt) }
+ .iplt 0 : { *(.iplt) }
+ .text 0 :
+ {
+ *(.text .stub)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0
+ .fini 0 :
+ {
+ KEEP (*(.fini))
+ } =0
+ .rodata 0 : { *(.rodata) }
+ .rodata1 0 : { *(.rodata1) }
+ .sdata2 0 :
+ {
+ *(.sdata2)
+ }
+ .sbss2 0 : { *(.sbss2) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ /* Exception handling */
+ .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata 0 : { *(.tdata) }
+ .tbss 0 : { *(.tbss) }
+ .preinit_array 0 :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array 0 :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array 0 :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .jcr 0 : { KEEP (*(.jcr)) }
+ .data 0 :
+ {
+ *(.data)
+ }
+ .data1 0 : { *(.data1) }
+ .got.plt 0 : { *(.got.plt) }
+ .got 0 : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata 0 :
+ {
+ *(.sdata)
+ }
+ .lit8 0 : { *(.lit8) }
+ .lit4 0 : { *(.lit4) }
+ .srdata 0 : { *(.srdata) }
+ .sbss 0 :
+ {
+ *(.dynsbss)
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss 0 :
+ {
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ }
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xs b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xs
new file mode 100644
index 0000000..21f11dc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xs
@@ -0,0 +1,240 @@
+/* Script for ld --shared: link shared library */
+OUTPUT_FORMAT("elf64-tradlittlemips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
+ .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.dyn : { *(.rel.dyn) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.iplt :
+ {
+ *(.rel.iplt)
+ }
+ .rela.iplt :
+ {
+ *(.rela.iplt)
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xsc b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xsc
new file mode 100644
index 0000000..602511c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xsc
@@ -0,0 +1,239 @@
+/* Script for --shared -z combreloc: shared library, combine & sort relocs */
+OUTPUT_FORMAT("elf64-tradlittlemips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ *(.rel.iplt)
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ *(.rela.iplt)
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .got.plt : { *(.got.plt) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xsw b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xsw
new file mode 100644
index 0000000..172edc8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xsw
@@ -0,0 +1,239 @@
+/* Script for --shared -z combreloc -z now -z relro: shared library, combine & sort relocs */
+OUTPUT_FORMAT("elf64-tradlittlemips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ *(.rel.iplt)
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ *(.rela.iplt)
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .got.plt : { *(.got.plt) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xu b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xu
new file mode 100644
index 0000000..7a7c6cc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xu
@@ -0,0 +1,194 @@
+/* Script for ld -Ur: link w/out relocation, do create constructors */
+OUTPUT_FORMAT("elf64-tradlittlemips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ /* For some reason, the Solaris linker makes bad executables
+ if gld -r is used and the intermediate file has sections starting
+ at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
+ bug. But for now assigning the zero vmas works. */
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic 0 : { *(.dynamic) }
+ .hash 0 : { *(.hash) }
+ .gnu.hash 0 : { *(.gnu.hash) }
+ .dynsym 0 : { *(.dynsym) }
+ .dynstr 0 : { *(.dynstr) }
+ .gnu.version 0 : { *(.gnu.version) }
+ .gnu.version_d 0: { *(.gnu.version_d) }
+ .gnu.version_r 0: { *(.gnu.version_r) }
+ .rel.init 0 : { *(.rel.init) }
+ .rela.init 0 : { *(.rela.init) }
+ .rel.text 0 : { *(.rel.text) }
+ .rela.text 0 : { *(.rela.text) }
+ .rel.fini 0 : { *(.rel.fini) }
+ .rela.fini 0 : { *(.rela.fini) }
+ .rel.rodata 0 : { *(.rel.rodata) }
+ .rela.rodata 0 : { *(.rela.rodata) }
+ .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) }
+ .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }
+ .rel.data 0 : { *(.rel.data) }
+ .rela.data 0 : { *(.rela.data) }
+ .rel.tdata 0 : { *(.rel.tdata) }
+ .rela.tdata 0 : { *(.rela.tdata) }
+ .rel.tbss 0 : { *(.rel.tbss) }
+ .rela.tbss 0 : { *(.rela.tbss) }
+ .rel.ctors 0 : { *(.rel.ctors) }
+ .rela.ctors 0 : { *(.rela.ctors) }
+ .rel.dtors 0 : { *(.rel.dtors) }
+ .rela.dtors 0 : { *(.rela.dtors) }
+ .rel.got 0 : { *(.rel.got) }
+ .rela.got 0 : { *(.rela.got) }
+ .rel.dyn 0 : { *(.rel.dyn) }
+ .rel.sdata 0 : { *(.rel.sdata) }
+ .rela.sdata 0 : { *(.rela.sdata) }
+ .rel.sbss 0 : { *(.rel.sbss) }
+ .rela.sbss 0 : { *(.rela.sbss) }
+ .rel.sdata2 0 : { *(.rel.sdata2) }
+ .rela.sdata2 0 : { *(.rela.sdata2) }
+ .rel.sbss2 0 : { *(.rel.sbss2) }
+ .rela.sbss2 0 : { *(.rela.sbss2) }
+ .rel.bss 0 : { *(.rel.bss) }
+ .rela.bss 0 : { *(.rela.bss) }
+ .rel.iplt 0 :
+ {
+ *(.rel.iplt)
+ }
+ .rela.iplt 0 :
+ {
+ *(.rela.iplt)
+ }
+ .rel.plt 0 :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt 0 :
+ {
+ *(.rela.plt)
+ }
+ .init 0 :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt 0 : { *(.plt) }
+ .iplt 0 : { *(.iplt) }
+ .text 0 :
+ {
+ *(.text .stub)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0
+ .fini 0 :
+ {
+ KEEP (*(.fini))
+ } =0
+ .rodata 0 : { *(.rodata) }
+ .rodata1 0 : { *(.rodata1) }
+ .sdata2 0 :
+ {
+ *(.sdata2)
+ }
+ .sbss2 0 : { *(.sbss2) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ /* Exception handling */
+ .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata 0 : { *(.tdata) }
+ .tbss 0 : { *(.tbss) }
+ .preinit_array 0 :
+ {
+ KEEP (*(.preinit_array))
+ }
+ .init_array 0 :
+ {
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ }
+ .fini_array 0 :
+ {
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ }
+ .jcr 0 : { KEEP (*(.jcr)) }
+ .data 0 :
+ {
+ *(.data)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 0 : { *(.data1) }
+ .got.plt 0 : { *(.got.plt) }
+ .got 0 : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata 0 :
+ {
+ *(.sdata)
+ }
+ .lit8 0 : { *(.lit8) }
+ .lit4 0 : { *(.lit4) }
+ .srdata 0 : { *(.srdata) }
+ .sbss 0 :
+ {
+ *(.dynsbss)
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss 0 :
+ {
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ }
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xw b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xw
new file mode 100644
index 0000000..a6724dd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/ldscripts/elf64ltsmip.xw
@@ -0,0 +1,256 @@
+/* Script for -z combreloc -z now -z relro: combine and sort reloc sections */
+OUTPUT_FORMAT("elf64-tradlittlemips", "elf64-tradbigmips",
+ "elf64-tradlittlemips")
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SEARCH_DIR("/usr/mips-linux-uclibc/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x120000000)); . = SEGMENT_START("text-segment", 0x120000000) + SIZEOF_HEADERS;
+ .MIPS.options : { *(.MIPS.options) }
+ .note.gnu.build-id : { *(.note.gnu.build-id) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.dyn)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rela.fini)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rela.ctors)
+ *(.rela.dtors)
+ *(.rela.got)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
+ .rel.plt :
+ {
+ *(.rel.plt)
+ }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ .text :
+ {
+ _ftext = . ;
+ *(.text.unlikely .text.*_unlikely)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.mips16.fn.*) *(.mips16.call.*)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 :
+ {
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE_HIDDEN (__init_array_end = .);
+ }
+ .fini_array :
+ {
+ PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ PROVIDE_HIDDEN (__fini_array_end = .);
+ }
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ /* We don't want to include the .ctor section from
+ the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
+ .got.plt : { *(.got.plt) }
+ . = DATA_SEGMENT_RELRO_END (0, .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ . = .;
+ _gp = ALIGN(16) + 0x7ff0;
+ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata :
+ {
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
+ .srdata : { *(.srdata) }
+ _edata = .; PROVIDE (edata = .);
+ __bss_start = .;
+ _fbss = .;
+ .sbss :
+ {
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we don't
+ pad the .data section. */
+ . = ALIGN(. != 0 ? 64 / 8 : 1);
+ }
+ . = ALIGN(64 / 8);
+ . = ALIGN(64 / 8);
+ _end = .; PROVIDE (end = .);
+ . = DATA_SEGMENT_END (.);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* DWARF 3 */
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }
+ .debug_ranges 0 : { *(.debug_ranges) }
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libc.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libc.a
new file mode 100644
index 0000000..9454daa
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libc.a
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libc.so b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libc.so
new file mode 100644
index 0000000..d4198c8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libc.so
@@ -0,0 +1,4 @@
+/* GNU ld script
+ * Use the shared library, but some functions are only in
+ * the static library, so try that secondarily. */
+GROUP ( /lib/libc.so.0 /usr/lib/uclibc_nonshared.a )
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libc_pic.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libc_pic.a
new file mode 120000
index 0000000..f65e590
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libc_pic.a
@@ -0,0 +1 @@
+libc.a \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libcrypt.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libcrypt.a
new file mode 100644
index 0000000..1fe2152
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libcrypt.a
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libcrypt.so b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libcrypt.so
new file mode 120000
index 0000000..4273571
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libcrypt.so
@@ -0,0 +1 @@
+../../lib/libcrypt.so.0 \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libcrypt_pic.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libcrypt_pic.a
new file mode 120000
index 0000000..a3d3a43
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libcrypt_pic.a
@@ -0,0 +1 @@
+libcrypt.a \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libdl.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libdl.a
new file mode 100644
index 0000000..67a4094
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libdl.a
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libdl.so b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libdl.so
new file mode 120000
index 0000000..f648150
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libdl.so
@@ -0,0 +1 @@
+../../lib/libdl.so.0 \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libdl_pic.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libdl_pic.a
new file mode 120000
index 0000000..71f60a9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libdl_pic.a
@@ -0,0 +1 @@
+libdl.a \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libiberty.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libiberty.a
new file mode 100644
index 0000000..b571868
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libiberty.a
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libm.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libm.a
new file mode 100644
index 0000000..04eacdc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libm.a
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libm.so b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libm.so
new file mode 120000
index 0000000..8d5c614
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libm.so
@@ -0,0 +1 @@
+../../lib/libm.so.0 \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libm_pic.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libm_pic.a
new file mode 120000
index 0000000..48b3529
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libm_pic.a
@@ -0,0 +1 @@
+libm.a \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libnsl.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libnsl.a
new file mode 100644
index 0000000..3fc4853
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libnsl.a
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libnsl.so b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libnsl.so
new file mode 120000
index 0000000..b4a0866
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libnsl.so
@@ -0,0 +1 @@
+../../lib/libnsl.so.0 \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libnsl_pic.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libnsl_pic.a
new file mode 120000
index 0000000..b93e985
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libnsl_pic.a
@@ -0,0 +1 @@
+libnsl.a \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libpthread.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libpthread.a
new file mode 100644
index 0000000..e972298
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libpthread.a
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libpthread.so b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libpthread.so
new file mode 120000
index 0000000..57f4003
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libpthread.so
@@ -0,0 +1 @@
+../../lib/libpthread.so.0 \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libpthread_pic.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libpthread_pic.a
new file mode 120000
index 0000000..ec8b05e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libpthread_pic.a
@@ -0,0 +1 @@
+libpthread.a \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libresolv.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libresolv.a
new file mode 100644
index 0000000..d4326c5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libresolv.a
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libresolv.so b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libresolv.so
new file mode 120000
index 0000000..f5b11fc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libresolv.so
@@ -0,0 +1 @@
+../../lib/libresolv.so.0 \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libresolv_pic.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libresolv_pic.a
new file mode 120000
index 0000000..913ff29
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libresolv_pic.a
@@ -0,0 +1 @@
+libresolv.a \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/librt.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/librt.a
new file mode 100644
index 0000000..ee8fc4d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/librt.a
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/librt.so b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/librt.so
new file mode 120000
index 0000000..b7dd09d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/librt.so
@@ -0,0 +1 @@
+../../lib/librt.so.0 \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/librt_pic.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/librt_pic.a
new file mode 120000
index 0000000..a16ea64
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/librt_pic.a
@@ -0,0 +1 @@
+librt.a \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libthread_db.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libthread_db.a
new file mode 100644
index 0000000..ad01fa6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libthread_db.a
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libthread_db.so b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libthread_db.so
new file mode 120000
index 0000000..e05f68f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libthread_db.so
@@ -0,0 +1 @@
+../../lib/libthread_db.so.1 \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libthread_db_pic.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libthread_db_pic.a
new file mode 120000
index 0000000..a3646a9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libthread_db_pic.a
@@ -0,0 +1 @@
+libthread_db.a \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libutil.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libutil.a
new file mode 100644
index 0000000..705d1e4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libutil.a
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libutil.so b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libutil.so
new file mode 120000
index 0000000..5b10356
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libutil.so
@@ -0,0 +1 @@
+../../lib/libutil.so.0 \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libutil_pic.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libutil_pic.a
new file mode 120000
index 0000000..8e31bc6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/libutil_pic.a
@@ -0,0 +1 @@
+libutil.a \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/lib/uclibc_nonshared.a b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/uclibc_nonshared.a
new file mode 100644
index 0000000..6c24016
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/lib/uclibc_nonshared.a
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/cc1 b/uclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/cc1
new file mode 100755
index 0000000..d123697
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/cc1
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/cc1plus b/uclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/cc1plus
new file mode 100755
index 0000000..6bb99e6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/cc1plus
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/collect2 b/uclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/collect2
new file mode 100755
index 0000000..eeec337
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/collect2
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/install-tools/fixinc.sh b/uclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/install-tools/fixinc.sh
new file mode 100755
index 0000000..e73aed9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/install-tools/fixinc.sh
@@ -0,0 +1,498 @@
+#!/bin/sh
+#
+# Install modified versions of certain ANSI-incompatible system header
+# files which are fixed to work correctly with ANSI C and placed in a
+# directory that GCC will search.
+#
+# See README-fixinc for more information.
+#
+# fixincludes copyright (c) 1998, 1999, 2000, 2002, 2009
+# The Free Software Foundation, Inc.
+#
+# fixincludes is free software.
+#
+# You may redistribute it and/or modify it under the terms of the
+# GNU General Public License, as published by the Free Software
+# Foundation; either version 3, or (at your option) any later version.
+#
+# fixincludes is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with fixincludes; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+#
+# # # # # # # # # # # # # # # # # # # # #
+
+# Usage: fixinc.sh output-dir input-dir
+#
+# Directory in which to store the results.
+# Fail if no arg to specify a directory for the output.
+if [ "x$1" = "x" ]
+then
+ echo fixincludes: no output directory specified
+ exit 1
+fi
+
+LIB=${1}
+shift
+
+# Make sure it exists.
+if [ ! -d $LIB ]; then
+ mkdir $LIB || {
+ echo fixincludes: output dir '`'$LIB"' cannot be created"
+ exit 1
+ }
+else
+ ( cd $LIB && touch DONE && rm DONE ) || {
+ echo fixincludes: output dir '`'$LIB"' is an invalid directory"
+ exit 1
+ }
+fi
+
+if test -z "$VERBOSE"
+then
+ VERBOSE=2
+ export VERBOSE
+else
+ case "$VERBOSE" in
+ [0-9] ) : ;;
+ * ) VERBOSE=3 ;;
+ esac
+fi
+
+# Define what target system we're fixing.
+#
+if test -r ./Makefile; then
+ target_canonical="`sed -n -e 's,^target[ ]*=[ ]*\(.*\)$,\1,p' < Makefile`"
+fi
+
+# If not from the Makefile, then try config.guess
+#
+if test -z "${target_canonical}" ; then
+ if test -x ./config.guess ; then
+ target_canonical="`config.guess`" ; fi
+ test -z "${target_canonical}" && target_canonical=unknown
+fi
+export target_canonical
+
+# # # # # # # # # # # # # # # # # # # # #
+#
+# Define PWDCMD as a command to use to get the working dir
+# in the form that we want.
+PWDCMD=${PWDCMD-pwd}
+
+case "`$PWDCMD`" in
+//*)
+ # On an Apollo, discard everything before `/usr'.
+ PWDCMD="eval pwd | sed -e 's,.*/usr/,/usr/,'"
+ ;;
+esac
+
+# Original directory.
+ORIGDIR=`${PWDCMD}`
+export ORIGDIR
+FIXINCL=`${PWDCMD}`/fixincl
+if [ ! -x $FIXINCL ] ; then
+ echo "Cannot find fixincl" >&2
+ exit 1
+fi
+export FIXINCL
+
+# Make LIB absolute only if needed to avoid problems with the amd.
+case $LIB in
+/*)
+ ;;
+*)
+ cd $LIB; LIB=`${PWDCMD}`
+ ;;
+esac
+
+if test $VERBOSE -gt 0
+then echo Fixing headers into ${LIB} for ${target_canonical} target ; fi
+
+# Determine whether this system has symbolic links.
+if test -n "$DJDIR"; then
+ LINKS=false
+elif ln -s X $LIB/ShouldNotExist 2>/dev/null; then
+ rm -f $LIB/ShouldNotExist
+ LINKS=true
+elif ln -s X /tmp/ShouldNotExist 2>/dev/null; then
+ rm -f /tmp/ShouldNotExist
+ LINKS=true
+else
+ LINKS=false
+fi
+
+# # # # # # # # # # # # # # # # # # # # #
+#
+# In the file macro_list are listed all the predefined
+# macros that are not in the C89 reserved namespace (the reserved
+# namespace is all identifiers beginnning with two underscores or one
+# underscore followed by a capital letter). A regular expression to find
+# any of those macros in a header file is written to MN_NAME_PAT.
+#
+# Note dependency on ASCII. \012 = newline.
+# tr ' ' '\n' is, alas, not portable.
+
+if test -s ${MACRO_LIST}
+then
+ if test $VERBOSE -gt 0; then
+ echo "Forbidden identifiers: `tr '\012' ' ' < ${MACRO_LIST}`"
+ fi
+ MN_NAME_PAT="`sed 's/^/\\\\</; s/$/\\\\>/; $!s/$/|/' \
+ < ${MACRO_LIST} | tr -d '\012'`"
+ export MN_NAME_PAT
+else
+ if test $VERBOSE -gt 0
+ then echo "No forbidden identifiers defined by this target" ; fi
+fi
+
+# # # # # # # # # # # # # # # # # # # # #
+#
+# Search each input directory for broken header files.
+# This loop ends near the end of the file.
+#
+if test $# -eq 0
+then
+ INPUTLIST="/usr/include"
+else
+ INPUTLIST="$@"
+fi
+
+for INPUT in ${INPUTLIST} ; do
+
+cd ${ORIGDIR}
+
+# Make sure a directory exists before changing into it,
+# otherwise Solaris2 will fail-exit the script.
+#
+if [ ! -d ${INPUT} ]; then
+ continue
+fi
+cd ${INPUT}
+
+INPUT=`${PWDCMD}`
+export INPUT
+
+#
+# # # # # # # # # # # # # # # # # # # # #
+#
+if test $VERBOSE -gt 1
+then echo Finding directories and links to directories ; fi
+
+# Find all directories and all symlinks that point to directories.
+# Put the list in $all_dirs.
+# Each time we find a symlink, add it to newdirs
+# so that we do another find within the dir the link points to.
+# Note that $all_dirs may have duplicates in it;
+# later parts of this file are supposed to ignore them.
+dirs="."
+levels=2
+all_dirs=""
+search_dirs=""
+
+while [ -n "$dirs" ] && [ $levels -gt 0 ]
+do
+ levels=`expr $levels - 1`
+ newdirs=
+ for d in $dirs
+ do
+ if test $VERBOSE -gt 1
+ then echo " Searching $INPUT/$d" ; fi
+
+ # Find all directories under $d, relative to $d, excluding $d itself.
+ # (The /. is needed after $d in case $d is a symlink.)
+ all_dirs="$all_dirs `find $d/. -type d -print | \
+ sed -e '/\/\.$/d' -e 's@/./@/@g'`"
+ # Find all links to directories.
+ # Using `-exec test -d' in find fails on some systems,
+ # and trying to run test via sh fails on others,
+ # so this is the simplest alternative left.
+ # First find all the links, then test each one.
+ theselinks=
+ $LINKS && \
+ theselinks=`find $d/. -type l -print | sed -e 's@/./@/@g'`
+ for d1 in $theselinks --dummy--
+ do
+ # If the link points to a directory,
+ # add that dir to $newdirs
+ if [ -d $d1 ]
+ then
+ all_dirs="$all_dirs $d1"
+ if [ "`ls -ld $d1 | sed -n 's/.*-> //p'`" != "." ]
+ then
+ newdirs="$newdirs $d1"
+ search_dirs="$search_dirs $d1"
+ fi
+ fi
+ done
+ done
+
+ dirs="$newdirs"
+done
+
+# # # # # # # # # # # # # # # # # # # # #
+#
+dirs=
+if test $VERBOSE -gt 2
+then echo "All directories (including links to directories):"
+ echo $all_dirs
+fi
+
+for file in $all_dirs; do
+ rm -rf $LIB/$file
+ if [ ! -d $LIB/$file ]
+ then mkdir $LIB/$file
+ fi
+done
+mkdir $LIB/root
+
+# # # # # # # # # # # # # # # # # # # # #
+#
+# treetops gets an alternating list
+# of old directories to copy
+# and the new directories to copy to.
+treetops=". ${LIB}"
+
+if $LINKS; then
+ if test $VERBOSE -gt 1
+ then echo 'Making symbolic directory links' ; fi
+ cwd=`${PWDCMD}`
+
+ for sym_link in $search_dirs; do
+ cd ${INPUT}
+ dest=`ls -ld ${sym_link} | sed -n 's/.*-> //p'`
+
+ # In case $dest is relative, get to ${sym_link}'s dir first.
+ #
+ cd ./`echo ${sym_link} | sed 's;/[^/]*$;;'`
+
+ # Check that the target directory exists.
+ # Redirections changed to avoid bug in sh on Ultrix.
+ #
+ (cd $dest) > /dev/null 2>&1
+ if [ $? = 0 ]; then
+ cd $dest
+
+ # full_dest_dir gets the dir that the link actually leads to.
+ #
+ full_dest_dir=`${PWDCMD}`
+
+ # Canonicalize ${INPUT} now to minimize the time an
+ # automounter has to change the result of ${PWDCMD}.
+ #
+ cinput=`cd ${INPUT}; ${PWDCMD}`
+
+ # If a link points to ., make a similar link to .
+ #
+ if [ ${full_dest_dir} = ${cinput} ]; then
+ if test $VERBOSE -gt 2
+ then echo ${sym_link} '->' . ': Making self link' ; fi
+ rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
+ ln -s . ${LIB}/${sym_link} > /dev/null 2>&1
+
+ # If link leads back into ${INPUT},
+ # make a similar link here.
+ #
+ elif expr ${full_dest_dir} : "${cinput}/.*" > /dev/null; then
+ # Y gets the actual target dir name, relative to ${INPUT}.
+ y=`echo ${full_dest_dir} | sed -n "s&${cinput}/&&p"`
+ # DOTS is the relative path from ${LIB}/${sym_link} back to ${LIB}.
+ dots=`echo "${sym_link}" |
+ sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'`
+ if test $VERBOSE -gt 2
+ then echo ${sym_link} '->' $dots$y ': Making local link' ; fi
+ rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
+ ln -s $dots$y ${LIB}/${sym_link} > /dev/null 2>&1
+
+ else
+ # If the link is to a dir $target outside ${INPUT},
+ # repoint the link at ${INPUT}/root$target
+ # and process $target into ${INPUT}/root$target
+ # treat this directory as if it actually contained the files.
+ #
+ if test $VERBOSE -gt 2
+ then echo ${sym_link} '->' root${full_dest_dir} ': Making rooted link'
+ fi
+ if [ -d $LIB/root${full_dest_dir} ]
+ then true
+ else
+ dirname=root${full_dest_dir}/
+ dirmade=.
+ cd $LIB
+ while [ x$dirname != x ]; do
+ component=`echo $dirname | sed -e 's|/.*$||'`
+ mkdir $component >/dev/null 2>&1
+ cd $component
+ dirmade=$dirmade/$component
+ dirname=`echo $dirname | sed -e 's|[^/]*/||'`
+ done
+ fi
+
+ # Duplicate directory structure created in ${LIB}/${sym_link} in new
+ # root area.
+ #
+ for file2 in $all_dirs; do
+ case $file2 in
+ ${sym_link}/*)
+ dupdir=${LIB}/root${full_dest_dir}/`echo $file2 |
+ sed -n "s|^${sym_link}/||p"`
+ if test $VERBOSE -gt 2
+ then echo "Duplicating ${sym_link}'s ${dupdir}" ; fi
+ if [ -d ${dupdir} ]
+ then true
+ else
+ mkdir ${dupdir}
+ fi
+ ;;
+ *)
+ ;;
+ esac
+ done
+
+ # Get the path from ${LIB} to ${sym_link}, accounting for symlinks.
+ #
+ parent=`echo "${sym_link}" | sed -e 's@/[^/]*$@@'`
+ libabs=`cd ${LIB}; ${PWDCMD}`
+ file2=`cd ${LIB}; cd $parent; ${PWDCMD} | sed -e "s@^${libabs}@@"`
+
+ # DOTS is the relative path from ${LIB}/${sym_link} back to ${LIB}.
+ #
+ dots=`echo "$file2" | sed -e 's@/[^/]*@../@g'`
+ rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
+ ln -s ${dots}root${full_dest_dir} ${LIB}/${sym_link} > /dev/null 2>&1
+ treetops="$treetops ${sym_link} ${LIB}/root${full_dest_dir}"
+ fi
+ fi
+ done
+fi
+
+# # # # # # # # # # # # # # # # # # # # #
+#
+required=
+set x $treetops
+shift
+while [ $# != 0 ]; do
+ # $1 is an old directory to copy, and $2 is the new directory to copy to.
+ #
+ SRCDIR=`cd ${INPUT} ; cd $1 ; ${PWDCMD}`
+ export SRCDIR
+
+ FIND_BASE=$1
+ export FIND_BASE
+ shift
+
+ DESTDIR=`cd $1;${PWDCMD}`
+ export DESTDIR
+ shift
+
+ # The same dir can appear more than once in treetops.
+ # There's no need to scan it more than once.
+ #
+ if [ -f ${DESTDIR}/DONE ]
+ then continue ; fi
+
+ touch ${DESTDIR}/DONE
+ if test $VERBOSE -gt 1
+ then echo Fixing directory ${SRCDIR} into ${DESTDIR} ; fi
+
+ # Check files which are symlinks as well as those which are files.
+ #
+ cd ${INPUT}
+ required="$required `if $LINKS; then
+ find ${FIND_BASE}/. -name '*.h' \( -type f -o -type l \) -print
+ else
+ find ${FIND_BASE}/. -name '*.h' -type f -print
+ fi | \
+ sed -e 's;/\./;/;g' -e 's;//*;/;g' | \
+ ${FIXINCL}`"
+done
+
+## Make sure that any include files referenced using double quotes
+## exist in the fixed directory. This comes last since otherwise
+## we might end up deleting some of these files "because they don't
+## need any change."
+set x `echo $required`
+shift
+while [ $# != 0 ]; do
+ newreq=
+ while [ $# != 0 ]; do
+ # $1 is the directory to copy from,
+ # $2 is the unfixed file,
+ # $3 is the fixed file name.
+ #
+ cd ${INPUT}
+ cd $1
+ if [ -f $2 ] ; then
+ if [ -r $2 ] && [ ! -r $3 ]; then
+ cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2" >&2
+ chmod +w $3 2>/dev/null
+ chmod a+r $3 2>/dev/null
+ if test $VERBOSE -gt 2
+ then echo Copied $2 ; fi
+ for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $3 |
+ sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`
+ do
+ dir=`echo $2 | sed -e s'|/[^/]*$||'`
+ dir2=`echo $3 | sed -e s'|/[^/]*$||'`
+ newreq="$newreq $1 $dir/$include $dir2/$include"
+ done
+ fi
+ fi
+ shift; shift; shift
+ done
+ set x $newreq
+ shift
+done
+
+if test $VERBOSE -gt 2
+then echo 'Cleaning up DONE files.' ; fi
+cd $LIB
+# Look for files case-insensitively, for the benefit of
+# DOS/Windows filesystems.
+find . -name '[Dd][Oo][Nn][Ee]' -exec rm -f '{}' ';'
+
+if test $VERBOSE -gt 1
+then echo 'Cleaning up unneeded directories:' ; fi
+cd $LIB
+all_dirs=`find . -type d \! -name '.' -print | sort -r`
+for file in $all_dirs; do
+ if rmdir $LIB/$file > /dev/null
+ then
+ test $VERBOSE -gt 3 && echo " removed $file"
+ fi
+done 2> /dev/null
+
+# On systems which don't support symlinks, `find' may barf
+# if called with "-type l" predicate. So only use that if
+# we know we should look for symlinks.
+if $LINKS; then
+ test $VERBOSE -gt 2 && echo "Removing unused symlinks"
+
+ all_dirs=`find . -type l -print`
+ for file in $all_dirs
+ do
+ if test ! -d $file
+ then
+ rm -f $file
+ test $VERBOSE -gt 3 && echo " removed $file"
+ rmdir `dirname $file` > /dev/null && \
+ test $VERBOSE -gt 3 && \
+ echo " removed `dirname $file`"
+ fi
+ done 2> /dev/null
+fi
+
+if test $VERBOSE -gt 0
+then echo fixincludes is done ; fi
+
+# # # # # # # # # # # # # # # # # # # # #
+#
+# End of for INPUT directories
+#
+done
+#
+# # # # # # # # # # # # # # # # # # # # #
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/install-tools/fixincl b/uclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/install-tools/fixincl
new file mode 100755
index 0000000..e5b9369
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/install-tools/fixincl
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/install-tools/mkheaders b/uclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/install-tools/mkheaders
new file mode 100755
index 0000000..b7fba43
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/install-tools/mkheaders
@@ -0,0 +1,109 @@
+#!/bin/sh
+
+# Copyright (C) 2002, 2007, 2009 Free Software Foundation, Inc.
+
+#This file is part of GCC.
+
+#GCC is free software; you can redistribute it and/or modify it under
+#the terms of the GNU General Public License as published by the Free
+#Software Foundation; either version 3, or (at your option) any later
+#version.
+
+#GCC is distributed in the hope that it will be useful, but WITHOUT
+#ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+#FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+#for more details.
+
+#You should have received a copy of the GNU General Public License
+#along with GCC; see the file COPYING3. If not see
+#<http://www.gnu.org/licenses/>.
+
+# Basic information
+target=mips-unknown-linux-uclibc
+target_noncanonical=mips-linux-uclibc
+version=4.4.2
+
+VERBOSE=0
+while [ x$1 = x-v ] ; do
+ shift
+ VERBOSE=`expr $VERBOSE + 1`
+done
+export VERBOSE
+
+if [ x$1 = x--help ] ; then
+ echo "Usage: mkheaders [options] [prefix [isysroot]]"
+ echo "Options:"
+ echo " -v Print more output (may be repeated for even more output)"
+ echo " --help This help"
+ echo " --version Print version information"
+ exit 0
+fi
+
+if [ x$1 = x--version ] ; then
+ echo "mkheaders (GCC) version $version"
+ echo "Copyright 2002, 2007 Free Software Foundation, Inc."
+ echo "This program is free software; you may redistribute it under the"
+ echo "terms of the GNU General Public License. This program has"
+ echo "absolutely no warranty."
+ exit 0
+fi
+
+# Common prefix for installation directories.
+if [ x$1 != x ] ; then
+ prefix=$1
+ shift
+else
+ prefix=/usr
+fi
+
+# Allow for alternate isysroot in which to find headers
+if [ x$1 != x ] ; then
+ isysroot=$1
+ shift
+else
+ isysroot=
+fi
+
+# Directory in which to put host dependent programs and libraries
+exec_prefix=${prefix}
+# Directory in which to put the directories used by the compiler.
+libdir=${exec_prefix}/lib
+libexecdir=${exec_prefix}/libexec
+# Directory in which the compiler finds libraries, etc.
+libsubdir=${libdir}/gcc/${target_noncanonical}/${version}
+# Directory in which the compiler finds executables
+libexecsubdir=${libexecdir}/gcc/${target_noncanonical}/${version}
+
+itoolsdir=${libexecsubdir}/install-tools
+itoolsdatadir=${libsubdir}/install-tools
+incdir=${libsubdir}/include-fixed
+mkinstalldirs="/bin/sh ${itoolsdir}/mkinstalldirs"
+
+cd ${itoolsdir}
+rm -rf ${incdir}/*
+
+for ml in `cat ${itoolsdatadir}/fixinc_list`; do
+ sysroot_headers_suffix=`echo ${ml} | sed -e 's/;.*$//'`
+ multi_dir=`echo ${ml} | sed -e 's/^[^;]*;//'`
+ subincdir=${incdir}${multi_dir}
+ . ${itoolsdatadir}/mkheaders.conf
+ if [ x${STMP_FIXINC} != x ] ; then
+ TARGET_MACHINE="${target}" target_canonical="${target}" \
+ MACRO_LIST="${itoolsdatadir}/macro_list" \
+ /bin/sh ./fixinc.sh ${subincdir} \
+ ${isysroot}${SYSTEM_HEADER_DIR} ${OTHER_FIXINCLUDES_DIRS}
+ rm -f ${subincdir}/syslimits.h
+ if [ -f ${subincdir}/limits.h ]; then
+ mv ${subincdir}/limits.h ${subincdir}/syslimits.h
+ else
+ cp ${itoolsdatadir}/gsyslimits.h ${subincdir}/syslimits.h
+ fi
+ fi
+
+ cp ${itoolsdatadir}/include${multi_dir}/limits.h ${subincdir}
+
+ if [ x${STMP_FIXPROTO} != x ] ; then
+ export FIXPROTO_DEFINES mkinstalldirs
+ /bin/sh fixproto ${subincdir} ${subincdir} ${isysroot}${SYSTEM_HEADER_DIR} || exit 1
+ fi
+done
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/install-tools/mkinstalldirs b/uclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/install-tools/mkinstalldirs
new file mode 100755
index 0000000..259dbfc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/libexec/gcc/mips-linux-uclibc/4.4.2/install-tools/mkinstalldirs
@@ -0,0 +1,158 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+
+scriptversion=2005-06-29.22
+
+# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+errstatus=0
+dirmode=
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <bug-automake@gnu.org>."
+
+# process command line arguments
+while test $# -gt 0 ; do
+ case $1 in
+ -h | --help | --h*) # -h for help
+ echo "$usage"
+ exit $?
+ ;;
+ -m) # -m PERM arg
+ shift
+ test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+ dirmode=$1
+ shift
+ ;;
+ --version)
+ echo "$0 $scriptversion"
+ exit $?
+ ;;
+ --) # stop option processing
+ shift
+ break
+ ;;
+ -*) # unknown option
+ echo "$usage" 1>&2
+ exit 1
+ ;;
+ *) # first non-opt arg
+ break
+ ;;
+ esac
+done
+
+for file
+do
+ if test -d "$file"; then
+ shift
+ else
+ break
+ fi
+done
+
+case $# in
+ 0) exit 0 ;;
+esac
+
+# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error. This is a problem when calling mkinstalldirs
+# from a parallel make. We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
+case $dirmode in
+ '')
+ if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ echo "mkdir -p -- $*"
+ exec mkdir -p -- "$@"
+ else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ test -d ./-p && rmdir ./-p
+ test -d ./--version && rmdir ./--version
+ fi
+ ;;
+ *)
+ if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+ test ! -d ./--version; then
+ echo "mkdir -m $dirmode -p -- $*"
+ exec mkdir -m "$dirmode" -p -- "$@"
+ else
+ # Clean up after NextStep and OpenStep mkdir.
+ for d in ./-m ./-p ./--version "./$dirmode";
+ do
+ test -d $d && rmdir $d
+ done
+ fi
+ ;;
+esac
+
+for file
+do
+ case $file in
+ /*) pathcomp=/ ;;
+ *) pathcomp= ;;
+ esac
+ oIFS=$IFS
+ IFS=/
+ set fnord $file
+ shift
+ IFS=$oIFS
+
+ for d
+ do
+ test "x$d" = x && continue
+
+ pathcomp=$pathcomp$d
+ case $pathcomp in
+ -*) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ else
+ if test ! -z "$dirmode"; then
+ echo "chmod $dirmode $pathcomp"
+ lasterr=
+ chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+ if test ! -z "$lasterr"; then
+ errstatus=$lasterr
+ fi
+ fi
+ fi
+ fi
+
+ pathcomp=$pathcomp/
+ done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/man/man1/mips-linux-uclibc-cpp.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/man/man1/mips-linux-uclibc-cpp.1
new file mode 100644
index 0000000..797cc09
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/man/man1/mips-linux-uclibc-cpp.1
@@ -0,0 +1,979 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.07)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "CPP 1"
+.TH CPP 1 "2009-10-15" "gcc-4.4.2" "GNU"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+cpp \- The C Preprocessor
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+cpp [\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR]
+ [\fB\-I\fR\fIdir\fR...] [\fB\-iquote\fR\fIdir\fR...]
+ [\fB\-W\fR\fIwarn\fR...]
+ [\fB\-M\fR|\fB\-MM\fR] [\fB\-MG\fR] [\fB\-MF\fR \fIfilename\fR]
+ [\fB\-MP\fR] [\fB\-MQ\fR \fItarget\fR...]
+ [\fB\-MT\fR \fItarget\fR...]
+ [\fB\-P\fR] [\fB\-fno\-working\-directory\fR]
+ [\fB\-x\fR \fIlanguage\fR] [\fB\-std=\fR\fIstandard\fR]
+ \fIinfile\fR \fIoutfile\fR
+.PP
+Only the most useful options are listed here; see below for the remainder.
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+The C preprocessor, often known as \fIcpp\fR, is a \fImacro processor\fR
+that is used automatically by the C compiler to transform your program
+before compilation. It is called a macro processor because it allows
+you to define \fImacros\fR, which are brief abbreviations for longer
+constructs.
+.PP
+The C preprocessor is intended to be used only with C, \*(C+, and
+Objective-C source code. In the past, it has been abused as a general
+text processor. It will choke on input which does not obey C's lexical
+rules. For example, apostrophes will be interpreted as the beginning of
+character constants, and cause errors. Also, you cannot rely on it
+preserving characteristics of the input which are not significant to
+C\-family languages. If a Makefile is preprocessed, all the hard tabs
+will be removed, and the Makefile will not work.
+.PP
+Having said that, you can often get away with using cpp on things which
+are not C. Other Algol-ish programming languages are often safe
+(Pascal, Ada, etc.) So is assembly, with caution. \fB\-traditional\-cpp\fR
+mode preserves more white space, and is otherwise more permissive. Many
+of the problems can be avoided by writing C or \*(C+ style comments
+instead of native language comments, and keeping macros simple.
+.PP
+Wherever possible, you should use a preprocessor geared to the language
+you are writing in. Modern versions of the \s-1GNU\s0 assembler have macro
+facilities. Most high level programming languages have their own
+conditional compilation and inclusion mechanism. If all else fails,
+try a true general text processor, such as \s-1GNU\s0 M4.
+.PP
+C preprocessors vary in some details. This manual discusses the \s-1GNU\s0 C
+preprocessor, which provides a small superset of the features of \s-1ISO\s0
+Standard C. In its default mode, the \s-1GNU\s0 C preprocessor does not do a
+few things required by the standard. These are features which are
+rarely, if ever, used, and may cause surprising changes to the meaning
+of a program which does not expect them. To get strict \s-1ISO\s0 Standard C,
+you should use the \fB\-std=c89\fR or \fB\-std=c99\fR options, depending
+on which version of the standard you want. To get all the mandatory
+diagnostics, you must also use \fB\-pedantic\fR.
+.PP
+This manual describes the behavior of the \s-1ISO\s0 preprocessor. To
+minimize gratuitous differences, where the \s-1ISO\s0 preprocessor's
+behavior does not conflict with traditional semantics, the
+traditional preprocessor should behave the same way. The various
+differences that do exist are detailed in the section \fBTraditional
+Mode\fR.
+.PP
+For clarity, unless noted otherwise, references to \fB\s-1CPP\s0\fR in this
+manual refer to \s-1GNU\s0 \s-1CPP\s0.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+The C preprocessor expects two file names as arguments, \fIinfile\fR and
+\&\fIoutfile\fR. The preprocessor reads \fIinfile\fR together with any
+other files it specifies with \fB#include\fR. All the output generated
+by the combined input files is written in \fIoutfile\fR.
+.PP
+Either \fIinfile\fR or \fIoutfile\fR may be \fB\-\fR, which as
+\&\fIinfile\fR means to read from standard input and as \fIoutfile\fR
+means to write to standard output. Also, if either file is omitted, it
+means the same as if \fB\-\fR had been specified for that file.
+.PP
+Unless otherwise noted, or the option ends in \fB=\fR, all options
+which take an argument may have that argument appear either immediately
+after the option, or with a space between option and argument:
+\&\fB\-Ifoo\fR and \fB\-I foo\fR have the same effect.
+.PP
+Many options have multi-letter names; therefore multiple single-letter
+options may \fInot\fR be grouped: \fB\-dM\fR is very different from
+\&\fB\-d\ \-M\fR.
+.IP "\fB\-D\fR \fIname\fR" 4
+.IX Item "-D name"
+Predefine \fIname\fR as a macro, with definition \f(CW1\fR.
+.IP "\fB\-D\fR \fIname\fR\fB=\fR\fIdefinition\fR" 4
+.IX Item "-D name=definition"
+The contents of \fIdefinition\fR are tokenized and processed as if
+they appeared during translation phase three in a \fB#define\fR
+directive. In particular, the definition will be truncated by
+embedded newline characters.
+.Sp
+If you are invoking the preprocessor from a shell or shell-like
+program you may need to use the shell's quoting syntax to protect
+characters such as spaces that have a meaning in the shell syntax.
+.Sp
+If you wish to define a function-like macro on the command line, write
+its argument list with surrounding parentheses before the equals sign
+(if any). Parentheses are meaningful to most shells, so you will need
+to quote the option. With \fBsh\fR and \fBcsh\fR,
+\&\fB\-D'\fR\fIname\fR\fB(\fR\fIargs...\fR\fB)=\fR\fIdefinition\fR\fB'\fR works.
+.Sp
+\&\fB\-D\fR and \fB\-U\fR options are processed in the order they
+are given on the command line. All \fB\-imacros\fR \fIfile\fR and
+\&\fB\-include\fR \fIfile\fR options are processed after all
+\&\fB\-D\fR and \fB\-U\fR options.
+.IP "\fB\-U\fR \fIname\fR" 4
+.IX Item "-U name"
+Cancel any previous definition of \fIname\fR, either built in or
+provided with a \fB\-D\fR option.
+.IP "\fB\-undef\fR" 4
+.IX Item "-undef"
+Do not predefine any system-specific or GCC-specific macros. The
+standard predefined macros remain defined.
+.IP "\fB\-I\fR \fIdir\fR" 4
+.IX Item "-I dir"
+Add the directory \fIdir\fR to the list of directories to be searched
+for header files.
+.Sp
+Directories named by \fB\-I\fR are searched before the standard
+system include directories. If the directory \fIdir\fR is a standard
+system include directory, the option is ignored to ensure that the
+default search order for system directories and the special treatment
+of system headers are not defeated
+\&.
+If \fIdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced
+by the sysroot prefix; see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
+.IP "\fB\-o\fR \fIfile\fR" 4
+.IX Item "-o file"
+Write output to \fIfile\fR. This is the same as specifying \fIfile\fR
+as the second non-option argument to \fBcpp\fR. \fBgcc\fR has a
+different interpretation of a second non-option argument, so you must
+use \fB\-o\fR to specify the output file.
+.IP "\fB\-Wall\fR" 4
+.IX Item "-Wall"
+Turns on all optional warnings which are desirable for normal code.
+At present this is \fB\-Wcomment\fR, \fB\-Wtrigraphs\fR,
+\&\fB\-Wmultichar\fR and a warning about integer promotion causing a
+change of sign in \f(CW\*(C`#if\*(C'\fR expressions. Note that many of the
+preprocessor's warnings are on by default and have no options to
+control them.
+.IP "\fB\-Wcomment\fR" 4
+.IX Item "-Wcomment"
+.PD 0
+.IP "\fB\-Wcomments\fR" 4
+.IX Item "-Wcomments"
+.PD
+Warn whenever a comment-start sequence \fB/*\fR appears in a \fB/*\fR
+comment, or whenever a backslash-newline appears in a \fB//\fR comment.
+(Both forms have the same effect.)
+.IP "\fB\-Wtrigraphs\fR" 4
+.IX Item "-Wtrigraphs"
+Most trigraphs in comments cannot affect the meaning of the program.
+However, a trigraph that would form an escaped newline (\fB??/\fR at
+the end of a line) can, by changing where the comment begins or ends.
+Therefore, only trigraphs that would form escaped newlines produce
+warnings inside a comment.
+.Sp
+This option is implied by \fB\-Wall\fR. If \fB\-Wall\fR is not
+given, this option is still enabled unless trigraphs are enabled. To
+get trigraph conversion without warnings, but get the other
+\&\fB\-Wall\fR warnings, use \fB\-trigraphs \-Wall \-Wno\-trigraphs\fR.
+.IP "\fB\-Wtraditional\fR" 4
+.IX Item "-Wtraditional"
+Warn about certain constructs that behave differently in traditional and
+\&\s-1ISO\s0 C. Also warn about \s-1ISO\s0 C constructs that have no traditional C
+equivalent, and problematic constructs which should be avoided.
+.IP "\fB\-Wundef\fR" 4
+.IX Item "-Wundef"
+Warn whenever an identifier which is not a macro is encountered in an
+\&\fB#if\fR directive, outside of \fBdefined\fR. Such identifiers are
+replaced with zero.
+.IP "\fB\-Wunused\-macros\fR" 4
+.IX Item "-Wunused-macros"
+Warn about macros defined in the main file that are unused. A macro
+is \fIused\fR if it is expanded or tested for existence at least once.
+The preprocessor will also warn if the macro has not been used at the
+time it is redefined or undefined.
+.Sp
+Built-in macros, macros defined on the command line, and macros
+defined in include files are not warned about.
+.Sp
+\&\fINote:\fR If a macro is actually used, but only used in skipped
+conditional blocks, then \s-1CPP\s0 will report it as unused. To avoid the
+warning in such a case, you might improve the scope of the macro's
+definition by, for example, moving it into the first skipped block.
+Alternatively, you could provide a dummy use with something like:
+.Sp
+.Vb 2
+\& #if defined the_macro_causing_the_warning
+\& #endif
+.Ve
+.IP "\fB\-Wendif\-labels\fR" 4
+.IX Item "-Wendif-labels"
+Warn whenever an \fB#else\fR or an \fB#endif\fR are followed by text.
+This usually happens in code of the form
+.Sp
+.Vb 5
+\& #if FOO
+\& ...
+\& #else FOO
+\& ...
+\& #endif FOO
+.Ve
+.Sp
+The second and third \f(CW\*(C`FOO\*(C'\fR should be in comments, but often are not
+in older programs. This warning is on by default.
+.IP "\fB\-Werror\fR" 4
+.IX Item "-Werror"
+Make all warnings into hard errors. Source code which triggers warnings
+will be rejected.
+.IP "\fB\-Wsystem\-headers\fR" 4
+.IX Item "-Wsystem-headers"
+Issue warnings for code in system headers. These are normally unhelpful
+in finding bugs in your own code, therefore suppressed. If you are
+responsible for the system library, you may want to see them.
+.IP "\fB\-w\fR" 4
+.IX Item "-w"
+Suppress all warnings, including those which \s-1GNU\s0 \s-1CPP\s0 issues by default.
+.IP "\fB\-pedantic\fR" 4
+.IX Item "-pedantic"
+Issue all the mandatory diagnostics listed in the C standard. Some of
+them are left out by default, since they trigger frequently on harmless
+code.
+.IP "\fB\-pedantic\-errors\fR" 4
+.IX Item "-pedantic-errors"
+Issue all the mandatory diagnostics, and make all mandatory diagnostics
+into errors. This includes mandatory diagnostics that \s-1GCC\s0 issues
+without \fB\-pedantic\fR but treats as warnings.
+.IP "\fB\-M\fR" 4
+.IX Item "-M"
+Instead of outputting the result of preprocessing, output a rule
+suitable for \fBmake\fR describing the dependencies of the main
+source file. The preprocessor outputs one \fBmake\fR rule containing
+the object file name for that source file, a colon, and the names of all
+the included files, including those coming from \fB\-include\fR or
+\&\fB\-imacros\fR command line options.
+.Sp
+Unless specified explicitly (with \fB\-MT\fR or \fB\-MQ\fR), the
+object file name consists of the name of the source file with any
+suffix replaced with object file suffix and with any leading directory
+parts removed. If there are many included files then the rule is
+split into several lines using \fB\e\fR\-newline. The rule has no
+commands.
+.Sp
+This option does not suppress the preprocessor's debug output, such as
+\&\fB\-dM\fR. To avoid mixing such debug output with the dependency
+rules you should explicitly specify the dependency output file with
+\&\fB\-MF\fR, or use an environment variable like
+\&\fB\s-1DEPENDENCIES_OUTPUT\s0\fR. Debug output
+will still be sent to the regular output stream as normal.
+.Sp
+Passing \fB\-M\fR to the driver implies \fB\-E\fR, and suppresses
+warnings with an implicit \fB\-w\fR.
+.IP "\fB\-MM\fR" 4
+.IX Item "-MM"
+Like \fB\-M\fR but do not mention header files that are found in
+system header directories, nor header files that are included,
+directly or indirectly, from such a header.
+.Sp
+This implies that the choice of angle brackets or double quotes in an
+\&\fB#include\fR directive does not in itself determine whether that
+header will appear in \fB\-MM\fR dependency output. This is a
+slight change in semantics from \s-1GCC\s0 versions 3.0 and earlier.
+.IP "\fB\-MF\fR \fIfile\fR" 4
+.IX Item "-MF file"
+When used with \fB\-M\fR or \fB\-MM\fR, specifies a
+file to write the dependencies to. If no \fB\-MF\fR switch is given
+the preprocessor sends the rules to the same place it would have sent
+preprocessed output.
+.Sp
+When used with the driver options \fB\-MD\fR or \fB\-MMD\fR,
+\&\fB\-MF\fR overrides the default dependency output file.
+.IP "\fB\-MG\fR" 4
+.IX Item "-MG"
+In conjunction with an option such as \fB\-M\fR requesting
+dependency generation, \fB\-MG\fR assumes missing header files are
+generated files and adds them to the dependency list without raising
+an error. The dependency filename is taken directly from the
+\&\f(CW\*(C`#include\*(C'\fR directive without prepending any path. \fB\-MG\fR
+also suppresses preprocessed output, as a missing header file renders
+this useless.
+.Sp
+This feature is used in automatic updating of makefiles.
+.IP "\fB\-MP\fR" 4
+.IX Item "-MP"
+This option instructs \s-1CPP\s0 to add a phony target for each dependency
+other than the main file, causing each to depend on nothing. These
+dummy rules work around errors \fBmake\fR gives if you remove header
+files without updating the \fIMakefile\fR to match.
+.Sp
+This is typical output:
+.Sp
+.Vb 1
+\& test.o: test.c test.h
+\&
+\& test.h:
+.Ve
+.IP "\fB\-MT\fR \fItarget\fR" 4
+.IX Item "-MT target"
+Change the target of the rule emitted by dependency generation. By
+default \s-1CPP\s0 takes the name of the main input file, deletes any
+directory components and any file suffix such as \fB.c\fR, and
+appends the platform's usual object suffix. The result is the target.
+.Sp
+An \fB\-MT\fR option will set the target to be exactly the string you
+specify. If you want multiple targets, you can specify them as a single
+argument to \fB\-MT\fR, or use multiple \fB\-MT\fR options.
+.Sp
+For example, \fB\-MT\ '$(objpfx)foo.o'\fR might give
+.Sp
+.Vb 1
+\& $(objpfx)foo.o: foo.c
+.Ve
+.IP "\fB\-MQ\fR \fItarget\fR" 4
+.IX Item "-MQ target"
+Same as \fB\-MT\fR, but it quotes any characters which are special to
+Make. \fB\-MQ\ '$(objpfx)foo.o'\fR gives
+.Sp
+.Vb 1
+\& $$(objpfx)foo.o: foo.c
+.Ve
+.Sp
+The default target is automatically quoted, as if it were given with
+\&\fB\-MQ\fR.
+.IP "\fB\-MD\fR" 4
+.IX Item "-MD"
+\&\fB\-MD\fR is equivalent to \fB\-M \-MF\fR \fIfile\fR, except that
+\&\fB\-E\fR is not implied. The driver determines \fIfile\fR based on
+whether an \fB\-o\fR option is given. If it is, the driver uses its
+argument but with a suffix of \fI.d\fR, otherwise it takes the name
+of the input file, removes any directory components and suffix, and
+applies a \fI.d\fR suffix.
+.Sp
+If \fB\-MD\fR is used in conjunction with \fB\-E\fR, any
+\&\fB\-o\fR switch is understood to specify the dependency output file, but if used without \fB\-E\fR, each \fB\-o\fR
+is understood to specify a target object file.
+.Sp
+Since \fB\-E\fR is not implied, \fB\-MD\fR can be used to generate
+a dependency output file as a side-effect of the compilation process.
+.IP "\fB\-MMD\fR" 4
+.IX Item "-MMD"
+Like \fB\-MD\fR except mention only user header files, not system
+header files.
+.IP "\fB\-x c\fR" 4
+.IX Item "-x c"
+.PD 0
+.IP "\fB\-x c++\fR" 4
+.IX Item "-x c++"
+.IP "\fB\-x objective-c\fR" 4
+.IX Item "-x objective-c"
+.IP "\fB\-x assembler-with-cpp\fR" 4
+.IX Item "-x assembler-with-cpp"
+.PD
+Specify the source language: C, \*(C+, Objective-C, or assembly. This has
+nothing to do with standards conformance or extensions; it merely
+selects which base syntax to expect. If you give none of these options,
+cpp will deduce the language from the extension of the source file:
+\&\fB.c\fR, \fB.cc\fR, \fB.m\fR, or \fB.S\fR. Some other common
+extensions for \*(C+ and assembly are also recognized. If cpp does not
+recognize the extension, it will treat the file as C; this is the most
+generic mode.
+.Sp
+\&\fINote:\fR Previous versions of cpp accepted a \fB\-lang\fR option
+which selected both the language and the standards conformance level.
+This option has been removed, because it conflicts with the \fB\-l\fR
+option.
+.IP "\fB\-std=\fR\fIstandard\fR" 4
+.IX Item "-std=standard"
+.PD 0
+.IP "\fB\-ansi\fR" 4
+.IX Item "-ansi"
+.PD
+Specify the standard to which the code should conform. Currently \s-1CPP\s0
+knows about C and \*(C+ standards; others may be added in the future.
+.Sp
+\&\fIstandard\fR
+may be one of:
+.RS 4
+.ie n .IP """iso9899:1990""" 4
+.el .IP "\f(CWiso9899:1990\fR" 4
+.IX Item "iso9899:1990"
+.PD 0
+.ie n .IP """c89""" 4
+.el .IP "\f(CWc89\fR" 4
+.IX Item "c89"
+.PD
+The \s-1ISO\s0 C standard from 1990. \fBc89\fR is the customary shorthand for
+this version of the standard.
+.Sp
+The \fB\-ansi\fR option is equivalent to \fB\-std=c89\fR.
+.ie n .IP """iso9899:199409""" 4
+.el .IP "\f(CWiso9899:199409\fR" 4
+.IX Item "iso9899:199409"
+The 1990 C standard, as amended in 1994.
+.ie n .IP """iso9899:1999""" 4
+.el .IP "\f(CWiso9899:1999\fR" 4
+.IX Item "iso9899:1999"
+.PD 0
+.ie n .IP """c99""" 4
+.el .IP "\f(CWc99\fR" 4
+.IX Item "c99"
+.ie n .IP """iso9899:199x""" 4
+.el .IP "\f(CWiso9899:199x\fR" 4
+.IX Item "iso9899:199x"
+.ie n .IP """c9x""" 4
+.el .IP "\f(CWc9x\fR" 4
+.IX Item "c9x"
+.PD
+The revised \s-1ISO\s0 C standard, published in December 1999. Before
+publication, this was known as C9X.
+.ie n .IP """gnu89""" 4
+.el .IP "\f(CWgnu89\fR" 4
+.IX Item "gnu89"
+The 1990 C standard plus \s-1GNU\s0 extensions. This is the default.
+.ie n .IP """gnu99""" 4
+.el .IP "\f(CWgnu99\fR" 4
+.IX Item "gnu99"
+.PD 0
+.ie n .IP """gnu9x""" 4
+.el .IP "\f(CWgnu9x\fR" 4
+.IX Item "gnu9x"
+.PD
+The 1999 C standard plus \s-1GNU\s0 extensions.
+.ie n .IP """c++98""" 4
+.el .IP "\f(CWc++98\fR" 4
+.IX Item "c++98"
+The 1998 \s-1ISO\s0 \*(C+ standard plus amendments.
+.ie n .IP """gnu++98""" 4
+.el .IP "\f(CWgnu++98\fR" 4
+.IX Item "gnu++98"
+The same as \fB\-std=c++98\fR plus \s-1GNU\s0 extensions. This is the
+default for \*(C+ code.
+.RE
+.RS 4
+.RE
+.IP "\fB\-I\-\fR" 4
+.IX Item "-I-"
+Split the include path. Any directories specified with \fB\-I\fR
+options before \fB\-I\-\fR are searched only for headers requested with
+\&\f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR; they are not searched for
+\&\f(CW\*(C`#include\ <\f(CIfile\f(CW>\*(C'\fR. If additional directories are
+specified with \fB\-I\fR options after the \fB\-I\-\fR, those
+directories are searched for all \fB#include\fR directives.
+.Sp
+In addition, \fB\-I\-\fR inhibits the use of the directory of the current
+file directory as the first search directory for \f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR.
+.Sp
+This option has been deprecated.
+.IP "\fB\-nostdinc\fR" 4
+.IX Item "-nostdinc"
+Do not search the standard system directories for header files.
+Only the directories you have specified with \fB\-I\fR options
+(and the directory of the current file, if appropriate) are searched.
+.IP "\fB\-nostdinc++\fR" 4
+.IX Item "-nostdinc++"
+Do not search for header files in the \*(C+\-specific standard directories,
+but do still search the other standard directories. (This option is
+used when building the \*(C+ library.)
+.IP "\fB\-include\fR \fIfile\fR" 4
+.IX Item "-include file"
+Process \fIfile\fR as if \f(CW\*(C`#include "file"\*(C'\fR appeared as the first
+line of the primary source file. However, the first directory searched
+for \fIfile\fR is the preprocessor's working directory \fIinstead of\fR
+the directory containing the main source file. If not found there, it
+is searched for in the remainder of the \f(CW\*(C`#include "..."\*(C'\fR search
+chain as normal.
+.Sp
+If multiple \fB\-include\fR options are given, the files are included
+in the order they appear on the command line.
+.IP "\fB\-imacros\fR \fIfile\fR" 4
+.IX Item "-imacros file"
+Exactly like \fB\-include\fR, except that any output produced by
+scanning \fIfile\fR is thrown away. Macros it defines remain defined.
+This allows you to acquire all the macros from a header without also
+processing its declarations.
+.Sp
+All files specified by \fB\-imacros\fR are processed before all files
+specified by \fB\-include\fR.
+.IP "\fB\-idirafter\fR \fIdir\fR" 4
+.IX Item "-idirafter dir"
+Search \fIdir\fR for header files, but do it \fIafter\fR all
+directories specified with \fB\-I\fR and the standard system directories
+have been exhausted. \fIdir\fR is treated as a system include directory.
+If \fIdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced
+by the sysroot prefix; see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
+.IP "\fB\-iprefix\fR \fIprefix\fR" 4
+.IX Item "-iprefix prefix"
+Specify \fIprefix\fR as the prefix for subsequent \fB\-iwithprefix\fR
+options. If the prefix represents a directory, you should include the
+final \fB/\fR.
+.IP "\fB\-iwithprefix\fR \fIdir\fR" 4
+.IX Item "-iwithprefix dir"
+.PD 0
+.IP "\fB\-iwithprefixbefore\fR \fIdir\fR" 4
+.IX Item "-iwithprefixbefore dir"
+.PD
+Append \fIdir\fR to the prefix specified previously with
+\&\fB\-iprefix\fR, and add the resulting directory to the include search
+path. \fB\-iwithprefixbefore\fR puts it in the same place \fB\-I\fR
+would; \fB\-iwithprefix\fR puts it where \fB\-idirafter\fR would.
+.IP "\fB\-isysroot\fR \fIdir\fR" 4
+.IX Item "-isysroot dir"
+This option is like the \fB\-\-sysroot\fR option, but applies only to
+header files. See the \fB\-\-sysroot\fR option for more information.
+.IP "\fB\-imultilib\fR \fIdir\fR" 4
+.IX Item "-imultilib dir"
+Use \fIdir\fR as a subdirectory of the directory containing
+target-specific \*(C+ headers.
+.IP "\fB\-isystem\fR \fIdir\fR" 4
+.IX Item "-isystem dir"
+Search \fIdir\fR for header files, after all directories specified by
+\&\fB\-I\fR but before the standard system directories. Mark it
+as a system directory, so that it gets the same special treatment as
+is applied to the standard system directories.
+.Sp
+If \fIdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced
+by the sysroot prefix; see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
+.IP "\fB\-iquote\fR \fIdir\fR" 4
+.IX Item "-iquote dir"
+Search \fIdir\fR only for header files requested with
+\&\f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR; they are not searched for
+\&\f(CW\*(C`#include\ <\f(CIfile\f(CW>\*(C'\fR, before all directories specified by
+\&\fB\-I\fR and before the standard system directories.
+.Sp
+If \fIdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced
+by the sysroot prefix; see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
+.IP "\fB\-fdirectives\-only\fR" 4
+.IX Item "-fdirectives-only"
+When preprocessing, handle directives, but do not expand macros.
+.Sp
+The option's behavior depends on the \fB\-E\fR and \fB\-fpreprocessed\fR
+options.
+.Sp
+With \fB\-E\fR, preprocessing is limited to the handling of directives
+such as \f(CW\*(C`#define\*(C'\fR, \f(CW\*(C`#ifdef\*(C'\fR, and \f(CW\*(C`#error\*(C'\fR. Other
+preprocessor operations, such as macro expansion and trigraph
+conversion are not performed. In addition, the \fB\-dD\fR option is
+implicitly enabled.
+.Sp
+With \fB\-fpreprocessed\fR, predefinition of command line and most
+builtin macros is disabled. Macros such as \f(CW\*(C`_\|_LINE_\|_\*(C'\fR, which are
+contextually dependent, are handled normally. This enables compilation of
+files previously preprocessed with \f(CW\*(C`\-E \-fdirectives\-only\*(C'\fR.
+.Sp
+With both \fB\-E\fR and \fB\-fpreprocessed\fR, the rules for
+\&\fB\-fpreprocessed\fR take precedence. This enables full preprocessing of
+files previously preprocessed with \f(CW\*(C`\-E \-fdirectives\-only\*(C'\fR.
+.IP "\fB\-fdollars\-in\-identifiers\fR" 4
+.IX Item "-fdollars-in-identifiers"
+Accept \fB$\fR in identifiers.
+.IP "\fB\-fextended\-identifiers\fR" 4
+.IX Item "-fextended-identifiers"
+Accept universal character names in identifiers. This option is
+experimental; in a future version of \s-1GCC\s0, it will be enabled by
+default for C99 and \*(C+.
+.IP "\fB\-fpreprocessed\fR" 4
+.IX Item "-fpreprocessed"
+Indicate to the preprocessor that the input file has already been
+preprocessed. This suppresses things like macro expansion, trigraph
+conversion, escaped newline splicing, and processing of most directives.
+The preprocessor still recognizes and removes comments, so that you can
+pass a file preprocessed with \fB\-C\fR to the compiler without
+problems. In this mode the integrated preprocessor is little more than
+a tokenizer for the front ends.
+.Sp
+\&\fB\-fpreprocessed\fR is implicit if the input file has one of the
+extensions \fB.i\fR, \fB.ii\fR or \fB.mi\fR. These are the
+extensions that \s-1GCC\s0 uses for preprocessed files created by
+\&\fB\-save\-temps\fR.
+.IP "\fB\-ftabstop=\fR\fIwidth\fR" 4
+.IX Item "-ftabstop=width"
+Set the distance between tab stops. This helps the preprocessor report
+correct column numbers in warnings or errors, even if tabs appear on the
+line. If the value is less than 1 or greater than 100, the option is
+ignored. The default is 8.
+.IP "\fB\-fexec\-charset=\fR\fIcharset\fR" 4
+.IX Item "-fexec-charset=charset"
+Set the execution character set, used for string and character
+constants. The default is \s-1UTF\-8\s0. \fIcharset\fR can be any encoding
+supported by the system's \f(CW\*(C`iconv\*(C'\fR library routine.
+.IP "\fB\-fwide\-exec\-charset=\fR\fIcharset\fR" 4
+.IX Item "-fwide-exec-charset=charset"
+Set the wide execution character set, used for wide string and
+character constants. The default is \s-1UTF\-32\s0 or \s-1UTF\-16\s0, whichever
+corresponds to the width of \f(CW\*(C`wchar_t\*(C'\fR. As with
+\&\fB\-fexec\-charset\fR, \fIcharset\fR can be any encoding supported
+by the system's \f(CW\*(C`iconv\*(C'\fR library routine; however, you will have
+problems with encodings that do not fit exactly in \f(CW\*(C`wchar_t\*(C'\fR.
+.IP "\fB\-finput\-charset=\fR\fIcharset\fR" 4
+.IX Item "-finput-charset=charset"
+Set the input character set, used for translation from the character
+set of the input file to the source character set used by \s-1GCC\s0. If the
+locale does not specify, or \s-1GCC\s0 cannot get this information from the
+locale, the default is \s-1UTF\-8\s0. This can be overridden by either the locale
+or this command line option. Currently the command line option takes
+precedence if there's a conflict. \fIcharset\fR can be any encoding
+supported by the system's \f(CW\*(C`iconv\*(C'\fR library routine.
+.IP "\fB\-fworking\-directory\fR" 4
+.IX Item "-fworking-directory"
+Enable generation of linemarkers in the preprocessor output that will
+let the compiler know the current working directory at the time of
+preprocessing. When this option is enabled, the preprocessor will
+emit, after the initial linemarker, a second linemarker with the
+current working directory followed by two slashes. \s-1GCC\s0 will use this
+directory, when it's present in the preprocessed input, as the
+directory emitted as the current working directory in some debugging
+information formats. This option is implicitly enabled if debugging
+information is enabled, but this can be inhibited with the negated
+form \fB\-fno\-working\-directory\fR. If the \fB\-P\fR flag is
+present in the command line, this option has no effect, since no
+\&\f(CW\*(C`#line\*(C'\fR directives are emitted whatsoever.
+.IP "\fB\-fno\-show\-column\fR" 4
+.IX Item "-fno-show-column"
+Do not print column numbers in diagnostics. This may be necessary if
+diagnostics are being scanned by a program that does not understand the
+column numbers, such as \fBdejagnu\fR.
+.IP "\fB\-A\fR \fIpredicate\fR\fB=\fR\fIanswer\fR" 4
+.IX Item "-A predicate=answer"
+Make an assertion with the predicate \fIpredicate\fR and answer
+\&\fIanswer\fR. This form is preferred to the older form \fB\-A\fR
+\&\fIpredicate\fR\fB(\fR\fIanswer\fR\fB)\fR, which is still supported, because
+it does not use shell special characters.
+.IP "\fB\-A \-\fR\fIpredicate\fR\fB=\fR\fIanswer\fR" 4
+.IX Item "-A -predicate=answer"
+Cancel an assertion with the predicate \fIpredicate\fR and answer
+\&\fIanswer\fR.
+.IP "\fB\-dCHARS\fR" 4
+.IX Item "-dCHARS"
+\&\fI\s-1CHARS\s0\fR is a sequence of one or more of the following characters,
+and must not be preceded by a space. Other characters are interpreted
+by the compiler proper, or reserved for future versions of \s-1GCC\s0, and so
+are silently ignored. If you specify characters whose behavior
+conflicts, the result is undefined.
+.RS 4
+.IP "\fBM\fR" 4
+.IX Item "M"
+Instead of the normal output, generate a list of \fB#define\fR
+directives for all the macros defined during the execution of the
+preprocessor, including predefined macros. This gives you a way of
+finding out what is predefined in your version of the preprocessor.
+Assuming you have no file \fIfoo.h\fR, the command
+.Sp
+.Vb 1
+\& touch foo.h; cpp \-dM foo.h
+.Ve
+.Sp
+will show all the predefined macros.
+.Sp
+If you use \fB\-dM\fR without the \fB\-E\fR option, \fB\-dM\fR is
+interpreted as a synonym for \fB\-fdump\-rtl\-mach\fR.
+.IP "\fBD\fR" 4
+.IX Item "D"
+Like \fBM\fR except in two respects: it does \fInot\fR include the
+predefined macros, and it outputs \fIboth\fR the \fB#define\fR
+directives and the result of preprocessing. Both kinds of output go to
+the standard output file.
+.IP "\fBN\fR" 4
+.IX Item "N"
+Like \fBD\fR, but emit only the macro names, not their expansions.
+.IP "\fBI\fR" 4
+.IX Item "I"
+Output \fB#include\fR directives in addition to the result of
+preprocessing.
+.IP "\fBU\fR" 4
+.IX Item "U"
+Like \fBD\fR except that only macros that are expanded, or whose
+definedness is tested in preprocessor directives, are output; the
+output is delayed until the use or test of the macro; and
+\&\fB#undef\fR directives are also output for macros tested but
+undefined at the time.
+.RE
+.RS 4
+.RE
+.IP "\fB\-P\fR" 4
+.IX Item "-P"
+Inhibit generation of linemarkers in the output from the preprocessor.
+This might be useful when running the preprocessor on something that is
+not C code, and will be sent to a program which might be confused by the
+linemarkers.
+.IP "\fB\-C\fR" 4
+.IX Item "-C"
+Do not discard comments. All comments are passed through to the output
+file, except for comments in processed directives, which are deleted
+along with the directive.
+.Sp
+You should be prepared for side effects when using \fB\-C\fR; it
+causes the preprocessor to treat comments as tokens in their own right.
+For example, comments appearing at the start of what would be a
+directive line have the effect of turning that line into an ordinary
+source line, since the first token on the line is no longer a \fB#\fR.
+.IP "\fB\-CC\fR" 4
+.IX Item "-CC"
+Do not discard comments, including during macro expansion. This is
+like \fB\-C\fR, except that comments contained within macros are
+also passed through to the output file where the macro is expanded.
+.Sp
+In addition to the side-effects of the \fB\-C\fR option, the
+\&\fB\-CC\fR option causes all \*(C+\-style comments inside a macro
+to be converted to C\-style comments. This is to prevent later use
+of that macro from inadvertently commenting out the remainder of
+the source line.
+.Sp
+The \fB\-CC\fR option is generally used to support lint comments.
+.IP "\fB\-traditional\-cpp\fR" 4
+.IX Item "-traditional-cpp"
+Try to imitate the behavior of old-fashioned C preprocessors, as
+opposed to \s-1ISO\s0 C preprocessors.
+.IP "\fB\-trigraphs\fR" 4
+.IX Item "-trigraphs"
+Process trigraph sequences.
+.IP "\fB\-remap\fR" 4
+.IX Item "-remap"
+Enable special code to work around file systems which only permit very
+short file names, such as MS-DOS.
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
+.PD 0
+.IP "\fB\-\-target\-help\fR" 4
+.IX Item "--target-help"
+.PD
+Print text describing all the command line options instead of
+preprocessing anything.
+.IP "\fB\-v\fR" 4
+.IX Item "-v"
+Verbose mode. Print out \s-1GNU\s0 \s-1CPP\s0's version number at the beginning of
+execution, and report the final form of the include path.
+.IP "\fB\-H\fR" 4
+.IX Item "-H"
+Print the name of each header file used, in addition to other normal
+activities. Each name is indented to show how deep in the
+\&\fB#include\fR stack it is. Precompiled header files are also
+printed, even if they are found to be invalid; an invalid precompiled
+header file is printed with \fB...x\fR and a valid one with \fB...!\fR .
+.IP "\fB\-version\fR" 4
+.IX Item "-version"
+.PD 0
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+.PD
+Print out \s-1GNU\s0 \s-1CPP\s0's version number. With one dash, proceed to
+preprocess as normal. With two dashes, exit immediately.
+.SH "ENVIRONMENT"
+.IX Header "ENVIRONMENT"
+This section describes the environment variables that affect how \s-1CPP\s0
+operates. You can use them to specify directories or prefixes to use
+when searching for include files, or to control dependency output.
+.PP
+Note that you can also specify places to search using options such as
+\&\fB\-I\fR, and control dependency output with options like
+\&\fB\-M\fR. These take precedence over
+environment variables, which in turn take precedence over the
+configuration of \s-1GCC\s0.
+.IP "\fB\s-1CPATH\s0\fR" 4
+.IX Item "CPATH"
+.PD 0
+.IP "\fBC_INCLUDE_PATH\fR" 4
+.IX Item "C_INCLUDE_PATH"
+.IP "\fB\s-1CPLUS_INCLUDE_PATH\s0\fR" 4
+.IX Item "CPLUS_INCLUDE_PATH"
+.IP "\fB\s-1OBJC_INCLUDE_PATH\s0\fR" 4
+.IX Item "OBJC_INCLUDE_PATH"
+.PD
+Each variable's value is a list of directories separated by a special
+character, much like \fB\s-1PATH\s0\fR, in which to look for header files.
+The special character, \f(CW\*(C`PATH_SEPARATOR\*(C'\fR, is target-dependent and
+determined at \s-1GCC\s0 build time. For Microsoft Windows-based targets it is a
+semicolon, and for almost all other targets it is a colon.
+.Sp
+\&\fB\s-1CPATH\s0\fR specifies a list of directories to be searched as if
+specified with \fB\-I\fR, but after any paths given with \fB\-I\fR
+options on the command line. This environment variable is used
+regardless of which language is being preprocessed.
+.Sp
+The remaining environment variables apply only when preprocessing the
+particular language indicated. Each specifies a list of directories
+to be searched as if specified with \fB\-isystem\fR, but after any
+paths given with \fB\-isystem\fR options on the command line.
+.Sp
+In all these variables, an empty element instructs the compiler to
+search its current working directory. Empty elements can appear at the
+beginning or end of a path. For instance, if the value of
+\&\fB\s-1CPATH\s0\fR is \f(CW\*(C`:/special/include\*(C'\fR, that has the same
+effect as \fB\-I.\ \-I/special/include\fR.
+.IP "\fB\s-1DEPENDENCIES_OUTPUT\s0\fR" 4
+.IX Item "DEPENDENCIES_OUTPUT"
+If this variable is set, its value specifies how to output
+dependencies for Make based on the non-system header files processed
+by the compiler. System header files are ignored in the dependency
+output.
+.Sp
+The value of \fB\s-1DEPENDENCIES_OUTPUT\s0\fR can be just a file name, in
+which case the Make rules are written to that file, guessing the target
+name from the source file name. Or the value can have the form
+\&\fIfile\fR\fB \fR\fItarget\fR, in which case the rules are written to
+file \fIfile\fR using \fItarget\fR as the target name.
+.Sp
+In other words, this environment variable is equivalent to combining
+the options \fB\-MM\fR and \fB\-MF\fR,
+with an optional \fB\-MT\fR switch too.
+.IP "\fB\s-1SUNPRO_DEPENDENCIES\s0\fR" 4
+.IX Item "SUNPRO_DEPENDENCIES"
+This variable is the same as \fB\s-1DEPENDENCIES_OUTPUT\s0\fR (see above),
+except that system header files are not ignored, so it implies
+\&\fB\-M\fR rather than \fB\-MM\fR. However, the dependence on the
+main input file is omitted.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fIgpl\fR\|(7), \fIgfdl\fR\|(7), \fIfsf\-funding\fR\|(7),
+\&\fIgcc\fR\|(1), \fIas\fR\|(1), \fIld\fR\|(1), and the Info entries for \fIcpp\fR, \fIgcc\fR, and
+\&\fIbinutils\fR.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
+1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation. A copy of
+the license is included in the
+man page \fIgfdl\fR\|(7).
+This manual contains no Invariant Sections. The Front-Cover Texts are
+(a) (see below), and the Back-Cover Texts are (b) (see below).
+.PP
+(a) The \s-1FSF\s0's Front-Cover Text is:
+.PP
+.Vb 1
+\& A GNU Manual
+.Ve
+.PP
+(b) The \s-1FSF\s0's Back-Cover Text is:
+.PP
+.Vb 3
+\& You have freedom to copy and modify this GNU Manual, like GNU
+\& software. Copies published by the Free Software Foundation raise
+\& funds for GNU development.
+.Ve
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/man/man1/mips-linux-uclibc-g++.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/man/man1/mips-linux-uclibc-g++.1
new file mode 100644
index 0000000..9db3170
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/man/man1/mips-linux-uclibc-g++.1
@@ -0,0 +1,15367 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "GCC 1"
+.TH GCC 1 "2010-01-29" "gcc-4.4.2" "GNU"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+gcc \- GNU project C and C++ compiler
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+gcc [\fB\-c\fR|\fB\-S\fR|\fB\-E\fR] [\fB\-std=\fR\fIstandard\fR]
+ [\fB\-g\fR] [\fB\-pg\fR] [\fB\-O\fR\fIlevel\fR]
+ [\fB\-W\fR\fIwarn\fR...] [\fB\-pedantic\fR]
+ [\fB\-I\fR\fIdir\fR...] [\fB\-L\fR\fIdir\fR...]
+ [\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR]
+ [\fB\-f\fR\fIoption\fR...] [\fB\-m\fR\fImachine-option\fR...]
+ [\fB\-o\fR \fIoutfile\fR] [@\fIfile\fR] \fIinfile\fR...
+.PP
+Only the most useful options are listed here; see below for the
+remainder. \fBg++\fR accepts mostly the same options as \fBgcc\fR.
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+When you invoke \s-1GCC\s0, it normally does preprocessing, compilation,
+assembly and linking. The \*(L"overall options\*(R" allow you to stop this
+process at an intermediate stage. For example, the \fB\-c\fR option
+says not to run the linker. Then the output consists of object files
+output by the assembler.
+.PP
+Other options are passed on to one stage of processing. Some options
+control the preprocessor and others the compiler itself. Yet other
+options control the assembler and linker; most of these are not
+documented here, since you rarely need to use any of them.
+.PP
+Most of the command line options that you can use with \s-1GCC\s0 are useful
+for C programs; when an option is only useful with another language
+(usually \*(C+), the explanation says so explicitly. If the description
+for a particular option does not mention a source language, you can use
+that option with all supported languages.
+.PP
+The \fBgcc\fR program accepts options and file names as operands. Many
+options have multi-letter names; therefore multiple single-letter options
+may \fInot\fR be grouped: \fB\-dv\fR is very different from \fB\-d\ \-v\fR.
+.PP
+You can mix options and other arguments. For the most part, the order
+you use doesn't matter. Order does matter when you use several
+options of the same kind; for example, if you specify \fB\-L\fR more
+than once, the directories are searched in the order specified. Also,
+the placement of the \fB\-l\fR option is significant.
+.PP
+Many options have long names starting with \fB\-f\fR or with
+\&\fB\-W\fR\-\-\-for example,
+\&\fB\-fmove\-loop\-invariants\fR, \fB\-Wformat\fR and so on. Most of
+these have both positive and negative forms; the negative form of
+\&\fB\-ffoo\fR would be \fB\-fno\-foo\fR. This manual documents
+only one of these two forms, whichever one is not the default.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+.Sh "Option Summary"
+.IX Subsection "Option Summary"
+Here is a summary of all the options, grouped by type. Explanations are
+in the following sections.
+.IP "\fIOverall Options\fR" 4
+.IX Item "Overall Options"
+\&\fB\-c \-S \-E \-o\fR \fIfile\fR \fB\-combine \-pipe \-pass\-exit\-codes
+\&\-x\fR \fIlanguage\fR \fB\-v \-### \-\-help\fR[\fB=\fR\fIclass\fR[\fB,...\fR]] \fB\-\-target\-help
+\&\-\-version \-wrapper@\fR\fIfile\fR
+.IP "\fIC Language Options\fR" 4
+.IX Item "C Language Options"
+\&\fB\-ansi \-std=\fR\fIstandard\fR \fB\-fgnu89\-inline
+\&\-aux\-info\fR \fIfilename\fR
+\&\fB\-fno\-asm \-fno\-builtin \-fno\-builtin\-\fR\fIfunction\fR
+\&\fB\-fhosted \-ffreestanding \-fopenmp \-fms\-extensions
+\&\-trigraphs \-no\-integrated\-cpp \-traditional \-traditional\-cpp
+\&\-fallow\-single\-precision \-fcond\-mismatch \-flax\-vector\-conversions
+\&\-fsigned\-bitfields \-fsigned\-char
+\&\-funsigned\-bitfields \-funsigned\-char\fR
+.IP "\fI\*(C+ Language Options\fR" 4
+.IX Item " Language Options"
+\&\fB\-fabi\-version=\fR\fIn\fR \fB\-fno\-access\-control \-fcheck\-new
+\&\-fconserve\-space \-ffriend\-injection
+\&\-fno\-elide\-constructors
+\&\-fno\-enforce\-eh\-specs
+\&\-ffor\-scope \-fno\-for\-scope \-fno\-gnu\-keywords
+\&\-fno\-implicit\-templates
+\&\-fno\-implicit\-inline\-templates
+\&\-fno\-implement\-inlines \-fms\-extensions
+\&\-fno\-nonansi\-builtins \-fno\-operator\-names
+\&\-fno\-optional\-diags \-fpermissive
+\&\-frepo \-fno\-rtti \-fstats \-ftemplate\-depth\-\fR\fIn\fR
+\&\fB\-fno\-threadsafe\-statics \-fuse\-cxa\-atexit \-fno\-weak \-nostdinc++
+\&\-fno\-default\-inline \-fvisibility\-inlines\-hidden
+\&\-fvisibility\-ms\-compat
+\&\-Wabi \-Wctor\-dtor\-privacy
+\&\-Wnon\-virtual\-dtor \-Wreorder
+\&\-Weffc++ \-Wstrict\-null\-sentinel
+\&\-Wno\-non\-template\-friend \-Wold\-style\-cast
+\&\-Woverloaded\-virtual \-Wno\-pmf\-conversions
+\&\-Wsign\-promo\fR
+.IP "\fIObjective-C and Objective\-\*(C+ Language Options\fR" 4
+.IX Item "Objective-C and Objective- Language Options"
+\&\fB\-fconstant\-string\-class=\fR\fIclass-name\fR
+\&\fB\-fgnu\-runtime \-fnext\-runtime
+\&\-fno\-nil\-receivers
+\&\-fobjc\-call\-cxx\-cdtors
+\&\-fobjc\-direct\-dispatch
+\&\-fobjc\-exceptions
+\&\-fobjc\-gc
+\&\-freplace\-objc\-classes
+\&\-fzero\-link
+\&\-gen\-decls
+\&\-Wassign\-intercept
+\&\-Wno\-protocol \-Wselector
+\&\-Wstrict\-selector\-match
+\&\-Wundeclared\-selector\fR
+.IP "\fILanguage Independent Options\fR" 4
+.IX Item "Language Independent Options"
+\&\fB\-fmessage\-length=\fR\fIn\fR
+\&\fB\-fdiagnostics\-show\-location=\fR[\fBonce\fR|\fBevery-line\fR]
+\&\fB\-fdiagnostics\-show\-option\fR
+.IP "\fIWarning Options\fR" 4
+.IX Item "Warning Options"
+\&\fB\-fsyntax\-only \-pedantic \-pedantic\-errors
+\&\-w \-Wextra \-Wall \-Waddress \-Waggregate\-return \-Warray\-bounds
+\&\-Wno\-attributes \-Wno\-builtin\-macro\-redefined
+\&\-Wc++\-compat \-Wc++0x\-compat \-Wcast\-align \-Wcast\-qual
+\&\-Wchar\-subscripts \-Wclobbered \-Wcomment
+\&\-Wconversion \-Wcoverage\-mismatch \-Wno\-deprecated
+\&\-Wno\-deprecated\-declarations \-Wdisabled\-optimization
+\&\-Wno\-div\-by\-zero \-Wempty\-body \-Wenum\-compare \-Wno\-endif\-labels
+\&\-Werror \-Werror=*
+\&\-Wfatal\-errors \-Wfloat\-equal \-Wformat \-Wformat=2
+\&\-Wno\-format\-contains\-nul \-Wno\-format\-extra\-args \-Wformat\-nonliteral
+\&\-Wformat\-security \-Wformat\-y2k
+\&\-Wframe\-larger\-than=\fR\fIlen\fR \fB\-Wignored\-qualifiers
+\&\-Wimplicit \-Wimplicit\-function\-declaration \-Wimplicit\-int
+\&\-Winit\-self \-Winline
+\&\-Wno\-int\-to\-pointer\-cast \-Wno\-invalid\-offsetof
+\&\-Winvalid\-pch \-Wlarger\-than=\fR\fIlen\fR \fB\-Wunsafe\-loop\-optimizations
+\&\-Wlogical\-op \-Wlong\-long
+\&\-Wmain \-Wmissing\-braces \-Wmissing\-field\-initializers
+\&\-Wmissing\-format\-attribute \-Wmissing\-include\-dirs
+\&\-Wmissing\-noreturn \-Wno\-mudflap
+\&\-Wno\-multichar \-Wnonnull \-Wno\-overflow
+\&\-Woverlength\-strings \-Wpacked \-Wpacked\-bitfield\-compat \-Wpadded
+\&\-Wparentheses \-Wpedantic\-ms\-format \-Wno\-pedantic\-ms\-format
+\&\-Wpointer\-arith \-Wno\-pointer\-to\-int\-cast
+\&\-Wredundant\-decls
+\&\-Wreturn\-type \-Wsequence\-point \-Wshadow
+\&\-Wsign\-compare \-Wsign\-conversion \-Wstack\-protector
+\&\-Wstrict\-aliasing \-Wstrict\-aliasing=n
+\&\-Wstrict\-overflow \-Wstrict\-overflow=\fR\fIn\fR
+\&\fB\-Wswitch \-Wswitch\-default \-Wswitch\-enum \-Wsync\-nand
+\&\-Wsystem\-headers \-Wtrigraphs \-Wtype\-limits \-Wundef \-Wuninitialized
+\&\-Wunknown\-pragmas \-Wno\-pragmas \-Wunreachable\-code
+\&\-Wunused \-Wunused\-function \-Wunused\-label \-Wunused\-parameter
+\&\-Wunused\-value \-Wunused\-variable
+\&\-Wvariadic\-macros \-Wvla
+\&\-Wvolatile\-register\-var \-Wwrite\-strings\fR
+.IP "\fIC and Objective-C-only Warning Options\fR" 4
+.IX Item "C and Objective-C-only Warning Options"
+\&\fB\-Wbad\-function\-cast \-Wmissing\-declarations
+\&\-Wmissing\-parameter\-type \-Wmissing\-prototypes \-Wnested\-externs
+\&\-Wold\-style\-declaration \-Wold\-style\-definition
+\&\-Wstrict\-prototypes \-Wtraditional \-Wtraditional\-conversion
+\&\-Wdeclaration\-after\-statement \-Wpointer\-sign\fR
+.IP "\fIDebugging Options\fR" 4
+.IX Item "Debugging Options"
+\&\fB\-d\fR\fIletters\fR \fB\-dumpspecs \-dumpmachine \-dumpversion
+\&\-fdbg\-cnt\-list \-fdbg\-cnt=\fR\fIcounter-value-list\fR
+\&\fB\-fdump\-noaddr \-fdump\-unnumbered
+\&\-fdump\-translation\-unit\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-class\-hierarchy\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-ipa\-all \-fdump\-ipa\-cgraph \-fdump\-ipa\-inline
+\&\-fdump\-statistics
+\&\-fdump\-tree\-all
+\&\-fdump\-tree\-original\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-optimized\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-cfg \-fdump\-tree\-vcg \-fdump\-tree\-alias
+\&\-fdump\-tree\-ch
+\&\-fdump\-tree\-ssa\fR[\fB\-\fR\fIn\fR] \fB\-fdump\-tree\-pre\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-ccp\fR[\fB\-\fR\fIn\fR] \fB\-fdump\-tree\-dce\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-gimple\fR[\fB\-raw\fR] \fB\-fdump\-tree\-mudflap\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-dom\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-dse\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-phiopt\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-forwprop\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-copyrename\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-nrv \-fdump\-tree\-vect
+\&\-fdump\-tree\-sink
+\&\-fdump\-tree\-sra\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-fre\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-vrp\fR[\fB\-\fR\fIn\fR]
+\&\fB\-ftree\-vectorizer\-verbose=\fR\fIn\fR
+\&\fB\-fdump\-tree\-storeccp\fR[\fB\-\fR\fIn\fR]
+\&\fB\-feliminate\-dwarf2\-dups \-feliminate\-unused\-debug\-types
+\&\-feliminate\-unused\-debug\-symbols \-femit\-class\-debug\-always
+\&\-fmem\-report \-fpre\-ipa\-mem\-report \-fpost\-ipa\-mem\-report \-fprofile\-arcs
+\&\-frandom\-seed=\fR\fIstring\fR \fB\-fsched\-verbose=\fR\fIn\fR
+\&\fB\-fsel\-sched\-verbose \-fsel\-sched\-dump\-cfg \-fsel\-sched\-pipelining\-verbose
+\&\-ftest\-coverage \-ftime\-report \-fvar\-tracking
+\&\-g \-g\fR\fIlevel\fR \fB\-gcoff \-gdwarf\-2
+\&\-ggdb \-gstabs \-gstabs+ \-gvms \-gxcoff \-gxcoff+
+\&\-fno\-merge\-debug\-strings \-fno\-dwarf2\-cfi\-asm
+\&\-fdebug\-prefix\-map=\fR\fIold\fR\fB=\fR\fInew\fR
+\&\fB\-femit\-struct\-debug\-baseonly \-femit\-struct\-debug\-reduced
+\&\-femit\-struct\-debug\-detailed\fR[\fB=\fR\fIspec-list\fR]
+\&\fB\-p \-pg \-print\-file\-name=\fR\fIlibrary\fR \fB\-print\-libgcc\-file\-name
+\&\-print\-multi\-directory \-print\-multi\-lib
+\&\-print\-prog\-name=\fR\fIprogram\fR \fB\-print\-search\-dirs \-Q
+\&\-print\-sysroot \-print\-sysroot\-headers\-suffix
+\&\-save\-temps \-time\fR
+.IP "\fIOptimization Options\fR" 4
+.IX Item "Optimization Options"
+\&\fB\-falign\-functions[=\fR\fIn\fR\fB] \-falign\-jumps[=\fR\fIn\fR\fB]
+\&\-falign\-labels[=\fR\fIn\fR\fB] \-falign\-loops[=\fR\fIn\fR\fB] \-fassociative\-math
+\&\-fauto\-inc\-dec \-fbranch\-probabilities \-fbranch\-target\-load\-optimize
+\&\-fbranch\-target\-load\-optimize2 \-fbtr\-bb\-exclusive \-fcaller\-saves
+\&\-fcheck\-data\-deps \-fconserve\-stack \-fcprop\-registers \-fcrossjumping
+\&\-fcse\-follow\-jumps \-fcse\-skip\-blocks \-fcx\-fortran\-rules \-fcx\-limited\-range
+\&\-fdata\-sections \-fdce \-fdce
+\&\-fdelayed\-branch \-fdelete\-null\-pointer\-checks \-fdse \-fdse
+\&\-fearly\-inlining \-fexpensive\-optimizations \-ffast\-math
+\&\-ffinite\-math\-only \-ffloat\-store \-fforward\-propagate
+\&\-ffunction\-sections \-fgcse \-fgcse\-after\-reload \-fgcse\-las \-fgcse\-lm
+\&\-fgcse\-sm \-fif\-conversion \-fif\-conversion2 \-findirect\-inlining
+\&\-finline\-functions \-finline\-functions\-called\-once \-finline\-limit=\fR\fIn\fR
+\&\fB\-finline\-small\-functions \-fipa\-cp \-fipa\-cp\-clone \-fipa\-matrix\-reorg \-fipa\-pta
+\&\-fipa\-pure\-const \-fipa\-reference \-fipa\-struct\-reorg
+\&\-fipa\-type\-escape \-fira\-algorithm=\fR\fIalgorithm\fR
+\&\fB\-fira\-region=\fR\fIregion\fR \fB\-fira\-coalesce \-fno\-ira\-share\-save\-slots
+\&\-fno\-ira\-share\-spill\-slots \-fira\-verbose=\fR\fIn\fR
+\&\fB\-fivopts \-fkeep\-inline\-functions \-fkeep\-static\-consts
+\&\-floop\-block \-floop\-interchange \-floop\-strip\-mine
+\&\-fmerge\-all\-constants \-fmerge\-constants \-fmodulo\-sched
+\&\-fmodulo\-sched\-allow\-regmoves \-fmove\-loop\-invariants \-fmudflap
+\&\-fmudflapir \-fmudflapth \-fno\-branch\-count\-reg \-fno\-default\-inline
+\&\-fno\-defer\-pop \-fno\-function\-cse \-fno\-guess\-branch\-probability
+\&\-fno\-inline \-fno\-math\-errno \-fno\-peephole \-fno\-peephole2
+\&\-fno\-sched\-interblock \-fno\-sched\-spec \-fno\-signed\-zeros
+\&\-fno\-toplevel\-reorder \-fno\-trapping\-math \-fno\-zero\-initialized\-in\-bss
+\&\-fomit\-frame\-pointer \-foptimize\-register\-move \-foptimize\-sibling\-calls
+\&\-fpeel\-loops \-fpredictive\-commoning \-fprefetch\-loop\-arrays
+\&\-fprofile\-correction \-fprofile\-dir=\fR\fIpath\fR \fB\-fprofile\-generate
+\&\-fprofile\-generate=\fR\fIpath\fR
+\&\fB\-fprofile\-use \-fprofile\-use=\fR\fIpath\fR \fB\-fprofile\-values
+\&\-freciprocal\-math \-fregmove \-frename\-registers \-freorder\-blocks
+\&\-freorder\-blocks\-and\-partition \-freorder\-functions
+\&\-frerun\-cse\-after\-loop \-freschedule\-modulo\-scheduled\-loops
+\&\-frounding\-math \-frtl\-abstract\-sequences \-fsched2\-use\-superblocks
+\&\-fsched2\-use\-traces \-fsched\-spec\-load \-fsched\-spec\-load\-dangerous
+\&\-fsched\-stalled\-insns\-dep[=\fR\fIn\fR\fB] \-fsched\-stalled\-insns[=\fR\fIn\fR\fB]
+\&\-fschedule\-insns \-fschedule\-insns2 \-fsection\-anchors \-fsee
+\&\-fselective\-scheduling \-fselective\-scheduling2
+\&\-fsel\-sched\-pipelining \-fsel\-sched\-pipelining\-outer\-loops
+\&\-fsignaling\-nans \-fsingle\-precision\-constant \-fsplit\-ivs\-in\-unroller
+\&\-fsplit\-wide\-types \-fstack\-protector \-fstack\-protector\-all
+\&\-fstrict\-aliasing \-fstrict\-overflow \-fthread\-jumps \-ftracer
+\&\-ftree\-builtin\-call\-dce \-ftree\-ccp \-ftree\-ch \-ftree\-copy\-prop
+\&\-ftree\-copyrename \-ftree\-dce
+\&\-ftree\-dominator\-opts \-ftree\-dse \-ftree\-fre \-ftree\-loop\-im
+\&\-ftree\-loop\-distribution
+\&\-ftree\-loop\-ivcanon \-ftree\-loop\-linear \-ftree\-loop\-optimize
+\&\-ftree\-parallelize\-loops=\fR\fIn\fR \fB\-ftree\-pre \-ftree\-reassoc
+\&\-ftree\-sink \-ftree\-sra \-ftree\-switch\-conversion
+\&\-ftree\-ter \-ftree\-vect\-loop\-version \-ftree\-vectorize \-ftree\-vrp
+\&\-funit\-at\-a\-time \-funroll\-all\-loops \-funroll\-loops
+\&\-funsafe\-loop\-optimizations \-funsafe\-math\-optimizations \-funswitch\-loops
+\&\-fvariable\-expansion\-in\-unroller \-fvect\-cost\-model \-fvpt \-fweb
+\&\-fwhole\-program
+\&\-\-param\fR \fIname\fR\fB=\fR\fIvalue\fR
+\&\fB\-O \-O0 \-O1 \-O2 \-O3 \-Os\fR
+.IP "\fIPreprocessor Options\fR" 4
+.IX Item "Preprocessor Options"
+\&\fB\-A\fR\fIquestion\fR\fB=\fR\fIanswer\fR
+\&\fB\-A\-\fR\fIquestion\fR[\fB=\fR\fIanswer\fR]
+\&\fB\-C \-dD \-dI \-dM \-dN
+\&\-D\fR\fImacro\fR[\fB=\fR\fIdefn\fR] \fB\-E \-H
+\&\-idirafter\fR \fIdir\fR
+\&\fB\-include\fR \fIfile\fR \fB\-imacros\fR \fIfile\fR
+\&\fB\-iprefix\fR \fIfile\fR \fB\-iwithprefix\fR \fIdir\fR
+\&\fB\-iwithprefixbefore\fR \fIdir\fR \fB\-isystem\fR \fIdir\fR
+\&\fB\-imultilib\fR \fIdir\fR \fB\-isysroot\fR \fIdir\fR
+\&\fB\-M \-MM \-MF \-MG \-MP \-MQ \-MT \-nostdinc
+\&\-P \-fworking\-directory \-remap
+\&\-trigraphs \-undef \-U\fR\fImacro\fR \fB\-Wp,\fR\fIoption\fR
+\&\fB\-Xpreprocessor\fR \fIoption\fR
+.IP "\fIAssembler Option\fR" 4
+.IX Item "Assembler Option"
+\&\fB\-Wa,\fR\fIoption\fR \fB\-Xassembler\fR \fIoption\fR
+.IP "\fILinker Options\fR" 4
+.IX Item "Linker Options"
+\&\fIobject-file-name\fR \fB\-l\fR\fIlibrary\fR
+\&\fB\-nostartfiles \-nodefaultlibs \-nostdlib \-pie \-rdynamic
+\&\-s \-static \-static\-libgcc \-shared \-shared\-libgcc \-symbolic
+\&\-T\fR \fIscript\fR \fB\-Wl,\fR\fIoption\fR \fB\-Xlinker\fR \fIoption\fR
+\&\fB\-u\fR \fIsymbol\fR
+.IP "\fIDirectory Options\fR" 4
+.IX Item "Directory Options"
+\&\fB\-B\fR\fIprefix\fR \fB\-I\fR\fIdir\fR \fB\-iquote\fR\fIdir\fR \fB\-L\fR\fIdir\fR
+\&\fB\-specs=\fR\fIfile\fR \fB\-I\- \-\-sysroot=\fR\fIdir\fR
+.IP "\fITarget Options\fR" 4
+.IX Item "Target Options"
+\&\fB\-V\fR \fIversion\fR \fB\-b\fR \fImachine\fR
+.IP "\fIMachine Dependent Options\fR" 4
+.IX Item "Machine Dependent Options"
+\&\fI\s-1ARC\s0 Options\fR
+\&\fB\-EB \-EL
+\&\-mmangle\-cpu \-mcpu=\fR\fIcpu\fR \fB\-mtext=\fR\fItext-section\fR
+\&\fB\-mdata=\fR\fIdata-section\fR \fB\-mrodata=\fR\fIreadonly-data-section\fR
+.Sp
+\&\fI\s-1ARM\s0 Options\fR
+\&\fB\-mapcs\-frame \-mno\-apcs\-frame
+\&\-mabi=\fR\fIname\fR
+\&\fB\-mapcs\-stack\-check \-mno\-apcs\-stack\-check
+\&\-mapcs\-float \-mno\-apcs\-float
+\&\-mapcs\-reentrant \-mno\-apcs\-reentrant
+\&\-msched\-prolog \-mno\-sched\-prolog
+\&\-mlittle\-endian \-mbig\-endian \-mwords\-little\-endian
+\&\-mfloat\-abi=\fR\fIname\fR \fB\-msoft\-float \-mhard\-float \-mfpe
+\&\-mthumb\-interwork \-mno\-thumb\-interwork
+\&\-mcpu=\fR\fIname\fR \fB\-march=\fR\fIname\fR \fB\-mfpu=\fR\fIname\fR
+\&\fB\-mstructure\-size\-boundary=\fR\fIn\fR
+\&\fB\-mabort\-on\-noreturn
+\&\-mlong\-calls \-mno\-long\-calls
+\&\-msingle\-pic\-base \-mno\-single\-pic\-base
+\&\-mpic\-register=\fR\fIreg\fR
+\&\fB\-mnop\-fun\-dllimport
+\&\-mcirrus\-fix\-invalid\-insns \-mno\-cirrus\-fix\-invalid\-insns
+\&\-mpoke\-function\-name
+\&\-mthumb \-marm
+\&\-mtpcs\-frame \-mtpcs\-leaf\-frame
+\&\-mcaller\-super\-interworking \-mcallee\-super\-interworking
+\&\-mtp=\fR\fIname\fR
+\&\fB\-mword\-relocations
+\&\-mfix\-cortex\-m3\-ldrd\fR
+.Sp
+\&\fI\s-1AVR\s0 Options\fR
+\&\fB\-mmcu=\fR\fImcu\fR \fB\-msize \-mno\-interrupts
+\&\-mcall\-prologues \-mno\-tablejump \-mtiny\-stack \-mint8\fR
+.Sp
+\&\fIBlackfin Options\fR
+\&\fB\-mcpu=\fR\fIcpu\fR[\fB\-\fR\fIsirevision\fR]
+\&\fB\-msim \-momit\-leaf\-frame\-pointer \-mno\-omit\-leaf\-frame\-pointer
+\&\-mspecld\-anomaly \-mno\-specld\-anomaly \-mcsync\-anomaly \-mno\-csync\-anomaly
+\&\-mlow\-64k \-mno\-low64k \-mstack\-check\-l1 \-mid\-shared\-library
+\&\-mno\-id\-shared\-library \-mshared\-library\-id=\fR\fIn\fR
+\&\fB\-mleaf\-id\-shared\-library \-mno\-leaf\-id\-shared\-library
+\&\-msep\-data \-mno\-sep\-data \-mlong\-calls \-mno\-long\-calls
+\&\-mfast\-fp \-minline\-plt \-mmulticore \-mcorea \-mcoreb \-msdram
+\&\-micplb\fR
+.Sp
+\&\fI\s-1CRIS\s0 Options\fR
+\&\fB\-mcpu=\fR\fIcpu\fR \fB\-march=\fR\fIcpu\fR \fB\-mtune=\fR\fIcpu\fR
+\&\fB\-mmax\-stack\-frame=\fR\fIn\fR \fB\-melinux\-stacksize=\fR\fIn\fR
+\&\fB\-metrax4 \-metrax100 \-mpdebug \-mcc\-init \-mno\-side\-effects
+\&\-mstack\-align \-mdata\-align \-mconst\-align
+\&\-m32\-bit \-m16\-bit \-m8\-bit \-mno\-prologue\-epilogue \-mno\-gotplt
+\&\-melf \-maout \-melinux \-mlinux \-sim \-sim2
+\&\-mmul\-bug\-workaround \-mno\-mul\-bug\-workaround\fR
+.Sp
+\&\fI\s-1CRX\s0 Options\fR
+\&\fB\-mmac \-mpush\-args\fR
+.Sp
+\&\fIDarwin Options\fR
+\&\fB\-all_load \-allowable_client \-arch \-arch_errors_fatal
+\&\-arch_only \-bind_at_load \-bundle \-bundle_loader
+\&\-client_name \-compatibility_version \-current_version
+\&\-dead_strip
+\&\-dependency\-file \-dylib_file \-dylinker_install_name
+\&\-dynamic \-dynamiclib \-exported_symbols_list
+\&\-filelist \-flat_namespace \-force_cpusubtype_ALL
+\&\-force_flat_namespace \-headerpad_max_install_names
+\&\-iframework
+\&\-image_base \-init \-install_name \-keep_private_externs
+\&\-multi_module \-multiply_defined \-multiply_defined_unused
+\&\-noall_load \-no_dead_strip_inits_and_terms
+\&\-nofixprebinding \-nomultidefs \-noprebind \-noseglinkedit
+\&\-pagezero_size \-prebind \-prebind_all_twolevel_modules
+\&\-private_bundle \-read_only_relocs \-sectalign
+\&\-sectobjectsymbols \-whyload \-seg1addr
+\&\-sectcreate \-sectobjectsymbols \-sectorder
+\&\-segaddr \-segs_read_only_addr \-segs_read_write_addr
+\&\-seg_addr_table \-seg_addr_table_filename \-seglinkedit
+\&\-segprot \-segs_read_only_addr \-segs_read_write_addr
+\&\-single_module \-static \-sub_library \-sub_umbrella
+\&\-twolevel_namespace \-umbrella \-undefined
+\&\-unexported_symbols_list \-weak_reference_mismatches
+\&\-whatsloaded \-F \-gused \-gfull \-mmacosx\-version\-min=\fR\fIversion\fR
+\&\fB\-mkernel \-mone\-byte\-bool\fR
+.Sp
+\&\fI\s-1DEC\s0 Alpha Options\fR
+\&\fB\-mno\-fp\-regs \-msoft\-float \-malpha\-as \-mgas
+\&\-mieee \-mieee\-with\-inexact \-mieee\-conformant
+\&\-mfp\-trap\-mode=\fR\fImode\fR \fB\-mfp\-rounding\-mode=\fR\fImode\fR
+\&\fB\-mtrap\-precision=\fR\fImode\fR \fB\-mbuild\-constants
+\&\-mcpu=\fR\fIcpu-type\fR \fB\-mtune=\fR\fIcpu-type\fR
+\&\fB\-mbwx \-mmax \-mfix \-mcix
+\&\-mfloat\-vax \-mfloat\-ieee
+\&\-mexplicit\-relocs \-msmall\-data \-mlarge\-data
+\&\-msmall\-text \-mlarge\-text
+\&\-mmemory\-latency=\fR\fItime\fR
+.Sp
+\&\fI\s-1DEC\s0 Alpha/VMS Options\fR
+\&\fB\-mvms\-return\-codes\fR
+.Sp
+\&\fI\s-1FR30\s0 Options\fR
+\&\fB\-msmall\-model \-mno\-lsim\fR
+.Sp
+\&\fI\s-1FRV\s0 Options\fR
+\&\fB\-mgpr\-32 \-mgpr\-64 \-mfpr\-32 \-mfpr\-64
+\&\-mhard\-float \-msoft\-float
+\&\-malloc\-cc \-mfixed\-cc \-mdword \-mno\-dword
+\&\-mdouble \-mno\-double
+\&\-mmedia \-mno\-media \-mmuladd \-mno\-muladd
+\&\-mfdpic \-minline\-plt \-mgprel\-ro \-multilib\-library\-pic
+\&\-mlinked\-fp \-mlong\-calls \-malign\-labels
+\&\-mlibrary\-pic \-macc\-4 \-macc\-8
+\&\-mpack \-mno\-pack \-mno\-eflags \-mcond\-move \-mno\-cond\-move
+\&\-moptimize\-membar \-mno\-optimize\-membar
+\&\-mscc \-mno\-scc \-mcond\-exec \-mno\-cond\-exec
+\&\-mvliw\-branch \-mno\-vliw\-branch
+\&\-mmulti\-cond\-exec \-mno\-multi\-cond\-exec \-mnested\-cond\-exec
+\&\-mno\-nested\-cond\-exec \-mtomcat\-stats
+\&\-mTLS \-mtls
+\&\-mcpu=\fR\fIcpu\fR
+.Sp
+\&\fIGNU/Linux Options\fR
+\&\fB\-muclibc\fR
+.Sp
+\&\fIH8/300 Options\fR
+\&\fB\-mrelax \-mh \-ms \-mn \-mint32 \-malign\-300\fR
+.Sp
+\&\fI\s-1HPPA\s0 Options\fR
+\&\fB\-march=\fR\fIarchitecture-type\fR
+\&\fB\-mbig\-switch \-mdisable\-fpregs \-mdisable\-indexing
+\&\-mfast\-indirect\-calls \-mgas \-mgnu\-ld \-mhp\-ld
+\&\-mfixed\-range=\fR\fIregister-range\fR
+\&\fB\-mjump\-in\-delay \-mlinker\-opt \-mlong\-calls
+\&\-mlong\-load\-store \-mno\-big\-switch \-mno\-disable\-fpregs
+\&\-mno\-disable\-indexing \-mno\-fast\-indirect\-calls \-mno\-gas
+\&\-mno\-jump\-in\-delay \-mno\-long\-load\-store
+\&\-mno\-portable\-runtime \-mno\-soft\-float
+\&\-mno\-space\-regs \-msoft\-float \-mpa\-risc\-1\-0
+\&\-mpa\-risc\-1\-1 \-mpa\-risc\-2\-0 \-mportable\-runtime
+\&\-mschedule=\fR\fIcpu-type\fR \fB\-mspace\-regs \-msio \-mwsio
+\&\-munix=\fR\fIunix-std\fR \fB\-nolibdld \-static \-threads\fR
+.Sp
+\&\fIi386 and x86\-64 Options\fR
+\&\fB\-mtune=\fR\fIcpu-type\fR \fB\-march=\fR\fIcpu-type\fR
+\&\fB\-mfpmath=\fR\fIunit\fR
+\&\fB\-masm=\fR\fIdialect\fR \fB\-mno\-fancy\-math\-387
+\&\-mno\-fp\-ret\-in\-387 \-msoft\-float
+\&\-mno\-wide\-multiply \-mrtd \-malign\-double
+\&\-mpreferred\-stack\-boundary=\fR\fInum\fR
+\&\fB\-mincoming\-stack\-boundary=\fR\fInum\fR
+\&\fB\-mcld \-mcx16 \-msahf \-mrecip
+\&\-mmmx \-msse \-msse2 \-msse3 \-mssse3 \-msse4.1 \-msse4.2 \-msse4 \-mavx
+\&\-maes \-mpclmul
+\&\-msse4a \-m3dnow \-mpopcnt \-mabm \-msse5
+\&\-mthreads \-mno\-align\-stringops \-minline\-all\-stringops
+\&\-minline\-stringops\-dynamically \-mstringop\-strategy=\fR\fIalg\fR
+\&\fB\-mpush\-args \-maccumulate\-outgoing\-args \-m128bit\-long\-double
+\&\-m96bit\-long\-double \-mregparm=\fR\fInum\fR \fB\-msseregparm
+\&\-mveclibabi=\fR\fItype\fR \fB\-mpc32 \-mpc64 \-mpc80 \-mstackrealign
+\&\-momit\-leaf\-frame\-pointer \-mno\-red\-zone \-mno\-tls\-direct\-seg\-refs
+\&\-mcmodel=\fR\fIcode-model\fR
+\&\fB\-m32 \-m64 \-mlarge\-data\-threshold=\fR\fInum\fR
+\&\fB\-mfused\-madd \-mno\-fused\-madd \-msse2avx\fR
+.Sp
+\&\fI\s-1IA\-64\s0 Options\fR
+\&\fB\-mbig\-endian \-mlittle\-endian \-mgnu\-as \-mgnu\-ld \-mno\-pic
+\&\-mvolatile\-asm\-stop \-mregister\-names \-mno\-sdata
+\&\-mconstant\-gp \-mauto\-pic \-minline\-float\-divide\-min\-latency
+\&\-minline\-float\-divide\-max\-throughput
+\&\-minline\-int\-divide\-min\-latency
+\&\-minline\-int\-divide\-max\-throughput
+\&\-minline\-sqrt\-min\-latency \-minline\-sqrt\-max\-throughput
+\&\-mno\-dwarf2\-asm \-mearly\-stop\-bits
+\&\-mfixed\-range=\fR\fIregister-range\fR \fB\-mtls\-size=\fR\fItls-size\fR
+\&\fB\-mtune=\fR\fIcpu-type\fR \fB\-mt \-pthread \-milp32 \-mlp64
+\&\-mno\-sched\-br\-data\-spec \-msched\-ar\-data\-spec \-mno\-sched\-control\-spec
+\&\-msched\-br\-in\-data\-spec \-msched\-ar\-in\-data\-spec \-msched\-in\-control\-spec
+\&\-msched\-ldc \-mno\-sched\-control\-ldc \-mno\-sched\-spec\-verbose
+\&\-mno\-sched\-prefer\-non\-data\-spec\-insns
+\&\-mno\-sched\-prefer\-non\-control\-spec\-insns
+\&\-mno\-sched\-count\-spec\-in\-critical\-path\fR
+.Sp
+\&\fIM32R/D Options\fR
+\&\fB\-m32r2 \-m32rx \-m32r
+\&\-mdebug
+\&\-malign\-loops \-mno\-align\-loops
+\&\-missue\-rate=\fR\fInumber\fR
+\&\fB\-mbranch\-cost=\fR\fInumber\fR
+\&\fB\-mmodel=\fR\fIcode-size-model-type\fR
+\&\fB\-msdata=\fR\fIsdata-type\fR
+\&\fB\-mno\-flush\-func \-mflush\-func=\fR\fIname\fR
+\&\fB\-mno\-flush\-trap \-mflush\-trap=\fR\fInumber\fR
+\&\fB\-G\fR \fInum\fR
+.Sp
+\&\fIM32C Options\fR
+\&\fB\-mcpu=\fR\fIcpu\fR \fB\-msim \-memregs=\fR\fInumber\fR
+.Sp
+\&\fIM680x0 Options\fR
+\&\fB\-march=\fR\fIarch\fR \fB\-mcpu=\fR\fIcpu\fR \fB\-mtune=\fR\fItune\fR
+\&\fB\-m68000 \-m68020 \-m68020\-40 \-m68020\-60 \-m68030 \-m68040
+\&\-m68060 \-mcpu32 \-m5200 \-m5206e \-m528x \-m5307 \-m5407
+\&\-mcfv4e \-mbitfield \-mno\-bitfield \-mc68000 \-mc68020
+\&\-mnobitfield \-mrtd \-mno\-rtd \-mdiv \-mno\-div \-mshort
+\&\-mno\-short \-mhard\-float \-m68881 \-msoft\-float \-mpcrel
+\&\-malign\-int \-mstrict\-align \-msep\-data \-mno\-sep\-data
+\&\-mshared\-library\-id=n \-mid\-shared\-library \-mno\-id\-shared\-library
+\&\-mxgot \-mno\-xgot\fR
+.Sp
+\&\fIM68hc1x Options\fR
+\&\fB\-m6811 \-m6812 \-m68hc11 \-m68hc12 \-m68hcs12
+\&\-mauto\-incdec \-minmax \-mlong\-calls \-mshort
+\&\-msoft\-reg\-count=\fR\fIcount\fR
+.Sp
+\&\fIMCore Options\fR
+\&\fB\-mhardlit \-mno\-hardlit \-mdiv \-mno\-div \-mrelax\-immediates
+\&\-mno\-relax\-immediates \-mwide\-bitfields \-mno\-wide\-bitfields
+\&\-m4byte\-functions \-mno\-4byte\-functions \-mcallgraph\-data
+\&\-mno\-callgraph\-data \-mslow\-bytes \-mno\-slow\-bytes \-mno\-lsim
+\&\-mlittle\-endian \-mbig\-endian \-m210 \-m340 \-mstack\-increment\fR
+.Sp
+\&\fI\s-1MIPS\s0 Options\fR
+\&\fB\-EL \-EB \-march=\fR\fIarch\fR \fB\-mtune=\fR\fIarch\fR
+\&\fB\-mips1 \-mips2 \-mips3 \-mips4 \-mips32 \-mips32r2
+\&\-mips64 \-mips64r2
+\&\-mips16 \-mno\-mips16 \-mflip\-mips16
+\&\-minterlink\-mips16 \-mno\-interlink\-mips16
+\&\-mabi=\fR\fIabi\fR \fB\-mabicalls \-mno\-abicalls
+\&\-mshared \-mno\-shared \-mplt \-mno\-plt \-mxgot \-mno\-xgot
+\&\-mgp32 \-mgp64 \-mfp32 \-mfp64 \-mhard\-float \-msoft\-float
+\&\-msingle\-float \-mdouble\-float \-mdsp \-mno\-dsp \-mdspr2 \-mno\-dspr2
+\&\-mfpu=\fR\fIfpu-type\fR
+\&\fB\-msmartmips \-mno\-smartmips
+\&\-mpaired\-single \-mno\-paired\-single \-mdmx \-mno\-mdmx
+\&\-mips3d \-mno\-mips3d \-mmt \-mno\-mt \-mllsc \-mno\-llsc
+\&\-mlong64 \-mlong32 \-msym32 \-mno\-sym32
+\&\-G\fR\fInum\fR \fB\-mlocal\-sdata \-mno\-local\-sdata
+\&\-mextern\-sdata \-mno\-extern\-sdata \-mgpopt \-mno\-gopt
+\&\-membedded\-data \-mno\-embedded\-data
+\&\-muninit\-const\-in\-rodata \-mno\-uninit\-const\-in\-rodata
+\&\-mcode\-readable=\fR\fIsetting\fR
+\&\fB\-msplit\-addresses \-mno\-split\-addresses
+\&\-mexplicit\-relocs \-mno\-explicit\-relocs
+\&\-mcheck\-zero\-division \-mno\-check\-zero\-division
+\&\-mdivide\-traps \-mdivide\-breaks
+\&\-mmemcpy \-mno\-memcpy \-mlong\-calls \-mno\-long\-calls
+\&\-mmad \-mno\-mad \-mfused\-madd \-mno\-fused\-madd \-nocpp
+\&\-mfix\-r4000 \-mno\-fix\-r4000 \-mfix\-r4400 \-mno\-fix\-r4400
+\&\-mfix\-r10000 \-mno\-fix\-r10000 \-mfix\-vr4120 \-mno\-fix\-vr4120
+\&\-mfix\-vr4130 \-mno\-fix\-vr4130 \-mfix\-sb1 \-mno\-fix\-sb1
+\&\-mflush\-func=\fR\fIfunc\fR \fB\-mno\-flush\-func
+\&\-mbranch\-cost=\fR\fInum\fR \fB\-mbranch\-likely \-mno\-branch\-likely
+\&\-mfp\-exceptions \-mno\-fp\-exceptions
+\&\-mvr4130\-align \-mno\-vr4130\-align\fR
+.Sp
+\&\fI\s-1MMIX\s0 Options\fR
+\&\fB\-mlibfuncs \-mno\-libfuncs \-mepsilon \-mno\-epsilon \-mabi=gnu
+\&\-mabi=mmixware \-mzero\-extend \-mknuthdiv \-mtoplevel\-symbols
+\&\-melf \-mbranch\-predict \-mno\-branch\-predict \-mbase\-addresses
+\&\-mno\-base\-addresses \-msingle\-exit \-mno\-single\-exit\fR
+.Sp
+\&\fI\s-1MN10300\s0 Options\fR
+\&\fB\-mmult\-bug \-mno\-mult\-bug
+\&\-mam33 \-mno\-am33
+\&\-mam33\-2 \-mno\-am33\-2
+\&\-mreturn\-pointer\-on\-d0
+\&\-mno\-crt0 \-mrelax\fR
+.Sp
+\&\fI\s-1PDP\-11\s0 Options\fR
+\&\fB\-mfpu \-msoft\-float \-mac0 \-mno\-ac0 \-m40 \-m45 \-m10
+\&\-mbcopy \-mbcopy\-builtin \-mint32 \-mno\-int16
+\&\-mint16 \-mno\-int32 \-mfloat32 \-mno\-float64
+\&\-mfloat64 \-mno\-float32 \-mabshi \-mno\-abshi
+\&\-mbranch\-expensive \-mbranch\-cheap
+\&\-msplit \-mno\-split \-munix\-asm \-mdec\-asm\fR
+.Sp
+\&\fIpicoChip Options\fR
+\&\fB\-mae=\fR\fIae_type\fR \fB\-mvliw\-lookahead=\fR\fIN\fR
+\&\fB\-msymbol\-as\-address \-mno\-inefficient\-warnings\fR
+.Sp
+\&\fIPowerPC Options\fR
+See \s-1RS/6000\s0 and PowerPC Options.
+.Sp
+\&\fI\s-1RS/6000\s0 and PowerPC Options\fR
+\&\fB\-mcpu=\fR\fIcpu-type\fR
+\&\fB\-mtune=\fR\fIcpu-type\fR
+\&\fB\-mpower \-mno\-power \-mpower2 \-mno\-power2
+\&\-mpowerpc \-mpowerpc64 \-mno\-powerpc
+\&\-maltivec \-mno\-altivec
+\&\-mpowerpc\-gpopt \-mno\-powerpc\-gpopt
+\&\-mpowerpc\-gfxopt \-mno\-powerpc\-gfxopt
+\&\-mmfcrf \-mno\-mfcrf \-mpopcntb \-mno\-popcntb \-mfprnd \-mno\-fprnd
+\&\-mcmpb \-mno\-cmpb \-mmfpgpr \-mno\-mfpgpr \-mhard\-dfp \-mno\-hard\-dfp
+\&\-mnew\-mnemonics \-mold\-mnemonics
+\&\-mfull\-toc \-mminimal\-toc \-mno\-fp\-in\-toc \-mno\-sum\-in\-toc
+\&\-m64 \-m32 \-mxl\-compat \-mno\-xl\-compat \-mpe
+\&\-malign\-power \-malign\-natural
+\&\-msoft\-float \-mhard\-float \-mmultiple \-mno\-multiple
+\&\-msingle\-float \-mdouble\-float \-msimple\-fpu
+\&\-mstring \-mno\-string \-mupdate \-mno\-update
+\&\-mavoid\-indexed\-addresses \-mno\-avoid\-indexed\-addresses
+\&\-mfused\-madd \-mno\-fused\-madd \-mbit\-align \-mno\-bit\-align
+\&\-mstrict\-align \-mno\-strict\-align \-mrelocatable
+\&\-mno\-relocatable \-mrelocatable\-lib \-mno\-relocatable\-lib
+\&\-mtoc \-mno\-toc \-mlittle \-mlittle\-endian \-mbig \-mbig\-endian
+\&\-mdynamic\-no\-pic \-maltivec \-mswdiv
+\&\-mprioritize\-restricted\-insns=\fR\fIpriority\fR
+\&\fB\-msched\-costly\-dep=\fR\fIdependence_type\fR
+\&\fB\-minsert\-sched\-nops=\fR\fIscheme\fR
+\&\fB\-mcall\-sysv \-mcall\-netbsd
+\&\-maix\-struct\-return \-msvr4\-struct\-return
+\&\-mabi=\fR\fIabi-type\fR \fB\-msecure\-plt \-mbss\-plt
+\&\-misel \-mno\-isel
+\&\-misel=yes \-misel=no
+\&\-mspe \-mno\-spe
+\&\-mspe=yes \-mspe=no
+\&\-mpaired
+\&\-mgen\-cell\-microcode \-mwarn\-cell\-microcode
+\&\-mvrsave \-mno\-vrsave
+\&\-mmulhw \-mno\-mulhw
+\&\-mdlmzb \-mno\-dlmzb
+\&\-mfloat\-gprs=yes \-mfloat\-gprs=no \-mfloat\-gprs=single \-mfloat\-gprs=double
+\&\-mprototype \-mno\-prototype
+\&\-msim \-mmvme \-mads \-myellowknife \-memb \-msdata
+\&\-msdata=\fR\fIopt\fR \fB\-mvxworks \-G\fR \fInum\fR \fB\-pthread\fR
+.Sp
+\&\fIS/390 and zSeries Options\fR
+\&\fB\-mtune=\fR\fIcpu-type\fR \fB\-march=\fR\fIcpu-type\fR
+\&\fB\-mhard\-float \-msoft\-float \-mhard\-dfp \-mno\-hard\-dfp
+\&\-mlong\-double\-64 \-mlong\-double\-128
+\&\-mbackchain \-mno\-backchain \-mpacked\-stack \-mno\-packed\-stack
+\&\-msmall\-exec \-mno\-small\-exec \-mmvcle \-mno\-mvcle
+\&\-m64 \-m31 \-mdebug \-mno\-debug \-mesa \-mzarch
+\&\-mtpf\-trace \-mno\-tpf\-trace \-mfused\-madd \-mno\-fused\-madd
+\&\-mwarn\-framesize \-mwarn\-dynamicstack \-mstack\-size \-mstack\-guard\fR
+.Sp
+\&\fIScore Options\fR
+\&\fB\-meb \-mel
+\&\-mnhwloop
+\&\-muls
+\&\-mmac
+\&\-mscore5 \-mscore5u \-mscore7 \-mscore7d\fR
+.Sp
+\&\fI\s-1SH\s0 Options\fR
+\&\fB\-m1 \-m2 \-m2e \-m3 \-m3e
+\&\-m4\-nofpu \-m4\-single\-only \-m4\-single \-m4
+\&\-m4a\-nofpu \-m4a\-single\-only \-m4a\-single \-m4a \-m4al
+\&\-m5\-64media \-m5\-64media\-nofpu
+\&\-m5\-32media \-m5\-32media\-nofpu
+\&\-m5\-compact \-m5\-compact\-nofpu
+\&\-mb \-ml \-mdalign \-mrelax
+\&\-mbigtable \-mfmovd \-mhitachi \-mrenesas \-mno\-renesas \-mnomacsave
+\&\-mieee \-mbitops \-misize \-minline\-ic_invalidate \-mpadstruct \-mspace
+\&\-mprefergot \-musermode \-multcost=\fR\fInumber\fR \fB\-mdiv=\fR\fIstrategy\fR
+\&\fB\-mdivsi3_libfunc=\fR\fIname\fR \fB\-mfixed\-range=\fR\fIregister-range\fR
+\&\fB\-madjust\-unroll \-mindexed\-addressing \-mgettrcost=\fR\fInumber\fR \fB\-mpt\-fixed
+\&\-minvalid\-symbols\fR
+.Sp
+\&\fI\s-1SPARC\s0 Options\fR
+\&\fB\-mcpu=\fR\fIcpu-type\fR
+\&\fB\-mtune=\fR\fIcpu-type\fR
+\&\fB\-mcmodel=\fR\fIcode-model\fR
+\&\fB\-m32 \-m64 \-mapp\-regs \-mno\-app\-regs
+\&\-mfaster\-structs \-mno\-faster\-structs
+\&\-mfpu \-mno\-fpu \-mhard\-float \-msoft\-float
+\&\-mhard\-quad\-float \-msoft\-quad\-float
+\&\-mimpure\-text \-mno\-impure\-text \-mlittle\-endian
+\&\-mstack\-bias \-mno\-stack\-bias
+\&\-munaligned\-doubles \-mno\-unaligned\-doubles
+\&\-mv8plus \-mno\-v8plus \-mvis \-mno\-vis
+\&\-threads \-pthreads \-pthread\fR
+.Sp
+\&\fI\s-1SPU\s0 Options\fR
+\&\fB\-mwarn\-reloc \-merror\-reloc
+\&\-msafe\-dma \-munsafe\-dma
+\&\-mbranch\-hints
+\&\-msmall\-mem \-mlarge\-mem \-mstdmain
+\&\-mfixed\-range=\fR\fIregister-range\fR
+.Sp
+\&\fISystem V Options\fR
+\&\fB\-Qy \-Qn \-YP,\fR\fIpaths\fR \fB\-Ym,\fR\fIdir\fR
+.Sp
+\&\fIV850 Options\fR
+\&\fB\-mlong\-calls \-mno\-long\-calls \-mep \-mno\-ep
+\&\-mprolog\-function \-mno\-prolog\-function \-mspace
+\&\-mtda=\fR\fIn\fR \fB\-msda=\fR\fIn\fR \fB\-mzda=\fR\fIn\fR
+\&\fB\-mapp\-regs \-mno\-app\-regs
+\&\-mdisable\-callt \-mno\-disable\-callt
+\&\-mv850e1
+\&\-mv850e
+\&\-mv850 \-mbig\-switch\fR
+.Sp
+\&\fI\s-1VAX\s0 Options\fR
+\&\fB\-mg \-mgnu \-munix\fR
+.Sp
+\&\fIVxWorks Options\fR
+\&\fB\-mrtp \-non\-static \-Bstatic \-Bdynamic
+\&\-Xbind\-lazy \-Xbind\-now\fR
+.Sp
+\&\fIx86\-64 Options\fR
+See i386 and x86\-64 Options.
+.Sp
+\&\fIi386 and x86\-64 Windows Options\fR
+\&\fB\-mconsole \-mcygwin \-mno\-cygwin \-mdll
+\&\-mnop\-fun\-dllimport \-mthread \-mwin32 \-mwindows\fR
+.Sp
+\&\fIXstormy16 Options\fR
+\&\fB\-msim\fR
+.Sp
+\&\fIXtensa Options\fR
+\&\fB\-mconst16 \-mno\-const16
+\&\-mfused\-madd \-mno\-fused\-madd
+\&\-mserialize\-volatile \-mno\-serialize\-volatile
+\&\-mtext\-section\-literals \-mno\-text\-section\-literals
+\&\-mtarget\-align \-mno\-target\-align
+\&\-mlongcalls \-mno\-longcalls\fR
+.Sp
+\&\fIzSeries Options\fR
+See S/390 and zSeries Options.
+.IP "\fICode Generation Options\fR" 4
+.IX Item "Code Generation Options"
+\&\fB\-fcall\-saved\-\fR\fIreg\fR \fB\-fcall\-used\-\fR\fIreg\fR
+\&\fB\-ffixed\-\fR\fIreg\fR \fB\-fexceptions
+\&\-fnon\-call\-exceptions \-funwind\-tables
+\&\-fasynchronous\-unwind\-tables
+\&\-finhibit\-size\-directive \-finstrument\-functions
+\&\-finstrument\-functions\-exclude\-function\-list=\fR\fIsym\fR\fB,\fR\fIsym\fR\fB,...
+\&\-finstrument\-functions\-exclude\-file\-list=\fR\fIfile\fR\fB,\fR\fIfile\fR\fB,...
+\&\-fno\-common \-fno\-ident
+\&\-fpcc\-struct\-return \-fpic \-fPIC \-fpie \-fPIE
+\&\-fno\-jump\-tables
+\&\-frecord\-gcc\-switches
+\&\-freg\-struct\-return \-fshort\-enums
+\&\-fshort\-double \-fshort\-wchar
+\&\-fverbose\-asm \-fpack\-struct[=\fR\fIn\fR\fB] \-fstack\-check
+\&\-fstack\-limit\-register=\fR\fIreg\fR \fB\-fstack\-limit\-symbol=\fR\fIsym\fR
+\&\fB\-fno\-stack\-limit \-fargument\-alias \-fargument\-noalias
+\&\-fargument\-noalias\-global \-fargument\-noalias\-anything
+\&\-fleading\-underscore \-ftls\-model=\fR\fImodel\fR
+\&\fB\-ftrapv \-fwrapv \-fbounds\-check
+\&\-fvisibility\fR
+.Sh "Options Controlling the Kind of Output"
+.IX Subsection "Options Controlling the Kind of Output"
+Compilation can involve up to four stages: preprocessing, compilation
+proper, assembly and linking, always in that order. \s-1GCC\s0 is capable of
+preprocessing and compiling several files either into several
+assembler input files, or into one assembler input file; then each
+assembler input file produces an object file, and linking combines all
+the object files (those newly compiled, and those specified as input)
+into an executable file.
+.PP
+For any given input file, the file name suffix determines what kind of
+compilation is done:
+.IP "\fIfile\fR\fB.c\fR" 4
+.IX Item "file.c"
+C source code which must be preprocessed.
+.IP "\fIfile\fR\fB.i\fR" 4
+.IX Item "file.i"
+C source code which should not be preprocessed.
+.IP "\fIfile\fR\fB.ii\fR" 4
+.IX Item "file.ii"
+\&\*(C+ source code which should not be preprocessed.
+.IP "\fIfile\fR\fB.m\fR" 4
+.IX Item "file.m"
+Objective-C source code. Note that you must link with the \fIlibobjc\fR
+library to make an Objective-C program work.
+.IP "\fIfile\fR\fB.mi\fR" 4
+.IX Item "file.mi"
+Objective-C source code which should not be preprocessed.
+.IP "\fIfile\fR\fB.mm\fR" 4
+.IX Item "file.mm"
+.PD 0
+.IP "\fIfile\fR\fB.M\fR" 4
+.IX Item "file.M"
+.PD
+Objective\-\*(C+ source code. Note that you must link with the \fIlibobjc\fR
+library to make an Objective\-\*(C+ program work. Note that \fB.M\fR refers
+to a literal capital M.
+.IP "\fIfile\fR\fB.mii\fR" 4
+.IX Item "file.mii"
+Objective\-\*(C+ source code which should not be preprocessed.
+.IP "\fIfile\fR\fB.h\fR" 4
+.IX Item "file.h"
+C, \*(C+, Objective-C or Objective\-\*(C+ header file to be turned into a
+precompiled header.
+.IP "\fIfile\fR\fB.cc\fR" 4
+.IX Item "file.cc"
+.PD 0
+.IP "\fIfile\fR\fB.cp\fR" 4
+.IX Item "file.cp"
+.IP "\fIfile\fR\fB.cxx\fR" 4
+.IX Item "file.cxx"
+.IP "\fIfile\fR\fB.cpp\fR" 4
+.IX Item "file.cpp"
+.IP "\fIfile\fR\fB.CPP\fR" 4
+.IX Item "file.CPP"
+.IP "\fIfile\fR\fB.c++\fR" 4
+.IX Item "file.c++"
+.IP "\fIfile\fR\fB.C\fR" 4
+.IX Item "file.C"
+.PD
+\&\*(C+ source code which must be preprocessed. Note that in \fB.cxx\fR,
+the last two letters must both be literally \fBx\fR. Likewise,
+\&\fB.C\fR refers to a literal capital C.
+.IP "\fIfile\fR\fB.mm\fR" 4
+.IX Item "file.mm"
+.PD 0
+.IP "\fIfile\fR\fB.M\fR" 4
+.IX Item "file.M"
+.PD
+Objective\-\*(C+ source code which must be preprocessed.
+.IP "\fIfile\fR\fB.mii\fR" 4
+.IX Item "file.mii"
+Objective\-\*(C+ source code which should not be preprocessed.
+.IP "\fIfile\fR\fB.hh\fR" 4
+.IX Item "file.hh"
+.PD 0
+.IP "\fIfile\fR\fB.H\fR" 4
+.IX Item "file.H"
+.IP "\fIfile\fR\fB.hp\fR" 4
+.IX Item "file.hp"
+.IP "\fIfile\fR\fB.hxx\fR" 4
+.IX Item "file.hxx"
+.IP "\fIfile\fR\fB.hpp\fR" 4
+.IX Item "file.hpp"
+.IP "\fIfile\fR\fB.HPP\fR" 4
+.IX Item "file.HPP"
+.IP "\fIfile\fR\fB.h++\fR" 4
+.IX Item "file.h++"
+.IP "\fIfile\fR\fB.tcc\fR" 4
+.IX Item "file.tcc"
+.PD
+\&\*(C+ header file to be turned into a precompiled header.
+.IP "\fIfile\fR\fB.f\fR" 4
+.IX Item "file.f"
+.PD 0
+.IP "\fIfile\fR\fB.for\fR" 4
+.IX Item "file.for"
+.IP "\fIfile\fR\fB.ftn\fR" 4
+.IX Item "file.ftn"
+.PD
+Fixed form Fortran source code which should not be preprocessed.
+.IP "\fIfile\fR\fB.F\fR" 4
+.IX Item "file.F"
+.PD 0
+.IP "\fIfile\fR\fB.FOR\fR" 4
+.IX Item "file.FOR"
+.IP "\fIfile\fR\fB.fpp\fR" 4
+.IX Item "file.fpp"
+.IP "\fIfile\fR\fB.FPP\fR" 4
+.IX Item "file.FPP"
+.IP "\fIfile\fR\fB.FTN\fR" 4
+.IX Item "file.FTN"
+.PD
+Fixed form Fortran source code which must be preprocessed (with the traditional
+preprocessor).
+.IP "\fIfile\fR\fB.f90\fR" 4
+.IX Item "file.f90"
+.PD 0
+.IP "\fIfile\fR\fB.f95\fR" 4
+.IX Item "file.f95"
+.IP "\fIfile\fR\fB.f03\fR" 4
+.IX Item "file.f03"
+.IP "\fIfile\fR\fB.f08\fR" 4
+.IX Item "file.f08"
+.PD
+Free form Fortran source code which should not be preprocessed.
+.IP "\fIfile\fR\fB.F90\fR" 4
+.IX Item "file.F90"
+.PD 0
+.IP "\fIfile\fR\fB.F95\fR" 4
+.IX Item "file.F95"
+.IP "\fIfile\fR\fB.F03\fR" 4
+.IX Item "file.F03"
+.IP "\fIfile\fR\fB.F08\fR" 4
+.IX Item "file.F08"
+.PD
+Free form Fortran source code which must be preprocessed (with the
+traditional preprocessor).
+.IP "\fIfile\fR\fB.ads\fR" 4
+.IX Item "file.ads"
+Ada source code file which contains a library unit declaration (a
+declaration of a package, subprogram, or generic, or a generic
+instantiation), or a library unit renaming declaration (a package,
+generic, or subprogram renaming declaration). Such files are also
+called \fIspecs\fR.
+.IP "\fIfile\fR\fB.adb\fR" 4
+.IX Item "file.adb"
+Ada source code file containing a library unit body (a subprogram or
+package body). Such files are also called \fIbodies\fR.
+.IP "\fIfile\fR\fB.s\fR" 4
+.IX Item "file.s"
+Assembler code.
+.IP "\fIfile\fR\fB.S\fR" 4
+.IX Item "file.S"
+.PD 0
+.IP "\fIfile\fR\fB.sx\fR" 4
+.IX Item "file.sx"
+.PD
+Assembler code which must be preprocessed.
+.IP "\fIother\fR" 4
+.IX Item "other"
+An object file to be fed straight into linking.
+Any file name with no recognized suffix is treated this way.
+.PP
+You can specify the input language explicitly with the \fB\-x\fR option:
+.IP "\fB\-x\fR \fIlanguage\fR" 4
+.IX Item "-x language"
+Specify explicitly the \fIlanguage\fR for the following input files
+(rather than letting the compiler choose a default based on the file
+name suffix). This option applies to all following input files until
+the next \fB\-x\fR option. Possible values for \fIlanguage\fR are:
+.Sp
+.Vb 8
+\& c c\-header c\-cpp\-output
+\& c++ c++\-header c++\-cpp\-output
+\& objective\-c objective\-c\-header objective\-c\-cpp\-output
+\& objective\-c++ objective\-c++\-header objective\-c++\-cpp\-output
+\& assembler assembler\-with\-cpp
+\& ada
+\& f77 f77\-cpp\-input f95 f95\-cpp\-input
+\& java
+.Ve
+.IP "\fB\-x none\fR" 4
+.IX Item "-x none"
+Turn off any specification of a language, so that subsequent files are
+handled according to their file name suffixes (as they are if \fB\-x\fR
+has not been used at all).
+.IP "\fB\-pass\-exit\-codes\fR" 4
+.IX Item "-pass-exit-codes"
+Normally the \fBgcc\fR program will exit with the code of 1 if any
+phase of the compiler returns a non-success return code. If you specify
+\&\fB\-pass\-exit\-codes\fR, the \fBgcc\fR program will instead return with
+numerically highest error produced by any phase that returned an error
+indication. The C, \*(C+, and Fortran frontends return 4, if an internal
+compiler error is encountered.
+.PP
+If you only want some of the stages of compilation, you can use
+\&\fB\-x\fR (or filename suffixes) to tell \fBgcc\fR where to start, and
+one of the options \fB\-c\fR, \fB\-S\fR, or \fB\-E\fR to say where
+\&\fBgcc\fR is to stop. Note that some combinations (for example,
+\&\fB\-x cpp-output \-E\fR) instruct \fBgcc\fR to do nothing at all.
+.IP "\fB\-c\fR" 4
+.IX Item "-c"
+Compile or assemble the source files, but do not link. The linking
+stage simply is not done. The ultimate output is in the form of an
+object file for each source file.
+.Sp
+By default, the object file name for a source file is made by replacing
+the suffix \fB.c\fR, \fB.i\fR, \fB.s\fR, etc., with \fB.o\fR.
+.Sp
+Unrecognized input files, not requiring compilation or assembly, are
+ignored.
+.IP "\fB\-S\fR" 4
+.IX Item "-S"
+Stop after the stage of compilation proper; do not assemble. The output
+is in the form of an assembler code file for each non-assembler input
+file specified.
+.Sp
+By default, the assembler file name for a source file is made by
+replacing the suffix \fB.c\fR, \fB.i\fR, etc., with \fB.s\fR.
+.Sp
+Input files that don't require compilation are ignored.
+.IP "\fB\-E\fR" 4
+.IX Item "-E"
+Stop after the preprocessing stage; do not run the compiler proper. The
+output is in the form of preprocessed source code, which is sent to the
+standard output.
+.Sp
+Input files which don't require preprocessing are ignored.
+.IP "\fB\-o\fR \fIfile\fR" 4
+.IX Item "-o file"
+Place output in file \fIfile\fR. This applies regardless to whatever
+sort of output is being produced, whether it be an executable file,
+an object file, an assembler file or preprocessed C code.
+.Sp
+If \fB\-o\fR is not specified, the default is to put an executable
+file in \fIa.out\fR, the object file for
+\&\fI\fIsource\fI.\fIsuffix\fI\fR in \fI\fIsource\fI.o\fR, its
+assembler file in \fI\fIsource\fI.s\fR, a precompiled header file in
+\&\fI\fIsource\fI.\fIsuffix\fI.gch\fR, and all preprocessed C source on
+standard output.
+.IP "\fB\-v\fR" 4
+.IX Item "-v"
+Print (on standard error output) the commands executed to run the stages
+of compilation. Also print the version number of the compiler driver
+program and of the preprocessor and the compiler proper.
+.IP "\fB\-###\fR" 4
+.IX Item "-###"
+Like \fB\-v\fR except the commands are not executed and all command
+arguments are quoted. This is useful for shell scripts to capture the
+driver-generated command lines.
+.IP "\fB\-pipe\fR" 4
+.IX Item "-pipe"
+Use pipes rather than temporary files for communication between the
+various stages of compilation. This fails to work on some systems where
+the assembler is unable to read from a pipe; but the \s-1GNU\s0 assembler has
+no trouble.
+.IP "\fB\-combine\fR" 4
+.IX Item "-combine"
+If you are compiling multiple source files, this option tells the driver
+to pass all the source files to the compiler at once (for those
+languages for which the compiler can handle this). This will allow
+intermodule analysis (\s-1IMA\s0) to be performed by the compiler. Currently the only
+language for which this is supported is C. If you pass source files for
+multiple languages to the driver, using this option, the driver will invoke
+the compiler(s) that support \s-1IMA\s0 once each, passing each compiler all the
+source files appropriate for it. For those languages that do not support
+\&\s-1IMA\s0 this option will be ignored, and the compiler will be invoked once for
+each source file in that language. If you use this option in conjunction
+with \fB\-save\-temps\fR, the compiler will generate multiple
+pre-processed files
+(one for each source file), but only one (combined) \fI.o\fR or
+\&\fI.s\fR file.
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
+Print (on the standard output) a description of the command line options
+understood by \fBgcc\fR. If the \fB\-v\fR option is also specified
+then \fB\-\-help\fR will also be passed on to the various processes
+invoked by \fBgcc\fR, so that they can display the command line options
+they accept. If the \fB\-Wextra\fR option has also been specified
+(prior to the \fB\-\-help\fR option), then command line options which
+have no documentation associated with them will also be displayed.
+.IP "\fB\-\-target\-help\fR" 4
+.IX Item "--target-help"
+Print (on the standard output) a description of target-specific command
+line options for each tool. For some targets extra target-specific
+information may also be printed.
+.IP "\fB\-\-help={\fR\fIclass\fR|[\fB^\fR]\fIqualifier\fR\fB}\fR[\fB,...\fR]" 4
+.IX Item "--help={class|[^]qualifier}[,...]"
+Print (on the standard output) a description of the command line
+options understood by the compiler that fit into all specified classes
+and qualifiers. These are the supported classes:
+.RS 4
+.IP "\fBoptimizers\fR" 4
+.IX Item "optimizers"
+This will display all of the optimization options supported by the
+compiler.
+.IP "\fBwarnings\fR" 4
+.IX Item "warnings"
+This will display all of the options controlling warning messages
+produced by the compiler.
+.IP "\fBtarget\fR" 4
+.IX Item "target"
+This will display target-specific options. Unlike the
+\&\fB\-\-target\-help\fR option however, target-specific options of the
+linker and assembler will not be displayed. This is because those
+tools do not currently support the extended \fB\-\-help=\fR syntax.
+.IP "\fBparams\fR" 4
+.IX Item "params"
+This will display the values recognized by the \fB\-\-param\fR
+option.
+.IP "\fIlanguage\fR" 4
+.IX Item "language"
+This will display the options supported for \fIlanguage\fR, where
+\&\fIlanguage\fR is the name of one of the languages supported in this
+version of \s-1GCC\s0.
+.IP "\fBcommon\fR" 4
+.IX Item "common"
+This will display the options that are common to all languages.
+.RE
+.RS 4
+.Sp
+These are the supported qualifiers:
+.IP "\fBundocumented\fR" 4
+.IX Item "undocumented"
+Display only those options which are undocumented.
+.IP "\fBjoined\fR" 4
+.IX Item "joined"
+Display options which take an argument that appears after an equal
+sign in the same continuous piece of text, such as:
+\&\fB\-\-help=target\fR.
+.IP "\fBseparate\fR" 4
+.IX Item "separate"
+Display options which take an argument that appears as a separate word
+following the original option, such as: \fB\-o output-file\fR.
+.RE
+.RS 4
+.Sp
+Thus for example to display all the undocumented target-specific
+switches supported by the compiler the following can be used:
+.Sp
+.Vb 1
+\& \-\-help=target,undocumented
+.Ve
+.Sp
+The sense of a qualifier can be inverted by prefixing it with the
+\&\fB^\fR character, so for example to display all binary warning
+options (i.e., ones that are either on or off and that do not take an
+argument), which have a description the following can be used:
+.Sp
+.Vb 1
+\& \-\-help=warnings,^joined,^undocumented
+.Ve
+.Sp
+The argument to \fB\-\-help=\fR should not consist solely of inverted
+qualifiers.
+.Sp
+Combining several classes is possible, although this usually
+restricts the output by so much that there is nothing to display. One
+case where it does work however is when one of the classes is
+\&\fItarget\fR. So for example to display all the target-specific
+optimization options the following can be used:
+.Sp
+.Vb 1
+\& \-\-help=target,optimizers
+.Ve
+.Sp
+The \fB\-\-help=\fR option can be repeated on the command line. Each
+successive use will display its requested class of options, skipping
+those that have already been displayed.
+.Sp
+If the \fB\-Q\fR option appears on the command line before the
+\&\fB\-\-help=\fR option, then the descriptive text displayed by
+\&\fB\-\-help=\fR is changed. Instead of describing the displayed
+options, an indication is given as to whether the option is enabled,
+disabled or set to a specific value (assuming that the compiler
+knows this at the point where the \fB\-\-help=\fR option is used).
+.Sp
+Here is a truncated example from the \s-1ARM\s0 port of \fBgcc\fR:
+.Sp
+.Vb 5
+\& % gcc \-Q \-mabi=2 \-\-help=target \-c
+\& The following options are target specific:
+\& \-mabi= 2
+\& \-mabort\-on\-noreturn [disabled]
+\& \-mapcs [disabled]
+.Ve
+.Sp
+The output is sensitive to the effects of previous command line
+options, so for example it is possible to find out which optimizations
+are enabled at \fB\-O2\fR by using:
+.Sp
+.Vb 1
+\& \-Q \-O2 \-\-help=optimizers
+.Ve
+.Sp
+Alternatively you can discover which binary optimizations are enabled
+by \fB\-O3\fR by using:
+.Sp
+.Vb 3
+\& gcc \-c \-Q \-O3 \-\-help=optimizers > /tmp/O3\-opts
+\& gcc \-c \-Q \-O2 \-\-help=optimizers > /tmp/O2\-opts
+\& diff /tmp/O2\-opts /tmp/O3\-opts | grep enabled
+.Ve
+.RE
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+Display the version number and copyrights of the invoked \s-1GCC\s0.
+.IP "\fB\-wrapper\fR" 4
+.IX Item "-wrapper"
+Invoke all subcommands under a wrapper program. It takes a single
+comma separated list as an argument, which will be used to invoke
+the wrapper:
+.Sp
+.Vb 1
+\& gcc \-c t.c \-wrapper gdb,\-\-args
+.Ve
+.Sp
+This will invoke all subprograms of gcc under \*(L"gdb \-\-args\*(R",
+thus cc1 invocation will be \*(L"gdb \-\-args cc1 ...\*(R".
+.IP "\fB@\fR\fIfile\fR" 4
+.IX Item "@file"
+Read command-line options from \fIfile\fR. The options read are
+inserted in place of the original @\fIfile\fR option. If \fIfile\fR
+does not exist, or cannot be read, then the option will be treated
+literally, and not removed.
+.Sp
+Options in \fIfile\fR are separated by whitespace. A whitespace
+character may be included in an option by surrounding the entire
+option in either single or double quotes. Any character (including a
+backslash) may be included by prefixing the character to be included
+with a backslash. The \fIfile\fR may itself contain additional
+@\fIfile\fR options; any such options will be processed recursively.
+.Sh "Compiling \*(C+ Programs"
+.IX Subsection "Compiling Programs"
+\&\*(C+ source files conventionally use one of the suffixes \fB.C\fR,
+\&\fB.cc\fR, \fB.cpp\fR, \fB.CPP\fR, \fB.c++\fR, \fB.cp\fR, or
+\&\fB.cxx\fR; \*(C+ header files often use \fB.hh\fR, \fB.hpp\fR,
+\&\fB.H\fR, or (for shared template code) \fB.tcc\fR; and
+preprocessed \*(C+ files use the suffix \fB.ii\fR. \s-1GCC\s0 recognizes
+files with these names and compiles them as \*(C+ programs even if you
+call the compiler the same way as for compiling C programs (usually
+with the name \fBgcc\fR).
+.PP
+However, the use of \fBgcc\fR does not add the \*(C+ library.
+\&\fBg++\fR is a program that calls \s-1GCC\s0 and treats \fB.c\fR,
+\&\fB.h\fR and \fB.i\fR files as \*(C+ source files instead of C source
+files unless \fB\-x\fR is used, and automatically specifies linking
+against the \*(C+ library. This program is also useful when
+precompiling a C header file with a \fB.h\fR extension for use in \*(C+
+compilations. On many systems, \fBg++\fR is also installed with
+the name \fBc++\fR.
+.PP
+When you compile \*(C+ programs, you may specify many of the same
+command-line options that you use for compiling programs in any
+language; or command-line options meaningful for C and related
+languages; or options that are meaningful only for \*(C+ programs.
+.Sh "Options Controlling C Dialect"
+.IX Subsection "Options Controlling C Dialect"
+The following options control the dialect of C (or languages derived
+from C, such as \*(C+, Objective-C and Objective\-\*(C+) that the compiler
+accepts:
+.IP "\fB\-ansi\fR" 4
+.IX Item "-ansi"
+In C mode, this is equivalent to \fB\-std=c89\fR. In \*(C+ mode, it is
+equivalent to \fB\-std=c++98\fR.
+.Sp
+This turns off certain features of \s-1GCC\s0 that are incompatible with \s-1ISO\s0
+C90 (when compiling C code), or of standard \*(C+ (when compiling \*(C+ code),
+such as the \f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`typeof\*(C'\fR keywords, and
+predefined macros such as \f(CW\*(C`unix\*(C'\fR and \f(CW\*(C`vax\*(C'\fR that identify the
+type of system you are using. It also enables the undesirable and
+rarely used \s-1ISO\s0 trigraph feature. For the C compiler,
+it disables recognition of \*(C+ style \fB//\fR comments as well as
+the \f(CW\*(C`inline\*(C'\fR keyword.
+.Sp
+The alternate keywords \f(CW\*(C`_\|_asm_\|_\*(C'\fR, \f(CW\*(C`_\|_extension_\|_\*(C'\fR,
+\&\f(CW\*(C`_\|_inline_\|_\*(C'\fR and \f(CW\*(C`_\|_typeof_\|_\*(C'\fR continue to work despite
+\&\fB\-ansi\fR. You would not want to use them in an \s-1ISO\s0 C program, of
+course, but it is useful to put them in header files that might be included
+in compilations done with \fB\-ansi\fR. Alternate predefined macros
+such as \f(CW\*(C`_\|_unix_\|_\*(C'\fR and \f(CW\*(C`_\|_vax_\|_\*(C'\fR are also available, with or
+without \fB\-ansi\fR.
+.Sp
+The \fB\-ansi\fR option does not cause non-ISO programs to be
+rejected gratuitously. For that, \fB\-pedantic\fR is required in
+addition to \fB\-ansi\fR.
+.Sp
+The macro \f(CW\*(C`_\|_STRICT_ANSI_\|_\*(C'\fR is predefined when the \fB\-ansi\fR
+option is used. Some header files may notice this macro and refrain
+from declaring certain functions or defining certain macros that the
+\&\s-1ISO\s0 standard doesn't call for; this is to avoid interfering with any
+programs that might use these names for other things.
+.Sp
+Functions that would normally be built in but do not have semantics
+defined by \s-1ISO\s0 C (such as \f(CW\*(C`alloca\*(C'\fR and \f(CW\*(C`ffs\*(C'\fR) are not built-in
+functions when \fB\-ansi\fR is used.
+.IP "\fB\-std=\fR" 4
+.IX Item "-std="
+Determine the language standard. This option
+is currently only supported when compiling C or \*(C+.
+.Sp
+The compiler can accept several base standards, such as \fBc89\fR or
+\&\fBc++98\fR, and \s-1GNU\s0 dialects of those standards, such as
+\&\fBgnu89\fR or \fBgnu++98\fR. By specifying a base standard, the
+compiler will accept all programs following that standard and those
+using \s-1GNU\s0 extensions that do not contradict it. For example,
+\&\fB\-std=c89\fR turns off certain features of \s-1GCC\s0 that are
+incompatible with \s-1ISO\s0 C90, such as the \f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`typeof\*(C'\fR
+keywords, but not other \s-1GNU\s0 extensions that do not have a meaning in
+\&\s-1ISO\s0 C90, such as omitting the middle term of a \f(CW\*(C`?:\*(C'\fR
+expression. On the other hand, by specifying a \s-1GNU\s0 dialect of a
+standard, all features the compiler support are enabled, even when
+those features change the meaning of the base standard and some
+strict-conforming programs may be rejected. The particular standard
+is used by \fB\-pedantic\fR to identify which features are \s-1GNU\s0
+extensions given that version of the standard. For example
+\&\fB\-std=gnu89 \-pedantic\fR would warn about \*(C+ style \fB//\fR
+comments, while \fB\-std=gnu99 \-pedantic\fR would not.
+.Sp
+A value for this option must be provided; possible values are
+.RS 4
+.IP "\fBc89\fR" 4
+.IX Item "c89"
+.PD 0
+.IP "\fBiso9899:1990\fR" 4
+.IX Item "iso9899:1990"
+.PD
+Support all \s-1ISO\s0 C90 programs (certain \s-1GNU\s0 extensions that conflict
+with \s-1ISO\s0 C90 are disabled). Same as \fB\-ansi\fR for C code.
+.IP "\fBiso9899:199409\fR" 4
+.IX Item "iso9899:199409"
+\&\s-1ISO\s0 C90 as modified in amendment 1.
+.IP "\fBc99\fR" 4
+.IX Item "c99"
+.PD 0
+.IP "\fBc9x\fR" 4
+.IX Item "c9x"
+.IP "\fBiso9899:1999\fR" 4
+.IX Item "iso9899:1999"
+.IP "\fBiso9899:199x\fR" 4
+.IX Item "iso9899:199x"
+.PD
+\&\s-1ISO\s0 C99. Note that this standard is not yet fully supported; see
+<\fBhttp://gcc.gnu.org/gcc\-4.4/c99status.html\fR> for more information. The
+names \fBc9x\fR and \fBiso9899:199x\fR are deprecated.
+.IP "\fBgnu89\fR" 4
+.IX Item "gnu89"
+\&\s-1GNU\s0 dialect of \s-1ISO\s0 C90 (including some C99 features). This
+is the default for C code.
+.IP "\fBgnu99\fR" 4
+.IX Item "gnu99"
+.PD 0
+.IP "\fBgnu9x\fR" 4
+.IX Item "gnu9x"
+.PD
+\&\s-1GNU\s0 dialect of \s-1ISO\s0 C99. When \s-1ISO\s0 C99 is fully implemented in \s-1GCC\s0,
+this will become the default. The name \fBgnu9x\fR is deprecated.
+.IP "\fBc++98\fR" 4
+.IX Item "c++98"
+The 1998 \s-1ISO\s0 \*(C+ standard plus amendments. Same as \fB\-ansi\fR for
+\&\*(C+ code.
+.IP "\fBgnu++98\fR" 4
+.IX Item "gnu++98"
+\&\s-1GNU\s0 dialect of \fB\-std=c++98\fR. This is the default for
+\&\*(C+ code.
+.IP "\fBc++0x\fR" 4
+.IX Item "c++0x"
+The working draft of the upcoming \s-1ISO\s0 \*(C+0x standard. This option
+enables experimental features that are likely to be included in
+\&\*(C+0x. The working draft is constantly changing, and any feature that is
+enabled by this flag may be removed from future versions of \s-1GCC\s0 if it is
+not part of the \*(C+0x standard.
+.IP "\fBgnu++0x\fR" 4
+.IX Item "gnu++0x"
+\&\s-1GNU\s0 dialect of \fB\-std=c++0x\fR. This option enables
+experimental features that may be removed in future versions of \s-1GCC\s0.
+.RE
+.RS 4
+.RE
+.IP "\fB\-fgnu89\-inline\fR" 4
+.IX Item "-fgnu89-inline"
+The option \fB\-fgnu89\-inline\fR tells \s-1GCC\s0 to use the traditional
+\&\s-1GNU\s0 semantics for \f(CW\*(C`inline\*(C'\fR functions when in C99 mode.
+ This option
+is accepted and ignored by \s-1GCC\s0 versions 4.1.3 up to but not including
+4.3. In \s-1GCC\s0 versions 4.3 and later it changes the behavior of \s-1GCC\s0 in
+C99 mode. Using this option is roughly equivalent to adding the
+\&\f(CW\*(C`gnu_inline\*(C'\fR function attribute to all inline functions.
+.Sp
+The option \fB\-fno\-gnu89\-inline\fR explicitly tells \s-1GCC\s0 to use the
+C99 semantics for \f(CW\*(C`inline\*(C'\fR when in C99 or gnu99 mode (i.e., it
+specifies the default behavior). This option was first supported in
+\&\s-1GCC\s0 4.3. This option is not supported in C89 or gnu89 mode.
+.Sp
+The preprocessor macros \f(CW\*(C`_\|_GNUC_GNU_INLINE_\|_\*(C'\fR and
+\&\f(CW\*(C`_\|_GNUC_STDC_INLINE_\|_\*(C'\fR may be used to check which semantics are
+in effect for \f(CW\*(C`inline\*(C'\fR functions.
+.IP "\fB\-aux\-info\fR \fIfilename\fR" 4
+.IX Item "-aux-info filename"
+Output to the given filename prototyped declarations for all functions
+declared and/or defined in a translation unit, including those in header
+files. This option is silently ignored in any language other than C.
+.Sp
+Besides declarations, the file indicates, in comments, the origin of
+each declaration (source file and line), whether the declaration was
+implicit, prototyped or unprototyped (\fBI\fR, \fBN\fR for new or
+\&\fBO\fR for old, respectively, in the first character after the line
+number and the colon), and whether it came from a declaration or a
+definition (\fBC\fR or \fBF\fR, respectively, in the following
+character). In the case of function definitions, a K&R\-style list of
+arguments followed by their declarations is also provided, inside
+comments, after the declaration.
+.IP "\fB\-fno\-asm\fR" 4
+.IX Item "-fno-asm"
+Do not recognize \f(CW\*(C`asm\*(C'\fR, \f(CW\*(C`inline\*(C'\fR or \f(CW\*(C`typeof\*(C'\fR as a
+keyword, so that code can use these words as identifiers. You can use
+the keywords \f(CW\*(C`_\|_asm_\|_\*(C'\fR, \f(CW\*(C`_\|_inline_\|_\*(C'\fR and \f(CW\*(C`_\|_typeof_\|_\*(C'\fR
+instead. \fB\-ansi\fR implies \fB\-fno\-asm\fR.
+.Sp
+In \*(C+, this switch only affects the \f(CW\*(C`typeof\*(C'\fR keyword, since
+\&\f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`inline\*(C'\fR are standard keywords. You may want to
+use the \fB\-fno\-gnu\-keywords\fR flag instead, which has the same
+effect. In C99 mode (\fB\-std=c99\fR or \fB\-std=gnu99\fR), this
+switch only affects the \f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`typeof\*(C'\fR keywords, since
+\&\f(CW\*(C`inline\*(C'\fR is a standard keyword in \s-1ISO\s0 C99.
+.IP "\fB\-fno\-builtin\fR" 4
+.IX Item "-fno-builtin"
+.PD 0
+.IP "\fB\-fno\-builtin\-\fR\fIfunction\fR" 4
+.IX Item "-fno-builtin-function"
+.PD
+Don't recognize built-in functions that do not begin with
+\&\fB_\|_builtin_\fR as prefix.
+.Sp
+\&\s-1GCC\s0 normally generates special code to handle certain built-in functions
+more efficiently; for instance, calls to \f(CW\*(C`alloca\*(C'\fR may become single
+instructions that adjust the stack directly, and calls to \f(CW\*(C`memcpy\*(C'\fR
+may become inline copy loops. The resulting code is often both smaller
+and faster, but since the function calls no longer appear as such, you
+cannot set a breakpoint on those calls, nor can you change the behavior
+of the functions by linking with a different library. In addition,
+when a function is recognized as a built-in function, \s-1GCC\s0 may use
+information about that function to warn about problems with calls to
+that function, or to generate more efficient code, even if the
+resulting code still contains calls to that function. For example,
+warnings are given with \fB\-Wformat\fR for bad calls to
+\&\f(CW\*(C`printf\*(C'\fR, when \f(CW\*(C`printf\*(C'\fR is built in, and \f(CW\*(C`strlen\*(C'\fR is
+known not to modify global memory.
+.Sp
+With the \fB\-fno\-builtin\-\fR\fIfunction\fR option
+only the built-in function \fIfunction\fR is
+disabled. \fIfunction\fR must not begin with \fB_\|_builtin_\fR. If a
+function is named that is not built-in in this version of \s-1GCC\s0, this
+option is ignored. There is no corresponding
+\&\fB\-fbuiltin\-\fR\fIfunction\fR option; if you wish to enable
+built-in functions selectively when using \fB\-fno\-builtin\fR or
+\&\fB\-ffreestanding\fR, you may define macros such as:
+.Sp
+.Vb 2
+\& #define abs(n) _\|_builtin_abs ((n))
+\& #define strcpy(d, s) _\|_builtin_strcpy ((d), (s))
+.Ve
+.IP "\fB\-fhosted\fR" 4
+.IX Item "-fhosted"
+Assert that compilation takes place in a hosted environment. This implies
+\&\fB\-fbuiltin\fR. A hosted environment is one in which the
+entire standard library is available, and in which \f(CW\*(C`main\*(C'\fR has a return
+type of \f(CW\*(C`int\*(C'\fR. Examples are nearly everything except a kernel.
+This is equivalent to \fB\-fno\-freestanding\fR.
+.IP "\fB\-ffreestanding\fR" 4
+.IX Item "-ffreestanding"
+Assert that compilation takes place in a freestanding environment. This
+implies \fB\-fno\-builtin\fR. A freestanding environment
+is one in which the standard library may not exist, and program startup may
+not necessarily be at \f(CW\*(C`main\*(C'\fR. The most obvious example is an \s-1OS\s0 kernel.
+This is equivalent to \fB\-fno\-hosted\fR.
+.IP "\fB\-fopenmp\fR" 4
+.IX Item "-fopenmp"
+Enable handling of OpenMP directives \f(CW\*(C`#pragma omp\*(C'\fR in C/\*(C+ and
+\&\f(CW\*(C`!$omp\*(C'\fR in Fortran. When \fB\-fopenmp\fR is specified, the
+compiler generates parallel code according to the OpenMP Application
+Program Interface v2.5 <\fBhttp://www.openmp.org/\fR>. This option
+implies \fB\-pthread\fR, and thus is only supported on targets that
+have support for \fB\-pthread\fR.
+.IP "\fB\-fms\-extensions\fR" 4
+.IX Item "-fms-extensions"
+Accept some non-standard constructs used in Microsoft header files.
+.Sp
+Some cases of unnamed fields in structures and unions are only
+accepted with this option.
+.IP "\fB\-trigraphs\fR" 4
+.IX Item "-trigraphs"
+Support \s-1ISO\s0 C trigraphs. The \fB\-ansi\fR option (and \fB\-std\fR
+options for strict \s-1ISO\s0 C conformance) implies \fB\-trigraphs\fR.
+.IP "\fB\-no\-integrated\-cpp\fR" 4
+.IX Item "-no-integrated-cpp"
+Performs a compilation in two passes: preprocessing and compiling. This
+option allows a user supplied \*(L"cc1\*(R", \*(L"cc1plus\*(R", or \*(L"cc1obj\*(R" via the
+\&\fB\-B\fR option. The user supplied compilation step can then add in
+an additional preprocessing step after normal preprocessing but before
+compiling. The default is to use the integrated cpp (internal cpp)
+.Sp
+The semantics of this option will change if \*(L"cc1\*(R", \*(L"cc1plus\*(R", and
+\&\*(L"cc1obj\*(R" are merged.
+.IP "\fB\-traditional\fR" 4
+.IX Item "-traditional"
+.PD 0
+.IP "\fB\-traditional\-cpp\fR" 4
+.IX Item "-traditional-cpp"
+.PD
+Formerly, these options caused \s-1GCC\s0 to attempt to emulate a pre-standard
+C compiler. They are now only supported with the \fB\-E\fR switch.
+The preprocessor continues to support a pre-standard mode. See the \s-1GNU\s0
+\&\s-1CPP\s0 manual for details.
+.IP "\fB\-fcond\-mismatch\fR" 4
+.IX Item "-fcond-mismatch"
+Allow conditional expressions with mismatched types in the second and
+third arguments. The value of such an expression is void. This option
+is not supported for \*(C+.
+.IP "\fB\-flax\-vector\-conversions\fR" 4
+.IX Item "-flax-vector-conversions"
+Allow implicit conversions between vectors with differing numbers of
+elements and/or incompatible element types. This option should not be
+used for new code.
+.IP "\fB\-funsigned\-char\fR" 4
+.IX Item "-funsigned-char"
+Let the type \f(CW\*(C`char\*(C'\fR be unsigned, like \f(CW\*(C`unsigned char\*(C'\fR.
+.Sp
+Each kind of machine has a default for what \f(CW\*(C`char\*(C'\fR should
+be. It is either like \f(CW\*(C`unsigned char\*(C'\fR by default or like
+\&\f(CW\*(C`signed char\*(C'\fR by default.
+.Sp
+Ideally, a portable program should always use \f(CW\*(C`signed char\*(C'\fR or
+\&\f(CW\*(C`unsigned char\*(C'\fR when it depends on the signedness of an object.
+But many programs have been written to use plain \f(CW\*(C`char\*(C'\fR and
+expect it to be signed, or expect it to be unsigned, depending on the
+machines they were written for. This option, and its inverse, let you
+make such a program work with the opposite default.
+.Sp
+The type \f(CW\*(C`char\*(C'\fR is always a distinct type from each of
+\&\f(CW\*(C`signed char\*(C'\fR or \f(CW\*(C`unsigned char\*(C'\fR, even though its behavior
+is always just like one of those two.
+.IP "\fB\-fsigned\-char\fR" 4
+.IX Item "-fsigned-char"
+Let the type \f(CW\*(C`char\*(C'\fR be signed, like \f(CW\*(C`signed char\*(C'\fR.
+.Sp
+Note that this is equivalent to \fB\-fno\-unsigned\-char\fR, which is
+the negative form of \fB\-funsigned\-char\fR. Likewise, the option
+\&\fB\-fno\-signed\-char\fR is equivalent to \fB\-funsigned\-char\fR.
+.IP "\fB\-fsigned\-bitfields\fR" 4
+.IX Item "-fsigned-bitfields"
+.PD 0
+.IP "\fB\-funsigned\-bitfields\fR" 4
+.IX Item "-funsigned-bitfields"
+.IP "\fB\-fno\-signed\-bitfields\fR" 4
+.IX Item "-fno-signed-bitfields"
+.IP "\fB\-fno\-unsigned\-bitfields\fR" 4
+.IX Item "-fno-unsigned-bitfields"
+.PD
+These options control whether a bit-field is signed or unsigned, when the
+declaration does not use either \f(CW\*(C`signed\*(C'\fR or \f(CW\*(C`unsigned\*(C'\fR. By
+default, such a bit-field is signed, because this is consistent: the
+basic integer types such as \f(CW\*(C`int\*(C'\fR are signed types.
+.Sh "Options Controlling \*(C+ Dialect"
+.IX Subsection "Options Controlling Dialect"
+This section describes the command-line options that are only meaningful
+for \*(C+ programs; but you can also use most of the \s-1GNU\s0 compiler options
+regardless of what language your program is in. For example, you
+might compile a file \f(CW\*(C`firstClass.C\*(C'\fR like this:
+.PP
+.Vb 1
+\& g++ \-g \-frepo \-O \-c firstClass.C
+.Ve
+.PP
+In this example, only \fB\-frepo\fR is an option meant
+only for \*(C+ programs; you can use the other options with any
+language supported by \s-1GCC\s0.
+.PP
+Here is a list of options that are \fIonly\fR for compiling \*(C+ programs:
+.IP "\fB\-fabi\-version=\fR\fIn\fR" 4
+.IX Item "-fabi-version=n"
+Use version \fIn\fR of the \*(C+ \s-1ABI\s0. Version 2 is the version of the
+\&\*(C+ \s-1ABI\s0 that first appeared in G++ 3.4. Version 1 is the version of
+the \*(C+ \s-1ABI\s0 that first appeared in G++ 3.2. Version 0 will always be
+the version that conforms most closely to the \*(C+ \s-1ABI\s0 specification.
+Therefore, the \s-1ABI\s0 obtained using version 0 will change as \s-1ABI\s0 bugs
+are fixed.
+.Sp
+The default is version 2.
+.IP "\fB\-fno\-access\-control\fR" 4
+.IX Item "-fno-access-control"
+Turn off all access checking. This switch is mainly useful for working
+around bugs in the access control code.
+.IP "\fB\-fcheck\-new\fR" 4
+.IX Item "-fcheck-new"
+Check that the pointer returned by \f(CW\*(C`operator new\*(C'\fR is non-null
+before attempting to modify the storage allocated. This check is
+normally unnecessary because the \*(C+ standard specifies that
+\&\f(CW\*(C`operator new\*(C'\fR will only return \f(CW0\fR if it is declared
+\&\fB\f(BIthrow()\fB\fR, in which case the compiler will always check the
+return value even without this option. In all other cases, when
+\&\f(CW\*(C`operator new\*(C'\fR has a non-empty exception specification, memory
+exhaustion is signalled by throwing \f(CW\*(C`std::bad_alloc\*(C'\fR. See also
+\&\fBnew (nothrow)\fR.
+.IP "\fB\-fconserve\-space\fR" 4
+.IX Item "-fconserve-space"
+Put uninitialized or runtime-initialized global variables into the
+common segment, as C does. This saves space in the executable at the
+cost of not diagnosing duplicate definitions. If you compile with this
+flag and your program mysteriously crashes after \f(CW\*(C`main()\*(C'\fR has
+completed, you may have an object that is being destroyed twice because
+two definitions were merged.
+.Sp
+This option is no longer useful on most targets, now that support has
+been added for putting variables into \s-1BSS\s0 without making them common.
+.IP "\fB\-fno\-deduce\-init\-list\fR" 4
+.IX Item "-fno-deduce-init-list"
+Disable deduction of a template type parameter as
+std::initializer_list from a brace-enclosed initializer list, i.e.
+.Sp
+.Vb 4
+\& template <class T> auto forward(T t) \-> decltype (realfn (t))
+\& {
+\& return realfn (t);
+\& }
+\&
+\& void f()
+\& {
+\& forward({1,2}); // call forward<std::initializer_list<int>>
+\& }
+.Ve
+.Sp
+This option is present because this deduction is an extension to the
+current specification in the \*(C+0x working draft, and there was
+some concern about potential overload resolution problems.
+.IP "\fB\-ffriend\-injection\fR" 4
+.IX Item "-ffriend-injection"
+Inject friend functions into the enclosing namespace, so that they are
+visible outside the scope of the class in which they are declared.
+Friend functions were documented to work this way in the old Annotated
+\&\*(C+ Reference Manual, and versions of G++ before 4.1 always worked
+that way. However, in \s-1ISO\s0 \*(C+ a friend function which is not declared
+in an enclosing scope can only be found using argument dependent
+lookup. This option causes friends to be injected as they were in
+earlier releases.
+.Sp
+This option is for compatibility, and may be removed in a future
+release of G++.
+.IP "\fB\-fno\-elide\-constructors\fR" 4
+.IX Item "-fno-elide-constructors"
+The \*(C+ standard allows an implementation to omit creating a temporary
+which is only used to initialize another object of the same type.
+Specifying this option disables that optimization, and forces G++ to
+call the copy constructor in all cases.
+.IP "\fB\-fno\-enforce\-eh\-specs\fR" 4
+.IX Item "-fno-enforce-eh-specs"
+Don't generate code to check for violation of exception specifications
+at runtime. This option violates the \*(C+ standard, but may be useful
+for reducing code size in production builds, much like defining
+\&\fB\s-1NDEBUG\s0\fR. This does not give user code permission to throw
+exceptions in violation of the exception specifications; the compiler
+will still optimize based on the specifications, so throwing an
+unexpected exception will result in undefined behavior.
+.IP "\fB\-ffor\-scope\fR" 4
+.IX Item "-ffor-scope"
+.PD 0
+.IP "\fB\-fno\-for\-scope\fR" 4
+.IX Item "-fno-for-scope"
+.PD
+If \fB\-ffor\-scope\fR is specified, the scope of variables declared in
+a \fIfor-init-statement\fR is limited to the \fBfor\fR loop itself,
+as specified by the \*(C+ standard.
+If \fB\-fno\-for\-scope\fR is specified, the scope of variables declared in
+a \fIfor-init-statement\fR extends to the end of the enclosing scope,
+as was the case in old versions of G++, and other (traditional)
+implementations of \*(C+.
+.Sp
+The default if neither flag is given to follow the standard,
+but to allow and give a warning for old-style code that would
+otherwise be invalid, or have different behavior.
+.IP "\fB\-fno\-gnu\-keywords\fR" 4
+.IX Item "-fno-gnu-keywords"
+Do not recognize \f(CW\*(C`typeof\*(C'\fR as a keyword, so that code can use this
+word as an identifier. You can use the keyword \f(CW\*(C`_\|_typeof_\|_\*(C'\fR instead.
+\&\fB\-ansi\fR implies \fB\-fno\-gnu\-keywords\fR.
+.IP "\fB\-fno\-implicit\-templates\fR" 4
+.IX Item "-fno-implicit-templates"
+Never emit code for non-inline templates which are instantiated
+implicitly (i.e. by use); only emit code for explicit instantiations.
+.IP "\fB\-fno\-implicit\-inline\-templates\fR" 4
+.IX Item "-fno-implicit-inline-templates"
+Don't emit code for implicit instantiations of inline templates, either.
+The default is to handle inlines differently so that compiles with and
+without optimization will need the same set of explicit instantiations.
+.IP "\fB\-fno\-implement\-inlines\fR" 4
+.IX Item "-fno-implement-inlines"
+To save space, do not emit out-of-line copies of inline functions
+controlled by \fB#pragma implementation\fR. This will cause linker
+errors if these functions are not inlined everywhere they are called.
+.IP "\fB\-fms\-extensions\fR" 4
+.IX Item "-fms-extensions"
+Disable pedantic warnings about constructs used in \s-1MFC\s0, such as implicit
+int and getting a pointer to member function via non-standard syntax.
+.IP "\fB\-fno\-nonansi\-builtins\fR" 4
+.IX Item "-fno-nonansi-builtins"
+Disable built-in declarations of functions that are not mandated by
+\&\s-1ANSI/ISO\s0 C. These include \f(CW\*(C`ffs\*(C'\fR, \f(CW\*(C`alloca\*(C'\fR, \f(CW\*(C`_exit\*(C'\fR,
+\&\f(CW\*(C`index\*(C'\fR, \f(CW\*(C`bzero\*(C'\fR, \f(CW\*(C`conjf\*(C'\fR, and other related functions.
+.IP "\fB\-fno\-operator\-names\fR" 4
+.IX Item "-fno-operator-names"
+Do not treat the operator name keywords \f(CW\*(C`and\*(C'\fR, \f(CW\*(C`bitand\*(C'\fR,
+\&\f(CW\*(C`bitor\*(C'\fR, \f(CW\*(C`compl\*(C'\fR, \f(CW\*(C`not\*(C'\fR, \f(CW\*(C`or\*(C'\fR and \f(CW\*(C`xor\*(C'\fR as
+synonyms as keywords.
+.IP "\fB\-fno\-optional\-diags\fR" 4
+.IX Item "-fno-optional-diags"
+Disable diagnostics that the standard says a compiler does not need to
+issue. Currently, the only such diagnostic issued by G++ is the one for
+a name having multiple meanings within a class.
+.IP "\fB\-fpermissive\fR" 4
+.IX Item "-fpermissive"
+Downgrade some diagnostics about nonconformant code from errors to
+warnings. Thus, using \fB\-fpermissive\fR will allow some
+nonconforming code to compile.
+.IP "\fB\-frepo\fR" 4
+.IX Item "-frepo"
+Enable automatic template instantiation at link time. This option also
+implies \fB\-fno\-implicit\-templates\fR.
+.IP "\fB\-fno\-rtti\fR" 4
+.IX Item "-fno-rtti"
+Disable generation of information about every class with virtual
+functions for use by the \*(C+ runtime type identification features
+(\fBdynamic_cast\fR and \fBtypeid\fR). If you don't use those parts
+of the language, you can save some space by using this flag. Note that
+exception handling uses the same information, but it will generate it as
+needed. The \fBdynamic_cast\fR operator can still be used for casts that
+do not require runtime type information, i.e. casts to \f(CW\*(C`void *\*(C'\fR or to
+unambiguous base classes.
+.IP "\fB\-fstats\fR" 4
+.IX Item "-fstats"
+Emit statistics about front-end processing at the end of the compilation.
+This information is generally only useful to the G++ development team.
+.IP "\fB\-ftemplate\-depth\-\fR\fIn\fR" 4
+.IX Item "-ftemplate-depth-n"
+Set the maximum instantiation depth for template classes to \fIn\fR.
+A limit on the template instantiation depth is needed to detect
+endless recursions during template class instantiation. \s-1ANSI/ISO\s0 \*(C+
+conforming programs must not rely on a maximum depth greater than 17.
+.IP "\fB\-fno\-threadsafe\-statics\fR" 4
+.IX Item "-fno-threadsafe-statics"
+Do not emit the extra code to use the routines specified in the \*(C+
+\&\s-1ABI\s0 for thread-safe initialization of local statics. You can use this
+option to reduce code size slightly in code that doesn't need to be
+thread-safe.
+.IP "\fB\-fuse\-cxa\-atexit\fR" 4
+.IX Item "-fuse-cxa-atexit"
+Register destructors for objects with static storage duration with the
+\&\f(CW\*(C`_\|_cxa_atexit\*(C'\fR function rather than the \f(CW\*(C`atexit\*(C'\fR function.
+This option is required for fully standards-compliant handling of static
+destructors, but will only work if your C library supports
+\&\f(CW\*(C`_\|_cxa_atexit\*(C'\fR.
+.IP "\fB\-fno\-use\-cxa\-get\-exception\-ptr\fR" 4
+.IX Item "-fno-use-cxa-get-exception-ptr"
+Don't use the \f(CW\*(C`_\|_cxa_get_exception_ptr\*(C'\fR runtime routine. This
+will cause \f(CW\*(C`std::uncaught_exception\*(C'\fR to be incorrect, but is necessary
+if the runtime routine is not available.
+.IP "\fB\-fvisibility\-inlines\-hidden\fR" 4
+.IX Item "-fvisibility-inlines-hidden"
+This switch declares that the user does not attempt to compare
+pointers to inline methods where the addresses of the two functions
+were taken in different shared objects.
+.Sp
+The effect of this is that \s-1GCC\s0 may, effectively, mark inline methods with
+\&\f(CW\*(C`_\|_attribute_\|_ ((visibility ("hidden")))\*(C'\fR so that they do not
+appear in the export table of a \s-1DSO\s0 and do not require a \s-1PLT\s0 indirection
+when used within the \s-1DSO\s0. Enabling this option can have a dramatic effect
+on load and link times of a \s-1DSO\s0 as it massively reduces the size of the
+dynamic export table when the library makes heavy use of templates.
+.Sp
+The behavior of this switch is not quite the same as marking the
+methods as hidden directly, because it does not affect static variables
+local to the function or cause the compiler to deduce that
+the function is defined in only one shared object.
+.Sp
+You may mark a method as having a visibility explicitly to negate the
+effect of the switch for that method. For example, if you do want to
+compare pointers to a particular inline method, you might mark it as
+having default visibility. Marking the enclosing class with explicit
+visibility will have no effect.
+.Sp
+Explicitly instantiated inline methods are unaffected by this option
+as their linkage might otherwise cross a shared library boundary.
+.IP "\fB\-fvisibility\-ms\-compat\fR" 4
+.IX Item "-fvisibility-ms-compat"
+This flag attempts to use visibility settings to make \s-1GCC\s0's \*(C+
+linkage model compatible with that of Microsoft Visual Studio.
+.Sp
+The flag makes these changes to \s-1GCC\s0's linkage model:
+.RS 4
+.IP "1." 4
+It sets the default visibility to \f(CW\*(C`hidden\*(C'\fR, like
+\&\fB\-fvisibility=hidden\fR.
+.IP "2." 4
+Types, but not their members, are not hidden by default.
+.IP "3." 4
+The One Definition Rule is relaxed for types without explicit
+visibility specifications which are defined in more than one different
+shared object: those declarations are permitted if they would have
+been permitted when this option was not used.
+.RE
+.RS 4
+.Sp
+In new code it is better to use \fB\-fvisibility=hidden\fR and
+export those classes which are intended to be externally visible.
+Unfortunately it is possible for code to rely, perhaps accidentally,
+on the Visual Studio behavior.
+.Sp
+Among the consequences of these changes are that static data members
+of the same type with the same name but defined in different shared
+objects will be different, so changing one will not change the other;
+and that pointers to function members defined in different shared
+objects may not compare equal. When this flag is given, it is a
+violation of the \s-1ODR\s0 to define types with the same name differently.
+.RE
+.IP "\fB\-fno\-weak\fR" 4
+.IX Item "-fno-weak"
+Do not use weak symbol support, even if it is provided by the linker.
+By default, G++ will use weak symbols if they are available. This
+option exists only for testing, and should not be used by end-users;
+it will result in inferior code and has no benefits. This option may
+be removed in a future release of G++.
+.IP "\fB\-nostdinc++\fR" 4
+.IX Item "-nostdinc++"
+Do not search for header files in the standard directories specific to
+\&\*(C+, but do still search the other standard directories. (This option
+is used when building the \*(C+ library.)
+.PP
+In addition, these optimization, warning, and code generation options
+have meanings only for \*(C+ programs:
+.IP "\fB\-fno\-default\-inline\fR" 4
+.IX Item "-fno-default-inline"
+Do not assume \fBinline\fR for functions defined inside a class scope.
+ Note that these
+functions will have linkage like inline functions; they just won't be
+inlined by default.
+.IP "\fB\-Wabi\fR (C, Objective-C, \*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wabi (C, Objective-C, and Objective- only)"
+Warn when G++ generates code that is probably not compatible with the
+vendor-neutral \*(C+ \s-1ABI\s0. Although an effort has been made to warn about
+all such cases, there are probably some cases that are not warned about,
+even though G++ is generating incompatible code. There may also be
+cases where warnings are emitted even though the code that is generated
+will be compatible.
+.Sp
+You should rewrite your code to avoid these warnings if you are
+concerned about the fact that code generated by G++ may not be binary
+compatible with code generated by other compilers.
+.Sp
+The known incompatibilities at this point include:
+.RS 4
+.IP "\(bu" 4
+Incorrect handling of tail-padding for bit-fields. G++ may attempt to
+pack data into the same byte as a base class. For example:
+.Sp
+.Vb 2
+\& struct A { virtual void f(); int f1 : 1; };
+\& struct B : public A { int f2 : 1; };
+.Ve
+.Sp
+In this case, G++ will place \f(CW\*(C`B::f2\*(C'\fR into the same byte
+as\f(CW\*(C`A::f1\*(C'\fR; other compilers will not. You can avoid this problem
+by explicitly padding \f(CW\*(C`A\*(C'\fR so that its size is a multiple of the
+byte size on your platform; that will cause G++ and other compilers to
+layout \f(CW\*(C`B\*(C'\fR identically.
+.IP "\(bu" 4
+Incorrect handling of tail-padding for virtual bases. G++ does not use
+tail padding when laying out virtual bases. For example:
+.Sp
+.Vb 3
+\& struct A { virtual void f(); char c1; };
+\& struct B { B(); char c2; };
+\& struct C : public A, public virtual B {};
+.Ve
+.Sp
+In this case, G++ will not place \f(CW\*(C`B\*(C'\fR into the tail-padding for
+\&\f(CW\*(C`A\*(C'\fR; other compilers will. You can avoid this problem by
+explicitly padding \f(CW\*(C`A\*(C'\fR so that its size is a multiple of its
+alignment (ignoring virtual base classes); that will cause G++ and other
+compilers to layout \f(CW\*(C`C\*(C'\fR identically.
+.IP "\(bu" 4
+Incorrect handling of bit-fields with declared widths greater than that
+of their underlying types, when the bit-fields appear in a union. For
+example:
+.Sp
+.Vb 1
+\& union U { int i : 4096; };
+.Ve
+.Sp
+Assuming that an \f(CW\*(C`int\*(C'\fR does not have 4096 bits, G++ will make the
+union too small by the number of bits in an \f(CW\*(C`int\*(C'\fR.
+.IP "\(bu" 4
+Empty classes can be placed at incorrect offsets. For example:
+.Sp
+.Vb 1
+\& struct A {};
+\&
+\& struct B {
+\& A a;
+\& virtual void f ();
+\& };
+\&
+\& struct C : public B, public A {};
+.Ve
+.Sp
+G++ will place the \f(CW\*(C`A\*(C'\fR base class of \f(CW\*(C`C\*(C'\fR at a nonzero offset;
+it should be placed at offset zero. G++ mistakenly believes that the
+\&\f(CW\*(C`A\*(C'\fR data member of \f(CW\*(C`B\*(C'\fR is already at offset zero.
+.IP "\(bu" 4
+Names of template functions whose types involve \f(CW\*(C`typename\*(C'\fR or
+template template parameters can be mangled incorrectly.
+.Sp
+.Vb 2
+\& template <typename Q>
+\& void f(typename Q::X) {}
+\&
+\& template <template <typename> class Q>
+\& void f(typename Q<int>::X) {}
+.Ve
+.Sp
+Instantiations of these templates may be mangled incorrectly.
+.RE
+.RS 4
+.Sp
+It also warns psABI related changes. The known psABI changes at this
+point include:
+.IP "\(bu" 4
+For SYSV/x86\-64, when passing union with long double, it is changed to
+pass in memory as specified in psABI. For example:
+.Sp
+.Vb 4
+\& union U {
+\& long double ld;
+\& int i;
+\& };
+.Ve
+.Sp
+\&\f(CW\*(C`union U\*(C'\fR will always be passed in memory.
+.RE
+.RS 4
+.RE
+.IP "\fB\-Wctor\-dtor\-privacy\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wctor-dtor-privacy ( and Objective- only)"
+Warn when a class seems unusable because all the constructors or
+destructors in that class are private, and it has neither friends nor
+public static member functions.
+.IP "\fB\-Wnon\-virtual\-dtor\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wnon-virtual-dtor ( and Objective- only)"
+Warn when a class has virtual functions and accessible non-virtual
+destructor, in which case it would be possible but unsafe to delete
+an instance of a derived class through a pointer to the base class.
+This warning is also enabled if \-Weffc++ is specified.
+.IP "\fB\-Wreorder\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wreorder ( and Objective- only)"
+Warn when the order of member initializers given in the code does not
+match the order in which they must be executed. For instance:
+.Sp
+.Vb 5
+\& struct A {
+\& int i;
+\& int j;
+\& A(): j (0), i (1) { }
+\& };
+.Ve
+.Sp
+The compiler will rearrange the member initializers for \fBi\fR
+and \fBj\fR to match the declaration order of the members, emitting
+a warning to that effect. This warning is enabled by \fB\-Wall\fR.
+.PP
+The following \fB\-W...\fR options are not affected by \fB\-Wall\fR.
+.IP "\fB\-Weffc++\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Weffc++ ( and Objective- only)"
+Warn about violations of the following style guidelines from Scott Meyers'
+\&\fIEffective \*(C+\fR book:
+.RS 4
+.IP "\(bu" 4
+Item 11: Define a copy constructor and an assignment operator for classes
+with dynamically allocated memory.
+.IP "\(bu" 4
+Item 12: Prefer initialization to assignment in constructors.
+.IP "\(bu" 4
+Item 14: Make destructors virtual in base classes.
+.IP "\(bu" 4
+Item 15: Have \f(CW\*(C`operator=\*(C'\fR return a reference to \f(CW*this\fR.
+.IP "\(bu" 4
+Item 23: Don't try to return a reference when you must return an object.
+.RE
+.RS 4
+.Sp
+Also warn about violations of the following style guidelines from
+Scott Meyers' \fIMore Effective \*(C+\fR book:
+.IP "\(bu" 4
+Item 6: Distinguish between prefix and postfix forms of increment and
+decrement operators.
+.IP "\(bu" 4
+Item 7: Never overload \f(CW\*(C`&&\*(C'\fR, \f(CW\*(C`||\*(C'\fR, or \f(CW\*(C`,\*(C'\fR.
+.RE
+.RS 4
+.Sp
+When selecting this option, be aware that the standard library
+headers do not obey all of these guidelines; use \fBgrep \-v\fR
+to filter out those warnings.
+.RE
+.IP "\fB\-Wstrict\-null\-sentinel\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wstrict-null-sentinel ( and Objective- only)"
+Warn also about the use of an uncasted \f(CW\*(C`NULL\*(C'\fR as sentinel. When
+compiling only with \s-1GCC\s0 this is a valid sentinel, as \f(CW\*(C`NULL\*(C'\fR is defined
+to \f(CW\*(C`_\|_null\*(C'\fR. Although it is a null pointer constant not a null pointer,
+it is guaranteed to be of the same size as a pointer. But this use is
+not portable across different compilers.
+.IP "\fB\-Wno\-non\-template\-friend\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wno-non-template-friend ( and Objective- only)"
+Disable warnings when non-templatized friend functions are declared
+within a template. Since the advent of explicit template specification
+support in G++, if the name of the friend is an unqualified-id (i.e.,
+\&\fBfriend foo(int)\fR), the \*(C+ language specification demands that the
+friend declare or define an ordinary, nontemplate function. (Section
+14.5.3). Before G++ implemented explicit specification, unqualified-ids
+could be interpreted as a particular specialization of a templatized
+function. Because this non-conforming behavior is no longer the default
+behavior for G++, \fB\-Wnon\-template\-friend\fR allows the compiler to
+check existing code for potential trouble spots and is on by default.
+This new compiler behavior can be turned off with
+\&\fB\-Wno\-non\-template\-friend\fR which keeps the conformant compiler code
+but disables the helpful warning.
+.IP "\fB\-Wold\-style\-cast\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wold-style-cast ( and Objective- only)"
+Warn if an old-style (C\-style) cast to a non-void type is used within
+a \*(C+ program. The new-style casts (\fBdynamic_cast\fR,
+\&\fBstatic_cast\fR, \fBreinterpret_cast\fR, and \fBconst_cast\fR) are
+less vulnerable to unintended effects and much easier to search for.
+.IP "\fB\-Woverloaded\-virtual\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Woverloaded-virtual ( and Objective- only)"
+Warn when a function declaration hides virtual functions from a
+base class. For example, in:
+.Sp
+.Vb 3
+\& struct A {
+\& virtual void f();
+\& };
+\&
+\& struct B: public A {
+\& void f(int);
+\& };
+.Ve
+.Sp
+the \f(CW\*(C`A\*(C'\fR class version of \f(CW\*(C`f\*(C'\fR is hidden in \f(CW\*(C`B\*(C'\fR, and code
+like:
+.Sp
+.Vb 2
+\& B* b;
+\& b\->f();
+.Ve
+.Sp
+will fail to compile.
+.IP "\fB\-Wno\-pmf\-conversions\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wno-pmf-conversions ( and Objective- only)"
+Disable the diagnostic for converting a bound pointer to member function
+to a plain pointer.
+.IP "\fB\-Wsign\-promo\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wsign-promo ( and Objective- only)"
+Warn when overload resolution chooses a promotion from unsigned or
+enumerated type to a signed type, over a conversion to an unsigned type of
+the same size. Previous versions of G++ would try to preserve
+unsignedness, but the standard mandates the current behavior.
+.Sp
+.Vb 4
+\& struct A {
+\& operator int ();
+\& A& operator = (int);
+\& };
+\&
+\& main ()
+\& {
+\& A a,b;
+\& a = b;
+\& }
+.Ve
+.Sp
+In this example, G++ will synthesize a default \fBA& operator =
+(const A&);\fR, while cfront will use the user-defined \fBoperator =\fR.
+.Sh "Options Controlling Objective-C and Objective\-\*(C+ Dialects"
+.IX Subsection "Options Controlling Objective-C and Objective- Dialects"
+(\s-1NOTE:\s0 This manual does not describe the Objective-C and Objective\-\*(C+
+languages themselves. See
+.PP
+This section describes the command-line options that are only meaningful
+for Objective-C and Objective\-\*(C+ programs, but you can also use most of
+the language-independent \s-1GNU\s0 compiler options.
+For example, you might compile a file \f(CW\*(C`some_class.m\*(C'\fR like this:
+.PP
+.Vb 1
+\& gcc \-g \-fgnu\-runtime \-O \-c some_class.m
+.Ve
+.PP
+In this example, \fB\-fgnu\-runtime\fR is an option meant only for
+Objective-C and Objective\-\*(C+ programs; you can use the other options with
+any language supported by \s-1GCC\s0.
+.PP
+Note that since Objective-C is an extension of the C language, Objective-C
+compilations may also use options specific to the C front-end (e.g.,
+\&\fB\-Wtraditional\fR). Similarly, Objective\-\*(C+ compilations may use
+\&\*(C+\-specific options (e.g., \fB\-Wabi\fR).
+.PP
+Here is a list of options that are \fIonly\fR for compiling Objective-C
+and Objective\-\*(C+ programs:
+.IP "\fB\-fconstant\-string\-class=\fR\fIclass-name\fR" 4
+.IX Item "-fconstant-string-class=class-name"
+Use \fIclass-name\fR as the name of the class to instantiate for each
+literal string specified with the syntax \f(CW\*(C`@"..."\*(C'\fR. The default
+class name is \f(CW\*(C`NXConstantString\*(C'\fR if the \s-1GNU\s0 runtime is being used, and
+\&\f(CW\*(C`NSConstantString\*(C'\fR if the NeXT runtime is being used (see below). The
+\&\fB\-fconstant\-cfstrings\fR option, if also present, will override the
+\&\fB\-fconstant\-string\-class\fR setting and cause \f(CW\*(C`@"..."\*(C'\fR literals
+to be laid out as constant CoreFoundation strings.
+.IP "\fB\-fgnu\-runtime\fR" 4
+.IX Item "-fgnu-runtime"
+Generate object code compatible with the standard \s-1GNU\s0 Objective-C
+runtime. This is the default for most types of systems.
+.IP "\fB\-fnext\-runtime\fR" 4
+.IX Item "-fnext-runtime"
+Generate output compatible with the NeXT runtime. This is the default
+for NeXT-based systems, including Darwin and Mac \s-1OS\s0 X. The macro
+\&\f(CW\*(C`_\|_NEXT_RUNTIME_\|_\*(C'\fR is predefined if (and only if) this option is
+used.
+.IP "\fB\-fno\-nil\-receivers\fR" 4
+.IX Item "-fno-nil-receivers"
+Assume that all Objective-C message dispatches (e.g.,
+\&\f(CW\*(C`[receiver message:arg]\*(C'\fR) in this translation unit ensure that the receiver
+is not \f(CW\*(C`nil\*(C'\fR. This allows for more efficient entry points in the runtime
+to be used. Currently, this option is only available in conjunction with
+the NeXT runtime on Mac \s-1OS\s0 X 10.3 and later.
+.IP "\fB\-fobjc\-call\-cxx\-cdtors\fR" 4
+.IX Item "-fobjc-call-cxx-cdtors"
+For each Objective-C class, check if any of its instance variables is a
+\&\*(C+ object with a non-trivial default constructor. If so, synthesize a
+special \f(CW\*(C`\- (id) .cxx_construct\*(C'\fR instance method that will run
+non-trivial default constructors on any such instance variables, in order,
+and then return \f(CW\*(C`self\*(C'\fR. Similarly, check if any instance variable
+is a \*(C+ object with a non-trivial destructor, and if so, synthesize a
+special \f(CW\*(C`\- (void) .cxx_destruct\*(C'\fR method that will run
+all such default destructors, in reverse order.
+.Sp
+The \f(CW\*(C`\- (id) .cxx_construct\*(C'\fR and/or \f(CW\*(C`\- (void) .cxx_destruct\*(C'\fR methods
+thusly generated will only operate on instance variables declared in the
+current Objective-C class, and not those inherited from superclasses. It
+is the responsibility of the Objective-C runtime to invoke all such methods
+in an object's inheritance hierarchy. The \f(CW\*(C`\- (id) .cxx_construct\*(C'\fR methods
+will be invoked by the runtime immediately after a new object
+instance is allocated; the \f(CW\*(C`\- (void) .cxx_destruct\*(C'\fR methods will
+be invoked immediately before the runtime deallocates an object instance.
+.Sp
+As of this writing, only the NeXT runtime on Mac \s-1OS\s0 X 10.4 and later has
+support for invoking the \f(CW\*(C`\- (id) .cxx_construct\*(C'\fR and
+\&\f(CW\*(C`\- (void) .cxx_destruct\*(C'\fR methods.
+.IP "\fB\-fobjc\-direct\-dispatch\fR" 4
+.IX Item "-fobjc-direct-dispatch"
+Allow fast jumps to the message dispatcher. On Darwin this is
+accomplished via the comm page.
+.IP "\fB\-fobjc\-exceptions\fR" 4
+.IX Item "-fobjc-exceptions"
+Enable syntactic support for structured exception handling in Objective-C,
+similar to what is offered by \*(C+ and Java. This option is
+unavailable in conjunction with the NeXT runtime on Mac \s-1OS\s0 X 10.2 and
+earlier.
+.Sp
+.Vb 10
+\& @try {
+\& ...
+\& @throw expr;
+\& ...
+\& }
+\& @catch (AnObjCClass *exc) {
+\& ...
+\& @throw expr;
+\& ...
+\& @throw;
+\& ...
+\& }
+\& @catch (AnotherClass *exc) {
+\& ...
+\& }
+\& @catch (id allOthers) {
+\& ...
+\& }
+\& @finally {
+\& ...
+\& @throw expr;
+\& ...
+\& }
+.Ve
+.Sp
+The \f(CW@throw\fR statement may appear anywhere in an Objective-C or
+Objective\-\*(C+ program; when used inside of a \f(CW@catch\fR block, the
+\&\f(CW@throw\fR may appear without an argument (as shown above), in which case
+the object caught by the \f(CW@catch\fR will be rethrown.
+.Sp
+Note that only (pointers to) Objective-C objects may be thrown and
+caught using this scheme. When an object is thrown, it will be caught
+by the nearest \f(CW@catch\fR clause capable of handling objects of that type,
+analogously to how \f(CW\*(C`catch\*(C'\fR blocks work in \*(C+ and Java. A
+\&\f(CW\*(C`@catch(id ...)\*(C'\fR clause (as shown above) may also be provided to catch
+any and all Objective-C exceptions not caught by previous \f(CW@catch\fR
+clauses (if any).
+.Sp
+The \f(CW@finally\fR clause, if present, will be executed upon exit from the
+immediately preceding \f(CW\*(C`@try ... @catch\*(C'\fR section. This will happen
+regardless of whether any exceptions are thrown, caught or rethrown
+inside the \f(CW\*(C`@try ... @catch\*(C'\fR section, analogously to the behavior
+of the \f(CW\*(C`finally\*(C'\fR clause in Java.
+.Sp
+There are several caveats to using the new exception mechanism:
+.RS 4
+.IP "\(bu" 4
+Although currently designed to be binary compatible with \f(CW\*(C`NS_HANDLER\*(C'\fR\-style
+idioms provided by the \f(CW\*(C`NSException\*(C'\fR class, the new
+exceptions can only be used on Mac \s-1OS\s0 X 10.3 (Panther) and later
+systems, due to additional functionality needed in the (NeXT) Objective-C
+runtime.
+.IP "\(bu" 4
+As mentioned above, the new exceptions do not support handling
+types other than Objective-C objects. Furthermore, when used from
+Objective\-\*(C+, the Objective-C exception model does not interoperate with \*(C+
+exceptions at this time. This means you cannot \f(CW@throw\fR an exception
+from Objective-C and \f(CW\*(C`catch\*(C'\fR it in \*(C+, or vice versa
+(i.e., \f(CW\*(C`throw ... @catch\*(C'\fR).
+.RE
+.RS 4
+.Sp
+The \fB\-fobjc\-exceptions\fR switch also enables the use of synchronization
+blocks for thread-safe execution:
+.Sp
+.Vb 3
+\& @synchronized (ObjCClass *guard) {
+\& ...
+\& }
+.Ve
+.Sp
+Upon entering the \f(CW@synchronized\fR block, a thread of execution shall
+first check whether a lock has been placed on the corresponding \f(CW\*(C`guard\*(C'\fR
+object by another thread. If it has, the current thread shall wait until
+the other thread relinquishes its lock. Once \f(CW\*(C`guard\*(C'\fR becomes available,
+the current thread will place its own lock on it, execute the code contained in
+the \f(CW@synchronized\fR block, and finally relinquish the lock (thereby
+making \f(CW\*(C`guard\*(C'\fR available to other threads).
+.Sp
+Unlike Java, Objective-C does not allow for entire methods to be marked
+\&\f(CW@synchronized\fR. Note that throwing exceptions out of
+\&\f(CW@synchronized\fR blocks is allowed, and will cause the guarding object
+to be unlocked properly.
+.RE
+.IP "\fB\-fobjc\-gc\fR" 4
+.IX Item "-fobjc-gc"
+Enable garbage collection (\s-1GC\s0) in Objective-C and Objective\-\*(C+ programs.
+.IP "\fB\-freplace\-objc\-classes\fR" 4
+.IX Item "-freplace-objc-classes"
+Emit a special marker instructing \fB\f(BIld\fB\|(1)\fR not to statically link in
+the resulting object file, and allow \fB\f(BIdyld\fB\|(1)\fR to load it in at
+run time instead. This is used in conjunction with the Fix-and-Continue
+debugging mode, where the object file in question may be recompiled and
+dynamically reloaded in the course of program execution, without the need
+to restart the program itself. Currently, Fix-and-Continue functionality
+is only available in conjunction with the NeXT runtime on Mac \s-1OS\s0 X 10.3
+and later.
+.IP "\fB\-fzero\-link\fR" 4
+.IX Item "-fzero-link"
+When compiling for the NeXT runtime, the compiler ordinarily replaces calls
+to \f(CW\*(C`objc_getClass("...")\*(C'\fR (when the name of the class is known at
+compile time) with static class references that get initialized at load time,
+which improves run-time performance. Specifying the \fB\-fzero\-link\fR flag
+suppresses this behavior and causes calls to \f(CW\*(C`objc_getClass("...")\*(C'\fR
+to be retained. This is useful in Zero-Link debugging mode, since it allows
+for individual class implementations to be modified during program execution.
+.IP "\fB\-gen\-decls\fR" 4
+.IX Item "-gen-decls"
+Dump interface declarations for all classes seen in the source file to a
+file named \fI\fIsourcename\fI.decl\fR.
+.IP "\fB\-Wassign\-intercept\fR (Objective-C and Objective\-\*(C+ only)" 4
+.IX Item "-Wassign-intercept (Objective-C and Objective- only)"
+Warn whenever an Objective-C assignment is being intercepted by the
+garbage collector.
+.IP "\fB\-Wno\-protocol\fR (Objective-C and Objective\-\*(C+ only)" 4
+.IX Item "-Wno-protocol (Objective-C and Objective- only)"
+If a class is declared to implement a protocol, a warning is issued for
+every method in the protocol that is not implemented by the class. The
+default behavior is to issue a warning for every method not explicitly
+implemented in the class, even if a method implementation is inherited
+from the superclass. If you use the \fB\-Wno\-protocol\fR option, then
+methods inherited from the superclass are considered to be implemented,
+and no warning is issued for them.
+.IP "\fB\-Wselector\fR (Objective-C and Objective\-\*(C+ only)" 4
+.IX Item "-Wselector (Objective-C and Objective- only)"
+Warn if multiple methods of different types for the same selector are
+found during compilation. The check is performed on the list of methods
+in the final stage of compilation. Additionally, a check is performed
+for each selector appearing in a \f(CW\*(C`@selector(...)\*(C'\fR
+expression, and a corresponding method for that selector has been found
+during compilation. Because these checks scan the method table only at
+the end of compilation, these warnings are not produced if the final
+stage of compilation is not reached, for example because an error is
+found during compilation, or because the \fB\-fsyntax\-only\fR option is
+being used.
+.IP "\fB\-Wstrict\-selector\-match\fR (Objective-C and Objective\-\*(C+ only)" 4
+.IX Item "-Wstrict-selector-match (Objective-C and Objective- only)"
+Warn if multiple methods with differing argument and/or return types are
+found for a given selector when attempting to send a message using this
+selector to a receiver of type \f(CW\*(C`id\*(C'\fR or \f(CW\*(C`Class\*(C'\fR. When this flag
+is off (which is the default behavior), the compiler will omit such warnings
+if any differences found are confined to types which share the same size
+and alignment.
+.IP "\fB\-Wundeclared\-selector\fR (Objective-C and Objective\-\*(C+ only)" 4
+.IX Item "-Wundeclared-selector (Objective-C and Objective- only)"
+Warn if a \f(CW\*(C`@selector(...)\*(C'\fR expression referring to an
+undeclared selector is found. A selector is considered undeclared if no
+method with that name has been declared before the
+\&\f(CW\*(C`@selector(...)\*(C'\fR expression, either explicitly in an
+\&\f(CW@interface\fR or \f(CW@protocol\fR declaration, or implicitly in
+an \f(CW@implementation\fR section. This option always performs its
+checks as soon as a \f(CW\*(C`@selector(...)\*(C'\fR expression is found,
+while \fB\-Wselector\fR only performs its checks in the final stage of
+compilation. This also enforces the coding style convention
+that methods and selectors must be declared before being used.
+.IP "\fB\-print\-objc\-runtime\-info\fR" 4
+.IX Item "-print-objc-runtime-info"
+Generate C header describing the largest structure that is passed by
+value, if any.
+.Sh "Options to Control Diagnostic Messages Formatting"
+.IX Subsection "Options to Control Diagnostic Messages Formatting"
+Traditionally, diagnostic messages have been formatted irrespective of
+the output device's aspect (e.g. its width, ...). The options described
+below can be used to control the diagnostic messages formatting
+algorithm, e.g. how many characters per line, how often source location
+information should be reported. Right now, only the \*(C+ front end can
+honor these options. However it is expected, in the near future, that
+the remaining front ends would be able to digest them correctly.
+.IP "\fB\-fmessage\-length=\fR\fIn\fR" 4
+.IX Item "-fmessage-length=n"
+Try to format error messages so that they fit on lines of about \fIn\fR
+characters. The default is 72 characters for \fBg++\fR and 0 for the rest of
+the front ends supported by \s-1GCC\s0. If \fIn\fR is zero, then no
+line-wrapping will be done; each error message will appear on a single
+line.
+.IP "\fB\-fdiagnostics\-show\-location=once\fR" 4
+.IX Item "-fdiagnostics-show-location=once"
+Only meaningful in line-wrapping mode. Instructs the diagnostic messages
+reporter to emit \fIonce\fR source location information; that is, in
+case the message is too long to fit on a single physical line and has to
+be wrapped, the source location won't be emitted (as prefix) again,
+over and over, in subsequent continuation lines. This is the default
+behavior.
+.IP "\fB\-fdiagnostics\-show\-location=every\-line\fR" 4
+.IX Item "-fdiagnostics-show-location=every-line"
+Only meaningful in line-wrapping mode. Instructs the diagnostic
+messages reporter to emit the same source location information (as
+prefix) for physical lines that result from the process of breaking
+a message which is too long to fit on a single line.
+.IP "\fB\-fdiagnostics\-show\-option\fR" 4
+.IX Item "-fdiagnostics-show-option"
+This option instructs the diagnostic machinery to add text to each
+diagnostic emitted, which indicates which command line option directly
+controls that diagnostic, when such an option is known to the
+diagnostic machinery.
+.IP "\fB\-Wcoverage\-mismatch\fR" 4
+.IX Item "-Wcoverage-mismatch"
+Warn if feedback profiles do not match when using the
+\&\fB\-fprofile\-use\fR option.
+If a source file was changed between \fB\-fprofile\-gen\fR and
+\&\fB\-fprofile\-use\fR, the files with the profile feedback can fail
+to match the source file and \s-1GCC\s0 can not use the profile feedback
+information. By default, \s-1GCC\s0 emits an error message in this case.
+The option \fB\-Wcoverage\-mismatch\fR emits a warning instead of an
+error. \s-1GCC\s0 does not use appropriate feedback profiles, so using this
+option can result in poorly optimized code. This option is useful
+only in the case of very minor changes such as bug fixes to an
+existing code-base.
+.Sh "Options to Request or Suppress Warnings"
+.IX Subsection "Options to Request or Suppress Warnings"
+Warnings are diagnostic messages that report constructions which
+are not inherently erroneous but which are risky or suggest there
+may have been an error.
+.PP
+The following language-independent options do not enable specific
+warnings but control the kinds of diagnostics produced by \s-1GCC\s0.
+.IP "\fB\-fsyntax\-only\fR" 4
+.IX Item "-fsyntax-only"
+Check the code for syntax errors, but don't do anything beyond that.
+.IP "\fB\-w\fR" 4
+.IX Item "-w"
+Inhibit all warning messages.
+.IP "\fB\-Werror\fR" 4
+.IX Item "-Werror"
+Make all warnings into errors.
+.IP "\fB\-Werror=\fR" 4
+.IX Item "-Werror="
+Make the specified warning into an error. The specifier for a warning
+is appended, for example \fB\-Werror=switch\fR turns the warnings
+controlled by \fB\-Wswitch\fR into errors. This switch takes a
+negative form, to be used to negate \fB\-Werror\fR for specific
+warnings, for example \fB\-Wno\-error=switch\fR makes
+\&\fB\-Wswitch\fR warnings not be errors, even when \fB\-Werror\fR
+is in effect. You can use the \fB\-fdiagnostics\-show\-option\fR
+option to have each controllable warning amended with the option which
+controls it, to determine what to use with this option.
+.Sp
+Note that specifying \fB\-Werror=\fR\fIfoo\fR automatically implies
+\&\fB\-W\fR\fIfoo\fR. However, \fB\-Wno\-error=\fR\fIfoo\fR does not
+imply anything.
+.IP "\fB\-Wfatal\-errors\fR" 4
+.IX Item "-Wfatal-errors"
+This option causes the compiler to abort compilation on the first error
+occurred rather than trying to keep going and printing further error
+messages.
+.PP
+You can request many specific warnings with options beginning
+\&\fB\-W\fR, for example \fB\-Wimplicit\fR to request warnings on
+implicit declarations. Each of these specific warning options also
+has a negative form beginning \fB\-Wno\-\fR to turn off warnings; for
+example, \fB\-Wno\-implicit\fR. This manual lists only one of the
+two forms, whichever is not the default. For further,
+language-specific options also refer to \fB\*(C+ Dialect Options\fR and
+\&\fBObjective-C and Objective\-\*(C+ Dialect Options\fR.
+.IP "\fB\-pedantic\fR" 4
+.IX Item "-pedantic"
+Issue all the warnings demanded by strict \s-1ISO\s0 C and \s-1ISO\s0 \*(C+;
+reject all programs that use forbidden extensions, and some other
+programs that do not follow \s-1ISO\s0 C and \s-1ISO\s0 \*(C+. For \s-1ISO\s0 C, follows the
+version of the \s-1ISO\s0 C standard specified by any \fB\-std\fR option used.
+.Sp
+Valid \s-1ISO\s0 C and \s-1ISO\s0 \*(C+ programs should compile properly with or without
+this option (though a rare few will require \fB\-ansi\fR or a
+\&\fB\-std\fR option specifying the required version of \s-1ISO\s0 C). However,
+without this option, certain \s-1GNU\s0 extensions and traditional C and \*(C+
+features are supported as well. With this option, they are rejected.
+.Sp
+\&\fB\-pedantic\fR does not cause warning messages for use of the
+alternate keywords whose names begin and end with \fB_\|_\fR. Pedantic
+warnings are also disabled in the expression that follows
+\&\f(CW\*(C`_\|_extension_\|_\*(C'\fR. However, only system header files should use
+these escape routes; application programs should avoid them.
+.Sp
+Some users try to use \fB\-pedantic\fR to check programs for strict \s-1ISO\s0
+C conformance. They soon find that it does not do quite what they want:
+it finds some non-ISO practices, but not all\-\-\-only those for which
+\&\s-1ISO\s0 C \fIrequires\fR a diagnostic, and some others for which
+diagnostics have been added.
+.Sp
+A feature to report any failure to conform to \s-1ISO\s0 C might be useful in
+some instances, but would require considerable additional work and would
+be quite different from \fB\-pedantic\fR. We don't have plans to
+support such a feature in the near future.
+.Sp
+Where the standard specified with \fB\-std\fR represents a \s-1GNU\s0
+extended dialect of C, such as \fBgnu89\fR or \fBgnu99\fR, there is a
+corresponding \fIbase standard\fR, the version of \s-1ISO\s0 C on which the \s-1GNU\s0
+extended dialect is based. Warnings from \fB\-pedantic\fR are given
+where they are required by the base standard. (It would not make sense
+for such warnings to be given only for features not in the specified \s-1GNU\s0
+C dialect, since by definition the \s-1GNU\s0 dialects of C include all
+features the compiler supports with the given option, and there would be
+nothing to warn about.)
+.IP "\fB\-pedantic\-errors\fR" 4
+.IX Item "-pedantic-errors"
+Like \fB\-pedantic\fR, except that errors are produced rather than
+warnings.
+.IP "\fB\-Wall\fR" 4
+.IX Item "-Wall"
+This enables all the warnings about constructions that some users
+consider questionable, and that are easy to avoid (or modify to
+prevent the warning), even in conjunction with macros. This also
+enables some language-specific warnings described in \fB\*(C+ Dialect
+Options\fR and \fBObjective-C and Objective\-\*(C+ Dialect Options\fR.
+.Sp
+\&\fB\-Wall\fR turns on the following warning flags:
+.Sp
+\&\fB\-Waddress
+\&\-Warray\-bounds\fR (only with\fB \fR\fB\-O2\fR)
+\&\fB\-Wc++0x\-compat
+\&\-Wchar\-subscripts
+\&\-Wimplicit\-int
+\&\-Wimplicit\-function\-declaration
+\&\-Wcomment
+\&\-Wformat
+\&\-Wmain\fR (only for C/ObjC and unless\fB \fR\fB\-ffreestanding\fR)
+\&\fB\-Wmissing\-braces
+\&\-Wnonnull
+\&\-Wparentheses
+\&\-Wpointer\-sign
+\&\-Wreorder
+\&\-Wreturn\-type
+\&\-Wsequence\-point
+\&\-Wsign\-compare\fR (only in \*(C+)
+\&\fB\-Wstrict\-aliasing
+\&\-Wstrict\-overflow=1
+\&\-Wswitch
+\&\-Wtrigraphs
+\&\-Wuninitialized
+\&\-Wunknown\-pragmas
+\&\-Wunused\-function
+\&\-Wunused\-label
+\&\-Wunused\-value
+\&\-Wunused\-variable
+\&\-Wvolatile\-register\-var\fR
+.Sp
+Note that some warning flags are not implied by \fB\-Wall\fR. Some of
+them warn about constructions that users generally do not consider
+questionable, but which occasionally you might wish to check for;
+others warn about constructions that are necessary or hard to avoid in
+some cases, and there is no simple way to modify the code to suppress
+the warning. Some of them are enabled by \fB\-Wextra\fR but many of
+them must be enabled individually.
+.IP "\fB\-Wextra\fR" 4
+.IX Item "-Wextra"
+This enables some extra warning flags that are not enabled by
+\&\fB\-Wall\fR. (This option used to be called \fB\-W\fR. The older
+name is still supported, but the newer name is more descriptive.)
+.Sp
+\&\fB\-Wclobbered
+\&\-Wempty\-body
+\&\-Wignored\-qualifiers
+\&\-Wmissing\-field\-initializers
+\&\-Wmissing\-parameter\-type\fR (C only)
+\&\fB\-Wold\-style\-declaration\fR (C only)
+\&\fB\-Woverride\-init
+\&\-Wsign\-compare
+\&\-Wtype\-limits
+\&\-Wuninitialized
+\&\-Wunused\-parameter\fR (only with\fB \fR\fB\-Wunused\fR\fB \fRor\fB \fR\fB\-Wall\fR) \fB \fR
+.Sp
+The option \fB\-Wextra\fR also prints warning messages for the
+following cases:
+.RS 4
+.IP "\(bu" 4
+A pointer is compared against integer zero with \fB<\fR, \fB<=\fR,
+\&\fB>\fR, or \fB>=\fR.
+.IP "\(bu" 4
+(\*(C+ only) An enumerator and a non-enumerator both appear in a
+conditional expression.
+.IP "\(bu" 4
+(\*(C+ only) Ambiguous virtual bases.
+.IP "\(bu" 4
+(\*(C+ only) Subscripting an array which has been declared \fBregister\fR.
+.IP "\(bu" 4
+(\*(C+ only) Taking the address of a variable which has been declared
+\&\fBregister\fR.
+.IP "\(bu" 4
+(\*(C+ only) A base class is not initialized in a derived class' copy
+constructor.
+.RE
+.RS 4
+.RE
+.IP "\fB\-Wchar\-subscripts\fR" 4
+.IX Item "-Wchar-subscripts"
+Warn if an array subscript has type \f(CW\*(C`char\*(C'\fR. This is a common cause
+of error, as programmers often forget that this type is signed on some
+machines.
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wcomment\fR" 4
+.IX Item "-Wcomment"
+Warn whenever a comment-start sequence \fB/*\fR appears in a \fB/*\fR
+comment, or whenever a Backslash-Newline appears in a \fB//\fR comment.
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wformat\fR" 4
+.IX Item "-Wformat"
+Check calls to \f(CW\*(C`printf\*(C'\fR and \f(CW\*(C`scanf\*(C'\fR, etc., to make sure that
+the arguments supplied have types appropriate to the format string
+specified, and that the conversions specified in the format string make
+sense. This includes standard functions, and others specified by format
+attributes, in the \f(CW\*(C`printf\*(C'\fR,
+\&\f(CW\*(C`scanf\*(C'\fR, \f(CW\*(C`strftime\*(C'\fR and \f(CW\*(C`strfmon\*(C'\fR (an X/Open extension,
+not in the C standard) families (or other target-specific families).
+Which functions are checked without format attributes having been
+specified depends on the standard version selected, and such checks of
+functions without the attribute specified are disabled by
+\&\fB\-ffreestanding\fR or \fB\-fno\-builtin\fR.
+.Sp
+The formats are checked against the format features supported by \s-1GNU\s0
+libc version 2.2. These include all \s-1ISO\s0 C90 and C99 features, as well
+as features from the Single Unix Specification and some \s-1BSD\s0 and \s-1GNU\s0
+extensions. Other library implementations may not support all these
+features; \s-1GCC\s0 does not support warning about features that go beyond a
+particular library's limitations. However, if \fB\-pedantic\fR is used
+with \fB\-Wformat\fR, warnings will be given about format features not
+in the selected standard version (but not for \f(CW\*(C`strfmon\*(C'\fR formats,
+since those are not in any version of the C standard).
+.Sp
+Since \fB\-Wformat\fR also checks for null format arguments for
+several functions, \fB\-Wformat\fR also implies \fB\-Wnonnull\fR.
+.Sp
+\&\fB\-Wformat\fR is included in \fB\-Wall\fR. For more control over some
+aspects of format checking, the options \fB\-Wformat\-y2k\fR,
+\&\fB\-Wno\-format\-extra\-args\fR, \fB\-Wno\-format\-zero\-length\fR,
+\&\fB\-Wformat\-nonliteral\fR, \fB\-Wformat\-security\fR, and
+\&\fB\-Wformat=2\fR are available, but are not included in \fB\-Wall\fR.
+.IP "\fB\-Wformat\-y2k\fR" 4
+.IX Item "-Wformat-y2k"
+If \fB\-Wformat\fR is specified, also warn about \f(CW\*(C`strftime\*(C'\fR
+formats which may yield only a two-digit year.
+.IP "\fB\-Wno\-format\-contains\-nul\fR" 4
+.IX Item "-Wno-format-contains-nul"
+If \fB\-Wformat\fR is specified, do not warn about format strings that
+contain \s-1NUL\s0 bytes.
+.IP "\fB\-Wno\-format\-extra\-args\fR" 4
+.IX Item "-Wno-format-extra-args"
+If \fB\-Wformat\fR is specified, do not warn about excess arguments to a
+\&\f(CW\*(C`printf\*(C'\fR or \f(CW\*(C`scanf\*(C'\fR format function. The C standard specifies
+that such arguments are ignored.
+.Sp
+Where the unused arguments lie between used arguments that are
+specified with \fB$\fR operand number specifications, normally
+warnings are still given, since the implementation could not know what
+type to pass to \f(CW\*(C`va_arg\*(C'\fR to skip the unused arguments. However,
+in the case of \f(CW\*(C`scanf\*(C'\fR formats, this option will suppress the
+warning if the unused arguments are all pointers, since the Single
+Unix Specification says that such unused arguments are allowed.
+.IP "\fB\-Wno\-format\-zero\-length\fR (C and Objective-C only)" 4
+.IX Item "-Wno-format-zero-length (C and Objective-C only)"
+If \fB\-Wformat\fR is specified, do not warn about zero-length formats.
+The C standard specifies that zero-length formats are allowed.
+.IP "\fB\-Wformat\-nonliteral\fR" 4
+.IX Item "-Wformat-nonliteral"
+If \fB\-Wformat\fR is specified, also warn if the format string is not a
+string literal and so cannot be checked, unless the format function
+takes its format arguments as a \f(CW\*(C`va_list\*(C'\fR.
+.IP "\fB\-Wformat\-security\fR" 4
+.IX Item "-Wformat-security"
+If \fB\-Wformat\fR is specified, also warn about uses of format
+functions that represent possible security problems. At present, this
+warns about calls to \f(CW\*(C`printf\*(C'\fR and \f(CW\*(C`scanf\*(C'\fR functions where the
+format string is not a string literal and there are no format arguments,
+as in \f(CW\*(C`printf (foo);\*(C'\fR. This may be a security hole if the format
+string came from untrusted input and contains \fB\f(CB%n\fB\fR. (This is
+currently a subset of what \fB\-Wformat\-nonliteral\fR warns about, but
+in future warnings may be added to \fB\-Wformat\-security\fR that are not
+included in \fB\-Wformat\-nonliteral\fR.)
+.IP "\fB\-Wformat=2\fR" 4
+.IX Item "-Wformat=2"
+Enable \fB\-Wformat\fR plus format checks not included in
+\&\fB\-Wformat\fR. Currently equivalent to \fB\-Wformat
+\&\-Wformat\-nonliteral \-Wformat\-security \-Wformat\-y2k\fR.
+.IP "\fB\-Wnonnull\fR (C and Objective-C only)" 4
+.IX Item "-Wnonnull (C and Objective-C only)"
+Warn about passing a null pointer for arguments marked as
+requiring a non-null value by the \f(CW\*(C`nonnull\*(C'\fR function attribute.
+.Sp
+\&\fB\-Wnonnull\fR is included in \fB\-Wall\fR and \fB\-Wformat\fR. It
+can be disabled with the \fB\-Wno\-nonnull\fR option.
+.IP "\fB\-Winit\-self\fR (C, \*(C+, Objective-C and Objective\-\*(C+ only)" 4
+.IX Item "-Winit-self (C, , Objective-C and Objective- only)"
+Warn about uninitialized variables which are initialized with themselves.
+Note this option can only be used with the \fB\-Wuninitialized\fR option.
+.Sp
+For example, \s-1GCC\s0 will warn about \f(CW\*(C`i\*(C'\fR being uninitialized in the
+following snippet only when \fB\-Winit\-self\fR has been specified:
+.Sp
+.Vb 5
+\& int f()
+\& {
+\& int i = i;
+\& return i;
+\& }
+.Ve
+.IP "\fB\-Wimplicit\-int\fR (C and Objective-C only)" 4
+.IX Item "-Wimplicit-int (C and Objective-C only)"
+Warn when a declaration does not specify a type.
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wimplicit\-function\-declaration\fR (C and Objective-C only)" 4
+.IX Item "-Wimplicit-function-declaration (C and Objective-C only)"
+Give a warning whenever a function is used before being declared. In
+C99 mode (\fB\-std=c99\fR or \fB\-std=gnu99\fR), this warning is
+enabled by default and it is made into an error by
+\&\fB\-pedantic\-errors\fR. This warning is also enabled by
+\&\fB\-Wall\fR.
+.IP "\fB\-Wimplicit\fR" 4
+.IX Item "-Wimplicit"
+Same as \fB\-Wimplicit\-int\fR and \fB\-Wimplicit\-function\-declaration\fR.
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wignored\-qualifiers\fR (C and \*(C+ only)" 4
+.IX Item "-Wignored-qualifiers (C and only)"
+Warn if the return type of a function has a type qualifier
+such as \f(CW\*(C`const\*(C'\fR. For \s-1ISO\s0 C such a type qualifier has no effect,
+since the value returned by a function is not an lvalue.
+For \*(C+, the warning is only emitted for scalar types or \f(CW\*(C`void\*(C'\fR.
+\&\s-1ISO\s0 C prohibits qualified \f(CW\*(C`void\*(C'\fR return types on function
+definitions, so such return types always receive a warning
+even without this option.
+.Sp
+This warning is also enabled by \fB\-Wextra\fR.
+.IP "\fB\-Wmain\fR" 4
+.IX Item "-Wmain"
+Warn if the type of \fBmain\fR is suspicious. \fBmain\fR should be
+a function with external linkage, returning int, taking either zero
+arguments, two, or three arguments of appropriate types. This warning
+is enabled by default in \*(C+ and is enabled by either \fB\-Wall\fR
+or \fB\-pedantic\fR.
+.IP "\fB\-Wmissing\-braces\fR" 4
+.IX Item "-Wmissing-braces"
+Warn if an aggregate or union initializer is not fully bracketed. In
+the following example, the initializer for \fBa\fR is not fully
+bracketed, but that for \fBb\fR is fully bracketed.
+.Sp
+.Vb 2
+\& int a[2][2] = { 0, 1, 2, 3 };
+\& int b[2][2] = { { 0, 1 }, { 2, 3 } };
+.Ve
+.Sp
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wmissing\-include\-dirs\fR (C, \*(C+, Objective-C and Objective\-\*(C+ only)" 4
+.IX Item "-Wmissing-include-dirs (C, , Objective-C and Objective- only)"
+Warn if a user-supplied include directory does not exist.
+.IP "\fB\-Wparentheses\fR" 4
+.IX Item "-Wparentheses"
+Warn if parentheses are omitted in certain contexts, such
+as when there is an assignment in a context where a truth value
+is expected, or when operators are nested whose precedence people
+often get confused about.
+.Sp
+Also warn if a comparison like \fBx<=y<=z\fR appears; this is
+equivalent to \fB(x<=y ? 1 : 0) <= z\fR, which is a different
+interpretation from that of ordinary mathematical notation.
+.Sp
+Also warn about constructions where there may be confusion to which
+\&\f(CW\*(C`if\*(C'\fR statement an \f(CW\*(C`else\*(C'\fR branch belongs. Here is an example of
+such a case:
+.Sp
+.Vb 7
+\& {
+\& if (a)
+\& if (b)
+\& foo ();
+\& else
+\& bar ();
+\& }
+.Ve
+.Sp
+In C/\*(C+, every \f(CW\*(C`else\*(C'\fR branch belongs to the innermost possible
+\&\f(CW\*(C`if\*(C'\fR statement, which in this example is \f(CW\*(C`if (b)\*(C'\fR. This is
+often not what the programmer expected, as illustrated in the above
+example by indentation the programmer chose. When there is the
+potential for this confusion, \s-1GCC\s0 will issue a warning when this flag
+is specified. To eliminate the warning, add explicit braces around
+the innermost \f(CW\*(C`if\*(C'\fR statement so there is no way the \f(CW\*(C`else\*(C'\fR
+could belong to the enclosing \f(CW\*(C`if\*(C'\fR. The resulting code would
+look like this:
+.Sp
+.Vb 9
+\& {
+\& if (a)
+\& {
+\& if (b)
+\& foo ();
+\& else
+\& bar ();
+\& }
+\& }
+.Ve
+.Sp
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wsequence\-point\fR" 4
+.IX Item "-Wsequence-point"
+Warn about code that may have undefined semantics because of violations
+of sequence point rules in the C and \*(C+ standards.
+.Sp
+The C and \*(C+ standards defines the order in which expressions in a C/\*(C+
+program are evaluated in terms of \fIsequence points\fR, which represent
+a partial ordering between the execution of parts of the program: those
+executed before the sequence point, and those executed after it. These
+occur after the evaluation of a full expression (one which is not part
+of a larger expression), after the evaluation of the first operand of a
+\&\f(CW\*(C`&&\*(C'\fR, \f(CW\*(C`||\*(C'\fR, \f(CW\*(C`? :\*(C'\fR or \f(CW\*(C`,\*(C'\fR (comma) operator, before a
+function is called (but after the evaluation of its arguments and the
+expression denoting the called function), and in certain other places.
+Other than as expressed by the sequence point rules, the order of
+evaluation of subexpressions of an expression is not specified. All
+these rules describe only a partial order rather than a total order,
+since, for example, if two functions are called within one expression
+with no sequence point between them, the order in which the functions
+are called is not specified. However, the standards committee have
+ruled that function calls do not overlap.
+.Sp
+It is not specified when between sequence points modifications to the
+values of objects take effect. Programs whose behavior depends on this
+have undefined behavior; the C and \*(C+ standards specify that \*(L"Between
+the previous and next sequence point an object shall have its stored
+value modified at most once by the evaluation of an expression.
+Furthermore, the prior value shall be read only to determine the value
+to be stored.\*(R". If a program breaks these rules, the results on any
+particular implementation are entirely unpredictable.
+.Sp
+Examples of code with undefined behavior are \f(CW\*(C`a = a++;\*(C'\fR, \f(CW\*(C`a[n]
+= b[n++]\*(C'\fR and \f(CW\*(C`a[i++] = i;\*(C'\fR. Some more complicated cases are not
+diagnosed by this option, and it may give an occasional false positive
+result, but in general it has been found fairly effective at detecting
+this sort of problem in programs.
+.Sp
+The standard is worded confusingly, therefore there is some debate
+over the precise meaning of the sequence point rules in subtle cases.
+Links to discussions of the problem, including proposed formal
+definitions, may be found on the \s-1GCC\s0 readings page, at
+<\fBhttp://gcc.gnu.org/readings.html\fR>.
+.Sp
+This warning is enabled by \fB\-Wall\fR for C and \*(C+.
+.IP "\fB\-Wreturn\-type\fR" 4
+.IX Item "-Wreturn-type"
+Warn whenever a function is defined with a return-type that defaults
+to \f(CW\*(C`int\*(C'\fR. Also warn about any \f(CW\*(C`return\*(C'\fR statement with no
+return-value in a function whose return-type is not \f(CW\*(C`void\*(C'\fR
+(falling off the end of the function body is considered returning
+without a value), and about a \f(CW\*(C`return\*(C'\fR statement with a
+expression in a function whose return-type is \f(CW\*(C`void\*(C'\fR.
+.Sp
+For \*(C+, a function without return type always produces a diagnostic
+message, even when \fB\-Wno\-return\-type\fR is specified. The only
+exceptions are \fBmain\fR and functions defined in system headers.
+.Sp
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wswitch\fR" 4
+.IX Item "-Wswitch"
+Warn whenever a \f(CW\*(C`switch\*(C'\fR statement has an index of enumerated type
+and lacks a \f(CW\*(C`case\*(C'\fR for one or more of the named codes of that
+enumeration. (The presence of a \f(CW\*(C`default\*(C'\fR label prevents this
+warning.) \f(CW\*(C`case\*(C'\fR labels outside the enumeration range also
+provoke warnings when this option is used.
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wswitch\-default\fR" 4
+.IX Item "-Wswitch-default"
+Warn whenever a \f(CW\*(C`switch\*(C'\fR statement does not have a \f(CW\*(C`default\*(C'\fR
+case.
+.IP "\fB\-Wswitch\-enum\fR" 4
+.IX Item "-Wswitch-enum"
+Warn whenever a \f(CW\*(C`switch\*(C'\fR statement has an index of enumerated type
+and lacks a \f(CW\*(C`case\*(C'\fR for one or more of the named codes of that
+enumeration. \f(CW\*(C`case\*(C'\fR labels outside the enumeration range also
+provoke warnings when this option is used.
+.IP "\fB\-Wsync\-nand\fR (C and \*(C+ only)" 4
+.IX Item "-Wsync-nand (C and only)"
+Warn when \f(CW\*(C`_\|_sync_fetch_and_nand\*(C'\fR and \f(CW\*(C`_\|_sync_nand_and_fetch\*(C'\fR
+built-in functions are used. These functions changed semantics in \s-1GCC\s0 4.4.
+.IP "\fB\-Wtrigraphs\fR" 4
+.IX Item "-Wtrigraphs"
+Warn if any trigraphs are encountered that might change the meaning of
+the program (trigraphs within comments are not warned about).
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wunused\-function\fR" 4
+.IX Item "-Wunused-function"
+Warn whenever a static function is declared but not defined or a
+non-inline static function is unused.
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wunused\-label\fR" 4
+.IX Item "-Wunused-label"
+Warn whenever a label is declared but not used.
+This warning is enabled by \fB\-Wall\fR.
+.Sp
+To suppress this warning use the \fBunused\fR attribute.
+.IP "\fB\-Wunused\-parameter\fR" 4
+.IX Item "-Wunused-parameter"
+Warn whenever a function parameter is unused aside from its declaration.
+.Sp
+To suppress this warning use the \fBunused\fR attribute.
+.IP "\fB\-Wunused\-variable\fR" 4
+.IX Item "-Wunused-variable"
+Warn whenever a local variable or non-constant static variable is unused
+aside from its declaration.
+This warning is enabled by \fB\-Wall\fR.
+.Sp
+To suppress this warning use the \fBunused\fR attribute.
+.IP "\fB\-Wunused\-value\fR" 4
+.IX Item "-Wunused-value"
+Warn whenever a statement computes a result that is explicitly not
+used. To suppress this warning cast the unused expression to
+\&\fBvoid\fR. This includes an expression-statement or the left-hand
+side of a comma expression that contains no side effects. For example,
+an expression such as \fBx[i,j]\fR will cause a warning, while
+\&\fBx[(void)i,j]\fR will not.
+.Sp
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wunused\fR" 4
+.IX Item "-Wunused"
+All the above \fB\-Wunused\fR options combined.
+.Sp
+In order to get a warning about an unused function parameter, you must
+either specify \fB\-Wextra \-Wunused\fR (note that \fB\-Wall\fR implies
+\&\fB\-Wunused\fR), or separately specify \fB\-Wunused\-parameter\fR.
+.IP "\fB\-Wuninitialized\fR" 4
+.IX Item "-Wuninitialized"
+Warn if an automatic variable is used without first being initialized
+or if a variable may be clobbered by a \f(CW\*(C`setjmp\*(C'\fR call. In \*(C+,
+warn if a non-static reference or non-static \fBconst\fR member
+appears in a class without constructors.
+.Sp
+If you want to warn about code which uses the uninitialized value of the
+variable in its own initializer, use the \fB\-Winit\-self\fR option.
+.Sp
+These warnings occur for individual uninitialized or clobbered
+elements of structure, union or array variables as well as for
+variables which are uninitialized or clobbered as a whole. They do
+not occur for variables or elements declared \f(CW\*(C`volatile\*(C'\fR. Because
+these warnings depend on optimization, the exact variables or elements
+for which there are warnings will depend on the precise optimization
+options and version of \s-1GCC\s0 used.
+.Sp
+Note that there may be no warning about a variable that is used only
+to compute a value that itself is never used, because such
+computations may be deleted by data flow analysis before the warnings
+are printed.
+.Sp
+These warnings are made optional because \s-1GCC\s0 is not smart
+enough to see all the reasons why the code might be correct
+despite appearing to have an error. Here is one example of how
+this can happen:
+.Sp
+.Vb 12
+\& {
+\& int x;
+\& switch (y)
+\& {
+\& case 1: x = 1;
+\& break;
+\& case 2: x = 4;
+\& break;
+\& case 3: x = 5;
+\& }
+\& foo (x);
+\& }
+.Ve
+.Sp
+If the value of \f(CW\*(C`y\*(C'\fR is always 1, 2 or 3, then \f(CW\*(C`x\*(C'\fR is
+always initialized, but \s-1GCC\s0 doesn't know this. Here is
+another common case:
+.Sp
+.Vb 6
+\& {
+\& int save_y;
+\& if (change_y) save_y = y, y = new_y;
+\& ...
+\& if (change_y) y = save_y;
+\& }
+.Ve
+.Sp
+This has no bug because \f(CW\*(C`save_y\*(C'\fR is used only if it is set.
+.Sp
+This option also warns when a non-volatile automatic variable might be
+changed by a call to \f(CW\*(C`longjmp\*(C'\fR. These warnings as well are possible
+only in optimizing compilation.
+.Sp
+The compiler sees only the calls to \f(CW\*(C`setjmp\*(C'\fR. It cannot know
+where \f(CW\*(C`longjmp\*(C'\fR will be called; in fact, a signal handler could
+call it at any point in the code. As a result, you may get a warning
+even when there is in fact no problem because \f(CW\*(C`longjmp\*(C'\fR cannot
+in fact be called at the place which would cause a problem.
+.Sp
+Some spurious warnings can be avoided if you declare all the functions
+you use that never return as \f(CW\*(C`noreturn\*(C'\fR.
+.Sp
+This warning is enabled by \fB\-Wall\fR or \fB\-Wextra\fR.
+.IP "\fB\-Wunknown\-pragmas\fR" 4
+.IX Item "-Wunknown-pragmas"
+Warn when a #pragma directive is encountered which is not understood by
+\&\s-1GCC\s0. If this command line option is used, warnings will even be issued
+for unknown pragmas in system header files. This is not the case if
+the warnings were only enabled by the \fB\-Wall\fR command line option.
+.IP "\fB\-Wno\-pragmas\fR" 4
+.IX Item "-Wno-pragmas"
+Do not warn about misuses of pragmas, such as incorrect parameters,
+invalid syntax, or conflicts between pragmas. See also
+\&\fB\-Wunknown\-pragmas\fR.
+.IP "\fB\-Wstrict\-aliasing\fR" 4
+.IX Item "-Wstrict-aliasing"
+This option is only active when \fB\-fstrict\-aliasing\fR is active.
+It warns about code which might break the strict aliasing rules that the
+compiler is using for optimization. The warning does not catch all
+cases, but does attempt to catch the more common pitfalls. It is
+included in \fB\-Wall\fR.
+It is equivalent to \fB\-Wstrict\-aliasing=3\fR
+.IP "\fB\-Wstrict\-aliasing=n\fR" 4
+.IX Item "-Wstrict-aliasing=n"
+This option is only active when \fB\-fstrict\-aliasing\fR is active.
+It warns about code which might break the strict aliasing rules that the
+compiler is using for optimization.
+Higher levels correspond to higher accuracy (fewer false positives).
+Higher levels also correspond to more effort, similar to the way \-O works.
+\&\fB\-Wstrict\-aliasing\fR is equivalent to \fB\-Wstrict\-aliasing=n\fR,
+with n=3.
+.Sp
+Level 1: Most aggressive, quick, least accurate.
+Possibly useful when higher levels
+do not warn but \-fstrict\-aliasing still breaks the code, as it has very few
+false negatives. However, it has many false positives.
+Warns for all pointer conversions between possibly incompatible types,
+even if never dereferenced. Runs in the frontend only.
+.Sp
+Level 2: Aggressive, quick, not too precise.
+May still have many false positives (not as many as level 1 though),
+and few false negatives (but possibly more than level 1).
+Unlike level 1, it only warns when an address is taken. Warns about
+incomplete types. Runs in the frontend only.
+.Sp
+Level 3 (default for \fB\-Wstrict\-aliasing\fR):
+Should have very few false positives and few false
+negatives. Slightly slower than levels 1 or 2 when optimization is enabled.
+Takes care of the common punn+dereference pattern in the frontend:
+\&\f(CW\*(C`*(int*)&some_float\*(C'\fR.
+If optimization is enabled, it also runs in the backend, where it deals
+with multiple statement cases using flow-sensitive points-to information.
+Only warns when the converted pointer is dereferenced.
+Does not warn about incomplete types.
+.IP "\fB\-Wstrict\-overflow\fR" 4
+.IX Item "-Wstrict-overflow"
+.PD 0
+.IP "\fB\-Wstrict\-overflow=\fR\fIn\fR" 4
+.IX Item "-Wstrict-overflow=n"
+.PD
+This option is only active when \fB\-fstrict\-overflow\fR is active.
+It warns about cases where the compiler optimizes based on the
+assumption that signed overflow does not occur. Note that it does not
+warn about all cases where the code might overflow: it only warns
+about cases where the compiler implements some optimization. Thus
+this warning depends on the optimization level.
+.Sp
+An optimization which assumes that signed overflow does not occur is
+perfectly safe if the values of the variables involved are such that
+overflow never does, in fact, occur. Therefore this warning can
+easily give a false positive: a warning about code which is not
+actually a problem. To help focus on important issues, several
+warning levels are defined. No warnings are issued for the use of
+undefined signed overflow when estimating how many iterations a loop
+will require, in particular when determining whether a loop will be
+executed at all.
+.RS 4
+.IP "\fB\-Wstrict\-overflow=1\fR" 4
+.IX Item "-Wstrict-overflow=1"
+Warn about cases which are both questionable and easy to avoid. For
+example: \f(CW\*(C`x + 1 > x\*(C'\fR; with \fB\-fstrict\-overflow\fR, the
+compiler will simplify this to \f(CW1\fR. This level of
+\&\fB\-Wstrict\-overflow\fR is enabled by \fB\-Wall\fR; higher levels
+are not, and must be explicitly requested.
+.IP "\fB\-Wstrict\-overflow=2\fR" 4
+.IX Item "-Wstrict-overflow=2"
+Also warn about other cases where a comparison is simplified to a
+constant. For example: \f(CW\*(C`abs (x) >= 0\*(C'\fR. This can only be
+simplified when \fB\-fstrict\-overflow\fR is in effect, because
+\&\f(CW\*(C`abs (INT_MIN)\*(C'\fR overflows to \f(CW\*(C`INT_MIN\*(C'\fR, which is less than
+zero. \fB\-Wstrict\-overflow\fR (with no level) is the same as
+\&\fB\-Wstrict\-overflow=2\fR.
+.IP "\fB\-Wstrict\-overflow=3\fR" 4
+.IX Item "-Wstrict-overflow=3"
+Also warn about other cases where a comparison is simplified. For
+example: \f(CW\*(C`x + 1 > 1\*(C'\fR will be simplified to \f(CW\*(C`x > 0\*(C'\fR.
+.IP "\fB\-Wstrict\-overflow=4\fR" 4
+.IX Item "-Wstrict-overflow=4"
+Also warn about other simplifications not covered by the above cases.
+For example: \f(CW\*(C`(x * 10) / 5\*(C'\fR will be simplified to \f(CW\*(C`x * 2\*(C'\fR.
+.IP "\fB\-Wstrict\-overflow=5\fR" 4
+.IX Item "-Wstrict-overflow=5"
+Also warn about cases where the compiler reduces the magnitude of a
+constant involved in a comparison. For example: \f(CW\*(C`x + 2 > y\*(C'\fR will
+be simplified to \f(CW\*(C`x + 1 >= y\*(C'\fR. This is reported only at the
+highest warning level because this simplification applies to many
+comparisons, so this warning level will give a very large number of
+false positives.
+.RE
+.RS 4
+.RE
+.IP "\fB\-Warray\-bounds\fR" 4
+.IX Item "-Warray-bounds"
+This option is only active when \fB\-ftree\-vrp\fR is active
+(default for \-O2 and above). It warns about subscripts to arrays
+that are always out of bounds. This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wno\-div\-by\-zero\fR" 4
+.IX Item "-Wno-div-by-zero"
+Do not warn about compile-time integer division by zero. Floating point
+division by zero is not warned about, as it can be a legitimate way of
+obtaining infinities and NaNs.
+.IP "\fB\-Wsystem\-headers\fR" 4
+.IX Item "-Wsystem-headers"
+Print warning messages for constructs found in system header files.
+Warnings from system headers are normally suppressed, on the assumption
+that they usually do not indicate real problems and would only make the
+compiler output harder to read. Using this command line option tells
+\&\s-1GCC\s0 to emit warnings from system headers as if they occurred in user
+code. However, note that using \fB\-Wall\fR in conjunction with this
+option will \fInot\fR warn about unknown pragmas in system
+headers\-\-\-for that, \fB\-Wunknown\-pragmas\fR must also be used.
+.IP "\fB\-Wfloat\-equal\fR" 4
+.IX Item "-Wfloat-equal"
+Warn if floating point values are used in equality comparisons.
+.Sp
+The idea behind this is that sometimes it is convenient (for the
+programmer) to consider floating-point values as approximations to
+infinitely precise real numbers. If you are doing this, then you need
+to compute (by analyzing the code, or in some other way) the maximum or
+likely maximum error that the computation introduces, and allow for it
+when performing comparisons (and when producing output, but that's a
+different problem). In particular, instead of testing for equality, you
+would check to see whether the two values have ranges that overlap; and
+this is done with the relational operators, so equality comparisons are
+probably mistaken.
+.IP "\fB\-Wtraditional\fR (C and Objective-C only)" 4
+.IX Item "-Wtraditional (C and Objective-C only)"
+Warn about certain constructs that behave differently in traditional and
+\&\s-1ISO\s0 C. Also warn about \s-1ISO\s0 C constructs that have no traditional C
+equivalent, and/or problematic constructs which should be avoided.
+.RS 4
+.IP "\(bu" 4
+Macro parameters that appear within string literals in the macro body.
+In traditional C macro replacement takes place within string literals,
+but does not in \s-1ISO\s0 C.
+.IP "\(bu" 4
+In traditional C, some preprocessor directives did not exist.
+Traditional preprocessors would only consider a line to be a directive
+if the \fB#\fR appeared in column 1 on the line. Therefore
+\&\fB\-Wtraditional\fR warns about directives that traditional C
+understands but would ignore because the \fB#\fR does not appear as the
+first character on the line. It also suggests you hide directives like
+\&\fB#pragma\fR not understood by traditional C by indenting them. Some
+traditional implementations would not recognize \fB#elif\fR, so it
+suggests avoiding it altogether.
+.IP "\(bu" 4
+A function-like macro that appears without arguments.
+.IP "\(bu" 4
+The unary plus operator.
+.IP "\(bu" 4
+The \fBU\fR integer constant suffix, or the \fBF\fR or \fBL\fR floating point
+constant suffixes. (Traditional C does support the \fBL\fR suffix on integer
+constants.) Note, these suffixes appear in macros defined in the system
+headers of most modern systems, e.g. the \fB_MIN\fR/\fB_MAX\fR macros in \f(CW\*(C`<limits.h>\*(C'\fR.
+Use of these macros in user code might normally lead to spurious
+warnings, however \s-1GCC\s0's integrated preprocessor has enough context to
+avoid warning in these cases.
+.IP "\(bu" 4
+A function declared external in one block and then used after the end of
+the block.
+.IP "\(bu" 4
+A \f(CW\*(C`switch\*(C'\fR statement has an operand of type \f(CW\*(C`long\*(C'\fR.
+.IP "\(bu" 4
+A non\-\f(CW\*(C`static\*(C'\fR function declaration follows a \f(CW\*(C`static\*(C'\fR one.
+This construct is not accepted by some traditional C compilers.
+.IP "\(bu" 4
+The \s-1ISO\s0 type of an integer constant has a different width or
+signedness from its traditional type. This warning is only issued if
+the base of the constant is ten. I.e. hexadecimal or octal values, which
+typically represent bit patterns, are not warned about.
+.IP "\(bu" 4
+Usage of \s-1ISO\s0 string concatenation is detected.
+.IP "\(bu" 4
+Initialization of automatic aggregates.
+.IP "\(bu" 4
+Identifier conflicts with labels. Traditional C lacks a separate
+namespace for labels.
+.IP "\(bu" 4
+Initialization of unions. If the initializer is zero, the warning is
+omitted. This is done under the assumption that the zero initializer in
+user code appears conditioned on e.g. \f(CW\*(C`_\|_STDC_\|_\*(C'\fR to avoid missing
+initializer warnings and relies on default initialization to zero in the
+traditional C case.
+.IP "\(bu" 4
+Conversions by prototypes between fixed/floating point values and vice
+versa. The absence of these prototypes when compiling with traditional
+C would cause serious problems. This is a subset of the possible
+conversion warnings, for the full set use \fB\-Wtraditional\-conversion\fR.
+.IP "\(bu" 4
+Use of \s-1ISO\s0 C style function definitions. This warning intentionally is
+\&\fInot\fR issued for prototype declarations or variadic functions
+because these \s-1ISO\s0 C features will appear in your code when using
+libiberty's traditional C compatibility macros, \f(CW\*(C`PARAMS\*(C'\fR and
+\&\f(CW\*(C`VPARAMS\*(C'\fR. This warning is also bypassed for nested functions
+because that feature is already a \s-1GCC\s0 extension and thus not relevant to
+traditional C compatibility.
+.RE
+.RS 4
+.RE
+.IP "\fB\-Wtraditional\-conversion\fR (C and Objective-C only)" 4
+.IX Item "-Wtraditional-conversion (C and Objective-C only)"
+Warn if a prototype causes a type conversion that is different from what
+would happen to the same argument in the absence of a prototype. This
+includes conversions of fixed point to floating and vice versa, and
+conversions changing the width or signedness of a fixed point argument
+except when the same as the default promotion.
+.IP "\fB\-Wdeclaration\-after\-statement\fR (C and Objective-C only)" 4
+.IX Item "-Wdeclaration-after-statement (C and Objective-C only)"
+Warn when a declaration is found after a statement in a block. This
+construct, known from \*(C+, was introduced with \s-1ISO\s0 C99 and is by default
+allowed in \s-1GCC\s0. It is not supported by \s-1ISO\s0 C90 and was not supported by
+\&\s-1GCC\s0 versions before \s-1GCC\s0 3.0.
+.IP "\fB\-Wundef\fR" 4
+.IX Item "-Wundef"
+Warn if an undefined identifier is evaluated in an \fB#if\fR directive.
+.IP "\fB\-Wno\-endif\-labels\fR" 4
+.IX Item "-Wno-endif-labels"
+Do not warn whenever an \fB#else\fR or an \fB#endif\fR are followed by text.
+.IP "\fB\-Wshadow\fR" 4
+.IX Item "-Wshadow"
+Warn whenever a local variable shadows another local variable, parameter or
+global variable or whenever a built-in function is shadowed.
+.IP "\fB\-Wlarger\-than=\fR\fIlen\fR" 4
+.IX Item "-Wlarger-than=len"
+Warn whenever an object of larger than \fIlen\fR bytes is defined.
+.IP "\fB\-Wframe\-larger\-than=\fR\fIlen\fR" 4
+.IX Item "-Wframe-larger-than=len"
+Warn if the size of a function frame is larger than \fIlen\fR bytes.
+The computation done to determine the stack frame size is approximate
+and not conservative.
+The actual requirements may be somewhat greater than \fIlen\fR
+even if you do not get a warning. In addition, any space allocated
+via \f(CW\*(C`alloca\*(C'\fR, variable-length arrays, or related constructs
+is not included by the compiler when determining
+whether or not to issue a warning.
+.IP "\fB\-Wunsafe\-loop\-optimizations\fR" 4
+.IX Item "-Wunsafe-loop-optimizations"
+Warn if the loop cannot be optimized because the compiler could not
+assume anything on the bounds of the loop indices. With
+\&\fB\-funsafe\-loop\-optimizations\fR warn if the compiler made
+such assumptions.
+.IP "\fB\-Wno\-pedantic\-ms\-format\fR (MinGW targets only)" 4
+.IX Item "-Wno-pedantic-ms-format (MinGW targets only)"
+Disables the warnings about non-ISO \f(CW\*(C`printf\*(C'\fR / \f(CW\*(C`scanf\*(C'\fR format
+width specifiers \f(CW\*(C`I32\*(C'\fR, \f(CW\*(C`I64\*(C'\fR, and \f(CW\*(C`I\*(C'\fR used on Windows targets
+depending on the \s-1MS\s0 runtime, when you are using the options \fB\-Wformat\fR
+and \fB\-pedantic\fR without gnu-extensions.
+.IP "\fB\-Wpointer\-arith\fR" 4
+.IX Item "-Wpointer-arith"
+Warn about anything that depends on the \*(L"size of\*(R" a function type or
+of \f(CW\*(C`void\*(C'\fR. \s-1GNU\s0 C assigns these types a size of 1, for
+convenience in calculations with \f(CW\*(C`void *\*(C'\fR pointers and pointers
+to functions. In \*(C+, warn also when an arithmetic operation involves
+\&\f(CW\*(C`NULL\*(C'\fR. This warning is also enabled by \fB\-pedantic\fR.
+.IP "\fB\-Wtype\-limits\fR" 4
+.IX Item "-Wtype-limits"
+Warn if a comparison is always true or always false due to the limited
+range of the data type, but do not warn for constant expressions. For
+example, warn if an unsigned variable is compared against zero with
+\&\fB<\fR or \fB>=\fR. This warning is also enabled by
+\&\fB\-Wextra\fR.
+.IP "\fB\-Wbad\-function\-cast\fR (C and Objective-C only)" 4
+.IX Item "-Wbad-function-cast (C and Objective-C only)"
+Warn whenever a function call is cast to a non-matching type.
+For example, warn if \f(CW\*(C`int malloc()\*(C'\fR is cast to \f(CW\*(C`anything *\*(C'\fR.
+.IP "\fB\-Wc++\-compat\fR (C and Objective-C only)" 4
+.IX Item "-Wc++-compat (C and Objective-C only)"
+Warn about \s-1ISO\s0 C constructs that are outside of the common subset of
+\&\s-1ISO\s0 C and \s-1ISO\s0 \*(C+, e.g. request for implicit conversion from
+\&\f(CW\*(C`void *\*(C'\fR to a pointer to non\-\f(CW\*(C`void\*(C'\fR type.
+.IP "\fB\-Wc++0x\-compat\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wc++0x-compat ( and Objective- only)"
+Warn about \*(C+ constructs whose meaning differs between \s-1ISO\s0 \*(C+ 1998 and
+\&\s-1ISO\s0 \*(C+ 200x, e.g., identifiers in \s-1ISO\s0 \*(C+ 1998 that will become keywords
+in \s-1ISO\s0 \*(C+ 200x. This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wcast\-qual\fR" 4
+.IX Item "-Wcast-qual"
+Warn whenever a pointer is cast so as to remove a type qualifier from
+the target type. For example, warn if a \f(CW\*(C`const char *\*(C'\fR is cast
+to an ordinary \f(CW\*(C`char *\*(C'\fR.
+.IP "\fB\-Wcast\-align\fR" 4
+.IX Item "-Wcast-align"
+Warn whenever a pointer is cast such that the required alignment of the
+target is increased. For example, warn if a \f(CW\*(C`char *\*(C'\fR is cast to
+an \f(CW\*(C`int *\*(C'\fR on machines where integers can only be accessed at
+two\- or four-byte boundaries.
+.IP "\fB\-Wwrite\-strings\fR" 4
+.IX Item "-Wwrite-strings"
+When compiling C, give string constants the type \f(CW\*(C`const
+char[\f(CIlength\f(CW]\*(C'\fR so that copying the address of one into a
+non\-\f(CW\*(C`const\*(C'\fR \f(CW\*(C`char *\*(C'\fR pointer will get a warning. These
+warnings will help you find at compile time code that can try to write
+into a string constant, but only if you have been very careful about
+using \f(CW\*(C`const\*(C'\fR in declarations and prototypes. Otherwise, it will
+just be a nuisance. This is why we did not make \fB\-Wall\fR request
+these warnings.
+.Sp
+When compiling \*(C+, warn about the deprecated conversion from string
+literals to \f(CW\*(C`char *\*(C'\fR. This warning is enabled by default for \*(C+
+programs.
+.IP "\fB\-Wclobbered\fR" 4
+.IX Item "-Wclobbered"
+Warn for variables that might be changed by \fBlongjmp\fR or
+\&\fBvfork\fR. This warning is also enabled by \fB\-Wextra\fR.
+.IP "\fB\-Wconversion\fR" 4
+.IX Item "-Wconversion"
+Warn for implicit conversions that may alter a value. This includes
+conversions between real and integer, like \f(CW\*(C`abs (x)\*(C'\fR when
+\&\f(CW\*(C`x\*(C'\fR is \f(CW\*(C`double\*(C'\fR; conversions between signed and unsigned,
+like \f(CW\*(C`unsigned ui = \-1\*(C'\fR; and conversions to smaller types, like
+\&\f(CW\*(C`sqrtf (M_PI)\*(C'\fR. Do not warn for explicit casts like \f(CW\*(C`abs
+((int) x)\*(C'\fR and \f(CW\*(C`ui = (unsigned) \-1\*(C'\fR, or if the value is not
+changed by the conversion like in \f(CW\*(C`abs (2.0)\*(C'\fR. Warnings about
+conversions between signed and unsigned integers can be disabled by
+using \fB\-Wno\-sign\-conversion\fR.
+.Sp
+For \*(C+, also warn for conversions between \f(CW\*(C`NULL\*(C'\fR and non-pointer
+types; confusing overload resolution for user-defined conversions; and
+conversions that will never use a type conversion operator:
+conversions to \f(CW\*(C`void\*(C'\fR, the same type, a base class or a reference
+to them. Warnings about conversions between signed and unsigned
+integers are disabled by default in \*(C+ unless
+\&\fB\-Wsign\-conversion\fR is explicitly enabled.
+.IP "\fB\-Wempty\-body\fR" 4
+.IX Item "-Wempty-body"
+Warn if an empty body occurs in an \fBif\fR, \fBelse\fR or \fBdo
+while\fR statement. This warning is also enabled by \fB\-Wextra\fR.
+.IP "\fB\-Wenum\-compare\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wenum-compare ( and Objective- only)"
+Warn about a comparison between values of different enum types. This
+warning is enabled by default.
+.IP "\fB\-Wsign\-compare\fR" 4
+.IX Item "-Wsign-compare"
+Warn when a comparison between signed and unsigned values could produce
+an incorrect result when the signed value is converted to unsigned.
+This warning is also enabled by \fB\-Wextra\fR; to get the other warnings
+of \fB\-Wextra\fR without this warning, use \fB\-Wextra \-Wno\-sign\-compare\fR.
+.IP "\fB\-Wsign\-conversion\fR" 4
+.IX Item "-Wsign-conversion"
+Warn for implicit conversions that may change the sign of an integer
+value, like assigning a signed integer expression to an unsigned
+integer variable. An explicit cast silences the warning. In C, this
+option is enabled also by \fB\-Wconversion\fR.
+.IP "\fB\-Waddress\fR" 4
+.IX Item "-Waddress"
+Warn about suspicious uses of memory addresses. These include using
+the address of a function in a conditional expression, such as
+\&\f(CW\*(C`void func(void); if (func)\*(C'\fR, and comparisons against the memory
+address of a string literal, such as \f(CW\*(C`if (x == "abc")\*(C'\fR. Such
+uses typically indicate a programmer error: the address of a function
+always evaluates to true, so their use in a conditional usually
+indicate that the programmer forgot the parentheses in a function
+call; and comparisons against string literals result in unspecified
+behavior and are not portable in C, so they usually indicate that the
+programmer intended to use \f(CW\*(C`strcmp\*(C'\fR. This warning is enabled by
+\&\fB\-Wall\fR.
+.IP "\fB\-Wlogical\-op\fR" 4
+.IX Item "-Wlogical-op"
+Warn about suspicious uses of logical operators in expressions.
+This includes using logical operators in contexts where a
+bit-wise operator is likely to be expected.
+.IP "\fB\-Waggregate\-return\fR" 4
+.IX Item "-Waggregate-return"
+Warn if any functions that return structures or unions are defined or
+called. (In languages where you can return an array, this also elicits
+a warning.)
+.IP "\fB\-Wno\-attributes\fR" 4
+.IX Item "-Wno-attributes"
+Do not warn if an unexpected \f(CW\*(C`_\|_attribute_\|_\*(C'\fR is used, such as
+unrecognized attributes, function attributes applied to variables,
+etc. This will not stop errors for incorrect use of supported
+attributes.
+.IP "\fB\-Wno\-builtin\-macro\-redefined\fR" 4
+.IX Item "-Wno-builtin-macro-redefined"
+Do not warn if certain built-in macros are redefined. This suppresses
+warnings for redefinition of \f(CW\*(C`_\|_TIMESTAMP_\|_\*(C'\fR, \f(CW\*(C`_\|_TIME_\|_\*(C'\fR,
+\&\f(CW\*(C`_\|_DATE_\|_\*(C'\fR, \f(CW\*(C`_\|_FILE_\|_\*(C'\fR, and \f(CW\*(C`_\|_BASE_FILE_\|_\*(C'\fR.
+.IP "\fB\-Wstrict\-prototypes\fR (C and Objective-C only)" 4
+.IX Item "-Wstrict-prototypes (C and Objective-C only)"
+Warn if a function is declared or defined without specifying the
+argument types. (An old-style function definition is permitted without
+a warning if preceded by a declaration which specifies the argument
+types.)
+.IP "\fB\-Wold\-style\-declaration\fR (C and Objective-C only)" 4
+.IX Item "-Wold-style-declaration (C and Objective-C only)"
+Warn for obsolescent usages, according to the C Standard, in a
+declaration. For example, warn if storage-class specifiers like
+\&\f(CW\*(C`static\*(C'\fR are not the first things in a declaration. This warning
+is also enabled by \fB\-Wextra\fR.
+.IP "\fB\-Wold\-style\-definition\fR (C and Objective-C only)" 4
+.IX Item "-Wold-style-definition (C and Objective-C only)"
+Warn if an old-style function definition is used. A warning is given
+even if there is a previous prototype.
+.IP "\fB\-Wmissing\-parameter\-type\fR (C and Objective-C only)" 4
+.IX Item "-Wmissing-parameter-type (C and Objective-C only)"
+A function parameter is declared without a type specifier in K&R\-style
+functions:
+.Sp
+.Vb 1
+\& void foo(bar) { }
+.Ve
+.Sp
+This warning is also enabled by \fB\-Wextra\fR.
+.IP "\fB\-Wmissing\-prototypes\fR (C and Objective-C only)" 4
+.IX Item "-Wmissing-prototypes (C and Objective-C only)"
+Warn if a global function is defined without a previous prototype
+declaration. This warning is issued even if the definition itself
+provides a prototype. The aim is to detect global functions that fail
+to be declared in header files.
+.IP "\fB\-Wmissing\-declarations\fR" 4
+.IX Item "-Wmissing-declarations"
+Warn if a global function is defined without a previous declaration.
+Do so even if the definition itself provides a prototype.
+Use this option to detect global functions that are not declared in
+header files. In \*(C+, no warnings are issued for function templates,
+or for inline functions, or for functions in anonymous namespaces.
+.IP "\fB\-Wmissing\-field\-initializers\fR" 4
+.IX Item "-Wmissing-field-initializers"
+Warn if a structure's initializer has some fields missing. For
+example, the following code would cause such a warning, because
+\&\f(CW\*(C`x.h\*(C'\fR is implicitly zero:
+.Sp
+.Vb 2
+\& struct s { int f, g, h; };
+\& struct s x = { 3, 4 };
+.Ve
+.Sp
+This option does not warn about designated initializers, so the following
+modification would not trigger a warning:
+.Sp
+.Vb 2
+\& struct s { int f, g, h; };
+\& struct s x = { .f = 3, .g = 4 };
+.Ve
+.Sp
+This warning is included in \fB\-Wextra\fR. To get other \fB\-Wextra\fR
+warnings without this one, use \fB\-Wextra \-Wno\-missing\-field\-initializers\fR.
+.IP "\fB\-Wmissing\-noreturn\fR" 4
+.IX Item "-Wmissing-noreturn"
+Warn about functions which might be candidates for attribute \f(CW\*(C`noreturn\*(C'\fR.
+Note these are only possible candidates, not absolute ones. Care should
+be taken to manually verify functions actually do not ever return before
+adding the \f(CW\*(C`noreturn\*(C'\fR attribute, otherwise subtle code generation
+bugs could be introduced. You will not get a warning for \f(CW\*(C`main\*(C'\fR in
+hosted C environments.
+.IP "\fB\-Wmissing\-format\-attribute\fR" 4
+.IX Item "-Wmissing-format-attribute"
+Warn about function pointers which might be candidates for \f(CW\*(C`format\*(C'\fR
+attributes. Note these are only possible candidates, not absolute ones.
+\&\s-1GCC\s0 will guess that function pointers with \f(CW\*(C`format\*(C'\fR attributes that
+are used in assignment, initialization, parameter passing or return
+statements should have a corresponding \f(CW\*(C`format\*(C'\fR attribute in the
+resulting type. I.e. the left-hand side of the assignment or
+initialization, the type of the parameter variable, or the return type
+of the containing function respectively should also have a \f(CW\*(C`format\*(C'\fR
+attribute to avoid the warning.
+.Sp
+\&\s-1GCC\s0 will also warn about function definitions which might be
+candidates for \f(CW\*(C`format\*(C'\fR attributes. Again, these are only
+possible candidates. \s-1GCC\s0 will guess that \f(CW\*(C`format\*(C'\fR attributes
+might be appropriate for any function that calls a function like
+\&\f(CW\*(C`vprintf\*(C'\fR or \f(CW\*(C`vscanf\*(C'\fR, but this might not always be the
+case, and some functions for which \f(CW\*(C`format\*(C'\fR attributes are
+appropriate may not be detected.
+.IP "\fB\-Wno\-multichar\fR" 4
+.IX Item "-Wno-multichar"
+Do not warn if a multicharacter constant (\fB'\s-1FOOF\s0'\fR) is used.
+Usually they indicate a typo in the user's code, as they have
+implementation-defined values, and should not be used in portable code.
+.IP "\fB\-Wnormalized=<none|id|nfc|nfkc>\fR" 4
+.IX Item "-Wnormalized=<none|id|nfc|nfkc>"
+In \s-1ISO\s0 C and \s-1ISO\s0 \*(C+, two identifiers are different if they are
+different sequences of characters. However, sometimes when characters
+outside the basic \s-1ASCII\s0 character set are used, you can have two
+different character sequences that look the same. To avoid confusion,
+the \s-1ISO\s0 10646 standard sets out some \fInormalization rules\fR which
+when applied ensure that two sequences that look the same are turned into
+the same sequence. \s-1GCC\s0 can warn you if you are using identifiers which
+have not been normalized; this option controls that warning.
+.Sp
+There are four levels of warning that \s-1GCC\s0 supports. The default is
+\&\fB\-Wnormalized=nfc\fR, which warns about any identifier which is
+not in the \s-1ISO\s0 10646 \*(L"C\*(R" normalized form, \fI\s-1NFC\s0\fR. \s-1NFC\s0 is the
+recommended form for most uses.
+.Sp
+Unfortunately, there are some characters which \s-1ISO\s0 C and \s-1ISO\s0 \*(C+ allow
+in identifiers that when turned into \s-1NFC\s0 aren't allowable as
+identifiers. That is, there's no way to use these symbols in portable
+\&\s-1ISO\s0 C or \*(C+ and have all your identifiers in \s-1NFC\s0.
+\&\fB\-Wnormalized=id\fR suppresses the warning for these characters.
+It is hoped that future versions of the standards involved will correct
+this, which is why this option is not the default.
+.Sp
+You can switch the warning off for all characters by writing
+\&\fB\-Wnormalized=none\fR. You would only want to do this if you
+were using some other normalization scheme (like \*(L"D\*(R"), because
+otherwise you can easily create bugs that are literally impossible to see.
+.Sp
+Some characters in \s-1ISO\s0 10646 have distinct meanings but look identical
+in some fonts or display methodologies, especially once formatting has
+been applied. For instance \f(CW\*(C`\eu207F\*(C'\fR, \*(L"\s-1SUPERSCRIPT\s0 \s-1LATIN\s0 \s-1SMALL\s0
+\&\s-1LETTER\s0 N\*(R", will display just like a regular \f(CW\*(C`n\*(C'\fR which has been
+placed in a superscript. \s-1ISO\s0 10646 defines the \fI\s-1NFKC\s0\fR
+normalization scheme to convert all these into a standard form as
+well, and \s-1GCC\s0 will warn if your code is not in \s-1NFKC\s0 if you use
+\&\fB\-Wnormalized=nfkc\fR. This warning is comparable to warning
+about every identifier that contains the letter O because it might be
+confused with the digit 0, and so is not the default, but may be
+useful as a local coding convention if the programming environment is
+unable to be fixed to display these characters distinctly.
+.IP "\fB\-Wno\-deprecated\fR" 4
+.IX Item "-Wno-deprecated"
+Do not warn about usage of deprecated features.
+.IP "\fB\-Wno\-deprecated\-declarations\fR" 4
+.IX Item "-Wno-deprecated-declarations"
+Do not warn about uses of functions,
+variables, and types marked as deprecated by using the \f(CW\*(C`deprecated\*(C'\fR
+attribute.
+.IP "\fB\-Wno\-overflow\fR" 4
+.IX Item "-Wno-overflow"
+Do not warn about compile-time overflow in constant expressions.
+.IP "\fB\-Woverride\-init\fR (C and Objective-C only)" 4
+.IX Item "-Woverride-init (C and Objective-C only)"
+Warn if an initialized field without side effects is overridden when
+using designated initializers.
+.Sp
+This warning is included in \fB\-Wextra\fR. To get other
+\&\fB\-Wextra\fR warnings without this one, use \fB\-Wextra
+\&\-Wno\-override\-init\fR.
+.IP "\fB\-Wpacked\fR" 4
+.IX Item "-Wpacked"
+Warn if a structure is given the packed attribute, but the packed
+attribute has no effect on the layout or size of the structure.
+Such structures may be mis-aligned for little benefit. For
+instance, in this code, the variable \f(CW\*(C`f.x\*(C'\fR in \f(CW\*(C`struct bar\*(C'\fR
+will be misaligned even though \f(CW\*(C`struct bar\*(C'\fR does not itself
+have the packed attribute:
+.Sp
+.Vb 8
+\& struct foo {
+\& int x;
+\& char a, b, c, d;
+\& } _\|_attribute_\|_((packed));
+\& struct bar {
+\& char z;
+\& struct foo f;
+\& };
+.Ve
+.IP "\fB\-Wpacked\-bitfield\-compat\fR" 4
+.IX Item "-Wpacked-bitfield-compat"
+The 4.1, 4.2 and 4.3 series of \s-1GCC\s0 ignore the \f(CW\*(C`packed\*(C'\fR attribute
+on bit-fields of type \f(CW\*(C`char\*(C'\fR. This has been fixed in \s-1GCC\s0 4.4 but
+the change can lead to differences in the structure layout. \s-1GCC\s0
+informs you when the offset of such a field has changed in \s-1GCC\s0 4.4.
+For example there is no longer a 4\-bit padding between field \f(CW\*(C`a\*(C'\fR
+and \f(CW\*(C`b\*(C'\fR in this structure:
+.Sp
+.Vb 5
+\& struct foo
+\& {
+\& char a:4;
+\& char b:8;
+\& } _\|_attribute_\|_ ((packed));
+.Ve
+.Sp
+This warning is enabled by default. Use
+\&\fB\-Wno\-packed\-bitfield\-compat\fR to disable this warning.
+.IP "\fB\-Wpadded\fR" 4
+.IX Item "-Wpadded"
+Warn if padding is included in a structure, either to align an element
+of the structure or to align the whole structure. Sometimes when this
+happens it is possible to rearrange the fields of the structure to
+reduce the padding and so make the structure smaller.
+.IP "\fB\-Wredundant\-decls\fR" 4
+.IX Item "-Wredundant-decls"
+Warn if anything is declared more than once in the same scope, even in
+cases where multiple declaration is valid and changes nothing.
+.IP "\fB\-Wnested\-externs\fR (C and Objective-C only)" 4
+.IX Item "-Wnested-externs (C and Objective-C only)"
+Warn if an \f(CW\*(C`extern\*(C'\fR declaration is encountered within a function.
+.IP "\fB\-Wunreachable\-code\fR" 4
+.IX Item "-Wunreachable-code"
+Warn if the compiler detects that code will never be executed.
+.Sp
+This option is intended to warn when the compiler detects that at
+least a whole line of source code will never be executed, because
+some condition is never satisfied or because it is after a
+procedure that never returns.
+.Sp
+It is possible for this option to produce a warning even though there
+are circumstances under which part of the affected line can be executed,
+so care should be taken when removing apparently-unreachable code.
+.Sp
+For instance, when a function is inlined, a warning may mean that the
+line is unreachable in only one inlined copy of the function.
+.Sp
+This option is not made part of \fB\-Wall\fR because in a debugging
+version of a program there is often substantial code which checks
+correct functioning of the program and is, hopefully, unreachable
+because the program does work. Another common use of unreachable
+code is to provide behavior which is selectable at compile-time.
+.IP "\fB\-Winline\fR" 4
+.IX Item "-Winline"
+Warn if a function can not be inlined and it was declared as inline.
+Even with this option, the compiler will not warn about failures to
+inline functions declared in system headers.
+.Sp
+The compiler uses a variety of heuristics to determine whether or not
+to inline a function. For example, the compiler takes into account
+the size of the function being inlined and the amount of inlining
+that has already been done in the current function. Therefore,
+seemingly insignificant changes in the source program can cause the
+warnings produced by \fB\-Winline\fR to appear or disappear.
+.IP "\fB\-Wno\-invalid\-offsetof\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wno-invalid-offsetof ( and Objective- only)"
+Suppress warnings from applying the \fBoffsetof\fR macro to a non-POD
+type. According to the 1998 \s-1ISO\s0 \*(C+ standard, applying \fBoffsetof\fR
+to a non-POD type is undefined. In existing \*(C+ implementations,
+however, \fBoffsetof\fR typically gives meaningful results even when
+applied to certain kinds of non-POD types. (Such as a simple
+\&\fBstruct\fR that fails to be a \s-1POD\s0 type only by virtue of having a
+constructor.) This flag is for users who are aware that they are
+writing nonportable code and who have deliberately chosen to ignore the
+warning about it.
+.Sp
+The restrictions on \fBoffsetof\fR may be relaxed in a future version
+of the \*(C+ standard.
+.IP "\fB\-Wno\-int\-to\-pointer\-cast\fR (C and Objective-C only)" 4
+.IX Item "-Wno-int-to-pointer-cast (C and Objective-C only)"
+Suppress warnings from casts to pointer type of an integer of a
+different size.
+.IP "\fB\-Wno\-pointer\-to\-int\-cast\fR (C and Objective-C only)" 4
+.IX Item "-Wno-pointer-to-int-cast (C and Objective-C only)"
+Suppress warnings from casts from a pointer to an integer type of a
+different size.
+.IP "\fB\-Winvalid\-pch\fR" 4
+.IX Item "-Winvalid-pch"
+Warn if a precompiled header is found in
+the search path but can't be used.
+.IP "\fB\-Wlong\-long\fR" 4
+.IX Item "-Wlong-long"
+Warn if \fBlong long\fR type is used. This is default. To inhibit
+the warning messages, use \fB\-Wno\-long\-long\fR. Flags
+\&\fB\-Wlong\-long\fR and \fB\-Wno\-long\-long\fR are taken into account
+only when \fB\-pedantic\fR flag is used.
+.IP "\fB\-Wvariadic\-macros\fR" 4
+.IX Item "-Wvariadic-macros"
+Warn if variadic macros are used in pedantic \s-1ISO\s0 C90 mode, or the \s-1GNU\s0
+alternate syntax when in pedantic \s-1ISO\s0 C99 mode. This is default.
+To inhibit the warning messages, use \fB\-Wno\-variadic\-macros\fR.
+.IP "\fB\-Wvla\fR" 4
+.IX Item "-Wvla"
+Warn if variable length array is used in the code.
+\&\fB\-Wno\-vla\fR will prevent the \fB\-pedantic\fR warning of
+the variable length array.
+.IP "\fB\-Wvolatile\-register\-var\fR" 4
+.IX Item "-Wvolatile-register-var"
+Warn if a register variable is declared volatile. The volatile
+modifier does not inhibit all optimizations that may eliminate reads
+and/or writes to register variables. This warning is enabled by
+\&\fB\-Wall\fR.
+.IP "\fB\-Wdisabled\-optimization\fR" 4
+.IX Item "-Wdisabled-optimization"
+Warn if a requested optimization pass is disabled. This warning does
+not generally indicate that there is anything wrong with your code; it
+merely indicates that \s-1GCC\s0's optimizers were unable to handle the code
+effectively. Often, the problem is that your code is too big or too
+complex; \s-1GCC\s0 will refuse to optimize programs when the optimization
+itself is likely to take inordinate amounts of time.
+.IP "\fB\-Wpointer\-sign\fR (C and Objective-C only)" 4
+.IX Item "-Wpointer-sign (C and Objective-C only)"
+Warn for pointer argument passing or assignment with different signedness.
+This option is only supported for C and Objective-C. It is implied by
+\&\fB\-Wall\fR and by \fB\-pedantic\fR, which can be disabled with
+\&\fB\-Wno\-pointer\-sign\fR.
+.IP "\fB\-Wstack\-protector\fR" 4
+.IX Item "-Wstack-protector"
+This option is only active when \fB\-fstack\-protector\fR is active. It
+warns about functions that will not be protected against stack smashing.
+.IP "\fB\-Wno\-mudflap\fR" 4
+.IX Item "-Wno-mudflap"
+Suppress warnings about constructs that cannot be instrumented by
+\&\fB\-fmudflap\fR.
+.IP "\fB\-Woverlength\-strings\fR" 4
+.IX Item "-Woverlength-strings"
+Warn about string constants which are longer than the \*(L"minimum
+maximum\*(R" length specified in the C standard. Modern compilers
+generally allow string constants which are much longer than the
+standard's minimum limit, but very portable programs should avoid
+using longer strings.
+.Sp
+The limit applies \fIafter\fR string constant concatenation, and does
+not count the trailing \s-1NUL\s0. In C89, the limit was 509 characters; in
+C99, it was raised to 4095. \*(C+98 does not specify a normative
+minimum maximum, so we do not diagnose overlength strings in \*(C+.
+.Sp
+This option is implied by \fB\-pedantic\fR, and can be disabled with
+\&\fB\-Wno\-overlength\-strings\fR.
+.Sh "Options for Debugging Your Program or \s-1GCC\s0"
+.IX Subsection "Options for Debugging Your Program or GCC"
+\&\s-1GCC\s0 has various special options that are used for debugging
+either your program or \s-1GCC:\s0
+.IP "\fB\-g\fR" 4
+.IX Item "-g"
+Produce debugging information in the operating system's native format
+(stabs, \s-1COFF\s0, \s-1XCOFF\s0, or \s-1DWARF\s0 2). \s-1GDB\s0 can work with this debugging
+information.
+.Sp
+On most systems that use stabs format, \fB\-g\fR enables use of extra
+debugging information that only \s-1GDB\s0 can use; this extra information
+makes debugging work better in \s-1GDB\s0 but will probably make other debuggers
+crash or
+refuse to read the program. If you want to control for certain whether
+to generate the extra information, use \fB\-gstabs+\fR, \fB\-gstabs\fR,
+\&\fB\-gxcoff+\fR, \fB\-gxcoff\fR, or \fB\-gvms\fR (see below).
+.Sp
+\&\s-1GCC\s0 allows you to use \fB\-g\fR with
+\&\fB\-O\fR. The shortcuts taken by optimized code may occasionally
+produce surprising results: some variables you declared may not exist
+at all; flow of control may briefly move where you did not expect it;
+some statements may not be executed because they compute constant
+results or their values were already at hand; some statements may
+execute in different places because they were moved out of loops.
+.Sp
+Nevertheless it proves possible to debug optimized output. This makes
+it reasonable to use the optimizer for programs that might have bugs.
+.Sp
+The following options are useful when \s-1GCC\s0 is generated with the
+capability for more than one debugging format.
+.IP "\fB\-ggdb\fR" 4
+.IX Item "-ggdb"
+Produce debugging information for use by \s-1GDB\s0. This means to use the
+most expressive format available (\s-1DWARF\s0 2, stabs, or the native format
+if neither of those are supported), including \s-1GDB\s0 extensions if at all
+possible.
+.IP "\fB\-gstabs\fR" 4
+.IX Item "-gstabs"
+Produce debugging information in stabs format (if that is supported),
+without \s-1GDB\s0 extensions. This is the format used by \s-1DBX\s0 on most \s-1BSD\s0
+systems. On \s-1MIPS\s0, Alpha and System V Release 4 systems this option
+produces stabs debugging output which is not understood by \s-1DBX\s0 or \s-1SDB\s0.
+On System V Release 4 systems this option requires the \s-1GNU\s0 assembler.
+.IP "\fB\-feliminate\-unused\-debug\-symbols\fR" 4
+.IX Item "-feliminate-unused-debug-symbols"
+Produce debugging information in stabs format (if that is supported),
+for only symbols that are actually used.
+.IP "\fB\-femit\-class\-debug\-always\fR" 4
+.IX Item "-femit-class-debug-always"
+Instead of emitting debugging information for a \*(C+ class in only one
+object file, emit it in all object files using the class. This option
+should be used only with debuggers that are unable to handle the way \s-1GCC\s0
+normally emits debugging information for classes because using this
+option will increase the size of debugging information by as much as a
+factor of two.
+.IP "\fB\-gstabs+\fR" 4
+.IX Item "-gstabs+"
+Produce debugging information in stabs format (if that is supported),
+using \s-1GNU\s0 extensions understood only by the \s-1GNU\s0 debugger (\s-1GDB\s0). The
+use of these extensions is likely to make other debuggers crash or
+refuse to read the program.
+.IP "\fB\-gcoff\fR" 4
+.IX Item "-gcoff"
+Produce debugging information in \s-1COFF\s0 format (if that is supported).
+This is the format used by \s-1SDB\s0 on most System V systems prior to
+System V Release 4.
+.IP "\fB\-gxcoff\fR" 4
+.IX Item "-gxcoff"
+Produce debugging information in \s-1XCOFF\s0 format (if that is supported).
+This is the format used by the \s-1DBX\s0 debugger on \s-1IBM\s0 \s-1RS/6000\s0 systems.
+.IP "\fB\-gxcoff+\fR" 4
+.IX Item "-gxcoff+"
+Produce debugging information in \s-1XCOFF\s0 format (if that is supported),
+using \s-1GNU\s0 extensions understood only by the \s-1GNU\s0 debugger (\s-1GDB\s0). The
+use of these extensions is likely to make other debuggers crash or
+refuse to read the program, and may cause assemblers other than the \s-1GNU\s0
+assembler (\s-1GAS\s0) to fail with an error.
+.IP "\fB\-gdwarf\-2\fR" 4
+.IX Item "-gdwarf-2"
+Produce debugging information in \s-1DWARF\s0 version 2 format (if that is
+supported). This is the format used by \s-1DBX\s0 on \s-1IRIX\s0 6. With this
+option, \s-1GCC\s0 uses features of \s-1DWARF\s0 version 3 when they are useful;
+version 3 is upward compatible with version 2, but may still cause
+problems for older debuggers.
+.IP "\fB\-gvms\fR" 4
+.IX Item "-gvms"
+Produce debugging information in \s-1VMS\s0 debug format (if that is
+supported). This is the format used by \s-1DEBUG\s0 on \s-1VMS\s0 systems.
+.IP "\fB\-g\fR\fIlevel\fR" 4
+.IX Item "-glevel"
+.PD 0
+.IP "\fB\-ggdb\fR\fIlevel\fR" 4
+.IX Item "-ggdblevel"
+.IP "\fB\-gstabs\fR\fIlevel\fR" 4
+.IX Item "-gstabslevel"
+.IP "\fB\-gcoff\fR\fIlevel\fR" 4
+.IX Item "-gcofflevel"
+.IP "\fB\-gxcoff\fR\fIlevel\fR" 4
+.IX Item "-gxcofflevel"
+.IP "\fB\-gvms\fR\fIlevel\fR" 4
+.IX Item "-gvmslevel"
+.PD
+Request debugging information and also use \fIlevel\fR to specify how
+much information. The default level is 2.
+.Sp
+Level 0 produces no debug information at all. Thus, \fB\-g0\fR negates
+\&\fB\-g\fR.
+.Sp
+Level 1 produces minimal information, enough for making backtraces in
+parts of the program that you don't plan to debug. This includes
+descriptions of functions and external variables, but no information
+about local variables and no line numbers.
+.Sp
+Level 3 includes extra information, such as all the macro definitions
+present in the program. Some debuggers support macro expansion when
+you use \fB\-g3\fR.
+.Sp
+\&\fB\-gdwarf\-2\fR does not accept a concatenated debug level, because
+\&\s-1GCC\s0 used to support an option \fB\-gdwarf\fR that meant to generate
+debug information in version 1 of the \s-1DWARF\s0 format (which is very
+different from version 2), and it would have been too confusing. That
+debug format is long obsolete, but the option cannot be changed now.
+Instead use an additional \fB\-g\fR\fIlevel\fR option to change the
+debug level for \s-1DWARF2\s0.
+.IP "\fB\-feliminate\-dwarf2\-dups\fR" 4
+.IX Item "-feliminate-dwarf2-dups"
+Compress \s-1DWARF2\s0 debugging information by eliminating duplicated
+information about each symbol. This option only makes sense when
+generating \s-1DWARF2\s0 debugging information with \fB\-gdwarf\-2\fR.
+.IP "\fB\-femit\-struct\-debug\-baseonly\fR" 4
+.IX Item "-femit-struct-debug-baseonly"
+Emit debug information for struct-like types
+only when the base name of the compilation source file
+matches the base name of file in which the struct was defined.
+.Sp
+This option substantially reduces the size of debugging information,
+but at significant potential loss in type information to the debugger.
+See \fB\-femit\-struct\-debug\-reduced\fR for a less aggressive option.
+See \fB\-femit\-struct\-debug\-detailed\fR for more detailed control.
+.Sp
+This option works only with \s-1DWARF\s0 2.
+.IP "\fB\-femit\-struct\-debug\-reduced\fR" 4
+.IX Item "-femit-struct-debug-reduced"
+Emit debug information for struct-like types
+only when the base name of the compilation source file
+matches the base name of file in which the type was defined,
+unless the struct is a template or defined in a system header.
+.Sp
+This option significantly reduces the size of debugging information,
+with some potential loss in type information to the debugger.
+See \fB\-femit\-struct\-debug\-baseonly\fR for a more aggressive option.
+See \fB\-femit\-struct\-debug\-detailed\fR for more detailed control.
+.Sp
+This option works only with \s-1DWARF\s0 2.
+.IP "\fB\-femit\-struct\-debug\-detailed\fR[\fB=\fR\fIspec-list\fR]" 4
+.IX Item "-femit-struct-debug-detailed[=spec-list]"
+Specify the struct-like types
+for which the compiler will generate debug information.
+The intent is to reduce duplicate struct debug information
+between different object files within the same program.
+.Sp
+This option is a detailed version of
+\&\fB\-femit\-struct\-debug\-reduced\fR and \fB\-femit\-struct\-debug\-baseonly\fR,
+which will serve for most needs.
+.Sp
+A specification has the syntax
+[\fBdir:\fR|\fBind:\fR][\fBord:\fR|\fBgen:\fR](\fBany\fR|\fBsys\fR|\fBbase\fR|\fBnone\fR)
+.Sp
+The optional first word limits the specification to
+structs that are used directly (\fBdir:\fR) or used indirectly (\fBind:\fR).
+A struct type is used directly when it is the type of a variable, member.
+Indirect uses arise through pointers to structs.
+That is, when use of an incomplete struct would be legal, the use is indirect.
+An example is
+\&\fBstruct one direct; struct two * indirect;\fR.
+.Sp
+The optional second word limits the specification to
+ordinary structs (\fBord:\fR) or generic structs (\fBgen:\fR).
+Generic structs are a bit complicated to explain.
+For \*(C+, these are non-explicit specializations of template classes,
+or non-template classes within the above.
+Other programming languages have generics,
+but \fB\-femit\-struct\-debug\-detailed\fR does not yet implement them.
+.Sp
+The third word specifies the source files for those
+structs for which the compiler will emit debug information.
+The values \fBnone\fR and \fBany\fR have the normal meaning.
+The value \fBbase\fR means that
+the base of name of the file in which the type declaration appears
+must match the base of the name of the main compilation file.
+In practice, this means that
+types declared in \fIfoo.c\fR and \fIfoo.h\fR will have debug information,
+but types declared in other header will not.
+The value \fBsys\fR means those types satisfying \fBbase\fR
+or declared in system or compiler headers.
+.Sp
+You may need to experiment to determine the best settings for your application.
+.Sp
+The default is \fB\-femit\-struct\-debug\-detailed=all\fR.
+.Sp
+This option works only with \s-1DWARF\s0 2.
+.IP "\fB\-fno\-merge\-debug\-strings\fR" 4
+.IX Item "-fno-merge-debug-strings"
+Direct the linker to not merge together strings in the debugging
+information which are identical in different object files. Merging is
+not supported by all assemblers or linkers. Merging decreases the size
+of the debug information in the output file at the cost of increasing
+link processing time. Merging is enabled by default.
+.IP "\fB\-fdebug\-prefix\-map=\fR\fIold\fR\fB=\fR\fInew\fR" 4
+.IX Item "-fdebug-prefix-map=old=new"
+When compiling files in directory \fI\fIold\fI\fR, record debugging
+information describing them as in \fI\fInew\fI\fR instead.
+.IP "\fB\-fno\-dwarf2\-cfi\-asm\fR" 4
+.IX Item "-fno-dwarf2-cfi-asm"
+Emit \s-1DWARF\s0 2 unwind info as compiler generated \f(CW\*(C`.eh_frame\*(C'\fR section
+instead of using \s-1GAS\s0 \f(CW\*(C`.cfi_*\*(C'\fR directives.
+.IP "\fB\-p\fR" 4
+.IX Item "-p"
+Generate extra code to write profile information suitable for the
+analysis program \fBprof\fR. You must use this option when compiling
+the source files you want data about, and you must also use it when
+linking.
+.IP "\fB\-pg\fR" 4
+.IX Item "-pg"
+Generate extra code to write profile information suitable for the
+analysis program \fBgprof\fR. You must use this option when compiling
+the source files you want data about, and you must also use it when
+linking.
+.IP "\fB\-Q\fR" 4
+.IX Item "-Q"
+Makes the compiler print out each function name as it is compiled, and
+print some statistics about each pass when it finishes.
+.IP "\fB\-ftime\-report\fR" 4
+.IX Item "-ftime-report"
+Makes the compiler print some statistics about the time consumed by each
+pass when it finishes.
+.IP "\fB\-fmem\-report\fR" 4
+.IX Item "-fmem-report"
+Makes the compiler print some statistics about permanent memory
+allocation when it finishes.
+.IP "\fB\-fpre\-ipa\-mem\-report\fR" 4
+.IX Item "-fpre-ipa-mem-report"
+.PD 0
+.IP "\fB\-fpost\-ipa\-mem\-report\fR" 4
+.IX Item "-fpost-ipa-mem-report"
+.PD
+Makes the compiler print some statistics about permanent memory
+allocation before or after interprocedural optimization.
+.IP "\fB\-fprofile\-arcs\fR" 4
+.IX Item "-fprofile-arcs"
+Add code so that program flow \fIarcs\fR are instrumented. During
+execution the program records how many times each branch and call is
+executed and how many times it is taken or returns. When the compiled
+program exits it saves this data to a file called
+\&\fI\fIauxname\fI.gcda\fR for each source file. The data may be used for
+profile-directed optimizations (\fB\-fbranch\-probabilities\fR), or for
+test coverage analysis (\fB\-ftest\-coverage\fR). Each object file's
+\&\fIauxname\fR is generated from the name of the output file, if
+explicitly specified and it is not the final executable, otherwise it is
+the basename of the source file. In both cases any suffix is removed
+(e.g. \fIfoo.gcda\fR for input file \fIdir/foo.c\fR, or
+\&\fIdir/foo.gcda\fR for output file specified as \fB\-o dir/foo.o\fR).
+.IP "\fB\-\-coverage\fR" 4
+.IX Item "--coverage"
+This option is used to compile and link code instrumented for coverage
+analysis. The option is a synonym for \fB\-fprofile\-arcs\fR
+\&\fB\-ftest\-coverage\fR (when compiling) and \fB\-lgcov\fR (when
+linking). See the documentation for those options for more details.
+.RS 4
+.IP "\(bu" 4
+Compile the source files with \fB\-fprofile\-arcs\fR plus optimization
+and code generation options. For test coverage analysis, use the
+additional \fB\-ftest\-coverage\fR option. You do not need to profile
+every source file in a program.
+.IP "\(bu" 4
+Link your object files with \fB\-lgcov\fR or \fB\-fprofile\-arcs\fR
+(the latter implies the former).
+.IP "\(bu" 4
+Run the program on a representative workload to generate the arc profile
+information. This may be repeated any number of times. You can run
+concurrent instances of your program, and provided that the file system
+supports locking, the data files will be correctly updated. Also
+\&\f(CW\*(C`fork\*(C'\fR calls are detected and correctly handled (double counting
+will not happen).
+.IP "\(bu" 4
+For profile-directed optimizations, compile the source files again with
+the same optimization and code generation options plus
+\&\fB\-fbranch\-probabilities\fR.
+.IP "\(bu" 4
+For test coverage analysis, use \fBgcov\fR to produce human readable
+information from the \fI.gcno\fR and \fI.gcda\fR files. Refer to the
+\&\fBgcov\fR documentation for further information.
+.RE
+.RS 4
+.Sp
+With \fB\-fprofile\-arcs\fR, for each function of your program \s-1GCC\s0
+creates a program flow graph, then finds a spanning tree for the graph.
+Only arcs that are not on the spanning tree have to be instrumented: the
+compiler adds code to count the number of times that these arcs are
+executed. When an arc is the only exit or only entrance to a block, the
+instrumentation code can be added to the block; otherwise, a new basic
+block must be created to hold the instrumentation code.
+.RE
+.IP "\fB\-ftest\-coverage\fR" 4
+.IX Item "-ftest-coverage"
+Produce a notes file that the \fBgcov\fR code-coverage utility can use to
+show program coverage. Each source file's note file is called
+\&\fI\fIauxname\fI.gcno\fR. Refer to the \fB\-fprofile\-arcs\fR option
+above for a description of \fIauxname\fR and instructions on how to
+generate test coverage data. Coverage data will match the source files
+more closely, if you do not optimize.
+.IP "\fB\-fdbg\-cnt\-list\fR" 4
+.IX Item "-fdbg-cnt-list"
+Print the name and the counter upperbound for all debug counters.
+.IP "\fB\-fdbg\-cnt=\fR\fIcounter-value-list\fR" 4
+.IX Item "-fdbg-cnt=counter-value-list"
+Set the internal debug counter upperbound. \fIcounter-value-list\fR
+is a comma-separated list of \fIname\fR:\fIvalue\fR pairs
+which sets the upperbound of each debug counter \fIname\fR to \fIvalue\fR.
+All debug counters have the initial upperbound of \fI\s-1UINT_MAX\s0\fR,
+thus \fIdbg_cnt()\fR returns true always unless the upperbound is set by this option.
+e.g. With \-fdbg\-cnt=dce:10,tail_call:0
+dbg_cnt(dce) will return true only for first 10 invocations
+and dbg_cnt(tail_call) will return false always.
+.IP "\fB\-d\fR\fIletters\fR" 4
+.IX Item "-dletters"
+.PD 0
+.IP "\fB\-fdump\-rtl\-\fR\fIpass\fR" 4
+.IX Item "-fdump-rtl-pass"
+.PD
+Says to make debugging dumps during compilation at times specified by
+\&\fIletters\fR. This is used for debugging the RTL-based passes of the
+compiler. The file names for most of the dumps are made by appending a
+pass number and a word to the \fIdumpname\fR. \fIdumpname\fR is generated
+from the name of the output file, if explicitly specified and it is not
+an executable, otherwise it is the basename of the source file. These
+switches may have different effects when \fB\-E\fR is used for
+preprocessing.
+.Sp
+Debug dumps can be enabled with a \fB\-fdump\-rtl\fR switch or some
+\&\fB\-d\fR option \fIletters\fR. Here are the possible
+letters for use in \fIpass\fR and \fIletters\fR, and their meanings:
+.RS 4
+.IP "\fB\-fdump\-rtl\-alignments\fR" 4
+.IX Item "-fdump-rtl-alignments"
+Dump after branch alignments have been computed.
+.IP "\fB\-fdump\-rtl\-asmcons\fR" 4
+.IX Item "-fdump-rtl-asmcons"
+Dump after fixing rtl statements that have unsatisfied in/out constraints.
+.IP "\fB\-fdump\-rtl\-auto_inc_dec\fR" 4
+.IX Item "-fdump-rtl-auto_inc_dec"
+Dump after auto-inc-dec discovery. This pass is only run on
+architectures that have auto inc or auto dec instructions.
+.IP "\fB\-fdump\-rtl\-barriers\fR" 4
+.IX Item "-fdump-rtl-barriers"
+Dump after cleaning up the barrier instructions.
+.IP "\fB\-fdump\-rtl\-bbpart\fR" 4
+.IX Item "-fdump-rtl-bbpart"
+Dump after partitioning hot and cold basic blocks.
+.IP "\fB\-fdump\-rtl\-bbro\fR" 4
+.IX Item "-fdump-rtl-bbro"
+Dump after block reordering.
+.IP "\fB\-fdump\-rtl\-btl1\fR" 4
+.IX Item "-fdump-rtl-btl1"
+.PD 0
+.IP "\fB\-fdump\-rtl\-btl2\fR" 4
+.IX Item "-fdump-rtl-btl2"
+.PD
+\&\fB\-fdump\-rtl\-btl1\fR and \fB\-fdump\-rtl\-btl2\fR enable dumping
+after the two branch
+target load optimization passes.
+.IP "\fB\-fdump\-rtl\-bypass\fR" 4
+.IX Item "-fdump-rtl-bypass"
+Dump after jump bypassing and control flow optimizations.
+.IP "\fB\-fdump\-rtl\-combine\fR" 4
+.IX Item "-fdump-rtl-combine"
+Dump after the \s-1RTL\s0 instruction combination pass.
+.IP "\fB\-fdump\-rtl\-compgotos\fR" 4
+.IX Item "-fdump-rtl-compgotos"
+Dump after duplicating the computed gotos.
+.IP "\fB\-fdump\-rtl\-ce1\fR" 4
+.IX Item "-fdump-rtl-ce1"
+.PD 0
+.IP "\fB\-fdump\-rtl\-ce2\fR" 4
+.IX Item "-fdump-rtl-ce2"
+.IP "\fB\-fdump\-rtl\-ce3\fR" 4
+.IX Item "-fdump-rtl-ce3"
+.PD
+\&\fB\-fdump\-rtl\-ce1\fR, \fB\-fdump\-rtl\-ce2\fR, and
+\&\fB\-fdump\-rtl\-ce3\fR enable dumping after the three
+if conversion passes.
+.IP "\fB\-fdump\-rtl\-cprop_hardreg\fR" 4
+.IX Item "-fdump-rtl-cprop_hardreg"
+Dump after hard register copy propagation.
+.IP "\fB\-fdump\-rtl\-csa\fR" 4
+.IX Item "-fdump-rtl-csa"
+Dump after combining stack adjustments.
+.IP "\fB\-fdump\-rtl\-cse1\fR" 4
+.IX Item "-fdump-rtl-cse1"
+.PD 0
+.IP "\fB\-fdump\-rtl\-cse2\fR" 4
+.IX Item "-fdump-rtl-cse2"
+.PD
+\&\fB\-fdump\-rtl\-cse1\fR and \fB\-fdump\-rtl\-cse2\fR enable dumping after
+the two common sub-expression elimination passes.
+.IP "\fB\-fdump\-rtl\-dce\fR" 4
+.IX Item "-fdump-rtl-dce"
+Dump after the standalone dead code elimination passes.
+.IP "\fB\-fdump\-rtl\-dbr\fR" 4
+.IX Item "-fdump-rtl-dbr"
+Dump after delayed branch scheduling.
+.IP "\fB\-fdump\-rtl\-dce1\fR" 4
+.IX Item "-fdump-rtl-dce1"
+.PD 0
+.IP "\fB\-fdump\-rtl\-dce2\fR" 4
+.IX Item "-fdump-rtl-dce2"
+.PD
+\&\fB\-fdump\-rtl\-dce1\fR and \fB\-fdump\-rtl\-dce2\fR enable dumping after
+the two dead store elimination passes.
+.IP "\fB\-fdump\-rtl\-eh\fR" 4
+.IX Item "-fdump-rtl-eh"
+Dump after finalization of \s-1EH\s0 handling code.
+.IP "\fB\-fdump\-rtl\-eh_ranges\fR" 4
+.IX Item "-fdump-rtl-eh_ranges"
+Dump after conversion of \s-1EH\s0 handling range regions.
+.IP "\fB\-fdump\-rtl\-expand\fR" 4
+.IX Item "-fdump-rtl-expand"
+Dump after \s-1RTL\s0 generation.
+.IP "\fB\-fdump\-rtl\-fwprop1\fR" 4
+.IX Item "-fdump-rtl-fwprop1"
+.PD 0
+.IP "\fB\-fdump\-rtl\-fwprop2\fR" 4
+.IX Item "-fdump-rtl-fwprop2"
+.PD
+\&\fB\-fdump\-rtl\-fwprop1\fR and \fB\-fdump\-rtl\-fwprop2\fR enable
+dumping after the two forward propagation passes.
+.IP "\fB\-fdump\-rtl\-gcse1\fR" 4
+.IX Item "-fdump-rtl-gcse1"
+.PD 0
+.IP "\fB\-fdump\-rtl\-gcse2\fR" 4
+.IX Item "-fdump-rtl-gcse2"
+.PD
+\&\fB\-fdump\-rtl\-gcse1\fR and \fB\-fdump\-rtl\-gcse2\fR enable dumping
+after global common subexpression elimination.
+.IP "\fB\-fdump\-rtl\-init\-regs\fR" 4
+.IX Item "-fdump-rtl-init-regs"
+Dump after the initialization of the registers.
+.IP "\fB\-fdump\-rtl\-initvals\fR" 4
+.IX Item "-fdump-rtl-initvals"
+Dump after the computation of the initial value sets.
+.IP "\fB\-fdump\-rtl\-into_cfglayout\fR" 4
+.IX Item "-fdump-rtl-into_cfglayout"
+Dump after converting to cfglayout mode.
+.IP "\fB\-fdump\-rtl\-ira\fR" 4
+.IX Item "-fdump-rtl-ira"
+Dump after iterated register allocation.
+.IP "\fB\-fdump\-rtl\-jump\fR" 4
+.IX Item "-fdump-rtl-jump"
+Dump after the second jump optimization.
+.IP "\fB\-fdump\-rtl\-loop2\fR" 4
+.IX Item "-fdump-rtl-loop2"
+\&\fB\-fdump\-rtl\-loop2\fR enables dumping after the rtl
+loop optimization passes.
+.IP "\fB\-fdump\-rtl\-mach\fR" 4
+.IX Item "-fdump-rtl-mach"
+Dump after performing the machine dependent reorganization pass, if that
+pass exists.
+.IP "\fB\-fdump\-rtl\-mode_sw\fR" 4
+.IX Item "-fdump-rtl-mode_sw"
+Dump after removing redundant mode switches.
+.IP "\fB\-fdump\-rtl\-rnreg\fR" 4
+.IX Item "-fdump-rtl-rnreg"
+Dump after register renumbering.
+.IP "\fB\-fdump\-rtl\-outof_cfglayout\fR" 4
+.IX Item "-fdump-rtl-outof_cfglayout"
+Dump after converting from cfglayout mode.
+.IP "\fB\-fdump\-rtl\-peephole2\fR" 4
+.IX Item "-fdump-rtl-peephole2"
+Dump after the peephole pass.
+.IP "\fB\-fdump\-rtl\-postreload\fR" 4
+.IX Item "-fdump-rtl-postreload"
+Dump after post-reload optimizations.
+.IP "\fB\-fdump\-rtl\-pro_and_epilogue\fR" 4
+.IX Item "-fdump-rtl-pro_and_epilogue"
+Dump after generating the function pro and epilogues.
+.IP "\fB\-fdump\-rtl\-regmove\fR" 4
+.IX Item "-fdump-rtl-regmove"
+Dump after the register move pass.
+.IP "\fB\-fdump\-rtl\-sched1\fR" 4
+.IX Item "-fdump-rtl-sched1"
+.PD 0
+.IP "\fB\-fdump\-rtl\-sched2\fR" 4
+.IX Item "-fdump-rtl-sched2"
+.PD
+\&\fB\-fdump\-rtl\-sched1\fR and \fB\-fdump\-rtl\-sched2\fR enable dumping
+after the basic block scheduling passes.
+.IP "\fB\-fdump\-rtl\-see\fR" 4
+.IX Item "-fdump-rtl-see"
+Dump after sign extension elimination.
+.IP "\fB\-fdump\-rtl\-seqabstr\fR" 4
+.IX Item "-fdump-rtl-seqabstr"
+Dump after common sequence discovery.
+.IP "\fB\-fdump\-rtl\-shorten\fR" 4
+.IX Item "-fdump-rtl-shorten"
+Dump after shortening branches.
+.IP "\fB\-fdump\-rtl\-sibling\fR" 4
+.IX Item "-fdump-rtl-sibling"
+Dump after sibling call optimizations.
+.IP "\fB\-fdump\-rtl\-split1\fR" 4
+.IX Item "-fdump-rtl-split1"
+.PD 0
+.IP "\fB\-fdump\-rtl\-split2\fR" 4
+.IX Item "-fdump-rtl-split2"
+.IP "\fB\-fdump\-rtl\-split3\fR" 4
+.IX Item "-fdump-rtl-split3"
+.IP "\fB\-fdump\-rtl\-split4\fR" 4
+.IX Item "-fdump-rtl-split4"
+.IP "\fB\-fdump\-rtl\-split5\fR" 4
+.IX Item "-fdump-rtl-split5"
+.PD
+\&\fB\-fdump\-rtl\-split1\fR, \fB\-fdump\-rtl\-split2\fR,
+\&\fB\-fdump\-rtl\-split3\fR, \fB\-fdump\-rtl\-split4\fR and
+\&\fB\-fdump\-rtl\-split5\fR enable dumping after five rounds of
+instruction splitting.
+.IP "\fB\-fdump\-rtl\-sms\fR" 4
+.IX Item "-fdump-rtl-sms"
+Dump after modulo scheduling. This pass is only run on some
+architectures.
+.IP "\fB\-fdump\-rtl\-stack\fR" 4
+.IX Item "-fdump-rtl-stack"
+Dump after conversion from \s-1GCC\s0's \*(L"flat register file\*(R" registers to the
+x87's stack-like registers. This pass is only run on x86 variants.
+.IP "\fB\-fdump\-rtl\-subreg1\fR" 4
+.IX Item "-fdump-rtl-subreg1"
+.PD 0
+.IP "\fB\-fdump\-rtl\-subreg2\fR" 4
+.IX Item "-fdump-rtl-subreg2"
+.PD
+\&\fB\-fdump\-rtl\-subreg1\fR and \fB\-fdump\-rtl\-subreg2\fR enable dumping after
+the two subreg expansion passes.
+.IP "\fB\-fdump\-rtl\-unshare\fR" 4
+.IX Item "-fdump-rtl-unshare"
+Dump after all rtl has been unshared.
+.IP "\fB\-fdump\-rtl\-vartrack\fR" 4
+.IX Item "-fdump-rtl-vartrack"
+Dump after variable tracking.
+.IP "\fB\-fdump\-rtl\-vregs\fR" 4
+.IX Item "-fdump-rtl-vregs"
+Dump after converting virtual registers to hard registers.
+.IP "\fB\-fdump\-rtl\-web\fR" 4
+.IX Item "-fdump-rtl-web"
+Dump after live range splitting.
+.IP "\fB\-fdump\-rtl\-regclass\fR" 4
+.IX Item "-fdump-rtl-regclass"
+.PD 0
+.IP "\fB\-fdump\-rtl\-subregs_of_mode_init\fR" 4
+.IX Item "-fdump-rtl-subregs_of_mode_init"
+.IP "\fB\-fdump\-rtl\-subregs_of_mode_finish\fR" 4
+.IX Item "-fdump-rtl-subregs_of_mode_finish"
+.IP "\fB\-fdump\-rtl\-dfinit\fR" 4
+.IX Item "-fdump-rtl-dfinit"
+.IP "\fB\-fdump\-rtl\-dfinish\fR" 4
+.IX Item "-fdump-rtl-dfinish"
+.PD
+These dumps are defined but always produce empty files.
+.IP "\fB\-fdump\-rtl\-all\fR" 4
+.IX Item "-fdump-rtl-all"
+Produce all the dumps listed above.
+.IP "\fB\-dA\fR" 4
+.IX Item "-dA"
+Annotate the assembler output with miscellaneous debugging information.
+.IP "\fB\-dD\fR" 4
+.IX Item "-dD"
+Dump all macro definitions, at the end of preprocessing, in addition to
+normal output.
+.IP "\fB\-dH\fR" 4
+.IX Item "-dH"
+Produce a core dump whenever an error occurs.
+.IP "\fB\-dm\fR" 4
+.IX Item "-dm"
+Print statistics on memory usage, at the end of the run, to
+standard error.
+.IP "\fB\-dp\fR" 4
+.IX Item "-dp"
+Annotate the assembler output with a comment indicating which
+pattern and alternative was used. The length of each instruction is
+also printed.
+.IP "\fB\-dP\fR" 4
+.IX Item "-dP"
+Dump the \s-1RTL\s0 in the assembler output as a comment before each instruction.
+Also turns on \fB\-dp\fR annotation.
+.IP "\fB\-dv\fR" 4
+.IX Item "-dv"
+For each of the other indicated dump files (\fB\-fdump\-rtl\-\fR\fIpass\fR),
+dump a representation of the control flow graph suitable for viewing with \s-1VCG\s0
+to \fI\fIfile\fI.\fIpass\fI.vcg\fR.
+.IP "\fB\-dx\fR" 4
+.IX Item "-dx"
+Just generate \s-1RTL\s0 for a function instead of compiling it. Usually used
+with \fB\-fdump\-rtl\-expand\fR.
+.IP "\fB\-dy\fR" 4
+.IX Item "-dy"
+Dump debugging information during parsing, to standard error.
+.RE
+.RS 4
+.RE
+.IP "\fB\-fdump\-noaddr\fR" 4
+.IX Item "-fdump-noaddr"
+When doing debugging dumps, suppress address output. This makes it more
+feasible to use diff on debugging dumps for compiler invocations with
+different compiler binaries and/or different
+text / bss / data / heap / stack / dso start locations.
+.IP "\fB\-fdump\-unnumbered\fR" 4
+.IX Item "-fdump-unnumbered"
+When doing debugging dumps, suppress instruction numbers and address output.
+This makes it more feasible to use diff on debugging dumps for compiler
+invocations with different options, in particular with and without
+\&\fB\-g\fR.
+.IP "\fB\-fdump\-translation\-unit\fR (\*(C+ only)" 4
+.IX Item "-fdump-translation-unit ( only)"
+.PD 0
+.IP "\fB\-fdump\-translation\-unit\-\fR\fIoptions\fR\fB \fR(\*(C+ only)" 4
+.IX Item "-fdump-translation-unit-options ( only)"
+.PD
+Dump a representation of the tree structure for the entire translation
+unit to a file. The file name is made by appending \fI.tu\fR to the
+source file name. If the \fB\-\fR\fIoptions\fR form is used, \fIoptions\fR
+controls the details of the dump as described for the
+\&\fB\-fdump\-tree\fR options.
+.IP "\fB\-fdump\-class\-hierarchy\fR (\*(C+ only)" 4
+.IX Item "-fdump-class-hierarchy ( only)"
+.PD 0
+.IP "\fB\-fdump\-class\-hierarchy\-\fR\fIoptions\fR\fB \fR(\*(C+ only)" 4
+.IX Item "-fdump-class-hierarchy-options ( only)"
+.PD
+Dump a representation of each class's hierarchy and virtual function
+table layout to a file. The file name is made by appending \fI.class\fR
+to the source file name. If the \fB\-\fR\fIoptions\fR form is used,
+\&\fIoptions\fR controls the details of the dump as described for the
+\&\fB\-fdump\-tree\fR options.
+.IP "\fB\-fdump\-ipa\-\fR\fIswitch\fR" 4
+.IX Item "-fdump-ipa-switch"
+Control the dumping at various stages of inter-procedural analysis
+language tree to a file. The file name is generated by appending a switch
+specific suffix to the source file name. The following dumps are possible:
+.RS 4
+.IP "\fBall\fR" 4
+.IX Item "all"
+Enables all inter-procedural analysis dumps.
+.IP "\fBcgraph\fR" 4
+.IX Item "cgraph"
+Dumps information about call-graph optimization, unused function removal,
+and inlining decisions.
+.IP "\fBinline\fR" 4
+.IX Item "inline"
+Dump after function inlining.
+.RE
+.RS 4
+.RE
+.IP "\fB\-fdump\-statistics\-\fR\fIoption\fR" 4
+.IX Item "-fdump-statistics-option"
+Enable and control dumping of pass statistics in a separate file. The
+file name is generated by appending a suffix ending in \fB.statistics\fR
+to the source file name. If the \fB\-\fR\fIoption\fR form is used,
+\&\fB\-stats\fR will cause counters to be summed over the whole compilation unit
+while \fB\-details\fR will dump every event as the passes generate them.
+The default with no option is to sum counters for each function compiled.
+.IP "\fB\-fdump\-tree\-\fR\fIswitch\fR" 4
+.IX Item "-fdump-tree-switch"
+.PD 0
+.IP "\fB\-fdump\-tree\-\fR\fIswitch\fR\fB\-\fR\fIoptions\fR" 4
+.IX Item "-fdump-tree-switch-options"
+.PD
+Control the dumping at various stages of processing the intermediate
+language tree to a file. The file name is generated by appending a switch
+specific suffix to the source file name. If the \fB\-\fR\fIoptions\fR
+form is used, \fIoptions\fR is a list of \fB\-\fR separated options that
+control the details of the dump. Not all options are applicable to all
+dumps, those which are not meaningful will be ignored. The following
+options are available
+.RS 4
+.IP "\fBaddress\fR" 4
+.IX Item "address"
+Print the address of each node. Usually this is not meaningful as it
+changes according to the environment and source file. Its primary use
+is for tying up a dump file with a debug environment.
+.IP "\fBslim\fR" 4
+.IX Item "slim"
+Inhibit dumping of members of a scope or body of a function merely
+because that scope has been reached. Only dump such items when they
+are directly reachable by some other path. When dumping pretty-printed
+trees, this option inhibits dumping the bodies of control structures.
+.IP "\fBraw\fR" 4
+.IX Item "raw"
+Print a raw representation of the tree. By default, trees are
+pretty-printed into a C\-like representation.
+.IP "\fBdetails\fR" 4
+.IX Item "details"
+Enable more detailed dumps (not honored by every dump option).
+.IP "\fBstats\fR" 4
+.IX Item "stats"
+Enable dumping various statistics about the pass (not honored by every dump
+option).
+.IP "\fBblocks\fR" 4
+.IX Item "blocks"
+Enable showing basic block boundaries (disabled in raw dumps).
+.IP "\fBvops\fR" 4
+.IX Item "vops"
+Enable showing virtual operands for every statement.
+.IP "\fBlineno\fR" 4
+.IX Item "lineno"
+Enable showing line numbers for statements.
+.IP "\fBuid\fR" 4
+.IX Item "uid"
+Enable showing the unique \s-1ID\s0 (\f(CW\*(C`DECL_UID\*(C'\fR) for each variable.
+.IP "\fBverbose\fR" 4
+.IX Item "verbose"
+Enable showing the tree dump for each statement.
+.IP "\fBall\fR" 4
+.IX Item "all"
+Turn on all options, except \fBraw\fR, \fBslim\fR, \fBverbose\fR
+and \fBlineno\fR.
+.RE
+.RS 4
+.Sp
+The following tree dumps are possible:
+.IP "\fBoriginal\fR" 4
+.IX Item "original"
+Dump before any tree based optimization, to \fI\fIfile\fI.original\fR.
+.IP "\fBoptimized\fR" 4
+.IX Item "optimized"
+Dump after all tree based optimization, to \fI\fIfile\fI.optimized\fR.
+.IP "\fBgimple\fR" 4
+.IX Item "gimple"
+Dump each function before and after the gimplification pass to a file. The
+file name is made by appending \fI.gimple\fR to the source file name.
+.IP "\fBcfg\fR" 4
+.IX Item "cfg"
+Dump the control flow graph of each function to a file. The file name is
+made by appending \fI.cfg\fR to the source file name.
+.IP "\fBvcg\fR" 4
+.IX Item "vcg"
+Dump the control flow graph of each function to a file in \s-1VCG\s0 format. The
+file name is made by appending \fI.vcg\fR to the source file name. Note
+that if the file contains more than one function, the generated file cannot
+be used directly by \s-1VCG\s0. You will need to cut and paste each function's
+graph into its own separate file first.
+.IP "\fBch\fR" 4
+.IX Item "ch"
+Dump each function after copying loop headers. The file name is made by
+appending \fI.ch\fR to the source file name.
+.IP "\fBssa\fR" 4
+.IX Item "ssa"
+Dump \s-1SSA\s0 related information to a file. The file name is made by appending
+\&\fI.ssa\fR to the source file name.
+.IP "\fBalias\fR" 4
+.IX Item "alias"
+Dump aliasing information for each function. The file name is made by
+appending \fI.alias\fR to the source file name.
+.IP "\fBccp\fR" 4
+.IX Item "ccp"
+Dump each function after \s-1CCP\s0. The file name is made by appending
+\&\fI.ccp\fR to the source file name.
+.IP "\fBstoreccp\fR" 4
+.IX Item "storeccp"
+Dump each function after STORE-CCP. The file name is made by appending
+\&\fI.storeccp\fR to the source file name.
+.IP "\fBpre\fR" 4
+.IX Item "pre"
+Dump trees after partial redundancy elimination. The file name is made
+by appending \fI.pre\fR to the source file name.
+.IP "\fBfre\fR" 4
+.IX Item "fre"
+Dump trees after full redundancy elimination. The file name is made
+by appending \fI.fre\fR to the source file name.
+.IP "\fBcopyprop\fR" 4
+.IX Item "copyprop"
+Dump trees after copy propagation. The file name is made
+by appending \fI.copyprop\fR to the source file name.
+.IP "\fBstore_copyprop\fR" 4
+.IX Item "store_copyprop"
+Dump trees after store copy-propagation. The file name is made
+by appending \fI.store_copyprop\fR to the source file name.
+.IP "\fBdce\fR" 4
+.IX Item "dce"
+Dump each function after dead code elimination. The file name is made by
+appending \fI.dce\fR to the source file name.
+.IP "\fBmudflap\fR" 4
+.IX Item "mudflap"
+Dump each function after adding mudflap instrumentation. The file name is
+made by appending \fI.mudflap\fR to the source file name.
+.IP "\fBsra\fR" 4
+.IX Item "sra"
+Dump each function after performing scalar replacement of aggregates. The
+file name is made by appending \fI.sra\fR to the source file name.
+.IP "\fBsink\fR" 4
+.IX Item "sink"
+Dump each function after performing code sinking. The file name is made
+by appending \fI.sink\fR to the source file name.
+.IP "\fBdom\fR" 4
+.IX Item "dom"
+Dump each function after applying dominator tree optimizations. The file
+name is made by appending \fI.dom\fR to the source file name.
+.IP "\fBdse\fR" 4
+.IX Item "dse"
+Dump each function after applying dead store elimination. The file
+name is made by appending \fI.dse\fR to the source file name.
+.IP "\fBphiopt\fR" 4
+.IX Item "phiopt"
+Dump each function after optimizing \s-1PHI\s0 nodes into straightline code. The file
+name is made by appending \fI.phiopt\fR to the source file name.
+.IP "\fBforwprop\fR" 4
+.IX Item "forwprop"
+Dump each function after forward propagating single use variables. The file
+name is made by appending \fI.forwprop\fR to the source file name.
+.IP "\fBcopyrename\fR" 4
+.IX Item "copyrename"
+Dump each function after applying the copy rename optimization. The file
+name is made by appending \fI.copyrename\fR to the source file name.
+.IP "\fBnrv\fR" 4
+.IX Item "nrv"
+Dump each function after applying the named return value optimization on
+generic trees. The file name is made by appending \fI.nrv\fR to the source
+file name.
+.IP "\fBvect\fR" 4
+.IX Item "vect"
+Dump each function after applying vectorization of loops. The file name is
+made by appending \fI.vect\fR to the source file name.
+.IP "\fBvrp\fR" 4
+.IX Item "vrp"
+Dump each function after Value Range Propagation (\s-1VRP\s0). The file name
+is made by appending \fI.vrp\fR to the source file name.
+.IP "\fBall\fR" 4
+.IX Item "all"
+Enable all the available tree dumps with the flags provided in this option.
+.RE
+.RS 4
+.RE
+.IP "\fB\-ftree\-vectorizer\-verbose=\fR\fIn\fR" 4
+.IX Item "-ftree-vectorizer-verbose=n"
+This option controls the amount of debugging output the vectorizer prints.
+This information is written to standard error, unless
+\&\fB\-fdump\-tree\-all\fR or \fB\-fdump\-tree\-vect\fR is specified,
+in which case it is output to the usual dump listing file, \fI.vect\fR.
+For \fIn\fR=0 no diagnostic information is reported.
+If \fIn\fR=1 the vectorizer reports each loop that got vectorized,
+and the total number of loops that got vectorized.
+If \fIn\fR=2 the vectorizer also reports non-vectorized loops that passed
+the first analysis phase (vect_analyze_loop_form) \- i.e. countable,
+inner-most, single-bb, single\-entry/exit loops. This is the same verbosity
+level that \fB\-fdump\-tree\-vect\-stats\fR uses.
+Higher verbosity levels mean either more information dumped for each
+reported loop, or same amount of information reported for more loops:
+If \fIn\fR=3, alignment related information is added to the reports.
+If \fIn\fR=4, data-references related information (e.g. memory dependences,
+memory access-patterns) is added to the reports.
+If \fIn\fR=5, the vectorizer reports also non-vectorized inner-most loops
+that did not pass the first analysis phase (i.e., may not be countable, or
+may have complicated control-flow).
+If \fIn\fR=6, the vectorizer reports also non-vectorized nested loops.
+For \fIn\fR=7, all the information the vectorizer generates during its
+analysis and transformation is reported. This is the same verbosity level
+that \fB\-fdump\-tree\-vect\-details\fR uses.
+.IP "\fB\-frandom\-seed=\fR\fIstring\fR" 4
+.IX Item "-frandom-seed=string"
+This option provides a seed that \s-1GCC\s0 uses when it would otherwise use
+random numbers. It is used to generate certain symbol names
+that have to be different in every compiled file. It is also used to
+place unique stamps in coverage data files and the object files that
+produce them. You can use the \fB\-frandom\-seed\fR option to produce
+reproducibly identical object files.
+.Sp
+The \fIstring\fR should be different for every file you compile.
+.IP "\fB\-fsched\-verbose=\fR\fIn\fR" 4
+.IX Item "-fsched-verbose=n"
+On targets that use instruction scheduling, this option controls the
+amount of debugging output the scheduler prints. This information is
+written to standard error, unless \fB\-fdump\-rtl\-sched1\fR or
+\&\fB\-fdump\-rtl\-sched2\fR is specified, in which case it is output
+to the usual dump listing file, \fI.sched\fR or \fI.sched2\fR
+respectively. However for \fIn\fR greater than nine, the output is
+always printed to standard error.
+.Sp
+For \fIn\fR greater than zero, \fB\-fsched\-verbose\fR outputs the
+same information as \fB\-fdump\-rtl\-sched1\fR and \fB\-fdump\-rtl\-sched2\fR.
+For \fIn\fR greater than one, it also output basic block probabilities,
+detailed ready list information and unit/insn info. For \fIn\fR greater
+than two, it includes \s-1RTL\s0 at abort point, control-flow and regions info.
+And for \fIn\fR over four, \fB\-fsched\-verbose\fR also includes
+dependence info.
+.IP "\fB\-save\-temps\fR" 4
+.IX Item "-save-temps"
+Store the usual \*(L"temporary\*(R" intermediate files permanently; place them
+in the current directory and name them based on the source file. Thus,
+compiling \fIfoo.c\fR with \fB\-c \-save\-temps\fR would produce files
+\&\fIfoo.i\fR and \fIfoo.s\fR, as well as \fIfoo.o\fR. This creates a
+preprocessed \fIfoo.i\fR output file even though the compiler now
+normally uses an integrated preprocessor.
+.Sp
+When used in combination with the \fB\-x\fR command line option,
+\&\fB\-save\-temps\fR is sensible enough to avoid over writing an
+input source file with the same extension as an intermediate file.
+The corresponding intermediate file may be obtained by renaming the
+source file before using \fB\-save\-temps\fR.
+.IP "\fB\-time\fR" 4
+.IX Item "-time"
+Report the \s-1CPU\s0 time taken by each subprocess in the compilation
+sequence. For C source files, this is the compiler proper and assembler
+(plus the linker if linking is done). The output looks like this:
+.Sp
+.Vb 2
+\& # cc1 0.12 0.01
+\& # as 0.00 0.01
+.Ve
+.Sp
+The first number on each line is the \*(L"user time\*(R", that is time spent
+executing the program itself. The second number is \*(L"system time\*(R",
+time spent executing operating system routines on behalf of the program.
+Both numbers are in seconds.
+.IP "\fB\-fvar\-tracking\fR" 4
+.IX Item "-fvar-tracking"
+Run variable tracking pass. It computes where variables are stored at each
+position in code. Better debugging information is then generated
+(if the debugging information format supports this information).
+.Sp
+It is enabled by default when compiling with optimization (\fB\-Os\fR,
+\&\fB\-O\fR, \fB\-O2\fR, ...), debugging information (\fB\-g\fR) and
+the debug info format supports it.
+.IP "\fB\-print\-file\-name=\fR\fIlibrary\fR" 4
+.IX Item "-print-file-name=library"
+Print the full absolute name of the library file \fIlibrary\fR that
+would be used when linking\-\-\-and don't do anything else. With this
+option, \s-1GCC\s0 does not compile or link anything; it just prints the
+file name.
+.IP "\fB\-print\-multi\-directory\fR" 4
+.IX Item "-print-multi-directory"
+Print the directory name corresponding to the multilib selected by any
+other switches present in the command line. This directory is supposed
+to exist in \fB\s-1GCC_EXEC_PREFIX\s0\fR.
+.IP "\fB\-print\-multi\-lib\fR" 4
+.IX Item "-print-multi-lib"
+Print the mapping from multilib directory names to compiler switches
+that enable them. The directory name is separated from the switches by
+\&\fB;\fR, and each switch starts with an \fB@} instead of the
+\&\f(CB@samp\fB{\-\fR, without spaces between multiple switches. This is supposed to
+ease shell-processing.
+.IP "\fB\-print\-prog\-name=\fR\fIprogram\fR" 4
+.IX Item "-print-prog-name=program"
+Like \fB\-print\-file\-name\fR, but searches for a program such as \fBcpp\fR.
+.IP "\fB\-print\-libgcc\-file\-name\fR" 4
+.IX Item "-print-libgcc-file-name"
+Same as \fB\-print\-file\-name=libgcc.a\fR.
+.Sp
+This is useful when you use \fB\-nostdlib\fR or \fB\-nodefaultlibs\fR
+but you do want to link with \fIlibgcc.a\fR. You can do
+.Sp
+.Vb 1
+\& gcc \-nostdlib <files>... \`gcc \-print\-libgcc\-file\-name\`
+.Ve
+.IP "\fB\-print\-search\-dirs\fR" 4
+.IX Item "-print-search-dirs"
+Print the name of the configured installation directory and a list of
+program and library directories \fBgcc\fR will search\-\-\-and don't do anything else.
+.Sp
+This is useful when \fBgcc\fR prints the error message
+\&\fBinstallation problem, cannot exec cpp0: No such file or directory\fR.
+To resolve this you either need to put \fIcpp0\fR and the other compiler
+components where \fBgcc\fR expects to find them, or you can set the environment
+variable \fB\s-1GCC_EXEC_PREFIX\s0\fR to the directory where you installed them.
+Don't forget the trailing \fB/\fR.
+.IP "\fB\-print\-sysroot\fR" 4
+.IX Item "-print-sysroot"
+Print the target sysroot directory that will be used during
+compilation. This is the target sysroot specified either at configure
+time or using the \fB\-\-sysroot\fR option, possibly with an extra
+suffix that depends on compilation options. If no target sysroot is
+specified, the option prints nothing.
+.IP "\fB\-print\-sysroot\-headers\-suffix\fR" 4
+.IX Item "-print-sysroot-headers-suffix"
+Print the suffix added to the target sysroot when searching for
+headers, or give an error if the compiler is not configured with such
+a suffix\-\-\-and don't do anything else.
+.IP "\fB\-dumpmachine\fR" 4
+.IX Item "-dumpmachine"
+Print the compiler's target machine (for example,
+\&\fBi686\-pc\-linux\-gnu\fR)\-\-\-and don't do anything else.
+.IP "\fB\-dumpversion\fR" 4
+.IX Item "-dumpversion"
+Print the compiler version (for example, \fB3.0\fR)\-\-\-and don't do
+anything else.
+.IP "\fB\-dumpspecs\fR" 4
+.IX Item "-dumpspecs"
+Print the compiler's built-in specs\-\-\-and don't do anything else. (This
+is used when \s-1GCC\s0 itself is being built.)
+.IP "\fB\-feliminate\-unused\-debug\-types\fR" 4
+.IX Item "-feliminate-unused-debug-types"
+Normally, when producing \s-1DWARF2\s0 output, \s-1GCC\s0 will emit debugging
+information for all types declared in a compilation
+unit, regardless of whether or not they are actually used
+in that compilation unit. Sometimes this is useful, such as
+if, in the debugger, you want to cast a value to a type that is
+not actually used in your program (but is declared). More often,
+however, this results in a significant amount of wasted space.
+With this option, \s-1GCC\s0 will avoid producing debug symbol output
+for types that are nowhere used in the source file being compiled.
+.Sh "Options That Control Optimization"
+.IX Subsection "Options That Control Optimization"
+These options control various sorts of optimizations.
+.PP
+Without any optimization option, the compiler's goal is to reduce the
+cost of compilation and to make debugging produce the expected
+results. Statements are independent: if you stop the program with a
+breakpoint between statements, you can then assign a new value to any
+variable or change the program counter to any other statement in the
+function and get exactly the results you would expect from the source
+code.
+.PP
+Turning on optimization flags makes the compiler attempt to improve
+the performance and/or code size at the expense of compilation time
+and possibly the ability to debug the program.
+.PP
+The compiler performs optimization based on the knowledge it has of the
+program. Compiling multiple files at once to a single output file mode allows
+the compiler to use information gained from all of the files when compiling
+each of them.
+.PP
+Not all optimizations are controlled directly by a flag. Only
+optimizations that have a flag are listed.
+.IP "\fB\-O\fR" 4
+.IX Item "-O"
+.PD 0
+.IP "\fB\-O1\fR" 4
+.IX Item "-O1"
+.PD
+Optimize. Optimizing compilation takes somewhat more time, and a lot
+more memory for a large function.
+.Sp
+With \fB\-O\fR, the compiler tries to reduce code size and execution
+time, without performing any optimizations that take a great deal of
+compilation time.
+.Sp
+\&\fB\-O\fR turns on the following optimization flags:
+.Sp
+\&\fB\-fauto\-inc\-dec
+\&\-fcprop\-registers
+\&\-fdce
+\&\-fdefer\-pop
+\&\-fdelayed\-branch
+\&\-fdse
+\&\-fguess\-branch\-probability
+\&\-fif\-conversion2
+\&\-fif\-conversion
+\&\-finline\-small\-functions
+\&\-fipa\-pure\-const
+\&\-fipa\-reference
+\&\-fmerge\-constants
+\&\-fsplit\-wide\-types
+\&\-ftree\-builtin\-call\-dce
+\&\-ftree\-ccp
+\&\-ftree\-ch
+\&\-ftree\-copyrename
+\&\-ftree\-dce
+\&\-ftree\-dominator\-opts
+\&\-ftree\-dse
+\&\-ftree\-fre
+\&\-ftree\-sra
+\&\-ftree\-ter
+\&\-funit\-at\-a\-time\fR
+.Sp
+\&\fB\-O\fR also turns on \fB\-fomit\-frame\-pointer\fR on machines
+where doing so does not interfere with debugging.
+.IP "\fB\-O2\fR" 4
+.IX Item "-O2"
+Optimize even more. \s-1GCC\s0 performs nearly all supported optimizations
+that do not involve a space-speed tradeoff.
+As compared to \fB\-O\fR, this option increases both compilation time
+and the performance of the generated code.
+.Sp
+\&\fB\-O2\fR turns on all optimization flags specified by \fB\-O\fR. It
+also turns on the following optimization flags:
+\&\fB\-fthread\-jumps
+\&\-falign\-functions \-falign\-jumps
+\&\-falign\-loops \-falign\-labels
+\&\-fcaller\-saves
+\&\-fcrossjumping
+\&\-fcse\-follow\-jumps \-fcse\-skip\-blocks
+\&\-fdelete\-null\-pointer\-checks
+\&\-fexpensive\-optimizations
+\&\-fgcse \-fgcse\-lm
+\&\-findirect\-inlining
+\&\-foptimize\-sibling\-calls
+\&\-fpeephole2
+\&\-fregmove
+\&\-freorder\-blocks \-freorder\-functions
+\&\-frerun\-cse\-after\-loop
+\&\-fsched\-interblock \-fsched\-spec
+\&\-fschedule\-insns \-fschedule\-insns2
+\&\-fstrict\-aliasing \-fstrict\-overflow
+\&\-ftree\-switch\-conversion
+\&\-ftree\-pre
+\&\-ftree\-vrp\fR
+.Sp
+Please note the warning under \fB\-fgcse\fR about
+invoking \fB\-O2\fR on programs that use computed gotos.
+.IP "\fB\-O3\fR" 4
+.IX Item "-O3"
+Optimize yet more. \fB\-O3\fR turns on all optimizations specified
+by \fB\-O2\fR and also turns on the \fB\-finline\-functions\fR,
+\&\fB\-funswitch\-loops\fR, \fB\-fpredictive\-commoning\fR,
+\&\fB\-fgcse\-after\-reload\fR and \fB\-ftree\-vectorize\fR options.
+.IP "\fB\-O0\fR" 4
+.IX Item "-O0"
+Reduce compilation time and make debugging produce the expected
+results. This is the default.
+.IP "\fB\-Os\fR" 4
+.IX Item "-Os"
+Optimize for size. \fB\-Os\fR enables all \fB\-O2\fR optimizations that
+do not typically increase code size. It also performs further
+optimizations designed to reduce code size.
+.Sp
+\&\fB\-Os\fR disables the following optimization flags:
+\&\fB\-falign\-functions \-falign\-jumps \-falign\-loops
+\&\-falign\-labels \-freorder\-blocks \-freorder\-blocks\-and\-partition
+\&\-fprefetch\-loop\-arrays \-ftree\-vect\-loop\-version\fR
+.Sp
+If you use multiple \fB\-O\fR options, with or without level numbers,
+the last such option is the one that is effective.
+.PP
+Options of the form \fB\-f\fR\fIflag\fR specify machine-independent
+flags. Most flags have both positive and negative forms; the negative
+form of \fB\-ffoo\fR would be \fB\-fno\-foo\fR. In the table
+below, only one of the forms is listed\-\-\-the one you typically will
+use. You can figure out the other form by either removing \fBno\-\fR
+or adding it.
+.PP
+The following options control specific optimizations. They are either
+activated by \fB\-O\fR options or are related to ones that are. You
+can use the following flags in the rare cases when \*(L"fine-tuning\*(R" of
+optimizations to be performed is desired.
+.IP "\fB\-fno\-default\-inline\fR" 4
+.IX Item "-fno-default-inline"
+Do not make member functions inline by default merely because they are
+defined inside the class scope (\*(C+ only). Otherwise, when you specify
+\&\fB\-O\fR, member functions defined inside class scope are compiled
+inline by default; i.e., you don't need to add \fBinline\fR in front of
+the member function name.
+.IP "\fB\-fno\-defer\-pop\fR" 4
+.IX Item "-fno-defer-pop"
+Always pop the arguments to each function call as soon as that function
+returns. For machines which must pop arguments after a function call,
+the compiler normally lets arguments accumulate on the stack for several
+function calls and pops them all at once.
+.Sp
+Disabled at levels \fB\-O\fR, \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fforward\-propagate\fR" 4
+.IX Item "-fforward-propagate"
+Perform a forward propagation pass on \s-1RTL\s0. The pass tries to combine two
+instructions and checks if the result can be simplified. If loop unrolling
+is active, two passes are performed and the second is scheduled after
+loop unrolling.
+.Sp
+This option is enabled by default at optimization levels \fB\-O2\fR,
+\&\fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fomit\-frame\-pointer\fR" 4
+.IX Item "-fomit-frame-pointer"
+Don't keep the frame pointer in a register for functions that
+don't need one. This avoids the instructions to save, set up and
+restore frame pointers; it also makes an extra register available
+in many functions. \fBIt also makes debugging impossible on
+some machines.\fR
+.Sp
+On some machines, such as the \s-1VAX\s0, this flag has no effect, because
+the standard calling sequence automatically handles the frame pointer
+and nothing is saved by pretending it doesn't exist. The
+machine-description macro \f(CW\*(C`FRAME_POINTER_REQUIRED\*(C'\fR controls
+whether a target machine supports this flag.
+.Sp
+Enabled at levels \fB\-O\fR, \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-foptimize\-sibling\-calls\fR" 4
+.IX Item "-foptimize-sibling-calls"
+Optimize sibling and tail recursive calls.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fno\-inline\fR" 4
+.IX Item "-fno-inline"
+Don't pay attention to the \f(CW\*(C`inline\*(C'\fR keyword. Normally this option
+is used to keep the compiler from expanding any functions inline.
+Note that if you are not optimizing, no functions can be expanded inline.
+.IP "\fB\-finline\-small\-functions\fR" 4
+.IX Item "-finline-small-functions"
+Integrate functions into their callers when their body is smaller than expected
+function call code (so overall size of program gets smaller). The compiler
+heuristically decides which functions are simple enough to be worth integrating
+in this way.
+.Sp
+Enabled at level \fB\-O2\fR.
+.IP "\fB\-findirect\-inlining\fR" 4
+.IX Item "-findirect-inlining"
+Inline also indirect calls that are discovered to be known at compile
+time thanks to previous inlining. This option has any effect only
+when inlining itself is turned on by the \fB\-finline\-functions\fR
+or \fB\-finline\-small\-functions\fR options.
+.Sp
+Enabled at level \fB\-O2\fR.
+.IP "\fB\-finline\-functions\fR" 4
+.IX Item "-finline-functions"
+Integrate all simple functions into their callers. The compiler
+heuristically decides which functions are simple enough to be worth
+integrating in this way.
+.Sp
+If all calls to a given function are integrated, and the function is
+declared \f(CW\*(C`static\*(C'\fR, then the function is normally not output as
+assembler code in its own right.
+.Sp
+Enabled at level \fB\-O3\fR.
+.IP "\fB\-finline\-functions\-called\-once\fR" 4
+.IX Item "-finline-functions-called-once"
+Consider all \f(CW\*(C`static\*(C'\fR functions called once for inlining into their
+caller even if they are not marked \f(CW\*(C`inline\*(C'\fR. If a call to a given
+function is integrated, then the function is not output as assembler code
+in its own right.
+.Sp
+Enabled at levels \fB\-O1\fR, \fB\-O2\fR, \fB\-O3\fR and \fB\-Os\fR.
+.IP "\fB\-fearly\-inlining\fR" 4
+.IX Item "-fearly-inlining"
+Inline functions marked by \f(CW\*(C`always_inline\*(C'\fR and functions whose body seems
+smaller than the function call overhead early before doing
+\&\fB\-fprofile\-generate\fR instrumentation and real inlining pass. Doing so
+makes profiling significantly cheaper and usually inlining faster on programs
+having large chains of nested wrapper functions.
+.Sp
+Enabled by default.
+.IP "\fB\-finline\-limit=\fR\fIn\fR" 4
+.IX Item "-finline-limit=n"
+By default, \s-1GCC\s0 limits the size of functions that can be inlined. This flag
+allows coarse control of this limit. \fIn\fR is the size of functions that
+can be inlined in number of pseudo instructions.
+.Sp
+Inlining is actually controlled by a number of parameters, which may be
+specified individually by using \fB\-\-param\fR \fIname\fR\fB=\fR\fIvalue\fR.
+The \fB\-finline\-limit=\fR\fIn\fR option sets some of these parameters
+as follows:
+.RS 4
+.IP "\fBmax-inline-insns-single\fR" 4
+.IX Item "max-inline-insns-single"
+is set to \fIn\fR/2.
+.IP "\fBmax-inline-insns-auto\fR" 4
+.IX Item "max-inline-insns-auto"
+is set to \fIn\fR/2.
+.RE
+.RS 4
+.Sp
+See below for a documentation of the individual
+parameters controlling inlining and for the defaults of these parameters.
+.Sp
+\&\fINote:\fR there may be no value to \fB\-finline\-limit\fR that results
+in default behavior.
+.Sp
+\&\fINote:\fR pseudo instruction represents, in this particular context, an
+abstract measurement of function's size. In no way does it represent a count
+of assembly instructions and as such its exact meaning might change from one
+release to an another.
+.RE
+.IP "\fB\-fkeep\-inline\-functions\fR" 4
+.IX Item "-fkeep-inline-functions"
+In C, emit \f(CW\*(C`static\*(C'\fR functions that are declared \f(CW\*(C`inline\*(C'\fR
+into the object file, even if the function has been inlined into all
+of its callers. This switch does not affect functions using the
+\&\f(CW\*(C`extern inline\*(C'\fR extension in \s-1GNU\s0 C89. In \*(C+, emit any and all
+inline functions into the object file.
+.IP "\fB\-fkeep\-static\-consts\fR" 4
+.IX Item "-fkeep-static-consts"
+Emit variables declared \f(CW\*(C`static const\*(C'\fR when optimization isn't turned
+on, even if the variables aren't referenced.
+.Sp
+\&\s-1GCC\s0 enables this option by default. If you want to force the compiler to
+check if the variable was referenced, regardless of whether or not
+optimization is turned on, use the \fB\-fno\-keep\-static\-consts\fR option.
+.IP "\fB\-fmerge\-constants\fR" 4
+.IX Item "-fmerge-constants"
+Attempt to merge identical constants (string constants and floating point
+constants) across compilation units.
+.Sp
+This option is the default for optimized compilation if the assembler and
+linker support it. Use \fB\-fno\-merge\-constants\fR to inhibit this
+behavior.
+.Sp
+Enabled at levels \fB\-O\fR, \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fmerge\-all\-constants\fR" 4
+.IX Item "-fmerge-all-constants"
+Attempt to merge identical constants and identical variables.
+.Sp
+This option implies \fB\-fmerge\-constants\fR. In addition to
+\&\fB\-fmerge\-constants\fR this considers e.g. even constant initialized
+arrays or initialized constant variables with integral or floating point
+types. Languages like C or \*(C+ require each variable, including multiple
+instances of the same variable in recursive calls, to have distinct locations,
+so using this option will result in non-conforming
+behavior.
+.IP "\fB\-fmodulo\-sched\fR" 4
+.IX Item "-fmodulo-sched"
+Perform swing modulo scheduling immediately before the first scheduling
+pass. This pass looks at innermost loops and reorders their
+instructions by overlapping different iterations.
+.IP "\fB\-fmodulo\-sched\-allow\-regmoves\fR" 4
+.IX Item "-fmodulo-sched-allow-regmoves"
+Perform more aggressive \s-1SMS\s0 based modulo scheduling with register moves
+allowed. By setting this flag certain anti-dependences edges will be
+deleted which will trigger the generation of reg-moves based on the
+life-range analysis. This option is effective only with
+\&\fB\-fmodulo\-sched\fR enabled.
+.IP "\fB\-fno\-branch\-count\-reg\fR" 4
+.IX Item "-fno-branch-count-reg"
+Do not use \*(L"decrement and branch\*(R" instructions on a count register,
+but instead generate a sequence of instructions that decrement a
+register, compare it against zero, then branch based upon the result.
+This option is only meaningful on architectures that support such
+instructions, which include x86, PowerPC, \s-1IA\-64\s0 and S/390.
+.Sp
+The default is \fB\-fbranch\-count\-reg\fR.
+.IP "\fB\-fno\-function\-cse\fR" 4
+.IX Item "-fno-function-cse"
+Do not put function addresses in registers; make each instruction that
+calls a constant function contain the function's address explicitly.
+.Sp
+This option results in less efficient code, but some strange hacks
+that alter the assembler output may be confused by the optimizations
+performed when this option is not used.
+.Sp
+The default is \fB\-ffunction\-cse\fR
+.IP "\fB\-fno\-zero\-initialized\-in\-bss\fR" 4
+.IX Item "-fno-zero-initialized-in-bss"
+If the target supports a \s-1BSS\s0 section, \s-1GCC\s0 by default puts variables that
+are initialized to zero into \s-1BSS\s0. This can save space in the resulting
+code.
+.Sp
+This option turns off this behavior because some programs explicitly
+rely on variables going to the data section. E.g., so that the
+resulting executable can find the beginning of that section and/or make
+assumptions based on that.
+.Sp
+The default is \fB\-fzero\-initialized\-in\-bss\fR.
+.IP "\fB\-fmudflap \-fmudflapth \-fmudflapir\fR" 4
+.IX Item "-fmudflap -fmudflapth -fmudflapir"
+For front-ends that support it (C and \*(C+), instrument all risky
+pointer/array dereferencing operations, some standard library
+string/heap functions, and some other associated constructs with
+range/validity tests. Modules so instrumented should be immune to
+buffer overflows, invalid heap use, and some other classes of C/\*(C+
+programming errors. The instrumentation relies on a separate runtime
+library (\fIlibmudflap\fR), which will be linked into a program if
+\&\fB\-fmudflap\fR is given at link time. Run-time behavior of the
+instrumented program is controlled by the \fB\s-1MUDFLAP_OPTIONS\s0\fR
+environment variable. See \f(CW\*(C`env MUDFLAP_OPTIONS=\-help a.out\*(C'\fR
+for its options.
+.Sp
+Use \fB\-fmudflapth\fR instead of \fB\-fmudflap\fR to compile and to
+link if your program is multi-threaded. Use \fB\-fmudflapir\fR, in
+addition to \fB\-fmudflap\fR or \fB\-fmudflapth\fR, if
+instrumentation should ignore pointer reads. This produces less
+instrumentation (and therefore faster execution) and still provides
+some protection against outright memory corrupting writes, but allows
+erroneously read data to propagate within a program.
+.IP "\fB\-fthread\-jumps\fR" 4
+.IX Item "-fthread-jumps"
+Perform optimizations where we check to see if a jump branches to a
+location where another comparison subsumed by the first is found. If
+so, the first branch is redirected to either the destination of the
+second branch or a point immediately following it, depending on whether
+the condition is known to be true or false.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fsplit\-wide\-types\fR" 4
+.IX Item "-fsplit-wide-types"
+When using a type that occupies multiple registers, such as \f(CW\*(C`long
+long\*(C'\fR on a 32\-bit system, split the registers apart and allocate them
+independently. This normally generates better code for those types,
+but may make debugging more difficult.
+.Sp
+Enabled at levels \fB\-O\fR, \fB\-O2\fR, \fB\-O3\fR,
+\&\fB\-Os\fR.
+.IP "\fB\-fcse\-follow\-jumps\fR" 4
+.IX Item "-fcse-follow-jumps"
+In common subexpression elimination (\s-1CSE\s0), scan through jump instructions
+when the target of the jump is not reached by any other path. For
+example, when \s-1CSE\s0 encounters an \f(CW\*(C`if\*(C'\fR statement with an
+\&\f(CW\*(C`else\*(C'\fR clause, \s-1CSE\s0 will follow the jump when the condition
+tested is false.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fcse\-skip\-blocks\fR" 4
+.IX Item "-fcse-skip-blocks"
+This is similar to \fB\-fcse\-follow\-jumps\fR, but causes \s-1CSE\s0 to
+follow jumps which conditionally skip over blocks. When \s-1CSE\s0
+encounters a simple \f(CW\*(C`if\*(C'\fR statement with no else clause,
+\&\fB\-fcse\-skip\-blocks\fR causes \s-1CSE\s0 to follow the jump around the
+body of the \f(CW\*(C`if\*(C'\fR.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-frerun\-cse\-after\-loop\fR" 4
+.IX Item "-frerun-cse-after-loop"
+Re-run common subexpression elimination after loop optimizations has been
+performed.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fgcse\fR" 4
+.IX Item "-fgcse"
+Perform a global common subexpression elimination pass.
+This pass also performs global constant and copy propagation.
+.Sp
+\&\fINote:\fR When compiling a program using computed gotos, a \s-1GCC\s0
+extension, you may get better runtime performance if you disable
+the global common subexpression elimination pass by adding
+\&\fB\-fno\-gcse\fR to the command line.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fgcse\-lm\fR" 4
+.IX Item "-fgcse-lm"
+When \fB\-fgcse\-lm\fR is enabled, global common subexpression elimination will
+attempt to move loads which are only killed by stores into themselves. This
+allows a loop containing a load/store sequence to be changed to a load outside
+the loop, and a copy/store within the loop.
+.Sp
+Enabled by default when gcse is enabled.
+.IP "\fB\-fgcse\-sm\fR" 4
+.IX Item "-fgcse-sm"
+When \fB\-fgcse\-sm\fR is enabled, a store motion pass is run after
+global common subexpression elimination. This pass will attempt to move
+stores out of loops. When used in conjunction with \fB\-fgcse\-lm\fR,
+loops containing a load/store sequence can be changed to a load before
+the loop and a store after the loop.
+.Sp
+Not enabled at any optimization level.
+.IP "\fB\-fgcse\-las\fR" 4
+.IX Item "-fgcse-las"
+When \fB\-fgcse\-las\fR is enabled, the global common subexpression
+elimination pass eliminates redundant loads that come after stores to the
+same memory location (both partial and full redundancies).
+.Sp
+Not enabled at any optimization level.
+.IP "\fB\-fgcse\-after\-reload\fR" 4
+.IX Item "-fgcse-after-reload"
+When \fB\-fgcse\-after\-reload\fR is enabled, a redundant load elimination
+pass is performed after reload. The purpose of this pass is to cleanup
+redundant spilling.
+.IP "\fB\-funsafe\-loop\-optimizations\fR" 4
+.IX Item "-funsafe-loop-optimizations"
+If given, the loop optimizer will assume that loop indices do not
+overflow, and that the loops with nontrivial exit condition are not
+infinite. This enables a wider range of loop optimizations even if
+the loop optimizer itself cannot prove that these assumptions are valid.
+Using \fB\-Wunsafe\-loop\-optimizations\fR, the compiler will warn you
+if it finds this kind of loop.
+.IP "\fB\-fcrossjumping\fR" 4
+.IX Item "-fcrossjumping"
+Perform cross-jumping transformation. This transformation unifies equivalent code and save code size. The
+resulting code may or may not perform better than without cross-jumping.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fauto\-inc\-dec\fR" 4
+.IX Item "-fauto-inc-dec"
+Combine increments or decrements of addresses with memory accesses.
+This pass is always skipped on architectures that do not have
+instructions to support this. Enabled by default at \fB\-O\fR and
+higher on architectures that support this.
+.IP "\fB\-fdce\fR" 4
+.IX Item "-fdce"
+Perform dead code elimination (\s-1DCE\s0) on \s-1RTL\s0.
+Enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-fdse\fR" 4
+.IX Item "-fdse"
+Perform dead store elimination (\s-1DSE\s0) on \s-1RTL\s0.
+Enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-fif\-conversion\fR" 4
+.IX Item "-fif-conversion"
+Attempt to transform conditional jumps into branch-less equivalents. This
+include use of conditional moves, min, max, set flags and abs instructions, and
+some tricks doable by standard arithmetics. The use of conditional execution
+on chips where it is available is controlled by \f(CW\*(C`if\-conversion2\*(C'\fR.
+.Sp
+Enabled at levels \fB\-O\fR, \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fif\-conversion2\fR" 4
+.IX Item "-fif-conversion2"
+Use conditional execution (where available) to transform conditional jumps into
+branch-less equivalents.
+.Sp
+Enabled at levels \fB\-O\fR, \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fdelete\-null\-pointer\-checks\fR" 4
+.IX Item "-fdelete-null-pointer-checks"
+Use global dataflow analysis to identify and eliminate useless checks
+for null pointers. The compiler assumes that dereferencing a null
+pointer would have halted the program. If a pointer is checked after
+it has already been dereferenced, it cannot be null.
+.Sp
+In some environments, this assumption is not true, and programs can
+safely dereference null pointers. Use
+\&\fB\-fno\-delete\-null\-pointer\-checks\fR to disable this optimization
+for programs which depend on that behavior.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fexpensive\-optimizations\fR" 4
+.IX Item "-fexpensive-optimizations"
+Perform a number of minor optimizations that are relatively expensive.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-foptimize\-register\-move\fR" 4
+.IX Item "-foptimize-register-move"
+.PD 0
+.IP "\fB\-fregmove\fR" 4
+.IX Item "-fregmove"
+.PD
+Attempt to reassign register numbers in move instructions and as
+operands of other simple instructions in order to maximize the amount of
+register tying. This is especially helpful on machines with two-operand
+instructions.
+.Sp
+Note \fB\-fregmove\fR and \fB\-foptimize\-register\-move\fR are the same
+optimization.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fira\-algorithm=\fR\fIalgorithm\fR" 4
+.IX Item "-fira-algorithm=algorithm"
+Use specified coloring algorithm for the integrated register
+allocator. The \fIalgorithm\fR argument should be \f(CW\*(C`priority\*(C'\fR or
+\&\f(CW\*(C`CB\*(C'\fR. The first algorithm specifies Chow's priority coloring,
+the second one specifies Chaitin-Briggs coloring. The second
+algorithm can be unimplemented for some architectures. If it is
+implemented, it is the default because Chaitin-Briggs coloring as a
+rule generates a better code.
+.IP "\fB\-fira\-region=\fR\fIregion\fR" 4
+.IX Item "-fira-region=region"
+Use specified regions for the integrated register allocator. The
+\&\fIregion\fR argument should be one of \f(CW\*(C`all\*(C'\fR, \f(CW\*(C`mixed\*(C'\fR, or
+\&\f(CW\*(C`one\*(C'\fR. The first value means using all loops as register
+allocation regions, the second value which is the default means using
+all loops except for loops with small register pressure as the
+regions, and third one means using all function as a single region.
+The first value can give best result for machines with small size and
+irregular register set, the third one results in faster and generates
+decent code and the smallest size code, and the default value usually
+give the best results in most cases and for most architectures.
+.IP "\fB\-fira\-coalesce\fR" 4
+.IX Item "-fira-coalesce"
+Do optimistic register coalescing. This option might be profitable for
+architectures with big regular register files.
+.IP "\fB\-fno\-ira\-share\-save\-slots\fR" 4
+.IX Item "-fno-ira-share-save-slots"
+Switch off sharing stack slots used for saving call used hard
+registers living through a call. Each hard register will get a
+separate stack slot and as a result function stack frame will be
+bigger.
+.IP "\fB\-fno\-ira\-share\-spill\-slots\fR" 4
+.IX Item "-fno-ira-share-spill-slots"
+Switch off sharing stack slots allocated for pseudo-registers. Each
+pseudo-register which did not get a hard register will get a separate
+stack slot and as a result function stack frame will be bigger.
+.IP "\fB\-fira\-verbose=\fR\fIn\fR" 4
+.IX Item "-fira-verbose=n"
+Set up how verbose dump file for the integrated register allocator
+will be. Default value is 5. If the value is greater or equal to 10,
+the dump file will be stderr as if the value were \fIn\fR minus 10.
+.IP "\fB\-fdelayed\-branch\fR" 4
+.IX Item "-fdelayed-branch"
+If supported for the target machine, attempt to reorder instructions
+to exploit instruction slots available after delayed branch
+instructions.
+.Sp
+Enabled at levels \fB\-O\fR, \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fschedule\-insns\fR" 4
+.IX Item "-fschedule-insns"
+If supported for the target machine, attempt to reorder instructions to
+eliminate execution stalls due to required data being unavailable. This
+helps machines that have slow floating point or memory load instructions
+by allowing other instructions to be issued until the result of the load
+or floating point instruction is required.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fschedule\-insns2\fR" 4
+.IX Item "-fschedule-insns2"
+Similar to \fB\-fschedule\-insns\fR, but requests an additional pass of
+instruction scheduling after register allocation has been done. This is
+especially useful on machines with a relatively small number of
+registers and where memory load instructions take more than one cycle.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fno\-sched\-interblock\fR" 4
+.IX Item "-fno-sched-interblock"
+Don't schedule instructions across basic blocks. This is normally
+enabled by default when scheduling before register allocation, i.e.
+with \fB\-fschedule\-insns\fR or at \fB\-O2\fR or higher.
+.IP "\fB\-fno\-sched\-spec\fR" 4
+.IX Item "-fno-sched-spec"
+Don't allow speculative motion of non-load instructions. This is normally
+enabled by default when scheduling before register allocation, i.e.
+with \fB\-fschedule\-insns\fR or at \fB\-O2\fR or higher.
+.IP "\fB\-fsched\-spec\-load\fR" 4
+.IX Item "-fsched-spec-load"
+Allow speculative motion of some load instructions. This only makes
+sense when scheduling before register allocation, i.e. with
+\&\fB\-fschedule\-insns\fR or at \fB\-O2\fR or higher.
+.IP "\fB\-fsched\-spec\-load\-dangerous\fR" 4
+.IX Item "-fsched-spec-load-dangerous"
+Allow speculative motion of more load instructions. This only makes
+sense when scheduling before register allocation, i.e. with
+\&\fB\-fschedule\-insns\fR or at \fB\-O2\fR or higher.
+.IP "\fB\-fsched\-stalled\-insns\fR" 4
+.IX Item "-fsched-stalled-insns"
+.PD 0
+.IP "\fB\-fsched\-stalled\-insns=\fR\fIn\fR" 4
+.IX Item "-fsched-stalled-insns=n"
+.PD
+Define how many insns (if any) can be moved prematurely from the queue
+of stalled insns into the ready list, during the second scheduling pass.
+\&\fB\-fno\-sched\-stalled\-insns\fR means that no insns will be moved
+prematurely, \fB\-fsched\-stalled\-insns=0\fR means there is no limit
+on how many queued insns can be moved prematurely.
+\&\fB\-fsched\-stalled\-insns\fR without a value is equivalent to
+\&\fB\-fsched\-stalled\-insns=1\fR.
+.IP "\fB\-fsched\-stalled\-insns\-dep\fR" 4
+.IX Item "-fsched-stalled-insns-dep"
+.PD 0
+.IP "\fB\-fsched\-stalled\-insns\-dep=\fR\fIn\fR" 4
+.IX Item "-fsched-stalled-insns-dep=n"
+.PD
+Define how many insn groups (cycles) will be examined for a dependency
+on a stalled insn that is candidate for premature removal from the queue
+of stalled insns. This has an effect only during the second scheduling pass,
+and only if \fB\-fsched\-stalled\-insns\fR is used.
+\&\fB\-fno\-sched\-stalled\-insns\-dep\fR is equivalent to
+\&\fB\-fsched\-stalled\-insns\-dep=0\fR.
+\&\fB\-fsched\-stalled\-insns\-dep\fR without a value is equivalent to
+\&\fB\-fsched\-stalled\-insns\-dep=1\fR.
+.IP "\fB\-fsched2\-use\-superblocks\fR" 4
+.IX Item "-fsched2-use-superblocks"
+When scheduling after register allocation, do use superblock scheduling
+algorithm. Superblock scheduling allows motion across basic block boundaries
+resulting on faster schedules. This option is experimental, as not all machine
+descriptions used by \s-1GCC\s0 model the \s-1CPU\s0 closely enough to avoid unreliable
+results from the algorithm.
+.Sp
+This only makes sense when scheduling after register allocation, i.e. with
+\&\fB\-fschedule\-insns2\fR or at \fB\-O2\fR or higher.
+.IP "\fB\-fsched2\-use\-traces\fR" 4
+.IX Item "-fsched2-use-traces"
+Use \fB\-fsched2\-use\-superblocks\fR algorithm when scheduling after register
+allocation and additionally perform code duplication in order to increase the
+size of superblocks using tracer pass. See \fB\-ftracer\fR for details on
+trace formation.
+.Sp
+This mode should produce faster but significantly longer programs. Also
+without \fB\-fbranch\-probabilities\fR the traces constructed may not
+match the reality and hurt the performance. This only makes
+sense when scheduling after register allocation, i.e. with
+\&\fB\-fschedule\-insns2\fR or at \fB\-O2\fR or higher.
+.IP "\fB\-fsee\fR" 4
+.IX Item "-fsee"
+Eliminate redundant sign extension instructions and move the non-redundant
+ones to optimal placement using lazy code motion (\s-1LCM\s0).
+.IP "\fB\-freschedule\-modulo\-scheduled\-loops\fR" 4
+.IX Item "-freschedule-modulo-scheduled-loops"
+The modulo scheduling comes before the traditional scheduling, if a loop
+was modulo scheduled we may want to prevent the later scheduling passes
+from changing its schedule, we use this option to control that.
+.IP "\fB\-fselective\-scheduling\fR" 4
+.IX Item "-fselective-scheduling"
+Schedule instructions using selective scheduling algorithm. Selective
+scheduling runs instead of the first scheduler pass.
+.IP "\fB\-fselective\-scheduling2\fR" 4
+.IX Item "-fselective-scheduling2"
+Schedule instructions using selective scheduling algorithm. Selective
+scheduling runs instead of the second scheduler pass.
+.IP "\fB\-fsel\-sched\-pipelining\fR" 4
+.IX Item "-fsel-sched-pipelining"
+Enable software pipelining of innermost loops during selective scheduling.
+This option has no effect until one of \fB\-fselective\-scheduling\fR or
+\&\fB\-fselective\-scheduling2\fR is turned on.
+.IP "\fB\-fsel\-sched\-pipelining\-outer\-loops\fR" 4
+.IX Item "-fsel-sched-pipelining-outer-loops"
+When pipelining loops during selective scheduling, also pipeline outer loops.
+This option has no effect until \fB\-fsel\-sched\-pipelining\fR is turned on.
+.IP "\fB\-fcaller\-saves\fR" 4
+.IX Item "-fcaller-saves"
+Enable values to be allocated in registers that will be clobbered by
+function calls, by emitting extra instructions to save and restore the
+registers around such calls. Such allocation is done only when it
+seems to result in better code than would otherwise be produced.
+.Sp
+This option is always enabled by default on certain machines, usually
+those which have no call-preserved registers to use instead.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fconserve\-stack\fR" 4
+.IX Item "-fconserve-stack"
+Attempt to minimize stack usage. The compiler will attempt to use less
+stack space, even if that makes the program slower. This option
+implies setting the \fBlarge-stack-frame\fR parameter to 100
+and the \fBlarge-stack-frame-growth\fR parameter to 400.
+.IP "\fB\-ftree\-reassoc\fR" 4
+.IX Item "-ftree-reassoc"
+Perform reassociation on trees. This flag is enabled by default
+at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-pre\fR" 4
+.IX Item "-ftree-pre"
+Perform partial redundancy elimination (\s-1PRE\s0) on trees. This flag is
+enabled by default at \fB\-O2\fR and \fB\-O3\fR.
+.IP "\fB\-ftree\-fre\fR" 4
+.IX Item "-ftree-fre"
+Perform full redundancy elimination (\s-1FRE\s0) on trees. The difference
+between \s-1FRE\s0 and \s-1PRE\s0 is that \s-1FRE\s0 only considers expressions
+that are computed on all paths leading to the redundant computation.
+This analysis is faster than \s-1PRE\s0, though it exposes fewer redundancies.
+This flag is enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-copy\-prop\fR" 4
+.IX Item "-ftree-copy-prop"
+Perform copy propagation on trees. This pass eliminates unnecessary
+copy operations. This flag is enabled by default at \fB\-O\fR and
+higher.
+.IP "\fB\-fipa\-pure\-const\fR" 4
+.IX Item "-fipa-pure-const"
+Discover which functions are pure or constant.
+Enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-fipa\-reference\fR" 4
+.IX Item "-fipa-reference"
+Discover which static variables do not escape cannot escape the
+compilation unit.
+Enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-fipa\-struct\-reorg\fR" 4
+.IX Item "-fipa-struct-reorg"
+Perform structure reorganization optimization, that change C\-like structures
+layout in order to better utilize spatial locality. This transformation is
+affective for programs containing arrays of structures. Available in two
+compilation modes: profile-based (enabled with \fB\-fprofile\-generate\fR)
+or static (which uses built-in heuristics). Require \fB\-fipa\-type\-escape\fR
+to provide the safety of this transformation. It works only in whole program
+mode, so it requires \fB\-fwhole\-program\fR and \fB\-combine\fR to be
+enabled. Structures considered \fBcold\fR by this transformation are not
+affected (see \fB\-\-param struct\-reorg\-cold\-struct\-ratio=\fR\fIvalue\fR).
+.Sp
+With this flag, the program debug info reflects a new structure layout.
+.IP "\fB\-fipa\-pta\fR" 4
+.IX Item "-fipa-pta"
+Perform interprocedural pointer analysis. This option is experimental
+and does not affect generated code.
+.IP "\fB\-fipa\-cp\fR" 4
+.IX Item "-fipa-cp"
+Perform interprocedural constant propagation.
+This optimization analyzes the program to determine when values passed
+to functions are constants and then optimizes accordingly.
+This optimization can substantially increase performance
+if the application has constants passed to functions.
+This flag is enabled by default at \fB\-O2\fR, \fB\-Os\fR and \fB\-O3\fR.
+.IP "\fB\-fipa\-cp\-clone\fR" 4
+.IX Item "-fipa-cp-clone"
+Perform function cloning to make interprocedural constant propagation stronger.
+When enabled, interprocedural constant propagation will perform function cloning
+when externally visible function can be called with constant arguments.
+Because this optimization can create multiple copies of functions,
+it may significantly increase code size
+(see \fB\-\-param ipcp\-unit\-growth=\fR\fIvalue\fR).
+This flag is enabled by default at \fB\-O3\fR.
+.IP "\fB\-fipa\-matrix\-reorg\fR" 4
+.IX Item "-fipa-matrix-reorg"
+Perform matrix flattening and transposing.
+Matrix flattening tries to replace a m\-dimensional matrix
+with its equivalent n\-dimensional matrix, where n < m.
+This reduces the level of indirection needed for accessing the elements
+of the matrix. The second optimization is matrix transposing that
+attempts to change the order of the matrix's dimensions in order to
+improve cache locality.
+Both optimizations need the \fB\-fwhole\-program\fR flag.
+Transposing is enabled only if profiling information is available.
+.IP "\fB\-ftree\-sink\fR" 4
+.IX Item "-ftree-sink"
+Perform forward store motion on trees. This flag is
+enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-ccp\fR" 4
+.IX Item "-ftree-ccp"
+Perform sparse conditional constant propagation (\s-1CCP\s0) on trees. This
+pass only operates on local scalar variables and is enabled by default
+at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-switch\-conversion\fR" 4
+.IX Item "-ftree-switch-conversion"
+Perform conversion of simple initializations in a switch to
+initializations from a scalar array. This flag is enabled by default
+at \fB\-O2\fR and higher.
+.IP "\fB\-ftree\-dce\fR" 4
+.IX Item "-ftree-dce"
+Perform dead code elimination (\s-1DCE\s0) on trees. This flag is enabled by
+default at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-builtin\-call\-dce\fR" 4
+.IX Item "-ftree-builtin-call-dce"
+Perform conditional dead code elimination (\s-1DCE\s0) for calls to builtin functions
+that may set \f(CW\*(C`errno\*(C'\fR but are otherwise side-effect free. This flag is
+enabled by default at \fB\-O2\fR and higher if \fB\-Os\fR is not also
+specified.
+.IP "\fB\-ftree\-dominator\-opts\fR" 4
+.IX Item "-ftree-dominator-opts"
+Perform a variety of simple scalar cleanups (constant/copy
+propagation, redundancy elimination, range propagation and expression
+simplification) based on a dominator tree traversal. This also
+performs jump threading (to reduce jumps to jumps). This flag is
+enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-dse\fR" 4
+.IX Item "-ftree-dse"
+Perform dead store elimination (\s-1DSE\s0) on trees. A dead store is a store into
+a memory location which will later be overwritten by another store without
+any intervening loads. In this case the earlier store can be deleted. This
+flag is enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-ch\fR" 4
+.IX Item "-ftree-ch"
+Perform loop header copying on trees. This is beneficial since it increases
+effectiveness of code motion optimizations. It also saves one jump. This flag
+is enabled by default at \fB\-O\fR and higher. It is not enabled
+for \fB\-Os\fR, since it usually increases code size.
+.IP "\fB\-ftree\-loop\-optimize\fR" 4
+.IX Item "-ftree-loop-optimize"
+Perform loop optimizations on trees. This flag is enabled by default
+at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-loop\-linear\fR" 4
+.IX Item "-ftree-loop-linear"
+Perform linear loop transformations on tree. This flag can improve cache
+performance and allow further loop optimizations to take place.
+.IP "\fB\-floop\-interchange\fR" 4
+.IX Item "-floop-interchange"
+Perform loop interchange transformations on loops. Interchanging two
+nested loops switches the inner and outer loops. For example, given a
+loop like:
+.Sp
+.Vb 5
+\& DO J = 1, M
+\& DO I = 1, N
+\& A(J, I) = A(J, I) * C
+\& ENDDO
+\& ENDDO
+.Ve
+.Sp
+loop interchange will transform the loop as if the user had written:
+.Sp
+.Vb 5
+\& DO I = 1, N
+\& DO J = 1, M
+\& A(J, I) = A(J, I) * C
+\& ENDDO
+\& ENDDO
+.Ve
+.Sp
+which can be beneficial when \f(CW\*(C`N\*(C'\fR is larger than the caches,
+because in Fortran, the elements of an array are stored in memory
+contiguously by column, and the original loop iterates over rows,
+potentially creating at each access a cache miss. This optimization
+applies to all the languages supported by \s-1GCC\s0 and is not limited to
+Fortran. To use this code transformation, \s-1GCC\s0 has to be configured
+with \fB\-\-with\-ppl\fR and \fB\-\-with\-cloog\fR to enable the
+Graphite loop transformation infrastructure.
+.IP "\fB\-floop\-strip\-mine\fR" 4
+.IX Item "-floop-strip-mine"
+Perform loop strip mining transformations on loops. Strip mining
+splits a loop into two nested loops. The outer loop has strides
+equal to the strip size and the inner loop has strides of the
+original loop within a strip. For example, given a loop like:
+.Sp
+.Vb 3
+\& DO I = 1, N
+\& A(I) = A(I) + C
+\& ENDDO
+.Ve
+.Sp
+loop strip mining will transform the loop as if the user had written:
+.Sp
+.Vb 5
+\& DO II = 1, N, 4
+\& DO I = II, min (II + 3, N)
+\& A(I) = A(I) + C
+\& ENDDO
+\& ENDDO
+.Ve
+.Sp
+This optimization applies to all the languages supported by \s-1GCC\s0 and is
+not limited to Fortran. To use this code transformation, \s-1GCC\s0 has to
+be configured with \fB\-\-with\-ppl\fR and \fB\-\-with\-cloog\fR to
+enable the Graphite loop transformation infrastructure.
+.IP "\fB\-floop\-block\fR" 4
+.IX Item "-floop-block"
+Perform loop blocking transformations on loops. Blocking strip mines
+each loop in the loop nest such that the memory accesses of the
+element loops fit inside caches. For example, given a loop like:
+.Sp
+.Vb 5
+\& DO I = 1, N
+\& DO J = 1, M
+\& A(J, I) = B(I) + C(J)
+\& ENDDO
+\& ENDDO
+.Ve
+.Sp
+loop blocking will transform the loop as if the user had written:
+.Sp
+.Vb 9
+\& DO II = 1, N, 64
+\& DO JJ = 1, M, 64
+\& DO I = II, min (II + 63, N)
+\& DO J = JJ, min (JJ + 63, M)
+\& A(J, I) = B(I) + C(J)
+\& ENDDO
+\& ENDDO
+\& ENDDO
+\& ENDDO
+.Ve
+.Sp
+which can be beneficial when \f(CW\*(C`M\*(C'\fR is larger than the caches,
+because the innermost loop will iterate over a smaller amount of data
+that can be kept in the caches. This optimization applies to all the
+languages supported by \s-1GCC\s0 and is not limited to Fortran. To use this
+code transformation, \s-1GCC\s0 has to be configured with \fB\-\-with\-ppl\fR
+and \fB\-\-with\-cloog\fR to enable the Graphite loop transformation
+infrastructure.
+.IP "\fB\-fcheck\-data\-deps\fR" 4
+.IX Item "-fcheck-data-deps"
+Compare the results of several data dependence analyzers. This option
+is used for debugging the data dependence analyzers.
+.IP "\fB\-ftree\-loop\-distribution\fR" 4
+.IX Item "-ftree-loop-distribution"
+Perform loop distribution. This flag can improve cache performance on
+big loop bodies and allow further loop optimizations, like
+parallelization or vectorization, to take place. For example, the loop
+.Sp
+.Vb 4
+\& DO I = 1, N
+\& A(I) = B(I) + C
+\& D(I) = E(I) * F
+\& ENDDO
+.Ve
+.Sp
+is transformed to
+.Sp
+.Vb 6
+\& DO I = 1, N
+\& A(I) = B(I) + C
+\& ENDDO
+\& DO I = 1, N
+\& D(I) = E(I) * F
+\& ENDDO
+.Ve
+.IP "\fB\-ftree\-loop\-im\fR" 4
+.IX Item "-ftree-loop-im"
+Perform loop invariant motion on trees. This pass moves only invariants that
+would be hard to handle at \s-1RTL\s0 level (function calls, operations that expand to
+nontrivial sequences of insns). With \fB\-funswitch\-loops\fR it also moves
+operands of conditions that are invariant out of the loop, so that we can use
+just trivial invariantness analysis in loop unswitching. The pass also includes
+store motion.
+.IP "\fB\-ftree\-loop\-ivcanon\fR" 4
+.IX Item "-ftree-loop-ivcanon"
+Create a canonical counter for number of iterations in the loop for that
+determining number of iterations requires complicated analysis. Later
+optimizations then may determine the number easily. Useful especially
+in connection with unrolling.
+.IP "\fB\-fivopts\fR" 4
+.IX Item "-fivopts"
+Perform induction variable optimizations (strength reduction, induction
+variable merging and induction variable elimination) on trees.
+.IP "\fB\-ftree\-parallelize\-loops=n\fR" 4
+.IX Item "-ftree-parallelize-loops=n"
+Parallelize loops, i.e., split their iteration space to run in n threads.
+This is only possible for loops whose iterations are independent
+and can be arbitrarily reordered. The optimization is only
+profitable on multiprocessor machines, for loops that are CPU-intensive,
+rather than constrained e.g. by memory bandwidth. This option
+implies \fB\-pthread\fR, and thus is only supported on targets
+that have support for \fB\-pthread\fR.
+.IP "\fB\-ftree\-sra\fR" 4
+.IX Item "-ftree-sra"
+Perform scalar replacement of aggregates. This pass replaces structure
+references with scalars to prevent committing structures to memory too
+early. This flag is enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-copyrename\fR" 4
+.IX Item "-ftree-copyrename"
+Perform copy renaming on trees. This pass attempts to rename compiler
+temporaries to other variables at copy locations, usually resulting in
+variable names which more closely resemble the original variables. This flag
+is enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-ter\fR" 4
+.IX Item "-ftree-ter"
+Perform temporary expression replacement during the \s-1SSA\-\s0>normal phase. Single
+use/single def temporaries are replaced at their use location with their
+defining expression. This results in non-GIMPLE code, but gives the expanders
+much more complex trees to work on resulting in better \s-1RTL\s0 generation. This is
+enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-vectorize\fR" 4
+.IX Item "-ftree-vectorize"
+Perform loop vectorization on trees. This flag is enabled by default at
+\&\fB\-O3\fR.
+.IP "\fB\-ftree\-vect\-loop\-version\fR" 4
+.IX Item "-ftree-vect-loop-version"
+Perform loop versioning when doing loop vectorization on trees. When a loop
+appears to be vectorizable except that data alignment or data dependence cannot
+be determined at compile time then vectorized and non-vectorized versions of
+the loop are generated along with runtime checks for alignment or dependence
+to control which version is executed. This option is enabled by default
+except at level \fB\-Os\fR where it is disabled.
+.IP "\fB\-fvect\-cost\-model\fR" 4
+.IX Item "-fvect-cost-model"
+Enable cost model for vectorization.
+.IP "\fB\-ftree\-vrp\fR" 4
+.IX Item "-ftree-vrp"
+Perform Value Range Propagation on trees. This is similar to the
+constant propagation pass, but instead of values, ranges of values are
+propagated. This allows the optimizers to remove unnecessary range
+checks like array bound checks and null pointer checks. This is
+enabled by default at \fB\-O2\fR and higher. Null pointer check
+elimination is only done if \fB\-fdelete\-null\-pointer\-checks\fR is
+enabled.
+.IP "\fB\-ftracer\fR" 4
+.IX Item "-ftracer"
+Perform tail duplication to enlarge superblock size. This transformation
+simplifies the control flow of the function allowing other optimizations to do
+better job.
+.IP "\fB\-funroll\-loops\fR" 4
+.IX Item "-funroll-loops"
+Unroll loops whose number of iterations can be determined at compile
+time or upon entry to the loop. \fB\-funroll\-loops\fR implies
+\&\fB\-frerun\-cse\-after\-loop\fR. This option makes code larger,
+and may or may not make it run faster.
+.IP "\fB\-funroll\-all\-loops\fR" 4
+.IX Item "-funroll-all-loops"
+Unroll all loops, even if their number of iterations is uncertain when
+the loop is entered. This usually makes programs run more slowly.
+\&\fB\-funroll\-all\-loops\fR implies the same options as
+\&\fB\-funroll\-loops\fR,
+.IP "\fB\-fsplit\-ivs\-in\-unroller\fR" 4
+.IX Item "-fsplit-ivs-in-unroller"
+Enables expressing of values of induction variables in later iterations
+of the unrolled loop using the value in the first iteration. This breaks
+long dependency chains, thus improving efficiency of the scheduling passes.
+.Sp
+Combination of \fB\-fweb\fR and \s-1CSE\s0 is often sufficient to obtain the
+same effect. However in cases the loop body is more complicated than
+a single basic block, this is not reliable. It also does not work at all
+on some of the architectures due to restrictions in the \s-1CSE\s0 pass.
+.Sp
+This optimization is enabled by default.
+.IP "\fB\-fvariable\-expansion\-in\-unroller\fR" 4
+.IX Item "-fvariable-expansion-in-unroller"
+With this option, the compiler will create multiple copies of some
+local variables when unrolling a loop which can result in superior code.
+.IP "\fB\-fpredictive\-commoning\fR" 4
+.IX Item "-fpredictive-commoning"
+Perform predictive commoning optimization, i.e., reusing computations
+(especially memory loads and stores) performed in previous
+iterations of loops.
+.Sp
+This option is enabled at level \fB\-O3\fR.
+.IP "\fB\-fprefetch\-loop\-arrays\fR" 4
+.IX Item "-fprefetch-loop-arrays"
+If supported by the target machine, generate instructions to prefetch
+memory to improve the performance of loops that access large arrays.
+.Sp
+This option may generate better or worse code; results are highly
+dependent on the structure of loops within the source code.
+.Sp
+Disabled at level \fB\-Os\fR.
+.IP "\fB\-fno\-peephole\fR" 4
+.IX Item "-fno-peephole"
+.PD 0
+.IP "\fB\-fno\-peephole2\fR" 4
+.IX Item "-fno-peephole2"
+.PD
+Disable any machine-specific peephole optimizations. The difference
+between \fB\-fno\-peephole\fR and \fB\-fno\-peephole2\fR is in how they
+are implemented in the compiler; some targets use one, some use the
+other, a few use both.
+.Sp
+\&\fB\-fpeephole\fR is enabled by default.
+\&\fB\-fpeephole2\fR enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fno\-guess\-branch\-probability\fR" 4
+.IX Item "-fno-guess-branch-probability"
+Do not guess branch probabilities using heuristics.
+.Sp
+\&\s-1GCC\s0 will use heuristics to guess branch probabilities if they are
+not provided by profiling feedback (\fB\-fprofile\-arcs\fR). These
+heuristics are based on the control flow graph. If some branch probabilities
+are specified by \fB_\|_builtin_expect\fR, then the heuristics will be
+used to guess branch probabilities for the rest of the control flow graph,
+taking the \fB_\|_builtin_expect\fR info into account. The interactions
+between the heuristics and \fB_\|_builtin_expect\fR can be complex, and in
+some cases, it may be useful to disable the heuristics so that the effects
+of \fB_\|_builtin_expect\fR are easier to understand.
+.Sp
+The default is \fB\-fguess\-branch\-probability\fR at levels
+\&\fB\-O\fR, \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-freorder\-blocks\fR" 4
+.IX Item "-freorder-blocks"
+Reorder basic blocks in the compiled function in order to reduce number of
+taken branches and improve code locality.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR.
+.IP "\fB\-freorder\-blocks\-and\-partition\fR" 4
+.IX Item "-freorder-blocks-and-partition"
+In addition to reordering basic blocks in the compiled function, in order
+to reduce number of taken branches, partitions hot and cold basic blocks
+into separate sections of the assembly and .o files, to improve
+paging and cache locality performance.
+.Sp
+This optimization is automatically turned off in the presence of
+exception handling, for linkonce sections, for functions with a user-defined
+section attribute and on any architecture that does not support named
+sections.
+.IP "\fB\-freorder\-functions\fR" 4
+.IX Item "-freorder-functions"
+Reorder functions in the object file in order to
+improve code locality. This is implemented by using special
+subsections \f(CW\*(C`.text.hot\*(C'\fR for most frequently executed functions and
+\&\f(CW\*(C`.text.unlikely\*(C'\fR for unlikely executed functions. Reordering is done by
+the linker so object file format must support named sections and linker must
+place them in a reasonable way.
+.Sp
+Also profile feedback must be available in to make this option effective. See
+\&\fB\-fprofile\-arcs\fR for details.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fstrict\-aliasing\fR" 4
+.IX Item "-fstrict-aliasing"
+Allow the compiler to assume the strictest aliasing rules applicable to
+the language being compiled. For C (and \*(C+), this activates
+optimizations based on the type of expressions. In particular, an
+object of one type is assumed never to reside at the same address as an
+object of a different type, unless the types are almost the same. For
+example, an \f(CW\*(C`unsigned int\*(C'\fR can alias an \f(CW\*(C`int\*(C'\fR, but not a
+\&\f(CW\*(C`void*\*(C'\fR or a \f(CW\*(C`double\*(C'\fR. A character type may alias any other
+type.
+.Sp
+Pay special attention to code like this:
+.Sp
+.Vb 4
+\& union a_union {
+\& int i;
+\& double d;
+\& };
+\&
+\& int f() {
+\& union a_union t;
+\& t.d = 3.0;
+\& return t.i;
+\& }
+.Ve
+.Sp
+The practice of reading from a different union member than the one most
+recently written to (called \*(L"type-punning\*(R") is common. Even with
+\&\fB\-fstrict\-aliasing\fR, type-punning is allowed, provided the memory
+is accessed through the union type. So, the code above will work as
+expected. However, this code might not:
+.Sp
+.Vb 7
+\& int f() {
+\& union a_union t;
+\& int* ip;
+\& t.d = 3.0;
+\& ip = &t.i;
+\& return *ip;
+\& }
+.Ve
+.Sp
+Similarly, access by taking the address, casting the resulting pointer
+and dereferencing the result has undefined behavior, even if the cast
+uses a union type, e.g.:
+.Sp
+.Vb 4
+\& int f() {
+\& double d = 3.0;
+\& return ((union a_union *) &d)\->i;
+\& }
+.Ve
+.Sp
+The \fB\-fstrict\-aliasing\fR option is enabled at levels
+\&\fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fstrict\-overflow\fR" 4
+.IX Item "-fstrict-overflow"
+Allow the compiler to assume strict signed overflow rules, depending
+on the language being compiled. For C (and \*(C+) this means that
+overflow when doing arithmetic with signed numbers is undefined, which
+means that the compiler may assume that it will not happen. This
+permits various optimizations. For example, the compiler will assume
+that an expression like \f(CW\*(C`i + 10 > i\*(C'\fR will always be true for
+signed \f(CW\*(C`i\*(C'\fR. This assumption is only valid if signed overflow is
+undefined, as the expression is false if \f(CW\*(C`i + 10\*(C'\fR overflows when
+using twos complement arithmetic. When this option is in effect any
+attempt to determine whether an operation on signed numbers will
+overflow must be written carefully to not actually involve overflow.
+.Sp
+This option also allows the compiler to assume strict pointer
+semantics: given a pointer to an object, if adding an offset to that
+pointer does not produce a pointer to the same object, the addition is
+undefined. This permits the compiler to conclude that \f(CW\*(C`p + u >
+p\*(C'\fR is always true for a pointer \f(CW\*(C`p\*(C'\fR and unsigned integer
+\&\f(CW\*(C`u\*(C'\fR. This assumption is only valid because pointer wraparound is
+undefined, as the expression is false if \f(CW\*(C`p + u\*(C'\fR overflows using
+twos complement arithmetic.
+.Sp
+See also the \fB\-fwrapv\fR option. Using \fB\-fwrapv\fR means
+that integer signed overflow is fully defined: it wraps. When
+\&\fB\-fwrapv\fR is used, there is no difference between
+\&\fB\-fstrict\-overflow\fR and \fB\-fno\-strict\-overflow\fR for
+integers. With \fB\-fwrapv\fR certain types of overflow are
+permitted. For example, if the compiler gets an overflow when doing
+arithmetic on constants, the overflowed value can still be used with
+\&\fB\-fwrapv\fR, but not otherwise.
+.Sp
+The \fB\-fstrict\-overflow\fR option is enabled at levels
+\&\fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-falign\-functions\fR" 4
+.IX Item "-falign-functions"
+.PD 0
+.IP "\fB\-falign\-functions=\fR\fIn\fR" 4
+.IX Item "-falign-functions=n"
+.PD
+Align the start of functions to the next power-of-two greater than
+\&\fIn\fR, skipping up to \fIn\fR bytes. For instance,
+\&\fB\-falign\-functions=32\fR aligns functions to the next 32\-byte
+boundary, but \fB\-falign\-functions=24\fR would align to the next
+32\-byte boundary only if this can be done by skipping 23 bytes or less.
+.Sp
+\&\fB\-fno\-align\-functions\fR and \fB\-falign\-functions=1\fR are
+equivalent and mean that functions will not be aligned.
+.Sp
+Some assemblers only support this flag when \fIn\fR is a power of two;
+in that case, it is rounded up.
+.Sp
+If \fIn\fR is not specified or is zero, use a machine-dependent default.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR.
+.IP "\fB\-falign\-labels\fR" 4
+.IX Item "-falign-labels"
+.PD 0
+.IP "\fB\-falign\-labels=\fR\fIn\fR" 4
+.IX Item "-falign-labels=n"
+.PD
+Align all branch targets to a power-of-two boundary, skipping up to
+\&\fIn\fR bytes like \fB\-falign\-functions\fR. This option can easily
+make code slower, because it must insert dummy operations for when the
+branch target is reached in the usual flow of the code.
+.Sp
+\&\fB\-fno\-align\-labels\fR and \fB\-falign\-labels=1\fR are
+equivalent and mean that labels will not be aligned.
+.Sp
+If \fB\-falign\-loops\fR or \fB\-falign\-jumps\fR are applicable and
+are greater than this value, then their values are used instead.
+.Sp
+If \fIn\fR is not specified or is zero, use a machine-dependent default
+which is very likely to be \fB1\fR, meaning no alignment.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR.
+.IP "\fB\-falign\-loops\fR" 4
+.IX Item "-falign-loops"
+.PD 0
+.IP "\fB\-falign\-loops=\fR\fIn\fR" 4
+.IX Item "-falign-loops=n"
+.PD
+Align loops to a power-of-two boundary, skipping up to \fIn\fR bytes
+like \fB\-falign\-functions\fR. The hope is that the loop will be
+executed many times, which will make up for any execution of the dummy
+operations.
+.Sp
+\&\fB\-fno\-align\-loops\fR and \fB\-falign\-loops=1\fR are
+equivalent and mean that loops will not be aligned.
+.Sp
+If \fIn\fR is not specified or is zero, use a machine-dependent default.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR.
+.IP "\fB\-falign\-jumps\fR" 4
+.IX Item "-falign-jumps"
+.PD 0
+.IP "\fB\-falign\-jumps=\fR\fIn\fR" 4
+.IX Item "-falign-jumps=n"
+.PD
+Align branch targets to a power-of-two boundary, for branch targets
+where the targets can only be reached by jumping, skipping up to \fIn\fR
+bytes like \fB\-falign\-functions\fR. In this case, no dummy operations
+need be executed.
+.Sp
+\&\fB\-fno\-align\-jumps\fR and \fB\-falign\-jumps=1\fR are
+equivalent and mean that loops will not be aligned.
+.Sp
+If \fIn\fR is not specified or is zero, use a machine-dependent default.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR.
+.IP "\fB\-funit\-at\-a\-time\fR" 4
+.IX Item "-funit-at-a-time"
+This option is left for compatibility reasons. \fB\-funit\-at\-a\-time\fR
+has no effect, while \fB\-fno\-unit\-at\-a\-time\fR implies
+\&\fB\-fno\-toplevel\-reorder\fR and \fB\-fno\-section\-anchors\fR.
+.Sp
+Enabled by default.
+.IP "\fB\-fno\-toplevel\-reorder\fR" 4
+.IX Item "-fno-toplevel-reorder"
+Do not reorder top-level functions, variables, and \f(CW\*(C`asm\*(C'\fR
+statements. Output them in the same order that they appear in the
+input file. When this option is used, unreferenced static variables
+will not be removed. This option is intended to support existing code
+which relies on a particular ordering. For new code, it is better to
+use attributes.
+.Sp
+Enabled at level \fB\-O0\fR. When disabled explicitly, it also imply
+\&\fB\-fno\-section\-anchors\fR that is otherwise enabled at \fB\-O0\fR on some
+targets.
+.IP "\fB\-fweb\fR" 4
+.IX Item "-fweb"
+Constructs webs as commonly used for register allocation purposes and assign
+each web individual pseudo register. This allows the register allocation pass
+to operate on pseudos directly, but also strengthens several other optimization
+passes, such as \s-1CSE\s0, loop optimizer and trivial dead code remover. It can,
+however, make debugging impossible, since variables will no longer stay in a
+\&\*(L"home register\*(R".
+.Sp
+Enabled by default with \fB\-funroll\-loops\fR.
+.IP "\fB\-fwhole\-program\fR" 4
+.IX Item "-fwhole-program"
+Assume that the current compilation unit represents whole program being
+compiled. All public functions and variables with the exception of \f(CW\*(C`main\*(C'\fR
+and those merged by attribute \f(CW\*(C`externally_visible\*(C'\fR become static functions
+and in a affect gets more aggressively optimized by interprocedural optimizers.
+While this option is equivalent to proper use of \f(CW\*(C`static\*(C'\fR keyword for
+programs consisting of single file, in combination with option
+\&\fB\-\-combine\fR this flag can be used to compile most of smaller scale C
+programs since the functions and variables become local for the whole combined
+compilation unit, not for the single source file itself.
+.Sp
+This option is not supported for Fortran programs.
+.IP "\fB\-fcprop\-registers\fR" 4
+.IX Item "-fcprop-registers"
+After register allocation and post-register allocation instruction splitting,
+we perform a copy-propagation pass to try to reduce scheduling dependencies
+and occasionally eliminate the copy.
+.Sp
+Enabled at levels \fB\-O\fR, \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fprofile\-correction\fR" 4
+.IX Item "-fprofile-correction"
+Profiles collected using an instrumented binary for multi-threaded programs may
+be inconsistent due to missed counter updates. When this option is specified,
+\&\s-1GCC\s0 will use heuristics to correct or smooth out such inconsistencies. By
+default, \s-1GCC\s0 will emit an error message when an inconsistent profile is detected.
+.IP "\fB\-fprofile\-dir=\fR\fIpath\fR" 4
+.IX Item "-fprofile-dir=path"
+Set the directory to search the profile data files in to \fIpath\fR.
+This option affects only the profile data generated by
+\&\fB\-fprofile\-generate\fR, \fB\-ftest\-coverage\fR, \fB\-fprofile\-arcs\fR
+and used by \fB\-fprofile\-use\fR and \fB\-fbranch\-probabilities\fR
+and its related options.
+By default, \s-1GCC\s0 will use the current directory as \fIpath\fR
+thus the profile data file will appear in the same directory as the object file.
+.IP "\fB\-fprofile\-generate\fR" 4
+.IX Item "-fprofile-generate"
+.PD 0
+.IP "\fB\-fprofile\-generate=\fR\fIpath\fR" 4
+.IX Item "-fprofile-generate=path"
+.PD
+Enable options usually used for instrumenting application to produce
+profile useful for later recompilation with profile feedback based
+optimization. You must use \fB\-fprofile\-generate\fR both when
+compiling and when linking your program.
+.Sp
+The following options are enabled: \f(CW\*(C`\-fprofile\-arcs\*(C'\fR, \f(CW\*(C`\-fprofile\-values\*(C'\fR, \f(CW\*(C`\-fvpt\*(C'\fR.
+.Sp
+If \fIpath\fR is specified, \s-1GCC\s0 will look at the \fIpath\fR to find
+the profile feedback data files. See \fB\-fprofile\-dir\fR.
+.IP "\fB\-fprofile\-use\fR" 4
+.IX Item "-fprofile-use"
+.PD 0
+.IP "\fB\-fprofile\-use=\fR\fIpath\fR" 4
+.IX Item "-fprofile-use=path"
+.PD
+Enable profile feedback directed optimizations, and optimizations
+generally profitable only with profile feedback available.
+.Sp
+The following options are enabled: \f(CW\*(C`\-fbranch\-probabilities\*(C'\fR, \f(CW\*(C`\-fvpt\*(C'\fR,
+\&\f(CW\*(C`\-funroll\-loops\*(C'\fR, \f(CW\*(C`\-fpeel\-loops\*(C'\fR, \f(CW\*(C`\-ftracer\*(C'\fR
+.Sp
+By default, \s-1GCC\s0 emits an error message if the feedback profiles do not
+match the source code. This error can be turned into a warning by using
+\&\fB\-Wcoverage\-mismatch\fR. Note this may result in poorly optimized
+code.
+.Sp
+If \fIpath\fR is specified, \s-1GCC\s0 will look at the \fIpath\fR to find
+the profile feedback data files. See \fB\-fprofile\-dir\fR.
+.PP
+The following options control compiler behavior regarding floating
+point arithmetic. These options trade off between speed and
+correctness. All must be specifically enabled.
+.IP "\fB\-ffloat\-store\fR" 4
+.IX Item "-ffloat-store"
+Do not store floating point variables in registers, and inhibit other
+options that might change whether a floating point value is taken from a
+register or memory.
+.Sp
+This option prevents undesirable excess precision on machines such as
+the 68000 where the floating registers (of the 68881) keep more
+precision than a \f(CW\*(C`double\*(C'\fR is supposed to have. Similarly for the
+x86 architecture. For most programs, the excess precision does only
+good, but a few programs rely on the precise definition of \s-1IEEE\s0 floating
+point. Use \fB\-ffloat\-store\fR for such programs, after modifying
+them to store all pertinent intermediate computations into variables.
+.IP "\fB\-ffast\-math\fR" 4
+.IX Item "-ffast-math"
+Sets \fB\-fno\-math\-errno\fR, \fB\-funsafe\-math\-optimizations\fR,
+\&\fB\-ffinite\-math\-only\fR, \fB\-fno\-rounding\-math\fR,
+\&\fB\-fno\-signaling\-nans\fR and \fB\-fcx\-limited\-range\fR.
+.Sp
+This option causes the preprocessor macro \f(CW\*(C`_\|_FAST_MATH_\|_\*(C'\fR to be defined.
+.Sp
+This option is not turned on by any \fB\-O\fR option since
+it can result in incorrect output for programs which depend on
+an exact implementation of \s-1IEEE\s0 or \s-1ISO\s0 rules/specifications for
+math functions. It may, however, yield faster code for programs
+that do not require the guarantees of these specifications.
+.IP "\fB\-fno\-math\-errno\fR" 4
+.IX Item "-fno-math-errno"
+Do not set \s-1ERRNO\s0 after calling math functions that are executed
+with a single instruction, e.g., sqrt. A program that relies on
+\&\s-1IEEE\s0 exceptions for math error handling may want to use this flag
+for speed while maintaining \s-1IEEE\s0 arithmetic compatibility.
+.Sp
+This option is not turned on by any \fB\-O\fR option since
+it can result in incorrect output for programs which depend on
+an exact implementation of \s-1IEEE\s0 or \s-1ISO\s0 rules/specifications for
+math functions. It may, however, yield faster code for programs
+that do not require the guarantees of these specifications.
+.Sp
+The default is \fB\-fmath\-errno\fR.
+.Sp
+On Darwin systems, the math library never sets \f(CW\*(C`errno\*(C'\fR. There is
+therefore no reason for the compiler to consider the possibility that
+it might, and \fB\-fno\-math\-errno\fR is the default.
+.IP "\fB\-funsafe\-math\-optimizations\fR" 4
+.IX Item "-funsafe-math-optimizations"
+Allow optimizations for floating-point arithmetic that (a) assume
+that arguments and results are valid and (b) may violate \s-1IEEE\s0 or
+\&\s-1ANSI\s0 standards. When used at link-time, it may include libraries
+or startup files that change the default \s-1FPU\s0 control word or other
+similar optimizations.
+.Sp
+This option is not turned on by any \fB\-O\fR option since
+it can result in incorrect output for programs which depend on
+an exact implementation of \s-1IEEE\s0 or \s-1ISO\s0 rules/specifications for
+math functions. It may, however, yield faster code for programs
+that do not require the guarantees of these specifications.
+Enables \fB\-fno\-signed\-zeros\fR, \fB\-fno\-trapping\-math\fR,
+\&\fB\-fassociative\-math\fR and \fB\-freciprocal\-math\fR.
+.Sp
+The default is \fB\-fno\-unsafe\-math\-optimizations\fR.
+.IP "\fB\-fassociative\-math\fR" 4
+.IX Item "-fassociative-math"
+Allow re-association of operands in series of floating-point operations.
+This violates the \s-1ISO\s0 C and \*(C+ language standard by possibly changing
+computation result. \s-1NOTE:\s0 re-ordering may change the sign of zero as
+well as ignore NaNs and inhibit or create underflow or overflow (and
+thus cannot be used on a code which relies on rounding behavior like
+\&\f(CW\*(C`(x + 2**52) \- 2**52)\*(C'\fR. May also reorder floating-point comparisons
+and thus may not be used when ordered comparisons are required.
+This option requires that both \fB\-fno\-signed\-zeros\fR and
+\&\fB\-fno\-trapping\-math\fR be in effect. Moreover, it doesn't make
+much sense with \fB\-frounding\-math\fR.
+.Sp
+The default is \fB\-fno\-associative\-math\fR.
+.IP "\fB\-freciprocal\-math\fR" 4
+.IX Item "-freciprocal-math"
+Allow the reciprocal of a value to be used instead of dividing by
+the value if this enables optimizations. For example \f(CW\*(C`x / y\*(C'\fR
+can be replaced with \f(CW\*(C`x * (1/y)\*(C'\fR which is useful if \f(CW\*(C`(1/y)\*(C'\fR
+is subject to common subexpression elimination. Note that this loses
+precision and increases the number of flops operating on the value.
+.Sp
+The default is \fB\-fno\-reciprocal\-math\fR.
+.IP "\fB\-ffinite\-math\-only\fR" 4
+.IX Item "-ffinite-math-only"
+Allow optimizations for floating-point arithmetic that assume
+that arguments and results are not NaNs or +\-Infs.
+.Sp
+This option is not turned on by any \fB\-O\fR option since
+it can result in incorrect output for programs which depend on
+an exact implementation of \s-1IEEE\s0 or \s-1ISO\s0 rules/specifications for
+math functions. It may, however, yield faster code for programs
+that do not require the guarantees of these specifications.
+.Sp
+The default is \fB\-fno\-finite\-math\-only\fR.
+.IP "\fB\-fno\-signed\-zeros\fR" 4
+.IX Item "-fno-signed-zeros"
+Allow optimizations for floating point arithmetic that ignore the
+signedness of zero. \s-1IEEE\s0 arithmetic specifies the behavior of
+distinct +0.0 and \-0.0 values, which then prohibits simplification
+of expressions such as x+0.0 or 0.0*x (even with \fB\-ffinite\-math\-only\fR).
+This option implies that the sign of a zero result isn't significant.
+.Sp
+The default is \fB\-fsigned\-zeros\fR.
+.IP "\fB\-fno\-trapping\-math\fR" 4
+.IX Item "-fno-trapping-math"
+Compile code assuming that floating-point operations cannot generate
+user-visible traps. These traps include division by zero, overflow,
+underflow, inexact result and invalid operation. This option requires
+that \fB\-fno\-signaling\-nans\fR be in effect. Setting this option may
+allow faster code if one relies on \*(L"non-stop\*(R" \s-1IEEE\s0 arithmetic, for example.
+.Sp
+This option should never be turned on by any \fB\-O\fR option since
+it can result in incorrect output for programs which depend on
+an exact implementation of \s-1IEEE\s0 or \s-1ISO\s0 rules/specifications for
+math functions.
+.Sp
+The default is \fB\-ftrapping\-math\fR.
+.IP "\fB\-frounding\-math\fR" 4
+.IX Item "-frounding-math"
+Disable transformations and optimizations that assume default floating
+point rounding behavior. This is round-to-zero for all floating point
+to integer conversions, and round-to-nearest for all other arithmetic
+truncations. This option should be specified for programs that change
+the \s-1FP\s0 rounding mode dynamically, or that may be executed with a
+non-default rounding mode. This option disables constant folding of
+floating point expressions at compile-time (which may be affected by
+rounding mode) and arithmetic transformations that are unsafe in the
+presence of sign-dependent rounding modes.
+.Sp
+The default is \fB\-fno\-rounding\-math\fR.
+.Sp
+This option is experimental and does not currently guarantee to
+disable all \s-1GCC\s0 optimizations that are affected by rounding mode.
+Future versions of \s-1GCC\s0 may provide finer control of this setting
+using C99's \f(CW\*(C`FENV_ACCESS\*(C'\fR pragma. This command line option
+will be used to specify the default state for \f(CW\*(C`FENV_ACCESS\*(C'\fR.
+.IP "\fB\-frtl\-abstract\-sequences\fR" 4
+.IX Item "-frtl-abstract-sequences"
+It is a size optimization method. This option is to find identical
+sequences of code, which can be turned into pseudo-procedures and
+then replace all occurrences with calls to the newly created
+subroutine. It is kind of an opposite of \fB\-finline\-functions\fR.
+This optimization runs at \s-1RTL\s0 level.
+.IP "\fB\-fsignaling\-nans\fR" 4
+.IX Item "-fsignaling-nans"
+Compile code assuming that \s-1IEEE\s0 signaling NaNs may generate user-visible
+traps during floating-point operations. Setting this option disables
+optimizations that may change the number of exceptions visible with
+signaling NaNs. This option implies \fB\-ftrapping\-math\fR.
+.Sp
+This option causes the preprocessor macro \f(CW\*(C`_\|_SUPPORT_SNAN_\|_\*(C'\fR to
+be defined.
+.Sp
+The default is \fB\-fno\-signaling\-nans\fR.
+.Sp
+This option is experimental and does not currently guarantee to
+disable all \s-1GCC\s0 optimizations that affect signaling NaN behavior.
+.IP "\fB\-fsingle\-precision\-constant\fR" 4
+.IX Item "-fsingle-precision-constant"
+Treat floating point constant as single precision constant instead of
+implicitly converting it to double precision constant.
+.IP "\fB\-fcx\-limited\-range\fR" 4
+.IX Item "-fcx-limited-range"
+When enabled, this option states that a range reduction step is not
+needed when performing complex division. Also, there is no checking
+whether the result of a complex multiplication or division is \f(CW\*(C`NaN
++ I*NaN\*(C'\fR, with an attempt to rescue the situation in that case. The
+default is \fB\-fno\-cx\-limited\-range\fR, but is enabled by
+\&\fB\-ffast\-math\fR.
+.Sp
+This option controls the default setting of the \s-1ISO\s0 C99
+\&\f(CW\*(C`CX_LIMITED_RANGE\*(C'\fR pragma. Nevertheless, the option applies to
+all languages.
+.IP "\fB\-fcx\-fortran\-rules\fR" 4
+.IX Item "-fcx-fortran-rules"
+Complex multiplication and division follow Fortran rules. Range
+reduction is done as part of complex division, but there is no checking
+whether the result of a complex multiplication or division is \f(CW\*(C`NaN
++ I*NaN\*(C'\fR, with an attempt to rescue the situation in that case.
+.Sp
+The default is \fB\-fno\-cx\-fortran\-rules\fR.
+.PP
+The following options control optimizations that may improve
+performance, but are not enabled by any \fB\-O\fR options. This
+section includes experimental options that may produce broken code.
+.IP "\fB\-fbranch\-probabilities\fR" 4
+.IX Item "-fbranch-probabilities"
+After running a program compiled with \fB\-fprofile\-arcs\fR, you can compile it a second time using
+\&\fB\-fbranch\-probabilities\fR, to improve optimizations based on
+the number of times each branch was taken. When the program
+compiled with \fB\-fprofile\-arcs\fR exits it saves arc execution
+counts to a file called \fI\fIsourcename\fI.gcda\fR for each source
+file. The information in this data file is very dependent on the
+structure of the generated code, so you must use the same source code
+and the same optimization options for both compilations.
+.Sp
+With \fB\-fbranch\-probabilities\fR, \s-1GCC\s0 puts a
+\&\fB\s-1REG_BR_PROB\s0\fR note on each \fB\s-1JUMP_INSN\s0\fR and \fB\s-1CALL_INSN\s0\fR.
+These can be used to improve optimization. Currently, they are only
+used in one place: in \fIreorg.c\fR, instead of guessing which path a
+branch is mostly to take, the \fB\s-1REG_BR_PROB\s0\fR values are used to
+exactly determine which path is taken more often.
+.IP "\fB\-fprofile\-values\fR" 4
+.IX Item "-fprofile-values"
+If combined with \fB\-fprofile\-arcs\fR, it adds code so that some
+data about values of expressions in the program is gathered.
+.Sp
+With \fB\-fbranch\-probabilities\fR, it reads back the data gathered
+from profiling values of expressions and adds \fB\s-1REG_VALUE_PROFILE\s0\fR
+notes to instructions for their later usage in optimizations.
+.Sp
+Enabled with \fB\-fprofile\-generate\fR and \fB\-fprofile\-use\fR.
+.IP "\fB\-fvpt\fR" 4
+.IX Item "-fvpt"
+If combined with \fB\-fprofile\-arcs\fR, it instructs the compiler to add
+a code to gather information about values of expressions.
+.Sp
+With \fB\-fbranch\-probabilities\fR, it reads back the data gathered
+and actually performs the optimizations based on them.
+Currently the optimizations include specialization of division operation
+using the knowledge about the value of the denominator.
+.IP "\fB\-frename\-registers\fR" 4
+.IX Item "-frename-registers"
+Attempt to avoid false dependencies in scheduled code by making use
+of registers left over after register allocation. This optimization
+will most benefit processors with lots of registers. Depending on the
+debug information format adopted by the target, however, it can
+make debugging impossible, since variables will no longer stay in
+a \*(L"home register\*(R".
+.Sp
+Enabled by default with \fB\-funroll\-loops\fR.
+.IP "\fB\-ftracer\fR" 4
+.IX Item "-ftracer"
+Perform tail duplication to enlarge superblock size. This transformation
+simplifies the control flow of the function allowing other optimizations to do
+better job.
+.Sp
+Enabled with \fB\-fprofile\-use\fR.
+.IP "\fB\-funroll\-loops\fR" 4
+.IX Item "-funroll-loops"
+Unroll loops whose number of iterations can be determined at compile time or
+upon entry to the loop. \fB\-funroll\-loops\fR implies
+\&\fB\-frerun\-cse\-after\-loop\fR, \fB\-fweb\fR and \fB\-frename\-registers\fR.
+It also turns on complete loop peeling (i.e. complete removal of loops with
+small constant number of iterations). This option makes code larger, and may
+or may not make it run faster.
+.Sp
+Enabled with \fB\-fprofile\-use\fR.
+.IP "\fB\-funroll\-all\-loops\fR" 4
+.IX Item "-funroll-all-loops"
+Unroll all loops, even if their number of iterations is uncertain when
+the loop is entered. This usually makes programs run more slowly.
+\&\fB\-funroll\-all\-loops\fR implies the same options as
+\&\fB\-funroll\-loops\fR.
+.IP "\fB\-fpeel\-loops\fR" 4
+.IX Item "-fpeel-loops"
+Peels the loops for that there is enough information that they do not
+roll much (from profile feedback). It also turns on complete loop peeling
+(i.e. complete removal of loops with small constant number of iterations).
+.Sp
+Enabled with \fB\-fprofile\-use\fR.
+.IP "\fB\-fmove\-loop\-invariants\fR" 4
+.IX Item "-fmove-loop-invariants"
+Enables the loop invariant motion pass in the \s-1RTL\s0 loop optimizer. Enabled
+at level \fB\-O1\fR
+.IP "\fB\-funswitch\-loops\fR" 4
+.IX Item "-funswitch-loops"
+Move branches with loop invariant conditions out of the loop, with duplicates
+of the loop on both branches (modified according to result of the condition).
+.IP "\fB\-ffunction\-sections\fR" 4
+.IX Item "-ffunction-sections"
+.PD 0
+.IP "\fB\-fdata\-sections\fR" 4
+.IX Item "-fdata-sections"
+.PD
+Place each function or data item into its own section in the output
+file if the target supports arbitrary sections. The name of the
+function or the name of the data item determines the section's name
+in the output file.
+.Sp
+Use these options on systems where the linker can perform optimizations
+to improve locality of reference in the instruction space. Most systems
+using the \s-1ELF\s0 object format and \s-1SPARC\s0 processors running Solaris 2 have
+linkers with such optimizations. \s-1AIX\s0 may have these optimizations in
+the future.
+.Sp
+Only use these options when there are significant benefits from doing
+so. When you specify these options, the assembler and linker will
+create larger object and executable files and will also be slower.
+You will not be able to use \f(CW\*(C`gprof\*(C'\fR on all systems if you
+specify this option and you may have problems with debugging if
+you specify both this option and \fB\-g\fR.
+.IP "\fB\-fbranch\-target\-load\-optimize\fR" 4
+.IX Item "-fbranch-target-load-optimize"
+Perform branch target register load optimization before prologue / epilogue
+threading.
+The use of target registers can typically be exposed only during reload,
+thus hoisting loads out of loops and doing inter-block scheduling needs
+a separate optimization pass.
+.IP "\fB\-fbranch\-target\-load\-optimize2\fR" 4
+.IX Item "-fbranch-target-load-optimize2"
+Perform branch target register load optimization after prologue / epilogue
+threading.
+.IP "\fB\-fbtr\-bb\-exclusive\fR" 4
+.IX Item "-fbtr-bb-exclusive"
+When performing branch target register load optimization, don't reuse
+branch target registers in within any basic block.
+.IP "\fB\-fstack\-protector\fR" 4
+.IX Item "-fstack-protector"
+Emit extra code to check for buffer overflows, such as stack smashing
+attacks. This is done by adding a guard variable to functions with
+vulnerable objects. This includes functions that call alloca, and
+functions with buffers larger than 8 bytes. The guards are initialized
+when a function is entered and then checked when the function exits.
+If a guard check fails, an error message is printed and the program exits.
+.IP "\fB\-fstack\-protector\-all\fR" 4
+.IX Item "-fstack-protector-all"
+Like \fB\-fstack\-protector\fR except that all functions are protected.
+.IP "\fB\-fsection\-anchors\fR" 4
+.IX Item "-fsection-anchors"
+Try to reduce the number of symbolic address calculations by using
+shared \*(L"anchor\*(R" symbols to address nearby objects. This transformation
+can help to reduce the number of \s-1GOT\s0 entries and \s-1GOT\s0 accesses on some
+targets.
+.Sp
+For example, the implementation of the following function \f(CW\*(C`foo\*(C'\fR:
+.Sp
+.Vb 2
+\& static int a, b, c;
+\& int foo (void) { return a + b + c; }
+.Ve
+.Sp
+would usually calculate the addresses of all three variables, but if you
+compile it with \fB\-fsection\-anchors\fR, it will access the variables
+from a common anchor point instead. The effect is similar to the
+following pseudocode (which isn't valid C):
+.Sp
+.Vb 5
+\& int foo (void)
+\& {
+\& register int *xr = &x;
+\& return xr[&a \- &x] + xr[&b \- &x] + xr[&c \- &x];
+\& }
+.Ve
+.Sp
+Not all targets support this option.
+.IP "\fB\-\-param\fR \fIname\fR\fB=\fR\fIvalue\fR" 4
+.IX Item "--param name=value"
+In some places, \s-1GCC\s0 uses various constants to control the amount of
+optimization that is done. For example, \s-1GCC\s0 will not inline functions
+that contain more that a certain number of instructions. You can
+control some of these constants on the command-line using the
+\&\fB\-\-param\fR option.
+.Sp
+The names of specific parameters, and the meaning of the values, are
+tied to the internals of the compiler, and are subject to change
+without notice in future releases.
+.Sp
+In each case, the \fIvalue\fR is an integer. The allowable choices for
+\&\fIname\fR are given in the following table:
+.RS 4
+.IP "\fBsra-max-structure-size\fR" 4
+.IX Item "sra-max-structure-size"
+The maximum structure size, in bytes, at which the scalar replacement
+of aggregates (\s-1SRA\s0) optimization will perform block copies. The
+default value, 0, implies that \s-1GCC\s0 will select the most appropriate
+size itself.
+.IP "\fBsra-field-structure-ratio\fR" 4
+.IX Item "sra-field-structure-ratio"
+The threshold ratio (as a percentage) between instantiated fields and
+the complete structure size. We say that if the ratio of the number
+of bytes in instantiated fields to the number of bytes in the complete
+structure exceeds this parameter, then block copies are not used. The
+default is 75.
+.IP "\fBstruct-reorg-cold-struct-ratio\fR" 4
+.IX Item "struct-reorg-cold-struct-ratio"
+The threshold ratio (as a percentage) between a structure frequency
+and the frequency of the hottest structure in the program. This parameter
+is used by struct-reorg optimization enabled by \fB\-fipa\-struct\-reorg\fR.
+We say that if the ratio of a structure frequency, calculated by profiling,
+to the hottest structure frequency in the program is less than this
+parameter, then structure reorganization is not applied to this structure.
+The default is 10.
+.IP "\fBpredictable-branch-cost-outcome\fR" 4
+.IX Item "predictable-branch-cost-outcome"
+When branch is predicted to be taken with probability lower than this threshold
+(in percent), then it is considered well predictable. The default is 10.
+.IP "\fBmax-crossjump-edges\fR" 4
+.IX Item "max-crossjump-edges"
+The maximum number of incoming edges to consider for crossjumping.
+The algorithm used by \fB\-fcrossjumping\fR is O(N^2) in
+the number of edges incoming to each block. Increasing values mean
+more aggressive optimization, making the compile time increase with
+probably small improvement in executable size.
+.IP "\fBmin-crossjump-insns\fR" 4
+.IX Item "min-crossjump-insns"
+The minimum number of instructions which must be matched at the end
+of two blocks before crossjumping will be performed on them. This
+value is ignored in the case where all instructions in the block being
+crossjumped from are matched. The default value is 5.
+.IP "\fBmax-grow-copy-bb-insns\fR" 4
+.IX Item "max-grow-copy-bb-insns"
+The maximum code size expansion factor when copying basic blocks
+instead of jumping. The expansion is relative to a jump instruction.
+The default value is 8.
+.IP "\fBmax-goto-duplication-insns\fR" 4
+.IX Item "max-goto-duplication-insns"
+The maximum number of instructions to duplicate to a block that jumps
+to a computed goto. To avoid O(N^2) behavior in a number of
+passes, \s-1GCC\s0 factors computed gotos early in the compilation process,
+and unfactors them as late as possible. Only computed jumps at the
+end of a basic blocks with no more than max-goto-duplication-insns are
+unfactored. The default value is 8.
+.IP "\fBmax-delay-slot-insn-search\fR" 4
+.IX Item "max-delay-slot-insn-search"
+The maximum number of instructions to consider when looking for an
+instruction to fill a delay slot. If more than this arbitrary number of
+instructions is searched, the time savings from filling the delay slot
+will be minimal so stop searching. Increasing values mean more
+aggressive optimization, making the compile time increase with probably
+small improvement in executable run time.
+.IP "\fBmax-delay-slot-live-search\fR" 4
+.IX Item "max-delay-slot-live-search"
+When trying to fill delay slots, the maximum number of instructions to
+consider when searching for a block with valid live register
+information. Increasing this arbitrarily chosen value means more
+aggressive optimization, increasing the compile time. This parameter
+should be removed when the delay slot code is rewritten to maintain the
+control-flow graph.
+.IP "\fBmax-gcse-memory\fR" 4
+.IX Item "max-gcse-memory"
+The approximate maximum amount of memory that will be allocated in
+order to perform the global common subexpression elimination
+optimization. If more memory than specified is required, the
+optimization will not be done.
+.IP "\fBmax-gcse-passes\fR" 4
+.IX Item "max-gcse-passes"
+The maximum number of passes of \s-1GCSE\s0 to run. The default is 1.
+.IP "\fBmax-pending-list-length\fR" 4
+.IX Item "max-pending-list-length"
+The maximum number of pending dependencies scheduling will allow
+before flushing the current state and starting over. Large functions
+with few branches or calls can create excessively large lists which
+needlessly consume memory and resources.
+.IP "\fBmax-inline-insns-single\fR" 4
+.IX Item "max-inline-insns-single"
+Several parameters control the tree inliner used in gcc.
+This number sets the maximum number of instructions (counted in \s-1GCC\s0's
+internal representation) in a single function that the tree inliner
+will consider for inlining. This only affects functions declared
+inline and methods implemented in a class declaration (\*(C+).
+The default value is 450.
+.IP "\fBmax-inline-insns-auto\fR" 4
+.IX Item "max-inline-insns-auto"
+When you use \fB\-finline\-functions\fR (included in \fB\-O3\fR),
+a lot of functions that would otherwise not be considered for inlining
+by the compiler will be investigated. To those functions, a different
+(more restrictive) limit compared to functions declared inline can
+be applied.
+The default value is 90.
+.IP "\fBlarge-function-insns\fR" 4
+.IX Item "large-function-insns"
+The limit specifying really large functions. For functions larger than this
+limit after inlining, inlining is constrained by
+\&\fB\-\-param large-function-growth\fR. This parameter is useful primarily
+to avoid extreme compilation time caused by non-linear algorithms used by the
+backend.
+The default value is 2700.
+.IP "\fBlarge-function-growth\fR" 4
+.IX Item "large-function-growth"
+Specifies maximal growth of large function caused by inlining in percents.
+The default value is 100 which limits large function growth to 2.0 times
+the original size.
+.IP "\fBlarge-unit-insns\fR" 4
+.IX Item "large-unit-insns"
+The limit specifying large translation unit. Growth caused by inlining of
+units larger than this limit is limited by \fB\-\-param inline-unit-growth\fR.
+For small units this might be too tight (consider unit consisting of function A
+that is inline and B that just calls A three time. If B is small relative to
+A, the growth of unit is 300\e% and yet such inlining is very sane. For very
+large units consisting of small inlineable functions however the overall unit
+growth limit is needed to avoid exponential explosion of code size. Thus for
+smaller units, the size is increased to \fB\-\-param large-unit-insns\fR
+before applying \fB\-\-param inline-unit-growth\fR. The default is 10000
+.IP "\fBinline-unit-growth\fR" 4
+.IX Item "inline-unit-growth"
+Specifies maximal overall growth of the compilation unit caused by inlining.
+The default value is 30 which limits unit growth to 1.3 times the original
+size.
+.IP "\fBipcp-unit-growth\fR" 4
+.IX Item "ipcp-unit-growth"
+Specifies maximal overall growth of the compilation unit caused by
+interprocedural constant propagation. The default value is 10 which limits
+unit growth to 1.1 times the original size.
+.IP "\fBlarge-stack-frame\fR" 4
+.IX Item "large-stack-frame"
+The limit specifying large stack frames. While inlining the algorithm is trying
+to not grow past this limit too much. Default value is 256 bytes.
+.IP "\fBlarge-stack-frame-growth\fR" 4
+.IX Item "large-stack-frame-growth"
+Specifies maximal growth of large stack frames caused by inlining in percents.
+The default value is 1000 which limits large stack frame growth to 11 times
+the original size.
+.IP "\fBmax-inline-insns-recursive\fR" 4
+.IX Item "max-inline-insns-recursive"
+.PD 0
+.IP "\fBmax-inline-insns-recursive-auto\fR" 4
+.IX Item "max-inline-insns-recursive-auto"
+.PD
+Specifies maximum number of instructions out-of-line copy of self recursive inline
+function can grow into by performing recursive inlining.
+.Sp
+For functions declared inline \fB\-\-param max-inline-insns-recursive\fR is
+taken into account. For function not declared inline, recursive inlining
+happens only when \fB\-finline\-functions\fR (included in \fB\-O3\fR) is
+enabled and \fB\-\-param max-inline-insns-recursive-auto\fR is used. The
+default value is 450.
+.IP "\fBmax-inline-recursive-depth\fR" 4
+.IX Item "max-inline-recursive-depth"
+.PD 0
+.IP "\fBmax-inline-recursive-depth-auto\fR" 4
+.IX Item "max-inline-recursive-depth-auto"
+.PD
+Specifies maximum recursion depth used by the recursive inlining.
+.Sp
+For functions declared inline \fB\-\-param max-inline-recursive-depth\fR is
+taken into account. For function not declared inline, recursive inlining
+happens only when \fB\-finline\-functions\fR (included in \fB\-O3\fR) is
+enabled and \fB\-\-param max-inline-recursive-depth-auto\fR is used. The
+default value is 8.
+.IP "\fBmin-inline-recursive-probability\fR" 4
+.IX Item "min-inline-recursive-probability"
+Recursive inlining is profitable only for function having deep recursion
+in average and can hurt for function having little recursion depth by
+increasing the prologue size or complexity of function body to other
+optimizers.
+.Sp
+When profile feedback is available (see \fB\-fprofile\-generate\fR) the actual
+recursion depth can be guessed from probability that function will recurse via
+given call expression. This parameter limits inlining only to call expression
+whose probability exceeds given threshold (in percents). The default value is
+10.
+.IP "\fBinline-call-cost\fR" 4
+.IX Item "inline-call-cost"
+Specify cost of call instruction relative to simple arithmetics operations
+(having cost of 1). Increasing this cost disqualifies inlining of non-leaf
+functions and at the same time increases size of leaf function that is believed to
+reduce function size by being inlined. In effect it increases amount of
+inlining for code having large abstraction penalty (many functions that just
+pass the arguments to other functions) and decrease inlining for code with low
+abstraction penalty. The default value is 12.
+.IP "\fBmin-vect-loop-bound\fR" 4
+.IX Item "min-vect-loop-bound"
+The minimum number of iterations under which a loop will not get vectorized
+when \fB\-ftree\-vectorize\fR is used. The number of iterations after
+vectorization needs to be greater than the value specified by this option
+to allow vectorization. The default value is 0.
+.IP "\fBmax-unrolled-insns\fR" 4
+.IX Item "max-unrolled-insns"
+The maximum number of instructions that a loop should have if that loop
+is unrolled, and if the loop is unrolled, it determines how many times
+the loop code is unrolled.
+.IP "\fBmax-average-unrolled-insns\fR" 4
+.IX Item "max-average-unrolled-insns"
+The maximum number of instructions biased by probabilities of their execution
+that a loop should have if that loop is unrolled, and if the loop is unrolled,
+it determines how many times the loop code is unrolled.
+.IP "\fBmax-unroll-times\fR" 4
+.IX Item "max-unroll-times"
+The maximum number of unrollings of a single loop.
+.IP "\fBmax-peeled-insns\fR" 4
+.IX Item "max-peeled-insns"
+The maximum number of instructions that a loop should have if that loop
+is peeled, and if the loop is peeled, it determines how many times
+the loop code is peeled.
+.IP "\fBmax-peel-times\fR" 4
+.IX Item "max-peel-times"
+The maximum number of peelings of a single loop.
+.IP "\fBmax-completely-peeled-insns\fR" 4
+.IX Item "max-completely-peeled-insns"
+The maximum number of insns of a completely peeled loop.
+.IP "\fBmax-completely-peel-times\fR" 4
+.IX Item "max-completely-peel-times"
+The maximum number of iterations of a loop to be suitable for complete peeling.
+.IP "\fBmax-unswitch-insns\fR" 4
+.IX Item "max-unswitch-insns"
+The maximum number of insns of an unswitched loop.
+.IP "\fBmax-unswitch-level\fR" 4
+.IX Item "max-unswitch-level"
+The maximum number of branches unswitched in a single loop.
+.IP "\fBlim-expensive\fR" 4
+.IX Item "lim-expensive"
+The minimum cost of an expensive expression in the loop invariant motion.
+.IP "\fBiv-consider-all-candidates-bound\fR" 4
+.IX Item "iv-consider-all-candidates-bound"
+Bound on number of candidates for induction variables below that
+all candidates are considered for each use in induction variable
+optimizations. Only the most relevant candidates are considered
+if there are more candidates, to avoid quadratic time complexity.
+.IP "\fBiv-max-considered-uses\fR" 4
+.IX Item "iv-max-considered-uses"
+The induction variable optimizations give up on loops that contain more
+induction variable uses.
+.IP "\fBiv-always-prune-cand-set-bound\fR" 4
+.IX Item "iv-always-prune-cand-set-bound"
+If number of candidates in the set is smaller than this value,
+we always try to remove unnecessary ivs from the set during its
+optimization when a new iv is added to the set.
+.IP "\fBscev-max-expr-size\fR" 4
+.IX Item "scev-max-expr-size"
+Bound on size of expressions used in the scalar evolutions analyzer.
+Large expressions slow the analyzer.
+.IP "\fBomega-max-vars\fR" 4
+.IX Item "omega-max-vars"
+The maximum number of variables in an Omega constraint system.
+The default value is 128.
+.IP "\fBomega-max-geqs\fR" 4
+.IX Item "omega-max-geqs"
+The maximum number of inequalities in an Omega constraint system.
+The default value is 256.
+.IP "\fBomega-max-eqs\fR" 4
+.IX Item "omega-max-eqs"
+The maximum number of equalities in an Omega constraint system.
+The default value is 128.
+.IP "\fBomega-max-wild-cards\fR" 4
+.IX Item "omega-max-wild-cards"
+The maximum number of wildcard variables that the Omega solver will
+be able to insert. The default value is 18.
+.IP "\fBomega-hash-table-size\fR" 4
+.IX Item "omega-hash-table-size"
+The size of the hash table in the Omega solver. The default value is
+550.
+.IP "\fBomega-max-keys\fR" 4
+.IX Item "omega-max-keys"
+The maximal number of keys used by the Omega solver. The default
+value is 500.
+.IP "\fBomega-eliminate-redundant-constraints\fR" 4
+.IX Item "omega-eliminate-redundant-constraints"
+When set to 1, use expensive methods to eliminate all redundant
+constraints. The default value is 0.
+.IP "\fBvect-max-version-for-alignment-checks\fR" 4
+.IX Item "vect-max-version-for-alignment-checks"
+The maximum number of runtime checks that can be performed when
+doing loop versioning for alignment in the vectorizer. See option
+ftree-vect-loop-version for more information.
+.IP "\fBvect-max-version-for-alias-checks\fR" 4
+.IX Item "vect-max-version-for-alias-checks"
+The maximum number of runtime checks that can be performed when
+doing loop versioning for alias in the vectorizer. See option
+ftree-vect-loop-version for more information.
+.IP "\fBmax-iterations-to-track\fR" 4
+.IX Item "max-iterations-to-track"
+The maximum number of iterations of a loop the brute force algorithm
+for analysis of # of iterations of the loop tries to evaluate.
+.IP "\fBhot-bb-count-fraction\fR" 4
+.IX Item "hot-bb-count-fraction"
+Select fraction of the maximal count of repetitions of basic block in program
+given basic block needs to have to be considered hot.
+.IP "\fBhot-bb-frequency-fraction\fR" 4
+.IX Item "hot-bb-frequency-fraction"
+Select fraction of the maximal frequency of executions of basic block in
+function given basic block needs to have to be considered hot
+.IP "\fBmax-predicted-iterations\fR" 4
+.IX Item "max-predicted-iterations"
+The maximum number of loop iterations we predict statically. This is useful
+in cases where function contain single loop with known bound and other loop
+with unknown. We predict the known number of iterations correctly, while
+the unknown number of iterations average to roughly 10. This means that the
+loop without bounds would appear artificially cold relative to the other one.
+.IP "\fBalign-threshold\fR" 4
+.IX Item "align-threshold"
+Select fraction of the maximal frequency of executions of basic block in
+function given basic block will get aligned.
+.IP "\fBalign-loop-iterations\fR" 4
+.IX Item "align-loop-iterations"
+A loop expected to iterate at lest the selected number of iterations will get
+aligned.
+.IP "\fBtracer-dynamic-coverage\fR" 4
+.IX Item "tracer-dynamic-coverage"
+.PD 0
+.IP "\fBtracer-dynamic-coverage-feedback\fR" 4
+.IX Item "tracer-dynamic-coverage-feedback"
+.PD
+This value is used to limit superblock formation once the given percentage of
+executed instructions is covered. This limits unnecessary code size
+expansion.
+.Sp
+The \fBtracer-dynamic-coverage-feedback\fR is used only when profile
+feedback is available. The real profiles (as opposed to statically estimated
+ones) are much less balanced allowing the threshold to be larger value.
+.IP "\fBtracer-max-code-growth\fR" 4
+.IX Item "tracer-max-code-growth"
+Stop tail duplication once code growth has reached given percentage. This is
+rather hokey argument, as most of the duplicates will be eliminated later in
+cross jumping, so it may be set to much higher values than is the desired code
+growth.
+.IP "\fBtracer-min-branch-ratio\fR" 4
+.IX Item "tracer-min-branch-ratio"
+Stop reverse growth when the reverse probability of best edge is less than this
+threshold (in percent).
+.IP "\fBtracer-min-branch-ratio\fR" 4
+.IX Item "tracer-min-branch-ratio"
+.PD 0
+.IP "\fBtracer-min-branch-ratio-feedback\fR" 4
+.IX Item "tracer-min-branch-ratio-feedback"
+.PD
+Stop forward growth if the best edge do have probability lower than this
+threshold.
+.Sp
+Similarly to \fBtracer-dynamic-coverage\fR two values are present, one for
+compilation for profile feedback and one for compilation without. The value
+for compilation with profile feedback needs to be more conservative (higher) in
+order to make tracer effective.
+.IP "\fBmax-cse-path-length\fR" 4
+.IX Item "max-cse-path-length"
+Maximum number of basic blocks on path that cse considers. The default is 10.
+.IP "\fBmax-cse-insns\fR" 4
+.IX Item "max-cse-insns"
+The maximum instructions \s-1CSE\s0 process before flushing. The default is 1000.
+.IP "\fBmax-aliased-vops\fR" 4
+.IX Item "max-aliased-vops"
+Maximum number of virtual operands per function allowed to represent
+aliases before triggering the alias partitioning heuristic. Alias
+partitioning reduces compile times and memory consumption needed for
+aliasing at the expense of precision loss in alias information. The
+default value for this parameter is 100 for \-O1, 500 for \-O2 and 1000
+for \-O3.
+.Sp
+Notice that if a function contains more memory statements than the
+value of this parameter, it is not really possible to achieve this
+reduction. In this case, the compiler will use the number of memory
+statements as the value for \fBmax-aliased-vops\fR.
+.IP "\fBavg-aliased-vops\fR" 4
+.IX Item "avg-aliased-vops"
+Average number of virtual operands per statement allowed to represent
+aliases before triggering the alias partitioning heuristic. This
+works in conjunction with \fBmax-aliased-vops\fR. If a function
+contains more than \fBmax-aliased-vops\fR virtual operators, then
+memory symbols will be grouped into memory partitions until either the
+total number of virtual operators is below \fBmax-aliased-vops\fR
+or the average number of virtual operators per memory statement is
+below \fBavg-aliased-vops\fR. The default value for this parameter
+is 1 for \-O1 and \-O2, and 3 for \-O3.
+.IP "\fBggc-min-expand\fR" 4
+.IX Item "ggc-min-expand"
+\&\s-1GCC\s0 uses a garbage collector to manage its own memory allocation. This
+parameter specifies the minimum percentage by which the garbage
+collector's heap should be allowed to expand between collections.
+Tuning this may improve compilation speed; it has no effect on code
+generation.
+.Sp
+The default is 30% + 70% * (\s-1RAM/1GB\s0) with an upper bound of 100% when
+\&\s-1RAM\s0 >= 1GB. If \f(CW\*(C`getrlimit\*(C'\fR is available, the notion of \*(L"\s-1RAM\s0\*(R" is
+the smallest of actual \s-1RAM\s0 and \f(CW\*(C`RLIMIT_DATA\*(C'\fR or \f(CW\*(C`RLIMIT_AS\*(C'\fR. If
+\&\s-1GCC\s0 is not able to calculate \s-1RAM\s0 on a particular platform, the lower
+bound of 30% is used. Setting this parameter and
+\&\fBggc-min-heapsize\fR to zero causes a full collection to occur at
+every opportunity. This is extremely slow, but can be useful for
+debugging.
+.IP "\fBggc-min-heapsize\fR" 4
+.IX Item "ggc-min-heapsize"
+Minimum size of the garbage collector's heap before it begins bothering
+to collect garbage. The first collection occurs after the heap expands
+by \fBggc-min-expand\fR% beyond \fBggc-min-heapsize\fR. Again,
+tuning this may improve compilation speed, and has no effect on code
+generation.
+.Sp
+The default is the smaller of \s-1RAM/8\s0, \s-1RLIMIT_RSS\s0, or a limit which
+tries to ensure that \s-1RLIMIT_DATA\s0 or \s-1RLIMIT_AS\s0 are not exceeded, but
+with a lower bound of 4096 (four megabytes) and an upper bound of
+131072 (128 megabytes). If \s-1GCC\s0 is not able to calculate \s-1RAM\s0 on a
+particular platform, the lower bound is used. Setting this parameter
+very large effectively disables garbage collection. Setting this
+parameter and \fBggc-min-expand\fR to zero causes a full collection
+to occur at every opportunity.
+.IP "\fBmax-reload-search-insns\fR" 4
+.IX Item "max-reload-search-insns"
+The maximum number of instruction reload should look backward for equivalent
+register. Increasing values mean more aggressive optimization, making the
+compile time increase with probably slightly better performance. The default
+value is 100.
+.IP "\fBmax-cselib-memory-locations\fR" 4
+.IX Item "max-cselib-memory-locations"
+The maximum number of memory locations cselib should take into account.
+Increasing values mean more aggressive optimization, making the compile time
+increase with probably slightly better performance. The default value is 500.
+.IP "\fBreorder-blocks-duplicate\fR" 4
+.IX Item "reorder-blocks-duplicate"
+.PD 0
+.IP "\fBreorder-blocks-duplicate-feedback\fR" 4
+.IX Item "reorder-blocks-duplicate-feedback"
+.PD
+Used by basic block reordering pass to decide whether to use unconditional
+branch or duplicate the code on its destination. Code is duplicated when its
+estimated size is smaller than this value multiplied by the estimated size of
+unconditional jump in the hot spots of the program.
+.Sp
+The \fBreorder-block-duplicate-feedback\fR is used only when profile
+feedback is available and may be set to higher values than
+\&\fBreorder-block-duplicate\fR since information about the hot spots is more
+accurate.
+.IP "\fBmax-sched-ready-insns\fR" 4
+.IX Item "max-sched-ready-insns"
+The maximum number of instructions ready to be issued the scheduler should
+consider at any given time during the first scheduling pass. Increasing
+values mean more thorough searches, making the compilation time increase
+with probably little benefit. The default value is 100.
+.IP "\fBmax-sched-region-blocks\fR" 4
+.IX Item "max-sched-region-blocks"
+The maximum number of blocks in a region to be considered for
+interblock scheduling. The default value is 10.
+.IP "\fBmax-pipeline-region-blocks\fR" 4
+.IX Item "max-pipeline-region-blocks"
+The maximum number of blocks in a region to be considered for
+pipelining in the selective scheduler. The default value is 15.
+.IP "\fBmax-sched-region-insns\fR" 4
+.IX Item "max-sched-region-insns"
+The maximum number of insns in a region to be considered for
+interblock scheduling. The default value is 100.
+.IP "\fBmax-pipeline-region-insns\fR" 4
+.IX Item "max-pipeline-region-insns"
+The maximum number of insns in a region to be considered for
+pipelining in the selective scheduler. The default value is 200.
+.IP "\fBmin-spec-prob\fR" 4
+.IX Item "min-spec-prob"
+The minimum probability (in percents) of reaching a source block
+for interblock speculative scheduling. The default value is 40.
+.IP "\fBmax-sched-extend-regions-iters\fR" 4
+.IX Item "max-sched-extend-regions-iters"
+The maximum number of iterations through \s-1CFG\s0 to extend regions.
+0 \- disable region extension,
+N \- do at most N iterations.
+The default value is 0.
+.IP "\fBmax-sched-insn-conflict-delay\fR" 4
+.IX Item "max-sched-insn-conflict-delay"
+The maximum conflict delay for an insn to be considered for speculative motion.
+The default value is 3.
+.IP "\fBsched-spec-prob-cutoff\fR" 4
+.IX Item "sched-spec-prob-cutoff"
+The minimal probability of speculation success (in percents), so that
+speculative insn will be scheduled.
+The default value is 40.
+.IP "\fBsched-mem-true-dep-cost\fR" 4
+.IX Item "sched-mem-true-dep-cost"
+Minimal distance (in \s-1CPU\s0 cycles) between store and load targeting same
+memory locations. The default value is 1.
+.IP "\fBselsched-max-lookahead\fR" 4
+.IX Item "selsched-max-lookahead"
+The maximum size of the lookahead window of selective scheduling. It is a
+depth of search for available instructions.
+The default value is 50.
+.IP "\fBselsched-max-sched-times\fR" 4
+.IX Item "selsched-max-sched-times"
+The maximum number of times that an instruction will be scheduled during
+selective scheduling. This is the limit on the number of iterations
+through which the instruction may be pipelined. The default value is 2.
+.IP "\fBselsched-max-insns-to-rename\fR" 4
+.IX Item "selsched-max-insns-to-rename"
+The maximum number of best instructions in the ready list that are considered
+for renaming in the selective scheduler. The default value is 2.
+.IP "\fBmax-last-value-rtl\fR" 4
+.IX Item "max-last-value-rtl"
+The maximum size measured as number of RTLs that can be recorded in an expression
+in combiner for a pseudo register as last known value of that register. The default
+is 10000.
+.IP "\fBinteger-share-limit\fR" 4
+.IX Item "integer-share-limit"
+Small integer constants can use a shared data structure, reducing the
+compiler's memory usage and increasing its speed. This sets the maximum
+value of a shared integer constant. The default value is 256.
+.IP "\fBmin-virtual-mappings\fR" 4
+.IX Item "min-virtual-mappings"
+Specifies the minimum number of virtual mappings in the incremental
+\&\s-1SSA\s0 updater that should be registered to trigger the virtual mappings
+heuristic defined by virtual-mappings-ratio. The default value is
+100.
+.IP "\fBvirtual-mappings-ratio\fR" 4
+.IX Item "virtual-mappings-ratio"
+If the number of virtual mappings is virtual-mappings-ratio bigger
+than the number of virtual symbols to be updated, then the incremental
+\&\s-1SSA\s0 updater switches to a full update for those symbols. The default
+ratio is 3.
+.IP "\fBssp-buffer-size\fR" 4
+.IX Item "ssp-buffer-size"
+The minimum size of buffers (i.e. arrays) that will receive stack smashing
+protection when \fB\-fstack\-protection\fR is used.
+.IP "\fBmax-jump-thread-duplication-stmts\fR" 4
+.IX Item "max-jump-thread-duplication-stmts"
+Maximum number of statements allowed in a block that needs to be
+duplicated when threading jumps.
+.IP "\fBmax-fields-for-field-sensitive\fR" 4
+.IX Item "max-fields-for-field-sensitive"
+Maximum number of fields in a structure we will treat in
+a field sensitive manner during pointer analysis. The default is zero
+for \-O0, and \-O1 and 100 for \-Os, \-O2, and \-O3.
+.IP "\fBprefetch-latency\fR" 4
+.IX Item "prefetch-latency"
+Estimate on average number of instructions that are executed before
+prefetch finishes. The distance we prefetch ahead is proportional
+to this constant. Increasing this number may also lead to less
+streams being prefetched (see \fBsimultaneous-prefetches\fR).
+.IP "\fBsimultaneous-prefetches\fR" 4
+.IX Item "simultaneous-prefetches"
+Maximum number of prefetches that can run at the same time.
+.IP "\fBl1\-cache\-line\-size\fR" 4
+.IX Item "l1-cache-line-size"
+The size of cache line in L1 cache, in bytes.
+.IP "\fBl1\-cache\-size\fR" 4
+.IX Item "l1-cache-size"
+The size of L1 cache, in kilobytes.
+.IP "\fBl2\-cache\-size\fR" 4
+.IX Item "l2-cache-size"
+The size of L2 cache, in kilobytes.
+.IP "\fBuse-canonical-types\fR" 4
+.IX Item "use-canonical-types"
+Whether the compiler should use the \*(L"canonical\*(R" type system. By
+default, this should always be 1, which uses a more efficient internal
+mechanism for comparing types in \*(C+ and Objective\-\*(C+. However, if
+bugs in the canonical type system are causing compilation failures,
+set this value to 0 to disable canonical types.
+.IP "\fBswitch-conversion-max-branch-ratio\fR" 4
+.IX Item "switch-conversion-max-branch-ratio"
+Switch initialization conversion will refuse to create arrays that are
+bigger than \fBswitch-conversion-max-branch-ratio\fR times the number of
+branches in the switch.
+.IP "\fBmax-partial-antic-length\fR" 4
+.IX Item "max-partial-antic-length"
+Maximum length of the partial antic set computed during the tree
+partial redundancy elimination optimization (\fB\-ftree\-pre\fR) when
+optimizing at \fB\-O3\fR and above. For some sorts of source code
+the enhanced partial redundancy elimination optimization can run away,
+consuming all of the memory available on the host machine. This
+parameter sets a limit on the length of the sets that are computed,
+which prevents the runaway behavior. Setting a value of 0 for
+this parameter will allow an unlimited set length.
+.IP "\fBsccvn-max-scc-size\fR" 4
+.IX Item "sccvn-max-scc-size"
+Maximum size of a strongly connected component (\s-1SCC\s0) during \s-1SCCVN\s0
+processing. If this limit is hit, \s-1SCCVN\s0 processing for the whole
+function will not be done and optimizations depending on it will
+be disabled. The default maximum \s-1SCC\s0 size is 10000.
+.IP "\fBira-max-loops-num\fR" 4
+.IX Item "ira-max-loops-num"
+\&\s-1IRA\s0 uses a regional register allocation by default. If a function
+contains loops more than number given by the parameter, only at most
+given number of the most frequently executed loops will form regions
+for the regional register allocation. The default value of the
+parameter is 100.
+.IP "\fBira-max-conflict-table-size\fR" 4
+.IX Item "ira-max-conflict-table-size"
+Although \s-1IRA\s0 uses a sophisticated algorithm of compression conflict
+table, the table can be still big for huge functions. If the conflict
+table for a function could be more than size in \s-1MB\s0 given by the
+parameter, the conflict table is not built and faster, simpler, and
+lower quality register allocation algorithm will be used. The
+algorithm do not use pseudo-register conflicts. The default value of
+the parameter is 2000.
+.IP "\fBloop-invariant-max-bbs-in-loop\fR" 4
+.IX Item "loop-invariant-max-bbs-in-loop"
+Loop invariant motion can be very expensive, both in compile time and
+in amount of needed compile time memory, with very large loops. Loops
+with more basic blocks than this parameter won't have loop invariant
+motion optimization performed on them. The default value of the
+parameter is 1000 for \-O1 and 10000 for \-O2 and above.
+.RE
+.RS 4
+.RE
+.Sh "Options Controlling the Preprocessor"
+.IX Subsection "Options Controlling the Preprocessor"
+These options control the C preprocessor, which is run on each C source
+file before actual compilation.
+.PP
+If you use the \fB\-E\fR option, nothing is done except preprocessing.
+Some of these options make sense only together with \fB\-E\fR because
+they cause the preprocessor output to be unsuitable for actual
+compilation.
+.Sp
+.RS 4
+You can use \fB\-Wp,\fR\fIoption\fR to bypass the compiler driver
+and pass \fIoption\fR directly through to the preprocessor. If
+\&\fIoption\fR contains commas, it is split into multiple options at the
+commas. However, many options are modified, translated or interpreted
+by the compiler driver before being passed to the preprocessor, and
+\&\fB\-Wp\fR forcibly bypasses this phase. The preprocessor's direct
+interface is undocumented and subject to change, so whenever possible
+you should avoid using \fB\-Wp\fR and let the driver handle the
+options instead.
+.Sp
+\&\fB\-Xpreprocessor\fR \fIoption\fR
+.Sp
+Pass \fIoption\fR as an option to the preprocessor. You can use this to
+supply system-specific preprocessor options which \s-1GCC\s0 does not know how to
+recognize.
+.Sp
+If you want to pass an option that takes an argument, you must use
+\&\fB\-Xpreprocessor\fR twice, once for the option and once for the argument.
+.RE
+.IP "\fB\-D\fR \fIname\fR" 4
+.IX Item "-D name"
+Predefine \fIname\fR as a macro, with definition \f(CW1\fR.
+.IP "\fB\-D\fR \fIname\fR\fB=\fR\fIdefinition\fR" 4
+.IX Item "-D name=definition"
+The contents of \fIdefinition\fR are tokenized and processed as if
+they appeared during translation phase three in a \fB#define\fR
+directive. In particular, the definition will be truncated by
+embedded newline characters.
+.Sp
+If you are invoking the preprocessor from a shell or shell-like
+program you may need to use the shell's quoting syntax to protect
+characters such as spaces that have a meaning in the shell syntax.
+.Sp
+If you wish to define a function-like macro on the command line, write
+its argument list with surrounding parentheses before the equals sign
+(if any). Parentheses are meaningful to most shells, so you will need
+to quote the option. With \fBsh\fR and \fBcsh\fR,
+\&\fB\-D'\fR\fIname\fR\fB(\fR\fIargs...\fR\fB)=\fR\fIdefinition\fR\fB'\fR works.
+.Sp
+\&\fB\-D\fR and \fB\-U\fR options are processed in the order they
+are given on the command line. All \fB\-imacros\fR \fIfile\fR and
+\&\fB\-include\fR \fIfile\fR options are processed after all
+\&\fB\-D\fR and \fB\-U\fR options.
+.IP "\fB\-U\fR \fIname\fR" 4
+.IX Item "-U name"
+Cancel any previous definition of \fIname\fR, either built in or
+provided with a \fB\-D\fR option.
+.IP "\fB\-undef\fR" 4
+.IX Item "-undef"
+Do not predefine any system-specific or GCC-specific macros. The
+standard predefined macros remain defined.
+.IP "\fB\-I\fR \fIdir\fR" 4
+.IX Item "-I dir"
+Add the directory \fIdir\fR to the list of directories to be searched
+for header files.
+Directories named by \fB\-I\fR are searched before the standard
+system include directories. If the directory \fIdir\fR is a standard
+system include directory, the option is ignored to ensure that the
+default search order for system directories and the special treatment
+of system headers are not defeated
+\&.
+If \fIdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced
+by the sysroot prefix; see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
+.IP "\fB\-o\fR \fIfile\fR" 4
+.IX Item "-o file"
+Write output to \fIfile\fR. This is the same as specifying \fIfile\fR
+as the second non-option argument to \fBcpp\fR. \fBgcc\fR has a
+different interpretation of a second non-option argument, so you must
+use \fB\-o\fR to specify the output file.
+.IP "\fB\-Wall\fR" 4
+.IX Item "-Wall"
+Turns on all optional warnings which are desirable for normal code.
+At present this is \fB\-Wcomment\fR, \fB\-Wtrigraphs\fR,
+\&\fB\-Wmultichar\fR and a warning about integer promotion causing a
+change of sign in \f(CW\*(C`#if\*(C'\fR expressions. Note that many of the
+preprocessor's warnings are on by default and have no options to
+control them.
+.IP "\fB\-Wcomment\fR" 4
+.IX Item "-Wcomment"
+.PD 0
+.IP "\fB\-Wcomments\fR" 4
+.IX Item "-Wcomments"
+.PD
+Warn whenever a comment-start sequence \fB/*\fR appears in a \fB/*\fR
+comment, or whenever a backslash-newline appears in a \fB//\fR comment.
+(Both forms have the same effect.)
+.IP "\fB\-Wtrigraphs\fR" 4
+.IX Item "-Wtrigraphs"
+Most trigraphs in comments cannot affect the meaning of the program.
+However, a trigraph that would form an escaped newline (\fB??/\fR at
+the end of a line) can, by changing where the comment begins or ends.
+Therefore, only trigraphs that would form escaped newlines produce
+warnings inside a comment.
+.Sp
+This option is implied by \fB\-Wall\fR. If \fB\-Wall\fR is not
+given, this option is still enabled unless trigraphs are enabled. To
+get trigraph conversion without warnings, but get the other
+\&\fB\-Wall\fR warnings, use \fB\-trigraphs \-Wall \-Wno\-trigraphs\fR.
+.IP "\fB\-Wtraditional\fR" 4
+.IX Item "-Wtraditional"
+Warn about certain constructs that behave differently in traditional and
+\&\s-1ISO\s0 C. Also warn about \s-1ISO\s0 C constructs that have no traditional C
+equivalent, and problematic constructs which should be avoided.
+.IP "\fB\-Wundef\fR" 4
+.IX Item "-Wundef"
+Warn whenever an identifier which is not a macro is encountered in an
+\&\fB#if\fR directive, outside of \fBdefined\fR. Such identifiers are
+replaced with zero.
+.IP "\fB\-Wunused\-macros\fR" 4
+.IX Item "-Wunused-macros"
+Warn about macros defined in the main file that are unused. A macro
+is \fIused\fR if it is expanded or tested for existence at least once.
+The preprocessor will also warn if the macro has not been used at the
+time it is redefined or undefined.
+.Sp
+Built-in macros, macros defined on the command line, and macros
+defined in include files are not warned about.
+.Sp
+\&\fINote:\fR If a macro is actually used, but only used in skipped
+conditional blocks, then \s-1CPP\s0 will report it as unused. To avoid the
+warning in such a case, you might improve the scope of the macro's
+definition by, for example, moving it into the first skipped block.
+Alternatively, you could provide a dummy use with something like:
+.Sp
+.Vb 2
+\& #if defined the_macro_causing_the_warning
+\& #endif
+.Ve
+.IP "\fB\-Wendif\-labels\fR" 4
+.IX Item "-Wendif-labels"
+Warn whenever an \fB#else\fR or an \fB#endif\fR are followed by text.
+This usually happens in code of the form
+.Sp
+.Vb 5
+\& #if FOO
+\& ...
+\& #else FOO
+\& ...
+\& #endif FOO
+.Ve
+.Sp
+The second and third \f(CW\*(C`FOO\*(C'\fR should be in comments, but often are not
+in older programs. This warning is on by default.
+.IP "\fB\-Werror\fR" 4
+.IX Item "-Werror"
+Make all warnings into hard errors. Source code which triggers warnings
+will be rejected.
+.IP "\fB\-Wsystem\-headers\fR" 4
+.IX Item "-Wsystem-headers"
+Issue warnings for code in system headers. These are normally unhelpful
+in finding bugs in your own code, therefore suppressed. If you are
+responsible for the system library, you may want to see them.
+.IP "\fB\-w\fR" 4
+.IX Item "-w"
+Suppress all warnings, including those which \s-1GNU\s0 \s-1CPP\s0 issues by default.
+.IP "\fB\-pedantic\fR" 4
+.IX Item "-pedantic"
+Issue all the mandatory diagnostics listed in the C standard. Some of
+them are left out by default, since they trigger frequently on harmless
+code.
+.IP "\fB\-pedantic\-errors\fR" 4
+.IX Item "-pedantic-errors"
+Issue all the mandatory diagnostics, and make all mandatory diagnostics
+into errors. This includes mandatory diagnostics that \s-1GCC\s0 issues
+without \fB\-pedantic\fR but treats as warnings.
+.IP "\fB\-M\fR" 4
+.IX Item "-M"
+Instead of outputting the result of preprocessing, output a rule
+suitable for \fBmake\fR describing the dependencies of the main
+source file. The preprocessor outputs one \fBmake\fR rule containing
+the object file name for that source file, a colon, and the names of all
+the included files, including those coming from \fB\-include\fR or
+\&\fB\-imacros\fR command line options.
+.Sp
+Unless specified explicitly (with \fB\-MT\fR or \fB\-MQ\fR), the
+object file name consists of the name of the source file with any
+suffix replaced with object file suffix and with any leading directory
+parts removed. If there are many included files then the rule is
+split into several lines using \fB\e\fR\-newline. The rule has no
+commands.
+.Sp
+This option does not suppress the preprocessor's debug output, such as
+\&\fB\-dM\fR. To avoid mixing such debug output with the dependency
+rules you should explicitly specify the dependency output file with
+\&\fB\-MF\fR, or use an environment variable like
+\&\fB\s-1DEPENDENCIES_OUTPUT\s0\fR. Debug output
+will still be sent to the regular output stream as normal.
+.Sp
+Passing \fB\-M\fR to the driver implies \fB\-E\fR, and suppresses
+warnings with an implicit \fB\-w\fR.
+.IP "\fB\-MM\fR" 4
+.IX Item "-MM"
+Like \fB\-M\fR but do not mention header files that are found in
+system header directories, nor header files that are included,
+directly or indirectly, from such a header.
+.Sp
+This implies that the choice of angle brackets or double quotes in an
+\&\fB#include\fR directive does not in itself determine whether that
+header will appear in \fB\-MM\fR dependency output. This is a
+slight change in semantics from \s-1GCC\s0 versions 3.0 and earlier.
+.IP "\fB\-MF\fR \fIfile\fR" 4
+.IX Item "-MF file"
+When used with \fB\-M\fR or \fB\-MM\fR, specifies a
+file to write the dependencies to. If no \fB\-MF\fR switch is given
+the preprocessor sends the rules to the same place it would have sent
+preprocessed output.
+.Sp
+When used with the driver options \fB\-MD\fR or \fB\-MMD\fR,
+\&\fB\-MF\fR overrides the default dependency output file.
+.IP "\fB\-MG\fR" 4
+.IX Item "-MG"
+In conjunction with an option such as \fB\-M\fR requesting
+dependency generation, \fB\-MG\fR assumes missing header files are
+generated files and adds them to the dependency list without raising
+an error. The dependency filename is taken directly from the
+\&\f(CW\*(C`#include\*(C'\fR directive without prepending any path. \fB\-MG\fR
+also suppresses preprocessed output, as a missing header file renders
+this useless.
+.Sp
+This feature is used in automatic updating of makefiles.
+.IP "\fB\-MP\fR" 4
+.IX Item "-MP"
+This option instructs \s-1CPP\s0 to add a phony target for each dependency
+other than the main file, causing each to depend on nothing. These
+dummy rules work around errors \fBmake\fR gives if you remove header
+files without updating the \fIMakefile\fR to match.
+.Sp
+This is typical output:
+.Sp
+.Vb 1
+\& test.o: test.c test.h
+\&
+\& test.h:
+.Ve
+.IP "\fB\-MT\fR \fItarget\fR" 4
+.IX Item "-MT target"
+Change the target of the rule emitted by dependency generation. By
+default \s-1CPP\s0 takes the name of the main input file, deletes any
+directory components and any file suffix such as \fB.c\fR, and
+appends the platform's usual object suffix. The result is the target.
+.Sp
+An \fB\-MT\fR option will set the target to be exactly the string you
+specify. If you want multiple targets, you can specify them as a single
+argument to \fB\-MT\fR, or use multiple \fB\-MT\fR options.
+.Sp
+For example, \fB\-MT\ '$(objpfx)foo.o'\fR might give
+.Sp
+.Vb 1
+\& $(objpfx)foo.o: foo.c
+.Ve
+.IP "\fB\-MQ\fR \fItarget\fR" 4
+.IX Item "-MQ target"
+Same as \fB\-MT\fR, but it quotes any characters which are special to
+Make. \fB\-MQ\ '$(objpfx)foo.o'\fR gives
+.Sp
+.Vb 1
+\& $$(objpfx)foo.o: foo.c
+.Ve
+.Sp
+The default target is automatically quoted, as if it were given with
+\&\fB\-MQ\fR.
+.IP "\fB\-MD\fR" 4
+.IX Item "-MD"
+\&\fB\-MD\fR is equivalent to \fB\-M \-MF\fR \fIfile\fR, except that
+\&\fB\-E\fR is not implied. The driver determines \fIfile\fR based on
+whether an \fB\-o\fR option is given. If it is, the driver uses its
+argument but with a suffix of \fI.d\fR, otherwise it takes the name
+of the input file, removes any directory components and suffix, and
+applies a \fI.d\fR suffix.
+.Sp
+If \fB\-MD\fR is used in conjunction with \fB\-E\fR, any
+\&\fB\-o\fR switch is understood to specify the dependency output file, but if used without \fB\-E\fR, each \fB\-o\fR
+is understood to specify a target object file.
+.Sp
+Since \fB\-E\fR is not implied, \fB\-MD\fR can be used to generate
+a dependency output file as a side-effect of the compilation process.
+.IP "\fB\-MMD\fR" 4
+.IX Item "-MMD"
+Like \fB\-MD\fR except mention only user header files, not system
+header files.
+.IP "\fB\-fpch\-deps\fR" 4
+.IX Item "-fpch-deps"
+When using precompiled headers, this flag
+will cause the dependency-output flags to also list the files from the
+precompiled header's dependencies. If not specified only the
+precompiled header would be listed and not the files that were used to
+create it because those files are not consulted when a precompiled
+header is used.
+.IP "\fB\-fpch\-preprocess\fR" 4
+.IX Item "-fpch-preprocess"
+This option allows use of a precompiled header together with \fB\-E\fR. It inserts a special \f(CW\*(C`#pragma\*(C'\fR,
+\&\f(CW\*(C`#pragma GCC pch_preprocess "<filename>"\*(C'\fR in the output to mark
+the place where the precompiled header was found, and its filename. When
+\&\fB\-fpreprocessed\fR is in use, \s-1GCC\s0 recognizes this \f(CW\*(C`#pragma\*(C'\fR and
+loads the \s-1PCH\s0.
+.Sp
+This option is off by default, because the resulting preprocessed output
+is only really suitable as input to \s-1GCC\s0. It is switched on by
+\&\fB\-save\-temps\fR.
+.Sp
+You should not write this \f(CW\*(C`#pragma\*(C'\fR in your own code, but it is
+safe to edit the filename if the \s-1PCH\s0 file is available in a different
+location. The filename may be absolute or it may be relative to \s-1GCC\s0's
+current directory.
+.IP "\fB\-x c\fR" 4
+.IX Item "-x c"
+.PD 0
+.IP "\fB\-x c++\fR" 4
+.IX Item "-x c++"
+.IP "\fB\-x objective-c\fR" 4
+.IX Item "-x objective-c"
+.IP "\fB\-x assembler-with-cpp\fR" 4
+.IX Item "-x assembler-with-cpp"
+.PD
+Specify the source language: C, \*(C+, Objective-C, or assembly. This has
+nothing to do with standards conformance or extensions; it merely
+selects which base syntax to expect. If you give none of these options,
+cpp will deduce the language from the extension of the source file:
+\&\fB.c\fR, \fB.cc\fR, \fB.m\fR, or \fB.S\fR. Some other common
+extensions for \*(C+ and assembly are also recognized. If cpp does not
+recognize the extension, it will treat the file as C; this is the most
+generic mode.
+.Sp
+\&\fINote:\fR Previous versions of cpp accepted a \fB\-lang\fR option
+which selected both the language and the standards conformance level.
+This option has been removed, because it conflicts with the \fB\-l\fR
+option.
+.IP "\fB\-std=\fR\fIstandard\fR" 4
+.IX Item "-std=standard"
+.PD 0
+.IP "\fB\-ansi\fR" 4
+.IX Item "-ansi"
+.PD
+Specify the standard to which the code should conform. Currently \s-1CPP\s0
+knows about C and \*(C+ standards; others may be added in the future.
+.Sp
+\&\fIstandard\fR
+may be one of:
+.RS 4
+.ie n .IP """iso9899:1990""" 4
+.el .IP "\f(CWiso9899:1990\fR" 4
+.IX Item "iso9899:1990"
+.PD 0
+.ie n .IP """c89""" 4
+.el .IP "\f(CWc89\fR" 4
+.IX Item "c89"
+.PD
+The \s-1ISO\s0 C standard from 1990. \fBc89\fR is the customary shorthand for
+this version of the standard.
+.Sp
+The \fB\-ansi\fR option is equivalent to \fB\-std=c89\fR.
+.ie n .IP """iso9899:199409""" 4
+.el .IP "\f(CWiso9899:199409\fR" 4
+.IX Item "iso9899:199409"
+The 1990 C standard, as amended in 1994.
+.ie n .IP """iso9899:1999""" 4
+.el .IP "\f(CWiso9899:1999\fR" 4
+.IX Item "iso9899:1999"
+.PD 0
+.ie n .IP """c99""" 4
+.el .IP "\f(CWc99\fR" 4
+.IX Item "c99"
+.ie n .IP """iso9899:199x""" 4
+.el .IP "\f(CWiso9899:199x\fR" 4
+.IX Item "iso9899:199x"
+.ie n .IP """c9x""" 4
+.el .IP "\f(CWc9x\fR" 4
+.IX Item "c9x"
+.PD
+The revised \s-1ISO\s0 C standard, published in December 1999. Before
+publication, this was known as C9X.
+.ie n .IP """gnu89""" 4
+.el .IP "\f(CWgnu89\fR" 4
+.IX Item "gnu89"
+The 1990 C standard plus \s-1GNU\s0 extensions. This is the default.
+.ie n .IP """gnu99""" 4
+.el .IP "\f(CWgnu99\fR" 4
+.IX Item "gnu99"
+.PD 0
+.ie n .IP """gnu9x""" 4
+.el .IP "\f(CWgnu9x\fR" 4
+.IX Item "gnu9x"
+.PD
+The 1999 C standard plus \s-1GNU\s0 extensions.
+.ie n .IP """c++98""" 4
+.el .IP "\f(CWc++98\fR" 4
+.IX Item "c++98"
+The 1998 \s-1ISO\s0 \*(C+ standard plus amendments.
+.ie n .IP """gnu++98""" 4
+.el .IP "\f(CWgnu++98\fR" 4
+.IX Item "gnu++98"
+The same as \fB\-std=c++98\fR plus \s-1GNU\s0 extensions. This is the
+default for \*(C+ code.
+.RE
+.RS 4
+.RE
+.IP "\fB\-I\-\fR" 4
+.IX Item "-I-"
+Split the include path. Any directories specified with \fB\-I\fR
+options before \fB\-I\-\fR are searched only for headers requested with
+\&\f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR; they are not searched for
+\&\f(CW\*(C`#include\ <\f(CIfile\f(CW>\*(C'\fR. If additional directories are
+specified with \fB\-I\fR options after the \fB\-I\-\fR, those
+directories are searched for all \fB#include\fR directives.
+.Sp
+In addition, \fB\-I\-\fR inhibits the use of the directory of the current
+file directory as the first search directory for \f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR.
+This option has been deprecated.
+.IP "\fB\-nostdinc\fR" 4
+.IX Item "-nostdinc"
+Do not search the standard system directories for header files.
+Only the directories you have specified with \fB\-I\fR options
+(and the directory of the current file, if appropriate) are searched.
+.IP "\fB\-nostdinc++\fR" 4
+.IX Item "-nostdinc++"
+Do not search for header files in the \*(C+\-specific standard directories,
+but do still search the other standard directories. (This option is
+used when building the \*(C+ library.)
+.IP "\fB\-include\fR \fIfile\fR" 4
+.IX Item "-include file"
+Process \fIfile\fR as if \f(CW\*(C`#include "file"\*(C'\fR appeared as the first
+line of the primary source file. However, the first directory searched
+for \fIfile\fR is the preprocessor's working directory \fIinstead of\fR
+the directory containing the main source file. If not found there, it
+is searched for in the remainder of the \f(CW\*(C`#include "..."\*(C'\fR search
+chain as normal.
+.Sp
+If multiple \fB\-include\fR options are given, the files are included
+in the order they appear on the command line.
+.IP "\fB\-imacros\fR \fIfile\fR" 4
+.IX Item "-imacros file"
+Exactly like \fB\-include\fR, except that any output produced by
+scanning \fIfile\fR is thrown away. Macros it defines remain defined.
+This allows you to acquire all the macros from a header without also
+processing its declarations.
+.Sp
+All files specified by \fB\-imacros\fR are processed before all files
+specified by \fB\-include\fR.
+.IP "\fB\-idirafter\fR \fIdir\fR" 4
+.IX Item "-idirafter dir"
+Search \fIdir\fR for header files, but do it \fIafter\fR all
+directories specified with \fB\-I\fR and the standard system directories
+have been exhausted. \fIdir\fR is treated as a system include directory.
+If \fIdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced
+by the sysroot prefix; see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
+.IP "\fB\-iprefix\fR \fIprefix\fR" 4
+.IX Item "-iprefix prefix"
+Specify \fIprefix\fR as the prefix for subsequent \fB\-iwithprefix\fR
+options. If the prefix represents a directory, you should include the
+final \fB/\fR.
+.IP "\fB\-iwithprefix\fR \fIdir\fR" 4
+.IX Item "-iwithprefix dir"
+.PD 0
+.IP "\fB\-iwithprefixbefore\fR \fIdir\fR" 4
+.IX Item "-iwithprefixbefore dir"
+.PD
+Append \fIdir\fR to the prefix specified previously with
+\&\fB\-iprefix\fR, and add the resulting directory to the include search
+path. \fB\-iwithprefixbefore\fR puts it in the same place \fB\-I\fR
+would; \fB\-iwithprefix\fR puts it where \fB\-idirafter\fR would.
+.IP "\fB\-isysroot\fR \fIdir\fR" 4
+.IX Item "-isysroot dir"
+This option is like the \fB\-\-sysroot\fR option, but applies only to
+header files. See the \fB\-\-sysroot\fR option for more information.
+.IP "\fB\-imultilib\fR \fIdir\fR" 4
+.IX Item "-imultilib dir"
+Use \fIdir\fR as a subdirectory of the directory containing
+target-specific \*(C+ headers.
+.IP "\fB\-isystem\fR \fIdir\fR" 4
+.IX Item "-isystem dir"
+Search \fIdir\fR for header files, after all directories specified by
+\&\fB\-I\fR but before the standard system directories. Mark it
+as a system directory, so that it gets the same special treatment as
+is applied to the standard system directories.
+If \fIdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced
+by the sysroot prefix; see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
+.IP "\fB\-iquote\fR \fIdir\fR" 4
+.IX Item "-iquote dir"
+Search \fIdir\fR only for header files requested with
+\&\f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR; they are not searched for
+\&\f(CW\*(C`#include\ <\f(CIfile\f(CW>\*(C'\fR, before all directories specified by
+\&\fB\-I\fR and before the standard system directories.
+If \fIdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced
+by the sysroot prefix; see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
+.IP "\fB\-fdirectives\-only\fR" 4
+.IX Item "-fdirectives-only"
+When preprocessing, handle directives, but do not expand macros.
+.Sp
+The option's behavior depends on the \fB\-E\fR and \fB\-fpreprocessed\fR
+options.
+.Sp
+With \fB\-E\fR, preprocessing is limited to the handling of directives
+such as \f(CW\*(C`#define\*(C'\fR, \f(CW\*(C`#ifdef\*(C'\fR, and \f(CW\*(C`#error\*(C'\fR. Other
+preprocessor operations, such as macro expansion and trigraph
+conversion are not performed. In addition, the \fB\-dD\fR option is
+implicitly enabled.
+.Sp
+With \fB\-fpreprocessed\fR, predefinition of command line and most
+builtin macros is disabled. Macros such as \f(CW\*(C`_\|_LINE_\|_\*(C'\fR, which are
+contextually dependent, are handled normally. This enables compilation of
+files previously preprocessed with \f(CW\*(C`\-E \-fdirectives\-only\*(C'\fR.
+.Sp
+With both \fB\-E\fR and \fB\-fpreprocessed\fR, the rules for
+\&\fB\-fpreprocessed\fR take precedence. This enables full preprocessing of
+files previously preprocessed with \f(CW\*(C`\-E \-fdirectives\-only\*(C'\fR.
+.IP "\fB\-fdollars\-in\-identifiers\fR" 4
+.IX Item "-fdollars-in-identifiers"
+Accept \fB$\fR in identifiers.
+.IP "\fB\-fextended\-identifiers\fR" 4
+.IX Item "-fextended-identifiers"
+Accept universal character names in identifiers. This option is
+experimental; in a future version of \s-1GCC\s0, it will be enabled by
+default for C99 and \*(C+.
+.IP "\fB\-fpreprocessed\fR" 4
+.IX Item "-fpreprocessed"
+Indicate to the preprocessor that the input file has already been
+preprocessed. This suppresses things like macro expansion, trigraph
+conversion, escaped newline splicing, and processing of most directives.
+The preprocessor still recognizes and removes comments, so that you can
+pass a file preprocessed with \fB\-C\fR to the compiler without
+problems. In this mode the integrated preprocessor is little more than
+a tokenizer for the front ends.
+.Sp
+\&\fB\-fpreprocessed\fR is implicit if the input file has one of the
+extensions \fB.i\fR, \fB.ii\fR or \fB.mi\fR. These are the
+extensions that \s-1GCC\s0 uses for preprocessed files created by
+\&\fB\-save\-temps\fR.
+.IP "\fB\-ftabstop=\fR\fIwidth\fR" 4
+.IX Item "-ftabstop=width"
+Set the distance between tab stops. This helps the preprocessor report
+correct column numbers in warnings or errors, even if tabs appear on the
+line. If the value is less than 1 or greater than 100, the option is
+ignored. The default is 8.
+.IP "\fB\-fexec\-charset=\fR\fIcharset\fR" 4
+.IX Item "-fexec-charset=charset"
+Set the execution character set, used for string and character
+constants. The default is \s-1UTF\-8\s0. \fIcharset\fR can be any encoding
+supported by the system's \f(CW\*(C`iconv\*(C'\fR library routine.
+.IP "\fB\-fwide\-exec\-charset=\fR\fIcharset\fR" 4
+.IX Item "-fwide-exec-charset=charset"
+Set the wide execution character set, used for wide string and
+character constants. The default is \s-1UTF\-32\s0 or \s-1UTF\-16\s0, whichever
+corresponds to the width of \f(CW\*(C`wchar_t\*(C'\fR. As with
+\&\fB\-fexec\-charset\fR, \fIcharset\fR can be any encoding supported
+by the system's \f(CW\*(C`iconv\*(C'\fR library routine; however, you will have
+problems with encodings that do not fit exactly in \f(CW\*(C`wchar_t\*(C'\fR.
+.IP "\fB\-finput\-charset=\fR\fIcharset\fR" 4
+.IX Item "-finput-charset=charset"
+Set the input character set, used for translation from the character
+set of the input file to the source character set used by \s-1GCC\s0. If the
+locale does not specify, or \s-1GCC\s0 cannot get this information from the
+locale, the default is \s-1UTF\-8\s0. This can be overridden by either the locale
+or this command line option. Currently the command line option takes
+precedence if there's a conflict. \fIcharset\fR can be any encoding
+supported by the system's \f(CW\*(C`iconv\*(C'\fR library routine.
+.IP "\fB\-fworking\-directory\fR" 4
+.IX Item "-fworking-directory"
+Enable generation of linemarkers in the preprocessor output that will
+let the compiler know the current working directory at the time of
+preprocessing. When this option is enabled, the preprocessor will
+emit, after the initial linemarker, a second linemarker with the
+current working directory followed by two slashes. \s-1GCC\s0 will use this
+directory, when it's present in the preprocessed input, as the
+directory emitted as the current working directory in some debugging
+information formats. This option is implicitly enabled if debugging
+information is enabled, but this can be inhibited with the negated
+form \fB\-fno\-working\-directory\fR. If the \fB\-P\fR flag is
+present in the command line, this option has no effect, since no
+\&\f(CW\*(C`#line\*(C'\fR directives are emitted whatsoever.
+.IP "\fB\-fno\-show\-column\fR" 4
+.IX Item "-fno-show-column"
+Do not print column numbers in diagnostics. This may be necessary if
+diagnostics are being scanned by a program that does not understand the
+column numbers, such as \fBdejagnu\fR.
+.IP "\fB\-A\fR \fIpredicate\fR\fB=\fR\fIanswer\fR" 4
+.IX Item "-A predicate=answer"
+Make an assertion with the predicate \fIpredicate\fR and answer
+\&\fIanswer\fR. This form is preferred to the older form \fB\-A\fR
+\&\fIpredicate\fR\fB(\fR\fIanswer\fR\fB)\fR, which is still supported, because
+it does not use shell special characters.
+.IP "\fB\-A \-\fR\fIpredicate\fR\fB=\fR\fIanswer\fR" 4
+.IX Item "-A -predicate=answer"
+Cancel an assertion with the predicate \fIpredicate\fR and answer
+\&\fIanswer\fR.
+.IP "\fB\-dCHARS\fR" 4
+.IX Item "-dCHARS"
+\&\fI\s-1CHARS\s0\fR is a sequence of one or more of the following characters,
+and must not be preceded by a space. Other characters are interpreted
+by the compiler proper, or reserved for future versions of \s-1GCC\s0, and so
+are silently ignored. If you specify characters whose behavior
+conflicts, the result is undefined.
+.RS 4
+.IP "\fBM\fR" 4
+.IX Item "M"
+Instead of the normal output, generate a list of \fB#define\fR
+directives for all the macros defined during the execution of the
+preprocessor, including predefined macros. This gives you a way of
+finding out what is predefined in your version of the preprocessor.
+Assuming you have no file \fIfoo.h\fR, the command
+.Sp
+.Vb 1
+\& touch foo.h; cpp \-dM foo.h
+.Ve
+.Sp
+will show all the predefined macros.
+.Sp
+If you use \fB\-dM\fR without the \fB\-E\fR option, \fB\-dM\fR is
+interpreted as a synonym for \fB\-fdump\-rtl\-mach\fR.
+.IP "\fBD\fR" 4
+.IX Item "D"
+Like \fBM\fR except in two respects: it does \fInot\fR include the
+predefined macros, and it outputs \fIboth\fR the \fB#define\fR
+directives and the result of preprocessing. Both kinds of output go to
+the standard output file.
+.IP "\fBN\fR" 4
+.IX Item "N"
+Like \fBD\fR, but emit only the macro names, not their expansions.
+.IP "\fBI\fR" 4
+.IX Item "I"
+Output \fB#include\fR directives in addition to the result of
+preprocessing.
+.IP "\fBU\fR" 4
+.IX Item "U"
+Like \fBD\fR except that only macros that are expanded, or whose
+definedness is tested in preprocessor directives, are output; the
+output is delayed until the use or test of the macro; and
+\&\fB#undef\fR directives are also output for macros tested but
+undefined at the time.
+.RE
+.RS 4
+.RE
+.IP "\fB\-P\fR" 4
+.IX Item "-P"
+Inhibit generation of linemarkers in the output from the preprocessor.
+This might be useful when running the preprocessor on something that is
+not C code, and will be sent to a program which might be confused by the
+linemarkers.
+.IP "\fB\-C\fR" 4
+.IX Item "-C"
+Do not discard comments. All comments are passed through to the output
+file, except for comments in processed directives, which are deleted
+along with the directive.
+.Sp
+You should be prepared for side effects when using \fB\-C\fR; it
+causes the preprocessor to treat comments as tokens in their own right.
+For example, comments appearing at the start of what would be a
+directive line have the effect of turning that line into an ordinary
+source line, since the first token on the line is no longer a \fB#\fR.
+.IP "\fB\-CC\fR" 4
+.IX Item "-CC"
+Do not discard comments, including during macro expansion. This is
+like \fB\-C\fR, except that comments contained within macros are
+also passed through to the output file where the macro is expanded.
+.Sp
+In addition to the side-effects of the \fB\-C\fR option, the
+\&\fB\-CC\fR option causes all \*(C+\-style comments inside a macro
+to be converted to C\-style comments. This is to prevent later use
+of that macro from inadvertently commenting out the remainder of
+the source line.
+.Sp
+The \fB\-CC\fR option is generally used to support lint comments.
+.IP "\fB\-traditional\-cpp\fR" 4
+.IX Item "-traditional-cpp"
+Try to imitate the behavior of old-fashioned C preprocessors, as
+opposed to \s-1ISO\s0 C preprocessors.
+.IP "\fB\-trigraphs\fR" 4
+.IX Item "-trigraphs"
+Process trigraph sequences.
+These are three-character sequences, all starting with \fB??\fR, that
+are defined by \s-1ISO\s0 C to stand for single characters. For example,
+\&\fB??/\fR stands for \fB\e\fR, so \fB'??/n'\fR is a character
+constant for a newline. By default, \s-1GCC\s0 ignores trigraphs, but in
+standard-conforming modes it converts them. See the \fB\-std\fR and
+\&\fB\-ansi\fR options.
+.Sp
+The nine trigraphs and their replacements are
+.Sp
+.Vb 2
+\& Trigraph: ??( ??) ??< ??> ??= ??/ ??\*(Aq ??! ??\-
+\& Replacement: [ ] { } # \e ^ | ~
+.Ve
+.IP "\fB\-remap\fR" 4
+.IX Item "-remap"
+Enable special code to work around file systems which only permit very
+short file names, such as MS-DOS.
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
+.PD 0
+.IP "\fB\-\-target\-help\fR" 4
+.IX Item "--target-help"
+.PD
+Print text describing all the command line options instead of
+preprocessing anything.
+.IP "\fB\-v\fR" 4
+.IX Item "-v"
+Verbose mode. Print out \s-1GNU\s0 \s-1CPP\s0's version number at the beginning of
+execution, and report the final form of the include path.
+.IP "\fB\-H\fR" 4
+.IX Item "-H"
+Print the name of each header file used, in addition to other normal
+activities. Each name is indented to show how deep in the
+\&\fB#include\fR stack it is. Precompiled header files are also
+printed, even if they are found to be invalid; an invalid precompiled
+header file is printed with \fB...x\fR and a valid one with \fB...!\fR .
+.IP "\fB\-version\fR" 4
+.IX Item "-version"
+.PD 0
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+.PD
+Print out \s-1GNU\s0 \s-1CPP\s0's version number. With one dash, proceed to
+preprocess as normal. With two dashes, exit immediately.
+.Sh "Passing Options to the Assembler"
+.IX Subsection "Passing Options to the Assembler"
+You can pass options to the assembler.
+.IP "\fB\-Wa,\fR\fIoption\fR" 4
+.IX Item "-Wa,option"
+Pass \fIoption\fR as an option to the assembler. If \fIoption\fR
+contains commas, it is split into multiple options at the commas.
+.IP "\fB\-Xassembler\fR \fIoption\fR" 4
+.IX Item "-Xassembler option"
+Pass \fIoption\fR as an option to the assembler. You can use this to
+supply system-specific assembler options which \s-1GCC\s0 does not know how to
+recognize.
+.Sp
+If you want to pass an option that takes an argument, you must use
+\&\fB\-Xassembler\fR twice, once for the option and once for the argument.
+.Sh "Options for Linking"
+.IX Subsection "Options for Linking"
+These options come into play when the compiler links object files into
+an executable output file. They are meaningless if the compiler is
+not doing a link step.
+.IP "\fIobject-file-name\fR" 4
+.IX Item "object-file-name"
+A file name that does not end in a special recognized suffix is
+considered to name an object file or library. (Object files are
+distinguished from libraries by the linker according to the file
+contents.) If linking is done, these object files are used as input
+to the linker.
+.IP "\fB\-c\fR" 4
+.IX Item "-c"
+.PD 0
+.IP "\fB\-S\fR" 4
+.IX Item "-S"
+.IP "\fB\-E\fR" 4
+.IX Item "-E"
+.PD
+If any of these options is used, then the linker is not run, and
+object file names should not be used as arguments.
+.IP "\fB\-l\fR\fIlibrary\fR" 4
+.IX Item "-llibrary"
+.PD 0
+.IP "\fB\-l\fR \fIlibrary\fR" 4
+.IX Item "-l library"
+.PD
+Search the library named \fIlibrary\fR when linking. (The second
+alternative with the library as a separate argument is only for
+\&\s-1POSIX\s0 compliance and is not recommended.)
+.Sp
+It makes a difference where in the command you write this option; the
+linker searches and processes libraries and object files in the order they
+are specified. Thus, \fBfoo.o \-lz bar.o\fR searches library \fBz\fR
+after file \fIfoo.o\fR but before \fIbar.o\fR. If \fIbar.o\fR refers
+to functions in \fBz\fR, those functions may not be loaded.
+.Sp
+The linker searches a standard list of directories for the library,
+which is actually a file named \fIlib\fIlibrary\fI.a\fR. The linker
+then uses this file as if it had been specified precisely by name.
+.Sp
+The directories searched include several standard system directories
+plus any that you specify with \fB\-L\fR.
+.Sp
+Normally the files found this way are library files\-\-\-archive files
+whose members are object files. The linker handles an archive file by
+scanning through it for members which define symbols that have so far
+been referenced but not defined. But if the file that is found is an
+ordinary object file, it is linked in the usual fashion. The only
+difference between using an \fB\-l\fR option and specifying a file name
+is that \fB\-l\fR surrounds \fIlibrary\fR with \fBlib\fR and \fB.a\fR
+and searches several directories.
+.IP "\fB\-lobjc\fR" 4
+.IX Item "-lobjc"
+You need this special case of the \fB\-l\fR option in order to
+link an Objective-C or Objective\-\*(C+ program.
+.IP "\fB\-nostartfiles\fR" 4
+.IX Item "-nostartfiles"
+Do not use the standard system startup files when linking.
+The standard system libraries are used normally, unless \fB\-nostdlib\fR
+or \fB\-nodefaultlibs\fR is used.
+.IP "\fB\-nodefaultlibs\fR" 4
+.IX Item "-nodefaultlibs"
+Do not use the standard system libraries when linking.
+Only the libraries you specify will be passed to the linker.
+The standard startup files are used normally, unless \fB\-nostartfiles\fR
+is used. The compiler may generate calls to \f(CW\*(C`memcmp\*(C'\fR,
+\&\f(CW\*(C`memset\*(C'\fR, \f(CW\*(C`memcpy\*(C'\fR and \f(CW\*(C`memmove\*(C'\fR.
+These entries are usually resolved by entries in
+libc. These entry points should be supplied through some other
+mechanism when this option is specified.
+.IP "\fB\-nostdlib\fR" 4
+.IX Item "-nostdlib"
+Do not use the standard system startup files or libraries when linking.
+No startup files and only the libraries you specify will be passed to
+the linker. The compiler may generate calls to \f(CW\*(C`memcmp\*(C'\fR, \f(CW\*(C`memset\*(C'\fR,
+\&\f(CW\*(C`memcpy\*(C'\fR and \f(CW\*(C`memmove\*(C'\fR.
+These entries are usually resolved by entries in
+libc. These entry points should be supplied through some other
+mechanism when this option is specified.
+.Sp
+One of the standard libraries bypassed by \fB\-nostdlib\fR and
+\&\fB\-nodefaultlibs\fR is \fIlibgcc.a\fR, a library of internal subroutines
+that \s-1GCC\s0 uses to overcome shortcomings of particular machines, or special
+needs for some languages.
+.Sp
+In most cases, you need \fIlibgcc.a\fR even when you want to avoid
+other standard libraries. In other words, when you specify \fB\-nostdlib\fR
+or \fB\-nodefaultlibs\fR you should usually specify \fB\-lgcc\fR as well.
+This ensures that you have no unresolved references to internal \s-1GCC\s0
+library subroutines. (For example, \fB_\|_main\fR, used to ensure \*(C+
+constructors will be called.)
+.IP "\fB\-pie\fR" 4
+.IX Item "-pie"
+Produce a position independent executable on targets which support it.
+For predictable results, you must also specify the same set of options
+that were used to generate code (\fB\-fpie\fR, \fB\-fPIE\fR,
+or model suboptions) when you specify this option.
+.IP "\fB\-rdynamic\fR" 4
+.IX Item "-rdynamic"
+Pass the flag \fB\-export\-dynamic\fR to the \s-1ELF\s0 linker, on targets
+that support it. This instructs the linker to add all symbols, not
+only used ones, to the dynamic symbol table. This option is needed
+for some uses of \f(CW\*(C`dlopen\*(C'\fR or to allow obtaining backtraces
+from within a program.
+.IP "\fB\-s\fR" 4
+.IX Item "-s"
+Remove all symbol table and relocation information from the executable.
+.IP "\fB\-static\fR" 4
+.IX Item "-static"
+On systems that support dynamic linking, this prevents linking with the shared
+libraries. On other systems, this option has no effect.
+.IP "\fB\-shared\fR" 4
+.IX Item "-shared"
+Produce a shared object which can then be linked with other objects to
+form an executable. Not all systems support this option. For predictable
+results, you must also specify the same set of options that were used to
+generate code (\fB\-fpic\fR, \fB\-fPIC\fR, or model suboptions)
+when you specify this option.[1]
+.IP "\fB\-shared\-libgcc\fR" 4
+.IX Item "-shared-libgcc"
+.PD 0
+.IP "\fB\-static\-libgcc\fR" 4
+.IX Item "-static-libgcc"
+.PD
+On systems that provide \fIlibgcc\fR as a shared library, these options
+force the use of either the shared or static version respectively.
+If no shared version of \fIlibgcc\fR was built when the compiler was
+configured, these options have no effect.
+.Sp
+There are several situations in which an application should use the
+shared \fIlibgcc\fR instead of the static version. The most common
+of these is when the application wishes to throw and catch exceptions
+across different shared libraries. In that case, each of the libraries
+as well as the application itself should use the shared \fIlibgcc\fR.
+.Sp
+Therefore, the G++ and \s-1GCJ\s0 drivers automatically add
+\&\fB\-shared\-libgcc\fR whenever you build a shared library or a main
+executable, because \*(C+ and Java programs typically use exceptions, so
+this is the right thing to do.
+.Sp
+If, instead, you use the \s-1GCC\s0 driver to create shared libraries, you may
+find that they will not always be linked with the shared \fIlibgcc\fR.
+If \s-1GCC\s0 finds, at its configuration time, that you have a non-GNU linker
+or a \s-1GNU\s0 linker that does not support option \fB\-\-eh\-frame\-hdr\fR,
+it will link the shared version of \fIlibgcc\fR into shared libraries
+by default. Otherwise, it will take advantage of the linker and optimize
+away the linking with the shared version of \fIlibgcc\fR, linking with
+the static version of libgcc by default. This allows exceptions to
+propagate through such shared libraries, without incurring relocation
+costs at library load time.
+.Sp
+However, if a library or main executable is supposed to throw or catch
+exceptions, you must link it using the G++ or \s-1GCJ\s0 driver, as appropriate
+for the languages used in the program, or using the option
+\&\fB\-shared\-libgcc\fR, such that it is linked with the shared
+\&\fIlibgcc\fR.
+.IP "\fB\-symbolic\fR" 4
+.IX Item "-symbolic"
+Bind references to global symbols when building a shared object. Warn
+about any unresolved references (unless overridden by the link editor
+option \fB\-Xlinker \-z \-Xlinker defs\fR). Only a few systems support
+this option.
+.IP "\fB\-T\fR \fIscript\fR" 4
+.IX Item "-T script"
+Use \fIscript\fR as the linker script. This option is supported by most
+systems using the \s-1GNU\s0 linker. On some targets, such as bare-board
+targets without an operating system, the \fB\-T\fR option may be required
+when linking to avoid references to undefined symbols.
+.IP "\fB\-Xlinker\fR \fIoption\fR" 4
+.IX Item "-Xlinker option"
+Pass \fIoption\fR as an option to the linker. You can use this to
+supply system-specific linker options which \s-1GCC\s0 does not know how to
+recognize.
+.Sp
+If you want to pass an option that takes a separate argument, you must use
+\&\fB\-Xlinker\fR twice, once for the option and once for the argument.
+For example, to pass \fB\-assert definitions\fR, you must write
+\&\fB\-Xlinker \-assert \-Xlinker definitions\fR. It does not work to write
+\&\fB\-Xlinker \*(L"\-assert definitions\*(R"\fR, because this passes the entire
+string as a single argument, which is not what the linker expects.
+.Sp
+When using the \s-1GNU\s0 linker, it is usually more convenient to pass
+arguments to linker options using the \fIoption\fR\fB=\fR\fIvalue\fR
+syntax than as separate arguments. For example, you can specify
+\&\fB\-Xlinker \-Map=output.map\fR rather than
+\&\fB\-Xlinker \-Map \-Xlinker output.map\fR. Other linkers may not support
+this syntax for command-line options.
+.IP "\fB\-Wl,\fR\fIoption\fR" 4
+.IX Item "-Wl,option"
+Pass \fIoption\fR as an option to the linker. If \fIoption\fR contains
+commas, it is split into multiple options at the commas. You can use this
+syntax to pass an argument to the option.
+For example, \fB\-Wl,\-Map,output.map\fR passes \fB\-Map output.map\fR to the
+linker. When using the \s-1GNU\s0 linker, you can also get the same effect with
+\&\fB\-Wl,\-Map=output.map\fR.
+.IP "\fB\-u\fR \fIsymbol\fR" 4
+.IX Item "-u symbol"
+Pretend the symbol \fIsymbol\fR is undefined, to force linking of
+library modules to define it. You can use \fB\-u\fR multiple times with
+different symbols to force loading of additional library modules.
+.Sh "Options for Directory Search"
+.IX Subsection "Options for Directory Search"
+These options specify directories to search for header files, for
+libraries and for parts of the compiler:
+.IP "\fB\-I\fR\fIdir\fR" 4
+.IX Item "-Idir"
+Add the directory \fIdir\fR to the head of the list of directories to be
+searched for header files. This can be used to override a system header
+file, substituting your own version, since these directories are
+searched before the system header file directories. However, you should
+not use this option to add directories that contain vendor-supplied
+system header files (use \fB\-isystem\fR for that). If you use more than
+one \fB\-I\fR option, the directories are scanned in left-to-right
+order; the standard system directories come after.
+.Sp
+If a standard system include directory, or a directory specified with
+\&\fB\-isystem\fR, is also specified with \fB\-I\fR, the \fB\-I\fR
+option will be ignored. The directory will still be searched but as a
+system directory at its normal position in the system include chain.
+This is to ensure that \s-1GCC\s0's procedure to fix buggy system headers and
+the ordering for the include_next directive are not inadvertently changed.
+If you really need to change the search order for system directories,
+use the \fB\-nostdinc\fR and/or \fB\-isystem\fR options.
+.IP "\fB\-iquote\fR\fIdir\fR" 4
+.IX Item "-iquotedir"
+Add the directory \fIdir\fR to the head of the list of directories to
+be searched for header files only for the case of \fB#include
+"\fR\fIfile\fR\fB"\fR; they are not searched for \fB#include <\fR\fIfile\fR\fB>\fR,
+otherwise just like \fB\-I\fR.
+.IP "\fB\-L\fR\fIdir\fR" 4
+.IX Item "-Ldir"
+Add directory \fIdir\fR to the list of directories to be searched
+for \fB\-l\fR.
+.IP "\fB\-B\fR\fIprefix\fR" 4
+.IX Item "-Bprefix"
+This option specifies where to find the executables, libraries,
+include files, and data files of the compiler itself.
+.Sp
+The compiler driver program runs one or more of the subprograms
+\&\fIcpp\fR, \fIcc1\fR, \fIas\fR and \fIld\fR. It tries
+\&\fIprefix\fR as a prefix for each program it tries to run, both with and
+without \fImachine\fR\fB/\fR\fIversion\fR\fB/\fR.
+.Sp
+For each subprogram to be run, the compiler driver first tries the
+\&\fB\-B\fR prefix, if any. If that name is not found, or if \fB\-B\fR
+was not specified, the driver tries two standard prefixes, which are
+\&\fI/usr/lib/gcc/\fR and \fI/usr/local/lib/gcc/\fR. If neither of
+those results in a file name that is found, the unmodified program
+name is searched for using the directories specified in your
+\&\fB\s-1PATH\s0\fR environment variable.
+.Sp
+The compiler will check to see if the path provided by the \fB\-B\fR
+refers to a directory, and if necessary it will add a directory
+separator character at the end of the path.
+.Sp
+\&\fB\-B\fR prefixes that effectively specify directory names also apply
+to libraries in the linker, because the compiler translates these
+options into \fB\-L\fR options for the linker. They also apply to
+includes files in the preprocessor, because the compiler translates these
+options into \fB\-isystem\fR options for the preprocessor. In this case,
+the compiler appends \fBinclude\fR to the prefix.
+.Sp
+The run-time support file \fIlibgcc.a\fR can also be searched for using
+the \fB\-B\fR prefix, if needed. If it is not found there, the two
+standard prefixes above are tried, and that is all. The file is left
+out of the link if it is not found by those means.
+.Sp
+Another way to specify a prefix much like the \fB\-B\fR prefix is to use
+the environment variable \fB\s-1GCC_EXEC_PREFIX\s0\fR.
+.Sp
+As a special kludge, if the path provided by \fB\-B\fR is
+\&\fI[dir/]stage\fIN\fI/\fR, where \fIN\fR is a number in the range 0 to
+9, then it will be replaced by \fI[dir/]include\fR. This is to help
+with boot-strapping the compiler.
+.IP "\fB\-specs=\fR\fIfile\fR" 4
+.IX Item "-specs=file"
+Process \fIfile\fR after the compiler reads in the standard \fIspecs\fR
+file, in order to override the defaults that the \fIgcc\fR driver
+program uses when determining what switches to pass to \fIcc1\fR,
+\&\fIcc1plus\fR, \fIas\fR, \fIld\fR, etc. More than one
+\&\fB\-specs=\fR\fIfile\fR can be specified on the command line, and they
+are processed in order, from left to right.
+.IP "\fB\-\-sysroot=\fR\fIdir\fR" 4
+.IX Item "--sysroot=dir"
+Use \fIdir\fR as the logical root directory for headers and libraries.
+For example, if the compiler would normally search for headers in
+\&\fI/usr/include\fR and libraries in \fI/usr/lib\fR, it will instead
+search \fI\fIdir\fI/usr/include\fR and \fI\fIdir\fI/usr/lib\fR.
+.Sp
+If you use both this option and the \fB\-isysroot\fR option, then
+the \fB\-\-sysroot\fR option will apply to libraries, but the
+\&\fB\-isysroot\fR option will apply to header files.
+.Sp
+The \s-1GNU\s0 linker (beginning with version 2.16) has the necessary support
+for this option. If your linker does not support this option, the
+header file aspect of \fB\-\-sysroot\fR will still work, but the
+library aspect will not.
+.IP "\fB\-I\-\fR" 4
+.IX Item "-I-"
+This option has been deprecated. Please use \fB\-iquote\fR instead for
+\&\fB\-I\fR directories before the \fB\-I\-\fR and remove the \fB\-I\-\fR.
+Any directories you specify with \fB\-I\fR options before the \fB\-I\-\fR
+option are searched only for the case of \fB#include "\fR\fIfile\fR\fB"\fR;
+they are not searched for \fB#include <\fR\fIfile\fR\fB>\fR.
+.Sp
+If additional directories are specified with \fB\-I\fR options after
+the \fB\-I\-\fR, these directories are searched for all \fB#include\fR
+directives. (Ordinarily \fIall\fR \fB\-I\fR directories are used
+this way.)
+.Sp
+In addition, the \fB\-I\-\fR option inhibits the use of the current
+directory (where the current input file came from) as the first search
+directory for \fB#include "\fR\fIfile\fR\fB"\fR. There is no way to
+override this effect of \fB\-I\-\fR. With \fB\-I.\fR you can specify
+searching the directory which was current when the compiler was
+invoked. That is not exactly the same as what the preprocessor does
+by default, but it is often satisfactory.
+.Sp
+\&\fB\-I\-\fR does not inhibit the use of the standard system directories
+for header files. Thus, \fB\-I\-\fR and \fB\-nostdinc\fR are
+independent.
+.Sh "Specifying Target Machine and Compiler Version"
+.IX Subsection "Specifying Target Machine and Compiler Version"
+The usual way to run \s-1GCC\s0 is to run the executable called \fIgcc\fR, or
+\&\fI<machine>\-gcc\fR when cross-compiling, or
+\&\fI<machine>\-gcc\-<version>\fR to run a version other than the one that
+was installed last. Sometimes this is inconvenient, so \s-1GCC\s0 provides
+options that will switch to another cross-compiler or version.
+.IP "\fB\-b\fR \fImachine\fR" 4
+.IX Item "-b machine"
+The argument \fImachine\fR specifies the target machine for compilation.
+.Sp
+The value to use for \fImachine\fR is the same as was specified as the
+machine type when configuring \s-1GCC\s0 as a cross-compiler. For
+example, if a cross-compiler was configured with \fBconfigure
+arm-elf\fR, meaning to compile for an arm processor with elf binaries,
+then you would specify \fB\-b arm-elf\fR to run that cross compiler.
+Because there are other options beginning with \fB\-b\fR, the
+configuration must contain a hyphen, or \fB\-b\fR alone should be one
+argument followed by the configuration in the next argument.
+.IP "\fB\-V\fR \fIversion\fR" 4
+.IX Item "-V version"
+The argument \fIversion\fR specifies which version of \s-1GCC\s0 to run.
+This is useful when multiple versions are installed. For example,
+\&\fIversion\fR might be \fB4.0\fR, meaning to run \s-1GCC\s0 version 4.0.
+.PP
+The \fB\-V\fR and \fB\-b\fR options work by running the
+\&\fI<machine>\-gcc\-<version>\fR executable, so there's no real reason to
+use them if you can just run that directly.
+.Sh "Hardware Models and Configurations"
+.IX Subsection "Hardware Models and Configurations"
+Earlier we discussed the standard option \fB\-b\fR which chooses among
+different installed compilers for completely different target
+machines, such as \s-1VAX\s0 vs. 68000 vs. 80386.
+.PP
+In addition, each of these target machine types can have its own
+special options, starting with \fB\-m\fR, to choose among various
+hardware models or configurations\-\-\-for example, 68010 vs 68020,
+floating coprocessor or none. A single installed version of the
+compiler can compile for any model or configuration, according to the
+options specified.
+.PP
+Some configurations of the compiler also support additional special
+options, usually for compatibility with other compilers on the same
+platform.
+.PP
+\fI\s-1ARC\s0 Options\fR
+.IX Subsection "ARC Options"
+.PP
+These options are defined for \s-1ARC\s0 implementations:
+.IP "\fB\-EL\fR" 4
+.IX Item "-EL"
+Compile code for little endian mode. This is the default.
+.IP "\fB\-EB\fR" 4
+.IX Item "-EB"
+Compile code for big endian mode.
+.IP "\fB\-mmangle\-cpu\fR" 4
+.IX Item "-mmangle-cpu"
+Prepend the name of the cpu to all public symbol names.
+In multiple-processor systems, there are many \s-1ARC\s0 variants with different
+instruction and register set characteristics. This flag prevents code
+compiled for one cpu to be linked with code compiled for another.
+No facility exists for handling variants that are \*(L"almost identical\*(R".
+This is an all or nothing option.
+.IP "\fB\-mcpu=\fR\fIcpu\fR" 4
+.IX Item "-mcpu=cpu"
+Compile code for \s-1ARC\s0 variant \fIcpu\fR.
+Which variants are supported depend on the configuration.
+All variants support \fB\-mcpu=base\fR, this is the default.
+.IP "\fB\-mtext=\fR\fItext-section\fR" 4
+.IX Item "-mtext=text-section"
+.PD 0
+.IP "\fB\-mdata=\fR\fIdata-section\fR" 4
+.IX Item "-mdata=data-section"
+.IP "\fB\-mrodata=\fR\fIreadonly-data-section\fR" 4
+.IX Item "-mrodata=readonly-data-section"
+.PD
+Put functions, data, and readonly data in \fItext-section\fR,
+\&\fIdata-section\fR, and \fIreadonly-data-section\fR respectively
+by default. This can be overridden with the \f(CW\*(C`section\*(C'\fR attribute.
+.IP "\fB\-mfix\-cortex\-m3\-ldrd\fR" 4
+.IX Item "-mfix-cortex-m3-ldrd"
+Some Cortex\-M3 cores can cause data corruption when \f(CW\*(C`ldrd\*(C'\fR instructions
+with overlapping destination and base registers are used. This option avoids
+generating these instructions. This option is enabled by default when
+\&\fB\-mcpu=cortex\-m3\fR is specified.
+.PP
+\fI\s-1ARM\s0 Options\fR
+.IX Subsection "ARM Options"
+.PP
+These \fB\-m\fR options are defined for Advanced \s-1RISC\s0 Machines (\s-1ARM\s0)
+architectures:
+.IP "\fB\-mabi=\fR\fIname\fR" 4
+.IX Item "-mabi=name"
+Generate code for the specified \s-1ABI\s0. Permissible values are: \fBapcs-gnu\fR,
+\&\fBatpcs\fR, \fBaapcs\fR, \fBaapcs-linux\fR and \fBiwmmxt\fR.
+.IP "\fB\-mapcs\-frame\fR" 4
+.IX Item "-mapcs-frame"
+Generate a stack frame that is compliant with the \s-1ARM\s0 Procedure Call
+Standard for all functions, even if this is not strictly necessary for
+correct execution of the code. Specifying \fB\-fomit\-frame\-pointer\fR
+with this option will cause the stack frames not to be generated for
+leaf functions. The default is \fB\-mno\-apcs\-frame\fR.
+.IP "\fB\-mapcs\fR" 4
+.IX Item "-mapcs"
+This is a synonym for \fB\-mapcs\-frame\fR.
+.IP "\fB\-mthumb\-interwork\fR" 4
+.IX Item "-mthumb-interwork"
+Generate code which supports calling between the \s-1ARM\s0 and Thumb
+instruction sets. Without this option the two instruction sets cannot
+be reliably used inside one program. The default is
+\&\fB\-mno\-thumb\-interwork\fR, since slightly larger code is generated
+when \fB\-mthumb\-interwork\fR is specified.
+.IP "\fB\-mno\-sched\-prolog\fR" 4
+.IX Item "-mno-sched-prolog"
+Prevent the reordering of instructions in the function prolog, or the
+merging of those instruction with the instructions in the function's
+body. This means that all functions will start with a recognizable set
+of instructions (or in fact one of a choice from a small set of
+different function prologues), and this information can be used to
+locate the start if functions inside an executable piece of code. The
+default is \fB\-msched\-prolog\fR.
+.IP "\fB\-mfloat\-abi=\fR\fIname\fR" 4
+.IX Item "-mfloat-abi=name"
+Specifies which floating-point \s-1ABI\s0 to use. Permissible values
+are: \fBsoft\fR, \fBsoftfp\fR and \fBhard\fR.
+.Sp
+Specifying \fBsoft\fR causes \s-1GCC\s0 to generate output containing
+library calls for floating-point operations.
+\&\fBsoftfp\fR allows the generation of code using hardware floating-point
+instructions, but still uses the soft-float calling conventions.
+\&\fBhard\fR allows generation of floating-point instructions
+and uses FPU-specific calling conventions.
+.Sp
+Using \fB\-mfloat\-abi=hard\fR with \s-1VFP\s0 coprocessors is not supported.
+Use \fB\-mfloat\-abi=softfp\fR with the appropriate \fB\-mfpu\fR option
+to allow the compiler to generate code that makes use of the hardware
+floating-point capabilities for these CPUs.
+.Sp
+The default depends on the specific target configuration. Note that
+the hard-float and soft-float ABIs are not link-compatible; you must
+compile your entire program with the same \s-1ABI\s0, and link with a
+compatible set of libraries.
+.IP "\fB\-mhard\-float\fR" 4
+.IX Item "-mhard-float"
+Equivalent to \fB\-mfloat\-abi=hard\fR.
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+Equivalent to \fB\-mfloat\-abi=soft\fR.
+.IP "\fB\-mlittle\-endian\fR" 4
+.IX Item "-mlittle-endian"
+Generate code for a processor running in little-endian mode. This is
+the default for all standard configurations.
+.IP "\fB\-mbig\-endian\fR" 4
+.IX Item "-mbig-endian"
+Generate code for a processor running in big-endian mode; the default is
+to compile code for a little-endian processor.
+.IP "\fB\-mwords\-little\-endian\fR" 4
+.IX Item "-mwords-little-endian"
+This option only applies when generating code for big-endian processors.
+Generate code for a little-endian word order but a big-endian byte
+order. That is, a byte order of the form \fB32107654\fR. Note: this
+option should only be used if you require compatibility with code for
+big-endian \s-1ARM\s0 processors generated by versions of the compiler prior to
+2.8.
+.IP "\fB\-mcpu=\fR\fIname\fR" 4
+.IX Item "-mcpu=name"
+This specifies the name of the target \s-1ARM\s0 processor. \s-1GCC\s0 uses this name
+to determine what kind of instructions it can emit when generating
+assembly code. Permissible names are: \fBarm2\fR, \fBarm250\fR,
+\&\fBarm3\fR, \fBarm6\fR, \fBarm60\fR, \fBarm600\fR, \fBarm610\fR,
+\&\fBarm620\fR, \fBarm7\fR, \fBarm7m\fR, \fBarm7d\fR, \fBarm7dm\fR,
+\&\fBarm7di\fR, \fBarm7dmi\fR, \fBarm70\fR, \fBarm700\fR,
+\&\fBarm700i\fR, \fBarm710\fR, \fBarm710c\fR, \fBarm7100\fR,
+\&\fBarm720\fR,
+\&\fBarm7500\fR, \fBarm7500fe\fR, \fBarm7tdmi\fR, \fBarm7tdmi\-s\fR,
+\&\fBarm710t\fR, \fBarm720t\fR, \fBarm740t\fR,
+\&\fBstrongarm\fR, \fBstrongarm110\fR, \fBstrongarm1100\fR,
+\&\fBstrongarm1110\fR,
+\&\fBarm8\fR, \fBarm810\fR, \fBarm9\fR, \fBarm9e\fR, \fBarm920\fR,
+\&\fBarm920t\fR, \fBarm922t\fR, \fBarm946e\-s\fR, \fBarm966e\-s\fR,
+\&\fBarm968e\-s\fR, \fBarm926ej\-s\fR, \fBarm940t\fR, \fBarm9tdmi\fR,
+\&\fBarm10tdmi\fR, \fBarm1020t\fR, \fBarm1026ej\-s\fR,
+\&\fBarm10e\fR, \fBarm1020e\fR, \fBarm1022e\fR,
+\&\fBarm1136j\-s\fR, \fBarm1136jf\-s\fR, \fBmpcore\fR, \fBmpcorenovfp\fR,
+\&\fBarm1156t2\-s\fR, \fBarm1176jz\-s\fR, \fBarm1176jzf\-s\fR,
+\&\fBcortex\-a8\fR, \fBcortex\-a9\fR,
+\&\fBcortex\-r4\fR, \fBcortex\-r4f\fR, \fBcortex\-m3\fR,
+\&\fBcortex\-m1\fR,
+\&\fBxscale\fR, \fBiwmmxt\fR, \fBiwmmxt2\fR, \fBep9312\fR.
+.IP "\fB\-mtune=\fR\fIname\fR" 4
+.IX Item "-mtune=name"
+This option is very similar to the \fB\-mcpu=\fR option, except that
+instead of specifying the actual target processor type, and hence
+restricting which instructions can be used, it specifies that \s-1GCC\s0 should
+tune the performance of the code as if the target were of the type
+specified in this option, but still choosing the instructions that it
+will generate based on the cpu specified by a \fB\-mcpu=\fR option.
+For some \s-1ARM\s0 implementations better performance can be obtained by using
+this option.
+.IP "\fB\-march=\fR\fIname\fR" 4
+.IX Item "-march=name"
+This specifies the name of the target \s-1ARM\s0 architecture. \s-1GCC\s0 uses this
+name to determine what kind of instructions it can emit when generating
+assembly code. This option can be used in conjunction with or instead
+of the \fB\-mcpu=\fR option. Permissible names are: \fBarmv2\fR,
+\&\fBarmv2a\fR, \fBarmv3\fR, \fBarmv3m\fR, \fBarmv4\fR, \fBarmv4t\fR,
+\&\fBarmv5\fR, \fBarmv5t\fR, \fBarmv5e\fR, \fBarmv5te\fR,
+\&\fBarmv6\fR, \fBarmv6j\fR,
+\&\fBarmv6t2\fR, \fBarmv6z\fR, \fBarmv6zk\fR, \fBarmv6\-m\fR,
+\&\fBarmv7\fR, \fBarmv7\-a\fR, \fBarmv7\-r\fR, \fBarmv7\-m\fR,
+\&\fBiwmmxt\fR, \fBiwmmxt2\fR, \fBep9312\fR.
+.IP "\fB\-mfpu=\fR\fIname\fR" 4
+.IX Item "-mfpu=name"
+.PD 0
+.IP "\fB\-mfpe=\fR\fInumber\fR" 4
+.IX Item "-mfpe=number"
+.IP "\fB\-mfp=\fR\fInumber\fR" 4
+.IX Item "-mfp=number"
+.PD
+This specifies what floating point hardware (or hardware emulation) is
+available on the target. Permissible names are: \fBfpa\fR, \fBfpe2\fR,
+\&\fBfpe3\fR, \fBmaverick\fR, \fBvfp\fR, \fBvfpv3\fR, \fBvfpv3\-d16\fR and
+\&\fBneon\fR. \fB\-mfp\fR and \fB\-mfpe\fR
+are synonyms for \fB\-mfpu\fR=\fBfpe\fR\fInumber\fR, for compatibility
+with older versions of \s-1GCC\s0.
+.Sp
+If \fB\-msoft\-float\fR is specified this specifies the format of
+floating point values.
+.IP "\fB\-mstructure\-size\-boundary=\fR\fIn\fR" 4
+.IX Item "-mstructure-size-boundary=n"
+The size of all structures and unions will be rounded up to a multiple
+of the number of bits set by this option. Permissible values are 8, 32
+and 64. The default value varies for different toolchains. For the \s-1COFF\s0
+targeted toolchain the default value is 8. A value of 64 is only allowed
+if the underlying \s-1ABI\s0 supports it.
+.Sp
+Specifying the larger number can produce faster, more efficient code, but
+can also increase the size of the program. Different values are potentially
+incompatible. Code compiled with one value cannot necessarily expect to
+work with code or libraries compiled with another value, if they exchange
+information using structures or unions.
+.IP "\fB\-mabort\-on\-noreturn\fR" 4
+.IX Item "-mabort-on-noreturn"
+Generate a call to the function \f(CW\*(C`abort\*(C'\fR at the end of a
+\&\f(CW\*(C`noreturn\*(C'\fR function. It will be executed if the function tries to
+return.
+.IP "\fB\-mlong\-calls\fR" 4
+.IX Item "-mlong-calls"
+.PD 0
+.IP "\fB\-mno\-long\-calls\fR" 4
+.IX Item "-mno-long-calls"
+.PD
+Tells the compiler to perform function calls by first loading the
+address of the function into a register and then performing a subroutine
+call on this register. This switch is needed if the target function
+will lie outside of the 64 megabyte addressing range of the offset based
+version of subroutine call instruction.
+.Sp
+Even if this switch is enabled, not all function calls will be turned
+into long calls. The heuristic is that static functions, functions
+which have the \fBshort-call\fR attribute, functions that are inside
+the scope of a \fB#pragma no_long_calls\fR directive and functions whose
+definitions have already been compiled within the current compilation
+unit, will not be turned into long calls. The exception to this rule is
+that weak function definitions, functions with the \fBlong-call\fR
+attribute or the \fBsection\fR attribute, and functions that are within
+the scope of a \fB#pragma long_calls\fR directive, will always be
+turned into long calls.
+.Sp
+This feature is not enabled by default. Specifying
+\&\fB\-mno\-long\-calls\fR will restore the default behavior, as will
+placing the function calls within the scope of a \fB#pragma
+long_calls_off\fR directive. Note these switches have no effect on how
+the compiler generates code to handle function calls via function
+pointers.
+.IP "\fB\-msingle\-pic\-base\fR" 4
+.IX Item "-msingle-pic-base"
+Treat the register used for \s-1PIC\s0 addressing as read-only, rather than
+loading it in the prologue for each function. The run-time system is
+responsible for initializing this register with an appropriate value
+before execution begins.
+.IP "\fB\-mpic\-register=\fR\fIreg\fR" 4
+.IX Item "-mpic-register=reg"
+Specify the register to be used for \s-1PIC\s0 addressing. The default is R10
+unless stack-checking is enabled, when R9 is used.
+.IP "\fB\-mcirrus\-fix\-invalid\-insns\fR" 4
+.IX Item "-mcirrus-fix-invalid-insns"
+Insert NOPs into the instruction stream to in order to work around
+problems with invalid Maverick instruction combinations. This option
+is only valid if the \fB\-mcpu=ep9312\fR option has been used to
+enable generation of instructions for the Cirrus Maverick floating
+point co-processor. This option is not enabled by default, since the
+problem is only present in older Maverick implementations. The default
+can be re-enabled by use of the \fB\-mno\-cirrus\-fix\-invalid\-insns\fR
+switch.
+.IP "\fB\-mpoke\-function\-name\fR" 4
+.IX Item "-mpoke-function-name"
+Write the name of each function into the text section, directly
+preceding the function prologue. The generated code is similar to this:
+.Sp
+.Vb 9
+\& t0
+\& .ascii "arm_poke_function_name", 0
+\& .align
+\& t1
+\& .word 0xff000000 + (t1 \- t0)
+\& arm_poke_function_name
+\& mov ip, sp
+\& stmfd sp!, {fp, ip, lr, pc}
+\& sub fp, ip, #4
+.Ve
+.Sp
+When performing a stack backtrace, code can inspect the value of
+\&\f(CW\*(C`pc\*(C'\fR stored at \f(CW\*(C`fp + 0\*(C'\fR. If the trace function then looks at
+location \f(CW\*(C`pc \- 12\*(C'\fR and the top 8 bits are set, then we know that
+there is a function name embedded immediately preceding this location
+and has length \f(CW\*(C`((pc[\-3]) & 0xff000000)\*(C'\fR.
+.IP "\fB\-mthumb\fR" 4
+.IX Item "-mthumb"
+Generate code for the Thumb instruction set. The default is to
+use the 32\-bit \s-1ARM\s0 instruction set.
+This option automatically enables either 16\-bit Thumb\-1 or
+mixed 16/32\-bit Thumb\-2 instructions based on the \fB\-mcpu=\fR\fIname\fR
+and \fB\-march=\fR\fIname\fR options.
+.IP "\fB\-mtpcs\-frame\fR" 4
+.IX Item "-mtpcs-frame"
+Generate a stack frame that is compliant with the Thumb Procedure Call
+Standard for all non-leaf functions. (A leaf function is one that does
+not call any other functions.) The default is \fB\-mno\-tpcs\-frame\fR.
+.IP "\fB\-mtpcs\-leaf\-frame\fR" 4
+.IX Item "-mtpcs-leaf-frame"
+Generate a stack frame that is compliant with the Thumb Procedure Call
+Standard for all leaf functions. (A leaf function is one that does
+not call any other functions.) The default is \fB\-mno\-apcs\-leaf\-frame\fR.
+.IP "\fB\-mcallee\-super\-interworking\fR" 4
+.IX Item "-mcallee-super-interworking"
+Gives all externally visible functions in the file being compiled an \s-1ARM\s0
+instruction set header which switches to Thumb mode before executing the
+rest of the function. This allows these functions to be called from
+non-interworking code.
+.IP "\fB\-mcaller\-super\-interworking\fR" 4
+.IX Item "-mcaller-super-interworking"
+Allows calls via function pointers (including virtual functions) to
+execute correctly regardless of whether the target code has been
+compiled for interworking or not. There is a small overhead in the cost
+of executing a function pointer if this option is enabled.
+.IP "\fB\-mtp=\fR\fIname\fR" 4
+.IX Item "-mtp=name"
+Specify the access model for the thread local storage pointer. The valid
+models are \fBsoft\fR, which generates calls to \f(CW\*(C`_\|_aeabi_read_tp\*(C'\fR,
+\&\fBcp15\fR, which fetches the thread pointer from \f(CW\*(C`cp15\*(C'\fR directly
+(supported in the arm6k architecture), and \fBauto\fR, which uses the
+best available method for the selected processor. The default setting is
+\&\fBauto\fR.
+.IP "\fB\-mword\-relocations\fR" 4
+.IX Item "-mword-relocations"
+Only generate absolute relocations on word sized values (i.e. R_ARM_ABS32).
+This is enabled by default on targets (uClinux, SymbianOS) where the runtime
+loader imposes this restriction, and when \fB\-fpic\fR or \fB\-fPIC\fR
+is specified.
+.PP
+\fI\s-1AVR\s0 Options\fR
+.IX Subsection "AVR Options"
+.PP
+These options are defined for \s-1AVR\s0 implementations:
+.IP "\fB\-mmcu=\fR\fImcu\fR" 4
+.IX Item "-mmcu=mcu"
+Specify \s-1ATMEL\s0 \s-1AVR\s0 instruction set or \s-1MCU\s0 type.
+.Sp
+Instruction set avr1 is for the minimal \s-1AVR\s0 core, not supported by the C
+compiler, only for assembler programs (\s-1MCU\s0 types: at90s1200, attiny10,
+attiny11, attiny12, attiny15, attiny28).
+.Sp
+Instruction set avr2 (default) is for the classic \s-1AVR\s0 core with up to
+8K program memory space (\s-1MCU\s0 types: at90s2313, at90s2323, attiny22,
+at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
+at90c8534, at90s8535).
+.Sp
+Instruction set avr3 is for the classic \s-1AVR\s0 core with up to 128K program
+memory space (\s-1MCU\s0 types: atmega103, atmega603, at43usb320, at76c711).
+.Sp
+Instruction set avr4 is for the enhanced \s-1AVR\s0 core with up to 8K program
+memory space (\s-1MCU\s0 types: atmega8, atmega83, atmega85).
+.Sp
+Instruction set avr5 is for the enhanced \s-1AVR\s0 core with up to 128K program
+memory space (\s-1MCU\s0 types: atmega16, atmega161, atmega163, atmega32, atmega323,
+atmega64, atmega128, at43usb355, at94k).
+.IP "\fB\-msize\fR" 4
+.IX Item "-msize"
+Output instruction sizes to the asm file.
+.IP "\fB\-mno\-interrupts\fR" 4
+.IX Item "-mno-interrupts"
+Generated code is not compatible with hardware interrupts.
+Code size will be smaller.
+.IP "\fB\-mcall\-prologues\fR" 4
+.IX Item "-mcall-prologues"
+Functions prologues/epilogues expanded as call to appropriate
+subroutines. Code size will be smaller.
+.IP "\fB\-mno\-tablejump\fR" 4
+.IX Item "-mno-tablejump"
+Do not generate tablejump insns which sometimes increase code size.
+The option is now deprecated in favor of the equivalent
+\&\fB\-fno\-jump\-tables\fR
+.IP "\fB\-mtiny\-stack\fR" 4
+.IX Item "-mtiny-stack"
+Change only the low 8 bits of the stack pointer.
+.IP "\fB\-mint8\fR" 4
+.IX Item "-mint8"
+Assume int to be 8 bit integer. This affects the sizes of all types: A
+char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
+and long long will be 4 bytes. Please note that this option does not
+comply to the C standards, but it will provide you with smaller code
+size.
+.PP
+\fIBlackfin Options\fR
+.IX Subsection "Blackfin Options"
+.IP "\fB\-mcpu=\fR\fIcpu\fR[\fB\-\fR\fIsirevision\fR]" 4
+.IX Item "-mcpu=cpu[-sirevision]"
+Specifies the name of the target Blackfin processor. Currently, \fIcpu\fR
+can be one of \fBbf512\fR, \fBbf514\fR, \fBbf516\fR, \fBbf518\fR,
+\&\fBbf522\fR, \fBbf523\fR, \fBbf524\fR, \fBbf525\fR, \fBbf526\fR,
+\&\fBbf527\fR, \fBbf531\fR, \fBbf532\fR, \fBbf533\fR,
+\&\fBbf534\fR, \fBbf536\fR, \fBbf537\fR, \fBbf538\fR, \fBbf539\fR,
+\&\fBbf542\fR, \fBbf544\fR, \fBbf547\fR, \fBbf548\fR, \fBbf549\fR,
+\&\fBbf561\fR.
+The optional \fIsirevision\fR specifies the silicon revision of the target
+Blackfin processor. Any workarounds available for the targeted silicon revision
+will be enabled. If \fIsirevision\fR is \fBnone\fR, no workarounds are enabled.
+If \fIsirevision\fR is \fBany\fR, all workarounds for the targeted processor
+will be enabled. The \f(CW\*(C`_\|_SILICON_REVISION_\|_\*(C'\fR macro is defined to two
+hexadecimal digits representing the major and minor numbers in the silicon
+revision. If \fIsirevision\fR is \fBnone\fR, the \f(CW\*(C`_\|_SILICON_REVISION_\|_\*(C'\fR
+is not defined. If \fIsirevision\fR is \fBany\fR, the
+\&\f(CW\*(C`_\|_SILICON_REVISION_\|_\*(C'\fR is defined to be \f(CW0xffff\fR.
+If this optional \fIsirevision\fR is not used, \s-1GCC\s0 assumes the latest known
+silicon revision of the targeted Blackfin processor.
+.Sp
+Support for \fBbf561\fR is incomplete. For \fBbf561\fR,
+Only the processor macro is defined.
+Without this option, \fBbf532\fR is used as the processor by default.
+The corresponding predefined processor macros for \fIcpu\fR is to
+be defined. And for \fBbfin-elf\fR toolchain, this causes the hardware \s-1BSP\s0
+provided by libgloss to be linked in if \fB\-msim\fR is not given.
+.IP "\fB\-msim\fR" 4
+.IX Item "-msim"
+Specifies that the program will be run on the simulator. This causes
+the simulator \s-1BSP\s0 provided by libgloss to be linked in. This option
+has effect only for \fBbfin-elf\fR toolchain.
+Certain other options, such as \fB\-mid\-shared\-library\fR and
+\&\fB\-mfdpic\fR, imply \fB\-msim\fR.
+.IP "\fB\-momit\-leaf\-frame\-pointer\fR" 4
+.IX Item "-momit-leaf-frame-pointer"
+Don't keep the frame pointer in a register for leaf functions. This
+avoids the instructions to save, set up and restore frame pointers and
+makes an extra register available in leaf functions. The option
+\&\fB\-fomit\-frame\-pointer\fR removes the frame pointer for all functions
+which might make debugging harder.
+.IP "\fB\-mspecld\-anomaly\fR" 4
+.IX Item "-mspecld-anomaly"
+When enabled, the compiler will ensure that the generated code does not
+contain speculative loads after jump instructions. If this option is used,
+\&\f(CW\*(C`_\|_WORKAROUND_SPECULATIVE_LOADS\*(C'\fR is defined.
+.IP "\fB\-mno\-specld\-anomaly\fR" 4
+.IX Item "-mno-specld-anomaly"
+Don't generate extra code to prevent speculative loads from occurring.
+.IP "\fB\-mcsync\-anomaly\fR" 4
+.IX Item "-mcsync-anomaly"
+When enabled, the compiler will ensure that the generated code does not
+contain \s-1CSYNC\s0 or \s-1SSYNC\s0 instructions too soon after conditional branches.
+If this option is used, \f(CW\*(C`_\|_WORKAROUND_SPECULATIVE_SYNCS\*(C'\fR is defined.
+.IP "\fB\-mno\-csync\-anomaly\fR" 4
+.IX Item "-mno-csync-anomaly"
+Don't generate extra code to prevent \s-1CSYNC\s0 or \s-1SSYNC\s0 instructions from
+occurring too soon after a conditional branch.
+.IP "\fB\-mlow\-64k\fR" 4
+.IX Item "-mlow-64k"
+When enabled, the compiler is free to take advantage of the knowledge that
+the entire program fits into the low 64k of memory.
+.IP "\fB\-mno\-low\-64k\fR" 4
+.IX Item "-mno-low-64k"
+Assume that the program is arbitrarily large. This is the default.
+.IP "\fB\-mstack\-check\-l1\fR" 4
+.IX Item "-mstack-check-l1"
+Do stack checking using information placed into L1 scratchpad memory by the
+uClinux kernel.
+.IP "\fB\-mid\-shared\-library\fR" 4
+.IX Item "-mid-shared-library"
+Generate code that supports shared libraries via the library \s-1ID\s0 method.
+This allows for execute in place and shared libraries in an environment
+without virtual memory management. This option implies \fB\-fPIC\fR.
+With a \fBbfin-elf\fR target, this option implies \fB\-msim\fR.
+.IP "\fB\-mno\-id\-shared\-library\fR" 4
+.IX Item "-mno-id-shared-library"
+Generate code that doesn't assume \s-1ID\s0 based shared libraries are being used.
+This is the default.
+.IP "\fB\-mleaf\-id\-shared\-library\fR" 4
+.IX Item "-mleaf-id-shared-library"
+Generate code that supports shared libraries via the library \s-1ID\s0 method,
+but assumes that this library or executable won't link against any other
+\&\s-1ID\s0 shared libraries. That allows the compiler to use faster code for jumps
+and calls.
+.IP "\fB\-mno\-leaf\-id\-shared\-library\fR" 4
+.IX Item "-mno-leaf-id-shared-library"
+Do not assume that the code being compiled won't link against any \s-1ID\s0 shared
+libraries. Slower code will be generated for jump and call insns.
+.IP "\fB\-mshared\-library\-id=n\fR" 4
+.IX Item "-mshared-library-id=n"
+Specified the identification number of the \s-1ID\s0 based shared library being
+compiled. Specifying a value of 0 will generate more compact code, specifying
+other values will force the allocation of that number to the current
+library but is no more space or time efficient than omitting this option.
+.IP "\fB\-msep\-data\fR" 4
+.IX Item "-msep-data"
+Generate code that allows the data segment to be located in a different
+area of memory from the text segment. This allows for execute in place in
+an environment without virtual memory management by eliminating relocations
+against the text section.
+.IP "\fB\-mno\-sep\-data\fR" 4
+.IX Item "-mno-sep-data"
+Generate code that assumes that the data segment follows the text segment.
+This is the default.
+.IP "\fB\-mlong\-calls\fR" 4
+.IX Item "-mlong-calls"
+.PD 0
+.IP "\fB\-mno\-long\-calls\fR" 4
+.IX Item "-mno-long-calls"
+.PD
+Tells the compiler to perform function calls by first loading the
+address of the function into a register and then performing a subroutine
+call on this register. This switch is needed if the target function
+will lie outside of the 24 bit addressing range of the offset based
+version of subroutine call instruction.
+.Sp
+This feature is not enabled by default. Specifying
+\&\fB\-mno\-long\-calls\fR will restore the default behavior. Note these
+switches have no effect on how the compiler generates code to handle
+function calls via function pointers.
+.IP "\fB\-mfast\-fp\fR" 4
+.IX Item "-mfast-fp"
+Link with the fast floating-point library. This library relaxes some of
+the \s-1IEEE\s0 floating-point standard's rules for checking inputs against
+Not-a-Number (\s-1NAN\s0), in the interest of performance.
+.IP "\fB\-minline\-plt\fR" 4
+.IX Item "-minline-plt"
+Enable inlining of \s-1PLT\s0 entries in function calls to functions that are
+not known to bind locally. It has no effect without \fB\-mfdpic\fR.
+.IP "\fB\-mmulticore\fR" 4
+.IX Item "-mmulticore"
+Build standalone application for multicore Blackfin processor. Proper
+start files and link scripts will be used to support multicore.
+This option defines \f(CW\*(C`_\|_BFIN_MULTICORE\*(C'\fR. It can only be used with
+\&\fB\-mcpu=bf561\fR[\fB\-\fR\fIsirevision\fR]. It can be used with
+\&\fB\-mcorea\fR or \fB\-mcoreb\fR. If it's used without
+\&\fB\-mcorea\fR or \fB\-mcoreb\fR, single application/dual core
+programming model is used. In this model, the main function of Core B
+should be named as coreb_main. If it's used with \fB\-mcorea\fR or
+\&\fB\-mcoreb\fR, one application per core programming model is used.
+If this option is not used, single core application programming
+model is used.
+.IP "\fB\-mcorea\fR" 4
+.IX Item "-mcorea"
+Build standalone application for Core A of \s-1BF561\s0 when using
+one application per core programming model. Proper start files
+and link scripts will be used to support Core A. This option
+defines \f(CW\*(C`_\|_BFIN_COREA\*(C'\fR. It must be used with \fB\-mmulticore\fR.
+.IP "\fB\-mcoreb\fR" 4
+.IX Item "-mcoreb"
+Build standalone application for Core B of \s-1BF561\s0 when using
+one application per core programming model. Proper start files
+and link scripts will be used to support Core B. This option
+defines \f(CW\*(C`_\|_BFIN_COREB\*(C'\fR. When this option is used, coreb_main
+should be used instead of main. It must be used with
+\&\fB\-mmulticore\fR.
+.IP "\fB\-msdram\fR" 4
+.IX Item "-msdram"
+Build standalone application for \s-1SDRAM\s0. Proper start files and
+link scripts will be used to put the application into \s-1SDRAM\s0.
+Loader should initialize \s-1SDRAM\s0 before loading the application
+into \s-1SDRAM\s0. This option defines \f(CW\*(C`_\|_BFIN_SDRAM\*(C'\fR.
+.IP "\fB\-micplb\fR" 4
+.IX Item "-micplb"
+Assume that ICPLBs are enabled at runtime. This has an effect on certain
+anomaly workarounds. For Linux targets, the default is to assume ICPLBs
+are enabled; for standalone applications the default is off.
+.PP
+\fI\s-1CRIS\s0 Options\fR
+.IX Subsection "CRIS Options"
+.PP
+These options are defined specifically for the \s-1CRIS\s0 ports.
+.IP "\fB\-march=\fR\fIarchitecture-type\fR" 4
+.IX Item "-march=architecture-type"
+.PD 0
+.IP "\fB\-mcpu=\fR\fIarchitecture-type\fR" 4
+.IX Item "-mcpu=architecture-type"
+.PD
+Generate code for the specified architecture. The choices for
+\&\fIarchitecture-type\fR are \fBv3\fR, \fBv8\fR and \fBv10\fR for
+respectively \s-1ETRAX\s0\ 4, \s-1ETRAX\s0\ 100, and \s-1ETRAX\s0\ 100\ \s-1LX\s0.
+Default is \fBv0\fR except for cris-axis-linux-gnu, where the default is
+\&\fBv10\fR.
+.IP "\fB\-mtune=\fR\fIarchitecture-type\fR" 4
+.IX Item "-mtune=architecture-type"
+Tune to \fIarchitecture-type\fR everything applicable about the generated
+code, except for the \s-1ABI\s0 and the set of available instructions. The
+choices for \fIarchitecture-type\fR are the same as for
+\&\fB\-march=\fR\fIarchitecture-type\fR.
+.IP "\fB\-mmax\-stack\-frame=\fR\fIn\fR" 4
+.IX Item "-mmax-stack-frame=n"
+Warn when the stack frame of a function exceeds \fIn\fR bytes.
+.IP "\fB\-metrax4\fR" 4
+.IX Item "-metrax4"
+.PD 0
+.IP "\fB\-metrax100\fR" 4
+.IX Item "-metrax100"
+.PD
+The options \fB\-metrax4\fR and \fB\-metrax100\fR are synonyms for
+\&\fB\-march=v3\fR and \fB\-march=v8\fR respectively.
+.IP "\fB\-mmul\-bug\-workaround\fR" 4
+.IX Item "-mmul-bug-workaround"
+.PD 0
+.IP "\fB\-mno\-mul\-bug\-workaround\fR" 4
+.IX Item "-mno-mul-bug-workaround"
+.PD
+Work around a bug in the \f(CW\*(C`muls\*(C'\fR and \f(CW\*(C`mulu\*(C'\fR instructions for \s-1CPU\s0
+models where it applies. This option is active by default.
+.IP "\fB\-mpdebug\fR" 4
+.IX Item "-mpdebug"
+Enable CRIS-specific verbose debug-related information in the assembly
+code. This option also has the effect to turn off the \fB#NO_APP\fR
+formatted-code indicator to the assembler at the beginning of the
+assembly file.
+.IP "\fB\-mcc\-init\fR" 4
+.IX Item "-mcc-init"
+Do not use condition-code results from previous instruction; always emit
+compare and test instructions before use of condition codes.
+.IP "\fB\-mno\-side\-effects\fR" 4
+.IX Item "-mno-side-effects"
+Do not emit instructions with side-effects in addressing modes other than
+post-increment.
+.IP "\fB\-mstack\-align\fR" 4
+.IX Item "-mstack-align"
+.PD 0
+.IP "\fB\-mno\-stack\-align\fR" 4
+.IX Item "-mno-stack-align"
+.IP "\fB\-mdata\-align\fR" 4
+.IX Item "-mdata-align"
+.IP "\fB\-mno\-data\-align\fR" 4
+.IX Item "-mno-data-align"
+.IP "\fB\-mconst\-align\fR" 4
+.IX Item "-mconst-align"
+.IP "\fB\-mno\-const\-align\fR" 4
+.IX Item "-mno-const-align"
+.PD
+These options (no-options) arranges (eliminate arrangements) for the
+stack-frame, individual data and constants to be aligned for the maximum
+single data access size for the chosen \s-1CPU\s0 model. The default is to
+arrange for 32\-bit alignment. \s-1ABI\s0 details such as structure layout are
+not affected by these options.
+.IP "\fB\-m32\-bit\fR" 4
+.IX Item "-m32-bit"
+.PD 0
+.IP "\fB\-m16\-bit\fR" 4
+.IX Item "-m16-bit"
+.IP "\fB\-m8\-bit\fR" 4
+.IX Item "-m8-bit"
+.PD
+Similar to the stack\- data\- and const-align options above, these options
+arrange for stack-frame, writable data and constants to all be 32\-bit,
+16\-bit or 8\-bit aligned. The default is 32\-bit alignment.
+.IP "\fB\-mno\-prologue\-epilogue\fR" 4
+.IX Item "-mno-prologue-epilogue"
+.PD 0
+.IP "\fB\-mprologue\-epilogue\fR" 4
+.IX Item "-mprologue-epilogue"
+.PD
+With \fB\-mno\-prologue\-epilogue\fR, the normal function prologue and
+epilogue that sets up the stack-frame are omitted and no return
+instructions or return sequences are generated in the code. Use this
+option only together with visual inspection of the compiled code: no
+warnings or errors are generated when call-saved registers must be saved,
+or storage for local variable needs to be allocated.
+.IP "\fB\-mno\-gotplt\fR" 4
+.IX Item "-mno-gotplt"
+.PD 0
+.IP "\fB\-mgotplt\fR" 4
+.IX Item "-mgotplt"
+.PD
+With \fB\-fpic\fR and \fB\-fPIC\fR, don't generate (do generate)
+instruction sequences that load addresses for functions from the \s-1PLT\s0 part
+of the \s-1GOT\s0 rather than (traditional on other architectures) calls to the
+\&\s-1PLT\s0. The default is \fB\-mgotplt\fR.
+.IP "\fB\-melf\fR" 4
+.IX Item "-melf"
+Legacy no-op option only recognized with the cris-axis-elf and
+cris-axis-linux-gnu targets.
+.IP "\fB\-mlinux\fR" 4
+.IX Item "-mlinux"
+Legacy no-op option only recognized with the cris-axis-linux-gnu target.
+.IP "\fB\-sim\fR" 4
+.IX Item "-sim"
+This option, recognized for the cris-axis-elf arranges
+to link with input-output functions from a simulator library. Code,
+initialized data and zero-initialized data are allocated consecutively.
+.IP "\fB\-sim2\fR" 4
+.IX Item "-sim2"
+Like \fB\-sim\fR, but pass linker options to locate initialized data at
+0x40000000 and zero-initialized data at 0x80000000.
+.PP
+\fI\s-1CRX\s0 Options\fR
+.IX Subsection "CRX Options"
+.PP
+These options are defined specifically for the \s-1CRX\s0 ports.
+.IP "\fB\-mmac\fR" 4
+.IX Item "-mmac"
+Enable the use of multiply-accumulate instructions. Disabled by default.
+.IP "\fB\-mpush\-args\fR" 4
+.IX Item "-mpush-args"
+Push instructions will be used to pass outgoing arguments when functions
+are called. Enabled by default.
+.PP
+\fIDarwin Options\fR
+.IX Subsection "Darwin Options"
+.PP
+These options are defined for all architectures running the Darwin operating
+system.
+.PP
+\&\s-1FSF\s0 \s-1GCC\s0 on Darwin does not create \*(L"fat\*(R" object files; it will create
+an object file for the single architecture that it was built to
+target. Apple's \s-1GCC\s0 on Darwin does create \*(L"fat\*(R" files if multiple
+\&\fB\-arch\fR options are used; it does so by running the compiler or
+linker multiple times and joining the results together with
+\&\fIlipo\fR.
+.PP
+The subtype of the file created (like \fBppc7400\fR or \fBppc970\fR or
+\&\fBi686\fR) is determined by the flags that specify the \s-1ISA\s0
+that \s-1GCC\s0 is targetting, like \fB\-mcpu\fR or \fB\-march\fR. The
+\&\fB\-force_cpusubtype_ALL\fR option can be used to override this.
+.PP
+The Darwin tools vary in their behavior when presented with an \s-1ISA\s0
+mismatch. The assembler, \fIas\fR, will only permit instructions to
+be used that are valid for the subtype of the file it is generating,
+so you cannot put 64\-bit instructions in an \fBppc750\fR object file.
+The linker for shared libraries, \fI/usr/bin/libtool\fR, will fail
+and print an error if asked to create a shared library with a less
+restrictive subtype than its input files (for instance, trying to put
+a \fBppc970\fR object file in a \fBppc7400\fR library). The linker
+for executables, \fIld\fR, will quietly give the executable the most
+restrictive subtype of any of its input files.
+.IP "\fB\-F\fR\fIdir\fR" 4
+.IX Item "-Fdir"
+Add the framework directory \fIdir\fR to the head of the list of
+directories to be searched for header files. These directories are
+interleaved with those specified by \fB\-I\fR options and are
+scanned in a left-to-right order.
+.Sp
+A framework directory is a directory with frameworks in it. A
+framework is a directory with a \fB\*(L"Headers\*(R"\fR and/or
+\&\fB\*(L"PrivateHeaders\*(R"\fR directory contained directly in it that ends
+in \fB\*(L".framework\*(R"\fR. The name of a framework is the name of this
+directory excluding the \fB\*(L".framework\*(R"\fR. Headers associated with
+the framework are found in one of those two directories, with
+\&\fB\*(L"Headers\*(R"\fR being searched first. A subframework is a framework
+directory that is in a framework's \fB\*(L"Frameworks\*(R"\fR directory.
+Includes of subframework headers can only appear in a header of a
+framework that contains the subframework, or in a sibling subframework
+header. Two subframeworks are siblings if they occur in the same
+framework. A subframework should not have the same name as a
+framework, a warning will be issued if this is violated. Currently a
+subframework cannot have subframeworks, in the future, the mechanism
+may be extended to support this. The standard frameworks can be found
+in \fB\*(L"/System/Library/Frameworks\*(R"\fR and
+\&\fB\*(L"/Library/Frameworks\*(R"\fR. An example include looks like
+\&\f(CW\*(C`#include <Framework/header.h>\*(C'\fR, where \fBFramework\fR denotes
+the name of the framework and header.h is found in the
+\&\fB\*(L"PrivateHeaders\*(R"\fR or \fB\*(L"Headers\*(R"\fR directory.
+.IP "\fB\-iframework\fR\fIdir\fR" 4
+.IX Item "-iframeworkdir"
+Like \fB\-F\fR except the directory is a treated as a system
+directory. The main difference between this \fB\-iframework\fR and
+\&\fB\-F\fR is that with \fB\-iframework\fR the compiler does not
+warn about constructs contained within header files found via
+\&\fIdir\fR. This option is valid only for the C family of languages.
+.IP "\fB\-gused\fR" 4
+.IX Item "-gused"
+Emit debugging information for symbols that are used. For \s-1STABS\s0
+debugging format, this enables \fB\-feliminate\-unused\-debug\-symbols\fR.
+This is by default \s-1ON\s0.
+.IP "\fB\-gfull\fR" 4
+.IX Item "-gfull"
+Emit debugging information for all symbols and types.
+.IP "\fB\-mmacosx\-version\-min=\fR\fIversion\fR" 4
+.IX Item "-mmacosx-version-min=version"
+The earliest version of MacOS X that this executable will run on
+is \fIversion\fR. Typical values of \fIversion\fR include \f(CW10.1\fR,
+\&\f(CW10.2\fR, and \f(CW10.3.9\fR.
+.Sp
+If the compiler was built to use the system's headers by default,
+then the default for this option is the system version on which the
+compiler is running, otherwise the default is to make choices which
+are compatible with as many systems and code bases as possible.
+.IP "\fB\-mkernel\fR" 4
+.IX Item "-mkernel"
+Enable kernel development mode. The \fB\-mkernel\fR option sets
+\&\fB\-static\fR, \fB\-fno\-common\fR, \fB\-fno\-cxa\-atexit\fR,
+\&\fB\-fno\-exceptions\fR, \fB\-fno\-non\-call\-exceptions\fR,
+\&\fB\-fapple\-kext\fR, \fB\-fno\-weak\fR and \fB\-fno\-rtti\fR where
+applicable. This mode also sets \fB\-mno\-altivec\fR,
+\&\fB\-msoft\-float\fR, \fB\-fno\-builtin\fR and
+\&\fB\-mlong\-branch\fR for PowerPC targets.
+.IP "\fB\-mone\-byte\-bool\fR" 4
+.IX Item "-mone-byte-bool"
+Override the defaults for \fBbool\fR so that \fBsizeof(bool)==1\fR.
+By default \fBsizeof(bool)\fR is \fB4\fR when compiling for
+Darwin/PowerPC and \fB1\fR when compiling for Darwin/x86, so this
+option has no effect on x86.
+.Sp
+\&\fBWarning:\fR The \fB\-mone\-byte\-bool\fR switch causes \s-1GCC\s0
+to generate code that is not binary compatible with code generated
+without that switch. Using this switch may require recompiling all
+other modules in a program, including system libraries. Use this
+switch to conform to a non-default data model.
+.IP "\fB\-mfix\-and\-continue\fR" 4
+.IX Item "-mfix-and-continue"
+.PD 0
+.IP "\fB\-ffix\-and\-continue\fR" 4
+.IX Item "-ffix-and-continue"
+.IP "\fB\-findirect\-data\fR" 4
+.IX Item "-findirect-data"
+.PD
+Generate code suitable for fast turn around development. Needed to
+enable gdb to dynamically load \f(CW\*(C`.o\*(C'\fR files into already running
+programs. \fB\-findirect\-data\fR and \fB\-ffix\-and\-continue\fR
+are provided for backwards compatibility.
+.IP "\fB\-all_load\fR" 4
+.IX Item "-all_load"
+Loads all members of static archive libraries.
+See man \fIld\fR\|(1) for more information.
+.IP "\fB\-arch_errors_fatal\fR" 4
+.IX Item "-arch_errors_fatal"
+Cause the errors having to do with files that have the wrong architecture
+to be fatal.
+.IP "\fB\-bind_at_load\fR" 4
+.IX Item "-bind_at_load"
+Causes the output file to be marked such that the dynamic linker will
+bind all undefined references when the file is loaded or launched.
+.IP "\fB\-bundle\fR" 4
+.IX Item "-bundle"
+Produce a Mach-o bundle format file.
+See man \fIld\fR\|(1) for more information.
+.IP "\fB\-bundle_loader\fR \fIexecutable\fR" 4
+.IX Item "-bundle_loader executable"
+This option specifies the \fIexecutable\fR that will be loading the build
+output file being linked. See man \fIld\fR\|(1) for more information.
+.IP "\fB\-dynamiclib\fR" 4
+.IX Item "-dynamiclib"
+When passed this option, \s-1GCC\s0 will produce a dynamic library instead of
+an executable when linking, using the Darwin \fIlibtool\fR command.
+.IP "\fB\-force_cpusubtype_ALL\fR" 4
+.IX Item "-force_cpusubtype_ALL"
+This causes \s-1GCC\s0's output file to have the \fI\s-1ALL\s0\fR subtype, instead of
+one controlled by the \fB\-mcpu\fR or \fB\-march\fR option.
+.IP "\fB\-allowable_client\fR \fIclient_name\fR" 4
+.IX Item "-allowable_client client_name"
+.PD 0
+.IP "\fB\-client_name\fR" 4
+.IX Item "-client_name"
+.IP "\fB\-compatibility_version\fR" 4
+.IX Item "-compatibility_version"
+.IP "\fB\-current_version\fR" 4
+.IX Item "-current_version"
+.IP "\fB\-dead_strip\fR" 4
+.IX Item "-dead_strip"
+.IP "\fB\-dependency\-file\fR" 4
+.IX Item "-dependency-file"
+.IP "\fB\-dylib_file\fR" 4
+.IX Item "-dylib_file"
+.IP "\fB\-dylinker_install_name\fR" 4
+.IX Item "-dylinker_install_name"
+.IP "\fB\-dynamic\fR" 4
+.IX Item "-dynamic"
+.IP "\fB\-exported_symbols_list\fR" 4
+.IX Item "-exported_symbols_list"
+.IP "\fB\-filelist\fR" 4
+.IX Item "-filelist"
+.IP "\fB\-flat_namespace\fR" 4
+.IX Item "-flat_namespace"
+.IP "\fB\-force_flat_namespace\fR" 4
+.IX Item "-force_flat_namespace"
+.IP "\fB\-headerpad_max_install_names\fR" 4
+.IX Item "-headerpad_max_install_names"
+.IP "\fB\-image_base\fR" 4
+.IX Item "-image_base"
+.IP "\fB\-init\fR" 4
+.IX Item "-init"
+.IP "\fB\-install_name\fR" 4
+.IX Item "-install_name"
+.IP "\fB\-keep_private_externs\fR" 4
+.IX Item "-keep_private_externs"
+.IP "\fB\-multi_module\fR" 4
+.IX Item "-multi_module"
+.IP "\fB\-multiply_defined\fR" 4
+.IX Item "-multiply_defined"
+.IP "\fB\-multiply_defined_unused\fR" 4
+.IX Item "-multiply_defined_unused"
+.IP "\fB\-noall_load\fR" 4
+.IX Item "-noall_load"
+.IP "\fB\-no_dead_strip_inits_and_terms\fR" 4
+.IX Item "-no_dead_strip_inits_and_terms"
+.IP "\fB\-nofixprebinding\fR" 4
+.IX Item "-nofixprebinding"
+.IP "\fB\-nomultidefs\fR" 4
+.IX Item "-nomultidefs"
+.IP "\fB\-noprebind\fR" 4
+.IX Item "-noprebind"
+.IP "\fB\-noseglinkedit\fR" 4
+.IX Item "-noseglinkedit"
+.IP "\fB\-pagezero_size\fR" 4
+.IX Item "-pagezero_size"
+.IP "\fB\-prebind\fR" 4
+.IX Item "-prebind"
+.IP "\fB\-prebind_all_twolevel_modules\fR" 4
+.IX Item "-prebind_all_twolevel_modules"
+.IP "\fB\-private_bundle\fR" 4
+.IX Item "-private_bundle"
+.IP "\fB\-read_only_relocs\fR" 4
+.IX Item "-read_only_relocs"
+.IP "\fB\-sectalign\fR" 4
+.IX Item "-sectalign"
+.IP "\fB\-sectobjectsymbols\fR" 4
+.IX Item "-sectobjectsymbols"
+.IP "\fB\-whyload\fR" 4
+.IX Item "-whyload"
+.IP "\fB\-seg1addr\fR" 4
+.IX Item "-seg1addr"
+.IP "\fB\-sectcreate\fR" 4
+.IX Item "-sectcreate"
+.IP "\fB\-sectobjectsymbols\fR" 4
+.IX Item "-sectobjectsymbols"
+.IP "\fB\-sectorder\fR" 4
+.IX Item "-sectorder"
+.IP "\fB\-segaddr\fR" 4
+.IX Item "-segaddr"
+.IP "\fB\-segs_read_only_addr\fR" 4
+.IX Item "-segs_read_only_addr"
+.IP "\fB\-segs_read_write_addr\fR" 4
+.IX Item "-segs_read_write_addr"
+.IP "\fB\-seg_addr_table\fR" 4
+.IX Item "-seg_addr_table"
+.IP "\fB\-seg_addr_table_filename\fR" 4
+.IX Item "-seg_addr_table_filename"
+.IP "\fB\-seglinkedit\fR" 4
+.IX Item "-seglinkedit"
+.IP "\fB\-segprot\fR" 4
+.IX Item "-segprot"
+.IP "\fB\-segs_read_only_addr\fR" 4
+.IX Item "-segs_read_only_addr"
+.IP "\fB\-segs_read_write_addr\fR" 4
+.IX Item "-segs_read_write_addr"
+.IP "\fB\-single_module\fR" 4
+.IX Item "-single_module"
+.IP "\fB\-static\fR" 4
+.IX Item "-static"
+.IP "\fB\-sub_library\fR" 4
+.IX Item "-sub_library"
+.IP "\fB\-sub_umbrella\fR" 4
+.IX Item "-sub_umbrella"
+.IP "\fB\-twolevel_namespace\fR" 4
+.IX Item "-twolevel_namespace"
+.IP "\fB\-umbrella\fR" 4
+.IX Item "-umbrella"
+.IP "\fB\-undefined\fR" 4
+.IX Item "-undefined"
+.IP "\fB\-unexported_symbols_list\fR" 4
+.IX Item "-unexported_symbols_list"
+.IP "\fB\-weak_reference_mismatches\fR" 4
+.IX Item "-weak_reference_mismatches"
+.IP "\fB\-whatsloaded\fR" 4
+.IX Item "-whatsloaded"
+.PD
+These options are passed to the Darwin linker. The Darwin linker man page
+describes them in detail.
+.PP
+\fI\s-1DEC\s0 Alpha Options\fR
+.IX Subsection "DEC Alpha Options"
+.PP
+These \fB\-m\fR options are defined for the \s-1DEC\s0 Alpha implementations:
+.IP "\fB\-mno\-soft\-float\fR" 4
+.IX Item "-mno-soft-float"
+.PD 0
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+.PD
+Use (do not use) the hardware floating-point instructions for
+floating-point operations. When \fB\-msoft\-float\fR is specified,
+functions in \fIlibgcc.a\fR will be used to perform floating-point
+operations. Unless they are replaced by routines that emulate the
+floating-point operations, or compiled in such a way as to call such
+emulations routines, these routines will issue floating-point
+operations. If you are compiling for an Alpha without floating-point
+operations, you must ensure that the library is built so as not to call
+them.
+.Sp
+Note that Alpha implementations without floating-point operations are
+required to have floating-point registers.
+.IP "\fB\-mfp\-reg\fR" 4
+.IX Item "-mfp-reg"
+.PD 0
+.IP "\fB\-mno\-fp\-regs\fR" 4
+.IX Item "-mno-fp-regs"
+.PD
+Generate code that uses (does not use) the floating-point register set.
+\&\fB\-mno\-fp\-regs\fR implies \fB\-msoft\-float\fR. If the floating-point
+register set is not used, floating point operands are passed in integer
+registers as if they were integers and floating-point results are passed
+in \f(CW$0\fR instead of \f(CW$f0\fR. This is a non-standard calling sequence,
+so any function with a floating-point argument or return value called by code
+compiled with \fB\-mno\-fp\-regs\fR must also be compiled with that
+option.
+.Sp
+A typical use of this option is building a kernel that does not use,
+and hence need not save and restore, any floating-point registers.
+.IP "\fB\-mieee\fR" 4
+.IX Item "-mieee"
+The Alpha architecture implements floating-point hardware optimized for
+maximum performance. It is mostly compliant with the \s-1IEEE\s0 floating
+point standard. However, for full compliance, software assistance is
+required. This option generates code fully \s-1IEEE\s0 compliant code
+\&\fIexcept\fR that the \fIinexact-flag\fR is not maintained (see below).
+If this option is turned on, the preprocessor macro \f(CW\*(C`_IEEE_FP\*(C'\fR is
+defined during compilation. The resulting code is less efficient but is
+able to correctly support denormalized numbers and exceptional \s-1IEEE\s0
+values such as not-a-number and plus/minus infinity. Other Alpha
+compilers call this option \fB\-ieee_with_no_inexact\fR.
+.IP "\fB\-mieee\-with\-inexact\fR" 4
+.IX Item "-mieee-with-inexact"
+This is like \fB\-mieee\fR except the generated code also maintains
+the \s-1IEEE\s0 \fIinexact-flag\fR. Turning on this option causes the
+generated code to implement fully-compliant \s-1IEEE\s0 math. In addition to
+\&\f(CW\*(C`_IEEE_FP\*(C'\fR, \f(CW\*(C`_IEEE_FP_EXACT\*(C'\fR is defined as a preprocessor
+macro. On some Alpha implementations the resulting code may execute
+significantly slower than the code generated by default. Since there is
+very little code that depends on the \fIinexact-flag\fR, you should
+normally not specify this option. Other Alpha compilers call this
+option \fB\-ieee_with_inexact\fR.
+.IP "\fB\-mfp\-trap\-mode=\fR\fItrap-mode\fR" 4
+.IX Item "-mfp-trap-mode=trap-mode"
+This option controls what floating-point related traps are enabled.
+Other Alpha compilers call this option \fB\-fptm\fR \fItrap-mode\fR.
+The trap mode can be set to one of four values:
+.RS 4
+.IP "\fBn\fR" 4
+.IX Item "n"
+This is the default (normal) setting. The only traps that are enabled
+are the ones that cannot be disabled in software (e.g., division by zero
+trap).
+.IP "\fBu\fR" 4
+.IX Item "u"
+In addition to the traps enabled by \fBn\fR, underflow traps are enabled
+as well.
+.IP "\fBsu\fR" 4
+.IX Item "su"
+Like \fBu\fR, but the instructions are marked to be safe for software
+completion (see Alpha architecture manual for details).
+.IP "\fBsui\fR" 4
+.IX Item "sui"
+Like \fBsu\fR, but inexact traps are enabled as well.
+.RE
+.RS 4
+.RE
+.IP "\fB\-mfp\-rounding\-mode=\fR\fIrounding-mode\fR" 4
+.IX Item "-mfp-rounding-mode=rounding-mode"
+Selects the \s-1IEEE\s0 rounding mode. Other Alpha compilers call this option
+\&\fB\-fprm\fR \fIrounding-mode\fR. The \fIrounding-mode\fR can be one
+of:
+.RS 4
+.IP "\fBn\fR" 4
+.IX Item "n"
+Normal \s-1IEEE\s0 rounding mode. Floating point numbers are rounded towards
+the nearest machine number or towards the even machine number in case
+of a tie.
+.IP "\fBm\fR" 4
+.IX Item "m"
+Round towards minus infinity.
+.IP "\fBc\fR" 4
+.IX Item "c"
+Chopped rounding mode. Floating point numbers are rounded towards zero.
+.IP "\fBd\fR" 4
+.IX Item "d"
+Dynamic rounding mode. A field in the floating point control register
+(\fIfpcr\fR, see Alpha architecture reference manual) controls the
+rounding mode in effect. The C library initializes this register for
+rounding towards plus infinity. Thus, unless your program modifies the
+\&\fIfpcr\fR, \fBd\fR corresponds to round towards plus infinity.
+.RE
+.RS 4
+.RE
+.IP "\fB\-mtrap\-precision=\fR\fItrap-precision\fR" 4
+.IX Item "-mtrap-precision=trap-precision"
+In the Alpha architecture, floating point traps are imprecise. This
+means without software assistance it is impossible to recover from a
+floating trap and program execution normally needs to be terminated.
+\&\s-1GCC\s0 can generate code that can assist operating system trap handlers
+in determining the exact location that caused a floating point trap.
+Depending on the requirements of an application, different levels of
+precisions can be selected:
+.RS 4
+.IP "\fBp\fR" 4
+.IX Item "p"
+Program precision. This option is the default and means a trap handler
+can only identify which program caused a floating point exception.
+.IP "\fBf\fR" 4
+.IX Item "f"
+Function precision. The trap handler can determine the function that
+caused a floating point exception.
+.IP "\fBi\fR" 4
+.IX Item "i"
+Instruction precision. The trap handler can determine the exact
+instruction that caused a floating point exception.
+.RE
+.RS 4
+.Sp
+Other Alpha compilers provide the equivalent options called
+\&\fB\-scope_safe\fR and \fB\-resumption_safe\fR.
+.RE
+.IP "\fB\-mieee\-conformant\fR" 4
+.IX Item "-mieee-conformant"
+This option marks the generated code as \s-1IEEE\s0 conformant. You must not
+use this option unless you also specify \fB\-mtrap\-precision=i\fR and either
+\&\fB\-mfp\-trap\-mode=su\fR or \fB\-mfp\-trap\-mode=sui\fR. Its only effect
+is to emit the line \fB.eflag 48\fR in the function prologue of the
+generated assembly file. Under \s-1DEC\s0 Unix, this has the effect that
+IEEE-conformant math library routines will be linked in.
+.IP "\fB\-mbuild\-constants\fR" 4
+.IX Item "-mbuild-constants"
+Normally \s-1GCC\s0 examines a 32\- or 64\-bit integer constant to
+see if it can construct it from smaller constants in two or three
+instructions. If it cannot, it will output the constant as a literal and
+generate code to load it from the data segment at runtime.
+.Sp
+Use this option to require \s-1GCC\s0 to construct \fIall\fR integer constants
+using code, even if it takes more instructions (the maximum is six).
+.Sp
+You would typically use this option to build a shared library dynamic
+loader. Itself a shared library, it must relocate itself in memory
+before it can find the variables and constants in its own data segment.
+.IP "\fB\-malpha\-as\fR" 4
+.IX Item "-malpha-as"
+.PD 0
+.IP "\fB\-mgas\fR" 4
+.IX Item "-mgas"
+.PD
+Select whether to generate code to be assembled by the vendor-supplied
+assembler (\fB\-malpha\-as\fR) or by the \s-1GNU\s0 assembler \fB\-mgas\fR.
+.IP "\fB\-mbwx\fR" 4
+.IX Item "-mbwx"
+.PD 0
+.IP "\fB\-mno\-bwx\fR" 4
+.IX Item "-mno-bwx"
+.IP "\fB\-mcix\fR" 4
+.IX Item "-mcix"
+.IP "\fB\-mno\-cix\fR" 4
+.IX Item "-mno-cix"
+.IP "\fB\-mfix\fR" 4
+.IX Item "-mfix"
+.IP "\fB\-mno\-fix\fR" 4
+.IX Item "-mno-fix"
+.IP "\fB\-mmax\fR" 4
+.IX Item "-mmax"
+.IP "\fB\-mno\-max\fR" 4
+.IX Item "-mno-max"
+.PD
+Indicate whether \s-1GCC\s0 should generate code to use the optional \s-1BWX\s0,
+\&\s-1CIX\s0, \s-1FIX\s0 and \s-1MAX\s0 instruction sets. The default is to use the instruction
+sets supported by the \s-1CPU\s0 type specified via \fB\-mcpu=\fR option or that
+of the \s-1CPU\s0 on which \s-1GCC\s0 was built if none was specified.
+.IP "\fB\-mfloat\-vax\fR" 4
+.IX Item "-mfloat-vax"
+.PD 0
+.IP "\fB\-mfloat\-ieee\fR" 4
+.IX Item "-mfloat-ieee"
+.PD
+Generate code that uses (does not use) \s-1VAX\s0 F and G floating point
+arithmetic instead of \s-1IEEE\s0 single and double precision.
+.IP "\fB\-mexplicit\-relocs\fR" 4
+.IX Item "-mexplicit-relocs"
+.PD 0
+.IP "\fB\-mno\-explicit\-relocs\fR" 4
+.IX Item "-mno-explicit-relocs"
+.PD
+Older Alpha assemblers provided no way to generate symbol relocations
+except via assembler macros. Use of these macros does not allow
+optimal instruction scheduling. \s-1GNU\s0 binutils as of version 2.12
+supports a new syntax that allows the compiler to explicitly mark
+which relocations should apply to which instructions. This option
+is mostly useful for debugging, as \s-1GCC\s0 detects the capabilities of
+the assembler when it is built and sets the default accordingly.
+.IP "\fB\-msmall\-data\fR" 4
+.IX Item "-msmall-data"
+.PD 0
+.IP "\fB\-mlarge\-data\fR" 4
+.IX Item "-mlarge-data"
+.PD
+When \fB\-mexplicit\-relocs\fR is in effect, static data is
+accessed via \fIgp-relative\fR relocations. When \fB\-msmall\-data\fR
+is used, objects 8 bytes long or smaller are placed in a \fIsmall data area\fR
+(the \f(CW\*(C`.sdata\*(C'\fR and \f(CW\*(C`.sbss\*(C'\fR sections) and are accessed via
+16\-bit relocations off of the \f(CW$gp\fR register. This limits the
+size of the small data area to 64KB, but allows the variables to be
+directly accessed via a single instruction.
+.Sp
+The default is \fB\-mlarge\-data\fR. With this option the data area
+is limited to just below 2GB. Programs that require more than 2GB of
+data must use \f(CW\*(C`malloc\*(C'\fR or \f(CW\*(C`mmap\*(C'\fR to allocate the data in the
+heap instead of in the program's data segment.
+.Sp
+When generating code for shared libraries, \fB\-fpic\fR implies
+\&\fB\-msmall\-data\fR and \fB\-fPIC\fR implies \fB\-mlarge\-data\fR.
+.IP "\fB\-msmall\-text\fR" 4
+.IX Item "-msmall-text"
+.PD 0
+.IP "\fB\-mlarge\-text\fR" 4
+.IX Item "-mlarge-text"
+.PD
+When \fB\-msmall\-text\fR is used, the compiler assumes that the
+code of the entire program (or shared library) fits in 4MB, and is
+thus reachable with a branch instruction. When \fB\-msmall\-data\fR
+is used, the compiler can assume that all local symbols share the
+same \f(CW$gp\fR value, and thus reduce the number of instructions
+required for a function call from 4 to 1.
+.Sp
+The default is \fB\-mlarge\-text\fR.
+.IP "\fB\-mcpu=\fR\fIcpu_type\fR" 4
+.IX Item "-mcpu=cpu_type"
+Set the instruction set and instruction scheduling parameters for
+machine type \fIcpu_type\fR. You can specify either the \fB\s-1EV\s0\fR
+style name or the corresponding chip number. \s-1GCC\s0 supports scheduling
+parameters for the \s-1EV4\s0, \s-1EV5\s0 and \s-1EV6\s0 family of processors and will
+choose the default values for the instruction set from the processor
+you specify. If you do not specify a processor type, \s-1GCC\s0 will default
+to the processor on which the compiler was built.
+.Sp
+Supported values for \fIcpu_type\fR are
+.RS 4
+.IP "\fBev4\fR" 4
+.IX Item "ev4"
+.PD 0
+.IP "\fBev45\fR" 4
+.IX Item "ev45"
+.IP "\fB21064\fR" 4
+.IX Item "21064"
+.PD
+Schedules as an \s-1EV4\s0 and has no instruction set extensions.
+.IP "\fBev5\fR" 4
+.IX Item "ev5"
+.PD 0
+.IP "\fB21164\fR" 4
+.IX Item "21164"
+.PD
+Schedules as an \s-1EV5\s0 and has no instruction set extensions.
+.IP "\fBev56\fR" 4
+.IX Item "ev56"
+.PD 0
+.IP "\fB21164a\fR" 4
+.IX Item "21164a"
+.PD
+Schedules as an \s-1EV5\s0 and supports the \s-1BWX\s0 extension.
+.IP "\fBpca56\fR" 4
+.IX Item "pca56"
+.PD 0
+.IP "\fB21164pc\fR" 4
+.IX Item "21164pc"
+.IP "\fB21164PC\fR" 4
+.IX Item "21164PC"
+.PD
+Schedules as an \s-1EV5\s0 and supports the \s-1BWX\s0 and \s-1MAX\s0 extensions.
+.IP "\fBev6\fR" 4
+.IX Item "ev6"
+.PD 0
+.IP "\fB21264\fR" 4
+.IX Item "21264"
+.PD
+Schedules as an \s-1EV6\s0 and supports the \s-1BWX\s0, \s-1FIX\s0, and \s-1MAX\s0 extensions.
+.IP "\fBev67\fR" 4
+.IX Item "ev67"
+.PD 0
+.IP "\fB21264a\fR" 4
+.IX Item "21264a"
+.PD
+Schedules as an \s-1EV6\s0 and supports the \s-1BWX\s0, \s-1CIX\s0, \s-1FIX\s0, and \s-1MAX\s0 extensions.
+.RE
+.RS 4
+.Sp
+Native Linux/GNU toolchains also support the value \fBnative\fR,
+which selects the best architecture option for the host processor.
+\&\fB\-mcpu=native\fR has no effect if \s-1GCC\s0 does not recognize
+the processor.
+.RE
+.IP "\fB\-mtune=\fR\fIcpu_type\fR" 4
+.IX Item "-mtune=cpu_type"
+Set only the instruction scheduling parameters for machine type
+\&\fIcpu_type\fR. The instruction set is not changed.
+.Sp
+Native Linux/GNU toolchains also support the value \fBnative\fR,
+which selects the best architecture option for the host processor.
+\&\fB\-mtune=native\fR has no effect if \s-1GCC\s0 does not recognize
+the processor.
+.IP "\fB\-mmemory\-latency=\fR\fItime\fR" 4
+.IX Item "-mmemory-latency=time"
+Sets the latency the scheduler should assume for typical memory
+references as seen by the application. This number is highly
+dependent on the memory access patterns used by the application
+and the size of the external cache on the machine.
+.Sp
+Valid options for \fItime\fR are
+.RS 4
+.IP "\fInumber\fR" 4
+.IX Item "number"
+A decimal number representing clock cycles.
+.IP "\fBL1\fR" 4
+.IX Item "L1"
+.PD 0
+.IP "\fBL2\fR" 4
+.IX Item "L2"
+.IP "\fBL3\fR" 4
+.IX Item "L3"
+.IP "\fBmain\fR" 4
+.IX Item "main"
+.PD
+The compiler contains estimates of the number of clock cycles for
+\&\*(L"typical\*(R" \s-1EV4\s0 & \s-1EV5\s0 hardware for the Level 1, 2 & 3 caches
+(also called Dcache, Scache, and Bcache), as well as to main memory.
+Note that L3 is only valid for \s-1EV5\s0.
+.RE
+.RS 4
+.RE
+.PP
+\fI\s-1DEC\s0 Alpha/VMS Options\fR
+.IX Subsection "DEC Alpha/VMS Options"
+.PP
+These \fB\-m\fR options are defined for the \s-1DEC\s0 Alpha/VMS implementations:
+.IP "\fB\-mvms\-return\-codes\fR" 4
+.IX Item "-mvms-return-codes"
+Return \s-1VMS\s0 condition codes from main. The default is to return \s-1POSIX\s0
+style condition (e.g. error) codes.
+.PP
+\fI\s-1FR30\s0 Options\fR
+.IX Subsection "FR30 Options"
+.PP
+These options are defined specifically for the \s-1FR30\s0 port.
+.IP "\fB\-msmall\-model\fR" 4
+.IX Item "-msmall-model"
+Use the small address space model. This can produce smaller code, but
+it does assume that all symbolic values and addresses will fit into a
+20\-bit range.
+.IP "\fB\-mno\-lsim\fR" 4
+.IX Item "-mno-lsim"
+Assume that run-time support has been provided and so there is no need
+to include the simulator library (\fIlibsim.a\fR) on the linker
+command line.
+.PP
+\fI\s-1FRV\s0 Options\fR
+.IX Subsection "FRV Options"
+.IP "\fB\-mgpr\-32\fR" 4
+.IX Item "-mgpr-32"
+Only use the first 32 general purpose registers.
+.IP "\fB\-mgpr\-64\fR" 4
+.IX Item "-mgpr-64"
+Use all 64 general purpose registers.
+.IP "\fB\-mfpr\-32\fR" 4
+.IX Item "-mfpr-32"
+Use only the first 32 floating point registers.
+.IP "\fB\-mfpr\-64\fR" 4
+.IX Item "-mfpr-64"
+Use all 64 floating point registers
+.IP "\fB\-mhard\-float\fR" 4
+.IX Item "-mhard-float"
+Use hardware instructions for floating point operations.
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+Use library routines for floating point operations.
+.IP "\fB\-malloc\-cc\fR" 4
+.IX Item "-malloc-cc"
+Dynamically allocate condition code registers.
+.IP "\fB\-mfixed\-cc\fR" 4
+.IX Item "-mfixed-cc"
+Do not try to dynamically allocate condition code registers, only
+use \f(CW\*(C`icc0\*(C'\fR and \f(CW\*(C`fcc0\*(C'\fR.
+.IP "\fB\-mdword\fR" 4
+.IX Item "-mdword"
+Change \s-1ABI\s0 to use double word insns.
+.IP "\fB\-mno\-dword\fR" 4
+.IX Item "-mno-dword"
+Do not use double word instructions.
+.IP "\fB\-mdouble\fR" 4
+.IX Item "-mdouble"
+Use floating point double instructions.
+.IP "\fB\-mno\-double\fR" 4
+.IX Item "-mno-double"
+Do not use floating point double instructions.
+.IP "\fB\-mmedia\fR" 4
+.IX Item "-mmedia"
+Use media instructions.
+.IP "\fB\-mno\-media\fR" 4
+.IX Item "-mno-media"
+Do not use media instructions.
+.IP "\fB\-mmuladd\fR" 4
+.IX Item "-mmuladd"
+Use multiply and add/subtract instructions.
+.IP "\fB\-mno\-muladd\fR" 4
+.IX Item "-mno-muladd"
+Do not use multiply and add/subtract instructions.
+.IP "\fB\-mfdpic\fR" 4
+.IX Item "-mfdpic"
+Select the \s-1FDPIC\s0 \s-1ABI\s0, that uses function descriptors to represent
+pointers to functions. Without any PIC/PIE\-related options, it
+implies \fB\-fPIE\fR. With \fB\-fpic\fR or \fB\-fpie\fR, it
+assumes \s-1GOT\s0 entries and small data are within a 12\-bit range from the
+\&\s-1GOT\s0 base address; with \fB\-fPIC\fR or \fB\-fPIE\fR, \s-1GOT\s0 offsets
+are computed with 32 bits.
+With a \fBbfin-elf\fR target, this option implies \fB\-msim\fR.
+.IP "\fB\-minline\-plt\fR" 4
+.IX Item "-minline-plt"
+Enable inlining of \s-1PLT\s0 entries in function calls to functions that are
+not known to bind locally. It has no effect without \fB\-mfdpic\fR.
+It's enabled by default if optimizing for speed and compiling for
+shared libraries (i.e., \fB\-fPIC\fR or \fB\-fpic\fR), or when an
+optimization option such as \fB\-O3\fR or above is present in the
+command line.
+.IP "\fB\-mTLS\fR" 4
+.IX Item "-mTLS"
+Assume a large \s-1TLS\s0 segment when generating thread-local code.
+.IP "\fB\-mtls\fR" 4
+.IX Item "-mtls"
+Do not assume a large \s-1TLS\s0 segment when generating thread-local code.
+.IP "\fB\-mgprel\-ro\fR" 4
+.IX Item "-mgprel-ro"
+Enable the use of \f(CW\*(C`GPREL\*(C'\fR relocations in the \s-1FDPIC\s0 \s-1ABI\s0 for data
+that is known to be in read-only sections. It's enabled by default,
+except for \fB\-fpic\fR or \fB\-fpie\fR: even though it may help
+make the global offset table smaller, it trades 1 instruction for 4.
+With \fB\-fPIC\fR or \fB\-fPIE\fR, it trades 3 instructions for 4,
+one of which may be shared by multiple symbols, and it avoids the need
+for a \s-1GOT\s0 entry for the referenced symbol, so it's more likely to be a
+win. If it is not, \fB\-mno\-gprel\-ro\fR can be used to disable it.
+.IP "\fB\-multilib\-library\-pic\fR" 4
+.IX Item "-multilib-library-pic"
+Link with the (library, not \s-1FD\s0) pic libraries. It's implied by
+\&\fB\-mlibrary\-pic\fR, as well as by \fB\-fPIC\fR and
+\&\fB\-fpic\fR without \fB\-mfdpic\fR. You should never have to use
+it explicitly.
+.IP "\fB\-mlinked\-fp\fR" 4
+.IX Item "-mlinked-fp"
+Follow the \s-1EABI\s0 requirement of always creating a frame pointer whenever
+a stack frame is allocated. This option is enabled by default and can
+be disabled with \fB\-mno\-linked\-fp\fR.
+.IP "\fB\-mlong\-calls\fR" 4
+.IX Item "-mlong-calls"
+Use indirect addressing to call functions outside the current
+compilation unit. This allows the functions to be placed anywhere
+within the 32\-bit address space.
+.IP "\fB\-malign\-labels\fR" 4
+.IX Item "-malign-labels"
+Try to align labels to an 8\-byte boundary by inserting nops into the
+previous packet. This option only has an effect when \s-1VLIW\s0 packing
+is enabled. It doesn't create new packets; it merely adds nops to
+existing ones.
+.IP "\fB\-mlibrary\-pic\fR" 4
+.IX Item "-mlibrary-pic"
+Generate position-independent \s-1EABI\s0 code.
+.IP "\fB\-macc\-4\fR" 4
+.IX Item "-macc-4"
+Use only the first four media accumulator registers.
+.IP "\fB\-macc\-8\fR" 4
+.IX Item "-macc-8"
+Use all eight media accumulator registers.
+.IP "\fB\-mpack\fR" 4
+.IX Item "-mpack"
+Pack \s-1VLIW\s0 instructions.
+.IP "\fB\-mno\-pack\fR" 4
+.IX Item "-mno-pack"
+Do not pack \s-1VLIW\s0 instructions.
+.IP "\fB\-mno\-eflags\fR" 4
+.IX Item "-mno-eflags"
+Do not mark \s-1ABI\s0 switches in e_flags.
+.IP "\fB\-mcond\-move\fR" 4
+.IX Item "-mcond-move"
+Enable the use of conditional-move instructions (default).
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mno\-cond\-move\fR" 4
+.IX Item "-mno-cond-move"
+Disable the use of conditional-move instructions.
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mscc\fR" 4
+.IX Item "-mscc"
+Enable the use of conditional set instructions (default).
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mno\-scc\fR" 4
+.IX Item "-mno-scc"
+Disable the use of conditional set instructions.
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mcond\-exec\fR" 4
+.IX Item "-mcond-exec"
+Enable the use of conditional execution (default).
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mno\-cond\-exec\fR" 4
+.IX Item "-mno-cond-exec"
+Disable the use of conditional execution.
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mvliw\-branch\fR" 4
+.IX Item "-mvliw-branch"
+Run a pass to pack branches into \s-1VLIW\s0 instructions (default).
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mno\-vliw\-branch\fR" 4
+.IX Item "-mno-vliw-branch"
+Do not run a pass to pack branches into \s-1VLIW\s0 instructions.
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mmulti\-cond\-exec\fR" 4
+.IX Item "-mmulti-cond-exec"
+Enable optimization of \f(CW\*(C`&&\*(C'\fR and \f(CW\*(C`||\*(C'\fR in conditional execution
+(default).
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mno\-multi\-cond\-exec\fR" 4
+.IX Item "-mno-multi-cond-exec"
+Disable optimization of \f(CW\*(C`&&\*(C'\fR and \f(CW\*(C`||\*(C'\fR in conditional execution.
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mnested\-cond\-exec\fR" 4
+.IX Item "-mnested-cond-exec"
+Enable nested conditional execution optimizations (default).
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mno\-nested\-cond\-exec\fR" 4
+.IX Item "-mno-nested-cond-exec"
+Disable nested conditional execution optimizations.
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-moptimize\-membar\fR" 4
+.IX Item "-moptimize-membar"
+This switch removes redundant \f(CW\*(C`membar\*(C'\fR instructions from the
+compiler generated code. It is enabled by default.
+.IP "\fB\-mno\-optimize\-membar\fR" 4
+.IX Item "-mno-optimize-membar"
+This switch disables the automatic removal of redundant \f(CW\*(C`membar\*(C'\fR
+instructions from the generated code.
+.IP "\fB\-mtomcat\-stats\fR" 4
+.IX Item "-mtomcat-stats"
+Cause gas to print out tomcat statistics.
+.IP "\fB\-mcpu=\fR\fIcpu\fR" 4
+.IX Item "-mcpu=cpu"
+Select the processor type for which to generate code. Possible values are
+\&\fBfrv\fR, \fBfr550\fR, \fBtomcat\fR, \fBfr500\fR, \fBfr450\fR,
+\&\fBfr405\fR, \fBfr400\fR, \fBfr300\fR and \fBsimple\fR.
+.PP
+\fIGNU/Linux Options\fR
+.IX Subsection "GNU/Linux Options"
+.PP
+These \fB\-m\fR options are defined for GNU/Linux targets:
+.IP "\fB\-mglibc\fR" 4
+.IX Item "-mglibc"
+Use the \s-1GNU\s0 C library instead of uClibc. This is the default except
+on \fB*\-*\-linux\-*uclibc*\fR targets.
+.IP "\fB\-muclibc\fR" 4
+.IX Item "-muclibc"
+Use uClibc instead of the \s-1GNU\s0 C library. This is the default on
+\&\fB*\-*\-linux\-*uclibc*\fR targets.
+.PP
+\fIH8/300 Options\fR
+.IX Subsection "H8/300 Options"
+.PP
+These \fB\-m\fR options are defined for the H8/300 implementations:
+.IP "\fB\-mrelax\fR" 4
+.IX Item "-mrelax"
+Shorten some address references at link time, when possible; uses the
+linker option \fB\-relax\fR.
+.IP "\fB\-mh\fR" 4
+.IX Item "-mh"
+Generate code for the H8/300H.
+.IP "\fB\-ms\fR" 4
+.IX Item "-ms"
+Generate code for the H8S.
+.IP "\fB\-mn\fR" 4
+.IX Item "-mn"
+Generate code for the H8S and H8/300H in the normal mode. This switch
+must be used either with \fB\-mh\fR or \fB\-ms\fR.
+.IP "\fB\-ms2600\fR" 4
+.IX Item "-ms2600"
+Generate code for the H8S/2600. This switch must be used with \fB\-ms\fR.
+.IP "\fB\-mint32\fR" 4
+.IX Item "-mint32"
+Make \f(CW\*(C`int\*(C'\fR data 32 bits by default.
+.IP "\fB\-malign\-300\fR" 4
+.IX Item "-malign-300"
+On the H8/300H and H8S, use the same alignment rules as for the H8/300.
+The default for the H8/300H and H8S is to align longs and floats on 4
+byte boundaries.
+\&\fB\-malign\-300\fR causes them to be aligned on 2 byte boundaries.
+This option has no effect on the H8/300.
+.PP
+\fI\s-1HPPA\s0 Options\fR
+.IX Subsection "HPPA Options"
+.PP
+These \fB\-m\fR options are defined for the \s-1HPPA\s0 family of computers:
+.IP "\fB\-march=\fR\fIarchitecture-type\fR" 4
+.IX Item "-march=architecture-type"
+Generate code for the specified architecture. The choices for
+\&\fIarchitecture-type\fR are \fB1.0\fR for \s-1PA\s0 1.0, \fB1.1\fR for \s-1PA\s0
+1.1, and \fB2.0\fR for \s-1PA\s0 2.0 processors. Refer to
+\&\fI/usr/lib/sched.models\fR on an HP-UX system to determine the proper
+architecture option for your machine. Code compiled for lower numbered
+architectures will run on higher numbered architectures, but not the
+other way around.
+.IP "\fB\-mpa\-risc\-1\-0\fR" 4
+.IX Item "-mpa-risc-1-0"
+.PD 0
+.IP "\fB\-mpa\-risc\-1\-1\fR" 4
+.IX Item "-mpa-risc-1-1"
+.IP "\fB\-mpa\-risc\-2\-0\fR" 4
+.IX Item "-mpa-risc-2-0"
+.PD
+Synonyms for \fB\-march=1.0\fR, \fB\-march=1.1\fR, and \fB\-march=2.0\fR respectively.
+.IP "\fB\-mbig\-switch\fR" 4
+.IX Item "-mbig-switch"
+Generate code suitable for big switch tables. Use this option only if
+the assembler/linker complain about out of range branches within a switch
+table.
+.IP "\fB\-mjump\-in\-delay\fR" 4
+.IX Item "-mjump-in-delay"
+Fill delay slots of function calls with unconditional jump instructions
+by modifying the return pointer for the function call to be the target
+of the conditional jump.
+.IP "\fB\-mdisable\-fpregs\fR" 4
+.IX Item "-mdisable-fpregs"
+Prevent floating point registers from being used in any manner. This is
+necessary for compiling kernels which perform lazy context switching of
+floating point registers. If you use this option and attempt to perform
+floating point operations, the compiler will abort.
+.IP "\fB\-mdisable\-indexing\fR" 4
+.IX Item "-mdisable-indexing"
+Prevent the compiler from using indexing address modes. This avoids some
+rather obscure problems when compiling \s-1MIG\s0 generated code under \s-1MACH\s0.
+.IP "\fB\-mno\-space\-regs\fR" 4
+.IX Item "-mno-space-regs"
+Generate code that assumes the target has no space registers. This allows
+\&\s-1GCC\s0 to generate faster indirect calls and use unscaled index address modes.
+.Sp
+Such code is suitable for level 0 \s-1PA\s0 systems and kernels.
+.IP "\fB\-mfast\-indirect\-calls\fR" 4
+.IX Item "-mfast-indirect-calls"
+Generate code that assumes calls never cross space boundaries. This
+allows \s-1GCC\s0 to emit code which performs faster indirect calls.
+.Sp
+This option will not work in the presence of shared libraries or nested
+functions.
+.IP "\fB\-mfixed\-range=\fR\fIregister-range\fR" 4
+.IX Item "-mfixed-range=register-range"
+Generate code treating the given register range as fixed registers.
+A fixed register is one that the register allocator can not use. This is
+useful when compiling kernel code. A register range is specified as
+two registers separated by a dash. Multiple register ranges can be
+specified separated by a comma.
+.IP "\fB\-mlong\-load\-store\fR" 4
+.IX Item "-mlong-load-store"
+Generate 3\-instruction load and store sequences as sometimes required by
+the HP-UX 10 linker. This is equivalent to the \fB+k\fR option to
+the \s-1HP\s0 compilers.
+.IP "\fB\-mportable\-runtime\fR" 4
+.IX Item "-mportable-runtime"
+Use the portable calling conventions proposed by \s-1HP\s0 for \s-1ELF\s0 systems.
+.IP "\fB\-mgas\fR" 4
+.IX Item "-mgas"
+Enable the use of assembler directives only \s-1GAS\s0 understands.
+.IP "\fB\-mschedule=\fR\fIcpu-type\fR" 4
+.IX Item "-mschedule=cpu-type"
+Schedule code according to the constraints for the machine type
+\&\fIcpu-type\fR. The choices for \fIcpu-type\fR are \fB700\fR
+\&\fB7100\fR, \fB7100LC\fR, \fB7200\fR, \fB7300\fR and \fB8000\fR. Refer
+to \fI/usr/lib/sched.models\fR on an HP-UX system to determine the
+proper scheduling option for your machine. The default scheduling is
+\&\fB8000\fR.
+.IP "\fB\-mlinker\-opt\fR" 4
+.IX Item "-mlinker-opt"
+Enable the optimization pass in the HP-UX linker. Note this makes symbolic
+debugging impossible. It also triggers a bug in the HP-UX 8 and HP-UX 9
+linkers in which they give bogus error messages when linking some programs.
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+Generate output containing library calls for floating point.
+\&\fBWarning:\fR the requisite libraries are not available for all \s-1HPPA\s0
+targets. Normally the facilities of the machine's usual C compiler are
+used, but this cannot be done directly in cross-compilation. You must make
+your own arrangements to provide suitable library functions for
+cross-compilation.
+.Sp
+\&\fB\-msoft\-float\fR changes the calling convention in the output file;
+therefore, it is only useful if you compile \fIall\fR of a program with
+this option. In particular, you need to compile \fIlibgcc.a\fR, the
+library that comes with \s-1GCC\s0, with \fB\-msoft\-float\fR in order for
+this to work.
+.IP "\fB\-msio\fR" 4
+.IX Item "-msio"
+Generate the predefine, \f(CW\*(C`_SIO\*(C'\fR, for server \s-1IO\s0. The default is
+\&\fB\-mwsio\fR. This generates the predefines, \f(CW\*(C`_\|_hp9000s700\*(C'\fR,
+\&\f(CW\*(C`_\|_hp9000s700_\|_\*(C'\fR and \f(CW\*(C`_WSIO\*(C'\fR, for workstation \s-1IO\s0. These
+options are available under HP-UX and HI-UX.
+.IP "\fB\-mgnu\-ld\fR" 4
+.IX Item "-mgnu-ld"
+Use \s-1GNU\s0 ld specific options. This passes \fB\-shared\fR to ld when
+building a shared library. It is the default when \s-1GCC\s0 is configured,
+explicitly or implicitly, with the \s-1GNU\s0 linker. This option does not
+have any affect on which ld is called, it only changes what parameters
+are passed to that ld. The ld that is called is determined by the
+\&\fB\-\-with\-ld\fR configure option, \s-1GCC\s0's program search path, and
+finally by the user's \fB\s-1PATH\s0\fR. The linker used by \s-1GCC\s0 can be printed
+using \fBwhich `gcc \-print\-prog\-name=ld`\fR. This option is only available
+on the 64 bit HP-UX \s-1GCC\s0, i.e. configured with \fBhppa*64*\-*\-hpux*\fR.
+.IP "\fB\-mhp\-ld\fR" 4
+.IX Item "-mhp-ld"
+Use \s-1HP\s0 ld specific options. This passes \fB\-b\fR to ld when building
+a shared library and passes \fB+Accept TypeMismatch\fR to ld on all
+links. It is the default when \s-1GCC\s0 is configured, explicitly or
+implicitly, with the \s-1HP\s0 linker. This option does not have any affect on
+which ld is called, it only changes what parameters are passed to that
+ld. The ld that is called is determined by the \fB\-\-with\-ld\fR
+configure option, \s-1GCC\s0's program search path, and finally by the user's
+\&\fB\s-1PATH\s0\fR. The linker used by \s-1GCC\s0 can be printed using \fBwhich
+`gcc \-print\-prog\-name=ld`\fR. This option is only available on the 64 bit
+HP-UX \s-1GCC\s0, i.e. configured with \fBhppa*64*\-*\-hpux*\fR.
+.IP "\fB\-mlong\-calls\fR" 4
+.IX Item "-mlong-calls"
+Generate code that uses long call sequences. This ensures that a call
+is always able to reach linker generated stubs. The default is to generate
+long calls only when the distance from the call site to the beginning
+of the function or translation unit, as the case may be, exceeds a
+predefined limit set by the branch type being used. The limits for
+normal calls are 7,600,000 and 240,000 bytes, respectively for the
+\&\s-1PA\s0 2.0 and \s-1PA\s0 1.X architectures. Sibcalls are always limited at
+240,000 bytes.
+.Sp
+Distances are measured from the beginning of functions when using the
+\&\fB\-ffunction\-sections\fR option, or when using the \fB\-mgas\fR
+and \fB\-mno\-portable\-runtime\fR options together under HP-UX with
+the \s-1SOM\s0 linker.
+.Sp
+It is normally not desirable to use this option as it will degrade
+performance. However, it may be useful in large applications,
+particularly when partial linking is used to build the application.
+.Sp
+The types of long calls used depends on the capabilities of the
+assembler and linker, and the type of code being generated. The
+impact on systems that support long absolute calls, and long pic
+symbol-difference or pc-relative calls should be relatively small.
+However, an indirect call is used on 32\-bit \s-1ELF\s0 systems in pic code
+and it is quite long.
+.IP "\fB\-munix=\fR\fIunix-std\fR" 4
+.IX Item "-munix=unix-std"
+Generate compiler predefines and select a startfile for the specified
+\&\s-1UNIX\s0 standard. The choices for \fIunix-std\fR are \fB93\fR, \fB95\fR
+and \fB98\fR. \fB93\fR is supported on all HP-UX versions. \fB95\fR
+is available on HP-UX 10.10 and later. \fB98\fR is available on HP-UX
+11.11 and later. The default values are \fB93\fR for HP-UX 10.00,
+\&\fB95\fR for HP-UX 10.10 though to 11.00, and \fB98\fR for HP-UX 11.11
+and later.
+.Sp
+\&\fB\-munix=93\fR provides the same predefines as \s-1GCC\s0 3.3 and 3.4.
+\&\fB\-munix=95\fR provides additional predefines for \f(CW\*(C`XOPEN_UNIX\*(C'\fR
+and \f(CW\*(C`_XOPEN_SOURCE_EXTENDED\*(C'\fR, and the startfile \fIunix95.o\fR.
+\&\fB\-munix=98\fR provides additional predefines for \f(CW\*(C`_XOPEN_UNIX\*(C'\fR,
+\&\f(CW\*(C`_XOPEN_SOURCE_EXTENDED\*(C'\fR, \f(CW\*(C`_INCLUDE_\|_STDC_A1_SOURCE\*(C'\fR and
+\&\f(CW\*(C`_INCLUDE_XOPEN_SOURCE_500\*(C'\fR, and the startfile \fIunix98.o\fR.
+.Sp
+It is \fIimportant\fR to note that this option changes the interfaces
+for various library routines. It also affects the operational behavior
+of the C library. Thus, \fIextreme\fR care is needed in using this
+option.
+.Sp
+Library code that is intended to operate with more than one \s-1UNIX\s0
+standard must test, set and restore the variable \fI_\|_xpg4_extended_mask\fR
+as appropriate. Most \s-1GNU\s0 software doesn't provide this capability.
+.IP "\fB\-nolibdld\fR" 4
+.IX Item "-nolibdld"
+Suppress the generation of link options to search libdld.sl when the
+\&\fB\-static\fR option is specified on HP-UX 10 and later.
+.IP "\fB\-static\fR" 4
+.IX Item "-static"
+The HP-UX implementation of setlocale in libc has a dependency on
+libdld.sl. There isn't an archive version of libdld.sl. Thus,
+when the \fB\-static\fR option is specified, special link options
+are needed to resolve this dependency.
+.Sp
+On HP-UX 10 and later, the \s-1GCC\s0 driver adds the necessary options to
+link with libdld.sl when the \fB\-static\fR option is specified.
+This causes the resulting binary to be dynamic. On the 64\-bit port,
+the linkers generate dynamic binaries by default in any case. The
+\&\fB\-nolibdld\fR option can be used to prevent the \s-1GCC\s0 driver from
+adding these link options.
+.IP "\fB\-threads\fR" 4
+.IX Item "-threads"
+Add support for multithreading with the \fIdce thread\fR library
+under HP-UX. This option sets flags for both the preprocessor and
+linker.
+.PP
+\fIIntel 386 and \s-1AMD\s0 x86\-64 Options\fR
+.IX Subsection "Intel 386 and AMD x86-64 Options"
+.PP
+These \fB\-m\fR options are defined for the i386 and x86\-64 family of
+computers:
+.IP "\fB\-mtune=\fR\fIcpu-type\fR" 4
+.IX Item "-mtune=cpu-type"
+Tune to \fIcpu-type\fR everything applicable about the generated code, except
+for the \s-1ABI\s0 and the set of available instructions. The choices for
+\&\fIcpu-type\fR are:
+.RS 4
+.IP "\fIgeneric\fR" 4
+.IX Item "generic"
+Produce code optimized for the most common \s-1IA32/AMD64/EM64T\s0 processors.
+If you know the \s-1CPU\s0 on which your code will run, then you should use
+the corresponding \fB\-mtune\fR option instead of
+\&\fB\-mtune=generic\fR. But, if you do not know exactly what \s-1CPU\s0 users
+of your application will have, then you should use this option.
+.Sp
+As new processors are deployed in the marketplace, the behavior of this
+option will change. Therefore, if you upgrade to a newer version of
+\&\s-1GCC\s0, the code generated option will change to reflect the processors
+that were most common when that version of \s-1GCC\s0 was released.
+.Sp
+There is no \fB\-march=generic\fR option because \fB\-march\fR
+indicates the instruction set the compiler can use, and there is no
+generic instruction set applicable to all processors. In contrast,
+\&\fB\-mtune\fR indicates the processor (or, in this case, collection of
+processors) for which the code is optimized.
+.IP "\fInative\fR" 4
+.IX Item "native"
+This selects the \s-1CPU\s0 to tune for at compilation time by determining
+the processor type of the compiling machine. Using \fB\-mtune=native\fR
+will produce code optimized for the local machine under the constraints
+of the selected instruction set. Using \fB\-march=native\fR will
+enable all instruction subsets supported by the local machine (hence
+the result might not run on different machines).
+.IP "\fIi386\fR" 4
+.IX Item "i386"
+Original Intel's i386 \s-1CPU\s0.
+.IP "\fIi486\fR" 4
+.IX Item "i486"
+Intel's i486 \s-1CPU\s0. (No scheduling is implemented for this chip.)
+.IP "\fIi586, pentium\fR" 4
+.IX Item "i586, pentium"
+Intel Pentium \s-1CPU\s0 with no \s-1MMX\s0 support.
+.IP "\fIpentium-mmx\fR" 4
+.IX Item "pentium-mmx"
+Intel PentiumMMX \s-1CPU\s0 based on Pentium core with \s-1MMX\s0 instruction set support.
+.IP "\fIpentiumpro\fR" 4
+.IX Item "pentiumpro"
+Intel PentiumPro \s-1CPU\s0.
+.IP "\fIi686\fR" 4
+.IX Item "i686"
+Same as \f(CW\*(C`generic\*(C'\fR, but when used as \f(CW\*(C`march\*(C'\fR option, PentiumPro
+instruction set will be used, so the code will run on all i686 family chips.
+.IP "\fIpentium2\fR" 4
+.IX Item "pentium2"
+Intel Pentium2 \s-1CPU\s0 based on PentiumPro core with \s-1MMX\s0 instruction set support.
+.IP "\fIpentium3, pentium3m\fR" 4
+.IX Item "pentium3, pentium3m"
+Intel Pentium3 \s-1CPU\s0 based on PentiumPro core with \s-1MMX\s0 and \s-1SSE\s0 instruction set
+support.
+.IP "\fIpentium-m\fR" 4
+.IX Item "pentium-m"
+Low power version of Intel Pentium3 \s-1CPU\s0 with \s-1MMX\s0, \s-1SSE\s0 and \s-1SSE2\s0 instruction set
+support. Used by Centrino notebooks.
+.IP "\fIpentium4, pentium4m\fR" 4
+.IX Item "pentium4, pentium4m"
+Intel Pentium4 \s-1CPU\s0 with \s-1MMX\s0, \s-1SSE\s0 and \s-1SSE2\s0 instruction set support.
+.IP "\fIprescott\fR" 4
+.IX Item "prescott"
+Improved version of Intel Pentium4 \s-1CPU\s0 with \s-1MMX\s0, \s-1SSE\s0, \s-1SSE2\s0 and \s-1SSE3\s0 instruction
+set support.
+.IP "\fInocona\fR" 4
+.IX Item "nocona"
+Improved version of Intel Pentium4 \s-1CPU\s0 with 64\-bit extensions, \s-1MMX\s0, \s-1SSE\s0,
+\&\s-1SSE2\s0 and \s-1SSE3\s0 instruction set support.
+.IP "\fIcore2\fR" 4
+.IX Item "core2"
+Intel Core2 \s-1CPU\s0 with 64\-bit extensions, \s-1MMX\s0, \s-1SSE\s0, \s-1SSE2\s0, \s-1SSE3\s0 and \s-1SSSE3\s0
+instruction set support.
+.IP "\fIk6\fR" 4
+.IX Item "k6"
+\&\s-1AMD\s0 K6 \s-1CPU\s0 with \s-1MMX\s0 instruction set support.
+.IP "\fIk6\-2, k6\-3\fR" 4
+.IX Item "k6-2, k6-3"
+Improved versions of \s-1AMD\s0 K6 \s-1CPU\s0 with \s-1MMX\s0 and 3dNOW! instruction set support.
+.IP "\fIathlon, athlon-tbird\fR" 4
+.IX Item "athlon, athlon-tbird"
+\&\s-1AMD\s0 Athlon \s-1CPU\s0 with \s-1MMX\s0, 3dNOW!, enhanced 3dNOW! and \s-1SSE\s0 prefetch instructions
+support.
+.IP "\fIathlon\-4, athlon-xp, athlon-mp\fR" 4
+.IX Item "athlon-4, athlon-xp, athlon-mp"
+Improved \s-1AMD\s0 Athlon \s-1CPU\s0 with \s-1MMX\s0, 3dNOW!, enhanced 3dNOW! and full \s-1SSE\s0
+instruction set support.
+.IP "\fIk8, opteron, athlon64, athlon-fx\fR" 4
+.IX Item "k8, opteron, athlon64, athlon-fx"
+\&\s-1AMD\s0 K8 core based CPUs with x86\-64 instruction set support. (This supersets
+\&\s-1MMX\s0, \s-1SSE\s0, \s-1SSE2\s0, 3dNOW!, enhanced 3dNOW! and 64\-bit instruction set extensions.)
+.IP "\fIk8\-sse3, opteron\-sse3, athlon64\-sse3\fR" 4
+.IX Item "k8-sse3, opteron-sse3, athlon64-sse3"
+Improved versions of k8, opteron and athlon64 with \s-1SSE3\s0 instruction set support.
+.IP "\fIamdfam10, barcelona\fR" 4
+.IX Item "amdfam10, barcelona"
+\&\s-1AMD\s0 Family 10h core based CPUs with x86\-64 instruction set support. (This
+supersets \s-1MMX\s0, \s-1SSE\s0, \s-1SSE2\s0, \s-1SSE3\s0, \s-1SSE4A\s0, 3dNOW!, enhanced 3dNOW!, \s-1ABM\s0 and 64\-bit
+instruction set extensions.)
+.IP "\fIwinchip\-c6\fR" 4
+.IX Item "winchip-c6"
+\&\s-1IDT\s0 Winchip C6 \s-1CPU\s0, dealt in same way as i486 with additional \s-1MMX\s0 instruction
+set support.
+.IP "\fIwinchip2\fR" 4
+.IX Item "winchip2"
+\&\s-1IDT\s0 Winchip2 \s-1CPU\s0, dealt in same way as i486 with additional \s-1MMX\s0 and 3dNOW!
+instruction set support.
+.IP "\fIc3\fR" 4
+.IX Item "c3"
+Via C3 \s-1CPU\s0 with \s-1MMX\s0 and 3dNOW! instruction set support. (No scheduling is
+implemented for this chip.)
+.IP "\fIc3\-2\fR" 4
+.IX Item "c3-2"
+Via C3\-2 \s-1CPU\s0 with \s-1MMX\s0 and \s-1SSE\s0 instruction set support. (No scheduling is
+implemented for this chip.)
+.IP "\fIgeode\fR" 4
+.IX Item "geode"
+Embedded \s-1AMD\s0 \s-1CPU\s0 with \s-1MMX\s0 and 3dNOW! instruction set support.
+.RE
+.RS 4
+.Sp
+While picking a specific \fIcpu-type\fR will schedule things appropriately
+for that particular chip, the compiler will not generate any code that
+does not run on the i386 without the \fB\-march=\fR\fIcpu-type\fR option
+being used.
+.RE
+.IP "\fB\-march=\fR\fIcpu-type\fR" 4
+.IX Item "-march=cpu-type"
+Generate instructions for the machine type \fIcpu-type\fR. The choices
+for \fIcpu-type\fR are the same as for \fB\-mtune\fR. Moreover,
+specifying \fB\-march=\fR\fIcpu-type\fR implies \fB\-mtune=\fR\fIcpu-type\fR.
+.IP "\fB\-mcpu=\fR\fIcpu-type\fR" 4
+.IX Item "-mcpu=cpu-type"
+A deprecated synonym for \fB\-mtune\fR.
+.IP "\fB\-mfpmath=\fR\fIunit\fR" 4
+.IX Item "-mfpmath=unit"
+Generate floating point arithmetics for selected unit \fIunit\fR. The choices
+for \fIunit\fR are:
+.RS 4
+.IP "\fB387\fR" 4
+.IX Item "387"
+Use the standard 387 floating point coprocessor present majority of chips and
+emulated otherwise. Code compiled with this option will run almost everywhere.
+The temporary results are computed in 80bit precision instead of precision
+specified by the type resulting in slightly different results compared to most
+of other chips. See \fB\-ffloat\-store\fR for more detailed description.
+.Sp
+This is the default choice for i386 compiler.
+.IP "\fBsse\fR" 4
+.IX Item "sse"
+Use scalar floating point instructions present in the \s-1SSE\s0 instruction set.
+This instruction set is supported by Pentium3 and newer chips, in the \s-1AMD\s0 line
+by Athlon\-4, Athlon-xp and Athlon-mp chips. The earlier version of \s-1SSE\s0
+instruction set supports only single precision arithmetics, thus the double and
+extended precision arithmetics is still done using 387. Later version, present
+only in Pentium4 and the future \s-1AMD\s0 x86\-64 chips supports double precision
+arithmetics too.
+.Sp
+For the i386 compiler, you need to use \fB\-march=\fR\fIcpu-type\fR, \fB\-msse\fR
+or \fB\-msse2\fR switches to enable \s-1SSE\s0 extensions and make this option
+effective. For the x86\-64 compiler, these extensions are enabled by default.
+.Sp
+The resulting code should be considerably faster in the majority of cases and avoid
+the numerical instability problems of 387 code, but may break some existing
+code that expects temporaries to be 80bit.
+.Sp
+This is the default choice for the x86\-64 compiler.
+.IP "\fBsse,387\fR" 4
+.IX Item "sse,387"
+.PD 0
+.IP "\fBsse+387\fR" 4
+.IX Item "sse+387"
+.IP "\fBboth\fR" 4
+.IX Item "both"
+.PD
+Attempt to utilize both instruction sets at once. This effectively double the
+amount of available registers and on chips with separate execution units for
+387 and \s-1SSE\s0 the execution resources too. Use this option with care, as it is
+still experimental, because the \s-1GCC\s0 register allocator does not model separate
+functional units well resulting in instable performance.
+.RE
+.RS 4
+.RE
+.IP "\fB\-masm=\fR\fIdialect\fR" 4
+.IX Item "-masm=dialect"
+Output asm instructions using selected \fIdialect\fR. Supported
+choices are \fBintel\fR or \fBatt\fR (the default one). Darwin does
+not support \fBintel\fR.
+.IP "\fB\-mieee\-fp\fR" 4
+.IX Item "-mieee-fp"
+.PD 0
+.IP "\fB\-mno\-ieee\-fp\fR" 4
+.IX Item "-mno-ieee-fp"
+.PD
+Control whether or not the compiler uses \s-1IEEE\s0 floating point
+comparisons. These handle correctly the case where the result of a
+comparison is unordered.
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+Generate output containing library calls for floating point.
+\&\fBWarning:\fR the requisite libraries are not part of \s-1GCC\s0.
+Normally the facilities of the machine's usual C compiler are used, but
+this can't be done directly in cross-compilation. You must make your
+own arrangements to provide suitable library functions for
+cross-compilation.
+.Sp
+On machines where a function returns floating point results in the 80387
+register stack, some floating point opcodes may be emitted even if
+\&\fB\-msoft\-float\fR is used.
+.IP "\fB\-mno\-fp\-ret\-in\-387\fR" 4
+.IX Item "-mno-fp-ret-in-387"
+Do not use the \s-1FPU\s0 registers for return values of functions.
+.Sp
+The usual calling convention has functions return values of types
+\&\f(CW\*(C`float\*(C'\fR and \f(CW\*(C`double\*(C'\fR in an \s-1FPU\s0 register, even if there
+is no \s-1FPU\s0. The idea is that the operating system should emulate
+an \s-1FPU\s0.
+.Sp
+The option \fB\-mno\-fp\-ret\-in\-387\fR causes such values to be returned
+in ordinary \s-1CPU\s0 registers instead.
+.IP "\fB\-mno\-fancy\-math\-387\fR" 4
+.IX Item "-mno-fancy-math-387"
+Some 387 emulators do not support the \f(CW\*(C`sin\*(C'\fR, \f(CW\*(C`cos\*(C'\fR and
+\&\f(CW\*(C`sqrt\*(C'\fR instructions for the 387. Specify this option to avoid
+generating those instructions. This option is the default on FreeBSD,
+OpenBSD and NetBSD. This option is overridden when \fB\-march\fR
+indicates that the target cpu will always have an \s-1FPU\s0 and so the
+instruction will not need emulation. As of revision 2.6.1, these
+instructions are not generated unless you also use the
+\&\fB\-funsafe\-math\-optimizations\fR switch.
+.IP "\fB\-malign\-double\fR" 4
+.IX Item "-malign-double"
+.PD 0
+.IP "\fB\-mno\-align\-double\fR" 4
+.IX Item "-mno-align-double"
+.PD
+Control whether \s-1GCC\s0 aligns \f(CW\*(C`double\*(C'\fR, \f(CW\*(C`long double\*(C'\fR, and
+\&\f(CW\*(C`long long\*(C'\fR variables on a two word boundary or a one word
+boundary. Aligning \f(CW\*(C`double\*(C'\fR variables on a two word boundary will
+produce code that runs somewhat faster on a \fBPentium\fR at the
+expense of more memory.
+.Sp
+On x86\-64, \fB\-malign\-double\fR is enabled by default.
+.Sp
+\&\fBWarning:\fR if you use the \fB\-malign\-double\fR switch,
+structures containing the above types will be aligned differently than
+the published application binary interface specifications for the 386
+and will not be binary compatible with structures in code compiled
+without that switch.
+.IP "\fB\-m96bit\-long\-double\fR" 4
+.IX Item "-m96bit-long-double"
+.PD 0
+.IP "\fB\-m128bit\-long\-double\fR" 4
+.IX Item "-m128bit-long-double"
+.PD
+These switches control the size of \f(CW\*(C`long double\*(C'\fR type. The i386
+application binary interface specifies the size to be 96 bits,
+so \fB\-m96bit\-long\-double\fR is the default in 32 bit mode.
+.Sp
+Modern architectures (Pentium and newer) would prefer \f(CW\*(C`long double\*(C'\fR
+to be aligned to an 8 or 16 byte boundary. In arrays or structures
+conforming to the \s-1ABI\s0, this would not be possible. So specifying a
+\&\fB\-m128bit\-long\-double\fR will align \f(CW\*(C`long double\*(C'\fR
+to a 16 byte boundary by padding the \f(CW\*(C`long double\*(C'\fR with an additional
+32 bit zero.
+.Sp
+In the x86\-64 compiler, \fB\-m128bit\-long\-double\fR is the default choice as
+its \s-1ABI\s0 specifies that \f(CW\*(C`long double\*(C'\fR is to be aligned on 16 byte boundary.
+.Sp
+Notice that neither of these options enable any extra precision over the x87
+standard of 80 bits for a \f(CW\*(C`long double\*(C'\fR.
+.Sp
+\&\fBWarning:\fR if you override the default value for your target \s-1ABI\s0, the
+structures and arrays containing \f(CW\*(C`long double\*(C'\fR variables will change
+their size as well as function calling convention for function taking
+\&\f(CW\*(C`long double\*(C'\fR will be modified. Hence they will not be binary
+compatible with arrays or structures in code compiled without that switch.
+.IP "\fB\-mlarge\-data\-threshold=\fR\fInumber\fR" 4
+.IX Item "-mlarge-data-threshold=number"
+When \fB\-mcmodel=medium\fR is specified, the data greater than
+\&\fIthreshold\fR are placed in large data section. This value must be the
+same across all object linked into the binary and defaults to 65535.
+.IP "\fB\-mrtd\fR" 4
+.IX Item "-mrtd"
+Use a different function-calling convention, in which functions that
+take a fixed number of arguments return with the \f(CW\*(C`ret\*(C'\fR \fInum\fR
+instruction, which pops their arguments while returning. This saves one
+instruction in the caller since there is no need to pop the arguments
+there.
+.Sp
+You can specify that an individual function is called with this calling
+sequence with the function attribute \fBstdcall\fR. You can also
+override the \fB\-mrtd\fR option by using the function attribute
+\&\fBcdecl\fR.
+.Sp
+\&\fBWarning:\fR this calling convention is incompatible with the one
+normally used on Unix, so you cannot use it if you need to call
+libraries compiled with the Unix compiler.
+.Sp
+Also, you must provide function prototypes for all functions that
+take variable numbers of arguments (including \f(CW\*(C`printf\*(C'\fR);
+otherwise incorrect code will be generated for calls to those
+functions.
+.Sp
+In addition, seriously incorrect code will result if you call a
+function with too many arguments. (Normally, extra arguments are
+harmlessly ignored.)
+.IP "\fB\-mregparm=\fR\fInum\fR" 4
+.IX Item "-mregparm=num"
+Control how many registers are used to pass integer arguments. By
+default, no registers are used to pass arguments, and at most 3
+registers can be used. You can control this behavior for a specific
+function by using the function attribute \fBregparm\fR.
+.Sp
+\&\fBWarning:\fR if you use this switch, and
+\&\fInum\fR is nonzero, then you must build all modules with the same
+value, including any libraries. This includes the system libraries and
+startup modules.
+.IP "\fB\-msseregparm\fR" 4
+.IX Item "-msseregparm"
+Use \s-1SSE\s0 register passing conventions for float and double arguments
+and return values. You can control this behavior for a specific
+function by using the function attribute \fBsseregparm\fR.
+.Sp
+\&\fBWarning:\fR if you use this switch then you must build all
+modules with the same value, including any libraries. This includes
+the system libraries and startup modules.
+.IP "\fB\-mpc32\fR" 4
+.IX Item "-mpc32"
+.PD 0
+.IP "\fB\-mpc64\fR" 4
+.IX Item "-mpc64"
+.IP "\fB\-mpc80\fR" 4
+.IX Item "-mpc80"
+.PD
+Set 80387 floating-point precision to 32, 64 or 80 bits. When \fB\-mpc32\fR
+is specified, the significands of results of floating-point operations are
+rounded to 24 bits (single precision); \fB\-mpc64\fR rounds the
+significands of results of floating-point operations to 53 bits (double
+precision) and \fB\-mpc80\fR rounds the significands of results of
+floating-point operations to 64 bits (extended double precision), which is
+the default. When this option is used, floating-point operations in higher
+precisions are not available to the programmer without setting the \s-1FPU\s0
+control word explicitly.
+.Sp
+Setting the rounding of floating-point operations to less than the default
+80 bits can speed some programs by 2% or more. Note that some mathematical
+libraries assume that extended precision (80 bit) floating-point operations
+are enabled by default; routines in such libraries could suffer significant
+loss of accuracy, typically through so-called \*(L"catastrophic cancellation\*(R",
+when this option is used to set the precision to less than extended precision.
+.IP "\fB\-mstackrealign\fR" 4
+.IX Item "-mstackrealign"
+Realign the stack at entry. On the Intel x86, the \fB\-mstackrealign\fR
+option will generate an alternate prologue and epilogue that realigns the
+runtime stack if necessary. This supports mixing legacy codes that keep
+a 4\-byte aligned stack with modern codes that keep a 16\-byte stack for
+\&\s-1SSE\s0 compatibility. See also the attribute \f(CW\*(C`force_align_arg_pointer\*(C'\fR,
+applicable to individual functions.
+.IP "\fB\-mpreferred\-stack\-boundary=\fR\fInum\fR" 4
+.IX Item "-mpreferred-stack-boundary=num"
+Attempt to keep the stack boundary aligned to a 2 raised to \fInum\fR
+byte boundary. If \fB\-mpreferred\-stack\-boundary\fR is not specified,
+the default is 4 (16 bytes or 128 bits).
+.IP "\fB\-mincoming\-stack\-boundary=\fR\fInum\fR" 4
+.IX Item "-mincoming-stack-boundary=num"
+Assume the incoming stack is aligned to a 2 raised to \fInum\fR byte
+boundary. If \fB\-mincoming\-stack\-boundary\fR is not specified,
+the one specified by \fB\-mpreferred\-stack\-boundary\fR will be used.
+.Sp
+On Pentium and PentiumPro, \f(CW\*(C`double\*(C'\fR and \f(CW\*(C`long double\*(C'\fR values
+should be aligned to an 8 byte boundary (see \fB\-malign\-double\fR) or
+suffer significant run time performance penalties. On Pentium \s-1III\s0, the
+Streaming \s-1SIMD\s0 Extension (\s-1SSE\s0) data type \f(CW\*(C`_\|_m128\*(C'\fR may not work
+properly if it is not 16 byte aligned.
+.Sp
+To ensure proper alignment of this values on the stack, the stack boundary
+must be as aligned as that required by any value stored on the stack.
+Further, every function must be generated such that it keeps the stack
+aligned. Thus calling a function compiled with a higher preferred
+stack boundary from a function compiled with a lower preferred stack
+boundary will most likely misalign the stack. It is recommended that
+libraries that use callbacks always use the default setting.
+.Sp
+This extra alignment does consume extra stack space, and generally
+increases code size. Code that is sensitive to stack space usage, such
+as embedded systems and operating system kernels, may want to reduce the
+preferred alignment to \fB\-mpreferred\-stack\-boundary=2\fR.
+.IP "\fB\-mmmx\fR" 4
+.IX Item "-mmmx"
+.PD 0
+.IP "\fB\-mno\-mmx\fR" 4
+.IX Item "-mno-mmx"
+.IP "\fB\-msse\fR" 4
+.IX Item "-msse"
+.IP "\fB\-mno\-sse\fR" 4
+.IX Item "-mno-sse"
+.IP "\fB\-msse2\fR" 4
+.IX Item "-msse2"
+.IP "\fB\-mno\-sse2\fR" 4
+.IX Item "-mno-sse2"
+.IP "\fB\-msse3\fR" 4
+.IX Item "-msse3"
+.IP "\fB\-mno\-sse3\fR" 4
+.IX Item "-mno-sse3"
+.IP "\fB\-mssse3\fR" 4
+.IX Item "-mssse3"
+.IP "\fB\-mno\-ssse3\fR" 4
+.IX Item "-mno-ssse3"
+.IP "\fB\-msse4.1\fR" 4
+.IX Item "-msse4.1"
+.IP "\fB\-mno\-sse4.1\fR" 4
+.IX Item "-mno-sse4.1"
+.IP "\fB\-msse4.2\fR" 4
+.IX Item "-msse4.2"
+.IP "\fB\-mno\-sse4.2\fR" 4
+.IX Item "-mno-sse4.2"
+.IP "\fB\-msse4\fR" 4
+.IX Item "-msse4"
+.IP "\fB\-mno\-sse4\fR" 4
+.IX Item "-mno-sse4"
+.IP "\fB\-mavx\fR" 4
+.IX Item "-mavx"
+.IP "\fB\-mno\-avx\fR" 4
+.IX Item "-mno-avx"
+.IP "\fB\-maes\fR" 4
+.IX Item "-maes"
+.IP "\fB\-mno\-aes\fR" 4
+.IX Item "-mno-aes"
+.IP "\fB\-mpclmul\fR" 4
+.IX Item "-mpclmul"
+.IP "\fB\-mno\-pclmul\fR" 4
+.IX Item "-mno-pclmul"
+.IP "\fB\-msse4a\fR" 4
+.IX Item "-msse4a"
+.IP "\fB\-mno\-sse4a\fR" 4
+.IX Item "-mno-sse4a"
+.IP "\fB\-msse5\fR" 4
+.IX Item "-msse5"
+.IP "\fB\-mno\-sse5\fR" 4
+.IX Item "-mno-sse5"
+.IP "\fB\-m3dnow\fR" 4
+.IX Item "-m3dnow"
+.IP "\fB\-mno\-3dnow\fR" 4
+.IX Item "-mno-3dnow"
+.IP "\fB\-mpopcnt\fR" 4
+.IX Item "-mpopcnt"
+.IP "\fB\-mno\-popcnt\fR" 4
+.IX Item "-mno-popcnt"
+.IP "\fB\-mabm\fR" 4
+.IX Item "-mabm"
+.IP "\fB\-mno\-abm\fR" 4
+.IX Item "-mno-abm"
+.PD
+These switches enable or disable the use of instructions in the \s-1MMX\s0,
+\&\s-1SSE\s0, \s-1SSE2\s0, \s-1SSE3\s0, \s-1SSSE3\s0, \s-1SSE4\s0.1, \s-1AVX\s0, \s-1AES\s0, \s-1PCLMUL\s0, \s-1SSE4A\s0, \s-1SSE5\s0, \s-1ABM\s0 or
+3DNow! extended instruction sets.
+These extensions are also available as built-in functions: see
+\&\fBX86 Built-in Functions\fR, for details of the functions enabled and
+disabled by these switches.
+.Sp
+To have \s-1SSE/SSE2\s0 instructions generated automatically from floating-point
+code (as opposed to 387 instructions), see \fB\-mfpmath=sse\fR.
+.Sp
+\&\s-1GCC\s0 depresses SSEx instructions when \fB\-mavx\fR is used. Instead, it
+generates new \s-1AVX\s0 instructions or \s-1AVX\s0 equivalence for all SSEx instructions
+when needed.
+.Sp
+These options will enable \s-1GCC\s0 to use these extended instructions in
+generated code, even without \fB\-mfpmath=sse\fR. Applications which
+perform runtime \s-1CPU\s0 detection must compile separate files for each
+supported architecture, using the appropriate flags. In particular,
+the file containing the \s-1CPU\s0 detection code should be compiled without
+these options.
+.IP "\fB\-mcld\fR" 4
+.IX Item "-mcld"
+This option instructs \s-1GCC\s0 to emit a \f(CW\*(C`cld\*(C'\fR instruction in the prologue
+of functions that use string instructions. String instructions depend on
+the \s-1DF\s0 flag to select between autoincrement or autodecrement mode. While the
+\&\s-1ABI\s0 specifies the \s-1DF\s0 flag to be cleared on function entry, some operating
+systems violate this specification by not clearing the \s-1DF\s0 flag in their
+exception dispatchers. The exception handler can be invoked with the \s-1DF\s0 flag
+set which leads to wrong direction mode, when string instructions are used.
+This option can be enabled by default on 32\-bit x86 targets by configuring
+\&\s-1GCC\s0 with the \fB\-\-enable\-cld\fR configure option. Generation of \f(CW\*(C`cld\*(C'\fR
+instructions can be suppressed with the \fB\-mno\-cld\fR compiler option
+in this case.
+.IP "\fB\-mcx16\fR" 4
+.IX Item "-mcx16"
+This option will enable \s-1GCC\s0 to use \s-1CMPXCHG16B\s0 instruction in generated code.
+\&\s-1CMPXCHG16B\s0 allows for atomic operations on 128\-bit double quadword (or oword)
+data types. This is useful for high resolution counters that could be updated
+by multiple processors (or cores). This instruction is generated as part of
+atomic built-in functions: see \fBAtomic Builtins\fR for details.
+.IP "\fB\-msahf\fR" 4
+.IX Item "-msahf"
+This option will enable \s-1GCC\s0 to use \s-1SAHF\s0 instruction in generated 64\-bit code.
+Early Intel CPUs with Intel 64 lacked \s-1LAHF\s0 and \s-1SAHF\s0 instructions supported
+by \s-1AMD64\s0 until introduction of Pentium 4 G1 step in December 2005. \s-1LAHF\s0 and
+\&\s-1SAHF\s0 are load and store instructions, respectively, for certain status flags.
+In 64\-bit mode, \s-1SAHF\s0 instruction is used to optimize \f(CW\*(C`fmod\*(C'\fR, \f(CW\*(C`drem\*(C'\fR
+or \f(CW\*(C`remainder\*(C'\fR built-in functions: see \fBOther Builtins\fR for details.
+.IP "\fB\-mrecip\fR" 4
+.IX Item "-mrecip"
+This option will enable \s-1GCC\s0 to use \s-1RCPSS\s0 and \s-1RSQRTSS\s0 instructions (and their
+vectorized variants \s-1RCPPS\s0 and \s-1RSQRTPS\s0) with an additional Newton-Raphson step
+to increase precision instead of \s-1DIVSS\s0 and \s-1SQRTSS\s0 (and their vectorized
+variants) for single precision floating point arguments. These instructions
+are generated only when \fB\-funsafe\-math\-optimizations\fR is enabled
+together with \fB\-finite\-math\-only\fR and \fB\-fno\-trapping\-math\fR.
+Note that while the throughput of the sequence is higher than the throughput
+of the non-reciprocal instruction, the precision of the sequence can be
+decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
+.IP "\fB\-mveclibabi=\fR\fItype\fR" 4
+.IX Item "-mveclibabi=type"
+Specifies the \s-1ABI\s0 type to use for vectorizing intrinsics using an
+external library. Supported types are \f(CW\*(C`svml\*(C'\fR for the Intel short
+vector math library and \f(CW\*(C`acml\*(C'\fR for the \s-1AMD\s0 math core library style
+of interfacing. \s-1GCC\s0 will currently emit calls to \f(CW\*(C`vmldExp2\*(C'\fR,
+\&\f(CW\*(C`vmldLn2\*(C'\fR, \f(CW\*(C`vmldLog102\*(C'\fR, \f(CW\*(C`vmldLog102\*(C'\fR, \f(CW\*(C`vmldPow2\*(C'\fR,
+\&\f(CW\*(C`vmldTanh2\*(C'\fR, \f(CW\*(C`vmldTan2\*(C'\fR, \f(CW\*(C`vmldAtan2\*(C'\fR, \f(CW\*(C`vmldAtanh2\*(C'\fR,
+\&\f(CW\*(C`vmldCbrt2\*(C'\fR, \f(CW\*(C`vmldSinh2\*(C'\fR, \f(CW\*(C`vmldSin2\*(C'\fR, \f(CW\*(C`vmldAsinh2\*(C'\fR,
+\&\f(CW\*(C`vmldAsin2\*(C'\fR, \f(CW\*(C`vmldCosh2\*(C'\fR, \f(CW\*(C`vmldCos2\*(C'\fR, \f(CW\*(C`vmldAcosh2\*(C'\fR,
+\&\f(CW\*(C`vmldAcos2\*(C'\fR, \f(CW\*(C`vmlsExp4\*(C'\fR, \f(CW\*(C`vmlsLn4\*(C'\fR, \f(CW\*(C`vmlsLog104\*(C'\fR,
+\&\f(CW\*(C`vmlsLog104\*(C'\fR, \f(CW\*(C`vmlsPow4\*(C'\fR, \f(CW\*(C`vmlsTanh4\*(C'\fR, \f(CW\*(C`vmlsTan4\*(C'\fR,
+\&\f(CW\*(C`vmlsAtan4\*(C'\fR, \f(CW\*(C`vmlsAtanh4\*(C'\fR, \f(CW\*(C`vmlsCbrt4\*(C'\fR, \f(CW\*(C`vmlsSinh4\*(C'\fR,
+\&\f(CW\*(C`vmlsSin4\*(C'\fR, \f(CW\*(C`vmlsAsinh4\*(C'\fR, \f(CW\*(C`vmlsAsin4\*(C'\fR, \f(CW\*(C`vmlsCosh4\*(C'\fR,
+\&\f(CW\*(C`vmlsCos4\*(C'\fR, \f(CW\*(C`vmlsAcosh4\*(C'\fR and \f(CW\*(C`vmlsAcos4\*(C'\fR for corresponding
+function type when \fB\-mveclibabi=svml\fR is used and \f(CW\*(C`_\|_vrd2_sin\*(C'\fR,
+\&\f(CW\*(C`_\|_vrd2_cos\*(C'\fR, \f(CW\*(C`_\|_vrd2_exp\*(C'\fR, \f(CW\*(C`_\|_vrd2_log\*(C'\fR, \f(CW\*(C`_\|_vrd2_log2\*(C'\fR,
+\&\f(CW\*(C`_\|_vrd2_log10\*(C'\fR, \f(CW\*(C`_\|_vrs4_sinf\*(C'\fR, \f(CW\*(C`_\|_vrs4_cosf\*(C'\fR,
+\&\f(CW\*(C`_\|_vrs4_expf\*(C'\fR, \f(CW\*(C`_\|_vrs4_logf\*(C'\fR, \f(CW\*(C`_\|_vrs4_log2f\*(C'\fR,
+\&\f(CW\*(C`_\|_vrs4_log10f\*(C'\fR and \f(CW\*(C`_\|_vrs4_powf\*(C'\fR for corresponding function type
+when \fB\-mveclibabi=acml\fR is used. Both \fB\-ftree\-vectorize\fR and
+\&\fB\-funsafe\-math\-optimizations\fR have to be enabled. A \s-1SVML\s0 or \s-1ACML\s0 \s-1ABI\s0
+compatible library will have to be specified at link time.
+.IP "\fB\-mpush\-args\fR" 4
+.IX Item "-mpush-args"
+.PD 0
+.IP "\fB\-mno\-push\-args\fR" 4
+.IX Item "-mno-push-args"
+.PD
+Use \s-1PUSH\s0 operations to store outgoing parameters. This method is shorter
+and usually equally fast as method using \s-1SUB/MOV\s0 operations and is enabled
+by default. In some cases disabling it may improve performance because of
+improved scheduling and reduced dependencies.
+.IP "\fB\-maccumulate\-outgoing\-args\fR" 4
+.IX Item "-maccumulate-outgoing-args"
+If enabled, the maximum amount of space required for outgoing arguments will be
+computed in the function prologue. This is faster on most modern CPUs
+because of reduced dependencies, improved scheduling and reduced stack usage
+when preferred stack boundary is not equal to 2. The drawback is a notable
+increase in code size. This switch implies \fB\-mno\-push\-args\fR.
+.IP "\fB\-mthreads\fR" 4
+.IX Item "-mthreads"
+Support thread-safe exception handling on \fBMingw32\fR. Code that relies
+on thread-safe exception handling must compile and link all code with the
+\&\fB\-mthreads\fR option. When compiling, \fB\-mthreads\fR defines
+\&\fB\-D_MT\fR; when linking, it links in a special thread helper library
+\&\fB\-lmingwthrd\fR which cleans up per thread exception handling data.
+.IP "\fB\-mno\-align\-stringops\fR" 4
+.IX Item "-mno-align-stringops"
+Do not align destination of inlined string operations. This switch reduces
+code size and improves performance in case the destination is already aligned,
+but \s-1GCC\s0 doesn't know about it.
+.IP "\fB\-minline\-all\-stringops\fR" 4
+.IX Item "-minline-all-stringops"
+By default \s-1GCC\s0 inlines string operations only when destination is known to be
+aligned at least to 4 byte boundary. This enables more inlining, increase code
+size, but may improve performance of code that depends on fast memcpy, strlen
+and memset for short lengths.
+.IP "\fB\-minline\-stringops\-dynamically\fR" 4
+.IX Item "-minline-stringops-dynamically"
+For string operation of unknown size, inline runtime checks so for small
+blocks inline code is used, while for large blocks library call is used.
+.IP "\fB\-mstringop\-strategy=\fR\fIalg\fR" 4
+.IX Item "-mstringop-strategy=alg"
+Overwrite internal decision heuristic about particular algorithm to inline
+string operation with. The allowed values are \f(CW\*(C`rep_byte\*(C'\fR,
+\&\f(CW\*(C`rep_4byte\*(C'\fR, \f(CW\*(C`rep_8byte\*(C'\fR for expanding using i386 \f(CW\*(C`rep\*(C'\fR prefix
+of specified size, \f(CW\*(C`byte_loop\*(C'\fR, \f(CW\*(C`loop\*(C'\fR, \f(CW\*(C`unrolled_loop\*(C'\fR for
+expanding inline loop, \f(CW\*(C`libcall\*(C'\fR for always expanding library call.
+.IP "\fB\-momit\-leaf\-frame\-pointer\fR" 4
+.IX Item "-momit-leaf-frame-pointer"
+Don't keep the frame pointer in a register for leaf functions. This
+avoids the instructions to save, set up and restore frame pointers and
+makes an extra register available in leaf functions. The option
+\&\fB\-fomit\-frame\-pointer\fR removes the frame pointer for all functions
+which might make debugging harder.
+.IP "\fB\-mtls\-direct\-seg\-refs\fR" 4
+.IX Item "-mtls-direct-seg-refs"
+.PD 0
+.IP "\fB\-mno\-tls\-direct\-seg\-refs\fR" 4
+.IX Item "-mno-tls-direct-seg-refs"
+.PD
+Controls whether \s-1TLS\s0 variables may be accessed with offsets from the
+\&\s-1TLS\s0 segment register (\f(CW%gs\fR for 32\-bit, \f(CW%fs\fR for 64\-bit),
+or whether the thread base pointer must be added. Whether or not this
+is legal depends on the operating system, and whether it maps the
+segment to cover the entire \s-1TLS\s0 area.
+.Sp
+For systems that use \s-1GNU\s0 libc, the default is on.
+.IP "\fB\-mfused\-madd\fR" 4
+.IX Item "-mfused-madd"
+.PD 0
+.IP "\fB\-mno\-fused\-madd\fR" 4
+.IX Item "-mno-fused-madd"
+.PD
+Enable automatic generation of fused floating point multiply-add instructions
+if the \s-1ISA\s0 supports such instructions. The \-mfused\-madd option is on by
+default. The fused multiply-add instructions have a different
+rounding behavior compared to executing a multiply followed by an add.
+.IP "\fB\-msse2avx\fR" 4
+.IX Item "-msse2avx"
+.PD 0
+.IP "\fB\-mno\-sse2avx\fR" 4
+.IX Item "-mno-sse2avx"
+.PD
+Specify that the assembler should encode \s-1SSE\s0 instructions with \s-1VEX\s0
+prefix. The option \fB\-mavx\fR turns this on by default.
+.PP
+These \fB\-m\fR switches are supported in addition to the above
+on \s-1AMD\s0 x86\-64 processors in 64\-bit environments.
+.IP "\fB\-m32\fR" 4
+.IX Item "-m32"
+.PD 0
+.IP "\fB\-m64\fR" 4
+.IX Item "-m64"
+.PD
+Generate code for a 32\-bit or 64\-bit environment.
+The 32\-bit environment sets int, long and pointer to 32 bits and
+generates code that runs on any i386 system.
+The 64\-bit environment sets int to 32 bits and long and pointer
+to 64 bits and generates code for \s-1AMD\s0's x86\-64 architecture. For
+darwin only the \-m64 option turns off the \fB\-fno\-pic\fR and
+\&\fB\-mdynamic\-no\-pic\fR options.
+.IP "\fB\-mno\-red\-zone\fR" 4
+.IX Item "-mno-red-zone"
+Do not use a so called red zone for x86\-64 code. The red zone is mandated
+by the x86\-64 \s-1ABI\s0, it is a 128\-byte area beyond the location of the
+stack pointer that will not be modified by signal or interrupt handlers
+and therefore can be used for temporary data without adjusting the stack
+pointer. The flag \fB\-mno\-red\-zone\fR disables this red zone.
+.IP "\fB\-mcmodel=small\fR" 4
+.IX Item "-mcmodel=small"
+Generate code for the small code model: the program and its symbols must
+be linked in the lower 2 \s-1GB\s0 of the address space. Pointers are 64 bits.
+Programs can be statically or dynamically linked. This is the default
+code model.
+.IP "\fB\-mcmodel=kernel\fR" 4
+.IX Item "-mcmodel=kernel"
+Generate code for the kernel code model. The kernel runs in the
+negative 2 \s-1GB\s0 of the address space.
+This model has to be used for Linux kernel code.
+.IP "\fB\-mcmodel=medium\fR" 4
+.IX Item "-mcmodel=medium"
+Generate code for the medium model: The program is linked in the lower 2
+\&\s-1GB\s0 of the address space. Small symbols are also placed there. Symbols
+with sizes larger than \fB\-mlarge\-data\-threshold\fR are put into
+large data or bss sections and can be located above 2GB. Programs can
+be statically or dynamically linked.
+.IP "\fB\-mcmodel=large\fR" 4
+.IX Item "-mcmodel=large"
+Generate code for the large model: This model makes no assumptions
+about addresses and sizes of sections.
+.PP
+\fI\s-1IA\-64\s0 Options\fR
+.IX Subsection "IA-64 Options"
+.PP
+These are the \fB\-m\fR options defined for the Intel \s-1IA\-64\s0 architecture.
+.IP "\fB\-mbig\-endian\fR" 4
+.IX Item "-mbig-endian"
+Generate code for a big endian target. This is the default for HP-UX.
+.IP "\fB\-mlittle\-endian\fR" 4
+.IX Item "-mlittle-endian"
+Generate code for a little endian target. This is the default for \s-1AIX5\s0
+and GNU/Linux.
+.IP "\fB\-mgnu\-as\fR" 4
+.IX Item "-mgnu-as"
+.PD 0
+.IP "\fB\-mno\-gnu\-as\fR" 4
+.IX Item "-mno-gnu-as"
+.PD
+Generate (or don't) code for the \s-1GNU\s0 assembler. This is the default.
+.IP "\fB\-mgnu\-ld\fR" 4
+.IX Item "-mgnu-ld"
+.PD 0
+.IP "\fB\-mno\-gnu\-ld\fR" 4
+.IX Item "-mno-gnu-ld"
+.PD
+Generate (or don't) code for the \s-1GNU\s0 linker. This is the default.
+.IP "\fB\-mno\-pic\fR" 4
+.IX Item "-mno-pic"
+Generate code that does not use a global pointer register. The result
+is not position independent code, and violates the \s-1IA\-64\s0 \s-1ABI\s0.
+.IP "\fB\-mvolatile\-asm\-stop\fR" 4
+.IX Item "-mvolatile-asm-stop"
+.PD 0
+.IP "\fB\-mno\-volatile\-asm\-stop\fR" 4
+.IX Item "-mno-volatile-asm-stop"
+.PD
+Generate (or don't) a stop bit immediately before and after volatile asm
+statements.
+.IP "\fB\-mregister\-names\fR" 4
+.IX Item "-mregister-names"
+.PD 0
+.IP "\fB\-mno\-register\-names\fR" 4
+.IX Item "-mno-register-names"
+.PD
+Generate (or don't) \fBin\fR, \fBloc\fR, and \fBout\fR register names for
+the stacked registers. This may make assembler output more readable.
+.IP "\fB\-mno\-sdata\fR" 4
+.IX Item "-mno-sdata"
+.PD 0
+.IP "\fB\-msdata\fR" 4
+.IX Item "-msdata"
+.PD
+Disable (or enable) optimizations that use the small data section. This may
+be useful for working around optimizer bugs.
+.IP "\fB\-mconstant\-gp\fR" 4
+.IX Item "-mconstant-gp"
+Generate code that uses a single constant global pointer value. This is
+useful when compiling kernel code.
+.IP "\fB\-mauto\-pic\fR" 4
+.IX Item "-mauto-pic"
+Generate code that is self-relocatable. This implies \fB\-mconstant\-gp\fR.
+This is useful when compiling firmware code.
+.IP "\fB\-minline\-float\-divide\-min\-latency\fR" 4
+.IX Item "-minline-float-divide-min-latency"
+Generate code for inline divides of floating point values
+using the minimum latency algorithm.
+.IP "\fB\-minline\-float\-divide\-max\-throughput\fR" 4
+.IX Item "-minline-float-divide-max-throughput"
+Generate code for inline divides of floating point values
+using the maximum throughput algorithm.
+.IP "\fB\-minline\-int\-divide\-min\-latency\fR" 4
+.IX Item "-minline-int-divide-min-latency"
+Generate code for inline divides of integer values
+using the minimum latency algorithm.
+.IP "\fB\-minline\-int\-divide\-max\-throughput\fR" 4
+.IX Item "-minline-int-divide-max-throughput"
+Generate code for inline divides of integer values
+using the maximum throughput algorithm.
+.IP "\fB\-minline\-sqrt\-min\-latency\fR" 4
+.IX Item "-minline-sqrt-min-latency"
+Generate code for inline square roots
+using the minimum latency algorithm.
+.IP "\fB\-minline\-sqrt\-max\-throughput\fR" 4
+.IX Item "-minline-sqrt-max-throughput"
+Generate code for inline square roots
+using the maximum throughput algorithm.
+.IP "\fB\-mno\-dwarf2\-asm\fR" 4
+.IX Item "-mno-dwarf2-asm"
+.PD 0
+.IP "\fB\-mdwarf2\-asm\fR" 4
+.IX Item "-mdwarf2-asm"
+.PD
+Don't (or do) generate assembler code for the \s-1DWARF2\s0 line number debugging
+info. This may be useful when not using the \s-1GNU\s0 assembler.
+.IP "\fB\-mearly\-stop\-bits\fR" 4
+.IX Item "-mearly-stop-bits"
+.PD 0
+.IP "\fB\-mno\-early\-stop\-bits\fR" 4
+.IX Item "-mno-early-stop-bits"
+.PD
+Allow stop bits to be placed earlier than immediately preceding the
+instruction that triggered the stop bit. This can improve instruction
+scheduling, but does not always do so.
+.IP "\fB\-mfixed\-range=\fR\fIregister-range\fR" 4
+.IX Item "-mfixed-range=register-range"
+Generate code treating the given register range as fixed registers.
+A fixed register is one that the register allocator can not use. This is
+useful when compiling kernel code. A register range is specified as
+two registers separated by a dash. Multiple register ranges can be
+specified separated by a comma.
+.IP "\fB\-mtls\-size=\fR\fItls-size\fR" 4
+.IX Item "-mtls-size=tls-size"
+Specify bit size of immediate \s-1TLS\s0 offsets. Valid values are 14, 22, and
+64.
+.IP "\fB\-mtune=\fR\fIcpu-type\fR" 4
+.IX Item "-mtune=cpu-type"
+Tune the instruction scheduling for a particular \s-1CPU\s0, Valid values are
+itanium, itanium1, merced, itanium2, and mckinley.
+.IP "\fB\-mt\fR" 4
+.IX Item "-mt"
+.PD 0
+.IP "\fB\-pthread\fR" 4
+.IX Item "-pthread"
+.PD
+Add support for multithreading using the \s-1POSIX\s0 threads library. This
+option sets flags for both the preprocessor and linker. It does
+not affect the thread safety of object code produced by the compiler or
+that of libraries supplied with it. These are HP-UX specific flags.
+.IP "\fB\-milp32\fR" 4
+.IX Item "-milp32"
+.PD 0
+.IP "\fB\-mlp64\fR" 4
+.IX Item "-mlp64"
+.PD
+Generate code for a 32\-bit or 64\-bit environment.
+The 32\-bit environment sets int, long and pointer to 32 bits.
+The 64\-bit environment sets int to 32 bits and long and pointer
+to 64 bits. These are HP-UX specific flags.
+.IP "\fB\-mno\-sched\-br\-data\-spec\fR" 4
+.IX Item "-mno-sched-br-data-spec"
+.PD 0
+.IP "\fB\-msched\-br\-data\-spec\fR" 4
+.IX Item "-msched-br-data-spec"
+.PD
+(Dis/En)able data speculative scheduling before reload.
+This will result in generation of the ld.a instructions and
+the corresponding check instructions (ld.c / chk.a).
+The default is 'disable'.
+.IP "\fB\-msched\-ar\-data\-spec\fR" 4
+.IX Item "-msched-ar-data-spec"
+.PD 0
+.IP "\fB\-mno\-sched\-ar\-data\-spec\fR" 4
+.IX Item "-mno-sched-ar-data-spec"
+.PD
+(En/Dis)able data speculative scheduling after reload.
+This will result in generation of the ld.a instructions and
+the corresponding check instructions (ld.c / chk.a).
+The default is 'enable'.
+.IP "\fB\-mno\-sched\-control\-spec\fR" 4
+.IX Item "-mno-sched-control-spec"
+.PD 0
+.IP "\fB\-msched\-control\-spec\fR" 4
+.IX Item "-msched-control-spec"
+.PD
+(Dis/En)able control speculative scheduling. This feature is
+available only during region scheduling (i.e. before reload).
+This will result in generation of the ld.s instructions and
+the corresponding check instructions chk.s .
+The default is 'disable'.
+.IP "\fB\-msched\-br\-in\-data\-spec\fR" 4
+.IX Item "-msched-br-in-data-spec"
+.PD 0
+.IP "\fB\-mno\-sched\-br\-in\-data\-spec\fR" 4
+.IX Item "-mno-sched-br-in-data-spec"
+.PD
+(En/Dis)able speculative scheduling of the instructions that
+are dependent on the data speculative loads before reload.
+This is effective only with \fB\-msched\-br\-data\-spec\fR enabled.
+The default is 'enable'.
+.IP "\fB\-msched\-ar\-in\-data\-spec\fR" 4
+.IX Item "-msched-ar-in-data-spec"
+.PD 0
+.IP "\fB\-mno\-sched\-ar\-in\-data\-spec\fR" 4
+.IX Item "-mno-sched-ar-in-data-spec"
+.PD
+(En/Dis)able speculative scheduling of the instructions that
+are dependent on the data speculative loads after reload.
+This is effective only with \fB\-msched\-ar\-data\-spec\fR enabled.
+The default is 'enable'.
+.IP "\fB\-msched\-in\-control\-spec\fR" 4
+.IX Item "-msched-in-control-spec"
+.PD 0
+.IP "\fB\-mno\-sched\-in\-control\-spec\fR" 4
+.IX Item "-mno-sched-in-control-spec"
+.PD
+(En/Dis)able speculative scheduling of the instructions that
+are dependent on the control speculative loads.
+This is effective only with \fB\-msched\-control\-spec\fR enabled.
+The default is 'enable'.
+.IP "\fB\-msched\-ldc\fR" 4
+.IX Item "-msched-ldc"
+.PD 0
+.IP "\fB\-mno\-sched\-ldc\fR" 4
+.IX Item "-mno-sched-ldc"
+.PD
+(En/Dis)able use of simple data speculation checks ld.c .
+If disabled, only chk.a instructions will be emitted to check
+data speculative loads.
+The default is 'enable'.
+.IP "\fB\-mno\-sched\-control\-ldc\fR" 4
+.IX Item "-mno-sched-control-ldc"
+.PD 0
+.IP "\fB\-msched\-control\-ldc\fR" 4
+.IX Item "-msched-control-ldc"
+.PD
+(Dis/En)able use of ld.c instructions to check control speculative loads.
+If enabled, in case of control speculative load with no speculatively
+scheduled dependent instructions this load will be emitted as ld.sa and
+ld.c will be used to check it.
+The default is 'disable'.
+.IP "\fB\-mno\-sched\-spec\-verbose\fR" 4
+.IX Item "-mno-sched-spec-verbose"
+.PD 0
+.IP "\fB\-msched\-spec\-verbose\fR" 4
+.IX Item "-msched-spec-verbose"
+.PD
+(Dis/En)able printing of the information about speculative motions.
+.IP "\fB\-mno\-sched\-prefer\-non\-data\-spec\-insns\fR" 4
+.IX Item "-mno-sched-prefer-non-data-spec-insns"
+.PD 0
+.IP "\fB\-msched\-prefer\-non\-data\-spec\-insns\fR" 4
+.IX Item "-msched-prefer-non-data-spec-insns"
+.PD
+If enabled, data speculative instructions will be chosen for schedule
+only if there are no other choices at the moment. This will make
+the use of the data speculation much more conservative.
+The default is 'disable'.
+.IP "\fB\-mno\-sched\-prefer\-non\-control\-spec\-insns\fR" 4
+.IX Item "-mno-sched-prefer-non-control-spec-insns"
+.PD 0
+.IP "\fB\-msched\-prefer\-non\-control\-spec\-insns\fR" 4
+.IX Item "-msched-prefer-non-control-spec-insns"
+.PD
+If enabled, control speculative instructions will be chosen for schedule
+only if there are no other choices at the moment. This will make
+the use of the control speculation much more conservative.
+The default is 'disable'.
+.IP "\fB\-mno\-sched\-count\-spec\-in\-critical\-path\fR" 4
+.IX Item "-mno-sched-count-spec-in-critical-path"
+.PD 0
+.IP "\fB\-msched\-count\-spec\-in\-critical\-path\fR" 4
+.IX Item "-msched-count-spec-in-critical-path"
+.PD
+If enabled, speculative dependencies will be considered during
+computation of the instructions priorities. This will make the use of the
+speculation a bit more conservative.
+The default is 'disable'.
+.PP
+\fIM32C Options\fR
+.IX Subsection "M32C Options"
+.IP "\fB\-mcpu=\fR\fIname\fR" 4
+.IX Item "-mcpu=name"
+Select the \s-1CPU\s0 for which code is generated. \fIname\fR may be one of
+\&\fBr8c\fR for the R8C/Tiny series, \fBm16c\fR for the M16C (up to
+/60) series, \fBm32cm\fR for the M16C/80 series, or \fBm32c\fR for
+the M32C/80 series.
+.IP "\fB\-msim\fR" 4
+.IX Item "-msim"
+Specifies that the program will be run on the simulator. This causes
+an alternate runtime library to be linked in which supports, for
+example, file I/O. You must not use this option when generating
+programs that will run on real hardware; you must provide your own
+runtime library for whatever I/O functions are needed.
+.IP "\fB\-memregs=\fR\fInumber\fR" 4
+.IX Item "-memregs=number"
+Specifies the number of memory-based pseudo-registers \s-1GCC\s0 will use
+during code generation. These pseudo-registers will be used like real
+registers, so there is a tradeoff between \s-1GCC\s0's ability to fit the
+code into available registers, and the performance penalty of using
+memory instead of registers. Note that all modules in a program must
+be compiled with the same value for this option. Because of that, you
+must not use this option with the default runtime libraries gcc
+builds.
+.PP
+\fIM32R/D Options\fR
+.IX Subsection "M32R/D Options"
+.PP
+These \fB\-m\fR options are defined for Renesas M32R/D architectures:
+.IP "\fB\-m32r2\fR" 4
+.IX Item "-m32r2"
+Generate code for the M32R/2.
+.IP "\fB\-m32rx\fR" 4
+.IX Item "-m32rx"
+Generate code for the M32R/X.
+.IP "\fB\-m32r\fR" 4
+.IX Item "-m32r"
+Generate code for the M32R. This is the default.
+.IP "\fB\-mmodel=small\fR" 4
+.IX Item "-mmodel=small"
+Assume all objects live in the lower 16MB of memory (so that their addresses
+can be loaded with the \f(CW\*(C`ld24\*(C'\fR instruction), and assume all subroutines
+are reachable with the \f(CW\*(C`bl\*(C'\fR instruction.
+This is the default.
+.Sp
+The addressability of a particular object can be set with the
+\&\f(CW\*(C`model\*(C'\fR attribute.
+.IP "\fB\-mmodel=medium\fR" 4
+.IX Item "-mmodel=medium"
+Assume objects may be anywhere in the 32\-bit address space (the compiler
+will generate \f(CW\*(C`seth/add3\*(C'\fR instructions to load their addresses), and
+assume all subroutines are reachable with the \f(CW\*(C`bl\*(C'\fR instruction.
+.IP "\fB\-mmodel=large\fR" 4
+.IX Item "-mmodel=large"
+Assume objects may be anywhere in the 32\-bit address space (the compiler
+will generate \f(CW\*(C`seth/add3\*(C'\fR instructions to load their addresses), and
+assume subroutines may not be reachable with the \f(CW\*(C`bl\*(C'\fR instruction
+(the compiler will generate the much slower \f(CW\*(C`seth/add3/jl\*(C'\fR
+instruction sequence).
+.IP "\fB\-msdata=none\fR" 4
+.IX Item "-msdata=none"
+Disable use of the small data area. Variables will be put into
+one of \fB.data\fR, \fBbss\fR, or \fB.rodata\fR (unless the
+\&\f(CW\*(C`section\*(C'\fR attribute has been specified).
+This is the default.
+.Sp
+The small data area consists of sections \fB.sdata\fR and \fB.sbss\fR.
+Objects may be explicitly put in the small data area with the
+\&\f(CW\*(C`section\*(C'\fR attribute using one of these sections.
+.IP "\fB\-msdata=sdata\fR" 4
+.IX Item "-msdata=sdata"
+Put small global and static data in the small data area, but do not
+generate special code to reference them.
+.IP "\fB\-msdata=use\fR" 4
+.IX Item "-msdata=use"
+Put small global and static data in the small data area, and generate
+special instructions to reference them.
+.IP "\fB\-G\fR \fInum\fR" 4
+.IX Item "-G num"
+Put global and static objects less than or equal to \fInum\fR bytes
+into the small data or bss sections instead of the normal data or bss
+sections. The default value of \fInum\fR is 8.
+The \fB\-msdata\fR option must be set to one of \fBsdata\fR or \fBuse\fR
+for this option to have any effect.
+.Sp
+All modules should be compiled with the same \fB\-G\fR \fInum\fR value.
+Compiling with different values of \fInum\fR may or may not work; if it
+doesn't the linker will give an error message\-\-\-incorrect code will not be
+generated.
+.IP "\fB\-mdebug\fR" 4
+.IX Item "-mdebug"
+Makes the M32R specific code in the compiler display some statistics
+that might help in debugging programs.
+.IP "\fB\-malign\-loops\fR" 4
+.IX Item "-malign-loops"
+Align all loops to a 32\-byte boundary.
+.IP "\fB\-mno\-align\-loops\fR" 4
+.IX Item "-mno-align-loops"
+Do not enforce a 32\-byte alignment for loops. This is the default.
+.IP "\fB\-missue\-rate=\fR\fInumber\fR" 4
+.IX Item "-missue-rate=number"
+Issue \fInumber\fR instructions per cycle. \fInumber\fR can only be 1
+or 2.
+.IP "\fB\-mbranch\-cost=\fR\fInumber\fR" 4
+.IX Item "-mbranch-cost=number"
+\&\fInumber\fR can only be 1 or 2. If it is 1 then branches will be
+preferred over conditional code, if it is 2, then the opposite will
+apply.
+.IP "\fB\-mflush\-trap=\fR\fInumber\fR" 4
+.IX Item "-mflush-trap=number"
+Specifies the trap number to use to flush the cache. The default is
+12. Valid numbers are between 0 and 15 inclusive.
+.IP "\fB\-mno\-flush\-trap\fR" 4
+.IX Item "-mno-flush-trap"
+Specifies that the cache cannot be flushed by using a trap.
+.IP "\fB\-mflush\-func=\fR\fIname\fR" 4
+.IX Item "-mflush-func=name"
+Specifies the name of the operating system function to call to flush
+the cache. The default is \fI_flush_cache\fR, but a function call
+will only be used if a trap is not available.
+.IP "\fB\-mno\-flush\-func\fR" 4
+.IX Item "-mno-flush-func"
+Indicates that there is no \s-1OS\s0 function for flushing the cache.
+.PP
+\fIM680x0 Options\fR
+.IX Subsection "M680x0 Options"
+.PP
+These are the \fB\-m\fR options defined for M680x0 and ColdFire processors.
+The default settings depend on which architecture was selected when
+the compiler was configured; the defaults for the most common choices
+are given below.
+.IP "\fB\-march=\fR\fIarch\fR" 4
+.IX Item "-march=arch"
+Generate code for a specific M680x0 or ColdFire instruction set
+architecture. Permissible values of \fIarch\fR for M680x0
+architectures are: \fB68000\fR, \fB68010\fR, \fB68020\fR,
+\&\fB68030\fR, \fB68040\fR, \fB68060\fR and \fBcpu32\fR. ColdFire
+architectures are selected according to Freescale's \s-1ISA\s0 classification
+and the permissible values are: \fBisaa\fR, \fBisaaplus\fR,
+\&\fBisab\fR and \fBisac\fR.
+.Sp
+gcc defines a macro \fB_\|_mcf\fR\fIarch\fR\fB_\|_\fR whenever it is generating
+code for a ColdFire target. The \fIarch\fR in this macro is one of the
+\&\fB\-march\fR arguments given above.
+.Sp
+When used together, \fB\-march\fR and \fB\-mtune\fR select code
+that runs on a family of similar processors but that is optimized
+for a particular microarchitecture.
+.IP "\fB\-mcpu=\fR\fIcpu\fR" 4
+.IX Item "-mcpu=cpu"
+Generate code for a specific M680x0 or ColdFire processor.
+The M680x0 \fIcpu\fRs are: \fB68000\fR, \fB68010\fR, \fB68020\fR,
+\&\fB68030\fR, \fB68040\fR, \fB68060\fR, \fB68302\fR, \fB68332\fR
+and \fBcpu32\fR. The ColdFire \fIcpu\fRs are given by the table
+below, which also classifies the CPUs into families:
+.RS 4
+.IP "Family : \fB\-mcpu\fR arguments" 4
+.IX Item "Family : -mcpu arguments"
+.PD 0
+.IP "\fB51qe\fR : \fB51qe\fR" 4
+.IX Item "51qe : 51qe"
+.IP "\fB5206\fR : \fB5202\fR \fB5204\fR \fB5206\fR" 4
+.IX Item "5206 : 5202 5204 5206"
+.IP "\fB5206e\fR : \fB5206e\fR" 4
+.IX Item "5206e : 5206e"
+.IP "\fB5208\fR : \fB5207\fR \fB5208\fR" 4
+.IX Item "5208 : 5207 5208"
+.IP "\fB5211a\fR : \fB5210a\fR \fB5211a\fR" 4
+.IX Item "5211a : 5210a 5211a"
+.IP "\fB5213\fR : \fB5211\fR \fB5212\fR \fB5213\fR" 4
+.IX Item "5213 : 5211 5212 5213"
+.IP "\fB5216\fR : \fB5214\fR \fB5216\fR" 4
+.IX Item "5216 : 5214 5216"
+.IP "\fB52235\fR : \fB52230\fR \fB52231\fR \fB52232\fR \fB52233\fR \fB52234\fR \fB52235\fR" 4
+.IX Item "52235 : 52230 52231 52232 52233 52234 52235"
+.IP "\fB5225\fR : \fB5224\fR \fB5225\fR" 4
+.IX Item "5225 : 5224 5225"
+.IP "\fB5235\fR : \fB5232\fR \fB5233\fR \fB5234\fR \fB5235\fR \fB523x\fR" 4
+.IX Item "5235 : 5232 5233 5234 5235 523x"
+.IP "\fB5249\fR : \fB5249\fR" 4
+.IX Item "5249 : 5249"
+.IP "\fB5250\fR : \fB5250\fR" 4
+.IX Item "5250 : 5250"
+.IP "\fB5271\fR : \fB5270\fR \fB5271\fR" 4
+.IX Item "5271 : 5270 5271"
+.IP "\fB5272\fR : \fB5272\fR" 4
+.IX Item "5272 : 5272"
+.IP "\fB5275\fR : \fB5274\fR \fB5275\fR" 4
+.IX Item "5275 : 5274 5275"
+.IP "\fB5282\fR : \fB5280\fR \fB5281\fR \fB5282\fR \fB528x\fR" 4
+.IX Item "5282 : 5280 5281 5282 528x"
+.IP "\fB5307\fR : \fB5307\fR" 4
+.IX Item "5307 : 5307"
+.IP "\fB5329\fR : \fB5327\fR \fB5328\fR \fB5329\fR \fB532x\fR" 4
+.IX Item "5329 : 5327 5328 5329 532x"
+.IP "\fB5373\fR : \fB5372\fR \fB5373\fR \fB537x\fR" 4
+.IX Item "5373 : 5372 5373 537x"
+.IP "\fB5407\fR : \fB5407\fR" 4
+.IX Item "5407 : 5407"
+.IP "\fB5475\fR : \fB5470\fR \fB5471\fR \fB5472\fR \fB5473\fR \fB5474\fR \fB5475\fR \fB547x\fR \fB5480\fR \fB5481\fR \fB5482\fR \fB5483\fR \fB5484\fR \fB5485\fR" 4
+.IX Item "5475 : 5470 5471 5472 5473 5474 5475 547x 5480 5481 5482 5483 5484 5485"
+.RE
+.RS 4
+.PD
+.Sp
+\&\fB\-mcpu=\fR\fIcpu\fR overrides \fB\-march=\fR\fIarch\fR if
+\&\fIarch\fR is compatible with \fIcpu\fR. Other combinations of
+\&\fB\-mcpu\fR and \fB\-march\fR are rejected.
+.Sp
+gcc defines the macro \fB_\|_mcf_cpu_\fR\fIcpu\fR when ColdFire target
+\&\fIcpu\fR is selected. It also defines \fB_\|_mcf_family_\fR\fIfamily\fR,
+where the value of \fIfamily\fR is given by the table above.
+.RE
+.IP "\fB\-mtune=\fR\fItune\fR" 4
+.IX Item "-mtune=tune"
+Tune the code for a particular microarchitecture, within the
+constraints set by \fB\-march\fR and \fB\-mcpu\fR.
+The M680x0 microarchitectures are: \fB68000\fR, \fB68010\fR,
+\&\fB68020\fR, \fB68030\fR, \fB68040\fR, \fB68060\fR
+and \fBcpu32\fR. The ColdFire microarchitectures
+are: \fBcfv1\fR, \fBcfv2\fR, \fBcfv3\fR, \fBcfv4\fR and \fBcfv4e\fR.
+.Sp
+You can also use \fB\-mtune=68020\-40\fR for code that needs
+to run relatively well on 68020, 68030 and 68040 targets.
+\&\fB\-mtune=68020\-60\fR is similar but includes 68060 targets
+as well. These two options select the same tuning decisions as
+\&\fB\-m68020\-40\fR and \fB\-m68020\-60\fR respectively.
+.Sp
+gcc defines the macros \fB_\|_mc\fR\fIarch\fR and \fB_\|_mc\fR\fIarch\fR\fB_\|_\fR
+when tuning for 680x0 architecture \fIarch\fR. It also defines
+\&\fBmc\fR\fIarch\fR unless either \fB\-ansi\fR or a non-GNU \fB\-std\fR
+option is used. If gcc is tuning for a range of architectures,
+as selected by \fB\-mtune=68020\-40\fR or \fB\-mtune=68020\-60\fR,
+it defines the macros for every architecture in the range.
+.Sp
+gcc also defines the macro \fB_\|_m\fR\fIuarch\fR\fB_\|_\fR when tuning for
+ColdFire microarchitecture \fIuarch\fR, where \fIuarch\fR is one
+of the arguments given above.
+.IP "\fB\-m68000\fR" 4
+.IX Item "-m68000"
+.PD 0
+.IP "\fB\-mc68000\fR" 4
+.IX Item "-mc68000"
+.PD
+Generate output for a 68000. This is the default
+when the compiler is configured for 68000\-based systems.
+It is equivalent to \fB\-march=68000\fR.
+.Sp
+Use this option for microcontrollers with a 68000 or \s-1EC000\s0 core,
+including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
+.IP "\fB\-m68010\fR" 4
+.IX Item "-m68010"
+Generate output for a 68010. This is the default
+when the compiler is configured for 68010\-based systems.
+It is equivalent to \fB\-march=68010\fR.
+.IP "\fB\-m68020\fR" 4
+.IX Item "-m68020"
+.PD 0
+.IP "\fB\-mc68020\fR" 4
+.IX Item "-mc68020"
+.PD
+Generate output for a 68020. This is the default
+when the compiler is configured for 68020\-based systems.
+It is equivalent to \fB\-march=68020\fR.
+.IP "\fB\-m68030\fR" 4
+.IX Item "-m68030"
+Generate output for a 68030. This is the default when the compiler is
+configured for 68030\-based systems. It is equivalent to
+\&\fB\-march=68030\fR.
+.IP "\fB\-m68040\fR" 4
+.IX Item "-m68040"
+Generate output for a 68040. This is the default when the compiler is
+configured for 68040\-based systems. It is equivalent to
+\&\fB\-march=68040\fR.
+.Sp
+This option inhibits the use of 68881/68882 instructions that have to be
+emulated by software on the 68040. Use this option if your 68040 does not
+have code to emulate those instructions.
+.IP "\fB\-m68060\fR" 4
+.IX Item "-m68060"
+Generate output for a 68060. This is the default when the compiler is
+configured for 68060\-based systems. It is equivalent to
+\&\fB\-march=68060\fR.
+.Sp
+This option inhibits the use of 68020 and 68881/68882 instructions that
+have to be emulated by software on the 68060. Use this option if your 68060
+does not have code to emulate those instructions.
+.IP "\fB\-mcpu32\fR" 4
+.IX Item "-mcpu32"
+Generate output for a \s-1CPU32\s0. This is the default
+when the compiler is configured for CPU32\-based systems.
+It is equivalent to \fB\-march=cpu32\fR.
+.Sp
+Use this option for microcontrollers with a
+\&\s-1CPU32\s0 or \s-1CPU32+\s0 core, including the 68330, 68331, 68332, 68333, 68334,
+68336, 68340, 68341, 68349 and 68360.
+.IP "\fB\-m5200\fR" 4
+.IX Item "-m5200"
+Generate output for a 520X ColdFire \s-1CPU\s0. This is the default
+when the compiler is configured for 520X\-based systems.
+It is equivalent to \fB\-mcpu=5206\fR, and is now deprecated
+in favor of that option.
+.Sp
+Use this option for microcontroller with a 5200 core, including
+the \s-1MCF5202\s0, \s-1MCF5203\s0, \s-1MCF5204\s0 and \s-1MCF5206\s0.
+.IP "\fB\-m5206e\fR" 4
+.IX Item "-m5206e"
+Generate output for a 5206e ColdFire \s-1CPU\s0. The option is now
+deprecated in favor of the equivalent \fB\-mcpu=5206e\fR.
+.IP "\fB\-m528x\fR" 4
+.IX Item "-m528x"
+Generate output for a member of the ColdFire 528X family.
+The option is now deprecated in favor of the equivalent
+\&\fB\-mcpu=528x\fR.
+.IP "\fB\-m5307\fR" 4
+.IX Item "-m5307"
+Generate output for a ColdFire 5307 \s-1CPU\s0. The option is now deprecated
+in favor of the equivalent \fB\-mcpu=5307\fR.
+.IP "\fB\-m5407\fR" 4
+.IX Item "-m5407"
+Generate output for a ColdFire 5407 \s-1CPU\s0. The option is now deprecated
+in favor of the equivalent \fB\-mcpu=5407\fR.
+.IP "\fB\-mcfv4e\fR" 4
+.IX Item "-mcfv4e"
+Generate output for a ColdFire V4e family \s-1CPU\s0 (e.g. 547x/548x).
+This includes use of hardware floating point instructions.
+The option is equivalent to \fB\-mcpu=547x\fR, and is now
+deprecated in favor of that option.
+.IP "\fB\-m68020\-40\fR" 4
+.IX Item "-m68020-40"
+Generate output for a 68040, without using any of the new instructions.
+This results in code which can run relatively efficiently on either a
+68020/68881 or a 68030 or a 68040. The generated code does use the
+68881 instructions that are emulated on the 68040.
+.Sp
+The option is equivalent to \fB\-march=68020\fR \fB\-mtune=68020\-40\fR.
+.IP "\fB\-m68020\-60\fR" 4
+.IX Item "-m68020-60"
+Generate output for a 68060, without using any of the new instructions.
+This results in code which can run relatively efficiently on either a
+68020/68881 or a 68030 or a 68040. The generated code does use the
+68881 instructions that are emulated on the 68060.
+.Sp
+The option is equivalent to \fB\-march=68020\fR \fB\-mtune=68020\-60\fR.
+.IP "\fB\-mhard\-float\fR" 4
+.IX Item "-mhard-float"
+.PD 0
+.IP "\fB\-m68881\fR" 4
+.IX Item "-m68881"
+.PD
+Generate floating-point instructions. This is the default for 68020
+and above, and for ColdFire devices that have an \s-1FPU\s0. It defines the
+macro \fB_\|_HAVE_68881_\|_\fR on M680x0 targets and \fB_\|_mcffpu_\|_\fR
+on ColdFire targets.
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+Do not generate floating-point instructions; use library calls instead.
+This is the default for 68000, 68010, and 68832 targets. It is also
+the default for ColdFire devices that have no \s-1FPU\s0.
+.IP "\fB\-mdiv\fR" 4
+.IX Item "-mdiv"
+.PD 0
+.IP "\fB\-mno\-div\fR" 4
+.IX Item "-mno-div"
+.PD
+Generate (do not generate) ColdFire hardware divide and remainder
+instructions. If \fB\-march\fR is used without \fB\-mcpu\fR,
+the default is \*(L"on\*(R" for ColdFire architectures and \*(L"off\*(R" for M680x0
+architectures. Otherwise, the default is taken from the target \s-1CPU\s0
+(either the default \s-1CPU\s0, or the one specified by \fB\-mcpu\fR). For
+example, the default is \*(L"off\*(R" for \fB\-mcpu=5206\fR and \*(L"on\*(R" for
+\&\fB\-mcpu=5206e\fR.
+.Sp
+gcc defines the macro \fB_\|_mcfhwdiv_\|_\fR when this option is enabled.
+.IP "\fB\-mshort\fR" 4
+.IX Item "-mshort"
+Consider type \f(CW\*(C`int\*(C'\fR to be 16 bits wide, like \f(CW\*(C`short int\*(C'\fR.
+Additionally, parameters passed on the stack are also aligned to a
+16\-bit boundary even on targets whose \s-1API\s0 mandates promotion to 32\-bit.
+.IP "\fB\-mno\-short\fR" 4
+.IX Item "-mno-short"
+Do not consider type \f(CW\*(C`int\*(C'\fR to be 16 bits wide. This is the default.
+.IP "\fB\-mnobitfield\fR" 4
+.IX Item "-mnobitfield"
+.PD 0
+.IP "\fB\-mno\-bitfield\fR" 4
+.IX Item "-mno-bitfield"
+.PD
+Do not use the bit-field instructions. The \fB\-m68000\fR, \fB\-mcpu32\fR
+and \fB\-m5200\fR options imply \fB\-mnobitfield\fR.
+.IP "\fB\-mbitfield\fR" 4
+.IX Item "-mbitfield"
+Do use the bit-field instructions. The \fB\-m68020\fR option implies
+\&\fB\-mbitfield\fR. This is the default if you use a configuration
+designed for a 68020.
+.IP "\fB\-mrtd\fR" 4
+.IX Item "-mrtd"
+Use a different function-calling convention, in which functions
+that take a fixed number of arguments return with the \f(CW\*(C`rtd\*(C'\fR
+instruction, which pops their arguments while returning. This
+saves one instruction in the caller since there is no need to pop
+the arguments there.
+.Sp
+This calling convention is incompatible with the one normally
+used on Unix, so you cannot use it if you need to call libraries
+compiled with the Unix compiler.
+.Sp
+Also, you must provide function prototypes for all functions that
+take variable numbers of arguments (including \f(CW\*(C`printf\*(C'\fR);
+otherwise incorrect code will be generated for calls to those
+functions.
+.Sp
+In addition, seriously incorrect code will result if you call a
+function with too many arguments. (Normally, extra arguments are
+harmlessly ignored.)
+.Sp
+The \f(CW\*(C`rtd\*(C'\fR instruction is supported by the 68010, 68020, 68030,
+68040, 68060 and \s-1CPU32\s0 processors, but not by the 68000 or 5200.
+.IP "\fB\-mno\-rtd\fR" 4
+.IX Item "-mno-rtd"
+Do not use the calling conventions selected by \fB\-mrtd\fR.
+This is the default.
+.IP "\fB\-malign\-int\fR" 4
+.IX Item "-malign-int"
+.PD 0
+.IP "\fB\-mno\-align\-int\fR" 4
+.IX Item "-mno-align-int"
+.PD
+Control whether \s-1GCC\s0 aligns \f(CW\*(C`int\*(C'\fR, \f(CW\*(C`long\*(C'\fR, \f(CW\*(C`long long\*(C'\fR,
+\&\f(CW\*(C`float\*(C'\fR, \f(CW\*(C`double\*(C'\fR, and \f(CW\*(C`long double\*(C'\fR variables on a 32\-bit
+boundary (\fB\-malign\-int\fR) or a 16\-bit boundary (\fB\-mno\-align\-int\fR).
+Aligning variables on 32\-bit boundaries produces code that runs somewhat
+faster on processors with 32\-bit busses at the expense of more memory.
+.Sp
+\&\fBWarning:\fR if you use the \fB\-malign\-int\fR switch, \s-1GCC\s0 will
+align structures containing the above types differently than
+most published application binary interface specifications for the m68k.
+.IP "\fB\-mpcrel\fR" 4
+.IX Item "-mpcrel"
+Use the pc-relative addressing mode of the 68000 directly, instead of
+using a global offset table. At present, this option implies \fB\-fpic\fR,
+allowing at most a 16\-bit offset for pc-relative addressing. \fB\-fPIC\fR is
+not presently supported with \fB\-mpcrel\fR, though this could be supported for
+68020 and higher processors.
+.IP "\fB\-mno\-strict\-align\fR" 4
+.IX Item "-mno-strict-align"
+.PD 0
+.IP "\fB\-mstrict\-align\fR" 4
+.IX Item "-mstrict-align"
+.PD
+Do not (do) assume that unaligned memory references will be handled by
+the system.
+.IP "\fB\-msep\-data\fR" 4
+.IX Item "-msep-data"
+Generate code that allows the data segment to be located in a different
+area of memory from the text segment. This allows for execute in place in
+an environment without virtual memory management. This option implies
+\&\fB\-fPIC\fR.
+.IP "\fB\-mno\-sep\-data\fR" 4
+.IX Item "-mno-sep-data"
+Generate code that assumes that the data segment follows the text segment.
+This is the default.
+.IP "\fB\-mid\-shared\-library\fR" 4
+.IX Item "-mid-shared-library"
+Generate code that supports shared libraries via the library \s-1ID\s0 method.
+This allows for execute in place and shared libraries in an environment
+without virtual memory management. This option implies \fB\-fPIC\fR.
+.IP "\fB\-mno\-id\-shared\-library\fR" 4
+.IX Item "-mno-id-shared-library"
+Generate code that doesn't assume \s-1ID\s0 based shared libraries are being used.
+This is the default.
+.IP "\fB\-mshared\-library\-id=n\fR" 4
+.IX Item "-mshared-library-id=n"
+Specified the identification number of the \s-1ID\s0 based shared library being
+compiled. Specifying a value of 0 will generate more compact code, specifying
+other values will force the allocation of that number to the current
+library but is no more space or time efficient than omitting this option.
+.IP "\fB\-mxgot\fR" 4
+.IX Item "-mxgot"
+.PD 0
+.IP "\fB\-mno\-xgot\fR" 4
+.IX Item "-mno-xgot"
+.PD
+When generating position-independent code for ColdFire, generate code
+that works if the \s-1GOT\s0 has more than 8192 entries. This code is
+larger and slower than code generated without this option. On M680x0
+processors, this option is not needed; \fB\-fPIC\fR suffices.
+.Sp
+\&\s-1GCC\s0 normally uses a single instruction to load values from the \s-1GOT\s0.
+While this is relatively efficient, it only works if the \s-1GOT\s0
+is smaller than about 64k. Anything larger causes the linker
+to report an error such as:
+.Sp
+.Vb 1
+\& relocation truncated to fit: R_68K_GOT16O foobar
+.Ve
+.Sp
+If this happens, you should recompile your code with \fB\-mxgot\fR.
+It should then work with very large GOTs. However, code generated with
+\&\fB\-mxgot\fR is less efficient, since it takes 4 instructions to fetch
+the value of a global symbol.
+.Sp
+Note that some linkers, including newer versions of the \s-1GNU\s0 linker,
+can create multiple GOTs and sort \s-1GOT\s0 entries. If you have such a linker,
+you should only need to use \fB\-mxgot\fR when compiling a single
+object file that accesses more than 8192 \s-1GOT\s0 entries. Very few do.
+.Sp
+These options have no effect unless \s-1GCC\s0 is generating
+position-independent code.
+.PP
+\fIM68hc1x Options\fR
+.IX Subsection "M68hc1x Options"
+.PP
+These are the \fB\-m\fR options defined for the 68hc11 and 68hc12
+microcontrollers. The default values for these options depends on
+which style of microcontroller was selected when the compiler was configured;
+the defaults for the most common choices are given below.
+.IP "\fB\-m6811\fR" 4
+.IX Item "-m6811"
+.PD 0
+.IP "\fB\-m68hc11\fR" 4
+.IX Item "-m68hc11"
+.PD
+Generate output for a 68HC11. This is the default
+when the compiler is configured for 68HC11\-based systems.
+.IP "\fB\-m6812\fR" 4
+.IX Item "-m6812"
+.PD 0
+.IP "\fB\-m68hc12\fR" 4
+.IX Item "-m68hc12"
+.PD
+Generate output for a 68HC12. This is the default
+when the compiler is configured for 68HC12\-based systems.
+.IP "\fB\-m68S12\fR" 4
+.IX Item "-m68S12"
+.PD 0
+.IP "\fB\-m68hcs12\fR" 4
+.IX Item "-m68hcs12"
+.PD
+Generate output for a 68HCS12.
+.IP "\fB\-mauto\-incdec\fR" 4
+.IX Item "-mauto-incdec"
+Enable the use of 68HC12 pre and post auto-increment and auto-decrement
+addressing modes.
+.IP "\fB\-minmax\fR" 4
+.IX Item "-minmax"
+.PD 0
+.IP "\fB\-nominmax\fR" 4
+.IX Item "-nominmax"
+.PD
+Enable the use of 68HC12 min and max instructions.
+.IP "\fB\-mlong\-calls\fR" 4
+.IX Item "-mlong-calls"
+.PD 0
+.IP "\fB\-mno\-long\-calls\fR" 4
+.IX Item "-mno-long-calls"
+.PD
+Treat all calls as being far away (near). If calls are assumed to be
+far away, the compiler will use the \f(CW\*(C`call\*(C'\fR instruction to
+call a function and the \f(CW\*(C`rtc\*(C'\fR instruction for returning.
+.IP "\fB\-mshort\fR" 4
+.IX Item "-mshort"
+Consider type \f(CW\*(C`int\*(C'\fR to be 16 bits wide, like \f(CW\*(C`short int\*(C'\fR.
+.IP "\fB\-msoft\-reg\-count=\fR\fIcount\fR" 4
+.IX Item "-msoft-reg-count=count"
+Specify the number of pseudo-soft registers which are used for the
+code generation. The maximum number is 32. Using more pseudo-soft
+register may or may not result in better code depending on the program.
+The default is 4 for 68HC11 and 2 for 68HC12.
+.PP
+\fIMCore Options\fR
+.IX Subsection "MCore Options"
+.PP
+These are the \fB\-m\fR options defined for the Motorola M*Core
+processors.
+.IP "\fB\-mhardlit\fR" 4
+.IX Item "-mhardlit"
+.PD 0
+.IP "\fB\-mno\-hardlit\fR" 4
+.IX Item "-mno-hardlit"
+.PD
+Inline constants into the code stream if it can be done in two
+instructions or less.
+.IP "\fB\-mdiv\fR" 4
+.IX Item "-mdiv"
+.PD 0
+.IP "\fB\-mno\-div\fR" 4
+.IX Item "-mno-div"
+.PD
+Use the divide instruction. (Enabled by default).
+.IP "\fB\-mrelax\-immediate\fR" 4
+.IX Item "-mrelax-immediate"
+.PD 0
+.IP "\fB\-mno\-relax\-immediate\fR" 4
+.IX Item "-mno-relax-immediate"
+.PD
+Allow arbitrary sized immediates in bit operations.
+.IP "\fB\-mwide\-bitfields\fR" 4
+.IX Item "-mwide-bitfields"
+.PD 0
+.IP "\fB\-mno\-wide\-bitfields\fR" 4
+.IX Item "-mno-wide-bitfields"
+.PD
+Always treat bit-fields as int-sized.
+.IP "\fB\-m4byte\-functions\fR" 4
+.IX Item "-m4byte-functions"
+.PD 0
+.IP "\fB\-mno\-4byte\-functions\fR" 4
+.IX Item "-mno-4byte-functions"
+.PD
+Force all functions to be aligned to a four byte boundary.
+.IP "\fB\-mcallgraph\-data\fR" 4
+.IX Item "-mcallgraph-data"
+.PD 0
+.IP "\fB\-mno\-callgraph\-data\fR" 4
+.IX Item "-mno-callgraph-data"
+.PD
+Emit callgraph information.
+.IP "\fB\-mslow\-bytes\fR" 4
+.IX Item "-mslow-bytes"
+.PD 0
+.IP "\fB\-mno\-slow\-bytes\fR" 4
+.IX Item "-mno-slow-bytes"
+.PD
+Prefer word access when reading byte quantities.
+.IP "\fB\-mlittle\-endian\fR" 4
+.IX Item "-mlittle-endian"
+.PD 0
+.IP "\fB\-mbig\-endian\fR" 4
+.IX Item "-mbig-endian"
+.PD
+Generate code for a little endian target.
+.IP "\fB\-m210\fR" 4
+.IX Item "-m210"
+.PD 0
+.IP "\fB\-m340\fR" 4
+.IX Item "-m340"
+.PD
+Generate code for the 210 processor.
+.IP "\fB\-mno\-lsim\fR" 4
+.IX Item "-mno-lsim"
+Assume that run-time support has been provided and so omit the
+simulator library (\fIlibsim.a)\fR from the linker command line.
+.IP "\fB\-mstack\-increment=\fR\fIsize\fR" 4
+.IX Item "-mstack-increment=size"
+Set the maximum amount for a single stack increment operation. Large
+values can increase the speed of programs which contain functions
+that need a large amount of stack space, but they can also trigger a
+segmentation fault if the stack is extended too much. The default
+value is 0x1000.
+.PP
+\fI\s-1MIPS\s0 Options\fR
+.IX Subsection "MIPS Options"
+.IP "\fB\-EB\fR" 4
+.IX Item "-EB"
+Generate big-endian code.
+.IP "\fB\-EL\fR" 4
+.IX Item "-EL"
+Generate little-endian code. This is the default for \fBmips*el\-*\-*\fR
+configurations.
+.IP "\fB\-march=\fR\fIarch\fR" 4
+.IX Item "-march=arch"
+Generate code that will run on \fIarch\fR, which can be the name of a
+generic \s-1MIPS\s0 \s-1ISA\s0, or the name of a particular processor.
+The \s-1ISA\s0 names are:
+\&\fBmips1\fR, \fBmips2\fR, \fBmips3\fR, \fBmips4\fR,
+\&\fBmips32\fR, \fBmips32r2\fR, \fBmips64\fR and \fBmips64r2\fR.
+The processor names are:
+\&\fB4kc\fR, \fB4km\fR, \fB4kp\fR, \fB4ksc\fR,
+\&\fB4kec\fR, \fB4kem\fR, \fB4kep\fR, \fB4ksd\fR,
+\&\fB5kc\fR, \fB5kf\fR,
+\&\fB20kc\fR,
+\&\fB24kc\fR, \fB24kf2_1\fR, \fB24kf1_1\fR,
+\&\fB24kec\fR, \fB24kef2_1\fR, \fB24kef1_1\fR,
+\&\fB34kc\fR, \fB34kf2_1\fR, \fB34kf1_1\fR,
+\&\fB74kc\fR, \fB74kf2_1\fR, \fB74kf1_1\fR, \fB74kf3_2\fR,
+\&\fBloongson2e\fR, \fBloongson2f\fR,
+\&\fBm4k\fR,
+\&\fBocteon\fR,
+\&\fBorion\fR,
+\&\fBr2000\fR, \fBr3000\fR, \fBr3900\fR, \fBr4000\fR, \fBr4400\fR,
+\&\fBr4600\fR, \fBr4650\fR, \fBr6000\fR, \fBr8000\fR,
+\&\fBrm7000\fR, \fBrm9000\fR,
+\&\fBr10000\fR, \fBr12000\fR, \fBr14000\fR, \fBr16000\fR,
+\&\fBsb1\fR,
+\&\fBsr71000\fR,
+\&\fBvr4100\fR, \fBvr4111\fR, \fBvr4120\fR, \fBvr4130\fR, \fBvr4300\fR,
+\&\fBvr5000\fR, \fBvr5400\fR, \fBvr5500\fR
+and \fBxlr\fR.
+The special value \fBfrom-abi\fR selects the
+most compatible architecture for the selected \s-1ABI\s0 (that is,
+\&\fBmips1\fR for 32\-bit ABIs and \fBmips3\fR for 64\-bit ABIs).
+.Sp
+Native Linux/GNU toolchains also support the value \fBnative\fR,
+which selects the best architecture option for the host processor.
+\&\fB\-march=native\fR has no effect if \s-1GCC\s0 does not recognize
+the processor.
+.Sp
+In processor names, a final \fB000\fR can be abbreviated as \fBk\fR
+(for example, \fB\-march=r2k\fR). Prefixes are optional, and
+\&\fBvr\fR may be written \fBr\fR.
+.Sp
+Names of the form \fIn\fR\fBf2_1\fR refer to processors with
+FPUs clocked at half the rate of the core, names of the form
+\&\fIn\fR\fBf1_1\fR refer to processors with FPUs clocked at the same
+rate as the core, and names of the form \fIn\fR\fBf3_2\fR refer to
+processors with FPUs clocked a ratio of 3:2 with respect to the core.
+For compatibility reasons, \fIn\fR\fBf\fR is accepted as a synonym
+for \fIn\fR\fBf2_1\fR while \fIn\fR\fBx\fR and \fIb\fR\fBfx\fR are
+accepted as synonyms for \fIn\fR\fBf1_1\fR.
+.Sp
+\&\s-1GCC\s0 defines two macros based on the value of this option. The first
+is \fB_MIPS_ARCH\fR, which gives the name of target architecture, as
+a string. The second has the form \fB_MIPS_ARCH_\fR\fIfoo\fR,
+where \fIfoo\fR is the capitalized value of \fB_MIPS_ARCH\fR.
+For example, \fB\-march=r2000\fR will set \fB_MIPS_ARCH\fR
+to \fB\*(L"r2000\*(R"\fR and define the macro \fB_MIPS_ARCH_R2000\fR.
+.Sp
+Note that the \fB_MIPS_ARCH\fR macro uses the processor names given
+above. In other words, it will have the full prefix and will not
+abbreviate \fB000\fR as \fBk\fR. In the case of \fBfrom-abi\fR,
+the macro names the resolved architecture (either \fB\*(L"mips1\*(R"\fR or
+\&\fB\*(L"mips3\*(R"\fR). It names the default architecture when no
+\&\fB\-march\fR option is given.
+.IP "\fB\-mtune=\fR\fIarch\fR" 4
+.IX Item "-mtune=arch"
+Optimize for \fIarch\fR. Among other things, this option controls
+the way instructions are scheduled, and the perceived cost of arithmetic
+operations. The list of \fIarch\fR values is the same as for
+\&\fB\-march\fR.
+.Sp
+When this option is not used, \s-1GCC\s0 will optimize for the processor
+specified by \fB\-march\fR. By using \fB\-march\fR and
+\&\fB\-mtune\fR together, it is possible to generate code that will
+run on a family of processors, but optimize the code for one
+particular member of that family.
+.Sp
+\&\fB\-mtune\fR defines the macros \fB_MIPS_TUNE\fR and
+\&\fB_MIPS_TUNE_\fR\fIfoo\fR, which work in the same way as the
+\&\fB\-march\fR ones described above.
+.IP "\fB\-mips1\fR" 4
+.IX Item "-mips1"
+Equivalent to \fB\-march=mips1\fR.
+.IP "\fB\-mips2\fR" 4
+.IX Item "-mips2"
+Equivalent to \fB\-march=mips2\fR.
+.IP "\fB\-mips3\fR" 4
+.IX Item "-mips3"
+Equivalent to \fB\-march=mips3\fR.
+.IP "\fB\-mips4\fR" 4
+.IX Item "-mips4"
+Equivalent to \fB\-march=mips4\fR.
+.IP "\fB\-mips32\fR" 4
+.IX Item "-mips32"
+Equivalent to \fB\-march=mips32\fR.
+.IP "\fB\-mips32r2\fR" 4
+.IX Item "-mips32r2"
+Equivalent to \fB\-march=mips32r2\fR.
+.IP "\fB\-mips64\fR" 4
+.IX Item "-mips64"
+Equivalent to \fB\-march=mips64\fR.
+.IP "\fB\-mips64r2\fR" 4
+.IX Item "-mips64r2"
+Equivalent to \fB\-march=mips64r2\fR.
+.IP "\fB\-mips16\fR" 4
+.IX Item "-mips16"
+.PD 0
+.IP "\fB\-mno\-mips16\fR" 4
+.IX Item "-mno-mips16"
+.PD
+Generate (do not generate) \s-1MIPS16\s0 code. If \s-1GCC\s0 is targetting a
+\&\s-1MIPS32\s0 or \s-1MIPS64\s0 architecture, it will make use of the MIPS16e \s-1ASE\s0.
+.Sp
+\&\s-1MIPS16\s0 code generation can also be controlled on a per-function basis
+by means of \f(CW\*(C`mips16\*(C'\fR and \f(CW\*(C`nomips16\*(C'\fR attributes.
+.IP "\fB\-mflip\-mips16\fR" 4
+.IX Item "-mflip-mips16"
+Generate \s-1MIPS16\s0 code on alternating functions. This option is provided
+for regression testing of mixed MIPS16/non\-MIPS16 code generation, and is
+not intended for ordinary use in compiling user code.
+.IP "\fB\-minterlink\-mips16\fR" 4
+.IX Item "-minterlink-mips16"
+.PD 0
+.IP "\fB\-mno\-interlink\-mips16\fR" 4
+.IX Item "-mno-interlink-mips16"
+.PD
+Require (do not require) that non\-MIPS16 code be link-compatible with
+\&\s-1MIPS16\s0 code.
+.Sp
+For example, non\-MIPS16 code cannot jump directly to \s-1MIPS16\s0 code;
+it must either use a call or an indirect jump. \fB\-minterlink\-mips16\fR
+therefore disables direct jumps unless \s-1GCC\s0 knows that the target of the
+jump is not \s-1MIPS16\s0.
+.IP "\fB\-mabi=32\fR" 4
+.IX Item "-mabi=32"
+.PD 0
+.IP "\fB\-mabi=o64\fR" 4
+.IX Item "-mabi=o64"
+.IP "\fB\-mabi=n32\fR" 4
+.IX Item "-mabi=n32"
+.IP "\fB\-mabi=64\fR" 4
+.IX Item "-mabi=64"
+.IP "\fB\-mabi=eabi\fR" 4
+.IX Item "-mabi=eabi"
+.PD
+Generate code for the given \s-1ABI\s0.
+.Sp
+Note that the \s-1EABI\s0 has a 32\-bit and a 64\-bit variant. \s-1GCC\s0 normally
+generates 64\-bit code when you select a 64\-bit architecture, but you
+can use \fB\-mgp32\fR to get 32\-bit code instead.
+.Sp
+For information about the O64 \s-1ABI\s0, see
+<\fBhttp://gcc.gnu.org/projects/mipso64\-abi.html\fR>.
+.Sp
+\&\s-1GCC\s0 supports a variant of the o32 \s-1ABI\s0 in which floating-point registers
+are 64 rather than 32 bits wide. You can select this combination with
+\&\fB\-mabi=32\fR \fB\-mfp64\fR. This \s-1ABI\s0 relies on the \fBmthc1\fR
+and \fBmfhc1\fR instructions and is therefore only supported for
+\&\s-1MIPS32R2\s0 processors.
+.Sp
+The register assignments for arguments and return values remain the
+same, but each scalar value is passed in a single 64\-bit register
+rather than a pair of 32\-bit registers. For example, scalar
+floating-point values are returned in \fB\f(CB$f0\fB\fR only, not a
+\&\fB\f(CB$f0\fB\fR/\fB\f(CB$f1\fB\fR pair. The set of call-saved registers also
+remains the same, but all 64 bits are saved.
+.IP "\fB\-mabicalls\fR" 4
+.IX Item "-mabicalls"
+.PD 0
+.IP "\fB\-mno\-abicalls\fR" 4
+.IX Item "-mno-abicalls"
+.PD
+Generate (do not generate) code that is suitable for SVR4\-style
+dynamic objects. \fB\-mabicalls\fR is the default for SVR4\-based
+systems.
+.IP "\fB\-mshared\fR" 4
+.IX Item "-mshared"
+.PD 0
+.IP "\fB\-mno\-shared\fR" 4
+.IX Item "-mno-shared"
+.PD
+Generate (do not generate) code that is fully position-independent,
+and that can therefore be linked into shared libraries. This option
+only affects \fB\-mabicalls\fR.
+.Sp
+All \fB\-mabicalls\fR code has traditionally been position-independent,
+regardless of options like \fB\-fPIC\fR and \fB\-fpic\fR. However,
+as an extension, the \s-1GNU\s0 toolchain allows executables to use absolute
+accesses for locally-binding symbols. It can also use shorter \s-1GP\s0
+initialization sequences and generate direct calls to locally-defined
+functions. This mode is selected by \fB\-mno\-shared\fR.
+.Sp
+\&\fB\-mno\-shared\fR depends on binutils 2.16 or higher and generates
+objects that can only be linked by the \s-1GNU\s0 linker. However, the option
+does not affect the \s-1ABI\s0 of the final executable; it only affects the \s-1ABI\s0
+of relocatable objects. Using \fB\-mno\-shared\fR will generally make
+executables both smaller and quicker.
+.Sp
+\&\fB\-mshared\fR is the default.
+.IP "\fB\-mplt\fR" 4
+.IX Item "-mplt"
+.PD 0
+.IP "\fB\-mno\-plt\fR" 4
+.IX Item "-mno-plt"
+.PD
+Assume (do not assume) that the static and dynamic linkers
+support PLTs and copy relocations. This option only affects
+\&\fB\-mno\-shared \-mabicalls\fR. For the n64 \s-1ABI\s0, this option
+has no effect without \fB\-msym32\fR.
+.Sp
+You can make \fB\-mplt\fR the default by configuring
+\&\s-1GCC\s0 with \fB\-\-with\-mips\-plt\fR. The default is
+\&\fB\-mno\-plt\fR otherwise.
+.IP "\fB\-mxgot\fR" 4
+.IX Item "-mxgot"
+.PD 0
+.IP "\fB\-mno\-xgot\fR" 4
+.IX Item "-mno-xgot"
+.PD
+Lift (do not lift) the usual restrictions on the size of the global
+offset table.
+.Sp
+\&\s-1GCC\s0 normally uses a single instruction to load values from the \s-1GOT\s0.
+While this is relatively efficient, it will only work if the \s-1GOT\s0
+is smaller than about 64k. Anything larger will cause the linker
+to report an error such as:
+.Sp
+.Vb 1
+\& relocation truncated to fit: R_MIPS_GOT16 foobar
+.Ve
+.Sp
+If this happens, you should recompile your code with \fB\-mxgot\fR.
+It should then work with very large GOTs, although it will also be
+less efficient, since it will take three instructions to fetch the
+value of a global symbol.
+.Sp
+Note that some linkers can create multiple GOTs. If you have such a
+linker, you should only need to use \fB\-mxgot\fR when a single object
+file accesses more than 64k's worth of \s-1GOT\s0 entries. Very few do.
+.Sp
+These options have no effect unless \s-1GCC\s0 is generating position
+independent code.
+.IP "\fB\-mgp32\fR" 4
+.IX Item "-mgp32"
+Assume that general-purpose registers are 32 bits wide.
+.IP "\fB\-mgp64\fR" 4
+.IX Item "-mgp64"
+Assume that general-purpose registers are 64 bits wide.
+.IP "\fB\-mfp32\fR" 4
+.IX Item "-mfp32"
+Assume that floating-point registers are 32 bits wide.
+.IP "\fB\-mfp64\fR" 4
+.IX Item "-mfp64"
+Assume that floating-point registers are 64 bits wide.
+.IP "\fB\-mhard\-float\fR" 4
+.IX Item "-mhard-float"
+Use floating-point coprocessor instructions.
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+Do not use floating-point coprocessor instructions. Implement
+floating-point calculations using library calls instead.
+.IP "\fB\-msingle\-float\fR" 4
+.IX Item "-msingle-float"
+Assume that the floating-point coprocessor only supports single-precision
+operations.
+.IP "\fB\-mdouble\-float\fR" 4
+.IX Item "-mdouble-float"
+Assume that the floating-point coprocessor supports double-precision
+operations. This is the default.
+.IP "\fB\-mllsc\fR" 4
+.IX Item "-mllsc"
+.PD 0
+.IP "\fB\-mno\-llsc\fR" 4
+.IX Item "-mno-llsc"
+.PD
+Use (do not use) \fBll\fR, \fBsc\fR, and \fBsync\fR instructions to
+implement atomic memory built-in functions. When neither option is
+specified, \s-1GCC\s0 will use the instructions if the target architecture
+supports them.
+.Sp
+\&\fB\-mllsc\fR is useful if the runtime environment can emulate the
+instructions and \fB\-mno\-llsc\fR can be useful when compiling for
+nonstandard ISAs. You can make either option the default by
+configuring \s-1GCC\s0 with \fB\-\-with\-llsc\fR and \fB\-\-without\-llsc\fR
+respectively. \fB\-\-with\-llsc\fR is the default for some
+configurations; see the installation documentation for details.
+.IP "\fB\-mdsp\fR" 4
+.IX Item "-mdsp"
+.PD 0
+.IP "\fB\-mno\-dsp\fR" 4
+.IX Item "-mno-dsp"
+.PD
+Use (do not use) revision 1 of the \s-1MIPS\s0 \s-1DSP\s0 \s-1ASE\s0.
+ This option defines the
+preprocessor macro \fB_\|_mips_dsp\fR. It also defines
+\&\fB_\|_mips_dsp_rev\fR to 1.
+.IP "\fB\-mdspr2\fR" 4
+.IX Item "-mdspr2"
+.PD 0
+.IP "\fB\-mno\-dspr2\fR" 4
+.IX Item "-mno-dspr2"
+.PD
+Use (do not use) revision 2 of the \s-1MIPS\s0 \s-1DSP\s0 \s-1ASE\s0.
+ This option defines the
+preprocessor macros \fB_\|_mips_dsp\fR and \fB_\|_mips_dspr2\fR.
+It also defines \fB_\|_mips_dsp_rev\fR to 2.
+.IP "\fB\-msmartmips\fR" 4
+.IX Item "-msmartmips"
+.PD 0
+.IP "\fB\-mno\-smartmips\fR" 4
+.IX Item "-mno-smartmips"
+.PD
+Use (do not use) the \s-1MIPS\s0 SmartMIPS \s-1ASE\s0.
+.IP "\fB\-mpaired\-single\fR" 4
+.IX Item "-mpaired-single"
+.PD 0
+.IP "\fB\-mno\-paired\-single\fR" 4
+.IX Item "-mno-paired-single"
+.PD
+Use (do not use) paired-single floating-point instructions.
+ This option requires
+hardware floating-point support to be enabled.
+.IP "\fB\-mdmx\fR" 4
+.IX Item "-mdmx"
+.PD 0
+.IP "\fB\-mno\-mdmx\fR" 4
+.IX Item "-mno-mdmx"
+.PD
+Use (do not use) \s-1MIPS\s0 Digital Media Extension instructions.
+This option can only be used when generating 64\-bit code and requires
+hardware floating-point support to be enabled.
+.IP "\fB\-mips3d\fR" 4
+.IX Item "-mips3d"
+.PD 0
+.IP "\fB\-mno\-mips3d\fR" 4
+.IX Item "-mno-mips3d"
+.PD
+Use (do not use) the \s-1MIPS\-3D\s0 \s-1ASE\s0.
+The option \fB\-mips3d\fR implies \fB\-mpaired\-single\fR.
+.IP "\fB\-mmt\fR" 4
+.IX Item "-mmt"
+.PD 0
+.IP "\fB\-mno\-mt\fR" 4
+.IX Item "-mno-mt"
+.PD
+Use (do not use) \s-1MT\s0 Multithreading instructions.
+.IP "\fB\-mlong64\fR" 4
+.IX Item "-mlong64"
+Force \f(CW\*(C`long\*(C'\fR types to be 64 bits wide. See \fB\-mlong32\fR for
+an explanation of the default and the way that the pointer size is
+determined.
+.IP "\fB\-mlong32\fR" 4
+.IX Item "-mlong32"
+Force \f(CW\*(C`long\*(C'\fR, \f(CW\*(C`int\*(C'\fR, and pointer types to be 32 bits wide.
+.Sp
+The default size of \f(CW\*(C`int\*(C'\fRs, \f(CW\*(C`long\*(C'\fRs and pointers depends on
+the \s-1ABI\s0. All the supported ABIs use 32\-bit \f(CW\*(C`int\*(C'\fRs. The n64 \s-1ABI\s0
+uses 64\-bit \f(CW\*(C`long\*(C'\fRs, as does the 64\-bit \s-1EABI\s0; the others use
+32\-bit \f(CW\*(C`long\*(C'\fRs. Pointers are the same size as \f(CW\*(C`long\*(C'\fRs,
+or the same size as integer registers, whichever is smaller.
+.IP "\fB\-msym32\fR" 4
+.IX Item "-msym32"
+.PD 0
+.IP "\fB\-mno\-sym32\fR" 4
+.IX Item "-mno-sym32"
+.PD
+Assume (do not assume) that all symbols have 32\-bit values, regardless
+of the selected \s-1ABI\s0. This option is useful in combination with
+\&\fB\-mabi=64\fR and \fB\-mno\-abicalls\fR because it allows \s-1GCC\s0
+to generate shorter and faster references to symbolic addresses.
+.IP "\fB\-G\fR \fInum\fR" 4
+.IX Item "-G num"
+Put definitions of externally-visible data in a small data section
+if that data is no bigger than \fInum\fR bytes. \s-1GCC\s0 can then access
+the data more efficiently; see \fB\-mgpopt\fR for details.
+.Sp
+The default \fB\-G\fR option depends on the configuration.
+.IP "\fB\-mlocal\-sdata\fR" 4
+.IX Item "-mlocal-sdata"
+.PD 0
+.IP "\fB\-mno\-local\-sdata\fR" 4
+.IX Item "-mno-local-sdata"
+.PD
+Extend (do not extend) the \fB\-G\fR behavior to local data too,
+such as to static variables in C. \fB\-mlocal\-sdata\fR is the
+default for all configurations.
+.Sp
+If the linker complains that an application is using too much small data,
+you might want to try rebuilding the less performance-critical parts with
+\&\fB\-mno\-local\-sdata\fR. You might also want to build large
+libraries with \fB\-mno\-local\-sdata\fR, so that the libraries leave
+more room for the main program.
+.IP "\fB\-mextern\-sdata\fR" 4
+.IX Item "-mextern-sdata"
+.PD 0
+.IP "\fB\-mno\-extern\-sdata\fR" 4
+.IX Item "-mno-extern-sdata"
+.PD
+Assume (do not assume) that externally-defined data will be in
+a small data section if that data is within the \fB\-G\fR limit.
+\&\fB\-mextern\-sdata\fR is the default for all configurations.
+.Sp
+If you compile a module \fIMod\fR with \fB\-mextern\-sdata\fR \fB\-G\fR
+\&\fInum\fR \fB\-mgpopt\fR, and \fIMod\fR references a variable \fIVar\fR
+that is no bigger than \fInum\fR bytes, you must make sure that \fIVar\fR
+is placed in a small data section. If \fIVar\fR is defined by another
+module, you must either compile that module with a high-enough
+\&\fB\-G\fR setting or attach a \f(CW\*(C`section\*(C'\fR attribute to \fIVar\fR's
+definition. If \fIVar\fR is common, you must link the application
+with a high-enough \fB\-G\fR setting.
+.Sp
+The easiest way of satisfying these restrictions is to compile
+and link every module with the same \fB\-G\fR option. However,
+you may wish to build a library that supports several different
+small data limits. You can do this by compiling the library with
+the highest supported \fB\-G\fR setting and additionally using
+\&\fB\-mno\-extern\-sdata\fR to stop the library from making assumptions
+about externally-defined data.
+.IP "\fB\-mgpopt\fR" 4
+.IX Item "-mgpopt"
+.PD 0
+.IP "\fB\-mno\-gpopt\fR" 4
+.IX Item "-mno-gpopt"
+.PD
+Use (do not use) GP-relative accesses for symbols that are known to be
+in a small data section; see \fB\-G\fR, \fB\-mlocal\-sdata\fR and
+\&\fB\-mextern\-sdata\fR. \fB\-mgpopt\fR is the default for all
+configurations.
+.Sp
+\&\fB\-mno\-gpopt\fR is useful for cases where the \f(CW$gp\fR register
+might not hold the value of \f(CW\*(C`_gp\*(C'\fR. For example, if the code is
+part of a library that might be used in a boot monitor, programs that
+call boot monitor routines will pass an unknown value in \f(CW$gp\fR.
+(In such situations, the boot monitor itself would usually be compiled
+with \fB\-G0\fR.)
+.Sp
+\&\fB\-mno\-gpopt\fR implies \fB\-mno\-local\-sdata\fR and
+\&\fB\-mno\-extern\-sdata\fR.
+.IP "\fB\-membedded\-data\fR" 4
+.IX Item "-membedded-data"
+.PD 0
+.IP "\fB\-mno\-embedded\-data\fR" 4
+.IX Item "-mno-embedded-data"
+.PD
+Allocate variables to the read-only data section first if possible, then
+next in the small data section if possible, otherwise in data. This gives
+slightly slower code than the default, but reduces the amount of \s-1RAM\s0 required
+when executing, and thus may be preferred for some embedded systems.
+.IP "\fB\-muninit\-const\-in\-rodata\fR" 4
+.IX Item "-muninit-const-in-rodata"
+.PD 0
+.IP "\fB\-mno\-uninit\-const\-in\-rodata\fR" 4
+.IX Item "-mno-uninit-const-in-rodata"
+.PD
+Put uninitialized \f(CW\*(C`const\*(C'\fR variables in the read-only data section.
+This option is only meaningful in conjunction with \fB\-membedded\-data\fR.
+.IP "\fB\-mcode\-readable=\fR\fIsetting\fR" 4
+.IX Item "-mcode-readable=setting"
+Specify whether \s-1GCC\s0 may generate code that reads from executable sections.
+There are three possible settings:
+.RS 4
+.IP "\fB\-mcode\-readable=yes\fR" 4
+.IX Item "-mcode-readable=yes"
+Instructions may freely access executable sections. This is the
+default setting.
+.IP "\fB\-mcode\-readable=pcrel\fR" 4
+.IX Item "-mcode-readable=pcrel"
+\&\s-1MIPS16\s0 PC-relative load instructions can access executable sections,
+but other instructions must not do so. This option is useful on 4KSc
+and 4KSd processors when the code TLBs have the Read Inhibit bit set.
+It is also useful on processors that can be configured to have a dual
+instruction/data \s-1SRAM\s0 interface and that, like the M4K, automatically
+redirect PC-relative loads to the instruction \s-1RAM\s0.
+.IP "\fB\-mcode\-readable=no\fR" 4
+.IX Item "-mcode-readable=no"
+Instructions must not access executable sections. This option can be
+useful on targets that are configured to have a dual instruction/data
+\&\s-1SRAM\s0 interface but that (unlike the M4K) do not automatically redirect
+PC-relative loads to the instruction \s-1RAM\s0.
+.RE
+.RS 4
+.RE
+.IP "\fB\-msplit\-addresses\fR" 4
+.IX Item "-msplit-addresses"
+.PD 0
+.IP "\fB\-mno\-split\-addresses\fR" 4
+.IX Item "-mno-split-addresses"
+.PD
+Enable (disable) use of the \f(CW\*(C`%hi()\*(C'\fR and \f(CW\*(C`%lo()\*(C'\fR assembler
+relocation operators. This option has been superseded by
+\&\fB\-mexplicit\-relocs\fR but is retained for backwards compatibility.
+.IP "\fB\-mexplicit\-relocs\fR" 4
+.IX Item "-mexplicit-relocs"
+.PD 0
+.IP "\fB\-mno\-explicit\-relocs\fR" 4
+.IX Item "-mno-explicit-relocs"
+.PD
+Use (do not use) assembler relocation operators when dealing with symbolic
+addresses. The alternative, selected by \fB\-mno\-explicit\-relocs\fR,
+is to use assembler macros instead.
+.Sp
+\&\fB\-mexplicit\-relocs\fR is the default if \s-1GCC\s0 was configured
+to use an assembler that supports relocation operators.
+.IP "\fB\-mcheck\-zero\-division\fR" 4
+.IX Item "-mcheck-zero-division"
+.PD 0
+.IP "\fB\-mno\-check\-zero\-division\fR" 4
+.IX Item "-mno-check-zero-division"
+.PD
+Trap (do not trap) on integer division by zero.
+.Sp
+The default is \fB\-mcheck\-zero\-division\fR.
+.IP "\fB\-mdivide\-traps\fR" 4
+.IX Item "-mdivide-traps"
+.PD 0
+.IP "\fB\-mdivide\-breaks\fR" 4
+.IX Item "-mdivide-breaks"
+.PD
+\&\s-1MIPS\s0 systems check for division by zero by generating either a
+conditional trap or a break instruction. Using traps results in
+smaller code, but is only supported on \s-1MIPS\s0 \s-1II\s0 and later. Also, some
+versions of the Linux kernel have a bug that prevents trap from
+generating the proper signal (\f(CW\*(C`SIGFPE\*(C'\fR). Use \fB\-mdivide\-traps\fR to
+allow conditional traps on architectures that support them and
+\&\fB\-mdivide\-breaks\fR to force the use of breaks.
+.Sp
+The default is usually \fB\-mdivide\-traps\fR, but this can be
+overridden at configure time using \fB\-\-with\-divide=breaks\fR.
+Divide-by-zero checks can be completely disabled using
+\&\fB\-mno\-check\-zero\-division\fR.
+.IP "\fB\-mmemcpy\fR" 4
+.IX Item "-mmemcpy"
+.PD 0
+.IP "\fB\-mno\-memcpy\fR" 4
+.IX Item "-mno-memcpy"
+.PD
+Force (do not force) the use of \f(CW\*(C`memcpy()\*(C'\fR for non-trivial block
+moves. The default is \fB\-mno\-memcpy\fR, which allows \s-1GCC\s0 to inline
+most constant-sized copies.
+.IP "\fB\-mlong\-calls\fR" 4
+.IX Item "-mlong-calls"
+.PD 0
+.IP "\fB\-mno\-long\-calls\fR" 4
+.IX Item "-mno-long-calls"
+.PD
+Disable (do not disable) use of the \f(CW\*(C`jal\*(C'\fR instruction. Calling
+functions using \f(CW\*(C`jal\*(C'\fR is more efficient but requires the caller
+and callee to be in the same 256 megabyte segment.
+.Sp
+This option has no effect on abicalls code. The default is
+\&\fB\-mno\-long\-calls\fR.
+.IP "\fB\-mmad\fR" 4
+.IX Item "-mmad"
+.PD 0
+.IP "\fB\-mno\-mad\fR" 4
+.IX Item "-mno-mad"
+.PD
+Enable (disable) use of the \f(CW\*(C`mad\*(C'\fR, \f(CW\*(C`madu\*(C'\fR and \f(CW\*(C`mul\*(C'\fR
+instructions, as provided by the R4650 \s-1ISA\s0.
+.IP "\fB\-mfused\-madd\fR" 4
+.IX Item "-mfused-madd"
+.PD 0
+.IP "\fB\-mno\-fused\-madd\fR" 4
+.IX Item "-mno-fused-madd"
+.PD
+Enable (disable) use of the floating point multiply-accumulate
+instructions, when they are available. The default is
+\&\fB\-mfused\-madd\fR.
+.Sp
+When multiply-accumulate instructions are used, the intermediate
+product is calculated to infinite precision and is not subject to
+the \s-1FCSR\s0 Flush to Zero bit. This may be undesirable in some
+circumstances.
+.IP "\fB\-nocpp\fR" 4
+.IX Item "-nocpp"
+Tell the \s-1MIPS\s0 assembler to not run its preprocessor over user
+assembler files (with a \fB.s\fR suffix) when assembling them.
+.IP "\fB\-mfix\-r4000\fR" 4
+.IX Item "-mfix-r4000"
+.PD 0
+.IP "\fB\-mno\-fix\-r4000\fR" 4
+.IX Item "-mno-fix-r4000"
+.PD
+Work around certain R4000 \s-1CPU\s0 errata:
+.RS 4
+.IP "\-" 4
+A double-word or a variable shift may give an incorrect result if executed
+immediately after starting an integer division.
+.IP "\-" 4
+A double-word or a variable shift may give an incorrect result if executed
+while an integer multiplication is in progress.
+.IP "\-" 4
+An integer division may give an incorrect result if started in a delay slot
+of a taken branch or a jump.
+.RE
+.RS 4
+.RE
+.IP "\fB\-mfix\-r4400\fR" 4
+.IX Item "-mfix-r4400"
+.PD 0
+.IP "\fB\-mno\-fix\-r4400\fR" 4
+.IX Item "-mno-fix-r4400"
+.PD
+Work around certain R4400 \s-1CPU\s0 errata:
+.RS 4
+.IP "\-" 4
+A double-word or a variable shift may give an incorrect result if executed
+immediately after starting an integer division.
+.RE
+.RS 4
+.RE
+.IP "\fB\-mfix\-r10000\fR" 4
+.IX Item "-mfix-r10000"
+.PD 0
+.IP "\fB\-mno\-fix\-r10000\fR" 4
+.IX Item "-mno-fix-r10000"
+.PD
+Work around certain R10000 errata:
+.RS 4
+.IP "\-" 4
+\&\f(CW\*(C`ll\*(C'\fR/\f(CW\*(C`sc\*(C'\fR sequences may not behave atomically on revisions
+prior to 3.0. They may deadlock on revisions 2.6 and earlier.
+.RE
+.RS 4
+.Sp
+This option can only be used if the target architecture supports
+branch-likely instructions. \fB\-mfix\-r10000\fR is the default when
+\&\fB\-march=r10000\fR is used; \fB\-mno\-fix\-r10000\fR is the default
+otherwise.
+.RE
+.IP "\fB\-mfix\-vr4120\fR" 4
+.IX Item "-mfix-vr4120"
+.PD 0
+.IP "\fB\-mno\-fix\-vr4120\fR" 4
+.IX Item "-mno-fix-vr4120"
+.PD
+Work around certain \s-1VR4120\s0 errata:
+.RS 4
+.IP "\-" 4
+\&\f(CW\*(C`dmultu\*(C'\fR does not always produce the correct result.
+.IP "\-" 4
+\&\f(CW\*(C`div\*(C'\fR and \f(CW\*(C`ddiv\*(C'\fR do not always produce the correct result if one
+of the operands is negative.
+.RE
+.RS 4
+.Sp
+The workarounds for the division errata rely on special functions in
+\&\fIlibgcc.a\fR. At present, these functions are only provided by
+the \f(CW\*(C`mips64vr*\-elf\*(C'\fR configurations.
+.Sp
+Other \s-1VR4120\s0 errata require a nop to be inserted between certain pairs of
+instructions. These errata are handled by the assembler, not by \s-1GCC\s0 itself.
+.RE
+.IP "\fB\-mfix\-vr4130\fR" 4
+.IX Item "-mfix-vr4130"
+Work around the \s-1VR4130\s0 \f(CW\*(C`mflo\*(C'\fR/\f(CW\*(C`mfhi\*(C'\fR errata. The
+workarounds are implemented by the assembler rather than by \s-1GCC\s0,
+although \s-1GCC\s0 will avoid using \f(CW\*(C`mflo\*(C'\fR and \f(CW\*(C`mfhi\*(C'\fR if the
+\&\s-1VR4130\s0 \f(CW\*(C`macc\*(C'\fR, \f(CW\*(C`macchi\*(C'\fR, \f(CW\*(C`dmacc\*(C'\fR and \f(CW\*(C`dmacchi\*(C'\fR
+instructions are available instead.
+.IP "\fB\-mfix\-sb1\fR" 4
+.IX Item "-mfix-sb1"
+.PD 0
+.IP "\fB\-mno\-fix\-sb1\fR" 4
+.IX Item "-mno-fix-sb1"
+.PD
+Work around certain \s-1SB\-1\s0 \s-1CPU\s0 core errata.
+(This flag currently works around the \s-1SB\-1\s0 revision 2
+\&\*(L"F1\*(R" and \*(L"F2\*(R" floating point errata.)
+.IP "\fB\-mr10k\-cache\-barrier=\fR\fIsetting\fR" 4
+.IX Item "-mr10k-cache-barrier=setting"
+Specify whether \s-1GCC\s0 should insert cache barriers to avoid the
+side-effects of speculation on R10K processors.
+.Sp
+In common with many processors, the R10K tries to predict the outcome
+of a conditional branch and speculatively executes instructions from
+the \*(L"taken\*(R" branch. It later aborts these instructions if the
+predicted outcome was wrong. However, on the R10K, even aborted
+instructions can have side effects.
+.Sp
+This problem only affects kernel stores and, depending on the system,
+kernel loads. As an example, a speculatively-executed store may load
+the target memory into cache and mark the cache line as dirty, even if
+the store itself is later aborted. If a \s-1DMA\s0 operation writes to the
+same area of memory before the \*(L"dirty\*(R" line is flushed, the cached
+data will overwrite the DMA-ed data. See the R10K processor manual
+for a full description, including other potential problems.
+.Sp
+One workaround is to insert cache barrier instructions before every memory
+access that might be speculatively executed and that might have side
+effects even if aborted. \fB\-mr10k\-cache\-barrier=\fR\fIsetting\fR
+controls \s-1GCC\s0's implementation of this workaround. It assumes that
+aborted accesses to any byte in the following regions will not have
+side effects:
+.RS 4
+.IP "1." 4
+the memory occupied by the current function's stack frame;
+.IP "2." 4
+the memory occupied by an incoming stack argument;
+.IP "3." 4
+the memory occupied by an object with a link-time-constant address.
+.RE
+.RS 4
+.Sp
+It is the kernel's responsibility to ensure that speculative
+accesses to these regions are indeed safe.
+.Sp
+If the input program contains a function declaration such as:
+.Sp
+.Vb 1
+\& void foo (void);
+.Ve
+.Sp
+then the implementation of \f(CW\*(C`foo\*(C'\fR must allow \f(CW\*(C`j foo\*(C'\fR and
+\&\f(CW\*(C`jal foo\*(C'\fR to be executed speculatively. \s-1GCC\s0 honors this
+restriction for functions it compiles itself. It expects non-GCC
+functions (such as hand-written assembly code) to do the same.
+.Sp
+The option has three forms:
+.IP "\fB\-mr10k\-cache\-barrier=load\-store\fR" 4
+.IX Item "-mr10k-cache-barrier=load-store"
+Insert a cache barrier before a load or store that might be
+speculatively executed and that might have side effects even
+if aborted.
+.IP "\fB\-mr10k\-cache\-barrier=store\fR" 4
+.IX Item "-mr10k-cache-barrier=store"
+Insert a cache barrier before a store that might be speculatively
+executed and that might have side effects even if aborted.
+.IP "\fB\-mr10k\-cache\-barrier=none\fR" 4
+.IX Item "-mr10k-cache-barrier=none"
+Disable the insertion of cache barriers. This is the default setting.
+.RE
+.RS 4
+.RE
+.IP "\fB\-mflush\-func=\fR\fIfunc\fR" 4
+.IX Item "-mflush-func=func"
+.PD 0
+.IP "\fB\-mno\-flush\-func\fR" 4
+.IX Item "-mno-flush-func"
+.PD
+Specifies the function to call to flush the I and D caches, or to not
+call any such function. If called, the function must take the same
+arguments as the common \f(CW\*(C`_flush_func()\*(C'\fR, that is, the address of the
+memory range for which the cache is being flushed, the size of the
+memory range, and the number 3 (to flush both caches). The default
+depends on the target \s-1GCC\s0 was configured for, but commonly is either
+\&\fB_flush_func\fR or \fB_\|_cpu_flush\fR.
+.IP "\fBmbranch\-cost=\fR\fInum\fR" 4
+.IX Item "mbranch-cost=num"
+Set the cost of branches to roughly \fInum\fR \*(L"simple\*(R" instructions.
+This cost is only a heuristic and is not guaranteed to produce
+consistent results across releases. A zero cost redundantly selects
+the default, which is based on the \fB\-mtune\fR setting.
+.IP "\fB\-mbranch\-likely\fR" 4
+.IX Item "-mbranch-likely"
+.PD 0
+.IP "\fB\-mno\-branch\-likely\fR" 4
+.IX Item "-mno-branch-likely"
+.PD
+Enable or disable use of Branch Likely instructions, regardless of the
+default for the selected architecture. By default, Branch Likely
+instructions may be generated if they are supported by the selected
+architecture. An exception is for the \s-1MIPS32\s0 and \s-1MIPS64\s0 architectures
+and processors which implement those architectures; for those, Branch
+Likely instructions will not be generated by default because the \s-1MIPS32\s0
+and \s-1MIPS64\s0 architectures specifically deprecate their use.
+.IP "\fB\-mfp\-exceptions\fR" 4
+.IX Item "-mfp-exceptions"
+.PD 0
+.IP "\fB\-mno\-fp\-exceptions\fR" 4
+.IX Item "-mno-fp-exceptions"
+.PD
+Specifies whether \s-1FP\s0 exceptions are enabled. This affects how we schedule
+\&\s-1FP\s0 instructions for some processors. The default is that \s-1FP\s0 exceptions are
+enabled.
+.Sp
+For instance, on the \s-1SB\-1\s0, if \s-1FP\s0 exceptions are disabled, and we are emitting
+64\-bit code, then we can use both \s-1FP\s0 pipes. Otherwise, we can only use one
+\&\s-1FP\s0 pipe.
+.IP "\fB\-mvr4130\-align\fR" 4
+.IX Item "-mvr4130-align"
+.PD 0
+.IP "\fB\-mno\-vr4130\-align\fR" 4
+.IX Item "-mno-vr4130-align"
+.PD
+The \s-1VR4130\s0 pipeline is two-way superscalar, but can only issue two
+instructions together if the first one is 8\-byte aligned. When this
+option is enabled, \s-1GCC\s0 will align pairs of instructions that it
+thinks should execute in parallel.
+.Sp
+This option only has an effect when optimizing for the \s-1VR4130\s0.
+It normally makes code faster, but at the expense of making it bigger.
+It is enabled by default at optimization level \fB\-O3\fR.
+.PP
+\fI\s-1MMIX\s0 Options\fR
+.IX Subsection "MMIX Options"
+.PP
+These options are defined for the \s-1MMIX:\s0
+.IP "\fB\-mlibfuncs\fR" 4
+.IX Item "-mlibfuncs"
+.PD 0
+.IP "\fB\-mno\-libfuncs\fR" 4
+.IX Item "-mno-libfuncs"
+.PD
+Specify that intrinsic library functions are being compiled, passing all
+values in registers, no matter the size.
+.IP "\fB\-mepsilon\fR" 4
+.IX Item "-mepsilon"
+.PD 0
+.IP "\fB\-mno\-epsilon\fR" 4
+.IX Item "-mno-epsilon"
+.PD
+Generate floating-point comparison instructions that compare with respect
+to the \f(CW\*(C`rE\*(C'\fR epsilon register.
+.IP "\fB\-mabi=mmixware\fR" 4
+.IX Item "-mabi=mmixware"
+.PD 0
+.IP "\fB\-mabi=gnu\fR" 4
+.IX Item "-mabi=gnu"
+.PD
+Generate code that passes function parameters and return values that (in
+the called function) are seen as registers \f(CW$0\fR and up, as opposed to
+the \s-1GNU\s0 \s-1ABI\s0 which uses global registers \f(CW$231\fR and up.
+.IP "\fB\-mzero\-extend\fR" 4
+.IX Item "-mzero-extend"
+.PD 0
+.IP "\fB\-mno\-zero\-extend\fR" 4
+.IX Item "-mno-zero-extend"
+.PD
+When reading data from memory in sizes shorter than 64 bits, use (do not
+use) zero-extending load instructions by default, rather than
+sign-extending ones.
+.IP "\fB\-mknuthdiv\fR" 4
+.IX Item "-mknuthdiv"
+.PD 0
+.IP "\fB\-mno\-knuthdiv\fR" 4
+.IX Item "-mno-knuthdiv"
+.PD
+Make the result of a division yielding a remainder have the same sign as
+the divisor. With the default, \fB\-mno\-knuthdiv\fR, the sign of the
+remainder follows the sign of the dividend. Both methods are
+arithmetically valid, the latter being almost exclusively used.
+.IP "\fB\-mtoplevel\-symbols\fR" 4
+.IX Item "-mtoplevel-symbols"
+.PD 0
+.IP "\fB\-mno\-toplevel\-symbols\fR" 4
+.IX Item "-mno-toplevel-symbols"
+.PD
+Prepend (do not prepend) a \fB:\fR to all global symbols, so the assembly
+code can be used with the \f(CW\*(C`PREFIX\*(C'\fR assembly directive.
+.IP "\fB\-melf\fR" 4
+.IX Item "-melf"
+Generate an executable in the \s-1ELF\s0 format, rather than the default
+\&\fBmmo\fR format used by the \fBmmix\fR simulator.
+.IP "\fB\-mbranch\-predict\fR" 4
+.IX Item "-mbranch-predict"
+.PD 0
+.IP "\fB\-mno\-branch\-predict\fR" 4
+.IX Item "-mno-branch-predict"
+.PD
+Use (do not use) the probable-branch instructions, when static branch
+prediction indicates a probable branch.
+.IP "\fB\-mbase\-addresses\fR" 4
+.IX Item "-mbase-addresses"
+.PD 0
+.IP "\fB\-mno\-base\-addresses\fR" 4
+.IX Item "-mno-base-addresses"
+.PD
+Generate (do not generate) code that uses \fIbase addresses\fR. Using a
+base address automatically generates a request (handled by the assembler
+and the linker) for a constant to be set up in a global register. The
+register is used for one or more base address requests within the range 0
+to 255 from the value held in the register. The generally leads to short
+and fast code, but the number of different data items that can be
+addressed is limited. This means that a program that uses lots of static
+data may require \fB\-mno\-base\-addresses\fR.
+.IP "\fB\-msingle\-exit\fR" 4
+.IX Item "-msingle-exit"
+.PD 0
+.IP "\fB\-mno\-single\-exit\fR" 4
+.IX Item "-mno-single-exit"
+.PD
+Force (do not force) generated code to have a single exit point in each
+function.
+.PP
+\fI\s-1MN10300\s0 Options\fR
+.IX Subsection "MN10300 Options"
+.PP
+These \fB\-m\fR options are defined for Matsushita \s-1MN10300\s0 architectures:
+.IP "\fB\-mmult\-bug\fR" 4
+.IX Item "-mmult-bug"
+Generate code to avoid bugs in the multiply instructions for the \s-1MN10300\s0
+processors. This is the default.
+.IP "\fB\-mno\-mult\-bug\fR" 4
+.IX Item "-mno-mult-bug"
+Do not generate code to avoid bugs in the multiply instructions for the
+\&\s-1MN10300\s0 processors.
+.IP "\fB\-mam33\fR" 4
+.IX Item "-mam33"
+Generate code which uses features specific to the \s-1AM33\s0 processor.
+.IP "\fB\-mno\-am33\fR" 4
+.IX Item "-mno-am33"
+Do not generate code which uses features specific to the \s-1AM33\s0 processor. This
+is the default.
+.IP "\fB\-mreturn\-pointer\-on\-d0\fR" 4
+.IX Item "-mreturn-pointer-on-d0"
+When generating a function which returns a pointer, return the pointer
+in both \f(CW\*(C`a0\*(C'\fR and \f(CW\*(C`d0\*(C'\fR. Otherwise, the pointer is returned
+only in a0, and attempts to call such functions without a prototype
+would result in errors. Note that this option is on by default; use
+\&\fB\-mno\-return\-pointer\-on\-d0\fR to disable it.
+.IP "\fB\-mno\-crt0\fR" 4
+.IX Item "-mno-crt0"
+Do not link in the C run-time initialization object file.
+.IP "\fB\-mrelax\fR" 4
+.IX Item "-mrelax"
+Indicate to the linker that it should perform a relaxation optimization pass
+to shorten branches, calls and absolute memory addresses. This option only
+has an effect when used on the command line for the final link step.
+.Sp
+This option makes symbolic debugging impossible.
+.PP
+\fI\s-1PDP\-11\s0 Options\fR
+.IX Subsection "PDP-11 Options"
+.PP
+These options are defined for the \s-1PDP\-11:\s0
+.IP "\fB\-mfpu\fR" 4
+.IX Item "-mfpu"
+Use hardware \s-1FPP\s0 floating point. This is the default. (\s-1FIS\s0 floating
+point on the \s-1PDP\-11/40\s0 is not supported.)
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+Do not use hardware floating point.
+.IP "\fB\-mac0\fR" 4
+.IX Item "-mac0"
+Return floating-point results in ac0 (fr0 in Unix assembler syntax).
+.IP "\fB\-mno\-ac0\fR" 4
+.IX Item "-mno-ac0"
+Return floating-point results in memory. This is the default.
+.IP "\fB\-m40\fR" 4
+.IX Item "-m40"
+Generate code for a \s-1PDP\-11/40\s0.
+.IP "\fB\-m45\fR" 4
+.IX Item "-m45"
+Generate code for a \s-1PDP\-11/45\s0. This is the default.
+.IP "\fB\-m10\fR" 4
+.IX Item "-m10"
+Generate code for a \s-1PDP\-11/10\s0.
+.IP "\fB\-mbcopy\-builtin\fR" 4
+.IX Item "-mbcopy-builtin"
+Use inline \f(CW\*(C`movmemhi\*(C'\fR patterns for copying memory. This is the
+default.
+.IP "\fB\-mbcopy\fR" 4
+.IX Item "-mbcopy"
+Do not use inline \f(CW\*(C`movmemhi\*(C'\fR patterns for copying memory.
+.IP "\fB\-mint16\fR" 4
+.IX Item "-mint16"
+.PD 0
+.IP "\fB\-mno\-int32\fR" 4
+.IX Item "-mno-int32"
+.PD
+Use 16\-bit \f(CW\*(C`int\*(C'\fR. This is the default.
+.IP "\fB\-mint32\fR" 4
+.IX Item "-mint32"
+.PD 0
+.IP "\fB\-mno\-int16\fR" 4
+.IX Item "-mno-int16"
+.PD
+Use 32\-bit \f(CW\*(C`int\*(C'\fR.
+.IP "\fB\-mfloat64\fR" 4
+.IX Item "-mfloat64"
+.PD 0
+.IP "\fB\-mno\-float32\fR" 4
+.IX Item "-mno-float32"
+.PD
+Use 64\-bit \f(CW\*(C`float\*(C'\fR. This is the default.
+.IP "\fB\-mfloat32\fR" 4
+.IX Item "-mfloat32"
+.PD 0
+.IP "\fB\-mno\-float64\fR" 4
+.IX Item "-mno-float64"
+.PD
+Use 32\-bit \f(CW\*(C`float\*(C'\fR.
+.IP "\fB\-mabshi\fR" 4
+.IX Item "-mabshi"
+Use \f(CW\*(C`abshi2\*(C'\fR pattern. This is the default.
+.IP "\fB\-mno\-abshi\fR" 4
+.IX Item "-mno-abshi"
+Do not use \f(CW\*(C`abshi2\*(C'\fR pattern.
+.IP "\fB\-mbranch\-expensive\fR" 4
+.IX Item "-mbranch-expensive"
+Pretend that branches are expensive. This is for experimenting with
+code generation only.
+.IP "\fB\-mbranch\-cheap\fR" 4
+.IX Item "-mbranch-cheap"
+Do not pretend that branches are expensive. This is the default.
+.IP "\fB\-msplit\fR" 4
+.IX Item "-msplit"
+Generate code for a system with split I&D.
+.IP "\fB\-mno\-split\fR" 4
+.IX Item "-mno-split"
+Generate code for a system without split I&D. This is the default.
+.IP "\fB\-munix\-asm\fR" 4
+.IX Item "-munix-asm"
+Use Unix assembler syntax. This is the default when configured for
+\&\fBpdp11\-*\-bsd\fR.
+.IP "\fB\-mdec\-asm\fR" 4
+.IX Item "-mdec-asm"
+Use \s-1DEC\s0 assembler syntax. This is the default when configured for any
+\&\s-1PDP\-11\s0 target other than \fBpdp11\-*\-bsd\fR.
+.PP
+\fIpicoChip Options\fR
+.IX Subsection "picoChip Options"
+.PP
+These \fB\-m\fR options are defined for picoChip implementations:
+.IP "\fB\-mae=\fR\fIae_type\fR" 4
+.IX Item "-mae=ae_type"
+Set the instruction set, register set, and instruction scheduling
+parameters for array element type \fIae_type\fR. Supported values
+for \fIae_type\fR are \fB\s-1ANY\s0\fR, \fB\s-1MUL\s0\fR, and \fB\s-1MAC\s0\fR.
+.Sp
+\&\fB\-mae=ANY\fR selects a completely generic \s-1AE\s0 type. Code
+generated with this option will run on any of the other \s-1AE\s0 types. The
+code will not be as efficient as it would be if compiled for a specific
+\&\s-1AE\s0 type, and some types of operation (e.g., multiplication) will not
+work properly on all types of \s-1AE\s0.
+.Sp
+\&\fB\-mae=MUL\fR selects a \s-1MUL\s0 \s-1AE\s0 type. This is the most useful \s-1AE\s0 type
+for compiled code, and is the default.
+.Sp
+\&\fB\-mae=MAC\fR selects a DSP-style \s-1MAC\s0 \s-1AE\s0. Code compiled with this
+option may suffer from poor performance of byte (char) manipulation,
+since the \s-1DSP\s0 \s-1AE\s0 does not provide hardware support for byte load/stores.
+.IP "\fB\-msymbol\-as\-address\fR" 4
+.IX Item "-msymbol-as-address"
+Enable the compiler to directly use a symbol name as an address in a
+load/store instruction, without first loading it into a
+register. Typically, the use of this option will generate larger
+programs, which run faster than when the option isn't used. However, the
+results vary from program to program, so it is left as a user option,
+rather than being permanently enabled.
+.IP "\fB\-mno\-inefficient\-warnings\fR" 4
+.IX Item "-mno-inefficient-warnings"
+Disables warnings about the generation of inefficient code. These
+warnings can be generated, for example, when compiling code which
+performs byte-level memory operations on the \s-1MAC\s0 \s-1AE\s0 type. The \s-1MAC\s0 \s-1AE\s0 has
+no hardware support for byte-level memory operations, so all byte
+load/stores must be synthesized from word load/store operations. This is
+inefficient and a warning will be generated indicating to the programmer
+that they should rewrite the code to avoid byte operations, or to target
+an \s-1AE\s0 type which has the necessary hardware support. This option enables
+the warning to be turned off.
+.PP
+\fIPowerPC Options\fR
+.IX Subsection "PowerPC Options"
+.PP
+These are listed under
+.PP
+\fI\s-1IBM\s0 \s-1RS/6000\s0 and PowerPC Options\fR
+.IX Subsection "IBM RS/6000 and PowerPC Options"
+.PP
+These \fB\-m\fR options are defined for the \s-1IBM\s0 \s-1RS/6000\s0 and PowerPC:
+.IP "\fB\-mpower\fR" 4
+.IX Item "-mpower"
+.PD 0
+.IP "\fB\-mno\-power\fR" 4
+.IX Item "-mno-power"
+.IP "\fB\-mpower2\fR" 4
+.IX Item "-mpower2"
+.IP "\fB\-mno\-power2\fR" 4
+.IX Item "-mno-power2"
+.IP "\fB\-mpowerpc\fR" 4
+.IX Item "-mpowerpc"
+.IP "\fB\-mno\-powerpc\fR" 4
+.IX Item "-mno-powerpc"
+.IP "\fB\-mpowerpc\-gpopt\fR" 4
+.IX Item "-mpowerpc-gpopt"
+.IP "\fB\-mno\-powerpc\-gpopt\fR" 4
+.IX Item "-mno-powerpc-gpopt"
+.IP "\fB\-mpowerpc\-gfxopt\fR" 4
+.IX Item "-mpowerpc-gfxopt"
+.IP "\fB\-mno\-powerpc\-gfxopt\fR" 4
+.IX Item "-mno-powerpc-gfxopt"
+.IP "\fB\-mpowerpc64\fR" 4
+.IX Item "-mpowerpc64"
+.IP "\fB\-mno\-powerpc64\fR" 4
+.IX Item "-mno-powerpc64"
+.IP "\fB\-mmfcrf\fR" 4
+.IX Item "-mmfcrf"
+.IP "\fB\-mno\-mfcrf\fR" 4
+.IX Item "-mno-mfcrf"
+.IP "\fB\-mpopcntb\fR" 4
+.IX Item "-mpopcntb"
+.IP "\fB\-mno\-popcntb\fR" 4
+.IX Item "-mno-popcntb"
+.IP "\fB\-mfprnd\fR" 4
+.IX Item "-mfprnd"
+.IP "\fB\-mno\-fprnd\fR" 4
+.IX Item "-mno-fprnd"
+.IP "\fB\-mcmpb\fR" 4
+.IX Item "-mcmpb"
+.IP "\fB\-mno\-cmpb\fR" 4
+.IX Item "-mno-cmpb"
+.IP "\fB\-mmfpgpr\fR" 4
+.IX Item "-mmfpgpr"
+.IP "\fB\-mno\-mfpgpr\fR" 4
+.IX Item "-mno-mfpgpr"
+.IP "\fB\-mhard\-dfp\fR" 4
+.IX Item "-mhard-dfp"
+.IP "\fB\-mno\-hard\-dfp\fR" 4
+.IX Item "-mno-hard-dfp"
+.PD
+\&\s-1GCC\s0 supports two related instruction set architectures for the
+\&\s-1RS/6000\s0 and PowerPC. The \fI\s-1POWER\s0\fR instruction set are those
+instructions supported by the \fBrios\fR chip set used in the original
+\&\s-1RS/6000\s0 systems and the \fIPowerPC\fR instruction set is the
+architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
+the \s-1IBM\s0 4xx, 6xx, and follow-on microprocessors.
+.Sp
+Neither architecture is a subset of the other. However there is a
+large common subset of instructions supported by both. An \s-1MQ\s0
+register is included in processors supporting the \s-1POWER\s0 architecture.
+.Sp
+You use these options to specify which instructions are available on the
+processor you are using. The default value of these options is
+determined when configuring \s-1GCC\s0. Specifying the
+\&\fB\-mcpu=\fR\fIcpu_type\fR overrides the specification of these
+options. We recommend you use the \fB\-mcpu=\fR\fIcpu_type\fR option
+rather than the options listed above.
+.Sp
+The \fB\-mpower\fR option allows \s-1GCC\s0 to generate instructions that
+are found only in the \s-1POWER\s0 architecture and to use the \s-1MQ\s0 register.
+Specifying \fB\-mpower2\fR implies \fB\-power\fR and also allows \s-1GCC\s0
+to generate instructions that are present in the \s-1POWER2\s0 architecture but
+not the original \s-1POWER\s0 architecture.
+.Sp
+The \fB\-mpowerpc\fR option allows \s-1GCC\s0 to generate instructions that
+are found only in the 32\-bit subset of the PowerPC architecture.
+Specifying \fB\-mpowerpc\-gpopt\fR implies \fB\-mpowerpc\fR and also allows
+\&\s-1GCC\s0 to use the optional PowerPC architecture instructions in the
+General Purpose group, including floating-point square root. Specifying
+\&\fB\-mpowerpc\-gfxopt\fR implies \fB\-mpowerpc\fR and also allows \s-1GCC\s0 to
+use the optional PowerPC architecture instructions in the Graphics
+group, including floating-point select.
+.Sp
+The \fB\-mmfcrf\fR option allows \s-1GCC\s0 to generate the move from
+condition register field instruction implemented on the \s-1POWER4\s0
+processor and other processors that support the PowerPC V2.01
+architecture.
+The \fB\-mpopcntb\fR option allows \s-1GCC\s0 to generate the popcount and
+double precision \s-1FP\s0 reciprocal estimate instruction implemented on the
+\&\s-1POWER5\s0 processor and other processors that support the PowerPC V2.02
+architecture.
+The \fB\-mfprnd\fR option allows \s-1GCC\s0 to generate the \s-1FP\s0 round to
+integer instructions implemented on the \s-1POWER5+\s0 processor and other
+processors that support the PowerPC V2.03 architecture.
+The \fB\-mcmpb\fR option allows \s-1GCC\s0 to generate the compare bytes
+instruction implemented on the \s-1POWER6\s0 processor and other processors
+that support the PowerPC V2.05 architecture.
+The \fB\-mmfpgpr\fR option allows \s-1GCC\s0 to generate the \s-1FP\s0 move to/from
+general purpose register instructions implemented on the \s-1POWER6X\s0
+processor and other processors that support the extended PowerPC V2.05
+architecture.
+The \fB\-mhard\-dfp\fR option allows \s-1GCC\s0 to generate the decimal floating
+point instructions implemented on some \s-1POWER\s0 processors.
+.Sp
+The \fB\-mpowerpc64\fR option allows \s-1GCC\s0 to generate the additional
+64\-bit instructions that are found in the full PowerPC64 architecture
+and to treat GPRs as 64\-bit, doubleword quantities. \s-1GCC\s0 defaults to
+\&\fB\-mno\-powerpc64\fR.
+.Sp
+If you specify both \fB\-mno\-power\fR and \fB\-mno\-powerpc\fR, \s-1GCC\s0
+will use only the instructions in the common subset of both
+architectures plus some special \s-1AIX\s0 common-mode calls, and will not use
+the \s-1MQ\s0 register. Specifying both \fB\-mpower\fR and \fB\-mpowerpc\fR
+permits \s-1GCC\s0 to use any instruction from either architecture and to
+allow use of the \s-1MQ\s0 register; specify this for the Motorola \s-1MPC601\s0.
+.IP "\fB\-mnew\-mnemonics\fR" 4
+.IX Item "-mnew-mnemonics"
+.PD 0
+.IP "\fB\-mold\-mnemonics\fR" 4
+.IX Item "-mold-mnemonics"
+.PD
+Select which mnemonics to use in the generated assembler code. With
+\&\fB\-mnew\-mnemonics\fR, \s-1GCC\s0 uses the assembler mnemonics defined for
+the PowerPC architecture. With \fB\-mold\-mnemonics\fR it uses the
+assembler mnemonics defined for the \s-1POWER\s0 architecture. Instructions
+defined in only one architecture have only one mnemonic; \s-1GCC\s0 uses that
+mnemonic irrespective of which of these options is specified.
+.Sp
+\&\s-1GCC\s0 defaults to the mnemonics appropriate for the architecture in
+use. Specifying \fB\-mcpu=\fR\fIcpu_type\fR sometimes overrides the
+value of these option. Unless you are building a cross-compiler, you
+should normally not specify either \fB\-mnew\-mnemonics\fR or
+\&\fB\-mold\-mnemonics\fR, but should instead accept the default.
+.IP "\fB\-mcpu=\fR\fIcpu_type\fR" 4
+.IX Item "-mcpu=cpu_type"
+Set architecture type, register usage, choice of mnemonics, and
+instruction scheduling parameters for machine type \fIcpu_type\fR.
+Supported values for \fIcpu_type\fR are \fB401\fR, \fB403\fR,
+\&\fB405\fR, \fB405fp\fR, \fB440\fR, \fB440fp\fR, \fB464\fR, \fB464fp\fR,
+\&\fB505\fR, \fB601\fR, \fB602\fR, \fB603\fR, \fB603e\fR, \fB604\fR,
+\&\fB604e\fR, \fB620\fR, \fB630\fR, \fB740\fR, \fB7400\fR,
+\&\fB7450\fR, \fB750\fR, \fB801\fR, \fB821\fR, \fB823\fR,
+\&\fB860\fR, \fB970\fR, \fB8540\fR, \fBe300c2\fR, \fBe300c3\fR,
+\&\fBe500mc\fR, \fBec603e\fR, \fBG3\fR, \fBG4\fR, \fBG5\fR,
+\&\fBpower\fR, \fBpower2\fR, \fBpower3\fR, \fBpower4\fR,
+\&\fBpower5\fR, \fBpower5+\fR, \fBpower6\fR, \fBpower6x\fR, \fBpower7\fR
+\&\fBcommon\fR, \fBpowerpc\fR, \fBpowerpc64\fR, \fBrios\fR,
+\&\fBrios1\fR, \fBrios2\fR, \fBrsc\fR, and \fBrs64\fR.
+.Sp
+\&\fB\-mcpu=common\fR selects a completely generic processor. Code
+generated under this option will run on any \s-1POWER\s0 or PowerPC processor.
+\&\s-1GCC\s0 will use only the instructions in the common subset of both
+architectures, and will not use the \s-1MQ\s0 register. \s-1GCC\s0 assumes a generic
+processor model for scheduling purposes.
+.Sp
+\&\fB\-mcpu=power\fR, \fB\-mcpu=power2\fR, \fB\-mcpu=powerpc\fR, and
+\&\fB\-mcpu=powerpc64\fR specify generic \s-1POWER\s0, \s-1POWER2\s0, pure 32\-bit
+PowerPC (i.e., not \s-1MPC601\s0), and 64\-bit PowerPC architecture machine
+types, with an appropriate, generic processor model assumed for
+scheduling purposes.
+.Sp
+The other options specify a specific processor. Code generated under
+those options will run best on that processor, and may not run at all on
+others.
+.Sp
+The \fB\-mcpu\fR options automatically enable or disable the
+following options:
+.Sp
+\&\fB\-maltivec \-mfprnd \-mhard\-float \-mmfcrf \-mmultiple
+\&\-mnew\-mnemonics \-mpopcntb \-mpower \-mpower2 \-mpowerpc64
+\&\-mpowerpc\-gpopt \-mpowerpc\-gfxopt \-msingle\-float \-mdouble\-float
+\&\-msimple\-fpu \-mstring \-mmulhw \-mdlmzb \-mmfpgpr\fR
+.Sp
+The particular options set for any particular \s-1CPU\s0 will vary between
+compiler versions, depending on what setting seems to produce optimal
+code for that \s-1CPU\s0; it doesn't necessarily reflect the actual hardware's
+capabilities. If you wish to set an individual option to a particular
+value, you may specify it after the \fB\-mcpu\fR option, like
+\&\fB\-mcpu=970 \-mno\-altivec\fR.
+.Sp
+On \s-1AIX\s0, the \fB\-maltivec\fR and \fB\-mpowerpc64\fR options are
+not enabled or disabled by the \fB\-mcpu\fR option at present because
+\&\s-1AIX\s0 does not have full support for these options. You may still
+enable or disable them individually if you're sure it'll work in your
+environment.
+.IP "\fB\-mtune=\fR\fIcpu_type\fR" 4
+.IX Item "-mtune=cpu_type"
+Set the instruction scheduling parameters for machine type
+\&\fIcpu_type\fR, but do not set the architecture type, register usage, or
+choice of mnemonics, as \fB\-mcpu=\fR\fIcpu_type\fR would. The same
+values for \fIcpu_type\fR are used for \fB\-mtune\fR as for
+\&\fB\-mcpu\fR. If both are specified, the code generated will use the
+architecture, registers, and mnemonics set by \fB\-mcpu\fR, but the
+scheduling parameters set by \fB\-mtune\fR.
+.IP "\fB\-mswdiv\fR" 4
+.IX Item "-mswdiv"
+.PD 0
+.IP "\fB\-mno\-swdiv\fR" 4
+.IX Item "-mno-swdiv"
+.PD
+Generate code to compute division as reciprocal estimate and iterative
+refinement, creating opportunities for increased throughput. This
+feature requires: optional PowerPC Graphics instruction set for single
+precision and \s-1FRE\s0 instruction for double precision, assuming divides
+cannot generate user-visible traps, and the domain values not include
+Infinities, denormals or zero denominator.
+.IP "\fB\-maltivec\fR" 4
+.IX Item "-maltivec"
+.PD 0
+.IP "\fB\-mno\-altivec\fR" 4
+.IX Item "-mno-altivec"
+.PD
+Generate code that uses (does not use) AltiVec instructions, and also
+enable the use of built-in functions that allow more direct access to
+the AltiVec instruction set. You may also need to set
+\&\fB\-mabi=altivec\fR to adjust the current \s-1ABI\s0 with AltiVec \s-1ABI\s0
+enhancements.
+.IP "\fB\-mvrsave\fR" 4
+.IX Item "-mvrsave"
+.PD 0
+.IP "\fB\-mno\-vrsave\fR" 4
+.IX Item "-mno-vrsave"
+.PD
+Generate \s-1VRSAVE\s0 instructions when generating AltiVec code.
+.IP "\fB\-mgen\-cell\-microcode\fR" 4
+.IX Item "-mgen-cell-microcode"
+Generate Cell microcode instructions
+.IP "\fB\-mwarn\-cell\-microcode\fR" 4
+.IX Item "-mwarn-cell-microcode"
+Warning when a Cell microcode instruction is going to emitted. An example
+of a Cell microcode instruction is a variable shift.
+.IP "\fB\-msecure\-plt\fR" 4
+.IX Item "-msecure-plt"
+Generate code that allows ld and ld.so to build executables and shared
+libraries with non-exec .plt and .got sections. This is a PowerPC
+32\-bit \s-1SYSV\s0 \s-1ABI\s0 option.
+.IP "\fB\-mbss\-plt\fR" 4
+.IX Item "-mbss-plt"
+Generate code that uses a \s-1BSS\s0 .plt section that ld.so fills in, and
+requires .plt and .got sections that are both writable and executable.
+This is a PowerPC 32\-bit \s-1SYSV\s0 \s-1ABI\s0 option.
+.IP "\fB\-misel\fR" 4
+.IX Item "-misel"
+.PD 0
+.IP "\fB\-mno\-isel\fR" 4
+.IX Item "-mno-isel"
+.PD
+This switch enables or disables the generation of \s-1ISEL\s0 instructions.
+.IP "\fB\-misel=\fR\fIyes/no\fR" 4
+.IX Item "-misel=yes/no"
+This switch has been deprecated. Use \fB\-misel\fR and
+\&\fB\-mno\-isel\fR instead.
+.IP "\fB\-mspe\fR" 4
+.IX Item "-mspe"
+.PD 0
+.IP "\fB\-mno\-spe\fR" 4
+.IX Item "-mno-spe"
+.PD
+This switch enables or disables the generation of \s-1SPE\s0 simd
+instructions.
+.IP "\fB\-mpaired\fR" 4
+.IX Item "-mpaired"
+.PD 0
+.IP "\fB\-mno\-paired\fR" 4
+.IX Item "-mno-paired"
+.PD
+This switch enables or disables the generation of \s-1PAIRED\s0 simd
+instructions.
+.IP "\fB\-mspe=\fR\fIyes/no\fR" 4
+.IX Item "-mspe=yes/no"
+This option has been deprecated. Use \fB\-mspe\fR and
+\&\fB\-mno\-spe\fR instead.
+.IP "\fB\-mfloat\-gprs=\fR\fIyes/single/double/no\fR" 4
+.IX Item "-mfloat-gprs=yes/single/double/no"
+.PD 0
+.IP "\fB\-mfloat\-gprs\fR" 4
+.IX Item "-mfloat-gprs"
+.PD
+This switch enables or disables the generation of floating point
+operations on the general purpose registers for architectures that
+support it.
+.Sp
+The argument \fIyes\fR or \fIsingle\fR enables the use of
+single-precision floating point operations.
+.Sp
+The argument \fIdouble\fR enables the use of single and
+double-precision floating point operations.
+.Sp
+The argument \fIno\fR disables floating point operations on the
+general purpose registers.
+.Sp
+This option is currently only available on the MPC854x.
+.IP "\fB\-m32\fR" 4
+.IX Item "-m32"
+.PD 0
+.IP "\fB\-m64\fR" 4
+.IX Item "-m64"
+.PD
+Generate code for 32\-bit or 64\-bit environments of Darwin and \s-1SVR4\s0
+targets (including GNU/Linux). The 32\-bit environment sets int, long
+and pointer to 32 bits and generates code that runs on any PowerPC
+variant. The 64\-bit environment sets int to 32 bits and long and
+pointer to 64 bits, and generates code for PowerPC64, as for
+\&\fB\-mpowerpc64\fR.
+.IP "\fB\-mfull\-toc\fR" 4
+.IX Item "-mfull-toc"
+.PD 0
+.IP "\fB\-mno\-fp\-in\-toc\fR" 4
+.IX Item "-mno-fp-in-toc"
+.IP "\fB\-mno\-sum\-in\-toc\fR" 4
+.IX Item "-mno-sum-in-toc"
+.IP "\fB\-mminimal\-toc\fR" 4
+.IX Item "-mminimal-toc"
+.PD
+Modify generation of the \s-1TOC\s0 (Table Of Contents), which is created for
+every executable file. The \fB\-mfull\-toc\fR option is selected by
+default. In that case, \s-1GCC\s0 will allocate at least one \s-1TOC\s0 entry for
+each unique non-automatic variable reference in your program. \s-1GCC\s0
+will also place floating-point constants in the \s-1TOC\s0. However, only
+16,384 entries are available in the \s-1TOC\s0.
+.Sp
+If you receive a linker error message that saying you have overflowed
+the available \s-1TOC\s0 space, you can reduce the amount of \s-1TOC\s0 space used
+with the \fB\-mno\-fp\-in\-toc\fR and \fB\-mno\-sum\-in\-toc\fR options.
+\&\fB\-mno\-fp\-in\-toc\fR prevents \s-1GCC\s0 from putting floating-point
+constants in the \s-1TOC\s0 and \fB\-mno\-sum\-in\-toc\fR forces \s-1GCC\s0 to
+generate code to calculate the sum of an address and a constant at
+run-time instead of putting that sum into the \s-1TOC\s0. You may specify one
+or both of these options. Each causes \s-1GCC\s0 to produce very slightly
+slower and larger code at the expense of conserving \s-1TOC\s0 space.
+.Sp
+If you still run out of space in the \s-1TOC\s0 even when you specify both of
+these options, specify \fB\-mminimal\-toc\fR instead. This option causes
+\&\s-1GCC\s0 to make only one \s-1TOC\s0 entry for every file. When you specify this
+option, \s-1GCC\s0 will produce code that is slower and larger but which
+uses extremely little \s-1TOC\s0 space. You may wish to use this option
+only on files that contain less frequently executed code.
+.IP "\fB\-maix64\fR" 4
+.IX Item "-maix64"
+.PD 0
+.IP "\fB\-maix32\fR" 4
+.IX Item "-maix32"
+.PD
+Enable 64\-bit \s-1AIX\s0 \s-1ABI\s0 and calling convention: 64\-bit pointers, 64\-bit
+\&\f(CW\*(C`long\*(C'\fR type, and the infrastructure needed to support them.
+Specifying \fB\-maix64\fR implies \fB\-mpowerpc64\fR and
+\&\fB\-mpowerpc\fR, while \fB\-maix32\fR disables the 64\-bit \s-1ABI\s0 and
+implies \fB\-mno\-powerpc64\fR. \s-1GCC\s0 defaults to \fB\-maix32\fR.
+.IP "\fB\-mxl\-compat\fR" 4
+.IX Item "-mxl-compat"
+.PD 0
+.IP "\fB\-mno\-xl\-compat\fR" 4
+.IX Item "-mno-xl-compat"
+.PD
+Produce code that conforms more closely to \s-1IBM\s0 \s-1XL\s0 compiler semantics
+when using AIX-compatible \s-1ABI\s0. Pass floating-point arguments to
+prototyped functions beyond the register save area (\s-1RSA\s0) on the stack
+in addition to argument FPRs. Do not assume that most significant
+double in 128\-bit long double value is properly rounded when comparing
+values and converting to double. Use \s-1XL\s0 symbol names for long double
+support routines.
+.Sp
+The \s-1AIX\s0 calling convention was extended but not initially documented to
+handle an obscure K&R C case of calling a function that takes the
+address of its arguments with fewer arguments than declared. \s-1IBM\s0 \s-1XL\s0
+compilers access floating point arguments which do not fit in the
+\&\s-1RSA\s0 from the stack when a subroutine is compiled without
+optimization. Because always storing floating-point arguments on the
+stack is inefficient and rarely needed, this option is not enabled by
+default and only is necessary when calling subroutines compiled by \s-1IBM\s0
+\&\s-1XL\s0 compilers without optimization.
+.IP "\fB\-mpe\fR" 4
+.IX Item "-mpe"
+Support \fI\s-1IBM\s0 \s-1RS/6000\s0 \s-1SP\s0\fR \fIParallel Environment\fR (\s-1PE\s0). Link an
+application written to use message passing with special startup code to
+enable the application to run. The system must have \s-1PE\s0 installed in the
+standard location (\fI/usr/lpp/ppe.poe/\fR), or the \fIspecs\fR file
+must be overridden with the \fB\-specs=\fR option to specify the
+appropriate directory location. The Parallel Environment does not
+support threads, so the \fB\-mpe\fR option and the \fB\-pthread\fR
+option are incompatible.
+.IP "\fB\-malign\-natural\fR" 4
+.IX Item "-malign-natural"
+.PD 0
+.IP "\fB\-malign\-power\fR" 4
+.IX Item "-malign-power"
+.PD
+On \s-1AIX\s0, 32\-bit Darwin, and 64\-bit PowerPC GNU/Linux, the option
+\&\fB\-malign\-natural\fR overrides the ABI-defined alignment of larger
+types, such as floating-point doubles, on their natural size-based boundary.
+The option \fB\-malign\-power\fR instructs \s-1GCC\s0 to follow the ABI-specified
+alignment rules. \s-1GCC\s0 defaults to the standard alignment defined in the \s-1ABI\s0.
+.Sp
+On 64\-bit Darwin, natural alignment is the default, and \fB\-malign\-power\fR
+is not supported.
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+.PD 0
+.IP "\fB\-mhard\-float\fR" 4
+.IX Item "-mhard-float"
+.PD
+Generate code that does not use (uses) the floating-point register set.
+Software floating point emulation is provided if you use the
+\&\fB\-msoft\-float\fR option, and pass the option to \s-1GCC\s0 when linking.
+.IP "\fB\-msingle\-float\fR" 4
+.IX Item "-msingle-float"
+.PD 0
+.IP "\fB\-mdouble\-float\fR" 4
+.IX Item "-mdouble-float"
+.PD
+Generate code for single or double-precision floating point operations.
+\&\fB\-mdouble\-float\fR implies \fB\-msingle\-float\fR.
+.IP "\fB\-msimple\-fpu\fR" 4
+.IX Item "-msimple-fpu"
+Do not generate sqrt and div instructions for hardware floating point unit.
+.IP "\fB\-mfpu\fR" 4
+.IX Item "-mfpu"
+Specify type of floating point unit. Valid values are \fIsp_lite\fR
+(equivalent to \-msingle\-float \-msimple\-fpu), \fIdp_lite\fR (equivalent
+to \-mdouble\-float \-msimple\-fpu), \fIsp_full\fR (equivalent to \-msingle\-float),
+and \fIdp_full\fR (equivalent to \-mdouble\-float).
+.IP "\fB\-mxilinx\-fpu\fR" 4
+.IX Item "-mxilinx-fpu"
+Perform optimizations for floating point unit on Xilinx \s-1PPC\s0 405/440.
+.IP "\fB\-mmultiple\fR" 4
+.IX Item "-mmultiple"
+.PD 0
+.IP "\fB\-mno\-multiple\fR" 4
+.IX Item "-mno-multiple"
+.PD
+Generate code that uses (does not use) the load multiple word
+instructions and the store multiple word instructions. These
+instructions are generated by default on \s-1POWER\s0 systems, and not
+generated on PowerPC systems. Do not use \fB\-mmultiple\fR on little
+endian PowerPC systems, since those instructions do not work when the
+processor is in little endian mode. The exceptions are \s-1PPC740\s0 and
+\&\s-1PPC750\s0 which permit the instructions usage in little endian mode.
+.IP "\fB\-mstring\fR" 4
+.IX Item "-mstring"
+.PD 0
+.IP "\fB\-mno\-string\fR" 4
+.IX Item "-mno-string"
+.PD
+Generate code that uses (does not use) the load string instructions
+and the store string word instructions to save multiple registers and
+do small block moves. These instructions are generated by default on
+\&\s-1POWER\s0 systems, and not generated on PowerPC systems. Do not use
+\&\fB\-mstring\fR on little endian PowerPC systems, since those
+instructions do not work when the processor is in little endian mode.
+The exceptions are \s-1PPC740\s0 and \s-1PPC750\s0 which permit the instructions
+usage in little endian mode.
+.IP "\fB\-mupdate\fR" 4
+.IX Item "-mupdate"
+.PD 0
+.IP "\fB\-mno\-update\fR" 4
+.IX Item "-mno-update"
+.PD
+Generate code that uses (does not use) the load or store instructions
+that update the base register to the address of the calculated memory
+location. These instructions are generated by default. If you use
+\&\fB\-mno\-update\fR, there is a small window between the time that the
+stack pointer is updated and the address of the previous frame is
+stored, which means code that walks the stack frame across interrupts or
+signals may get corrupted data.
+.IP "\fB\-mavoid\-indexed\-addresses\fR" 4
+.IX Item "-mavoid-indexed-addresses"
+.PD 0
+.IP "\fB\-mno\-avoid\-indexed\-addresses\fR" 4
+.IX Item "-mno-avoid-indexed-addresses"
+.PD
+Generate code that tries to avoid (not avoid) the use of indexed load
+or store instructions. These instructions can incur a performance
+penalty on Power6 processors in certain situations, such as when
+stepping through large arrays that cross a 16M boundary. This option
+is enabled by default when targetting Power6 and disabled otherwise.
+.IP "\fB\-mfused\-madd\fR" 4
+.IX Item "-mfused-madd"
+.PD 0
+.IP "\fB\-mno\-fused\-madd\fR" 4
+.IX Item "-mno-fused-madd"
+.PD
+Generate code that uses (does not use) the floating point multiply and
+accumulate instructions. These instructions are generated by default if
+hardware floating is used.
+.IP "\fB\-mmulhw\fR" 4
+.IX Item "-mmulhw"
+.PD 0
+.IP "\fB\-mno\-mulhw\fR" 4
+.IX Item "-mno-mulhw"
+.PD
+Generate code that uses (does not use) the half-word multiply and
+multiply-accumulate instructions on the \s-1IBM\s0 405, 440 and 464 processors.
+These instructions are generated by default when targetting those
+processors.
+.IP "\fB\-mdlmzb\fR" 4
+.IX Item "-mdlmzb"
+.PD 0
+.IP "\fB\-mno\-dlmzb\fR" 4
+.IX Item "-mno-dlmzb"
+.PD
+Generate code that uses (does not use) the string-search \fBdlmzb\fR
+instruction on the \s-1IBM\s0 405, 440 and 464 processors. This instruction is
+generated by default when targetting those processors.
+.IP "\fB\-mno\-bit\-align\fR" 4
+.IX Item "-mno-bit-align"
+.PD 0
+.IP "\fB\-mbit\-align\fR" 4
+.IX Item "-mbit-align"
+.PD
+On System V.4 and embedded PowerPC systems do not (do) force structures
+and unions that contain bit-fields to be aligned to the base type of the
+bit-field.
+.Sp
+For example, by default a structure containing nothing but 8
+\&\f(CW\*(C`unsigned\*(C'\fR bit-fields of length 1 would be aligned to a 4 byte
+boundary and have a size of 4 bytes. By using \fB\-mno\-bit\-align\fR,
+the structure would be aligned to a 1 byte boundary and be one byte in
+size.
+.IP "\fB\-mno\-strict\-align\fR" 4
+.IX Item "-mno-strict-align"
+.PD 0
+.IP "\fB\-mstrict\-align\fR" 4
+.IX Item "-mstrict-align"
+.PD
+On System V.4 and embedded PowerPC systems do not (do) assume that
+unaligned memory references will be handled by the system.
+.IP "\fB\-mrelocatable\fR" 4
+.IX Item "-mrelocatable"
+.PD 0
+.IP "\fB\-mno\-relocatable\fR" 4
+.IX Item "-mno-relocatable"
+.PD
+On embedded PowerPC systems generate code that allows (does not allow)
+the program to be relocated to a different address at runtime. If you
+use \fB\-mrelocatable\fR on any module, all objects linked together must
+be compiled with \fB\-mrelocatable\fR or \fB\-mrelocatable\-lib\fR.
+.IP "\fB\-mrelocatable\-lib\fR" 4
+.IX Item "-mrelocatable-lib"
+.PD 0
+.IP "\fB\-mno\-relocatable\-lib\fR" 4
+.IX Item "-mno-relocatable-lib"
+.PD
+On embedded PowerPC systems generate code that allows (does not allow)
+the program to be relocated to a different address at runtime. Modules
+compiled with \fB\-mrelocatable\-lib\fR can be linked with either modules
+compiled without \fB\-mrelocatable\fR and \fB\-mrelocatable\-lib\fR or
+with modules compiled with the \fB\-mrelocatable\fR options.
+.IP "\fB\-mno\-toc\fR" 4
+.IX Item "-mno-toc"
+.PD 0
+.IP "\fB\-mtoc\fR" 4
+.IX Item "-mtoc"
+.PD
+On System V.4 and embedded PowerPC systems do not (do) assume that
+register 2 contains a pointer to a global area pointing to the addresses
+used in the program.
+.IP "\fB\-mlittle\fR" 4
+.IX Item "-mlittle"
+.PD 0
+.IP "\fB\-mlittle\-endian\fR" 4
+.IX Item "-mlittle-endian"
+.PD
+On System V.4 and embedded PowerPC systems compile code for the
+processor in little endian mode. The \fB\-mlittle\-endian\fR option is
+the same as \fB\-mlittle\fR.
+.IP "\fB\-mbig\fR" 4
+.IX Item "-mbig"
+.PD 0
+.IP "\fB\-mbig\-endian\fR" 4
+.IX Item "-mbig-endian"
+.PD
+On System V.4 and embedded PowerPC systems compile code for the
+processor in big endian mode. The \fB\-mbig\-endian\fR option is
+the same as \fB\-mbig\fR.
+.IP "\fB\-mdynamic\-no\-pic\fR" 4
+.IX Item "-mdynamic-no-pic"
+On Darwin and Mac \s-1OS\s0 X systems, compile code so that it is not
+relocatable, but that its external references are relocatable. The
+resulting code is suitable for applications, but not shared
+libraries.
+.IP "\fB\-mprioritize\-restricted\-insns=\fR\fIpriority\fR" 4
+.IX Item "-mprioritize-restricted-insns=priority"
+This option controls the priority that is assigned to
+dispatch-slot restricted instructions during the second scheduling
+pass. The argument \fIpriority\fR takes the value \fI0/1/2\fR to assign
+\&\fIno/highest/second\-highest\fR priority to dispatch slot restricted
+instructions.
+.IP "\fB\-msched\-costly\-dep=\fR\fIdependence_type\fR" 4
+.IX Item "-msched-costly-dep=dependence_type"
+This option controls which dependences are considered costly
+by the target during instruction scheduling. The argument
+\&\fIdependence_type\fR takes one of the following values:
+\&\fIno\fR: no dependence is costly,
+\&\fIall\fR: all dependences are costly,
+\&\fItrue_store_to_load\fR: a true dependence from store to load is costly,
+\&\fIstore_to_load\fR: any dependence from store to load is costly,
+\&\fInumber\fR: any dependence which latency >= \fInumber\fR is costly.
+.IP "\fB\-minsert\-sched\-nops=\fR\fIscheme\fR" 4
+.IX Item "-minsert-sched-nops=scheme"
+This option controls which nop insertion scheme will be used during
+the second scheduling pass. The argument \fIscheme\fR takes one of the
+following values:
+\&\fIno\fR: Don't insert nops.
+\&\fIpad\fR: Pad with nops any dispatch group which has vacant issue slots,
+according to the scheduler's grouping.
+\&\fIregroup_exact\fR: Insert nops to force costly dependent insns into
+separate groups. Insert exactly as many nops as needed to force an insn
+to a new group, according to the estimated processor grouping.
+\&\fInumber\fR: Insert nops to force costly dependent insns into
+separate groups. Insert \fInumber\fR nops to force an insn to a new group.
+.IP "\fB\-mcall\-sysv\fR" 4
+.IX Item "-mcall-sysv"
+On System V.4 and embedded PowerPC systems compile code using calling
+conventions that adheres to the March 1995 draft of the System V
+Application Binary Interface, PowerPC processor supplement. This is the
+default unless you configured \s-1GCC\s0 using \fBpowerpc\-*\-eabiaix\fR.
+.IP "\fB\-mcall\-sysv\-eabi\fR" 4
+.IX Item "-mcall-sysv-eabi"
+Specify both \fB\-mcall\-sysv\fR and \fB\-meabi\fR options.
+.IP "\fB\-mcall\-sysv\-noeabi\fR" 4
+.IX Item "-mcall-sysv-noeabi"
+Specify both \fB\-mcall\-sysv\fR and \fB\-mno\-eabi\fR options.
+.IP "\fB\-mcall\-solaris\fR" 4
+.IX Item "-mcall-solaris"
+On System V.4 and embedded PowerPC systems compile code for the Solaris
+operating system.
+.IP "\fB\-mcall\-linux\fR" 4
+.IX Item "-mcall-linux"
+On System V.4 and embedded PowerPC systems compile code for the
+Linux-based \s-1GNU\s0 system.
+.IP "\fB\-mcall\-gnu\fR" 4
+.IX Item "-mcall-gnu"
+On System V.4 and embedded PowerPC systems compile code for the
+Hurd-based \s-1GNU\s0 system.
+.IP "\fB\-mcall\-netbsd\fR" 4
+.IX Item "-mcall-netbsd"
+On System V.4 and embedded PowerPC systems compile code for the
+NetBSD operating system.
+.IP "\fB\-maix\-struct\-return\fR" 4
+.IX Item "-maix-struct-return"
+Return all structures in memory (as specified by the \s-1AIX\s0 \s-1ABI\s0).
+.IP "\fB\-msvr4\-struct\-return\fR" 4
+.IX Item "-msvr4-struct-return"
+Return structures smaller than 8 bytes in registers (as specified by the
+\&\s-1SVR4\s0 \s-1ABI\s0).
+.IP "\fB\-mabi=\fR\fIabi-type\fR" 4
+.IX Item "-mabi=abi-type"
+Extend the current \s-1ABI\s0 with a particular extension, or remove such extension.
+Valid values are \fIaltivec\fR, \fIno-altivec\fR, \fIspe\fR,
+\&\fIno-spe\fR, \fIibmlongdouble\fR, \fIieeelongdouble\fR.
+.IP "\fB\-mabi=spe\fR" 4
+.IX Item "-mabi=spe"
+Extend the current \s-1ABI\s0 with \s-1SPE\s0 \s-1ABI\s0 extensions. This does not change
+the default \s-1ABI\s0, instead it adds the \s-1SPE\s0 \s-1ABI\s0 extensions to the current
+\&\s-1ABI\s0.
+.IP "\fB\-mabi=no\-spe\fR" 4
+.IX Item "-mabi=no-spe"
+Disable Booke \s-1SPE\s0 \s-1ABI\s0 extensions for the current \s-1ABI\s0.
+.IP "\fB\-mabi=ibmlongdouble\fR" 4
+.IX Item "-mabi=ibmlongdouble"
+Change the current \s-1ABI\s0 to use \s-1IBM\s0 extended precision long double.
+This is a PowerPC 32\-bit \s-1SYSV\s0 \s-1ABI\s0 option.
+.IP "\fB\-mabi=ieeelongdouble\fR" 4
+.IX Item "-mabi=ieeelongdouble"
+Change the current \s-1ABI\s0 to use \s-1IEEE\s0 extended precision long double.
+This is a PowerPC 32\-bit Linux \s-1ABI\s0 option.
+.IP "\fB\-mprototype\fR" 4
+.IX Item "-mprototype"
+.PD 0
+.IP "\fB\-mno\-prototype\fR" 4
+.IX Item "-mno-prototype"
+.PD
+On System V.4 and embedded PowerPC systems assume that all calls to
+variable argument functions are properly prototyped. Otherwise, the
+compiler must insert an instruction before every non prototyped call to
+set or clear bit 6 of the condition code register (\fI\s-1CR\s0\fR) to
+indicate whether floating point values were passed in the floating point
+registers in case the function takes a variable arguments. With
+\&\fB\-mprototype\fR, only calls to prototyped variable argument functions
+will set or clear the bit.
+.IP "\fB\-msim\fR" 4
+.IX Item "-msim"
+On embedded PowerPC systems, assume that the startup module is called
+\&\fIsim\-crt0.o\fR and that the standard C libraries are \fIlibsim.a\fR and
+\&\fIlibc.a\fR. This is the default for \fBpowerpc\-*\-eabisim\fR
+configurations.
+.IP "\fB\-mmvme\fR" 4
+.IX Item "-mmvme"
+On embedded PowerPC systems, assume that the startup module is called
+\&\fIcrt0.o\fR and the standard C libraries are \fIlibmvme.a\fR and
+\&\fIlibc.a\fR.
+.IP "\fB\-mads\fR" 4
+.IX Item "-mads"
+On embedded PowerPC systems, assume that the startup module is called
+\&\fIcrt0.o\fR and the standard C libraries are \fIlibads.a\fR and
+\&\fIlibc.a\fR.
+.IP "\fB\-myellowknife\fR" 4
+.IX Item "-myellowknife"
+On embedded PowerPC systems, assume that the startup module is called
+\&\fIcrt0.o\fR and the standard C libraries are \fIlibyk.a\fR and
+\&\fIlibc.a\fR.
+.IP "\fB\-mvxworks\fR" 4
+.IX Item "-mvxworks"
+On System V.4 and embedded PowerPC systems, specify that you are
+compiling for a VxWorks system.
+.IP "\fB\-memb\fR" 4
+.IX Item "-memb"
+On embedded PowerPC systems, set the \fI\s-1PPC_EMB\s0\fR bit in the \s-1ELF\s0 flags
+header to indicate that \fBeabi\fR extended relocations are used.
+.IP "\fB\-meabi\fR" 4
+.IX Item "-meabi"
+.PD 0
+.IP "\fB\-mno\-eabi\fR" 4
+.IX Item "-mno-eabi"
+.PD
+On System V.4 and embedded PowerPC systems do (do not) adhere to the
+Embedded Applications Binary Interface (eabi) which is a set of
+modifications to the System V.4 specifications. Selecting \fB\-meabi\fR
+means that the stack is aligned to an 8 byte boundary, a function
+\&\f(CW\*(C`_\|_eabi\*(C'\fR is called to from \f(CW\*(C`main\*(C'\fR to set up the eabi
+environment, and the \fB\-msdata\fR option can use both \f(CW\*(C`r2\*(C'\fR and
+\&\f(CW\*(C`r13\*(C'\fR to point to two separate small data areas. Selecting
+\&\fB\-mno\-eabi\fR means that the stack is aligned to a 16 byte boundary,
+do not call an initialization function from \f(CW\*(C`main\*(C'\fR, and the
+\&\fB\-msdata\fR option will only use \f(CW\*(C`r13\*(C'\fR to point to a single
+small data area. The \fB\-meabi\fR option is on by default if you
+configured \s-1GCC\s0 using one of the \fBpowerpc*\-*\-eabi*\fR options.
+.IP "\fB\-msdata=eabi\fR" 4
+.IX Item "-msdata=eabi"
+On System V.4 and embedded PowerPC systems, put small initialized
+\&\f(CW\*(C`const\*(C'\fR global and static data in the \fB.sdata2\fR section, which
+is pointed to by register \f(CW\*(C`r2\*(C'\fR. Put small initialized
+non\-\f(CW\*(C`const\*(C'\fR global and static data in the \fB.sdata\fR section,
+which is pointed to by register \f(CW\*(C`r13\*(C'\fR. Put small uninitialized
+global and static data in the \fB.sbss\fR section, which is adjacent to
+the \fB.sdata\fR section. The \fB\-msdata=eabi\fR option is
+incompatible with the \fB\-mrelocatable\fR option. The
+\&\fB\-msdata=eabi\fR option also sets the \fB\-memb\fR option.
+.IP "\fB\-msdata=sysv\fR" 4
+.IX Item "-msdata=sysv"
+On System V.4 and embedded PowerPC systems, put small global and static
+data in the \fB.sdata\fR section, which is pointed to by register
+\&\f(CW\*(C`r13\*(C'\fR. Put small uninitialized global and static data in the
+\&\fB.sbss\fR section, which is adjacent to the \fB.sdata\fR section.
+The \fB\-msdata=sysv\fR option is incompatible with the
+\&\fB\-mrelocatable\fR option.
+.IP "\fB\-msdata=default\fR" 4
+.IX Item "-msdata=default"
+.PD 0
+.IP "\fB\-msdata\fR" 4
+.IX Item "-msdata"
+.PD
+On System V.4 and embedded PowerPC systems, if \fB\-meabi\fR is used,
+compile code the same as \fB\-msdata=eabi\fR, otherwise compile code the
+same as \fB\-msdata=sysv\fR.
+.IP "\fB\-msdata=data\fR" 4
+.IX Item "-msdata=data"
+On System V.4 and embedded PowerPC systems, put small global
+data in the \fB.sdata\fR section. Put small uninitialized global
+data in the \fB.sbss\fR section. Do not use register \f(CW\*(C`r13\*(C'\fR
+to address small data however. This is the default behavior unless
+other \fB\-msdata\fR options are used.
+.IP "\fB\-msdata=none\fR" 4
+.IX Item "-msdata=none"
+.PD 0
+.IP "\fB\-mno\-sdata\fR" 4
+.IX Item "-mno-sdata"
+.PD
+On embedded PowerPC systems, put all initialized global and static data
+in the \fB.data\fR section, and all uninitialized data in the
+\&\fB.bss\fR section.
+.IP "\fB\-G\fR \fInum\fR" 4
+.IX Item "-G num"
+On embedded PowerPC systems, put global and static items less than or
+equal to \fInum\fR bytes into the small data or bss sections instead of
+the normal data or bss section. By default, \fInum\fR is 8. The
+\&\fB\-G\fR \fInum\fR switch is also passed to the linker.
+All modules should be compiled with the same \fB\-G\fR \fInum\fR value.
+.IP "\fB\-mregnames\fR" 4
+.IX Item "-mregnames"
+.PD 0
+.IP "\fB\-mno\-regnames\fR" 4
+.IX Item "-mno-regnames"
+.PD
+On System V.4 and embedded PowerPC systems do (do not) emit register
+names in the assembly language output using symbolic forms.
+.IP "\fB\-mlongcall\fR" 4
+.IX Item "-mlongcall"
+.PD 0
+.IP "\fB\-mno\-longcall\fR" 4
+.IX Item "-mno-longcall"
+.PD
+By default assume that all calls are far away so that a longer more
+expensive calling sequence is required. This is required for calls
+further than 32 megabytes (33,554,432 bytes) from the current location.
+A short call will be generated if the compiler knows
+the call cannot be that far away. This setting can be overridden by
+the \f(CW\*(C`shortcall\*(C'\fR function attribute, or by \f(CW\*(C`#pragma
+longcall(0)\*(C'\fR.
+.Sp
+Some linkers are capable of detecting out-of-range calls and generating
+glue code on the fly. On these systems, long calls are unnecessary and
+generate slower code. As of this writing, the \s-1AIX\s0 linker can do this,
+as can the \s-1GNU\s0 linker for PowerPC/64. It is planned to add this feature
+to the \s-1GNU\s0 linker for 32\-bit PowerPC systems as well.
+.Sp
+On Darwin/PPC systems, \f(CW\*(C`#pragma longcall\*(C'\fR will generate \*(L"jbsr
+callee, L42\*(R", plus a \*(L"branch island\*(R" (glue code). The two target
+addresses represent the callee and the \*(L"branch island\*(R". The
+Darwin/PPC linker will prefer the first address and generate a \*(L"bl
+callee\*(R" if the \s-1PPC\s0 \*(L"bl\*(R" instruction will reach the callee directly;
+otherwise, the linker will generate \*(L"bl L42\*(R" to call the \*(L"branch
+island\*(R". The \*(L"branch island\*(R" is appended to the body of the
+calling function; it computes the full 32\-bit address of the callee
+and jumps to it.
+.Sp
+On Mach-O (Darwin) systems, this option directs the compiler emit to
+the glue for every direct call, and the Darwin linker decides whether
+to use or discard it.
+.Sp
+In the future, we may cause \s-1GCC\s0 to ignore all longcall specifications
+when the linker is known to generate glue.
+.IP "\fB\-pthread\fR" 4
+.IX Item "-pthread"
+Adds support for multithreading with the \fIpthreads\fR library.
+This option sets flags for both the preprocessor and linker.
+.PP
+\fIS/390 and zSeries Options\fR
+.IX Subsection "S/390 and zSeries Options"
+.PP
+These are the \fB\-m\fR options defined for the S/390 and zSeries architecture.
+.IP "\fB\-mhard\-float\fR" 4
+.IX Item "-mhard-float"
+.PD 0
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+.PD
+Use (do not use) the hardware floating-point instructions and registers
+for floating-point operations. When \fB\-msoft\-float\fR is specified,
+functions in \fIlibgcc.a\fR will be used to perform floating-point
+operations. When \fB\-mhard\-float\fR is specified, the compiler
+generates \s-1IEEE\s0 floating-point instructions. This is the default.
+.IP "\fB\-mhard\-dfp\fR" 4
+.IX Item "-mhard-dfp"
+.PD 0
+.IP "\fB\-mno\-hard\-dfp\fR" 4
+.IX Item "-mno-hard-dfp"
+.PD
+Use (do not use) the hardware decimal-floating-point instructions for
+decimal-floating-point operations. When \fB\-mno\-hard\-dfp\fR is
+specified, functions in \fIlibgcc.a\fR will be used to perform
+decimal-floating-point operations. When \fB\-mhard\-dfp\fR is
+specified, the compiler generates decimal-floating-point hardware
+instructions. This is the default for \fB\-march=z9\-ec\fR or higher.
+.IP "\fB\-mlong\-double\-64\fR" 4
+.IX Item "-mlong-double-64"
+.PD 0
+.IP "\fB\-mlong\-double\-128\fR" 4
+.IX Item "-mlong-double-128"
+.PD
+These switches control the size of \f(CW\*(C`long double\*(C'\fR type. A size
+of 64bit makes the \f(CW\*(C`long double\*(C'\fR type equivalent to the \f(CW\*(C`double\*(C'\fR
+type. This is the default.
+.IP "\fB\-mbackchain\fR" 4
+.IX Item "-mbackchain"
+.PD 0
+.IP "\fB\-mno\-backchain\fR" 4
+.IX Item "-mno-backchain"
+.PD
+Store (do not store) the address of the caller's frame as backchain pointer
+into the callee's stack frame.
+A backchain may be needed to allow debugging using tools that do not understand
+\&\s-1DWARF\-2\s0 call frame information.
+When \fB\-mno\-packed\-stack\fR is in effect, the backchain pointer is stored
+at the bottom of the stack frame; when \fB\-mpacked\-stack\fR is in effect,
+the backchain is placed into the topmost word of the 96/160 byte register
+save area.
+.Sp
+In general, code compiled with \fB\-mbackchain\fR is call-compatible with
+code compiled with \fB\-mmo\-backchain\fR; however, use of the backchain
+for debugging purposes usually requires that the whole binary is built with
+\&\fB\-mbackchain\fR. Note that the combination of \fB\-mbackchain\fR,
+\&\fB\-mpacked\-stack\fR and \fB\-mhard\-float\fR is not supported. In order
+to build a linux kernel use \fB\-msoft\-float\fR.
+.Sp
+The default is to not maintain the backchain.
+.IP "\fB\-mpacked\-stack\fR" 4
+.IX Item "-mpacked-stack"
+.PD 0
+.IP "\fB\-mno\-packed\-stack\fR" 4
+.IX Item "-mno-packed-stack"
+.PD
+Use (do not use) the packed stack layout. When \fB\-mno\-packed\-stack\fR is
+specified, the compiler uses the all fields of the 96/160 byte register save
+area only for their default purpose; unused fields still take up stack space.
+When \fB\-mpacked\-stack\fR is specified, register save slots are densely
+packed at the top of the register save area; unused space is reused for other
+purposes, allowing for more efficient use of the available stack space.
+However, when \fB\-mbackchain\fR is also in effect, the topmost word of
+the save area is always used to store the backchain, and the return address
+register is always saved two words below the backchain.
+.Sp
+As long as the stack frame backchain is not used, code generated with
+\&\fB\-mpacked\-stack\fR is call-compatible with code generated with
+\&\fB\-mno\-packed\-stack\fR. Note that some non-FSF releases of \s-1GCC\s0 2.95 for
+S/390 or zSeries generated code that uses the stack frame backchain at run
+time, not just for debugging purposes. Such code is not call-compatible
+with code compiled with \fB\-mpacked\-stack\fR. Also, note that the
+combination of \fB\-mbackchain\fR,
+\&\fB\-mpacked\-stack\fR and \fB\-mhard\-float\fR is not supported. In order
+to build a linux kernel use \fB\-msoft\-float\fR.
+.Sp
+The default is to not use the packed stack layout.
+.IP "\fB\-msmall\-exec\fR" 4
+.IX Item "-msmall-exec"
+.PD 0
+.IP "\fB\-mno\-small\-exec\fR" 4
+.IX Item "-mno-small-exec"
+.PD
+Generate (or do not generate) code using the \f(CW\*(C`bras\*(C'\fR instruction
+to do subroutine calls.
+This only works reliably if the total executable size does not
+exceed 64k. The default is to use the \f(CW\*(C`basr\*(C'\fR instruction instead,
+which does not have this limitation.
+.IP "\fB\-m64\fR" 4
+.IX Item "-m64"
+.PD 0
+.IP "\fB\-m31\fR" 4
+.IX Item "-m31"
+.PD
+When \fB\-m31\fR is specified, generate code compliant to the
+GNU/Linux for S/390 \s-1ABI\s0. When \fB\-m64\fR is specified, generate
+code compliant to the GNU/Linux for zSeries \s-1ABI\s0. This allows \s-1GCC\s0 in
+particular to generate 64\-bit instructions. For the \fBs390\fR
+targets, the default is \fB\-m31\fR, while the \fBs390x\fR
+targets default to \fB\-m64\fR.
+.IP "\fB\-mzarch\fR" 4
+.IX Item "-mzarch"
+.PD 0
+.IP "\fB\-mesa\fR" 4
+.IX Item "-mesa"
+.PD
+When \fB\-mzarch\fR is specified, generate code using the
+instructions available on z/Architecture.
+When \fB\-mesa\fR is specified, generate code using the
+instructions available on \s-1ESA/390\s0. Note that \fB\-mesa\fR is
+not possible with \fB\-m64\fR.
+When generating code compliant to the GNU/Linux for S/390 \s-1ABI\s0,
+the default is \fB\-mesa\fR. When generating code compliant
+to the GNU/Linux for zSeries \s-1ABI\s0, the default is \fB\-mzarch\fR.
+.IP "\fB\-mmvcle\fR" 4
+.IX Item "-mmvcle"
+.PD 0
+.IP "\fB\-mno\-mvcle\fR" 4
+.IX Item "-mno-mvcle"
+.PD
+Generate (or do not generate) code using the \f(CW\*(C`mvcle\*(C'\fR instruction
+to perform block moves. When \fB\-mno\-mvcle\fR is specified,
+use a \f(CW\*(C`mvc\*(C'\fR loop instead. This is the default unless optimizing for
+size.
+.IP "\fB\-mdebug\fR" 4
+.IX Item "-mdebug"
+.PD 0
+.IP "\fB\-mno\-debug\fR" 4
+.IX Item "-mno-debug"
+.PD
+Print (or do not print) additional debug information when compiling.
+The default is to not print debug information.
+.IP "\fB\-march=\fR\fIcpu-type\fR" 4
+.IX Item "-march=cpu-type"
+Generate code that will run on \fIcpu-type\fR, which is the name of a system
+representing a certain processor type. Possible values for
+\&\fIcpu-type\fR are \fBg5\fR, \fBg6\fR, \fBz900\fR, \fBz990\fR,
+\&\fBz9\-109\fR, \fBz9\-ec\fR and \fBz10\fR.
+When generating code using the instructions available on z/Architecture,
+the default is \fB\-march=z900\fR. Otherwise, the default is
+\&\fB\-march=g5\fR.
+.IP "\fB\-mtune=\fR\fIcpu-type\fR" 4
+.IX Item "-mtune=cpu-type"
+Tune to \fIcpu-type\fR everything applicable about the generated code,
+except for the \s-1ABI\s0 and the set of available instructions.
+The list of \fIcpu-type\fR values is the same as for \fB\-march\fR.
+The default is the value used for \fB\-march\fR.
+.IP "\fB\-mtpf\-trace\fR" 4
+.IX Item "-mtpf-trace"
+.PD 0
+.IP "\fB\-mno\-tpf\-trace\fR" 4
+.IX Item "-mno-tpf-trace"
+.PD
+Generate code that adds (does not add) in \s-1TPF\s0 \s-1OS\s0 specific branches to trace
+routines in the operating system. This option is off by default, even
+when compiling for the \s-1TPF\s0 \s-1OS\s0.
+.IP "\fB\-mfused\-madd\fR" 4
+.IX Item "-mfused-madd"
+.PD 0
+.IP "\fB\-mno\-fused\-madd\fR" 4
+.IX Item "-mno-fused-madd"
+.PD
+Generate code that uses (does not use) the floating point multiply and
+accumulate instructions. These instructions are generated by default if
+hardware floating point is used.
+.IP "\fB\-mwarn\-framesize=\fR\fIframesize\fR" 4
+.IX Item "-mwarn-framesize=framesize"
+Emit a warning if the current function exceeds the given frame size. Because
+this is a compile time check it doesn't need to be a real problem when the program
+runs. It is intended to identify functions which most probably cause
+a stack overflow. It is useful to be used in an environment with limited stack
+size e.g. the linux kernel.
+.IP "\fB\-mwarn\-dynamicstack\fR" 4
+.IX Item "-mwarn-dynamicstack"
+Emit a warning if the function calls alloca or uses dynamically
+sized arrays. This is generally a bad idea with a limited stack size.
+.IP "\fB\-mstack\-guard=\fR\fIstack-guard\fR" 4
+.IX Item "-mstack-guard=stack-guard"
+.PD 0
+.IP "\fB\-mstack\-size=\fR\fIstack-size\fR" 4
+.IX Item "-mstack-size=stack-size"
+.PD
+If these options are provided the s390 back end emits additional instructions in
+the function prologue which trigger a trap if the stack size is \fIstack-guard\fR
+bytes above the \fIstack-size\fR (remember that the stack on s390 grows downward).
+If the \fIstack-guard\fR option is omitted the smallest power of 2 larger than
+the frame size of the compiled function is chosen.
+These options are intended to be used to help debugging stack overflow problems.
+The additionally emitted code causes only little overhead and hence can also be
+used in production like systems without greater performance degradation. The given
+values have to be exact powers of 2 and \fIstack-size\fR has to be greater than
+\&\fIstack-guard\fR without exceeding 64k.
+In order to be efficient the extra code makes the assumption that the stack starts
+at an address aligned to the value given by \fIstack-size\fR.
+The \fIstack-guard\fR option can only be used in conjunction with \fIstack-size\fR.
+.PP
+\fIScore Options\fR
+.IX Subsection "Score Options"
+.PP
+These options are defined for Score implementations:
+.IP "\fB\-meb\fR" 4
+.IX Item "-meb"
+Compile code for big endian mode. This is the default.
+.IP "\fB\-mel\fR" 4
+.IX Item "-mel"
+Compile code for little endian mode.
+.IP "\fB\-mnhwloop\fR" 4
+.IX Item "-mnhwloop"
+Disable generate bcnz instruction.
+.IP "\fB\-muls\fR" 4
+.IX Item "-muls"
+Enable generate unaligned load and store instruction.
+.IP "\fB\-mmac\fR" 4
+.IX Item "-mmac"
+Enable the use of multiply-accumulate instructions. Disabled by default.
+.IP "\fB\-mscore5\fR" 4
+.IX Item "-mscore5"
+Specify the \s-1SCORE5\s0 as the target architecture.
+.IP "\fB\-mscore5u\fR" 4
+.IX Item "-mscore5u"
+Specify the \s-1SCORE5U\s0 of the target architecture.
+.IP "\fB\-mscore7\fR" 4
+.IX Item "-mscore7"
+Specify the \s-1SCORE7\s0 as the target architecture. This is the default.
+.IP "\fB\-mscore7d\fR" 4
+.IX Item "-mscore7d"
+Specify the \s-1SCORE7D\s0 as the target architecture.
+.PP
+\fI\s-1SH\s0 Options\fR
+.IX Subsection "SH Options"
+.PP
+These \fB\-m\fR options are defined for the \s-1SH\s0 implementations:
+.IP "\fB\-m1\fR" 4
+.IX Item "-m1"
+Generate code for the \s-1SH1\s0.
+.IP "\fB\-m2\fR" 4
+.IX Item "-m2"
+Generate code for the \s-1SH2\s0.
+.IP "\fB\-m2e\fR" 4
+.IX Item "-m2e"
+Generate code for the SH2e.
+.IP "\fB\-m3\fR" 4
+.IX Item "-m3"
+Generate code for the \s-1SH3\s0.
+.IP "\fB\-m3e\fR" 4
+.IX Item "-m3e"
+Generate code for the SH3e.
+.IP "\fB\-m4\-nofpu\fR" 4
+.IX Item "-m4-nofpu"
+Generate code for the \s-1SH4\s0 without a floating-point unit.
+.IP "\fB\-m4\-single\-only\fR" 4
+.IX Item "-m4-single-only"
+Generate code for the \s-1SH4\s0 with a floating-point unit that only
+supports single-precision arithmetic.
+.IP "\fB\-m4\-single\fR" 4
+.IX Item "-m4-single"
+Generate code for the \s-1SH4\s0 assuming the floating-point unit is in
+single-precision mode by default.
+.IP "\fB\-m4\fR" 4
+.IX Item "-m4"
+Generate code for the \s-1SH4\s0.
+.IP "\fB\-m4a\-nofpu\fR" 4
+.IX Item "-m4a-nofpu"
+Generate code for the SH4al\-dsp, or for a SH4a in such a way that the
+floating-point unit is not used.
+.IP "\fB\-m4a\-single\-only\fR" 4
+.IX Item "-m4a-single-only"
+Generate code for the SH4a, in such a way that no double-precision
+floating point operations are used.
+.IP "\fB\-m4a\-single\fR" 4
+.IX Item "-m4a-single"
+Generate code for the SH4a assuming the floating-point unit is in
+single-precision mode by default.
+.IP "\fB\-m4a\fR" 4
+.IX Item "-m4a"
+Generate code for the SH4a.
+.IP "\fB\-m4al\fR" 4
+.IX Item "-m4al"
+Same as \fB\-m4a\-nofpu\fR, except that it implicitly passes
+\&\fB\-dsp\fR to the assembler. \s-1GCC\s0 doesn't generate any \s-1DSP\s0
+instructions at the moment.
+.IP "\fB\-mb\fR" 4
+.IX Item "-mb"
+Compile code for the processor in big endian mode.
+.IP "\fB\-ml\fR" 4
+.IX Item "-ml"
+Compile code for the processor in little endian mode.
+.IP "\fB\-mdalign\fR" 4
+.IX Item "-mdalign"
+Align doubles at 64\-bit boundaries. Note that this changes the calling
+conventions, and thus some functions from the standard C library will
+not work unless you recompile it first with \fB\-mdalign\fR.
+.IP "\fB\-mrelax\fR" 4
+.IX Item "-mrelax"
+Shorten some address references at link time, when possible; uses the
+linker option \fB\-relax\fR.
+.IP "\fB\-mbigtable\fR" 4
+.IX Item "-mbigtable"
+Use 32\-bit offsets in \f(CW\*(C`switch\*(C'\fR tables. The default is to use
+16\-bit offsets.
+.IP "\fB\-mbitops\fR" 4
+.IX Item "-mbitops"
+Enable the use of bit manipulation instructions on \s-1SH2A\s0.
+.IP "\fB\-mfmovd\fR" 4
+.IX Item "-mfmovd"
+Enable the use of the instruction \f(CW\*(C`fmovd\*(C'\fR.
+.IP "\fB\-mhitachi\fR" 4
+.IX Item "-mhitachi"
+Comply with the calling conventions defined by Renesas.
+.IP "\fB\-mrenesas\fR" 4
+.IX Item "-mrenesas"
+Comply with the calling conventions defined by Renesas.
+.IP "\fB\-mno\-renesas\fR" 4
+.IX Item "-mno-renesas"
+Comply with the calling conventions defined for \s-1GCC\s0 before the Renesas
+conventions were available. This option is the default for all
+targets of the \s-1SH\s0 toolchain except for \fBsh-symbianelf\fR.
+.IP "\fB\-mnomacsave\fR" 4
+.IX Item "-mnomacsave"
+Mark the \f(CW\*(C`MAC\*(C'\fR register as call-clobbered, even if
+\&\fB\-mhitachi\fR is given.
+.IP "\fB\-mieee\fR" 4
+.IX Item "-mieee"
+Increase IEEE-compliance of floating-point code.
+At the moment, this is equivalent to \fB\-fno\-finite\-math\-only\fR.
+When generating 16 bit \s-1SH\s0 opcodes, getting IEEE-conforming results for
+comparisons of NANs / infinities incurs extra overhead in every
+floating point comparison, therefore the default is set to
+\&\fB\-ffinite\-math\-only\fR.
+.IP "\fB\-minline\-ic_invalidate\fR" 4
+.IX Item "-minline-ic_invalidate"
+Inline code to invalidate instruction cache entries after setting up
+nested function trampolines.
+This option has no effect if \-musermode is in effect and the selected
+code generation option (e.g. \-m4) does not allow the use of the icbi
+instruction.
+If the selected code generation option does not allow the use of the icbi
+instruction, and \-musermode is not in effect, the inlined code will
+manipulate the instruction cache address array directly with an associative
+write. This not only requires privileged mode, but it will also
+fail if the cache line had been mapped via the \s-1TLB\s0 and has become unmapped.
+.IP "\fB\-misize\fR" 4
+.IX Item "-misize"
+Dump instruction size and location in the assembly code.
+.IP "\fB\-mpadstruct\fR" 4
+.IX Item "-mpadstruct"
+This option is deprecated. It pads structures to multiple of 4 bytes,
+which is incompatible with the \s-1SH\s0 \s-1ABI\s0.
+.IP "\fB\-mspace\fR" 4
+.IX Item "-mspace"
+Optimize for space instead of speed. Implied by \fB\-Os\fR.
+.IP "\fB\-mprefergot\fR" 4
+.IX Item "-mprefergot"
+When generating position-independent code, emit function calls using
+the Global Offset Table instead of the Procedure Linkage Table.
+.IP "\fB\-musermode\fR" 4
+.IX Item "-musermode"
+Don't generate privileged mode only code; implies \-mno\-inline\-ic_invalidate
+if the inlined code would not work in user mode.
+This is the default when the target is \f(CW\*(C`sh\-*\-linux*\*(C'\fR.
+.IP "\fB\-multcost=\fR\fInumber\fR" 4
+.IX Item "-multcost=number"
+Set the cost to assume for a multiply insn.
+.IP "\fB\-mdiv=\fR\fIstrategy\fR" 4
+.IX Item "-mdiv=strategy"
+Set the division strategy to use for SHmedia code. \fIstrategy\fR must be
+one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
+inv:call2, inv:fp .
+\&\*(L"fp\*(R" performs the operation in floating point. This has a very high latency,
+but needs only a few instructions, so it might be a good choice if
+your code has enough easily exploitable \s-1ILP\s0 to allow the compiler to
+schedule the floating point instructions together with other instructions.
+Division by zero causes a floating point exception.
+\&\*(L"inv\*(R" uses integer operations to calculate the inverse of the divisor,
+and then multiplies the dividend with the inverse. This strategy allows
+cse and hoisting of the inverse calculation. Division by zero calculates
+an unspecified result, but does not trap.
+\&\*(L"inv:minlat\*(R" is a variant of \*(L"inv\*(R" where if no cse / hoisting opportunities
+have been found, or if the entire operation has been hoisted to the same
+place, the last stages of the inverse calculation are intertwined with the
+final multiply to reduce the overall latency, at the expense of using a few
+more instructions, and thus offering fewer scheduling opportunities with
+other code.
+\&\*(L"call\*(R" calls a library function that usually implements the inv:minlat
+strategy.
+This gives high code density for m5\-*media\-nofpu compilations.
+\&\*(L"call2\*(R" uses a different entry point of the same library function, where it
+assumes that a pointer to a lookup table has already been set up, which
+exposes the pointer load to cse / code hoisting optimizations.
+\&\*(L"inv:call\*(R", \*(L"inv:call2\*(R" and \*(L"inv:fp\*(R" all use the \*(L"inv\*(R" algorithm for initial
+code generation, but if the code stays unoptimized, revert to the \*(L"call\*(R",
+\&\*(L"call2\*(R", or \*(L"fp\*(R" strategies, respectively. Note that the
+potentially-trapping side effect of division by zero is carried by a
+separate instruction, so it is possible that all the integer instructions
+are hoisted out, but the marker for the side effect stays where it is.
+A recombination to fp operations or a call is not possible in that case.
+\&\*(L"inv20u\*(R" and \*(L"inv20l\*(R" are variants of the \*(L"inv:minlat\*(R" strategy. In the case
+that the inverse calculation was nor separated from the multiply, they speed
+up division where the dividend fits into 20 bits (plus sign where applicable),
+by inserting a test to skip a number of operations in this case; this test
+slows down the case of larger dividends. inv20u assumes the case of a such
+a small dividend to be unlikely, and inv20l assumes it to be likely.
+.IP "\fB\-mdivsi3_libfunc=\fR\fIname\fR" 4
+.IX Item "-mdivsi3_libfunc=name"
+Set the name of the library function used for 32 bit signed division to
+\&\fIname\fR. This only affect the name used in the call and inv:call
+division strategies, and the compiler will still expect the same
+sets of input/output/clobbered registers as if this option was not present.
+.IP "\fB\-mfixed\-range=\fR\fIregister-range\fR" 4
+.IX Item "-mfixed-range=register-range"
+Generate code treating the given register range as fixed registers.
+A fixed register is one that the register allocator can not use. This is
+useful when compiling kernel code. A register range is specified as
+two registers separated by a dash. Multiple register ranges can be
+specified separated by a comma.
+.IP "\fB\-madjust\-unroll\fR" 4
+.IX Item "-madjust-unroll"
+Throttle unrolling to avoid thrashing target registers.
+This option only has an effect if the gcc code base supports the
+\&\s-1TARGET_ADJUST_UNROLL_MAX\s0 target hook.
+.IP "\fB\-mindexed\-addressing\fR" 4
+.IX Item "-mindexed-addressing"
+Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
+This is only safe if the hardware and/or \s-1OS\s0 implement 32 bit wrap-around
+semantics for the indexed addressing mode. The architecture allows the
+implementation of processors with 64 bit \s-1MMU\s0, which the \s-1OS\s0 could use to
+get 32 bit addressing, but since no current hardware implementation supports
+this or any other way to make the indexed addressing mode safe to use in
+the 32 bit \s-1ABI\s0, the default is \-mno\-indexed\-addressing.
+.IP "\fB\-mgettrcost=\fR\fInumber\fR" 4
+.IX Item "-mgettrcost=number"
+Set the cost assumed for the gettr instruction to \fInumber\fR.
+The default is 2 if \fB\-mpt\-fixed\fR is in effect, 100 otherwise.
+.IP "\fB\-mpt\-fixed\fR" 4
+.IX Item "-mpt-fixed"
+Assume pt* instructions won't trap. This will generally generate better
+scheduled code, but is unsafe on current hardware. The current architecture
+definition says that ptabs and ptrel trap when the target anded with 3 is 3.
+This has the unintentional effect of making it unsafe to schedule ptabs /
+ptrel before a branch, or hoist it out of a loop. For example,
+_\|_do_global_ctors, a part of libgcc that runs constructors at program
+startup, calls functions in a list which is delimited by \-1. With the
+\&\-mpt\-fixed option, the ptabs will be done before testing against \-1.
+That means that all the constructors will be run a bit quicker, but when
+the loop comes to the end of the list, the program crashes because ptabs
+loads \-1 into a target register. Since this option is unsafe for any
+hardware implementing the current architecture specification, the default
+is \-mno\-pt\-fixed. Unless the user specifies a specific cost with
+\&\fB\-mgettrcost\fR, \-mno\-pt\-fixed also implies \fB\-mgettrcost=100\fR;
+this deters register allocation using target registers for storing
+ordinary integers.
+.IP "\fB\-minvalid\-symbols\fR" 4
+.IX Item "-minvalid-symbols"
+Assume symbols might be invalid. Ordinary function symbols generated by
+the compiler will always be valid to load with movi/shori/ptabs or
+movi/shori/ptrel, but with assembler and/or linker tricks it is possible
+to generate symbols that will cause ptabs / ptrel to trap.
+This option is only meaningful when \fB\-mno\-pt\-fixed\fR is in effect.
+It will then prevent cross-basic-block cse, hoisting and most scheduling
+of symbol loads. The default is \fB\-mno\-invalid\-symbols\fR.
+.PP
+\fI\s-1SPARC\s0 Options\fR
+.IX Subsection "SPARC Options"
+.PP
+These \fB\-m\fR options are supported on the \s-1SPARC:\s0
+.IP "\fB\-mno\-app\-regs\fR" 4
+.IX Item "-mno-app-regs"
+.PD 0
+.IP "\fB\-mapp\-regs\fR" 4
+.IX Item "-mapp-regs"
+.PD
+Specify \fB\-mapp\-regs\fR to generate output using the global registers
+2 through 4, which the \s-1SPARC\s0 \s-1SVR4\s0 \s-1ABI\s0 reserves for applications. This
+is the default.
+.Sp
+To be fully \s-1SVR4\s0 \s-1ABI\s0 compliant at the cost of some performance loss,
+specify \fB\-mno\-app\-regs\fR. You should compile libraries and system
+software with this option.
+.IP "\fB\-mfpu\fR" 4
+.IX Item "-mfpu"
+.PD 0
+.IP "\fB\-mhard\-float\fR" 4
+.IX Item "-mhard-float"
+.PD
+Generate output containing floating point instructions. This is the
+default.
+.IP "\fB\-mno\-fpu\fR" 4
+.IX Item "-mno-fpu"
+.PD 0
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+.PD
+Generate output containing library calls for floating point.
+\&\fBWarning:\fR the requisite libraries are not available for all \s-1SPARC\s0
+targets. Normally the facilities of the machine's usual C compiler are
+used, but this cannot be done directly in cross-compilation. You must make
+your own arrangements to provide suitable library functions for
+cross-compilation. The embedded targets \fBsparc\-*\-aout\fR and
+\&\fBsparclite\-*\-*\fR do provide software floating point support.
+.Sp
+\&\fB\-msoft\-float\fR changes the calling convention in the output file;
+therefore, it is only useful if you compile \fIall\fR of a program with
+this option. In particular, you need to compile \fIlibgcc.a\fR, the
+library that comes with \s-1GCC\s0, with \fB\-msoft\-float\fR in order for
+this to work.
+.IP "\fB\-mhard\-quad\-float\fR" 4
+.IX Item "-mhard-quad-float"
+Generate output containing quad-word (long double) floating point
+instructions.
+.IP "\fB\-msoft\-quad\-float\fR" 4
+.IX Item "-msoft-quad-float"
+Generate output containing library calls for quad-word (long double)
+floating point instructions. The functions called are those specified
+in the \s-1SPARC\s0 \s-1ABI\s0. This is the default.
+.Sp
+As of this writing, there are no \s-1SPARC\s0 implementations that have hardware
+support for the quad-word floating point instructions. They all invoke
+a trap handler for one of these instructions, and then the trap handler
+emulates the effect of the instruction. Because of the trap handler overhead,
+this is much slower than calling the \s-1ABI\s0 library routines. Thus the
+\&\fB\-msoft\-quad\-float\fR option is the default.
+.IP "\fB\-mno\-unaligned\-doubles\fR" 4
+.IX Item "-mno-unaligned-doubles"
+.PD 0
+.IP "\fB\-munaligned\-doubles\fR" 4
+.IX Item "-munaligned-doubles"
+.PD
+Assume that doubles have 8 byte alignment. This is the default.
+.Sp
+With \fB\-munaligned\-doubles\fR, \s-1GCC\s0 assumes that doubles have 8 byte
+alignment only if they are contained in another type, or if they have an
+absolute address. Otherwise, it assumes they have 4 byte alignment.
+Specifying this option avoids some rare compatibility problems with code
+generated by other compilers. It is not the default because it results
+in a performance loss, especially for floating point code.
+.IP "\fB\-mno\-faster\-structs\fR" 4
+.IX Item "-mno-faster-structs"
+.PD 0
+.IP "\fB\-mfaster\-structs\fR" 4
+.IX Item "-mfaster-structs"
+.PD
+With \fB\-mfaster\-structs\fR, the compiler assumes that structures
+should have 8 byte alignment. This enables the use of pairs of
+\&\f(CW\*(C`ldd\*(C'\fR and \f(CW\*(C`std\*(C'\fR instructions for copies in structure
+assignment, in place of twice as many \f(CW\*(C`ld\*(C'\fR and \f(CW\*(C`st\*(C'\fR pairs.
+However, the use of this changed alignment directly violates the \s-1SPARC\s0
+\&\s-1ABI\s0. Thus, it's intended only for use on targets where the developer
+acknowledges that their resulting code will not be directly in line with
+the rules of the \s-1ABI\s0.
+.IP "\fB\-mimpure\-text\fR" 4
+.IX Item "-mimpure-text"
+\&\fB\-mimpure\-text\fR, used in addition to \fB\-shared\fR, tells
+the compiler to not pass \fB\-z text\fR to the linker when linking a
+shared object. Using this option, you can link position-dependent
+code into a shared object.
+.Sp
+\&\fB\-mimpure\-text\fR suppresses the \*(L"relocations remain against
+allocatable but non-writable sections\*(R" linker error message.
+However, the necessary relocations will trigger copy-on-write, and the
+shared object is not actually shared across processes. Instead of
+using \fB\-mimpure\-text\fR, you should compile all source code with
+\&\fB\-fpic\fR or \fB\-fPIC\fR.
+.Sp
+This option is only available on SunOS and Solaris.
+.IP "\fB\-mcpu=\fR\fIcpu_type\fR" 4
+.IX Item "-mcpu=cpu_type"
+Set the instruction set, register set, and instruction scheduling parameters
+for machine type \fIcpu_type\fR. Supported values for \fIcpu_type\fR are
+\&\fBv7\fR, \fBcypress\fR, \fBv8\fR, \fBsupersparc\fR, \fBsparclite\fR,
+\&\fBf930\fR, \fBf934\fR, \fBhypersparc\fR, \fBsparclite86x\fR,
+\&\fBsparclet\fR, \fBtsc701\fR, \fBv9\fR, \fBultrasparc\fR,
+\&\fBultrasparc3\fR, \fBniagara\fR and \fBniagara2\fR.
+.Sp
+Default instruction scheduling parameters are used for values that select
+an architecture and not an implementation. These are \fBv7\fR, \fBv8\fR,
+\&\fBsparclite\fR, \fBsparclet\fR, \fBv9\fR.
+.Sp
+Here is a list of each supported architecture and their supported
+implementations.
+.Sp
+.Vb 5
+\& v7: cypress
+\& v8: supersparc, hypersparc
+\& sparclite: f930, f934, sparclite86x
+\& sparclet: tsc701
+\& v9: ultrasparc, ultrasparc3, niagara, niagara2
+.Ve
+.Sp
+By default (unless configured otherwise), \s-1GCC\s0 generates code for the V7
+variant of the \s-1SPARC\s0 architecture. With \fB\-mcpu=cypress\fR, the compiler
+additionally optimizes it for the Cypress \s-1CY7C602\s0 chip, as used in the
+SPARCStation/SPARCServer 3xx series. This is also appropriate for the older
+SPARCStation 1, 2, \s-1IPX\s0 etc.
+.Sp
+With \fB\-mcpu=v8\fR, \s-1GCC\s0 generates code for the V8 variant of the \s-1SPARC\s0
+architecture. The only difference from V7 code is that the compiler emits
+the integer multiply and integer divide instructions which exist in \s-1SPARC\-V8\s0
+but not in \s-1SPARC\-V7\s0. With \fB\-mcpu=supersparc\fR, the compiler additionally
+optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
+2000 series.
+.Sp
+With \fB\-mcpu=sparclite\fR, \s-1GCC\s0 generates code for the SPARClite variant of
+the \s-1SPARC\s0 architecture. This adds the integer multiply, integer divide step
+and scan (\f(CW\*(C`ffs\*(C'\fR) instructions which exist in SPARClite but not in \s-1SPARC\-V7\s0.
+With \fB\-mcpu=f930\fR, the compiler additionally optimizes it for the
+Fujitsu \s-1MB86930\s0 chip, which is the original SPARClite, with no \s-1FPU\s0. With
+\&\fB\-mcpu=f934\fR, the compiler additionally optimizes it for the Fujitsu
+\&\s-1MB86934\s0 chip, which is the more recent SPARClite with \s-1FPU\s0.
+.Sp
+With \fB\-mcpu=sparclet\fR, \s-1GCC\s0 generates code for the SPARClet variant of
+the \s-1SPARC\s0 architecture. This adds the integer multiply, multiply/accumulate,
+integer divide step and scan (\f(CW\*(C`ffs\*(C'\fR) instructions which exist in SPARClet
+but not in \s-1SPARC\-V7\s0. With \fB\-mcpu=tsc701\fR, the compiler additionally
+optimizes it for the \s-1TEMIC\s0 SPARClet chip.
+.Sp
+With \fB\-mcpu=v9\fR, \s-1GCC\s0 generates code for the V9 variant of the \s-1SPARC\s0
+architecture. This adds 64\-bit integer and floating-point move instructions,
+3 additional floating-point condition code registers and conditional move
+instructions. With \fB\-mcpu=ultrasparc\fR, the compiler additionally
+optimizes it for the Sun UltraSPARC I/II/IIi chips. With
+\&\fB\-mcpu=ultrasparc3\fR, the compiler additionally optimizes it for the
+Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips. With
+\&\fB\-mcpu=niagara\fR, the compiler additionally optimizes it for
+Sun UltraSPARC T1 chips. With \fB\-mcpu=niagara2\fR, the compiler
+additionally optimizes it for Sun UltraSPARC T2 chips.
+.IP "\fB\-mtune=\fR\fIcpu_type\fR" 4
+.IX Item "-mtune=cpu_type"
+Set the instruction scheduling parameters for machine type
+\&\fIcpu_type\fR, but do not set the instruction set or register set that the
+option \fB\-mcpu=\fR\fIcpu_type\fR would.
+.Sp
+The same values for \fB\-mcpu=\fR\fIcpu_type\fR can be used for
+\&\fB\-mtune=\fR\fIcpu_type\fR, but the only useful values are those
+that select a particular cpu implementation. Those are \fBcypress\fR,
+\&\fBsupersparc\fR, \fBhypersparc\fR, \fBf930\fR, \fBf934\fR,
+\&\fBsparclite86x\fR, \fBtsc701\fR, \fBultrasparc\fR,
+\&\fBultrasparc3\fR, \fBniagara\fR, and \fBniagara2\fR.
+.IP "\fB\-mv8plus\fR" 4
+.IX Item "-mv8plus"
+.PD 0
+.IP "\fB\-mno\-v8plus\fR" 4
+.IX Item "-mno-v8plus"
+.PD
+With \fB\-mv8plus\fR, \s-1GCC\s0 generates code for the \s-1SPARC\-V8+\s0 \s-1ABI\s0. The
+difference from the V8 \s-1ABI\s0 is that the global and out registers are
+considered 64\-bit wide. This is enabled by default on Solaris in 32\-bit
+mode for all \s-1SPARC\-V9\s0 processors.
+.IP "\fB\-mvis\fR" 4
+.IX Item "-mvis"
+.PD 0
+.IP "\fB\-mno\-vis\fR" 4
+.IX Item "-mno-vis"
+.PD
+With \fB\-mvis\fR, \s-1GCC\s0 generates code that takes advantage of the UltraSPARC
+Visual Instruction Set extensions. The default is \fB\-mno\-vis\fR.
+.PP
+These \fB\-m\fR options are supported in addition to the above
+on \s-1SPARC\-V9\s0 processors in 64\-bit environments:
+.IP "\fB\-mlittle\-endian\fR" 4
+.IX Item "-mlittle-endian"
+Generate code for a processor running in little-endian mode. It is only
+available for a few configurations and most notably not on Solaris and Linux.
+.IP "\fB\-m32\fR" 4
+.IX Item "-m32"
+.PD 0
+.IP "\fB\-m64\fR" 4
+.IX Item "-m64"
+.PD
+Generate code for a 32\-bit or 64\-bit environment.
+The 32\-bit environment sets int, long and pointer to 32 bits.
+The 64\-bit environment sets int to 32 bits and long and pointer
+to 64 bits.
+.IP "\fB\-mcmodel=medlow\fR" 4
+.IX Item "-mcmodel=medlow"
+Generate code for the Medium/Low code model: 64\-bit addresses, programs
+must be linked in the low 32 bits of memory. Programs can be statically
+or dynamically linked.
+.IP "\fB\-mcmodel=medmid\fR" 4
+.IX Item "-mcmodel=medmid"
+Generate code for the Medium/Middle code model: 64\-bit addresses, programs
+must be linked in the low 44 bits of memory, the text and data segments must
+be less than 2GB in size and the data segment must be located within 2GB of
+the text segment.
+.IP "\fB\-mcmodel=medany\fR" 4
+.IX Item "-mcmodel=medany"
+Generate code for the Medium/Anywhere code model: 64\-bit addresses, programs
+may be linked anywhere in memory, the text and data segments must be less
+than 2GB in size and the data segment must be located within 2GB of the
+text segment.
+.IP "\fB\-mcmodel=embmedany\fR" 4
+.IX Item "-mcmodel=embmedany"
+Generate code for the Medium/Anywhere code model for embedded systems:
+64\-bit addresses, the text and data segments must be less than 2GB in
+size, both starting anywhere in memory (determined at link time). The
+global register \f(CW%g4\fR points to the base of the data segment. Programs
+are statically linked and \s-1PIC\s0 is not supported.
+.IP "\fB\-mstack\-bias\fR" 4
+.IX Item "-mstack-bias"
+.PD 0
+.IP "\fB\-mno\-stack\-bias\fR" 4
+.IX Item "-mno-stack-bias"
+.PD
+With \fB\-mstack\-bias\fR, \s-1GCC\s0 assumes that the stack pointer, and
+frame pointer if present, are offset by \-2047 which must be added back
+when making stack frame references. This is the default in 64\-bit mode.
+Otherwise, assume no such offset is present.
+.PP
+These switches are supported in addition to the above on Solaris:
+.IP "\fB\-threads\fR" 4
+.IX Item "-threads"
+Add support for multithreading using the Solaris threads library. This
+option sets flags for both the preprocessor and linker. This option does
+not affect the thread safety of object code produced by the compiler or
+that of libraries supplied with it.
+.IP "\fB\-pthreads\fR" 4
+.IX Item "-pthreads"
+Add support for multithreading using the \s-1POSIX\s0 threads library. This
+option sets flags for both the preprocessor and linker. This option does
+not affect the thread safety of object code produced by the compiler or
+that of libraries supplied with it.
+.IP "\fB\-pthread\fR" 4
+.IX Item "-pthread"
+This is a synonym for \fB\-pthreads\fR.
+.PP
+\fI\s-1SPU\s0 Options\fR
+.IX Subsection "SPU Options"
+.PP
+These \fB\-m\fR options are supported on the \s-1SPU:\s0
+.IP "\fB\-mwarn\-reloc\fR" 4
+.IX Item "-mwarn-reloc"
+.PD 0
+.IP "\fB\-merror\-reloc\fR" 4
+.IX Item "-merror-reloc"
+.PD
+The loader for \s-1SPU\s0 does not handle dynamic relocations. By default, \s-1GCC\s0
+will give an error when it generates code that requires a dynamic
+relocation. \fB\-mno\-error\-reloc\fR disables the error,
+\&\fB\-mwarn\-reloc\fR will generate a warning instead.
+.IP "\fB\-msafe\-dma\fR" 4
+.IX Item "-msafe-dma"
+.PD 0
+.IP "\fB\-munsafe\-dma\fR" 4
+.IX Item "-munsafe-dma"
+.PD
+Instructions which initiate or test completion of \s-1DMA\s0 must not be
+reordered with respect to loads and stores of the memory which is being
+accessed. Users typically address this problem using the volatile
+keyword, but that can lead to inefficient code in places where the
+memory is known to not change. Rather than mark the memory as volatile
+we treat the \s-1DMA\s0 instructions as potentially effecting all memory. With
+\&\fB\-munsafe\-dma\fR users must use the volatile keyword to protect
+memory accesses.
+.IP "\fB\-mbranch\-hints\fR" 4
+.IX Item "-mbranch-hints"
+By default, \s-1GCC\s0 will generate a branch hint instruction to avoid
+pipeline stalls for always taken or probably taken branches. A hint
+will not be generated closer than 8 instructions away from its branch.
+There is little reason to disable them, except for debugging purposes,
+or to make an object a little bit smaller.
+.IP "\fB\-msmall\-mem\fR" 4
+.IX Item "-msmall-mem"
+.PD 0
+.IP "\fB\-mlarge\-mem\fR" 4
+.IX Item "-mlarge-mem"
+.PD
+By default, \s-1GCC\s0 generates code assuming that addresses are never larger
+than 18 bits. With \fB\-mlarge\-mem\fR code is generated that assumes
+a full 32 bit address.
+.IP "\fB\-mstdmain\fR" 4
+.IX Item "-mstdmain"
+By default, \s-1GCC\s0 links against startup code that assumes the SPU-style
+main function interface (which has an unconventional parameter list).
+With \fB\-mstdmain\fR, \s-1GCC\s0 will link your program against startup
+code that assumes a C99\-style interface to \f(CW\*(C`main\*(C'\fR, including a
+local copy of \f(CW\*(C`argv\*(C'\fR strings.
+.IP "\fB\-mfixed\-range=\fR\fIregister-range\fR" 4
+.IX Item "-mfixed-range=register-range"
+Generate code treating the given register range as fixed registers.
+A fixed register is one that the register allocator can not use. This is
+useful when compiling kernel code. A register range is specified as
+two registers separated by a dash. Multiple register ranges can be
+specified separated by a comma.
+.IP "\fB\-mdual\-nops\fR" 4
+.IX Item "-mdual-nops"
+.PD 0
+.IP "\fB\-mdual\-nops=\fR\fIn\fR" 4
+.IX Item "-mdual-nops=n"
+.PD
+By default, \s-1GCC\s0 will insert nops to increase dual issue when it expects
+it to increase performance. \fIn\fR can be a value from 0 to 10. A
+smaller \fIn\fR will insert fewer nops. 10 is the default, 0 is the
+same as \fB\-mno\-dual\-nops\fR. Disabled with \fB\-Os\fR.
+.IP "\fB\-mhint\-max\-nops=\fR\fIn\fR" 4
+.IX Item "-mhint-max-nops=n"
+Maximum number of nops to insert for a branch hint. A branch hint must
+be at least 8 instructions away from the branch it is effecting. \s-1GCC\s0
+will insert up to \fIn\fR nops to enforce this, otherwise it will not
+generate the branch hint.
+.IP "\fB\-mhint\-max\-distance=\fR\fIn\fR" 4
+.IX Item "-mhint-max-distance=n"
+The encoding of the branch hint instruction limits the hint to be within
+256 instructions of the branch it is effecting. By default, \s-1GCC\s0 makes
+sure it is within 125.
+.IP "\fB\-msafe\-hints\fR" 4
+.IX Item "-msafe-hints"
+Work around a hardware bug which causes the \s-1SPU\s0 to stall indefinitely.
+By default, \s-1GCC\s0 will insert the \f(CW\*(C`hbrp\*(C'\fR instruction to make sure
+this stall won't happen.
+.PP
+\fIOptions for System V\fR
+.IX Subsection "Options for System V"
+.PP
+These additional options are available on System V Release 4 for
+compatibility with other compilers on those systems:
+.IP "\fB\-G\fR" 4
+.IX Item "-G"
+Create a shared object.
+It is recommended that \fB\-symbolic\fR or \fB\-shared\fR be used instead.
+.IP "\fB\-Qy\fR" 4
+.IX Item "-Qy"
+Identify the versions of each tool used by the compiler, in a
+\&\f(CW\*(C`.ident\*(C'\fR assembler directive in the output.
+.IP "\fB\-Qn\fR" 4
+.IX Item "-Qn"
+Refrain from adding \f(CW\*(C`.ident\*(C'\fR directives to the output file (this is
+the default).
+.IP "\fB\-YP,\fR\fIdirs\fR" 4
+.IX Item "-YP,dirs"
+Search the directories \fIdirs\fR, and no others, for libraries
+specified with \fB\-l\fR.
+.IP "\fB\-Ym,\fR\fIdir\fR" 4
+.IX Item "-Ym,dir"
+Look in the directory \fIdir\fR to find the M4 preprocessor.
+The assembler uses this option.
+.PP
+\fIV850 Options\fR
+.IX Subsection "V850 Options"
+.PP
+These \fB\-m\fR options are defined for V850 implementations:
+.IP "\fB\-mlong\-calls\fR" 4
+.IX Item "-mlong-calls"
+.PD 0
+.IP "\fB\-mno\-long\-calls\fR" 4
+.IX Item "-mno-long-calls"
+.PD
+Treat all calls as being far away (near). If calls are assumed to be
+far away, the compiler will always load the functions address up into a
+register, and call indirect through the pointer.
+.IP "\fB\-mno\-ep\fR" 4
+.IX Item "-mno-ep"
+.PD 0
+.IP "\fB\-mep\fR" 4
+.IX Item "-mep"
+.PD
+Do not optimize (do optimize) basic blocks that use the same index
+pointer 4 or more times to copy pointer into the \f(CW\*(C`ep\*(C'\fR register, and
+use the shorter \f(CW\*(C`sld\*(C'\fR and \f(CW\*(C`sst\*(C'\fR instructions. The \fB\-mep\fR
+option is on by default if you optimize.
+.IP "\fB\-mno\-prolog\-function\fR" 4
+.IX Item "-mno-prolog-function"
+.PD 0
+.IP "\fB\-mprolog\-function\fR" 4
+.IX Item "-mprolog-function"
+.PD
+Do not use (do use) external functions to save and restore registers
+at the prologue and epilogue of a function. The external functions
+are slower, but use less code space if more than one function saves
+the same number of registers. The \fB\-mprolog\-function\fR option
+is on by default if you optimize.
+.IP "\fB\-mspace\fR" 4
+.IX Item "-mspace"
+Try to make the code as small as possible. At present, this just turns
+on the \fB\-mep\fR and \fB\-mprolog\-function\fR options.
+.IP "\fB\-mtda=\fR\fIn\fR" 4
+.IX Item "-mtda=n"
+Put static or global variables whose size is \fIn\fR bytes or less into
+the tiny data area that register \f(CW\*(C`ep\*(C'\fR points to. The tiny data
+area can hold up to 256 bytes in total (128 bytes for byte references).
+.IP "\fB\-msda=\fR\fIn\fR" 4
+.IX Item "-msda=n"
+Put static or global variables whose size is \fIn\fR bytes or less into
+the small data area that register \f(CW\*(C`gp\*(C'\fR points to. The small data
+area can hold up to 64 kilobytes.
+.IP "\fB\-mzda=\fR\fIn\fR" 4
+.IX Item "-mzda=n"
+Put static or global variables whose size is \fIn\fR bytes or less into
+the first 32 kilobytes of memory.
+.IP "\fB\-mv850\fR" 4
+.IX Item "-mv850"
+Specify that the target processor is the V850.
+.IP "\fB\-mbig\-switch\fR" 4
+.IX Item "-mbig-switch"
+Generate code suitable for big switch tables. Use this option only if
+the assembler/linker complain about out of range branches within a switch
+table.
+.IP "\fB\-mapp\-regs\fR" 4
+.IX Item "-mapp-regs"
+This option will cause r2 and r5 to be used in the code generated by
+the compiler. This setting is the default.
+.IP "\fB\-mno\-app\-regs\fR" 4
+.IX Item "-mno-app-regs"
+This option will cause r2 and r5 to be treated as fixed registers.
+.IP "\fB\-mv850e1\fR" 4
+.IX Item "-mv850e1"
+Specify that the target processor is the V850E1. The preprocessor
+constants \fB_\|_v850e1_\|_\fR and \fB_\|_v850e_\|_\fR will be defined if
+this option is used.
+.IP "\fB\-mv850e\fR" 4
+.IX Item "-mv850e"
+Specify that the target processor is the V850E. The preprocessor
+constant \fB_\|_v850e_\|_\fR will be defined if this option is used.
+.Sp
+If neither \fB\-mv850\fR nor \fB\-mv850e\fR nor \fB\-mv850e1\fR
+are defined then a default target processor will be chosen and the
+relevant \fB_\|_v850*_\|_\fR preprocessor constant will be defined.
+.Sp
+The preprocessor constants \fB_\|_v850\fR and \fB_\|_v851_\|_\fR are always
+defined, regardless of which processor variant is the target.
+.IP "\fB\-mdisable\-callt\fR" 4
+.IX Item "-mdisable-callt"
+This option will suppress generation of the \s-1CALLT\s0 instruction for the
+v850e and v850e1 flavors of the v850 architecture. The default is
+\&\fB\-mno\-disable\-callt\fR which allows the \s-1CALLT\s0 instruction to be used.
+.PP
+\fI\s-1VAX\s0 Options\fR
+.IX Subsection "VAX Options"
+.PP
+These \fB\-m\fR options are defined for the \s-1VAX:\s0
+.IP "\fB\-munix\fR" 4
+.IX Item "-munix"
+Do not output certain jump instructions (\f(CW\*(C`aobleq\*(C'\fR and so on)
+that the Unix assembler for the \s-1VAX\s0 cannot handle across long
+ranges.
+.IP "\fB\-mgnu\fR" 4
+.IX Item "-mgnu"
+Do output those jump instructions, on the assumption that you
+will assemble with the \s-1GNU\s0 assembler.
+.IP "\fB\-mg\fR" 4
+.IX Item "-mg"
+Output code for g\-format floating point numbers instead of d\-format.
+.PP
+\fIVxWorks Options\fR
+.IX Subsection "VxWorks Options"
+.PP
+The options in this section are defined for all VxWorks targets.
+Options specific to the target hardware are listed with the other
+options for that target.
+.IP "\fB\-mrtp\fR" 4
+.IX Item "-mrtp"
+\&\s-1GCC\s0 can generate code for both VxWorks kernels and real time processes
+(RTPs). This option switches from the former to the latter. It also
+defines the preprocessor macro \f(CW\*(C`_\|_RTP_\|_\*(C'\fR.
+.IP "\fB\-non\-static\fR" 4
+.IX Item "-non-static"
+Link an \s-1RTP\s0 executable against shared libraries rather than static
+libraries. The options \fB\-static\fR and \fB\-shared\fR can
+also be used for RTPs; \fB\-static\fR
+is the default.
+.IP "\fB\-Bstatic\fR" 4
+.IX Item "-Bstatic"
+.PD 0
+.IP "\fB\-Bdynamic\fR" 4
+.IX Item "-Bdynamic"
+.PD
+These options are passed down to the linker. They are defined for
+compatibility with Diab.
+.IP "\fB\-Xbind\-lazy\fR" 4
+.IX Item "-Xbind-lazy"
+Enable lazy binding of function calls. This option is equivalent to
+\&\fB\-Wl,\-z,now\fR and is defined for compatibility with Diab.
+.IP "\fB\-Xbind\-now\fR" 4
+.IX Item "-Xbind-now"
+Disable lazy binding of function calls. This option is the default and
+is defined for compatibility with Diab.
+.PP
+\fIx86\-64 Options\fR
+.IX Subsection "x86-64 Options"
+.PP
+These are listed under
+.PP
+\fIi386 and x86\-64 Windows Options\fR
+.IX Subsection "i386 and x86-64 Windows Options"
+.PP
+These additional options are available for Windows targets:
+.IP "\fB\-mconsole\fR" 4
+.IX Item "-mconsole"
+This option is available for Cygwin and MinGW targets. It
+specifies that a console application is to be generated, by
+instructing the linker to set the \s-1PE\s0 header subsystem type
+required for console applications.
+This is the default behaviour for Cygwin and MinGW targets.
+.IP "\fB\-mcygwin\fR" 4
+.IX Item "-mcygwin"
+This option is available for Cygwin targets. It specifies that
+the Cygwin internal interface is to be used for predefined
+preprocessor macros, C runtime libraries and related linker
+paths and options. For Cygwin targets this is the default behaviour.
+This option is deprecated and will be removed in a future release.
+.IP "\fB\-mno\-cygwin\fR" 4
+.IX Item "-mno-cygwin"
+This option is available for Cygwin targets. It specifies that
+the MinGW internal interface is to be used instead of Cygwin's, by
+setting MinGW-related predefined macros and linker paths and default
+library options.
+This option is deprecated and will be removed in a future release.
+.IP "\fB\-mdll\fR" 4
+.IX Item "-mdll"
+This option is available for Cygwin and MinGW targets. It
+specifies that a \s-1DLL\s0 \- a dynamic link library \- is to be
+generated, enabling the selection of the required runtime
+startup object and entry point.
+.IP "\fB\-mnop\-fun\-dllimport\fR" 4
+.IX Item "-mnop-fun-dllimport"
+This option is available for Cygwin and MinGW targets. It
+specifies that the dllimport attribute should be ignored.
+.IP "\fB\-mthread\fR" 4
+.IX Item "-mthread"
+This option is available for MinGW targets. It specifies
+that MinGW-specific thread support is to be used.
+.IP "\fB\-mwin32\fR" 4
+.IX Item "-mwin32"
+This option is available for Cygwin and MinGW targets. It
+specifies that the typical Windows pre-defined macros are to
+be set in the pre-processor, but does not influence the choice
+of runtime library/startup code.
+.IP "\fB\-mwindows\fR" 4
+.IX Item "-mwindows"
+This option is available for Cygwin and MinGW targets. It
+specifies that a \s-1GUI\s0 application is to be generated by
+instructing the linker to set the \s-1PE\s0 header subsystem type
+appropriately.
+.PP
+See also under \fBi386 and x86\-64 Options\fR for standard options.
+.PP
+\fIXstormy16 Options\fR
+.IX Subsection "Xstormy16 Options"
+.PP
+These options are defined for Xstormy16:
+.IP "\fB\-msim\fR" 4
+.IX Item "-msim"
+Choose startup files and linker script suitable for the simulator.
+.PP
+\fIXtensa Options\fR
+.IX Subsection "Xtensa Options"
+.PP
+These options are supported for Xtensa targets:
+.IP "\fB\-mconst16\fR" 4
+.IX Item "-mconst16"
+.PD 0
+.IP "\fB\-mno\-const16\fR" 4
+.IX Item "-mno-const16"
+.PD
+Enable or disable use of \f(CW\*(C`CONST16\*(C'\fR instructions for loading
+constant values. The \f(CW\*(C`CONST16\*(C'\fR instruction is currently not a
+standard option from Tensilica. When enabled, \f(CW\*(C`CONST16\*(C'\fR
+instructions are always used in place of the standard \f(CW\*(C`L32R\*(C'\fR
+instructions. The use of \f(CW\*(C`CONST16\*(C'\fR is enabled by default only if
+the \f(CW\*(C`L32R\*(C'\fR instruction is not available.
+.IP "\fB\-mfused\-madd\fR" 4
+.IX Item "-mfused-madd"
+.PD 0
+.IP "\fB\-mno\-fused\-madd\fR" 4
+.IX Item "-mno-fused-madd"
+.PD
+Enable or disable use of fused multiply/add and multiply/subtract
+instructions in the floating-point option. This has no effect if the
+floating-point option is not also enabled. Disabling fused multiply/add
+and multiply/subtract instructions forces the compiler to use separate
+instructions for the multiply and add/subtract operations. This may be
+desirable in some cases where strict \s-1IEEE\s0 754\-compliant results are
+required: the fused multiply add/subtract instructions do not round the
+intermediate result, thereby producing results with \fImore\fR bits of
+precision than specified by the \s-1IEEE\s0 standard. Disabling fused multiply
+add/subtract instructions also ensures that the program output is not
+sensitive to the compiler's ability to combine multiply and add/subtract
+operations.
+.IP "\fB\-mserialize\-volatile\fR" 4
+.IX Item "-mserialize-volatile"
+.PD 0
+.IP "\fB\-mno\-serialize\-volatile\fR" 4
+.IX Item "-mno-serialize-volatile"
+.PD
+When this option is enabled, \s-1GCC\s0 inserts \f(CW\*(C`MEMW\*(C'\fR instructions before
+\&\f(CW\*(C`volatile\*(C'\fR memory references to guarantee sequential consistency.
+The default is \fB\-mserialize\-volatile\fR. Use
+\&\fB\-mno\-serialize\-volatile\fR to omit the \f(CW\*(C`MEMW\*(C'\fR instructions.
+.IP "\fB\-mtext\-section\-literals\fR" 4
+.IX Item "-mtext-section-literals"
+.PD 0
+.IP "\fB\-mno\-text\-section\-literals\fR" 4
+.IX Item "-mno-text-section-literals"
+.PD
+Control the treatment of literal pools. The default is
+\&\fB\-mno\-text\-section\-literals\fR, which places literals in a separate
+section in the output file. This allows the literal pool to be placed
+in a data \s-1RAM/ROM\s0, and it also allows the linker to combine literal
+pools from separate object files to remove redundant literals and
+improve code size. With \fB\-mtext\-section\-literals\fR, the literals
+are interspersed in the text section in order to keep them as close as
+possible to their references. This may be necessary for large assembly
+files.
+.IP "\fB\-mtarget\-align\fR" 4
+.IX Item "-mtarget-align"
+.PD 0
+.IP "\fB\-mno\-target\-align\fR" 4
+.IX Item "-mno-target-align"
+.PD
+When this option is enabled, \s-1GCC\s0 instructs the assembler to
+automatically align instructions to reduce branch penalties at the
+expense of some code density. The assembler attempts to widen density
+instructions to align branch targets and the instructions following call
+instructions. If there are not enough preceding safe density
+instructions to align a target, no widening will be performed. The
+default is \fB\-mtarget\-align\fR. These options do not affect the
+treatment of auto-aligned instructions like \f(CW\*(C`LOOP\*(C'\fR, which the
+assembler will always align, either by widening density instructions or
+by inserting no-op instructions.
+.IP "\fB\-mlongcalls\fR" 4
+.IX Item "-mlongcalls"
+.PD 0
+.IP "\fB\-mno\-longcalls\fR" 4
+.IX Item "-mno-longcalls"
+.PD
+When this option is enabled, \s-1GCC\s0 instructs the assembler to translate
+direct calls to indirect calls unless it can determine that the target
+of a direct call is in the range allowed by the call instruction. This
+translation typically occurs for calls to functions in other source
+files. Specifically, the assembler translates a direct \f(CW\*(C`CALL\*(C'\fR
+instruction into an \f(CW\*(C`L32R\*(C'\fR followed by a \f(CW\*(C`CALLX\*(C'\fR instruction.
+The default is \fB\-mno\-longcalls\fR. This option should be used in
+programs where the call target can potentially be out of range. This
+option is implemented in the assembler, not the compiler, so the
+assembly code generated by \s-1GCC\s0 will still show direct call
+instructions\-\-\-look at the disassembled object code to see the actual
+instructions. Note that the assembler will use an indirect call for
+every cross-file call, not just those that really will be out of range.
+.PP
+\fIzSeries Options\fR
+.IX Subsection "zSeries Options"
+.PP
+These are listed under
+.Sh "Options for Code Generation Conventions"
+.IX Subsection "Options for Code Generation Conventions"
+These machine-independent options control the interface conventions
+used in code generation.
+.PP
+Most of them have both positive and negative forms; the negative form
+of \fB\-ffoo\fR would be \fB\-fno\-foo\fR. In the table below, only
+one of the forms is listed\-\-\-the one which is not the default. You
+can figure out the other form by either removing \fBno\-\fR or adding
+it.
+.IP "\fB\-fbounds\-check\fR" 4
+.IX Item "-fbounds-check"
+For front-ends that support it, generate additional code to check that
+indices used to access arrays are within the declared range. This is
+currently only supported by the Java and Fortran front-ends, where
+this option defaults to true and false respectively.
+.IP "\fB\-ftrapv\fR" 4
+.IX Item "-ftrapv"
+This option generates traps for signed overflow on addition, subtraction,
+multiplication operations.
+.IP "\fB\-fwrapv\fR" 4
+.IX Item "-fwrapv"
+This option instructs the compiler to assume that signed arithmetic
+overflow of addition, subtraction and multiplication wraps around
+using twos-complement representation. This flag enables some optimizations
+and disables others. This option is enabled by default for the Java
+front-end, as required by the Java language specification.
+.IP "\fB\-fexceptions\fR" 4
+.IX Item "-fexceptions"
+Enable exception handling. Generates extra code needed to propagate
+exceptions. For some targets, this implies \s-1GCC\s0 will generate frame
+unwind information for all functions, which can produce significant data
+size overhead, although it does not affect execution. If you do not
+specify this option, \s-1GCC\s0 will enable it by default for languages like
+\&\*(C+ which normally require exception handling, and disable it for
+languages like C that do not normally require it. However, you may need
+to enable this option when compiling C code that needs to interoperate
+properly with exception handlers written in \*(C+. You may also wish to
+disable this option if you are compiling older \*(C+ programs that don't
+use exception handling.
+.IP "\fB\-fnon\-call\-exceptions\fR" 4
+.IX Item "-fnon-call-exceptions"
+Generate code that allows trapping instructions to throw exceptions.
+Note that this requires platform-specific runtime support that does
+not exist everywhere. Moreover, it only allows \fItrapping\fR
+instructions to throw exceptions, i.e. memory references or floating
+point instructions. It does not allow exceptions to be thrown from
+arbitrary signal handlers such as \f(CW\*(C`SIGALRM\*(C'\fR.
+.IP "\fB\-funwind\-tables\fR" 4
+.IX Item "-funwind-tables"
+Similar to \fB\-fexceptions\fR, except that it will just generate any needed
+static data, but will not affect the generated code in any other way.
+You will normally not enable this option; instead, a language processor
+that needs this handling would enable it on your behalf.
+.IP "\fB\-fasynchronous\-unwind\-tables\fR" 4
+.IX Item "-fasynchronous-unwind-tables"
+Generate unwind table in dwarf2 format, if supported by target machine. The
+table is exact at each instruction boundary, so it can be used for stack
+unwinding from asynchronous events (such as debugger or garbage collector).
+.IP "\fB\-fpcc\-struct\-return\fR" 4
+.IX Item "-fpcc-struct-return"
+Return \*(L"short\*(R" \f(CW\*(C`struct\*(C'\fR and \f(CW\*(C`union\*(C'\fR values in memory like
+longer ones, rather than in registers. This convention is less
+efficient, but it has the advantage of allowing intercallability between
+GCC-compiled files and files compiled with other compilers, particularly
+the Portable C Compiler (pcc).
+.Sp
+The precise convention for returning structures in memory depends
+on the target configuration macros.
+.Sp
+Short structures and unions are those whose size and alignment match
+that of some integer type.
+.Sp
+\&\fBWarning:\fR code compiled with the \fB\-fpcc\-struct\-return\fR
+switch is not binary compatible with code compiled with the
+\&\fB\-freg\-struct\-return\fR switch.
+Use it to conform to a non-default application binary interface.
+.IP "\fB\-freg\-struct\-return\fR" 4
+.IX Item "-freg-struct-return"
+Return \f(CW\*(C`struct\*(C'\fR and \f(CW\*(C`union\*(C'\fR values in registers when possible.
+This is more efficient for small structures than
+\&\fB\-fpcc\-struct\-return\fR.
+.Sp
+If you specify neither \fB\-fpcc\-struct\-return\fR nor
+\&\fB\-freg\-struct\-return\fR, \s-1GCC\s0 defaults to whichever convention is
+standard for the target. If there is no standard convention, \s-1GCC\s0
+defaults to \fB\-fpcc\-struct\-return\fR, except on targets where \s-1GCC\s0 is
+the principal compiler. In those cases, we can choose the standard, and
+we chose the more efficient register return alternative.
+.Sp
+\&\fBWarning:\fR code compiled with the \fB\-freg\-struct\-return\fR
+switch is not binary compatible with code compiled with the
+\&\fB\-fpcc\-struct\-return\fR switch.
+Use it to conform to a non-default application binary interface.
+.IP "\fB\-fshort\-enums\fR" 4
+.IX Item "-fshort-enums"
+Allocate to an \f(CW\*(C`enum\*(C'\fR type only as many bytes as it needs for the
+declared range of possible values. Specifically, the \f(CW\*(C`enum\*(C'\fR type
+will be equivalent to the smallest integer type which has enough room.
+.Sp
+\&\fBWarning:\fR the \fB\-fshort\-enums\fR switch causes \s-1GCC\s0 to generate
+code that is not binary compatible with code generated without that switch.
+Use it to conform to a non-default application binary interface.
+.IP "\fB\-fshort\-double\fR" 4
+.IX Item "-fshort-double"
+Use the same size for \f(CW\*(C`double\*(C'\fR as for \f(CW\*(C`float\*(C'\fR.
+.Sp
+\&\fBWarning:\fR the \fB\-fshort\-double\fR switch causes \s-1GCC\s0 to generate
+code that is not binary compatible with code generated without that switch.
+Use it to conform to a non-default application binary interface.
+.IP "\fB\-fshort\-wchar\fR" 4
+.IX Item "-fshort-wchar"
+Override the underlying type for \fBwchar_t\fR to be \fBshort
+unsigned int\fR instead of the default for the target. This option is
+useful for building programs to run under \s-1WINE\s0.
+.Sp
+\&\fBWarning:\fR the \fB\-fshort\-wchar\fR switch causes \s-1GCC\s0 to generate
+code that is not binary compatible with code generated without that switch.
+Use it to conform to a non-default application binary interface.
+.IP "\fB\-fno\-common\fR" 4
+.IX Item "-fno-common"
+In C code, controls the placement of uninitialized global variables.
+Unix C compilers have traditionally permitted multiple definitions of
+such variables in different compilation units by placing the variables
+in a common block.
+This is the behavior specified by \fB\-fcommon\fR, and is the default
+for \s-1GCC\s0 on most targets.
+On the other hand, this behavior is not required by \s-1ISO\s0 C, and on some
+targets may carry a speed or code size penalty on variable references.
+The \fB\-fno\-common\fR option specifies that the compiler should place
+uninitialized global variables in the data section of the object file,
+rather than generating them as common blocks.
+This has the effect that if the same variable is declared
+(without \f(CW\*(C`extern\*(C'\fR) in two different compilations,
+you will get a multiple-definition error when you link them.
+In this case, you must compile with \fB\-fcommon\fR instead.
+Compiling with \fB\-fno\-common\fR is useful on targets for which
+it provides better performance, or if you wish to verify that the
+program will work on other systems which always treat uninitialized
+variable declarations this way.
+.IP "\fB\-fno\-ident\fR" 4
+.IX Item "-fno-ident"
+Ignore the \fB#ident\fR directive.
+.IP "\fB\-finhibit\-size\-directive\fR" 4
+.IX Item "-finhibit-size-directive"
+Don't output a \f(CW\*(C`.size\*(C'\fR assembler directive, or anything else that
+would cause trouble if the function is split in the middle, and the
+two halves are placed at locations far apart in memory. This option is
+used when compiling \fIcrtstuff.c\fR; you should not need to use it
+for anything else.
+.IP "\fB\-fverbose\-asm\fR" 4
+.IX Item "-fverbose-asm"
+Put extra commentary information in the generated assembly code to
+make it more readable. This option is generally only of use to those
+who actually need to read the generated assembly code (perhaps while
+debugging the compiler itself).
+.Sp
+\&\fB\-fno\-verbose\-asm\fR, the default, causes the
+extra information to be omitted and is useful when comparing two assembler
+files.
+.IP "\fB\-frecord\-gcc\-switches\fR" 4
+.IX Item "-frecord-gcc-switches"
+This switch causes the command line that was used to invoke the
+compiler to be recorded into the object file that is being created.
+This switch is only implemented on some targets and the exact format
+of the recording is target and binary file format dependent, but it
+usually takes the form of a section containing \s-1ASCII\s0 text. This
+switch is related to the \fB\-fverbose\-asm\fR switch, but that
+switch only records information in the assembler output file as
+comments, so it never reaches the object file.
+.IP "\fB\-fpic\fR" 4
+.IX Item "-fpic"
+Generate position-independent code (\s-1PIC\s0) suitable for use in a shared
+library, if supported for the target machine. Such code accesses all
+constant addresses through a global offset table (\s-1GOT\s0). The dynamic
+loader resolves the \s-1GOT\s0 entries when the program starts (the dynamic
+loader is not part of \s-1GCC\s0; it is part of the operating system). If
+the \s-1GOT\s0 size for the linked executable exceeds a machine-specific
+maximum size, you get an error message from the linker indicating that
+\&\fB\-fpic\fR does not work; in that case, recompile with \fB\-fPIC\fR
+instead. (These maximums are 8k on the \s-1SPARC\s0 and 32k
+on the m68k and \s-1RS/6000\s0. The 386 has no such limit.)
+.Sp
+Position-independent code requires special support, and therefore works
+only on certain machines. For the 386, \s-1GCC\s0 supports \s-1PIC\s0 for System V
+but not for the Sun 386i. Code generated for the \s-1IBM\s0 \s-1RS/6000\s0 is always
+position-independent.
+.Sp
+When this flag is set, the macros \f(CW\*(C`_\|_pic_\|_\*(C'\fR and \f(CW\*(C`_\|_PIC_\|_\*(C'\fR
+are defined to 1.
+.IP "\fB\-fPIC\fR" 4
+.IX Item "-fPIC"
+If supported for the target machine, emit position-independent code,
+suitable for dynamic linking and avoiding any limit on the size of the
+global offset table. This option makes a difference on the m68k,
+PowerPC and \s-1SPARC\s0.
+.Sp
+Position-independent code requires special support, and therefore works
+only on certain machines.
+.Sp
+When this flag is set, the macros \f(CW\*(C`_\|_pic_\|_\*(C'\fR and \f(CW\*(C`_\|_PIC_\|_\*(C'\fR
+are defined to 2.
+.IP "\fB\-fpie\fR" 4
+.IX Item "-fpie"
+.PD 0
+.IP "\fB\-fPIE\fR" 4
+.IX Item "-fPIE"
+.PD
+These options are similar to \fB\-fpic\fR and \fB\-fPIC\fR, but
+generated position independent code can be only linked into executables.
+Usually these options are used when \fB\-pie\fR \s-1GCC\s0 option will be
+used during linking.
+.Sp
+\&\fB\-fpie\fR and \fB\-fPIE\fR both define the macros
+\&\f(CW\*(C`_\|_pie_\|_\*(C'\fR and \f(CW\*(C`_\|_PIE_\|_\*(C'\fR. The macros have the value 1
+for \fB\-fpie\fR and 2 for \fB\-fPIE\fR.
+.IP "\fB\-fno\-jump\-tables\fR" 4
+.IX Item "-fno-jump-tables"
+Do not use jump tables for switch statements even where it would be
+more efficient than other code generation strategies. This option is
+of use in conjunction with \fB\-fpic\fR or \fB\-fPIC\fR for
+building code which forms part of a dynamic linker and cannot
+reference the address of a jump table. On some targets, jump tables
+do not require a \s-1GOT\s0 and this option is not needed.
+.IP "\fB\-ffixed\-\fR\fIreg\fR" 4
+.IX Item "-ffixed-reg"
+Treat the register named \fIreg\fR as a fixed register; generated code
+should never refer to it (except perhaps as a stack pointer, frame
+pointer or in some other fixed role).
+.Sp
+\&\fIreg\fR must be the name of a register. The register names accepted
+are machine-specific and are defined in the \f(CW\*(C`REGISTER_NAMES\*(C'\fR
+macro in the machine description macro file.
+.Sp
+This flag does not have a negative form, because it specifies a
+three-way choice.
+.IP "\fB\-fcall\-used\-\fR\fIreg\fR" 4
+.IX Item "-fcall-used-reg"
+Treat the register named \fIreg\fR as an allocable register that is
+clobbered by function calls. It may be allocated for temporaries or
+variables that do not live across a call. Functions compiled this way
+will not save and restore the register \fIreg\fR.
+.Sp
+It is an error to used this flag with the frame pointer or stack pointer.
+Use of this flag for other registers that have fixed pervasive roles in
+the machine's execution model will produce disastrous results.
+.Sp
+This flag does not have a negative form, because it specifies a
+three-way choice.
+.IP "\fB\-fcall\-saved\-\fR\fIreg\fR" 4
+.IX Item "-fcall-saved-reg"
+Treat the register named \fIreg\fR as an allocable register saved by
+functions. It may be allocated even for temporaries or variables that
+live across a call. Functions compiled this way will save and restore
+the register \fIreg\fR if they use it.
+.Sp
+It is an error to used this flag with the frame pointer or stack pointer.
+Use of this flag for other registers that have fixed pervasive roles in
+the machine's execution model will produce disastrous results.
+.Sp
+A different sort of disaster will result from the use of this flag for
+a register in which function values may be returned.
+.Sp
+This flag does not have a negative form, because it specifies a
+three-way choice.
+.IP "\fB\-fpack\-struct[=\fR\fIn\fR\fB]\fR" 4
+.IX Item "-fpack-struct[=n]"
+Without a value specified, pack all structure members together without
+holes. When a value is specified (which must be a small power of two), pack
+structure members according to this value, representing the maximum
+alignment (that is, objects with default alignment requirements larger than
+this will be output potentially unaligned at the next fitting location.
+.Sp
+\&\fBWarning:\fR the \fB\-fpack\-struct\fR switch causes \s-1GCC\s0 to generate
+code that is not binary compatible with code generated without that switch.
+Additionally, it makes the code suboptimal.
+Use it to conform to a non-default application binary interface.
+.IP "\fB\-finstrument\-functions\fR" 4
+.IX Item "-finstrument-functions"
+Generate instrumentation calls for entry and exit to functions. Just
+after function entry and just before function exit, the following
+profiling functions will be called with the address of the current
+function and its call site. (On some platforms,
+\&\f(CW\*(C`_\|_builtin_return_address\*(C'\fR does not work beyond the current
+function, so the call site information may not be available to the
+profiling functions otherwise.)
+.Sp
+.Vb 4
+\& void _\|_cyg_profile_func_enter (void *this_fn,
+\& void *call_site);
+\& void _\|_cyg_profile_func_exit (void *this_fn,
+\& void *call_site);
+.Ve
+.Sp
+The first argument is the address of the start of the current function,
+which may be looked up exactly in the symbol table.
+.Sp
+This instrumentation is also done for functions expanded inline in other
+functions. The profiling calls will indicate where, conceptually, the
+inline function is entered and exited. This means that addressable
+versions of such functions must be available. If all your uses of a
+function are expanded inline, this may mean an additional expansion of
+code size. If you use \fBextern inline\fR in your C code, an
+addressable version of such functions must be provided. (This is
+normally the case anyways, but if you get lucky and the optimizer always
+expands the functions inline, you might have gotten away without
+providing static copies.)
+.Sp
+A function may be given the attribute \f(CW\*(C`no_instrument_function\*(C'\fR, in
+which case this instrumentation will not be done. This can be used, for
+example, for the profiling functions listed above, high-priority
+interrupt routines, and any functions from which the profiling functions
+cannot safely be called (perhaps signal handlers, if the profiling
+routines generate output or allocate memory).
+.IP "\fB\-finstrument\-functions\-exclude\-file\-list=\fR\fIfile\fR\fB,\fR\fIfile\fR\fB,...\fR" 4
+.IX Item "-finstrument-functions-exclude-file-list=file,file,..."
+Set the list of functions that are excluded from instrumentation (see
+the description of \f(CW\*(C`\-finstrument\-functions\*(C'\fR). If the file that
+contains a function definition matches with one of \fIfile\fR, then
+that function is not instrumented. The match is done on substrings:
+if the \fIfile\fR parameter is a substring of the file name, it is
+considered to be a match.
+.Sp
+For example,
+\&\f(CW\*(C`\-finstrument\-functions\-exclude\-file\-list=/bits/stl,include/sys\*(C'\fR
+will exclude any inline function defined in files whose pathnames
+contain \f(CW\*(C`/bits/stl\*(C'\fR or \f(CW\*(C`include/sys\*(C'\fR.
+.Sp
+If, for some reason, you want to include letter \f(CW\*(Aq,\*(Aq\fR in one of
+\&\fIsym\fR, write \f(CW\*(Aq,\*(Aq\fR. For example,
+\&\f(CW\*(C`\-finstrument\-functions\-exclude\-file\-list=\*(Aq,,tmp\*(Aq\*(C'\fR
+(note the single quote surrounding the option).
+.IP "\fB\-finstrument\-functions\-exclude\-function\-list=\fR\fIsym\fR\fB,\fR\fIsym\fR\fB,...\fR" 4
+.IX Item "-finstrument-functions-exclude-function-list=sym,sym,..."
+This is similar to \f(CW\*(C`\-finstrument\-functions\-exclude\-file\-list\*(C'\fR,
+but this option sets the list of function names to be excluded from
+instrumentation. The function name to be matched is its user-visible
+name, such as \f(CW\*(C`vector<int> blah(const vector<int> &)\*(C'\fR, not the
+internal mangled name (e.g., \f(CW\*(C`_Z4blahRSt6vectorIiSaIiEE\*(C'\fR). The
+match is done on substrings: if the \fIsym\fR parameter is a substring
+of the function name, it is considered to be a match.
+.IP "\fB\-fstack\-check\fR" 4
+.IX Item "-fstack-check"
+Generate code to verify that you do not go beyond the boundary of the
+stack. You should specify this flag if you are running in an
+environment with multiple threads, but only rarely need to specify it in
+a single-threaded environment since stack overflow is automatically
+detected on nearly all systems if there is only one stack.
+.Sp
+Note that this switch does not actually cause checking to be done; the
+operating system or the language runtime must do that. The switch causes
+generation of code to ensure that they see the stack being extended.
+.Sp
+You can additionally specify a string parameter: \f(CW\*(C`no\*(C'\fR means no
+checking, \f(CW\*(C`generic\*(C'\fR means force the use of old-style checking,
+\&\f(CW\*(C`specific\*(C'\fR means use the best checking method and is equivalent
+to bare \fB\-fstack\-check\fR.
+.Sp
+Old-style checking is a generic mechanism that requires no specific
+target support in the compiler but comes with the following drawbacks:
+.RS 4
+.IP "1." 4
+Modified allocation strategy for large objects: they will always be
+allocated dynamically if their size exceeds a fixed threshold.
+.IP "2." 4
+Fixed limit on the size of the static frame of functions: when it is
+topped by a particular function, stack checking is not reliable and
+a warning is issued by the compiler.
+.IP "3." 4
+Inefficiency: because of both the modified allocation strategy and the
+generic implementation, the performances of the code are hampered.
+.RE
+.RS 4
+.Sp
+Note that old-style stack checking is also the fallback method for
+\&\f(CW\*(C`specific\*(C'\fR if no target support has been added in the compiler.
+.RE
+.IP "\fB\-fstack\-limit\-register=\fR\fIreg\fR" 4
+.IX Item "-fstack-limit-register=reg"
+.PD 0
+.IP "\fB\-fstack\-limit\-symbol=\fR\fIsym\fR" 4
+.IX Item "-fstack-limit-symbol=sym"
+.IP "\fB\-fno\-stack\-limit\fR" 4
+.IX Item "-fno-stack-limit"
+.PD
+Generate code to ensure that the stack does not grow beyond a certain value,
+either the value of a register or the address of a symbol. If the stack
+would grow beyond the value, a signal is raised. For most targets,
+the signal is raised before the stack overruns the boundary, so
+it is possible to catch the signal without taking special precautions.
+.Sp
+For instance, if the stack starts at absolute address \fB0x80000000\fR
+and grows downwards, you can use the flags
+\&\fB\-fstack\-limit\-symbol=_\|_stack_limit\fR and
+\&\fB\-Wl,\-\-defsym,_\|_stack_limit=0x7ffe0000\fR to enforce a stack limit
+of 128KB. Note that this may only work with the \s-1GNU\s0 linker.
+.IP "\fB\-fargument\-alias\fR" 4
+.IX Item "-fargument-alias"
+.PD 0
+.IP "\fB\-fargument\-noalias\fR" 4
+.IX Item "-fargument-noalias"
+.IP "\fB\-fargument\-noalias\-global\fR" 4
+.IX Item "-fargument-noalias-global"
+.IP "\fB\-fargument\-noalias\-anything\fR" 4
+.IX Item "-fargument-noalias-anything"
+.PD
+Specify the possible relationships among parameters and between
+parameters and global data.
+.Sp
+\&\fB\-fargument\-alias\fR specifies that arguments (parameters) may
+alias each other and may alias global storage.\fB\-fargument\-noalias\fR specifies that arguments do not alias
+each other, but may alias global storage.\fB\-fargument\-noalias\-global\fR specifies that arguments do not
+alias each other and do not alias global storage.
+\&\fB\-fargument\-noalias\-anything\fR specifies that arguments do not
+alias any other storage.
+.Sp
+Each language will automatically use whatever option is required by
+the language standard. You should not need to use these options yourself.
+.IP "\fB\-fleading\-underscore\fR" 4
+.IX Item "-fleading-underscore"
+This option and its counterpart, \fB\-fno\-leading\-underscore\fR, forcibly
+change the way C symbols are represented in the object file. One use
+is to help link with legacy assembly code.
+.Sp
+\&\fBWarning:\fR the \fB\-fleading\-underscore\fR switch causes \s-1GCC\s0 to
+generate code that is not binary compatible with code generated without that
+switch. Use it to conform to a non-default application binary interface.
+Not all targets provide complete support for this switch.
+.IP "\fB\-ftls\-model=\fR\fImodel\fR" 4
+.IX Item "-ftls-model=model"
+Alter the thread-local storage model to be used.
+The \fImodel\fR argument should be one of \f(CW\*(C`global\-dynamic\*(C'\fR,
+\&\f(CW\*(C`local\-dynamic\*(C'\fR, \f(CW\*(C`initial\-exec\*(C'\fR or \f(CW\*(C`local\-exec\*(C'\fR.
+.Sp
+The default without \fB\-fpic\fR is \f(CW\*(C`initial\-exec\*(C'\fR; with
+\&\fB\-fpic\fR the default is \f(CW\*(C`global\-dynamic\*(C'\fR.
+.IP "\fB\-fvisibility=\fR\fIdefault|internal|hidden|protected\fR" 4
+.IX Item "-fvisibility=default|internal|hidden|protected"
+Set the default \s-1ELF\s0 image symbol visibility to the specified option\-\-\-all
+symbols will be marked with this unless overridden within the code.
+Using this feature can very substantially improve linking and
+load times of shared object libraries, produce more optimized
+code, provide near-perfect \s-1API\s0 export and prevent symbol clashes.
+It is \fBstrongly\fR recommended that you use this in any shared objects
+you distribute.
+.Sp
+Despite the nomenclature, \f(CW\*(C`default\*(C'\fR always means public ie;
+available to be linked against from outside the shared object.
+\&\f(CW\*(C`protected\*(C'\fR and \f(CW\*(C`internal\*(C'\fR are pretty useless in real-world
+usage so the only other commonly used option will be \f(CW\*(C`hidden\*(C'\fR.
+The default if \fB\-fvisibility\fR isn't specified is
+\&\f(CW\*(C`default\*(C'\fR, i.e., make every
+symbol public\-\-\-this causes the same behavior as previous versions of
+\&\s-1GCC\s0.
+.Sp
+A good explanation of the benefits offered by ensuring \s-1ELF\s0
+symbols have the correct visibility is given by \*(L"How To Write
+Shared Libraries\*(R" by Ulrich Drepper (which can be found at
+<\fBhttp://people.redhat.com/~drepper/\fR>)\-\-\-however a superior
+solution made possible by this option to marking things hidden when
+the default is public is to make the default hidden and mark things
+public. This is the norm with \s-1DLL\s0's on Windows and with \fB\-fvisibility=hidden\fR
+and \f(CW\*(C`_\|_attribute_\|_ ((visibility("default")))\*(C'\fR instead of
+\&\f(CW\*(C`_\|_declspec(dllexport)\*(C'\fR you get almost identical semantics with
+identical syntax. This is a great boon to those working with
+cross-platform projects.
+.Sp
+For those adding visibility support to existing code, you may find
+\&\fB#pragma \s-1GCC\s0 visibility\fR of use. This works by you enclosing
+the declarations you wish to set visibility for with (for example)
+\&\fB#pragma \s-1GCC\s0 visibility push(hidden)\fR and
+\&\fB#pragma \s-1GCC\s0 visibility pop\fR.
+Bear in mind that symbol visibility should be viewed \fBas
+part of the \s-1API\s0 interface contract\fR and thus all new code should
+always specify visibility when it is not the default ie; declarations
+only for use within the local \s-1DSO\s0 should \fBalways\fR be marked explicitly
+as hidden as so to avoid \s-1PLT\s0 indirection overheads\-\-\-making this
+abundantly clear also aids readability and self-documentation of the code.
+Note that due to \s-1ISO\s0 \*(C+ specification requirements, operator new and
+operator delete must always be of default visibility.
+.Sp
+Be aware that headers from outside your project, in particular system
+headers and headers from any other library you use, may not be
+expecting to be compiled with visibility other than the default. You
+may need to explicitly say \fB#pragma \s-1GCC\s0 visibility push(default)\fR
+before including any such headers.
+.Sp
+\&\fBextern\fR declarations are not affected by \fB\-fvisibility\fR, so
+a lot of code can be recompiled with \fB\-fvisibility=hidden\fR with
+no modifications. However, this means that calls to \fBextern\fR
+functions with no explicit visibility will use the \s-1PLT\s0, so it is more
+effective to use \fB_\|_attribute ((visibility))\fR and/or
+\&\fB#pragma \s-1GCC\s0 visibility\fR to tell the compiler which \fBextern\fR
+declarations should be treated as hidden.
+.Sp
+Note that \fB\-fvisibility\fR does affect \*(C+ vague linkage
+entities. This means that, for instance, an exception class that will
+be thrown between DSOs must be explicitly marked with default
+visibility so that the \fBtype_info\fR nodes will be unified between
+the DSOs.
+.Sp
+An overview of these techniques, their benefits and how to use them
+is at <\fBhttp://gcc.gnu.org/wiki/Visibility\fR>.
+.SH "ENVIRONMENT"
+.IX Header "ENVIRONMENT"
+This section describes several environment variables that affect how \s-1GCC\s0
+operates. Some of them work by specifying directories or prefixes to use
+when searching for various kinds of files. Some are used to specify other
+aspects of the compilation environment.
+.PP
+Note that you can also specify places to search using options such as
+\&\fB\-B\fR, \fB\-I\fR and \fB\-L\fR. These
+take precedence over places specified using environment variables, which
+in turn take precedence over those specified by the configuration of \s-1GCC\s0.
+.IP "\fB\s-1LANG\s0\fR" 4
+.IX Item "LANG"
+.PD 0
+.IP "\fB\s-1LC_CTYPE\s0\fR" 4
+.IX Item "LC_CTYPE"
+.IP "\fB\s-1LC_MESSAGES\s0\fR" 4
+.IX Item "LC_MESSAGES"
+.IP "\fB\s-1LC_ALL\s0\fR" 4
+.IX Item "LC_ALL"
+.PD
+These environment variables control the way that \s-1GCC\s0 uses
+localization information that allow \s-1GCC\s0 to work with different
+national conventions. \s-1GCC\s0 inspects the locale categories
+\&\fB\s-1LC_CTYPE\s0\fR and \fB\s-1LC_MESSAGES\s0\fR if it has been configured to do
+so. These locale categories can be set to any value supported by your
+installation. A typical value is \fBen_GB.UTF\-8\fR for English in the United
+Kingdom encoded in \s-1UTF\-8\s0.
+.Sp
+The \fB\s-1LC_CTYPE\s0\fR environment variable specifies character
+classification. \s-1GCC\s0 uses it to determine the character boundaries in
+a string; this is needed for some multibyte encodings that contain quote
+and escape characters that would otherwise be interpreted as a string
+end or escape.
+.Sp
+The \fB\s-1LC_MESSAGES\s0\fR environment variable specifies the language to
+use in diagnostic messages.
+.Sp
+If the \fB\s-1LC_ALL\s0\fR environment variable is set, it overrides the value
+of \fB\s-1LC_CTYPE\s0\fR and \fB\s-1LC_MESSAGES\s0\fR; otherwise, \fB\s-1LC_CTYPE\s0\fR
+and \fB\s-1LC_MESSAGES\s0\fR default to the value of the \fB\s-1LANG\s0\fR
+environment variable. If none of these variables are set, \s-1GCC\s0
+defaults to traditional C English behavior.
+.IP "\fB\s-1TMPDIR\s0\fR" 4
+.IX Item "TMPDIR"
+If \fB\s-1TMPDIR\s0\fR is set, it specifies the directory to use for temporary
+files. \s-1GCC\s0 uses temporary files to hold the output of one stage of
+compilation which is to be used as input to the next stage: for example,
+the output of the preprocessor, which is the input to the compiler
+proper.
+.IP "\fB\s-1GCC_EXEC_PREFIX\s0\fR" 4
+.IX Item "GCC_EXEC_PREFIX"
+If \fB\s-1GCC_EXEC_PREFIX\s0\fR is set, it specifies a prefix to use in the
+names of the subprograms executed by the compiler. No slash is added
+when this prefix is combined with the name of a subprogram, but you can
+specify a prefix that ends with a slash if you wish.
+.Sp
+If \fB\s-1GCC_EXEC_PREFIX\s0\fR is not set, \s-1GCC\s0 will attempt to figure out
+an appropriate prefix to use based on the pathname it was invoked with.
+.Sp
+If \s-1GCC\s0 cannot find the subprogram using the specified prefix, it
+tries looking in the usual places for the subprogram.
+.Sp
+The default value of \fB\s-1GCC_EXEC_PREFIX\s0\fR is
+\&\fI\fIprefix\fI/lib/gcc/\fR where \fIprefix\fR is the prefix to
+the installed compiler. In many cases \fIprefix\fR is the value
+of \f(CW\*(C`prefix\*(C'\fR when you ran the \fIconfigure\fR script.
+.Sp
+Other prefixes specified with \fB\-B\fR take precedence over this prefix.
+.Sp
+This prefix is also used for finding files such as \fIcrt0.o\fR that are
+used for linking.
+.Sp
+In addition, the prefix is used in an unusual way in finding the
+directories to search for header files. For each of the standard
+directories whose name normally begins with \fB/usr/local/lib/gcc\fR
+(more precisely, with the value of \fB\s-1GCC_INCLUDE_DIR\s0\fR), \s-1GCC\s0 tries
+replacing that beginning with the specified prefix to produce an
+alternate directory name. Thus, with \fB\-Bfoo/\fR, \s-1GCC\s0 will search
+\&\fIfoo/bar\fR where it would normally search \fI/usr/local/lib/bar\fR.
+These alternate directories are searched first; the standard directories
+come next. If a standard directory begins with the configured
+\&\fIprefix\fR then the value of \fIprefix\fR is replaced by
+\&\fB\s-1GCC_EXEC_PREFIX\s0\fR when looking for header files.
+.IP "\fB\s-1COMPILER_PATH\s0\fR" 4
+.IX Item "COMPILER_PATH"
+The value of \fB\s-1COMPILER_PATH\s0\fR is a colon-separated list of
+directories, much like \fB\s-1PATH\s0\fR. \s-1GCC\s0 tries the directories thus
+specified when searching for subprograms, if it can't find the
+subprograms using \fB\s-1GCC_EXEC_PREFIX\s0\fR.
+.IP "\fB\s-1LIBRARY_PATH\s0\fR" 4
+.IX Item "LIBRARY_PATH"
+The value of \fB\s-1LIBRARY_PATH\s0\fR is a colon-separated list of
+directories, much like \fB\s-1PATH\s0\fR. When configured as a native compiler,
+\&\s-1GCC\s0 tries the directories thus specified when searching for special
+linker files, if it can't find them using \fB\s-1GCC_EXEC_PREFIX\s0\fR. Linking
+using \s-1GCC\s0 also uses these directories when searching for ordinary
+libraries for the \fB\-l\fR option (but directories specified with
+\&\fB\-L\fR come first).
+.IP "\fB\s-1LANG\s0\fR" 4
+.IX Item "LANG"
+This variable is used to pass locale information to the compiler. One way in
+which this information is used is to determine the character set to be used
+when character literals, string literals and comments are parsed in C and \*(C+.
+When the compiler is configured to allow multibyte characters,
+the following values for \fB\s-1LANG\s0\fR are recognized:
+.RS 4
+.IP "\fBC\-JIS\fR" 4
+.IX Item "C-JIS"
+Recognize \s-1JIS\s0 characters.
+.IP "\fBC\-SJIS\fR" 4
+.IX Item "C-SJIS"
+Recognize \s-1SJIS\s0 characters.
+.IP "\fBC\-EUCJP\fR" 4
+.IX Item "C-EUCJP"
+Recognize \s-1EUCJP\s0 characters.
+.RE
+.RS 4
+.Sp
+If \fB\s-1LANG\s0\fR is not defined, or if it has some other value, then the
+compiler will use mblen and mbtowc as defined by the default locale to
+recognize and translate multibyte characters.
+.RE
+.PP
+Some additional environments variables affect the behavior of the
+preprocessor.
+.IP "\fB\s-1CPATH\s0\fR" 4
+.IX Item "CPATH"
+.PD 0
+.IP "\fBC_INCLUDE_PATH\fR" 4
+.IX Item "C_INCLUDE_PATH"
+.IP "\fB\s-1CPLUS_INCLUDE_PATH\s0\fR" 4
+.IX Item "CPLUS_INCLUDE_PATH"
+.IP "\fB\s-1OBJC_INCLUDE_PATH\s0\fR" 4
+.IX Item "OBJC_INCLUDE_PATH"
+.PD
+Each variable's value is a list of directories separated by a special
+character, much like \fB\s-1PATH\s0\fR, in which to look for header files.
+The special character, \f(CW\*(C`PATH_SEPARATOR\*(C'\fR, is target-dependent and
+determined at \s-1GCC\s0 build time. For Microsoft Windows-based targets it is a
+semicolon, and for almost all other targets it is a colon.
+.Sp
+\&\fB\s-1CPATH\s0\fR specifies a list of directories to be searched as if
+specified with \fB\-I\fR, but after any paths given with \fB\-I\fR
+options on the command line. This environment variable is used
+regardless of which language is being preprocessed.
+.Sp
+The remaining environment variables apply only when preprocessing the
+particular language indicated. Each specifies a list of directories
+to be searched as if specified with \fB\-isystem\fR, but after any
+paths given with \fB\-isystem\fR options on the command line.
+.Sp
+In all these variables, an empty element instructs the compiler to
+search its current working directory. Empty elements can appear at the
+beginning or end of a path. For instance, if the value of
+\&\fB\s-1CPATH\s0\fR is \f(CW\*(C`:/special/include\*(C'\fR, that has the same
+effect as \fB\-I.\ \-I/special/include\fR.
+.IP "\fB\s-1DEPENDENCIES_OUTPUT\s0\fR" 4
+.IX Item "DEPENDENCIES_OUTPUT"
+If this variable is set, its value specifies how to output
+dependencies for Make based on the non-system header files processed
+by the compiler. System header files are ignored in the dependency
+output.
+.Sp
+The value of \fB\s-1DEPENDENCIES_OUTPUT\s0\fR can be just a file name, in
+which case the Make rules are written to that file, guessing the target
+name from the source file name. Or the value can have the form
+\&\fIfile\fR\fB \fR\fItarget\fR, in which case the rules are written to
+file \fIfile\fR using \fItarget\fR as the target name.
+.Sp
+In other words, this environment variable is equivalent to combining
+the options \fB\-MM\fR and \fB\-MF\fR,
+with an optional \fB\-MT\fR switch too.
+.IP "\fB\s-1SUNPRO_DEPENDENCIES\s0\fR" 4
+.IX Item "SUNPRO_DEPENDENCIES"
+This variable is the same as \fB\s-1DEPENDENCIES_OUTPUT\s0\fR (see above),
+except that system header files are not ignored, so it implies
+\&\fB\-M\fR rather than \fB\-MM\fR. However, the dependence on the
+main input file is omitted.
+.SH "BUGS"
+.IX Header "BUGS"
+For instructions on reporting bugs, see
+<\fBhttp://bugs.buildroot.net/\fR>.
+.SH "FOOTNOTES"
+.IX Header "FOOTNOTES"
+.IP "1." 4
+On some systems, \fBgcc \-shared\fR
+needs to build supplementary stub code for constructors to work. On
+multi-libbed systems, \fBgcc \-shared\fR must select the correct support
+libraries to link against. Failing to supply the correct flags may lead
+to subtle defects. Supplying them in cases where they are not necessary
+is innocuous.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fIgpl\fR\|(7), \fIgfdl\fR\|(7), \fIfsf\-funding\fR\|(7),
+\&\fIcpp\fR\|(1), \fIgcov\fR\|(1), \fIas\fR\|(1), \fIld\fR\|(1), \fIgdb\fR\|(1), \fIadb\fR\|(1), \fIdbx\fR\|(1), \fIsdb\fR\|(1)
+and the Info entries for \fIgcc\fR, \fIcpp\fR, \fIas\fR,
+\&\fIld\fR, \fIbinutils\fR and \fIgdb\fR.
+.SH "AUTHOR"
+.IX Header "AUTHOR"
+See the Info entry for \fBgcc\fR, or
+<\fBhttp://gcc.gnu.org/onlinedocs/gcc/Contributors.html\fR>,
+for contributors to \s-1GCC\s0.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being \*(L"\s-1GNU\s0 General Public License\*(R" and \*(L"Funding
+Free Software\*(R", the Front-Cover texts being (a) (see below), and with
+the Back-Cover Texts being (b) (see below). A copy of the license is
+included in the \fIgfdl\fR\|(7) man page.
+.PP
+(a) The \s-1FSF\s0's Front-Cover Text is:
+.PP
+.Vb 1
+\& A GNU Manual
+.Ve
+.PP
+(b) The \s-1FSF\s0's Back-Cover Text is:
+.PP
+.Vb 3
+\& You have freedom to copy and modify this GNU Manual, like GNU
+\& software. Copies published by the Free Software Foundation raise
+\& funds for GNU development.
+.Ve
+.SH "POD ERRORS"
+.IX Header "POD ERRORS"
+Hey! \fBThe above document had some coding errors, which are explained below:\fR
+.IP "Around line 8736:" 4
+.IX Item "Around line 8736:"
+You can't have =items (as at line 8749) unless the first thing after the =over is an =item
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/man/man1/mips-linux-uclibc-gcc.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/man/man1/mips-linux-uclibc-gcc.1
new file mode 100644
index 0000000..9db3170
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/man/man1/mips-linux-uclibc-gcc.1
@@ -0,0 +1,15367 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "GCC 1"
+.TH GCC 1 "2010-01-29" "gcc-4.4.2" "GNU"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+gcc \- GNU project C and C++ compiler
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+gcc [\fB\-c\fR|\fB\-S\fR|\fB\-E\fR] [\fB\-std=\fR\fIstandard\fR]
+ [\fB\-g\fR] [\fB\-pg\fR] [\fB\-O\fR\fIlevel\fR]
+ [\fB\-W\fR\fIwarn\fR...] [\fB\-pedantic\fR]
+ [\fB\-I\fR\fIdir\fR...] [\fB\-L\fR\fIdir\fR...]
+ [\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR]
+ [\fB\-f\fR\fIoption\fR...] [\fB\-m\fR\fImachine-option\fR...]
+ [\fB\-o\fR \fIoutfile\fR] [@\fIfile\fR] \fIinfile\fR...
+.PP
+Only the most useful options are listed here; see below for the
+remainder. \fBg++\fR accepts mostly the same options as \fBgcc\fR.
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+When you invoke \s-1GCC\s0, it normally does preprocessing, compilation,
+assembly and linking. The \*(L"overall options\*(R" allow you to stop this
+process at an intermediate stage. For example, the \fB\-c\fR option
+says not to run the linker. Then the output consists of object files
+output by the assembler.
+.PP
+Other options are passed on to one stage of processing. Some options
+control the preprocessor and others the compiler itself. Yet other
+options control the assembler and linker; most of these are not
+documented here, since you rarely need to use any of them.
+.PP
+Most of the command line options that you can use with \s-1GCC\s0 are useful
+for C programs; when an option is only useful with another language
+(usually \*(C+), the explanation says so explicitly. If the description
+for a particular option does not mention a source language, you can use
+that option with all supported languages.
+.PP
+The \fBgcc\fR program accepts options and file names as operands. Many
+options have multi-letter names; therefore multiple single-letter options
+may \fInot\fR be grouped: \fB\-dv\fR is very different from \fB\-d\ \-v\fR.
+.PP
+You can mix options and other arguments. For the most part, the order
+you use doesn't matter. Order does matter when you use several
+options of the same kind; for example, if you specify \fB\-L\fR more
+than once, the directories are searched in the order specified. Also,
+the placement of the \fB\-l\fR option is significant.
+.PP
+Many options have long names starting with \fB\-f\fR or with
+\&\fB\-W\fR\-\-\-for example,
+\&\fB\-fmove\-loop\-invariants\fR, \fB\-Wformat\fR and so on. Most of
+these have both positive and negative forms; the negative form of
+\&\fB\-ffoo\fR would be \fB\-fno\-foo\fR. This manual documents
+only one of these two forms, whichever one is not the default.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+.Sh "Option Summary"
+.IX Subsection "Option Summary"
+Here is a summary of all the options, grouped by type. Explanations are
+in the following sections.
+.IP "\fIOverall Options\fR" 4
+.IX Item "Overall Options"
+\&\fB\-c \-S \-E \-o\fR \fIfile\fR \fB\-combine \-pipe \-pass\-exit\-codes
+\&\-x\fR \fIlanguage\fR \fB\-v \-### \-\-help\fR[\fB=\fR\fIclass\fR[\fB,...\fR]] \fB\-\-target\-help
+\&\-\-version \-wrapper@\fR\fIfile\fR
+.IP "\fIC Language Options\fR" 4
+.IX Item "C Language Options"
+\&\fB\-ansi \-std=\fR\fIstandard\fR \fB\-fgnu89\-inline
+\&\-aux\-info\fR \fIfilename\fR
+\&\fB\-fno\-asm \-fno\-builtin \-fno\-builtin\-\fR\fIfunction\fR
+\&\fB\-fhosted \-ffreestanding \-fopenmp \-fms\-extensions
+\&\-trigraphs \-no\-integrated\-cpp \-traditional \-traditional\-cpp
+\&\-fallow\-single\-precision \-fcond\-mismatch \-flax\-vector\-conversions
+\&\-fsigned\-bitfields \-fsigned\-char
+\&\-funsigned\-bitfields \-funsigned\-char\fR
+.IP "\fI\*(C+ Language Options\fR" 4
+.IX Item " Language Options"
+\&\fB\-fabi\-version=\fR\fIn\fR \fB\-fno\-access\-control \-fcheck\-new
+\&\-fconserve\-space \-ffriend\-injection
+\&\-fno\-elide\-constructors
+\&\-fno\-enforce\-eh\-specs
+\&\-ffor\-scope \-fno\-for\-scope \-fno\-gnu\-keywords
+\&\-fno\-implicit\-templates
+\&\-fno\-implicit\-inline\-templates
+\&\-fno\-implement\-inlines \-fms\-extensions
+\&\-fno\-nonansi\-builtins \-fno\-operator\-names
+\&\-fno\-optional\-diags \-fpermissive
+\&\-frepo \-fno\-rtti \-fstats \-ftemplate\-depth\-\fR\fIn\fR
+\&\fB\-fno\-threadsafe\-statics \-fuse\-cxa\-atexit \-fno\-weak \-nostdinc++
+\&\-fno\-default\-inline \-fvisibility\-inlines\-hidden
+\&\-fvisibility\-ms\-compat
+\&\-Wabi \-Wctor\-dtor\-privacy
+\&\-Wnon\-virtual\-dtor \-Wreorder
+\&\-Weffc++ \-Wstrict\-null\-sentinel
+\&\-Wno\-non\-template\-friend \-Wold\-style\-cast
+\&\-Woverloaded\-virtual \-Wno\-pmf\-conversions
+\&\-Wsign\-promo\fR
+.IP "\fIObjective-C and Objective\-\*(C+ Language Options\fR" 4
+.IX Item "Objective-C and Objective- Language Options"
+\&\fB\-fconstant\-string\-class=\fR\fIclass-name\fR
+\&\fB\-fgnu\-runtime \-fnext\-runtime
+\&\-fno\-nil\-receivers
+\&\-fobjc\-call\-cxx\-cdtors
+\&\-fobjc\-direct\-dispatch
+\&\-fobjc\-exceptions
+\&\-fobjc\-gc
+\&\-freplace\-objc\-classes
+\&\-fzero\-link
+\&\-gen\-decls
+\&\-Wassign\-intercept
+\&\-Wno\-protocol \-Wselector
+\&\-Wstrict\-selector\-match
+\&\-Wundeclared\-selector\fR
+.IP "\fILanguage Independent Options\fR" 4
+.IX Item "Language Independent Options"
+\&\fB\-fmessage\-length=\fR\fIn\fR
+\&\fB\-fdiagnostics\-show\-location=\fR[\fBonce\fR|\fBevery-line\fR]
+\&\fB\-fdiagnostics\-show\-option\fR
+.IP "\fIWarning Options\fR" 4
+.IX Item "Warning Options"
+\&\fB\-fsyntax\-only \-pedantic \-pedantic\-errors
+\&\-w \-Wextra \-Wall \-Waddress \-Waggregate\-return \-Warray\-bounds
+\&\-Wno\-attributes \-Wno\-builtin\-macro\-redefined
+\&\-Wc++\-compat \-Wc++0x\-compat \-Wcast\-align \-Wcast\-qual
+\&\-Wchar\-subscripts \-Wclobbered \-Wcomment
+\&\-Wconversion \-Wcoverage\-mismatch \-Wno\-deprecated
+\&\-Wno\-deprecated\-declarations \-Wdisabled\-optimization
+\&\-Wno\-div\-by\-zero \-Wempty\-body \-Wenum\-compare \-Wno\-endif\-labels
+\&\-Werror \-Werror=*
+\&\-Wfatal\-errors \-Wfloat\-equal \-Wformat \-Wformat=2
+\&\-Wno\-format\-contains\-nul \-Wno\-format\-extra\-args \-Wformat\-nonliteral
+\&\-Wformat\-security \-Wformat\-y2k
+\&\-Wframe\-larger\-than=\fR\fIlen\fR \fB\-Wignored\-qualifiers
+\&\-Wimplicit \-Wimplicit\-function\-declaration \-Wimplicit\-int
+\&\-Winit\-self \-Winline
+\&\-Wno\-int\-to\-pointer\-cast \-Wno\-invalid\-offsetof
+\&\-Winvalid\-pch \-Wlarger\-than=\fR\fIlen\fR \fB\-Wunsafe\-loop\-optimizations
+\&\-Wlogical\-op \-Wlong\-long
+\&\-Wmain \-Wmissing\-braces \-Wmissing\-field\-initializers
+\&\-Wmissing\-format\-attribute \-Wmissing\-include\-dirs
+\&\-Wmissing\-noreturn \-Wno\-mudflap
+\&\-Wno\-multichar \-Wnonnull \-Wno\-overflow
+\&\-Woverlength\-strings \-Wpacked \-Wpacked\-bitfield\-compat \-Wpadded
+\&\-Wparentheses \-Wpedantic\-ms\-format \-Wno\-pedantic\-ms\-format
+\&\-Wpointer\-arith \-Wno\-pointer\-to\-int\-cast
+\&\-Wredundant\-decls
+\&\-Wreturn\-type \-Wsequence\-point \-Wshadow
+\&\-Wsign\-compare \-Wsign\-conversion \-Wstack\-protector
+\&\-Wstrict\-aliasing \-Wstrict\-aliasing=n
+\&\-Wstrict\-overflow \-Wstrict\-overflow=\fR\fIn\fR
+\&\fB\-Wswitch \-Wswitch\-default \-Wswitch\-enum \-Wsync\-nand
+\&\-Wsystem\-headers \-Wtrigraphs \-Wtype\-limits \-Wundef \-Wuninitialized
+\&\-Wunknown\-pragmas \-Wno\-pragmas \-Wunreachable\-code
+\&\-Wunused \-Wunused\-function \-Wunused\-label \-Wunused\-parameter
+\&\-Wunused\-value \-Wunused\-variable
+\&\-Wvariadic\-macros \-Wvla
+\&\-Wvolatile\-register\-var \-Wwrite\-strings\fR
+.IP "\fIC and Objective-C-only Warning Options\fR" 4
+.IX Item "C and Objective-C-only Warning Options"
+\&\fB\-Wbad\-function\-cast \-Wmissing\-declarations
+\&\-Wmissing\-parameter\-type \-Wmissing\-prototypes \-Wnested\-externs
+\&\-Wold\-style\-declaration \-Wold\-style\-definition
+\&\-Wstrict\-prototypes \-Wtraditional \-Wtraditional\-conversion
+\&\-Wdeclaration\-after\-statement \-Wpointer\-sign\fR
+.IP "\fIDebugging Options\fR" 4
+.IX Item "Debugging Options"
+\&\fB\-d\fR\fIletters\fR \fB\-dumpspecs \-dumpmachine \-dumpversion
+\&\-fdbg\-cnt\-list \-fdbg\-cnt=\fR\fIcounter-value-list\fR
+\&\fB\-fdump\-noaddr \-fdump\-unnumbered
+\&\-fdump\-translation\-unit\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-class\-hierarchy\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-ipa\-all \-fdump\-ipa\-cgraph \-fdump\-ipa\-inline
+\&\-fdump\-statistics
+\&\-fdump\-tree\-all
+\&\-fdump\-tree\-original\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-optimized\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-cfg \-fdump\-tree\-vcg \-fdump\-tree\-alias
+\&\-fdump\-tree\-ch
+\&\-fdump\-tree\-ssa\fR[\fB\-\fR\fIn\fR] \fB\-fdump\-tree\-pre\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-ccp\fR[\fB\-\fR\fIn\fR] \fB\-fdump\-tree\-dce\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-gimple\fR[\fB\-raw\fR] \fB\-fdump\-tree\-mudflap\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-dom\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-dse\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-phiopt\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-forwprop\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-copyrename\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-nrv \-fdump\-tree\-vect
+\&\-fdump\-tree\-sink
+\&\-fdump\-tree\-sra\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-fre\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-tree\-vrp\fR[\fB\-\fR\fIn\fR]
+\&\fB\-ftree\-vectorizer\-verbose=\fR\fIn\fR
+\&\fB\-fdump\-tree\-storeccp\fR[\fB\-\fR\fIn\fR]
+\&\fB\-feliminate\-dwarf2\-dups \-feliminate\-unused\-debug\-types
+\&\-feliminate\-unused\-debug\-symbols \-femit\-class\-debug\-always
+\&\-fmem\-report \-fpre\-ipa\-mem\-report \-fpost\-ipa\-mem\-report \-fprofile\-arcs
+\&\-frandom\-seed=\fR\fIstring\fR \fB\-fsched\-verbose=\fR\fIn\fR
+\&\fB\-fsel\-sched\-verbose \-fsel\-sched\-dump\-cfg \-fsel\-sched\-pipelining\-verbose
+\&\-ftest\-coverage \-ftime\-report \-fvar\-tracking
+\&\-g \-g\fR\fIlevel\fR \fB\-gcoff \-gdwarf\-2
+\&\-ggdb \-gstabs \-gstabs+ \-gvms \-gxcoff \-gxcoff+
+\&\-fno\-merge\-debug\-strings \-fno\-dwarf2\-cfi\-asm
+\&\-fdebug\-prefix\-map=\fR\fIold\fR\fB=\fR\fInew\fR
+\&\fB\-femit\-struct\-debug\-baseonly \-femit\-struct\-debug\-reduced
+\&\-femit\-struct\-debug\-detailed\fR[\fB=\fR\fIspec-list\fR]
+\&\fB\-p \-pg \-print\-file\-name=\fR\fIlibrary\fR \fB\-print\-libgcc\-file\-name
+\&\-print\-multi\-directory \-print\-multi\-lib
+\&\-print\-prog\-name=\fR\fIprogram\fR \fB\-print\-search\-dirs \-Q
+\&\-print\-sysroot \-print\-sysroot\-headers\-suffix
+\&\-save\-temps \-time\fR
+.IP "\fIOptimization Options\fR" 4
+.IX Item "Optimization Options"
+\&\fB\-falign\-functions[=\fR\fIn\fR\fB] \-falign\-jumps[=\fR\fIn\fR\fB]
+\&\-falign\-labels[=\fR\fIn\fR\fB] \-falign\-loops[=\fR\fIn\fR\fB] \-fassociative\-math
+\&\-fauto\-inc\-dec \-fbranch\-probabilities \-fbranch\-target\-load\-optimize
+\&\-fbranch\-target\-load\-optimize2 \-fbtr\-bb\-exclusive \-fcaller\-saves
+\&\-fcheck\-data\-deps \-fconserve\-stack \-fcprop\-registers \-fcrossjumping
+\&\-fcse\-follow\-jumps \-fcse\-skip\-blocks \-fcx\-fortran\-rules \-fcx\-limited\-range
+\&\-fdata\-sections \-fdce \-fdce
+\&\-fdelayed\-branch \-fdelete\-null\-pointer\-checks \-fdse \-fdse
+\&\-fearly\-inlining \-fexpensive\-optimizations \-ffast\-math
+\&\-ffinite\-math\-only \-ffloat\-store \-fforward\-propagate
+\&\-ffunction\-sections \-fgcse \-fgcse\-after\-reload \-fgcse\-las \-fgcse\-lm
+\&\-fgcse\-sm \-fif\-conversion \-fif\-conversion2 \-findirect\-inlining
+\&\-finline\-functions \-finline\-functions\-called\-once \-finline\-limit=\fR\fIn\fR
+\&\fB\-finline\-small\-functions \-fipa\-cp \-fipa\-cp\-clone \-fipa\-matrix\-reorg \-fipa\-pta
+\&\-fipa\-pure\-const \-fipa\-reference \-fipa\-struct\-reorg
+\&\-fipa\-type\-escape \-fira\-algorithm=\fR\fIalgorithm\fR
+\&\fB\-fira\-region=\fR\fIregion\fR \fB\-fira\-coalesce \-fno\-ira\-share\-save\-slots
+\&\-fno\-ira\-share\-spill\-slots \-fira\-verbose=\fR\fIn\fR
+\&\fB\-fivopts \-fkeep\-inline\-functions \-fkeep\-static\-consts
+\&\-floop\-block \-floop\-interchange \-floop\-strip\-mine
+\&\-fmerge\-all\-constants \-fmerge\-constants \-fmodulo\-sched
+\&\-fmodulo\-sched\-allow\-regmoves \-fmove\-loop\-invariants \-fmudflap
+\&\-fmudflapir \-fmudflapth \-fno\-branch\-count\-reg \-fno\-default\-inline
+\&\-fno\-defer\-pop \-fno\-function\-cse \-fno\-guess\-branch\-probability
+\&\-fno\-inline \-fno\-math\-errno \-fno\-peephole \-fno\-peephole2
+\&\-fno\-sched\-interblock \-fno\-sched\-spec \-fno\-signed\-zeros
+\&\-fno\-toplevel\-reorder \-fno\-trapping\-math \-fno\-zero\-initialized\-in\-bss
+\&\-fomit\-frame\-pointer \-foptimize\-register\-move \-foptimize\-sibling\-calls
+\&\-fpeel\-loops \-fpredictive\-commoning \-fprefetch\-loop\-arrays
+\&\-fprofile\-correction \-fprofile\-dir=\fR\fIpath\fR \fB\-fprofile\-generate
+\&\-fprofile\-generate=\fR\fIpath\fR
+\&\fB\-fprofile\-use \-fprofile\-use=\fR\fIpath\fR \fB\-fprofile\-values
+\&\-freciprocal\-math \-fregmove \-frename\-registers \-freorder\-blocks
+\&\-freorder\-blocks\-and\-partition \-freorder\-functions
+\&\-frerun\-cse\-after\-loop \-freschedule\-modulo\-scheduled\-loops
+\&\-frounding\-math \-frtl\-abstract\-sequences \-fsched2\-use\-superblocks
+\&\-fsched2\-use\-traces \-fsched\-spec\-load \-fsched\-spec\-load\-dangerous
+\&\-fsched\-stalled\-insns\-dep[=\fR\fIn\fR\fB] \-fsched\-stalled\-insns[=\fR\fIn\fR\fB]
+\&\-fschedule\-insns \-fschedule\-insns2 \-fsection\-anchors \-fsee
+\&\-fselective\-scheduling \-fselective\-scheduling2
+\&\-fsel\-sched\-pipelining \-fsel\-sched\-pipelining\-outer\-loops
+\&\-fsignaling\-nans \-fsingle\-precision\-constant \-fsplit\-ivs\-in\-unroller
+\&\-fsplit\-wide\-types \-fstack\-protector \-fstack\-protector\-all
+\&\-fstrict\-aliasing \-fstrict\-overflow \-fthread\-jumps \-ftracer
+\&\-ftree\-builtin\-call\-dce \-ftree\-ccp \-ftree\-ch \-ftree\-copy\-prop
+\&\-ftree\-copyrename \-ftree\-dce
+\&\-ftree\-dominator\-opts \-ftree\-dse \-ftree\-fre \-ftree\-loop\-im
+\&\-ftree\-loop\-distribution
+\&\-ftree\-loop\-ivcanon \-ftree\-loop\-linear \-ftree\-loop\-optimize
+\&\-ftree\-parallelize\-loops=\fR\fIn\fR \fB\-ftree\-pre \-ftree\-reassoc
+\&\-ftree\-sink \-ftree\-sra \-ftree\-switch\-conversion
+\&\-ftree\-ter \-ftree\-vect\-loop\-version \-ftree\-vectorize \-ftree\-vrp
+\&\-funit\-at\-a\-time \-funroll\-all\-loops \-funroll\-loops
+\&\-funsafe\-loop\-optimizations \-funsafe\-math\-optimizations \-funswitch\-loops
+\&\-fvariable\-expansion\-in\-unroller \-fvect\-cost\-model \-fvpt \-fweb
+\&\-fwhole\-program
+\&\-\-param\fR \fIname\fR\fB=\fR\fIvalue\fR
+\&\fB\-O \-O0 \-O1 \-O2 \-O3 \-Os\fR
+.IP "\fIPreprocessor Options\fR" 4
+.IX Item "Preprocessor Options"
+\&\fB\-A\fR\fIquestion\fR\fB=\fR\fIanswer\fR
+\&\fB\-A\-\fR\fIquestion\fR[\fB=\fR\fIanswer\fR]
+\&\fB\-C \-dD \-dI \-dM \-dN
+\&\-D\fR\fImacro\fR[\fB=\fR\fIdefn\fR] \fB\-E \-H
+\&\-idirafter\fR \fIdir\fR
+\&\fB\-include\fR \fIfile\fR \fB\-imacros\fR \fIfile\fR
+\&\fB\-iprefix\fR \fIfile\fR \fB\-iwithprefix\fR \fIdir\fR
+\&\fB\-iwithprefixbefore\fR \fIdir\fR \fB\-isystem\fR \fIdir\fR
+\&\fB\-imultilib\fR \fIdir\fR \fB\-isysroot\fR \fIdir\fR
+\&\fB\-M \-MM \-MF \-MG \-MP \-MQ \-MT \-nostdinc
+\&\-P \-fworking\-directory \-remap
+\&\-trigraphs \-undef \-U\fR\fImacro\fR \fB\-Wp,\fR\fIoption\fR
+\&\fB\-Xpreprocessor\fR \fIoption\fR
+.IP "\fIAssembler Option\fR" 4
+.IX Item "Assembler Option"
+\&\fB\-Wa,\fR\fIoption\fR \fB\-Xassembler\fR \fIoption\fR
+.IP "\fILinker Options\fR" 4
+.IX Item "Linker Options"
+\&\fIobject-file-name\fR \fB\-l\fR\fIlibrary\fR
+\&\fB\-nostartfiles \-nodefaultlibs \-nostdlib \-pie \-rdynamic
+\&\-s \-static \-static\-libgcc \-shared \-shared\-libgcc \-symbolic
+\&\-T\fR \fIscript\fR \fB\-Wl,\fR\fIoption\fR \fB\-Xlinker\fR \fIoption\fR
+\&\fB\-u\fR \fIsymbol\fR
+.IP "\fIDirectory Options\fR" 4
+.IX Item "Directory Options"
+\&\fB\-B\fR\fIprefix\fR \fB\-I\fR\fIdir\fR \fB\-iquote\fR\fIdir\fR \fB\-L\fR\fIdir\fR
+\&\fB\-specs=\fR\fIfile\fR \fB\-I\- \-\-sysroot=\fR\fIdir\fR
+.IP "\fITarget Options\fR" 4
+.IX Item "Target Options"
+\&\fB\-V\fR \fIversion\fR \fB\-b\fR \fImachine\fR
+.IP "\fIMachine Dependent Options\fR" 4
+.IX Item "Machine Dependent Options"
+\&\fI\s-1ARC\s0 Options\fR
+\&\fB\-EB \-EL
+\&\-mmangle\-cpu \-mcpu=\fR\fIcpu\fR \fB\-mtext=\fR\fItext-section\fR
+\&\fB\-mdata=\fR\fIdata-section\fR \fB\-mrodata=\fR\fIreadonly-data-section\fR
+.Sp
+\&\fI\s-1ARM\s0 Options\fR
+\&\fB\-mapcs\-frame \-mno\-apcs\-frame
+\&\-mabi=\fR\fIname\fR
+\&\fB\-mapcs\-stack\-check \-mno\-apcs\-stack\-check
+\&\-mapcs\-float \-mno\-apcs\-float
+\&\-mapcs\-reentrant \-mno\-apcs\-reentrant
+\&\-msched\-prolog \-mno\-sched\-prolog
+\&\-mlittle\-endian \-mbig\-endian \-mwords\-little\-endian
+\&\-mfloat\-abi=\fR\fIname\fR \fB\-msoft\-float \-mhard\-float \-mfpe
+\&\-mthumb\-interwork \-mno\-thumb\-interwork
+\&\-mcpu=\fR\fIname\fR \fB\-march=\fR\fIname\fR \fB\-mfpu=\fR\fIname\fR
+\&\fB\-mstructure\-size\-boundary=\fR\fIn\fR
+\&\fB\-mabort\-on\-noreturn
+\&\-mlong\-calls \-mno\-long\-calls
+\&\-msingle\-pic\-base \-mno\-single\-pic\-base
+\&\-mpic\-register=\fR\fIreg\fR
+\&\fB\-mnop\-fun\-dllimport
+\&\-mcirrus\-fix\-invalid\-insns \-mno\-cirrus\-fix\-invalid\-insns
+\&\-mpoke\-function\-name
+\&\-mthumb \-marm
+\&\-mtpcs\-frame \-mtpcs\-leaf\-frame
+\&\-mcaller\-super\-interworking \-mcallee\-super\-interworking
+\&\-mtp=\fR\fIname\fR
+\&\fB\-mword\-relocations
+\&\-mfix\-cortex\-m3\-ldrd\fR
+.Sp
+\&\fI\s-1AVR\s0 Options\fR
+\&\fB\-mmcu=\fR\fImcu\fR \fB\-msize \-mno\-interrupts
+\&\-mcall\-prologues \-mno\-tablejump \-mtiny\-stack \-mint8\fR
+.Sp
+\&\fIBlackfin Options\fR
+\&\fB\-mcpu=\fR\fIcpu\fR[\fB\-\fR\fIsirevision\fR]
+\&\fB\-msim \-momit\-leaf\-frame\-pointer \-mno\-omit\-leaf\-frame\-pointer
+\&\-mspecld\-anomaly \-mno\-specld\-anomaly \-mcsync\-anomaly \-mno\-csync\-anomaly
+\&\-mlow\-64k \-mno\-low64k \-mstack\-check\-l1 \-mid\-shared\-library
+\&\-mno\-id\-shared\-library \-mshared\-library\-id=\fR\fIn\fR
+\&\fB\-mleaf\-id\-shared\-library \-mno\-leaf\-id\-shared\-library
+\&\-msep\-data \-mno\-sep\-data \-mlong\-calls \-mno\-long\-calls
+\&\-mfast\-fp \-minline\-plt \-mmulticore \-mcorea \-mcoreb \-msdram
+\&\-micplb\fR
+.Sp
+\&\fI\s-1CRIS\s0 Options\fR
+\&\fB\-mcpu=\fR\fIcpu\fR \fB\-march=\fR\fIcpu\fR \fB\-mtune=\fR\fIcpu\fR
+\&\fB\-mmax\-stack\-frame=\fR\fIn\fR \fB\-melinux\-stacksize=\fR\fIn\fR
+\&\fB\-metrax4 \-metrax100 \-mpdebug \-mcc\-init \-mno\-side\-effects
+\&\-mstack\-align \-mdata\-align \-mconst\-align
+\&\-m32\-bit \-m16\-bit \-m8\-bit \-mno\-prologue\-epilogue \-mno\-gotplt
+\&\-melf \-maout \-melinux \-mlinux \-sim \-sim2
+\&\-mmul\-bug\-workaround \-mno\-mul\-bug\-workaround\fR
+.Sp
+\&\fI\s-1CRX\s0 Options\fR
+\&\fB\-mmac \-mpush\-args\fR
+.Sp
+\&\fIDarwin Options\fR
+\&\fB\-all_load \-allowable_client \-arch \-arch_errors_fatal
+\&\-arch_only \-bind_at_load \-bundle \-bundle_loader
+\&\-client_name \-compatibility_version \-current_version
+\&\-dead_strip
+\&\-dependency\-file \-dylib_file \-dylinker_install_name
+\&\-dynamic \-dynamiclib \-exported_symbols_list
+\&\-filelist \-flat_namespace \-force_cpusubtype_ALL
+\&\-force_flat_namespace \-headerpad_max_install_names
+\&\-iframework
+\&\-image_base \-init \-install_name \-keep_private_externs
+\&\-multi_module \-multiply_defined \-multiply_defined_unused
+\&\-noall_load \-no_dead_strip_inits_and_terms
+\&\-nofixprebinding \-nomultidefs \-noprebind \-noseglinkedit
+\&\-pagezero_size \-prebind \-prebind_all_twolevel_modules
+\&\-private_bundle \-read_only_relocs \-sectalign
+\&\-sectobjectsymbols \-whyload \-seg1addr
+\&\-sectcreate \-sectobjectsymbols \-sectorder
+\&\-segaddr \-segs_read_only_addr \-segs_read_write_addr
+\&\-seg_addr_table \-seg_addr_table_filename \-seglinkedit
+\&\-segprot \-segs_read_only_addr \-segs_read_write_addr
+\&\-single_module \-static \-sub_library \-sub_umbrella
+\&\-twolevel_namespace \-umbrella \-undefined
+\&\-unexported_symbols_list \-weak_reference_mismatches
+\&\-whatsloaded \-F \-gused \-gfull \-mmacosx\-version\-min=\fR\fIversion\fR
+\&\fB\-mkernel \-mone\-byte\-bool\fR
+.Sp
+\&\fI\s-1DEC\s0 Alpha Options\fR
+\&\fB\-mno\-fp\-regs \-msoft\-float \-malpha\-as \-mgas
+\&\-mieee \-mieee\-with\-inexact \-mieee\-conformant
+\&\-mfp\-trap\-mode=\fR\fImode\fR \fB\-mfp\-rounding\-mode=\fR\fImode\fR
+\&\fB\-mtrap\-precision=\fR\fImode\fR \fB\-mbuild\-constants
+\&\-mcpu=\fR\fIcpu-type\fR \fB\-mtune=\fR\fIcpu-type\fR
+\&\fB\-mbwx \-mmax \-mfix \-mcix
+\&\-mfloat\-vax \-mfloat\-ieee
+\&\-mexplicit\-relocs \-msmall\-data \-mlarge\-data
+\&\-msmall\-text \-mlarge\-text
+\&\-mmemory\-latency=\fR\fItime\fR
+.Sp
+\&\fI\s-1DEC\s0 Alpha/VMS Options\fR
+\&\fB\-mvms\-return\-codes\fR
+.Sp
+\&\fI\s-1FR30\s0 Options\fR
+\&\fB\-msmall\-model \-mno\-lsim\fR
+.Sp
+\&\fI\s-1FRV\s0 Options\fR
+\&\fB\-mgpr\-32 \-mgpr\-64 \-mfpr\-32 \-mfpr\-64
+\&\-mhard\-float \-msoft\-float
+\&\-malloc\-cc \-mfixed\-cc \-mdword \-mno\-dword
+\&\-mdouble \-mno\-double
+\&\-mmedia \-mno\-media \-mmuladd \-mno\-muladd
+\&\-mfdpic \-minline\-plt \-mgprel\-ro \-multilib\-library\-pic
+\&\-mlinked\-fp \-mlong\-calls \-malign\-labels
+\&\-mlibrary\-pic \-macc\-4 \-macc\-8
+\&\-mpack \-mno\-pack \-mno\-eflags \-mcond\-move \-mno\-cond\-move
+\&\-moptimize\-membar \-mno\-optimize\-membar
+\&\-mscc \-mno\-scc \-mcond\-exec \-mno\-cond\-exec
+\&\-mvliw\-branch \-mno\-vliw\-branch
+\&\-mmulti\-cond\-exec \-mno\-multi\-cond\-exec \-mnested\-cond\-exec
+\&\-mno\-nested\-cond\-exec \-mtomcat\-stats
+\&\-mTLS \-mtls
+\&\-mcpu=\fR\fIcpu\fR
+.Sp
+\&\fIGNU/Linux Options\fR
+\&\fB\-muclibc\fR
+.Sp
+\&\fIH8/300 Options\fR
+\&\fB\-mrelax \-mh \-ms \-mn \-mint32 \-malign\-300\fR
+.Sp
+\&\fI\s-1HPPA\s0 Options\fR
+\&\fB\-march=\fR\fIarchitecture-type\fR
+\&\fB\-mbig\-switch \-mdisable\-fpregs \-mdisable\-indexing
+\&\-mfast\-indirect\-calls \-mgas \-mgnu\-ld \-mhp\-ld
+\&\-mfixed\-range=\fR\fIregister-range\fR
+\&\fB\-mjump\-in\-delay \-mlinker\-opt \-mlong\-calls
+\&\-mlong\-load\-store \-mno\-big\-switch \-mno\-disable\-fpregs
+\&\-mno\-disable\-indexing \-mno\-fast\-indirect\-calls \-mno\-gas
+\&\-mno\-jump\-in\-delay \-mno\-long\-load\-store
+\&\-mno\-portable\-runtime \-mno\-soft\-float
+\&\-mno\-space\-regs \-msoft\-float \-mpa\-risc\-1\-0
+\&\-mpa\-risc\-1\-1 \-mpa\-risc\-2\-0 \-mportable\-runtime
+\&\-mschedule=\fR\fIcpu-type\fR \fB\-mspace\-regs \-msio \-mwsio
+\&\-munix=\fR\fIunix-std\fR \fB\-nolibdld \-static \-threads\fR
+.Sp
+\&\fIi386 and x86\-64 Options\fR
+\&\fB\-mtune=\fR\fIcpu-type\fR \fB\-march=\fR\fIcpu-type\fR
+\&\fB\-mfpmath=\fR\fIunit\fR
+\&\fB\-masm=\fR\fIdialect\fR \fB\-mno\-fancy\-math\-387
+\&\-mno\-fp\-ret\-in\-387 \-msoft\-float
+\&\-mno\-wide\-multiply \-mrtd \-malign\-double
+\&\-mpreferred\-stack\-boundary=\fR\fInum\fR
+\&\fB\-mincoming\-stack\-boundary=\fR\fInum\fR
+\&\fB\-mcld \-mcx16 \-msahf \-mrecip
+\&\-mmmx \-msse \-msse2 \-msse3 \-mssse3 \-msse4.1 \-msse4.2 \-msse4 \-mavx
+\&\-maes \-mpclmul
+\&\-msse4a \-m3dnow \-mpopcnt \-mabm \-msse5
+\&\-mthreads \-mno\-align\-stringops \-minline\-all\-stringops
+\&\-minline\-stringops\-dynamically \-mstringop\-strategy=\fR\fIalg\fR
+\&\fB\-mpush\-args \-maccumulate\-outgoing\-args \-m128bit\-long\-double
+\&\-m96bit\-long\-double \-mregparm=\fR\fInum\fR \fB\-msseregparm
+\&\-mveclibabi=\fR\fItype\fR \fB\-mpc32 \-mpc64 \-mpc80 \-mstackrealign
+\&\-momit\-leaf\-frame\-pointer \-mno\-red\-zone \-mno\-tls\-direct\-seg\-refs
+\&\-mcmodel=\fR\fIcode-model\fR
+\&\fB\-m32 \-m64 \-mlarge\-data\-threshold=\fR\fInum\fR
+\&\fB\-mfused\-madd \-mno\-fused\-madd \-msse2avx\fR
+.Sp
+\&\fI\s-1IA\-64\s0 Options\fR
+\&\fB\-mbig\-endian \-mlittle\-endian \-mgnu\-as \-mgnu\-ld \-mno\-pic
+\&\-mvolatile\-asm\-stop \-mregister\-names \-mno\-sdata
+\&\-mconstant\-gp \-mauto\-pic \-minline\-float\-divide\-min\-latency
+\&\-minline\-float\-divide\-max\-throughput
+\&\-minline\-int\-divide\-min\-latency
+\&\-minline\-int\-divide\-max\-throughput
+\&\-minline\-sqrt\-min\-latency \-minline\-sqrt\-max\-throughput
+\&\-mno\-dwarf2\-asm \-mearly\-stop\-bits
+\&\-mfixed\-range=\fR\fIregister-range\fR \fB\-mtls\-size=\fR\fItls-size\fR
+\&\fB\-mtune=\fR\fIcpu-type\fR \fB\-mt \-pthread \-milp32 \-mlp64
+\&\-mno\-sched\-br\-data\-spec \-msched\-ar\-data\-spec \-mno\-sched\-control\-spec
+\&\-msched\-br\-in\-data\-spec \-msched\-ar\-in\-data\-spec \-msched\-in\-control\-spec
+\&\-msched\-ldc \-mno\-sched\-control\-ldc \-mno\-sched\-spec\-verbose
+\&\-mno\-sched\-prefer\-non\-data\-spec\-insns
+\&\-mno\-sched\-prefer\-non\-control\-spec\-insns
+\&\-mno\-sched\-count\-spec\-in\-critical\-path\fR
+.Sp
+\&\fIM32R/D Options\fR
+\&\fB\-m32r2 \-m32rx \-m32r
+\&\-mdebug
+\&\-malign\-loops \-mno\-align\-loops
+\&\-missue\-rate=\fR\fInumber\fR
+\&\fB\-mbranch\-cost=\fR\fInumber\fR
+\&\fB\-mmodel=\fR\fIcode-size-model-type\fR
+\&\fB\-msdata=\fR\fIsdata-type\fR
+\&\fB\-mno\-flush\-func \-mflush\-func=\fR\fIname\fR
+\&\fB\-mno\-flush\-trap \-mflush\-trap=\fR\fInumber\fR
+\&\fB\-G\fR \fInum\fR
+.Sp
+\&\fIM32C Options\fR
+\&\fB\-mcpu=\fR\fIcpu\fR \fB\-msim \-memregs=\fR\fInumber\fR
+.Sp
+\&\fIM680x0 Options\fR
+\&\fB\-march=\fR\fIarch\fR \fB\-mcpu=\fR\fIcpu\fR \fB\-mtune=\fR\fItune\fR
+\&\fB\-m68000 \-m68020 \-m68020\-40 \-m68020\-60 \-m68030 \-m68040
+\&\-m68060 \-mcpu32 \-m5200 \-m5206e \-m528x \-m5307 \-m5407
+\&\-mcfv4e \-mbitfield \-mno\-bitfield \-mc68000 \-mc68020
+\&\-mnobitfield \-mrtd \-mno\-rtd \-mdiv \-mno\-div \-mshort
+\&\-mno\-short \-mhard\-float \-m68881 \-msoft\-float \-mpcrel
+\&\-malign\-int \-mstrict\-align \-msep\-data \-mno\-sep\-data
+\&\-mshared\-library\-id=n \-mid\-shared\-library \-mno\-id\-shared\-library
+\&\-mxgot \-mno\-xgot\fR
+.Sp
+\&\fIM68hc1x Options\fR
+\&\fB\-m6811 \-m6812 \-m68hc11 \-m68hc12 \-m68hcs12
+\&\-mauto\-incdec \-minmax \-mlong\-calls \-mshort
+\&\-msoft\-reg\-count=\fR\fIcount\fR
+.Sp
+\&\fIMCore Options\fR
+\&\fB\-mhardlit \-mno\-hardlit \-mdiv \-mno\-div \-mrelax\-immediates
+\&\-mno\-relax\-immediates \-mwide\-bitfields \-mno\-wide\-bitfields
+\&\-m4byte\-functions \-mno\-4byte\-functions \-mcallgraph\-data
+\&\-mno\-callgraph\-data \-mslow\-bytes \-mno\-slow\-bytes \-mno\-lsim
+\&\-mlittle\-endian \-mbig\-endian \-m210 \-m340 \-mstack\-increment\fR
+.Sp
+\&\fI\s-1MIPS\s0 Options\fR
+\&\fB\-EL \-EB \-march=\fR\fIarch\fR \fB\-mtune=\fR\fIarch\fR
+\&\fB\-mips1 \-mips2 \-mips3 \-mips4 \-mips32 \-mips32r2
+\&\-mips64 \-mips64r2
+\&\-mips16 \-mno\-mips16 \-mflip\-mips16
+\&\-minterlink\-mips16 \-mno\-interlink\-mips16
+\&\-mabi=\fR\fIabi\fR \fB\-mabicalls \-mno\-abicalls
+\&\-mshared \-mno\-shared \-mplt \-mno\-plt \-mxgot \-mno\-xgot
+\&\-mgp32 \-mgp64 \-mfp32 \-mfp64 \-mhard\-float \-msoft\-float
+\&\-msingle\-float \-mdouble\-float \-mdsp \-mno\-dsp \-mdspr2 \-mno\-dspr2
+\&\-mfpu=\fR\fIfpu-type\fR
+\&\fB\-msmartmips \-mno\-smartmips
+\&\-mpaired\-single \-mno\-paired\-single \-mdmx \-mno\-mdmx
+\&\-mips3d \-mno\-mips3d \-mmt \-mno\-mt \-mllsc \-mno\-llsc
+\&\-mlong64 \-mlong32 \-msym32 \-mno\-sym32
+\&\-G\fR\fInum\fR \fB\-mlocal\-sdata \-mno\-local\-sdata
+\&\-mextern\-sdata \-mno\-extern\-sdata \-mgpopt \-mno\-gopt
+\&\-membedded\-data \-mno\-embedded\-data
+\&\-muninit\-const\-in\-rodata \-mno\-uninit\-const\-in\-rodata
+\&\-mcode\-readable=\fR\fIsetting\fR
+\&\fB\-msplit\-addresses \-mno\-split\-addresses
+\&\-mexplicit\-relocs \-mno\-explicit\-relocs
+\&\-mcheck\-zero\-division \-mno\-check\-zero\-division
+\&\-mdivide\-traps \-mdivide\-breaks
+\&\-mmemcpy \-mno\-memcpy \-mlong\-calls \-mno\-long\-calls
+\&\-mmad \-mno\-mad \-mfused\-madd \-mno\-fused\-madd \-nocpp
+\&\-mfix\-r4000 \-mno\-fix\-r4000 \-mfix\-r4400 \-mno\-fix\-r4400
+\&\-mfix\-r10000 \-mno\-fix\-r10000 \-mfix\-vr4120 \-mno\-fix\-vr4120
+\&\-mfix\-vr4130 \-mno\-fix\-vr4130 \-mfix\-sb1 \-mno\-fix\-sb1
+\&\-mflush\-func=\fR\fIfunc\fR \fB\-mno\-flush\-func
+\&\-mbranch\-cost=\fR\fInum\fR \fB\-mbranch\-likely \-mno\-branch\-likely
+\&\-mfp\-exceptions \-mno\-fp\-exceptions
+\&\-mvr4130\-align \-mno\-vr4130\-align\fR
+.Sp
+\&\fI\s-1MMIX\s0 Options\fR
+\&\fB\-mlibfuncs \-mno\-libfuncs \-mepsilon \-mno\-epsilon \-mabi=gnu
+\&\-mabi=mmixware \-mzero\-extend \-mknuthdiv \-mtoplevel\-symbols
+\&\-melf \-mbranch\-predict \-mno\-branch\-predict \-mbase\-addresses
+\&\-mno\-base\-addresses \-msingle\-exit \-mno\-single\-exit\fR
+.Sp
+\&\fI\s-1MN10300\s0 Options\fR
+\&\fB\-mmult\-bug \-mno\-mult\-bug
+\&\-mam33 \-mno\-am33
+\&\-mam33\-2 \-mno\-am33\-2
+\&\-mreturn\-pointer\-on\-d0
+\&\-mno\-crt0 \-mrelax\fR
+.Sp
+\&\fI\s-1PDP\-11\s0 Options\fR
+\&\fB\-mfpu \-msoft\-float \-mac0 \-mno\-ac0 \-m40 \-m45 \-m10
+\&\-mbcopy \-mbcopy\-builtin \-mint32 \-mno\-int16
+\&\-mint16 \-mno\-int32 \-mfloat32 \-mno\-float64
+\&\-mfloat64 \-mno\-float32 \-mabshi \-mno\-abshi
+\&\-mbranch\-expensive \-mbranch\-cheap
+\&\-msplit \-mno\-split \-munix\-asm \-mdec\-asm\fR
+.Sp
+\&\fIpicoChip Options\fR
+\&\fB\-mae=\fR\fIae_type\fR \fB\-mvliw\-lookahead=\fR\fIN\fR
+\&\fB\-msymbol\-as\-address \-mno\-inefficient\-warnings\fR
+.Sp
+\&\fIPowerPC Options\fR
+See \s-1RS/6000\s0 and PowerPC Options.
+.Sp
+\&\fI\s-1RS/6000\s0 and PowerPC Options\fR
+\&\fB\-mcpu=\fR\fIcpu-type\fR
+\&\fB\-mtune=\fR\fIcpu-type\fR
+\&\fB\-mpower \-mno\-power \-mpower2 \-mno\-power2
+\&\-mpowerpc \-mpowerpc64 \-mno\-powerpc
+\&\-maltivec \-mno\-altivec
+\&\-mpowerpc\-gpopt \-mno\-powerpc\-gpopt
+\&\-mpowerpc\-gfxopt \-mno\-powerpc\-gfxopt
+\&\-mmfcrf \-mno\-mfcrf \-mpopcntb \-mno\-popcntb \-mfprnd \-mno\-fprnd
+\&\-mcmpb \-mno\-cmpb \-mmfpgpr \-mno\-mfpgpr \-mhard\-dfp \-mno\-hard\-dfp
+\&\-mnew\-mnemonics \-mold\-mnemonics
+\&\-mfull\-toc \-mminimal\-toc \-mno\-fp\-in\-toc \-mno\-sum\-in\-toc
+\&\-m64 \-m32 \-mxl\-compat \-mno\-xl\-compat \-mpe
+\&\-malign\-power \-malign\-natural
+\&\-msoft\-float \-mhard\-float \-mmultiple \-mno\-multiple
+\&\-msingle\-float \-mdouble\-float \-msimple\-fpu
+\&\-mstring \-mno\-string \-mupdate \-mno\-update
+\&\-mavoid\-indexed\-addresses \-mno\-avoid\-indexed\-addresses
+\&\-mfused\-madd \-mno\-fused\-madd \-mbit\-align \-mno\-bit\-align
+\&\-mstrict\-align \-mno\-strict\-align \-mrelocatable
+\&\-mno\-relocatable \-mrelocatable\-lib \-mno\-relocatable\-lib
+\&\-mtoc \-mno\-toc \-mlittle \-mlittle\-endian \-mbig \-mbig\-endian
+\&\-mdynamic\-no\-pic \-maltivec \-mswdiv
+\&\-mprioritize\-restricted\-insns=\fR\fIpriority\fR
+\&\fB\-msched\-costly\-dep=\fR\fIdependence_type\fR
+\&\fB\-minsert\-sched\-nops=\fR\fIscheme\fR
+\&\fB\-mcall\-sysv \-mcall\-netbsd
+\&\-maix\-struct\-return \-msvr4\-struct\-return
+\&\-mabi=\fR\fIabi-type\fR \fB\-msecure\-plt \-mbss\-plt
+\&\-misel \-mno\-isel
+\&\-misel=yes \-misel=no
+\&\-mspe \-mno\-spe
+\&\-mspe=yes \-mspe=no
+\&\-mpaired
+\&\-mgen\-cell\-microcode \-mwarn\-cell\-microcode
+\&\-mvrsave \-mno\-vrsave
+\&\-mmulhw \-mno\-mulhw
+\&\-mdlmzb \-mno\-dlmzb
+\&\-mfloat\-gprs=yes \-mfloat\-gprs=no \-mfloat\-gprs=single \-mfloat\-gprs=double
+\&\-mprototype \-mno\-prototype
+\&\-msim \-mmvme \-mads \-myellowknife \-memb \-msdata
+\&\-msdata=\fR\fIopt\fR \fB\-mvxworks \-G\fR \fInum\fR \fB\-pthread\fR
+.Sp
+\&\fIS/390 and zSeries Options\fR
+\&\fB\-mtune=\fR\fIcpu-type\fR \fB\-march=\fR\fIcpu-type\fR
+\&\fB\-mhard\-float \-msoft\-float \-mhard\-dfp \-mno\-hard\-dfp
+\&\-mlong\-double\-64 \-mlong\-double\-128
+\&\-mbackchain \-mno\-backchain \-mpacked\-stack \-mno\-packed\-stack
+\&\-msmall\-exec \-mno\-small\-exec \-mmvcle \-mno\-mvcle
+\&\-m64 \-m31 \-mdebug \-mno\-debug \-mesa \-mzarch
+\&\-mtpf\-trace \-mno\-tpf\-trace \-mfused\-madd \-mno\-fused\-madd
+\&\-mwarn\-framesize \-mwarn\-dynamicstack \-mstack\-size \-mstack\-guard\fR
+.Sp
+\&\fIScore Options\fR
+\&\fB\-meb \-mel
+\&\-mnhwloop
+\&\-muls
+\&\-mmac
+\&\-mscore5 \-mscore5u \-mscore7 \-mscore7d\fR
+.Sp
+\&\fI\s-1SH\s0 Options\fR
+\&\fB\-m1 \-m2 \-m2e \-m3 \-m3e
+\&\-m4\-nofpu \-m4\-single\-only \-m4\-single \-m4
+\&\-m4a\-nofpu \-m4a\-single\-only \-m4a\-single \-m4a \-m4al
+\&\-m5\-64media \-m5\-64media\-nofpu
+\&\-m5\-32media \-m5\-32media\-nofpu
+\&\-m5\-compact \-m5\-compact\-nofpu
+\&\-mb \-ml \-mdalign \-mrelax
+\&\-mbigtable \-mfmovd \-mhitachi \-mrenesas \-mno\-renesas \-mnomacsave
+\&\-mieee \-mbitops \-misize \-minline\-ic_invalidate \-mpadstruct \-mspace
+\&\-mprefergot \-musermode \-multcost=\fR\fInumber\fR \fB\-mdiv=\fR\fIstrategy\fR
+\&\fB\-mdivsi3_libfunc=\fR\fIname\fR \fB\-mfixed\-range=\fR\fIregister-range\fR
+\&\fB\-madjust\-unroll \-mindexed\-addressing \-mgettrcost=\fR\fInumber\fR \fB\-mpt\-fixed
+\&\-minvalid\-symbols\fR
+.Sp
+\&\fI\s-1SPARC\s0 Options\fR
+\&\fB\-mcpu=\fR\fIcpu-type\fR
+\&\fB\-mtune=\fR\fIcpu-type\fR
+\&\fB\-mcmodel=\fR\fIcode-model\fR
+\&\fB\-m32 \-m64 \-mapp\-regs \-mno\-app\-regs
+\&\-mfaster\-structs \-mno\-faster\-structs
+\&\-mfpu \-mno\-fpu \-mhard\-float \-msoft\-float
+\&\-mhard\-quad\-float \-msoft\-quad\-float
+\&\-mimpure\-text \-mno\-impure\-text \-mlittle\-endian
+\&\-mstack\-bias \-mno\-stack\-bias
+\&\-munaligned\-doubles \-mno\-unaligned\-doubles
+\&\-mv8plus \-mno\-v8plus \-mvis \-mno\-vis
+\&\-threads \-pthreads \-pthread\fR
+.Sp
+\&\fI\s-1SPU\s0 Options\fR
+\&\fB\-mwarn\-reloc \-merror\-reloc
+\&\-msafe\-dma \-munsafe\-dma
+\&\-mbranch\-hints
+\&\-msmall\-mem \-mlarge\-mem \-mstdmain
+\&\-mfixed\-range=\fR\fIregister-range\fR
+.Sp
+\&\fISystem V Options\fR
+\&\fB\-Qy \-Qn \-YP,\fR\fIpaths\fR \fB\-Ym,\fR\fIdir\fR
+.Sp
+\&\fIV850 Options\fR
+\&\fB\-mlong\-calls \-mno\-long\-calls \-mep \-mno\-ep
+\&\-mprolog\-function \-mno\-prolog\-function \-mspace
+\&\-mtda=\fR\fIn\fR \fB\-msda=\fR\fIn\fR \fB\-mzda=\fR\fIn\fR
+\&\fB\-mapp\-regs \-mno\-app\-regs
+\&\-mdisable\-callt \-mno\-disable\-callt
+\&\-mv850e1
+\&\-mv850e
+\&\-mv850 \-mbig\-switch\fR
+.Sp
+\&\fI\s-1VAX\s0 Options\fR
+\&\fB\-mg \-mgnu \-munix\fR
+.Sp
+\&\fIVxWorks Options\fR
+\&\fB\-mrtp \-non\-static \-Bstatic \-Bdynamic
+\&\-Xbind\-lazy \-Xbind\-now\fR
+.Sp
+\&\fIx86\-64 Options\fR
+See i386 and x86\-64 Options.
+.Sp
+\&\fIi386 and x86\-64 Windows Options\fR
+\&\fB\-mconsole \-mcygwin \-mno\-cygwin \-mdll
+\&\-mnop\-fun\-dllimport \-mthread \-mwin32 \-mwindows\fR
+.Sp
+\&\fIXstormy16 Options\fR
+\&\fB\-msim\fR
+.Sp
+\&\fIXtensa Options\fR
+\&\fB\-mconst16 \-mno\-const16
+\&\-mfused\-madd \-mno\-fused\-madd
+\&\-mserialize\-volatile \-mno\-serialize\-volatile
+\&\-mtext\-section\-literals \-mno\-text\-section\-literals
+\&\-mtarget\-align \-mno\-target\-align
+\&\-mlongcalls \-mno\-longcalls\fR
+.Sp
+\&\fIzSeries Options\fR
+See S/390 and zSeries Options.
+.IP "\fICode Generation Options\fR" 4
+.IX Item "Code Generation Options"
+\&\fB\-fcall\-saved\-\fR\fIreg\fR \fB\-fcall\-used\-\fR\fIreg\fR
+\&\fB\-ffixed\-\fR\fIreg\fR \fB\-fexceptions
+\&\-fnon\-call\-exceptions \-funwind\-tables
+\&\-fasynchronous\-unwind\-tables
+\&\-finhibit\-size\-directive \-finstrument\-functions
+\&\-finstrument\-functions\-exclude\-function\-list=\fR\fIsym\fR\fB,\fR\fIsym\fR\fB,...
+\&\-finstrument\-functions\-exclude\-file\-list=\fR\fIfile\fR\fB,\fR\fIfile\fR\fB,...
+\&\-fno\-common \-fno\-ident
+\&\-fpcc\-struct\-return \-fpic \-fPIC \-fpie \-fPIE
+\&\-fno\-jump\-tables
+\&\-frecord\-gcc\-switches
+\&\-freg\-struct\-return \-fshort\-enums
+\&\-fshort\-double \-fshort\-wchar
+\&\-fverbose\-asm \-fpack\-struct[=\fR\fIn\fR\fB] \-fstack\-check
+\&\-fstack\-limit\-register=\fR\fIreg\fR \fB\-fstack\-limit\-symbol=\fR\fIsym\fR
+\&\fB\-fno\-stack\-limit \-fargument\-alias \-fargument\-noalias
+\&\-fargument\-noalias\-global \-fargument\-noalias\-anything
+\&\-fleading\-underscore \-ftls\-model=\fR\fImodel\fR
+\&\fB\-ftrapv \-fwrapv \-fbounds\-check
+\&\-fvisibility\fR
+.Sh "Options Controlling the Kind of Output"
+.IX Subsection "Options Controlling the Kind of Output"
+Compilation can involve up to four stages: preprocessing, compilation
+proper, assembly and linking, always in that order. \s-1GCC\s0 is capable of
+preprocessing and compiling several files either into several
+assembler input files, or into one assembler input file; then each
+assembler input file produces an object file, and linking combines all
+the object files (those newly compiled, and those specified as input)
+into an executable file.
+.PP
+For any given input file, the file name suffix determines what kind of
+compilation is done:
+.IP "\fIfile\fR\fB.c\fR" 4
+.IX Item "file.c"
+C source code which must be preprocessed.
+.IP "\fIfile\fR\fB.i\fR" 4
+.IX Item "file.i"
+C source code which should not be preprocessed.
+.IP "\fIfile\fR\fB.ii\fR" 4
+.IX Item "file.ii"
+\&\*(C+ source code which should not be preprocessed.
+.IP "\fIfile\fR\fB.m\fR" 4
+.IX Item "file.m"
+Objective-C source code. Note that you must link with the \fIlibobjc\fR
+library to make an Objective-C program work.
+.IP "\fIfile\fR\fB.mi\fR" 4
+.IX Item "file.mi"
+Objective-C source code which should not be preprocessed.
+.IP "\fIfile\fR\fB.mm\fR" 4
+.IX Item "file.mm"
+.PD 0
+.IP "\fIfile\fR\fB.M\fR" 4
+.IX Item "file.M"
+.PD
+Objective\-\*(C+ source code. Note that you must link with the \fIlibobjc\fR
+library to make an Objective\-\*(C+ program work. Note that \fB.M\fR refers
+to a literal capital M.
+.IP "\fIfile\fR\fB.mii\fR" 4
+.IX Item "file.mii"
+Objective\-\*(C+ source code which should not be preprocessed.
+.IP "\fIfile\fR\fB.h\fR" 4
+.IX Item "file.h"
+C, \*(C+, Objective-C or Objective\-\*(C+ header file to be turned into a
+precompiled header.
+.IP "\fIfile\fR\fB.cc\fR" 4
+.IX Item "file.cc"
+.PD 0
+.IP "\fIfile\fR\fB.cp\fR" 4
+.IX Item "file.cp"
+.IP "\fIfile\fR\fB.cxx\fR" 4
+.IX Item "file.cxx"
+.IP "\fIfile\fR\fB.cpp\fR" 4
+.IX Item "file.cpp"
+.IP "\fIfile\fR\fB.CPP\fR" 4
+.IX Item "file.CPP"
+.IP "\fIfile\fR\fB.c++\fR" 4
+.IX Item "file.c++"
+.IP "\fIfile\fR\fB.C\fR" 4
+.IX Item "file.C"
+.PD
+\&\*(C+ source code which must be preprocessed. Note that in \fB.cxx\fR,
+the last two letters must both be literally \fBx\fR. Likewise,
+\&\fB.C\fR refers to a literal capital C.
+.IP "\fIfile\fR\fB.mm\fR" 4
+.IX Item "file.mm"
+.PD 0
+.IP "\fIfile\fR\fB.M\fR" 4
+.IX Item "file.M"
+.PD
+Objective\-\*(C+ source code which must be preprocessed.
+.IP "\fIfile\fR\fB.mii\fR" 4
+.IX Item "file.mii"
+Objective\-\*(C+ source code which should not be preprocessed.
+.IP "\fIfile\fR\fB.hh\fR" 4
+.IX Item "file.hh"
+.PD 0
+.IP "\fIfile\fR\fB.H\fR" 4
+.IX Item "file.H"
+.IP "\fIfile\fR\fB.hp\fR" 4
+.IX Item "file.hp"
+.IP "\fIfile\fR\fB.hxx\fR" 4
+.IX Item "file.hxx"
+.IP "\fIfile\fR\fB.hpp\fR" 4
+.IX Item "file.hpp"
+.IP "\fIfile\fR\fB.HPP\fR" 4
+.IX Item "file.HPP"
+.IP "\fIfile\fR\fB.h++\fR" 4
+.IX Item "file.h++"
+.IP "\fIfile\fR\fB.tcc\fR" 4
+.IX Item "file.tcc"
+.PD
+\&\*(C+ header file to be turned into a precompiled header.
+.IP "\fIfile\fR\fB.f\fR" 4
+.IX Item "file.f"
+.PD 0
+.IP "\fIfile\fR\fB.for\fR" 4
+.IX Item "file.for"
+.IP "\fIfile\fR\fB.ftn\fR" 4
+.IX Item "file.ftn"
+.PD
+Fixed form Fortran source code which should not be preprocessed.
+.IP "\fIfile\fR\fB.F\fR" 4
+.IX Item "file.F"
+.PD 0
+.IP "\fIfile\fR\fB.FOR\fR" 4
+.IX Item "file.FOR"
+.IP "\fIfile\fR\fB.fpp\fR" 4
+.IX Item "file.fpp"
+.IP "\fIfile\fR\fB.FPP\fR" 4
+.IX Item "file.FPP"
+.IP "\fIfile\fR\fB.FTN\fR" 4
+.IX Item "file.FTN"
+.PD
+Fixed form Fortran source code which must be preprocessed (with the traditional
+preprocessor).
+.IP "\fIfile\fR\fB.f90\fR" 4
+.IX Item "file.f90"
+.PD 0
+.IP "\fIfile\fR\fB.f95\fR" 4
+.IX Item "file.f95"
+.IP "\fIfile\fR\fB.f03\fR" 4
+.IX Item "file.f03"
+.IP "\fIfile\fR\fB.f08\fR" 4
+.IX Item "file.f08"
+.PD
+Free form Fortran source code which should not be preprocessed.
+.IP "\fIfile\fR\fB.F90\fR" 4
+.IX Item "file.F90"
+.PD 0
+.IP "\fIfile\fR\fB.F95\fR" 4
+.IX Item "file.F95"
+.IP "\fIfile\fR\fB.F03\fR" 4
+.IX Item "file.F03"
+.IP "\fIfile\fR\fB.F08\fR" 4
+.IX Item "file.F08"
+.PD
+Free form Fortran source code which must be preprocessed (with the
+traditional preprocessor).
+.IP "\fIfile\fR\fB.ads\fR" 4
+.IX Item "file.ads"
+Ada source code file which contains a library unit declaration (a
+declaration of a package, subprogram, or generic, or a generic
+instantiation), or a library unit renaming declaration (a package,
+generic, or subprogram renaming declaration). Such files are also
+called \fIspecs\fR.
+.IP "\fIfile\fR\fB.adb\fR" 4
+.IX Item "file.adb"
+Ada source code file containing a library unit body (a subprogram or
+package body). Such files are also called \fIbodies\fR.
+.IP "\fIfile\fR\fB.s\fR" 4
+.IX Item "file.s"
+Assembler code.
+.IP "\fIfile\fR\fB.S\fR" 4
+.IX Item "file.S"
+.PD 0
+.IP "\fIfile\fR\fB.sx\fR" 4
+.IX Item "file.sx"
+.PD
+Assembler code which must be preprocessed.
+.IP "\fIother\fR" 4
+.IX Item "other"
+An object file to be fed straight into linking.
+Any file name with no recognized suffix is treated this way.
+.PP
+You can specify the input language explicitly with the \fB\-x\fR option:
+.IP "\fB\-x\fR \fIlanguage\fR" 4
+.IX Item "-x language"
+Specify explicitly the \fIlanguage\fR for the following input files
+(rather than letting the compiler choose a default based on the file
+name suffix). This option applies to all following input files until
+the next \fB\-x\fR option. Possible values for \fIlanguage\fR are:
+.Sp
+.Vb 8
+\& c c\-header c\-cpp\-output
+\& c++ c++\-header c++\-cpp\-output
+\& objective\-c objective\-c\-header objective\-c\-cpp\-output
+\& objective\-c++ objective\-c++\-header objective\-c++\-cpp\-output
+\& assembler assembler\-with\-cpp
+\& ada
+\& f77 f77\-cpp\-input f95 f95\-cpp\-input
+\& java
+.Ve
+.IP "\fB\-x none\fR" 4
+.IX Item "-x none"
+Turn off any specification of a language, so that subsequent files are
+handled according to their file name suffixes (as they are if \fB\-x\fR
+has not been used at all).
+.IP "\fB\-pass\-exit\-codes\fR" 4
+.IX Item "-pass-exit-codes"
+Normally the \fBgcc\fR program will exit with the code of 1 if any
+phase of the compiler returns a non-success return code. If you specify
+\&\fB\-pass\-exit\-codes\fR, the \fBgcc\fR program will instead return with
+numerically highest error produced by any phase that returned an error
+indication. The C, \*(C+, and Fortran frontends return 4, if an internal
+compiler error is encountered.
+.PP
+If you only want some of the stages of compilation, you can use
+\&\fB\-x\fR (or filename suffixes) to tell \fBgcc\fR where to start, and
+one of the options \fB\-c\fR, \fB\-S\fR, or \fB\-E\fR to say where
+\&\fBgcc\fR is to stop. Note that some combinations (for example,
+\&\fB\-x cpp-output \-E\fR) instruct \fBgcc\fR to do nothing at all.
+.IP "\fB\-c\fR" 4
+.IX Item "-c"
+Compile or assemble the source files, but do not link. The linking
+stage simply is not done. The ultimate output is in the form of an
+object file for each source file.
+.Sp
+By default, the object file name for a source file is made by replacing
+the suffix \fB.c\fR, \fB.i\fR, \fB.s\fR, etc., with \fB.o\fR.
+.Sp
+Unrecognized input files, not requiring compilation or assembly, are
+ignored.
+.IP "\fB\-S\fR" 4
+.IX Item "-S"
+Stop after the stage of compilation proper; do not assemble. The output
+is in the form of an assembler code file for each non-assembler input
+file specified.
+.Sp
+By default, the assembler file name for a source file is made by
+replacing the suffix \fB.c\fR, \fB.i\fR, etc., with \fB.s\fR.
+.Sp
+Input files that don't require compilation are ignored.
+.IP "\fB\-E\fR" 4
+.IX Item "-E"
+Stop after the preprocessing stage; do not run the compiler proper. The
+output is in the form of preprocessed source code, which is sent to the
+standard output.
+.Sp
+Input files which don't require preprocessing are ignored.
+.IP "\fB\-o\fR \fIfile\fR" 4
+.IX Item "-o file"
+Place output in file \fIfile\fR. This applies regardless to whatever
+sort of output is being produced, whether it be an executable file,
+an object file, an assembler file or preprocessed C code.
+.Sp
+If \fB\-o\fR is not specified, the default is to put an executable
+file in \fIa.out\fR, the object file for
+\&\fI\fIsource\fI.\fIsuffix\fI\fR in \fI\fIsource\fI.o\fR, its
+assembler file in \fI\fIsource\fI.s\fR, a precompiled header file in
+\&\fI\fIsource\fI.\fIsuffix\fI.gch\fR, and all preprocessed C source on
+standard output.
+.IP "\fB\-v\fR" 4
+.IX Item "-v"
+Print (on standard error output) the commands executed to run the stages
+of compilation. Also print the version number of the compiler driver
+program and of the preprocessor and the compiler proper.
+.IP "\fB\-###\fR" 4
+.IX Item "-###"
+Like \fB\-v\fR except the commands are not executed and all command
+arguments are quoted. This is useful for shell scripts to capture the
+driver-generated command lines.
+.IP "\fB\-pipe\fR" 4
+.IX Item "-pipe"
+Use pipes rather than temporary files for communication between the
+various stages of compilation. This fails to work on some systems where
+the assembler is unable to read from a pipe; but the \s-1GNU\s0 assembler has
+no trouble.
+.IP "\fB\-combine\fR" 4
+.IX Item "-combine"
+If you are compiling multiple source files, this option tells the driver
+to pass all the source files to the compiler at once (for those
+languages for which the compiler can handle this). This will allow
+intermodule analysis (\s-1IMA\s0) to be performed by the compiler. Currently the only
+language for which this is supported is C. If you pass source files for
+multiple languages to the driver, using this option, the driver will invoke
+the compiler(s) that support \s-1IMA\s0 once each, passing each compiler all the
+source files appropriate for it. For those languages that do not support
+\&\s-1IMA\s0 this option will be ignored, and the compiler will be invoked once for
+each source file in that language. If you use this option in conjunction
+with \fB\-save\-temps\fR, the compiler will generate multiple
+pre-processed files
+(one for each source file), but only one (combined) \fI.o\fR or
+\&\fI.s\fR file.
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
+Print (on the standard output) a description of the command line options
+understood by \fBgcc\fR. If the \fB\-v\fR option is also specified
+then \fB\-\-help\fR will also be passed on to the various processes
+invoked by \fBgcc\fR, so that they can display the command line options
+they accept. If the \fB\-Wextra\fR option has also been specified
+(prior to the \fB\-\-help\fR option), then command line options which
+have no documentation associated with them will also be displayed.
+.IP "\fB\-\-target\-help\fR" 4
+.IX Item "--target-help"
+Print (on the standard output) a description of target-specific command
+line options for each tool. For some targets extra target-specific
+information may also be printed.
+.IP "\fB\-\-help={\fR\fIclass\fR|[\fB^\fR]\fIqualifier\fR\fB}\fR[\fB,...\fR]" 4
+.IX Item "--help={class|[^]qualifier}[,...]"
+Print (on the standard output) a description of the command line
+options understood by the compiler that fit into all specified classes
+and qualifiers. These are the supported classes:
+.RS 4
+.IP "\fBoptimizers\fR" 4
+.IX Item "optimizers"
+This will display all of the optimization options supported by the
+compiler.
+.IP "\fBwarnings\fR" 4
+.IX Item "warnings"
+This will display all of the options controlling warning messages
+produced by the compiler.
+.IP "\fBtarget\fR" 4
+.IX Item "target"
+This will display target-specific options. Unlike the
+\&\fB\-\-target\-help\fR option however, target-specific options of the
+linker and assembler will not be displayed. This is because those
+tools do not currently support the extended \fB\-\-help=\fR syntax.
+.IP "\fBparams\fR" 4
+.IX Item "params"
+This will display the values recognized by the \fB\-\-param\fR
+option.
+.IP "\fIlanguage\fR" 4
+.IX Item "language"
+This will display the options supported for \fIlanguage\fR, where
+\&\fIlanguage\fR is the name of one of the languages supported in this
+version of \s-1GCC\s0.
+.IP "\fBcommon\fR" 4
+.IX Item "common"
+This will display the options that are common to all languages.
+.RE
+.RS 4
+.Sp
+These are the supported qualifiers:
+.IP "\fBundocumented\fR" 4
+.IX Item "undocumented"
+Display only those options which are undocumented.
+.IP "\fBjoined\fR" 4
+.IX Item "joined"
+Display options which take an argument that appears after an equal
+sign in the same continuous piece of text, such as:
+\&\fB\-\-help=target\fR.
+.IP "\fBseparate\fR" 4
+.IX Item "separate"
+Display options which take an argument that appears as a separate word
+following the original option, such as: \fB\-o output-file\fR.
+.RE
+.RS 4
+.Sp
+Thus for example to display all the undocumented target-specific
+switches supported by the compiler the following can be used:
+.Sp
+.Vb 1
+\& \-\-help=target,undocumented
+.Ve
+.Sp
+The sense of a qualifier can be inverted by prefixing it with the
+\&\fB^\fR character, so for example to display all binary warning
+options (i.e., ones that are either on or off and that do not take an
+argument), which have a description the following can be used:
+.Sp
+.Vb 1
+\& \-\-help=warnings,^joined,^undocumented
+.Ve
+.Sp
+The argument to \fB\-\-help=\fR should not consist solely of inverted
+qualifiers.
+.Sp
+Combining several classes is possible, although this usually
+restricts the output by so much that there is nothing to display. One
+case where it does work however is when one of the classes is
+\&\fItarget\fR. So for example to display all the target-specific
+optimization options the following can be used:
+.Sp
+.Vb 1
+\& \-\-help=target,optimizers
+.Ve
+.Sp
+The \fB\-\-help=\fR option can be repeated on the command line. Each
+successive use will display its requested class of options, skipping
+those that have already been displayed.
+.Sp
+If the \fB\-Q\fR option appears on the command line before the
+\&\fB\-\-help=\fR option, then the descriptive text displayed by
+\&\fB\-\-help=\fR is changed. Instead of describing the displayed
+options, an indication is given as to whether the option is enabled,
+disabled or set to a specific value (assuming that the compiler
+knows this at the point where the \fB\-\-help=\fR option is used).
+.Sp
+Here is a truncated example from the \s-1ARM\s0 port of \fBgcc\fR:
+.Sp
+.Vb 5
+\& % gcc \-Q \-mabi=2 \-\-help=target \-c
+\& The following options are target specific:
+\& \-mabi= 2
+\& \-mabort\-on\-noreturn [disabled]
+\& \-mapcs [disabled]
+.Ve
+.Sp
+The output is sensitive to the effects of previous command line
+options, so for example it is possible to find out which optimizations
+are enabled at \fB\-O2\fR by using:
+.Sp
+.Vb 1
+\& \-Q \-O2 \-\-help=optimizers
+.Ve
+.Sp
+Alternatively you can discover which binary optimizations are enabled
+by \fB\-O3\fR by using:
+.Sp
+.Vb 3
+\& gcc \-c \-Q \-O3 \-\-help=optimizers > /tmp/O3\-opts
+\& gcc \-c \-Q \-O2 \-\-help=optimizers > /tmp/O2\-opts
+\& diff /tmp/O2\-opts /tmp/O3\-opts | grep enabled
+.Ve
+.RE
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+Display the version number and copyrights of the invoked \s-1GCC\s0.
+.IP "\fB\-wrapper\fR" 4
+.IX Item "-wrapper"
+Invoke all subcommands under a wrapper program. It takes a single
+comma separated list as an argument, which will be used to invoke
+the wrapper:
+.Sp
+.Vb 1
+\& gcc \-c t.c \-wrapper gdb,\-\-args
+.Ve
+.Sp
+This will invoke all subprograms of gcc under \*(L"gdb \-\-args\*(R",
+thus cc1 invocation will be \*(L"gdb \-\-args cc1 ...\*(R".
+.IP "\fB@\fR\fIfile\fR" 4
+.IX Item "@file"
+Read command-line options from \fIfile\fR. The options read are
+inserted in place of the original @\fIfile\fR option. If \fIfile\fR
+does not exist, or cannot be read, then the option will be treated
+literally, and not removed.
+.Sp
+Options in \fIfile\fR are separated by whitespace. A whitespace
+character may be included in an option by surrounding the entire
+option in either single or double quotes. Any character (including a
+backslash) may be included by prefixing the character to be included
+with a backslash. The \fIfile\fR may itself contain additional
+@\fIfile\fR options; any such options will be processed recursively.
+.Sh "Compiling \*(C+ Programs"
+.IX Subsection "Compiling Programs"
+\&\*(C+ source files conventionally use one of the suffixes \fB.C\fR,
+\&\fB.cc\fR, \fB.cpp\fR, \fB.CPP\fR, \fB.c++\fR, \fB.cp\fR, or
+\&\fB.cxx\fR; \*(C+ header files often use \fB.hh\fR, \fB.hpp\fR,
+\&\fB.H\fR, or (for shared template code) \fB.tcc\fR; and
+preprocessed \*(C+ files use the suffix \fB.ii\fR. \s-1GCC\s0 recognizes
+files with these names and compiles them as \*(C+ programs even if you
+call the compiler the same way as for compiling C programs (usually
+with the name \fBgcc\fR).
+.PP
+However, the use of \fBgcc\fR does not add the \*(C+ library.
+\&\fBg++\fR is a program that calls \s-1GCC\s0 and treats \fB.c\fR,
+\&\fB.h\fR and \fB.i\fR files as \*(C+ source files instead of C source
+files unless \fB\-x\fR is used, and automatically specifies linking
+against the \*(C+ library. This program is also useful when
+precompiling a C header file with a \fB.h\fR extension for use in \*(C+
+compilations. On many systems, \fBg++\fR is also installed with
+the name \fBc++\fR.
+.PP
+When you compile \*(C+ programs, you may specify many of the same
+command-line options that you use for compiling programs in any
+language; or command-line options meaningful for C and related
+languages; or options that are meaningful only for \*(C+ programs.
+.Sh "Options Controlling C Dialect"
+.IX Subsection "Options Controlling C Dialect"
+The following options control the dialect of C (or languages derived
+from C, such as \*(C+, Objective-C and Objective\-\*(C+) that the compiler
+accepts:
+.IP "\fB\-ansi\fR" 4
+.IX Item "-ansi"
+In C mode, this is equivalent to \fB\-std=c89\fR. In \*(C+ mode, it is
+equivalent to \fB\-std=c++98\fR.
+.Sp
+This turns off certain features of \s-1GCC\s0 that are incompatible with \s-1ISO\s0
+C90 (when compiling C code), or of standard \*(C+ (when compiling \*(C+ code),
+such as the \f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`typeof\*(C'\fR keywords, and
+predefined macros such as \f(CW\*(C`unix\*(C'\fR and \f(CW\*(C`vax\*(C'\fR that identify the
+type of system you are using. It also enables the undesirable and
+rarely used \s-1ISO\s0 trigraph feature. For the C compiler,
+it disables recognition of \*(C+ style \fB//\fR comments as well as
+the \f(CW\*(C`inline\*(C'\fR keyword.
+.Sp
+The alternate keywords \f(CW\*(C`_\|_asm_\|_\*(C'\fR, \f(CW\*(C`_\|_extension_\|_\*(C'\fR,
+\&\f(CW\*(C`_\|_inline_\|_\*(C'\fR and \f(CW\*(C`_\|_typeof_\|_\*(C'\fR continue to work despite
+\&\fB\-ansi\fR. You would not want to use them in an \s-1ISO\s0 C program, of
+course, but it is useful to put them in header files that might be included
+in compilations done with \fB\-ansi\fR. Alternate predefined macros
+such as \f(CW\*(C`_\|_unix_\|_\*(C'\fR and \f(CW\*(C`_\|_vax_\|_\*(C'\fR are also available, with or
+without \fB\-ansi\fR.
+.Sp
+The \fB\-ansi\fR option does not cause non-ISO programs to be
+rejected gratuitously. For that, \fB\-pedantic\fR is required in
+addition to \fB\-ansi\fR.
+.Sp
+The macro \f(CW\*(C`_\|_STRICT_ANSI_\|_\*(C'\fR is predefined when the \fB\-ansi\fR
+option is used. Some header files may notice this macro and refrain
+from declaring certain functions or defining certain macros that the
+\&\s-1ISO\s0 standard doesn't call for; this is to avoid interfering with any
+programs that might use these names for other things.
+.Sp
+Functions that would normally be built in but do not have semantics
+defined by \s-1ISO\s0 C (such as \f(CW\*(C`alloca\*(C'\fR and \f(CW\*(C`ffs\*(C'\fR) are not built-in
+functions when \fB\-ansi\fR is used.
+.IP "\fB\-std=\fR" 4
+.IX Item "-std="
+Determine the language standard. This option
+is currently only supported when compiling C or \*(C+.
+.Sp
+The compiler can accept several base standards, such as \fBc89\fR or
+\&\fBc++98\fR, and \s-1GNU\s0 dialects of those standards, such as
+\&\fBgnu89\fR or \fBgnu++98\fR. By specifying a base standard, the
+compiler will accept all programs following that standard and those
+using \s-1GNU\s0 extensions that do not contradict it. For example,
+\&\fB\-std=c89\fR turns off certain features of \s-1GCC\s0 that are
+incompatible with \s-1ISO\s0 C90, such as the \f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`typeof\*(C'\fR
+keywords, but not other \s-1GNU\s0 extensions that do not have a meaning in
+\&\s-1ISO\s0 C90, such as omitting the middle term of a \f(CW\*(C`?:\*(C'\fR
+expression. On the other hand, by specifying a \s-1GNU\s0 dialect of a
+standard, all features the compiler support are enabled, even when
+those features change the meaning of the base standard and some
+strict-conforming programs may be rejected. The particular standard
+is used by \fB\-pedantic\fR to identify which features are \s-1GNU\s0
+extensions given that version of the standard. For example
+\&\fB\-std=gnu89 \-pedantic\fR would warn about \*(C+ style \fB//\fR
+comments, while \fB\-std=gnu99 \-pedantic\fR would not.
+.Sp
+A value for this option must be provided; possible values are
+.RS 4
+.IP "\fBc89\fR" 4
+.IX Item "c89"
+.PD 0
+.IP "\fBiso9899:1990\fR" 4
+.IX Item "iso9899:1990"
+.PD
+Support all \s-1ISO\s0 C90 programs (certain \s-1GNU\s0 extensions that conflict
+with \s-1ISO\s0 C90 are disabled). Same as \fB\-ansi\fR for C code.
+.IP "\fBiso9899:199409\fR" 4
+.IX Item "iso9899:199409"
+\&\s-1ISO\s0 C90 as modified in amendment 1.
+.IP "\fBc99\fR" 4
+.IX Item "c99"
+.PD 0
+.IP "\fBc9x\fR" 4
+.IX Item "c9x"
+.IP "\fBiso9899:1999\fR" 4
+.IX Item "iso9899:1999"
+.IP "\fBiso9899:199x\fR" 4
+.IX Item "iso9899:199x"
+.PD
+\&\s-1ISO\s0 C99. Note that this standard is not yet fully supported; see
+<\fBhttp://gcc.gnu.org/gcc\-4.4/c99status.html\fR> for more information. The
+names \fBc9x\fR and \fBiso9899:199x\fR are deprecated.
+.IP "\fBgnu89\fR" 4
+.IX Item "gnu89"
+\&\s-1GNU\s0 dialect of \s-1ISO\s0 C90 (including some C99 features). This
+is the default for C code.
+.IP "\fBgnu99\fR" 4
+.IX Item "gnu99"
+.PD 0
+.IP "\fBgnu9x\fR" 4
+.IX Item "gnu9x"
+.PD
+\&\s-1GNU\s0 dialect of \s-1ISO\s0 C99. When \s-1ISO\s0 C99 is fully implemented in \s-1GCC\s0,
+this will become the default. The name \fBgnu9x\fR is deprecated.
+.IP "\fBc++98\fR" 4
+.IX Item "c++98"
+The 1998 \s-1ISO\s0 \*(C+ standard plus amendments. Same as \fB\-ansi\fR for
+\&\*(C+ code.
+.IP "\fBgnu++98\fR" 4
+.IX Item "gnu++98"
+\&\s-1GNU\s0 dialect of \fB\-std=c++98\fR. This is the default for
+\&\*(C+ code.
+.IP "\fBc++0x\fR" 4
+.IX Item "c++0x"
+The working draft of the upcoming \s-1ISO\s0 \*(C+0x standard. This option
+enables experimental features that are likely to be included in
+\&\*(C+0x. The working draft is constantly changing, and any feature that is
+enabled by this flag may be removed from future versions of \s-1GCC\s0 if it is
+not part of the \*(C+0x standard.
+.IP "\fBgnu++0x\fR" 4
+.IX Item "gnu++0x"
+\&\s-1GNU\s0 dialect of \fB\-std=c++0x\fR. This option enables
+experimental features that may be removed in future versions of \s-1GCC\s0.
+.RE
+.RS 4
+.RE
+.IP "\fB\-fgnu89\-inline\fR" 4
+.IX Item "-fgnu89-inline"
+The option \fB\-fgnu89\-inline\fR tells \s-1GCC\s0 to use the traditional
+\&\s-1GNU\s0 semantics for \f(CW\*(C`inline\*(C'\fR functions when in C99 mode.
+ This option
+is accepted and ignored by \s-1GCC\s0 versions 4.1.3 up to but not including
+4.3. In \s-1GCC\s0 versions 4.3 and later it changes the behavior of \s-1GCC\s0 in
+C99 mode. Using this option is roughly equivalent to adding the
+\&\f(CW\*(C`gnu_inline\*(C'\fR function attribute to all inline functions.
+.Sp
+The option \fB\-fno\-gnu89\-inline\fR explicitly tells \s-1GCC\s0 to use the
+C99 semantics for \f(CW\*(C`inline\*(C'\fR when in C99 or gnu99 mode (i.e., it
+specifies the default behavior). This option was first supported in
+\&\s-1GCC\s0 4.3. This option is not supported in C89 or gnu89 mode.
+.Sp
+The preprocessor macros \f(CW\*(C`_\|_GNUC_GNU_INLINE_\|_\*(C'\fR and
+\&\f(CW\*(C`_\|_GNUC_STDC_INLINE_\|_\*(C'\fR may be used to check which semantics are
+in effect for \f(CW\*(C`inline\*(C'\fR functions.
+.IP "\fB\-aux\-info\fR \fIfilename\fR" 4
+.IX Item "-aux-info filename"
+Output to the given filename prototyped declarations for all functions
+declared and/or defined in a translation unit, including those in header
+files. This option is silently ignored in any language other than C.
+.Sp
+Besides declarations, the file indicates, in comments, the origin of
+each declaration (source file and line), whether the declaration was
+implicit, prototyped or unprototyped (\fBI\fR, \fBN\fR for new or
+\&\fBO\fR for old, respectively, in the first character after the line
+number and the colon), and whether it came from a declaration or a
+definition (\fBC\fR or \fBF\fR, respectively, in the following
+character). In the case of function definitions, a K&R\-style list of
+arguments followed by their declarations is also provided, inside
+comments, after the declaration.
+.IP "\fB\-fno\-asm\fR" 4
+.IX Item "-fno-asm"
+Do not recognize \f(CW\*(C`asm\*(C'\fR, \f(CW\*(C`inline\*(C'\fR or \f(CW\*(C`typeof\*(C'\fR as a
+keyword, so that code can use these words as identifiers. You can use
+the keywords \f(CW\*(C`_\|_asm_\|_\*(C'\fR, \f(CW\*(C`_\|_inline_\|_\*(C'\fR and \f(CW\*(C`_\|_typeof_\|_\*(C'\fR
+instead. \fB\-ansi\fR implies \fB\-fno\-asm\fR.
+.Sp
+In \*(C+, this switch only affects the \f(CW\*(C`typeof\*(C'\fR keyword, since
+\&\f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`inline\*(C'\fR are standard keywords. You may want to
+use the \fB\-fno\-gnu\-keywords\fR flag instead, which has the same
+effect. In C99 mode (\fB\-std=c99\fR or \fB\-std=gnu99\fR), this
+switch only affects the \f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`typeof\*(C'\fR keywords, since
+\&\f(CW\*(C`inline\*(C'\fR is a standard keyword in \s-1ISO\s0 C99.
+.IP "\fB\-fno\-builtin\fR" 4
+.IX Item "-fno-builtin"
+.PD 0
+.IP "\fB\-fno\-builtin\-\fR\fIfunction\fR" 4
+.IX Item "-fno-builtin-function"
+.PD
+Don't recognize built-in functions that do not begin with
+\&\fB_\|_builtin_\fR as prefix.
+.Sp
+\&\s-1GCC\s0 normally generates special code to handle certain built-in functions
+more efficiently; for instance, calls to \f(CW\*(C`alloca\*(C'\fR may become single
+instructions that adjust the stack directly, and calls to \f(CW\*(C`memcpy\*(C'\fR
+may become inline copy loops. The resulting code is often both smaller
+and faster, but since the function calls no longer appear as such, you
+cannot set a breakpoint on those calls, nor can you change the behavior
+of the functions by linking with a different library. In addition,
+when a function is recognized as a built-in function, \s-1GCC\s0 may use
+information about that function to warn about problems with calls to
+that function, or to generate more efficient code, even if the
+resulting code still contains calls to that function. For example,
+warnings are given with \fB\-Wformat\fR for bad calls to
+\&\f(CW\*(C`printf\*(C'\fR, when \f(CW\*(C`printf\*(C'\fR is built in, and \f(CW\*(C`strlen\*(C'\fR is
+known not to modify global memory.
+.Sp
+With the \fB\-fno\-builtin\-\fR\fIfunction\fR option
+only the built-in function \fIfunction\fR is
+disabled. \fIfunction\fR must not begin with \fB_\|_builtin_\fR. If a
+function is named that is not built-in in this version of \s-1GCC\s0, this
+option is ignored. There is no corresponding
+\&\fB\-fbuiltin\-\fR\fIfunction\fR option; if you wish to enable
+built-in functions selectively when using \fB\-fno\-builtin\fR or
+\&\fB\-ffreestanding\fR, you may define macros such as:
+.Sp
+.Vb 2
+\& #define abs(n) _\|_builtin_abs ((n))
+\& #define strcpy(d, s) _\|_builtin_strcpy ((d), (s))
+.Ve
+.IP "\fB\-fhosted\fR" 4
+.IX Item "-fhosted"
+Assert that compilation takes place in a hosted environment. This implies
+\&\fB\-fbuiltin\fR. A hosted environment is one in which the
+entire standard library is available, and in which \f(CW\*(C`main\*(C'\fR has a return
+type of \f(CW\*(C`int\*(C'\fR. Examples are nearly everything except a kernel.
+This is equivalent to \fB\-fno\-freestanding\fR.
+.IP "\fB\-ffreestanding\fR" 4
+.IX Item "-ffreestanding"
+Assert that compilation takes place in a freestanding environment. This
+implies \fB\-fno\-builtin\fR. A freestanding environment
+is one in which the standard library may not exist, and program startup may
+not necessarily be at \f(CW\*(C`main\*(C'\fR. The most obvious example is an \s-1OS\s0 kernel.
+This is equivalent to \fB\-fno\-hosted\fR.
+.IP "\fB\-fopenmp\fR" 4
+.IX Item "-fopenmp"
+Enable handling of OpenMP directives \f(CW\*(C`#pragma omp\*(C'\fR in C/\*(C+ and
+\&\f(CW\*(C`!$omp\*(C'\fR in Fortran. When \fB\-fopenmp\fR is specified, the
+compiler generates parallel code according to the OpenMP Application
+Program Interface v2.5 <\fBhttp://www.openmp.org/\fR>. This option
+implies \fB\-pthread\fR, and thus is only supported on targets that
+have support for \fB\-pthread\fR.
+.IP "\fB\-fms\-extensions\fR" 4
+.IX Item "-fms-extensions"
+Accept some non-standard constructs used in Microsoft header files.
+.Sp
+Some cases of unnamed fields in structures and unions are only
+accepted with this option.
+.IP "\fB\-trigraphs\fR" 4
+.IX Item "-trigraphs"
+Support \s-1ISO\s0 C trigraphs. The \fB\-ansi\fR option (and \fB\-std\fR
+options for strict \s-1ISO\s0 C conformance) implies \fB\-trigraphs\fR.
+.IP "\fB\-no\-integrated\-cpp\fR" 4
+.IX Item "-no-integrated-cpp"
+Performs a compilation in two passes: preprocessing and compiling. This
+option allows a user supplied \*(L"cc1\*(R", \*(L"cc1plus\*(R", or \*(L"cc1obj\*(R" via the
+\&\fB\-B\fR option. The user supplied compilation step can then add in
+an additional preprocessing step after normal preprocessing but before
+compiling. The default is to use the integrated cpp (internal cpp)
+.Sp
+The semantics of this option will change if \*(L"cc1\*(R", \*(L"cc1plus\*(R", and
+\&\*(L"cc1obj\*(R" are merged.
+.IP "\fB\-traditional\fR" 4
+.IX Item "-traditional"
+.PD 0
+.IP "\fB\-traditional\-cpp\fR" 4
+.IX Item "-traditional-cpp"
+.PD
+Formerly, these options caused \s-1GCC\s0 to attempt to emulate a pre-standard
+C compiler. They are now only supported with the \fB\-E\fR switch.
+The preprocessor continues to support a pre-standard mode. See the \s-1GNU\s0
+\&\s-1CPP\s0 manual for details.
+.IP "\fB\-fcond\-mismatch\fR" 4
+.IX Item "-fcond-mismatch"
+Allow conditional expressions with mismatched types in the second and
+third arguments. The value of such an expression is void. This option
+is not supported for \*(C+.
+.IP "\fB\-flax\-vector\-conversions\fR" 4
+.IX Item "-flax-vector-conversions"
+Allow implicit conversions between vectors with differing numbers of
+elements and/or incompatible element types. This option should not be
+used for new code.
+.IP "\fB\-funsigned\-char\fR" 4
+.IX Item "-funsigned-char"
+Let the type \f(CW\*(C`char\*(C'\fR be unsigned, like \f(CW\*(C`unsigned char\*(C'\fR.
+.Sp
+Each kind of machine has a default for what \f(CW\*(C`char\*(C'\fR should
+be. It is either like \f(CW\*(C`unsigned char\*(C'\fR by default or like
+\&\f(CW\*(C`signed char\*(C'\fR by default.
+.Sp
+Ideally, a portable program should always use \f(CW\*(C`signed char\*(C'\fR or
+\&\f(CW\*(C`unsigned char\*(C'\fR when it depends on the signedness of an object.
+But many programs have been written to use plain \f(CW\*(C`char\*(C'\fR and
+expect it to be signed, or expect it to be unsigned, depending on the
+machines they were written for. This option, and its inverse, let you
+make such a program work with the opposite default.
+.Sp
+The type \f(CW\*(C`char\*(C'\fR is always a distinct type from each of
+\&\f(CW\*(C`signed char\*(C'\fR or \f(CW\*(C`unsigned char\*(C'\fR, even though its behavior
+is always just like one of those two.
+.IP "\fB\-fsigned\-char\fR" 4
+.IX Item "-fsigned-char"
+Let the type \f(CW\*(C`char\*(C'\fR be signed, like \f(CW\*(C`signed char\*(C'\fR.
+.Sp
+Note that this is equivalent to \fB\-fno\-unsigned\-char\fR, which is
+the negative form of \fB\-funsigned\-char\fR. Likewise, the option
+\&\fB\-fno\-signed\-char\fR is equivalent to \fB\-funsigned\-char\fR.
+.IP "\fB\-fsigned\-bitfields\fR" 4
+.IX Item "-fsigned-bitfields"
+.PD 0
+.IP "\fB\-funsigned\-bitfields\fR" 4
+.IX Item "-funsigned-bitfields"
+.IP "\fB\-fno\-signed\-bitfields\fR" 4
+.IX Item "-fno-signed-bitfields"
+.IP "\fB\-fno\-unsigned\-bitfields\fR" 4
+.IX Item "-fno-unsigned-bitfields"
+.PD
+These options control whether a bit-field is signed or unsigned, when the
+declaration does not use either \f(CW\*(C`signed\*(C'\fR or \f(CW\*(C`unsigned\*(C'\fR. By
+default, such a bit-field is signed, because this is consistent: the
+basic integer types such as \f(CW\*(C`int\*(C'\fR are signed types.
+.Sh "Options Controlling \*(C+ Dialect"
+.IX Subsection "Options Controlling Dialect"
+This section describes the command-line options that are only meaningful
+for \*(C+ programs; but you can also use most of the \s-1GNU\s0 compiler options
+regardless of what language your program is in. For example, you
+might compile a file \f(CW\*(C`firstClass.C\*(C'\fR like this:
+.PP
+.Vb 1
+\& g++ \-g \-frepo \-O \-c firstClass.C
+.Ve
+.PP
+In this example, only \fB\-frepo\fR is an option meant
+only for \*(C+ programs; you can use the other options with any
+language supported by \s-1GCC\s0.
+.PP
+Here is a list of options that are \fIonly\fR for compiling \*(C+ programs:
+.IP "\fB\-fabi\-version=\fR\fIn\fR" 4
+.IX Item "-fabi-version=n"
+Use version \fIn\fR of the \*(C+ \s-1ABI\s0. Version 2 is the version of the
+\&\*(C+ \s-1ABI\s0 that first appeared in G++ 3.4. Version 1 is the version of
+the \*(C+ \s-1ABI\s0 that first appeared in G++ 3.2. Version 0 will always be
+the version that conforms most closely to the \*(C+ \s-1ABI\s0 specification.
+Therefore, the \s-1ABI\s0 obtained using version 0 will change as \s-1ABI\s0 bugs
+are fixed.
+.Sp
+The default is version 2.
+.IP "\fB\-fno\-access\-control\fR" 4
+.IX Item "-fno-access-control"
+Turn off all access checking. This switch is mainly useful for working
+around bugs in the access control code.
+.IP "\fB\-fcheck\-new\fR" 4
+.IX Item "-fcheck-new"
+Check that the pointer returned by \f(CW\*(C`operator new\*(C'\fR is non-null
+before attempting to modify the storage allocated. This check is
+normally unnecessary because the \*(C+ standard specifies that
+\&\f(CW\*(C`operator new\*(C'\fR will only return \f(CW0\fR if it is declared
+\&\fB\f(BIthrow()\fB\fR, in which case the compiler will always check the
+return value even without this option. In all other cases, when
+\&\f(CW\*(C`operator new\*(C'\fR has a non-empty exception specification, memory
+exhaustion is signalled by throwing \f(CW\*(C`std::bad_alloc\*(C'\fR. See also
+\&\fBnew (nothrow)\fR.
+.IP "\fB\-fconserve\-space\fR" 4
+.IX Item "-fconserve-space"
+Put uninitialized or runtime-initialized global variables into the
+common segment, as C does. This saves space in the executable at the
+cost of not diagnosing duplicate definitions. If you compile with this
+flag and your program mysteriously crashes after \f(CW\*(C`main()\*(C'\fR has
+completed, you may have an object that is being destroyed twice because
+two definitions were merged.
+.Sp
+This option is no longer useful on most targets, now that support has
+been added for putting variables into \s-1BSS\s0 without making them common.
+.IP "\fB\-fno\-deduce\-init\-list\fR" 4
+.IX Item "-fno-deduce-init-list"
+Disable deduction of a template type parameter as
+std::initializer_list from a brace-enclosed initializer list, i.e.
+.Sp
+.Vb 4
+\& template <class T> auto forward(T t) \-> decltype (realfn (t))
+\& {
+\& return realfn (t);
+\& }
+\&
+\& void f()
+\& {
+\& forward({1,2}); // call forward<std::initializer_list<int>>
+\& }
+.Ve
+.Sp
+This option is present because this deduction is an extension to the
+current specification in the \*(C+0x working draft, and there was
+some concern about potential overload resolution problems.
+.IP "\fB\-ffriend\-injection\fR" 4
+.IX Item "-ffriend-injection"
+Inject friend functions into the enclosing namespace, so that they are
+visible outside the scope of the class in which they are declared.
+Friend functions were documented to work this way in the old Annotated
+\&\*(C+ Reference Manual, and versions of G++ before 4.1 always worked
+that way. However, in \s-1ISO\s0 \*(C+ a friend function which is not declared
+in an enclosing scope can only be found using argument dependent
+lookup. This option causes friends to be injected as they were in
+earlier releases.
+.Sp
+This option is for compatibility, and may be removed in a future
+release of G++.
+.IP "\fB\-fno\-elide\-constructors\fR" 4
+.IX Item "-fno-elide-constructors"
+The \*(C+ standard allows an implementation to omit creating a temporary
+which is only used to initialize another object of the same type.
+Specifying this option disables that optimization, and forces G++ to
+call the copy constructor in all cases.
+.IP "\fB\-fno\-enforce\-eh\-specs\fR" 4
+.IX Item "-fno-enforce-eh-specs"
+Don't generate code to check for violation of exception specifications
+at runtime. This option violates the \*(C+ standard, but may be useful
+for reducing code size in production builds, much like defining
+\&\fB\s-1NDEBUG\s0\fR. This does not give user code permission to throw
+exceptions in violation of the exception specifications; the compiler
+will still optimize based on the specifications, so throwing an
+unexpected exception will result in undefined behavior.
+.IP "\fB\-ffor\-scope\fR" 4
+.IX Item "-ffor-scope"
+.PD 0
+.IP "\fB\-fno\-for\-scope\fR" 4
+.IX Item "-fno-for-scope"
+.PD
+If \fB\-ffor\-scope\fR is specified, the scope of variables declared in
+a \fIfor-init-statement\fR is limited to the \fBfor\fR loop itself,
+as specified by the \*(C+ standard.
+If \fB\-fno\-for\-scope\fR is specified, the scope of variables declared in
+a \fIfor-init-statement\fR extends to the end of the enclosing scope,
+as was the case in old versions of G++, and other (traditional)
+implementations of \*(C+.
+.Sp
+The default if neither flag is given to follow the standard,
+but to allow and give a warning for old-style code that would
+otherwise be invalid, or have different behavior.
+.IP "\fB\-fno\-gnu\-keywords\fR" 4
+.IX Item "-fno-gnu-keywords"
+Do not recognize \f(CW\*(C`typeof\*(C'\fR as a keyword, so that code can use this
+word as an identifier. You can use the keyword \f(CW\*(C`_\|_typeof_\|_\*(C'\fR instead.
+\&\fB\-ansi\fR implies \fB\-fno\-gnu\-keywords\fR.
+.IP "\fB\-fno\-implicit\-templates\fR" 4
+.IX Item "-fno-implicit-templates"
+Never emit code for non-inline templates which are instantiated
+implicitly (i.e. by use); only emit code for explicit instantiations.
+.IP "\fB\-fno\-implicit\-inline\-templates\fR" 4
+.IX Item "-fno-implicit-inline-templates"
+Don't emit code for implicit instantiations of inline templates, either.
+The default is to handle inlines differently so that compiles with and
+without optimization will need the same set of explicit instantiations.
+.IP "\fB\-fno\-implement\-inlines\fR" 4
+.IX Item "-fno-implement-inlines"
+To save space, do not emit out-of-line copies of inline functions
+controlled by \fB#pragma implementation\fR. This will cause linker
+errors if these functions are not inlined everywhere they are called.
+.IP "\fB\-fms\-extensions\fR" 4
+.IX Item "-fms-extensions"
+Disable pedantic warnings about constructs used in \s-1MFC\s0, such as implicit
+int and getting a pointer to member function via non-standard syntax.
+.IP "\fB\-fno\-nonansi\-builtins\fR" 4
+.IX Item "-fno-nonansi-builtins"
+Disable built-in declarations of functions that are not mandated by
+\&\s-1ANSI/ISO\s0 C. These include \f(CW\*(C`ffs\*(C'\fR, \f(CW\*(C`alloca\*(C'\fR, \f(CW\*(C`_exit\*(C'\fR,
+\&\f(CW\*(C`index\*(C'\fR, \f(CW\*(C`bzero\*(C'\fR, \f(CW\*(C`conjf\*(C'\fR, and other related functions.
+.IP "\fB\-fno\-operator\-names\fR" 4
+.IX Item "-fno-operator-names"
+Do not treat the operator name keywords \f(CW\*(C`and\*(C'\fR, \f(CW\*(C`bitand\*(C'\fR,
+\&\f(CW\*(C`bitor\*(C'\fR, \f(CW\*(C`compl\*(C'\fR, \f(CW\*(C`not\*(C'\fR, \f(CW\*(C`or\*(C'\fR and \f(CW\*(C`xor\*(C'\fR as
+synonyms as keywords.
+.IP "\fB\-fno\-optional\-diags\fR" 4
+.IX Item "-fno-optional-diags"
+Disable diagnostics that the standard says a compiler does not need to
+issue. Currently, the only such diagnostic issued by G++ is the one for
+a name having multiple meanings within a class.
+.IP "\fB\-fpermissive\fR" 4
+.IX Item "-fpermissive"
+Downgrade some diagnostics about nonconformant code from errors to
+warnings. Thus, using \fB\-fpermissive\fR will allow some
+nonconforming code to compile.
+.IP "\fB\-frepo\fR" 4
+.IX Item "-frepo"
+Enable automatic template instantiation at link time. This option also
+implies \fB\-fno\-implicit\-templates\fR.
+.IP "\fB\-fno\-rtti\fR" 4
+.IX Item "-fno-rtti"
+Disable generation of information about every class with virtual
+functions for use by the \*(C+ runtime type identification features
+(\fBdynamic_cast\fR and \fBtypeid\fR). If you don't use those parts
+of the language, you can save some space by using this flag. Note that
+exception handling uses the same information, but it will generate it as
+needed. The \fBdynamic_cast\fR operator can still be used for casts that
+do not require runtime type information, i.e. casts to \f(CW\*(C`void *\*(C'\fR or to
+unambiguous base classes.
+.IP "\fB\-fstats\fR" 4
+.IX Item "-fstats"
+Emit statistics about front-end processing at the end of the compilation.
+This information is generally only useful to the G++ development team.
+.IP "\fB\-ftemplate\-depth\-\fR\fIn\fR" 4
+.IX Item "-ftemplate-depth-n"
+Set the maximum instantiation depth for template classes to \fIn\fR.
+A limit on the template instantiation depth is needed to detect
+endless recursions during template class instantiation. \s-1ANSI/ISO\s0 \*(C+
+conforming programs must not rely on a maximum depth greater than 17.
+.IP "\fB\-fno\-threadsafe\-statics\fR" 4
+.IX Item "-fno-threadsafe-statics"
+Do not emit the extra code to use the routines specified in the \*(C+
+\&\s-1ABI\s0 for thread-safe initialization of local statics. You can use this
+option to reduce code size slightly in code that doesn't need to be
+thread-safe.
+.IP "\fB\-fuse\-cxa\-atexit\fR" 4
+.IX Item "-fuse-cxa-atexit"
+Register destructors for objects with static storage duration with the
+\&\f(CW\*(C`_\|_cxa_atexit\*(C'\fR function rather than the \f(CW\*(C`atexit\*(C'\fR function.
+This option is required for fully standards-compliant handling of static
+destructors, but will only work if your C library supports
+\&\f(CW\*(C`_\|_cxa_atexit\*(C'\fR.
+.IP "\fB\-fno\-use\-cxa\-get\-exception\-ptr\fR" 4
+.IX Item "-fno-use-cxa-get-exception-ptr"
+Don't use the \f(CW\*(C`_\|_cxa_get_exception_ptr\*(C'\fR runtime routine. This
+will cause \f(CW\*(C`std::uncaught_exception\*(C'\fR to be incorrect, but is necessary
+if the runtime routine is not available.
+.IP "\fB\-fvisibility\-inlines\-hidden\fR" 4
+.IX Item "-fvisibility-inlines-hidden"
+This switch declares that the user does not attempt to compare
+pointers to inline methods where the addresses of the two functions
+were taken in different shared objects.
+.Sp
+The effect of this is that \s-1GCC\s0 may, effectively, mark inline methods with
+\&\f(CW\*(C`_\|_attribute_\|_ ((visibility ("hidden")))\*(C'\fR so that they do not
+appear in the export table of a \s-1DSO\s0 and do not require a \s-1PLT\s0 indirection
+when used within the \s-1DSO\s0. Enabling this option can have a dramatic effect
+on load and link times of a \s-1DSO\s0 as it massively reduces the size of the
+dynamic export table when the library makes heavy use of templates.
+.Sp
+The behavior of this switch is not quite the same as marking the
+methods as hidden directly, because it does not affect static variables
+local to the function or cause the compiler to deduce that
+the function is defined in only one shared object.
+.Sp
+You may mark a method as having a visibility explicitly to negate the
+effect of the switch for that method. For example, if you do want to
+compare pointers to a particular inline method, you might mark it as
+having default visibility. Marking the enclosing class with explicit
+visibility will have no effect.
+.Sp
+Explicitly instantiated inline methods are unaffected by this option
+as their linkage might otherwise cross a shared library boundary.
+.IP "\fB\-fvisibility\-ms\-compat\fR" 4
+.IX Item "-fvisibility-ms-compat"
+This flag attempts to use visibility settings to make \s-1GCC\s0's \*(C+
+linkage model compatible with that of Microsoft Visual Studio.
+.Sp
+The flag makes these changes to \s-1GCC\s0's linkage model:
+.RS 4
+.IP "1." 4
+It sets the default visibility to \f(CW\*(C`hidden\*(C'\fR, like
+\&\fB\-fvisibility=hidden\fR.
+.IP "2." 4
+Types, but not their members, are not hidden by default.
+.IP "3." 4
+The One Definition Rule is relaxed for types without explicit
+visibility specifications which are defined in more than one different
+shared object: those declarations are permitted if they would have
+been permitted when this option was not used.
+.RE
+.RS 4
+.Sp
+In new code it is better to use \fB\-fvisibility=hidden\fR and
+export those classes which are intended to be externally visible.
+Unfortunately it is possible for code to rely, perhaps accidentally,
+on the Visual Studio behavior.
+.Sp
+Among the consequences of these changes are that static data members
+of the same type with the same name but defined in different shared
+objects will be different, so changing one will not change the other;
+and that pointers to function members defined in different shared
+objects may not compare equal. When this flag is given, it is a
+violation of the \s-1ODR\s0 to define types with the same name differently.
+.RE
+.IP "\fB\-fno\-weak\fR" 4
+.IX Item "-fno-weak"
+Do not use weak symbol support, even if it is provided by the linker.
+By default, G++ will use weak symbols if they are available. This
+option exists only for testing, and should not be used by end-users;
+it will result in inferior code and has no benefits. This option may
+be removed in a future release of G++.
+.IP "\fB\-nostdinc++\fR" 4
+.IX Item "-nostdinc++"
+Do not search for header files in the standard directories specific to
+\&\*(C+, but do still search the other standard directories. (This option
+is used when building the \*(C+ library.)
+.PP
+In addition, these optimization, warning, and code generation options
+have meanings only for \*(C+ programs:
+.IP "\fB\-fno\-default\-inline\fR" 4
+.IX Item "-fno-default-inline"
+Do not assume \fBinline\fR for functions defined inside a class scope.
+ Note that these
+functions will have linkage like inline functions; they just won't be
+inlined by default.
+.IP "\fB\-Wabi\fR (C, Objective-C, \*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wabi (C, Objective-C, and Objective- only)"
+Warn when G++ generates code that is probably not compatible with the
+vendor-neutral \*(C+ \s-1ABI\s0. Although an effort has been made to warn about
+all such cases, there are probably some cases that are not warned about,
+even though G++ is generating incompatible code. There may also be
+cases where warnings are emitted even though the code that is generated
+will be compatible.
+.Sp
+You should rewrite your code to avoid these warnings if you are
+concerned about the fact that code generated by G++ may not be binary
+compatible with code generated by other compilers.
+.Sp
+The known incompatibilities at this point include:
+.RS 4
+.IP "\(bu" 4
+Incorrect handling of tail-padding for bit-fields. G++ may attempt to
+pack data into the same byte as a base class. For example:
+.Sp
+.Vb 2
+\& struct A { virtual void f(); int f1 : 1; };
+\& struct B : public A { int f2 : 1; };
+.Ve
+.Sp
+In this case, G++ will place \f(CW\*(C`B::f2\*(C'\fR into the same byte
+as\f(CW\*(C`A::f1\*(C'\fR; other compilers will not. You can avoid this problem
+by explicitly padding \f(CW\*(C`A\*(C'\fR so that its size is a multiple of the
+byte size on your platform; that will cause G++ and other compilers to
+layout \f(CW\*(C`B\*(C'\fR identically.
+.IP "\(bu" 4
+Incorrect handling of tail-padding for virtual bases. G++ does not use
+tail padding when laying out virtual bases. For example:
+.Sp
+.Vb 3
+\& struct A { virtual void f(); char c1; };
+\& struct B { B(); char c2; };
+\& struct C : public A, public virtual B {};
+.Ve
+.Sp
+In this case, G++ will not place \f(CW\*(C`B\*(C'\fR into the tail-padding for
+\&\f(CW\*(C`A\*(C'\fR; other compilers will. You can avoid this problem by
+explicitly padding \f(CW\*(C`A\*(C'\fR so that its size is a multiple of its
+alignment (ignoring virtual base classes); that will cause G++ and other
+compilers to layout \f(CW\*(C`C\*(C'\fR identically.
+.IP "\(bu" 4
+Incorrect handling of bit-fields with declared widths greater than that
+of their underlying types, when the bit-fields appear in a union. For
+example:
+.Sp
+.Vb 1
+\& union U { int i : 4096; };
+.Ve
+.Sp
+Assuming that an \f(CW\*(C`int\*(C'\fR does not have 4096 bits, G++ will make the
+union too small by the number of bits in an \f(CW\*(C`int\*(C'\fR.
+.IP "\(bu" 4
+Empty classes can be placed at incorrect offsets. For example:
+.Sp
+.Vb 1
+\& struct A {};
+\&
+\& struct B {
+\& A a;
+\& virtual void f ();
+\& };
+\&
+\& struct C : public B, public A {};
+.Ve
+.Sp
+G++ will place the \f(CW\*(C`A\*(C'\fR base class of \f(CW\*(C`C\*(C'\fR at a nonzero offset;
+it should be placed at offset zero. G++ mistakenly believes that the
+\&\f(CW\*(C`A\*(C'\fR data member of \f(CW\*(C`B\*(C'\fR is already at offset zero.
+.IP "\(bu" 4
+Names of template functions whose types involve \f(CW\*(C`typename\*(C'\fR or
+template template parameters can be mangled incorrectly.
+.Sp
+.Vb 2
+\& template <typename Q>
+\& void f(typename Q::X) {}
+\&
+\& template <template <typename> class Q>
+\& void f(typename Q<int>::X) {}
+.Ve
+.Sp
+Instantiations of these templates may be mangled incorrectly.
+.RE
+.RS 4
+.Sp
+It also warns psABI related changes. The known psABI changes at this
+point include:
+.IP "\(bu" 4
+For SYSV/x86\-64, when passing union with long double, it is changed to
+pass in memory as specified in psABI. For example:
+.Sp
+.Vb 4
+\& union U {
+\& long double ld;
+\& int i;
+\& };
+.Ve
+.Sp
+\&\f(CW\*(C`union U\*(C'\fR will always be passed in memory.
+.RE
+.RS 4
+.RE
+.IP "\fB\-Wctor\-dtor\-privacy\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wctor-dtor-privacy ( and Objective- only)"
+Warn when a class seems unusable because all the constructors or
+destructors in that class are private, and it has neither friends nor
+public static member functions.
+.IP "\fB\-Wnon\-virtual\-dtor\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wnon-virtual-dtor ( and Objective- only)"
+Warn when a class has virtual functions and accessible non-virtual
+destructor, in which case it would be possible but unsafe to delete
+an instance of a derived class through a pointer to the base class.
+This warning is also enabled if \-Weffc++ is specified.
+.IP "\fB\-Wreorder\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wreorder ( and Objective- only)"
+Warn when the order of member initializers given in the code does not
+match the order in which they must be executed. For instance:
+.Sp
+.Vb 5
+\& struct A {
+\& int i;
+\& int j;
+\& A(): j (0), i (1) { }
+\& };
+.Ve
+.Sp
+The compiler will rearrange the member initializers for \fBi\fR
+and \fBj\fR to match the declaration order of the members, emitting
+a warning to that effect. This warning is enabled by \fB\-Wall\fR.
+.PP
+The following \fB\-W...\fR options are not affected by \fB\-Wall\fR.
+.IP "\fB\-Weffc++\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Weffc++ ( and Objective- only)"
+Warn about violations of the following style guidelines from Scott Meyers'
+\&\fIEffective \*(C+\fR book:
+.RS 4
+.IP "\(bu" 4
+Item 11: Define a copy constructor and an assignment operator for classes
+with dynamically allocated memory.
+.IP "\(bu" 4
+Item 12: Prefer initialization to assignment in constructors.
+.IP "\(bu" 4
+Item 14: Make destructors virtual in base classes.
+.IP "\(bu" 4
+Item 15: Have \f(CW\*(C`operator=\*(C'\fR return a reference to \f(CW*this\fR.
+.IP "\(bu" 4
+Item 23: Don't try to return a reference when you must return an object.
+.RE
+.RS 4
+.Sp
+Also warn about violations of the following style guidelines from
+Scott Meyers' \fIMore Effective \*(C+\fR book:
+.IP "\(bu" 4
+Item 6: Distinguish between prefix and postfix forms of increment and
+decrement operators.
+.IP "\(bu" 4
+Item 7: Never overload \f(CW\*(C`&&\*(C'\fR, \f(CW\*(C`||\*(C'\fR, or \f(CW\*(C`,\*(C'\fR.
+.RE
+.RS 4
+.Sp
+When selecting this option, be aware that the standard library
+headers do not obey all of these guidelines; use \fBgrep \-v\fR
+to filter out those warnings.
+.RE
+.IP "\fB\-Wstrict\-null\-sentinel\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wstrict-null-sentinel ( and Objective- only)"
+Warn also about the use of an uncasted \f(CW\*(C`NULL\*(C'\fR as sentinel. When
+compiling only with \s-1GCC\s0 this is a valid sentinel, as \f(CW\*(C`NULL\*(C'\fR is defined
+to \f(CW\*(C`_\|_null\*(C'\fR. Although it is a null pointer constant not a null pointer,
+it is guaranteed to be of the same size as a pointer. But this use is
+not portable across different compilers.
+.IP "\fB\-Wno\-non\-template\-friend\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wno-non-template-friend ( and Objective- only)"
+Disable warnings when non-templatized friend functions are declared
+within a template. Since the advent of explicit template specification
+support in G++, if the name of the friend is an unqualified-id (i.e.,
+\&\fBfriend foo(int)\fR), the \*(C+ language specification demands that the
+friend declare or define an ordinary, nontemplate function. (Section
+14.5.3). Before G++ implemented explicit specification, unqualified-ids
+could be interpreted as a particular specialization of a templatized
+function. Because this non-conforming behavior is no longer the default
+behavior for G++, \fB\-Wnon\-template\-friend\fR allows the compiler to
+check existing code for potential trouble spots and is on by default.
+This new compiler behavior can be turned off with
+\&\fB\-Wno\-non\-template\-friend\fR which keeps the conformant compiler code
+but disables the helpful warning.
+.IP "\fB\-Wold\-style\-cast\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wold-style-cast ( and Objective- only)"
+Warn if an old-style (C\-style) cast to a non-void type is used within
+a \*(C+ program. The new-style casts (\fBdynamic_cast\fR,
+\&\fBstatic_cast\fR, \fBreinterpret_cast\fR, and \fBconst_cast\fR) are
+less vulnerable to unintended effects and much easier to search for.
+.IP "\fB\-Woverloaded\-virtual\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Woverloaded-virtual ( and Objective- only)"
+Warn when a function declaration hides virtual functions from a
+base class. For example, in:
+.Sp
+.Vb 3
+\& struct A {
+\& virtual void f();
+\& };
+\&
+\& struct B: public A {
+\& void f(int);
+\& };
+.Ve
+.Sp
+the \f(CW\*(C`A\*(C'\fR class version of \f(CW\*(C`f\*(C'\fR is hidden in \f(CW\*(C`B\*(C'\fR, and code
+like:
+.Sp
+.Vb 2
+\& B* b;
+\& b\->f();
+.Ve
+.Sp
+will fail to compile.
+.IP "\fB\-Wno\-pmf\-conversions\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wno-pmf-conversions ( and Objective- only)"
+Disable the diagnostic for converting a bound pointer to member function
+to a plain pointer.
+.IP "\fB\-Wsign\-promo\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wsign-promo ( and Objective- only)"
+Warn when overload resolution chooses a promotion from unsigned or
+enumerated type to a signed type, over a conversion to an unsigned type of
+the same size. Previous versions of G++ would try to preserve
+unsignedness, but the standard mandates the current behavior.
+.Sp
+.Vb 4
+\& struct A {
+\& operator int ();
+\& A& operator = (int);
+\& };
+\&
+\& main ()
+\& {
+\& A a,b;
+\& a = b;
+\& }
+.Ve
+.Sp
+In this example, G++ will synthesize a default \fBA& operator =
+(const A&);\fR, while cfront will use the user-defined \fBoperator =\fR.
+.Sh "Options Controlling Objective-C and Objective\-\*(C+ Dialects"
+.IX Subsection "Options Controlling Objective-C and Objective- Dialects"
+(\s-1NOTE:\s0 This manual does not describe the Objective-C and Objective\-\*(C+
+languages themselves. See
+.PP
+This section describes the command-line options that are only meaningful
+for Objective-C and Objective\-\*(C+ programs, but you can also use most of
+the language-independent \s-1GNU\s0 compiler options.
+For example, you might compile a file \f(CW\*(C`some_class.m\*(C'\fR like this:
+.PP
+.Vb 1
+\& gcc \-g \-fgnu\-runtime \-O \-c some_class.m
+.Ve
+.PP
+In this example, \fB\-fgnu\-runtime\fR is an option meant only for
+Objective-C and Objective\-\*(C+ programs; you can use the other options with
+any language supported by \s-1GCC\s0.
+.PP
+Note that since Objective-C is an extension of the C language, Objective-C
+compilations may also use options specific to the C front-end (e.g.,
+\&\fB\-Wtraditional\fR). Similarly, Objective\-\*(C+ compilations may use
+\&\*(C+\-specific options (e.g., \fB\-Wabi\fR).
+.PP
+Here is a list of options that are \fIonly\fR for compiling Objective-C
+and Objective\-\*(C+ programs:
+.IP "\fB\-fconstant\-string\-class=\fR\fIclass-name\fR" 4
+.IX Item "-fconstant-string-class=class-name"
+Use \fIclass-name\fR as the name of the class to instantiate for each
+literal string specified with the syntax \f(CW\*(C`@"..."\*(C'\fR. The default
+class name is \f(CW\*(C`NXConstantString\*(C'\fR if the \s-1GNU\s0 runtime is being used, and
+\&\f(CW\*(C`NSConstantString\*(C'\fR if the NeXT runtime is being used (see below). The
+\&\fB\-fconstant\-cfstrings\fR option, if also present, will override the
+\&\fB\-fconstant\-string\-class\fR setting and cause \f(CW\*(C`@"..."\*(C'\fR literals
+to be laid out as constant CoreFoundation strings.
+.IP "\fB\-fgnu\-runtime\fR" 4
+.IX Item "-fgnu-runtime"
+Generate object code compatible with the standard \s-1GNU\s0 Objective-C
+runtime. This is the default for most types of systems.
+.IP "\fB\-fnext\-runtime\fR" 4
+.IX Item "-fnext-runtime"
+Generate output compatible with the NeXT runtime. This is the default
+for NeXT-based systems, including Darwin and Mac \s-1OS\s0 X. The macro
+\&\f(CW\*(C`_\|_NEXT_RUNTIME_\|_\*(C'\fR is predefined if (and only if) this option is
+used.
+.IP "\fB\-fno\-nil\-receivers\fR" 4
+.IX Item "-fno-nil-receivers"
+Assume that all Objective-C message dispatches (e.g.,
+\&\f(CW\*(C`[receiver message:arg]\*(C'\fR) in this translation unit ensure that the receiver
+is not \f(CW\*(C`nil\*(C'\fR. This allows for more efficient entry points in the runtime
+to be used. Currently, this option is only available in conjunction with
+the NeXT runtime on Mac \s-1OS\s0 X 10.3 and later.
+.IP "\fB\-fobjc\-call\-cxx\-cdtors\fR" 4
+.IX Item "-fobjc-call-cxx-cdtors"
+For each Objective-C class, check if any of its instance variables is a
+\&\*(C+ object with a non-trivial default constructor. If so, synthesize a
+special \f(CW\*(C`\- (id) .cxx_construct\*(C'\fR instance method that will run
+non-trivial default constructors on any such instance variables, in order,
+and then return \f(CW\*(C`self\*(C'\fR. Similarly, check if any instance variable
+is a \*(C+ object with a non-trivial destructor, and if so, synthesize a
+special \f(CW\*(C`\- (void) .cxx_destruct\*(C'\fR method that will run
+all such default destructors, in reverse order.
+.Sp
+The \f(CW\*(C`\- (id) .cxx_construct\*(C'\fR and/or \f(CW\*(C`\- (void) .cxx_destruct\*(C'\fR methods
+thusly generated will only operate on instance variables declared in the
+current Objective-C class, and not those inherited from superclasses. It
+is the responsibility of the Objective-C runtime to invoke all such methods
+in an object's inheritance hierarchy. The \f(CW\*(C`\- (id) .cxx_construct\*(C'\fR methods
+will be invoked by the runtime immediately after a new object
+instance is allocated; the \f(CW\*(C`\- (void) .cxx_destruct\*(C'\fR methods will
+be invoked immediately before the runtime deallocates an object instance.
+.Sp
+As of this writing, only the NeXT runtime on Mac \s-1OS\s0 X 10.4 and later has
+support for invoking the \f(CW\*(C`\- (id) .cxx_construct\*(C'\fR and
+\&\f(CW\*(C`\- (void) .cxx_destruct\*(C'\fR methods.
+.IP "\fB\-fobjc\-direct\-dispatch\fR" 4
+.IX Item "-fobjc-direct-dispatch"
+Allow fast jumps to the message dispatcher. On Darwin this is
+accomplished via the comm page.
+.IP "\fB\-fobjc\-exceptions\fR" 4
+.IX Item "-fobjc-exceptions"
+Enable syntactic support for structured exception handling in Objective-C,
+similar to what is offered by \*(C+ and Java. This option is
+unavailable in conjunction with the NeXT runtime on Mac \s-1OS\s0 X 10.2 and
+earlier.
+.Sp
+.Vb 10
+\& @try {
+\& ...
+\& @throw expr;
+\& ...
+\& }
+\& @catch (AnObjCClass *exc) {
+\& ...
+\& @throw expr;
+\& ...
+\& @throw;
+\& ...
+\& }
+\& @catch (AnotherClass *exc) {
+\& ...
+\& }
+\& @catch (id allOthers) {
+\& ...
+\& }
+\& @finally {
+\& ...
+\& @throw expr;
+\& ...
+\& }
+.Ve
+.Sp
+The \f(CW@throw\fR statement may appear anywhere in an Objective-C or
+Objective\-\*(C+ program; when used inside of a \f(CW@catch\fR block, the
+\&\f(CW@throw\fR may appear without an argument (as shown above), in which case
+the object caught by the \f(CW@catch\fR will be rethrown.
+.Sp
+Note that only (pointers to) Objective-C objects may be thrown and
+caught using this scheme. When an object is thrown, it will be caught
+by the nearest \f(CW@catch\fR clause capable of handling objects of that type,
+analogously to how \f(CW\*(C`catch\*(C'\fR blocks work in \*(C+ and Java. A
+\&\f(CW\*(C`@catch(id ...)\*(C'\fR clause (as shown above) may also be provided to catch
+any and all Objective-C exceptions not caught by previous \f(CW@catch\fR
+clauses (if any).
+.Sp
+The \f(CW@finally\fR clause, if present, will be executed upon exit from the
+immediately preceding \f(CW\*(C`@try ... @catch\*(C'\fR section. This will happen
+regardless of whether any exceptions are thrown, caught or rethrown
+inside the \f(CW\*(C`@try ... @catch\*(C'\fR section, analogously to the behavior
+of the \f(CW\*(C`finally\*(C'\fR clause in Java.
+.Sp
+There are several caveats to using the new exception mechanism:
+.RS 4
+.IP "\(bu" 4
+Although currently designed to be binary compatible with \f(CW\*(C`NS_HANDLER\*(C'\fR\-style
+idioms provided by the \f(CW\*(C`NSException\*(C'\fR class, the new
+exceptions can only be used on Mac \s-1OS\s0 X 10.3 (Panther) and later
+systems, due to additional functionality needed in the (NeXT) Objective-C
+runtime.
+.IP "\(bu" 4
+As mentioned above, the new exceptions do not support handling
+types other than Objective-C objects. Furthermore, when used from
+Objective\-\*(C+, the Objective-C exception model does not interoperate with \*(C+
+exceptions at this time. This means you cannot \f(CW@throw\fR an exception
+from Objective-C and \f(CW\*(C`catch\*(C'\fR it in \*(C+, or vice versa
+(i.e., \f(CW\*(C`throw ... @catch\*(C'\fR).
+.RE
+.RS 4
+.Sp
+The \fB\-fobjc\-exceptions\fR switch also enables the use of synchronization
+blocks for thread-safe execution:
+.Sp
+.Vb 3
+\& @synchronized (ObjCClass *guard) {
+\& ...
+\& }
+.Ve
+.Sp
+Upon entering the \f(CW@synchronized\fR block, a thread of execution shall
+first check whether a lock has been placed on the corresponding \f(CW\*(C`guard\*(C'\fR
+object by another thread. If it has, the current thread shall wait until
+the other thread relinquishes its lock. Once \f(CW\*(C`guard\*(C'\fR becomes available,
+the current thread will place its own lock on it, execute the code contained in
+the \f(CW@synchronized\fR block, and finally relinquish the lock (thereby
+making \f(CW\*(C`guard\*(C'\fR available to other threads).
+.Sp
+Unlike Java, Objective-C does not allow for entire methods to be marked
+\&\f(CW@synchronized\fR. Note that throwing exceptions out of
+\&\f(CW@synchronized\fR blocks is allowed, and will cause the guarding object
+to be unlocked properly.
+.RE
+.IP "\fB\-fobjc\-gc\fR" 4
+.IX Item "-fobjc-gc"
+Enable garbage collection (\s-1GC\s0) in Objective-C and Objective\-\*(C+ programs.
+.IP "\fB\-freplace\-objc\-classes\fR" 4
+.IX Item "-freplace-objc-classes"
+Emit a special marker instructing \fB\f(BIld\fB\|(1)\fR not to statically link in
+the resulting object file, and allow \fB\f(BIdyld\fB\|(1)\fR to load it in at
+run time instead. This is used in conjunction with the Fix-and-Continue
+debugging mode, where the object file in question may be recompiled and
+dynamically reloaded in the course of program execution, without the need
+to restart the program itself. Currently, Fix-and-Continue functionality
+is only available in conjunction with the NeXT runtime on Mac \s-1OS\s0 X 10.3
+and later.
+.IP "\fB\-fzero\-link\fR" 4
+.IX Item "-fzero-link"
+When compiling for the NeXT runtime, the compiler ordinarily replaces calls
+to \f(CW\*(C`objc_getClass("...")\*(C'\fR (when the name of the class is known at
+compile time) with static class references that get initialized at load time,
+which improves run-time performance. Specifying the \fB\-fzero\-link\fR flag
+suppresses this behavior and causes calls to \f(CW\*(C`objc_getClass("...")\*(C'\fR
+to be retained. This is useful in Zero-Link debugging mode, since it allows
+for individual class implementations to be modified during program execution.
+.IP "\fB\-gen\-decls\fR" 4
+.IX Item "-gen-decls"
+Dump interface declarations for all classes seen in the source file to a
+file named \fI\fIsourcename\fI.decl\fR.
+.IP "\fB\-Wassign\-intercept\fR (Objective-C and Objective\-\*(C+ only)" 4
+.IX Item "-Wassign-intercept (Objective-C and Objective- only)"
+Warn whenever an Objective-C assignment is being intercepted by the
+garbage collector.
+.IP "\fB\-Wno\-protocol\fR (Objective-C and Objective\-\*(C+ only)" 4
+.IX Item "-Wno-protocol (Objective-C and Objective- only)"
+If a class is declared to implement a protocol, a warning is issued for
+every method in the protocol that is not implemented by the class. The
+default behavior is to issue a warning for every method not explicitly
+implemented in the class, even if a method implementation is inherited
+from the superclass. If you use the \fB\-Wno\-protocol\fR option, then
+methods inherited from the superclass are considered to be implemented,
+and no warning is issued for them.
+.IP "\fB\-Wselector\fR (Objective-C and Objective\-\*(C+ only)" 4
+.IX Item "-Wselector (Objective-C and Objective- only)"
+Warn if multiple methods of different types for the same selector are
+found during compilation. The check is performed on the list of methods
+in the final stage of compilation. Additionally, a check is performed
+for each selector appearing in a \f(CW\*(C`@selector(...)\*(C'\fR
+expression, and a corresponding method for that selector has been found
+during compilation. Because these checks scan the method table only at
+the end of compilation, these warnings are not produced if the final
+stage of compilation is not reached, for example because an error is
+found during compilation, or because the \fB\-fsyntax\-only\fR option is
+being used.
+.IP "\fB\-Wstrict\-selector\-match\fR (Objective-C and Objective\-\*(C+ only)" 4
+.IX Item "-Wstrict-selector-match (Objective-C and Objective- only)"
+Warn if multiple methods with differing argument and/or return types are
+found for a given selector when attempting to send a message using this
+selector to a receiver of type \f(CW\*(C`id\*(C'\fR or \f(CW\*(C`Class\*(C'\fR. When this flag
+is off (which is the default behavior), the compiler will omit such warnings
+if any differences found are confined to types which share the same size
+and alignment.
+.IP "\fB\-Wundeclared\-selector\fR (Objective-C and Objective\-\*(C+ only)" 4
+.IX Item "-Wundeclared-selector (Objective-C and Objective- only)"
+Warn if a \f(CW\*(C`@selector(...)\*(C'\fR expression referring to an
+undeclared selector is found. A selector is considered undeclared if no
+method with that name has been declared before the
+\&\f(CW\*(C`@selector(...)\*(C'\fR expression, either explicitly in an
+\&\f(CW@interface\fR or \f(CW@protocol\fR declaration, or implicitly in
+an \f(CW@implementation\fR section. This option always performs its
+checks as soon as a \f(CW\*(C`@selector(...)\*(C'\fR expression is found,
+while \fB\-Wselector\fR only performs its checks in the final stage of
+compilation. This also enforces the coding style convention
+that methods and selectors must be declared before being used.
+.IP "\fB\-print\-objc\-runtime\-info\fR" 4
+.IX Item "-print-objc-runtime-info"
+Generate C header describing the largest structure that is passed by
+value, if any.
+.Sh "Options to Control Diagnostic Messages Formatting"
+.IX Subsection "Options to Control Diagnostic Messages Formatting"
+Traditionally, diagnostic messages have been formatted irrespective of
+the output device's aspect (e.g. its width, ...). The options described
+below can be used to control the diagnostic messages formatting
+algorithm, e.g. how many characters per line, how often source location
+information should be reported. Right now, only the \*(C+ front end can
+honor these options. However it is expected, in the near future, that
+the remaining front ends would be able to digest them correctly.
+.IP "\fB\-fmessage\-length=\fR\fIn\fR" 4
+.IX Item "-fmessage-length=n"
+Try to format error messages so that they fit on lines of about \fIn\fR
+characters. The default is 72 characters for \fBg++\fR and 0 for the rest of
+the front ends supported by \s-1GCC\s0. If \fIn\fR is zero, then no
+line-wrapping will be done; each error message will appear on a single
+line.
+.IP "\fB\-fdiagnostics\-show\-location=once\fR" 4
+.IX Item "-fdiagnostics-show-location=once"
+Only meaningful in line-wrapping mode. Instructs the diagnostic messages
+reporter to emit \fIonce\fR source location information; that is, in
+case the message is too long to fit on a single physical line and has to
+be wrapped, the source location won't be emitted (as prefix) again,
+over and over, in subsequent continuation lines. This is the default
+behavior.
+.IP "\fB\-fdiagnostics\-show\-location=every\-line\fR" 4
+.IX Item "-fdiagnostics-show-location=every-line"
+Only meaningful in line-wrapping mode. Instructs the diagnostic
+messages reporter to emit the same source location information (as
+prefix) for physical lines that result from the process of breaking
+a message which is too long to fit on a single line.
+.IP "\fB\-fdiagnostics\-show\-option\fR" 4
+.IX Item "-fdiagnostics-show-option"
+This option instructs the diagnostic machinery to add text to each
+diagnostic emitted, which indicates which command line option directly
+controls that diagnostic, when such an option is known to the
+diagnostic machinery.
+.IP "\fB\-Wcoverage\-mismatch\fR" 4
+.IX Item "-Wcoverage-mismatch"
+Warn if feedback profiles do not match when using the
+\&\fB\-fprofile\-use\fR option.
+If a source file was changed between \fB\-fprofile\-gen\fR and
+\&\fB\-fprofile\-use\fR, the files with the profile feedback can fail
+to match the source file and \s-1GCC\s0 can not use the profile feedback
+information. By default, \s-1GCC\s0 emits an error message in this case.
+The option \fB\-Wcoverage\-mismatch\fR emits a warning instead of an
+error. \s-1GCC\s0 does not use appropriate feedback profiles, so using this
+option can result in poorly optimized code. This option is useful
+only in the case of very minor changes such as bug fixes to an
+existing code-base.
+.Sh "Options to Request or Suppress Warnings"
+.IX Subsection "Options to Request or Suppress Warnings"
+Warnings are diagnostic messages that report constructions which
+are not inherently erroneous but which are risky or suggest there
+may have been an error.
+.PP
+The following language-independent options do not enable specific
+warnings but control the kinds of diagnostics produced by \s-1GCC\s0.
+.IP "\fB\-fsyntax\-only\fR" 4
+.IX Item "-fsyntax-only"
+Check the code for syntax errors, but don't do anything beyond that.
+.IP "\fB\-w\fR" 4
+.IX Item "-w"
+Inhibit all warning messages.
+.IP "\fB\-Werror\fR" 4
+.IX Item "-Werror"
+Make all warnings into errors.
+.IP "\fB\-Werror=\fR" 4
+.IX Item "-Werror="
+Make the specified warning into an error. The specifier for a warning
+is appended, for example \fB\-Werror=switch\fR turns the warnings
+controlled by \fB\-Wswitch\fR into errors. This switch takes a
+negative form, to be used to negate \fB\-Werror\fR for specific
+warnings, for example \fB\-Wno\-error=switch\fR makes
+\&\fB\-Wswitch\fR warnings not be errors, even when \fB\-Werror\fR
+is in effect. You can use the \fB\-fdiagnostics\-show\-option\fR
+option to have each controllable warning amended with the option which
+controls it, to determine what to use with this option.
+.Sp
+Note that specifying \fB\-Werror=\fR\fIfoo\fR automatically implies
+\&\fB\-W\fR\fIfoo\fR. However, \fB\-Wno\-error=\fR\fIfoo\fR does not
+imply anything.
+.IP "\fB\-Wfatal\-errors\fR" 4
+.IX Item "-Wfatal-errors"
+This option causes the compiler to abort compilation on the first error
+occurred rather than trying to keep going and printing further error
+messages.
+.PP
+You can request many specific warnings with options beginning
+\&\fB\-W\fR, for example \fB\-Wimplicit\fR to request warnings on
+implicit declarations. Each of these specific warning options also
+has a negative form beginning \fB\-Wno\-\fR to turn off warnings; for
+example, \fB\-Wno\-implicit\fR. This manual lists only one of the
+two forms, whichever is not the default. For further,
+language-specific options also refer to \fB\*(C+ Dialect Options\fR and
+\&\fBObjective-C and Objective\-\*(C+ Dialect Options\fR.
+.IP "\fB\-pedantic\fR" 4
+.IX Item "-pedantic"
+Issue all the warnings demanded by strict \s-1ISO\s0 C and \s-1ISO\s0 \*(C+;
+reject all programs that use forbidden extensions, and some other
+programs that do not follow \s-1ISO\s0 C and \s-1ISO\s0 \*(C+. For \s-1ISO\s0 C, follows the
+version of the \s-1ISO\s0 C standard specified by any \fB\-std\fR option used.
+.Sp
+Valid \s-1ISO\s0 C and \s-1ISO\s0 \*(C+ programs should compile properly with or without
+this option (though a rare few will require \fB\-ansi\fR or a
+\&\fB\-std\fR option specifying the required version of \s-1ISO\s0 C). However,
+without this option, certain \s-1GNU\s0 extensions and traditional C and \*(C+
+features are supported as well. With this option, they are rejected.
+.Sp
+\&\fB\-pedantic\fR does not cause warning messages for use of the
+alternate keywords whose names begin and end with \fB_\|_\fR. Pedantic
+warnings are also disabled in the expression that follows
+\&\f(CW\*(C`_\|_extension_\|_\*(C'\fR. However, only system header files should use
+these escape routes; application programs should avoid them.
+.Sp
+Some users try to use \fB\-pedantic\fR to check programs for strict \s-1ISO\s0
+C conformance. They soon find that it does not do quite what they want:
+it finds some non-ISO practices, but not all\-\-\-only those for which
+\&\s-1ISO\s0 C \fIrequires\fR a diagnostic, and some others for which
+diagnostics have been added.
+.Sp
+A feature to report any failure to conform to \s-1ISO\s0 C might be useful in
+some instances, but would require considerable additional work and would
+be quite different from \fB\-pedantic\fR. We don't have plans to
+support such a feature in the near future.
+.Sp
+Where the standard specified with \fB\-std\fR represents a \s-1GNU\s0
+extended dialect of C, such as \fBgnu89\fR or \fBgnu99\fR, there is a
+corresponding \fIbase standard\fR, the version of \s-1ISO\s0 C on which the \s-1GNU\s0
+extended dialect is based. Warnings from \fB\-pedantic\fR are given
+where they are required by the base standard. (It would not make sense
+for such warnings to be given only for features not in the specified \s-1GNU\s0
+C dialect, since by definition the \s-1GNU\s0 dialects of C include all
+features the compiler supports with the given option, and there would be
+nothing to warn about.)
+.IP "\fB\-pedantic\-errors\fR" 4
+.IX Item "-pedantic-errors"
+Like \fB\-pedantic\fR, except that errors are produced rather than
+warnings.
+.IP "\fB\-Wall\fR" 4
+.IX Item "-Wall"
+This enables all the warnings about constructions that some users
+consider questionable, and that are easy to avoid (or modify to
+prevent the warning), even in conjunction with macros. This also
+enables some language-specific warnings described in \fB\*(C+ Dialect
+Options\fR and \fBObjective-C and Objective\-\*(C+ Dialect Options\fR.
+.Sp
+\&\fB\-Wall\fR turns on the following warning flags:
+.Sp
+\&\fB\-Waddress
+\&\-Warray\-bounds\fR (only with\fB \fR\fB\-O2\fR)
+\&\fB\-Wc++0x\-compat
+\&\-Wchar\-subscripts
+\&\-Wimplicit\-int
+\&\-Wimplicit\-function\-declaration
+\&\-Wcomment
+\&\-Wformat
+\&\-Wmain\fR (only for C/ObjC and unless\fB \fR\fB\-ffreestanding\fR)
+\&\fB\-Wmissing\-braces
+\&\-Wnonnull
+\&\-Wparentheses
+\&\-Wpointer\-sign
+\&\-Wreorder
+\&\-Wreturn\-type
+\&\-Wsequence\-point
+\&\-Wsign\-compare\fR (only in \*(C+)
+\&\fB\-Wstrict\-aliasing
+\&\-Wstrict\-overflow=1
+\&\-Wswitch
+\&\-Wtrigraphs
+\&\-Wuninitialized
+\&\-Wunknown\-pragmas
+\&\-Wunused\-function
+\&\-Wunused\-label
+\&\-Wunused\-value
+\&\-Wunused\-variable
+\&\-Wvolatile\-register\-var\fR
+.Sp
+Note that some warning flags are not implied by \fB\-Wall\fR. Some of
+them warn about constructions that users generally do not consider
+questionable, but which occasionally you might wish to check for;
+others warn about constructions that are necessary or hard to avoid in
+some cases, and there is no simple way to modify the code to suppress
+the warning. Some of them are enabled by \fB\-Wextra\fR but many of
+them must be enabled individually.
+.IP "\fB\-Wextra\fR" 4
+.IX Item "-Wextra"
+This enables some extra warning flags that are not enabled by
+\&\fB\-Wall\fR. (This option used to be called \fB\-W\fR. The older
+name is still supported, but the newer name is more descriptive.)
+.Sp
+\&\fB\-Wclobbered
+\&\-Wempty\-body
+\&\-Wignored\-qualifiers
+\&\-Wmissing\-field\-initializers
+\&\-Wmissing\-parameter\-type\fR (C only)
+\&\fB\-Wold\-style\-declaration\fR (C only)
+\&\fB\-Woverride\-init
+\&\-Wsign\-compare
+\&\-Wtype\-limits
+\&\-Wuninitialized
+\&\-Wunused\-parameter\fR (only with\fB \fR\fB\-Wunused\fR\fB \fRor\fB \fR\fB\-Wall\fR) \fB \fR
+.Sp
+The option \fB\-Wextra\fR also prints warning messages for the
+following cases:
+.RS 4
+.IP "\(bu" 4
+A pointer is compared against integer zero with \fB<\fR, \fB<=\fR,
+\&\fB>\fR, or \fB>=\fR.
+.IP "\(bu" 4
+(\*(C+ only) An enumerator and a non-enumerator both appear in a
+conditional expression.
+.IP "\(bu" 4
+(\*(C+ only) Ambiguous virtual bases.
+.IP "\(bu" 4
+(\*(C+ only) Subscripting an array which has been declared \fBregister\fR.
+.IP "\(bu" 4
+(\*(C+ only) Taking the address of a variable which has been declared
+\&\fBregister\fR.
+.IP "\(bu" 4
+(\*(C+ only) A base class is not initialized in a derived class' copy
+constructor.
+.RE
+.RS 4
+.RE
+.IP "\fB\-Wchar\-subscripts\fR" 4
+.IX Item "-Wchar-subscripts"
+Warn if an array subscript has type \f(CW\*(C`char\*(C'\fR. This is a common cause
+of error, as programmers often forget that this type is signed on some
+machines.
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wcomment\fR" 4
+.IX Item "-Wcomment"
+Warn whenever a comment-start sequence \fB/*\fR appears in a \fB/*\fR
+comment, or whenever a Backslash-Newline appears in a \fB//\fR comment.
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wformat\fR" 4
+.IX Item "-Wformat"
+Check calls to \f(CW\*(C`printf\*(C'\fR and \f(CW\*(C`scanf\*(C'\fR, etc., to make sure that
+the arguments supplied have types appropriate to the format string
+specified, and that the conversions specified in the format string make
+sense. This includes standard functions, and others specified by format
+attributes, in the \f(CW\*(C`printf\*(C'\fR,
+\&\f(CW\*(C`scanf\*(C'\fR, \f(CW\*(C`strftime\*(C'\fR and \f(CW\*(C`strfmon\*(C'\fR (an X/Open extension,
+not in the C standard) families (or other target-specific families).
+Which functions are checked without format attributes having been
+specified depends on the standard version selected, and such checks of
+functions without the attribute specified are disabled by
+\&\fB\-ffreestanding\fR or \fB\-fno\-builtin\fR.
+.Sp
+The formats are checked against the format features supported by \s-1GNU\s0
+libc version 2.2. These include all \s-1ISO\s0 C90 and C99 features, as well
+as features from the Single Unix Specification and some \s-1BSD\s0 and \s-1GNU\s0
+extensions. Other library implementations may not support all these
+features; \s-1GCC\s0 does not support warning about features that go beyond a
+particular library's limitations. However, if \fB\-pedantic\fR is used
+with \fB\-Wformat\fR, warnings will be given about format features not
+in the selected standard version (but not for \f(CW\*(C`strfmon\*(C'\fR formats,
+since those are not in any version of the C standard).
+.Sp
+Since \fB\-Wformat\fR also checks for null format arguments for
+several functions, \fB\-Wformat\fR also implies \fB\-Wnonnull\fR.
+.Sp
+\&\fB\-Wformat\fR is included in \fB\-Wall\fR. For more control over some
+aspects of format checking, the options \fB\-Wformat\-y2k\fR,
+\&\fB\-Wno\-format\-extra\-args\fR, \fB\-Wno\-format\-zero\-length\fR,
+\&\fB\-Wformat\-nonliteral\fR, \fB\-Wformat\-security\fR, and
+\&\fB\-Wformat=2\fR are available, but are not included in \fB\-Wall\fR.
+.IP "\fB\-Wformat\-y2k\fR" 4
+.IX Item "-Wformat-y2k"
+If \fB\-Wformat\fR is specified, also warn about \f(CW\*(C`strftime\*(C'\fR
+formats which may yield only a two-digit year.
+.IP "\fB\-Wno\-format\-contains\-nul\fR" 4
+.IX Item "-Wno-format-contains-nul"
+If \fB\-Wformat\fR is specified, do not warn about format strings that
+contain \s-1NUL\s0 bytes.
+.IP "\fB\-Wno\-format\-extra\-args\fR" 4
+.IX Item "-Wno-format-extra-args"
+If \fB\-Wformat\fR is specified, do not warn about excess arguments to a
+\&\f(CW\*(C`printf\*(C'\fR or \f(CW\*(C`scanf\*(C'\fR format function. The C standard specifies
+that such arguments are ignored.
+.Sp
+Where the unused arguments lie between used arguments that are
+specified with \fB$\fR operand number specifications, normally
+warnings are still given, since the implementation could not know what
+type to pass to \f(CW\*(C`va_arg\*(C'\fR to skip the unused arguments. However,
+in the case of \f(CW\*(C`scanf\*(C'\fR formats, this option will suppress the
+warning if the unused arguments are all pointers, since the Single
+Unix Specification says that such unused arguments are allowed.
+.IP "\fB\-Wno\-format\-zero\-length\fR (C and Objective-C only)" 4
+.IX Item "-Wno-format-zero-length (C and Objective-C only)"
+If \fB\-Wformat\fR is specified, do not warn about zero-length formats.
+The C standard specifies that zero-length formats are allowed.
+.IP "\fB\-Wformat\-nonliteral\fR" 4
+.IX Item "-Wformat-nonliteral"
+If \fB\-Wformat\fR is specified, also warn if the format string is not a
+string literal and so cannot be checked, unless the format function
+takes its format arguments as a \f(CW\*(C`va_list\*(C'\fR.
+.IP "\fB\-Wformat\-security\fR" 4
+.IX Item "-Wformat-security"
+If \fB\-Wformat\fR is specified, also warn about uses of format
+functions that represent possible security problems. At present, this
+warns about calls to \f(CW\*(C`printf\*(C'\fR and \f(CW\*(C`scanf\*(C'\fR functions where the
+format string is not a string literal and there are no format arguments,
+as in \f(CW\*(C`printf (foo);\*(C'\fR. This may be a security hole if the format
+string came from untrusted input and contains \fB\f(CB%n\fB\fR. (This is
+currently a subset of what \fB\-Wformat\-nonliteral\fR warns about, but
+in future warnings may be added to \fB\-Wformat\-security\fR that are not
+included in \fB\-Wformat\-nonliteral\fR.)
+.IP "\fB\-Wformat=2\fR" 4
+.IX Item "-Wformat=2"
+Enable \fB\-Wformat\fR plus format checks not included in
+\&\fB\-Wformat\fR. Currently equivalent to \fB\-Wformat
+\&\-Wformat\-nonliteral \-Wformat\-security \-Wformat\-y2k\fR.
+.IP "\fB\-Wnonnull\fR (C and Objective-C only)" 4
+.IX Item "-Wnonnull (C and Objective-C only)"
+Warn about passing a null pointer for arguments marked as
+requiring a non-null value by the \f(CW\*(C`nonnull\*(C'\fR function attribute.
+.Sp
+\&\fB\-Wnonnull\fR is included in \fB\-Wall\fR and \fB\-Wformat\fR. It
+can be disabled with the \fB\-Wno\-nonnull\fR option.
+.IP "\fB\-Winit\-self\fR (C, \*(C+, Objective-C and Objective\-\*(C+ only)" 4
+.IX Item "-Winit-self (C, , Objective-C and Objective- only)"
+Warn about uninitialized variables which are initialized with themselves.
+Note this option can only be used with the \fB\-Wuninitialized\fR option.
+.Sp
+For example, \s-1GCC\s0 will warn about \f(CW\*(C`i\*(C'\fR being uninitialized in the
+following snippet only when \fB\-Winit\-self\fR has been specified:
+.Sp
+.Vb 5
+\& int f()
+\& {
+\& int i = i;
+\& return i;
+\& }
+.Ve
+.IP "\fB\-Wimplicit\-int\fR (C and Objective-C only)" 4
+.IX Item "-Wimplicit-int (C and Objective-C only)"
+Warn when a declaration does not specify a type.
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wimplicit\-function\-declaration\fR (C and Objective-C only)" 4
+.IX Item "-Wimplicit-function-declaration (C and Objective-C only)"
+Give a warning whenever a function is used before being declared. In
+C99 mode (\fB\-std=c99\fR or \fB\-std=gnu99\fR), this warning is
+enabled by default and it is made into an error by
+\&\fB\-pedantic\-errors\fR. This warning is also enabled by
+\&\fB\-Wall\fR.
+.IP "\fB\-Wimplicit\fR" 4
+.IX Item "-Wimplicit"
+Same as \fB\-Wimplicit\-int\fR and \fB\-Wimplicit\-function\-declaration\fR.
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wignored\-qualifiers\fR (C and \*(C+ only)" 4
+.IX Item "-Wignored-qualifiers (C and only)"
+Warn if the return type of a function has a type qualifier
+such as \f(CW\*(C`const\*(C'\fR. For \s-1ISO\s0 C such a type qualifier has no effect,
+since the value returned by a function is not an lvalue.
+For \*(C+, the warning is only emitted for scalar types or \f(CW\*(C`void\*(C'\fR.
+\&\s-1ISO\s0 C prohibits qualified \f(CW\*(C`void\*(C'\fR return types on function
+definitions, so such return types always receive a warning
+even without this option.
+.Sp
+This warning is also enabled by \fB\-Wextra\fR.
+.IP "\fB\-Wmain\fR" 4
+.IX Item "-Wmain"
+Warn if the type of \fBmain\fR is suspicious. \fBmain\fR should be
+a function with external linkage, returning int, taking either zero
+arguments, two, or three arguments of appropriate types. This warning
+is enabled by default in \*(C+ and is enabled by either \fB\-Wall\fR
+or \fB\-pedantic\fR.
+.IP "\fB\-Wmissing\-braces\fR" 4
+.IX Item "-Wmissing-braces"
+Warn if an aggregate or union initializer is not fully bracketed. In
+the following example, the initializer for \fBa\fR is not fully
+bracketed, but that for \fBb\fR is fully bracketed.
+.Sp
+.Vb 2
+\& int a[2][2] = { 0, 1, 2, 3 };
+\& int b[2][2] = { { 0, 1 }, { 2, 3 } };
+.Ve
+.Sp
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wmissing\-include\-dirs\fR (C, \*(C+, Objective-C and Objective\-\*(C+ only)" 4
+.IX Item "-Wmissing-include-dirs (C, , Objective-C and Objective- only)"
+Warn if a user-supplied include directory does not exist.
+.IP "\fB\-Wparentheses\fR" 4
+.IX Item "-Wparentheses"
+Warn if parentheses are omitted in certain contexts, such
+as when there is an assignment in a context where a truth value
+is expected, or when operators are nested whose precedence people
+often get confused about.
+.Sp
+Also warn if a comparison like \fBx<=y<=z\fR appears; this is
+equivalent to \fB(x<=y ? 1 : 0) <= z\fR, which is a different
+interpretation from that of ordinary mathematical notation.
+.Sp
+Also warn about constructions where there may be confusion to which
+\&\f(CW\*(C`if\*(C'\fR statement an \f(CW\*(C`else\*(C'\fR branch belongs. Here is an example of
+such a case:
+.Sp
+.Vb 7
+\& {
+\& if (a)
+\& if (b)
+\& foo ();
+\& else
+\& bar ();
+\& }
+.Ve
+.Sp
+In C/\*(C+, every \f(CW\*(C`else\*(C'\fR branch belongs to the innermost possible
+\&\f(CW\*(C`if\*(C'\fR statement, which in this example is \f(CW\*(C`if (b)\*(C'\fR. This is
+often not what the programmer expected, as illustrated in the above
+example by indentation the programmer chose. When there is the
+potential for this confusion, \s-1GCC\s0 will issue a warning when this flag
+is specified. To eliminate the warning, add explicit braces around
+the innermost \f(CW\*(C`if\*(C'\fR statement so there is no way the \f(CW\*(C`else\*(C'\fR
+could belong to the enclosing \f(CW\*(C`if\*(C'\fR. The resulting code would
+look like this:
+.Sp
+.Vb 9
+\& {
+\& if (a)
+\& {
+\& if (b)
+\& foo ();
+\& else
+\& bar ();
+\& }
+\& }
+.Ve
+.Sp
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wsequence\-point\fR" 4
+.IX Item "-Wsequence-point"
+Warn about code that may have undefined semantics because of violations
+of sequence point rules in the C and \*(C+ standards.
+.Sp
+The C and \*(C+ standards defines the order in which expressions in a C/\*(C+
+program are evaluated in terms of \fIsequence points\fR, which represent
+a partial ordering between the execution of parts of the program: those
+executed before the sequence point, and those executed after it. These
+occur after the evaluation of a full expression (one which is not part
+of a larger expression), after the evaluation of the first operand of a
+\&\f(CW\*(C`&&\*(C'\fR, \f(CW\*(C`||\*(C'\fR, \f(CW\*(C`? :\*(C'\fR or \f(CW\*(C`,\*(C'\fR (comma) operator, before a
+function is called (but after the evaluation of its arguments and the
+expression denoting the called function), and in certain other places.
+Other than as expressed by the sequence point rules, the order of
+evaluation of subexpressions of an expression is not specified. All
+these rules describe only a partial order rather than a total order,
+since, for example, if two functions are called within one expression
+with no sequence point between them, the order in which the functions
+are called is not specified. However, the standards committee have
+ruled that function calls do not overlap.
+.Sp
+It is not specified when between sequence points modifications to the
+values of objects take effect. Programs whose behavior depends on this
+have undefined behavior; the C and \*(C+ standards specify that \*(L"Between
+the previous and next sequence point an object shall have its stored
+value modified at most once by the evaluation of an expression.
+Furthermore, the prior value shall be read only to determine the value
+to be stored.\*(R". If a program breaks these rules, the results on any
+particular implementation are entirely unpredictable.
+.Sp
+Examples of code with undefined behavior are \f(CW\*(C`a = a++;\*(C'\fR, \f(CW\*(C`a[n]
+= b[n++]\*(C'\fR and \f(CW\*(C`a[i++] = i;\*(C'\fR. Some more complicated cases are not
+diagnosed by this option, and it may give an occasional false positive
+result, but in general it has been found fairly effective at detecting
+this sort of problem in programs.
+.Sp
+The standard is worded confusingly, therefore there is some debate
+over the precise meaning of the sequence point rules in subtle cases.
+Links to discussions of the problem, including proposed formal
+definitions, may be found on the \s-1GCC\s0 readings page, at
+<\fBhttp://gcc.gnu.org/readings.html\fR>.
+.Sp
+This warning is enabled by \fB\-Wall\fR for C and \*(C+.
+.IP "\fB\-Wreturn\-type\fR" 4
+.IX Item "-Wreturn-type"
+Warn whenever a function is defined with a return-type that defaults
+to \f(CW\*(C`int\*(C'\fR. Also warn about any \f(CW\*(C`return\*(C'\fR statement with no
+return-value in a function whose return-type is not \f(CW\*(C`void\*(C'\fR
+(falling off the end of the function body is considered returning
+without a value), and about a \f(CW\*(C`return\*(C'\fR statement with a
+expression in a function whose return-type is \f(CW\*(C`void\*(C'\fR.
+.Sp
+For \*(C+, a function without return type always produces a diagnostic
+message, even when \fB\-Wno\-return\-type\fR is specified. The only
+exceptions are \fBmain\fR and functions defined in system headers.
+.Sp
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wswitch\fR" 4
+.IX Item "-Wswitch"
+Warn whenever a \f(CW\*(C`switch\*(C'\fR statement has an index of enumerated type
+and lacks a \f(CW\*(C`case\*(C'\fR for one or more of the named codes of that
+enumeration. (The presence of a \f(CW\*(C`default\*(C'\fR label prevents this
+warning.) \f(CW\*(C`case\*(C'\fR labels outside the enumeration range also
+provoke warnings when this option is used.
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wswitch\-default\fR" 4
+.IX Item "-Wswitch-default"
+Warn whenever a \f(CW\*(C`switch\*(C'\fR statement does not have a \f(CW\*(C`default\*(C'\fR
+case.
+.IP "\fB\-Wswitch\-enum\fR" 4
+.IX Item "-Wswitch-enum"
+Warn whenever a \f(CW\*(C`switch\*(C'\fR statement has an index of enumerated type
+and lacks a \f(CW\*(C`case\*(C'\fR for one or more of the named codes of that
+enumeration. \f(CW\*(C`case\*(C'\fR labels outside the enumeration range also
+provoke warnings when this option is used.
+.IP "\fB\-Wsync\-nand\fR (C and \*(C+ only)" 4
+.IX Item "-Wsync-nand (C and only)"
+Warn when \f(CW\*(C`_\|_sync_fetch_and_nand\*(C'\fR and \f(CW\*(C`_\|_sync_nand_and_fetch\*(C'\fR
+built-in functions are used. These functions changed semantics in \s-1GCC\s0 4.4.
+.IP "\fB\-Wtrigraphs\fR" 4
+.IX Item "-Wtrigraphs"
+Warn if any trigraphs are encountered that might change the meaning of
+the program (trigraphs within comments are not warned about).
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wunused\-function\fR" 4
+.IX Item "-Wunused-function"
+Warn whenever a static function is declared but not defined or a
+non-inline static function is unused.
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wunused\-label\fR" 4
+.IX Item "-Wunused-label"
+Warn whenever a label is declared but not used.
+This warning is enabled by \fB\-Wall\fR.
+.Sp
+To suppress this warning use the \fBunused\fR attribute.
+.IP "\fB\-Wunused\-parameter\fR" 4
+.IX Item "-Wunused-parameter"
+Warn whenever a function parameter is unused aside from its declaration.
+.Sp
+To suppress this warning use the \fBunused\fR attribute.
+.IP "\fB\-Wunused\-variable\fR" 4
+.IX Item "-Wunused-variable"
+Warn whenever a local variable or non-constant static variable is unused
+aside from its declaration.
+This warning is enabled by \fB\-Wall\fR.
+.Sp
+To suppress this warning use the \fBunused\fR attribute.
+.IP "\fB\-Wunused\-value\fR" 4
+.IX Item "-Wunused-value"
+Warn whenever a statement computes a result that is explicitly not
+used. To suppress this warning cast the unused expression to
+\&\fBvoid\fR. This includes an expression-statement or the left-hand
+side of a comma expression that contains no side effects. For example,
+an expression such as \fBx[i,j]\fR will cause a warning, while
+\&\fBx[(void)i,j]\fR will not.
+.Sp
+This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wunused\fR" 4
+.IX Item "-Wunused"
+All the above \fB\-Wunused\fR options combined.
+.Sp
+In order to get a warning about an unused function parameter, you must
+either specify \fB\-Wextra \-Wunused\fR (note that \fB\-Wall\fR implies
+\&\fB\-Wunused\fR), or separately specify \fB\-Wunused\-parameter\fR.
+.IP "\fB\-Wuninitialized\fR" 4
+.IX Item "-Wuninitialized"
+Warn if an automatic variable is used without first being initialized
+or if a variable may be clobbered by a \f(CW\*(C`setjmp\*(C'\fR call. In \*(C+,
+warn if a non-static reference or non-static \fBconst\fR member
+appears in a class without constructors.
+.Sp
+If you want to warn about code which uses the uninitialized value of the
+variable in its own initializer, use the \fB\-Winit\-self\fR option.
+.Sp
+These warnings occur for individual uninitialized or clobbered
+elements of structure, union or array variables as well as for
+variables which are uninitialized or clobbered as a whole. They do
+not occur for variables or elements declared \f(CW\*(C`volatile\*(C'\fR. Because
+these warnings depend on optimization, the exact variables or elements
+for which there are warnings will depend on the precise optimization
+options and version of \s-1GCC\s0 used.
+.Sp
+Note that there may be no warning about a variable that is used only
+to compute a value that itself is never used, because such
+computations may be deleted by data flow analysis before the warnings
+are printed.
+.Sp
+These warnings are made optional because \s-1GCC\s0 is not smart
+enough to see all the reasons why the code might be correct
+despite appearing to have an error. Here is one example of how
+this can happen:
+.Sp
+.Vb 12
+\& {
+\& int x;
+\& switch (y)
+\& {
+\& case 1: x = 1;
+\& break;
+\& case 2: x = 4;
+\& break;
+\& case 3: x = 5;
+\& }
+\& foo (x);
+\& }
+.Ve
+.Sp
+If the value of \f(CW\*(C`y\*(C'\fR is always 1, 2 or 3, then \f(CW\*(C`x\*(C'\fR is
+always initialized, but \s-1GCC\s0 doesn't know this. Here is
+another common case:
+.Sp
+.Vb 6
+\& {
+\& int save_y;
+\& if (change_y) save_y = y, y = new_y;
+\& ...
+\& if (change_y) y = save_y;
+\& }
+.Ve
+.Sp
+This has no bug because \f(CW\*(C`save_y\*(C'\fR is used only if it is set.
+.Sp
+This option also warns when a non-volatile automatic variable might be
+changed by a call to \f(CW\*(C`longjmp\*(C'\fR. These warnings as well are possible
+only in optimizing compilation.
+.Sp
+The compiler sees only the calls to \f(CW\*(C`setjmp\*(C'\fR. It cannot know
+where \f(CW\*(C`longjmp\*(C'\fR will be called; in fact, a signal handler could
+call it at any point in the code. As a result, you may get a warning
+even when there is in fact no problem because \f(CW\*(C`longjmp\*(C'\fR cannot
+in fact be called at the place which would cause a problem.
+.Sp
+Some spurious warnings can be avoided if you declare all the functions
+you use that never return as \f(CW\*(C`noreturn\*(C'\fR.
+.Sp
+This warning is enabled by \fB\-Wall\fR or \fB\-Wextra\fR.
+.IP "\fB\-Wunknown\-pragmas\fR" 4
+.IX Item "-Wunknown-pragmas"
+Warn when a #pragma directive is encountered which is not understood by
+\&\s-1GCC\s0. If this command line option is used, warnings will even be issued
+for unknown pragmas in system header files. This is not the case if
+the warnings were only enabled by the \fB\-Wall\fR command line option.
+.IP "\fB\-Wno\-pragmas\fR" 4
+.IX Item "-Wno-pragmas"
+Do not warn about misuses of pragmas, such as incorrect parameters,
+invalid syntax, or conflicts between pragmas. See also
+\&\fB\-Wunknown\-pragmas\fR.
+.IP "\fB\-Wstrict\-aliasing\fR" 4
+.IX Item "-Wstrict-aliasing"
+This option is only active when \fB\-fstrict\-aliasing\fR is active.
+It warns about code which might break the strict aliasing rules that the
+compiler is using for optimization. The warning does not catch all
+cases, but does attempt to catch the more common pitfalls. It is
+included in \fB\-Wall\fR.
+It is equivalent to \fB\-Wstrict\-aliasing=3\fR
+.IP "\fB\-Wstrict\-aliasing=n\fR" 4
+.IX Item "-Wstrict-aliasing=n"
+This option is only active when \fB\-fstrict\-aliasing\fR is active.
+It warns about code which might break the strict aliasing rules that the
+compiler is using for optimization.
+Higher levels correspond to higher accuracy (fewer false positives).
+Higher levels also correspond to more effort, similar to the way \-O works.
+\&\fB\-Wstrict\-aliasing\fR is equivalent to \fB\-Wstrict\-aliasing=n\fR,
+with n=3.
+.Sp
+Level 1: Most aggressive, quick, least accurate.
+Possibly useful when higher levels
+do not warn but \-fstrict\-aliasing still breaks the code, as it has very few
+false negatives. However, it has many false positives.
+Warns for all pointer conversions between possibly incompatible types,
+even if never dereferenced. Runs in the frontend only.
+.Sp
+Level 2: Aggressive, quick, not too precise.
+May still have many false positives (not as many as level 1 though),
+and few false negatives (but possibly more than level 1).
+Unlike level 1, it only warns when an address is taken. Warns about
+incomplete types. Runs in the frontend only.
+.Sp
+Level 3 (default for \fB\-Wstrict\-aliasing\fR):
+Should have very few false positives and few false
+negatives. Slightly slower than levels 1 or 2 when optimization is enabled.
+Takes care of the common punn+dereference pattern in the frontend:
+\&\f(CW\*(C`*(int*)&some_float\*(C'\fR.
+If optimization is enabled, it also runs in the backend, where it deals
+with multiple statement cases using flow-sensitive points-to information.
+Only warns when the converted pointer is dereferenced.
+Does not warn about incomplete types.
+.IP "\fB\-Wstrict\-overflow\fR" 4
+.IX Item "-Wstrict-overflow"
+.PD 0
+.IP "\fB\-Wstrict\-overflow=\fR\fIn\fR" 4
+.IX Item "-Wstrict-overflow=n"
+.PD
+This option is only active when \fB\-fstrict\-overflow\fR is active.
+It warns about cases where the compiler optimizes based on the
+assumption that signed overflow does not occur. Note that it does not
+warn about all cases where the code might overflow: it only warns
+about cases where the compiler implements some optimization. Thus
+this warning depends on the optimization level.
+.Sp
+An optimization which assumes that signed overflow does not occur is
+perfectly safe if the values of the variables involved are such that
+overflow never does, in fact, occur. Therefore this warning can
+easily give a false positive: a warning about code which is not
+actually a problem. To help focus on important issues, several
+warning levels are defined. No warnings are issued for the use of
+undefined signed overflow when estimating how many iterations a loop
+will require, in particular when determining whether a loop will be
+executed at all.
+.RS 4
+.IP "\fB\-Wstrict\-overflow=1\fR" 4
+.IX Item "-Wstrict-overflow=1"
+Warn about cases which are both questionable and easy to avoid. For
+example: \f(CW\*(C`x + 1 > x\*(C'\fR; with \fB\-fstrict\-overflow\fR, the
+compiler will simplify this to \f(CW1\fR. This level of
+\&\fB\-Wstrict\-overflow\fR is enabled by \fB\-Wall\fR; higher levels
+are not, and must be explicitly requested.
+.IP "\fB\-Wstrict\-overflow=2\fR" 4
+.IX Item "-Wstrict-overflow=2"
+Also warn about other cases where a comparison is simplified to a
+constant. For example: \f(CW\*(C`abs (x) >= 0\*(C'\fR. This can only be
+simplified when \fB\-fstrict\-overflow\fR is in effect, because
+\&\f(CW\*(C`abs (INT_MIN)\*(C'\fR overflows to \f(CW\*(C`INT_MIN\*(C'\fR, which is less than
+zero. \fB\-Wstrict\-overflow\fR (with no level) is the same as
+\&\fB\-Wstrict\-overflow=2\fR.
+.IP "\fB\-Wstrict\-overflow=3\fR" 4
+.IX Item "-Wstrict-overflow=3"
+Also warn about other cases where a comparison is simplified. For
+example: \f(CW\*(C`x + 1 > 1\*(C'\fR will be simplified to \f(CW\*(C`x > 0\*(C'\fR.
+.IP "\fB\-Wstrict\-overflow=4\fR" 4
+.IX Item "-Wstrict-overflow=4"
+Also warn about other simplifications not covered by the above cases.
+For example: \f(CW\*(C`(x * 10) / 5\*(C'\fR will be simplified to \f(CW\*(C`x * 2\*(C'\fR.
+.IP "\fB\-Wstrict\-overflow=5\fR" 4
+.IX Item "-Wstrict-overflow=5"
+Also warn about cases where the compiler reduces the magnitude of a
+constant involved in a comparison. For example: \f(CW\*(C`x + 2 > y\*(C'\fR will
+be simplified to \f(CW\*(C`x + 1 >= y\*(C'\fR. This is reported only at the
+highest warning level because this simplification applies to many
+comparisons, so this warning level will give a very large number of
+false positives.
+.RE
+.RS 4
+.RE
+.IP "\fB\-Warray\-bounds\fR" 4
+.IX Item "-Warray-bounds"
+This option is only active when \fB\-ftree\-vrp\fR is active
+(default for \-O2 and above). It warns about subscripts to arrays
+that are always out of bounds. This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wno\-div\-by\-zero\fR" 4
+.IX Item "-Wno-div-by-zero"
+Do not warn about compile-time integer division by zero. Floating point
+division by zero is not warned about, as it can be a legitimate way of
+obtaining infinities and NaNs.
+.IP "\fB\-Wsystem\-headers\fR" 4
+.IX Item "-Wsystem-headers"
+Print warning messages for constructs found in system header files.
+Warnings from system headers are normally suppressed, on the assumption
+that they usually do not indicate real problems and would only make the
+compiler output harder to read. Using this command line option tells
+\&\s-1GCC\s0 to emit warnings from system headers as if they occurred in user
+code. However, note that using \fB\-Wall\fR in conjunction with this
+option will \fInot\fR warn about unknown pragmas in system
+headers\-\-\-for that, \fB\-Wunknown\-pragmas\fR must also be used.
+.IP "\fB\-Wfloat\-equal\fR" 4
+.IX Item "-Wfloat-equal"
+Warn if floating point values are used in equality comparisons.
+.Sp
+The idea behind this is that sometimes it is convenient (for the
+programmer) to consider floating-point values as approximations to
+infinitely precise real numbers. If you are doing this, then you need
+to compute (by analyzing the code, or in some other way) the maximum or
+likely maximum error that the computation introduces, and allow for it
+when performing comparisons (and when producing output, but that's a
+different problem). In particular, instead of testing for equality, you
+would check to see whether the two values have ranges that overlap; and
+this is done with the relational operators, so equality comparisons are
+probably mistaken.
+.IP "\fB\-Wtraditional\fR (C and Objective-C only)" 4
+.IX Item "-Wtraditional (C and Objective-C only)"
+Warn about certain constructs that behave differently in traditional and
+\&\s-1ISO\s0 C. Also warn about \s-1ISO\s0 C constructs that have no traditional C
+equivalent, and/or problematic constructs which should be avoided.
+.RS 4
+.IP "\(bu" 4
+Macro parameters that appear within string literals in the macro body.
+In traditional C macro replacement takes place within string literals,
+but does not in \s-1ISO\s0 C.
+.IP "\(bu" 4
+In traditional C, some preprocessor directives did not exist.
+Traditional preprocessors would only consider a line to be a directive
+if the \fB#\fR appeared in column 1 on the line. Therefore
+\&\fB\-Wtraditional\fR warns about directives that traditional C
+understands but would ignore because the \fB#\fR does not appear as the
+first character on the line. It also suggests you hide directives like
+\&\fB#pragma\fR not understood by traditional C by indenting them. Some
+traditional implementations would not recognize \fB#elif\fR, so it
+suggests avoiding it altogether.
+.IP "\(bu" 4
+A function-like macro that appears without arguments.
+.IP "\(bu" 4
+The unary plus operator.
+.IP "\(bu" 4
+The \fBU\fR integer constant suffix, or the \fBF\fR or \fBL\fR floating point
+constant suffixes. (Traditional C does support the \fBL\fR suffix on integer
+constants.) Note, these suffixes appear in macros defined in the system
+headers of most modern systems, e.g. the \fB_MIN\fR/\fB_MAX\fR macros in \f(CW\*(C`<limits.h>\*(C'\fR.
+Use of these macros in user code might normally lead to spurious
+warnings, however \s-1GCC\s0's integrated preprocessor has enough context to
+avoid warning in these cases.
+.IP "\(bu" 4
+A function declared external in one block and then used after the end of
+the block.
+.IP "\(bu" 4
+A \f(CW\*(C`switch\*(C'\fR statement has an operand of type \f(CW\*(C`long\*(C'\fR.
+.IP "\(bu" 4
+A non\-\f(CW\*(C`static\*(C'\fR function declaration follows a \f(CW\*(C`static\*(C'\fR one.
+This construct is not accepted by some traditional C compilers.
+.IP "\(bu" 4
+The \s-1ISO\s0 type of an integer constant has a different width or
+signedness from its traditional type. This warning is only issued if
+the base of the constant is ten. I.e. hexadecimal or octal values, which
+typically represent bit patterns, are not warned about.
+.IP "\(bu" 4
+Usage of \s-1ISO\s0 string concatenation is detected.
+.IP "\(bu" 4
+Initialization of automatic aggregates.
+.IP "\(bu" 4
+Identifier conflicts with labels. Traditional C lacks a separate
+namespace for labels.
+.IP "\(bu" 4
+Initialization of unions. If the initializer is zero, the warning is
+omitted. This is done under the assumption that the zero initializer in
+user code appears conditioned on e.g. \f(CW\*(C`_\|_STDC_\|_\*(C'\fR to avoid missing
+initializer warnings and relies on default initialization to zero in the
+traditional C case.
+.IP "\(bu" 4
+Conversions by prototypes between fixed/floating point values and vice
+versa. The absence of these prototypes when compiling with traditional
+C would cause serious problems. This is a subset of the possible
+conversion warnings, for the full set use \fB\-Wtraditional\-conversion\fR.
+.IP "\(bu" 4
+Use of \s-1ISO\s0 C style function definitions. This warning intentionally is
+\&\fInot\fR issued for prototype declarations or variadic functions
+because these \s-1ISO\s0 C features will appear in your code when using
+libiberty's traditional C compatibility macros, \f(CW\*(C`PARAMS\*(C'\fR and
+\&\f(CW\*(C`VPARAMS\*(C'\fR. This warning is also bypassed for nested functions
+because that feature is already a \s-1GCC\s0 extension and thus not relevant to
+traditional C compatibility.
+.RE
+.RS 4
+.RE
+.IP "\fB\-Wtraditional\-conversion\fR (C and Objective-C only)" 4
+.IX Item "-Wtraditional-conversion (C and Objective-C only)"
+Warn if a prototype causes a type conversion that is different from what
+would happen to the same argument in the absence of a prototype. This
+includes conversions of fixed point to floating and vice versa, and
+conversions changing the width or signedness of a fixed point argument
+except when the same as the default promotion.
+.IP "\fB\-Wdeclaration\-after\-statement\fR (C and Objective-C only)" 4
+.IX Item "-Wdeclaration-after-statement (C and Objective-C only)"
+Warn when a declaration is found after a statement in a block. This
+construct, known from \*(C+, was introduced with \s-1ISO\s0 C99 and is by default
+allowed in \s-1GCC\s0. It is not supported by \s-1ISO\s0 C90 and was not supported by
+\&\s-1GCC\s0 versions before \s-1GCC\s0 3.0.
+.IP "\fB\-Wundef\fR" 4
+.IX Item "-Wundef"
+Warn if an undefined identifier is evaluated in an \fB#if\fR directive.
+.IP "\fB\-Wno\-endif\-labels\fR" 4
+.IX Item "-Wno-endif-labels"
+Do not warn whenever an \fB#else\fR or an \fB#endif\fR are followed by text.
+.IP "\fB\-Wshadow\fR" 4
+.IX Item "-Wshadow"
+Warn whenever a local variable shadows another local variable, parameter or
+global variable or whenever a built-in function is shadowed.
+.IP "\fB\-Wlarger\-than=\fR\fIlen\fR" 4
+.IX Item "-Wlarger-than=len"
+Warn whenever an object of larger than \fIlen\fR bytes is defined.
+.IP "\fB\-Wframe\-larger\-than=\fR\fIlen\fR" 4
+.IX Item "-Wframe-larger-than=len"
+Warn if the size of a function frame is larger than \fIlen\fR bytes.
+The computation done to determine the stack frame size is approximate
+and not conservative.
+The actual requirements may be somewhat greater than \fIlen\fR
+even if you do not get a warning. In addition, any space allocated
+via \f(CW\*(C`alloca\*(C'\fR, variable-length arrays, or related constructs
+is not included by the compiler when determining
+whether or not to issue a warning.
+.IP "\fB\-Wunsafe\-loop\-optimizations\fR" 4
+.IX Item "-Wunsafe-loop-optimizations"
+Warn if the loop cannot be optimized because the compiler could not
+assume anything on the bounds of the loop indices. With
+\&\fB\-funsafe\-loop\-optimizations\fR warn if the compiler made
+such assumptions.
+.IP "\fB\-Wno\-pedantic\-ms\-format\fR (MinGW targets only)" 4
+.IX Item "-Wno-pedantic-ms-format (MinGW targets only)"
+Disables the warnings about non-ISO \f(CW\*(C`printf\*(C'\fR / \f(CW\*(C`scanf\*(C'\fR format
+width specifiers \f(CW\*(C`I32\*(C'\fR, \f(CW\*(C`I64\*(C'\fR, and \f(CW\*(C`I\*(C'\fR used on Windows targets
+depending on the \s-1MS\s0 runtime, when you are using the options \fB\-Wformat\fR
+and \fB\-pedantic\fR without gnu-extensions.
+.IP "\fB\-Wpointer\-arith\fR" 4
+.IX Item "-Wpointer-arith"
+Warn about anything that depends on the \*(L"size of\*(R" a function type or
+of \f(CW\*(C`void\*(C'\fR. \s-1GNU\s0 C assigns these types a size of 1, for
+convenience in calculations with \f(CW\*(C`void *\*(C'\fR pointers and pointers
+to functions. In \*(C+, warn also when an arithmetic operation involves
+\&\f(CW\*(C`NULL\*(C'\fR. This warning is also enabled by \fB\-pedantic\fR.
+.IP "\fB\-Wtype\-limits\fR" 4
+.IX Item "-Wtype-limits"
+Warn if a comparison is always true or always false due to the limited
+range of the data type, but do not warn for constant expressions. For
+example, warn if an unsigned variable is compared against zero with
+\&\fB<\fR or \fB>=\fR. This warning is also enabled by
+\&\fB\-Wextra\fR.
+.IP "\fB\-Wbad\-function\-cast\fR (C and Objective-C only)" 4
+.IX Item "-Wbad-function-cast (C and Objective-C only)"
+Warn whenever a function call is cast to a non-matching type.
+For example, warn if \f(CW\*(C`int malloc()\*(C'\fR is cast to \f(CW\*(C`anything *\*(C'\fR.
+.IP "\fB\-Wc++\-compat\fR (C and Objective-C only)" 4
+.IX Item "-Wc++-compat (C and Objective-C only)"
+Warn about \s-1ISO\s0 C constructs that are outside of the common subset of
+\&\s-1ISO\s0 C and \s-1ISO\s0 \*(C+, e.g. request for implicit conversion from
+\&\f(CW\*(C`void *\*(C'\fR to a pointer to non\-\f(CW\*(C`void\*(C'\fR type.
+.IP "\fB\-Wc++0x\-compat\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wc++0x-compat ( and Objective- only)"
+Warn about \*(C+ constructs whose meaning differs between \s-1ISO\s0 \*(C+ 1998 and
+\&\s-1ISO\s0 \*(C+ 200x, e.g., identifiers in \s-1ISO\s0 \*(C+ 1998 that will become keywords
+in \s-1ISO\s0 \*(C+ 200x. This warning is enabled by \fB\-Wall\fR.
+.IP "\fB\-Wcast\-qual\fR" 4
+.IX Item "-Wcast-qual"
+Warn whenever a pointer is cast so as to remove a type qualifier from
+the target type. For example, warn if a \f(CW\*(C`const char *\*(C'\fR is cast
+to an ordinary \f(CW\*(C`char *\*(C'\fR.
+.IP "\fB\-Wcast\-align\fR" 4
+.IX Item "-Wcast-align"
+Warn whenever a pointer is cast such that the required alignment of the
+target is increased. For example, warn if a \f(CW\*(C`char *\*(C'\fR is cast to
+an \f(CW\*(C`int *\*(C'\fR on machines where integers can only be accessed at
+two\- or four-byte boundaries.
+.IP "\fB\-Wwrite\-strings\fR" 4
+.IX Item "-Wwrite-strings"
+When compiling C, give string constants the type \f(CW\*(C`const
+char[\f(CIlength\f(CW]\*(C'\fR so that copying the address of one into a
+non\-\f(CW\*(C`const\*(C'\fR \f(CW\*(C`char *\*(C'\fR pointer will get a warning. These
+warnings will help you find at compile time code that can try to write
+into a string constant, but only if you have been very careful about
+using \f(CW\*(C`const\*(C'\fR in declarations and prototypes. Otherwise, it will
+just be a nuisance. This is why we did not make \fB\-Wall\fR request
+these warnings.
+.Sp
+When compiling \*(C+, warn about the deprecated conversion from string
+literals to \f(CW\*(C`char *\*(C'\fR. This warning is enabled by default for \*(C+
+programs.
+.IP "\fB\-Wclobbered\fR" 4
+.IX Item "-Wclobbered"
+Warn for variables that might be changed by \fBlongjmp\fR or
+\&\fBvfork\fR. This warning is also enabled by \fB\-Wextra\fR.
+.IP "\fB\-Wconversion\fR" 4
+.IX Item "-Wconversion"
+Warn for implicit conversions that may alter a value. This includes
+conversions between real and integer, like \f(CW\*(C`abs (x)\*(C'\fR when
+\&\f(CW\*(C`x\*(C'\fR is \f(CW\*(C`double\*(C'\fR; conversions between signed and unsigned,
+like \f(CW\*(C`unsigned ui = \-1\*(C'\fR; and conversions to smaller types, like
+\&\f(CW\*(C`sqrtf (M_PI)\*(C'\fR. Do not warn for explicit casts like \f(CW\*(C`abs
+((int) x)\*(C'\fR and \f(CW\*(C`ui = (unsigned) \-1\*(C'\fR, or if the value is not
+changed by the conversion like in \f(CW\*(C`abs (2.0)\*(C'\fR. Warnings about
+conversions between signed and unsigned integers can be disabled by
+using \fB\-Wno\-sign\-conversion\fR.
+.Sp
+For \*(C+, also warn for conversions between \f(CW\*(C`NULL\*(C'\fR and non-pointer
+types; confusing overload resolution for user-defined conversions; and
+conversions that will never use a type conversion operator:
+conversions to \f(CW\*(C`void\*(C'\fR, the same type, a base class or a reference
+to them. Warnings about conversions between signed and unsigned
+integers are disabled by default in \*(C+ unless
+\&\fB\-Wsign\-conversion\fR is explicitly enabled.
+.IP "\fB\-Wempty\-body\fR" 4
+.IX Item "-Wempty-body"
+Warn if an empty body occurs in an \fBif\fR, \fBelse\fR or \fBdo
+while\fR statement. This warning is also enabled by \fB\-Wextra\fR.
+.IP "\fB\-Wenum\-compare\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wenum-compare ( and Objective- only)"
+Warn about a comparison between values of different enum types. This
+warning is enabled by default.
+.IP "\fB\-Wsign\-compare\fR" 4
+.IX Item "-Wsign-compare"
+Warn when a comparison between signed and unsigned values could produce
+an incorrect result when the signed value is converted to unsigned.
+This warning is also enabled by \fB\-Wextra\fR; to get the other warnings
+of \fB\-Wextra\fR without this warning, use \fB\-Wextra \-Wno\-sign\-compare\fR.
+.IP "\fB\-Wsign\-conversion\fR" 4
+.IX Item "-Wsign-conversion"
+Warn for implicit conversions that may change the sign of an integer
+value, like assigning a signed integer expression to an unsigned
+integer variable. An explicit cast silences the warning. In C, this
+option is enabled also by \fB\-Wconversion\fR.
+.IP "\fB\-Waddress\fR" 4
+.IX Item "-Waddress"
+Warn about suspicious uses of memory addresses. These include using
+the address of a function in a conditional expression, such as
+\&\f(CW\*(C`void func(void); if (func)\*(C'\fR, and comparisons against the memory
+address of a string literal, such as \f(CW\*(C`if (x == "abc")\*(C'\fR. Such
+uses typically indicate a programmer error: the address of a function
+always evaluates to true, so their use in a conditional usually
+indicate that the programmer forgot the parentheses in a function
+call; and comparisons against string literals result in unspecified
+behavior and are not portable in C, so they usually indicate that the
+programmer intended to use \f(CW\*(C`strcmp\*(C'\fR. This warning is enabled by
+\&\fB\-Wall\fR.
+.IP "\fB\-Wlogical\-op\fR" 4
+.IX Item "-Wlogical-op"
+Warn about suspicious uses of logical operators in expressions.
+This includes using logical operators in contexts where a
+bit-wise operator is likely to be expected.
+.IP "\fB\-Waggregate\-return\fR" 4
+.IX Item "-Waggregate-return"
+Warn if any functions that return structures or unions are defined or
+called. (In languages where you can return an array, this also elicits
+a warning.)
+.IP "\fB\-Wno\-attributes\fR" 4
+.IX Item "-Wno-attributes"
+Do not warn if an unexpected \f(CW\*(C`_\|_attribute_\|_\*(C'\fR is used, such as
+unrecognized attributes, function attributes applied to variables,
+etc. This will not stop errors for incorrect use of supported
+attributes.
+.IP "\fB\-Wno\-builtin\-macro\-redefined\fR" 4
+.IX Item "-Wno-builtin-macro-redefined"
+Do not warn if certain built-in macros are redefined. This suppresses
+warnings for redefinition of \f(CW\*(C`_\|_TIMESTAMP_\|_\*(C'\fR, \f(CW\*(C`_\|_TIME_\|_\*(C'\fR,
+\&\f(CW\*(C`_\|_DATE_\|_\*(C'\fR, \f(CW\*(C`_\|_FILE_\|_\*(C'\fR, and \f(CW\*(C`_\|_BASE_FILE_\|_\*(C'\fR.
+.IP "\fB\-Wstrict\-prototypes\fR (C and Objective-C only)" 4
+.IX Item "-Wstrict-prototypes (C and Objective-C only)"
+Warn if a function is declared or defined without specifying the
+argument types. (An old-style function definition is permitted without
+a warning if preceded by a declaration which specifies the argument
+types.)
+.IP "\fB\-Wold\-style\-declaration\fR (C and Objective-C only)" 4
+.IX Item "-Wold-style-declaration (C and Objective-C only)"
+Warn for obsolescent usages, according to the C Standard, in a
+declaration. For example, warn if storage-class specifiers like
+\&\f(CW\*(C`static\*(C'\fR are not the first things in a declaration. This warning
+is also enabled by \fB\-Wextra\fR.
+.IP "\fB\-Wold\-style\-definition\fR (C and Objective-C only)" 4
+.IX Item "-Wold-style-definition (C and Objective-C only)"
+Warn if an old-style function definition is used. A warning is given
+even if there is a previous prototype.
+.IP "\fB\-Wmissing\-parameter\-type\fR (C and Objective-C only)" 4
+.IX Item "-Wmissing-parameter-type (C and Objective-C only)"
+A function parameter is declared without a type specifier in K&R\-style
+functions:
+.Sp
+.Vb 1
+\& void foo(bar) { }
+.Ve
+.Sp
+This warning is also enabled by \fB\-Wextra\fR.
+.IP "\fB\-Wmissing\-prototypes\fR (C and Objective-C only)" 4
+.IX Item "-Wmissing-prototypes (C and Objective-C only)"
+Warn if a global function is defined without a previous prototype
+declaration. This warning is issued even if the definition itself
+provides a prototype. The aim is to detect global functions that fail
+to be declared in header files.
+.IP "\fB\-Wmissing\-declarations\fR" 4
+.IX Item "-Wmissing-declarations"
+Warn if a global function is defined without a previous declaration.
+Do so even if the definition itself provides a prototype.
+Use this option to detect global functions that are not declared in
+header files. In \*(C+, no warnings are issued for function templates,
+or for inline functions, or for functions in anonymous namespaces.
+.IP "\fB\-Wmissing\-field\-initializers\fR" 4
+.IX Item "-Wmissing-field-initializers"
+Warn if a structure's initializer has some fields missing. For
+example, the following code would cause such a warning, because
+\&\f(CW\*(C`x.h\*(C'\fR is implicitly zero:
+.Sp
+.Vb 2
+\& struct s { int f, g, h; };
+\& struct s x = { 3, 4 };
+.Ve
+.Sp
+This option does not warn about designated initializers, so the following
+modification would not trigger a warning:
+.Sp
+.Vb 2
+\& struct s { int f, g, h; };
+\& struct s x = { .f = 3, .g = 4 };
+.Ve
+.Sp
+This warning is included in \fB\-Wextra\fR. To get other \fB\-Wextra\fR
+warnings without this one, use \fB\-Wextra \-Wno\-missing\-field\-initializers\fR.
+.IP "\fB\-Wmissing\-noreturn\fR" 4
+.IX Item "-Wmissing-noreturn"
+Warn about functions which might be candidates for attribute \f(CW\*(C`noreturn\*(C'\fR.
+Note these are only possible candidates, not absolute ones. Care should
+be taken to manually verify functions actually do not ever return before
+adding the \f(CW\*(C`noreturn\*(C'\fR attribute, otherwise subtle code generation
+bugs could be introduced. You will not get a warning for \f(CW\*(C`main\*(C'\fR in
+hosted C environments.
+.IP "\fB\-Wmissing\-format\-attribute\fR" 4
+.IX Item "-Wmissing-format-attribute"
+Warn about function pointers which might be candidates for \f(CW\*(C`format\*(C'\fR
+attributes. Note these are only possible candidates, not absolute ones.
+\&\s-1GCC\s0 will guess that function pointers with \f(CW\*(C`format\*(C'\fR attributes that
+are used in assignment, initialization, parameter passing or return
+statements should have a corresponding \f(CW\*(C`format\*(C'\fR attribute in the
+resulting type. I.e. the left-hand side of the assignment or
+initialization, the type of the parameter variable, or the return type
+of the containing function respectively should also have a \f(CW\*(C`format\*(C'\fR
+attribute to avoid the warning.
+.Sp
+\&\s-1GCC\s0 will also warn about function definitions which might be
+candidates for \f(CW\*(C`format\*(C'\fR attributes. Again, these are only
+possible candidates. \s-1GCC\s0 will guess that \f(CW\*(C`format\*(C'\fR attributes
+might be appropriate for any function that calls a function like
+\&\f(CW\*(C`vprintf\*(C'\fR or \f(CW\*(C`vscanf\*(C'\fR, but this might not always be the
+case, and some functions for which \f(CW\*(C`format\*(C'\fR attributes are
+appropriate may not be detected.
+.IP "\fB\-Wno\-multichar\fR" 4
+.IX Item "-Wno-multichar"
+Do not warn if a multicharacter constant (\fB'\s-1FOOF\s0'\fR) is used.
+Usually they indicate a typo in the user's code, as they have
+implementation-defined values, and should not be used in portable code.
+.IP "\fB\-Wnormalized=<none|id|nfc|nfkc>\fR" 4
+.IX Item "-Wnormalized=<none|id|nfc|nfkc>"
+In \s-1ISO\s0 C and \s-1ISO\s0 \*(C+, two identifiers are different if they are
+different sequences of characters. However, sometimes when characters
+outside the basic \s-1ASCII\s0 character set are used, you can have two
+different character sequences that look the same. To avoid confusion,
+the \s-1ISO\s0 10646 standard sets out some \fInormalization rules\fR which
+when applied ensure that two sequences that look the same are turned into
+the same sequence. \s-1GCC\s0 can warn you if you are using identifiers which
+have not been normalized; this option controls that warning.
+.Sp
+There are four levels of warning that \s-1GCC\s0 supports. The default is
+\&\fB\-Wnormalized=nfc\fR, which warns about any identifier which is
+not in the \s-1ISO\s0 10646 \*(L"C\*(R" normalized form, \fI\s-1NFC\s0\fR. \s-1NFC\s0 is the
+recommended form for most uses.
+.Sp
+Unfortunately, there are some characters which \s-1ISO\s0 C and \s-1ISO\s0 \*(C+ allow
+in identifiers that when turned into \s-1NFC\s0 aren't allowable as
+identifiers. That is, there's no way to use these symbols in portable
+\&\s-1ISO\s0 C or \*(C+ and have all your identifiers in \s-1NFC\s0.
+\&\fB\-Wnormalized=id\fR suppresses the warning for these characters.
+It is hoped that future versions of the standards involved will correct
+this, which is why this option is not the default.
+.Sp
+You can switch the warning off for all characters by writing
+\&\fB\-Wnormalized=none\fR. You would only want to do this if you
+were using some other normalization scheme (like \*(L"D\*(R"), because
+otherwise you can easily create bugs that are literally impossible to see.
+.Sp
+Some characters in \s-1ISO\s0 10646 have distinct meanings but look identical
+in some fonts or display methodologies, especially once formatting has
+been applied. For instance \f(CW\*(C`\eu207F\*(C'\fR, \*(L"\s-1SUPERSCRIPT\s0 \s-1LATIN\s0 \s-1SMALL\s0
+\&\s-1LETTER\s0 N\*(R", will display just like a regular \f(CW\*(C`n\*(C'\fR which has been
+placed in a superscript. \s-1ISO\s0 10646 defines the \fI\s-1NFKC\s0\fR
+normalization scheme to convert all these into a standard form as
+well, and \s-1GCC\s0 will warn if your code is not in \s-1NFKC\s0 if you use
+\&\fB\-Wnormalized=nfkc\fR. This warning is comparable to warning
+about every identifier that contains the letter O because it might be
+confused with the digit 0, and so is not the default, but may be
+useful as a local coding convention if the programming environment is
+unable to be fixed to display these characters distinctly.
+.IP "\fB\-Wno\-deprecated\fR" 4
+.IX Item "-Wno-deprecated"
+Do not warn about usage of deprecated features.
+.IP "\fB\-Wno\-deprecated\-declarations\fR" 4
+.IX Item "-Wno-deprecated-declarations"
+Do not warn about uses of functions,
+variables, and types marked as deprecated by using the \f(CW\*(C`deprecated\*(C'\fR
+attribute.
+.IP "\fB\-Wno\-overflow\fR" 4
+.IX Item "-Wno-overflow"
+Do not warn about compile-time overflow in constant expressions.
+.IP "\fB\-Woverride\-init\fR (C and Objective-C only)" 4
+.IX Item "-Woverride-init (C and Objective-C only)"
+Warn if an initialized field without side effects is overridden when
+using designated initializers.
+.Sp
+This warning is included in \fB\-Wextra\fR. To get other
+\&\fB\-Wextra\fR warnings without this one, use \fB\-Wextra
+\&\-Wno\-override\-init\fR.
+.IP "\fB\-Wpacked\fR" 4
+.IX Item "-Wpacked"
+Warn if a structure is given the packed attribute, but the packed
+attribute has no effect on the layout or size of the structure.
+Such structures may be mis-aligned for little benefit. For
+instance, in this code, the variable \f(CW\*(C`f.x\*(C'\fR in \f(CW\*(C`struct bar\*(C'\fR
+will be misaligned even though \f(CW\*(C`struct bar\*(C'\fR does not itself
+have the packed attribute:
+.Sp
+.Vb 8
+\& struct foo {
+\& int x;
+\& char a, b, c, d;
+\& } _\|_attribute_\|_((packed));
+\& struct bar {
+\& char z;
+\& struct foo f;
+\& };
+.Ve
+.IP "\fB\-Wpacked\-bitfield\-compat\fR" 4
+.IX Item "-Wpacked-bitfield-compat"
+The 4.1, 4.2 and 4.3 series of \s-1GCC\s0 ignore the \f(CW\*(C`packed\*(C'\fR attribute
+on bit-fields of type \f(CW\*(C`char\*(C'\fR. This has been fixed in \s-1GCC\s0 4.4 but
+the change can lead to differences in the structure layout. \s-1GCC\s0
+informs you when the offset of such a field has changed in \s-1GCC\s0 4.4.
+For example there is no longer a 4\-bit padding between field \f(CW\*(C`a\*(C'\fR
+and \f(CW\*(C`b\*(C'\fR in this structure:
+.Sp
+.Vb 5
+\& struct foo
+\& {
+\& char a:4;
+\& char b:8;
+\& } _\|_attribute_\|_ ((packed));
+.Ve
+.Sp
+This warning is enabled by default. Use
+\&\fB\-Wno\-packed\-bitfield\-compat\fR to disable this warning.
+.IP "\fB\-Wpadded\fR" 4
+.IX Item "-Wpadded"
+Warn if padding is included in a structure, either to align an element
+of the structure or to align the whole structure. Sometimes when this
+happens it is possible to rearrange the fields of the structure to
+reduce the padding and so make the structure smaller.
+.IP "\fB\-Wredundant\-decls\fR" 4
+.IX Item "-Wredundant-decls"
+Warn if anything is declared more than once in the same scope, even in
+cases where multiple declaration is valid and changes nothing.
+.IP "\fB\-Wnested\-externs\fR (C and Objective-C only)" 4
+.IX Item "-Wnested-externs (C and Objective-C only)"
+Warn if an \f(CW\*(C`extern\*(C'\fR declaration is encountered within a function.
+.IP "\fB\-Wunreachable\-code\fR" 4
+.IX Item "-Wunreachable-code"
+Warn if the compiler detects that code will never be executed.
+.Sp
+This option is intended to warn when the compiler detects that at
+least a whole line of source code will never be executed, because
+some condition is never satisfied or because it is after a
+procedure that never returns.
+.Sp
+It is possible for this option to produce a warning even though there
+are circumstances under which part of the affected line can be executed,
+so care should be taken when removing apparently-unreachable code.
+.Sp
+For instance, when a function is inlined, a warning may mean that the
+line is unreachable in only one inlined copy of the function.
+.Sp
+This option is not made part of \fB\-Wall\fR because in a debugging
+version of a program there is often substantial code which checks
+correct functioning of the program and is, hopefully, unreachable
+because the program does work. Another common use of unreachable
+code is to provide behavior which is selectable at compile-time.
+.IP "\fB\-Winline\fR" 4
+.IX Item "-Winline"
+Warn if a function can not be inlined and it was declared as inline.
+Even with this option, the compiler will not warn about failures to
+inline functions declared in system headers.
+.Sp
+The compiler uses a variety of heuristics to determine whether or not
+to inline a function. For example, the compiler takes into account
+the size of the function being inlined and the amount of inlining
+that has already been done in the current function. Therefore,
+seemingly insignificant changes in the source program can cause the
+warnings produced by \fB\-Winline\fR to appear or disappear.
+.IP "\fB\-Wno\-invalid\-offsetof\fR (\*(C+ and Objective\-\*(C+ only)" 4
+.IX Item "-Wno-invalid-offsetof ( and Objective- only)"
+Suppress warnings from applying the \fBoffsetof\fR macro to a non-POD
+type. According to the 1998 \s-1ISO\s0 \*(C+ standard, applying \fBoffsetof\fR
+to a non-POD type is undefined. In existing \*(C+ implementations,
+however, \fBoffsetof\fR typically gives meaningful results even when
+applied to certain kinds of non-POD types. (Such as a simple
+\&\fBstruct\fR that fails to be a \s-1POD\s0 type only by virtue of having a
+constructor.) This flag is for users who are aware that they are
+writing nonportable code and who have deliberately chosen to ignore the
+warning about it.
+.Sp
+The restrictions on \fBoffsetof\fR may be relaxed in a future version
+of the \*(C+ standard.
+.IP "\fB\-Wno\-int\-to\-pointer\-cast\fR (C and Objective-C only)" 4
+.IX Item "-Wno-int-to-pointer-cast (C and Objective-C only)"
+Suppress warnings from casts to pointer type of an integer of a
+different size.
+.IP "\fB\-Wno\-pointer\-to\-int\-cast\fR (C and Objective-C only)" 4
+.IX Item "-Wno-pointer-to-int-cast (C and Objective-C only)"
+Suppress warnings from casts from a pointer to an integer type of a
+different size.
+.IP "\fB\-Winvalid\-pch\fR" 4
+.IX Item "-Winvalid-pch"
+Warn if a precompiled header is found in
+the search path but can't be used.
+.IP "\fB\-Wlong\-long\fR" 4
+.IX Item "-Wlong-long"
+Warn if \fBlong long\fR type is used. This is default. To inhibit
+the warning messages, use \fB\-Wno\-long\-long\fR. Flags
+\&\fB\-Wlong\-long\fR and \fB\-Wno\-long\-long\fR are taken into account
+only when \fB\-pedantic\fR flag is used.
+.IP "\fB\-Wvariadic\-macros\fR" 4
+.IX Item "-Wvariadic-macros"
+Warn if variadic macros are used in pedantic \s-1ISO\s0 C90 mode, or the \s-1GNU\s0
+alternate syntax when in pedantic \s-1ISO\s0 C99 mode. This is default.
+To inhibit the warning messages, use \fB\-Wno\-variadic\-macros\fR.
+.IP "\fB\-Wvla\fR" 4
+.IX Item "-Wvla"
+Warn if variable length array is used in the code.
+\&\fB\-Wno\-vla\fR will prevent the \fB\-pedantic\fR warning of
+the variable length array.
+.IP "\fB\-Wvolatile\-register\-var\fR" 4
+.IX Item "-Wvolatile-register-var"
+Warn if a register variable is declared volatile. The volatile
+modifier does not inhibit all optimizations that may eliminate reads
+and/or writes to register variables. This warning is enabled by
+\&\fB\-Wall\fR.
+.IP "\fB\-Wdisabled\-optimization\fR" 4
+.IX Item "-Wdisabled-optimization"
+Warn if a requested optimization pass is disabled. This warning does
+not generally indicate that there is anything wrong with your code; it
+merely indicates that \s-1GCC\s0's optimizers were unable to handle the code
+effectively. Often, the problem is that your code is too big or too
+complex; \s-1GCC\s0 will refuse to optimize programs when the optimization
+itself is likely to take inordinate amounts of time.
+.IP "\fB\-Wpointer\-sign\fR (C and Objective-C only)" 4
+.IX Item "-Wpointer-sign (C and Objective-C only)"
+Warn for pointer argument passing or assignment with different signedness.
+This option is only supported for C and Objective-C. It is implied by
+\&\fB\-Wall\fR and by \fB\-pedantic\fR, which can be disabled with
+\&\fB\-Wno\-pointer\-sign\fR.
+.IP "\fB\-Wstack\-protector\fR" 4
+.IX Item "-Wstack-protector"
+This option is only active when \fB\-fstack\-protector\fR is active. It
+warns about functions that will not be protected against stack smashing.
+.IP "\fB\-Wno\-mudflap\fR" 4
+.IX Item "-Wno-mudflap"
+Suppress warnings about constructs that cannot be instrumented by
+\&\fB\-fmudflap\fR.
+.IP "\fB\-Woverlength\-strings\fR" 4
+.IX Item "-Woverlength-strings"
+Warn about string constants which are longer than the \*(L"minimum
+maximum\*(R" length specified in the C standard. Modern compilers
+generally allow string constants which are much longer than the
+standard's minimum limit, but very portable programs should avoid
+using longer strings.
+.Sp
+The limit applies \fIafter\fR string constant concatenation, and does
+not count the trailing \s-1NUL\s0. In C89, the limit was 509 characters; in
+C99, it was raised to 4095. \*(C+98 does not specify a normative
+minimum maximum, so we do not diagnose overlength strings in \*(C+.
+.Sp
+This option is implied by \fB\-pedantic\fR, and can be disabled with
+\&\fB\-Wno\-overlength\-strings\fR.
+.Sh "Options for Debugging Your Program or \s-1GCC\s0"
+.IX Subsection "Options for Debugging Your Program or GCC"
+\&\s-1GCC\s0 has various special options that are used for debugging
+either your program or \s-1GCC:\s0
+.IP "\fB\-g\fR" 4
+.IX Item "-g"
+Produce debugging information in the operating system's native format
+(stabs, \s-1COFF\s0, \s-1XCOFF\s0, or \s-1DWARF\s0 2). \s-1GDB\s0 can work with this debugging
+information.
+.Sp
+On most systems that use stabs format, \fB\-g\fR enables use of extra
+debugging information that only \s-1GDB\s0 can use; this extra information
+makes debugging work better in \s-1GDB\s0 but will probably make other debuggers
+crash or
+refuse to read the program. If you want to control for certain whether
+to generate the extra information, use \fB\-gstabs+\fR, \fB\-gstabs\fR,
+\&\fB\-gxcoff+\fR, \fB\-gxcoff\fR, or \fB\-gvms\fR (see below).
+.Sp
+\&\s-1GCC\s0 allows you to use \fB\-g\fR with
+\&\fB\-O\fR. The shortcuts taken by optimized code may occasionally
+produce surprising results: some variables you declared may not exist
+at all; flow of control may briefly move where you did not expect it;
+some statements may not be executed because they compute constant
+results or their values were already at hand; some statements may
+execute in different places because they were moved out of loops.
+.Sp
+Nevertheless it proves possible to debug optimized output. This makes
+it reasonable to use the optimizer for programs that might have bugs.
+.Sp
+The following options are useful when \s-1GCC\s0 is generated with the
+capability for more than one debugging format.
+.IP "\fB\-ggdb\fR" 4
+.IX Item "-ggdb"
+Produce debugging information for use by \s-1GDB\s0. This means to use the
+most expressive format available (\s-1DWARF\s0 2, stabs, or the native format
+if neither of those are supported), including \s-1GDB\s0 extensions if at all
+possible.
+.IP "\fB\-gstabs\fR" 4
+.IX Item "-gstabs"
+Produce debugging information in stabs format (if that is supported),
+without \s-1GDB\s0 extensions. This is the format used by \s-1DBX\s0 on most \s-1BSD\s0
+systems. On \s-1MIPS\s0, Alpha and System V Release 4 systems this option
+produces stabs debugging output which is not understood by \s-1DBX\s0 or \s-1SDB\s0.
+On System V Release 4 systems this option requires the \s-1GNU\s0 assembler.
+.IP "\fB\-feliminate\-unused\-debug\-symbols\fR" 4
+.IX Item "-feliminate-unused-debug-symbols"
+Produce debugging information in stabs format (if that is supported),
+for only symbols that are actually used.
+.IP "\fB\-femit\-class\-debug\-always\fR" 4
+.IX Item "-femit-class-debug-always"
+Instead of emitting debugging information for a \*(C+ class in only one
+object file, emit it in all object files using the class. This option
+should be used only with debuggers that are unable to handle the way \s-1GCC\s0
+normally emits debugging information for classes because using this
+option will increase the size of debugging information by as much as a
+factor of two.
+.IP "\fB\-gstabs+\fR" 4
+.IX Item "-gstabs+"
+Produce debugging information in stabs format (if that is supported),
+using \s-1GNU\s0 extensions understood only by the \s-1GNU\s0 debugger (\s-1GDB\s0). The
+use of these extensions is likely to make other debuggers crash or
+refuse to read the program.
+.IP "\fB\-gcoff\fR" 4
+.IX Item "-gcoff"
+Produce debugging information in \s-1COFF\s0 format (if that is supported).
+This is the format used by \s-1SDB\s0 on most System V systems prior to
+System V Release 4.
+.IP "\fB\-gxcoff\fR" 4
+.IX Item "-gxcoff"
+Produce debugging information in \s-1XCOFF\s0 format (if that is supported).
+This is the format used by the \s-1DBX\s0 debugger on \s-1IBM\s0 \s-1RS/6000\s0 systems.
+.IP "\fB\-gxcoff+\fR" 4
+.IX Item "-gxcoff+"
+Produce debugging information in \s-1XCOFF\s0 format (if that is supported),
+using \s-1GNU\s0 extensions understood only by the \s-1GNU\s0 debugger (\s-1GDB\s0). The
+use of these extensions is likely to make other debuggers crash or
+refuse to read the program, and may cause assemblers other than the \s-1GNU\s0
+assembler (\s-1GAS\s0) to fail with an error.
+.IP "\fB\-gdwarf\-2\fR" 4
+.IX Item "-gdwarf-2"
+Produce debugging information in \s-1DWARF\s0 version 2 format (if that is
+supported). This is the format used by \s-1DBX\s0 on \s-1IRIX\s0 6. With this
+option, \s-1GCC\s0 uses features of \s-1DWARF\s0 version 3 when they are useful;
+version 3 is upward compatible with version 2, but may still cause
+problems for older debuggers.
+.IP "\fB\-gvms\fR" 4
+.IX Item "-gvms"
+Produce debugging information in \s-1VMS\s0 debug format (if that is
+supported). This is the format used by \s-1DEBUG\s0 on \s-1VMS\s0 systems.
+.IP "\fB\-g\fR\fIlevel\fR" 4
+.IX Item "-glevel"
+.PD 0
+.IP "\fB\-ggdb\fR\fIlevel\fR" 4
+.IX Item "-ggdblevel"
+.IP "\fB\-gstabs\fR\fIlevel\fR" 4
+.IX Item "-gstabslevel"
+.IP "\fB\-gcoff\fR\fIlevel\fR" 4
+.IX Item "-gcofflevel"
+.IP "\fB\-gxcoff\fR\fIlevel\fR" 4
+.IX Item "-gxcofflevel"
+.IP "\fB\-gvms\fR\fIlevel\fR" 4
+.IX Item "-gvmslevel"
+.PD
+Request debugging information and also use \fIlevel\fR to specify how
+much information. The default level is 2.
+.Sp
+Level 0 produces no debug information at all. Thus, \fB\-g0\fR negates
+\&\fB\-g\fR.
+.Sp
+Level 1 produces minimal information, enough for making backtraces in
+parts of the program that you don't plan to debug. This includes
+descriptions of functions and external variables, but no information
+about local variables and no line numbers.
+.Sp
+Level 3 includes extra information, such as all the macro definitions
+present in the program. Some debuggers support macro expansion when
+you use \fB\-g3\fR.
+.Sp
+\&\fB\-gdwarf\-2\fR does not accept a concatenated debug level, because
+\&\s-1GCC\s0 used to support an option \fB\-gdwarf\fR that meant to generate
+debug information in version 1 of the \s-1DWARF\s0 format (which is very
+different from version 2), and it would have been too confusing. That
+debug format is long obsolete, but the option cannot be changed now.
+Instead use an additional \fB\-g\fR\fIlevel\fR option to change the
+debug level for \s-1DWARF2\s0.
+.IP "\fB\-feliminate\-dwarf2\-dups\fR" 4
+.IX Item "-feliminate-dwarf2-dups"
+Compress \s-1DWARF2\s0 debugging information by eliminating duplicated
+information about each symbol. This option only makes sense when
+generating \s-1DWARF2\s0 debugging information with \fB\-gdwarf\-2\fR.
+.IP "\fB\-femit\-struct\-debug\-baseonly\fR" 4
+.IX Item "-femit-struct-debug-baseonly"
+Emit debug information for struct-like types
+only when the base name of the compilation source file
+matches the base name of file in which the struct was defined.
+.Sp
+This option substantially reduces the size of debugging information,
+but at significant potential loss in type information to the debugger.
+See \fB\-femit\-struct\-debug\-reduced\fR for a less aggressive option.
+See \fB\-femit\-struct\-debug\-detailed\fR for more detailed control.
+.Sp
+This option works only with \s-1DWARF\s0 2.
+.IP "\fB\-femit\-struct\-debug\-reduced\fR" 4
+.IX Item "-femit-struct-debug-reduced"
+Emit debug information for struct-like types
+only when the base name of the compilation source file
+matches the base name of file in which the type was defined,
+unless the struct is a template or defined in a system header.
+.Sp
+This option significantly reduces the size of debugging information,
+with some potential loss in type information to the debugger.
+See \fB\-femit\-struct\-debug\-baseonly\fR for a more aggressive option.
+See \fB\-femit\-struct\-debug\-detailed\fR for more detailed control.
+.Sp
+This option works only with \s-1DWARF\s0 2.
+.IP "\fB\-femit\-struct\-debug\-detailed\fR[\fB=\fR\fIspec-list\fR]" 4
+.IX Item "-femit-struct-debug-detailed[=spec-list]"
+Specify the struct-like types
+for which the compiler will generate debug information.
+The intent is to reduce duplicate struct debug information
+between different object files within the same program.
+.Sp
+This option is a detailed version of
+\&\fB\-femit\-struct\-debug\-reduced\fR and \fB\-femit\-struct\-debug\-baseonly\fR,
+which will serve for most needs.
+.Sp
+A specification has the syntax
+[\fBdir:\fR|\fBind:\fR][\fBord:\fR|\fBgen:\fR](\fBany\fR|\fBsys\fR|\fBbase\fR|\fBnone\fR)
+.Sp
+The optional first word limits the specification to
+structs that are used directly (\fBdir:\fR) or used indirectly (\fBind:\fR).
+A struct type is used directly when it is the type of a variable, member.
+Indirect uses arise through pointers to structs.
+That is, when use of an incomplete struct would be legal, the use is indirect.
+An example is
+\&\fBstruct one direct; struct two * indirect;\fR.
+.Sp
+The optional second word limits the specification to
+ordinary structs (\fBord:\fR) or generic structs (\fBgen:\fR).
+Generic structs are a bit complicated to explain.
+For \*(C+, these are non-explicit specializations of template classes,
+or non-template classes within the above.
+Other programming languages have generics,
+but \fB\-femit\-struct\-debug\-detailed\fR does not yet implement them.
+.Sp
+The third word specifies the source files for those
+structs for which the compiler will emit debug information.
+The values \fBnone\fR and \fBany\fR have the normal meaning.
+The value \fBbase\fR means that
+the base of name of the file in which the type declaration appears
+must match the base of the name of the main compilation file.
+In practice, this means that
+types declared in \fIfoo.c\fR and \fIfoo.h\fR will have debug information,
+but types declared in other header will not.
+The value \fBsys\fR means those types satisfying \fBbase\fR
+or declared in system or compiler headers.
+.Sp
+You may need to experiment to determine the best settings for your application.
+.Sp
+The default is \fB\-femit\-struct\-debug\-detailed=all\fR.
+.Sp
+This option works only with \s-1DWARF\s0 2.
+.IP "\fB\-fno\-merge\-debug\-strings\fR" 4
+.IX Item "-fno-merge-debug-strings"
+Direct the linker to not merge together strings in the debugging
+information which are identical in different object files. Merging is
+not supported by all assemblers or linkers. Merging decreases the size
+of the debug information in the output file at the cost of increasing
+link processing time. Merging is enabled by default.
+.IP "\fB\-fdebug\-prefix\-map=\fR\fIold\fR\fB=\fR\fInew\fR" 4
+.IX Item "-fdebug-prefix-map=old=new"
+When compiling files in directory \fI\fIold\fI\fR, record debugging
+information describing them as in \fI\fInew\fI\fR instead.
+.IP "\fB\-fno\-dwarf2\-cfi\-asm\fR" 4
+.IX Item "-fno-dwarf2-cfi-asm"
+Emit \s-1DWARF\s0 2 unwind info as compiler generated \f(CW\*(C`.eh_frame\*(C'\fR section
+instead of using \s-1GAS\s0 \f(CW\*(C`.cfi_*\*(C'\fR directives.
+.IP "\fB\-p\fR" 4
+.IX Item "-p"
+Generate extra code to write profile information suitable for the
+analysis program \fBprof\fR. You must use this option when compiling
+the source files you want data about, and you must also use it when
+linking.
+.IP "\fB\-pg\fR" 4
+.IX Item "-pg"
+Generate extra code to write profile information suitable for the
+analysis program \fBgprof\fR. You must use this option when compiling
+the source files you want data about, and you must also use it when
+linking.
+.IP "\fB\-Q\fR" 4
+.IX Item "-Q"
+Makes the compiler print out each function name as it is compiled, and
+print some statistics about each pass when it finishes.
+.IP "\fB\-ftime\-report\fR" 4
+.IX Item "-ftime-report"
+Makes the compiler print some statistics about the time consumed by each
+pass when it finishes.
+.IP "\fB\-fmem\-report\fR" 4
+.IX Item "-fmem-report"
+Makes the compiler print some statistics about permanent memory
+allocation when it finishes.
+.IP "\fB\-fpre\-ipa\-mem\-report\fR" 4
+.IX Item "-fpre-ipa-mem-report"
+.PD 0
+.IP "\fB\-fpost\-ipa\-mem\-report\fR" 4
+.IX Item "-fpost-ipa-mem-report"
+.PD
+Makes the compiler print some statistics about permanent memory
+allocation before or after interprocedural optimization.
+.IP "\fB\-fprofile\-arcs\fR" 4
+.IX Item "-fprofile-arcs"
+Add code so that program flow \fIarcs\fR are instrumented. During
+execution the program records how many times each branch and call is
+executed and how many times it is taken or returns. When the compiled
+program exits it saves this data to a file called
+\&\fI\fIauxname\fI.gcda\fR for each source file. The data may be used for
+profile-directed optimizations (\fB\-fbranch\-probabilities\fR), or for
+test coverage analysis (\fB\-ftest\-coverage\fR). Each object file's
+\&\fIauxname\fR is generated from the name of the output file, if
+explicitly specified and it is not the final executable, otherwise it is
+the basename of the source file. In both cases any suffix is removed
+(e.g. \fIfoo.gcda\fR for input file \fIdir/foo.c\fR, or
+\&\fIdir/foo.gcda\fR for output file specified as \fB\-o dir/foo.o\fR).
+.IP "\fB\-\-coverage\fR" 4
+.IX Item "--coverage"
+This option is used to compile and link code instrumented for coverage
+analysis. The option is a synonym for \fB\-fprofile\-arcs\fR
+\&\fB\-ftest\-coverage\fR (when compiling) and \fB\-lgcov\fR (when
+linking). See the documentation for those options for more details.
+.RS 4
+.IP "\(bu" 4
+Compile the source files with \fB\-fprofile\-arcs\fR plus optimization
+and code generation options. For test coverage analysis, use the
+additional \fB\-ftest\-coverage\fR option. You do not need to profile
+every source file in a program.
+.IP "\(bu" 4
+Link your object files with \fB\-lgcov\fR or \fB\-fprofile\-arcs\fR
+(the latter implies the former).
+.IP "\(bu" 4
+Run the program on a representative workload to generate the arc profile
+information. This may be repeated any number of times. You can run
+concurrent instances of your program, and provided that the file system
+supports locking, the data files will be correctly updated. Also
+\&\f(CW\*(C`fork\*(C'\fR calls are detected and correctly handled (double counting
+will not happen).
+.IP "\(bu" 4
+For profile-directed optimizations, compile the source files again with
+the same optimization and code generation options plus
+\&\fB\-fbranch\-probabilities\fR.
+.IP "\(bu" 4
+For test coverage analysis, use \fBgcov\fR to produce human readable
+information from the \fI.gcno\fR and \fI.gcda\fR files. Refer to the
+\&\fBgcov\fR documentation for further information.
+.RE
+.RS 4
+.Sp
+With \fB\-fprofile\-arcs\fR, for each function of your program \s-1GCC\s0
+creates a program flow graph, then finds a spanning tree for the graph.
+Only arcs that are not on the spanning tree have to be instrumented: the
+compiler adds code to count the number of times that these arcs are
+executed. When an arc is the only exit or only entrance to a block, the
+instrumentation code can be added to the block; otherwise, a new basic
+block must be created to hold the instrumentation code.
+.RE
+.IP "\fB\-ftest\-coverage\fR" 4
+.IX Item "-ftest-coverage"
+Produce a notes file that the \fBgcov\fR code-coverage utility can use to
+show program coverage. Each source file's note file is called
+\&\fI\fIauxname\fI.gcno\fR. Refer to the \fB\-fprofile\-arcs\fR option
+above for a description of \fIauxname\fR and instructions on how to
+generate test coverage data. Coverage data will match the source files
+more closely, if you do not optimize.
+.IP "\fB\-fdbg\-cnt\-list\fR" 4
+.IX Item "-fdbg-cnt-list"
+Print the name and the counter upperbound for all debug counters.
+.IP "\fB\-fdbg\-cnt=\fR\fIcounter-value-list\fR" 4
+.IX Item "-fdbg-cnt=counter-value-list"
+Set the internal debug counter upperbound. \fIcounter-value-list\fR
+is a comma-separated list of \fIname\fR:\fIvalue\fR pairs
+which sets the upperbound of each debug counter \fIname\fR to \fIvalue\fR.
+All debug counters have the initial upperbound of \fI\s-1UINT_MAX\s0\fR,
+thus \fIdbg_cnt()\fR returns true always unless the upperbound is set by this option.
+e.g. With \-fdbg\-cnt=dce:10,tail_call:0
+dbg_cnt(dce) will return true only for first 10 invocations
+and dbg_cnt(tail_call) will return false always.
+.IP "\fB\-d\fR\fIletters\fR" 4
+.IX Item "-dletters"
+.PD 0
+.IP "\fB\-fdump\-rtl\-\fR\fIpass\fR" 4
+.IX Item "-fdump-rtl-pass"
+.PD
+Says to make debugging dumps during compilation at times specified by
+\&\fIletters\fR. This is used for debugging the RTL-based passes of the
+compiler. The file names for most of the dumps are made by appending a
+pass number and a word to the \fIdumpname\fR. \fIdumpname\fR is generated
+from the name of the output file, if explicitly specified and it is not
+an executable, otherwise it is the basename of the source file. These
+switches may have different effects when \fB\-E\fR is used for
+preprocessing.
+.Sp
+Debug dumps can be enabled with a \fB\-fdump\-rtl\fR switch or some
+\&\fB\-d\fR option \fIletters\fR. Here are the possible
+letters for use in \fIpass\fR and \fIletters\fR, and their meanings:
+.RS 4
+.IP "\fB\-fdump\-rtl\-alignments\fR" 4
+.IX Item "-fdump-rtl-alignments"
+Dump after branch alignments have been computed.
+.IP "\fB\-fdump\-rtl\-asmcons\fR" 4
+.IX Item "-fdump-rtl-asmcons"
+Dump after fixing rtl statements that have unsatisfied in/out constraints.
+.IP "\fB\-fdump\-rtl\-auto_inc_dec\fR" 4
+.IX Item "-fdump-rtl-auto_inc_dec"
+Dump after auto-inc-dec discovery. This pass is only run on
+architectures that have auto inc or auto dec instructions.
+.IP "\fB\-fdump\-rtl\-barriers\fR" 4
+.IX Item "-fdump-rtl-barriers"
+Dump after cleaning up the barrier instructions.
+.IP "\fB\-fdump\-rtl\-bbpart\fR" 4
+.IX Item "-fdump-rtl-bbpart"
+Dump after partitioning hot and cold basic blocks.
+.IP "\fB\-fdump\-rtl\-bbro\fR" 4
+.IX Item "-fdump-rtl-bbro"
+Dump after block reordering.
+.IP "\fB\-fdump\-rtl\-btl1\fR" 4
+.IX Item "-fdump-rtl-btl1"
+.PD 0
+.IP "\fB\-fdump\-rtl\-btl2\fR" 4
+.IX Item "-fdump-rtl-btl2"
+.PD
+\&\fB\-fdump\-rtl\-btl1\fR and \fB\-fdump\-rtl\-btl2\fR enable dumping
+after the two branch
+target load optimization passes.
+.IP "\fB\-fdump\-rtl\-bypass\fR" 4
+.IX Item "-fdump-rtl-bypass"
+Dump after jump bypassing and control flow optimizations.
+.IP "\fB\-fdump\-rtl\-combine\fR" 4
+.IX Item "-fdump-rtl-combine"
+Dump after the \s-1RTL\s0 instruction combination pass.
+.IP "\fB\-fdump\-rtl\-compgotos\fR" 4
+.IX Item "-fdump-rtl-compgotos"
+Dump after duplicating the computed gotos.
+.IP "\fB\-fdump\-rtl\-ce1\fR" 4
+.IX Item "-fdump-rtl-ce1"
+.PD 0
+.IP "\fB\-fdump\-rtl\-ce2\fR" 4
+.IX Item "-fdump-rtl-ce2"
+.IP "\fB\-fdump\-rtl\-ce3\fR" 4
+.IX Item "-fdump-rtl-ce3"
+.PD
+\&\fB\-fdump\-rtl\-ce1\fR, \fB\-fdump\-rtl\-ce2\fR, and
+\&\fB\-fdump\-rtl\-ce3\fR enable dumping after the three
+if conversion passes.
+.IP "\fB\-fdump\-rtl\-cprop_hardreg\fR" 4
+.IX Item "-fdump-rtl-cprop_hardreg"
+Dump after hard register copy propagation.
+.IP "\fB\-fdump\-rtl\-csa\fR" 4
+.IX Item "-fdump-rtl-csa"
+Dump after combining stack adjustments.
+.IP "\fB\-fdump\-rtl\-cse1\fR" 4
+.IX Item "-fdump-rtl-cse1"
+.PD 0
+.IP "\fB\-fdump\-rtl\-cse2\fR" 4
+.IX Item "-fdump-rtl-cse2"
+.PD
+\&\fB\-fdump\-rtl\-cse1\fR and \fB\-fdump\-rtl\-cse2\fR enable dumping after
+the two common sub-expression elimination passes.
+.IP "\fB\-fdump\-rtl\-dce\fR" 4
+.IX Item "-fdump-rtl-dce"
+Dump after the standalone dead code elimination passes.
+.IP "\fB\-fdump\-rtl\-dbr\fR" 4
+.IX Item "-fdump-rtl-dbr"
+Dump after delayed branch scheduling.
+.IP "\fB\-fdump\-rtl\-dce1\fR" 4
+.IX Item "-fdump-rtl-dce1"
+.PD 0
+.IP "\fB\-fdump\-rtl\-dce2\fR" 4
+.IX Item "-fdump-rtl-dce2"
+.PD
+\&\fB\-fdump\-rtl\-dce1\fR and \fB\-fdump\-rtl\-dce2\fR enable dumping after
+the two dead store elimination passes.
+.IP "\fB\-fdump\-rtl\-eh\fR" 4
+.IX Item "-fdump-rtl-eh"
+Dump after finalization of \s-1EH\s0 handling code.
+.IP "\fB\-fdump\-rtl\-eh_ranges\fR" 4
+.IX Item "-fdump-rtl-eh_ranges"
+Dump after conversion of \s-1EH\s0 handling range regions.
+.IP "\fB\-fdump\-rtl\-expand\fR" 4
+.IX Item "-fdump-rtl-expand"
+Dump after \s-1RTL\s0 generation.
+.IP "\fB\-fdump\-rtl\-fwprop1\fR" 4
+.IX Item "-fdump-rtl-fwprop1"
+.PD 0
+.IP "\fB\-fdump\-rtl\-fwprop2\fR" 4
+.IX Item "-fdump-rtl-fwprop2"
+.PD
+\&\fB\-fdump\-rtl\-fwprop1\fR and \fB\-fdump\-rtl\-fwprop2\fR enable
+dumping after the two forward propagation passes.
+.IP "\fB\-fdump\-rtl\-gcse1\fR" 4
+.IX Item "-fdump-rtl-gcse1"
+.PD 0
+.IP "\fB\-fdump\-rtl\-gcse2\fR" 4
+.IX Item "-fdump-rtl-gcse2"
+.PD
+\&\fB\-fdump\-rtl\-gcse1\fR and \fB\-fdump\-rtl\-gcse2\fR enable dumping
+after global common subexpression elimination.
+.IP "\fB\-fdump\-rtl\-init\-regs\fR" 4
+.IX Item "-fdump-rtl-init-regs"
+Dump after the initialization of the registers.
+.IP "\fB\-fdump\-rtl\-initvals\fR" 4
+.IX Item "-fdump-rtl-initvals"
+Dump after the computation of the initial value sets.
+.IP "\fB\-fdump\-rtl\-into_cfglayout\fR" 4
+.IX Item "-fdump-rtl-into_cfglayout"
+Dump after converting to cfglayout mode.
+.IP "\fB\-fdump\-rtl\-ira\fR" 4
+.IX Item "-fdump-rtl-ira"
+Dump after iterated register allocation.
+.IP "\fB\-fdump\-rtl\-jump\fR" 4
+.IX Item "-fdump-rtl-jump"
+Dump after the second jump optimization.
+.IP "\fB\-fdump\-rtl\-loop2\fR" 4
+.IX Item "-fdump-rtl-loop2"
+\&\fB\-fdump\-rtl\-loop2\fR enables dumping after the rtl
+loop optimization passes.
+.IP "\fB\-fdump\-rtl\-mach\fR" 4
+.IX Item "-fdump-rtl-mach"
+Dump after performing the machine dependent reorganization pass, if that
+pass exists.
+.IP "\fB\-fdump\-rtl\-mode_sw\fR" 4
+.IX Item "-fdump-rtl-mode_sw"
+Dump after removing redundant mode switches.
+.IP "\fB\-fdump\-rtl\-rnreg\fR" 4
+.IX Item "-fdump-rtl-rnreg"
+Dump after register renumbering.
+.IP "\fB\-fdump\-rtl\-outof_cfglayout\fR" 4
+.IX Item "-fdump-rtl-outof_cfglayout"
+Dump after converting from cfglayout mode.
+.IP "\fB\-fdump\-rtl\-peephole2\fR" 4
+.IX Item "-fdump-rtl-peephole2"
+Dump after the peephole pass.
+.IP "\fB\-fdump\-rtl\-postreload\fR" 4
+.IX Item "-fdump-rtl-postreload"
+Dump after post-reload optimizations.
+.IP "\fB\-fdump\-rtl\-pro_and_epilogue\fR" 4
+.IX Item "-fdump-rtl-pro_and_epilogue"
+Dump after generating the function pro and epilogues.
+.IP "\fB\-fdump\-rtl\-regmove\fR" 4
+.IX Item "-fdump-rtl-regmove"
+Dump after the register move pass.
+.IP "\fB\-fdump\-rtl\-sched1\fR" 4
+.IX Item "-fdump-rtl-sched1"
+.PD 0
+.IP "\fB\-fdump\-rtl\-sched2\fR" 4
+.IX Item "-fdump-rtl-sched2"
+.PD
+\&\fB\-fdump\-rtl\-sched1\fR and \fB\-fdump\-rtl\-sched2\fR enable dumping
+after the basic block scheduling passes.
+.IP "\fB\-fdump\-rtl\-see\fR" 4
+.IX Item "-fdump-rtl-see"
+Dump after sign extension elimination.
+.IP "\fB\-fdump\-rtl\-seqabstr\fR" 4
+.IX Item "-fdump-rtl-seqabstr"
+Dump after common sequence discovery.
+.IP "\fB\-fdump\-rtl\-shorten\fR" 4
+.IX Item "-fdump-rtl-shorten"
+Dump after shortening branches.
+.IP "\fB\-fdump\-rtl\-sibling\fR" 4
+.IX Item "-fdump-rtl-sibling"
+Dump after sibling call optimizations.
+.IP "\fB\-fdump\-rtl\-split1\fR" 4
+.IX Item "-fdump-rtl-split1"
+.PD 0
+.IP "\fB\-fdump\-rtl\-split2\fR" 4
+.IX Item "-fdump-rtl-split2"
+.IP "\fB\-fdump\-rtl\-split3\fR" 4
+.IX Item "-fdump-rtl-split3"
+.IP "\fB\-fdump\-rtl\-split4\fR" 4
+.IX Item "-fdump-rtl-split4"
+.IP "\fB\-fdump\-rtl\-split5\fR" 4
+.IX Item "-fdump-rtl-split5"
+.PD
+\&\fB\-fdump\-rtl\-split1\fR, \fB\-fdump\-rtl\-split2\fR,
+\&\fB\-fdump\-rtl\-split3\fR, \fB\-fdump\-rtl\-split4\fR and
+\&\fB\-fdump\-rtl\-split5\fR enable dumping after five rounds of
+instruction splitting.
+.IP "\fB\-fdump\-rtl\-sms\fR" 4
+.IX Item "-fdump-rtl-sms"
+Dump after modulo scheduling. This pass is only run on some
+architectures.
+.IP "\fB\-fdump\-rtl\-stack\fR" 4
+.IX Item "-fdump-rtl-stack"
+Dump after conversion from \s-1GCC\s0's \*(L"flat register file\*(R" registers to the
+x87's stack-like registers. This pass is only run on x86 variants.
+.IP "\fB\-fdump\-rtl\-subreg1\fR" 4
+.IX Item "-fdump-rtl-subreg1"
+.PD 0
+.IP "\fB\-fdump\-rtl\-subreg2\fR" 4
+.IX Item "-fdump-rtl-subreg2"
+.PD
+\&\fB\-fdump\-rtl\-subreg1\fR and \fB\-fdump\-rtl\-subreg2\fR enable dumping after
+the two subreg expansion passes.
+.IP "\fB\-fdump\-rtl\-unshare\fR" 4
+.IX Item "-fdump-rtl-unshare"
+Dump after all rtl has been unshared.
+.IP "\fB\-fdump\-rtl\-vartrack\fR" 4
+.IX Item "-fdump-rtl-vartrack"
+Dump after variable tracking.
+.IP "\fB\-fdump\-rtl\-vregs\fR" 4
+.IX Item "-fdump-rtl-vregs"
+Dump after converting virtual registers to hard registers.
+.IP "\fB\-fdump\-rtl\-web\fR" 4
+.IX Item "-fdump-rtl-web"
+Dump after live range splitting.
+.IP "\fB\-fdump\-rtl\-regclass\fR" 4
+.IX Item "-fdump-rtl-regclass"
+.PD 0
+.IP "\fB\-fdump\-rtl\-subregs_of_mode_init\fR" 4
+.IX Item "-fdump-rtl-subregs_of_mode_init"
+.IP "\fB\-fdump\-rtl\-subregs_of_mode_finish\fR" 4
+.IX Item "-fdump-rtl-subregs_of_mode_finish"
+.IP "\fB\-fdump\-rtl\-dfinit\fR" 4
+.IX Item "-fdump-rtl-dfinit"
+.IP "\fB\-fdump\-rtl\-dfinish\fR" 4
+.IX Item "-fdump-rtl-dfinish"
+.PD
+These dumps are defined but always produce empty files.
+.IP "\fB\-fdump\-rtl\-all\fR" 4
+.IX Item "-fdump-rtl-all"
+Produce all the dumps listed above.
+.IP "\fB\-dA\fR" 4
+.IX Item "-dA"
+Annotate the assembler output with miscellaneous debugging information.
+.IP "\fB\-dD\fR" 4
+.IX Item "-dD"
+Dump all macro definitions, at the end of preprocessing, in addition to
+normal output.
+.IP "\fB\-dH\fR" 4
+.IX Item "-dH"
+Produce a core dump whenever an error occurs.
+.IP "\fB\-dm\fR" 4
+.IX Item "-dm"
+Print statistics on memory usage, at the end of the run, to
+standard error.
+.IP "\fB\-dp\fR" 4
+.IX Item "-dp"
+Annotate the assembler output with a comment indicating which
+pattern and alternative was used. The length of each instruction is
+also printed.
+.IP "\fB\-dP\fR" 4
+.IX Item "-dP"
+Dump the \s-1RTL\s0 in the assembler output as a comment before each instruction.
+Also turns on \fB\-dp\fR annotation.
+.IP "\fB\-dv\fR" 4
+.IX Item "-dv"
+For each of the other indicated dump files (\fB\-fdump\-rtl\-\fR\fIpass\fR),
+dump a representation of the control flow graph suitable for viewing with \s-1VCG\s0
+to \fI\fIfile\fI.\fIpass\fI.vcg\fR.
+.IP "\fB\-dx\fR" 4
+.IX Item "-dx"
+Just generate \s-1RTL\s0 for a function instead of compiling it. Usually used
+with \fB\-fdump\-rtl\-expand\fR.
+.IP "\fB\-dy\fR" 4
+.IX Item "-dy"
+Dump debugging information during parsing, to standard error.
+.RE
+.RS 4
+.RE
+.IP "\fB\-fdump\-noaddr\fR" 4
+.IX Item "-fdump-noaddr"
+When doing debugging dumps, suppress address output. This makes it more
+feasible to use diff on debugging dumps for compiler invocations with
+different compiler binaries and/or different
+text / bss / data / heap / stack / dso start locations.
+.IP "\fB\-fdump\-unnumbered\fR" 4
+.IX Item "-fdump-unnumbered"
+When doing debugging dumps, suppress instruction numbers and address output.
+This makes it more feasible to use diff on debugging dumps for compiler
+invocations with different options, in particular with and without
+\&\fB\-g\fR.
+.IP "\fB\-fdump\-translation\-unit\fR (\*(C+ only)" 4
+.IX Item "-fdump-translation-unit ( only)"
+.PD 0
+.IP "\fB\-fdump\-translation\-unit\-\fR\fIoptions\fR\fB \fR(\*(C+ only)" 4
+.IX Item "-fdump-translation-unit-options ( only)"
+.PD
+Dump a representation of the tree structure for the entire translation
+unit to a file. The file name is made by appending \fI.tu\fR to the
+source file name. If the \fB\-\fR\fIoptions\fR form is used, \fIoptions\fR
+controls the details of the dump as described for the
+\&\fB\-fdump\-tree\fR options.
+.IP "\fB\-fdump\-class\-hierarchy\fR (\*(C+ only)" 4
+.IX Item "-fdump-class-hierarchy ( only)"
+.PD 0
+.IP "\fB\-fdump\-class\-hierarchy\-\fR\fIoptions\fR\fB \fR(\*(C+ only)" 4
+.IX Item "-fdump-class-hierarchy-options ( only)"
+.PD
+Dump a representation of each class's hierarchy and virtual function
+table layout to a file. The file name is made by appending \fI.class\fR
+to the source file name. If the \fB\-\fR\fIoptions\fR form is used,
+\&\fIoptions\fR controls the details of the dump as described for the
+\&\fB\-fdump\-tree\fR options.
+.IP "\fB\-fdump\-ipa\-\fR\fIswitch\fR" 4
+.IX Item "-fdump-ipa-switch"
+Control the dumping at various stages of inter-procedural analysis
+language tree to a file. The file name is generated by appending a switch
+specific suffix to the source file name. The following dumps are possible:
+.RS 4
+.IP "\fBall\fR" 4
+.IX Item "all"
+Enables all inter-procedural analysis dumps.
+.IP "\fBcgraph\fR" 4
+.IX Item "cgraph"
+Dumps information about call-graph optimization, unused function removal,
+and inlining decisions.
+.IP "\fBinline\fR" 4
+.IX Item "inline"
+Dump after function inlining.
+.RE
+.RS 4
+.RE
+.IP "\fB\-fdump\-statistics\-\fR\fIoption\fR" 4
+.IX Item "-fdump-statistics-option"
+Enable and control dumping of pass statistics in a separate file. The
+file name is generated by appending a suffix ending in \fB.statistics\fR
+to the source file name. If the \fB\-\fR\fIoption\fR form is used,
+\&\fB\-stats\fR will cause counters to be summed over the whole compilation unit
+while \fB\-details\fR will dump every event as the passes generate them.
+The default with no option is to sum counters for each function compiled.
+.IP "\fB\-fdump\-tree\-\fR\fIswitch\fR" 4
+.IX Item "-fdump-tree-switch"
+.PD 0
+.IP "\fB\-fdump\-tree\-\fR\fIswitch\fR\fB\-\fR\fIoptions\fR" 4
+.IX Item "-fdump-tree-switch-options"
+.PD
+Control the dumping at various stages of processing the intermediate
+language tree to a file. The file name is generated by appending a switch
+specific suffix to the source file name. If the \fB\-\fR\fIoptions\fR
+form is used, \fIoptions\fR is a list of \fB\-\fR separated options that
+control the details of the dump. Not all options are applicable to all
+dumps, those which are not meaningful will be ignored. The following
+options are available
+.RS 4
+.IP "\fBaddress\fR" 4
+.IX Item "address"
+Print the address of each node. Usually this is not meaningful as it
+changes according to the environment and source file. Its primary use
+is for tying up a dump file with a debug environment.
+.IP "\fBslim\fR" 4
+.IX Item "slim"
+Inhibit dumping of members of a scope or body of a function merely
+because that scope has been reached. Only dump such items when they
+are directly reachable by some other path. When dumping pretty-printed
+trees, this option inhibits dumping the bodies of control structures.
+.IP "\fBraw\fR" 4
+.IX Item "raw"
+Print a raw representation of the tree. By default, trees are
+pretty-printed into a C\-like representation.
+.IP "\fBdetails\fR" 4
+.IX Item "details"
+Enable more detailed dumps (not honored by every dump option).
+.IP "\fBstats\fR" 4
+.IX Item "stats"
+Enable dumping various statistics about the pass (not honored by every dump
+option).
+.IP "\fBblocks\fR" 4
+.IX Item "blocks"
+Enable showing basic block boundaries (disabled in raw dumps).
+.IP "\fBvops\fR" 4
+.IX Item "vops"
+Enable showing virtual operands for every statement.
+.IP "\fBlineno\fR" 4
+.IX Item "lineno"
+Enable showing line numbers for statements.
+.IP "\fBuid\fR" 4
+.IX Item "uid"
+Enable showing the unique \s-1ID\s0 (\f(CW\*(C`DECL_UID\*(C'\fR) for each variable.
+.IP "\fBverbose\fR" 4
+.IX Item "verbose"
+Enable showing the tree dump for each statement.
+.IP "\fBall\fR" 4
+.IX Item "all"
+Turn on all options, except \fBraw\fR, \fBslim\fR, \fBverbose\fR
+and \fBlineno\fR.
+.RE
+.RS 4
+.Sp
+The following tree dumps are possible:
+.IP "\fBoriginal\fR" 4
+.IX Item "original"
+Dump before any tree based optimization, to \fI\fIfile\fI.original\fR.
+.IP "\fBoptimized\fR" 4
+.IX Item "optimized"
+Dump after all tree based optimization, to \fI\fIfile\fI.optimized\fR.
+.IP "\fBgimple\fR" 4
+.IX Item "gimple"
+Dump each function before and after the gimplification pass to a file. The
+file name is made by appending \fI.gimple\fR to the source file name.
+.IP "\fBcfg\fR" 4
+.IX Item "cfg"
+Dump the control flow graph of each function to a file. The file name is
+made by appending \fI.cfg\fR to the source file name.
+.IP "\fBvcg\fR" 4
+.IX Item "vcg"
+Dump the control flow graph of each function to a file in \s-1VCG\s0 format. The
+file name is made by appending \fI.vcg\fR to the source file name. Note
+that if the file contains more than one function, the generated file cannot
+be used directly by \s-1VCG\s0. You will need to cut and paste each function's
+graph into its own separate file first.
+.IP "\fBch\fR" 4
+.IX Item "ch"
+Dump each function after copying loop headers. The file name is made by
+appending \fI.ch\fR to the source file name.
+.IP "\fBssa\fR" 4
+.IX Item "ssa"
+Dump \s-1SSA\s0 related information to a file. The file name is made by appending
+\&\fI.ssa\fR to the source file name.
+.IP "\fBalias\fR" 4
+.IX Item "alias"
+Dump aliasing information for each function. The file name is made by
+appending \fI.alias\fR to the source file name.
+.IP "\fBccp\fR" 4
+.IX Item "ccp"
+Dump each function after \s-1CCP\s0. The file name is made by appending
+\&\fI.ccp\fR to the source file name.
+.IP "\fBstoreccp\fR" 4
+.IX Item "storeccp"
+Dump each function after STORE-CCP. The file name is made by appending
+\&\fI.storeccp\fR to the source file name.
+.IP "\fBpre\fR" 4
+.IX Item "pre"
+Dump trees after partial redundancy elimination. The file name is made
+by appending \fI.pre\fR to the source file name.
+.IP "\fBfre\fR" 4
+.IX Item "fre"
+Dump trees after full redundancy elimination. The file name is made
+by appending \fI.fre\fR to the source file name.
+.IP "\fBcopyprop\fR" 4
+.IX Item "copyprop"
+Dump trees after copy propagation. The file name is made
+by appending \fI.copyprop\fR to the source file name.
+.IP "\fBstore_copyprop\fR" 4
+.IX Item "store_copyprop"
+Dump trees after store copy-propagation. The file name is made
+by appending \fI.store_copyprop\fR to the source file name.
+.IP "\fBdce\fR" 4
+.IX Item "dce"
+Dump each function after dead code elimination. The file name is made by
+appending \fI.dce\fR to the source file name.
+.IP "\fBmudflap\fR" 4
+.IX Item "mudflap"
+Dump each function after adding mudflap instrumentation. The file name is
+made by appending \fI.mudflap\fR to the source file name.
+.IP "\fBsra\fR" 4
+.IX Item "sra"
+Dump each function after performing scalar replacement of aggregates. The
+file name is made by appending \fI.sra\fR to the source file name.
+.IP "\fBsink\fR" 4
+.IX Item "sink"
+Dump each function after performing code sinking. The file name is made
+by appending \fI.sink\fR to the source file name.
+.IP "\fBdom\fR" 4
+.IX Item "dom"
+Dump each function after applying dominator tree optimizations. The file
+name is made by appending \fI.dom\fR to the source file name.
+.IP "\fBdse\fR" 4
+.IX Item "dse"
+Dump each function after applying dead store elimination. The file
+name is made by appending \fI.dse\fR to the source file name.
+.IP "\fBphiopt\fR" 4
+.IX Item "phiopt"
+Dump each function after optimizing \s-1PHI\s0 nodes into straightline code. The file
+name is made by appending \fI.phiopt\fR to the source file name.
+.IP "\fBforwprop\fR" 4
+.IX Item "forwprop"
+Dump each function after forward propagating single use variables. The file
+name is made by appending \fI.forwprop\fR to the source file name.
+.IP "\fBcopyrename\fR" 4
+.IX Item "copyrename"
+Dump each function after applying the copy rename optimization. The file
+name is made by appending \fI.copyrename\fR to the source file name.
+.IP "\fBnrv\fR" 4
+.IX Item "nrv"
+Dump each function after applying the named return value optimization on
+generic trees. The file name is made by appending \fI.nrv\fR to the source
+file name.
+.IP "\fBvect\fR" 4
+.IX Item "vect"
+Dump each function after applying vectorization of loops. The file name is
+made by appending \fI.vect\fR to the source file name.
+.IP "\fBvrp\fR" 4
+.IX Item "vrp"
+Dump each function after Value Range Propagation (\s-1VRP\s0). The file name
+is made by appending \fI.vrp\fR to the source file name.
+.IP "\fBall\fR" 4
+.IX Item "all"
+Enable all the available tree dumps with the flags provided in this option.
+.RE
+.RS 4
+.RE
+.IP "\fB\-ftree\-vectorizer\-verbose=\fR\fIn\fR" 4
+.IX Item "-ftree-vectorizer-verbose=n"
+This option controls the amount of debugging output the vectorizer prints.
+This information is written to standard error, unless
+\&\fB\-fdump\-tree\-all\fR or \fB\-fdump\-tree\-vect\fR is specified,
+in which case it is output to the usual dump listing file, \fI.vect\fR.
+For \fIn\fR=0 no diagnostic information is reported.
+If \fIn\fR=1 the vectorizer reports each loop that got vectorized,
+and the total number of loops that got vectorized.
+If \fIn\fR=2 the vectorizer also reports non-vectorized loops that passed
+the first analysis phase (vect_analyze_loop_form) \- i.e. countable,
+inner-most, single-bb, single\-entry/exit loops. This is the same verbosity
+level that \fB\-fdump\-tree\-vect\-stats\fR uses.
+Higher verbosity levels mean either more information dumped for each
+reported loop, or same amount of information reported for more loops:
+If \fIn\fR=3, alignment related information is added to the reports.
+If \fIn\fR=4, data-references related information (e.g. memory dependences,
+memory access-patterns) is added to the reports.
+If \fIn\fR=5, the vectorizer reports also non-vectorized inner-most loops
+that did not pass the first analysis phase (i.e., may not be countable, or
+may have complicated control-flow).
+If \fIn\fR=6, the vectorizer reports also non-vectorized nested loops.
+For \fIn\fR=7, all the information the vectorizer generates during its
+analysis and transformation is reported. This is the same verbosity level
+that \fB\-fdump\-tree\-vect\-details\fR uses.
+.IP "\fB\-frandom\-seed=\fR\fIstring\fR" 4
+.IX Item "-frandom-seed=string"
+This option provides a seed that \s-1GCC\s0 uses when it would otherwise use
+random numbers. It is used to generate certain symbol names
+that have to be different in every compiled file. It is also used to
+place unique stamps in coverage data files and the object files that
+produce them. You can use the \fB\-frandom\-seed\fR option to produce
+reproducibly identical object files.
+.Sp
+The \fIstring\fR should be different for every file you compile.
+.IP "\fB\-fsched\-verbose=\fR\fIn\fR" 4
+.IX Item "-fsched-verbose=n"
+On targets that use instruction scheduling, this option controls the
+amount of debugging output the scheduler prints. This information is
+written to standard error, unless \fB\-fdump\-rtl\-sched1\fR or
+\&\fB\-fdump\-rtl\-sched2\fR is specified, in which case it is output
+to the usual dump listing file, \fI.sched\fR or \fI.sched2\fR
+respectively. However for \fIn\fR greater than nine, the output is
+always printed to standard error.
+.Sp
+For \fIn\fR greater than zero, \fB\-fsched\-verbose\fR outputs the
+same information as \fB\-fdump\-rtl\-sched1\fR and \fB\-fdump\-rtl\-sched2\fR.
+For \fIn\fR greater than one, it also output basic block probabilities,
+detailed ready list information and unit/insn info. For \fIn\fR greater
+than two, it includes \s-1RTL\s0 at abort point, control-flow and regions info.
+And for \fIn\fR over four, \fB\-fsched\-verbose\fR also includes
+dependence info.
+.IP "\fB\-save\-temps\fR" 4
+.IX Item "-save-temps"
+Store the usual \*(L"temporary\*(R" intermediate files permanently; place them
+in the current directory and name them based on the source file. Thus,
+compiling \fIfoo.c\fR with \fB\-c \-save\-temps\fR would produce files
+\&\fIfoo.i\fR and \fIfoo.s\fR, as well as \fIfoo.o\fR. This creates a
+preprocessed \fIfoo.i\fR output file even though the compiler now
+normally uses an integrated preprocessor.
+.Sp
+When used in combination with the \fB\-x\fR command line option,
+\&\fB\-save\-temps\fR is sensible enough to avoid over writing an
+input source file with the same extension as an intermediate file.
+The corresponding intermediate file may be obtained by renaming the
+source file before using \fB\-save\-temps\fR.
+.IP "\fB\-time\fR" 4
+.IX Item "-time"
+Report the \s-1CPU\s0 time taken by each subprocess in the compilation
+sequence. For C source files, this is the compiler proper and assembler
+(plus the linker if linking is done). The output looks like this:
+.Sp
+.Vb 2
+\& # cc1 0.12 0.01
+\& # as 0.00 0.01
+.Ve
+.Sp
+The first number on each line is the \*(L"user time\*(R", that is time spent
+executing the program itself. The second number is \*(L"system time\*(R",
+time spent executing operating system routines on behalf of the program.
+Both numbers are in seconds.
+.IP "\fB\-fvar\-tracking\fR" 4
+.IX Item "-fvar-tracking"
+Run variable tracking pass. It computes where variables are stored at each
+position in code. Better debugging information is then generated
+(if the debugging information format supports this information).
+.Sp
+It is enabled by default when compiling with optimization (\fB\-Os\fR,
+\&\fB\-O\fR, \fB\-O2\fR, ...), debugging information (\fB\-g\fR) and
+the debug info format supports it.
+.IP "\fB\-print\-file\-name=\fR\fIlibrary\fR" 4
+.IX Item "-print-file-name=library"
+Print the full absolute name of the library file \fIlibrary\fR that
+would be used when linking\-\-\-and don't do anything else. With this
+option, \s-1GCC\s0 does not compile or link anything; it just prints the
+file name.
+.IP "\fB\-print\-multi\-directory\fR" 4
+.IX Item "-print-multi-directory"
+Print the directory name corresponding to the multilib selected by any
+other switches present in the command line. This directory is supposed
+to exist in \fB\s-1GCC_EXEC_PREFIX\s0\fR.
+.IP "\fB\-print\-multi\-lib\fR" 4
+.IX Item "-print-multi-lib"
+Print the mapping from multilib directory names to compiler switches
+that enable them. The directory name is separated from the switches by
+\&\fB;\fR, and each switch starts with an \fB@} instead of the
+\&\f(CB@samp\fB{\-\fR, without spaces between multiple switches. This is supposed to
+ease shell-processing.
+.IP "\fB\-print\-prog\-name=\fR\fIprogram\fR" 4
+.IX Item "-print-prog-name=program"
+Like \fB\-print\-file\-name\fR, but searches for a program such as \fBcpp\fR.
+.IP "\fB\-print\-libgcc\-file\-name\fR" 4
+.IX Item "-print-libgcc-file-name"
+Same as \fB\-print\-file\-name=libgcc.a\fR.
+.Sp
+This is useful when you use \fB\-nostdlib\fR or \fB\-nodefaultlibs\fR
+but you do want to link with \fIlibgcc.a\fR. You can do
+.Sp
+.Vb 1
+\& gcc \-nostdlib <files>... \`gcc \-print\-libgcc\-file\-name\`
+.Ve
+.IP "\fB\-print\-search\-dirs\fR" 4
+.IX Item "-print-search-dirs"
+Print the name of the configured installation directory and a list of
+program and library directories \fBgcc\fR will search\-\-\-and don't do anything else.
+.Sp
+This is useful when \fBgcc\fR prints the error message
+\&\fBinstallation problem, cannot exec cpp0: No such file or directory\fR.
+To resolve this you either need to put \fIcpp0\fR and the other compiler
+components where \fBgcc\fR expects to find them, or you can set the environment
+variable \fB\s-1GCC_EXEC_PREFIX\s0\fR to the directory where you installed them.
+Don't forget the trailing \fB/\fR.
+.IP "\fB\-print\-sysroot\fR" 4
+.IX Item "-print-sysroot"
+Print the target sysroot directory that will be used during
+compilation. This is the target sysroot specified either at configure
+time or using the \fB\-\-sysroot\fR option, possibly with an extra
+suffix that depends on compilation options. If no target sysroot is
+specified, the option prints nothing.
+.IP "\fB\-print\-sysroot\-headers\-suffix\fR" 4
+.IX Item "-print-sysroot-headers-suffix"
+Print the suffix added to the target sysroot when searching for
+headers, or give an error if the compiler is not configured with such
+a suffix\-\-\-and don't do anything else.
+.IP "\fB\-dumpmachine\fR" 4
+.IX Item "-dumpmachine"
+Print the compiler's target machine (for example,
+\&\fBi686\-pc\-linux\-gnu\fR)\-\-\-and don't do anything else.
+.IP "\fB\-dumpversion\fR" 4
+.IX Item "-dumpversion"
+Print the compiler version (for example, \fB3.0\fR)\-\-\-and don't do
+anything else.
+.IP "\fB\-dumpspecs\fR" 4
+.IX Item "-dumpspecs"
+Print the compiler's built-in specs\-\-\-and don't do anything else. (This
+is used when \s-1GCC\s0 itself is being built.)
+.IP "\fB\-feliminate\-unused\-debug\-types\fR" 4
+.IX Item "-feliminate-unused-debug-types"
+Normally, when producing \s-1DWARF2\s0 output, \s-1GCC\s0 will emit debugging
+information for all types declared in a compilation
+unit, regardless of whether or not they are actually used
+in that compilation unit. Sometimes this is useful, such as
+if, in the debugger, you want to cast a value to a type that is
+not actually used in your program (but is declared). More often,
+however, this results in a significant amount of wasted space.
+With this option, \s-1GCC\s0 will avoid producing debug symbol output
+for types that are nowhere used in the source file being compiled.
+.Sh "Options That Control Optimization"
+.IX Subsection "Options That Control Optimization"
+These options control various sorts of optimizations.
+.PP
+Without any optimization option, the compiler's goal is to reduce the
+cost of compilation and to make debugging produce the expected
+results. Statements are independent: if you stop the program with a
+breakpoint between statements, you can then assign a new value to any
+variable or change the program counter to any other statement in the
+function and get exactly the results you would expect from the source
+code.
+.PP
+Turning on optimization flags makes the compiler attempt to improve
+the performance and/or code size at the expense of compilation time
+and possibly the ability to debug the program.
+.PP
+The compiler performs optimization based on the knowledge it has of the
+program. Compiling multiple files at once to a single output file mode allows
+the compiler to use information gained from all of the files when compiling
+each of them.
+.PP
+Not all optimizations are controlled directly by a flag. Only
+optimizations that have a flag are listed.
+.IP "\fB\-O\fR" 4
+.IX Item "-O"
+.PD 0
+.IP "\fB\-O1\fR" 4
+.IX Item "-O1"
+.PD
+Optimize. Optimizing compilation takes somewhat more time, and a lot
+more memory for a large function.
+.Sp
+With \fB\-O\fR, the compiler tries to reduce code size and execution
+time, without performing any optimizations that take a great deal of
+compilation time.
+.Sp
+\&\fB\-O\fR turns on the following optimization flags:
+.Sp
+\&\fB\-fauto\-inc\-dec
+\&\-fcprop\-registers
+\&\-fdce
+\&\-fdefer\-pop
+\&\-fdelayed\-branch
+\&\-fdse
+\&\-fguess\-branch\-probability
+\&\-fif\-conversion2
+\&\-fif\-conversion
+\&\-finline\-small\-functions
+\&\-fipa\-pure\-const
+\&\-fipa\-reference
+\&\-fmerge\-constants
+\&\-fsplit\-wide\-types
+\&\-ftree\-builtin\-call\-dce
+\&\-ftree\-ccp
+\&\-ftree\-ch
+\&\-ftree\-copyrename
+\&\-ftree\-dce
+\&\-ftree\-dominator\-opts
+\&\-ftree\-dse
+\&\-ftree\-fre
+\&\-ftree\-sra
+\&\-ftree\-ter
+\&\-funit\-at\-a\-time\fR
+.Sp
+\&\fB\-O\fR also turns on \fB\-fomit\-frame\-pointer\fR on machines
+where doing so does not interfere with debugging.
+.IP "\fB\-O2\fR" 4
+.IX Item "-O2"
+Optimize even more. \s-1GCC\s0 performs nearly all supported optimizations
+that do not involve a space-speed tradeoff.
+As compared to \fB\-O\fR, this option increases both compilation time
+and the performance of the generated code.
+.Sp
+\&\fB\-O2\fR turns on all optimization flags specified by \fB\-O\fR. It
+also turns on the following optimization flags:
+\&\fB\-fthread\-jumps
+\&\-falign\-functions \-falign\-jumps
+\&\-falign\-loops \-falign\-labels
+\&\-fcaller\-saves
+\&\-fcrossjumping
+\&\-fcse\-follow\-jumps \-fcse\-skip\-blocks
+\&\-fdelete\-null\-pointer\-checks
+\&\-fexpensive\-optimizations
+\&\-fgcse \-fgcse\-lm
+\&\-findirect\-inlining
+\&\-foptimize\-sibling\-calls
+\&\-fpeephole2
+\&\-fregmove
+\&\-freorder\-blocks \-freorder\-functions
+\&\-frerun\-cse\-after\-loop
+\&\-fsched\-interblock \-fsched\-spec
+\&\-fschedule\-insns \-fschedule\-insns2
+\&\-fstrict\-aliasing \-fstrict\-overflow
+\&\-ftree\-switch\-conversion
+\&\-ftree\-pre
+\&\-ftree\-vrp\fR
+.Sp
+Please note the warning under \fB\-fgcse\fR about
+invoking \fB\-O2\fR on programs that use computed gotos.
+.IP "\fB\-O3\fR" 4
+.IX Item "-O3"
+Optimize yet more. \fB\-O3\fR turns on all optimizations specified
+by \fB\-O2\fR and also turns on the \fB\-finline\-functions\fR,
+\&\fB\-funswitch\-loops\fR, \fB\-fpredictive\-commoning\fR,
+\&\fB\-fgcse\-after\-reload\fR and \fB\-ftree\-vectorize\fR options.
+.IP "\fB\-O0\fR" 4
+.IX Item "-O0"
+Reduce compilation time and make debugging produce the expected
+results. This is the default.
+.IP "\fB\-Os\fR" 4
+.IX Item "-Os"
+Optimize for size. \fB\-Os\fR enables all \fB\-O2\fR optimizations that
+do not typically increase code size. It also performs further
+optimizations designed to reduce code size.
+.Sp
+\&\fB\-Os\fR disables the following optimization flags:
+\&\fB\-falign\-functions \-falign\-jumps \-falign\-loops
+\&\-falign\-labels \-freorder\-blocks \-freorder\-blocks\-and\-partition
+\&\-fprefetch\-loop\-arrays \-ftree\-vect\-loop\-version\fR
+.Sp
+If you use multiple \fB\-O\fR options, with or without level numbers,
+the last such option is the one that is effective.
+.PP
+Options of the form \fB\-f\fR\fIflag\fR specify machine-independent
+flags. Most flags have both positive and negative forms; the negative
+form of \fB\-ffoo\fR would be \fB\-fno\-foo\fR. In the table
+below, only one of the forms is listed\-\-\-the one you typically will
+use. You can figure out the other form by either removing \fBno\-\fR
+or adding it.
+.PP
+The following options control specific optimizations. They are either
+activated by \fB\-O\fR options or are related to ones that are. You
+can use the following flags in the rare cases when \*(L"fine-tuning\*(R" of
+optimizations to be performed is desired.
+.IP "\fB\-fno\-default\-inline\fR" 4
+.IX Item "-fno-default-inline"
+Do not make member functions inline by default merely because they are
+defined inside the class scope (\*(C+ only). Otherwise, when you specify
+\&\fB\-O\fR, member functions defined inside class scope are compiled
+inline by default; i.e., you don't need to add \fBinline\fR in front of
+the member function name.
+.IP "\fB\-fno\-defer\-pop\fR" 4
+.IX Item "-fno-defer-pop"
+Always pop the arguments to each function call as soon as that function
+returns. For machines which must pop arguments after a function call,
+the compiler normally lets arguments accumulate on the stack for several
+function calls and pops them all at once.
+.Sp
+Disabled at levels \fB\-O\fR, \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fforward\-propagate\fR" 4
+.IX Item "-fforward-propagate"
+Perform a forward propagation pass on \s-1RTL\s0. The pass tries to combine two
+instructions and checks if the result can be simplified. If loop unrolling
+is active, two passes are performed and the second is scheduled after
+loop unrolling.
+.Sp
+This option is enabled by default at optimization levels \fB\-O2\fR,
+\&\fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fomit\-frame\-pointer\fR" 4
+.IX Item "-fomit-frame-pointer"
+Don't keep the frame pointer in a register for functions that
+don't need one. This avoids the instructions to save, set up and
+restore frame pointers; it also makes an extra register available
+in many functions. \fBIt also makes debugging impossible on
+some machines.\fR
+.Sp
+On some machines, such as the \s-1VAX\s0, this flag has no effect, because
+the standard calling sequence automatically handles the frame pointer
+and nothing is saved by pretending it doesn't exist. The
+machine-description macro \f(CW\*(C`FRAME_POINTER_REQUIRED\*(C'\fR controls
+whether a target machine supports this flag.
+.Sp
+Enabled at levels \fB\-O\fR, \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-foptimize\-sibling\-calls\fR" 4
+.IX Item "-foptimize-sibling-calls"
+Optimize sibling and tail recursive calls.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fno\-inline\fR" 4
+.IX Item "-fno-inline"
+Don't pay attention to the \f(CW\*(C`inline\*(C'\fR keyword. Normally this option
+is used to keep the compiler from expanding any functions inline.
+Note that if you are not optimizing, no functions can be expanded inline.
+.IP "\fB\-finline\-small\-functions\fR" 4
+.IX Item "-finline-small-functions"
+Integrate functions into their callers when their body is smaller than expected
+function call code (so overall size of program gets smaller). The compiler
+heuristically decides which functions are simple enough to be worth integrating
+in this way.
+.Sp
+Enabled at level \fB\-O2\fR.
+.IP "\fB\-findirect\-inlining\fR" 4
+.IX Item "-findirect-inlining"
+Inline also indirect calls that are discovered to be known at compile
+time thanks to previous inlining. This option has any effect only
+when inlining itself is turned on by the \fB\-finline\-functions\fR
+or \fB\-finline\-small\-functions\fR options.
+.Sp
+Enabled at level \fB\-O2\fR.
+.IP "\fB\-finline\-functions\fR" 4
+.IX Item "-finline-functions"
+Integrate all simple functions into their callers. The compiler
+heuristically decides which functions are simple enough to be worth
+integrating in this way.
+.Sp
+If all calls to a given function are integrated, and the function is
+declared \f(CW\*(C`static\*(C'\fR, then the function is normally not output as
+assembler code in its own right.
+.Sp
+Enabled at level \fB\-O3\fR.
+.IP "\fB\-finline\-functions\-called\-once\fR" 4
+.IX Item "-finline-functions-called-once"
+Consider all \f(CW\*(C`static\*(C'\fR functions called once for inlining into their
+caller even if they are not marked \f(CW\*(C`inline\*(C'\fR. If a call to a given
+function is integrated, then the function is not output as assembler code
+in its own right.
+.Sp
+Enabled at levels \fB\-O1\fR, \fB\-O2\fR, \fB\-O3\fR and \fB\-Os\fR.
+.IP "\fB\-fearly\-inlining\fR" 4
+.IX Item "-fearly-inlining"
+Inline functions marked by \f(CW\*(C`always_inline\*(C'\fR and functions whose body seems
+smaller than the function call overhead early before doing
+\&\fB\-fprofile\-generate\fR instrumentation and real inlining pass. Doing so
+makes profiling significantly cheaper and usually inlining faster on programs
+having large chains of nested wrapper functions.
+.Sp
+Enabled by default.
+.IP "\fB\-finline\-limit=\fR\fIn\fR" 4
+.IX Item "-finline-limit=n"
+By default, \s-1GCC\s0 limits the size of functions that can be inlined. This flag
+allows coarse control of this limit. \fIn\fR is the size of functions that
+can be inlined in number of pseudo instructions.
+.Sp
+Inlining is actually controlled by a number of parameters, which may be
+specified individually by using \fB\-\-param\fR \fIname\fR\fB=\fR\fIvalue\fR.
+The \fB\-finline\-limit=\fR\fIn\fR option sets some of these parameters
+as follows:
+.RS 4
+.IP "\fBmax-inline-insns-single\fR" 4
+.IX Item "max-inline-insns-single"
+is set to \fIn\fR/2.
+.IP "\fBmax-inline-insns-auto\fR" 4
+.IX Item "max-inline-insns-auto"
+is set to \fIn\fR/2.
+.RE
+.RS 4
+.Sp
+See below for a documentation of the individual
+parameters controlling inlining and for the defaults of these parameters.
+.Sp
+\&\fINote:\fR there may be no value to \fB\-finline\-limit\fR that results
+in default behavior.
+.Sp
+\&\fINote:\fR pseudo instruction represents, in this particular context, an
+abstract measurement of function's size. In no way does it represent a count
+of assembly instructions and as such its exact meaning might change from one
+release to an another.
+.RE
+.IP "\fB\-fkeep\-inline\-functions\fR" 4
+.IX Item "-fkeep-inline-functions"
+In C, emit \f(CW\*(C`static\*(C'\fR functions that are declared \f(CW\*(C`inline\*(C'\fR
+into the object file, even if the function has been inlined into all
+of its callers. This switch does not affect functions using the
+\&\f(CW\*(C`extern inline\*(C'\fR extension in \s-1GNU\s0 C89. In \*(C+, emit any and all
+inline functions into the object file.
+.IP "\fB\-fkeep\-static\-consts\fR" 4
+.IX Item "-fkeep-static-consts"
+Emit variables declared \f(CW\*(C`static const\*(C'\fR when optimization isn't turned
+on, even if the variables aren't referenced.
+.Sp
+\&\s-1GCC\s0 enables this option by default. If you want to force the compiler to
+check if the variable was referenced, regardless of whether or not
+optimization is turned on, use the \fB\-fno\-keep\-static\-consts\fR option.
+.IP "\fB\-fmerge\-constants\fR" 4
+.IX Item "-fmerge-constants"
+Attempt to merge identical constants (string constants and floating point
+constants) across compilation units.
+.Sp
+This option is the default for optimized compilation if the assembler and
+linker support it. Use \fB\-fno\-merge\-constants\fR to inhibit this
+behavior.
+.Sp
+Enabled at levels \fB\-O\fR, \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fmerge\-all\-constants\fR" 4
+.IX Item "-fmerge-all-constants"
+Attempt to merge identical constants and identical variables.
+.Sp
+This option implies \fB\-fmerge\-constants\fR. In addition to
+\&\fB\-fmerge\-constants\fR this considers e.g. even constant initialized
+arrays or initialized constant variables with integral or floating point
+types. Languages like C or \*(C+ require each variable, including multiple
+instances of the same variable in recursive calls, to have distinct locations,
+so using this option will result in non-conforming
+behavior.
+.IP "\fB\-fmodulo\-sched\fR" 4
+.IX Item "-fmodulo-sched"
+Perform swing modulo scheduling immediately before the first scheduling
+pass. This pass looks at innermost loops and reorders their
+instructions by overlapping different iterations.
+.IP "\fB\-fmodulo\-sched\-allow\-regmoves\fR" 4
+.IX Item "-fmodulo-sched-allow-regmoves"
+Perform more aggressive \s-1SMS\s0 based modulo scheduling with register moves
+allowed. By setting this flag certain anti-dependences edges will be
+deleted which will trigger the generation of reg-moves based on the
+life-range analysis. This option is effective only with
+\&\fB\-fmodulo\-sched\fR enabled.
+.IP "\fB\-fno\-branch\-count\-reg\fR" 4
+.IX Item "-fno-branch-count-reg"
+Do not use \*(L"decrement and branch\*(R" instructions on a count register,
+but instead generate a sequence of instructions that decrement a
+register, compare it against zero, then branch based upon the result.
+This option is only meaningful on architectures that support such
+instructions, which include x86, PowerPC, \s-1IA\-64\s0 and S/390.
+.Sp
+The default is \fB\-fbranch\-count\-reg\fR.
+.IP "\fB\-fno\-function\-cse\fR" 4
+.IX Item "-fno-function-cse"
+Do not put function addresses in registers; make each instruction that
+calls a constant function contain the function's address explicitly.
+.Sp
+This option results in less efficient code, but some strange hacks
+that alter the assembler output may be confused by the optimizations
+performed when this option is not used.
+.Sp
+The default is \fB\-ffunction\-cse\fR
+.IP "\fB\-fno\-zero\-initialized\-in\-bss\fR" 4
+.IX Item "-fno-zero-initialized-in-bss"
+If the target supports a \s-1BSS\s0 section, \s-1GCC\s0 by default puts variables that
+are initialized to zero into \s-1BSS\s0. This can save space in the resulting
+code.
+.Sp
+This option turns off this behavior because some programs explicitly
+rely on variables going to the data section. E.g., so that the
+resulting executable can find the beginning of that section and/or make
+assumptions based on that.
+.Sp
+The default is \fB\-fzero\-initialized\-in\-bss\fR.
+.IP "\fB\-fmudflap \-fmudflapth \-fmudflapir\fR" 4
+.IX Item "-fmudflap -fmudflapth -fmudflapir"
+For front-ends that support it (C and \*(C+), instrument all risky
+pointer/array dereferencing operations, some standard library
+string/heap functions, and some other associated constructs with
+range/validity tests. Modules so instrumented should be immune to
+buffer overflows, invalid heap use, and some other classes of C/\*(C+
+programming errors. The instrumentation relies on a separate runtime
+library (\fIlibmudflap\fR), which will be linked into a program if
+\&\fB\-fmudflap\fR is given at link time. Run-time behavior of the
+instrumented program is controlled by the \fB\s-1MUDFLAP_OPTIONS\s0\fR
+environment variable. See \f(CW\*(C`env MUDFLAP_OPTIONS=\-help a.out\*(C'\fR
+for its options.
+.Sp
+Use \fB\-fmudflapth\fR instead of \fB\-fmudflap\fR to compile and to
+link if your program is multi-threaded. Use \fB\-fmudflapir\fR, in
+addition to \fB\-fmudflap\fR or \fB\-fmudflapth\fR, if
+instrumentation should ignore pointer reads. This produces less
+instrumentation (and therefore faster execution) and still provides
+some protection against outright memory corrupting writes, but allows
+erroneously read data to propagate within a program.
+.IP "\fB\-fthread\-jumps\fR" 4
+.IX Item "-fthread-jumps"
+Perform optimizations where we check to see if a jump branches to a
+location where another comparison subsumed by the first is found. If
+so, the first branch is redirected to either the destination of the
+second branch or a point immediately following it, depending on whether
+the condition is known to be true or false.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fsplit\-wide\-types\fR" 4
+.IX Item "-fsplit-wide-types"
+When using a type that occupies multiple registers, such as \f(CW\*(C`long
+long\*(C'\fR on a 32\-bit system, split the registers apart and allocate them
+independently. This normally generates better code for those types,
+but may make debugging more difficult.
+.Sp
+Enabled at levels \fB\-O\fR, \fB\-O2\fR, \fB\-O3\fR,
+\&\fB\-Os\fR.
+.IP "\fB\-fcse\-follow\-jumps\fR" 4
+.IX Item "-fcse-follow-jumps"
+In common subexpression elimination (\s-1CSE\s0), scan through jump instructions
+when the target of the jump is not reached by any other path. For
+example, when \s-1CSE\s0 encounters an \f(CW\*(C`if\*(C'\fR statement with an
+\&\f(CW\*(C`else\*(C'\fR clause, \s-1CSE\s0 will follow the jump when the condition
+tested is false.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fcse\-skip\-blocks\fR" 4
+.IX Item "-fcse-skip-blocks"
+This is similar to \fB\-fcse\-follow\-jumps\fR, but causes \s-1CSE\s0 to
+follow jumps which conditionally skip over blocks. When \s-1CSE\s0
+encounters a simple \f(CW\*(C`if\*(C'\fR statement with no else clause,
+\&\fB\-fcse\-skip\-blocks\fR causes \s-1CSE\s0 to follow the jump around the
+body of the \f(CW\*(C`if\*(C'\fR.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-frerun\-cse\-after\-loop\fR" 4
+.IX Item "-frerun-cse-after-loop"
+Re-run common subexpression elimination after loop optimizations has been
+performed.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fgcse\fR" 4
+.IX Item "-fgcse"
+Perform a global common subexpression elimination pass.
+This pass also performs global constant and copy propagation.
+.Sp
+\&\fINote:\fR When compiling a program using computed gotos, a \s-1GCC\s0
+extension, you may get better runtime performance if you disable
+the global common subexpression elimination pass by adding
+\&\fB\-fno\-gcse\fR to the command line.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fgcse\-lm\fR" 4
+.IX Item "-fgcse-lm"
+When \fB\-fgcse\-lm\fR is enabled, global common subexpression elimination will
+attempt to move loads which are only killed by stores into themselves. This
+allows a loop containing a load/store sequence to be changed to a load outside
+the loop, and a copy/store within the loop.
+.Sp
+Enabled by default when gcse is enabled.
+.IP "\fB\-fgcse\-sm\fR" 4
+.IX Item "-fgcse-sm"
+When \fB\-fgcse\-sm\fR is enabled, a store motion pass is run after
+global common subexpression elimination. This pass will attempt to move
+stores out of loops. When used in conjunction with \fB\-fgcse\-lm\fR,
+loops containing a load/store sequence can be changed to a load before
+the loop and a store after the loop.
+.Sp
+Not enabled at any optimization level.
+.IP "\fB\-fgcse\-las\fR" 4
+.IX Item "-fgcse-las"
+When \fB\-fgcse\-las\fR is enabled, the global common subexpression
+elimination pass eliminates redundant loads that come after stores to the
+same memory location (both partial and full redundancies).
+.Sp
+Not enabled at any optimization level.
+.IP "\fB\-fgcse\-after\-reload\fR" 4
+.IX Item "-fgcse-after-reload"
+When \fB\-fgcse\-after\-reload\fR is enabled, a redundant load elimination
+pass is performed after reload. The purpose of this pass is to cleanup
+redundant spilling.
+.IP "\fB\-funsafe\-loop\-optimizations\fR" 4
+.IX Item "-funsafe-loop-optimizations"
+If given, the loop optimizer will assume that loop indices do not
+overflow, and that the loops with nontrivial exit condition are not
+infinite. This enables a wider range of loop optimizations even if
+the loop optimizer itself cannot prove that these assumptions are valid.
+Using \fB\-Wunsafe\-loop\-optimizations\fR, the compiler will warn you
+if it finds this kind of loop.
+.IP "\fB\-fcrossjumping\fR" 4
+.IX Item "-fcrossjumping"
+Perform cross-jumping transformation. This transformation unifies equivalent code and save code size. The
+resulting code may or may not perform better than without cross-jumping.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fauto\-inc\-dec\fR" 4
+.IX Item "-fauto-inc-dec"
+Combine increments or decrements of addresses with memory accesses.
+This pass is always skipped on architectures that do not have
+instructions to support this. Enabled by default at \fB\-O\fR and
+higher on architectures that support this.
+.IP "\fB\-fdce\fR" 4
+.IX Item "-fdce"
+Perform dead code elimination (\s-1DCE\s0) on \s-1RTL\s0.
+Enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-fdse\fR" 4
+.IX Item "-fdse"
+Perform dead store elimination (\s-1DSE\s0) on \s-1RTL\s0.
+Enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-fif\-conversion\fR" 4
+.IX Item "-fif-conversion"
+Attempt to transform conditional jumps into branch-less equivalents. This
+include use of conditional moves, min, max, set flags and abs instructions, and
+some tricks doable by standard arithmetics. The use of conditional execution
+on chips where it is available is controlled by \f(CW\*(C`if\-conversion2\*(C'\fR.
+.Sp
+Enabled at levels \fB\-O\fR, \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fif\-conversion2\fR" 4
+.IX Item "-fif-conversion2"
+Use conditional execution (where available) to transform conditional jumps into
+branch-less equivalents.
+.Sp
+Enabled at levels \fB\-O\fR, \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fdelete\-null\-pointer\-checks\fR" 4
+.IX Item "-fdelete-null-pointer-checks"
+Use global dataflow analysis to identify and eliminate useless checks
+for null pointers. The compiler assumes that dereferencing a null
+pointer would have halted the program. If a pointer is checked after
+it has already been dereferenced, it cannot be null.
+.Sp
+In some environments, this assumption is not true, and programs can
+safely dereference null pointers. Use
+\&\fB\-fno\-delete\-null\-pointer\-checks\fR to disable this optimization
+for programs which depend on that behavior.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fexpensive\-optimizations\fR" 4
+.IX Item "-fexpensive-optimizations"
+Perform a number of minor optimizations that are relatively expensive.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-foptimize\-register\-move\fR" 4
+.IX Item "-foptimize-register-move"
+.PD 0
+.IP "\fB\-fregmove\fR" 4
+.IX Item "-fregmove"
+.PD
+Attempt to reassign register numbers in move instructions and as
+operands of other simple instructions in order to maximize the amount of
+register tying. This is especially helpful on machines with two-operand
+instructions.
+.Sp
+Note \fB\-fregmove\fR and \fB\-foptimize\-register\-move\fR are the same
+optimization.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fira\-algorithm=\fR\fIalgorithm\fR" 4
+.IX Item "-fira-algorithm=algorithm"
+Use specified coloring algorithm for the integrated register
+allocator. The \fIalgorithm\fR argument should be \f(CW\*(C`priority\*(C'\fR or
+\&\f(CW\*(C`CB\*(C'\fR. The first algorithm specifies Chow's priority coloring,
+the second one specifies Chaitin-Briggs coloring. The second
+algorithm can be unimplemented for some architectures. If it is
+implemented, it is the default because Chaitin-Briggs coloring as a
+rule generates a better code.
+.IP "\fB\-fira\-region=\fR\fIregion\fR" 4
+.IX Item "-fira-region=region"
+Use specified regions for the integrated register allocator. The
+\&\fIregion\fR argument should be one of \f(CW\*(C`all\*(C'\fR, \f(CW\*(C`mixed\*(C'\fR, or
+\&\f(CW\*(C`one\*(C'\fR. The first value means using all loops as register
+allocation regions, the second value which is the default means using
+all loops except for loops with small register pressure as the
+regions, and third one means using all function as a single region.
+The first value can give best result for machines with small size and
+irregular register set, the third one results in faster and generates
+decent code and the smallest size code, and the default value usually
+give the best results in most cases and for most architectures.
+.IP "\fB\-fira\-coalesce\fR" 4
+.IX Item "-fira-coalesce"
+Do optimistic register coalescing. This option might be profitable for
+architectures with big regular register files.
+.IP "\fB\-fno\-ira\-share\-save\-slots\fR" 4
+.IX Item "-fno-ira-share-save-slots"
+Switch off sharing stack slots used for saving call used hard
+registers living through a call. Each hard register will get a
+separate stack slot and as a result function stack frame will be
+bigger.
+.IP "\fB\-fno\-ira\-share\-spill\-slots\fR" 4
+.IX Item "-fno-ira-share-spill-slots"
+Switch off sharing stack slots allocated for pseudo-registers. Each
+pseudo-register which did not get a hard register will get a separate
+stack slot and as a result function stack frame will be bigger.
+.IP "\fB\-fira\-verbose=\fR\fIn\fR" 4
+.IX Item "-fira-verbose=n"
+Set up how verbose dump file for the integrated register allocator
+will be. Default value is 5. If the value is greater or equal to 10,
+the dump file will be stderr as if the value were \fIn\fR minus 10.
+.IP "\fB\-fdelayed\-branch\fR" 4
+.IX Item "-fdelayed-branch"
+If supported for the target machine, attempt to reorder instructions
+to exploit instruction slots available after delayed branch
+instructions.
+.Sp
+Enabled at levels \fB\-O\fR, \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fschedule\-insns\fR" 4
+.IX Item "-fschedule-insns"
+If supported for the target machine, attempt to reorder instructions to
+eliminate execution stalls due to required data being unavailable. This
+helps machines that have slow floating point or memory load instructions
+by allowing other instructions to be issued until the result of the load
+or floating point instruction is required.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fschedule\-insns2\fR" 4
+.IX Item "-fschedule-insns2"
+Similar to \fB\-fschedule\-insns\fR, but requests an additional pass of
+instruction scheduling after register allocation has been done. This is
+especially useful on machines with a relatively small number of
+registers and where memory load instructions take more than one cycle.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fno\-sched\-interblock\fR" 4
+.IX Item "-fno-sched-interblock"
+Don't schedule instructions across basic blocks. This is normally
+enabled by default when scheduling before register allocation, i.e.
+with \fB\-fschedule\-insns\fR or at \fB\-O2\fR or higher.
+.IP "\fB\-fno\-sched\-spec\fR" 4
+.IX Item "-fno-sched-spec"
+Don't allow speculative motion of non-load instructions. This is normally
+enabled by default when scheduling before register allocation, i.e.
+with \fB\-fschedule\-insns\fR or at \fB\-O2\fR or higher.
+.IP "\fB\-fsched\-spec\-load\fR" 4
+.IX Item "-fsched-spec-load"
+Allow speculative motion of some load instructions. This only makes
+sense when scheduling before register allocation, i.e. with
+\&\fB\-fschedule\-insns\fR or at \fB\-O2\fR or higher.
+.IP "\fB\-fsched\-spec\-load\-dangerous\fR" 4
+.IX Item "-fsched-spec-load-dangerous"
+Allow speculative motion of more load instructions. This only makes
+sense when scheduling before register allocation, i.e. with
+\&\fB\-fschedule\-insns\fR or at \fB\-O2\fR or higher.
+.IP "\fB\-fsched\-stalled\-insns\fR" 4
+.IX Item "-fsched-stalled-insns"
+.PD 0
+.IP "\fB\-fsched\-stalled\-insns=\fR\fIn\fR" 4
+.IX Item "-fsched-stalled-insns=n"
+.PD
+Define how many insns (if any) can be moved prematurely from the queue
+of stalled insns into the ready list, during the second scheduling pass.
+\&\fB\-fno\-sched\-stalled\-insns\fR means that no insns will be moved
+prematurely, \fB\-fsched\-stalled\-insns=0\fR means there is no limit
+on how many queued insns can be moved prematurely.
+\&\fB\-fsched\-stalled\-insns\fR without a value is equivalent to
+\&\fB\-fsched\-stalled\-insns=1\fR.
+.IP "\fB\-fsched\-stalled\-insns\-dep\fR" 4
+.IX Item "-fsched-stalled-insns-dep"
+.PD 0
+.IP "\fB\-fsched\-stalled\-insns\-dep=\fR\fIn\fR" 4
+.IX Item "-fsched-stalled-insns-dep=n"
+.PD
+Define how many insn groups (cycles) will be examined for a dependency
+on a stalled insn that is candidate for premature removal from the queue
+of stalled insns. This has an effect only during the second scheduling pass,
+and only if \fB\-fsched\-stalled\-insns\fR is used.
+\&\fB\-fno\-sched\-stalled\-insns\-dep\fR is equivalent to
+\&\fB\-fsched\-stalled\-insns\-dep=0\fR.
+\&\fB\-fsched\-stalled\-insns\-dep\fR without a value is equivalent to
+\&\fB\-fsched\-stalled\-insns\-dep=1\fR.
+.IP "\fB\-fsched2\-use\-superblocks\fR" 4
+.IX Item "-fsched2-use-superblocks"
+When scheduling after register allocation, do use superblock scheduling
+algorithm. Superblock scheduling allows motion across basic block boundaries
+resulting on faster schedules. This option is experimental, as not all machine
+descriptions used by \s-1GCC\s0 model the \s-1CPU\s0 closely enough to avoid unreliable
+results from the algorithm.
+.Sp
+This only makes sense when scheduling after register allocation, i.e. with
+\&\fB\-fschedule\-insns2\fR or at \fB\-O2\fR or higher.
+.IP "\fB\-fsched2\-use\-traces\fR" 4
+.IX Item "-fsched2-use-traces"
+Use \fB\-fsched2\-use\-superblocks\fR algorithm when scheduling after register
+allocation and additionally perform code duplication in order to increase the
+size of superblocks using tracer pass. See \fB\-ftracer\fR for details on
+trace formation.
+.Sp
+This mode should produce faster but significantly longer programs. Also
+without \fB\-fbranch\-probabilities\fR the traces constructed may not
+match the reality and hurt the performance. This only makes
+sense when scheduling after register allocation, i.e. with
+\&\fB\-fschedule\-insns2\fR or at \fB\-O2\fR or higher.
+.IP "\fB\-fsee\fR" 4
+.IX Item "-fsee"
+Eliminate redundant sign extension instructions and move the non-redundant
+ones to optimal placement using lazy code motion (\s-1LCM\s0).
+.IP "\fB\-freschedule\-modulo\-scheduled\-loops\fR" 4
+.IX Item "-freschedule-modulo-scheduled-loops"
+The modulo scheduling comes before the traditional scheduling, if a loop
+was modulo scheduled we may want to prevent the later scheduling passes
+from changing its schedule, we use this option to control that.
+.IP "\fB\-fselective\-scheduling\fR" 4
+.IX Item "-fselective-scheduling"
+Schedule instructions using selective scheduling algorithm. Selective
+scheduling runs instead of the first scheduler pass.
+.IP "\fB\-fselective\-scheduling2\fR" 4
+.IX Item "-fselective-scheduling2"
+Schedule instructions using selective scheduling algorithm. Selective
+scheduling runs instead of the second scheduler pass.
+.IP "\fB\-fsel\-sched\-pipelining\fR" 4
+.IX Item "-fsel-sched-pipelining"
+Enable software pipelining of innermost loops during selective scheduling.
+This option has no effect until one of \fB\-fselective\-scheduling\fR or
+\&\fB\-fselective\-scheduling2\fR is turned on.
+.IP "\fB\-fsel\-sched\-pipelining\-outer\-loops\fR" 4
+.IX Item "-fsel-sched-pipelining-outer-loops"
+When pipelining loops during selective scheduling, also pipeline outer loops.
+This option has no effect until \fB\-fsel\-sched\-pipelining\fR is turned on.
+.IP "\fB\-fcaller\-saves\fR" 4
+.IX Item "-fcaller-saves"
+Enable values to be allocated in registers that will be clobbered by
+function calls, by emitting extra instructions to save and restore the
+registers around such calls. Such allocation is done only when it
+seems to result in better code than would otherwise be produced.
+.Sp
+This option is always enabled by default on certain machines, usually
+those which have no call-preserved registers to use instead.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fconserve\-stack\fR" 4
+.IX Item "-fconserve-stack"
+Attempt to minimize stack usage. The compiler will attempt to use less
+stack space, even if that makes the program slower. This option
+implies setting the \fBlarge-stack-frame\fR parameter to 100
+and the \fBlarge-stack-frame-growth\fR parameter to 400.
+.IP "\fB\-ftree\-reassoc\fR" 4
+.IX Item "-ftree-reassoc"
+Perform reassociation on trees. This flag is enabled by default
+at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-pre\fR" 4
+.IX Item "-ftree-pre"
+Perform partial redundancy elimination (\s-1PRE\s0) on trees. This flag is
+enabled by default at \fB\-O2\fR and \fB\-O3\fR.
+.IP "\fB\-ftree\-fre\fR" 4
+.IX Item "-ftree-fre"
+Perform full redundancy elimination (\s-1FRE\s0) on trees. The difference
+between \s-1FRE\s0 and \s-1PRE\s0 is that \s-1FRE\s0 only considers expressions
+that are computed on all paths leading to the redundant computation.
+This analysis is faster than \s-1PRE\s0, though it exposes fewer redundancies.
+This flag is enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-copy\-prop\fR" 4
+.IX Item "-ftree-copy-prop"
+Perform copy propagation on trees. This pass eliminates unnecessary
+copy operations. This flag is enabled by default at \fB\-O\fR and
+higher.
+.IP "\fB\-fipa\-pure\-const\fR" 4
+.IX Item "-fipa-pure-const"
+Discover which functions are pure or constant.
+Enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-fipa\-reference\fR" 4
+.IX Item "-fipa-reference"
+Discover which static variables do not escape cannot escape the
+compilation unit.
+Enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-fipa\-struct\-reorg\fR" 4
+.IX Item "-fipa-struct-reorg"
+Perform structure reorganization optimization, that change C\-like structures
+layout in order to better utilize spatial locality. This transformation is
+affective for programs containing arrays of structures. Available in two
+compilation modes: profile-based (enabled with \fB\-fprofile\-generate\fR)
+or static (which uses built-in heuristics). Require \fB\-fipa\-type\-escape\fR
+to provide the safety of this transformation. It works only in whole program
+mode, so it requires \fB\-fwhole\-program\fR and \fB\-combine\fR to be
+enabled. Structures considered \fBcold\fR by this transformation are not
+affected (see \fB\-\-param struct\-reorg\-cold\-struct\-ratio=\fR\fIvalue\fR).
+.Sp
+With this flag, the program debug info reflects a new structure layout.
+.IP "\fB\-fipa\-pta\fR" 4
+.IX Item "-fipa-pta"
+Perform interprocedural pointer analysis. This option is experimental
+and does not affect generated code.
+.IP "\fB\-fipa\-cp\fR" 4
+.IX Item "-fipa-cp"
+Perform interprocedural constant propagation.
+This optimization analyzes the program to determine when values passed
+to functions are constants and then optimizes accordingly.
+This optimization can substantially increase performance
+if the application has constants passed to functions.
+This flag is enabled by default at \fB\-O2\fR, \fB\-Os\fR and \fB\-O3\fR.
+.IP "\fB\-fipa\-cp\-clone\fR" 4
+.IX Item "-fipa-cp-clone"
+Perform function cloning to make interprocedural constant propagation stronger.
+When enabled, interprocedural constant propagation will perform function cloning
+when externally visible function can be called with constant arguments.
+Because this optimization can create multiple copies of functions,
+it may significantly increase code size
+(see \fB\-\-param ipcp\-unit\-growth=\fR\fIvalue\fR).
+This flag is enabled by default at \fB\-O3\fR.
+.IP "\fB\-fipa\-matrix\-reorg\fR" 4
+.IX Item "-fipa-matrix-reorg"
+Perform matrix flattening and transposing.
+Matrix flattening tries to replace a m\-dimensional matrix
+with its equivalent n\-dimensional matrix, where n < m.
+This reduces the level of indirection needed for accessing the elements
+of the matrix. The second optimization is matrix transposing that
+attempts to change the order of the matrix's dimensions in order to
+improve cache locality.
+Both optimizations need the \fB\-fwhole\-program\fR flag.
+Transposing is enabled only if profiling information is available.
+.IP "\fB\-ftree\-sink\fR" 4
+.IX Item "-ftree-sink"
+Perform forward store motion on trees. This flag is
+enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-ccp\fR" 4
+.IX Item "-ftree-ccp"
+Perform sparse conditional constant propagation (\s-1CCP\s0) on trees. This
+pass only operates on local scalar variables and is enabled by default
+at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-switch\-conversion\fR" 4
+.IX Item "-ftree-switch-conversion"
+Perform conversion of simple initializations in a switch to
+initializations from a scalar array. This flag is enabled by default
+at \fB\-O2\fR and higher.
+.IP "\fB\-ftree\-dce\fR" 4
+.IX Item "-ftree-dce"
+Perform dead code elimination (\s-1DCE\s0) on trees. This flag is enabled by
+default at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-builtin\-call\-dce\fR" 4
+.IX Item "-ftree-builtin-call-dce"
+Perform conditional dead code elimination (\s-1DCE\s0) for calls to builtin functions
+that may set \f(CW\*(C`errno\*(C'\fR but are otherwise side-effect free. This flag is
+enabled by default at \fB\-O2\fR and higher if \fB\-Os\fR is not also
+specified.
+.IP "\fB\-ftree\-dominator\-opts\fR" 4
+.IX Item "-ftree-dominator-opts"
+Perform a variety of simple scalar cleanups (constant/copy
+propagation, redundancy elimination, range propagation and expression
+simplification) based on a dominator tree traversal. This also
+performs jump threading (to reduce jumps to jumps). This flag is
+enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-dse\fR" 4
+.IX Item "-ftree-dse"
+Perform dead store elimination (\s-1DSE\s0) on trees. A dead store is a store into
+a memory location which will later be overwritten by another store without
+any intervening loads. In this case the earlier store can be deleted. This
+flag is enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-ch\fR" 4
+.IX Item "-ftree-ch"
+Perform loop header copying on trees. This is beneficial since it increases
+effectiveness of code motion optimizations. It also saves one jump. This flag
+is enabled by default at \fB\-O\fR and higher. It is not enabled
+for \fB\-Os\fR, since it usually increases code size.
+.IP "\fB\-ftree\-loop\-optimize\fR" 4
+.IX Item "-ftree-loop-optimize"
+Perform loop optimizations on trees. This flag is enabled by default
+at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-loop\-linear\fR" 4
+.IX Item "-ftree-loop-linear"
+Perform linear loop transformations on tree. This flag can improve cache
+performance and allow further loop optimizations to take place.
+.IP "\fB\-floop\-interchange\fR" 4
+.IX Item "-floop-interchange"
+Perform loop interchange transformations on loops. Interchanging two
+nested loops switches the inner and outer loops. For example, given a
+loop like:
+.Sp
+.Vb 5
+\& DO J = 1, M
+\& DO I = 1, N
+\& A(J, I) = A(J, I) * C
+\& ENDDO
+\& ENDDO
+.Ve
+.Sp
+loop interchange will transform the loop as if the user had written:
+.Sp
+.Vb 5
+\& DO I = 1, N
+\& DO J = 1, M
+\& A(J, I) = A(J, I) * C
+\& ENDDO
+\& ENDDO
+.Ve
+.Sp
+which can be beneficial when \f(CW\*(C`N\*(C'\fR is larger than the caches,
+because in Fortran, the elements of an array are stored in memory
+contiguously by column, and the original loop iterates over rows,
+potentially creating at each access a cache miss. This optimization
+applies to all the languages supported by \s-1GCC\s0 and is not limited to
+Fortran. To use this code transformation, \s-1GCC\s0 has to be configured
+with \fB\-\-with\-ppl\fR and \fB\-\-with\-cloog\fR to enable the
+Graphite loop transformation infrastructure.
+.IP "\fB\-floop\-strip\-mine\fR" 4
+.IX Item "-floop-strip-mine"
+Perform loop strip mining transformations on loops. Strip mining
+splits a loop into two nested loops. The outer loop has strides
+equal to the strip size and the inner loop has strides of the
+original loop within a strip. For example, given a loop like:
+.Sp
+.Vb 3
+\& DO I = 1, N
+\& A(I) = A(I) + C
+\& ENDDO
+.Ve
+.Sp
+loop strip mining will transform the loop as if the user had written:
+.Sp
+.Vb 5
+\& DO II = 1, N, 4
+\& DO I = II, min (II + 3, N)
+\& A(I) = A(I) + C
+\& ENDDO
+\& ENDDO
+.Ve
+.Sp
+This optimization applies to all the languages supported by \s-1GCC\s0 and is
+not limited to Fortran. To use this code transformation, \s-1GCC\s0 has to
+be configured with \fB\-\-with\-ppl\fR and \fB\-\-with\-cloog\fR to
+enable the Graphite loop transformation infrastructure.
+.IP "\fB\-floop\-block\fR" 4
+.IX Item "-floop-block"
+Perform loop blocking transformations on loops. Blocking strip mines
+each loop in the loop nest such that the memory accesses of the
+element loops fit inside caches. For example, given a loop like:
+.Sp
+.Vb 5
+\& DO I = 1, N
+\& DO J = 1, M
+\& A(J, I) = B(I) + C(J)
+\& ENDDO
+\& ENDDO
+.Ve
+.Sp
+loop blocking will transform the loop as if the user had written:
+.Sp
+.Vb 9
+\& DO II = 1, N, 64
+\& DO JJ = 1, M, 64
+\& DO I = II, min (II + 63, N)
+\& DO J = JJ, min (JJ + 63, M)
+\& A(J, I) = B(I) + C(J)
+\& ENDDO
+\& ENDDO
+\& ENDDO
+\& ENDDO
+.Ve
+.Sp
+which can be beneficial when \f(CW\*(C`M\*(C'\fR is larger than the caches,
+because the innermost loop will iterate over a smaller amount of data
+that can be kept in the caches. This optimization applies to all the
+languages supported by \s-1GCC\s0 and is not limited to Fortran. To use this
+code transformation, \s-1GCC\s0 has to be configured with \fB\-\-with\-ppl\fR
+and \fB\-\-with\-cloog\fR to enable the Graphite loop transformation
+infrastructure.
+.IP "\fB\-fcheck\-data\-deps\fR" 4
+.IX Item "-fcheck-data-deps"
+Compare the results of several data dependence analyzers. This option
+is used for debugging the data dependence analyzers.
+.IP "\fB\-ftree\-loop\-distribution\fR" 4
+.IX Item "-ftree-loop-distribution"
+Perform loop distribution. This flag can improve cache performance on
+big loop bodies and allow further loop optimizations, like
+parallelization or vectorization, to take place. For example, the loop
+.Sp
+.Vb 4
+\& DO I = 1, N
+\& A(I) = B(I) + C
+\& D(I) = E(I) * F
+\& ENDDO
+.Ve
+.Sp
+is transformed to
+.Sp
+.Vb 6
+\& DO I = 1, N
+\& A(I) = B(I) + C
+\& ENDDO
+\& DO I = 1, N
+\& D(I) = E(I) * F
+\& ENDDO
+.Ve
+.IP "\fB\-ftree\-loop\-im\fR" 4
+.IX Item "-ftree-loop-im"
+Perform loop invariant motion on trees. This pass moves only invariants that
+would be hard to handle at \s-1RTL\s0 level (function calls, operations that expand to
+nontrivial sequences of insns). With \fB\-funswitch\-loops\fR it also moves
+operands of conditions that are invariant out of the loop, so that we can use
+just trivial invariantness analysis in loop unswitching. The pass also includes
+store motion.
+.IP "\fB\-ftree\-loop\-ivcanon\fR" 4
+.IX Item "-ftree-loop-ivcanon"
+Create a canonical counter for number of iterations in the loop for that
+determining number of iterations requires complicated analysis. Later
+optimizations then may determine the number easily. Useful especially
+in connection with unrolling.
+.IP "\fB\-fivopts\fR" 4
+.IX Item "-fivopts"
+Perform induction variable optimizations (strength reduction, induction
+variable merging and induction variable elimination) on trees.
+.IP "\fB\-ftree\-parallelize\-loops=n\fR" 4
+.IX Item "-ftree-parallelize-loops=n"
+Parallelize loops, i.e., split their iteration space to run in n threads.
+This is only possible for loops whose iterations are independent
+and can be arbitrarily reordered. The optimization is only
+profitable on multiprocessor machines, for loops that are CPU-intensive,
+rather than constrained e.g. by memory bandwidth. This option
+implies \fB\-pthread\fR, and thus is only supported on targets
+that have support for \fB\-pthread\fR.
+.IP "\fB\-ftree\-sra\fR" 4
+.IX Item "-ftree-sra"
+Perform scalar replacement of aggregates. This pass replaces structure
+references with scalars to prevent committing structures to memory too
+early. This flag is enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-copyrename\fR" 4
+.IX Item "-ftree-copyrename"
+Perform copy renaming on trees. This pass attempts to rename compiler
+temporaries to other variables at copy locations, usually resulting in
+variable names which more closely resemble the original variables. This flag
+is enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-ter\fR" 4
+.IX Item "-ftree-ter"
+Perform temporary expression replacement during the \s-1SSA\-\s0>normal phase. Single
+use/single def temporaries are replaced at their use location with their
+defining expression. This results in non-GIMPLE code, but gives the expanders
+much more complex trees to work on resulting in better \s-1RTL\s0 generation. This is
+enabled by default at \fB\-O\fR and higher.
+.IP "\fB\-ftree\-vectorize\fR" 4
+.IX Item "-ftree-vectorize"
+Perform loop vectorization on trees. This flag is enabled by default at
+\&\fB\-O3\fR.
+.IP "\fB\-ftree\-vect\-loop\-version\fR" 4
+.IX Item "-ftree-vect-loop-version"
+Perform loop versioning when doing loop vectorization on trees. When a loop
+appears to be vectorizable except that data alignment or data dependence cannot
+be determined at compile time then vectorized and non-vectorized versions of
+the loop are generated along with runtime checks for alignment or dependence
+to control which version is executed. This option is enabled by default
+except at level \fB\-Os\fR where it is disabled.
+.IP "\fB\-fvect\-cost\-model\fR" 4
+.IX Item "-fvect-cost-model"
+Enable cost model for vectorization.
+.IP "\fB\-ftree\-vrp\fR" 4
+.IX Item "-ftree-vrp"
+Perform Value Range Propagation on trees. This is similar to the
+constant propagation pass, but instead of values, ranges of values are
+propagated. This allows the optimizers to remove unnecessary range
+checks like array bound checks and null pointer checks. This is
+enabled by default at \fB\-O2\fR and higher. Null pointer check
+elimination is only done if \fB\-fdelete\-null\-pointer\-checks\fR is
+enabled.
+.IP "\fB\-ftracer\fR" 4
+.IX Item "-ftracer"
+Perform tail duplication to enlarge superblock size. This transformation
+simplifies the control flow of the function allowing other optimizations to do
+better job.
+.IP "\fB\-funroll\-loops\fR" 4
+.IX Item "-funroll-loops"
+Unroll loops whose number of iterations can be determined at compile
+time or upon entry to the loop. \fB\-funroll\-loops\fR implies
+\&\fB\-frerun\-cse\-after\-loop\fR. This option makes code larger,
+and may or may not make it run faster.
+.IP "\fB\-funroll\-all\-loops\fR" 4
+.IX Item "-funroll-all-loops"
+Unroll all loops, even if their number of iterations is uncertain when
+the loop is entered. This usually makes programs run more slowly.
+\&\fB\-funroll\-all\-loops\fR implies the same options as
+\&\fB\-funroll\-loops\fR,
+.IP "\fB\-fsplit\-ivs\-in\-unroller\fR" 4
+.IX Item "-fsplit-ivs-in-unroller"
+Enables expressing of values of induction variables in later iterations
+of the unrolled loop using the value in the first iteration. This breaks
+long dependency chains, thus improving efficiency of the scheduling passes.
+.Sp
+Combination of \fB\-fweb\fR and \s-1CSE\s0 is often sufficient to obtain the
+same effect. However in cases the loop body is more complicated than
+a single basic block, this is not reliable. It also does not work at all
+on some of the architectures due to restrictions in the \s-1CSE\s0 pass.
+.Sp
+This optimization is enabled by default.
+.IP "\fB\-fvariable\-expansion\-in\-unroller\fR" 4
+.IX Item "-fvariable-expansion-in-unroller"
+With this option, the compiler will create multiple copies of some
+local variables when unrolling a loop which can result in superior code.
+.IP "\fB\-fpredictive\-commoning\fR" 4
+.IX Item "-fpredictive-commoning"
+Perform predictive commoning optimization, i.e., reusing computations
+(especially memory loads and stores) performed in previous
+iterations of loops.
+.Sp
+This option is enabled at level \fB\-O3\fR.
+.IP "\fB\-fprefetch\-loop\-arrays\fR" 4
+.IX Item "-fprefetch-loop-arrays"
+If supported by the target machine, generate instructions to prefetch
+memory to improve the performance of loops that access large arrays.
+.Sp
+This option may generate better or worse code; results are highly
+dependent on the structure of loops within the source code.
+.Sp
+Disabled at level \fB\-Os\fR.
+.IP "\fB\-fno\-peephole\fR" 4
+.IX Item "-fno-peephole"
+.PD 0
+.IP "\fB\-fno\-peephole2\fR" 4
+.IX Item "-fno-peephole2"
+.PD
+Disable any machine-specific peephole optimizations. The difference
+between \fB\-fno\-peephole\fR and \fB\-fno\-peephole2\fR is in how they
+are implemented in the compiler; some targets use one, some use the
+other, a few use both.
+.Sp
+\&\fB\-fpeephole\fR is enabled by default.
+\&\fB\-fpeephole2\fR enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fno\-guess\-branch\-probability\fR" 4
+.IX Item "-fno-guess-branch-probability"
+Do not guess branch probabilities using heuristics.
+.Sp
+\&\s-1GCC\s0 will use heuristics to guess branch probabilities if they are
+not provided by profiling feedback (\fB\-fprofile\-arcs\fR). These
+heuristics are based on the control flow graph. If some branch probabilities
+are specified by \fB_\|_builtin_expect\fR, then the heuristics will be
+used to guess branch probabilities for the rest of the control flow graph,
+taking the \fB_\|_builtin_expect\fR info into account. The interactions
+between the heuristics and \fB_\|_builtin_expect\fR can be complex, and in
+some cases, it may be useful to disable the heuristics so that the effects
+of \fB_\|_builtin_expect\fR are easier to understand.
+.Sp
+The default is \fB\-fguess\-branch\-probability\fR at levels
+\&\fB\-O\fR, \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-freorder\-blocks\fR" 4
+.IX Item "-freorder-blocks"
+Reorder basic blocks in the compiled function in order to reduce number of
+taken branches and improve code locality.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR.
+.IP "\fB\-freorder\-blocks\-and\-partition\fR" 4
+.IX Item "-freorder-blocks-and-partition"
+In addition to reordering basic blocks in the compiled function, in order
+to reduce number of taken branches, partitions hot and cold basic blocks
+into separate sections of the assembly and .o files, to improve
+paging and cache locality performance.
+.Sp
+This optimization is automatically turned off in the presence of
+exception handling, for linkonce sections, for functions with a user-defined
+section attribute and on any architecture that does not support named
+sections.
+.IP "\fB\-freorder\-functions\fR" 4
+.IX Item "-freorder-functions"
+Reorder functions in the object file in order to
+improve code locality. This is implemented by using special
+subsections \f(CW\*(C`.text.hot\*(C'\fR for most frequently executed functions and
+\&\f(CW\*(C`.text.unlikely\*(C'\fR for unlikely executed functions. Reordering is done by
+the linker so object file format must support named sections and linker must
+place them in a reasonable way.
+.Sp
+Also profile feedback must be available in to make this option effective. See
+\&\fB\-fprofile\-arcs\fR for details.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fstrict\-aliasing\fR" 4
+.IX Item "-fstrict-aliasing"
+Allow the compiler to assume the strictest aliasing rules applicable to
+the language being compiled. For C (and \*(C+), this activates
+optimizations based on the type of expressions. In particular, an
+object of one type is assumed never to reside at the same address as an
+object of a different type, unless the types are almost the same. For
+example, an \f(CW\*(C`unsigned int\*(C'\fR can alias an \f(CW\*(C`int\*(C'\fR, but not a
+\&\f(CW\*(C`void*\*(C'\fR or a \f(CW\*(C`double\*(C'\fR. A character type may alias any other
+type.
+.Sp
+Pay special attention to code like this:
+.Sp
+.Vb 4
+\& union a_union {
+\& int i;
+\& double d;
+\& };
+\&
+\& int f() {
+\& union a_union t;
+\& t.d = 3.0;
+\& return t.i;
+\& }
+.Ve
+.Sp
+The practice of reading from a different union member than the one most
+recently written to (called \*(L"type-punning\*(R") is common. Even with
+\&\fB\-fstrict\-aliasing\fR, type-punning is allowed, provided the memory
+is accessed through the union type. So, the code above will work as
+expected. However, this code might not:
+.Sp
+.Vb 7
+\& int f() {
+\& union a_union t;
+\& int* ip;
+\& t.d = 3.0;
+\& ip = &t.i;
+\& return *ip;
+\& }
+.Ve
+.Sp
+Similarly, access by taking the address, casting the resulting pointer
+and dereferencing the result has undefined behavior, even if the cast
+uses a union type, e.g.:
+.Sp
+.Vb 4
+\& int f() {
+\& double d = 3.0;
+\& return ((union a_union *) &d)\->i;
+\& }
+.Ve
+.Sp
+The \fB\-fstrict\-aliasing\fR option is enabled at levels
+\&\fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fstrict\-overflow\fR" 4
+.IX Item "-fstrict-overflow"
+Allow the compiler to assume strict signed overflow rules, depending
+on the language being compiled. For C (and \*(C+) this means that
+overflow when doing arithmetic with signed numbers is undefined, which
+means that the compiler may assume that it will not happen. This
+permits various optimizations. For example, the compiler will assume
+that an expression like \f(CW\*(C`i + 10 > i\*(C'\fR will always be true for
+signed \f(CW\*(C`i\*(C'\fR. This assumption is only valid if signed overflow is
+undefined, as the expression is false if \f(CW\*(C`i + 10\*(C'\fR overflows when
+using twos complement arithmetic. When this option is in effect any
+attempt to determine whether an operation on signed numbers will
+overflow must be written carefully to not actually involve overflow.
+.Sp
+This option also allows the compiler to assume strict pointer
+semantics: given a pointer to an object, if adding an offset to that
+pointer does not produce a pointer to the same object, the addition is
+undefined. This permits the compiler to conclude that \f(CW\*(C`p + u >
+p\*(C'\fR is always true for a pointer \f(CW\*(C`p\*(C'\fR and unsigned integer
+\&\f(CW\*(C`u\*(C'\fR. This assumption is only valid because pointer wraparound is
+undefined, as the expression is false if \f(CW\*(C`p + u\*(C'\fR overflows using
+twos complement arithmetic.
+.Sp
+See also the \fB\-fwrapv\fR option. Using \fB\-fwrapv\fR means
+that integer signed overflow is fully defined: it wraps. When
+\&\fB\-fwrapv\fR is used, there is no difference between
+\&\fB\-fstrict\-overflow\fR and \fB\-fno\-strict\-overflow\fR for
+integers. With \fB\-fwrapv\fR certain types of overflow are
+permitted. For example, if the compiler gets an overflow when doing
+arithmetic on constants, the overflowed value can still be used with
+\&\fB\-fwrapv\fR, but not otherwise.
+.Sp
+The \fB\-fstrict\-overflow\fR option is enabled at levels
+\&\fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-falign\-functions\fR" 4
+.IX Item "-falign-functions"
+.PD 0
+.IP "\fB\-falign\-functions=\fR\fIn\fR" 4
+.IX Item "-falign-functions=n"
+.PD
+Align the start of functions to the next power-of-two greater than
+\&\fIn\fR, skipping up to \fIn\fR bytes. For instance,
+\&\fB\-falign\-functions=32\fR aligns functions to the next 32\-byte
+boundary, but \fB\-falign\-functions=24\fR would align to the next
+32\-byte boundary only if this can be done by skipping 23 bytes or less.
+.Sp
+\&\fB\-fno\-align\-functions\fR and \fB\-falign\-functions=1\fR are
+equivalent and mean that functions will not be aligned.
+.Sp
+Some assemblers only support this flag when \fIn\fR is a power of two;
+in that case, it is rounded up.
+.Sp
+If \fIn\fR is not specified or is zero, use a machine-dependent default.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR.
+.IP "\fB\-falign\-labels\fR" 4
+.IX Item "-falign-labels"
+.PD 0
+.IP "\fB\-falign\-labels=\fR\fIn\fR" 4
+.IX Item "-falign-labels=n"
+.PD
+Align all branch targets to a power-of-two boundary, skipping up to
+\&\fIn\fR bytes like \fB\-falign\-functions\fR. This option can easily
+make code slower, because it must insert dummy operations for when the
+branch target is reached in the usual flow of the code.
+.Sp
+\&\fB\-fno\-align\-labels\fR and \fB\-falign\-labels=1\fR are
+equivalent and mean that labels will not be aligned.
+.Sp
+If \fB\-falign\-loops\fR or \fB\-falign\-jumps\fR are applicable and
+are greater than this value, then their values are used instead.
+.Sp
+If \fIn\fR is not specified or is zero, use a machine-dependent default
+which is very likely to be \fB1\fR, meaning no alignment.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR.
+.IP "\fB\-falign\-loops\fR" 4
+.IX Item "-falign-loops"
+.PD 0
+.IP "\fB\-falign\-loops=\fR\fIn\fR" 4
+.IX Item "-falign-loops=n"
+.PD
+Align loops to a power-of-two boundary, skipping up to \fIn\fR bytes
+like \fB\-falign\-functions\fR. The hope is that the loop will be
+executed many times, which will make up for any execution of the dummy
+operations.
+.Sp
+\&\fB\-fno\-align\-loops\fR and \fB\-falign\-loops=1\fR are
+equivalent and mean that loops will not be aligned.
+.Sp
+If \fIn\fR is not specified or is zero, use a machine-dependent default.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR.
+.IP "\fB\-falign\-jumps\fR" 4
+.IX Item "-falign-jumps"
+.PD 0
+.IP "\fB\-falign\-jumps=\fR\fIn\fR" 4
+.IX Item "-falign-jumps=n"
+.PD
+Align branch targets to a power-of-two boundary, for branch targets
+where the targets can only be reached by jumping, skipping up to \fIn\fR
+bytes like \fB\-falign\-functions\fR. In this case, no dummy operations
+need be executed.
+.Sp
+\&\fB\-fno\-align\-jumps\fR and \fB\-falign\-jumps=1\fR are
+equivalent and mean that loops will not be aligned.
+.Sp
+If \fIn\fR is not specified or is zero, use a machine-dependent default.
+.Sp
+Enabled at levels \fB\-O2\fR, \fB\-O3\fR.
+.IP "\fB\-funit\-at\-a\-time\fR" 4
+.IX Item "-funit-at-a-time"
+This option is left for compatibility reasons. \fB\-funit\-at\-a\-time\fR
+has no effect, while \fB\-fno\-unit\-at\-a\-time\fR implies
+\&\fB\-fno\-toplevel\-reorder\fR and \fB\-fno\-section\-anchors\fR.
+.Sp
+Enabled by default.
+.IP "\fB\-fno\-toplevel\-reorder\fR" 4
+.IX Item "-fno-toplevel-reorder"
+Do not reorder top-level functions, variables, and \f(CW\*(C`asm\*(C'\fR
+statements. Output them in the same order that they appear in the
+input file. When this option is used, unreferenced static variables
+will not be removed. This option is intended to support existing code
+which relies on a particular ordering. For new code, it is better to
+use attributes.
+.Sp
+Enabled at level \fB\-O0\fR. When disabled explicitly, it also imply
+\&\fB\-fno\-section\-anchors\fR that is otherwise enabled at \fB\-O0\fR on some
+targets.
+.IP "\fB\-fweb\fR" 4
+.IX Item "-fweb"
+Constructs webs as commonly used for register allocation purposes and assign
+each web individual pseudo register. This allows the register allocation pass
+to operate on pseudos directly, but also strengthens several other optimization
+passes, such as \s-1CSE\s0, loop optimizer and trivial dead code remover. It can,
+however, make debugging impossible, since variables will no longer stay in a
+\&\*(L"home register\*(R".
+.Sp
+Enabled by default with \fB\-funroll\-loops\fR.
+.IP "\fB\-fwhole\-program\fR" 4
+.IX Item "-fwhole-program"
+Assume that the current compilation unit represents whole program being
+compiled. All public functions and variables with the exception of \f(CW\*(C`main\*(C'\fR
+and those merged by attribute \f(CW\*(C`externally_visible\*(C'\fR become static functions
+and in a affect gets more aggressively optimized by interprocedural optimizers.
+While this option is equivalent to proper use of \f(CW\*(C`static\*(C'\fR keyword for
+programs consisting of single file, in combination with option
+\&\fB\-\-combine\fR this flag can be used to compile most of smaller scale C
+programs since the functions and variables become local for the whole combined
+compilation unit, not for the single source file itself.
+.Sp
+This option is not supported for Fortran programs.
+.IP "\fB\-fcprop\-registers\fR" 4
+.IX Item "-fcprop-registers"
+After register allocation and post-register allocation instruction splitting,
+we perform a copy-propagation pass to try to reduce scheduling dependencies
+and occasionally eliminate the copy.
+.Sp
+Enabled at levels \fB\-O\fR, \fB\-O2\fR, \fB\-O3\fR, \fB\-Os\fR.
+.IP "\fB\-fprofile\-correction\fR" 4
+.IX Item "-fprofile-correction"
+Profiles collected using an instrumented binary for multi-threaded programs may
+be inconsistent due to missed counter updates. When this option is specified,
+\&\s-1GCC\s0 will use heuristics to correct or smooth out such inconsistencies. By
+default, \s-1GCC\s0 will emit an error message when an inconsistent profile is detected.
+.IP "\fB\-fprofile\-dir=\fR\fIpath\fR" 4
+.IX Item "-fprofile-dir=path"
+Set the directory to search the profile data files in to \fIpath\fR.
+This option affects only the profile data generated by
+\&\fB\-fprofile\-generate\fR, \fB\-ftest\-coverage\fR, \fB\-fprofile\-arcs\fR
+and used by \fB\-fprofile\-use\fR and \fB\-fbranch\-probabilities\fR
+and its related options.
+By default, \s-1GCC\s0 will use the current directory as \fIpath\fR
+thus the profile data file will appear in the same directory as the object file.
+.IP "\fB\-fprofile\-generate\fR" 4
+.IX Item "-fprofile-generate"
+.PD 0
+.IP "\fB\-fprofile\-generate=\fR\fIpath\fR" 4
+.IX Item "-fprofile-generate=path"
+.PD
+Enable options usually used for instrumenting application to produce
+profile useful for later recompilation with profile feedback based
+optimization. You must use \fB\-fprofile\-generate\fR both when
+compiling and when linking your program.
+.Sp
+The following options are enabled: \f(CW\*(C`\-fprofile\-arcs\*(C'\fR, \f(CW\*(C`\-fprofile\-values\*(C'\fR, \f(CW\*(C`\-fvpt\*(C'\fR.
+.Sp
+If \fIpath\fR is specified, \s-1GCC\s0 will look at the \fIpath\fR to find
+the profile feedback data files. See \fB\-fprofile\-dir\fR.
+.IP "\fB\-fprofile\-use\fR" 4
+.IX Item "-fprofile-use"
+.PD 0
+.IP "\fB\-fprofile\-use=\fR\fIpath\fR" 4
+.IX Item "-fprofile-use=path"
+.PD
+Enable profile feedback directed optimizations, and optimizations
+generally profitable only with profile feedback available.
+.Sp
+The following options are enabled: \f(CW\*(C`\-fbranch\-probabilities\*(C'\fR, \f(CW\*(C`\-fvpt\*(C'\fR,
+\&\f(CW\*(C`\-funroll\-loops\*(C'\fR, \f(CW\*(C`\-fpeel\-loops\*(C'\fR, \f(CW\*(C`\-ftracer\*(C'\fR
+.Sp
+By default, \s-1GCC\s0 emits an error message if the feedback profiles do not
+match the source code. This error can be turned into a warning by using
+\&\fB\-Wcoverage\-mismatch\fR. Note this may result in poorly optimized
+code.
+.Sp
+If \fIpath\fR is specified, \s-1GCC\s0 will look at the \fIpath\fR to find
+the profile feedback data files. See \fB\-fprofile\-dir\fR.
+.PP
+The following options control compiler behavior regarding floating
+point arithmetic. These options trade off between speed and
+correctness. All must be specifically enabled.
+.IP "\fB\-ffloat\-store\fR" 4
+.IX Item "-ffloat-store"
+Do not store floating point variables in registers, and inhibit other
+options that might change whether a floating point value is taken from a
+register or memory.
+.Sp
+This option prevents undesirable excess precision on machines such as
+the 68000 where the floating registers (of the 68881) keep more
+precision than a \f(CW\*(C`double\*(C'\fR is supposed to have. Similarly for the
+x86 architecture. For most programs, the excess precision does only
+good, but a few programs rely on the precise definition of \s-1IEEE\s0 floating
+point. Use \fB\-ffloat\-store\fR for such programs, after modifying
+them to store all pertinent intermediate computations into variables.
+.IP "\fB\-ffast\-math\fR" 4
+.IX Item "-ffast-math"
+Sets \fB\-fno\-math\-errno\fR, \fB\-funsafe\-math\-optimizations\fR,
+\&\fB\-ffinite\-math\-only\fR, \fB\-fno\-rounding\-math\fR,
+\&\fB\-fno\-signaling\-nans\fR and \fB\-fcx\-limited\-range\fR.
+.Sp
+This option causes the preprocessor macro \f(CW\*(C`_\|_FAST_MATH_\|_\*(C'\fR to be defined.
+.Sp
+This option is not turned on by any \fB\-O\fR option since
+it can result in incorrect output for programs which depend on
+an exact implementation of \s-1IEEE\s0 or \s-1ISO\s0 rules/specifications for
+math functions. It may, however, yield faster code for programs
+that do not require the guarantees of these specifications.
+.IP "\fB\-fno\-math\-errno\fR" 4
+.IX Item "-fno-math-errno"
+Do not set \s-1ERRNO\s0 after calling math functions that are executed
+with a single instruction, e.g., sqrt. A program that relies on
+\&\s-1IEEE\s0 exceptions for math error handling may want to use this flag
+for speed while maintaining \s-1IEEE\s0 arithmetic compatibility.
+.Sp
+This option is not turned on by any \fB\-O\fR option since
+it can result in incorrect output for programs which depend on
+an exact implementation of \s-1IEEE\s0 or \s-1ISO\s0 rules/specifications for
+math functions. It may, however, yield faster code for programs
+that do not require the guarantees of these specifications.
+.Sp
+The default is \fB\-fmath\-errno\fR.
+.Sp
+On Darwin systems, the math library never sets \f(CW\*(C`errno\*(C'\fR. There is
+therefore no reason for the compiler to consider the possibility that
+it might, and \fB\-fno\-math\-errno\fR is the default.
+.IP "\fB\-funsafe\-math\-optimizations\fR" 4
+.IX Item "-funsafe-math-optimizations"
+Allow optimizations for floating-point arithmetic that (a) assume
+that arguments and results are valid and (b) may violate \s-1IEEE\s0 or
+\&\s-1ANSI\s0 standards. When used at link-time, it may include libraries
+or startup files that change the default \s-1FPU\s0 control word or other
+similar optimizations.
+.Sp
+This option is not turned on by any \fB\-O\fR option since
+it can result in incorrect output for programs which depend on
+an exact implementation of \s-1IEEE\s0 or \s-1ISO\s0 rules/specifications for
+math functions. It may, however, yield faster code for programs
+that do not require the guarantees of these specifications.
+Enables \fB\-fno\-signed\-zeros\fR, \fB\-fno\-trapping\-math\fR,
+\&\fB\-fassociative\-math\fR and \fB\-freciprocal\-math\fR.
+.Sp
+The default is \fB\-fno\-unsafe\-math\-optimizations\fR.
+.IP "\fB\-fassociative\-math\fR" 4
+.IX Item "-fassociative-math"
+Allow re-association of operands in series of floating-point operations.
+This violates the \s-1ISO\s0 C and \*(C+ language standard by possibly changing
+computation result. \s-1NOTE:\s0 re-ordering may change the sign of zero as
+well as ignore NaNs and inhibit or create underflow or overflow (and
+thus cannot be used on a code which relies on rounding behavior like
+\&\f(CW\*(C`(x + 2**52) \- 2**52)\*(C'\fR. May also reorder floating-point comparisons
+and thus may not be used when ordered comparisons are required.
+This option requires that both \fB\-fno\-signed\-zeros\fR and
+\&\fB\-fno\-trapping\-math\fR be in effect. Moreover, it doesn't make
+much sense with \fB\-frounding\-math\fR.
+.Sp
+The default is \fB\-fno\-associative\-math\fR.
+.IP "\fB\-freciprocal\-math\fR" 4
+.IX Item "-freciprocal-math"
+Allow the reciprocal of a value to be used instead of dividing by
+the value if this enables optimizations. For example \f(CW\*(C`x / y\*(C'\fR
+can be replaced with \f(CW\*(C`x * (1/y)\*(C'\fR which is useful if \f(CW\*(C`(1/y)\*(C'\fR
+is subject to common subexpression elimination. Note that this loses
+precision and increases the number of flops operating on the value.
+.Sp
+The default is \fB\-fno\-reciprocal\-math\fR.
+.IP "\fB\-ffinite\-math\-only\fR" 4
+.IX Item "-ffinite-math-only"
+Allow optimizations for floating-point arithmetic that assume
+that arguments and results are not NaNs or +\-Infs.
+.Sp
+This option is not turned on by any \fB\-O\fR option since
+it can result in incorrect output for programs which depend on
+an exact implementation of \s-1IEEE\s0 or \s-1ISO\s0 rules/specifications for
+math functions. It may, however, yield faster code for programs
+that do not require the guarantees of these specifications.
+.Sp
+The default is \fB\-fno\-finite\-math\-only\fR.
+.IP "\fB\-fno\-signed\-zeros\fR" 4
+.IX Item "-fno-signed-zeros"
+Allow optimizations for floating point arithmetic that ignore the
+signedness of zero. \s-1IEEE\s0 arithmetic specifies the behavior of
+distinct +0.0 and \-0.0 values, which then prohibits simplification
+of expressions such as x+0.0 or 0.0*x (even with \fB\-ffinite\-math\-only\fR).
+This option implies that the sign of a zero result isn't significant.
+.Sp
+The default is \fB\-fsigned\-zeros\fR.
+.IP "\fB\-fno\-trapping\-math\fR" 4
+.IX Item "-fno-trapping-math"
+Compile code assuming that floating-point operations cannot generate
+user-visible traps. These traps include division by zero, overflow,
+underflow, inexact result and invalid operation. This option requires
+that \fB\-fno\-signaling\-nans\fR be in effect. Setting this option may
+allow faster code if one relies on \*(L"non-stop\*(R" \s-1IEEE\s0 arithmetic, for example.
+.Sp
+This option should never be turned on by any \fB\-O\fR option since
+it can result in incorrect output for programs which depend on
+an exact implementation of \s-1IEEE\s0 or \s-1ISO\s0 rules/specifications for
+math functions.
+.Sp
+The default is \fB\-ftrapping\-math\fR.
+.IP "\fB\-frounding\-math\fR" 4
+.IX Item "-frounding-math"
+Disable transformations and optimizations that assume default floating
+point rounding behavior. This is round-to-zero for all floating point
+to integer conversions, and round-to-nearest for all other arithmetic
+truncations. This option should be specified for programs that change
+the \s-1FP\s0 rounding mode dynamically, or that may be executed with a
+non-default rounding mode. This option disables constant folding of
+floating point expressions at compile-time (which may be affected by
+rounding mode) and arithmetic transformations that are unsafe in the
+presence of sign-dependent rounding modes.
+.Sp
+The default is \fB\-fno\-rounding\-math\fR.
+.Sp
+This option is experimental and does not currently guarantee to
+disable all \s-1GCC\s0 optimizations that are affected by rounding mode.
+Future versions of \s-1GCC\s0 may provide finer control of this setting
+using C99's \f(CW\*(C`FENV_ACCESS\*(C'\fR pragma. This command line option
+will be used to specify the default state for \f(CW\*(C`FENV_ACCESS\*(C'\fR.
+.IP "\fB\-frtl\-abstract\-sequences\fR" 4
+.IX Item "-frtl-abstract-sequences"
+It is a size optimization method. This option is to find identical
+sequences of code, which can be turned into pseudo-procedures and
+then replace all occurrences with calls to the newly created
+subroutine. It is kind of an opposite of \fB\-finline\-functions\fR.
+This optimization runs at \s-1RTL\s0 level.
+.IP "\fB\-fsignaling\-nans\fR" 4
+.IX Item "-fsignaling-nans"
+Compile code assuming that \s-1IEEE\s0 signaling NaNs may generate user-visible
+traps during floating-point operations. Setting this option disables
+optimizations that may change the number of exceptions visible with
+signaling NaNs. This option implies \fB\-ftrapping\-math\fR.
+.Sp
+This option causes the preprocessor macro \f(CW\*(C`_\|_SUPPORT_SNAN_\|_\*(C'\fR to
+be defined.
+.Sp
+The default is \fB\-fno\-signaling\-nans\fR.
+.Sp
+This option is experimental and does not currently guarantee to
+disable all \s-1GCC\s0 optimizations that affect signaling NaN behavior.
+.IP "\fB\-fsingle\-precision\-constant\fR" 4
+.IX Item "-fsingle-precision-constant"
+Treat floating point constant as single precision constant instead of
+implicitly converting it to double precision constant.
+.IP "\fB\-fcx\-limited\-range\fR" 4
+.IX Item "-fcx-limited-range"
+When enabled, this option states that a range reduction step is not
+needed when performing complex division. Also, there is no checking
+whether the result of a complex multiplication or division is \f(CW\*(C`NaN
++ I*NaN\*(C'\fR, with an attempt to rescue the situation in that case. The
+default is \fB\-fno\-cx\-limited\-range\fR, but is enabled by
+\&\fB\-ffast\-math\fR.
+.Sp
+This option controls the default setting of the \s-1ISO\s0 C99
+\&\f(CW\*(C`CX_LIMITED_RANGE\*(C'\fR pragma. Nevertheless, the option applies to
+all languages.
+.IP "\fB\-fcx\-fortran\-rules\fR" 4
+.IX Item "-fcx-fortran-rules"
+Complex multiplication and division follow Fortran rules. Range
+reduction is done as part of complex division, but there is no checking
+whether the result of a complex multiplication or division is \f(CW\*(C`NaN
++ I*NaN\*(C'\fR, with an attempt to rescue the situation in that case.
+.Sp
+The default is \fB\-fno\-cx\-fortran\-rules\fR.
+.PP
+The following options control optimizations that may improve
+performance, but are not enabled by any \fB\-O\fR options. This
+section includes experimental options that may produce broken code.
+.IP "\fB\-fbranch\-probabilities\fR" 4
+.IX Item "-fbranch-probabilities"
+After running a program compiled with \fB\-fprofile\-arcs\fR, you can compile it a second time using
+\&\fB\-fbranch\-probabilities\fR, to improve optimizations based on
+the number of times each branch was taken. When the program
+compiled with \fB\-fprofile\-arcs\fR exits it saves arc execution
+counts to a file called \fI\fIsourcename\fI.gcda\fR for each source
+file. The information in this data file is very dependent on the
+structure of the generated code, so you must use the same source code
+and the same optimization options for both compilations.
+.Sp
+With \fB\-fbranch\-probabilities\fR, \s-1GCC\s0 puts a
+\&\fB\s-1REG_BR_PROB\s0\fR note on each \fB\s-1JUMP_INSN\s0\fR and \fB\s-1CALL_INSN\s0\fR.
+These can be used to improve optimization. Currently, they are only
+used in one place: in \fIreorg.c\fR, instead of guessing which path a
+branch is mostly to take, the \fB\s-1REG_BR_PROB\s0\fR values are used to
+exactly determine which path is taken more often.
+.IP "\fB\-fprofile\-values\fR" 4
+.IX Item "-fprofile-values"
+If combined with \fB\-fprofile\-arcs\fR, it adds code so that some
+data about values of expressions in the program is gathered.
+.Sp
+With \fB\-fbranch\-probabilities\fR, it reads back the data gathered
+from profiling values of expressions and adds \fB\s-1REG_VALUE_PROFILE\s0\fR
+notes to instructions for their later usage in optimizations.
+.Sp
+Enabled with \fB\-fprofile\-generate\fR and \fB\-fprofile\-use\fR.
+.IP "\fB\-fvpt\fR" 4
+.IX Item "-fvpt"
+If combined with \fB\-fprofile\-arcs\fR, it instructs the compiler to add
+a code to gather information about values of expressions.
+.Sp
+With \fB\-fbranch\-probabilities\fR, it reads back the data gathered
+and actually performs the optimizations based on them.
+Currently the optimizations include specialization of division operation
+using the knowledge about the value of the denominator.
+.IP "\fB\-frename\-registers\fR" 4
+.IX Item "-frename-registers"
+Attempt to avoid false dependencies in scheduled code by making use
+of registers left over after register allocation. This optimization
+will most benefit processors with lots of registers. Depending on the
+debug information format adopted by the target, however, it can
+make debugging impossible, since variables will no longer stay in
+a \*(L"home register\*(R".
+.Sp
+Enabled by default with \fB\-funroll\-loops\fR.
+.IP "\fB\-ftracer\fR" 4
+.IX Item "-ftracer"
+Perform tail duplication to enlarge superblock size. This transformation
+simplifies the control flow of the function allowing other optimizations to do
+better job.
+.Sp
+Enabled with \fB\-fprofile\-use\fR.
+.IP "\fB\-funroll\-loops\fR" 4
+.IX Item "-funroll-loops"
+Unroll loops whose number of iterations can be determined at compile time or
+upon entry to the loop. \fB\-funroll\-loops\fR implies
+\&\fB\-frerun\-cse\-after\-loop\fR, \fB\-fweb\fR and \fB\-frename\-registers\fR.
+It also turns on complete loop peeling (i.e. complete removal of loops with
+small constant number of iterations). This option makes code larger, and may
+or may not make it run faster.
+.Sp
+Enabled with \fB\-fprofile\-use\fR.
+.IP "\fB\-funroll\-all\-loops\fR" 4
+.IX Item "-funroll-all-loops"
+Unroll all loops, even if their number of iterations is uncertain when
+the loop is entered. This usually makes programs run more slowly.
+\&\fB\-funroll\-all\-loops\fR implies the same options as
+\&\fB\-funroll\-loops\fR.
+.IP "\fB\-fpeel\-loops\fR" 4
+.IX Item "-fpeel-loops"
+Peels the loops for that there is enough information that they do not
+roll much (from profile feedback). It also turns on complete loop peeling
+(i.e. complete removal of loops with small constant number of iterations).
+.Sp
+Enabled with \fB\-fprofile\-use\fR.
+.IP "\fB\-fmove\-loop\-invariants\fR" 4
+.IX Item "-fmove-loop-invariants"
+Enables the loop invariant motion pass in the \s-1RTL\s0 loop optimizer. Enabled
+at level \fB\-O1\fR
+.IP "\fB\-funswitch\-loops\fR" 4
+.IX Item "-funswitch-loops"
+Move branches with loop invariant conditions out of the loop, with duplicates
+of the loop on both branches (modified according to result of the condition).
+.IP "\fB\-ffunction\-sections\fR" 4
+.IX Item "-ffunction-sections"
+.PD 0
+.IP "\fB\-fdata\-sections\fR" 4
+.IX Item "-fdata-sections"
+.PD
+Place each function or data item into its own section in the output
+file if the target supports arbitrary sections. The name of the
+function or the name of the data item determines the section's name
+in the output file.
+.Sp
+Use these options on systems where the linker can perform optimizations
+to improve locality of reference in the instruction space. Most systems
+using the \s-1ELF\s0 object format and \s-1SPARC\s0 processors running Solaris 2 have
+linkers with such optimizations. \s-1AIX\s0 may have these optimizations in
+the future.
+.Sp
+Only use these options when there are significant benefits from doing
+so. When you specify these options, the assembler and linker will
+create larger object and executable files and will also be slower.
+You will not be able to use \f(CW\*(C`gprof\*(C'\fR on all systems if you
+specify this option and you may have problems with debugging if
+you specify both this option and \fB\-g\fR.
+.IP "\fB\-fbranch\-target\-load\-optimize\fR" 4
+.IX Item "-fbranch-target-load-optimize"
+Perform branch target register load optimization before prologue / epilogue
+threading.
+The use of target registers can typically be exposed only during reload,
+thus hoisting loads out of loops and doing inter-block scheduling needs
+a separate optimization pass.
+.IP "\fB\-fbranch\-target\-load\-optimize2\fR" 4
+.IX Item "-fbranch-target-load-optimize2"
+Perform branch target register load optimization after prologue / epilogue
+threading.
+.IP "\fB\-fbtr\-bb\-exclusive\fR" 4
+.IX Item "-fbtr-bb-exclusive"
+When performing branch target register load optimization, don't reuse
+branch target registers in within any basic block.
+.IP "\fB\-fstack\-protector\fR" 4
+.IX Item "-fstack-protector"
+Emit extra code to check for buffer overflows, such as stack smashing
+attacks. This is done by adding a guard variable to functions with
+vulnerable objects. This includes functions that call alloca, and
+functions with buffers larger than 8 bytes. The guards are initialized
+when a function is entered and then checked when the function exits.
+If a guard check fails, an error message is printed and the program exits.
+.IP "\fB\-fstack\-protector\-all\fR" 4
+.IX Item "-fstack-protector-all"
+Like \fB\-fstack\-protector\fR except that all functions are protected.
+.IP "\fB\-fsection\-anchors\fR" 4
+.IX Item "-fsection-anchors"
+Try to reduce the number of symbolic address calculations by using
+shared \*(L"anchor\*(R" symbols to address nearby objects. This transformation
+can help to reduce the number of \s-1GOT\s0 entries and \s-1GOT\s0 accesses on some
+targets.
+.Sp
+For example, the implementation of the following function \f(CW\*(C`foo\*(C'\fR:
+.Sp
+.Vb 2
+\& static int a, b, c;
+\& int foo (void) { return a + b + c; }
+.Ve
+.Sp
+would usually calculate the addresses of all three variables, but if you
+compile it with \fB\-fsection\-anchors\fR, it will access the variables
+from a common anchor point instead. The effect is similar to the
+following pseudocode (which isn't valid C):
+.Sp
+.Vb 5
+\& int foo (void)
+\& {
+\& register int *xr = &x;
+\& return xr[&a \- &x] + xr[&b \- &x] + xr[&c \- &x];
+\& }
+.Ve
+.Sp
+Not all targets support this option.
+.IP "\fB\-\-param\fR \fIname\fR\fB=\fR\fIvalue\fR" 4
+.IX Item "--param name=value"
+In some places, \s-1GCC\s0 uses various constants to control the amount of
+optimization that is done. For example, \s-1GCC\s0 will not inline functions
+that contain more that a certain number of instructions. You can
+control some of these constants on the command-line using the
+\&\fB\-\-param\fR option.
+.Sp
+The names of specific parameters, and the meaning of the values, are
+tied to the internals of the compiler, and are subject to change
+without notice in future releases.
+.Sp
+In each case, the \fIvalue\fR is an integer. The allowable choices for
+\&\fIname\fR are given in the following table:
+.RS 4
+.IP "\fBsra-max-structure-size\fR" 4
+.IX Item "sra-max-structure-size"
+The maximum structure size, in bytes, at which the scalar replacement
+of aggregates (\s-1SRA\s0) optimization will perform block copies. The
+default value, 0, implies that \s-1GCC\s0 will select the most appropriate
+size itself.
+.IP "\fBsra-field-structure-ratio\fR" 4
+.IX Item "sra-field-structure-ratio"
+The threshold ratio (as a percentage) between instantiated fields and
+the complete structure size. We say that if the ratio of the number
+of bytes in instantiated fields to the number of bytes in the complete
+structure exceeds this parameter, then block copies are not used. The
+default is 75.
+.IP "\fBstruct-reorg-cold-struct-ratio\fR" 4
+.IX Item "struct-reorg-cold-struct-ratio"
+The threshold ratio (as a percentage) between a structure frequency
+and the frequency of the hottest structure in the program. This parameter
+is used by struct-reorg optimization enabled by \fB\-fipa\-struct\-reorg\fR.
+We say that if the ratio of a structure frequency, calculated by profiling,
+to the hottest structure frequency in the program is less than this
+parameter, then structure reorganization is not applied to this structure.
+The default is 10.
+.IP "\fBpredictable-branch-cost-outcome\fR" 4
+.IX Item "predictable-branch-cost-outcome"
+When branch is predicted to be taken with probability lower than this threshold
+(in percent), then it is considered well predictable. The default is 10.
+.IP "\fBmax-crossjump-edges\fR" 4
+.IX Item "max-crossjump-edges"
+The maximum number of incoming edges to consider for crossjumping.
+The algorithm used by \fB\-fcrossjumping\fR is O(N^2) in
+the number of edges incoming to each block. Increasing values mean
+more aggressive optimization, making the compile time increase with
+probably small improvement in executable size.
+.IP "\fBmin-crossjump-insns\fR" 4
+.IX Item "min-crossjump-insns"
+The minimum number of instructions which must be matched at the end
+of two blocks before crossjumping will be performed on them. This
+value is ignored in the case where all instructions in the block being
+crossjumped from are matched. The default value is 5.
+.IP "\fBmax-grow-copy-bb-insns\fR" 4
+.IX Item "max-grow-copy-bb-insns"
+The maximum code size expansion factor when copying basic blocks
+instead of jumping. The expansion is relative to a jump instruction.
+The default value is 8.
+.IP "\fBmax-goto-duplication-insns\fR" 4
+.IX Item "max-goto-duplication-insns"
+The maximum number of instructions to duplicate to a block that jumps
+to a computed goto. To avoid O(N^2) behavior in a number of
+passes, \s-1GCC\s0 factors computed gotos early in the compilation process,
+and unfactors them as late as possible. Only computed jumps at the
+end of a basic blocks with no more than max-goto-duplication-insns are
+unfactored. The default value is 8.
+.IP "\fBmax-delay-slot-insn-search\fR" 4
+.IX Item "max-delay-slot-insn-search"
+The maximum number of instructions to consider when looking for an
+instruction to fill a delay slot. If more than this arbitrary number of
+instructions is searched, the time savings from filling the delay slot
+will be minimal so stop searching. Increasing values mean more
+aggressive optimization, making the compile time increase with probably
+small improvement in executable run time.
+.IP "\fBmax-delay-slot-live-search\fR" 4
+.IX Item "max-delay-slot-live-search"
+When trying to fill delay slots, the maximum number of instructions to
+consider when searching for a block with valid live register
+information. Increasing this arbitrarily chosen value means more
+aggressive optimization, increasing the compile time. This parameter
+should be removed when the delay slot code is rewritten to maintain the
+control-flow graph.
+.IP "\fBmax-gcse-memory\fR" 4
+.IX Item "max-gcse-memory"
+The approximate maximum amount of memory that will be allocated in
+order to perform the global common subexpression elimination
+optimization. If more memory than specified is required, the
+optimization will not be done.
+.IP "\fBmax-gcse-passes\fR" 4
+.IX Item "max-gcse-passes"
+The maximum number of passes of \s-1GCSE\s0 to run. The default is 1.
+.IP "\fBmax-pending-list-length\fR" 4
+.IX Item "max-pending-list-length"
+The maximum number of pending dependencies scheduling will allow
+before flushing the current state and starting over. Large functions
+with few branches or calls can create excessively large lists which
+needlessly consume memory and resources.
+.IP "\fBmax-inline-insns-single\fR" 4
+.IX Item "max-inline-insns-single"
+Several parameters control the tree inliner used in gcc.
+This number sets the maximum number of instructions (counted in \s-1GCC\s0's
+internal representation) in a single function that the tree inliner
+will consider for inlining. This only affects functions declared
+inline and methods implemented in a class declaration (\*(C+).
+The default value is 450.
+.IP "\fBmax-inline-insns-auto\fR" 4
+.IX Item "max-inline-insns-auto"
+When you use \fB\-finline\-functions\fR (included in \fB\-O3\fR),
+a lot of functions that would otherwise not be considered for inlining
+by the compiler will be investigated. To those functions, a different
+(more restrictive) limit compared to functions declared inline can
+be applied.
+The default value is 90.
+.IP "\fBlarge-function-insns\fR" 4
+.IX Item "large-function-insns"
+The limit specifying really large functions. For functions larger than this
+limit after inlining, inlining is constrained by
+\&\fB\-\-param large-function-growth\fR. This parameter is useful primarily
+to avoid extreme compilation time caused by non-linear algorithms used by the
+backend.
+The default value is 2700.
+.IP "\fBlarge-function-growth\fR" 4
+.IX Item "large-function-growth"
+Specifies maximal growth of large function caused by inlining in percents.
+The default value is 100 which limits large function growth to 2.0 times
+the original size.
+.IP "\fBlarge-unit-insns\fR" 4
+.IX Item "large-unit-insns"
+The limit specifying large translation unit. Growth caused by inlining of
+units larger than this limit is limited by \fB\-\-param inline-unit-growth\fR.
+For small units this might be too tight (consider unit consisting of function A
+that is inline and B that just calls A three time. If B is small relative to
+A, the growth of unit is 300\e% and yet such inlining is very sane. For very
+large units consisting of small inlineable functions however the overall unit
+growth limit is needed to avoid exponential explosion of code size. Thus for
+smaller units, the size is increased to \fB\-\-param large-unit-insns\fR
+before applying \fB\-\-param inline-unit-growth\fR. The default is 10000
+.IP "\fBinline-unit-growth\fR" 4
+.IX Item "inline-unit-growth"
+Specifies maximal overall growth of the compilation unit caused by inlining.
+The default value is 30 which limits unit growth to 1.3 times the original
+size.
+.IP "\fBipcp-unit-growth\fR" 4
+.IX Item "ipcp-unit-growth"
+Specifies maximal overall growth of the compilation unit caused by
+interprocedural constant propagation. The default value is 10 which limits
+unit growth to 1.1 times the original size.
+.IP "\fBlarge-stack-frame\fR" 4
+.IX Item "large-stack-frame"
+The limit specifying large stack frames. While inlining the algorithm is trying
+to not grow past this limit too much. Default value is 256 bytes.
+.IP "\fBlarge-stack-frame-growth\fR" 4
+.IX Item "large-stack-frame-growth"
+Specifies maximal growth of large stack frames caused by inlining in percents.
+The default value is 1000 which limits large stack frame growth to 11 times
+the original size.
+.IP "\fBmax-inline-insns-recursive\fR" 4
+.IX Item "max-inline-insns-recursive"
+.PD 0
+.IP "\fBmax-inline-insns-recursive-auto\fR" 4
+.IX Item "max-inline-insns-recursive-auto"
+.PD
+Specifies maximum number of instructions out-of-line copy of self recursive inline
+function can grow into by performing recursive inlining.
+.Sp
+For functions declared inline \fB\-\-param max-inline-insns-recursive\fR is
+taken into account. For function not declared inline, recursive inlining
+happens only when \fB\-finline\-functions\fR (included in \fB\-O3\fR) is
+enabled and \fB\-\-param max-inline-insns-recursive-auto\fR is used. The
+default value is 450.
+.IP "\fBmax-inline-recursive-depth\fR" 4
+.IX Item "max-inline-recursive-depth"
+.PD 0
+.IP "\fBmax-inline-recursive-depth-auto\fR" 4
+.IX Item "max-inline-recursive-depth-auto"
+.PD
+Specifies maximum recursion depth used by the recursive inlining.
+.Sp
+For functions declared inline \fB\-\-param max-inline-recursive-depth\fR is
+taken into account. For function not declared inline, recursive inlining
+happens only when \fB\-finline\-functions\fR (included in \fB\-O3\fR) is
+enabled and \fB\-\-param max-inline-recursive-depth-auto\fR is used. The
+default value is 8.
+.IP "\fBmin-inline-recursive-probability\fR" 4
+.IX Item "min-inline-recursive-probability"
+Recursive inlining is profitable only for function having deep recursion
+in average and can hurt for function having little recursion depth by
+increasing the prologue size or complexity of function body to other
+optimizers.
+.Sp
+When profile feedback is available (see \fB\-fprofile\-generate\fR) the actual
+recursion depth can be guessed from probability that function will recurse via
+given call expression. This parameter limits inlining only to call expression
+whose probability exceeds given threshold (in percents). The default value is
+10.
+.IP "\fBinline-call-cost\fR" 4
+.IX Item "inline-call-cost"
+Specify cost of call instruction relative to simple arithmetics operations
+(having cost of 1). Increasing this cost disqualifies inlining of non-leaf
+functions and at the same time increases size of leaf function that is believed to
+reduce function size by being inlined. In effect it increases amount of
+inlining for code having large abstraction penalty (many functions that just
+pass the arguments to other functions) and decrease inlining for code with low
+abstraction penalty. The default value is 12.
+.IP "\fBmin-vect-loop-bound\fR" 4
+.IX Item "min-vect-loop-bound"
+The minimum number of iterations under which a loop will not get vectorized
+when \fB\-ftree\-vectorize\fR is used. The number of iterations after
+vectorization needs to be greater than the value specified by this option
+to allow vectorization. The default value is 0.
+.IP "\fBmax-unrolled-insns\fR" 4
+.IX Item "max-unrolled-insns"
+The maximum number of instructions that a loop should have if that loop
+is unrolled, and if the loop is unrolled, it determines how many times
+the loop code is unrolled.
+.IP "\fBmax-average-unrolled-insns\fR" 4
+.IX Item "max-average-unrolled-insns"
+The maximum number of instructions biased by probabilities of their execution
+that a loop should have if that loop is unrolled, and if the loop is unrolled,
+it determines how many times the loop code is unrolled.
+.IP "\fBmax-unroll-times\fR" 4
+.IX Item "max-unroll-times"
+The maximum number of unrollings of a single loop.
+.IP "\fBmax-peeled-insns\fR" 4
+.IX Item "max-peeled-insns"
+The maximum number of instructions that a loop should have if that loop
+is peeled, and if the loop is peeled, it determines how many times
+the loop code is peeled.
+.IP "\fBmax-peel-times\fR" 4
+.IX Item "max-peel-times"
+The maximum number of peelings of a single loop.
+.IP "\fBmax-completely-peeled-insns\fR" 4
+.IX Item "max-completely-peeled-insns"
+The maximum number of insns of a completely peeled loop.
+.IP "\fBmax-completely-peel-times\fR" 4
+.IX Item "max-completely-peel-times"
+The maximum number of iterations of a loop to be suitable for complete peeling.
+.IP "\fBmax-unswitch-insns\fR" 4
+.IX Item "max-unswitch-insns"
+The maximum number of insns of an unswitched loop.
+.IP "\fBmax-unswitch-level\fR" 4
+.IX Item "max-unswitch-level"
+The maximum number of branches unswitched in a single loop.
+.IP "\fBlim-expensive\fR" 4
+.IX Item "lim-expensive"
+The minimum cost of an expensive expression in the loop invariant motion.
+.IP "\fBiv-consider-all-candidates-bound\fR" 4
+.IX Item "iv-consider-all-candidates-bound"
+Bound on number of candidates for induction variables below that
+all candidates are considered for each use in induction variable
+optimizations. Only the most relevant candidates are considered
+if there are more candidates, to avoid quadratic time complexity.
+.IP "\fBiv-max-considered-uses\fR" 4
+.IX Item "iv-max-considered-uses"
+The induction variable optimizations give up on loops that contain more
+induction variable uses.
+.IP "\fBiv-always-prune-cand-set-bound\fR" 4
+.IX Item "iv-always-prune-cand-set-bound"
+If number of candidates in the set is smaller than this value,
+we always try to remove unnecessary ivs from the set during its
+optimization when a new iv is added to the set.
+.IP "\fBscev-max-expr-size\fR" 4
+.IX Item "scev-max-expr-size"
+Bound on size of expressions used in the scalar evolutions analyzer.
+Large expressions slow the analyzer.
+.IP "\fBomega-max-vars\fR" 4
+.IX Item "omega-max-vars"
+The maximum number of variables in an Omega constraint system.
+The default value is 128.
+.IP "\fBomega-max-geqs\fR" 4
+.IX Item "omega-max-geqs"
+The maximum number of inequalities in an Omega constraint system.
+The default value is 256.
+.IP "\fBomega-max-eqs\fR" 4
+.IX Item "omega-max-eqs"
+The maximum number of equalities in an Omega constraint system.
+The default value is 128.
+.IP "\fBomega-max-wild-cards\fR" 4
+.IX Item "omega-max-wild-cards"
+The maximum number of wildcard variables that the Omega solver will
+be able to insert. The default value is 18.
+.IP "\fBomega-hash-table-size\fR" 4
+.IX Item "omega-hash-table-size"
+The size of the hash table in the Omega solver. The default value is
+550.
+.IP "\fBomega-max-keys\fR" 4
+.IX Item "omega-max-keys"
+The maximal number of keys used by the Omega solver. The default
+value is 500.
+.IP "\fBomega-eliminate-redundant-constraints\fR" 4
+.IX Item "omega-eliminate-redundant-constraints"
+When set to 1, use expensive methods to eliminate all redundant
+constraints. The default value is 0.
+.IP "\fBvect-max-version-for-alignment-checks\fR" 4
+.IX Item "vect-max-version-for-alignment-checks"
+The maximum number of runtime checks that can be performed when
+doing loop versioning for alignment in the vectorizer. See option
+ftree-vect-loop-version for more information.
+.IP "\fBvect-max-version-for-alias-checks\fR" 4
+.IX Item "vect-max-version-for-alias-checks"
+The maximum number of runtime checks that can be performed when
+doing loop versioning for alias in the vectorizer. See option
+ftree-vect-loop-version for more information.
+.IP "\fBmax-iterations-to-track\fR" 4
+.IX Item "max-iterations-to-track"
+The maximum number of iterations of a loop the brute force algorithm
+for analysis of # of iterations of the loop tries to evaluate.
+.IP "\fBhot-bb-count-fraction\fR" 4
+.IX Item "hot-bb-count-fraction"
+Select fraction of the maximal count of repetitions of basic block in program
+given basic block needs to have to be considered hot.
+.IP "\fBhot-bb-frequency-fraction\fR" 4
+.IX Item "hot-bb-frequency-fraction"
+Select fraction of the maximal frequency of executions of basic block in
+function given basic block needs to have to be considered hot
+.IP "\fBmax-predicted-iterations\fR" 4
+.IX Item "max-predicted-iterations"
+The maximum number of loop iterations we predict statically. This is useful
+in cases where function contain single loop with known bound and other loop
+with unknown. We predict the known number of iterations correctly, while
+the unknown number of iterations average to roughly 10. This means that the
+loop without bounds would appear artificially cold relative to the other one.
+.IP "\fBalign-threshold\fR" 4
+.IX Item "align-threshold"
+Select fraction of the maximal frequency of executions of basic block in
+function given basic block will get aligned.
+.IP "\fBalign-loop-iterations\fR" 4
+.IX Item "align-loop-iterations"
+A loop expected to iterate at lest the selected number of iterations will get
+aligned.
+.IP "\fBtracer-dynamic-coverage\fR" 4
+.IX Item "tracer-dynamic-coverage"
+.PD 0
+.IP "\fBtracer-dynamic-coverage-feedback\fR" 4
+.IX Item "tracer-dynamic-coverage-feedback"
+.PD
+This value is used to limit superblock formation once the given percentage of
+executed instructions is covered. This limits unnecessary code size
+expansion.
+.Sp
+The \fBtracer-dynamic-coverage-feedback\fR is used only when profile
+feedback is available. The real profiles (as opposed to statically estimated
+ones) are much less balanced allowing the threshold to be larger value.
+.IP "\fBtracer-max-code-growth\fR" 4
+.IX Item "tracer-max-code-growth"
+Stop tail duplication once code growth has reached given percentage. This is
+rather hokey argument, as most of the duplicates will be eliminated later in
+cross jumping, so it may be set to much higher values than is the desired code
+growth.
+.IP "\fBtracer-min-branch-ratio\fR" 4
+.IX Item "tracer-min-branch-ratio"
+Stop reverse growth when the reverse probability of best edge is less than this
+threshold (in percent).
+.IP "\fBtracer-min-branch-ratio\fR" 4
+.IX Item "tracer-min-branch-ratio"
+.PD 0
+.IP "\fBtracer-min-branch-ratio-feedback\fR" 4
+.IX Item "tracer-min-branch-ratio-feedback"
+.PD
+Stop forward growth if the best edge do have probability lower than this
+threshold.
+.Sp
+Similarly to \fBtracer-dynamic-coverage\fR two values are present, one for
+compilation for profile feedback and one for compilation without. The value
+for compilation with profile feedback needs to be more conservative (higher) in
+order to make tracer effective.
+.IP "\fBmax-cse-path-length\fR" 4
+.IX Item "max-cse-path-length"
+Maximum number of basic blocks on path that cse considers. The default is 10.
+.IP "\fBmax-cse-insns\fR" 4
+.IX Item "max-cse-insns"
+The maximum instructions \s-1CSE\s0 process before flushing. The default is 1000.
+.IP "\fBmax-aliased-vops\fR" 4
+.IX Item "max-aliased-vops"
+Maximum number of virtual operands per function allowed to represent
+aliases before triggering the alias partitioning heuristic. Alias
+partitioning reduces compile times and memory consumption needed for
+aliasing at the expense of precision loss in alias information. The
+default value for this parameter is 100 for \-O1, 500 for \-O2 and 1000
+for \-O3.
+.Sp
+Notice that if a function contains more memory statements than the
+value of this parameter, it is not really possible to achieve this
+reduction. In this case, the compiler will use the number of memory
+statements as the value for \fBmax-aliased-vops\fR.
+.IP "\fBavg-aliased-vops\fR" 4
+.IX Item "avg-aliased-vops"
+Average number of virtual operands per statement allowed to represent
+aliases before triggering the alias partitioning heuristic. This
+works in conjunction with \fBmax-aliased-vops\fR. If a function
+contains more than \fBmax-aliased-vops\fR virtual operators, then
+memory symbols will be grouped into memory partitions until either the
+total number of virtual operators is below \fBmax-aliased-vops\fR
+or the average number of virtual operators per memory statement is
+below \fBavg-aliased-vops\fR. The default value for this parameter
+is 1 for \-O1 and \-O2, and 3 for \-O3.
+.IP "\fBggc-min-expand\fR" 4
+.IX Item "ggc-min-expand"
+\&\s-1GCC\s0 uses a garbage collector to manage its own memory allocation. This
+parameter specifies the minimum percentage by which the garbage
+collector's heap should be allowed to expand between collections.
+Tuning this may improve compilation speed; it has no effect on code
+generation.
+.Sp
+The default is 30% + 70% * (\s-1RAM/1GB\s0) with an upper bound of 100% when
+\&\s-1RAM\s0 >= 1GB. If \f(CW\*(C`getrlimit\*(C'\fR is available, the notion of \*(L"\s-1RAM\s0\*(R" is
+the smallest of actual \s-1RAM\s0 and \f(CW\*(C`RLIMIT_DATA\*(C'\fR or \f(CW\*(C`RLIMIT_AS\*(C'\fR. If
+\&\s-1GCC\s0 is not able to calculate \s-1RAM\s0 on a particular platform, the lower
+bound of 30% is used. Setting this parameter and
+\&\fBggc-min-heapsize\fR to zero causes a full collection to occur at
+every opportunity. This is extremely slow, but can be useful for
+debugging.
+.IP "\fBggc-min-heapsize\fR" 4
+.IX Item "ggc-min-heapsize"
+Minimum size of the garbage collector's heap before it begins bothering
+to collect garbage. The first collection occurs after the heap expands
+by \fBggc-min-expand\fR% beyond \fBggc-min-heapsize\fR. Again,
+tuning this may improve compilation speed, and has no effect on code
+generation.
+.Sp
+The default is the smaller of \s-1RAM/8\s0, \s-1RLIMIT_RSS\s0, or a limit which
+tries to ensure that \s-1RLIMIT_DATA\s0 or \s-1RLIMIT_AS\s0 are not exceeded, but
+with a lower bound of 4096 (four megabytes) and an upper bound of
+131072 (128 megabytes). If \s-1GCC\s0 is not able to calculate \s-1RAM\s0 on a
+particular platform, the lower bound is used. Setting this parameter
+very large effectively disables garbage collection. Setting this
+parameter and \fBggc-min-expand\fR to zero causes a full collection
+to occur at every opportunity.
+.IP "\fBmax-reload-search-insns\fR" 4
+.IX Item "max-reload-search-insns"
+The maximum number of instruction reload should look backward for equivalent
+register. Increasing values mean more aggressive optimization, making the
+compile time increase with probably slightly better performance. The default
+value is 100.
+.IP "\fBmax-cselib-memory-locations\fR" 4
+.IX Item "max-cselib-memory-locations"
+The maximum number of memory locations cselib should take into account.
+Increasing values mean more aggressive optimization, making the compile time
+increase with probably slightly better performance. The default value is 500.
+.IP "\fBreorder-blocks-duplicate\fR" 4
+.IX Item "reorder-blocks-duplicate"
+.PD 0
+.IP "\fBreorder-blocks-duplicate-feedback\fR" 4
+.IX Item "reorder-blocks-duplicate-feedback"
+.PD
+Used by basic block reordering pass to decide whether to use unconditional
+branch or duplicate the code on its destination. Code is duplicated when its
+estimated size is smaller than this value multiplied by the estimated size of
+unconditional jump in the hot spots of the program.
+.Sp
+The \fBreorder-block-duplicate-feedback\fR is used only when profile
+feedback is available and may be set to higher values than
+\&\fBreorder-block-duplicate\fR since information about the hot spots is more
+accurate.
+.IP "\fBmax-sched-ready-insns\fR" 4
+.IX Item "max-sched-ready-insns"
+The maximum number of instructions ready to be issued the scheduler should
+consider at any given time during the first scheduling pass. Increasing
+values mean more thorough searches, making the compilation time increase
+with probably little benefit. The default value is 100.
+.IP "\fBmax-sched-region-blocks\fR" 4
+.IX Item "max-sched-region-blocks"
+The maximum number of blocks in a region to be considered for
+interblock scheduling. The default value is 10.
+.IP "\fBmax-pipeline-region-blocks\fR" 4
+.IX Item "max-pipeline-region-blocks"
+The maximum number of blocks in a region to be considered for
+pipelining in the selective scheduler. The default value is 15.
+.IP "\fBmax-sched-region-insns\fR" 4
+.IX Item "max-sched-region-insns"
+The maximum number of insns in a region to be considered for
+interblock scheduling. The default value is 100.
+.IP "\fBmax-pipeline-region-insns\fR" 4
+.IX Item "max-pipeline-region-insns"
+The maximum number of insns in a region to be considered for
+pipelining in the selective scheduler. The default value is 200.
+.IP "\fBmin-spec-prob\fR" 4
+.IX Item "min-spec-prob"
+The minimum probability (in percents) of reaching a source block
+for interblock speculative scheduling. The default value is 40.
+.IP "\fBmax-sched-extend-regions-iters\fR" 4
+.IX Item "max-sched-extend-regions-iters"
+The maximum number of iterations through \s-1CFG\s0 to extend regions.
+0 \- disable region extension,
+N \- do at most N iterations.
+The default value is 0.
+.IP "\fBmax-sched-insn-conflict-delay\fR" 4
+.IX Item "max-sched-insn-conflict-delay"
+The maximum conflict delay for an insn to be considered for speculative motion.
+The default value is 3.
+.IP "\fBsched-spec-prob-cutoff\fR" 4
+.IX Item "sched-spec-prob-cutoff"
+The minimal probability of speculation success (in percents), so that
+speculative insn will be scheduled.
+The default value is 40.
+.IP "\fBsched-mem-true-dep-cost\fR" 4
+.IX Item "sched-mem-true-dep-cost"
+Minimal distance (in \s-1CPU\s0 cycles) between store and load targeting same
+memory locations. The default value is 1.
+.IP "\fBselsched-max-lookahead\fR" 4
+.IX Item "selsched-max-lookahead"
+The maximum size of the lookahead window of selective scheduling. It is a
+depth of search for available instructions.
+The default value is 50.
+.IP "\fBselsched-max-sched-times\fR" 4
+.IX Item "selsched-max-sched-times"
+The maximum number of times that an instruction will be scheduled during
+selective scheduling. This is the limit on the number of iterations
+through which the instruction may be pipelined. The default value is 2.
+.IP "\fBselsched-max-insns-to-rename\fR" 4
+.IX Item "selsched-max-insns-to-rename"
+The maximum number of best instructions in the ready list that are considered
+for renaming in the selective scheduler. The default value is 2.
+.IP "\fBmax-last-value-rtl\fR" 4
+.IX Item "max-last-value-rtl"
+The maximum size measured as number of RTLs that can be recorded in an expression
+in combiner for a pseudo register as last known value of that register. The default
+is 10000.
+.IP "\fBinteger-share-limit\fR" 4
+.IX Item "integer-share-limit"
+Small integer constants can use a shared data structure, reducing the
+compiler's memory usage and increasing its speed. This sets the maximum
+value of a shared integer constant. The default value is 256.
+.IP "\fBmin-virtual-mappings\fR" 4
+.IX Item "min-virtual-mappings"
+Specifies the minimum number of virtual mappings in the incremental
+\&\s-1SSA\s0 updater that should be registered to trigger the virtual mappings
+heuristic defined by virtual-mappings-ratio. The default value is
+100.
+.IP "\fBvirtual-mappings-ratio\fR" 4
+.IX Item "virtual-mappings-ratio"
+If the number of virtual mappings is virtual-mappings-ratio bigger
+than the number of virtual symbols to be updated, then the incremental
+\&\s-1SSA\s0 updater switches to a full update for those symbols. The default
+ratio is 3.
+.IP "\fBssp-buffer-size\fR" 4
+.IX Item "ssp-buffer-size"
+The minimum size of buffers (i.e. arrays) that will receive stack smashing
+protection when \fB\-fstack\-protection\fR is used.
+.IP "\fBmax-jump-thread-duplication-stmts\fR" 4
+.IX Item "max-jump-thread-duplication-stmts"
+Maximum number of statements allowed in a block that needs to be
+duplicated when threading jumps.
+.IP "\fBmax-fields-for-field-sensitive\fR" 4
+.IX Item "max-fields-for-field-sensitive"
+Maximum number of fields in a structure we will treat in
+a field sensitive manner during pointer analysis. The default is zero
+for \-O0, and \-O1 and 100 for \-Os, \-O2, and \-O3.
+.IP "\fBprefetch-latency\fR" 4
+.IX Item "prefetch-latency"
+Estimate on average number of instructions that are executed before
+prefetch finishes. The distance we prefetch ahead is proportional
+to this constant. Increasing this number may also lead to less
+streams being prefetched (see \fBsimultaneous-prefetches\fR).
+.IP "\fBsimultaneous-prefetches\fR" 4
+.IX Item "simultaneous-prefetches"
+Maximum number of prefetches that can run at the same time.
+.IP "\fBl1\-cache\-line\-size\fR" 4
+.IX Item "l1-cache-line-size"
+The size of cache line in L1 cache, in bytes.
+.IP "\fBl1\-cache\-size\fR" 4
+.IX Item "l1-cache-size"
+The size of L1 cache, in kilobytes.
+.IP "\fBl2\-cache\-size\fR" 4
+.IX Item "l2-cache-size"
+The size of L2 cache, in kilobytes.
+.IP "\fBuse-canonical-types\fR" 4
+.IX Item "use-canonical-types"
+Whether the compiler should use the \*(L"canonical\*(R" type system. By
+default, this should always be 1, which uses a more efficient internal
+mechanism for comparing types in \*(C+ and Objective\-\*(C+. However, if
+bugs in the canonical type system are causing compilation failures,
+set this value to 0 to disable canonical types.
+.IP "\fBswitch-conversion-max-branch-ratio\fR" 4
+.IX Item "switch-conversion-max-branch-ratio"
+Switch initialization conversion will refuse to create arrays that are
+bigger than \fBswitch-conversion-max-branch-ratio\fR times the number of
+branches in the switch.
+.IP "\fBmax-partial-antic-length\fR" 4
+.IX Item "max-partial-antic-length"
+Maximum length of the partial antic set computed during the tree
+partial redundancy elimination optimization (\fB\-ftree\-pre\fR) when
+optimizing at \fB\-O3\fR and above. For some sorts of source code
+the enhanced partial redundancy elimination optimization can run away,
+consuming all of the memory available on the host machine. This
+parameter sets a limit on the length of the sets that are computed,
+which prevents the runaway behavior. Setting a value of 0 for
+this parameter will allow an unlimited set length.
+.IP "\fBsccvn-max-scc-size\fR" 4
+.IX Item "sccvn-max-scc-size"
+Maximum size of a strongly connected component (\s-1SCC\s0) during \s-1SCCVN\s0
+processing. If this limit is hit, \s-1SCCVN\s0 processing for the whole
+function will not be done and optimizations depending on it will
+be disabled. The default maximum \s-1SCC\s0 size is 10000.
+.IP "\fBira-max-loops-num\fR" 4
+.IX Item "ira-max-loops-num"
+\&\s-1IRA\s0 uses a regional register allocation by default. If a function
+contains loops more than number given by the parameter, only at most
+given number of the most frequently executed loops will form regions
+for the regional register allocation. The default value of the
+parameter is 100.
+.IP "\fBira-max-conflict-table-size\fR" 4
+.IX Item "ira-max-conflict-table-size"
+Although \s-1IRA\s0 uses a sophisticated algorithm of compression conflict
+table, the table can be still big for huge functions. If the conflict
+table for a function could be more than size in \s-1MB\s0 given by the
+parameter, the conflict table is not built and faster, simpler, and
+lower quality register allocation algorithm will be used. The
+algorithm do not use pseudo-register conflicts. The default value of
+the parameter is 2000.
+.IP "\fBloop-invariant-max-bbs-in-loop\fR" 4
+.IX Item "loop-invariant-max-bbs-in-loop"
+Loop invariant motion can be very expensive, both in compile time and
+in amount of needed compile time memory, with very large loops. Loops
+with more basic blocks than this parameter won't have loop invariant
+motion optimization performed on them. The default value of the
+parameter is 1000 for \-O1 and 10000 for \-O2 and above.
+.RE
+.RS 4
+.RE
+.Sh "Options Controlling the Preprocessor"
+.IX Subsection "Options Controlling the Preprocessor"
+These options control the C preprocessor, which is run on each C source
+file before actual compilation.
+.PP
+If you use the \fB\-E\fR option, nothing is done except preprocessing.
+Some of these options make sense only together with \fB\-E\fR because
+they cause the preprocessor output to be unsuitable for actual
+compilation.
+.Sp
+.RS 4
+You can use \fB\-Wp,\fR\fIoption\fR to bypass the compiler driver
+and pass \fIoption\fR directly through to the preprocessor. If
+\&\fIoption\fR contains commas, it is split into multiple options at the
+commas. However, many options are modified, translated or interpreted
+by the compiler driver before being passed to the preprocessor, and
+\&\fB\-Wp\fR forcibly bypasses this phase. The preprocessor's direct
+interface is undocumented and subject to change, so whenever possible
+you should avoid using \fB\-Wp\fR and let the driver handle the
+options instead.
+.Sp
+\&\fB\-Xpreprocessor\fR \fIoption\fR
+.Sp
+Pass \fIoption\fR as an option to the preprocessor. You can use this to
+supply system-specific preprocessor options which \s-1GCC\s0 does not know how to
+recognize.
+.Sp
+If you want to pass an option that takes an argument, you must use
+\&\fB\-Xpreprocessor\fR twice, once for the option and once for the argument.
+.RE
+.IP "\fB\-D\fR \fIname\fR" 4
+.IX Item "-D name"
+Predefine \fIname\fR as a macro, with definition \f(CW1\fR.
+.IP "\fB\-D\fR \fIname\fR\fB=\fR\fIdefinition\fR" 4
+.IX Item "-D name=definition"
+The contents of \fIdefinition\fR are tokenized and processed as if
+they appeared during translation phase three in a \fB#define\fR
+directive. In particular, the definition will be truncated by
+embedded newline characters.
+.Sp
+If you are invoking the preprocessor from a shell or shell-like
+program you may need to use the shell's quoting syntax to protect
+characters such as spaces that have a meaning in the shell syntax.
+.Sp
+If you wish to define a function-like macro on the command line, write
+its argument list with surrounding parentheses before the equals sign
+(if any). Parentheses are meaningful to most shells, so you will need
+to quote the option. With \fBsh\fR and \fBcsh\fR,
+\&\fB\-D'\fR\fIname\fR\fB(\fR\fIargs...\fR\fB)=\fR\fIdefinition\fR\fB'\fR works.
+.Sp
+\&\fB\-D\fR and \fB\-U\fR options are processed in the order they
+are given on the command line. All \fB\-imacros\fR \fIfile\fR and
+\&\fB\-include\fR \fIfile\fR options are processed after all
+\&\fB\-D\fR and \fB\-U\fR options.
+.IP "\fB\-U\fR \fIname\fR" 4
+.IX Item "-U name"
+Cancel any previous definition of \fIname\fR, either built in or
+provided with a \fB\-D\fR option.
+.IP "\fB\-undef\fR" 4
+.IX Item "-undef"
+Do not predefine any system-specific or GCC-specific macros. The
+standard predefined macros remain defined.
+.IP "\fB\-I\fR \fIdir\fR" 4
+.IX Item "-I dir"
+Add the directory \fIdir\fR to the list of directories to be searched
+for header files.
+Directories named by \fB\-I\fR are searched before the standard
+system include directories. If the directory \fIdir\fR is a standard
+system include directory, the option is ignored to ensure that the
+default search order for system directories and the special treatment
+of system headers are not defeated
+\&.
+If \fIdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced
+by the sysroot prefix; see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
+.IP "\fB\-o\fR \fIfile\fR" 4
+.IX Item "-o file"
+Write output to \fIfile\fR. This is the same as specifying \fIfile\fR
+as the second non-option argument to \fBcpp\fR. \fBgcc\fR has a
+different interpretation of a second non-option argument, so you must
+use \fB\-o\fR to specify the output file.
+.IP "\fB\-Wall\fR" 4
+.IX Item "-Wall"
+Turns on all optional warnings which are desirable for normal code.
+At present this is \fB\-Wcomment\fR, \fB\-Wtrigraphs\fR,
+\&\fB\-Wmultichar\fR and a warning about integer promotion causing a
+change of sign in \f(CW\*(C`#if\*(C'\fR expressions. Note that many of the
+preprocessor's warnings are on by default and have no options to
+control them.
+.IP "\fB\-Wcomment\fR" 4
+.IX Item "-Wcomment"
+.PD 0
+.IP "\fB\-Wcomments\fR" 4
+.IX Item "-Wcomments"
+.PD
+Warn whenever a comment-start sequence \fB/*\fR appears in a \fB/*\fR
+comment, or whenever a backslash-newline appears in a \fB//\fR comment.
+(Both forms have the same effect.)
+.IP "\fB\-Wtrigraphs\fR" 4
+.IX Item "-Wtrigraphs"
+Most trigraphs in comments cannot affect the meaning of the program.
+However, a trigraph that would form an escaped newline (\fB??/\fR at
+the end of a line) can, by changing where the comment begins or ends.
+Therefore, only trigraphs that would form escaped newlines produce
+warnings inside a comment.
+.Sp
+This option is implied by \fB\-Wall\fR. If \fB\-Wall\fR is not
+given, this option is still enabled unless trigraphs are enabled. To
+get trigraph conversion without warnings, but get the other
+\&\fB\-Wall\fR warnings, use \fB\-trigraphs \-Wall \-Wno\-trigraphs\fR.
+.IP "\fB\-Wtraditional\fR" 4
+.IX Item "-Wtraditional"
+Warn about certain constructs that behave differently in traditional and
+\&\s-1ISO\s0 C. Also warn about \s-1ISO\s0 C constructs that have no traditional C
+equivalent, and problematic constructs which should be avoided.
+.IP "\fB\-Wundef\fR" 4
+.IX Item "-Wundef"
+Warn whenever an identifier which is not a macro is encountered in an
+\&\fB#if\fR directive, outside of \fBdefined\fR. Such identifiers are
+replaced with zero.
+.IP "\fB\-Wunused\-macros\fR" 4
+.IX Item "-Wunused-macros"
+Warn about macros defined in the main file that are unused. A macro
+is \fIused\fR if it is expanded or tested for existence at least once.
+The preprocessor will also warn if the macro has not been used at the
+time it is redefined or undefined.
+.Sp
+Built-in macros, macros defined on the command line, and macros
+defined in include files are not warned about.
+.Sp
+\&\fINote:\fR If a macro is actually used, but only used in skipped
+conditional blocks, then \s-1CPP\s0 will report it as unused. To avoid the
+warning in such a case, you might improve the scope of the macro's
+definition by, for example, moving it into the first skipped block.
+Alternatively, you could provide a dummy use with something like:
+.Sp
+.Vb 2
+\& #if defined the_macro_causing_the_warning
+\& #endif
+.Ve
+.IP "\fB\-Wendif\-labels\fR" 4
+.IX Item "-Wendif-labels"
+Warn whenever an \fB#else\fR or an \fB#endif\fR are followed by text.
+This usually happens in code of the form
+.Sp
+.Vb 5
+\& #if FOO
+\& ...
+\& #else FOO
+\& ...
+\& #endif FOO
+.Ve
+.Sp
+The second and third \f(CW\*(C`FOO\*(C'\fR should be in comments, but often are not
+in older programs. This warning is on by default.
+.IP "\fB\-Werror\fR" 4
+.IX Item "-Werror"
+Make all warnings into hard errors. Source code which triggers warnings
+will be rejected.
+.IP "\fB\-Wsystem\-headers\fR" 4
+.IX Item "-Wsystem-headers"
+Issue warnings for code in system headers. These are normally unhelpful
+in finding bugs in your own code, therefore suppressed. If you are
+responsible for the system library, you may want to see them.
+.IP "\fB\-w\fR" 4
+.IX Item "-w"
+Suppress all warnings, including those which \s-1GNU\s0 \s-1CPP\s0 issues by default.
+.IP "\fB\-pedantic\fR" 4
+.IX Item "-pedantic"
+Issue all the mandatory diagnostics listed in the C standard. Some of
+them are left out by default, since they trigger frequently on harmless
+code.
+.IP "\fB\-pedantic\-errors\fR" 4
+.IX Item "-pedantic-errors"
+Issue all the mandatory diagnostics, and make all mandatory diagnostics
+into errors. This includes mandatory diagnostics that \s-1GCC\s0 issues
+without \fB\-pedantic\fR but treats as warnings.
+.IP "\fB\-M\fR" 4
+.IX Item "-M"
+Instead of outputting the result of preprocessing, output a rule
+suitable for \fBmake\fR describing the dependencies of the main
+source file. The preprocessor outputs one \fBmake\fR rule containing
+the object file name for that source file, a colon, and the names of all
+the included files, including those coming from \fB\-include\fR or
+\&\fB\-imacros\fR command line options.
+.Sp
+Unless specified explicitly (with \fB\-MT\fR or \fB\-MQ\fR), the
+object file name consists of the name of the source file with any
+suffix replaced with object file suffix and with any leading directory
+parts removed. If there are many included files then the rule is
+split into several lines using \fB\e\fR\-newline. The rule has no
+commands.
+.Sp
+This option does not suppress the preprocessor's debug output, such as
+\&\fB\-dM\fR. To avoid mixing such debug output with the dependency
+rules you should explicitly specify the dependency output file with
+\&\fB\-MF\fR, or use an environment variable like
+\&\fB\s-1DEPENDENCIES_OUTPUT\s0\fR. Debug output
+will still be sent to the regular output stream as normal.
+.Sp
+Passing \fB\-M\fR to the driver implies \fB\-E\fR, and suppresses
+warnings with an implicit \fB\-w\fR.
+.IP "\fB\-MM\fR" 4
+.IX Item "-MM"
+Like \fB\-M\fR but do not mention header files that are found in
+system header directories, nor header files that are included,
+directly or indirectly, from such a header.
+.Sp
+This implies that the choice of angle brackets or double quotes in an
+\&\fB#include\fR directive does not in itself determine whether that
+header will appear in \fB\-MM\fR dependency output. This is a
+slight change in semantics from \s-1GCC\s0 versions 3.0 and earlier.
+.IP "\fB\-MF\fR \fIfile\fR" 4
+.IX Item "-MF file"
+When used with \fB\-M\fR or \fB\-MM\fR, specifies a
+file to write the dependencies to. If no \fB\-MF\fR switch is given
+the preprocessor sends the rules to the same place it would have sent
+preprocessed output.
+.Sp
+When used with the driver options \fB\-MD\fR or \fB\-MMD\fR,
+\&\fB\-MF\fR overrides the default dependency output file.
+.IP "\fB\-MG\fR" 4
+.IX Item "-MG"
+In conjunction with an option such as \fB\-M\fR requesting
+dependency generation, \fB\-MG\fR assumes missing header files are
+generated files and adds them to the dependency list without raising
+an error. The dependency filename is taken directly from the
+\&\f(CW\*(C`#include\*(C'\fR directive without prepending any path. \fB\-MG\fR
+also suppresses preprocessed output, as a missing header file renders
+this useless.
+.Sp
+This feature is used in automatic updating of makefiles.
+.IP "\fB\-MP\fR" 4
+.IX Item "-MP"
+This option instructs \s-1CPP\s0 to add a phony target for each dependency
+other than the main file, causing each to depend on nothing. These
+dummy rules work around errors \fBmake\fR gives if you remove header
+files without updating the \fIMakefile\fR to match.
+.Sp
+This is typical output:
+.Sp
+.Vb 1
+\& test.o: test.c test.h
+\&
+\& test.h:
+.Ve
+.IP "\fB\-MT\fR \fItarget\fR" 4
+.IX Item "-MT target"
+Change the target of the rule emitted by dependency generation. By
+default \s-1CPP\s0 takes the name of the main input file, deletes any
+directory components and any file suffix such as \fB.c\fR, and
+appends the platform's usual object suffix. The result is the target.
+.Sp
+An \fB\-MT\fR option will set the target to be exactly the string you
+specify. If you want multiple targets, you can specify them as a single
+argument to \fB\-MT\fR, or use multiple \fB\-MT\fR options.
+.Sp
+For example, \fB\-MT\ '$(objpfx)foo.o'\fR might give
+.Sp
+.Vb 1
+\& $(objpfx)foo.o: foo.c
+.Ve
+.IP "\fB\-MQ\fR \fItarget\fR" 4
+.IX Item "-MQ target"
+Same as \fB\-MT\fR, but it quotes any characters which are special to
+Make. \fB\-MQ\ '$(objpfx)foo.o'\fR gives
+.Sp
+.Vb 1
+\& $$(objpfx)foo.o: foo.c
+.Ve
+.Sp
+The default target is automatically quoted, as if it were given with
+\&\fB\-MQ\fR.
+.IP "\fB\-MD\fR" 4
+.IX Item "-MD"
+\&\fB\-MD\fR is equivalent to \fB\-M \-MF\fR \fIfile\fR, except that
+\&\fB\-E\fR is not implied. The driver determines \fIfile\fR based on
+whether an \fB\-o\fR option is given. If it is, the driver uses its
+argument but with a suffix of \fI.d\fR, otherwise it takes the name
+of the input file, removes any directory components and suffix, and
+applies a \fI.d\fR suffix.
+.Sp
+If \fB\-MD\fR is used in conjunction with \fB\-E\fR, any
+\&\fB\-o\fR switch is understood to specify the dependency output file, but if used without \fB\-E\fR, each \fB\-o\fR
+is understood to specify a target object file.
+.Sp
+Since \fB\-E\fR is not implied, \fB\-MD\fR can be used to generate
+a dependency output file as a side-effect of the compilation process.
+.IP "\fB\-MMD\fR" 4
+.IX Item "-MMD"
+Like \fB\-MD\fR except mention only user header files, not system
+header files.
+.IP "\fB\-fpch\-deps\fR" 4
+.IX Item "-fpch-deps"
+When using precompiled headers, this flag
+will cause the dependency-output flags to also list the files from the
+precompiled header's dependencies. If not specified only the
+precompiled header would be listed and not the files that were used to
+create it because those files are not consulted when a precompiled
+header is used.
+.IP "\fB\-fpch\-preprocess\fR" 4
+.IX Item "-fpch-preprocess"
+This option allows use of a precompiled header together with \fB\-E\fR. It inserts a special \f(CW\*(C`#pragma\*(C'\fR,
+\&\f(CW\*(C`#pragma GCC pch_preprocess "<filename>"\*(C'\fR in the output to mark
+the place where the precompiled header was found, and its filename. When
+\&\fB\-fpreprocessed\fR is in use, \s-1GCC\s0 recognizes this \f(CW\*(C`#pragma\*(C'\fR and
+loads the \s-1PCH\s0.
+.Sp
+This option is off by default, because the resulting preprocessed output
+is only really suitable as input to \s-1GCC\s0. It is switched on by
+\&\fB\-save\-temps\fR.
+.Sp
+You should not write this \f(CW\*(C`#pragma\*(C'\fR in your own code, but it is
+safe to edit the filename if the \s-1PCH\s0 file is available in a different
+location. The filename may be absolute or it may be relative to \s-1GCC\s0's
+current directory.
+.IP "\fB\-x c\fR" 4
+.IX Item "-x c"
+.PD 0
+.IP "\fB\-x c++\fR" 4
+.IX Item "-x c++"
+.IP "\fB\-x objective-c\fR" 4
+.IX Item "-x objective-c"
+.IP "\fB\-x assembler-with-cpp\fR" 4
+.IX Item "-x assembler-with-cpp"
+.PD
+Specify the source language: C, \*(C+, Objective-C, or assembly. This has
+nothing to do with standards conformance or extensions; it merely
+selects which base syntax to expect. If you give none of these options,
+cpp will deduce the language from the extension of the source file:
+\&\fB.c\fR, \fB.cc\fR, \fB.m\fR, or \fB.S\fR. Some other common
+extensions for \*(C+ and assembly are also recognized. If cpp does not
+recognize the extension, it will treat the file as C; this is the most
+generic mode.
+.Sp
+\&\fINote:\fR Previous versions of cpp accepted a \fB\-lang\fR option
+which selected both the language and the standards conformance level.
+This option has been removed, because it conflicts with the \fB\-l\fR
+option.
+.IP "\fB\-std=\fR\fIstandard\fR" 4
+.IX Item "-std=standard"
+.PD 0
+.IP "\fB\-ansi\fR" 4
+.IX Item "-ansi"
+.PD
+Specify the standard to which the code should conform. Currently \s-1CPP\s0
+knows about C and \*(C+ standards; others may be added in the future.
+.Sp
+\&\fIstandard\fR
+may be one of:
+.RS 4
+.ie n .IP """iso9899:1990""" 4
+.el .IP "\f(CWiso9899:1990\fR" 4
+.IX Item "iso9899:1990"
+.PD 0
+.ie n .IP """c89""" 4
+.el .IP "\f(CWc89\fR" 4
+.IX Item "c89"
+.PD
+The \s-1ISO\s0 C standard from 1990. \fBc89\fR is the customary shorthand for
+this version of the standard.
+.Sp
+The \fB\-ansi\fR option is equivalent to \fB\-std=c89\fR.
+.ie n .IP """iso9899:199409""" 4
+.el .IP "\f(CWiso9899:199409\fR" 4
+.IX Item "iso9899:199409"
+The 1990 C standard, as amended in 1994.
+.ie n .IP """iso9899:1999""" 4
+.el .IP "\f(CWiso9899:1999\fR" 4
+.IX Item "iso9899:1999"
+.PD 0
+.ie n .IP """c99""" 4
+.el .IP "\f(CWc99\fR" 4
+.IX Item "c99"
+.ie n .IP """iso9899:199x""" 4
+.el .IP "\f(CWiso9899:199x\fR" 4
+.IX Item "iso9899:199x"
+.ie n .IP """c9x""" 4
+.el .IP "\f(CWc9x\fR" 4
+.IX Item "c9x"
+.PD
+The revised \s-1ISO\s0 C standard, published in December 1999. Before
+publication, this was known as C9X.
+.ie n .IP """gnu89""" 4
+.el .IP "\f(CWgnu89\fR" 4
+.IX Item "gnu89"
+The 1990 C standard plus \s-1GNU\s0 extensions. This is the default.
+.ie n .IP """gnu99""" 4
+.el .IP "\f(CWgnu99\fR" 4
+.IX Item "gnu99"
+.PD 0
+.ie n .IP """gnu9x""" 4
+.el .IP "\f(CWgnu9x\fR" 4
+.IX Item "gnu9x"
+.PD
+The 1999 C standard plus \s-1GNU\s0 extensions.
+.ie n .IP """c++98""" 4
+.el .IP "\f(CWc++98\fR" 4
+.IX Item "c++98"
+The 1998 \s-1ISO\s0 \*(C+ standard plus amendments.
+.ie n .IP """gnu++98""" 4
+.el .IP "\f(CWgnu++98\fR" 4
+.IX Item "gnu++98"
+The same as \fB\-std=c++98\fR plus \s-1GNU\s0 extensions. This is the
+default for \*(C+ code.
+.RE
+.RS 4
+.RE
+.IP "\fB\-I\-\fR" 4
+.IX Item "-I-"
+Split the include path. Any directories specified with \fB\-I\fR
+options before \fB\-I\-\fR are searched only for headers requested with
+\&\f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR; they are not searched for
+\&\f(CW\*(C`#include\ <\f(CIfile\f(CW>\*(C'\fR. If additional directories are
+specified with \fB\-I\fR options after the \fB\-I\-\fR, those
+directories are searched for all \fB#include\fR directives.
+.Sp
+In addition, \fB\-I\-\fR inhibits the use of the directory of the current
+file directory as the first search directory for \f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR.
+This option has been deprecated.
+.IP "\fB\-nostdinc\fR" 4
+.IX Item "-nostdinc"
+Do not search the standard system directories for header files.
+Only the directories you have specified with \fB\-I\fR options
+(and the directory of the current file, if appropriate) are searched.
+.IP "\fB\-nostdinc++\fR" 4
+.IX Item "-nostdinc++"
+Do not search for header files in the \*(C+\-specific standard directories,
+but do still search the other standard directories. (This option is
+used when building the \*(C+ library.)
+.IP "\fB\-include\fR \fIfile\fR" 4
+.IX Item "-include file"
+Process \fIfile\fR as if \f(CW\*(C`#include "file"\*(C'\fR appeared as the first
+line of the primary source file. However, the first directory searched
+for \fIfile\fR is the preprocessor's working directory \fIinstead of\fR
+the directory containing the main source file. If not found there, it
+is searched for in the remainder of the \f(CW\*(C`#include "..."\*(C'\fR search
+chain as normal.
+.Sp
+If multiple \fB\-include\fR options are given, the files are included
+in the order they appear on the command line.
+.IP "\fB\-imacros\fR \fIfile\fR" 4
+.IX Item "-imacros file"
+Exactly like \fB\-include\fR, except that any output produced by
+scanning \fIfile\fR is thrown away. Macros it defines remain defined.
+This allows you to acquire all the macros from a header without also
+processing its declarations.
+.Sp
+All files specified by \fB\-imacros\fR are processed before all files
+specified by \fB\-include\fR.
+.IP "\fB\-idirafter\fR \fIdir\fR" 4
+.IX Item "-idirafter dir"
+Search \fIdir\fR for header files, but do it \fIafter\fR all
+directories specified with \fB\-I\fR and the standard system directories
+have been exhausted. \fIdir\fR is treated as a system include directory.
+If \fIdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced
+by the sysroot prefix; see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
+.IP "\fB\-iprefix\fR \fIprefix\fR" 4
+.IX Item "-iprefix prefix"
+Specify \fIprefix\fR as the prefix for subsequent \fB\-iwithprefix\fR
+options. If the prefix represents a directory, you should include the
+final \fB/\fR.
+.IP "\fB\-iwithprefix\fR \fIdir\fR" 4
+.IX Item "-iwithprefix dir"
+.PD 0
+.IP "\fB\-iwithprefixbefore\fR \fIdir\fR" 4
+.IX Item "-iwithprefixbefore dir"
+.PD
+Append \fIdir\fR to the prefix specified previously with
+\&\fB\-iprefix\fR, and add the resulting directory to the include search
+path. \fB\-iwithprefixbefore\fR puts it in the same place \fB\-I\fR
+would; \fB\-iwithprefix\fR puts it where \fB\-idirafter\fR would.
+.IP "\fB\-isysroot\fR \fIdir\fR" 4
+.IX Item "-isysroot dir"
+This option is like the \fB\-\-sysroot\fR option, but applies only to
+header files. See the \fB\-\-sysroot\fR option for more information.
+.IP "\fB\-imultilib\fR \fIdir\fR" 4
+.IX Item "-imultilib dir"
+Use \fIdir\fR as a subdirectory of the directory containing
+target-specific \*(C+ headers.
+.IP "\fB\-isystem\fR \fIdir\fR" 4
+.IX Item "-isystem dir"
+Search \fIdir\fR for header files, after all directories specified by
+\&\fB\-I\fR but before the standard system directories. Mark it
+as a system directory, so that it gets the same special treatment as
+is applied to the standard system directories.
+If \fIdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced
+by the sysroot prefix; see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
+.IP "\fB\-iquote\fR \fIdir\fR" 4
+.IX Item "-iquote dir"
+Search \fIdir\fR only for header files requested with
+\&\f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR; they are not searched for
+\&\f(CW\*(C`#include\ <\f(CIfile\f(CW>\*(C'\fR, before all directories specified by
+\&\fB\-I\fR and before the standard system directories.
+If \fIdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced
+by the sysroot prefix; see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
+.IP "\fB\-fdirectives\-only\fR" 4
+.IX Item "-fdirectives-only"
+When preprocessing, handle directives, but do not expand macros.
+.Sp
+The option's behavior depends on the \fB\-E\fR and \fB\-fpreprocessed\fR
+options.
+.Sp
+With \fB\-E\fR, preprocessing is limited to the handling of directives
+such as \f(CW\*(C`#define\*(C'\fR, \f(CW\*(C`#ifdef\*(C'\fR, and \f(CW\*(C`#error\*(C'\fR. Other
+preprocessor operations, such as macro expansion and trigraph
+conversion are not performed. In addition, the \fB\-dD\fR option is
+implicitly enabled.
+.Sp
+With \fB\-fpreprocessed\fR, predefinition of command line and most
+builtin macros is disabled. Macros such as \f(CW\*(C`_\|_LINE_\|_\*(C'\fR, which are
+contextually dependent, are handled normally. This enables compilation of
+files previously preprocessed with \f(CW\*(C`\-E \-fdirectives\-only\*(C'\fR.
+.Sp
+With both \fB\-E\fR and \fB\-fpreprocessed\fR, the rules for
+\&\fB\-fpreprocessed\fR take precedence. This enables full preprocessing of
+files previously preprocessed with \f(CW\*(C`\-E \-fdirectives\-only\*(C'\fR.
+.IP "\fB\-fdollars\-in\-identifiers\fR" 4
+.IX Item "-fdollars-in-identifiers"
+Accept \fB$\fR in identifiers.
+.IP "\fB\-fextended\-identifiers\fR" 4
+.IX Item "-fextended-identifiers"
+Accept universal character names in identifiers. This option is
+experimental; in a future version of \s-1GCC\s0, it will be enabled by
+default for C99 and \*(C+.
+.IP "\fB\-fpreprocessed\fR" 4
+.IX Item "-fpreprocessed"
+Indicate to the preprocessor that the input file has already been
+preprocessed. This suppresses things like macro expansion, trigraph
+conversion, escaped newline splicing, and processing of most directives.
+The preprocessor still recognizes and removes comments, so that you can
+pass a file preprocessed with \fB\-C\fR to the compiler without
+problems. In this mode the integrated preprocessor is little more than
+a tokenizer for the front ends.
+.Sp
+\&\fB\-fpreprocessed\fR is implicit if the input file has one of the
+extensions \fB.i\fR, \fB.ii\fR or \fB.mi\fR. These are the
+extensions that \s-1GCC\s0 uses for preprocessed files created by
+\&\fB\-save\-temps\fR.
+.IP "\fB\-ftabstop=\fR\fIwidth\fR" 4
+.IX Item "-ftabstop=width"
+Set the distance between tab stops. This helps the preprocessor report
+correct column numbers in warnings or errors, even if tabs appear on the
+line. If the value is less than 1 or greater than 100, the option is
+ignored. The default is 8.
+.IP "\fB\-fexec\-charset=\fR\fIcharset\fR" 4
+.IX Item "-fexec-charset=charset"
+Set the execution character set, used for string and character
+constants. The default is \s-1UTF\-8\s0. \fIcharset\fR can be any encoding
+supported by the system's \f(CW\*(C`iconv\*(C'\fR library routine.
+.IP "\fB\-fwide\-exec\-charset=\fR\fIcharset\fR" 4
+.IX Item "-fwide-exec-charset=charset"
+Set the wide execution character set, used for wide string and
+character constants. The default is \s-1UTF\-32\s0 or \s-1UTF\-16\s0, whichever
+corresponds to the width of \f(CW\*(C`wchar_t\*(C'\fR. As with
+\&\fB\-fexec\-charset\fR, \fIcharset\fR can be any encoding supported
+by the system's \f(CW\*(C`iconv\*(C'\fR library routine; however, you will have
+problems with encodings that do not fit exactly in \f(CW\*(C`wchar_t\*(C'\fR.
+.IP "\fB\-finput\-charset=\fR\fIcharset\fR" 4
+.IX Item "-finput-charset=charset"
+Set the input character set, used for translation from the character
+set of the input file to the source character set used by \s-1GCC\s0. If the
+locale does not specify, or \s-1GCC\s0 cannot get this information from the
+locale, the default is \s-1UTF\-8\s0. This can be overridden by either the locale
+or this command line option. Currently the command line option takes
+precedence if there's a conflict. \fIcharset\fR can be any encoding
+supported by the system's \f(CW\*(C`iconv\*(C'\fR library routine.
+.IP "\fB\-fworking\-directory\fR" 4
+.IX Item "-fworking-directory"
+Enable generation of linemarkers in the preprocessor output that will
+let the compiler know the current working directory at the time of
+preprocessing. When this option is enabled, the preprocessor will
+emit, after the initial linemarker, a second linemarker with the
+current working directory followed by two slashes. \s-1GCC\s0 will use this
+directory, when it's present in the preprocessed input, as the
+directory emitted as the current working directory in some debugging
+information formats. This option is implicitly enabled if debugging
+information is enabled, but this can be inhibited with the negated
+form \fB\-fno\-working\-directory\fR. If the \fB\-P\fR flag is
+present in the command line, this option has no effect, since no
+\&\f(CW\*(C`#line\*(C'\fR directives are emitted whatsoever.
+.IP "\fB\-fno\-show\-column\fR" 4
+.IX Item "-fno-show-column"
+Do not print column numbers in diagnostics. This may be necessary if
+diagnostics are being scanned by a program that does not understand the
+column numbers, such as \fBdejagnu\fR.
+.IP "\fB\-A\fR \fIpredicate\fR\fB=\fR\fIanswer\fR" 4
+.IX Item "-A predicate=answer"
+Make an assertion with the predicate \fIpredicate\fR and answer
+\&\fIanswer\fR. This form is preferred to the older form \fB\-A\fR
+\&\fIpredicate\fR\fB(\fR\fIanswer\fR\fB)\fR, which is still supported, because
+it does not use shell special characters.
+.IP "\fB\-A \-\fR\fIpredicate\fR\fB=\fR\fIanswer\fR" 4
+.IX Item "-A -predicate=answer"
+Cancel an assertion with the predicate \fIpredicate\fR and answer
+\&\fIanswer\fR.
+.IP "\fB\-dCHARS\fR" 4
+.IX Item "-dCHARS"
+\&\fI\s-1CHARS\s0\fR is a sequence of one or more of the following characters,
+and must not be preceded by a space. Other characters are interpreted
+by the compiler proper, or reserved for future versions of \s-1GCC\s0, and so
+are silently ignored. If you specify characters whose behavior
+conflicts, the result is undefined.
+.RS 4
+.IP "\fBM\fR" 4
+.IX Item "M"
+Instead of the normal output, generate a list of \fB#define\fR
+directives for all the macros defined during the execution of the
+preprocessor, including predefined macros. This gives you a way of
+finding out what is predefined in your version of the preprocessor.
+Assuming you have no file \fIfoo.h\fR, the command
+.Sp
+.Vb 1
+\& touch foo.h; cpp \-dM foo.h
+.Ve
+.Sp
+will show all the predefined macros.
+.Sp
+If you use \fB\-dM\fR without the \fB\-E\fR option, \fB\-dM\fR is
+interpreted as a synonym for \fB\-fdump\-rtl\-mach\fR.
+.IP "\fBD\fR" 4
+.IX Item "D"
+Like \fBM\fR except in two respects: it does \fInot\fR include the
+predefined macros, and it outputs \fIboth\fR the \fB#define\fR
+directives and the result of preprocessing. Both kinds of output go to
+the standard output file.
+.IP "\fBN\fR" 4
+.IX Item "N"
+Like \fBD\fR, but emit only the macro names, not their expansions.
+.IP "\fBI\fR" 4
+.IX Item "I"
+Output \fB#include\fR directives in addition to the result of
+preprocessing.
+.IP "\fBU\fR" 4
+.IX Item "U"
+Like \fBD\fR except that only macros that are expanded, or whose
+definedness is tested in preprocessor directives, are output; the
+output is delayed until the use or test of the macro; and
+\&\fB#undef\fR directives are also output for macros tested but
+undefined at the time.
+.RE
+.RS 4
+.RE
+.IP "\fB\-P\fR" 4
+.IX Item "-P"
+Inhibit generation of linemarkers in the output from the preprocessor.
+This might be useful when running the preprocessor on something that is
+not C code, and will be sent to a program which might be confused by the
+linemarkers.
+.IP "\fB\-C\fR" 4
+.IX Item "-C"
+Do not discard comments. All comments are passed through to the output
+file, except for comments in processed directives, which are deleted
+along with the directive.
+.Sp
+You should be prepared for side effects when using \fB\-C\fR; it
+causes the preprocessor to treat comments as tokens in their own right.
+For example, comments appearing at the start of what would be a
+directive line have the effect of turning that line into an ordinary
+source line, since the first token on the line is no longer a \fB#\fR.
+.IP "\fB\-CC\fR" 4
+.IX Item "-CC"
+Do not discard comments, including during macro expansion. This is
+like \fB\-C\fR, except that comments contained within macros are
+also passed through to the output file where the macro is expanded.
+.Sp
+In addition to the side-effects of the \fB\-C\fR option, the
+\&\fB\-CC\fR option causes all \*(C+\-style comments inside a macro
+to be converted to C\-style comments. This is to prevent later use
+of that macro from inadvertently commenting out the remainder of
+the source line.
+.Sp
+The \fB\-CC\fR option is generally used to support lint comments.
+.IP "\fB\-traditional\-cpp\fR" 4
+.IX Item "-traditional-cpp"
+Try to imitate the behavior of old-fashioned C preprocessors, as
+opposed to \s-1ISO\s0 C preprocessors.
+.IP "\fB\-trigraphs\fR" 4
+.IX Item "-trigraphs"
+Process trigraph sequences.
+These are three-character sequences, all starting with \fB??\fR, that
+are defined by \s-1ISO\s0 C to stand for single characters. For example,
+\&\fB??/\fR stands for \fB\e\fR, so \fB'??/n'\fR is a character
+constant for a newline. By default, \s-1GCC\s0 ignores trigraphs, but in
+standard-conforming modes it converts them. See the \fB\-std\fR and
+\&\fB\-ansi\fR options.
+.Sp
+The nine trigraphs and their replacements are
+.Sp
+.Vb 2
+\& Trigraph: ??( ??) ??< ??> ??= ??/ ??\*(Aq ??! ??\-
+\& Replacement: [ ] { } # \e ^ | ~
+.Ve
+.IP "\fB\-remap\fR" 4
+.IX Item "-remap"
+Enable special code to work around file systems which only permit very
+short file names, such as MS-DOS.
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
+.PD 0
+.IP "\fB\-\-target\-help\fR" 4
+.IX Item "--target-help"
+.PD
+Print text describing all the command line options instead of
+preprocessing anything.
+.IP "\fB\-v\fR" 4
+.IX Item "-v"
+Verbose mode. Print out \s-1GNU\s0 \s-1CPP\s0's version number at the beginning of
+execution, and report the final form of the include path.
+.IP "\fB\-H\fR" 4
+.IX Item "-H"
+Print the name of each header file used, in addition to other normal
+activities. Each name is indented to show how deep in the
+\&\fB#include\fR stack it is. Precompiled header files are also
+printed, even if they are found to be invalid; an invalid precompiled
+header file is printed with \fB...x\fR and a valid one with \fB...!\fR .
+.IP "\fB\-version\fR" 4
+.IX Item "-version"
+.PD 0
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+.PD
+Print out \s-1GNU\s0 \s-1CPP\s0's version number. With one dash, proceed to
+preprocess as normal. With two dashes, exit immediately.
+.Sh "Passing Options to the Assembler"
+.IX Subsection "Passing Options to the Assembler"
+You can pass options to the assembler.
+.IP "\fB\-Wa,\fR\fIoption\fR" 4
+.IX Item "-Wa,option"
+Pass \fIoption\fR as an option to the assembler. If \fIoption\fR
+contains commas, it is split into multiple options at the commas.
+.IP "\fB\-Xassembler\fR \fIoption\fR" 4
+.IX Item "-Xassembler option"
+Pass \fIoption\fR as an option to the assembler. You can use this to
+supply system-specific assembler options which \s-1GCC\s0 does not know how to
+recognize.
+.Sp
+If you want to pass an option that takes an argument, you must use
+\&\fB\-Xassembler\fR twice, once for the option and once for the argument.
+.Sh "Options for Linking"
+.IX Subsection "Options for Linking"
+These options come into play when the compiler links object files into
+an executable output file. They are meaningless if the compiler is
+not doing a link step.
+.IP "\fIobject-file-name\fR" 4
+.IX Item "object-file-name"
+A file name that does not end in a special recognized suffix is
+considered to name an object file or library. (Object files are
+distinguished from libraries by the linker according to the file
+contents.) If linking is done, these object files are used as input
+to the linker.
+.IP "\fB\-c\fR" 4
+.IX Item "-c"
+.PD 0
+.IP "\fB\-S\fR" 4
+.IX Item "-S"
+.IP "\fB\-E\fR" 4
+.IX Item "-E"
+.PD
+If any of these options is used, then the linker is not run, and
+object file names should not be used as arguments.
+.IP "\fB\-l\fR\fIlibrary\fR" 4
+.IX Item "-llibrary"
+.PD 0
+.IP "\fB\-l\fR \fIlibrary\fR" 4
+.IX Item "-l library"
+.PD
+Search the library named \fIlibrary\fR when linking. (The second
+alternative with the library as a separate argument is only for
+\&\s-1POSIX\s0 compliance and is not recommended.)
+.Sp
+It makes a difference where in the command you write this option; the
+linker searches and processes libraries and object files in the order they
+are specified. Thus, \fBfoo.o \-lz bar.o\fR searches library \fBz\fR
+after file \fIfoo.o\fR but before \fIbar.o\fR. If \fIbar.o\fR refers
+to functions in \fBz\fR, those functions may not be loaded.
+.Sp
+The linker searches a standard list of directories for the library,
+which is actually a file named \fIlib\fIlibrary\fI.a\fR. The linker
+then uses this file as if it had been specified precisely by name.
+.Sp
+The directories searched include several standard system directories
+plus any that you specify with \fB\-L\fR.
+.Sp
+Normally the files found this way are library files\-\-\-archive files
+whose members are object files. The linker handles an archive file by
+scanning through it for members which define symbols that have so far
+been referenced but not defined. But if the file that is found is an
+ordinary object file, it is linked in the usual fashion. The only
+difference between using an \fB\-l\fR option and specifying a file name
+is that \fB\-l\fR surrounds \fIlibrary\fR with \fBlib\fR and \fB.a\fR
+and searches several directories.
+.IP "\fB\-lobjc\fR" 4
+.IX Item "-lobjc"
+You need this special case of the \fB\-l\fR option in order to
+link an Objective-C or Objective\-\*(C+ program.
+.IP "\fB\-nostartfiles\fR" 4
+.IX Item "-nostartfiles"
+Do not use the standard system startup files when linking.
+The standard system libraries are used normally, unless \fB\-nostdlib\fR
+or \fB\-nodefaultlibs\fR is used.
+.IP "\fB\-nodefaultlibs\fR" 4
+.IX Item "-nodefaultlibs"
+Do not use the standard system libraries when linking.
+Only the libraries you specify will be passed to the linker.
+The standard startup files are used normally, unless \fB\-nostartfiles\fR
+is used. The compiler may generate calls to \f(CW\*(C`memcmp\*(C'\fR,
+\&\f(CW\*(C`memset\*(C'\fR, \f(CW\*(C`memcpy\*(C'\fR and \f(CW\*(C`memmove\*(C'\fR.
+These entries are usually resolved by entries in
+libc. These entry points should be supplied through some other
+mechanism when this option is specified.
+.IP "\fB\-nostdlib\fR" 4
+.IX Item "-nostdlib"
+Do not use the standard system startup files or libraries when linking.
+No startup files and only the libraries you specify will be passed to
+the linker. The compiler may generate calls to \f(CW\*(C`memcmp\*(C'\fR, \f(CW\*(C`memset\*(C'\fR,
+\&\f(CW\*(C`memcpy\*(C'\fR and \f(CW\*(C`memmove\*(C'\fR.
+These entries are usually resolved by entries in
+libc. These entry points should be supplied through some other
+mechanism when this option is specified.
+.Sp
+One of the standard libraries bypassed by \fB\-nostdlib\fR and
+\&\fB\-nodefaultlibs\fR is \fIlibgcc.a\fR, a library of internal subroutines
+that \s-1GCC\s0 uses to overcome shortcomings of particular machines, or special
+needs for some languages.
+.Sp
+In most cases, you need \fIlibgcc.a\fR even when you want to avoid
+other standard libraries. In other words, when you specify \fB\-nostdlib\fR
+or \fB\-nodefaultlibs\fR you should usually specify \fB\-lgcc\fR as well.
+This ensures that you have no unresolved references to internal \s-1GCC\s0
+library subroutines. (For example, \fB_\|_main\fR, used to ensure \*(C+
+constructors will be called.)
+.IP "\fB\-pie\fR" 4
+.IX Item "-pie"
+Produce a position independent executable on targets which support it.
+For predictable results, you must also specify the same set of options
+that were used to generate code (\fB\-fpie\fR, \fB\-fPIE\fR,
+or model suboptions) when you specify this option.
+.IP "\fB\-rdynamic\fR" 4
+.IX Item "-rdynamic"
+Pass the flag \fB\-export\-dynamic\fR to the \s-1ELF\s0 linker, on targets
+that support it. This instructs the linker to add all symbols, not
+only used ones, to the dynamic symbol table. This option is needed
+for some uses of \f(CW\*(C`dlopen\*(C'\fR or to allow obtaining backtraces
+from within a program.
+.IP "\fB\-s\fR" 4
+.IX Item "-s"
+Remove all symbol table and relocation information from the executable.
+.IP "\fB\-static\fR" 4
+.IX Item "-static"
+On systems that support dynamic linking, this prevents linking with the shared
+libraries. On other systems, this option has no effect.
+.IP "\fB\-shared\fR" 4
+.IX Item "-shared"
+Produce a shared object which can then be linked with other objects to
+form an executable. Not all systems support this option. For predictable
+results, you must also specify the same set of options that were used to
+generate code (\fB\-fpic\fR, \fB\-fPIC\fR, or model suboptions)
+when you specify this option.[1]
+.IP "\fB\-shared\-libgcc\fR" 4
+.IX Item "-shared-libgcc"
+.PD 0
+.IP "\fB\-static\-libgcc\fR" 4
+.IX Item "-static-libgcc"
+.PD
+On systems that provide \fIlibgcc\fR as a shared library, these options
+force the use of either the shared or static version respectively.
+If no shared version of \fIlibgcc\fR was built when the compiler was
+configured, these options have no effect.
+.Sp
+There are several situations in which an application should use the
+shared \fIlibgcc\fR instead of the static version. The most common
+of these is when the application wishes to throw and catch exceptions
+across different shared libraries. In that case, each of the libraries
+as well as the application itself should use the shared \fIlibgcc\fR.
+.Sp
+Therefore, the G++ and \s-1GCJ\s0 drivers automatically add
+\&\fB\-shared\-libgcc\fR whenever you build a shared library or a main
+executable, because \*(C+ and Java programs typically use exceptions, so
+this is the right thing to do.
+.Sp
+If, instead, you use the \s-1GCC\s0 driver to create shared libraries, you may
+find that they will not always be linked with the shared \fIlibgcc\fR.
+If \s-1GCC\s0 finds, at its configuration time, that you have a non-GNU linker
+or a \s-1GNU\s0 linker that does not support option \fB\-\-eh\-frame\-hdr\fR,
+it will link the shared version of \fIlibgcc\fR into shared libraries
+by default. Otherwise, it will take advantage of the linker and optimize
+away the linking with the shared version of \fIlibgcc\fR, linking with
+the static version of libgcc by default. This allows exceptions to
+propagate through such shared libraries, without incurring relocation
+costs at library load time.
+.Sp
+However, if a library or main executable is supposed to throw or catch
+exceptions, you must link it using the G++ or \s-1GCJ\s0 driver, as appropriate
+for the languages used in the program, or using the option
+\&\fB\-shared\-libgcc\fR, such that it is linked with the shared
+\&\fIlibgcc\fR.
+.IP "\fB\-symbolic\fR" 4
+.IX Item "-symbolic"
+Bind references to global symbols when building a shared object. Warn
+about any unresolved references (unless overridden by the link editor
+option \fB\-Xlinker \-z \-Xlinker defs\fR). Only a few systems support
+this option.
+.IP "\fB\-T\fR \fIscript\fR" 4
+.IX Item "-T script"
+Use \fIscript\fR as the linker script. This option is supported by most
+systems using the \s-1GNU\s0 linker. On some targets, such as bare-board
+targets without an operating system, the \fB\-T\fR option may be required
+when linking to avoid references to undefined symbols.
+.IP "\fB\-Xlinker\fR \fIoption\fR" 4
+.IX Item "-Xlinker option"
+Pass \fIoption\fR as an option to the linker. You can use this to
+supply system-specific linker options which \s-1GCC\s0 does not know how to
+recognize.
+.Sp
+If you want to pass an option that takes a separate argument, you must use
+\&\fB\-Xlinker\fR twice, once for the option and once for the argument.
+For example, to pass \fB\-assert definitions\fR, you must write
+\&\fB\-Xlinker \-assert \-Xlinker definitions\fR. It does not work to write
+\&\fB\-Xlinker \*(L"\-assert definitions\*(R"\fR, because this passes the entire
+string as a single argument, which is not what the linker expects.
+.Sp
+When using the \s-1GNU\s0 linker, it is usually more convenient to pass
+arguments to linker options using the \fIoption\fR\fB=\fR\fIvalue\fR
+syntax than as separate arguments. For example, you can specify
+\&\fB\-Xlinker \-Map=output.map\fR rather than
+\&\fB\-Xlinker \-Map \-Xlinker output.map\fR. Other linkers may not support
+this syntax for command-line options.
+.IP "\fB\-Wl,\fR\fIoption\fR" 4
+.IX Item "-Wl,option"
+Pass \fIoption\fR as an option to the linker. If \fIoption\fR contains
+commas, it is split into multiple options at the commas. You can use this
+syntax to pass an argument to the option.
+For example, \fB\-Wl,\-Map,output.map\fR passes \fB\-Map output.map\fR to the
+linker. When using the \s-1GNU\s0 linker, you can also get the same effect with
+\&\fB\-Wl,\-Map=output.map\fR.
+.IP "\fB\-u\fR \fIsymbol\fR" 4
+.IX Item "-u symbol"
+Pretend the symbol \fIsymbol\fR is undefined, to force linking of
+library modules to define it. You can use \fB\-u\fR multiple times with
+different symbols to force loading of additional library modules.
+.Sh "Options for Directory Search"
+.IX Subsection "Options for Directory Search"
+These options specify directories to search for header files, for
+libraries and for parts of the compiler:
+.IP "\fB\-I\fR\fIdir\fR" 4
+.IX Item "-Idir"
+Add the directory \fIdir\fR to the head of the list of directories to be
+searched for header files. This can be used to override a system header
+file, substituting your own version, since these directories are
+searched before the system header file directories. However, you should
+not use this option to add directories that contain vendor-supplied
+system header files (use \fB\-isystem\fR for that). If you use more than
+one \fB\-I\fR option, the directories are scanned in left-to-right
+order; the standard system directories come after.
+.Sp
+If a standard system include directory, or a directory specified with
+\&\fB\-isystem\fR, is also specified with \fB\-I\fR, the \fB\-I\fR
+option will be ignored. The directory will still be searched but as a
+system directory at its normal position in the system include chain.
+This is to ensure that \s-1GCC\s0's procedure to fix buggy system headers and
+the ordering for the include_next directive are not inadvertently changed.
+If you really need to change the search order for system directories,
+use the \fB\-nostdinc\fR and/or \fB\-isystem\fR options.
+.IP "\fB\-iquote\fR\fIdir\fR" 4
+.IX Item "-iquotedir"
+Add the directory \fIdir\fR to the head of the list of directories to
+be searched for header files only for the case of \fB#include
+"\fR\fIfile\fR\fB"\fR; they are not searched for \fB#include <\fR\fIfile\fR\fB>\fR,
+otherwise just like \fB\-I\fR.
+.IP "\fB\-L\fR\fIdir\fR" 4
+.IX Item "-Ldir"
+Add directory \fIdir\fR to the list of directories to be searched
+for \fB\-l\fR.
+.IP "\fB\-B\fR\fIprefix\fR" 4
+.IX Item "-Bprefix"
+This option specifies where to find the executables, libraries,
+include files, and data files of the compiler itself.
+.Sp
+The compiler driver program runs one or more of the subprograms
+\&\fIcpp\fR, \fIcc1\fR, \fIas\fR and \fIld\fR. It tries
+\&\fIprefix\fR as a prefix for each program it tries to run, both with and
+without \fImachine\fR\fB/\fR\fIversion\fR\fB/\fR.
+.Sp
+For each subprogram to be run, the compiler driver first tries the
+\&\fB\-B\fR prefix, if any. If that name is not found, or if \fB\-B\fR
+was not specified, the driver tries two standard prefixes, which are
+\&\fI/usr/lib/gcc/\fR and \fI/usr/local/lib/gcc/\fR. If neither of
+those results in a file name that is found, the unmodified program
+name is searched for using the directories specified in your
+\&\fB\s-1PATH\s0\fR environment variable.
+.Sp
+The compiler will check to see if the path provided by the \fB\-B\fR
+refers to a directory, and if necessary it will add a directory
+separator character at the end of the path.
+.Sp
+\&\fB\-B\fR prefixes that effectively specify directory names also apply
+to libraries in the linker, because the compiler translates these
+options into \fB\-L\fR options for the linker. They also apply to
+includes files in the preprocessor, because the compiler translates these
+options into \fB\-isystem\fR options for the preprocessor. In this case,
+the compiler appends \fBinclude\fR to the prefix.
+.Sp
+The run-time support file \fIlibgcc.a\fR can also be searched for using
+the \fB\-B\fR prefix, if needed. If it is not found there, the two
+standard prefixes above are tried, and that is all. The file is left
+out of the link if it is not found by those means.
+.Sp
+Another way to specify a prefix much like the \fB\-B\fR prefix is to use
+the environment variable \fB\s-1GCC_EXEC_PREFIX\s0\fR.
+.Sp
+As a special kludge, if the path provided by \fB\-B\fR is
+\&\fI[dir/]stage\fIN\fI/\fR, where \fIN\fR is a number in the range 0 to
+9, then it will be replaced by \fI[dir/]include\fR. This is to help
+with boot-strapping the compiler.
+.IP "\fB\-specs=\fR\fIfile\fR" 4
+.IX Item "-specs=file"
+Process \fIfile\fR after the compiler reads in the standard \fIspecs\fR
+file, in order to override the defaults that the \fIgcc\fR driver
+program uses when determining what switches to pass to \fIcc1\fR,
+\&\fIcc1plus\fR, \fIas\fR, \fIld\fR, etc. More than one
+\&\fB\-specs=\fR\fIfile\fR can be specified on the command line, and they
+are processed in order, from left to right.
+.IP "\fB\-\-sysroot=\fR\fIdir\fR" 4
+.IX Item "--sysroot=dir"
+Use \fIdir\fR as the logical root directory for headers and libraries.
+For example, if the compiler would normally search for headers in
+\&\fI/usr/include\fR and libraries in \fI/usr/lib\fR, it will instead
+search \fI\fIdir\fI/usr/include\fR and \fI\fIdir\fI/usr/lib\fR.
+.Sp
+If you use both this option and the \fB\-isysroot\fR option, then
+the \fB\-\-sysroot\fR option will apply to libraries, but the
+\&\fB\-isysroot\fR option will apply to header files.
+.Sp
+The \s-1GNU\s0 linker (beginning with version 2.16) has the necessary support
+for this option. If your linker does not support this option, the
+header file aspect of \fB\-\-sysroot\fR will still work, but the
+library aspect will not.
+.IP "\fB\-I\-\fR" 4
+.IX Item "-I-"
+This option has been deprecated. Please use \fB\-iquote\fR instead for
+\&\fB\-I\fR directories before the \fB\-I\-\fR and remove the \fB\-I\-\fR.
+Any directories you specify with \fB\-I\fR options before the \fB\-I\-\fR
+option are searched only for the case of \fB#include "\fR\fIfile\fR\fB"\fR;
+they are not searched for \fB#include <\fR\fIfile\fR\fB>\fR.
+.Sp
+If additional directories are specified with \fB\-I\fR options after
+the \fB\-I\-\fR, these directories are searched for all \fB#include\fR
+directives. (Ordinarily \fIall\fR \fB\-I\fR directories are used
+this way.)
+.Sp
+In addition, the \fB\-I\-\fR option inhibits the use of the current
+directory (where the current input file came from) as the first search
+directory for \fB#include "\fR\fIfile\fR\fB"\fR. There is no way to
+override this effect of \fB\-I\-\fR. With \fB\-I.\fR you can specify
+searching the directory which was current when the compiler was
+invoked. That is not exactly the same as what the preprocessor does
+by default, but it is often satisfactory.
+.Sp
+\&\fB\-I\-\fR does not inhibit the use of the standard system directories
+for header files. Thus, \fB\-I\-\fR and \fB\-nostdinc\fR are
+independent.
+.Sh "Specifying Target Machine and Compiler Version"
+.IX Subsection "Specifying Target Machine and Compiler Version"
+The usual way to run \s-1GCC\s0 is to run the executable called \fIgcc\fR, or
+\&\fI<machine>\-gcc\fR when cross-compiling, or
+\&\fI<machine>\-gcc\-<version>\fR to run a version other than the one that
+was installed last. Sometimes this is inconvenient, so \s-1GCC\s0 provides
+options that will switch to another cross-compiler or version.
+.IP "\fB\-b\fR \fImachine\fR" 4
+.IX Item "-b machine"
+The argument \fImachine\fR specifies the target machine for compilation.
+.Sp
+The value to use for \fImachine\fR is the same as was specified as the
+machine type when configuring \s-1GCC\s0 as a cross-compiler. For
+example, if a cross-compiler was configured with \fBconfigure
+arm-elf\fR, meaning to compile for an arm processor with elf binaries,
+then you would specify \fB\-b arm-elf\fR to run that cross compiler.
+Because there are other options beginning with \fB\-b\fR, the
+configuration must contain a hyphen, or \fB\-b\fR alone should be one
+argument followed by the configuration in the next argument.
+.IP "\fB\-V\fR \fIversion\fR" 4
+.IX Item "-V version"
+The argument \fIversion\fR specifies which version of \s-1GCC\s0 to run.
+This is useful when multiple versions are installed. For example,
+\&\fIversion\fR might be \fB4.0\fR, meaning to run \s-1GCC\s0 version 4.0.
+.PP
+The \fB\-V\fR and \fB\-b\fR options work by running the
+\&\fI<machine>\-gcc\-<version>\fR executable, so there's no real reason to
+use them if you can just run that directly.
+.Sh "Hardware Models and Configurations"
+.IX Subsection "Hardware Models and Configurations"
+Earlier we discussed the standard option \fB\-b\fR which chooses among
+different installed compilers for completely different target
+machines, such as \s-1VAX\s0 vs. 68000 vs. 80386.
+.PP
+In addition, each of these target machine types can have its own
+special options, starting with \fB\-m\fR, to choose among various
+hardware models or configurations\-\-\-for example, 68010 vs 68020,
+floating coprocessor or none. A single installed version of the
+compiler can compile for any model or configuration, according to the
+options specified.
+.PP
+Some configurations of the compiler also support additional special
+options, usually for compatibility with other compilers on the same
+platform.
+.PP
+\fI\s-1ARC\s0 Options\fR
+.IX Subsection "ARC Options"
+.PP
+These options are defined for \s-1ARC\s0 implementations:
+.IP "\fB\-EL\fR" 4
+.IX Item "-EL"
+Compile code for little endian mode. This is the default.
+.IP "\fB\-EB\fR" 4
+.IX Item "-EB"
+Compile code for big endian mode.
+.IP "\fB\-mmangle\-cpu\fR" 4
+.IX Item "-mmangle-cpu"
+Prepend the name of the cpu to all public symbol names.
+In multiple-processor systems, there are many \s-1ARC\s0 variants with different
+instruction and register set characteristics. This flag prevents code
+compiled for one cpu to be linked with code compiled for another.
+No facility exists for handling variants that are \*(L"almost identical\*(R".
+This is an all or nothing option.
+.IP "\fB\-mcpu=\fR\fIcpu\fR" 4
+.IX Item "-mcpu=cpu"
+Compile code for \s-1ARC\s0 variant \fIcpu\fR.
+Which variants are supported depend on the configuration.
+All variants support \fB\-mcpu=base\fR, this is the default.
+.IP "\fB\-mtext=\fR\fItext-section\fR" 4
+.IX Item "-mtext=text-section"
+.PD 0
+.IP "\fB\-mdata=\fR\fIdata-section\fR" 4
+.IX Item "-mdata=data-section"
+.IP "\fB\-mrodata=\fR\fIreadonly-data-section\fR" 4
+.IX Item "-mrodata=readonly-data-section"
+.PD
+Put functions, data, and readonly data in \fItext-section\fR,
+\&\fIdata-section\fR, and \fIreadonly-data-section\fR respectively
+by default. This can be overridden with the \f(CW\*(C`section\*(C'\fR attribute.
+.IP "\fB\-mfix\-cortex\-m3\-ldrd\fR" 4
+.IX Item "-mfix-cortex-m3-ldrd"
+Some Cortex\-M3 cores can cause data corruption when \f(CW\*(C`ldrd\*(C'\fR instructions
+with overlapping destination and base registers are used. This option avoids
+generating these instructions. This option is enabled by default when
+\&\fB\-mcpu=cortex\-m3\fR is specified.
+.PP
+\fI\s-1ARM\s0 Options\fR
+.IX Subsection "ARM Options"
+.PP
+These \fB\-m\fR options are defined for Advanced \s-1RISC\s0 Machines (\s-1ARM\s0)
+architectures:
+.IP "\fB\-mabi=\fR\fIname\fR" 4
+.IX Item "-mabi=name"
+Generate code for the specified \s-1ABI\s0. Permissible values are: \fBapcs-gnu\fR,
+\&\fBatpcs\fR, \fBaapcs\fR, \fBaapcs-linux\fR and \fBiwmmxt\fR.
+.IP "\fB\-mapcs\-frame\fR" 4
+.IX Item "-mapcs-frame"
+Generate a stack frame that is compliant with the \s-1ARM\s0 Procedure Call
+Standard for all functions, even if this is not strictly necessary for
+correct execution of the code. Specifying \fB\-fomit\-frame\-pointer\fR
+with this option will cause the stack frames not to be generated for
+leaf functions. The default is \fB\-mno\-apcs\-frame\fR.
+.IP "\fB\-mapcs\fR" 4
+.IX Item "-mapcs"
+This is a synonym for \fB\-mapcs\-frame\fR.
+.IP "\fB\-mthumb\-interwork\fR" 4
+.IX Item "-mthumb-interwork"
+Generate code which supports calling between the \s-1ARM\s0 and Thumb
+instruction sets. Without this option the two instruction sets cannot
+be reliably used inside one program. The default is
+\&\fB\-mno\-thumb\-interwork\fR, since slightly larger code is generated
+when \fB\-mthumb\-interwork\fR is specified.
+.IP "\fB\-mno\-sched\-prolog\fR" 4
+.IX Item "-mno-sched-prolog"
+Prevent the reordering of instructions in the function prolog, or the
+merging of those instruction with the instructions in the function's
+body. This means that all functions will start with a recognizable set
+of instructions (or in fact one of a choice from a small set of
+different function prologues), and this information can be used to
+locate the start if functions inside an executable piece of code. The
+default is \fB\-msched\-prolog\fR.
+.IP "\fB\-mfloat\-abi=\fR\fIname\fR" 4
+.IX Item "-mfloat-abi=name"
+Specifies which floating-point \s-1ABI\s0 to use. Permissible values
+are: \fBsoft\fR, \fBsoftfp\fR and \fBhard\fR.
+.Sp
+Specifying \fBsoft\fR causes \s-1GCC\s0 to generate output containing
+library calls for floating-point operations.
+\&\fBsoftfp\fR allows the generation of code using hardware floating-point
+instructions, but still uses the soft-float calling conventions.
+\&\fBhard\fR allows generation of floating-point instructions
+and uses FPU-specific calling conventions.
+.Sp
+Using \fB\-mfloat\-abi=hard\fR with \s-1VFP\s0 coprocessors is not supported.
+Use \fB\-mfloat\-abi=softfp\fR with the appropriate \fB\-mfpu\fR option
+to allow the compiler to generate code that makes use of the hardware
+floating-point capabilities for these CPUs.
+.Sp
+The default depends on the specific target configuration. Note that
+the hard-float and soft-float ABIs are not link-compatible; you must
+compile your entire program with the same \s-1ABI\s0, and link with a
+compatible set of libraries.
+.IP "\fB\-mhard\-float\fR" 4
+.IX Item "-mhard-float"
+Equivalent to \fB\-mfloat\-abi=hard\fR.
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+Equivalent to \fB\-mfloat\-abi=soft\fR.
+.IP "\fB\-mlittle\-endian\fR" 4
+.IX Item "-mlittle-endian"
+Generate code for a processor running in little-endian mode. This is
+the default for all standard configurations.
+.IP "\fB\-mbig\-endian\fR" 4
+.IX Item "-mbig-endian"
+Generate code for a processor running in big-endian mode; the default is
+to compile code for a little-endian processor.
+.IP "\fB\-mwords\-little\-endian\fR" 4
+.IX Item "-mwords-little-endian"
+This option only applies when generating code for big-endian processors.
+Generate code for a little-endian word order but a big-endian byte
+order. That is, a byte order of the form \fB32107654\fR. Note: this
+option should only be used if you require compatibility with code for
+big-endian \s-1ARM\s0 processors generated by versions of the compiler prior to
+2.8.
+.IP "\fB\-mcpu=\fR\fIname\fR" 4
+.IX Item "-mcpu=name"
+This specifies the name of the target \s-1ARM\s0 processor. \s-1GCC\s0 uses this name
+to determine what kind of instructions it can emit when generating
+assembly code. Permissible names are: \fBarm2\fR, \fBarm250\fR,
+\&\fBarm3\fR, \fBarm6\fR, \fBarm60\fR, \fBarm600\fR, \fBarm610\fR,
+\&\fBarm620\fR, \fBarm7\fR, \fBarm7m\fR, \fBarm7d\fR, \fBarm7dm\fR,
+\&\fBarm7di\fR, \fBarm7dmi\fR, \fBarm70\fR, \fBarm700\fR,
+\&\fBarm700i\fR, \fBarm710\fR, \fBarm710c\fR, \fBarm7100\fR,
+\&\fBarm720\fR,
+\&\fBarm7500\fR, \fBarm7500fe\fR, \fBarm7tdmi\fR, \fBarm7tdmi\-s\fR,
+\&\fBarm710t\fR, \fBarm720t\fR, \fBarm740t\fR,
+\&\fBstrongarm\fR, \fBstrongarm110\fR, \fBstrongarm1100\fR,
+\&\fBstrongarm1110\fR,
+\&\fBarm8\fR, \fBarm810\fR, \fBarm9\fR, \fBarm9e\fR, \fBarm920\fR,
+\&\fBarm920t\fR, \fBarm922t\fR, \fBarm946e\-s\fR, \fBarm966e\-s\fR,
+\&\fBarm968e\-s\fR, \fBarm926ej\-s\fR, \fBarm940t\fR, \fBarm9tdmi\fR,
+\&\fBarm10tdmi\fR, \fBarm1020t\fR, \fBarm1026ej\-s\fR,
+\&\fBarm10e\fR, \fBarm1020e\fR, \fBarm1022e\fR,
+\&\fBarm1136j\-s\fR, \fBarm1136jf\-s\fR, \fBmpcore\fR, \fBmpcorenovfp\fR,
+\&\fBarm1156t2\-s\fR, \fBarm1176jz\-s\fR, \fBarm1176jzf\-s\fR,
+\&\fBcortex\-a8\fR, \fBcortex\-a9\fR,
+\&\fBcortex\-r4\fR, \fBcortex\-r4f\fR, \fBcortex\-m3\fR,
+\&\fBcortex\-m1\fR,
+\&\fBxscale\fR, \fBiwmmxt\fR, \fBiwmmxt2\fR, \fBep9312\fR.
+.IP "\fB\-mtune=\fR\fIname\fR" 4
+.IX Item "-mtune=name"
+This option is very similar to the \fB\-mcpu=\fR option, except that
+instead of specifying the actual target processor type, and hence
+restricting which instructions can be used, it specifies that \s-1GCC\s0 should
+tune the performance of the code as if the target were of the type
+specified in this option, but still choosing the instructions that it
+will generate based on the cpu specified by a \fB\-mcpu=\fR option.
+For some \s-1ARM\s0 implementations better performance can be obtained by using
+this option.
+.IP "\fB\-march=\fR\fIname\fR" 4
+.IX Item "-march=name"
+This specifies the name of the target \s-1ARM\s0 architecture. \s-1GCC\s0 uses this
+name to determine what kind of instructions it can emit when generating
+assembly code. This option can be used in conjunction with or instead
+of the \fB\-mcpu=\fR option. Permissible names are: \fBarmv2\fR,
+\&\fBarmv2a\fR, \fBarmv3\fR, \fBarmv3m\fR, \fBarmv4\fR, \fBarmv4t\fR,
+\&\fBarmv5\fR, \fBarmv5t\fR, \fBarmv5e\fR, \fBarmv5te\fR,
+\&\fBarmv6\fR, \fBarmv6j\fR,
+\&\fBarmv6t2\fR, \fBarmv6z\fR, \fBarmv6zk\fR, \fBarmv6\-m\fR,
+\&\fBarmv7\fR, \fBarmv7\-a\fR, \fBarmv7\-r\fR, \fBarmv7\-m\fR,
+\&\fBiwmmxt\fR, \fBiwmmxt2\fR, \fBep9312\fR.
+.IP "\fB\-mfpu=\fR\fIname\fR" 4
+.IX Item "-mfpu=name"
+.PD 0
+.IP "\fB\-mfpe=\fR\fInumber\fR" 4
+.IX Item "-mfpe=number"
+.IP "\fB\-mfp=\fR\fInumber\fR" 4
+.IX Item "-mfp=number"
+.PD
+This specifies what floating point hardware (or hardware emulation) is
+available on the target. Permissible names are: \fBfpa\fR, \fBfpe2\fR,
+\&\fBfpe3\fR, \fBmaverick\fR, \fBvfp\fR, \fBvfpv3\fR, \fBvfpv3\-d16\fR and
+\&\fBneon\fR. \fB\-mfp\fR and \fB\-mfpe\fR
+are synonyms for \fB\-mfpu\fR=\fBfpe\fR\fInumber\fR, for compatibility
+with older versions of \s-1GCC\s0.
+.Sp
+If \fB\-msoft\-float\fR is specified this specifies the format of
+floating point values.
+.IP "\fB\-mstructure\-size\-boundary=\fR\fIn\fR" 4
+.IX Item "-mstructure-size-boundary=n"
+The size of all structures and unions will be rounded up to a multiple
+of the number of bits set by this option. Permissible values are 8, 32
+and 64. The default value varies for different toolchains. For the \s-1COFF\s0
+targeted toolchain the default value is 8. A value of 64 is only allowed
+if the underlying \s-1ABI\s0 supports it.
+.Sp
+Specifying the larger number can produce faster, more efficient code, but
+can also increase the size of the program. Different values are potentially
+incompatible. Code compiled with one value cannot necessarily expect to
+work with code or libraries compiled with another value, if they exchange
+information using structures or unions.
+.IP "\fB\-mabort\-on\-noreturn\fR" 4
+.IX Item "-mabort-on-noreturn"
+Generate a call to the function \f(CW\*(C`abort\*(C'\fR at the end of a
+\&\f(CW\*(C`noreturn\*(C'\fR function. It will be executed if the function tries to
+return.
+.IP "\fB\-mlong\-calls\fR" 4
+.IX Item "-mlong-calls"
+.PD 0
+.IP "\fB\-mno\-long\-calls\fR" 4
+.IX Item "-mno-long-calls"
+.PD
+Tells the compiler to perform function calls by first loading the
+address of the function into a register and then performing a subroutine
+call on this register. This switch is needed if the target function
+will lie outside of the 64 megabyte addressing range of the offset based
+version of subroutine call instruction.
+.Sp
+Even if this switch is enabled, not all function calls will be turned
+into long calls. The heuristic is that static functions, functions
+which have the \fBshort-call\fR attribute, functions that are inside
+the scope of a \fB#pragma no_long_calls\fR directive and functions whose
+definitions have already been compiled within the current compilation
+unit, will not be turned into long calls. The exception to this rule is
+that weak function definitions, functions with the \fBlong-call\fR
+attribute or the \fBsection\fR attribute, and functions that are within
+the scope of a \fB#pragma long_calls\fR directive, will always be
+turned into long calls.
+.Sp
+This feature is not enabled by default. Specifying
+\&\fB\-mno\-long\-calls\fR will restore the default behavior, as will
+placing the function calls within the scope of a \fB#pragma
+long_calls_off\fR directive. Note these switches have no effect on how
+the compiler generates code to handle function calls via function
+pointers.
+.IP "\fB\-msingle\-pic\-base\fR" 4
+.IX Item "-msingle-pic-base"
+Treat the register used for \s-1PIC\s0 addressing as read-only, rather than
+loading it in the prologue for each function. The run-time system is
+responsible for initializing this register with an appropriate value
+before execution begins.
+.IP "\fB\-mpic\-register=\fR\fIreg\fR" 4
+.IX Item "-mpic-register=reg"
+Specify the register to be used for \s-1PIC\s0 addressing. The default is R10
+unless stack-checking is enabled, when R9 is used.
+.IP "\fB\-mcirrus\-fix\-invalid\-insns\fR" 4
+.IX Item "-mcirrus-fix-invalid-insns"
+Insert NOPs into the instruction stream to in order to work around
+problems with invalid Maverick instruction combinations. This option
+is only valid if the \fB\-mcpu=ep9312\fR option has been used to
+enable generation of instructions for the Cirrus Maverick floating
+point co-processor. This option is not enabled by default, since the
+problem is only present in older Maverick implementations. The default
+can be re-enabled by use of the \fB\-mno\-cirrus\-fix\-invalid\-insns\fR
+switch.
+.IP "\fB\-mpoke\-function\-name\fR" 4
+.IX Item "-mpoke-function-name"
+Write the name of each function into the text section, directly
+preceding the function prologue. The generated code is similar to this:
+.Sp
+.Vb 9
+\& t0
+\& .ascii "arm_poke_function_name", 0
+\& .align
+\& t1
+\& .word 0xff000000 + (t1 \- t0)
+\& arm_poke_function_name
+\& mov ip, sp
+\& stmfd sp!, {fp, ip, lr, pc}
+\& sub fp, ip, #4
+.Ve
+.Sp
+When performing a stack backtrace, code can inspect the value of
+\&\f(CW\*(C`pc\*(C'\fR stored at \f(CW\*(C`fp + 0\*(C'\fR. If the trace function then looks at
+location \f(CW\*(C`pc \- 12\*(C'\fR and the top 8 bits are set, then we know that
+there is a function name embedded immediately preceding this location
+and has length \f(CW\*(C`((pc[\-3]) & 0xff000000)\*(C'\fR.
+.IP "\fB\-mthumb\fR" 4
+.IX Item "-mthumb"
+Generate code for the Thumb instruction set. The default is to
+use the 32\-bit \s-1ARM\s0 instruction set.
+This option automatically enables either 16\-bit Thumb\-1 or
+mixed 16/32\-bit Thumb\-2 instructions based on the \fB\-mcpu=\fR\fIname\fR
+and \fB\-march=\fR\fIname\fR options.
+.IP "\fB\-mtpcs\-frame\fR" 4
+.IX Item "-mtpcs-frame"
+Generate a stack frame that is compliant with the Thumb Procedure Call
+Standard for all non-leaf functions. (A leaf function is one that does
+not call any other functions.) The default is \fB\-mno\-tpcs\-frame\fR.
+.IP "\fB\-mtpcs\-leaf\-frame\fR" 4
+.IX Item "-mtpcs-leaf-frame"
+Generate a stack frame that is compliant with the Thumb Procedure Call
+Standard for all leaf functions. (A leaf function is one that does
+not call any other functions.) The default is \fB\-mno\-apcs\-leaf\-frame\fR.
+.IP "\fB\-mcallee\-super\-interworking\fR" 4
+.IX Item "-mcallee-super-interworking"
+Gives all externally visible functions in the file being compiled an \s-1ARM\s0
+instruction set header which switches to Thumb mode before executing the
+rest of the function. This allows these functions to be called from
+non-interworking code.
+.IP "\fB\-mcaller\-super\-interworking\fR" 4
+.IX Item "-mcaller-super-interworking"
+Allows calls via function pointers (including virtual functions) to
+execute correctly regardless of whether the target code has been
+compiled for interworking or not. There is a small overhead in the cost
+of executing a function pointer if this option is enabled.
+.IP "\fB\-mtp=\fR\fIname\fR" 4
+.IX Item "-mtp=name"
+Specify the access model for the thread local storage pointer. The valid
+models are \fBsoft\fR, which generates calls to \f(CW\*(C`_\|_aeabi_read_tp\*(C'\fR,
+\&\fBcp15\fR, which fetches the thread pointer from \f(CW\*(C`cp15\*(C'\fR directly
+(supported in the arm6k architecture), and \fBauto\fR, which uses the
+best available method for the selected processor. The default setting is
+\&\fBauto\fR.
+.IP "\fB\-mword\-relocations\fR" 4
+.IX Item "-mword-relocations"
+Only generate absolute relocations on word sized values (i.e. R_ARM_ABS32).
+This is enabled by default on targets (uClinux, SymbianOS) where the runtime
+loader imposes this restriction, and when \fB\-fpic\fR or \fB\-fPIC\fR
+is specified.
+.PP
+\fI\s-1AVR\s0 Options\fR
+.IX Subsection "AVR Options"
+.PP
+These options are defined for \s-1AVR\s0 implementations:
+.IP "\fB\-mmcu=\fR\fImcu\fR" 4
+.IX Item "-mmcu=mcu"
+Specify \s-1ATMEL\s0 \s-1AVR\s0 instruction set or \s-1MCU\s0 type.
+.Sp
+Instruction set avr1 is for the minimal \s-1AVR\s0 core, not supported by the C
+compiler, only for assembler programs (\s-1MCU\s0 types: at90s1200, attiny10,
+attiny11, attiny12, attiny15, attiny28).
+.Sp
+Instruction set avr2 (default) is for the classic \s-1AVR\s0 core with up to
+8K program memory space (\s-1MCU\s0 types: at90s2313, at90s2323, attiny22,
+at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
+at90c8534, at90s8535).
+.Sp
+Instruction set avr3 is for the classic \s-1AVR\s0 core with up to 128K program
+memory space (\s-1MCU\s0 types: atmega103, atmega603, at43usb320, at76c711).
+.Sp
+Instruction set avr4 is for the enhanced \s-1AVR\s0 core with up to 8K program
+memory space (\s-1MCU\s0 types: atmega8, atmega83, atmega85).
+.Sp
+Instruction set avr5 is for the enhanced \s-1AVR\s0 core with up to 128K program
+memory space (\s-1MCU\s0 types: atmega16, atmega161, atmega163, atmega32, atmega323,
+atmega64, atmega128, at43usb355, at94k).
+.IP "\fB\-msize\fR" 4
+.IX Item "-msize"
+Output instruction sizes to the asm file.
+.IP "\fB\-mno\-interrupts\fR" 4
+.IX Item "-mno-interrupts"
+Generated code is not compatible with hardware interrupts.
+Code size will be smaller.
+.IP "\fB\-mcall\-prologues\fR" 4
+.IX Item "-mcall-prologues"
+Functions prologues/epilogues expanded as call to appropriate
+subroutines. Code size will be smaller.
+.IP "\fB\-mno\-tablejump\fR" 4
+.IX Item "-mno-tablejump"
+Do not generate tablejump insns which sometimes increase code size.
+The option is now deprecated in favor of the equivalent
+\&\fB\-fno\-jump\-tables\fR
+.IP "\fB\-mtiny\-stack\fR" 4
+.IX Item "-mtiny-stack"
+Change only the low 8 bits of the stack pointer.
+.IP "\fB\-mint8\fR" 4
+.IX Item "-mint8"
+Assume int to be 8 bit integer. This affects the sizes of all types: A
+char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
+and long long will be 4 bytes. Please note that this option does not
+comply to the C standards, but it will provide you with smaller code
+size.
+.PP
+\fIBlackfin Options\fR
+.IX Subsection "Blackfin Options"
+.IP "\fB\-mcpu=\fR\fIcpu\fR[\fB\-\fR\fIsirevision\fR]" 4
+.IX Item "-mcpu=cpu[-sirevision]"
+Specifies the name of the target Blackfin processor. Currently, \fIcpu\fR
+can be one of \fBbf512\fR, \fBbf514\fR, \fBbf516\fR, \fBbf518\fR,
+\&\fBbf522\fR, \fBbf523\fR, \fBbf524\fR, \fBbf525\fR, \fBbf526\fR,
+\&\fBbf527\fR, \fBbf531\fR, \fBbf532\fR, \fBbf533\fR,
+\&\fBbf534\fR, \fBbf536\fR, \fBbf537\fR, \fBbf538\fR, \fBbf539\fR,
+\&\fBbf542\fR, \fBbf544\fR, \fBbf547\fR, \fBbf548\fR, \fBbf549\fR,
+\&\fBbf561\fR.
+The optional \fIsirevision\fR specifies the silicon revision of the target
+Blackfin processor. Any workarounds available for the targeted silicon revision
+will be enabled. If \fIsirevision\fR is \fBnone\fR, no workarounds are enabled.
+If \fIsirevision\fR is \fBany\fR, all workarounds for the targeted processor
+will be enabled. The \f(CW\*(C`_\|_SILICON_REVISION_\|_\*(C'\fR macro is defined to two
+hexadecimal digits representing the major and minor numbers in the silicon
+revision. If \fIsirevision\fR is \fBnone\fR, the \f(CW\*(C`_\|_SILICON_REVISION_\|_\*(C'\fR
+is not defined. If \fIsirevision\fR is \fBany\fR, the
+\&\f(CW\*(C`_\|_SILICON_REVISION_\|_\*(C'\fR is defined to be \f(CW0xffff\fR.
+If this optional \fIsirevision\fR is not used, \s-1GCC\s0 assumes the latest known
+silicon revision of the targeted Blackfin processor.
+.Sp
+Support for \fBbf561\fR is incomplete. For \fBbf561\fR,
+Only the processor macro is defined.
+Without this option, \fBbf532\fR is used as the processor by default.
+The corresponding predefined processor macros for \fIcpu\fR is to
+be defined. And for \fBbfin-elf\fR toolchain, this causes the hardware \s-1BSP\s0
+provided by libgloss to be linked in if \fB\-msim\fR is not given.
+.IP "\fB\-msim\fR" 4
+.IX Item "-msim"
+Specifies that the program will be run on the simulator. This causes
+the simulator \s-1BSP\s0 provided by libgloss to be linked in. This option
+has effect only for \fBbfin-elf\fR toolchain.
+Certain other options, such as \fB\-mid\-shared\-library\fR and
+\&\fB\-mfdpic\fR, imply \fB\-msim\fR.
+.IP "\fB\-momit\-leaf\-frame\-pointer\fR" 4
+.IX Item "-momit-leaf-frame-pointer"
+Don't keep the frame pointer in a register for leaf functions. This
+avoids the instructions to save, set up and restore frame pointers and
+makes an extra register available in leaf functions. The option
+\&\fB\-fomit\-frame\-pointer\fR removes the frame pointer for all functions
+which might make debugging harder.
+.IP "\fB\-mspecld\-anomaly\fR" 4
+.IX Item "-mspecld-anomaly"
+When enabled, the compiler will ensure that the generated code does not
+contain speculative loads after jump instructions. If this option is used,
+\&\f(CW\*(C`_\|_WORKAROUND_SPECULATIVE_LOADS\*(C'\fR is defined.
+.IP "\fB\-mno\-specld\-anomaly\fR" 4
+.IX Item "-mno-specld-anomaly"
+Don't generate extra code to prevent speculative loads from occurring.
+.IP "\fB\-mcsync\-anomaly\fR" 4
+.IX Item "-mcsync-anomaly"
+When enabled, the compiler will ensure that the generated code does not
+contain \s-1CSYNC\s0 or \s-1SSYNC\s0 instructions too soon after conditional branches.
+If this option is used, \f(CW\*(C`_\|_WORKAROUND_SPECULATIVE_SYNCS\*(C'\fR is defined.
+.IP "\fB\-mno\-csync\-anomaly\fR" 4
+.IX Item "-mno-csync-anomaly"
+Don't generate extra code to prevent \s-1CSYNC\s0 or \s-1SSYNC\s0 instructions from
+occurring too soon after a conditional branch.
+.IP "\fB\-mlow\-64k\fR" 4
+.IX Item "-mlow-64k"
+When enabled, the compiler is free to take advantage of the knowledge that
+the entire program fits into the low 64k of memory.
+.IP "\fB\-mno\-low\-64k\fR" 4
+.IX Item "-mno-low-64k"
+Assume that the program is arbitrarily large. This is the default.
+.IP "\fB\-mstack\-check\-l1\fR" 4
+.IX Item "-mstack-check-l1"
+Do stack checking using information placed into L1 scratchpad memory by the
+uClinux kernel.
+.IP "\fB\-mid\-shared\-library\fR" 4
+.IX Item "-mid-shared-library"
+Generate code that supports shared libraries via the library \s-1ID\s0 method.
+This allows for execute in place and shared libraries in an environment
+without virtual memory management. This option implies \fB\-fPIC\fR.
+With a \fBbfin-elf\fR target, this option implies \fB\-msim\fR.
+.IP "\fB\-mno\-id\-shared\-library\fR" 4
+.IX Item "-mno-id-shared-library"
+Generate code that doesn't assume \s-1ID\s0 based shared libraries are being used.
+This is the default.
+.IP "\fB\-mleaf\-id\-shared\-library\fR" 4
+.IX Item "-mleaf-id-shared-library"
+Generate code that supports shared libraries via the library \s-1ID\s0 method,
+but assumes that this library or executable won't link against any other
+\&\s-1ID\s0 shared libraries. That allows the compiler to use faster code for jumps
+and calls.
+.IP "\fB\-mno\-leaf\-id\-shared\-library\fR" 4
+.IX Item "-mno-leaf-id-shared-library"
+Do not assume that the code being compiled won't link against any \s-1ID\s0 shared
+libraries. Slower code will be generated for jump and call insns.
+.IP "\fB\-mshared\-library\-id=n\fR" 4
+.IX Item "-mshared-library-id=n"
+Specified the identification number of the \s-1ID\s0 based shared library being
+compiled. Specifying a value of 0 will generate more compact code, specifying
+other values will force the allocation of that number to the current
+library but is no more space or time efficient than omitting this option.
+.IP "\fB\-msep\-data\fR" 4
+.IX Item "-msep-data"
+Generate code that allows the data segment to be located in a different
+area of memory from the text segment. This allows for execute in place in
+an environment without virtual memory management by eliminating relocations
+against the text section.
+.IP "\fB\-mno\-sep\-data\fR" 4
+.IX Item "-mno-sep-data"
+Generate code that assumes that the data segment follows the text segment.
+This is the default.
+.IP "\fB\-mlong\-calls\fR" 4
+.IX Item "-mlong-calls"
+.PD 0
+.IP "\fB\-mno\-long\-calls\fR" 4
+.IX Item "-mno-long-calls"
+.PD
+Tells the compiler to perform function calls by first loading the
+address of the function into a register and then performing a subroutine
+call on this register. This switch is needed if the target function
+will lie outside of the 24 bit addressing range of the offset based
+version of subroutine call instruction.
+.Sp
+This feature is not enabled by default. Specifying
+\&\fB\-mno\-long\-calls\fR will restore the default behavior. Note these
+switches have no effect on how the compiler generates code to handle
+function calls via function pointers.
+.IP "\fB\-mfast\-fp\fR" 4
+.IX Item "-mfast-fp"
+Link with the fast floating-point library. This library relaxes some of
+the \s-1IEEE\s0 floating-point standard's rules for checking inputs against
+Not-a-Number (\s-1NAN\s0), in the interest of performance.
+.IP "\fB\-minline\-plt\fR" 4
+.IX Item "-minline-plt"
+Enable inlining of \s-1PLT\s0 entries in function calls to functions that are
+not known to bind locally. It has no effect without \fB\-mfdpic\fR.
+.IP "\fB\-mmulticore\fR" 4
+.IX Item "-mmulticore"
+Build standalone application for multicore Blackfin processor. Proper
+start files and link scripts will be used to support multicore.
+This option defines \f(CW\*(C`_\|_BFIN_MULTICORE\*(C'\fR. It can only be used with
+\&\fB\-mcpu=bf561\fR[\fB\-\fR\fIsirevision\fR]. It can be used with
+\&\fB\-mcorea\fR or \fB\-mcoreb\fR. If it's used without
+\&\fB\-mcorea\fR or \fB\-mcoreb\fR, single application/dual core
+programming model is used. In this model, the main function of Core B
+should be named as coreb_main. If it's used with \fB\-mcorea\fR or
+\&\fB\-mcoreb\fR, one application per core programming model is used.
+If this option is not used, single core application programming
+model is used.
+.IP "\fB\-mcorea\fR" 4
+.IX Item "-mcorea"
+Build standalone application for Core A of \s-1BF561\s0 when using
+one application per core programming model. Proper start files
+and link scripts will be used to support Core A. This option
+defines \f(CW\*(C`_\|_BFIN_COREA\*(C'\fR. It must be used with \fB\-mmulticore\fR.
+.IP "\fB\-mcoreb\fR" 4
+.IX Item "-mcoreb"
+Build standalone application for Core B of \s-1BF561\s0 when using
+one application per core programming model. Proper start files
+and link scripts will be used to support Core B. This option
+defines \f(CW\*(C`_\|_BFIN_COREB\*(C'\fR. When this option is used, coreb_main
+should be used instead of main. It must be used with
+\&\fB\-mmulticore\fR.
+.IP "\fB\-msdram\fR" 4
+.IX Item "-msdram"
+Build standalone application for \s-1SDRAM\s0. Proper start files and
+link scripts will be used to put the application into \s-1SDRAM\s0.
+Loader should initialize \s-1SDRAM\s0 before loading the application
+into \s-1SDRAM\s0. This option defines \f(CW\*(C`_\|_BFIN_SDRAM\*(C'\fR.
+.IP "\fB\-micplb\fR" 4
+.IX Item "-micplb"
+Assume that ICPLBs are enabled at runtime. This has an effect on certain
+anomaly workarounds. For Linux targets, the default is to assume ICPLBs
+are enabled; for standalone applications the default is off.
+.PP
+\fI\s-1CRIS\s0 Options\fR
+.IX Subsection "CRIS Options"
+.PP
+These options are defined specifically for the \s-1CRIS\s0 ports.
+.IP "\fB\-march=\fR\fIarchitecture-type\fR" 4
+.IX Item "-march=architecture-type"
+.PD 0
+.IP "\fB\-mcpu=\fR\fIarchitecture-type\fR" 4
+.IX Item "-mcpu=architecture-type"
+.PD
+Generate code for the specified architecture. The choices for
+\&\fIarchitecture-type\fR are \fBv3\fR, \fBv8\fR and \fBv10\fR for
+respectively \s-1ETRAX\s0\ 4, \s-1ETRAX\s0\ 100, and \s-1ETRAX\s0\ 100\ \s-1LX\s0.
+Default is \fBv0\fR except for cris-axis-linux-gnu, where the default is
+\&\fBv10\fR.
+.IP "\fB\-mtune=\fR\fIarchitecture-type\fR" 4
+.IX Item "-mtune=architecture-type"
+Tune to \fIarchitecture-type\fR everything applicable about the generated
+code, except for the \s-1ABI\s0 and the set of available instructions. The
+choices for \fIarchitecture-type\fR are the same as for
+\&\fB\-march=\fR\fIarchitecture-type\fR.
+.IP "\fB\-mmax\-stack\-frame=\fR\fIn\fR" 4
+.IX Item "-mmax-stack-frame=n"
+Warn when the stack frame of a function exceeds \fIn\fR bytes.
+.IP "\fB\-metrax4\fR" 4
+.IX Item "-metrax4"
+.PD 0
+.IP "\fB\-metrax100\fR" 4
+.IX Item "-metrax100"
+.PD
+The options \fB\-metrax4\fR and \fB\-metrax100\fR are synonyms for
+\&\fB\-march=v3\fR and \fB\-march=v8\fR respectively.
+.IP "\fB\-mmul\-bug\-workaround\fR" 4
+.IX Item "-mmul-bug-workaround"
+.PD 0
+.IP "\fB\-mno\-mul\-bug\-workaround\fR" 4
+.IX Item "-mno-mul-bug-workaround"
+.PD
+Work around a bug in the \f(CW\*(C`muls\*(C'\fR and \f(CW\*(C`mulu\*(C'\fR instructions for \s-1CPU\s0
+models where it applies. This option is active by default.
+.IP "\fB\-mpdebug\fR" 4
+.IX Item "-mpdebug"
+Enable CRIS-specific verbose debug-related information in the assembly
+code. This option also has the effect to turn off the \fB#NO_APP\fR
+formatted-code indicator to the assembler at the beginning of the
+assembly file.
+.IP "\fB\-mcc\-init\fR" 4
+.IX Item "-mcc-init"
+Do not use condition-code results from previous instruction; always emit
+compare and test instructions before use of condition codes.
+.IP "\fB\-mno\-side\-effects\fR" 4
+.IX Item "-mno-side-effects"
+Do not emit instructions with side-effects in addressing modes other than
+post-increment.
+.IP "\fB\-mstack\-align\fR" 4
+.IX Item "-mstack-align"
+.PD 0
+.IP "\fB\-mno\-stack\-align\fR" 4
+.IX Item "-mno-stack-align"
+.IP "\fB\-mdata\-align\fR" 4
+.IX Item "-mdata-align"
+.IP "\fB\-mno\-data\-align\fR" 4
+.IX Item "-mno-data-align"
+.IP "\fB\-mconst\-align\fR" 4
+.IX Item "-mconst-align"
+.IP "\fB\-mno\-const\-align\fR" 4
+.IX Item "-mno-const-align"
+.PD
+These options (no-options) arranges (eliminate arrangements) for the
+stack-frame, individual data and constants to be aligned for the maximum
+single data access size for the chosen \s-1CPU\s0 model. The default is to
+arrange for 32\-bit alignment. \s-1ABI\s0 details such as structure layout are
+not affected by these options.
+.IP "\fB\-m32\-bit\fR" 4
+.IX Item "-m32-bit"
+.PD 0
+.IP "\fB\-m16\-bit\fR" 4
+.IX Item "-m16-bit"
+.IP "\fB\-m8\-bit\fR" 4
+.IX Item "-m8-bit"
+.PD
+Similar to the stack\- data\- and const-align options above, these options
+arrange for stack-frame, writable data and constants to all be 32\-bit,
+16\-bit or 8\-bit aligned. The default is 32\-bit alignment.
+.IP "\fB\-mno\-prologue\-epilogue\fR" 4
+.IX Item "-mno-prologue-epilogue"
+.PD 0
+.IP "\fB\-mprologue\-epilogue\fR" 4
+.IX Item "-mprologue-epilogue"
+.PD
+With \fB\-mno\-prologue\-epilogue\fR, the normal function prologue and
+epilogue that sets up the stack-frame are omitted and no return
+instructions or return sequences are generated in the code. Use this
+option only together with visual inspection of the compiled code: no
+warnings or errors are generated when call-saved registers must be saved,
+or storage for local variable needs to be allocated.
+.IP "\fB\-mno\-gotplt\fR" 4
+.IX Item "-mno-gotplt"
+.PD 0
+.IP "\fB\-mgotplt\fR" 4
+.IX Item "-mgotplt"
+.PD
+With \fB\-fpic\fR and \fB\-fPIC\fR, don't generate (do generate)
+instruction sequences that load addresses for functions from the \s-1PLT\s0 part
+of the \s-1GOT\s0 rather than (traditional on other architectures) calls to the
+\&\s-1PLT\s0. The default is \fB\-mgotplt\fR.
+.IP "\fB\-melf\fR" 4
+.IX Item "-melf"
+Legacy no-op option only recognized with the cris-axis-elf and
+cris-axis-linux-gnu targets.
+.IP "\fB\-mlinux\fR" 4
+.IX Item "-mlinux"
+Legacy no-op option only recognized with the cris-axis-linux-gnu target.
+.IP "\fB\-sim\fR" 4
+.IX Item "-sim"
+This option, recognized for the cris-axis-elf arranges
+to link with input-output functions from a simulator library. Code,
+initialized data and zero-initialized data are allocated consecutively.
+.IP "\fB\-sim2\fR" 4
+.IX Item "-sim2"
+Like \fB\-sim\fR, but pass linker options to locate initialized data at
+0x40000000 and zero-initialized data at 0x80000000.
+.PP
+\fI\s-1CRX\s0 Options\fR
+.IX Subsection "CRX Options"
+.PP
+These options are defined specifically for the \s-1CRX\s0 ports.
+.IP "\fB\-mmac\fR" 4
+.IX Item "-mmac"
+Enable the use of multiply-accumulate instructions. Disabled by default.
+.IP "\fB\-mpush\-args\fR" 4
+.IX Item "-mpush-args"
+Push instructions will be used to pass outgoing arguments when functions
+are called. Enabled by default.
+.PP
+\fIDarwin Options\fR
+.IX Subsection "Darwin Options"
+.PP
+These options are defined for all architectures running the Darwin operating
+system.
+.PP
+\&\s-1FSF\s0 \s-1GCC\s0 on Darwin does not create \*(L"fat\*(R" object files; it will create
+an object file for the single architecture that it was built to
+target. Apple's \s-1GCC\s0 on Darwin does create \*(L"fat\*(R" files if multiple
+\&\fB\-arch\fR options are used; it does so by running the compiler or
+linker multiple times and joining the results together with
+\&\fIlipo\fR.
+.PP
+The subtype of the file created (like \fBppc7400\fR or \fBppc970\fR or
+\&\fBi686\fR) is determined by the flags that specify the \s-1ISA\s0
+that \s-1GCC\s0 is targetting, like \fB\-mcpu\fR or \fB\-march\fR. The
+\&\fB\-force_cpusubtype_ALL\fR option can be used to override this.
+.PP
+The Darwin tools vary in their behavior when presented with an \s-1ISA\s0
+mismatch. The assembler, \fIas\fR, will only permit instructions to
+be used that are valid for the subtype of the file it is generating,
+so you cannot put 64\-bit instructions in an \fBppc750\fR object file.
+The linker for shared libraries, \fI/usr/bin/libtool\fR, will fail
+and print an error if asked to create a shared library with a less
+restrictive subtype than its input files (for instance, trying to put
+a \fBppc970\fR object file in a \fBppc7400\fR library). The linker
+for executables, \fIld\fR, will quietly give the executable the most
+restrictive subtype of any of its input files.
+.IP "\fB\-F\fR\fIdir\fR" 4
+.IX Item "-Fdir"
+Add the framework directory \fIdir\fR to the head of the list of
+directories to be searched for header files. These directories are
+interleaved with those specified by \fB\-I\fR options and are
+scanned in a left-to-right order.
+.Sp
+A framework directory is a directory with frameworks in it. A
+framework is a directory with a \fB\*(L"Headers\*(R"\fR and/or
+\&\fB\*(L"PrivateHeaders\*(R"\fR directory contained directly in it that ends
+in \fB\*(L".framework\*(R"\fR. The name of a framework is the name of this
+directory excluding the \fB\*(L".framework\*(R"\fR. Headers associated with
+the framework are found in one of those two directories, with
+\&\fB\*(L"Headers\*(R"\fR being searched first. A subframework is a framework
+directory that is in a framework's \fB\*(L"Frameworks\*(R"\fR directory.
+Includes of subframework headers can only appear in a header of a
+framework that contains the subframework, or in a sibling subframework
+header. Two subframeworks are siblings if they occur in the same
+framework. A subframework should not have the same name as a
+framework, a warning will be issued if this is violated. Currently a
+subframework cannot have subframeworks, in the future, the mechanism
+may be extended to support this. The standard frameworks can be found
+in \fB\*(L"/System/Library/Frameworks\*(R"\fR and
+\&\fB\*(L"/Library/Frameworks\*(R"\fR. An example include looks like
+\&\f(CW\*(C`#include <Framework/header.h>\*(C'\fR, where \fBFramework\fR denotes
+the name of the framework and header.h is found in the
+\&\fB\*(L"PrivateHeaders\*(R"\fR or \fB\*(L"Headers\*(R"\fR directory.
+.IP "\fB\-iframework\fR\fIdir\fR" 4
+.IX Item "-iframeworkdir"
+Like \fB\-F\fR except the directory is a treated as a system
+directory. The main difference between this \fB\-iframework\fR and
+\&\fB\-F\fR is that with \fB\-iframework\fR the compiler does not
+warn about constructs contained within header files found via
+\&\fIdir\fR. This option is valid only for the C family of languages.
+.IP "\fB\-gused\fR" 4
+.IX Item "-gused"
+Emit debugging information for symbols that are used. For \s-1STABS\s0
+debugging format, this enables \fB\-feliminate\-unused\-debug\-symbols\fR.
+This is by default \s-1ON\s0.
+.IP "\fB\-gfull\fR" 4
+.IX Item "-gfull"
+Emit debugging information for all symbols and types.
+.IP "\fB\-mmacosx\-version\-min=\fR\fIversion\fR" 4
+.IX Item "-mmacosx-version-min=version"
+The earliest version of MacOS X that this executable will run on
+is \fIversion\fR. Typical values of \fIversion\fR include \f(CW10.1\fR,
+\&\f(CW10.2\fR, and \f(CW10.3.9\fR.
+.Sp
+If the compiler was built to use the system's headers by default,
+then the default for this option is the system version on which the
+compiler is running, otherwise the default is to make choices which
+are compatible with as many systems and code bases as possible.
+.IP "\fB\-mkernel\fR" 4
+.IX Item "-mkernel"
+Enable kernel development mode. The \fB\-mkernel\fR option sets
+\&\fB\-static\fR, \fB\-fno\-common\fR, \fB\-fno\-cxa\-atexit\fR,
+\&\fB\-fno\-exceptions\fR, \fB\-fno\-non\-call\-exceptions\fR,
+\&\fB\-fapple\-kext\fR, \fB\-fno\-weak\fR and \fB\-fno\-rtti\fR where
+applicable. This mode also sets \fB\-mno\-altivec\fR,
+\&\fB\-msoft\-float\fR, \fB\-fno\-builtin\fR and
+\&\fB\-mlong\-branch\fR for PowerPC targets.
+.IP "\fB\-mone\-byte\-bool\fR" 4
+.IX Item "-mone-byte-bool"
+Override the defaults for \fBbool\fR so that \fBsizeof(bool)==1\fR.
+By default \fBsizeof(bool)\fR is \fB4\fR when compiling for
+Darwin/PowerPC and \fB1\fR when compiling for Darwin/x86, so this
+option has no effect on x86.
+.Sp
+\&\fBWarning:\fR The \fB\-mone\-byte\-bool\fR switch causes \s-1GCC\s0
+to generate code that is not binary compatible with code generated
+without that switch. Using this switch may require recompiling all
+other modules in a program, including system libraries. Use this
+switch to conform to a non-default data model.
+.IP "\fB\-mfix\-and\-continue\fR" 4
+.IX Item "-mfix-and-continue"
+.PD 0
+.IP "\fB\-ffix\-and\-continue\fR" 4
+.IX Item "-ffix-and-continue"
+.IP "\fB\-findirect\-data\fR" 4
+.IX Item "-findirect-data"
+.PD
+Generate code suitable for fast turn around development. Needed to
+enable gdb to dynamically load \f(CW\*(C`.o\*(C'\fR files into already running
+programs. \fB\-findirect\-data\fR and \fB\-ffix\-and\-continue\fR
+are provided for backwards compatibility.
+.IP "\fB\-all_load\fR" 4
+.IX Item "-all_load"
+Loads all members of static archive libraries.
+See man \fIld\fR\|(1) for more information.
+.IP "\fB\-arch_errors_fatal\fR" 4
+.IX Item "-arch_errors_fatal"
+Cause the errors having to do with files that have the wrong architecture
+to be fatal.
+.IP "\fB\-bind_at_load\fR" 4
+.IX Item "-bind_at_load"
+Causes the output file to be marked such that the dynamic linker will
+bind all undefined references when the file is loaded or launched.
+.IP "\fB\-bundle\fR" 4
+.IX Item "-bundle"
+Produce a Mach-o bundle format file.
+See man \fIld\fR\|(1) for more information.
+.IP "\fB\-bundle_loader\fR \fIexecutable\fR" 4
+.IX Item "-bundle_loader executable"
+This option specifies the \fIexecutable\fR that will be loading the build
+output file being linked. See man \fIld\fR\|(1) for more information.
+.IP "\fB\-dynamiclib\fR" 4
+.IX Item "-dynamiclib"
+When passed this option, \s-1GCC\s0 will produce a dynamic library instead of
+an executable when linking, using the Darwin \fIlibtool\fR command.
+.IP "\fB\-force_cpusubtype_ALL\fR" 4
+.IX Item "-force_cpusubtype_ALL"
+This causes \s-1GCC\s0's output file to have the \fI\s-1ALL\s0\fR subtype, instead of
+one controlled by the \fB\-mcpu\fR or \fB\-march\fR option.
+.IP "\fB\-allowable_client\fR \fIclient_name\fR" 4
+.IX Item "-allowable_client client_name"
+.PD 0
+.IP "\fB\-client_name\fR" 4
+.IX Item "-client_name"
+.IP "\fB\-compatibility_version\fR" 4
+.IX Item "-compatibility_version"
+.IP "\fB\-current_version\fR" 4
+.IX Item "-current_version"
+.IP "\fB\-dead_strip\fR" 4
+.IX Item "-dead_strip"
+.IP "\fB\-dependency\-file\fR" 4
+.IX Item "-dependency-file"
+.IP "\fB\-dylib_file\fR" 4
+.IX Item "-dylib_file"
+.IP "\fB\-dylinker_install_name\fR" 4
+.IX Item "-dylinker_install_name"
+.IP "\fB\-dynamic\fR" 4
+.IX Item "-dynamic"
+.IP "\fB\-exported_symbols_list\fR" 4
+.IX Item "-exported_symbols_list"
+.IP "\fB\-filelist\fR" 4
+.IX Item "-filelist"
+.IP "\fB\-flat_namespace\fR" 4
+.IX Item "-flat_namespace"
+.IP "\fB\-force_flat_namespace\fR" 4
+.IX Item "-force_flat_namespace"
+.IP "\fB\-headerpad_max_install_names\fR" 4
+.IX Item "-headerpad_max_install_names"
+.IP "\fB\-image_base\fR" 4
+.IX Item "-image_base"
+.IP "\fB\-init\fR" 4
+.IX Item "-init"
+.IP "\fB\-install_name\fR" 4
+.IX Item "-install_name"
+.IP "\fB\-keep_private_externs\fR" 4
+.IX Item "-keep_private_externs"
+.IP "\fB\-multi_module\fR" 4
+.IX Item "-multi_module"
+.IP "\fB\-multiply_defined\fR" 4
+.IX Item "-multiply_defined"
+.IP "\fB\-multiply_defined_unused\fR" 4
+.IX Item "-multiply_defined_unused"
+.IP "\fB\-noall_load\fR" 4
+.IX Item "-noall_load"
+.IP "\fB\-no_dead_strip_inits_and_terms\fR" 4
+.IX Item "-no_dead_strip_inits_and_terms"
+.IP "\fB\-nofixprebinding\fR" 4
+.IX Item "-nofixprebinding"
+.IP "\fB\-nomultidefs\fR" 4
+.IX Item "-nomultidefs"
+.IP "\fB\-noprebind\fR" 4
+.IX Item "-noprebind"
+.IP "\fB\-noseglinkedit\fR" 4
+.IX Item "-noseglinkedit"
+.IP "\fB\-pagezero_size\fR" 4
+.IX Item "-pagezero_size"
+.IP "\fB\-prebind\fR" 4
+.IX Item "-prebind"
+.IP "\fB\-prebind_all_twolevel_modules\fR" 4
+.IX Item "-prebind_all_twolevel_modules"
+.IP "\fB\-private_bundle\fR" 4
+.IX Item "-private_bundle"
+.IP "\fB\-read_only_relocs\fR" 4
+.IX Item "-read_only_relocs"
+.IP "\fB\-sectalign\fR" 4
+.IX Item "-sectalign"
+.IP "\fB\-sectobjectsymbols\fR" 4
+.IX Item "-sectobjectsymbols"
+.IP "\fB\-whyload\fR" 4
+.IX Item "-whyload"
+.IP "\fB\-seg1addr\fR" 4
+.IX Item "-seg1addr"
+.IP "\fB\-sectcreate\fR" 4
+.IX Item "-sectcreate"
+.IP "\fB\-sectobjectsymbols\fR" 4
+.IX Item "-sectobjectsymbols"
+.IP "\fB\-sectorder\fR" 4
+.IX Item "-sectorder"
+.IP "\fB\-segaddr\fR" 4
+.IX Item "-segaddr"
+.IP "\fB\-segs_read_only_addr\fR" 4
+.IX Item "-segs_read_only_addr"
+.IP "\fB\-segs_read_write_addr\fR" 4
+.IX Item "-segs_read_write_addr"
+.IP "\fB\-seg_addr_table\fR" 4
+.IX Item "-seg_addr_table"
+.IP "\fB\-seg_addr_table_filename\fR" 4
+.IX Item "-seg_addr_table_filename"
+.IP "\fB\-seglinkedit\fR" 4
+.IX Item "-seglinkedit"
+.IP "\fB\-segprot\fR" 4
+.IX Item "-segprot"
+.IP "\fB\-segs_read_only_addr\fR" 4
+.IX Item "-segs_read_only_addr"
+.IP "\fB\-segs_read_write_addr\fR" 4
+.IX Item "-segs_read_write_addr"
+.IP "\fB\-single_module\fR" 4
+.IX Item "-single_module"
+.IP "\fB\-static\fR" 4
+.IX Item "-static"
+.IP "\fB\-sub_library\fR" 4
+.IX Item "-sub_library"
+.IP "\fB\-sub_umbrella\fR" 4
+.IX Item "-sub_umbrella"
+.IP "\fB\-twolevel_namespace\fR" 4
+.IX Item "-twolevel_namespace"
+.IP "\fB\-umbrella\fR" 4
+.IX Item "-umbrella"
+.IP "\fB\-undefined\fR" 4
+.IX Item "-undefined"
+.IP "\fB\-unexported_symbols_list\fR" 4
+.IX Item "-unexported_symbols_list"
+.IP "\fB\-weak_reference_mismatches\fR" 4
+.IX Item "-weak_reference_mismatches"
+.IP "\fB\-whatsloaded\fR" 4
+.IX Item "-whatsloaded"
+.PD
+These options are passed to the Darwin linker. The Darwin linker man page
+describes them in detail.
+.PP
+\fI\s-1DEC\s0 Alpha Options\fR
+.IX Subsection "DEC Alpha Options"
+.PP
+These \fB\-m\fR options are defined for the \s-1DEC\s0 Alpha implementations:
+.IP "\fB\-mno\-soft\-float\fR" 4
+.IX Item "-mno-soft-float"
+.PD 0
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+.PD
+Use (do not use) the hardware floating-point instructions for
+floating-point operations. When \fB\-msoft\-float\fR is specified,
+functions in \fIlibgcc.a\fR will be used to perform floating-point
+operations. Unless they are replaced by routines that emulate the
+floating-point operations, or compiled in such a way as to call such
+emulations routines, these routines will issue floating-point
+operations. If you are compiling for an Alpha without floating-point
+operations, you must ensure that the library is built so as not to call
+them.
+.Sp
+Note that Alpha implementations without floating-point operations are
+required to have floating-point registers.
+.IP "\fB\-mfp\-reg\fR" 4
+.IX Item "-mfp-reg"
+.PD 0
+.IP "\fB\-mno\-fp\-regs\fR" 4
+.IX Item "-mno-fp-regs"
+.PD
+Generate code that uses (does not use) the floating-point register set.
+\&\fB\-mno\-fp\-regs\fR implies \fB\-msoft\-float\fR. If the floating-point
+register set is not used, floating point operands are passed in integer
+registers as if they were integers and floating-point results are passed
+in \f(CW$0\fR instead of \f(CW$f0\fR. This is a non-standard calling sequence,
+so any function with a floating-point argument or return value called by code
+compiled with \fB\-mno\-fp\-regs\fR must also be compiled with that
+option.
+.Sp
+A typical use of this option is building a kernel that does not use,
+and hence need not save and restore, any floating-point registers.
+.IP "\fB\-mieee\fR" 4
+.IX Item "-mieee"
+The Alpha architecture implements floating-point hardware optimized for
+maximum performance. It is mostly compliant with the \s-1IEEE\s0 floating
+point standard. However, for full compliance, software assistance is
+required. This option generates code fully \s-1IEEE\s0 compliant code
+\&\fIexcept\fR that the \fIinexact-flag\fR is not maintained (see below).
+If this option is turned on, the preprocessor macro \f(CW\*(C`_IEEE_FP\*(C'\fR is
+defined during compilation. The resulting code is less efficient but is
+able to correctly support denormalized numbers and exceptional \s-1IEEE\s0
+values such as not-a-number and plus/minus infinity. Other Alpha
+compilers call this option \fB\-ieee_with_no_inexact\fR.
+.IP "\fB\-mieee\-with\-inexact\fR" 4
+.IX Item "-mieee-with-inexact"
+This is like \fB\-mieee\fR except the generated code also maintains
+the \s-1IEEE\s0 \fIinexact-flag\fR. Turning on this option causes the
+generated code to implement fully-compliant \s-1IEEE\s0 math. In addition to
+\&\f(CW\*(C`_IEEE_FP\*(C'\fR, \f(CW\*(C`_IEEE_FP_EXACT\*(C'\fR is defined as a preprocessor
+macro. On some Alpha implementations the resulting code may execute
+significantly slower than the code generated by default. Since there is
+very little code that depends on the \fIinexact-flag\fR, you should
+normally not specify this option. Other Alpha compilers call this
+option \fB\-ieee_with_inexact\fR.
+.IP "\fB\-mfp\-trap\-mode=\fR\fItrap-mode\fR" 4
+.IX Item "-mfp-trap-mode=trap-mode"
+This option controls what floating-point related traps are enabled.
+Other Alpha compilers call this option \fB\-fptm\fR \fItrap-mode\fR.
+The trap mode can be set to one of four values:
+.RS 4
+.IP "\fBn\fR" 4
+.IX Item "n"
+This is the default (normal) setting. The only traps that are enabled
+are the ones that cannot be disabled in software (e.g., division by zero
+trap).
+.IP "\fBu\fR" 4
+.IX Item "u"
+In addition to the traps enabled by \fBn\fR, underflow traps are enabled
+as well.
+.IP "\fBsu\fR" 4
+.IX Item "su"
+Like \fBu\fR, but the instructions are marked to be safe for software
+completion (see Alpha architecture manual for details).
+.IP "\fBsui\fR" 4
+.IX Item "sui"
+Like \fBsu\fR, but inexact traps are enabled as well.
+.RE
+.RS 4
+.RE
+.IP "\fB\-mfp\-rounding\-mode=\fR\fIrounding-mode\fR" 4
+.IX Item "-mfp-rounding-mode=rounding-mode"
+Selects the \s-1IEEE\s0 rounding mode. Other Alpha compilers call this option
+\&\fB\-fprm\fR \fIrounding-mode\fR. The \fIrounding-mode\fR can be one
+of:
+.RS 4
+.IP "\fBn\fR" 4
+.IX Item "n"
+Normal \s-1IEEE\s0 rounding mode. Floating point numbers are rounded towards
+the nearest machine number or towards the even machine number in case
+of a tie.
+.IP "\fBm\fR" 4
+.IX Item "m"
+Round towards minus infinity.
+.IP "\fBc\fR" 4
+.IX Item "c"
+Chopped rounding mode. Floating point numbers are rounded towards zero.
+.IP "\fBd\fR" 4
+.IX Item "d"
+Dynamic rounding mode. A field in the floating point control register
+(\fIfpcr\fR, see Alpha architecture reference manual) controls the
+rounding mode in effect. The C library initializes this register for
+rounding towards plus infinity. Thus, unless your program modifies the
+\&\fIfpcr\fR, \fBd\fR corresponds to round towards plus infinity.
+.RE
+.RS 4
+.RE
+.IP "\fB\-mtrap\-precision=\fR\fItrap-precision\fR" 4
+.IX Item "-mtrap-precision=trap-precision"
+In the Alpha architecture, floating point traps are imprecise. This
+means without software assistance it is impossible to recover from a
+floating trap and program execution normally needs to be terminated.
+\&\s-1GCC\s0 can generate code that can assist operating system trap handlers
+in determining the exact location that caused a floating point trap.
+Depending on the requirements of an application, different levels of
+precisions can be selected:
+.RS 4
+.IP "\fBp\fR" 4
+.IX Item "p"
+Program precision. This option is the default and means a trap handler
+can only identify which program caused a floating point exception.
+.IP "\fBf\fR" 4
+.IX Item "f"
+Function precision. The trap handler can determine the function that
+caused a floating point exception.
+.IP "\fBi\fR" 4
+.IX Item "i"
+Instruction precision. The trap handler can determine the exact
+instruction that caused a floating point exception.
+.RE
+.RS 4
+.Sp
+Other Alpha compilers provide the equivalent options called
+\&\fB\-scope_safe\fR and \fB\-resumption_safe\fR.
+.RE
+.IP "\fB\-mieee\-conformant\fR" 4
+.IX Item "-mieee-conformant"
+This option marks the generated code as \s-1IEEE\s0 conformant. You must not
+use this option unless you also specify \fB\-mtrap\-precision=i\fR and either
+\&\fB\-mfp\-trap\-mode=su\fR or \fB\-mfp\-trap\-mode=sui\fR. Its only effect
+is to emit the line \fB.eflag 48\fR in the function prologue of the
+generated assembly file. Under \s-1DEC\s0 Unix, this has the effect that
+IEEE-conformant math library routines will be linked in.
+.IP "\fB\-mbuild\-constants\fR" 4
+.IX Item "-mbuild-constants"
+Normally \s-1GCC\s0 examines a 32\- or 64\-bit integer constant to
+see if it can construct it from smaller constants in two or three
+instructions. If it cannot, it will output the constant as a literal and
+generate code to load it from the data segment at runtime.
+.Sp
+Use this option to require \s-1GCC\s0 to construct \fIall\fR integer constants
+using code, even if it takes more instructions (the maximum is six).
+.Sp
+You would typically use this option to build a shared library dynamic
+loader. Itself a shared library, it must relocate itself in memory
+before it can find the variables and constants in its own data segment.
+.IP "\fB\-malpha\-as\fR" 4
+.IX Item "-malpha-as"
+.PD 0
+.IP "\fB\-mgas\fR" 4
+.IX Item "-mgas"
+.PD
+Select whether to generate code to be assembled by the vendor-supplied
+assembler (\fB\-malpha\-as\fR) or by the \s-1GNU\s0 assembler \fB\-mgas\fR.
+.IP "\fB\-mbwx\fR" 4
+.IX Item "-mbwx"
+.PD 0
+.IP "\fB\-mno\-bwx\fR" 4
+.IX Item "-mno-bwx"
+.IP "\fB\-mcix\fR" 4
+.IX Item "-mcix"
+.IP "\fB\-mno\-cix\fR" 4
+.IX Item "-mno-cix"
+.IP "\fB\-mfix\fR" 4
+.IX Item "-mfix"
+.IP "\fB\-mno\-fix\fR" 4
+.IX Item "-mno-fix"
+.IP "\fB\-mmax\fR" 4
+.IX Item "-mmax"
+.IP "\fB\-mno\-max\fR" 4
+.IX Item "-mno-max"
+.PD
+Indicate whether \s-1GCC\s0 should generate code to use the optional \s-1BWX\s0,
+\&\s-1CIX\s0, \s-1FIX\s0 and \s-1MAX\s0 instruction sets. The default is to use the instruction
+sets supported by the \s-1CPU\s0 type specified via \fB\-mcpu=\fR option or that
+of the \s-1CPU\s0 on which \s-1GCC\s0 was built if none was specified.
+.IP "\fB\-mfloat\-vax\fR" 4
+.IX Item "-mfloat-vax"
+.PD 0
+.IP "\fB\-mfloat\-ieee\fR" 4
+.IX Item "-mfloat-ieee"
+.PD
+Generate code that uses (does not use) \s-1VAX\s0 F and G floating point
+arithmetic instead of \s-1IEEE\s0 single and double precision.
+.IP "\fB\-mexplicit\-relocs\fR" 4
+.IX Item "-mexplicit-relocs"
+.PD 0
+.IP "\fB\-mno\-explicit\-relocs\fR" 4
+.IX Item "-mno-explicit-relocs"
+.PD
+Older Alpha assemblers provided no way to generate symbol relocations
+except via assembler macros. Use of these macros does not allow
+optimal instruction scheduling. \s-1GNU\s0 binutils as of version 2.12
+supports a new syntax that allows the compiler to explicitly mark
+which relocations should apply to which instructions. This option
+is mostly useful for debugging, as \s-1GCC\s0 detects the capabilities of
+the assembler when it is built and sets the default accordingly.
+.IP "\fB\-msmall\-data\fR" 4
+.IX Item "-msmall-data"
+.PD 0
+.IP "\fB\-mlarge\-data\fR" 4
+.IX Item "-mlarge-data"
+.PD
+When \fB\-mexplicit\-relocs\fR is in effect, static data is
+accessed via \fIgp-relative\fR relocations. When \fB\-msmall\-data\fR
+is used, objects 8 bytes long or smaller are placed in a \fIsmall data area\fR
+(the \f(CW\*(C`.sdata\*(C'\fR and \f(CW\*(C`.sbss\*(C'\fR sections) and are accessed via
+16\-bit relocations off of the \f(CW$gp\fR register. This limits the
+size of the small data area to 64KB, but allows the variables to be
+directly accessed via a single instruction.
+.Sp
+The default is \fB\-mlarge\-data\fR. With this option the data area
+is limited to just below 2GB. Programs that require more than 2GB of
+data must use \f(CW\*(C`malloc\*(C'\fR or \f(CW\*(C`mmap\*(C'\fR to allocate the data in the
+heap instead of in the program's data segment.
+.Sp
+When generating code for shared libraries, \fB\-fpic\fR implies
+\&\fB\-msmall\-data\fR and \fB\-fPIC\fR implies \fB\-mlarge\-data\fR.
+.IP "\fB\-msmall\-text\fR" 4
+.IX Item "-msmall-text"
+.PD 0
+.IP "\fB\-mlarge\-text\fR" 4
+.IX Item "-mlarge-text"
+.PD
+When \fB\-msmall\-text\fR is used, the compiler assumes that the
+code of the entire program (or shared library) fits in 4MB, and is
+thus reachable with a branch instruction. When \fB\-msmall\-data\fR
+is used, the compiler can assume that all local symbols share the
+same \f(CW$gp\fR value, and thus reduce the number of instructions
+required for a function call from 4 to 1.
+.Sp
+The default is \fB\-mlarge\-text\fR.
+.IP "\fB\-mcpu=\fR\fIcpu_type\fR" 4
+.IX Item "-mcpu=cpu_type"
+Set the instruction set and instruction scheduling parameters for
+machine type \fIcpu_type\fR. You can specify either the \fB\s-1EV\s0\fR
+style name or the corresponding chip number. \s-1GCC\s0 supports scheduling
+parameters for the \s-1EV4\s0, \s-1EV5\s0 and \s-1EV6\s0 family of processors and will
+choose the default values for the instruction set from the processor
+you specify. If you do not specify a processor type, \s-1GCC\s0 will default
+to the processor on which the compiler was built.
+.Sp
+Supported values for \fIcpu_type\fR are
+.RS 4
+.IP "\fBev4\fR" 4
+.IX Item "ev4"
+.PD 0
+.IP "\fBev45\fR" 4
+.IX Item "ev45"
+.IP "\fB21064\fR" 4
+.IX Item "21064"
+.PD
+Schedules as an \s-1EV4\s0 and has no instruction set extensions.
+.IP "\fBev5\fR" 4
+.IX Item "ev5"
+.PD 0
+.IP "\fB21164\fR" 4
+.IX Item "21164"
+.PD
+Schedules as an \s-1EV5\s0 and has no instruction set extensions.
+.IP "\fBev56\fR" 4
+.IX Item "ev56"
+.PD 0
+.IP "\fB21164a\fR" 4
+.IX Item "21164a"
+.PD
+Schedules as an \s-1EV5\s0 and supports the \s-1BWX\s0 extension.
+.IP "\fBpca56\fR" 4
+.IX Item "pca56"
+.PD 0
+.IP "\fB21164pc\fR" 4
+.IX Item "21164pc"
+.IP "\fB21164PC\fR" 4
+.IX Item "21164PC"
+.PD
+Schedules as an \s-1EV5\s0 and supports the \s-1BWX\s0 and \s-1MAX\s0 extensions.
+.IP "\fBev6\fR" 4
+.IX Item "ev6"
+.PD 0
+.IP "\fB21264\fR" 4
+.IX Item "21264"
+.PD
+Schedules as an \s-1EV6\s0 and supports the \s-1BWX\s0, \s-1FIX\s0, and \s-1MAX\s0 extensions.
+.IP "\fBev67\fR" 4
+.IX Item "ev67"
+.PD 0
+.IP "\fB21264a\fR" 4
+.IX Item "21264a"
+.PD
+Schedules as an \s-1EV6\s0 and supports the \s-1BWX\s0, \s-1CIX\s0, \s-1FIX\s0, and \s-1MAX\s0 extensions.
+.RE
+.RS 4
+.Sp
+Native Linux/GNU toolchains also support the value \fBnative\fR,
+which selects the best architecture option for the host processor.
+\&\fB\-mcpu=native\fR has no effect if \s-1GCC\s0 does not recognize
+the processor.
+.RE
+.IP "\fB\-mtune=\fR\fIcpu_type\fR" 4
+.IX Item "-mtune=cpu_type"
+Set only the instruction scheduling parameters for machine type
+\&\fIcpu_type\fR. The instruction set is not changed.
+.Sp
+Native Linux/GNU toolchains also support the value \fBnative\fR,
+which selects the best architecture option for the host processor.
+\&\fB\-mtune=native\fR has no effect if \s-1GCC\s0 does not recognize
+the processor.
+.IP "\fB\-mmemory\-latency=\fR\fItime\fR" 4
+.IX Item "-mmemory-latency=time"
+Sets the latency the scheduler should assume for typical memory
+references as seen by the application. This number is highly
+dependent on the memory access patterns used by the application
+and the size of the external cache on the machine.
+.Sp
+Valid options for \fItime\fR are
+.RS 4
+.IP "\fInumber\fR" 4
+.IX Item "number"
+A decimal number representing clock cycles.
+.IP "\fBL1\fR" 4
+.IX Item "L1"
+.PD 0
+.IP "\fBL2\fR" 4
+.IX Item "L2"
+.IP "\fBL3\fR" 4
+.IX Item "L3"
+.IP "\fBmain\fR" 4
+.IX Item "main"
+.PD
+The compiler contains estimates of the number of clock cycles for
+\&\*(L"typical\*(R" \s-1EV4\s0 & \s-1EV5\s0 hardware for the Level 1, 2 & 3 caches
+(also called Dcache, Scache, and Bcache), as well as to main memory.
+Note that L3 is only valid for \s-1EV5\s0.
+.RE
+.RS 4
+.RE
+.PP
+\fI\s-1DEC\s0 Alpha/VMS Options\fR
+.IX Subsection "DEC Alpha/VMS Options"
+.PP
+These \fB\-m\fR options are defined for the \s-1DEC\s0 Alpha/VMS implementations:
+.IP "\fB\-mvms\-return\-codes\fR" 4
+.IX Item "-mvms-return-codes"
+Return \s-1VMS\s0 condition codes from main. The default is to return \s-1POSIX\s0
+style condition (e.g. error) codes.
+.PP
+\fI\s-1FR30\s0 Options\fR
+.IX Subsection "FR30 Options"
+.PP
+These options are defined specifically for the \s-1FR30\s0 port.
+.IP "\fB\-msmall\-model\fR" 4
+.IX Item "-msmall-model"
+Use the small address space model. This can produce smaller code, but
+it does assume that all symbolic values and addresses will fit into a
+20\-bit range.
+.IP "\fB\-mno\-lsim\fR" 4
+.IX Item "-mno-lsim"
+Assume that run-time support has been provided and so there is no need
+to include the simulator library (\fIlibsim.a\fR) on the linker
+command line.
+.PP
+\fI\s-1FRV\s0 Options\fR
+.IX Subsection "FRV Options"
+.IP "\fB\-mgpr\-32\fR" 4
+.IX Item "-mgpr-32"
+Only use the first 32 general purpose registers.
+.IP "\fB\-mgpr\-64\fR" 4
+.IX Item "-mgpr-64"
+Use all 64 general purpose registers.
+.IP "\fB\-mfpr\-32\fR" 4
+.IX Item "-mfpr-32"
+Use only the first 32 floating point registers.
+.IP "\fB\-mfpr\-64\fR" 4
+.IX Item "-mfpr-64"
+Use all 64 floating point registers
+.IP "\fB\-mhard\-float\fR" 4
+.IX Item "-mhard-float"
+Use hardware instructions for floating point operations.
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+Use library routines for floating point operations.
+.IP "\fB\-malloc\-cc\fR" 4
+.IX Item "-malloc-cc"
+Dynamically allocate condition code registers.
+.IP "\fB\-mfixed\-cc\fR" 4
+.IX Item "-mfixed-cc"
+Do not try to dynamically allocate condition code registers, only
+use \f(CW\*(C`icc0\*(C'\fR and \f(CW\*(C`fcc0\*(C'\fR.
+.IP "\fB\-mdword\fR" 4
+.IX Item "-mdword"
+Change \s-1ABI\s0 to use double word insns.
+.IP "\fB\-mno\-dword\fR" 4
+.IX Item "-mno-dword"
+Do not use double word instructions.
+.IP "\fB\-mdouble\fR" 4
+.IX Item "-mdouble"
+Use floating point double instructions.
+.IP "\fB\-mno\-double\fR" 4
+.IX Item "-mno-double"
+Do not use floating point double instructions.
+.IP "\fB\-mmedia\fR" 4
+.IX Item "-mmedia"
+Use media instructions.
+.IP "\fB\-mno\-media\fR" 4
+.IX Item "-mno-media"
+Do not use media instructions.
+.IP "\fB\-mmuladd\fR" 4
+.IX Item "-mmuladd"
+Use multiply and add/subtract instructions.
+.IP "\fB\-mno\-muladd\fR" 4
+.IX Item "-mno-muladd"
+Do not use multiply and add/subtract instructions.
+.IP "\fB\-mfdpic\fR" 4
+.IX Item "-mfdpic"
+Select the \s-1FDPIC\s0 \s-1ABI\s0, that uses function descriptors to represent
+pointers to functions. Without any PIC/PIE\-related options, it
+implies \fB\-fPIE\fR. With \fB\-fpic\fR or \fB\-fpie\fR, it
+assumes \s-1GOT\s0 entries and small data are within a 12\-bit range from the
+\&\s-1GOT\s0 base address; with \fB\-fPIC\fR or \fB\-fPIE\fR, \s-1GOT\s0 offsets
+are computed with 32 bits.
+With a \fBbfin-elf\fR target, this option implies \fB\-msim\fR.
+.IP "\fB\-minline\-plt\fR" 4
+.IX Item "-minline-plt"
+Enable inlining of \s-1PLT\s0 entries in function calls to functions that are
+not known to bind locally. It has no effect without \fB\-mfdpic\fR.
+It's enabled by default if optimizing for speed and compiling for
+shared libraries (i.e., \fB\-fPIC\fR or \fB\-fpic\fR), or when an
+optimization option such as \fB\-O3\fR or above is present in the
+command line.
+.IP "\fB\-mTLS\fR" 4
+.IX Item "-mTLS"
+Assume a large \s-1TLS\s0 segment when generating thread-local code.
+.IP "\fB\-mtls\fR" 4
+.IX Item "-mtls"
+Do not assume a large \s-1TLS\s0 segment when generating thread-local code.
+.IP "\fB\-mgprel\-ro\fR" 4
+.IX Item "-mgprel-ro"
+Enable the use of \f(CW\*(C`GPREL\*(C'\fR relocations in the \s-1FDPIC\s0 \s-1ABI\s0 for data
+that is known to be in read-only sections. It's enabled by default,
+except for \fB\-fpic\fR or \fB\-fpie\fR: even though it may help
+make the global offset table smaller, it trades 1 instruction for 4.
+With \fB\-fPIC\fR or \fB\-fPIE\fR, it trades 3 instructions for 4,
+one of which may be shared by multiple symbols, and it avoids the need
+for a \s-1GOT\s0 entry for the referenced symbol, so it's more likely to be a
+win. If it is not, \fB\-mno\-gprel\-ro\fR can be used to disable it.
+.IP "\fB\-multilib\-library\-pic\fR" 4
+.IX Item "-multilib-library-pic"
+Link with the (library, not \s-1FD\s0) pic libraries. It's implied by
+\&\fB\-mlibrary\-pic\fR, as well as by \fB\-fPIC\fR and
+\&\fB\-fpic\fR without \fB\-mfdpic\fR. You should never have to use
+it explicitly.
+.IP "\fB\-mlinked\-fp\fR" 4
+.IX Item "-mlinked-fp"
+Follow the \s-1EABI\s0 requirement of always creating a frame pointer whenever
+a stack frame is allocated. This option is enabled by default and can
+be disabled with \fB\-mno\-linked\-fp\fR.
+.IP "\fB\-mlong\-calls\fR" 4
+.IX Item "-mlong-calls"
+Use indirect addressing to call functions outside the current
+compilation unit. This allows the functions to be placed anywhere
+within the 32\-bit address space.
+.IP "\fB\-malign\-labels\fR" 4
+.IX Item "-malign-labels"
+Try to align labels to an 8\-byte boundary by inserting nops into the
+previous packet. This option only has an effect when \s-1VLIW\s0 packing
+is enabled. It doesn't create new packets; it merely adds nops to
+existing ones.
+.IP "\fB\-mlibrary\-pic\fR" 4
+.IX Item "-mlibrary-pic"
+Generate position-independent \s-1EABI\s0 code.
+.IP "\fB\-macc\-4\fR" 4
+.IX Item "-macc-4"
+Use only the first four media accumulator registers.
+.IP "\fB\-macc\-8\fR" 4
+.IX Item "-macc-8"
+Use all eight media accumulator registers.
+.IP "\fB\-mpack\fR" 4
+.IX Item "-mpack"
+Pack \s-1VLIW\s0 instructions.
+.IP "\fB\-mno\-pack\fR" 4
+.IX Item "-mno-pack"
+Do not pack \s-1VLIW\s0 instructions.
+.IP "\fB\-mno\-eflags\fR" 4
+.IX Item "-mno-eflags"
+Do not mark \s-1ABI\s0 switches in e_flags.
+.IP "\fB\-mcond\-move\fR" 4
+.IX Item "-mcond-move"
+Enable the use of conditional-move instructions (default).
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mno\-cond\-move\fR" 4
+.IX Item "-mno-cond-move"
+Disable the use of conditional-move instructions.
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mscc\fR" 4
+.IX Item "-mscc"
+Enable the use of conditional set instructions (default).
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mno\-scc\fR" 4
+.IX Item "-mno-scc"
+Disable the use of conditional set instructions.
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mcond\-exec\fR" 4
+.IX Item "-mcond-exec"
+Enable the use of conditional execution (default).
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mno\-cond\-exec\fR" 4
+.IX Item "-mno-cond-exec"
+Disable the use of conditional execution.
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mvliw\-branch\fR" 4
+.IX Item "-mvliw-branch"
+Run a pass to pack branches into \s-1VLIW\s0 instructions (default).
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mno\-vliw\-branch\fR" 4
+.IX Item "-mno-vliw-branch"
+Do not run a pass to pack branches into \s-1VLIW\s0 instructions.
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mmulti\-cond\-exec\fR" 4
+.IX Item "-mmulti-cond-exec"
+Enable optimization of \f(CW\*(C`&&\*(C'\fR and \f(CW\*(C`||\*(C'\fR in conditional execution
+(default).
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mno\-multi\-cond\-exec\fR" 4
+.IX Item "-mno-multi-cond-exec"
+Disable optimization of \f(CW\*(C`&&\*(C'\fR and \f(CW\*(C`||\*(C'\fR in conditional execution.
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mnested\-cond\-exec\fR" 4
+.IX Item "-mnested-cond-exec"
+Enable nested conditional execution optimizations (default).
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-mno\-nested\-cond\-exec\fR" 4
+.IX Item "-mno-nested-cond-exec"
+Disable nested conditional execution optimizations.
+.Sp
+This switch is mainly for debugging the compiler and will likely be removed
+in a future version.
+.IP "\fB\-moptimize\-membar\fR" 4
+.IX Item "-moptimize-membar"
+This switch removes redundant \f(CW\*(C`membar\*(C'\fR instructions from the
+compiler generated code. It is enabled by default.
+.IP "\fB\-mno\-optimize\-membar\fR" 4
+.IX Item "-mno-optimize-membar"
+This switch disables the automatic removal of redundant \f(CW\*(C`membar\*(C'\fR
+instructions from the generated code.
+.IP "\fB\-mtomcat\-stats\fR" 4
+.IX Item "-mtomcat-stats"
+Cause gas to print out tomcat statistics.
+.IP "\fB\-mcpu=\fR\fIcpu\fR" 4
+.IX Item "-mcpu=cpu"
+Select the processor type for which to generate code. Possible values are
+\&\fBfrv\fR, \fBfr550\fR, \fBtomcat\fR, \fBfr500\fR, \fBfr450\fR,
+\&\fBfr405\fR, \fBfr400\fR, \fBfr300\fR and \fBsimple\fR.
+.PP
+\fIGNU/Linux Options\fR
+.IX Subsection "GNU/Linux Options"
+.PP
+These \fB\-m\fR options are defined for GNU/Linux targets:
+.IP "\fB\-mglibc\fR" 4
+.IX Item "-mglibc"
+Use the \s-1GNU\s0 C library instead of uClibc. This is the default except
+on \fB*\-*\-linux\-*uclibc*\fR targets.
+.IP "\fB\-muclibc\fR" 4
+.IX Item "-muclibc"
+Use uClibc instead of the \s-1GNU\s0 C library. This is the default on
+\&\fB*\-*\-linux\-*uclibc*\fR targets.
+.PP
+\fIH8/300 Options\fR
+.IX Subsection "H8/300 Options"
+.PP
+These \fB\-m\fR options are defined for the H8/300 implementations:
+.IP "\fB\-mrelax\fR" 4
+.IX Item "-mrelax"
+Shorten some address references at link time, when possible; uses the
+linker option \fB\-relax\fR.
+.IP "\fB\-mh\fR" 4
+.IX Item "-mh"
+Generate code for the H8/300H.
+.IP "\fB\-ms\fR" 4
+.IX Item "-ms"
+Generate code for the H8S.
+.IP "\fB\-mn\fR" 4
+.IX Item "-mn"
+Generate code for the H8S and H8/300H in the normal mode. This switch
+must be used either with \fB\-mh\fR or \fB\-ms\fR.
+.IP "\fB\-ms2600\fR" 4
+.IX Item "-ms2600"
+Generate code for the H8S/2600. This switch must be used with \fB\-ms\fR.
+.IP "\fB\-mint32\fR" 4
+.IX Item "-mint32"
+Make \f(CW\*(C`int\*(C'\fR data 32 bits by default.
+.IP "\fB\-malign\-300\fR" 4
+.IX Item "-malign-300"
+On the H8/300H and H8S, use the same alignment rules as for the H8/300.
+The default for the H8/300H and H8S is to align longs and floats on 4
+byte boundaries.
+\&\fB\-malign\-300\fR causes them to be aligned on 2 byte boundaries.
+This option has no effect on the H8/300.
+.PP
+\fI\s-1HPPA\s0 Options\fR
+.IX Subsection "HPPA Options"
+.PP
+These \fB\-m\fR options are defined for the \s-1HPPA\s0 family of computers:
+.IP "\fB\-march=\fR\fIarchitecture-type\fR" 4
+.IX Item "-march=architecture-type"
+Generate code for the specified architecture. The choices for
+\&\fIarchitecture-type\fR are \fB1.0\fR for \s-1PA\s0 1.0, \fB1.1\fR for \s-1PA\s0
+1.1, and \fB2.0\fR for \s-1PA\s0 2.0 processors. Refer to
+\&\fI/usr/lib/sched.models\fR on an HP-UX system to determine the proper
+architecture option for your machine. Code compiled for lower numbered
+architectures will run on higher numbered architectures, but not the
+other way around.
+.IP "\fB\-mpa\-risc\-1\-0\fR" 4
+.IX Item "-mpa-risc-1-0"
+.PD 0
+.IP "\fB\-mpa\-risc\-1\-1\fR" 4
+.IX Item "-mpa-risc-1-1"
+.IP "\fB\-mpa\-risc\-2\-0\fR" 4
+.IX Item "-mpa-risc-2-0"
+.PD
+Synonyms for \fB\-march=1.0\fR, \fB\-march=1.1\fR, and \fB\-march=2.0\fR respectively.
+.IP "\fB\-mbig\-switch\fR" 4
+.IX Item "-mbig-switch"
+Generate code suitable for big switch tables. Use this option only if
+the assembler/linker complain about out of range branches within a switch
+table.
+.IP "\fB\-mjump\-in\-delay\fR" 4
+.IX Item "-mjump-in-delay"
+Fill delay slots of function calls with unconditional jump instructions
+by modifying the return pointer for the function call to be the target
+of the conditional jump.
+.IP "\fB\-mdisable\-fpregs\fR" 4
+.IX Item "-mdisable-fpregs"
+Prevent floating point registers from being used in any manner. This is
+necessary for compiling kernels which perform lazy context switching of
+floating point registers. If you use this option and attempt to perform
+floating point operations, the compiler will abort.
+.IP "\fB\-mdisable\-indexing\fR" 4
+.IX Item "-mdisable-indexing"
+Prevent the compiler from using indexing address modes. This avoids some
+rather obscure problems when compiling \s-1MIG\s0 generated code under \s-1MACH\s0.
+.IP "\fB\-mno\-space\-regs\fR" 4
+.IX Item "-mno-space-regs"
+Generate code that assumes the target has no space registers. This allows
+\&\s-1GCC\s0 to generate faster indirect calls and use unscaled index address modes.
+.Sp
+Such code is suitable for level 0 \s-1PA\s0 systems and kernels.
+.IP "\fB\-mfast\-indirect\-calls\fR" 4
+.IX Item "-mfast-indirect-calls"
+Generate code that assumes calls never cross space boundaries. This
+allows \s-1GCC\s0 to emit code which performs faster indirect calls.
+.Sp
+This option will not work in the presence of shared libraries or nested
+functions.
+.IP "\fB\-mfixed\-range=\fR\fIregister-range\fR" 4
+.IX Item "-mfixed-range=register-range"
+Generate code treating the given register range as fixed registers.
+A fixed register is one that the register allocator can not use. This is
+useful when compiling kernel code. A register range is specified as
+two registers separated by a dash. Multiple register ranges can be
+specified separated by a comma.
+.IP "\fB\-mlong\-load\-store\fR" 4
+.IX Item "-mlong-load-store"
+Generate 3\-instruction load and store sequences as sometimes required by
+the HP-UX 10 linker. This is equivalent to the \fB+k\fR option to
+the \s-1HP\s0 compilers.
+.IP "\fB\-mportable\-runtime\fR" 4
+.IX Item "-mportable-runtime"
+Use the portable calling conventions proposed by \s-1HP\s0 for \s-1ELF\s0 systems.
+.IP "\fB\-mgas\fR" 4
+.IX Item "-mgas"
+Enable the use of assembler directives only \s-1GAS\s0 understands.
+.IP "\fB\-mschedule=\fR\fIcpu-type\fR" 4
+.IX Item "-mschedule=cpu-type"
+Schedule code according to the constraints for the machine type
+\&\fIcpu-type\fR. The choices for \fIcpu-type\fR are \fB700\fR
+\&\fB7100\fR, \fB7100LC\fR, \fB7200\fR, \fB7300\fR and \fB8000\fR. Refer
+to \fI/usr/lib/sched.models\fR on an HP-UX system to determine the
+proper scheduling option for your machine. The default scheduling is
+\&\fB8000\fR.
+.IP "\fB\-mlinker\-opt\fR" 4
+.IX Item "-mlinker-opt"
+Enable the optimization pass in the HP-UX linker. Note this makes symbolic
+debugging impossible. It also triggers a bug in the HP-UX 8 and HP-UX 9
+linkers in which they give bogus error messages when linking some programs.
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+Generate output containing library calls for floating point.
+\&\fBWarning:\fR the requisite libraries are not available for all \s-1HPPA\s0
+targets. Normally the facilities of the machine's usual C compiler are
+used, but this cannot be done directly in cross-compilation. You must make
+your own arrangements to provide suitable library functions for
+cross-compilation.
+.Sp
+\&\fB\-msoft\-float\fR changes the calling convention in the output file;
+therefore, it is only useful if you compile \fIall\fR of a program with
+this option. In particular, you need to compile \fIlibgcc.a\fR, the
+library that comes with \s-1GCC\s0, with \fB\-msoft\-float\fR in order for
+this to work.
+.IP "\fB\-msio\fR" 4
+.IX Item "-msio"
+Generate the predefine, \f(CW\*(C`_SIO\*(C'\fR, for server \s-1IO\s0. The default is
+\&\fB\-mwsio\fR. This generates the predefines, \f(CW\*(C`_\|_hp9000s700\*(C'\fR,
+\&\f(CW\*(C`_\|_hp9000s700_\|_\*(C'\fR and \f(CW\*(C`_WSIO\*(C'\fR, for workstation \s-1IO\s0. These
+options are available under HP-UX and HI-UX.
+.IP "\fB\-mgnu\-ld\fR" 4
+.IX Item "-mgnu-ld"
+Use \s-1GNU\s0 ld specific options. This passes \fB\-shared\fR to ld when
+building a shared library. It is the default when \s-1GCC\s0 is configured,
+explicitly or implicitly, with the \s-1GNU\s0 linker. This option does not
+have any affect on which ld is called, it only changes what parameters
+are passed to that ld. The ld that is called is determined by the
+\&\fB\-\-with\-ld\fR configure option, \s-1GCC\s0's program search path, and
+finally by the user's \fB\s-1PATH\s0\fR. The linker used by \s-1GCC\s0 can be printed
+using \fBwhich `gcc \-print\-prog\-name=ld`\fR. This option is only available
+on the 64 bit HP-UX \s-1GCC\s0, i.e. configured with \fBhppa*64*\-*\-hpux*\fR.
+.IP "\fB\-mhp\-ld\fR" 4
+.IX Item "-mhp-ld"
+Use \s-1HP\s0 ld specific options. This passes \fB\-b\fR to ld when building
+a shared library and passes \fB+Accept TypeMismatch\fR to ld on all
+links. It is the default when \s-1GCC\s0 is configured, explicitly or
+implicitly, with the \s-1HP\s0 linker. This option does not have any affect on
+which ld is called, it only changes what parameters are passed to that
+ld. The ld that is called is determined by the \fB\-\-with\-ld\fR
+configure option, \s-1GCC\s0's program search path, and finally by the user's
+\&\fB\s-1PATH\s0\fR. The linker used by \s-1GCC\s0 can be printed using \fBwhich
+`gcc \-print\-prog\-name=ld`\fR. This option is only available on the 64 bit
+HP-UX \s-1GCC\s0, i.e. configured with \fBhppa*64*\-*\-hpux*\fR.
+.IP "\fB\-mlong\-calls\fR" 4
+.IX Item "-mlong-calls"
+Generate code that uses long call sequences. This ensures that a call
+is always able to reach linker generated stubs. The default is to generate
+long calls only when the distance from the call site to the beginning
+of the function or translation unit, as the case may be, exceeds a
+predefined limit set by the branch type being used. The limits for
+normal calls are 7,600,000 and 240,000 bytes, respectively for the
+\&\s-1PA\s0 2.0 and \s-1PA\s0 1.X architectures. Sibcalls are always limited at
+240,000 bytes.
+.Sp
+Distances are measured from the beginning of functions when using the
+\&\fB\-ffunction\-sections\fR option, or when using the \fB\-mgas\fR
+and \fB\-mno\-portable\-runtime\fR options together under HP-UX with
+the \s-1SOM\s0 linker.
+.Sp
+It is normally not desirable to use this option as it will degrade
+performance. However, it may be useful in large applications,
+particularly when partial linking is used to build the application.
+.Sp
+The types of long calls used depends on the capabilities of the
+assembler and linker, and the type of code being generated. The
+impact on systems that support long absolute calls, and long pic
+symbol-difference or pc-relative calls should be relatively small.
+However, an indirect call is used on 32\-bit \s-1ELF\s0 systems in pic code
+and it is quite long.
+.IP "\fB\-munix=\fR\fIunix-std\fR" 4
+.IX Item "-munix=unix-std"
+Generate compiler predefines and select a startfile for the specified
+\&\s-1UNIX\s0 standard. The choices for \fIunix-std\fR are \fB93\fR, \fB95\fR
+and \fB98\fR. \fB93\fR is supported on all HP-UX versions. \fB95\fR
+is available on HP-UX 10.10 and later. \fB98\fR is available on HP-UX
+11.11 and later. The default values are \fB93\fR for HP-UX 10.00,
+\&\fB95\fR for HP-UX 10.10 though to 11.00, and \fB98\fR for HP-UX 11.11
+and later.
+.Sp
+\&\fB\-munix=93\fR provides the same predefines as \s-1GCC\s0 3.3 and 3.4.
+\&\fB\-munix=95\fR provides additional predefines for \f(CW\*(C`XOPEN_UNIX\*(C'\fR
+and \f(CW\*(C`_XOPEN_SOURCE_EXTENDED\*(C'\fR, and the startfile \fIunix95.o\fR.
+\&\fB\-munix=98\fR provides additional predefines for \f(CW\*(C`_XOPEN_UNIX\*(C'\fR,
+\&\f(CW\*(C`_XOPEN_SOURCE_EXTENDED\*(C'\fR, \f(CW\*(C`_INCLUDE_\|_STDC_A1_SOURCE\*(C'\fR and
+\&\f(CW\*(C`_INCLUDE_XOPEN_SOURCE_500\*(C'\fR, and the startfile \fIunix98.o\fR.
+.Sp
+It is \fIimportant\fR to note that this option changes the interfaces
+for various library routines. It also affects the operational behavior
+of the C library. Thus, \fIextreme\fR care is needed in using this
+option.
+.Sp
+Library code that is intended to operate with more than one \s-1UNIX\s0
+standard must test, set and restore the variable \fI_\|_xpg4_extended_mask\fR
+as appropriate. Most \s-1GNU\s0 software doesn't provide this capability.
+.IP "\fB\-nolibdld\fR" 4
+.IX Item "-nolibdld"
+Suppress the generation of link options to search libdld.sl when the
+\&\fB\-static\fR option is specified on HP-UX 10 and later.
+.IP "\fB\-static\fR" 4
+.IX Item "-static"
+The HP-UX implementation of setlocale in libc has a dependency on
+libdld.sl. There isn't an archive version of libdld.sl. Thus,
+when the \fB\-static\fR option is specified, special link options
+are needed to resolve this dependency.
+.Sp
+On HP-UX 10 and later, the \s-1GCC\s0 driver adds the necessary options to
+link with libdld.sl when the \fB\-static\fR option is specified.
+This causes the resulting binary to be dynamic. On the 64\-bit port,
+the linkers generate dynamic binaries by default in any case. The
+\&\fB\-nolibdld\fR option can be used to prevent the \s-1GCC\s0 driver from
+adding these link options.
+.IP "\fB\-threads\fR" 4
+.IX Item "-threads"
+Add support for multithreading with the \fIdce thread\fR library
+under HP-UX. This option sets flags for both the preprocessor and
+linker.
+.PP
+\fIIntel 386 and \s-1AMD\s0 x86\-64 Options\fR
+.IX Subsection "Intel 386 and AMD x86-64 Options"
+.PP
+These \fB\-m\fR options are defined for the i386 and x86\-64 family of
+computers:
+.IP "\fB\-mtune=\fR\fIcpu-type\fR" 4
+.IX Item "-mtune=cpu-type"
+Tune to \fIcpu-type\fR everything applicable about the generated code, except
+for the \s-1ABI\s0 and the set of available instructions. The choices for
+\&\fIcpu-type\fR are:
+.RS 4
+.IP "\fIgeneric\fR" 4
+.IX Item "generic"
+Produce code optimized for the most common \s-1IA32/AMD64/EM64T\s0 processors.
+If you know the \s-1CPU\s0 on which your code will run, then you should use
+the corresponding \fB\-mtune\fR option instead of
+\&\fB\-mtune=generic\fR. But, if you do not know exactly what \s-1CPU\s0 users
+of your application will have, then you should use this option.
+.Sp
+As new processors are deployed in the marketplace, the behavior of this
+option will change. Therefore, if you upgrade to a newer version of
+\&\s-1GCC\s0, the code generated option will change to reflect the processors
+that were most common when that version of \s-1GCC\s0 was released.
+.Sp
+There is no \fB\-march=generic\fR option because \fB\-march\fR
+indicates the instruction set the compiler can use, and there is no
+generic instruction set applicable to all processors. In contrast,
+\&\fB\-mtune\fR indicates the processor (or, in this case, collection of
+processors) for which the code is optimized.
+.IP "\fInative\fR" 4
+.IX Item "native"
+This selects the \s-1CPU\s0 to tune for at compilation time by determining
+the processor type of the compiling machine. Using \fB\-mtune=native\fR
+will produce code optimized for the local machine under the constraints
+of the selected instruction set. Using \fB\-march=native\fR will
+enable all instruction subsets supported by the local machine (hence
+the result might not run on different machines).
+.IP "\fIi386\fR" 4
+.IX Item "i386"
+Original Intel's i386 \s-1CPU\s0.
+.IP "\fIi486\fR" 4
+.IX Item "i486"
+Intel's i486 \s-1CPU\s0. (No scheduling is implemented for this chip.)
+.IP "\fIi586, pentium\fR" 4
+.IX Item "i586, pentium"
+Intel Pentium \s-1CPU\s0 with no \s-1MMX\s0 support.
+.IP "\fIpentium-mmx\fR" 4
+.IX Item "pentium-mmx"
+Intel PentiumMMX \s-1CPU\s0 based on Pentium core with \s-1MMX\s0 instruction set support.
+.IP "\fIpentiumpro\fR" 4
+.IX Item "pentiumpro"
+Intel PentiumPro \s-1CPU\s0.
+.IP "\fIi686\fR" 4
+.IX Item "i686"
+Same as \f(CW\*(C`generic\*(C'\fR, but when used as \f(CW\*(C`march\*(C'\fR option, PentiumPro
+instruction set will be used, so the code will run on all i686 family chips.
+.IP "\fIpentium2\fR" 4
+.IX Item "pentium2"
+Intel Pentium2 \s-1CPU\s0 based on PentiumPro core with \s-1MMX\s0 instruction set support.
+.IP "\fIpentium3, pentium3m\fR" 4
+.IX Item "pentium3, pentium3m"
+Intel Pentium3 \s-1CPU\s0 based on PentiumPro core with \s-1MMX\s0 and \s-1SSE\s0 instruction set
+support.
+.IP "\fIpentium-m\fR" 4
+.IX Item "pentium-m"
+Low power version of Intel Pentium3 \s-1CPU\s0 with \s-1MMX\s0, \s-1SSE\s0 and \s-1SSE2\s0 instruction set
+support. Used by Centrino notebooks.
+.IP "\fIpentium4, pentium4m\fR" 4
+.IX Item "pentium4, pentium4m"
+Intel Pentium4 \s-1CPU\s0 with \s-1MMX\s0, \s-1SSE\s0 and \s-1SSE2\s0 instruction set support.
+.IP "\fIprescott\fR" 4
+.IX Item "prescott"
+Improved version of Intel Pentium4 \s-1CPU\s0 with \s-1MMX\s0, \s-1SSE\s0, \s-1SSE2\s0 and \s-1SSE3\s0 instruction
+set support.
+.IP "\fInocona\fR" 4
+.IX Item "nocona"
+Improved version of Intel Pentium4 \s-1CPU\s0 with 64\-bit extensions, \s-1MMX\s0, \s-1SSE\s0,
+\&\s-1SSE2\s0 and \s-1SSE3\s0 instruction set support.
+.IP "\fIcore2\fR" 4
+.IX Item "core2"
+Intel Core2 \s-1CPU\s0 with 64\-bit extensions, \s-1MMX\s0, \s-1SSE\s0, \s-1SSE2\s0, \s-1SSE3\s0 and \s-1SSSE3\s0
+instruction set support.
+.IP "\fIk6\fR" 4
+.IX Item "k6"
+\&\s-1AMD\s0 K6 \s-1CPU\s0 with \s-1MMX\s0 instruction set support.
+.IP "\fIk6\-2, k6\-3\fR" 4
+.IX Item "k6-2, k6-3"
+Improved versions of \s-1AMD\s0 K6 \s-1CPU\s0 with \s-1MMX\s0 and 3dNOW! instruction set support.
+.IP "\fIathlon, athlon-tbird\fR" 4
+.IX Item "athlon, athlon-tbird"
+\&\s-1AMD\s0 Athlon \s-1CPU\s0 with \s-1MMX\s0, 3dNOW!, enhanced 3dNOW! and \s-1SSE\s0 prefetch instructions
+support.
+.IP "\fIathlon\-4, athlon-xp, athlon-mp\fR" 4
+.IX Item "athlon-4, athlon-xp, athlon-mp"
+Improved \s-1AMD\s0 Athlon \s-1CPU\s0 with \s-1MMX\s0, 3dNOW!, enhanced 3dNOW! and full \s-1SSE\s0
+instruction set support.
+.IP "\fIk8, opteron, athlon64, athlon-fx\fR" 4
+.IX Item "k8, opteron, athlon64, athlon-fx"
+\&\s-1AMD\s0 K8 core based CPUs with x86\-64 instruction set support. (This supersets
+\&\s-1MMX\s0, \s-1SSE\s0, \s-1SSE2\s0, 3dNOW!, enhanced 3dNOW! and 64\-bit instruction set extensions.)
+.IP "\fIk8\-sse3, opteron\-sse3, athlon64\-sse3\fR" 4
+.IX Item "k8-sse3, opteron-sse3, athlon64-sse3"
+Improved versions of k8, opteron and athlon64 with \s-1SSE3\s0 instruction set support.
+.IP "\fIamdfam10, barcelona\fR" 4
+.IX Item "amdfam10, barcelona"
+\&\s-1AMD\s0 Family 10h core based CPUs with x86\-64 instruction set support. (This
+supersets \s-1MMX\s0, \s-1SSE\s0, \s-1SSE2\s0, \s-1SSE3\s0, \s-1SSE4A\s0, 3dNOW!, enhanced 3dNOW!, \s-1ABM\s0 and 64\-bit
+instruction set extensions.)
+.IP "\fIwinchip\-c6\fR" 4
+.IX Item "winchip-c6"
+\&\s-1IDT\s0 Winchip C6 \s-1CPU\s0, dealt in same way as i486 with additional \s-1MMX\s0 instruction
+set support.
+.IP "\fIwinchip2\fR" 4
+.IX Item "winchip2"
+\&\s-1IDT\s0 Winchip2 \s-1CPU\s0, dealt in same way as i486 with additional \s-1MMX\s0 and 3dNOW!
+instruction set support.
+.IP "\fIc3\fR" 4
+.IX Item "c3"
+Via C3 \s-1CPU\s0 with \s-1MMX\s0 and 3dNOW! instruction set support. (No scheduling is
+implemented for this chip.)
+.IP "\fIc3\-2\fR" 4
+.IX Item "c3-2"
+Via C3\-2 \s-1CPU\s0 with \s-1MMX\s0 and \s-1SSE\s0 instruction set support. (No scheduling is
+implemented for this chip.)
+.IP "\fIgeode\fR" 4
+.IX Item "geode"
+Embedded \s-1AMD\s0 \s-1CPU\s0 with \s-1MMX\s0 and 3dNOW! instruction set support.
+.RE
+.RS 4
+.Sp
+While picking a specific \fIcpu-type\fR will schedule things appropriately
+for that particular chip, the compiler will not generate any code that
+does not run on the i386 without the \fB\-march=\fR\fIcpu-type\fR option
+being used.
+.RE
+.IP "\fB\-march=\fR\fIcpu-type\fR" 4
+.IX Item "-march=cpu-type"
+Generate instructions for the machine type \fIcpu-type\fR. The choices
+for \fIcpu-type\fR are the same as for \fB\-mtune\fR. Moreover,
+specifying \fB\-march=\fR\fIcpu-type\fR implies \fB\-mtune=\fR\fIcpu-type\fR.
+.IP "\fB\-mcpu=\fR\fIcpu-type\fR" 4
+.IX Item "-mcpu=cpu-type"
+A deprecated synonym for \fB\-mtune\fR.
+.IP "\fB\-mfpmath=\fR\fIunit\fR" 4
+.IX Item "-mfpmath=unit"
+Generate floating point arithmetics for selected unit \fIunit\fR. The choices
+for \fIunit\fR are:
+.RS 4
+.IP "\fB387\fR" 4
+.IX Item "387"
+Use the standard 387 floating point coprocessor present majority of chips and
+emulated otherwise. Code compiled with this option will run almost everywhere.
+The temporary results are computed in 80bit precision instead of precision
+specified by the type resulting in slightly different results compared to most
+of other chips. See \fB\-ffloat\-store\fR for more detailed description.
+.Sp
+This is the default choice for i386 compiler.
+.IP "\fBsse\fR" 4
+.IX Item "sse"
+Use scalar floating point instructions present in the \s-1SSE\s0 instruction set.
+This instruction set is supported by Pentium3 and newer chips, in the \s-1AMD\s0 line
+by Athlon\-4, Athlon-xp and Athlon-mp chips. The earlier version of \s-1SSE\s0
+instruction set supports only single precision arithmetics, thus the double and
+extended precision arithmetics is still done using 387. Later version, present
+only in Pentium4 and the future \s-1AMD\s0 x86\-64 chips supports double precision
+arithmetics too.
+.Sp
+For the i386 compiler, you need to use \fB\-march=\fR\fIcpu-type\fR, \fB\-msse\fR
+or \fB\-msse2\fR switches to enable \s-1SSE\s0 extensions and make this option
+effective. For the x86\-64 compiler, these extensions are enabled by default.
+.Sp
+The resulting code should be considerably faster in the majority of cases and avoid
+the numerical instability problems of 387 code, but may break some existing
+code that expects temporaries to be 80bit.
+.Sp
+This is the default choice for the x86\-64 compiler.
+.IP "\fBsse,387\fR" 4
+.IX Item "sse,387"
+.PD 0
+.IP "\fBsse+387\fR" 4
+.IX Item "sse+387"
+.IP "\fBboth\fR" 4
+.IX Item "both"
+.PD
+Attempt to utilize both instruction sets at once. This effectively double the
+amount of available registers and on chips with separate execution units for
+387 and \s-1SSE\s0 the execution resources too. Use this option with care, as it is
+still experimental, because the \s-1GCC\s0 register allocator does not model separate
+functional units well resulting in instable performance.
+.RE
+.RS 4
+.RE
+.IP "\fB\-masm=\fR\fIdialect\fR" 4
+.IX Item "-masm=dialect"
+Output asm instructions using selected \fIdialect\fR. Supported
+choices are \fBintel\fR or \fBatt\fR (the default one). Darwin does
+not support \fBintel\fR.
+.IP "\fB\-mieee\-fp\fR" 4
+.IX Item "-mieee-fp"
+.PD 0
+.IP "\fB\-mno\-ieee\-fp\fR" 4
+.IX Item "-mno-ieee-fp"
+.PD
+Control whether or not the compiler uses \s-1IEEE\s0 floating point
+comparisons. These handle correctly the case where the result of a
+comparison is unordered.
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+Generate output containing library calls for floating point.
+\&\fBWarning:\fR the requisite libraries are not part of \s-1GCC\s0.
+Normally the facilities of the machine's usual C compiler are used, but
+this can't be done directly in cross-compilation. You must make your
+own arrangements to provide suitable library functions for
+cross-compilation.
+.Sp
+On machines where a function returns floating point results in the 80387
+register stack, some floating point opcodes may be emitted even if
+\&\fB\-msoft\-float\fR is used.
+.IP "\fB\-mno\-fp\-ret\-in\-387\fR" 4
+.IX Item "-mno-fp-ret-in-387"
+Do not use the \s-1FPU\s0 registers for return values of functions.
+.Sp
+The usual calling convention has functions return values of types
+\&\f(CW\*(C`float\*(C'\fR and \f(CW\*(C`double\*(C'\fR in an \s-1FPU\s0 register, even if there
+is no \s-1FPU\s0. The idea is that the operating system should emulate
+an \s-1FPU\s0.
+.Sp
+The option \fB\-mno\-fp\-ret\-in\-387\fR causes such values to be returned
+in ordinary \s-1CPU\s0 registers instead.
+.IP "\fB\-mno\-fancy\-math\-387\fR" 4
+.IX Item "-mno-fancy-math-387"
+Some 387 emulators do not support the \f(CW\*(C`sin\*(C'\fR, \f(CW\*(C`cos\*(C'\fR and
+\&\f(CW\*(C`sqrt\*(C'\fR instructions for the 387. Specify this option to avoid
+generating those instructions. This option is the default on FreeBSD,
+OpenBSD and NetBSD. This option is overridden when \fB\-march\fR
+indicates that the target cpu will always have an \s-1FPU\s0 and so the
+instruction will not need emulation. As of revision 2.6.1, these
+instructions are not generated unless you also use the
+\&\fB\-funsafe\-math\-optimizations\fR switch.
+.IP "\fB\-malign\-double\fR" 4
+.IX Item "-malign-double"
+.PD 0
+.IP "\fB\-mno\-align\-double\fR" 4
+.IX Item "-mno-align-double"
+.PD
+Control whether \s-1GCC\s0 aligns \f(CW\*(C`double\*(C'\fR, \f(CW\*(C`long double\*(C'\fR, and
+\&\f(CW\*(C`long long\*(C'\fR variables on a two word boundary or a one word
+boundary. Aligning \f(CW\*(C`double\*(C'\fR variables on a two word boundary will
+produce code that runs somewhat faster on a \fBPentium\fR at the
+expense of more memory.
+.Sp
+On x86\-64, \fB\-malign\-double\fR is enabled by default.
+.Sp
+\&\fBWarning:\fR if you use the \fB\-malign\-double\fR switch,
+structures containing the above types will be aligned differently than
+the published application binary interface specifications for the 386
+and will not be binary compatible with structures in code compiled
+without that switch.
+.IP "\fB\-m96bit\-long\-double\fR" 4
+.IX Item "-m96bit-long-double"
+.PD 0
+.IP "\fB\-m128bit\-long\-double\fR" 4
+.IX Item "-m128bit-long-double"
+.PD
+These switches control the size of \f(CW\*(C`long double\*(C'\fR type. The i386
+application binary interface specifies the size to be 96 bits,
+so \fB\-m96bit\-long\-double\fR is the default in 32 bit mode.
+.Sp
+Modern architectures (Pentium and newer) would prefer \f(CW\*(C`long double\*(C'\fR
+to be aligned to an 8 or 16 byte boundary. In arrays or structures
+conforming to the \s-1ABI\s0, this would not be possible. So specifying a
+\&\fB\-m128bit\-long\-double\fR will align \f(CW\*(C`long double\*(C'\fR
+to a 16 byte boundary by padding the \f(CW\*(C`long double\*(C'\fR with an additional
+32 bit zero.
+.Sp
+In the x86\-64 compiler, \fB\-m128bit\-long\-double\fR is the default choice as
+its \s-1ABI\s0 specifies that \f(CW\*(C`long double\*(C'\fR is to be aligned on 16 byte boundary.
+.Sp
+Notice that neither of these options enable any extra precision over the x87
+standard of 80 bits for a \f(CW\*(C`long double\*(C'\fR.
+.Sp
+\&\fBWarning:\fR if you override the default value for your target \s-1ABI\s0, the
+structures and arrays containing \f(CW\*(C`long double\*(C'\fR variables will change
+their size as well as function calling convention for function taking
+\&\f(CW\*(C`long double\*(C'\fR will be modified. Hence they will not be binary
+compatible with arrays or structures in code compiled without that switch.
+.IP "\fB\-mlarge\-data\-threshold=\fR\fInumber\fR" 4
+.IX Item "-mlarge-data-threshold=number"
+When \fB\-mcmodel=medium\fR is specified, the data greater than
+\&\fIthreshold\fR are placed in large data section. This value must be the
+same across all object linked into the binary and defaults to 65535.
+.IP "\fB\-mrtd\fR" 4
+.IX Item "-mrtd"
+Use a different function-calling convention, in which functions that
+take a fixed number of arguments return with the \f(CW\*(C`ret\*(C'\fR \fInum\fR
+instruction, which pops their arguments while returning. This saves one
+instruction in the caller since there is no need to pop the arguments
+there.
+.Sp
+You can specify that an individual function is called with this calling
+sequence with the function attribute \fBstdcall\fR. You can also
+override the \fB\-mrtd\fR option by using the function attribute
+\&\fBcdecl\fR.
+.Sp
+\&\fBWarning:\fR this calling convention is incompatible with the one
+normally used on Unix, so you cannot use it if you need to call
+libraries compiled with the Unix compiler.
+.Sp
+Also, you must provide function prototypes for all functions that
+take variable numbers of arguments (including \f(CW\*(C`printf\*(C'\fR);
+otherwise incorrect code will be generated for calls to those
+functions.
+.Sp
+In addition, seriously incorrect code will result if you call a
+function with too many arguments. (Normally, extra arguments are
+harmlessly ignored.)
+.IP "\fB\-mregparm=\fR\fInum\fR" 4
+.IX Item "-mregparm=num"
+Control how many registers are used to pass integer arguments. By
+default, no registers are used to pass arguments, and at most 3
+registers can be used. You can control this behavior for a specific
+function by using the function attribute \fBregparm\fR.
+.Sp
+\&\fBWarning:\fR if you use this switch, and
+\&\fInum\fR is nonzero, then you must build all modules with the same
+value, including any libraries. This includes the system libraries and
+startup modules.
+.IP "\fB\-msseregparm\fR" 4
+.IX Item "-msseregparm"
+Use \s-1SSE\s0 register passing conventions for float and double arguments
+and return values. You can control this behavior for a specific
+function by using the function attribute \fBsseregparm\fR.
+.Sp
+\&\fBWarning:\fR if you use this switch then you must build all
+modules with the same value, including any libraries. This includes
+the system libraries and startup modules.
+.IP "\fB\-mpc32\fR" 4
+.IX Item "-mpc32"
+.PD 0
+.IP "\fB\-mpc64\fR" 4
+.IX Item "-mpc64"
+.IP "\fB\-mpc80\fR" 4
+.IX Item "-mpc80"
+.PD
+Set 80387 floating-point precision to 32, 64 or 80 bits. When \fB\-mpc32\fR
+is specified, the significands of results of floating-point operations are
+rounded to 24 bits (single precision); \fB\-mpc64\fR rounds the
+significands of results of floating-point operations to 53 bits (double
+precision) and \fB\-mpc80\fR rounds the significands of results of
+floating-point operations to 64 bits (extended double precision), which is
+the default. When this option is used, floating-point operations in higher
+precisions are not available to the programmer without setting the \s-1FPU\s0
+control word explicitly.
+.Sp
+Setting the rounding of floating-point operations to less than the default
+80 bits can speed some programs by 2% or more. Note that some mathematical
+libraries assume that extended precision (80 bit) floating-point operations
+are enabled by default; routines in such libraries could suffer significant
+loss of accuracy, typically through so-called \*(L"catastrophic cancellation\*(R",
+when this option is used to set the precision to less than extended precision.
+.IP "\fB\-mstackrealign\fR" 4
+.IX Item "-mstackrealign"
+Realign the stack at entry. On the Intel x86, the \fB\-mstackrealign\fR
+option will generate an alternate prologue and epilogue that realigns the
+runtime stack if necessary. This supports mixing legacy codes that keep
+a 4\-byte aligned stack with modern codes that keep a 16\-byte stack for
+\&\s-1SSE\s0 compatibility. See also the attribute \f(CW\*(C`force_align_arg_pointer\*(C'\fR,
+applicable to individual functions.
+.IP "\fB\-mpreferred\-stack\-boundary=\fR\fInum\fR" 4
+.IX Item "-mpreferred-stack-boundary=num"
+Attempt to keep the stack boundary aligned to a 2 raised to \fInum\fR
+byte boundary. If \fB\-mpreferred\-stack\-boundary\fR is not specified,
+the default is 4 (16 bytes or 128 bits).
+.IP "\fB\-mincoming\-stack\-boundary=\fR\fInum\fR" 4
+.IX Item "-mincoming-stack-boundary=num"
+Assume the incoming stack is aligned to a 2 raised to \fInum\fR byte
+boundary. If \fB\-mincoming\-stack\-boundary\fR is not specified,
+the one specified by \fB\-mpreferred\-stack\-boundary\fR will be used.
+.Sp
+On Pentium and PentiumPro, \f(CW\*(C`double\*(C'\fR and \f(CW\*(C`long double\*(C'\fR values
+should be aligned to an 8 byte boundary (see \fB\-malign\-double\fR) or
+suffer significant run time performance penalties. On Pentium \s-1III\s0, the
+Streaming \s-1SIMD\s0 Extension (\s-1SSE\s0) data type \f(CW\*(C`_\|_m128\*(C'\fR may not work
+properly if it is not 16 byte aligned.
+.Sp
+To ensure proper alignment of this values on the stack, the stack boundary
+must be as aligned as that required by any value stored on the stack.
+Further, every function must be generated such that it keeps the stack
+aligned. Thus calling a function compiled with a higher preferred
+stack boundary from a function compiled with a lower preferred stack
+boundary will most likely misalign the stack. It is recommended that
+libraries that use callbacks always use the default setting.
+.Sp
+This extra alignment does consume extra stack space, and generally
+increases code size. Code that is sensitive to stack space usage, such
+as embedded systems and operating system kernels, may want to reduce the
+preferred alignment to \fB\-mpreferred\-stack\-boundary=2\fR.
+.IP "\fB\-mmmx\fR" 4
+.IX Item "-mmmx"
+.PD 0
+.IP "\fB\-mno\-mmx\fR" 4
+.IX Item "-mno-mmx"
+.IP "\fB\-msse\fR" 4
+.IX Item "-msse"
+.IP "\fB\-mno\-sse\fR" 4
+.IX Item "-mno-sse"
+.IP "\fB\-msse2\fR" 4
+.IX Item "-msse2"
+.IP "\fB\-mno\-sse2\fR" 4
+.IX Item "-mno-sse2"
+.IP "\fB\-msse3\fR" 4
+.IX Item "-msse3"
+.IP "\fB\-mno\-sse3\fR" 4
+.IX Item "-mno-sse3"
+.IP "\fB\-mssse3\fR" 4
+.IX Item "-mssse3"
+.IP "\fB\-mno\-ssse3\fR" 4
+.IX Item "-mno-ssse3"
+.IP "\fB\-msse4.1\fR" 4
+.IX Item "-msse4.1"
+.IP "\fB\-mno\-sse4.1\fR" 4
+.IX Item "-mno-sse4.1"
+.IP "\fB\-msse4.2\fR" 4
+.IX Item "-msse4.2"
+.IP "\fB\-mno\-sse4.2\fR" 4
+.IX Item "-mno-sse4.2"
+.IP "\fB\-msse4\fR" 4
+.IX Item "-msse4"
+.IP "\fB\-mno\-sse4\fR" 4
+.IX Item "-mno-sse4"
+.IP "\fB\-mavx\fR" 4
+.IX Item "-mavx"
+.IP "\fB\-mno\-avx\fR" 4
+.IX Item "-mno-avx"
+.IP "\fB\-maes\fR" 4
+.IX Item "-maes"
+.IP "\fB\-mno\-aes\fR" 4
+.IX Item "-mno-aes"
+.IP "\fB\-mpclmul\fR" 4
+.IX Item "-mpclmul"
+.IP "\fB\-mno\-pclmul\fR" 4
+.IX Item "-mno-pclmul"
+.IP "\fB\-msse4a\fR" 4
+.IX Item "-msse4a"
+.IP "\fB\-mno\-sse4a\fR" 4
+.IX Item "-mno-sse4a"
+.IP "\fB\-msse5\fR" 4
+.IX Item "-msse5"
+.IP "\fB\-mno\-sse5\fR" 4
+.IX Item "-mno-sse5"
+.IP "\fB\-m3dnow\fR" 4
+.IX Item "-m3dnow"
+.IP "\fB\-mno\-3dnow\fR" 4
+.IX Item "-mno-3dnow"
+.IP "\fB\-mpopcnt\fR" 4
+.IX Item "-mpopcnt"
+.IP "\fB\-mno\-popcnt\fR" 4
+.IX Item "-mno-popcnt"
+.IP "\fB\-mabm\fR" 4
+.IX Item "-mabm"
+.IP "\fB\-mno\-abm\fR" 4
+.IX Item "-mno-abm"
+.PD
+These switches enable or disable the use of instructions in the \s-1MMX\s0,
+\&\s-1SSE\s0, \s-1SSE2\s0, \s-1SSE3\s0, \s-1SSSE3\s0, \s-1SSE4\s0.1, \s-1AVX\s0, \s-1AES\s0, \s-1PCLMUL\s0, \s-1SSE4A\s0, \s-1SSE5\s0, \s-1ABM\s0 or
+3DNow! extended instruction sets.
+These extensions are also available as built-in functions: see
+\&\fBX86 Built-in Functions\fR, for details of the functions enabled and
+disabled by these switches.
+.Sp
+To have \s-1SSE/SSE2\s0 instructions generated automatically from floating-point
+code (as opposed to 387 instructions), see \fB\-mfpmath=sse\fR.
+.Sp
+\&\s-1GCC\s0 depresses SSEx instructions when \fB\-mavx\fR is used. Instead, it
+generates new \s-1AVX\s0 instructions or \s-1AVX\s0 equivalence for all SSEx instructions
+when needed.
+.Sp
+These options will enable \s-1GCC\s0 to use these extended instructions in
+generated code, even without \fB\-mfpmath=sse\fR. Applications which
+perform runtime \s-1CPU\s0 detection must compile separate files for each
+supported architecture, using the appropriate flags. In particular,
+the file containing the \s-1CPU\s0 detection code should be compiled without
+these options.
+.IP "\fB\-mcld\fR" 4
+.IX Item "-mcld"
+This option instructs \s-1GCC\s0 to emit a \f(CW\*(C`cld\*(C'\fR instruction in the prologue
+of functions that use string instructions. String instructions depend on
+the \s-1DF\s0 flag to select between autoincrement or autodecrement mode. While the
+\&\s-1ABI\s0 specifies the \s-1DF\s0 flag to be cleared on function entry, some operating
+systems violate this specification by not clearing the \s-1DF\s0 flag in their
+exception dispatchers. The exception handler can be invoked with the \s-1DF\s0 flag
+set which leads to wrong direction mode, when string instructions are used.
+This option can be enabled by default on 32\-bit x86 targets by configuring
+\&\s-1GCC\s0 with the \fB\-\-enable\-cld\fR configure option. Generation of \f(CW\*(C`cld\*(C'\fR
+instructions can be suppressed with the \fB\-mno\-cld\fR compiler option
+in this case.
+.IP "\fB\-mcx16\fR" 4
+.IX Item "-mcx16"
+This option will enable \s-1GCC\s0 to use \s-1CMPXCHG16B\s0 instruction in generated code.
+\&\s-1CMPXCHG16B\s0 allows for atomic operations on 128\-bit double quadword (or oword)
+data types. This is useful for high resolution counters that could be updated
+by multiple processors (or cores). This instruction is generated as part of
+atomic built-in functions: see \fBAtomic Builtins\fR for details.
+.IP "\fB\-msahf\fR" 4
+.IX Item "-msahf"
+This option will enable \s-1GCC\s0 to use \s-1SAHF\s0 instruction in generated 64\-bit code.
+Early Intel CPUs with Intel 64 lacked \s-1LAHF\s0 and \s-1SAHF\s0 instructions supported
+by \s-1AMD64\s0 until introduction of Pentium 4 G1 step in December 2005. \s-1LAHF\s0 and
+\&\s-1SAHF\s0 are load and store instructions, respectively, for certain status flags.
+In 64\-bit mode, \s-1SAHF\s0 instruction is used to optimize \f(CW\*(C`fmod\*(C'\fR, \f(CW\*(C`drem\*(C'\fR
+or \f(CW\*(C`remainder\*(C'\fR built-in functions: see \fBOther Builtins\fR for details.
+.IP "\fB\-mrecip\fR" 4
+.IX Item "-mrecip"
+This option will enable \s-1GCC\s0 to use \s-1RCPSS\s0 and \s-1RSQRTSS\s0 instructions (and their
+vectorized variants \s-1RCPPS\s0 and \s-1RSQRTPS\s0) with an additional Newton-Raphson step
+to increase precision instead of \s-1DIVSS\s0 and \s-1SQRTSS\s0 (and their vectorized
+variants) for single precision floating point arguments. These instructions
+are generated only when \fB\-funsafe\-math\-optimizations\fR is enabled
+together with \fB\-finite\-math\-only\fR and \fB\-fno\-trapping\-math\fR.
+Note that while the throughput of the sequence is higher than the throughput
+of the non-reciprocal instruction, the precision of the sequence can be
+decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
+.IP "\fB\-mveclibabi=\fR\fItype\fR" 4
+.IX Item "-mveclibabi=type"
+Specifies the \s-1ABI\s0 type to use for vectorizing intrinsics using an
+external library. Supported types are \f(CW\*(C`svml\*(C'\fR for the Intel short
+vector math library and \f(CW\*(C`acml\*(C'\fR for the \s-1AMD\s0 math core library style
+of interfacing. \s-1GCC\s0 will currently emit calls to \f(CW\*(C`vmldExp2\*(C'\fR,
+\&\f(CW\*(C`vmldLn2\*(C'\fR, \f(CW\*(C`vmldLog102\*(C'\fR, \f(CW\*(C`vmldLog102\*(C'\fR, \f(CW\*(C`vmldPow2\*(C'\fR,
+\&\f(CW\*(C`vmldTanh2\*(C'\fR, \f(CW\*(C`vmldTan2\*(C'\fR, \f(CW\*(C`vmldAtan2\*(C'\fR, \f(CW\*(C`vmldAtanh2\*(C'\fR,
+\&\f(CW\*(C`vmldCbrt2\*(C'\fR, \f(CW\*(C`vmldSinh2\*(C'\fR, \f(CW\*(C`vmldSin2\*(C'\fR, \f(CW\*(C`vmldAsinh2\*(C'\fR,
+\&\f(CW\*(C`vmldAsin2\*(C'\fR, \f(CW\*(C`vmldCosh2\*(C'\fR, \f(CW\*(C`vmldCos2\*(C'\fR, \f(CW\*(C`vmldAcosh2\*(C'\fR,
+\&\f(CW\*(C`vmldAcos2\*(C'\fR, \f(CW\*(C`vmlsExp4\*(C'\fR, \f(CW\*(C`vmlsLn4\*(C'\fR, \f(CW\*(C`vmlsLog104\*(C'\fR,
+\&\f(CW\*(C`vmlsLog104\*(C'\fR, \f(CW\*(C`vmlsPow4\*(C'\fR, \f(CW\*(C`vmlsTanh4\*(C'\fR, \f(CW\*(C`vmlsTan4\*(C'\fR,
+\&\f(CW\*(C`vmlsAtan4\*(C'\fR, \f(CW\*(C`vmlsAtanh4\*(C'\fR, \f(CW\*(C`vmlsCbrt4\*(C'\fR, \f(CW\*(C`vmlsSinh4\*(C'\fR,
+\&\f(CW\*(C`vmlsSin4\*(C'\fR, \f(CW\*(C`vmlsAsinh4\*(C'\fR, \f(CW\*(C`vmlsAsin4\*(C'\fR, \f(CW\*(C`vmlsCosh4\*(C'\fR,
+\&\f(CW\*(C`vmlsCos4\*(C'\fR, \f(CW\*(C`vmlsAcosh4\*(C'\fR and \f(CW\*(C`vmlsAcos4\*(C'\fR for corresponding
+function type when \fB\-mveclibabi=svml\fR is used and \f(CW\*(C`_\|_vrd2_sin\*(C'\fR,
+\&\f(CW\*(C`_\|_vrd2_cos\*(C'\fR, \f(CW\*(C`_\|_vrd2_exp\*(C'\fR, \f(CW\*(C`_\|_vrd2_log\*(C'\fR, \f(CW\*(C`_\|_vrd2_log2\*(C'\fR,
+\&\f(CW\*(C`_\|_vrd2_log10\*(C'\fR, \f(CW\*(C`_\|_vrs4_sinf\*(C'\fR, \f(CW\*(C`_\|_vrs4_cosf\*(C'\fR,
+\&\f(CW\*(C`_\|_vrs4_expf\*(C'\fR, \f(CW\*(C`_\|_vrs4_logf\*(C'\fR, \f(CW\*(C`_\|_vrs4_log2f\*(C'\fR,
+\&\f(CW\*(C`_\|_vrs4_log10f\*(C'\fR and \f(CW\*(C`_\|_vrs4_powf\*(C'\fR for corresponding function type
+when \fB\-mveclibabi=acml\fR is used. Both \fB\-ftree\-vectorize\fR and
+\&\fB\-funsafe\-math\-optimizations\fR have to be enabled. A \s-1SVML\s0 or \s-1ACML\s0 \s-1ABI\s0
+compatible library will have to be specified at link time.
+.IP "\fB\-mpush\-args\fR" 4
+.IX Item "-mpush-args"
+.PD 0
+.IP "\fB\-mno\-push\-args\fR" 4
+.IX Item "-mno-push-args"
+.PD
+Use \s-1PUSH\s0 operations to store outgoing parameters. This method is shorter
+and usually equally fast as method using \s-1SUB/MOV\s0 operations and is enabled
+by default. In some cases disabling it may improve performance because of
+improved scheduling and reduced dependencies.
+.IP "\fB\-maccumulate\-outgoing\-args\fR" 4
+.IX Item "-maccumulate-outgoing-args"
+If enabled, the maximum amount of space required for outgoing arguments will be
+computed in the function prologue. This is faster on most modern CPUs
+because of reduced dependencies, improved scheduling and reduced stack usage
+when preferred stack boundary is not equal to 2. The drawback is a notable
+increase in code size. This switch implies \fB\-mno\-push\-args\fR.
+.IP "\fB\-mthreads\fR" 4
+.IX Item "-mthreads"
+Support thread-safe exception handling on \fBMingw32\fR. Code that relies
+on thread-safe exception handling must compile and link all code with the
+\&\fB\-mthreads\fR option. When compiling, \fB\-mthreads\fR defines
+\&\fB\-D_MT\fR; when linking, it links in a special thread helper library
+\&\fB\-lmingwthrd\fR which cleans up per thread exception handling data.
+.IP "\fB\-mno\-align\-stringops\fR" 4
+.IX Item "-mno-align-stringops"
+Do not align destination of inlined string operations. This switch reduces
+code size and improves performance in case the destination is already aligned,
+but \s-1GCC\s0 doesn't know about it.
+.IP "\fB\-minline\-all\-stringops\fR" 4
+.IX Item "-minline-all-stringops"
+By default \s-1GCC\s0 inlines string operations only when destination is known to be
+aligned at least to 4 byte boundary. This enables more inlining, increase code
+size, but may improve performance of code that depends on fast memcpy, strlen
+and memset for short lengths.
+.IP "\fB\-minline\-stringops\-dynamically\fR" 4
+.IX Item "-minline-stringops-dynamically"
+For string operation of unknown size, inline runtime checks so for small
+blocks inline code is used, while for large blocks library call is used.
+.IP "\fB\-mstringop\-strategy=\fR\fIalg\fR" 4
+.IX Item "-mstringop-strategy=alg"
+Overwrite internal decision heuristic about particular algorithm to inline
+string operation with. The allowed values are \f(CW\*(C`rep_byte\*(C'\fR,
+\&\f(CW\*(C`rep_4byte\*(C'\fR, \f(CW\*(C`rep_8byte\*(C'\fR for expanding using i386 \f(CW\*(C`rep\*(C'\fR prefix
+of specified size, \f(CW\*(C`byte_loop\*(C'\fR, \f(CW\*(C`loop\*(C'\fR, \f(CW\*(C`unrolled_loop\*(C'\fR for
+expanding inline loop, \f(CW\*(C`libcall\*(C'\fR for always expanding library call.
+.IP "\fB\-momit\-leaf\-frame\-pointer\fR" 4
+.IX Item "-momit-leaf-frame-pointer"
+Don't keep the frame pointer in a register for leaf functions. This
+avoids the instructions to save, set up and restore frame pointers and
+makes an extra register available in leaf functions. The option
+\&\fB\-fomit\-frame\-pointer\fR removes the frame pointer for all functions
+which might make debugging harder.
+.IP "\fB\-mtls\-direct\-seg\-refs\fR" 4
+.IX Item "-mtls-direct-seg-refs"
+.PD 0
+.IP "\fB\-mno\-tls\-direct\-seg\-refs\fR" 4
+.IX Item "-mno-tls-direct-seg-refs"
+.PD
+Controls whether \s-1TLS\s0 variables may be accessed with offsets from the
+\&\s-1TLS\s0 segment register (\f(CW%gs\fR for 32\-bit, \f(CW%fs\fR for 64\-bit),
+or whether the thread base pointer must be added. Whether or not this
+is legal depends on the operating system, and whether it maps the
+segment to cover the entire \s-1TLS\s0 area.
+.Sp
+For systems that use \s-1GNU\s0 libc, the default is on.
+.IP "\fB\-mfused\-madd\fR" 4
+.IX Item "-mfused-madd"
+.PD 0
+.IP "\fB\-mno\-fused\-madd\fR" 4
+.IX Item "-mno-fused-madd"
+.PD
+Enable automatic generation of fused floating point multiply-add instructions
+if the \s-1ISA\s0 supports such instructions. The \-mfused\-madd option is on by
+default. The fused multiply-add instructions have a different
+rounding behavior compared to executing a multiply followed by an add.
+.IP "\fB\-msse2avx\fR" 4
+.IX Item "-msse2avx"
+.PD 0
+.IP "\fB\-mno\-sse2avx\fR" 4
+.IX Item "-mno-sse2avx"
+.PD
+Specify that the assembler should encode \s-1SSE\s0 instructions with \s-1VEX\s0
+prefix. The option \fB\-mavx\fR turns this on by default.
+.PP
+These \fB\-m\fR switches are supported in addition to the above
+on \s-1AMD\s0 x86\-64 processors in 64\-bit environments.
+.IP "\fB\-m32\fR" 4
+.IX Item "-m32"
+.PD 0
+.IP "\fB\-m64\fR" 4
+.IX Item "-m64"
+.PD
+Generate code for a 32\-bit or 64\-bit environment.
+The 32\-bit environment sets int, long and pointer to 32 bits and
+generates code that runs on any i386 system.
+The 64\-bit environment sets int to 32 bits and long and pointer
+to 64 bits and generates code for \s-1AMD\s0's x86\-64 architecture. For
+darwin only the \-m64 option turns off the \fB\-fno\-pic\fR and
+\&\fB\-mdynamic\-no\-pic\fR options.
+.IP "\fB\-mno\-red\-zone\fR" 4
+.IX Item "-mno-red-zone"
+Do not use a so called red zone for x86\-64 code. The red zone is mandated
+by the x86\-64 \s-1ABI\s0, it is a 128\-byte area beyond the location of the
+stack pointer that will not be modified by signal or interrupt handlers
+and therefore can be used for temporary data without adjusting the stack
+pointer. The flag \fB\-mno\-red\-zone\fR disables this red zone.
+.IP "\fB\-mcmodel=small\fR" 4
+.IX Item "-mcmodel=small"
+Generate code for the small code model: the program and its symbols must
+be linked in the lower 2 \s-1GB\s0 of the address space. Pointers are 64 bits.
+Programs can be statically or dynamically linked. This is the default
+code model.
+.IP "\fB\-mcmodel=kernel\fR" 4
+.IX Item "-mcmodel=kernel"
+Generate code for the kernel code model. The kernel runs in the
+negative 2 \s-1GB\s0 of the address space.
+This model has to be used for Linux kernel code.
+.IP "\fB\-mcmodel=medium\fR" 4
+.IX Item "-mcmodel=medium"
+Generate code for the medium model: The program is linked in the lower 2
+\&\s-1GB\s0 of the address space. Small symbols are also placed there. Symbols
+with sizes larger than \fB\-mlarge\-data\-threshold\fR are put into
+large data or bss sections and can be located above 2GB. Programs can
+be statically or dynamically linked.
+.IP "\fB\-mcmodel=large\fR" 4
+.IX Item "-mcmodel=large"
+Generate code for the large model: This model makes no assumptions
+about addresses and sizes of sections.
+.PP
+\fI\s-1IA\-64\s0 Options\fR
+.IX Subsection "IA-64 Options"
+.PP
+These are the \fB\-m\fR options defined for the Intel \s-1IA\-64\s0 architecture.
+.IP "\fB\-mbig\-endian\fR" 4
+.IX Item "-mbig-endian"
+Generate code for a big endian target. This is the default for HP-UX.
+.IP "\fB\-mlittle\-endian\fR" 4
+.IX Item "-mlittle-endian"
+Generate code for a little endian target. This is the default for \s-1AIX5\s0
+and GNU/Linux.
+.IP "\fB\-mgnu\-as\fR" 4
+.IX Item "-mgnu-as"
+.PD 0
+.IP "\fB\-mno\-gnu\-as\fR" 4
+.IX Item "-mno-gnu-as"
+.PD
+Generate (or don't) code for the \s-1GNU\s0 assembler. This is the default.
+.IP "\fB\-mgnu\-ld\fR" 4
+.IX Item "-mgnu-ld"
+.PD 0
+.IP "\fB\-mno\-gnu\-ld\fR" 4
+.IX Item "-mno-gnu-ld"
+.PD
+Generate (or don't) code for the \s-1GNU\s0 linker. This is the default.
+.IP "\fB\-mno\-pic\fR" 4
+.IX Item "-mno-pic"
+Generate code that does not use a global pointer register. The result
+is not position independent code, and violates the \s-1IA\-64\s0 \s-1ABI\s0.
+.IP "\fB\-mvolatile\-asm\-stop\fR" 4
+.IX Item "-mvolatile-asm-stop"
+.PD 0
+.IP "\fB\-mno\-volatile\-asm\-stop\fR" 4
+.IX Item "-mno-volatile-asm-stop"
+.PD
+Generate (or don't) a stop bit immediately before and after volatile asm
+statements.
+.IP "\fB\-mregister\-names\fR" 4
+.IX Item "-mregister-names"
+.PD 0
+.IP "\fB\-mno\-register\-names\fR" 4
+.IX Item "-mno-register-names"
+.PD
+Generate (or don't) \fBin\fR, \fBloc\fR, and \fBout\fR register names for
+the stacked registers. This may make assembler output more readable.
+.IP "\fB\-mno\-sdata\fR" 4
+.IX Item "-mno-sdata"
+.PD 0
+.IP "\fB\-msdata\fR" 4
+.IX Item "-msdata"
+.PD
+Disable (or enable) optimizations that use the small data section. This may
+be useful for working around optimizer bugs.
+.IP "\fB\-mconstant\-gp\fR" 4
+.IX Item "-mconstant-gp"
+Generate code that uses a single constant global pointer value. This is
+useful when compiling kernel code.
+.IP "\fB\-mauto\-pic\fR" 4
+.IX Item "-mauto-pic"
+Generate code that is self-relocatable. This implies \fB\-mconstant\-gp\fR.
+This is useful when compiling firmware code.
+.IP "\fB\-minline\-float\-divide\-min\-latency\fR" 4
+.IX Item "-minline-float-divide-min-latency"
+Generate code for inline divides of floating point values
+using the minimum latency algorithm.
+.IP "\fB\-minline\-float\-divide\-max\-throughput\fR" 4
+.IX Item "-minline-float-divide-max-throughput"
+Generate code for inline divides of floating point values
+using the maximum throughput algorithm.
+.IP "\fB\-minline\-int\-divide\-min\-latency\fR" 4
+.IX Item "-minline-int-divide-min-latency"
+Generate code for inline divides of integer values
+using the minimum latency algorithm.
+.IP "\fB\-minline\-int\-divide\-max\-throughput\fR" 4
+.IX Item "-minline-int-divide-max-throughput"
+Generate code for inline divides of integer values
+using the maximum throughput algorithm.
+.IP "\fB\-minline\-sqrt\-min\-latency\fR" 4
+.IX Item "-minline-sqrt-min-latency"
+Generate code for inline square roots
+using the minimum latency algorithm.
+.IP "\fB\-minline\-sqrt\-max\-throughput\fR" 4
+.IX Item "-minline-sqrt-max-throughput"
+Generate code for inline square roots
+using the maximum throughput algorithm.
+.IP "\fB\-mno\-dwarf2\-asm\fR" 4
+.IX Item "-mno-dwarf2-asm"
+.PD 0
+.IP "\fB\-mdwarf2\-asm\fR" 4
+.IX Item "-mdwarf2-asm"
+.PD
+Don't (or do) generate assembler code for the \s-1DWARF2\s0 line number debugging
+info. This may be useful when not using the \s-1GNU\s0 assembler.
+.IP "\fB\-mearly\-stop\-bits\fR" 4
+.IX Item "-mearly-stop-bits"
+.PD 0
+.IP "\fB\-mno\-early\-stop\-bits\fR" 4
+.IX Item "-mno-early-stop-bits"
+.PD
+Allow stop bits to be placed earlier than immediately preceding the
+instruction that triggered the stop bit. This can improve instruction
+scheduling, but does not always do so.
+.IP "\fB\-mfixed\-range=\fR\fIregister-range\fR" 4
+.IX Item "-mfixed-range=register-range"
+Generate code treating the given register range as fixed registers.
+A fixed register is one that the register allocator can not use. This is
+useful when compiling kernel code. A register range is specified as
+two registers separated by a dash. Multiple register ranges can be
+specified separated by a comma.
+.IP "\fB\-mtls\-size=\fR\fItls-size\fR" 4
+.IX Item "-mtls-size=tls-size"
+Specify bit size of immediate \s-1TLS\s0 offsets. Valid values are 14, 22, and
+64.
+.IP "\fB\-mtune=\fR\fIcpu-type\fR" 4
+.IX Item "-mtune=cpu-type"
+Tune the instruction scheduling for a particular \s-1CPU\s0, Valid values are
+itanium, itanium1, merced, itanium2, and mckinley.
+.IP "\fB\-mt\fR" 4
+.IX Item "-mt"
+.PD 0
+.IP "\fB\-pthread\fR" 4
+.IX Item "-pthread"
+.PD
+Add support for multithreading using the \s-1POSIX\s0 threads library. This
+option sets flags for both the preprocessor and linker. It does
+not affect the thread safety of object code produced by the compiler or
+that of libraries supplied with it. These are HP-UX specific flags.
+.IP "\fB\-milp32\fR" 4
+.IX Item "-milp32"
+.PD 0
+.IP "\fB\-mlp64\fR" 4
+.IX Item "-mlp64"
+.PD
+Generate code for a 32\-bit or 64\-bit environment.
+The 32\-bit environment sets int, long and pointer to 32 bits.
+The 64\-bit environment sets int to 32 bits and long and pointer
+to 64 bits. These are HP-UX specific flags.
+.IP "\fB\-mno\-sched\-br\-data\-spec\fR" 4
+.IX Item "-mno-sched-br-data-spec"
+.PD 0
+.IP "\fB\-msched\-br\-data\-spec\fR" 4
+.IX Item "-msched-br-data-spec"
+.PD
+(Dis/En)able data speculative scheduling before reload.
+This will result in generation of the ld.a instructions and
+the corresponding check instructions (ld.c / chk.a).
+The default is 'disable'.
+.IP "\fB\-msched\-ar\-data\-spec\fR" 4
+.IX Item "-msched-ar-data-spec"
+.PD 0
+.IP "\fB\-mno\-sched\-ar\-data\-spec\fR" 4
+.IX Item "-mno-sched-ar-data-spec"
+.PD
+(En/Dis)able data speculative scheduling after reload.
+This will result in generation of the ld.a instructions and
+the corresponding check instructions (ld.c / chk.a).
+The default is 'enable'.
+.IP "\fB\-mno\-sched\-control\-spec\fR" 4
+.IX Item "-mno-sched-control-spec"
+.PD 0
+.IP "\fB\-msched\-control\-spec\fR" 4
+.IX Item "-msched-control-spec"
+.PD
+(Dis/En)able control speculative scheduling. This feature is
+available only during region scheduling (i.e. before reload).
+This will result in generation of the ld.s instructions and
+the corresponding check instructions chk.s .
+The default is 'disable'.
+.IP "\fB\-msched\-br\-in\-data\-spec\fR" 4
+.IX Item "-msched-br-in-data-spec"
+.PD 0
+.IP "\fB\-mno\-sched\-br\-in\-data\-spec\fR" 4
+.IX Item "-mno-sched-br-in-data-spec"
+.PD
+(En/Dis)able speculative scheduling of the instructions that
+are dependent on the data speculative loads before reload.
+This is effective only with \fB\-msched\-br\-data\-spec\fR enabled.
+The default is 'enable'.
+.IP "\fB\-msched\-ar\-in\-data\-spec\fR" 4
+.IX Item "-msched-ar-in-data-spec"
+.PD 0
+.IP "\fB\-mno\-sched\-ar\-in\-data\-spec\fR" 4
+.IX Item "-mno-sched-ar-in-data-spec"
+.PD
+(En/Dis)able speculative scheduling of the instructions that
+are dependent on the data speculative loads after reload.
+This is effective only with \fB\-msched\-ar\-data\-spec\fR enabled.
+The default is 'enable'.
+.IP "\fB\-msched\-in\-control\-spec\fR" 4
+.IX Item "-msched-in-control-spec"
+.PD 0
+.IP "\fB\-mno\-sched\-in\-control\-spec\fR" 4
+.IX Item "-mno-sched-in-control-spec"
+.PD
+(En/Dis)able speculative scheduling of the instructions that
+are dependent on the control speculative loads.
+This is effective only with \fB\-msched\-control\-spec\fR enabled.
+The default is 'enable'.
+.IP "\fB\-msched\-ldc\fR" 4
+.IX Item "-msched-ldc"
+.PD 0
+.IP "\fB\-mno\-sched\-ldc\fR" 4
+.IX Item "-mno-sched-ldc"
+.PD
+(En/Dis)able use of simple data speculation checks ld.c .
+If disabled, only chk.a instructions will be emitted to check
+data speculative loads.
+The default is 'enable'.
+.IP "\fB\-mno\-sched\-control\-ldc\fR" 4
+.IX Item "-mno-sched-control-ldc"
+.PD 0
+.IP "\fB\-msched\-control\-ldc\fR" 4
+.IX Item "-msched-control-ldc"
+.PD
+(Dis/En)able use of ld.c instructions to check control speculative loads.
+If enabled, in case of control speculative load with no speculatively
+scheduled dependent instructions this load will be emitted as ld.sa and
+ld.c will be used to check it.
+The default is 'disable'.
+.IP "\fB\-mno\-sched\-spec\-verbose\fR" 4
+.IX Item "-mno-sched-spec-verbose"
+.PD 0
+.IP "\fB\-msched\-spec\-verbose\fR" 4
+.IX Item "-msched-spec-verbose"
+.PD
+(Dis/En)able printing of the information about speculative motions.
+.IP "\fB\-mno\-sched\-prefer\-non\-data\-spec\-insns\fR" 4
+.IX Item "-mno-sched-prefer-non-data-spec-insns"
+.PD 0
+.IP "\fB\-msched\-prefer\-non\-data\-spec\-insns\fR" 4
+.IX Item "-msched-prefer-non-data-spec-insns"
+.PD
+If enabled, data speculative instructions will be chosen for schedule
+only if there are no other choices at the moment. This will make
+the use of the data speculation much more conservative.
+The default is 'disable'.
+.IP "\fB\-mno\-sched\-prefer\-non\-control\-spec\-insns\fR" 4
+.IX Item "-mno-sched-prefer-non-control-spec-insns"
+.PD 0
+.IP "\fB\-msched\-prefer\-non\-control\-spec\-insns\fR" 4
+.IX Item "-msched-prefer-non-control-spec-insns"
+.PD
+If enabled, control speculative instructions will be chosen for schedule
+only if there are no other choices at the moment. This will make
+the use of the control speculation much more conservative.
+The default is 'disable'.
+.IP "\fB\-mno\-sched\-count\-spec\-in\-critical\-path\fR" 4
+.IX Item "-mno-sched-count-spec-in-critical-path"
+.PD 0
+.IP "\fB\-msched\-count\-spec\-in\-critical\-path\fR" 4
+.IX Item "-msched-count-spec-in-critical-path"
+.PD
+If enabled, speculative dependencies will be considered during
+computation of the instructions priorities. This will make the use of the
+speculation a bit more conservative.
+The default is 'disable'.
+.PP
+\fIM32C Options\fR
+.IX Subsection "M32C Options"
+.IP "\fB\-mcpu=\fR\fIname\fR" 4
+.IX Item "-mcpu=name"
+Select the \s-1CPU\s0 for which code is generated. \fIname\fR may be one of
+\&\fBr8c\fR for the R8C/Tiny series, \fBm16c\fR for the M16C (up to
+/60) series, \fBm32cm\fR for the M16C/80 series, or \fBm32c\fR for
+the M32C/80 series.
+.IP "\fB\-msim\fR" 4
+.IX Item "-msim"
+Specifies that the program will be run on the simulator. This causes
+an alternate runtime library to be linked in which supports, for
+example, file I/O. You must not use this option when generating
+programs that will run on real hardware; you must provide your own
+runtime library for whatever I/O functions are needed.
+.IP "\fB\-memregs=\fR\fInumber\fR" 4
+.IX Item "-memregs=number"
+Specifies the number of memory-based pseudo-registers \s-1GCC\s0 will use
+during code generation. These pseudo-registers will be used like real
+registers, so there is a tradeoff between \s-1GCC\s0's ability to fit the
+code into available registers, and the performance penalty of using
+memory instead of registers. Note that all modules in a program must
+be compiled with the same value for this option. Because of that, you
+must not use this option with the default runtime libraries gcc
+builds.
+.PP
+\fIM32R/D Options\fR
+.IX Subsection "M32R/D Options"
+.PP
+These \fB\-m\fR options are defined for Renesas M32R/D architectures:
+.IP "\fB\-m32r2\fR" 4
+.IX Item "-m32r2"
+Generate code for the M32R/2.
+.IP "\fB\-m32rx\fR" 4
+.IX Item "-m32rx"
+Generate code for the M32R/X.
+.IP "\fB\-m32r\fR" 4
+.IX Item "-m32r"
+Generate code for the M32R. This is the default.
+.IP "\fB\-mmodel=small\fR" 4
+.IX Item "-mmodel=small"
+Assume all objects live in the lower 16MB of memory (so that their addresses
+can be loaded with the \f(CW\*(C`ld24\*(C'\fR instruction), and assume all subroutines
+are reachable with the \f(CW\*(C`bl\*(C'\fR instruction.
+This is the default.
+.Sp
+The addressability of a particular object can be set with the
+\&\f(CW\*(C`model\*(C'\fR attribute.
+.IP "\fB\-mmodel=medium\fR" 4
+.IX Item "-mmodel=medium"
+Assume objects may be anywhere in the 32\-bit address space (the compiler
+will generate \f(CW\*(C`seth/add3\*(C'\fR instructions to load their addresses), and
+assume all subroutines are reachable with the \f(CW\*(C`bl\*(C'\fR instruction.
+.IP "\fB\-mmodel=large\fR" 4
+.IX Item "-mmodel=large"
+Assume objects may be anywhere in the 32\-bit address space (the compiler
+will generate \f(CW\*(C`seth/add3\*(C'\fR instructions to load their addresses), and
+assume subroutines may not be reachable with the \f(CW\*(C`bl\*(C'\fR instruction
+(the compiler will generate the much slower \f(CW\*(C`seth/add3/jl\*(C'\fR
+instruction sequence).
+.IP "\fB\-msdata=none\fR" 4
+.IX Item "-msdata=none"
+Disable use of the small data area. Variables will be put into
+one of \fB.data\fR, \fBbss\fR, or \fB.rodata\fR (unless the
+\&\f(CW\*(C`section\*(C'\fR attribute has been specified).
+This is the default.
+.Sp
+The small data area consists of sections \fB.sdata\fR and \fB.sbss\fR.
+Objects may be explicitly put in the small data area with the
+\&\f(CW\*(C`section\*(C'\fR attribute using one of these sections.
+.IP "\fB\-msdata=sdata\fR" 4
+.IX Item "-msdata=sdata"
+Put small global and static data in the small data area, but do not
+generate special code to reference them.
+.IP "\fB\-msdata=use\fR" 4
+.IX Item "-msdata=use"
+Put small global and static data in the small data area, and generate
+special instructions to reference them.
+.IP "\fB\-G\fR \fInum\fR" 4
+.IX Item "-G num"
+Put global and static objects less than or equal to \fInum\fR bytes
+into the small data or bss sections instead of the normal data or bss
+sections. The default value of \fInum\fR is 8.
+The \fB\-msdata\fR option must be set to one of \fBsdata\fR or \fBuse\fR
+for this option to have any effect.
+.Sp
+All modules should be compiled with the same \fB\-G\fR \fInum\fR value.
+Compiling with different values of \fInum\fR may or may not work; if it
+doesn't the linker will give an error message\-\-\-incorrect code will not be
+generated.
+.IP "\fB\-mdebug\fR" 4
+.IX Item "-mdebug"
+Makes the M32R specific code in the compiler display some statistics
+that might help in debugging programs.
+.IP "\fB\-malign\-loops\fR" 4
+.IX Item "-malign-loops"
+Align all loops to a 32\-byte boundary.
+.IP "\fB\-mno\-align\-loops\fR" 4
+.IX Item "-mno-align-loops"
+Do not enforce a 32\-byte alignment for loops. This is the default.
+.IP "\fB\-missue\-rate=\fR\fInumber\fR" 4
+.IX Item "-missue-rate=number"
+Issue \fInumber\fR instructions per cycle. \fInumber\fR can only be 1
+or 2.
+.IP "\fB\-mbranch\-cost=\fR\fInumber\fR" 4
+.IX Item "-mbranch-cost=number"
+\&\fInumber\fR can only be 1 or 2. If it is 1 then branches will be
+preferred over conditional code, if it is 2, then the opposite will
+apply.
+.IP "\fB\-mflush\-trap=\fR\fInumber\fR" 4
+.IX Item "-mflush-trap=number"
+Specifies the trap number to use to flush the cache. The default is
+12. Valid numbers are between 0 and 15 inclusive.
+.IP "\fB\-mno\-flush\-trap\fR" 4
+.IX Item "-mno-flush-trap"
+Specifies that the cache cannot be flushed by using a trap.
+.IP "\fB\-mflush\-func=\fR\fIname\fR" 4
+.IX Item "-mflush-func=name"
+Specifies the name of the operating system function to call to flush
+the cache. The default is \fI_flush_cache\fR, but a function call
+will only be used if a trap is not available.
+.IP "\fB\-mno\-flush\-func\fR" 4
+.IX Item "-mno-flush-func"
+Indicates that there is no \s-1OS\s0 function for flushing the cache.
+.PP
+\fIM680x0 Options\fR
+.IX Subsection "M680x0 Options"
+.PP
+These are the \fB\-m\fR options defined for M680x0 and ColdFire processors.
+The default settings depend on which architecture was selected when
+the compiler was configured; the defaults for the most common choices
+are given below.
+.IP "\fB\-march=\fR\fIarch\fR" 4
+.IX Item "-march=arch"
+Generate code for a specific M680x0 or ColdFire instruction set
+architecture. Permissible values of \fIarch\fR for M680x0
+architectures are: \fB68000\fR, \fB68010\fR, \fB68020\fR,
+\&\fB68030\fR, \fB68040\fR, \fB68060\fR and \fBcpu32\fR. ColdFire
+architectures are selected according to Freescale's \s-1ISA\s0 classification
+and the permissible values are: \fBisaa\fR, \fBisaaplus\fR,
+\&\fBisab\fR and \fBisac\fR.
+.Sp
+gcc defines a macro \fB_\|_mcf\fR\fIarch\fR\fB_\|_\fR whenever it is generating
+code for a ColdFire target. The \fIarch\fR in this macro is one of the
+\&\fB\-march\fR arguments given above.
+.Sp
+When used together, \fB\-march\fR and \fB\-mtune\fR select code
+that runs on a family of similar processors but that is optimized
+for a particular microarchitecture.
+.IP "\fB\-mcpu=\fR\fIcpu\fR" 4
+.IX Item "-mcpu=cpu"
+Generate code for a specific M680x0 or ColdFire processor.
+The M680x0 \fIcpu\fRs are: \fB68000\fR, \fB68010\fR, \fB68020\fR,
+\&\fB68030\fR, \fB68040\fR, \fB68060\fR, \fB68302\fR, \fB68332\fR
+and \fBcpu32\fR. The ColdFire \fIcpu\fRs are given by the table
+below, which also classifies the CPUs into families:
+.RS 4
+.IP "Family : \fB\-mcpu\fR arguments" 4
+.IX Item "Family : -mcpu arguments"
+.PD 0
+.IP "\fB51qe\fR : \fB51qe\fR" 4
+.IX Item "51qe : 51qe"
+.IP "\fB5206\fR : \fB5202\fR \fB5204\fR \fB5206\fR" 4
+.IX Item "5206 : 5202 5204 5206"
+.IP "\fB5206e\fR : \fB5206e\fR" 4
+.IX Item "5206e : 5206e"
+.IP "\fB5208\fR : \fB5207\fR \fB5208\fR" 4
+.IX Item "5208 : 5207 5208"
+.IP "\fB5211a\fR : \fB5210a\fR \fB5211a\fR" 4
+.IX Item "5211a : 5210a 5211a"
+.IP "\fB5213\fR : \fB5211\fR \fB5212\fR \fB5213\fR" 4
+.IX Item "5213 : 5211 5212 5213"
+.IP "\fB5216\fR : \fB5214\fR \fB5216\fR" 4
+.IX Item "5216 : 5214 5216"
+.IP "\fB52235\fR : \fB52230\fR \fB52231\fR \fB52232\fR \fB52233\fR \fB52234\fR \fB52235\fR" 4
+.IX Item "52235 : 52230 52231 52232 52233 52234 52235"
+.IP "\fB5225\fR : \fB5224\fR \fB5225\fR" 4
+.IX Item "5225 : 5224 5225"
+.IP "\fB5235\fR : \fB5232\fR \fB5233\fR \fB5234\fR \fB5235\fR \fB523x\fR" 4
+.IX Item "5235 : 5232 5233 5234 5235 523x"
+.IP "\fB5249\fR : \fB5249\fR" 4
+.IX Item "5249 : 5249"
+.IP "\fB5250\fR : \fB5250\fR" 4
+.IX Item "5250 : 5250"
+.IP "\fB5271\fR : \fB5270\fR \fB5271\fR" 4
+.IX Item "5271 : 5270 5271"
+.IP "\fB5272\fR : \fB5272\fR" 4
+.IX Item "5272 : 5272"
+.IP "\fB5275\fR : \fB5274\fR \fB5275\fR" 4
+.IX Item "5275 : 5274 5275"
+.IP "\fB5282\fR : \fB5280\fR \fB5281\fR \fB5282\fR \fB528x\fR" 4
+.IX Item "5282 : 5280 5281 5282 528x"
+.IP "\fB5307\fR : \fB5307\fR" 4
+.IX Item "5307 : 5307"
+.IP "\fB5329\fR : \fB5327\fR \fB5328\fR \fB5329\fR \fB532x\fR" 4
+.IX Item "5329 : 5327 5328 5329 532x"
+.IP "\fB5373\fR : \fB5372\fR \fB5373\fR \fB537x\fR" 4
+.IX Item "5373 : 5372 5373 537x"
+.IP "\fB5407\fR : \fB5407\fR" 4
+.IX Item "5407 : 5407"
+.IP "\fB5475\fR : \fB5470\fR \fB5471\fR \fB5472\fR \fB5473\fR \fB5474\fR \fB5475\fR \fB547x\fR \fB5480\fR \fB5481\fR \fB5482\fR \fB5483\fR \fB5484\fR \fB5485\fR" 4
+.IX Item "5475 : 5470 5471 5472 5473 5474 5475 547x 5480 5481 5482 5483 5484 5485"
+.RE
+.RS 4
+.PD
+.Sp
+\&\fB\-mcpu=\fR\fIcpu\fR overrides \fB\-march=\fR\fIarch\fR if
+\&\fIarch\fR is compatible with \fIcpu\fR. Other combinations of
+\&\fB\-mcpu\fR and \fB\-march\fR are rejected.
+.Sp
+gcc defines the macro \fB_\|_mcf_cpu_\fR\fIcpu\fR when ColdFire target
+\&\fIcpu\fR is selected. It also defines \fB_\|_mcf_family_\fR\fIfamily\fR,
+where the value of \fIfamily\fR is given by the table above.
+.RE
+.IP "\fB\-mtune=\fR\fItune\fR" 4
+.IX Item "-mtune=tune"
+Tune the code for a particular microarchitecture, within the
+constraints set by \fB\-march\fR and \fB\-mcpu\fR.
+The M680x0 microarchitectures are: \fB68000\fR, \fB68010\fR,
+\&\fB68020\fR, \fB68030\fR, \fB68040\fR, \fB68060\fR
+and \fBcpu32\fR. The ColdFire microarchitectures
+are: \fBcfv1\fR, \fBcfv2\fR, \fBcfv3\fR, \fBcfv4\fR and \fBcfv4e\fR.
+.Sp
+You can also use \fB\-mtune=68020\-40\fR for code that needs
+to run relatively well on 68020, 68030 and 68040 targets.
+\&\fB\-mtune=68020\-60\fR is similar but includes 68060 targets
+as well. These two options select the same tuning decisions as
+\&\fB\-m68020\-40\fR and \fB\-m68020\-60\fR respectively.
+.Sp
+gcc defines the macros \fB_\|_mc\fR\fIarch\fR and \fB_\|_mc\fR\fIarch\fR\fB_\|_\fR
+when tuning for 680x0 architecture \fIarch\fR. It also defines
+\&\fBmc\fR\fIarch\fR unless either \fB\-ansi\fR or a non-GNU \fB\-std\fR
+option is used. If gcc is tuning for a range of architectures,
+as selected by \fB\-mtune=68020\-40\fR or \fB\-mtune=68020\-60\fR,
+it defines the macros for every architecture in the range.
+.Sp
+gcc also defines the macro \fB_\|_m\fR\fIuarch\fR\fB_\|_\fR when tuning for
+ColdFire microarchitecture \fIuarch\fR, where \fIuarch\fR is one
+of the arguments given above.
+.IP "\fB\-m68000\fR" 4
+.IX Item "-m68000"
+.PD 0
+.IP "\fB\-mc68000\fR" 4
+.IX Item "-mc68000"
+.PD
+Generate output for a 68000. This is the default
+when the compiler is configured for 68000\-based systems.
+It is equivalent to \fB\-march=68000\fR.
+.Sp
+Use this option for microcontrollers with a 68000 or \s-1EC000\s0 core,
+including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
+.IP "\fB\-m68010\fR" 4
+.IX Item "-m68010"
+Generate output for a 68010. This is the default
+when the compiler is configured for 68010\-based systems.
+It is equivalent to \fB\-march=68010\fR.
+.IP "\fB\-m68020\fR" 4
+.IX Item "-m68020"
+.PD 0
+.IP "\fB\-mc68020\fR" 4
+.IX Item "-mc68020"
+.PD
+Generate output for a 68020. This is the default
+when the compiler is configured for 68020\-based systems.
+It is equivalent to \fB\-march=68020\fR.
+.IP "\fB\-m68030\fR" 4
+.IX Item "-m68030"
+Generate output for a 68030. This is the default when the compiler is
+configured for 68030\-based systems. It is equivalent to
+\&\fB\-march=68030\fR.
+.IP "\fB\-m68040\fR" 4
+.IX Item "-m68040"
+Generate output for a 68040. This is the default when the compiler is
+configured for 68040\-based systems. It is equivalent to
+\&\fB\-march=68040\fR.
+.Sp
+This option inhibits the use of 68881/68882 instructions that have to be
+emulated by software on the 68040. Use this option if your 68040 does not
+have code to emulate those instructions.
+.IP "\fB\-m68060\fR" 4
+.IX Item "-m68060"
+Generate output for a 68060. This is the default when the compiler is
+configured for 68060\-based systems. It is equivalent to
+\&\fB\-march=68060\fR.
+.Sp
+This option inhibits the use of 68020 and 68881/68882 instructions that
+have to be emulated by software on the 68060. Use this option if your 68060
+does not have code to emulate those instructions.
+.IP "\fB\-mcpu32\fR" 4
+.IX Item "-mcpu32"
+Generate output for a \s-1CPU32\s0. This is the default
+when the compiler is configured for CPU32\-based systems.
+It is equivalent to \fB\-march=cpu32\fR.
+.Sp
+Use this option for microcontrollers with a
+\&\s-1CPU32\s0 or \s-1CPU32+\s0 core, including the 68330, 68331, 68332, 68333, 68334,
+68336, 68340, 68341, 68349 and 68360.
+.IP "\fB\-m5200\fR" 4
+.IX Item "-m5200"
+Generate output for a 520X ColdFire \s-1CPU\s0. This is the default
+when the compiler is configured for 520X\-based systems.
+It is equivalent to \fB\-mcpu=5206\fR, and is now deprecated
+in favor of that option.
+.Sp
+Use this option for microcontroller with a 5200 core, including
+the \s-1MCF5202\s0, \s-1MCF5203\s0, \s-1MCF5204\s0 and \s-1MCF5206\s0.
+.IP "\fB\-m5206e\fR" 4
+.IX Item "-m5206e"
+Generate output for a 5206e ColdFire \s-1CPU\s0. The option is now
+deprecated in favor of the equivalent \fB\-mcpu=5206e\fR.
+.IP "\fB\-m528x\fR" 4
+.IX Item "-m528x"
+Generate output for a member of the ColdFire 528X family.
+The option is now deprecated in favor of the equivalent
+\&\fB\-mcpu=528x\fR.
+.IP "\fB\-m5307\fR" 4
+.IX Item "-m5307"
+Generate output for a ColdFire 5307 \s-1CPU\s0. The option is now deprecated
+in favor of the equivalent \fB\-mcpu=5307\fR.
+.IP "\fB\-m5407\fR" 4
+.IX Item "-m5407"
+Generate output for a ColdFire 5407 \s-1CPU\s0. The option is now deprecated
+in favor of the equivalent \fB\-mcpu=5407\fR.
+.IP "\fB\-mcfv4e\fR" 4
+.IX Item "-mcfv4e"
+Generate output for a ColdFire V4e family \s-1CPU\s0 (e.g. 547x/548x).
+This includes use of hardware floating point instructions.
+The option is equivalent to \fB\-mcpu=547x\fR, and is now
+deprecated in favor of that option.
+.IP "\fB\-m68020\-40\fR" 4
+.IX Item "-m68020-40"
+Generate output for a 68040, without using any of the new instructions.
+This results in code which can run relatively efficiently on either a
+68020/68881 or a 68030 or a 68040. The generated code does use the
+68881 instructions that are emulated on the 68040.
+.Sp
+The option is equivalent to \fB\-march=68020\fR \fB\-mtune=68020\-40\fR.
+.IP "\fB\-m68020\-60\fR" 4
+.IX Item "-m68020-60"
+Generate output for a 68060, without using any of the new instructions.
+This results in code which can run relatively efficiently on either a
+68020/68881 or a 68030 or a 68040. The generated code does use the
+68881 instructions that are emulated on the 68060.
+.Sp
+The option is equivalent to \fB\-march=68020\fR \fB\-mtune=68020\-60\fR.
+.IP "\fB\-mhard\-float\fR" 4
+.IX Item "-mhard-float"
+.PD 0
+.IP "\fB\-m68881\fR" 4
+.IX Item "-m68881"
+.PD
+Generate floating-point instructions. This is the default for 68020
+and above, and for ColdFire devices that have an \s-1FPU\s0. It defines the
+macro \fB_\|_HAVE_68881_\|_\fR on M680x0 targets and \fB_\|_mcffpu_\|_\fR
+on ColdFire targets.
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+Do not generate floating-point instructions; use library calls instead.
+This is the default for 68000, 68010, and 68832 targets. It is also
+the default for ColdFire devices that have no \s-1FPU\s0.
+.IP "\fB\-mdiv\fR" 4
+.IX Item "-mdiv"
+.PD 0
+.IP "\fB\-mno\-div\fR" 4
+.IX Item "-mno-div"
+.PD
+Generate (do not generate) ColdFire hardware divide and remainder
+instructions. If \fB\-march\fR is used without \fB\-mcpu\fR,
+the default is \*(L"on\*(R" for ColdFire architectures and \*(L"off\*(R" for M680x0
+architectures. Otherwise, the default is taken from the target \s-1CPU\s0
+(either the default \s-1CPU\s0, or the one specified by \fB\-mcpu\fR). For
+example, the default is \*(L"off\*(R" for \fB\-mcpu=5206\fR and \*(L"on\*(R" for
+\&\fB\-mcpu=5206e\fR.
+.Sp
+gcc defines the macro \fB_\|_mcfhwdiv_\|_\fR when this option is enabled.
+.IP "\fB\-mshort\fR" 4
+.IX Item "-mshort"
+Consider type \f(CW\*(C`int\*(C'\fR to be 16 bits wide, like \f(CW\*(C`short int\*(C'\fR.
+Additionally, parameters passed on the stack are also aligned to a
+16\-bit boundary even on targets whose \s-1API\s0 mandates promotion to 32\-bit.
+.IP "\fB\-mno\-short\fR" 4
+.IX Item "-mno-short"
+Do not consider type \f(CW\*(C`int\*(C'\fR to be 16 bits wide. This is the default.
+.IP "\fB\-mnobitfield\fR" 4
+.IX Item "-mnobitfield"
+.PD 0
+.IP "\fB\-mno\-bitfield\fR" 4
+.IX Item "-mno-bitfield"
+.PD
+Do not use the bit-field instructions. The \fB\-m68000\fR, \fB\-mcpu32\fR
+and \fB\-m5200\fR options imply \fB\-mnobitfield\fR.
+.IP "\fB\-mbitfield\fR" 4
+.IX Item "-mbitfield"
+Do use the bit-field instructions. The \fB\-m68020\fR option implies
+\&\fB\-mbitfield\fR. This is the default if you use a configuration
+designed for a 68020.
+.IP "\fB\-mrtd\fR" 4
+.IX Item "-mrtd"
+Use a different function-calling convention, in which functions
+that take a fixed number of arguments return with the \f(CW\*(C`rtd\*(C'\fR
+instruction, which pops their arguments while returning. This
+saves one instruction in the caller since there is no need to pop
+the arguments there.
+.Sp
+This calling convention is incompatible with the one normally
+used on Unix, so you cannot use it if you need to call libraries
+compiled with the Unix compiler.
+.Sp
+Also, you must provide function prototypes for all functions that
+take variable numbers of arguments (including \f(CW\*(C`printf\*(C'\fR);
+otherwise incorrect code will be generated for calls to those
+functions.
+.Sp
+In addition, seriously incorrect code will result if you call a
+function with too many arguments. (Normally, extra arguments are
+harmlessly ignored.)
+.Sp
+The \f(CW\*(C`rtd\*(C'\fR instruction is supported by the 68010, 68020, 68030,
+68040, 68060 and \s-1CPU32\s0 processors, but not by the 68000 or 5200.
+.IP "\fB\-mno\-rtd\fR" 4
+.IX Item "-mno-rtd"
+Do not use the calling conventions selected by \fB\-mrtd\fR.
+This is the default.
+.IP "\fB\-malign\-int\fR" 4
+.IX Item "-malign-int"
+.PD 0
+.IP "\fB\-mno\-align\-int\fR" 4
+.IX Item "-mno-align-int"
+.PD
+Control whether \s-1GCC\s0 aligns \f(CW\*(C`int\*(C'\fR, \f(CW\*(C`long\*(C'\fR, \f(CW\*(C`long long\*(C'\fR,
+\&\f(CW\*(C`float\*(C'\fR, \f(CW\*(C`double\*(C'\fR, and \f(CW\*(C`long double\*(C'\fR variables on a 32\-bit
+boundary (\fB\-malign\-int\fR) or a 16\-bit boundary (\fB\-mno\-align\-int\fR).
+Aligning variables on 32\-bit boundaries produces code that runs somewhat
+faster on processors with 32\-bit busses at the expense of more memory.
+.Sp
+\&\fBWarning:\fR if you use the \fB\-malign\-int\fR switch, \s-1GCC\s0 will
+align structures containing the above types differently than
+most published application binary interface specifications for the m68k.
+.IP "\fB\-mpcrel\fR" 4
+.IX Item "-mpcrel"
+Use the pc-relative addressing mode of the 68000 directly, instead of
+using a global offset table. At present, this option implies \fB\-fpic\fR,
+allowing at most a 16\-bit offset for pc-relative addressing. \fB\-fPIC\fR is
+not presently supported with \fB\-mpcrel\fR, though this could be supported for
+68020 and higher processors.
+.IP "\fB\-mno\-strict\-align\fR" 4
+.IX Item "-mno-strict-align"
+.PD 0
+.IP "\fB\-mstrict\-align\fR" 4
+.IX Item "-mstrict-align"
+.PD
+Do not (do) assume that unaligned memory references will be handled by
+the system.
+.IP "\fB\-msep\-data\fR" 4
+.IX Item "-msep-data"
+Generate code that allows the data segment to be located in a different
+area of memory from the text segment. This allows for execute in place in
+an environment without virtual memory management. This option implies
+\&\fB\-fPIC\fR.
+.IP "\fB\-mno\-sep\-data\fR" 4
+.IX Item "-mno-sep-data"
+Generate code that assumes that the data segment follows the text segment.
+This is the default.
+.IP "\fB\-mid\-shared\-library\fR" 4
+.IX Item "-mid-shared-library"
+Generate code that supports shared libraries via the library \s-1ID\s0 method.
+This allows for execute in place and shared libraries in an environment
+without virtual memory management. This option implies \fB\-fPIC\fR.
+.IP "\fB\-mno\-id\-shared\-library\fR" 4
+.IX Item "-mno-id-shared-library"
+Generate code that doesn't assume \s-1ID\s0 based shared libraries are being used.
+This is the default.
+.IP "\fB\-mshared\-library\-id=n\fR" 4
+.IX Item "-mshared-library-id=n"
+Specified the identification number of the \s-1ID\s0 based shared library being
+compiled. Specifying a value of 0 will generate more compact code, specifying
+other values will force the allocation of that number to the current
+library but is no more space or time efficient than omitting this option.
+.IP "\fB\-mxgot\fR" 4
+.IX Item "-mxgot"
+.PD 0
+.IP "\fB\-mno\-xgot\fR" 4
+.IX Item "-mno-xgot"
+.PD
+When generating position-independent code for ColdFire, generate code
+that works if the \s-1GOT\s0 has more than 8192 entries. This code is
+larger and slower than code generated without this option. On M680x0
+processors, this option is not needed; \fB\-fPIC\fR suffices.
+.Sp
+\&\s-1GCC\s0 normally uses a single instruction to load values from the \s-1GOT\s0.
+While this is relatively efficient, it only works if the \s-1GOT\s0
+is smaller than about 64k. Anything larger causes the linker
+to report an error such as:
+.Sp
+.Vb 1
+\& relocation truncated to fit: R_68K_GOT16O foobar
+.Ve
+.Sp
+If this happens, you should recompile your code with \fB\-mxgot\fR.
+It should then work with very large GOTs. However, code generated with
+\&\fB\-mxgot\fR is less efficient, since it takes 4 instructions to fetch
+the value of a global symbol.
+.Sp
+Note that some linkers, including newer versions of the \s-1GNU\s0 linker,
+can create multiple GOTs and sort \s-1GOT\s0 entries. If you have such a linker,
+you should only need to use \fB\-mxgot\fR when compiling a single
+object file that accesses more than 8192 \s-1GOT\s0 entries. Very few do.
+.Sp
+These options have no effect unless \s-1GCC\s0 is generating
+position-independent code.
+.PP
+\fIM68hc1x Options\fR
+.IX Subsection "M68hc1x Options"
+.PP
+These are the \fB\-m\fR options defined for the 68hc11 and 68hc12
+microcontrollers. The default values for these options depends on
+which style of microcontroller was selected when the compiler was configured;
+the defaults for the most common choices are given below.
+.IP "\fB\-m6811\fR" 4
+.IX Item "-m6811"
+.PD 0
+.IP "\fB\-m68hc11\fR" 4
+.IX Item "-m68hc11"
+.PD
+Generate output for a 68HC11. This is the default
+when the compiler is configured for 68HC11\-based systems.
+.IP "\fB\-m6812\fR" 4
+.IX Item "-m6812"
+.PD 0
+.IP "\fB\-m68hc12\fR" 4
+.IX Item "-m68hc12"
+.PD
+Generate output for a 68HC12. This is the default
+when the compiler is configured for 68HC12\-based systems.
+.IP "\fB\-m68S12\fR" 4
+.IX Item "-m68S12"
+.PD 0
+.IP "\fB\-m68hcs12\fR" 4
+.IX Item "-m68hcs12"
+.PD
+Generate output for a 68HCS12.
+.IP "\fB\-mauto\-incdec\fR" 4
+.IX Item "-mauto-incdec"
+Enable the use of 68HC12 pre and post auto-increment and auto-decrement
+addressing modes.
+.IP "\fB\-minmax\fR" 4
+.IX Item "-minmax"
+.PD 0
+.IP "\fB\-nominmax\fR" 4
+.IX Item "-nominmax"
+.PD
+Enable the use of 68HC12 min and max instructions.
+.IP "\fB\-mlong\-calls\fR" 4
+.IX Item "-mlong-calls"
+.PD 0
+.IP "\fB\-mno\-long\-calls\fR" 4
+.IX Item "-mno-long-calls"
+.PD
+Treat all calls as being far away (near). If calls are assumed to be
+far away, the compiler will use the \f(CW\*(C`call\*(C'\fR instruction to
+call a function and the \f(CW\*(C`rtc\*(C'\fR instruction for returning.
+.IP "\fB\-mshort\fR" 4
+.IX Item "-mshort"
+Consider type \f(CW\*(C`int\*(C'\fR to be 16 bits wide, like \f(CW\*(C`short int\*(C'\fR.
+.IP "\fB\-msoft\-reg\-count=\fR\fIcount\fR" 4
+.IX Item "-msoft-reg-count=count"
+Specify the number of pseudo-soft registers which are used for the
+code generation. The maximum number is 32. Using more pseudo-soft
+register may or may not result in better code depending on the program.
+The default is 4 for 68HC11 and 2 for 68HC12.
+.PP
+\fIMCore Options\fR
+.IX Subsection "MCore Options"
+.PP
+These are the \fB\-m\fR options defined for the Motorola M*Core
+processors.
+.IP "\fB\-mhardlit\fR" 4
+.IX Item "-mhardlit"
+.PD 0
+.IP "\fB\-mno\-hardlit\fR" 4
+.IX Item "-mno-hardlit"
+.PD
+Inline constants into the code stream if it can be done in two
+instructions or less.
+.IP "\fB\-mdiv\fR" 4
+.IX Item "-mdiv"
+.PD 0
+.IP "\fB\-mno\-div\fR" 4
+.IX Item "-mno-div"
+.PD
+Use the divide instruction. (Enabled by default).
+.IP "\fB\-mrelax\-immediate\fR" 4
+.IX Item "-mrelax-immediate"
+.PD 0
+.IP "\fB\-mno\-relax\-immediate\fR" 4
+.IX Item "-mno-relax-immediate"
+.PD
+Allow arbitrary sized immediates in bit operations.
+.IP "\fB\-mwide\-bitfields\fR" 4
+.IX Item "-mwide-bitfields"
+.PD 0
+.IP "\fB\-mno\-wide\-bitfields\fR" 4
+.IX Item "-mno-wide-bitfields"
+.PD
+Always treat bit-fields as int-sized.
+.IP "\fB\-m4byte\-functions\fR" 4
+.IX Item "-m4byte-functions"
+.PD 0
+.IP "\fB\-mno\-4byte\-functions\fR" 4
+.IX Item "-mno-4byte-functions"
+.PD
+Force all functions to be aligned to a four byte boundary.
+.IP "\fB\-mcallgraph\-data\fR" 4
+.IX Item "-mcallgraph-data"
+.PD 0
+.IP "\fB\-mno\-callgraph\-data\fR" 4
+.IX Item "-mno-callgraph-data"
+.PD
+Emit callgraph information.
+.IP "\fB\-mslow\-bytes\fR" 4
+.IX Item "-mslow-bytes"
+.PD 0
+.IP "\fB\-mno\-slow\-bytes\fR" 4
+.IX Item "-mno-slow-bytes"
+.PD
+Prefer word access when reading byte quantities.
+.IP "\fB\-mlittle\-endian\fR" 4
+.IX Item "-mlittle-endian"
+.PD 0
+.IP "\fB\-mbig\-endian\fR" 4
+.IX Item "-mbig-endian"
+.PD
+Generate code for a little endian target.
+.IP "\fB\-m210\fR" 4
+.IX Item "-m210"
+.PD 0
+.IP "\fB\-m340\fR" 4
+.IX Item "-m340"
+.PD
+Generate code for the 210 processor.
+.IP "\fB\-mno\-lsim\fR" 4
+.IX Item "-mno-lsim"
+Assume that run-time support has been provided and so omit the
+simulator library (\fIlibsim.a)\fR from the linker command line.
+.IP "\fB\-mstack\-increment=\fR\fIsize\fR" 4
+.IX Item "-mstack-increment=size"
+Set the maximum amount for a single stack increment operation. Large
+values can increase the speed of programs which contain functions
+that need a large amount of stack space, but they can also trigger a
+segmentation fault if the stack is extended too much. The default
+value is 0x1000.
+.PP
+\fI\s-1MIPS\s0 Options\fR
+.IX Subsection "MIPS Options"
+.IP "\fB\-EB\fR" 4
+.IX Item "-EB"
+Generate big-endian code.
+.IP "\fB\-EL\fR" 4
+.IX Item "-EL"
+Generate little-endian code. This is the default for \fBmips*el\-*\-*\fR
+configurations.
+.IP "\fB\-march=\fR\fIarch\fR" 4
+.IX Item "-march=arch"
+Generate code that will run on \fIarch\fR, which can be the name of a
+generic \s-1MIPS\s0 \s-1ISA\s0, or the name of a particular processor.
+The \s-1ISA\s0 names are:
+\&\fBmips1\fR, \fBmips2\fR, \fBmips3\fR, \fBmips4\fR,
+\&\fBmips32\fR, \fBmips32r2\fR, \fBmips64\fR and \fBmips64r2\fR.
+The processor names are:
+\&\fB4kc\fR, \fB4km\fR, \fB4kp\fR, \fB4ksc\fR,
+\&\fB4kec\fR, \fB4kem\fR, \fB4kep\fR, \fB4ksd\fR,
+\&\fB5kc\fR, \fB5kf\fR,
+\&\fB20kc\fR,
+\&\fB24kc\fR, \fB24kf2_1\fR, \fB24kf1_1\fR,
+\&\fB24kec\fR, \fB24kef2_1\fR, \fB24kef1_1\fR,
+\&\fB34kc\fR, \fB34kf2_1\fR, \fB34kf1_1\fR,
+\&\fB74kc\fR, \fB74kf2_1\fR, \fB74kf1_1\fR, \fB74kf3_2\fR,
+\&\fBloongson2e\fR, \fBloongson2f\fR,
+\&\fBm4k\fR,
+\&\fBocteon\fR,
+\&\fBorion\fR,
+\&\fBr2000\fR, \fBr3000\fR, \fBr3900\fR, \fBr4000\fR, \fBr4400\fR,
+\&\fBr4600\fR, \fBr4650\fR, \fBr6000\fR, \fBr8000\fR,
+\&\fBrm7000\fR, \fBrm9000\fR,
+\&\fBr10000\fR, \fBr12000\fR, \fBr14000\fR, \fBr16000\fR,
+\&\fBsb1\fR,
+\&\fBsr71000\fR,
+\&\fBvr4100\fR, \fBvr4111\fR, \fBvr4120\fR, \fBvr4130\fR, \fBvr4300\fR,
+\&\fBvr5000\fR, \fBvr5400\fR, \fBvr5500\fR
+and \fBxlr\fR.
+The special value \fBfrom-abi\fR selects the
+most compatible architecture for the selected \s-1ABI\s0 (that is,
+\&\fBmips1\fR for 32\-bit ABIs and \fBmips3\fR for 64\-bit ABIs).
+.Sp
+Native Linux/GNU toolchains also support the value \fBnative\fR,
+which selects the best architecture option for the host processor.
+\&\fB\-march=native\fR has no effect if \s-1GCC\s0 does not recognize
+the processor.
+.Sp
+In processor names, a final \fB000\fR can be abbreviated as \fBk\fR
+(for example, \fB\-march=r2k\fR). Prefixes are optional, and
+\&\fBvr\fR may be written \fBr\fR.
+.Sp
+Names of the form \fIn\fR\fBf2_1\fR refer to processors with
+FPUs clocked at half the rate of the core, names of the form
+\&\fIn\fR\fBf1_1\fR refer to processors with FPUs clocked at the same
+rate as the core, and names of the form \fIn\fR\fBf3_2\fR refer to
+processors with FPUs clocked a ratio of 3:2 with respect to the core.
+For compatibility reasons, \fIn\fR\fBf\fR is accepted as a synonym
+for \fIn\fR\fBf2_1\fR while \fIn\fR\fBx\fR and \fIb\fR\fBfx\fR are
+accepted as synonyms for \fIn\fR\fBf1_1\fR.
+.Sp
+\&\s-1GCC\s0 defines two macros based on the value of this option. The first
+is \fB_MIPS_ARCH\fR, which gives the name of target architecture, as
+a string. The second has the form \fB_MIPS_ARCH_\fR\fIfoo\fR,
+where \fIfoo\fR is the capitalized value of \fB_MIPS_ARCH\fR.
+For example, \fB\-march=r2000\fR will set \fB_MIPS_ARCH\fR
+to \fB\*(L"r2000\*(R"\fR and define the macro \fB_MIPS_ARCH_R2000\fR.
+.Sp
+Note that the \fB_MIPS_ARCH\fR macro uses the processor names given
+above. In other words, it will have the full prefix and will not
+abbreviate \fB000\fR as \fBk\fR. In the case of \fBfrom-abi\fR,
+the macro names the resolved architecture (either \fB\*(L"mips1\*(R"\fR or
+\&\fB\*(L"mips3\*(R"\fR). It names the default architecture when no
+\&\fB\-march\fR option is given.
+.IP "\fB\-mtune=\fR\fIarch\fR" 4
+.IX Item "-mtune=arch"
+Optimize for \fIarch\fR. Among other things, this option controls
+the way instructions are scheduled, and the perceived cost of arithmetic
+operations. The list of \fIarch\fR values is the same as for
+\&\fB\-march\fR.
+.Sp
+When this option is not used, \s-1GCC\s0 will optimize for the processor
+specified by \fB\-march\fR. By using \fB\-march\fR and
+\&\fB\-mtune\fR together, it is possible to generate code that will
+run on a family of processors, but optimize the code for one
+particular member of that family.
+.Sp
+\&\fB\-mtune\fR defines the macros \fB_MIPS_TUNE\fR and
+\&\fB_MIPS_TUNE_\fR\fIfoo\fR, which work in the same way as the
+\&\fB\-march\fR ones described above.
+.IP "\fB\-mips1\fR" 4
+.IX Item "-mips1"
+Equivalent to \fB\-march=mips1\fR.
+.IP "\fB\-mips2\fR" 4
+.IX Item "-mips2"
+Equivalent to \fB\-march=mips2\fR.
+.IP "\fB\-mips3\fR" 4
+.IX Item "-mips3"
+Equivalent to \fB\-march=mips3\fR.
+.IP "\fB\-mips4\fR" 4
+.IX Item "-mips4"
+Equivalent to \fB\-march=mips4\fR.
+.IP "\fB\-mips32\fR" 4
+.IX Item "-mips32"
+Equivalent to \fB\-march=mips32\fR.
+.IP "\fB\-mips32r2\fR" 4
+.IX Item "-mips32r2"
+Equivalent to \fB\-march=mips32r2\fR.
+.IP "\fB\-mips64\fR" 4
+.IX Item "-mips64"
+Equivalent to \fB\-march=mips64\fR.
+.IP "\fB\-mips64r2\fR" 4
+.IX Item "-mips64r2"
+Equivalent to \fB\-march=mips64r2\fR.
+.IP "\fB\-mips16\fR" 4
+.IX Item "-mips16"
+.PD 0
+.IP "\fB\-mno\-mips16\fR" 4
+.IX Item "-mno-mips16"
+.PD
+Generate (do not generate) \s-1MIPS16\s0 code. If \s-1GCC\s0 is targetting a
+\&\s-1MIPS32\s0 or \s-1MIPS64\s0 architecture, it will make use of the MIPS16e \s-1ASE\s0.
+.Sp
+\&\s-1MIPS16\s0 code generation can also be controlled on a per-function basis
+by means of \f(CW\*(C`mips16\*(C'\fR and \f(CW\*(C`nomips16\*(C'\fR attributes.
+.IP "\fB\-mflip\-mips16\fR" 4
+.IX Item "-mflip-mips16"
+Generate \s-1MIPS16\s0 code on alternating functions. This option is provided
+for regression testing of mixed MIPS16/non\-MIPS16 code generation, and is
+not intended for ordinary use in compiling user code.
+.IP "\fB\-minterlink\-mips16\fR" 4
+.IX Item "-minterlink-mips16"
+.PD 0
+.IP "\fB\-mno\-interlink\-mips16\fR" 4
+.IX Item "-mno-interlink-mips16"
+.PD
+Require (do not require) that non\-MIPS16 code be link-compatible with
+\&\s-1MIPS16\s0 code.
+.Sp
+For example, non\-MIPS16 code cannot jump directly to \s-1MIPS16\s0 code;
+it must either use a call or an indirect jump. \fB\-minterlink\-mips16\fR
+therefore disables direct jumps unless \s-1GCC\s0 knows that the target of the
+jump is not \s-1MIPS16\s0.
+.IP "\fB\-mabi=32\fR" 4
+.IX Item "-mabi=32"
+.PD 0
+.IP "\fB\-mabi=o64\fR" 4
+.IX Item "-mabi=o64"
+.IP "\fB\-mabi=n32\fR" 4
+.IX Item "-mabi=n32"
+.IP "\fB\-mabi=64\fR" 4
+.IX Item "-mabi=64"
+.IP "\fB\-mabi=eabi\fR" 4
+.IX Item "-mabi=eabi"
+.PD
+Generate code for the given \s-1ABI\s0.
+.Sp
+Note that the \s-1EABI\s0 has a 32\-bit and a 64\-bit variant. \s-1GCC\s0 normally
+generates 64\-bit code when you select a 64\-bit architecture, but you
+can use \fB\-mgp32\fR to get 32\-bit code instead.
+.Sp
+For information about the O64 \s-1ABI\s0, see
+<\fBhttp://gcc.gnu.org/projects/mipso64\-abi.html\fR>.
+.Sp
+\&\s-1GCC\s0 supports a variant of the o32 \s-1ABI\s0 in which floating-point registers
+are 64 rather than 32 bits wide. You can select this combination with
+\&\fB\-mabi=32\fR \fB\-mfp64\fR. This \s-1ABI\s0 relies on the \fBmthc1\fR
+and \fBmfhc1\fR instructions and is therefore only supported for
+\&\s-1MIPS32R2\s0 processors.
+.Sp
+The register assignments for arguments and return values remain the
+same, but each scalar value is passed in a single 64\-bit register
+rather than a pair of 32\-bit registers. For example, scalar
+floating-point values are returned in \fB\f(CB$f0\fB\fR only, not a
+\&\fB\f(CB$f0\fB\fR/\fB\f(CB$f1\fB\fR pair. The set of call-saved registers also
+remains the same, but all 64 bits are saved.
+.IP "\fB\-mabicalls\fR" 4
+.IX Item "-mabicalls"
+.PD 0
+.IP "\fB\-mno\-abicalls\fR" 4
+.IX Item "-mno-abicalls"
+.PD
+Generate (do not generate) code that is suitable for SVR4\-style
+dynamic objects. \fB\-mabicalls\fR is the default for SVR4\-based
+systems.
+.IP "\fB\-mshared\fR" 4
+.IX Item "-mshared"
+.PD 0
+.IP "\fB\-mno\-shared\fR" 4
+.IX Item "-mno-shared"
+.PD
+Generate (do not generate) code that is fully position-independent,
+and that can therefore be linked into shared libraries. This option
+only affects \fB\-mabicalls\fR.
+.Sp
+All \fB\-mabicalls\fR code has traditionally been position-independent,
+regardless of options like \fB\-fPIC\fR and \fB\-fpic\fR. However,
+as an extension, the \s-1GNU\s0 toolchain allows executables to use absolute
+accesses for locally-binding symbols. It can also use shorter \s-1GP\s0
+initialization sequences and generate direct calls to locally-defined
+functions. This mode is selected by \fB\-mno\-shared\fR.
+.Sp
+\&\fB\-mno\-shared\fR depends on binutils 2.16 or higher and generates
+objects that can only be linked by the \s-1GNU\s0 linker. However, the option
+does not affect the \s-1ABI\s0 of the final executable; it only affects the \s-1ABI\s0
+of relocatable objects. Using \fB\-mno\-shared\fR will generally make
+executables both smaller and quicker.
+.Sp
+\&\fB\-mshared\fR is the default.
+.IP "\fB\-mplt\fR" 4
+.IX Item "-mplt"
+.PD 0
+.IP "\fB\-mno\-plt\fR" 4
+.IX Item "-mno-plt"
+.PD
+Assume (do not assume) that the static and dynamic linkers
+support PLTs and copy relocations. This option only affects
+\&\fB\-mno\-shared \-mabicalls\fR. For the n64 \s-1ABI\s0, this option
+has no effect without \fB\-msym32\fR.
+.Sp
+You can make \fB\-mplt\fR the default by configuring
+\&\s-1GCC\s0 with \fB\-\-with\-mips\-plt\fR. The default is
+\&\fB\-mno\-plt\fR otherwise.
+.IP "\fB\-mxgot\fR" 4
+.IX Item "-mxgot"
+.PD 0
+.IP "\fB\-mno\-xgot\fR" 4
+.IX Item "-mno-xgot"
+.PD
+Lift (do not lift) the usual restrictions on the size of the global
+offset table.
+.Sp
+\&\s-1GCC\s0 normally uses a single instruction to load values from the \s-1GOT\s0.
+While this is relatively efficient, it will only work if the \s-1GOT\s0
+is smaller than about 64k. Anything larger will cause the linker
+to report an error such as:
+.Sp
+.Vb 1
+\& relocation truncated to fit: R_MIPS_GOT16 foobar
+.Ve
+.Sp
+If this happens, you should recompile your code with \fB\-mxgot\fR.
+It should then work with very large GOTs, although it will also be
+less efficient, since it will take three instructions to fetch the
+value of a global symbol.
+.Sp
+Note that some linkers can create multiple GOTs. If you have such a
+linker, you should only need to use \fB\-mxgot\fR when a single object
+file accesses more than 64k's worth of \s-1GOT\s0 entries. Very few do.
+.Sp
+These options have no effect unless \s-1GCC\s0 is generating position
+independent code.
+.IP "\fB\-mgp32\fR" 4
+.IX Item "-mgp32"
+Assume that general-purpose registers are 32 bits wide.
+.IP "\fB\-mgp64\fR" 4
+.IX Item "-mgp64"
+Assume that general-purpose registers are 64 bits wide.
+.IP "\fB\-mfp32\fR" 4
+.IX Item "-mfp32"
+Assume that floating-point registers are 32 bits wide.
+.IP "\fB\-mfp64\fR" 4
+.IX Item "-mfp64"
+Assume that floating-point registers are 64 bits wide.
+.IP "\fB\-mhard\-float\fR" 4
+.IX Item "-mhard-float"
+Use floating-point coprocessor instructions.
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+Do not use floating-point coprocessor instructions. Implement
+floating-point calculations using library calls instead.
+.IP "\fB\-msingle\-float\fR" 4
+.IX Item "-msingle-float"
+Assume that the floating-point coprocessor only supports single-precision
+operations.
+.IP "\fB\-mdouble\-float\fR" 4
+.IX Item "-mdouble-float"
+Assume that the floating-point coprocessor supports double-precision
+operations. This is the default.
+.IP "\fB\-mllsc\fR" 4
+.IX Item "-mllsc"
+.PD 0
+.IP "\fB\-mno\-llsc\fR" 4
+.IX Item "-mno-llsc"
+.PD
+Use (do not use) \fBll\fR, \fBsc\fR, and \fBsync\fR instructions to
+implement atomic memory built-in functions. When neither option is
+specified, \s-1GCC\s0 will use the instructions if the target architecture
+supports them.
+.Sp
+\&\fB\-mllsc\fR is useful if the runtime environment can emulate the
+instructions and \fB\-mno\-llsc\fR can be useful when compiling for
+nonstandard ISAs. You can make either option the default by
+configuring \s-1GCC\s0 with \fB\-\-with\-llsc\fR and \fB\-\-without\-llsc\fR
+respectively. \fB\-\-with\-llsc\fR is the default for some
+configurations; see the installation documentation for details.
+.IP "\fB\-mdsp\fR" 4
+.IX Item "-mdsp"
+.PD 0
+.IP "\fB\-mno\-dsp\fR" 4
+.IX Item "-mno-dsp"
+.PD
+Use (do not use) revision 1 of the \s-1MIPS\s0 \s-1DSP\s0 \s-1ASE\s0.
+ This option defines the
+preprocessor macro \fB_\|_mips_dsp\fR. It also defines
+\&\fB_\|_mips_dsp_rev\fR to 1.
+.IP "\fB\-mdspr2\fR" 4
+.IX Item "-mdspr2"
+.PD 0
+.IP "\fB\-mno\-dspr2\fR" 4
+.IX Item "-mno-dspr2"
+.PD
+Use (do not use) revision 2 of the \s-1MIPS\s0 \s-1DSP\s0 \s-1ASE\s0.
+ This option defines the
+preprocessor macros \fB_\|_mips_dsp\fR and \fB_\|_mips_dspr2\fR.
+It also defines \fB_\|_mips_dsp_rev\fR to 2.
+.IP "\fB\-msmartmips\fR" 4
+.IX Item "-msmartmips"
+.PD 0
+.IP "\fB\-mno\-smartmips\fR" 4
+.IX Item "-mno-smartmips"
+.PD
+Use (do not use) the \s-1MIPS\s0 SmartMIPS \s-1ASE\s0.
+.IP "\fB\-mpaired\-single\fR" 4
+.IX Item "-mpaired-single"
+.PD 0
+.IP "\fB\-mno\-paired\-single\fR" 4
+.IX Item "-mno-paired-single"
+.PD
+Use (do not use) paired-single floating-point instructions.
+ This option requires
+hardware floating-point support to be enabled.
+.IP "\fB\-mdmx\fR" 4
+.IX Item "-mdmx"
+.PD 0
+.IP "\fB\-mno\-mdmx\fR" 4
+.IX Item "-mno-mdmx"
+.PD
+Use (do not use) \s-1MIPS\s0 Digital Media Extension instructions.
+This option can only be used when generating 64\-bit code and requires
+hardware floating-point support to be enabled.
+.IP "\fB\-mips3d\fR" 4
+.IX Item "-mips3d"
+.PD 0
+.IP "\fB\-mno\-mips3d\fR" 4
+.IX Item "-mno-mips3d"
+.PD
+Use (do not use) the \s-1MIPS\-3D\s0 \s-1ASE\s0.
+The option \fB\-mips3d\fR implies \fB\-mpaired\-single\fR.
+.IP "\fB\-mmt\fR" 4
+.IX Item "-mmt"
+.PD 0
+.IP "\fB\-mno\-mt\fR" 4
+.IX Item "-mno-mt"
+.PD
+Use (do not use) \s-1MT\s0 Multithreading instructions.
+.IP "\fB\-mlong64\fR" 4
+.IX Item "-mlong64"
+Force \f(CW\*(C`long\*(C'\fR types to be 64 bits wide. See \fB\-mlong32\fR for
+an explanation of the default and the way that the pointer size is
+determined.
+.IP "\fB\-mlong32\fR" 4
+.IX Item "-mlong32"
+Force \f(CW\*(C`long\*(C'\fR, \f(CW\*(C`int\*(C'\fR, and pointer types to be 32 bits wide.
+.Sp
+The default size of \f(CW\*(C`int\*(C'\fRs, \f(CW\*(C`long\*(C'\fRs and pointers depends on
+the \s-1ABI\s0. All the supported ABIs use 32\-bit \f(CW\*(C`int\*(C'\fRs. The n64 \s-1ABI\s0
+uses 64\-bit \f(CW\*(C`long\*(C'\fRs, as does the 64\-bit \s-1EABI\s0; the others use
+32\-bit \f(CW\*(C`long\*(C'\fRs. Pointers are the same size as \f(CW\*(C`long\*(C'\fRs,
+or the same size as integer registers, whichever is smaller.
+.IP "\fB\-msym32\fR" 4
+.IX Item "-msym32"
+.PD 0
+.IP "\fB\-mno\-sym32\fR" 4
+.IX Item "-mno-sym32"
+.PD
+Assume (do not assume) that all symbols have 32\-bit values, regardless
+of the selected \s-1ABI\s0. This option is useful in combination with
+\&\fB\-mabi=64\fR and \fB\-mno\-abicalls\fR because it allows \s-1GCC\s0
+to generate shorter and faster references to symbolic addresses.
+.IP "\fB\-G\fR \fInum\fR" 4
+.IX Item "-G num"
+Put definitions of externally-visible data in a small data section
+if that data is no bigger than \fInum\fR bytes. \s-1GCC\s0 can then access
+the data more efficiently; see \fB\-mgpopt\fR for details.
+.Sp
+The default \fB\-G\fR option depends on the configuration.
+.IP "\fB\-mlocal\-sdata\fR" 4
+.IX Item "-mlocal-sdata"
+.PD 0
+.IP "\fB\-mno\-local\-sdata\fR" 4
+.IX Item "-mno-local-sdata"
+.PD
+Extend (do not extend) the \fB\-G\fR behavior to local data too,
+such as to static variables in C. \fB\-mlocal\-sdata\fR is the
+default for all configurations.
+.Sp
+If the linker complains that an application is using too much small data,
+you might want to try rebuilding the less performance-critical parts with
+\&\fB\-mno\-local\-sdata\fR. You might also want to build large
+libraries with \fB\-mno\-local\-sdata\fR, so that the libraries leave
+more room for the main program.
+.IP "\fB\-mextern\-sdata\fR" 4
+.IX Item "-mextern-sdata"
+.PD 0
+.IP "\fB\-mno\-extern\-sdata\fR" 4
+.IX Item "-mno-extern-sdata"
+.PD
+Assume (do not assume) that externally-defined data will be in
+a small data section if that data is within the \fB\-G\fR limit.
+\&\fB\-mextern\-sdata\fR is the default for all configurations.
+.Sp
+If you compile a module \fIMod\fR with \fB\-mextern\-sdata\fR \fB\-G\fR
+\&\fInum\fR \fB\-mgpopt\fR, and \fIMod\fR references a variable \fIVar\fR
+that is no bigger than \fInum\fR bytes, you must make sure that \fIVar\fR
+is placed in a small data section. If \fIVar\fR is defined by another
+module, you must either compile that module with a high-enough
+\&\fB\-G\fR setting or attach a \f(CW\*(C`section\*(C'\fR attribute to \fIVar\fR's
+definition. If \fIVar\fR is common, you must link the application
+with a high-enough \fB\-G\fR setting.
+.Sp
+The easiest way of satisfying these restrictions is to compile
+and link every module with the same \fB\-G\fR option. However,
+you may wish to build a library that supports several different
+small data limits. You can do this by compiling the library with
+the highest supported \fB\-G\fR setting and additionally using
+\&\fB\-mno\-extern\-sdata\fR to stop the library from making assumptions
+about externally-defined data.
+.IP "\fB\-mgpopt\fR" 4
+.IX Item "-mgpopt"
+.PD 0
+.IP "\fB\-mno\-gpopt\fR" 4
+.IX Item "-mno-gpopt"
+.PD
+Use (do not use) GP-relative accesses for symbols that are known to be
+in a small data section; see \fB\-G\fR, \fB\-mlocal\-sdata\fR and
+\&\fB\-mextern\-sdata\fR. \fB\-mgpopt\fR is the default for all
+configurations.
+.Sp
+\&\fB\-mno\-gpopt\fR is useful for cases where the \f(CW$gp\fR register
+might not hold the value of \f(CW\*(C`_gp\*(C'\fR. For example, if the code is
+part of a library that might be used in a boot monitor, programs that
+call boot monitor routines will pass an unknown value in \f(CW$gp\fR.
+(In such situations, the boot monitor itself would usually be compiled
+with \fB\-G0\fR.)
+.Sp
+\&\fB\-mno\-gpopt\fR implies \fB\-mno\-local\-sdata\fR and
+\&\fB\-mno\-extern\-sdata\fR.
+.IP "\fB\-membedded\-data\fR" 4
+.IX Item "-membedded-data"
+.PD 0
+.IP "\fB\-mno\-embedded\-data\fR" 4
+.IX Item "-mno-embedded-data"
+.PD
+Allocate variables to the read-only data section first if possible, then
+next in the small data section if possible, otherwise in data. This gives
+slightly slower code than the default, but reduces the amount of \s-1RAM\s0 required
+when executing, and thus may be preferred for some embedded systems.
+.IP "\fB\-muninit\-const\-in\-rodata\fR" 4
+.IX Item "-muninit-const-in-rodata"
+.PD 0
+.IP "\fB\-mno\-uninit\-const\-in\-rodata\fR" 4
+.IX Item "-mno-uninit-const-in-rodata"
+.PD
+Put uninitialized \f(CW\*(C`const\*(C'\fR variables in the read-only data section.
+This option is only meaningful in conjunction with \fB\-membedded\-data\fR.
+.IP "\fB\-mcode\-readable=\fR\fIsetting\fR" 4
+.IX Item "-mcode-readable=setting"
+Specify whether \s-1GCC\s0 may generate code that reads from executable sections.
+There are three possible settings:
+.RS 4
+.IP "\fB\-mcode\-readable=yes\fR" 4
+.IX Item "-mcode-readable=yes"
+Instructions may freely access executable sections. This is the
+default setting.
+.IP "\fB\-mcode\-readable=pcrel\fR" 4
+.IX Item "-mcode-readable=pcrel"
+\&\s-1MIPS16\s0 PC-relative load instructions can access executable sections,
+but other instructions must not do so. This option is useful on 4KSc
+and 4KSd processors when the code TLBs have the Read Inhibit bit set.
+It is also useful on processors that can be configured to have a dual
+instruction/data \s-1SRAM\s0 interface and that, like the M4K, automatically
+redirect PC-relative loads to the instruction \s-1RAM\s0.
+.IP "\fB\-mcode\-readable=no\fR" 4
+.IX Item "-mcode-readable=no"
+Instructions must not access executable sections. This option can be
+useful on targets that are configured to have a dual instruction/data
+\&\s-1SRAM\s0 interface but that (unlike the M4K) do not automatically redirect
+PC-relative loads to the instruction \s-1RAM\s0.
+.RE
+.RS 4
+.RE
+.IP "\fB\-msplit\-addresses\fR" 4
+.IX Item "-msplit-addresses"
+.PD 0
+.IP "\fB\-mno\-split\-addresses\fR" 4
+.IX Item "-mno-split-addresses"
+.PD
+Enable (disable) use of the \f(CW\*(C`%hi()\*(C'\fR and \f(CW\*(C`%lo()\*(C'\fR assembler
+relocation operators. This option has been superseded by
+\&\fB\-mexplicit\-relocs\fR but is retained for backwards compatibility.
+.IP "\fB\-mexplicit\-relocs\fR" 4
+.IX Item "-mexplicit-relocs"
+.PD 0
+.IP "\fB\-mno\-explicit\-relocs\fR" 4
+.IX Item "-mno-explicit-relocs"
+.PD
+Use (do not use) assembler relocation operators when dealing with symbolic
+addresses. The alternative, selected by \fB\-mno\-explicit\-relocs\fR,
+is to use assembler macros instead.
+.Sp
+\&\fB\-mexplicit\-relocs\fR is the default if \s-1GCC\s0 was configured
+to use an assembler that supports relocation operators.
+.IP "\fB\-mcheck\-zero\-division\fR" 4
+.IX Item "-mcheck-zero-division"
+.PD 0
+.IP "\fB\-mno\-check\-zero\-division\fR" 4
+.IX Item "-mno-check-zero-division"
+.PD
+Trap (do not trap) on integer division by zero.
+.Sp
+The default is \fB\-mcheck\-zero\-division\fR.
+.IP "\fB\-mdivide\-traps\fR" 4
+.IX Item "-mdivide-traps"
+.PD 0
+.IP "\fB\-mdivide\-breaks\fR" 4
+.IX Item "-mdivide-breaks"
+.PD
+\&\s-1MIPS\s0 systems check for division by zero by generating either a
+conditional trap or a break instruction. Using traps results in
+smaller code, but is only supported on \s-1MIPS\s0 \s-1II\s0 and later. Also, some
+versions of the Linux kernel have a bug that prevents trap from
+generating the proper signal (\f(CW\*(C`SIGFPE\*(C'\fR). Use \fB\-mdivide\-traps\fR to
+allow conditional traps on architectures that support them and
+\&\fB\-mdivide\-breaks\fR to force the use of breaks.
+.Sp
+The default is usually \fB\-mdivide\-traps\fR, but this can be
+overridden at configure time using \fB\-\-with\-divide=breaks\fR.
+Divide-by-zero checks can be completely disabled using
+\&\fB\-mno\-check\-zero\-division\fR.
+.IP "\fB\-mmemcpy\fR" 4
+.IX Item "-mmemcpy"
+.PD 0
+.IP "\fB\-mno\-memcpy\fR" 4
+.IX Item "-mno-memcpy"
+.PD
+Force (do not force) the use of \f(CW\*(C`memcpy()\*(C'\fR for non-trivial block
+moves. The default is \fB\-mno\-memcpy\fR, which allows \s-1GCC\s0 to inline
+most constant-sized copies.
+.IP "\fB\-mlong\-calls\fR" 4
+.IX Item "-mlong-calls"
+.PD 0
+.IP "\fB\-mno\-long\-calls\fR" 4
+.IX Item "-mno-long-calls"
+.PD
+Disable (do not disable) use of the \f(CW\*(C`jal\*(C'\fR instruction. Calling
+functions using \f(CW\*(C`jal\*(C'\fR is more efficient but requires the caller
+and callee to be in the same 256 megabyte segment.
+.Sp
+This option has no effect on abicalls code. The default is
+\&\fB\-mno\-long\-calls\fR.
+.IP "\fB\-mmad\fR" 4
+.IX Item "-mmad"
+.PD 0
+.IP "\fB\-mno\-mad\fR" 4
+.IX Item "-mno-mad"
+.PD
+Enable (disable) use of the \f(CW\*(C`mad\*(C'\fR, \f(CW\*(C`madu\*(C'\fR and \f(CW\*(C`mul\*(C'\fR
+instructions, as provided by the R4650 \s-1ISA\s0.
+.IP "\fB\-mfused\-madd\fR" 4
+.IX Item "-mfused-madd"
+.PD 0
+.IP "\fB\-mno\-fused\-madd\fR" 4
+.IX Item "-mno-fused-madd"
+.PD
+Enable (disable) use of the floating point multiply-accumulate
+instructions, when they are available. The default is
+\&\fB\-mfused\-madd\fR.
+.Sp
+When multiply-accumulate instructions are used, the intermediate
+product is calculated to infinite precision and is not subject to
+the \s-1FCSR\s0 Flush to Zero bit. This may be undesirable in some
+circumstances.
+.IP "\fB\-nocpp\fR" 4
+.IX Item "-nocpp"
+Tell the \s-1MIPS\s0 assembler to not run its preprocessor over user
+assembler files (with a \fB.s\fR suffix) when assembling them.
+.IP "\fB\-mfix\-r4000\fR" 4
+.IX Item "-mfix-r4000"
+.PD 0
+.IP "\fB\-mno\-fix\-r4000\fR" 4
+.IX Item "-mno-fix-r4000"
+.PD
+Work around certain R4000 \s-1CPU\s0 errata:
+.RS 4
+.IP "\-" 4
+A double-word or a variable shift may give an incorrect result if executed
+immediately after starting an integer division.
+.IP "\-" 4
+A double-word or a variable shift may give an incorrect result if executed
+while an integer multiplication is in progress.
+.IP "\-" 4
+An integer division may give an incorrect result if started in a delay slot
+of a taken branch or a jump.
+.RE
+.RS 4
+.RE
+.IP "\fB\-mfix\-r4400\fR" 4
+.IX Item "-mfix-r4400"
+.PD 0
+.IP "\fB\-mno\-fix\-r4400\fR" 4
+.IX Item "-mno-fix-r4400"
+.PD
+Work around certain R4400 \s-1CPU\s0 errata:
+.RS 4
+.IP "\-" 4
+A double-word or a variable shift may give an incorrect result if executed
+immediately after starting an integer division.
+.RE
+.RS 4
+.RE
+.IP "\fB\-mfix\-r10000\fR" 4
+.IX Item "-mfix-r10000"
+.PD 0
+.IP "\fB\-mno\-fix\-r10000\fR" 4
+.IX Item "-mno-fix-r10000"
+.PD
+Work around certain R10000 errata:
+.RS 4
+.IP "\-" 4
+\&\f(CW\*(C`ll\*(C'\fR/\f(CW\*(C`sc\*(C'\fR sequences may not behave atomically on revisions
+prior to 3.0. They may deadlock on revisions 2.6 and earlier.
+.RE
+.RS 4
+.Sp
+This option can only be used if the target architecture supports
+branch-likely instructions. \fB\-mfix\-r10000\fR is the default when
+\&\fB\-march=r10000\fR is used; \fB\-mno\-fix\-r10000\fR is the default
+otherwise.
+.RE
+.IP "\fB\-mfix\-vr4120\fR" 4
+.IX Item "-mfix-vr4120"
+.PD 0
+.IP "\fB\-mno\-fix\-vr4120\fR" 4
+.IX Item "-mno-fix-vr4120"
+.PD
+Work around certain \s-1VR4120\s0 errata:
+.RS 4
+.IP "\-" 4
+\&\f(CW\*(C`dmultu\*(C'\fR does not always produce the correct result.
+.IP "\-" 4
+\&\f(CW\*(C`div\*(C'\fR and \f(CW\*(C`ddiv\*(C'\fR do not always produce the correct result if one
+of the operands is negative.
+.RE
+.RS 4
+.Sp
+The workarounds for the division errata rely on special functions in
+\&\fIlibgcc.a\fR. At present, these functions are only provided by
+the \f(CW\*(C`mips64vr*\-elf\*(C'\fR configurations.
+.Sp
+Other \s-1VR4120\s0 errata require a nop to be inserted between certain pairs of
+instructions. These errata are handled by the assembler, not by \s-1GCC\s0 itself.
+.RE
+.IP "\fB\-mfix\-vr4130\fR" 4
+.IX Item "-mfix-vr4130"
+Work around the \s-1VR4130\s0 \f(CW\*(C`mflo\*(C'\fR/\f(CW\*(C`mfhi\*(C'\fR errata. The
+workarounds are implemented by the assembler rather than by \s-1GCC\s0,
+although \s-1GCC\s0 will avoid using \f(CW\*(C`mflo\*(C'\fR and \f(CW\*(C`mfhi\*(C'\fR if the
+\&\s-1VR4130\s0 \f(CW\*(C`macc\*(C'\fR, \f(CW\*(C`macchi\*(C'\fR, \f(CW\*(C`dmacc\*(C'\fR and \f(CW\*(C`dmacchi\*(C'\fR
+instructions are available instead.
+.IP "\fB\-mfix\-sb1\fR" 4
+.IX Item "-mfix-sb1"
+.PD 0
+.IP "\fB\-mno\-fix\-sb1\fR" 4
+.IX Item "-mno-fix-sb1"
+.PD
+Work around certain \s-1SB\-1\s0 \s-1CPU\s0 core errata.
+(This flag currently works around the \s-1SB\-1\s0 revision 2
+\&\*(L"F1\*(R" and \*(L"F2\*(R" floating point errata.)
+.IP "\fB\-mr10k\-cache\-barrier=\fR\fIsetting\fR" 4
+.IX Item "-mr10k-cache-barrier=setting"
+Specify whether \s-1GCC\s0 should insert cache barriers to avoid the
+side-effects of speculation on R10K processors.
+.Sp
+In common with many processors, the R10K tries to predict the outcome
+of a conditional branch and speculatively executes instructions from
+the \*(L"taken\*(R" branch. It later aborts these instructions if the
+predicted outcome was wrong. However, on the R10K, even aborted
+instructions can have side effects.
+.Sp
+This problem only affects kernel stores and, depending on the system,
+kernel loads. As an example, a speculatively-executed store may load
+the target memory into cache and mark the cache line as dirty, even if
+the store itself is later aborted. If a \s-1DMA\s0 operation writes to the
+same area of memory before the \*(L"dirty\*(R" line is flushed, the cached
+data will overwrite the DMA-ed data. See the R10K processor manual
+for a full description, including other potential problems.
+.Sp
+One workaround is to insert cache barrier instructions before every memory
+access that might be speculatively executed and that might have side
+effects even if aborted. \fB\-mr10k\-cache\-barrier=\fR\fIsetting\fR
+controls \s-1GCC\s0's implementation of this workaround. It assumes that
+aborted accesses to any byte in the following regions will not have
+side effects:
+.RS 4
+.IP "1." 4
+the memory occupied by the current function's stack frame;
+.IP "2." 4
+the memory occupied by an incoming stack argument;
+.IP "3." 4
+the memory occupied by an object with a link-time-constant address.
+.RE
+.RS 4
+.Sp
+It is the kernel's responsibility to ensure that speculative
+accesses to these regions are indeed safe.
+.Sp
+If the input program contains a function declaration such as:
+.Sp
+.Vb 1
+\& void foo (void);
+.Ve
+.Sp
+then the implementation of \f(CW\*(C`foo\*(C'\fR must allow \f(CW\*(C`j foo\*(C'\fR and
+\&\f(CW\*(C`jal foo\*(C'\fR to be executed speculatively. \s-1GCC\s0 honors this
+restriction for functions it compiles itself. It expects non-GCC
+functions (such as hand-written assembly code) to do the same.
+.Sp
+The option has three forms:
+.IP "\fB\-mr10k\-cache\-barrier=load\-store\fR" 4
+.IX Item "-mr10k-cache-barrier=load-store"
+Insert a cache barrier before a load or store that might be
+speculatively executed and that might have side effects even
+if aborted.
+.IP "\fB\-mr10k\-cache\-barrier=store\fR" 4
+.IX Item "-mr10k-cache-barrier=store"
+Insert a cache barrier before a store that might be speculatively
+executed and that might have side effects even if aborted.
+.IP "\fB\-mr10k\-cache\-barrier=none\fR" 4
+.IX Item "-mr10k-cache-barrier=none"
+Disable the insertion of cache barriers. This is the default setting.
+.RE
+.RS 4
+.RE
+.IP "\fB\-mflush\-func=\fR\fIfunc\fR" 4
+.IX Item "-mflush-func=func"
+.PD 0
+.IP "\fB\-mno\-flush\-func\fR" 4
+.IX Item "-mno-flush-func"
+.PD
+Specifies the function to call to flush the I and D caches, or to not
+call any such function. If called, the function must take the same
+arguments as the common \f(CW\*(C`_flush_func()\*(C'\fR, that is, the address of the
+memory range for which the cache is being flushed, the size of the
+memory range, and the number 3 (to flush both caches). The default
+depends on the target \s-1GCC\s0 was configured for, but commonly is either
+\&\fB_flush_func\fR or \fB_\|_cpu_flush\fR.
+.IP "\fBmbranch\-cost=\fR\fInum\fR" 4
+.IX Item "mbranch-cost=num"
+Set the cost of branches to roughly \fInum\fR \*(L"simple\*(R" instructions.
+This cost is only a heuristic and is not guaranteed to produce
+consistent results across releases. A zero cost redundantly selects
+the default, which is based on the \fB\-mtune\fR setting.
+.IP "\fB\-mbranch\-likely\fR" 4
+.IX Item "-mbranch-likely"
+.PD 0
+.IP "\fB\-mno\-branch\-likely\fR" 4
+.IX Item "-mno-branch-likely"
+.PD
+Enable or disable use of Branch Likely instructions, regardless of the
+default for the selected architecture. By default, Branch Likely
+instructions may be generated if they are supported by the selected
+architecture. An exception is for the \s-1MIPS32\s0 and \s-1MIPS64\s0 architectures
+and processors which implement those architectures; for those, Branch
+Likely instructions will not be generated by default because the \s-1MIPS32\s0
+and \s-1MIPS64\s0 architectures specifically deprecate their use.
+.IP "\fB\-mfp\-exceptions\fR" 4
+.IX Item "-mfp-exceptions"
+.PD 0
+.IP "\fB\-mno\-fp\-exceptions\fR" 4
+.IX Item "-mno-fp-exceptions"
+.PD
+Specifies whether \s-1FP\s0 exceptions are enabled. This affects how we schedule
+\&\s-1FP\s0 instructions for some processors. The default is that \s-1FP\s0 exceptions are
+enabled.
+.Sp
+For instance, on the \s-1SB\-1\s0, if \s-1FP\s0 exceptions are disabled, and we are emitting
+64\-bit code, then we can use both \s-1FP\s0 pipes. Otherwise, we can only use one
+\&\s-1FP\s0 pipe.
+.IP "\fB\-mvr4130\-align\fR" 4
+.IX Item "-mvr4130-align"
+.PD 0
+.IP "\fB\-mno\-vr4130\-align\fR" 4
+.IX Item "-mno-vr4130-align"
+.PD
+The \s-1VR4130\s0 pipeline is two-way superscalar, but can only issue two
+instructions together if the first one is 8\-byte aligned. When this
+option is enabled, \s-1GCC\s0 will align pairs of instructions that it
+thinks should execute in parallel.
+.Sp
+This option only has an effect when optimizing for the \s-1VR4130\s0.
+It normally makes code faster, but at the expense of making it bigger.
+It is enabled by default at optimization level \fB\-O3\fR.
+.PP
+\fI\s-1MMIX\s0 Options\fR
+.IX Subsection "MMIX Options"
+.PP
+These options are defined for the \s-1MMIX:\s0
+.IP "\fB\-mlibfuncs\fR" 4
+.IX Item "-mlibfuncs"
+.PD 0
+.IP "\fB\-mno\-libfuncs\fR" 4
+.IX Item "-mno-libfuncs"
+.PD
+Specify that intrinsic library functions are being compiled, passing all
+values in registers, no matter the size.
+.IP "\fB\-mepsilon\fR" 4
+.IX Item "-mepsilon"
+.PD 0
+.IP "\fB\-mno\-epsilon\fR" 4
+.IX Item "-mno-epsilon"
+.PD
+Generate floating-point comparison instructions that compare with respect
+to the \f(CW\*(C`rE\*(C'\fR epsilon register.
+.IP "\fB\-mabi=mmixware\fR" 4
+.IX Item "-mabi=mmixware"
+.PD 0
+.IP "\fB\-mabi=gnu\fR" 4
+.IX Item "-mabi=gnu"
+.PD
+Generate code that passes function parameters and return values that (in
+the called function) are seen as registers \f(CW$0\fR and up, as opposed to
+the \s-1GNU\s0 \s-1ABI\s0 which uses global registers \f(CW$231\fR and up.
+.IP "\fB\-mzero\-extend\fR" 4
+.IX Item "-mzero-extend"
+.PD 0
+.IP "\fB\-mno\-zero\-extend\fR" 4
+.IX Item "-mno-zero-extend"
+.PD
+When reading data from memory in sizes shorter than 64 bits, use (do not
+use) zero-extending load instructions by default, rather than
+sign-extending ones.
+.IP "\fB\-mknuthdiv\fR" 4
+.IX Item "-mknuthdiv"
+.PD 0
+.IP "\fB\-mno\-knuthdiv\fR" 4
+.IX Item "-mno-knuthdiv"
+.PD
+Make the result of a division yielding a remainder have the same sign as
+the divisor. With the default, \fB\-mno\-knuthdiv\fR, the sign of the
+remainder follows the sign of the dividend. Both methods are
+arithmetically valid, the latter being almost exclusively used.
+.IP "\fB\-mtoplevel\-symbols\fR" 4
+.IX Item "-mtoplevel-symbols"
+.PD 0
+.IP "\fB\-mno\-toplevel\-symbols\fR" 4
+.IX Item "-mno-toplevel-symbols"
+.PD
+Prepend (do not prepend) a \fB:\fR to all global symbols, so the assembly
+code can be used with the \f(CW\*(C`PREFIX\*(C'\fR assembly directive.
+.IP "\fB\-melf\fR" 4
+.IX Item "-melf"
+Generate an executable in the \s-1ELF\s0 format, rather than the default
+\&\fBmmo\fR format used by the \fBmmix\fR simulator.
+.IP "\fB\-mbranch\-predict\fR" 4
+.IX Item "-mbranch-predict"
+.PD 0
+.IP "\fB\-mno\-branch\-predict\fR" 4
+.IX Item "-mno-branch-predict"
+.PD
+Use (do not use) the probable-branch instructions, when static branch
+prediction indicates a probable branch.
+.IP "\fB\-mbase\-addresses\fR" 4
+.IX Item "-mbase-addresses"
+.PD 0
+.IP "\fB\-mno\-base\-addresses\fR" 4
+.IX Item "-mno-base-addresses"
+.PD
+Generate (do not generate) code that uses \fIbase addresses\fR. Using a
+base address automatically generates a request (handled by the assembler
+and the linker) for a constant to be set up in a global register. The
+register is used for one or more base address requests within the range 0
+to 255 from the value held in the register. The generally leads to short
+and fast code, but the number of different data items that can be
+addressed is limited. This means that a program that uses lots of static
+data may require \fB\-mno\-base\-addresses\fR.
+.IP "\fB\-msingle\-exit\fR" 4
+.IX Item "-msingle-exit"
+.PD 0
+.IP "\fB\-mno\-single\-exit\fR" 4
+.IX Item "-mno-single-exit"
+.PD
+Force (do not force) generated code to have a single exit point in each
+function.
+.PP
+\fI\s-1MN10300\s0 Options\fR
+.IX Subsection "MN10300 Options"
+.PP
+These \fB\-m\fR options are defined for Matsushita \s-1MN10300\s0 architectures:
+.IP "\fB\-mmult\-bug\fR" 4
+.IX Item "-mmult-bug"
+Generate code to avoid bugs in the multiply instructions for the \s-1MN10300\s0
+processors. This is the default.
+.IP "\fB\-mno\-mult\-bug\fR" 4
+.IX Item "-mno-mult-bug"
+Do not generate code to avoid bugs in the multiply instructions for the
+\&\s-1MN10300\s0 processors.
+.IP "\fB\-mam33\fR" 4
+.IX Item "-mam33"
+Generate code which uses features specific to the \s-1AM33\s0 processor.
+.IP "\fB\-mno\-am33\fR" 4
+.IX Item "-mno-am33"
+Do not generate code which uses features specific to the \s-1AM33\s0 processor. This
+is the default.
+.IP "\fB\-mreturn\-pointer\-on\-d0\fR" 4
+.IX Item "-mreturn-pointer-on-d0"
+When generating a function which returns a pointer, return the pointer
+in both \f(CW\*(C`a0\*(C'\fR and \f(CW\*(C`d0\*(C'\fR. Otherwise, the pointer is returned
+only in a0, and attempts to call such functions without a prototype
+would result in errors. Note that this option is on by default; use
+\&\fB\-mno\-return\-pointer\-on\-d0\fR to disable it.
+.IP "\fB\-mno\-crt0\fR" 4
+.IX Item "-mno-crt0"
+Do not link in the C run-time initialization object file.
+.IP "\fB\-mrelax\fR" 4
+.IX Item "-mrelax"
+Indicate to the linker that it should perform a relaxation optimization pass
+to shorten branches, calls and absolute memory addresses. This option only
+has an effect when used on the command line for the final link step.
+.Sp
+This option makes symbolic debugging impossible.
+.PP
+\fI\s-1PDP\-11\s0 Options\fR
+.IX Subsection "PDP-11 Options"
+.PP
+These options are defined for the \s-1PDP\-11:\s0
+.IP "\fB\-mfpu\fR" 4
+.IX Item "-mfpu"
+Use hardware \s-1FPP\s0 floating point. This is the default. (\s-1FIS\s0 floating
+point on the \s-1PDP\-11/40\s0 is not supported.)
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+Do not use hardware floating point.
+.IP "\fB\-mac0\fR" 4
+.IX Item "-mac0"
+Return floating-point results in ac0 (fr0 in Unix assembler syntax).
+.IP "\fB\-mno\-ac0\fR" 4
+.IX Item "-mno-ac0"
+Return floating-point results in memory. This is the default.
+.IP "\fB\-m40\fR" 4
+.IX Item "-m40"
+Generate code for a \s-1PDP\-11/40\s0.
+.IP "\fB\-m45\fR" 4
+.IX Item "-m45"
+Generate code for a \s-1PDP\-11/45\s0. This is the default.
+.IP "\fB\-m10\fR" 4
+.IX Item "-m10"
+Generate code for a \s-1PDP\-11/10\s0.
+.IP "\fB\-mbcopy\-builtin\fR" 4
+.IX Item "-mbcopy-builtin"
+Use inline \f(CW\*(C`movmemhi\*(C'\fR patterns for copying memory. This is the
+default.
+.IP "\fB\-mbcopy\fR" 4
+.IX Item "-mbcopy"
+Do not use inline \f(CW\*(C`movmemhi\*(C'\fR patterns for copying memory.
+.IP "\fB\-mint16\fR" 4
+.IX Item "-mint16"
+.PD 0
+.IP "\fB\-mno\-int32\fR" 4
+.IX Item "-mno-int32"
+.PD
+Use 16\-bit \f(CW\*(C`int\*(C'\fR. This is the default.
+.IP "\fB\-mint32\fR" 4
+.IX Item "-mint32"
+.PD 0
+.IP "\fB\-mno\-int16\fR" 4
+.IX Item "-mno-int16"
+.PD
+Use 32\-bit \f(CW\*(C`int\*(C'\fR.
+.IP "\fB\-mfloat64\fR" 4
+.IX Item "-mfloat64"
+.PD 0
+.IP "\fB\-mno\-float32\fR" 4
+.IX Item "-mno-float32"
+.PD
+Use 64\-bit \f(CW\*(C`float\*(C'\fR. This is the default.
+.IP "\fB\-mfloat32\fR" 4
+.IX Item "-mfloat32"
+.PD 0
+.IP "\fB\-mno\-float64\fR" 4
+.IX Item "-mno-float64"
+.PD
+Use 32\-bit \f(CW\*(C`float\*(C'\fR.
+.IP "\fB\-mabshi\fR" 4
+.IX Item "-mabshi"
+Use \f(CW\*(C`abshi2\*(C'\fR pattern. This is the default.
+.IP "\fB\-mno\-abshi\fR" 4
+.IX Item "-mno-abshi"
+Do not use \f(CW\*(C`abshi2\*(C'\fR pattern.
+.IP "\fB\-mbranch\-expensive\fR" 4
+.IX Item "-mbranch-expensive"
+Pretend that branches are expensive. This is for experimenting with
+code generation only.
+.IP "\fB\-mbranch\-cheap\fR" 4
+.IX Item "-mbranch-cheap"
+Do not pretend that branches are expensive. This is the default.
+.IP "\fB\-msplit\fR" 4
+.IX Item "-msplit"
+Generate code for a system with split I&D.
+.IP "\fB\-mno\-split\fR" 4
+.IX Item "-mno-split"
+Generate code for a system without split I&D. This is the default.
+.IP "\fB\-munix\-asm\fR" 4
+.IX Item "-munix-asm"
+Use Unix assembler syntax. This is the default when configured for
+\&\fBpdp11\-*\-bsd\fR.
+.IP "\fB\-mdec\-asm\fR" 4
+.IX Item "-mdec-asm"
+Use \s-1DEC\s0 assembler syntax. This is the default when configured for any
+\&\s-1PDP\-11\s0 target other than \fBpdp11\-*\-bsd\fR.
+.PP
+\fIpicoChip Options\fR
+.IX Subsection "picoChip Options"
+.PP
+These \fB\-m\fR options are defined for picoChip implementations:
+.IP "\fB\-mae=\fR\fIae_type\fR" 4
+.IX Item "-mae=ae_type"
+Set the instruction set, register set, and instruction scheduling
+parameters for array element type \fIae_type\fR. Supported values
+for \fIae_type\fR are \fB\s-1ANY\s0\fR, \fB\s-1MUL\s0\fR, and \fB\s-1MAC\s0\fR.
+.Sp
+\&\fB\-mae=ANY\fR selects a completely generic \s-1AE\s0 type. Code
+generated with this option will run on any of the other \s-1AE\s0 types. The
+code will not be as efficient as it would be if compiled for a specific
+\&\s-1AE\s0 type, and some types of operation (e.g., multiplication) will not
+work properly on all types of \s-1AE\s0.
+.Sp
+\&\fB\-mae=MUL\fR selects a \s-1MUL\s0 \s-1AE\s0 type. This is the most useful \s-1AE\s0 type
+for compiled code, and is the default.
+.Sp
+\&\fB\-mae=MAC\fR selects a DSP-style \s-1MAC\s0 \s-1AE\s0. Code compiled with this
+option may suffer from poor performance of byte (char) manipulation,
+since the \s-1DSP\s0 \s-1AE\s0 does not provide hardware support for byte load/stores.
+.IP "\fB\-msymbol\-as\-address\fR" 4
+.IX Item "-msymbol-as-address"
+Enable the compiler to directly use a symbol name as an address in a
+load/store instruction, without first loading it into a
+register. Typically, the use of this option will generate larger
+programs, which run faster than when the option isn't used. However, the
+results vary from program to program, so it is left as a user option,
+rather than being permanently enabled.
+.IP "\fB\-mno\-inefficient\-warnings\fR" 4
+.IX Item "-mno-inefficient-warnings"
+Disables warnings about the generation of inefficient code. These
+warnings can be generated, for example, when compiling code which
+performs byte-level memory operations on the \s-1MAC\s0 \s-1AE\s0 type. The \s-1MAC\s0 \s-1AE\s0 has
+no hardware support for byte-level memory operations, so all byte
+load/stores must be synthesized from word load/store operations. This is
+inefficient and a warning will be generated indicating to the programmer
+that they should rewrite the code to avoid byte operations, or to target
+an \s-1AE\s0 type which has the necessary hardware support. This option enables
+the warning to be turned off.
+.PP
+\fIPowerPC Options\fR
+.IX Subsection "PowerPC Options"
+.PP
+These are listed under
+.PP
+\fI\s-1IBM\s0 \s-1RS/6000\s0 and PowerPC Options\fR
+.IX Subsection "IBM RS/6000 and PowerPC Options"
+.PP
+These \fB\-m\fR options are defined for the \s-1IBM\s0 \s-1RS/6000\s0 and PowerPC:
+.IP "\fB\-mpower\fR" 4
+.IX Item "-mpower"
+.PD 0
+.IP "\fB\-mno\-power\fR" 4
+.IX Item "-mno-power"
+.IP "\fB\-mpower2\fR" 4
+.IX Item "-mpower2"
+.IP "\fB\-mno\-power2\fR" 4
+.IX Item "-mno-power2"
+.IP "\fB\-mpowerpc\fR" 4
+.IX Item "-mpowerpc"
+.IP "\fB\-mno\-powerpc\fR" 4
+.IX Item "-mno-powerpc"
+.IP "\fB\-mpowerpc\-gpopt\fR" 4
+.IX Item "-mpowerpc-gpopt"
+.IP "\fB\-mno\-powerpc\-gpopt\fR" 4
+.IX Item "-mno-powerpc-gpopt"
+.IP "\fB\-mpowerpc\-gfxopt\fR" 4
+.IX Item "-mpowerpc-gfxopt"
+.IP "\fB\-mno\-powerpc\-gfxopt\fR" 4
+.IX Item "-mno-powerpc-gfxopt"
+.IP "\fB\-mpowerpc64\fR" 4
+.IX Item "-mpowerpc64"
+.IP "\fB\-mno\-powerpc64\fR" 4
+.IX Item "-mno-powerpc64"
+.IP "\fB\-mmfcrf\fR" 4
+.IX Item "-mmfcrf"
+.IP "\fB\-mno\-mfcrf\fR" 4
+.IX Item "-mno-mfcrf"
+.IP "\fB\-mpopcntb\fR" 4
+.IX Item "-mpopcntb"
+.IP "\fB\-mno\-popcntb\fR" 4
+.IX Item "-mno-popcntb"
+.IP "\fB\-mfprnd\fR" 4
+.IX Item "-mfprnd"
+.IP "\fB\-mno\-fprnd\fR" 4
+.IX Item "-mno-fprnd"
+.IP "\fB\-mcmpb\fR" 4
+.IX Item "-mcmpb"
+.IP "\fB\-mno\-cmpb\fR" 4
+.IX Item "-mno-cmpb"
+.IP "\fB\-mmfpgpr\fR" 4
+.IX Item "-mmfpgpr"
+.IP "\fB\-mno\-mfpgpr\fR" 4
+.IX Item "-mno-mfpgpr"
+.IP "\fB\-mhard\-dfp\fR" 4
+.IX Item "-mhard-dfp"
+.IP "\fB\-mno\-hard\-dfp\fR" 4
+.IX Item "-mno-hard-dfp"
+.PD
+\&\s-1GCC\s0 supports two related instruction set architectures for the
+\&\s-1RS/6000\s0 and PowerPC. The \fI\s-1POWER\s0\fR instruction set are those
+instructions supported by the \fBrios\fR chip set used in the original
+\&\s-1RS/6000\s0 systems and the \fIPowerPC\fR instruction set is the
+architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
+the \s-1IBM\s0 4xx, 6xx, and follow-on microprocessors.
+.Sp
+Neither architecture is a subset of the other. However there is a
+large common subset of instructions supported by both. An \s-1MQ\s0
+register is included in processors supporting the \s-1POWER\s0 architecture.
+.Sp
+You use these options to specify which instructions are available on the
+processor you are using. The default value of these options is
+determined when configuring \s-1GCC\s0. Specifying the
+\&\fB\-mcpu=\fR\fIcpu_type\fR overrides the specification of these
+options. We recommend you use the \fB\-mcpu=\fR\fIcpu_type\fR option
+rather than the options listed above.
+.Sp
+The \fB\-mpower\fR option allows \s-1GCC\s0 to generate instructions that
+are found only in the \s-1POWER\s0 architecture and to use the \s-1MQ\s0 register.
+Specifying \fB\-mpower2\fR implies \fB\-power\fR and also allows \s-1GCC\s0
+to generate instructions that are present in the \s-1POWER2\s0 architecture but
+not the original \s-1POWER\s0 architecture.
+.Sp
+The \fB\-mpowerpc\fR option allows \s-1GCC\s0 to generate instructions that
+are found only in the 32\-bit subset of the PowerPC architecture.
+Specifying \fB\-mpowerpc\-gpopt\fR implies \fB\-mpowerpc\fR and also allows
+\&\s-1GCC\s0 to use the optional PowerPC architecture instructions in the
+General Purpose group, including floating-point square root. Specifying
+\&\fB\-mpowerpc\-gfxopt\fR implies \fB\-mpowerpc\fR and also allows \s-1GCC\s0 to
+use the optional PowerPC architecture instructions in the Graphics
+group, including floating-point select.
+.Sp
+The \fB\-mmfcrf\fR option allows \s-1GCC\s0 to generate the move from
+condition register field instruction implemented on the \s-1POWER4\s0
+processor and other processors that support the PowerPC V2.01
+architecture.
+The \fB\-mpopcntb\fR option allows \s-1GCC\s0 to generate the popcount and
+double precision \s-1FP\s0 reciprocal estimate instruction implemented on the
+\&\s-1POWER5\s0 processor and other processors that support the PowerPC V2.02
+architecture.
+The \fB\-mfprnd\fR option allows \s-1GCC\s0 to generate the \s-1FP\s0 round to
+integer instructions implemented on the \s-1POWER5+\s0 processor and other
+processors that support the PowerPC V2.03 architecture.
+The \fB\-mcmpb\fR option allows \s-1GCC\s0 to generate the compare bytes
+instruction implemented on the \s-1POWER6\s0 processor and other processors
+that support the PowerPC V2.05 architecture.
+The \fB\-mmfpgpr\fR option allows \s-1GCC\s0 to generate the \s-1FP\s0 move to/from
+general purpose register instructions implemented on the \s-1POWER6X\s0
+processor and other processors that support the extended PowerPC V2.05
+architecture.
+The \fB\-mhard\-dfp\fR option allows \s-1GCC\s0 to generate the decimal floating
+point instructions implemented on some \s-1POWER\s0 processors.
+.Sp
+The \fB\-mpowerpc64\fR option allows \s-1GCC\s0 to generate the additional
+64\-bit instructions that are found in the full PowerPC64 architecture
+and to treat GPRs as 64\-bit, doubleword quantities. \s-1GCC\s0 defaults to
+\&\fB\-mno\-powerpc64\fR.
+.Sp
+If you specify both \fB\-mno\-power\fR and \fB\-mno\-powerpc\fR, \s-1GCC\s0
+will use only the instructions in the common subset of both
+architectures plus some special \s-1AIX\s0 common-mode calls, and will not use
+the \s-1MQ\s0 register. Specifying both \fB\-mpower\fR and \fB\-mpowerpc\fR
+permits \s-1GCC\s0 to use any instruction from either architecture and to
+allow use of the \s-1MQ\s0 register; specify this for the Motorola \s-1MPC601\s0.
+.IP "\fB\-mnew\-mnemonics\fR" 4
+.IX Item "-mnew-mnemonics"
+.PD 0
+.IP "\fB\-mold\-mnemonics\fR" 4
+.IX Item "-mold-mnemonics"
+.PD
+Select which mnemonics to use in the generated assembler code. With
+\&\fB\-mnew\-mnemonics\fR, \s-1GCC\s0 uses the assembler mnemonics defined for
+the PowerPC architecture. With \fB\-mold\-mnemonics\fR it uses the
+assembler mnemonics defined for the \s-1POWER\s0 architecture. Instructions
+defined in only one architecture have only one mnemonic; \s-1GCC\s0 uses that
+mnemonic irrespective of which of these options is specified.
+.Sp
+\&\s-1GCC\s0 defaults to the mnemonics appropriate for the architecture in
+use. Specifying \fB\-mcpu=\fR\fIcpu_type\fR sometimes overrides the
+value of these option. Unless you are building a cross-compiler, you
+should normally not specify either \fB\-mnew\-mnemonics\fR or
+\&\fB\-mold\-mnemonics\fR, but should instead accept the default.
+.IP "\fB\-mcpu=\fR\fIcpu_type\fR" 4
+.IX Item "-mcpu=cpu_type"
+Set architecture type, register usage, choice of mnemonics, and
+instruction scheduling parameters for machine type \fIcpu_type\fR.
+Supported values for \fIcpu_type\fR are \fB401\fR, \fB403\fR,
+\&\fB405\fR, \fB405fp\fR, \fB440\fR, \fB440fp\fR, \fB464\fR, \fB464fp\fR,
+\&\fB505\fR, \fB601\fR, \fB602\fR, \fB603\fR, \fB603e\fR, \fB604\fR,
+\&\fB604e\fR, \fB620\fR, \fB630\fR, \fB740\fR, \fB7400\fR,
+\&\fB7450\fR, \fB750\fR, \fB801\fR, \fB821\fR, \fB823\fR,
+\&\fB860\fR, \fB970\fR, \fB8540\fR, \fBe300c2\fR, \fBe300c3\fR,
+\&\fBe500mc\fR, \fBec603e\fR, \fBG3\fR, \fBG4\fR, \fBG5\fR,
+\&\fBpower\fR, \fBpower2\fR, \fBpower3\fR, \fBpower4\fR,
+\&\fBpower5\fR, \fBpower5+\fR, \fBpower6\fR, \fBpower6x\fR, \fBpower7\fR
+\&\fBcommon\fR, \fBpowerpc\fR, \fBpowerpc64\fR, \fBrios\fR,
+\&\fBrios1\fR, \fBrios2\fR, \fBrsc\fR, and \fBrs64\fR.
+.Sp
+\&\fB\-mcpu=common\fR selects a completely generic processor. Code
+generated under this option will run on any \s-1POWER\s0 or PowerPC processor.
+\&\s-1GCC\s0 will use only the instructions in the common subset of both
+architectures, and will not use the \s-1MQ\s0 register. \s-1GCC\s0 assumes a generic
+processor model for scheduling purposes.
+.Sp
+\&\fB\-mcpu=power\fR, \fB\-mcpu=power2\fR, \fB\-mcpu=powerpc\fR, and
+\&\fB\-mcpu=powerpc64\fR specify generic \s-1POWER\s0, \s-1POWER2\s0, pure 32\-bit
+PowerPC (i.e., not \s-1MPC601\s0), and 64\-bit PowerPC architecture machine
+types, with an appropriate, generic processor model assumed for
+scheduling purposes.
+.Sp
+The other options specify a specific processor. Code generated under
+those options will run best on that processor, and may not run at all on
+others.
+.Sp
+The \fB\-mcpu\fR options automatically enable or disable the
+following options:
+.Sp
+\&\fB\-maltivec \-mfprnd \-mhard\-float \-mmfcrf \-mmultiple
+\&\-mnew\-mnemonics \-mpopcntb \-mpower \-mpower2 \-mpowerpc64
+\&\-mpowerpc\-gpopt \-mpowerpc\-gfxopt \-msingle\-float \-mdouble\-float
+\&\-msimple\-fpu \-mstring \-mmulhw \-mdlmzb \-mmfpgpr\fR
+.Sp
+The particular options set for any particular \s-1CPU\s0 will vary between
+compiler versions, depending on what setting seems to produce optimal
+code for that \s-1CPU\s0; it doesn't necessarily reflect the actual hardware's
+capabilities. If you wish to set an individual option to a particular
+value, you may specify it after the \fB\-mcpu\fR option, like
+\&\fB\-mcpu=970 \-mno\-altivec\fR.
+.Sp
+On \s-1AIX\s0, the \fB\-maltivec\fR and \fB\-mpowerpc64\fR options are
+not enabled or disabled by the \fB\-mcpu\fR option at present because
+\&\s-1AIX\s0 does not have full support for these options. You may still
+enable or disable them individually if you're sure it'll work in your
+environment.
+.IP "\fB\-mtune=\fR\fIcpu_type\fR" 4
+.IX Item "-mtune=cpu_type"
+Set the instruction scheduling parameters for machine type
+\&\fIcpu_type\fR, but do not set the architecture type, register usage, or
+choice of mnemonics, as \fB\-mcpu=\fR\fIcpu_type\fR would. The same
+values for \fIcpu_type\fR are used for \fB\-mtune\fR as for
+\&\fB\-mcpu\fR. If both are specified, the code generated will use the
+architecture, registers, and mnemonics set by \fB\-mcpu\fR, but the
+scheduling parameters set by \fB\-mtune\fR.
+.IP "\fB\-mswdiv\fR" 4
+.IX Item "-mswdiv"
+.PD 0
+.IP "\fB\-mno\-swdiv\fR" 4
+.IX Item "-mno-swdiv"
+.PD
+Generate code to compute division as reciprocal estimate and iterative
+refinement, creating opportunities for increased throughput. This
+feature requires: optional PowerPC Graphics instruction set for single
+precision and \s-1FRE\s0 instruction for double precision, assuming divides
+cannot generate user-visible traps, and the domain values not include
+Infinities, denormals or zero denominator.
+.IP "\fB\-maltivec\fR" 4
+.IX Item "-maltivec"
+.PD 0
+.IP "\fB\-mno\-altivec\fR" 4
+.IX Item "-mno-altivec"
+.PD
+Generate code that uses (does not use) AltiVec instructions, and also
+enable the use of built-in functions that allow more direct access to
+the AltiVec instruction set. You may also need to set
+\&\fB\-mabi=altivec\fR to adjust the current \s-1ABI\s0 with AltiVec \s-1ABI\s0
+enhancements.
+.IP "\fB\-mvrsave\fR" 4
+.IX Item "-mvrsave"
+.PD 0
+.IP "\fB\-mno\-vrsave\fR" 4
+.IX Item "-mno-vrsave"
+.PD
+Generate \s-1VRSAVE\s0 instructions when generating AltiVec code.
+.IP "\fB\-mgen\-cell\-microcode\fR" 4
+.IX Item "-mgen-cell-microcode"
+Generate Cell microcode instructions
+.IP "\fB\-mwarn\-cell\-microcode\fR" 4
+.IX Item "-mwarn-cell-microcode"
+Warning when a Cell microcode instruction is going to emitted. An example
+of a Cell microcode instruction is a variable shift.
+.IP "\fB\-msecure\-plt\fR" 4
+.IX Item "-msecure-plt"
+Generate code that allows ld and ld.so to build executables and shared
+libraries with non-exec .plt and .got sections. This is a PowerPC
+32\-bit \s-1SYSV\s0 \s-1ABI\s0 option.
+.IP "\fB\-mbss\-plt\fR" 4
+.IX Item "-mbss-plt"
+Generate code that uses a \s-1BSS\s0 .plt section that ld.so fills in, and
+requires .plt and .got sections that are both writable and executable.
+This is a PowerPC 32\-bit \s-1SYSV\s0 \s-1ABI\s0 option.
+.IP "\fB\-misel\fR" 4
+.IX Item "-misel"
+.PD 0
+.IP "\fB\-mno\-isel\fR" 4
+.IX Item "-mno-isel"
+.PD
+This switch enables or disables the generation of \s-1ISEL\s0 instructions.
+.IP "\fB\-misel=\fR\fIyes/no\fR" 4
+.IX Item "-misel=yes/no"
+This switch has been deprecated. Use \fB\-misel\fR and
+\&\fB\-mno\-isel\fR instead.
+.IP "\fB\-mspe\fR" 4
+.IX Item "-mspe"
+.PD 0
+.IP "\fB\-mno\-spe\fR" 4
+.IX Item "-mno-spe"
+.PD
+This switch enables or disables the generation of \s-1SPE\s0 simd
+instructions.
+.IP "\fB\-mpaired\fR" 4
+.IX Item "-mpaired"
+.PD 0
+.IP "\fB\-mno\-paired\fR" 4
+.IX Item "-mno-paired"
+.PD
+This switch enables or disables the generation of \s-1PAIRED\s0 simd
+instructions.
+.IP "\fB\-mspe=\fR\fIyes/no\fR" 4
+.IX Item "-mspe=yes/no"
+This option has been deprecated. Use \fB\-mspe\fR and
+\&\fB\-mno\-spe\fR instead.
+.IP "\fB\-mfloat\-gprs=\fR\fIyes/single/double/no\fR" 4
+.IX Item "-mfloat-gprs=yes/single/double/no"
+.PD 0
+.IP "\fB\-mfloat\-gprs\fR" 4
+.IX Item "-mfloat-gprs"
+.PD
+This switch enables or disables the generation of floating point
+operations on the general purpose registers for architectures that
+support it.
+.Sp
+The argument \fIyes\fR or \fIsingle\fR enables the use of
+single-precision floating point operations.
+.Sp
+The argument \fIdouble\fR enables the use of single and
+double-precision floating point operations.
+.Sp
+The argument \fIno\fR disables floating point operations on the
+general purpose registers.
+.Sp
+This option is currently only available on the MPC854x.
+.IP "\fB\-m32\fR" 4
+.IX Item "-m32"
+.PD 0
+.IP "\fB\-m64\fR" 4
+.IX Item "-m64"
+.PD
+Generate code for 32\-bit or 64\-bit environments of Darwin and \s-1SVR4\s0
+targets (including GNU/Linux). The 32\-bit environment sets int, long
+and pointer to 32 bits and generates code that runs on any PowerPC
+variant. The 64\-bit environment sets int to 32 bits and long and
+pointer to 64 bits, and generates code for PowerPC64, as for
+\&\fB\-mpowerpc64\fR.
+.IP "\fB\-mfull\-toc\fR" 4
+.IX Item "-mfull-toc"
+.PD 0
+.IP "\fB\-mno\-fp\-in\-toc\fR" 4
+.IX Item "-mno-fp-in-toc"
+.IP "\fB\-mno\-sum\-in\-toc\fR" 4
+.IX Item "-mno-sum-in-toc"
+.IP "\fB\-mminimal\-toc\fR" 4
+.IX Item "-mminimal-toc"
+.PD
+Modify generation of the \s-1TOC\s0 (Table Of Contents), which is created for
+every executable file. The \fB\-mfull\-toc\fR option is selected by
+default. In that case, \s-1GCC\s0 will allocate at least one \s-1TOC\s0 entry for
+each unique non-automatic variable reference in your program. \s-1GCC\s0
+will also place floating-point constants in the \s-1TOC\s0. However, only
+16,384 entries are available in the \s-1TOC\s0.
+.Sp
+If you receive a linker error message that saying you have overflowed
+the available \s-1TOC\s0 space, you can reduce the amount of \s-1TOC\s0 space used
+with the \fB\-mno\-fp\-in\-toc\fR and \fB\-mno\-sum\-in\-toc\fR options.
+\&\fB\-mno\-fp\-in\-toc\fR prevents \s-1GCC\s0 from putting floating-point
+constants in the \s-1TOC\s0 and \fB\-mno\-sum\-in\-toc\fR forces \s-1GCC\s0 to
+generate code to calculate the sum of an address and a constant at
+run-time instead of putting that sum into the \s-1TOC\s0. You may specify one
+or both of these options. Each causes \s-1GCC\s0 to produce very slightly
+slower and larger code at the expense of conserving \s-1TOC\s0 space.
+.Sp
+If you still run out of space in the \s-1TOC\s0 even when you specify both of
+these options, specify \fB\-mminimal\-toc\fR instead. This option causes
+\&\s-1GCC\s0 to make only one \s-1TOC\s0 entry for every file. When you specify this
+option, \s-1GCC\s0 will produce code that is slower and larger but which
+uses extremely little \s-1TOC\s0 space. You may wish to use this option
+only on files that contain less frequently executed code.
+.IP "\fB\-maix64\fR" 4
+.IX Item "-maix64"
+.PD 0
+.IP "\fB\-maix32\fR" 4
+.IX Item "-maix32"
+.PD
+Enable 64\-bit \s-1AIX\s0 \s-1ABI\s0 and calling convention: 64\-bit pointers, 64\-bit
+\&\f(CW\*(C`long\*(C'\fR type, and the infrastructure needed to support them.
+Specifying \fB\-maix64\fR implies \fB\-mpowerpc64\fR and
+\&\fB\-mpowerpc\fR, while \fB\-maix32\fR disables the 64\-bit \s-1ABI\s0 and
+implies \fB\-mno\-powerpc64\fR. \s-1GCC\s0 defaults to \fB\-maix32\fR.
+.IP "\fB\-mxl\-compat\fR" 4
+.IX Item "-mxl-compat"
+.PD 0
+.IP "\fB\-mno\-xl\-compat\fR" 4
+.IX Item "-mno-xl-compat"
+.PD
+Produce code that conforms more closely to \s-1IBM\s0 \s-1XL\s0 compiler semantics
+when using AIX-compatible \s-1ABI\s0. Pass floating-point arguments to
+prototyped functions beyond the register save area (\s-1RSA\s0) on the stack
+in addition to argument FPRs. Do not assume that most significant
+double in 128\-bit long double value is properly rounded when comparing
+values and converting to double. Use \s-1XL\s0 symbol names for long double
+support routines.
+.Sp
+The \s-1AIX\s0 calling convention was extended but not initially documented to
+handle an obscure K&R C case of calling a function that takes the
+address of its arguments with fewer arguments than declared. \s-1IBM\s0 \s-1XL\s0
+compilers access floating point arguments which do not fit in the
+\&\s-1RSA\s0 from the stack when a subroutine is compiled without
+optimization. Because always storing floating-point arguments on the
+stack is inefficient and rarely needed, this option is not enabled by
+default and only is necessary when calling subroutines compiled by \s-1IBM\s0
+\&\s-1XL\s0 compilers without optimization.
+.IP "\fB\-mpe\fR" 4
+.IX Item "-mpe"
+Support \fI\s-1IBM\s0 \s-1RS/6000\s0 \s-1SP\s0\fR \fIParallel Environment\fR (\s-1PE\s0). Link an
+application written to use message passing with special startup code to
+enable the application to run. The system must have \s-1PE\s0 installed in the
+standard location (\fI/usr/lpp/ppe.poe/\fR), or the \fIspecs\fR file
+must be overridden with the \fB\-specs=\fR option to specify the
+appropriate directory location. The Parallel Environment does not
+support threads, so the \fB\-mpe\fR option and the \fB\-pthread\fR
+option are incompatible.
+.IP "\fB\-malign\-natural\fR" 4
+.IX Item "-malign-natural"
+.PD 0
+.IP "\fB\-malign\-power\fR" 4
+.IX Item "-malign-power"
+.PD
+On \s-1AIX\s0, 32\-bit Darwin, and 64\-bit PowerPC GNU/Linux, the option
+\&\fB\-malign\-natural\fR overrides the ABI-defined alignment of larger
+types, such as floating-point doubles, on their natural size-based boundary.
+The option \fB\-malign\-power\fR instructs \s-1GCC\s0 to follow the ABI-specified
+alignment rules. \s-1GCC\s0 defaults to the standard alignment defined in the \s-1ABI\s0.
+.Sp
+On 64\-bit Darwin, natural alignment is the default, and \fB\-malign\-power\fR
+is not supported.
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+.PD 0
+.IP "\fB\-mhard\-float\fR" 4
+.IX Item "-mhard-float"
+.PD
+Generate code that does not use (uses) the floating-point register set.
+Software floating point emulation is provided if you use the
+\&\fB\-msoft\-float\fR option, and pass the option to \s-1GCC\s0 when linking.
+.IP "\fB\-msingle\-float\fR" 4
+.IX Item "-msingle-float"
+.PD 0
+.IP "\fB\-mdouble\-float\fR" 4
+.IX Item "-mdouble-float"
+.PD
+Generate code for single or double-precision floating point operations.
+\&\fB\-mdouble\-float\fR implies \fB\-msingle\-float\fR.
+.IP "\fB\-msimple\-fpu\fR" 4
+.IX Item "-msimple-fpu"
+Do not generate sqrt and div instructions for hardware floating point unit.
+.IP "\fB\-mfpu\fR" 4
+.IX Item "-mfpu"
+Specify type of floating point unit. Valid values are \fIsp_lite\fR
+(equivalent to \-msingle\-float \-msimple\-fpu), \fIdp_lite\fR (equivalent
+to \-mdouble\-float \-msimple\-fpu), \fIsp_full\fR (equivalent to \-msingle\-float),
+and \fIdp_full\fR (equivalent to \-mdouble\-float).
+.IP "\fB\-mxilinx\-fpu\fR" 4
+.IX Item "-mxilinx-fpu"
+Perform optimizations for floating point unit on Xilinx \s-1PPC\s0 405/440.
+.IP "\fB\-mmultiple\fR" 4
+.IX Item "-mmultiple"
+.PD 0
+.IP "\fB\-mno\-multiple\fR" 4
+.IX Item "-mno-multiple"
+.PD
+Generate code that uses (does not use) the load multiple word
+instructions and the store multiple word instructions. These
+instructions are generated by default on \s-1POWER\s0 systems, and not
+generated on PowerPC systems. Do not use \fB\-mmultiple\fR on little
+endian PowerPC systems, since those instructions do not work when the
+processor is in little endian mode. The exceptions are \s-1PPC740\s0 and
+\&\s-1PPC750\s0 which permit the instructions usage in little endian mode.
+.IP "\fB\-mstring\fR" 4
+.IX Item "-mstring"
+.PD 0
+.IP "\fB\-mno\-string\fR" 4
+.IX Item "-mno-string"
+.PD
+Generate code that uses (does not use) the load string instructions
+and the store string word instructions to save multiple registers and
+do small block moves. These instructions are generated by default on
+\&\s-1POWER\s0 systems, and not generated on PowerPC systems. Do not use
+\&\fB\-mstring\fR on little endian PowerPC systems, since those
+instructions do not work when the processor is in little endian mode.
+The exceptions are \s-1PPC740\s0 and \s-1PPC750\s0 which permit the instructions
+usage in little endian mode.
+.IP "\fB\-mupdate\fR" 4
+.IX Item "-mupdate"
+.PD 0
+.IP "\fB\-mno\-update\fR" 4
+.IX Item "-mno-update"
+.PD
+Generate code that uses (does not use) the load or store instructions
+that update the base register to the address of the calculated memory
+location. These instructions are generated by default. If you use
+\&\fB\-mno\-update\fR, there is a small window between the time that the
+stack pointer is updated and the address of the previous frame is
+stored, which means code that walks the stack frame across interrupts or
+signals may get corrupted data.
+.IP "\fB\-mavoid\-indexed\-addresses\fR" 4
+.IX Item "-mavoid-indexed-addresses"
+.PD 0
+.IP "\fB\-mno\-avoid\-indexed\-addresses\fR" 4
+.IX Item "-mno-avoid-indexed-addresses"
+.PD
+Generate code that tries to avoid (not avoid) the use of indexed load
+or store instructions. These instructions can incur a performance
+penalty on Power6 processors in certain situations, such as when
+stepping through large arrays that cross a 16M boundary. This option
+is enabled by default when targetting Power6 and disabled otherwise.
+.IP "\fB\-mfused\-madd\fR" 4
+.IX Item "-mfused-madd"
+.PD 0
+.IP "\fB\-mno\-fused\-madd\fR" 4
+.IX Item "-mno-fused-madd"
+.PD
+Generate code that uses (does not use) the floating point multiply and
+accumulate instructions. These instructions are generated by default if
+hardware floating is used.
+.IP "\fB\-mmulhw\fR" 4
+.IX Item "-mmulhw"
+.PD 0
+.IP "\fB\-mno\-mulhw\fR" 4
+.IX Item "-mno-mulhw"
+.PD
+Generate code that uses (does not use) the half-word multiply and
+multiply-accumulate instructions on the \s-1IBM\s0 405, 440 and 464 processors.
+These instructions are generated by default when targetting those
+processors.
+.IP "\fB\-mdlmzb\fR" 4
+.IX Item "-mdlmzb"
+.PD 0
+.IP "\fB\-mno\-dlmzb\fR" 4
+.IX Item "-mno-dlmzb"
+.PD
+Generate code that uses (does not use) the string-search \fBdlmzb\fR
+instruction on the \s-1IBM\s0 405, 440 and 464 processors. This instruction is
+generated by default when targetting those processors.
+.IP "\fB\-mno\-bit\-align\fR" 4
+.IX Item "-mno-bit-align"
+.PD 0
+.IP "\fB\-mbit\-align\fR" 4
+.IX Item "-mbit-align"
+.PD
+On System V.4 and embedded PowerPC systems do not (do) force structures
+and unions that contain bit-fields to be aligned to the base type of the
+bit-field.
+.Sp
+For example, by default a structure containing nothing but 8
+\&\f(CW\*(C`unsigned\*(C'\fR bit-fields of length 1 would be aligned to a 4 byte
+boundary and have a size of 4 bytes. By using \fB\-mno\-bit\-align\fR,
+the structure would be aligned to a 1 byte boundary and be one byte in
+size.
+.IP "\fB\-mno\-strict\-align\fR" 4
+.IX Item "-mno-strict-align"
+.PD 0
+.IP "\fB\-mstrict\-align\fR" 4
+.IX Item "-mstrict-align"
+.PD
+On System V.4 and embedded PowerPC systems do not (do) assume that
+unaligned memory references will be handled by the system.
+.IP "\fB\-mrelocatable\fR" 4
+.IX Item "-mrelocatable"
+.PD 0
+.IP "\fB\-mno\-relocatable\fR" 4
+.IX Item "-mno-relocatable"
+.PD
+On embedded PowerPC systems generate code that allows (does not allow)
+the program to be relocated to a different address at runtime. If you
+use \fB\-mrelocatable\fR on any module, all objects linked together must
+be compiled with \fB\-mrelocatable\fR or \fB\-mrelocatable\-lib\fR.
+.IP "\fB\-mrelocatable\-lib\fR" 4
+.IX Item "-mrelocatable-lib"
+.PD 0
+.IP "\fB\-mno\-relocatable\-lib\fR" 4
+.IX Item "-mno-relocatable-lib"
+.PD
+On embedded PowerPC systems generate code that allows (does not allow)
+the program to be relocated to a different address at runtime. Modules
+compiled with \fB\-mrelocatable\-lib\fR can be linked with either modules
+compiled without \fB\-mrelocatable\fR and \fB\-mrelocatable\-lib\fR or
+with modules compiled with the \fB\-mrelocatable\fR options.
+.IP "\fB\-mno\-toc\fR" 4
+.IX Item "-mno-toc"
+.PD 0
+.IP "\fB\-mtoc\fR" 4
+.IX Item "-mtoc"
+.PD
+On System V.4 and embedded PowerPC systems do not (do) assume that
+register 2 contains a pointer to a global area pointing to the addresses
+used in the program.
+.IP "\fB\-mlittle\fR" 4
+.IX Item "-mlittle"
+.PD 0
+.IP "\fB\-mlittle\-endian\fR" 4
+.IX Item "-mlittle-endian"
+.PD
+On System V.4 and embedded PowerPC systems compile code for the
+processor in little endian mode. The \fB\-mlittle\-endian\fR option is
+the same as \fB\-mlittle\fR.
+.IP "\fB\-mbig\fR" 4
+.IX Item "-mbig"
+.PD 0
+.IP "\fB\-mbig\-endian\fR" 4
+.IX Item "-mbig-endian"
+.PD
+On System V.4 and embedded PowerPC systems compile code for the
+processor in big endian mode. The \fB\-mbig\-endian\fR option is
+the same as \fB\-mbig\fR.
+.IP "\fB\-mdynamic\-no\-pic\fR" 4
+.IX Item "-mdynamic-no-pic"
+On Darwin and Mac \s-1OS\s0 X systems, compile code so that it is not
+relocatable, but that its external references are relocatable. The
+resulting code is suitable for applications, but not shared
+libraries.
+.IP "\fB\-mprioritize\-restricted\-insns=\fR\fIpriority\fR" 4
+.IX Item "-mprioritize-restricted-insns=priority"
+This option controls the priority that is assigned to
+dispatch-slot restricted instructions during the second scheduling
+pass. The argument \fIpriority\fR takes the value \fI0/1/2\fR to assign
+\&\fIno/highest/second\-highest\fR priority to dispatch slot restricted
+instructions.
+.IP "\fB\-msched\-costly\-dep=\fR\fIdependence_type\fR" 4
+.IX Item "-msched-costly-dep=dependence_type"
+This option controls which dependences are considered costly
+by the target during instruction scheduling. The argument
+\&\fIdependence_type\fR takes one of the following values:
+\&\fIno\fR: no dependence is costly,
+\&\fIall\fR: all dependences are costly,
+\&\fItrue_store_to_load\fR: a true dependence from store to load is costly,
+\&\fIstore_to_load\fR: any dependence from store to load is costly,
+\&\fInumber\fR: any dependence which latency >= \fInumber\fR is costly.
+.IP "\fB\-minsert\-sched\-nops=\fR\fIscheme\fR" 4
+.IX Item "-minsert-sched-nops=scheme"
+This option controls which nop insertion scheme will be used during
+the second scheduling pass. The argument \fIscheme\fR takes one of the
+following values:
+\&\fIno\fR: Don't insert nops.
+\&\fIpad\fR: Pad with nops any dispatch group which has vacant issue slots,
+according to the scheduler's grouping.
+\&\fIregroup_exact\fR: Insert nops to force costly dependent insns into
+separate groups. Insert exactly as many nops as needed to force an insn
+to a new group, according to the estimated processor grouping.
+\&\fInumber\fR: Insert nops to force costly dependent insns into
+separate groups. Insert \fInumber\fR nops to force an insn to a new group.
+.IP "\fB\-mcall\-sysv\fR" 4
+.IX Item "-mcall-sysv"
+On System V.4 and embedded PowerPC systems compile code using calling
+conventions that adheres to the March 1995 draft of the System V
+Application Binary Interface, PowerPC processor supplement. This is the
+default unless you configured \s-1GCC\s0 using \fBpowerpc\-*\-eabiaix\fR.
+.IP "\fB\-mcall\-sysv\-eabi\fR" 4
+.IX Item "-mcall-sysv-eabi"
+Specify both \fB\-mcall\-sysv\fR and \fB\-meabi\fR options.
+.IP "\fB\-mcall\-sysv\-noeabi\fR" 4
+.IX Item "-mcall-sysv-noeabi"
+Specify both \fB\-mcall\-sysv\fR and \fB\-mno\-eabi\fR options.
+.IP "\fB\-mcall\-solaris\fR" 4
+.IX Item "-mcall-solaris"
+On System V.4 and embedded PowerPC systems compile code for the Solaris
+operating system.
+.IP "\fB\-mcall\-linux\fR" 4
+.IX Item "-mcall-linux"
+On System V.4 and embedded PowerPC systems compile code for the
+Linux-based \s-1GNU\s0 system.
+.IP "\fB\-mcall\-gnu\fR" 4
+.IX Item "-mcall-gnu"
+On System V.4 and embedded PowerPC systems compile code for the
+Hurd-based \s-1GNU\s0 system.
+.IP "\fB\-mcall\-netbsd\fR" 4
+.IX Item "-mcall-netbsd"
+On System V.4 and embedded PowerPC systems compile code for the
+NetBSD operating system.
+.IP "\fB\-maix\-struct\-return\fR" 4
+.IX Item "-maix-struct-return"
+Return all structures in memory (as specified by the \s-1AIX\s0 \s-1ABI\s0).
+.IP "\fB\-msvr4\-struct\-return\fR" 4
+.IX Item "-msvr4-struct-return"
+Return structures smaller than 8 bytes in registers (as specified by the
+\&\s-1SVR4\s0 \s-1ABI\s0).
+.IP "\fB\-mabi=\fR\fIabi-type\fR" 4
+.IX Item "-mabi=abi-type"
+Extend the current \s-1ABI\s0 with a particular extension, or remove such extension.
+Valid values are \fIaltivec\fR, \fIno-altivec\fR, \fIspe\fR,
+\&\fIno-spe\fR, \fIibmlongdouble\fR, \fIieeelongdouble\fR.
+.IP "\fB\-mabi=spe\fR" 4
+.IX Item "-mabi=spe"
+Extend the current \s-1ABI\s0 with \s-1SPE\s0 \s-1ABI\s0 extensions. This does not change
+the default \s-1ABI\s0, instead it adds the \s-1SPE\s0 \s-1ABI\s0 extensions to the current
+\&\s-1ABI\s0.
+.IP "\fB\-mabi=no\-spe\fR" 4
+.IX Item "-mabi=no-spe"
+Disable Booke \s-1SPE\s0 \s-1ABI\s0 extensions for the current \s-1ABI\s0.
+.IP "\fB\-mabi=ibmlongdouble\fR" 4
+.IX Item "-mabi=ibmlongdouble"
+Change the current \s-1ABI\s0 to use \s-1IBM\s0 extended precision long double.
+This is a PowerPC 32\-bit \s-1SYSV\s0 \s-1ABI\s0 option.
+.IP "\fB\-mabi=ieeelongdouble\fR" 4
+.IX Item "-mabi=ieeelongdouble"
+Change the current \s-1ABI\s0 to use \s-1IEEE\s0 extended precision long double.
+This is a PowerPC 32\-bit Linux \s-1ABI\s0 option.
+.IP "\fB\-mprototype\fR" 4
+.IX Item "-mprototype"
+.PD 0
+.IP "\fB\-mno\-prototype\fR" 4
+.IX Item "-mno-prototype"
+.PD
+On System V.4 and embedded PowerPC systems assume that all calls to
+variable argument functions are properly prototyped. Otherwise, the
+compiler must insert an instruction before every non prototyped call to
+set or clear bit 6 of the condition code register (\fI\s-1CR\s0\fR) to
+indicate whether floating point values were passed in the floating point
+registers in case the function takes a variable arguments. With
+\&\fB\-mprototype\fR, only calls to prototyped variable argument functions
+will set or clear the bit.
+.IP "\fB\-msim\fR" 4
+.IX Item "-msim"
+On embedded PowerPC systems, assume that the startup module is called
+\&\fIsim\-crt0.o\fR and that the standard C libraries are \fIlibsim.a\fR and
+\&\fIlibc.a\fR. This is the default for \fBpowerpc\-*\-eabisim\fR
+configurations.
+.IP "\fB\-mmvme\fR" 4
+.IX Item "-mmvme"
+On embedded PowerPC systems, assume that the startup module is called
+\&\fIcrt0.o\fR and the standard C libraries are \fIlibmvme.a\fR and
+\&\fIlibc.a\fR.
+.IP "\fB\-mads\fR" 4
+.IX Item "-mads"
+On embedded PowerPC systems, assume that the startup module is called
+\&\fIcrt0.o\fR and the standard C libraries are \fIlibads.a\fR and
+\&\fIlibc.a\fR.
+.IP "\fB\-myellowknife\fR" 4
+.IX Item "-myellowknife"
+On embedded PowerPC systems, assume that the startup module is called
+\&\fIcrt0.o\fR and the standard C libraries are \fIlibyk.a\fR and
+\&\fIlibc.a\fR.
+.IP "\fB\-mvxworks\fR" 4
+.IX Item "-mvxworks"
+On System V.4 and embedded PowerPC systems, specify that you are
+compiling for a VxWorks system.
+.IP "\fB\-memb\fR" 4
+.IX Item "-memb"
+On embedded PowerPC systems, set the \fI\s-1PPC_EMB\s0\fR bit in the \s-1ELF\s0 flags
+header to indicate that \fBeabi\fR extended relocations are used.
+.IP "\fB\-meabi\fR" 4
+.IX Item "-meabi"
+.PD 0
+.IP "\fB\-mno\-eabi\fR" 4
+.IX Item "-mno-eabi"
+.PD
+On System V.4 and embedded PowerPC systems do (do not) adhere to the
+Embedded Applications Binary Interface (eabi) which is a set of
+modifications to the System V.4 specifications. Selecting \fB\-meabi\fR
+means that the stack is aligned to an 8 byte boundary, a function
+\&\f(CW\*(C`_\|_eabi\*(C'\fR is called to from \f(CW\*(C`main\*(C'\fR to set up the eabi
+environment, and the \fB\-msdata\fR option can use both \f(CW\*(C`r2\*(C'\fR and
+\&\f(CW\*(C`r13\*(C'\fR to point to two separate small data areas. Selecting
+\&\fB\-mno\-eabi\fR means that the stack is aligned to a 16 byte boundary,
+do not call an initialization function from \f(CW\*(C`main\*(C'\fR, and the
+\&\fB\-msdata\fR option will only use \f(CW\*(C`r13\*(C'\fR to point to a single
+small data area. The \fB\-meabi\fR option is on by default if you
+configured \s-1GCC\s0 using one of the \fBpowerpc*\-*\-eabi*\fR options.
+.IP "\fB\-msdata=eabi\fR" 4
+.IX Item "-msdata=eabi"
+On System V.4 and embedded PowerPC systems, put small initialized
+\&\f(CW\*(C`const\*(C'\fR global and static data in the \fB.sdata2\fR section, which
+is pointed to by register \f(CW\*(C`r2\*(C'\fR. Put small initialized
+non\-\f(CW\*(C`const\*(C'\fR global and static data in the \fB.sdata\fR section,
+which is pointed to by register \f(CW\*(C`r13\*(C'\fR. Put small uninitialized
+global and static data in the \fB.sbss\fR section, which is adjacent to
+the \fB.sdata\fR section. The \fB\-msdata=eabi\fR option is
+incompatible with the \fB\-mrelocatable\fR option. The
+\&\fB\-msdata=eabi\fR option also sets the \fB\-memb\fR option.
+.IP "\fB\-msdata=sysv\fR" 4
+.IX Item "-msdata=sysv"
+On System V.4 and embedded PowerPC systems, put small global and static
+data in the \fB.sdata\fR section, which is pointed to by register
+\&\f(CW\*(C`r13\*(C'\fR. Put small uninitialized global and static data in the
+\&\fB.sbss\fR section, which is adjacent to the \fB.sdata\fR section.
+The \fB\-msdata=sysv\fR option is incompatible with the
+\&\fB\-mrelocatable\fR option.
+.IP "\fB\-msdata=default\fR" 4
+.IX Item "-msdata=default"
+.PD 0
+.IP "\fB\-msdata\fR" 4
+.IX Item "-msdata"
+.PD
+On System V.4 and embedded PowerPC systems, if \fB\-meabi\fR is used,
+compile code the same as \fB\-msdata=eabi\fR, otherwise compile code the
+same as \fB\-msdata=sysv\fR.
+.IP "\fB\-msdata=data\fR" 4
+.IX Item "-msdata=data"
+On System V.4 and embedded PowerPC systems, put small global
+data in the \fB.sdata\fR section. Put small uninitialized global
+data in the \fB.sbss\fR section. Do not use register \f(CW\*(C`r13\*(C'\fR
+to address small data however. This is the default behavior unless
+other \fB\-msdata\fR options are used.
+.IP "\fB\-msdata=none\fR" 4
+.IX Item "-msdata=none"
+.PD 0
+.IP "\fB\-mno\-sdata\fR" 4
+.IX Item "-mno-sdata"
+.PD
+On embedded PowerPC systems, put all initialized global and static data
+in the \fB.data\fR section, and all uninitialized data in the
+\&\fB.bss\fR section.
+.IP "\fB\-G\fR \fInum\fR" 4
+.IX Item "-G num"
+On embedded PowerPC systems, put global and static items less than or
+equal to \fInum\fR bytes into the small data or bss sections instead of
+the normal data or bss section. By default, \fInum\fR is 8. The
+\&\fB\-G\fR \fInum\fR switch is also passed to the linker.
+All modules should be compiled with the same \fB\-G\fR \fInum\fR value.
+.IP "\fB\-mregnames\fR" 4
+.IX Item "-mregnames"
+.PD 0
+.IP "\fB\-mno\-regnames\fR" 4
+.IX Item "-mno-regnames"
+.PD
+On System V.4 and embedded PowerPC systems do (do not) emit register
+names in the assembly language output using symbolic forms.
+.IP "\fB\-mlongcall\fR" 4
+.IX Item "-mlongcall"
+.PD 0
+.IP "\fB\-mno\-longcall\fR" 4
+.IX Item "-mno-longcall"
+.PD
+By default assume that all calls are far away so that a longer more
+expensive calling sequence is required. This is required for calls
+further than 32 megabytes (33,554,432 bytes) from the current location.
+A short call will be generated if the compiler knows
+the call cannot be that far away. This setting can be overridden by
+the \f(CW\*(C`shortcall\*(C'\fR function attribute, or by \f(CW\*(C`#pragma
+longcall(0)\*(C'\fR.
+.Sp
+Some linkers are capable of detecting out-of-range calls and generating
+glue code on the fly. On these systems, long calls are unnecessary and
+generate slower code. As of this writing, the \s-1AIX\s0 linker can do this,
+as can the \s-1GNU\s0 linker for PowerPC/64. It is planned to add this feature
+to the \s-1GNU\s0 linker for 32\-bit PowerPC systems as well.
+.Sp
+On Darwin/PPC systems, \f(CW\*(C`#pragma longcall\*(C'\fR will generate \*(L"jbsr
+callee, L42\*(R", plus a \*(L"branch island\*(R" (glue code). The two target
+addresses represent the callee and the \*(L"branch island\*(R". The
+Darwin/PPC linker will prefer the first address and generate a \*(L"bl
+callee\*(R" if the \s-1PPC\s0 \*(L"bl\*(R" instruction will reach the callee directly;
+otherwise, the linker will generate \*(L"bl L42\*(R" to call the \*(L"branch
+island\*(R". The \*(L"branch island\*(R" is appended to the body of the
+calling function; it computes the full 32\-bit address of the callee
+and jumps to it.
+.Sp
+On Mach-O (Darwin) systems, this option directs the compiler emit to
+the glue for every direct call, and the Darwin linker decides whether
+to use or discard it.
+.Sp
+In the future, we may cause \s-1GCC\s0 to ignore all longcall specifications
+when the linker is known to generate glue.
+.IP "\fB\-pthread\fR" 4
+.IX Item "-pthread"
+Adds support for multithreading with the \fIpthreads\fR library.
+This option sets flags for both the preprocessor and linker.
+.PP
+\fIS/390 and zSeries Options\fR
+.IX Subsection "S/390 and zSeries Options"
+.PP
+These are the \fB\-m\fR options defined for the S/390 and zSeries architecture.
+.IP "\fB\-mhard\-float\fR" 4
+.IX Item "-mhard-float"
+.PD 0
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+.PD
+Use (do not use) the hardware floating-point instructions and registers
+for floating-point operations. When \fB\-msoft\-float\fR is specified,
+functions in \fIlibgcc.a\fR will be used to perform floating-point
+operations. When \fB\-mhard\-float\fR is specified, the compiler
+generates \s-1IEEE\s0 floating-point instructions. This is the default.
+.IP "\fB\-mhard\-dfp\fR" 4
+.IX Item "-mhard-dfp"
+.PD 0
+.IP "\fB\-mno\-hard\-dfp\fR" 4
+.IX Item "-mno-hard-dfp"
+.PD
+Use (do not use) the hardware decimal-floating-point instructions for
+decimal-floating-point operations. When \fB\-mno\-hard\-dfp\fR is
+specified, functions in \fIlibgcc.a\fR will be used to perform
+decimal-floating-point operations. When \fB\-mhard\-dfp\fR is
+specified, the compiler generates decimal-floating-point hardware
+instructions. This is the default for \fB\-march=z9\-ec\fR or higher.
+.IP "\fB\-mlong\-double\-64\fR" 4
+.IX Item "-mlong-double-64"
+.PD 0
+.IP "\fB\-mlong\-double\-128\fR" 4
+.IX Item "-mlong-double-128"
+.PD
+These switches control the size of \f(CW\*(C`long double\*(C'\fR type. A size
+of 64bit makes the \f(CW\*(C`long double\*(C'\fR type equivalent to the \f(CW\*(C`double\*(C'\fR
+type. This is the default.
+.IP "\fB\-mbackchain\fR" 4
+.IX Item "-mbackchain"
+.PD 0
+.IP "\fB\-mno\-backchain\fR" 4
+.IX Item "-mno-backchain"
+.PD
+Store (do not store) the address of the caller's frame as backchain pointer
+into the callee's stack frame.
+A backchain may be needed to allow debugging using tools that do not understand
+\&\s-1DWARF\-2\s0 call frame information.
+When \fB\-mno\-packed\-stack\fR is in effect, the backchain pointer is stored
+at the bottom of the stack frame; when \fB\-mpacked\-stack\fR is in effect,
+the backchain is placed into the topmost word of the 96/160 byte register
+save area.
+.Sp
+In general, code compiled with \fB\-mbackchain\fR is call-compatible with
+code compiled with \fB\-mmo\-backchain\fR; however, use of the backchain
+for debugging purposes usually requires that the whole binary is built with
+\&\fB\-mbackchain\fR. Note that the combination of \fB\-mbackchain\fR,
+\&\fB\-mpacked\-stack\fR and \fB\-mhard\-float\fR is not supported. In order
+to build a linux kernel use \fB\-msoft\-float\fR.
+.Sp
+The default is to not maintain the backchain.
+.IP "\fB\-mpacked\-stack\fR" 4
+.IX Item "-mpacked-stack"
+.PD 0
+.IP "\fB\-mno\-packed\-stack\fR" 4
+.IX Item "-mno-packed-stack"
+.PD
+Use (do not use) the packed stack layout. When \fB\-mno\-packed\-stack\fR is
+specified, the compiler uses the all fields of the 96/160 byte register save
+area only for their default purpose; unused fields still take up stack space.
+When \fB\-mpacked\-stack\fR is specified, register save slots are densely
+packed at the top of the register save area; unused space is reused for other
+purposes, allowing for more efficient use of the available stack space.
+However, when \fB\-mbackchain\fR is also in effect, the topmost word of
+the save area is always used to store the backchain, and the return address
+register is always saved two words below the backchain.
+.Sp
+As long as the stack frame backchain is not used, code generated with
+\&\fB\-mpacked\-stack\fR is call-compatible with code generated with
+\&\fB\-mno\-packed\-stack\fR. Note that some non-FSF releases of \s-1GCC\s0 2.95 for
+S/390 or zSeries generated code that uses the stack frame backchain at run
+time, not just for debugging purposes. Such code is not call-compatible
+with code compiled with \fB\-mpacked\-stack\fR. Also, note that the
+combination of \fB\-mbackchain\fR,
+\&\fB\-mpacked\-stack\fR and \fB\-mhard\-float\fR is not supported. In order
+to build a linux kernel use \fB\-msoft\-float\fR.
+.Sp
+The default is to not use the packed stack layout.
+.IP "\fB\-msmall\-exec\fR" 4
+.IX Item "-msmall-exec"
+.PD 0
+.IP "\fB\-mno\-small\-exec\fR" 4
+.IX Item "-mno-small-exec"
+.PD
+Generate (or do not generate) code using the \f(CW\*(C`bras\*(C'\fR instruction
+to do subroutine calls.
+This only works reliably if the total executable size does not
+exceed 64k. The default is to use the \f(CW\*(C`basr\*(C'\fR instruction instead,
+which does not have this limitation.
+.IP "\fB\-m64\fR" 4
+.IX Item "-m64"
+.PD 0
+.IP "\fB\-m31\fR" 4
+.IX Item "-m31"
+.PD
+When \fB\-m31\fR is specified, generate code compliant to the
+GNU/Linux for S/390 \s-1ABI\s0. When \fB\-m64\fR is specified, generate
+code compliant to the GNU/Linux for zSeries \s-1ABI\s0. This allows \s-1GCC\s0 in
+particular to generate 64\-bit instructions. For the \fBs390\fR
+targets, the default is \fB\-m31\fR, while the \fBs390x\fR
+targets default to \fB\-m64\fR.
+.IP "\fB\-mzarch\fR" 4
+.IX Item "-mzarch"
+.PD 0
+.IP "\fB\-mesa\fR" 4
+.IX Item "-mesa"
+.PD
+When \fB\-mzarch\fR is specified, generate code using the
+instructions available on z/Architecture.
+When \fB\-mesa\fR is specified, generate code using the
+instructions available on \s-1ESA/390\s0. Note that \fB\-mesa\fR is
+not possible with \fB\-m64\fR.
+When generating code compliant to the GNU/Linux for S/390 \s-1ABI\s0,
+the default is \fB\-mesa\fR. When generating code compliant
+to the GNU/Linux for zSeries \s-1ABI\s0, the default is \fB\-mzarch\fR.
+.IP "\fB\-mmvcle\fR" 4
+.IX Item "-mmvcle"
+.PD 0
+.IP "\fB\-mno\-mvcle\fR" 4
+.IX Item "-mno-mvcle"
+.PD
+Generate (or do not generate) code using the \f(CW\*(C`mvcle\*(C'\fR instruction
+to perform block moves. When \fB\-mno\-mvcle\fR is specified,
+use a \f(CW\*(C`mvc\*(C'\fR loop instead. This is the default unless optimizing for
+size.
+.IP "\fB\-mdebug\fR" 4
+.IX Item "-mdebug"
+.PD 0
+.IP "\fB\-mno\-debug\fR" 4
+.IX Item "-mno-debug"
+.PD
+Print (or do not print) additional debug information when compiling.
+The default is to not print debug information.
+.IP "\fB\-march=\fR\fIcpu-type\fR" 4
+.IX Item "-march=cpu-type"
+Generate code that will run on \fIcpu-type\fR, which is the name of a system
+representing a certain processor type. Possible values for
+\&\fIcpu-type\fR are \fBg5\fR, \fBg6\fR, \fBz900\fR, \fBz990\fR,
+\&\fBz9\-109\fR, \fBz9\-ec\fR and \fBz10\fR.
+When generating code using the instructions available on z/Architecture,
+the default is \fB\-march=z900\fR. Otherwise, the default is
+\&\fB\-march=g5\fR.
+.IP "\fB\-mtune=\fR\fIcpu-type\fR" 4
+.IX Item "-mtune=cpu-type"
+Tune to \fIcpu-type\fR everything applicable about the generated code,
+except for the \s-1ABI\s0 and the set of available instructions.
+The list of \fIcpu-type\fR values is the same as for \fB\-march\fR.
+The default is the value used for \fB\-march\fR.
+.IP "\fB\-mtpf\-trace\fR" 4
+.IX Item "-mtpf-trace"
+.PD 0
+.IP "\fB\-mno\-tpf\-trace\fR" 4
+.IX Item "-mno-tpf-trace"
+.PD
+Generate code that adds (does not add) in \s-1TPF\s0 \s-1OS\s0 specific branches to trace
+routines in the operating system. This option is off by default, even
+when compiling for the \s-1TPF\s0 \s-1OS\s0.
+.IP "\fB\-mfused\-madd\fR" 4
+.IX Item "-mfused-madd"
+.PD 0
+.IP "\fB\-mno\-fused\-madd\fR" 4
+.IX Item "-mno-fused-madd"
+.PD
+Generate code that uses (does not use) the floating point multiply and
+accumulate instructions. These instructions are generated by default if
+hardware floating point is used.
+.IP "\fB\-mwarn\-framesize=\fR\fIframesize\fR" 4
+.IX Item "-mwarn-framesize=framesize"
+Emit a warning if the current function exceeds the given frame size. Because
+this is a compile time check it doesn't need to be a real problem when the program
+runs. It is intended to identify functions which most probably cause
+a stack overflow. It is useful to be used in an environment with limited stack
+size e.g. the linux kernel.
+.IP "\fB\-mwarn\-dynamicstack\fR" 4
+.IX Item "-mwarn-dynamicstack"
+Emit a warning if the function calls alloca or uses dynamically
+sized arrays. This is generally a bad idea with a limited stack size.
+.IP "\fB\-mstack\-guard=\fR\fIstack-guard\fR" 4
+.IX Item "-mstack-guard=stack-guard"
+.PD 0
+.IP "\fB\-mstack\-size=\fR\fIstack-size\fR" 4
+.IX Item "-mstack-size=stack-size"
+.PD
+If these options are provided the s390 back end emits additional instructions in
+the function prologue which trigger a trap if the stack size is \fIstack-guard\fR
+bytes above the \fIstack-size\fR (remember that the stack on s390 grows downward).
+If the \fIstack-guard\fR option is omitted the smallest power of 2 larger than
+the frame size of the compiled function is chosen.
+These options are intended to be used to help debugging stack overflow problems.
+The additionally emitted code causes only little overhead and hence can also be
+used in production like systems without greater performance degradation. The given
+values have to be exact powers of 2 and \fIstack-size\fR has to be greater than
+\&\fIstack-guard\fR without exceeding 64k.
+In order to be efficient the extra code makes the assumption that the stack starts
+at an address aligned to the value given by \fIstack-size\fR.
+The \fIstack-guard\fR option can only be used in conjunction with \fIstack-size\fR.
+.PP
+\fIScore Options\fR
+.IX Subsection "Score Options"
+.PP
+These options are defined for Score implementations:
+.IP "\fB\-meb\fR" 4
+.IX Item "-meb"
+Compile code for big endian mode. This is the default.
+.IP "\fB\-mel\fR" 4
+.IX Item "-mel"
+Compile code for little endian mode.
+.IP "\fB\-mnhwloop\fR" 4
+.IX Item "-mnhwloop"
+Disable generate bcnz instruction.
+.IP "\fB\-muls\fR" 4
+.IX Item "-muls"
+Enable generate unaligned load and store instruction.
+.IP "\fB\-mmac\fR" 4
+.IX Item "-mmac"
+Enable the use of multiply-accumulate instructions. Disabled by default.
+.IP "\fB\-mscore5\fR" 4
+.IX Item "-mscore5"
+Specify the \s-1SCORE5\s0 as the target architecture.
+.IP "\fB\-mscore5u\fR" 4
+.IX Item "-mscore5u"
+Specify the \s-1SCORE5U\s0 of the target architecture.
+.IP "\fB\-mscore7\fR" 4
+.IX Item "-mscore7"
+Specify the \s-1SCORE7\s0 as the target architecture. This is the default.
+.IP "\fB\-mscore7d\fR" 4
+.IX Item "-mscore7d"
+Specify the \s-1SCORE7D\s0 as the target architecture.
+.PP
+\fI\s-1SH\s0 Options\fR
+.IX Subsection "SH Options"
+.PP
+These \fB\-m\fR options are defined for the \s-1SH\s0 implementations:
+.IP "\fB\-m1\fR" 4
+.IX Item "-m1"
+Generate code for the \s-1SH1\s0.
+.IP "\fB\-m2\fR" 4
+.IX Item "-m2"
+Generate code for the \s-1SH2\s0.
+.IP "\fB\-m2e\fR" 4
+.IX Item "-m2e"
+Generate code for the SH2e.
+.IP "\fB\-m3\fR" 4
+.IX Item "-m3"
+Generate code for the \s-1SH3\s0.
+.IP "\fB\-m3e\fR" 4
+.IX Item "-m3e"
+Generate code for the SH3e.
+.IP "\fB\-m4\-nofpu\fR" 4
+.IX Item "-m4-nofpu"
+Generate code for the \s-1SH4\s0 without a floating-point unit.
+.IP "\fB\-m4\-single\-only\fR" 4
+.IX Item "-m4-single-only"
+Generate code for the \s-1SH4\s0 with a floating-point unit that only
+supports single-precision arithmetic.
+.IP "\fB\-m4\-single\fR" 4
+.IX Item "-m4-single"
+Generate code for the \s-1SH4\s0 assuming the floating-point unit is in
+single-precision mode by default.
+.IP "\fB\-m4\fR" 4
+.IX Item "-m4"
+Generate code for the \s-1SH4\s0.
+.IP "\fB\-m4a\-nofpu\fR" 4
+.IX Item "-m4a-nofpu"
+Generate code for the SH4al\-dsp, or for a SH4a in such a way that the
+floating-point unit is not used.
+.IP "\fB\-m4a\-single\-only\fR" 4
+.IX Item "-m4a-single-only"
+Generate code for the SH4a, in such a way that no double-precision
+floating point operations are used.
+.IP "\fB\-m4a\-single\fR" 4
+.IX Item "-m4a-single"
+Generate code for the SH4a assuming the floating-point unit is in
+single-precision mode by default.
+.IP "\fB\-m4a\fR" 4
+.IX Item "-m4a"
+Generate code for the SH4a.
+.IP "\fB\-m4al\fR" 4
+.IX Item "-m4al"
+Same as \fB\-m4a\-nofpu\fR, except that it implicitly passes
+\&\fB\-dsp\fR to the assembler. \s-1GCC\s0 doesn't generate any \s-1DSP\s0
+instructions at the moment.
+.IP "\fB\-mb\fR" 4
+.IX Item "-mb"
+Compile code for the processor in big endian mode.
+.IP "\fB\-ml\fR" 4
+.IX Item "-ml"
+Compile code for the processor in little endian mode.
+.IP "\fB\-mdalign\fR" 4
+.IX Item "-mdalign"
+Align doubles at 64\-bit boundaries. Note that this changes the calling
+conventions, and thus some functions from the standard C library will
+not work unless you recompile it first with \fB\-mdalign\fR.
+.IP "\fB\-mrelax\fR" 4
+.IX Item "-mrelax"
+Shorten some address references at link time, when possible; uses the
+linker option \fB\-relax\fR.
+.IP "\fB\-mbigtable\fR" 4
+.IX Item "-mbigtable"
+Use 32\-bit offsets in \f(CW\*(C`switch\*(C'\fR tables. The default is to use
+16\-bit offsets.
+.IP "\fB\-mbitops\fR" 4
+.IX Item "-mbitops"
+Enable the use of bit manipulation instructions on \s-1SH2A\s0.
+.IP "\fB\-mfmovd\fR" 4
+.IX Item "-mfmovd"
+Enable the use of the instruction \f(CW\*(C`fmovd\*(C'\fR.
+.IP "\fB\-mhitachi\fR" 4
+.IX Item "-mhitachi"
+Comply with the calling conventions defined by Renesas.
+.IP "\fB\-mrenesas\fR" 4
+.IX Item "-mrenesas"
+Comply with the calling conventions defined by Renesas.
+.IP "\fB\-mno\-renesas\fR" 4
+.IX Item "-mno-renesas"
+Comply with the calling conventions defined for \s-1GCC\s0 before the Renesas
+conventions were available. This option is the default for all
+targets of the \s-1SH\s0 toolchain except for \fBsh-symbianelf\fR.
+.IP "\fB\-mnomacsave\fR" 4
+.IX Item "-mnomacsave"
+Mark the \f(CW\*(C`MAC\*(C'\fR register as call-clobbered, even if
+\&\fB\-mhitachi\fR is given.
+.IP "\fB\-mieee\fR" 4
+.IX Item "-mieee"
+Increase IEEE-compliance of floating-point code.
+At the moment, this is equivalent to \fB\-fno\-finite\-math\-only\fR.
+When generating 16 bit \s-1SH\s0 opcodes, getting IEEE-conforming results for
+comparisons of NANs / infinities incurs extra overhead in every
+floating point comparison, therefore the default is set to
+\&\fB\-ffinite\-math\-only\fR.
+.IP "\fB\-minline\-ic_invalidate\fR" 4
+.IX Item "-minline-ic_invalidate"
+Inline code to invalidate instruction cache entries after setting up
+nested function trampolines.
+This option has no effect if \-musermode is in effect and the selected
+code generation option (e.g. \-m4) does not allow the use of the icbi
+instruction.
+If the selected code generation option does not allow the use of the icbi
+instruction, and \-musermode is not in effect, the inlined code will
+manipulate the instruction cache address array directly with an associative
+write. This not only requires privileged mode, but it will also
+fail if the cache line had been mapped via the \s-1TLB\s0 and has become unmapped.
+.IP "\fB\-misize\fR" 4
+.IX Item "-misize"
+Dump instruction size and location in the assembly code.
+.IP "\fB\-mpadstruct\fR" 4
+.IX Item "-mpadstruct"
+This option is deprecated. It pads structures to multiple of 4 bytes,
+which is incompatible with the \s-1SH\s0 \s-1ABI\s0.
+.IP "\fB\-mspace\fR" 4
+.IX Item "-mspace"
+Optimize for space instead of speed. Implied by \fB\-Os\fR.
+.IP "\fB\-mprefergot\fR" 4
+.IX Item "-mprefergot"
+When generating position-independent code, emit function calls using
+the Global Offset Table instead of the Procedure Linkage Table.
+.IP "\fB\-musermode\fR" 4
+.IX Item "-musermode"
+Don't generate privileged mode only code; implies \-mno\-inline\-ic_invalidate
+if the inlined code would not work in user mode.
+This is the default when the target is \f(CW\*(C`sh\-*\-linux*\*(C'\fR.
+.IP "\fB\-multcost=\fR\fInumber\fR" 4
+.IX Item "-multcost=number"
+Set the cost to assume for a multiply insn.
+.IP "\fB\-mdiv=\fR\fIstrategy\fR" 4
+.IX Item "-mdiv=strategy"
+Set the division strategy to use for SHmedia code. \fIstrategy\fR must be
+one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
+inv:call2, inv:fp .
+\&\*(L"fp\*(R" performs the operation in floating point. This has a very high latency,
+but needs only a few instructions, so it might be a good choice if
+your code has enough easily exploitable \s-1ILP\s0 to allow the compiler to
+schedule the floating point instructions together with other instructions.
+Division by zero causes a floating point exception.
+\&\*(L"inv\*(R" uses integer operations to calculate the inverse of the divisor,
+and then multiplies the dividend with the inverse. This strategy allows
+cse and hoisting of the inverse calculation. Division by zero calculates
+an unspecified result, but does not trap.
+\&\*(L"inv:minlat\*(R" is a variant of \*(L"inv\*(R" where if no cse / hoisting opportunities
+have been found, or if the entire operation has been hoisted to the same
+place, the last stages of the inverse calculation are intertwined with the
+final multiply to reduce the overall latency, at the expense of using a few
+more instructions, and thus offering fewer scheduling opportunities with
+other code.
+\&\*(L"call\*(R" calls a library function that usually implements the inv:minlat
+strategy.
+This gives high code density for m5\-*media\-nofpu compilations.
+\&\*(L"call2\*(R" uses a different entry point of the same library function, where it
+assumes that a pointer to a lookup table has already been set up, which
+exposes the pointer load to cse / code hoisting optimizations.
+\&\*(L"inv:call\*(R", \*(L"inv:call2\*(R" and \*(L"inv:fp\*(R" all use the \*(L"inv\*(R" algorithm for initial
+code generation, but if the code stays unoptimized, revert to the \*(L"call\*(R",
+\&\*(L"call2\*(R", or \*(L"fp\*(R" strategies, respectively. Note that the
+potentially-trapping side effect of division by zero is carried by a
+separate instruction, so it is possible that all the integer instructions
+are hoisted out, but the marker for the side effect stays where it is.
+A recombination to fp operations or a call is not possible in that case.
+\&\*(L"inv20u\*(R" and \*(L"inv20l\*(R" are variants of the \*(L"inv:minlat\*(R" strategy. In the case
+that the inverse calculation was nor separated from the multiply, they speed
+up division where the dividend fits into 20 bits (plus sign where applicable),
+by inserting a test to skip a number of operations in this case; this test
+slows down the case of larger dividends. inv20u assumes the case of a such
+a small dividend to be unlikely, and inv20l assumes it to be likely.
+.IP "\fB\-mdivsi3_libfunc=\fR\fIname\fR" 4
+.IX Item "-mdivsi3_libfunc=name"
+Set the name of the library function used for 32 bit signed division to
+\&\fIname\fR. This only affect the name used in the call and inv:call
+division strategies, and the compiler will still expect the same
+sets of input/output/clobbered registers as if this option was not present.
+.IP "\fB\-mfixed\-range=\fR\fIregister-range\fR" 4
+.IX Item "-mfixed-range=register-range"
+Generate code treating the given register range as fixed registers.
+A fixed register is one that the register allocator can not use. This is
+useful when compiling kernel code. A register range is specified as
+two registers separated by a dash. Multiple register ranges can be
+specified separated by a comma.
+.IP "\fB\-madjust\-unroll\fR" 4
+.IX Item "-madjust-unroll"
+Throttle unrolling to avoid thrashing target registers.
+This option only has an effect if the gcc code base supports the
+\&\s-1TARGET_ADJUST_UNROLL_MAX\s0 target hook.
+.IP "\fB\-mindexed\-addressing\fR" 4
+.IX Item "-mindexed-addressing"
+Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
+This is only safe if the hardware and/or \s-1OS\s0 implement 32 bit wrap-around
+semantics for the indexed addressing mode. The architecture allows the
+implementation of processors with 64 bit \s-1MMU\s0, which the \s-1OS\s0 could use to
+get 32 bit addressing, but since no current hardware implementation supports
+this or any other way to make the indexed addressing mode safe to use in
+the 32 bit \s-1ABI\s0, the default is \-mno\-indexed\-addressing.
+.IP "\fB\-mgettrcost=\fR\fInumber\fR" 4
+.IX Item "-mgettrcost=number"
+Set the cost assumed for the gettr instruction to \fInumber\fR.
+The default is 2 if \fB\-mpt\-fixed\fR is in effect, 100 otherwise.
+.IP "\fB\-mpt\-fixed\fR" 4
+.IX Item "-mpt-fixed"
+Assume pt* instructions won't trap. This will generally generate better
+scheduled code, but is unsafe on current hardware. The current architecture
+definition says that ptabs and ptrel trap when the target anded with 3 is 3.
+This has the unintentional effect of making it unsafe to schedule ptabs /
+ptrel before a branch, or hoist it out of a loop. For example,
+_\|_do_global_ctors, a part of libgcc that runs constructors at program
+startup, calls functions in a list which is delimited by \-1. With the
+\&\-mpt\-fixed option, the ptabs will be done before testing against \-1.
+That means that all the constructors will be run a bit quicker, but when
+the loop comes to the end of the list, the program crashes because ptabs
+loads \-1 into a target register. Since this option is unsafe for any
+hardware implementing the current architecture specification, the default
+is \-mno\-pt\-fixed. Unless the user specifies a specific cost with
+\&\fB\-mgettrcost\fR, \-mno\-pt\-fixed also implies \fB\-mgettrcost=100\fR;
+this deters register allocation using target registers for storing
+ordinary integers.
+.IP "\fB\-minvalid\-symbols\fR" 4
+.IX Item "-minvalid-symbols"
+Assume symbols might be invalid. Ordinary function symbols generated by
+the compiler will always be valid to load with movi/shori/ptabs or
+movi/shori/ptrel, but with assembler and/or linker tricks it is possible
+to generate symbols that will cause ptabs / ptrel to trap.
+This option is only meaningful when \fB\-mno\-pt\-fixed\fR is in effect.
+It will then prevent cross-basic-block cse, hoisting and most scheduling
+of symbol loads. The default is \fB\-mno\-invalid\-symbols\fR.
+.PP
+\fI\s-1SPARC\s0 Options\fR
+.IX Subsection "SPARC Options"
+.PP
+These \fB\-m\fR options are supported on the \s-1SPARC:\s0
+.IP "\fB\-mno\-app\-regs\fR" 4
+.IX Item "-mno-app-regs"
+.PD 0
+.IP "\fB\-mapp\-regs\fR" 4
+.IX Item "-mapp-regs"
+.PD
+Specify \fB\-mapp\-regs\fR to generate output using the global registers
+2 through 4, which the \s-1SPARC\s0 \s-1SVR4\s0 \s-1ABI\s0 reserves for applications. This
+is the default.
+.Sp
+To be fully \s-1SVR4\s0 \s-1ABI\s0 compliant at the cost of some performance loss,
+specify \fB\-mno\-app\-regs\fR. You should compile libraries and system
+software with this option.
+.IP "\fB\-mfpu\fR" 4
+.IX Item "-mfpu"
+.PD 0
+.IP "\fB\-mhard\-float\fR" 4
+.IX Item "-mhard-float"
+.PD
+Generate output containing floating point instructions. This is the
+default.
+.IP "\fB\-mno\-fpu\fR" 4
+.IX Item "-mno-fpu"
+.PD 0
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+.PD
+Generate output containing library calls for floating point.
+\&\fBWarning:\fR the requisite libraries are not available for all \s-1SPARC\s0
+targets. Normally the facilities of the machine's usual C compiler are
+used, but this cannot be done directly in cross-compilation. You must make
+your own arrangements to provide suitable library functions for
+cross-compilation. The embedded targets \fBsparc\-*\-aout\fR and
+\&\fBsparclite\-*\-*\fR do provide software floating point support.
+.Sp
+\&\fB\-msoft\-float\fR changes the calling convention in the output file;
+therefore, it is only useful if you compile \fIall\fR of a program with
+this option. In particular, you need to compile \fIlibgcc.a\fR, the
+library that comes with \s-1GCC\s0, with \fB\-msoft\-float\fR in order for
+this to work.
+.IP "\fB\-mhard\-quad\-float\fR" 4
+.IX Item "-mhard-quad-float"
+Generate output containing quad-word (long double) floating point
+instructions.
+.IP "\fB\-msoft\-quad\-float\fR" 4
+.IX Item "-msoft-quad-float"
+Generate output containing library calls for quad-word (long double)
+floating point instructions. The functions called are those specified
+in the \s-1SPARC\s0 \s-1ABI\s0. This is the default.
+.Sp
+As of this writing, there are no \s-1SPARC\s0 implementations that have hardware
+support for the quad-word floating point instructions. They all invoke
+a trap handler for one of these instructions, and then the trap handler
+emulates the effect of the instruction. Because of the trap handler overhead,
+this is much slower than calling the \s-1ABI\s0 library routines. Thus the
+\&\fB\-msoft\-quad\-float\fR option is the default.
+.IP "\fB\-mno\-unaligned\-doubles\fR" 4
+.IX Item "-mno-unaligned-doubles"
+.PD 0
+.IP "\fB\-munaligned\-doubles\fR" 4
+.IX Item "-munaligned-doubles"
+.PD
+Assume that doubles have 8 byte alignment. This is the default.
+.Sp
+With \fB\-munaligned\-doubles\fR, \s-1GCC\s0 assumes that doubles have 8 byte
+alignment only if they are contained in another type, or if they have an
+absolute address. Otherwise, it assumes they have 4 byte alignment.
+Specifying this option avoids some rare compatibility problems with code
+generated by other compilers. It is not the default because it results
+in a performance loss, especially for floating point code.
+.IP "\fB\-mno\-faster\-structs\fR" 4
+.IX Item "-mno-faster-structs"
+.PD 0
+.IP "\fB\-mfaster\-structs\fR" 4
+.IX Item "-mfaster-structs"
+.PD
+With \fB\-mfaster\-structs\fR, the compiler assumes that structures
+should have 8 byte alignment. This enables the use of pairs of
+\&\f(CW\*(C`ldd\*(C'\fR and \f(CW\*(C`std\*(C'\fR instructions for copies in structure
+assignment, in place of twice as many \f(CW\*(C`ld\*(C'\fR and \f(CW\*(C`st\*(C'\fR pairs.
+However, the use of this changed alignment directly violates the \s-1SPARC\s0
+\&\s-1ABI\s0. Thus, it's intended only for use on targets where the developer
+acknowledges that their resulting code will not be directly in line with
+the rules of the \s-1ABI\s0.
+.IP "\fB\-mimpure\-text\fR" 4
+.IX Item "-mimpure-text"
+\&\fB\-mimpure\-text\fR, used in addition to \fB\-shared\fR, tells
+the compiler to not pass \fB\-z text\fR to the linker when linking a
+shared object. Using this option, you can link position-dependent
+code into a shared object.
+.Sp
+\&\fB\-mimpure\-text\fR suppresses the \*(L"relocations remain against
+allocatable but non-writable sections\*(R" linker error message.
+However, the necessary relocations will trigger copy-on-write, and the
+shared object is not actually shared across processes. Instead of
+using \fB\-mimpure\-text\fR, you should compile all source code with
+\&\fB\-fpic\fR or \fB\-fPIC\fR.
+.Sp
+This option is only available on SunOS and Solaris.
+.IP "\fB\-mcpu=\fR\fIcpu_type\fR" 4
+.IX Item "-mcpu=cpu_type"
+Set the instruction set, register set, and instruction scheduling parameters
+for machine type \fIcpu_type\fR. Supported values for \fIcpu_type\fR are
+\&\fBv7\fR, \fBcypress\fR, \fBv8\fR, \fBsupersparc\fR, \fBsparclite\fR,
+\&\fBf930\fR, \fBf934\fR, \fBhypersparc\fR, \fBsparclite86x\fR,
+\&\fBsparclet\fR, \fBtsc701\fR, \fBv9\fR, \fBultrasparc\fR,
+\&\fBultrasparc3\fR, \fBniagara\fR and \fBniagara2\fR.
+.Sp
+Default instruction scheduling parameters are used for values that select
+an architecture and not an implementation. These are \fBv7\fR, \fBv8\fR,
+\&\fBsparclite\fR, \fBsparclet\fR, \fBv9\fR.
+.Sp
+Here is a list of each supported architecture and their supported
+implementations.
+.Sp
+.Vb 5
+\& v7: cypress
+\& v8: supersparc, hypersparc
+\& sparclite: f930, f934, sparclite86x
+\& sparclet: tsc701
+\& v9: ultrasparc, ultrasparc3, niagara, niagara2
+.Ve
+.Sp
+By default (unless configured otherwise), \s-1GCC\s0 generates code for the V7
+variant of the \s-1SPARC\s0 architecture. With \fB\-mcpu=cypress\fR, the compiler
+additionally optimizes it for the Cypress \s-1CY7C602\s0 chip, as used in the
+SPARCStation/SPARCServer 3xx series. This is also appropriate for the older
+SPARCStation 1, 2, \s-1IPX\s0 etc.
+.Sp
+With \fB\-mcpu=v8\fR, \s-1GCC\s0 generates code for the V8 variant of the \s-1SPARC\s0
+architecture. The only difference from V7 code is that the compiler emits
+the integer multiply and integer divide instructions which exist in \s-1SPARC\-V8\s0
+but not in \s-1SPARC\-V7\s0. With \fB\-mcpu=supersparc\fR, the compiler additionally
+optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
+2000 series.
+.Sp
+With \fB\-mcpu=sparclite\fR, \s-1GCC\s0 generates code for the SPARClite variant of
+the \s-1SPARC\s0 architecture. This adds the integer multiply, integer divide step
+and scan (\f(CW\*(C`ffs\*(C'\fR) instructions which exist in SPARClite but not in \s-1SPARC\-V7\s0.
+With \fB\-mcpu=f930\fR, the compiler additionally optimizes it for the
+Fujitsu \s-1MB86930\s0 chip, which is the original SPARClite, with no \s-1FPU\s0. With
+\&\fB\-mcpu=f934\fR, the compiler additionally optimizes it for the Fujitsu
+\&\s-1MB86934\s0 chip, which is the more recent SPARClite with \s-1FPU\s0.
+.Sp
+With \fB\-mcpu=sparclet\fR, \s-1GCC\s0 generates code for the SPARClet variant of
+the \s-1SPARC\s0 architecture. This adds the integer multiply, multiply/accumulate,
+integer divide step and scan (\f(CW\*(C`ffs\*(C'\fR) instructions which exist in SPARClet
+but not in \s-1SPARC\-V7\s0. With \fB\-mcpu=tsc701\fR, the compiler additionally
+optimizes it for the \s-1TEMIC\s0 SPARClet chip.
+.Sp
+With \fB\-mcpu=v9\fR, \s-1GCC\s0 generates code for the V9 variant of the \s-1SPARC\s0
+architecture. This adds 64\-bit integer and floating-point move instructions,
+3 additional floating-point condition code registers and conditional move
+instructions. With \fB\-mcpu=ultrasparc\fR, the compiler additionally
+optimizes it for the Sun UltraSPARC I/II/IIi chips. With
+\&\fB\-mcpu=ultrasparc3\fR, the compiler additionally optimizes it for the
+Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips. With
+\&\fB\-mcpu=niagara\fR, the compiler additionally optimizes it for
+Sun UltraSPARC T1 chips. With \fB\-mcpu=niagara2\fR, the compiler
+additionally optimizes it for Sun UltraSPARC T2 chips.
+.IP "\fB\-mtune=\fR\fIcpu_type\fR" 4
+.IX Item "-mtune=cpu_type"
+Set the instruction scheduling parameters for machine type
+\&\fIcpu_type\fR, but do not set the instruction set or register set that the
+option \fB\-mcpu=\fR\fIcpu_type\fR would.
+.Sp
+The same values for \fB\-mcpu=\fR\fIcpu_type\fR can be used for
+\&\fB\-mtune=\fR\fIcpu_type\fR, but the only useful values are those
+that select a particular cpu implementation. Those are \fBcypress\fR,
+\&\fBsupersparc\fR, \fBhypersparc\fR, \fBf930\fR, \fBf934\fR,
+\&\fBsparclite86x\fR, \fBtsc701\fR, \fBultrasparc\fR,
+\&\fBultrasparc3\fR, \fBniagara\fR, and \fBniagara2\fR.
+.IP "\fB\-mv8plus\fR" 4
+.IX Item "-mv8plus"
+.PD 0
+.IP "\fB\-mno\-v8plus\fR" 4
+.IX Item "-mno-v8plus"
+.PD
+With \fB\-mv8plus\fR, \s-1GCC\s0 generates code for the \s-1SPARC\-V8+\s0 \s-1ABI\s0. The
+difference from the V8 \s-1ABI\s0 is that the global and out registers are
+considered 64\-bit wide. This is enabled by default on Solaris in 32\-bit
+mode for all \s-1SPARC\-V9\s0 processors.
+.IP "\fB\-mvis\fR" 4
+.IX Item "-mvis"
+.PD 0
+.IP "\fB\-mno\-vis\fR" 4
+.IX Item "-mno-vis"
+.PD
+With \fB\-mvis\fR, \s-1GCC\s0 generates code that takes advantage of the UltraSPARC
+Visual Instruction Set extensions. The default is \fB\-mno\-vis\fR.
+.PP
+These \fB\-m\fR options are supported in addition to the above
+on \s-1SPARC\-V9\s0 processors in 64\-bit environments:
+.IP "\fB\-mlittle\-endian\fR" 4
+.IX Item "-mlittle-endian"
+Generate code for a processor running in little-endian mode. It is only
+available for a few configurations and most notably not on Solaris and Linux.
+.IP "\fB\-m32\fR" 4
+.IX Item "-m32"
+.PD 0
+.IP "\fB\-m64\fR" 4
+.IX Item "-m64"
+.PD
+Generate code for a 32\-bit or 64\-bit environment.
+The 32\-bit environment sets int, long and pointer to 32 bits.
+The 64\-bit environment sets int to 32 bits and long and pointer
+to 64 bits.
+.IP "\fB\-mcmodel=medlow\fR" 4
+.IX Item "-mcmodel=medlow"
+Generate code for the Medium/Low code model: 64\-bit addresses, programs
+must be linked in the low 32 bits of memory. Programs can be statically
+or dynamically linked.
+.IP "\fB\-mcmodel=medmid\fR" 4
+.IX Item "-mcmodel=medmid"
+Generate code for the Medium/Middle code model: 64\-bit addresses, programs
+must be linked in the low 44 bits of memory, the text and data segments must
+be less than 2GB in size and the data segment must be located within 2GB of
+the text segment.
+.IP "\fB\-mcmodel=medany\fR" 4
+.IX Item "-mcmodel=medany"
+Generate code for the Medium/Anywhere code model: 64\-bit addresses, programs
+may be linked anywhere in memory, the text and data segments must be less
+than 2GB in size and the data segment must be located within 2GB of the
+text segment.
+.IP "\fB\-mcmodel=embmedany\fR" 4
+.IX Item "-mcmodel=embmedany"
+Generate code for the Medium/Anywhere code model for embedded systems:
+64\-bit addresses, the text and data segments must be less than 2GB in
+size, both starting anywhere in memory (determined at link time). The
+global register \f(CW%g4\fR points to the base of the data segment. Programs
+are statically linked and \s-1PIC\s0 is not supported.
+.IP "\fB\-mstack\-bias\fR" 4
+.IX Item "-mstack-bias"
+.PD 0
+.IP "\fB\-mno\-stack\-bias\fR" 4
+.IX Item "-mno-stack-bias"
+.PD
+With \fB\-mstack\-bias\fR, \s-1GCC\s0 assumes that the stack pointer, and
+frame pointer if present, are offset by \-2047 which must be added back
+when making stack frame references. This is the default in 64\-bit mode.
+Otherwise, assume no such offset is present.
+.PP
+These switches are supported in addition to the above on Solaris:
+.IP "\fB\-threads\fR" 4
+.IX Item "-threads"
+Add support for multithreading using the Solaris threads library. This
+option sets flags for both the preprocessor and linker. This option does
+not affect the thread safety of object code produced by the compiler or
+that of libraries supplied with it.
+.IP "\fB\-pthreads\fR" 4
+.IX Item "-pthreads"
+Add support for multithreading using the \s-1POSIX\s0 threads library. This
+option sets flags for both the preprocessor and linker. This option does
+not affect the thread safety of object code produced by the compiler or
+that of libraries supplied with it.
+.IP "\fB\-pthread\fR" 4
+.IX Item "-pthread"
+This is a synonym for \fB\-pthreads\fR.
+.PP
+\fI\s-1SPU\s0 Options\fR
+.IX Subsection "SPU Options"
+.PP
+These \fB\-m\fR options are supported on the \s-1SPU:\s0
+.IP "\fB\-mwarn\-reloc\fR" 4
+.IX Item "-mwarn-reloc"
+.PD 0
+.IP "\fB\-merror\-reloc\fR" 4
+.IX Item "-merror-reloc"
+.PD
+The loader for \s-1SPU\s0 does not handle dynamic relocations. By default, \s-1GCC\s0
+will give an error when it generates code that requires a dynamic
+relocation. \fB\-mno\-error\-reloc\fR disables the error,
+\&\fB\-mwarn\-reloc\fR will generate a warning instead.
+.IP "\fB\-msafe\-dma\fR" 4
+.IX Item "-msafe-dma"
+.PD 0
+.IP "\fB\-munsafe\-dma\fR" 4
+.IX Item "-munsafe-dma"
+.PD
+Instructions which initiate or test completion of \s-1DMA\s0 must not be
+reordered with respect to loads and stores of the memory which is being
+accessed. Users typically address this problem using the volatile
+keyword, but that can lead to inefficient code in places where the
+memory is known to not change. Rather than mark the memory as volatile
+we treat the \s-1DMA\s0 instructions as potentially effecting all memory. With
+\&\fB\-munsafe\-dma\fR users must use the volatile keyword to protect
+memory accesses.
+.IP "\fB\-mbranch\-hints\fR" 4
+.IX Item "-mbranch-hints"
+By default, \s-1GCC\s0 will generate a branch hint instruction to avoid
+pipeline stalls for always taken or probably taken branches. A hint
+will not be generated closer than 8 instructions away from its branch.
+There is little reason to disable them, except for debugging purposes,
+or to make an object a little bit smaller.
+.IP "\fB\-msmall\-mem\fR" 4
+.IX Item "-msmall-mem"
+.PD 0
+.IP "\fB\-mlarge\-mem\fR" 4
+.IX Item "-mlarge-mem"
+.PD
+By default, \s-1GCC\s0 generates code assuming that addresses are never larger
+than 18 bits. With \fB\-mlarge\-mem\fR code is generated that assumes
+a full 32 bit address.
+.IP "\fB\-mstdmain\fR" 4
+.IX Item "-mstdmain"
+By default, \s-1GCC\s0 links against startup code that assumes the SPU-style
+main function interface (which has an unconventional parameter list).
+With \fB\-mstdmain\fR, \s-1GCC\s0 will link your program against startup
+code that assumes a C99\-style interface to \f(CW\*(C`main\*(C'\fR, including a
+local copy of \f(CW\*(C`argv\*(C'\fR strings.
+.IP "\fB\-mfixed\-range=\fR\fIregister-range\fR" 4
+.IX Item "-mfixed-range=register-range"
+Generate code treating the given register range as fixed registers.
+A fixed register is one that the register allocator can not use. This is
+useful when compiling kernel code. A register range is specified as
+two registers separated by a dash. Multiple register ranges can be
+specified separated by a comma.
+.IP "\fB\-mdual\-nops\fR" 4
+.IX Item "-mdual-nops"
+.PD 0
+.IP "\fB\-mdual\-nops=\fR\fIn\fR" 4
+.IX Item "-mdual-nops=n"
+.PD
+By default, \s-1GCC\s0 will insert nops to increase dual issue when it expects
+it to increase performance. \fIn\fR can be a value from 0 to 10. A
+smaller \fIn\fR will insert fewer nops. 10 is the default, 0 is the
+same as \fB\-mno\-dual\-nops\fR. Disabled with \fB\-Os\fR.
+.IP "\fB\-mhint\-max\-nops=\fR\fIn\fR" 4
+.IX Item "-mhint-max-nops=n"
+Maximum number of nops to insert for a branch hint. A branch hint must
+be at least 8 instructions away from the branch it is effecting. \s-1GCC\s0
+will insert up to \fIn\fR nops to enforce this, otherwise it will not
+generate the branch hint.
+.IP "\fB\-mhint\-max\-distance=\fR\fIn\fR" 4
+.IX Item "-mhint-max-distance=n"
+The encoding of the branch hint instruction limits the hint to be within
+256 instructions of the branch it is effecting. By default, \s-1GCC\s0 makes
+sure it is within 125.
+.IP "\fB\-msafe\-hints\fR" 4
+.IX Item "-msafe-hints"
+Work around a hardware bug which causes the \s-1SPU\s0 to stall indefinitely.
+By default, \s-1GCC\s0 will insert the \f(CW\*(C`hbrp\*(C'\fR instruction to make sure
+this stall won't happen.
+.PP
+\fIOptions for System V\fR
+.IX Subsection "Options for System V"
+.PP
+These additional options are available on System V Release 4 for
+compatibility with other compilers on those systems:
+.IP "\fB\-G\fR" 4
+.IX Item "-G"
+Create a shared object.
+It is recommended that \fB\-symbolic\fR or \fB\-shared\fR be used instead.
+.IP "\fB\-Qy\fR" 4
+.IX Item "-Qy"
+Identify the versions of each tool used by the compiler, in a
+\&\f(CW\*(C`.ident\*(C'\fR assembler directive in the output.
+.IP "\fB\-Qn\fR" 4
+.IX Item "-Qn"
+Refrain from adding \f(CW\*(C`.ident\*(C'\fR directives to the output file (this is
+the default).
+.IP "\fB\-YP,\fR\fIdirs\fR" 4
+.IX Item "-YP,dirs"
+Search the directories \fIdirs\fR, and no others, for libraries
+specified with \fB\-l\fR.
+.IP "\fB\-Ym,\fR\fIdir\fR" 4
+.IX Item "-Ym,dir"
+Look in the directory \fIdir\fR to find the M4 preprocessor.
+The assembler uses this option.
+.PP
+\fIV850 Options\fR
+.IX Subsection "V850 Options"
+.PP
+These \fB\-m\fR options are defined for V850 implementations:
+.IP "\fB\-mlong\-calls\fR" 4
+.IX Item "-mlong-calls"
+.PD 0
+.IP "\fB\-mno\-long\-calls\fR" 4
+.IX Item "-mno-long-calls"
+.PD
+Treat all calls as being far away (near). If calls are assumed to be
+far away, the compiler will always load the functions address up into a
+register, and call indirect through the pointer.
+.IP "\fB\-mno\-ep\fR" 4
+.IX Item "-mno-ep"
+.PD 0
+.IP "\fB\-mep\fR" 4
+.IX Item "-mep"
+.PD
+Do not optimize (do optimize) basic blocks that use the same index
+pointer 4 or more times to copy pointer into the \f(CW\*(C`ep\*(C'\fR register, and
+use the shorter \f(CW\*(C`sld\*(C'\fR and \f(CW\*(C`sst\*(C'\fR instructions. The \fB\-mep\fR
+option is on by default if you optimize.
+.IP "\fB\-mno\-prolog\-function\fR" 4
+.IX Item "-mno-prolog-function"
+.PD 0
+.IP "\fB\-mprolog\-function\fR" 4
+.IX Item "-mprolog-function"
+.PD
+Do not use (do use) external functions to save and restore registers
+at the prologue and epilogue of a function. The external functions
+are slower, but use less code space if more than one function saves
+the same number of registers. The \fB\-mprolog\-function\fR option
+is on by default if you optimize.
+.IP "\fB\-mspace\fR" 4
+.IX Item "-mspace"
+Try to make the code as small as possible. At present, this just turns
+on the \fB\-mep\fR and \fB\-mprolog\-function\fR options.
+.IP "\fB\-mtda=\fR\fIn\fR" 4
+.IX Item "-mtda=n"
+Put static or global variables whose size is \fIn\fR bytes or less into
+the tiny data area that register \f(CW\*(C`ep\*(C'\fR points to. The tiny data
+area can hold up to 256 bytes in total (128 bytes for byte references).
+.IP "\fB\-msda=\fR\fIn\fR" 4
+.IX Item "-msda=n"
+Put static or global variables whose size is \fIn\fR bytes or less into
+the small data area that register \f(CW\*(C`gp\*(C'\fR points to. The small data
+area can hold up to 64 kilobytes.
+.IP "\fB\-mzda=\fR\fIn\fR" 4
+.IX Item "-mzda=n"
+Put static or global variables whose size is \fIn\fR bytes or less into
+the first 32 kilobytes of memory.
+.IP "\fB\-mv850\fR" 4
+.IX Item "-mv850"
+Specify that the target processor is the V850.
+.IP "\fB\-mbig\-switch\fR" 4
+.IX Item "-mbig-switch"
+Generate code suitable for big switch tables. Use this option only if
+the assembler/linker complain about out of range branches within a switch
+table.
+.IP "\fB\-mapp\-regs\fR" 4
+.IX Item "-mapp-regs"
+This option will cause r2 and r5 to be used in the code generated by
+the compiler. This setting is the default.
+.IP "\fB\-mno\-app\-regs\fR" 4
+.IX Item "-mno-app-regs"
+This option will cause r2 and r5 to be treated as fixed registers.
+.IP "\fB\-mv850e1\fR" 4
+.IX Item "-mv850e1"
+Specify that the target processor is the V850E1. The preprocessor
+constants \fB_\|_v850e1_\|_\fR and \fB_\|_v850e_\|_\fR will be defined if
+this option is used.
+.IP "\fB\-mv850e\fR" 4
+.IX Item "-mv850e"
+Specify that the target processor is the V850E. The preprocessor
+constant \fB_\|_v850e_\|_\fR will be defined if this option is used.
+.Sp
+If neither \fB\-mv850\fR nor \fB\-mv850e\fR nor \fB\-mv850e1\fR
+are defined then a default target processor will be chosen and the
+relevant \fB_\|_v850*_\|_\fR preprocessor constant will be defined.
+.Sp
+The preprocessor constants \fB_\|_v850\fR and \fB_\|_v851_\|_\fR are always
+defined, regardless of which processor variant is the target.
+.IP "\fB\-mdisable\-callt\fR" 4
+.IX Item "-mdisable-callt"
+This option will suppress generation of the \s-1CALLT\s0 instruction for the
+v850e and v850e1 flavors of the v850 architecture. The default is
+\&\fB\-mno\-disable\-callt\fR which allows the \s-1CALLT\s0 instruction to be used.
+.PP
+\fI\s-1VAX\s0 Options\fR
+.IX Subsection "VAX Options"
+.PP
+These \fB\-m\fR options are defined for the \s-1VAX:\s0
+.IP "\fB\-munix\fR" 4
+.IX Item "-munix"
+Do not output certain jump instructions (\f(CW\*(C`aobleq\*(C'\fR and so on)
+that the Unix assembler for the \s-1VAX\s0 cannot handle across long
+ranges.
+.IP "\fB\-mgnu\fR" 4
+.IX Item "-mgnu"
+Do output those jump instructions, on the assumption that you
+will assemble with the \s-1GNU\s0 assembler.
+.IP "\fB\-mg\fR" 4
+.IX Item "-mg"
+Output code for g\-format floating point numbers instead of d\-format.
+.PP
+\fIVxWorks Options\fR
+.IX Subsection "VxWorks Options"
+.PP
+The options in this section are defined for all VxWorks targets.
+Options specific to the target hardware are listed with the other
+options for that target.
+.IP "\fB\-mrtp\fR" 4
+.IX Item "-mrtp"
+\&\s-1GCC\s0 can generate code for both VxWorks kernels and real time processes
+(RTPs). This option switches from the former to the latter. It also
+defines the preprocessor macro \f(CW\*(C`_\|_RTP_\|_\*(C'\fR.
+.IP "\fB\-non\-static\fR" 4
+.IX Item "-non-static"
+Link an \s-1RTP\s0 executable against shared libraries rather than static
+libraries. The options \fB\-static\fR and \fB\-shared\fR can
+also be used for RTPs; \fB\-static\fR
+is the default.
+.IP "\fB\-Bstatic\fR" 4
+.IX Item "-Bstatic"
+.PD 0
+.IP "\fB\-Bdynamic\fR" 4
+.IX Item "-Bdynamic"
+.PD
+These options are passed down to the linker. They are defined for
+compatibility with Diab.
+.IP "\fB\-Xbind\-lazy\fR" 4
+.IX Item "-Xbind-lazy"
+Enable lazy binding of function calls. This option is equivalent to
+\&\fB\-Wl,\-z,now\fR and is defined for compatibility with Diab.
+.IP "\fB\-Xbind\-now\fR" 4
+.IX Item "-Xbind-now"
+Disable lazy binding of function calls. This option is the default and
+is defined for compatibility with Diab.
+.PP
+\fIx86\-64 Options\fR
+.IX Subsection "x86-64 Options"
+.PP
+These are listed under
+.PP
+\fIi386 and x86\-64 Windows Options\fR
+.IX Subsection "i386 and x86-64 Windows Options"
+.PP
+These additional options are available for Windows targets:
+.IP "\fB\-mconsole\fR" 4
+.IX Item "-mconsole"
+This option is available for Cygwin and MinGW targets. It
+specifies that a console application is to be generated, by
+instructing the linker to set the \s-1PE\s0 header subsystem type
+required for console applications.
+This is the default behaviour for Cygwin and MinGW targets.
+.IP "\fB\-mcygwin\fR" 4
+.IX Item "-mcygwin"
+This option is available for Cygwin targets. It specifies that
+the Cygwin internal interface is to be used for predefined
+preprocessor macros, C runtime libraries and related linker
+paths and options. For Cygwin targets this is the default behaviour.
+This option is deprecated and will be removed in a future release.
+.IP "\fB\-mno\-cygwin\fR" 4
+.IX Item "-mno-cygwin"
+This option is available for Cygwin targets. It specifies that
+the MinGW internal interface is to be used instead of Cygwin's, by
+setting MinGW-related predefined macros and linker paths and default
+library options.
+This option is deprecated and will be removed in a future release.
+.IP "\fB\-mdll\fR" 4
+.IX Item "-mdll"
+This option is available for Cygwin and MinGW targets. It
+specifies that a \s-1DLL\s0 \- a dynamic link library \- is to be
+generated, enabling the selection of the required runtime
+startup object and entry point.
+.IP "\fB\-mnop\-fun\-dllimport\fR" 4
+.IX Item "-mnop-fun-dllimport"
+This option is available for Cygwin and MinGW targets. It
+specifies that the dllimport attribute should be ignored.
+.IP "\fB\-mthread\fR" 4
+.IX Item "-mthread"
+This option is available for MinGW targets. It specifies
+that MinGW-specific thread support is to be used.
+.IP "\fB\-mwin32\fR" 4
+.IX Item "-mwin32"
+This option is available for Cygwin and MinGW targets. It
+specifies that the typical Windows pre-defined macros are to
+be set in the pre-processor, but does not influence the choice
+of runtime library/startup code.
+.IP "\fB\-mwindows\fR" 4
+.IX Item "-mwindows"
+This option is available for Cygwin and MinGW targets. It
+specifies that a \s-1GUI\s0 application is to be generated by
+instructing the linker to set the \s-1PE\s0 header subsystem type
+appropriately.
+.PP
+See also under \fBi386 and x86\-64 Options\fR for standard options.
+.PP
+\fIXstormy16 Options\fR
+.IX Subsection "Xstormy16 Options"
+.PP
+These options are defined for Xstormy16:
+.IP "\fB\-msim\fR" 4
+.IX Item "-msim"
+Choose startup files and linker script suitable for the simulator.
+.PP
+\fIXtensa Options\fR
+.IX Subsection "Xtensa Options"
+.PP
+These options are supported for Xtensa targets:
+.IP "\fB\-mconst16\fR" 4
+.IX Item "-mconst16"
+.PD 0
+.IP "\fB\-mno\-const16\fR" 4
+.IX Item "-mno-const16"
+.PD
+Enable or disable use of \f(CW\*(C`CONST16\*(C'\fR instructions for loading
+constant values. The \f(CW\*(C`CONST16\*(C'\fR instruction is currently not a
+standard option from Tensilica. When enabled, \f(CW\*(C`CONST16\*(C'\fR
+instructions are always used in place of the standard \f(CW\*(C`L32R\*(C'\fR
+instructions. The use of \f(CW\*(C`CONST16\*(C'\fR is enabled by default only if
+the \f(CW\*(C`L32R\*(C'\fR instruction is not available.
+.IP "\fB\-mfused\-madd\fR" 4
+.IX Item "-mfused-madd"
+.PD 0
+.IP "\fB\-mno\-fused\-madd\fR" 4
+.IX Item "-mno-fused-madd"
+.PD
+Enable or disable use of fused multiply/add and multiply/subtract
+instructions in the floating-point option. This has no effect if the
+floating-point option is not also enabled. Disabling fused multiply/add
+and multiply/subtract instructions forces the compiler to use separate
+instructions for the multiply and add/subtract operations. This may be
+desirable in some cases where strict \s-1IEEE\s0 754\-compliant results are
+required: the fused multiply add/subtract instructions do not round the
+intermediate result, thereby producing results with \fImore\fR bits of
+precision than specified by the \s-1IEEE\s0 standard. Disabling fused multiply
+add/subtract instructions also ensures that the program output is not
+sensitive to the compiler's ability to combine multiply and add/subtract
+operations.
+.IP "\fB\-mserialize\-volatile\fR" 4
+.IX Item "-mserialize-volatile"
+.PD 0
+.IP "\fB\-mno\-serialize\-volatile\fR" 4
+.IX Item "-mno-serialize-volatile"
+.PD
+When this option is enabled, \s-1GCC\s0 inserts \f(CW\*(C`MEMW\*(C'\fR instructions before
+\&\f(CW\*(C`volatile\*(C'\fR memory references to guarantee sequential consistency.
+The default is \fB\-mserialize\-volatile\fR. Use
+\&\fB\-mno\-serialize\-volatile\fR to omit the \f(CW\*(C`MEMW\*(C'\fR instructions.
+.IP "\fB\-mtext\-section\-literals\fR" 4
+.IX Item "-mtext-section-literals"
+.PD 0
+.IP "\fB\-mno\-text\-section\-literals\fR" 4
+.IX Item "-mno-text-section-literals"
+.PD
+Control the treatment of literal pools. The default is
+\&\fB\-mno\-text\-section\-literals\fR, which places literals in a separate
+section in the output file. This allows the literal pool to be placed
+in a data \s-1RAM/ROM\s0, and it also allows the linker to combine literal
+pools from separate object files to remove redundant literals and
+improve code size. With \fB\-mtext\-section\-literals\fR, the literals
+are interspersed in the text section in order to keep them as close as
+possible to their references. This may be necessary for large assembly
+files.
+.IP "\fB\-mtarget\-align\fR" 4
+.IX Item "-mtarget-align"
+.PD 0
+.IP "\fB\-mno\-target\-align\fR" 4
+.IX Item "-mno-target-align"
+.PD
+When this option is enabled, \s-1GCC\s0 instructs the assembler to
+automatically align instructions to reduce branch penalties at the
+expense of some code density. The assembler attempts to widen density
+instructions to align branch targets and the instructions following call
+instructions. If there are not enough preceding safe density
+instructions to align a target, no widening will be performed. The
+default is \fB\-mtarget\-align\fR. These options do not affect the
+treatment of auto-aligned instructions like \f(CW\*(C`LOOP\*(C'\fR, which the
+assembler will always align, either by widening density instructions or
+by inserting no-op instructions.
+.IP "\fB\-mlongcalls\fR" 4
+.IX Item "-mlongcalls"
+.PD 0
+.IP "\fB\-mno\-longcalls\fR" 4
+.IX Item "-mno-longcalls"
+.PD
+When this option is enabled, \s-1GCC\s0 instructs the assembler to translate
+direct calls to indirect calls unless it can determine that the target
+of a direct call is in the range allowed by the call instruction. This
+translation typically occurs for calls to functions in other source
+files. Specifically, the assembler translates a direct \f(CW\*(C`CALL\*(C'\fR
+instruction into an \f(CW\*(C`L32R\*(C'\fR followed by a \f(CW\*(C`CALLX\*(C'\fR instruction.
+The default is \fB\-mno\-longcalls\fR. This option should be used in
+programs where the call target can potentially be out of range. This
+option is implemented in the assembler, not the compiler, so the
+assembly code generated by \s-1GCC\s0 will still show direct call
+instructions\-\-\-look at the disassembled object code to see the actual
+instructions. Note that the assembler will use an indirect call for
+every cross-file call, not just those that really will be out of range.
+.PP
+\fIzSeries Options\fR
+.IX Subsection "zSeries Options"
+.PP
+These are listed under
+.Sh "Options for Code Generation Conventions"
+.IX Subsection "Options for Code Generation Conventions"
+These machine-independent options control the interface conventions
+used in code generation.
+.PP
+Most of them have both positive and negative forms; the negative form
+of \fB\-ffoo\fR would be \fB\-fno\-foo\fR. In the table below, only
+one of the forms is listed\-\-\-the one which is not the default. You
+can figure out the other form by either removing \fBno\-\fR or adding
+it.
+.IP "\fB\-fbounds\-check\fR" 4
+.IX Item "-fbounds-check"
+For front-ends that support it, generate additional code to check that
+indices used to access arrays are within the declared range. This is
+currently only supported by the Java and Fortran front-ends, where
+this option defaults to true and false respectively.
+.IP "\fB\-ftrapv\fR" 4
+.IX Item "-ftrapv"
+This option generates traps for signed overflow on addition, subtraction,
+multiplication operations.
+.IP "\fB\-fwrapv\fR" 4
+.IX Item "-fwrapv"
+This option instructs the compiler to assume that signed arithmetic
+overflow of addition, subtraction and multiplication wraps around
+using twos-complement representation. This flag enables some optimizations
+and disables others. This option is enabled by default for the Java
+front-end, as required by the Java language specification.
+.IP "\fB\-fexceptions\fR" 4
+.IX Item "-fexceptions"
+Enable exception handling. Generates extra code needed to propagate
+exceptions. For some targets, this implies \s-1GCC\s0 will generate frame
+unwind information for all functions, which can produce significant data
+size overhead, although it does not affect execution. If you do not
+specify this option, \s-1GCC\s0 will enable it by default for languages like
+\&\*(C+ which normally require exception handling, and disable it for
+languages like C that do not normally require it. However, you may need
+to enable this option when compiling C code that needs to interoperate
+properly with exception handlers written in \*(C+. You may also wish to
+disable this option if you are compiling older \*(C+ programs that don't
+use exception handling.
+.IP "\fB\-fnon\-call\-exceptions\fR" 4
+.IX Item "-fnon-call-exceptions"
+Generate code that allows trapping instructions to throw exceptions.
+Note that this requires platform-specific runtime support that does
+not exist everywhere. Moreover, it only allows \fItrapping\fR
+instructions to throw exceptions, i.e. memory references or floating
+point instructions. It does not allow exceptions to be thrown from
+arbitrary signal handlers such as \f(CW\*(C`SIGALRM\*(C'\fR.
+.IP "\fB\-funwind\-tables\fR" 4
+.IX Item "-funwind-tables"
+Similar to \fB\-fexceptions\fR, except that it will just generate any needed
+static data, but will not affect the generated code in any other way.
+You will normally not enable this option; instead, a language processor
+that needs this handling would enable it on your behalf.
+.IP "\fB\-fasynchronous\-unwind\-tables\fR" 4
+.IX Item "-fasynchronous-unwind-tables"
+Generate unwind table in dwarf2 format, if supported by target machine. The
+table is exact at each instruction boundary, so it can be used for stack
+unwinding from asynchronous events (such as debugger or garbage collector).
+.IP "\fB\-fpcc\-struct\-return\fR" 4
+.IX Item "-fpcc-struct-return"
+Return \*(L"short\*(R" \f(CW\*(C`struct\*(C'\fR and \f(CW\*(C`union\*(C'\fR values in memory like
+longer ones, rather than in registers. This convention is less
+efficient, but it has the advantage of allowing intercallability between
+GCC-compiled files and files compiled with other compilers, particularly
+the Portable C Compiler (pcc).
+.Sp
+The precise convention for returning structures in memory depends
+on the target configuration macros.
+.Sp
+Short structures and unions are those whose size and alignment match
+that of some integer type.
+.Sp
+\&\fBWarning:\fR code compiled with the \fB\-fpcc\-struct\-return\fR
+switch is not binary compatible with code compiled with the
+\&\fB\-freg\-struct\-return\fR switch.
+Use it to conform to a non-default application binary interface.
+.IP "\fB\-freg\-struct\-return\fR" 4
+.IX Item "-freg-struct-return"
+Return \f(CW\*(C`struct\*(C'\fR and \f(CW\*(C`union\*(C'\fR values in registers when possible.
+This is more efficient for small structures than
+\&\fB\-fpcc\-struct\-return\fR.
+.Sp
+If you specify neither \fB\-fpcc\-struct\-return\fR nor
+\&\fB\-freg\-struct\-return\fR, \s-1GCC\s0 defaults to whichever convention is
+standard for the target. If there is no standard convention, \s-1GCC\s0
+defaults to \fB\-fpcc\-struct\-return\fR, except on targets where \s-1GCC\s0 is
+the principal compiler. In those cases, we can choose the standard, and
+we chose the more efficient register return alternative.
+.Sp
+\&\fBWarning:\fR code compiled with the \fB\-freg\-struct\-return\fR
+switch is not binary compatible with code compiled with the
+\&\fB\-fpcc\-struct\-return\fR switch.
+Use it to conform to a non-default application binary interface.
+.IP "\fB\-fshort\-enums\fR" 4
+.IX Item "-fshort-enums"
+Allocate to an \f(CW\*(C`enum\*(C'\fR type only as many bytes as it needs for the
+declared range of possible values. Specifically, the \f(CW\*(C`enum\*(C'\fR type
+will be equivalent to the smallest integer type which has enough room.
+.Sp
+\&\fBWarning:\fR the \fB\-fshort\-enums\fR switch causes \s-1GCC\s0 to generate
+code that is not binary compatible with code generated without that switch.
+Use it to conform to a non-default application binary interface.
+.IP "\fB\-fshort\-double\fR" 4
+.IX Item "-fshort-double"
+Use the same size for \f(CW\*(C`double\*(C'\fR as for \f(CW\*(C`float\*(C'\fR.
+.Sp
+\&\fBWarning:\fR the \fB\-fshort\-double\fR switch causes \s-1GCC\s0 to generate
+code that is not binary compatible with code generated without that switch.
+Use it to conform to a non-default application binary interface.
+.IP "\fB\-fshort\-wchar\fR" 4
+.IX Item "-fshort-wchar"
+Override the underlying type for \fBwchar_t\fR to be \fBshort
+unsigned int\fR instead of the default for the target. This option is
+useful for building programs to run under \s-1WINE\s0.
+.Sp
+\&\fBWarning:\fR the \fB\-fshort\-wchar\fR switch causes \s-1GCC\s0 to generate
+code that is not binary compatible with code generated without that switch.
+Use it to conform to a non-default application binary interface.
+.IP "\fB\-fno\-common\fR" 4
+.IX Item "-fno-common"
+In C code, controls the placement of uninitialized global variables.
+Unix C compilers have traditionally permitted multiple definitions of
+such variables in different compilation units by placing the variables
+in a common block.
+This is the behavior specified by \fB\-fcommon\fR, and is the default
+for \s-1GCC\s0 on most targets.
+On the other hand, this behavior is not required by \s-1ISO\s0 C, and on some
+targets may carry a speed or code size penalty on variable references.
+The \fB\-fno\-common\fR option specifies that the compiler should place
+uninitialized global variables in the data section of the object file,
+rather than generating them as common blocks.
+This has the effect that if the same variable is declared
+(without \f(CW\*(C`extern\*(C'\fR) in two different compilations,
+you will get a multiple-definition error when you link them.
+In this case, you must compile with \fB\-fcommon\fR instead.
+Compiling with \fB\-fno\-common\fR is useful on targets for which
+it provides better performance, or if you wish to verify that the
+program will work on other systems which always treat uninitialized
+variable declarations this way.
+.IP "\fB\-fno\-ident\fR" 4
+.IX Item "-fno-ident"
+Ignore the \fB#ident\fR directive.
+.IP "\fB\-finhibit\-size\-directive\fR" 4
+.IX Item "-finhibit-size-directive"
+Don't output a \f(CW\*(C`.size\*(C'\fR assembler directive, or anything else that
+would cause trouble if the function is split in the middle, and the
+two halves are placed at locations far apart in memory. This option is
+used when compiling \fIcrtstuff.c\fR; you should not need to use it
+for anything else.
+.IP "\fB\-fverbose\-asm\fR" 4
+.IX Item "-fverbose-asm"
+Put extra commentary information in the generated assembly code to
+make it more readable. This option is generally only of use to those
+who actually need to read the generated assembly code (perhaps while
+debugging the compiler itself).
+.Sp
+\&\fB\-fno\-verbose\-asm\fR, the default, causes the
+extra information to be omitted and is useful when comparing two assembler
+files.
+.IP "\fB\-frecord\-gcc\-switches\fR" 4
+.IX Item "-frecord-gcc-switches"
+This switch causes the command line that was used to invoke the
+compiler to be recorded into the object file that is being created.
+This switch is only implemented on some targets and the exact format
+of the recording is target and binary file format dependent, but it
+usually takes the form of a section containing \s-1ASCII\s0 text. This
+switch is related to the \fB\-fverbose\-asm\fR switch, but that
+switch only records information in the assembler output file as
+comments, so it never reaches the object file.
+.IP "\fB\-fpic\fR" 4
+.IX Item "-fpic"
+Generate position-independent code (\s-1PIC\s0) suitable for use in a shared
+library, if supported for the target machine. Such code accesses all
+constant addresses through a global offset table (\s-1GOT\s0). The dynamic
+loader resolves the \s-1GOT\s0 entries when the program starts (the dynamic
+loader is not part of \s-1GCC\s0; it is part of the operating system). If
+the \s-1GOT\s0 size for the linked executable exceeds a machine-specific
+maximum size, you get an error message from the linker indicating that
+\&\fB\-fpic\fR does not work; in that case, recompile with \fB\-fPIC\fR
+instead. (These maximums are 8k on the \s-1SPARC\s0 and 32k
+on the m68k and \s-1RS/6000\s0. The 386 has no such limit.)
+.Sp
+Position-independent code requires special support, and therefore works
+only on certain machines. For the 386, \s-1GCC\s0 supports \s-1PIC\s0 for System V
+but not for the Sun 386i. Code generated for the \s-1IBM\s0 \s-1RS/6000\s0 is always
+position-independent.
+.Sp
+When this flag is set, the macros \f(CW\*(C`_\|_pic_\|_\*(C'\fR and \f(CW\*(C`_\|_PIC_\|_\*(C'\fR
+are defined to 1.
+.IP "\fB\-fPIC\fR" 4
+.IX Item "-fPIC"
+If supported for the target machine, emit position-independent code,
+suitable for dynamic linking and avoiding any limit on the size of the
+global offset table. This option makes a difference on the m68k,
+PowerPC and \s-1SPARC\s0.
+.Sp
+Position-independent code requires special support, and therefore works
+only on certain machines.
+.Sp
+When this flag is set, the macros \f(CW\*(C`_\|_pic_\|_\*(C'\fR and \f(CW\*(C`_\|_PIC_\|_\*(C'\fR
+are defined to 2.
+.IP "\fB\-fpie\fR" 4
+.IX Item "-fpie"
+.PD 0
+.IP "\fB\-fPIE\fR" 4
+.IX Item "-fPIE"
+.PD
+These options are similar to \fB\-fpic\fR and \fB\-fPIC\fR, but
+generated position independent code can be only linked into executables.
+Usually these options are used when \fB\-pie\fR \s-1GCC\s0 option will be
+used during linking.
+.Sp
+\&\fB\-fpie\fR and \fB\-fPIE\fR both define the macros
+\&\f(CW\*(C`_\|_pie_\|_\*(C'\fR and \f(CW\*(C`_\|_PIE_\|_\*(C'\fR. The macros have the value 1
+for \fB\-fpie\fR and 2 for \fB\-fPIE\fR.
+.IP "\fB\-fno\-jump\-tables\fR" 4
+.IX Item "-fno-jump-tables"
+Do not use jump tables for switch statements even where it would be
+more efficient than other code generation strategies. This option is
+of use in conjunction with \fB\-fpic\fR or \fB\-fPIC\fR for
+building code which forms part of a dynamic linker and cannot
+reference the address of a jump table. On some targets, jump tables
+do not require a \s-1GOT\s0 and this option is not needed.
+.IP "\fB\-ffixed\-\fR\fIreg\fR" 4
+.IX Item "-ffixed-reg"
+Treat the register named \fIreg\fR as a fixed register; generated code
+should never refer to it (except perhaps as a stack pointer, frame
+pointer or in some other fixed role).
+.Sp
+\&\fIreg\fR must be the name of a register. The register names accepted
+are machine-specific and are defined in the \f(CW\*(C`REGISTER_NAMES\*(C'\fR
+macro in the machine description macro file.
+.Sp
+This flag does not have a negative form, because it specifies a
+three-way choice.
+.IP "\fB\-fcall\-used\-\fR\fIreg\fR" 4
+.IX Item "-fcall-used-reg"
+Treat the register named \fIreg\fR as an allocable register that is
+clobbered by function calls. It may be allocated for temporaries or
+variables that do not live across a call. Functions compiled this way
+will not save and restore the register \fIreg\fR.
+.Sp
+It is an error to used this flag with the frame pointer or stack pointer.
+Use of this flag for other registers that have fixed pervasive roles in
+the machine's execution model will produce disastrous results.
+.Sp
+This flag does not have a negative form, because it specifies a
+three-way choice.
+.IP "\fB\-fcall\-saved\-\fR\fIreg\fR" 4
+.IX Item "-fcall-saved-reg"
+Treat the register named \fIreg\fR as an allocable register saved by
+functions. It may be allocated even for temporaries or variables that
+live across a call. Functions compiled this way will save and restore
+the register \fIreg\fR if they use it.
+.Sp
+It is an error to used this flag with the frame pointer or stack pointer.
+Use of this flag for other registers that have fixed pervasive roles in
+the machine's execution model will produce disastrous results.
+.Sp
+A different sort of disaster will result from the use of this flag for
+a register in which function values may be returned.
+.Sp
+This flag does not have a negative form, because it specifies a
+three-way choice.
+.IP "\fB\-fpack\-struct[=\fR\fIn\fR\fB]\fR" 4
+.IX Item "-fpack-struct[=n]"
+Without a value specified, pack all structure members together without
+holes. When a value is specified (which must be a small power of two), pack
+structure members according to this value, representing the maximum
+alignment (that is, objects with default alignment requirements larger than
+this will be output potentially unaligned at the next fitting location.
+.Sp
+\&\fBWarning:\fR the \fB\-fpack\-struct\fR switch causes \s-1GCC\s0 to generate
+code that is not binary compatible with code generated without that switch.
+Additionally, it makes the code suboptimal.
+Use it to conform to a non-default application binary interface.
+.IP "\fB\-finstrument\-functions\fR" 4
+.IX Item "-finstrument-functions"
+Generate instrumentation calls for entry and exit to functions. Just
+after function entry and just before function exit, the following
+profiling functions will be called with the address of the current
+function and its call site. (On some platforms,
+\&\f(CW\*(C`_\|_builtin_return_address\*(C'\fR does not work beyond the current
+function, so the call site information may not be available to the
+profiling functions otherwise.)
+.Sp
+.Vb 4
+\& void _\|_cyg_profile_func_enter (void *this_fn,
+\& void *call_site);
+\& void _\|_cyg_profile_func_exit (void *this_fn,
+\& void *call_site);
+.Ve
+.Sp
+The first argument is the address of the start of the current function,
+which may be looked up exactly in the symbol table.
+.Sp
+This instrumentation is also done for functions expanded inline in other
+functions. The profiling calls will indicate where, conceptually, the
+inline function is entered and exited. This means that addressable
+versions of such functions must be available. If all your uses of a
+function are expanded inline, this may mean an additional expansion of
+code size. If you use \fBextern inline\fR in your C code, an
+addressable version of such functions must be provided. (This is
+normally the case anyways, but if you get lucky and the optimizer always
+expands the functions inline, you might have gotten away without
+providing static copies.)
+.Sp
+A function may be given the attribute \f(CW\*(C`no_instrument_function\*(C'\fR, in
+which case this instrumentation will not be done. This can be used, for
+example, for the profiling functions listed above, high-priority
+interrupt routines, and any functions from which the profiling functions
+cannot safely be called (perhaps signal handlers, if the profiling
+routines generate output or allocate memory).
+.IP "\fB\-finstrument\-functions\-exclude\-file\-list=\fR\fIfile\fR\fB,\fR\fIfile\fR\fB,...\fR" 4
+.IX Item "-finstrument-functions-exclude-file-list=file,file,..."
+Set the list of functions that are excluded from instrumentation (see
+the description of \f(CW\*(C`\-finstrument\-functions\*(C'\fR). If the file that
+contains a function definition matches with one of \fIfile\fR, then
+that function is not instrumented. The match is done on substrings:
+if the \fIfile\fR parameter is a substring of the file name, it is
+considered to be a match.
+.Sp
+For example,
+\&\f(CW\*(C`\-finstrument\-functions\-exclude\-file\-list=/bits/stl,include/sys\*(C'\fR
+will exclude any inline function defined in files whose pathnames
+contain \f(CW\*(C`/bits/stl\*(C'\fR or \f(CW\*(C`include/sys\*(C'\fR.
+.Sp
+If, for some reason, you want to include letter \f(CW\*(Aq,\*(Aq\fR in one of
+\&\fIsym\fR, write \f(CW\*(Aq,\*(Aq\fR. For example,
+\&\f(CW\*(C`\-finstrument\-functions\-exclude\-file\-list=\*(Aq,,tmp\*(Aq\*(C'\fR
+(note the single quote surrounding the option).
+.IP "\fB\-finstrument\-functions\-exclude\-function\-list=\fR\fIsym\fR\fB,\fR\fIsym\fR\fB,...\fR" 4
+.IX Item "-finstrument-functions-exclude-function-list=sym,sym,..."
+This is similar to \f(CW\*(C`\-finstrument\-functions\-exclude\-file\-list\*(C'\fR,
+but this option sets the list of function names to be excluded from
+instrumentation. The function name to be matched is its user-visible
+name, such as \f(CW\*(C`vector<int> blah(const vector<int> &)\*(C'\fR, not the
+internal mangled name (e.g., \f(CW\*(C`_Z4blahRSt6vectorIiSaIiEE\*(C'\fR). The
+match is done on substrings: if the \fIsym\fR parameter is a substring
+of the function name, it is considered to be a match.
+.IP "\fB\-fstack\-check\fR" 4
+.IX Item "-fstack-check"
+Generate code to verify that you do not go beyond the boundary of the
+stack. You should specify this flag if you are running in an
+environment with multiple threads, but only rarely need to specify it in
+a single-threaded environment since stack overflow is automatically
+detected on nearly all systems if there is only one stack.
+.Sp
+Note that this switch does not actually cause checking to be done; the
+operating system or the language runtime must do that. The switch causes
+generation of code to ensure that they see the stack being extended.
+.Sp
+You can additionally specify a string parameter: \f(CW\*(C`no\*(C'\fR means no
+checking, \f(CW\*(C`generic\*(C'\fR means force the use of old-style checking,
+\&\f(CW\*(C`specific\*(C'\fR means use the best checking method and is equivalent
+to bare \fB\-fstack\-check\fR.
+.Sp
+Old-style checking is a generic mechanism that requires no specific
+target support in the compiler but comes with the following drawbacks:
+.RS 4
+.IP "1." 4
+Modified allocation strategy for large objects: they will always be
+allocated dynamically if their size exceeds a fixed threshold.
+.IP "2." 4
+Fixed limit on the size of the static frame of functions: when it is
+topped by a particular function, stack checking is not reliable and
+a warning is issued by the compiler.
+.IP "3." 4
+Inefficiency: because of both the modified allocation strategy and the
+generic implementation, the performances of the code are hampered.
+.RE
+.RS 4
+.Sp
+Note that old-style stack checking is also the fallback method for
+\&\f(CW\*(C`specific\*(C'\fR if no target support has been added in the compiler.
+.RE
+.IP "\fB\-fstack\-limit\-register=\fR\fIreg\fR" 4
+.IX Item "-fstack-limit-register=reg"
+.PD 0
+.IP "\fB\-fstack\-limit\-symbol=\fR\fIsym\fR" 4
+.IX Item "-fstack-limit-symbol=sym"
+.IP "\fB\-fno\-stack\-limit\fR" 4
+.IX Item "-fno-stack-limit"
+.PD
+Generate code to ensure that the stack does not grow beyond a certain value,
+either the value of a register or the address of a symbol. If the stack
+would grow beyond the value, a signal is raised. For most targets,
+the signal is raised before the stack overruns the boundary, so
+it is possible to catch the signal without taking special precautions.
+.Sp
+For instance, if the stack starts at absolute address \fB0x80000000\fR
+and grows downwards, you can use the flags
+\&\fB\-fstack\-limit\-symbol=_\|_stack_limit\fR and
+\&\fB\-Wl,\-\-defsym,_\|_stack_limit=0x7ffe0000\fR to enforce a stack limit
+of 128KB. Note that this may only work with the \s-1GNU\s0 linker.
+.IP "\fB\-fargument\-alias\fR" 4
+.IX Item "-fargument-alias"
+.PD 0
+.IP "\fB\-fargument\-noalias\fR" 4
+.IX Item "-fargument-noalias"
+.IP "\fB\-fargument\-noalias\-global\fR" 4
+.IX Item "-fargument-noalias-global"
+.IP "\fB\-fargument\-noalias\-anything\fR" 4
+.IX Item "-fargument-noalias-anything"
+.PD
+Specify the possible relationships among parameters and between
+parameters and global data.
+.Sp
+\&\fB\-fargument\-alias\fR specifies that arguments (parameters) may
+alias each other and may alias global storage.\fB\-fargument\-noalias\fR specifies that arguments do not alias
+each other, but may alias global storage.\fB\-fargument\-noalias\-global\fR specifies that arguments do not
+alias each other and do not alias global storage.
+\&\fB\-fargument\-noalias\-anything\fR specifies that arguments do not
+alias any other storage.
+.Sp
+Each language will automatically use whatever option is required by
+the language standard. You should not need to use these options yourself.
+.IP "\fB\-fleading\-underscore\fR" 4
+.IX Item "-fleading-underscore"
+This option and its counterpart, \fB\-fno\-leading\-underscore\fR, forcibly
+change the way C symbols are represented in the object file. One use
+is to help link with legacy assembly code.
+.Sp
+\&\fBWarning:\fR the \fB\-fleading\-underscore\fR switch causes \s-1GCC\s0 to
+generate code that is not binary compatible with code generated without that
+switch. Use it to conform to a non-default application binary interface.
+Not all targets provide complete support for this switch.
+.IP "\fB\-ftls\-model=\fR\fImodel\fR" 4
+.IX Item "-ftls-model=model"
+Alter the thread-local storage model to be used.
+The \fImodel\fR argument should be one of \f(CW\*(C`global\-dynamic\*(C'\fR,
+\&\f(CW\*(C`local\-dynamic\*(C'\fR, \f(CW\*(C`initial\-exec\*(C'\fR or \f(CW\*(C`local\-exec\*(C'\fR.
+.Sp
+The default without \fB\-fpic\fR is \f(CW\*(C`initial\-exec\*(C'\fR; with
+\&\fB\-fpic\fR the default is \f(CW\*(C`global\-dynamic\*(C'\fR.
+.IP "\fB\-fvisibility=\fR\fIdefault|internal|hidden|protected\fR" 4
+.IX Item "-fvisibility=default|internal|hidden|protected"
+Set the default \s-1ELF\s0 image symbol visibility to the specified option\-\-\-all
+symbols will be marked with this unless overridden within the code.
+Using this feature can very substantially improve linking and
+load times of shared object libraries, produce more optimized
+code, provide near-perfect \s-1API\s0 export and prevent symbol clashes.
+It is \fBstrongly\fR recommended that you use this in any shared objects
+you distribute.
+.Sp
+Despite the nomenclature, \f(CW\*(C`default\*(C'\fR always means public ie;
+available to be linked against from outside the shared object.
+\&\f(CW\*(C`protected\*(C'\fR and \f(CW\*(C`internal\*(C'\fR are pretty useless in real-world
+usage so the only other commonly used option will be \f(CW\*(C`hidden\*(C'\fR.
+The default if \fB\-fvisibility\fR isn't specified is
+\&\f(CW\*(C`default\*(C'\fR, i.e., make every
+symbol public\-\-\-this causes the same behavior as previous versions of
+\&\s-1GCC\s0.
+.Sp
+A good explanation of the benefits offered by ensuring \s-1ELF\s0
+symbols have the correct visibility is given by \*(L"How To Write
+Shared Libraries\*(R" by Ulrich Drepper (which can be found at
+<\fBhttp://people.redhat.com/~drepper/\fR>)\-\-\-however a superior
+solution made possible by this option to marking things hidden when
+the default is public is to make the default hidden and mark things
+public. This is the norm with \s-1DLL\s0's on Windows and with \fB\-fvisibility=hidden\fR
+and \f(CW\*(C`_\|_attribute_\|_ ((visibility("default")))\*(C'\fR instead of
+\&\f(CW\*(C`_\|_declspec(dllexport)\*(C'\fR you get almost identical semantics with
+identical syntax. This is a great boon to those working with
+cross-platform projects.
+.Sp
+For those adding visibility support to existing code, you may find
+\&\fB#pragma \s-1GCC\s0 visibility\fR of use. This works by you enclosing
+the declarations you wish to set visibility for with (for example)
+\&\fB#pragma \s-1GCC\s0 visibility push(hidden)\fR and
+\&\fB#pragma \s-1GCC\s0 visibility pop\fR.
+Bear in mind that symbol visibility should be viewed \fBas
+part of the \s-1API\s0 interface contract\fR and thus all new code should
+always specify visibility when it is not the default ie; declarations
+only for use within the local \s-1DSO\s0 should \fBalways\fR be marked explicitly
+as hidden as so to avoid \s-1PLT\s0 indirection overheads\-\-\-making this
+abundantly clear also aids readability and self-documentation of the code.
+Note that due to \s-1ISO\s0 \*(C+ specification requirements, operator new and
+operator delete must always be of default visibility.
+.Sp
+Be aware that headers from outside your project, in particular system
+headers and headers from any other library you use, may not be
+expecting to be compiled with visibility other than the default. You
+may need to explicitly say \fB#pragma \s-1GCC\s0 visibility push(default)\fR
+before including any such headers.
+.Sp
+\&\fBextern\fR declarations are not affected by \fB\-fvisibility\fR, so
+a lot of code can be recompiled with \fB\-fvisibility=hidden\fR with
+no modifications. However, this means that calls to \fBextern\fR
+functions with no explicit visibility will use the \s-1PLT\s0, so it is more
+effective to use \fB_\|_attribute ((visibility))\fR and/or
+\&\fB#pragma \s-1GCC\s0 visibility\fR to tell the compiler which \fBextern\fR
+declarations should be treated as hidden.
+.Sp
+Note that \fB\-fvisibility\fR does affect \*(C+ vague linkage
+entities. This means that, for instance, an exception class that will
+be thrown between DSOs must be explicitly marked with default
+visibility so that the \fBtype_info\fR nodes will be unified between
+the DSOs.
+.Sp
+An overview of these techniques, their benefits and how to use them
+is at <\fBhttp://gcc.gnu.org/wiki/Visibility\fR>.
+.SH "ENVIRONMENT"
+.IX Header "ENVIRONMENT"
+This section describes several environment variables that affect how \s-1GCC\s0
+operates. Some of them work by specifying directories or prefixes to use
+when searching for various kinds of files. Some are used to specify other
+aspects of the compilation environment.
+.PP
+Note that you can also specify places to search using options such as
+\&\fB\-B\fR, \fB\-I\fR and \fB\-L\fR. These
+take precedence over places specified using environment variables, which
+in turn take precedence over those specified by the configuration of \s-1GCC\s0.
+.IP "\fB\s-1LANG\s0\fR" 4
+.IX Item "LANG"
+.PD 0
+.IP "\fB\s-1LC_CTYPE\s0\fR" 4
+.IX Item "LC_CTYPE"
+.IP "\fB\s-1LC_MESSAGES\s0\fR" 4
+.IX Item "LC_MESSAGES"
+.IP "\fB\s-1LC_ALL\s0\fR" 4
+.IX Item "LC_ALL"
+.PD
+These environment variables control the way that \s-1GCC\s0 uses
+localization information that allow \s-1GCC\s0 to work with different
+national conventions. \s-1GCC\s0 inspects the locale categories
+\&\fB\s-1LC_CTYPE\s0\fR and \fB\s-1LC_MESSAGES\s0\fR if it has been configured to do
+so. These locale categories can be set to any value supported by your
+installation. A typical value is \fBen_GB.UTF\-8\fR for English in the United
+Kingdom encoded in \s-1UTF\-8\s0.
+.Sp
+The \fB\s-1LC_CTYPE\s0\fR environment variable specifies character
+classification. \s-1GCC\s0 uses it to determine the character boundaries in
+a string; this is needed for some multibyte encodings that contain quote
+and escape characters that would otherwise be interpreted as a string
+end or escape.
+.Sp
+The \fB\s-1LC_MESSAGES\s0\fR environment variable specifies the language to
+use in diagnostic messages.
+.Sp
+If the \fB\s-1LC_ALL\s0\fR environment variable is set, it overrides the value
+of \fB\s-1LC_CTYPE\s0\fR and \fB\s-1LC_MESSAGES\s0\fR; otherwise, \fB\s-1LC_CTYPE\s0\fR
+and \fB\s-1LC_MESSAGES\s0\fR default to the value of the \fB\s-1LANG\s0\fR
+environment variable. If none of these variables are set, \s-1GCC\s0
+defaults to traditional C English behavior.
+.IP "\fB\s-1TMPDIR\s0\fR" 4
+.IX Item "TMPDIR"
+If \fB\s-1TMPDIR\s0\fR is set, it specifies the directory to use for temporary
+files. \s-1GCC\s0 uses temporary files to hold the output of one stage of
+compilation which is to be used as input to the next stage: for example,
+the output of the preprocessor, which is the input to the compiler
+proper.
+.IP "\fB\s-1GCC_EXEC_PREFIX\s0\fR" 4
+.IX Item "GCC_EXEC_PREFIX"
+If \fB\s-1GCC_EXEC_PREFIX\s0\fR is set, it specifies a prefix to use in the
+names of the subprograms executed by the compiler. No slash is added
+when this prefix is combined with the name of a subprogram, but you can
+specify a prefix that ends with a slash if you wish.
+.Sp
+If \fB\s-1GCC_EXEC_PREFIX\s0\fR is not set, \s-1GCC\s0 will attempt to figure out
+an appropriate prefix to use based on the pathname it was invoked with.
+.Sp
+If \s-1GCC\s0 cannot find the subprogram using the specified prefix, it
+tries looking in the usual places for the subprogram.
+.Sp
+The default value of \fB\s-1GCC_EXEC_PREFIX\s0\fR is
+\&\fI\fIprefix\fI/lib/gcc/\fR where \fIprefix\fR is the prefix to
+the installed compiler. In many cases \fIprefix\fR is the value
+of \f(CW\*(C`prefix\*(C'\fR when you ran the \fIconfigure\fR script.
+.Sp
+Other prefixes specified with \fB\-B\fR take precedence over this prefix.
+.Sp
+This prefix is also used for finding files such as \fIcrt0.o\fR that are
+used for linking.
+.Sp
+In addition, the prefix is used in an unusual way in finding the
+directories to search for header files. For each of the standard
+directories whose name normally begins with \fB/usr/local/lib/gcc\fR
+(more precisely, with the value of \fB\s-1GCC_INCLUDE_DIR\s0\fR), \s-1GCC\s0 tries
+replacing that beginning with the specified prefix to produce an
+alternate directory name. Thus, with \fB\-Bfoo/\fR, \s-1GCC\s0 will search
+\&\fIfoo/bar\fR where it would normally search \fI/usr/local/lib/bar\fR.
+These alternate directories are searched first; the standard directories
+come next. If a standard directory begins with the configured
+\&\fIprefix\fR then the value of \fIprefix\fR is replaced by
+\&\fB\s-1GCC_EXEC_PREFIX\s0\fR when looking for header files.
+.IP "\fB\s-1COMPILER_PATH\s0\fR" 4
+.IX Item "COMPILER_PATH"
+The value of \fB\s-1COMPILER_PATH\s0\fR is a colon-separated list of
+directories, much like \fB\s-1PATH\s0\fR. \s-1GCC\s0 tries the directories thus
+specified when searching for subprograms, if it can't find the
+subprograms using \fB\s-1GCC_EXEC_PREFIX\s0\fR.
+.IP "\fB\s-1LIBRARY_PATH\s0\fR" 4
+.IX Item "LIBRARY_PATH"
+The value of \fB\s-1LIBRARY_PATH\s0\fR is a colon-separated list of
+directories, much like \fB\s-1PATH\s0\fR. When configured as a native compiler,
+\&\s-1GCC\s0 tries the directories thus specified when searching for special
+linker files, if it can't find them using \fB\s-1GCC_EXEC_PREFIX\s0\fR. Linking
+using \s-1GCC\s0 also uses these directories when searching for ordinary
+libraries for the \fB\-l\fR option (but directories specified with
+\&\fB\-L\fR come first).
+.IP "\fB\s-1LANG\s0\fR" 4
+.IX Item "LANG"
+This variable is used to pass locale information to the compiler. One way in
+which this information is used is to determine the character set to be used
+when character literals, string literals and comments are parsed in C and \*(C+.
+When the compiler is configured to allow multibyte characters,
+the following values for \fB\s-1LANG\s0\fR are recognized:
+.RS 4
+.IP "\fBC\-JIS\fR" 4
+.IX Item "C-JIS"
+Recognize \s-1JIS\s0 characters.
+.IP "\fBC\-SJIS\fR" 4
+.IX Item "C-SJIS"
+Recognize \s-1SJIS\s0 characters.
+.IP "\fBC\-EUCJP\fR" 4
+.IX Item "C-EUCJP"
+Recognize \s-1EUCJP\s0 characters.
+.RE
+.RS 4
+.Sp
+If \fB\s-1LANG\s0\fR is not defined, or if it has some other value, then the
+compiler will use mblen and mbtowc as defined by the default locale to
+recognize and translate multibyte characters.
+.RE
+.PP
+Some additional environments variables affect the behavior of the
+preprocessor.
+.IP "\fB\s-1CPATH\s0\fR" 4
+.IX Item "CPATH"
+.PD 0
+.IP "\fBC_INCLUDE_PATH\fR" 4
+.IX Item "C_INCLUDE_PATH"
+.IP "\fB\s-1CPLUS_INCLUDE_PATH\s0\fR" 4
+.IX Item "CPLUS_INCLUDE_PATH"
+.IP "\fB\s-1OBJC_INCLUDE_PATH\s0\fR" 4
+.IX Item "OBJC_INCLUDE_PATH"
+.PD
+Each variable's value is a list of directories separated by a special
+character, much like \fB\s-1PATH\s0\fR, in which to look for header files.
+The special character, \f(CW\*(C`PATH_SEPARATOR\*(C'\fR, is target-dependent and
+determined at \s-1GCC\s0 build time. For Microsoft Windows-based targets it is a
+semicolon, and for almost all other targets it is a colon.
+.Sp
+\&\fB\s-1CPATH\s0\fR specifies a list of directories to be searched as if
+specified with \fB\-I\fR, but after any paths given with \fB\-I\fR
+options on the command line. This environment variable is used
+regardless of which language is being preprocessed.
+.Sp
+The remaining environment variables apply only when preprocessing the
+particular language indicated. Each specifies a list of directories
+to be searched as if specified with \fB\-isystem\fR, but after any
+paths given with \fB\-isystem\fR options on the command line.
+.Sp
+In all these variables, an empty element instructs the compiler to
+search its current working directory. Empty elements can appear at the
+beginning or end of a path. For instance, if the value of
+\&\fB\s-1CPATH\s0\fR is \f(CW\*(C`:/special/include\*(C'\fR, that has the same
+effect as \fB\-I.\ \-I/special/include\fR.
+.IP "\fB\s-1DEPENDENCIES_OUTPUT\s0\fR" 4
+.IX Item "DEPENDENCIES_OUTPUT"
+If this variable is set, its value specifies how to output
+dependencies for Make based on the non-system header files processed
+by the compiler. System header files are ignored in the dependency
+output.
+.Sp
+The value of \fB\s-1DEPENDENCIES_OUTPUT\s0\fR can be just a file name, in
+which case the Make rules are written to that file, guessing the target
+name from the source file name. Or the value can have the form
+\&\fIfile\fR\fB \fR\fItarget\fR, in which case the rules are written to
+file \fIfile\fR using \fItarget\fR as the target name.
+.Sp
+In other words, this environment variable is equivalent to combining
+the options \fB\-MM\fR and \fB\-MF\fR,
+with an optional \fB\-MT\fR switch too.
+.IP "\fB\s-1SUNPRO_DEPENDENCIES\s0\fR" 4
+.IX Item "SUNPRO_DEPENDENCIES"
+This variable is the same as \fB\s-1DEPENDENCIES_OUTPUT\s0\fR (see above),
+except that system header files are not ignored, so it implies
+\&\fB\-M\fR rather than \fB\-MM\fR. However, the dependence on the
+main input file is omitted.
+.SH "BUGS"
+.IX Header "BUGS"
+For instructions on reporting bugs, see
+<\fBhttp://bugs.buildroot.net/\fR>.
+.SH "FOOTNOTES"
+.IX Header "FOOTNOTES"
+.IP "1." 4
+On some systems, \fBgcc \-shared\fR
+needs to build supplementary stub code for constructors to work. On
+multi-libbed systems, \fBgcc \-shared\fR must select the correct support
+libraries to link against. Failing to supply the correct flags may lead
+to subtle defects. Supplying them in cases where they are not necessary
+is innocuous.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fIgpl\fR\|(7), \fIgfdl\fR\|(7), \fIfsf\-funding\fR\|(7),
+\&\fIcpp\fR\|(1), \fIgcov\fR\|(1), \fIas\fR\|(1), \fIld\fR\|(1), \fIgdb\fR\|(1), \fIadb\fR\|(1), \fIdbx\fR\|(1), \fIsdb\fR\|(1)
+and the Info entries for \fIgcc\fR, \fIcpp\fR, \fIas\fR,
+\&\fIld\fR, \fIbinutils\fR and \fIgdb\fR.
+.SH "AUTHOR"
+.IX Header "AUTHOR"
+See the Info entry for \fBgcc\fR, or
+<\fBhttp://gcc.gnu.org/onlinedocs/gcc/Contributors.html\fR>,
+for contributors to \s-1GCC\s0.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being \*(L"\s-1GNU\s0 General Public License\*(R" and \*(L"Funding
+Free Software\*(R", the Front-Cover texts being (a) (see below), and with
+the Back-Cover Texts being (b) (see below). A copy of the license is
+included in the \fIgfdl\fR\|(7) man page.
+.PP
+(a) The \s-1FSF\s0's Front-Cover Text is:
+.PP
+.Vb 1
+\& A GNU Manual
+.Ve
+.PP
+(b) The \s-1FSF\s0's Back-Cover Text is:
+.PP
+.Vb 3
+\& You have freedom to copy and modify this GNU Manual, like GNU
+\& software. Copies published by the Free Software Foundation raise
+\& funds for GNU development.
+.Ve
+.SH "POD ERRORS"
+.IX Header "POD ERRORS"
+Hey! \fBThe above document had some coding errors, which are explained below:\fR
+.IP "Around line 8736:" 4
+.IX Item "Around line 8736:"
+You can't have =items (as at line 8749) unless the first thing after the =over is an =item
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/man/man1/mips-linux-uclibc-gcov.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/man/man1/mips-linux-uclibc-gcov.1
new file mode 100644
index 0000000..f334e9b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/man/man1/mips-linux-uclibc-gcov.1
@@ -0,0 +1,635 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.07)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "GCOV 1"
+.TH GCOV 1 "2009-10-15" "gcc-4.4.2" "GNU"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+gcov \- coverage testing tool
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+gcov [\fB\-v\fR|\fB\-\-version\fR] [\fB\-h\fR|\fB\-\-help\fR]
+ [\fB\-a\fR|\fB\-\-all\-blocks\fR]
+ [\fB\-b\fR|\fB\-\-branch\-probabilities\fR]
+ [\fB\-c\fR|\fB\-\-branch\-counts\fR]
+ [\fB\-n\fR|\fB\-\-no\-output\fR]
+ [\fB\-l\fR|\fB\-\-long\-file\-names\fR]
+ [\fB\-p\fR|\fB\-\-preserve\-paths\fR]
+ [\fB\-f\fR|\fB\-\-function\-summaries\fR]
+ [\fB\-o\fR|\fB\-\-object\-directory\fR \fIdirectory|file\fR] \fIsourcefiles\fR
+ [\fB\-u\fR|\fB\-\-unconditional\-branches\fR]
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+\&\fBgcov\fR is a test coverage program. Use it in concert with \s-1GCC\s0
+to analyze your programs to help create more efficient, faster running
+code and to discover untested parts of your program. You can use
+\&\fBgcov\fR as a profiling tool to help discover where your
+optimization efforts will best affect your code. You can also use
+\&\fBgcov\fR along with the other profiling tool, \fBgprof\fR, to
+assess which parts of your code use the greatest amount of computing
+time.
+.PP
+Profiling tools help you analyze your code's performance. Using a
+profiler such as \fBgcov\fR or \fBgprof\fR, you can find out some
+basic performance statistics, such as:
+.IP "\(bu" 4
+how often each line of code executes
+.IP "\(bu" 4
+what lines of code are actually executed
+.IP "\(bu" 4
+how much computing time each section of code uses
+.PP
+Once you know these things about how your code works when compiled, you
+can look at each module to see which modules should be optimized.
+\&\fBgcov\fR helps you determine where to work on optimization.
+.PP
+Software developers also use coverage testing in concert with
+testsuites, to make sure software is actually good enough for a release.
+Testsuites can verify that a program works as expected; a coverage
+program tests to see how much of the program is exercised by the
+testsuite. Developers can then determine what kinds of test cases need
+to be added to the testsuites to create both better testing and a better
+final product.
+.PP
+You should compile your code without optimization if you plan to use
+\&\fBgcov\fR because the optimization, by combining some lines of code
+into one function, may not give you as much information as you need to
+look for `hot spots' where the code is using a great deal of computer
+time. Likewise, because \fBgcov\fR accumulates statistics by line (at
+the lowest resolution), it works best with a programming style that
+places only one statement on each line. If you use complicated macros
+that expand to loops or to other control structures, the statistics are
+less helpful\-\-\-they only report on the line where the macro call
+appears. If your complex macros behave like functions, you can replace
+them with inline functions to solve this problem.
+.PP
+\&\fBgcov\fR creates a logfile called \fI\fIsourcefile\fI.gcov\fR which
+indicates how many times each line of a source file \fI\fIsourcefile\fI.c\fR
+has executed. You can use these logfiles along with \fBgprof\fR to aid
+in fine-tuning the performance of your programs. \fBgprof\fR gives
+timing information you can use along with the information you get from
+\&\fBgcov\fR.
+.PP
+\&\fBgcov\fR works only on code compiled with \s-1GCC\s0. It is not
+compatible with any other profiling or test coverage mechanism.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+.IP "\fB\-h\fR" 4
+.IX Item "-h"
+.PD 0
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
+.PD
+Display help about using \fBgcov\fR (on the standard output), and
+exit without doing any further processing.
+.IP "\fB\-v\fR" 4
+.IX Item "-v"
+.PD 0
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+.PD
+Display the \fBgcov\fR version number (on the standard output),
+and exit without doing any further processing.
+.IP "\fB\-a\fR" 4
+.IX Item "-a"
+.PD 0
+.IP "\fB\-\-all\-blocks\fR" 4
+.IX Item "--all-blocks"
+.PD
+Write individual execution counts for every basic block. Normally gcov
+outputs execution counts only for the main blocks of a line. With this
+option you can determine if blocks within a single line are not being
+executed.
+.IP "\fB\-b\fR" 4
+.IX Item "-b"
+.PD 0
+.IP "\fB\-\-branch\-probabilities\fR" 4
+.IX Item "--branch-probabilities"
+.PD
+Write branch frequencies to the output file, and write branch summary
+info to the standard output. This option allows you to see how often
+each branch in your program was taken. Unconditional branches will not
+be shown, unless the \fB\-u\fR option is given.
+.IP "\fB\-c\fR" 4
+.IX Item "-c"
+.PD 0
+.IP "\fB\-\-branch\-counts\fR" 4
+.IX Item "--branch-counts"
+.PD
+Write branch frequencies as the number of branches taken, rather than
+the percentage of branches taken.
+.IP "\fB\-n\fR" 4
+.IX Item "-n"
+.PD 0
+.IP "\fB\-\-no\-output\fR" 4
+.IX Item "--no-output"
+.PD
+Do not create the \fBgcov\fR output file.
+.IP "\fB\-l\fR" 4
+.IX Item "-l"
+.PD 0
+.IP "\fB\-\-long\-file\-names\fR" 4
+.IX Item "--long-file-names"
+.PD
+Create long file names for included source files. For example, if the
+header file \fIx.h\fR contains code, and was included in the file
+\&\fIa.c\fR, then running \fBgcov\fR on the file \fIa.c\fR will produce
+an output file called \fIa.c##x.h.gcov\fR instead of \fIx.h.gcov\fR.
+This can be useful if \fIx.h\fR is included in multiple source
+files. If you use the \fB\-p\fR option, both the including and
+included file names will be complete path names.
+.IP "\fB\-p\fR" 4
+.IX Item "-p"
+.PD 0
+.IP "\fB\-\-preserve\-paths\fR" 4
+.IX Item "--preserve-paths"
+.PD
+Preserve complete path information in the names of generated
+\&\fI.gcov\fR files. Without this option, just the filename component is
+used. With this option, all directories are used, with \fB/\fR characters
+translated to \fB#\fR characters, \fI.\fR directory components
+removed and \fI..\fR
+components renamed to \fB^\fR. This is useful if sourcefiles are in several
+different directories. It also affects the \fB\-l\fR option.
+.IP "\fB\-f\fR" 4
+.IX Item "-f"
+.PD 0
+.IP "\fB\-\-function\-summaries\fR" 4
+.IX Item "--function-summaries"
+.PD
+Output summaries for each function in addition to the file level summary.
+.IP "\fB\-o\fR \fIdirectory|file\fR" 4
+.IX Item "-o directory|file"
+.PD 0
+.IP "\fB\-\-object\-directory\fR \fIdirectory\fR" 4
+.IX Item "--object-directory directory"
+.IP "\fB\-\-object\-file\fR \fIfile\fR" 4
+.IX Item "--object-file file"
+.PD
+Specify either the directory containing the gcov data files, or the
+object path name. The \fI.gcno\fR, and
+\&\fI.gcda\fR data files are searched for using this option. If a directory
+is specified, the data files are in that directory and named after the
+source file name, without its extension. If a file is specified here,
+the data files are named after that file, without its extension. If this
+option is not supplied, it defaults to the current directory.
+.IP "\fB\-u\fR" 4
+.IX Item "-u"
+.PD 0
+.IP "\fB\-\-unconditional\-branches\fR" 4
+.IX Item "--unconditional-branches"
+.PD
+When branch probabilities are given, include those of unconditional branches.
+Unconditional branches are normally not interesting.
+.PP
+\&\fBgcov\fR should be run with the current directory the same as that
+when you invoked the compiler. Otherwise it will not be able to locate
+the source files. \fBgcov\fR produces files called
+\&\fI\fImangledname\fI.gcov\fR in the current directory. These contain
+the coverage information of the source file they correspond to.
+One \fI.gcov\fR file is produced for each source file containing code,
+which was compiled to produce the data files. The \fImangledname\fR part
+of the output file name is usually simply the source file name, but can
+be something more complicated if the \fB\-l\fR or \fB\-p\fR options are
+given. Refer to those options for details.
+.PP
+The \fI.gcov\fR files contain the \fB:\fR separated fields along with
+program source code. The format is
+.PP
+.Vb 1
+\& <execution_count>:<line_number>:<source line text>
+.Ve
+.PP
+Additional block information may succeed each line, when requested by
+command line option. The \fIexecution_count\fR is \fB\-\fR for lines
+containing no code and \fB#####\fR for lines which were never executed.
+Some lines of information at the start have \fIline_number\fR of zero.
+.PP
+The preamble lines are of the form
+.PP
+.Vb 1
+\& \-:0:<tag>:<value>
+.Ve
+.PP
+The ordering and number of these preamble lines will be augmented as
+\&\fBgcov\fR development progresses \-\-\- do not rely on them remaining
+unchanged. Use \fItag\fR to locate a particular preamble line.
+.PP
+The additional block information is of the form
+.PP
+.Vb 1
+\& <tag> <information>
+.Ve
+.PP
+The \fIinformation\fR is human readable, but designed to be simple
+enough for machine parsing too.
+.PP
+When printing percentages, 0% and 100% are only printed when the values
+are \fIexactly\fR 0% and 100% respectively. Other values which would
+conventionally be rounded to 0% or 100% are instead printed as the
+nearest non-boundary value.
+.PP
+When using \fBgcov\fR, you must first compile your program with two
+special \s-1GCC\s0 options: \fB\-fprofile\-arcs \-ftest\-coverage\fR.
+This tells the compiler to generate additional information needed by
+gcov (basically a flow graph of the program) and also includes
+additional code in the object files for generating the extra profiling
+information needed by gcov. These additional files are placed in the
+directory where the object file is located.
+.PP
+Running the program will cause profile output to be generated. For each
+source file compiled with \fB\-fprofile\-arcs\fR, an accompanying
+\&\fI.gcda\fR file will be placed in the object file directory.
+.PP
+Running \fBgcov\fR with your program's source file names as arguments
+will now produce a listing of the code along with frequency of execution
+for each line. For example, if your program is called \fItmp.c\fR, this
+is what you see when you use the basic \fBgcov\fR facility:
+.PP
+.Vb 5
+\& $ gcc \-fprofile\-arcs \-ftest\-coverage tmp.c
+\& $ a.out
+\& $ gcov tmp.c
+\& 90.00% of 10 source lines executed in file tmp.c
+\& Creating tmp.c.gcov.
+.Ve
+.PP
+The file \fItmp.c.gcov\fR contains output from \fBgcov\fR.
+Here is a sample:
+.PP
+.Vb 10
+\& \-: 0:Source:tmp.c
+\& \-: 0:Graph:tmp.gcno
+\& \-: 0:Data:tmp.gcda
+\& \-: 0:Runs:1
+\& \-: 0:Programs:1
+\& \-: 1:#include <stdio.h>
+\& \-: 2:
+\& \-: 3:int main (void)
+\& 1: 4:{
+\& 1: 5: int i, total;
+\& \-: 6:
+\& 1: 7: total = 0;
+\& \-: 8:
+\& 11: 9: for (i = 0; i < 10; i++)
+\& 10: 10: total += i;
+\& \-: 11:
+\& 1: 12: if (total != 45)
+\& #####: 13: printf ("Failure\en");
+\& \-: 14: else
+\& 1: 15: printf ("Success\en");
+\& 1: 16: return 0;
+\& \-: 17:}
+.Ve
+.PP
+When you use the \fB\-a\fR option, you will get individual block
+counts, and the output looks like this:
+.PP
+.Vb 10
+\& \-: 0:Source:tmp.c
+\& \-: 0:Graph:tmp.gcno
+\& \-: 0:Data:tmp.gcda
+\& \-: 0:Runs:1
+\& \-: 0:Programs:1
+\& \-: 1:#include <stdio.h>
+\& \-: 2:
+\& \-: 3:int main (void)
+\& 1: 4:{
+\& 1: 4\-block 0
+\& 1: 5: int i, total;
+\& \-: 6:
+\& 1: 7: total = 0;
+\& \-: 8:
+\& 11: 9: for (i = 0; i < 10; i++)
+\& 11: 9\-block 0
+\& 10: 10: total += i;
+\& 10: 10\-block 0
+\& \-: 11:
+\& 1: 12: if (total != 45)
+\& 1: 12\-block 0
+\& #####: 13: printf ("Failure\en");
+\& $$$$$: 13\-block 0
+\& \-: 14: else
+\& 1: 15: printf ("Success\en");
+\& 1: 15\-block 0
+\& 1: 16: return 0;
+\& 1: 16\-block 0
+\& \-: 17:}
+.Ve
+.PP
+In this mode, each basic block is only shown on one line \*(-- the last
+line of the block. A multi-line block will only contribute to the
+execution count of that last line, and other lines will not be shown
+to contain code, unless previous blocks end on those lines.
+The total execution count of a line is shown and subsequent lines show
+the execution counts for individual blocks that end on that line. After each
+block, the branch and call counts of the block will be shown, if the
+\&\fB\-b\fR option is given.
+.PP
+Because of the way \s-1GCC\s0 instruments calls, a call count can be shown
+after a line with no individual blocks.
+As you can see, line 13 contains a basic block that was not executed.
+.PP
+When you use the \fB\-b\fR option, your output looks like this:
+.PP
+.Vb 6
+\& $ gcov \-b tmp.c
+\& 90.00% of 10 source lines executed in file tmp.c
+\& 80.00% of 5 branches executed in file tmp.c
+\& 80.00% of 5 branches taken at least once in file tmp.c
+\& 50.00% of 2 calls executed in file tmp.c
+\& Creating tmp.c.gcov.
+.Ve
+.PP
+Here is a sample of a resulting \fItmp.c.gcov\fR file:
+.PP
+.Vb 10
+\& \-: 0:Source:tmp.c
+\& \-: 0:Graph:tmp.gcno
+\& \-: 0:Data:tmp.gcda
+\& \-: 0:Runs:1
+\& \-: 0:Programs:1
+\& \-: 1:#include <stdio.h>
+\& \-: 2:
+\& \-: 3:int main (void)
+\& function main called 1 returned 1 blocks executed 75%
+\& 1: 4:{
+\& 1: 5: int i, total;
+\& \-: 6:
+\& 1: 7: total = 0;
+\& \-: 8:
+\& 11: 9: for (i = 0; i < 10; i++)
+\& branch 0 taken 91% (fallthrough)
+\& branch 1 taken 9%
+\& 10: 10: total += i;
+\& \-: 11:
+\& 1: 12: if (total != 45)
+\& branch 0 taken 0% (fallthrough)
+\& branch 1 taken 100%
+\& #####: 13: printf ("Failure\en");
+\& call 0 never executed
+\& \-: 14: else
+\& 1: 15: printf ("Success\en");
+\& call 0 called 1 returned 100%
+\& 1: 16: return 0;
+\& \-: 17:}
+.Ve
+.PP
+For each function, a line is printed showing how many times the function
+is called, how many times it returns and what percentage of the
+function's blocks were executed.
+.PP
+For each basic block, a line is printed after the last line of the basic
+block describing the branch or call that ends the basic block. There can
+be multiple branches and calls listed for a single source line if there
+are multiple basic blocks that end on that line. In this case, the
+branches and calls are each given a number. There is no simple way to map
+these branches and calls back to source constructs. In general, though,
+the lowest numbered branch or call will correspond to the leftmost construct
+on the source line.
+.PP
+For a branch, if it was executed at least once, then a percentage
+indicating the number of times the branch was taken divided by the
+number of times the branch was executed will be printed. Otherwise, the
+message \*(L"never executed\*(R" is printed.
+.PP
+For a call, if it was executed at least once, then a percentage
+indicating the number of times the call returned divided by the number
+of times the call was executed will be printed. This will usually be
+100%, but may be less for functions that call \f(CW\*(C`exit\*(C'\fR or \f(CW\*(C`longjmp\*(C'\fR,
+and thus may not return every time they are called.
+.PP
+The execution counts are cumulative. If the example program were
+executed again without removing the \fI.gcda\fR file, the count for the
+number of times each line in the source was executed would be added to
+the results of the previous run(s). This is potentially useful in
+several ways. For example, it could be used to accumulate data over a
+number of program runs as part of a test verification suite, or to
+provide more accurate long-term information over a large number of
+program runs.
+.PP
+The data in the \fI.gcda\fR files is saved immediately before the program
+exits. For each source file compiled with \fB\-fprofile\-arcs\fR, the
+profiling code first attempts to read in an existing \fI.gcda\fR file; if
+the file doesn't match the executable (differing number of basic block
+counts) it will ignore the contents of the file. It then adds in the
+new execution counts and finally writes the data to the file.
+.Sh "Using \fBgcov\fP with \s-1GCC\s0 Optimization"
+.IX Subsection "Using gcov with GCC Optimization"
+If you plan to use \fBgcov\fR to help optimize your code, you must
+first compile your program with two special \s-1GCC\s0 options:
+\&\fB\-fprofile\-arcs \-ftest\-coverage\fR. Aside from that, you can use any
+other \s-1GCC\s0 options; but if you want to prove that every single line
+in your program was executed, you should not compile with optimization
+at the same time. On some machines the optimizer can eliminate some
+simple code lines by combining them with other lines. For example, code
+like this:
+.PP
+.Vb 4
+\& if (a != b)
+\& c = 1;
+\& else
+\& c = 0;
+.Ve
+.PP
+can be compiled into one instruction on some machines. In this case,
+there is no way for \fBgcov\fR to calculate separate execution counts
+for each line because there isn't separate code for each line. Hence
+the \fBgcov\fR output looks like this if you compiled the program with
+optimization:
+.PP
+.Vb 4
+\& 100: 12:if (a != b)
+\& 100: 13: c = 1;
+\& 100: 14:else
+\& 100: 15: c = 0;
+.Ve
+.PP
+The output shows that this block of code, combined by optimization,
+executed 100 times. In one sense this result is correct, because there
+was only one instruction representing all four of these lines. However,
+the output does not indicate how many times the result was 0 and how
+many times the result was 1.
+.PP
+Inlineable functions can create unexpected line counts. Line counts are
+shown for the source code of the inlineable function, but what is shown
+depends on where the function is inlined, or if it is not inlined at all.
+.PP
+If the function is not inlined, the compiler must emit an out of line
+copy of the function, in any object file that needs it. If
+\&\fIfileA.o\fR and \fIfileB.o\fR both contain out of line bodies of a
+particular inlineable function, they will also both contain coverage
+counts for that function. When \fIfileA.o\fR and \fIfileB.o\fR are
+linked together, the linker will, on many systems, select one of those
+out of line bodies for all calls to that function, and remove or ignore
+the other. Unfortunately, it will not remove the coverage counters for
+the unused function body. Hence when instrumented, all but one use of
+that function will show zero counts.
+.PP
+If the function is inlined in several places, the block structure in
+each location might not be the same. For instance, a condition might
+now be calculable at compile time in some instances. Because the
+coverage of all the uses of the inline function will be shown for the
+same source lines, the line counts themselves might seem inconsistent.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fIgpl\fR\|(7), \fIgfdl\fR\|(7), \fIfsf\-funding\fR\|(7), \fIgcc\fR\|(1) and the Info entry for \fIgcc\fR.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+2008 Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being \*(L"\s-1GNU\s0 General Public License\*(R" and \*(L"Funding
+Free Software\*(R", the Front-Cover texts being (a) (see below), and with
+the Back-Cover Texts being (b) (see below). A copy of the license is
+included in the \fIgfdl\fR\|(7) man page.
+.PP
+(a) The \s-1FSF\s0's Front-Cover Text is:
+.PP
+.Vb 1
+\& A GNU Manual
+.Ve
+.PP
+(b) The \s-1FSF\s0's Back-Cover Text is:
+.PP
+.Vb 3
+\& You have freedom to copy and modify this GNU Manual, like GNU
+\& software. Copies published by the Free Software Foundation raise
+\& funds for GNU development.
+.Ve
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/man/man7/fsf-funding.7 b/uclibc-crosstools-gcc-4.4.2-1/usr/man/man7/fsf-funding.7
new file mode 100644
index 0000000..6bf598f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/man/man7/fsf-funding.7
@@ -0,0 +1,192 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.07)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "FSF-FUNDING 7"
+.TH FSF-FUNDING 7 "2009-10-15" "gcc-4.4.2" "GNU"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+fsf\-funding \- Funding Free Software
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+.Sh "Funding Free Software"
+.IX Subsection "Funding Free Software"
+If you want to have more free software a few years from now, it makes
+sense for you to help encourage people to contribute funds for its
+development. The most effective approach known is to encourage
+commercial redistributors to donate.
+.PP
+Users of free software systems can boost the pace of development by
+encouraging for-a-fee distributors to donate part of their selling price
+to free software developers\-\-\-the Free Software Foundation, and others.
+.PP
+The way to convince distributors to do this is to demand it and expect
+it from them. So when you compare distributors, judge them partly by
+how much they give to free software development. Show distributors
+they must compete to be the one who gives the most.
+.PP
+To make this approach work, you must insist on numbers that you can
+compare, such as, \*(L"We will donate ten dollars to the Frobnitz project
+for each disk sold.\*(R" Don't be satisfied with a vague promise, such as
+\&\*(L"A portion of the profits are donated,\*(R" since it doesn't give a basis
+for comparison.
+.PP
+Even a precise fraction \*(L"of the profits from this disk\*(R" is not very
+meaningful, since creative accounting and unrelated business decisions
+can greatly alter what fraction of the sales price counts as profit.
+If the price you pay is \f(CW$50\fR, ten percent of the profit is probably
+less than a dollar; it might be a few cents, or nothing at all.
+.PP
+Some redistributors do development work themselves. This is useful too;
+but to keep everyone honest, you need to inquire how much they do, and
+what kind. Some kinds of development make much more long-term
+difference than others. For example, maintaining a separate version of
+a program contributes very little; maintaining the standard version of a
+program for the whole community contributes much. Easy new ports
+contribute little, since someone else would surely do them; difficult
+ports such as adding a new \s-1CPU\s0 to the \s-1GNU\s0 Compiler Collection contribute more;
+major new features or packages contribute the most.
+.PP
+By establishing the idea that supporting further development is \*(L"the
+proper thing to do\*(R" when distributing free software for a fee, we can
+assure a steady flow of resources into making more free software.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fIgpl\fR\|(7), \fIgfdl\fR\|(7).
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1994 Free Software Foundation, Inc.
+Verbatim copying and redistribution of this section is permitted
+without royalty; alteration is not permitted.
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/man/man7/gfdl.7 b/uclibc-crosstools-gcc-4.4.2-1/usr/man/man7/gfdl.7
new file mode 100644
index 0000000..f87b6bc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/man/man7/gfdl.7
@@ -0,0 +1,591 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.07)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "GFDL 7"
+.TH GFDL 7 "2009-10-15" "gcc-4.4.2" "GNU"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+gfdl \- GNU Free Documentation License
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+.Sh "\s-1GNU\s0 Free Documentation License"
+.IX Subsection "GNU Free Documentation License"
+.Sh "Version 1.2, November 2002"
+.IX Subsection "Version 1.2, November 2002"
+.Vb 2
+\& Copyright (c) 2000,2001,2002 Free Software Foundation, Inc.
+\& 51 Franklin Street, Fifth Floor, Boston, MA 02110\-1301, USA
+\&
+\& Everyone is permitted to copy and distribute verbatim copies
+\& of this license document, but changing it is not allowed.
+.Ve
+.IP "0." 4
+.IX Item "0."
+\&\s-1PREAMBLE\s0
+.Sp
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document \fIfree\fR in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
+.Sp
+This License is a kind of \*(L"copyleft\*(R", which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the \s-1GNU\s0 General Public License, which is a copyleft
+license designed for free software.
+.Sp
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+.IP "1." 4
+.IX Item "1."
+\&\s-1APPLICABILITY\s0 \s-1AND\s0 \s-1DEFINITIONS\s0
+.Sp
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License. Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein. The \*(L"Document\*(R", below,
+refers to any such manual or work. Any member of the public is a
+licensee, and is addressed as \*(L"you\*(R". You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
+.Sp
+A \*(L"Modified Version\*(R" of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+.Sp
+A \*(L"Secondary Section\*(R" is a named appendix or a front-matter section
+of the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall
+subject (or to related matters) and contains nothing that could fall
+directly within that overall subject. (Thus, if the Document is in
+part a textbook of mathematics, a Secondary Section may not explain
+any mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+.Sp
+The \*(L"Invariant Sections\*(R" are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License. If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant. The Document may contain zero
+Invariant Sections. If the Document does not identify any Invariant
+Sections then there are none.
+.Sp
+The \*(L"Cover Texts\*(R" are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License. A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
+.Sp
+A \*(L"Transparent\*(R" copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, that is suitable for revising the document
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text. A copy that is not \*(L"Transparent\*(R" is called \*(L"Opaque\*(R".
+.Sp
+Examples of suitable formats for Transparent copies include plain
+\&\s-1ASCII\s0 without markup, Texinfo input format, LaTeX input
+format, \f(CW@acronym\fR{\s-1SGML\s0} or \f(CW@acronym\fR{\s-1XML\s0} using a publicly available
+\&\f(CW@acronym\fR{\s-1DTD\s0}, and standard-conforming simple \f(CW@acronym\fR{\s-1HTML\s0},
+PostScript or \f(CW@acronym\fR{\s-1PDF\s0} designed for human modification. Examples
+of transparent image formats include \f(CW@acronym\fR{\s-1PNG\s0}, \f(CW@acronym\fR{\s-1XCF\s0} and
+\&\f(CW@acronym\fR{\s-1JPG\s0}. Opaque formats include proprietary formats that can be
+read and edited only by proprietary word processors, \f(CW@acronym\fR{\s-1SGML\s0} or
+\&\f(CW@acronym\fR{\s-1XML\s0} for which the \f(CW@acronym\fR{\s-1DTD\s0} and/or processing tools are
+not generally available, and the machine-generated \f(CW@acronym\fR{\s-1HTML\s0},
+PostScript or \f(CW@acronym\fR{\s-1PDF\s0} produced by some word processors for
+output purposes only.
+.Sp
+The \*(L"Title Page\*(R" means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, \*(L"Title Page\*(R" means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+.Sp
+A section \*(L"Entitled \s-1XYZ\s0\*(R" means a named subunit of the Document whose
+title either is precisely \s-1XYZ\s0 or contains \s-1XYZ\s0 in parentheses following
+text that translates \s-1XYZ\s0 in another language. (Here \s-1XYZ\s0 stands for a
+specific section name mentioned below, such as \*(L"Acknowledgements\*(R",
+\&\*(L"Dedications\*(R", \*(L"Endorsements\*(R", or \*(L"History\*(R".) To \*(L"Preserve the Title\*(R"
+of such a section when you modify the Document means that it remains a
+section \*(L"Entitled \s-1XYZ\s0\*(R" according to this definition.
+.Sp
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document. These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+.IP "2." 4
+.IX Item "2."
+\&\s-1VERBATIM\s0 \s-1COPYING\s0
+.Sp
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+.Sp
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+.IP "3." 4
+.IX Item "3."
+\&\s-1COPYING\s0 \s-1IN\s0 \s-1QUANTITY\s0
+.Sp
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+.Sp
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+.Sp
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
+.Sp
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+.IP "4." 4
+.IX Item "4."
+\&\s-1MODIFICATIONS\s0
+.Sp
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it. In addition, you must do these things in the Modified Version:
+.RS 4
+.IP "A." 4
+.IX Item "A."
+Use in the Title Page (and on the covers, if any) a title distinct
+from that of the Document, and from those of previous versions
+(which should, if there were any, be listed in the History section
+of the Document). You may use the same title as a previous version
+if the original publisher of that version gives permission.
+.IP "B." 4
+.IX Item "B."
+List on the Title Page, as authors, one or more persons or entities
+responsible for authorship of the modifications in the Modified
+Version, together with at least five of the principal authors of the
+Document (all of its principal authors, if it has fewer than five),
+unless they release you from this requirement.
+.IP "C." 4
+.IX Item "C."
+State on the Title page the name of the publisher of the
+Modified Version, as the publisher.
+.IP "D." 4
+.IX Item "D."
+Preserve all the copyright notices of the Document.
+.IP "E." 4
+.IX Item "E."
+Add an appropriate copyright notice for your modifications
+adjacent to the other copyright notices.
+.IP "F." 4
+.IX Item "F."
+Include, immediately after the copyright notices, a license notice
+giving the public permission to use the Modified Version under the
+terms of this License, in the form shown in the Addendum below.
+.IP "G." 4
+.IX Item "G."
+Preserve in that license notice the full lists of Invariant Sections
+and required Cover Texts given in the Document's license notice.
+.IP "H." 4
+.IX Item "H."
+Include an unaltered copy of this License.
+.IP "I." 4
+.IX Item "I."
+Preserve the section Entitled \*(L"History\*(R", Preserve its Title, and add
+to it an item stating at least the title, year, new authors, and
+publisher of the Modified Version as given on the Title Page. If
+there is no section Entitled \*(L"History\*(R" in the Document, create one
+stating the title, year, authors, and publisher of the Document as
+given on its Title Page, then add an item describing the Modified
+Version as stated in the previous sentence.
+.IP "J." 4
+.IX Item "J."
+Preserve the network location, if any, given in the Document for
+public access to a Transparent copy of the Document, and likewise
+the network locations given in the Document for previous versions
+it was based on. These may be placed in the \*(L"History\*(R" section.
+You may omit a network location for a work that was published at
+least four years before the Document itself, or if the original
+publisher of the version it refers to gives permission.
+.IP "K." 4
+.IX Item "K."
+For any section Entitled \*(L"Acknowledgements\*(R" or \*(L"Dedications\*(R", Preserve
+the Title of the section, and preserve in the section all the
+substance and tone of each of the contributor acknowledgements and/or
+dedications given therein.
+.IP "L." 4
+.IX Item "L."
+Preserve all the Invariant Sections of the Document,
+unaltered in their text and in their titles. Section numbers
+or the equivalent are not considered part of the section titles.
+.IP "M." 4
+.IX Item "M."
+Delete any section Entitled \*(L"Endorsements\*(R". Such a section
+may not be included in the Modified Version.
+.IP "N." 4
+.IX Item "N."
+Do not retitle any existing section to be Entitled \*(L"Endorsements\*(R" or
+to conflict in title with any Invariant Section.
+.IP "O." 4
+.IX Item "O."
+Preserve any Warranty Disclaimers.
+.RE
+.RS 4
+.Sp
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant. To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+.Sp
+You may add a section Entitled \*(L"Endorsements\*(R", provided it contains
+nothing but endorsements of your Modified Version by various
+parties\-\-\-for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+.Sp
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version. Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity. If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+.Sp
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+.RE
+.IP "5." 4
+.IX Item "5."
+\&\s-1COMBINING\s0 \s-1DOCUMENTS\s0
+.Sp
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice, and that you preserve all their Warranty Disclaimers.
+.Sp
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy. If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+.Sp
+In the combination, you must combine any sections Entitled \*(L"History\*(R"
+in the various original documents, forming one section Entitled
+\&\*(L"History\*(R"; likewise combine any sections Entitled \*(L"Acknowledgements\*(R",
+and any sections Entitled \*(L"Dedications\*(R". You must delete all
+sections Entitled \*(L"Endorsements.\*(R"
+.IP "6." 4
+.IX Item "6."
+\&\s-1COLLECTIONS\s0 \s-1OF\s0 \s-1DOCUMENTS\s0
+.Sp
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+.Sp
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+.IP "7." 4
+.IX Item "7."
+\&\s-1AGGREGATION\s0 \s-1WITH\s0 \s-1INDEPENDENT\s0 \s-1WORKS\s0
+.Sp
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, is called an \*(L"aggregate\*(R" if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
+.Sp
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+.IP "8." 4
+.IX Item "8."
+\&\s-1TRANSLATION\s0
+.Sp
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections. You may include a
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers. In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+.Sp
+If a section in the Document is Entitled \*(L"Acknowledgements\*(R",
+\&\*(L"Dedications\*(R", or \*(L"History\*(R", the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+.IP "9." 4
+.IX Item "9."
+\&\s-1TERMINATION\s0
+.Sp
+You may not copy, modify, sublicense, or distribute the Document except
+as expressly provided for under this License. Any other attempt to
+copy, modify, sublicense or distribute the Document is void, and will
+automatically terminate your rights under this License. However,
+parties who have received copies, or rights, from you under this
+License will not have their licenses terminated so long as such
+parties remain in full compliance.
+.IP "10." 4
+.IX Item "10."
+\&\s-1FUTURE\s0 \s-1REVISIONS\s0 \s-1OF\s0 \s-1THIS\s0 \s-1LICENSE\s0
+.Sp
+The Free Software Foundation may publish new, revised versions
+of the \s-1GNU\s0 Free Documentation License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns. See
+<\fBhttp://www.gnu.org/copyleft/\fR>.
+.Sp
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License \*(L"or any later version\*(R" applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation. If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.
+.Sh "\s-1ADDENDUM:\s0 How to use this License for your documents"
+.IX Subsection "ADDENDUM: How to use this License for your documents"
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+.PP
+.Vb 7
+\& Copyright (C) <year> <your name>.
+\& Permission is granted to copy, distribute and/or modify this document
+\& under the terms of the GNU Free Documentation License, Version 1.2
+\& or any later version published by the Free Software Foundation;
+\& with no Invariant Sections, no Front\-Cover Texts, and no Back\-Cover
+\& Texts. A copy of the license is included in the section entitled "GNU
+\& Free Documentation License".
+.Ve
+.PP
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the \*(L"with...Texts.\*(R" line with this:
+.PP
+.Vb 3
+\& with the Invariant Sections being <list their titles>, with
+\& the Front\-Cover Texts being <list>, and with the Back\-Cover Texts
+\& being <list>.
+.Ve
+.PP
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+.PP
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the \s-1GNU\s0 General Public License,
+to permit their use in free software.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fIgpl\fR\|(7), \fIfsf\-funding\fR\|(7).
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 2000,2001,2002 Free Software Foundation, Inc.
+51 Franklin Street, Fifth Floor, Boston, \s-1MA\s0 02110\-1301, \s-1USA\s0
+.PP
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/man/man7/gpl.7 b/uclibc-crosstools-gcc-4.4.2-1/usr/man/man7/gpl.7
new file mode 100644
index 0000000..d8d3da3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/man/man7/gpl.7
@@ -0,0 +1,849 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "GPL 7"
+.TH GPL 7 "2010-01-29" "gcc-4.4.2" "GNU"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+gpl \- GNU General Public License
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+.Sh "\s-1GNU\s0 General Public License"
+.IX Subsection "GNU General Public License"
+.Sh "Version 3, 29 June 2007"
+.IX Subsection "Version 3, 29 June 2007"
+.Vb 1
+\& Copyright (c) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+\&
+\& Everyone is permitted to copy and distribute verbatim copies of this
+\& license document, but changing it is not allowed.
+.Ve
+.Sh "Preamble"
+.IX Subsection "Preamble"
+The \s-1GNU\s0 General Public License is a free, copyleft license for
+software and other kinds of works.
+.PP
+The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the \s-1GNU\s0 General Public License is intended to guarantee your freedom
+to share and change all versions of a program\*(--to make sure it remains
+free software for all its users. We, the Free Software Foundation,
+use the \s-1GNU\s0 General Public License for most of our software; it
+applies also to any other work released this way by its authors. You
+can apply it to your programs, too.
+.PP
+When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+.PP
+To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you
+have certain responsibilities if you distribute copies of the
+software, or if you modify it: responsibilities to respect the freedom
+of others.
+.PP
+For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too,
+receive or can get the source code. And you must show them these
+terms so they know their rights.
+.PP
+Developers that use the \s-1GNU\s0 \s-1GPL\s0 protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+.PP
+For the developers' and authors' protection, the \s-1GPL\s0 clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the \s-1GPL\s0 requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+.PP
+Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the
+manufacturer can do so. This is fundamentally incompatible with the
+aim of protecting users' freedom to change the software. The
+systematic pattern of such abuse occurs in the area of products for
+individuals to use, which is precisely where it is most unacceptable.
+Therefore, we have designed this version of the \s-1GPL\s0 to prohibit the
+practice for those products. If such problems arise substantially in
+other domains, we stand ready to extend this provision to those
+domains in future versions of the \s-1GPL\s0, as needed to protect the
+freedom of users.
+.PP
+Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish
+to avoid the special danger that patents applied to a free program
+could make it effectively proprietary. To prevent this, the \s-1GPL\s0
+assures that patents cannot be used to render the program non-free.
+.PP
+The precise terms and conditions for copying, distribution and
+modification follow.
+.Sh "\s-1TERMS\s0 \s-1AND\s0 \s-1CONDITIONS\s0"
+.IX Subsection "TERMS AND CONDITIONS"
+.IP "0. Definitions." 4
+.IX Item "0. Definitions."
+\&\*(L"This License\*(R" refers to version 3 of the \s-1GNU\s0 General Public License.
+.Sp
+\&\*(L"Copyright\*(R" also means copyright-like laws that apply to other kinds
+of works, such as semiconductor masks.
+.Sp
+\&\*(L"The Program\*(R" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as \*(L"you\*(R". \*(L"Licensees\*(R" and
+\&\*(L"recipients\*(R" may be individuals or organizations.
+.Sp
+To \*(L"modify\*(R" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of
+an exact copy. The resulting work is called a \*(L"modified version\*(R" of
+the earlier work or a work \*(L"based on\*(R" the earlier work.
+.Sp
+A \*(L"covered work\*(R" means either the unmodified Program or a work based
+on the Program.
+.Sp
+To \*(L"propagate\*(R" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+.Sp
+To \*(L"convey\*(R" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user
+through a computer network, with no transfer of a copy, is not
+conveying.
+.Sp
+An interactive user interface displays \*(L"Appropriate Legal Notices\*(R" to
+the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+.IP "1. Source Code." 4
+.IX Item "1. Source Code."
+The \*(L"source code\*(R" for a work means the preferred form of the work for
+making modifications to it. \*(L"Object code\*(R" means any non-source form
+of a work.
+.Sp
+A \*(L"Standard Interface\*(R" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+.Sp
+The \*(L"System Libraries\*(R" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+\&\*(L"Major Component\*(R", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+.Sp
+The \*(L"Corresponding Source\*(R" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+.Sp
+The Corresponding Source need not include anything that users can
+regenerate automatically from other parts of the Corresponding Source.
+.Sp
+The Corresponding Source for a work in source code form is that same
+work.
+.IP "2. Basic Permissions." 4
+.IX Item "2. Basic Permissions."
+All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+.Sp
+You may make, run and propagate covered works that you do not convey,
+without conditions so long as your license otherwise remains in force.
+You may convey covered works to others for the sole purpose of having
+them make modifications exclusively for you, or provide you with
+facilities for running those works, provided that you comply with the
+terms of this License in conveying all material for which you do not
+control copyright. Those thus making or running the covered works for
+you must do so exclusively on your behalf, under your direction and
+control, on terms that prohibit them from making any copies of your
+copyrighted material outside their relationship with you.
+.Sp
+Conveying under any other circumstances is permitted solely under the
+conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+.IP "3. Protecting Users' Legal Rights From Anti-Circumvention Law." 4
+.IX Item "3. Protecting Users' Legal Rights From Anti-Circumvention Law."
+No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the \s-1WIPO\s0 copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+.Sp
+When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such
+circumvention is effected by exercising rights under this License with
+respect to the covered work, and you disclaim any intention to limit
+operation or modification of the work as a means of enforcing, against
+the work's users, your or third parties' legal rights to forbid
+circumvention of technological measures.
+.IP "4. Conveying Verbatim Copies." 4
+.IX Item "4. Conveying Verbatim Copies."
+You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+.Sp
+You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+.IP "5. Conveying Modified Source Versions." 4
+.IX Item "5. Conveying Modified Source Versions."
+You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these
+conditions:
+.RS 4
+.IP "a." 4
+.IX Item "a."
+The work must carry prominent notices stating that you modified it,
+and giving a relevant date.
+.IP "b." 4
+.IX Item "b."
+The work must carry prominent notices stating that it is released
+under this License and any conditions added under section 7. This
+requirement modifies the requirement in section 4 to \*(L"keep intact all
+notices\*(R".
+.IP "c." 4
+.IX Item "c."
+You must license the entire work, as a whole, under this License to
+anyone who comes into possession of a copy. This License will
+therefore apply, along with any applicable section 7 additional terms,
+to the whole of the work, and all its parts, regardless of how they
+are packaged. This License gives no permission to license the work in
+any other way, but it does not invalidate such permission if you have
+separately received it.
+.IP "d." 4
+.IX Item "d."
+If the work has interactive user interfaces, each must display
+Appropriate Legal Notices; however, if the Program has interactive
+interfaces that do not display Appropriate Legal Notices, your work
+need not make them do so.
+.RE
+.RS 4
+.Sp
+A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+\&\*(L"aggregate\*(R" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+.RE
+.IP "6. Conveying Non-Source Forms." 4
+.IX Item "6. Conveying Non-Source Forms."
+You may convey a covered work in object code form under the terms of
+sections 4 and 5, provided that you also convey the machine-readable
+Corresponding Source under the terms of this License, in one of these
+ways:
+.RS 4
+.IP "a." 4
+.IX Item "a."
+Convey the object code in, or embodied in, a physical product
+(including a physical distribution medium), accompanied by the
+Corresponding Source fixed on a durable physical medium customarily
+used for software interchange.
+.IP "b." 4
+.IX Item "b."
+Convey the object code in, or embodied in, a physical product
+(including a physical distribution medium), accompanied by a written
+offer, valid for at least three years and valid for as long as you
+offer spare parts or customer support for that product model, to give
+anyone who possesses the object code either (1) a copy of the
+Corresponding Source for all the software in the product that is
+covered by this License, on a durable physical medium customarily used
+for software interchange, for a price no more than your reasonable
+cost of physically performing this conveying of source, or (2) access
+to copy the Corresponding Source from a network server at no charge.
+.IP "c." 4
+.IX Item "c."
+Convey individual copies of the object code with a copy of the written
+offer to provide the Corresponding Source. This alternative is
+allowed only occasionally and noncommercially, and only if you
+received the object code with such an offer, in accord with subsection
+6b.
+.IP "d." 4
+.IX Item "d."
+Convey the object code by offering access from a designated place
+(gratis or for a charge), and offer equivalent access to the
+Corresponding Source in the same way through the same place at no
+further charge. You need not require recipients to copy the
+Corresponding Source along with the object code. If the place to copy
+the object code is a network server, the Corresponding Source may be
+on a different server (operated by you or a third party) that supports
+equivalent copying facilities, provided you maintain clear directions
+next to the object code saying where to find the Corresponding Source.
+Regardless of what server hosts the Corresponding Source, you remain
+obligated to ensure that it is available for as long as needed to
+satisfy these requirements.
+.IP "e." 4
+.IX Item "e."
+Convey the object code using peer-to-peer transmission, provided you
+inform other peers where the object code and Corresponding Source of
+the work are being offered to the general public at no charge under
+subsection 6d.
+.RE
+.RS 4
+.Sp
+A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+.Sp
+A \*(L"User Product\*(R" is either (1) a \*(L"consumer product\*(R", which means any
+tangible personal property which is normally used for personal,
+family, or household purposes, or (2) anything designed or sold for
+incorporation into a dwelling. In determining whether a product is a
+consumer product, doubtful cases shall be resolved in favor of
+coverage. For a particular product received by a particular user,
+\&\*(L"normally used\*(R" refers to a typical or common use of that class of
+product, regardless of the status of the particular user or of the way
+in which the particular user actually uses, or expects or is expected
+to use, the product. A product is a consumer product regardless of
+whether the product has substantial commercial, industrial or
+non-consumer uses, unless such uses represent the only significant
+mode of use of the product.
+.Sp
+\&\*(L"Installation Information\*(R" for a User Product means any methods,
+procedures, authorization keys, or other information required to
+install and execute modified versions of a covered work in that User
+Product from a modified version of its Corresponding Source. The
+information must suffice to ensure that the continued functioning of
+the modified object code is in no case prevented or interfered with
+solely because modification has been made.
+.Sp
+If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in \s-1ROM\s0).
+.Sp
+The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or
+updates for a work that has been modified or installed by the
+recipient, or for the User Product in which it has been modified or
+installed. Access to a network may be denied when the modification
+itself materially and adversely affects the operation of the network
+or violates the rules and protocols for communication across the
+network.
+.Sp
+Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+.RE
+.IP "7. Additional Terms." 4
+.IX Item "7. Additional Terms."
+\&\*(L"Additional permissions\*(R" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+.Sp
+When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+.Sp
+Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders
+of that material) supplement the terms of this License with terms:
+.RS 4
+.IP "a." 4
+.IX Item "a."
+Disclaiming warranty or limiting liability differently from the terms
+of sections 15 and 16 of this License; or
+.IP "b." 4
+.IX Item "b."
+Requiring preservation of specified reasonable legal notices or author
+attributions in that material or in the Appropriate Legal Notices
+displayed by works containing it; or
+.IP "c." 4
+.IX Item "c."
+Prohibiting misrepresentation of the origin of that material, or
+requiring that modified versions of such material be marked in
+reasonable ways as different from the original version; or
+.IP "d." 4
+.IX Item "d."
+Limiting the use for publicity purposes of names of licensors or
+authors of the material; or
+.IP "e." 4
+.IX Item "e."
+Declining to grant rights under trademark law for use of some trade
+names, trademarks, or service marks; or
+.IP "f." 4
+.IX Item "f."
+Requiring indemnification of licensors and authors of that material by
+anyone who conveys the material (or modified versions of it) with
+contractual assumptions of liability to the recipient, for any
+liability that these contractual assumptions directly impose on those
+licensors and authors.
+.RE
+.RS 4
+.Sp
+All other non-permissive additional terms are considered \*(L"further
+restrictions\*(R" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+.Sp
+If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+.Sp
+Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions; the
+above requirements apply either way.
+.RE
+.IP "8. Termination." 4
+.IX Item "8. Termination."
+You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+.Sp
+However, if you cease all violation of this License, then your license
+from a particular copyright holder is reinstated (a) provisionally,
+unless and until the copyright holder explicitly and finally
+terminates your license, and (b) permanently, if the copyright holder
+fails to notify you of the violation by some reasonable means prior to
+60 days after the cessation.
+.Sp
+Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+.Sp
+Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+.IP "9. Acceptance Not Required for Having Copies." 4
+.IX Item "9. Acceptance Not Required for Having Copies."
+You are not required to accept this License in order to receive or run
+a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+.IP "10. Automatic Licensing of Downstream Recipients." 4
+.IX Item "10. Automatic Licensing of Downstream Recipients."
+Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+.Sp
+An \*(L"entity transaction\*(R" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+.Sp
+You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+.IP "11. Patents." 4
+.IX Item "11. Patents."
+A \*(L"contributor\*(R" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's \*(L"contributor version\*(R".
+.Sp
+A contributor's \*(L"essential patent claims\*(R" are all patent claims owned
+or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, \*(L"control\*(R" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+.Sp
+Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+.Sp
+In the following three paragraphs, a \*(L"patent license\*(R" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To \*(L"grant\*(R" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+.Sp
+If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. \*(L"Knowingly relying\*(R" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+.Sp
+If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+.Sp
+A patent license is \*(L"discriminatory\*(R" if it does not include within the
+scope of its coverage, prohibits the exercise of, or is conditioned on
+the non-exercise of one or more of the rights that are specifically
+granted under this License. You may not convey a covered work if you
+are a party to an arrangement with a third party that is in the
+business of distributing software, under which you make payment to the
+third party based on the extent of your activity of conveying the
+work, and under which the third party grants, to any of the parties
+who would receive the covered work from you, a discriminatory patent
+license (a) in connection with copies of the covered work conveyed by
+you (or copies made from those copies), or (b) primarily for and in
+connection with specific products or compilations that contain the
+covered work, unless you entered into that arrangement, or that patent
+license was granted, prior to 28 March 2007.
+.Sp
+Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+.IP "12. No Surrender of Others' Freedom." 4
+.IX Item "12. No Surrender of Others' Freedom."
+If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey
+a covered work so as to satisfy simultaneously your obligations under
+this License and any other pertinent obligations, then as a
+consequence you may not convey it at all. For example, if you agree
+to terms that obligate you to collect a royalty for further conveying
+from those to whom you convey the Program, the only way you could
+satisfy both those terms and this License would be to refrain entirely
+from conveying the Program.
+.IP "13. Use with the \s-1GNU\s0 Affero General Public License." 4
+.IX Item "13. Use with the GNU Affero General Public License."
+Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the \s-1GNU\s0 Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the \s-1GNU\s0 Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+.IP "14. Revised Versions of this License." 4
+.IX Item "14. Revised Versions of this License."
+The Free Software Foundation may publish revised and/or new versions
+of the \s-1GNU\s0 General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+.Sp
+Each version is given a distinguishing version number. If the Program
+specifies that a certain numbered version of the \s-1GNU\s0 General Public
+License \*(L"or any later version\*(R" applies to it, you have the option of
+following the terms and conditions either of that numbered version or
+of any later version published by the Free Software Foundation. If
+the Program does not specify a version number of the \s-1GNU\s0 General
+Public License, you may choose any version ever published by the Free
+Software Foundation.
+.Sp
+If the Program specifies that a proxy can decide which future versions
+of the \s-1GNU\s0 General Public License can be used, that proxy's public
+statement of acceptance of a version permanently authorizes you to
+choose that version for the Program.
+.Sp
+Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+.IP "15. Disclaimer of Warranty." 4
+.IX Item "15. Disclaimer of Warranty."
+\&\s-1THERE\s0 \s-1IS\s0 \s-1NO\s0 \s-1WARRANTY\s0 \s-1FOR\s0 \s-1THE\s0 \s-1PROGRAM\s0, \s-1TO\s0 \s-1THE\s0 \s-1EXTENT\s0 \s-1PERMITTED\s0 \s-1BY\s0
+\&\s-1APPLICABLE\s0 \s-1LAW\s0. \s-1EXCEPT\s0 \s-1WHEN\s0 \s-1OTHERWISE\s0 \s-1STATED\s0 \s-1IN\s0 \s-1WRITING\s0 \s-1THE\s0 \s-1COPYRIGHT\s0
+\&\s-1HOLDERS\s0 \s-1AND/OR\s0 \s-1OTHER\s0 \s-1PARTIES\s0 \s-1PROVIDE\s0 \s-1THE\s0 \s-1PROGRAM\s0 \*(L"\s-1AS\s0 \s-1IS\s0\*(R" \s-1WITHOUT\s0
+\&\s-1WARRANTY\s0 \s-1OF\s0 \s-1ANY\s0 \s-1KIND\s0, \s-1EITHER\s0 \s-1EXPRESSED\s0 \s-1OR\s0 \s-1IMPLIED\s0, \s-1INCLUDING\s0, \s-1BUT\s0 \s-1NOT\s0
+\&\s-1LIMITED\s0 \s-1TO\s0, \s-1THE\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0 \s-1OF\s0 \s-1MERCHANTABILITY\s0 \s-1AND\s0 \s-1FITNESS\s0 \s-1FOR\s0
+A \s-1PARTICULAR\s0 \s-1PURPOSE\s0. \s-1THE\s0 \s-1ENTIRE\s0 \s-1RISK\s0 \s-1AS\s0 \s-1TO\s0 \s-1THE\s0 \s-1QUALITY\s0 \s-1AND\s0
+\&\s-1PERFORMANCE\s0 \s-1OF\s0 \s-1THE\s0 \s-1PROGRAM\s0 \s-1IS\s0 \s-1WITH\s0 \s-1YOU\s0. \s-1SHOULD\s0 \s-1THE\s0 \s-1PROGRAM\s0 \s-1PROVE\s0
+\&\s-1DEFECTIVE\s0, \s-1YOU\s0 \s-1ASSUME\s0 \s-1THE\s0 \s-1COST\s0 \s-1OF\s0 \s-1ALL\s0 \s-1NECESSARY\s0 \s-1SERVICING\s0, \s-1REPAIR\s0 \s-1OR\s0
+\&\s-1CORRECTION\s0.
+.IP "16. Limitation of Liability." 4
+.IX Item "16. Limitation of Liability."
+\&\s-1IN\s0 \s-1NO\s0 \s-1EVENT\s0 \s-1UNLESS\s0 \s-1REQUIRED\s0 \s-1BY\s0 \s-1APPLICABLE\s0 \s-1LAW\s0 \s-1OR\s0 \s-1AGREED\s0 \s-1TO\s0 \s-1IN\s0 \s-1WRITING\s0
+\&\s-1WILL\s0 \s-1ANY\s0 \s-1COPYRIGHT\s0 \s-1HOLDER\s0, \s-1OR\s0 \s-1ANY\s0 \s-1OTHER\s0 \s-1PARTY\s0 \s-1WHO\s0 \s-1MODIFIES\s0 \s-1AND/OR\s0
+\&\s-1CONVEYS\s0 \s-1THE\s0 \s-1PROGRAM\s0 \s-1AS\s0 \s-1PERMITTED\s0 \s-1ABOVE\s0, \s-1BE\s0 \s-1LIABLE\s0 \s-1TO\s0 \s-1YOU\s0 \s-1FOR\s0 \s-1DAMAGES\s0,
+\&\s-1INCLUDING\s0 \s-1ANY\s0 \s-1GENERAL\s0, \s-1SPECIAL\s0, \s-1INCIDENTAL\s0 \s-1OR\s0 \s-1CONSEQUENTIAL\s0 \s-1DAMAGES\s0
+\&\s-1ARISING\s0 \s-1OUT\s0 \s-1OF\s0 \s-1THE\s0 \s-1USE\s0 \s-1OR\s0 \s-1INABILITY\s0 \s-1TO\s0 \s-1USE\s0 \s-1THE\s0 \s-1PROGRAM\s0 (\s-1INCLUDING\s0 \s-1BUT\s0
+\&\s-1NOT\s0 \s-1LIMITED\s0 \s-1TO\s0 \s-1LOSS\s0 \s-1OF\s0 \s-1DATA\s0 \s-1OR\s0 \s-1DATA\s0 \s-1BEING\s0 \s-1RENDERED\s0 \s-1INACCURATE\s0 \s-1OR\s0
+\&\s-1LOSSES\s0 \s-1SUSTAINED\s0 \s-1BY\s0 \s-1YOU\s0 \s-1OR\s0 \s-1THIRD\s0 \s-1PARTIES\s0 \s-1OR\s0 A \s-1FAILURE\s0 \s-1OF\s0 \s-1THE\s0 \s-1PROGRAM\s0
+\&\s-1TO\s0 \s-1OPERATE\s0 \s-1WITH\s0 \s-1ANY\s0 \s-1OTHER\s0 \s-1PROGRAMS\s0), \s-1EVEN\s0 \s-1IF\s0 \s-1SUCH\s0 \s-1HOLDER\s0 \s-1OR\s0 \s-1OTHER\s0
+\&\s-1PARTY\s0 \s-1HAS\s0 \s-1BEEN\s0 \s-1ADVISED\s0 \s-1OF\s0 \s-1THE\s0 \s-1POSSIBILITY\s0 \s-1OF\s0 \s-1SUCH\s0 \s-1DAMAGES\s0.
+.IP "17. Interpretation of Sections 15 and 16." 4
+.IX Item "17. Interpretation of Sections 15 and 16."
+If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+.Sh "\s-1END\s0 \s-1OF\s0 \s-1TERMS\s0 \s-1AND\s0 \s-1CONDITIONS\s0"
+.IX Subsection "END OF TERMS AND CONDITIONS"
+.Sh "How to Apply These Terms to Your New Programs"
+.IX Subsection "How to Apply These Terms to Your New Programs"
+If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these
+terms.
+.PP
+To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the \*(L"copyright\*(R" line and a pointer to where the full notice is found.
+.PP
+.Vb 2
+\& <one line to give the program\*(Aqs name and a brief idea of what it does.>
+\& Copyright (C) <year> <name of author>
+\&
+\& This program is free software: you can redistribute it and/or modify
+\& it under the terms of the GNU General Public License as published by
+\& the Free Software Foundation, either version 3 of the License, or (at
+\& your option) any later version.
+\&
+\& This program is distributed in the hope that it will be useful, but
+\& WITHOUT ANY WARRANTY; without even the implied warranty of
+\& MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+\& General Public License for more details.
+\&
+\& You should have received a copy of the GNU General Public License
+\& along with this program. If not, see <http://www.gnu.org/licenses/>.
+.Ve
+.PP
+Also add information on how to contact you by electronic and paper mail.
+.PP
+If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+.PP
+.Vb 4
+\& <program> Copyright (C) <year> <name of author>
+\& This program comes with ABSOLUTELY NO WARRANTY; for details type "show w".
+\& This is free software, and you are welcome to redistribute it
+\& under certain conditions; type "show c" for details.
+.Ve
+.PP
+The hypothetical commands \fBshow w\fR and \fBshow c\fR should show
+the appropriate parts of the General Public License. Of course, your
+program's commands might be different; for a \s-1GUI\s0 interface, you would
+use an \*(L"about box\*(R".
+.PP
+You should also get your employer (if you work as a programmer) or school,
+if any, to sign a \*(L"copyright disclaimer\*(R" for the program, if necessary.
+For more information on this, and how to apply and follow the \s-1GNU\s0 \s-1GPL\s0, see
+<\fBhttp://www.gnu.org/licenses/\fR>.
+.PP
+The \s-1GNU\s0 General Public License does not permit incorporating your
+program into proprietary programs. If your program is a subroutine
+library, you may consider it more useful to permit linking proprietary
+applications with the library. If this is what you want to do, use
+the \s-1GNU\s0 Lesser General Public License instead of this License. But
+first, please read <\fBhttp://www.gnu.org/philosophy/why\-not\-lgpl.html\fR>.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fIgfdl\fR\|(7), \fIfsf\-funding\fR\|(7).
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 2007 Free Software Foundation, Inc.
+.PP
+Everyone is permitted to copy and distribute verbatim copies of this
+license document, but changing it is not allowed.
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux
new file mode 120000
index 0000000..3368949
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux
@@ -0,0 +1 @@
+mips-linux-uclibc \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/ar b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/ar
new file mode 100755
index 0000000..928c841
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/ar
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/as b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/as
new file mode 100755
index 0000000..79591da
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/as
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/c++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/c++
new file mode 100755
index 0000000..1c9e54e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/c++
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/cc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/cc
new file mode 120000
index 0000000..b08d5af
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/cc
@@ -0,0 +1 @@
+gcc \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/g++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/g++
new file mode 100755
index 0000000..1c9e54e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/g++
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/gcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/gcc
new file mode 100755
index 0000000..c8a2dd3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/gcc
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/gdb b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/gdb
new file mode 120000
index 0000000..880f598
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/gdb
@@ -0,0 +1 @@
+../../bin/mips-linux-uclibc-gdb \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/ld b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/ld
new file mode 100755
index 0000000..268e1f0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/ld
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/nm b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/nm
new file mode 100755
index 0000000..d08ce3e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/nm
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/objcopy b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/objcopy
new file mode 100755
index 0000000..72a06f0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/objcopy
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/objdump b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/objdump
new file mode 100755
index 0000000..40fe1e7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/objdump
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/ranlib b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/ranlib
new file mode 100755
index 0000000..a4cf0e4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/ranlib
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/sstrip b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/sstrip
new file mode 120000
index 0000000..5ce8317
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/sstrip
@@ -0,0 +1 @@
+../../bin/mips-linux-uclibc-sstrip \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/strip b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/strip
new file mode 100755
index 0000000..72fb4aa
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/bin/strip
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/algorithm b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/algorithm
new file mode 100644
index 0000000..cb8488c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/algorithm
@@ -0,0 +1,68 @@
+// <algorithm> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/algorithm
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_ALGORITHM
+#define _GLIBCXX_ALGORITHM 1
+
+#pragma GCC system_header
+
+#include <bits/stl_algobase.h>
+#include <bits/stl_algo.h>
+
+#ifdef _GLIBCXX_PARALLEL
+# include <parallel/algorithm>
+#endif
+
+#endif /* _GLIBCXX_ALGORITHM */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/array b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/array
new file mode 100644
index 0000000..70e7756
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/array
@@ -0,0 +1,60 @@
+// <array> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/array
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_ARRAY
+#define _GLIBCXX_ARRAY 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <bits/stl_algobase.h>
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/array>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/array>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_ARRAY
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/auto_ptr.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/auto_ptr.h
new file mode 100644
index 0000000..4554d7a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/auto_ptr.h
@@ -0,0 +1,292 @@
+// auto_ptr implementation -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file backward/auto_ptr.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_AUTO_PTR_H
+#define _STL_AUTO_PTR_H 1
+
+#include <bits/c++config.h>
+#include <debug/debug.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * A wrapper class to provide auto_ptr with reference semantics.
+ * For example, an auto_ptr can be assigned (or constructed from)
+ * the result of a function which returns an auto_ptr by value.
+ *
+ * All the auto_ptr_ref stuff should happen behind the scenes.
+ */
+ template<typename _Tp1>
+ struct auto_ptr_ref
+ {
+ _Tp1* _M_ptr;
+
+ explicit
+ auto_ptr_ref(_Tp1* __p): _M_ptr(__p) { }
+ } _GLIBCXX_DEPRECATED_ATTR;
+
+
+ /**
+ * @brief A simple smart pointer providing strict ownership semantics.
+ *
+ * The Standard says:
+ * <pre>
+ * An @c auto_ptr owns the object it holds a pointer to. Copying
+ * an @c auto_ptr copies the pointer and transfers ownership to the
+ * destination. If more than one @c auto_ptr owns the same object
+ * at the same time the behavior of the program is undefined.
+ *
+ * The uses of @c auto_ptr include providing temporary
+ * exception-safety for dynamically allocated memory, passing
+ * ownership of dynamically allocated memory to a function, and
+ * returning dynamically allocated memory from a function. @c
+ * auto_ptr does not meet the CopyConstructible and Assignable
+ * requirements for Standard Library <a
+ * href="tables.html#65">container</a> elements and thus
+ * instantiating a Standard Library container with an @c auto_ptr
+ * results in undefined behavior.
+ * </pre>
+ * Quoted from [20.4.5]/3.
+ *
+ * Good examples of what can and cannot be done with auto_ptr can
+ * be found in the libstdc++ testsuite.
+ *
+ * _GLIBCXX_RESOLVE_LIB_DEFECTS
+ * 127. auto_ptr<> conversion issues
+ * These resolutions have all been incorporated.
+ */
+ template<typename _Tp>
+ class auto_ptr
+ {
+ private:
+ _Tp* _M_ptr;
+
+ public:
+ /// The pointed-to type.
+ typedef _Tp element_type;
+
+ /**
+ * @brief An %auto_ptr is usually constructed from a raw pointer.
+ * @param p A pointer (defaults to NULL).
+ *
+ * This object now @e owns the object pointed to by @a p.
+ */
+ explicit
+ auto_ptr(element_type* __p = 0) throw() : _M_ptr(__p) { }
+
+ /**
+ * @brief An %auto_ptr can be constructed from another %auto_ptr.
+ * @param a Another %auto_ptr of the same type.
+ *
+ * This object now @e owns the object previously owned by @a a,
+ * which has given up ownership.
+ */
+ auto_ptr(auto_ptr& __a) throw() : _M_ptr(__a.release()) { }
+
+ /**
+ * @brief An %auto_ptr can be constructed from another %auto_ptr.
+ * @param a Another %auto_ptr of a different but related type.
+ *
+ * A pointer-to-Tp1 must be convertible to a
+ * pointer-to-Tp/element_type.
+ *
+ * This object now @e owns the object previously owned by @a a,
+ * which has given up ownership.
+ */
+ template<typename _Tp1>
+ auto_ptr(auto_ptr<_Tp1>& __a) throw() : _M_ptr(__a.release()) { }
+
+ /**
+ * @brief %auto_ptr assignment operator.
+ * @param a Another %auto_ptr of the same type.
+ *
+ * This object now @e owns the object previously owned by @a a,
+ * which has given up ownership. The object that this one @e
+ * used to own and track has been deleted.
+ */
+ auto_ptr&
+ operator=(auto_ptr& __a) throw()
+ {
+ reset(__a.release());
+ return *this;
+ }
+
+ /**
+ * @brief %auto_ptr assignment operator.
+ * @param a Another %auto_ptr of a different but related type.
+ *
+ * A pointer-to-Tp1 must be convertible to a pointer-to-Tp/element_type.
+ *
+ * This object now @e owns the object previously owned by @a a,
+ * which has given up ownership. The object that this one @e
+ * used to own and track has been deleted.
+ */
+ template<typename _Tp1>
+ auto_ptr&
+ operator=(auto_ptr<_Tp1>& __a) throw()
+ {
+ reset(__a.release());
+ return *this;
+ }
+
+ /**
+ * When the %auto_ptr goes out of scope, the object it owns is
+ * deleted. If it no longer owns anything (i.e., @c get() is
+ * @c NULL), then this has no effect.
+ *
+ * The C++ standard says there is supposed to be an empty throw
+ * specification here, but omitting it is standard conforming. Its
+ * presence can be detected only if _Tp::~_Tp() throws, but this is
+ * prohibited. [17.4.3.6]/2
+ */
+ ~auto_ptr() { delete _M_ptr; }
+
+ /**
+ * @brief Smart pointer dereferencing.
+ *
+ * If this %auto_ptr no longer owns anything, then this
+ * operation will crash. (For a smart pointer, "no longer owns
+ * anything" is the same as being a null pointer, and you know
+ * what happens when you dereference one of those...)
+ */
+ element_type&
+ operator*() const throw()
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
+ return *_M_ptr;
+ }
+
+ /**
+ * @brief Smart pointer dereferencing.
+ *
+ * This returns the pointer itself, which the language then will
+ * automatically cause to be dereferenced.
+ */
+ element_type*
+ operator->() const throw()
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
+ return _M_ptr;
+ }
+
+ /**
+ * @brief Bypassing the smart pointer.
+ * @return The raw pointer being managed.
+ *
+ * You can get a copy of the pointer that this object owns, for
+ * situations such as passing to a function which only accepts
+ * a raw pointer.
+ *
+ * @note This %auto_ptr still owns the memory.
+ */
+ element_type*
+ get() const throw() { return _M_ptr; }
+
+ /**
+ * @brief Bypassing the smart pointer.
+ * @return The raw pointer being managed.
+ *
+ * You can get a copy of the pointer that this object owns, for
+ * situations such as passing to a function which only accepts
+ * a raw pointer.
+ *
+ * @note This %auto_ptr no longer owns the memory. When this object
+ * goes out of scope, nothing will happen.
+ */
+ element_type*
+ release() throw()
+ {
+ element_type* __tmp = _M_ptr;
+ _M_ptr = 0;
+ return __tmp;
+ }
+
+ /**
+ * @brief Forcibly deletes the managed object.
+ * @param p A pointer (defaults to NULL).
+ *
+ * This object now @e owns the object pointed to by @a p. The
+ * previous object has been deleted.
+ */
+ void
+ reset(element_type* __p = 0) throw()
+ {
+ if (__p != _M_ptr)
+ {
+ delete _M_ptr;
+ _M_ptr = __p;
+ }
+ }
+
+ /**
+ * @brief Automatic conversions
+ *
+ * These operations convert an %auto_ptr into and from an auto_ptr_ref
+ * automatically as needed. This allows constructs such as
+ * @code
+ * auto_ptr<Derived> func_returning_auto_ptr(.....);
+ * ...
+ * auto_ptr<Base> ptr = func_returning_auto_ptr(.....);
+ * @endcode
+ */
+ auto_ptr(auto_ptr_ref<element_type> __ref) throw()
+ : _M_ptr(__ref._M_ptr) { }
+
+ auto_ptr&
+ operator=(auto_ptr_ref<element_type> __ref) throw()
+ {
+ if (__ref._M_ptr != this->get())
+ {
+ delete _M_ptr;
+ _M_ptr = __ref._M_ptr;
+ }
+ return *this;
+ }
+
+ template<typename _Tp1>
+ operator auto_ptr_ref<_Tp1>() throw()
+ { return auto_ptr_ref<_Tp1>(this->release()); }
+
+ template<typename _Tp1>
+ operator auto_ptr<_Tp1>() throw()
+ { return auto_ptr<_Tp1>(this->release()); }
+ } _GLIBCXX_DEPRECATED_ATTR;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 541. shared_ptr template assignment and void
+ template<>
+ class auto_ptr<void>
+ {
+ public:
+ typedef void element_type;
+ } _GLIBCXX_DEPRECATED_ATTR;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_AUTO_PTR_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/backward_warning.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/backward_warning.h
new file mode 100644
index 0000000..53df521
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/backward_warning.h
@@ -0,0 +1,56 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef _BACKWARD_BACKWARD_WARNING_H
+#define _BACKWARD_BACKWARD_WARNING_H 1
+
+#ifdef __DEPRECATED
+#warning \
+ This file includes at least one deprecated or antiquated header which \
+ may be removed without further notice at a future date. Please use a \
+ non-deprecated interface with equivalent functionality instead. For a \
+ listing of replacement headers and interfaces, consult the file \
+ backward_warning.h. To disable this warning use -Wno-deprecated.
+
+/*
+ A list of valid replacements is as follows:
+
+ Use: Instead of:
+ <sstream>, basic_stringbuf <strstream>, strstreambuf
+ <sstream>, basic_istringstream <strstream>, istrstream
+ <sstream>, basic_ostringstream <strstream>, ostrstream
+ <sstream>, basic_stringstream <strstream>, strstream
+ <unordered_set>, unordered_set <ext/hash_set>, hash_set
+ <unordered_set>, unordered_multiset <ext/hash_set>, hash_multiset
+ <unordered_map>, unordered_map <ext/hash_map>, hash_map
+ <unordered_map>, unordered_multimap <ext/hash_map>, hash_multimap
+ <functional>, bind <functional>, binder1st
+ <functional>, bind <functional>, binder2nd
+ <functional>, bind <functional>, bind1st
+ <functional>, bind <functional>, bind2nd
+ <memory>, unique_ptr <memory>, auto_ptr
+*/
+
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/binders.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/binders.h
new file mode 100644
index 0000000..9b059ce
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/binders.h
@@ -0,0 +1,168 @@
+// Functor implementations -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file backward/binders.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_BINDERS_H
+#define _GLIBCXX_BINDERS_H 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 20.3.6 binders
+ /** @defgroup binders Binder Classes
+ * @ingroup functors
+ *
+ * Binders turn functions/functors with two arguments into functors with
+ * a single argument, storing an argument to be applied later. For
+ * example, a variable @c B of type @c binder1st is constructed from a
+ * functor @c f and an argument @c x. Later, B's @c operator() is called
+ * with a single argument @c y. The return value is the value of @c f(x,y).
+ * @c B can be "called" with various arguments (y1, y2, ...) and will in
+ * turn call @c f(x,y1), @c f(x,y2), ...
+ *
+ * The function @c bind1st is provided to save some typing. It takes the
+ * function and an argument as parameters, and returns an instance of
+ * @c binder1st.
+ *
+ * The type @c binder2nd and its creator function @c bind2nd do the same
+ * thing, but the stored argument is passed as the second parameter instead
+ * of the first, e.g., @c bind2nd(std::minus<float>,1.3) will create a
+ * functor whose @c operator() accepts a floating-point number, subtracts
+ * 1.3 from it, and returns the result. (If @c bind1st had been used,
+ * the functor would perform "1.3 - x" instead.
+ *
+ * Creator-wrapper functions like @c bind1st are intended to be used in
+ * calling algorithms. Their return values will be temporary objects.
+ * (The goal is to not require you to type names like
+ * @c std::binder1st<std::plus<int>> for declaring a variable to hold the
+ * return value from @c bind1st(std::plus<int>,5).
+ *
+ * These become more useful when combined with the composition functions.
+ *
+ * @{
+ */
+ /// One of the @link binders binder functors@endlink.
+ template<typename _Operation>
+ class binder1st
+ : public unary_function<typename _Operation::second_argument_type,
+ typename _Operation::result_type>
+ {
+ protected:
+ _Operation op;
+ typename _Operation::first_argument_type value;
+
+ public:
+ binder1st(const _Operation& __x,
+ const typename _Operation::first_argument_type& __y)
+ : op(__x), value(__y) { }
+
+ typename _Operation::result_type
+ operator()(const typename _Operation::second_argument_type& __x) const
+ { return op(value, __x); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 109. Missing binders for non-const sequence elements
+ typename _Operation::result_type
+ operator()(typename _Operation::second_argument_type& __x) const
+ { return op(value, __x); }
+ } _GLIBCXX_DEPRECATED_ATTR;
+
+ /// One of the @link binders binder functors@endlink.
+ template<typename _Operation, typename _Tp>
+ inline binder1st<_Operation>
+ bind1st(const _Operation& __fn, const _Tp& __x)
+ {
+ typedef typename _Operation::first_argument_type _Arg1_type;
+ return binder1st<_Operation>(__fn, _Arg1_type(__x));
+ }
+
+ /// One of the @link binders binder functors@endlink.
+ template<typename _Operation>
+ class binder2nd
+ : public unary_function<typename _Operation::first_argument_type,
+ typename _Operation::result_type>
+ {
+ protected:
+ _Operation op;
+ typename _Operation::second_argument_type value;
+
+ public:
+ binder2nd(const _Operation& __x,
+ const typename _Operation::second_argument_type& __y)
+ : op(__x), value(__y) { }
+
+ typename _Operation::result_type
+ operator()(const typename _Operation::first_argument_type& __x) const
+ { return op(__x, value); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 109. Missing binders for non-const sequence elements
+ typename _Operation::result_type
+ operator()(typename _Operation::first_argument_type& __x) const
+ { return op(__x, value); }
+ } _GLIBCXX_DEPRECATED_ATTR;
+
+ /// One of the @link binders binder functors@endlink.
+ template<typename _Operation, typename _Tp>
+ inline binder2nd<_Operation>
+ bind2nd(const _Operation& __fn, const _Tp& __x)
+ {
+ typedef typename _Operation::second_argument_type _Arg2_type;
+ return binder2nd<_Operation>(__fn, _Arg2_type(__x));
+ }
+ /** @} */
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _GLIBCXX_BINDERS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/hash_fun.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/hash_fun.h
new file mode 100644
index 0000000..8cc7a42
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/hash_fun.h
@@ -0,0 +1,167 @@
+// 'struct hash' from SGI -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file backward/hash_fun.h
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _HASH_FUN_H
+#define _HASH_FUN_H 1
+
+#include <cstddef>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+
+ template<class _Key>
+ struct hash { };
+
+ inline size_t
+ __stl_hash_string(const char* __s)
+ {
+ unsigned long __h = 0;
+ for ( ; *__s; ++__s)
+ __h = 5 * __h + *__s;
+ return size_t(__h);
+ }
+
+ template<>
+ struct hash<char*>
+ {
+ size_t
+ operator()(const char* __s) const
+ { return __stl_hash_string(__s); }
+ };
+
+ template<>
+ struct hash<const char*>
+ {
+ size_t
+ operator()(const char* __s) const
+ { return __stl_hash_string(__s); }
+ };
+
+ template<>
+ struct hash<char>
+ {
+ size_t
+ operator()(char __x) const
+ { return __x; }
+ };
+
+ template<>
+ struct hash<unsigned char>
+ {
+ size_t
+ operator()(unsigned char __x) const
+ { return __x; }
+ };
+
+ template<>
+ struct hash<signed char>
+ {
+ size_t
+ operator()(unsigned char __x) const
+ { return __x; }
+ };
+
+ template<>
+ struct hash<short>
+ {
+ size_t
+ operator()(short __x) const
+ { return __x; }
+ };
+
+ template<>
+ struct hash<unsigned short>
+ {
+ size_t
+ operator()(unsigned short __x) const
+ { return __x; }
+ };
+
+ template<>
+ struct hash<int>
+ {
+ size_t
+ operator()(int __x) const
+ { return __x; }
+ };
+
+ template<>
+ struct hash<unsigned int>
+ {
+ size_t
+ operator()(unsigned int __x) const
+ { return __x; }
+ };
+
+ template<>
+ struct hash<long>
+ {
+ size_t
+ operator()(long __x) const
+ { return __x; }
+ };
+
+ template<>
+ struct hash<unsigned long>
+ {
+ size_t
+ operator()(unsigned long __x) const
+ { return __x; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/hash_map b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/hash_map
new file mode 100644
index 0000000..469429c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/hash_map
@@ -0,0 +1,590 @@
+// Hashing map implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2004, 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file backward/hash_map
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _HASH_MAP
+#define _HASH_MAP 1
+
+#include "backward_warning.h"
+#include <bits/c++config.h>
+#include <backward/hashtable.h>
+#include <bits/concept_check.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::equal_to;
+ using std::allocator;
+ using std::pair;
+ using std::_Select1st;
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<class _Key, class _Tp, class _HashFn = hash<_Key>,
+ class _EqualKey = equal_to<_Key>, class _Alloc = allocator<_Tp> >
+ class hash_map
+ {
+ private:
+ typedef hashtable<pair<const _Key, _Tp>,_Key, _HashFn,
+ _Select1st<pair<const _Key, _Tp> >,
+ _EqualKey, _Alloc> _Ht;
+
+ _Ht _M_ht;
+
+ public:
+ typedef typename _Ht::key_type key_type;
+ typedef _Tp data_type;
+ typedef _Tp mapped_type;
+ typedef typename _Ht::value_type value_type;
+ typedef typename _Ht::hasher hasher;
+ typedef typename _Ht::key_equal key_equal;
+
+ typedef typename _Ht::size_type size_type;
+ typedef typename _Ht::difference_type difference_type;
+ typedef typename _Ht::pointer pointer;
+ typedef typename _Ht::const_pointer const_pointer;
+ typedef typename _Ht::reference reference;
+ typedef typename _Ht::const_reference const_reference;
+
+ typedef typename _Ht::iterator iterator;
+ typedef typename _Ht::const_iterator const_iterator;
+
+ typedef typename _Ht::allocator_type allocator_type;
+
+ hasher
+ hash_funct() const
+ { return _M_ht.hash_funct(); }
+
+ key_equal
+ key_eq() const
+ { return _M_ht.key_eq(); }
+
+ allocator_type
+ get_allocator() const
+ { return _M_ht.get_allocator(); }
+
+ hash_map()
+ : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
+
+ explicit
+ hash_map(size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
+
+ hash_map(size_type __n, const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
+
+ hash_map(size_type __n, const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a) {}
+
+ template<class _InputIterator>
+ hash_map(_InputIterator __f, _InputIterator __l)
+ : _M_ht(100, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_map(_InputIterator __f, _InputIterator __l, size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a)
+ { _M_ht.insert_unique(__f, __l); }
+
+ size_type
+ size() const
+ { return _M_ht.size(); }
+
+ size_type
+ max_size() const
+ { return _M_ht.max_size(); }
+
+ bool
+ empty() const
+ { return _M_ht.empty(); }
+
+ void
+ swap(hash_map& __hs)
+ { _M_ht.swap(__hs._M_ht); }
+
+ template<class _K1, class _T1, class _HF, class _EqK, class _Al>
+ friend bool
+ operator== (const hash_map<_K1, _T1, _HF, _EqK, _Al>&,
+ const hash_map<_K1, _T1, _HF, _EqK, _Al>&);
+
+ iterator
+ begin()
+ { return _M_ht.begin(); }
+
+ iterator
+ end()
+ { return _M_ht.end(); }
+
+ const_iterator
+ begin() const
+ { return _M_ht.begin(); }
+
+ const_iterator
+ end() const
+ { return _M_ht.end(); }
+
+ pair<iterator, bool>
+ insert(const value_type& __obj)
+ { return _M_ht.insert_unique(__obj); }
+
+ template<class _InputIterator>
+ void
+ insert(_InputIterator __f, _InputIterator __l)
+ { _M_ht.insert_unique(__f, __l); }
+
+ pair<iterator, bool>
+ insert_noresize(const value_type& __obj)
+ { return _M_ht.insert_unique_noresize(__obj); }
+
+ iterator
+ find(const key_type& __key)
+ { return _M_ht.find(__key); }
+
+ const_iterator
+ find(const key_type& __key) const
+ { return _M_ht.find(__key); }
+
+ _Tp&
+ operator[](const key_type& __key)
+ { return _M_ht.find_or_insert(value_type(__key, _Tp())).second; }
+
+ size_type
+ count(const key_type& __key) const
+ { return _M_ht.count(__key); }
+
+ pair<iterator, iterator>
+ equal_range(const key_type& __key)
+ { return _M_ht.equal_range(__key); }
+
+ pair<const_iterator, const_iterator>
+ equal_range(const key_type& __key) const
+ { return _M_ht.equal_range(__key); }
+
+ size_type
+ erase(const key_type& __key)
+ {return _M_ht.erase(__key); }
+
+ void
+ erase(iterator __it)
+ { _M_ht.erase(__it); }
+
+ void
+ erase(iterator __f, iterator __l)
+ { _M_ht.erase(__f, __l); }
+
+ void
+ clear()
+ { _M_ht.clear(); }
+
+ void
+ resize(size_type __hint)
+ { _M_ht.resize(__hint); }
+
+ size_type
+ bucket_count() const
+ { return _M_ht.bucket_count(); }
+
+ size_type
+ max_bucket_count() const
+ { return _M_ht.max_bucket_count(); }
+
+ size_type
+ elems_in_bucket(size_type __n) const
+ { return _M_ht.elems_in_bucket(__n); }
+ };
+
+ template<class _Key, class _Tp, class _HashFn, class _EqlKey, class _Alloc>
+ inline bool
+ operator==(const hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm1,
+ const hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm2)
+ { return __hm1._M_ht == __hm2._M_ht; }
+
+ template<class _Key, class _Tp, class _HashFn, class _EqlKey, class _Alloc>
+ inline bool
+ operator!=(const hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm1,
+ const hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm2)
+ { return !(__hm1 == __hm2); }
+
+ template<class _Key, class _Tp, class _HashFn, class _EqlKey, class _Alloc>
+ inline void
+ swap(hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm1,
+ hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm2)
+ { __hm1.swap(__hm2); }
+
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<class _Key, class _Tp,
+ class _HashFn = hash<_Key>,
+ class _EqualKey = equal_to<_Key>,
+ class _Alloc = allocator<_Tp> >
+ class hash_multimap
+ {
+ // concept requirements
+ __glibcxx_class_requires(_Key, _SGIAssignableConcept)
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires3(_HashFn, size_t, _Key, _UnaryFunctionConcept)
+ __glibcxx_class_requires3(_EqualKey, _Key, _Key, _BinaryPredicateConcept)
+
+ private:
+ typedef hashtable<pair<const _Key, _Tp>, _Key, _HashFn,
+ _Select1st<pair<const _Key, _Tp> >, _EqualKey, _Alloc>
+ _Ht;
+
+ _Ht _M_ht;
+
+ public:
+ typedef typename _Ht::key_type key_type;
+ typedef _Tp data_type;
+ typedef _Tp mapped_type;
+ typedef typename _Ht::value_type value_type;
+ typedef typename _Ht::hasher hasher;
+ typedef typename _Ht::key_equal key_equal;
+
+ typedef typename _Ht::size_type size_type;
+ typedef typename _Ht::difference_type difference_type;
+ typedef typename _Ht::pointer pointer;
+ typedef typename _Ht::const_pointer const_pointer;
+ typedef typename _Ht::reference reference;
+ typedef typename _Ht::const_reference const_reference;
+
+ typedef typename _Ht::iterator iterator;
+ typedef typename _Ht::const_iterator const_iterator;
+
+ typedef typename _Ht::allocator_type allocator_type;
+
+ hasher
+ hash_funct() const
+ { return _M_ht.hash_funct(); }
+
+ key_equal
+ key_eq() const
+ { return _M_ht.key_eq(); }
+
+ allocator_type
+ get_allocator() const
+ { return _M_ht.get_allocator(); }
+
+ hash_multimap()
+ : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
+
+ explicit
+ hash_multimap(size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
+
+ hash_multimap(size_type __n, const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
+
+ hash_multimap(size_type __n, const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a) {}
+
+ template<class _InputIterator>
+ hash_multimap(_InputIterator __f, _InputIterator __l)
+ : _M_ht(100, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a)
+ { _M_ht.insert_equal(__f, __l); }
+
+ size_type
+ size() const
+ { return _M_ht.size(); }
+
+ size_type
+ max_size() const
+ { return _M_ht.max_size(); }
+
+ bool
+ empty() const
+ { return _M_ht.empty(); }
+
+ void
+ swap(hash_multimap& __hs)
+ { _M_ht.swap(__hs._M_ht); }
+
+ template<class _K1, class _T1, class _HF, class _EqK, class _Al>
+ friend bool
+ operator==(const hash_multimap<_K1, _T1, _HF, _EqK, _Al>&,
+ const hash_multimap<_K1, _T1, _HF, _EqK, _Al>&);
+
+ iterator
+ begin()
+ { return _M_ht.begin(); }
+
+ iterator
+ end()
+ { return _M_ht.end(); }
+
+ const_iterator
+ begin() const
+ { return _M_ht.begin(); }
+
+ const_iterator
+ end() const
+ { return _M_ht.end(); }
+
+ iterator
+ insert(const value_type& __obj)
+ { return _M_ht.insert_equal(__obj); }
+
+ template<class _InputIterator>
+ void
+ insert(_InputIterator __f, _InputIterator __l)
+ { _M_ht.insert_equal(__f,__l); }
+
+ iterator
+ insert_noresize(const value_type& __obj)
+ { return _M_ht.insert_equal_noresize(__obj); }
+
+ iterator
+ find(const key_type& __key)
+ { return _M_ht.find(__key); }
+
+ const_iterator
+ find(const key_type& __key) const
+ { return _M_ht.find(__key); }
+
+ size_type
+ count(const key_type& __key) const
+ { return _M_ht.count(__key); }
+
+ pair<iterator, iterator>
+ equal_range(const key_type& __key)
+ { return _M_ht.equal_range(__key); }
+
+ pair<const_iterator, const_iterator>
+ equal_range(const key_type& __key) const
+ { return _M_ht.equal_range(__key); }
+
+ size_type
+ erase(const key_type& __key)
+ { return _M_ht.erase(__key); }
+
+ void
+ erase(iterator __it)
+ { _M_ht.erase(__it); }
+
+ void
+ erase(iterator __f, iterator __l)
+ { _M_ht.erase(__f, __l); }
+
+ void
+ clear()
+ { _M_ht.clear(); }
+
+ void
+ resize(size_type __hint)
+ { _M_ht.resize(__hint); }
+
+ size_type
+ bucket_count() const
+ { return _M_ht.bucket_count(); }
+
+ size_type
+ max_bucket_count() const
+ { return _M_ht.max_bucket_count(); }
+
+ size_type
+ elems_in_bucket(size_type __n) const
+ { return _M_ht.elems_in_bucket(__n); }
+ };
+
+ template<class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
+ inline bool
+ operator==(const hash_multimap<_Key, _Tp, _HF, _EqKey, _Alloc>& __hm1,
+ const hash_multimap<_Key, _Tp, _HF, _EqKey, _Alloc>& __hm2)
+ { return __hm1._M_ht == __hm2._M_ht; }
+
+ template<class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
+ inline bool
+ operator!=(const hash_multimap<_Key, _Tp, _HF, _EqKey, _Alloc>& __hm1,
+ const hash_multimap<_Key, _Tp, _HF, _EqKey, _Alloc>& __hm2)
+ { return !(__hm1 == __hm2); }
+
+ template<class _Key, class _Tp, class _HashFn, class _EqlKey, class _Alloc>
+ inline void
+ swap(hash_multimap<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm1,
+ hash_multimap<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm2)
+ { __hm1.swap(__hm2); }
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Specialization of insert_iterator so that it will work for hash_map
+ // and hash_multimap.
+ template<class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc>
+ class insert_iterator<__gnu_cxx::hash_map<_Key, _Tp, _HashFn,
+ _EqKey, _Alloc> >
+ {
+ protected:
+ typedef __gnu_cxx::hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc>
+ _Container;
+ _Container* container;
+
+ public:
+ typedef _Container container_type;
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ insert_iterator(_Container& __x)
+ : container(&__x) {}
+
+ insert_iterator(_Container& __x, typename _Container::iterator)
+ : container(&__x) {}
+
+ insert_iterator<_Container>&
+ operator=(const typename _Container::value_type& __value)
+ {
+ container->insert(__value);
+ return *this;
+ }
+
+ insert_iterator<_Container>&
+ operator*()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++() { return *this; }
+
+ insert_iterator<_Container>&
+ operator++(int)
+ { return *this; }
+ };
+
+ template<class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc>
+ class insert_iterator<__gnu_cxx::hash_multimap<_Key, _Tp, _HashFn,
+ _EqKey, _Alloc> >
+ {
+ protected:
+ typedef __gnu_cxx::hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc>
+ _Container;
+ _Container* container;
+ typename _Container::iterator iter;
+
+ public:
+ typedef _Container container_type;
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ insert_iterator(_Container& __x)
+ : container(&__x) {}
+
+ insert_iterator(_Container& __x, typename _Container::iterator)
+ : container(&__x) {}
+
+ insert_iterator<_Container>&
+ operator=(const typename _Container::value_type& __value)
+ {
+ container->insert(__value);
+ return *this;
+ }
+
+ insert_iterator<_Container>&
+ operator*()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++(int)
+ { return *this; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/hash_set b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/hash_set
new file mode 100644
index 0000000..32fa220
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/hash_set
@@ -0,0 +1,558 @@
+// Hashing set implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2004, 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file backward/hash_set
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _HASH_SET
+#define _HASH_SET 1
+
+#include "backward_warning.h"
+#include <bits/c++config.h>
+#include <backward/hashtable.h>
+#include <bits/concept_check.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::equal_to;
+ using std::allocator;
+ using std::pair;
+ using std::_Identity;
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<class _Value, class _HashFcn = hash<_Value>,
+ class _EqualKey = equal_to<_Value>,
+ class _Alloc = allocator<_Value> >
+ class hash_set
+ {
+ // concept requirements
+ __glibcxx_class_requires(_Value, _SGIAssignableConcept)
+ __glibcxx_class_requires3(_HashFcn, size_t, _Value, _UnaryFunctionConcept)
+ __glibcxx_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept)
+
+ private:
+ typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
+ _EqualKey, _Alloc> _Ht;
+ _Ht _M_ht;
+
+ public:
+ typedef typename _Ht::key_type key_type;
+ typedef typename _Ht::value_type value_type;
+ typedef typename _Ht::hasher hasher;
+ typedef typename _Ht::key_equal key_equal;
+
+ typedef typename _Ht::size_type size_type;
+ typedef typename _Ht::difference_type difference_type;
+ typedef typename _Alloc::pointer pointer;
+ typedef typename _Alloc::const_pointer const_pointer;
+ typedef typename _Alloc::reference reference;
+ typedef typename _Alloc::const_reference const_reference;
+
+ typedef typename _Ht::const_iterator iterator;
+ typedef typename _Ht::const_iterator const_iterator;
+
+ typedef typename _Ht::allocator_type allocator_type;
+
+ hasher
+ hash_funct() const
+ { return _M_ht.hash_funct(); }
+
+ key_equal
+ key_eq() const
+ { return _M_ht.key_eq(); }
+
+ allocator_type
+ get_allocator() const
+ { return _M_ht.get_allocator(); }
+
+ hash_set()
+ : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
+
+ explicit
+ hash_set(size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
+
+ hash_set(size_type __n, const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
+
+ hash_set(size_type __n, const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a) {}
+
+ template<class _InputIterator>
+ hash_set(_InputIterator __f, _InputIterator __l)
+ : _M_ht(100, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_set(_InputIterator __f, _InputIterator __l, size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_set(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_set(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a)
+ { _M_ht.insert_unique(__f, __l); }
+
+ size_type
+ size() const
+ { return _M_ht.size(); }
+
+ size_type
+ max_size() const
+ { return _M_ht.max_size(); }
+
+ bool
+ empty() const
+ { return _M_ht.empty(); }
+
+ void
+ swap(hash_set& __hs)
+ { _M_ht.swap(__hs._M_ht); }
+
+ template<class _Val, class _HF, class _EqK, class _Al>
+ friend bool
+ operator==(const hash_set<_Val, _HF, _EqK, _Al>&,
+ const hash_set<_Val, _HF, _EqK, _Al>&);
+
+ iterator
+ begin() const
+ { return _M_ht.begin(); }
+
+ iterator
+ end() const
+ { return _M_ht.end(); }
+
+ pair<iterator, bool>
+ insert(const value_type& __obj)
+ {
+ pair<typename _Ht::iterator, bool> __p = _M_ht.insert_unique(__obj);
+ return pair<iterator,bool>(__p.first, __p.second);
+ }
+
+ template<class _InputIterator>
+ void
+ insert(_InputIterator __f, _InputIterator __l)
+ { _M_ht.insert_unique(__f, __l); }
+
+ pair<iterator, bool>
+ insert_noresize(const value_type& __obj)
+ {
+ pair<typename _Ht::iterator, bool> __p
+ = _M_ht.insert_unique_noresize(__obj);
+ return pair<iterator, bool>(__p.first, __p.second);
+ }
+
+ iterator
+ find(const key_type& __key) const
+ { return _M_ht.find(__key); }
+
+ size_type
+ count(const key_type& __key) const
+ { return _M_ht.count(__key); }
+
+ pair<iterator, iterator>
+ equal_range(const key_type& __key) const
+ { return _M_ht.equal_range(__key); }
+
+ size_type
+ erase(const key_type& __key)
+ {return _M_ht.erase(__key); }
+
+ void
+ erase(iterator __it)
+ { _M_ht.erase(__it); }
+
+ void
+ erase(iterator __f, iterator __l)
+ { _M_ht.erase(__f, __l); }
+
+ void
+ clear()
+ { _M_ht.clear(); }
+
+ void
+ resize(size_type __hint)
+ { _M_ht.resize(__hint); }
+
+ size_type
+ bucket_count() const
+ { return _M_ht.bucket_count(); }
+
+ size_type
+ max_bucket_count() const
+ { return _M_ht.max_bucket_count(); }
+
+ size_type
+ elems_in_bucket(size_type __n) const
+ { return _M_ht.elems_in_bucket(__n); }
+ };
+
+ template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
+ inline bool
+ operator==(const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { return __hs1._M_ht == __hs2._M_ht; }
+
+ template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
+ inline bool
+ operator!=(const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { return !(__hs1 == __hs2); }
+
+ template<class _Val, class _HashFcn, class _EqualKey, class _Alloc>
+ inline void
+ swap(hash_set<_Val, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ hash_set<_Val, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { __hs1.swap(__hs2); }
+
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<class _Value,
+ class _HashFcn = hash<_Value>,
+ class _EqualKey = equal_to<_Value>,
+ class _Alloc = allocator<_Value> >
+ class hash_multiset
+ {
+ // concept requirements
+ __glibcxx_class_requires(_Value, _SGIAssignableConcept)
+ __glibcxx_class_requires3(_HashFcn, size_t, _Value, _UnaryFunctionConcept)
+ __glibcxx_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept)
+
+ private:
+ typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
+ _EqualKey, _Alloc> _Ht;
+ _Ht _M_ht;
+
+ public:
+ typedef typename _Ht::key_type key_type;
+ typedef typename _Ht::value_type value_type;
+ typedef typename _Ht::hasher hasher;
+ typedef typename _Ht::key_equal key_equal;
+
+ typedef typename _Ht::size_type size_type;
+ typedef typename _Ht::difference_type difference_type;
+ typedef typename _Alloc::pointer pointer;
+ typedef typename _Alloc::const_pointer const_pointer;
+ typedef typename _Alloc::reference reference;
+ typedef typename _Alloc::const_reference const_reference;
+
+ typedef typename _Ht::const_iterator iterator;
+ typedef typename _Ht::const_iterator const_iterator;
+
+ typedef typename _Ht::allocator_type allocator_type;
+
+ hasher
+ hash_funct() const
+ { return _M_ht.hash_funct(); }
+
+ key_equal
+ key_eq() const
+ { return _M_ht.key_eq(); }
+
+ allocator_type
+ get_allocator() const
+ { return _M_ht.get_allocator(); }
+
+ hash_multiset()
+ : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
+
+ explicit
+ hash_multiset(size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
+
+ hash_multiset(size_type __n, const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
+
+ hash_multiset(size_type __n, const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a) {}
+
+ template<class _InputIterator>
+ hash_multiset(_InputIterator __f, _InputIterator __l)
+ : _M_ht(100, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a)
+ { _M_ht.insert_equal(__f, __l); }
+
+ size_type
+ size() const
+ { return _M_ht.size(); }
+
+ size_type
+ max_size() const
+ { return _M_ht.max_size(); }
+
+ bool
+ empty() const
+ { return _M_ht.empty(); }
+
+ void
+ swap(hash_multiset& hs)
+ { _M_ht.swap(hs._M_ht); }
+
+ template<class _Val, class _HF, class _EqK, class _Al>
+ friend bool
+ operator==(const hash_multiset<_Val, _HF, _EqK, _Al>&,
+ const hash_multiset<_Val, _HF, _EqK, _Al>&);
+
+ iterator
+ begin() const
+ { return _M_ht.begin(); }
+
+ iterator
+ end() const
+ { return _M_ht.end(); }
+
+ iterator
+ insert(const value_type& __obj)
+ { return _M_ht.insert_equal(__obj); }
+
+ template<class _InputIterator>
+ void
+ insert(_InputIterator __f, _InputIterator __l)
+ { _M_ht.insert_equal(__f,__l); }
+
+ iterator
+ insert_noresize(const value_type& __obj)
+ { return _M_ht.insert_equal_noresize(__obj); }
+
+ iterator
+ find(const key_type& __key) const
+ { return _M_ht.find(__key); }
+
+ size_type
+ count(const key_type& __key) const
+ { return _M_ht.count(__key); }
+
+ pair<iterator, iterator>
+ equal_range(const key_type& __key) const
+ { return _M_ht.equal_range(__key); }
+
+ size_type
+ erase(const key_type& __key)
+ { return _M_ht.erase(__key); }
+
+ void
+ erase(iterator __it)
+ { _M_ht.erase(__it); }
+
+ void
+ erase(iterator __f, iterator __l)
+ { _M_ht.erase(__f, __l); }
+
+ void
+ clear()
+ { _M_ht.clear(); }
+
+ void
+ resize(size_type __hint)
+ { _M_ht.resize(__hint); }
+
+ size_type
+ bucket_count() const
+ { return _M_ht.bucket_count(); }
+
+ size_type
+ max_bucket_count() const
+ { return _M_ht.max_bucket_count(); }
+
+ size_type
+ elems_in_bucket(size_type __n) const
+ { return _M_ht.elems_in_bucket(__n); }
+ };
+
+ template<class _Val, class _HashFcn, class _EqualKey, class _Alloc>
+ inline bool
+ operator==(const hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ const hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { return __hs1._M_ht == __hs2._M_ht; }
+
+ template<class _Val, class _HashFcn, class _EqualKey, class _Alloc>
+ inline bool
+ operator!=(const hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ const hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { return !(__hs1 == __hs2); }
+
+ template<class _Val, class _HashFcn, class _EqualKey, class _Alloc>
+ inline void
+ swap(hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { __hs1.swap(__hs2); }
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Specialization of insert_iterator so that it will work for hash_set
+ // and hash_multiset.
+ template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
+ class insert_iterator<__gnu_cxx::hash_set<_Value, _HashFcn,
+ _EqualKey, _Alloc> >
+ {
+ protected:
+ typedef __gnu_cxx::hash_set<_Value, _HashFcn, _EqualKey, _Alloc>
+ _Container;
+ _Container* container;
+
+ public:
+ typedef _Container container_type;
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ insert_iterator(_Container& __x)
+ : container(&__x) {}
+
+ insert_iterator(_Container& __x, typename _Container::iterator)
+ : container(&__x) {}
+
+ insert_iterator<_Container>&
+ operator=(const typename _Container::value_type& __value)
+ {
+ container->insert(__value);
+ return *this;
+ }
+
+ insert_iterator<_Container>&
+ operator*()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++(int)
+ { return *this; }
+ };
+
+ template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
+ class insert_iterator<__gnu_cxx::hash_multiset<_Value, _HashFcn,
+ _EqualKey, _Alloc> >
+ {
+ protected:
+ typedef __gnu_cxx::hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc>
+ _Container;
+ _Container* container;
+ typename _Container::iterator iter;
+
+ public:
+ typedef _Container container_type;
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ insert_iterator(_Container& __x)
+ : container(&__x) {}
+
+ insert_iterator(_Container& __x, typename _Container::iterator)
+ : container(&__x) {}
+
+ insert_iterator<_Container>&
+ operator=(const typename _Container::value_type& __value)
+ {
+ container->insert(__value);
+ return *this;
+ }
+
+ insert_iterator<_Container>&
+ operator*()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++(int) { return *this; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/hashtable.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/hashtable.h
new file mode 100644
index 0000000..70edbd2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/hashtable.h
@@ -0,0 +1,1125 @@
+// Hashtable implementation used by containers -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file backward/hashtable.h
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _HASHTABLE_H
+#define _HASHTABLE_H 1
+
+// Hashtable class, used to implement the hashed associative containers
+// hash_set, hash_map, hash_multiset, and hash_multimap.
+
+#include <vector>
+#include <iterator>
+#include <algorithm>
+#include <bits/stl_function.h>
+#include <backward/hash_fun.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+ using std::ptrdiff_t;
+ using std::forward_iterator_tag;
+ using std::input_iterator_tag;
+ using std::_Construct;
+ using std::_Destroy;
+ using std::distance;
+ using std::vector;
+ using std::pair;
+ using std::__iterator_category;
+
+ template<class _Val>
+ struct _Hashtable_node
+ {
+ _Hashtable_node* _M_next;
+ _Val _M_val;
+ };
+
+ template<class _Val, class _Key, class _HashFcn, class _ExtractKey,
+ class _EqualKey, class _Alloc = std::allocator<_Val> >
+ class hashtable;
+
+ template<class _Val, class _Key, class _HashFcn,
+ class _ExtractKey, class _EqualKey, class _Alloc>
+ struct _Hashtable_iterator;
+
+ template<class _Val, class _Key, class _HashFcn,
+ class _ExtractKey, class _EqualKey, class _Alloc>
+ struct _Hashtable_const_iterator;
+
+ template<class _Val, class _Key, class _HashFcn,
+ class _ExtractKey, class _EqualKey, class _Alloc>
+ struct _Hashtable_iterator
+ {
+ typedef hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>
+ _Hashtable;
+ typedef _Hashtable_iterator<_Val, _Key, _HashFcn,
+ _ExtractKey, _EqualKey, _Alloc>
+ iterator;
+ typedef _Hashtable_const_iterator<_Val, _Key, _HashFcn,
+ _ExtractKey, _EqualKey, _Alloc>
+ const_iterator;
+ typedef _Hashtable_node<_Val> _Node;
+ typedef forward_iterator_tag iterator_category;
+ typedef _Val value_type;
+ typedef ptrdiff_t difference_type;
+ typedef size_t size_type;
+ typedef _Val& reference;
+ typedef _Val* pointer;
+
+ _Node* _M_cur;
+ _Hashtable* _M_ht;
+
+ _Hashtable_iterator(_Node* __n, _Hashtable* __tab)
+ : _M_cur(__n), _M_ht(__tab) { }
+
+ _Hashtable_iterator() { }
+
+ reference
+ operator*() const
+ { return _M_cur->_M_val; }
+
+ pointer
+ operator->() const
+ { return &(operator*()); }
+
+ iterator&
+ operator++();
+
+ iterator
+ operator++(int);
+
+ bool
+ operator==(const iterator& __it) const
+ { return _M_cur == __it._M_cur; }
+
+ bool
+ operator!=(const iterator& __it) const
+ { return _M_cur != __it._M_cur; }
+ };
+
+ template<class _Val, class _Key, class _HashFcn,
+ class _ExtractKey, class _EqualKey, class _Alloc>
+ struct _Hashtable_const_iterator
+ {
+ typedef hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>
+ _Hashtable;
+ typedef _Hashtable_iterator<_Val,_Key,_HashFcn,
+ _ExtractKey,_EqualKey,_Alloc>
+ iterator;
+ typedef _Hashtable_const_iterator<_Val, _Key, _HashFcn,
+ _ExtractKey, _EqualKey, _Alloc>
+ const_iterator;
+ typedef _Hashtable_node<_Val> _Node;
+
+ typedef forward_iterator_tag iterator_category;
+ typedef _Val value_type;
+ typedef ptrdiff_t difference_type;
+ typedef size_t size_type;
+ typedef const _Val& reference;
+ typedef const _Val* pointer;
+
+ const _Node* _M_cur;
+ const _Hashtable* _M_ht;
+
+ _Hashtable_const_iterator(const _Node* __n, const _Hashtable* __tab)
+ : _M_cur(__n), _M_ht(__tab) { }
+
+ _Hashtable_const_iterator() { }
+
+ _Hashtable_const_iterator(const iterator& __it)
+ : _M_cur(__it._M_cur), _M_ht(__it._M_ht) { }
+
+ reference
+ operator*() const
+ { return _M_cur->_M_val; }
+
+ pointer
+ operator->() const
+ { return &(operator*()); }
+
+ const_iterator&
+ operator++();
+
+ const_iterator
+ operator++(int);
+
+ bool
+ operator==(const const_iterator& __it) const
+ { return _M_cur == __it._M_cur; }
+
+ bool
+ operator!=(const const_iterator& __it) const
+ { return _M_cur != __it._M_cur; }
+ };
+
+ // Note: assumes long is at least 32 bits.
+ enum { _S_num_primes = 28 };
+
+ static const unsigned long __stl_prime_list[_S_num_primes] =
+ {
+ 53ul, 97ul, 193ul, 389ul, 769ul,
+ 1543ul, 3079ul, 6151ul, 12289ul, 24593ul,
+ 49157ul, 98317ul, 196613ul, 393241ul, 786433ul,
+ 1572869ul, 3145739ul, 6291469ul, 12582917ul, 25165843ul,
+ 50331653ul, 100663319ul, 201326611ul, 402653189ul, 805306457ul,
+ 1610612741ul, 3221225473ul, 4294967291ul
+ };
+
+ inline unsigned long
+ __stl_next_prime(unsigned long __n)
+ {
+ const unsigned long* __first = __stl_prime_list;
+ const unsigned long* __last = __stl_prime_list + (int)_S_num_primes;
+ const unsigned long* pos = std::lower_bound(__first, __last, __n);
+ return pos == __last ? *(__last - 1) : *pos;
+ }
+
+ // Forward declaration of operator==.
+ template<class _Val, class _Key, class _HF, class _Ex,
+ class _Eq, class _All>
+ class hashtable;
+
+ template<class _Val, class _Key, class _HF, class _Ex,
+ class _Eq, class _All>
+ bool
+ operator==(const hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>& __ht1,
+ const hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>& __ht2);
+
+ // Hashtables handle allocators a bit differently than other
+ // containers do. If we're using standard-conforming allocators, then
+ // a hashtable unconditionally has a member variable to hold its
+ // allocator, even if it so happens that all instances of the
+ // allocator type are identical. This is because, for hashtables,
+ // this extra storage is negligible. Additionally, a base class
+ // wouldn't serve any other purposes; it wouldn't, for example,
+ // simplify the exception-handling code.
+ template<class _Val, class _Key, class _HashFcn,
+ class _ExtractKey, class _EqualKey, class _Alloc>
+ class hashtable
+ {
+ public:
+ typedef _Key key_type;
+ typedef _Val value_type;
+ typedef _HashFcn hasher;
+ typedef _EqualKey key_equal;
+
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef value_type* pointer;
+ typedef const value_type* const_pointer;
+ typedef value_type& reference;
+ typedef const value_type& const_reference;
+
+ hasher
+ hash_funct() const
+ { return _M_hash; }
+
+ key_equal
+ key_eq() const
+ { return _M_equals; }
+
+ private:
+ typedef _Hashtable_node<_Val> _Node;
+
+ public:
+ typedef typename _Alloc::template rebind<value_type>::other allocator_type;
+ allocator_type
+ get_allocator() const
+ { return _M_node_allocator; }
+
+ private:
+ typedef typename _Alloc::template rebind<_Node>::other _Node_Alloc;
+ typedef typename _Alloc::template rebind<_Node*>::other _Nodeptr_Alloc;
+ typedef vector<_Node*, _Nodeptr_Alloc> _Vector_type;
+
+ _Node_Alloc _M_node_allocator;
+
+ _Node*
+ _M_get_node()
+ { return _M_node_allocator.allocate(1); }
+
+ void
+ _M_put_node(_Node* __p)
+ { _M_node_allocator.deallocate(__p, 1); }
+
+ private:
+ hasher _M_hash;
+ key_equal _M_equals;
+ _ExtractKey _M_get_key;
+ _Vector_type _M_buckets;
+ size_type _M_num_elements;
+
+ public:
+ typedef _Hashtable_iterator<_Val, _Key, _HashFcn, _ExtractKey,
+ _EqualKey, _Alloc>
+ iterator;
+ typedef _Hashtable_const_iterator<_Val, _Key, _HashFcn, _ExtractKey,
+ _EqualKey, _Alloc>
+ const_iterator;
+
+ friend struct
+ _Hashtable_iterator<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>;
+
+ friend struct
+ _Hashtable_const_iterator<_Val, _Key, _HashFcn, _ExtractKey,
+ _EqualKey, _Alloc>;
+
+ public:
+ hashtable(size_type __n, const _HashFcn& __hf,
+ const _EqualKey& __eql, const _ExtractKey& __ext,
+ const allocator_type& __a = allocator_type())
+ : _M_node_allocator(__a), _M_hash(__hf), _M_equals(__eql),
+ _M_get_key(__ext), _M_buckets(__a), _M_num_elements(0)
+ { _M_initialize_buckets(__n); }
+
+ hashtable(size_type __n, const _HashFcn& __hf,
+ const _EqualKey& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_node_allocator(__a), _M_hash(__hf), _M_equals(__eql),
+ _M_get_key(_ExtractKey()), _M_buckets(__a), _M_num_elements(0)
+ { _M_initialize_buckets(__n); }
+
+ hashtable(const hashtable& __ht)
+ : _M_node_allocator(__ht.get_allocator()), _M_hash(__ht._M_hash),
+ _M_equals(__ht._M_equals), _M_get_key(__ht._M_get_key),
+ _M_buckets(__ht.get_allocator()), _M_num_elements(0)
+ { _M_copy_from(__ht); }
+
+ hashtable&
+ operator= (const hashtable& __ht)
+ {
+ if (&__ht != this)
+ {
+ clear();
+ _M_hash = __ht._M_hash;
+ _M_equals = __ht._M_equals;
+ _M_get_key = __ht._M_get_key;
+ _M_copy_from(__ht);
+ }
+ return *this;
+ }
+
+ ~hashtable()
+ { clear(); }
+
+ size_type
+ size() const
+ { return _M_num_elements; }
+
+ size_type
+ max_size() const
+ { return size_type(-1); }
+
+ bool
+ empty() const
+ { return size() == 0; }
+
+ void
+ swap(hashtable& __ht)
+ {
+ std::swap(_M_hash, __ht._M_hash);
+ std::swap(_M_equals, __ht._M_equals);
+ std::swap(_M_get_key, __ht._M_get_key);
+ _M_buckets.swap(__ht._M_buckets);
+ std::swap(_M_num_elements, __ht._M_num_elements);
+ }
+
+ iterator
+ begin()
+ {
+ for (size_type __n = 0; __n < _M_buckets.size(); ++__n)
+ if (_M_buckets[__n])
+ return iterator(_M_buckets[__n], this);
+ return end();
+ }
+
+ iterator
+ end()
+ { return iterator(0, this); }
+
+ const_iterator
+ begin() const
+ {
+ for (size_type __n = 0; __n < _M_buckets.size(); ++__n)
+ if (_M_buckets[__n])
+ return const_iterator(_M_buckets[__n], this);
+ return end();
+ }
+
+ const_iterator
+ end() const
+ { return const_iterator(0, this); }
+
+ template<class _Vl, class _Ky, class _HF, class _Ex, class _Eq,
+ class _Al>
+ friend bool
+ operator==(const hashtable<_Vl, _Ky, _HF, _Ex, _Eq, _Al>&,
+ const hashtable<_Vl, _Ky, _HF, _Ex, _Eq, _Al>&);
+
+ public:
+ size_type
+ bucket_count() const
+ { return _M_buckets.size(); }
+
+ size_type
+ max_bucket_count() const
+ { return __stl_prime_list[(int)_S_num_primes - 1]; }
+
+ size_type
+ elems_in_bucket(size_type __bucket) const
+ {
+ size_type __result = 0;
+ for (_Node* __n = _M_buckets[__bucket]; __n; __n = __n->_M_next)
+ __result += 1;
+ return __result;
+ }
+
+ pair<iterator, bool>
+ insert_unique(const value_type& __obj)
+ {
+ resize(_M_num_elements + 1);
+ return insert_unique_noresize(__obj);
+ }
+
+ iterator
+ insert_equal(const value_type& __obj)
+ {
+ resize(_M_num_elements + 1);
+ return insert_equal_noresize(__obj);
+ }
+
+ pair<iterator, bool>
+ insert_unique_noresize(const value_type& __obj);
+
+ iterator
+ insert_equal_noresize(const value_type& __obj);
+
+ template<class _InputIterator>
+ void
+ insert_unique(_InputIterator __f, _InputIterator __l)
+ { insert_unique(__f, __l, __iterator_category(__f)); }
+
+ template<class _InputIterator>
+ void
+ insert_equal(_InputIterator __f, _InputIterator __l)
+ { insert_equal(__f, __l, __iterator_category(__f)); }
+
+ template<class _InputIterator>
+ void
+ insert_unique(_InputIterator __f, _InputIterator __l,
+ input_iterator_tag)
+ {
+ for ( ; __f != __l; ++__f)
+ insert_unique(*__f);
+ }
+
+ template<class _InputIterator>
+ void
+ insert_equal(_InputIterator __f, _InputIterator __l,
+ input_iterator_tag)
+ {
+ for ( ; __f != __l; ++__f)
+ insert_equal(*__f);
+ }
+
+ template<class _ForwardIterator>
+ void
+ insert_unique(_ForwardIterator __f, _ForwardIterator __l,
+ forward_iterator_tag)
+ {
+ size_type __n = distance(__f, __l);
+ resize(_M_num_elements + __n);
+ for ( ; __n > 0; --__n, ++__f)
+ insert_unique_noresize(*__f);
+ }
+
+ template<class _ForwardIterator>
+ void
+ insert_equal(_ForwardIterator __f, _ForwardIterator __l,
+ forward_iterator_tag)
+ {
+ size_type __n = distance(__f, __l);
+ resize(_M_num_elements + __n);
+ for ( ; __n > 0; --__n, ++__f)
+ insert_equal_noresize(*__f);
+ }
+
+ reference
+ find_or_insert(const value_type& __obj);
+
+ iterator
+ find(const key_type& __key)
+ {
+ size_type __n = _M_bkt_num_key(__key);
+ _Node* __first;
+ for (__first = _M_buckets[__n];
+ __first && !_M_equals(_M_get_key(__first->_M_val), __key);
+ __first = __first->_M_next)
+ { }
+ return iterator(__first, this);
+ }
+
+ const_iterator
+ find(const key_type& __key) const
+ {
+ size_type __n = _M_bkt_num_key(__key);
+ const _Node* __first;
+ for (__first = _M_buckets[__n];
+ __first && !_M_equals(_M_get_key(__first->_M_val), __key);
+ __first = __first->_M_next)
+ { }
+ return const_iterator(__first, this);
+ }
+
+ size_type
+ count(const key_type& __key) const
+ {
+ const size_type __n = _M_bkt_num_key(__key);
+ size_type __result = 0;
+
+ for (const _Node* __cur = _M_buckets[__n]; __cur;
+ __cur = __cur->_M_next)
+ if (_M_equals(_M_get_key(__cur->_M_val), __key))
+ ++__result;
+ return __result;
+ }
+
+ pair<iterator, iterator>
+ equal_range(const key_type& __key);
+
+ pair<const_iterator, const_iterator>
+ equal_range(const key_type& __key) const;
+
+ size_type
+ erase(const key_type& __key);
+
+ void
+ erase(const iterator& __it);
+
+ void
+ erase(iterator __first, iterator __last);
+
+ void
+ erase(const const_iterator& __it);
+
+ void
+ erase(const_iterator __first, const_iterator __last);
+
+ void
+ resize(size_type __num_elements_hint);
+
+ void
+ clear();
+
+ private:
+ size_type
+ _M_next_size(size_type __n) const
+ { return __stl_next_prime(__n); }
+
+ void
+ _M_initialize_buckets(size_type __n)
+ {
+ const size_type __n_buckets = _M_next_size(__n);
+ _M_buckets.reserve(__n_buckets);
+ _M_buckets.insert(_M_buckets.end(), __n_buckets, (_Node*) 0);
+ _M_num_elements = 0;
+ }
+
+ size_type
+ _M_bkt_num_key(const key_type& __key) const
+ { return _M_bkt_num_key(__key, _M_buckets.size()); }
+
+ size_type
+ _M_bkt_num(const value_type& __obj) const
+ { return _M_bkt_num_key(_M_get_key(__obj)); }
+
+ size_type
+ _M_bkt_num_key(const key_type& __key, size_t __n) const
+ { return _M_hash(__key) % __n; }
+
+ size_type
+ _M_bkt_num(const value_type& __obj, size_t __n) const
+ { return _M_bkt_num_key(_M_get_key(__obj), __n); }
+
+ _Node*
+ _M_new_node(const value_type& __obj)
+ {
+ _Node* __n = _M_get_node();
+ __n->_M_next = 0;
+ __try
+ {
+ this->get_allocator().construct(&__n->_M_val, __obj);
+ return __n;
+ }
+ __catch(...)
+ {
+ _M_put_node(__n);
+ __throw_exception_again;
+ }
+ }
+
+ void
+ _M_delete_node(_Node* __n)
+ {
+ this->get_allocator().destroy(&__n->_M_val);
+ _M_put_node(__n);
+ }
+
+ void
+ _M_erase_bucket(const size_type __n, _Node* __first, _Node* __last);
+
+ void
+ _M_erase_bucket(const size_type __n, _Node* __last);
+
+ void
+ _M_copy_from(const hashtable& __ht);
+ };
+
+ template<class _Val, class _Key, class _HF, class _ExK, class _EqK,
+ class _All>
+ _Hashtable_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>&
+ _Hashtable_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>::
+ operator++()
+ {
+ const _Node* __old = _M_cur;
+ _M_cur = _M_cur->_M_next;
+ if (!_M_cur)
+ {
+ size_type __bucket = _M_ht->_M_bkt_num(__old->_M_val);
+ while (!_M_cur && ++__bucket < _M_ht->_M_buckets.size())
+ _M_cur = _M_ht->_M_buckets[__bucket];
+ }
+ return *this;
+ }
+
+ template<class _Val, class _Key, class _HF, class _ExK, class _EqK,
+ class _All>
+ inline _Hashtable_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>
+ _Hashtable_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>::
+ operator++(int)
+ {
+ iterator __tmp = *this;
+ ++*this;
+ return __tmp;
+ }
+
+ template<class _Val, class _Key, class _HF, class _ExK, class _EqK,
+ class _All>
+ _Hashtable_const_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>&
+ _Hashtable_const_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>::
+ operator++()
+ {
+ const _Node* __old = _M_cur;
+ _M_cur = _M_cur->_M_next;
+ if (!_M_cur)
+ {
+ size_type __bucket = _M_ht->_M_bkt_num(__old->_M_val);
+ while (!_M_cur && ++__bucket < _M_ht->_M_buckets.size())
+ _M_cur = _M_ht->_M_buckets[__bucket];
+ }
+ return *this;
+ }
+
+ template<class _Val, class _Key, class _HF, class _ExK, class _EqK,
+ class _All>
+ inline _Hashtable_const_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>
+ _Hashtable_const_iterator<_Val, _Key, _HF, _ExK, _EqK, _All>::
+ operator++(int)
+ {
+ const_iterator __tmp = *this;
+ ++*this;
+ return __tmp;
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ bool
+ operator==(const hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>& __ht1,
+ const hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>& __ht2)
+ {
+ typedef typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::_Node _Node;
+
+ if (__ht1._M_buckets.size() != __ht2._M_buckets.size())
+ return false;
+
+ for (size_t __n = 0; __n < __ht1._M_buckets.size(); ++__n)
+ {
+ _Node* __cur1 = __ht1._M_buckets[__n];
+ _Node* __cur2 = __ht2._M_buckets[__n];
+ // Check same length of lists
+ for (; __cur1 && __cur2;
+ __cur1 = __cur1->_M_next, __cur2 = __cur2->_M_next)
+ { }
+ if (__cur1 || __cur2)
+ return false;
+ // Now check one's elements are in the other
+ for (__cur1 = __ht1._M_buckets[__n] ; __cur1;
+ __cur1 = __cur1->_M_next)
+ {
+ bool _found__cur1 = false;
+ for (__cur2 = __ht2._M_buckets[__n];
+ __cur2; __cur2 = __cur2->_M_next)
+ {
+ if (__cur1->_M_val == __cur2->_M_val)
+ {
+ _found__cur1 = true;
+ break;
+ }
+ }
+ if (!_found__cur1)
+ return false;
+ }
+ }
+ return true;
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ inline bool
+ operator!=(const hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>& __ht1,
+ const hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>& __ht2)
+ { return !(__ht1 == __ht2); }
+
+ template<class _Val, class _Key, class _HF, class _Extract, class _EqKey,
+ class _All>
+ inline void
+ swap(hashtable<_Val, _Key, _HF, _Extract, _EqKey, _All>& __ht1,
+ hashtable<_Val, _Key, _HF, _Extract, _EqKey, _All>& __ht2)
+ { __ht1.swap(__ht2); }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ pair<typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::iterator, bool>
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ insert_unique_noresize(const value_type& __obj)
+ {
+ const size_type __n = _M_bkt_num(__obj);
+ _Node* __first = _M_buckets[__n];
+
+ for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
+ if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj)))
+ return pair<iterator, bool>(iterator(__cur, this), false);
+
+ _Node* __tmp = _M_new_node(__obj);
+ __tmp->_M_next = __first;
+ _M_buckets[__n] = __tmp;
+ ++_M_num_elements;
+ return pair<iterator, bool>(iterator(__tmp, this), true);
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::iterator
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ insert_equal_noresize(const value_type& __obj)
+ {
+ const size_type __n = _M_bkt_num(__obj);
+ _Node* __first = _M_buckets[__n];
+
+ for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
+ if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj)))
+ {
+ _Node* __tmp = _M_new_node(__obj);
+ __tmp->_M_next = __cur->_M_next;
+ __cur->_M_next = __tmp;
+ ++_M_num_elements;
+ return iterator(__tmp, this);
+ }
+
+ _Node* __tmp = _M_new_node(__obj);
+ __tmp->_M_next = __first;
+ _M_buckets[__n] = __tmp;
+ ++_M_num_elements;
+ return iterator(__tmp, this);
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::reference
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ find_or_insert(const value_type& __obj)
+ {
+ resize(_M_num_elements + 1);
+
+ size_type __n = _M_bkt_num(__obj);
+ _Node* __first = _M_buckets[__n];
+
+ for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
+ if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj)))
+ return __cur->_M_val;
+
+ _Node* __tmp = _M_new_node(__obj);
+ __tmp->_M_next = __first;
+ _M_buckets[__n] = __tmp;
+ ++_M_num_elements;
+ return __tmp->_M_val;
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ pair<typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::iterator,
+ typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::iterator>
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ equal_range(const key_type& __key)
+ {
+ typedef pair<iterator, iterator> _Pii;
+ const size_type __n = _M_bkt_num_key(__key);
+
+ for (_Node* __first = _M_buckets[__n]; __first;
+ __first = __first->_M_next)
+ if (_M_equals(_M_get_key(__first->_M_val), __key))
+ {
+ for (_Node* __cur = __first->_M_next; __cur;
+ __cur = __cur->_M_next)
+ if (!_M_equals(_M_get_key(__cur->_M_val), __key))
+ return _Pii(iterator(__first, this), iterator(__cur, this));
+ for (size_type __m = __n + 1; __m < _M_buckets.size(); ++__m)
+ if (_M_buckets[__m])
+ return _Pii(iterator(__first, this),
+ iterator(_M_buckets[__m], this));
+ return _Pii(iterator(__first, this), end());
+ }
+ return _Pii(end(), end());
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ pair<typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::const_iterator,
+ typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::const_iterator>
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ equal_range(const key_type& __key) const
+ {
+ typedef pair<const_iterator, const_iterator> _Pii;
+ const size_type __n = _M_bkt_num_key(__key);
+
+ for (const _Node* __first = _M_buckets[__n]; __first;
+ __first = __first->_M_next)
+ {
+ if (_M_equals(_M_get_key(__first->_M_val), __key))
+ {
+ for (const _Node* __cur = __first->_M_next; __cur;
+ __cur = __cur->_M_next)
+ if (!_M_equals(_M_get_key(__cur->_M_val), __key))
+ return _Pii(const_iterator(__first, this),
+ const_iterator(__cur, this));
+ for (size_type __m = __n + 1; __m < _M_buckets.size(); ++__m)
+ if (_M_buckets[__m])
+ return _Pii(const_iterator(__first, this),
+ const_iterator(_M_buckets[__m], this));
+ return _Pii(const_iterator(__first, this), end());
+ }
+ }
+ return _Pii(end(), end());
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ typename hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::size_type
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ erase(const key_type& __key)
+ {
+ const size_type __n = _M_bkt_num_key(__key);
+ _Node* __first = _M_buckets[__n];
+ size_type __erased = 0;
+
+ if (__first)
+ {
+ _Node* __cur = __first;
+ _Node* __next = __cur->_M_next;
+ while (__next)
+ {
+ if (_M_equals(_M_get_key(__next->_M_val), __key))
+ {
+ __cur->_M_next = __next->_M_next;
+ _M_delete_node(__next);
+ __next = __cur->_M_next;
+ ++__erased;
+ --_M_num_elements;
+ }
+ else
+ {
+ __cur = __next;
+ __next = __cur->_M_next;
+ }
+ }
+ if (_M_equals(_M_get_key(__first->_M_val), __key))
+ {
+ _M_buckets[__n] = __first->_M_next;
+ _M_delete_node(__first);
+ ++__erased;
+ --_M_num_elements;
+ }
+ }
+ return __erased;
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ void hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ erase(const iterator& __it)
+ {
+ _Node* __p = __it._M_cur;
+ if (__p)
+ {
+ const size_type __n = _M_bkt_num(__p->_M_val);
+ _Node* __cur = _M_buckets[__n];
+
+ if (__cur == __p)
+ {
+ _M_buckets[__n] = __cur->_M_next;
+ _M_delete_node(__cur);
+ --_M_num_elements;
+ }
+ else
+ {
+ _Node* __next = __cur->_M_next;
+ while (__next)
+ {
+ if (__next == __p)
+ {
+ __cur->_M_next = __next->_M_next;
+ _M_delete_node(__next);
+ --_M_num_elements;
+ break;
+ }
+ else
+ {
+ __cur = __next;
+ __next = __cur->_M_next;
+ }
+ }
+ }
+ }
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ void
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ erase(iterator __first, iterator __last)
+ {
+ size_type __f_bucket = __first._M_cur ? _M_bkt_num(__first._M_cur->_M_val)
+ : _M_buckets.size();
+
+ size_type __l_bucket = __last._M_cur ? _M_bkt_num(__last._M_cur->_M_val)
+ : _M_buckets.size();
+
+ if (__first._M_cur == __last._M_cur)
+ return;
+ else if (__f_bucket == __l_bucket)
+ _M_erase_bucket(__f_bucket, __first._M_cur, __last._M_cur);
+ else
+ {
+ _M_erase_bucket(__f_bucket, __first._M_cur, 0);
+ for (size_type __n = __f_bucket + 1; __n < __l_bucket; ++__n)
+ _M_erase_bucket(__n, 0);
+ if (__l_bucket != _M_buckets.size())
+ _M_erase_bucket(__l_bucket, __last._M_cur);
+ }
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ inline void
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ erase(const_iterator __first, const_iterator __last)
+ {
+ erase(iterator(const_cast<_Node*>(__first._M_cur),
+ const_cast<hashtable*>(__first._M_ht)),
+ iterator(const_cast<_Node*>(__last._M_cur),
+ const_cast<hashtable*>(__last._M_ht)));
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ inline void
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ erase(const const_iterator& __it)
+ { erase(iterator(const_cast<_Node*>(__it._M_cur),
+ const_cast<hashtable*>(__it._M_ht))); }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ void
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ resize(size_type __num_elements_hint)
+ {
+ const size_type __old_n = _M_buckets.size();
+ if (__num_elements_hint > __old_n)
+ {
+ const size_type __n = _M_next_size(__num_elements_hint);
+ if (__n > __old_n)
+ {
+ _Vector_type __tmp(__n, (_Node*)(0), _M_buckets.get_allocator());
+ __try
+ {
+ for (size_type __bucket = 0; __bucket < __old_n; ++__bucket)
+ {
+ _Node* __first = _M_buckets[__bucket];
+ while (__first)
+ {
+ size_type __new_bucket = _M_bkt_num(__first->_M_val,
+ __n);
+ _M_buckets[__bucket] = __first->_M_next;
+ __first->_M_next = __tmp[__new_bucket];
+ __tmp[__new_bucket] = __first;
+ __first = _M_buckets[__bucket];
+ }
+ }
+ _M_buckets.swap(__tmp);
+ }
+ __catch(...)
+ {
+ for (size_type __bucket = 0; __bucket < __tmp.size();
+ ++__bucket)
+ {
+ while (__tmp[__bucket])
+ {
+ _Node* __next = __tmp[__bucket]->_M_next;
+ _M_delete_node(__tmp[__bucket]);
+ __tmp[__bucket] = __next;
+ }
+ }
+ __throw_exception_again;
+ }
+ }
+ }
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ void
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ _M_erase_bucket(const size_type __n, _Node* __first, _Node* __last)
+ {
+ _Node* __cur = _M_buckets[__n];
+ if (__cur == __first)
+ _M_erase_bucket(__n, __last);
+ else
+ {
+ _Node* __next;
+ for (__next = __cur->_M_next;
+ __next != __first;
+ __cur = __next, __next = __cur->_M_next)
+ ;
+ while (__next != __last)
+ {
+ __cur->_M_next = __next->_M_next;
+ _M_delete_node(__next);
+ __next = __cur->_M_next;
+ --_M_num_elements;
+ }
+ }
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ void
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ _M_erase_bucket(const size_type __n, _Node* __last)
+ {
+ _Node* __cur = _M_buckets[__n];
+ while (__cur != __last)
+ {
+ _Node* __next = __cur->_M_next;
+ _M_delete_node(__cur);
+ __cur = __next;
+ _M_buckets[__n] = __cur;
+ --_M_num_elements;
+ }
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ void
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ clear()
+ {
+ for (size_type __i = 0; __i < _M_buckets.size(); ++__i)
+ {
+ _Node* __cur = _M_buckets[__i];
+ while (__cur != 0)
+ {
+ _Node* __next = __cur->_M_next;
+ _M_delete_node(__cur);
+ __cur = __next;
+ }
+ _M_buckets[__i] = 0;
+ }
+ _M_num_elements = 0;
+ }
+
+ template<class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
+ void
+ hashtable<_Val, _Key, _HF, _Ex, _Eq, _All>::
+ _M_copy_from(const hashtable& __ht)
+ {
+ _M_buckets.clear();
+ _M_buckets.reserve(__ht._M_buckets.size());
+ _M_buckets.insert(_M_buckets.end(), __ht._M_buckets.size(), (_Node*) 0);
+ __try
+ {
+ for (size_type __i = 0; __i < __ht._M_buckets.size(); ++__i) {
+ const _Node* __cur = __ht._M_buckets[__i];
+ if (__cur)
+ {
+ _Node* __local_copy = _M_new_node(__cur->_M_val);
+ _M_buckets[__i] = __local_copy;
+
+ for (_Node* __next = __cur->_M_next;
+ __next;
+ __cur = __next, __next = __cur->_M_next)
+ {
+ __local_copy->_M_next = _M_new_node(__next->_M_val);
+ __local_copy = __local_copy->_M_next;
+ }
+ }
+ }
+ _M_num_elements = __ht._M_num_elements;
+ }
+ __catch(...)
+ {
+ clear();
+ __throw_exception_again;
+ }
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/strstream b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/strstream
new file mode 100644
index 0000000..a643e8b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/backward/strstream
@@ -0,0 +1,176 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+// WARNING: The classes defined in this header are DEPRECATED. This
+// header is defined in section D.7.1 of the C++ standard, and it
+// MAY BE REMOVED in a future standard revision. One should use the
+// header <sstream> instead.
+
+#ifndef _GLIBCXX_STRSTREAM
+#define _GLIBCXX_STRSTREAM
+
+#include "backward_warning.h"
+#include <iosfwd>
+#include <ios>
+#include <istream>
+#include <ostream>
+#include <string>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Class strstreambuf, a streambuf class that manages an array of char.
+ // Note that this class is not a template.
+ class strstreambuf : public basic_streambuf<char, char_traits<char> >
+ {
+ public:
+ // Types.
+ typedef char_traits<char> _Traits;
+ typedef basic_streambuf<char, _Traits> _Base;
+
+ public:
+ // Constructor, destructor
+ explicit strstreambuf(streamsize __initial_capacity = 0);
+ strstreambuf(void* (*__alloc)(size_t), void (*__free)(void*));
+
+ strstreambuf(char* __get, streamsize __n, char* __put = 0);
+ strstreambuf(signed char* __get, streamsize __n, signed char* __put = 0);
+ strstreambuf(unsigned char* __get, streamsize __n, unsigned char* __put=0);
+
+ strstreambuf(const char* __get, streamsize __n);
+ strstreambuf(const signed char* __get, streamsize __n);
+ strstreambuf(const unsigned char* __get, streamsize __n);
+
+ virtual ~strstreambuf();
+
+ public:
+ void freeze(bool = true);
+ char* str();
+ int pcount() const;
+
+ protected:
+ virtual int_type overflow(int_type __c = _Traits::eof());
+ virtual int_type pbackfail(int_type __c = _Traits::eof());
+ virtual int_type underflow();
+ virtual _Base* setbuf(char* __buf, streamsize __n);
+ virtual pos_type seekoff(off_type __off, ios_base::seekdir __dir,
+ ios_base::openmode __mode
+ = ios_base::in | ios_base::out);
+ virtual pos_type seekpos(pos_type __pos, ios_base::openmode __mode
+ = ios_base::in | ios_base::out);
+
+ private:
+ strstreambuf&
+ operator=(const strstreambuf&);
+
+ strstreambuf(const strstreambuf&);
+
+ // Dynamic allocation, possibly using _M_alloc_fun and _M_free_fun.
+ char* _M_alloc(size_t);
+ void _M_free(char*);
+
+ // Helper function used in constructors.
+ void _M_setup(char* __get, char* __put, streamsize __n);
+
+ private:
+ // Data members.
+ void* (*_M_alloc_fun)(size_t);
+ void (*_M_free_fun)(void*);
+
+ bool _M_dynamic : 1;
+ bool _M_frozen : 1;
+ bool _M_constant : 1;
+ };
+
+ // Class istrstream, an istream that manages a strstreambuf.
+ class istrstream : public basic_istream<char>
+ {
+ public:
+ explicit istrstream(char*);
+ explicit istrstream(const char*);
+ istrstream(char* , streamsize);
+ istrstream(const char*, streamsize);
+ virtual ~istrstream();
+
+ strstreambuf* rdbuf() const;
+ char* str();
+
+ private:
+ strstreambuf _M_buf;
+ };
+
+ // Class ostrstream
+ class ostrstream : public basic_ostream<char>
+ {
+ public:
+ ostrstream();
+ ostrstream(char*, int, ios_base::openmode = ios_base::out);
+ virtual ~ostrstream();
+
+ strstreambuf* rdbuf() const;
+ void freeze(bool = true);
+ char* str();
+ int pcount() const;
+
+ private:
+ strstreambuf _M_buf;
+ };
+
+ // Class strstream
+ class strstream : public basic_iostream<char>
+ {
+ public:
+ typedef char char_type;
+ typedef char_traits<char>::int_type int_type;
+ typedef char_traits<char>::pos_type pos_type;
+ typedef char_traits<char>::off_type off_type;
+
+ strstream();
+ strstream(char*, int, ios_base::openmode = ios_base::in | ios_base::out);
+ virtual ~strstream();
+
+ strstreambuf* rdbuf() const;
+ void freeze(bool = true);
+ int pcount() const;
+ char* str();
+
+ private:
+ strstreambuf _M_buf;
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/algorithmfwd.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/algorithmfwd.h
new file mode 100644
index 0000000..e33a14c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/algorithmfwd.h
@@ -0,0 +1,805 @@
+// <algorithm> declarations -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/algorithmfwd.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_ALGORITHMFWD_H
+#define _GLIBCXX_ALGORITHMFWD_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/stl_pair.h>
+#include <bits/stl_iterator_base_types.h>
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /*
+ adjacent_find
+ all_of (C++0x)
+ any_of (C++0x)
+ binary_search
+ copy
+ copy_backward
+ copy_if (C++0x)
+ copy_n (C++0x)
+ count
+ count_if
+ equal
+ equal_range
+ fill
+ fill_n
+ find
+ find_end
+ find_first_of
+ find_if
+ find_if_not (C++0x)
+ for_each
+ generate
+ generate_n
+ includes
+ inplace_merge
+ is_heap (C++0x)
+ is_heap_until (C++0x)
+ is_partitioned (C++0x)
+ is_sorted (C++0x)
+ is_sorted_until (C++0x)
+ iter_swap
+ lexicographical_compare
+ lower_bound
+ make_heap
+ max
+ max_element
+ merge
+ min
+ min_element
+ minmax (C++0x)
+ minmax_element (C++0x)
+ mismatch
+ next_permutation
+ none_of (C++0x)
+ nth_element
+ partial_sort
+ partial_sort_copy
+ partition
+ partition_copy (C++0x)
+ partition_point (C++0x)
+ pop_heap
+ prev_permutation
+ push_heap
+ random_shuffle
+ remove
+ remove_copy
+ remove_copy_if
+ remove_if
+ replace
+ replace_copy
+ replace_copy_if
+ replace_if
+ reverse
+ reverse_copy
+ rotate
+ rotate_copy
+ search
+ search_n
+ set_difference
+ set_intersection
+ set_symmetric_difference
+ set_union
+ sort
+ sort_heap
+ stable_partition
+ stable_sort
+ swap
+ swap_ranges
+ transform
+ unique
+ unique_copy
+ upper_bound
+ */
+
+ /**
+ * @defgroup algorithms Algorithms
+ *
+ * Components for performing algorithmic operations. Includes
+ * non-modifying sequence, modifying (mutating) sequence, sorting,
+ * searching, merge, partition, heap, set, minima, maxima, and
+ * permutation operations.
+ */
+
+ /**
+ * @defgroup mutating_algorithms Mutating Algorithms
+ * @ingroup algorithms
+ */
+
+ /**
+ * @defgroup non_mutating_algorithms Non-Mutating Algorithms
+ * @ingroup algorithms
+ */
+
+ /**
+ * @defgroup sorting_algorithms Sorting Algorithms
+ * @ingroup algorithms
+ */
+
+ /**
+ * @defgroup set_algorithms Set Operation Algorithms
+ * @ingroup sorting_algorithms
+ *
+ * These algorithms are common set operations performed on sequences
+ * that are already sorted. The number of comparisons will be
+ * linear.
+ */
+
+ /**
+ * @defgroup binary_search_algorithms Binary Search Algorithms
+ * @ingroup sorting_algorithms
+ *
+ * These algorithms are variations of a classic binary search, and
+ * all assume that the sequence being searched is already sorted.
+ *
+ * The number of comparisons will be logarithmic (and as few as
+ * possible). The number of steps through the sequence will be
+ * logarithmic for random-access iterators (e.g., pointers), and
+ * linear otherwise.
+ *
+ * The LWG has passed Defect Report 270, which notes: <em>The
+ * proposed resolution reinterprets binary search. Instead of
+ * thinking about searching for a value in a sorted range, we view
+ * that as an important special case of a more general algorithm:
+ * searching for the partition point in a partitioned range. We
+ * also add a guarantee that the old wording did not: we ensure that
+ * the upper bound is no earlier than the lower bound, that the pair
+ * returned by equal_range is a valid range, and that the first part
+ * of that pair is the lower bound.</em>
+ *
+ * The actual effect of the first sentence is that a comparison
+ * functor passed by the user doesn't necessarily need to induce a
+ * strict weak ordering relation. Rather, it partitions the range.
+ */
+
+ // adjacent_find
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _IIter, typename _Predicate>
+ bool
+ all_of(_IIter, _IIter, _Predicate);
+
+ template<typename _IIter, typename _Predicate>
+ bool
+ any_of(_IIter, _IIter, _Predicate);
+#endif
+
+ template<typename _FIter, typename _Tp>
+ bool
+ binary_search(_FIter, _FIter, const _Tp&);
+
+ template<typename _FIter, typename _Tp, typename _Compare>
+ bool
+ binary_search(_FIter, _FIter, const _Tp&, _Compare);
+
+ template<typename _IIter, typename _OIter>
+ _OIter
+ copy(_IIter, _IIter, _OIter);
+
+ template<typename _BIter1, typename _BIter2>
+ _BIter2
+ copy_backward(_BIter1, _BIter1, _BIter2);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _IIter, typename _OIter, typename _Predicate>
+ _OIter
+ copy_if(_IIter, _IIter, _OIter, _Predicate);
+
+ template<typename _IIter, typename _Size, typename _OIter>
+ _OIter
+ copy_n(_IIter, _Size, _OIter);
+#endif
+
+ // count
+ // count_if
+
+ template<typename _FIter, typename _Tp>
+ pair<_FIter, _FIter>
+ equal_range(_FIter, _FIter, const _Tp&);
+
+ template<typename _FIter, typename _Tp, typename _Compare>
+ pair<_FIter, _FIter>
+ equal_range(_FIter, _FIter, const _Tp&, _Compare);
+
+ template<typename _FIter, typename _Tp>
+ void
+ fill(_FIter, _FIter, const _Tp&);
+
+/*
+ XXX NB: return type different from ISO C++.
+ template<typename _OIter, typename _Size, typename _Tp>
+ void
+ fill_n(_OIter, _Size, const _Tp&);
+*/
+
+ template<typename _OIter, typename _Size, typename _Tp>
+ _OIter
+ fill_n(_OIter, _Size, const _Tp&);
+
+ // find
+
+ template<typename _FIter1, typename _FIter2>
+ _FIter1
+ find_end(_FIter1, _FIter1, _FIter2, _FIter2);
+
+ template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
+ _FIter1
+ find_end(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
+
+ // find_first_of
+ // find_if
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _IIter, typename _Predicate>
+ _IIter
+ find_if_not(_IIter, _IIter, _Predicate);
+#endif
+
+ // for_each
+ // generate
+ // generate_n
+
+ template<typename _IIter1, typename _IIter2>
+ bool
+ includes(_IIter1, _IIter1, _IIter2, _IIter2);
+
+ template<typename _IIter1, typename _IIter2, typename _Compare>
+ bool
+ includes(_IIter1, _IIter1, _IIter2, _IIter2, _Compare);
+
+ template<typename _BIter>
+ void
+ inplace_merge(_BIter, _BIter, _BIter);
+
+ template<typename _BIter, typename _Compare>
+ void
+ inplace_merge(_BIter, _BIter, _BIter, _Compare);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _RAIter>
+ bool
+ is_heap(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ bool
+ is_heap(_RAIter, _RAIter, _Compare);
+
+ template<typename _RAIter>
+ _RAIter
+ is_heap_until(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ _RAIter
+ is_heap_until(_RAIter, _RAIter, _Compare);
+
+ template<typename _IIter, typename _Predicate>
+ bool
+ is_partitioned(_IIter, _IIter, _Predicate);
+
+ template<typename _FIter>
+ bool
+ is_sorted(_FIter, _FIter);
+
+ template<typename _FIter, typename _Compare>
+ bool
+ is_sorted(_FIter, _FIter, _Compare);
+
+ template<typename _FIter>
+ _FIter
+ is_sorted_until(_FIter, _FIter);
+
+ template<typename _FIter, typename _Compare>
+ _FIter
+ is_sorted_until(_FIter, _FIter, _Compare);
+#endif
+
+ template<typename _FIter1, typename _FIter2>
+ void
+ iter_swap(_FIter1, _FIter2);
+
+ template<typename _FIter, typename _Tp>
+ _FIter
+ lower_bound(_FIter, _FIter, const _Tp&);
+
+ template<typename _FIter, typename _Tp, typename _Compare>
+ _FIter
+ lower_bound(_FIter, _FIter, const _Tp&, _Compare);
+
+ template<typename _RAIter>
+ void
+ make_heap(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ make_heap(_RAIter, _RAIter, _Compare);
+
+ template<typename _Tp>
+ const _Tp&
+ max(const _Tp&, const _Tp&);
+
+ template<typename _Tp, typename _Compare>
+ const _Tp&
+ max(const _Tp&, const _Tp&, _Compare);
+
+ // max_element
+ // merge
+
+ template<typename _Tp>
+ const _Tp&
+ min(const _Tp&, const _Tp&);
+
+ template<typename _Tp, typename _Compare>
+ const _Tp&
+ min(const _Tp&, const _Tp&, _Compare);
+
+ // min_element
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp>
+ pair<const _Tp&, const _Tp&>
+ minmax(const _Tp&, const _Tp&);
+
+ template<typename _Tp, typename _Compare>
+ pair<const _Tp&, const _Tp&>
+ minmax(const _Tp&, const _Tp&, _Compare);
+
+ template<typename _FIter>
+ pair<_FIter, _FIter>
+ minmax_element(_FIter, _FIter);
+
+ template<typename _FIter, typename _Compare>
+ pair<_FIter, _FIter>
+ minmax_element(_FIter, _FIter, _Compare);
+
+ template<typename _Tp>
+ _Tp
+ min(initializer_list<_Tp>);
+
+ template<typename _Tp, typename _Compare>
+ _Tp
+ min(initializer_list<_Tp>, _Compare);
+
+ template<typename _Tp>
+ _Tp
+ max(initializer_list<_Tp>);
+
+ template<typename _Tp, typename _Compare>
+ _Tp
+ max(initializer_list<_Tp>, _Compare);
+
+ template<typename _Tp>
+ pair<_Tp, _Tp>
+ minmax(initializer_list<_Tp>);
+
+ template<typename _Tp, typename _Compare>
+ pair<_Tp, _Tp>
+ minmax(initializer_list<_Tp>, _Compare);
+#endif
+
+ // mismatch
+
+ template<typename _BIter>
+ bool
+ next_permutation(_BIter, _BIter);
+
+ template<typename _BIter, typename _Compare>
+ bool
+ next_permutation(_BIter, _BIter, _Compare);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _IIter, typename _Predicate>
+ bool
+ none_of(_IIter, _IIter, _Predicate);
+#endif
+
+ // nth_element
+ // partial_sort
+
+ template<typename _IIter, typename _RAIter>
+ _RAIter
+ partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter);
+
+ template<typename _IIter, typename _RAIter, typename _Compare>
+ _RAIter
+ partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter, _Compare);
+
+ // partition
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _IIter, typename _OIter1,
+ typename _OIter2, typename _Predicate>
+ pair<_OIter1, _OIter2>
+ partition_copy(_IIter, _IIter, _OIter1, _OIter2, _Predicate);
+
+ template<typename _FIter, typename _Predicate>
+ _FIter
+ partition_point(_FIter, _FIter, _Predicate);
+#endif
+
+ template<typename _RAIter>
+ void
+ pop_heap(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ pop_heap(_RAIter, _RAIter, _Compare);
+
+ template<typename _BIter>
+ bool
+ prev_permutation(_BIter, _BIter);
+
+ template<typename _BIter, typename _Compare>
+ bool
+ prev_permutation(_BIter, _BIter, _Compare);
+
+ template<typename _RAIter>
+ void
+ push_heap(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ push_heap(_RAIter, _RAIter, _Compare);
+
+ // random_shuffle
+
+ template<typename _FIter, typename _Tp>
+ _FIter
+ remove(_FIter, _FIter, const _Tp&);
+
+ template<typename _FIter, typename _Predicate>
+ _FIter
+ remove_if(_FIter, _FIter, _Predicate);
+
+ template<typename _IIter, typename _OIter, typename _Tp>
+ _OIter
+ remove_copy(_IIter, _IIter, _OIter, const _Tp&);
+
+ template<typename _IIter, typename _OIter, typename _Predicate>
+ _OIter
+ remove_copy_if(_IIter, _IIter, _OIter, _Predicate);
+
+ // replace
+
+ template<typename _IIter, typename _OIter, typename _Tp>
+ _OIter
+ replace_copy(_IIter, _IIter, _OIter, const _Tp&, const _Tp&);
+
+ template<typename _Iter, typename _OIter, typename _Predicate, typename _Tp>
+ _OIter
+ replace_copy_if(_Iter, _Iter, _OIter, _Predicate, const _Tp&);
+
+ // replace_if
+
+ template<typename _BIter>
+ void
+ reverse(_BIter, _BIter);
+
+ template<typename _BIter, typename _OIter>
+ _OIter
+ reverse_copy(_BIter, _BIter, _OIter);
+
+ template<typename _FIter>
+ void
+ rotate(_FIter, _FIter, _FIter);
+
+ template<typename _FIter, typename _OIter>
+ _OIter
+ rotate_copy(_FIter, _FIter, _FIter, _OIter);
+
+ // search
+ // search_n
+ // set_difference
+ // set_intersection
+ // set_symmetric_difference
+ // set_union
+
+ template<typename _RAIter>
+ void
+ sort_heap(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ sort_heap(_RAIter, _RAIter, _Compare);
+
+ template<typename _BIter, typename _Predicate>
+ _BIter
+ stable_partition(_BIter, _BIter, _Predicate);
+
+ template<typename _Tp>
+ void
+ swap(_Tp&, _Tp&);
+
+ template<typename _Tp, size_t _Nm>
+ void
+ swap(_Tp (&)[_Nm], _Tp (&)[_Nm]);
+
+ template<typename _FIter1, typename _FIter2>
+ _FIter2
+ swap_ranges(_FIter1, _FIter1, _FIter2);
+
+ // transform
+
+ template<typename _FIter>
+ _FIter
+ unique(_FIter, _FIter);
+
+ template<typename _FIter, typename _BinaryPredicate>
+ _FIter
+ unique(_FIter, _FIter, _BinaryPredicate);
+
+ // unique_copy
+
+ template<typename _FIter, typename _Tp>
+ _FIter
+ upper_bound(_FIter, _FIter, const _Tp&);
+
+ template<typename _FIter, typename _Tp, typename _Compare>
+ _FIter
+ upper_bound(_FIter, _FIter, const _Tp&, _Compare);
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P)
+
+ template<typename _FIter>
+ _FIter
+ adjacent_find(_FIter, _FIter);
+
+ template<typename _FIter, typename _BinaryPredicate>
+ _FIter
+ adjacent_find(_FIter, _FIter, _BinaryPredicate);
+
+ template<typename _IIter, typename _Tp>
+ typename iterator_traits<_IIter>::difference_type
+ count(_IIter, _IIter, const _Tp&);
+
+ template<typename _IIter, typename _Predicate>
+ typename iterator_traits<_IIter>::difference_type
+ count_if(_IIter, _IIter, _Predicate);
+
+ template<typename _IIter1, typename _IIter2>
+ bool
+ equal(_IIter1, _IIter1, _IIter2);
+
+ template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
+ bool
+ equal(_IIter1, _IIter1, _IIter2, _BinaryPredicate);
+
+ template<typename _IIter, typename _Tp>
+ _IIter
+ find(_IIter, _IIter, const _Tp&);
+
+ template<typename _FIter1, typename _FIter2>
+ _FIter1
+ find_first_of(_FIter1, _FIter1, _FIter2, _FIter2);
+
+ template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
+ _FIter1
+ find_first_of(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
+
+ template<typename _IIter, typename _Predicate>
+ _IIter
+ find_if(_IIter, _IIter, _Predicate);
+
+ template<typename _IIter, typename _Funct>
+ _Funct
+ for_each(_IIter, _IIter, _Funct);
+
+ template<typename _FIter, typename _Generator>
+ void
+ generate(_FIter, _FIter, _Generator);
+
+/*
+ XXX NB: return type different from ISO C++.
+ template<typename _OIter, typename _Size, typename _Tp>
+ void
+ generate_n(_OIter, _Size, _Generator);
+*/
+
+ template<typename _OIter, typename _Size, typename _Generator>
+ _OIter
+ generate_n(_OIter, _Size, _Generator);
+
+ template<typename _IIter1, typename _IIter2>
+ bool
+ lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2);
+
+ template<typename _IIter1, typename _IIter2, typename _Compare>
+ bool
+ lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2, _Compare);
+
+ template<typename _FIter>
+ _FIter
+ max_element(_FIter, _FIter);
+
+ template<typename _FIter, typename _Compare>
+ _FIter
+ max_element(_FIter, _FIter, _Compare);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Compare>
+ _OIter
+ merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
+
+ template<typename _FIter>
+ _FIter
+ min_element(_FIter, _FIter);
+
+ template<typename _FIter, typename _Compare>
+ _FIter
+ min_element(_FIter, _FIter, _Compare);
+
+ template<typename _IIter1, typename _IIter2>
+ pair<_IIter1, _IIter2>
+ mismatch(_IIter1, _IIter1, _IIter2);
+
+ template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
+ pair<_IIter1, _IIter2>
+ mismatch(_IIter1, _IIter1, _IIter2, _BinaryPredicate);
+
+ template<typename _RAIter>
+ void
+ nth_element(_RAIter, _RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ nth_element(_RAIter, _RAIter, _RAIter, _Compare);
+
+ template<typename _RAIter>
+ void
+ partial_sort(_RAIter, _RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ partial_sort(_RAIter, _RAIter, _RAIter, _Compare);
+
+ template<typename _BIter, typename _Predicate>
+ _BIter
+ partition(_BIter, _BIter, _Predicate);
+
+ template<typename _RAIter>
+ void
+ random_shuffle(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Generator>
+ void
+ random_shuffle(_RAIter, _RAIter, _Generator&);
+
+ template<typename _FIter, typename _Tp>
+ void
+ replace(_FIter, _FIter, const _Tp&, const _Tp&);
+
+ template<typename _FIter, typename _Predicate, typename _Tp>
+ void
+ replace_if(_FIter, _FIter, _Predicate, const _Tp&);
+
+ template<typename _FIter1, typename _FIter2>
+ _FIter1
+ search(_FIter1, _FIter1, _FIter2, _FIter2);
+
+ template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
+ _FIter1
+ search(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
+
+ template<typename _FIter, typename _Size, typename _Tp>
+ _FIter
+ search_n(_FIter, _FIter, _Size, const _Tp&);
+
+ template<typename _FIter, typename _Size, typename _Tp,
+ typename _BinaryPredicate>
+ _FIter
+ search_n(_FIter, _FIter, _Size, const _Tp&, _BinaryPredicate);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Compare>
+ _OIter
+ set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Compare>
+ _OIter
+ set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Compare>
+ _OIter
+ set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2,
+ _OIter, _Compare);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Compare>
+ _OIter
+ set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
+
+ template<typename _RAIter>
+ void
+ sort(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ sort(_RAIter, _RAIter, _Compare);
+
+ template<typename _RAIter>
+ void
+ stable_sort(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ stable_sort(_RAIter, _RAIter, _Compare);
+
+ template<typename _IIter, typename _OIter, typename _UnaryOperation>
+ _OIter
+ transform(_IIter, _IIter, _OIter, _UnaryOperation);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _BinaryOperation>
+ _OIter
+ transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation);
+
+ template<typename _IIter, typename _OIter>
+ _OIter
+ unique_copy(_IIter, _IIter, _OIter);
+
+ template<typename _IIter, typename _OIter, typename _BinaryPredicate>
+ _OIter
+ unique_copy(_IIter, _IIter, _OIter, _BinaryPredicate);
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#ifdef _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
+# include <parallel/algorithmfwd.h>
+#endif
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/allocator.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/allocator.h
new file mode 100644
index 0000000..334fee5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/allocator.h
@@ -0,0 +1,181 @@
+// Allocators -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996-1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file allocator.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _ALLOCATOR_H
+#define _ALLOCATOR_H 1
+
+// Define the base class to std::allocator.
+#include <bits/c++allocator.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @defgroup allocators Allocators
+ * @ingroup memory
+ *
+ * Classes encapsulating memory operations.
+ */
+
+ template<typename _Tp>
+ class allocator;
+
+ /// allocator<void> specialization.
+ template<>
+ class allocator<void>
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef void* pointer;
+ typedef const void* const_pointer;
+ typedef void value_type;
+
+ template<typename _Tp1>
+ struct rebind
+ { typedef allocator<_Tp1> other; };
+ };
+
+ /**
+ * @brief The "standard" allocator, as per [20.4].
+ * @ingroup allocators
+ *
+ * Further details:
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt04ch11.html
+ */
+ template<typename _Tp>
+ class allocator: public __glibcxx_base_allocator<_Tp>
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+
+ template<typename _Tp1>
+ struct rebind
+ { typedef allocator<_Tp1> other; };
+
+ allocator() throw() { }
+
+ allocator(const allocator& __a) throw()
+ : __glibcxx_base_allocator<_Tp>(__a) { }
+
+ template<typename _Tp1>
+ allocator(const allocator<_Tp1>&) throw() { }
+
+ ~allocator() throw() { }
+
+ // Inherit everything else.
+ };
+
+ template<typename _T1, typename _T2>
+ inline bool
+ operator==(const allocator<_T1>&, const allocator<_T2>&)
+ { return true; }
+
+ template<typename _Tp>
+ inline bool
+ operator==(const allocator<_Tp>&, const allocator<_Tp>&)
+ { return true; }
+
+ template<typename _T1, typename _T2>
+ inline bool
+ operator!=(const allocator<_T1>&, const allocator<_T2>&)
+ { return false; }
+
+ template<typename _Tp>
+ inline bool
+ operator!=(const allocator<_Tp>&, const allocator<_Tp>&)
+ { return false; }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class allocator<char>;
+ extern template class allocator<wchar_t>;
+#endif
+
+ // Undefine.
+#undef __glibcxx_base_allocator
+
+ // To implement Option 3 of DR 431.
+ template<typename _Alloc, bool = __is_empty(_Alloc)>
+ struct __alloc_swap
+ { static void _S_do_it(_Alloc&, _Alloc&) { } };
+
+ template<typename _Alloc>
+ struct __alloc_swap<_Alloc, false>
+ {
+ static void
+ _S_do_it(_Alloc& __one, _Alloc& __two)
+ {
+ // Precondition: swappable allocators.
+ if (__one != __two)
+ swap(__one, __two);
+ }
+ };
+
+ // Optimize for stateless allocators.
+ template<typename _Alloc, bool = __is_empty(_Alloc)>
+ struct __alloc_neq
+ {
+ static bool
+ _S_do_it(const _Alloc&, const _Alloc&)
+ { return false; }
+ };
+
+ template<typename _Alloc>
+ struct __alloc_neq<_Alloc, false>
+ {
+ static bool
+ _S_do_it(const _Alloc& __one, const _Alloc& __two)
+ { return __one != __two; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/atomic_0.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/atomic_0.h
new file mode 100644
index 0000000..a493ea6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/atomic_0.h
@@ -0,0 +1,463 @@
+// -*- C++ -*- header.
+
+// Copyright (C) 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/atomic_0.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_ATOMIC_0_H
+#define _GLIBCXX_ATOMIC_0_H 1
+
+#pragma GCC system_header
+
+// _GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 0 == __atomic0 == Never lock-free
+namespace __atomic0
+{
+ struct atomic_flag;
+
+ // Implementation specific defines.
+#define _ATOMIC_LOAD_(__a, __x) \
+ ({ volatile __typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
+ volatile __atomic_flag_base* __g = __atomic_flag_for_address(__p); \
+ __atomic_flag_wait_explicit(__g, __x); \
+ __typeof__ _ATOMIC_MEMBER_ __r = *__p; \
+ atomic_flag_clear_explicit(__g, __x); \
+ __r; })
+
+#define _ATOMIC_STORE_(__a, __m, __x) \
+ ({ volatile __typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
+ __typeof__(__m) __v = (__m); \
+ volatile __atomic_flag_base* __g = __atomic_flag_for_address(__p); \
+ __atomic_flag_wait_explicit(__g, __x); \
+ *__p = __v; \
+ atomic_flag_clear_explicit(__g, __x); \
+ __v; })
+
+#define _ATOMIC_MODIFY_(__a, __o, __m, __x) \
+ ({ volatile __typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
+ __typeof__(__m) __v = (__m); \
+ volatile __atomic_flag_base* __g = __atomic_flag_for_address(__p); \
+ __atomic_flag_wait_explicit(__g, __x); \
+ __typeof__ _ATOMIC_MEMBER_ __r = *__p; \
+ *__p __o __v; \
+ atomic_flag_clear_explicit(__g, __x); \
+ __r; })
+
+#define _ATOMIC_CMPEXCHNG_(__a, __e, __m, __x) \
+ ({ volatile __typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
+ __typeof__(__e) __q = (__e); \
+ __typeof__(__m) __v = (__m); \
+ bool __r; \
+ volatile __atomic_flag_base* __g = __atomic_flag_for_address(__p); \
+ __atomic_flag_wait_explicit(__g, __x); \
+ __typeof__ _ATOMIC_MEMBER_ __t__ = *__p; \
+ if (__t__ == *__q) { *__p = __v; __r = true; } \
+ else { *__q = __t__; __r = false; } \
+ atomic_flag_clear_explicit(__g, __x); \
+ __r; })
+
+ /// atomic_flag
+ struct atomic_flag : private __atomic_flag_base
+ {
+ atomic_flag() = default;
+ ~atomic_flag() = default;
+ atomic_flag(const atomic_flag&) = delete;
+ atomic_flag& operator=(const atomic_flag&) = delete;
+
+ atomic_flag(bool __i) { _M_i = __i; } // XXX deleted copy ctor != agg
+
+ bool
+ test_and_set(memory_order __m = memory_order_seq_cst) volatile;
+
+ void
+ clear(memory_order __m = memory_order_seq_cst) volatile;
+ };
+
+ /// 29.4.2, address types
+ struct atomic_address
+ {
+ private:
+ void* _M_i;
+
+ public:
+ atomic_address() = default;
+ ~atomic_address() = default;
+ atomic_address(const atomic_address&) = delete;
+ atomic_address& operator=(const atomic_address&) = delete;
+
+ atomic_address(void* __v) { _M_i = __v; }
+
+ bool
+ is_lock_free() const volatile
+ { return false; }
+
+ void
+ store(void* __v, memory_order __m = memory_order_seq_cst) volatile
+ {
+ __glibcxx_assert(__m != memory_order_acquire);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+ __glibcxx_assert(__m != memory_order_consume);
+ _ATOMIC_STORE_(this, __v, __m);
+ }
+
+ void*
+ load(memory_order __m = memory_order_seq_cst) const volatile
+ {
+ __glibcxx_assert(__m != memory_order_release);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+ return _ATOMIC_LOAD_(this, __m);
+ }
+
+ void*
+ exchange(void* __v, memory_order __m = memory_order_seq_cst) volatile
+ { return _ATOMIC_MODIFY_(this, =, __v, __m); }
+
+ bool
+ compare_exchange_weak(void*& __v1, void* __v2, memory_order __m1,
+ memory_order __m2) volatile
+ {
+ __glibcxx_assert(__m2 != memory_order_release);
+ __glibcxx_assert(__m2 != memory_order_acq_rel);
+ __glibcxx_assert(__m2 <= __m1);
+ return _ATOMIC_CMPEXCHNG_(this, &__v1, __v2, __m1);
+ }
+
+ bool
+ compare_exchange_weak(void*& __v1, void* __v2,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ return compare_exchange_weak(__v1, __v2, __m,
+ __calculate_memory_order(__m));
+ }
+
+ bool
+ compare_exchange_strong(void*& __v1, void* __v2, memory_order __m1,
+ memory_order __m2) volatile
+ {
+ __glibcxx_assert(__m2 != memory_order_release);
+ __glibcxx_assert(__m2 != memory_order_acq_rel);
+ __glibcxx_assert(__m2 <= __m1);
+ return _ATOMIC_CMPEXCHNG_(this, &__v1, __v2, __m1);
+ }
+
+ bool
+ compare_exchange_strong(void*& __v1, void* __v2,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ return compare_exchange_strong(__v1, __v2, __m,
+ __calculate_memory_order(__m));
+ }
+
+ void*
+ fetch_add(ptrdiff_t __d, memory_order __m = memory_order_seq_cst) volatile
+ {
+ void* volatile* __p = &(_M_i);
+ volatile __atomic_flag_base* __g = __atomic_flag_for_address(__p);
+ __atomic_flag_wait_explicit(__g, __m);
+ void* __r = *__p;
+ *__p = (void*)((char*)(*__p) + __d);
+ atomic_flag_clear_explicit(__g, __m);
+ return __r;
+ }
+
+ void*
+ fetch_sub(ptrdiff_t __d, memory_order __m = memory_order_seq_cst) volatile
+ {
+ void* volatile* __p = &(_M_i);
+ volatile __atomic_flag_base* __g = __atomic_flag_for_address(__p);
+ __atomic_flag_wait_explicit(__g, __m);
+ void* __r = *__p;
+ *__p = (void*)((char*)(*__p) - __d);
+ atomic_flag_clear_explicit(__g, __m);
+ return __r;
+ }
+
+ operator void*() const volatile
+ { return load(); }
+
+ void*
+ operator=(void* __v) // XXX volatile
+ {
+ store(__v);
+ return __v;
+ }
+
+ void*
+ operator+=(ptrdiff_t __d) volatile
+ { return fetch_add(__d) + __d; }
+
+ void*
+ operator-=(ptrdiff_t __d) volatile
+ { return fetch_sub(__d) - __d; }
+ };
+
+
+ // 29.3.1 atomic integral types
+ // For each of the integral types, define atomic_[integral type] struct
+ //
+ // atomic_bool bool
+ // atomic_char char
+ // atomic_schar signed char
+ // atomic_uchar unsigned char
+ // atomic_short short
+ // atomic_ushort unsigned short
+ // atomic_int int
+ // atomic_uint unsigned int
+ // atomic_long long
+ // atomic_ulong unsigned long
+ // atomic_llong long long
+ // atomic_ullong unsigned long long
+ // atomic_char16_t char16_t
+ // atomic_char32_t char32_t
+ // atomic_wchar_t wchar_t
+
+ // Base type.
+ // NB: Assuming _ITp is an integral scalar type that is 1, 2, 4, or 8 bytes,
+ // since that is what GCC built-in functions for atomic memory access work on.
+ template<typename _ITp>
+ struct __atomic_base
+ {
+ private:
+ typedef _ITp __integral_type;
+
+ __integral_type _M_i;
+
+ public:
+ __atomic_base() = default;
+ ~__atomic_base() = default;
+ __atomic_base(const __atomic_base&) = delete;
+ __atomic_base& operator=(const __atomic_base&) = delete;
+
+ // Requires __integral_type convertible to _M_base._M_i.
+ __atomic_base(__integral_type __i) { _M_i = __i; }
+
+ operator __integral_type() const volatile
+ { return load(); }
+
+ __integral_type
+ operator=(__integral_type __i) // XXX volatile
+ {
+ store(__i);
+ return __i;
+ }
+
+ __integral_type
+ operator++(int) volatile
+ { return fetch_add(1); }
+
+ __integral_type
+ operator--(int) volatile
+ { return fetch_sub(1); }
+
+ __integral_type
+ operator++() volatile
+ { return fetch_add(1) + 1; }
+
+ __integral_type
+ operator--() volatile
+ { return fetch_sub(1) - 1; }
+
+ __integral_type
+ operator+=(__integral_type __i) volatile
+ { return fetch_add(__i) + __i; }
+
+ __integral_type
+ operator-=(__integral_type __i) volatile
+ { return fetch_sub(__i) - __i; }
+
+ __integral_type
+ operator&=(__integral_type __i) volatile
+ { return fetch_and(__i) & __i; }
+
+ __integral_type
+ operator|=(__integral_type __i) volatile
+ { return fetch_or(__i) | __i; }
+
+ __integral_type
+ operator^=(__integral_type __i) volatile
+ { return fetch_xor(__i) ^ __i; }
+
+ bool
+ is_lock_free() const volatile
+ { return false; }
+
+ void
+ store(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ __glibcxx_assert(__m != memory_order_acquire);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+ __glibcxx_assert(__m != memory_order_consume);
+ _ATOMIC_STORE_(this, __i, __m);
+ }
+
+ __integral_type
+ load(memory_order __m = memory_order_seq_cst) const volatile
+ {
+ __glibcxx_assert(__m != memory_order_release);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+ return _ATOMIC_LOAD_(this, __m);
+ }
+
+ __integral_type
+ exchange(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return _ATOMIC_MODIFY_(this, =, __i, __m); }
+
+ bool
+ compare_exchange_weak(__integral_type& __i1, __integral_type __i2,
+ memory_order __m1, memory_order __m2) volatile
+ {
+ __glibcxx_assert(__m2 != memory_order_release);
+ __glibcxx_assert(__m2 != memory_order_acq_rel);
+ __glibcxx_assert(__m2 <= __m1);
+ return _ATOMIC_CMPEXCHNG_(this, &__i1, __i2, __m1);
+ }
+
+ bool
+ compare_exchange_weak(__integral_type& __i1, __integral_type __i2,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ return compare_exchange_weak(__i1, __i2, __m,
+ __calculate_memory_order(__m));
+ }
+
+ bool
+ compare_exchange_strong(__integral_type& __i1, __integral_type __i2,
+ memory_order __m1, memory_order __m2) volatile
+ {
+ __glibcxx_assert(__m2 != memory_order_release);
+ __glibcxx_assert(__m2 != memory_order_acq_rel);
+ __glibcxx_assert(__m2 <= __m1);
+ return _ATOMIC_CMPEXCHNG_(this, &__i1, __i2, __m1);
+ }
+
+ bool
+ compare_exchange_strong(__integral_type& __i1, __integral_type __i2,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ return compare_exchange_strong(__i1, __i2, __m,
+ __calculate_memory_order(__m));
+ }
+
+ __integral_type
+ fetch_add(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return _ATOMIC_MODIFY_(this, +=, __i, __m); }
+
+ __integral_type
+ fetch_sub(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return _ATOMIC_MODIFY_(this, -=, __i, __m); }
+
+ __integral_type
+ fetch_and(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return _ATOMIC_MODIFY_(this, &=, __i, __m); }
+
+ __integral_type
+ fetch_or(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return _ATOMIC_MODIFY_(this, |=, __i, __m); }
+
+ __integral_type
+ fetch_xor(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return _ATOMIC_MODIFY_(this, ^=, __i, __m); }
+ };
+
+
+ /// atomic_bool
+ // NB: No operators or fetch-operations for this type.
+ struct atomic_bool
+ {
+ private:
+ __atomic_base<bool> _M_base;
+
+ public:
+ atomic_bool() = default;
+ ~atomic_bool() = default;
+ atomic_bool(const atomic_bool&) = delete;
+ atomic_bool& operator=(const atomic_bool&) = delete;
+
+ atomic_bool(bool __i) : _M_base(__i) { }
+
+ bool
+ operator=(bool __i) // XXX volatile
+ { return _M_base.operator=(__i); }
+
+ operator bool() const volatile
+ { return _M_base.load(); }
+
+ bool
+ is_lock_free() const volatile
+ { return _M_base.is_lock_free(); }
+
+ void
+ store(bool __i, memory_order __m = memory_order_seq_cst) volatile
+ { _M_base.store(__i, __m); }
+
+ bool
+ load(memory_order __m = memory_order_seq_cst) const volatile
+ { return _M_base.load(__m); }
+
+ bool
+ exchange(bool __i, memory_order __m = memory_order_seq_cst) volatile
+ { return _M_base.exchange(__i, __m); }
+
+ bool
+ compare_exchange_weak(bool& __i1, bool __i2, memory_order __m1,
+ memory_order __m2) volatile
+ { return _M_base.compare_exchange_weak(__i1, __i2, __m1, __m2); }
+
+ bool
+ compare_exchange_weak(bool& __i1, bool __i2,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return _M_base.compare_exchange_weak(__i1, __i2, __m); }
+
+ bool
+ compare_exchange_strong(bool& __i1, bool __i2, memory_order __m1,
+ memory_order __m2) volatile
+ { return _M_base.compare_exchange_strong(__i1, __i2, __m1, __m2); }
+
+
+ bool
+ compare_exchange_strong(bool& __i1, bool __i2,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return _M_base.compare_exchange_strong(__i1, __i2, __m); }
+ };
+
+#undef _ATOMIC_LOAD_
+#undef _ATOMIC_STORE_
+#undef _ATOMIC_MODIFY_
+#undef _ATOMIC_CMPEXCHNG_
+} // namespace __atomic0
+
+// _GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/atomic_2.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/atomic_2.h
new file mode 100644
index 0000000..8e8e7ff
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/atomic_2.h
@@ -0,0 +1,453 @@
+// -*- C++ -*- header.
+
+// Copyright (C) 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/atomic_2.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_ATOMIC_2_H
+#define _GLIBCXX_ATOMIC_2_H 1
+
+#pragma GCC system_header
+
+// _GLIBCXX_BEGIN_NAMESPACE(std)
+
+// 2 == __atomic2 == Always lock-free
+// Assumed:
+// _GLIBCXX_ATOMIC_BUILTINS_1
+// _GLIBCXX_ATOMIC_BUILTINS_2
+// _GLIBCXX_ATOMIC_BUILTINS_4
+// _GLIBCXX_ATOMIC_BUILTINS_8
+namespace __atomic2
+{
+ /// atomic_flag
+ struct atomic_flag : private __atomic_flag_base
+ {
+ atomic_flag() = default;
+ ~atomic_flag() = default;
+ atomic_flag(const atomic_flag&) = delete;
+ atomic_flag& operator=(const atomic_flag&) = delete;
+
+ atomic_flag(bool __i) { _M_i = __i; } // XXX deleted copy ctor != agg
+
+ bool
+ test_and_set(memory_order __m = memory_order_seq_cst) volatile
+ {
+ // Redundant synchronize if built-in for lock is a full barrier.
+ if (__m != memory_order_acquire && __m != memory_order_acq_rel)
+ __sync_synchronize();
+ return __sync_lock_test_and_set(&_M_i, 1);
+ }
+
+ void
+ clear(memory_order __m = memory_order_seq_cst) volatile
+ {
+ __glibcxx_assert(__m != memory_order_consume);
+ __glibcxx_assert(__m != memory_order_acquire);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+
+ __sync_lock_release(&_M_i);
+ if (__m != memory_order_acquire && __m != memory_order_acq_rel)
+ __sync_synchronize();
+ }
+ };
+
+
+ /// 29.4.2, address types
+ struct atomic_address
+ {
+ private:
+ void* _M_i;
+
+ public:
+ atomic_address() = default;
+ ~atomic_address() = default;
+ atomic_address(const atomic_address&) = delete;
+ atomic_address& operator=(const atomic_address&) = delete;
+
+ atomic_address(void* __v) { _M_i = __v; }
+
+ bool
+ is_lock_free() const volatile
+ { return true; }
+
+ void
+ store(void* __v, memory_order __m = memory_order_seq_cst) volatile
+ {
+ __glibcxx_assert(__m != memory_order_acquire);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+ __glibcxx_assert(__m != memory_order_consume);
+
+ if (__m == memory_order_relaxed)
+ _M_i = __v;
+ else
+ {
+ // write_mem_barrier();
+ _M_i = __v;
+ if (__m = memory_order_seq_cst)
+ __sync_synchronize();
+ }
+ }
+
+ void*
+ load(memory_order __m = memory_order_seq_cst) const volatile
+ {
+ __glibcxx_assert(__m != memory_order_release);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+
+ __sync_synchronize();
+ void* __ret = _M_i;
+ __sync_synchronize();
+ return __ret;
+ }
+
+ void*
+ exchange(void* __v, memory_order __m = memory_order_seq_cst) volatile
+ {
+ // XXX built-in assumes memory_order_acquire.
+ return __sync_lock_test_and_set(&_M_i, __v);
+ }
+
+ bool
+ compare_exchange_weak(void*& __v1, void* __v2, memory_order __m1,
+ memory_order __m2) volatile
+ { return compare_exchange_strong(__v1, __v2, __m1, __m2); }
+
+ bool
+ compare_exchange_weak(void*& __v1, void* __v2,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ return compare_exchange_weak(__v1, __v2, __m,
+ __calculate_memory_order(__m));
+ }
+
+ bool
+ compare_exchange_strong(void*& __v1, void* __v2, memory_order __m1,
+ memory_order __m2) volatile
+ {
+ __glibcxx_assert(__m2 != memory_order_release);
+ __glibcxx_assert(__m2 != memory_order_acq_rel);
+ __glibcxx_assert(__m2 <= __m1);
+
+ void* __v1o = __v1;
+ void* __v1n = __sync_val_compare_and_swap(&_M_i, __v1o, __v2);
+
+ // Assume extra stores (of same value) allowed in true case.
+ __v1 = __v1n;
+ return __v1o == __v1n;
+ }
+
+ bool
+ compare_exchange_strong(void*& __v1, void* __v2,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ return compare_exchange_strong(__v1, __v2, __m,
+ __calculate_memory_order(__m));
+ }
+
+ void*
+ fetch_add(ptrdiff_t __d, memory_order __m = memory_order_seq_cst) volatile
+ { return __sync_fetch_and_add(&_M_i, __d); }
+
+ void*
+ fetch_sub(ptrdiff_t __d, memory_order __m = memory_order_seq_cst) volatile
+ { return __sync_fetch_and_sub(&_M_i, __d); }
+
+ operator void*() const volatile
+ { return load(); }
+
+ void*
+ operator=(void* __v) // XXX volatile
+ {
+ store(__v);
+ return __v;
+ }
+
+ void*
+ operator+=(ptrdiff_t __d) volatile
+ { return __sync_add_and_fetch(&_M_i, __d); }
+
+ void*
+ operator-=(ptrdiff_t __d) volatile
+ { return __sync_sub_and_fetch(&_M_i, __d); }
+ };
+
+ // 29.3.1 atomic integral types
+ // For each of the integral types, define atomic_[integral type] struct
+ //
+ // atomic_bool bool
+ // atomic_char char
+ // atomic_schar signed char
+ // atomic_uchar unsigned char
+ // atomic_short short
+ // atomic_ushort unsigned short
+ // atomic_int int
+ // atomic_uint unsigned int
+ // atomic_long long
+ // atomic_ulong unsigned long
+ // atomic_llong long long
+ // atomic_ullong unsigned long long
+ // atomic_char16_t char16_t
+ // atomic_char32_t char32_t
+ // atomic_wchar_t wchar_t
+
+ // Base type.
+ // NB: Assuming _ITp is an integral scalar type that is 1, 2, 4, or 8 bytes,
+ // since that is what GCC built-in functions for atomic memory access work on.
+ template<typename _ITp>
+ struct __atomic_base
+ {
+ private:
+ typedef _ITp __integral_type;
+
+ __integral_type _M_i;
+
+ public:
+ __atomic_base() = default;
+ ~__atomic_base() = default;
+ __atomic_base(const __atomic_base&) = delete;
+ __atomic_base& operator=(const __atomic_base&) = delete;
+
+ // Requires __integral_type convertible to _M_base._M_i.
+ __atomic_base(__integral_type __i) { _M_i = __i; }
+
+ operator __integral_type() const volatile
+ { return load(); }
+
+ __integral_type
+ operator=(__integral_type __i) // XXX volatile
+ {
+ store(__i);
+ return __i;
+ }
+
+ __integral_type
+ operator++(int) volatile
+ { return fetch_add(1); }
+
+ __integral_type
+ operator--(int) volatile
+ { return fetch_sub(1); }
+
+ __integral_type
+ operator++() volatile
+ { return __sync_add_and_fetch(&_M_i, 1); }
+
+ __integral_type
+ operator--() volatile
+ { return __sync_sub_and_fetch(&_M_i, 1); }
+
+ __integral_type
+ operator+=(__integral_type __i) volatile
+ { return __sync_add_and_fetch(&_M_i, __i); }
+
+ __integral_type
+ operator-=(__integral_type __i) volatile
+ { return __sync_sub_and_fetch(&_M_i, __i); }
+
+ __integral_type
+ operator&=(__integral_type __i) volatile
+ { return __sync_and_and_fetch(&_M_i, __i); }
+
+ __integral_type
+ operator|=(__integral_type __i) volatile
+ { return __sync_or_and_fetch(&_M_i, __i); }
+
+ __integral_type
+ operator^=(__integral_type __i) volatile
+ { return __sync_xor_and_fetch(&_M_i, __i); }
+
+ bool
+ is_lock_free() const volatile
+ { return true; }
+
+ void
+ store(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ __glibcxx_assert(__m != memory_order_acquire);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+ __glibcxx_assert(__m != memory_order_consume);
+
+ if (__m == memory_order_relaxed)
+ _M_i = __i;
+ else
+ {
+ // write_mem_barrier();
+ _M_i = __i;
+ if (__m = memory_order_seq_cst)
+ __sync_synchronize();
+ }
+ }
+
+ __integral_type
+ load(memory_order __m = memory_order_seq_cst) const volatile
+ {
+ __glibcxx_assert(__m != memory_order_release);
+ __glibcxx_assert(__m != memory_order_acq_rel);
+
+ __sync_synchronize();
+ __integral_type __ret = _M_i;
+ __sync_synchronize();
+ return __ret;
+ }
+
+ __integral_type
+ exchange(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ // XXX built-in assumes memory_order_acquire.
+ return __sync_lock_test_and_set(&_M_i, __i);
+ }
+
+ bool
+ compare_exchange_weak(__integral_type& __i1, __integral_type __i2,
+ memory_order __m1, memory_order __m2) volatile
+ { return compare_exchange_strong(__i1, __i2, __m1, __m2); }
+
+ bool
+ compare_exchange_weak(__integral_type& __i1, __integral_type __i2,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ return compare_exchange_weak(__i1, __i2, __m,
+ __calculate_memory_order(__m));
+ }
+
+ bool
+ compare_exchange_strong(__integral_type& __i1, __integral_type __i2,
+ memory_order __m1, memory_order __m2) volatile
+ {
+ __glibcxx_assert(__m2 != memory_order_release);
+ __glibcxx_assert(__m2 != memory_order_acq_rel);
+ __glibcxx_assert(__m2 <= __m1);
+
+ __integral_type __i1o = __i1;
+ __integral_type __i1n = __sync_val_compare_and_swap(&_M_i, __i1o, __i2);
+
+ // Assume extra stores (of same value) allowed in true case.
+ __i1 = __i1n;
+ return __i1o == __i1n;
+ }
+
+ bool
+ compare_exchange_strong(__integral_type& __i1, __integral_type __i2,
+ memory_order __m = memory_order_seq_cst) volatile
+ {
+ return compare_exchange_strong(__i1, __i2, __m,
+ __calculate_memory_order(__m));
+ }
+
+ __integral_type
+ fetch_add(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return __sync_fetch_and_add(&_M_i, __i); }
+
+ __integral_type
+ fetch_sub(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return __sync_fetch_and_sub(&_M_i, __i); }
+
+ __integral_type
+ fetch_and(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return __sync_fetch_and_and(&_M_i, __i); }
+
+ __integral_type
+ fetch_or(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return __sync_fetch_and_or(&_M_i, __i); }
+
+ __integral_type
+ fetch_xor(__integral_type __i,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return __sync_fetch_and_xor(&_M_i, __i); }
+ };
+
+
+ /// atomic_bool
+ // NB: No operators or fetch-operations for this type.
+ struct atomic_bool
+ {
+ private:
+ __atomic_base<bool> _M_base;
+
+ public:
+ atomic_bool() = default;
+ ~atomic_bool() = default;
+ atomic_bool(const atomic_bool&) = delete;
+ atomic_bool& operator=(const atomic_bool&) = delete;
+
+ atomic_bool(bool __i) : _M_base(__i) { }
+
+ bool
+ operator=(bool __i) // XXX volatile
+ { return _M_base.operator=(__i); }
+
+ operator bool() const volatile
+ { return _M_base.load(); }
+
+ bool
+ is_lock_free() const volatile
+ { return _M_base.is_lock_free(); }
+
+ void
+ store(bool __i, memory_order __m = memory_order_seq_cst) volatile
+ { _M_base.store(__i, __m); }
+
+ bool
+ load(memory_order __m = memory_order_seq_cst) const volatile
+ { return _M_base.load(__m); }
+
+ bool
+ exchange(bool __i, memory_order __m = memory_order_seq_cst) volatile
+ { return _M_base.exchange(__i, __m); }
+
+ bool
+ compare_exchange_weak(bool& __i1, bool __i2, memory_order __m1,
+ memory_order __m2) volatile
+ { return _M_base.compare_exchange_weak(__i1, __i2, __m1, __m2); }
+
+ bool
+ compare_exchange_weak(bool& __i1, bool __i2,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return _M_base.compare_exchange_weak(__i1, __i2, __m); }
+
+ bool
+ compare_exchange_strong(bool& __i1, bool __i2, memory_order __m1,
+ memory_order __m2) volatile
+ { return _M_base.compare_exchange_strong(__i1, __i2, __m1, __m2); }
+
+
+ bool
+ compare_exchange_strong(bool& __i1, bool __i2,
+ memory_order __m = memory_order_seq_cst) volatile
+ { return _M_base.compare_exchange_strong(__i1, __i2, __m); }
+ };
+} // namespace __atomic2
+
+// _GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/atomicfwd_c.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/atomicfwd_c.h
new file mode 100644
index 0000000..0841843
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/atomicfwd_c.h
@@ -0,0 +1,174 @@
+// -*- C++ -*- header.
+
+// Copyright (C) 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/atomicfwd_c.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// "C" only bits.
+
+#define _ATOMIC_MEMBER_ ((__a)->_M_i)
+
+ // POD base classes for atomic intgral types.
+ struct __atomic_bool_base
+ {
+ bool _M_i;
+ };
+
+ struct __atomic_char_base
+ {
+ char _M_i;
+ };
+
+ struct __atomic_schar_base
+ {
+ signed char _M_i;
+ };
+
+ struct __atomic_uchar_base
+ {
+ unsigned char _M_i;
+ };
+
+ struct __atomic_short_base
+ {
+ short _M_i;
+ };
+
+ struct __atomic_ushort_base
+ {
+ unsigned short _M_i;
+ };
+
+ struct __atomic_int_base
+ {
+ int _M_i;
+ };
+
+ struct __atomic_uint_base
+ {
+ unsigned int _M_i;
+ };
+
+ struct __atomic_long_base
+ {
+ long _M_i;
+ };
+
+ struct __atomic_ulong_base
+ {
+ unsigned long _M_i;
+ };
+
+ struct __atomic_llong_base
+ {
+ long long _M_i;
+ };
+
+ struct __atomic_ullong_base
+ {
+ unsigned long long _M_i;
+ };
+
+ struct __atomic_wchar_t_base
+ {
+ wchar_t _M_i;
+ };
+
+ typedef struct __atomic_flag_base atomic_flag;
+ typedef struct __atomic_address_base atomic_address;
+ typedef struct __atomic_bool_base atomic_bool;
+ typedef struct __atomic_char_base atomic_char;
+ typedef struct __atomic_schar_base atomic_schar;
+ typedef struct __atomic_uchar_base atomic_uchar;
+ typedef struct __atomic_short_base atomic_short;
+ typedef struct __atomic_ushort_base atomic_ushort;
+ typedef struct __atomic_int_base atomic_int;
+ typedef struct __atomic_uint_base atomic_uint;
+ typedef struct __atomic_long_base atomic_long;
+ typedef struct __atomic_ulong_base atomic_ulong;
+ typedef struct __atomic_llong_base atomic_llong;
+ typedef struct __atomic_ullong_base atomic_ullong;
+ typedef struct __atomic_wchar_t_base atomic_wchar_t;
+ typedef struct __atomic_short_base atomic_char16_t;
+ typedef struct __atomic_int_base atomic_char32_t;
+
+#define atomic_is_lock_free(__a) \
+ false
+
+#define atomic_load_explicit(__a, __x) \
+ _ATOMIC_LOAD_(__a, __x)
+
+#define atomic_load(__a) \
+ atomic_load_explicit(__a, memory_order_seq_cst)
+
+#define atomic_store_explicit(__a, __m, __x) \
+ _ATOMIC_STORE_(__a, __m, __x)
+
+#define atomic_store(__a, __m) \
+ atomic_store_explicit(__a, __m, memory_order_seq_cst)
+
+#define atomic_exchange_explicit(__a, __m, __x) \
+ _ATOMIC_MODIFY_(__a, =, __m, __x)
+
+#define atomic_exchange(__a, __m) \
+ atomic_exchange_explicit(__a, __m, memory_order_seq_cst)
+
+#define atomic_compare_exchange_explicit(__a, __e, __m, __x, __y) \
+ _ATOMIC_CMPEXCHNG_(__a, __e, __m, __x)
+
+#define atomic_compare_exchange(__a, __e, __m) \
+ _ATOMIC_CMPEXCHNG_(__a, __e, __m, memory_order_seq_cst)
+
+#define atomic_fetch_add_explicit(__a, __m, __x) \
+ _ATOMIC_MODIFY_(__a, +=, __m, __x)
+
+#define atomic_fetch_add(__a, __m) \
+ atomic_fetch_add_explicit(__a, __m, memory_order_seq_cst)
+
+#define atomic_fetch_sub_explicit(__a, __m, __x) \
+ _ATOMIC_MODIFY_(__a, -=, __m, __x)
+
+#define atomic_fetch_sub(__a, __m) \
+ atomic_fetch_sub_explicit(__a, __m, memory_order_seq_cst)
+
+#define atomic_fetch_and_explicit(__a, __m, __x) \
+ _ATOMIC_MODIFY_(__a, &=, __m, __x)
+
+#define atomic_fetch_and(__a, __m) \
+ atomic_fetch_and_explicit(__a, __m, memory_order_seq_cst)
+
+#define atomic_fetch_or_explicit(__a, __m, __x) \
+ _ATOMIC_MODIFY_(__a, |=, __m, __x)
+
+#define atomic_fetch_or(__a, __m) \
+ atomic_fetch_or_explicit(__a, __m, memory_order_seq_cst)
+
+#define atomic_fetch_xor_explicit(__a, __m, __x) \
+ _ATOMIC_MODIFY_(__a, ^=, __m, __x)
+
+#define atomic_fetch_xor(__a, __m) \
+ atomic_fetch_xor_explicit(__a, __m, memory_order_seq_cst)
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/atomicfwd_cxx.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/atomicfwd_cxx.h
new file mode 100644
index 0000000..8b67635
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/atomicfwd_cxx.h
@@ -0,0 +1,109 @@
+// -*- C++ -*- header.
+
+// Copyright (C) 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/atomicfwd_cxx.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// "C++" only bits.
+
+#define _ATOMIC_MEMBER_ _M_i
+
+_GLIBCXX_END_EXTERN_C
+
+ namespace __atomic0
+ {
+ template<typename _IntTp>
+ struct __atomic_base;
+
+ struct atomic_flag;
+ struct atomic_address;
+ struct atomic_bool;
+ }
+
+ namespace __atomic2
+ {
+ template<typename _IntTp>
+ struct __atomic_base;
+
+ struct atomic_flag;
+ struct atomic_address;
+ struct atomic_bool;
+ }
+
+ namespace __atomic1
+ {
+ using __atomic2::atomic_flag;
+ using __atomic2::atomic_bool;
+ using __atomic0::atomic_address;
+ using __atomic0::__atomic_base;
+ }
+
+ /// atomic_char
+ typedef __atomic_base<char> atomic_char;
+
+ /// atomic_schar
+ typedef __atomic_base<signed char> atomic_schar;
+
+ /// atomic_uchar
+ typedef __atomic_base<unsigned char> atomic_uchar;
+
+ /// atomic_short
+ typedef __atomic_base<short> atomic_short;
+
+ /// atomic_ushort
+ typedef __atomic_base<unsigned short> atomic_ushort;
+
+ /// atomic_int
+ typedef __atomic_base<int> atomic_int;
+
+ /// atomic_uint
+ typedef __atomic_base<unsigned int> atomic_uint;
+
+ /// atomic_long
+ typedef __atomic_base<long> atomic_long;
+
+ /// atomic_ulong
+ typedef __atomic_base<unsigned long> atomic_ulong;
+
+ /// atomic_llong
+ typedef __atomic_base<long long> atomic_llong;
+
+ /// atomic_ullong
+ typedef __atomic_base<unsigned long long> atomic_ullong;
+
+ /// atomic_wchar_t
+ typedef __atomic_base<wchar_t> atomic_wchar_t;
+
+ /// atomic_char16_t
+ typedef __atomic_base<char16_t> atomic_char16_t;
+
+ /// atomic_char32_t
+ typedef __atomic_base<char32_t> atomic_char32_t;
+
+ template<typename _Tp>
+ struct atomic;
+_GLIBCXX_BEGIN_EXTERN_C
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/basic_ios.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/basic_ios.h
new file mode 100644
index 0000000..ee1b646
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/basic_ios.h
@@ -0,0 +1,474 @@
+// Iostreams base classes -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file basic_ios.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _BASIC_IOS_H
+#define _BASIC_IOS_H 1
+
+#pragma GCC system_header
+
+#include <bits/localefwd.h>
+#include <bits/locale_classes.h>
+#include <bits/locale_facets.h>
+#include <bits/streambuf_iterator.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _Facet>
+ inline const _Facet&
+ __check_facet(const _Facet* __f)
+ {
+ if (!__f)
+ __throw_bad_cast();
+ return *__f;
+ }
+
+ // 27.4.5 Template class basic_ios
+ /**
+ * @brief Virtual base class for all stream classes.
+ * @ingroup io
+ *
+ * Most of the member functions called dispatched on stream objects
+ * (e.g., @c std::cout.foo(bar);) are consolidated in this class.
+ */
+ template<typename _CharT, typename _Traits>
+ class basic_ios : public ios_base
+ {
+ public:
+ //@{
+ /**
+ * These are standard types. They permit a standardized way of
+ * referring to names of (or names dependant on) the template
+ * parameters, which are specific to the implementation.
+ */
+ typedef _CharT char_type;
+ typedef typename _Traits::int_type int_type;
+ typedef typename _Traits::pos_type pos_type;
+ typedef typename _Traits::off_type off_type;
+ typedef _Traits traits_type;
+ //@}
+
+ //@{
+ /**
+ * These are non-standard types.
+ */
+ typedef ctype<_CharT> __ctype_type;
+ typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
+ __num_put_type;
+ typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
+ __num_get_type;
+ //@}
+
+ // Data members:
+ protected:
+ basic_ostream<_CharT, _Traits>* _M_tie;
+ mutable char_type _M_fill;
+ mutable bool _M_fill_init;
+ basic_streambuf<_CharT, _Traits>* _M_streambuf;
+
+ // Cached use_facet<ctype>, which is based on the current locale info.
+ const __ctype_type* _M_ctype;
+ // For ostream.
+ const __num_put_type* _M_num_put;
+ // For istream.
+ const __num_get_type* _M_num_get;
+
+ public:
+ //@{
+ /**
+ * @brief The quick-and-easy status check.
+ *
+ * This allows you to write constructs such as
+ * "if (!a_stream) ..." and "while (a_stream) ..."
+ */
+ operator void*() const
+ { return this->fail() ? 0 : const_cast<basic_ios*>(this); }
+
+ bool
+ operator!() const
+ { return this->fail(); }
+ //@}
+
+ /**
+ * @brief Returns the error state of the stream buffer.
+ * @return A bit pattern (well, isn't everything?)
+ *
+ * See std::ios_base::iostate for the possible bit values. Most
+ * users will call one of the interpreting wrappers, e.g., good().
+ */
+ iostate
+ rdstate() const
+ { return _M_streambuf_state; }
+
+ /**
+ * @brief [Re]sets the error state.
+ * @param state The new state flag(s) to set.
+ *
+ * See std::ios_base::iostate for the possible bit values. Most
+ * users will not need to pass an argument.
+ */
+ void
+ clear(iostate __state = goodbit);
+
+ /**
+ * @brief Sets additional flags in the error state.
+ * @param state The additional state flag(s) to set.
+ *
+ * See std::ios_base::iostate for the possible bit values.
+ */
+ void
+ setstate(iostate __state)
+ { this->clear(this->rdstate() | __state); }
+
+ // Flip the internal state on for the proper state bits, then re
+ // throws the propagated exception if bit also set in
+ // exceptions().
+ void
+ _M_setstate(iostate __state)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ _M_streambuf_state |= __state;
+ if (this->exceptions() & __state)
+ __throw_exception_again;
+ }
+
+ /**
+ * @brief Fast error checking.
+ * @return True if no error flags are set.
+ *
+ * A wrapper around rdstate.
+ */
+ bool
+ good() const
+ { return this->rdstate() == 0; }
+
+ /**
+ * @brief Fast error checking.
+ * @return True if the eofbit is set.
+ *
+ * Note that other iostate flags may also be set.
+ */
+ bool
+ eof() const
+ { return (this->rdstate() & eofbit) != 0; }
+
+ /**
+ * @brief Fast error checking.
+ * @return True if either the badbit or the failbit is set.
+ *
+ * Checking the badbit in fail() is historical practice.
+ * Note that other iostate flags may also be set.
+ */
+ bool
+ fail() const
+ { return (this->rdstate() & (badbit | failbit)) != 0; }
+
+ /**
+ * @brief Fast error checking.
+ * @return True if the badbit is set.
+ *
+ * Note that other iostate flags may also be set.
+ */
+ bool
+ bad() const
+ { return (this->rdstate() & badbit) != 0; }
+
+ /**
+ * @brief Throwing exceptions on errors.
+ * @return The current exceptions mask.
+ *
+ * This changes nothing in the stream. See the one-argument version
+ * of exceptions(iostate) for the meaning of the return value.
+ */
+ iostate
+ exceptions() const
+ { return _M_exception; }
+
+ /**
+ * @brief Throwing exceptions on errors.
+ * @param except The new exceptions mask.
+ *
+ * By default, error flags are set silently. You can set an
+ * exceptions mask for each stream; if a bit in the mask becomes set
+ * in the error flags, then an exception of type
+ * std::ios_base::failure is thrown.
+ *
+ * If the error flag is already set when the exceptions mask is
+ * added, the exception is immediately thrown. Try running the
+ * following under GCC 3.1 or later:
+ * @code
+ * #include <iostream>
+ * #include <fstream>
+ * #include <exception>
+ *
+ * int main()
+ * {
+ * std::set_terminate (__gnu_cxx::__verbose_terminate_handler);
+ *
+ * std::ifstream f ("/etc/motd");
+ *
+ * std::cerr << "Setting badbit\n";
+ * f.setstate (std::ios_base::badbit);
+ *
+ * std::cerr << "Setting exception mask\n";
+ * f.exceptions (std::ios_base::badbit);
+ * }
+ * @endcode
+ */
+ void
+ exceptions(iostate __except)
+ {
+ _M_exception = __except;
+ this->clear(_M_streambuf_state);
+ }
+
+ // Constructor/destructor:
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * The parameter is passed by derived streams.
+ */
+ explicit
+ basic_ios(basic_streambuf<_CharT, _Traits>* __sb)
+ : ios_base(), _M_tie(0), _M_fill(), _M_fill_init(false), _M_streambuf(0),
+ _M_ctype(0), _M_num_put(0), _M_num_get(0)
+ { this->init(__sb); }
+
+ /**
+ * @brief Empty.
+ *
+ * The destructor does nothing. More specifically, it does not
+ * destroy the streambuf held by rdbuf().
+ */
+ virtual
+ ~basic_ios() { }
+
+ // Members:
+ /**
+ * @brief Fetches the current @e tied stream.
+ * @return A pointer to the tied stream, or NULL if the stream is
+ * not tied.
+ *
+ * A stream may be @e tied (or synchronized) to a second output
+ * stream. When this stream performs any I/O, the tied stream is
+ * first flushed. For example, @c std::cin is tied to @c std::cout.
+ */
+ basic_ostream<_CharT, _Traits>*
+ tie() const
+ { return _M_tie; }
+
+ /**
+ * @brief Ties this stream to an output stream.
+ * @param tiestr The output stream.
+ * @return The previously tied output stream, or NULL if the stream
+ * was not tied.
+ *
+ * This sets up a new tie; see tie() for more.
+ */
+ basic_ostream<_CharT, _Traits>*
+ tie(basic_ostream<_CharT, _Traits>* __tiestr)
+ {
+ basic_ostream<_CharT, _Traits>* __old = _M_tie;
+ _M_tie = __tiestr;
+ return __old;
+ }
+
+ /**
+ * @brief Accessing the underlying buffer.
+ * @return The current stream buffer.
+ *
+ * This does not change the state of the stream.
+ */
+ basic_streambuf<_CharT, _Traits>*
+ rdbuf() const
+ { return _M_streambuf; }
+
+ /**
+ * @brief Changing the underlying buffer.
+ * @param sb The new stream buffer.
+ * @return The previous stream buffer.
+ *
+ * Associates a new buffer with the current stream, and clears the
+ * error state.
+ *
+ * Due to historical accidents which the LWG refuses to correct, the
+ * I/O library suffers from a design error: this function is hidden
+ * in derived classes by overrides of the zero-argument @c rdbuf(),
+ * which is non-virtual for hysterical raisins. As a result, you
+ * must use explicit qualifications to access this function via any
+ * derived class. For example:
+ *
+ * @code
+ * std::fstream foo; // or some other derived type
+ * std::streambuf* p = .....;
+ *
+ * foo.ios::rdbuf(p); // ios == basic_ios<char>
+ * @endcode
+ */
+ basic_streambuf<_CharT, _Traits>*
+ rdbuf(basic_streambuf<_CharT, _Traits>* __sb);
+
+ /**
+ * @brief Copies fields of __rhs into this.
+ * @param __rhs The source values for the copies.
+ * @return Reference to this object.
+ *
+ * All fields of __rhs are copied into this object except that rdbuf()
+ * and rdstate() remain unchanged. All values in the pword and iword
+ * arrays are copied. Before copying, each callback is invoked with
+ * erase_event. After copying, each (new) callback is invoked with
+ * copyfmt_event. The final step is to copy exceptions().
+ */
+ basic_ios&
+ copyfmt(const basic_ios& __rhs);
+
+ /**
+ * @brief Retrieves the "empty" character.
+ * @return The current fill character.
+ *
+ * It defaults to a space (' ') in the current locale.
+ */
+ char_type
+ fill() const
+ {
+ if (!_M_fill_init)
+ {
+ _M_fill = this->widen(' ');
+ _M_fill_init = true;
+ }
+ return _M_fill;
+ }
+
+ /**
+ * @brief Sets a new "empty" character.
+ * @param ch The new character.
+ * @return The previous fill character.
+ *
+ * The fill character is used to fill out space when P+ characters
+ * have been requested (e.g., via setw), Q characters are actually
+ * used, and Q<P. It defaults to a space (' ') in the current locale.
+ */
+ char_type
+ fill(char_type __ch)
+ {
+ char_type __old = this->fill();
+ _M_fill = __ch;
+ return __old;
+ }
+
+ // Locales:
+ /**
+ * @brief Moves to a new locale.
+ * @param loc The new locale.
+ * @return The previous locale.
+ *
+ * Calls @c ios_base::imbue(loc), and if a stream buffer is associated
+ * with this stream, calls that buffer's @c pubimbue(loc).
+ *
+ * Additional l10n notes are at
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
+ */
+ locale
+ imbue(const locale& __loc);
+
+ /**
+ * @brief Squeezes characters.
+ * @param c The character to narrow.
+ * @param dfault The character to narrow.
+ * @return The narrowed character.
+ *
+ * Maps a character of @c char_type to a character of @c char,
+ * if possible.
+ *
+ * Returns the result of
+ * @code
+ * std::use_facet<ctype<char_type> >(getloc()).narrow(c,dfault)
+ * @endcode
+ *
+ * Additional l10n notes are at
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
+ */
+ char
+ narrow(char_type __c, char __dfault) const
+ { return __check_facet(_M_ctype).narrow(__c, __dfault); }
+
+ /**
+ * @brief Widens characters.
+ * @param c The character to widen.
+ * @return The widened character.
+ *
+ * Maps a character of @c char to a character of @c char_type.
+ *
+ * Returns the result of
+ * @code
+ * std::use_facet<ctype<char_type> >(getloc()).widen(c)
+ * @endcode
+ *
+ * Additional l10n notes are at
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
+ */
+ char_type
+ widen(char __c) const
+ { return __check_facet(_M_ctype).widen(__c); }
+
+ protected:
+ // 27.4.5.1 basic_ios constructors
+ /**
+ * @brief Empty.
+ *
+ * The default constructor does nothing and is not normally
+ * accessible to users.
+ */
+ basic_ios()
+ : ios_base(), _M_tie(0), _M_fill(char_type()), _M_fill_init(false),
+ _M_streambuf(0), _M_ctype(0), _M_num_put(0), _M_num_get(0)
+ { }
+
+ /**
+ * @brief All setup is performed here.
+ *
+ * This is called from the public constructor. It is not virtual and
+ * cannot be redefined.
+ */
+ void
+ init(basic_streambuf<_CharT, _Traits>* __sb);
+
+ void
+ _M_cache_locale(const locale& __loc);
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+#include <bits/basic_ios.tcc>
+#endif
+
+#endif /* _BASIC_IOS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/basic_ios.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/basic_ios.tcc
new file mode 100644
index 0000000..a0dc67e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/basic_ios.tcc
@@ -0,0 +1,187 @@
+// basic_ios member functions -*- C++ -*-
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+// 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file basic_ios.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _BASIC_IOS_TCC
+#define _BASIC_IOS_TCC 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, typename _Traits>
+ void
+ basic_ios<_CharT, _Traits>::clear(iostate __state)
+ {
+ if (this->rdbuf())
+ _M_streambuf_state = __state;
+ else
+ _M_streambuf_state = __state | badbit;
+ if (this->exceptions() & this->rdstate())
+ __throw_ios_failure(__N("basic_ios::clear"));
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_streambuf<_CharT, _Traits>*
+ basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
+ {
+ basic_streambuf<_CharT, _Traits>* __old = _M_streambuf;
+ _M_streambuf = __sb;
+ this->clear();
+ return __old;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ios<_CharT, _Traits>&
+ basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 292. effects of a.copyfmt (a)
+ if (this != &__rhs)
+ {
+ // Per 27.1.1, do not call imbue, yet must trash all caches
+ // associated with imbue()
+
+ // Alloc any new word array first, so if it fails we have "rollback".
+ _Words* __words = (__rhs._M_word_size <= _S_local_word_size) ?
+ _M_local_word : new _Words[__rhs._M_word_size];
+
+ // Bump refs before doing callbacks, for safety.
+ _Callback_list* __cb = __rhs._M_callbacks;
+ if (__cb)
+ __cb->_M_add_reference();
+ _M_call_callbacks(erase_event);
+ if (_M_word != _M_local_word)
+ {
+ delete [] _M_word;
+ _M_word = 0;
+ }
+ _M_dispose_callbacks();
+
+ // NB: Don't want any added during above.
+ _M_callbacks = __cb;
+ for (int __i = 0; __i < __rhs._M_word_size; ++__i)
+ __words[__i] = __rhs._M_word[__i];
+ _M_word = __words;
+ _M_word_size = __rhs._M_word_size;
+
+ this->flags(__rhs.flags());
+ this->width(__rhs.width());
+ this->precision(__rhs.precision());
+ this->tie(__rhs.tie());
+ this->fill(__rhs.fill());
+ _M_ios_locale = __rhs.getloc();
+ _M_cache_locale(_M_ios_locale);
+
+ _M_call_callbacks(copyfmt_event);
+
+ // The next is required to be the last assignment.
+ this->exceptions(__rhs.exceptions());
+ }
+ return *this;
+ }
+
+ // Locales:
+ template<typename _CharT, typename _Traits>
+ locale
+ basic_ios<_CharT, _Traits>::imbue(const locale& __loc)
+ {
+ locale __old(this->getloc());
+ ios_base::imbue(__loc);
+ _M_cache_locale(__loc);
+ if (this->rdbuf() != 0)
+ this->rdbuf()->pubimbue(__loc);
+ return __old;
+ }
+
+ template<typename _CharT, typename _Traits>
+ void
+ basic_ios<_CharT, _Traits>::init(basic_streambuf<_CharT, _Traits>* __sb)
+ {
+ // NB: This may be called more than once on the same object.
+ ios_base::_M_init();
+
+ // Cache locale data and specific facets used by iostreams.
+ _M_cache_locale(_M_ios_locale);
+
+ // NB: The 27.4.4.1 Postconditions Table specifies requirements
+ // after basic_ios::init() has been called. As part of this,
+ // fill() must return widen(' ') any time after init() has been
+ // called, which needs an imbued ctype facet of char_type to
+ // return without throwing an exception. Unfortunately,
+ // ctype<char_type> is not necessarily a required facet, so
+ // streams with char_type != [char, wchar_t] will not have it by
+ // default. Because of this, the correct value for _M_fill is
+ // constructed on the first call of fill(). That way,
+ // unformatted input and output with non-required basic_ios
+ // instantiations is possible even without imbuing the expected
+ // ctype<char_type> facet.
+ _M_fill = _CharT();
+ _M_fill_init = false;
+
+ _M_tie = 0;
+ _M_exception = goodbit;
+ _M_streambuf = __sb;
+ _M_streambuf_state = __sb ? goodbit : badbit;
+ }
+
+ template<typename _CharT, typename _Traits>
+ void
+ basic_ios<_CharT, _Traits>::_M_cache_locale(const locale& __loc)
+ {
+ if (__builtin_expect(has_facet<__ctype_type>(__loc), true))
+ _M_ctype = &use_facet<__ctype_type>(__loc);
+ else
+ _M_ctype = 0;
+
+ if (__builtin_expect(has_facet<__num_put_type>(__loc), true))
+ _M_num_put = &use_facet<__num_put_type>(__loc);
+ else
+ _M_num_put = 0;
+
+ if (__builtin_expect(has_facet<__num_get_type>(__loc), true))
+ _M_num_get = &use_facet<__num_get_type>(__loc);
+ else
+ _M_num_get = 0;
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class basic_ios<char>;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class basic_ios<wchar_t>;
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/basic_string.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/basic_string.h
new file mode 100644
index 0000000..1e8300d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/basic_string.h
@@ -0,0 +1,2692 @@
+// Components for manipulating sequences of characters -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file basic_string.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 21 Strings library
+//
+
+#ifndef _BASIC_STRING_H
+#define _BASIC_STRING_H 1
+
+#pragma GCC system_header
+
+#include <ext/atomicity.h>
+#include <debug/debug.h>
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @class basic_string basic_string.h <string>
+ * @brief Managing sequences of characters and character-like objects.
+ *
+ * @ingroup sequences
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, a
+ * <a href="tables.html#66">reversible container</a>, and a
+ * <a href="tables.html#67">sequence</a>. Of the
+ * <a href="tables.html#68">optional sequence requirements</a>, only
+ * @c push_back, @c at, and array access are supported.
+ *
+ * @doctodo
+ *
+ *
+ * Documentation? What's that?
+ * Nathan Myers <ncm@cantrip.org>.
+ *
+ * A string looks like this:
+ *
+ * @code
+ * [_Rep]
+ * _M_length
+ * [basic_string<char_type>] _M_capacity
+ * _M_dataplus _M_refcount
+ * _M_p ----------------> unnamed array of char_type
+ * @endcode
+ *
+ * Where the _M_p points to the first character in the string, and
+ * you cast it to a pointer-to-_Rep and subtract 1 to get a
+ * pointer to the header.
+ *
+ * This approach has the enormous advantage that a string object
+ * requires only one allocation. All the ugliness is confined
+ * within a single pair of inline functions, which each compile to
+ * a single "add" instruction: _Rep::_M_data(), and
+ * string::_M_rep(); and the allocation function which gets a
+ * block of raw bytes and with room enough and constructs a _Rep
+ * object at the front.
+ *
+ * The reason you want _M_data pointing to the character array and
+ * not the _Rep is so that the debugger can see the string
+ * contents. (Probably we should add a non-inline member to get
+ * the _Rep for the debugger to use, so users can check the actual
+ * string length.)
+ *
+ * Note that the _Rep object is a POD so that you can have a
+ * static "empty string" _Rep object already "constructed" before
+ * static constructors have run. The reference-count encoding is
+ * chosen so that a 0 indicates one reference, so you never try to
+ * destroy the empty-string _Rep object.
+ *
+ * All but the last paragraph is considered pretty conventional
+ * for a C++ string implementation.
+ */
+ // 21.3 Template class basic_string
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ class basic_string
+ {
+ typedef typename _Alloc::template rebind<_CharT>::other _CharT_alloc_type;
+
+ // Types:
+ public:
+ typedef _Traits traits_type;
+ typedef typename _Traits::char_type value_type;
+ typedef _Alloc allocator_type;
+ typedef typename _CharT_alloc_type::size_type size_type;
+ typedef typename _CharT_alloc_type::difference_type difference_type;
+ typedef typename _CharT_alloc_type::reference reference;
+ typedef typename _CharT_alloc_type::const_reference const_reference;
+ typedef typename _CharT_alloc_type::pointer pointer;
+ typedef typename _CharT_alloc_type::const_pointer const_pointer;
+ typedef __gnu_cxx::__normal_iterator<pointer, basic_string> iterator;
+ typedef __gnu_cxx::__normal_iterator<const_pointer, basic_string>
+ const_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+
+ private:
+ // _Rep: string representation
+ // Invariants:
+ // 1. String really contains _M_length + 1 characters: due to 21.3.4
+ // must be kept null-terminated.
+ // 2. _M_capacity >= _M_length
+ // Allocated memory is always (_M_capacity + 1) * sizeof(_CharT).
+ // 3. _M_refcount has three states:
+ // -1: leaked, one reference, no ref-copies allowed, non-const.
+ // 0: one reference, non-const.
+ // n>0: n + 1 references, operations require a lock, const.
+ // 4. All fields==0 is an empty string, given the extra storage
+ // beyond-the-end for a null terminator; thus, the shared
+ // empty string representation needs no constructor.
+
+ struct _Rep_base
+ {
+ size_type _M_length;
+ size_type _M_capacity;
+ _Atomic_word _M_refcount;
+ };
+
+ struct _Rep : _Rep_base
+ {
+ // Types:
+ typedef typename _Alloc::template rebind<char>::other _Raw_bytes_alloc;
+
+ // (Public) Data members:
+
+ // The maximum number of individual char_type elements of an
+ // individual string is determined by _S_max_size. This is the
+ // value that will be returned by max_size(). (Whereas npos
+ // is the maximum number of bytes the allocator can allocate.)
+ // If one was to divvy up the theoretical largest size string,
+ // with a terminating character and m _CharT elements, it'd
+ // look like this:
+ // npos = sizeof(_Rep) + (m * sizeof(_CharT)) + sizeof(_CharT)
+ // Solving for m:
+ // m = ((npos - sizeof(_Rep))/sizeof(CharT)) - 1
+ // In addition, this implementation quarters this amount.
+ static const size_type _S_max_size;
+ static const _CharT _S_terminal;
+
+ // The following storage is init'd to 0 by the linker, resulting
+ // (carefully) in an empty string with one reference.
+ static size_type _S_empty_rep_storage[];
+
+ static _Rep&
+ _S_empty_rep()
+ {
+ // NB: Mild hack to avoid strict-aliasing warnings. Note that
+ // _S_empty_rep_storage is never modified and the punning should
+ // be reasonably safe in this case.
+ void* __p = reinterpret_cast<void*>(&_S_empty_rep_storage);
+ return *reinterpret_cast<_Rep*>(__p);
+ }
+
+ bool
+ _M_is_leaked() const
+ { return this->_M_refcount < 0; }
+
+ bool
+ _M_is_shared() const
+ { return this->_M_refcount > 0; }
+
+ void
+ _M_set_leaked()
+ { this->_M_refcount = -1; }
+
+ void
+ _M_set_sharable()
+ { this->_M_refcount = 0; }
+
+ void
+ _M_set_length_and_sharable(size_type __n)
+ {
+ this->_M_set_sharable(); // One reference.
+ this->_M_length = __n;
+ traits_type::assign(this->_M_refdata()[__n], _S_terminal);
+ // grrr. (per 21.3.4)
+ // You cannot leave those LWG people alone for a second.
+ }
+
+ _CharT*
+ _M_refdata() throw()
+ { return reinterpret_cast<_CharT*>(this + 1); }
+
+ _CharT*
+ _M_grab(const _Alloc& __alloc1, const _Alloc& __alloc2)
+ {
+ return (!_M_is_leaked() && __alloc1 == __alloc2)
+ ? _M_refcopy() : _M_clone(__alloc1);
+ }
+
+ // Create & Destroy
+ static _Rep*
+ _S_create(size_type, size_type, const _Alloc&);
+
+ void
+ _M_dispose(const _Alloc& __a)
+ {
+#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+ if (__builtin_expect(this != &_S_empty_rep(), false))
+#endif
+ if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount,
+ -1) <= 0)
+ _M_destroy(__a);
+ } // XXX MT
+
+ void
+ _M_destroy(const _Alloc&) throw();
+
+ _CharT*
+ _M_refcopy() throw()
+ {
+#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+ if (__builtin_expect(this != &_S_empty_rep(), false))
+#endif
+ __gnu_cxx::__atomic_add_dispatch(&this->_M_refcount, 1);
+ return _M_refdata();
+ } // XXX MT
+
+ _CharT*
+ _M_clone(const _Alloc&, size_type __res = 0);
+ };
+
+ // Use empty-base optimization: http://www.cantrip.org/emptyopt.html
+ struct _Alloc_hider : _Alloc
+ {
+ _Alloc_hider(_CharT* __dat, const _Alloc& __a)
+ : _Alloc(__a), _M_p(__dat) { }
+
+ _CharT* _M_p; // The actual data.
+ };
+
+ public:
+ // Data Members (public):
+ // NB: This is an unsigned type, and thus represents the maximum
+ // size that the allocator can hold.
+ /// Value returned by various member functions when they fail.
+ static const size_type npos = static_cast<size_type>(-1);
+
+ private:
+ // Data Members (private):
+ mutable _Alloc_hider _M_dataplus;
+
+ _CharT*
+ _M_data() const
+ { return _M_dataplus._M_p; }
+
+ _CharT*
+ _M_data(_CharT* __p)
+ { return (_M_dataplus._M_p = __p); }
+
+ _Rep*
+ _M_rep() const
+ { return &((reinterpret_cast<_Rep*> (_M_data()))[-1]); }
+
+ // For the internal use we have functions similar to `begin'/`end'
+ // but they do not call _M_leak.
+ iterator
+ _M_ibegin() const
+ { return iterator(_M_data()); }
+
+ iterator
+ _M_iend() const
+ { return iterator(_M_data() + this->size()); }
+
+ void
+ _M_leak() // for use in begin() & non-const op[]
+ {
+ if (!_M_rep()->_M_is_leaked())
+ _M_leak_hard();
+ }
+
+ size_type
+ _M_check(size_type __pos, const char* __s) const
+ {
+ if (__pos > this->size())
+ __throw_out_of_range(__N(__s));
+ return __pos;
+ }
+
+ void
+ _M_check_length(size_type __n1, size_type __n2, const char* __s) const
+ {
+ if (this->max_size() - (this->size() - __n1) < __n2)
+ __throw_length_error(__N(__s));
+ }
+
+ // NB: _M_limit doesn't check for a bad __pos value.
+ size_type
+ _M_limit(size_type __pos, size_type __off) const
+ {
+ const bool __testoff = __off < this->size() - __pos;
+ return __testoff ? __off : this->size() - __pos;
+ }
+
+ // True if _Rep and source do not overlap.
+ bool
+ _M_disjunct(const _CharT* __s) const
+ {
+ return (less<const _CharT*>()(__s, _M_data())
+ || less<const _CharT*>()(_M_data() + this->size(), __s));
+ }
+
+ // When __n = 1 way faster than the general multichar
+ // traits_type::copy/move/assign.
+ static void
+ _M_copy(_CharT* __d, const _CharT* __s, size_type __n)
+ {
+ if (__n == 1)
+ traits_type::assign(*__d, *__s);
+ else
+ traits_type::copy(__d, __s, __n);
+ }
+
+ static void
+ _M_move(_CharT* __d, const _CharT* __s, size_type __n)
+ {
+ if (__n == 1)
+ traits_type::assign(*__d, *__s);
+ else
+ traits_type::move(__d, __s, __n);
+ }
+
+ static void
+ _M_assign(_CharT* __d, size_type __n, _CharT __c)
+ {
+ if (__n == 1)
+ traits_type::assign(*__d, __c);
+ else
+ traits_type::assign(__d, __n, __c);
+ }
+
+ // _S_copy_chars is a separate template to permit specialization
+ // to optimize for the common case of pointers as iterators.
+ template<class _Iterator>
+ static void
+ _S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
+ {
+ for (; __k1 != __k2; ++__k1, ++__p)
+ traits_type::assign(*__p, *__k1); // These types are off.
+ }
+
+ static void
+ _S_copy_chars(_CharT* __p, iterator __k1, iterator __k2)
+ { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+
+ static void
+ _S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2)
+ { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+
+ static void
+ _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2)
+ { _M_copy(__p, __k1, __k2 - __k1); }
+
+ static void
+ _S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2)
+ { _M_copy(__p, __k1, __k2 - __k1); }
+
+ static int
+ _S_compare(size_type __n1, size_type __n2)
+ {
+ const difference_type __d = difference_type(__n1 - __n2);
+
+ if (__d > __gnu_cxx::__numeric_traits<int>::__max)
+ return __gnu_cxx::__numeric_traits<int>::__max;
+ else if (__d < __gnu_cxx::__numeric_traits<int>::__min)
+ return __gnu_cxx::__numeric_traits<int>::__min;
+ else
+ return int(__d);
+ }
+
+ void
+ _M_mutate(size_type __pos, size_type __len1, size_type __len2);
+
+ void
+ _M_leak_hard();
+
+ static _Rep&
+ _S_empty_rep()
+ { return _Rep::_S_empty_rep(); }
+
+ public:
+ // Construct/copy/destroy:
+ // NB: We overload ctors in some cases instead of using default
+ // arguments, per 17.4.4.4 para. 2 item 2.
+
+ /**
+ * @brief Default constructor creates an empty string.
+ */
+ inline
+ basic_string();
+
+ /**
+ * @brief Construct an empty string using allocator @a a.
+ */
+ explicit
+ basic_string(const _Alloc& __a);
+
+ // NB: per LWG issue 42, semantics different from IS:
+ /**
+ * @brief Construct string with copy of value of @a str.
+ * @param str Source string.
+ */
+ basic_string(const basic_string& __str);
+ /**
+ * @brief Construct string as copy of a substring.
+ * @param str Source string.
+ * @param pos Index of first character to copy from.
+ * @param n Number of characters to copy (default remainder).
+ */
+ basic_string(const basic_string& __str, size_type __pos,
+ size_type __n = npos);
+ /**
+ * @brief Construct string as copy of a substring.
+ * @param str Source string.
+ * @param pos Index of first character to copy from.
+ * @param n Number of characters to copy.
+ * @param a Allocator to use.
+ */
+ basic_string(const basic_string& __str, size_type __pos,
+ size_type __n, const _Alloc& __a);
+
+ /**
+ * @brief Construct string initialized by a character array.
+ * @param s Source character array.
+ * @param n Number of characters to copy.
+ * @param a Allocator to use (default is default allocator).
+ *
+ * NB: @a s must have at least @a n characters, '\\0' has no special
+ * meaning.
+ */
+ basic_string(const _CharT* __s, size_type __n,
+ const _Alloc& __a = _Alloc());
+ /**
+ * @brief Construct string as copy of a C string.
+ * @param s Source C string.
+ * @param a Allocator to use (default is default allocator).
+ */
+ basic_string(const _CharT* __s, const _Alloc& __a = _Alloc());
+ /**
+ * @brief Construct string as multiple characters.
+ * @param n Number of characters.
+ * @param c Character to use.
+ * @param a Allocator to use (default is default allocator).
+ */
+ basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc());
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Construct string from an initializer list.
+ * @param l std::initializer_list of characters.
+ * @param a Allocator to use (default is default allocator).
+ */
+ basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc());
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ /**
+ * @brief Construct string as copy of a range.
+ * @param beg Start of range.
+ * @param end End of range.
+ * @param a Allocator to use (default is default allocator).
+ */
+ template<class _InputIterator>
+ basic_string(_InputIterator __beg, _InputIterator __end,
+ const _Alloc& __a = _Alloc());
+
+ /**
+ * @brief Destroy the string instance.
+ */
+ ~basic_string()
+ { _M_rep()->_M_dispose(this->get_allocator()); }
+
+ /**
+ * @brief Assign the value of @a str to this string.
+ * @param str Source string.
+ */
+ basic_string&
+ operator=(const basic_string& __str)
+ { return this->assign(__str); }
+
+ /**
+ * @brief Copy contents of @a s into this string.
+ * @param s Source null-terminated string.
+ */
+ basic_string&
+ operator=(const _CharT* __s)
+ { return this->assign(__s); }
+
+ /**
+ * @brief Set value to string of length 1.
+ * @param c Source character.
+ *
+ * Assigning to a character makes this string length 1 and
+ * (*this)[0] == @a c.
+ */
+ basic_string&
+ operator=(_CharT __c)
+ {
+ this->assign(1, __c);
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Set value to string constructed from initializer list.
+ * @param l std::initializer_list.
+ */
+ basic_string&
+ operator=(initializer_list<_CharT> __l)
+ {
+ this->assign (__l.begin(), __l.end());
+ return *this;
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ // Iterators:
+ /**
+ * Returns a read/write iterator that points to the first character in
+ * the %string. Unshares the string.
+ */
+ iterator
+ begin()
+ {
+ _M_leak();
+ return iterator(_M_data());
+ }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * character in the %string.
+ */
+ const_iterator
+ begin() const
+ { return const_iterator(_M_data()); }
+
+ /**
+ * Returns a read/write iterator that points one past the last
+ * character in the %string. Unshares the string.
+ */
+ iterator
+ end()
+ {
+ _M_leak();
+ return iterator(_M_data() + this->size());
+ }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the
+ * last character in the %string.
+ */
+ const_iterator
+ end() const
+ { return const_iterator(_M_data() + this->size()); }
+
+ /**
+ * Returns a read/write reverse iterator that points to the last
+ * character in the %string. Iteration is done in reverse element
+ * order. Unshares the string.
+ */
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(this->end()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to the last character in the %string. Iteration is done in
+ * reverse element order.
+ */
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(this->end()); }
+
+ /**
+ * Returns a read/write reverse iterator that points to one before the
+ * first character in the %string. Iteration is done in reverse
+ * element order. Unshares the string.
+ */
+ reverse_iterator
+ rend()
+ { return reverse_iterator(this->begin()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to one before the first character in the %string. Iteration
+ * is done in reverse element order.
+ */
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(this->begin()); }
+
+ public:
+ // Capacity:
+ /// Returns the number of characters in the string, not including any
+ /// null-termination.
+ size_type
+ size() const
+ { return _M_rep()->_M_length; }
+
+ /// Returns the number of characters in the string, not including any
+ /// null-termination.
+ size_type
+ length() const
+ { return _M_rep()->_M_length; }
+
+ /// Returns the size() of the largest possible %string.
+ size_type
+ max_size() const
+ { return _Rep::_S_max_size; }
+
+ /**
+ * @brief Resizes the %string to the specified number of characters.
+ * @param n Number of characters the %string should contain.
+ * @param c Character to fill any new elements.
+ *
+ * This function will %resize the %string to the specified
+ * number of characters. If the number is smaller than the
+ * %string's current size the %string is truncated, otherwise
+ * the %string is extended and new elements are set to @a c.
+ */
+ void
+ resize(size_type __n, _CharT __c);
+
+ /**
+ * @brief Resizes the %string to the specified number of characters.
+ * @param n Number of characters the %string should contain.
+ *
+ * This function will resize the %string to the specified length. If
+ * the new size is smaller than the %string's current size the %string
+ * is truncated, otherwise the %string is extended and new characters
+ * are default-constructed. For basic types such as char, this means
+ * setting them to 0.
+ */
+ void
+ resize(size_type __n)
+ { this->resize(__n, _CharT()); }
+
+ /**
+ * Returns the total number of characters that the %string can hold
+ * before needing to allocate more memory.
+ */
+ size_type
+ capacity() const
+ { return _M_rep()->_M_capacity; }
+
+ /**
+ * @brief Attempt to preallocate enough memory for specified number of
+ * characters.
+ * @param res_arg Number of characters required.
+ * @throw std::length_error If @a res_arg exceeds @c max_size().
+ *
+ * This function attempts to reserve enough memory for the
+ * %string to hold the specified number of characters. If the
+ * number requested is more than max_size(), length_error is
+ * thrown.
+ *
+ * The advantage of this function is that if optimal code is a
+ * necessity and the user can determine the string length that will be
+ * required, the user can reserve the memory in %advance, and thus
+ * prevent a possible reallocation of memory and copying of %string
+ * data.
+ */
+ void
+ reserve(size_type __res_arg = 0);
+
+ /**
+ * Erases the string, making it empty.
+ */
+ void
+ clear()
+ { _M_mutate(0, this->size(), 0); }
+
+ /**
+ * Returns true if the %string is empty. Equivalent to *this == "".
+ */
+ bool
+ empty() const
+ { return this->size() == 0; }
+
+ // Element access:
+ /**
+ * @brief Subscript access to the data contained in the %string.
+ * @param pos The index of the character to access.
+ * @return Read-only (constant) reference to the character.
+ *
+ * This operator allows for easy, array-style, data access.
+ * Note that data access with this operator is unchecked and
+ * out_of_range lookups are not defined. (For checked lookups
+ * see at().)
+ */
+ const_reference
+ operator[] (size_type __pos) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(__pos <= size());
+ return _M_data()[__pos];
+ }
+
+ /**
+ * @brief Subscript access to the data contained in the %string.
+ * @param pos The index of the character to access.
+ * @return Read/write reference to the character.
+ *
+ * This operator allows for easy, array-style, data access.
+ * Note that data access with this operator is unchecked and
+ * out_of_range lookups are not defined. (For checked lookups
+ * see at().) Unshares the string.
+ */
+ reference
+ operator[](size_type __pos)
+ {
+ // allow pos == size() as v3 extension:
+ _GLIBCXX_DEBUG_ASSERT(__pos <= size());
+ // but be strict in pedantic mode:
+ _GLIBCXX_DEBUG_PEDASSERT(__pos < size());
+ _M_leak();
+ return _M_data()[__pos];
+ }
+
+ /**
+ * @brief Provides access to the data contained in the %string.
+ * @param n The index of the character to access.
+ * @return Read-only (const) reference to the character.
+ * @throw std::out_of_range If @a n is an invalid index.
+ *
+ * This function provides for safer data access. The parameter is
+ * first checked that it is in the range of the string. The function
+ * throws out_of_range if the check fails.
+ */
+ const_reference
+ at(size_type __n) const
+ {
+ if (__n >= this->size())
+ __throw_out_of_range(__N("basic_string::at"));
+ return _M_data()[__n];
+ }
+
+ /**
+ * @brief Provides access to the data contained in the %string.
+ * @param n The index of the character to access.
+ * @return Read/write reference to the character.
+ * @throw std::out_of_range If @a n is an invalid index.
+ *
+ * This function provides for safer data access. The parameter is
+ * first checked that it is in the range of the string. The function
+ * throws out_of_range if the check fails. Success results in
+ * unsharing the string.
+ */
+ reference
+ at(size_type __n)
+ {
+ if (__n >= size())
+ __throw_out_of_range(__N("basic_string::at"));
+ _M_leak();
+ return _M_data()[__n];
+ }
+
+ // Modifiers:
+ /**
+ * @brief Append a string to this string.
+ * @param str The string to append.
+ * @return Reference to this string.
+ */
+ basic_string&
+ operator+=(const basic_string& __str)
+ { return this->append(__str); }
+
+ /**
+ * @brief Append a C string.
+ * @param s The C string to append.
+ * @return Reference to this string.
+ */
+ basic_string&
+ operator+=(const _CharT* __s)
+ { return this->append(__s); }
+
+ /**
+ * @brief Append a character.
+ * @param c The character to append.
+ * @return Reference to this string.
+ */
+ basic_string&
+ operator+=(_CharT __c)
+ {
+ this->push_back(__c);
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Append an initializer_list of characters.
+ * @param l The initializer_list of characters to be appended.
+ * @return Reference to this string.
+ */
+ basic_string&
+ operator+=(initializer_list<_CharT> __l)
+ { return this->append(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ /**
+ * @brief Append a string to this string.
+ * @param str The string to append.
+ * @return Reference to this string.
+ */
+ basic_string&
+ append(const basic_string& __str);
+
+ /**
+ * @brief Append a substring.
+ * @param str The string to append.
+ * @param pos Index of the first character of str to append.
+ * @param n The number of characters to append.
+ * @return Reference to this string.
+ * @throw std::out_of_range if @a pos is not a valid index.
+ *
+ * This function appends @a n characters from @a str starting at @a pos
+ * to this string. If @a n is is larger than the number of available
+ * characters in @a str, the remainder of @a str is appended.
+ */
+ basic_string&
+ append(const basic_string& __str, size_type __pos, size_type __n);
+
+ /**
+ * @brief Append a C substring.
+ * @param s The C string to append.
+ * @param n The number of characters to append.
+ * @return Reference to this string.
+ */
+ basic_string&
+ append(const _CharT* __s, size_type __n);
+
+ /**
+ * @brief Append a C string.
+ * @param s The C string to append.
+ * @return Reference to this string.
+ */
+ basic_string&
+ append(const _CharT* __s)
+ {
+ __glibcxx_requires_string(__s);
+ return this->append(__s, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Append multiple characters.
+ * @param n The number of characters to append.
+ * @param c The character to use.
+ * @return Reference to this string.
+ *
+ * Appends n copies of c to this string.
+ */
+ basic_string&
+ append(size_type __n, _CharT __c);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Append an initializer_list of characters.
+ * @param l The initializer_list of characters to append.
+ * @return Reference to this string.
+ */
+ basic_string&
+ append(initializer_list<_CharT> __l)
+ { return this->append(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ /**
+ * @brief Append a range of characters.
+ * @param first Iterator referencing the first character to append.
+ * @param last Iterator marking the end of the range.
+ * @return Reference to this string.
+ *
+ * Appends characters in the range [first,last) to this string.
+ */
+ template<class _InputIterator>
+ basic_string&
+ append(_InputIterator __first, _InputIterator __last)
+ { return this->replace(_M_iend(), _M_iend(), __first, __last); }
+
+ /**
+ * @brief Append a single character.
+ * @param c Character to append.
+ */
+ void
+ push_back(_CharT __c)
+ {
+ const size_type __len = 1 + this->size();
+ if (__len > this->capacity() || _M_rep()->_M_is_shared())
+ this->reserve(__len);
+ traits_type::assign(_M_data()[this->size()], __c);
+ _M_rep()->_M_set_length_and_sharable(__len);
+ }
+
+ /**
+ * @brief Set value to contents of another string.
+ * @param str Source string to use.
+ * @return Reference to this string.
+ */
+ basic_string&
+ assign(const basic_string& __str);
+
+ /**
+ * @brief Set value to a substring of a string.
+ * @param str The string to use.
+ * @param pos Index of the first character of str.
+ * @param n Number of characters to use.
+ * @return Reference to this string.
+ * @throw std::out_of_range if @a pos is not a valid index.
+ *
+ * This function sets this string to the substring of @a str consisting
+ * of @a n characters at @a pos. If @a n is is larger than the number
+ * of available characters in @a str, the remainder of @a str is used.
+ */
+ basic_string&
+ assign(const basic_string& __str, size_type __pos, size_type __n)
+ { return this->assign(__str._M_data()
+ + __str._M_check(__pos, "basic_string::assign"),
+ __str._M_limit(__pos, __n)); }
+
+ /**
+ * @brief Set value to a C substring.
+ * @param s The C string to use.
+ * @param n Number of characters to use.
+ * @return Reference to this string.
+ *
+ * This function sets the value of this string to the first @a n
+ * characters of @a s. If @a n is is larger than the number of
+ * available characters in @a s, the remainder of @a s is used.
+ */
+ basic_string&
+ assign(const _CharT* __s, size_type __n);
+
+ /**
+ * @brief Set value to contents of a C string.
+ * @param s The C string to use.
+ * @return Reference to this string.
+ *
+ * This function sets the value of this string to the value of @a s.
+ * The data is copied, so there is no dependence on @a s once the
+ * function returns.
+ */
+ basic_string&
+ assign(const _CharT* __s)
+ {
+ __glibcxx_requires_string(__s);
+ return this->assign(__s, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Set value to multiple characters.
+ * @param n Length of the resulting string.
+ * @param c The character to use.
+ * @return Reference to this string.
+ *
+ * This function sets the value of this string to @a n copies of
+ * character @a c.
+ */
+ basic_string&
+ assign(size_type __n, _CharT __c)
+ { return _M_replace_aux(size_type(0), this->size(), __n, __c); }
+
+ /**
+ * @brief Set value to a range of characters.
+ * @param first Iterator referencing the first character to append.
+ * @param last Iterator marking the end of the range.
+ * @return Reference to this string.
+ *
+ * Sets value of string to characters in the range [first,last).
+ */
+ template<class _InputIterator>
+ basic_string&
+ assign(_InputIterator __first, _InputIterator __last)
+ { return this->replace(_M_ibegin(), _M_iend(), __first, __last); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Set value to an initializer_list of characters.
+ * @param l The initializer_list of characters to assign.
+ * @return Reference to this string.
+ */
+ basic_string&
+ assign(initializer_list<_CharT> __l)
+ { return this->assign(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ /**
+ * @brief Insert multiple characters.
+ * @param p Iterator referencing location in string to insert at.
+ * @param n Number of characters to insert
+ * @param c The character to insert.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Inserts @a n copies of character @a c starting at the position
+ * referenced by iterator @a p. If adding characters causes the length
+ * to exceed max_size(), length_error is thrown. The value of the
+ * string doesn't change if an error is thrown.
+ */
+ void
+ insert(iterator __p, size_type __n, _CharT __c)
+ { this->replace(__p, __p, __n, __c); }
+
+ /**
+ * @brief Insert a range of characters.
+ * @param p Iterator referencing location in string to insert at.
+ * @param beg Start of range.
+ * @param end End of range.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Inserts characters in range [beg,end). If adding characters causes
+ * the length to exceed max_size(), length_error is thrown. The value
+ * of the string doesn't change if an error is thrown.
+ */
+ template<class _InputIterator>
+ void
+ insert(iterator __p, _InputIterator __beg, _InputIterator __end)
+ { this->replace(__p, __p, __beg, __end); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Insert an initializer_list of characters.
+ * @param p Iterator referencing location in string to insert at.
+ * @param l The initializer_list of characters to insert.
+ * @throw std::length_error If new length exceeds @c max_size().
+ */
+ void
+ insert(iterator __p, initializer_list<_CharT> __l)
+ { this->insert(__p, __l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ /**
+ * @brief Insert value of a string.
+ * @param pos1 Iterator referencing location in string to insert at.
+ * @param str The string to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Inserts value of @a str starting at @a pos1. If adding characters
+ * causes the length to exceed max_size(), length_error is thrown. The
+ * value of the string doesn't change if an error is thrown.
+ */
+ basic_string&
+ insert(size_type __pos1, const basic_string& __str)
+ { return this->insert(__pos1, __str, size_type(0), __str.size()); }
+
+ /**
+ * @brief Insert a substring.
+ * @param pos1 Iterator referencing location in string to insert at.
+ * @param str The string to insert.
+ * @param pos2 Start of characters in str to insert.
+ * @param n Number of characters to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a pos1 > size() or
+ * @a pos2 > @a str.size().
+ *
+ * Starting at @a pos1, insert @a n character of @a str beginning with
+ * @a pos2. If adding characters causes the length to exceed
+ * max_size(), length_error is thrown. If @a pos1 is beyond the end of
+ * this string or @a pos2 is beyond the end of @a str, out_of_range is
+ * thrown. The value of the string doesn't change if an error is
+ * thrown.
+ */
+ basic_string&
+ insert(size_type __pos1, const basic_string& __str,
+ size_type __pos2, size_type __n)
+ { return this->insert(__pos1, __str._M_data()
+ + __str._M_check(__pos2, "basic_string::insert"),
+ __str._M_limit(__pos2, __n)); }
+
+ /**
+ * @brief Insert a C substring.
+ * @param pos Iterator referencing location in string to insert at.
+ * @param s The C string to insert.
+ * @param n The number of characters to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a pos is beyond the end of this
+ * string.
+ *
+ * Inserts the first @a n characters of @a s starting at @a pos. If
+ * adding characters causes the length to exceed max_size(),
+ * length_error is thrown. If @a pos is beyond end(), out_of_range is
+ * thrown. The value of the string doesn't change if an error is
+ * thrown.
+ */
+ basic_string&
+ insert(size_type __pos, const _CharT* __s, size_type __n);
+
+ /**
+ * @brief Insert a C string.
+ * @param pos Iterator referencing location in string to insert at.
+ * @param s The C string to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a pos is beyond the end of this
+ * string.
+ *
+ * Inserts the first @a n characters of @a s starting at @a pos. If
+ * adding characters causes the length to exceed max_size(),
+ * length_error is thrown. If @a pos is beyond end(), out_of_range is
+ * thrown. The value of the string doesn't change if an error is
+ * thrown.
+ */
+ basic_string&
+ insert(size_type __pos, const _CharT* __s)
+ {
+ __glibcxx_requires_string(__s);
+ return this->insert(__pos, __s, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Insert multiple characters.
+ * @param pos Index in string to insert at.
+ * @param n Number of characters to insert
+ * @param c The character to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a pos is beyond the end of this
+ * string.
+ *
+ * Inserts @a n copies of character @a c starting at index @a pos. If
+ * adding characters causes the length to exceed max_size(),
+ * length_error is thrown. If @a pos > length(), out_of_range is
+ * thrown. The value of the string doesn't change if an error is
+ * thrown.
+ */
+ basic_string&
+ insert(size_type __pos, size_type __n, _CharT __c)
+ { return _M_replace_aux(_M_check(__pos, "basic_string::insert"),
+ size_type(0), __n, __c); }
+
+ /**
+ * @brief Insert one character.
+ * @param p Iterator referencing position in string to insert at.
+ * @param c The character to insert.
+ * @return Iterator referencing newly inserted char.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Inserts character @a c at position referenced by @a p. If adding
+ * character causes the length to exceed max_size(), length_error is
+ * thrown. If @a p is beyond end of string, out_of_range is thrown.
+ * The value of the string doesn't change if an error is thrown.
+ */
+ iterator
+ insert(iterator __p, _CharT __c)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(__p >= _M_ibegin() && __p <= _M_iend());
+ const size_type __pos = __p - _M_ibegin();
+ _M_replace_aux(__pos, size_type(0), size_type(1), __c);
+ _M_rep()->_M_set_leaked();
+ return iterator(_M_data() + __pos);
+ }
+
+ /**
+ * @brief Remove characters.
+ * @param pos Index of first character to remove (default 0).
+ * @param n Number of characters to remove (default remainder).
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a pos is beyond the end of this
+ * string.
+ *
+ * Removes @a n characters from this string starting at @a pos. The
+ * length of the string is reduced by @a n. If there are < @a n
+ * characters to remove, the remainder of the string is truncated. If
+ * @a p is beyond end of string, out_of_range is thrown. The value of
+ * the string doesn't change if an error is thrown.
+ */
+ basic_string&
+ erase(size_type __pos = 0, size_type __n = npos)
+ {
+ _M_mutate(_M_check(__pos, "basic_string::erase"),
+ _M_limit(__pos, __n), size_type(0));
+ return *this;
+ }
+
+ /**
+ * @brief Remove one character.
+ * @param position Iterator referencing the character to remove.
+ * @return iterator referencing same location after removal.
+ *
+ * Removes the character at @a position from this string. The value
+ * of the string doesn't change if an error is thrown.
+ */
+ iterator
+ erase(iterator __position)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(__position >= _M_ibegin()
+ && __position < _M_iend());
+ const size_type __pos = __position - _M_ibegin();
+ _M_mutate(__pos, size_type(1), size_type(0));
+ _M_rep()->_M_set_leaked();
+ return iterator(_M_data() + __pos);
+ }
+
+ /**
+ * @brief Remove a range of characters.
+ * @param first Iterator referencing the first character to remove.
+ * @param last Iterator referencing the end of the range.
+ * @return Iterator referencing location of first after removal.
+ *
+ * Removes the characters in the range [first,last) from this string.
+ * The value of the string doesn't change if an error is thrown.
+ */
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(__first >= _M_ibegin() && __first <= __last
+ && __last <= _M_iend());
+ const size_type __pos = __first - _M_ibegin();
+ _M_mutate(__pos, __last - __first, size_type(0));
+ _M_rep()->_M_set_leaked();
+ return iterator(_M_data() + __pos);
+ }
+
+ /**
+ * @brief Replace characters with value from another string.
+ * @param pos Index of first character to replace.
+ * @param n Number of characters to be replaced.
+ * @param str String to insert.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a pos is beyond the end of this
+ * string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos,pos+n) from this string.
+ * In place, the value of @a str is inserted. If @a pos is beyond end
+ * of string, out_of_range is thrown. If the length of the result
+ * exceeds max_size(), length_error is thrown. The value of the string
+ * doesn't change if an error is thrown.
+ */
+ basic_string&
+ replace(size_type __pos, size_type __n, const basic_string& __str)
+ { return this->replace(__pos, __n, __str._M_data(), __str.size()); }
+
+ /**
+ * @brief Replace characters with value from another string.
+ * @param pos1 Index of first character to replace.
+ * @param n1 Number of characters to be replaced.
+ * @param str String to insert.
+ * @param pos2 Index of first character of str to use.
+ * @param n2 Number of characters from str to use.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a pos1 > size() or @a pos2 >
+ * str.size().
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos1,pos1 + n) from this
+ * string. In place, the value of @a str is inserted. If @a pos is
+ * beyond end of string, out_of_range is thrown. If the length of the
+ * result exceeds max_size(), length_error is thrown. The value of the
+ * string doesn't change if an error is thrown.
+ */
+ basic_string&
+ replace(size_type __pos1, size_type __n1, const basic_string& __str,
+ size_type __pos2, size_type __n2)
+ { return this->replace(__pos1, __n1, __str._M_data()
+ + __str._M_check(__pos2, "basic_string::replace"),
+ __str._M_limit(__pos2, __n2)); }
+
+ /**
+ * @brief Replace characters with value of a C substring.
+ * @param pos Index of first character to replace.
+ * @param n1 Number of characters to be replaced.
+ * @param s C string to insert.
+ * @param n2 Number of characters from @a s to use.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a pos1 > size().
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos,pos + n1) from this string.
+ * In place, the first @a n2 characters of @a s are inserted, or all
+ * of @a s if @a n2 is too large. If @a pos is beyond end of string,
+ * out_of_range is thrown. If the length of result exceeds max_size(),
+ * length_error is thrown. The value of the string doesn't change if
+ * an error is thrown.
+ */
+ basic_string&
+ replace(size_type __pos, size_type __n1, const _CharT* __s,
+ size_type __n2);
+
+ /**
+ * @brief Replace characters with value of a C string.
+ * @param pos Index of first character to replace.
+ * @param n1 Number of characters to be replaced.
+ * @param s C string to insert.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a pos > size().
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos,pos + n1) from this string.
+ * In place, the first @a n characters of @a s are inserted. If @a
+ * pos is beyond end of string, out_of_range is thrown. If the length
+ * of result exceeds max_size(), length_error is thrown. The value of
+ * the string doesn't change if an error is thrown.
+ */
+ basic_string&
+ replace(size_type __pos, size_type __n1, const _CharT* __s)
+ {
+ __glibcxx_requires_string(__s);
+ return this->replace(__pos, __n1, __s, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Replace characters with multiple characters.
+ * @param pos Index of first character to replace.
+ * @param n1 Number of characters to be replaced.
+ * @param n2 Number of characters to insert.
+ * @param c Character to insert.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a pos > size().
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos,pos + n1) from this string.
+ * In place, @a n2 copies of @a c are inserted. If @a pos is beyond
+ * end of string, out_of_range is thrown. If the length of result
+ * exceeds max_size(), length_error is thrown. The value of the string
+ * doesn't change if an error is thrown.
+ */
+ basic_string&
+ replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
+ { return _M_replace_aux(_M_check(__pos, "basic_string::replace"),
+ _M_limit(__pos, __n1), __n2, __c); }
+
+ /**
+ * @brief Replace range of characters with string.
+ * @param i1 Iterator referencing start of range to replace.
+ * @param i2 Iterator referencing end of range to replace.
+ * @param str String value to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, the value of
+ * @a str is inserted. If the length of result exceeds max_size(),
+ * length_error is thrown. The value of the string doesn't change if
+ * an error is thrown.
+ */
+ basic_string&
+ replace(iterator __i1, iterator __i2, const basic_string& __str)
+ { return this->replace(__i1, __i2, __str._M_data(), __str.size()); }
+
+ /**
+ * @brief Replace range of characters with C substring.
+ * @param i1 Iterator referencing start of range to replace.
+ * @param i2 Iterator referencing end of range to replace.
+ * @param s C string value to insert.
+ * @param n Number of characters from s to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, the first @a
+ * n characters of @a s are inserted. If the length of result exceeds
+ * max_size(), length_error is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ basic_string&
+ replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1, __s, __n);
+ }
+
+ /**
+ * @brief Replace range of characters with C string.
+ * @param i1 Iterator referencing start of range to replace.
+ * @param i2 Iterator referencing end of range to replace.
+ * @param s C string value to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, the
+ * characters of @a s are inserted. If the length of result exceeds
+ * max_size(), length_error is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ basic_string&
+ replace(iterator __i1, iterator __i2, const _CharT* __s)
+ {
+ __glibcxx_requires_string(__s);
+ return this->replace(__i1, __i2, __s, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Replace range of characters with multiple characters
+ * @param i1 Iterator referencing start of range to replace.
+ * @param i2 Iterator referencing end of range to replace.
+ * @param n Number of characters to insert.
+ * @param c Character to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, @a n copies
+ * of @a c are inserted. If the length of result exceeds max_size(),
+ * length_error is thrown. The value of the string doesn't change if
+ * an error is thrown.
+ */
+ basic_string&
+ replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __c);
+ }
+
+ /**
+ * @brief Replace range of characters with range.
+ * @param i1 Iterator referencing start of range to replace.
+ * @param i2 Iterator referencing end of range to replace.
+ * @param k1 Iterator referencing start of range to insert.
+ * @param k2 Iterator referencing end of range to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, characters
+ * in the range [k1,k2) are inserted. If the length of result exceeds
+ * max_size(), length_error is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ template<class _InputIterator>
+ basic_string&
+ replace(iterator __i1, iterator __i2,
+ _InputIterator __k1, _InputIterator __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral());
+ }
+
+ // Specializations for the common case of pointer and iterator:
+ // useful to avoid the overhead of temporary buffering in _M_replace.
+ basic_string&
+ replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1, __k2 - __k1);
+ }
+
+ basic_string&
+ replace(iterator __i1, iterator __i2,
+ const _CharT* __k1, const _CharT* __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1, __k2 - __k1);
+ }
+
+ basic_string&
+ replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1.base(), __k2 - __k1);
+ }
+
+ basic_string&
+ replace(iterator __i1, iterator __i2,
+ const_iterator __k1, const_iterator __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1.base(), __k2 - __k1);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Replace range of characters with initializer_list.
+ * @param i1 Iterator referencing start of range to replace.
+ * @param i2 Iterator referencing end of range to replace.
+ * @param l The initializer_list of characters to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, characters
+ * in the range [k1,k2) are inserted. If the length of result exceeds
+ * max_size(), length_error is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ basic_string& replace(iterator __i1, iterator __i2,
+ initializer_list<_CharT> __l)
+ { return this->replace(__i1, __i2, __l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ private:
+ template<class _Integer>
+ basic_string&
+ _M_replace_dispatch(iterator __i1, iterator __i2, _Integer __n,
+ _Integer __val, __true_type)
+ { return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __val); }
+
+ template<class _InputIterator>
+ basic_string&
+ _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
+ _InputIterator __k2, __false_type);
+
+ basic_string&
+ _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
+ _CharT __c);
+
+ basic_string&
+ _M_replace_safe(size_type __pos1, size_type __n1, const _CharT* __s,
+ size_type __n2);
+
+ // _S_construct_aux is used to implement the 21.3.1 para 15 which
+ // requires special behaviour if _InIter is an integral type
+ template<class _InIterator>
+ static _CharT*
+ _S_construct_aux(_InIterator __beg, _InIterator __end,
+ const _Alloc& __a, __false_type)
+ {
+ typedef typename iterator_traits<_InIterator>::iterator_category _Tag;
+ return _S_construct(__beg, __end, __a, _Tag());
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<class _Integer>
+ static _CharT*
+ _S_construct_aux(_Integer __beg, _Integer __end,
+ const _Alloc& __a, __true_type)
+ { return _S_construct(static_cast<size_type>(__beg), __end, __a); }
+
+ template<class _InIterator>
+ static _CharT*
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a)
+ {
+ typedef typename std::__is_integer<_InIterator>::__type _Integral;
+ return _S_construct_aux(__beg, __end, __a, _Integral());
+ }
+
+ // For Input Iterators, used in istreambuf_iterators, etc.
+ template<class _InIterator>
+ static _CharT*
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
+ input_iterator_tag);
+
+ // For forward_iterators up to random_access_iterators, used for
+ // string::iterator, _CharT*, etc.
+ template<class _FwdIterator>
+ static _CharT*
+ _S_construct(_FwdIterator __beg, _FwdIterator __end, const _Alloc& __a,
+ forward_iterator_tag);
+
+ static _CharT*
+ _S_construct(size_type __req, _CharT __c, const _Alloc& __a);
+
+ public:
+
+ /**
+ * @brief Copy substring into C string.
+ * @param s C string to copy value into.
+ * @param n Number of characters to copy.
+ * @param pos Index of first character to copy.
+ * @return Number of characters actually copied
+ * @throw std::out_of_range If pos > size().
+ *
+ * Copies up to @a n characters starting at @a pos into the C string @a
+ * s. If @a pos is greater than size(), out_of_range is thrown.
+ */
+ size_type
+ copy(_CharT* __s, size_type __n, size_type __pos = 0) const;
+
+ /**
+ * @brief Swap contents with another string.
+ * @param s String to swap with.
+ *
+ * Exchanges the contents of this string with that of @a s in constant
+ * time.
+ */
+ void
+ swap(basic_string& __s);
+
+ // String operations:
+ /**
+ * @brief Return const pointer to null-terminated contents.
+ *
+ * This is a handle to internal data. Do not modify or dire things may
+ * happen.
+ */
+ const _CharT*
+ c_str() const
+ { return _M_data(); }
+
+ /**
+ * @brief Return const pointer to contents.
+ *
+ * This is a handle to internal data. Do not modify or dire things may
+ * happen.
+ */
+ const _CharT*
+ data() const
+ { return _M_data(); }
+
+ /**
+ * @brief Return copy of allocator used to construct this string.
+ */
+ allocator_type
+ get_allocator() const
+ { return _M_dataplus; }
+
+ /**
+ * @brief Find position of a C substring.
+ * @param s C string to locate.
+ * @param pos Index of character to search from.
+ * @param n Number of characters from @a s to search for.
+ * @return Index of start of first occurrence.
+ *
+ * Starting from @a pos, searches forward for the first @a n characters
+ * in @a s within this string. If found, returns the index where it
+ * begins. If not found, returns npos.
+ */
+ size_type
+ find(const _CharT* __s, size_type __pos, size_type __n) const;
+
+ /**
+ * @brief Find position of a string.
+ * @param str String to locate.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of start of first occurrence.
+ *
+ * Starting from @a pos, searches forward for value of @a str within
+ * this string. If found, returns the index where it begins. If not
+ * found, returns npos.
+ */
+ size_type
+ find(const basic_string& __str, size_type __pos = 0) const
+ { return this->find(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find position of a C string.
+ * @param s C string to locate.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of start of first occurrence.
+ *
+ * Starting from @a pos, searches forward for the value of @a s within
+ * this string. If found, returns the index where it begins. If not
+ * found, returns npos.
+ */
+ size_type
+ find(const _CharT* __s, size_type __pos = 0) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->find(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find position of a character.
+ * @param c Character to locate.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for @a c within this string.
+ * If found, returns the index where it was found. If not found,
+ * returns npos.
+ */
+ size_type
+ find(_CharT __c, size_type __pos = 0) const;
+
+ /**
+ * @brief Find last position of a string.
+ * @param str String to locate.
+ * @param pos Index of character to search back from (default end).
+ * @return Index of start of last occurrence.
+ *
+ * Starting from @a pos, searches backward for value of @a str within
+ * this string. If found, returns the index where it begins. If not
+ * found, returns npos.
+ */
+ size_type
+ rfind(const basic_string& __str, size_type __pos = npos) const
+ { return this->rfind(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find last position of a C substring.
+ * @param s C string to locate.
+ * @param pos Index of character to search back from.
+ * @param n Number of characters from s to search for.
+ * @return Index of start of last occurrence.
+ *
+ * Starting from @a pos, searches backward for the first @a n
+ * characters in @a s within this string. If found, returns the index
+ * where it begins. If not found, returns npos.
+ */
+ size_type
+ rfind(const _CharT* __s, size_type __pos, size_type __n) const;
+
+ /**
+ * @brief Find last position of a C string.
+ * @param s C string to locate.
+ * @param pos Index of character to start search at (default end).
+ * @return Index of start of last occurrence.
+ *
+ * Starting from @a pos, searches backward for the value of @a s within
+ * this string. If found, returns the index where it begins. If not
+ * found, returns npos.
+ */
+ size_type
+ rfind(const _CharT* __s, size_type __pos = npos) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->rfind(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find last position of a character.
+ * @param c Character to locate.
+ * @param pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for @a c within this string.
+ * If found, returns the index where it was found. If not found,
+ * returns npos.
+ */
+ size_type
+ rfind(_CharT __c, size_type __pos = npos) const;
+
+ /**
+ * @brief Find position of a character of string.
+ * @param str String containing characters to locate.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for one of the characters of
+ * @a str within this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
+ size_type
+ find_first_of(const basic_string& __str, size_type __pos = 0) const
+ { return this->find_first_of(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find position of a character of C substring.
+ * @param s String containing characters to locate.
+ * @param pos Index of character to search from.
+ * @param n Number of characters from s to search for.
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for one of the first @a n
+ * characters of @a s within this string. If found, returns the index
+ * where it was found. If not found, returns npos.
+ */
+ size_type
+ find_first_of(const _CharT* __s, size_type __pos, size_type __n) const;
+
+ /**
+ * @brief Find position of a character of C string.
+ * @param s String containing characters to locate.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for one of the characters of
+ * @a s within this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
+ size_type
+ find_first_of(const _CharT* __s, size_type __pos = 0) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->find_first_of(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find position of a character.
+ * @param c Character to locate.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for the character @a c within
+ * this string. If found, returns the index where it was found. If
+ * not found, returns npos.
+ *
+ * Note: equivalent to find(c, pos).
+ */
+ size_type
+ find_first_of(_CharT __c, size_type __pos = 0) const
+ { return this->find(__c, __pos); }
+
+ /**
+ * @brief Find last position of a character of string.
+ * @param str String containing characters to locate.
+ * @param pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for one of the characters of
+ * @a str within this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
+ size_type
+ find_last_of(const basic_string& __str, size_type __pos = npos) const
+ { return this->find_last_of(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find last position of a character of C substring.
+ * @param s C string containing characters to locate.
+ * @param pos Index of character to search back from.
+ * @param n Number of characters from s to search for.
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for one of the first @a n
+ * characters of @a s within this string. If found, returns the index
+ * where it was found. If not found, returns npos.
+ */
+ size_type
+ find_last_of(const _CharT* __s, size_type __pos, size_type __n) const;
+
+ /**
+ * @brief Find last position of a character of C string.
+ * @param s C string containing characters to locate.
+ * @param pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for one of the characters of
+ * @a s within this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
+ size_type
+ find_last_of(const _CharT* __s, size_type __pos = npos) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->find_last_of(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find last position of a character.
+ * @param c Character to locate.
+ * @param pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for @a c within this string.
+ * If found, returns the index where it was found. If not found,
+ * returns npos.
+ *
+ * Note: equivalent to rfind(c, pos).
+ */
+ size_type
+ find_last_of(_CharT __c, size_type __pos = npos) const
+ { return this->rfind(__c, __pos); }
+
+ /**
+ * @brief Find position of a character not in string.
+ * @param str String containing characters to avoid.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for a character not contained
+ * in @a str within this string. If found, returns the index where it
+ * was found. If not found, returns npos.
+ */
+ size_type
+ find_first_not_of(const basic_string& __str, size_type __pos = 0) const
+ { return this->find_first_not_of(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find position of a character not in C substring.
+ * @param s C string containing characters to avoid.
+ * @param pos Index of character to search from.
+ * @param n Number of characters from s to consider.
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for a character not contained
+ * in the first @a n characters of @a s within this string. If found,
+ * returns the index where it was found. If not found, returns npos.
+ */
+ size_type
+ find_first_not_of(const _CharT* __s, size_type __pos,
+ size_type __n) const;
+
+ /**
+ * @brief Find position of a character not in C string.
+ * @param s C string containing characters to avoid.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for a character not contained
+ * in @a s within this string. If found, returns the index where it
+ * was found. If not found, returns npos.
+ */
+ size_type
+ find_first_not_of(const _CharT* __s, size_type __pos = 0) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->find_first_not_of(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find position of a different character.
+ * @param c Character to avoid.
+ * @param pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a pos, searches forward for a character other than @a c
+ * within this string. If found, returns the index where it was found.
+ * If not found, returns npos.
+ */
+ size_type
+ find_first_not_of(_CharT __c, size_type __pos = 0) const;
+
+ /**
+ * @brief Find last position of a character not in string.
+ * @param str String containing characters to avoid.
+ * @param pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for a character not
+ * contained in @a str within this string. If found, returns the index
+ * where it was found. If not found, returns npos.
+ */
+ size_type
+ find_last_not_of(const basic_string& __str, size_type __pos = npos) const
+ { return this->find_last_not_of(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find last position of a character not in C substring.
+ * @param s C string containing characters to avoid.
+ * @param pos Index of character to search back from.
+ * @param n Number of characters from s to consider.
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for a character not
+ * contained in the first @a n characters of @a s within this string.
+ * If found, returns the index where it was found. If not found,
+ * returns npos.
+ */
+ size_type
+ find_last_not_of(const _CharT* __s, size_type __pos,
+ size_type __n) const;
+ /**
+ * @brief Find last position of a character not in C string.
+ * @param s C string containing characters to avoid.
+ * @param pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for a character not
+ * contained in @a s within this string. If found, returns the index
+ * where it was found. If not found, returns npos.
+ */
+ size_type
+ find_last_not_of(const _CharT* __s, size_type __pos = npos) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->find_last_not_of(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find last position of a different character.
+ * @param c Character to avoid.
+ * @param pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a pos, searches backward for a character other than
+ * @a c within this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
+ size_type
+ find_last_not_of(_CharT __c, size_type __pos = npos) const;
+
+ /**
+ * @brief Get a substring.
+ * @param pos Index of first character (default 0).
+ * @param n Number of characters in substring (default remainder).
+ * @return The new string.
+ * @throw std::out_of_range If pos > size().
+ *
+ * Construct and return a new string using the @a n characters starting
+ * at @a pos. If the string is too short, use the remainder of the
+ * characters. If @a pos is beyond the end of the string, out_of_range
+ * is thrown.
+ */
+ basic_string
+ substr(size_type __pos = 0, size_type __n = npos) const
+ { return basic_string(*this,
+ _M_check(__pos, "basic_string::substr"), __n); }
+
+ /**
+ * @brief Compare to a string.
+ * @param str String to compare against.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Returns an integer < 0 if this string is ordered before @a str, 0 if
+ * their values are equivalent, or > 0 if this string is ordered after
+ * @a str. Determines the effective length rlen of the strings to
+ * compare as the smallest of size() and str.size(). The function
+ * then compares the two strings by calling traits::compare(data(),
+ * str.data(),rlen). If the result of the comparison is nonzero returns
+ * it, otherwise the shorter one is ordered first.
+ */
+ int
+ compare(const basic_string& __str) const
+ {
+ const size_type __size = this->size();
+ const size_type __osize = __str.size();
+ const size_type __len = std::min(__size, __osize);
+
+ int __r = traits_type::compare(_M_data(), __str.data(), __len);
+ if (!__r)
+ __r = _S_compare(__size, __osize);
+ return __r;
+ }
+
+ /**
+ * @brief Compare substring to a string.
+ * @param pos Index of first character of substring.
+ * @param n Number of characters in substring.
+ * @param str String to compare against.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Form the substring of this string from the @a n characters starting
+ * at @a pos. Returns an integer < 0 if the substring is ordered
+ * before @a str, 0 if their values are equivalent, or > 0 if the
+ * substring is ordered after @a str. Determines the effective length
+ * rlen of the strings to compare as the smallest of the length of the
+ * substring and @a str.size(). The function then compares the two
+ * strings by calling traits::compare(substring.data(),str.data(),rlen).
+ * If the result of the comparison is nonzero returns it, otherwise the
+ * shorter one is ordered first.
+ */
+ int
+ compare(size_type __pos, size_type __n, const basic_string& __str) const;
+
+ /**
+ * @brief Compare substring to a substring.
+ * @param pos1 Index of first character of substring.
+ * @param n1 Number of characters in substring.
+ * @param str String to compare against.
+ * @param pos2 Index of first character of substring of str.
+ * @param n2 Number of characters in substring of str.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Form the substring of this string from the @a n1 characters starting
+ * at @a pos1. Form the substring of @a str from the @a n2 characters
+ * starting at @a pos2. Returns an integer < 0 if this substring is
+ * ordered before the substring of @a str, 0 if their values are
+ * equivalent, or > 0 if this substring is ordered after the substring
+ * of @a str. Determines the effective length rlen of the strings
+ * to compare as the smallest of the lengths of the substrings. The
+ * function then compares the two strings by calling
+ * traits::compare(substring.data(),str.substr(pos2,n2).data(),rlen).
+ * If the result of the comparison is nonzero returns it, otherwise the
+ * shorter one is ordered first.
+ */
+ int
+ compare(size_type __pos1, size_type __n1, const basic_string& __str,
+ size_type __pos2, size_type __n2) const;
+
+ /**
+ * @brief Compare to a C string.
+ * @param s C string to compare against.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Returns an integer < 0 if this string is ordered before @a s, 0 if
+ * their values are equivalent, or > 0 if this string is ordered after
+ * @a s. Determines the effective length rlen of the strings to
+ * compare as the smallest of size() and the length of a string
+ * constructed from @a s. The function then compares the two strings
+ * by calling traits::compare(data(),s,rlen). If the result of the
+ * comparison is nonzero returns it, otherwise the shorter one is
+ * ordered first.
+ */
+ int
+ compare(const _CharT* __s) const;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 5 String::compare specification questionable
+ /**
+ * @brief Compare substring to a C string.
+ * @param pos Index of first character of substring.
+ * @param n1 Number of characters in substring.
+ * @param s C string to compare against.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Form the substring of this string from the @a n1 characters starting
+ * at @a pos. Returns an integer < 0 if the substring is ordered
+ * before @a s, 0 if their values are equivalent, or > 0 if the
+ * substring is ordered after @a s. Determines the effective length
+ * rlen of the strings to compare as the smallest of the length of the
+ * substring and the length of a string constructed from @a s. The
+ * function then compares the two string by calling
+ * traits::compare(substring.data(),s,rlen). If the result of the
+ * comparison is nonzero returns it, otherwise the shorter one is
+ * ordered first.
+ */
+ int
+ compare(size_type __pos, size_type __n1, const _CharT* __s) const;
+
+ /**
+ * @brief Compare substring against a character array.
+ * @param pos1 Index of first character of substring.
+ * @param n1 Number of characters in substring.
+ * @param s character array to compare against.
+ * @param n2 Number of characters of s.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Form the substring of this string from the @a n1 characters starting
+ * at @a pos1. Form a string from the first @a n2 characters of @a s.
+ * Returns an integer < 0 if this substring is ordered before the string
+ * from @a s, 0 if their values are equivalent, or > 0 if this substring
+ * is ordered after the string from @a s. Determines the effective
+ * length rlen of the strings to compare as the smallest of the length
+ * of the substring and @a n2. The function then compares the two
+ * strings by calling traits::compare(substring.data(),s,rlen). If the
+ * result of the comparison is nonzero returns it, otherwise the shorter
+ * one is ordered first.
+ *
+ * NB: s must have at least n2 characters, '\\0' has no special
+ * meaning.
+ */
+ int
+ compare(size_type __pos, size_type __n1, const _CharT* __s,
+ size_type __n2) const;
+ };
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline basic_string<_CharT, _Traits, _Alloc>::
+ basic_string()
+#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+ : _M_dataplus(_S_empty_rep()._M_refdata(), _Alloc()) { }
+#else
+ : _M_dataplus(_S_construct(size_type(), _CharT(), _Alloc()), _Alloc()) { }
+#endif
+
+ // operator+
+ /**
+ * @brief Concatenate two strings.
+ * @param lhs First string.
+ * @param rhs Last string.
+ * @return New string with value of @a lhs followed by @a rhs.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>
+ operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ {
+ basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
+ __str.append(__rhs);
+ return __str;
+ }
+
+ /**
+ * @brief Concatenate C string and string.
+ * @param lhs First string.
+ * @param rhs Last string.
+ * @return New string with value of @a lhs followed by @a rhs.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT,_Traits,_Alloc>
+ operator+(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Alloc>& __rhs);
+
+ /**
+ * @brief Concatenate character and string.
+ * @param lhs First string.
+ * @param rhs Last string.
+ * @return New string with @a lhs followed by @a rhs.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT,_Traits,_Alloc>
+ operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs);
+
+ /**
+ * @brief Concatenate string and C string.
+ * @param lhs First string.
+ * @param rhs Last string.
+ * @return New string with @a lhs followed by @a rhs.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline basic_string<_CharT, _Traits, _Alloc>
+ operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const _CharT* __rhs)
+ {
+ basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
+ __str.append(__rhs);
+ return __str;
+ }
+
+ /**
+ * @brief Concatenate string and character.
+ * @param lhs First string.
+ * @param rhs Last string.
+ * @return New string with @a lhs followed by @a rhs.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline basic_string<_CharT, _Traits, _Alloc>
+ operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
+ {
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+ typedef typename __string_type::size_type __size_type;
+ __string_type __str(__lhs);
+ __str.append(__size_type(1), __rhs);
+ return __str;
+ }
+
+ // operator ==
+ /**
+ * @brief Test equivalence of two strings.
+ * @param lhs First string.
+ * @param rhs Second string.
+ * @return True if @a lhs.compare(@a rhs) == 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __lhs.compare(__rhs) == 0; }
+
+ template<typename _CharT>
+ inline
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, bool>::__type
+ operator==(const basic_string<_CharT>& __lhs,
+ const basic_string<_CharT>& __rhs)
+ { return (__lhs.size() == __rhs.size()
+ && !std::char_traits<_CharT>::compare(__lhs.data(), __rhs.data(),
+ __lhs.size())); }
+
+ /**
+ * @brief Test equivalence of C string and string.
+ * @param lhs C string.
+ * @param rhs String.
+ * @return True if @a rhs.compare(@a lhs) == 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator==(const _CharT* __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __rhs.compare(__lhs) == 0; }
+
+ /**
+ * @brief Test equivalence of string and C string.
+ * @param lhs String.
+ * @param rhs C string.
+ * @return True if @a lhs.compare(@a rhs) == 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) == 0; }
+
+ // operator !=
+ /**
+ * @brief Test difference of two strings.
+ * @param lhs First string.
+ * @param rhs Second string.
+ * @return True if @a lhs.compare(@a rhs) != 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return !(__lhs == __rhs); }
+
+ /**
+ * @brief Test difference of C string and string.
+ * @param lhs C string.
+ * @param rhs String.
+ * @return True if @a rhs.compare(@a lhs) != 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator!=(const _CharT* __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return !(__lhs == __rhs); }
+
+ /**
+ * @brief Test difference of string and C string.
+ * @param lhs String.
+ * @param rhs C string.
+ * @return True if @a lhs.compare(@a rhs) != 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const _CharT* __rhs)
+ { return !(__lhs == __rhs); }
+
+ // operator <
+ /**
+ * @brief Test if string precedes string.
+ * @param lhs First string.
+ * @param rhs Second string.
+ * @return True if @a lhs precedes @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __lhs.compare(__rhs) < 0; }
+
+ /**
+ * @brief Test if string precedes C string.
+ * @param lhs String.
+ * @param rhs C string.
+ * @return True if @a lhs precedes @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) < 0; }
+
+ /**
+ * @brief Test if C string precedes string.
+ * @param lhs C string.
+ * @param rhs String.
+ * @return True if @a lhs precedes @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator<(const _CharT* __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __rhs.compare(__lhs) > 0; }
+
+ // operator >
+ /**
+ * @brief Test if string follows string.
+ * @param lhs First string.
+ * @param rhs Second string.
+ * @return True if @a lhs follows @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __lhs.compare(__rhs) > 0; }
+
+ /**
+ * @brief Test if string follows C string.
+ * @param lhs String.
+ * @param rhs C string.
+ * @return True if @a lhs follows @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) > 0; }
+
+ /**
+ * @brief Test if C string follows string.
+ * @param lhs C string.
+ * @param rhs String.
+ * @return True if @a lhs follows @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator>(const _CharT* __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __rhs.compare(__lhs) < 0; }
+
+ // operator <=
+ /**
+ * @brief Test if string doesn't follow string.
+ * @param lhs First string.
+ * @param rhs Second string.
+ * @return True if @a lhs doesn't follow @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __lhs.compare(__rhs) <= 0; }
+
+ /**
+ * @brief Test if string doesn't follow C string.
+ * @param lhs String.
+ * @param rhs C string.
+ * @return True if @a lhs doesn't follow @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) <= 0; }
+
+ /**
+ * @brief Test if C string doesn't follow string.
+ * @param lhs C string.
+ * @param rhs String.
+ * @return True if @a lhs doesn't follow @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator<=(const _CharT* __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __rhs.compare(__lhs) >= 0; }
+
+ // operator >=
+ /**
+ * @brief Test if string doesn't precede string.
+ * @param lhs First string.
+ * @param rhs Second string.
+ * @return True if @a lhs doesn't precede @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __lhs.compare(__rhs) >= 0; }
+
+ /**
+ * @brief Test if string doesn't precede C string.
+ * @param lhs String.
+ * @param rhs C string.
+ * @return True if @a lhs doesn't precede @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) >= 0; }
+
+ /**
+ * @brief Test if C string doesn't precede string.
+ * @param lhs C string.
+ * @param rhs String.
+ * @return True if @a lhs doesn't precede @a rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline bool
+ operator>=(const _CharT* __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { return __rhs.compare(__lhs) <= 0; }
+
+ /**
+ * @brief Swap contents of two strings.
+ * @param lhs First string.
+ * @param rhs Second string.
+ *
+ * Exchanges the contents of @a lhs and @a rhs in constant time.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline void
+ swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
+ basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ /**
+ * @brief Read stream into a string.
+ * @param is Input stream.
+ * @param str Buffer to store into.
+ * @return Reference to the input stream.
+ *
+ * Stores characters from @a is into @a str until whitespace is found, the
+ * end of the stream is encountered, or str.max_size() is reached. If
+ * is.width() is non-zero, that is the limit on the number of characters
+ * stored into @a str. Any previous contents of @a str are erased.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __is,
+ basic_string<_CharT, _Traits, _Alloc>& __str);
+
+ template<>
+ basic_istream<char>&
+ operator>>(basic_istream<char>& __is, basic_string<char>& __str);
+
+ /**
+ * @brief Write string to a stream.
+ * @param os Output stream.
+ * @param str String to write out.
+ * @return Reference to the output stream.
+ *
+ * Output characters of @a str into os following the same rules as for
+ * writing a C string.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os,
+ const basic_string<_CharT, _Traits, _Alloc>& __str)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 586. string inserter not a formatted function
+ return __ostream_insert(__os, __str.data(), __str.size());
+ }
+
+ /**
+ * @brief Read a line from stream into a string.
+ * @param is Input stream.
+ * @param str Buffer to store into.
+ * @param delim Character marking end of line.
+ * @return Reference to the input stream.
+ *
+ * Stores characters from @a is into @a str until @a delim is found, the
+ * end of the stream is encountered, or str.max_size() is reached. If
+ * is.width() is non-zero, that is the limit on the number of characters
+ * stored into @a str. Any previous contents of @a str are erased. If @a
+ * delim was encountered, it is extracted but not stored into @a str.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_istream<_CharT, _Traits>&
+ getline(basic_istream<_CharT, _Traits>& __is,
+ basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim);
+
+ /**
+ * @brief Read a line from stream into a string.
+ * @param is Input stream.
+ * @param str Buffer to store into.
+ * @return Reference to the input stream.
+ *
+ * Stores characters from is into @a str until '\n' is found, the end of
+ * the stream is encountered, or str.max_size() is reached. If is.width()
+ * is non-zero, that is the limit on the number of characters stored into
+ * @a str. Any previous contents of @a str are erased. If end of line was
+ * encountered, it is extracted but not stored into @a str.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline basic_istream<_CharT, _Traits>&
+ getline(basic_istream<_CharT, _Traits>& __is,
+ basic_string<_CharT, _Traits, _Alloc>& __str)
+ { return getline(__is, __str, __is.widen('\n')); }
+
+ template<>
+ basic_istream<char>&
+ getline(basic_istream<char>& __in, basic_string<char>& __str,
+ char __delim);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ basic_istream<wchar_t>&
+ getline(basic_istream<wchar_t>& __in, basic_string<wchar_t>& __str,
+ wchar_t __delim);
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#if (defined(__GXX_EXPERIMENTAL_CXX0X__) && defined(_GLIBCXX_USE_C99) \
+ && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF))
+
+#include <ext/string_conversions.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 21.4 Numeric Conversions [string.conversions].
+ inline int
+ stoi(const string& __str, size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa<long, int>(&std::strtol, "stoi", __str.c_str(),
+ __idx, __base); }
+
+ inline long
+ stol(const string& __str, size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::strtol, "stol", __str.c_str(),
+ __idx, __base); }
+
+ inline unsigned long
+ stoul(const string& __str, size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::strtoul, "stoul", __str.c_str(),
+ __idx, __base); }
+
+ inline long long
+ stoll(const string& __str, size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::strtoll, "stoll", __str.c_str(),
+ __idx, __base); }
+
+ inline unsigned long long
+ stoull(const string& __str, size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::strtoull, "stoull", __str.c_str(),
+ __idx, __base); }
+
+ // NB: strtof vs strtod.
+ inline float
+ stof(const string& __str, size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::strtof, "stof", __str.c_str(), __idx); }
+
+ inline double
+ stod(const string& __str, size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::strtod, "stod", __str.c_str(), __idx); }
+
+ inline long double
+ stold(const string& __str, size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::strtold, "stold", __str.c_str(), __idx); }
+
+ // NB: (v)snprintf vs sprintf.
+ inline string
+ to_string(long long __val)
+ { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
+ 4 * sizeof(long long),
+ "%lld", __val); }
+
+ inline string
+ to_string(unsigned long long __val)
+ { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
+ 4 * sizeof(unsigned long long),
+ "%llu", __val); }
+
+ inline string
+ to_string(long double __val)
+ {
+ const int __n =
+ __gnu_cxx::__numeric_traits<long double>::__max_exponent10 + 20;
+ return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
+ "%Lf", __val);
+ }
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ inline int
+ stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa<long, int>(&std::wcstol, "stoi", __str.c_str(),
+ __idx, __base); }
+
+ inline long
+ stol(const wstring& __str, size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::wcstol, "stol", __str.c_str(),
+ __idx, __base); }
+
+ inline unsigned long
+ stoul(const wstring& __str, size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::wcstoul, "stoul", __str.c_str(),
+ __idx, __base); }
+
+ inline long long
+ stoll(const wstring& __str, size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::wcstoll, "stoll", __str.c_str(),
+ __idx, __base); }
+
+ inline unsigned long long
+ stoull(const wstring& __str, size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::wcstoull, "stoull", __str.c_str(),
+ __idx, __base); }
+
+ // NB: wcstof vs wcstod.
+ inline float
+ stof(const wstring& __str, size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::wcstof, "stof", __str.c_str(), __idx); }
+
+ inline double
+ stod(const wstring& __str, size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::wcstod, "stod", __str.c_str(), __idx); }
+
+ inline long double
+ stold(const wstring& __str, size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::wcstold, "stold", __str.c_str(), __idx); }
+
+ inline wstring
+ to_wstring(long long __val)
+ { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf,
+ 4 * sizeof(long long),
+ L"%lld", __val); }
+
+ inline wstring
+ to_wstring(unsigned long long __val)
+ { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf,
+ 4 * sizeof(unsigned long long),
+ L"%llu", __val); }
+
+ inline wstring
+ to_wstring(long double __val)
+ {
+ const int __n =
+ __gnu_cxx::__numeric_traits<long double>::__max_exponent10 + 20;
+ return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf, __n,
+ L"%Lf", __val);
+ }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
+#endif /* _BASIC_STRING_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/basic_string.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/basic_string.tcc
new file mode 100644
index 0000000..a5553c6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/basic_string.tcc
@@ -0,0 +1,1144 @@
+// Components for manipulating sequences of characters -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file basic_string.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 21 Strings library
+//
+
+// Written by Jason Merrill based upon the specification by Takanori Adachi
+// in ANSI X3J16/94-0013R2. Rewritten by Nathan Myers to ISO-14882.
+
+#ifndef _BASIC_STRING_TCC
+#define _BASIC_STRING_TCC 1
+
+#pragma GCC system_header
+
+#include <cxxabi-forced.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ const typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ _Rep::_S_max_size = (((npos - sizeof(_Rep_base))/sizeof(_CharT)) - 1) / 4;
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ const _CharT
+ basic_string<_CharT, _Traits, _Alloc>::
+ _Rep::_S_terminal = _CharT();
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ const typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::npos;
+
+ // Linker sets _S_empty_rep_storage to all 0s (one reference, empty string)
+ // at static init time (before static ctors are run).
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
+ (sizeof(_Rep_base) + sizeof(_CharT) + sizeof(size_type) - 1) /
+ sizeof(size_type)];
+
+ // NB: This is the special case for Input Iterators, used in
+ // istreambuf_iterators, etc.
+ // Input Iterators have a cost structure very different from
+ // pointers, calling for a different coding style.
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InIterator>
+ _CharT*
+ basic_string<_CharT, _Traits, _Alloc>::
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
+ input_iterator_tag)
+ {
+#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+ if (__beg == __end && __a == _Alloc())
+ return _S_empty_rep()._M_refdata();
+#endif
+ // Avoid reallocation for common case.
+ _CharT __buf[128];
+ size_type __len = 0;
+ while (__beg != __end && __len < sizeof(__buf) / sizeof(_CharT))
+ {
+ __buf[__len++] = *__beg;
+ ++__beg;
+ }
+ _Rep* __r = _Rep::_S_create(__len, size_type(0), __a);
+ _M_copy(__r->_M_refdata(), __buf, __len);
+ __try
+ {
+ while (__beg != __end)
+ {
+ if (__len == __r->_M_capacity)
+ {
+ // Allocate more space.
+ _Rep* __another = _Rep::_S_create(__len + 1, __len, __a);
+ _M_copy(__another->_M_refdata(), __r->_M_refdata(), __len);
+ __r->_M_destroy(__a);
+ __r = __another;
+ }
+ __r->_M_refdata()[__len++] = *__beg;
+ ++__beg;
+ }
+ }
+ __catch(...)
+ {
+ __r->_M_destroy(__a);
+ __throw_exception_again;
+ }
+ __r->_M_set_length_and_sharable(__len);
+ return __r->_M_refdata();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template <typename _InIterator>
+ _CharT*
+ basic_string<_CharT, _Traits, _Alloc>::
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
+ forward_iterator_tag)
+ {
+#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+ if (__beg == __end && __a == _Alloc())
+ return _S_empty_rep()._M_refdata();
+#endif
+ // NB: Not required, but considered best practice.
+ if (__builtin_expect(__gnu_cxx::__is_null_pointer(__beg)
+ && __beg != __end, 0))
+ __throw_logic_error(__N("basic_string::_S_construct NULL not valid"));
+
+ const size_type __dnew = static_cast<size_type>(std::distance(__beg,
+ __end));
+ // Check for out_of_range and length_error exceptions.
+ _Rep* __r = _Rep::_S_create(__dnew, size_type(0), __a);
+ __try
+ { _S_copy_chars(__r->_M_refdata(), __beg, __end); }
+ __catch(...)
+ {
+ __r->_M_destroy(__a);
+ __throw_exception_again;
+ }
+ __r->_M_set_length_and_sharable(__dnew);
+ return __r->_M_refdata();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ _CharT*
+ basic_string<_CharT, _Traits, _Alloc>::
+ _S_construct(size_type __n, _CharT __c, const _Alloc& __a)
+ {
+#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+ if (__n == 0 && __a == _Alloc())
+ return _S_empty_rep()._M_refdata();
+#endif
+ // Check for out_of_range and length_error exceptions.
+ _Rep* __r = _Rep::_S_create(__n, size_type(0), __a);
+ if (__n)
+ _M_assign(__r->_M_refdata(), __n, __c);
+
+ __r->_M_set_length_and_sharable(__n);
+ return __r->_M_refdata();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(const basic_string& __str)
+ : _M_dataplus(__str._M_rep()->_M_grab(_Alloc(__str.get_allocator()),
+ __str.get_allocator()),
+ __str.get_allocator())
+ { }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(const _Alloc& __a)
+ : _M_dataplus(_S_construct(size_type(), _CharT(), __a), __a)
+ { }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(const basic_string& __str, size_type __pos, size_type __n)
+ : _M_dataplus(_S_construct(__str._M_data()
+ + __str._M_check(__pos,
+ "basic_string::basic_string"),
+ __str._M_data() + __str._M_limit(__pos, __n)
+ + __pos, _Alloc()), _Alloc())
+ { }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(const basic_string& __str, size_type __pos,
+ size_type __n, const _Alloc& __a)
+ : _M_dataplus(_S_construct(__str._M_data()
+ + __str._M_check(__pos,
+ "basic_string::basic_string"),
+ __str._M_data() + __str._M_limit(__pos, __n)
+ + __pos, __a), __a)
+ { }
+
+ // TBD: DPG annotate
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(const _CharT* __s, size_type __n, const _Alloc& __a)
+ : _M_dataplus(_S_construct(__s, __s + __n, __a), __a)
+ { }
+
+ // TBD: DPG annotate
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(const _CharT* __s, const _Alloc& __a)
+ : _M_dataplus(_S_construct(__s, __s ? __s + traits_type::length(__s) :
+ __s + npos, __a), __a)
+ { }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(size_type __n, _CharT __c, const _Alloc& __a)
+ : _M_dataplus(_S_construct(__n, __c, __a), __a)
+ { }
+
+ // TBD: DPG annotate
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InputIterator>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(_InputIterator __beg, _InputIterator __end, const _Alloc& __a)
+ : _M_dataplus(_S_construct(__beg, __end, __a), __a)
+ { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(initializer_list<_CharT> __l, const _Alloc& __a)
+ : _M_dataplus(_S_construct(__l.begin(), __l.end(), __a), __a)
+ { }
+#endif
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ assign(const basic_string& __str)
+ {
+ if (_M_rep() != __str._M_rep())
+ {
+ // XXX MT
+ const allocator_type __a = this->get_allocator();
+ _CharT* __tmp = __str._M_rep()->_M_grab(__a, __str.get_allocator());
+ _M_rep()->_M_dispose(__a);
+ _M_data(__tmp);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ assign(const _CharT* __s, size_type __n)
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ _M_check_length(this->size(), __n, "basic_string::assign");
+ if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
+ return _M_replace_safe(size_type(0), this->size(), __s, __n);
+ else
+ {
+ // Work in-place.
+ const size_type __pos = __s - _M_data();
+ if (__pos >= __n)
+ _M_copy(_M_data(), __s, __n);
+ else if (__pos)
+ _M_move(_M_data(), __s, __n);
+ _M_rep()->_M_set_length_and_sharable(__n);
+ return *this;
+ }
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ append(size_type __n, _CharT __c)
+ {
+ if (__n)
+ {
+ _M_check_length(size_type(0), __n, "basic_string::append");
+ const size_type __len = __n + this->size();
+ if (__len > this->capacity() || _M_rep()->_M_is_shared())
+ this->reserve(__len);
+ _M_assign(_M_data() + this->size(), __n, __c);
+ _M_rep()->_M_set_length_and_sharable(__len);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ append(const _CharT* __s, size_type __n)
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ if (__n)
+ {
+ _M_check_length(size_type(0), __n, "basic_string::append");
+ const size_type __len = __n + this->size();
+ if (__len > this->capacity() || _M_rep()->_M_is_shared())
+ {
+ if (_M_disjunct(__s))
+ this->reserve(__len);
+ else
+ {
+ const size_type __off = __s - _M_data();
+ this->reserve(__len);
+ __s = _M_data() + __off;
+ }
+ }
+ _M_copy(_M_data() + this->size(), __s, __n);
+ _M_rep()->_M_set_length_and_sharable(__len);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ append(const basic_string& __str)
+ {
+ const size_type __size = __str.size();
+ if (__size)
+ {
+ const size_type __len = __size + this->size();
+ if (__len > this->capacity() || _M_rep()->_M_is_shared())
+ this->reserve(__len);
+ _M_copy(_M_data() + this->size(), __str._M_data(), __size);
+ _M_rep()->_M_set_length_and_sharable(__len);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ append(const basic_string& __str, size_type __pos, size_type __n)
+ {
+ __str._M_check(__pos, "basic_string::append");
+ __n = __str._M_limit(__pos, __n);
+ if (__n)
+ {
+ const size_type __len = __n + this->size();
+ if (__len > this->capacity() || _M_rep()->_M_is_shared())
+ this->reserve(__len);
+ _M_copy(_M_data() + this->size(), __str._M_data() + __pos, __n);
+ _M_rep()->_M_set_length_and_sharable(__len);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ insert(size_type __pos, const _CharT* __s, size_type __n)
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ _M_check(__pos, "basic_string::insert");
+ _M_check_length(size_type(0), __n, "basic_string::insert");
+ if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
+ return _M_replace_safe(__pos, size_type(0), __s, __n);
+ else
+ {
+ // Work in-place.
+ const size_type __off = __s - _M_data();
+ _M_mutate(__pos, 0, __n);
+ __s = _M_data() + __off;
+ _CharT* __p = _M_data() + __pos;
+ if (__s + __n <= __p)
+ _M_copy(__p, __s, __n);
+ else if (__s >= __p)
+ _M_copy(__p, __s + __n, __n);
+ else
+ {
+ const size_type __nleft = __p - __s;
+ _M_copy(__p, __s, __nleft);
+ _M_copy(__p + __nleft, __p + __n, __n - __nleft);
+ }
+ return *this;
+ }
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ replace(size_type __pos, size_type __n1, const _CharT* __s,
+ size_type __n2)
+ {
+ __glibcxx_requires_string_len(__s, __n2);
+ _M_check(__pos, "basic_string::replace");
+ __n1 = _M_limit(__pos, __n1);
+ _M_check_length(__n1, __n2, "basic_string::replace");
+ bool __left;
+ if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
+ return _M_replace_safe(__pos, __n1, __s, __n2);
+ else if ((__left = __s + __n2 <= _M_data() + __pos)
+ || _M_data() + __pos + __n1 <= __s)
+ {
+ // Work in-place: non-overlapping case.
+ size_type __off = __s - _M_data();
+ __left ? __off : (__off += __n2 - __n1);
+ _M_mutate(__pos, __n1, __n2);
+ _M_copy(_M_data() + __pos, _M_data() + __off, __n2);
+ return *this;
+ }
+ else
+ {
+ // Todo: overlapping case.
+ const basic_string __tmp(__s, __n2);
+ return _M_replace_safe(__pos, __n1, __tmp._M_data(), __n2);
+ }
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ basic_string<_CharT, _Traits, _Alloc>::_Rep::
+ _M_destroy(const _Alloc& __a) throw ()
+ {
+ const size_type __size = sizeof(_Rep_base) +
+ (this->_M_capacity + 1) * sizeof(_CharT);
+ _Raw_bytes_alloc(__a).deallocate(reinterpret_cast<char*>(this), __size);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ basic_string<_CharT, _Traits, _Alloc>::
+ _M_leak_hard()
+ {
+#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+ if (_M_rep() == &_S_empty_rep())
+ return;
+#endif
+ if (_M_rep()->_M_is_shared())
+ _M_mutate(0, 0, 0);
+ _M_rep()->_M_set_leaked();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ basic_string<_CharT, _Traits, _Alloc>::
+ _M_mutate(size_type __pos, size_type __len1, size_type __len2)
+ {
+ const size_type __old_size = this->size();
+ const size_type __new_size = __old_size + __len2 - __len1;
+ const size_type __how_much = __old_size - __pos - __len1;
+
+ if (__new_size > this->capacity() || _M_rep()->_M_is_shared())
+ {
+ // Must reallocate.
+ const allocator_type __a = get_allocator();
+ _Rep* __r = _Rep::_S_create(__new_size, this->capacity(), __a);
+
+ if (__pos)
+ _M_copy(__r->_M_refdata(), _M_data(), __pos);
+ if (__how_much)
+ _M_copy(__r->_M_refdata() + __pos + __len2,
+ _M_data() + __pos + __len1, __how_much);
+
+ _M_rep()->_M_dispose(__a);
+ _M_data(__r->_M_refdata());
+ }
+ else if (__how_much && __len1 != __len2)
+ {
+ // Work in-place.
+ _M_move(_M_data() + __pos + __len2,
+ _M_data() + __pos + __len1, __how_much);
+ }
+ _M_rep()->_M_set_length_and_sharable(__new_size);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ basic_string<_CharT, _Traits, _Alloc>::
+ reserve(size_type __res)
+ {
+ if (__res != this->capacity() || _M_rep()->_M_is_shared())
+ {
+ // Make sure we don't shrink below the current size
+ if (__res < this->size())
+ __res = this->size();
+ const allocator_type __a = get_allocator();
+ _CharT* __tmp = _M_rep()->_M_clone(__a, __res - this->size());
+ _M_rep()->_M_dispose(__a);
+ _M_data(__tmp);
+ }
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ basic_string<_CharT, _Traits, _Alloc>::
+ swap(basic_string& __s)
+ {
+ if (_M_rep()->_M_is_leaked())
+ _M_rep()->_M_set_sharable();
+ if (__s._M_rep()->_M_is_leaked())
+ __s._M_rep()->_M_set_sharable();
+ if (this->get_allocator() == __s.get_allocator())
+ {
+ _CharT* __tmp = _M_data();
+ _M_data(__s._M_data());
+ __s._M_data(__tmp);
+ }
+ // The code below can usually be optimized away.
+ else
+ {
+ const basic_string __tmp1(_M_ibegin(), _M_iend(),
+ __s.get_allocator());
+ const basic_string __tmp2(__s._M_ibegin(), __s._M_iend(),
+ this->get_allocator());
+ *this = __tmp2;
+ __s = __tmp1;
+ }
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::_Rep*
+ basic_string<_CharT, _Traits, _Alloc>::_Rep::
+ _S_create(size_type __capacity, size_type __old_capacity,
+ const _Alloc& __alloc)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 83. String::npos vs. string::max_size()
+ if (__capacity > _S_max_size)
+ __throw_length_error(__N("basic_string::_S_create"));
+
+ // The standard places no restriction on allocating more memory
+ // than is strictly needed within this layer at the moment or as
+ // requested by an explicit application call to reserve().
+
+ // Many malloc implementations perform quite poorly when an
+ // application attempts to allocate memory in a stepwise fashion
+ // growing each allocation size by only 1 char. Additionally,
+ // it makes little sense to allocate less linear memory than the
+ // natural blocking size of the malloc implementation.
+ // Unfortunately, we would need a somewhat low-level calculation
+ // with tuned parameters to get this perfect for any particular
+ // malloc implementation. Fortunately, generalizations about
+ // common features seen among implementations seems to suffice.
+
+ // __pagesize need not match the actual VM page size for good
+ // results in practice, thus we pick a common value on the low
+ // side. __malloc_header_size is an estimate of the amount of
+ // overhead per memory allocation (in practice seen N * sizeof
+ // (void*) where N is 0, 2 or 4). According to folklore,
+ // picking this value on the high side is better than
+ // low-balling it (especially when this algorithm is used with
+ // malloc implementations that allocate memory blocks rounded up
+ // to a size which is a power of 2).
+ const size_type __pagesize = 4096;
+ const size_type __malloc_header_size = 4 * sizeof(void*);
+
+ // The below implements an exponential growth policy, necessary to
+ // meet amortized linear time requirements of the library: see
+ // http://gcc.gnu.org/ml/libstdc++/2001-07/msg00085.html.
+ // It's active for allocations requiring an amount of memory above
+ // system pagesize. This is consistent with the requirements of the
+ // standard: http://gcc.gnu.org/ml/libstdc++/2001-07/msg00130.html
+ if (__capacity > __old_capacity && __capacity < 2 * __old_capacity)
+ __capacity = 2 * __old_capacity;
+
+ // NB: Need an array of char_type[__capacity], plus a terminating
+ // null char_type() element, plus enough for the _Rep data structure.
+ // Whew. Seemingly so needy, yet so elemental.
+ size_type __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep);
+
+ const size_type __adj_size = __size + __malloc_header_size;
+ if (__adj_size > __pagesize && __capacity > __old_capacity)
+ {
+ const size_type __extra = __pagesize - __adj_size % __pagesize;
+ __capacity += __extra / sizeof(_CharT);
+ // Never allocate a string bigger than _S_max_size.
+ if (__capacity > _S_max_size)
+ __capacity = _S_max_size;
+ __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep);
+ }
+
+ // NB: Might throw, but no worries about a leak, mate: _Rep()
+ // does not throw.
+ void* __place = _Raw_bytes_alloc(__alloc).allocate(__size);
+ _Rep *__p = new (__place) _Rep;
+ __p->_M_capacity = __capacity;
+ // ABI compatibility - 3.4.x set in _S_create both
+ // _M_refcount and _M_length. All callers of _S_create
+ // in basic_string.tcc then set just _M_length.
+ // In 4.0.x and later both _M_refcount and _M_length
+ // are initialized in the callers, unfortunately we can
+ // have 3.4.x compiled code with _S_create callers inlined
+ // calling 4.0.x+ _S_create.
+ __p->_M_set_sharable();
+ return __p;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ _CharT*
+ basic_string<_CharT, _Traits, _Alloc>::_Rep::
+ _M_clone(const _Alloc& __alloc, size_type __res)
+ {
+ // Requested capacity of the clone.
+ const size_type __requested_cap = this->_M_length + __res;
+ _Rep* __r = _Rep::_S_create(__requested_cap, this->_M_capacity,
+ __alloc);
+ if (this->_M_length)
+ _M_copy(__r->_M_refdata(), _M_refdata(), this->_M_length);
+
+ __r->_M_set_length_and_sharable(this->_M_length);
+ return __r->_M_refdata();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ basic_string<_CharT, _Traits, _Alloc>::
+ resize(size_type __n, _CharT __c)
+ {
+ const size_type __size = this->size();
+ _M_check_length(__size, __n, "basic_string::resize");
+ if (__size < __n)
+ this->append(__n - __size, __c);
+ else if (__n < __size)
+ this->erase(__n);
+ // else nothing (in particular, avoid calling _M_mutate() unnecessarily.)
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InputIterator>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
+ _InputIterator __k2, __false_type)
+ {
+ const basic_string __s(__k1, __k2);
+ const size_type __n1 = __i2 - __i1;
+ _M_check_length(__n1, __s.size(), "basic_string::_M_replace_dispatch");
+ return _M_replace_safe(__i1 - _M_ibegin(), __n1, __s._M_data(),
+ __s.size());
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
+ _CharT __c)
+ {
+ _M_check_length(__n1, __n2, "basic_string::_M_replace_aux");
+ _M_mutate(__pos1, __n1, __n2);
+ if (__n2)
+ _M_assign(_M_data() + __pos1, __n2, __c);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ _M_replace_safe(size_type __pos1, size_type __n1, const _CharT* __s,
+ size_type __n2)
+ {
+ _M_mutate(__pos1, __n1, __n2);
+ if (__n2)
+ _M_copy(_M_data() + __pos1, __s, __n2);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>
+ operator+(const _CharT* __lhs,
+ const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ {
+ __glibcxx_requires_string(__lhs);
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+ typedef typename __string_type::size_type __size_type;
+ const __size_type __len = _Traits::length(__lhs);
+ __string_type __str;
+ __str.reserve(__len + __rhs.size());
+ __str.append(__lhs, __len);
+ __str.append(__rhs);
+ return __str;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>
+ operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+ {
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+ typedef typename __string_type::size_type __size_type;
+ __string_type __str;
+ const __size_type __len = __rhs.size();
+ __str.reserve(__len + 1);
+ __str.append(__size_type(1), __lhs);
+ __str.append(__rhs);
+ return __str;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ copy(_CharT* __s, size_type __n, size_type __pos) const
+ {
+ _M_check(__pos, "basic_string::copy");
+ __n = _M_limit(__pos, __n);
+ __glibcxx_requires_string_len(__s, __n);
+ if (__n)
+ _M_copy(__s, _M_data() + __pos, __n);
+ // 21.3.5.7 par 3: do not append null. (good.)
+ return __n;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ const size_type __size = this->size();
+ const _CharT* __data = _M_data();
+
+ if (__n == 0)
+ return __pos <= __size ? __pos : npos;
+
+ if (__n <= __size)
+ {
+ for (; __pos <= __size - __n; ++__pos)
+ if (traits_type::eq(__data[__pos], __s[0])
+ && traits_type::compare(__data + __pos + 1,
+ __s + 1, __n - 1) == 0)
+ return __pos;
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find(_CharT __c, size_type __pos) const
+ {
+ size_type __ret = npos;
+ const size_type __size = this->size();
+ if (__pos < __size)
+ {
+ const _CharT* __data = _M_data();
+ const size_type __n = __size - __pos;
+ const _CharT* __p = traits_type::find(__data + __pos, __n, __c);
+ if (__p)
+ __ret = __p - __data;
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ rfind(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ const size_type __size = this->size();
+ if (__n <= __size)
+ {
+ __pos = std::min(size_type(__size - __n), __pos);
+ const _CharT* __data = _M_data();
+ do
+ {
+ if (traits_type::compare(__data + __pos, __s, __n) == 0)
+ return __pos;
+ }
+ while (__pos-- > 0);
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ rfind(_CharT __c, size_type __pos) const
+ {
+ size_type __size = this->size();
+ if (__size)
+ {
+ if (--__size > __pos)
+ __size = __pos;
+ for (++__size; __size-- > 0; )
+ if (traits_type::eq(_M_data()[__size], __c))
+ return __size;
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ for (; __n && __pos < this->size(); ++__pos)
+ {
+ const _CharT* __p = traits_type::find(__s, __n, _M_data()[__pos]);
+ if (__p)
+ return __pos;
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ size_type __size = this->size();
+ if (__size && __n)
+ {
+ if (--__size > __pos)
+ __size = __pos;
+ do
+ {
+ if (traits_type::find(__s, __n, _M_data()[__size]))
+ return __size;
+ }
+ while (__size-- != 0);
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ for (; __pos < this->size(); ++__pos)
+ if (!traits_type::find(__s, __n, _M_data()[__pos]))
+ return __pos;
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find_first_not_of(_CharT __c, size_type __pos) const
+ {
+ for (; __pos < this->size(); ++__pos)
+ if (!traits_type::eq(_M_data()[__pos], __c))
+ return __pos;
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ size_type __size = this->size();
+ if (__size)
+ {
+ if (--__size > __pos)
+ __size = __pos;
+ do
+ {
+ if (!traits_type::find(__s, __n, _M_data()[__size]))
+ return __size;
+ }
+ while (__size--);
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
+ basic_string<_CharT, _Traits, _Alloc>::
+ find_last_not_of(_CharT __c, size_type __pos) const
+ {
+ size_type __size = this->size();
+ if (__size)
+ {
+ if (--__size > __pos)
+ __size = __pos;
+ do
+ {
+ if (!traits_type::eq(_M_data()[__size], __c))
+ return __size;
+ }
+ while (__size--);
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ int
+ basic_string<_CharT, _Traits, _Alloc>::
+ compare(size_type __pos, size_type __n, const basic_string& __str) const
+ {
+ _M_check(__pos, "basic_string::compare");
+ __n = _M_limit(__pos, __n);
+ const size_type __osize = __str.size();
+ const size_type __len = std::min(__n, __osize);
+ int __r = traits_type::compare(_M_data() + __pos, __str.data(), __len);
+ if (!__r)
+ __r = _S_compare(__n, __osize);
+ return __r;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ int
+ basic_string<_CharT, _Traits, _Alloc>::
+ compare(size_type __pos1, size_type __n1, const basic_string& __str,
+ size_type __pos2, size_type __n2) const
+ {
+ _M_check(__pos1, "basic_string::compare");
+ __str._M_check(__pos2, "basic_string::compare");
+ __n1 = _M_limit(__pos1, __n1);
+ __n2 = __str._M_limit(__pos2, __n2);
+ const size_type __len = std::min(__n1, __n2);
+ int __r = traits_type::compare(_M_data() + __pos1,
+ __str.data() + __pos2, __len);
+ if (!__r)
+ __r = _S_compare(__n1, __n2);
+ return __r;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ int
+ basic_string<_CharT, _Traits, _Alloc>::
+ compare(const _CharT* __s) const
+ {
+ __glibcxx_requires_string(__s);
+ const size_type __size = this->size();
+ const size_type __osize = traits_type::length(__s);
+ const size_type __len = std::min(__size, __osize);
+ int __r = traits_type::compare(_M_data(), __s, __len);
+ if (!__r)
+ __r = _S_compare(__size, __osize);
+ return __r;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ int
+ basic_string <_CharT, _Traits, _Alloc>::
+ compare(size_type __pos, size_type __n1, const _CharT* __s) const
+ {
+ __glibcxx_requires_string(__s);
+ _M_check(__pos, "basic_string::compare");
+ __n1 = _M_limit(__pos, __n1);
+ const size_type __osize = traits_type::length(__s);
+ const size_type __len = std::min(__n1, __osize);
+ int __r = traits_type::compare(_M_data() + __pos, __s, __len);
+ if (!__r)
+ __r = _S_compare(__n1, __osize);
+ return __r;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ int
+ basic_string <_CharT, _Traits, _Alloc>::
+ compare(size_type __pos, size_type __n1, const _CharT* __s,
+ size_type __n2) const
+ {
+ __glibcxx_requires_string_len(__s, __n2);
+ _M_check(__pos, "basic_string::compare");
+ __n1 = _M_limit(__pos, __n1);
+ const size_type __len = std::min(__n1, __n2);
+ int __r = traits_type::compare(_M_data() + __pos, __s, __len);
+ if (!__r)
+ __r = _S_compare(__n1, __n2);
+ return __r;
+ }
+
+ // 21.3.7.9 basic_string::getline and operators
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __in,
+ basic_string<_CharT, _Traits, _Alloc>& __str)
+ {
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+ typedef typename __istream_type::ios_base __ios_base;
+ typedef typename __istream_type::int_type __int_type;
+ typedef typename __string_type::size_type __size_type;
+ typedef ctype<_CharT> __ctype_type;
+ typedef typename __ctype_type::ctype_base __ctype_base;
+
+ __size_type __extracted = 0;
+ typename __ios_base::iostate __err = __ios_base::goodbit;
+ typename __istream_type::sentry __cerb(__in, false);
+ if (__cerb)
+ {
+ __try
+ {
+ // Avoid reallocation for common case.
+ __str.erase();
+ _CharT __buf[128];
+ __size_type __len = 0;
+ const streamsize __w = __in.width();
+ const __size_type __n = __w > 0 ? static_cast<__size_type>(__w)
+ : __str.max_size();
+ const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
+ const __int_type __eof = _Traits::eof();
+ __int_type __c = __in.rdbuf()->sgetc();
+
+ while (__extracted < __n
+ && !_Traits::eq_int_type(__c, __eof)
+ && !__ct.is(__ctype_base::space,
+ _Traits::to_char_type(__c)))
+ {
+ if (__len == sizeof(__buf) / sizeof(_CharT))
+ {
+ __str.append(__buf, sizeof(__buf) / sizeof(_CharT));
+ __len = 0;
+ }
+ __buf[__len++] = _Traits::to_char_type(__c);
+ ++__extracted;
+ __c = __in.rdbuf()->snextc();
+ }
+ __str.append(__buf, __len);
+
+ if (_Traits::eq_int_type(__c, __eof))
+ __err |= __ios_base::eofbit;
+ __in.width(0);
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(__ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 91. Description of operator>> and getline() for string<>
+ // might cause endless loop
+ __in._M_setstate(__ios_base::badbit);
+ }
+ }
+ // 211. operator>>(istream&, string&) doesn't set failbit
+ if (!__extracted)
+ __err |= __ios_base::failbit;
+ if (__err)
+ __in.setstate(__err);
+ return __in;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_istream<_CharT, _Traits>&
+ getline(basic_istream<_CharT, _Traits>& __in,
+ basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim)
+ {
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+ typedef typename __istream_type::ios_base __ios_base;
+ typedef typename __istream_type::int_type __int_type;
+ typedef typename __string_type::size_type __size_type;
+
+ __size_type __extracted = 0;
+ const __size_type __n = __str.max_size();
+ typename __ios_base::iostate __err = __ios_base::goodbit;
+ typename __istream_type::sentry __cerb(__in, true);
+ if (__cerb)
+ {
+ __try
+ {
+ __str.erase();
+ const __int_type __idelim = _Traits::to_int_type(__delim);
+ const __int_type __eof = _Traits::eof();
+ __int_type __c = __in.rdbuf()->sgetc();
+
+ while (__extracted < __n
+ && !_Traits::eq_int_type(__c, __eof)
+ && !_Traits::eq_int_type(__c, __idelim))
+ {
+ __str += _Traits::to_char_type(__c);
+ ++__extracted;
+ __c = __in.rdbuf()->snextc();
+ }
+
+ if (_Traits::eq_int_type(__c, __eof))
+ __err |= __ios_base::eofbit;
+ else if (_Traits::eq_int_type(__c, __idelim))
+ {
+ ++__extracted;
+ __in.rdbuf()->sbumpc();
+ }
+ else
+ __err |= __ios_base::failbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(__ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 91. Description of operator>> and getline() for string<>
+ // might cause endless loop
+ __in._M_setstate(__ios_base::badbit);
+ }
+ }
+ if (!__extracted)
+ __err |= __ios_base::failbit;
+ if (__err)
+ __in.setstate(__err);
+ return __in;
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE > 0
+ extern template class basic_string<char>;
+ extern template
+ basic_istream<char>&
+ operator>>(basic_istream<char>&, string&);
+ extern template
+ basic_ostream<char>&
+ operator<<(basic_ostream<char>&, const string&);
+ extern template
+ basic_istream<char>&
+ getline(basic_istream<char>&, string&, char);
+ extern template
+ basic_istream<char>&
+ getline(basic_istream<char>&, string&);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class basic_string<wchar_t>;
+ extern template
+ basic_istream<wchar_t>&
+ operator>>(basic_istream<wchar_t>&, wstring&);
+ extern template
+ basic_ostream<wchar_t>&
+ operator<<(basic_ostream<wchar_t>&, const wstring&);
+ extern template
+ basic_istream<wchar_t>&
+ getline(basic_istream<wchar_t>&, wstring&, wchar_t);
+ extern template
+ basic_istream<wchar_t>&
+ getline(basic_istream<wchar_t>&, wstring&);
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/boost_concept_check.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/boost_concept_check.h
new file mode 100644
index 0000000..054fcf2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/boost_concept_check.h
@@ -0,0 +1,787 @@
+// -*- C++ -*-
+
+// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// (C) Copyright Jeremy Siek 2000. Permission to copy, use, modify,
+// sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+//
+
+/** @file boost_concept_check.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// GCC Note: based on version 1.12.0 of the Boost library.
+
+#ifndef _BOOST_CONCEPT_CHECK_H
+#define _BOOST_CONCEPT_CHECK_H 1
+
+#pragma GCC system_header
+
+#include <cstddef> // for ptrdiff_t, used next
+#include <bits/stl_iterator_base_types.h> // for traits and tags
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+#define _IsUnused __attribute__ ((__unused__))
+
+// When the C-C code is in use, we would like this function to do as little
+// as possible at runtime, use as few resources as possible, and hopefully
+// be elided out of existence... hmmm.
+template <class _Concept>
+inline void __function_requires()
+{
+ void (_Concept::*__x)() _IsUnused = &_Concept::__constraints;
+}
+
+// No definition: if this is referenced, there's a problem with
+// the instantiating type not being one of the required integer types.
+// Unfortunately, this results in a link-time error, not a compile-time error.
+void __error_type_must_be_an_integer_type();
+void __error_type_must_be_an_unsigned_integer_type();
+void __error_type_must_be_a_signed_integer_type();
+
+// ??? Should the "concept_checking*" structs begin with more than _ ?
+#define _GLIBCXX_CLASS_REQUIRES(_type_var, _ns, _concept) \
+ typedef void (_ns::_concept <_type_var>::* _func##_type_var##_concept)(); \
+ template <_func##_type_var##_concept _Tp1> \
+ struct _concept_checking##_type_var##_concept { }; \
+ typedef _concept_checking##_type_var##_concept< \
+ &_ns::_concept <_type_var>::__constraints> \
+ _concept_checking_typedef##_type_var##_concept
+
+#define _GLIBCXX_CLASS_REQUIRES2(_type_var1, _type_var2, _ns, _concept) \
+ typedef void (_ns::_concept <_type_var1,_type_var2>::* _func##_type_var1##_type_var2##_concept)(); \
+ template <_func##_type_var1##_type_var2##_concept _Tp1> \
+ struct _concept_checking##_type_var1##_type_var2##_concept { }; \
+ typedef _concept_checking##_type_var1##_type_var2##_concept< \
+ &_ns::_concept <_type_var1,_type_var2>::__constraints> \
+ _concept_checking_typedef##_type_var1##_type_var2##_concept
+
+#define _GLIBCXX_CLASS_REQUIRES3(_type_var1, _type_var2, _type_var3, _ns, _concept) \
+ typedef void (_ns::_concept <_type_var1,_type_var2,_type_var3>::* _func##_type_var1##_type_var2##_type_var3##_concept)(); \
+ template <_func##_type_var1##_type_var2##_type_var3##_concept _Tp1> \
+ struct _concept_checking##_type_var1##_type_var2##_type_var3##_concept { }; \
+ typedef _concept_checking##_type_var1##_type_var2##_type_var3##_concept< \
+ &_ns::_concept <_type_var1,_type_var2,_type_var3>::__constraints> \
+ _concept_checking_typedef##_type_var1##_type_var2##_type_var3##_concept
+
+#define _GLIBCXX_CLASS_REQUIRES4(_type_var1, _type_var2, _type_var3, _type_var4, _ns, _concept) \
+ typedef void (_ns::_concept <_type_var1,_type_var2,_type_var3,_type_var4>::* _func##_type_var1##_type_var2##_type_var3##_type_var4##_concept)(); \
+ template <_func##_type_var1##_type_var2##_type_var3##_type_var4##_concept _Tp1> \
+ struct _concept_checking##_type_var1##_type_var2##_type_var3##_type_var4##_concept { }; \
+ typedef _concept_checking##_type_var1##_type_var2##_type_var3##_type_var4##_concept< \
+ &_ns::_concept <_type_var1,_type_var2,_type_var3,_type_var4>::__constraints> \
+ _concept_checking_typedef##_type_var1##_type_var2##_type_var3##_type_var4##_concept
+
+
+template <class _Tp1, class _Tp2>
+struct _Aux_require_same { };
+
+template <class _Tp>
+struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
+
+ template <class _Tp1, class _Tp2>
+ struct _SameTypeConcept
+ {
+ void __constraints() {
+ typedef typename _Aux_require_same<_Tp1, _Tp2>::_Type _Required;
+ }
+ };
+
+ template <class _Tp>
+ struct _IntegerConcept {
+ void __constraints() {
+ __error_type_must_be_an_integer_type();
+ }
+ };
+ template <> struct _IntegerConcept<short> { void __constraints() {} };
+ template <> struct _IntegerConcept<unsigned short> { void __constraints(){} };
+ template <> struct _IntegerConcept<int> { void __constraints() {} };
+ template <> struct _IntegerConcept<unsigned int> { void __constraints() {} };
+ template <> struct _IntegerConcept<long> { void __constraints() {} };
+ template <> struct _IntegerConcept<unsigned long> { void __constraints() {} };
+ template <> struct _IntegerConcept<long long> { void __constraints() {} };
+ template <> struct _IntegerConcept<unsigned long long>
+ { void __constraints() {} };
+
+ template <class _Tp>
+ struct _SignedIntegerConcept {
+ void __constraints() {
+ __error_type_must_be_a_signed_integer_type();
+ }
+ };
+ template <> struct _SignedIntegerConcept<short> { void __constraints() {} };
+ template <> struct _SignedIntegerConcept<int> { void __constraints() {} };
+ template <> struct _SignedIntegerConcept<long> { void __constraints() {} };
+ template <> struct _SignedIntegerConcept<long long> { void __constraints(){}};
+
+ template <class _Tp>
+ struct _UnsignedIntegerConcept {
+ void __constraints() {
+ __error_type_must_be_an_unsigned_integer_type();
+ }
+ };
+ template <> struct _UnsignedIntegerConcept<unsigned short>
+ { void __constraints() {} };
+ template <> struct _UnsignedIntegerConcept<unsigned int>
+ { void __constraints() {} };
+ template <> struct _UnsignedIntegerConcept<unsigned long>
+ { void __constraints() {} };
+ template <> struct _UnsignedIntegerConcept<unsigned long long>
+ { void __constraints() {} };
+
+ //===========================================================================
+ // Basic Concepts
+
+ template <class _Tp>
+ struct _DefaultConstructibleConcept
+ {
+ void __constraints() {
+ _Tp __a _IsUnused; // require default constructor
+ }
+ };
+
+ template <class _Tp>
+ struct _AssignableConcept
+ {
+ void __constraints() {
+ __a = __a; // require assignment operator
+ __const_constraints(__a);
+ }
+ void __const_constraints(const _Tp& __b) {
+ __a = __b; // const required for argument to assignment
+ }
+ _Tp __a;
+ // possibly should be "Tp* a;" and then dereference "a" in constraint
+ // functions? present way would require a default ctor, i think...
+ };
+
+ template <class _Tp>
+ struct _CopyConstructibleConcept
+ {
+ void __constraints() {
+ _Tp __a(__b); // require copy constructor
+ _Tp* __ptr _IsUnused = &__a; // require address of operator
+ __const_constraints(__a);
+ }
+ void __const_constraints(const _Tp& __a) {
+ _Tp __c _IsUnused(__a); // require const copy constructor
+ const _Tp* __ptr _IsUnused = &__a; // require const address of operator
+ }
+ _Tp __b;
+ };
+
+ // The SGI STL version of Assignable requires copy constructor and operator=
+ template <class _Tp>
+ struct _SGIAssignableConcept
+ {
+ void __constraints() {
+ _Tp __b _IsUnused(__a);
+ __a = __a; // require assignment operator
+ __const_constraints(__a);
+ }
+ void __const_constraints(const _Tp& __b) {
+ _Tp __c _IsUnused(__b);
+ __a = __b; // const required for argument to assignment
+ }
+ _Tp __a;
+ };
+
+ template <class _From, class _To>
+ struct _ConvertibleConcept
+ {
+ void __constraints() {
+ _To __y _IsUnused = __x;
+ }
+ _From __x;
+ };
+
+ // The C++ standard requirements for many concepts talk about return
+ // types that must be "convertible to bool". The problem with this
+ // requirement is that it leaves the door open for evil proxies that
+ // define things like operator|| with strange return types. Two
+ // possible solutions are:
+ // 1) require the return type to be exactly bool
+ // 2) stay with convertible to bool, and also
+ // specify stuff about all the logical operators.
+ // For now we just test for convertible to bool.
+ template <class _Tp>
+ void __aux_require_boolean_expr(const _Tp& __t) {
+ bool __x _IsUnused = __t;
+ }
+
+// FIXME
+ template <class _Tp>
+ struct _EqualityComparableConcept
+ {
+ void __constraints() {
+ __aux_require_boolean_expr(__a == __b);
+ }
+ _Tp __a, __b;
+ };
+
+ template <class _Tp>
+ struct _LessThanComparableConcept
+ {
+ void __constraints() {
+ __aux_require_boolean_expr(__a < __b);
+ }
+ _Tp __a, __b;
+ };
+
+ // This is equivalent to SGI STL's LessThanComparable.
+ template <class _Tp>
+ struct _ComparableConcept
+ {
+ void __constraints() {
+ __aux_require_boolean_expr(__a < __b);
+ __aux_require_boolean_expr(__a > __b);
+ __aux_require_boolean_expr(__a <= __b);
+ __aux_require_boolean_expr(__a >= __b);
+ }
+ _Tp __a, __b;
+ };
+
+#define _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(_OP,_NAME) \
+ template <class _First, class _Second> \
+ struct _NAME { \
+ void __constraints() { (void)__constraints_(); } \
+ bool __constraints_() { \
+ return __a _OP __b; \
+ } \
+ _First __a; \
+ _Second __b; \
+ }
+
+#define _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(_OP,_NAME) \
+ template <class _Ret, class _First, class _Second> \
+ struct _NAME { \
+ void __constraints() { (void)__constraints_(); } \
+ _Ret __constraints_() { \
+ return __a _OP __b; \
+ } \
+ _First __a; \
+ _Second __b; \
+ }
+
+ _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(==, _EqualOpConcept);
+ _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(!=, _NotEqualOpConcept);
+ _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(<, _LessThanOpConcept);
+ _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(<=, _LessEqualOpConcept);
+ _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(>, _GreaterThanOpConcept);
+ _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(>=, _GreaterEqualOpConcept);
+
+ _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(+, _PlusOpConcept);
+ _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(*, _TimesOpConcept);
+ _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(/, _DivideOpConcept);
+ _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(-, _SubtractOpConcept);
+ _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(%, _ModOpConcept);
+
+#undef _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT
+#undef _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT
+
+ //===========================================================================
+ // Function Object Concepts
+
+ template <class _Func, class _Return>
+ struct _GeneratorConcept
+ {
+ void __constraints() {
+ const _Return& __r _IsUnused = __f();// require operator() member function
+ }
+ _Func __f;
+ };
+
+
+ template <class _Func>
+ struct _GeneratorConcept<_Func,void>
+ {
+ void __constraints() {
+ __f(); // require operator() member function
+ }
+ _Func __f;
+ };
+
+ template <class _Func, class _Return, class _Arg>
+ struct _UnaryFunctionConcept
+ {
+ void __constraints() {
+ __r = __f(__arg); // require operator()
+ }
+ _Func __f;
+ _Arg __arg;
+ _Return __r;
+ };
+
+ template <class _Func, class _Arg>
+ struct _UnaryFunctionConcept<_Func, void, _Arg> {
+ void __constraints() {
+ __f(__arg); // require operator()
+ }
+ _Func __f;
+ _Arg __arg;
+ };
+
+ template <class _Func, class _Return, class _First, class _Second>
+ struct _BinaryFunctionConcept
+ {
+ void __constraints() {
+ __r = __f(__first, __second); // require operator()
+ }
+ _Func __f;
+ _First __first;
+ _Second __second;
+ _Return __r;
+ };
+
+ template <class _Func, class _First, class _Second>
+ struct _BinaryFunctionConcept<_Func, void, _First, _Second>
+ {
+ void __constraints() {
+ __f(__first, __second); // require operator()
+ }
+ _Func __f;
+ _First __first;
+ _Second __second;
+ };
+
+ template <class _Func, class _Arg>
+ struct _UnaryPredicateConcept
+ {
+ void __constraints() {
+ __aux_require_boolean_expr(__f(__arg)); // require op() returning bool
+ }
+ _Func __f;
+ _Arg __arg;
+ };
+
+ template <class _Func, class _First, class _Second>
+ struct _BinaryPredicateConcept
+ {
+ void __constraints() {
+ __aux_require_boolean_expr(__f(__a, __b)); // require op() returning bool
+ }
+ _Func __f;
+ _First __a;
+ _Second __b;
+ };
+
+ // use this when functor is used inside a container class like std::set
+ template <class _Func, class _First, class _Second>
+ struct _Const_BinaryPredicateConcept {
+ void __constraints() {
+ __const_constraints(__f);
+ }
+ void __const_constraints(const _Func& __fun) {
+ __function_requires<_BinaryPredicateConcept<_Func, _First, _Second> >();
+ // operator() must be a const member function
+ __aux_require_boolean_expr(__fun(__a, __b));
+ }
+ _Func __f;
+ _First __a;
+ _Second __b;
+ };
+
+ //===========================================================================
+ // Iterator Concepts
+
+ template <class _Tp>
+ struct _TrivialIteratorConcept
+ {
+ void __constraints() {
+// __function_requires< _DefaultConstructibleConcept<_Tp> >();
+ __function_requires< _AssignableConcept<_Tp> >();
+ __function_requires< _EqualityComparableConcept<_Tp> >();
+// typedef typename std::iterator_traits<_Tp>::value_type _V;
+ (void)*__i; // require dereference operator
+ }
+ _Tp __i;
+ };
+
+ template <class _Tp>
+ struct _Mutable_TrivialIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _TrivialIteratorConcept<_Tp> >();
+ *__i = *__j; // require dereference and assignment
+ }
+ _Tp __i, __j;
+ };
+
+ template <class _Tp>
+ struct _InputIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _TrivialIteratorConcept<_Tp> >();
+ // require iterator_traits typedef's
+ typedef typename std::iterator_traits<_Tp>::difference_type _Diff;
+// __function_requires< _SignedIntegerConcept<_Diff> >();
+ typedef typename std::iterator_traits<_Tp>::reference _Ref;
+ typedef typename std::iterator_traits<_Tp>::pointer _Pt;
+ typedef typename std::iterator_traits<_Tp>::iterator_category _Cat;
+ __function_requires< _ConvertibleConcept<
+ typename std::iterator_traits<_Tp>::iterator_category,
+ std::input_iterator_tag> >();
+ ++__i; // require preincrement operator
+ __i++; // require postincrement operator
+ }
+ _Tp __i;
+ };
+
+ template <class _Tp, class _ValueT>
+ struct _OutputIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _AssignableConcept<_Tp> >();
+ ++__i; // require preincrement operator
+ __i++; // require postincrement operator
+ *__i++ = __t; // require postincrement and assignment
+ }
+ _Tp __i;
+ _ValueT __t;
+ };
+
+ template <class _Tp>
+ struct _ForwardIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _InputIteratorConcept<_Tp> >();
+ __function_requires< _DefaultConstructibleConcept<_Tp> >();
+ __function_requires< _ConvertibleConcept<
+ typename std::iterator_traits<_Tp>::iterator_category,
+ std::forward_iterator_tag> >();
+ typedef typename std::iterator_traits<_Tp>::reference _Ref;
+ _Ref __r _IsUnused = *__i;
+ }
+ _Tp __i;
+ };
+
+ template <class _Tp>
+ struct _Mutable_ForwardIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _ForwardIteratorConcept<_Tp> >();
+ *__i++ = *__i; // require postincrement and assignment
+ }
+ _Tp __i;
+ };
+
+ template <class _Tp>
+ struct _BidirectionalIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _ForwardIteratorConcept<_Tp> >();
+ __function_requires< _ConvertibleConcept<
+ typename std::iterator_traits<_Tp>::iterator_category,
+ std::bidirectional_iterator_tag> >();
+ --__i; // require predecrement operator
+ __i--; // require postdecrement operator
+ }
+ _Tp __i;
+ };
+
+ template <class _Tp>
+ struct _Mutable_BidirectionalIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _BidirectionalIteratorConcept<_Tp> >();
+ __function_requires< _Mutable_ForwardIteratorConcept<_Tp> >();
+ *__i-- = *__i; // require postdecrement and assignment
+ }
+ _Tp __i;
+ };
+
+
+ template <class _Tp>
+ struct _RandomAccessIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _BidirectionalIteratorConcept<_Tp> >();
+ __function_requires< _ComparableConcept<_Tp> >();
+ __function_requires< _ConvertibleConcept<
+ typename std::iterator_traits<_Tp>::iterator_category,
+ std::random_access_iterator_tag> >();
+ // ??? We don't use _Ref, are we just checking for "referenceability"?
+ typedef typename std::iterator_traits<_Tp>::reference _Ref;
+
+ __i += __n; // require assignment addition operator
+ __i = __i + __n; __i = __n + __i; // require addition with difference type
+ __i -= __n; // require assignment subtraction op
+ __i = __i - __n; // require subtraction with
+ // difference type
+ __n = __i - __j; // require difference operator
+ (void)__i[__n]; // require element access operator
+ }
+ _Tp __a, __b;
+ _Tp __i, __j;
+ typename std::iterator_traits<_Tp>::difference_type __n;
+ };
+
+ template <class _Tp>
+ struct _Mutable_RandomAccessIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _RandomAccessIteratorConcept<_Tp> >();
+ __function_requires< _Mutable_BidirectionalIteratorConcept<_Tp> >();
+ __i[__n] = *__i; // require element access and assignment
+ }
+ _Tp __i;
+ typename std::iterator_traits<_Tp>::difference_type __n;
+ };
+
+ //===========================================================================
+ // Container Concepts
+
+ template <class _Container>
+ struct _ContainerConcept
+ {
+ typedef typename _Container::value_type _Value_type;
+ typedef typename _Container::difference_type _Difference_type;
+ typedef typename _Container::size_type _Size_type;
+ typedef typename _Container::const_reference _Const_reference;
+ typedef typename _Container::const_pointer _Const_pointer;
+ typedef typename _Container::const_iterator _Const_iterator;
+
+ void __constraints() {
+ __function_requires< _InputIteratorConcept<_Const_iterator> >();
+ __function_requires< _AssignableConcept<_Container> >();
+ const _Container __c;
+ __i = __c.begin();
+ __i = __c.end();
+ __n = __c.size();
+ __n = __c.max_size();
+ __b = __c.empty();
+ }
+ bool __b;
+ _Const_iterator __i;
+ _Size_type __n;
+ };
+
+ template <class _Container>
+ struct _Mutable_ContainerConcept
+ {
+ typedef typename _Container::value_type _Value_type;
+ typedef typename _Container::reference _Reference;
+ typedef typename _Container::iterator _Iterator;
+ typedef typename _Container::pointer _Pointer;
+
+ void __constraints() {
+ __function_requires< _ContainerConcept<_Container> >();
+ __function_requires< _AssignableConcept<_Value_type> >();
+ __function_requires< _InputIteratorConcept<_Iterator> >();
+
+ __i = __c.begin();
+ __i = __c.end();
+ __c.swap(__c2);
+ }
+ _Iterator __i;
+ _Container __c, __c2;
+ };
+
+ template <class _ForwardContainer>
+ struct _ForwardContainerConcept
+ {
+ void __constraints() {
+ __function_requires< _ContainerConcept<_ForwardContainer> >();
+ typedef typename _ForwardContainer::const_iterator _Const_iterator;
+ __function_requires< _ForwardIteratorConcept<_Const_iterator> >();
+ }
+ };
+
+ template <class _ForwardContainer>
+ struct _Mutable_ForwardContainerConcept
+ {
+ void __constraints() {
+ __function_requires< _ForwardContainerConcept<_ForwardContainer> >();
+ __function_requires< _Mutable_ContainerConcept<_ForwardContainer> >();
+ typedef typename _ForwardContainer::iterator _Iterator;
+ __function_requires< _Mutable_ForwardIteratorConcept<_Iterator> >();
+ }
+ };
+
+ template <class _ReversibleContainer>
+ struct _ReversibleContainerConcept
+ {
+ typedef typename _ReversibleContainer::const_iterator _Const_iterator;
+ typedef typename _ReversibleContainer::const_reverse_iterator
+ _Const_reverse_iterator;
+
+ void __constraints() {
+ __function_requires< _ForwardContainerConcept<_ReversibleContainer> >();
+ __function_requires< _BidirectionalIteratorConcept<_Const_iterator> >();
+ __function_requires<
+ _BidirectionalIteratorConcept<_Const_reverse_iterator> >();
+
+ const _ReversibleContainer __c;
+ _Const_reverse_iterator __i = __c.rbegin();
+ __i = __c.rend();
+ }
+ };
+
+ template <class _ReversibleContainer>
+ struct _Mutable_ReversibleContainerConcept
+ {
+ typedef typename _ReversibleContainer::iterator _Iterator;
+ typedef typename _ReversibleContainer::reverse_iterator _Reverse_iterator;
+
+ void __constraints() {
+ __function_requires<_ReversibleContainerConcept<_ReversibleContainer> >();
+ __function_requires<
+ _Mutable_ForwardContainerConcept<_ReversibleContainer> >();
+ __function_requires<_Mutable_BidirectionalIteratorConcept<_Iterator> >();
+ __function_requires<
+ _Mutable_BidirectionalIteratorConcept<_Reverse_iterator> >();
+
+ _Reverse_iterator __i = __c.rbegin();
+ __i = __c.rend();
+ }
+ _ReversibleContainer __c;
+ };
+
+ template <class _RandomAccessContainer>
+ struct _RandomAccessContainerConcept
+ {
+ typedef typename _RandomAccessContainer::size_type _Size_type;
+ typedef typename _RandomAccessContainer::const_reference _Const_reference;
+ typedef typename _RandomAccessContainer::const_iterator _Const_iterator;
+ typedef typename _RandomAccessContainer::const_reverse_iterator
+ _Const_reverse_iterator;
+
+ void __constraints() {
+ __function_requires<
+ _ReversibleContainerConcept<_RandomAccessContainer> >();
+ __function_requires< _RandomAccessIteratorConcept<_Const_iterator> >();
+ __function_requires<
+ _RandomAccessIteratorConcept<_Const_reverse_iterator> >();
+
+ const _RandomAccessContainer __c;
+ _Const_reference __r _IsUnused = __c[__n];
+ }
+ _Size_type __n;
+ };
+
+ template <class _RandomAccessContainer>
+ struct _Mutable_RandomAccessContainerConcept
+ {
+ typedef typename _RandomAccessContainer::size_type _Size_type;
+ typedef typename _RandomAccessContainer::reference _Reference;
+ typedef typename _RandomAccessContainer::iterator _Iterator;
+ typedef typename _RandomAccessContainer::reverse_iterator _Reverse_iterator;
+
+ void __constraints() {
+ __function_requires<
+ _RandomAccessContainerConcept<_RandomAccessContainer> >();
+ __function_requires<
+ _Mutable_ReversibleContainerConcept<_RandomAccessContainer> >();
+ __function_requires< _Mutable_RandomAccessIteratorConcept<_Iterator> >();
+ __function_requires<
+ _Mutable_RandomAccessIteratorConcept<_Reverse_iterator> >();
+
+ _Reference __r _IsUnused = __c[__i];
+ }
+ _Size_type __i;
+ _RandomAccessContainer __c;
+ };
+
+ // A Sequence is inherently mutable
+ template <class _Sequence>
+ struct _SequenceConcept
+ {
+ typedef typename _Sequence::reference _Reference;
+ typedef typename _Sequence::const_reference _Const_reference;
+
+ void __constraints() {
+ // Matt Austern's book puts DefaultConstructible here, the C++
+ // standard places it in Container
+ // function_requires< DefaultConstructible<Sequence> >();
+ __function_requires< _Mutable_ForwardContainerConcept<_Sequence> >();
+ __function_requires< _DefaultConstructibleConcept<_Sequence> >();
+
+ _Sequence
+ __c _IsUnused(__n, __t),
+ __c2 _IsUnused(__first, __last);
+
+ __c.insert(__p, __t);
+ __c.insert(__p, __n, __t);
+ __c.insert(__p, __first, __last);
+
+ __c.erase(__p);
+ __c.erase(__p, __q);
+
+ _Reference __r _IsUnused = __c.front();
+
+ __const_constraints(__c);
+ }
+ void __const_constraints(const _Sequence& __c) {
+ _Const_reference __r _IsUnused = __c.front();
+ }
+ typename _Sequence::value_type __t;
+ typename _Sequence::size_type __n;
+ typename _Sequence::value_type *__first, *__last;
+ typename _Sequence::iterator __p, __q;
+ };
+
+ template <class _FrontInsertionSequence>
+ struct _FrontInsertionSequenceConcept
+ {
+ void __constraints() {
+ __function_requires< _SequenceConcept<_FrontInsertionSequence> >();
+
+ __c.push_front(__t);
+ __c.pop_front();
+ }
+ _FrontInsertionSequence __c;
+ typename _FrontInsertionSequence::value_type __t;
+ };
+
+ template <class _BackInsertionSequence>
+ struct _BackInsertionSequenceConcept
+ {
+ typedef typename _BackInsertionSequence::reference _Reference;
+ typedef typename _BackInsertionSequence::const_reference _Const_reference;
+
+ void __constraints() {
+ __function_requires< _SequenceConcept<_BackInsertionSequence> >();
+
+ __c.push_back(__t);
+ __c.pop_back();
+ _Reference __r _IsUnused = __c.back();
+ }
+ void __const_constraints(const _BackInsertionSequence& __c) {
+ _Const_reference __r _IsUnused = __c.back();
+ };
+ _BackInsertionSequence __c;
+ typename _BackInsertionSequence::value_type __t;
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#undef _IsUnused
+
+#endif // _GLIBCXX_BOOST_CONCEPT_CHECK
+
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/char_traits.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/char_traits.h
new file mode 100644
index 0000000..5e52c75
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/char_traits.h
@@ -0,0 +1,575 @@
+// Character Traits for use by standard string and iostream -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file char_traits.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 21 Strings library
+//
+
+#ifndef _CHAR_TRAITS_H
+#define _CHAR_TRAITS_H 1
+
+#pragma GCC system_header
+
+#include <bits/stl_algobase.h> // std::copy, std::fill_n
+#include <bits/postypes.h> // For streampos
+#include <cwchar> // For WEOF, wmemmove, wmemset, etc.
+
+#ifndef _GLIBCXX_STDIO_MACROS
+# include <cstdio> // For EOF
+# define _CHAR_TRAITS_EOF EOF
+#else
+# define _CHAR_TRAITS_EOF (-1)
+#endif
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ /**
+ * @brief Mapping from character type to associated types.
+ *
+ * @note This is an implementation class for the generic version
+ * of char_traits. It defines int_type, off_type, pos_type, and
+ * state_type. By default these are unsigned long, streamoff,
+ * streampos, and mbstate_t. Users who need a different set of
+ * types, but who don't need to change the definitions of any function
+ * defined in char_traits, can specialize __gnu_cxx::_Char_types
+ * while leaving __gnu_cxx::char_traits alone. */
+ template<typename _CharT>
+ struct _Char_types
+ {
+ typedef unsigned long int_type;
+ typedef std::streampos pos_type;
+ typedef std::streamoff off_type;
+ typedef std::mbstate_t state_type;
+ };
+
+
+ /**
+ * @brief Base class used to implement std::char_traits.
+ *
+ * @note For any given actual character type, this definition is
+ * probably wrong. (Most of the member functions are likely to be
+ * right, but the int_type and state_type typedefs, and the eof()
+ * member function, are likely to be wrong.) The reason this class
+ * exists is so users can specialize it. Classes in namespace std
+ * may not be specialized for fundamental types, but classes in
+ * namespace __gnu_cxx may be.
+ *
+ * See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt05ch13s03.html
+ * for advice on how to make use of this class for "unusual" character
+ * types. Also, check out include/ext/pod_char_traits.h.
+ */
+ template<typename _CharT>
+ struct char_traits
+ {
+ typedef _CharT char_type;
+ typedef typename _Char_types<_CharT>::int_type int_type;
+ typedef typename _Char_types<_CharT>::pos_type pos_type;
+ typedef typename _Char_types<_CharT>::off_type off_type;
+ typedef typename _Char_types<_CharT>::state_type state_type;
+
+ static void
+ assign(char_type& __c1, const char_type& __c2)
+ { __c1 = __c2; }
+
+ static bool
+ eq(const char_type& __c1, const char_type& __c2)
+ { return __c1 == __c2; }
+
+ static bool
+ lt(const char_type& __c1, const char_type& __c2)
+ { return __c1 < __c2; }
+
+ static int
+ compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
+
+ static std::size_t
+ length(const char_type* __s);
+
+ static const char_type*
+ find(const char_type* __s, std::size_t __n, const char_type& __a);
+
+ static char_type*
+ move(char_type* __s1, const char_type* __s2, std::size_t __n);
+
+ static char_type*
+ copy(char_type* __s1, const char_type* __s2, std::size_t __n);
+
+ static char_type*
+ assign(char_type* __s, std::size_t __n, char_type __a);
+
+ static char_type
+ to_char_type(const int_type& __c)
+ { return static_cast<char_type>(__c); }
+
+ static int_type
+ to_int_type(const char_type& __c)
+ { return static_cast<int_type>(__c); }
+
+ static bool
+ eq_int_type(const int_type& __c1, const int_type& __c2)
+ { return __c1 == __c2; }
+
+ static int_type
+ eof()
+ { return static_cast<int_type>(_CHAR_TRAITS_EOF); }
+
+ static int_type
+ not_eof(const int_type& __c)
+ { return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); }
+ };
+
+ template<typename _CharT>
+ int
+ char_traits<_CharT>::
+ compare(const char_type* __s1, const char_type* __s2, std::size_t __n)
+ {
+ for (std::size_t __i = 0; __i < __n; ++__i)
+ if (lt(__s1[__i], __s2[__i]))
+ return -1;
+ else if (lt(__s2[__i], __s1[__i]))
+ return 1;
+ return 0;
+ }
+
+ template<typename _CharT>
+ std::size_t
+ char_traits<_CharT>::
+ length(const char_type* __p)
+ {
+ std::size_t __i = 0;
+ while (!eq(__p[__i], char_type()))
+ ++__i;
+ return __i;
+ }
+
+ template<typename _CharT>
+ const typename char_traits<_CharT>::char_type*
+ char_traits<_CharT>::
+ find(const char_type* __s, std::size_t __n, const char_type& __a)
+ {
+ for (std::size_t __i = 0; __i < __n; ++__i)
+ if (eq(__s[__i], __a))
+ return __s + __i;
+ return 0;
+ }
+
+ template<typename _CharT>
+ typename char_traits<_CharT>::char_type*
+ char_traits<_CharT>::
+ move(char_type* __s1, const char_type* __s2, std::size_t __n)
+ {
+ return static_cast<_CharT*>(__builtin_memmove(__s1, __s2,
+ __n * sizeof(char_type)));
+ }
+
+ template<typename _CharT>
+ typename char_traits<_CharT>::char_type*
+ char_traits<_CharT>::
+ copy(char_type* __s1, const char_type* __s2, std::size_t __n)
+ {
+ // NB: Inline std::copy so no recursive dependencies.
+ std::copy(__s2, __s2 + __n, __s1);
+ return __s1;
+ }
+
+ template<typename _CharT>
+ typename char_traits<_CharT>::char_type*
+ char_traits<_CharT>::
+ assign(char_type* __s, std::size_t __n, char_type __a)
+ {
+ // NB: Inline std::fill_n so no recursive dependencies.
+ std::fill_n(__s, __n, __a);
+ return __s;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 21.1
+ /**
+ * @brief Basis for explicit traits specializations.
+ *
+ * @note For any given actual character type, this definition is
+ * probably wrong. Since this is just a thin wrapper around
+ * __gnu_cxx::char_traits, it is possible to achieve a more
+ * appropriate definition by specializing __gnu_cxx::char_traits.
+ *
+ * See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt05ch13s03.html
+ * for advice on how to make use of this class for "unusual" character
+ * types. Also, check out include/ext/pod_char_traits.h.
+ */
+ template<class _CharT>
+ struct char_traits : public __gnu_cxx::char_traits<_CharT>
+ { };
+
+
+ /// 21.1.3.1 char_traits specializations
+ template<>
+ struct char_traits<char>
+ {
+ typedef char char_type;
+ typedef int int_type;
+ typedef streampos pos_type;
+ typedef streamoff off_type;
+ typedef mbstate_t state_type;
+
+ static void
+ assign(char_type& __c1, const char_type& __c2)
+ { __c1 = __c2; }
+
+ static bool
+ eq(const char_type& __c1, const char_type& __c2)
+ { return __c1 == __c2; }
+
+ static bool
+ lt(const char_type& __c1, const char_type& __c2)
+ { return __c1 < __c2; }
+
+ static int
+ compare(const char_type* __s1, const char_type* __s2, size_t __n)
+ { return __builtin_memcmp(__s1, __s2, __n); }
+
+ static size_t
+ length(const char_type* __s)
+ { return __builtin_strlen(__s); }
+
+ static const char_type*
+ find(const char_type* __s, size_t __n, const char_type& __a)
+ { return static_cast<const char_type*>(__builtin_memchr(__s, __a, __n)); }
+
+ static char_type*
+ move(char_type* __s1, const char_type* __s2, size_t __n)
+ { return static_cast<char_type*>(__builtin_memmove(__s1, __s2, __n)); }
+
+ static char_type*
+ copy(char_type* __s1, const char_type* __s2, size_t __n)
+ { return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n)); }
+
+ static char_type*
+ assign(char_type* __s, size_t __n, char_type __a)
+ { return static_cast<char_type*>(__builtin_memset(__s, __a, __n)); }
+
+ static char_type
+ to_char_type(const int_type& __c)
+ { return static_cast<char_type>(__c); }
+
+ // To keep both the byte 0xff and the eof symbol 0xffffffff
+ // from ending up as 0xffffffff.
+ static int_type
+ to_int_type(const char_type& __c)
+ { return static_cast<int_type>(static_cast<unsigned char>(__c)); }
+
+ static bool
+ eq_int_type(const int_type& __c1, const int_type& __c2)
+ { return __c1 == __c2; }
+
+ static int_type
+ eof()
+ { return static_cast<int_type>(_CHAR_TRAITS_EOF); }
+
+ static int_type
+ not_eof(const int_type& __c)
+ { return (__c == eof()) ? 0 : __c; }
+ };
+
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ /// 21.1.3.2 char_traits specializations
+ template<>
+ struct char_traits<wchar_t>
+ {
+ typedef wchar_t char_type;
+ typedef wint_t int_type;
+ typedef streamoff off_type;
+ typedef wstreampos pos_type;
+ typedef mbstate_t state_type;
+
+ static void
+ assign(char_type& __c1, const char_type& __c2)
+ { __c1 = __c2; }
+
+ static bool
+ eq(const char_type& __c1, const char_type& __c2)
+ { return __c1 == __c2; }
+
+ static bool
+ lt(const char_type& __c1, const char_type& __c2)
+ { return __c1 < __c2; }
+
+ static int
+ compare(const char_type* __s1, const char_type* __s2, size_t __n)
+ { return wmemcmp(__s1, __s2, __n); }
+
+ static size_t
+ length(const char_type* __s)
+ { return wcslen(__s); }
+
+ static const char_type*
+ find(const char_type* __s, size_t __n, const char_type& __a)
+ { return wmemchr(__s, __a, __n); }
+
+ static char_type*
+ move(char_type* __s1, const char_type* __s2, size_t __n)
+ { return wmemmove(__s1, __s2, __n); }
+
+ static char_type*
+ copy(char_type* __s1, const char_type* __s2, size_t __n)
+ { return wmemcpy(__s1, __s2, __n); }
+
+ static char_type*
+ assign(char_type* __s, size_t __n, char_type __a)
+ { return wmemset(__s, __a, __n); }
+
+ static char_type
+ to_char_type(const int_type& __c)
+ { return char_type(__c); }
+
+ static int_type
+ to_int_type(const char_type& __c)
+ { return int_type(__c); }
+
+ static bool
+ eq_int_type(const int_type& __c1, const int_type& __c2)
+ { return __c1 == __c2; }
+
+ static int_type
+ eof()
+ { return static_cast<int_type>(WEOF); }
+
+ static int_type
+ not_eof(const int_type& __c)
+ { return eq_int_type(__c, eof()) ? 0 : __c; }
+ };
+#endif //_GLIBCXX_USE_WCHAR_T
+
+_GLIBCXX_END_NAMESPACE
+
+#if (defined(__GXX_EXPERIMENTAL_CXX0X__) \
+ && defined(_GLIBCXX_USE_C99_STDINT_TR1))
+
+#include <cstdint>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<>
+ struct char_traits<char16_t>
+ {
+ typedef char16_t char_type;
+ typedef uint_least16_t int_type;
+ typedef streamoff off_type;
+ typedef u16streampos pos_type;
+ typedef mbstate_t state_type;
+
+ static void
+ assign(char_type& __c1, const char_type& __c2)
+ { __c1 = __c2; }
+
+ static bool
+ eq(const char_type& __c1, const char_type& __c2)
+ { return __c1 == __c2; }
+
+ static bool
+ lt(const char_type& __c1, const char_type& __c2)
+ { return __c1 < __c2; }
+
+ static int
+ compare(const char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ if (lt(__s1[__i], __s2[__i]))
+ return -1;
+ else if (lt(__s2[__i], __s1[__i]))
+ return 1;
+ return 0;
+ }
+
+ static size_t
+ length(const char_type* __s)
+ {
+ size_t __i = 0;
+ while (!eq(__s[__i], char_type()))
+ ++__i;
+ return __i;
+ }
+
+ static const char_type*
+ find(const char_type* __s, size_t __n, const char_type& __a)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ if (eq(__s[__i], __a))
+ return __s + __i;
+ return 0;
+ }
+
+ static char_type*
+ move(char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ return (static_cast<char_type*>
+ (__builtin_memmove(__s1, __s2, __n * sizeof(char_type))));
+ }
+
+ static char_type*
+ copy(char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ return (static_cast<char_type*>
+ (__builtin_memcpy(__s1, __s2, __n * sizeof(char_type))));
+ }
+
+ static char_type*
+ assign(char_type* __s, size_t __n, char_type __a)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ assign(__s[__i], __a);
+ return __s;
+ }
+
+ static char_type
+ to_char_type(const int_type& __c)
+ { return char_type(__c); }
+
+ static int_type
+ to_int_type(const char_type& __c)
+ { return int_type(__c); }
+
+ static bool
+ eq_int_type(const int_type& __c1, const int_type& __c2)
+ { return __c1 == __c2; }
+
+ static int_type
+ eof()
+ { return static_cast<int_type>(-1); }
+
+ static int_type
+ not_eof(const int_type& __c)
+ { return eq_int_type(__c, eof()) ? 0 : __c; }
+ };
+
+ template<>
+ struct char_traits<char32_t>
+ {
+ typedef char32_t char_type;
+ typedef uint_least32_t int_type;
+ typedef streamoff off_type;
+ typedef u32streampos pos_type;
+ typedef mbstate_t state_type;
+
+ static void
+ assign(char_type& __c1, const char_type& __c2)
+ { __c1 = __c2; }
+
+ static bool
+ eq(const char_type& __c1, const char_type& __c2)
+ { return __c1 == __c2; }
+
+ static bool
+ lt(const char_type& __c1, const char_type& __c2)
+ { return __c1 < __c2; }
+
+ static int
+ compare(const char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ if (lt(__s1[__i], __s2[__i]))
+ return -1;
+ else if (lt(__s2[__i], __s1[__i]))
+ return 1;
+ return 0;
+ }
+
+ static size_t
+ length(const char_type* __s)
+ {
+ size_t __i = 0;
+ while (!eq(__s[__i], char_type()))
+ ++__i;
+ return __i;
+ }
+
+ static const char_type*
+ find(const char_type* __s, size_t __n, const char_type& __a)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ if (eq(__s[__i], __a))
+ return __s + __i;
+ return 0;
+ }
+
+ static char_type*
+ move(char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ return (static_cast<char_type*>
+ (__builtin_memmove(__s1, __s2, __n * sizeof(char_type))));
+ }
+
+ static char_type*
+ copy(char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ return (static_cast<char_type*>
+ (__builtin_memcpy(__s1, __s2, __n * sizeof(char_type))));
+ }
+
+ static char_type*
+ assign(char_type* __s, size_t __n, char_type __a)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ assign(__s[__i], __a);
+ return __s;
+ }
+
+ static char_type
+ to_char_type(const int_type& __c)
+ { return char_type(__c); }
+
+ static int_type
+ to_int_type(const char_type& __c)
+ { return int_type(__c); }
+
+ static bool
+ eq_int_type(const int_type& __c1, const int_type& __c2)
+ { return __c1 == __c2; }
+
+ static int_type
+ eof()
+ { return static_cast<int_type>(-1); }
+
+ static int_type
+ not_eof(const int_type& __c)
+ { return eq_int_type(__c, eof()) ? 0 : __c; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
+#undef _CHAR_TRAITS_EOF
+
+#endif // _CHAR_TRAITS_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/cmath.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/cmath.tcc
new file mode 100644
index 0000000..9f4c853
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/cmath.tcc
@@ -0,0 +1,55 @@
+// -*- C++ -*- C math library.
+
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// This file was written by Gabriel Dos Reis <gdr@codesourcery.com>
+
+/** @file cmath.tcc
+ * This is a Standard C++ Library file.
+ */
+
+#ifndef _GLIBCXX_CMATH_TCC
+#define _GLIBCXX_CMATH_TCC 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _Tp>
+ inline _Tp
+ __cmath_power(_Tp __x, unsigned int __n)
+ {
+ _Tp __y = __n % 2 ? __x : _Tp(1);
+
+ while (__n >>= 1)
+ {
+ __x = __x * __x;
+ if (__n % 2)
+ __y = __y * __x;
+ }
+
+ return __y;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/codecvt.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/codecvt.h
new file mode 100644
index 0000000..2dbb498
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/codecvt.h
@@ -0,0 +1,497 @@
+// Locale support (codecvt) -*- C++ -*-
+
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+// 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/codecvt.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.2.1.5 Template class codecvt
+//
+
+// Written by Benjamin Kosnik <bkoz@redhat.com>
+
+#ifndef _CODECVT_H
+#define _CODECVT_H 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /// Empty base class for codecvt facet [22.2.1.5].
+ class codecvt_base
+ {
+ public:
+ enum result
+ {
+ ok,
+ partial,
+ error,
+ noconv
+ };
+ };
+
+ /**
+ * @brief Common base for codecvt functions.
+ *
+ * This template class provides implementations of the public functions
+ * that forward to the protected virtual functions.
+ *
+ * This template also provides abstract stubs for the protected virtual
+ * functions.
+ */
+ template<typename _InternT, typename _ExternT, typename _StateT>
+ class __codecvt_abstract_base
+ : public locale::facet, public codecvt_base
+ {
+ public:
+ // Types:
+ typedef codecvt_base::result result;
+ typedef _InternT intern_type;
+ typedef _ExternT extern_type;
+ typedef _StateT state_type;
+
+ // 22.2.1.5.1 codecvt members
+ /**
+ * @brief Convert from internal to external character set.
+ *
+ * Converts input string of intern_type to output string of
+ * extern_type. This is analogous to wcsrtombs. It does this by
+ * calling codecvt::do_out.
+ *
+ * The source and destination character sets are determined by the
+ * facet's locale, internal and external types.
+ *
+ * The characters in [from,from_end) are converted and written to
+ * [to,to_end). from_next and to_next are set to point to the
+ * character following the last successfully converted character,
+ * respectively. If the result needed no conversion, from_next and
+ * to_next are not affected.
+ *
+ * The @a state argument should be initialized if the input is at the
+ * beginning and carried from a previous call if continuing
+ * conversion. There are no guarantees about how @a state is used.
+ *
+ * The result returned is a member of codecvt_base::result. If
+ * all the input is converted, returns codecvt_base::ok. If no
+ * conversion is necessary, returns codecvt_base::noconv. If
+ * the input ends early or there is insufficient space in the
+ * output, returns codecvt_base::partial. Otherwise the
+ * conversion failed and codecvt_base::error is returned.
+ *
+ * @param state Persistent conversion state data.
+ * @param from Start of input.
+ * @param from_end End of input.
+ * @param from_next Returns start of unconverted data.
+ * @param to Start of output buffer.
+ * @param to_end End of output buffer.
+ * @param to_next Returns start of unused output area.
+ * @return codecvt_base::result.
+ */
+ result
+ out(state_type& __state, const intern_type* __from,
+ const intern_type* __from_end, const intern_type*& __from_next,
+ extern_type* __to, extern_type* __to_end,
+ extern_type*& __to_next) const
+ {
+ return this->do_out(__state, __from, __from_end, __from_next,
+ __to, __to_end, __to_next);
+ }
+
+ /**
+ * @brief Reset conversion state.
+ *
+ * Writes characters to output that would restore @a state to initial
+ * conditions. The idea is that if a partial conversion occurs, then
+ * the converting the characters written by this function would leave
+ * the state in initial conditions, rather than partial conversion
+ * state. It does this by calling codecvt::do_unshift().
+ *
+ * For example, if 4 external characters always converted to 1 internal
+ * character, and input to in() had 6 external characters with state
+ * saved, this function would write two characters to the output and
+ * set the state to initialized conditions.
+ *
+ * The source and destination character sets are determined by the
+ * facet's locale, internal and external types.
+ *
+ * The result returned is a member of codecvt_base::result. If the
+ * state could be reset and data written, returns codecvt_base::ok. If
+ * no conversion is necessary, returns codecvt_base::noconv. If the
+ * output has insufficient space, returns codecvt_base::partial.
+ * Otherwise the reset failed and codecvt_base::error is returned.
+ *
+ * @param state Persistent conversion state data.
+ * @param to Start of output buffer.
+ * @param to_end End of output buffer.
+ * @param to_next Returns start of unused output area.
+ * @return codecvt_base::result.
+ */
+ result
+ unshift(state_type& __state, extern_type* __to, extern_type* __to_end,
+ extern_type*& __to_next) const
+ { return this->do_unshift(__state, __to,__to_end,__to_next); }
+
+ /**
+ * @brief Convert from external to internal character set.
+ *
+ * Converts input string of extern_type to output string of
+ * intern_type. This is analogous to mbsrtowcs. It does this by
+ * calling codecvt::do_in.
+ *
+ * The source and destination character sets are determined by the
+ * facet's locale, internal and external types.
+ *
+ * The characters in [from,from_end) are converted and written to
+ * [to,to_end). from_next and to_next are set to point to the
+ * character following the last successfully converted character,
+ * respectively. If the result needed no conversion, from_next and
+ * to_next are not affected.
+ *
+ * The @a state argument should be initialized if the input is at the
+ * beginning and carried from a previous call if continuing
+ * conversion. There are no guarantees about how @a state is used.
+ *
+ * The result returned is a member of codecvt_base::result. If
+ * all the input is converted, returns codecvt_base::ok. If no
+ * conversion is necessary, returns codecvt_base::noconv. If
+ * the input ends early or there is insufficient space in the
+ * output, returns codecvt_base::partial. Otherwise the
+ * conversion failed and codecvt_base::error is returned.
+ *
+ * @param state Persistent conversion state data.
+ * @param from Start of input.
+ * @param from_end End of input.
+ * @param from_next Returns start of unconverted data.
+ * @param to Start of output buffer.
+ * @param to_end End of output buffer.
+ * @param to_next Returns start of unused output area.
+ * @return codecvt_base::result.
+ */
+ result
+ in(state_type& __state, const extern_type* __from,
+ const extern_type* __from_end, const extern_type*& __from_next,
+ intern_type* __to, intern_type* __to_end,
+ intern_type*& __to_next) const
+ {
+ return this->do_in(__state, __from, __from_end, __from_next,
+ __to, __to_end, __to_next);
+ }
+
+ int
+ encoding() const throw()
+ { return this->do_encoding(); }
+
+ bool
+ always_noconv() const throw()
+ { return this->do_always_noconv(); }
+
+ int
+ length(state_type& __state, const extern_type* __from,
+ const extern_type* __end, size_t __max) const
+ { return this->do_length(__state, __from, __end, __max); }
+
+ int
+ max_length() const throw()
+ { return this->do_max_length(); }
+
+ protected:
+ explicit
+ __codecvt_abstract_base(size_t __refs = 0) : locale::facet(__refs) { }
+
+ virtual
+ ~__codecvt_abstract_base() { }
+
+ /**
+ * @brief Convert from internal to external character set.
+ *
+ * Converts input string of intern_type to output string of
+ * extern_type. This function is a hook for derived classes to change
+ * the value returned. @see out for more information.
+ */
+ virtual result
+ do_out(state_type& __state, const intern_type* __from,
+ const intern_type* __from_end, const intern_type*& __from_next,
+ extern_type* __to, extern_type* __to_end,
+ extern_type*& __to_next) const = 0;
+
+ virtual result
+ do_unshift(state_type& __state, extern_type* __to,
+ extern_type* __to_end, extern_type*& __to_next) const = 0;
+
+ virtual result
+ do_in(state_type& __state, const extern_type* __from,
+ const extern_type* __from_end, const extern_type*& __from_next,
+ intern_type* __to, intern_type* __to_end,
+ intern_type*& __to_next) const = 0;
+
+ virtual int
+ do_encoding() const throw() = 0;
+
+ virtual bool
+ do_always_noconv() const throw() = 0;
+
+ virtual int
+ do_length(state_type&, const extern_type* __from,
+ const extern_type* __end, size_t __max) const = 0;
+
+ virtual int
+ do_max_length() const throw() = 0;
+ };
+
+ /// @brief class codecvt [22.2.1.5].
+ /// NB: Generic, mostly useless implementation.
+ template<typename _InternT, typename _ExternT, typename _StateT>
+ class codecvt
+ : public __codecvt_abstract_base<_InternT, _ExternT, _StateT>
+ {
+ public:
+ // Types:
+ typedef codecvt_base::result result;
+ typedef _InternT intern_type;
+ typedef _ExternT extern_type;
+ typedef _StateT state_type;
+
+ protected:
+ __c_locale _M_c_locale_codecvt;
+
+ public:
+ static locale::id id;
+
+ explicit
+ codecvt(size_t __refs = 0)
+ : __codecvt_abstract_base<_InternT, _ExternT, _StateT> (__refs) { }
+
+ explicit
+ codecvt(__c_locale __cloc, size_t __refs = 0);
+
+ protected:
+ virtual
+ ~codecvt() { }
+
+ virtual result
+ do_out(state_type& __state, const intern_type* __from,
+ const intern_type* __from_end, const intern_type*& __from_next,
+ extern_type* __to, extern_type* __to_end,
+ extern_type*& __to_next) const;
+
+ virtual result
+ do_unshift(state_type& __state, extern_type* __to,
+ extern_type* __to_end, extern_type*& __to_next) const;
+
+ virtual result
+ do_in(state_type& __state, const extern_type* __from,
+ const extern_type* __from_end, const extern_type*& __from_next,
+ intern_type* __to, intern_type* __to_end,
+ intern_type*& __to_next) const;
+
+ virtual int
+ do_encoding() const throw();
+
+ virtual bool
+ do_always_noconv() const throw();
+
+ virtual int
+ do_length(state_type&, const extern_type* __from,
+ const extern_type* __end, size_t __max) const;
+
+ virtual int
+ do_max_length() const throw();
+ };
+
+ template<typename _InternT, typename _ExternT, typename _StateT>
+ locale::id codecvt<_InternT, _ExternT, _StateT>::id;
+
+ /// class codecvt<char, char, mbstate_t> specialization.
+ template<>
+ class codecvt<char, char, mbstate_t>
+ : public __codecvt_abstract_base<char, char, mbstate_t>
+ {
+ public:
+ // Types:
+ typedef char intern_type;
+ typedef char extern_type;
+ typedef mbstate_t state_type;
+
+ protected:
+ __c_locale _M_c_locale_codecvt;
+
+ public:
+ static locale::id id;
+
+ explicit
+ codecvt(size_t __refs = 0);
+
+ explicit
+ codecvt(__c_locale __cloc, size_t __refs = 0);
+
+ protected:
+ virtual
+ ~codecvt();
+
+ virtual result
+ do_out(state_type& __state, const intern_type* __from,
+ const intern_type* __from_end, const intern_type*& __from_next,
+ extern_type* __to, extern_type* __to_end,
+ extern_type*& __to_next) const;
+
+ virtual result
+ do_unshift(state_type& __state, extern_type* __to,
+ extern_type* __to_end, extern_type*& __to_next) const;
+
+ virtual result
+ do_in(state_type& __state, const extern_type* __from,
+ const extern_type* __from_end, const extern_type*& __from_next,
+ intern_type* __to, intern_type* __to_end,
+ intern_type*& __to_next) const;
+
+ virtual int
+ do_encoding() const throw();
+
+ virtual bool
+ do_always_noconv() const throw();
+
+ virtual int
+ do_length(state_type&, const extern_type* __from,
+ const extern_type* __end, size_t __max) const;
+
+ virtual int
+ do_max_length() const throw();
+ };
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ /// class codecvt<wchar_t, char, mbstate_t> specialization.
+ template<>
+ class codecvt<wchar_t, char, mbstate_t>
+ : public __codecvt_abstract_base<wchar_t, char, mbstate_t>
+ {
+ public:
+ // Types:
+ typedef wchar_t intern_type;
+ typedef char extern_type;
+ typedef mbstate_t state_type;
+
+ protected:
+ __c_locale _M_c_locale_codecvt;
+
+ public:
+ static locale::id id;
+
+ explicit
+ codecvt(size_t __refs = 0);
+
+ explicit
+ codecvt(__c_locale __cloc, size_t __refs = 0);
+
+ protected:
+ virtual
+ ~codecvt();
+
+ virtual result
+ do_out(state_type& __state, const intern_type* __from,
+ const intern_type* __from_end, const intern_type*& __from_next,
+ extern_type* __to, extern_type* __to_end,
+ extern_type*& __to_next) const;
+
+ virtual result
+ do_unshift(state_type& __state,
+ extern_type* __to, extern_type* __to_end,
+ extern_type*& __to_next) const;
+
+ virtual result
+ do_in(state_type& __state,
+ const extern_type* __from, const extern_type* __from_end,
+ const extern_type*& __from_next,
+ intern_type* __to, intern_type* __to_end,
+ intern_type*& __to_next) const;
+
+ virtual
+ int do_encoding() const throw();
+
+ virtual
+ bool do_always_noconv() const throw();
+
+ virtual
+ int do_length(state_type&, const extern_type* __from,
+ const extern_type* __end, size_t __max) const;
+
+ virtual int
+ do_max_length() const throw();
+ };
+#endif //_GLIBCXX_USE_WCHAR_T
+
+ /// class codecvt_byname [22.2.1.6].
+ template<typename _InternT, typename _ExternT, typename _StateT>
+ class codecvt_byname : public codecvt<_InternT, _ExternT, _StateT>
+ {
+ public:
+ explicit
+ codecvt_byname(const char* __s, size_t __refs = 0)
+ : codecvt<_InternT, _ExternT, _StateT>(__refs)
+ {
+ if (__builtin_strcmp(__s, "C") != 0
+ && __builtin_strcmp(__s, "POSIX") != 0)
+ {
+ this->_S_destroy_c_locale(this->_M_c_locale_codecvt);
+ this->_S_create_c_locale(this->_M_c_locale_codecvt, __s);
+ }
+ }
+
+ protected:
+ virtual
+ ~codecvt_byname() { }
+ };
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class codecvt_byname<char, char, mbstate_t>;
+
+ extern template
+ const codecvt<char, char, mbstate_t>&
+ use_facet<codecvt<char, char, mbstate_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<codecvt<char, char, mbstate_t> >(const locale&);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class codecvt_byname<wchar_t, char, mbstate_t>;
+
+ extern template
+ const codecvt<wchar_t, char, mbstate_t>&
+ use_facet<codecvt<wchar_t, char, mbstate_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<codecvt<wchar_t, char, mbstate_t> >(const locale&);
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif // _CODECVT_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/concept_check.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/concept_check.h
new file mode 100644
index 0000000..6d45e26
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/concept_check.h
@@ -0,0 +1,80 @@
+// Concept-checking control -*- C++ -*-
+
+// Copyright (C) 2001, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file concept_check.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _CONCEPT_CHECK_H
+#define _CONCEPT_CHECK_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+
+// All places in libstdc++-v3 where these are used, or /might/ be used, or
+// don't need to be used, or perhaps /should/ be used, are commented with
+// "concept requirements" (and maybe some more text). So grep like crazy
+// if you're looking for additional places to use these.
+
+// Concept-checking code is off by default unless users turn it on via
+// configure options or editing c++config.h.
+
+#ifndef _GLIBCXX_CONCEPT_CHECKS
+
+#define __glibcxx_function_requires(...)
+#define __glibcxx_class_requires(_a,_b)
+#define __glibcxx_class_requires2(_a,_b,_c)
+#define __glibcxx_class_requires3(_a,_b,_c,_d)
+#define __glibcxx_class_requires4(_a,_b,_c,_d,_e)
+
+#else // the checks are on
+
+#include <bits/boost_concept_check.h>
+
+// Note that the obvious and elegant approach of
+//
+//#define glibcxx_function_requires(C) boost::function_requires< boost::C >()
+//
+// won't work due to concept templates with more than one parameter, e.g.,
+// BinaryPredicateConcept. The preprocessor tries to split things up on
+// the commas in the template argument list. We can't use an inner pair of
+// parenthesis to hide the commas, because "boost::(Temp<Foo,Bar>)" isn't
+// a valid instantiation pattern. Thus, we steal a feature from C99.
+
+#define __glibcxx_function_requires(...) \
+ __gnu_cxx::__function_requires< __gnu_cxx::__VA_ARGS__ >();
+#define __glibcxx_class_requires(_a,_C) \
+ _GLIBCXX_CLASS_REQUIRES(_a, __gnu_cxx, _C);
+#define __glibcxx_class_requires2(_a,_b,_C) \
+ _GLIBCXX_CLASS_REQUIRES2(_a, _b, __gnu_cxx, _C);
+#define __glibcxx_class_requires3(_a,_b,_c,_C) \
+ _GLIBCXX_CLASS_REQUIRES3(_a, _b, _c, __gnu_cxx, _C);
+#define __glibcxx_class_requires4(_a,_b,_c,_d,_C) \
+ _GLIBCXX_CLASS_REQUIRES4(_a, _b, _c, _d, __gnu_cxx, _C);
+
+#endif // enable/disable
+
+#endif // _GLIBCXX_CONCEPT_CHECK
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/cpp_type_traits.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/cpp_type_traits.h
new file mode 100644
index 0000000..afb0049
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/cpp_type_traits.h
@@ -0,0 +1,419 @@
+// The -*- C++ -*- type traits classes for internal use in libstdc++
+
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file cpp_type_traits.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Written by Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
+
+#ifndef _CPP_TYPE_TRAITS_H
+#define _CPP_TYPE_TRAITS_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+
+//
+// This file provides some compile-time information about various types.
+// These representations were designed, on purpose, to be constant-expressions
+// and not types as found in <bits/type_traits.h>. In particular, they
+// can be used in control structures and the optimizer hopefully will do
+// the obvious thing.
+//
+// Why integral expressions, and not functions nor types?
+// Firstly, these compile-time entities are used as template-arguments
+// so function return values won't work: We need compile-time entities.
+// We're left with types and constant integral expressions.
+// Secondly, from the point of view of ease of use, type-based compile-time
+// information is -not- *that* convenient. On has to write lots of
+// overloaded functions and to hope that the compiler will select the right
+// one. As a net effect, the overall structure isn't very clear at first
+// glance.
+// Thirdly, partial ordering and overload resolution (of function templates)
+// is highly costly in terms of compiler-resource. It is a Good Thing to
+// keep these resource consumption as least as possible.
+//
+// See valarray_array.h for a case use.
+//
+// -- Gaby (dosreis@cmla.ens-cachan.fr) 2000-03-06.
+//
+// Update 2005: types are also provided and <bits/type_traits.h> has been
+// removed.
+//
+
+// Forward declaration hack, should really include this from somewhere.
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ template<typename _Iterator, typename _Container>
+ class __normal_iterator;
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ struct __true_type { };
+ struct __false_type { };
+
+ template<bool>
+ struct __truth_type
+ { typedef __false_type __type; };
+
+ template<>
+ struct __truth_type<true>
+ { typedef __true_type __type; };
+
+ // N.B. The conversions to bool are needed due to the issue
+ // explained in c++/19404.
+ template<class _Sp, class _Tp>
+ struct __traitor
+ {
+ enum { __value = bool(_Sp::__value) || bool(_Tp::__value) };
+ typedef typename __truth_type<__value>::__type __type;
+ };
+
+ // Compare for equality of types.
+ template<typename, typename>
+ struct __are_same
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+
+ template<typename _Tp>
+ struct __are_same<_Tp, _Tp>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ // Holds if the template-argument is a void type.
+ template<typename _Tp>
+ struct __is_void
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+
+ template<>
+ struct __is_void<void>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ //
+ // Integer types
+ //
+ template<typename _Tp>
+ struct __is_integer
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+
+ // Thirteen specializations (yes there are eleven standard integer
+ // types; 'long long' and 'unsigned long long' are supported as
+ // extensions)
+ template<>
+ struct __is_integer<bool>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<char>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<signed char>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<unsigned char>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+# ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ struct __is_integer<wchar_t>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+# endif
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<>
+ struct __is_integer<char16_t>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<char32_t>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+#endif
+
+ template<>
+ struct __is_integer<short>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<unsigned short>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<int>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<unsigned int>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<long>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<unsigned long>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<long long>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_integer<unsigned long long>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ //
+ // Floating point types
+ //
+ template<typename _Tp>
+ struct __is_floating
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+
+ // three specializations (float, double and 'long double')
+ template<>
+ struct __is_floating<float>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_floating<double>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_floating<long double>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ //
+ // Pointer types
+ //
+ template<typename _Tp>
+ struct __is_pointer
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+
+ template<typename _Tp>
+ struct __is_pointer<_Tp*>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ //
+ // Normal iterator type
+ //
+ template<typename _Tp>
+ struct __is_normal_iterator
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+
+ template<typename _Iterator, typename _Container>
+ struct __is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator,
+ _Container> >
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ //
+ // An arithmetic type is an integer type or a floating point type
+ //
+ template<typename _Tp>
+ struct __is_arithmetic
+ : public __traitor<__is_integer<_Tp>, __is_floating<_Tp> >
+ { };
+
+ //
+ // A fundamental type is `void' or and arithmetic type
+ //
+ template<typename _Tp>
+ struct __is_fundamental
+ : public __traitor<__is_void<_Tp>, __is_arithmetic<_Tp> >
+ { };
+
+ //
+ // A scalar type is an arithmetic type or a pointer type
+ //
+ template<typename _Tp>
+ struct __is_scalar
+ : public __traitor<__is_arithmetic<_Tp>, __is_pointer<_Tp> >
+ { };
+
+ //
+ // For use in std::copy and std::find overloads for streambuf iterators.
+ //
+ template<typename _Tp>
+ struct __is_char
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+
+ template<>
+ struct __is_char<char>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ struct __is_char<wchar_t>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+#endif
+
+ template<typename _Tp>
+ struct __is_byte
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+
+ template<>
+ struct __is_byte<char>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_byte<signed char>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ template<>
+ struct __is_byte<unsigned char>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+
+ //
+ // Move iterator type
+ //
+ template<typename _Tp>
+ struct __is_move_iterator
+ {
+ enum { __value = 0 };
+ typedef __false_type __type;
+ };
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Iterator>
+ class move_iterator;
+
+ template<typename _Iterator>
+ struct __is_move_iterator< move_iterator<_Iterator> >
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif //_CPP_TYPE_TRAITS_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/deque.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/deque.tcc
new file mode 100644
index 0000000..aac0d59
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/deque.tcc
@@ -0,0 +1,863 @@
+// Deque implementation (out of line) -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file deque.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _DEQUE_TCC
+#define _DEQUE_TCC 1
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ template <typename _Tp, typename _Alloc>
+ deque<_Tp, _Alloc>&
+ deque<_Tp, _Alloc>::
+ operator=(const deque& __x)
+ {
+ const size_type __len = size();
+ if (&__x != this)
+ {
+ if (__len >= __x.size())
+ _M_erase_at_end(std::copy(__x.begin(), __x.end(),
+ this->_M_impl._M_start));
+ else
+ {
+ const_iterator __mid = __x.begin() + difference_type(__len);
+ std::copy(__x.begin(), __mid, this->_M_impl._M_start);
+ insert(this->_M_impl._M_finish, __mid, __x.end());
+ }
+ }
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ template<typename... _Args>
+ void
+ deque<_Tp, _Alloc>::
+ emplace_front(_Args&&... __args)
+ {
+ if (this->_M_impl._M_start._M_cur != this->_M_impl._M_start._M_first)
+ {
+ this->_M_impl.construct(this->_M_impl._M_start._M_cur - 1,
+ std::forward<_Args>(__args)...);
+ --this->_M_impl._M_start._M_cur;
+ }
+ else
+ _M_push_front_aux(std::forward<_Args>(__args)...);
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename... _Args>
+ void
+ deque<_Tp, _Alloc>::
+ emplace_back(_Args&&... __args)
+ {
+ if (this->_M_impl._M_finish._M_cur
+ != this->_M_impl._M_finish._M_last - 1)
+ {
+ this->_M_impl.construct(this->_M_impl._M_finish._M_cur,
+ std::forward<_Args>(__args)...);
+ ++this->_M_impl._M_finish._M_cur;
+ }
+ else
+ _M_push_back_aux(std::forward<_Args>(__args)...);
+ }
+#endif
+
+ template <typename _Tp, typename _Alloc>
+ typename deque<_Tp, _Alloc>::iterator
+ deque<_Tp, _Alloc>::
+ insert(iterator __position, const value_type& __x)
+ {
+ if (__position._M_cur == this->_M_impl._M_start._M_cur)
+ {
+ push_front(__x);
+ return this->_M_impl._M_start;
+ }
+ else if (__position._M_cur == this->_M_impl._M_finish._M_cur)
+ {
+ push_back(__x);
+ iterator __tmp = this->_M_impl._M_finish;
+ --__tmp;
+ return __tmp;
+ }
+ else
+ return _M_insert_aux(__position, __x);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ template<typename... _Args>
+ typename deque<_Tp, _Alloc>::iterator
+ deque<_Tp, _Alloc>::
+ emplace(iterator __position, _Args&&... __args)
+ {
+ if (__position._M_cur == this->_M_impl._M_start._M_cur)
+ {
+ push_front(std::forward<_Args>(__args)...);
+ return this->_M_impl._M_start;
+ }
+ else if (__position._M_cur == this->_M_impl._M_finish._M_cur)
+ {
+ push_back(std::forward<_Args>(__args)...);
+ iterator __tmp = this->_M_impl._M_finish;
+ --__tmp;
+ return __tmp;
+ }
+ else
+ return _M_insert_aux(__position, std::forward<_Args>(__args)...);
+ }
+#endif
+
+ template <typename _Tp, typename _Alloc>
+ typename deque<_Tp, _Alloc>::iterator
+ deque<_Tp, _Alloc>::
+ erase(iterator __position)
+ {
+ iterator __next = __position;
+ ++__next;
+ const difference_type __index = __position - begin();
+ if (static_cast<size_type>(__index) < (size() >> 1))
+ {
+ if (__position != begin())
+ _GLIBCXX_MOVE_BACKWARD3(begin(), __position, __next);
+ pop_front();
+ }
+ else
+ {
+ if (__next != end())
+ _GLIBCXX_MOVE3(__next, end(), __position);
+ pop_back();
+ }
+ return begin() + __index;
+ }
+
+ template <typename _Tp, typename _Alloc>
+ typename deque<_Tp, _Alloc>::iterator
+ deque<_Tp, _Alloc>::
+ erase(iterator __first, iterator __last)
+ {
+ if (__first == begin() && __last == end())
+ {
+ clear();
+ return end();
+ }
+ else
+ {
+ const difference_type __n = __last - __first;
+ const difference_type __elems_before = __first - begin();
+ if (static_cast<size_type>(__elems_before) <= (size() - __n) / 2)
+ {
+ if (__first != begin())
+ _GLIBCXX_MOVE_BACKWARD3(begin(), __first, __last);
+ _M_erase_at_begin(begin() + __n);
+ }
+ else
+ {
+ if (__last != end())
+ _GLIBCXX_MOVE3(__last, end(), __first);
+ _M_erase_at_end(end() - __n);
+ }
+ return begin() + __elems_before;
+ }
+ }
+
+ template <typename _Tp, class _Alloc>
+ template <typename _InputIterator>
+ void
+ deque<_Tp, _Alloc>::
+ _M_assign_aux(_InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag)
+ {
+ iterator __cur = begin();
+ for (; __first != __last && __cur != end(); ++__cur, ++__first)
+ *__cur = *__first;
+ if (__first == __last)
+ _M_erase_at_end(__cur);
+ else
+ insert(end(), __first, __last);
+ }
+
+ template <typename _Tp, typename _Alloc>
+ void
+ deque<_Tp, _Alloc>::
+ _M_fill_insert(iterator __pos, size_type __n, const value_type& __x)
+ {
+ if (__pos._M_cur == this->_M_impl._M_start._M_cur)
+ {
+ iterator __new_start = _M_reserve_elements_at_front(__n);
+ __try
+ {
+ std::__uninitialized_fill_a(__new_start, this->_M_impl._M_start,
+ __x, _M_get_Tp_allocator());
+ this->_M_impl._M_start = __new_start;
+ }
+ __catch(...)
+ {
+ _M_destroy_nodes(__new_start._M_node,
+ this->_M_impl._M_start._M_node);
+ __throw_exception_again;
+ }
+ }
+ else if (__pos._M_cur == this->_M_impl._M_finish._M_cur)
+ {
+ iterator __new_finish = _M_reserve_elements_at_back(__n);
+ __try
+ {
+ std::__uninitialized_fill_a(this->_M_impl._M_finish,
+ __new_finish, __x,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish = __new_finish;
+ }
+ __catch(...)
+ {
+ _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
+ __new_finish._M_node + 1);
+ __throw_exception_again;
+ }
+ }
+ else
+ _M_insert_aux(__pos, __n, __x);
+ }
+
+ template <typename _Tp, typename _Alloc>
+ void
+ deque<_Tp, _Alloc>::
+ _M_fill_initialize(const value_type& __value)
+ {
+ _Map_pointer __cur;
+ __try
+ {
+ for (__cur = this->_M_impl._M_start._M_node;
+ __cur < this->_M_impl._M_finish._M_node;
+ ++__cur)
+ std::__uninitialized_fill_a(*__cur, *__cur + _S_buffer_size(),
+ __value, _M_get_Tp_allocator());
+ std::__uninitialized_fill_a(this->_M_impl._M_finish._M_first,
+ this->_M_impl._M_finish._M_cur,
+ __value, _M_get_Tp_allocator());
+ }
+ __catch(...)
+ {
+ std::_Destroy(this->_M_impl._M_start, iterator(*__cur, __cur),
+ _M_get_Tp_allocator());
+ __throw_exception_again;
+ }
+ }
+
+ template <typename _Tp, typename _Alloc>
+ template <typename _InputIterator>
+ void
+ deque<_Tp, _Alloc>::
+ _M_range_initialize(_InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag)
+ {
+ this->_M_initialize_map(0);
+ __try
+ {
+ for (; __first != __last; ++__first)
+ push_back(*__first);
+ }
+ __catch(...)
+ {
+ clear();
+ __throw_exception_again;
+ }
+ }
+
+ template <typename _Tp, typename _Alloc>
+ template <typename _ForwardIterator>
+ void
+ deque<_Tp, _Alloc>::
+ _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag)
+ {
+ const size_type __n = std::distance(__first, __last);
+ this->_M_initialize_map(__n);
+
+ _Map_pointer __cur_node;
+ __try
+ {
+ for (__cur_node = this->_M_impl._M_start._M_node;
+ __cur_node < this->_M_impl._M_finish._M_node;
+ ++__cur_node)
+ {
+ _ForwardIterator __mid = __first;
+ std::advance(__mid, _S_buffer_size());
+ std::__uninitialized_copy_a(__first, __mid, *__cur_node,
+ _M_get_Tp_allocator());
+ __first = __mid;
+ }
+ std::__uninitialized_copy_a(__first, __last,
+ this->_M_impl._M_finish._M_first,
+ _M_get_Tp_allocator());
+ }
+ __catch(...)
+ {
+ std::_Destroy(this->_M_impl._M_start,
+ iterator(*__cur_node, __cur_node),
+ _M_get_Tp_allocator());
+ __throw_exception_again;
+ }
+ }
+
+ // Called only if _M_impl._M_finish._M_cur == _M_impl._M_finish._M_last - 1.
+ template<typename _Tp, typename _Alloc>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ void
+ deque<_Tp, _Alloc>::
+ _M_push_back_aux(_Args&&... __args)
+#else
+ void
+ deque<_Tp, _Alloc>::
+ _M_push_back_aux(const value_type& __t)
+#endif
+ {
+ _M_reserve_map_at_back();
+ *(this->_M_impl._M_finish._M_node + 1) = this->_M_allocate_node();
+ __try
+ {
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ this->_M_impl.construct(this->_M_impl._M_finish._M_cur,
+ std::forward<_Args>(__args)...);
+#else
+ this->_M_impl.construct(this->_M_impl._M_finish._M_cur, __t);
+#endif
+ this->_M_impl._M_finish._M_set_node(this->_M_impl._M_finish._M_node
+ + 1);
+ this->_M_impl._M_finish._M_cur = this->_M_impl._M_finish._M_first;
+ }
+ __catch(...)
+ {
+ _M_deallocate_node(*(this->_M_impl._M_finish._M_node + 1));
+ __throw_exception_again;
+ }
+ }
+
+ // Called only if _M_impl._M_start._M_cur == _M_impl._M_start._M_first.
+ template<typename _Tp, typename _Alloc>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ void
+ deque<_Tp, _Alloc>::
+ _M_push_front_aux(_Args&&... __args)
+#else
+ void
+ deque<_Tp, _Alloc>::
+ _M_push_front_aux(const value_type& __t)
+#endif
+ {
+ _M_reserve_map_at_front();
+ *(this->_M_impl._M_start._M_node - 1) = this->_M_allocate_node();
+ __try
+ {
+ this->_M_impl._M_start._M_set_node(this->_M_impl._M_start._M_node
+ - 1);
+ this->_M_impl._M_start._M_cur = this->_M_impl._M_start._M_last - 1;
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ this->_M_impl.construct(this->_M_impl._M_start._M_cur,
+ std::forward<_Args>(__args)...);
+#else
+ this->_M_impl.construct(this->_M_impl._M_start._M_cur, __t);
+#endif
+ }
+ __catch(...)
+ {
+ ++this->_M_impl._M_start;
+ _M_deallocate_node(*(this->_M_impl._M_start._M_node - 1));
+ __throw_exception_again;
+ }
+ }
+
+ // Called only if _M_impl._M_finish._M_cur == _M_impl._M_finish._M_first.
+ template <typename _Tp, typename _Alloc>
+ void deque<_Tp, _Alloc>::
+ _M_pop_back_aux()
+ {
+ _M_deallocate_node(this->_M_impl._M_finish._M_first);
+ this->_M_impl._M_finish._M_set_node(this->_M_impl._M_finish._M_node - 1);
+ this->_M_impl._M_finish._M_cur = this->_M_impl._M_finish._M_last - 1;
+ this->_M_impl.destroy(this->_M_impl._M_finish._M_cur);
+ }
+
+ // Called only if _M_impl._M_start._M_cur == _M_impl._M_start._M_last - 1.
+ // Note that if the deque has at least one element (a precondition for this
+ // member function), and if
+ // _M_impl._M_start._M_cur == _M_impl._M_start._M_last,
+ // then the deque must have at least two nodes.
+ template <typename _Tp, typename _Alloc>
+ void deque<_Tp, _Alloc>::
+ _M_pop_front_aux()
+ {
+ this->_M_impl.destroy(this->_M_impl._M_start._M_cur);
+ _M_deallocate_node(this->_M_impl._M_start._M_first);
+ this->_M_impl._M_start._M_set_node(this->_M_impl._M_start._M_node + 1);
+ this->_M_impl._M_start._M_cur = this->_M_impl._M_start._M_first;
+ }
+
+ template <typename _Tp, typename _Alloc>
+ template <typename _InputIterator>
+ void
+ deque<_Tp, _Alloc>::
+ _M_range_insert_aux(iterator __pos,
+ _InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag)
+ { std::copy(__first, __last, std::inserter(*this, __pos)); }
+
+ template <typename _Tp, typename _Alloc>
+ template <typename _ForwardIterator>
+ void
+ deque<_Tp, _Alloc>::
+ _M_range_insert_aux(iterator __pos,
+ _ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag)
+ {
+ const size_type __n = std::distance(__first, __last);
+ if (__pos._M_cur == this->_M_impl._M_start._M_cur)
+ {
+ iterator __new_start = _M_reserve_elements_at_front(__n);
+ __try
+ {
+ std::__uninitialized_copy_a(__first, __last, __new_start,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_start = __new_start;
+ }
+ __catch(...)
+ {
+ _M_destroy_nodes(__new_start._M_node,
+ this->_M_impl._M_start._M_node);
+ __throw_exception_again;
+ }
+ }
+ else if (__pos._M_cur == this->_M_impl._M_finish._M_cur)
+ {
+ iterator __new_finish = _M_reserve_elements_at_back(__n);
+ __try
+ {
+ std::__uninitialized_copy_a(__first, __last,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish = __new_finish;
+ }
+ __catch(...)
+ {
+ _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
+ __new_finish._M_node + 1);
+ __throw_exception_again;
+ }
+ }
+ else
+ _M_insert_aux(__pos, __first, __last, __n);
+ }
+
+ template<typename _Tp, typename _Alloc>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ typename deque<_Tp, _Alloc>::iterator
+ deque<_Tp, _Alloc>::
+ _M_insert_aux(iterator __pos, _Args&&... __args)
+ {
+ value_type __x_copy(std::forward<_Args>(__args)...); // XXX copy
+#else
+ typename deque<_Tp, _Alloc>::iterator
+ deque<_Tp, _Alloc>::
+ _M_insert_aux(iterator __pos, const value_type& __x)
+ {
+ value_type __x_copy = __x; // XXX copy
+#endif
+ difference_type __index = __pos - this->_M_impl._M_start;
+ if (static_cast<size_type>(__index) < size() / 2)
+ {
+ push_front(_GLIBCXX_MOVE(front()));
+ iterator __front1 = this->_M_impl._M_start;
+ ++__front1;
+ iterator __front2 = __front1;
+ ++__front2;
+ __pos = this->_M_impl._M_start + __index;
+ iterator __pos1 = __pos;
+ ++__pos1;
+ _GLIBCXX_MOVE3(__front2, __pos1, __front1);
+ }
+ else
+ {
+ push_back(_GLIBCXX_MOVE(back()));
+ iterator __back1 = this->_M_impl._M_finish;
+ --__back1;
+ iterator __back2 = __back1;
+ --__back2;
+ __pos = this->_M_impl._M_start + __index;
+ _GLIBCXX_MOVE_BACKWARD3(__pos, __back2, __back1);
+ }
+ *__pos = _GLIBCXX_MOVE(__x_copy);
+ return __pos;
+ }
+
+ template <typename _Tp, typename _Alloc>
+ void
+ deque<_Tp, _Alloc>::
+ _M_insert_aux(iterator __pos, size_type __n, const value_type& __x)
+ {
+ const difference_type __elems_before = __pos - this->_M_impl._M_start;
+ const size_type __length = this->size();
+ value_type __x_copy = __x;
+ if (__elems_before < difference_type(__length / 2))
+ {
+ iterator __new_start = _M_reserve_elements_at_front(__n);
+ iterator __old_start = this->_M_impl._M_start;
+ __pos = this->_M_impl._M_start + __elems_before;
+ __try
+ {
+ if (__elems_before >= difference_type(__n))
+ {
+ iterator __start_n = (this->_M_impl._M_start
+ + difference_type(__n));
+ std::__uninitialized_move_a(this->_M_impl._M_start,
+ __start_n, __new_start,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_start = __new_start;
+ _GLIBCXX_MOVE3(__start_n, __pos, __old_start);
+ std::fill(__pos - difference_type(__n), __pos, __x_copy);
+ }
+ else
+ {
+ std::__uninitialized_move_fill(this->_M_impl._M_start,
+ __pos, __new_start,
+ this->_M_impl._M_start,
+ __x_copy,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_start = __new_start;
+ std::fill(__old_start, __pos, __x_copy);
+ }
+ }
+ __catch(...)
+ {
+ _M_destroy_nodes(__new_start._M_node,
+ this->_M_impl._M_start._M_node);
+ __throw_exception_again;
+ }
+ }
+ else
+ {
+ iterator __new_finish = _M_reserve_elements_at_back(__n);
+ iterator __old_finish = this->_M_impl._M_finish;
+ const difference_type __elems_after =
+ difference_type(__length) - __elems_before;
+ __pos = this->_M_impl._M_finish - __elems_after;
+ __try
+ {
+ if (__elems_after > difference_type(__n))
+ {
+ iterator __finish_n = (this->_M_impl._M_finish
+ - difference_type(__n));
+ std::__uninitialized_move_a(__finish_n,
+ this->_M_impl._M_finish,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish = __new_finish;
+ _GLIBCXX_MOVE_BACKWARD3(__pos, __finish_n, __old_finish);
+ std::fill(__pos, __pos + difference_type(__n), __x_copy);
+ }
+ else
+ {
+ std::__uninitialized_fill_move(this->_M_impl._M_finish,
+ __pos + difference_type(__n),
+ __x_copy, __pos,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish = __new_finish;
+ std::fill(__pos, __old_finish, __x_copy);
+ }
+ }
+ __catch(...)
+ {
+ _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
+ __new_finish._M_node + 1);
+ __throw_exception_again;
+ }
+ }
+ }
+
+ template <typename _Tp, typename _Alloc>
+ template <typename _ForwardIterator>
+ void
+ deque<_Tp, _Alloc>::
+ _M_insert_aux(iterator __pos,
+ _ForwardIterator __first, _ForwardIterator __last,
+ size_type __n)
+ {
+ const difference_type __elemsbefore = __pos - this->_M_impl._M_start;
+ const size_type __length = size();
+ if (static_cast<size_type>(__elemsbefore) < __length / 2)
+ {
+ iterator __new_start = _M_reserve_elements_at_front(__n);
+ iterator __old_start = this->_M_impl._M_start;
+ __pos = this->_M_impl._M_start + __elemsbefore;
+ __try
+ {
+ if (__elemsbefore >= difference_type(__n))
+ {
+ iterator __start_n = (this->_M_impl._M_start
+ + difference_type(__n));
+ std::__uninitialized_move_a(this->_M_impl._M_start,
+ __start_n, __new_start,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_start = __new_start;
+ _GLIBCXX_MOVE3(__start_n, __pos, __old_start);
+ std::copy(__first, __last, __pos - difference_type(__n));
+ }
+ else
+ {
+ _ForwardIterator __mid = __first;
+ std::advance(__mid, difference_type(__n) - __elemsbefore);
+ std::__uninitialized_move_copy(this->_M_impl._M_start,
+ __pos, __first, __mid,
+ __new_start,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_start = __new_start;
+ std::copy(__mid, __last, __old_start);
+ }
+ }
+ __catch(...)
+ {
+ _M_destroy_nodes(__new_start._M_node,
+ this->_M_impl._M_start._M_node);
+ __throw_exception_again;
+ }
+ }
+ else
+ {
+ iterator __new_finish = _M_reserve_elements_at_back(__n);
+ iterator __old_finish = this->_M_impl._M_finish;
+ const difference_type __elemsafter =
+ difference_type(__length) - __elemsbefore;
+ __pos = this->_M_impl._M_finish - __elemsafter;
+ __try
+ {
+ if (__elemsafter > difference_type(__n))
+ {
+ iterator __finish_n = (this->_M_impl._M_finish
+ - difference_type(__n));
+ std::__uninitialized_move_a(__finish_n,
+ this->_M_impl._M_finish,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish = __new_finish;
+ _GLIBCXX_MOVE_BACKWARD3(__pos, __finish_n, __old_finish);
+ std::copy(__first, __last, __pos);
+ }
+ else
+ {
+ _ForwardIterator __mid = __first;
+ std::advance(__mid, __elemsafter);
+ std::__uninitialized_copy_move(__mid, __last, __pos,
+ this->_M_impl._M_finish,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish = __new_finish;
+ std::copy(__first, __mid, __pos);
+ }
+ }
+ __catch(...)
+ {
+ _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
+ __new_finish._M_node + 1);
+ __throw_exception_again;
+ }
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ deque<_Tp, _Alloc>::
+ _M_destroy_data_aux(iterator __first, iterator __last)
+ {
+ for (_Map_pointer __node = __first._M_node + 1;
+ __node < __last._M_node; ++__node)
+ std::_Destroy(*__node, *__node + _S_buffer_size(),
+ _M_get_Tp_allocator());
+
+ if (__first._M_node != __last._M_node)
+ {
+ std::_Destroy(__first._M_cur, __first._M_last,
+ _M_get_Tp_allocator());
+ std::_Destroy(__last._M_first, __last._M_cur,
+ _M_get_Tp_allocator());
+ }
+ else
+ std::_Destroy(__first._M_cur, __last._M_cur,
+ _M_get_Tp_allocator());
+ }
+
+ template <typename _Tp, typename _Alloc>
+ void
+ deque<_Tp, _Alloc>::
+ _M_new_elements_at_front(size_type __new_elems)
+ {
+ if (this->max_size() - this->size() < __new_elems)
+ __throw_length_error(__N("deque::_M_new_elements_at_front"));
+
+ const size_type __new_nodes = ((__new_elems + _S_buffer_size() - 1)
+ / _S_buffer_size());
+ _M_reserve_map_at_front(__new_nodes);
+ size_type __i;
+ __try
+ {
+ for (__i = 1; __i <= __new_nodes; ++__i)
+ *(this->_M_impl._M_start._M_node - __i) = this->_M_allocate_node();
+ }
+ __catch(...)
+ {
+ for (size_type __j = 1; __j < __i; ++__j)
+ _M_deallocate_node(*(this->_M_impl._M_start._M_node - __j));
+ __throw_exception_again;
+ }
+ }
+
+ template <typename _Tp, typename _Alloc>
+ void
+ deque<_Tp, _Alloc>::
+ _M_new_elements_at_back(size_type __new_elems)
+ {
+ if (this->max_size() - this->size() < __new_elems)
+ __throw_length_error(__N("deque::_M_new_elements_at_back"));
+
+ const size_type __new_nodes = ((__new_elems + _S_buffer_size() - 1)
+ / _S_buffer_size());
+ _M_reserve_map_at_back(__new_nodes);
+ size_type __i;
+ __try
+ {
+ for (__i = 1; __i <= __new_nodes; ++__i)
+ *(this->_M_impl._M_finish._M_node + __i) = this->_M_allocate_node();
+ }
+ __catch(...)
+ {
+ for (size_type __j = 1; __j < __i; ++__j)
+ _M_deallocate_node(*(this->_M_impl._M_finish._M_node + __j));
+ __throw_exception_again;
+ }
+ }
+
+ template <typename _Tp, typename _Alloc>
+ void
+ deque<_Tp, _Alloc>::
+ _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front)
+ {
+ const size_type __old_num_nodes
+ = this->_M_impl._M_finish._M_node - this->_M_impl._M_start._M_node + 1;
+ const size_type __new_num_nodes = __old_num_nodes + __nodes_to_add;
+
+ _Map_pointer __new_nstart;
+ if (this->_M_impl._M_map_size > 2 * __new_num_nodes)
+ {
+ __new_nstart = this->_M_impl._M_map + (this->_M_impl._M_map_size
+ - __new_num_nodes) / 2
+ + (__add_at_front ? __nodes_to_add : 0);
+ if (__new_nstart < this->_M_impl._M_start._M_node)
+ std::copy(this->_M_impl._M_start._M_node,
+ this->_M_impl._M_finish._M_node + 1,
+ __new_nstart);
+ else
+ std::copy_backward(this->_M_impl._M_start._M_node,
+ this->_M_impl._M_finish._M_node + 1,
+ __new_nstart + __old_num_nodes);
+ }
+ else
+ {
+ size_type __new_map_size = this->_M_impl._M_map_size
+ + std::max(this->_M_impl._M_map_size,
+ __nodes_to_add) + 2;
+
+ _Map_pointer __new_map = this->_M_allocate_map(__new_map_size);
+ __new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2
+ + (__add_at_front ? __nodes_to_add : 0);
+ std::copy(this->_M_impl._M_start._M_node,
+ this->_M_impl._M_finish._M_node + 1,
+ __new_nstart);
+ _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size);
+
+ this->_M_impl._M_map = __new_map;
+ this->_M_impl._M_map_size = __new_map_size;
+ }
+
+ this->_M_impl._M_start._M_set_node(__new_nstart);
+ this->_M_impl._M_finish._M_set_node(__new_nstart + __old_num_nodes - 1);
+ }
+
+ // Overload for deque::iterators, exploiting the "segmented-iterator
+ // optimization". NB: leave const_iterators alone!
+ template<typename _Tp>
+ void
+ fill(const _Deque_iterator<_Tp, _Tp&, _Tp*>& __first,
+ const _Deque_iterator<_Tp, _Tp&, _Tp*>& __last, const _Tp& __value)
+ {
+ typedef typename _Deque_iterator<_Tp, _Tp&, _Tp*>::_Self _Self;
+
+ for (typename _Self::_Map_pointer __node = __first._M_node + 1;
+ __node < __last._M_node; ++__node)
+ std::fill(*__node, *__node + _Self::_S_buffer_size(), __value);
+
+ if (__first._M_node != __last._M_node)
+ {
+ std::fill(__first._M_cur, __first._M_last, __value);
+ std::fill(__last._M_first, __last._M_cur, __value);
+ }
+ else
+ std::fill(__first._M_cur, __last._M_cur, __value);
+ }
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/forward_list.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/forward_list.h
new file mode 100644
index 0000000..d49eb4a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/forward_list.h
@@ -0,0 +1,1306 @@
+// <forward_list.h> -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file forward_list.h
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _FORWARD_LIST_H
+#define _FORWARD_LIST_H 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#include <memory>
+#include <initializer_list>
+#include <ext/cast.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using __gnu_cxx::__static_pointer_cast;
+ using __gnu_cxx::__const_pointer_cast;
+
+ /**
+ * @brief A helper basic node class for %forward_list.
+ * This is just a linked list with nothing inside it.
+ * There are purely list shuffling utility methods here.
+ */
+ template<typename _Alloc>
+ struct _Fwd_list_node_base
+ {
+ // The type allocated by _Alloc cannot be this type, so we rebind
+ typedef typename _Alloc::template rebind<_Fwd_list_node_base<_Alloc> >
+ ::other::pointer _Pointer;
+ typedef typename _Alloc::template rebind<_Fwd_list_node_base<_Alloc> >
+ ::other::const_pointer _Const_pointer;
+
+ _Pointer _M_next;
+
+ _Fwd_list_node_base() : _M_next(0) { }
+
+ static void
+ swap(_Fwd_list_node_base& __x, _Fwd_list_node_base& __y)
+ { std::swap(__x._M_next, __y._M_next); }
+
+ void
+ _M_transfer_after(_Pointer __bbegin);
+
+ void
+ _M_transfer_after(_Pointer __bbegin, _Pointer __bend);
+
+ void
+ _M_reverse_after();
+ };
+
+ /**
+ * @brief A helper node class for %forward_list.
+ * This is just a linked list with a data value in each node.
+ * There is a sorting utility method.
+ */
+ template<typename _Tp, typename _Alloc>
+ struct _Fwd_list_node : public _Fwd_list_node_base<_Alloc>
+ {
+ typedef typename _Alloc::template rebind<_Fwd_list_node<_Tp, _Alloc> >
+ ::other::pointer _Pointer;
+
+ template<typename... _Args>
+ _Fwd_list_node(_Args&&... __args)
+ : _Fwd_list_node_base<_Alloc>(),
+ _M_value(std::forward<_Args>(__args)...) { }
+
+ template<typename _Comp>
+ void
+ _M_sort_after(_Comp __comp);
+
+ _Tp _M_value;
+ };
+
+ /**
+ * @brief A forward_list::iterator.
+ *
+ * All the functions are op overloads.
+ */
+ template<typename _Tp, typename _Alloc>
+ struct _Fwd_list_iterator
+ {
+ typedef _Fwd_list_iterator<_Tp, _Alloc> _Self;
+ typedef _Fwd_list_node<_Tp, _Alloc> _Node;
+ typedef _Fwd_list_node_base<_Alloc> _Node_base;
+
+ typedef _Tp value_type;
+ typedef typename _Alloc::pointer pointer;
+ typedef typename _Alloc::reference reference;
+ typedef typename _Alloc::difference_type difference_type;
+ typedef std::forward_iterator_tag iterator_category;
+
+ _Fwd_list_iterator() : _M_node() { }
+
+ explicit
+ _Fwd_list_iterator(typename _Node_base::_Pointer __n)
+ : _M_node(__n) { }
+
+ reference
+ operator*() const
+ { return __static_pointer_cast<_Node*>(_M_node)->_M_value; }
+
+ pointer
+ operator->() const
+ { return &__static_pointer_cast<_Node*>(_M_node)->_M_value; }
+
+ _Self&
+ operator++()
+ {
+ _M_node = _M_node->_M_next;
+ return *this;
+ }
+
+ _Self
+ operator++(int)
+ {
+ _Self __tmp(*this);
+ _M_node = _M_node->_M_next;
+ return __tmp;
+ }
+
+ bool
+ operator==(const _Self& __x) const
+ { return _M_node == __x._M_node; }
+
+ bool
+ operator!=(const _Self& __x) const
+ { return _M_node != __x._M_node; }
+
+ _Self
+ _M_next() const
+ {
+ if (_M_node)
+ return _Fwd_list_iterator(_M_node->_M_next);
+ else
+ return _Fwd_list_iterator(0);
+ }
+
+ typename _Node_base::_Pointer _M_node;
+ };
+
+ /**
+ * @brief A forward_list::const_iterator.
+ *
+ * All the functions are op overloads.
+ */
+ template<typename _Tp, typename _Alloc>
+ struct _Fwd_list_const_iterator
+ {
+ typedef _Fwd_list_const_iterator<_Tp, _Alloc> _Self;
+ typedef const _Fwd_list_node<_Tp, _Alloc> _Node;
+ typedef const _Fwd_list_node_base<_Alloc> _Node_base;
+ typedef _Fwd_list_iterator<_Tp, _Alloc> iterator;
+
+ typedef _Tp value_type;
+ typedef typename _Alloc::const_pointer pointer;
+ typedef typename _Alloc::const_reference reference;
+ typedef typename _Alloc::difference_type difference_type;
+ typedef std::forward_iterator_tag iterator_category;
+
+ _Fwd_list_const_iterator() : _M_node() { }
+
+ explicit
+ _Fwd_list_const_iterator(typename _Node_base::_Const_pointer __n)
+ : _M_node(__n) { }
+
+ _Fwd_list_const_iterator(const iterator& __iter)
+ : _M_node(__iter._M_node) { }
+
+ reference
+ operator*() const
+ { return __static_pointer_cast<_Node*>(_M_node)->_M_value; }
+
+ pointer
+ operator->() const
+ { return &__static_pointer_cast<_Node*>(_M_node)->_M_value; }
+
+ _Self&
+ operator++()
+ {
+ _M_node = _M_node->_M_next;
+ return *this;
+ }
+
+ _Self
+ operator++(int)
+ {
+ _Self __tmp(*this);
+ _M_node = _M_node->_M_next;
+ return __tmp;
+ }
+
+ bool
+ operator==(const _Self& __x) const
+ { return _M_node == __x._M_node; }
+
+ bool
+ operator!=(const _Self& __x) const
+ { return _M_node != __x._M_node; }
+
+ _Self
+ _M_next() const
+ {
+ if (this->_M_node)
+ return _Fwd_list_const_iterator(_M_node->_M_next);
+ else
+ return _Fwd_list_const_iterator(0);
+ }
+
+ typename _Node_base::_Const_pointer _M_node;
+ };
+
+ /**
+ * @brief Forward list iterator equality comparison.
+ */
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator==(const _Fwd_list_iterator<_Tp, _Alloc>& __x,
+ const _Fwd_list_const_iterator<_Tp, _Alloc>& __y)
+ { return __x._M_node == __y._M_node; }
+
+ /**
+ * @brief Forward list iterator inequality comparison.
+ */
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator!=(const _Fwd_list_iterator<_Tp, _Alloc>& __x,
+ const _Fwd_list_const_iterator<_Tp, _Alloc>& __y)
+ { return __x._M_node != __y._M_node; }
+
+ /**
+ * @brief Base class for %forward_list.
+ */
+ template<typename _Tp, typename _Alloc>
+ struct _Fwd_list_base
+ {
+ protected:
+ typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
+
+ typedef typename _Alloc::template
+ rebind<_Fwd_list_node<_Tp, _Tp_alloc_type>>::other _Node_alloc_type;
+
+ struct _Fwd_list_impl
+ : public _Node_alloc_type
+ {
+ _Fwd_list_node_base<_Tp_alloc_type> _M_head;
+
+ _Fwd_list_impl()
+ : _Node_alloc_type(), _M_head()
+ { }
+
+ _Fwd_list_impl(const _Node_alloc_type& __a)
+ : _Node_alloc_type(__a), _M_head()
+ { }
+ };
+
+ _Fwd_list_impl _M_impl;
+
+ public:
+ typedef _Fwd_list_iterator<_Tp, _Tp_alloc_type> iterator;
+ typedef _Fwd_list_const_iterator<_Tp, _Tp_alloc_type> const_iterator;
+
+ typedef _Fwd_list_node<_Tp, _Tp_alloc_type> _Node;
+ typedef _Fwd_list_node_base<_Tp_alloc_type> _Node_base;
+
+ _Node_alloc_type&
+ _M_get_Node_allocator()
+ { return *static_cast<_Node_alloc_type*>(&this->_M_impl); }
+
+ const _Node_alloc_type&
+ _M_get_Node_allocator() const
+ { return *static_cast<const _Node_alloc_type*>(&this->_M_impl); }
+
+ _Fwd_list_base()
+ : _M_impl()
+ { this->_M_impl._M_head._M_next = 0; }
+
+ _Fwd_list_base(const _Alloc& __a)
+ : _M_impl(__a)
+ { this->_M_impl._M_head._M_next = 0; }
+
+ _Fwd_list_base(const _Fwd_list_base& __lst, const _Alloc& __a);
+
+ _Fwd_list_base(_Fwd_list_base&& __lst, const _Alloc& __a)
+ : _M_impl(__a)
+ { _Node_base::swap(this->_M_impl._M_head,
+ __lst._M_impl._M_head); }
+
+ _Fwd_list_base(_Fwd_list_base&& __lst)
+ : _M_impl(__lst._M_get_Node_allocator())
+ { _Node_base::swap(this->_M_impl._M_head,
+ __lst._M_impl._M_head); }
+
+ ~_Fwd_list_base()
+ { _M_erase_after(&_M_impl._M_head, 0); }
+
+ protected:
+
+ typename _Node::_Pointer
+ _M_get_node()
+ { return _M_get_Node_allocator().allocate(1); }
+
+ template<typename... _Args>
+ typename _Node::_Pointer
+ _M_create_node(_Args&&... __args)
+ {
+ typename _Node::_Pointer __node = this->_M_get_node();
+ __try
+ {
+ _M_get_Node_allocator().construct(__node,
+ std::forward<_Args>(__args)...);
+ __node->_M_next = 0;
+ }
+ __catch(...)
+ {
+ this->_M_put_node(__node);
+ __throw_exception_again;
+ }
+ return __node;
+ }
+
+ template<typename... _Args>
+ typename _Node_base::_Pointer
+ _M_insert_after(const_iterator __pos, _Args&&... __args);
+
+ void
+ _M_put_node(typename _Node::_Pointer __p)
+ { _M_get_Node_allocator().deallocate(__p, 1); }
+
+ typename _Node_base::_Pointer
+ _M_erase_after(typename _Node_base::_Pointer __pos);
+
+ typename _Node_base::_Pointer
+ _M_erase_after(typename _Node_base::_Pointer __pos,
+ typename _Node_base::_Pointer __last);
+ };
+
+ /**
+ * @brief A standard container with linear time access to elements,
+ * and fixed time insertion/deletion at any point in the sequence.
+ *
+ * @ingroup sequences
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, a
+ * <a href="tables.html#67">sequence</a>, including the
+ * <a href="tables.html#68">optional sequence requirements</a> with the
+ * %exception of @c at and @c operator[].
+ *
+ * This is a @e singly @e linked %list. Traversal up the
+ * %list requires linear time, but adding and removing elements (or
+ * @e nodes) is done in constant time, regardless of where the
+ * change takes place. Unlike std::vector and std::deque,
+ * random-access iterators are not provided, so subscripting ( @c
+ * [] ) access is not allowed. For algorithms which only need
+ * sequential access, this lack makes no difference.
+ *
+ * Also unlike the other standard containers, std::forward_list provides
+ * specialized algorithms %unique to linked lists, such as
+ * splicing, sorting, and in-place reversal.
+ *
+ * A couple points on memory allocation for forward_list<Tp>:
+ *
+ * First, we never actually allocate a Tp, we allocate
+ * Fwd_list_node<Tp>'s and trust [20.1.5]/4 to DTRT. This is to ensure
+ * that after elements from %forward_list<X,Alloc1> are spliced into
+ * %forward_list<X,Alloc2>, destroying the memory of the second %list is a
+ * valid operation, i.e., Alloc1 giveth and Alloc2 taketh away.
+ */
+ template<typename _Tp, typename _Alloc = allocator<_Tp> >
+ class forward_list : private _Fwd_list_base<_Tp, _Alloc>
+ {
+ private:
+ typedef _Fwd_list_base<_Tp, _Alloc> _Base;
+ typedef typename _Base::_Node _Node;
+ typedef typename _Base::_Node_base _Node_base;
+ typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
+
+ public:
+ // types:
+ typedef _Tp value_type;
+ typedef typename _Tp_alloc_type::pointer pointer;
+ typedef typename _Tp_alloc_type::const_pointer const_pointer;
+ typedef typename _Tp_alloc_type::reference reference;
+ typedef typename _Tp_alloc_type::const_reference const_reference;
+
+ typedef typename _Base::iterator iterator;
+ typedef typename _Base::const_iterator const_iterator;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef _Alloc allocator_type;
+
+ // 23.2.3.1 construct/copy/destroy:
+
+ /**
+ * @brief Creates a %forward_list with no elements.
+ * @param al An allocator object.
+ */
+ explicit
+ forward_list(const _Alloc& __al = _Alloc())
+ : _Base(__al)
+ { }
+
+ /**
+ * @brief Copy constructor with allocator argument.
+ * @param list Input list to copy.
+ * @param al An allocator object.
+ */
+ forward_list(const forward_list& __list, const _Alloc& __al)
+ : _Base(__list, __al)
+ { }
+
+ /**
+ * @brief Move constructor with allocator argument.
+ * @param list Input list to move.
+ * @param al An allocator object.
+ */
+ forward_list(forward_list&& __list, const _Alloc& __al)
+ : _Base(std::forward<_Base>(__list), __al)
+ { }
+
+ /**
+ * @brief Creates a %forward_list with copies of the default element
+ * type.
+ * @param n The number of elements to initially create.
+ *
+ * This constructor fills the %forward_list with @a n copies of
+ * the default value.
+ */
+ explicit
+ forward_list(size_type __n)
+ : _Base()
+ { _M_fill_initialize(__n, value_type()); }
+
+ /**
+ * @brief Creates a %forward_list with copies of an exemplar element.
+ * @param n The number of elements to initially create.
+ * @param value An element to copy.
+ * @param al An allocator object.
+ *
+ * This constructor fills the %forward_list with @a n copies of @a
+ * value.
+ */
+ forward_list(size_type __n, const _Tp& __value,
+ const _Alloc& __al = _Alloc())
+ : _Base(__al)
+ { _M_fill_initialize(__n, __value); }
+
+ /**
+ * @brief Builds a %forward_list from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param al An allocator object.
+ *
+ * Create a %forward_list consisting of copies of the elements from
+ * [@a first,@a last). This is linear in N (where N is
+ * distance(@a first,@a last)).
+ */
+ template<typename _InputIterator>
+ forward_list(_InputIterator __first, _InputIterator __last,
+ const _Alloc& __al = _Alloc())
+ : _Base(__al)
+ {
+ // Check whether it's an integral type. If so, it's not an iterator.
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_initialize_dispatch(__first, __last, _Integral());
+ }
+
+ /**
+ * @brief The %forward_list copy constructor.
+ * @param list A %forward_list of identical element and allocator
+ * types.
+ *
+ * The newly-created %forward_list uses a copy of the allocation
+ * object used by @a list.
+ */
+ forward_list(const forward_list& __list)
+ : _Base(__list.get_allocator())
+ { _M_initialize_dispatch(__list.begin(), __list.end(), __false_type()); }
+
+ /**
+ * @brief The %forward_list move constructor.
+ * @param list A %forward_list of identical element and allocator
+ * types.
+ *
+ * The newly-created %forward_list contains the exact contents of @a
+ * forward_list. The contents of @a list are a valid, but unspecified
+ * %forward_list.
+ */
+ forward_list(forward_list&& __list)
+ : _Base(std::forward<_Base>(__list)) { }
+
+ /**
+ * @brief Builds a %forward_list from an initializer_list
+ * @param il An initializer_list of value_type.
+ * @param al An allocator object.
+ *
+ * Create a %forward_list consisting of copies of the elements
+ * in the initializer_list @a il. This is linear in il.size().
+ */
+ forward_list(std::initializer_list<_Tp> __il,
+ const _Alloc& __al = _Alloc())
+ : _Base(__al)
+ { _M_initialize_dispatch(__il.begin(), __il.end(), __false_type()); }
+
+ /**
+ * @brief The forward_list dtor.
+ */
+ ~forward_list()
+ { _M_erase_after(&this->_M_impl._M_head, 0); }
+
+ /**
+ * @brief The %forward_list assignment operator.
+ * @param list A %forward_list of identical element and allocator
+ * types.
+ *
+ * All the elements of @a list are copied, but unlike the copy
+ * constructor, the allocator object is not copied.
+ */
+ forward_list&
+ operator=(const forward_list& __list);
+
+ /**
+ * @brief The %forward_list move assignment operator.
+ * @param list A %forward_list of identical element and allocator
+ * types.
+ *
+ * The contents of @a list are moved into this %forward_list
+ * (without copying). @a list is a valid, but unspecified
+ * %forward_list
+ */
+ forward_list&
+ operator=(forward_list&& __list)
+ {
+ if (&__list != this)
+ {
+ this->clear();
+ this->swap(__list);
+ }
+ return *this;
+ }
+
+ /**
+ * @brief The %forward_list initializer list assignment operator.
+ * @param il An initializer_list of value_type.
+ *
+ * Replace the contents of the %forward_list with copies of the
+ * elements in the initializer_list @a il. This is linear in
+ * il.size().
+ */
+ forward_list&
+ operator=(std::initializer_list<_Tp> __il)
+ {
+ assign(__il);
+ return *this;
+ }
+
+ /**
+ * @brief Assigns a range to a %forward_list.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * This function fills a %forward_list with copies of the elements
+ * in the range [@a first,@a last).
+ *
+ * Note that the assignment completely changes the %forward_list and
+ * that the resulting %forward_list's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ template<typename _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ clear();
+ insert_after(cbefore_begin(), __first, __last);
+ }
+
+ /**
+ * @brief Assigns a given value to a %forward_list.
+ * @param n Number of elements to be assigned.
+ * @param val Value to be assigned.
+ *
+ * This function fills a %forward_list with @a n copies of the given
+ * value. Note that the assignment completely changes the
+ * %forward_list and that the resulting %forward_list's size is the
+ * same as the number of elements assigned. Old data may be lost.
+ */
+ void
+ assign(size_type __n, const _Tp& __val)
+ {
+ clear();
+ insert_after(cbefore_begin(), __n, __val);
+ }
+
+ /**
+ * @brief Assigns an initializer_list to a %forward_list.
+ * @param il An initializer_list of value_type.
+ *
+ * Replace the contents of the %forward_list with copies of the
+ * elements in the initializer_list @a il. This is linear in
+ * il.size().
+ */
+ void
+ assign(std::initializer_list<_Tp> __il)
+ {
+ clear();
+ insert_after(cbefore_begin(), __il);
+ }
+
+ /// Get a copy of the memory allocation object.
+ allocator_type
+ get_allocator() const
+ { return this->_M_get_Node_allocator(); }
+
+ // 23.2.3.2 iterators:
+
+ /**
+ * Returns a read/write iterator that points before the first element
+ * in the %forward_list. Iteration is done in ordinary element order.
+ */
+ iterator
+ before_begin()
+ { return iterator(&this->_M_impl._M_head); }
+
+ /**
+ * Returns a read-only (constant) iterator that points before the
+ * first element in the %forward_list. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ before_begin() const
+ { return const_iterator(&this->_M_impl._M_head); }
+
+ /**
+ * Returns a read/write iterator that points to the first element
+ * in the %forward_list. Iteration is done in ordinary element order.
+ */
+ iterator
+ begin()
+ { return iterator(this->_M_impl._M_head._M_next); }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * element in the %forward_list. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ begin() const
+ { return const_iterator(this->_M_impl._M_head._M_next); }
+
+ /**
+ * Returns a read/write iterator that points one past the last
+ * element in the %forward_list. Iteration is done in ordinary
+ * element order.
+ */
+ iterator
+ end()
+ { return iterator(0); }
+
+ /**
+ * Returns a read-only iterator that points one past the last
+ * element in the %forward_list. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ end() const
+ { return const_iterator(0); }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the
+ * first element in the %forward_list. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ cbegin() const
+ { return const_iterator(this->_M_impl._M_head._M_next); }
+
+ /**
+ * Returns a read-only (constant) iterator that points before the
+ * first element in the %forward_list. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ cbefore_begin() const
+ { return const_iterator(&this->_M_impl._M_head); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past
+ * the last element in the %forward_list. Iteration is done in
+ * ordinary element order.
+ */
+ const_iterator
+ cend() const
+ { return const_iterator(0); }
+
+ /**
+ * Returns true if the %forward_list is empty. (Thus begin() would
+ * equal end().)
+ */
+ bool
+ empty() const
+ { return this->_M_impl._M_head._M_next == 0; }
+
+ /**
+ * Returns the largest possible size of %forward_list.
+ */
+ size_type
+ max_size() const
+ { return this->_M_get_Node_allocator().max_size(); }
+
+ // 23.2.3.3 element access:
+
+ /**
+ * Returns a read/write reference to the data at the first
+ * element of the %forward_list.
+ */
+ reference
+ front()
+ {
+ _Node* __front =
+ __static_pointer_cast<_Node*>(this->_M_impl._M_head._M_next);
+ return __front->_M_value;
+ }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the first
+ * element of the %forward_list.
+ */
+ const_reference
+ front() const
+ {
+ _Node* __front =
+ __static_pointer_cast<_Node*>(this->_M_impl._M_head._M_next);
+ return __front->_M_value;
+ }
+
+ // 23.2.3.4 modiï¬ers:
+
+ /**
+ * @brief Constructs object in %forward_list at the front of the
+ * list.
+ * @param args Arguments.
+ *
+ * This function will insert an object of type Tp constructed
+ * with Tp(std::forward<Args>(args)...) at the front of the list
+ * Due to the nature of a %forward_list this operation can
+ * be done in constant time, and does not invalidate iterators
+ * and references.
+ */
+ template<typename... _Args>
+ void
+ emplace_front(_Args&&... __args)
+ { this->_M_insert_after(cbefore_begin(),
+ std::forward<_Args>(__args)...); }
+
+ /**
+ * @brief Add data to the front of the %forward_list.
+ * @param val Data to be added.
+ *
+ * This is a typical stack operation. The function creates an
+ * element at the front of the %forward_list and assigns the given
+ * data to it. Due to the nature of a %forward_list this operation
+ * can be done in constant time, and does not invalidate iterators
+ * and references.
+ */
+ void
+ push_front(const _Tp& __val)
+ { this->_M_insert_after(cbefore_begin(), __val); }
+
+ /**
+ *
+ */
+ void
+ push_front(_Tp&& __val)
+ { this->_M_insert_after(cbefore_begin(), std::move(__val)); }
+
+ /**
+ * @brief Removes first element.
+ *
+ * This is a typical stack operation. It shrinks the %forward_list
+ * by one. Due to the nature of a %forward_list this operation can
+ * be done in constant time, and only invalidates iterators/references
+ * to the element being removed.
+ *
+ * Note that no data is returned, and if the first element's data
+ * is needed, it should be retrieved before pop_front() is
+ * called.
+ */
+ void
+ pop_front()
+ { this->_M_erase_after(&this->_M_impl._M_head); }
+
+ /**
+ * @brief Constructs object in %forward_list after the specified
+ * iterator.
+ * @param pos A const_iterator into the %forward_list.
+ * @param args Arguments.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert an object of type T constructed
+ * with T(std::forward<Args>(args)...) after the specified
+ * location. Due to the nature of a %forward_list this operation can
+ * be done in constant time, and does not invalidate iterators
+ * and references.
+ */
+ template<typename... _Args>
+ iterator
+ emplace_after(const_iterator __pos, _Args&&... __args)
+ { return iterator(this->_M_insert_after(__pos,
+ std::forward<_Args>(__args)...)); }
+
+ /**
+ * @brief Inserts given value into %forward_list after specified
+ * iterator.
+ * @param pos An iterator into the %forward_list.
+ * @param val Data to be inserted.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert a copy of the given value after
+ * the specified location. Due to the nature of a %forward_list this
+ * operation can be done in constant time, and does not
+ * invalidate iterators and references.
+ */
+ iterator
+ insert_after(const_iterator __pos, const _Tp& __val)
+ { return iterator(this->_M_insert_after(__pos, __val)); }
+
+ /**
+ *
+ */
+ iterator
+ insert_after(const_iterator __pos, _Tp&& __val)
+ { return iterator(this->_M_insert_after(__pos, std::move(__val))); }
+
+ /**
+ * @brief Inserts a number of copies of given data into the
+ * %forward_list.
+ * @param pos An iterator into the %forward_list.
+ * @param n Number of elements to be inserted.
+ * @param val Data to be inserted.
+ *
+ * This function will insert a specified number of copies of the
+ * given data after the location specified by @a pos.
+ *
+ * This operation is linear in the number of elements inserted and
+ * does not invalidate iterators and references.
+ */
+ void
+ insert_after(const_iterator __pos, size_type __n, const _Tp& __val)
+ {
+ forward_list __tmp(__n, __val, this->get_allocator());
+ this->splice_after(__pos, std::move(__tmp));
+ }
+
+ /**
+ * @brief Inserts a range into the %forward_list.
+ * @param position An iterator into the %forward_list.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * This function will insert copies of the data in the range [@a
+ * first,@a last) into the %forward_list after the location specified
+ * by @a pos.
+ *
+ * This operation is linear in the number of elements inserted and
+ * does not invalidate iterators and references.
+ */
+ template<typename _InputIterator>
+ void
+ insert_after(const_iterator __pos,
+ _InputIterator __first, _InputIterator __last)
+ {
+ forward_list __tmp(__first, __last, this->get_allocator());
+ this->splice_after(__pos, std::move(__tmp));
+ }
+
+ /**
+ * @brief Inserts the contents of an initializer_list into
+ * %forward_list after the specified iterator.
+ * @param pos An iterator into the %forward_list.
+ * @param il An initializer_list of value_type.
+ *
+ * This function will insert copies of the data in the
+ * initializer_list @a il into the %forward_list before the location
+ * specified by @a pos.
+ *
+ * This operation is linear in the number of elements inserted and
+ * does not invalidate iterators and references.
+ */
+ void
+ insert_after(const_iterator __pos, std::initializer_list<_Tp> __il)
+ {
+ forward_list __tmp(__il, this->get_allocator());
+ this->splice_after(__pos, std::move(__tmp));
+ }
+
+ /**
+ * @brief Removes the element pointed to by the iterator following
+ * @c pos.
+ * @param pos Iterator pointing to element to be erased.
+ * @return An iterator pointing to the next element (or end()).
+ *
+ * This function will erase the element at the given position and
+ * thus shorten the %forward_list by one.
+ *
+ * Due to the nature of a %forward_list this operation can be done
+ * in constant time, and only invalidates iterators/references to
+ * the element being removed. The user is also cautioned that
+ * this function only erases the element, and that if the element
+ * is itself a pointer, the pointed-to memory is not touched in
+ * any way. Managing the pointer is the user's responsibility.
+ */
+ iterator
+ erase_after(const_iterator __pos)
+ {
+ _Node_base* __tmp = __const_pointer_cast<_Node_base*>(__pos._M_node);
+ if (__tmp)
+ return iterator(this->_M_erase_after(__tmp));
+ else
+ return end();
+ }
+
+ /**
+ * @brief Remove a range of elements.
+ * @param pos Iterator pointing before the first element to be
+ * erased.
+ * @param last Iterator pointing to one past the last element to be
+ * erased.
+ * @return An iterator pointing to the element pointed to by @a last
+ * prior to erasing (or end()).
+ *
+ * This function will erase the elements in the range @a
+ * (pos,last) and shorten the %forward_list accordingly.
+ *
+ * This operation is linear time in the size of the range and only
+ * invalidates iterators/references to the element being removed.
+ * The user is also cautioned that this function only erases the
+ * elements, and that if the elements themselves are pointers, the
+ * pointed-to memory is not touched in any way. Managing the pointer
+ * is the user's responsibility.
+ */
+ iterator
+ erase_after(const_iterator __pos, iterator __last)
+ {
+ _Node_base* __tmp = __const_pointer_cast<_Node_base*>(__pos._M_node);
+ return iterator(this->_M_erase_after(__tmp, &*__last._M_node));
+ }
+
+ /**
+ * @brief Swaps data with another %forward_list.
+ * @param list A %forward_list of the same element and allocator
+ * types.
+ *
+ * This exchanges the elements between two lists in constant
+ * time. Note that the global std::swap() function is
+ * specialized such that std::swap(l1,l2) will feed to this
+ * function.
+ */
+ void
+ swap(forward_list&& __list)
+ { _Node_base::swap(this->_M_impl._M_head, __list._M_impl._M_head); }
+
+ /**
+ * @brief Resizes the %forward_list to the specified number of
+ * elements.
+ * @param sz Number of elements the %forward_list should contain.
+ *
+ * This function will %resize the %forward_list to the specified
+ * number of elements. If the number is smaller than the
+ * %forward_list's current size the %forward_list is truncated,
+ * otherwise the %forward_list is extended and new elements are
+ * populated with given data.
+ */
+ void
+ resize(size_type __sz)
+ { resize(__sz, _Tp()); }
+
+ /**
+ * @brief Resizes the %forward_list to the specified number of
+ * elements.
+ * @param sz Number of elements the %forward_list should contain.
+ * @param val Data with which new elements should be populated.
+ *
+ * This function will %resize the %forward_list to the specified
+ * number of elements. If the number is smaller than the
+ * %forward_list's current size the %forward_list is truncated,
+ * otherwise the %forward_list is extended and new elements are
+ * populated with given data.
+ */
+ void
+ resize(size_type __sz, value_type __val);
+
+ /**
+ * @brief Erases all the elements.
+ *
+ * Note that this function only erases
+ * the elements, and that if the elements themselves are
+ * pointers, the pointed-to memory is not touched in any way.
+ * Managing the pointer is the user's responsibility.
+ */
+ void
+ clear()
+ { this->_M_erase_after(&this->_M_impl._M_head, 0); }
+
+ // 23.2.3.5 forward_list operations:
+
+ /**
+ * @brief Insert contents of another %forward_list.
+ * @param pos Iterator referencing the element to insert after.
+ * @param list Source list.
+ *
+ * The elements of @a list are inserted in constant time after
+ * the element referenced by @a pos. @a list becomes an empty
+ * list.
+ *
+ * Requires this != @a x.
+ */
+ void
+ splice_after(const_iterator __pos, forward_list&& __list);
+
+ /**
+ * @brief Insert element from another %forward_list.
+ * @param pos Iterator referencing the element to insert after.
+ * @param list Source list.
+ * @param it Iterator referencing the element before the element
+ * to move.
+ *
+ * Removes the element in list @a list referenced by @a i and
+ * inserts it into the current list after @a pos.
+ */
+ void
+ splice_after(const_iterator __pos, forward_list&& __list,
+ const_iterator __it)
+ { this->splice_after(__pos, __list, __it, __it._M_next()); }
+
+ /**
+ * @brief Insert range from another %forward_list.
+ * @param pos Iterator referencing the element to insert after.
+ * @param list Source list.
+ * @param before Iterator referencing before the start of range
+ * in list.
+ * @param last Iterator referencing the end of range in list.
+ *
+ * Removes elements in the range (before,last) and inserts them
+ * after @a pos in constant time.
+ *
+ * Undefined if @a pos is in (before,last).
+ */
+ void
+ splice_after(const_iterator __pos, forward_list&& __list,
+ const_iterator __before, const_iterator __last);
+
+ /**
+ * @brief Remove all elements equal to value.
+ * @param val The value to remove.
+ *
+ * Removes every element in the list equal to @a value.
+ * Remaining elements stay in list order. Note that this
+ * function only erases the elements, and that if the elements
+ * themselves are pointers, the pointed-to memory is not
+ * touched in any way. Managing the pointer is the user's
+ * responsibility.
+ */
+ void
+ remove(const _Tp& __val);
+
+ /**
+ * @brief Remove all elements satisfying a predicate.
+ * @param pred Unary predicate function or object.
+ *
+ * Removes every element in the list for which the predicate
+ * returns true. Remaining elements stay in list order. Note
+ * that this function only erases the elements, and that if the
+ * elements themselves are pointers, the pointed-to memory is
+ * not touched in any way. Managing the pointer is the user's
+ * responsibility.
+ */
+ template<typename _Pred>
+ void
+ remove_if(_Pred __pred);
+
+ /**
+ * @brief Remove consecutive duplicate elements.
+ *
+ * For each consecutive set of elements with the same value,
+ * remove all but the first one. Remaining elements stay in
+ * list order. Note that this function only erases the
+ * elements, and that if the elements themselves are pointers,
+ * the pointed-to memory is not touched in any way. Managing
+ * the pointer is the user's responsibility.
+ */
+ void
+ unique()
+ { this->unique(std::equal_to<_Tp>()); }
+
+ /**
+ * @brief Remove consecutive elements satisfying a predicate.
+ * @param binary_pred Binary predicate function or object.
+ *
+ * For each consecutive set of elements [first,last) that
+ * satisfy predicate(first,i) where i is an iterator in
+ * [first,last), remove all but the first one. Remaining
+ * elements stay in list order. Note that this function only
+ * erases the elements, and that if the elements themselves are
+ * pointers, the pointed-to memory is not touched in any way.
+ * Managing the pointer is the user's responsibility.
+ */
+ template<typename _BinPred>
+ void
+ unique(_BinPred __binary_pred);
+
+ /**
+ * @brief Merge sorted lists.
+ * @param list Sorted list to merge.
+ *
+ * Assumes that both @a list and this list are sorted according to
+ * operator<(). Merges elements of @a list into this list in
+ * sorted order, leaving @a list empty when complete. Elements in
+ * this list precede elements in @a list that are equal.
+ */
+ void
+ merge(forward_list&& __list)
+ { this->merge(__list, std::less<_Tp>()); }
+
+ /**
+ * @brief Merge sorted lists according to comparison function.
+ * @param list Sorted list to merge.
+ * @param comp Comparison function defining sort order.
+ *
+ * Assumes that both @a list and this list are sorted according to
+ * comp. Merges elements of @a list into this list
+ * in sorted order, leaving @a list empty when complete. Elements
+ * in this list precede elements in @a list that are equivalent
+ * according to comp().
+ */
+ template<typename _Comp>
+ void
+ merge(forward_list&& __list, _Comp __comp);
+
+ /**
+ * @brief Sort the elements of the list.
+ *
+ * Sorts the elements of this list in NlogN time. Equivalent
+ * elements remain in list order.
+ */
+ void
+ sort()
+ {
+ _Node* __tmp = __static_pointer_cast<_Node*>(&this->_M_impl._M_head);
+ __tmp->_M_sort_after(std::less<_Tp>());
+ }
+
+ /**
+ * @brief Sort the forward_list using a comparison function.
+ *
+ * Sorts the elements of this list in NlogN time. Equivalent
+ * elements remain in list order.
+ */
+ template<typename _Comp>
+ void
+ sort(_Comp __comp)
+ {
+ _Node* __tmp = __static_pointer_cast<_Node*>(&this->_M_impl._M_head);
+ __tmp->_M_sort_after(__comp);
+ }
+
+ /**
+ * @brief Reverse the elements in list.
+ *
+ * Reverse the order of elements in the list in linear time.
+ */
+ void
+ reverse()
+ { this->_M_impl._M_head._M_reverse_after(); }
+
+ private:
+ template<typename _Integer>
+ void
+ _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
+ { _M_fill_initialize(static_cast<size_type>(__n), __x); }
+
+ // Called by the range constructor to implement [23.1.1]/9
+ template<typename _InputIterator>
+ void
+ _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type);
+
+ // Called by forward_list(n,v,a), and the range constructor when it
+ // turns out to be the same thing.
+ void
+ _M_fill_initialize(size_type __n, const value_type& __value);
+ };
+
+ /**
+ * @brief Forward list equality comparison.
+ * @param lx A %forward_list
+ * @param ly A %forward_list of the same type as @a lx.
+ * @return True iff the size and elements of the forward lists are equal.
+ *
+ * This is an equivalence relation. It is linear in the size of the
+ * forward lists. Deques are considered equivalent if corresponding
+ * elements compare equal.
+ */
+ template<typename _Tp, typename _Alloc>
+ bool
+ operator==(const forward_list<_Tp, _Alloc>& __lx,
+ const forward_list<_Tp, _Alloc>& __ly);
+
+ /**
+ * @brief Forward list ordering relation.
+ * @param lx A %forward_list.
+ * @param ly A %forward_list of the same type as @a lx.
+ * @return True iff @a lx is lexicographically less than @a ly.
+ *
+ * This is a total ordering relation. It is linear in the size of the
+ * forward lists. The elements must be comparable with @c <.
+ *
+ * See std::lexicographical_compare() for how the determination is made.
+ */
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<(const forward_list<_Tp, _Alloc>& __lx,
+ const forward_list<_Tp, _Alloc>& __ly)
+ { return std::lexicographical_compare(__lx.cbegin(), __lx.cend(),
+ __ly.cbegin(), __ly.cend()); }
+
+ /// Based on operator==
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator!=(const forward_list<_Tp, _Alloc>& __lx,
+ const forward_list<_Tp, _Alloc>& __ly)
+ { return !(__lx == __ly); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>(const forward_list<_Tp, _Alloc>& __lx,
+ const forward_list<_Tp, _Alloc>& __ly)
+ { return (__ly < __lx); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>=(const forward_list<_Tp, _Alloc>& __lx,
+ const forward_list<_Tp, _Alloc>& __ly)
+ { return !(__lx < __ly); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<=(const forward_list<_Tp, _Alloc>& __lx,
+ const forward_list<_Tp, _Alloc>& __ly)
+ { return !(__ly < __lx); }
+
+ /// See std::forward_list::swap().
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(forward_list<_Tp, _Alloc>& __lx,
+ forward_list<_Tp, _Alloc>& __ly)
+ { __lx.swap(__ly); }
+
+ /// See std::forward_list::swap().
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(forward_list<_Tp, _Alloc>&& __lx,
+ forward_list<_Tp, _Alloc>& __ly)
+ { __lx.swap(__ly); }
+
+ /// See std::forward_list::swap().
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(forward_list<_Tp, _Alloc>& __lx,
+ forward_list<_Tp, _Alloc>&& __ly)
+ { __lx.swap(__ly); }
+
+_GLIBCXX_END_NAMESPACE // namespace std
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _FORWARD_LIST_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/forward_list.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/forward_list.tcc
new file mode 100644
index 0000000..8458e7e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/forward_list.tcc
@@ -0,0 +1,478 @@
+// <forward_list.tcc> -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file forward_list.tcc
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _FORWARD_LIST_TCC
+#define _FORWARD_LIST_TCC 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _Alloc>
+ void
+ _Fwd_list_node_base<_Alloc>::
+ _M_transfer_after(_Pointer __bbegin)
+ {
+ _Pointer __bend = __bbegin;
+ while (__bend && __bend->_M_next)
+ __bend = __bend->_M_next;
+ _M_transfer_after(__bbegin, __bend);
+ }
+
+ template<typename _Alloc>
+ void
+ _Fwd_list_node_base<_Alloc>::
+ _M_transfer_after(_Pointer __bbegin, _Pointer __bend)
+ {
+ _Pointer __keep = __bbegin->_M_next;
+ if (__bend)
+ {
+ __bbegin->_M_next = __bend->_M_next;
+ __bend->_M_next = _M_next;
+ }
+ else
+ __bbegin->_M_next = 0;
+ _M_next = __keep;
+ }
+
+ template<typename _Alloc>
+ void
+ _Fwd_list_node_base<_Alloc>::
+ _M_reverse_after()
+ {
+ _Pointer __tail = _M_next;
+ if (!__tail)
+ return;
+ while (_Pointer __temp = __tail->_M_next)
+ {
+ _Pointer __keep = _M_next;
+ _M_next = __temp;
+ __tail->_M_next = __temp->_M_next;
+ _M_next->_M_next = __keep;
+ }
+ }
+
+ /**
+ * @brief Sort the singly linked list starting after this node.
+ * This node is assumed to be an empty head node (of type
+ * _Fwd_list_node_base).
+ */
+ template<typename _Tp, class _Alloc>
+ template<typename _Comp>
+ void
+ _Fwd_list_node<_Tp, _Alloc>::
+ _M_sort_after(_Comp __comp)
+ {
+ // If `next' is 0, return immediately.
+ _Pointer __list = __static_pointer_cast<_Pointer>(this->_M_next);
+ if (!__list)
+ return;
+
+ unsigned long __insize = 1;
+
+ while (1)
+ {
+ _Pointer __p = __list;
+ __list = 0;
+ _Pointer __tail = 0;
+
+ // Count number of merges we do in this pass.
+ unsigned long __nmerges = 0;
+
+ while (__p)
+ {
+ ++__nmerges;
+ // There exists a merge to be done.
+ // Step `insize' places along from p.
+ _Pointer __q = __p;
+ unsigned long __psize = 0;
+ for (unsigned long __i = 0; __i < __insize; ++__i)
+ {
+ ++__psize;
+ __q = __static_pointer_cast<_Pointer>(__q->_M_next);
+ if (!__q)
+ break;
+ }
+
+ // If q hasn't fallen off end, we have two lists to merge.
+ unsigned long __qsize = __insize;
+
+ // Now we have two lists; merge them.
+ while (__psize > 0 || (__qsize > 0 && __q))
+ {
+ // Decide whether next node of merge comes from p or q.
+ _Pointer __e;
+ if (__psize == 0)
+ {
+ // p is empty; e must come from q.
+ __e = __q;
+ __q = __static_pointer_cast<_Pointer>(__q->_M_next);
+ --__qsize;
+ }
+ else if (__qsize == 0 || !__q)
+ {
+ // q is empty; e must come from p.
+ __e = __p;
+ __p = __static_pointer_cast<_Pointer>(__p->_M_next);
+ --__psize;
+ }
+ else if (__comp(__p->_M_value, __q->_M_value))
+ {
+ // First node of p is lower; e must come from p.
+ __e = __p;
+ __p = __static_pointer_cast<_Pointer>(__p->_M_next);
+ --__psize;
+ }
+ else
+ {
+ // First node of q is lower; e must come from q.
+ __e = __q;
+ __q = __static_pointer_cast<_Pointer>(__q->_M_next);
+ --__qsize;
+ }
+
+ // Add the next node to the merged list.
+ if (__tail)
+ __tail->_M_next = __e;
+ else
+ __list = __e;
+ __tail = __e;
+ }
+
+ // Now p has stepped `insize' places along, and q has too.
+ __p = __q;
+ }
+ __tail->_M_next = 0;
+
+ // If we have done only one merge, we're finished.
+ // Allow for nmerges == 0, the empty list case.
+ if (__nmerges <= 1)
+ {
+ this->_M_next = __list;
+ return;
+ }
+
+ // Otherwise repeat, merging lists twice the size.
+ __insize *= 2;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ _Fwd_list_base<_Tp, _Alloc>::
+ _Fwd_list_base(const _Fwd_list_base& __lst, const _Alloc& __a)
+ : _M_impl(__a)
+ {
+ this->_M_impl._M_head._M_next = 0;
+ typename _Node_base::_Pointer __to = &this->_M_impl._M_head;
+ typename _Node::_Pointer __curr
+ = __static_pointer_cast<typename _Node::_Pointer>
+ (__lst._M_impl._M_head._M_next);
+ while (__curr)
+ {
+ __to->_M_next = _M_create_node(__curr->_M_value);
+ __to = __to->_M_next;
+ __curr = __static_pointer_cast<typename _Node::_Pointer>
+ (__curr->_M_next);
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename... _Args>
+ typename _Fwd_list_base<_Tp, _Alloc>::_Node_base::_Pointer
+ _Fwd_list_base<_Tp, _Alloc>::
+ _M_insert_after(const_iterator __pos, _Args&&... __args)
+ {
+ typename _Node_base::_Pointer __to
+ = __const_pointer_cast<typename _Node_base::_Pointer>
+ (__pos._M_node);
+ typename _Node::_Pointer __thing
+ = __static_pointer_cast<typename _Node::_Pointer>(
+ _M_create_node(std::forward<_Args>(__args)...) );
+ __thing->_M_next = __to->_M_next;
+ __to->_M_next = __thing;
+ return __static_pointer_cast<typename _Node_base::_Pointer>
+ (__to->_M_next);
+ }
+
+ template<typename _Tp, typename _Alloc>
+ typename _Fwd_list_base<_Tp, _Alloc>::_Node_base::_Pointer
+ _Fwd_list_base<_Tp, _Alloc>::
+ _M_erase_after(typename _Node_base::_Pointer __pos)
+ {
+ typename _Node::_Pointer __curr
+ = __static_pointer_cast<typename _Node::_Pointer>(__pos->_M_next);
+ if (__curr)
+ {
+ typename _Node_base::_Pointer __next = __curr->_M_next;
+ __pos->_M_next = __next;
+ _M_get_Node_allocator().destroy(__curr);
+ _M_put_node(__curr);
+ }
+ return __pos;
+ }
+
+ template<typename _Tp, typename _Alloc>
+ typename _Fwd_list_base<_Tp, _Alloc>::_Node_base::_Pointer
+ _Fwd_list_base<_Tp, _Alloc>::
+ _M_erase_after(typename _Node_base::_Pointer __pos,
+ typename _Node_base::_Pointer __last)
+ {
+ typename _Node::_Pointer __curr
+ = __static_pointer_cast<typename _Node::_Pointer>(__pos->_M_next);
+ while (__curr)
+ {
+ typename _Node::_Pointer __temp = __curr;
+ __curr = __static_pointer_cast<typename _Node::_Pointer>
+ (__curr->_M_next);
+ _M_get_Node_allocator().destroy(__temp);
+ _M_put_node(__temp);
+ __pos->_M_next = __curr;
+ if (__temp == __last)
+ break;
+ }
+ return __pos;
+ }
+
+ // Called by the range constructor to implement [23.1.1]/9
+ template<typename _Tp, typename _Alloc>
+ template<typename _InputIterator>
+ void
+ forward_list<_Tp, _Alloc>::
+ _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type)
+ {
+ typename _Node_base::_Pointer __to = &this->_M_impl._M_head;
+ for (; __first != __last; ++__first)
+ {
+ __to->_M_next = this->_M_create_node(*__first);
+ __to = __to->_M_next;
+ }
+ }
+
+ // Called by forward_list(n,v,a), and the range constructor
+ // when it turns out to be the same thing.
+ template<typename _Tp, typename _Alloc>
+ void
+ forward_list<_Tp, _Alloc>::
+ _M_fill_initialize(size_type __n, const value_type& __value)
+ {
+ typename _Node_base::_Pointer __to = &this->_M_impl._M_head;
+ for (; __n > 0; --__n)
+ {
+ __to->_M_next = this->_M_create_node(__value);
+ __to = __to->_M_next;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ forward_list<_Tp, _Alloc>&
+ forward_list<_Tp, _Alloc>::
+ operator=(const forward_list& __list)
+ {
+ if (&__list != this)
+ {
+ iterator __prev1 = before_begin();
+ iterator __curr1 = begin();
+ iterator __last1 = end();
+ const_iterator __first2 = __list.cbegin();
+ const_iterator __last2 = __list.cend();
+ while (__curr1 != __last1 && __first2 != __last2)
+ {
+ *__curr1 = *__first2;
+ ++__prev1;
+ ++__curr1;
+ ++__first2;
+ }
+ if (__first2 == __last2)
+ erase_after(__prev1, __last1);
+ else
+ insert_after(__prev1, __first2, __last2);
+ }
+ return *this;
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ forward_list<_Tp, _Alloc>::
+ resize(size_type __sz, value_type __val)
+ {
+ iterator __k = before_begin();
+
+ size_type __len = 0;
+ while (__k._M_next() != end() && __len < __sz)
+ {
+ ++__k;
+ ++__len;
+ }
+ if (__len == __sz)
+ erase_after(__k, end());
+ else
+ insert_after(__k, __sz - __len, __val);
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ forward_list<_Tp, _Alloc>::
+ splice_after(const_iterator __pos, forward_list&& __list)
+ {
+ if (!__list.empty() && &__list != this)
+ {
+ typename _Node_base::_Pointer __tmp
+ = __const_pointer_cast<typename _Node_base::_Pointer>
+ (__pos._M_node);
+ const_iterator __before = __list.cbefore_begin();
+ __tmp->_M_transfer_after(__const_pointer_cast
+ <typename _Node_base::_Pointer>
+ (__before._M_node));
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ forward_list<_Tp, _Alloc>::
+ splice_after(const_iterator __pos, forward_list&& __list,
+ const_iterator __before, const_iterator __last)
+ {
+ typename _Node_base::_Pointer __tmp
+ = __const_pointer_cast<typename _Node_base::_Pointer>(__pos._M_node);
+ __tmp->_M_transfer_after(__const_pointer_cast
+ <typename _Node_base::_Pointer>
+ (__before._M_node),
+ __const_pointer_cast
+ <typename _Node_base::_Pointer>
+ (__last._M_node));
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ forward_list<_Tp, _Alloc>::
+ remove(const _Tp& __val)
+ {
+ typename _Node::_Pointer __curr
+ = __static_pointer_cast<typename _Node::_Pointer>
+ (&this->_M_impl._M_head);
+ while (typename _Node::_Pointer __temp =
+ __static_pointer_cast<typename _Node::_Pointer>(__curr->_M_next))
+ {
+ if (__temp->_M_value == __val)
+ this->_M_erase_after(__curr);
+ else
+ __curr = __static_pointer_cast<typename _Node::_Pointer>
+ (__curr->_M_next);
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename _Pred>
+ void
+ forward_list<_Tp, _Alloc>::
+ remove_if(_Pred __pred)
+ {
+ typename _Node::_Pointer __curr
+ = __static_pointer_cast<typename _Node::_Pointer>
+ (&this->_M_impl._M_head);
+ while (typename _Node::_Pointer __temp =
+ __static_pointer_cast<typename _Node::_Pointer>(__curr->_M_next))
+ {
+ if (__pred(__temp->_M_value))
+ this->_M_erase_after(__curr);
+ else
+ __curr = __static_pointer_cast<typename _Node::_Pointer>
+ (__curr->_M_next);
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename _BinPred>
+ void
+ forward_list<_Tp, _Alloc>::
+ unique(_BinPred __binary_pred)
+ {
+ iterator __first = begin();
+ iterator __last = end();
+ if (__first == __last)
+ return;
+ iterator __next = __first;
+ while (++__next != __last)
+ {
+ if (__binary_pred(*__first, *__next))
+ erase_after(__first);
+ else
+ __first = __next;
+ __next = __first;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename _Comp>
+ void
+ forward_list<_Tp, _Alloc>::
+ merge(forward_list&& __list, _Comp __comp)
+ {
+ typename _Node_base::_Pointer __node = &this->_M_impl._M_head;
+ while (__node->_M_next && __list._M_impl._M_head._M_next)
+ {
+ if (__comp(__static_pointer_cast<typename _Node::_Pointer>
+ (__list._M_impl._M_head._M_next)->_M_value,
+ __static_pointer_cast<typename _Node::_Pointer>
+ (__node->_M_next)->_M_value))
+ __node->_M_transfer_after(&__list._M_impl._M_head,
+ __list._M_impl._M_head._M_next);
+ __node = __node->_M_next;
+ }
+ if (__list._M_impl._M_head._M_next)
+ {
+ __node->_M_next = __list._M_impl._M_head._M_next;
+ __list._M_impl._M_head._M_next = 0;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ bool
+ operator==(const forward_list<_Tp, _Alloc>& __lx,
+ const forward_list<_Tp, _Alloc>& __ly)
+ {
+ // We don't have size() so we need to walk through both lists
+ // making sure both iterators are valid.
+ auto __ix = __lx.cbegin();
+ auto __iy = __ly.cbegin();
+ while (__ix != __lx.cend() && __iy != __ly.cend())
+ {
+ if (*__ix != *__iy)
+ return false;
+ ++__ix;
+ ++__iy;
+ }
+ if (__ix == __lx.cend() && __iy == __ly.cend())
+ return true;
+ else
+ return false;
+ }
+
+_GLIBCXX_END_NAMESPACE // namespace std
+
+#endif /* _FORWARD_LIST_TCC */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/fstream.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/fstream.tcc
new file mode 100644
index 0000000..c5f7f8c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/fstream.tcc
@@ -0,0 +1,926 @@
+// File based streams -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+// 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file fstream.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 27.8 File-based streams
+//
+
+#ifndef _FSTREAM_TCC
+#define _FSTREAM_TCC 1
+
+#pragma GCC system_header
+
+#include <cxxabi-forced.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, typename _Traits>
+ void
+ basic_filebuf<_CharT, _Traits>::
+ _M_allocate_internal_buffer()
+ {
+ // Allocate internal buffer only if one doesn't already exist
+ // (either allocated or provided by the user via setbuf).
+ if (!_M_buf_allocated && !_M_buf)
+ {
+ _M_buf = new char_type[_M_buf_size];
+ _M_buf_allocated = true;
+ }
+ }
+
+ template<typename _CharT, typename _Traits>
+ void
+ basic_filebuf<_CharT, _Traits>::
+ _M_destroy_internal_buffer() throw()
+ {
+ if (_M_buf_allocated)
+ {
+ delete [] _M_buf;
+ _M_buf = NULL;
+ _M_buf_allocated = false;
+ }
+ delete [] _M_ext_buf;
+ _M_ext_buf = NULL;
+ _M_ext_buf_size = 0;
+ _M_ext_next = NULL;
+ _M_ext_end = NULL;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_filebuf<_CharT, _Traits>::
+ basic_filebuf() : __streambuf_type(), _M_lock(), _M_file(&_M_lock),
+ _M_mode(ios_base::openmode(0)), _M_state_beg(), _M_state_cur(),
+ _M_state_last(), _M_buf(NULL), _M_buf_size(BUFSIZ),
+ _M_buf_allocated(false), _M_reading(false), _M_writing(false), _M_pback(),
+ _M_pback_cur_save(0), _M_pback_end_save(0), _M_pback_init(false),
+ _M_codecvt(0), _M_ext_buf(0), _M_ext_buf_size(0), _M_ext_next(0),
+ _M_ext_end(0)
+ {
+ if (has_facet<__codecvt_type>(this->_M_buf_locale))
+ _M_codecvt = &use_facet<__codecvt_type>(this->_M_buf_locale);
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_filebuf<_CharT, _Traits>::__filebuf_type*
+ basic_filebuf<_CharT, _Traits>::
+ open(const char* __s, ios_base::openmode __mode)
+ {
+ __filebuf_type *__ret = NULL;
+ if (!this->is_open())
+ {
+ _M_file.open(__s, __mode);
+ if (this->is_open())
+ {
+ _M_allocate_internal_buffer();
+ _M_mode = __mode;
+
+ // Setup initial buffer to 'uncommitted' mode.
+ _M_reading = false;
+ _M_writing = false;
+ _M_set_buffer(-1);
+
+ // Reset to initial state.
+ _M_state_last = _M_state_cur = _M_state_beg;
+
+ // 27.8.1.3,4
+ if ((__mode & ios_base::ate)
+ && this->seekoff(0, ios_base::end, __mode)
+ == pos_type(off_type(-1)))
+ this->close();
+ else
+ __ret = this;
+ }
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_filebuf<_CharT, _Traits>::__filebuf_type*
+ basic_filebuf<_CharT, _Traits>::
+ close()
+ {
+ if (!this->is_open())
+ return NULL;
+
+ bool __testfail = false;
+ {
+ // NB: Do this here so that re-opened filebufs will be cool...
+ struct __close_sentry
+ {
+ basic_filebuf *__fb;
+ __close_sentry (basic_filebuf *__fbi): __fb(__fbi) { }
+ ~__close_sentry ()
+ {
+ __fb->_M_mode = ios_base::openmode(0);
+ __fb->_M_pback_init = false;
+ __fb->_M_destroy_internal_buffer();
+ __fb->_M_reading = false;
+ __fb->_M_writing = false;
+ __fb->_M_set_buffer(-1);
+ __fb->_M_state_last = __fb->_M_state_cur = __fb->_M_state_beg;
+ }
+ } __cs (this);
+
+ __try
+ {
+ if (!_M_terminate_output())
+ __testfail = true;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ _M_file.close();
+ __throw_exception_again;
+ }
+ __catch(...)
+ { __testfail = true; }
+ }
+
+ if (!_M_file.close())
+ __testfail = true;
+
+ if (__testfail)
+ return NULL;
+ else
+ return this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ streamsize
+ basic_filebuf<_CharT, _Traits>::
+ showmanyc()
+ {
+ streamsize __ret = -1;
+ const bool __testin = _M_mode & ios_base::in;
+ if (__testin && this->is_open())
+ {
+ // For a stateful encoding (-1) the pending sequence might be just
+ // shift and unshift prefixes with no actual character.
+ __ret = this->egptr() - this->gptr();
+
+#if _GLIBCXX_HAVE_DOS_BASED_FILESYSTEM
+ // About this workaround, see libstdc++/20806.
+ const bool __testbinary = _M_mode & ios_base::binary;
+ if (__check_facet(_M_codecvt).encoding() >= 0
+ && __testbinary)
+#else
+ if (__check_facet(_M_codecvt).encoding() >= 0)
+#endif
+ __ret += _M_file.showmanyc() / _M_codecvt->max_length();
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_filebuf<_CharT, _Traits>::int_type
+ basic_filebuf<_CharT, _Traits>::
+ underflow()
+ {
+ int_type __ret = traits_type::eof();
+ const bool __testin = _M_mode & ios_base::in;
+ if (__testin && !_M_writing)
+ {
+ // Check for pback madness, and if so switch back to the
+ // normal buffers and jet outta here before expensive
+ // fileops happen...
+ _M_destroy_pback();
+
+ if (this->gptr() < this->egptr())
+ return traits_type::to_int_type(*this->gptr());
+
+ // Get and convert input sequence.
+ const size_t __buflen = _M_buf_size > 1 ? _M_buf_size - 1 : 1;
+
+ // Will be set to true if ::read() returns 0 indicating EOF.
+ bool __got_eof = false;
+ // Number of internal characters produced.
+ streamsize __ilen = 0;
+ codecvt_base::result __r = codecvt_base::ok;
+ if (__check_facet(_M_codecvt).always_noconv())
+ {
+ __ilen = _M_file.xsgetn(reinterpret_cast<char*>(this->eback()),
+ __buflen);
+ if (__ilen == 0)
+ __got_eof = true;
+ }
+ else
+ {
+ // Worst-case number of external bytes.
+ // XXX Not done encoding() == -1.
+ const int __enc = _M_codecvt->encoding();
+ streamsize __blen; // Minimum buffer size.
+ streamsize __rlen; // Number of chars to read.
+ if (__enc > 0)
+ __blen = __rlen = __buflen * __enc;
+ else
+ {
+ __blen = __buflen + _M_codecvt->max_length() - 1;
+ __rlen = __buflen;
+ }
+ const streamsize __remainder = _M_ext_end - _M_ext_next;
+ __rlen = __rlen > __remainder ? __rlen - __remainder : 0;
+
+ // An imbue in 'read' mode implies first converting the external
+ // chars already present.
+ if (_M_reading && this->egptr() == this->eback() && __remainder)
+ __rlen = 0;
+
+ // Allocate buffer if necessary and move unconverted
+ // bytes to front.
+ if (_M_ext_buf_size < __blen)
+ {
+ char* __buf = new char[__blen];
+ if (__remainder)
+ __builtin_memcpy(__buf, _M_ext_next, __remainder);
+
+ delete [] _M_ext_buf;
+ _M_ext_buf = __buf;
+ _M_ext_buf_size = __blen;
+ }
+ else if (__remainder)
+ __builtin_memmove(_M_ext_buf, _M_ext_next, __remainder);
+
+ _M_ext_next = _M_ext_buf;
+ _M_ext_end = _M_ext_buf + __remainder;
+ _M_state_last = _M_state_cur;
+
+ do
+ {
+ if (__rlen > 0)
+ {
+ // Sanity check!
+ // This may fail if the return value of
+ // codecvt::max_length() is bogus.
+ if (_M_ext_end - _M_ext_buf + __rlen > _M_ext_buf_size)
+ {
+ __throw_ios_failure(__N("basic_filebuf::underflow "
+ "codecvt::max_length() "
+ "is not valid"));
+ }
+ streamsize __elen = _M_file.xsgetn(_M_ext_end, __rlen);
+ if (__elen == 0)
+ __got_eof = true;
+ else if (__elen == -1)
+ break;
+ _M_ext_end += __elen;
+ }
+
+ char_type* __iend = this->eback();
+ if (_M_ext_next < _M_ext_end)
+ __r = _M_codecvt->in(_M_state_cur, _M_ext_next,
+ _M_ext_end, _M_ext_next,
+ this->eback(),
+ this->eback() + __buflen, __iend);
+ if (__r == codecvt_base::noconv)
+ {
+ size_t __avail = _M_ext_end - _M_ext_buf;
+ __ilen = std::min(__avail, __buflen);
+ traits_type::copy(this->eback(),
+ reinterpret_cast<char_type*>
+ (_M_ext_buf), __ilen);
+ _M_ext_next = _M_ext_buf + __ilen;
+ }
+ else
+ __ilen = __iend - this->eback();
+
+ // _M_codecvt->in may return error while __ilen > 0: this is
+ // ok, and actually occurs in case of mixed encodings (e.g.,
+ // XML files).
+ if (__r == codecvt_base::error)
+ break;
+
+ __rlen = 1;
+ }
+ while (__ilen == 0 && !__got_eof);
+ }
+
+ if (__ilen > 0)
+ {
+ _M_set_buffer(__ilen);
+ _M_reading = true;
+ __ret = traits_type::to_int_type(*this->gptr());
+ }
+ else if (__got_eof)
+ {
+ // If the actual end of file is reached, set 'uncommitted'
+ // mode, thus allowing an immediate write without an
+ // intervening seek.
+ _M_set_buffer(-1);
+ _M_reading = false;
+ // However, reaching it while looping on partial means that
+ // the file has got an incomplete character.
+ if (__r == codecvt_base::partial)
+ __throw_ios_failure(__N("basic_filebuf::underflow "
+ "incomplete character in file"));
+ }
+ else if (__r == codecvt_base::error)
+ __throw_ios_failure(__N("basic_filebuf::underflow "
+ "invalid byte sequence in file"));
+ else
+ __throw_ios_failure(__N("basic_filebuf::underflow "
+ "error reading the file"));
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_filebuf<_CharT, _Traits>::int_type
+ basic_filebuf<_CharT, _Traits>::
+ pbackfail(int_type __i)
+ {
+ int_type __ret = traits_type::eof();
+ const bool __testin = _M_mode & ios_base::in;
+ if (__testin && !_M_writing)
+ {
+ // Remember whether the pback buffer is active, otherwise below
+ // we may try to store in it a second char (libstdc++/9761).
+ const bool __testpb = _M_pback_init;
+ const bool __testeof = traits_type::eq_int_type(__i, __ret);
+ int_type __tmp;
+ if (this->eback() < this->gptr())
+ {
+ this->gbump(-1);
+ __tmp = traits_type::to_int_type(*this->gptr());
+ }
+ else if (this->seekoff(-1, ios_base::cur) != pos_type(off_type(-1)))
+ {
+ __tmp = this->underflow();
+ if (traits_type::eq_int_type(__tmp, __ret))
+ return __ret;
+ }
+ else
+ {
+ // At the beginning of the buffer, need to make a
+ // putback position available. But the seek may fail
+ // (f.i., at the beginning of a file, see
+ // libstdc++/9439) and in that case we return
+ // traits_type::eof().
+ return __ret;
+ }
+
+ // Try to put back __i into input sequence in one of three ways.
+ // Order these tests done in is unspecified by the standard.
+ if (!__testeof && traits_type::eq_int_type(__i, __tmp))
+ __ret = __i;
+ else if (__testeof)
+ __ret = traits_type::not_eof(__i);
+ else if (!__testpb)
+ {
+ _M_create_pback();
+ _M_reading = true;
+ *this->gptr() = traits_type::to_char_type(__i);
+ __ret = __i;
+ }
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_filebuf<_CharT, _Traits>::int_type
+ basic_filebuf<_CharT, _Traits>::
+ overflow(int_type __c)
+ {
+ int_type __ret = traits_type::eof();
+ const bool __testeof = traits_type::eq_int_type(__c, __ret);
+ const bool __testout = _M_mode & ios_base::out;
+ if (__testout && !_M_reading)
+ {
+ if (this->pbase() < this->pptr())
+ {
+ // If appropriate, append the overflow char.
+ if (!__testeof)
+ {
+ *this->pptr() = traits_type::to_char_type(__c);
+ this->pbump(1);
+ }
+
+ // Convert pending sequence to external representation,
+ // and output.
+ if (_M_convert_to_external(this->pbase(),
+ this->pptr() - this->pbase()))
+ {
+ _M_set_buffer(0);
+ __ret = traits_type::not_eof(__c);
+ }
+ }
+ else if (_M_buf_size > 1)
+ {
+ // Overflow in 'uncommitted' mode: set _M_writing, set
+ // the buffer to the initial 'write' mode, and put __c
+ // into the buffer.
+ _M_set_buffer(0);
+ _M_writing = true;
+ if (!__testeof)
+ {
+ *this->pptr() = traits_type::to_char_type(__c);
+ this->pbump(1);
+ }
+ __ret = traits_type::not_eof(__c);
+ }
+ else
+ {
+ // Unbuffered.
+ char_type __conv = traits_type::to_char_type(__c);
+ if (__testeof || _M_convert_to_external(&__conv, 1))
+ {
+ _M_writing = true;
+ __ret = traits_type::not_eof(__c);
+ }
+ }
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ bool
+ basic_filebuf<_CharT, _Traits>::
+ _M_convert_to_external(_CharT* __ibuf, streamsize __ilen)
+ {
+ // Sizes of external and pending output.
+ streamsize __elen;
+ streamsize __plen;
+ if (__check_facet(_M_codecvt).always_noconv())
+ {
+ __elen = _M_file.xsputn(reinterpret_cast<char*>(__ibuf), __ilen);
+ __plen = __ilen;
+ }
+ else
+ {
+ // Worst-case number of external bytes needed.
+ // XXX Not done encoding() == -1.
+ streamsize __blen = __ilen * _M_codecvt->max_length();
+ char* __buf = static_cast<char*>(__builtin_alloca(__blen));
+
+ char* __bend;
+ const char_type* __iend;
+ codecvt_base::result __r;
+ __r = _M_codecvt->out(_M_state_cur, __ibuf, __ibuf + __ilen,
+ __iend, __buf, __buf + __blen, __bend);
+
+ if (__r == codecvt_base::ok || __r == codecvt_base::partial)
+ __blen = __bend - __buf;
+ else if (__r == codecvt_base::noconv)
+ {
+ // Same as the always_noconv case above.
+ __buf = reinterpret_cast<char*>(__ibuf);
+ __blen = __ilen;
+ }
+ else
+ __throw_ios_failure(__N("basic_filebuf::_M_convert_to_external "
+ "conversion error"));
+
+ __elen = _M_file.xsputn(__buf, __blen);
+ __plen = __blen;
+
+ // Try once more for partial conversions.
+ if (__r == codecvt_base::partial && __elen == __plen)
+ {
+ const char_type* __iresume = __iend;
+ streamsize __rlen = this->pptr() - __iend;
+ __r = _M_codecvt->out(_M_state_cur, __iresume,
+ __iresume + __rlen, __iend, __buf,
+ __buf + __blen, __bend);
+ if (__r != codecvt_base::error)
+ {
+ __rlen = __bend - __buf;
+ __elen = _M_file.xsputn(__buf, __rlen);
+ __plen = __rlen;
+ }
+ else
+ __throw_ios_failure(__N("basic_filebuf::_M_convert_to_external "
+ "conversion error"));
+ }
+ }
+ return __elen == __plen;
+ }
+
+ template<typename _CharT, typename _Traits>
+ streamsize
+ basic_filebuf<_CharT, _Traits>::
+ xsgetn(_CharT* __s, streamsize __n)
+ {
+ // Clear out pback buffer before going on to the real deal...
+ streamsize __ret = 0;
+ if (_M_pback_init)
+ {
+ if (__n > 0 && this->gptr() == this->eback())
+ {
+ *__s++ = *this->gptr();
+ this->gbump(1);
+ __ret = 1;
+ --__n;
+ }
+ _M_destroy_pback();
+ }
+
+ // Optimization in the always_noconv() case, to be generalized in the
+ // future: when __n > __buflen we read directly instead of using the
+ // buffer repeatedly.
+ const bool __testin = _M_mode & ios_base::in;
+ const streamsize __buflen = _M_buf_size > 1 ? _M_buf_size - 1 : 1;
+
+ if (__n > __buflen && __check_facet(_M_codecvt).always_noconv()
+ && __testin && !_M_writing)
+ {
+ // First, copy the chars already present in the buffer.
+ const streamsize __avail = this->egptr() - this->gptr();
+ if (__avail != 0)
+ {
+ if (__avail == 1)
+ *__s = *this->gptr();
+ else
+ traits_type::copy(__s, this->gptr(), __avail);
+ __s += __avail;
+ this->gbump(__avail);
+ __ret += __avail;
+ __n -= __avail;
+ }
+
+ // Need to loop in case of short reads (relatively common
+ // with pipes).
+ streamsize __len;
+ for (;;)
+ {
+ __len = _M_file.xsgetn(reinterpret_cast<char*>(__s),
+ __n);
+ if (__len == -1)
+ __throw_ios_failure(__N("basic_filebuf::xsgetn "
+ "error reading the file"));
+ if (__len == 0)
+ break;
+
+ __n -= __len;
+ __ret += __len;
+ if (__n == 0)
+ break;
+
+ __s += __len;
+ }
+
+ if (__n == 0)
+ {
+ _M_set_buffer(0);
+ _M_reading = true;
+ }
+ else if (__len == 0)
+ {
+ // If end of file is reached, set 'uncommitted'
+ // mode, thus allowing an immediate write without
+ // an intervening seek.
+ _M_set_buffer(-1);
+ _M_reading = false;
+ }
+ }
+ else
+ __ret += __streambuf_type::xsgetn(__s, __n);
+
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ streamsize
+ basic_filebuf<_CharT, _Traits>::
+ xsputn(const _CharT* __s, streamsize __n)
+ {
+ // Optimization in the always_noconv() case, to be generalized in the
+ // future: when __n is sufficiently large we write directly instead of
+ // using the buffer.
+ streamsize __ret = 0;
+ const bool __testout = _M_mode & ios_base::out;
+ if (__check_facet(_M_codecvt).always_noconv()
+ && __testout && !_M_reading)
+ {
+ // Measurement would reveal the best choice.
+ const streamsize __chunk = 1ul << 10;
+ streamsize __bufavail = this->epptr() - this->pptr();
+
+ // Don't mistake 'uncommitted' mode buffered with unbuffered.
+ if (!_M_writing && _M_buf_size > 1)
+ __bufavail = _M_buf_size - 1;
+
+ const streamsize __limit = std::min(__chunk, __bufavail);
+ if (__n >= __limit)
+ {
+ const streamsize __buffill = this->pptr() - this->pbase();
+ const char* __buf = reinterpret_cast<const char*>(this->pbase());
+ __ret = _M_file.xsputn_2(__buf, __buffill,
+ reinterpret_cast<const char*>(__s),
+ __n);
+ if (__ret == __buffill + __n)
+ {
+ _M_set_buffer(0);
+ _M_writing = true;
+ }
+ if (__ret > __buffill)
+ __ret -= __buffill;
+ else
+ __ret = 0;
+ }
+ else
+ __ret = __streambuf_type::xsputn(__s, __n);
+ }
+ else
+ __ret = __streambuf_type::xsputn(__s, __n);
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_filebuf<_CharT, _Traits>::__streambuf_type*
+ basic_filebuf<_CharT, _Traits>::
+ setbuf(char_type* __s, streamsize __n)
+ {
+ if (!this->is_open())
+ {
+ if (__s == 0 && __n == 0)
+ _M_buf_size = 1;
+ else if (__s && __n > 0)
+ {
+ // This is implementation-defined behavior, and assumes that
+ // an external char_type array of length __n exists and has
+ // been pre-allocated. If this is not the case, things will
+ // quickly blow up. When __n > 1, __n - 1 positions will be
+ // used for the get area, __n - 1 for the put area and 1
+ // position to host the overflow char of a full put area.
+ // When __n == 1, 1 position will be used for the get area
+ // and 0 for the put area, as in the unbuffered case above.
+ _M_buf = __s;
+ _M_buf_size = __n;
+ }
+ }
+ return this;
+ }
+
+
+ // According to 27.8.1.4 p11 - 13, seekoff should ignore the last
+ // argument (of type openmode).
+ template<typename _CharT, typename _Traits>
+ typename basic_filebuf<_CharT, _Traits>::pos_type
+ basic_filebuf<_CharT, _Traits>::
+ seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode)
+ {
+ int __width = 0;
+ if (_M_codecvt)
+ __width = _M_codecvt->encoding();
+ if (__width < 0)
+ __width = 0;
+
+ pos_type __ret = pos_type(off_type(-1));
+ const bool __testfail = __off != 0 && __width <= 0;
+ if (this->is_open() && !__testfail)
+ {
+ // Ditch any pback buffers to avoid confusion.
+ _M_destroy_pback();
+
+ // Correct state at destination. Note that this is the correct
+ // state for the current position during output, because
+ // codecvt::unshift() returns the state to the initial state.
+ // This is also the correct state at the end of the file because
+ // an unshift sequence should have been written at the end.
+ __state_type __state = _M_state_beg;
+ off_type __computed_off = __off * __width;
+ if (_M_reading && __way == ios_base::cur)
+ {
+ if (_M_codecvt->always_noconv())
+ __computed_off += this->gptr() - this->egptr();
+ else
+ {
+ // Calculate offset from _M_ext_buf that corresponds
+ // to gptr(). Note: uses _M_state_last, which
+ // corresponds to eback().
+ const int __gptr_off =
+ _M_codecvt->length(_M_state_last, _M_ext_buf, _M_ext_next,
+ this->gptr() - this->eback());
+ __computed_off += _M_ext_buf + __gptr_off - _M_ext_end;
+
+ // _M_state_last is modified by codecvt::length() so
+ // it now corresponds to gptr().
+ __state = _M_state_last;
+ }
+ }
+ __ret = _M_seek(__computed_off, __way, __state);
+ }
+ return __ret;
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 171. Strange seekpos() semantics due to joint position
+ // According to the resolution of DR 171, seekpos should ignore the last
+ // argument (of type openmode).
+ template<typename _CharT, typename _Traits>
+ typename basic_filebuf<_CharT, _Traits>::pos_type
+ basic_filebuf<_CharT, _Traits>::
+ seekpos(pos_type __pos, ios_base::openmode)
+ {
+ pos_type __ret = pos_type(off_type(-1));
+ if (this->is_open())
+ {
+ // Ditch any pback buffers to avoid confusion.
+ _M_destroy_pback();
+ __ret = _M_seek(off_type(__pos), ios_base::beg, __pos.state());
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_filebuf<_CharT, _Traits>::pos_type
+ basic_filebuf<_CharT, _Traits>::
+ _M_seek(off_type __off, ios_base::seekdir __way, __state_type __state)
+ {
+ pos_type __ret = pos_type(off_type(-1));
+ if (_M_terminate_output())
+ {
+ // Returns pos_type(off_type(-1)) in case of failure.
+ __ret = pos_type(_M_file.seekoff(__off, __way));
+ if (__ret != pos_type(off_type(-1)))
+ {
+ _M_reading = false;
+ _M_writing = false;
+ _M_ext_next = _M_ext_end = _M_ext_buf;
+ _M_set_buffer(-1);
+ _M_state_cur = __state;
+ __ret.state(_M_state_cur);
+ }
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ bool
+ basic_filebuf<_CharT, _Traits>::
+ _M_terminate_output()
+ {
+ // Part one: update the output sequence.
+ bool __testvalid = true;
+ if (this->pbase() < this->pptr())
+ {
+ const int_type __tmp = this->overflow();
+ if (traits_type::eq_int_type(__tmp, traits_type::eof()))
+ __testvalid = false;
+ }
+
+ // Part two: output unshift sequence.
+ if (_M_writing && !__check_facet(_M_codecvt).always_noconv()
+ && __testvalid)
+ {
+ // Note: this value is arbitrary, since there is no way to
+ // get the length of the unshift sequence from codecvt,
+ // without calling unshift.
+ const size_t __blen = 128;
+ char __buf[__blen];
+ codecvt_base::result __r;
+ streamsize __ilen = 0;
+
+ do
+ {
+ char* __next;
+ __r = _M_codecvt->unshift(_M_state_cur, __buf,
+ __buf + __blen, __next);
+ if (__r == codecvt_base::error)
+ __testvalid = false;
+ else if (__r == codecvt_base::ok ||
+ __r == codecvt_base::partial)
+ {
+ __ilen = __next - __buf;
+ if (__ilen > 0)
+ {
+ const streamsize __elen = _M_file.xsputn(__buf, __ilen);
+ if (__elen != __ilen)
+ __testvalid = false;
+ }
+ }
+ }
+ while (__r == codecvt_base::partial && __ilen > 0 && __testvalid);
+
+ if (__testvalid)
+ {
+ // This second call to overflow() is required by the standard,
+ // but it's not clear why it's needed, since the output buffer
+ // should be empty by this point (it should have been emptied
+ // in the first call to overflow()).
+ const int_type __tmp = this->overflow();
+ if (traits_type::eq_int_type(__tmp, traits_type::eof()))
+ __testvalid = false;
+ }
+ }
+ return __testvalid;
+ }
+
+ template<typename _CharT, typename _Traits>
+ int
+ basic_filebuf<_CharT, _Traits>::
+ sync()
+ {
+ // Make sure that the internal buffer resyncs its idea of
+ // the file position with the external file.
+ int __ret = 0;
+ if (this->pbase() < this->pptr())
+ {
+ const int_type __tmp = this->overflow();
+ if (traits_type::eq_int_type(__tmp, traits_type::eof()))
+ __ret = -1;
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ void
+ basic_filebuf<_CharT, _Traits>::
+ imbue(const locale& __loc)
+ {
+ bool __testvalid = true;
+
+ const __codecvt_type* _M_codecvt_tmp = 0;
+ if (__builtin_expect(has_facet<__codecvt_type>(__loc), true))
+ _M_codecvt_tmp = &use_facet<__codecvt_type>(__loc);
+
+ if (this->is_open())
+ {
+ // encoding() == -1 is ok only at the beginning.
+ if ((_M_reading || _M_writing)
+ && __check_facet(_M_codecvt).encoding() == -1)
+ __testvalid = false;
+ else
+ {
+ if (_M_reading)
+ {
+ if (__check_facet(_M_codecvt).always_noconv())
+ {
+ if (_M_codecvt_tmp
+ && !__check_facet(_M_codecvt_tmp).always_noconv())
+ __testvalid = this->seekoff(0, ios_base::cur, _M_mode)
+ != pos_type(off_type(-1));
+ }
+ else
+ {
+ // External position corresponding to gptr().
+ _M_ext_next = _M_ext_buf
+ + _M_codecvt->length(_M_state_last, _M_ext_buf, _M_ext_next,
+ this->gptr() - this->eback());
+ const streamsize __remainder = _M_ext_end - _M_ext_next;
+ if (__remainder)
+ __builtin_memmove(_M_ext_buf, _M_ext_next, __remainder);
+
+ _M_ext_next = _M_ext_buf;
+ _M_ext_end = _M_ext_buf + __remainder;
+ _M_set_buffer(-1);
+ _M_state_last = _M_state_cur = _M_state_beg;
+ }
+ }
+ else if (_M_writing && (__testvalid = _M_terminate_output()))
+ _M_set_buffer(-1);
+ }
+ }
+
+ if (__testvalid)
+ _M_codecvt = _M_codecvt_tmp;
+ else
+ _M_codecvt = 0;
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class basic_filebuf<char>;
+ extern template class basic_ifstream<char>;
+ extern template class basic_ofstream<char>;
+ extern template class basic_fstream<char>;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class basic_filebuf<wchar_t>;
+ extern template class basic_ifstream<wchar_t>;
+ extern template class basic_ofstream<wchar_t>;
+ extern template class basic_fstream<wchar_t>;
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/functexcept.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/functexcept.h
new file mode 100644
index 0000000..9315d34
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/functexcept.h
@@ -0,0 +1,93 @@
+// Function-Based Exception Support -*- C++ -*-
+
+// Copyright (C) 2001, 2004, 2005, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file functexcept.h
+ * This header provides support for -fno-exceptions.
+ */
+
+//
+// ISO C++ 14882: 19.1 Exception classes
+//
+
+#ifndef _FUNCTEXCEPT_H
+#define _FUNCTEXCEPT_H 1
+
+#include <bits/c++config.h>
+#include <exception_defines.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Helper for exception objects in <except>
+ void
+ __throw_bad_exception(void) __attribute__((__noreturn__));
+
+ // Helper for exception objects in <new>
+ void
+ __throw_bad_alloc(void) __attribute__((__noreturn__));
+
+ // Helper for exception objects in <typeinfo>
+ void
+ __throw_bad_cast(void) __attribute__((__noreturn__));
+
+ void
+ __throw_bad_typeid(void) __attribute__((__noreturn__));
+
+ // Helpers for exception objects in <stdexcept>
+ void
+ __throw_logic_error(const char*) __attribute__((__noreturn__));
+
+ void
+ __throw_domain_error(const char*) __attribute__((__noreturn__));
+
+ void
+ __throw_invalid_argument(const char*) __attribute__((__noreturn__));
+
+ void
+ __throw_length_error(const char*) __attribute__((__noreturn__));
+
+ void
+ __throw_out_of_range(const char*) __attribute__((__noreturn__));
+
+ void
+ __throw_runtime_error(const char*) __attribute__((__noreturn__));
+
+ void
+ __throw_range_error(const char*) __attribute__((__noreturn__));
+
+ void
+ __throw_overflow_error(const char*) __attribute__((__noreturn__));
+
+ void
+ __throw_underflow_error(const char*) __attribute__((__noreturn__));
+
+ // Helpers for exception objects in <ios>
+ void
+ __throw_ios_failure(const char*) __attribute__((__noreturn__));
+
+ void
+ __throw_system_error(int) __attribute__((__noreturn__));
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/functional_hash.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/functional_hash.h
new file mode 100644
index 0000000..892fcfa
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/functional_hash.h
@@ -0,0 +1,68 @@
+// functional_hash.h header -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/functional_hash.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _FUNCTIONAL_HASH_H
+#define _FUNCTIONAL_HASH_H 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/functional_hash.h>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/functional_hash.h>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+
+namespace std
+{
+ struct error_code;
+
+ template<>
+ size_t
+ hash<error_code>::operator()(error_code) const;
+}
+
+#endif // _FUNCTIONAL_HASH_H
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/gslice.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/gslice.h
new file mode 100644
index 0000000..29ba46a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/gslice.h
@@ -0,0 +1,182 @@
+// The template and inlines for the -*- C++ -*- gslice class.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004, 2005, 2006, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file gslice.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
+
+#ifndef _GSLICE_H
+#define _GSLICE_H 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @addtogroup numeric_arrays
+ * @{
+ */
+
+ /**
+ * @brief Class defining multi-dimensional subset of an array.
+ *
+ * The slice class represents a multi-dimensional subset of an array,
+ * specified by three parameter sets: start offset, size array, and stride
+ * array. The start offset is the index of the first element of the array
+ * that is part of the subset. The size and stride array describe each
+ * dimension of the slice. Size is the number of elements in that
+ * dimension, and stride is the distance in the array between successive
+ * elements in that dimension. Each dimension's size and stride is taken
+ * to begin at an array element described by the previous dimension. The
+ * size array and stride array must be the same size.
+ *
+ * For example, if you have offset==3, stride[0]==11, size[1]==3,
+ * stride[1]==3, then slice[0,0]==array[3], slice[0,1]==array[6],
+ * slice[0,2]==array[9], slice[1,0]==array[14], slice[1,1]==array[17],
+ * slice[1,2]==array[20].
+ */
+ class gslice
+ {
+ public:
+ /// Construct an empty slice.
+ gslice();
+
+ /**
+ * @brief Construct a slice.
+ *
+ * Constructs a slice with as many dimensions as the length of the @a l
+ * and @a s arrays.
+ *
+ * @param o Offset in array of first element.
+ * @param l Array of dimension lengths.
+ * @param s Array of dimension strides between array elements.
+ */
+ gslice(size_t, const valarray<size_t>&, const valarray<size_t>&);
+
+ // XXX: the IS says the copy-ctor and copy-assignment operators are
+ // synthesized by the compiler but they are just unsuitable
+ // for a ref-counted semantic
+ /// Copy constructor.
+ gslice(const gslice&);
+
+ /// Destructor.
+ ~gslice();
+
+ // XXX: See the note above.
+ /// Assignment operator.
+ gslice& operator=(const gslice&);
+
+ /// Return array offset of first slice element.
+ size_t start() const;
+
+ /// Return array of sizes of slice dimensions.
+ valarray<size_t> size() const;
+
+ /// Return array of array strides for each dimension.
+ valarray<size_t> stride() const;
+
+ private:
+ struct _Indexer
+ {
+ size_t _M_count;
+ size_t _M_start;
+ valarray<size_t> _M_size;
+ valarray<size_t> _M_stride;
+ valarray<size_t> _M_index; // Linear array of referenced indices
+
+ _Indexer()
+ : _M_count(1), _M_start(0), _M_size(), _M_stride(), _M_index() {}
+
+ _Indexer(size_t, const valarray<size_t>&,
+ const valarray<size_t>&);
+
+ void
+ _M_increment_use()
+ { ++_M_count; }
+
+ size_t
+ _M_decrement_use()
+ { return --_M_count; }
+ };
+
+ _Indexer* _M_index;
+
+ template<typename _Tp> friend class valarray;
+ };
+
+ inline size_t
+ gslice::start() const
+ { return _M_index ? _M_index->_M_start : 0; }
+
+ inline valarray<size_t>
+ gslice::size() const
+ { return _M_index ? _M_index->_M_size : valarray<size_t>(); }
+
+ inline valarray<size_t>
+ gslice::stride() const
+ { return _M_index ? _M_index->_M_stride : valarray<size_t>(); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 543. valarray slice default constructor
+ inline
+ gslice::gslice()
+ : _M_index(new gslice::_Indexer()) {}
+
+ inline
+ gslice::gslice(size_t __o, const valarray<size_t>& __l,
+ const valarray<size_t>& __s)
+ : _M_index(new gslice::_Indexer(__o, __l, __s)) {}
+
+ inline
+ gslice::gslice(const gslice& __g)
+ : _M_index(__g._M_index)
+ { if (_M_index) _M_index->_M_increment_use(); }
+
+ inline
+ gslice::~gslice()
+ {
+ if (_M_index && _M_index->_M_decrement_use() == 0)
+ delete _M_index;
+ }
+
+ inline gslice&
+ gslice::operator=(const gslice& __g)
+ {
+ if (__g._M_index)
+ __g._M_index->_M_increment_use();
+ if (_M_index && _M_index->_M_decrement_use() == 0)
+ delete _M_index;
+ _M_index = __g._M_index;
+ return *this;
+ }
+
+ // @} group numeric_arrays
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _GSLICE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/gslice_array.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/gslice_array.h
new file mode 100644
index 0000000..745a5a8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/gslice_array.h
@@ -0,0 +1,216 @@
+// The template and inlines for the -*- C++ -*- gslice_array class.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004, 2005, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file gslice_array.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
+
+#ifndef _GSLICE_ARRAY_H
+#define _GSLICE_ARRAY_H 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @addtogroup numeric_arrays
+ * @{
+ */
+
+ /**
+ * @brief Reference to multi-dimensional subset of an array.
+ *
+ * A gslice_array is a reference to the actual elements of an array
+ * specified by a gslice. The way to get a gslice_array is to call
+ * operator[](gslice) on a valarray. The returned gslice_array then
+ * permits carrying operations out on the referenced subset of elements in
+ * the original valarray. For example, operator+=(valarray) will add
+ * values to the subset of elements in the underlying valarray this
+ * gslice_array refers to.
+ *
+ * @param Tp Element type.
+ */
+ template<typename _Tp>
+ class gslice_array
+ {
+ public:
+ typedef _Tp value_type;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 253. valarray helper functions are almost entirely useless
+
+ /// Copy constructor. Both slices refer to the same underlying array.
+ gslice_array(const gslice_array&);
+
+ /// Assignment operator. Assigns slice elements to corresponding
+ /// elements of @a a.
+ gslice_array& operator=(const gslice_array&);
+
+ /// Assign slice elements to corresponding elements of @a v.
+ void operator=(const valarray<_Tp>&) const;
+ /// Multiply slice elements by corresponding elements of @a v.
+ void operator*=(const valarray<_Tp>&) const;
+ /// Divide slice elements by corresponding elements of @a v.
+ void operator/=(const valarray<_Tp>&) const;
+ /// Modulo slice elements by corresponding elements of @a v.
+ void operator%=(const valarray<_Tp>&) const;
+ /// Add corresponding elements of @a v to slice elements.
+ void operator+=(const valarray<_Tp>&) const;
+ /// Subtract corresponding elements of @a v from slice elements.
+ void operator-=(const valarray<_Tp>&) const;
+ /// Logical xor slice elements with corresponding elements of @a v.
+ void operator^=(const valarray<_Tp>&) const;
+ /// Logical and slice elements with corresponding elements of @a v.
+ void operator&=(const valarray<_Tp>&) const;
+ /// Logical or slice elements with corresponding elements of @a v.
+ void operator|=(const valarray<_Tp>&) const;
+ /// Left shift slice elements by corresponding elements of @a v.
+ void operator<<=(const valarray<_Tp>&) const;
+ /// Right shift slice elements by corresponding elements of @a v.
+ void operator>>=(const valarray<_Tp>&) const;
+ /// Assign all slice elements to @a t.
+ void operator=(const _Tp&) const;
+
+ template<class _Dom>
+ void operator=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator*=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator/=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator%=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator+=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator-=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator^=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator&=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator|=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator<<=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator>>=(const _Expr<_Dom, _Tp>&) const;
+
+ private:
+ _Array<_Tp> _M_array;
+ const valarray<size_t>& _M_index;
+
+ friend class valarray<_Tp>;
+
+ gslice_array(_Array<_Tp>, const valarray<size_t>&);
+
+ // not implemented
+ gslice_array();
+ };
+
+ template<typename _Tp>
+ inline
+ gslice_array<_Tp>::gslice_array(_Array<_Tp> __a,
+ const valarray<size_t>& __i)
+ : _M_array(__a), _M_index(__i) {}
+
+ template<typename _Tp>
+ inline
+ gslice_array<_Tp>::gslice_array(const gslice_array<_Tp>& __a)
+ : _M_array(__a._M_array), _M_index(__a._M_index) {}
+
+ template<typename _Tp>
+ inline gslice_array<_Tp>&
+ gslice_array<_Tp>::operator=(const gslice_array<_Tp>& __a)
+ {
+ std::__valarray_copy(_Array<_Tp>(__a._M_array),
+ _Array<size_t>(__a._M_index), _M_index.size(),
+ _M_array, _Array<size_t>(_M_index));
+ return *this;
+ }
+
+ template<typename _Tp>
+ inline void
+ gslice_array<_Tp>::operator=(const _Tp& __t) const
+ {
+ std::__valarray_fill(_M_array, _Array<size_t>(_M_index),
+ _M_index.size(), __t);
+ }
+
+ template<typename _Tp>
+ inline void
+ gslice_array<_Tp>::operator=(const valarray<_Tp>& __v) const
+ {
+ std::__valarray_copy(_Array<_Tp>(__v), __v.size(),
+ _M_array, _Array<size_t>(_M_index));
+ }
+
+ template<typename _Tp>
+ template<class _Dom>
+ inline void
+ gslice_array<_Tp>::operator=(const _Expr<_Dom, _Tp>& __e) const
+ {
+ std::__valarray_copy (__e, _M_index.size(), _M_array,
+ _Array<size_t>(_M_index));
+ }
+
+#undef _DEFINE_VALARRAY_OPERATOR
+#define _DEFINE_VALARRAY_OPERATOR(_Op, _Name) \
+ template<typename _Tp> \
+ inline void \
+ gslice_array<_Tp>::operator _Op##=(const valarray<_Tp>& __v) const \
+ { \
+ _Array_augmented_##_Name(_M_array, _Array<size_t>(_M_index), \
+ _Array<_Tp>(__v), __v.size()); \
+ } \
+ \
+ template<typename _Tp> \
+ template<class _Dom> \
+ inline void \
+ gslice_array<_Tp>::operator _Op##= (const _Expr<_Dom, _Tp>& __e) const\
+ { \
+ _Array_augmented_##_Name(_M_array, _Array<size_t>(_M_index), __e,\
+ _M_index.size()); \
+ }
+
+_DEFINE_VALARRAY_OPERATOR(*, __multiplies)
+_DEFINE_VALARRAY_OPERATOR(/, __divides)
+_DEFINE_VALARRAY_OPERATOR(%, __modulus)
+_DEFINE_VALARRAY_OPERATOR(+, __plus)
+_DEFINE_VALARRAY_OPERATOR(-, __minus)
+_DEFINE_VALARRAY_OPERATOR(^, __bitwise_xor)
+_DEFINE_VALARRAY_OPERATOR(&, __bitwise_and)
+_DEFINE_VALARRAY_OPERATOR(|, __bitwise_or)
+_DEFINE_VALARRAY_OPERATOR(<<, __shift_left)
+_DEFINE_VALARRAY_OPERATOR(>>, __shift_right)
+
+#undef _DEFINE_VALARRAY_OPERATOR
+
+ // @} group numeric_arrays
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _GSLICE_ARRAY_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/hashtable.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/hashtable.h
new file mode 100644
index 0000000..cdfa8af
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/hashtable.h
@@ -0,0 +1,58 @@
+// hashtable.h header -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/hashtable.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _HASHTABLE_H
+#define _HASHTABLE_H 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/hashtable>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/hashtable>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+#endif // _HASHTABLE_H
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/indirect_array.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/indirect_array.h
new file mode 100644
index 0000000..4920394
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/indirect_array.h
@@ -0,0 +1,210 @@
+// The template and inlines for the -*- C++ -*- indirect_array class.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file indirect_array.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
+
+#ifndef _INDIRECT_ARRAY_H
+#define _INDIRECT_ARRAY_H 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @addtogroup numeric_arrays
+ * @{
+ */
+
+ /**
+ * @brief Reference to arbitrary subset of an array.
+ *
+ * An indirect_array is a reference to the actual elements of an array
+ * specified by an ordered array of indices. The way to get an
+ * indirect_array is to call operator[](valarray<size_t>) on a valarray.
+ * The returned indirect_array then permits carrying operations out on the
+ * referenced subset of elements in the original valarray.
+ *
+ * For example, if an indirect_array is obtained using the array (4,2,0) as
+ * an argument, and then assigned to an array containing (1,2,3), then the
+ * underlying array will have array[0]==3, array[2]==2, and array[4]==1.
+ *
+ * @param Tp Element type.
+ */
+ template <class _Tp>
+ class indirect_array
+ {
+ public:
+ typedef _Tp value_type;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 253. valarray helper functions are almost entirely useless
+
+ /// Copy constructor. Both slices refer to the same underlying array.
+ indirect_array(const indirect_array&);
+
+ /// Assignment operator. Assigns elements to corresponding elements
+ /// of @a a.
+ indirect_array& operator=(const indirect_array&);
+
+ /// Assign slice elements to corresponding elements of @a v.
+ void operator=(const valarray<_Tp>&) const;
+ /// Multiply slice elements by corresponding elements of @a v.
+ void operator*=(const valarray<_Tp>&) const;
+ /// Divide slice elements by corresponding elements of @a v.
+ void operator/=(const valarray<_Tp>&) const;
+ /// Modulo slice elements by corresponding elements of @a v.
+ void operator%=(const valarray<_Tp>&) const;
+ /// Add corresponding elements of @a v to slice elements.
+ void operator+=(const valarray<_Tp>&) const;
+ /// Subtract corresponding elements of @a v from slice elements.
+ void operator-=(const valarray<_Tp>&) const;
+ /// Logical xor slice elements with corresponding elements of @a v.
+ void operator^=(const valarray<_Tp>&) const;
+ /// Logical and slice elements with corresponding elements of @a v.
+ void operator&=(const valarray<_Tp>&) const;
+ /// Logical or slice elements with corresponding elements of @a v.
+ void operator|=(const valarray<_Tp>&) const;
+ /// Left shift slice elements by corresponding elements of @a v.
+ void operator<<=(const valarray<_Tp>&) const;
+ /// Right shift slice elements by corresponding elements of @a v.
+ void operator>>=(const valarray<_Tp>&) const;
+ /// Assign all slice elements to @a t.
+ void operator= (const _Tp&) const;
+ // ~indirect_array();
+
+ template<class _Dom>
+ void operator=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator*=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator/=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator%=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator+=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator-=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator^=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator&=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator|=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator<<=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator>>=(const _Expr<_Dom, _Tp>&) const;
+
+ private:
+ /// Copy constructor. Both slices refer to the same underlying array.
+ indirect_array(_Array<_Tp>, size_t, _Array<size_t>);
+
+ friend class valarray<_Tp>;
+ friend class gslice_array<_Tp>;
+
+ const size_t _M_sz;
+ const _Array<size_t> _M_index;
+ const _Array<_Tp> _M_array;
+
+ // not implemented
+ indirect_array();
+ };
+
+ template<typename _Tp>
+ inline
+ indirect_array<_Tp>::indirect_array(const indirect_array<_Tp>& __a)
+ : _M_sz(__a._M_sz), _M_index(__a._M_index), _M_array(__a._M_array) {}
+
+ template<typename _Tp>
+ inline
+ indirect_array<_Tp>::indirect_array(_Array<_Tp> __a, size_t __s,
+ _Array<size_t> __i)
+ : _M_sz(__s), _M_index(__i), _M_array(__a) {}
+
+ template<typename _Tp>
+ inline indirect_array<_Tp>&
+ indirect_array<_Tp>::operator=(const indirect_array<_Tp>& __a)
+ {
+ std::__valarray_copy(__a._M_array, _M_sz, __a._M_index, _M_array,
+ _M_index);
+ return *this;
+ }
+
+ template<typename _Tp>
+ inline void
+ indirect_array<_Tp>::operator=(const _Tp& __t) const
+ { std::__valarray_fill(_M_array, _M_index, _M_sz, __t); }
+
+ template<typename _Tp>
+ inline void
+ indirect_array<_Tp>::operator=(const valarray<_Tp>& __v) const
+ { std::__valarray_copy(_Array<_Tp>(__v), _M_sz, _M_array, _M_index); }
+
+ template<typename _Tp>
+ template<class _Dom>
+ inline void
+ indirect_array<_Tp>::operator=(const _Expr<_Dom, _Tp>& __e) const
+ { std::__valarray_copy(__e, _M_sz, _M_array, _M_index); }
+
+#undef _DEFINE_VALARRAY_OPERATOR
+#define _DEFINE_VALARRAY_OPERATOR(_Op, _Name) \
+ template<typename _Tp> \
+ inline void \
+ indirect_array<_Tp>::operator _Op##=(const valarray<_Tp>& __v) const\
+ { \
+ _Array_augmented_##_Name(_M_array, _M_index, _Array<_Tp>(__v), _M_sz); \
+ } \
+ \
+ template<typename _Tp> \
+ template<class _Dom> \
+ inline void \
+ indirect_array<_Tp>::operator _Op##=(const _Expr<_Dom,_Tp>& __e) const\
+ { \
+ _Array_augmented_##_Name(_M_array, _M_index, __e, _M_sz); \
+ }
+
+_DEFINE_VALARRAY_OPERATOR(*, __multiplies)
+_DEFINE_VALARRAY_OPERATOR(/, __divides)
+_DEFINE_VALARRAY_OPERATOR(%, __modulus)
+_DEFINE_VALARRAY_OPERATOR(+, __plus)
+_DEFINE_VALARRAY_OPERATOR(-, __minus)
+_DEFINE_VALARRAY_OPERATOR(^, __bitwise_xor)
+_DEFINE_VALARRAY_OPERATOR(&, __bitwise_and)
+_DEFINE_VALARRAY_OPERATOR(|, __bitwise_or)
+_DEFINE_VALARRAY_OPERATOR(<<, __shift_left)
+_DEFINE_VALARRAY_OPERATOR(>>, __shift_right)
+
+#undef _DEFINE_VALARRAY_OPERATOR
+
+ // @} group numeric_arrays
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _INDIRECT_ARRAY_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/ios_base.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/ios_base.h
new file mode 100644
index 0000000..8dde100
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/ios_base.h
@@ -0,0 +1,982 @@
+// Iostreams base classes -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ios_base.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 27.4 Iostreams base classes
+//
+
+#ifndef _IOS_BASE_H
+#define _IOS_BASE_H 1
+
+#pragma GCC system_header
+
+#include <ext/atomicity.h>
+#include <bits/localefwd.h>
+#include <bits/locale_classes.h>
+
+#ifndef _GLIBCXX_STDIO_MACROS
+# include <cstdio> // For SEEK_CUR, SEEK_END
+# define _IOS_BASE_SEEK_CUR SEEK_CUR
+# define _IOS_BASE_SEEK_END SEEK_END
+#else
+# define _IOS_BASE_SEEK_CUR 1
+# define _IOS_BASE_SEEK_END 2
+#endif
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // The following definitions of bitmask types are enums, not ints,
+ // as permitted (but not required) in the standard, in order to provide
+ // better type safety in iostream calls. A side effect is that
+ // expressions involving them are no longer compile-time constants.
+ enum _Ios_Fmtflags
+ {
+ _S_boolalpha = 1L << 0,
+ _S_dec = 1L << 1,
+ _S_fixed = 1L << 2,
+ _S_hex = 1L << 3,
+ _S_internal = 1L << 4,
+ _S_left = 1L << 5,
+ _S_oct = 1L << 6,
+ _S_right = 1L << 7,
+ _S_scientific = 1L << 8,
+ _S_showbase = 1L << 9,
+ _S_showpoint = 1L << 10,
+ _S_showpos = 1L << 11,
+ _S_skipws = 1L << 12,
+ _S_unitbuf = 1L << 13,
+ _S_uppercase = 1L << 14,
+ _S_adjustfield = _S_left | _S_right | _S_internal,
+ _S_basefield = _S_dec | _S_oct | _S_hex,
+ _S_floatfield = _S_scientific | _S_fixed,
+ _S_ios_fmtflags_end = 1L << 16
+ };
+
+ inline _Ios_Fmtflags
+ operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
+ { return _Ios_Fmtflags(static_cast<int>(__a) & static_cast<int>(__b)); }
+
+ inline _Ios_Fmtflags
+ operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
+ { return _Ios_Fmtflags(static_cast<int>(__a) | static_cast<int>(__b)); }
+
+ inline _Ios_Fmtflags
+ operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
+ { return _Ios_Fmtflags(static_cast<int>(__a) ^ static_cast<int>(__b)); }
+
+ inline _Ios_Fmtflags&
+ operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
+ { return __a = __a | __b; }
+
+ inline _Ios_Fmtflags&
+ operator&=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
+ { return __a = __a & __b; }
+
+ inline _Ios_Fmtflags&
+ operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
+ { return __a = __a ^ __b; }
+
+ inline _Ios_Fmtflags
+ operator~(_Ios_Fmtflags __a)
+ { return _Ios_Fmtflags(~static_cast<int>(__a)); }
+
+
+ enum _Ios_Openmode
+ {
+ _S_app = 1L << 0,
+ _S_ate = 1L << 1,
+ _S_bin = 1L << 2,
+ _S_in = 1L << 3,
+ _S_out = 1L << 4,
+ _S_trunc = 1L << 5,
+ _S_ios_openmode_end = 1L << 16
+ };
+
+ inline _Ios_Openmode
+ operator&(_Ios_Openmode __a, _Ios_Openmode __b)
+ { return _Ios_Openmode(static_cast<int>(__a) & static_cast<int>(__b)); }
+
+ inline _Ios_Openmode
+ operator|(_Ios_Openmode __a, _Ios_Openmode __b)
+ { return _Ios_Openmode(static_cast<int>(__a) | static_cast<int>(__b)); }
+
+ inline _Ios_Openmode
+ operator^(_Ios_Openmode __a, _Ios_Openmode __b)
+ { return _Ios_Openmode(static_cast<int>(__a) ^ static_cast<int>(__b)); }
+
+ inline _Ios_Openmode&
+ operator|=(_Ios_Openmode& __a, _Ios_Openmode __b)
+ { return __a = __a | __b; }
+
+ inline _Ios_Openmode&
+ operator&=(_Ios_Openmode& __a, _Ios_Openmode __b)
+ { return __a = __a & __b; }
+
+ inline _Ios_Openmode&
+ operator^=(_Ios_Openmode& __a, _Ios_Openmode __b)
+ { return __a = __a ^ __b; }
+
+ inline _Ios_Openmode
+ operator~(_Ios_Openmode __a)
+ { return _Ios_Openmode(~static_cast<int>(__a)); }
+
+
+ enum _Ios_Iostate
+ {
+ _S_goodbit = 0,
+ _S_badbit = 1L << 0,
+ _S_eofbit = 1L << 1,
+ _S_failbit = 1L << 2,
+ _S_ios_iostate_end = 1L << 16
+ };
+
+ inline _Ios_Iostate
+ operator&(_Ios_Iostate __a, _Ios_Iostate __b)
+ { return _Ios_Iostate(static_cast<int>(__a) & static_cast<int>(__b)); }
+
+ inline _Ios_Iostate
+ operator|(_Ios_Iostate __a, _Ios_Iostate __b)
+ { return _Ios_Iostate(static_cast<int>(__a) | static_cast<int>(__b)); }
+
+ inline _Ios_Iostate
+ operator^(_Ios_Iostate __a, _Ios_Iostate __b)
+ { return _Ios_Iostate(static_cast<int>(__a) ^ static_cast<int>(__b)); }
+
+ inline _Ios_Iostate&
+ operator|=(_Ios_Iostate& __a, _Ios_Iostate __b)
+ { return __a = __a | __b; }
+
+ inline _Ios_Iostate&
+ operator&=(_Ios_Iostate& __a, _Ios_Iostate __b)
+ { return __a = __a & __b; }
+
+ inline _Ios_Iostate&
+ operator^=(_Ios_Iostate& __a, _Ios_Iostate __b)
+ { return __a = __a ^ __b; }
+
+ inline _Ios_Iostate
+ operator~(_Ios_Iostate __a)
+ { return _Ios_Iostate(~static_cast<int>(__a)); }
+
+ enum _Ios_Seekdir
+ {
+ _S_beg = 0,
+ _S_cur = _IOS_BASE_SEEK_CUR,
+ _S_end = _IOS_BASE_SEEK_END,
+ _S_ios_seekdir_end = 1L << 16
+ };
+
+ // 27.4.2 Class ios_base
+ /**
+ * @brief The base of the I/O class hierarchy.
+ * @ingroup io
+ *
+ * This class defines everything that can be defined about I/O that does
+ * not depend on the type of characters being input or output. Most
+ * people will only see @c ios_base when they need to specify the full
+ * name of the various I/O flags (e.g., the openmodes).
+ */
+ class ios_base
+ {
+ public:
+
+ /**
+ * @brief These are thrown to indicate problems with io.
+ * @ingroup exceptions
+ *
+ * 27.4.2.1.1 Class ios_base::failure
+ */
+ class failure : public exception
+ {
+ public:
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 48. Use of non-existent exception constructor
+ explicit
+ failure(const string& __str) throw();
+
+ // This declaration is not useless:
+ // http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Vague-Linkage.html
+ virtual
+ ~failure() throw();
+
+ virtual const char*
+ what() const throw();
+
+ private:
+ string _M_msg;
+ };
+
+ // 27.4.2.1.2 Type ios_base::fmtflags
+ /**
+ * @brief This is a bitmask type.
+ *
+ * @c "_Ios_Fmtflags" is implementation-defined, but it is valid to
+ * perform bitwise operations on these values and expect the Right
+ * Thing to happen. Defined objects of type fmtflags are:
+ * - boolalpha
+ * - dec
+ * - fixed
+ * - hex
+ * - internal
+ * - left
+ * - oct
+ * - right
+ * - scientific
+ * - showbase
+ * - showpoint
+ * - showpos
+ * - skipws
+ * - unitbuf
+ * - uppercase
+ * - adjustfield
+ * - basefield
+ * - floatfield
+ */
+ typedef _Ios_Fmtflags fmtflags;
+
+ /// Insert/extract @c bool in alphabetic rather than numeric format.
+ static const fmtflags boolalpha = _S_boolalpha;
+
+ /// Converts integer input or generates integer output in decimal base.
+ static const fmtflags dec = _S_dec;
+
+ /// Generate floating-point output in fixed-point notation.
+ static const fmtflags fixed = _S_fixed;
+
+ /// Converts integer input or generates integer output in hexadecimal base.
+ static const fmtflags hex = _S_hex;
+
+ /// Adds fill characters at a designated internal point in certain
+ /// generated output, or identical to @c right if no such point is
+ /// designated.
+ static const fmtflags internal = _S_internal;
+
+ /// Adds fill characters on the right (final positions) of certain
+ /// generated output. (I.e., the thing you print is flush left.)
+ static const fmtflags left = _S_left;
+
+ /// Converts integer input or generates integer output in octal base.
+ static const fmtflags oct = _S_oct;
+
+ /// Adds fill characters on the left (initial positions) of certain
+ /// generated output. (I.e., the thing you print is flush right.)
+ static const fmtflags right = _S_right;
+
+ /// Generates floating-point output in scientific notation.
+ static const fmtflags scientific = _S_scientific;
+
+ /// Generates a prefix indicating the numeric base of generated integer
+ /// output.
+ static const fmtflags showbase = _S_showbase;
+
+ /// Generates a decimal-point character unconditionally in generated
+ /// floating-point output.
+ static const fmtflags showpoint = _S_showpoint;
+
+ /// Generates a + sign in non-negative generated numeric output.
+ static const fmtflags showpos = _S_showpos;
+
+ /// Skips leading white space before certain input operations.
+ static const fmtflags skipws = _S_skipws;
+
+ /// Flushes output after each output operation.
+ static const fmtflags unitbuf = _S_unitbuf;
+
+ /// Replaces certain lowercase letters with their uppercase equivalents
+ /// in generated output.
+ static const fmtflags uppercase = _S_uppercase;
+
+ /// A mask of left|right|internal. Useful for the 2-arg form of @c setf.
+ static const fmtflags adjustfield = _S_adjustfield;
+
+ /// A mask of dec|oct|hex. Useful for the 2-arg form of @c setf.
+ static const fmtflags basefield = _S_basefield;
+
+ /// A mask of scientific|fixed. Useful for the 2-arg form of @c setf.
+ static const fmtflags floatfield = _S_floatfield;
+
+ // 27.4.2.1.3 Type ios_base::iostate
+ /**
+ * @brief This is a bitmask type.
+ *
+ * @c "_Ios_Iostate" is implementation-defined, but it is valid to
+ * perform bitwise operations on these values and expect the Right
+ * Thing to happen. Defined objects of type iostate are:
+ * - badbit
+ * - eofbit
+ * - failbit
+ * - goodbit
+ */
+ typedef _Ios_Iostate iostate;
+
+ /// Indicates a loss of integrity in an input or output sequence (such
+ /// as an irrecoverable read error from a file).
+ static const iostate badbit = _S_badbit;
+
+ /// Indicates that an input operation reached the end of an input sequence.
+ static const iostate eofbit = _S_eofbit;
+
+ /// Indicates that an input operation failed to read the expected
+ /// characters, or that an output operation failed to generate the
+ /// desired characters.
+ static const iostate failbit = _S_failbit;
+
+ /// Indicates all is well.
+ static const iostate goodbit = _S_goodbit;
+
+ // 27.4.2.1.4 Type ios_base::openmode
+ /**
+ * @brief This is a bitmask type.
+ *
+ * @c "_Ios_Openmode" is implementation-defined, but it is valid to
+ * perform bitwise operations on these values and expect the Right
+ * Thing to happen. Defined objects of type openmode are:
+ * - app
+ * - ate
+ * - binary
+ * - in
+ * - out
+ * - trunc
+ */
+ typedef _Ios_Openmode openmode;
+
+ /// Seek to end before each write.
+ static const openmode app = _S_app;
+
+ /// Open and seek to end immediately after opening.
+ static const openmode ate = _S_ate;
+
+ /// Perform input and output in binary mode (as opposed to text mode).
+ /// This is probably not what you think it is; see
+ /// http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch27s02.html
+ static const openmode binary = _S_bin;
+
+ /// Open for input. Default for @c ifstream and fstream.
+ static const openmode in = _S_in;
+
+ /// Open for output. Default for @c ofstream and fstream.
+ static const openmode out = _S_out;
+
+ /// Open for input. Default for @c ofstream.
+ static const openmode trunc = _S_trunc;
+
+ // 27.4.2.1.5 Type ios_base::seekdir
+ /**
+ * @brief This is an enumerated type.
+ *
+ * @c "_Ios_Seekdir" is implementation-defined. Defined values
+ * of type seekdir are:
+ * - beg
+ * - cur, equivalent to @c SEEK_CUR in the C standard library.
+ * - end, equivalent to @c SEEK_END in the C standard library.
+ */
+ typedef _Ios_Seekdir seekdir;
+
+ /// Request a seek relative to the beginning of the stream.
+ static const seekdir beg = _S_beg;
+
+ /// Request a seek relative to the current position within the sequence.
+ static const seekdir cur = _S_cur;
+
+ /// Request a seek relative to the current end of the sequence.
+ static const seekdir end = _S_end;
+
+ // Annex D.6
+ typedef int io_state;
+ typedef int open_mode;
+ typedef int seek_dir;
+
+ typedef std::streampos streampos;
+ typedef std::streamoff streamoff;
+
+ // Callbacks;
+ /**
+ * @brief The set of events that may be passed to an event callback.
+ *
+ * erase_event is used during ~ios() and copyfmt(). imbue_event is used
+ * during imbue(). copyfmt_event is used during copyfmt().
+ */
+ enum event
+ {
+ erase_event,
+ imbue_event,
+ copyfmt_event
+ };
+
+ /**
+ * @brief The type of an event callback function.
+ * @param event One of the members of the event enum.
+ * @param ios_base Reference to the ios_base object.
+ * @param int The integer provided when the callback was registered.
+ *
+ * Event callbacks are user defined functions that get called during
+ * several ios_base and basic_ios functions, specifically imbue(),
+ * copyfmt(), and ~ios().
+ */
+ typedef void (*event_callback) (event, ios_base&, int);
+
+ /**
+ * @brief Add the callback __fn with parameter __index.
+ * @param __fn The function to add.
+ * @param __index The integer to pass to the function when invoked.
+ *
+ * Registers a function as an event callback with an integer parameter to
+ * be passed to the function when invoked. Multiple copies of the
+ * function are allowed. If there are multiple callbacks, they are
+ * invoked in the order they were registered.
+ */
+ void
+ register_callback(event_callback __fn, int __index);
+
+ protected:
+ //@{
+ /**
+ * ios_base data members (doc me)
+ */
+ streamsize _M_precision;
+ streamsize _M_width;
+ fmtflags _M_flags;
+ iostate _M_exception;
+ iostate _M_streambuf_state;
+ //@}
+
+ // 27.4.2.6 Members for callbacks
+ // 27.4.2.6 ios_base callbacks
+ struct _Callback_list
+ {
+ // Data Members
+ _Callback_list* _M_next;
+ ios_base::event_callback _M_fn;
+ int _M_index;
+ _Atomic_word _M_refcount; // 0 means one reference.
+
+ _Callback_list(ios_base::event_callback __fn, int __index,
+ _Callback_list* __cb)
+ : _M_next(__cb), _M_fn(__fn), _M_index(__index), _M_refcount(0) { }
+
+ void
+ _M_add_reference() { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
+
+ // 0 => OK to delete.
+ int
+ _M_remove_reference()
+ { return __gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1); }
+ };
+
+ _Callback_list* _M_callbacks;
+
+ void
+ _M_call_callbacks(event __ev) throw();
+
+ void
+ _M_dispose_callbacks(void);
+
+ // 27.4.2.5 Members for iword/pword storage
+ struct _Words
+ {
+ void* _M_pword;
+ long _M_iword;
+ _Words() : _M_pword(0), _M_iword(0) { }
+ };
+
+ // Only for failed iword/pword calls.
+ _Words _M_word_zero;
+
+ // Guaranteed storage.
+ // The first 5 iword and pword slots are reserved for internal use.
+ enum { _S_local_word_size = 8 };
+ _Words _M_local_word[_S_local_word_size];
+
+ // Allocated storage.
+ int _M_word_size;
+ _Words* _M_word;
+
+ _Words&
+ _M_grow_words(int __index, bool __iword);
+
+ // Members for locale and locale caching.
+ locale _M_ios_locale;
+
+ void
+ _M_init();
+
+ public:
+
+ // 27.4.2.1.6 Class ios_base::Init
+ // Used to initialize standard streams. In theory, g++ could use
+ // -finit-priority to order this stuff correctly without going
+ // through these machinations.
+ class Init
+ {
+ friend class ios_base;
+ public:
+ Init();
+ ~Init();
+
+ private:
+ static _Atomic_word _S_refcount;
+ static bool _S_synced_with_stdio;
+ };
+
+ // [27.4.2.2] fmtflags state functions
+ /**
+ * @brief Access to format flags.
+ * @return The format control flags for both input and output.
+ */
+ fmtflags
+ flags() const
+ { return _M_flags; }
+
+ /**
+ * @brief Setting new format flags all at once.
+ * @param fmtfl The new flags to set.
+ * @return The previous format control flags.
+ *
+ * This function overwrites all the format flags with @a fmtfl.
+ */
+ fmtflags
+ flags(fmtflags __fmtfl)
+ {
+ fmtflags __old = _M_flags;
+ _M_flags = __fmtfl;
+ return __old;
+ }
+
+ /**
+ * @brief Setting new format flags.
+ * @param fmtfl Additional flags to set.
+ * @return The previous format control flags.
+ *
+ * This function sets additional flags in format control. Flags that
+ * were previously set remain set.
+ */
+ fmtflags
+ setf(fmtflags __fmtfl)
+ {
+ fmtflags __old = _M_flags;
+ _M_flags |= __fmtfl;
+ return __old;
+ }
+
+ /**
+ * @brief Setting new format flags.
+ * @param fmtfl Additional flags to set.
+ * @param mask The flags mask for @a fmtfl.
+ * @return The previous format control flags.
+ *
+ * This function clears @a mask in the format flags, then sets
+ * @a fmtfl @c & @a mask. An example mask is @c ios_base::adjustfield.
+ */
+ fmtflags
+ setf(fmtflags __fmtfl, fmtflags __mask)
+ {
+ fmtflags __old = _M_flags;
+ _M_flags &= ~__mask;
+ _M_flags |= (__fmtfl & __mask);
+ return __old;
+ }
+
+ /**
+ * @brief Clearing format flags.
+ * @param mask The flags to unset.
+ *
+ * This function clears @a mask in the format flags.
+ */
+ void
+ unsetf(fmtflags __mask)
+ { _M_flags &= ~__mask; }
+
+ /**
+ * @brief Flags access.
+ * @return The precision to generate on certain output operations.
+ *
+ * Be careful if you try to give a definition of "precision" here; see
+ * DR 189.
+ */
+ streamsize
+ precision() const
+ { return _M_precision; }
+
+ /**
+ * @brief Changing flags.
+ * @param prec The new precision value.
+ * @return The previous value of precision().
+ */
+ streamsize
+ precision(streamsize __prec)
+ {
+ streamsize __old = _M_precision;
+ _M_precision = __prec;
+ return __old;
+ }
+
+ /**
+ * @brief Flags access.
+ * @return The minimum field width to generate on output operations.
+ *
+ * "Minimum field width" refers to the number of characters.
+ */
+ streamsize
+ width() const
+ { return _M_width; }
+
+ /**
+ * @brief Changing flags.
+ * @param wide The new width value.
+ * @return The previous value of width().
+ */
+ streamsize
+ width(streamsize __wide)
+ {
+ streamsize __old = _M_width;
+ _M_width = __wide;
+ return __old;
+ }
+
+ // [27.4.2.4] ios_base static members
+ /**
+ * @brief Interaction with the standard C I/O objects.
+ * @param sync Whether to synchronize or not.
+ * @return True if the standard streams were previously synchronized.
+ *
+ * The synchronization referred to is @e only that between the standard
+ * C facilities (e.g., stdout) and the standard C++ objects (e.g.,
+ * cout). User-declared streams are unaffected. See
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch28s02.html
+ */
+ static bool
+ sync_with_stdio(bool __sync = true);
+
+ // [27.4.2.3] ios_base locale functions
+ /**
+ * @brief Setting a new locale.
+ * @param loc The new locale.
+ * @return The previous locale.
+ *
+ * Sets the new locale for this stream, and then invokes each callback
+ * with imbue_event.
+ */
+ locale
+ imbue(const locale& __loc);
+
+ /**
+ * @brief Locale access
+ * @return A copy of the current locale.
+ *
+ * If @c imbue(loc) has previously been called, then this function
+ * returns @c loc. Otherwise, it returns a copy of @c std::locale(),
+ * the global C++ locale.
+ */
+ locale
+ getloc() const
+ { return _M_ios_locale; }
+
+ /**
+ * @brief Locale access
+ * @return A reference to the current locale.
+ *
+ * Like getloc above, but returns a reference instead of
+ * generating a copy.
+ */
+ const locale&
+ _M_getloc() const
+ { return _M_ios_locale; }
+
+ // [27.4.2.5] ios_base storage functions
+ /**
+ * @brief Access to unique indices.
+ * @return An integer different from all previous calls.
+ *
+ * This function returns a unique integer every time it is called. It
+ * can be used for any purpose, but is primarily intended to be a unique
+ * index for the iword and pword functions. The expectation is that an
+ * application calls xalloc in order to obtain an index in the iword and
+ * pword arrays that can be used without fear of conflict.
+ *
+ * The implementation maintains a static variable that is incremented and
+ * returned on each invocation. xalloc is guaranteed to return an index
+ * that is safe to use in the iword and pword arrays.
+ */
+ static int
+ xalloc() throw();
+
+ /**
+ * @brief Access to integer array.
+ * @param __ix Index into the array.
+ * @return A reference to an integer associated with the index.
+ *
+ * The iword function provides access to an array of integers that can be
+ * used for any purpose. The array grows as required to hold the
+ * supplied index. All integers in the array are initialized to 0.
+ *
+ * The implementation reserves several indices. You should use xalloc to
+ * obtain an index that is safe to use. Also note that since the array
+ * can grow dynamically, it is not safe to hold onto the reference.
+ */
+ long&
+ iword(int __ix)
+ {
+ _Words& __word = (__ix < _M_word_size)
+ ? _M_word[__ix] : _M_grow_words(__ix, true);
+ return __word._M_iword;
+ }
+
+ /**
+ * @brief Access to void pointer array.
+ * @param __ix Index into the array.
+ * @return A reference to a void* associated with the index.
+ *
+ * The pword function provides access to an array of pointers that can be
+ * used for any purpose. The array grows as required to hold the
+ * supplied index. All pointers in the array are initialized to 0.
+ *
+ * The implementation reserves several indices. You should use xalloc to
+ * obtain an index that is safe to use. Also note that since the array
+ * can grow dynamically, it is not safe to hold onto the reference.
+ */
+ void*&
+ pword(int __ix)
+ {
+ _Words& __word = (__ix < _M_word_size)
+ ? _M_word[__ix] : _M_grow_words(__ix, false);
+ return __word._M_pword;
+ }
+
+ // Destructor
+ /**
+ * Invokes each callback with erase_event. Destroys local storage.
+ *
+ * Note that the ios_base object for the standard streams never gets
+ * destroyed. As a result, any callbacks registered with the standard
+ * streams will not get invoked with erase_event (unless copyfmt is
+ * used).
+ */
+ virtual ~ios_base();
+
+ protected:
+ ios_base();
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 50. Copy constructor and assignment operator of ios_base
+ private:
+ ios_base(const ios_base&);
+
+ ios_base&
+ operator=(const ios_base&);
+ };
+
+ // [27.4.5.1] fmtflags manipulators
+ /// Calls base.setf(ios_base::boolalpha).
+ inline ios_base&
+ boolalpha(ios_base& __base)
+ {
+ __base.setf(ios_base::boolalpha);
+ return __base;
+ }
+
+ /// Calls base.unsetf(ios_base::boolalpha).
+ inline ios_base&
+ noboolalpha(ios_base& __base)
+ {
+ __base.unsetf(ios_base::boolalpha);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::showbase).
+ inline ios_base&
+ showbase(ios_base& __base)
+ {
+ __base.setf(ios_base::showbase);
+ return __base;
+ }
+
+ /// Calls base.unsetf(ios_base::showbase).
+ inline ios_base&
+ noshowbase(ios_base& __base)
+ {
+ __base.unsetf(ios_base::showbase);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::showpoint).
+ inline ios_base&
+ showpoint(ios_base& __base)
+ {
+ __base.setf(ios_base::showpoint);
+ return __base;
+ }
+
+ /// Calls base.unsetf(ios_base::showpoint).
+ inline ios_base&
+ noshowpoint(ios_base& __base)
+ {
+ __base.unsetf(ios_base::showpoint);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::showpos).
+ inline ios_base&
+ showpos(ios_base& __base)
+ {
+ __base.setf(ios_base::showpos);
+ return __base;
+ }
+
+ /// Calls base.unsetf(ios_base::showpos).
+ inline ios_base&
+ noshowpos(ios_base& __base)
+ {
+ __base.unsetf(ios_base::showpos);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::skipws).
+ inline ios_base&
+ skipws(ios_base& __base)
+ {
+ __base.setf(ios_base::skipws);
+ return __base;
+ }
+
+ /// Calls base.unsetf(ios_base::skipws).
+ inline ios_base&
+ noskipws(ios_base& __base)
+ {
+ __base.unsetf(ios_base::skipws);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::uppercase).
+ inline ios_base&
+ uppercase(ios_base& __base)
+ {
+ __base.setf(ios_base::uppercase);
+ return __base;
+ }
+
+ /// Calls base.unsetf(ios_base::uppercase).
+ inline ios_base&
+ nouppercase(ios_base& __base)
+ {
+ __base.unsetf(ios_base::uppercase);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::unitbuf).
+ inline ios_base&
+ unitbuf(ios_base& __base)
+ {
+ __base.setf(ios_base::unitbuf);
+ return __base;
+ }
+
+ /// Calls base.unsetf(ios_base::unitbuf).
+ inline ios_base&
+ nounitbuf(ios_base& __base)
+ {
+ __base.unsetf(ios_base::unitbuf);
+ return __base;
+ }
+
+ // [27.4.5.2] adjustfield manipulators
+ /// Calls base.setf(ios_base::internal, ios_base::adjustfield).
+ inline ios_base&
+ internal(ios_base& __base)
+ {
+ __base.setf(ios_base::internal, ios_base::adjustfield);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::left, ios_base::adjustfield).
+ inline ios_base&
+ left(ios_base& __base)
+ {
+ __base.setf(ios_base::left, ios_base::adjustfield);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::right, ios_base::adjustfield).
+ inline ios_base&
+ right(ios_base& __base)
+ {
+ __base.setf(ios_base::right, ios_base::adjustfield);
+ return __base;
+ }
+
+ // [27.4.5.3] basefield manipulators
+ /// Calls base.setf(ios_base::dec, ios_base::basefield).
+ inline ios_base&
+ dec(ios_base& __base)
+ {
+ __base.setf(ios_base::dec, ios_base::basefield);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::hex, ios_base::basefield).
+ inline ios_base&
+ hex(ios_base& __base)
+ {
+ __base.setf(ios_base::hex, ios_base::basefield);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::oct, ios_base::basefield).
+ inline ios_base&
+ oct(ios_base& __base)
+ {
+ __base.setf(ios_base::oct, ios_base::basefield);
+ return __base;
+ }
+
+ // [27.4.5.4] floatfield manipulators
+ /// Calls base.setf(ios_base::fixed, ios_base::floatfield).
+ inline ios_base&
+ fixed(ios_base& __base)
+ {
+ __base.setf(ios_base::fixed, ios_base::floatfield);
+ return __base;
+ }
+
+ /// Calls base.setf(ios_base::scientific, ios_base::floatfield).
+ inline ios_base&
+ scientific(ios_base& __base)
+ {
+ __base.setf(ios_base::scientific, ios_base::floatfield);
+ return __base;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#undef _IOS_BASE_SEEK_CUR
+#undef _IOS_BASE_SEEK_END
+
+#endif /* _IOS_BASE_H */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/istream.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/istream.tcc
new file mode 100644
index 0000000..5d60791
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/istream.tcc
@@ -0,0 +1,1022 @@
+// istream classes -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file istream.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 27.6.1 Input streams
+//
+
+#ifndef _ISTREAM_TCC
+#define _ISTREAM_TCC 1
+
+#pragma GCC system_header
+
+#include <cxxabi-forced.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>::sentry::
+ sentry(basic_istream<_CharT, _Traits>& __in, bool __noskip) : _M_ok(false)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ if (__in.good())
+ {
+ if (__in.tie())
+ __in.tie()->flush();
+ if (!__noskip && bool(__in.flags() & ios_base::skipws))
+ {
+ const __int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = __in.rdbuf();
+ __int_type __c = __sb->sgetc();
+
+ const __ctype_type& __ct = __check_facet(__in._M_ctype);
+ while (!traits_type::eq_int_type(__c, __eof)
+ && __ct.is(ctype_base::space,
+ traits_type::to_char_type(__c)))
+ __c = __sb->snextc();
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 195. Should basic_istream::sentry's constructor ever
+ // set eofbit?
+ if (traits_type::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ }
+ }
+
+ if (__in.good() && __err == ios_base::goodbit)
+ _M_ok = true;
+ else
+ {
+ __err |= ios_base::failbit;
+ __in.setstate(__err);
+ }
+ }
+
+ template<typename _CharT, typename _Traits>
+ template<typename _ValueT>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ _M_extract(_ValueT& __v)
+ {
+ sentry __cerb(*this, false);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ const __num_get_type& __ng = __check_facet(this->_M_num_get);
+ __ng.get(*this, 0, *this, __err, __v);
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ operator>>(short& __n)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 118. basic_istream uses nonexistent num_get member functions.
+ long __l;
+ _M_extract(__l);
+ if (!this->fail())
+ {
+ if (__gnu_cxx::__numeric_traits<short>::__min <= __l
+ && __l <= __gnu_cxx::__numeric_traits<short>::__max)
+ __n = short(__l);
+ else
+ this->setstate(ios_base::failbit);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ operator>>(int& __n)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 118. basic_istream uses nonexistent num_get member functions.
+ long __l;
+ _M_extract(__l);
+ if (!this->fail())
+ {
+ if (__gnu_cxx::__numeric_traits<int>::__min <= __l
+ && __l <= __gnu_cxx::__numeric_traits<int>::__max)
+ __n = int(__l);
+ else
+ this->setstate(ios_base::failbit);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ operator>>(__streambuf_type* __sbout)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this, false);
+ if (__cerb && __sbout)
+ {
+ __try
+ {
+ bool __ineof;
+ if (!__copy_streambufs_eof(this->rdbuf(), __sbout, __ineof))
+ __err |= ios_base::failbit;
+ if (__ineof)
+ __err |= ios_base::eofbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::failbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::failbit); }
+ }
+ else if (!__sbout)
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_istream<_CharT, _Traits>::int_type
+ basic_istream<_CharT, _Traits>::
+ get(void)
+ {
+ const int_type __eof = traits_type::eof();
+ int_type __c = __eof;
+ _M_gcount = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ __try
+ {
+ __c = this->rdbuf()->sbumpc();
+ // 27.6.1.1 paragraph 3
+ if (!traits_type::eq_int_type(__c, __eof))
+ _M_gcount = 1;
+ else
+ __err |= ios_base::eofbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ }
+ if (!_M_gcount)
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
+ return __c;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ get(char_type& __c)
+ {
+ _M_gcount = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ __try
+ {
+ const int_type __cb = this->rdbuf()->sbumpc();
+ // 27.6.1.1 paragraph 3
+ if (!traits_type::eq_int_type(__cb, traits_type::eof()))
+ {
+ _M_gcount = 1;
+ __c = traits_type::to_char_type(__cb);
+ }
+ else
+ __err |= ios_base::eofbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ }
+ if (!_M_gcount)
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ get(char_type* __s, streamsize __n, char_type __delim)
+ {
+ _M_gcount = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ __try
+ {
+ const int_type __idelim = traits_type::to_int_type(__delim);
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ int_type __c = __sb->sgetc();
+
+ while (_M_gcount + 1 < __n
+ && !traits_type::eq_int_type(__c, __eof)
+ && !traits_type::eq_int_type(__c, __idelim))
+ {
+ *__s++ = traits_type::to_char_type(__c);
+ ++_M_gcount;
+ __c = __sb->snextc();
+ }
+ if (traits_type::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ }
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 243. get and getline when sentry reports failure.
+ if (__n > 0)
+ *__s = char_type();
+ if (!_M_gcount)
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ get(__streambuf_type& __sb, char_type __delim)
+ {
+ _M_gcount = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ __try
+ {
+ const int_type __idelim = traits_type::to_int_type(__delim);
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __this_sb = this->rdbuf();
+ int_type __c = __this_sb->sgetc();
+ char_type __c2 = traits_type::to_char_type(__c);
+
+ while (!traits_type::eq_int_type(__c, __eof)
+ && !traits_type::eq_int_type(__c, __idelim)
+ && !traits_type::eq_int_type(__sb.sputc(__c2), __eof))
+ {
+ ++_M_gcount;
+ __c = __this_sb->snextc();
+ __c2 = traits_type::to_char_type(__c);
+ }
+ if (traits_type::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ }
+ if (!_M_gcount)
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ getline(char_type* __s, streamsize __n, char_type __delim)
+ {
+ _M_gcount = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ __try
+ {
+ const int_type __idelim = traits_type::to_int_type(__delim);
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ int_type __c = __sb->sgetc();
+
+ while (_M_gcount + 1 < __n
+ && !traits_type::eq_int_type(__c, __eof)
+ && !traits_type::eq_int_type(__c, __idelim))
+ {
+ *__s++ = traits_type::to_char_type(__c);
+ __c = __sb->snextc();
+ ++_M_gcount;
+ }
+ if (traits_type::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ else
+ {
+ if (traits_type::eq_int_type(__c, __idelim))
+ {
+ __sb->sbumpc();
+ ++_M_gcount;
+ }
+ else
+ __err |= ios_base::failbit;
+ }
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ }
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 243. get and getline when sentry reports failure.
+ if (__n > 0)
+ *__s = char_type();
+ if (!_M_gcount)
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ // We provide three overloads, since the first two are much simpler
+ // than the general case. Also, the latter two can thus adopt the
+ // same "batchy" strategy used by getline above.
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ ignore(void)
+ {
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+
+ if (traits_type::eq_int_type(__sb->sbumpc(), __eof))
+ __err |= ios_base::eofbit;
+ else
+ _M_gcount = 1;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ ignore(streamsize __n)
+ {
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb && __n > 0)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ int_type __c = __sb->sgetc();
+
+ // N.B. On LFS-enabled platforms streamsize is still 32 bits
+ // wide: if we want to implement the standard mandated behavior
+ // for n == max() (see 27.6.1.3/24) we are at risk of signed
+ // integer overflow: thus these contortions. Also note that,
+ // by definition, when more than 2G chars are actually ignored,
+ // _M_gcount (the return value of gcount, that is) cannot be
+ // really correct, being unavoidably too small.
+ bool __large_ignore = false;
+ while (true)
+ {
+ while (_M_gcount < __n
+ && !traits_type::eq_int_type(__c, __eof))
+ {
+ ++_M_gcount;
+ __c = __sb->snextc();
+ }
+ if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
+ && !traits_type::eq_int_type(__c, __eof))
+ {
+ _M_gcount =
+ __gnu_cxx::__numeric_traits<streamsize>::__min;
+ __large_ignore = true;
+ }
+ else
+ break;
+ }
+
+ if (__large_ignore)
+ _M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
+
+ if (traits_type::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ ignore(streamsize __n, int_type __delim)
+ {
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb && __n > 0)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ int_type __c = __sb->sgetc();
+
+ // See comment above.
+ bool __large_ignore = false;
+ while (true)
+ {
+ while (_M_gcount < __n
+ && !traits_type::eq_int_type(__c, __eof)
+ && !traits_type::eq_int_type(__c, __delim))
+ {
+ ++_M_gcount;
+ __c = __sb->snextc();
+ }
+ if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
+ && !traits_type::eq_int_type(__c, __eof)
+ && !traits_type::eq_int_type(__c, __delim))
+ {
+ _M_gcount =
+ __gnu_cxx::__numeric_traits<streamsize>::__min;
+ __large_ignore = true;
+ }
+ else
+ break;
+ }
+
+ if (__large_ignore)
+ _M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
+
+ if (traits_type::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ else if (traits_type::eq_int_type(__c, __delim))
+ {
+ if (_M_gcount
+ < __gnu_cxx::__numeric_traits<streamsize>::__max)
+ ++_M_gcount;
+ __sb->sbumpc();
+ }
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_istream<_CharT, _Traits>::int_type
+ basic_istream<_CharT, _Traits>::
+ peek(void)
+ {
+ int_type __c = traits_type::eof();
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ __c = this->rdbuf()->sgetc();
+ if (traits_type::eq_int_type(__c, traits_type::eof()))
+ __err |= ios_base::eofbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return __c;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ read(char_type* __s, streamsize __n)
+ {
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ _M_gcount = this->rdbuf()->sgetn(__s, __n);
+ if (_M_gcount != __n)
+ __err |= (ios_base::eofbit | ios_base::failbit);
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ streamsize
+ basic_istream<_CharT, _Traits>::
+ readsome(char_type* __s, streamsize __n)
+ {
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ // Cannot compare int_type with streamsize generically.
+ const streamsize __num = this->rdbuf()->in_avail();
+ if (__num > 0)
+ _M_gcount = this->rdbuf()->sgetn(__s, std::min(__num, __n));
+ else if (__num == -1)
+ __err |= ios_base::eofbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return _M_gcount;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ putback(char_type __c)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 60. What is a formatted input function?
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ if (!__sb
+ || traits_type::eq_int_type(__sb->sputbackc(__c), __eof))
+ __err |= ios_base::badbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ unget(void)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 60. What is a formatted input function?
+ _M_gcount = 0;
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ if (!__sb
+ || traits_type::eq_int_type(__sb->sungetc(), __eof))
+ __err |= ios_base::badbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ int
+ basic_istream<_CharT, _Traits>::
+ sync(void)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR60. Do not change _M_gcount.
+ int __ret = -1;
+ sentry __cerb(*this, true);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ __streambuf_type* __sb = this->rdbuf();
+ if (__sb)
+ {
+ if (__sb->pubsync() == -1)
+ __err |= ios_base::badbit;
+ else
+ __ret = 0;
+ }
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_istream<_CharT, _Traits>::pos_type
+ basic_istream<_CharT, _Traits>::
+ tellg(void)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR60. Do not change _M_gcount.
+ pos_type __ret = pos_type(-1);
+ __try
+ {
+ if (!this->fail())
+ __ret = this->rdbuf()->pubseekoff(0, ios_base::cur,
+ ios_base::in);
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ seekg(pos_type __pos)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR60. Do not change _M_gcount.
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ if (!this->fail())
+ {
+ // 136. seekp, seekg setting wrong streams?
+ const pos_type __p = this->rdbuf()->pubseekpos(__pos,
+ ios_base::in);
+
+ // 129. Need error indication from seekp() and seekg()
+ if (__p == pos_type(off_type(-1)))
+ __err |= ios_base::failbit;
+ }
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ seekg(off_type __off, ios_base::seekdir __dir)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR60. Do not change _M_gcount.
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ if (!this->fail())
+ {
+ // 136. seekp, seekg setting wrong streams?
+ const pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
+ ios_base::in);
+
+ // 129. Need error indication from seekp() and seekg()
+ if (__p == pos_type(off_type(-1)))
+ __err |= ios_base::failbit;
+ }
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ // 27.6.1.2.3 Character extraction templates
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
+ {
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::int_type __int_type;
+
+ typename __istream_type::sentry __cerb(__in, false);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ const __int_type __cb = __in.rdbuf()->sbumpc();
+ if (!_Traits::eq_int_type(__cb, _Traits::eof()))
+ __c = _Traits::to_char_type(__cb);
+ else
+ __err |= (ios_base::eofbit | ios_base::failbit);
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { __in._M_setstate(ios_base::badbit); }
+ if (__err)
+ __in.setstate(__err);
+ }
+ return __in;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
+ {
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
+ typedef typename _Traits::int_type int_type;
+ typedef _CharT char_type;
+ typedef ctype<_CharT> __ctype_type;
+
+ streamsize __extracted = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ typename __istream_type::sentry __cerb(__in, false);
+ if (__cerb)
+ {
+ __try
+ {
+ // Figure out how many characters to extract.
+ streamsize __num = __in.width();
+ if (__num <= 0)
+ __num = __gnu_cxx::__numeric_traits<streamsize>::__max;
+
+ const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
+
+ const int_type __eof = _Traits::eof();
+ __streambuf_type* __sb = __in.rdbuf();
+ int_type __c = __sb->sgetc();
+
+ while (__extracted < __num - 1
+ && !_Traits::eq_int_type(__c, __eof)
+ && !__ct.is(ctype_base::space,
+ _Traits::to_char_type(__c)))
+ {
+ *__s++ = _Traits::to_char_type(__c);
+ ++__extracted;
+ __c = __sb->snextc();
+ }
+ if (_Traits::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 68. Extractors for char* should store null at end
+ *__s = char_type();
+ __in.width(0);
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { __in._M_setstate(ios_base::badbit); }
+ }
+ if (!__extracted)
+ __err |= ios_base::failbit;
+ if (__err)
+ __in.setstate(__err);
+ return __in;
+ }
+
+ // 27.6.1.4 Standard basic_istream manipulators
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ ws(basic_istream<_CharT, _Traits>& __in)
+ {
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
+ typedef typename __istream_type::int_type __int_type;
+ typedef ctype<_CharT> __ctype_type;
+
+ const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
+ const __int_type __eof = _Traits::eof();
+ __streambuf_type* __sb = __in.rdbuf();
+ __int_type __c = __sb->sgetc();
+
+ while (!_Traits::eq_int_type(__c, __eof)
+ && __ct.is(ctype_base::space, _Traits::to_char_type(__c)))
+ __c = __sb->snextc();
+
+ if (_Traits::eq_int_type(__c, __eof))
+ __in.setstate(ios_base::eofbit);
+ return __in;
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class basic_istream<char>;
+ extern template istream& ws(istream&);
+ extern template istream& operator>>(istream&, char&);
+ extern template istream& operator>>(istream&, char*);
+ extern template istream& operator>>(istream&, unsigned char&);
+ extern template istream& operator>>(istream&, signed char&);
+ extern template istream& operator>>(istream&, unsigned char*);
+ extern template istream& operator>>(istream&, signed char*);
+
+ extern template istream& istream::_M_extract(unsigned short&);
+ extern template istream& istream::_M_extract(unsigned int&);
+ extern template istream& istream::_M_extract(long&);
+ extern template istream& istream::_M_extract(unsigned long&);
+ extern template istream& istream::_M_extract(bool&);
+#ifdef _GLIBCXX_USE_LONG_LONG
+ extern template istream& istream::_M_extract(long long&);
+ extern template istream& istream::_M_extract(unsigned long long&);
+#endif
+ extern template istream& istream::_M_extract(float&);
+ extern template istream& istream::_M_extract(double&);
+ extern template istream& istream::_M_extract(long double&);
+ extern template istream& istream::_M_extract(void*&);
+
+ extern template class basic_iostream<char>;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class basic_istream<wchar_t>;
+ extern template wistream& ws(wistream&);
+ extern template wistream& operator>>(wistream&, wchar_t&);
+ extern template wistream& operator>>(wistream&, wchar_t*);
+
+ extern template wistream& wistream::_M_extract(unsigned short&);
+ extern template wistream& wistream::_M_extract(unsigned int&);
+ extern template wistream& wistream::_M_extract(long&);
+ extern template wistream& wistream::_M_extract(unsigned long&);
+ extern template wistream& wistream::_M_extract(bool&);
+#ifdef _GLIBCXX_USE_LONG_LONG
+ extern template wistream& wistream::_M_extract(long long&);
+ extern template wistream& wistream::_M_extract(unsigned long long&);
+#endif
+ extern template wistream& wistream::_M_extract(float&);
+ extern template wistream& wistream::_M_extract(double&);
+ extern template wistream& wistream::_M_extract(long double&);
+ extern template wistream& wistream::_M_extract(void*&);
+
+ extern template class basic_iostream<wchar_t>;
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/list.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/list.tcc
new file mode 100644
index 0000000..899b418
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/list.tcc
@@ -0,0 +1,416 @@
+// List implementation (out of line) -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file list.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _LIST_TCC
+#define _LIST_TCC 1
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ template<typename _Tp, typename _Alloc>
+ void
+ _List_base<_Tp, _Alloc>::
+ _M_clear()
+ {
+ typedef _List_node<_Tp> _Node;
+ _Node* __cur = static_cast<_Node*>(this->_M_impl._M_node._M_next);
+ while (__cur != &this->_M_impl._M_node)
+ {
+ _Node* __tmp = __cur;
+ __cur = static_cast<_Node*>(__cur->_M_next);
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ _M_get_Node_allocator().destroy(__tmp);
+#else
+ _M_get_Tp_allocator().destroy(&__tmp->_M_data);
+#endif
+ _M_put_node(__tmp);
+ }
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ template<typename... _Args>
+ typename list<_Tp, _Alloc>::iterator
+ list<_Tp, _Alloc>::
+ emplace(iterator __position, _Args&&... __args)
+ {
+ _Node* __tmp = _M_create_node(std::forward<_Args>(__args)...);
+ __tmp->hook(__position._M_node);
+ return iterator(__tmp);
+ }
+#endif
+
+ template<typename _Tp, typename _Alloc>
+ typename list<_Tp, _Alloc>::iterator
+ list<_Tp, _Alloc>::
+ insert(iterator __position, const value_type& __x)
+ {
+ _Node* __tmp = _M_create_node(__x);
+ __tmp->hook(__position._M_node);
+ return iterator(__tmp);
+ }
+
+ template<typename _Tp, typename _Alloc>
+ typename list<_Tp, _Alloc>::iterator
+ list<_Tp, _Alloc>::
+ erase(iterator __position)
+ {
+ iterator __ret = iterator(__position._M_node->_M_next);
+ _M_erase(__position);
+ return __ret;
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ list<_Tp, _Alloc>::
+ resize(size_type __new_size, value_type __x)
+ {
+ iterator __i = begin();
+ size_type __len = 0;
+ for (; __i != end() && __len < __new_size; ++__i, ++__len)
+ ;
+ if (__len == __new_size)
+ erase(__i, end());
+ else // __i == end()
+ insert(end(), __new_size - __len, __x);
+ }
+
+ template<typename _Tp, typename _Alloc>
+ list<_Tp, _Alloc>&
+ list<_Tp, _Alloc>::
+ operator=(const list& __x)
+ {
+ if (this != &__x)
+ {
+ iterator __first1 = begin();
+ iterator __last1 = end();
+ const_iterator __first2 = __x.begin();
+ const_iterator __last2 = __x.end();
+ for (; __first1 != __last1 && __first2 != __last2;
+ ++__first1, ++__first2)
+ *__first1 = *__first2;
+ if (__first2 == __last2)
+ erase(__first1, __last1);
+ else
+ insert(__last1, __first2, __last2);
+ }
+ return *this;
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ list<_Tp, _Alloc>::
+ _M_fill_assign(size_type __n, const value_type& __val)
+ {
+ iterator __i = begin();
+ for (; __i != end() && __n > 0; ++__i, --__n)
+ *__i = __val;
+ if (__n > 0)
+ insert(end(), __n, __val);
+ else
+ erase(__i, end());
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template <typename _InputIterator>
+ void
+ list<_Tp, _Alloc>::
+ _M_assign_dispatch(_InputIterator __first2, _InputIterator __last2,
+ __false_type)
+ {
+ iterator __first1 = begin();
+ iterator __last1 = end();
+ for (; __first1 != __last1 && __first2 != __last2;
+ ++__first1, ++__first2)
+ *__first1 = *__first2;
+ if (__first2 == __last2)
+ erase(__first1, __last1);
+ else
+ insert(__last1, __first2, __last2);
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ list<_Tp, _Alloc>::
+ remove(const value_type& __value)
+ {
+ iterator __first = begin();
+ iterator __last = end();
+ iterator __extra = __last;
+ while (__first != __last)
+ {
+ iterator __next = __first;
+ ++__next;
+ if (*__first == __value)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 526. Is it undefined if a function in the standard changes
+ // in parameters?
+ if (&*__first != &__value)
+ _M_erase(__first);
+ else
+ __extra = __first;
+ }
+ __first = __next;
+ }
+ if (__extra != __last)
+ _M_erase(__extra);
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ list<_Tp, _Alloc>::
+ unique()
+ {
+ iterator __first = begin();
+ iterator __last = end();
+ if (__first == __last)
+ return;
+ iterator __next = __first;
+ while (++__next != __last)
+ {
+ if (*__first == *__next)
+ _M_erase(__next);
+ else
+ __first = __next;
+ __next = __first;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ list<_Tp, _Alloc>::
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ merge(list&& __x)
+#else
+ merge(list& __x)
+#endif
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 300. list::merge() specification incomplete
+ if (this != &__x)
+ {
+ _M_check_equal_allocators(__x);
+
+ iterator __first1 = begin();
+ iterator __last1 = end();
+ iterator __first2 = __x.begin();
+ iterator __last2 = __x.end();
+ while (__first1 != __last1 && __first2 != __last2)
+ if (*__first2 < *__first1)
+ {
+ iterator __next = __first2;
+ _M_transfer(__first1, __first2, ++__next);
+ __first2 = __next;
+ }
+ else
+ ++__first1;
+ if (__first2 != __last2)
+ _M_transfer(__last1, __first2, __last2);
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template <typename _StrictWeakOrdering>
+ void
+ list<_Tp, _Alloc>::
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ merge(list&& __x, _StrictWeakOrdering __comp)
+#else
+ merge(list& __x, _StrictWeakOrdering __comp)
+#endif
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 300. list::merge() specification incomplete
+ if (this != &__x)
+ {
+ _M_check_equal_allocators(__x);
+
+ iterator __first1 = begin();
+ iterator __last1 = end();
+ iterator __first2 = __x.begin();
+ iterator __last2 = __x.end();
+ while (__first1 != __last1 && __first2 != __last2)
+ if (__comp(*__first2, *__first1))
+ {
+ iterator __next = __first2;
+ _M_transfer(__first1, __first2, ++__next);
+ __first2 = __next;
+ }
+ else
+ ++__first1;
+ if (__first2 != __last2)
+ _M_transfer(__last1, __first2, __last2);
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ list<_Tp, _Alloc>::
+ sort()
+ {
+ // Do nothing if the list has length 0 or 1.
+ if (this->_M_impl._M_node._M_next != &this->_M_impl._M_node
+ && this->_M_impl._M_node._M_next->_M_next != &this->_M_impl._M_node)
+ {
+ list __carry;
+ list __tmp[64];
+ list * __fill = &__tmp[0];
+ list * __counter;
+
+ do
+ {
+ __carry.splice(__carry.begin(), *this, begin());
+
+ for(__counter = &__tmp[0];
+ __counter != __fill && !__counter->empty();
+ ++__counter)
+ {
+ __counter->merge(__carry);
+ __carry.swap(*__counter);
+ }
+ __carry.swap(*__counter);
+ if (__counter == __fill)
+ ++__fill;
+ }
+ while ( !empty() );
+
+ for (__counter = &__tmp[1]; __counter != __fill; ++__counter)
+ __counter->merge(*(__counter - 1));
+ swap( *(__fill - 1) );
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template <typename _Predicate>
+ void
+ list<_Tp, _Alloc>::
+ remove_if(_Predicate __pred)
+ {
+ iterator __first = begin();
+ iterator __last = end();
+ while (__first != __last)
+ {
+ iterator __next = __first;
+ ++__next;
+ if (__pred(*__first))
+ _M_erase(__first);
+ __first = __next;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template <typename _BinaryPredicate>
+ void
+ list<_Tp, _Alloc>::
+ unique(_BinaryPredicate __binary_pred)
+ {
+ iterator __first = begin();
+ iterator __last = end();
+ if (__first == __last)
+ return;
+ iterator __next = __first;
+ while (++__next != __last)
+ {
+ if (__binary_pred(*__first, *__next))
+ _M_erase(__next);
+ else
+ __first = __next;
+ __next = __first;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template <typename _StrictWeakOrdering>
+ void
+ list<_Tp, _Alloc>::
+ sort(_StrictWeakOrdering __comp)
+ {
+ // Do nothing if the list has length 0 or 1.
+ if (this->_M_impl._M_node._M_next != &this->_M_impl._M_node
+ && this->_M_impl._M_node._M_next->_M_next != &this->_M_impl._M_node)
+ {
+ list __carry;
+ list __tmp[64];
+ list * __fill = &__tmp[0];
+ list * __counter;
+
+ do
+ {
+ __carry.splice(__carry.begin(), *this, begin());
+
+ for(__counter = &__tmp[0];
+ __counter != __fill && !__counter->empty();
+ ++__counter)
+ {
+ __counter->merge(__carry, __comp);
+ __carry.swap(*__counter);
+ }
+ __carry.swap(*__counter);
+ if (__counter == __fill)
+ ++__fill;
+ }
+ while ( !empty() );
+
+ for (__counter = &__tmp[1]; __counter != __fill; ++__counter)
+ __counter->merge(*(__counter - 1), __comp);
+ swap(*(__fill - 1));
+ }
+ }
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _LIST_TCC */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_classes.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_classes.h
new file mode 100644
index 0000000..4a64693
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_classes.h
@@ -0,0 +1,812 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file locale_classes.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+#ifndef _LOCALE_CLASSES_H
+#define _LOCALE_CLASSES_H 1
+
+#pragma GCC system_header
+
+#include <bits/localefwd.h>
+#include <string>
+#include <ext/atomicity.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 22.1.1 Class locale
+ /**
+ * @brief Container class for localization functionality.
+ *
+ * The locale class is first a class wrapper for C library locales. It is
+ * also an extensible container for user-defined localization. A locale is
+ * a collection of facets that implement various localization features such
+ * as money, time, and number printing.
+ *
+ * Constructing C++ locales does not change the C library locale.
+ *
+ * This library supports efficient construction and copying of locales
+ * through a reference counting implementation of the locale class.
+ */
+ class locale
+ {
+ public:
+ // Types:
+ /// Definition of locale::category.
+ typedef int category;
+
+ // Forward decls and friends:
+ class facet;
+ class id;
+ class _Impl;
+
+ friend class facet;
+ friend class _Impl;
+
+ template<typename _Facet>
+ friend bool
+ has_facet(const locale&) throw();
+
+ template<typename _Facet>
+ friend const _Facet&
+ use_facet(const locale&);
+
+ template<typename _Cache>
+ friend struct __use_cache;
+
+ //@{
+ /**
+ * @brief Category values.
+ *
+ * The standard category values are none, ctype, numeric, collate, time,
+ * monetary, and messages. They form a bitmask that supports union and
+ * intersection. The category all is the union of these values.
+ *
+ * NB: Order must match _S_facet_categories definition in locale.cc
+ */
+ static const category none = 0;
+ static const category ctype = 1L << 0;
+ static const category numeric = 1L << 1;
+ static const category collate = 1L << 2;
+ static const category time = 1L << 3;
+ static const category monetary = 1L << 4;
+ static const category messages = 1L << 5;
+ static const category all = (ctype | numeric | collate |
+ time | monetary | messages);
+ //@}
+
+ // Construct/copy/destroy:
+
+ /**
+ * @brief Default constructor.
+ *
+ * Constructs a copy of the global locale. If no locale has been
+ * explicitly set, this is the "C" locale.
+ */
+ locale() throw();
+
+ /**
+ * @brief Copy constructor.
+ *
+ * Constructs a copy of @a other.
+ *
+ * @param other The locale to copy.
+ */
+ locale(const locale& __other) throw();
+
+ /**
+ * @brief Named locale constructor.
+ *
+ * Constructs a copy of the named C library locale.
+ *
+ * @param s Name of the locale to construct.
+ * @throw std::runtime_error if s is null or an undefined locale.
+ */
+ explicit
+ locale(const char* __s);
+
+ /**
+ * @brief Construct locale with facets from another locale.
+ *
+ * Constructs a copy of the locale @a base. The facets specified by @a
+ * cat are replaced with those from the locale named by @a s. If base is
+ * named, this locale instance will also be named.
+ *
+ * @param base The locale to copy.
+ * @param s Name of the locale to use facets from.
+ * @param cat Set of categories defining the facets to use from s.
+ * @throw std::runtime_error if s is null or an undefined locale.
+ */
+ locale(const locale& __base, const char* __s, category __cat);
+
+ /**
+ * @brief Construct locale with facets from another locale.
+ *
+ * Constructs a copy of the locale @a base. The facets specified by @a
+ * cat are replaced with those from the locale @a add. If @a base and @a
+ * add are named, this locale instance will also be named.
+ *
+ * @param base The locale to copy.
+ * @param add The locale to use facets from.
+ * @param cat Set of categories defining the facets to use from add.
+ */
+ locale(const locale& __base, const locale& __add, category __cat);
+
+ /**
+ * @brief Construct locale with another facet.
+ *
+ * Constructs a copy of the locale @a other. The facet @f is added to
+ * @other, replacing an existing facet of type Facet if there is one. If
+ * @f is null, this locale is a copy of @a other.
+ *
+ * @param other The locale to copy.
+ * @param f The facet to add in.
+ */
+ template<typename _Facet>
+ locale(const locale& __other, _Facet* __f);
+
+ /// Locale destructor.
+ ~locale() throw();
+
+ /**
+ * @brief Assignment operator.
+ *
+ * Set this locale to be a copy of @a other.
+ *
+ * @param other The locale to copy.
+ * @return A reference to this locale.
+ */
+ const locale&
+ operator=(const locale& __other) throw();
+
+ /**
+ * @brief Construct locale with another facet.
+ *
+ * Constructs and returns a new copy of this locale. Adds or replaces an
+ * existing facet of type Facet from the locale @a other into the new
+ * locale.
+ *
+ * @param Facet The facet type to copy from other
+ * @param other The locale to copy from.
+ * @return Newly constructed locale.
+ * @throw std::runtime_error if other has no facet of type Facet.
+ */
+ template<typename _Facet>
+ locale
+ combine(const locale& __other) const;
+
+ // Locale operations:
+ /**
+ * @brief Return locale name.
+ * @return Locale name or "*" if unnamed.
+ */
+ string
+ name() const;
+
+ /**
+ * @brief Locale equality.
+ *
+ * @param other The locale to compare against.
+ * @return True if other and this refer to the same locale instance, are
+ * copies, or have the same name. False otherwise.
+ */
+ bool
+ operator==(const locale& __other) const throw ();
+
+ /**
+ * @brief Locale inequality.
+ *
+ * @param other The locale to compare against.
+ * @return ! (*this == other)
+ */
+ bool
+ operator!=(const locale& __other) const throw ()
+ { return !(this->operator==(__other)); }
+
+ /**
+ * @brief Compare two strings according to collate.
+ *
+ * Template operator to compare two strings using the compare function of
+ * the collate facet in this locale. One use is to provide the locale to
+ * the sort function. For example, a vector v of strings could be sorted
+ * according to locale loc by doing:
+ * @code
+ * std::sort(v.begin(), v.end(), loc);
+ * @endcode
+ *
+ * @param s1 First string to compare.
+ * @param s2 Second string to compare.
+ * @return True if collate<Char> facet compares s1 < s2, else false.
+ */
+ template<typename _Char, typename _Traits, typename _Alloc>
+ bool
+ operator()(const basic_string<_Char, _Traits, _Alloc>& __s1,
+ const basic_string<_Char, _Traits, _Alloc>& __s2) const;
+
+ // Global locale objects:
+ /**
+ * @brief Set global locale
+ *
+ * This function sets the global locale to the argument and returns a
+ * copy of the previous global locale. If the argument has a name, it
+ * will also call std::setlocale(LC_ALL, loc.name()).
+ *
+ * @param locale The new locale to make global.
+ * @return Copy of the old global locale.
+ */
+ static locale
+ global(const locale&);
+
+ /**
+ * @brief Return reference to the "C" locale.
+ */
+ static const locale&
+ classic();
+
+ private:
+ // The (shared) implementation
+ _Impl* _M_impl;
+
+ // The "C" reference locale
+ static _Impl* _S_classic;
+
+ // Current global locale
+ static _Impl* _S_global;
+
+ // Names of underlying locale categories.
+ // NB: locale::global() has to know how to modify all the
+ // underlying categories, not just the ones required by the C++
+ // standard.
+ static const char* const* const _S_categories;
+
+ // Number of standard categories. For C++, these categories are
+ // collate, ctype, monetary, numeric, time, and messages. These
+ // directly correspond to ISO C99 macros LC_COLLATE, LC_CTYPE,
+ // LC_MONETARY, LC_NUMERIC, and LC_TIME. In addition, POSIX (IEEE
+ // 1003.1-2001) specifies LC_MESSAGES.
+ // In addition to the standard categories, the underlying
+ // operating system is allowed to define extra LC_*
+ // macros. For GNU systems, the following are also valid:
+ // LC_PAPER, LC_NAME, LC_ADDRESS, LC_TELEPHONE, LC_MEASUREMENT,
+ // and LC_IDENTIFICATION.
+ enum { _S_categories_size = 6 + _GLIBCXX_NUM_CATEGORIES };
+
+#ifdef __GTHREADS
+ static __gthread_once_t _S_once;
+#endif
+
+ explicit
+ locale(_Impl*) throw();
+
+ static void
+ _S_initialize();
+
+ static void
+ _S_initialize_once();
+
+ static category
+ _S_normalize_category(category);
+
+ void
+ _M_coalesce(const locale& __base, const locale& __add, category __cat);
+ };
+
+
+ // 22.1.1.1.2 Class locale::facet
+ /**
+ * @brief Localization functionality base class.
+ *
+ * The facet class is the base class for a localization feature, such as
+ * money, time, and number printing. It provides common support for facets
+ * and reference management.
+ *
+ * Facets may not be copied or assigned.
+ */
+ class locale::facet
+ {
+ private:
+ friend class locale;
+ friend class locale::_Impl;
+
+ mutable _Atomic_word _M_refcount;
+
+ // Contains data from the underlying "C" library for the classic locale.
+ static __c_locale _S_c_locale;
+
+ // String literal for the name of the classic locale.
+ static const char _S_c_name[2];
+
+#ifdef __GTHREADS
+ static __gthread_once_t _S_once;
+#endif
+
+ static void
+ _S_initialize_once();
+
+ protected:
+ /**
+ * @brief Facet constructor.
+ *
+ * This is the constructor provided by the standard. If refs is 0, the
+ * facet is destroyed when the last referencing locale is destroyed.
+ * Otherwise the facet will never be destroyed.
+ *
+ * @param refs The initial value for reference count.
+ */
+ explicit
+ facet(size_t __refs = 0) throw() : _M_refcount(__refs ? 1 : 0)
+ { }
+
+ /// Facet destructor.
+ virtual
+ ~facet();
+
+ static void
+ _S_create_c_locale(__c_locale& __cloc, const char* __s,
+ __c_locale __old = 0);
+
+ static __c_locale
+ _S_clone_c_locale(__c_locale& __cloc);
+
+ static void
+ _S_destroy_c_locale(__c_locale& __cloc);
+
+ // Returns data from the underlying "C" library data for the
+ // classic locale.
+ static __c_locale
+ _S_get_c_locale();
+
+ static const char*
+ _S_get_c_name();
+
+ private:
+ void
+ _M_add_reference() const throw()
+ { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
+
+ void
+ _M_remove_reference() const throw()
+ {
+ if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1)
+ {
+ __try
+ { delete this; }
+ __catch(...)
+ { }
+ }
+ }
+
+ facet(const facet&); // Not defined.
+
+ facet&
+ operator=(const facet&); // Not defined.
+ };
+
+
+ // 22.1.1.1.3 Class locale::id
+ /**
+ * @brief Facet ID class.
+ *
+ * The ID class provides facets with an index used to identify them.
+ * Every facet class must define a public static member locale::id, or be
+ * derived from a facet that provides this member, otherwise the facet
+ * cannot be used in a locale. The locale::id ensures that each class
+ * type gets a unique identifier.
+ */
+ class locale::id
+ {
+ private:
+ friend class locale;
+ friend class locale::_Impl;
+
+ template<typename _Facet>
+ friend const _Facet&
+ use_facet(const locale&);
+
+ template<typename _Facet>
+ friend bool
+ has_facet(const locale&) throw ();
+
+ // NB: There is no accessor for _M_index because it may be used
+ // before the constructor is run; the effect of calling a member
+ // function (even an inline) would be undefined.
+ mutable size_t _M_index;
+
+ // Last id number assigned.
+ static _Atomic_word _S_refcount;
+
+ void
+ operator=(const id&); // Not defined.
+
+ id(const id&); // Not defined.
+
+ public:
+ // NB: This class is always a static data member, and thus can be
+ // counted on to be zero-initialized.
+ /// Constructor.
+ id() { }
+
+ size_t
+ _M_id() const;
+ };
+
+
+ // Implementation object for locale.
+ class locale::_Impl
+ {
+ public:
+ // Friends.
+ friend class locale;
+ friend class locale::facet;
+
+ template<typename _Facet>
+ friend bool
+ has_facet(const locale&) throw();
+
+ template<typename _Facet>
+ friend const _Facet&
+ use_facet(const locale&);
+
+ template<typename _Cache>
+ friend struct __use_cache;
+
+ private:
+ // Data Members.
+ _Atomic_word _M_refcount;
+ const facet** _M_facets;
+ size_t _M_facets_size;
+ const facet** _M_caches;
+ char** _M_names;
+ static const locale::id* const _S_id_ctype[];
+ static const locale::id* const _S_id_numeric[];
+ static const locale::id* const _S_id_collate[];
+ static const locale::id* const _S_id_time[];
+ static const locale::id* const _S_id_monetary[];
+ static const locale::id* const _S_id_messages[];
+ static const locale::id* const* const _S_facet_categories[];
+
+ void
+ _M_add_reference() throw()
+ { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
+
+ void
+ _M_remove_reference() throw()
+ {
+ if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1)
+ {
+ __try
+ { delete this; }
+ __catch(...)
+ { }
+ }
+ }
+
+ _Impl(const _Impl&, size_t);
+ _Impl(const char*, size_t);
+ _Impl(size_t) throw();
+
+ ~_Impl() throw();
+
+ _Impl(const _Impl&); // Not defined.
+
+ void
+ operator=(const _Impl&); // Not defined.
+
+ bool
+ _M_check_same_name()
+ {
+ bool __ret = true;
+ if (_M_names[1])
+ // We must actually compare all the _M_names: can be all equal!
+ for (size_t __i = 0; __ret && __i < _S_categories_size - 1; ++__i)
+ __ret = __builtin_strcmp(_M_names[__i], _M_names[__i + 1]) == 0;
+ return __ret;
+ }
+
+ void
+ _M_replace_categories(const _Impl*, category);
+
+ void
+ _M_replace_category(const _Impl*, const locale::id* const*);
+
+ void
+ _M_replace_facet(const _Impl*, const locale::id*);
+
+ void
+ _M_install_facet(const locale::id*, const facet*);
+
+ template<typename _Facet>
+ void
+ _M_init_facet(_Facet* __facet)
+ { _M_install_facet(&_Facet::id, __facet); }
+
+ void
+ _M_install_cache(const facet*, size_t);
+ };
+
+
+ /**
+ * @brief Test for the presence of a facet.
+ *
+ * has_facet tests the locale argument for the presence of the facet type
+ * provided as the template parameter. Facets derived from the facet
+ * parameter will also return true.
+ *
+ * @param Facet The facet type to test the presence of.
+ * @param locale The locale to test.
+ * @return true if locale contains a facet of type Facet, else false.
+ */
+ template<typename _Facet>
+ bool
+ has_facet(const locale& __loc) throw();
+
+ /**
+ * @brief Return a facet.
+ *
+ * use_facet looks for and returns a reference to a facet of type Facet
+ * where Facet is the template parameter. If has_facet(locale) is true,
+ * there is a suitable facet to return. It throws std::bad_cast if the
+ * locale doesn't contain a facet of type Facet.
+ *
+ * @param Facet The facet type to access.
+ * @param locale The locale to use.
+ * @return Reference to facet of type Facet.
+ * @throw std::bad_cast if locale doesn't contain a facet of type Facet.
+ */
+ template<typename _Facet>
+ const _Facet&
+ use_facet(const locale& __loc);
+
+
+ /**
+ * @brief Facet for localized string comparison.
+ *
+ * This facet encapsulates the code to compare strings in a localized
+ * manner.
+ *
+ * The collate template uses protected virtual functions to provide
+ * the actual results. The public accessors forward the call to
+ * the virtual functions. These virtual functions are hooks for
+ * developers to implement the behavior they require from the
+ * collate facet.
+ */
+ template<typename _CharT>
+ class collate : public locale::facet
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef basic_string<_CharT> string_type;
+ //@}
+
+ protected:
+ // Underlying "C" library locale information saved from
+ // initialization, needed by collate_byname as well.
+ __c_locale _M_c_locale_collate;
+
+ public:
+ /// Numpunct facet id.
+ static locale::id id;
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ collate(size_t __refs = 0)
+ : facet(__refs), _M_c_locale_collate(_S_get_c_locale())
+ { }
+
+ /**
+ * @brief Internal constructor. Not for general use.
+ *
+ * This is a constructor for use by the library itself to set up new
+ * locales.
+ *
+ * @param cloc The "C" locale.
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ collate(__c_locale __cloc, size_t __refs = 0)
+ : facet(__refs), _M_c_locale_collate(_S_clone_c_locale(__cloc))
+ { }
+
+ /**
+ * @brief Compare two strings.
+ *
+ * This function compares two strings and returns the result by calling
+ * collate::do_compare().
+ *
+ * @param lo1 Start of string 1.
+ * @param hi1 End of string 1.
+ * @param lo2 Start of string 2.
+ * @param hi2 End of string 2.
+ * @return 1 if string1 > string2, -1 if string1 < string2, else 0.
+ */
+ int
+ compare(const _CharT* __lo1, const _CharT* __hi1,
+ const _CharT* __lo2, const _CharT* __hi2) const
+ { return this->do_compare(__lo1, __hi1, __lo2, __hi2); }
+
+ /**
+ * @brief Transform string to comparable form.
+ *
+ * This function is a wrapper for strxfrm functionality. It takes the
+ * input string and returns a modified string that can be directly
+ * compared to other transformed strings. In the "C" locale, this
+ * function just returns a copy of the input string. In some other
+ * locales, it may replace two chars with one, change a char for
+ * another, etc. It does so by returning collate::do_transform().
+ *
+ * @param lo Start of string.
+ * @param hi End of string.
+ * @return Transformed string_type.
+ */
+ string_type
+ transform(const _CharT* __lo, const _CharT* __hi) const
+ { return this->do_transform(__lo, __hi); }
+
+ /**
+ * @brief Return hash of a string.
+ *
+ * This function computes and returns a hash on the input string. It
+ * does so by returning collate::do_hash().
+ *
+ * @param lo Start of string.
+ * @param hi End of string.
+ * @return Hash value.
+ */
+ long
+ hash(const _CharT* __lo, const _CharT* __hi) const
+ { return this->do_hash(__lo, __hi); }
+
+ // Used to abstract out _CharT bits in virtual member functions, below.
+ int
+ _M_compare(const _CharT*, const _CharT*) const;
+
+ size_t
+ _M_transform(_CharT*, const _CharT*, size_t) const;
+
+ protected:
+ /// Destructor.
+ virtual
+ ~collate()
+ { _S_destroy_c_locale(_M_c_locale_collate); }
+
+ /**
+ * @brief Compare two strings.
+ *
+ * This function is a hook for derived classes to change the value
+ * returned. @see compare().
+ *
+ * @param lo1 Start of string 1.
+ * @param hi1 End of string 1.
+ * @param lo2 Start of string 2.
+ * @param hi2 End of string 2.
+ * @return 1 if string1 > string2, -1 if string1 < string2, else 0.
+ */
+ virtual int
+ do_compare(const _CharT* __lo1, const _CharT* __hi1,
+ const _CharT* __lo2, const _CharT* __hi2) const;
+
+ /**
+ * @brief Transform string to comparable form.
+ *
+ * This function is a hook for derived classes to change the value
+ * returned.
+ *
+ * @param lo1 Start of string 1.
+ * @param hi1 End of string 1.
+ * @param lo2 Start of string 2.
+ * @param hi2 End of string 2.
+ * @return 1 if string1 > string2, -1 if string1 < string2, else 0.
+ */
+ virtual string_type
+ do_transform(const _CharT* __lo, const _CharT* __hi) const;
+
+ /**
+ * @brief Return hash of a string.
+ *
+ * This function computes and returns a hash on the input string. This
+ * function is a hook for derived classes to change the value returned.
+ *
+ * @param lo Start of string.
+ * @param hi End of string.
+ * @return Hash value.
+ */
+ virtual long
+ do_hash(const _CharT* __lo, const _CharT* __hi) const;
+ };
+
+ template<typename _CharT>
+ locale::id collate<_CharT>::id;
+
+ // Specializations.
+ template<>
+ int
+ collate<char>::_M_compare(const char*, const char*) const;
+
+ template<>
+ size_t
+ collate<char>::_M_transform(char*, const char*, size_t) const;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ int
+ collate<wchar_t>::_M_compare(const wchar_t*, const wchar_t*) const;
+
+ template<>
+ size_t
+ collate<wchar_t>::_M_transform(wchar_t*, const wchar_t*, size_t) const;
+#endif
+
+ /// class collate_byname [22.2.4.2].
+ template<typename _CharT>
+ class collate_byname : public collate<_CharT>
+ {
+ public:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef basic_string<_CharT> string_type;
+ //@}
+
+ explicit
+ collate_byname(const char* __s, size_t __refs = 0)
+ : collate<_CharT>(__refs)
+ {
+ if (__builtin_strcmp(__s, "C") != 0
+ && __builtin_strcmp(__s, "POSIX") != 0)
+ {
+ this->_S_destroy_c_locale(this->_M_c_locale_collate);
+ this->_S_create_c_locale(this->_M_c_locale_collate, __s);
+ }
+ }
+
+ protected:
+ virtual
+ ~collate_byname() { }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/locale_classes.tcc>
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_classes.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_classes.tcc
new file mode 100644
index 0000000..c97e555
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_classes.tcc
@@ -0,0 +1,271 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file locale_classes.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+#ifndef _LOCALE_CLASSES_TCC
+#define _LOCALE_CLASSES_TCC 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _Facet>
+ locale::
+ locale(const locale& __other, _Facet* __f)
+ {
+ _M_impl = new _Impl(*__other._M_impl, 1);
+
+ __try
+ { _M_impl->_M_install_facet(&_Facet::id, __f); }
+ __catch(...)
+ {
+ _M_impl->_M_remove_reference();
+ __throw_exception_again;
+ }
+ delete [] _M_impl->_M_names[0];
+ _M_impl->_M_names[0] = 0; // Unnamed.
+ }
+
+ template<typename _Facet>
+ locale
+ locale::
+ combine(const locale& __other) const
+ {
+ _Impl* __tmp = new _Impl(*_M_impl, 1);
+ __try
+ {
+ __tmp->_M_replace_facet(__other._M_impl, &_Facet::id);
+ }
+ __catch(...)
+ {
+ __tmp->_M_remove_reference();
+ __throw_exception_again;
+ }
+ return locale(__tmp);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ bool
+ locale::
+ operator()(const basic_string<_CharT, _Traits, _Alloc>& __s1,
+ const basic_string<_CharT, _Traits, _Alloc>& __s2) const
+ {
+ typedef std::collate<_CharT> __collate_type;
+ const __collate_type& __collate = use_facet<__collate_type>(*this);
+ return (__collate.compare(__s1.data(), __s1.data() + __s1.length(),
+ __s2.data(), __s2.data() + __s2.length()) < 0);
+ }
+
+
+ template<typename _Facet>
+ bool
+ has_facet(const locale& __loc) throw()
+ {
+ const size_t __i = _Facet::id._M_id();
+ const locale::facet** __facets = __loc._M_impl->_M_facets;
+ return (__i < __loc._M_impl->_M_facets_size
+#ifdef __GXX_RTTI
+ && dynamic_cast<const _Facet*>(__facets[__i]));
+#else
+ && static_cast<const _Facet*>(__facets[__i]));
+#endif
+ }
+
+ template<typename _Facet>
+ const _Facet&
+ use_facet(const locale& __loc)
+ {
+ const size_t __i = _Facet::id._M_id();
+ const locale::facet** __facets = __loc._M_impl->_M_facets;
+ if (__i >= __loc._M_impl->_M_facets_size || !__facets[__i])
+ __throw_bad_cast();
+#ifdef __GXX_RTTI
+ return dynamic_cast<const _Facet&>(*__facets[__i]);
+#else
+ return static_cast<const _Facet&>(*__facets[__i]);
+#endif
+ }
+
+
+ // Generic version does nothing.
+ template<typename _CharT>
+ int
+ collate<_CharT>::_M_compare(const _CharT*, const _CharT*) const
+ { return 0; }
+
+ // Generic version does nothing.
+ template<typename _CharT>
+ size_t
+ collate<_CharT>::_M_transform(_CharT*, const _CharT*, size_t) const
+ { return 0; }
+
+ template<typename _CharT>
+ int
+ collate<_CharT>::
+ do_compare(const _CharT* __lo1, const _CharT* __hi1,
+ const _CharT* __lo2, const _CharT* __hi2) const
+ {
+ // strcoll assumes zero-terminated strings so we make a copy
+ // and then put a zero at the end.
+ const string_type __one(__lo1, __hi1);
+ const string_type __two(__lo2, __hi2);
+
+ const _CharT* __p = __one.c_str();
+ const _CharT* __pend = __one.data() + __one.length();
+ const _CharT* __q = __two.c_str();
+ const _CharT* __qend = __two.data() + __two.length();
+
+ // strcoll stops when it sees a nul character so we break
+ // the strings into zero-terminated substrings and pass those
+ // to strcoll.
+ for (;;)
+ {
+ const int __res = _M_compare(__p, __q);
+ if (__res)
+ return __res;
+
+ __p += char_traits<_CharT>::length(__p);
+ __q += char_traits<_CharT>::length(__q);
+ if (__p == __pend && __q == __qend)
+ return 0;
+ else if (__p == __pend)
+ return -1;
+ else if (__q == __qend)
+ return 1;
+
+ __p++;
+ __q++;
+ }
+ }
+
+ template<typename _CharT>
+ typename collate<_CharT>::string_type
+ collate<_CharT>::
+ do_transform(const _CharT* __lo, const _CharT* __hi) const
+ {
+ string_type __ret;
+
+ // strxfrm assumes zero-terminated strings so we make a copy
+ const string_type __str(__lo, __hi);
+
+ const _CharT* __p = __str.c_str();
+ const _CharT* __pend = __str.data() + __str.length();
+
+ size_t __len = (__hi - __lo) * 2;
+
+ _CharT* __c = new _CharT[__len];
+
+ __try
+ {
+ // strxfrm stops when it sees a nul character so we break
+ // the string into zero-terminated substrings and pass those
+ // to strxfrm.
+ for (;;)
+ {
+ // First try a buffer perhaps big enough.
+ size_t __res = _M_transform(__c, __p, __len);
+ // If the buffer was not large enough, try again with the
+ // correct size.
+ if (__res >= __len)
+ {
+ __len = __res + 1;
+ delete [] __c, __c = 0;
+ __c = new _CharT[__len];
+ __res = _M_transform(__c, __p, __len);
+ }
+
+ __ret.append(__c, __res);
+ __p += char_traits<_CharT>::length(__p);
+ if (__p == __pend)
+ break;
+
+ __p++;
+ __ret.push_back(_CharT());
+ }
+ }
+ __catch(...)
+ {
+ delete [] __c;
+ __throw_exception_again;
+ }
+
+ delete [] __c;
+
+ return __ret;
+ }
+
+ template<typename _CharT>
+ long
+ collate<_CharT>::
+ do_hash(const _CharT* __lo, const _CharT* __hi) const
+ {
+ unsigned long __val = 0;
+ for (; __lo < __hi; ++__lo)
+ __val =
+ *__lo + ((__val << 7)
+ | (__val >> (__gnu_cxx::__numeric_traits<unsigned long>::
+ __digits - 7)));
+ return static_cast<long>(__val);
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class collate<char>;
+ extern template class collate_byname<char>;
+
+ extern template
+ const collate<char>&
+ use_facet<collate<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<collate<char> >(const locale&);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class collate<wchar_t>;
+ extern template class collate_byname<wchar_t>;
+
+ extern template
+ const collate<wchar_t>&
+ use_facet<collate<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<collate<wchar_t> >(const locale&);
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_facets.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_facets.h
new file mode 100644
index 0000000..beed6f1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_facets.h
@@ -0,0 +1,2602 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file locale_facets.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+#ifndef _LOCALE_FACETS_H
+#define _LOCALE_FACETS_H 1
+
+#pragma GCC system_header
+
+#include <cwctype> // For wctype_t
+#include <cctype>
+#include <bits/ctype_base.h>
+#include <iosfwd>
+#include <bits/ios_base.h> // For ios_base, ios_base::iostate
+#include <streambuf>
+#include <bits/cpp_type_traits.h>
+#include <ext/type_traits.h>
+#include <ext/numeric_traits.h>
+#include <bits/streambuf_iterator.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // NB: Don't instantiate required wchar_t facets if no wchar_t support.
+#ifdef _GLIBCXX_USE_WCHAR_T
+# define _GLIBCXX_NUM_FACETS 28
+#else
+# define _GLIBCXX_NUM_FACETS 14
+#endif
+
+ // Convert string to numeric value of type _Tv and store results.
+ // NB: This is specialized for all required types, there is no
+ // generic definition.
+ template<typename _Tv>
+ void
+ __convert_to_v(const char* __in, _Tv& __out, ios_base::iostate& __err,
+ const __c_locale& __cloc);
+
+ // Explicit specializations for required types.
+ template<>
+ void
+ __convert_to_v(const char*, float&, ios_base::iostate&,
+ const __c_locale&);
+
+ template<>
+ void
+ __convert_to_v(const char*, double&, ios_base::iostate&,
+ const __c_locale&);
+
+ template<>
+ void
+ __convert_to_v(const char*, long double&, ios_base::iostate&,
+ const __c_locale&);
+
+ // NB: __pad is a struct, rather than a function, so it can be
+ // partially-specialized.
+ template<typename _CharT, typename _Traits>
+ struct __pad
+ {
+ static void
+ _S_pad(ios_base& __io, _CharT __fill, _CharT* __news,
+ const _CharT* __olds, streamsize __newlen, streamsize __oldlen);
+ };
+
+ // Used by both numeric and monetary facets.
+ // Inserts "group separator" characters into an array of characters.
+ // It's recursive, one iteration per group. It moves the characters
+ // in the buffer this way: "xxxx12345" -> "12,345xxx". Call this
+ // only with __gsize != 0.
+ template<typename _CharT>
+ _CharT*
+ __add_grouping(_CharT* __s, _CharT __sep,
+ const char* __gbeg, size_t __gsize,
+ const _CharT* __first, const _CharT* __last);
+
+ // This template permits specializing facet output code for
+ // ostreambuf_iterator. For ostreambuf_iterator, sputn is
+ // significantly more efficient than incrementing iterators.
+ template<typename _CharT>
+ inline
+ ostreambuf_iterator<_CharT>
+ __write(ostreambuf_iterator<_CharT> __s, const _CharT* __ws, int __len)
+ {
+ __s._M_put(__ws, __len);
+ return __s;
+ }
+
+ // This is the unspecialized form of the template.
+ template<typename _CharT, typename _OutIter>
+ inline
+ _OutIter
+ __write(_OutIter __s, const _CharT* __ws, int __len)
+ {
+ for (int __j = 0; __j < __len; __j++, ++__s)
+ *__s = __ws[__j];
+ return __s;
+ }
+
+
+ // 22.2.1.1 Template class ctype
+ // Include host and configuration specific ctype enums for ctype_base.
+
+ // Common base for ctype<_CharT>.
+ /**
+ * @brief Common base for ctype facet
+ *
+ * This template class provides implementations of the public functions
+ * that forward to the protected virtual functions.
+ *
+ * This template also provides abstract stubs for the protected virtual
+ * functions.
+ */
+ template<typename _CharT>
+ class __ctype_abstract_base : public locale::facet, public ctype_base
+ {
+ public:
+ // Types:
+ /// Typedef for the template parameter
+ typedef _CharT char_type;
+
+ /**
+ * @brief Test char_type classification.
+ *
+ * This function finds a mask M for @a c and compares it to mask @a m.
+ * It does so by returning the value of ctype<char_type>::do_is().
+ *
+ * @param c The char_type to compare the mask of.
+ * @param m The mask to compare against.
+ * @return (M & m) != 0.
+ */
+ bool
+ is(mask __m, char_type __c) const
+ { return this->do_is(__m, __c); }
+
+ /**
+ * @brief Return a mask array.
+ *
+ * This function finds the mask for each char_type in the range [lo,hi)
+ * and successively writes it to vec. vec must have as many elements
+ * as the char array. It does so by returning the value of
+ * ctype<char_type>::do_is().
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param vec Pointer to an array of mask storage.
+ * @return @a hi.
+ */
+ const char_type*
+ is(const char_type *__lo, const char_type *__hi, mask *__vec) const
+ { return this->do_is(__lo, __hi, __vec); }
+
+ /**
+ * @brief Find char_type matching a mask
+ *
+ * This function searches for and returns the first char_type c in
+ * [lo,hi) for which is(m,c) is true. It does so by returning
+ * ctype<char_type>::do_scan_is().
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to matching char_type if found, else @a hi.
+ */
+ const char_type*
+ scan_is(mask __m, const char_type* __lo, const char_type* __hi) const
+ { return this->do_scan_is(__m, __lo, __hi); }
+
+ /**
+ * @brief Find char_type not matching a mask
+ *
+ * This function searches for and returns the first char_type c in
+ * [lo,hi) for which is(m,c) is false. It does so by returning
+ * ctype<char_type>::do_scan_not().
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to first char in range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to non-matching char if found, else @a hi.
+ */
+ const char_type*
+ scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
+ { return this->do_scan_not(__m, __lo, __hi); }
+
+ /**
+ * @brief Convert to uppercase.
+ *
+ * This function converts the argument to uppercase if possible.
+ * If not possible (for example, '2'), returns the argument. It does
+ * so by returning ctype<char_type>::do_toupper().
+ *
+ * @param c The char_type to convert.
+ * @return The uppercase char_type if convertible, else @a c.
+ */
+ char_type
+ toupper(char_type __c) const
+ { return this->do_toupper(__c); }
+
+ /**
+ * @brief Convert array to uppercase.
+ *
+ * This function converts each char_type in the range [lo,hi) to
+ * uppercase if possible. Other elements remain untouched. It does so
+ * by returning ctype<char_type>:: do_toupper(lo, hi).
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
+ const char_type*
+ toupper(char_type *__lo, const char_type* __hi) const
+ { return this->do_toupper(__lo, __hi); }
+
+ /**
+ * @brief Convert to lowercase.
+ *
+ * This function converts the argument to lowercase if possible. If
+ * not possible (for example, '2'), returns the argument. It does so
+ * by returning ctype<char_type>::do_tolower(c).
+ *
+ * @param c The char_type to convert.
+ * @return The lowercase char_type if convertible, else @a c.
+ */
+ char_type
+ tolower(char_type __c) const
+ { return this->do_tolower(__c); }
+
+ /**
+ * @brief Convert array to lowercase.
+ *
+ * This function converts each char_type in the range [lo,hi) to
+ * lowercase if possible. Other elements remain untouched. It does so
+ * by returning ctype<char_type>:: do_tolower(lo, hi).
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
+ const char_type*
+ tolower(char_type* __lo, const char_type* __hi) const
+ { return this->do_tolower(__lo, __hi); }
+
+ /**
+ * @brief Widen char to char_type
+ *
+ * This function converts the char argument to char_type using the
+ * simplest reasonable transformation. It does so by returning
+ * ctype<char_type>::do_widen(c).
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char to convert.
+ * @return The converted char_type.
+ */
+ char_type
+ widen(char __c) const
+ { return this->do_widen(__c); }
+
+ /**
+ * @brief Widen array to char_type
+ *
+ * This function converts each char in the input to char_type using the
+ * simplest reasonable transformation. It does so by returning
+ * ctype<char_type>::do_widen(c).
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
+ const char*
+ widen(const char* __lo, const char* __hi, char_type* __to) const
+ { return this->do_widen(__lo, __hi, __to); }
+
+ /**
+ * @brief Narrow char_type to char
+ *
+ * This function converts the char_type to char using the simplest
+ * reasonable transformation. If the conversion fails, dfault is
+ * returned instead. It does so by returning
+ * ctype<char_type>::do_narrow(c).
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char_type to convert.
+ * @param dfault Char to return if conversion fails.
+ * @return The converted char.
+ */
+ char
+ narrow(char_type __c, char __dfault) const
+ { return this->do_narrow(__c, __dfault); }
+
+ /**
+ * @brief Narrow array to char array
+ *
+ * This function converts each char_type in the input to char using the
+ * simplest reasonable transformation and writes the results to the
+ * destination array. For any char_type in the input that cannot be
+ * converted, @a dfault is used instead. It does so by returning
+ * ctype<char_type>::do_narrow(lo, hi, dfault, to).
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param dfault Char to use if conversion fails.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
+ const char_type*
+ narrow(const char_type* __lo, const char_type* __hi,
+ char __dfault, char *__to) const
+ { return this->do_narrow(__lo, __hi, __dfault, __to); }
+
+ protected:
+ explicit
+ __ctype_abstract_base(size_t __refs = 0): facet(__refs) { }
+
+ virtual
+ ~__ctype_abstract_base() { }
+
+ /**
+ * @brief Test char_type classification.
+ *
+ * This function finds a mask M for @a c and compares it to mask @a m.
+ *
+ * do_is() is a hook for a derived facet to change the behavior of
+ * classifying. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param c The char_type to find the mask of.
+ * @param m The mask to compare against.
+ * @return (M & m) != 0.
+ */
+ virtual bool
+ do_is(mask __m, char_type __c) const = 0;
+
+ /**
+ * @brief Return a mask array.
+ *
+ * This function finds the mask for each char_type in the range [lo,hi)
+ * and successively writes it to vec. vec must have as many elements
+ * as the input.
+ *
+ * do_is() is a hook for a derived facet to change the behavior of
+ * classifying. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param vec Pointer to an array of mask storage.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_is(const char_type* __lo, const char_type* __hi,
+ mask* __vec) const = 0;
+
+ /**
+ * @brief Find char_type matching mask
+ *
+ * This function searches for and returns the first char_type c in
+ * [lo,hi) for which is(m,c) is true.
+ *
+ * do_scan_is() is a hook for a derived facet to change the behavior of
+ * match searching. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to a matching char_type if found, else @a hi.
+ */
+ virtual const char_type*
+ do_scan_is(mask __m, const char_type* __lo,
+ const char_type* __hi) const = 0;
+
+ /**
+ * @brief Find char_type not matching mask
+ *
+ * This function searches for and returns a pointer to the first
+ * char_type c of [lo,hi) for which is(m,c) is false.
+ *
+ * do_scan_is() is a hook for a derived facet to change the behavior of
+ * match searching. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to a non-matching char_type if found, else @a hi.
+ */
+ virtual const char_type*
+ do_scan_not(mask __m, const char_type* __lo,
+ const char_type* __hi) const = 0;
+
+ /**
+ * @brief Convert to uppercase.
+ *
+ * This virtual function converts the char_type argument to uppercase
+ * if possible. If not possible (for example, '2'), returns the
+ * argument.
+ *
+ * do_toupper() is a hook for a derived facet to change the behavior of
+ * uppercasing. do_toupper() must always return the same result for
+ * the same input.
+ *
+ * @param c The char_type to convert.
+ * @return The uppercase char_type if convertible, else @a c.
+ */
+ virtual char_type
+ do_toupper(char_type) const = 0;
+
+ /**
+ * @brief Convert array to uppercase.
+ *
+ * This virtual function converts each char_type in the range [lo,hi)
+ * to uppercase if possible. Other elements remain untouched.
+ *
+ * do_toupper() is a hook for a derived facet to change the behavior of
+ * uppercasing. do_toupper() must always return the same result for
+ * the same input.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_toupper(char_type* __lo, const char_type* __hi) const = 0;
+
+ /**
+ * @brief Convert to lowercase.
+ *
+ * This virtual function converts the argument to lowercase if
+ * possible. If not possible (for example, '2'), returns the argument.
+ *
+ * do_tolower() is a hook for a derived facet to change the behavior of
+ * lowercasing. do_tolower() must always return the same result for
+ * the same input.
+ *
+ * @param c The char_type to convert.
+ * @return The lowercase char_type if convertible, else @a c.
+ */
+ virtual char_type
+ do_tolower(char_type) const = 0;
+
+ /**
+ * @brief Convert array to lowercase.
+ *
+ * This virtual function converts each char_type in the range [lo,hi)
+ * to lowercase if possible. Other elements remain untouched.
+ *
+ * do_tolower() is a hook for a derived facet to change the behavior of
+ * lowercasing. do_tolower() must always return the same result for
+ * the same input.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_tolower(char_type* __lo, const char_type* __hi) const = 0;
+
+ /**
+ * @brief Widen char
+ *
+ * This virtual function converts the char to char_type using the
+ * simplest reasonable transformation.
+ *
+ * do_widen() is a hook for a derived facet to change the behavior of
+ * widening. do_widen() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char to convert.
+ * @return The converted char_type
+ */
+ virtual char_type
+ do_widen(char) const = 0;
+
+ /**
+ * @brief Widen char array
+ *
+ * This function converts each char in the input to char_type using the
+ * simplest reasonable transformation.
+ *
+ * do_widen() is a hook for a derived facet to change the behavior of
+ * widening. do_widen() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start range.
+ * @param hi Pointer to end of range.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
+ virtual const char*
+ do_widen(const char* __lo, const char* __hi,
+ char_type* __dest) const = 0;
+
+ /**
+ * @brief Narrow char_type to char
+ *
+ * This virtual function converts the argument to char using the
+ * simplest reasonable transformation. If the conversion fails, dfault
+ * is returned instead.
+ *
+ * do_narrow() is a hook for a derived facet to change the behavior of
+ * narrowing. do_narrow() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char_type to convert.
+ * @param dfault Char to return if conversion fails.
+ * @return The converted char.
+ */
+ virtual char
+ do_narrow(char_type, char __dfault) const = 0;
+
+ /**
+ * @brief Narrow char_type array to char
+ *
+ * This virtual function converts each char_type in the range [lo,hi) to
+ * char using the simplest reasonable transformation and writes the
+ * results to the destination array. For any element in the input that
+ * cannot be converted, @a dfault is used instead.
+ *
+ * do_narrow() is a hook for a derived facet to change the behavior of
+ * narrowing. do_narrow() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param dfault Char to use if conversion fails.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_narrow(const char_type* __lo, const char_type* __hi,
+ char __dfault, char* __dest) const = 0;
+ };
+
+ // NB: Generic, mostly useless implementation.
+ /**
+ * @brief Template ctype facet
+ *
+ * This template class defines classification and conversion functions for
+ * character sets. It wraps <cctype> functionality. Ctype gets used by
+ * streams for many I/O operations.
+ *
+ * This template provides the protected virtual functions the developer
+ * will have to replace in a derived class or specialization to make a
+ * working facet. The public functions that access them are defined in
+ * __ctype_abstract_base, to allow for implementation flexibility. See
+ * ctype<wchar_t> for an example. The functions are documented in
+ * __ctype_abstract_base.
+ *
+ * Note: implementations are provided for all the protected virtual
+ * functions, but will likely not be useful.
+ */
+ template<typename _CharT>
+ class ctype : public __ctype_abstract_base<_CharT>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef typename __ctype_abstract_base<_CharT>::mask mask;
+
+ /// The facet id for ctype<char_type>
+ static locale::id id;
+
+ explicit
+ ctype(size_t __refs = 0) : __ctype_abstract_base<_CharT>(__refs) { }
+
+ protected:
+ virtual
+ ~ctype();
+
+ virtual bool
+ do_is(mask __m, char_type __c) const;
+
+ virtual const char_type*
+ do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
+
+ virtual const char_type*
+ do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
+
+ virtual const char_type*
+ do_scan_not(mask __m, const char_type* __lo,
+ const char_type* __hi) const;
+
+ virtual char_type
+ do_toupper(char_type __c) const;
+
+ virtual const char_type*
+ do_toupper(char_type* __lo, const char_type* __hi) const;
+
+ virtual char_type
+ do_tolower(char_type __c) const;
+
+ virtual const char_type*
+ do_tolower(char_type* __lo, const char_type* __hi) const;
+
+ virtual char_type
+ do_widen(char __c) const;
+
+ virtual const char*
+ do_widen(const char* __lo, const char* __hi, char_type* __dest) const;
+
+ virtual char
+ do_narrow(char_type, char __dfault) const;
+
+ virtual const char_type*
+ do_narrow(const char_type* __lo, const char_type* __hi,
+ char __dfault, char* __dest) const;
+ };
+
+ template<typename _CharT>
+ locale::id ctype<_CharT>::id;
+
+ // 22.2.1.3 ctype<char> specialization.
+ /**
+ * @brief The ctype<char> specialization.
+ *
+ * This class defines classification and conversion functions for
+ * the char type. It gets used by char streams for many I/O
+ * operations. The char specialization provides a number of
+ * optimizations as well.
+ */
+ template<>
+ class ctype<char> : public locale::facet, public ctype_base
+ {
+ public:
+ // Types:
+ /// Typedef for the template parameter char.
+ typedef char char_type;
+
+ protected:
+ // Data Members:
+ __c_locale _M_c_locale_ctype;
+ bool _M_del;
+ __to_type _M_toupper;
+ __to_type _M_tolower;
+ const mask* _M_table;
+ mutable char _M_widen_ok;
+ mutable char _M_widen[1 + static_cast<unsigned char>(-1)];
+ mutable char _M_narrow[1 + static_cast<unsigned char>(-1)];
+ mutable char _M_narrow_ok; // 0 uninitialized, 1 init,
+ // 2 memcpy can't be used
+
+ public:
+ /// The facet id for ctype<char>
+ static locale::id id;
+ /// The size of the mask table. It is SCHAR_MAX + 1.
+ static const size_t table_size = 1 + static_cast<unsigned char>(-1);
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param table If non-zero, table is used as the per-char mask.
+ * Else classic_table() is used.
+ * @param del If true, passes ownership of table to this facet.
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0);
+
+ /**
+ * @brief Constructor performs static initialization.
+ *
+ * This constructor is used to construct the initial C locale facet.
+ *
+ * @param cloc Handle to C locale data.
+ * @param table If non-zero, table is used as the per-char mask.
+ * @param del If true, passes ownership of table to this facet.
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ ctype(__c_locale __cloc, const mask* __table = 0, bool __del = false,
+ size_t __refs = 0);
+
+ /**
+ * @brief Test char classification.
+ *
+ * This function compares the mask table[c] to @a m.
+ *
+ * @param c The char to compare the mask of.
+ * @param m The mask to compare against.
+ * @return True if m & table[c] is true, false otherwise.
+ */
+ inline bool
+ is(mask __m, char __c) const;
+
+ /**
+ * @brief Return a mask array.
+ *
+ * This function finds the mask for each char in the range [lo, hi) and
+ * successively writes it to vec. vec must have as many elements as
+ * the char array.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param vec Pointer to an array of mask storage.
+ * @return @a hi.
+ */
+ inline const char*
+ is(const char* __lo, const char* __hi, mask* __vec) const;
+
+ /**
+ * @brief Find char matching a mask
+ *
+ * This function searches for and returns the first char in [lo,hi) for
+ * which is(m,char) is true.
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to a matching char if found, else @a hi.
+ */
+ inline const char*
+ scan_is(mask __m, const char* __lo, const char* __hi) const;
+
+ /**
+ * @brief Find char not matching a mask
+ *
+ * This function searches for and returns a pointer to the first char
+ * in [lo,hi) for which is(m,char) is false.
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to a non-matching char if found, else @a hi.
+ */
+ inline const char*
+ scan_not(mask __m, const char* __lo, const char* __hi) const;
+
+ /**
+ * @brief Convert to uppercase.
+ *
+ * This function converts the char argument to uppercase if possible.
+ * If not possible (for example, '2'), returns the argument.
+ *
+ * toupper() acts as if it returns ctype<char>::do_toupper(c).
+ * do_toupper() must always return the same result for the same input.
+ *
+ * @param c The char to convert.
+ * @return The uppercase char if convertible, else @a c.
+ */
+ char_type
+ toupper(char_type __c) const
+ { return this->do_toupper(__c); }
+
+ /**
+ * @brief Convert array to uppercase.
+ *
+ * This function converts each char in the range [lo,hi) to uppercase
+ * if possible. Other chars remain untouched.
+ *
+ * toupper() acts as if it returns ctype<char>:: do_toupper(lo, hi).
+ * do_toupper() must always return the same result for the same input.
+ *
+ * @param lo Pointer to first char in range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
+ const char_type*
+ toupper(char_type *__lo, const char_type* __hi) const
+ { return this->do_toupper(__lo, __hi); }
+
+ /**
+ * @brief Convert to lowercase.
+ *
+ * This function converts the char argument to lowercase if possible.
+ * If not possible (for example, '2'), returns the argument.
+ *
+ * tolower() acts as if it returns ctype<char>::do_tolower(c).
+ * do_tolower() must always return the same result for the same input.
+ *
+ * @param c The char to convert.
+ * @return The lowercase char if convertible, else @a c.
+ */
+ char_type
+ tolower(char_type __c) const
+ { return this->do_tolower(__c); }
+
+ /**
+ * @brief Convert array to lowercase.
+ *
+ * This function converts each char in the range [lo,hi) to lowercase
+ * if possible. Other chars remain untouched.
+ *
+ * tolower() acts as if it returns ctype<char>:: do_tolower(lo, hi).
+ * do_tolower() must always return the same result for the same input.
+ *
+ * @param lo Pointer to first char in range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
+ const char_type*
+ tolower(char_type* __lo, const char_type* __hi) const
+ { return this->do_tolower(__lo, __hi); }
+
+ /**
+ * @brief Widen char
+ *
+ * This function converts the char to char_type using the simplest
+ * reasonable transformation. For an underived ctype<char> facet, the
+ * argument will be returned unchanged.
+ *
+ * This function works as if it returns ctype<char>::do_widen(c).
+ * do_widen() must always return the same result for the same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char to convert.
+ * @return The converted character.
+ */
+ char_type
+ widen(char __c) const
+ {
+ if (_M_widen_ok)
+ return _M_widen[static_cast<unsigned char>(__c)];
+ this->_M_widen_init();
+ return this->do_widen(__c);
+ }
+
+ /**
+ * @brief Widen char array
+ *
+ * This function converts each char in the input to char using the
+ * simplest reasonable transformation. For an underived ctype<char>
+ * facet, the argument will be copied unchanged.
+ *
+ * This function works as if it returns ctype<char>::do_widen(c).
+ * do_widen() must always return the same result for the same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to first char in range.
+ * @param hi Pointer to end of range.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
+ const char*
+ widen(const char* __lo, const char* __hi, char_type* __to) const
+ {
+ if (_M_widen_ok == 1)
+ {
+ __builtin_memcpy(__to, __lo, __hi - __lo);
+ return __hi;
+ }
+ if (!_M_widen_ok)
+ _M_widen_init();
+ return this->do_widen(__lo, __hi, __to);
+ }
+
+ /**
+ * @brief Narrow char
+ *
+ * This function converts the char to char using the simplest
+ * reasonable transformation. If the conversion fails, dfault is
+ * returned instead. For an underived ctype<char> facet, @a c
+ * will be returned unchanged.
+ *
+ * This function works as if it returns ctype<char>::do_narrow(c).
+ * do_narrow() must always return the same result for the same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char to convert.
+ * @param dfault Char to return if conversion fails.
+ * @return The converted character.
+ */
+ char
+ narrow(char_type __c, char __dfault) const
+ {
+ if (_M_narrow[static_cast<unsigned char>(__c)])
+ return _M_narrow[static_cast<unsigned char>(__c)];
+ const char __t = do_narrow(__c, __dfault);
+ if (__t != __dfault)
+ _M_narrow[static_cast<unsigned char>(__c)] = __t;
+ return __t;
+ }
+
+ /**
+ * @brief Narrow char array
+ *
+ * This function converts each char in the input to char using the
+ * simplest reasonable transformation and writes the results to the
+ * destination array. For any char in the input that cannot be
+ * converted, @a dfault is used instead. For an underived ctype<char>
+ * facet, the argument will be copied unchanged.
+ *
+ * This function works as if it returns ctype<char>::do_narrow(lo, hi,
+ * dfault, to). do_narrow() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param dfault Char to use if conversion fails.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
+ const char_type*
+ narrow(const char_type* __lo, const char_type* __hi,
+ char __dfault, char *__to) const
+ {
+ if (__builtin_expect(_M_narrow_ok == 1, true))
+ {
+ __builtin_memcpy(__to, __lo, __hi - __lo);
+ return __hi;
+ }
+ if (!_M_narrow_ok)
+ _M_narrow_init();
+ return this->do_narrow(__lo, __hi, __dfault, __to);
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 695. ctype<char>::classic_table() not accessible.
+ /// Returns a pointer to the mask table provided to the constructor, or
+ /// the default from classic_table() if none was provided.
+ const mask*
+ table() const throw()
+ { return _M_table; }
+
+ /// Returns a pointer to the C locale mask table.
+ static const mask*
+ classic_table() throw();
+ protected:
+
+ /**
+ * @brief Destructor.
+ *
+ * This function deletes table() if @a del was true in the
+ * constructor.
+ */
+ virtual
+ ~ctype();
+
+ /**
+ * @brief Convert to uppercase.
+ *
+ * This virtual function converts the char argument to uppercase if
+ * possible. If not possible (for example, '2'), returns the argument.
+ *
+ * do_toupper() is a hook for a derived facet to change the behavior of
+ * uppercasing. do_toupper() must always return the same result for
+ * the same input.
+ *
+ * @param c The char to convert.
+ * @return The uppercase char if convertible, else @a c.
+ */
+ virtual char_type
+ do_toupper(char_type) const;
+
+ /**
+ * @brief Convert array to uppercase.
+ *
+ * This virtual function converts each char in the range [lo,hi) to
+ * uppercase if possible. Other chars remain untouched.
+ *
+ * do_toupper() is a hook for a derived facet to change the behavior of
+ * uppercasing. do_toupper() must always return the same result for
+ * the same input.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_toupper(char_type* __lo, const char_type* __hi) const;
+
+ /**
+ * @brief Convert to lowercase.
+ *
+ * This virtual function converts the char argument to lowercase if
+ * possible. If not possible (for example, '2'), returns the argument.
+ *
+ * do_tolower() is a hook for a derived facet to change the behavior of
+ * lowercasing. do_tolower() must always return the same result for
+ * the same input.
+ *
+ * @param c The char to convert.
+ * @return The lowercase char if convertible, else @a c.
+ */
+ virtual char_type
+ do_tolower(char_type) const;
+
+ /**
+ * @brief Convert array to lowercase.
+ *
+ * This virtual function converts each char in the range [lo,hi) to
+ * lowercase if possible. Other chars remain untouched.
+ *
+ * do_tolower() is a hook for a derived facet to change the behavior of
+ * lowercasing. do_tolower() must always return the same result for
+ * the same input.
+ *
+ * @param lo Pointer to first char in range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_tolower(char_type* __lo, const char_type* __hi) const;
+
+ /**
+ * @brief Widen char
+ *
+ * This virtual function converts the char to char using the simplest
+ * reasonable transformation. For an underived ctype<char> facet, the
+ * argument will be returned unchanged.
+ *
+ * do_widen() is a hook for a derived facet to change the behavior of
+ * widening. do_widen() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char to convert.
+ * @return The converted character.
+ */
+ virtual char_type
+ do_widen(char __c) const
+ { return __c; }
+
+ /**
+ * @brief Widen char array
+ *
+ * This function converts each char in the range [lo,hi) to char using
+ * the simplest reasonable transformation. For an underived
+ * ctype<char> facet, the argument will be copied unchanged.
+ *
+ * do_widen() is a hook for a derived facet to change the behavior of
+ * widening. do_widen() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
+ virtual const char*
+ do_widen(const char* __lo, const char* __hi, char_type* __dest) const
+ {
+ __builtin_memcpy(__dest, __lo, __hi - __lo);
+ return __hi;
+ }
+
+ /**
+ * @brief Narrow char
+ *
+ * This virtual function converts the char to char using the simplest
+ * reasonable transformation. If the conversion fails, dfault is
+ * returned instead. For an underived ctype<char> facet, @a c will be
+ * returned unchanged.
+ *
+ * do_narrow() is a hook for a derived facet to change the behavior of
+ * narrowing. do_narrow() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char to convert.
+ * @param dfault Char to return if conversion fails.
+ * @return The converted char.
+ */
+ virtual char
+ do_narrow(char_type __c, char) const
+ { return __c; }
+
+ /**
+ * @brief Narrow char array to char array
+ *
+ * This virtual function converts each char in the range [lo,hi) to
+ * char using the simplest reasonable transformation and writes the
+ * results to the destination array. For any char in the input that
+ * cannot be converted, @a dfault is used instead. For an underived
+ * ctype<char> facet, the argument will be copied unchanged.
+ *
+ * do_narrow() is a hook for a derived facet to change the behavior of
+ * narrowing. do_narrow() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param dfault Char to use if conversion fails.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_narrow(const char_type* __lo, const char_type* __hi,
+ char, char* __dest) const
+ {
+ __builtin_memcpy(__dest, __lo, __hi - __lo);
+ return __hi;
+ }
+
+ private:
+ void _M_narrow_init() const;
+ void _M_widen_init() const;
+ };
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ // 22.2.1.3 ctype<wchar_t> specialization
+ /**
+ * @brief The ctype<wchar_t> specialization.
+ *
+ * This class defines classification and conversion functions for the
+ * wchar_t type. It gets used by wchar_t streams for many I/O operations.
+ * The wchar_t specialization provides a number of optimizations as well.
+ *
+ * ctype<wchar_t> inherits its public methods from
+ * __ctype_abstract_base<wchar_t>.
+ */
+ template<>
+ class ctype<wchar_t> : public __ctype_abstract_base<wchar_t>
+ {
+ public:
+ // Types:
+ /// Typedef for the template parameter wchar_t.
+ typedef wchar_t char_type;
+ typedef wctype_t __wmask_type;
+
+ protected:
+ __c_locale _M_c_locale_ctype;
+
+ // Pre-computed narrowed and widened chars.
+ bool _M_narrow_ok;
+ char _M_narrow[128];
+ wint_t _M_widen[1 + static_cast<unsigned char>(-1)];
+
+ // Pre-computed elements for do_is.
+ mask _M_bit[16];
+ __wmask_type _M_wmask[16];
+
+ public:
+ // Data Members:
+ /// The facet id for ctype<wchar_t>
+ static locale::id id;
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ ctype(size_t __refs = 0);
+
+ /**
+ * @brief Constructor performs static initialization.
+ *
+ * This constructor is used to construct the initial C locale facet.
+ *
+ * @param cloc Handle to C locale data.
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ ctype(__c_locale __cloc, size_t __refs = 0);
+
+ protected:
+ __wmask_type
+ _M_convert_to_wmask(const mask __m) const;
+
+ /// Destructor
+ virtual
+ ~ctype();
+
+ /**
+ * @brief Test wchar_t classification.
+ *
+ * This function finds a mask M for @a c and compares it to mask @a m.
+ *
+ * do_is() is a hook for a derived facet to change the behavior of
+ * classifying. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param c The wchar_t to find the mask of.
+ * @param m The mask to compare against.
+ * @return (M & m) != 0.
+ */
+ virtual bool
+ do_is(mask __m, char_type __c) const;
+
+ /**
+ * @brief Return a mask array.
+ *
+ * This function finds the mask for each wchar_t in the range [lo,hi)
+ * and successively writes it to vec. vec must have as many elements
+ * as the input.
+ *
+ * do_is() is a hook for a derived facet to change the behavior of
+ * classifying. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param vec Pointer to an array of mask storage.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
+
+ /**
+ * @brief Find wchar_t matching mask
+ *
+ * This function searches for and returns the first wchar_t c in
+ * [lo,hi) for which is(m,c) is true.
+ *
+ * do_scan_is() is a hook for a derived facet to change the behavior of
+ * match searching. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to a matching wchar_t if found, else @a hi.
+ */
+ virtual const char_type*
+ do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
+
+ /**
+ * @brief Find wchar_t not matching mask
+ *
+ * This function searches for and returns a pointer to the first
+ * wchar_t c of [lo,hi) for which is(m,c) is false.
+ *
+ * do_scan_is() is a hook for a derived facet to change the behavior of
+ * match searching. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to a non-matching wchar_t if found, else @a hi.
+ */
+ virtual const char_type*
+ do_scan_not(mask __m, const char_type* __lo,
+ const char_type* __hi) const;
+
+ /**
+ * @brief Convert to uppercase.
+ *
+ * This virtual function converts the wchar_t argument to uppercase if
+ * possible. If not possible (for example, '2'), returns the argument.
+ *
+ * do_toupper() is a hook for a derived facet to change the behavior of
+ * uppercasing. do_toupper() must always return the same result for
+ * the same input.
+ *
+ * @param c The wchar_t to convert.
+ * @return The uppercase wchar_t if convertible, else @a c.
+ */
+ virtual char_type
+ do_toupper(char_type) const;
+
+ /**
+ * @brief Convert array to uppercase.
+ *
+ * This virtual function converts each wchar_t in the range [lo,hi) to
+ * uppercase if possible. Other elements remain untouched.
+ *
+ * do_toupper() is a hook for a derived facet to change the behavior of
+ * uppercasing. do_toupper() must always return the same result for
+ * the same input.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_toupper(char_type* __lo, const char_type* __hi) const;
+
+ /**
+ * @brief Convert to lowercase.
+ *
+ * This virtual function converts the argument to lowercase if
+ * possible. If not possible (for example, '2'), returns the argument.
+ *
+ * do_tolower() is a hook for a derived facet to change the behavior of
+ * lowercasing. do_tolower() must always return the same result for
+ * the same input.
+ *
+ * @param c The wchar_t to convert.
+ * @return The lowercase wchar_t if convertible, else @a c.
+ */
+ virtual char_type
+ do_tolower(char_type) const;
+
+ /**
+ * @brief Convert array to lowercase.
+ *
+ * This virtual function converts each wchar_t in the range [lo,hi) to
+ * lowercase if possible. Other elements remain untouched.
+ *
+ * do_tolower() is a hook for a derived facet to change the behavior of
+ * lowercasing. do_tolower() must always return the same result for
+ * the same input.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_tolower(char_type* __lo, const char_type* __hi) const;
+
+ /**
+ * @brief Widen char to wchar_t
+ *
+ * This virtual function converts the char to wchar_t using the
+ * simplest reasonable transformation. For an underived ctype<wchar_t>
+ * facet, the argument will be cast to wchar_t.
+ *
+ * do_widen() is a hook for a derived facet to change the behavior of
+ * widening. do_widen() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char to convert.
+ * @return The converted wchar_t.
+ */
+ virtual char_type
+ do_widen(char) const;
+
+ /**
+ * @brief Widen char array to wchar_t array
+ *
+ * This function converts each char in the input to wchar_t using the
+ * simplest reasonable transformation. For an underived ctype<wchar_t>
+ * facet, the argument will be copied, casting each element to wchar_t.
+ *
+ * do_widen() is a hook for a derived facet to change the behavior of
+ * widening. do_widen() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start range.
+ * @param hi Pointer to end of range.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
+ virtual const char*
+ do_widen(const char* __lo, const char* __hi, char_type* __dest) const;
+
+ /**
+ * @brief Narrow wchar_t to char
+ *
+ * This virtual function converts the argument to char using
+ * the simplest reasonable transformation. If the conversion
+ * fails, dfault is returned instead. For an underived
+ * ctype<wchar_t> facet, @a c will be cast to char and
+ * returned.
+ *
+ * do_narrow() is a hook for a derived facet to change the
+ * behavior of narrowing. do_narrow() must always return the
+ * same result for the same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The wchar_t to convert.
+ * @param dfault Char to return if conversion fails.
+ * @return The converted char.
+ */
+ virtual char
+ do_narrow(char_type, char __dfault) const;
+
+ /**
+ * @brief Narrow wchar_t array to char array
+ *
+ * This virtual function converts each wchar_t in the range [lo,hi) to
+ * char using the simplest reasonable transformation and writes the
+ * results to the destination array. For any wchar_t in the input that
+ * cannot be converted, @a dfault is used instead. For an underived
+ * ctype<wchar_t> facet, the argument will be copied, casting each
+ * element to char.
+ *
+ * do_narrow() is a hook for a derived facet to change the behavior of
+ * narrowing. do_narrow() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param dfault Char to use if conversion fails.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
+ virtual const char_type*
+ do_narrow(const char_type* __lo, const char_type* __hi,
+ char __dfault, char* __dest) const;
+
+ // For use at construction time only.
+ void
+ _M_initialize_ctype();
+ };
+#endif //_GLIBCXX_USE_WCHAR_T
+
+ /// class ctype_byname [22.2.1.2].
+ template<typename _CharT>
+ class ctype_byname : public ctype<_CharT>
+ {
+ public:
+ typedef typename ctype<_CharT>::mask mask;
+
+ explicit
+ ctype_byname(const char* __s, size_t __refs = 0);
+
+ protected:
+ virtual
+ ~ctype_byname() { };
+ };
+
+ /// 22.2.1.4 Class ctype_byname specializations.
+ template<>
+ class ctype_byname<char> : public ctype<char>
+ {
+ public:
+ explicit
+ ctype_byname(const char* __s, size_t __refs = 0);
+
+ protected:
+ virtual
+ ~ctype_byname();
+ };
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ class ctype_byname<wchar_t> : public ctype<wchar_t>
+ {
+ public:
+ explicit
+ ctype_byname(const char* __s, size_t __refs = 0);
+
+ protected:
+ virtual
+ ~ctype_byname();
+ };
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+// Include host and configuration specific ctype inlines.
+#include <bits/ctype_inline.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 22.2.2 The numeric category.
+ class __num_base
+ {
+ public:
+ // NB: Code depends on the order of _S_atoms_out elements.
+ // Below are the indices into _S_atoms_out.
+ enum
+ {
+ _S_ominus,
+ _S_oplus,
+ _S_ox,
+ _S_oX,
+ _S_odigits,
+ _S_odigits_end = _S_odigits + 16,
+ _S_oudigits = _S_odigits_end,
+ _S_oudigits_end = _S_oudigits + 16,
+ _S_oe = _S_odigits + 14, // For scientific notation, 'e'
+ _S_oE = _S_oudigits + 14, // For scientific notation, 'E'
+ _S_oend = _S_oudigits_end
+ };
+
+ // A list of valid numeric literals for output. This array
+ // contains chars that will be passed through the current locale's
+ // ctype<_CharT>.widen() and then used to render numbers.
+ // For the standard "C" locale, this is
+ // "-+xX0123456789abcdef0123456789ABCDEF".
+ static const char* _S_atoms_out;
+
+ // String literal of acceptable (narrow) input, for num_get.
+ // "-+xX0123456789abcdefABCDEF"
+ static const char* _S_atoms_in;
+
+ enum
+ {
+ _S_iminus,
+ _S_iplus,
+ _S_ix,
+ _S_iX,
+ _S_izero,
+ _S_ie = _S_izero + 14,
+ _S_iE = _S_izero + 20,
+ _S_iend = 26
+ };
+
+ // num_put
+ // Construct and return valid scanf format for floating point types.
+ static void
+ _S_format_float(const ios_base& __io, char* __fptr, char __mod);
+ };
+
+ template<typename _CharT>
+ struct __numpunct_cache : public locale::facet
+ {
+ const char* _M_grouping;
+ size_t _M_grouping_size;
+ bool _M_use_grouping;
+ const _CharT* _M_truename;
+ size_t _M_truename_size;
+ const _CharT* _M_falsename;
+ size_t _M_falsename_size;
+ _CharT _M_decimal_point;
+ _CharT _M_thousands_sep;
+
+ // A list of valid numeric literals for output: in the standard
+ // "C" locale, this is "-+xX0123456789abcdef0123456789ABCDEF".
+ // This array contains the chars after having been passed
+ // through the current locale's ctype<_CharT>.widen().
+ _CharT _M_atoms_out[__num_base::_S_oend];
+
+ // A list of valid numeric literals for input: in the standard
+ // "C" locale, this is "-+xX0123456789abcdefABCDEF"
+ // This array contains the chars after having been passed
+ // through the current locale's ctype<_CharT>.widen().
+ _CharT _M_atoms_in[__num_base::_S_iend];
+
+ bool _M_allocated;
+
+ __numpunct_cache(size_t __refs = 0) : facet(__refs),
+ _M_grouping(NULL), _M_grouping_size(0), _M_use_grouping(false),
+ _M_truename(NULL), _M_truename_size(0), _M_falsename(NULL),
+ _M_falsename_size(0), _M_decimal_point(_CharT()),
+ _M_thousands_sep(_CharT()), _M_allocated(false)
+ { }
+
+ ~__numpunct_cache();
+
+ void
+ _M_cache(const locale& __loc);
+
+ private:
+ __numpunct_cache&
+ operator=(const __numpunct_cache&);
+
+ explicit
+ __numpunct_cache(const __numpunct_cache&);
+ };
+
+ template<typename _CharT>
+ __numpunct_cache<_CharT>::~__numpunct_cache()
+ {
+ if (_M_allocated)
+ {
+ delete [] _M_grouping;
+ delete [] _M_truename;
+ delete [] _M_falsename;
+ }
+ }
+
+ /**
+ * @brief Numpunct facet.
+ *
+ * This facet stores several pieces of information related to printing and
+ * scanning numbers, such as the decimal point character. It takes a
+ * template parameter specifying the char type. The numpunct facet is
+ * used by streams for many I/O operations involving numbers.
+ *
+ * The numpunct template uses protected virtual functions to provide the
+ * actual results. The public accessors forward the call to the virtual
+ * functions. These virtual functions are hooks for developers to
+ * implement the behavior they require from a numpunct facet.
+ */
+ template<typename _CharT>
+ class numpunct : public locale::facet
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef basic_string<_CharT> string_type;
+ //@}
+ typedef __numpunct_cache<_CharT> __cache_type;
+
+ protected:
+ __cache_type* _M_data;
+
+ public:
+ /// Numpunct facet id.
+ static locale::id id;
+
+ /**
+ * @brief Numpunct constructor.
+ *
+ * @param refs Refcount to pass to the base class.
+ */
+ explicit
+ numpunct(size_t __refs = 0) : facet(__refs), _M_data(NULL)
+ { _M_initialize_numpunct(); }
+
+ /**
+ * @brief Internal constructor. Not for general use.
+ *
+ * This is a constructor for use by the library itself to set up the
+ * predefined locale facets.
+ *
+ * @param cache __numpunct_cache object.
+ * @param refs Refcount to pass to the base class.
+ */
+ explicit
+ numpunct(__cache_type* __cache, size_t __refs = 0)
+ : facet(__refs), _M_data(__cache)
+ { _M_initialize_numpunct(); }
+
+ /**
+ * @brief Internal constructor. Not for general use.
+ *
+ * This is a constructor for use by the library itself to set up new
+ * locales.
+ *
+ * @param cloc The "C" locale.
+ * @param refs Refcount to pass to the base class.
+ */
+ explicit
+ numpunct(__c_locale __cloc, size_t __refs = 0)
+ : facet(__refs), _M_data(NULL)
+ { _M_initialize_numpunct(__cloc); }
+
+ /**
+ * @brief Return decimal point character.
+ *
+ * This function returns a char_type to use as a decimal point. It
+ * does so by returning returning
+ * numpunct<char_type>::do_decimal_point().
+ *
+ * @return @a char_type representing a decimal point.
+ */
+ char_type
+ decimal_point() const
+ { return this->do_decimal_point(); }
+
+ /**
+ * @brief Return thousands separator character.
+ *
+ * This function returns a char_type to use as a thousands
+ * separator. It does so by returning returning
+ * numpunct<char_type>::do_thousands_sep().
+ *
+ * @return char_type representing a thousands separator.
+ */
+ char_type
+ thousands_sep() const
+ { return this->do_thousands_sep(); }
+
+ /**
+ * @brief Return grouping specification.
+ *
+ * This function returns a string representing groupings for the
+ * integer part of a number. Groupings indicate where thousands
+ * separators should be inserted in the integer part of a number.
+ *
+ * Each char in the return string is interpret as an integer
+ * rather than a character. These numbers represent the number
+ * of digits in a group. The first char in the string
+ * represents the number of digits in the least significant
+ * group. If a char is negative, it indicates an unlimited
+ * number of digits for the group. If more chars from the
+ * string are required to group a number, the last char is used
+ * repeatedly.
+ *
+ * For example, if the grouping() returns "\003\002" and is
+ * applied to the number 123456789, this corresponds to
+ * 12,34,56,789. Note that if the string was "32", this would
+ * put more than 50 digits into the least significant group if
+ * the character set is ASCII.
+ *
+ * The string is returned by calling
+ * numpunct<char_type>::do_grouping().
+ *
+ * @return string representing grouping specification.
+ */
+ string
+ grouping() const
+ { return this->do_grouping(); }
+
+ /**
+ * @brief Return string representation of bool true.
+ *
+ * This function returns a string_type containing the text
+ * representation for true bool variables. It does so by calling
+ * numpunct<char_type>::do_truename().
+ *
+ * @return string_type representing printed form of true.
+ */
+ string_type
+ truename() const
+ { return this->do_truename(); }
+
+ /**
+ * @brief Return string representation of bool false.
+ *
+ * This function returns a string_type containing the text
+ * representation for false bool variables. It does so by calling
+ * numpunct<char_type>::do_falsename().
+ *
+ * @return string_type representing printed form of false.
+ */
+ string_type
+ falsename() const
+ { return this->do_falsename(); }
+
+ protected:
+ /// Destructor.
+ virtual
+ ~numpunct();
+
+ /**
+ * @brief Return decimal point character.
+ *
+ * Returns a char_type to use as a decimal point. This function is a
+ * hook for derived classes to change the value returned.
+ *
+ * @return @a char_type representing a decimal point.
+ */
+ virtual char_type
+ do_decimal_point() const
+ { return _M_data->_M_decimal_point; }
+
+ /**
+ * @brief Return thousands separator character.
+ *
+ * Returns a char_type to use as a thousands separator. This function
+ * is a hook for derived classes to change the value returned.
+ *
+ * @return @a char_type representing a thousands separator.
+ */
+ virtual char_type
+ do_thousands_sep() const
+ { return _M_data->_M_thousands_sep; }
+
+ /**
+ * @brief Return grouping specification.
+ *
+ * Returns a string representing groupings for the integer part of a
+ * number. This function is a hook for derived classes to change the
+ * value returned. @see grouping() for details.
+ *
+ * @return String representing grouping specification.
+ */
+ virtual string
+ do_grouping() const
+ { return _M_data->_M_grouping; }
+
+ /**
+ * @brief Return string representation of bool true.
+ *
+ * Returns a string_type containing the text representation for true
+ * bool variables. This function is a hook for derived classes to
+ * change the value returned.
+ *
+ * @return string_type representing printed form of true.
+ */
+ virtual string_type
+ do_truename() const
+ { return _M_data->_M_truename; }
+
+ /**
+ * @brief Return string representation of bool false.
+ *
+ * Returns a string_type containing the text representation for false
+ * bool variables. This function is a hook for derived classes to
+ * change the value returned.
+ *
+ * @return string_type representing printed form of false.
+ */
+ virtual string_type
+ do_falsename() const
+ { return _M_data->_M_falsename; }
+
+ // For use at construction time only.
+ void
+ _M_initialize_numpunct(__c_locale __cloc = NULL);
+ };
+
+ template<typename _CharT>
+ locale::id numpunct<_CharT>::id;
+
+ template<>
+ numpunct<char>::~numpunct();
+
+ template<>
+ void
+ numpunct<char>::_M_initialize_numpunct(__c_locale __cloc);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ numpunct<wchar_t>::~numpunct();
+
+ template<>
+ void
+ numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc);
+#endif
+
+ /// class numpunct_byname [22.2.3.2].
+ template<typename _CharT>
+ class numpunct_byname : public numpunct<_CharT>
+ {
+ public:
+ typedef _CharT char_type;
+ typedef basic_string<_CharT> string_type;
+
+ explicit
+ numpunct_byname(const char* __s, size_t __refs = 0)
+ : numpunct<_CharT>(__refs)
+ {
+ if (__builtin_strcmp(__s, "C") != 0
+ && __builtin_strcmp(__s, "POSIX") != 0)
+ {
+ __c_locale __tmp;
+ this->_S_create_c_locale(__tmp, __s);
+ this->_M_initialize_numpunct(__tmp);
+ this->_S_destroy_c_locale(__tmp);
+ }
+ }
+
+ protected:
+ virtual
+ ~numpunct_byname() { }
+ };
+
+_GLIBCXX_BEGIN_LDBL_NAMESPACE
+
+ /**
+ * @brief Facet for parsing number strings.
+ *
+ * This facet encapsulates the code to parse and return a number
+ * from a string. It is used by the istream numeric extraction
+ * operators.
+ *
+ * The num_get template uses protected virtual functions to provide the
+ * actual results. The public accessors forward the call to the virtual
+ * functions. These virtual functions are hooks for developers to
+ * implement the behavior they require from the num_get facet.
+ */
+ template<typename _CharT, typename _InIter>
+ class num_get : public locale::facet
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef _InIter iter_type;
+ //@}
+
+ /// Numpunct facet id.
+ static locale::id id;
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ num_get(size_t __refs = 0) : facet(__refs) { }
+
+ /**
+ * @brief Numeric parsing.
+ *
+ * Parses the input stream into the bool @a v. It does so by calling
+ * num_get::do_get().
+ *
+ * If ios_base::boolalpha is set, attempts to read
+ * ctype<CharT>::truename() or ctype<CharT>::falsename(). Sets
+ * @a v to true or false if successful. Sets err to
+ * ios_base::failbit if reading the string fails. Sets err to
+ * ios_base::eofbit if the stream is emptied.
+ *
+ * If ios_base::boolalpha is not set, proceeds as with reading a long,
+ * except if the value is 1, sets @a v to true, if the value is 0, sets
+ * @a v to false, and otherwise set err to ios_base::failbit.
+ *
+ * @param in Start of input stream.
+ * @param end End of input stream.
+ * @param io Source of locale and flags.
+ * @param err Error flags to set.
+ * @param v Value to format and insert.
+ * @return Iterator after reading.
+ */
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, bool& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+
+ //@{
+ /**
+ * @brief Numeric parsing.
+ *
+ * Parses the input stream into the integral variable @a v. It does so
+ * by calling num_get::do_get().
+ *
+ * Parsing is affected by the flag settings in @a io.
+ *
+ * The basic parse is affected by the value of io.flags() &
+ * ios_base::basefield. If equal to ios_base::oct, parses like the
+ * scanf %o specifier. Else if equal to ios_base::hex, parses like %X
+ * specifier. Else if basefield equal to 0, parses like the %i
+ * specifier. Otherwise, parses like %d for signed and %u for unsigned
+ * types. The matching type length modifier is also used.
+ *
+ * Digit grouping is interpreted according to numpunct::grouping() and
+ * numpunct::thousands_sep(). If the pattern of digit groups isn't
+ * consistent, sets err to ios_base::failbit.
+ *
+ * If parsing the string yields a valid value for @a v, @a v is set.
+ * Otherwise, sets err to ios_base::failbit and leaves @a v unaltered.
+ * Sets err to ios_base::eofbit if the stream is emptied.
+ *
+ * @param in Start of input stream.
+ * @param end End of input stream.
+ * @param io Source of locale and flags.
+ * @param err Error flags to set.
+ * @param v Value to format and insert.
+ * @return Iterator after reading.
+ */
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, long& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned short& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned int& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned long& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+
+#ifdef _GLIBCXX_USE_LONG_LONG
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, long long& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned long long& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+#endif
+ //@}
+
+ //@{
+ /**
+ * @brief Numeric parsing.
+ *
+ * Parses the input stream into the integral variable @a v. It does so
+ * by calling num_get::do_get().
+ *
+ * The input characters are parsed like the scanf %g specifier. The
+ * matching type length modifier is also used.
+ *
+ * The decimal point character used is numpunct::decimal_point().
+ * Digit grouping is interpreted according to numpunct::grouping() and
+ * numpunct::thousands_sep(). If the pattern of digit groups isn't
+ * consistent, sets err to ios_base::failbit.
+ *
+ * If parsing the string yields a valid value for @a v, @a v is set.
+ * Otherwise, sets err to ios_base::failbit and leaves @a v unaltered.
+ * Sets err to ios_base::eofbit if the stream is emptied.
+ *
+ * @param in Start of input stream.
+ * @param end End of input stream.
+ * @param io Source of locale and flags.
+ * @param err Error flags to set.
+ * @param v Value to format and insert.
+ * @return Iterator after reading.
+ */
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, float& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, double& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, long double& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+ //@}
+
+ /**
+ * @brief Numeric parsing.
+ *
+ * Parses the input stream into the pointer variable @a v. It does so
+ * by calling num_get::do_get().
+ *
+ * The input characters are parsed like the scanf %p specifier.
+ *
+ * Digit grouping is interpreted according to numpunct::grouping() and
+ * numpunct::thousands_sep(). If the pattern of digit groups isn't
+ * consistent, sets err to ios_base::failbit.
+ *
+ * Note that the digit grouping effect for pointers is a bit ambiguous
+ * in the standard and shouldn't be relied on. See DR 344.
+ *
+ * If parsing the string yields a valid value for @a v, @a v is set.
+ * Otherwise, sets err to ios_base::failbit and leaves @a v unaltered.
+ * Sets err to ios_base::eofbit if the stream is emptied.
+ *
+ * @param in Start of input stream.
+ * @param end End of input stream.
+ * @param io Source of locale and flags.
+ * @param err Error flags to set.
+ * @param v Value to format and insert.
+ * @return Iterator after reading.
+ */
+ iter_type
+ get(iter_type __in, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, void*& __v) const
+ { return this->do_get(__in, __end, __io, __err, __v); }
+
+ protected:
+ /// Destructor.
+ virtual ~num_get() { }
+
+ iter_type
+ _M_extract_float(iter_type, iter_type, ios_base&, ios_base::iostate&,
+ string&) const;
+
+ template<typename _ValueT>
+ iter_type
+ _M_extract_int(iter_type, iter_type, ios_base&, ios_base::iostate&,
+ _ValueT&) const;
+
+ template<typename _CharT2>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value, int>::__type
+ _M_find(const _CharT2*, size_t __len, _CharT2 __c) const
+ {
+ int __ret = -1;
+ if (__len <= 10)
+ {
+ if (__c >= _CharT2('0') && __c < _CharT2(_CharT2('0') + __len))
+ __ret = __c - _CharT2('0');
+ }
+ else
+ {
+ if (__c >= _CharT2('0') && __c <= _CharT2('9'))
+ __ret = __c - _CharT2('0');
+ else if (__c >= _CharT2('a') && __c <= _CharT2('f'))
+ __ret = 10 + (__c - _CharT2('a'));
+ else if (__c >= _CharT2('A') && __c <= _CharT2('F'))
+ __ret = 10 + (__c - _CharT2('A'));
+ }
+ return __ret;
+ }
+
+ template<typename _CharT2>
+ typename __gnu_cxx::__enable_if<!__is_char<_CharT2>::__value,
+ int>::__type
+ _M_find(const _CharT2* __zero, size_t __len, _CharT2 __c) const
+ {
+ int __ret = -1;
+ const char_type* __q = char_traits<_CharT2>::find(__zero, __len, __c);
+ if (__q)
+ {
+ __ret = __q - __zero;
+ if (__ret > 15)
+ __ret -= 6;
+ }
+ return __ret;
+ }
+
+ //@{
+ /**
+ * @brief Numeric parsing.
+ *
+ * Parses the input stream into the variable @a v. This function is a
+ * hook for derived classes to change the value returned. @see get()
+ * for more details.
+ *
+ * @param in Start of input stream.
+ * @param end End of input stream.
+ * @param io Source of locale and flags.
+ * @param err Error flags to set.
+ * @param v Value to format and insert.
+ * @return Iterator after reading.
+ */
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, bool&) const;
+
+ virtual iter_type
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, long& __v) const
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+ virtual iter_type
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned short& __v) const
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+ virtual iter_type
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned int& __v) const
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+ virtual iter_type
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned long& __v) const
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+#ifdef _GLIBCXX_USE_LONG_LONG
+ virtual iter_type
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, long long& __v) const
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+ virtual iter_type
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, unsigned long long& __v) const
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
+#endif
+
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ float&) const;
+
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ double&) const;
+
+ // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ virtual iter_type
+ __do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ double&) const;
+#else
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ long double&) const;
+#endif
+
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ void*&) const;
+
+ // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ long double&) const;
+#endif
+ //@}
+ };
+
+ template<typename _CharT, typename _InIter>
+ locale::id num_get<_CharT, _InIter>::id;
+
+
+ /**
+ * @brief Facet for converting numbers to strings.
+ *
+ * This facet encapsulates the code to convert a number to a string. It is
+ * used by the ostream numeric insertion operators.
+ *
+ * The num_put template uses protected virtual functions to provide the
+ * actual results. The public accessors forward the call to the virtual
+ * functions. These virtual functions are hooks for developers to
+ * implement the behavior they require from the num_put facet.
+ */
+ template<typename _CharT, typename _OutIter>
+ class num_put : public locale::facet
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef _OutIter iter_type;
+ //@}
+
+ /// Numpunct facet id.
+ static locale::id id;
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ num_put(size_t __refs = 0) : facet(__refs) { }
+
+ /**
+ * @brief Numeric formatting.
+ *
+ * Formats the boolean @a v and inserts it into a stream. It does so
+ * by calling num_put::do_put().
+ *
+ * If ios_base::boolalpha is set, writes ctype<CharT>::truename() or
+ * ctype<CharT>::falsename(). Otherwise formats @a v as an int.
+ *
+ * @param s Stream to write to.
+ * @param io Source of locale and flags.
+ * @param fill Char_type to use for filling.
+ * @param v Value to format and insert.
+ * @return Iterator after writing.
+ */
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill, bool __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+
+ //@{
+ /**
+ * @brief Numeric formatting.
+ *
+ * Formats the integral value @a v and inserts it into a
+ * stream. It does so by calling num_put::do_put().
+ *
+ * Formatting is affected by the flag settings in @a io.
+ *
+ * The basic format is affected by the value of io.flags() &
+ * ios_base::basefield. If equal to ios_base::oct, formats like the
+ * printf %o specifier. Else if equal to ios_base::hex, formats like
+ * %x or %X with ios_base::uppercase unset or set respectively.
+ * Otherwise, formats like %d, %ld, %lld for signed and %u, %lu, %llu
+ * for unsigned values. Note that if both oct and hex are set, neither
+ * will take effect.
+ *
+ * If ios_base::showpos is set, '+' is output before positive values.
+ * If ios_base::showbase is set, '0' precedes octal values (except 0)
+ * and '0[xX]' precedes hex values.
+ *
+ * Thousands separators are inserted according to numpunct::grouping()
+ * and numpunct::thousands_sep(). The decimal point character used is
+ * numpunct::decimal_point().
+ *
+ * If io.width() is non-zero, enough @a fill characters are inserted to
+ * make the result at least that wide. If
+ * (io.flags() & ios_base::adjustfield) == ios_base::left, result is
+ * padded at the end. If ios_base::internal, then padding occurs
+ * immediately after either a '+' or '-' or after '0x' or '0X'.
+ * Otherwise, padding occurs at the beginning.
+ *
+ * @param s Stream to write to.
+ * @param io Source of locale and flags.
+ * @param fill Char_type to use for filling.
+ * @param v Value to format and insert.
+ * @return Iterator after writing.
+ */
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill, long __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill,
+ unsigned long __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+
+#ifdef _GLIBCXX_USE_LONG_LONG
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill, long long __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill,
+ unsigned long long __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+#endif
+ //@}
+
+ //@{
+ /**
+ * @brief Numeric formatting.
+ *
+ * Formats the floating point value @a v and inserts it into a stream.
+ * It does so by calling num_put::do_put().
+ *
+ * Formatting is affected by the flag settings in @a io.
+ *
+ * The basic format is affected by the value of io.flags() &
+ * ios_base::floatfield. If equal to ios_base::fixed, formats like the
+ * printf %f specifier. Else if equal to ios_base::scientific, formats
+ * like %e or %E with ios_base::uppercase unset or set respectively.
+ * Otherwise, formats like %g or %G depending on uppercase. Note that
+ * if both fixed and scientific are set, the effect will also be like
+ * %g or %G.
+ *
+ * The output precision is given by io.precision(). This precision is
+ * capped at numeric_limits::digits10 + 2 (different for double and
+ * long double). The default precision is 6.
+ *
+ * If ios_base::showpos is set, '+' is output before positive values.
+ * If ios_base::showpoint is set, a decimal point will always be
+ * output.
+ *
+ * Thousands separators are inserted according to numpunct::grouping()
+ * and numpunct::thousands_sep(). The decimal point character used is
+ * numpunct::decimal_point().
+ *
+ * If io.width() is non-zero, enough @a fill characters are inserted to
+ * make the result at least that wide. If
+ * (io.flags() & ios_base::adjustfield) == ios_base::left, result is
+ * padded at the end. If ios_base::internal, then padding occurs
+ * immediately after either a '+' or '-' or after '0x' or '0X'.
+ * Otherwise, padding occurs at the beginning.
+ *
+ * @param s Stream to write to.
+ * @param io Source of locale and flags.
+ * @param fill Char_type to use for filling.
+ * @param v Value to format and insert.
+ * @return Iterator after writing.
+ */
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill, double __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill,
+ long double __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+ //@}
+
+ /**
+ * @brief Numeric formatting.
+ *
+ * Formats the pointer value @a v and inserts it into a stream. It
+ * does so by calling num_put::do_put().
+ *
+ * This function formats @a v as an unsigned long with ios_base::hex
+ * and ios_base::showbase set.
+ *
+ * @param s Stream to write to.
+ * @param io Source of locale and flags.
+ * @param fill Char_type to use for filling.
+ * @param v Value to format and insert.
+ * @return Iterator after writing.
+ */
+ iter_type
+ put(iter_type __s, ios_base& __f, char_type __fill,
+ const void* __v) const
+ { return this->do_put(__s, __f, __fill, __v); }
+
+ protected:
+ template<typename _ValueT>
+ iter_type
+ _M_insert_float(iter_type, ios_base& __io, char_type __fill,
+ char __mod, _ValueT __v) const;
+
+ void
+ _M_group_float(const char* __grouping, size_t __grouping_size,
+ char_type __sep, const char_type* __p, char_type* __new,
+ char_type* __cs, int& __len) const;
+
+ template<typename _ValueT>
+ iter_type
+ _M_insert_int(iter_type, ios_base& __io, char_type __fill,
+ _ValueT __v) const;
+
+ void
+ _M_group_int(const char* __grouping, size_t __grouping_size,
+ char_type __sep, ios_base& __io, char_type* __new,
+ char_type* __cs, int& __len) const;
+
+ void
+ _M_pad(char_type __fill, streamsize __w, ios_base& __io,
+ char_type* __new, const char_type* __cs, int& __len) const;
+
+ /// Destructor.
+ virtual
+ ~num_put() { };
+
+ //@{
+ /**
+ * @brief Numeric formatting.
+ *
+ * These functions do the work of formatting numeric values and
+ * inserting them into a stream. This function is a hook for derived
+ * classes to change the value returned.
+ *
+ * @param s Stream to write to.
+ * @param io Source of locale and flags.
+ * @param fill Char_type to use for filling.
+ * @param v Value to format and insert.
+ * @return Iterator after writing.
+ */
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, bool __v) const;
+
+ virtual iter_type
+ do_put(iter_type __s, ios_base& __io, char_type __fill, long __v) const
+ { return _M_insert_int(__s, __io, __fill, __v); }
+
+ virtual iter_type
+ do_put(iter_type __s, ios_base& __io, char_type __fill,
+ unsigned long __v) const
+ { return _M_insert_int(__s, __io, __fill, __v); }
+
+#ifdef _GLIBCXX_USE_LONG_LONG
+ virtual iter_type
+ do_put(iter_type __s, ios_base& __io, char_type __fill,
+ long long __v) const
+ { return _M_insert_int(__s, __io, __fill, __v); }
+
+ virtual iter_type
+ do_put(iter_type __s, ios_base& __io, char_type __fill,
+ unsigned long long __v) const
+ { return _M_insert_int(__s, __io, __fill, __v); }
+#endif
+
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, double __v) const;
+
+ // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ virtual iter_type
+ __do_put(iter_type, ios_base&, char_type __fill, double __v) const;
+#else
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, long double __v) const;
+#endif
+
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, const void* __v) const;
+
+ // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, long double __v) const;
+#endif
+ //@}
+ };
+
+ template <typename _CharT, typename _OutIter>
+ locale::id num_put<_CharT, _OutIter>::id;
+
+_GLIBCXX_END_LDBL_NAMESPACE
+
+ // Subclause convenience interfaces, inlines.
+ // NB: These are inline because, when used in a loop, some compilers
+ // can hoist the body out of the loop; then it's just as fast as the
+ // C is*() function.
+
+ /// Convenience interface to ctype.is(ctype_base::space, __c).
+ template<typename _CharT>
+ inline bool
+ isspace(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::space, __c); }
+
+ /// Convenience interface to ctype.is(ctype_base::print, __c).
+ template<typename _CharT>
+ inline bool
+ isprint(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::print, __c); }
+
+ /// Convenience interface to ctype.is(ctype_base::cntrl, __c).
+ template<typename _CharT>
+ inline bool
+ iscntrl(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::cntrl, __c); }
+
+ /// Convenience interface to ctype.is(ctype_base::upper, __c).
+ template<typename _CharT>
+ inline bool
+ isupper(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::upper, __c); }
+
+ /// Convenience interface to ctype.is(ctype_base::lower, __c).
+ template<typename _CharT>
+ inline bool
+ islower(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::lower, __c); }
+
+ /// Convenience interface to ctype.is(ctype_base::alpha, __c).
+ template<typename _CharT>
+ inline bool
+ isalpha(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alpha, __c); }
+
+ /// Convenience interface to ctype.is(ctype_base::digit, __c).
+ template<typename _CharT>
+ inline bool
+ isdigit(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::digit, __c); }
+
+ /// Convenience interface to ctype.is(ctype_base::punct, __c).
+ template<typename _CharT>
+ inline bool
+ ispunct(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::punct, __c); }
+
+ /// Convenience interface to ctype.is(ctype_base::xdigit, __c).
+ template<typename _CharT>
+ inline bool
+ isxdigit(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::xdigit, __c); }
+
+ /// Convenience interface to ctype.is(ctype_base::alnum, __c).
+ template<typename _CharT>
+ inline bool
+ isalnum(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alnum, __c); }
+
+ /// Convenience interface to ctype.is(ctype_base::graph, __c).
+ template<typename _CharT>
+ inline bool
+ isgraph(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::graph, __c); }
+
+ /// Convenience interface to ctype.toupper(__c).
+ template<typename _CharT>
+ inline _CharT
+ toupper(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).toupper(__c); }
+
+ /// Convenience interface to ctype.tolower(__c).
+ template<typename _CharT>
+ inline _CharT
+ tolower(_CharT __c, const locale& __loc)
+ { return use_facet<ctype<_CharT> >(__loc).tolower(__c); }
+
+_GLIBCXX_END_NAMESPACE
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/locale_facets.tcc>
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_facets.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_facets.tcc
new file mode 100644
index 0000000..ba8f398
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_facets.tcc
@@ -0,0 +1,1345 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file locale_facets.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _LOCALE_FACETS_TCC
+#define _LOCALE_FACETS_TCC 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Routine to access a cache for the facet. If the cache didn't
+ // exist before, it gets constructed on the fly.
+ template<typename _Facet>
+ struct __use_cache
+ {
+ const _Facet*
+ operator() (const locale& __loc) const;
+ };
+
+ // Specializations.
+ template<typename _CharT>
+ struct __use_cache<__numpunct_cache<_CharT> >
+ {
+ const __numpunct_cache<_CharT>*
+ operator() (const locale& __loc) const
+ {
+ const size_t __i = numpunct<_CharT>::id._M_id();
+ const locale::facet** __caches = __loc._M_impl->_M_caches;
+ if (!__caches[__i])
+ {
+ __numpunct_cache<_CharT>* __tmp = NULL;
+ __try
+ {
+ __tmp = new __numpunct_cache<_CharT>;
+ __tmp->_M_cache(__loc);
+ }
+ __catch(...)
+ {
+ delete __tmp;
+ __throw_exception_again;
+ }
+ __loc._M_impl->_M_install_cache(__tmp, __i);
+ }
+ return static_cast<const __numpunct_cache<_CharT>*>(__caches[__i]);
+ }
+ };
+
+ template<typename _CharT>
+ void
+ __numpunct_cache<_CharT>::_M_cache(const locale& __loc)
+ {
+ _M_allocated = true;
+
+ const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
+
+ _M_grouping_size = __np.grouping().size();
+ char* __grouping = new char[_M_grouping_size];
+ __np.grouping().copy(__grouping, _M_grouping_size);
+ _M_grouping = __grouping;
+ _M_use_grouping = (_M_grouping_size
+ && static_cast<signed char>(_M_grouping[0]) > 0
+ && (_M_grouping[0]
+ != __gnu_cxx::__numeric_traits<char>::__max));
+
+ _M_truename_size = __np.truename().size();
+ _CharT* __truename = new _CharT[_M_truename_size];
+ __np.truename().copy(__truename, _M_truename_size);
+ _M_truename = __truename;
+
+ _M_falsename_size = __np.falsename().size();
+ _CharT* __falsename = new _CharT[_M_falsename_size];
+ __np.falsename().copy(__falsename, _M_falsename_size);
+ _M_falsename = __falsename;
+
+ _M_decimal_point = __np.decimal_point();
+ _M_thousands_sep = __np.thousands_sep();
+
+ const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
+ __ct.widen(__num_base::_S_atoms_out,
+ __num_base::_S_atoms_out + __num_base::_S_oend, _M_atoms_out);
+ __ct.widen(__num_base::_S_atoms_in,
+ __num_base::_S_atoms_in + __num_base::_S_iend, _M_atoms_in);
+ }
+
+ // Used by both numeric and monetary facets.
+ // Check to make sure that the __grouping_tmp string constructed in
+ // money_get or num_get matches the canonical grouping for a given
+ // locale.
+ // __grouping_tmp is parsed L to R
+ // 1,222,444 == __grouping_tmp of "\1\3\3"
+ // __grouping is parsed R to L
+ // 1,222,444 == __grouping of "\3" == "\3\3\3"
+ bool
+ __verify_grouping(const char* __grouping, size_t __grouping_size,
+ const string& __grouping_tmp);
+
+_GLIBCXX_BEGIN_LDBL_NAMESPACE
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ _M_extract_float(_InIter __beg, _InIter __end, ios_base& __io,
+ ios_base::iostate& __err, string& __xtrc) const
+ {
+ typedef char_traits<_CharT> __traits_type;
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+ const _CharT* __lit = __lc->_M_atoms_in;
+ char_type __c = char_type();
+
+ // True if __beg becomes equal to __end.
+ bool __testeof = __beg == __end;
+
+ // First check for sign.
+ if (!__testeof)
+ {
+ __c = *__beg;
+ const bool __plus = __c == __lit[__num_base::_S_iplus];
+ if ((__plus || __c == __lit[__num_base::_S_iminus])
+ && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+ && !(__c == __lc->_M_decimal_point))
+ {
+ __xtrc += __plus ? '+' : '-';
+ if (++__beg != __end)
+ __c = *__beg;
+ else
+ __testeof = true;
+ }
+ }
+
+ // Next, look for leading zeros.
+ bool __found_mantissa = false;
+ int __sep_pos = 0;
+ while (!__testeof)
+ {
+ if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+ || __c == __lc->_M_decimal_point)
+ break;
+ else if (__c == __lit[__num_base::_S_izero])
+ {
+ if (!__found_mantissa)
+ {
+ __xtrc += '0';
+ __found_mantissa = true;
+ }
+ ++__sep_pos;
+
+ if (++__beg != __end)
+ __c = *__beg;
+ else
+ __testeof = true;
+ }
+ else
+ break;
+ }
+
+ // Only need acceptable digits for floating point numbers.
+ bool __found_dec = false;
+ bool __found_sci = false;
+ string __found_grouping;
+ if (__lc->_M_use_grouping)
+ __found_grouping.reserve(32);
+ const char_type* __lit_zero = __lit + __num_base::_S_izero;
+
+ if (!__lc->_M_allocated)
+ // "C" locale
+ while (!__testeof)
+ {
+ const int __digit = _M_find(__lit_zero, 10, __c);
+ if (__digit != -1)
+ {
+ __xtrc += '0' + __digit;
+ __found_mantissa = true;
+ }
+ else if (__c == __lc->_M_decimal_point
+ && !__found_dec && !__found_sci)
+ {
+ __xtrc += '.';
+ __found_dec = true;
+ }
+ else if ((__c == __lit[__num_base::_S_ie]
+ || __c == __lit[__num_base::_S_iE])
+ && !__found_sci && __found_mantissa)
+ {
+ // Scientific notation.
+ __xtrc += 'e';
+ __found_sci = true;
+
+ // Remove optional plus or minus sign, if they exist.
+ if (++__beg != __end)
+ {
+ __c = *__beg;
+ const bool __plus = __c == __lit[__num_base::_S_iplus];
+ if (__plus || __c == __lit[__num_base::_S_iminus])
+ __xtrc += __plus ? '+' : '-';
+ else
+ continue;
+ }
+ else
+ {
+ __testeof = true;
+ break;
+ }
+ }
+ else
+ break;
+
+ if (++__beg != __end)
+ __c = *__beg;
+ else
+ __testeof = true;
+ }
+ else
+ while (!__testeof)
+ {
+ // According to 22.2.2.1.2, p8-9, first look for thousands_sep
+ // and decimal_point.
+ if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+ {
+ if (!__found_dec && !__found_sci)
+ {
+ // NB: Thousands separator at the beginning of a string
+ // is a no-no, as is two consecutive thousands separators.
+ if (__sep_pos)
+ {
+ __found_grouping += static_cast<char>(__sep_pos);
+ __sep_pos = 0;
+ }
+ else
+ {
+ // NB: __convert_to_v will not assign __v and will
+ // set the failbit.
+ __xtrc.clear();
+ break;
+ }
+ }
+ else
+ break;
+ }
+ else if (__c == __lc->_M_decimal_point)
+ {
+ if (!__found_dec && !__found_sci)
+ {
+ // If no grouping chars are seen, no grouping check
+ // is applied. Therefore __found_grouping is adjusted
+ // only if decimal_point comes after some thousands_sep.
+ if (__found_grouping.size())
+ __found_grouping += static_cast<char>(__sep_pos);
+ __xtrc += '.';
+ __found_dec = true;
+ }
+ else
+ break;
+ }
+ else
+ {
+ const char_type* __q =
+ __traits_type::find(__lit_zero, 10, __c);
+ if (__q)
+ {
+ __xtrc += '0' + (__q - __lit_zero);
+ __found_mantissa = true;
+ ++__sep_pos;
+ }
+ else if ((__c == __lit[__num_base::_S_ie]
+ || __c == __lit[__num_base::_S_iE])
+ && !__found_sci && __found_mantissa)
+ {
+ // Scientific notation.
+ if (__found_grouping.size() && !__found_dec)
+ __found_grouping += static_cast<char>(__sep_pos);
+ __xtrc += 'e';
+ __found_sci = true;
+
+ // Remove optional plus or minus sign, if they exist.
+ if (++__beg != __end)
+ {
+ __c = *__beg;
+ const bool __plus = __c == __lit[__num_base::_S_iplus];
+ if ((__plus || __c == __lit[__num_base::_S_iminus])
+ && !(__lc->_M_use_grouping
+ && __c == __lc->_M_thousands_sep)
+ && !(__c == __lc->_M_decimal_point))
+ __xtrc += __plus ? '+' : '-';
+ else
+ continue;
+ }
+ else
+ {
+ __testeof = true;
+ break;
+ }
+ }
+ else
+ break;
+ }
+
+ if (++__beg != __end)
+ __c = *__beg;
+ else
+ __testeof = true;
+ }
+
+ // Digit grouping is checked. If grouping and found_grouping don't
+ // match, then get very very upset, and set failbit.
+ if (__found_grouping.size())
+ {
+ // Add the ending grouping if a decimal or 'e'/'E' wasn't found.
+ if (!__found_dec && !__found_sci)
+ __found_grouping += static_cast<char>(__sep_pos);
+
+ if (!std::__verify_grouping(__lc->_M_grouping,
+ __lc->_M_grouping_size,
+ __found_grouping))
+ __err = ios_base::failbit;
+ }
+
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ template<typename _ValueT>
+ _InIter
+ num_get<_CharT, _InIter>::
+ _M_extract_int(_InIter __beg, _InIter __end, ios_base& __io,
+ ios_base::iostate& __err, _ValueT& __v) const
+ {
+ typedef char_traits<_CharT> __traits_type;
+ using __gnu_cxx::__add_unsigned;
+ typedef typename __add_unsigned<_ValueT>::__type __unsigned_type;
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+ const _CharT* __lit = __lc->_M_atoms_in;
+ char_type __c = char_type();
+
+ // NB: Iff __basefield == 0, __base can change based on contents.
+ const ios_base::fmtflags __basefield = __io.flags()
+ & ios_base::basefield;
+ const bool __oct = __basefield == ios_base::oct;
+ int __base = __oct ? 8 : (__basefield == ios_base::hex ? 16 : 10);
+
+ // True if __beg becomes equal to __end.
+ bool __testeof = __beg == __end;
+
+ // First check for sign.
+ bool __negative = false;
+ if (!__testeof)
+ {
+ __c = *__beg;
+ __negative = __c == __lit[__num_base::_S_iminus];
+ if ((__negative || __c == __lit[__num_base::_S_iplus])
+ && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+ && !(__c == __lc->_M_decimal_point))
+ {
+ if (++__beg != __end)
+ __c = *__beg;
+ else
+ __testeof = true;
+ }
+ }
+
+ // Next, look for leading zeros and check required digits
+ // for base formats.
+ bool __found_zero = false;
+ int __sep_pos = 0;
+ while (!__testeof)
+ {
+ if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+ || __c == __lc->_M_decimal_point)
+ break;
+ else if (__c == __lit[__num_base::_S_izero]
+ && (!__found_zero || __base == 10))
+ {
+ __found_zero = true;
+ ++__sep_pos;
+ if (__basefield == 0)
+ __base = 8;
+ if (__base == 8)
+ __sep_pos = 0;
+ }
+ else if (__found_zero
+ && (__c == __lit[__num_base::_S_ix]
+ || __c == __lit[__num_base::_S_iX]))
+ {
+ if (__basefield == 0)
+ __base = 16;
+ if (__base == 16)
+ {
+ __found_zero = false;
+ __sep_pos = 0;
+ }
+ else
+ break;
+ }
+ else
+ break;
+
+ if (++__beg != __end)
+ {
+ __c = *__beg;
+ if (!__found_zero)
+ break;
+ }
+ else
+ __testeof = true;
+ }
+
+ // At this point, base is determined. If not hex, only allow
+ // base digits as valid input.
+ const size_t __len = (__base == 16 ? __num_base::_S_iend
+ - __num_base::_S_izero : __base);
+
+ // Extract.
+ string __found_grouping;
+ if (__lc->_M_use_grouping)
+ __found_grouping.reserve(32);
+ bool __testfail = false;
+ bool __testoverflow = false;
+ const __unsigned_type __max =
+ (__negative && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
+ ? -__gnu_cxx::__numeric_traits<_ValueT>::__min
+ : __gnu_cxx::__numeric_traits<_ValueT>::__max;
+ const __unsigned_type __smax = __max / __base;
+ __unsigned_type __result = 0;
+ int __digit = 0;
+ const char_type* __lit_zero = __lit + __num_base::_S_izero;
+
+ if (!__lc->_M_allocated)
+ // "C" locale
+ while (!__testeof)
+ {
+ __digit = _M_find(__lit_zero, __len, __c);
+ if (__digit == -1)
+ break;
+
+ if (__result > __smax)
+ __testoverflow = true;
+ else
+ {
+ __result *= __base;
+ __testoverflow |= __result > __max - __digit;
+ __result += __digit;
+ ++__sep_pos;
+ }
+
+ if (++__beg != __end)
+ __c = *__beg;
+ else
+ __testeof = true;
+ }
+ else
+ while (!__testeof)
+ {
+ // According to 22.2.2.1.2, p8-9, first look for thousands_sep
+ // and decimal_point.
+ if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+ {
+ // NB: Thousands separator at the beginning of a string
+ // is a no-no, as is two consecutive thousands separators.
+ if (__sep_pos)
+ {
+ __found_grouping += static_cast<char>(__sep_pos);
+ __sep_pos = 0;
+ }
+ else
+ {
+ __testfail = true;
+ break;
+ }
+ }
+ else if (__c == __lc->_M_decimal_point)
+ break;
+ else
+ {
+ const char_type* __q =
+ __traits_type::find(__lit_zero, __len, __c);
+ if (!__q)
+ break;
+
+ __digit = __q - __lit_zero;
+ if (__digit > 15)
+ __digit -= 6;
+ if (__result > __smax)
+ __testoverflow = true;
+ else
+ {
+ __result *= __base;
+ __testoverflow |= __result > __max - __digit;
+ __result += __digit;
+ ++__sep_pos;
+ }
+ }
+
+ if (++__beg != __end)
+ __c = *__beg;
+ else
+ __testeof = true;
+ }
+
+ // Digit grouping is checked. If grouping and found_grouping don't
+ // match, then get very very upset, and set failbit.
+ if (__found_grouping.size())
+ {
+ // Add the ending grouping.
+ __found_grouping += static_cast<char>(__sep_pos);
+
+ if (!std::__verify_grouping(__lc->_M_grouping,
+ __lc->_M_grouping_size,
+ __found_grouping))
+ __err = ios_base::failbit;
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 23. Num_get overflow result.
+ if ((!__sep_pos && !__found_zero && !__found_grouping.size())
+ || __testfail)
+ {
+ __v = 0;
+ __err = ios_base::failbit;
+ }
+ else if (__testoverflow)
+ {
+ if (__negative
+ && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
+ __v = __gnu_cxx::__numeric_traits<_ValueT>::__min;
+ else
+ __v = __gnu_cxx::__numeric_traits<_ValueT>::__max;
+ __err = ios_base::failbit;
+ }
+ else
+ __v = __negative ? -__result : __result;
+
+ if (__testeof)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 17. Bad bool parsing
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, bool& __v) const
+ {
+ if (!(__io.flags() & ios_base::boolalpha))
+ {
+ // Parse bool values as long.
+ // NB: We can't just call do_get(long) here, as it might
+ // refer to a derived class.
+ long __l = -1;
+ __beg = _M_extract_int(__beg, __end, __io, __err, __l);
+ if (__l == 0 || __l == 1)
+ __v = bool(__l);
+ else
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 23. Num_get overflow result.
+ __v = true;
+ __err = ios_base::failbit;
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ }
+ }
+ else
+ {
+ // Parse bool values as alphanumeric.
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+
+ bool __testf = true;
+ bool __testt = true;
+ bool __donef = __lc->_M_falsename_size == 0;
+ bool __donet = __lc->_M_truename_size == 0;
+ bool __testeof = false;
+ size_t __n = 0;
+ while (!__donef || !__donet)
+ {
+ if (__beg == __end)
+ {
+ __testeof = true;
+ break;
+ }
+
+ const char_type __c = *__beg;
+
+ if (!__donef)
+ __testf = __c == __lc->_M_falsename[__n];
+
+ if (!__testf && __donet)
+ break;
+
+ if (!__donet)
+ __testt = __c == __lc->_M_truename[__n];
+
+ if (!__testt && __donef)
+ break;
+
+ if (!__testt && !__testf)
+ break;
+
+ ++__n;
+ ++__beg;
+
+ __donef = !__testf || __n >= __lc->_M_falsename_size;
+ __donet = !__testt || __n >= __lc->_M_truename_size;
+ }
+ if (__testf && __n == __lc->_M_falsename_size && __n)
+ {
+ __v = false;
+ if (__testt && __n == __lc->_M_truename_size)
+ __err = ios_base::failbit;
+ else
+ __err = __testeof ? ios_base::eofbit : ios_base::goodbit;
+ }
+ else if (__testt && __n == __lc->_M_truename_size && __n)
+ {
+ __v = true;
+ __err = __testeof ? ios_base::eofbit : ios_base::goodbit;
+ }
+ else
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 23. Num_get overflow result.
+ __v = false;
+ __err = ios_base::failbit;
+ if (__testeof)
+ __err |= ios_base::eofbit;
+ }
+ }
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, float& __v) const
+ {
+ string __xtrc;
+ __xtrc.reserve(32);
+ __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+ std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, double& __v) const
+ {
+ string __xtrc;
+ __xtrc.reserve(32);
+ __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+ std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ __do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, double& __v) const
+ {
+ string __xtrc;
+ __xtrc.reserve(32);
+ __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+ std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+#endif
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, long double& __v) const
+ {
+ string __xtrc;
+ __xtrc.reserve(32);
+ __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+ std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ num_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, void*& __v) const
+ {
+ // Prepare for hex formatted input.
+ typedef ios_base::fmtflags fmtflags;
+ const fmtflags __fmt = __io.flags();
+ __io.flags((__fmt & ~ios_base::basefield) | ios_base::hex);
+
+ typedef __gnu_cxx::__conditional_type<(sizeof(void*)
+ <= sizeof(unsigned long)),
+ unsigned long, unsigned long long>::__type _UIntPtrType;
+
+ _UIntPtrType __ul;
+ __beg = _M_extract_int(__beg, __end, __io, __err, __ul);
+
+ // Reset from hex formatted input.
+ __io.flags(__fmt);
+
+ __v = reinterpret_cast<void*>(__ul);
+ return __beg;
+ }
+
+ // For use by integer and floating-point types after they have been
+ // converted into a char_type string.
+ template<typename _CharT, typename _OutIter>
+ void
+ num_put<_CharT, _OutIter>::
+ _M_pad(_CharT __fill, streamsize __w, ios_base& __io,
+ _CharT* __new, const _CharT* __cs, int& __len) const
+ {
+ // [22.2.2.2.2] Stage 3.
+ // If necessary, pad.
+ __pad<_CharT, char_traits<_CharT> >::_S_pad(__io, __fill, __new,
+ __cs, __w, __len);
+ __len = static_cast<int>(__w);
+ }
+
+_GLIBCXX_END_LDBL_NAMESPACE
+
+ template<typename _CharT, typename _ValueT>
+ int
+ __int_to_char(_CharT* __bufend, _ValueT __v, const _CharT* __lit,
+ ios_base::fmtflags __flags, bool __dec)
+ {
+ _CharT* __buf = __bufend;
+ if (__builtin_expect(__dec, true))
+ {
+ // Decimal.
+ do
+ {
+ *--__buf = __lit[(__v % 10) + __num_base::_S_odigits];
+ __v /= 10;
+ }
+ while (__v != 0);
+ }
+ else if ((__flags & ios_base::basefield) == ios_base::oct)
+ {
+ // Octal.
+ do
+ {
+ *--__buf = __lit[(__v & 0x7) + __num_base::_S_odigits];
+ __v >>= 3;
+ }
+ while (__v != 0);
+ }
+ else
+ {
+ // Hex.
+ const bool __uppercase = __flags & ios_base::uppercase;
+ const int __case_offset = __uppercase ? __num_base::_S_oudigits
+ : __num_base::_S_odigits;
+ do
+ {
+ *--__buf = __lit[(__v & 0xf) + __case_offset];
+ __v >>= 4;
+ }
+ while (__v != 0);
+ }
+ return __bufend - __buf;
+ }
+
+_GLIBCXX_BEGIN_LDBL_NAMESPACE
+
+ template<typename _CharT, typename _OutIter>
+ void
+ num_put<_CharT, _OutIter>::
+ _M_group_int(const char* __grouping, size_t __grouping_size, _CharT __sep,
+ ios_base&, _CharT* __new, _CharT* __cs, int& __len) const
+ {
+ _CharT* __p = std::__add_grouping(__new, __sep, __grouping,
+ __grouping_size, __cs, __cs + __len);
+ __len = __p - __new;
+ }
+
+ template<typename _CharT, typename _OutIter>
+ template<typename _ValueT>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ _M_insert_int(_OutIter __s, ios_base& __io, _CharT __fill,
+ _ValueT __v) const
+ {
+ using __gnu_cxx::__add_unsigned;
+ typedef typename __add_unsigned<_ValueT>::__type __unsigned_type;
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+ const _CharT* __lit = __lc->_M_atoms_out;
+ const ios_base::fmtflags __flags = __io.flags();
+
+ // Long enough to hold hex, dec, and octal representations.
+ const int __ilen = 5 * sizeof(_ValueT);
+ _CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __ilen));
+
+ // [22.2.2.2.2] Stage 1, numeric conversion to character.
+ // Result is returned right-justified in the buffer.
+ const ios_base::fmtflags __basefield = __flags & ios_base::basefield;
+ const bool __dec = (__basefield != ios_base::oct
+ && __basefield != ios_base::hex);
+ const __unsigned_type __u = ((__v > 0 || !__dec)
+ ? __unsigned_type(__v)
+ : -__unsigned_type(__v));
+ int __len = __int_to_char(__cs + __ilen, __u, __lit, __flags, __dec);
+ __cs += __ilen - __len;
+
+ // Add grouping, if necessary.
+ if (__lc->_M_use_grouping)
+ {
+ // Grouping can add (almost) as many separators as the number
+ // of digits + space is reserved for numeric base or sign.
+ _CharT* __cs2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * (__len + 1)
+ * 2));
+ _M_group_int(__lc->_M_grouping, __lc->_M_grouping_size,
+ __lc->_M_thousands_sep, __io, __cs2 + 2, __cs, __len);
+ __cs = __cs2 + 2;
+ }
+
+ // Complete Stage 1, prepend numeric base or sign.
+ if (__builtin_expect(__dec, true))
+ {
+ // Decimal.
+ if (__v >= 0)
+ {
+ if (bool(__flags & ios_base::showpos)
+ && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
+ *--__cs = __lit[__num_base::_S_oplus], ++__len;
+ }
+ else
+ *--__cs = __lit[__num_base::_S_ominus], ++__len;
+ }
+ else if (bool(__flags & ios_base::showbase) && __v)
+ {
+ if (__basefield == ios_base::oct)
+ *--__cs = __lit[__num_base::_S_odigits], ++__len;
+ else
+ {
+ // 'x' or 'X'
+ const bool __uppercase = __flags & ios_base::uppercase;
+ *--__cs = __lit[__num_base::_S_ox + __uppercase];
+ // '0'
+ *--__cs = __lit[__num_base::_S_odigits];
+ __len += 2;
+ }
+ }
+
+ // Pad.
+ const streamsize __w = __io.width();
+ if (__w > static_cast<streamsize>(__len))
+ {
+ _CharT* __cs3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __w));
+ _M_pad(__fill, __w, __io, __cs3, __cs, __len);
+ __cs = __cs3;
+ }
+ __io.width(0);
+
+ // [22.2.2.2.2] Stage 4.
+ // Write resulting, fully-formatted string to output iterator.
+ return std::__write(__s, __cs, __len);
+ }
+
+ template<typename _CharT, typename _OutIter>
+ void
+ num_put<_CharT, _OutIter>::
+ _M_group_float(const char* __grouping, size_t __grouping_size,
+ _CharT __sep, const _CharT* __p, _CharT* __new,
+ _CharT* __cs, int& __len) const
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 282. What types does numpunct grouping refer to?
+ // Add grouping, if necessary.
+ const int __declen = __p ? __p - __cs : __len;
+ _CharT* __p2 = std::__add_grouping(__new, __sep, __grouping,
+ __grouping_size,
+ __cs, __cs + __declen);
+
+ // Tack on decimal part.
+ int __newlen = __p2 - __new;
+ if (__p)
+ {
+ char_traits<_CharT>::copy(__p2, __p, __len - __declen);
+ __newlen += __len - __declen;
+ }
+ __len = __newlen;
+ }
+
+ // The following code uses vsnprintf (or vsprintf(), when
+ // _GLIBCXX_USE_C99 is not defined) to convert floating point values
+ // for insertion into a stream. An optimization would be to replace
+ // them with code that works directly on a wide buffer and then use
+ // __pad to do the padding. It would be good to replace them anyway
+ // to gain back the efficiency that C++ provides by knowing up front
+ // the type of the values to insert. Also, sprintf is dangerous
+ // since may lead to accidental buffer overruns. This
+ // implementation follows the C++ standard fairly directly as
+ // outlined in 22.2.2.2 [lib.locale.num.put]
+ template<typename _CharT, typename _OutIter>
+ template<typename _ValueT>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ _M_insert_float(_OutIter __s, ios_base& __io, _CharT __fill, char __mod,
+ _ValueT __v) const
+ {
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+
+ // Use default precision if out of range.
+ const streamsize __prec = __io.precision() < 0 ? 6 : __io.precision();
+
+ const int __max_digits =
+ __gnu_cxx::__numeric_traits<_ValueT>::__digits10;
+
+ // [22.2.2.2.2] Stage 1, numeric conversion to character.
+ int __len;
+ // Long enough for the max format spec.
+ char __fbuf[16];
+ __num_base::_S_format_float(__io, __fbuf, __mod);
+
+#ifdef _GLIBCXX_USE_C99
+ // First try a buffer perhaps big enough (most probably sufficient
+ // for non-ios_base::fixed outputs)
+ int __cs_size = __max_digits * 3;
+ char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+ __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+ __fbuf, __prec, __v);
+
+ // If the buffer was not large enough, try again with the correct size.
+ if (__len >= __cs_size)
+ {
+ __cs_size = __len + 1;
+ __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+ __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+ __fbuf, __prec, __v);
+ }
+#else
+ // Consider the possibility of long ios_base::fixed outputs
+ const bool __fixed = __io.flags() & ios_base::fixed;
+ const int __max_exp =
+ __gnu_cxx::__numeric_traits<_ValueT>::__max_exponent10;
+
+ // The size of the output string is computed as follows.
+ // ios_base::fixed outputs may need up to __max_exp + 1 chars
+ // for the integer part + __prec chars for the fractional part
+ // + 3 chars for sign, decimal point, '\0'. On the other hand,
+ // for non-fixed outputs __max_digits * 2 + __prec chars are
+ // largely sufficient.
+ const int __cs_size = __fixed ? __max_exp + __prec + 4
+ : __max_digits * 2 + __prec;
+ char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+ __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, __fbuf,
+ __prec, __v);
+#endif
+
+ // [22.2.2.2.2] Stage 2, convert to char_type, using correct
+ // numpunct.decimal_point() values for '.' and adding grouping.
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+ _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __len));
+ __ctype.widen(__cs, __cs + __len, __ws);
+
+ // Replace decimal point.
+ _CharT* __wp = 0;
+ const char* __p = char_traits<char>::find(__cs, __len, '.');
+ if (__p)
+ {
+ __wp = __ws + (__p - __cs);
+ *__wp = __lc->_M_decimal_point;
+ }
+
+ // Add grouping, if necessary.
+ // N.B. Make sure to not group things like 2e20, i.e., no decimal
+ // point, scientific notation.
+ if (__lc->_M_use_grouping
+ && (__wp || __len < 3 || (__cs[1] <= '9' && __cs[2] <= '9'
+ && __cs[1] >= '0' && __cs[2] >= '0')))
+ {
+ // Grouping can add (almost) as many separators as the
+ // number of digits, but no more.
+ _CharT* __ws2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __len * 2));
+
+ streamsize __off = 0;
+ if (__cs[0] == '-' || __cs[0] == '+')
+ {
+ __off = 1;
+ __ws2[0] = __ws[0];
+ __len -= 1;
+ }
+
+ _M_group_float(__lc->_M_grouping, __lc->_M_grouping_size,
+ __lc->_M_thousands_sep, __wp, __ws2 + __off,
+ __ws + __off, __len);
+ __len += __off;
+
+ __ws = __ws2;
+ }
+
+ // Pad.
+ const streamsize __w = __io.width();
+ if (__w > static_cast<streamsize>(__len))
+ {
+ _CharT* __ws3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __w));
+ _M_pad(__fill, __w, __io, __ws3, __ws, __len);
+ __ws = __ws3;
+ }
+ __io.width(0);
+
+ // [22.2.2.2.2] Stage 4.
+ // Write resulting, fully-formatted string to output iterator.
+ return std::__write(__s, __ws, __len);
+ }
+
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ do_put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const
+ {
+ const ios_base::fmtflags __flags = __io.flags();
+ if ((__flags & ios_base::boolalpha) == 0)
+ {
+ const long __l = __v;
+ __s = _M_insert_int(__s, __io, __fill, __l);
+ }
+ else
+ {
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+
+ const _CharT* __name = __v ? __lc->_M_truename
+ : __lc->_M_falsename;
+ int __len = __v ? __lc->_M_truename_size
+ : __lc->_M_falsename_size;
+
+ const streamsize __w = __io.width();
+ if (__w > static_cast<streamsize>(__len))
+ {
+ const streamsize __plen = __w - __len;
+ _CharT* __ps
+ = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __plen));
+
+ char_traits<_CharT>::assign(__ps, __plen, __fill);
+ __io.width(0);
+
+ if ((__flags & ios_base::adjustfield) == ios_base::left)
+ {
+ __s = std::__write(__s, __name, __len);
+ __s = std::__write(__s, __ps, __plen);
+ }
+ else
+ {
+ __s = std::__write(__s, __ps, __plen);
+ __s = std::__write(__s, __name, __len);
+ }
+ return __s;
+ }
+ __io.width(0);
+ __s = std::__write(__s, __name, __len);
+ }
+ return __s;
+ }
+
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ do_put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
+ { return _M_insert_float(__s, __io, __fill, char(), __v); }
+
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ __do_put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
+ { return _M_insert_float(__s, __io, __fill, char(), __v); }
+#endif
+
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ do_put(iter_type __s, ios_base& __io, char_type __fill,
+ long double __v) const
+ { return _M_insert_float(__s, __io, __fill, 'L', __v); }
+
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ num_put<_CharT, _OutIter>::
+ do_put(iter_type __s, ios_base& __io, char_type __fill,
+ const void* __v) const
+ {
+ const ios_base::fmtflags __flags = __io.flags();
+ const ios_base::fmtflags __fmt = ~(ios_base::basefield
+ | ios_base::uppercase);
+ __io.flags((__flags & __fmt) | (ios_base::hex | ios_base::showbase));
+
+ typedef __gnu_cxx::__conditional_type<(sizeof(const void*)
+ <= sizeof(unsigned long)),
+ unsigned long, unsigned long long>::__type _UIntPtrType;
+
+ __s = _M_insert_int(__s, __io, __fill,
+ reinterpret_cast<_UIntPtrType>(__v));
+ __io.flags(__flags);
+ return __s;
+ }
+
+_GLIBCXX_END_LDBL_NAMESPACE
+
+ // Construct correctly padded string, as per 22.2.2.2.2
+ // Assumes
+ // __newlen > __oldlen
+ // __news is allocated for __newlen size
+
+ // NB: Of the two parameters, _CharT can be deduced from the
+ // function arguments. The other (_Traits) has to be explicitly specified.
+ template<typename _CharT, typename _Traits>
+ void
+ __pad<_CharT, _Traits>::_S_pad(ios_base& __io, _CharT __fill,
+ _CharT* __news, const _CharT* __olds,
+ streamsize __newlen, streamsize __oldlen)
+ {
+ const size_t __plen = static_cast<size_t>(__newlen - __oldlen);
+ const ios_base::fmtflags __adjust = __io.flags() & ios_base::adjustfield;
+
+ // Padding last.
+ if (__adjust == ios_base::left)
+ {
+ _Traits::copy(__news, __olds, __oldlen);
+ _Traits::assign(__news + __oldlen, __plen, __fill);
+ return;
+ }
+
+ size_t __mod = 0;
+ if (__adjust == ios_base::internal)
+ {
+ // Pad after the sign, if there is one.
+ // Pad after 0[xX], if there is one.
+ // Who came up with these rules, anyway? Jeeze.
+ const locale& __loc = __io._M_getloc();
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+ if (__ctype.widen('-') == __olds[0]
+ || __ctype.widen('+') == __olds[0])
+ {
+ __news[0] = __olds[0];
+ __mod = 1;
+ ++__news;
+ }
+ else if (__ctype.widen('0') == __olds[0]
+ && __oldlen > 1
+ && (__ctype.widen('x') == __olds[1]
+ || __ctype.widen('X') == __olds[1]))
+ {
+ __news[0] = __olds[0];
+ __news[1] = __olds[1];
+ __mod = 2;
+ __news += 2;
+ }
+ // else Padding first.
+ }
+ _Traits::assign(__news, __plen, __fill);
+ _Traits::copy(__news + __plen, __olds + __mod, __oldlen - __mod);
+ }
+
+ template<typename _CharT>
+ _CharT*
+ __add_grouping(_CharT* __s, _CharT __sep,
+ const char* __gbeg, size_t __gsize,
+ const _CharT* __first, const _CharT* __last)
+ {
+ size_t __idx = 0;
+ size_t __ctr = 0;
+
+ while (__last - __first > __gbeg[__idx]
+ && static_cast<signed char>(__gbeg[__idx]) > 0
+ && __gbeg[__idx] != __gnu_cxx::__numeric_traits<char>::__max)
+ {
+ __last -= __gbeg[__idx];
+ __idx < __gsize - 1 ? ++__idx : ++__ctr;
+ }
+
+ while (__first != __last)
+ *__s++ = *__first++;
+
+ while (__ctr--)
+ {
+ *__s++ = __sep;
+ for (char __i = __gbeg[__idx]; __i > 0; --__i)
+ *__s++ = *__first++;
+ }
+
+ while (__idx--)
+ {
+ *__s++ = __sep;
+ for (char __i = __gbeg[__idx]; __i > 0; --__i)
+ *__s++ = *__first++;
+ }
+
+ return __s;
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class numpunct<char>;
+ extern template class numpunct_byname<char>;
+ extern template class _GLIBCXX_LDBL_NAMESPACE num_get<char>;
+ extern template class _GLIBCXX_LDBL_NAMESPACE num_put<char>;
+ extern template class ctype_byname<char>;
+
+ extern template
+ const ctype<char>&
+ use_facet<ctype<char> >(const locale&);
+
+ extern template
+ const numpunct<char>&
+ use_facet<numpunct<char> >(const locale&);
+
+ extern template
+ const num_put<char>&
+ use_facet<num_put<char> >(const locale&);
+
+ extern template
+ const num_get<char>&
+ use_facet<num_get<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<ctype<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<numpunct<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<num_put<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<num_get<char> >(const locale&);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class numpunct<wchar_t>;
+ extern template class numpunct_byname<wchar_t>;
+ extern template class _GLIBCXX_LDBL_NAMESPACE num_get<wchar_t>;
+ extern template class _GLIBCXX_LDBL_NAMESPACE num_put<wchar_t>;
+ extern template class ctype_byname<wchar_t>;
+
+ extern template
+ const ctype<wchar_t>&
+ use_facet<ctype<wchar_t> >(const locale&);
+
+ extern template
+ const numpunct<wchar_t>&
+ use_facet<numpunct<wchar_t> >(const locale&);
+
+ extern template
+ const num_put<wchar_t>&
+ use_facet<num_put<wchar_t> >(const locale&);
+
+ extern template
+ const num_get<wchar_t>&
+ use_facet<num_get<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<ctype<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<numpunct<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<num_put<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<num_get<wchar_t> >(const locale&);
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_facets_nonio.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_facets_nonio.h
new file mode 100644
index 0000000..aba96d6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_facets_nonio.h
@@ -0,0 +1,1914 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file locale_facets_nonio.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+#ifndef _LOCALE_FACETS_NONIO_H
+#define _LOCALE_FACETS_NONIO_H 1
+
+#pragma GCC system_header
+
+#include <ctime> // For struct tm
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @brief Time format ordering data.
+ *
+ * This class provides an enum representing different orderings of day,
+ * month, and year.
+ */
+ class time_base
+ {
+ public:
+ enum dateorder { no_order, dmy, mdy, ymd, ydm };
+ };
+
+ template<typename _CharT>
+ struct __timepunct_cache : public locale::facet
+ {
+ // List of all known timezones, with GMT first.
+ static const _CharT* _S_timezones[14];
+
+ const _CharT* _M_date_format;
+ const _CharT* _M_date_era_format;
+ const _CharT* _M_time_format;
+ const _CharT* _M_time_era_format;
+ const _CharT* _M_date_time_format;
+ const _CharT* _M_date_time_era_format;
+ const _CharT* _M_am;
+ const _CharT* _M_pm;
+ const _CharT* _M_am_pm_format;
+
+ // Day names, starting with "C"'s Sunday.
+ const _CharT* _M_day1;
+ const _CharT* _M_day2;
+ const _CharT* _M_day3;
+ const _CharT* _M_day4;
+ const _CharT* _M_day5;
+ const _CharT* _M_day6;
+ const _CharT* _M_day7;
+
+ // Abbreviated day names, starting with "C"'s Sun.
+ const _CharT* _M_aday1;
+ const _CharT* _M_aday2;
+ const _CharT* _M_aday3;
+ const _CharT* _M_aday4;
+ const _CharT* _M_aday5;
+ const _CharT* _M_aday6;
+ const _CharT* _M_aday7;
+
+ // Month names, starting with "C"'s January.
+ const _CharT* _M_month01;
+ const _CharT* _M_month02;
+ const _CharT* _M_month03;
+ const _CharT* _M_month04;
+ const _CharT* _M_month05;
+ const _CharT* _M_month06;
+ const _CharT* _M_month07;
+ const _CharT* _M_month08;
+ const _CharT* _M_month09;
+ const _CharT* _M_month10;
+ const _CharT* _M_month11;
+ const _CharT* _M_month12;
+
+ // Abbreviated month names, starting with "C"'s Jan.
+ const _CharT* _M_amonth01;
+ const _CharT* _M_amonth02;
+ const _CharT* _M_amonth03;
+ const _CharT* _M_amonth04;
+ const _CharT* _M_amonth05;
+ const _CharT* _M_amonth06;
+ const _CharT* _M_amonth07;
+ const _CharT* _M_amonth08;
+ const _CharT* _M_amonth09;
+ const _CharT* _M_amonth10;
+ const _CharT* _M_amonth11;
+ const _CharT* _M_amonth12;
+
+ bool _M_allocated;
+
+ __timepunct_cache(size_t __refs = 0) : facet(__refs),
+ _M_date_format(NULL), _M_date_era_format(NULL), _M_time_format(NULL),
+ _M_time_era_format(NULL), _M_date_time_format(NULL),
+ _M_date_time_era_format(NULL), _M_am(NULL), _M_pm(NULL),
+ _M_am_pm_format(NULL), _M_day1(NULL), _M_day2(NULL), _M_day3(NULL),
+ _M_day4(NULL), _M_day5(NULL), _M_day6(NULL), _M_day7(NULL),
+ _M_aday1(NULL), _M_aday2(NULL), _M_aday3(NULL), _M_aday4(NULL),
+ _M_aday5(NULL), _M_aday6(NULL), _M_aday7(NULL), _M_month01(NULL),
+ _M_month02(NULL), _M_month03(NULL), _M_month04(NULL), _M_month05(NULL),
+ _M_month06(NULL), _M_month07(NULL), _M_month08(NULL), _M_month09(NULL),
+ _M_month10(NULL), _M_month11(NULL), _M_month12(NULL), _M_amonth01(NULL),
+ _M_amonth02(NULL), _M_amonth03(NULL), _M_amonth04(NULL),
+ _M_amonth05(NULL), _M_amonth06(NULL), _M_amonth07(NULL),
+ _M_amonth08(NULL), _M_amonth09(NULL), _M_amonth10(NULL),
+ _M_amonth11(NULL), _M_amonth12(NULL), _M_allocated(false)
+ { }
+
+ ~__timepunct_cache();
+
+ void
+ _M_cache(const locale& __loc);
+
+ private:
+ __timepunct_cache&
+ operator=(const __timepunct_cache&);
+
+ explicit
+ __timepunct_cache(const __timepunct_cache&);
+ };
+
+ template<typename _CharT>
+ __timepunct_cache<_CharT>::~__timepunct_cache()
+ {
+ if (_M_allocated)
+ {
+ // Unused.
+ }
+ }
+
+ // Specializations.
+ template<>
+ const char*
+ __timepunct_cache<char>::_S_timezones[14];
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ const wchar_t*
+ __timepunct_cache<wchar_t>::_S_timezones[14];
+#endif
+
+ // Generic.
+ template<typename _CharT>
+ const _CharT* __timepunct_cache<_CharT>::_S_timezones[14];
+
+ template<typename _CharT>
+ class __timepunct : public locale::facet
+ {
+ public:
+ // Types:
+ typedef _CharT __char_type;
+ typedef basic_string<_CharT> __string_type;
+ typedef __timepunct_cache<_CharT> __cache_type;
+
+ protected:
+ __cache_type* _M_data;
+ __c_locale _M_c_locale_timepunct;
+ const char* _M_name_timepunct;
+
+ public:
+ /// Numpunct facet id.
+ static locale::id id;
+
+ explicit
+ __timepunct(size_t __refs = 0);
+
+ explicit
+ __timepunct(__cache_type* __cache, size_t __refs = 0);
+
+ /**
+ * @brief Internal constructor. Not for general use.
+ *
+ * This is a constructor for use by the library itself to set up new
+ * locales.
+ *
+ * @param cloc The "C" locale.
+ * @param s The name of a locale.
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ __timepunct(__c_locale __cloc, const char* __s, size_t __refs = 0);
+
+ // FIXME: for error checking purposes _M_put should return the return
+ // value of strftime/wcsftime.
+ void
+ _M_put(_CharT* __s, size_t __maxlen, const _CharT* __format,
+ const tm* __tm) const;
+
+ void
+ _M_date_formats(const _CharT** __date) const
+ {
+ // Always have default first.
+ __date[0] = _M_data->_M_date_format;
+ __date[1] = _M_data->_M_date_era_format;
+ }
+
+ void
+ _M_time_formats(const _CharT** __time) const
+ {
+ // Always have default first.
+ __time[0] = _M_data->_M_time_format;
+ __time[1] = _M_data->_M_time_era_format;
+ }
+
+ void
+ _M_date_time_formats(const _CharT** __dt) const
+ {
+ // Always have default first.
+ __dt[0] = _M_data->_M_date_time_format;
+ __dt[1] = _M_data->_M_date_time_era_format;
+ }
+
+ void
+ _M_am_pm_format(const _CharT* __ampm) const
+ { __ampm = _M_data->_M_am_pm_format; }
+
+ void
+ _M_am_pm(const _CharT** __ampm) const
+ {
+ __ampm[0] = _M_data->_M_am;
+ __ampm[1] = _M_data->_M_pm;
+ }
+
+ void
+ _M_days(const _CharT** __days) const
+ {
+ __days[0] = _M_data->_M_day1;
+ __days[1] = _M_data->_M_day2;
+ __days[2] = _M_data->_M_day3;
+ __days[3] = _M_data->_M_day4;
+ __days[4] = _M_data->_M_day5;
+ __days[5] = _M_data->_M_day6;
+ __days[6] = _M_data->_M_day7;
+ }
+
+ void
+ _M_days_abbreviated(const _CharT** __days) const
+ {
+ __days[0] = _M_data->_M_aday1;
+ __days[1] = _M_data->_M_aday2;
+ __days[2] = _M_data->_M_aday3;
+ __days[3] = _M_data->_M_aday4;
+ __days[4] = _M_data->_M_aday5;
+ __days[5] = _M_data->_M_aday6;
+ __days[6] = _M_data->_M_aday7;
+ }
+
+ void
+ _M_months(const _CharT** __months) const
+ {
+ __months[0] = _M_data->_M_month01;
+ __months[1] = _M_data->_M_month02;
+ __months[2] = _M_data->_M_month03;
+ __months[3] = _M_data->_M_month04;
+ __months[4] = _M_data->_M_month05;
+ __months[5] = _M_data->_M_month06;
+ __months[6] = _M_data->_M_month07;
+ __months[7] = _M_data->_M_month08;
+ __months[8] = _M_data->_M_month09;
+ __months[9] = _M_data->_M_month10;
+ __months[10] = _M_data->_M_month11;
+ __months[11] = _M_data->_M_month12;
+ }
+
+ void
+ _M_months_abbreviated(const _CharT** __months) const
+ {
+ __months[0] = _M_data->_M_amonth01;
+ __months[1] = _M_data->_M_amonth02;
+ __months[2] = _M_data->_M_amonth03;
+ __months[3] = _M_data->_M_amonth04;
+ __months[4] = _M_data->_M_amonth05;
+ __months[5] = _M_data->_M_amonth06;
+ __months[6] = _M_data->_M_amonth07;
+ __months[7] = _M_data->_M_amonth08;
+ __months[8] = _M_data->_M_amonth09;
+ __months[9] = _M_data->_M_amonth10;
+ __months[10] = _M_data->_M_amonth11;
+ __months[11] = _M_data->_M_amonth12;
+ }
+
+ protected:
+ virtual
+ ~__timepunct();
+
+ // For use at construction time only.
+ void
+ _M_initialize_timepunct(__c_locale __cloc = NULL);
+ };
+
+ template<typename _CharT>
+ locale::id __timepunct<_CharT>::id;
+
+ // Specializations.
+ template<>
+ void
+ __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc);
+
+ template<>
+ void
+ __timepunct<char>::_M_put(char*, size_t, const char*, const tm*) const;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ void
+ __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc);
+
+ template<>
+ void
+ __timepunct<wchar_t>::_M_put(wchar_t*, size_t, const wchar_t*,
+ const tm*) const;
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+ // Include host and configuration specific timepunct functions.
+ #include <bits/time_members.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @brief Facet for parsing dates and times.
+ *
+ * This facet encapsulates the code to parse and return a date or
+ * time from a string. It is used by the istream numeric
+ * extraction operators.
+ *
+ * The time_get template uses protected virtual functions to provide the
+ * actual results. The public accessors forward the call to the virtual
+ * functions. These virtual functions are hooks for developers to
+ * implement the behavior they require from the time_get facet.
+ */
+ template<typename _CharT, typename _InIter>
+ class time_get : public locale::facet, public time_base
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef _InIter iter_type;
+ //@}
+ typedef basic_string<_CharT> __string_type;
+
+ /// Numpunct facet id.
+ static locale::id id;
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ time_get(size_t __refs = 0)
+ : facet (__refs) { }
+
+ /**
+ * @brief Return preferred order of month, day, and year.
+ *
+ * This function returns an enum from timebase::dateorder giving the
+ * preferred ordering if the format "x" given to time_put::put() only
+ * uses month, day, and year. If the format "x" for the associated
+ * locale uses other fields, this function returns
+ * timebase::dateorder::noorder.
+ *
+ * NOTE: The library always returns noorder at the moment.
+ *
+ * @return A member of timebase::dateorder.
+ */
+ dateorder
+ date_order() const
+ { return this->do_date_order(); }
+
+ /**
+ * @brief Parse input time string.
+ *
+ * This function parses a time according to the format "x" and puts the
+ * results into a user-supplied struct tm. The result is returned by
+ * calling time_get::do_get_time().
+ *
+ * If there is a valid time string according to format "x", @a tm will
+ * be filled in accordingly and the returned iterator will point to the
+ * first character beyond the time string. If an error occurs before
+ * the end, err |= ios_base::failbit. If parsing reads all the
+ * characters, err |= ios_base::eofbit.
+ *
+ * @param beg Start of string to parse.
+ * @param end End of string to parse.
+ * @param io Source of the locale.
+ * @param err Error flags to set.
+ * @param tm Pointer to struct tm to fill in.
+ * @return Iterator to first char beyond time string.
+ */
+ iter_type
+ get_time(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const
+ { return this->do_get_time(__beg, __end, __io, __err, __tm); }
+
+ /**
+ * @brief Parse input date string.
+ *
+ * This function parses a date according to the format "X" and puts the
+ * results into a user-supplied struct tm. The result is returned by
+ * calling time_get::do_get_date().
+ *
+ * If there is a valid date string according to format "X", @a tm will
+ * be filled in accordingly and the returned iterator will point to the
+ * first character beyond the date string. If an error occurs before
+ * the end, err |= ios_base::failbit. If parsing reads all the
+ * characters, err |= ios_base::eofbit.
+ *
+ * @param beg Start of string to parse.
+ * @param end End of string to parse.
+ * @param io Source of the locale.
+ * @param err Error flags to set.
+ * @param tm Pointer to struct tm to fill in.
+ * @return Iterator to first char beyond date string.
+ */
+ iter_type
+ get_date(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const
+ { return this->do_get_date(__beg, __end, __io, __err, __tm); }
+
+ /**
+ * @brief Parse input weekday string.
+ *
+ * This function parses a weekday name and puts the results into a
+ * user-supplied struct tm. The result is returned by calling
+ * time_get::do_get_weekday().
+ *
+ * Parsing starts by parsing an abbreviated weekday name. If a valid
+ * abbreviation is followed by a character that would lead to the full
+ * weekday name, parsing continues until the full name is found or an
+ * error occurs. Otherwise parsing finishes at the end of the
+ * abbreviated name.
+ *
+ * If an error occurs before the end, err |= ios_base::failbit. If
+ * parsing reads all the characters, err |= ios_base::eofbit.
+ *
+ * @param beg Start of string to parse.
+ * @param end End of string to parse.
+ * @param io Source of the locale.
+ * @param err Error flags to set.
+ * @param tm Pointer to struct tm to fill in.
+ * @return Iterator to first char beyond weekday name.
+ */
+ iter_type
+ get_weekday(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const
+ { return this->do_get_weekday(__beg, __end, __io, __err, __tm); }
+
+ /**
+ * @brief Parse input month string.
+ *
+ * This function parses a month name and puts the results into a
+ * user-supplied struct tm. The result is returned by calling
+ * time_get::do_get_monthname().
+ *
+ * Parsing starts by parsing an abbreviated month name. If a valid
+ * abbreviation is followed by a character that would lead to the full
+ * month name, parsing continues until the full name is found or an
+ * error occurs. Otherwise parsing finishes at the end of the
+ * abbreviated name.
+ *
+ * If an error occurs before the end, err |= ios_base::failbit. If
+ * parsing reads all the characters, err |=
+ * ios_base::eofbit.
+ *
+ * @param beg Start of string to parse.
+ * @param end End of string to parse.
+ * @param io Source of the locale.
+ * @param err Error flags to set.
+ * @param tm Pointer to struct tm to fill in.
+ * @return Iterator to first char beyond month name.
+ */
+ iter_type
+ get_monthname(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const
+ { return this->do_get_monthname(__beg, __end, __io, __err, __tm); }
+
+ /**
+ * @brief Parse input year string.
+ *
+ * This function reads up to 4 characters to parse a year string and
+ * puts the results into a user-supplied struct tm. The result is
+ * returned by calling time_get::do_get_year().
+ *
+ * 4 consecutive digits are interpreted as a full year. If there are
+ * exactly 2 consecutive digits, the library interprets this as the
+ * number of years since 1900.
+ *
+ * If an error occurs before the end, err |= ios_base::failbit. If
+ * parsing reads all the characters, err |= ios_base::eofbit.
+ *
+ * @param beg Start of string to parse.
+ * @param end End of string to parse.
+ * @param io Source of the locale.
+ * @param err Error flags to set.
+ * @param tm Pointer to struct tm to fill in.
+ * @return Iterator to first char beyond year.
+ */
+ iter_type
+ get_year(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const
+ { return this->do_get_year(__beg, __end, __io, __err, __tm); }
+
+ protected:
+ /// Destructor.
+ virtual
+ ~time_get() { }
+
+ /**
+ * @brief Return preferred order of month, day, and year.
+ *
+ * This function returns an enum from timebase::dateorder giving the
+ * preferred ordering if the format "x" given to time_put::put() only
+ * uses month, day, and year. This function is a hook for derived
+ * classes to change the value returned.
+ *
+ * @return A member of timebase::dateorder.
+ */
+ virtual dateorder
+ do_date_order() const;
+
+ /**
+ * @brief Parse input time string.
+ *
+ * This function parses a time according to the format "x" and puts the
+ * results into a user-supplied struct tm. This function is a hook for
+ * derived classes to change the value returned. @see get_time() for
+ * details.
+ *
+ * @param beg Start of string to parse.
+ * @param end End of string to parse.
+ * @param io Source of the locale.
+ * @param err Error flags to set.
+ * @param tm Pointer to struct tm to fill in.
+ * @return Iterator to first char beyond time string.
+ */
+ virtual iter_type
+ do_get_time(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const;
+
+ /**
+ * @brief Parse input date string.
+ *
+ * This function parses a date according to the format "X" and puts the
+ * results into a user-supplied struct tm. This function is a hook for
+ * derived classes to change the value returned. @see get_date() for
+ * details.
+ *
+ * @param beg Start of string to parse.
+ * @param end End of string to parse.
+ * @param io Source of the locale.
+ * @param err Error flags to set.
+ * @param tm Pointer to struct tm to fill in.
+ * @return Iterator to first char beyond date string.
+ */
+ virtual iter_type
+ do_get_date(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const;
+
+ /**
+ * @brief Parse input weekday string.
+ *
+ * This function parses a weekday name and puts the results into a
+ * user-supplied struct tm. This function is a hook for derived
+ * classes to change the value returned. @see get_weekday() for
+ * details.
+ *
+ * @param beg Start of string to parse.
+ * @param end End of string to parse.
+ * @param io Source of the locale.
+ * @param err Error flags to set.
+ * @param tm Pointer to struct tm to fill in.
+ * @return Iterator to first char beyond weekday name.
+ */
+ virtual iter_type
+ do_get_weekday(iter_type __beg, iter_type __end, ios_base&,
+ ios_base::iostate& __err, tm* __tm) const;
+
+ /**
+ * @brief Parse input month string.
+ *
+ * This function parses a month name and puts the results into a
+ * user-supplied struct tm. This function is a hook for derived
+ * classes to change the value returned. @see get_monthname() for
+ * details.
+ *
+ * @param beg Start of string to parse.
+ * @param end End of string to parse.
+ * @param io Source of the locale.
+ * @param err Error flags to set.
+ * @param tm Pointer to struct tm to fill in.
+ * @return Iterator to first char beyond month name.
+ */
+ virtual iter_type
+ do_get_monthname(iter_type __beg, iter_type __end, ios_base&,
+ ios_base::iostate& __err, tm* __tm) const;
+
+ /**
+ * @brief Parse input year string.
+ *
+ * This function reads up to 4 characters to parse a year string and
+ * puts the results into a user-supplied struct tm. This function is a
+ * hook for derived classes to change the value returned. @see
+ * get_year() for details.
+ *
+ * @param beg Start of string to parse.
+ * @param end End of string to parse.
+ * @param io Source of the locale.
+ * @param err Error flags to set.
+ * @param tm Pointer to struct tm to fill in.
+ * @return Iterator to first char beyond year.
+ */
+ virtual iter_type
+ do_get_year(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const;
+
+ // Extract numeric component of length __len.
+ iter_type
+ _M_extract_num(iter_type __beg, iter_type __end, int& __member,
+ int __min, int __max, size_t __len,
+ ios_base& __io, ios_base::iostate& __err) const;
+
+ // Extract day or month name, or any unique array of string
+ // literals in a const _CharT* array.
+ iter_type
+ _M_extract_name(iter_type __beg, iter_type __end, int& __member,
+ const _CharT** __names, size_t __indexlen,
+ ios_base& __io, ios_base::iostate& __err) const;
+
+ // Extract on a component-by-component basis, via __format argument.
+ iter_type
+ _M_extract_via_format(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm,
+ const _CharT* __format) const;
+ };
+
+ template<typename _CharT, typename _InIter>
+ locale::id time_get<_CharT, _InIter>::id;
+
+ /// class time_get_byname [22.2.5.2].
+ template<typename _CharT, typename _InIter>
+ class time_get_byname : public time_get<_CharT, _InIter>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _InIter iter_type;
+
+ explicit
+ time_get_byname(const char*, size_t __refs = 0)
+ : time_get<_CharT, _InIter>(__refs) { }
+
+ protected:
+ virtual
+ ~time_get_byname() { }
+ };
+
+ /**
+ * @brief Facet for outputting dates and times.
+ *
+ * This facet encapsulates the code to format and output dates and times
+ * according to formats used by strftime().
+ *
+ * The time_put template uses protected virtual functions to provide the
+ * actual results. The public accessors forward the call to the virtual
+ * functions. These virtual functions are hooks for developers to
+ * implement the behavior they require from the time_put facet.
+ */
+ template<typename _CharT, typename _OutIter>
+ class time_put : public locale::facet
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef _OutIter iter_type;
+ //@}
+
+ /// Numpunct facet id.
+ static locale::id id;
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ time_put(size_t __refs = 0)
+ : facet(__refs) { }
+
+ /**
+ * @brief Format and output a time or date.
+ *
+ * This function formats the data in struct tm according to the
+ * provided format string. The format string is interpreted as by
+ * strftime().
+ *
+ * @param s The stream to write to.
+ * @param io Source of locale.
+ * @param fill char_type to use for padding.
+ * @param tm Struct tm with date and time info to format.
+ * @param beg Start of format string.
+ * @param end End of format string.
+ * @return Iterator after writing.
+ */
+ iter_type
+ put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm,
+ const _CharT* __beg, const _CharT* __end) const;
+
+ /**
+ * @brief Format and output a time or date.
+ *
+ * This function formats the data in struct tm according to the
+ * provided format char and optional modifier. The format and modifier
+ * are interpreted as by strftime(). It does so by returning
+ * time_put::do_put().
+ *
+ * @param s The stream to write to.
+ * @param io Source of locale.
+ * @param fill char_type to use for padding.
+ * @param tm Struct tm with date and time info to format.
+ * @param format Format char.
+ * @param mod Optional modifier char.
+ * @return Iterator after writing.
+ */
+ iter_type
+ put(iter_type __s, ios_base& __io, char_type __fill,
+ const tm* __tm, char __format, char __mod = 0) const
+ { return this->do_put(__s, __io, __fill, __tm, __format, __mod); }
+
+ protected:
+ /// Destructor.
+ virtual
+ ~time_put()
+ { }
+
+ /**
+ * @brief Format and output a time or date.
+ *
+ * This function formats the data in struct tm according to the
+ * provided format char and optional modifier. This function is a hook
+ * for derived classes to change the value returned. @see put() for
+ * more details.
+ *
+ * @param s The stream to write to.
+ * @param io Source of locale.
+ * @param fill char_type to use for padding.
+ * @param tm Struct tm with date and time info to format.
+ * @param format Format char.
+ * @param mod Optional modifier char.
+ * @return Iterator after writing.
+ */
+ virtual iter_type
+ do_put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm,
+ char __format, char __mod) const;
+ };
+
+ template<typename _CharT, typename _OutIter>
+ locale::id time_put<_CharT, _OutIter>::id;
+
+ /// class time_put_byname [22.2.5.4].
+ template<typename _CharT, typename _OutIter>
+ class time_put_byname : public time_put<_CharT, _OutIter>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _OutIter iter_type;
+
+ explicit
+ time_put_byname(const char*, size_t __refs = 0)
+ : time_put<_CharT, _OutIter>(__refs)
+ { };
+
+ protected:
+ virtual
+ ~time_put_byname() { }
+ };
+
+
+ /**
+ * @brief Money format ordering data.
+ *
+ * This class contains an ordered array of 4 fields to represent the
+ * pattern for formatting a money amount. Each field may contain one entry
+ * from the part enum. symbol, sign, and value must be present and the
+ * remaining field must contain either none or space. @see
+ * moneypunct::pos_format() and moneypunct::neg_format() for details of how
+ * these fields are interpreted.
+ */
+ class money_base
+ {
+ public:
+ enum part { none, space, symbol, sign, value };
+ struct pattern { char field[4]; };
+
+ static const pattern _S_default_pattern;
+
+ enum
+ {
+ _S_minus,
+ _S_zero,
+ _S_end = 11
+ };
+
+ // String literal of acceptable (narrow) input/output, for
+ // money_get/money_put. "-0123456789"
+ static const char* _S_atoms;
+
+ // Construct and return valid pattern consisting of some combination of:
+ // space none symbol sign value
+ static pattern
+ _S_construct_pattern(char __precedes, char __space, char __posn);
+ };
+
+ template<typename _CharT, bool _Intl>
+ struct __moneypunct_cache : public locale::facet
+ {
+ const char* _M_grouping;
+ size_t _M_grouping_size;
+ bool _M_use_grouping;
+ _CharT _M_decimal_point;
+ _CharT _M_thousands_sep;
+ const _CharT* _M_curr_symbol;
+ size_t _M_curr_symbol_size;
+ const _CharT* _M_positive_sign;
+ size_t _M_positive_sign_size;
+ const _CharT* _M_negative_sign;
+ size_t _M_negative_sign_size;
+ int _M_frac_digits;
+ money_base::pattern _M_pos_format;
+ money_base::pattern _M_neg_format;
+
+ // A list of valid numeric literals for input and output: in the standard
+ // "C" locale, this is "-0123456789". This array contains the chars after
+ // having been passed through the current locale's ctype<_CharT>.widen().
+ _CharT _M_atoms[money_base::_S_end];
+
+ bool _M_allocated;
+
+ __moneypunct_cache(size_t __refs = 0) : facet(__refs),
+ _M_grouping(NULL), _M_grouping_size(0), _M_use_grouping(false),
+ _M_decimal_point(_CharT()), _M_thousands_sep(_CharT()),
+ _M_curr_symbol(NULL), _M_curr_symbol_size(0),
+ _M_positive_sign(NULL), _M_positive_sign_size(0),
+ _M_negative_sign(NULL), _M_negative_sign_size(0),
+ _M_frac_digits(0),
+ _M_pos_format(money_base::pattern()),
+ _M_neg_format(money_base::pattern()), _M_allocated(false)
+ { }
+
+ ~__moneypunct_cache();
+
+ void
+ _M_cache(const locale& __loc);
+
+ private:
+ __moneypunct_cache&
+ operator=(const __moneypunct_cache&);
+
+ explicit
+ __moneypunct_cache(const __moneypunct_cache&);
+ };
+
+ template<typename _CharT, bool _Intl>
+ __moneypunct_cache<_CharT, _Intl>::~__moneypunct_cache()
+ {
+ if (_M_allocated)
+ {
+ delete [] _M_grouping;
+ delete [] _M_curr_symbol;
+ delete [] _M_positive_sign;
+ delete [] _M_negative_sign;
+ }
+ }
+
+ /**
+ * @brief Facet for formatting data for money amounts.
+ *
+ * This facet encapsulates the punctuation, grouping and other formatting
+ * features of money amount string representations.
+ */
+ template<typename _CharT, bool _Intl>
+ class moneypunct : public locale::facet, public money_base
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef basic_string<_CharT> string_type;
+ //@}
+ typedef __moneypunct_cache<_CharT, _Intl> __cache_type;
+
+ private:
+ __cache_type* _M_data;
+
+ public:
+ /// This value is provided by the standard, but no reason for its
+ /// existence.
+ static const bool intl = _Intl;
+ /// Numpunct facet id.
+ static locale::id id;
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ moneypunct(size_t __refs = 0) : facet(__refs), _M_data(NULL)
+ { _M_initialize_moneypunct(); }
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is an internal constructor.
+ *
+ * @param cache Cache for optimization.
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ moneypunct(__cache_type* __cache, size_t __refs = 0)
+ : facet(__refs), _M_data(__cache)
+ { _M_initialize_moneypunct(); }
+
+ /**
+ * @brief Internal constructor. Not for general use.
+ *
+ * This is a constructor for use by the library itself to set up new
+ * locales.
+ *
+ * @param cloc The "C" locale.
+ * @param s The name of a locale.
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ moneypunct(__c_locale __cloc, const char* __s, size_t __refs = 0)
+ : facet(__refs), _M_data(NULL)
+ { _M_initialize_moneypunct(__cloc, __s); }
+
+ /**
+ * @brief Return decimal point character.
+ *
+ * This function returns a char_type to use as a decimal point. It
+ * does so by returning returning
+ * moneypunct<char_type>::do_decimal_point().
+ *
+ * @return @a char_type representing a decimal point.
+ */
+ char_type
+ decimal_point() const
+ { return this->do_decimal_point(); }
+
+ /**
+ * @brief Return thousands separator character.
+ *
+ * This function returns a char_type to use as a thousands
+ * separator. It does so by returning returning
+ * moneypunct<char_type>::do_thousands_sep().
+ *
+ * @return char_type representing a thousands separator.
+ */
+ char_type
+ thousands_sep() const
+ { return this->do_thousands_sep(); }
+
+ /**
+ * @brief Return grouping specification.
+ *
+ * This function returns a string representing groupings for the
+ * integer part of an amount. Groupings indicate where thousands
+ * separators should be inserted.
+ *
+ * Each char in the return string is interpret as an integer rather
+ * than a character. These numbers represent the number of digits in a
+ * group. The first char in the string represents the number of digits
+ * in the least significant group. If a char is negative, it indicates
+ * an unlimited number of digits for the group. If more chars from the
+ * string are required to group a number, the last char is used
+ * repeatedly.
+ *
+ * For example, if the grouping() returns "\003\002" and is applied to
+ * the number 123456789, this corresponds to 12,34,56,789. Note that
+ * if the string was "32", this would put more than 50 digits into the
+ * least significant group if the character set is ASCII.
+ *
+ * The string is returned by calling
+ * moneypunct<char_type>::do_grouping().
+ *
+ * @return string representing grouping specification.
+ */
+ string
+ grouping() const
+ { return this->do_grouping(); }
+
+ /**
+ * @brief Return currency symbol string.
+ *
+ * This function returns a string_type to use as a currency symbol. It
+ * does so by returning returning
+ * moneypunct<char_type>::do_curr_symbol().
+ *
+ * @return @a string_type representing a currency symbol.
+ */
+ string_type
+ curr_symbol() const
+ { return this->do_curr_symbol(); }
+
+ /**
+ * @brief Return positive sign string.
+ *
+ * This function returns a string_type to use as a sign for positive
+ * amounts. It does so by returning returning
+ * moneypunct<char_type>::do_positive_sign().
+ *
+ * If the return value contains more than one character, the first
+ * character appears in the position indicated by pos_format() and the
+ * remainder appear at the end of the formatted string.
+ *
+ * @return @a string_type representing a positive sign.
+ */
+ string_type
+ positive_sign() const
+ { return this->do_positive_sign(); }
+
+ /**
+ * @brief Return negative sign string.
+ *
+ * This function returns a string_type to use as a sign for negative
+ * amounts. It does so by returning returning
+ * moneypunct<char_type>::do_negative_sign().
+ *
+ * If the return value contains more than one character, the first
+ * character appears in the position indicated by neg_format() and the
+ * remainder appear at the end of the formatted string.
+ *
+ * @return @a string_type representing a negative sign.
+ */
+ string_type
+ negative_sign() const
+ { return this->do_negative_sign(); }
+
+ /**
+ * @brief Return number of digits in fraction.
+ *
+ * This function returns the exact number of digits that make up the
+ * fractional part of a money amount. It does so by returning
+ * returning moneypunct<char_type>::do_frac_digits().
+ *
+ * The fractional part of a money amount is optional. But if it is
+ * present, there must be frac_digits() digits.
+ *
+ * @return Number of digits in amount fraction.
+ */
+ int
+ frac_digits() const
+ { return this->do_frac_digits(); }
+
+ //@{
+ /**
+ * @brief Return pattern for money values.
+ *
+ * This function returns a pattern describing the formatting of a
+ * positive or negative valued money amount. It does so by returning
+ * returning moneypunct<char_type>::do_pos_format() or
+ * moneypunct<char_type>::do_neg_format().
+ *
+ * The pattern has 4 fields describing the ordering of symbol, sign,
+ * value, and none or space. There must be one of each in the pattern.
+ * The none and space enums may not appear in the first field and space
+ * may not appear in the final field.
+ *
+ * The parts of a money string must appear in the order indicated by
+ * the fields of the pattern. The symbol field indicates that the
+ * value of curr_symbol() may be present. The sign field indicates
+ * that the value of positive_sign() or negative_sign() must be
+ * present. The value field indicates that the absolute value of the
+ * money amount is present. none indicates 0 or more whitespace
+ * characters, except at the end, where it permits no whitespace.
+ * space indicates that 1 or more whitespace characters must be
+ * present.
+ *
+ * For example, for the US locale and pos_format() pattern
+ * {symbol,sign,value,none}, curr_symbol() == '$' positive_sign() ==
+ * '+', and value 10.01, and options set to force the symbol, the
+ * corresponding string is "$+10.01".
+ *
+ * @return Pattern for money values.
+ */
+ pattern
+ pos_format() const
+ { return this->do_pos_format(); }
+
+ pattern
+ neg_format() const
+ { return this->do_neg_format(); }
+ //@}
+
+ protected:
+ /// Destructor.
+ virtual
+ ~moneypunct();
+
+ /**
+ * @brief Return decimal point character.
+ *
+ * Returns a char_type to use as a decimal point. This function is a
+ * hook for derived classes to change the value returned.
+ *
+ * @return @a char_type representing a decimal point.
+ */
+ virtual char_type
+ do_decimal_point() const
+ { return _M_data->_M_decimal_point; }
+
+ /**
+ * @brief Return thousands separator character.
+ *
+ * Returns a char_type to use as a thousands separator. This function
+ * is a hook for derived classes to change the value returned.
+ *
+ * @return @a char_type representing a thousands separator.
+ */
+ virtual char_type
+ do_thousands_sep() const
+ { return _M_data->_M_thousands_sep; }
+
+ /**
+ * @brief Return grouping specification.
+ *
+ * Returns a string representing groupings for the integer part of a
+ * number. This function is a hook for derived classes to change the
+ * value returned. @see grouping() for details.
+ *
+ * @return String representing grouping specification.
+ */
+ virtual string
+ do_grouping() const
+ { return _M_data->_M_grouping; }
+
+ /**
+ * @brief Return currency symbol string.
+ *
+ * This function returns a string_type to use as a currency symbol.
+ * This function is a hook for derived classes to change the value
+ * returned. @see curr_symbol() for details.
+ *
+ * @return @a string_type representing a currency symbol.
+ */
+ virtual string_type
+ do_curr_symbol() const
+ { return _M_data->_M_curr_symbol; }
+
+ /**
+ * @brief Return positive sign string.
+ *
+ * This function returns a string_type to use as a sign for positive
+ * amounts. This function is a hook for derived classes to change the
+ * value returned. @see positive_sign() for details.
+ *
+ * @return @a string_type representing a positive sign.
+ */
+ virtual string_type
+ do_positive_sign() const
+ { return _M_data->_M_positive_sign; }
+
+ /**
+ * @brief Return negative sign string.
+ *
+ * This function returns a string_type to use as a sign for negative
+ * amounts. This function is a hook for derived classes to change the
+ * value returned. @see negative_sign() for details.
+ *
+ * @return @a string_type representing a negative sign.
+ */
+ virtual string_type
+ do_negative_sign() const
+ { return _M_data->_M_negative_sign; }
+
+ /**
+ * @brief Return number of digits in fraction.
+ *
+ * This function returns the exact number of digits that make up the
+ * fractional part of a money amount. This function is a hook for
+ * derived classes to change the value returned. @see frac_digits()
+ * for details.
+ *
+ * @return Number of digits in amount fraction.
+ */
+ virtual int
+ do_frac_digits() const
+ { return _M_data->_M_frac_digits; }
+
+ /**
+ * @brief Return pattern for money values.
+ *
+ * This function returns a pattern describing the formatting of a
+ * positive valued money amount. This function is a hook for derived
+ * classes to change the value returned. @see pos_format() for
+ * details.
+ *
+ * @return Pattern for money values.
+ */
+ virtual pattern
+ do_pos_format() const
+ { return _M_data->_M_pos_format; }
+
+ /**
+ * @brief Return pattern for money values.
+ *
+ * This function returns a pattern describing the formatting of a
+ * negative valued money amount. This function is a hook for derived
+ * classes to change the value returned. @see neg_format() for
+ * details.
+ *
+ * @return Pattern for money values.
+ */
+ virtual pattern
+ do_neg_format() const
+ { return _M_data->_M_neg_format; }
+
+ // For use at construction time only.
+ void
+ _M_initialize_moneypunct(__c_locale __cloc = NULL,
+ const char* __name = NULL);
+ };
+
+ template<typename _CharT, bool _Intl>
+ locale::id moneypunct<_CharT, _Intl>::id;
+
+ template<typename _CharT, bool _Intl>
+ const bool moneypunct<_CharT, _Intl>::intl;
+
+ template<>
+ moneypunct<char, true>::~moneypunct();
+
+ template<>
+ moneypunct<char, false>::~moneypunct();
+
+ template<>
+ void
+ moneypunct<char, true>::_M_initialize_moneypunct(__c_locale, const char*);
+
+ template<>
+ void
+ moneypunct<char, false>::_M_initialize_moneypunct(__c_locale, const char*);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ moneypunct<wchar_t, true>::~moneypunct();
+
+ template<>
+ moneypunct<wchar_t, false>::~moneypunct();
+
+ template<>
+ void
+ moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale,
+ const char*);
+
+ template<>
+ void
+ moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale,
+ const char*);
+#endif
+
+ /// class moneypunct_byname [22.2.6.4].
+ template<typename _CharT, bool _Intl>
+ class moneypunct_byname : public moneypunct<_CharT, _Intl>
+ {
+ public:
+ typedef _CharT char_type;
+ typedef basic_string<_CharT> string_type;
+
+ static const bool intl = _Intl;
+
+ explicit
+ moneypunct_byname(const char* __s, size_t __refs = 0)
+ : moneypunct<_CharT, _Intl>(__refs)
+ {
+ if (__builtin_strcmp(__s, "C") != 0
+ && __builtin_strcmp(__s, "POSIX") != 0)
+ {
+ __c_locale __tmp;
+ this->_S_create_c_locale(__tmp, __s);
+ this->_M_initialize_moneypunct(__tmp);
+ this->_S_destroy_c_locale(__tmp);
+ }
+ }
+
+ protected:
+ virtual
+ ~moneypunct_byname() { }
+ };
+
+ template<typename _CharT, bool _Intl>
+ const bool moneypunct_byname<_CharT, _Intl>::intl;
+
+_GLIBCXX_BEGIN_LDBL_NAMESPACE
+
+ /**
+ * @brief Facet for parsing monetary amounts.
+ *
+ * This facet encapsulates the code to parse and return a monetary
+ * amount from a string.
+ *
+ * The money_get template uses protected virtual functions to
+ * provide the actual results. The public accessors forward the
+ * call to the virtual functions. These virtual functions are
+ * hooks for developers to implement the behavior they require from
+ * the money_get facet.
+ */
+ template<typename _CharT, typename _InIter>
+ class money_get : public locale::facet
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef _InIter iter_type;
+ typedef basic_string<_CharT> string_type;
+ //@}
+
+ /// Numpunct facet id.
+ static locale::id id;
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ money_get(size_t __refs = 0) : facet(__refs) { }
+
+ /**
+ * @brief Read and parse a monetary value.
+ *
+ * This function reads characters from @a s, interprets them as a
+ * monetary value according to moneypunct and ctype facets retrieved
+ * from io.getloc(), and returns the result in @a units as an integral
+ * value moneypunct::frac_digits() * the actual amount. For example,
+ * the string $10.01 in a US locale would store 1001 in @a units.
+ *
+ * Any characters not part of a valid money amount are not consumed.
+ *
+ * If a money value cannot be parsed from the input stream, sets
+ * err=(err|io.failbit). If the stream is consumed before finishing
+ * parsing, sets err=(err|io.failbit|io.eofbit). @a units is
+ * unchanged if parsing fails.
+ *
+ * This function works by returning the result of do_get().
+ *
+ * @param s Start of characters to parse.
+ * @param end End of characters to parse.
+ * @param intl Parameter to use_facet<moneypunct<CharT,intl> >.
+ * @param io Source of facets and io state.
+ * @param err Error field to set if parsing fails.
+ * @param units Place to store result of parsing.
+ * @return Iterator referencing first character beyond valid money
+ * amount.
+ */
+ iter_type
+ get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
+ ios_base::iostate& __err, long double& __units) const
+ { return this->do_get(__s, __end, __intl, __io, __err, __units); }
+
+ /**
+ * @brief Read and parse a monetary value.
+ *
+ * This function reads characters from @a s, interprets them as a
+ * monetary value according to moneypunct and ctype facets retrieved
+ * from io.getloc(), and returns the result in @a digits. For example,
+ * the string $10.01 in a US locale would store "1001" in @a digits.
+ *
+ * Any characters not part of a valid money amount are not consumed.
+ *
+ * If a money value cannot be parsed from the input stream, sets
+ * err=(err|io.failbit). If the stream is consumed before finishing
+ * parsing, sets err=(err|io.failbit|io.eofbit).
+ *
+ * This function works by returning the result of do_get().
+ *
+ * @param s Start of characters to parse.
+ * @param end End of characters to parse.
+ * @param intl Parameter to use_facet<moneypunct<CharT,intl> >.
+ * @param io Source of facets and io state.
+ * @param err Error field to set if parsing fails.
+ * @param digits Place to store result of parsing.
+ * @return Iterator referencing first character beyond valid money
+ * amount.
+ */
+ iter_type
+ get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
+ ios_base::iostate& __err, string_type& __digits) const
+ { return this->do_get(__s, __end, __intl, __io, __err, __digits); }
+
+ protected:
+ /// Destructor.
+ virtual
+ ~money_get() { }
+
+ /**
+ * @brief Read and parse a monetary value.
+ *
+ * This function reads and parses characters representing a monetary
+ * value. This function is a hook for derived classes to change the
+ * value returned. @see get() for details.
+ */
+ // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ virtual iter_type
+ __do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
+ ios_base::iostate& __err, double& __units) const;
+#else
+ virtual iter_type
+ do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
+ ios_base::iostate& __err, long double& __units) const;
+#endif
+
+ /**
+ * @brief Read and parse a monetary value.
+ *
+ * This function reads and parses characters representing a monetary
+ * value. This function is a hook for derived classes to change the
+ * value returned. @see get() for details.
+ */
+ virtual iter_type
+ do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
+ ios_base::iostate& __err, string_type& __digits) const;
+
+ // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ virtual iter_type
+ do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io,
+ ios_base::iostate& __err, long double& __units) const;
+#endif
+
+ template<bool _Intl>
+ iter_type
+ _M_extract(iter_type __s, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, string& __digits) const;
+ };
+
+ template<typename _CharT, typename _InIter>
+ locale::id money_get<_CharT, _InIter>::id;
+
+ /**
+ * @brief Facet for outputting monetary amounts.
+ *
+ * This facet encapsulates the code to format and output a monetary
+ * amount.
+ *
+ * The money_put template uses protected virtual functions to
+ * provide the actual results. The public accessors forward the
+ * call to the virtual functions. These virtual functions are
+ * hooks for developers to implement the behavior they require from
+ * the money_put facet.
+ */
+ template<typename _CharT, typename _OutIter>
+ class money_put : public locale::facet
+ {
+ public:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef _OutIter iter_type;
+ typedef basic_string<_CharT> string_type;
+ //@}
+
+ /// Numpunct facet id.
+ static locale::id id;
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ money_put(size_t __refs = 0) : facet(__refs) { }
+
+ /**
+ * @brief Format and output a monetary value.
+ *
+ * This function formats @a units as a monetary value according to
+ * moneypunct and ctype facets retrieved from io.getloc(), and writes
+ * the resulting characters to @a s. For example, the value 1001 in a
+ * US locale would write "$10.01" to @a s.
+ *
+ * This function works by returning the result of do_put().
+ *
+ * @param s The stream to write to.
+ * @param intl Parameter to use_facet<moneypunct<CharT,intl> >.
+ * @param io Source of facets and io state.
+ * @param fill char_type to use for padding.
+ * @param units Place to store result of parsing.
+ * @return Iterator after writing.
+ */
+ iter_type
+ put(iter_type __s, bool __intl, ios_base& __io,
+ char_type __fill, long double __units) const
+ { return this->do_put(__s, __intl, __io, __fill, __units); }
+
+ /**
+ * @brief Format and output a monetary value.
+ *
+ * This function formats @a digits as a monetary value according to
+ * moneypunct and ctype facets retrieved from io.getloc(), and writes
+ * the resulting characters to @a s. For example, the string "1001" in
+ * a US locale would write "$10.01" to @a s.
+ *
+ * This function works by returning the result of do_put().
+ *
+ * @param s The stream to write to.
+ * @param intl Parameter to use_facet<moneypunct<CharT,intl> >.
+ * @param io Source of facets and io state.
+ * @param fill char_type to use for padding.
+ * @param units Place to store result of parsing.
+ * @return Iterator after writing.
+ */
+ iter_type
+ put(iter_type __s, bool __intl, ios_base& __io,
+ char_type __fill, const string_type& __digits) const
+ { return this->do_put(__s, __intl, __io, __fill, __digits); }
+
+ protected:
+ /// Destructor.
+ virtual
+ ~money_put() { }
+
+ /**
+ * @brief Format and output a monetary value.
+ *
+ * This function formats @a units as a monetary value according to
+ * moneypunct and ctype facets retrieved from io.getloc(), and writes
+ * the resulting characters to @a s. For example, the value 1001 in a
+ * US locale would write "$10.01" to @a s.
+ *
+ * This function is a hook for derived classes to change the value
+ * returned. @see put().
+ *
+ * @param s The stream to write to.
+ * @param intl Parameter to use_facet<moneypunct<CharT,intl> >.
+ * @param io Source of facets and io state.
+ * @param fill char_type to use for padding.
+ * @param units Place to store result of parsing.
+ * @return Iterator after writing.
+ */
+ // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ virtual iter_type
+ __do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
+ double __units) const;
+#else
+ virtual iter_type
+ do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
+ long double __units) const;
+#endif
+
+ /**
+ * @brief Format and output a monetary value.
+ *
+ * This function formats @a digits as a monetary value according to
+ * moneypunct and ctype facets retrieved from io.getloc(), and writes
+ * the resulting characters to @a s. For example, the string "1001" in
+ * a US locale would write "$10.01" to @a s.
+ *
+ * This function is a hook for derived classes to change the value
+ * returned. @see put().
+ *
+ * @param s The stream to write to.
+ * @param intl Parameter to use_facet<moneypunct<CharT,intl> >.
+ * @param io Source of facets and io state.
+ * @param fill char_type to use for padding.
+ * @param units Place to store result of parsing.
+ * @return Iterator after writing.
+ */
+ virtual iter_type
+ do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
+ const string_type& __digits) const;
+
+ // XXX GLIBCXX_ABI Deprecated
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ virtual iter_type
+ do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
+ long double __units) const;
+#endif
+
+ template<bool _Intl>
+ iter_type
+ _M_insert(iter_type __s, ios_base& __io, char_type __fill,
+ const string_type& __digits) const;
+ };
+
+ template<typename _CharT, typename _OutIter>
+ locale::id money_put<_CharT, _OutIter>::id;
+
+_GLIBCXX_END_LDBL_NAMESPACE
+
+ /**
+ * @brief Messages facet base class providing catalog typedef.
+ */
+ struct messages_base
+ {
+ typedef int catalog;
+ };
+
+ /**
+ * @brief Facet for handling message catalogs
+ *
+ * This facet encapsulates the code to retrieve messages from
+ * message catalogs. The only thing defined by the standard for this facet
+ * is the interface. All underlying functionality is
+ * implementation-defined.
+ *
+ * This library currently implements 3 versions of the message facet. The
+ * first version (gnu) is a wrapper around gettext, provided by libintl.
+ * The second version (ieee) is a wrapper around catgets. The final
+ * version (default) does no actual translation. These implementations are
+ * only provided for char and wchar_t instantiations.
+ *
+ * The messages template uses protected virtual functions to
+ * provide the actual results. The public accessors forward the
+ * call to the virtual functions. These virtual functions are
+ * hooks for developers to implement the behavior they require from
+ * the messages facet.
+ */
+ template<typename _CharT>
+ class messages : public locale::facet, public messages_base
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef basic_string<_CharT> string_type;
+ //@}
+
+ protected:
+ // Underlying "C" library locale information saved from
+ // initialization, needed by messages_byname as well.
+ __c_locale _M_c_locale_messages;
+ const char* _M_name_messages;
+
+ public:
+ /// Numpunct facet id.
+ static locale::id id;
+
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param refs Passed to the base facet class.
+ */
+ explicit
+ messages(size_t __refs = 0);
+
+ // Non-standard.
+ /**
+ * @brief Internal constructor. Not for general use.
+ *
+ * This is a constructor for use by the library itself to set up new
+ * locales.
+ *
+ * @param cloc The "C" locale.
+ * @param s The name of a locale.
+ * @param refs Refcount to pass to the base class.
+ */
+ explicit
+ messages(__c_locale __cloc, const char* __s, size_t __refs = 0);
+
+ /*
+ * @brief Open a message catalog.
+ *
+ * This function opens and returns a handle to a message catalog by
+ * returning do_open(s, loc).
+ *
+ * @param s The catalog to open.
+ * @param loc Locale to use for character set conversions.
+ * @return Handle to the catalog or value < 0 if open fails.
+ */
+ catalog
+ open(const basic_string<char>& __s, const locale& __loc) const
+ { return this->do_open(__s, __loc); }
+
+ // Non-standard and unorthodox, yet effective.
+ /*
+ * @brief Open a message catalog.
+ *
+ * This non-standard function opens and returns a handle to a message
+ * catalog by returning do_open(s, loc). The third argument provides a
+ * message catalog root directory for gnu gettext and is ignored
+ * otherwise.
+ *
+ * @param s The catalog to open.
+ * @param loc Locale to use for character set conversions.
+ * @param dir Message catalog root directory.
+ * @return Handle to the catalog or value < 0 if open fails.
+ */
+ catalog
+ open(const basic_string<char>&, const locale&, const char*) const;
+
+ /*
+ * @brief Look up a string in a message catalog.
+ *
+ * This function retrieves and returns a message from a catalog by
+ * returning do_get(c, set, msgid, s).
+ *
+ * For gnu, @a set and @a msgid are ignored. Returns gettext(s).
+ * For default, returns s. For ieee, returns catgets(c,set,msgid,s).
+ *
+ * @param c The catalog to access.
+ * @param set Implementation-defined.
+ * @param msgid Implementation-defined.
+ * @param s Default return value if retrieval fails.
+ * @return Retrieved message or @a s if get fails.
+ */
+ string_type
+ get(catalog __c, int __set, int __msgid, const string_type& __s) const
+ { return this->do_get(__c, __set, __msgid, __s); }
+
+ /*
+ * @brief Close a message catalog.
+ *
+ * Closes catalog @a c by calling do_close(c).
+ *
+ * @param c The catalog to close.
+ */
+ void
+ close(catalog __c) const
+ { return this->do_close(__c); }
+
+ protected:
+ /// Destructor.
+ virtual
+ ~messages();
+
+ /*
+ * @brief Open a message catalog.
+ *
+ * This function opens and returns a handle to a message catalog in an
+ * implementation-defined manner. This function is a hook for derived
+ * classes to change the value returned.
+ *
+ * @param s The catalog to open.
+ * @param loc Locale to use for character set conversions.
+ * @return Handle to the opened catalog, value < 0 if open failed.
+ */
+ virtual catalog
+ do_open(const basic_string<char>&, const locale&) const;
+
+ /*
+ * @brief Look up a string in a message catalog.
+ *
+ * This function retrieves and returns a message from a catalog in an
+ * implementation-defined manner. This function is a hook for derived
+ * classes to change the value returned.
+ *
+ * For gnu, @a set and @a msgid are ignored. Returns gettext(s).
+ * For default, returns s. For ieee, returns catgets(c,set,msgid,s).
+ *
+ * @param c The catalog to access.
+ * @param set Implementation-defined.
+ * @param msgid Implementation-defined.
+ * @param s Default return value if retrieval fails.
+ * @return Retrieved message or @a s if get fails.
+ */
+ virtual string_type
+ do_get(catalog, int, int, const string_type& __dfault) const;
+
+ /*
+ * @brief Close a message catalog.
+ *
+ * @param c The catalog to close.
+ */
+ virtual void
+ do_close(catalog) const;
+
+ // Returns a locale and codeset-converted string, given a char* message.
+ char*
+ _M_convert_to_char(const string_type& __msg) const
+ {
+ // XXX
+ return reinterpret_cast<char*>(const_cast<_CharT*>(__msg.c_str()));
+ }
+
+ // Returns a locale and codeset-converted string, given a char* message.
+ string_type
+ _M_convert_from_char(char*) const
+ {
+#if 0
+ // Length of message string without terminating null.
+ size_t __len = char_traits<char>::length(__msg) - 1;
+
+ // "everybody can easily convert the string using
+ // mbsrtowcs/wcsrtombs or with iconv()"
+
+ // Convert char* to _CharT in locale used to open catalog.
+ // XXX need additional template parameter on messages class for this..
+ // typedef typename codecvt<char, _CharT, _StateT> __codecvt_type;
+ typedef typename codecvt<char, _CharT, mbstate_t> __codecvt_type;
+
+ __codecvt_type::state_type __state;
+ // XXX may need to initialize state.
+ //initialize_state(__state._M_init());
+
+ char* __from_next;
+ // XXX what size for this string?
+ _CharT* __to = static_cast<_CharT*>(__builtin_alloca(__len + 1));
+ const __codecvt_type& __cvt = use_facet<__codecvt_type>(_M_locale_conv);
+ __cvt.out(__state, __msg, __msg + __len, __from_next,
+ __to, __to + __len + 1, __to_next);
+ return string_type(__to);
+#endif
+#if 0
+ typedef ctype<_CharT> __ctype_type;
+ // const __ctype_type& __cvt = use_facet<__ctype_type>(_M_locale_msg);
+ const __ctype_type& __cvt = use_facet<__ctype_type>(locale());
+ // XXX Again, proper length of converted string an issue here.
+ // For now, assume the converted length is not larger.
+ _CharT* __dest = static_cast<_CharT*>(__builtin_alloca(__len + 1));
+ __cvt.widen(__msg, __msg + __len, __dest);
+ return basic_string<_CharT>(__dest);
+#endif
+ return string_type();
+ }
+ };
+
+ template<typename _CharT>
+ locale::id messages<_CharT>::id;
+
+ // Specializations for required instantiations.
+ template<>
+ string
+ messages<char>::do_get(catalog, int, int, const string&) const;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ wstring
+ messages<wchar_t>::do_get(catalog, int, int, const wstring&) const;
+#endif
+
+ /// class messages_byname [22.2.7.2].
+ template<typename _CharT>
+ class messages_byname : public messages<_CharT>
+ {
+ public:
+ typedef _CharT char_type;
+ typedef basic_string<_CharT> string_type;
+
+ explicit
+ messages_byname(const char* __s, size_t __refs = 0);
+
+ protected:
+ virtual
+ ~messages_byname()
+ { }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+// Include host and configuration specific messages functions.
+#include <bits/messages_members.h>
+
+// 22.2.1.5 Template class codecvt
+#include <bits/codecvt.h>
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/locale_facets_nonio.tcc>
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_facets_nonio.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_facets_nonio.tcc
new file mode 100644
index 0000000..06bbfcf
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/locale_facets_nonio.tcc
@@ -0,0 +1,1330 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file locale_facets_nonio.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _LOCALE_FACETS_NONIO_TCC
+#define _LOCALE_FACETS_NONIO_TCC 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, bool _Intl>
+ struct __use_cache<__moneypunct_cache<_CharT, _Intl> >
+ {
+ const __moneypunct_cache<_CharT, _Intl>*
+ operator() (const locale& __loc) const
+ {
+ const size_t __i = moneypunct<_CharT, _Intl>::id._M_id();
+ const locale::facet** __caches = __loc._M_impl->_M_caches;
+ if (!__caches[__i])
+ {
+ __moneypunct_cache<_CharT, _Intl>* __tmp = NULL;
+ __try
+ {
+ __tmp = new __moneypunct_cache<_CharT, _Intl>;
+ __tmp->_M_cache(__loc);
+ }
+ __catch(...)
+ {
+ delete __tmp;
+ __throw_exception_again;
+ }
+ __loc._M_impl->_M_install_cache(__tmp, __i);
+ }
+ return static_cast<
+ const __moneypunct_cache<_CharT, _Intl>*>(__caches[__i]);
+ }
+ };
+
+ template<typename _CharT, bool _Intl>
+ void
+ __moneypunct_cache<_CharT, _Intl>::_M_cache(const locale& __loc)
+ {
+ _M_allocated = true;
+
+ const moneypunct<_CharT, _Intl>& __mp =
+ use_facet<moneypunct<_CharT, _Intl> >(__loc);
+
+ _M_grouping_size = __mp.grouping().size();
+ char* __grouping = new char[_M_grouping_size];
+ __mp.grouping().copy(__grouping, _M_grouping_size);
+ _M_grouping = __grouping;
+ _M_use_grouping = (_M_grouping_size
+ && static_cast<signed char>(_M_grouping[0]) > 0
+ && (_M_grouping[0]
+ != __gnu_cxx::__numeric_traits<char>::__max));
+
+ _M_decimal_point = __mp.decimal_point();
+ _M_thousands_sep = __mp.thousands_sep();
+ _M_frac_digits = __mp.frac_digits();
+
+ _M_curr_symbol_size = __mp.curr_symbol().size();
+ _CharT* __curr_symbol = new _CharT[_M_curr_symbol_size];
+ __mp.curr_symbol().copy(__curr_symbol, _M_curr_symbol_size);
+ _M_curr_symbol = __curr_symbol;
+
+ _M_positive_sign_size = __mp.positive_sign().size();
+ _CharT* __positive_sign = new _CharT[_M_positive_sign_size];
+ __mp.positive_sign().copy(__positive_sign, _M_positive_sign_size);
+ _M_positive_sign = __positive_sign;
+
+ _M_negative_sign_size = __mp.negative_sign().size();
+ _CharT* __negative_sign = new _CharT[_M_negative_sign_size];
+ __mp.negative_sign().copy(__negative_sign, _M_negative_sign_size);
+ _M_negative_sign = __negative_sign;
+
+ _M_pos_format = __mp.pos_format();
+ _M_neg_format = __mp.neg_format();
+
+ const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
+ __ct.widen(money_base::_S_atoms,
+ money_base::_S_atoms + money_base::_S_end, _M_atoms);
+ }
+
+_GLIBCXX_BEGIN_LDBL_NAMESPACE
+
+ template<typename _CharT, typename _InIter>
+ template<bool _Intl>
+ _InIter
+ money_get<_CharT, _InIter>::
+ _M_extract(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, string& __units) const
+ {
+ typedef char_traits<_CharT> __traits_type;
+ typedef typename string_type::size_type size_type;
+ typedef money_base::part part;
+ typedef __moneypunct_cache<_CharT, _Intl> __cache_type;
+
+ const locale& __loc = __io._M_getloc();
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+ __use_cache<__cache_type> __uc;
+ const __cache_type* __lc = __uc(__loc);
+ const char_type* __lit = __lc->_M_atoms;
+
+ // Deduced sign.
+ bool __negative = false;
+ // Sign size.
+ size_type __sign_size = 0;
+ // True if sign is mandatory.
+ const bool __mandatory_sign = (__lc->_M_positive_sign_size
+ && __lc->_M_negative_sign_size);
+ // String of grouping info from thousands_sep plucked from __units.
+ string __grouping_tmp;
+ if (__lc->_M_use_grouping)
+ __grouping_tmp.reserve(32);
+ // Last position before the decimal point.
+ int __last_pos = 0;
+ // Separator positions, then, possibly, fractional digits.
+ int __n = 0;
+ // If input iterator is in a valid state.
+ bool __testvalid = true;
+ // Flag marking when a decimal point is found.
+ bool __testdecfound = false;
+
+ // The tentative returned string is stored here.
+ string __res;
+ __res.reserve(32);
+
+ const char_type* __lit_zero = __lit + money_base::_S_zero;
+ const money_base::pattern __p = __lc->_M_neg_format;
+ for (int __i = 0; __i < 4 && __testvalid; ++__i)
+ {
+ const part __which = static_cast<part>(__p.field[__i]);
+ switch (__which)
+ {
+ case money_base::symbol:
+ // According to 22.2.6.1.2, p2, symbol is required
+ // if (__io.flags() & ios_base::showbase), otherwise
+ // is optional and consumed only if other characters
+ // are needed to complete the format.
+ if (__io.flags() & ios_base::showbase || __sign_size > 1
+ || __i == 0
+ || (__i == 1 && (__mandatory_sign
+ || (static_cast<part>(__p.field[0])
+ == money_base::sign)
+ || (static_cast<part>(__p.field[2])
+ == money_base::space)))
+ || (__i == 2 && ((static_cast<part>(__p.field[3])
+ == money_base::value)
+ || (__mandatory_sign
+ && (static_cast<part>(__p.field[3])
+ == money_base::sign)))))
+ {
+ const size_type __len = __lc->_M_curr_symbol_size;
+ size_type __j = 0;
+ for (; __beg != __end && __j < __len
+ && *__beg == __lc->_M_curr_symbol[__j];
+ ++__beg, ++__j);
+ if (__j != __len
+ && (__j || __io.flags() & ios_base::showbase))
+ __testvalid = false;
+ }
+ break;
+ case money_base::sign:
+ // Sign might not exist, or be more than one character long.
+ if (__lc->_M_positive_sign_size && __beg != __end
+ && *__beg == __lc->_M_positive_sign[0])
+ {
+ __sign_size = __lc->_M_positive_sign_size;
+ ++__beg;
+ }
+ else if (__lc->_M_negative_sign_size && __beg != __end
+ && *__beg == __lc->_M_negative_sign[0])
+ {
+ __negative = true;
+ __sign_size = __lc->_M_negative_sign_size;
+ ++__beg;
+ }
+ else if (__lc->_M_positive_sign_size
+ && !__lc->_M_negative_sign_size)
+ // "... if no sign is detected, the result is given the sign
+ // that corresponds to the source of the empty string"
+ __negative = true;
+ else if (__mandatory_sign)
+ __testvalid = false;
+ break;
+ case money_base::value:
+ // Extract digits, remove and stash away the
+ // grouping of found thousands separators.
+ for (; __beg != __end; ++__beg)
+ {
+ const char_type __c = *__beg;
+ const char_type* __q = __traits_type::find(__lit_zero,
+ 10, __c);
+ if (__q != 0)
+ {
+ __res += money_base::_S_atoms[__q - __lit];
+ ++__n;
+ }
+ else if (__c == __lc->_M_decimal_point
+ && !__testdecfound)
+ {
+ if (__lc->_M_frac_digits <= 0)
+ break;
+
+ __last_pos = __n;
+ __n = 0;
+ __testdecfound = true;
+ }
+ else if (__lc->_M_use_grouping
+ && __c == __lc->_M_thousands_sep
+ && !__testdecfound)
+ {
+ if (__n)
+ {
+ // Mark position for later analysis.
+ __grouping_tmp += static_cast<char>(__n);
+ __n = 0;
+ }
+ else
+ {
+ __testvalid = false;
+ break;
+ }
+ }
+ else
+ break;
+ }
+ if (__res.empty())
+ __testvalid = false;
+ break;
+ case money_base::space:
+ // At least one space is required.
+ if (__beg != __end && __ctype.is(ctype_base::space, *__beg))
+ ++__beg;
+ else
+ __testvalid = false;
+ case money_base::none:
+ // Only if not at the end of the pattern.
+ if (__i != 3)
+ for (; __beg != __end
+ && __ctype.is(ctype_base::space, *__beg); ++__beg);
+ break;
+ }
+ }
+
+ // Need to get the rest of the sign characters, if they exist.
+ if (__sign_size > 1 && __testvalid)
+ {
+ const char_type* __sign = __negative ? __lc->_M_negative_sign
+ : __lc->_M_positive_sign;
+ size_type __i = 1;
+ for (; __beg != __end && __i < __sign_size
+ && *__beg == __sign[__i]; ++__beg, ++__i);
+
+ if (__i != __sign_size)
+ __testvalid = false;
+ }
+
+ if (__testvalid)
+ {
+ // Strip leading zeros.
+ if (__res.size() > 1)
+ {
+ const size_type __first = __res.find_first_not_of('0');
+ const bool __only_zeros = __first == string::npos;
+ if (__first)
+ __res.erase(0, __only_zeros ? __res.size() - 1 : __first);
+ }
+
+ // 22.2.6.1.2, p4
+ if (__negative && __res[0] != '0')
+ __res.insert(__res.begin(), '-');
+
+ // Test for grouping fidelity.
+ if (__grouping_tmp.size())
+ {
+ // Add the ending grouping.
+ __grouping_tmp += static_cast<char>(__testdecfound ? __last_pos
+ : __n);
+ if (!std::__verify_grouping(__lc->_M_grouping,
+ __lc->_M_grouping_size,
+ __grouping_tmp))
+ __err |= ios_base::failbit;
+ }
+
+ // Iff not enough digits were supplied after the decimal-point.
+ if (__testdecfound && __n != __lc->_M_frac_digits)
+ __testvalid = false;
+ }
+
+ // Iff valid sequence is not recognized.
+ if (!__testvalid)
+ __err |= ios_base::failbit;
+ else
+ __units.swap(__res);
+
+ // Iff no more characters are available.
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ template<typename _CharT, typename _InIter>
+ _InIter
+ money_get<_CharT, _InIter>::
+ __do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io,
+ ios_base::iostate& __err, double& __units) const
+ {
+ string __str;
+ __beg = __intl ? _M_extract<true>(__beg, __end, __io, __err, __str)
+ : _M_extract<false>(__beg, __end, __io, __err, __str);
+ std::__convert_to_v(__str.c_str(), __units, __err, _S_get_c_locale());
+ return __beg;
+ }
+#endif
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ money_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io,
+ ios_base::iostate& __err, long double& __units) const
+ {
+ string __str;
+ __beg = __intl ? _M_extract<true>(__beg, __end, __io, __err, __str)
+ : _M_extract<false>(__beg, __end, __io, __err, __str);
+ std::__convert_to_v(__str.c_str(), __units, __err, _S_get_c_locale());
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ money_get<_CharT, _InIter>::
+ do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io,
+ ios_base::iostate& __err, string_type& __digits) const
+ {
+ typedef typename string::size_type size_type;
+
+ const locale& __loc = __io._M_getloc();
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+ string __str;
+ __beg = __intl ? _M_extract<true>(__beg, __end, __io, __err, __str)
+ : _M_extract<false>(__beg, __end, __io, __err, __str);
+ const size_type __len = __str.size();
+ if (__len)
+ {
+ __digits.resize(__len);
+ __ctype.widen(__str.data(), __str.data() + __len, &__digits[0]);
+ }
+ return __beg;
+ }
+
+ template<typename _CharT, typename _OutIter>
+ template<bool _Intl>
+ _OutIter
+ money_put<_CharT, _OutIter>::
+ _M_insert(iter_type __s, ios_base& __io, char_type __fill,
+ const string_type& __digits) const
+ {
+ typedef typename string_type::size_type size_type;
+ typedef money_base::part part;
+ typedef __moneypunct_cache<_CharT, _Intl> __cache_type;
+
+ const locale& __loc = __io._M_getloc();
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+ __use_cache<__cache_type> __uc;
+ const __cache_type* __lc = __uc(__loc);
+ const char_type* __lit = __lc->_M_atoms;
+
+ // Determine if negative or positive formats are to be used, and
+ // discard leading negative_sign if it is present.
+ const char_type* __beg = __digits.data();
+
+ money_base::pattern __p;
+ const char_type* __sign;
+ size_type __sign_size;
+ if (!(*__beg == __lit[money_base::_S_minus]))
+ {
+ __p = __lc->_M_pos_format;
+ __sign = __lc->_M_positive_sign;
+ __sign_size = __lc->_M_positive_sign_size;
+ }
+ else
+ {
+ __p = __lc->_M_neg_format;
+ __sign = __lc->_M_negative_sign;
+ __sign_size = __lc->_M_negative_sign_size;
+ if (__digits.size())
+ ++__beg;
+ }
+
+ // Look for valid numbers in the ctype facet within input digits.
+ size_type __len = __ctype.scan_not(ctype_base::digit, __beg,
+ __beg + __digits.size()) - __beg;
+ if (__len)
+ {
+ // Assume valid input, and attempt to format.
+ // Break down input numbers into base components, as follows:
+ // final_value = grouped units + (decimal point) + (digits)
+ string_type __value;
+ __value.reserve(2 * __len);
+
+ // Add thousands separators to non-decimal digits, per
+ // grouping rules.
+ long __paddec = __len - __lc->_M_frac_digits;
+ if (__paddec > 0)
+ {
+ if (__lc->_M_frac_digits < 0)
+ __paddec = __len;
+ if (__lc->_M_grouping_size)
+ {
+ __value.assign(2 * __paddec, char_type());
+ _CharT* __vend =
+ std::__add_grouping(&__value[0], __lc->_M_thousands_sep,
+ __lc->_M_grouping,
+ __lc->_M_grouping_size,
+ __beg, __beg + __paddec);
+ __value.erase(__vend - &__value[0]);
+ }
+ else
+ __value.assign(__beg, __paddec);
+ }
+
+ // Deal with decimal point, decimal digits.
+ if (__lc->_M_frac_digits > 0)
+ {
+ __value += __lc->_M_decimal_point;
+ if (__paddec >= 0)
+ __value.append(__beg + __paddec, __lc->_M_frac_digits);
+ else
+ {
+ // Have to pad zeros in the decimal position.
+ __value.append(-__paddec, __lit[money_base::_S_zero]);
+ __value.append(__beg, __len);
+ }
+ }
+
+ // Calculate length of resulting string.
+ const ios_base::fmtflags __f = __io.flags()
+ & ios_base::adjustfield;
+ __len = __value.size() + __sign_size;
+ __len += ((__io.flags() & ios_base::showbase)
+ ? __lc->_M_curr_symbol_size : 0);
+
+ string_type __res;
+ __res.reserve(2 * __len);
+
+ const size_type __width = static_cast<size_type>(__io.width());
+ const bool __testipad = (__f == ios_base::internal
+ && __len < __width);
+ // Fit formatted digits into the required pattern.
+ for (int __i = 0; __i < 4; ++__i)
+ {
+ const part __which = static_cast<part>(__p.field[__i]);
+ switch (__which)
+ {
+ case money_base::symbol:
+ if (__io.flags() & ios_base::showbase)
+ __res.append(__lc->_M_curr_symbol,
+ __lc->_M_curr_symbol_size);
+ break;
+ case money_base::sign:
+ // Sign might not exist, or be more than one
+ // character long. In that case, add in the rest
+ // below.
+ if (__sign_size)
+ __res += __sign[0];
+ break;
+ case money_base::value:
+ __res += __value;
+ break;
+ case money_base::space:
+ // At least one space is required, but if internal
+ // formatting is required, an arbitrary number of
+ // fill spaces will be necessary.
+ if (__testipad)
+ __res.append(__width - __len, __fill);
+ else
+ __res += __fill;
+ break;
+ case money_base::none:
+ if (__testipad)
+ __res.append(__width - __len, __fill);
+ break;
+ }
+ }
+
+ // Special case of multi-part sign parts.
+ if (__sign_size > 1)
+ __res.append(__sign + 1, __sign_size - 1);
+
+ // Pad, if still necessary.
+ __len = __res.size();
+ if (__width > __len)
+ {
+ if (__f == ios_base::left)
+ // After.
+ __res.append(__width - __len, __fill);
+ else
+ // Before.
+ __res.insert(0, __width - __len, __fill);
+ __len = __width;
+ }
+
+ // Write resulting, fully-formatted string to output iterator.
+ __s = std::__write(__s, __res.data(), __len);
+ }
+ __io.width(0);
+ return __s;
+ }
+
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ money_put<_CharT, _OutIter>::
+ __do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
+ double __units) const
+ { return this->do_put(__s, __intl, __io, __fill, (long double) __units); }
+#endif
+
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ money_put<_CharT, _OutIter>::
+ do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
+ long double __units) const
+ {
+ const locale __loc = __io.getloc();
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+#ifdef _GLIBCXX_USE_C99
+ // First try a buffer perhaps big enough.
+ int __cs_size = 64;
+ char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 328. Bad sprintf format modifier in money_put<>::do_put()
+ int __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+ "%.*Lf", 0, __units);
+ // If the buffer was not large enough, try again with the correct size.
+ if (__len >= __cs_size)
+ {
+ __cs_size = __len + 1;
+ __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+ __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+ "%.*Lf", 0, __units);
+ }
+#else
+ // max_exponent10 + 1 for the integer part, + 2 for sign and '\0'.
+ const int __cs_size =
+ __gnu_cxx::__numeric_traits<long double>::__max_exponent10 + 3;
+ char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+ int __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, "%.*Lf",
+ 0, __units);
+#endif
+ string_type __digits(__len, char_type());
+ __ctype.widen(__cs, __cs + __len, &__digits[0]);
+ return __intl ? _M_insert<true>(__s, __io, __fill, __digits)
+ : _M_insert<false>(__s, __io, __fill, __digits);
+ }
+
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ money_put<_CharT, _OutIter>::
+ do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
+ const string_type& __digits) const
+ { return __intl ? _M_insert<true>(__s, __io, __fill, __digits)
+ : _M_insert<false>(__s, __io, __fill, __digits); }
+
+_GLIBCXX_END_LDBL_NAMESPACE
+
+ // NB: Not especially useful. Without an ios_base object or some
+ // kind of locale reference, we are left clawing at the air where
+ // the side of the mountain used to be...
+ template<typename _CharT, typename _InIter>
+ time_base::dateorder
+ time_get<_CharT, _InIter>::do_date_order() const
+ { return time_base::no_order; }
+
+ // Expand a strftime format string and parse it. E.g., do_get_date() may
+ // pass %m/%d/%Y => extracted characters.
+ template<typename _CharT, typename _InIter>
+ _InIter
+ time_get<_CharT, _InIter>::
+ _M_extract_via_format(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm,
+ const _CharT* __format) const
+ {
+ const locale& __loc = __io._M_getloc();
+ const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+ const size_t __len = char_traits<_CharT>::length(__format);
+
+ ios_base::iostate __tmperr = ios_base::goodbit;
+ for (size_t __i = 0; __beg != __end && __i < __len && !__tmperr; ++__i)
+ {
+ if (__ctype.narrow(__format[__i], 0) == '%')
+ {
+ // Verify valid formatting code, attempt to extract.
+ char __c = __ctype.narrow(__format[++__i], 0);
+ int __mem = 0;
+ if (__c == 'E' || __c == 'O')
+ __c = __ctype.narrow(__format[++__i], 0);
+ switch (__c)
+ {
+ const char* __cs;
+ _CharT __wcs[10];
+ case 'a':
+ // Abbreviated weekday name [tm_wday]
+ const char_type* __days1[7];
+ __tp._M_days_abbreviated(__days1);
+ __beg = _M_extract_name(__beg, __end, __tm->tm_wday, __days1,
+ 7, __io, __tmperr);
+ break;
+ case 'A':
+ // Weekday name [tm_wday].
+ const char_type* __days2[7];
+ __tp._M_days(__days2);
+ __beg = _M_extract_name(__beg, __end, __tm->tm_wday, __days2,
+ 7, __io, __tmperr);
+ break;
+ case 'h':
+ case 'b':
+ // Abbreviated month name [tm_mon]
+ const char_type* __months1[12];
+ __tp._M_months_abbreviated(__months1);
+ __beg = _M_extract_name(__beg, __end, __tm->tm_mon,
+ __months1, 12, __io, __tmperr);
+ break;
+ case 'B':
+ // Month name [tm_mon].
+ const char_type* __months2[12];
+ __tp._M_months(__months2);
+ __beg = _M_extract_name(__beg, __end, __tm->tm_mon,
+ __months2, 12, __io, __tmperr);
+ break;
+ case 'c':
+ // Default time and date representation.
+ const char_type* __dt[2];
+ __tp._M_date_time_formats(__dt);
+ __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
+ __tm, __dt[0]);
+ break;
+ case 'd':
+ // Day [01, 31]. [tm_mday]
+ __beg = _M_extract_num(__beg, __end, __tm->tm_mday, 1, 31, 2,
+ __io, __tmperr);
+ break;
+ case 'e':
+ // Day [1, 31], with single digits preceded by
+ // space. [tm_mday]
+ if (__ctype.is(ctype_base::space, *__beg))
+ __beg = _M_extract_num(++__beg, __end, __tm->tm_mday, 1, 9,
+ 1, __io, __tmperr);
+ else
+ __beg = _M_extract_num(__beg, __end, __tm->tm_mday, 10, 31,
+ 2, __io, __tmperr);
+ break;
+ case 'D':
+ // Equivalent to %m/%d/%y.[tm_mon, tm_mday, tm_year]
+ __cs = "%m/%d/%y";
+ __ctype.widen(__cs, __cs + 9, __wcs);
+ __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
+ __tm, __wcs);
+ break;
+ case 'H':
+ // Hour [00, 23]. [tm_hour]
+ __beg = _M_extract_num(__beg, __end, __tm->tm_hour, 0, 23, 2,
+ __io, __tmperr);
+ break;
+ case 'I':
+ // Hour [01, 12]. [tm_hour]
+ __beg = _M_extract_num(__beg, __end, __tm->tm_hour, 1, 12, 2,
+ __io, __tmperr);
+ break;
+ case 'm':
+ // Month [01, 12]. [tm_mon]
+ __beg = _M_extract_num(__beg, __end, __mem, 1, 12, 2,
+ __io, __tmperr);
+ if (!__tmperr)
+ __tm->tm_mon = __mem - 1;
+ break;
+ case 'M':
+ // Minute [00, 59]. [tm_min]
+ __beg = _M_extract_num(__beg, __end, __tm->tm_min, 0, 59, 2,
+ __io, __tmperr);
+ break;
+ case 'n':
+ if (__ctype.narrow(*__beg, 0) == '\n')
+ ++__beg;
+ else
+ __tmperr |= ios_base::failbit;
+ break;
+ case 'R':
+ // Equivalent to (%H:%M).
+ __cs = "%H:%M";
+ __ctype.widen(__cs, __cs + 6, __wcs);
+ __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
+ __tm, __wcs);
+ break;
+ case 'S':
+ // Seconds. [tm_sec]
+ // [00, 60] in C99 (one leap-second), [00, 61] in C89.
+#ifdef _GLIBCXX_USE_C99
+ __beg = _M_extract_num(__beg, __end, __tm->tm_sec, 0, 60, 2,
+#else
+ __beg = _M_extract_num(__beg, __end, __tm->tm_sec, 0, 61, 2,
+#endif
+ __io, __tmperr);
+ break;
+ case 't':
+ if (__ctype.narrow(*__beg, 0) == '\t')
+ ++__beg;
+ else
+ __tmperr |= ios_base::failbit;
+ break;
+ case 'T':
+ // Equivalent to (%H:%M:%S).
+ __cs = "%H:%M:%S";
+ __ctype.widen(__cs, __cs + 9, __wcs);
+ __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
+ __tm, __wcs);
+ break;
+ case 'x':
+ // Locale's date.
+ const char_type* __dates[2];
+ __tp._M_date_formats(__dates);
+ __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
+ __tm, __dates[0]);
+ break;
+ case 'X':
+ // Locale's time.
+ const char_type* __times[2];
+ __tp._M_time_formats(__times);
+ __beg = _M_extract_via_format(__beg, __end, __io, __tmperr,
+ __tm, __times[0]);
+ break;
+ case 'y':
+ case 'C': // C99
+ // Two digit year. [tm_year]
+ __beg = _M_extract_num(__beg, __end, __tm->tm_year, 0, 99, 2,
+ __io, __tmperr);
+ break;
+ case 'Y':
+ // Year [1900). [tm_year]
+ __beg = _M_extract_num(__beg, __end, __mem, 0, 9999, 4,
+ __io, __tmperr);
+ if (!__tmperr)
+ __tm->tm_year = __mem - 1900;
+ break;
+ case 'Z':
+ // Timezone info.
+ if (__ctype.is(ctype_base::upper, *__beg))
+ {
+ int __tmp;
+ __beg = _M_extract_name(__beg, __end, __tmp,
+ __timepunct_cache<_CharT>::_S_timezones,
+ 14, __io, __tmperr);
+
+ // GMT requires special effort.
+ if (__beg != __end && !__tmperr && __tmp == 0
+ && (*__beg == __ctype.widen('-')
+ || *__beg == __ctype.widen('+')))
+ {
+ __beg = _M_extract_num(__beg, __end, __tmp, 0, 23, 2,
+ __io, __tmperr);
+ __beg = _M_extract_num(__beg, __end, __tmp, 0, 59, 2,
+ __io, __tmperr);
+ }
+ }
+ else
+ __tmperr |= ios_base::failbit;
+ break;
+ default:
+ // Not recognized.
+ __tmperr |= ios_base::failbit;
+ }
+ }
+ else
+ {
+ // Verify format and input match, extract and discard.
+ if (__format[__i] == *__beg)
+ ++__beg;
+ else
+ __tmperr |= ios_base::failbit;
+ }
+ }
+
+ if (__tmperr)
+ __err |= ios_base::failbit;
+
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ time_get<_CharT, _InIter>::
+ _M_extract_num(iter_type __beg, iter_type __end, int& __member,
+ int __min, int __max, size_t __len,
+ ios_base& __io, ios_base::iostate& __err) const
+ {
+ const locale& __loc = __io._M_getloc();
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+ // As-is works for __len = 1, 2, 4, the values actually used.
+ int __mult = __len == 2 ? 10 : (__len == 4 ? 1000 : 1);
+
+ ++__min;
+ size_t __i = 0;
+ int __value = 0;
+ for (; __beg != __end && __i < __len; ++__beg, ++__i)
+ {
+ const char __c = __ctype.narrow(*__beg, '*');
+ if (__c >= '0' && __c <= '9')
+ {
+ __value = __value * 10 + (__c - '0');
+ const int __valuec = __value * __mult;
+ if (__valuec > __max || __valuec + __mult < __min)
+ break;
+ __mult /= 10;
+ }
+ else
+ break;
+ }
+ if (__i == __len)
+ __member = __value;
+ else
+ __err |= ios_base::failbit;
+
+ return __beg;
+ }
+
+ // Assumptions:
+ // All elements in __names are unique.
+ template<typename _CharT, typename _InIter>
+ _InIter
+ time_get<_CharT, _InIter>::
+ _M_extract_name(iter_type __beg, iter_type __end, int& __member,
+ const _CharT** __names, size_t __indexlen,
+ ios_base& __io, ios_base::iostate& __err) const
+ {
+ typedef char_traits<_CharT> __traits_type;
+ const locale& __loc = __io._M_getloc();
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+ int* __matches = static_cast<int*>(__builtin_alloca(sizeof(int)
+ * __indexlen));
+ size_t __nmatches = 0;
+ size_t __pos = 0;
+ bool __testvalid = true;
+ const char_type* __name;
+
+ // Look for initial matches.
+ // NB: Some of the locale data is in the form of all lowercase
+ // names, and some is in the form of initially-capitalized
+ // names. Look for both.
+ if (__beg != __end)
+ {
+ const char_type __c = *__beg;
+ for (size_t __i1 = 0; __i1 < __indexlen; ++__i1)
+ if (__c == __names[__i1][0]
+ || __c == __ctype.toupper(__names[__i1][0]))
+ __matches[__nmatches++] = __i1;
+ }
+
+ while (__nmatches > 1)
+ {
+ // Find smallest matching string.
+ size_t __minlen = __traits_type::length(__names[__matches[0]]);
+ for (size_t __i2 = 1; __i2 < __nmatches; ++__i2)
+ __minlen = std::min(__minlen,
+ __traits_type::length(__names[__matches[__i2]]));
+ ++__beg, ++__pos;
+ if (__pos < __minlen && __beg != __end)
+ for (size_t __i3 = 0; __i3 < __nmatches;)
+ {
+ __name = __names[__matches[__i3]];
+ if (!(__name[__pos] == *__beg))
+ __matches[__i3] = __matches[--__nmatches];
+ else
+ ++__i3;
+ }
+ else
+ break;
+ }
+
+ if (__nmatches == 1)
+ {
+ // Make sure found name is completely extracted.
+ ++__beg, ++__pos;
+ __name = __names[__matches[0]];
+ const size_t __len = __traits_type::length(__name);
+ while (__pos < __len && __beg != __end && __name[__pos] == *__beg)
+ ++__beg, ++__pos;
+
+ if (__len == __pos)
+ __member = __matches[0];
+ else
+ __testvalid = false;
+ }
+ else
+ __testvalid = false;
+ if (!__testvalid)
+ __err |= ios_base::failbit;
+
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ time_get<_CharT, _InIter>::
+ do_get_time(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const
+ {
+ const locale& __loc = __io._M_getloc();
+ const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
+ const char_type* __times[2];
+ __tp._M_time_formats(__times);
+ __beg = _M_extract_via_format(__beg, __end, __io, __err,
+ __tm, __times[0]);
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ time_get<_CharT, _InIter>::
+ do_get_date(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const
+ {
+ const locale& __loc = __io._M_getloc();
+ const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
+ const char_type* __dates[2];
+ __tp._M_date_formats(__dates);
+ __beg = _M_extract_via_format(__beg, __end, __io, __err,
+ __tm, __dates[0]);
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ time_get<_CharT, _InIter>::
+ do_get_weekday(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const
+ {
+ typedef char_traits<_CharT> __traits_type;
+ const locale& __loc = __io._M_getloc();
+ const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+ const char_type* __days[7];
+ __tp._M_days_abbreviated(__days);
+ int __tmpwday;
+ ios_base::iostate __tmperr = ios_base::goodbit;
+ __beg = _M_extract_name(__beg, __end, __tmpwday, __days, 7,
+ __io, __tmperr);
+
+ // Check to see if non-abbreviated name exists, and extract.
+ // NB: Assumes both _M_days and _M_days_abbreviated organized in
+ // exact same order, first to last, such that the resulting
+ // __days array with the same index points to a day, and that
+ // day's abbreviated form.
+ // NB: Also assumes that an abbreviated name is a subset of the name.
+ if (!__tmperr && __beg != __end)
+ {
+ size_t __pos = __traits_type::length(__days[__tmpwday]);
+ __tp._M_days(__days);
+ const char_type* __name = __days[__tmpwday];
+ if (__name[__pos] == *__beg)
+ {
+ // Extract the rest of it.
+ const size_t __len = __traits_type::length(__name);
+ while (__pos < __len && __beg != __end
+ && __name[__pos] == *__beg)
+ ++__beg, ++__pos;
+ if (__len != __pos)
+ __tmperr |= ios_base::failbit;
+ }
+ }
+ if (!__tmperr)
+ __tm->tm_wday = __tmpwday;
+ else
+ __err |= ios_base::failbit;
+
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ time_get<_CharT, _InIter>::
+ do_get_monthname(iter_type __beg, iter_type __end,
+ ios_base& __io, ios_base::iostate& __err, tm* __tm) const
+ {
+ typedef char_traits<_CharT> __traits_type;
+ const locale& __loc = __io._M_getloc();
+ const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+ const char_type* __months[12];
+ __tp._M_months_abbreviated(__months);
+ int __tmpmon;
+ ios_base::iostate __tmperr = ios_base::goodbit;
+ __beg = _M_extract_name(__beg, __end, __tmpmon, __months, 12,
+ __io, __tmperr);
+
+ // Check to see if non-abbreviated name exists, and extract.
+ // NB: Assumes both _M_months and _M_months_abbreviated organized in
+ // exact same order, first to last, such that the resulting
+ // __months array with the same index points to a month, and that
+ // month's abbreviated form.
+ // NB: Also assumes that an abbreviated name is a subset of the name.
+ if (!__tmperr && __beg != __end)
+ {
+ size_t __pos = __traits_type::length(__months[__tmpmon]);
+ __tp._M_months(__months);
+ const char_type* __name = __months[__tmpmon];
+ if (__name[__pos] == *__beg)
+ {
+ // Extract the rest of it.
+ const size_t __len = __traits_type::length(__name);
+ while (__pos < __len && __beg != __end
+ && __name[__pos] == *__beg)
+ ++__beg, ++__pos;
+ if (__len != __pos)
+ __tmperr |= ios_base::failbit;
+ }
+ }
+ if (!__tmperr)
+ __tm->tm_mon = __tmpmon;
+ else
+ __err |= ios_base::failbit;
+
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+
+ template<typename _CharT, typename _InIter>
+ _InIter
+ time_get<_CharT, _InIter>::
+ do_get_year(iter_type __beg, iter_type __end, ios_base& __io,
+ ios_base::iostate& __err, tm* __tm) const
+ {
+ const locale& __loc = __io._M_getloc();
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+ size_t __i = 0;
+ int __value = 0;
+ for (; __beg != __end && __i < 4; ++__beg, ++__i)
+ {
+ const char __c = __ctype.narrow(*__beg, '*');
+ if (__c >= '0' && __c <= '9')
+ __value = __value * 10 + (__c - '0');
+ else
+ break;
+ }
+ if (__i == 2 || __i == 4)
+ __tm->tm_year = __i == 2 ? __value : __value - 1900;
+ else
+ __err |= ios_base::failbit;
+
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
+
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ time_put<_CharT, _OutIter>::
+ put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm,
+ const _CharT* __beg, const _CharT* __end) const
+ {
+ const locale& __loc = __io._M_getloc();
+ ctype<_CharT> const& __ctype = use_facet<ctype<_CharT> >(__loc);
+ for (; __beg != __end; ++__beg)
+ if (__ctype.narrow(*__beg, 0) != '%')
+ {
+ *__s = *__beg;
+ ++__s;
+ }
+ else if (++__beg != __end)
+ {
+ char __format;
+ char __mod = 0;
+ const char __c = __ctype.narrow(*__beg, 0);
+ if (__c != 'E' && __c != 'O')
+ __format = __c;
+ else if (++__beg != __end)
+ {
+ __mod = __c;
+ __format = __ctype.narrow(*__beg, 0);
+ }
+ else
+ break;
+ __s = this->do_put(__s, __io, __fill, __tm, __format, __mod);
+ }
+ else
+ break;
+ return __s;
+ }
+
+ template<typename _CharT, typename _OutIter>
+ _OutIter
+ time_put<_CharT, _OutIter>::
+ do_put(iter_type __s, ios_base& __io, char_type, const tm* __tm,
+ char __format, char __mod) const
+ {
+ const locale& __loc = __io._M_getloc();
+ ctype<_CharT> const& __ctype = use_facet<ctype<_CharT> >(__loc);
+ __timepunct<_CharT> const& __tp = use_facet<__timepunct<_CharT> >(__loc);
+
+ // NB: This size is arbitrary. Should this be a data member,
+ // initialized at construction?
+ const size_t __maxlen = 128;
+ char_type* __res =
+ static_cast<char_type*>(__builtin_alloca(sizeof(char_type) * __maxlen));
+
+ // NB: In IEE 1003.1-200x, and perhaps other locale models, it
+ // is possible that the format character will be longer than one
+ // character. Possibilities include 'E' or 'O' followed by a
+ // format character: if __mod is not the default argument, assume
+ // it's a valid modifier.
+ char_type __fmt[4];
+ __fmt[0] = __ctype.widen('%');
+ if (!__mod)
+ {
+ __fmt[1] = __format;
+ __fmt[2] = char_type();
+ }
+ else
+ {
+ __fmt[1] = __mod;
+ __fmt[2] = __format;
+ __fmt[3] = char_type();
+ }
+
+ __tp._M_put(__res, __maxlen, __fmt, __tm);
+
+ // Write resulting, fully-formatted string to output iterator.
+ return std::__write(__s, __res, char_traits<char_type>::length(__res));
+ }
+
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class moneypunct<char, false>;
+ extern template class moneypunct<char, true>;
+ extern template class moneypunct_byname<char, false>;
+ extern template class moneypunct_byname<char, true>;
+ extern template class _GLIBCXX_LDBL_NAMESPACE money_get<char>;
+ extern template class _GLIBCXX_LDBL_NAMESPACE money_put<char>;
+ extern template class __timepunct<char>;
+ extern template class time_put<char>;
+ extern template class time_put_byname<char>;
+ extern template class time_get<char>;
+ extern template class time_get_byname<char>;
+ extern template class messages<char>;
+ extern template class messages_byname<char>;
+
+ extern template
+ const moneypunct<char, true>&
+ use_facet<moneypunct<char, true> >(const locale&);
+
+ extern template
+ const moneypunct<char, false>&
+ use_facet<moneypunct<char, false> >(const locale&);
+
+ extern template
+ const money_put<char>&
+ use_facet<money_put<char> >(const locale&);
+
+ extern template
+ const money_get<char>&
+ use_facet<money_get<char> >(const locale&);
+
+ extern template
+ const __timepunct<char>&
+ use_facet<__timepunct<char> >(const locale&);
+
+ extern template
+ const time_put<char>&
+ use_facet<time_put<char> >(const locale&);
+
+ extern template
+ const time_get<char>&
+ use_facet<time_get<char> >(const locale&);
+
+ extern template
+ const messages<char>&
+ use_facet<messages<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<moneypunct<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<money_put<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<money_get<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<__timepunct<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<time_put<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<time_get<char> >(const locale&);
+
+ extern template
+ bool
+ has_facet<messages<char> >(const locale&);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class moneypunct<wchar_t, false>;
+ extern template class moneypunct<wchar_t, true>;
+ extern template class moneypunct_byname<wchar_t, false>;
+ extern template class moneypunct_byname<wchar_t, true>;
+ extern template class _GLIBCXX_LDBL_NAMESPACE money_get<wchar_t>;
+ extern template class _GLIBCXX_LDBL_NAMESPACE money_put<wchar_t>;
+ extern template class __timepunct<wchar_t>;
+ extern template class time_put<wchar_t>;
+ extern template class time_put_byname<wchar_t>;
+ extern template class time_get<wchar_t>;
+ extern template class time_get_byname<wchar_t>;
+ extern template class messages<wchar_t>;
+ extern template class messages_byname<wchar_t>;
+
+ extern template
+ const moneypunct<wchar_t, true>&
+ use_facet<moneypunct<wchar_t, true> >(const locale&);
+
+ extern template
+ const moneypunct<wchar_t, false>&
+ use_facet<moneypunct<wchar_t, false> >(const locale&);
+
+ extern template
+ const money_put<wchar_t>&
+ use_facet<money_put<wchar_t> >(const locale&);
+
+ extern template
+ const money_get<wchar_t>&
+ use_facet<money_get<wchar_t> >(const locale&);
+
+ extern template
+ const __timepunct<wchar_t>&
+ use_facet<__timepunct<wchar_t> >(const locale&);
+
+ extern template
+ const time_put<wchar_t>&
+ use_facet<time_put<wchar_t> >(const locale&);
+
+ extern template
+ const time_get<wchar_t>&
+ use_facet<time_get<wchar_t> >(const locale&);
+
+ extern template
+ const messages<wchar_t>&
+ use_facet<messages<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<moneypunct<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<money_put<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<money_get<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<__timepunct<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<time_put<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<time_get<wchar_t> >(const locale&);
+
+ extern template
+ bool
+ has_facet<messages<wchar_t> >(const locale&);
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/localefwd.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/localefwd.h
new file mode 100644
index 0000000..909df1e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/localefwd.h
@@ -0,0 +1,183 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file localefwd.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+#ifndef _LOCALE_FWD_H
+#define _LOCALE_FWD_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/c++locale.h> // Defines __c_locale, config-specific include
+#include <iosfwd> // For ostreambuf_iterator, istreambuf_iterator
+#include <cctype>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 22.1.1 Locale
+ class locale;
+
+ template<typename _Facet>
+ bool
+ has_facet(const locale&) throw();
+
+ template<typename _Facet>
+ const _Facet&
+ use_facet(const locale&);
+
+ // 22.1.3 Convenience interfaces
+ template<typename _CharT>
+ bool
+ isspace(_CharT, const locale&);
+
+ template<typename _CharT>
+ bool
+ isprint(_CharT, const locale&);
+
+ template<typename _CharT>
+ bool
+ iscntrl(_CharT, const locale&);
+
+ template<typename _CharT>
+ bool
+ isupper(_CharT, const locale&);
+
+ template<typename _CharT>
+ bool
+ islower(_CharT, const locale&);
+
+ template<typename _CharT>
+ bool
+ isalpha(_CharT, const locale&);
+
+ template<typename _CharT>
+ bool
+ isdigit(_CharT, const locale&);
+
+ template<typename _CharT>
+ bool
+ ispunct(_CharT, const locale&);
+
+ template<typename _CharT>
+ bool
+ isxdigit(_CharT, const locale&);
+
+ template<typename _CharT>
+ bool
+ isalnum(_CharT, const locale&);
+
+ template<typename _CharT>
+ bool
+ isgraph(_CharT, const locale&);
+
+ template<typename _CharT>
+ _CharT
+ toupper(_CharT, const locale&);
+
+ template<typename _CharT>
+ _CharT
+ tolower(_CharT, const locale&);
+
+ // 22.2.1 and 22.2.1.3 ctype
+ class ctype_base;
+ template<typename _CharT>
+ class ctype;
+ template<> class ctype<char>;
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<> class ctype<wchar_t>;
+#endif
+ template<typename _CharT>
+ class ctype_byname;
+ // NB: Specialized for char and wchar_t in locale_facets.h.
+
+ class codecvt_base;
+ template<typename _InternT, typename _ExternT, typename _StateT>
+ class codecvt;
+ template<> class codecvt<char, char, mbstate_t>;
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<> class codecvt<wchar_t, char, mbstate_t>;
+#endif
+ template<typename _InternT, typename _ExternT, typename _StateT>
+ class codecvt_byname;
+
+ // 22.2.2 and 22.2.3 numeric
+_GLIBCXX_BEGIN_LDBL_NAMESPACE
+ template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+ class num_get;
+ template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+ class num_put;
+_GLIBCXX_END_LDBL_NAMESPACE
+ template<typename _CharT> class numpunct;
+ template<typename _CharT> class numpunct_byname;
+
+ // 22.2.4 collation
+ template<typename _CharT>
+ class collate;
+ template<typename _CharT> class
+ collate_byname;
+
+ // 22.2.5 date and time
+ class time_base;
+ template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+ class time_get;
+ template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+ class time_get_byname;
+ template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+ class time_put;
+ template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+ class time_put_byname;
+
+ // 22.2.6 money
+ class money_base;
+_GLIBCXX_BEGIN_LDBL_NAMESPACE
+ template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+ class money_get;
+ template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+ class money_put;
+_GLIBCXX_END_LDBL_NAMESPACE
+ template<typename _CharT, bool _Intl = false>
+ class moneypunct;
+ template<typename _CharT, bool _Intl = false>
+ class moneypunct_byname;
+
+ // 22.2.7 message retrieval
+ class messages_base;
+ template<typename _CharT>
+ class messages;
+ template<typename _CharT>
+ class messages_byname;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/mask_array.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/mask_array.h
new file mode 100644
index 0000000..f915dd9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/mask_array.h
@@ -0,0 +1,206 @@
+// The template and inlines for the -*- C++ -*- mask_array class.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file mask_array.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
+
+#ifndef _MASK_ARRAY_H
+#define _MASK_ARRAY_H 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @addtogroup numeric_arrays
+ * @{
+ */
+
+ /**
+ * @brief Reference to selected subset of an array.
+ *
+ * A mask_array is a reference to the actual elements of an array specified
+ * by a bitmask in the form of an array of bool. The way to get a
+ * mask_array is to call operator[](valarray<bool>) on a valarray. The
+ * returned mask_array then permits carrying operations out on the
+ * referenced subset of elements in the original valarray.
+ *
+ * For example, if a mask_array is obtained using the array (false, true,
+ * false, true) as an argument, the mask array has two elements referring
+ * to array[1] and array[3] in the underlying array.
+ *
+ * @param Tp Element type.
+ */
+ template <class _Tp>
+ class mask_array
+ {
+ public:
+ typedef _Tp value_type;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 253. valarray helper functions are almost entirely useless
+
+ /// Copy constructor. Both slices refer to the same underlying array.
+ mask_array (const mask_array&);
+
+ /// Assignment operator. Assigns elements to corresponding elements
+ /// of @a a.
+ mask_array& operator=(const mask_array&);
+
+ void operator=(const valarray<_Tp>&) const;
+ /// Multiply slice elements by corresponding elements of @a v.
+ void operator*=(const valarray<_Tp>&) const;
+ /// Divide slice elements by corresponding elements of @a v.
+ void operator/=(const valarray<_Tp>&) const;
+ /// Modulo slice elements by corresponding elements of @a v.
+ void operator%=(const valarray<_Tp>&) const;
+ /// Add corresponding elements of @a v to slice elements.
+ void operator+=(const valarray<_Tp>&) const;
+ /// Subtract corresponding elements of @a v from slice elements.
+ void operator-=(const valarray<_Tp>&) const;
+ /// Logical xor slice elements with corresponding elements of @a v.
+ void operator^=(const valarray<_Tp>&) const;
+ /// Logical and slice elements with corresponding elements of @a v.
+ void operator&=(const valarray<_Tp>&) const;
+ /// Logical or slice elements with corresponding elements of @a v.
+ void operator|=(const valarray<_Tp>&) const;
+ /// Left shift slice elements by corresponding elements of @a v.
+ void operator<<=(const valarray<_Tp>&) const;
+ /// Right shift slice elements by corresponding elements of @a v.
+ void operator>>=(const valarray<_Tp>&) const;
+ /// Assign all slice elements to @a t.
+ void operator=(const _Tp&) const;
+
+ // ~mask_array ();
+
+ template<class _Dom>
+ void operator=(const _Expr<_Dom,_Tp>&) const;
+ template<class _Dom>
+ void operator*=(const _Expr<_Dom,_Tp>&) const;
+ template<class _Dom>
+ void operator/=(const _Expr<_Dom,_Tp>&) const;
+ template<class _Dom>
+ void operator%=(const _Expr<_Dom,_Tp>&) const;
+ template<class _Dom>
+ void operator+=(const _Expr<_Dom,_Tp>&) const;
+ template<class _Dom>
+ void operator-=(const _Expr<_Dom,_Tp>&) const;
+ template<class _Dom>
+ void operator^=(const _Expr<_Dom,_Tp>&) const;
+ template<class _Dom>
+ void operator&=(const _Expr<_Dom,_Tp>&) const;
+ template<class _Dom>
+ void operator|=(const _Expr<_Dom,_Tp>&) const;
+ template<class _Dom>
+ void operator<<=(const _Expr<_Dom,_Tp>&) const;
+ template<class _Dom>
+ void operator>>=(const _Expr<_Dom,_Tp>&) const;
+
+ private:
+ mask_array(_Array<_Tp>, size_t, _Array<bool>);
+ friend class valarray<_Tp>;
+
+ const size_t _M_sz;
+ const _Array<bool> _M_mask;
+ const _Array<_Tp> _M_array;
+
+ // not implemented
+ mask_array();
+ };
+
+ template<typename _Tp>
+ inline mask_array<_Tp>::mask_array(const mask_array<_Tp>& a)
+ : _M_sz(a._M_sz), _M_mask(a._M_mask), _M_array(a._M_array) {}
+
+ template<typename _Tp>
+ inline
+ mask_array<_Tp>::mask_array(_Array<_Tp> __a, size_t __s, _Array<bool> __m)
+ : _M_sz(__s), _M_mask(__m), _M_array(__a) {}
+
+ template<typename _Tp>
+ inline mask_array<_Tp>&
+ mask_array<_Tp>::operator=(const mask_array<_Tp>& __a)
+ {
+ std::__valarray_copy(__a._M_array, __a._M_mask,
+ _M_sz, _M_array, _M_mask);
+ return *this;
+ }
+
+ template<typename _Tp>
+ inline void
+ mask_array<_Tp>::operator=(const _Tp& __t) const
+ { std::__valarray_fill(_M_array, _M_sz, _M_mask, __t); }
+
+ template<typename _Tp>
+ inline void
+ mask_array<_Tp>::operator=(const valarray<_Tp>& __v) const
+ { std::__valarray_copy(_Array<_Tp>(__v), __v.size(), _M_array, _M_mask); }
+
+ template<typename _Tp>
+ template<class _Ex>
+ inline void
+ mask_array<_Tp>::operator=(const _Expr<_Ex, _Tp>& __e) const
+ { std::__valarray_copy(__e, __e.size(), _M_array, _M_mask); }
+
+#undef _DEFINE_VALARRAY_OPERATOR
+#define _DEFINE_VALARRAY_OPERATOR(_Op, _Name) \
+ template<typename _Tp> \
+ inline void \
+ mask_array<_Tp>::operator _Op##=(const valarray<_Tp>& __v) const \
+ { \
+ _Array_augmented_##_Name(_M_array, _M_mask, \
+ _Array<_Tp>(__v), __v.size()); \
+ } \
+ \
+ template<typename _Tp> \
+ template<class _Dom> \
+ inline void \
+ mask_array<_Tp>::operator _Op##=(const _Expr<_Dom, _Tp>& __e) const\
+ { \
+ _Array_augmented_##_Name(_M_array, _M_mask, __e, __e.size()); \
+ }
+
+_DEFINE_VALARRAY_OPERATOR(*, __multiplies)
+_DEFINE_VALARRAY_OPERATOR(/, __divides)
+_DEFINE_VALARRAY_OPERATOR(%, __modulus)
+_DEFINE_VALARRAY_OPERATOR(+, __plus)
+_DEFINE_VALARRAY_OPERATOR(-, __minus)
+_DEFINE_VALARRAY_OPERATOR(^, __bitwise_xor)
+_DEFINE_VALARRAY_OPERATOR(&, __bitwise_and)
+_DEFINE_VALARRAY_OPERATOR(|, __bitwise_or)
+_DEFINE_VALARRAY_OPERATOR(<<, __shift_left)
+_DEFINE_VALARRAY_OPERATOR(>>, __shift_right)
+
+#undef _DEFINE_VALARRAY_OPERATOR
+
+ // @} group numeric_arrays
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _MASK_ARRAY_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/move.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/move.h
new file mode 100644
index 0000000..ef86c4d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/move.h
@@ -0,0 +1,98 @@
+// Move, forward and identity for C++0x + swap -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file move.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _MOVE_H
+#define _MOVE_H 1
+
+#include <bits/c++config.h>
+#include <cstddef>
+#include <bits/concept_check.h>
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#include <type_traits>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 20.2.2, forward/move
+ template<typename _Tp>
+ struct identity
+ {
+ typedef _Tp type;
+ };
+
+ template<typename _Tp>
+ inline _Tp&&
+ forward(typename std::identity<_Tp>::type&& __t)
+ { return __t; }
+
+ template<typename _Tp>
+ inline typename std::remove_reference<_Tp>::type&&
+ move(_Tp&& __t)
+ { return __t; }
+
+_GLIBCXX_END_NAMESPACE
+
+#define _GLIBCXX_MOVE(_Tp) std::move(_Tp)
+#else
+#define _GLIBCXX_MOVE(_Tp) (_Tp)
+#endif
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @brief Swaps two values.
+ * @param a A thing of arbitrary type.
+ * @param b Another thing of arbitrary type.
+ * @return Nothing.
+ */
+ template<typename _Tp>
+ inline void
+ swap(_Tp& __a, _Tp& __b)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_SGIAssignableConcept<_Tp>)
+
+ _Tp __tmp = _GLIBCXX_MOVE(__a);
+ __a = _GLIBCXX_MOVE(__b);
+ __b = _GLIBCXX_MOVE(__tmp);
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 809. std::swap should be overloaded for array types.
+ template<typename _Tp, size_t _Nm>
+ inline void
+ swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
+ {
+ for (size_t __n = 0; __n < _Nm; ++__n)
+ swap(__a[__n], __b[__n]);
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _MOVE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/ostream.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/ostream.tcc
new file mode 100644
index 0000000..e2cbb58
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/ostream.tcc
@@ -0,0 +1,407 @@
+// ostream classes -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ostream.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 27.6.2 Output streams
+//
+
+#ifndef _OSTREAM_TCC
+#define _OSTREAM_TCC 1
+
+#pragma GCC system_header
+
+#include <cxxabi-forced.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>::sentry::
+ sentry(basic_ostream<_CharT, _Traits>& __os)
+ : _M_ok(false), _M_os(__os)
+ {
+ // XXX MT
+ if (__os.tie() && __os.good())
+ __os.tie()->flush();
+
+ if (__os.good())
+ _M_ok = true;
+ else
+ __os.setstate(ios_base::failbit);
+ }
+
+ template<typename _CharT, typename _Traits>
+ template<typename _ValueT>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ _M_insert(_ValueT __v)
+ {
+ sentry __cerb(*this);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ const __num_put_type& __np = __check_facet(this->_M_num_put);
+ if (__np.put(*this, *this, this->fill(), __v).failed())
+ __err |= ios_base::badbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ operator<<(short __n)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 117. basic_ostream uses nonexistent num_put member functions.
+ const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
+ if (__fmt == ios_base::oct || __fmt == ios_base::hex)
+ return _M_insert(static_cast<long>(static_cast<unsigned short>(__n)));
+ else
+ return _M_insert(static_cast<long>(__n));
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ operator<<(int __n)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 117. basic_ostream uses nonexistent num_put member functions.
+ const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
+ if (__fmt == ios_base::oct || __fmt == ios_base::hex)
+ return _M_insert(static_cast<long>(static_cast<unsigned int>(__n)));
+ else
+ return _M_insert(static_cast<long>(__n));
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ operator<<(__streambuf_type* __sbin)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this);
+ if (__cerb && __sbin)
+ {
+ __try
+ {
+ if (!__copy_streambufs(__sbin, this->rdbuf()))
+ __err |= ios_base::failbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::failbit); }
+ }
+ else if (!__sbin)
+ __err |= ios_base::badbit;
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ put(char_type __c)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // basic_ostream::put(char_type) is an unformatted output function.
+ // DR 63. Exception-handling policy for unformatted output.
+ // Unformatted output functions should catch exceptions thrown
+ // from streambuf members.
+ sentry __cerb(*this);
+ if (__cerb)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ const int_type __put = this->rdbuf()->sputc(__c);
+ if (traits_type::eq_int_type(__put, traits_type::eof()))
+ __err |= ios_base::badbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ write(const _CharT* __s, streamsize __n)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // basic_ostream::write(const char_type*, streamsize) is an
+ // unformatted output function.
+ // DR 63. Exception-handling policy for unformatted output.
+ // Unformatted output functions should catch exceptions thrown
+ // from streambuf members.
+ sentry __cerb(*this);
+ if (__cerb)
+ {
+ __try
+ { _M_write(__s, __n); }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ flush()
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // basic_ostream::flush() is *not* an unformatted output function.
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ if (this->rdbuf() && this->rdbuf()->pubsync() == -1)
+ __err |= ios_base::badbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_ostream<_CharT, _Traits>::pos_type
+ basic_ostream<_CharT, _Traits>::
+ tellp()
+ {
+ pos_type __ret = pos_type(-1);
+ __try
+ {
+ if (!this->fail())
+ __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out);
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ seekp(pos_type __pos)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ if (!this->fail())
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 136. seekp, seekg setting wrong streams?
+ const pos_type __p = this->rdbuf()->pubseekpos(__pos,
+ ios_base::out);
+
+ // 129. Need error indication from seekp() and seekg()
+ if (__p == pos_type(off_type(-1)))
+ __err |= ios_base::failbit;
+ }
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ seekp(off_type __off, ios_base::seekdir __dir)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ __try
+ {
+ if (!this->fail())
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 136. seekp, seekg setting wrong streams?
+ const pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
+ ios_base::out);
+
+ // 129. Need error indication from seekp() and seekg()
+ if (__p == pos_type(off_type(-1)))
+ __err |= ios_base::failbit;
+ }
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ this->_M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
+ {
+ if (!__s)
+ __out.setstate(ios_base::badbit);
+ else
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 167. Improper use of traits_type::length()
+ const size_t __clen = char_traits<char>::length(__s);
+ __try
+ {
+ struct __ptr_guard
+ {
+ _CharT *__p;
+ __ptr_guard (_CharT *__ip): __p(__ip) { }
+ ~__ptr_guard() { delete[] __p; }
+ _CharT* __get() { return __p; }
+ } __pg (new _CharT[__clen]);
+
+ _CharT *__ws = __pg.__get();
+ for (size_t __i = 0; __i < __clen; ++__i)
+ __ws[__i] = __out.widen(__s[__i]);
+ __ostream_insert(__out, __ws, __clen);
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ __out._M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { __out._M_setstate(ios_base::badbit); }
+ }
+ return __out;
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class basic_ostream<char>;
+ extern template ostream& endl(ostream&);
+ extern template ostream& ends(ostream&);
+ extern template ostream& flush(ostream&);
+ extern template ostream& operator<<(ostream&, char);
+ extern template ostream& operator<<(ostream&, unsigned char);
+ extern template ostream& operator<<(ostream&, signed char);
+ extern template ostream& operator<<(ostream&, const char*);
+ extern template ostream& operator<<(ostream&, const unsigned char*);
+ extern template ostream& operator<<(ostream&, const signed char*);
+
+ extern template ostream& ostream::_M_insert(long);
+ extern template ostream& ostream::_M_insert(unsigned long);
+ extern template ostream& ostream::_M_insert(bool);
+#ifdef _GLIBCXX_USE_LONG_LONG
+ extern template ostream& ostream::_M_insert(long long);
+ extern template ostream& ostream::_M_insert(unsigned long long);
+#endif
+ extern template ostream& ostream::_M_insert(double);
+ extern template ostream& ostream::_M_insert(long double);
+ extern template ostream& ostream::_M_insert(const void*);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class basic_ostream<wchar_t>;
+ extern template wostream& endl(wostream&);
+ extern template wostream& ends(wostream&);
+ extern template wostream& flush(wostream&);
+ extern template wostream& operator<<(wostream&, wchar_t);
+ extern template wostream& operator<<(wostream&, char);
+ extern template wostream& operator<<(wostream&, const wchar_t*);
+ extern template wostream& operator<<(wostream&, const char*);
+
+ extern template wostream& wostream::_M_insert(long);
+ extern template wostream& wostream::_M_insert(unsigned long);
+ extern template wostream& wostream::_M_insert(bool);
+#ifdef _GLIBCXX_USE_LONG_LONG
+ extern template wostream& wostream::_M_insert(long long);
+ extern template wostream& wostream::_M_insert(unsigned long long);
+#endif
+ extern template wostream& wostream::_M_insert(double);
+ extern template wostream& wostream::_M_insert(long double);
+ extern template wostream& wostream::_M_insert(const void*);
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/ostream_insert.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/ostream_insert.h
new file mode 100644
index 0000000..e0017ee
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/ostream_insert.h
@@ -0,0 +1,127 @@
+// Helpers for ostream inserters -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ostream_insert.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _OSTREAM_INSERT_H
+#define _OSTREAM_INSERT_H 1
+
+#pragma GCC system_header
+
+#include <iosfwd>
+#include <cxxabi-forced.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, typename _Traits>
+ inline void
+ __ostream_write(basic_ostream<_CharT, _Traits>& __out,
+ const _CharT* __s, streamsize __n)
+ {
+ typedef basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const streamsize __put = __out.rdbuf()->sputn(__s, __n);
+ if (__put != __n)
+ __out.setstate(__ios_base::badbit);
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline void
+ __ostream_fill(basic_ostream<_CharT, _Traits>& __out, streamsize __n)
+ {
+ typedef basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const _CharT __c = __out.fill();
+ for (; __n > 0; --__n)
+ {
+ const typename _Traits::int_type __put = __out.rdbuf()->sputc(__c);
+ if (_Traits::eq_int_type(__put, _Traits::eof()))
+ {
+ __out.setstate(__ios_base::badbit);
+ break;
+ }
+ }
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ __ostream_insert(basic_ostream<_CharT, _Traits>& __out,
+ const _CharT* __s, streamsize __n)
+ {
+ typedef basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ typename __ostream_type::sentry __cerb(__out);
+ if (__cerb)
+ {
+ __try
+ {
+ const streamsize __w = __out.width();
+ if (__w > __n)
+ {
+ const bool __left = ((__out.flags()
+ & __ios_base::adjustfield)
+ == __ios_base::left);
+ if (!__left)
+ __ostream_fill(__out, __w - __n);
+ if (__out.good())
+ __ostream_write(__out, __s, __n);
+ if (__left && __out.good())
+ __ostream_fill(__out, __w - __n);
+ }
+ else
+ __ostream_write(__out, __s, __n);
+ __out.width(0);
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ __out._M_setstate(__ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { __out._M_setstate(__ios_base::badbit); }
+ }
+ return __out;
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template ostream& __ostream_insert(ostream&, const char*, streamsize);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template wostream& __ostream_insert(wostream&, const wchar_t*,
+ streamsize);
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _OSTREAM_INSERT_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/postypes.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/postypes.h
new file mode 100644
index 0000000..8066d9b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/postypes.h
@@ -0,0 +1,241 @@
+// Position types -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file postypes.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 27.4.1 - Types
+// ISO C++ 14882: 27.4.3 - Template class fpos
+//
+
+#ifndef _GLIBCXX_POSTYPES_H
+#define _GLIBCXX_POSTYPES_H 1
+
+#pragma GCC system_header
+
+#include <cwchar> // For mbstate_t
+
+// XXX If <stdint.h> is really needed, make sure to define the macros
+// before including it, in order not to break <tr1/cstdint> (and <cstdint>
+// in C++0x). Reconsider all this as soon as possible...
+#if (defined(_GLIBCXX_HAVE_INT64_T) && !defined(_GLIBCXX_HAVE_INT64_T_LONG) \
+ && !defined(_GLIBCXX_HAVE_INT64_T_LONG_LONG))
+
+#ifndef __STDC_LIMIT_MACROS
+# define _UNDEF__STDC_LIMIT_MACROS
+# define __STDC_LIMIT_MACROS
+#endif
+#ifndef __STDC_CONSTANT_MACROS
+# define _UNDEF__STDC_CONSTANT_MACROS
+# define __STDC_CONSTANT_MACROS
+#endif
+#include <stdint.h> // For int64_t
+#ifdef _UNDEF__STDC_LIMIT_MACROS
+# undef __STDC_LIMIT_MACROS
+# undef _UNDEF__STDC_LIMIT_MACROS
+#endif
+#ifdef _UNDEF__STDC_CONSTANT_MACROS
+# undef __STDC_CONSTANT_MACROS
+# undef _UNDEF__STDC_CONSTANT_MACROS
+#endif
+
+#endif
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // The types streamoff, streampos and wstreampos and the class
+ // template fpos<> are described in clauses 21.1.2, 21.1.3, 27.1.2,
+ // 27.2, 27.4.1, 27.4.3 and D.6. Despite all this verbiage, the
+ // behaviour of these types is mostly implementation defined or
+ // unspecified. The behaviour in this implementation is as noted
+ // below.
+
+ /**
+ * @brief Type used by fpos, char_traits<char>, and char_traits<wchar_t>.
+ *
+ * In clauses 21.1.3.1 and 27.4.1 streamoff is described as an
+ * implementation defined type.
+ * Note: In versions of GCC up to and including GCC 3.3, streamoff
+ * was typedef long.
+ */
+#ifdef _GLIBCXX_HAVE_INT64_T_LONG
+ typedef long streamoff;
+#elif defined(_GLIBCXX_HAVE_INT64_T_LONG_LONG)
+ typedef long long streamoff;
+#elif defined(_GLIBCXX_HAVE_INT64_T)
+ typedef int64_t streamoff;
+#else
+ typedef long long streamoff;
+#endif
+
+ /// Integral type for I/O operation counts and buffer sizes.
+ typedef ptrdiff_t streamsize; // Signed integral type
+
+ /**
+ * @brief Class representing stream positions.
+ *
+ * The standard places no requirements upon the template parameter StateT.
+ * In this implementation StateT must be DefaultConstructible,
+ * CopyConstructible and Assignable. The standard only requires that fpos
+ * should contain a member of type StateT. In this implementation it also
+ * contains an offset stored as a signed integer.
+ *
+ * @param StateT Type passed to and returned from state().
+ */
+ template<typename _StateT>
+ class fpos
+ {
+ private:
+ streamoff _M_off;
+ _StateT _M_state;
+
+ public:
+ // The standard doesn't require that fpos objects can be default
+ // constructed. This implementation provides a default
+ // constructor that initializes the offset to 0 and default
+ // constructs the state.
+ fpos()
+ : _M_off(0), _M_state() { }
+
+ // The standard requires that fpos objects can be constructed
+ // from streamoff objects using the constructor syntax, and
+ // fails to give any meaningful semantics. In this
+ // implementation implicit conversion is also allowed, and this
+ // constructor stores the streamoff as the offset and default
+ // constructs the state.
+ /// Construct position from offset.
+ fpos(streamoff __off)
+ : _M_off(__off), _M_state() { }
+
+ /// Convert to streamoff.
+ operator streamoff() const { return _M_off; }
+
+ /// Remember the value of @a st.
+ void
+ state(_StateT __st)
+ { _M_state = __st; }
+
+ /// Return the last set value of @a st.
+ _StateT
+ state() const
+ { return _M_state; }
+
+ // The standard requires that this operator must be defined, but
+ // gives no semantics. In this implementation it just adds its
+ // argument to the stored offset and returns *this.
+ /// Add offset to this position.
+ fpos&
+ operator+=(streamoff __off)
+ {
+ _M_off += __off;
+ return *this;
+ }
+
+ // The standard requires that this operator must be defined, but
+ // gives no semantics. In this implementation it just subtracts
+ // its argument from the stored offset and returns *this.
+ /// Subtract offset from this position.
+ fpos&
+ operator-=(streamoff __off)
+ {
+ _M_off -= __off;
+ return *this;
+ }
+
+ // The standard requires that this operator must be defined, but
+ // defines its semantics only in terms of operator-. In this
+ // implementation it constructs a copy of *this, adds the
+ // argument to that copy using operator+= and then returns the
+ // copy.
+ /// Add position and offset.
+ fpos
+ operator+(streamoff __off) const
+ {
+ fpos __pos(*this);
+ __pos += __off;
+ return __pos;
+ }
+
+ // The standard requires that this operator must be defined, but
+ // defines its semantics only in terms of operator+. In this
+ // implementation it constructs a copy of *this, subtracts the
+ // argument from that copy using operator-= and then returns the
+ // copy.
+ /// Subtract offset from position.
+ fpos
+ operator-(streamoff __off) const
+ {
+ fpos __pos(*this);
+ __pos -= __off;
+ return __pos;
+ }
+
+ // The standard requires that this operator must be defined, but
+ // defines its semantics only in terms of operator+. In this
+ // implementation it returns the difference between the offset
+ // stored in *this and in the argument.
+ /// Subtract position to return offset.
+ streamoff
+ operator-(const fpos& __other) const
+ { return _M_off - __other._M_off; }
+ };
+
+ // The standard only requires that operator== must be an
+ // equivalence relation. In this implementation two fpos<StateT>
+ // objects belong to the same equivalence class if the contained
+ // offsets compare equal.
+ /// Test if equivalent to another position.
+ template<typename _StateT>
+ inline bool
+ operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
+ { return streamoff(__lhs) == streamoff(__rhs); }
+
+ template<typename _StateT>
+ inline bool
+ operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
+ { return streamoff(__lhs) != streamoff(__rhs); }
+
+ // Clauses 21.1.3.1 and 21.1.3.2 describe streampos and wstreampos
+ // as implementation defined types, but clause 27.2 requires that
+ // they must both be typedefs for fpos<mbstate_t>
+ /// File position for char streams.
+ typedef fpos<mbstate_t> streampos;
+ /// File position for wchar_t streams.
+ typedef fpos<mbstate_t> wstreampos;
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /// File position for char16_t streams.
+ typedef fpos<mbstate_t> u16streampos;
+ /// File position for char32_t streams.
+ typedef fpos<mbstate_t> u32streampos;
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/shared_ptr.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/shared_ptr.h
new file mode 100644
index 0000000..a378ae0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/shared_ptr.h
@@ -0,0 +1,1591 @@
+// shared_ptr and weak_ptr implementation -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// shared_count.hpp
+// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
+
+// shared_ptr.hpp
+// Copyright (C) 1998, 1999 Greg Colvin and Beman Dawes.
+// Copyright (C) 2001, 2002, 2003 Peter Dimov
+
+// weak_ptr.hpp
+// Copyright (C) 2001, 2002, 2003 Peter Dimov
+
+// enable_shared_from_this.hpp
+// Copyright (C) 2002 Peter Dimov
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// GCC Note: based on version 1.32.0 of the Boost library.
+
+/** @file bits/shared_ptr.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _SHARED_PTR_H
+#define _SHARED_PTR_H 1
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @addtogroup pointer_abstractions
+ * @{
+ */
+
+ // counted ptr with no deleter or allocator support
+ template<typename _Ptr, _Lock_policy _Lp>
+ class _Sp_counted_ptr
+ : public _Sp_counted_base<_Lp>
+ {
+ public:
+ _Sp_counted_ptr(_Ptr __p)
+ : _M_ptr(__p) { }
+
+ virtual void
+ _M_dispose() // nothrow
+ { delete _M_ptr; }
+
+ virtual void
+ _M_destroy() // nothrow
+ { delete this; }
+
+ virtual void*
+ _M_get_deleter(const std::type_info& __ti)
+ { return 0; }
+
+ _Sp_counted_ptr(const _Sp_counted_ptr&) = delete;
+ _Sp_counted_ptr& operator=(const _Sp_counted_ptr&) = delete;
+
+ protected:
+ _Ptr _M_ptr; // copy constructor must not throw
+ };
+
+ // support for custom deleter and/or allocator
+ template<typename _Ptr, typename _Deleter, typename _Alloc, _Lock_policy _Lp>
+ class _Sp_counted_deleter
+ : public _Sp_counted_ptr<_Ptr, _Lp>
+ {
+ typedef typename _Alloc::template
+ rebind<_Sp_counted_deleter>::other _My_alloc_type;
+
+ // Helper class that stores the Deleter and also acts as an allocator.
+ // Used to dispose of the owned pointer and the internal refcount
+ // Requires that copies of _Alloc can free each other's memory.
+ struct _My_Deleter
+ : public _My_alloc_type // copy constructor must not throw
+ {
+ _Deleter _M_del; // copy constructor must not throw
+ _My_Deleter(_Deleter __d, const _Alloc& __a)
+ : _My_alloc_type(__a), _M_del(__d) { }
+ };
+
+ protected:
+ typedef _Sp_counted_ptr<_Ptr, _Lp> _Base_type;
+
+ public:
+ /**
+ * @brief
+ * @pre __d(__p) must not throw.
+ */
+ _Sp_counted_deleter(_Ptr __p, _Deleter __d)
+ : _Base_type(__p), _M_del(__d, _Alloc()) { }
+
+ /**
+ * @brief
+ * @pre __d(__p) must not throw.
+ */
+ _Sp_counted_deleter(_Ptr __p, _Deleter __d, const _Alloc& __a)
+ : _Base_type(__p), _M_del(__d, __a) { }
+
+ virtual void
+ _M_dispose() // nothrow
+ { _M_del._M_del(_Base_type::_M_ptr); }
+
+ virtual void
+ _M_destroy() // nothrow
+ {
+ _My_alloc_type __a(_M_del);
+ this->~_Sp_counted_deleter();
+ __a.deallocate(this, 1);
+ }
+
+ virtual void*
+ _M_get_deleter(const std::type_info& __ti)
+ { return __ti == typeid(_Deleter) ? &_M_del._M_del : 0; }
+
+ protected:
+ _My_Deleter _M_del; // copy constructor must not throw
+ };
+
+ // helpers for make_shared / allocate_shared
+
+ template<typename _Tp>
+ struct _Sp_destroy_inplace
+ {
+ void operator()(_Tp* __p) const { if (__p) __p->~_Tp(); }
+ };
+
+ struct _Sp_make_shared_tag { };
+
+ template<typename _Tp, typename _Alloc, _Lock_policy _Lp>
+ class _Sp_counted_ptr_inplace
+ : public _Sp_counted_deleter<_Tp*, _Sp_destroy_inplace<_Tp>, _Alloc, _Lp>
+ {
+ typedef _Sp_counted_deleter<_Tp*, _Sp_destroy_inplace<_Tp>, _Alloc, _Lp>
+ _Base_type;
+
+ public:
+ _Sp_counted_ptr_inplace(_Alloc __a)
+ : _Base_type(static_cast<_Tp*>(0), _Sp_destroy_inplace<_Tp>(), __a)
+ , _M_storage()
+ {
+ void* __p = &_M_storage;
+ ::new (__p) _Tp(); // might throw
+ _Base_type::_Base_type::_M_ptr = static_cast<_Tp*>(__p);
+ }
+
+ template<typename... _Args>
+ _Sp_counted_ptr_inplace(_Alloc __a, _Args&&... __args)
+ : _Base_type(static_cast<_Tp*>(0), _Sp_destroy_inplace<_Tp>(), __a)
+ , _M_storage()
+ {
+ void* __p = &_M_storage;
+ ::new (__p) _Tp(std::forward<_Args>(__args)...); // might throw
+ _Base_type::_Base_type::_M_ptr = static_cast<_Tp*>(__p);
+ }
+
+ // override because the allocator needs to know the dynamic type
+ virtual void
+ _M_destroy() // nothrow
+ {
+ typedef typename _Alloc::template
+ rebind<_Sp_counted_ptr_inplace>::other _My_alloc_type;
+ _My_alloc_type __a(_Base_type::_M_del);
+ this->~_Sp_counted_ptr_inplace();
+ __a.deallocate(this, 1);
+ }
+
+ // sneaky trick so __shared_ptr can get the managed pointer
+ virtual void*
+ _M_get_deleter(const std::type_info& __ti)
+ {
+ return __ti == typeid(_Sp_make_shared_tag)
+ ? static_cast<void*>(&_M_storage)
+ : _Base_type::_M_get_deleter(__ti);
+ }
+
+ private:
+ typename aligned_storage<sizeof(_Tp), alignment_of<_Tp>::value>::type
+ _M_storage;
+ };
+
+ template<_Lock_policy _Lp = __default_lock_policy>
+ class __weak_count;
+
+ template<_Lock_policy _Lp = __default_lock_policy>
+ class __shared_count
+ {
+ public:
+ __shared_count()
+ : _M_pi(0) // nothrow
+ { }
+
+ template<typename _Ptr>
+ __shared_count(_Ptr __p) : _M_pi(0)
+ {
+ __try
+ {
+ _M_pi = new _Sp_counted_ptr<_Ptr, _Lp>(__p);
+ }
+ __catch(...)
+ {
+ delete __p;
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _Ptr, typename _Deleter>
+ __shared_count(_Ptr __p, _Deleter __d) : _M_pi(0)
+ {
+ // allocator's value_type doesn't matter, will rebind it anyway
+ typedef std::allocator<int> _Alloc;
+ typedef _Sp_counted_deleter<_Ptr, _Deleter, _Alloc, _Lp> _Sp_cd_type;
+ typedef std::allocator<_Sp_cd_type> _Alloc2;
+ _Alloc2 __a2;
+ __try
+ {
+ _M_pi = __a2.allocate(1);
+ ::new(static_cast<void*>(_M_pi)) _Sp_cd_type(__p, __d);
+ }
+ __catch(...)
+ {
+ __d(__p); // Call _Deleter on __p.
+ if (_M_pi)
+ __a2.deallocate(static_cast<_Sp_cd_type*>(_M_pi), 1);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _Ptr, typename _Deleter, typename _Alloc>
+ __shared_count(_Ptr __p, _Deleter __d, _Alloc __a) : _M_pi(0)
+ {
+ typedef _Sp_counted_deleter<_Ptr, _Deleter, _Alloc, _Lp> _Sp_cd_type;
+ typedef typename _Alloc::template rebind<_Sp_cd_type>::other _Alloc2;
+ _Alloc2 __a2(__a);
+ __try
+ {
+ _M_pi = __a2.allocate(1);
+ ::new(static_cast<void*>(_M_pi)) _Sp_cd_type(__p, __d, __a);
+ }
+ __catch(...)
+ {
+ __d(__p); // Call _Deleter on __p.
+ if (_M_pi)
+ __a2.deallocate(static_cast<_Sp_cd_type*>(_M_pi), 1);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc, typename... _Args>
+ __shared_count(_Sp_make_shared_tag, _Tp*, _Alloc __a, _Args&&... __args)
+ : _M_pi(0)
+ {
+ typedef _Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp> _Sp_cp_type;
+ typedef typename _Alloc::template rebind<_Sp_cp_type>::other _Alloc2;
+ _Alloc2 __a2(__a);
+ __try
+ {
+ _M_pi = __a2.allocate(1);
+ ::new(static_cast<void*>(_M_pi)) _Sp_cp_type(__a,
+ std::forward<_Args>(__args)...);
+ }
+ __catch(...)
+ {
+ if (_M_pi)
+ __a2.deallocate(static_cast<_Sp_cp_type*>(_M_pi), 1);
+ __throw_exception_again;
+ }
+ }
+
+#if _GLIBCXX_DEPRECATED
+ // Special case for auto_ptr<_Tp> to provide the strong guarantee.
+ template<typename _Tp>
+ explicit
+ __shared_count(std::auto_ptr<_Tp>&& __r)
+ : _M_pi(new _Sp_counted_ptr<_Tp*, _Lp>(__r.get()))
+ { __r.release(); }
+#endif
+
+ // Special case for unique_ptr<_Tp,_Del> to provide the strong guarantee.
+ template<typename _Tp, typename _Del>
+ explicit
+ __shared_count(std::unique_ptr<_Tp, _Del>&& __r)
+ : _M_pi(_S_create_from_up(std::move(__r)))
+ { __r.release(); }
+
+ // Throw bad_weak_ptr when __r._M_get_use_count() == 0.
+ explicit
+ __shared_count(const __weak_count<_Lp>& __r);
+
+ ~__shared_count() // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_release();
+ }
+
+ __shared_count(const __shared_count& __r)
+ : _M_pi(__r._M_pi) // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_add_ref_copy();
+ }
+
+ __shared_count&
+ operator=(const __shared_count& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ if (__tmp != _M_pi)
+ {
+ if (__tmp != 0)
+ __tmp->_M_add_ref_copy();
+ if (_M_pi != 0)
+ _M_pi->_M_release();
+ _M_pi = __tmp;
+ }
+ return *this;
+ }
+
+ void
+ _M_swap(__shared_count& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ __r._M_pi = _M_pi;
+ _M_pi = __tmp;
+ }
+
+ long
+ _M_get_use_count() const // nothrow
+ { return _M_pi != 0 ? _M_pi->_M_get_use_count() : 0; }
+
+ bool
+ _M_unique() const // nothrow
+ { return this->_M_get_use_count() == 1; }
+
+ void*
+ _M_get_deleter(const std::type_info& __ti) const
+ { return _M_pi ? _M_pi->_M_get_deleter(__ti) : 0; }
+
+ bool
+ _M_less(const __shared_count& __rhs) const
+ { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
+
+ bool
+ _M_less(const __weak_count<_Lp>& __rhs) const
+ { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
+
+ // friend function injected into enclosing namespace and found by ADL
+ friend inline bool
+ operator==(const __shared_count& __a, const __shared_count& __b)
+ { return __a._M_pi == __b._M_pi; }
+
+ private:
+ friend class __weak_count<_Lp>;
+
+ template<typename _Tp, typename _Del>
+ static _Sp_counted_base<_Lp>*
+ _S_create_from_up(std::unique_ptr<_Tp, _Del>&& __r,
+ typename std::enable_if<!std::is_reference<_Del>::value>::type* = 0)
+ {
+ return new _Sp_counted_deleter<_Tp*, _Del, std::allocator<_Tp>,
+ _Lp>(__r.get(), __r.get_deleter());
+ }
+
+ template<typename _Tp, typename _Del>
+ static _Sp_counted_base<_Lp>*
+ _S_create_from_up(std::unique_ptr<_Tp, _Del>&& __r,
+ typename std::enable_if<std::is_reference<_Del>::value>::type* = 0)
+ {
+ typedef typename std::remove_reference<_Del>::type _Del1;
+ typedef std::reference_wrapper<_Del1> _Del2;
+ return new _Sp_counted_deleter<_Tp*, _Del2, std::allocator<_Tp>,
+ _Lp>(__r.get(), std::ref(__r.get_deleter()));
+ }
+
+ _Sp_counted_base<_Lp>* _M_pi;
+ };
+
+
+ template<_Lock_policy _Lp>
+ class __weak_count
+ {
+ public:
+ __weak_count()
+ : _M_pi(0) // nothrow
+ { }
+
+ __weak_count(const __shared_count<_Lp>& __r)
+ : _M_pi(__r._M_pi) // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_weak_add_ref();
+ }
+
+ __weak_count(const __weak_count<_Lp>& __r)
+ : _M_pi(__r._M_pi) // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_weak_add_ref();
+ }
+
+ ~__weak_count() // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_weak_release();
+ }
+
+ __weak_count<_Lp>&
+ operator=(const __shared_count<_Lp>& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ if (__tmp != 0)
+ __tmp->_M_weak_add_ref();
+ if (_M_pi != 0)
+ _M_pi->_M_weak_release();
+ _M_pi = __tmp;
+ return *this;
+ }
+
+ __weak_count<_Lp>&
+ operator=(const __weak_count<_Lp>& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ if (__tmp != 0)
+ __tmp->_M_weak_add_ref();
+ if (_M_pi != 0)
+ _M_pi->_M_weak_release();
+ _M_pi = __tmp;
+ return *this;
+ }
+
+ void
+ _M_swap(__weak_count<_Lp>& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ __r._M_pi = _M_pi;
+ _M_pi = __tmp;
+ }
+
+ long
+ _M_get_use_count() const // nothrow
+ { return _M_pi != 0 ? _M_pi->_M_get_use_count() : 0; }
+
+ bool
+ _M_less(const __weak_count& __rhs) const
+ { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
+
+ bool
+ _M_less(const __shared_count<_Lp>& __rhs) const
+ { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
+
+ // friend function injected into enclosing namespace and found by ADL
+ friend inline bool
+ operator==(const __weak_count& __a, const __weak_count& __b)
+ { return __a._M_pi == __b._M_pi; }
+
+ private:
+ friend class __shared_count<_Lp>;
+
+ _Sp_counted_base<_Lp>* _M_pi;
+ };
+
+ // now that __weak_count is defined we can define this constructor:
+ template<_Lock_policy _Lp>
+ inline
+ __shared_count<_Lp>::
+ __shared_count(const __weak_count<_Lp>& __r)
+ : _M_pi(__r._M_pi)
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_add_ref_lock();
+ else
+ __throw_bad_weak_ptr();
+ }
+
+ // Forward declarations.
+ template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
+ class __shared_ptr;
+
+ template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
+ class __weak_ptr;
+
+ template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
+ class __enable_shared_from_this;
+
+ template<typename _Tp>
+ class shared_ptr;
+
+ template<typename _Tp>
+ class weak_ptr;
+
+ template<typename _Tp>
+ class enable_shared_from_this;
+
+ // Support for enable_shared_from_this.
+
+ // Friend of __enable_shared_from_this.
+ template<_Lock_policy _Lp, typename _Tp1, typename _Tp2>
+ void
+ __enable_shared_from_this_helper(const __shared_count<_Lp>&,
+ const __enable_shared_from_this<_Tp1,
+ _Lp>*, const _Tp2*);
+
+ // Friend of enable_shared_from_this.
+ template<typename _Tp1, typename _Tp2>
+ void
+ __enable_shared_from_this_helper(const __shared_count<>&,
+ const enable_shared_from_this<_Tp1>*,
+ const _Tp2*);
+
+ template<_Lock_policy _Lp>
+ inline void
+ __enable_shared_from_this_helper(const __shared_count<_Lp>&, ...)
+ { }
+
+
+ template<typename _Tp, _Lock_policy _Lp>
+ class __shared_ptr
+ {
+ public:
+ typedef _Tp element_type;
+
+ /** @brief Construct an empty %__shared_ptr.
+ * @post use_count()==0 && get()==0
+ */
+ __shared_ptr()
+ : _M_ptr(0), _M_refcount() // never throws
+ { }
+
+ /** @brief Construct a %__shared_ptr that owns the pointer @a __p.
+ * @param __p A pointer that is convertible to element_type*.
+ * @post use_count() == 1 && get() == __p
+ * @throw std::bad_alloc, in which case @c delete @a __p is called.
+ */
+ template<typename _Tp1>
+ explicit
+ __shared_ptr(_Tp1* __p)
+ : _M_ptr(__p), _M_refcount(__p)
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // __glibcxx_function_requires(_CompleteConcept<_Tp1*>)
+ __enable_shared_from_this_helper(_M_refcount, __p, __p);
+ }
+
+ //
+ // Requirements: _Deleter's copy constructor and destructor must
+ // not throw
+ //
+ // __shared_ptr will release __p by calling __d(__p)
+ //
+ /** @brief Construct a %__shared_ptr that owns the pointer @a __p
+ * and the deleter @a __d.
+ * @param __p A pointer.
+ * @param __d A deleter.
+ * @post use_count() == 1 && get() == __p
+ * @throw std::bad_alloc, in which case @a __d(__p) is called.
+ */
+ template<typename _Tp1, typename _Deleter>
+ __shared_ptr(_Tp1* __p, _Deleter __d)
+ : _M_ptr(__p), _M_refcount(__p, __d)
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // TODO requires _Deleter CopyConstructible and __d(__p) well-formed
+ __enable_shared_from_this_helper(_M_refcount, __p, __p);
+ }
+
+ //
+ // Requirements: _Deleter's copy constructor and destructor must
+ // not throw _Alloc's copy constructor and destructor must not
+ // throw.
+ //
+ // __shared_ptr will release __p by calling __d(__p)
+ //
+ /** @brief Construct a %__shared_ptr that owns the pointer @a __p
+ * and the deleter @a __d.
+ * @param __p A pointer.
+ * @param __d A deleter.
+ * @param __a An allocator.
+ * @post use_count() == 1 && get() == __p
+ * @throw std::bad_alloc, in which case @a __d(__p) is called.
+ */
+ template<typename _Tp1, typename _Deleter, typename _Alloc>
+ __shared_ptr(_Tp1* __p, _Deleter __d, const _Alloc& __a)
+ : _M_ptr(__p), _M_refcount(__p, __d, __a)
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // TODO requires _Deleter CopyConstructible and __d(__p) well-formed
+ __enable_shared_from_this_helper(_M_refcount, __p, __p);
+ }
+
+ /** @brief Constructs a %__shared_ptr instance that stores @a __p
+ * and shares ownership with @a __r.
+ * @param __r A %__shared_ptr.
+ * @param __p A pointer that will remain valid while @a *__r is valid.
+ * @post get() == __p && use_count() == __r.use_count()
+ *
+ * This can be used to construct a @c shared_ptr to a sub-object
+ * of an object managed by an existing @c shared_ptr.
+ *
+ * @code
+ * shared_ptr< pair<int,int> > pii(new pair<int,int>());
+ * shared_ptr<int> pi(pii, &pii->first);
+ * assert(pii.use_count() == 2);
+ * @endcode
+ */
+ template<typename _Tp1>
+ __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r, _Tp* __p)
+ : _M_ptr(__p), _M_refcount(__r._M_refcount) // never throws
+ { }
+
+ // generated copy constructor, assignment, destructor are fine.
+
+ /** @brief If @a __r is empty, constructs an empty %__shared_ptr;
+ * otherwise construct a %__shared_ptr that shares ownership
+ * with @a __r.
+ * @param __r A %__shared_ptr.
+ * @post get() == __r.get() && use_count() == __r.use_count()
+ */
+ template<typename _Tp1>
+ __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r)
+ : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
+ { __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) }
+
+ /** @brief Move-constructs a %__shared_ptr instance from @a __r.
+ * @param __r A %__shared_ptr rvalue.
+ * @post *this contains the old value of @a __r, @a __r is empty.
+ */
+ __shared_ptr(__shared_ptr&& __r)
+ : _M_ptr(__r._M_ptr), _M_refcount() // never throws
+ {
+ _M_refcount._M_swap(__r._M_refcount);
+ __r._M_ptr = 0;
+ }
+
+ /** @brief Move-constructs a %__shared_ptr instance from @a __r.
+ * @param __r A %__shared_ptr rvalue.
+ * @post *this contains the old value of @a __r, @a __r is empty.
+ */
+ template<typename _Tp1>
+ __shared_ptr(__shared_ptr<_Tp1, _Lp>&& __r)
+ : _M_ptr(__r._M_ptr), _M_refcount() // never throws
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ _M_refcount._M_swap(__r._M_refcount);
+ __r._M_ptr = 0;
+ }
+
+ /** @brief Constructs a %__shared_ptr that shares ownership with @a __r
+ * and stores a copy of the pointer stored in @a __r.
+ * @param __r A weak_ptr.
+ * @post use_count() == __r.use_count()
+ * @throw bad_weak_ptr when __r.expired(),
+ * in which case the constructor has no effect.
+ */
+ template<typename _Tp1>
+ explicit
+ __shared_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
+ : _M_refcount(__r._M_refcount) // may throw
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // It is now safe to copy __r._M_ptr, as _M_refcount(__r._M_refcount)
+ // did not throw.
+ _M_ptr = __r._M_ptr;
+ }
+
+ template<typename _Tp1, typename _Del>
+ explicit
+ __shared_ptr(const std::unique_ptr<_Tp1, _Del>&) = delete;
+
+ /**
+ * If an exception is thrown this constructor has no effect.
+ */
+ template<typename _Tp1, typename _Del>
+ explicit
+ __shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
+ : _M_ptr(__r.get()), _M_refcount()
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ _Tp1* __tmp = __r.get();
+ _M_refcount = __shared_count<_Lp>(std::move(__r));
+ __enable_shared_from_this_helper(_M_refcount, __tmp, __tmp);
+ }
+
+#if _GLIBCXX_DEPRECATED
+ /**
+ * @post use_count() == 1 and __r.get() == 0
+ */
+ template<typename _Tp1>
+ explicit
+ __shared_ptr(std::auto_ptr<_Tp1>&& __r)
+ : _M_ptr(__r.get()), _M_refcount()
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // TODO requires _Tp1 is complete, delete __r.release() well-formed
+ _Tp1* __tmp = __r.get();
+ _M_refcount = __shared_count<_Lp>(std::move(__r));
+ __enable_shared_from_this_helper(_M_refcount, __tmp, __tmp);
+ }
+#endif
+
+ template<typename _Tp1>
+ __shared_ptr&
+ operator=(const __shared_ptr<_Tp1, _Lp>& __r) // never throws
+ {
+ _M_ptr = __r._M_ptr;
+ _M_refcount = __r._M_refcount; // __shared_count::op= doesn't throw
+ return *this;
+ }
+
+#if _GLIBCXX_DEPRECATED
+ template<typename _Tp1>
+ __shared_ptr&
+ operator=(std::auto_ptr<_Tp1>&& __r)
+ {
+ __shared_ptr(std::move(__r)).swap(*this);
+ return *this;
+ }
+#endif
+
+ __shared_ptr&
+ operator=(__shared_ptr&& __r)
+ {
+ __shared_ptr(std::move(__r)).swap(*this);
+ return *this;
+ }
+
+ template<class _Tp1>
+ __shared_ptr&
+ operator=(__shared_ptr<_Tp1, _Lp>&& __r)
+ {
+ __shared_ptr(std::move(__r)).swap(*this);
+ return *this;
+ }
+
+ template<typename _Tp1, typename _Del>
+ __shared_ptr&
+ operator=(const std::unique_ptr<_Tp1, _Del>& __r) = delete;
+
+ template<typename _Tp1, typename _Del>
+ __shared_ptr&
+ operator=(std::unique_ptr<_Tp1, _Del>&& __r)
+ {
+ __shared_ptr(std::move(__r)).swap(*this);
+ return *this;
+ }
+
+ void
+ reset() // never throws
+ { __shared_ptr().swap(*this); }
+
+ template<typename _Tp1>
+ void
+ reset(_Tp1* __p) // _Tp1 must be complete.
+ {
+ // Catch self-reset errors.
+ _GLIBCXX_DEBUG_ASSERT(__p == 0 || __p != _M_ptr);
+ __shared_ptr(__p).swap(*this);
+ }
+
+ template<typename _Tp1, typename _Deleter>
+ void
+ reset(_Tp1* __p, _Deleter __d)
+ { __shared_ptr(__p, __d).swap(*this); }
+
+ template<typename _Tp1, typename _Deleter, typename _Alloc>
+ void
+ reset(_Tp1* __p, _Deleter __d, const _Alloc& __a)
+ { __shared_ptr(__p, __d, __a).swap(*this); }
+
+ // Allow class instantiation when _Tp is [cv-qual] void.
+ typename std::add_lvalue_reference<_Tp>::type
+ operator*() const // never throws
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
+ return *_M_ptr;
+ }
+
+ _Tp*
+ operator->() const // never throws
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
+ return _M_ptr;
+ }
+
+ _Tp*
+ get() const // never throws
+ { return _M_ptr; }
+
+ // Implicit conversion to "bool"
+ private:
+ typedef _Tp* __shared_ptr::*__unspecified_bool_type;
+
+ public:
+ operator __unspecified_bool_type() const // never throws
+ { return _M_ptr == 0 ? 0 : &__shared_ptr::_M_ptr; }
+
+ bool
+ unique() const // never throws
+ { return _M_refcount._M_unique(); }
+
+ long
+ use_count() const // never throws
+ { return _M_refcount._M_get_use_count(); }
+
+ void
+ swap(__shared_ptr<_Tp, _Lp>&& __other) // never throws
+ {
+ std::swap(_M_ptr, __other._M_ptr);
+ _M_refcount._M_swap(__other._M_refcount);
+ }
+
+ template<typename _Tp1>
+ bool
+ owner_before(__shared_ptr<_Tp1, _Lp> const& __rhs) const
+ { return _M_refcount._M_less(__rhs._M_refcount); }
+
+ template<typename _Tp1>
+ bool
+ owner_before(__weak_ptr<_Tp1, _Lp> const& __rhs) const
+ { return _M_refcount._M_less(__rhs._M_refcount); }
+
+ protected:
+ // This constructor is non-standard, it is used by allocate_shared.
+ template<typename _Alloc, typename... _Args>
+ __shared_ptr(_Sp_make_shared_tag __tag, _Alloc __a, _Args&&... __args)
+ : _M_ptr(), _M_refcount(__tag, (_Tp*)0, __a,
+ std::forward<_Args>(__args)...)
+ {
+ // _M_ptr needs to point to the newly constructed object.
+ // This relies on _Sp_counted_ptr_inplace::_M_get_deleter.
+ void* __p = _M_refcount._M_get_deleter(typeid(__tag));
+ _M_ptr = static_cast<_Tp*>(__p);
+ __enable_shared_from_this_helper(_M_refcount, _M_ptr, _M_ptr);
+ }
+
+ template<typename _Tp1, _Lock_policy _Lp1, typename _Alloc,
+ typename... _Args>
+ friend __shared_ptr<_Tp1, _Lp1>
+ __allocate_shared(_Alloc __a, _Args&&... __args);
+
+ private:
+ void*
+ _M_get_deleter(const std::type_info& __ti) const
+ { return _M_refcount._M_get_deleter(__ti); }
+
+ template<typename _Tp1, _Lock_policy _Lp1> friend class __shared_ptr;
+ template<typename _Tp1, _Lock_policy _Lp1> friend class __weak_ptr;
+
+ template<typename _Del, typename _Tp1, _Lock_policy _Lp1>
+ friend _Del* get_deleter(const __shared_ptr<_Tp1, _Lp1>&);
+
+ _Tp* _M_ptr; // Contained pointer.
+ __shared_count<_Lp> _M_refcount; // Reference counter.
+ };
+
+ // 20.8.13.2.7 shared_ptr comparisons
+ template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
+ inline bool
+ operator==(const __shared_ptr<_Tp1, _Lp>& __a,
+ const __shared_ptr<_Tp2, _Lp>& __b)
+ { return __a.get() == __b.get(); }
+
+ template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
+ inline bool
+ operator!=(const __shared_ptr<_Tp1, _Lp>& __a,
+ const __shared_ptr<_Tp2, _Lp>& __b)
+ { return __a.get() != __b.get(); }
+
+ template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
+ inline bool
+ operator<(const __shared_ptr<_Tp1, _Lp>& __a,
+ const __shared_ptr<_Tp2, _Lp>& __b)
+ { return __a.get() < __b.get(); }
+
+ template<typename _Sp>
+ struct _Sp_less : public binary_function<_Sp, _Sp, bool>
+ {
+ bool
+ operator()(const _Sp& __lhs, const _Sp& __rhs) const
+ {
+ return std::less<typename _Sp::element_type*>()(__lhs.get(),
+ __rhs.get());
+ }
+ };
+
+ template<typename _Tp, _Lock_policy _Lp>
+ struct less<__shared_ptr<_Tp, _Lp>>
+ : public _Sp_less<__shared_ptr<_Tp, _Lp>>
+ { };
+
+ // XXX LessThanComparable<_Tp> concept should provide >, >= and <=
+ template<typename _Tp, _Lock_policy _Lp>
+ inline bool
+ operator>(const __shared_ptr<_Tp, _Lp>& __a,
+ const __shared_ptr<_Tp, _Lp>& __b)
+ { return __a.get() > __b.get(); }
+
+ template<typename _Tp, _Lock_policy _Lp>
+ inline bool
+ operator>=(const __shared_ptr<_Tp, _Lp>& __a,
+ const __shared_ptr<_Tp, _Lp>& __b)
+ { return __a.get() >= __b.get(); }
+
+ template<typename _Tp, _Lock_policy _Lp>
+ inline bool
+ operator<=(const __shared_ptr<_Tp, _Lp>& __a,
+ const __shared_ptr<_Tp, _Lp>& __b)
+ { return __a.get() <= __b.get(); }
+
+ // 2.2.3.8 shared_ptr specialized algorithms.
+ template<typename _Tp, _Lock_policy _Lp>
+ inline void
+ swap(__shared_ptr<_Tp, _Lp>& __a, __shared_ptr<_Tp, _Lp>& __b)
+ { __a.swap(__b); }
+
+ template<typename _Tp, _Lock_policy _Lp>
+ inline void
+ swap(__shared_ptr<_Tp, _Lp>&& __a, __shared_ptr<_Tp, _Lp>& __b)
+ { __a.swap(__b); }
+
+ template<typename _Tp, _Lock_policy _Lp>
+ inline void
+ swap(__shared_ptr<_Tp, _Lp>& __a, __shared_ptr<_Tp, _Lp>&& __b)
+ { __a.swap(__b); }
+
+ // 2.2.3.9 shared_ptr casts
+ /** @warning The seemingly equivalent
+ * <code>shared_ptr<_Tp, _Lp>(static_cast<_Tp*>(__r.get()))</code>
+ * will eventually result in undefined behaviour,
+ * attempting to delete the same object twice.
+ */
+ template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
+ inline __shared_ptr<_Tp, _Lp>
+ static_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
+ { return __shared_ptr<_Tp, _Lp>(__r, static_cast<_Tp*>(__r.get())); }
+
+ /** @warning The seemingly equivalent
+ * <code>shared_ptr<_Tp, _Lp>(const_cast<_Tp*>(__r.get()))</code>
+ * will eventually result in undefined behaviour,
+ * attempting to delete the same object twice.
+ */
+ template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
+ inline __shared_ptr<_Tp, _Lp>
+ const_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
+ { return __shared_ptr<_Tp, _Lp>(__r, const_cast<_Tp*>(__r.get())); }
+
+ /** @warning The seemingly equivalent
+ * <code>shared_ptr<_Tp, _Lp>(dynamic_cast<_Tp*>(__r.get()))</code>
+ * will eventually result in undefined behaviour,
+ * attempting to delete the same object twice.
+ */
+ template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
+ inline __shared_ptr<_Tp, _Lp>
+ dynamic_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
+ {
+ if (_Tp* __p = dynamic_cast<_Tp*>(__r.get()))
+ return __shared_ptr<_Tp, _Lp>(__r, __p);
+ return __shared_ptr<_Tp, _Lp>();
+ }
+
+ // 2.2.3.7 shared_ptr I/O
+ template<typename _Ch, typename _Tr, typename _Tp, _Lock_policy _Lp>
+ std::basic_ostream<_Ch, _Tr>&
+ operator<<(std::basic_ostream<_Ch, _Tr>& __os,
+ const __shared_ptr<_Tp, _Lp>& __p)
+ {
+ __os << __p.get();
+ return __os;
+ }
+
+ // 2.2.3.10 shared_ptr get_deleter (experimental)
+ template<typename _Del, typename _Tp, _Lock_policy _Lp>
+ inline _Del*
+ get_deleter(const __shared_ptr<_Tp, _Lp>& __p)
+ { return static_cast<_Del*>(__p._M_get_deleter(typeid(_Del))); }
+
+
+ template<typename _Tp, _Lock_policy _Lp>
+ class __weak_ptr
+ {
+ public:
+ typedef _Tp element_type;
+
+ __weak_ptr()
+ : _M_ptr(0), _M_refcount() // never throws
+ { }
+
+ // Generated copy constructor, assignment, destructor are fine.
+
+ // The "obvious" converting constructor implementation:
+ //
+ // template<typename _Tp1>
+ // __weak_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
+ // : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
+ // { }
+ //
+ // has a serious problem.
+ //
+ // __r._M_ptr may already have been invalidated. The _M_ptr(__r._M_ptr)
+ // conversion may require access to *__r._M_ptr (virtual inheritance).
+ //
+ // It is not possible to avoid spurious access violations since
+ // in multithreaded programs __r._M_ptr may be invalidated at any point.
+ template<typename _Tp1>
+ __weak_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
+ : _M_refcount(__r._M_refcount) // never throws
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ _M_ptr = __r.lock().get();
+ }
+
+ template<typename _Tp1>
+ __weak_ptr(const __shared_ptr<_Tp1, _Lp>& __r)
+ : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
+ { __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) }
+
+ template<typename _Tp1>
+ __weak_ptr&
+ operator=(const __weak_ptr<_Tp1, _Lp>& __r) // never throws
+ {
+ _M_ptr = __r.lock().get();
+ _M_refcount = __r._M_refcount;
+ return *this;
+ }
+
+ template<typename _Tp1>
+ __weak_ptr&
+ operator=(const __shared_ptr<_Tp1, _Lp>& __r) // never throws
+ {
+ _M_ptr = __r._M_ptr;
+ _M_refcount = __r._M_refcount;
+ return *this;
+ }
+
+ __shared_ptr<_Tp, _Lp>
+ lock() const // never throws
+ {
+#ifdef __GTHREADS
+ // Optimization: avoid throw overhead.
+ if (expired())
+ return __shared_ptr<element_type, _Lp>();
+
+ __try
+ {
+ return __shared_ptr<element_type, _Lp>(*this);
+ }
+ __catch(const bad_weak_ptr&)
+ {
+ // Q: How can we get here?
+ // A: Another thread may have invalidated r after the
+ // use_count test above.
+ return __shared_ptr<element_type, _Lp>();
+ }
+
+#else
+ // Optimization: avoid try/catch overhead when single threaded.
+ return expired() ? __shared_ptr<element_type, _Lp>()
+ : __shared_ptr<element_type, _Lp>(*this);
+
+#endif
+ } // XXX MT
+
+ long
+ use_count() const // never throws
+ { return _M_refcount._M_get_use_count(); }
+
+ bool
+ expired() const // never throws
+ { return _M_refcount._M_get_use_count() == 0; }
+
+ template<typename _Tp1>
+ bool
+ owner_before(const __shared_ptr<_Tp1, _Lp>& __rhs) const
+ { return _M_refcount._M_less(__rhs._M_refcount); }
+
+ template<typename _Tp1>
+ bool
+ owner_before(const __weak_ptr<_Tp1, _Lp>& __rhs) const
+ { return _M_refcount._M_less(__rhs._M_refcount); }
+
+ void
+ reset() // never throws
+ { __weak_ptr().swap(*this); }
+
+ void
+ swap(__weak_ptr& __s) // never throws
+ {
+ std::swap(_M_ptr, __s._M_ptr);
+ _M_refcount._M_swap(__s._M_refcount);
+ }
+
+ // comparisons
+ template<typename _Tp1>
+ bool operator<(const __weak_ptr<_Tp1, _Lp>&) const = delete;
+ template<typename _Tp1>
+ bool operator<=(const __weak_ptr<_Tp1, _Lp>&) const = delete;
+ template<typename _Tp1>
+ bool operator>(const __weak_ptr<_Tp1, _Lp>&) const = delete;
+ template<typename _Tp1>
+ bool operator>=(const __weak_ptr<_Tp1, _Lp>&) const = delete;
+
+ private:
+ // Used by __enable_shared_from_this.
+ void
+ _M_assign(_Tp* __ptr, const __shared_count<_Lp>& __refcount)
+ {
+ _M_ptr = __ptr;
+ _M_refcount = __refcount;
+ }
+
+ template<typename _Tp1, _Lock_policy _Lp1> friend class __shared_ptr;
+ template<typename _Tp1, _Lock_policy _Lp1> friend class __weak_ptr;
+ friend class __enable_shared_from_this<_Tp, _Lp>;
+ friend class enable_shared_from_this<_Tp>;
+
+ _Tp* _M_ptr; // Contained pointer.
+ __weak_count<_Lp> _M_refcount; // Reference counter.
+ };
+
+ // 20.8.13.3.7 weak_ptr specialized algorithms.
+ template<typename _Tp, _Lock_policy _Lp>
+ inline void
+ swap(__weak_ptr<_Tp, _Lp>& __a, __weak_ptr<_Tp, _Lp>& __b)
+ { __a.swap(__b); }
+
+ /// owner_less
+ template<typename _Tp> struct owner_less;
+
+ template<typename _Tp, typename _Tp1>
+ struct _Sp_owner_less : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __lhs, const _Tp& __rhs) const
+ { return __lhs.owner_before(__rhs); }
+ bool
+ operator()(const _Tp& __lhs, const _Tp1& __rhs) const
+ { return __lhs.owner_before(__rhs); }
+ bool
+ operator()(const _Tp1& __lhs, const _Tp& __rhs) const
+ { return __lhs.owner_before(__rhs); }
+ };
+
+ template<typename _Tp, _Lock_policy _Lp>
+ struct owner_less<__shared_ptr<_Tp, _Lp>>
+ : public _Sp_owner_less<__shared_ptr<_Tp, _Lp>, __weak_ptr<_Tp, _Lp>>
+ { };
+
+ template<typename _Tp, _Lock_policy _Lp>
+ struct owner_less<__weak_ptr<_Tp, _Lp>>
+ : public _Sp_owner_less<__weak_ptr<_Tp, _Lp>, __shared_ptr<_Tp, _Lp>>
+ {
+ };
+
+
+ template<typename _Tp, _Lock_policy _Lp>
+ class __enable_shared_from_this
+ {
+ protected:
+ __enable_shared_from_this() { }
+
+ __enable_shared_from_this(const __enable_shared_from_this&) { }
+
+ __enable_shared_from_this&
+ operator=(const __enable_shared_from_this&)
+ { return *this; }
+
+ ~__enable_shared_from_this() { }
+
+ public:
+ __shared_ptr<_Tp, _Lp>
+ shared_from_this()
+ { return __shared_ptr<_Tp, _Lp>(this->_M_weak_this); }
+
+ __shared_ptr<const _Tp, _Lp>
+ shared_from_this() const
+ { return __shared_ptr<const _Tp, _Lp>(this->_M_weak_this); }
+
+ private:
+ template<typename _Tp1>
+ void
+ _M_weak_assign(_Tp1* __p, const __shared_count<_Lp>& __n) const
+ { _M_weak_this._M_assign(__p, __n); }
+
+ template<typename _Tp1>
+ friend void
+ __enable_shared_from_this_helper(const __shared_count<_Lp>& __pn,
+ const __enable_shared_from_this* __pe,
+ const _Tp1* __px)
+ {
+ if (__pe != 0)
+ __pe->_M_weak_assign(const_cast<_Tp1*>(__px), __pn);
+ }
+
+ mutable __weak_ptr<_Tp, _Lp> _M_weak_this;
+ };
+
+ /**
+ * @brief A smart pointer with reference-counted copy semantics.
+ *
+ * The object pointed to is deleted when the last shared_ptr pointing to
+ * it is destroyed or reset.
+ */
+ template<typename _Tp>
+ class shared_ptr
+ : public __shared_ptr<_Tp>
+ {
+ public:
+ shared_ptr()
+ : __shared_ptr<_Tp>() { }
+
+ template<typename _Tp1>
+ explicit
+ shared_ptr(_Tp1* __p)
+ : __shared_ptr<_Tp>(__p) { }
+
+ template<typename _Tp1, typename _Deleter>
+ shared_ptr(_Tp1* __p, _Deleter __d)
+ : __shared_ptr<_Tp>(__p, __d) { }
+
+ template<typename _Tp1, typename _Deleter, typename _Alloc>
+ shared_ptr(_Tp1* __p, _Deleter __d, const _Alloc& __a)
+ : __shared_ptr<_Tp>(__p, __d, __a) { }
+
+ // Aliasing constructor
+ template<typename _Tp1>
+ shared_ptr(const shared_ptr<_Tp1>& __r, _Tp* __p)
+ : __shared_ptr<_Tp>(__r, __p) { }
+
+ template<typename _Tp1>
+ shared_ptr(const shared_ptr<_Tp1>& __r)
+ : __shared_ptr<_Tp>(__r) { }
+
+ shared_ptr(shared_ptr&& __r)
+ : __shared_ptr<_Tp>(std::move(__r)) { }
+
+ template<typename _Tp1>
+ shared_ptr(shared_ptr<_Tp1>&& __r)
+ : __shared_ptr<_Tp>(std::move(__r)) { }
+
+ template<typename _Tp1>
+ explicit
+ shared_ptr(const weak_ptr<_Tp1>& __r)
+ : __shared_ptr<_Tp>(__r) { }
+
+#if _GLIBCXX_DEPRECATED
+ template<typename _Tp1>
+ explicit
+ shared_ptr(std::auto_ptr<_Tp1>&& __r)
+ : __shared_ptr<_Tp>(std::move(__r)) { }
+#endif
+
+ template<typename _Tp1, typename _Del>
+ explicit
+ shared_ptr(const std::unique_ptr<_Tp1, _Del>&) = delete;
+
+ template<typename _Tp1, typename _Del>
+ explicit
+ shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
+ : __shared_ptr<_Tp>(std::move(__r)) { }
+
+ template<typename _Tp1>
+ shared_ptr&
+ operator=(const shared_ptr<_Tp1>& __r) // never throws
+ {
+ this->__shared_ptr<_Tp>::operator=(__r);
+ return *this;
+ }
+
+#if _GLIBCXX_DEPRECATED
+ template<typename _Tp1>
+ shared_ptr&
+ operator=(std::auto_ptr<_Tp1>&& __r)
+ {
+ this->__shared_ptr<_Tp>::operator=(std::move(__r));
+ return *this;
+ }
+#endif
+
+ shared_ptr&
+ operator=(shared_ptr&& __r)
+ {
+ this->__shared_ptr<_Tp>::operator=(std::move(__r));
+ return *this;
+ }
+
+ template<class _Tp1>
+ shared_ptr&
+ operator=(shared_ptr<_Tp1>&& __r)
+ {
+ this->__shared_ptr<_Tp>::operator=(std::move(__r));
+ return *this;
+ }
+
+ template<typename _Tp1, typename _Del>
+ shared_ptr&
+ operator=(const std::unique_ptr<_Tp1, _Del>& __r) = delete;
+
+ template<typename _Tp1, typename _Del>
+ shared_ptr&
+ operator=(std::unique_ptr<_Tp1, _Del>&& __r)
+ {
+ this->__shared_ptr<_Tp>::operator=(std::move(__r));
+ return *this;
+ }
+
+ private:
+ // This constructor is non-standard, it is used by allocate_shared.
+ template<typename _Alloc, typename... _Args>
+ shared_ptr(_Sp_make_shared_tag __tag, _Alloc __a, _Args&&... __args)
+ : __shared_ptr<_Tp>(__tag, __a, std::forward<_Args>(__args)...)
+ { }
+
+ template<typename _Tp1, typename _Alloc, typename... _Args>
+ friend shared_ptr<_Tp1>
+ allocate_shared(_Alloc __a, _Args&&... __args);
+ };
+
+ // 20.8.13.2.7 shared_ptr comparisons
+ template<typename _Tp1, typename _Tp2>
+ inline bool
+ operator==(const shared_ptr<_Tp1>& __a, const shared_ptr<_Tp2>& __b)
+ { return __a.get() == __b.get(); }
+
+ template<typename _Tp1, typename _Tp2>
+ inline bool
+ operator!=(const shared_ptr<_Tp1>& __a, const shared_ptr<_Tp2>& __b)
+ { return __a.get() != __b.get(); }
+
+ template<typename _Tp1, typename _Tp2>
+ inline bool
+ operator<(const shared_ptr<_Tp1>& __a, const shared_ptr<_Tp2>& __b)
+ { return __a.get() < __b.get(); }
+
+ template<typename _Tp>
+ struct less<shared_ptr<_Tp>>
+ : public _Sp_less<shared_ptr<_Tp>>
+ { };
+
+ // 20.8.13.2.9 shared_ptr specialized algorithms.
+ template<typename _Tp>
+ inline void
+ swap(shared_ptr<_Tp>& __a, shared_ptr<_Tp>& __b)
+ { __a.swap(__b); }
+
+ template<typename _Tp>
+ inline void
+ swap(shared_ptr<_Tp>&& __a, shared_ptr<_Tp>& __b)
+ { __a.swap(__b); }
+
+ template<typename _Tp>
+ inline void
+ swap(shared_ptr<_Tp>& __a, shared_ptr<_Tp>&& __b)
+ { __a.swap(__b); }
+
+ // 20.8.13.2.10 shared_ptr casts.
+ template<typename _Tp, typename _Tp1>
+ inline shared_ptr<_Tp>
+ static_pointer_cast(const shared_ptr<_Tp1>& __r)
+ { return shared_ptr<_Tp>(__r, static_cast<_Tp*>(__r.get())); }
+
+ template<typename _Tp, typename _Tp1>
+ inline shared_ptr<_Tp>
+ const_pointer_cast(const shared_ptr<_Tp1>& __r)
+ { return shared_ptr<_Tp>(__r, const_cast<_Tp*>(__r.get())); }
+
+ template<typename _Tp, typename _Tp1>
+ inline shared_ptr<_Tp>
+ dynamic_pointer_cast(const shared_ptr<_Tp1>& __r)
+ {
+ if (_Tp* __p = dynamic_cast<_Tp*>(__r.get()))
+ return shared_ptr<_Tp>(__r, __p);
+ return shared_ptr<_Tp>();
+ }
+
+
+ /**
+ * @brief A smart pointer with weak semantics.
+ *
+ * With forwarding constructors and assignment operators.
+ */
+ template<typename _Tp>
+ class weak_ptr
+ : public __weak_ptr<_Tp>
+ {
+ public:
+ weak_ptr()
+ : __weak_ptr<_Tp>() { }
+
+ template<typename _Tp1>
+ weak_ptr(const weak_ptr<_Tp1>& __r)
+ : __weak_ptr<_Tp>(__r) { }
+
+ template<typename _Tp1>
+ weak_ptr(const shared_ptr<_Tp1>& __r)
+ : __weak_ptr<_Tp>(__r) { }
+
+ template<typename _Tp1>
+ weak_ptr&
+ operator=(const weak_ptr<_Tp1>& __r) // never throws
+ {
+ this->__weak_ptr<_Tp>::operator=(__r);
+ return *this;
+ }
+
+ template<typename _Tp1>
+ weak_ptr&
+ operator=(const shared_ptr<_Tp1>& __r) // never throws
+ {
+ this->__weak_ptr<_Tp>::operator=(__r);
+ return *this;
+ }
+
+ shared_ptr<_Tp>
+ lock() const // never throws
+ {
+#ifdef __GTHREADS
+ if (this->expired())
+ return shared_ptr<_Tp>();
+
+ __try
+ {
+ return shared_ptr<_Tp>(*this);
+ }
+ __catch(const bad_weak_ptr&)
+ {
+ return shared_ptr<_Tp>();
+ }
+#else
+ return this->expired() ? shared_ptr<_Tp>()
+ : shared_ptr<_Tp>(*this);
+#endif
+ }
+
+ // comparisons
+ template<typename _Tp1>
+ bool operator<(const weak_ptr<_Tp1>&) const = delete;
+ template<typename _Tp1>
+ bool operator<=(const weak_ptr<_Tp1>&) const = delete;
+ template<typename _Tp1>
+ bool operator>(const weak_ptr<_Tp1>&) const = delete;
+ template<typename _Tp1>
+ bool operator>=(const weak_ptr<_Tp1>&) const = delete;
+ };
+
+ // 20.8.13.3.7 weak_ptr specialized algorithms.
+ template<typename _Tp>
+ inline void
+ swap(weak_ptr<_Tp>& __a, weak_ptr<_Tp>& __b)
+ { __a.swap(__b); }
+
+ /// owner_less
+ template<typename _Tp>
+ struct owner_less<shared_ptr<_Tp>>
+ : public _Sp_owner_less<shared_ptr<_Tp>, weak_ptr<_Tp>>
+ { };
+
+ template<typename _Tp>
+ struct owner_less<weak_ptr<_Tp>>
+ : public _Sp_owner_less<weak_ptr<_Tp>, shared_ptr<_Tp>>
+ { };
+
+ /**
+ * @brief Base class allowing use of member function shared_from_this.
+ */
+ template<typename _Tp>
+ class enable_shared_from_this
+ {
+ protected:
+ enable_shared_from_this() { }
+
+ enable_shared_from_this(const enable_shared_from_this&) { }
+
+ enable_shared_from_this&
+ operator=(const enable_shared_from_this&)
+ { return *this; }
+
+ ~enable_shared_from_this() { }
+
+ public:
+ shared_ptr<_Tp>
+ shared_from_this()
+ { return shared_ptr<_Tp>(this->_M_weak_this); }
+
+ shared_ptr<const _Tp>
+ shared_from_this() const
+ { return shared_ptr<const _Tp>(this->_M_weak_this); }
+
+ private:
+ template<typename _Tp1>
+ void
+ _M_weak_assign(_Tp1* __p, const __shared_count<>& __n) const
+ { _M_weak_this._M_assign(__p, __n); }
+
+ template<typename _Tp1>
+ friend void
+ __enable_shared_from_this_helper(const __shared_count<>& __pn,
+ const enable_shared_from_this* __pe,
+ const _Tp1* __px)
+ {
+ if (__pe != 0)
+ __pe->_M_weak_assign(const_cast<_Tp1*>(__px), __pn);
+ }
+
+ mutable weak_ptr<_Tp> _M_weak_this;
+ };
+
+ template<typename _Tp, _Lock_policy _Lp, typename _Alloc, typename... _Args>
+ inline __shared_ptr<_Tp, _Lp>
+ __allocate_shared(_Alloc __a, _Args&&... __args)
+ {
+ return __shared_ptr<_Tp, _Lp>(_Sp_make_shared_tag(),
+ std::forward<_Alloc>(__a), std::forward<_Args>(__args)...);
+ }
+
+ template<typename _Tp, _Lock_policy _Lp, typename... _Args>
+ inline __shared_ptr<_Tp, _Lp>
+ __make_shared(_Args&&... __args)
+ {
+ typedef typename std::remove_const<_Tp>::type _Tp_nc;
+ return __allocate_shared<_Tp, _Lp>(std::allocator<_Tp_nc>(),
+ std::forward<_Args>(__args)...);
+ }
+
+ /** @brief Create an object that is owned by a shared_ptr.
+ * @param __a An allocator.
+ * @param __args Arguments for the @a _Tp object's constructor.
+ * @return A shared_ptr that owns the newly created object.
+ * @throw An exception thrown from @a _Alloc::allocate or from the
+ * constructor of @a _Tp.
+ *
+ * A copy of @a __a will be used to allocate memory for the shared_ptr
+ * and the new object.
+ */
+ template<typename _Tp, typename _Alloc, typename... _Args>
+ inline shared_ptr<_Tp>
+ allocate_shared(_Alloc __a, _Args&&... __args)
+ {
+ return shared_ptr<_Tp>(_Sp_make_shared_tag(), std::forward<_Alloc>(__a),
+ std::forward<_Args>(__args)...);
+ }
+
+ /** @brief Create an object that is owned by a shared_ptr.
+ * @param __args Arguments for the @a _Tp object's constructor.
+ * @return A shared_ptr that owns the newly created object.
+ * @throw std::bad_alloc, or an exception thrown from the
+ * constructor of @a _Tp.
+ */
+ template<typename _Tp, typename... _Args>
+ inline shared_ptr<_Tp>
+ make_shared(_Args&&... __args)
+ {
+ typedef typename std::remove_const<_Tp>::type _Tp_nc;
+ return allocate_shared<_Tp>(std::allocator<_Tp_nc>(),
+ std::forward<_Args>(__args)...);
+ }
+
+ // @} group pointer_abstractions
+
+_GLIBCXX_END_NAMESPACE
+
+#endif // _SHARED_PTR_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/slice_array.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/slice_array.h
new file mode 100644
index 0000000..566c764
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/slice_array.h
@@ -0,0 +1,272 @@
+// The template and inlines for the -*- C++ -*- slice_array class.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file slice_array.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
+
+#ifndef _SLICE_ARRAY_H
+#define _SLICE_ARRAY_H 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @addtogroup numeric_arrays
+ * @{
+ */
+
+ /**
+ * @brief Class defining one-dimensional subset of an array.
+ *
+ * The slice class represents a one-dimensional subset of an array,
+ * specified by three parameters: start offset, size, and stride. The
+ * start offset is the index of the first element of the array that is part
+ * of the subset. The size is the total number of elements in the subset.
+ * Stride is the distance between each successive array element to include
+ * in the subset.
+ *
+ * For example, with an array of size 10, and a slice with offset 1, size 3
+ * and stride 2, the subset consists of array elements 1, 3, and 5.
+ */
+ class slice
+ {
+ public:
+ /// Construct an empty slice.
+ slice();
+
+ /**
+ * @brief Construct a slice.
+ *
+ * @param o Offset in array of first element.
+ * @param d Number of elements in slice.
+ * @param s Stride between array elements.
+ */
+ slice(size_t, size_t, size_t);
+
+ /// Return array offset of first slice element.
+ size_t start() const;
+ /// Return size of slice.
+ size_t size() const;
+ /// Return array stride of slice.
+ size_t stride() const;
+
+ private:
+ size_t _M_off; // offset
+ size_t _M_sz; // size
+ size_t _M_st; // stride unit
+ };
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 543. valarray slice default constructor
+ inline
+ slice::slice()
+ : _M_off(0), _M_sz(0), _M_st(0) {}
+
+ inline
+ slice::slice(size_t __o, size_t __d, size_t __s)
+ : _M_off(__o), _M_sz(__d), _M_st(__s) {}
+
+ inline size_t
+ slice::start() const
+ { return _M_off; }
+
+ inline size_t
+ slice::size() const
+ { return _M_sz; }
+
+ inline size_t
+ slice::stride() const
+ { return _M_st; }
+
+ /**
+ * @brief Reference to one-dimensional subset of an array.
+ *
+ * A slice_array is a reference to the actual elements of an array
+ * specified by a slice. The way to get a slice_array is to call
+ * operator[](slice) on a valarray. The returned slice_array then permits
+ * carrying operations out on the referenced subset of elements in the
+ * original valarray. For example, operator+=(valarray) will add values
+ * to the subset of elements in the underlying valarray this slice_array
+ * refers to.
+ *
+ * @param Tp Element type.
+ */
+ template<typename _Tp>
+ class slice_array
+ {
+ public:
+ typedef _Tp value_type;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 253. valarray helper functions are almost entirely useless
+
+ /// Copy constructor. Both slices refer to the same underlying array.
+ slice_array(const slice_array&);
+
+ /// Assignment operator. Assigns slice elements to corresponding
+ /// elements of @a a.
+ slice_array& operator=(const slice_array&);
+
+ /// Assign slice elements to corresponding elements of @a v.
+ void operator=(const valarray<_Tp>&) const;
+ /// Multiply slice elements by corresponding elements of @a v.
+ void operator*=(const valarray<_Tp>&) const;
+ /// Divide slice elements by corresponding elements of @a v.
+ void operator/=(const valarray<_Tp>&) const;
+ /// Modulo slice elements by corresponding elements of @a v.
+ void operator%=(const valarray<_Tp>&) const;
+ /// Add corresponding elements of @a v to slice elements.
+ void operator+=(const valarray<_Tp>&) const;
+ /// Subtract corresponding elements of @a v from slice elements.
+ void operator-=(const valarray<_Tp>&) const;
+ /// Logical xor slice elements with corresponding elements of @a v.
+ void operator^=(const valarray<_Tp>&) const;
+ /// Logical and slice elements with corresponding elements of @a v.
+ void operator&=(const valarray<_Tp>&) const;
+ /// Logical or slice elements with corresponding elements of @a v.
+ void operator|=(const valarray<_Tp>&) const;
+ /// Left shift slice elements by corresponding elements of @a v.
+ void operator<<=(const valarray<_Tp>&) const;
+ /// Right shift slice elements by corresponding elements of @a v.
+ void operator>>=(const valarray<_Tp>&) const;
+ /// Assign all slice elements to @a t.
+ void operator=(const _Tp &) const;
+ // ~slice_array ();
+
+ template<class _Dom>
+ void operator=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator*=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator/=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator%=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator+=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator-=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator^=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator&=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator|=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator<<=(const _Expr<_Dom, _Tp>&) const;
+ template<class _Dom>
+ void operator>>=(const _Expr<_Dom, _Tp>&) const;
+
+ private:
+ friend class valarray<_Tp>;
+ slice_array(_Array<_Tp>, const slice&);
+
+ const size_t _M_sz;
+ const size_t _M_stride;
+ const _Array<_Tp> _M_array;
+
+ // not implemented
+ slice_array();
+ };
+
+ template<typename _Tp>
+ inline
+ slice_array<_Tp>::slice_array(_Array<_Tp> __a, const slice& __s)
+ : _M_sz(__s.size()), _M_stride(__s.stride()),
+ _M_array(__a.begin() + __s.start()) {}
+
+ template<typename _Tp>
+ inline
+ slice_array<_Tp>::slice_array(const slice_array<_Tp>& a)
+ : _M_sz(a._M_sz), _M_stride(a._M_stride), _M_array(a._M_array) {}
+
+ // template<typename _Tp>
+ // inline slice_array<_Tp>::~slice_array () {}
+
+ template<typename _Tp>
+ inline slice_array<_Tp>&
+ slice_array<_Tp>::operator=(const slice_array<_Tp>& __a)
+ {
+ std::__valarray_copy(__a._M_array, __a._M_sz, __a._M_stride,
+ _M_array, _M_stride);
+ return *this;
+ }
+
+ template<typename _Tp>
+ inline void
+ slice_array<_Tp>::operator=(const _Tp& __t) const
+ { std::__valarray_fill(_M_array, _M_sz, _M_stride, __t); }
+
+ template<typename _Tp>
+ inline void
+ slice_array<_Tp>::operator=(const valarray<_Tp>& __v) const
+ { std::__valarray_copy(_Array<_Tp>(__v), _M_array, _M_sz, _M_stride); }
+
+ template<typename _Tp>
+ template<class _Dom>
+ inline void
+ slice_array<_Tp>::operator=(const _Expr<_Dom,_Tp>& __e) const
+ { std::__valarray_copy(__e, _M_sz, _M_array, _M_stride); }
+
+#undef _DEFINE_VALARRAY_OPERATOR
+#define _DEFINE_VALARRAY_OPERATOR(_Op,_Name) \
+ template<typename _Tp> \
+ inline void \
+ slice_array<_Tp>::operator _Op##=(const valarray<_Tp>& __v) const \
+ { \
+ _Array_augmented_##_Name(_M_array, _M_sz, _M_stride, _Array<_Tp>(__v));\
+ } \
+ \
+ template<typename _Tp> \
+ template<class _Dom> \
+ inline void \
+ slice_array<_Tp>::operator _Op##=(const _Expr<_Dom,_Tp>& __e) const\
+ { \
+ _Array_augmented_##_Name(_M_array, _M_stride, __e, _M_sz); \
+ }
+
+
+_DEFINE_VALARRAY_OPERATOR(*, __multiplies)
+_DEFINE_VALARRAY_OPERATOR(/, __divides)
+_DEFINE_VALARRAY_OPERATOR(%, __modulus)
+_DEFINE_VALARRAY_OPERATOR(+, __plus)
+_DEFINE_VALARRAY_OPERATOR(-, __minus)
+_DEFINE_VALARRAY_OPERATOR(^, __bitwise_xor)
+_DEFINE_VALARRAY_OPERATOR(&, __bitwise_and)
+_DEFINE_VALARRAY_OPERATOR(|, __bitwise_or)
+_DEFINE_VALARRAY_OPERATOR(<<, __shift_left)
+_DEFINE_VALARRAY_OPERATOR(>>, __shift_right)
+
+#undef _DEFINE_VALARRAY_OPERATOR
+
+ // @} group numeric_arrays
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _SLICE_ARRAY_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/sstream.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/sstream.tcc
new file mode 100644
index 0000000..0f9db8e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/sstream.tcc
@@ -0,0 +1,273 @@
+// String based streams -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file sstream.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 27.7 String-based streams
+//
+
+#ifndef _SSTREAM_TCC
+#define _SSTREAM_TCC 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template <class _CharT, class _Traits, class _Alloc>
+ typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
+ basic_stringbuf<_CharT, _Traits, _Alloc>::
+ pbackfail(int_type __c)
+ {
+ int_type __ret = traits_type::eof();
+ if (this->eback() < this->gptr())
+ {
+ // Try to put back __c into input sequence in one of three ways.
+ // Order these tests done in is unspecified by the standard.
+ const bool __testeof = traits_type::eq_int_type(__c, __ret);
+ if (!__testeof)
+ {
+ const bool __testeq = traits_type::eq(traits_type::
+ to_char_type(__c),
+ this->gptr()[-1]);
+ const bool __testout = this->_M_mode & ios_base::out;
+ if (__testeq || __testout)
+ {
+ this->gbump(-1);
+ if (!__testeq)
+ *this->gptr() = traits_type::to_char_type(__c);
+ __ret = __c;
+ }
+ }
+ else
+ {
+ this->gbump(-1);
+ __ret = traits_type::not_eof(__c);
+ }
+ }
+ return __ret;
+ }
+
+ template <class _CharT, class _Traits, class _Alloc>
+ typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
+ basic_stringbuf<_CharT, _Traits, _Alloc>::
+ overflow(int_type __c)
+ {
+ const bool __testout = this->_M_mode & ios_base::out;
+ if (__builtin_expect(!__testout, false))
+ return traits_type::eof();
+
+ const bool __testeof = traits_type::eq_int_type(__c, traits_type::eof());
+ if (__builtin_expect(__testeof, false))
+ return traits_type::not_eof(__c);
+
+ const __size_type __capacity = _M_string.capacity();
+ const __size_type __max_size = _M_string.max_size();
+ const bool __testput = this->pptr() < this->epptr();
+ if (__builtin_expect(!__testput && __capacity == __max_size, false))
+ return traits_type::eof();
+
+ // Try to append __c into output sequence in one of two ways.
+ // Order these tests done in is unspecified by the standard.
+ const char_type __conv = traits_type::to_char_type(__c);
+ if (!__testput)
+ {
+ // NB: Start ostringstream buffers at 512 chars. This is an
+ // experimental value (pronounced "arbitrary" in some of the
+ // hipper English-speaking countries), and can be changed to
+ // suit particular needs.
+ //
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 169. Bad efficiency of overflow() mandated
+ // 432. stringbuf::overflow() makes only one write position
+ // available
+ const __size_type __opt_len = std::max(__size_type(2 * __capacity),
+ __size_type(512));
+ const __size_type __len = std::min(__opt_len, __max_size);
+ __string_type __tmp;
+ __tmp.reserve(__len);
+ if (this->pbase())
+ __tmp.assign(this->pbase(), this->epptr() - this->pbase());
+ __tmp.push_back(__conv);
+ _M_string.swap(__tmp);
+ _M_sync(const_cast<char_type*>(_M_string.data()),
+ this->gptr() - this->eback(), this->pptr() - this->pbase());
+ }
+ else
+ *this->pptr() = __conv;
+ this->pbump(1);
+ return __c;
+ }
+
+ template <class _CharT, class _Traits, class _Alloc>
+ typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
+ basic_stringbuf<_CharT, _Traits, _Alloc>::
+ underflow()
+ {
+ int_type __ret = traits_type::eof();
+ const bool __testin = this->_M_mode & ios_base::in;
+ if (__testin)
+ {
+ // Update egptr() to match the actual string end.
+ _M_update_egptr();
+
+ if (this->gptr() < this->egptr())
+ __ret = traits_type::to_int_type(*this->gptr());
+ }
+ return __ret;
+ }
+
+ template <class _CharT, class _Traits, class _Alloc>
+ typename basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type
+ basic_stringbuf<_CharT, _Traits, _Alloc>::
+ seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode)
+ {
+ pos_type __ret = pos_type(off_type(-1));
+ bool __testin = (ios_base::in & this->_M_mode & __mode) != 0;
+ bool __testout = (ios_base::out & this->_M_mode & __mode) != 0;
+ const bool __testboth = __testin && __testout && __way != ios_base::cur;
+ __testin &= !(__mode & ios_base::out);
+ __testout &= !(__mode & ios_base::in);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 453. basic_stringbuf::seekoff need not always fail for an empty stream.
+ const char_type* __beg = __testin ? this->eback() : this->pbase();
+ if ((__beg || !__off) && (__testin || __testout || __testboth))
+ {
+ _M_update_egptr();
+
+ off_type __newoffi = __off;
+ off_type __newoffo = __newoffi;
+ if (__way == ios_base::cur)
+ {
+ __newoffi += this->gptr() - __beg;
+ __newoffo += this->pptr() - __beg;
+ }
+ else if (__way == ios_base::end)
+ __newoffo = __newoffi += this->egptr() - __beg;
+
+ if ((__testin || __testboth)
+ && __newoffi >= 0
+ && this->egptr() - __beg >= __newoffi)
+ {
+ this->gbump((__beg + __newoffi) - this->gptr());
+ __ret = pos_type(__newoffi);
+ }
+ if ((__testout || __testboth)
+ && __newoffo >= 0
+ && this->egptr() - __beg >= __newoffo)
+ {
+ this->pbump((__beg + __newoffo) - this->pptr());
+ __ret = pos_type(__newoffo);
+ }
+ }
+ return __ret;
+ }
+
+ template <class _CharT, class _Traits, class _Alloc>
+ typename basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type
+ basic_stringbuf<_CharT, _Traits, _Alloc>::
+ seekpos(pos_type __sp, ios_base::openmode __mode)
+ {
+ pos_type __ret = pos_type(off_type(-1));
+ const bool __testin = (ios_base::in & this->_M_mode & __mode) != 0;
+ const bool __testout = (ios_base::out & this->_M_mode & __mode) != 0;
+
+ const char_type* __beg = __testin ? this->eback() : this->pbase();
+ if ((__beg || !off_type(__sp)) && (__testin || __testout))
+ {
+ _M_update_egptr();
+
+ const off_type __pos(__sp);
+ const bool __testpos = (0 <= __pos
+ && __pos <= this->egptr() - __beg);
+ if (__testpos)
+ {
+ if (__testin)
+ this->gbump((__beg + __pos) - this->gptr());
+ if (__testout)
+ this->pbump((__beg + __pos) - this->pptr());
+ __ret = __sp;
+ }
+ }
+ return __ret;
+ }
+
+ template <class _CharT, class _Traits, class _Alloc>
+ void
+ basic_stringbuf<_CharT, _Traits, _Alloc>::
+ _M_sync(char_type* __base, __size_type __i, __size_type __o)
+ {
+ const bool __testin = _M_mode & ios_base::in;
+ const bool __testout = _M_mode & ios_base::out;
+ char_type* __endg = __base + _M_string.size();
+ char_type* __endp = __base + _M_string.capacity();
+
+ if (__base != _M_string.data())
+ {
+ // setbuf: __i == size of buffer area (_M_string.size() == 0).
+ __endg += __i;
+ __i = 0;
+ __endp = __endg;
+ }
+
+ if (__testin)
+ this->setg(__base, __base + __i, __endg);
+ if (__testout)
+ {
+ this->setp(__base, __endp);
+ this->pbump(__o);
+ // egptr() always tracks the string end. When !__testin,
+ // for the correct functioning of the streambuf inlines
+ // the other get area pointers are identical.
+ if (!__testin)
+ this->setg(__endg, __endg, __endg);
+ }
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class basic_stringbuf<char>;
+ extern template class basic_istringstream<char>;
+ extern template class basic_ostringstream<char>;
+ extern template class basic_stringstream<char>;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class basic_stringbuf<wchar_t>;
+ extern template class basic_istringstream<wchar_t>;
+ extern template class basic_ostringstream<wchar_t>;
+ extern template class basic_stringstream<wchar_t>;
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_algo.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_algo.h
new file mode 100644
index 0000000..6418ebf
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_algo.h
@@ -0,0 +1,6090 @@
+// Algorithm implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_algo.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_ALGO_H
+#define _STL_ALGO_H 1
+
+#include <cstdlib> // for rand
+#include <bits/algorithmfwd.h>
+#include <bits/stl_heap.h>
+#include <bits/stl_tempbuf.h> // for _Temporary_buffer
+#include <debug/debug.h>
+#include <initializer_list>
+
+// See concept_check.h for the __glibcxx_*_requires macros.
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @brief Find the median of three values.
+ * @param a A value.
+ * @param b A value.
+ * @param c A value.
+ * @return One of @p a, @p b or @p c.
+ *
+ * If @c {l,m,n} is some convolution of @p {a,b,c} such that @c l<=m<=n
+ * then the value returned will be @c m.
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ */
+ template<typename _Tp>
+ inline const _Tp&
+ __median(const _Tp& __a, const _Tp& __b, const _Tp& __c)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
+ if (__a < __b)
+ if (__b < __c)
+ return __b;
+ else if (__a < __c)
+ return __c;
+ else
+ return __a;
+ else if (__a < __c)
+ return __a;
+ else if (__b < __c)
+ return __c;
+ else
+ return __b;
+ }
+
+ /**
+ * @brief Find the median of three values using a predicate for comparison.
+ * @param a A value.
+ * @param b A value.
+ * @param c A value.
+ * @param comp A binary predicate.
+ * @return One of @p a, @p b or @p c.
+ *
+ * If @c {l,m,n} is some convolution of @p {a,b,c} such that @p comp(l,m)
+ * and @p comp(m,n) are both true then the value returned will be @c m.
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ */
+ template<typename _Tp, typename _Compare>
+ inline const _Tp&
+ __median(const _Tp& __a, const _Tp& __b, const _Tp& __c, _Compare __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BinaryFunctionConcept<_Compare, bool,
+ _Tp, _Tp>)
+ if (__comp(__a, __b))
+ if (__comp(__b, __c))
+ return __b;
+ else if (__comp(__a, __c))
+ return __c;
+ else
+ return __a;
+ else if (__comp(__a, __c))
+ return __a;
+ else if (__comp(__b, __c))
+ return __c;
+ else
+ return __b;
+ }
+
+ // for_each
+
+ /// This is an overload used by find() for the Input Iterator case.
+ template<typename _InputIterator, typename _Tp>
+ inline _InputIterator
+ __find(_InputIterator __first, _InputIterator __last,
+ const _Tp& __val, input_iterator_tag)
+ {
+ while (__first != __last && !(*__first == __val))
+ ++__first;
+ return __first;
+ }
+
+ /// This is an overload used by find_if() for the Input Iterator case.
+ template<typename _InputIterator, typename _Predicate>
+ inline _InputIterator
+ __find_if(_InputIterator __first, _InputIterator __last,
+ _Predicate __pred, input_iterator_tag)
+ {
+ while (__first != __last && !bool(__pred(*__first)))
+ ++__first;
+ return __first;
+ }
+
+ /// This is an overload used by find() for the RAI case.
+ template<typename _RandomAccessIterator, typename _Tp>
+ _RandomAccessIterator
+ __find(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ const _Tp& __val, random_access_iterator_tag)
+ {
+ typename iterator_traits<_RandomAccessIterator>::difference_type
+ __trip_count = (__last - __first) >> 2;
+
+ for (; __trip_count > 0; --__trip_count)
+ {
+ if (*__first == __val)
+ return __first;
+ ++__first;
+
+ if (*__first == __val)
+ return __first;
+ ++__first;
+
+ if (*__first == __val)
+ return __first;
+ ++__first;
+
+ if (*__first == __val)
+ return __first;
+ ++__first;
+ }
+
+ switch (__last - __first)
+ {
+ case 3:
+ if (*__first == __val)
+ return __first;
+ ++__first;
+ case 2:
+ if (*__first == __val)
+ return __first;
+ ++__first;
+ case 1:
+ if (*__first == __val)
+ return __first;
+ ++__first;
+ case 0:
+ default:
+ return __last;
+ }
+ }
+
+ /// This is an overload used by find_if() for the RAI case.
+ template<typename _RandomAccessIterator, typename _Predicate>
+ _RandomAccessIterator
+ __find_if(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Predicate __pred, random_access_iterator_tag)
+ {
+ typename iterator_traits<_RandomAccessIterator>::difference_type
+ __trip_count = (__last - __first) >> 2;
+
+ for (; __trip_count > 0; --__trip_count)
+ {
+ if (__pred(*__first))
+ return __first;
+ ++__first;
+
+ if (__pred(*__first))
+ return __first;
+ ++__first;
+
+ if (__pred(*__first))
+ return __first;
+ ++__first;
+
+ if (__pred(*__first))
+ return __first;
+ ++__first;
+ }
+
+ switch (__last - __first)
+ {
+ case 3:
+ if (__pred(*__first))
+ return __first;
+ ++__first;
+ case 2:
+ if (__pred(*__first))
+ return __first;
+ ++__first;
+ case 1:
+ if (__pred(*__first))
+ return __first;
+ ++__first;
+ case 0:
+ default:
+ return __last;
+ }
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /// This is an overload used by find_if_not() for the Input Iterator case.
+ template<typename _InputIterator, typename _Predicate>
+ inline _InputIterator
+ __find_if_not(_InputIterator __first, _InputIterator __last,
+ _Predicate __pred, input_iterator_tag)
+ {
+ while (__first != __last && bool(__pred(*__first)))
+ ++__first;
+ return __first;
+ }
+
+ /// This is an overload used by find_if_not() for the RAI case.
+ template<typename _RandomAccessIterator, typename _Predicate>
+ _RandomAccessIterator
+ __find_if_not(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Predicate __pred, random_access_iterator_tag)
+ {
+ typename iterator_traits<_RandomAccessIterator>::difference_type
+ __trip_count = (__last - __first) >> 2;
+
+ for (; __trip_count > 0; --__trip_count)
+ {
+ if (!bool(__pred(*__first)))
+ return __first;
+ ++__first;
+
+ if (!bool(__pred(*__first)))
+ return __first;
+ ++__first;
+
+ if (!bool(__pred(*__first)))
+ return __first;
+ ++__first;
+
+ if (!bool(__pred(*__first)))
+ return __first;
+ ++__first;
+ }
+
+ switch (__last - __first)
+ {
+ case 3:
+ if (!bool(__pred(*__first)))
+ return __first;
+ ++__first;
+ case 2:
+ if (!bool(__pred(*__first)))
+ return __first;
+ ++__first;
+ case 1:
+ if (!bool(__pred(*__first)))
+ return __first;
+ ++__first;
+ case 0:
+ default:
+ return __last;
+ }
+ }
+#endif
+
+ // set_difference
+ // set_intersection
+ // set_symmetric_difference
+ // set_union
+ // for_each
+ // find
+ // find_if
+ // find_first_of
+ // adjacent_find
+ // count
+ // count_if
+ // search
+
+ /**
+ * This is an uglified
+ * search_n(_ForwardIterator, _ForwardIterator, _Integer, const _Tp&)
+ * overloaded for forward iterators.
+ */
+ template<typename _ForwardIterator, typename _Integer, typename _Tp>
+ _ForwardIterator
+ __search_n(_ForwardIterator __first, _ForwardIterator __last,
+ _Integer __count, const _Tp& __val,
+ std::forward_iterator_tag)
+ {
+ __first = _GLIBCXX_STD_P::find(__first, __last, __val);
+ while (__first != __last)
+ {
+ typename iterator_traits<_ForwardIterator>::difference_type
+ __n = __count;
+ _ForwardIterator __i = __first;
+ ++__i;
+ while (__i != __last && __n != 1 && *__i == __val)
+ {
+ ++__i;
+ --__n;
+ }
+ if (__n == 1)
+ return __first;
+ if (__i == __last)
+ return __last;
+ __first = _GLIBCXX_STD_P::find(++__i, __last, __val);
+ }
+ return __last;
+ }
+
+ /**
+ * This is an uglified
+ * search_n(_ForwardIterator, _ForwardIterator, _Integer, const _Tp&)
+ * overloaded for random access iterators.
+ */
+ template<typename _RandomAccessIter, typename _Integer, typename _Tp>
+ _RandomAccessIter
+ __search_n(_RandomAccessIter __first, _RandomAccessIter __last,
+ _Integer __count, const _Tp& __val,
+ std::random_access_iterator_tag)
+ {
+
+ typedef typename std::iterator_traits<_RandomAccessIter>::difference_type
+ _DistanceType;
+
+ _DistanceType __tailSize = __last - __first;
+ const _DistanceType __pattSize = __count;
+
+ if (__tailSize < __pattSize)
+ return __last;
+
+ const _DistanceType __skipOffset = __pattSize - 1;
+ _RandomAccessIter __lookAhead = __first + __skipOffset;
+ __tailSize -= __pattSize;
+
+ while (1) // the main loop...
+ {
+ // __lookAhead here is always pointing to the last element of next
+ // possible match.
+ while (!(*__lookAhead == __val)) // the skip loop...
+ {
+ if (__tailSize < __pattSize)
+ return __last; // Failure
+ __lookAhead += __pattSize;
+ __tailSize -= __pattSize;
+ }
+ _DistanceType __remainder = __skipOffset;
+ for (_RandomAccessIter __backTrack = __lookAhead - 1;
+ *__backTrack == __val; --__backTrack)
+ {
+ if (--__remainder == 0)
+ return (__lookAhead - __skipOffset); // Success
+ }
+ if (__remainder > __tailSize)
+ return __last; // Failure
+ __lookAhead += __remainder;
+ __tailSize -= __remainder;
+ }
+ }
+
+ // search_n
+
+ /**
+ * This is an uglified
+ * search_n(_ForwardIterator, _ForwardIterator, _Integer, const _Tp&,
+ * _BinaryPredicate)
+ * overloaded for forward iterators.
+ */
+ template<typename _ForwardIterator, typename _Integer, typename _Tp,
+ typename _BinaryPredicate>
+ _ForwardIterator
+ __search_n(_ForwardIterator __first, _ForwardIterator __last,
+ _Integer __count, const _Tp& __val,
+ _BinaryPredicate __binary_pred, std::forward_iterator_tag)
+ {
+ while (__first != __last && !bool(__binary_pred(*__first, __val)))
+ ++__first;
+
+ while (__first != __last)
+ {
+ typename iterator_traits<_ForwardIterator>::difference_type
+ __n = __count;
+ _ForwardIterator __i = __first;
+ ++__i;
+ while (__i != __last && __n != 1 && bool(__binary_pred(*__i, __val)))
+ {
+ ++__i;
+ --__n;
+ }
+ if (__n == 1)
+ return __first;
+ if (__i == __last)
+ return __last;
+ __first = ++__i;
+ while (__first != __last
+ && !bool(__binary_pred(*__first, __val)))
+ ++__first;
+ }
+ return __last;
+ }
+
+ /**
+ * This is an uglified
+ * search_n(_ForwardIterator, _ForwardIterator, _Integer, const _Tp&,
+ * _BinaryPredicate)
+ * overloaded for random access iterators.
+ */
+ template<typename _RandomAccessIter, typename _Integer, typename _Tp,
+ typename _BinaryPredicate>
+ _RandomAccessIter
+ __search_n(_RandomAccessIter __first, _RandomAccessIter __last,
+ _Integer __count, const _Tp& __val,
+ _BinaryPredicate __binary_pred, std::random_access_iterator_tag)
+ {
+
+ typedef typename std::iterator_traits<_RandomAccessIter>::difference_type
+ _DistanceType;
+
+ _DistanceType __tailSize = __last - __first;
+ const _DistanceType __pattSize = __count;
+
+ if (__tailSize < __pattSize)
+ return __last;
+
+ const _DistanceType __skipOffset = __pattSize - 1;
+ _RandomAccessIter __lookAhead = __first + __skipOffset;
+ __tailSize -= __pattSize;
+
+ while (1) // the main loop...
+ {
+ // __lookAhead here is always pointing to the last element of next
+ // possible match.
+ while (!bool(__binary_pred(*__lookAhead, __val))) // the skip loop...
+ {
+ if (__tailSize < __pattSize)
+ return __last; // Failure
+ __lookAhead += __pattSize;
+ __tailSize -= __pattSize;
+ }
+ _DistanceType __remainder = __skipOffset;
+ for (_RandomAccessIter __backTrack = __lookAhead - 1;
+ __binary_pred(*__backTrack, __val); --__backTrack)
+ {
+ if (--__remainder == 0)
+ return (__lookAhead - __skipOffset); // Success
+ }
+ if (__remainder > __tailSize)
+ return __last; // Failure
+ __lookAhead += __remainder;
+ __tailSize -= __remainder;
+ }
+ }
+
+ // find_end for forward iterators.
+ template<typename _ForwardIterator1, typename _ForwardIterator2>
+ _ForwardIterator1
+ __find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2,
+ forward_iterator_tag, forward_iterator_tag)
+ {
+ if (__first2 == __last2)
+ return __last1;
+ else
+ {
+ _ForwardIterator1 __result = __last1;
+ while (1)
+ {
+ _ForwardIterator1 __new_result
+ = _GLIBCXX_STD_P::search(__first1, __last1, __first2, __last2);
+ if (__new_result == __last1)
+ return __result;
+ else
+ {
+ __result = __new_result;
+ __first1 = __new_result;
+ ++__first1;
+ }
+ }
+ }
+ }
+
+ template<typename _ForwardIterator1, typename _ForwardIterator2,
+ typename _BinaryPredicate>
+ _ForwardIterator1
+ __find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2,
+ forward_iterator_tag, forward_iterator_tag,
+ _BinaryPredicate __comp)
+ {
+ if (__first2 == __last2)
+ return __last1;
+ else
+ {
+ _ForwardIterator1 __result = __last1;
+ while (1)
+ {
+ _ForwardIterator1 __new_result
+ = _GLIBCXX_STD_P::search(__first1, __last1, __first2,
+ __last2, __comp);
+ if (__new_result == __last1)
+ return __result;
+ else
+ {
+ __result = __new_result;
+ __first1 = __new_result;
+ ++__first1;
+ }
+ }
+ }
+ }
+
+ // find_end for bidirectional iterators (much faster).
+ template<typename _BidirectionalIterator1, typename _BidirectionalIterator2>
+ _BidirectionalIterator1
+ __find_end(_BidirectionalIterator1 __first1,
+ _BidirectionalIterator1 __last1,
+ _BidirectionalIterator2 __first2,
+ _BidirectionalIterator2 __last2,
+ bidirectional_iterator_tag, bidirectional_iterator_tag)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<
+ _BidirectionalIterator1>)
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<
+ _BidirectionalIterator2>)
+
+ typedef reverse_iterator<_BidirectionalIterator1> _RevIterator1;
+ typedef reverse_iterator<_BidirectionalIterator2> _RevIterator2;
+
+ _RevIterator1 __rlast1(__first1);
+ _RevIterator2 __rlast2(__first2);
+ _RevIterator1 __rresult = _GLIBCXX_STD_P::search(_RevIterator1(__last1),
+ __rlast1,
+ _RevIterator2(__last2),
+ __rlast2);
+
+ if (__rresult == __rlast1)
+ return __last1;
+ else
+ {
+ _BidirectionalIterator1 __result = __rresult.base();
+ std::advance(__result, -std::distance(__first2, __last2));
+ return __result;
+ }
+ }
+
+ template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
+ typename _BinaryPredicate>
+ _BidirectionalIterator1
+ __find_end(_BidirectionalIterator1 __first1,
+ _BidirectionalIterator1 __last1,
+ _BidirectionalIterator2 __first2,
+ _BidirectionalIterator2 __last2,
+ bidirectional_iterator_tag, bidirectional_iterator_tag,
+ _BinaryPredicate __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<
+ _BidirectionalIterator1>)
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<
+ _BidirectionalIterator2>)
+
+ typedef reverse_iterator<_BidirectionalIterator1> _RevIterator1;
+ typedef reverse_iterator<_BidirectionalIterator2> _RevIterator2;
+
+ _RevIterator1 __rlast1(__first1);
+ _RevIterator2 __rlast2(__first2);
+ _RevIterator1 __rresult = std::search(_RevIterator1(__last1), __rlast1,
+ _RevIterator2(__last2), __rlast2,
+ __comp);
+
+ if (__rresult == __rlast1)
+ return __last1;
+ else
+ {
+ _BidirectionalIterator1 __result = __rresult.base();
+ std::advance(__result, -std::distance(__first2, __last2));
+ return __result;
+ }
+ }
+
+ /**
+ * @brief Find last matching subsequence in a sequence.
+ * @ingroup non_mutating_algorithms
+ * @param first1 Start of range to search.
+ * @param last1 End of range to search.
+ * @param first2 Start of sequence to match.
+ * @param last2 End of sequence to match.
+ * @return The last iterator @c i in the range
+ * @p [first1,last1-(last2-first2)) such that @c *(i+N) == @p *(first2+N)
+ * for each @c N in the range @p [0,last2-first2), or @p last1 if no
+ * such iterator exists.
+ *
+ * Searches the range @p [first1,last1) for a sub-sequence that compares
+ * equal value-by-value with the sequence given by @p [first2,last2) and
+ * returns an iterator to the first element of the sub-sequence, or
+ * @p last1 if the sub-sequence is not found. The sub-sequence will be the
+ * last such subsequence contained in [first,last1).
+ *
+ * Because the sub-sequence must lie completely within the range
+ * @p [first1,last1) it must start at a position less than
+ * @p last1-(last2-first2) where @p last2-first2 is the length of the
+ * sub-sequence.
+ * This means that the returned iterator @c i will be in the range
+ * @p [first1,last1-(last2-first2))
+ */
+ template<typename _ForwardIterator1, typename _ForwardIterator2>
+ inline _ForwardIterator1
+ find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator1>)
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator2>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_ForwardIterator1>::value_type,
+ typename iterator_traits<_ForwardIterator2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ return std::__find_end(__first1, __last1, __first2, __last2,
+ std::__iterator_category(__first1),
+ std::__iterator_category(__first2));
+ }
+
+ /**
+ * @brief Find last matching subsequence in a sequence using a predicate.
+ * @ingroup non_mutating_algorithms
+ * @param first1 Start of range to search.
+ * @param last1 End of range to search.
+ * @param first2 Start of sequence to match.
+ * @param last2 End of sequence to match.
+ * @param comp The predicate to use.
+ * @return The last iterator @c i in the range
+ * @p [first1,last1-(last2-first2)) such that @c predicate(*(i+N), @p
+ * (first2+N)) is true for each @c N in the range @p [0,last2-first2), or
+ * @p last1 if no such iterator exists.
+ *
+ * Searches the range @p [first1,last1) for a sub-sequence that compares
+ * equal value-by-value with the sequence given by @p [first2,last2) using
+ * comp as a predicate and returns an iterator to the first element of the
+ * sub-sequence, or @p last1 if the sub-sequence is not found. The
+ * sub-sequence will be the last such subsequence contained in
+ * [first,last1).
+ *
+ * Because the sub-sequence must lie completely within the range
+ * @p [first1,last1) it must start at a position less than
+ * @p last1-(last2-first2) where @p last2-first2 is the length of the
+ * sub-sequence.
+ * This means that the returned iterator @c i will be in the range
+ * @p [first1,last1-(last2-first2))
+ */
+ template<typename _ForwardIterator1, typename _ForwardIterator2,
+ typename _BinaryPredicate>
+ inline _ForwardIterator1
+ find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2,
+ _BinaryPredicate __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator1>)
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_ForwardIterator1>::value_type,
+ typename iterator_traits<_ForwardIterator2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ return std::__find_end(__first1, __last1, __first2, __last2,
+ std::__iterator_category(__first1),
+ std::__iterator_category(__first2),
+ __comp);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Checks that a predicate is true for all the elements
+ * of a sequence.
+ * @ingroup non_mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param pred A predicate.
+ * @return True if the check is true, false otherwise.
+ *
+ * Returns true if @p pred is true for each element in the range
+ * @p [first,last), and false otherwise.
+ */
+ template<typename _InputIterator, typename _Predicate>
+ inline bool
+ all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
+ { return __last == std::find_if_not(__first, __last, __pred); }
+
+ /**
+ * @brief Checks that a predicate is false for all the elements
+ * of a sequence.
+ * @ingroup non_mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param pred A predicate.
+ * @return True if the check is true, false otherwise.
+ *
+ * Returns true if @p pred is false for each element in the range
+ * @p [first,last), and false otherwise.
+ */
+ template<typename _InputIterator, typename _Predicate>
+ inline bool
+ none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
+ { return __last == _GLIBCXX_STD_P::find_if(__first, __last, __pred); }
+
+ /**
+ * @brief Checks that a predicate is false for at least an element
+ * of a sequence.
+ * @ingroup non_mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param pred A predicate.
+ * @return True if the check is true, false otherwise.
+ *
+ * Returns true if an element exists in the range @p [first,last) such that
+ * @p pred is true, and false otherwise.
+ */
+ template<typename _InputIterator, typename _Predicate>
+ inline bool
+ any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
+ { return !std::none_of(__first, __last, __pred); }
+
+ /**
+ * @brief Find the first element in a sequence for which a
+ * predicate is false.
+ * @ingroup non_mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param pred A predicate.
+ * @return The first iterator @c i in the range @p [first,last)
+ * such that @p pred(*i) is false, or @p last if no such iterator exists.
+ */
+ template<typename _InputIterator, typename _Predicate>
+ inline _InputIterator
+ find_if_not(_InputIterator __first, _InputIterator __last,
+ _Predicate __pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+ return std::__find_if_not(__first, __last, __pred,
+ std::__iterator_category(__first));
+ }
+
+ /**
+ * @brief Checks whether the sequence is partitioned.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param pred A predicate.
+ * @return True if the range @p [first,last) is partioned by @p pred,
+ * i.e. if all elements that satisfy @p pred appear before those that
+ * do not.
+ */
+ template<typename _InputIterator, typename _Predicate>
+ inline bool
+ is_partitioned(_InputIterator __first, _InputIterator __last,
+ _Predicate __pred)
+ {
+ __first = std::find_if_not(__first, __last, __pred);
+ return std::none_of(__first, __last, __pred);
+ }
+
+ /**
+ * @brief Find the partition point of a partitioned range.
+ * @ingroup mutating_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param pred A predicate.
+ * @return An iterator @p mid such that @p all_of(first, mid, pred)
+ * and @p none_of(mid, last, pred) are both true.
+ */
+ template<typename _ForwardIterator, typename _Predicate>
+ _ForwardIterator
+ partition_point(_ForwardIterator __first, _ForwardIterator __last,
+ _Predicate __pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+
+ // A specific debug-mode test will be necessary...
+ __glibcxx_requires_valid_range(__first, __last);
+
+ typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+ _DistanceType __len = std::distance(__first, __last);
+ _DistanceType __half;
+ _ForwardIterator __middle;
+
+ while (__len > 0)
+ {
+ __half = __len >> 1;
+ __middle = __first;
+ std::advance(__middle, __half);
+ if (__pred(*__middle))
+ {
+ __first = __middle;
+ ++__first;
+ __len = __len - __half - 1;
+ }
+ else
+ __len = __half;
+ }
+ return __first;
+ }
+#endif
+
+
+ /**
+ * @brief Copy a sequence, removing elements of a given value.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @param value The value to be removed.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * Copies each element in the range @p [first,last) not equal to @p value
+ * to the range beginning at @p result.
+ * remove_copy() is stable, so the relative order of elements that are
+ * copied is unchanged.
+ */
+ template<typename _InputIterator, typename _OutputIterator, typename _Tp>
+ _OutputIterator
+ remove_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, const _Tp& __value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_InputIterator>::value_type, _Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first)
+ if (!(*__first == __value))
+ {
+ *__result = *__first;
+ ++__result;
+ }
+ return __result;
+ }
+
+ /**
+ * @brief Copy a sequence, removing elements for which a predicate is true.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @param pred A predicate.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * Copies each element in the range @p [first,last) for which
+ * @p pred returns false to the range beginning at @p result.
+ *
+ * remove_copy_if() is stable, so the relative order of elements that are
+ * copied is unchanged.
+ */
+ template<typename _InputIterator, typename _OutputIterator,
+ typename _Predicate>
+ _OutputIterator
+ remove_copy_if(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, _Predicate __pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first)
+ if (!bool(__pred(*__first)))
+ {
+ *__result = *__first;
+ ++__result;
+ }
+ return __result;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Copy the elements of a sequence for which a predicate is true.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @param pred A predicate.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * Copies each element in the range @p [first,last) for which
+ * @p pred returns true to the range beginning at @p result.
+ *
+ * copy_if() is stable, so the relative order of elements that are
+ * copied is unchanged.
+ */
+ template<typename _InputIterator, typename _OutputIterator,
+ typename _Predicate>
+ _OutputIterator
+ copy_if(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, _Predicate __pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first)
+ if (__pred(*__first))
+ {
+ *__result = *__first;
+ ++__result;
+ }
+ return __result;
+ }
+
+
+ template<typename _InputIterator, typename _Size, typename _OutputIterator>
+ _OutputIterator
+ __copy_n(_InputIterator __first, _Size __n,
+ _OutputIterator __result, input_iterator_tag)
+ {
+ for (; __n > 0; --__n)
+ {
+ *__result = *__first;
+ ++__first;
+ ++__result;
+ }
+ return __result;
+ }
+
+ template<typename _RandomAccessIterator, typename _Size,
+ typename _OutputIterator>
+ inline _OutputIterator
+ __copy_n(_RandomAccessIterator __first, _Size __n,
+ _OutputIterator __result, random_access_iterator_tag)
+ { return std::copy(__first, __first + __n, __result); }
+
+ /**
+ * @brief Copies the range [first,first+n) into [result,result+n).
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param n The number of elements to copy.
+ * @param result An output iterator.
+ * @return result+n.
+ *
+ * This inline function will boil down to a call to @c memmove whenever
+ * possible. Failing that, if random access iterators are passed, then the
+ * loop count will be known (and therefore a candidate for compiler
+ * optimizations such as unrolling).
+ */
+ template<typename _InputIterator, typename _Size, typename _OutputIterator>
+ inline _OutputIterator
+ copy_n(_InputIterator __first, _Size __n, _OutputIterator __result)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
+
+ return std::__copy_n(__first, __n, __result,
+ std::__iterator_category(__first));
+ }
+
+ /**
+ * @brief Copy the elements of a sequence to separate output sequences
+ * depending on the truth value of a predicate.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param out_true An output iterator.
+ * @param out_false An output iterator.
+ * @param pred A predicate.
+ * @return A pair designating the ends of the resulting sequences.
+ *
+ * Copies each element in the range @p [first,last) for which
+ * @p pred returns true to the range beginning at @p out_true
+ * and each element for which @p pred returns false to @p out_false.
+ */
+ template<typename _InputIterator, typename _OutputIterator1,
+ typename _OutputIterator2, typename _Predicate>
+ pair<_OutputIterator1, _OutputIterator2>
+ partition_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator1 __out_true, _OutputIterator2 __out_false,
+ _Predicate __pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator1,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator2,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first)
+ if (__pred(*__first))
+ {
+ *__out_true = *__first;
+ ++__out_true;
+ }
+ else
+ {
+ *__out_false = *__first;
+ ++__out_false;
+ }
+
+ return pair<_OutputIterator1, _OutputIterator2>(__out_true, __out_false);
+ }
+#endif
+
+ /**
+ * @brief Remove elements from a sequence.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param value The value to be removed.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * All elements equal to @p value are removed from the range
+ * @p [first,last).
+ *
+ * remove() is stable, so the relative order of elements that are
+ * not removed is unchanged.
+ *
+ * Elements between the end of the resulting sequence and @p last
+ * are still present, but their value is unspecified.
+ */
+ template<typename _ForwardIterator, typename _Tp>
+ _ForwardIterator
+ remove(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_ForwardIterator>::value_type, _Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ __first = _GLIBCXX_STD_P::find(__first, __last, __value);
+ if(__first == __last)
+ return __first;
+ _ForwardIterator __result = __first;
+ ++__first;
+ for(; __first != __last; ++__first)
+ if(!(*__first == __value))
+ {
+ *__result = _GLIBCXX_MOVE(*__first);
+ ++__result;
+ }
+ return __result;
+ }
+
+ /**
+ * @brief Remove elements from a sequence using a predicate.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param pred A predicate.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * All elements for which @p pred returns true are removed from the range
+ * @p [first,last).
+ *
+ * remove_if() is stable, so the relative order of elements that are
+ * not removed is unchanged.
+ *
+ * Elements between the end of the resulting sequence and @p last
+ * are still present, but their value is unspecified.
+ */
+ template<typename _ForwardIterator, typename _Predicate>
+ _ForwardIterator
+ remove_if(_ForwardIterator __first, _ForwardIterator __last,
+ _Predicate __pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ __first = _GLIBCXX_STD_P::find_if(__first, __last, __pred);
+ if(__first == __last)
+ return __first;
+ _ForwardIterator __result = __first;
+ ++__first;
+ for(; __first != __last; ++__first)
+ if(!bool(__pred(*__first)))
+ {
+ *__result = _GLIBCXX_MOVE(*__first);
+ ++__result;
+ }
+ return __result;
+ }
+
+ /**
+ * @brief Remove consecutive duplicate values from a sequence.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * Removes all but the first element from each group of consecutive
+ * values that compare equal.
+ * unique() is stable, so the relative order of elements that are
+ * not removed is unchanged.
+ * Elements between the end of the resulting sequence and @p last
+ * are still present, but their value is unspecified.
+ */
+ template<typename _ForwardIterator>
+ _ForwardIterator
+ unique(_ForwardIterator __first, _ForwardIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_function_requires(_EqualityComparableConcept<
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ // Skip the beginning, if already unique.
+ __first = _GLIBCXX_STD_P::adjacent_find(__first, __last);
+ if (__first == __last)
+ return __last;
+
+ // Do the real copy work.
+ _ForwardIterator __dest = __first;
+ ++__first;
+ while (++__first != __last)
+ if (!(*__dest == *__first))
+ *++__dest = _GLIBCXX_MOVE(*__first);
+ return ++__dest;
+ }
+
+ /**
+ * @brief Remove consecutive values from a sequence using a predicate.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param binary_pred A binary predicate.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * Removes all but the first element from each group of consecutive
+ * values for which @p binary_pred returns true.
+ * unique() is stable, so the relative order of elements that are
+ * not removed is unchanged.
+ * Elements between the end of the resulting sequence and @p last
+ * are still present, but their value is unspecified.
+ */
+ template<typename _ForwardIterator, typename _BinaryPredicate>
+ _ForwardIterator
+ unique(_ForwardIterator __first, _ForwardIterator __last,
+ _BinaryPredicate __binary_pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ // Skip the beginning, if already unique.
+ __first = _GLIBCXX_STD_P::adjacent_find(__first, __last, __binary_pred);
+ if (__first == __last)
+ return __last;
+
+ // Do the real copy work.
+ _ForwardIterator __dest = __first;
+ ++__first;
+ while (++__first != __last)
+ if (!bool(__binary_pred(*__dest, *__first)))
+ *++__dest = _GLIBCXX_MOVE(*__first);
+ return ++__dest;
+ }
+
+ /**
+ * This is an uglified unique_copy(_InputIterator, _InputIterator,
+ * _OutputIterator)
+ * overloaded for forward iterators and output iterator as result.
+ */
+ template<typename _ForwardIterator, typename _OutputIterator>
+ _OutputIterator
+ __unique_copy(_ForwardIterator __first, _ForwardIterator __last,
+ _OutputIterator __result,
+ forward_iterator_tag, output_iterator_tag)
+ {
+ // concept requirements -- taken care of in dispatching function
+ _ForwardIterator __next = __first;
+ *__result = *__first;
+ while (++__next != __last)
+ if (!(*__first == *__next))
+ {
+ __first = __next;
+ *++__result = *__first;
+ }
+ return ++__result;
+ }
+
+ /**
+ * This is an uglified unique_copy(_InputIterator, _InputIterator,
+ * _OutputIterator)
+ * overloaded for input iterators and output iterator as result.
+ */
+ template<typename _InputIterator, typename _OutputIterator>
+ _OutputIterator
+ __unique_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result,
+ input_iterator_tag, output_iterator_tag)
+ {
+ // concept requirements -- taken care of in dispatching function
+ typename iterator_traits<_InputIterator>::value_type __value = *__first;
+ *__result = __value;
+ while (++__first != __last)
+ if (!(__value == *__first))
+ {
+ __value = *__first;
+ *++__result = __value;
+ }
+ return ++__result;
+ }
+
+ /**
+ * This is an uglified unique_copy(_InputIterator, _InputIterator,
+ * _OutputIterator)
+ * overloaded for input iterators and forward iterator as result.
+ */
+ template<typename _InputIterator, typename _ForwardIterator>
+ _ForwardIterator
+ __unique_copy(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result,
+ input_iterator_tag, forward_iterator_tag)
+ {
+ // concept requirements -- taken care of in dispatching function
+ *__result = *__first;
+ while (++__first != __last)
+ if (!(*__result == *__first))
+ *++__result = *__first;
+ return ++__result;
+ }
+
+ /**
+ * This is an uglified
+ * unique_copy(_InputIterator, _InputIterator, _OutputIterator,
+ * _BinaryPredicate)
+ * overloaded for forward iterators and output iterator as result.
+ */
+ template<typename _ForwardIterator, typename _OutputIterator,
+ typename _BinaryPredicate>
+ _OutputIterator
+ __unique_copy(_ForwardIterator __first, _ForwardIterator __last,
+ _OutputIterator __result, _BinaryPredicate __binary_pred,
+ forward_iterator_tag, output_iterator_tag)
+ {
+ // concept requirements -- iterators already checked
+ __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+
+ _ForwardIterator __next = __first;
+ *__result = *__first;
+ while (++__next != __last)
+ if (!bool(__binary_pred(*__first, *__next)))
+ {
+ __first = __next;
+ *++__result = *__first;
+ }
+ return ++__result;
+ }
+
+ /**
+ * This is an uglified
+ * unique_copy(_InputIterator, _InputIterator, _OutputIterator,
+ * _BinaryPredicate)
+ * overloaded for input iterators and output iterator as result.
+ */
+ template<typename _InputIterator, typename _OutputIterator,
+ typename _BinaryPredicate>
+ _OutputIterator
+ __unique_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, _BinaryPredicate __binary_pred,
+ input_iterator_tag, output_iterator_tag)
+ {
+ // concept requirements -- iterators already checked
+ __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_InputIterator>::value_type,
+ typename iterator_traits<_InputIterator>::value_type>)
+
+ typename iterator_traits<_InputIterator>::value_type __value = *__first;
+ *__result = __value;
+ while (++__first != __last)
+ if (!bool(__binary_pred(__value, *__first)))
+ {
+ __value = *__first;
+ *++__result = __value;
+ }
+ return ++__result;
+ }
+
+ /**
+ * This is an uglified
+ * unique_copy(_InputIterator, _InputIterator, _OutputIterator,
+ * _BinaryPredicate)
+ * overloaded for input iterators and forward iterator as result.
+ */
+ template<typename _InputIterator, typename _ForwardIterator,
+ typename _BinaryPredicate>
+ _ForwardIterator
+ __unique_copy(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result, _BinaryPredicate __binary_pred,
+ input_iterator_tag, forward_iterator_tag)
+ {
+ // concept requirements -- iterators already checked
+ __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_InputIterator>::value_type>)
+
+ *__result = *__first;
+ while (++__first != __last)
+ if (!bool(__binary_pred(*__result, *__first)))
+ *++__result = *__first;
+ return ++__result;
+ }
+
+ /**
+ * This is an uglified reverse(_BidirectionalIterator,
+ * _BidirectionalIterator)
+ * overloaded for bidirectional iterators.
+ */
+ template<typename _BidirectionalIterator>
+ void
+ __reverse(_BidirectionalIterator __first, _BidirectionalIterator __last,
+ bidirectional_iterator_tag)
+ {
+ while (true)
+ if (__first == __last || __first == --__last)
+ return;
+ else
+ {
+ std::iter_swap(__first, __last);
+ ++__first;
+ }
+ }
+
+ /**
+ * This is an uglified reverse(_BidirectionalIterator,
+ * _BidirectionalIterator)
+ * overloaded for random access iterators.
+ */
+ template<typename _RandomAccessIterator>
+ void
+ __reverse(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ random_access_iterator_tag)
+ {
+ if (__first == __last)
+ return;
+ --__last;
+ while (__first < __last)
+ {
+ std::iter_swap(__first, __last);
+ ++__first;
+ --__last;
+ }
+ }
+
+ /**
+ * @brief Reverse a sequence.
+ * @ingroup mutating_algorithms
+ * @param first A bidirectional iterator.
+ * @param last A bidirectional iterator.
+ * @return reverse() returns no value.
+ *
+ * Reverses the order of the elements in the range @p [first,last),
+ * so that the first element becomes the last etc.
+ * For every @c i such that @p 0<=i<=(last-first)/2), @p reverse()
+ * swaps @p *(first+i) and @p *(last-(i+1))
+ */
+ template<typename _BidirectionalIterator>
+ inline void
+ reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<
+ _BidirectionalIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+ std::__reverse(__first, __last, std::__iterator_category(__first));
+ }
+
+ /**
+ * @brief Copy a sequence, reversing its elements.
+ * @ingroup mutating_algorithms
+ * @param first A bidirectional iterator.
+ * @param last A bidirectional iterator.
+ * @param result An output iterator.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * Copies the elements in the range @p [first,last) to the range
+ * @p [result,result+(last-first)) such that the order of the
+ * elements is reversed.
+ * For every @c i such that @p 0<=i<=(last-first), @p reverse_copy()
+ * performs the assignment @p *(result+(last-first)-i) = *(first+i).
+ * The ranges @p [first,last) and @p [result,result+(last-first))
+ * must not overlap.
+ */
+ template<typename _BidirectionalIterator, typename _OutputIterator>
+ _OutputIterator
+ reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last,
+ _OutputIterator __result)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<
+ _BidirectionalIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_BidirectionalIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ while (__first != __last)
+ {
+ --__last;
+ *__result = *__last;
+ ++__result;
+ }
+ return __result;
+ }
+
+ /**
+ * This is a helper function for the rotate algorithm specialized on RAIs.
+ * It returns the greatest common divisor of two integer values.
+ */
+ template<typename _EuclideanRingElement>
+ _EuclideanRingElement
+ __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
+ {
+ while (__n != 0)
+ {
+ _EuclideanRingElement __t = __m % __n;
+ __m = __n;
+ __n = __t;
+ }
+ return __m;
+ }
+
+ /// This is a helper function for the rotate algorithm.
+ template<typename _ForwardIterator>
+ void
+ __rotate(_ForwardIterator __first,
+ _ForwardIterator __middle,
+ _ForwardIterator __last,
+ forward_iterator_tag)
+ {
+ if (__first == __middle || __last == __middle)
+ return;
+
+ _ForwardIterator __first2 = __middle;
+ do
+ {
+ std::iter_swap(__first, __first2);
+ ++__first;
+ ++__first2;
+ if (__first == __middle)
+ __middle = __first2;
+ }
+ while (__first2 != __last);
+
+ __first2 = __middle;
+
+ while (__first2 != __last)
+ {
+ std::iter_swap(__first, __first2);
+ ++__first;
+ ++__first2;
+ if (__first == __middle)
+ __middle = __first2;
+ else if (__first2 == __last)
+ __first2 = __middle;
+ }
+ }
+
+ /// This is a helper function for the rotate algorithm.
+ template<typename _BidirectionalIterator>
+ void
+ __rotate(_BidirectionalIterator __first,
+ _BidirectionalIterator __middle,
+ _BidirectionalIterator __last,
+ bidirectional_iterator_tag)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<
+ _BidirectionalIterator>)
+
+ if (__first == __middle || __last == __middle)
+ return;
+
+ std::__reverse(__first, __middle, bidirectional_iterator_tag());
+ std::__reverse(__middle, __last, bidirectional_iterator_tag());
+
+ while (__first != __middle && __middle != __last)
+ {
+ std::iter_swap(__first, --__last);
+ ++__first;
+ }
+
+ if (__first == __middle)
+ std::__reverse(__middle, __last, bidirectional_iterator_tag());
+ else
+ std::__reverse(__first, __middle, bidirectional_iterator_tag());
+ }
+
+ /// This is a helper function for the rotate algorithm.
+ template<typename _RandomAccessIterator>
+ void
+ __rotate(_RandomAccessIterator __first,
+ _RandomAccessIterator __middle,
+ _RandomAccessIterator __last,
+ random_access_iterator_tag)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+
+ if (__first == __middle || __last == __middle)
+ return;
+
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _Distance;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ const _Distance __n = __last - __first;
+ const _Distance __k = __middle - __first;
+ const _Distance __l = __n - __k;
+
+ if (__k == __l)
+ {
+ std::swap_ranges(__first, __middle, __middle);
+ return;
+ }
+
+ const _Distance __d = std::__gcd(__n, __k);
+
+ for (_Distance __i = 0; __i < __d; __i++)
+ {
+ _ValueType __tmp = _GLIBCXX_MOVE(*__first);
+ _RandomAccessIterator __p = __first;
+
+ if (__k < __l)
+ {
+ for (_Distance __j = 0; __j < __l / __d; __j++)
+ {
+ if (__p > __first + __l)
+ {
+ *__p = _GLIBCXX_MOVE(*(__p - __l));
+ __p -= __l;
+ }
+
+ *__p = _GLIBCXX_MOVE(*(__p + __k));
+ __p += __k;
+ }
+ }
+ else
+ {
+ for (_Distance __j = 0; __j < __k / __d - 1; __j ++)
+ {
+ if (__p < __last - __k)
+ {
+ *__p = _GLIBCXX_MOVE(*(__p + __k));
+ __p += __k;
+ }
+ *__p = _GLIBCXX_MOVE(*(__p - __l));
+ __p -= __l;
+ }
+ }
+
+ *__p = _GLIBCXX_MOVE(__tmp);
+ ++__first;
+ }
+ }
+
+ /**
+ * @brief Rotate the elements of a sequence.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param middle A forward iterator.
+ * @param last A forward iterator.
+ * @return Nothing.
+ *
+ * Rotates the elements of the range @p [first,last) by @p (middle-first)
+ * positions so that the element at @p middle is moved to @p first, the
+ * element at @p middle+1 is moved to @first+1 and so on for each element
+ * in the range @p [first,last).
+ *
+ * This effectively swaps the ranges @p [first,middle) and
+ * @p [middle,last).
+ *
+ * Performs @p *(first+(n+(last-middle))%(last-first))=*(first+n) for
+ * each @p n in the range @p [0,last-first).
+ */
+ template<typename _ForwardIterator>
+ inline void
+ rotate(_ForwardIterator __first, _ForwardIterator __middle,
+ _ForwardIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_requires_valid_range(__first, __middle);
+ __glibcxx_requires_valid_range(__middle, __last);
+
+ typedef typename iterator_traits<_ForwardIterator>::iterator_category
+ _IterType;
+ std::__rotate(__first, __middle, __last, _IterType());
+ }
+
+ /**
+ * @brief Copy a sequence, rotating its elements.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param middle A forward iterator.
+ * @param last A forward iterator.
+ * @param result An output iterator.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * Copies the elements of the range @p [first,last) to the range
+ * beginning at @result, rotating the copied elements by @p (middle-first)
+ * positions so that the element at @p middle is moved to @p result, the
+ * element at @p middle+1 is moved to @result+1 and so on for each element
+ * in the range @p [first,last).
+ *
+ * Performs @p *(result+(n+(last-middle))%(last-first))=*(first+n) for
+ * each @p n in the range @p [0,last-first).
+ */
+ template<typename _ForwardIterator, typename _OutputIterator>
+ _OutputIterator
+ rotate_copy(_ForwardIterator __first, _ForwardIterator __middle,
+ _ForwardIterator __last, _OutputIterator __result)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __middle);
+ __glibcxx_requires_valid_range(__middle, __last);
+
+ return std::copy(__first, __middle,
+ std::copy(__middle, __last, __result));
+ }
+
+ /// This is a helper function...
+ template<typename _ForwardIterator, typename _Predicate>
+ _ForwardIterator
+ __partition(_ForwardIterator __first, _ForwardIterator __last,
+ _Predicate __pred, forward_iterator_tag)
+ {
+ if (__first == __last)
+ return __first;
+
+ while (__pred(*__first))
+ if (++__first == __last)
+ return __first;
+
+ _ForwardIterator __next = __first;
+
+ while (++__next != __last)
+ if (__pred(*__next))
+ {
+ std::iter_swap(__first, __next);
+ ++__first;
+ }
+
+ return __first;
+ }
+
+ /// This is a helper function...
+ template<typename _BidirectionalIterator, typename _Predicate>
+ _BidirectionalIterator
+ __partition(_BidirectionalIterator __first, _BidirectionalIterator __last,
+ _Predicate __pred, bidirectional_iterator_tag)
+ {
+ while (true)
+ {
+ while (true)
+ if (__first == __last)
+ return __first;
+ else if (__pred(*__first))
+ ++__first;
+ else
+ break;
+ --__last;
+ while (true)
+ if (__first == __last)
+ return __first;
+ else if (!bool(__pred(*__last)))
+ --__last;
+ else
+ break;
+ std::iter_swap(__first, __last);
+ ++__first;
+ }
+ }
+
+ // partition
+
+ /// This is a helper function...
+ template<typename _ForwardIterator, typename _Predicate, typename _Distance>
+ _ForwardIterator
+ __inplace_stable_partition(_ForwardIterator __first,
+ _ForwardIterator __last,
+ _Predicate __pred, _Distance __len)
+ {
+ if (__len == 1)
+ return __pred(*__first) ? __last : __first;
+ _ForwardIterator __middle = __first;
+ std::advance(__middle, __len / 2);
+ _ForwardIterator __begin = std::__inplace_stable_partition(__first,
+ __middle,
+ __pred,
+ __len / 2);
+ _ForwardIterator __end = std::__inplace_stable_partition(__middle, __last,
+ __pred,
+ __len
+ - __len / 2);
+ std::rotate(__begin, __middle, __end);
+ std::advance(__begin, std::distance(__middle, __end));
+ return __begin;
+ }
+
+ /// This is a helper function...
+ template<typename _ForwardIterator, typename _Pointer, typename _Predicate,
+ typename _Distance>
+ _ForwardIterator
+ __stable_partition_adaptive(_ForwardIterator __first,
+ _ForwardIterator __last,
+ _Predicate __pred, _Distance __len,
+ _Pointer __buffer,
+ _Distance __buffer_size)
+ {
+ if (__len <= __buffer_size)
+ {
+ _ForwardIterator __result1 = __first;
+ _Pointer __result2 = __buffer;
+ for (; __first != __last; ++__first)
+ if (__pred(*__first))
+ {
+ *__result1 = *__first;
+ ++__result1;
+ }
+ else
+ {
+ *__result2 = *__first;
+ ++__result2;
+ }
+ std::copy(__buffer, __result2, __result1);
+ return __result1;
+ }
+ else
+ {
+ _ForwardIterator __middle = __first;
+ std::advance(__middle, __len / 2);
+ _ForwardIterator __begin =
+ std::__stable_partition_adaptive(__first, __middle, __pred,
+ __len / 2, __buffer,
+ __buffer_size);
+ _ForwardIterator __end =
+ std::__stable_partition_adaptive(__middle, __last, __pred,
+ __len - __len / 2,
+ __buffer, __buffer_size);
+ std::rotate(__begin, __middle, __end);
+ std::advance(__begin, std::distance(__middle, __end));
+ return __begin;
+ }
+ }
+
+ /**
+ * @brief Move elements for which a predicate is true to the beginning
+ * of a sequence, preserving relative ordering.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param pred A predicate functor.
+ * @return An iterator @p middle such that @p pred(i) is true for each
+ * iterator @p i in the range @p [first,middle) and false for each @p i
+ * in the range @p [middle,last).
+ *
+ * Performs the same function as @p partition() with the additional
+ * guarantee that the relative ordering of elements in each group is
+ * preserved, so any two elements @p x and @p y in the range
+ * @p [first,last) such that @p pred(x)==pred(y) will have the same
+ * relative ordering after calling @p stable_partition().
+ */
+ template<typename _ForwardIterator, typename _Predicate>
+ _ForwardIterator
+ stable_partition(_ForwardIterator __first, _ForwardIterator __last,
+ _Predicate __pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __first;
+ else
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+ _Temporary_buffer<_ForwardIterator, _ValueType> __buf(__first,
+ __last);
+ if (__buf.size() > 0)
+ return
+ std::__stable_partition_adaptive(__first, __last, __pred,
+ _DistanceType(__buf.requested_size()),
+ __buf.begin(),
+ _DistanceType(__buf.size()));
+ else
+ return
+ std::__inplace_stable_partition(__first, __last, __pred,
+ _DistanceType(__buf.requested_size()));
+ }
+ }
+
+ /// This is a helper function for the sort routines.
+ template<typename _RandomAccessIterator>
+ void
+ __heap_select(_RandomAccessIterator __first,
+ _RandomAccessIterator __middle,
+ _RandomAccessIterator __last)
+ {
+ std::make_heap(__first, __middle);
+ for (_RandomAccessIterator __i = __middle; __i < __last; ++__i)
+ if (*__i < *__first)
+ std::__pop_heap(__first, __middle, __i);
+ }
+
+ /// This is a helper function for the sort routines.
+ template<typename _RandomAccessIterator, typename _Compare>
+ void
+ __heap_select(_RandomAccessIterator __first,
+ _RandomAccessIterator __middle,
+ _RandomAccessIterator __last, _Compare __comp)
+ {
+ std::make_heap(__first, __middle, __comp);
+ for (_RandomAccessIterator __i = __middle; __i < __last; ++__i)
+ if (__comp(*__i, *__first))
+ std::__pop_heap(__first, __middle, __i, __comp);
+ }
+
+ // partial_sort
+
+ /**
+ * @brief Copy the smallest elements of a sequence.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param result_first A random-access iterator.
+ * @param result_last Another random-access iterator.
+ * @return An iterator indicating the end of the resulting sequence.
+ *
+ * Copies and sorts the smallest N values from the range @p [first,last)
+ * to the range beginning at @p result_first, where the number of
+ * elements to be copied, @p N, is the smaller of @p (last-first) and
+ * @p (result_last-result_first).
+ * After the sort if @p i and @j are iterators in the range
+ * @p [result_first,result_first+N) such that @i precedes @j then
+ * @p *j<*i is false.
+ * The value returned is @p result_first+N.
+ */
+ template<typename _InputIterator, typename _RandomAccessIterator>
+ _RandomAccessIterator
+ partial_sort_copy(_InputIterator __first, _InputIterator __last,
+ _RandomAccessIterator __result_first,
+ _RandomAccessIterator __result_last)
+ {
+ typedef typename iterator_traits<_InputIterator>::value_type
+ _InputValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _OutputValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_ConvertibleConcept<_InputValueType,
+ _OutputValueType>)
+ __glibcxx_function_requires(_LessThanOpConcept<_InputValueType,
+ _OutputValueType>)
+ __glibcxx_function_requires(_LessThanComparableConcept<_OutputValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_valid_range(__result_first, __result_last);
+
+ if (__result_first == __result_last)
+ return __result_last;
+ _RandomAccessIterator __result_real_last = __result_first;
+ while(__first != __last && __result_real_last != __result_last)
+ {
+ *__result_real_last = *__first;
+ ++__result_real_last;
+ ++__first;
+ }
+ std::make_heap(__result_first, __result_real_last);
+ while (__first != __last)
+ {
+ if (*__first < *__result_first)
+ std::__adjust_heap(__result_first, _DistanceType(0),
+ _DistanceType(__result_real_last
+ - __result_first),
+ _InputValueType(*__first));
+ ++__first;
+ }
+ std::sort_heap(__result_first, __result_real_last);
+ return __result_real_last;
+ }
+
+ /**
+ * @brief Copy the smallest elements of a sequence using a predicate for
+ * comparison.
+ * @ingroup sorting_algorithms
+ * @param first An input iterator.
+ * @param last Another input iterator.
+ * @param result_first A random-access iterator.
+ * @param result_last Another random-access iterator.
+ * @param comp A comparison functor.
+ * @return An iterator indicating the end of the resulting sequence.
+ *
+ * Copies and sorts the smallest N values from the range @p [first,last)
+ * to the range beginning at @p result_first, where the number of
+ * elements to be copied, @p N, is the smaller of @p (last-first) and
+ * @p (result_last-result_first).
+ * After the sort if @p i and @j are iterators in the range
+ * @p [result_first,result_first+N) such that @i precedes @j then
+ * @p comp(*j,*i) is false.
+ * The value returned is @p result_first+N.
+ */
+ template<typename _InputIterator, typename _RandomAccessIterator, typename _Compare>
+ _RandomAccessIterator
+ partial_sort_copy(_InputIterator __first, _InputIterator __last,
+ _RandomAccessIterator __result_first,
+ _RandomAccessIterator __result_last,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_InputIterator>::value_type
+ _InputValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _OutputValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_ConvertibleConcept<_InputValueType,
+ _OutputValueType>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _InputValueType, _OutputValueType>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _OutputValueType, _OutputValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_valid_range(__result_first, __result_last);
+
+ if (__result_first == __result_last)
+ return __result_last;
+ _RandomAccessIterator __result_real_last = __result_first;
+ while(__first != __last && __result_real_last != __result_last)
+ {
+ *__result_real_last = *__first;
+ ++__result_real_last;
+ ++__first;
+ }
+ std::make_heap(__result_first, __result_real_last, __comp);
+ while (__first != __last)
+ {
+ if (__comp(*__first, *__result_first))
+ std::__adjust_heap(__result_first, _DistanceType(0),
+ _DistanceType(__result_real_last
+ - __result_first),
+ _InputValueType(*__first),
+ __comp);
+ ++__first;
+ }
+ std::sort_heap(__result_first, __result_real_last, __comp);
+ return __result_real_last;
+ }
+
+ /// This is a helper function for the sort routine.
+ template<typename _RandomAccessIterator, typename _Tp>
+ void
+ __unguarded_linear_insert(_RandomAccessIterator __last, _Tp __val)
+ {
+ _RandomAccessIterator __next = __last;
+ --__next;
+ while (__val < *__next)
+ {
+ *__last = *__next;
+ __last = __next;
+ --__next;
+ }
+ *__last = __val;
+ }
+
+ /// This is a helper function for the sort routine.
+ template<typename _RandomAccessIterator, typename _Tp, typename _Compare>
+ void
+ __unguarded_linear_insert(_RandomAccessIterator __last, _Tp __val,
+ _Compare __comp)
+ {
+ _RandomAccessIterator __next = __last;
+ --__next;
+ while (__comp(__val, *__next))
+ {
+ *__last = *__next;
+ __last = __next;
+ --__next;
+ }
+ *__last = __val;
+ }
+
+ /// This is a helper function for the sort routine.
+ template<typename _RandomAccessIterator>
+ void
+ __insertion_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last)
+ {
+ if (__first == __last)
+ return;
+
+ for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
+ {
+ typename iterator_traits<_RandomAccessIterator>::value_type
+ __val = *__i;
+ if (__val < *__first)
+ {
+ std::copy_backward(__first, __i, __i + 1);
+ *__first = __val;
+ }
+ else
+ std::__unguarded_linear_insert(__i, __val);
+ }
+ }
+
+ /// This is a helper function for the sort routine.
+ template<typename _RandomAccessIterator, typename _Compare>
+ void
+ __insertion_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last, _Compare __comp)
+ {
+ if (__first == __last) return;
+
+ for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
+ {
+ typename iterator_traits<_RandomAccessIterator>::value_type
+ __val = *__i;
+ if (__comp(__val, *__first))
+ {
+ std::copy_backward(__first, __i, __i + 1);
+ *__first = __val;
+ }
+ else
+ std::__unguarded_linear_insert(__i, __val, __comp);
+ }
+ }
+
+ /// This is a helper function for the sort routine.
+ template<typename _RandomAccessIterator>
+ inline void
+ __unguarded_insertion_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ for (_RandomAccessIterator __i = __first; __i != __last; ++__i)
+ std::__unguarded_linear_insert(__i, _ValueType(*__i));
+ }
+
+ /// This is a helper function for the sort routine.
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline void
+ __unguarded_insertion_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last, _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ for (_RandomAccessIterator __i = __first; __i != __last; ++__i)
+ std::__unguarded_linear_insert(__i, _ValueType(*__i), __comp);
+ }
+
+ /**
+ * @doctodo
+ * This controls some aspect of the sort routines.
+ */
+ enum { _S_threshold = 16 };
+
+ /// This is a helper function for the sort routine.
+ template<typename _RandomAccessIterator>
+ void
+ __final_insertion_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last)
+ {
+ if (__last - __first > int(_S_threshold))
+ {
+ std::__insertion_sort(__first, __first + int(_S_threshold));
+ std::__unguarded_insertion_sort(__first + int(_S_threshold), __last);
+ }
+ else
+ std::__insertion_sort(__first, __last);
+ }
+
+ /// This is a helper function for the sort routine.
+ template<typename _RandomAccessIterator, typename _Compare>
+ void
+ __final_insertion_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last, _Compare __comp)
+ {
+ if (__last - __first > int(_S_threshold))
+ {
+ std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
+ std::__unguarded_insertion_sort(__first + int(_S_threshold), __last,
+ __comp);
+ }
+ else
+ std::__insertion_sort(__first, __last, __comp);
+ }
+
+ /// This is a helper function...
+ template<typename _RandomAccessIterator, typename _Tp>
+ _RandomAccessIterator
+ __unguarded_partition(_RandomAccessIterator __first,
+ _RandomAccessIterator __last, _Tp __pivot)
+ {
+ while (true)
+ {
+ while (*__first < __pivot)
+ ++__first;
+ --__last;
+ while (__pivot < *__last)
+ --__last;
+ if (!(__first < __last))
+ return __first;
+ std::iter_swap(__first, __last);
+ ++__first;
+ }
+ }
+
+ /// This is a helper function...
+ template<typename _RandomAccessIterator, typename _Tp, typename _Compare>
+ _RandomAccessIterator
+ __unguarded_partition(_RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Tp __pivot, _Compare __comp)
+ {
+ while (true)
+ {
+ while (__comp(*__first, __pivot))
+ ++__first;
+ --__last;
+ while (__comp(__pivot, *__last))
+ --__last;
+ if (!(__first < __last))
+ return __first;
+ std::iter_swap(__first, __last);
+ ++__first;
+ }
+ }
+
+ /// This is a helper function for the sort routine.
+ template<typename _RandomAccessIterator, typename _Size>
+ void
+ __introsort_loop(_RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Size __depth_limit)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ while (__last - __first > int(_S_threshold))
+ {
+ if (__depth_limit == 0)
+ {
+ _GLIBCXX_STD_P::partial_sort(__first, __last, __last);
+ return;
+ }
+ --__depth_limit;
+ _RandomAccessIterator __cut =
+ std::__unguarded_partition(__first, __last,
+ _ValueType(std::__median(*__first,
+ *(__first
+ + (__last
+ - __first)
+ / 2),
+ *(__last
+ - 1))));
+ std::__introsort_loop(__cut, __last, __depth_limit);
+ __last = __cut;
+ }
+ }
+
+ /// This is a helper function for the sort routine.
+ template<typename _RandomAccessIterator, typename _Size, typename _Compare>
+ void
+ __introsort_loop(_RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Size __depth_limit, _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ while (__last - __first > int(_S_threshold))
+ {
+ if (__depth_limit == 0)
+ {
+ _GLIBCXX_STD_P::partial_sort(__first, __last, __last, __comp);
+ return;
+ }
+ --__depth_limit;
+ _RandomAccessIterator __cut =
+ std::__unguarded_partition(__first, __last,
+ _ValueType(std::__median(*__first,
+ *(__first
+ + (__last
+ - __first)
+ / 2),
+ *(__last - 1),
+ __comp)),
+ __comp);
+ std::__introsort_loop(__cut, __last, __depth_limit, __comp);
+ __last = __cut;
+ }
+ }
+
+ /// This is a helper function for the sort routines. Precondition: __n > 0.
+ template<typename _Size>
+ inline _Size
+ __lg(_Size __n)
+ {
+ _Size __k;
+ for (__k = 0; __n != 0; __n >>= 1)
+ ++__k;
+ return __k - 1;
+ }
+
+ inline int
+ __lg(int __n)
+ { return sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); }
+
+ inline long
+ __lg(long __n)
+ { return sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); }
+
+ inline long long
+ __lg(long long __n)
+ { return sizeof(long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); }
+
+ // sort
+
+ template<typename _RandomAccessIterator, typename _Size>
+ void
+ __introselect(_RandomAccessIterator __first, _RandomAccessIterator __nth,
+ _RandomAccessIterator __last, _Size __depth_limit)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ while (__last - __first > 3)
+ {
+ if (__depth_limit == 0)
+ {
+ std::__heap_select(__first, __nth + 1, __last);
+
+ // Place the nth largest element in its final position.
+ std::iter_swap(__first, __nth);
+ return;
+ }
+ --__depth_limit;
+ _RandomAccessIterator __cut =
+ std::__unguarded_partition(__first, __last,
+ _ValueType(std::__median(*__first,
+ *(__first
+ + (__last
+ - __first)
+ / 2),
+ *(__last
+ - 1))));
+ if (__cut <= __nth)
+ __first = __cut;
+ else
+ __last = __cut;
+ }
+ std::__insertion_sort(__first, __last);
+ }
+
+ template<typename _RandomAccessIterator, typename _Size, typename _Compare>
+ void
+ __introselect(_RandomAccessIterator __first, _RandomAccessIterator __nth,
+ _RandomAccessIterator __last, _Size __depth_limit,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ while (__last - __first > 3)
+ {
+ if (__depth_limit == 0)
+ {
+ std::__heap_select(__first, __nth + 1, __last, __comp);
+ // Place the nth largest element in its final position.
+ std::iter_swap(__first, __nth);
+ return;
+ }
+ --__depth_limit;
+ _RandomAccessIterator __cut =
+ std::__unguarded_partition(__first, __last,
+ _ValueType(std::__median(*__first,
+ *(__first
+ + (__last
+ - __first)
+ / 2),
+ *(__last - 1),
+ __comp)),
+ __comp);
+ if (__cut <= __nth)
+ __first = __cut;
+ else
+ __last = __cut;
+ }
+ std::__insertion_sort(__first, __last, __comp);
+ }
+
+ // nth_element
+
+ /**
+ * @brief Finds the first position in which @a val could be inserted
+ * without changing the ordering.
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param val The search term.
+ * @return An iterator pointing to the first element "not less
+ * than" @a val, or end() if every element is less than
+ * @a val.
+ * @ingroup binary_search_algorithms
+ */
+ template<typename _ForwardIterator, typename _Tp>
+ _ForwardIterator
+ lower_bound(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __val)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType, _Tp>)
+ __glibcxx_requires_partitioned_lower(__first, __last, __val);
+
+ _DistanceType __len = std::distance(__first, __last);
+ _DistanceType __half;
+ _ForwardIterator __middle;
+
+ while (__len > 0)
+ {
+ __half = __len >> 1;
+ __middle = __first;
+ std::advance(__middle, __half);
+ if (*__middle < __val)
+ {
+ __first = __middle;
+ ++__first;
+ __len = __len - __half - 1;
+ }
+ else
+ __len = __half;
+ }
+ return __first;
+ }
+
+ /**
+ * @brief Finds the first position in which @a val could be inserted
+ * without changing the ordering.
+ * @ingroup binary_search_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param val The search term.
+ * @param comp A functor to use for comparisons.
+ * @return An iterator pointing to the first element "not less than" @a val,
+ * or end() if every element is less than @a val.
+ * @ingroup binary_search_algorithms
+ *
+ * The comparison function should have the same effects on ordering as
+ * the function used for the initial sort.
+ */
+ template<typename _ForwardIterator, typename _Tp, typename _Compare>
+ _ForwardIterator
+ lower_bound(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __val, _Compare __comp)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType, _Tp>)
+ __glibcxx_requires_partitioned_lower_pred(__first, __last,
+ __val, __comp);
+
+ _DistanceType __len = std::distance(__first, __last);
+ _DistanceType __half;
+ _ForwardIterator __middle;
+
+ while (__len > 0)
+ {
+ __half = __len >> 1;
+ __middle = __first;
+ std::advance(__middle, __half);
+ if (__comp(*__middle, __val))
+ {
+ __first = __middle;
+ ++__first;
+ __len = __len - __half - 1;
+ }
+ else
+ __len = __half;
+ }
+ return __first;
+ }
+
+ /**
+ * @brief Finds the last position in which @a val could be inserted
+ * without changing the ordering.
+ * @ingroup binary_search_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param val The search term.
+ * @return An iterator pointing to the first element greater than @a val,
+ * or end() if no elements are greater than @a val.
+ * @ingroup binary_search_algorithms
+ */
+ template<typename _ForwardIterator, typename _Tp>
+ _ForwardIterator
+ upper_bound(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __val)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_LessThanOpConcept<_Tp, _ValueType>)
+ __glibcxx_requires_partitioned_upper(__first, __last, __val);
+
+ _DistanceType __len = std::distance(__first, __last);
+ _DistanceType __half;
+ _ForwardIterator __middle;
+
+ while (__len > 0)
+ {
+ __half = __len >> 1;
+ __middle = __first;
+ std::advance(__middle, __half);
+ if (__val < *__middle)
+ __len = __half;
+ else
+ {
+ __first = __middle;
+ ++__first;
+ __len = __len - __half - 1;
+ }
+ }
+ return __first;
+ }
+
+ /**
+ * @brief Finds the last position in which @a val could be inserted
+ * without changing the ordering.
+ * @ingroup binary_search_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param val The search term.
+ * @param comp A functor to use for comparisons.
+ * @return An iterator pointing to the first element greater than @a val,
+ * or end() if no elements are greater than @a val.
+ * @ingroup binary_search_algorithms
+ *
+ * The comparison function should have the same effects on ordering as
+ * the function used for the initial sort.
+ */
+ template<typename _ForwardIterator, typename _Tp, typename _Compare>
+ _ForwardIterator
+ upper_bound(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __val, _Compare __comp)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _Tp, _ValueType>)
+ __glibcxx_requires_partitioned_upper_pred(__first, __last,
+ __val, __comp);
+
+ _DistanceType __len = std::distance(__first, __last);
+ _DistanceType __half;
+ _ForwardIterator __middle;
+
+ while (__len > 0)
+ {
+ __half = __len >> 1;
+ __middle = __first;
+ std::advance(__middle, __half);
+ if (__comp(__val, *__middle))
+ __len = __half;
+ else
+ {
+ __first = __middle;
+ ++__first;
+ __len = __len - __half - 1;
+ }
+ }
+ return __first;
+ }
+
+ /**
+ * @brief Finds the largest subrange in which @a val could be inserted
+ * at any place in it without changing the ordering.
+ * @ingroup binary_search_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param val The search term.
+ * @return An pair of iterators defining the subrange.
+ * @ingroup binary_search_algorithms
+ *
+ * This is equivalent to
+ * @code
+ * std::make_pair(lower_bound(first, last, val),
+ * upper_bound(first, last, val))
+ * @endcode
+ * but does not actually call those functions.
+ */
+ template<typename _ForwardIterator, typename _Tp>
+ pair<_ForwardIterator, _ForwardIterator>
+ equal_range(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __val)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType, _Tp>)
+ __glibcxx_function_requires(_LessThanOpConcept<_Tp, _ValueType>)
+ __glibcxx_requires_partitioned_lower(__first, __last, __val);
+ __glibcxx_requires_partitioned_upper(__first, __last, __val);
+
+ _DistanceType __len = std::distance(__first, __last);
+ _DistanceType __half;
+ _ForwardIterator __middle, __left, __right;
+
+ while (__len > 0)
+ {
+ __half = __len >> 1;
+ __middle = __first;
+ std::advance(__middle, __half);
+ if (*__middle < __val)
+ {
+ __first = __middle;
+ ++__first;
+ __len = __len - __half - 1;
+ }
+ else if (__val < *__middle)
+ __len = __half;
+ else
+ {
+ __left = std::lower_bound(__first, __middle, __val);
+ std::advance(__first, __len);
+ __right = std::upper_bound(++__middle, __first, __val);
+ return pair<_ForwardIterator, _ForwardIterator>(__left, __right);
+ }
+ }
+ return pair<_ForwardIterator, _ForwardIterator>(__first, __first);
+ }
+
+ /**
+ * @brief Finds the largest subrange in which @a val could be inserted
+ * at any place in it without changing the ordering.
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param val The search term.
+ * @param comp A functor to use for comparisons.
+ * @return An pair of iterators defining the subrange.
+ * @ingroup binary_search_algorithms
+ *
+ * This is equivalent to
+ * @code
+ * std::make_pair(lower_bound(first, last, val, comp),
+ * upper_bound(first, last, val, comp))
+ * @endcode
+ * but does not actually call those functions.
+ */
+ template<typename _ForwardIterator, typename _Tp, typename _Compare>
+ pair<_ForwardIterator, _ForwardIterator>
+ equal_range(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __val,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType, _Tp>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _Tp, _ValueType>)
+ __glibcxx_requires_partitioned_lower_pred(__first, __last,
+ __val, __comp);
+ __glibcxx_requires_partitioned_upper_pred(__first, __last,
+ __val, __comp);
+
+ _DistanceType __len = std::distance(__first, __last);
+ _DistanceType __half;
+ _ForwardIterator __middle, __left, __right;
+
+ while (__len > 0)
+ {
+ __half = __len >> 1;
+ __middle = __first;
+ std::advance(__middle, __half);
+ if (__comp(*__middle, __val))
+ {
+ __first = __middle;
+ ++__first;
+ __len = __len - __half - 1;
+ }
+ else if (__comp(__val, *__middle))
+ __len = __half;
+ else
+ {
+ __left = std::lower_bound(__first, __middle, __val, __comp);
+ std::advance(__first, __len);
+ __right = std::upper_bound(++__middle, __first, __val, __comp);
+ return pair<_ForwardIterator, _ForwardIterator>(__left, __right);
+ }
+ }
+ return pair<_ForwardIterator, _ForwardIterator>(__first, __first);
+ }
+
+ /**
+ * @brief Determines whether an element exists in a range.
+ * @ingroup binary_search_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param val The search term.
+ * @return True if @a val (or its equivalent) is in [@a first,@a last ].
+ *
+ * Note that this does not actually return an iterator to @a val. For
+ * that, use std::find or a container's specialized find member functions.
+ */
+ template<typename _ForwardIterator, typename _Tp>
+ bool
+ binary_search(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __val)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_LessThanOpConcept<_Tp, _ValueType>)
+ __glibcxx_requires_partitioned_lower(__first, __last, __val);
+ __glibcxx_requires_partitioned_upper(__first, __last, __val);
+
+ _ForwardIterator __i = std::lower_bound(__first, __last, __val);
+ return __i != __last && !(__val < *__i);
+ }
+
+ /**
+ * @brief Determines whether an element exists in a range.
+ * @ingroup binary_search_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param val The search term.
+ * @param comp A functor to use for comparisons.
+ * @return True if @a val (or its equivalent) is in [@a first,@a last ].
+ *
+ * Note that this does not actually return an iterator to @a val. For
+ * that, use std::find or a container's specialized find member functions.
+ *
+ * The comparison function should have the same effects on ordering as
+ * the function used for the initial sort.
+ */
+ template<typename _ForwardIterator, typename _Tp, typename _Compare>
+ bool
+ binary_search(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __val, _Compare __comp)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _Tp, _ValueType>)
+ __glibcxx_requires_partitioned_lower_pred(__first, __last,
+ __val, __comp);
+ __glibcxx_requires_partitioned_upper_pred(__first, __last,
+ __val, __comp);
+
+ _ForwardIterator __i = std::lower_bound(__first, __last, __val, __comp);
+ return __i != __last && !bool(__comp(__val, *__i));
+ }
+
+ // merge
+
+ /// This is a helper function for the merge routines.
+ template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
+ typename _BidirectionalIterator3>
+ _BidirectionalIterator3
+ __merge_backward(_BidirectionalIterator1 __first1,
+ _BidirectionalIterator1 __last1,
+ _BidirectionalIterator2 __first2,
+ _BidirectionalIterator2 __last2,
+ _BidirectionalIterator3 __result)
+ {
+ if (__first1 == __last1)
+ return std::copy_backward(__first2, __last2, __result);
+ if (__first2 == __last2)
+ return std::copy_backward(__first1, __last1, __result);
+ --__last1;
+ --__last2;
+ while (true)
+ {
+ if (*__last2 < *__last1)
+ {
+ *--__result = *__last1;
+ if (__first1 == __last1)
+ return std::copy_backward(__first2, ++__last2, __result);
+ --__last1;
+ }
+ else
+ {
+ *--__result = *__last2;
+ if (__first2 == __last2)
+ return std::copy_backward(__first1, ++__last1, __result);
+ --__last2;
+ }
+ }
+ }
+
+ /// This is a helper function for the merge routines.
+ template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
+ typename _BidirectionalIterator3, typename _Compare>
+ _BidirectionalIterator3
+ __merge_backward(_BidirectionalIterator1 __first1,
+ _BidirectionalIterator1 __last1,
+ _BidirectionalIterator2 __first2,
+ _BidirectionalIterator2 __last2,
+ _BidirectionalIterator3 __result,
+ _Compare __comp)
+ {
+ if (__first1 == __last1)
+ return std::copy_backward(__first2, __last2, __result);
+ if (__first2 == __last2)
+ return std::copy_backward(__first1, __last1, __result);
+ --__last1;
+ --__last2;
+ while (true)
+ {
+ if (__comp(*__last2, *__last1))
+ {
+ *--__result = *__last1;
+ if (__first1 == __last1)
+ return std::copy_backward(__first2, ++__last2, __result);
+ --__last1;
+ }
+ else
+ {
+ *--__result = *__last2;
+ if (__first2 == __last2)
+ return std::copy_backward(__first1, ++__last1, __result);
+ --__last2;
+ }
+ }
+ }
+
+ /// This is a helper function for the merge routines.
+ template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
+ typename _Distance>
+ _BidirectionalIterator1
+ __rotate_adaptive(_BidirectionalIterator1 __first,
+ _BidirectionalIterator1 __middle,
+ _BidirectionalIterator1 __last,
+ _Distance __len1, _Distance __len2,
+ _BidirectionalIterator2 __buffer,
+ _Distance __buffer_size)
+ {
+ _BidirectionalIterator2 __buffer_end;
+ if (__len1 > __len2 && __len2 <= __buffer_size)
+ {
+ __buffer_end = std::copy(__middle, __last, __buffer);
+ std::copy_backward(__first, __middle, __last);
+ return std::copy(__buffer, __buffer_end, __first);
+ }
+ else if (__len1 <= __buffer_size)
+ {
+ __buffer_end = std::copy(__first, __middle, __buffer);
+ std::copy(__middle, __last, __first);
+ return std::copy_backward(__buffer, __buffer_end, __last);
+ }
+ else
+ {
+ std::rotate(__first, __middle, __last);
+ std::advance(__first, std::distance(__middle, __last));
+ return __first;
+ }
+ }
+
+ /// This is a helper function for the merge routines.
+ template<typename _BidirectionalIterator, typename _Distance,
+ typename _Pointer>
+ void
+ __merge_adaptive(_BidirectionalIterator __first,
+ _BidirectionalIterator __middle,
+ _BidirectionalIterator __last,
+ _Distance __len1, _Distance __len2,
+ _Pointer __buffer, _Distance __buffer_size)
+ {
+ if (__len1 <= __len2 && __len1 <= __buffer_size)
+ {
+ _Pointer __buffer_end = std::copy(__first, __middle, __buffer);
+ _GLIBCXX_STD_P::merge(__buffer, __buffer_end, __middle, __last,
+ __first);
+ }
+ else if (__len2 <= __buffer_size)
+ {
+ _Pointer __buffer_end = std::copy(__middle, __last, __buffer);
+ std::__merge_backward(__first, __middle, __buffer,
+ __buffer_end, __last);
+ }
+ else
+ {
+ _BidirectionalIterator __first_cut = __first;
+ _BidirectionalIterator __second_cut = __middle;
+ _Distance __len11 = 0;
+ _Distance __len22 = 0;
+ if (__len1 > __len2)
+ {
+ __len11 = __len1 / 2;
+ std::advance(__first_cut, __len11);
+ __second_cut = std::lower_bound(__middle, __last,
+ *__first_cut);
+ __len22 = std::distance(__middle, __second_cut);
+ }
+ else
+ {
+ __len22 = __len2 / 2;
+ std::advance(__second_cut, __len22);
+ __first_cut = std::upper_bound(__first, __middle,
+ *__second_cut);
+ __len11 = std::distance(__first, __first_cut);
+ }
+ _BidirectionalIterator __new_middle =
+ std::__rotate_adaptive(__first_cut, __middle, __second_cut,
+ __len1 - __len11, __len22, __buffer,
+ __buffer_size);
+ std::__merge_adaptive(__first, __first_cut, __new_middle, __len11,
+ __len22, __buffer, __buffer_size);
+ std::__merge_adaptive(__new_middle, __second_cut, __last,
+ __len1 - __len11,
+ __len2 - __len22, __buffer, __buffer_size);
+ }
+ }
+
+ /// This is a helper function for the merge routines.
+ template<typename _BidirectionalIterator, typename _Distance,
+ typename _Pointer, typename _Compare>
+ void
+ __merge_adaptive(_BidirectionalIterator __first,
+ _BidirectionalIterator __middle,
+ _BidirectionalIterator __last,
+ _Distance __len1, _Distance __len2,
+ _Pointer __buffer, _Distance __buffer_size,
+ _Compare __comp)
+ {
+ if (__len1 <= __len2 && __len1 <= __buffer_size)
+ {
+ _Pointer __buffer_end = std::copy(__first, __middle, __buffer);
+ _GLIBCXX_STD_P::merge(__buffer, __buffer_end, __middle, __last,
+ __first, __comp);
+ }
+ else if (__len2 <= __buffer_size)
+ {
+ _Pointer __buffer_end = std::copy(__middle, __last, __buffer);
+ std::__merge_backward(__first, __middle, __buffer, __buffer_end,
+ __last, __comp);
+ }
+ else
+ {
+ _BidirectionalIterator __first_cut = __first;
+ _BidirectionalIterator __second_cut = __middle;
+ _Distance __len11 = 0;
+ _Distance __len22 = 0;
+ if (__len1 > __len2)
+ {
+ __len11 = __len1 / 2;
+ std::advance(__first_cut, __len11);
+ __second_cut = std::lower_bound(__middle, __last, *__first_cut,
+ __comp);
+ __len22 = std::distance(__middle, __second_cut);
+ }
+ else
+ {
+ __len22 = __len2 / 2;
+ std::advance(__second_cut, __len22);
+ __first_cut = std::upper_bound(__first, __middle, *__second_cut,
+ __comp);
+ __len11 = std::distance(__first, __first_cut);
+ }
+ _BidirectionalIterator __new_middle =
+ std::__rotate_adaptive(__first_cut, __middle, __second_cut,
+ __len1 - __len11, __len22, __buffer,
+ __buffer_size);
+ std::__merge_adaptive(__first, __first_cut, __new_middle, __len11,
+ __len22, __buffer, __buffer_size, __comp);
+ std::__merge_adaptive(__new_middle, __second_cut, __last,
+ __len1 - __len11,
+ __len2 - __len22, __buffer,
+ __buffer_size, __comp);
+ }
+ }
+
+ /// This is a helper function for the merge routines.
+ template<typename _BidirectionalIterator, typename _Distance>
+ void
+ __merge_without_buffer(_BidirectionalIterator __first,
+ _BidirectionalIterator __middle,
+ _BidirectionalIterator __last,
+ _Distance __len1, _Distance __len2)
+ {
+ if (__len1 == 0 || __len2 == 0)
+ return;
+ if (__len1 + __len2 == 2)
+ {
+ if (*__middle < *__first)
+ std::iter_swap(__first, __middle);
+ return;
+ }
+ _BidirectionalIterator __first_cut = __first;
+ _BidirectionalIterator __second_cut = __middle;
+ _Distance __len11 = 0;
+ _Distance __len22 = 0;
+ if (__len1 > __len2)
+ {
+ __len11 = __len1 / 2;
+ std::advance(__first_cut, __len11);
+ __second_cut = std::lower_bound(__middle, __last, *__first_cut);
+ __len22 = std::distance(__middle, __second_cut);
+ }
+ else
+ {
+ __len22 = __len2 / 2;
+ std::advance(__second_cut, __len22);
+ __first_cut = std::upper_bound(__first, __middle, *__second_cut);
+ __len11 = std::distance(__first, __first_cut);
+ }
+ std::rotate(__first_cut, __middle, __second_cut);
+ _BidirectionalIterator __new_middle = __first_cut;
+ std::advance(__new_middle, std::distance(__middle, __second_cut));
+ std::__merge_without_buffer(__first, __first_cut, __new_middle,
+ __len11, __len22);
+ std::__merge_without_buffer(__new_middle, __second_cut, __last,
+ __len1 - __len11, __len2 - __len22);
+ }
+
+ /// This is a helper function for the merge routines.
+ template<typename _BidirectionalIterator, typename _Distance,
+ typename _Compare>
+ void
+ __merge_without_buffer(_BidirectionalIterator __first,
+ _BidirectionalIterator __middle,
+ _BidirectionalIterator __last,
+ _Distance __len1, _Distance __len2,
+ _Compare __comp)
+ {
+ if (__len1 == 0 || __len2 == 0)
+ return;
+ if (__len1 + __len2 == 2)
+ {
+ if (__comp(*__middle, *__first))
+ std::iter_swap(__first, __middle);
+ return;
+ }
+ _BidirectionalIterator __first_cut = __first;
+ _BidirectionalIterator __second_cut = __middle;
+ _Distance __len11 = 0;
+ _Distance __len22 = 0;
+ if (__len1 > __len2)
+ {
+ __len11 = __len1 / 2;
+ std::advance(__first_cut, __len11);
+ __second_cut = std::lower_bound(__middle, __last, *__first_cut,
+ __comp);
+ __len22 = std::distance(__middle, __second_cut);
+ }
+ else
+ {
+ __len22 = __len2 / 2;
+ std::advance(__second_cut, __len22);
+ __first_cut = std::upper_bound(__first, __middle, *__second_cut,
+ __comp);
+ __len11 = std::distance(__first, __first_cut);
+ }
+ std::rotate(__first_cut, __middle, __second_cut);
+ _BidirectionalIterator __new_middle = __first_cut;
+ std::advance(__new_middle, std::distance(__middle, __second_cut));
+ std::__merge_without_buffer(__first, __first_cut, __new_middle,
+ __len11, __len22, __comp);
+ std::__merge_without_buffer(__new_middle, __second_cut, __last,
+ __len1 - __len11, __len2 - __len22, __comp);
+ }
+
+ /**
+ * @brief Merges two sorted ranges in place.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param middle Another iterator.
+ * @param last Another iterator.
+ * @return Nothing.
+ *
+ * Merges two sorted and consecutive ranges, [first,middle) and
+ * [middle,last), and puts the result in [first,last). The output will
+ * be sorted. The sort is @e stable, that is, for equivalent
+ * elements in the two ranges, elements from the first range will always
+ * come before elements from the second.
+ *
+ * If enough additional memory is available, this takes (last-first)-1
+ * comparisons. Otherwise an NlogN algorithm is used, where N is
+ * distance(first,last).
+ */
+ template<typename _BidirectionalIterator>
+ void
+ inplace_merge(_BidirectionalIterator __first,
+ _BidirectionalIterator __middle,
+ _BidirectionalIterator __last)
+ {
+ typedef typename iterator_traits<_BidirectionalIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_BidirectionalIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<
+ _BidirectionalIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_sorted(__first, __middle);
+ __glibcxx_requires_sorted(__middle, __last);
+
+ if (__first == __middle || __middle == __last)
+ return;
+
+ _DistanceType __len1 = std::distance(__first, __middle);
+ _DistanceType __len2 = std::distance(__middle, __last);
+
+ _Temporary_buffer<_BidirectionalIterator, _ValueType> __buf(__first,
+ __last);
+ if (__buf.begin() == 0)
+ std::__merge_without_buffer(__first, __middle, __last, __len1, __len2);
+ else
+ std::__merge_adaptive(__first, __middle, __last, __len1, __len2,
+ __buf.begin(), _DistanceType(__buf.size()));
+ }
+
+ /**
+ * @brief Merges two sorted ranges in place.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param middle Another iterator.
+ * @param last Another iterator.
+ * @param comp A functor to use for comparisons.
+ * @return Nothing.
+ *
+ * Merges two sorted and consecutive ranges, [first,middle) and
+ * [middle,last), and puts the result in [first,last). The output will
+ * be sorted. The sort is @e stable, that is, for equivalent
+ * elements in the two ranges, elements from the first range will always
+ * come before elements from the second.
+ *
+ * If enough additional memory is available, this takes (last-first)-1
+ * comparisons. Otherwise an NlogN algorithm is used, where N is
+ * distance(first,last).
+ *
+ * The comparison function should have the same effects on ordering as
+ * the function used for the initial sort.
+ */
+ template<typename _BidirectionalIterator, typename _Compare>
+ void
+ inplace_merge(_BidirectionalIterator __first,
+ _BidirectionalIterator __middle,
+ _BidirectionalIterator __last,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_BidirectionalIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_BidirectionalIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<
+ _BidirectionalIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType, _ValueType>)
+ __glibcxx_requires_sorted_pred(__first, __middle, __comp);
+ __glibcxx_requires_sorted_pred(__middle, __last, __comp);
+
+ if (__first == __middle || __middle == __last)
+ return;
+
+ const _DistanceType __len1 = std::distance(__first, __middle);
+ const _DistanceType __len2 = std::distance(__middle, __last);
+
+ _Temporary_buffer<_BidirectionalIterator, _ValueType> __buf(__first,
+ __last);
+ if (__buf.begin() == 0)
+ std::__merge_without_buffer(__first, __middle, __last, __len1,
+ __len2, __comp);
+ else
+ std::__merge_adaptive(__first, __middle, __last, __len1, __len2,
+ __buf.begin(), _DistanceType(__buf.size()),
+ __comp);
+ }
+
+ template<typename _RandomAccessIterator1, typename _RandomAccessIterator2,
+ typename _Distance>
+ void
+ __merge_sort_loop(_RandomAccessIterator1 __first,
+ _RandomAccessIterator1 __last,
+ _RandomAccessIterator2 __result,
+ _Distance __step_size)
+ {
+ const _Distance __two_step = 2 * __step_size;
+
+ while (__last - __first >= __two_step)
+ {
+ __result = _GLIBCXX_STD_P::merge(__first, __first + __step_size,
+ __first + __step_size,
+ __first + __two_step,
+ __result);
+ __first += __two_step;
+ }
+
+ __step_size = std::min(_Distance(__last - __first), __step_size);
+ _GLIBCXX_STD_P::merge(__first, __first + __step_size,
+ __first + __step_size, __last,
+ __result);
+ }
+
+ template<typename _RandomAccessIterator1, typename _RandomAccessIterator2,
+ typename _Distance, typename _Compare>
+ void
+ __merge_sort_loop(_RandomAccessIterator1 __first,
+ _RandomAccessIterator1 __last,
+ _RandomAccessIterator2 __result, _Distance __step_size,
+ _Compare __comp)
+ {
+ const _Distance __two_step = 2 * __step_size;
+
+ while (__last - __first >= __two_step)
+ {
+ __result = _GLIBCXX_STD_P::merge(__first, __first + __step_size,
+ __first + __step_size, __first + __two_step,
+ __result,
+ __comp);
+ __first += __two_step;
+ }
+ __step_size = std::min(_Distance(__last - __first), __step_size);
+
+ _GLIBCXX_STD_P::merge(__first, __first + __step_size,
+ __first + __step_size, __last, __result, __comp);
+ }
+
+ template<typename _RandomAccessIterator, typename _Distance>
+ void
+ __chunk_insertion_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Distance __chunk_size)
+ {
+ while (__last - __first >= __chunk_size)
+ {
+ std::__insertion_sort(__first, __first + __chunk_size);
+ __first += __chunk_size;
+ }
+ std::__insertion_sort(__first, __last);
+ }
+
+ template<typename _RandomAccessIterator, typename _Distance,
+ typename _Compare>
+ void
+ __chunk_insertion_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Distance __chunk_size, _Compare __comp)
+ {
+ while (__last - __first >= __chunk_size)
+ {
+ std::__insertion_sort(__first, __first + __chunk_size, __comp);
+ __first += __chunk_size;
+ }
+ std::__insertion_sort(__first, __last, __comp);
+ }
+
+ enum { _S_chunk_size = 7 };
+
+ template<typename _RandomAccessIterator, typename _Pointer>
+ void
+ __merge_sort_with_buffer(_RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Pointer __buffer)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _Distance;
+
+ const _Distance __len = __last - __first;
+ const _Pointer __buffer_last = __buffer + __len;
+
+ _Distance __step_size = _S_chunk_size;
+ std::__chunk_insertion_sort(__first, __last, __step_size);
+
+ while (__step_size < __len)
+ {
+ std::__merge_sort_loop(__first, __last, __buffer, __step_size);
+ __step_size *= 2;
+ std::__merge_sort_loop(__buffer, __buffer_last, __first, __step_size);
+ __step_size *= 2;
+ }
+ }
+
+ template<typename _RandomAccessIterator, typename _Pointer, typename _Compare>
+ void
+ __merge_sort_with_buffer(_RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Pointer __buffer, _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _Distance;
+
+ const _Distance __len = __last - __first;
+ const _Pointer __buffer_last = __buffer + __len;
+
+ _Distance __step_size = _S_chunk_size;
+ std::__chunk_insertion_sort(__first, __last, __step_size, __comp);
+
+ while (__step_size < __len)
+ {
+ std::__merge_sort_loop(__first, __last, __buffer,
+ __step_size, __comp);
+ __step_size *= 2;
+ std::__merge_sort_loop(__buffer, __buffer_last, __first,
+ __step_size, __comp);
+ __step_size *= 2;
+ }
+ }
+
+ template<typename _RandomAccessIterator, typename _Pointer,
+ typename _Distance>
+ void
+ __stable_sort_adaptive(_RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Pointer __buffer, _Distance __buffer_size)
+ {
+ const _Distance __len = (__last - __first + 1) / 2;
+ const _RandomAccessIterator __middle = __first + __len;
+ if (__len > __buffer_size)
+ {
+ std::__stable_sort_adaptive(__first, __middle,
+ __buffer, __buffer_size);
+ std::__stable_sort_adaptive(__middle, __last,
+ __buffer, __buffer_size);
+ }
+ else
+ {
+ std::__merge_sort_with_buffer(__first, __middle, __buffer);
+ std::__merge_sort_with_buffer(__middle, __last, __buffer);
+ }
+ std::__merge_adaptive(__first, __middle, __last,
+ _Distance(__middle - __first),
+ _Distance(__last - __middle),
+ __buffer, __buffer_size);
+ }
+
+ template<typename _RandomAccessIterator, typename _Pointer,
+ typename _Distance, typename _Compare>
+ void
+ __stable_sort_adaptive(_RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Pointer __buffer, _Distance __buffer_size,
+ _Compare __comp)
+ {
+ const _Distance __len = (__last - __first + 1) / 2;
+ const _RandomAccessIterator __middle = __first + __len;
+ if (__len > __buffer_size)
+ {
+ std::__stable_sort_adaptive(__first, __middle, __buffer,
+ __buffer_size, __comp);
+ std::__stable_sort_adaptive(__middle, __last, __buffer,
+ __buffer_size, __comp);
+ }
+ else
+ {
+ std::__merge_sort_with_buffer(__first, __middle, __buffer, __comp);
+ std::__merge_sort_with_buffer(__middle, __last, __buffer, __comp);
+ }
+ std::__merge_adaptive(__first, __middle, __last,
+ _Distance(__middle - __first),
+ _Distance(__last - __middle),
+ __buffer, __buffer_size,
+ __comp);
+ }
+
+ /// This is a helper function for the stable sorting routines.
+ template<typename _RandomAccessIterator>
+ void
+ __inplace_stable_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last)
+ {
+ if (__last - __first < 15)
+ {
+ std::__insertion_sort(__first, __last);
+ return;
+ }
+ _RandomAccessIterator __middle = __first + (__last - __first) / 2;
+ std::__inplace_stable_sort(__first, __middle);
+ std::__inplace_stable_sort(__middle, __last);
+ std::__merge_without_buffer(__first, __middle, __last,
+ __middle - __first,
+ __last - __middle);
+ }
+
+ /// This is a helper function for the stable sorting routines.
+ template<typename _RandomAccessIterator, typename _Compare>
+ void
+ __inplace_stable_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __last, _Compare __comp)
+ {
+ if (__last - __first < 15)
+ {
+ std::__insertion_sort(__first, __last, __comp);
+ return;
+ }
+ _RandomAccessIterator __middle = __first + (__last - __first) / 2;
+ std::__inplace_stable_sort(__first, __middle, __comp);
+ std::__inplace_stable_sort(__middle, __last, __comp);
+ std::__merge_without_buffer(__first, __middle, __last,
+ __middle - __first,
+ __last - __middle,
+ __comp);
+ }
+
+ // stable_sort
+
+ // Set algorithms: includes, set_union, set_intersection, set_difference,
+ // set_symmetric_difference. All of these algorithms have the precondition
+ // that their input ranges are sorted and the postcondition that their output
+ // ranges are sorted.
+
+ /**
+ * @brief Determines whether all elements of a sequence exists in a range.
+ * @param first1 Start of search range.
+ * @param last1 End of search range.
+ * @param first2 Start of sequence
+ * @param last2 End of sequence.
+ * @return True if each element in [first2,last2) is contained in order
+ * within [first1,last1). False otherwise.
+ * @ingroup set_algorithms
+ *
+ * This operation expects both [first1,last1) and [first2,last2) to be
+ * sorted. Searches for the presence of each element in [first2,last2)
+ * within [first1,last1). The iterators over each range only move forward,
+ * so this is a linear algorithm. If an element in [first2,last2) is not
+ * found before the search iterator reaches @a last2, false is returned.
+ */
+ template<typename _InputIterator1, typename _InputIterator2>
+ bool
+ includes(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set(__first1, __last1, __first2);
+ __glibcxx_requires_sorted_set(__first2, __last2, __first1);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ if (*__first2 < *__first1)
+ return false;
+ else if(*__first1 < *__first2)
+ ++__first1;
+ else
+ ++__first1, ++__first2;
+
+ return __first2 == __last2;
+ }
+
+ /**
+ * @brief Determines whether all elements of a sequence exists in a range
+ * using comparison.
+ * @ingroup set_algorithms
+ * @param first1 Start of search range.
+ * @param last1 End of search range.
+ * @param first2 Start of sequence
+ * @param last2 End of sequence.
+ * @param comp Comparison function to use.
+ * @return True if each element in [first2,last2) is contained in order
+ * within [first1,last1) according to comp. False otherwise.
+ * @ingroup set_algorithms
+ *
+ * This operation expects both [first1,last1) and [first2,last2) to be
+ * sorted. Searches for the presence of each element in [first2,last2)
+ * within [first1,last1), using comp to decide. The iterators over each
+ * range only move forward, so this is a linear algorithm. If an element
+ * in [first2,last2) is not found before the search iterator reaches @a
+ * last2, false is returned.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _Compare>
+ bool
+ includes(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp);
+ __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ if (__comp(*__first2, *__first1))
+ return false;
+ else if(__comp(*__first1, *__first2))
+ ++__first1;
+ else
+ ++__first1, ++__first2;
+
+ return __first2 == __last2;
+ }
+
+ // nth_element
+ // merge
+ // set_difference
+ // set_intersection
+ // set_union
+ // stable_sort
+ // set_symmetric_difference
+ // min_element
+ // max_element
+
+ /**
+ * @brief Permute range into the next "dictionary" ordering.
+ * @ingroup sorting_algorithms
+ * @param first Start of range.
+ * @param last End of range.
+ * @return False if wrapped to first permutation, true otherwise.
+ *
+ * Treats all permutations of the range as a set of "dictionary" sorted
+ * sequences. Permutes the current sequence into the next one of this set.
+ * Returns true if there are more sequences to generate. If the sequence
+ * is the largest of the set, the smallest is generated and false returned.
+ */
+ template<typename _BidirectionalIterator>
+ bool
+ next_permutation(_BidirectionalIterator __first,
+ _BidirectionalIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<
+ _BidirectionalIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_BidirectionalIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return false;
+ _BidirectionalIterator __i = __first;
+ ++__i;
+ if (__i == __last)
+ return false;
+ __i = __last;
+ --__i;
+
+ for(;;)
+ {
+ _BidirectionalIterator __ii = __i;
+ --__i;
+ if (*__i < *__ii)
+ {
+ _BidirectionalIterator __j = __last;
+ while (!(*__i < *--__j))
+ {}
+ std::iter_swap(__i, __j);
+ std::reverse(__ii, __last);
+ return true;
+ }
+ if (__i == __first)
+ {
+ std::reverse(__first, __last);
+ return false;
+ }
+ }
+ }
+
+ /**
+ * @brief Permute range into the next "dictionary" ordering using
+ * comparison functor.
+ * @ingroup sorting_algorithms
+ * @param first Start of range.
+ * @param last End of range.
+ * @param comp A comparison functor.
+ * @return False if wrapped to first permutation, true otherwise.
+ *
+ * Treats all permutations of the range [first,last) as a set of
+ * "dictionary" sorted sequences ordered by @a comp. Permutes the current
+ * sequence into the next one of this set. Returns true if there are more
+ * sequences to generate. If the sequence is the largest of the set, the
+ * smallest is generated and false returned.
+ */
+ template<typename _BidirectionalIterator, typename _Compare>
+ bool
+ next_permutation(_BidirectionalIterator __first,
+ _BidirectionalIterator __last, _Compare __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<
+ _BidirectionalIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_BidirectionalIterator>::value_type,
+ typename iterator_traits<_BidirectionalIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return false;
+ _BidirectionalIterator __i = __first;
+ ++__i;
+ if (__i == __last)
+ return false;
+ __i = __last;
+ --__i;
+
+ for(;;)
+ {
+ _BidirectionalIterator __ii = __i;
+ --__i;
+ if (__comp(*__i, *__ii))
+ {
+ _BidirectionalIterator __j = __last;
+ while (!bool(__comp(*__i, *--__j)))
+ {}
+ std::iter_swap(__i, __j);
+ std::reverse(__ii, __last);
+ return true;
+ }
+ if (__i == __first)
+ {
+ std::reverse(__first, __last);
+ return false;
+ }
+ }
+ }
+
+ /**
+ * @brief Permute range into the previous "dictionary" ordering.
+ * @ingroup sorting_algorithms
+ * @param first Start of range.
+ * @param last End of range.
+ * @return False if wrapped to last permutation, true otherwise.
+ *
+ * Treats all permutations of the range as a set of "dictionary" sorted
+ * sequences. Permutes the current sequence into the previous one of this
+ * set. Returns true if there are more sequences to generate. If the
+ * sequence is the smallest of the set, the largest is generated and false
+ * returned.
+ */
+ template<typename _BidirectionalIterator>
+ bool
+ prev_permutation(_BidirectionalIterator __first,
+ _BidirectionalIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<
+ _BidirectionalIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_BidirectionalIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return false;
+ _BidirectionalIterator __i = __first;
+ ++__i;
+ if (__i == __last)
+ return false;
+ __i = __last;
+ --__i;
+
+ for(;;)
+ {
+ _BidirectionalIterator __ii = __i;
+ --__i;
+ if (*__ii < *__i)
+ {
+ _BidirectionalIterator __j = __last;
+ while (!(*--__j < *__i))
+ {}
+ std::iter_swap(__i, __j);
+ std::reverse(__ii, __last);
+ return true;
+ }
+ if (__i == __first)
+ {
+ std::reverse(__first, __last);
+ return false;
+ }
+ }
+ }
+
+ /**
+ * @brief Permute range into the previous "dictionary" ordering using
+ * comparison functor.
+ * @ingroup sorting_algorithms
+ * @param first Start of range.
+ * @param last End of range.
+ * @param comp A comparison functor.
+ * @return False if wrapped to last permutation, true otherwise.
+ *
+ * Treats all permutations of the range [first,last) as a set of
+ * "dictionary" sorted sequences ordered by @a comp. Permutes the current
+ * sequence into the previous one of this set. Returns true if there are
+ * more sequences to generate. If the sequence is the smallest of the set,
+ * the largest is generated and false returned.
+ */
+ template<typename _BidirectionalIterator, typename _Compare>
+ bool
+ prev_permutation(_BidirectionalIterator __first,
+ _BidirectionalIterator __last, _Compare __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<
+ _BidirectionalIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_BidirectionalIterator>::value_type,
+ typename iterator_traits<_BidirectionalIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return false;
+ _BidirectionalIterator __i = __first;
+ ++__i;
+ if (__i == __last)
+ return false;
+ __i = __last;
+ --__i;
+
+ for(;;)
+ {
+ _BidirectionalIterator __ii = __i;
+ --__i;
+ if (__comp(*__ii, *__i))
+ {
+ _BidirectionalIterator __j = __last;
+ while (!bool(__comp(*--__j, *__i)))
+ {}
+ std::iter_swap(__i, __j);
+ std::reverse(__ii, __last);
+ return true;
+ }
+ if (__i == __first)
+ {
+ std::reverse(__first, __last);
+ return false;
+ }
+ }
+ }
+
+ // replace
+ // replace_if
+
+ /**
+ * @brief Copy a sequence, replacing each element of one value with another
+ * value.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @param old_value The value to be replaced.
+ * @param new_value The replacement value.
+ * @return The end of the output sequence, @p result+(last-first).
+ *
+ * Copies each element in the input range @p [first,last) to the
+ * output range @p [result,result+(last-first)) replacing elements
+ * equal to @p old_value with @p new_value.
+ */
+ template<typename _InputIterator, typename _OutputIterator, typename _Tp>
+ _OutputIterator
+ replace_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result,
+ const _Tp& __old_value, const _Tp& __new_value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_InputIterator>::value_type, _Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first, ++__result)
+ if (*__first == __old_value)
+ *__result = __new_value;
+ else
+ *__result = *__first;
+ return __result;
+ }
+
+ /**
+ * @brief Copy a sequence, replacing each value for which a predicate
+ * returns true with another value.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @param pred A predicate.
+ * @param new_value The replacement value.
+ * @return The end of the output sequence, @p result+(last-first).
+ *
+ * Copies each element in the range @p [first,last) to the range
+ * @p [result,result+(last-first)) replacing elements for which
+ * @p pred returns true with @p new_value.
+ */
+ template<typename _InputIterator, typename _OutputIterator,
+ typename _Predicate, typename _Tp>
+ _OutputIterator
+ replace_copy_if(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result,
+ _Predicate __pred, const _Tp& __new_value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first, ++__result)
+ if (__pred(*__first))
+ *__result = __new_value;
+ else
+ *__result = *__first;
+ return __result;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Determines whether the elements of a sequence are sorted.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @return True if the elements are sorted, false otherwise.
+ */
+ template<typename _ForwardIterator>
+ inline bool
+ is_sorted(_ForwardIterator __first, _ForwardIterator __last)
+ { return std::is_sorted_until(__first, __last) == __last; }
+
+ /**
+ * @brief Determines whether the elements of a sequence are sorted
+ * according to a comparison functor.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param comp A comparison functor.
+ * @return True if the elements are sorted, false otherwise.
+ */
+ template<typename _ForwardIterator, typename _Compare>
+ inline bool
+ is_sorted(_ForwardIterator __first, _ForwardIterator __last,
+ _Compare __comp)
+ { return std::is_sorted_until(__first, __last, __comp) == __last; }
+
+ /**
+ * @brief Determines the end of a sorted sequence.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @return An iterator pointing to the last iterator i in [first, last)
+ * for which the range [first, i) is sorted.
+ */
+ template<typename _ForwardIterator>
+ _ForwardIterator
+ is_sorted_until(_ForwardIterator __first, _ForwardIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __last;
+
+ _ForwardIterator __next = __first;
+ for (++__next; __next != __last; __first = __next, ++__next)
+ if (*__next < *__first)
+ return __next;
+ return __next;
+ }
+
+ /**
+ * @brief Determines the end of a sorted sequence using comparison functor.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param comp A comparison functor.
+ * @return An iterator pointing to the last iterator i in [first, last)
+ * for which the range [first, i) is sorted.
+ */
+ template<typename _ForwardIterator, typename _Compare>
+ _ForwardIterator
+ is_sorted_until(_ForwardIterator __first, _ForwardIterator __last,
+ _Compare __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __last;
+
+ _ForwardIterator __next = __first;
+ for (++__next; __next != __last; __first = __next, ++__next)
+ if (__comp(*__next, *__first))
+ return __next;
+ return __next;
+ }
+
+ /**
+ * @brief Determines min and max at once as an ordered pair.
+ * @ingroup sorting_algorithms
+ * @param a A thing of arbitrary type.
+ * @param b Another thing of arbitrary type.
+ * @return A pair(b, a) if b is smaller than a, pair(a, b) otherwise.
+ */
+ template<typename _Tp>
+ inline pair<const _Tp&, const _Tp&>
+ minmax(const _Tp& __a, const _Tp& __b)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
+
+ return __b < __a ? pair<const _Tp&, const _Tp&>(__b, __a)
+ : pair<const _Tp&, const _Tp&>(__a, __b);
+ }
+
+ /**
+ * @brief Determines min and max at once as an ordered pair.
+ * @ingroup sorting_algorithms
+ * @param a A thing of arbitrary type.
+ * @param b Another thing of arbitrary type.
+ * @param comp A @link comparison_functor comparison functor@endlink.
+ * @return A pair(b, a) if b is smaller than a, pair(a, b) otherwise.
+ */
+ template<typename _Tp, typename _Compare>
+ inline pair<const _Tp&, const _Tp&>
+ minmax(const _Tp& __a, const _Tp& __b, _Compare __comp)
+ {
+ return __comp(__b, __a) ? pair<const _Tp&, const _Tp&>(__b, __a)
+ : pair<const _Tp&, const _Tp&>(__a, __b);
+ }
+
+ /**
+ * @brief Return a pair of iterators pointing to the minimum and maximum
+ * elements in a range.
+ * @ingroup sorting_algorithms
+ * @param first Start of range.
+ * @param last End of range.
+ * @return make_pair(m, M), where m is the first iterator i in
+ * [first, last) such that no other element in the range is
+ * smaller, and where M is the last iterator i in [first, last)
+ * such that no other element in the range is larger.
+ */
+ template<typename _ForwardIterator>
+ pair<_ForwardIterator, _ForwardIterator>
+ minmax_element(_ForwardIterator __first, _ForwardIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ _ForwardIterator __next = __first;
+ if (__first == __last
+ || ++__next == __last)
+ return std::make_pair(__first, __first);
+
+ _ForwardIterator __min, __max;
+ if (*__next < *__first)
+ {
+ __min = __next;
+ __max = __first;
+ }
+ else
+ {
+ __min = __first;
+ __max = __next;
+ }
+
+ __first = __next;
+ ++__first;
+
+ while (__first != __last)
+ {
+ __next = __first;
+ if (++__next == __last)
+ {
+ if (*__first < *__min)
+ __min = __first;
+ else if (!(*__first < *__max))
+ __max = __first;
+ break;
+ }
+
+ if (*__next < *__first)
+ {
+ if (*__next < *__min)
+ __min = __next;
+ if (!(*__first < *__max))
+ __max = __first;
+ }
+ else
+ {
+ if (*__first < *__min)
+ __min = __first;
+ if (!(*__next < *__max))
+ __max = __next;
+ }
+
+ __first = __next;
+ ++__first;
+ }
+
+ return std::make_pair(__min, __max);
+ }
+
+ /**
+ * @brief Return a pair of iterators pointing to the minimum and maximum
+ * elements in a range.
+ * @ingroup sorting_algorithms
+ * @param first Start of range.
+ * @param last End of range.
+ * @param comp Comparison functor.
+ * @return make_pair(m, M), where m is the first iterator i in
+ * [first, last) such that no other element in the range is
+ * smaller, and where M is the last iterator i in [first, last)
+ * such that no other element in the range is larger.
+ */
+ template<typename _ForwardIterator, typename _Compare>
+ pair<_ForwardIterator, _ForwardIterator>
+ minmax_element(_ForwardIterator __first, _ForwardIterator __last,
+ _Compare __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ _ForwardIterator __next = __first;
+ if (__first == __last
+ || ++__next == __last)
+ return std::make_pair(__first, __first);
+
+ _ForwardIterator __min, __max;
+ if (__comp(*__next, *__first))
+ {
+ __min = __next;
+ __max = __first;
+ }
+ else
+ {
+ __min = __first;
+ __max = __next;
+ }
+
+ __first = __next;
+ ++__first;
+
+ while (__first != __last)
+ {
+ __next = __first;
+ if (++__next == __last)
+ {
+ if (__comp(*__first, *__min))
+ __min = __first;
+ else if (!__comp(*__first, *__max))
+ __max = __first;
+ break;
+ }
+
+ if (__comp(*__next, *__first))
+ {
+ if (__comp(*__next, *__min))
+ __min = __next;
+ if (!__comp(*__first, *__max))
+ __max = __first;
+ }
+ else
+ {
+ if (__comp(*__first, *__min))
+ __min = __first;
+ if (!__comp(*__next, *__max))
+ __max = __next;
+ }
+
+ __first = __next;
+ ++__first;
+ }
+
+ return std::make_pair(__min, __max);
+ }
+
+ // N2722 + fixes.
+ template<typename _Tp>
+ inline _Tp
+ min(initializer_list<_Tp> __l)
+ { return *std::min_element(__l.begin(), __l.end()); }
+
+ template<typename _Tp, typename _Compare>
+ inline _Tp
+ min(initializer_list<_Tp> __l, _Compare __comp)
+ { return *std::min_element(__l.begin(), __l.end(), __comp); }
+
+ template<typename _Tp>
+ inline _Tp
+ max(initializer_list<_Tp> __l)
+ { return *std::max_element(__l.begin(), __l.end()); }
+
+ template<typename _Tp, typename _Compare>
+ inline _Tp
+ max(initializer_list<_Tp> __l, _Compare __comp)
+ { return *std::max_element(__l.begin(), __l.end(), __comp); }
+
+ template<typename _Tp>
+ inline pair<_Tp, _Tp>
+ minmax(initializer_list<_Tp> __l)
+ {
+ pair<const _Tp*, const _Tp*> __p =
+ std::minmax_element(__l.begin(), __l.end());
+ return std::make_pair(*__p.first, *__p.second);
+ }
+
+ template<typename _Tp, typename _Compare>
+ inline pair<_Tp, _Tp>
+ minmax(initializer_list<_Tp> __l, _Compare __comp)
+ {
+ pair<const _Tp*, const _Tp*> __p =
+ std::minmax_element(__l.begin(), __l.end(), __comp);
+ return std::make_pair(*__p.first, *__p.second);
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P)
+
+ /**
+ * @brief Apply a function to every element of a sequence.
+ * @ingroup non_mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param f A unary function object.
+ * @return @p f.
+ *
+ * Applies the function object @p f to each element in the range
+ * @p [first,last). @p f must not modify the order of the sequence.
+ * If @p f has a return value it is ignored.
+ */
+ template<typename _InputIterator, typename _Function>
+ _Function
+ for_each(_InputIterator __first, _InputIterator __last, _Function __f)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+ for (; __first != __last; ++__first)
+ __f(*__first);
+ return __f;
+ }
+
+ /**
+ * @brief Find the first occurrence of a value in a sequence.
+ * @ingroup non_mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param val The value to find.
+ * @return The first iterator @c i in the range @p [first,last)
+ * such that @c *i == @p val, or @p last if no such iterator exists.
+ */
+ template<typename _InputIterator, typename _Tp>
+ inline _InputIterator
+ find(_InputIterator __first, _InputIterator __last,
+ const _Tp& __val)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_InputIterator>::value_type, _Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
+ return std::__find(__first, __last, __val,
+ std::__iterator_category(__first));
+ }
+
+ /**
+ * @brief Find the first element in a sequence for which a
+ * predicate is true.
+ * @ingroup non_mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param pred A predicate.
+ * @return The first iterator @c i in the range @p [first,last)
+ * such that @p pred(*i) is true, or @p last if no such iterator exists.
+ */
+ template<typename _InputIterator, typename _Predicate>
+ inline _InputIterator
+ find_if(_InputIterator __first, _InputIterator __last,
+ _Predicate __pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+ return std::__find_if(__first, __last, __pred,
+ std::__iterator_category(__first));
+ }
+
+ /**
+ * @brief Find element from a set in a sequence.
+ * @ingroup non_mutating_algorithms
+ * @param first1 Start of range to search.
+ * @param last1 End of range to search.
+ * @param first2 Start of match candidates.
+ * @param last2 End of match candidates.
+ * @return The first iterator @c i in the range
+ * @p [first1,last1) such that @c *i == @p *(i2) such that i2 is an
+ * iterator in [first2,last2), or @p last1 if no such iterator exists.
+ *
+ * Searches the range @p [first1,last1) for an element that is equal to
+ * some element in the range [first2,last2). If found, returns an iterator
+ * in the range [first1,last1), otherwise returns @p last1.
+ */
+ template<typename _InputIterator, typename _ForwardIterator>
+ _InputIterator
+ find_first_of(_InputIterator __first1, _InputIterator __last1,
+ _ForwardIterator __first2, _ForwardIterator __last2)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_InputIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ for (; __first1 != __last1; ++__first1)
+ for (_ForwardIterator __iter = __first2; __iter != __last2; ++__iter)
+ if (*__first1 == *__iter)
+ return __first1;
+ return __last1;
+ }
+
+ /**
+ * @brief Find element from a set in a sequence using a predicate.
+ * @ingroup non_mutating_algorithms
+ * @param first1 Start of range to search.
+ * @param last1 End of range to search.
+ * @param first2 Start of match candidates.
+ * @param last2 End of match candidates.
+ * @param comp Predicate to use.
+ * @return The first iterator @c i in the range
+ * @p [first1,last1) such that @c comp(*i, @p *(i2)) is true and i2 is an
+ * iterator in [first2,last2), or @p last1 if no such iterator exists.
+ *
+
+ * Searches the range @p [first1,last1) for an element that is
+ * equal to some element in the range [first2,last2). If found,
+ * returns an iterator in the range [first1,last1), otherwise
+ * returns @p last1.
+ */
+ template<typename _InputIterator, typename _ForwardIterator,
+ typename _BinaryPredicate>
+ _InputIterator
+ find_first_of(_InputIterator __first1, _InputIterator __last1,
+ _ForwardIterator __first2, _ForwardIterator __last2,
+ _BinaryPredicate __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_InputIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ for (; __first1 != __last1; ++__first1)
+ for (_ForwardIterator __iter = __first2; __iter != __last2; ++__iter)
+ if (__comp(*__first1, *__iter))
+ return __first1;
+ return __last1;
+ }
+
+ /**
+ * @brief Find two adjacent values in a sequence that are equal.
+ * @ingroup non_mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @return The first iterator @c i such that @c i and @c i+1 are both
+ * valid iterators in @p [first,last) and such that @c *i == @c *(i+1),
+ * or @p last if no such iterator exists.
+ */
+ template<typename _ForwardIterator>
+ _ForwardIterator
+ adjacent_find(_ForwardIterator __first, _ForwardIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_EqualityComparableConcept<
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+ if (__first == __last)
+ return __last;
+ _ForwardIterator __next = __first;
+ while(++__next != __last)
+ {
+ if (*__first == *__next)
+ return __first;
+ __first = __next;
+ }
+ return __last;
+ }
+
+ /**
+ * @brief Find two adjacent values in a sequence using a predicate.
+ * @ingroup non_mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param binary_pred A binary predicate.
+ * @return The first iterator @c i such that @c i and @c i+1 are both
+ * valid iterators in @p [first,last) and such that
+ * @p binary_pred(*i,*(i+1)) is true, or @p last if no such iterator
+ * exists.
+ */
+ template<typename _ForwardIterator, typename _BinaryPredicate>
+ _ForwardIterator
+ adjacent_find(_ForwardIterator __first, _ForwardIterator __last,
+ _BinaryPredicate __binary_pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+ if (__first == __last)
+ return __last;
+ _ForwardIterator __next = __first;
+ while(++__next != __last)
+ {
+ if (__binary_pred(*__first, *__next))
+ return __first;
+ __first = __next;
+ }
+ return __last;
+ }
+
+ /**
+ * @brief Count the number of copies of a value in a sequence.
+ * @ingroup non_mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param value The value to be counted.
+ * @return The number of iterators @c i in the range @p [first,last)
+ * for which @c *i == @p value
+ */
+ template<typename _InputIterator, typename _Tp>
+ typename iterator_traits<_InputIterator>::difference_type
+ count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_InputIterator>::value_type, _Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
+ typename iterator_traits<_InputIterator>::difference_type __n = 0;
+ for (; __first != __last; ++__first)
+ if (*__first == __value)
+ ++__n;
+ return __n;
+ }
+
+ /**
+ * @brief Count the elements of a sequence for which a predicate is true.
+ * @ingroup non_mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param pred A predicate.
+ * @return The number of iterators @c i in the range @p [first,last)
+ * for which @p pred(*i) is true.
+ */
+ template<typename _InputIterator, typename _Predicate>
+ typename iterator_traits<_InputIterator>::difference_type
+ count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+ typename iterator_traits<_InputIterator>::difference_type __n = 0;
+ for (; __first != __last; ++__first)
+ if (__pred(*__first))
+ ++__n;
+ return __n;
+ }
+
+ /**
+ * @brief Search a sequence for a matching sub-sequence.
+ * @ingroup non_mutating_algorithms
+ * @param first1 A forward iterator.
+ * @param last1 A forward iterator.
+ * @param first2 A forward iterator.
+ * @param last2 A forward iterator.
+ * @return The first iterator @c i in the range
+ * @p [first1,last1-(last2-first2)) such that @c *(i+N) == @p *(first2+N)
+ * for each @c N in the range @p [0,last2-first2), or @p last1 if no
+ * such iterator exists.
+ *
+ * Searches the range @p [first1,last1) for a sub-sequence that compares
+ * equal value-by-value with the sequence given by @p [first2,last2) and
+ * returns an iterator to the first element of the sub-sequence, or
+ * @p last1 if the sub-sequence is not found.
+ *
+ * Because the sub-sequence must lie completely within the range
+ * @p [first1,last1) it must start at a position less than
+ * @p last1-(last2-first2) where @p last2-first2 is the length of the
+ * sub-sequence.
+ * This means that the returned iterator @c i will be in the range
+ * @p [first1,last1-(last2-first2))
+ */
+ template<typename _ForwardIterator1, typename _ForwardIterator2>
+ _ForwardIterator1
+ search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator1>)
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator2>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_ForwardIterator1>::value_type,
+ typename iterator_traits<_ForwardIterator2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ // Test for empty ranges
+ if (__first1 == __last1 || __first2 == __last2)
+ return __first1;
+
+ // Test for a pattern of length 1.
+ _ForwardIterator2 __p1(__first2);
+ if (++__p1 == __last2)
+ return _GLIBCXX_STD_P::find(__first1, __last1, *__first2);
+
+ // General case.
+ _ForwardIterator2 __p;
+ _ForwardIterator1 __current = __first1;
+
+ for (;;)
+ {
+ __first1 = _GLIBCXX_STD_P::find(__first1, __last1, *__first2);
+ if (__first1 == __last1)
+ return __last1;
+
+ __p = __p1;
+ __current = __first1;
+ if (++__current == __last1)
+ return __last1;
+
+ while (*__current == *__p)
+ {
+ if (++__p == __last2)
+ return __first1;
+ if (++__current == __last1)
+ return __last1;
+ }
+ ++__first1;
+ }
+ return __first1;
+ }
+
+ /**
+ * @brief Search a sequence for a matching sub-sequence using a predicate.
+ * @ingroup non_mutating_algorithms
+ * @param first1 A forward iterator.
+ * @param last1 A forward iterator.
+ * @param first2 A forward iterator.
+ * @param last2 A forward iterator.
+ * @param predicate A binary predicate.
+ * @return The first iterator @c i in the range
+ * @p [first1,last1-(last2-first2)) such that
+ * @p predicate(*(i+N),*(first2+N)) is true for each @c N in the range
+ * @p [0,last2-first2), or @p last1 if no such iterator exists.
+ *
+ * Searches the range @p [first1,last1) for a sub-sequence that compares
+ * equal value-by-value with the sequence given by @p [first2,last2),
+ * using @p predicate to determine equality, and returns an iterator
+ * to the first element of the sub-sequence, or @p last1 if no such
+ * iterator exists.
+ *
+ * @see search(_ForwardIter1, _ForwardIter1, _ForwardIter2, _ForwardIter2)
+ */
+ template<typename _ForwardIterator1, typename _ForwardIterator2,
+ typename _BinaryPredicate>
+ _ForwardIterator1
+ search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2,
+ _BinaryPredicate __predicate)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator1>)
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_ForwardIterator1>::value_type,
+ typename iterator_traits<_ForwardIterator2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ // Test for empty ranges
+ if (__first1 == __last1 || __first2 == __last2)
+ return __first1;
+
+ // Test for a pattern of length 1.
+ _ForwardIterator2 __p1(__first2);
+ if (++__p1 == __last2)
+ {
+ while (__first1 != __last1
+ && !bool(__predicate(*__first1, *__first2)))
+ ++__first1;
+ return __first1;
+ }
+
+ // General case.
+ _ForwardIterator2 __p;
+ _ForwardIterator1 __current = __first1;
+
+ for (;;)
+ {
+ while (__first1 != __last1
+ && !bool(__predicate(*__first1, *__first2)))
+ ++__first1;
+ if (__first1 == __last1)
+ return __last1;
+
+ __p = __p1;
+ __current = __first1;
+ if (++__current == __last1)
+ return __last1;
+
+ while (__predicate(*__current, *__p))
+ {
+ if (++__p == __last2)
+ return __first1;
+ if (++__current == __last1)
+ return __last1;
+ }
+ ++__first1;
+ }
+ return __first1;
+ }
+
+
+ /**
+ * @brief Search a sequence for a number of consecutive values.
+ * @ingroup non_mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param count The number of consecutive values.
+ * @param val The value to find.
+ * @return The first iterator @c i in the range @p [first,last-count)
+ * such that @c *(i+N) == @p val for each @c N in the range @p [0,count),
+ * or @p last if no such iterator exists.
+ *
+ * Searches the range @p [first,last) for @p count consecutive elements
+ * equal to @p val.
+ */
+ template<typename _ForwardIterator, typename _Integer, typename _Tp>
+ _ForwardIterator
+ search_n(_ForwardIterator __first, _ForwardIterator __last,
+ _Integer __count, const _Tp& __val)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_ForwardIterator>::value_type, _Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__count <= 0)
+ return __first;
+ if (__count == 1)
+ return _GLIBCXX_STD_P::find(__first, __last, __val);
+ return std::__search_n(__first, __last, __count, __val,
+ std::__iterator_category(__first));
+ }
+
+
+ /**
+ * @brief Search a sequence for a number of consecutive values using a
+ * predicate.
+ * @ingroup non_mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param count The number of consecutive values.
+ * @param val The value to find.
+ * @param binary_pred A binary predicate.
+ * @return The first iterator @c i in the range @p [first,last-count)
+ * such that @p binary_pred(*(i+N),val) is true for each @c N in the
+ * range @p [0,count), or @p last if no such iterator exists.
+ *
+ * Searches the range @p [first,last) for @p count consecutive elements
+ * for which the predicate returns true.
+ */
+ template<typename _ForwardIterator, typename _Integer, typename _Tp,
+ typename _BinaryPredicate>
+ _ForwardIterator
+ search_n(_ForwardIterator __first, _ForwardIterator __last,
+ _Integer __count, const _Tp& __val,
+ _BinaryPredicate __binary_pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_ForwardIterator>::value_type, _Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__count <= 0)
+ return __first;
+ if (__count == 1)
+ {
+ while (__first != __last && !bool(__binary_pred(*__first, __val)))
+ ++__first;
+ return __first;
+ }
+ return std::__search_n(__first, __last, __count, __val, __binary_pred,
+ std::__iterator_category(__first));
+ }
+
+
+ /**
+ * @brief Perform an operation on a sequence.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @param unary_op A unary operator.
+ * @return An output iterator equal to @p result+(last-first).
+ *
+ * Applies the operator to each element in the input range and assigns
+ * the results to successive elements of the output sequence.
+ * Evaluates @p *(result+N)=unary_op(*(first+N)) for each @c N in the
+ * range @p [0,last-first).
+ *
+ * @p unary_op must not alter its argument.
+ */
+ template<typename _InputIterator, typename _OutputIterator,
+ typename _UnaryOperation>
+ _OutputIterator
+ transform(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, _UnaryOperation __unary_op)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ // "the type returned by a _UnaryOperation"
+ __typeof__(__unary_op(*__first))>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first, ++__result)
+ *__result = __unary_op(*__first);
+ return __result;
+ }
+
+ /**
+ * @brief Perform an operation on corresponding elements of two sequences.
+ * @ingroup mutating_algorithms
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @param result An output iterator.
+ * @param binary_op A binary operator.
+ * @return An output iterator equal to @p result+(last-first).
+ *
+ * Applies the operator to the corresponding elements in the two
+ * input ranges and assigns the results to successive elements of the
+ * output sequence.
+ * Evaluates @p *(result+N)=binary_op(*(first1+N),*(first2+N)) for each
+ * @c N in the range @p [0,last1-first1).
+ *
+ * @p binary_op must not alter either of its arguments.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator, typename _BinaryOperation>
+ _OutputIterator
+ transform(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _OutputIterator __result,
+ _BinaryOperation __binary_op)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ // "the type returned by a _BinaryOperation"
+ __typeof__(__binary_op(*__first1,*__first2))>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+
+ for (; __first1 != __last1; ++__first1, ++__first2, ++__result)
+ *__result = __binary_op(*__first1, *__first2);
+ return __result;
+ }
+
+ /**
+ * @brief Replace each occurrence of one value in a sequence with another
+ * value.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param old_value The value to be replaced.
+ * @param new_value The replacement value.
+ * @return replace() returns no value.
+ *
+ * For each iterator @c i in the range @p [first,last) if @c *i ==
+ * @p old_value then the assignment @c *i = @p new_value is performed.
+ */
+ template<typename _ForwardIterator, typename _Tp>
+ void
+ replace(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __old_value, const _Tp& __new_value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_ForwardIterator>::value_type, _Tp>)
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first)
+ if (*__first == __old_value)
+ *__first = __new_value;
+ }
+
+ /**
+ * @brief Replace each value in a sequence for which a predicate returns
+ * true with another value.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param pred A predicate.
+ * @param new_value The replacement value.
+ * @return replace_if() returns no value.
+ *
+ * For each iterator @c i in the range @p [first,last) if @p pred(*i)
+ * is true then the assignment @c *i = @p new_value is performed.
+ */
+ template<typename _ForwardIterator, typename _Predicate, typename _Tp>
+ void
+ replace_if(_ForwardIterator __first, _ForwardIterator __last,
+ _Predicate __pred, const _Tp& __new_value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first)
+ if (__pred(*__first))
+ *__first = __new_value;
+ }
+
+ /**
+ * @brief Assign the result of a function object to each value in a
+ * sequence.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param gen A function object taking no arguments and returning
+ * std::iterator_traits<_ForwardIterator>::value_type
+ * @return generate() returns no value.
+ *
+ * Performs the assignment @c *i = @p gen() for each @c i in the range
+ * @p [first,last).
+ */
+ template<typename _ForwardIterator, typename _Generator>
+ void
+ generate(_ForwardIterator __first, _ForwardIterator __last,
+ _Generator __gen)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_GeneratorConcept<_Generator,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first)
+ *__first = __gen();
+ }
+
+ /**
+ * @brief Assign the result of a function object to each value in a
+ * sequence.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param n The length of the sequence.
+ * @param gen A function object taking no arguments and returning
+ * std::iterator_traits<_ForwardIterator>::value_type
+ * @return The end of the sequence, @p first+n
+ *
+ * Performs the assignment @c *i = @p gen() for each @c i in the range
+ * @p [first,first+n).
+ */
+ template<typename _OutputIterator, typename _Size, typename _Generator>
+ _OutputIterator
+ generate_n(_OutputIterator __first, _Size __n, _Generator __gen)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ // "the type returned by a _Generator"
+ __typeof__(__gen())>)
+
+ for (; __n > 0; --__n, ++__first)
+ *__first = __gen();
+ return __first;
+ }
+
+
+ /**
+ * @brief Copy a sequence, removing consecutive duplicate values.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * Copies each element in the range @p [first,last) to the range
+ * beginning at @p result, except that only the first element is copied
+ * from groups of consecutive elements that compare equal.
+ * unique_copy() is stable, so the relative order of elements that are
+ * copied is unchanged.
+ *
+ * _GLIBCXX_RESOLVE_LIB_DEFECTS
+ * DR 241. Does unique_copy() require CopyConstructible and Assignable?
+ *
+ * _GLIBCXX_RESOLVE_LIB_DEFECTS
+ * DR 538. 241 again: Does unique_copy() require CopyConstructible and
+ * Assignable?
+ */
+ template<typename _InputIterator, typename _OutputIterator>
+ inline _OutputIterator
+ unique_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_function_requires(_EqualityComparableConcept<
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __result;
+ return std::__unique_copy(__first, __last, __result,
+ std::__iterator_category(__first),
+ std::__iterator_category(__result));
+ }
+
+ /**
+ * @brief Copy a sequence, removing consecutive values using a predicate.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @param binary_pred A binary predicate.
+ * @return An iterator designating the end of the resulting sequence.
+ *
+ * Copies each element in the range @p [first,last) to the range
+ * beginning at @p result, except that only the first element is copied
+ * from groups of consecutive elements for which @p binary_pred returns
+ * true.
+ * unique_copy() is stable, so the relative order of elements that are
+ * copied is unchanged.
+ *
+ * _GLIBCXX_RESOLVE_LIB_DEFECTS
+ * DR 241. Does unique_copy() require CopyConstructible and Assignable?
+ */
+ template<typename _InputIterator, typename _OutputIterator,
+ typename _BinaryPredicate>
+ inline _OutputIterator
+ unique_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result,
+ _BinaryPredicate __binary_pred)
+ {
+ // concept requirements -- predicates checked later
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __result;
+ return std::__unique_copy(__first, __last, __result, __binary_pred,
+ std::__iterator_category(__first),
+ std::__iterator_category(__result));
+ }
+
+
+ /**
+ * @brief Randomly shuffle the elements of a sequence.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @return Nothing.
+ *
+ * Reorder the elements in the range @p [first,last) using a random
+ * distribution, so that every possible ordering of the sequence is
+ * equally likely.
+ */
+ template<typename _RandomAccessIterator>
+ inline void
+ random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first != __last)
+ for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
+ std::iter_swap(__i, __first + (std::rand() % ((__i - __first) + 1)));
+ }
+
+ /**
+ * @brief Shuffle the elements of a sequence using a random number
+ * generator.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param rand The RNG functor or function.
+ * @return Nothing.
+ *
+ * Reorders the elements in the range @p [first,last) using @p rand to
+ * provide a random distribution. Calling @p rand(N) for a positive
+ * integer @p N should return a randomly chosen integer from the
+ * range [0,N).
+ */
+ template<typename _RandomAccessIterator, typename _RandomNumberGenerator>
+ void
+ random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _RandomNumberGenerator& __rand)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return;
+ for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
+ std::iter_swap(__i, __first + __rand((__i - __first) + 1));
+ }
+
+
+ /**
+ * @brief Move elements for which a predicate is true to the beginning
+ * of a sequence.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param pred A predicate functor.
+ * @return An iterator @p middle such that @p pred(i) is true for each
+ * iterator @p i in the range @p [first,middle) and false for each @p i
+ * in the range @p [middle,last).
+ *
+ * @p pred must not modify its operand. @p partition() does not preserve
+ * the relative ordering of elements in each group, use
+ * @p stable_partition() if this is needed.
+ */
+ template<typename _ForwardIterator, typename _Predicate>
+ inline _ForwardIterator
+ partition(_ForwardIterator __first, _ForwardIterator __last,
+ _Predicate __pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ return std::__partition(__first, __last, __pred,
+ std::__iterator_category(__first));
+ }
+
+
+
+ /**
+ * @brief Sort the smallest elements of a sequence.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param middle Another iterator.
+ * @param last Another iterator.
+ * @return Nothing.
+ *
+ * Sorts the smallest @p (middle-first) elements in the range
+ * @p [first,last) and moves them to the range @p [first,middle). The
+ * order of the remaining elements in the range @p [middle,last) is
+ * undefined.
+ * After the sort if @p i and @j are iterators in the range
+ * @p [first,middle) such that @i precedes @j and @k is an iterator in
+ * the range @p [middle,last) then @p *j<*i and @p *k<*i are both false.
+ */
+ template<typename _RandomAccessIterator>
+ inline void
+ partial_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __middle,
+ _RandomAccessIterator __last)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_valid_range(__first, __middle);
+ __glibcxx_requires_valid_range(__middle, __last);
+
+ std::__heap_select(__first, __middle, __last);
+ std::sort_heap(__first, __middle);
+ }
+
+ /**
+ * @brief Sort the smallest elements of a sequence using a predicate
+ * for comparison.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param middle Another iterator.
+ * @param last Another iterator.
+ * @param comp A comparison functor.
+ * @return Nothing.
+ *
+ * Sorts the smallest @p (middle-first) elements in the range
+ * @p [first,last) and moves them to the range @p [first,middle). The
+ * order of the remaining elements in the range @p [middle,last) is
+ * undefined.
+ * After the sort if @p i and @j are iterators in the range
+ * @p [first,middle) such that @i precedes @j and @k is an iterator in
+ * the range @p [middle,last) then @p *comp(j,*i) and @p comp(*k,*i)
+ * are both false.
+ */
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline void
+ partial_sort(_RandomAccessIterator __first,
+ _RandomAccessIterator __middle,
+ _RandomAccessIterator __last,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType, _ValueType>)
+ __glibcxx_requires_valid_range(__first, __middle);
+ __glibcxx_requires_valid_range(__middle, __last);
+
+ std::__heap_select(__first, __middle, __last, __comp);
+ std::sort_heap(__first, __middle, __comp);
+ }
+
+ /**
+ * @brief Sort a sequence just enough to find a particular position.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param nth Another iterator.
+ * @param last Another iterator.
+ * @return Nothing.
+ *
+ * Rearranges the elements in the range @p [first,last) so that @p *nth
+ * is the same element that would have been in that position had the
+ * whole sequence been sorted.
+ * whole sequence been sorted. The elements either side of @p *nth are
+ * not completely sorted, but for any iterator @i in the range
+ * @p [first,nth) and any iterator @j in the range @p [nth,last) it
+ * holds that @p *j<*i is false.
+ */
+ template<typename _RandomAccessIterator>
+ inline void
+ nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth,
+ _RandomAccessIterator __last)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_valid_range(__first, __nth);
+ __glibcxx_requires_valid_range(__nth, __last);
+
+ if (__first == __last || __nth == __last)
+ return;
+
+ std::__introselect(__first, __nth, __last,
+ std::__lg(__last - __first) * 2);
+ }
+
+ /**
+ * @brief Sort a sequence just enough to find a particular position
+ * using a predicate for comparison.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param nth Another iterator.
+ * @param last Another iterator.
+ * @param comp A comparison functor.
+ * @return Nothing.
+ *
+ * Rearranges the elements in the range @p [first,last) so that @p *nth
+ * is the same element that would have been in that position had the
+ * whole sequence been sorted. The elements either side of @p *nth are
+ * not completely sorted, but for any iterator @i in the range
+ * @p [first,nth) and any iterator @j in the range @p [nth,last) it
+ * holds that @p comp(*j,*i) is false.
+ */
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline void
+ nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth,
+ _RandomAccessIterator __last, _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType, _ValueType>)
+ __glibcxx_requires_valid_range(__first, __nth);
+ __glibcxx_requires_valid_range(__nth, __last);
+
+ if (__first == __last || __nth == __last)
+ return;
+
+ std::__introselect(__first, __nth, __last,
+ std::__lg(__last - __first) * 2, __comp);
+ }
+
+
+ /**
+ * @brief Sort the elements of a sequence.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @return Nothing.
+ *
+ * Sorts the elements in the range @p [first,last) in ascending order,
+ * such that @p *(i+1)<*i is false for each iterator @p i in the range
+ * @p [first,last-1).
+ *
+ * The relative ordering of equivalent elements is not preserved, use
+ * @p stable_sort() if this is needed.
+ */
+ template<typename _RandomAccessIterator>
+ inline void
+ sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first != __last)
+ {
+ std::__introsort_loop(__first, __last,
+ std::__lg(__last - __first) * 2);
+ std::__final_insertion_sort(__first, __last);
+ }
+ }
+
+ /**
+ * @brief Sort the elements of a sequence using a predicate for comparison.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param comp A comparison functor.
+ * @return Nothing.
+ *
+ * Sorts the elements in the range @p [first,last) in ascending order,
+ * such that @p comp(*(i+1),*i) is false for every iterator @p i in the
+ * range @p [first,last-1).
+ *
+ * The relative ordering of equivalent elements is not preserved, use
+ * @p stable_sort() if this is needed.
+ */
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline void
+ sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, _ValueType,
+ _ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first != __last)
+ {
+ std::__introsort_loop(__first, __last,
+ std::__lg(__last - __first) * 2, __comp);
+ std::__final_insertion_sort(__first, __last, __comp);
+ }
+ }
+
+ /**
+ * @brief Merges two sorted ranges.
+ * @ingroup sorting_algorithms
+ * @param first1 An iterator.
+ * @param first2 Another iterator.
+ * @param last1 Another iterator.
+ * @param last2 Another iterator.
+ * @param result An iterator pointing to the end of the merged range.
+ * @return An iterator pointing to the first element "not less
+ * than" @a val.
+ *
+ * Merges the ranges [first1,last1) and [first2,last2) into the sorted range
+ * [result, result + (last1-first1) + (last2-first2)). Both input ranges
+ * must be sorted, and the output range must not overlap with either of
+ * the input ranges. The sort is @e stable, that is, for equivalent
+ * elements in the two ranges, elements from the first range will always
+ * come before elements from the second.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator>
+ _OutputIterator
+ merge(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType1>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set(__first1, __last1, __first2);
+ __glibcxx_requires_sorted_set(__first2, __last2, __first1);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ {
+ if (*__first2 < *__first1)
+ {
+ *__result = *__first2;
+ ++__first2;
+ }
+ else
+ {
+ *__result = *__first1;
+ ++__first1;
+ }
+ ++__result;
+ }
+ return std::copy(__first2, __last2, std::copy(__first1, __last1,
+ __result));
+ }
+
+ /**
+ * @brief Merges two sorted ranges.
+ * @ingroup sorting_algorithms
+ * @param first1 An iterator.
+ * @param first2 Another iterator.
+ * @param last1 Another iterator.
+ * @param last2 Another iterator.
+ * @param result An iterator pointing to the end of the merged range.
+ * @param comp A functor to use for comparisons.
+ * @return An iterator pointing to the first element "not less
+ * than" @a val.
+ *
+ * Merges the ranges [first1,last1) and [first2,last2) into the sorted range
+ * [result, result + (last1-first1) + (last2-first2)). Both input ranges
+ * must be sorted, and the output range must not overlap with either of
+ * the input ranges. The sort is @e stable, that is, for equivalent
+ * elements in the two ranges, elements from the first range will always
+ * come before elements from the second.
+ *
+ * The comparison function should have the same effects on ordering as
+ * the function used for the initial sort.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator, typename _Compare>
+ _OutputIterator
+ merge(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result, _Compare __comp)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType1>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp);
+ __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ {
+ if (__comp(*__first2, *__first1))
+ {
+ *__result = *__first2;
+ ++__first2;
+ }
+ else
+ {
+ *__result = *__first1;
+ ++__first1;
+ }
+ ++__result;
+ }
+ return std::copy(__first2, __last2, std::copy(__first1, __last1,
+ __result));
+ }
+
+
+ /**
+ * @brief Sort the elements of a sequence, preserving the relative order
+ * of equivalent elements.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @return Nothing.
+ *
+ * Sorts the elements in the range @p [first,last) in ascending order,
+ * such that @p *(i+1)<*i is false for each iterator @p i in the range
+ * @p [first,last-1).
+ *
+ * The relative ordering of equivalent elements is preserved, so any two
+ * elements @p x and @p y in the range @p [first,last) such that
+ * @p x<y is false and @p y<x is false will have the same relative
+ * ordering after calling @p stable_sort().
+ */
+ template<typename _RandomAccessIterator>
+ inline void
+ stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ _Temporary_buffer<_RandomAccessIterator, _ValueType> __buf(__first,
+ __last);
+ if (__buf.begin() == 0)
+ std::__inplace_stable_sort(__first, __last);
+ else
+ std::__stable_sort_adaptive(__first, __last, __buf.begin(),
+ _DistanceType(__buf.size()));
+ }
+
+ /**
+ * @brief Sort the elements of a sequence using a predicate for comparison,
+ * preserving the relative order of equivalent elements.
+ * @ingroup sorting_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param comp A comparison functor.
+ * @return Nothing.
+ *
+ * Sorts the elements in the range @p [first,last) in ascending order,
+ * such that @p comp(*(i+1),*i) is false for each iterator @p i in the
+ * range @p [first,last-1).
+ *
+ * The relative ordering of equivalent elements is preserved, so any two
+ * elements @p x and @p y in the range @p [first,last) such that
+ * @p comp(x,y) is false and @p comp(y,x) is false will have the same
+ * relative ordering after calling @p stable_sort().
+ */
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline void
+ stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType,
+ _ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ _Temporary_buffer<_RandomAccessIterator, _ValueType> __buf(__first,
+ __last);
+ if (__buf.begin() == 0)
+ std::__inplace_stable_sort(__first, __last, __comp);
+ else
+ std::__stable_sort_adaptive(__first, __last, __buf.begin(),
+ _DistanceType(__buf.size()), __comp);
+ }
+
+
+ /**
+ * @brief Return the union of two sorted ranges.
+ * @ingroup set_algorithms
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @return End of the output range.
+ * @ingroup set_algorithms
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * each range in order to the output range. Iterators increment for each
+ * range. When the current element of one range is less than the other,
+ * that element is copied and the iterator advanced. If an element is
+ * contained in both ranges, the element from the first range is copied and
+ * both ranges advance. The output range may not overlap either input
+ * range.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator>
+ _OutputIterator
+ set_union(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType1>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set(__first1, __last1, __first2);
+ __glibcxx_requires_sorted_set(__first2, __last2, __first1);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ {
+ if (*__first1 < *__first2)
+ {
+ *__result = *__first1;
+ ++__first1;
+ }
+ else if (*__first2 < *__first1)
+ {
+ *__result = *__first2;
+ ++__first2;
+ }
+ else
+ {
+ *__result = *__first1;
+ ++__first1;
+ ++__first2;
+ }
+ ++__result;
+ }
+ return std::copy(__first2, __last2, std::copy(__first1, __last1,
+ __result));
+ }
+
+ /**
+ * @brief Return the union of two sorted ranges using a comparison functor.
+ * @ingroup set_algorithms
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @param comp The comparison functor.
+ * @return End of the output range.
+ * @ingroup set_algorithms
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * each range in order to the output range. Iterators increment for each
+ * range. When the current element of one range is less than the other
+ * according to @a comp, that element is copied and the iterator advanced.
+ * If an equivalent element according to @a comp is contained in both
+ * ranges, the element from the first range is copied and both ranges
+ * advance. The output range may not overlap either input range.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator, typename _Compare>
+ _OutputIterator
+ set_union(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result, _Compare __comp)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType1>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp);
+ __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ {
+ if (__comp(*__first1, *__first2))
+ {
+ *__result = *__first1;
+ ++__first1;
+ }
+ else if (__comp(*__first2, *__first1))
+ {
+ *__result = *__first2;
+ ++__first2;
+ }
+ else
+ {
+ *__result = *__first1;
+ ++__first1;
+ ++__first2;
+ }
+ ++__result;
+ }
+ return std::copy(__first2, __last2, std::copy(__first1, __last1,
+ __result));
+ }
+
+ /**
+ * @brief Return the intersection of two sorted ranges.
+ * @ingroup set_algorithms
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @return End of the output range.
+ * @ingroup set_algorithms
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * both ranges in order to the output range. Iterators increment for each
+ * range. When the current element of one range is less than the other,
+ * that iterator advances. If an element is contained in both ranges, the
+ * element from the first range is copied and both ranges advance. The
+ * output range may not overlap either input range.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator>
+ _OutputIterator
+ set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType1>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set(__first1, __last1, __first2);
+ __glibcxx_requires_sorted_set(__first2, __last2, __first1);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ if (*__first1 < *__first2)
+ ++__first1;
+ else if (*__first2 < *__first1)
+ ++__first2;
+ else
+ {
+ *__result = *__first1;
+ ++__first1;
+ ++__first2;
+ ++__result;
+ }
+ return __result;
+ }
+
+ /**
+ * @brief Return the intersection of two sorted ranges using comparison
+ * functor.
+ * @ingroup set_algorithms
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @param comp The comparison functor.
+ * @return End of the output range.
+ * @ingroup set_algorithms
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * both ranges in order to the output range. Iterators increment for each
+ * range. When the current element of one range is less than the other
+ * according to @a comp, that iterator advances. If an element is
+ * contained in both ranges according to @a comp, the element from the
+ * first range is copied and both ranges advance. The output range may not
+ * overlap either input range.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator, typename _Compare>
+ _OutputIterator
+ set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result, _Compare __comp)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType1>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp);
+ __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ if (__comp(*__first1, *__first2))
+ ++__first1;
+ else if (__comp(*__first2, *__first1))
+ ++__first2;
+ else
+ {
+ *__result = *__first1;
+ ++__first1;
+ ++__first2;
+ ++__result;
+ }
+ return __result;
+ }
+
+ /**
+ * @brief Return the difference of two sorted ranges.
+ * @ingroup set_algorithms
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @return End of the output range.
+ * @ingroup set_algorithms
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * the first range but not the second in order to the output range.
+ * Iterators increment for each range. When the current element of the
+ * first range is less than the second, that element is copied and the
+ * iterator advances. If the current element of the second range is less,
+ * the iterator advances, but no element is copied. If an element is
+ * contained in both ranges, no elements are copied and both ranges
+ * advance. The output range may not overlap either input range.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator>
+ _OutputIterator
+ set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType1>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set(__first1, __last1, __first2);
+ __glibcxx_requires_sorted_set(__first2, __last2, __first1);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ if (*__first1 < *__first2)
+ {
+ *__result = *__first1;
+ ++__first1;
+ ++__result;
+ }
+ else if (*__first2 < *__first1)
+ ++__first2;
+ else
+ {
+ ++__first1;
+ ++__first2;
+ }
+ return std::copy(__first1, __last1, __result);
+ }
+
+ /**
+ * @brief Return the difference of two sorted ranges using comparison
+ * functor.
+ * @ingroup set_algorithms
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @param comp The comparison functor.
+ * @return End of the output range.
+ * @ingroup set_algorithms
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * the first range but not the second in order to the output range.
+ * Iterators increment for each range. When the current element of the
+ * first range is less than the second according to @a comp, that element
+ * is copied and the iterator advances. If the current element of the
+ * second range is less, no element is copied and the iterator advances.
+ * If an element is contained in both ranges according to @a comp, no
+ * elements are copied and both ranges advance. The output range may not
+ * overlap either input range.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator, typename _Compare>
+ _OutputIterator
+ set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result, _Compare __comp)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType1>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp);
+ __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ if (__comp(*__first1, *__first2))
+ {
+ *__result = *__first1;
+ ++__first1;
+ ++__result;
+ }
+ else if (__comp(*__first2, *__first1))
+ ++__first2;
+ else
+ {
+ ++__first1;
+ ++__first2;
+ }
+ return std::copy(__first1, __last1, __result);
+ }
+
+ /**
+ * @brief Return the symmetric difference of two sorted ranges.
+ * @ingroup set_algorithms
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @return End of the output range.
+ * @ingroup set_algorithms
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * one range but not the other in order to the output range. Iterators
+ * increment for each range. When the current element of one range is less
+ * than the other, that element is copied and the iterator advances. If an
+ * element is contained in both ranges, no elements are copied and both
+ * ranges advance. The output range may not overlap either input range.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator>
+ _OutputIterator
+ set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType1>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set(__first1, __last1, __first2);
+ __glibcxx_requires_sorted_set(__first2, __last2, __first1);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ if (*__first1 < *__first2)
+ {
+ *__result = *__first1;
+ ++__first1;
+ ++__result;
+ }
+ else if (*__first2 < *__first1)
+ {
+ *__result = *__first2;
+ ++__first2;
+ ++__result;
+ }
+ else
+ {
+ ++__first1;
+ ++__first2;
+ }
+ return std::copy(__first2, __last2, std::copy(__first1,
+ __last1, __result));
+ }
+
+ /**
+ * @brief Return the symmetric difference of two sorted ranges using
+ * comparison functor.
+ * @ingroup set_algorithms
+ * @param first1 Start of first range.
+ * @param last1 End of first range.
+ * @param first2 Start of second range.
+ * @param last2 End of second range.
+ * @param comp The comparison functor.
+ * @return End of the output range.
+ * @ingroup set_algorithms
+ *
+ * This operation iterates over both ranges, copying elements present in
+ * one range but not the other in order to the output range. Iterators
+ * increment for each range. When the current element of one range is less
+ * than the other according to @a comp, that element is copied and the
+ * iterator advances. If an element is contained in both ranges according
+ * to @a comp, no elements are copied and both ranges advance. The output
+ * range may not overlap either input range.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _OutputIterator, typename _Compare>
+ _OutputIterator
+ set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _OutputIterator __result,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType1>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType2, _ValueType1>)
+ __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp);
+ __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp);
+
+ while (__first1 != __last1 && __first2 != __last2)
+ if (__comp(*__first1, *__first2))
+ {
+ *__result = *__first1;
+ ++__first1;
+ ++__result;
+ }
+ else if (__comp(*__first2, *__first1))
+ {
+ *__result = *__first2;
+ ++__first2;
+ ++__result;
+ }
+ else
+ {
+ ++__first1;
+ ++__first2;
+ }
+ return std::copy(__first2, __last2,
+ std::copy(__first1, __last1, __result));
+ }
+
+
+ /**
+ * @brief Return the minimum element in a range.
+ * @ingroup sorting_algorithms
+ * @param first Start of range.
+ * @param last End of range.
+ * @return Iterator referencing the first instance of the smallest value.
+ */
+ template<typename _ForwardIterator>
+ _ForwardIterator
+ min_element(_ForwardIterator __first, _ForwardIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __first;
+ _ForwardIterator __result = __first;
+ while (++__first != __last)
+ if (*__first < *__result)
+ __result = __first;
+ return __result;
+ }
+
+ /**
+ * @brief Return the minimum element in a range using comparison functor.
+ * @ingroup sorting_algorithms
+ * @param first Start of range.
+ * @param last End of range.
+ * @param comp Comparison functor.
+ * @return Iterator referencing the first instance of the smallest value
+ * according to comp.
+ */
+ template<typename _ForwardIterator, typename _Compare>
+ _ForwardIterator
+ min_element(_ForwardIterator __first, _ForwardIterator __last,
+ _Compare __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __first;
+ _ForwardIterator __result = __first;
+ while (++__first != __last)
+ if (__comp(*__first, *__result))
+ __result = __first;
+ return __result;
+ }
+
+ /**
+ * @brief Return the maximum element in a range.
+ * @ingroup sorting_algorithms
+ * @param first Start of range.
+ * @param last End of range.
+ * @return Iterator referencing the first instance of the largest value.
+ */
+ template<typename _ForwardIterator>
+ _ForwardIterator
+ max_element(_ForwardIterator __first, _ForwardIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __first;
+ _ForwardIterator __result = __first;
+ while (++__first != __last)
+ if (*__result < *__first)
+ __result = __first;
+ return __result;
+ }
+
+ /**
+ * @brief Return the maximum element in a range using comparison functor.
+ * @ingroup sorting_algorithms
+ * @param first Start of range.
+ * @param last End of range.
+ * @param comp Comparison functor.
+ * @return Iterator referencing the first instance of the largest value
+ * according to comp.
+ */
+ template<typename _ForwardIterator, typename _Compare>
+ _ForwardIterator
+ max_element(_ForwardIterator __first, _ForwardIterator __last,
+ _Compare __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last) return __first;
+ _ForwardIterator __result = __first;
+ while (++__first != __last)
+ if (__comp(*__result, *__first))
+ __result = __first;
+ return __result;
+ }
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _STL_ALGO_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_algobase.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_algobase.h
new file mode 100644
index 0000000..2cef923
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_algobase.h
@@ -0,0 +1,1153 @@
+// Core algorithmic facilities -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_algobase.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_ALGOBASE_H
+#define _STL_ALGOBASE_H 1
+
+#include <bits/c++config.h>
+#include <cstddef>
+#include <bits/functexcept.h>
+#include <bits/cpp_type_traits.h>
+#include <ext/type_traits.h>
+#include <ext/numeric_traits.h>
+#include <bits/stl_pair.h>
+#include <bits/stl_iterator_base_types.h>
+#include <bits/stl_iterator_base_funcs.h>
+#include <bits/stl_iterator.h>
+#include <bits/concept_check.h>
+#include <debug/debug.h>
+#include <bits/move.h> // For std::swap and _GLIBCXX_MOVE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // See http://gcc.gnu.org/ml/libstdc++/2004-08/msg00167.html: in a
+ // nutshell, we are partially implementing the resolution of DR 187,
+ // when it's safe, i.e., the value_types are equal.
+ template<bool _BoolType>
+ struct __iter_swap
+ {
+ template<typename _ForwardIterator1, typename _ForwardIterator2>
+ static void
+ iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
+ {
+ typedef typename iterator_traits<_ForwardIterator1>::value_type
+ _ValueType1;
+ _ValueType1 __tmp = _GLIBCXX_MOVE(*__a);
+ *__a = _GLIBCXX_MOVE(*__b);
+ *__b = _GLIBCXX_MOVE(__tmp);
+ }
+ };
+
+ template<>
+ struct __iter_swap<true>
+ {
+ template<typename _ForwardIterator1, typename _ForwardIterator2>
+ static void
+ iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
+ {
+ swap(*__a, *__b);
+ }
+ };
+
+ /**
+ * @brief Swaps the contents of two iterators.
+ * @ingroup mutating_algorithms
+ * @param a An iterator.
+ * @param b Another iterator.
+ * @return Nothing.
+ *
+ * This function swaps the values pointed to by two iterators, not the
+ * iterators themselves.
+ */
+ template<typename _ForwardIterator1, typename _ForwardIterator2>
+ inline void
+ iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
+ {
+ typedef typename iterator_traits<_ForwardIterator1>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_ForwardIterator2>::value_type
+ _ValueType2;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator1>)
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator2>)
+ __glibcxx_function_requires(_ConvertibleConcept<_ValueType1,
+ _ValueType2>)
+ __glibcxx_function_requires(_ConvertibleConcept<_ValueType2,
+ _ValueType1>)
+
+ typedef typename iterator_traits<_ForwardIterator1>::reference
+ _ReferenceType1;
+ typedef typename iterator_traits<_ForwardIterator2>::reference
+ _ReferenceType2;
+ std::__iter_swap<__are_same<_ValueType1, _ValueType2>::__value
+ && __are_same<_ValueType1&, _ReferenceType1>::__value
+ && __are_same<_ValueType2&, _ReferenceType2>::__value>::
+ iter_swap(__a, __b);
+ }
+
+ /**
+ * @brief Swap the elements of two sequences.
+ * @ingroup mutating_algorithms
+ * @param first1 A forward iterator.
+ * @param last1 A forward iterator.
+ * @param first2 A forward iterator.
+ * @return An iterator equal to @p first2+(last1-first1).
+ *
+ * Swaps each element in the range @p [first1,last1) with the
+ * corresponding element in the range @p [first2,(last1-first1)).
+ * The ranges must not overlap.
+ */
+ template<typename _ForwardIterator1, typename _ForwardIterator2>
+ _ForwardIterator2
+ swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator1>)
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator2>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+
+ for (; __first1 != __last1; ++__first1, ++__first2)
+ std::iter_swap(__first1, __first2);
+ return __first2;
+ }
+
+ /**
+ * @brief This does what you think it does.
+ * @ingroup sorting_algorithms
+ * @param a A thing of arbitrary type.
+ * @param b Another thing of arbitrary type.
+ * @return The lesser of the parameters.
+ *
+ * This is the simple classic generic implementation. It will work on
+ * temporary expressions, since they are only evaluated once, unlike a
+ * preprocessor macro.
+ */
+ template<typename _Tp>
+ inline const _Tp&
+ min(const _Tp& __a, const _Tp& __b)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
+ //return __b < __a ? __b : __a;
+ if (__b < __a)
+ return __b;
+ return __a;
+ }
+
+ /**
+ * @brief This does what you think it does.
+ * @ingroup sorting_algorithms
+ * @param a A thing of arbitrary type.
+ * @param b Another thing of arbitrary type.
+ * @return The greater of the parameters.
+ *
+ * This is the simple classic generic implementation. It will work on
+ * temporary expressions, since they are only evaluated once, unlike a
+ * preprocessor macro.
+ */
+ template<typename _Tp>
+ inline const _Tp&
+ max(const _Tp& __a, const _Tp& __b)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
+ //return __a < __b ? __b : __a;
+ if (__a < __b)
+ return __b;
+ return __a;
+ }
+
+ /**
+ * @brief This does what you think it does.
+ * @ingroup sorting_algorithms
+ * @param a A thing of arbitrary type.
+ * @param b Another thing of arbitrary type.
+ * @param comp A @link comparison_functors comparison functor@endlink.
+ * @return The lesser of the parameters.
+ *
+ * This will work on temporary expressions, since they are only evaluated
+ * once, unlike a preprocessor macro.
+ */
+ template<typename _Tp, typename _Compare>
+ inline const _Tp&
+ min(const _Tp& __a, const _Tp& __b, _Compare __comp)
+ {
+ //return __comp(__b, __a) ? __b : __a;
+ if (__comp(__b, __a))
+ return __b;
+ return __a;
+ }
+
+ /**
+ * @brief This does what you think it does.
+ * @ingroup sorting_algorithms
+ * @param a A thing of arbitrary type.
+ * @param b Another thing of arbitrary type.
+ * @param comp A @link comparison_functors comparison functor@endlink.
+ * @return The greater of the parameters.
+ *
+ * This will work on temporary expressions, since they are only evaluated
+ * once, unlike a preprocessor macro.
+ */
+ template<typename _Tp, typename _Compare>
+ inline const _Tp&
+ max(const _Tp& __a, const _Tp& __b, _Compare __comp)
+ {
+ //return __comp(__a, __b) ? __b : __a;
+ if (__comp(__a, __b))
+ return __b;
+ return __a;
+ }
+
+
+ // If _Iterator is a __normal_iterator return its base (a plain pointer,
+ // normally) otherwise return it untouched. See copy, fill, ...
+ template<typename _Iterator,
+ bool _IsNormal = __is_normal_iterator<_Iterator>::__value>
+ struct __niter_base
+ {
+ static _Iterator
+ __b(_Iterator __it)
+ { return __it; }
+ };
+
+ template<typename _Iterator>
+ struct __niter_base<_Iterator, true>
+ {
+ static typename _Iterator::iterator_type
+ __b(_Iterator __it)
+ { return __it.base(); }
+ };
+
+ // Likewise, for move_iterator.
+ template<typename _Iterator,
+ bool _IsMove = __is_move_iterator<_Iterator>::__value>
+ struct __miter_base
+ {
+ static _Iterator
+ __b(_Iterator __it)
+ { return __it; }
+ };
+
+ template<typename _Iterator>
+ struct __miter_base<_Iterator, true>
+ {
+ static typename _Iterator::iterator_type
+ __b(_Iterator __it)
+ { return __it.base(); }
+ };
+
+ // All of these auxiliary structs serve two purposes. (1) Replace
+ // calls to copy with memmove whenever possible. (Memmove, not memcpy,
+ // because the input and output ranges are permitted to overlap.)
+ // (2) If we're using random access iterators, then write the loop as
+ // a for loop with an explicit count.
+
+ template<bool, bool, typename>
+ struct __copy_move
+ {
+ template<typename _II, typename _OI>
+ static _OI
+ __copy_m(_II __first, _II __last, _OI __result)
+ {
+ for (; __first != __last; ++__result, ++__first)
+ *__result = *__first;
+ return __result;
+ }
+ };
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Category>
+ struct __copy_move<true, false, _Category>
+ {
+ template<typename _II, typename _OI>
+ static _OI
+ __copy_m(_II __first, _II __last, _OI __result)
+ {
+ for (; __first != __last; ++__result, ++__first)
+ *__result = std::move(*__first);
+ return __result;
+ }
+ };
+#endif
+
+ template<>
+ struct __copy_move<false, false, random_access_iterator_tag>
+ {
+ template<typename _II, typename _OI>
+ static _OI
+ __copy_m(_II __first, _II __last, _OI __result)
+ {
+ typedef typename iterator_traits<_II>::difference_type _Distance;
+ for(_Distance __n = __last - __first; __n > 0; --__n)
+ {
+ *__result = *__first;
+ ++__first;
+ ++__result;
+ }
+ return __result;
+ }
+ };
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<>
+ struct __copy_move<true, false, random_access_iterator_tag>
+ {
+ template<typename _II, typename _OI>
+ static _OI
+ __copy_m(_II __first, _II __last, _OI __result)
+ {
+ typedef typename iterator_traits<_II>::difference_type _Distance;
+ for(_Distance __n = __last - __first; __n > 0; --__n)
+ {
+ *__result = std::move(*__first);
+ ++__first;
+ ++__result;
+ }
+ return __result;
+ }
+ };
+#endif
+
+ template<bool _IsMove>
+ struct __copy_move<_IsMove, true, random_access_iterator_tag>
+ {
+ template<typename _Tp>
+ static _Tp*
+ __copy_m(const _Tp* __first, const _Tp* __last, _Tp* __result)
+ {
+ __builtin_memmove(__result, __first,
+ sizeof(_Tp) * (__last - __first));
+ return __result + (__last - __first);
+ }
+ };
+
+ template<bool _IsMove, typename _II, typename _OI>
+ inline _OI
+ __copy_move_a(_II __first, _II __last, _OI __result)
+ {
+ typedef typename iterator_traits<_II>::value_type _ValueTypeI;
+ typedef typename iterator_traits<_OI>::value_type _ValueTypeO;
+ typedef typename iterator_traits<_II>::iterator_category _Category;
+ const bool __simple = (__is_pod(_ValueTypeI)
+ && __is_pointer<_II>::__value
+ && __is_pointer<_OI>::__value
+ && __are_same<_ValueTypeI, _ValueTypeO>::__value);
+
+ return std::__copy_move<_IsMove, __simple,
+ _Category>::__copy_m(__first, __last, __result);
+ }
+
+ // Helpers for streambuf iterators (either istream or ostream).
+ // NB: avoid including <iosfwd>, relatively large.
+ template<typename _CharT>
+ struct char_traits;
+
+ template<typename _CharT, typename _Traits>
+ class istreambuf_iterator;
+
+ template<typename _CharT, typename _Traits>
+ class ostreambuf_iterator;
+
+ template<bool _IsMove, typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
+ __copy_move_a2(_CharT*, _CharT*,
+ ostreambuf_iterator<_CharT, char_traits<_CharT> >);
+
+ template<bool _IsMove, typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
+ __copy_move_a2(const _CharT*, const _CharT*,
+ ostreambuf_iterator<_CharT, char_traits<_CharT> >);
+
+ template<bool _IsMove, typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ _CharT*>::__type
+ __copy_move_a2(istreambuf_iterator<_CharT, char_traits<_CharT> >,
+ istreambuf_iterator<_CharT, char_traits<_CharT> >, _CharT*);
+
+ template<bool _IsMove, typename _II, typename _OI>
+ inline _OI
+ __copy_move_a2(_II __first, _II __last, _OI __result)
+ {
+ return _OI(std::__copy_move_a<_IsMove>
+ (std::__niter_base<_II>::__b(__first),
+ std::__niter_base<_II>::__b(__last),
+ std::__niter_base<_OI>::__b(__result)));
+ }
+
+ /**
+ * @brief Copies the range [first,last) into result.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @return result + (first - last)
+ *
+ * This inline function will boil down to a call to @c memmove whenever
+ * possible. Failing that, if random access iterators are passed, then the
+ * loop count will be known (and therefore a candidate for compiler
+ * optimizations such as unrolling). Result may not be contained within
+ * [first,last); the copy_backward function should be used instead.
+ *
+ * Note that the end of the output range is permitted to be contained
+ * within [first,last).
+ */
+ template<typename _II, typename _OI>
+ inline _OI
+ copy(_II __first, _II __last, _OI __result)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_II>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OI,
+ typename iterator_traits<_II>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ return (std::__copy_move_a2<__is_move_iterator<_II>::__value>
+ (std::__miter_base<_II>::__b(__first),
+ std::__miter_base<_II>::__b(__last), __result));
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Moves the range [first,last) into result.
+ * @ingroup mutating_algorithms
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @return result + (first - last)
+ *
+ * This inline function will boil down to a call to @c memmove whenever
+ * possible. Failing that, if random access iterators are passed, then the
+ * loop count will be known (and therefore a candidate for compiler
+ * optimizations such as unrolling). Result may not be contained within
+ * [first,last); the move_backward function should be used instead.
+ *
+ * Note that the end of the output range is permitted to be contained
+ * within [first,last).
+ */
+ template<typename _II, typename _OI>
+ inline _OI
+ move(_II __first, _II __last, _OI __result)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_II>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OI,
+ typename iterator_traits<_II>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ return (std::__copy_move_a2<true>
+ (std::__miter_base<_II>::__b(__first),
+ std::__miter_base<_II>::__b(__last), __result));
+ }
+
+#define _GLIBCXX_MOVE3(_Tp, _Up, _Vp) std::move(_Tp, _Up, _Vp)
+#else
+#define _GLIBCXX_MOVE3(_Tp, _Up, _Vp) std::copy(_Tp, _Up, _Vp)
+#endif
+
+ template<bool, bool, typename>
+ struct __copy_move_backward
+ {
+ template<typename _BI1, typename _BI2>
+ static _BI2
+ __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+ while (__first != __last)
+ *--__result = *--__last;
+ return __result;
+ }
+ };
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Category>
+ struct __copy_move_backward<true, false, _Category>
+ {
+ template<typename _BI1, typename _BI2>
+ static _BI2
+ __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+ while (__first != __last)
+ *--__result = std::move(*--__last);
+ return __result;
+ }
+ };
+#endif
+
+ template<>
+ struct __copy_move_backward<false, false, random_access_iterator_tag>
+ {
+ template<typename _BI1, typename _BI2>
+ static _BI2
+ __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+ typename iterator_traits<_BI1>::difference_type __n;
+ for (__n = __last - __first; __n > 0; --__n)
+ *--__result = *--__last;
+ return __result;
+ }
+ };
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<>
+ struct __copy_move_backward<true, false, random_access_iterator_tag>
+ {
+ template<typename _BI1, typename _BI2>
+ static _BI2
+ __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+ typename iterator_traits<_BI1>::difference_type __n;
+ for (__n = __last - __first; __n > 0; --__n)
+ *--__result = std::move(*--__last);
+ return __result;
+ }
+ };
+#endif
+
+ template<bool _IsMove>
+ struct __copy_move_backward<_IsMove, true, random_access_iterator_tag>
+ {
+ template<typename _Tp>
+ static _Tp*
+ __copy_move_b(const _Tp* __first, const _Tp* __last, _Tp* __result)
+ {
+ const ptrdiff_t _Num = __last - __first;
+ __builtin_memmove(__result - _Num, __first, sizeof(_Tp) * _Num);
+ return __result - _Num;
+ }
+ };
+
+ template<bool _IsMove, typename _BI1, typename _BI2>
+ inline _BI2
+ __copy_move_backward_a(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+ typedef typename iterator_traits<_BI1>::value_type _ValueType1;
+ typedef typename iterator_traits<_BI2>::value_type _ValueType2;
+ typedef typename iterator_traits<_BI1>::iterator_category _Category;
+ const bool __simple = (__is_pod(_ValueType1)
+ && __is_pointer<_BI1>::__value
+ && __is_pointer<_BI2>::__value
+ && __are_same<_ValueType1, _ValueType2>::__value);
+
+ return std::__copy_move_backward<_IsMove, __simple,
+ _Category>::__copy_move_b(__first,
+ __last,
+ __result);
+ }
+
+ template<bool _IsMove, typename _BI1, typename _BI2>
+ inline _BI2
+ __copy_move_backward_a2(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+ return _BI2(std::__copy_move_backward_a<_IsMove>
+ (std::__niter_base<_BI1>::__b(__first),
+ std::__niter_base<_BI1>::__b(__last),
+ std::__niter_base<_BI2>::__b(__result)));
+ }
+
+ /**
+ * @brief Copies the range [first,last) into result.
+ * @ingroup mutating_algorithms
+ * @param first A bidirectional iterator.
+ * @param last A bidirectional iterator.
+ * @param result A bidirectional iterator.
+ * @return result - (first - last)
+ *
+ * The function has the same effect as copy, but starts at the end of the
+ * range and works its way to the start, returning the start of the result.
+ * This inline function will boil down to a call to @c memmove whenever
+ * possible. Failing that, if random access iterators are passed, then the
+ * loop count will be known (and therefore a candidate for compiler
+ * optimizations such as unrolling).
+ *
+ * Result may not be in the range [first,last). Use copy instead. Note
+ * that the start of the output range may overlap [first,last).
+ */
+ template<typename _BI1, typename _BI2>
+ inline _BI2
+ copy_backward(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<_BI1>)
+ __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<_BI2>)
+ __glibcxx_function_requires(_ConvertibleConcept<
+ typename iterator_traits<_BI1>::value_type,
+ typename iterator_traits<_BI2>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ return (std::__copy_move_backward_a2<__is_move_iterator<_BI1>::__value>
+ (std::__miter_base<_BI1>::__b(__first),
+ std::__miter_base<_BI1>::__b(__last), __result));
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Moves the range [first,last) into result.
+ * @ingroup mutating_algorithms
+ * @param first A bidirectional iterator.
+ * @param last A bidirectional iterator.
+ * @param result A bidirectional iterator.
+ * @return result - (first - last)
+ *
+ * The function has the same effect as move, but starts at the end of the
+ * range and works its way to the start, returning the start of the result.
+ * This inline function will boil down to a call to @c memmove whenever
+ * possible. Failing that, if random access iterators are passed, then the
+ * loop count will be known (and therefore a candidate for compiler
+ * optimizations such as unrolling).
+ *
+ * Result may not be in the range [first,last). Use move instead. Note
+ * that the start of the output range may overlap [first,last).
+ */
+ template<typename _BI1, typename _BI2>
+ inline _BI2
+ move_backward(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<_BI1>)
+ __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<_BI2>)
+ __glibcxx_function_requires(_ConvertibleConcept<
+ typename iterator_traits<_BI1>::value_type,
+ typename iterator_traits<_BI2>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ return (std::__copy_move_backward_a2<true>
+ (std::__miter_base<_BI1>::__b(__first),
+ std::__miter_base<_BI1>::__b(__last), __result));
+ }
+
+#define _GLIBCXX_MOVE_BACKWARD3(_Tp, _Up, _Vp) std::move_backward(_Tp, _Up, _Vp)
+#else
+#define _GLIBCXX_MOVE_BACKWARD3(_Tp, _Up, _Vp) std::copy_backward(_Tp, _Up, _Vp)
+#endif
+
+ template<typename _ForwardIterator, typename _Tp>
+ inline typename
+ __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, void>::__type
+ __fill_a(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __value)
+ {
+ for (; __first != __last; ++__first)
+ *__first = __value;
+ }
+
+ template<typename _ForwardIterator, typename _Tp>
+ inline typename
+ __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type
+ __fill_a(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __value)
+ {
+ const _Tp __tmp = __value;
+ for (; __first != __last; ++__first)
+ *__first = __tmp;
+ }
+
+ // Specialization: for char types we can use memset.
+ template<typename _Tp>
+ inline typename
+ __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, void>::__type
+ __fill_a(_Tp* __first, _Tp* __last, const _Tp& __c)
+ {
+ const _Tp __tmp = __c;
+ __builtin_memset(__first, static_cast<unsigned char>(__tmp),
+ __last - __first);
+ }
+
+ /**
+ * @brief Fills the range [first,last) with copies of value.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param value A reference-to-const of arbitrary type.
+ * @return Nothing.
+ *
+ * This function fills a range with copies of the same value. For char
+ * types filling contiguous areas of memory, this becomes an inline call
+ * to @c memset or @c wmemset.
+ */
+ template<typename _ForwardIterator, typename _Tp>
+ inline void
+ fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ std::__fill_a(std::__niter_base<_ForwardIterator>::__b(__first),
+ std::__niter_base<_ForwardIterator>::__b(__last), __value);
+ }
+
+ template<typename _OutputIterator, typename _Size, typename _Tp>
+ inline typename
+ __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, _OutputIterator>::__type
+ __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)
+ {
+ for (; __n > 0; --__n, ++__first)
+ *__first = __value;
+ return __first;
+ }
+
+ template<typename _OutputIterator, typename _Size, typename _Tp>
+ inline typename
+ __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, _OutputIterator>::__type
+ __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)
+ {
+ const _Tp __tmp = __value;
+ for (; __n > 0; --__n, ++__first)
+ *__first = __tmp;
+ return __first;
+ }
+
+ template<typename _Size, typename _Tp>
+ inline typename
+ __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, _Tp*>::__type
+ __fill_n_a(_Tp* __first, _Size __n, const _Tp& __c)
+ {
+ std::__fill_a(__first, __first + __n, __c);
+ return __first + __n;
+ }
+
+ /**
+ * @brief Fills the range [first,first+n) with copies of value.
+ * @ingroup mutating_algorithms
+ * @param first An output iterator.
+ * @param n The count of copies to perform.
+ * @param value A reference-to-const of arbitrary type.
+ * @return The iterator at first+n.
+ *
+ * This function fills a range with copies of the same value. For char
+ * types filling contiguous areas of memory, this becomes an inline call
+ * to @c memset or @ wmemset.
+ */
+ template<typename _OI, typename _Size, typename _Tp>
+ inline _OI
+ fill_n(_OI __first, _Size __n, const _Tp& __value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_OutputIteratorConcept<_OI, _Tp>)
+
+ return _OI(std::__fill_n_a(std::__niter_base<_OI>::__b(__first),
+ __n, __value));
+ }
+
+ template<bool _BoolType>
+ struct __equal
+ {
+ template<typename _II1, typename _II2>
+ static bool
+ equal(_II1 __first1, _II1 __last1, _II2 __first2)
+ {
+ for (; __first1 != __last1; ++__first1, ++__first2)
+ if (!(*__first1 == *__first2))
+ return false;
+ return true;
+ }
+ };
+
+ template<>
+ struct __equal<true>
+ {
+ template<typename _Tp>
+ static bool
+ equal(const _Tp* __first1, const _Tp* __last1, const _Tp* __first2)
+ {
+ return !__builtin_memcmp(__first1, __first2, sizeof(_Tp)
+ * (__last1 - __first1));
+ }
+ };
+
+ template<typename _II1, typename _II2>
+ inline bool
+ __equal_aux(_II1 __first1, _II1 __last1, _II2 __first2)
+ {
+ typedef typename iterator_traits<_II1>::value_type _ValueType1;
+ typedef typename iterator_traits<_II2>::value_type _ValueType2;
+ const bool __simple = (__is_integer<_ValueType1>::__value
+ && __is_pointer<_II1>::__value
+ && __is_pointer<_II2>::__value
+ && __are_same<_ValueType1, _ValueType2>::__value);
+
+ return std::__equal<__simple>::equal(__first1, __last1, __first2);
+ }
+
+
+ template<typename, typename>
+ struct __lc_rai
+ {
+ template<typename _II1, typename _II2>
+ static _II1
+ __newlast1(_II1, _II1 __last1, _II2, _II2)
+ { return __last1; }
+
+ template<typename _II>
+ static bool
+ __cnd2(_II __first, _II __last)
+ { return __first != __last; }
+ };
+
+ template<>
+ struct __lc_rai<random_access_iterator_tag, random_access_iterator_tag>
+ {
+ template<typename _RAI1, typename _RAI2>
+ static _RAI1
+ __newlast1(_RAI1 __first1, _RAI1 __last1,
+ _RAI2 __first2, _RAI2 __last2)
+ {
+ const typename iterator_traits<_RAI1>::difference_type
+ __diff1 = __last1 - __first1;
+ const typename iterator_traits<_RAI2>::difference_type
+ __diff2 = __last2 - __first2;
+ return __diff2 < __diff1 ? __first1 + __diff2 : __last1;
+ }
+
+ template<typename _RAI>
+ static bool
+ __cnd2(_RAI, _RAI)
+ { return true; }
+ };
+
+ template<bool _BoolType>
+ struct __lexicographical_compare
+ {
+ template<typename _II1, typename _II2>
+ static bool __lc(_II1, _II1, _II2, _II2);
+ };
+
+ template<bool _BoolType>
+ template<typename _II1, typename _II2>
+ bool
+ __lexicographical_compare<_BoolType>::
+ __lc(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
+ {
+ typedef typename iterator_traits<_II1>::iterator_category _Category1;
+ typedef typename iterator_traits<_II2>::iterator_category _Category2;
+ typedef std::__lc_rai<_Category1, _Category2> __rai_type;
+
+ __last1 = __rai_type::__newlast1(__first1, __last1,
+ __first2, __last2);
+ for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
+ ++__first1, ++__first2)
+ {
+ if (*__first1 < *__first2)
+ return true;
+ if (*__first2 < *__first1)
+ return false;
+ }
+ return __first1 == __last1 && __first2 != __last2;
+ }
+
+ template<>
+ struct __lexicographical_compare<true>
+ {
+ template<typename _Tp, typename _Up>
+ static bool
+ __lc(const _Tp* __first1, const _Tp* __last1,
+ const _Up* __first2, const _Up* __last2)
+ {
+ const size_t __len1 = __last1 - __first1;
+ const size_t __len2 = __last2 - __first2;
+ const int __result = __builtin_memcmp(__first1, __first2,
+ std::min(__len1, __len2));
+ return __result != 0 ? __result < 0 : __len1 < __len2;
+ }
+ };
+
+ template<typename _II1, typename _II2>
+ inline bool
+ __lexicographical_compare_aux(_II1 __first1, _II1 __last1,
+ _II2 __first2, _II2 __last2)
+ {
+ typedef typename iterator_traits<_II1>::value_type _ValueType1;
+ typedef typename iterator_traits<_II2>::value_type _ValueType2;
+ const bool __simple =
+ (__is_byte<_ValueType1>::__value && __is_byte<_ValueType2>::__value
+ && !__gnu_cxx::__numeric_traits<_ValueType1>::__is_signed
+ && !__gnu_cxx::__numeric_traits<_ValueType2>::__is_signed
+ && __is_pointer<_II1>::__value
+ && __is_pointer<_II2>::__value);
+
+ return std::__lexicographical_compare<__simple>::__lc(__first1, __last1,
+ __first2, __last2);
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P)
+
+ /**
+ * @brief Tests a range for element-wise equality.
+ * @ingroup non_mutating_algorithms
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @return A boolean true or false.
+ *
+ * This compares the elements of two ranges using @c == and returns true or
+ * false depending on whether all of the corresponding elements of the
+ * ranges are equal.
+ */
+ template<typename _II1, typename _II2>
+ inline bool
+ equal(_II1 __first1, _II1 __last1, _II2 __first2)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_II1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_II2>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_II1>::value_type,
+ typename iterator_traits<_II2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+
+ return std::__equal_aux(std::__niter_base<_II1>::__b(__first1),
+ std::__niter_base<_II1>::__b(__last1),
+ std::__niter_base<_II2>::__b(__first2));
+ }
+
+ /**
+ * @brief Tests a range for element-wise equality.
+ * @ingroup non_mutating_algorithms
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @param binary_pred A binary predicate @link functors
+ * functor@endlink.
+ * @return A boolean true or false.
+ *
+ * This compares the elements of two ranges using the binary_pred
+ * parameter, and returns true or
+ * false depending on whether all of the corresponding elements of the
+ * ranges are equal.
+ */
+ template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
+ inline bool
+ equal(_IIter1 __first1, _IIter1 __last1,
+ _IIter2 __first2, _BinaryPredicate __binary_pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_IIter1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_IIter2>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+
+ for (; __first1 != __last1; ++__first1, ++__first2)
+ if (!bool(__binary_pred(*__first1, *__first2)))
+ return false;
+ return true;
+ }
+
+ /**
+ * @brief Performs "dictionary" comparison on ranges.
+ * @ingroup sorting_algorithms
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @param last2 An input iterator.
+ * @return A boolean true or false.
+ *
+ * "Returns true if the sequence of elements defined by the range
+ * [first1,last1) is lexicographically less than the sequence of elements
+ * defined by the range [first2,last2). Returns false otherwise."
+ * (Quoted from [25.3.8]/1.) If the iterators are all character pointers,
+ * then this is an inline call to @c memcmp.
+ */
+ template<typename _II1, typename _II2>
+ inline bool
+ lexicographical_compare(_II1 __first1, _II1 __last1,
+ _II2 __first2, _II2 __last2)
+ {
+ // concept requirements
+ typedef typename iterator_traits<_II1>::value_type _ValueType1;
+ typedef typename iterator_traits<_II2>::value_type _ValueType2;
+ __glibcxx_function_requires(_InputIteratorConcept<_II1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_II2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType1, _ValueType2>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ return std::__lexicographical_compare_aux
+ (std::__niter_base<_II1>::__b(__first1),
+ std::__niter_base<_II1>::__b(__last1),
+ std::__niter_base<_II2>::__b(__first2),
+ std::__niter_base<_II2>::__b(__last2));
+ }
+
+ /**
+ * @brief Performs "dictionary" comparison on ranges.
+ * @ingroup sorting_algorithms
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @param last2 An input iterator.
+ * @param comp A @link comparison_functors comparison functor@endlink.
+ * @return A boolean true or false.
+ *
+ * The same as the four-parameter @c lexicographical_compare, but uses the
+ * comp parameter instead of @c <.
+ */
+ template<typename _II1, typename _II2, typename _Compare>
+ bool
+ lexicographical_compare(_II1 __first1, _II1 __last1,
+ _II2 __first2, _II2 __last2, _Compare __comp)
+ {
+ typedef typename iterator_traits<_II1>::iterator_category _Category1;
+ typedef typename iterator_traits<_II2>::iterator_category _Category2;
+ typedef std::__lc_rai<_Category1, _Category2> __rai_type;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_II1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_II2>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ __last1 = __rai_type::__newlast1(__first1, __last1, __first2, __last2);
+ for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
+ ++__first1, ++__first2)
+ {
+ if (__comp(*__first1, *__first2))
+ return true;
+ if (__comp(*__first2, *__first1))
+ return false;
+ }
+ return __first1 == __last1 && __first2 != __last2;
+ }
+
+ /**
+ * @brief Finds the places in ranges which don't match.
+ * @ingroup non_mutating_algorithms
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @return A pair of iterators pointing to the first mismatch.
+ *
+ * This compares the elements of two ranges using @c == and returns a pair
+ * of iterators. The first iterator points into the first range, the
+ * second iterator points into the second range, and the elements pointed
+ * to by the iterators are not equal.
+ */
+ template<typename _InputIterator1, typename _InputIterator2>
+ pair<_InputIterator1, _InputIterator2>
+ mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+
+ while (__first1 != __last1 && *__first1 == *__first2)
+ {
+ ++__first1;
+ ++__first2;
+ }
+ return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
+ }
+
+ /**
+ * @brief Finds the places in ranges which don't match.
+ * @ingroup non_mutating_algorithms
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @param binary_pred A binary predicate @link functors
+ * functor@endlink.
+ * @return A pair of iterators pointing to the first mismatch.
+ *
+ * This compares the elements of two ranges using the binary_pred
+ * parameter, and returns a pair
+ * of iterators. The first iterator points into the first range, the
+ * second iterator points into the second range, and the elements pointed
+ * to by the iterators are not equal.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _BinaryPredicate>
+ pair<_InputIterator1, _InputIterator2>
+ mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _BinaryPredicate __binary_pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+
+ while (__first1 != __last1 && bool(__binary_pred(*__first1, *__first2)))
+ {
+ ++__first1;
+ ++__first2;
+ }
+ return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
+ }
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+// NB: This file is included within many other C++ includes, as a way
+// of getting the base algorithms. So, make sure that parallel bits
+// come in too if requested.
+#ifdef _GLIBCXX_PARALLEL
+# include <parallel/algobase.h>
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_bvector.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_bvector.h
new file mode 100644
index 0000000..0e60b7f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_bvector.h
@@ -0,0 +1,1024 @@
+// vector<bool> specialization -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996-1999
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_bvector.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_BVECTOR_H
+#define _STL_BVECTOR_H 1
+
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ typedef unsigned long _Bit_type;
+ enum { _S_word_bit = int(__CHAR_BIT__ * sizeof(_Bit_type)) };
+
+ struct _Bit_reference
+ {
+ _Bit_type * _M_p;
+ _Bit_type _M_mask;
+
+ _Bit_reference(_Bit_type * __x, _Bit_type __y)
+ : _M_p(__x), _M_mask(__y) { }
+
+ _Bit_reference() : _M_p(0), _M_mask(0) { }
+
+ operator bool() const
+ { return !!(*_M_p & _M_mask); }
+
+ _Bit_reference&
+ operator=(bool __x)
+ {
+ if (__x)
+ *_M_p |= _M_mask;
+ else
+ *_M_p &= ~_M_mask;
+ return *this;
+ }
+
+ _Bit_reference&
+ operator=(const _Bit_reference& __x)
+ { return *this = bool(__x); }
+
+ bool
+ operator==(const _Bit_reference& __x) const
+ { return bool(*this) == bool(__x); }
+
+ bool
+ operator<(const _Bit_reference& __x) const
+ { return !bool(*this) && bool(__x); }
+
+ void
+ flip()
+ { *_M_p ^= _M_mask; }
+ };
+
+ struct _Bit_iterator_base
+ : public std::iterator<std::random_access_iterator_tag, bool>
+ {
+ _Bit_type * _M_p;
+ unsigned int _M_offset;
+
+ _Bit_iterator_base(_Bit_type * __x, unsigned int __y)
+ : _M_p(__x), _M_offset(__y) { }
+
+ void
+ _M_bump_up()
+ {
+ if (_M_offset++ == int(_S_word_bit) - 1)
+ {
+ _M_offset = 0;
+ ++_M_p;
+ }
+ }
+
+ void
+ _M_bump_down()
+ {
+ if (_M_offset-- == 0)
+ {
+ _M_offset = int(_S_word_bit) - 1;
+ --_M_p;
+ }
+ }
+
+ void
+ _M_incr(ptrdiff_t __i)
+ {
+ difference_type __n = __i + _M_offset;
+ _M_p += __n / int(_S_word_bit);
+ __n = __n % int(_S_word_bit);
+ if (__n < 0)
+ {
+ __n += int(_S_word_bit);
+ --_M_p;
+ }
+ _M_offset = static_cast<unsigned int>(__n);
+ }
+
+ bool
+ operator==(const _Bit_iterator_base& __i) const
+ { return _M_p == __i._M_p && _M_offset == __i._M_offset; }
+
+ bool
+ operator<(const _Bit_iterator_base& __i) const
+ {
+ return _M_p < __i._M_p
+ || (_M_p == __i._M_p && _M_offset < __i._M_offset);
+ }
+
+ bool
+ operator!=(const _Bit_iterator_base& __i) const
+ { return !(*this == __i); }
+
+ bool
+ operator>(const _Bit_iterator_base& __i) const
+ { return __i < *this; }
+
+ bool
+ operator<=(const _Bit_iterator_base& __i) const
+ { return !(__i < *this); }
+
+ bool
+ operator>=(const _Bit_iterator_base& __i) const
+ { return !(*this < __i); }
+ };
+
+ inline ptrdiff_t
+ operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y)
+ {
+ return (int(_S_word_bit) * (__x._M_p - __y._M_p)
+ + __x._M_offset - __y._M_offset);
+ }
+
+ struct _Bit_iterator : public _Bit_iterator_base
+ {
+ typedef _Bit_reference reference;
+ typedef _Bit_reference* pointer;
+ typedef _Bit_iterator iterator;
+
+ _Bit_iterator() : _Bit_iterator_base(0, 0) { }
+
+ _Bit_iterator(_Bit_type * __x, unsigned int __y)
+ : _Bit_iterator_base(__x, __y) { }
+
+ reference
+ operator*() const
+ { return reference(_M_p, 1UL << _M_offset); }
+
+ iterator&
+ operator++()
+ {
+ _M_bump_up();
+ return *this;
+ }
+
+ iterator
+ operator++(int)
+ {
+ iterator __tmp = *this;
+ _M_bump_up();
+ return __tmp;
+ }
+
+ iterator&
+ operator--()
+ {
+ _M_bump_down();
+ return *this;
+ }
+
+ iterator
+ operator--(int)
+ {
+ iterator __tmp = *this;
+ _M_bump_down();
+ return __tmp;
+ }
+
+ iterator&
+ operator+=(difference_type __i)
+ {
+ _M_incr(__i);
+ return *this;
+ }
+
+ iterator&
+ operator-=(difference_type __i)
+ {
+ *this += -__i;
+ return *this;
+ }
+
+ iterator
+ operator+(difference_type __i) const
+ {
+ iterator __tmp = *this;
+ return __tmp += __i;
+ }
+
+ iterator
+ operator-(difference_type __i) const
+ {
+ iterator __tmp = *this;
+ return __tmp -= __i;
+ }
+
+ reference
+ operator[](difference_type __i) const
+ { return *(*this + __i); }
+ };
+
+ inline _Bit_iterator
+ operator+(ptrdiff_t __n, const _Bit_iterator& __x)
+ { return __x + __n; }
+
+ struct _Bit_const_iterator : public _Bit_iterator_base
+ {
+ typedef bool reference;
+ typedef bool const_reference;
+ typedef const bool* pointer;
+ typedef _Bit_const_iterator const_iterator;
+
+ _Bit_const_iterator() : _Bit_iterator_base(0, 0) { }
+
+ _Bit_const_iterator(_Bit_type * __x, unsigned int __y)
+ : _Bit_iterator_base(__x, __y) { }
+
+ _Bit_const_iterator(const _Bit_iterator& __x)
+ : _Bit_iterator_base(__x._M_p, __x._M_offset) { }
+
+ const_reference
+ operator*() const
+ { return _Bit_reference(_M_p, 1UL << _M_offset); }
+
+ const_iterator&
+ operator++()
+ {
+ _M_bump_up();
+ return *this;
+ }
+
+ const_iterator
+ operator++(int)
+ {
+ const_iterator __tmp = *this;
+ _M_bump_up();
+ return __tmp;
+ }
+
+ const_iterator&
+ operator--()
+ {
+ _M_bump_down();
+ return *this;
+ }
+
+ const_iterator
+ operator--(int)
+ {
+ const_iterator __tmp = *this;
+ _M_bump_down();
+ return __tmp;
+ }
+
+ const_iterator&
+ operator+=(difference_type __i)
+ {
+ _M_incr(__i);
+ return *this;
+ }
+
+ const_iterator&
+ operator-=(difference_type __i)
+ {
+ *this += -__i;
+ return *this;
+ }
+
+ const_iterator
+ operator+(difference_type __i) const
+ {
+ const_iterator __tmp = *this;
+ return __tmp += __i;
+ }
+
+ const_iterator
+ operator-(difference_type __i) const
+ {
+ const_iterator __tmp = *this;
+ return __tmp -= __i;
+ }
+
+ const_reference
+ operator[](difference_type __i) const
+ { return *(*this + __i); }
+ };
+
+ inline _Bit_const_iterator
+ operator+(ptrdiff_t __n, const _Bit_const_iterator& __x)
+ { return __x + __n; }
+
+ inline void
+ __fill_bvector(_Bit_iterator __first, _Bit_iterator __last, bool __x)
+ {
+ for (; __first != __last; ++__first)
+ *__first = __x;
+ }
+
+ inline void
+ fill(_Bit_iterator __first, _Bit_iterator __last, const bool& __x)
+ {
+ if (__first._M_p != __last._M_p)
+ {
+ std::fill(__first._M_p + 1, __last._M_p, __x ? ~0 : 0);
+ __fill_bvector(__first, _Bit_iterator(__first._M_p + 1, 0), __x);
+ __fill_bvector(_Bit_iterator(__last._M_p, 0), __last, __x);
+ }
+ else
+ __fill_bvector(__first, __last, __x);
+ }
+
+ template<typename _Alloc>
+ struct _Bvector_base
+ {
+ typedef typename _Alloc::template rebind<_Bit_type>::other
+ _Bit_alloc_type;
+
+ struct _Bvector_impl
+ : public _Bit_alloc_type
+ {
+ _Bit_iterator _M_start;
+ _Bit_iterator _M_finish;
+ _Bit_type* _M_end_of_storage;
+
+ _Bvector_impl()
+ : _Bit_alloc_type(), _M_start(), _M_finish(), _M_end_of_storage(0)
+ { }
+
+ _Bvector_impl(const _Bit_alloc_type& __a)
+ : _Bit_alloc_type(__a), _M_start(), _M_finish(), _M_end_of_storage(0)
+ { }
+ };
+
+ public:
+ typedef _Alloc allocator_type;
+
+ _Bit_alloc_type&
+ _M_get_Bit_allocator()
+ { return *static_cast<_Bit_alloc_type*>(&this->_M_impl); }
+
+ const _Bit_alloc_type&
+ _M_get_Bit_allocator() const
+ { return *static_cast<const _Bit_alloc_type*>(&this->_M_impl); }
+
+ allocator_type
+ get_allocator() const
+ { return allocator_type(_M_get_Bit_allocator()); }
+
+ _Bvector_base()
+ : _M_impl() { }
+
+ _Bvector_base(const allocator_type& __a)
+ : _M_impl(__a) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ _Bvector_base(_Bvector_base&& __x)
+ : _M_impl(__x._M_get_Bit_allocator())
+ {
+ this->_M_impl._M_start = __x._M_impl._M_start;
+ this->_M_impl._M_finish = __x._M_impl._M_finish;
+ this->_M_impl._M_end_of_storage = __x._M_impl._M_end_of_storage;
+ __x._M_impl._M_start = _Bit_iterator();
+ __x._M_impl._M_finish = _Bit_iterator();
+ __x._M_impl._M_end_of_storage = 0;
+ }
+#endif
+
+ ~_Bvector_base()
+ { this->_M_deallocate(); }
+
+ protected:
+ _Bvector_impl _M_impl;
+
+ _Bit_type*
+ _M_allocate(size_t __n)
+ { return _M_impl.allocate((__n + int(_S_word_bit) - 1)
+ / int(_S_word_bit)); }
+
+ void
+ _M_deallocate()
+ {
+ if (_M_impl._M_start._M_p)
+ _M_impl.deallocate(_M_impl._M_start._M_p,
+ _M_impl._M_end_of_storage - _M_impl._M_start._M_p);
+ }
+ };
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+// Declare a partial specialization of vector<T, Alloc>.
+#include <bits/stl_vector.h>
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ /**
+ * @brief A specialization of vector for booleans which offers fixed time
+ * access to individual elements in any order.
+ *
+ * Note that vector<bool> does not actually meet the requirements for being
+ * a container. This is because the reference and pointer types are not
+ * really references and pointers to bool. See DR96 for details. @see
+ * vector for function documentation.
+ *
+ * @ingroup sequences
+ *
+ * In some terminology a %vector can be described as a dynamic
+ * C-style array, it offers fast and efficient access to individual
+ * elements in any order and saves the user from worrying about
+ * memory and size allocation. Subscripting ( @c [] ) access is
+ * also provided as with C-style arrays.
+ */
+template<typename _Alloc>
+ class vector<bool, _Alloc> : protected _Bvector_base<_Alloc>
+ {
+ typedef _Bvector_base<_Alloc> _Base;
+
+ public:
+ typedef bool value_type;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Bit_reference reference;
+ typedef bool const_reference;
+ typedef _Bit_reference* pointer;
+ typedef const bool* const_pointer;
+ typedef _Bit_iterator iterator;
+ typedef _Bit_const_iterator const_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef _Alloc allocator_type;
+
+ allocator_type get_allocator() const
+ { return _Base::get_allocator(); }
+
+ protected:
+ using _Base::_M_allocate;
+ using _Base::_M_deallocate;
+ using _Base::_M_get_Bit_allocator;
+
+ public:
+ vector()
+ : _Base() { }
+
+ explicit
+ vector(const allocator_type& __a)
+ : _Base(__a) { }
+
+ explicit
+ vector(size_type __n, const bool& __value = bool(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ _M_initialize(__n);
+ std::fill(this->_M_impl._M_start._M_p, this->_M_impl._M_end_of_storage,
+ __value ? ~0 : 0);
+ }
+
+ vector(const vector& __x)
+ : _Base(__x._M_get_Bit_allocator())
+ {
+ _M_initialize(__x.size());
+ _M_copy_aligned(__x.begin(), __x.end(), this->_M_impl._M_start);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ vector(vector&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+
+ vector(initializer_list<bool> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ _M_initialize_range(__l.begin(), __l.end(),
+ random_access_iterator_tag());
+ }
+#endif
+
+ template<typename _InputIterator>
+ vector(_InputIterator __first, _InputIterator __last,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_initialize_dispatch(__first, __last, _Integral());
+ }
+
+ ~vector() { }
+
+ vector&
+ operator=(const vector& __x)
+ {
+ if (&__x == this)
+ return *this;
+ if (__x.size() > capacity())
+ {
+ this->_M_deallocate();
+ _M_initialize(__x.size());
+ }
+ this->_M_impl._M_finish = _M_copy_aligned(__x.begin(), __x.end(),
+ begin());
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ vector&
+ operator=(vector&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ vector&
+ operator=(initializer_list<bool> __l)
+ {
+ this->assign (__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+
+ // assign(), a generalized assignment member function. Two
+ // versions: one that takes a count, and one that takes a range.
+ // The range version is a member template, so we dispatch on whether
+ // or not the type is an integer.
+ void
+ assign(size_type __n, const bool& __x)
+ { _M_fill_assign(__n, __x); }
+
+ template<typename _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_assign_dispatch(__first, __last, _Integral());
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ assign(initializer_list<bool> __l)
+ { this->assign(__l.begin(), __l.end()); }
+#endif
+
+ iterator
+ begin()
+ { return this->_M_impl._M_start; }
+
+ const_iterator
+ begin() const
+ { return this->_M_impl._M_start; }
+
+ iterator
+ end()
+ { return this->_M_impl._M_finish; }
+
+ const_iterator
+ end() const
+ { return this->_M_impl._M_finish; }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ const_iterator
+ cbegin() const
+ { return this->_M_impl._M_start; }
+
+ const_iterator
+ cend() const
+ { return this->_M_impl._M_finish; }
+
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ size_type
+ size() const
+ { return size_type(end() - begin()); }
+
+ size_type
+ max_size() const
+ {
+ const size_type __isize =
+ __gnu_cxx::__numeric_traits<difference_type>::__max
+ - int(_S_word_bit) + 1;
+ const size_type __asize = _M_get_Bit_allocator().max_size();
+ return (__asize <= __isize / int(_S_word_bit)
+ ? __asize * int(_S_word_bit) : __isize);
+ }
+
+ size_type
+ capacity() const
+ { return size_type(const_iterator(this->_M_impl._M_end_of_storage, 0)
+ - begin()); }
+
+ bool
+ empty() const
+ { return begin() == end(); }
+
+ reference
+ operator[](size_type __n)
+ {
+ return *iterator(this->_M_impl._M_start._M_p
+ + __n / int(_S_word_bit), __n % int(_S_word_bit));
+ }
+
+ const_reference
+ operator[](size_type __n) const
+ {
+ return *const_iterator(this->_M_impl._M_start._M_p
+ + __n / int(_S_word_bit), __n % int(_S_word_bit));
+ }
+
+ protected:
+ void
+ _M_range_check(size_type __n) const
+ {
+ if (__n >= this->size())
+ __throw_out_of_range(__N("vector<bool>::_M_range_check"));
+ }
+
+ public:
+ reference
+ at(size_type __n)
+ { _M_range_check(__n); return (*this)[__n]; }
+
+ const_reference
+ at(size_type __n) const
+ { _M_range_check(__n); return (*this)[__n]; }
+
+ void
+ reserve(size_type __n);
+
+ reference
+ front()
+ { return *begin(); }
+
+ const_reference
+ front() const
+ { return *begin(); }
+
+ reference
+ back()
+ { return *(end() - 1); }
+
+ const_reference
+ back() const
+ { return *(end() - 1); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 464. Suggestion for new member functions in standard containers.
+ // N.B. DR 464 says nothing about vector<bool> but we need something
+ // here due to the way we are implementing DR 464 in the debug-mode
+ // vector class.
+ void
+ data() { }
+
+ void
+ push_back(bool __x)
+ {
+ if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage)
+ *this->_M_impl._M_finish++ = __x;
+ else
+ _M_insert_aux(end(), __x);
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(vector&& __x)
+#else
+ swap(vector& __x)
+#endif
+ {
+ std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
+ std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
+ std::swap(this->_M_impl._M_end_of_storage,
+ __x._M_impl._M_end_of_storage);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 431. Swapping containers with unequal allocators.
+ std::__alloc_swap<typename _Base::_Bit_alloc_type>::
+ _S_do_it(_M_get_Bit_allocator(), __x._M_get_Bit_allocator());
+ }
+
+ // [23.2.5]/1, third-to-last entry in synopsis listing
+ static void
+ swap(reference __x, reference __y)
+ {
+ bool __tmp = __x;
+ __x = __y;
+ __y = __tmp;
+ }
+
+ iterator
+ insert(iterator __position, const bool& __x = bool())
+ {
+ const difference_type __n = __position - begin();
+ if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage
+ && __position == end())
+ *this->_M_impl._M_finish++ = __x;
+ else
+ _M_insert_aux(__position, __x);
+ return begin() + __n;
+ }
+
+ template<typename _InputIterator>
+ void
+ insert(iterator __position,
+ _InputIterator __first, _InputIterator __last)
+ {
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_insert_dispatch(__position, __first, __last, _Integral());
+ }
+
+ void
+ insert(iterator __position, size_type __n, const bool& __x)
+ { _M_fill_insert(__position, __n, __x); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void insert(iterator __p, initializer_list<bool> __l)
+ { this->insert(__p, __l.begin(), __l.end()); }
+#endif
+
+ void
+ pop_back()
+ { --this->_M_impl._M_finish; }
+
+ iterator
+ erase(iterator __position)
+ {
+ if (__position + 1 != end())
+ std::copy(__position + 1, end(), __position);
+ --this->_M_impl._M_finish;
+ return __position;
+ }
+
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ _M_erase_at_end(std::copy(__last, end(), __first));
+ return __first;
+ }
+
+ void
+ resize(size_type __new_size, bool __x = bool())
+ {
+ if (__new_size < size())
+ _M_erase_at_end(begin() + difference_type(__new_size));
+ else
+ insert(end(), __new_size - size(), __x);
+ }
+
+ void
+ flip()
+ {
+ for (_Bit_type * __p = this->_M_impl._M_start._M_p;
+ __p != this->_M_impl._M_end_of_storage; ++__p)
+ *__p = ~*__p;
+ }
+
+ void
+ clear()
+ { _M_erase_at_end(begin()); }
+
+
+ protected:
+ // Precondition: __first._M_offset == 0 && __result._M_offset == 0.
+ iterator
+ _M_copy_aligned(const_iterator __first, const_iterator __last,
+ iterator __result)
+ {
+ _Bit_type* __q = std::copy(__first._M_p, __last._M_p, __result._M_p);
+ return std::copy(const_iterator(__last._M_p, 0), __last,
+ iterator(__q, 0));
+ }
+
+ void
+ _M_initialize(size_type __n)
+ {
+ _Bit_type* __q = this->_M_allocate(__n);
+ this->_M_impl._M_end_of_storage = (__q
+ + ((__n + int(_S_word_bit) - 1)
+ / int(_S_word_bit)));
+ this->_M_impl._M_start = iterator(__q, 0);
+ this->_M_impl._M_finish = this->_M_impl._M_start + difference_type(__n);
+ }
+
+ // Check whether it's an integral type. If so, it's not an iterator.
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
+ {
+ _M_initialize(static_cast<size_type>(__n));
+ std::fill(this->_M_impl._M_start._M_p,
+ this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
+ }
+
+ template<typename _InputIterator>
+ void
+ _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type)
+ { _M_initialize_range(__first, __last,
+ std::__iterator_category(__first)); }
+
+ template<typename _InputIterator>
+ void
+ _M_initialize_range(_InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag)
+ {
+ for (; __first != __last; ++__first)
+ push_back(*__first);
+ }
+
+ template<typename _ForwardIterator>
+ void
+ _M_initialize_range(_ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag)
+ {
+ const size_type __n = std::distance(__first, __last);
+ _M_initialize(__n);
+ std::copy(__first, __last, this->_M_impl._M_start);
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
+ { _M_fill_assign(__n, __val); }
+
+ template<class _InputIterator>
+ void
+ _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type)
+ { _M_assign_aux(__first, __last, std::__iterator_category(__first)); }
+
+ void
+ _M_fill_assign(size_t __n, bool __x)
+ {
+ if (__n > size())
+ {
+ std::fill(this->_M_impl._M_start._M_p,
+ this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
+ insert(end(), __n - size(), __x);
+ }
+ else
+ {
+ _M_erase_at_end(begin() + __n);
+ std::fill(this->_M_impl._M_start._M_p,
+ this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
+ }
+ }
+
+ template<typename _InputIterator>
+ void
+ _M_assign_aux(_InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag)
+ {
+ iterator __cur = begin();
+ for (; __first != __last && __cur != end(); ++__cur, ++__first)
+ *__cur = *__first;
+ if (__first == __last)
+ _M_erase_at_end(__cur);
+ else
+ insert(end(), __first, __last);
+ }
+
+ template<typename _ForwardIterator>
+ void
+ _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag)
+ {
+ const size_type __len = std::distance(__first, __last);
+ if (__len < size())
+ _M_erase_at_end(std::copy(__first, __last, begin()));
+ else
+ {
+ _ForwardIterator __mid = __first;
+ std::advance(__mid, size());
+ std::copy(__first, __mid, begin());
+ insert(end(), __mid, __last);
+ }
+ }
+
+ // Check whether it's an integral type. If so, it's not an iterator.
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
+ __true_type)
+ { _M_fill_insert(__pos, __n, __x); }
+
+ template<typename _InputIterator>
+ void
+ _M_insert_dispatch(iterator __pos,
+ _InputIterator __first, _InputIterator __last,
+ __false_type)
+ { _M_insert_range(__pos, __first, __last,
+ std::__iterator_category(__first)); }
+
+ void
+ _M_fill_insert(iterator __position, size_type __n, bool __x);
+
+ template<typename _InputIterator>
+ void
+ _M_insert_range(iterator __pos, _InputIterator __first,
+ _InputIterator __last, std::input_iterator_tag)
+ {
+ for (; __first != __last; ++__first)
+ {
+ __pos = insert(__pos, *__first);
+ ++__pos;
+ }
+ }
+
+ template<typename _ForwardIterator>
+ void
+ _M_insert_range(iterator __position, _ForwardIterator __first,
+ _ForwardIterator __last, std::forward_iterator_tag);
+
+ void
+ _M_insert_aux(iterator __position, bool __x);
+
+ size_type
+ _M_check_len(size_type __n, const char* __s) const
+ {
+ if (max_size() - size() < __n)
+ __throw_length_error(__N(__s));
+
+ const size_type __len = size() + std::max(size(), __n);
+ return (__len < size() || __len > max_size()) ? max_size() : __len;
+ }
+
+ void
+ _M_erase_at_end(iterator __pos)
+ { this->_M_impl._M_finish = __pos; }
+ };
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_construct.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_construct.h
new file mode 100644
index 0000000..9df37fe
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_construct.h
@@ -0,0 +1,148 @@
+// nonstandard construct and destroy functions -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_construct.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_CONSTRUCT_H
+#define _STL_CONSTRUCT_H 1
+
+#include <new>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * Constructs an object in existing memory by invoking an allocated
+ * object's constructor with an initializer.
+ */
+ template<typename _T1, typename _T2>
+ inline void
+ _Construct(_T1* __p, const _T2& __value)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 402. wrong new expression in [some_]allocator::construct
+ ::new(static_cast<void*>(__p)) _T1(__value);
+ }
+
+ /**
+ * Destroy the object pointed to by a pointer type.
+ */
+ template<typename _Tp>
+ inline void
+ _Destroy(_Tp* __pointer)
+ { __pointer->~_Tp(); }
+
+ template<bool>
+ struct _Destroy_aux
+ {
+ template<typename _ForwardIterator>
+ static void
+ __destroy(_ForwardIterator __first, _ForwardIterator __last)
+ {
+ for (; __first != __last; ++__first)
+ std::_Destroy(&*__first);
+ }
+ };
+
+ template<>
+ struct _Destroy_aux<true>
+ {
+ template<typename _ForwardIterator>
+ static void
+ __destroy(_ForwardIterator, _ForwardIterator) { }
+ };
+
+ /**
+ * Destroy a range of objects. If the value_type of the object has
+ * a trivial destructor, the compiler should optimize all of this
+ * away, otherwise the objects' destructors must be invoked.
+ */
+ template<typename _ForwardIterator>
+ inline void
+ _Destroy(_ForwardIterator __first, _ForwardIterator __last)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _Value_type;
+ std::_Destroy_aux<__has_trivial_destructor(_Value_type)>::
+ __destroy(__first, __last);
+ }
+
+ /**
+ * Destroy a range of objects using the supplied allocator. For
+ * nondefault allocators we do not optimize away invocation of
+ * destroy() even if _Tp has a trivial destructor.
+ */
+
+ template <typename _Tp> class allocator;
+
+ template<typename _ForwardIterator, typename _Allocator>
+ void
+ _Destroy(_ForwardIterator __first, _ForwardIterator __last,
+ _Allocator& __alloc)
+ {
+ for (; __first != __last; ++__first)
+ __alloc.destroy(&*__first);
+ }
+
+ template<typename _ForwardIterator, typename _Tp>
+ inline void
+ _Destroy(_ForwardIterator __first, _ForwardIterator __last,
+ allocator<_Tp>&)
+ {
+ _Destroy(__first, __last);
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_CONSTRUCT_H */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_deque.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_deque.h
new file mode 100644
index 0000000..1c20e27
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_deque.h
@@ -0,0 +1,1819 @@
+// Deque implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_deque.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_DEQUE_H
+#define _STL_DEQUE_H 1
+
+#include <bits/concept_check.h>
+#include <bits/stl_iterator_base_types.h>
+#include <bits/stl_iterator_base_funcs.h>
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ /**
+ * @brief This function controls the size of memory nodes.
+ * @param size The size of an element.
+ * @return The number (not byte size) of elements per node.
+ *
+ * This function started off as a compiler kludge from SGI, but seems to
+ * be a useful wrapper around a repeated constant expression. The '512' is
+ * tunable (and no other code needs to change), but no investigation has
+ * been done since inheriting the SGI code.
+ */
+ inline size_t
+ __deque_buf_size(size_t __size)
+ { return __size < 512 ? size_t(512 / __size) : size_t(1); }
+
+
+ /**
+ * @brief A deque::iterator.
+ *
+ * Quite a bit of intelligence here. Much of the functionality of
+ * deque is actually passed off to this class. A deque holds two
+ * of these internally, marking its valid range. Access to
+ * elements is done as offsets of either of those two, relying on
+ * operator overloading in this class.
+ *
+ * All the functions are op overloads except for _M_set_node.
+ */
+ template<typename _Tp, typename _Ref, typename _Ptr>
+ struct _Deque_iterator
+ {
+ typedef _Deque_iterator<_Tp, _Tp&, _Tp*> iterator;
+ typedef _Deque_iterator<_Tp, const _Tp&, const _Tp*> const_iterator;
+
+ static size_t _S_buffer_size()
+ { return __deque_buf_size(sizeof(_Tp)); }
+
+ typedef std::random_access_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef _Ptr pointer;
+ typedef _Ref reference;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp** _Map_pointer;
+ typedef _Deque_iterator _Self;
+
+ _Tp* _M_cur;
+ _Tp* _M_first;
+ _Tp* _M_last;
+ _Map_pointer _M_node;
+
+ _Deque_iterator(_Tp* __x, _Map_pointer __y)
+ : _M_cur(__x), _M_first(*__y),
+ _M_last(*__y + _S_buffer_size()), _M_node(__y) { }
+
+ _Deque_iterator()
+ : _M_cur(0), _M_first(0), _M_last(0), _M_node(0) { }
+
+ _Deque_iterator(const iterator& __x)
+ : _M_cur(__x._M_cur), _M_first(__x._M_first),
+ _M_last(__x._M_last), _M_node(__x._M_node) { }
+
+ reference
+ operator*() const
+ { return *_M_cur; }
+
+ pointer
+ operator->() const
+ { return _M_cur; }
+
+ _Self&
+ operator++()
+ {
+ ++_M_cur;
+ if (_M_cur == _M_last)
+ {
+ _M_set_node(_M_node + 1);
+ _M_cur = _M_first;
+ }
+ return *this;
+ }
+
+ _Self
+ operator++(int)
+ {
+ _Self __tmp = *this;
+ ++*this;
+ return __tmp;
+ }
+
+ _Self&
+ operator--()
+ {
+ if (_M_cur == _M_first)
+ {
+ _M_set_node(_M_node - 1);
+ _M_cur = _M_last;
+ }
+ --_M_cur;
+ return *this;
+ }
+
+ _Self
+ operator--(int)
+ {
+ _Self __tmp = *this;
+ --*this;
+ return __tmp;
+ }
+
+ _Self&
+ operator+=(difference_type __n)
+ {
+ const difference_type __offset = __n + (_M_cur - _M_first);
+ if (__offset >= 0 && __offset < difference_type(_S_buffer_size()))
+ _M_cur += __n;
+ else
+ {
+ const difference_type __node_offset =
+ __offset > 0 ? __offset / difference_type(_S_buffer_size())
+ : -difference_type((-__offset - 1)
+ / _S_buffer_size()) - 1;
+ _M_set_node(_M_node + __node_offset);
+ _M_cur = _M_first + (__offset - __node_offset
+ * difference_type(_S_buffer_size()));
+ }
+ return *this;
+ }
+
+ _Self
+ operator+(difference_type __n) const
+ {
+ _Self __tmp = *this;
+ return __tmp += __n;
+ }
+
+ _Self&
+ operator-=(difference_type __n)
+ { return *this += -__n; }
+
+ _Self
+ operator-(difference_type __n) const
+ {
+ _Self __tmp = *this;
+ return __tmp -= __n;
+ }
+
+ reference
+ operator[](difference_type __n) const
+ { return *(*this + __n); }
+
+ /**
+ * Prepares to traverse new_node. Sets everything except
+ * _M_cur, which should therefore be set by the caller
+ * immediately afterwards, based on _M_first and _M_last.
+ */
+ void
+ _M_set_node(_Map_pointer __new_node)
+ {
+ _M_node = __new_node;
+ _M_first = *__new_node;
+ _M_last = _M_first + difference_type(_S_buffer_size());
+ }
+ };
+
+ // Note: we also provide overloads whose operands are of the same type in
+ // order to avoid ambiguous overload resolution when std::rel_ops operators
+ // are in scope (for additional details, see libstdc++/3628)
+ template<typename _Tp, typename _Ref, typename _Ptr>
+ inline bool
+ operator==(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
+ const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
+ { return __x._M_cur == __y._M_cur; }
+
+ template<typename _Tp, typename _RefL, typename _PtrL,
+ typename _RefR, typename _PtrR>
+ inline bool
+ operator==(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
+ const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
+ { return __x._M_cur == __y._M_cur; }
+
+ template<typename _Tp, typename _Ref, typename _Ptr>
+ inline bool
+ operator!=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
+ const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
+ { return !(__x == __y); }
+
+ template<typename _Tp, typename _RefL, typename _PtrL,
+ typename _RefR, typename _PtrR>
+ inline bool
+ operator!=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
+ const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
+ { return !(__x == __y); }
+
+ template<typename _Tp, typename _Ref, typename _Ptr>
+ inline bool
+ operator<(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
+ const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
+ { return (__x._M_node == __y._M_node) ? (__x._M_cur < __y._M_cur)
+ : (__x._M_node < __y._M_node); }
+
+ template<typename _Tp, typename _RefL, typename _PtrL,
+ typename _RefR, typename _PtrR>
+ inline bool
+ operator<(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
+ const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
+ { return (__x._M_node == __y._M_node) ? (__x._M_cur < __y._M_cur)
+ : (__x._M_node < __y._M_node); }
+
+ template<typename _Tp, typename _Ref, typename _Ptr>
+ inline bool
+ operator>(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
+ const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
+ { return __y < __x; }
+
+ template<typename _Tp, typename _RefL, typename _PtrL,
+ typename _RefR, typename _PtrR>
+ inline bool
+ operator>(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
+ const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
+ { return __y < __x; }
+
+ template<typename _Tp, typename _Ref, typename _Ptr>
+ inline bool
+ operator<=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
+ const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
+ { return !(__y < __x); }
+
+ template<typename _Tp, typename _RefL, typename _PtrL,
+ typename _RefR, typename _PtrR>
+ inline bool
+ operator<=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
+ const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
+ { return !(__y < __x); }
+
+ template<typename _Tp, typename _Ref, typename _Ptr>
+ inline bool
+ operator>=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
+ const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
+ { return !(__x < __y); }
+
+ template<typename _Tp, typename _RefL, typename _PtrL,
+ typename _RefR, typename _PtrR>
+ inline bool
+ operator>=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
+ const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
+ { return !(__x < __y); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // According to the resolution of DR179 not only the various comparison
+ // operators but also operator- must accept mixed iterator/const_iterator
+ // parameters.
+ template<typename _Tp, typename _Ref, typename _Ptr>
+ inline typename _Deque_iterator<_Tp, _Ref, _Ptr>::difference_type
+ operator-(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
+ const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
+ {
+ return typename _Deque_iterator<_Tp, _Ref, _Ptr>::difference_type
+ (_Deque_iterator<_Tp, _Ref, _Ptr>::_S_buffer_size())
+ * (__x._M_node - __y._M_node - 1) + (__x._M_cur - __x._M_first)
+ + (__y._M_last - __y._M_cur);
+ }
+
+ template<typename _Tp, typename _RefL, typename _PtrL,
+ typename _RefR, typename _PtrR>
+ inline typename _Deque_iterator<_Tp, _RefL, _PtrL>::difference_type
+ operator-(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
+ const _Deque_iterator<_Tp, _RefR, _PtrR>& __y)
+ {
+ return typename _Deque_iterator<_Tp, _RefL, _PtrL>::difference_type
+ (_Deque_iterator<_Tp, _RefL, _PtrL>::_S_buffer_size())
+ * (__x._M_node - __y._M_node - 1) + (__x._M_cur - __x._M_first)
+ + (__y._M_last - __y._M_cur);
+ }
+
+ template<typename _Tp, typename _Ref, typename _Ptr>
+ inline _Deque_iterator<_Tp, _Ref, _Ptr>
+ operator+(ptrdiff_t __n, const _Deque_iterator<_Tp, _Ref, _Ptr>& __x)
+ { return __x + __n; }
+
+ template<typename _Tp>
+ void
+ fill(const _Deque_iterator<_Tp, _Tp&, _Tp*>& __first,
+ const _Deque_iterator<_Tp, _Tp&, _Tp*>& __last, const _Tp& __value);
+
+ /**
+ * Deque base class. This class provides the unified face for %deque's
+ * allocation. This class's constructor and destructor allocate and
+ * deallocate (but do not initialize) storage. This makes %exception
+ * safety easier.
+ *
+ * Nothing in this class ever constructs or destroys an actual Tp element.
+ * (Deque handles that itself.) Only/All memory management is performed
+ * here.
+ */
+ template<typename _Tp, typename _Alloc>
+ class _Deque_base
+ {
+ public:
+ typedef _Alloc allocator_type;
+
+ allocator_type
+ get_allocator() const
+ { return allocator_type(_M_get_Tp_allocator()); }
+
+ typedef _Deque_iterator<_Tp, _Tp&, _Tp*> iterator;
+ typedef _Deque_iterator<_Tp, const _Tp&, const _Tp*> const_iterator;
+
+ _Deque_base()
+ : _M_impl()
+ { _M_initialize_map(0); }
+
+ _Deque_base(const allocator_type& __a, size_t __num_elements)
+ : _M_impl(__a)
+ { _M_initialize_map(__num_elements); }
+
+ _Deque_base(const allocator_type& __a)
+ : _M_impl(__a)
+ { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ _Deque_base(_Deque_base&& __x)
+ : _M_impl(__x._M_get_Tp_allocator())
+ {
+ _M_initialize_map(0);
+ if (__x._M_impl._M_map)
+ {
+ std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
+ std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
+ std::swap(this->_M_impl._M_map, __x._M_impl._M_map);
+ std::swap(this->_M_impl._M_map_size, __x._M_impl._M_map_size);
+ }
+ }
+#endif
+
+ ~_Deque_base();
+
+ protected:
+ //This struct encapsulates the implementation of the std::deque
+ //standard container and at the same time makes use of the EBO
+ //for empty allocators.
+ typedef typename _Alloc::template rebind<_Tp*>::other _Map_alloc_type;
+
+ typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
+
+ struct _Deque_impl
+ : public _Tp_alloc_type
+ {
+ _Tp** _M_map;
+ size_t _M_map_size;
+ iterator _M_start;
+ iterator _M_finish;
+
+ _Deque_impl()
+ : _Tp_alloc_type(), _M_map(0), _M_map_size(0),
+ _M_start(), _M_finish()
+ { }
+
+ _Deque_impl(const _Tp_alloc_type& __a)
+ : _Tp_alloc_type(__a), _M_map(0), _M_map_size(0),
+ _M_start(), _M_finish()
+ { }
+ };
+
+ _Tp_alloc_type&
+ _M_get_Tp_allocator()
+ { return *static_cast<_Tp_alloc_type*>(&this->_M_impl); }
+
+ const _Tp_alloc_type&
+ _M_get_Tp_allocator() const
+ { return *static_cast<const _Tp_alloc_type*>(&this->_M_impl); }
+
+ _Map_alloc_type
+ _M_get_map_allocator() const
+ { return _Map_alloc_type(_M_get_Tp_allocator()); }
+
+ _Tp*
+ _M_allocate_node()
+ {
+ return _M_impl._Tp_alloc_type::allocate(__deque_buf_size(sizeof(_Tp)));
+ }
+
+ void
+ _M_deallocate_node(_Tp* __p)
+ {
+ _M_impl._Tp_alloc_type::deallocate(__p, __deque_buf_size(sizeof(_Tp)));
+ }
+
+ _Tp**
+ _M_allocate_map(size_t __n)
+ { return _M_get_map_allocator().allocate(__n); }
+
+ void
+ _M_deallocate_map(_Tp** __p, size_t __n)
+ { _M_get_map_allocator().deallocate(__p, __n); }
+
+ protected:
+ void _M_initialize_map(size_t);
+ void _M_create_nodes(_Tp** __nstart, _Tp** __nfinish);
+ void _M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish);
+ enum { _S_initial_map_size = 8 };
+
+ _Deque_impl _M_impl;
+ };
+
+ template<typename _Tp, typename _Alloc>
+ _Deque_base<_Tp, _Alloc>::
+ ~_Deque_base()
+ {
+ if (this->_M_impl._M_map)
+ {
+ _M_destroy_nodes(this->_M_impl._M_start._M_node,
+ this->_M_impl._M_finish._M_node + 1);
+ _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size);
+ }
+ }
+
+ /**
+ * @brief Layout storage.
+ * @param num_elements The count of T's for which to allocate space
+ * at first.
+ * @return Nothing.
+ *
+ * The initial underlying memory layout is a bit complicated...
+ */
+ template<typename _Tp, typename _Alloc>
+ void
+ _Deque_base<_Tp, _Alloc>::
+ _M_initialize_map(size_t __num_elements)
+ {
+ const size_t __num_nodes = (__num_elements/ __deque_buf_size(sizeof(_Tp))
+ + 1);
+
+ this->_M_impl._M_map_size = std::max((size_t) _S_initial_map_size,
+ size_t(__num_nodes + 2));
+ this->_M_impl._M_map = _M_allocate_map(this->_M_impl._M_map_size);
+
+ // For "small" maps (needing less than _M_map_size nodes), allocation
+ // starts in the middle elements and grows outwards. So nstart may be
+ // the beginning of _M_map, but for small maps it may be as far in as
+ // _M_map+3.
+
+ _Tp** __nstart = (this->_M_impl._M_map
+ + (this->_M_impl._M_map_size - __num_nodes) / 2);
+ _Tp** __nfinish = __nstart + __num_nodes;
+
+ __try
+ { _M_create_nodes(__nstart, __nfinish); }
+ __catch(...)
+ {
+ _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size);
+ this->_M_impl._M_map = 0;
+ this->_M_impl._M_map_size = 0;
+ __throw_exception_again;
+ }
+
+ this->_M_impl._M_start._M_set_node(__nstart);
+ this->_M_impl._M_finish._M_set_node(__nfinish - 1);
+ this->_M_impl._M_start._M_cur = _M_impl._M_start._M_first;
+ this->_M_impl._M_finish._M_cur = (this->_M_impl._M_finish._M_first
+ + __num_elements
+ % __deque_buf_size(sizeof(_Tp)));
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ _Deque_base<_Tp, _Alloc>::
+ _M_create_nodes(_Tp** __nstart, _Tp** __nfinish)
+ {
+ _Tp** __cur;
+ __try
+ {
+ for (__cur = __nstart; __cur < __nfinish; ++__cur)
+ *__cur = this->_M_allocate_node();
+ }
+ __catch(...)
+ {
+ _M_destroy_nodes(__nstart, __cur);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ _Deque_base<_Tp, _Alloc>::
+ _M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish)
+ {
+ for (_Tp** __n = __nstart; __n < __nfinish; ++__n)
+ _M_deallocate_node(*__n);
+ }
+
+ /**
+ * @brief A standard container using fixed-size memory allocation and
+ * constant-time manipulation of elements at either end.
+ *
+ * @ingroup sequences
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, a
+ * <a href="tables.html#66">reversible container</a>, and a
+ * <a href="tables.html#67">sequence</a>, including the
+ * <a href="tables.html#68">optional sequence requirements</a>.
+ *
+ * In previous HP/SGI versions of deque, there was an extra template
+ * parameter so users could control the node size. This extension turned
+ * out to violate the C++ standard (it can be detected using template
+ * template parameters), and it was removed.
+ *
+ * Here's how a deque<Tp> manages memory. Each deque has 4 members:
+ *
+ * - Tp** _M_map
+ * - size_t _M_map_size
+ * - iterator _M_start, _M_finish
+ *
+ * map_size is at least 8. %map is an array of map_size
+ * pointers-to-"nodes". (The name %map has nothing to do with the
+ * std::map class, and "nodes" should not be confused with
+ * std::list's usage of "node".)
+ *
+ * A "node" has no specific type name as such, but it is referred
+ * to as "node" in this file. It is a simple array-of-Tp. If Tp
+ * is very large, there will be one Tp element per node (i.e., an
+ * "array" of one). For non-huge Tp's, node size is inversely
+ * related to Tp size: the larger the Tp, the fewer Tp's will fit
+ * in a node. The goal here is to keep the total size of a node
+ * relatively small and constant over different Tp's, to improve
+ * allocator efficiency.
+ *
+ * Not every pointer in the %map array will point to a node. If
+ * the initial number of elements in the deque is small, the
+ * /middle/ %map pointers will be valid, and the ones at the edges
+ * will be unused. This same situation will arise as the %map
+ * grows: available %map pointers, if any, will be on the ends. As
+ * new nodes are created, only a subset of the %map's pointers need
+ * to be copied "outward".
+ *
+ * Class invariants:
+ * - For any nonsingular iterator i:
+ * - i.node points to a member of the %map array. (Yes, you read that
+ * correctly: i.node does not actually point to a node.) The member of
+ * the %map array is what actually points to the node.
+ * - i.first == *(i.node) (This points to the node (first Tp element).)
+ * - i.last == i.first + node_size
+ * - i.cur is a pointer in the range [i.first, i.last). NOTE:
+ * the implication of this is that i.cur is always a dereferenceable
+ * pointer, even if i is a past-the-end iterator.
+ * - Start and Finish are always nonsingular iterators. NOTE: this
+ * means that an empty deque must have one node, a deque with <N
+ * elements (where N is the node buffer size) must have one node, a
+ * deque with N through (2N-1) elements must have two nodes, etc.
+ * - For every node other than start.node and finish.node, every
+ * element in the node is an initialized object. If start.node ==
+ * finish.node, then [start.cur, finish.cur) are initialized
+ * objects, and the elements outside that range are uninitialized
+ * storage. Otherwise, [start.cur, start.last) and [finish.first,
+ * finish.cur) are initialized objects, and [start.first, start.cur)
+ * and [finish.cur, finish.last) are uninitialized storage.
+ * - [%map, %map + map_size) is a valid, non-empty range.
+ * - [start.node, finish.node] is a valid range contained within
+ * [%map, %map + map_size).
+ * - A pointer in the range [%map, %map + map_size) points to an allocated
+ * node if and only if the pointer is in the range
+ * [start.node, finish.node].
+ *
+ * Here's the magic: nothing in deque is "aware" of the discontiguous
+ * storage!
+ *
+ * The memory setup and layout occurs in the parent, _Base, and the iterator
+ * class is entirely responsible for "leaping" from one node to the next.
+ * All the implementation routines for deque itself work only through the
+ * start and finish iterators. This keeps the routines simple and sane,
+ * and we can use other standard algorithms as well.
+ */
+ template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
+ class deque : protected _Deque_base<_Tp, _Alloc>
+ {
+ // concept requirements
+ typedef typename _Alloc::value_type _Alloc_value_type;
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept)
+
+ typedef _Deque_base<_Tp, _Alloc> _Base;
+ typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
+
+ public:
+ typedef _Tp value_type;
+ typedef typename _Tp_alloc_type::pointer pointer;
+ typedef typename _Tp_alloc_type::const_pointer const_pointer;
+ typedef typename _Tp_alloc_type::reference reference;
+ typedef typename _Tp_alloc_type::const_reference const_reference;
+ typedef typename _Base::iterator iterator;
+ typedef typename _Base::const_iterator const_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Alloc allocator_type;
+
+ protected:
+ typedef pointer* _Map_pointer;
+
+ static size_t _S_buffer_size()
+ { return __deque_buf_size(sizeof(_Tp)); }
+
+ // Functions controlling memory layout, and nothing else.
+ using _Base::_M_initialize_map;
+ using _Base::_M_create_nodes;
+ using _Base::_M_destroy_nodes;
+ using _Base::_M_allocate_node;
+ using _Base::_M_deallocate_node;
+ using _Base::_M_allocate_map;
+ using _Base::_M_deallocate_map;
+ using _Base::_M_get_Tp_allocator;
+
+ /**
+ * A total of four data members accumulated down the hierarchy.
+ * May be accessed via _M_impl.*
+ */
+ using _Base::_M_impl;
+
+ public:
+ // [23.2.1.1] construct/copy/destroy
+ // (assign() and get_allocator() are also listed in this section)
+ /**
+ * @brief Default constructor creates no elements.
+ */
+ deque()
+ : _Base() { }
+
+ /**
+ * @brief Creates a %deque with no elements.
+ * @param a An allocator object.
+ */
+ explicit
+ deque(const allocator_type& __a)
+ : _Base(__a, 0) { }
+
+ /**
+ * @brief Creates a %deque with copies of an exemplar element.
+ * @param n The number of elements to initially create.
+ * @param value An element to copy.
+ * @param a An allocator.
+ *
+ * This constructor fills the %deque with @a n copies of @a value.
+ */
+ explicit
+ deque(size_type __n, const value_type& __value = value_type(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__a, __n)
+ { _M_fill_initialize(__value); }
+
+ /**
+ * @brief %Deque copy constructor.
+ * @param x A %deque of identical element and allocator types.
+ *
+ * The newly-created %deque uses a copy of the allocation object used
+ * by @a x.
+ */
+ deque(const deque& __x)
+ : _Base(__x._M_get_Tp_allocator(), __x.size())
+ { std::__uninitialized_copy_a(__x.begin(), __x.end(),
+ this->_M_impl._M_start,
+ _M_get_Tp_allocator()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Deque move constructor.
+ * @param x A %deque of identical element and allocator types.
+ *
+ * The newly-created %deque contains the exact contents of @a x.
+ * The contents of @a x are a valid, but unspecified %deque.
+ */
+ deque(deque&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+
+ /**
+ * @brief Builds a %deque from an initializer list.
+ * @param l An initializer_list.
+ * @param a An allocator object.
+ *
+ * Create a %deque consisting of copies of the elements in the
+ * initializer_list @a l.
+ *
+ * This will call the element type's copy constructor N times
+ * (where N is l.size()) and do no memory reallocation.
+ */
+ deque(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ _M_range_initialize(__l.begin(), __l.end(),
+ random_access_iterator_tag());
+ }
+#endif
+
+ /**
+ * @brief Builds a %deque from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param a An allocator object.
+ *
+ * Create a %deque consisting of copies of the elements from [first,
+ * last).
+ *
+ * If the iterators are forward, bidirectional, or random-access, then
+ * this will call the elements' copy constructor N times (where N is
+ * distance(first,last)) and do no memory reallocation. But if only
+ * input iterators are used, then this will do at most 2N calls to the
+ * copy constructor, and logN memory reallocations.
+ */
+ template<typename _InputIterator>
+ deque(_InputIterator __first, _InputIterator __last,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ // Check whether it's an integral type. If so, it's not an iterator.
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_initialize_dispatch(__first, __last, _Integral());
+ }
+
+ /**
+ * The dtor only erases the elements, and note that if the elements
+ * themselves are pointers, the pointed-to memory is not touched in any
+ * way. Managing the pointer is the user's responsibility.
+ */
+ ~deque()
+ { _M_destroy_data(begin(), end(), _M_get_Tp_allocator()); }
+
+ /**
+ * @brief %Deque assignment operator.
+ * @param x A %deque of identical element and allocator types.
+ *
+ * All the elements of @a x are copied, but unlike the copy constructor,
+ * the allocator object is not copied.
+ */
+ deque&
+ operator=(const deque& __x);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Deque move assignment operator.
+ * @param x A %deque of identical element and allocator types.
+ *
+ * The contents of @a x are moved into this deque (without copying).
+ * @a x is a valid, but unspecified %deque.
+ */
+ deque&
+ operator=(deque&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ /**
+ * @brief Assigns an initializer list to a %deque.
+ * @param l An initializer_list.
+ *
+ * This function fills a %deque with copies of the elements in the
+ * initializer_list @a l.
+ *
+ * Note that the assignment completely changes the %deque and that the
+ * resulting %deque's size is the same as the number of elements
+ * assigned. Old data may be lost.
+ */
+ deque&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->assign(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+
+ /**
+ * @brief Assigns a given value to a %deque.
+ * @param n Number of elements to be assigned.
+ * @param val Value to be assigned.
+ *
+ * This function fills a %deque with @a n copies of the given
+ * value. Note that the assignment completely changes the
+ * %deque and that the resulting %deque's size is the same as
+ * the number of elements assigned. Old data may be lost.
+ */
+ void
+ assign(size_type __n, const value_type& __val)
+ { _M_fill_assign(__n, __val); }
+
+ /**
+ * @brief Assigns a range to a %deque.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * This function fills a %deque with copies of the elements in the
+ * range [first,last).
+ *
+ * Note that the assignment completely changes the %deque and that the
+ * resulting %deque's size is the same as the number of elements
+ * assigned. Old data may be lost.
+ */
+ template<typename _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_assign_dispatch(__first, __last, _Integral());
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Assigns an initializer list to a %deque.
+ * @param l An initializer_list.
+ *
+ * This function fills a %deque with copies of the elements in the
+ * initializer_list @a l.
+ *
+ * Note that the assignment completely changes the %deque and that the
+ * resulting %deque's size is the same as the number of elements
+ * assigned. Old data may be lost.
+ */
+ void
+ assign(initializer_list<value_type> __l)
+ { this->assign(__l.begin(), __l.end()); }
+#endif
+
+ /// Get a copy of the memory allocation object.
+ allocator_type
+ get_allocator() const
+ { return _Base::get_allocator(); }
+
+ // iterators
+ /**
+ * Returns a read/write iterator that points to the first element in the
+ * %deque. Iteration is done in ordinary element order.
+ */
+ iterator
+ begin()
+ { return this->_M_impl._M_start; }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * element in the %deque. Iteration is done in ordinary element order.
+ */
+ const_iterator
+ begin() const
+ { return this->_M_impl._M_start; }
+
+ /**
+ * Returns a read/write iterator that points one past the last
+ * element in the %deque. Iteration is done in ordinary
+ * element order.
+ */
+ iterator
+ end()
+ { return this->_M_impl._M_finish; }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past
+ * the last element in the %deque. Iteration is done in
+ * ordinary element order.
+ */
+ const_iterator
+ end() const
+ { return this->_M_impl._M_finish; }
+
+ /**
+ * Returns a read/write reverse iterator that points to the
+ * last element in the %deque. Iteration is done in reverse
+ * element order.
+ */
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(this->_M_impl._M_finish); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to the last element in the %deque. Iteration is done in
+ * reverse element order.
+ */
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(this->_M_impl._M_finish); }
+
+ /**
+ * Returns a read/write reverse iterator that points to one
+ * before the first element in the %deque. Iteration is done
+ * in reverse element order.
+ */
+ reverse_iterator
+ rend()
+ { return reverse_iterator(this->_M_impl._M_start); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to one before the first element in the %deque. Iteration is
+ * done in reverse element order.
+ */
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(this->_M_impl._M_start); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * element in the %deque. Iteration is done in ordinary element order.
+ */
+ const_iterator
+ cbegin() const
+ { return this->_M_impl._M_start; }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past
+ * the last element in the %deque. Iteration is done in
+ * ordinary element order.
+ */
+ const_iterator
+ cend() const
+ { return this->_M_impl._M_finish; }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to the last element in the %deque. Iteration is done in
+ * reverse element order.
+ */
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(this->_M_impl._M_finish); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to one before the first element in the %deque. Iteration is
+ * done in reverse element order.
+ */
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(this->_M_impl._M_start); }
+#endif
+
+ // [23.2.1.2] capacity
+ /** Returns the number of elements in the %deque. */
+ size_type
+ size() const
+ { return this->_M_impl._M_finish - this->_M_impl._M_start; }
+
+ /** Returns the size() of the largest possible %deque. */
+ size_type
+ max_size() const
+ { return _M_get_Tp_allocator().max_size(); }
+
+ /**
+ * @brief Resizes the %deque to the specified number of elements.
+ * @param new_size Number of elements the %deque should contain.
+ * @param x Data with which new elements should be populated.
+ *
+ * This function will %resize the %deque to the specified
+ * number of elements. If the number is smaller than the
+ * %deque's current size the %deque is truncated, otherwise the
+ * %deque is extended and new elements are populated with given
+ * data.
+ */
+ void
+ resize(size_type __new_size, value_type __x = value_type())
+ {
+ const size_type __len = size();
+ if (__new_size < __len)
+ _M_erase_at_end(this->_M_impl._M_start + difference_type(__new_size));
+ else
+ insert(this->_M_impl._M_finish, __new_size - __len, __x);
+ }
+
+ /**
+ * Returns true if the %deque is empty. (Thus begin() would
+ * equal end().)
+ */
+ bool
+ empty() const
+ { return this->_M_impl._M_finish == this->_M_impl._M_start; }
+
+ // element access
+ /**
+ * @brief Subscript access to the data contained in the %deque.
+ * @param n The index of the element for which data should be
+ * accessed.
+ * @return Read/write reference to data.
+ *
+ * This operator allows for easy, array-style, data access.
+ * Note that data access with this operator is unchecked and
+ * out_of_range lookups are not defined. (For checked lookups
+ * see at().)
+ */
+ reference
+ operator[](size_type __n)
+ { return this->_M_impl._M_start[difference_type(__n)]; }
+
+ /**
+ * @brief Subscript access to the data contained in the %deque.
+ * @param n The index of the element for which data should be
+ * accessed.
+ * @return Read-only (constant) reference to data.
+ *
+ * This operator allows for easy, array-style, data access.
+ * Note that data access with this operator is unchecked and
+ * out_of_range lookups are not defined. (For checked lookups
+ * see at().)
+ */
+ const_reference
+ operator[](size_type __n) const
+ { return this->_M_impl._M_start[difference_type(__n)]; }
+
+ protected:
+ /// Safety check used only from at().
+ void
+ _M_range_check(size_type __n) const
+ {
+ if (__n >= this->size())
+ __throw_out_of_range(__N("deque::_M_range_check"));
+ }
+
+ public:
+ /**
+ * @brief Provides access to the data contained in the %deque.
+ * @param n The index of the element for which data should be
+ * accessed.
+ * @return Read/write reference to data.
+ * @throw std::out_of_range If @a n is an invalid index.
+ *
+ * This function provides for safer data access. The parameter
+ * is first checked that it is in the range of the deque. The
+ * function throws out_of_range if the check fails.
+ */
+ reference
+ at(size_type __n)
+ {
+ _M_range_check(__n);
+ return (*this)[__n];
+ }
+
+ /**
+ * @brief Provides access to the data contained in the %deque.
+ * @param n The index of the element for which data should be
+ * accessed.
+ * @return Read-only (constant) reference to data.
+ * @throw std::out_of_range If @a n is an invalid index.
+ *
+ * This function provides for safer data access. The parameter is first
+ * checked that it is in the range of the deque. The function throws
+ * out_of_range if the check fails.
+ */
+ const_reference
+ at(size_type __n) const
+ {
+ _M_range_check(__n);
+ return (*this)[__n];
+ }
+
+ /**
+ * Returns a read/write reference to the data at the first
+ * element of the %deque.
+ */
+ reference
+ front()
+ { return *begin(); }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the first
+ * element of the %deque.
+ */
+ const_reference
+ front() const
+ { return *begin(); }
+
+ /**
+ * Returns a read/write reference to the data at the last element of the
+ * %deque.
+ */
+ reference
+ back()
+ {
+ iterator __tmp = end();
+ --__tmp;
+ return *__tmp;
+ }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the last
+ * element of the %deque.
+ */
+ const_reference
+ back() const
+ {
+ const_iterator __tmp = end();
+ --__tmp;
+ return *__tmp;
+ }
+
+ // [23.2.1.2] modifiers
+ /**
+ * @brief Add data to the front of the %deque.
+ * @param x Data to be added.
+ *
+ * This is a typical stack operation. The function creates an
+ * element at the front of the %deque and assigns the given
+ * data to it. Due to the nature of a %deque this operation
+ * can be done in constant time.
+ */
+ void
+ push_front(const value_type& __x)
+ {
+ if (this->_M_impl._M_start._M_cur != this->_M_impl._M_start._M_first)
+ {
+ this->_M_impl.construct(this->_M_impl._M_start._M_cur - 1, __x);
+ --this->_M_impl._M_start._M_cur;
+ }
+ else
+ _M_push_front_aux(__x);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push_front(value_type&& __x)
+ { emplace_front(std::move(__x)); }
+
+ template<typename... _Args>
+ void
+ emplace_front(_Args&&... __args);
+#endif
+
+ /**
+ * @brief Add data to the end of the %deque.
+ * @param x Data to be added.
+ *
+ * This is a typical stack operation. The function creates an
+ * element at the end of the %deque and assigns the given data
+ * to it. Due to the nature of a %deque this operation can be
+ * done in constant time.
+ */
+ void
+ push_back(const value_type& __x)
+ {
+ if (this->_M_impl._M_finish._M_cur
+ != this->_M_impl._M_finish._M_last - 1)
+ {
+ this->_M_impl.construct(this->_M_impl._M_finish._M_cur, __x);
+ ++this->_M_impl._M_finish._M_cur;
+ }
+ else
+ _M_push_back_aux(__x);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push_back(value_type&& __x)
+ { emplace_back(std::move(__x)); }
+
+ template<typename... _Args>
+ void
+ emplace_back(_Args&&... __args);
+#endif
+
+ /**
+ * @brief Removes first element.
+ *
+ * This is a typical stack operation. It shrinks the %deque by one.
+ *
+ * Note that no data is returned, and if the first element's data is
+ * needed, it should be retrieved before pop_front() is called.
+ */
+ void
+ pop_front()
+ {
+ if (this->_M_impl._M_start._M_cur
+ != this->_M_impl._M_start._M_last - 1)
+ {
+ this->_M_impl.destroy(this->_M_impl._M_start._M_cur);
+ ++this->_M_impl._M_start._M_cur;
+ }
+ else
+ _M_pop_front_aux();
+ }
+
+ /**
+ * @brief Removes last element.
+ *
+ * This is a typical stack operation. It shrinks the %deque by one.
+ *
+ * Note that no data is returned, and if the last element's data is
+ * needed, it should be retrieved before pop_back() is called.
+ */
+ void
+ pop_back()
+ {
+ if (this->_M_impl._M_finish._M_cur
+ != this->_M_impl._M_finish._M_first)
+ {
+ --this->_M_impl._M_finish._M_cur;
+ this->_M_impl.destroy(this->_M_impl._M_finish._M_cur);
+ }
+ else
+ _M_pop_back_aux();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Inserts an object in %deque before specified iterator.
+ * @param position An iterator into the %deque.
+ * @param args Arguments.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert an object of type T constructed
+ * with T(std::forward<Args>(args)...) before the specified location.
+ */
+ template<typename... _Args>
+ iterator
+ emplace(iterator __position, _Args&&... __args);
+#endif
+
+ /**
+ * @brief Inserts given value into %deque before specified iterator.
+ * @param position An iterator into the %deque.
+ * @param x Data to be inserted.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert a copy of the given value before the
+ * specified location.
+ */
+ iterator
+ insert(iterator __position, const value_type& __x);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Inserts given rvalue into %deque before specified iterator.
+ * @param position An iterator into the %deque.
+ * @param x Data to be inserted.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert a copy of the given rvalue before the
+ * specified location.
+ */
+ iterator
+ insert(iterator __position, value_type&& __x)
+ { return emplace(__position, std::move(__x)); }
+
+ /**
+ * @brief Inserts an initializer list into the %deque.
+ * @param p An iterator into the %deque.
+ * @param l An initializer_list.
+ *
+ * This function will insert copies of the data in the
+ * initializer_list @a l into the %deque before the location
+ * specified by @a p. This is known as "list insert."
+ */
+ void
+ insert(iterator __p, initializer_list<value_type> __l)
+ { this->insert(__p, __l.begin(), __l.end()); }
+#endif
+
+ /**
+ * @brief Inserts a number of copies of given data into the %deque.
+ * @param position An iterator into the %deque.
+ * @param n Number of elements to be inserted.
+ * @param x Data to be inserted.
+ *
+ * This function will insert a specified number of copies of the given
+ * data before the location specified by @a position.
+ */
+ void
+ insert(iterator __position, size_type __n, const value_type& __x)
+ { _M_fill_insert(__position, __n, __x); }
+
+ /**
+ * @brief Inserts a range into the %deque.
+ * @param position An iterator into the %deque.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * This function will insert copies of the data in the range
+ * [first,last) into the %deque before the location specified
+ * by @a pos. This is known as "range insert."
+ */
+ template<typename _InputIterator>
+ void
+ insert(iterator __position, _InputIterator __first,
+ _InputIterator __last)
+ {
+ // Check whether it's an integral type. If so, it's not an iterator.
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_insert_dispatch(__position, __first, __last, _Integral());
+ }
+
+ /**
+ * @brief Remove element at given position.
+ * @param position Iterator pointing to element to be erased.
+ * @return An iterator pointing to the next element (or end()).
+ *
+ * This function will erase the element at the given position and thus
+ * shorten the %deque by one.
+ *
+ * The user is cautioned that
+ * this function only erases the element, and that if the element is
+ * itself a pointer, the pointed-to memory is not touched in any way.
+ * Managing the pointer is the user's responsibility.
+ */
+ iterator
+ erase(iterator __position);
+
+ /**
+ * @brief Remove a range of elements.
+ * @param first Iterator pointing to the first element to be erased.
+ * @param last Iterator pointing to one past the last element to be
+ * erased.
+ * @return An iterator pointing to the element pointed to by @a last
+ * prior to erasing (or end()).
+ *
+ * This function will erase the elements in the range [first,last) and
+ * shorten the %deque accordingly.
+ *
+ * The user is cautioned that
+ * this function only erases the elements, and that if the elements
+ * themselves are pointers, the pointed-to memory is not touched in any
+ * way. Managing the pointer is the user's responsibility.
+ */
+ iterator
+ erase(iterator __first, iterator __last);
+
+ /**
+ * @brief Swaps data with another %deque.
+ * @param x A %deque of the same element and allocator types.
+ *
+ * This exchanges the elements between two deques in constant time.
+ * (Four pointers, so it should be quite fast.)
+ * Note that the global std::swap() function is specialized such that
+ * std::swap(d1,d2) will feed to this function.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(deque&& __x)
+#else
+ swap(deque& __x)
+#endif
+ {
+ std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
+ std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
+ std::swap(this->_M_impl._M_map, __x._M_impl._M_map);
+ std::swap(this->_M_impl._M_map_size, __x._M_impl._M_map_size);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 431. Swapping containers with unequal allocators.
+ std::__alloc_swap<_Tp_alloc_type>::_S_do_it(_M_get_Tp_allocator(),
+ __x._M_get_Tp_allocator());
+ }
+
+ /**
+ * Erases all the elements. Note that this function only erases the
+ * elements, and that if the elements themselves are pointers, the
+ * pointed-to memory is not touched in any way. Managing the pointer is
+ * the user's responsibility.
+ */
+ void
+ clear()
+ { _M_erase_at_end(begin()); }
+
+ protected:
+ // Internal constructor functions follow.
+
+ // called by the range constructor to implement [23.1.1]/9
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
+ {
+ _M_initialize_map(static_cast<size_type>(__n));
+ _M_fill_initialize(__x);
+ }
+
+ // called by the range constructor to implement [23.1.1]/9
+ template<typename _InputIterator>
+ void
+ _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::
+ iterator_category _IterCategory;
+ _M_range_initialize(__first, __last, _IterCategory());
+ }
+
+ // called by the second initialize_dispatch above
+ //@{
+ /**
+ * @brief Fills the deque with whatever is in [first,last).
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @return Nothing.
+ *
+ * If the iterators are actually forward iterators (or better), then the
+ * memory layout can be done all at once. Else we move forward using
+ * push_back on each value from the iterator.
+ */
+ template<typename _InputIterator>
+ void
+ _M_range_initialize(_InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag);
+
+ // called by the second initialize_dispatch above
+ template<typename _ForwardIterator>
+ void
+ _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag);
+ //@}
+
+ /**
+ * @brief Fills the %deque with copies of value.
+ * @param value Initial value.
+ * @return Nothing.
+ * @pre _M_start and _M_finish have already been initialized,
+ * but none of the %deque's elements have yet been constructed.
+ *
+ * This function is called only when the user provides an explicit size
+ * (with or without an explicit exemplar value).
+ */
+ void
+ _M_fill_initialize(const value_type& __value);
+
+ // Internal assign functions follow. The *_aux functions do the actual
+ // assignment work for the range versions.
+
+ // called by the range assign to implement [23.1.1]/9
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
+ { _M_fill_assign(__n, __val); }
+
+ // called by the range assign to implement [23.1.1]/9
+ template<typename _InputIterator>
+ void
+ _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::
+ iterator_category _IterCategory;
+ _M_assign_aux(__first, __last, _IterCategory());
+ }
+
+ // called by the second assign_dispatch above
+ template<typename _InputIterator>
+ void
+ _M_assign_aux(_InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag);
+
+ // called by the second assign_dispatch above
+ template<typename _ForwardIterator>
+ void
+ _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag)
+ {
+ const size_type __len = std::distance(__first, __last);
+ if (__len > size())
+ {
+ _ForwardIterator __mid = __first;
+ std::advance(__mid, size());
+ std::copy(__first, __mid, begin());
+ insert(end(), __mid, __last);
+ }
+ else
+ _M_erase_at_end(std::copy(__first, __last, begin()));
+ }
+
+ // Called by assign(n,t), and the range assign when it turns out
+ // to be the same thing.
+ void
+ _M_fill_assign(size_type __n, const value_type& __val)
+ {
+ if (__n > size())
+ {
+ std::fill(begin(), end(), __val);
+ insert(end(), __n - size(), __val);
+ }
+ else
+ {
+ _M_erase_at_end(begin() + difference_type(__n));
+ std::fill(begin(), end(), __val);
+ }
+ }
+
+ //@{
+ /// Helper functions for push_* and pop_*.
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ void _M_push_back_aux(const value_type&);
+
+ void _M_push_front_aux(const value_type&);
+#else
+ template<typename... _Args>
+ void _M_push_back_aux(_Args&&... __args);
+
+ template<typename... _Args>
+ void _M_push_front_aux(_Args&&... __args);
+#endif
+
+ void _M_pop_back_aux();
+
+ void _M_pop_front_aux();
+ //@}
+
+ // Internal insert functions follow. The *_aux functions do the actual
+ // insertion work when all shortcuts fail.
+
+ // called by the range insert to implement [23.1.1]/9
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_insert_dispatch(iterator __pos,
+ _Integer __n, _Integer __x, __true_type)
+ { _M_fill_insert(__pos, __n, __x); }
+
+ // called by the range insert to implement [23.1.1]/9
+ template<typename _InputIterator>
+ void
+ _M_insert_dispatch(iterator __pos,
+ _InputIterator __first, _InputIterator __last,
+ __false_type)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::
+ iterator_category _IterCategory;
+ _M_range_insert_aux(__pos, __first, __last, _IterCategory());
+ }
+
+ // called by the second insert_dispatch above
+ template<typename _InputIterator>
+ void
+ _M_range_insert_aux(iterator __pos, _InputIterator __first,
+ _InputIterator __last, std::input_iterator_tag);
+
+ // called by the second insert_dispatch above
+ template<typename _ForwardIterator>
+ void
+ _M_range_insert_aux(iterator __pos, _ForwardIterator __first,
+ _ForwardIterator __last, std::forward_iterator_tag);
+
+ // Called by insert(p,n,x), and the range insert when it turns out to be
+ // the same thing. Can use fill functions in optimal situations,
+ // otherwise passes off to insert_aux(p,n,x).
+ void
+ _M_fill_insert(iterator __pos, size_type __n, const value_type& __x);
+
+ // called by insert(p,x)
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ iterator
+ _M_insert_aux(iterator __pos, const value_type& __x);
+#else
+ template<typename... _Args>
+ iterator
+ _M_insert_aux(iterator __pos, _Args&&... __args);
+#endif
+
+ // called by insert(p,n,x) via fill_insert
+ void
+ _M_insert_aux(iterator __pos, size_type __n, const value_type& __x);
+
+ // called by range_insert_aux for forward iterators
+ template<typename _ForwardIterator>
+ void
+ _M_insert_aux(iterator __pos,
+ _ForwardIterator __first, _ForwardIterator __last,
+ size_type __n);
+
+
+ // Internal erase functions follow.
+
+ void
+ _M_destroy_data_aux(iterator __first, iterator __last);
+
+ // Called by ~deque().
+ // NB: Doesn't deallocate the nodes.
+ template<typename _Alloc1>
+ void
+ _M_destroy_data(iterator __first, iterator __last, const _Alloc1&)
+ { _M_destroy_data_aux(__first, __last); }
+
+ void
+ _M_destroy_data(iterator __first, iterator __last,
+ const std::allocator<_Tp>&)
+ {
+ if (!__has_trivial_destructor(value_type))
+ _M_destroy_data_aux(__first, __last);
+ }
+
+ // Called by erase(q1, q2).
+ void
+ _M_erase_at_begin(iterator __pos)
+ {
+ _M_destroy_data(begin(), __pos, _M_get_Tp_allocator());
+ _M_destroy_nodes(this->_M_impl._M_start._M_node, __pos._M_node);
+ this->_M_impl._M_start = __pos;
+ }
+
+ // Called by erase(q1, q2), resize(), clear(), _M_assign_aux,
+ // _M_fill_assign, operator=.
+ void
+ _M_erase_at_end(iterator __pos)
+ {
+ _M_destroy_data(__pos, end(), _M_get_Tp_allocator());
+ _M_destroy_nodes(__pos._M_node + 1,
+ this->_M_impl._M_finish._M_node + 1);
+ this->_M_impl._M_finish = __pos;
+ }
+
+ //@{
+ /// Memory-handling helpers for the previous internal insert functions.
+ iterator
+ _M_reserve_elements_at_front(size_type __n)
+ {
+ const size_type __vacancies = this->_M_impl._M_start._M_cur
+ - this->_M_impl._M_start._M_first;
+ if (__n > __vacancies)
+ _M_new_elements_at_front(__n - __vacancies);
+ return this->_M_impl._M_start - difference_type(__n);
+ }
+
+ iterator
+ _M_reserve_elements_at_back(size_type __n)
+ {
+ const size_type __vacancies = (this->_M_impl._M_finish._M_last
+ - this->_M_impl._M_finish._M_cur) - 1;
+ if (__n > __vacancies)
+ _M_new_elements_at_back(__n - __vacancies);
+ return this->_M_impl._M_finish + difference_type(__n);
+ }
+
+ void
+ _M_new_elements_at_front(size_type __new_elements);
+
+ void
+ _M_new_elements_at_back(size_type __new_elements);
+ //@}
+
+
+ //@{
+ /**
+ * @brief Memory-handling helpers for the major %map.
+ *
+ * Makes sure the _M_map has space for new nodes. Does not
+ * actually add the nodes. Can invalidate _M_map pointers.
+ * (And consequently, %deque iterators.)
+ */
+ void
+ _M_reserve_map_at_back(size_type __nodes_to_add = 1)
+ {
+ if (__nodes_to_add + 1 > this->_M_impl._M_map_size
+ - (this->_M_impl._M_finish._M_node - this->_M_impl._M_map))
+ _M_reallocate_map(__nodes_to_add, false);
+ }
+
+ void
+ _M_reserve_map_at_front(size_type __nodes_to_add = 1)
+ {
+ if (__nodes_to_add > size_type(this->_M_impl._M_start._M_node
+ - this->_M_impl._M_map))
+ _M_reallocate_map(__nodes_to_add, true);
+ }
+
+ void
+ _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front);
+ //@}
+ };
+
+
+ /**
+ * @brief Deque equality comparison.
+ * @param x A %deque.
+ * @param y A %deque of the same type as @a x.
+ * @return True iff the size and elements of the deques are equal.
+ *
+ * This is an equivalence relation. It is linear in the size of the
+ * deques. Deques are considered equivalent if their sizes are equal,
+ * and if corresponding elements compare equal.
+ */
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator==(const deque<_Tp, _Alloc>& __x,
+ const deque<_Tp, _Alloc>& __y)
+ { return __x.size() == __y.size()
+ && std::equal(__x.begin(), __x.end(), __y.begin()); }
+
+ /**
+ * @brief Deque ordering relation.
+ * @param x A %deque.
+ * @param y A %deque of the same type as @a x.
+ * @return True iff @a x is lexicographically less than @a y.
+ *
+ * This is a total ordering relation. It is linear in the size of the
+ * deques. The elements must be comparable with @c <.
+ *
+ * See std::lexicographical_compare() for how the determination is made.
+ */
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<(const deque<_Tp, _Alloc>& __x,
+ const deque<_Tp, _Alloc>& __y)
+ { return std::lexicographical_compare(__x.begin(), __x.end(),
+ __y.begin(), __y.end()); }
+
+ /// Based on operator==
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator!=(const deque<_Tp, _Alloc>& __x,
+ const deque<_Tp, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>(const deque<_Tp, _Alloc>& __x,
+ const deque<_Tp, _Alloc>& __y)
+ { return __y < __x; }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<=(const deque<_Tp, _Alloc>& __x,
+ const deque<_Tp, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>=(const deque<_Tp, _Alloc>& __x,
+ const deque<_Tp, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ /// See std::deque::swap().
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(deque<_Tp,_Alloc>& __x, deque<_Tp,_Alloc>& __y)
+ { __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(deque<_Tp,_Alloc>&& __x, deque<_Tp,_Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(deque<_Tp,_Alloc>& __x, deque<_Tp,_Alloc>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _STL_DEQUE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_function.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_function.h
new file mode 100644
index 0000000..b2569d5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_function.h
@@ -0,0 +1,715 @@
+// Functor implementations -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_function.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_FUNCTION_H
+#define _STL_FUNCTION_H 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 20.3.1 base classes
+ /** @defgroup functors Function Objects
+ * @ingroup utilities
+ *
+ * Function objects, or @e functors, are objects with an @c operator()
+ * defined and accessible. They can be passed as arguments to algorithm
+ * templates and used in place of a function pointer. Not only is the
+ * resulting expressiveness of the library increased, but the generated
+ * code can be more efficient than what you might write by hand. When we
+ * refer to "functors," then, generally we include function pointers in
+ * the description as well.
+ *
+ * Often, functors are only created as temporaries passed to algorithm
+ * calls, rather than being created as named variables.
+ *
+ * Two examples taken from the standard itself follow. To perform a
+ * by-element addition of two vectors @c a and @c b containing @c double,
+ * and put the result in @c a, use
+ * \code
+ * transform (a.begin(), a.end(), b.begin(), a.begin(), plus<double>());
+ * \endcode
+ * To negate every element in @c a, use
+ * \code
+ * transform(a.begin(), a.end(), a.begin(), negate<double>());
+ * \endcode
+ * The addition and negation functions will be inlined directly.
+ *
+ * The standard functors are derived from structs named @c unary_function
+ * and @c binary_function. These two classes contain nothing but typedefs,
+ * to aid in generic (template) programming. If you write your own
+ * functors, you might consider doing the same.
+ *
+ * @{
+ */
+ /**
+ * This is one of the @link functors functor base classes@endlink.
+ */
+ template<typename _Arg, typename _Result>
+ struct unary_function
+ {
+ typedef _Arg argument_type; ///< @c argument_type is the type of the
+ /// argument (no surprises here)
+
+ typedef _Result result_type; ///< @c result_type is the return type
+ };
+
+ /**
+ * This is one of the @link functors functor base classes@endlink.
+ */
+ template<typename _Arg1, typename _Arg2, typename _Result>
+ struct binary_function
+ {
+ typedef _Arg1 first_argument_type; ///< the type of the first argument
+ /// (no surprises here)
+
+ typedef _Arg2 second_argument_type; ///< the type of the second argument
+ typedef _Result result_type; ///< type of the return type
+ };
+ /** @} */
+
+ // 20.3.2 arithmetic
+ /** @defgroup arithmetic_functors Arithmetic Classes
+ * @ingroup functors
+ *
+ * Because basic math often needs to be done during an algorithm,
+ * the library provides functors for those operations. See the
+ * documentation for @link functors the base classes@endlink
+ * for examples of their use.
+ *
+ * @{
+ */
+ /// One of the @link arithmetic_functors math functors@endlink.
+ template<typename _Tp>
+ struct plus : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x + __y; }
+ };
+
+ /// One of the @link arithmetic_functors math functors@endlink.
+ template<typename _Tp>
+ struct minus : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x - __y; }
+ };
+
+ /// One of the @link arithmetic_functors math functors@endlink.
+ template<typename _Tp>
+ struct multiplies : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x * __y; }
+ };
+
+ /// One of the @link arithmetic_functors math functors@endlink.
+ template<typename _Tp>
+ struct divides : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x / __y; }
+ };
+
+ /// One of the @link arithmetic_functors math functors@endlink.
+ template<typename _Tp>
+ struct modulus : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x % __y; }
+ };
+
+ /// One of the @link arithmetic_functors math functors@endlink.
+ template<typename _Tp>
+ struct negate : public unary_function<_Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x) const
+ { return -__x; }
+ };
+ /** @} */
+
+ // 20.3.3 comparisons
+ /** @defgroup comparison_functors Comparison Classes
+ * @ingroup functors
+ *
+ * The library provides six wrapper functors for all the basic comparisons
+ * in C++, like @c <.
+ *
+ * @{
+ */
+ /// One of the @link comparison_functors comparison functors@endlink.
+ template<typename _Tp>
+ struct equal_to : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x == __y; }
+ };
+
+ /// One of the @link comparison_functors comparison functors@endlink.
+ template<typename _Tp>
+ struct not_equal_to : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x != __y; }
+ };
+
+ /// One of the @link comparison_functors comparison functors@endlink.
+ template<typename _Tp>
+ struct greater : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x > __y; }
+ };
+
+ /// One of the @link comparison_functors comparison functors@endlink.
+ template<typename _Tp>
+ struct less : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x < __y; }
+ };
+
+ /// One of the @link comparison_functors comparison functors@endlink.
+ template<typename _Tp>
+ struct greater_equal : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x >= __y; }
+ };
+
+ /// One of the @link comparison_functors comparison functors@endlink.
+ template<typename _Tp>
+ struct less_equal : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x <= __y; }
+ };
+ /** @} */
+
+ // 20.3.4 logical operations
+ /** @defgroup logical_functors Boolean Operations Classes
+ * @ingroup functors
+ *
+ * Here are wrapper functors for Boolean operations: @c &&, @c ||,
+ * and @c !.
+ *
+ * @{
+ */
+ /// One of the @link logical_functors Boolean operations functors@endlink.
+ template<typename _Tp>
+ struct logical_and : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x && __y; }
+ };
+
+ /// One of the @link logical_functors Boolean operations functors@endlink.
+ template<typename _Tp>
+ struct logical_or : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x || __y; }
+ };
+
+ /// One of the @link logical_functors Boolean operations functors@endlink.
+ template<typename _Tp>
+ struct logical_not : public unary_function<_Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x) const
+ { return !__x; }
+ };
+ /** @} */
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 660. Missing Bitwise Operations.
+ template<typename _Tp>
+ struct bit_and : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x & __y; }
+ };
+
+ template<typename _Tp>
+ struct bit_or : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x | __y; }
+ };
+
+ template<typename _Tp>
+ struct bit_xor : public binary_function<_Tp, _Tp, _Tp>
+ {
+ _Tp
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x ^ __y; }
+ };
+
+ // 20.3.5 negators
+ /** @defgroup negators Negators
+ * @ingroup functors
+ *
+ * The functions @c not1 and @c not2 each take a predicate functor
+ * and return an instance of @c unary_negate or
+ * @c binary_negate, respectively. These classes are functors whose
+ * @c operator() performs the stored predicate function and then returns
+ * the negation of the result.
+ *
+ * For example, given a vector of integers and a trivial predicate,
+ * \code
+ * struct IntGreaterThanThree
+ * : public std::unary_function<int, bool>
+ * {
+ * bool operator() (int x) { return x > 3; }
+ * };
+ *
+ * std::find_if (v.begin(), v.end(), not1(IntGreaterThanThree()));
+ * \endcode
+ * The call to @c find_if will locate the first index (i) of @c v for which
+ * "!(v[i] > 3)" is true.
+ *
+ * The not1/unary_negate combination works on predicates taking a single
+ * argument. The not2/binary_negate combination works on predicates which
+ * take two arguments.
+ *
+ * @{
+ */
+ /// One of the @link negators negation functors@endlink.
+ template<typename _Predicate>
+ class unary_negate
+ : public unary_function<typename _Predicate::argument_type, bool>
+ {
+ protected:
+ _Predicate _M_pred;
+
+ public:
+ explicit
+ unary_negate(const _Predicate& __x) : _M_pred(__x) { }
+
+ bool
+ operator()(const typename _Predicate::argument_type& __x) const
+ { return !_M_pred(__x); }
+ };
+
+ /// One of the @link negators negation functors@endlink.
+ template<typename _Predicate>
+ inline unary_negate<_Predicate>
+ not1(const _Predicate& __pred)
+ { return unary_negate<_Predicate>(__pred); }
+
+ /// One of the @link negators negation functors@endlink.
+ template<typename _Predicate>
+ class binary_negate
+ : public binary_function<typename _Predicate::first_argument_type,
+ typename _Predicate::second_argument_type, bool>
+ {
+ protected:
+ _Predicate _M_pred;
+
+ public:
+ explicit
+ binary_negate(const _Predicate& __x) : _M_pred(__x) { }
+
+ bool
+ operator()(const typename _Predicate::first_argument_type& __x,
+ const typename _Predicate::second_argument_type& __y) const
+ { return !_M_pred(__x, __y); }
+ };
+
+ /// One of the @link negators negation functors@endlink.
+ template<typename _Predicate>
+ inline binary_negate<_Predicate>
+ not2(const _Predicate& __pred)
+ { return binary_negate<_Predicate>(__pred); }
+ /** @} */
+
+ // 20.3.7 adaptors pointers functions
+ /** @defgroup pointer_adaptors Adaptors for pointers to functions
+ * @ingroup functors
+ *
+ * The advantage of function objects over pointers to functions is that
+ * the objects in the standard library declare nested typedefs describing
+ * their argument and result types with uniform names (e.g., @c result_type
+ * from the base classes @c unary_function and @c binary_function).
+ * Sometimes those typedefs are required, not just optional.
+ *
+ * Adaptors are provided to turn pointers to unary (single-argument) and
+ * binary (double-argument) functions into function objects. The
+ * long-winded functor @c pointer_to_unary_function is constructed with a
+ * function pointer @c f, and its @c operator() called with argument @c x
+ * returns @c f(x). The functor @c pointer_to_binary_function does the same
+ * thing, but with a double-argument @c f and @c operator().
+ *
+ * The function @c ptr_fun takes a pointer-to-function @c f and constructs
+ * an instance of the appropriate functor.
+ *
+ * @{
+ */
+ /// One of the @link pointer_adaptors adaptors for function pointers@endlink.
+ template<typename _Arg, typename _Result>
+ class pointer_to_unary_function : public unary_function<_Arg, _Result>
+ {
+ protected:
+ _Result (*_M_ptr)(_Arg);
+
+ public:
+ pointer_to_unary_function() { }
+
+ explicit
+ pointer_to_unary_function(_Result (*__x)(_Arg))
+ : _M_ptr(__x) { }
+
+ _Result
+ operator()(_Arg __x) const
+ { return _M_ptr(__x); }
+ };
+
+ /// One of the @link pointer_adaptors adaptors for function pointers@endlink.
+ template<typename _Arg, typename _Result>
+ inline pointer_to_unary_function<_Arg, _Result>
+ ptr_fun(_Result (*__x)(_Arg))
+ { return pointer_to_unary_function<_Arg, _Result>(__x); }
+
+ /// One of the @link pointer_adaptors adaptors for function pointers@endlink.
+ template<typename _Arg1, typename _Arg2, typename _Result>
+ class pointer_to_binary_function
+ : public binary_function<_Arg1, _Arg2, _Result>
+ {
+ protected:
+ _Result (*_M_ptr)(_Arg1, _Arg2);
+
+ public:
+ pointer_to_binary_function() { }
+
+ explicit
+ pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2))
+ : _M_ptr(__x) { }
+
+ _Result
+ operator()(_Arg1 __x, _Arg2 __y) const
+ { return _M_ptr(__x, __y); }
+ };
+
+ /// One of the @link pointer_adaptors adaptors for function pointers@endlink.
+ template<typename _Arg1, typename _Arg2, typename _Result>
+ inline pointer_to_binary_function<_Arg1, _Arg2, _Result>
+ ptr_fun(_Result (*__x)(_Arg1, _Arg2))
+ { return pointer_to_binary_function<_Arg1, _Arg2, _Result>(__x); }
+ /** @} */
+
+ template<typename _Tp>
+ struct _Identity : public unary_function<_Tp,_Tp>
+ {
+ _Tp&
+ operator()(_Tp& __x) const
+ { return __x; }
+
+ const _Tp&
+ operator()(const _Tp& __x) const
+ { return __x; }
+ };
+
+ template<typename _Pair>
+ struct _Select1st : public unary_function<_Pair,
+ typename _Pair::first_type>
+ {
+ typename _Pair::first_type&
+ operator()(_Pair& __x) const
+ { return __x.first; }
+
+ const typename _Pair::first_type&
+ operator()(const _Pair& __x) const
+ { return __x.first; }
+ };
+
+ template<typename _Pair>
+ struct _Select2nd : public unary_function<_Pair,
+ typename _Pair::second_type>
+ {
+ typename _Pair::second_type&
+ operator()(_Pair& __x) const
+ { return __x.second; }
+
+ const typename _Pair::second_type&
+ operator()(const _Pair& __x) const
+ { return __x.second; }
+ };
+
+ // 20.3.8 adaptors pointers members
+ /** @defgroup memory_adaptors Adaptors for pointers to members
+ * @ingroup functors
+ *
+ * There are a total of 8 = 2^3 function objects in this family.
+ * (1) Member functions taking no arguments vs member functions taking
+ * one argument.
+ * (2) Call through pointer vs call through reference.
+ * (3) Const vs non-const member function.
+ *
+ * All of this complexity is in the function objects themselves. You can
+ * ignore it by using the helper function mem_fun and mem_fun_ref,
+ * which create whichever type of adaptor is appropriate.
+ *
+ * @{
+ */
+ /// One of the @link memory_adaptors adaptors for member
+ /// pointers@endlink.
+ template<typename _Ret, typename _Tp>
+ class mem_fun_t : public unary_function<_Tp*, _Ret>
+ {
+ public:
+ explicit
+ mem_fun_t(_Ret (_Tp::*__pf)())
+ : _M_f(__pf) { }
+
+ _Ret
+ operator()(_Tp* __p) const
+ { return (__p->*_M_f)(); }
+
+ private:
+ _Ret (_Tp::*_M_f)();
+ };
+
+ /// One of the @link memory_adaptors adaptors for member
+ /// pointers@endlink.
+ template<typename _Ret, typename _Tp>
+ class const_mem_fun_t : public unary_function<const _Tp*, _Ret>
+ {
+ public:
+ explicit
+ const_mem_fun_t(_Ret (_Tp::*__pf)() const)
+ : _M_f(__pf) { }
+
+ _Ret
+ operator()(const _Tp* __p) const
+ { return (__p->*_M_f)(); }
+
+ private:
+ _Ret (_Tp::*_M_f)() const;
+ };
+
+ /// One of the @link memory_adaptors adaptors for member
+ /// pointers@endlink.
+ template<typename _Ret, typename _Tp>
+ class mem_fun_ref_t : public unary_function<_Tp, _Ret>
+ {
+ public:
+ explicit
+ mem_fun_ref_t(_Ret (_Tp::*__pf)())
+ : _M_f(__pf) { }
+
+ _Ret
+ operator()(_Tp& __r) const
+ { return (__r.*_M_f)(); }
+
+ private:
+ _Ret (_Tp::*_M_f)();
+ };
+
+ /// One of the @link memory_adaptors adaptors for member
+ /// pointers@endlink.
+ template<typename _Ret, typename _Tp>
+ class const_mem_fun_ref_t : public unary_function<_Tp, _Ret>
+ {
+ public:
+ explicit
+ const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const)
+ : _M_f(__pf) { }
+
+ _Ret
+ operator()(const _Tp& __r) const
+ { return (__r.*_M_f)(); }
+
+ private:
+ _Ret (_Tp::*_M_f)() const;
+ };
+
+ /// One of the @link memory_adaptors adaptors for member
+ /// pointers@endlink.
+ template<typename _Ret, typename _Tp, typename _Arg>
+ class mem_fun1_t : public binary_function<_Tp*, _Arg, _Ret>
+ {
+ public:
+ explicit
+ mem_fun1_t(_Ret (_Tp::*__pf)(_Arg))
+ : _M_f(__pf) { }
+
+ _Ret
+ operator()(_Tp* __p, _Arg __x) const
+ { return (__p->*_M_f)(__x); }
+
+ private:
+ _Ret (_Tp::*_M_f)(_Arg);
+ };
+
+ /// One of the @link memory_adaptors adaptors for member
+ /// pointers@endlink.
+ template<typename _Ret, typename _Tp, typename _Arg>
+ class const_mem_fun1_t : public binary_function<const _Tp*, _Arg, _Ret>
+ {
+ public:
+ explicit
+ const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const)
+ : _M_f(__pf) { }
+
+ _Ret
+ operator()(const _Tp* __p, _Arg __x) const
+ { return (__p->*_M_f)(__x); }
+
+ private:
+ _Ret (_Tp::*_M_f)(_Arg) const;
+ };
+
+ /// One of the @link memory_adaptors adaptors for member
+ /// pointers@endlink.
+ template<typename _Ret, typename _Tp, typename _Arg>
+ class mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
+ {
+ public:
+ explicit
+ mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg))
+ : _M_f(__pf) { }
+
+ _Ret
+ operator()(_Tp& __r, _Arg __x) const
+ { return (__r.*_M_f)(__x); }
+
+ private:
+ _Ret (_Tp::*_M_f)(_Arg);
+ };
+
+ /// One of the @link memory_adaptors adaptors for member
+ /// pointers@endlink.
+ template<typename _Ret, typename _Tp, typename _Arg>
+ class const_mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
+ {
+ public:
+ explicit
+ const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const)
+ : _M_f(__pf) { }
+
+ _Ret
+ operator()(const _Tp& __r, _Arg __x) const
+ { return (__r.*_M_f)(__x); }
+
+ private:
+ _Ret (_Tp::*_M_f)(_Arg) const;
+ };
+
+ // Mem_fun adaptor helper functions. There are only two:
+ // mem_fun and mem_fun_ref.
+ template<typename _Ret, typename _Tp>
+ inline mem_fun_t<_Ret, _Tp>
+ mem_fun(_Ret (_Tp::*__f)())
+ { return mem_fun_t<_Ret, _Tp>(__f); }
+
+ template<typename _Ret, typename _Tp>
+ inline const_mem_fun_t<_Ret, _Tp>
+ mem_fun(_Ret (_Tp::*__f)() const)
+ { return const_mem_fun_t<_Ret, _Tp>(__f); }
+
+ template<typename _Ret, typename _Tp>
+ inline mem_fun_ref_t<_Ret, _Tp>
+ mem_fun_ref(_Ret (_Tp::*__f)())
+ { return mem_fun_ref_t<_Ret, _Tp>(__f); }
+
+ template<typename _Ret, typename _Tp>
+ inline const_mem_fun_ref_t<_Ret, _Tp>
+ mem_fun_ref(_Ret (_Tp::*__f)() const)
+ { return const_mem_fun_ref_t<_Ret, _Tp>(__f); }
+
+ template<typename _Ret, typename _Tp, typename _Arg>
+ inline mem_fun1_t<_Ret, _Tp, _Arg>
+ mem_fun(_Ret (_Tp::*__f)(_Arg))
+ { return mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
+
+ template<typename _Ret, typename _Tp, typename _Arg>
+ inline const_mem_fun1_t<_Ret, _Tp, _Arg>
+ mem_fun(_Ret (_Tp::*__f)(_Arg) const)
+ { return const_mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
+
+ template<typename _Ret, typename _Tp, typename _Arg>
+ inline mem_fun1_ref_t<_Ret, _Tp, _Arg>
+ mem_fun_ref(_Ret (_Tp::*__f)(_Arg))
+ { return mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
+
+ template<typename _Ret, typename _Tp, typename _Arg>
+ inline const_mem_fun1_ref_t<_Ret, _Tp, _Arg>
+ mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const)
+ { return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
+
+ /** @} */
+
+_GLIBCXX_END_NAMESPACE
+
+#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || _GLIBCXX_DEPRECATED
+# include <backward/binders.h>
+#endif
+
+#endif /* _STL_FUNCTION_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_heap.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_heap.h
new file mode 100644
index 0000000..9348fe9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_heap.h
@@ -0,0 +1,578 @@
+// Heap implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * Copyright (c) 1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_heap.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_HEAP_H
+#define _STL_HEAP_H 1
+
+#include <debug/debug.h>
+#include <bits/move.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @defgroup heap_algorithms Heap Algorithms
+ * @ingroup sorting_algorithms
+ */
+
+ template<typename _RandomAccessIterator, typename _Distance>
+ _Distance
+ __is_heap_until(_RandomAccessIterator __first, _Distance __n)
+ {
+ _Distance __parent = 0;
+ for (_Distance __child = 1; __child < __n; ++__child)
+ {
+ if (__first[__parent] < __first[__child])
+ return __child;
+ if ((__child & 1) == 0)
+ ++__parent;
+ }
+ return __n;
+ }
+
+ template<typename _RandomAccessIterator, typename _Distance,
+ typename _Compare>
+ _Distance
+ __is_heap_until(_RandomAccessIterator __first, _Distance __n,
+ _Compare __comp)
+ {
+ _Distance __parent = 0;
+ for (_Distance __child = 1; __child < __n; ++__child)
+ {
+ if (__comp(__first[__parent], __first[__child]))
+ return __child;
+ if ((__child & 1) == 0)
+ ++__parent;
+ }
+ return __n;
+ }
+
+ // __is_heap, a predicate testing whether or not a range is a heap.
+ // This function is an extension, not part of the C++ standard.
+ template<typename _RandomAccessIterator, typename _Distance>
+ inline bool
+ __is_heap(_RandomAccessIterator __first, _Distance __n)
+ { return std::__is_heap_until(__first, __n) == __n; }
+
+ template<typename _RandomAccessIterator, typename _Compare,
+ typename _Distance>
+ inline bool
+ __is_heap(_RandomAccessIterator __first, _Compare __comp, _Distance __n)
+ { return std::__is_heap_until(__first, __n, __comp) == __n; }
+
+ template<typename _RandomAccessIterator>
+ inline bool
+ __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ { return std::__is_heap(__first, std::distance(__first, __last)); }
+
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline bool
+ __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Compare __comp)
+ { return std::__is_heap(__first, __comp, std::distance(__first, __last)); }
+
+ // Heap-manipulation functions: push_heap, pop_heap, make_heap, sort_heap,
+ // + is_heap and is_heap_until in C++0x.
+
+ template<typename _RandomAccessIterator, typename _Distance, typename _Tp>
+ void
+ __push_heap(_RandomAccessIterator __first,
+ _Distance __holeIndex, _Distance __topIndex, _Tp __value)
+ {
+ _Distance __parent = (__holeIndex - 1) / 2;
+ while (__holeIndex > __topIndex && *(__first + __parent) < __value)
+ {
+ *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __parent));
+ __holeIndex = __parent;
+ __parent = (__holeIndex - 1) / 2;
+ }
+ *(__first + __holeIndex) = _GLIBCXX_MOVE(__value);
+ }
+
+ /**
+ * @brief Push an element onto a heap.
+ * @param first Start of heap.
+ * @param last End of heap + element.
+ * @ingroup heap_algorithms
+ *
+ * This operation pushes the element at last-1 onto the valid heap over the
+ * range [first,last-1). After completion, [first,last) is a valid heap.
+ */
+ template<typename _RandomAccessIterator>
+ inline void
+ push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_heap(__first, __last - 1);
+
+ _ValueType __value = _GLIBCXX_MOVE(*(__last - 1));
+ std::__push_heap(__first, _DistanceType((__last - __first) - 1),
+ _DistanceType(0), _GLIBCXX_MOVE(__value));
+ }
+
+ template<typename _RandomAccessIterator, typename _Distance, typename _Tp,
+ typename _Compare>
+ void
+ __push_heap(_RandomAccessIterator __first, _Distance __holeIndex,
+ _Distance __topIndex, _Tp __value, _Compare __comp)
+ {
+ _Distance __parent = (__holeIndex - 1) / 2;
+ while (__holeIndex > __topIndex
+ && __comp(*(__first + __parent), __value))
+ {
+ *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __parent));
+ __holeIndex = __parent;
+ __parent = (__holeIndex - 1) / 2;
+ }
+ *(__first + __holeIndex) = _GLIBCXX_MOVE(__value);
+ }
+
+ /**
+ * @brief Push an element onto a heap using comparison functor.
+ * @param first Start of heap.
+ * @param last End of heap + element.
+ * @param comp Comparison functor.
+ * @ingroup heap_algorithms
+ *
+ * This operation pushes the element at last-1 onto the valid heap over the
+ * range [first,last-1). After completion, [first,last) is a valid heap.
+ * Compare operations are performed using comp.
+ */
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline void
+ push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_heap_pred(__first, __last - 1, __comp);
+
+ _ValueType __value = _GLIBCXX_MOVE(*(__last - 1));
+ std::__push_heap(__first, _DistanceType((__last - __first) - 1),
+ _DistanceType(0), _GLIBCXX_MOVE(__value), __comp);
+ }
+
+ template<typename _RandomAccessIterator, typename _Distance, typename _Tp>
+ void
+ __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
+ _Distance __len, _Tp __value)
+ {
+ const _Distance __topIndex = __holeIndex;
+ _Distance __secondChild = __holeIndex;
+ while (__secondChild < (__len - 1) / 2)
+ {
+ __secondChild = 2 * (__secondChild + 1);
+ if (*(__first + __secondChild) < *(__first + (__secondChild - 1)))
+ __secondChild--;
+ *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild));
+ __holeIndex = __secondChild;
+ }
+ if ((__len & 1) == 0 && __secondChild == (__len - 2) / 2)
+ {
+ __secondChild = 2 * (__secondChild + 1);
+ *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first
+ + (__secondChild - 1)));
+ __holeIndex = __secondChild - 1;
+ }
+ std::__push_heap(__first, __holeIndex, __topIndex,
+ _GLIBCXX_MOVE(__value));
+ }
+
+ template<typename _RandomAccessIterator>
+ inline void
+ __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _RandomAccessIterator __result)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+ _ValueType __value = _GLIBCXX_MOVE(*__result);
+ *__result = _GLIBCXX_MOVE(*__first);
+ std::__adjust_heap(__first, _DistanceType(0),
+ _DistanceType(__last - __first),
+ _GLIBCXX_MOVE(__value));
+ }
+
+ /**
+ * @brief Pop an element off a heap.
+ * @param first Start of heap.
+ * @param last End of heap.
+ * @ingroup heap_algorithms
+ *
+ * This operation pops the top of the heap. The elements first and last-1
+ * are swapped and [first,last-1) is made into a heap.
+ */
+ template<typename _RandomAccessIterator>
+ inline void
+ pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_heap(__first, __last);
+
+ --__last;
+ std::__pop_heap(__first, __last, __last);
+ }
+
+ template<typename _RandomAccessIterator, typename _Distance,
+ typename _Tp, typename _Compare>
+ void
+ __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
+ _Distance __len, _Tp __value, _Compare __comp)
+ {
+ const _Distance __topIndex = __holeIndex;
+ _Distance __secondChild = __holeIndex;
+ while (__secondChild < (__len - 1) / 2)
+ {
+ __secondChild = 2 * (__secondChild + 1);
+ if (__comp(*(__first + __secondChild),
+ *(__first + (__secondChild - 1))))
+ __secondChild--;
+ *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild));
+ __holeIndex = __secondChild;
+ }
+ if ((__len & 1) == 0 && __secondChild == (__len - 2) / 2)
+ {
+ __secondChild = 2 * (__secondChild + 1);
+ *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first
+ + (__secondChild - 1)));
+ __holeIndex = __secondChild - 1;
+ }
+ std::__push_heap(__first, __holeIndex, __topIndex,
+ _GLIBCXX_MOVE(__value), __comp);
+ }
+
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline void
+ __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _RandomAccessIterator __result, _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+ _ValueType __value = _GLIBCXX_MOVE(*__result);
+ *__result = _GLIBCXX_MOVE(*__first);
+ std::__adjust_heap(__first, _DistanceType(0),
+ _DistanceType(__last - __first),
+ _GLIBCXX_MOVE(__value), __comp);
+ }
+
+ /**
+ * @brief Pop an element off a heap using comparison functor.
+ * @param first Start of heap.
+ * @param last End of heap.
+ * @param comp Comparison functor to use.
+ * @ingroup heap_algorithms
+ *
+ * This operation pops the top of the heap. The elements first and last-1
+ * are swapped and [first,last-1) is made into a heap. Comparisons are
+ * made using comp.
+ */
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline void
+ pop_heap(_RandomAccessIterator __first,
+ _RandomAccessIterator __last, _Compare __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_heap_pred(__first, __last, __comp);
+
+ --__last;
+ std::__pop_heap(__first, __last, __last, __comp);
+ }
+
+ /**
+ * @brief Construct a heap over a range.
+ * @param first Start of heap.
+ * @param last End of heap.
+ * @ingroup heap_algorithms
+ *
+ * This operation makes the elements in [first,last) into a heap.
+ */
+ template<typename _RandomAccessIterator>
+ void
+ make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__last - __first < 2)
+ return;
+
+ const _DistanceType __len = __last - __first;
+ _DistanceType __parent = (__len - 2) / 2;
+ while (true)
+ {
+ _ValueType __value = _GLIBCXX_MOVE(*(__first + __parent));
+ std::__adjust_heap(__first, __parent, __len, _GLIBCXX_MOVE(__value));
+ if (__parent == 0)
+ return;
+ __parent--;
+ }
+ }
+
+ /**
+ * @brief Construct a heap over a range using comparison functor.
+ * @param first Start of heap.
+ * @param last End of heap.
+ * @param comp Comparison functor to use.
+ * @ingroup heap_algorithms
+ *
+ * This operation makes the elements in [first,last) into a heap.
+ * Comparisons are made using comp.
+ */
+ template<typename _RandomAccessIterator, typename _Compare>
+ void
+ make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Compare __comp)
+ {
+ typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__last - __first < 2)
+ return;
+
+ const _DistanceType __len = __last - __first;
+ _DistanceType __parent = (__len - 2) / 2;
+ while (true)
+ {
+ _ValueType __value = _GLIBCXX_MOVE(*(__first + __parent));
+ std::__adjust_heap(__first, __parent, __len, _GLIBCXX_MOVE(__value),
+ __comp);
+ if (__parent == 0)
+ return;
+ __parent--;
+ }
+ }
+
+ /**
+ * @brief Sort a heap.
+ * @param first Start of heap.
+ * @param last End of heap.
+ * @ingroup heap_algorithms
+ *
+ * This operation sorts the valid heap in the range [first,last).
+ */
+ template<typename _RandomAccessIterator>
+ void
+ sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_RandomAccessIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_heap(__first, __last);
+
+ while (__last - __first > 1)
+ {
+ --__last;
+ std::__pop_heap(__first, __last, __last);
+ }
+ }
+
+ /**
+ * @brief Sort a heap using comparison functor.
+ * @param first Start of heap.
+ * @param last End of heap.
+ * @param comp Comparison functor to use.
+ * @ingroup heap_algorithms
+ *
+ * This operation sorts the valid heap in the range [first,last).
+ * Comparisons are made using comp.
+ */
+ template<typename _RandomAccessIterator, typename _Compare>
+ void
+ sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Compare __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_heap_pred(__first, __last, __comp);
+
+ while (__last - __first > 1)
+ {
+ --__last;
+ std::__pop_heap(__first, __last, __last, __comp);
+ }
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Search the end of a heap.
+ * @param first Start of range.
+ * @param last End of range.
+ * @return An iterator pointing to the first element not in the heap.
+ * @ingroup heap_algorithms
+ *
+ * This operation returns the last iterator i in [first, last) for which
+ * the range [first, i) is a heap.
+ */
+ template<typename _RandomAccessIterator>
+ inline _RandomAccessIterator
+ is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_RandomAccessIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ return __first + std::__is_heap_until(__first, std::distance(__first,
+ __last));
+ }
+
+ /**
+ * @brief Search the end of a heap using comparison functor.
+ * @param first Start of range.
+ * @param last End of range.
+ * @param comp Comparison functor to use.
+ * @return An iterator pointing to the first element not in the heap.
+ * @ingroup heap_algorithms
+ *
+ * This operation returns the last iterator i in [first, last) for which
+ * the range [first, i) is a heap. Comparisons are made using comp.
+ */
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline _RandomAccessIterator
+ is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Compare __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ return __first + std::__is_heap_until(__first, std::distance(__first,
+ __last),
+ __comp);
+ }
+
+ /**
+ * @brief Determines whether a range is a heap.
+ * @param first Start of range.
+ * @param last End of range.
+ * @return True if range is a heap, false otherwise.
+ * @ingroup heap_algorithms
+ */
+ template<typename _RandomAccessIterator>
+ inline bool
+ is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ { return std::is_heap_until(__first, __last) == __last; }
+
+ /**
+ * @brief Determines whether a range is a heap using comparison functor.
+ * @param first Start of range.
+ * @param last End of range.
+ * @param comp Comparison functor to use.
+ * @return True if range is a heap, false otherwise.
+ * @ingroup heap_algorithms
+ */
+ template<typename _RandomAccessIterator, typename _Compare>
+ inline bool
+ is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Compare __comp)
+ { return std::is_heap_until(__first, __last, __comp) == __last; }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_HEAP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_iterator.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_iterator.h
new file mode 100644
index 0000000..129552f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_iterator.h
@@ -0,0 +1,1041 @@
+// Iterators -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_iterator.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ *
+ * This file implements reverse_iterator, back_insert_iterator,
+ * front_insert_iterator, insert_iterator, __normal_iterator, and their
+ * supporting functions and overloaded operators.
+ */
+
+#ifndef _STL_ITERATOR_H
+#define _STL_ITERATOR_H 1
+
+#include <bits/cpp_type_traits.h>
+#include <ext/type_traits.h>
+#include <bits/move.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 24.4.1 Reverse iterators
+ /**
+ * "Bidirectional and random access iterators have corresponding reverse
+ * %iterator adaptors that iterate through the data structure in the
+ * opposite direction. They have the same signatures as the corresponding
+ * iterators. The fundamental relation between a reverse %iterator and its
+ * corresponding %iterator @c i is established by the identity:
+ * @code
+ * &*(reverse_iterator(i)) == &*(i - 1)
+ * @endcode
+ *
+ * This mapping is dictated by the fact that while there is always a
+ * pointer past the end of an array, there might not be a valid pointer
+ * before the beginning of an array." [24.4.1]/1,2
+ *
+ * Reverse iterators can be tricky and surprising at first. Their
+ * semantics make sense, however, and the trickiness is a side effect of
+ * the requirement that the iterators must be safe.
+ */
+ template<typename _Iterator>
+ class reverse_iterator
+ : public iterator<typename iterator_traits<_Iterator>::iterator_category,
+ typename iterator_traits<_Iterator>::value_type,
+ typename iterator_traits<_Iterator>::difference_type,
+ typename iterator_traits<_Iterator>::pointer,
+ typename iterator_traits<_Iterator>::reference>
+ {
+ protected:
+ _Iterator current;
+
+ public:
+ typedef _Iterator iterator_type;
+ typedef typename iterator_traits<_Iterator>::difference_type
+ difference_type;
+ typedef typename iterator_traits<_Iterator>::reference reference;
+ typedef typename iterator_traits<_Iterator>::pointer pointer;
+
+ public:
+ /**
+ * The default constructor default-initializes member @p current.
+ * If it is a pointer, that means it is zero-initialized.
+ */
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 235 No specification of default ctor for reverse_iterator
+ reverse_iterator() : current() { }
+
+ /**
+ * This %iterator will move in the opposite direction that @p x does.
+ */
+ explicit
+ reverse_iterator(iterator_type __x) : current(__x) { }
+
+ /**
+ * The copy constructor is normal.
+ */
+ reverse_iterator(const reverse_iterator& __x)
+ : current(__x.current) { }
+
+ /**
+ * A reverse_iterator across other types can be copied in the normal
+ * fashion.
+ */
+ template<typename _Iter>
+ reverse_iterator(const reverse_iterator<_Iter>& __x)
+ : current(__x.base()) { }
+
+ /**
+ * @return @c current, the %iterator used for underlying work.
+ */
+ iterator_type
+ base() const
+ { return current; }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ reference
+ operator*() const
+ {
+ _Iterator __tmp = current;
+ return *--__tmp;
+ }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ pointer
+ operator->() const
+ { return &(operator*()); }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ reverse_iterator&
+ operator++()
+ {
+ --current;
+ return *this;
+ }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ reverse_iterator
+ operator++(int)
+ {
+ reverse_iterator __tmp = *this;
+ --current;
+ return __tmp;
+ }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ reverse_iterator&
+ operator--()
+ {
+ ++current;
+ return *this;
+ }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ reverse_iterator
+ operator--(int)
+ {
+ reverse_iterator __tmp = *this;
+ ++current;
+ return __tmp;
+ }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ reverse_iterator
+ operator+(difference_type __n) const
+ { return reverse_iterator(current - __n); }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ reverse_iterator&
+ operator+=(difference_type __n)
+ {
+ current -= __n;
+ return *this;
+ }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ reverse_iterator
+ operator-(difference_type __n) const
+ { return reverse_iterator(current + __n); }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ reverse_iterator&
+ operator-=(difference_type __n)
+ {
+ current += __n;
+ return *this;
+ }
+
+ /**
+ * @return TODO
+ *
+ * @doctodo
+ */
+ reference
+ operator[](difference_type __n) const
+ { return *(*this + __n); }
+ };
+
+ //@{
+ /**
+ * @param x A %reverse_iterator.
+ * @param y A %reverse_iterator.
+ * @return A simple bool.
+ *
+ * Reverse iterators forward many operations to their underlying base()
+ * iterators. Others are implemented in terms of one another.
+ *
+ */
+ template<typename _Iterator>
+ inline bool
+ operator==(const reverse_iterator<_Iterator>& __x,
+ const reverse_iterator<_Iterator>& __y)
+ { return __x.base() == __y.base(); }
+
+ template<typename _Iterator>
+ inline bool
+ operator<(const reverse_iterator<_Iterator>& __x,
+ const reverse_iterator<_Iterator>& __y)
+ { return __y.base() < __x.base(); }
+
+ template<typename _Iterator>
+ inline bool
+ operator!=(const reverse_iterator<_Iterator>& __x,
+ const reverse_iterator<_Iterator>& __y)
+ { return !(__x == __y); }
+
+ template<typename _Iterator>
+ inline bool
+ operator>(const reverse_iterator<_Iterator>& __x,
+ const reverse_iterator<_Iterator>& __y)
+ { return __y < __x; }
+
+ template<typename _Iterator>
+ inline bool
+ operator<=(const reverse_iterator<_Iterator>& __x,
+ const reverse_iterator<_Iterator>& __y)
+ { return !(__y < __x); }
+
+ template<typename _Iterator>
+ inline bool
+ operator>=(const reverse_iterator<_Iterator>& __x,
+ const reverse_iterator<_Iterator>& __y)
+ { return !(__x < __y); }
+
+ template<typename _Iterator>
+ inline typename reverse_iterator<_Iterator>::difference_type
+ operator-(const reverse_iterator<_Iterator>& __x,
+ const reverse_iterator<_Iterator>& __y)
+ { return __y.base() - __x.base(); }
+
+ template<typename _Iterator>
+ inline reverse_iterator<_Iterator>
+ operator+(typename reverse_iterator<_Iterator>::difference_type __n,
+ const reverse_iterator<_Iterator>& __x)
+ { return reverse_iterator<_Iterator>(__x.base() - __n); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 280. Comparison of reverse_iterator to const reverse_iterator.
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator==(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ { return __x.base() == __y.base(); }
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator<(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ { return __y.base() < __x.base(); }
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator!=(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ { return !(__x == __y); }
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator>(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ { return __y < __x; }
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator<=(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ { return !(__y < __x); }
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator>=(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ { return !(__x < __y); }
+
+ template<typename _IteratorL, typename _IteratorR>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ // DR 685.
+ inline auto
+ operator-(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ -> decltype(__y.base() - __x.base())
+#else
+ inline typename reverse_iterator<_IteratorL>::difference_type
+ operator-(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+#endif
+ { return __y.base() - __x.base(); }
+ //@}
+
+ // 24.4.2.2.1 back_insert_iterator
+ /**
+ * @brief Turns assignment into insertion.
+ *
+ * These are output iterators, constructed from a container-of-T.
+ * Assigning a T to the iterator appends it to the container using
+ * push_back.
+ *
+ * Tip: Using the back_inserter function to create these iterators can
+ * save typing.
+ */
+ template<typename _Container>
+ class back_insert_iterator
+ : public iterator<output_iterator_tag, void, void, void, void>
+ {
+ protected:
+ _Container* container;
+
+ public:
+ /// A nested typedef for the type of whatever container you used.
+ typedef _Container container_type;
+
+ /// The only way to create this %iterator is with a container.
+ explicit
+ back_insert_iterator(_Container& __x) : container(&__x) { }
+
+ /**
+ * @param value An instance of whatever type
+ * container_type::const_reference is; presumably a
+ * reference-to-const T for container<T>.
+ * @return This %iterator, for chained operations.
+ *
+ * This kind of %iterator doesn't really have a "position" in the
+ * container (you can think of the position as being permanently at
+ * the end, if you like). Assigning a value to the %iterator will
+ * always append the value to the end of the container.
+ */
+ back_insert_iterator&
+ operator=(typename _Container::const_reference __value)
+ {
+ container->push_back(__value);
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ back_insert_iterator&
+ operator=(typename _Container::value_type&& __value)
+ {
+ container->push_back(std::move(__value));
+ return *this;
+ }
+#endif
+
+ /// Simply returns *this.
+ back_insert_iterator&
+ operator*()
+ { return *this; }
+
+ /// Simply returns *this. (This %iterator does not "move".)
+ back_insert_iterator&
+ operator++()
+ { return *this; }
+
+ /// Simply returns *this. (This %iterator does not "move".)
+ back_insert_iterator
+ operator++(int)
+ { return *this; }
+ };
+
+ /**
+ * @param x A container of arbitrary type.
+ * @return An instance of back_insert_iterator working on @p x.
+ *
+ * This wrapper function helps in creating back_insert_iterator instances.
+ * Typing the name of the %iterator requires knowing the precise full
+ * type of the container, which can be tedious and impedes generic
+ * programming. Using this function lets you take advantage of automatic
+ * template parameter deduction, making the compiler match the correct
+ * types for you.
+ */
+ template<typename _Container>
+ inline back_insert_iterator<_Container>
+ back_inserter(_Container& __x)
+ { return back_insert_iterator<_Container>(__x); }
+
+ /**
+ * @brief Turns assignment into insertion.
+ *
+ * These are output iterators, constructed from a container-of-T.
+ * Assigning a T to the iterator prepends it to the container using
+ * push_front.
+ *
+ * Tip: Using the front_inserter function to create these iterators can
+ * save typing.
+ */
+ template<typename _Container>
+ class front_insert_iterator
+ : public iterator<output_iterator_tag, void, void, void, void>
+ {
+ protected:
+ _Container* container;
+
+ public:
+ /// A nested typedef for the type of whatever container you used.
+ typedef _Container container_type;
+
+ /// The only way to create this %iterator is with a container.
+ explicit front_insert_iterator(_Container& __x) : container(&__x) { }
+
+ /**
+ * @param value An instance of whatever type
+ * container_type::const_reference is; presumably a
+ * reference-to-const T for container<T>.
+ * @return This %iterator, for chained operations.
+ *
+ * This kind of %iterator doesn't really have a "position" in the
+ * container (you can think of the position as being permanently at
+ * the front, if you like). Assigning a value to the %iterator will
+ * always prepend the value to the front of the container.
+ */
+ front_insert_iterator&
+ operator=(typename _Container::const_reference __value)
+ {
+ container->push_front(__value);
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ front_insert_iterator&
+ operator=(typename _Container::value_type&& __value)
+ {
+ container->push_front(std::move(__value));
+ return *this;
+ }
+#endif
+
+ /// Simply returns *this.
+ front_insert_iterator&
+ operator*()
+ { return *this; }
+
+ /// Simply returns *this. (This %iterator does not "move".)
+ front_insert_iterator&
+ operator++()
+ { return *this; }
+
+ /// Simply returns *this. (This %iterator does not "move".)
+ front_insert_iterator
+ operator++(int)
+ { return *this; }
+ };
+
+ /**
+ * @param x A container of arbitrary type.
+ * @return An instance of front_insert_iterator working on @p x.
+ *
+ * This wrapper function helps in creating front_insert_iterator instances.
+ * Typing the name of the %iterator requires knowing the precise full
+ * type of the container, which can be tedious and impedes generic
+ * programming. Using this function lets you take advantage of automatic
+ * template parameter deduction, making the compiler match the correct
+ * types for you.
+ */
+ template<typename _Container>
+ inline front_insert_iterator<_Container>
+ front_inserter(_Container& __x)
+ { return front_insert_iterator<_Container>(__x); }
+
+ /**
+ * @brief Turns assignment into insertion.
+ *
+ * These are output iterators, constructed from a container-of-T.
+ * Assigning a T to the iterator inserts it in the container at the
+ * %iterator's position, rather than overwriting the value at that
+ * position.
+ *
+ * (Sequences will actually insert a @e copy of the value before the
+ * %iterator's position.)
+ *
+ * Tip: Using the inserter function to create these iterators can
+ * save typing.
+ */
+ template<typename _Container>
+ class insert_iterator
+ : public iterator<output_iterator_tag, void, void, void, void>
+ {
+ protected:
+ _Container* container;
+ typename _Container::iterator iter;
+
+ public:
+ /// A nested typedef for the type of whatever container you used.
+ typedef _Container container_type;
+
+ /**
+ * The only way to create this %iterator is with a container and an
+ * initial position (a normal %iterator into the container).
+ */
+ insert_iterator(_Container& __x, typename _Container::iterator __i)
+ : container(&__x), iter(__i) {}
+
+ /**
+ * @param value An instance of whatever type
+ * container_type::const_reference is; presumably a
+ * reference-to-const T for container<T>.
+ * @return This %iterator, for chained operations.
+ *
+ * This kind of %iterator maintains its own position in the
+ * container. Assigning a value to the %iterator will insert the
+ * value into the container at the place before the %iterator.
+ *
+ * The position is maintained such that subsequent assignments will
+ * insert values immediately after one another. For example,
+ * @code
+ * // vector v contains A and Z
+ *
+ * insert_iterator i (v, ++v.begin());
+ * i = 1;
+ * i = 2;
+ * i = 3;
+ *
+ * // vector v contains A, 1, 2, 3, and Z
+ * @endcode
+ */
+ insert_iterator&
+ operator=(typename _Container::const_reference __value)
+ {
+ iter = container->insert(iter, __value);
+ ++iter;
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ insert_iterator&
+ operator=(typename _Container::value_type&& __value)
+ {
+ iter = container->insert(iter, std::move(__value));
+ ++iter;
+ return *this;
+ }
+#endif
+
+ /// Simply returns *this.
+ insert_iterator&
+ operator*()
+ { return *this; }
+
+ /// Simply returns *this. (This %iterator does not "move".)
+ insert_iterator&
+ operator++()
+ { return *this; }
+
+ /// Simply returns *this. (This %iterator does not "move".)
+ insert_iterator&
+ operator++(int)
+ { return *this; }
+ };
+
+ /**
+ * @param x A container of arbitrary type.
+ * @return An instance of insert_iterator working on @p x.
+ *
+ * This wrapper function helps in creating insert_iterator instances.
+ * Typing the name of the %iterator requires knowing the precise full
+ * type of the container, which can be tedious and impedes generic
+ * programming. Using this function lets you take advantage of automatic
+ * template parameter deduction, making the compiler match the correct
+ * types for you.
+ */
+ template<typename _Container, typename _Iterator>
+ inline insert_iterator<_Container>
+ inserter(_Container& __x, _Iterator __i)
+ {
+ return insert_iterator<_Container>(__x,
+ typename _Container::iterator(__i));
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // This iterator adapter is 'normal' in the sense that it does not
+ // change the semantics of any of the operators of its iterator
+ // parameter. Its primary purpose is to convert an iterator that is
+ // not a class, e.g. a pointer, into an iterator that is a class.
+ // The _Container parameter exists solely so that different containers
+ // using this template can instantiate different types, even if the
+ // _Iterator parameter is the same.
+ using std::iterator_traits;
+ using std::iterator;
+ template<typename _Iterator, typename _Container>
+ class __normal_iterator
+ {
+ protected:
+ _Iterator _M_current;
+
+ public:
+ typedef _Iterator iterator_type;
+ typedef typename iterator_traits<_Iterator>::iterator_category
+ iterator_category;
+ typedef typename iterator_traits<_Iterator>::value_type value_type;
+ typedef typename iterator_traits<_Iterator>::difference_type
+ difference_type;
+ typedef typename iterator_traits<_Iterator>::reference reference;
+ typedef typename iterator_traits<_Iterator>::pointer pointer;
+
+ __normal_iterator() : _M_current(_Iterator()) { }
+
+ explicit
+ __normal_iterator(const _Iterator& __i) : _M_current(__i) { }
+
+ // Allow iterator to const_iterator conversion
+ template<typename _Iter>
+ __normal_iterator(const __normal_iterator<_Iter,
+ typename __enable_if<
+ (std::__are_same<_Iter, typename _Container::pointer>::__value),
+ _Container>::__type>& __i)
+ : _M_current(__i.base()) { }
+
+ // Forward iterator requirements
+ reference
+ operator*() const
+ { return *_M_current; }
+
+ pointer
+ operator->() const
+ { return _M_current; }
+
+ __normal_iterator&
+ operator++()
+ {
+ ++_M_current;
+ return *this;
+ }
+
+ __normal_iterator
+ operator++(int)
+ { return __normal_iterator(_M_current++); }
+
+ // Bidirectional iterator requirements
+ __normal_iterator&
+ operator--()
+ {
+ --_M_current;
+ return *this;
+ }
+
+ __normal_iterator
+ operator--(int)
+ { return __normal_iterator(_M_current--); }
+
+ // Random access iterator requirements
+ reference
+ operator[](const difference_type& __n) const
+ { return _M_current[__n]; }
+
+ __normal_iterator&
+ operator+=(const difference_type& __n)
+ { _M_current += __n; return *this; }
+
+ __normal_iterator
+ operator+(const difference_type& __n) const
+ { return __normal_iterator(_M_current + __n); }
+
+ __normal_iterator&
+ operator-=(const difference_type& __n)
+ { _M_current -= __n; return *this; }
+
+ __normal_iterator
+ operator-(const difference_type& __n) const
+ { return __normal_iterator(_M_current - __n); }
+
+ const _Iterator&
+ base() const
+ { return _M_current; }
+ };
+
+ // Note: In what follows, the left- and right-hand-side iterators are
+ // allowed to vary in types (conceptually in cv-qualification) so that
+ // comparison between cv-qualified and non-cv-qualified iterators be
+ // valid. However, the greedy and unfriendly operators in std::rel_ops
+ // will make overload resolution ambiguous (when in scope) if we don't
+ // provide overloads whose operands are of the same type. Can someone
+ // remind me what generic programming is about? -- Gaby
+
+ // Forward iterator requirements
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator==(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __lhs.base() == __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+ inline bool
+ operator==(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() == __rhs.base(); }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __lhs.base() != __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+ inline bool
+ operator!=(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() != __rhs.base(); }
+
+ // Random access iterator requirements
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __lhs.base() < __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+ inline bool
+ operator<(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() < __rhs.base(); }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator>(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __lhs.base() > __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+ inline bool
+ operator>(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() > __rhs.base(); }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __lhs.base() <= __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+ inline bool
+ operator<=(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() <= __rhs.base(); }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator>=(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __lhs.base() >= __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+ inline bool
+ operator>=(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() >= __rhs.base(); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // According to the resolution of DR179 not only the various comparison
+ // operators but also operator- must accept mixed iterator/const_iterator
+ // parameters.
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ // DR 685.
+ inline auto
+ operator-(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ -> decltype(__lhs.base() - __rhs.base())
+#else
+ inline typename __normal_iterator<_IteratorL, _Container>::difference_type
+ operator-(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+#endif
+ { return __lhs.base() - __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+ inline typename __normal_iterator<_Iterator, _Container>::difference_type
+ operator-(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() - __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+ inline __normal_iterator<_Iterator, _Container>
+ operator+(typename __normal_iterator<_Iterator, _Container>::difference_type
+ __n, const __normal_iterator<_Iterator, _Container>& __i)
+ { return __normal_iterator<_Iterator, _Container>(__i.base() + __n); }
+
+_GLIBCXX_END_NAMESPACE
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 24.4.3 Move iterators
+ /**
+ * Class template move_iterator is an iterator adapter with the same
+ * behavior as the underlying iterator except that its dereference
+ * operator implicitly converts the value returned by the underlying
+ * iterator's dereference operator to an rvalue reference. Some
+ * generic algorithms can be called with move iterators to replace
+ * copying with moving.
+ */
+ template<typename _Iterator>
+ class move_iterator
+ {
+ protected:
+ _Iterator _M_current;
+
+ public:
+ typedef _Iterator iterator_type;
+ typedef typename iterator_traits<_Iterator>::difference_type
+ difference_type;
+ // NB: DR 680.
+ typedef _Iterator pointer;
+ typedef typename iterator_traits<_Iterator>::value_type value_type;
+ typedef typename iterator_traits<_Iterator>::iterator_category
+ iterator_category;
+ typedef value_type&& reference;
+
+ public:
+ move_iterator()
+ : _M_current() { }
+
+ explicit
+ move_iterator(iterator_type __i)
+ : _M_current(__i) { }
+
+ template<typename _Iter>
+ move_iterator(const move_iterator<_Iter>& __i)
+ : _M_current(__i.base()) { }
+
+ iterator_type
+ base() const
+ { return _M_current; }
+
+ reference
+ operator*() const
+ { return *_M_current; }
+
+ pointer
+ operator->() const
+ { return _M_current; }
+
+ move_iterator&
+ operator++()
+ {
+ ++_M_current;
+ return *this;
+ }
+
+ move_iterator
+ operator++(int)
+ {
+ move_iterator __tmp = *this;
+ ++_M_current;
+ return __tmp;
+ }
+
+ move_iterator&
+ operator--()
+ {
+ --_M_current;
+ return *this;
+ }
+
+ move_iterator
+ operator--(int)
+ {
+ move_iterator __tmp = *this;
+ --_M_current;
+ return __tmp;
+ }
+
+ move_iterator
+ operator+(difference_type __n) const
+ { return move_iterator(_M_current + __n); }
+
+ move_iterator&
+ operator+=(difference_type __n)
+ {
+ _M_current += __n;
+ return *this;
+ }
+
+ move_iterator
+ operator-(difference_type __n) const
+ { return move_iterator(_M_current - __n); }
+
+ move_iterator&
+ operator-=(difference_type __n)
+ {
+ _M_current -= __n;
+ return *this;
+ }
+
+ reference
+ operator[](difference_type __n) const
+ { return _M_current[__n]; }
+ };
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator==(const move_iterator<_IteratorL>& __x,
+ const move_iterator<_IteratorR>& __y)
+ { return __x.base() == __y.base(); }
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator!=(const move_iterator<_IteratorL>& __x,
+ const move_iterator<_IteratorR>& __y)
+ { return !(__x == __y); }
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator<(const move_iterator<_IteratorL>& __x,
+ const move_iterator<_IteratorR>& __y)
+ { return __x.base() < __y.base(); }
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator<=(const move_iterator<_IteratorL>& __x,
+ const move_iterator<_IteratorR>& __y)
+ { return !(__y < __x); }
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator>(const move_iterator<_IteratorL>& __x,
+ const move_iterator<_IteratorR>& __y)
+ { return __y < __x; }
+
+ template<typename _IteratorL, typename _IteratorR>
+ inline bool
+ operator>=(const move_iterator<_IteratorL>& __x,
+ const move_iterator<_IteratorR>& __y)
+ { return !(__x < __y); }
+
+ // DR 685.
+ template<typename _IteratorL, typename _IteratorR>
+ inline auto
+ operator-(const move_iterator<_IteratorL>& __x,
+ const move_iterator<_IteratorR>& __y)
+ -> decltype(__x.base() - __y.base())
+ { return __x.base() - __y.base(); }
+
+ template<typename _Iterator>
+ inline move_iterator<_Iterator>
+ operator+(typename move_iterator<_Iterator>::difference_type __n,
+ const move_iterator<_Iterator>& __x)
+ { return __x + __n; }
+
+ template<typename _Iterator>
+ inline move_iterator<_Iterator>
+ make_move_iterator(const _Iterator& __i)
+ { return move_iterator<_Iterator>(__i); }
+
+_GLIBCXX_END_NAMESPACE
+
+#define _GLIBCXX_MAKE_MOVE_ITERATOR(_Iter) std::make_move_iterator(_Iter)
+#else
+#define _GLIBCXX_MAKE_MOVE_ITERATOR(_Iter) (_Iter)
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_iterator_base_funcs.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_iterator_base_funcs.h
new file mode 100644
index 0000000..0a854fa
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_iterator_base_funcs.h
@@ -0,0 +1,197 @@
+// Functions used by iterators -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_iterator_base_funcs.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ *
+ * This file contains all of the general iterator-related utility
+ * functions, such as distance() and advance().
+ */
+
+#ifndef _STL_ITERATOR_BASE_FUNCS_H
+#define _STL_ITERATOR_BASE_FUNCS_H 1
+
+#pragma GCC system_header
+#include <bits/concept_check.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _InputIterator>
+ inline typename iterator_traits<_InputIterator>::difference_type
+ __distance(_InputIterator __first, _InputIterator __last,
+ input_iterator_tag)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+
+ typename iterator_traits<_InputIterator>::difference_type __n = 0;
+ while (__first != __last)
+ {
+ ++__first;
+ ++__n;
+ }
+ return __n;
+ }
+
+ template<typename _RandomAccessIterator>
+ inline typename iterator_traits<_RandomAccessIterator>::difference_type
+ __distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ random_access_iterator_tag)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ return __last - __first;
+ }
+
+ /**
+ * @brief A generalization of pointer arithmetic.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @return The distance between them.
+ *
+ * Returns @c n such that first + n == last. This requires that @p last
+ * must be reachable from @p first. Note that @c n may be negative.
+ *
+ * For random access iterators, this uses their @c + and @c - operations
+ * and are constant time. For other %iterator classes they are linear time.
+ */
+ template<typename _InputIterator>
+ inline typename iterator_traits<_InputIterator>::difference_type
+ distance(_InputIterator __first, _InputIterator __last)
+ {
+ // concept requirements -- taken care of in __distance
+ return std::__distance(__first, __last,
+ std::__iterator_category(__first));
+ }
+
+ template<typename _InputIterator, typename _Distance>
+ inline void
+ __advance(_InputIterator& __i, _Distance __n, input_iterator_tag)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ while (__n--)
+ ++__i;
+ }
+
+ template<typename _BidirectionalIterator, typename _Distance>
+ inline void
+ __advance(_BidirectionalIterator& __i, _Distance __n,
+ bidirectional_iterator_tag)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_BidirectionalIteratorConcept<
+ _BidirectionalIterator>)
+ if (__n > 0)
+ while (__n--)
+ ++__i;
+ else
+ while (__n++)
+ --__i;
+ }
+
+ template<typename _RandomAccessIterator, typename _Distance>
+ inline void
+ __advance(_RandomAccessIterator& __i, _Distance __n,
+ random_access_iterator_tag)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __i += __n;
+ }
+
+ /**
+ * @brief A generalization of pointer arithmetic.
+ * @param i An input iterator.
+ * @param n The "delta" by which to change @p i.
+ * @return Nothing.
+ *
+ * This increments @p i by @p n. For bidirectional and random access
+ * iterators, @p n may be negative, in which case @p i is decremented.
+ *
+ * For random access iterators, this uses their @c + and @c - operations
+ * and are constant time. For other %iterator classes they are linear time.
+ */
+ template<typename _InputIterator, typename _Distance>
+ inline void
+ advance(_InputIterator& __i, _Distance __n)
+ {
+ // concept requirements -- taken care of in __advance
+ typename iterator_traits<_InputIterator>::difference_type __d = __n;
+ std::__advance(__i, __d, std::__iterator_category(__i));
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _InputIterator>
+ inline _InputIterator
+ next(_InputIterator __x, typename
+ iterator_traits<_InputIterator>::difference_type __n = 1)
+ {
+ std::advance(__x, __n);
+ return __x;
+ }
+
+ template<typename _BidirectionalIterator>
+ inline _BidirectionalIterator
+ prev(_BidirectionalIterator __x, typename
+ iterator_traits<_BidirectionalIterator>::difference_type __n = 1)
+ {
+ std::advance(__x, -__n);
+ return __x;
+ }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_ITERATOR_BASE_FUNCS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_iterator_base_types.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_iterator_base_types.h
new file mode 100644
index 0000000..6dc0d78
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_iterator_base_types.h
@@ -0,0 +1,168 @@
+// Types used in iterator implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_iterator_base_types.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ *
+ * This file contains all of the general iterator-related utility types,
+ * such as iterator_traits and struct iterator.
+ */
+
+#ifndef _STL_ITERATOR_BASE_TYPES_H
+#define _STL_ITERATOR_BASE_TYPES_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <cstddef>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @defgroup iterators Iterators
+ * These are empty types, used to distinguish different iterators. The
+ * distinction is not made by what they contain, but simply by what they
+ * are. Different underlying algorithms can then be used based on the
+ * different operations supported by different iterator types.
+ */
+ //@{
+ /// Marking input iterators.
+ struct input_iterator_tag { };
+ /// Marking output iterators.
+ struct output_iterator_tag { };
+ /// Forward iterators support a superset of input iterator operations.
+ struct forward_iterator_tag : public input_iterator_tag { };
+ /// Bidirectional iterators support a superset of forward iterator
+ /// operations.
+ struct bidirectional_iterator_tag : public forward_iterator_tag { };
+ /// Random-access iterators support a superset of bidirectional iterator
+ /// operations.
+ struct random_access_iterator_tag : public bidirectional_iterator_tag { };
+
+
+ /**
+ * @brief Common %iterator class.
+ *
+ * This class does nothing but define nested typedefs. %Iterator classes
+ * can inherit from this class to save some work. The typedefs are then
+ * used in specializations and overloading.
+ *
+ * In particular, there are no default implementations of requirements
+ * such as @c operator++ and the like. (How could there be?)
+ */
+ template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
+ typename _Pointer = _Tp*, typename _Reference = _Tp&>
+ struct iterator
+ {
+ /// One of the @link iterator_tags tag types@endlink.
+ typedef _Category iterator_category;
+ /// The type "pointed to" by the iterator.
+ typedef _Tp value_type;
+ /// Distance between iterators is represented as this type.
+ typedef _Distance difference_type;
+ /// This type represents a pointer-to-value_type.
+ typedef _Pointer pointer;
+ /// This type represents a reference-to-value_type.
+ typedef _Reference reference;
+ };
+
+ /**
+ * This class does nothing but define nested typedefs. The general
+ * version simply "forwards" the nested typedefs from the Iterator
+ * argument. Specialized versions for pointers and pointers-to-const
+ * provide tighter, more correct semantics.
+ */
+ template<typename _Iterator>
+ struct iterator_traits
+ {
+ typedef typename _Iterator::iterator_category iterator_category;
+ typedef typename _Iterator::value_type value_type;
+ typedef typename _Iterator::difference_type difference_type;
+ typedef typename _Iterator::pointer pointer;
+ typedef typename _Iterator::reference reference;
+ };
+
+ template<typename _Tp>
+ struct iterator_traits<_Tp*>
+ {
+ typedef random_access_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef _Tp& reference;
+ };
+
+ template<typename _Tp>
+ struct iterator_traits<const _Tp*>
+ {
+ typedef random_access_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef ptrdiff_t difference_type;
+ typedef const _Tp* pointer;
+ typedef const _Tp& reference;
+ };
+
+ /**
+ * This function is not a part of the C++ standard but is syntactic
+ * sugar for internal library use only.
+ */
+ template<typename _Iter>
+ inline typename iterator_traits<_Iter>::iterator_category
+ __iterator_category(const _Iter&)
+ { return typename iterator_traits<_Iter>::iterator_category(); }
+
+ //@}
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_ITERATOR_BASE_TYPES_H */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_list.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_list.h
new file mode 100644
index 0000000..66a50b8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_list.h
@@ -0,0 +1,1533 @@
+// List implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_list.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_LIST_H
+#define _STL_LIST_H 1
+
+#include <bits/concept_check.h>
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ // Supporting structures are split into common and templated types; the
+ // latter publicly inherits from the former in an effort to reduce code
+ // duplication. This results in some "needless" static_cast'ing later on,
+ // but it's all safe downcasting.
+
+ /// Common part of a node in the %list.
+ struct _List_node_base
+ {
+ _List_node_base* _M_next;
+ _List_node_base* _M_prev;
+
+ static void
+ swap(_List_node_base& __x, _List_node_base& __y);
+
+ void
+ transfer(_List_node_base * const __first,
+ _List_node_base * const __last);
+
+ void
+ reverse();
+
+ void
+ hook(_List_node_base * const __position);
+
+ void
+ unhook();
+ };
+
+ /// An actual node in the %list.
+ template<typename _Tp>
+ struct _List_node : public _List_node_base
+ {
+ ///< User's data.
+ _Tp _M_data;
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ _List_node(_Args&&... __args)
+ : _List_node_base(), _M_data(std::forward<_Args>(__args)...) { }
+#endif
+ };
+
+ /**
+ * @brief A list::iterator.
+ *
+ * All the functions are op overloads.
+ */
+ template<typename _Tp>
+ struct _List_iterator
+ {
+ typedef _List_iterator<_Tp> _Self;
+ typedef _List_node<_Tp> _Node;
+
+ typedef ptrdiff_t difference_type;
+ typedef std::bidirectional_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef _Tp* pointer;
+ typedef _Tp& reference;
+
+ _List_iterator()
+ : _M_node() { }
+
+ explicit
+ _List_iterator(_List_node_base* __x)
+ : _M_node(__x) { }
+
+ // Must downcast from List_node_base to _List_node to get to _M_data.
+ reference
+ operator*() const
+ { return static_cast<_Node*>(_M_node)->_M_data; }
+
+ pointer
+ operator->() const
+ { return &static_cast<_Node*>(_M_node)->_M_data; }
+
+ _Self&
+ operator++()
+ {
+ _M_node = _M_node->_M_next;
+ return *this;
+ }
+
+ _Self
+ operator++(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _M_node->_M_next;
+ return __tmp;
+ }
+
+ _Self&
+ operator--()
+ {
+ _M_node = _M_node->_M_prev;
+ return *this;
+ }
+
+ _Self
+ operator--(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _M_node->_M_prev;
+ return __tmp;
+ }
+
+ bool
+ operator==(const _Self& __x) const
+ { return _M_node == __x._M_node; }
+
+ bool
+ operator!=(const _Self& __x) const
+ { return _M_node != __x._M_node; }
+
+ // The only member points to the %list element.
+ _List_node_base* _M_node;
+ };
+
+ /**
+ * @brief A list::const_iterator.
+ *
+ * All the functions are op overloads.
+ */
+ template<typename _Tp>
+ struct _List_const_iterator
+ {
+ typedef _List_const_iterator<_Tp> _Self;
+ typedef const _List_node<_Tp> _Node;
+ typedef _List_iterator<_Tp> iterator;
+
+ typedef ptrdiff_t difference_type;
+ typedef std::bidirectional_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef const _Tp* pointer;
+ typedef const _Tp& reference;
+
+ _List_const_iterator()
+ : _M_node() { }
+
+ explicit
+ _List_const_iterator(const _List_node_base* __x)
+ : _M_node(__x) { }
+
+ _List_const_iterator(const iterator& __x)
+ : _M_node(__x._M_node) { }
+
+ // Must downcast from List_node_base to _List_node to get to
+ // _M_data.
+ reference
+ operator*() const
+ { return static_cast<_Node*>(_M_node)->_M_data; }
+
+ pointer
+ operator->() const
+ { return &static_cast<_Node*>(_M_node)->_M_data; }
+
+ _Self&
+ operator++()
+ {
+ _M_node = _M_node->_M_next;
+ return *this;
+ }
+
+ _Self
+ operator++(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _M_node->_M_next;
+ return __tmp;
+ }
+
+ _Self&
+ operator--()
+ {
+ _M_node = _M_node->_M_prev;
+ return *this;
+ }
+
+ _Self
+ operator--(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _M_node->_M_prev;
+ return __tmp;
+ }
+
+ bool
+ operator==(const _Self& __x) const
+ { return _M_node == __x._M_node; }
+
+ bool
+ operator!=(const _Self& __x) const
+ { return _M_node != __x._M_node; }
+
+ // The only member points to the %list element.
+ const _List_node_base* _M_node;
+ };
+
+ template<typename _Val>
+ inline bool
+ operator==(const _List_iterator<_Val>& __x,
+ const _List_const_iterator<_Val>& __y)
+ { return __x._M_node == __y._M_node; }
+
+ template<typename _Val>
+ inline bool
+ operator!=(const _List_iterator<_Val>& __x,
+ const _List_const_iterator<_Val>& __y)
+ { return __x._M_node != __y._M_node; }
+
+
+ /// See bits/stl_deque.h's _Deque_base for an explanation.
+ template<typename _Tp, typename _Alloc>
+ class _List_base
+ {
+ protected:
+ // NOTA BENE
+ // The stored instance is not actually of "allocator_type"'s
+ // type. Instead we rebind the type to
+ // Allocator<List_node<Tp>>, which according to [20.1.5]/4
+ // should probably be the same. List_node<Tp> is not the same
+ // size as Tp (it's two pointers larger), and specializations on
+ // Tp may go unused because List_node<Tp> is being bound
+ // instead.
+ //
+ // We put this to the test in the constructors and in
+ // get_allocator, where we use conversions between
+ // allocator_type and _Node_alloc_type. The conversion is
+ // required by table 32 in [20.1.5].
+ typedef typename _Alloc::template rebind<_List_node<_Tp> >::other
+ _Node_alloc_type;
+
+ typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
+
+ struct _List_impl
+ : public _Node_alloc_type
+ {
+ _List_node_base _M_node;
+
+ _List_impl()
+ : _Node_alloc_type(), _M_node()
+ { }
+
+ _List_impl(const _Node_alloc_type& __a)
+ : _Node_alloc_type(__a), _M_node()
+ { }
+ };
+
+ _List_impl _M_impl;
+
+ _List_node<_Tp>*
+ _M_get_node()
+ { return _M_impl._Node_alloc_type::allocate(1); }
+
+ void
+ _M_put_node(_List_node<_Tp>* __p)
+ { _M_impl._Node_alloc_type::deallocate(__p, 1); }
+
+ public:
+ typedef _Alloc allocator_type;
+
+ _Node_alloc_type&
+ _M_get_Node_allocator()
+ { return *static_cast<_Node_alloc_type*>(&this->_M_impl); }
+
+ const _Node_alloc_type&
+ _M_get_Node_allocator() const
+ { return *static_cast<const _Node_alloc_type*>(&this->_M_impl); }
+
+ _Tp_alloc_type
+ _M_get_Tp_allocator() const
+ { return _Tp_alloc_type(_M_get_Node_allocator()); }
+
+ allocator_type
+ get_allocator() const
+ { return allocator_type(_M_get_Node_allocator()); }
+
+ _List_base()
+ : _M_impl()
+ { _M_init(); }
+
+ _List_base(const allocator_type& __a)
+ : _M_impl(__a)
+ { _M_init(); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ _List_base(_List_base&& __x)
+ : _M_impl(__x._M_get_Node_allocator())
+ {
+ _M_init();
+ _List_node_base::swap(this->_M_impl._M_node, __x._M_impl._M_node);
+ }
+#endif
+
+ // This is what actually destroys the list.
+ ~_List_base()
+ { _M_clear(); }
+
+ void
+ _M_clear();
+
+ void
+ _M_init()
+ {
+ this->_M_impl._M_node._M_next = &this->_M_impl._M_node;
+ this->_M_impl._M_node._M_prev = &this->_M_impl._M_node;
+ }
+ };
+
+ /**
+ * @brief A standard container with linear time access to elements,
+ * and fixed time insertion/deletion at any point in the sequence.
+ *
+ * @ingroup sequences
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, a
+ * <a href="tables.html#66">reversible container</a>, and a
+ * <a href="tables.html#67">sequence</a>, including the
+ * <a href="tables.html#68">optional sequence requirements</a> with the
+ * %exception of @c at and @c operator[].
+ *
+ * This is a @e doubly @e linked %list. Traversal up and down the
+ * %list requires linear time, but adding and removing elements (or
+ * @e nodes) is done in constant time, regardless of where the
+ * change takes place. Unlike std::vector and std::deque,
+ * random-access iterators are not provided, so subscripting ( @c
+ * [] ) access is not allowed. For algorithms which only need
+ * sequential access, this lack makes no difference.
+ *
+ * Also unlike the other standard containers, std::list provides
+ * specialized algorithms %unique to linked lists, such as
+ * splicing, sorting, and in-place reversal.
+ *
+ * A couple points on memory allocation for list<Tp>:
+ *
+ * First, we never actually allocate a Tp, we allocate
+ * List_node<Tp>'s and trust [20.1.5]/4 to DTRT. This is to ensure
+ * that after elements from %list<X,Alloc1> are spliced into
+ * %list<X,Alloc2>, destroying the memory of the second %list is a
+ * valid operation, i.e., Alloc1 giveth and Alloc2 taketh away.
+ *
+ * Second, a %list conceptually represented as
+ * @code
+ * A <---> B <---> C <---> D
+ * @endcode
+ * is actually circular; a link exists between A and D. The %list
+ * class holds (as its only data member) a private list::iterator
+ * pointing to @e D, not to @e A! To get to the head of the %list,
+ * we start at the tail and move forward by one. When this member
+ * iterator's next/previous pointers refer to itself, the %list is
+ * %empty.
+ */
+ template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
+ class list : protected _List_base<_Tp, _Alloc>
+ {
+ // concept requirements
+ typedef typename _Alloc::value_type _Alloc_value_type;
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept)
+
+ typedef _List_base<_Tp, _Alloc> _Base;
+ typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
+
+ public:
+ typedef _Tp value_type;
+ typedef typename _Tp_alloc_type::pointer pointer;
+ typedef typename _Tp_alloc_type::const_pointer const_pointer;
+ typedef typename _Tp_alloc_type::reference reference;
+ typedef typename _Tp_alloc_type::const_reference const_reference;
+ typedef _List_iterator<_Tp> iterator;
+ typedef _List_const_iterator<_Tp> const_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Alloc allocator_type;
+
+ protected:
+ // Note that pointers-to-_Node's can be ctor-converted to
+ // iterator types.
+ typedef _List_node<_Tp> _Node;
+
+ using _Base::_M_impl;
+ using _Base::_M_put_node;
+ using _Base::_M_get_node;
+ using _Base::_M_get_Tp_allocator;
+ using _Base::_M_get_Node_allocator;
+
+ /**
+ * @param x An instance of user data.
+ *
+ * Allocates space for a new node and constructs a copy of @a x in it.
+ */
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ _Node*
+ _M_create_node(const value_type& __x)
+ {
+ _Node* __p = this->_M_get_node();
+ __try
+ {
+ _M_get_Tp_allocator().construct(&__p->_M_data, __x);
+ }
+ __catch(...)
+ {
+ _M_put_node(__p);
+ __throw_exception_again;
+ }
+ return __p;
+ }
+#else
+ template<typename... _Args>
+ _Node*
+ _M_create_node(_Args&&... __args)
+ {
+ _Node* __p = this->_M_get_node();
+ __try
+ {
+ _M_get_Node_allocator().construct(__p,
+ std::forward<_Args>(__args)...);
+ }
+ __catch(...)
+ {
+ _M_put_node(__p);
+ __throw_exception_again;
+ }
+ return __p;
+ }
+#endif
+
+ public:
+ // [23.2.2.1] construct/copy/destroy
+ // (assign() and get_allocator() are also listed in this section)
+ /**
+ * @brief Default constructor creates no elements.
+ */
+ list()
+ : _Base() { }
+
+ /**
+ * @brief Creates a %list with no elements.
+ * @param a An allocator object.
+ */
+ explicit
+ list(const allocator_type& __a)
+ : _Base(__a) { }
+
+ /**
+ * @brief Creates a %list with copies of an exemplar element.
+ * @param n The number of elements to initially create.
+ * @param value An element to copy.
+ * @param a An allocator object.
+ *
+ * This constructor fills the %list with @a n copies of @a value.
+ */
+ explicit
+ list(size_type __n, const value_type& __value = value_type(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ { _M_fill_initialize(__n, __value); }
+
+ /**
+ * @brief %List copy constructor.
+ * @param x A %list of identical element and allocator types.
+ *
+ * The newly-created %list uses a copy of the allocation object used
+ * by @a x.
+ */
+ list(const list& __x)
+ : _Base(__x._M_get_Node_allocator())
+ { _M_initialize_dispatch(__x.begin(), __x.end(), __false_type()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %List move constructor.
+ * @param x A %list of identical element and allocator types.
+ *
+ * The newly-created %list contains the exact contents of @a x.
+ * The contents of @a x are a valid, but unspecified %list.
+ */
+ list(list&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+
+ /**
+ * @brief Builds a %list from an initializer_list
+ * @param l An initializer_list of value_type.
+ * @param a An allocator object.
+ *
+ * Create a %list consisting of copies of the elements in the
+ * initializer_list @a l. This is linear in l.size().
+ */
+ list(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ { _M_initialize_dispatch(__l.begin(), __l.end(), __false_type()); }
+#endif
+
+ /**
+ * @brief Builds a %list from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param a An allocator object.
+ *
+ * Create a %list consisting of copies of the elements from
+ * [@a first,@a last). This is linear in N (where N is
+ * distance(@a first,@a last)).
+ */
+ template<typename _InputIterator>
+ list(_InputIterator __first, _InputIterator __last,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ // Check whether it's an integral type. If so, it's not an iterator.
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_initialize_dispatch(__first, __last, _Integral());
+ }
+
+ /**
+ * No explicit dtor needed as the _Base dtor takes care of
+ * things. The _Base dtor only erases the elements, and note
+ * that if the elements themselves are pointers, the pointed-to
+ * memory is not touched in any way. Managing the pointer is
+ * the user's responsibility.
+ */
+
+ /**
+ * @brief %List assignment operator.
+ * @param x A %list of identical element and allocator types.
+ *
+ * All the elements of @a x are copied, but unlike the copy
+ * constructor, the allocator object is not copied.
+ */
+ list&
+ operator=(const list& __x);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %List move assignment operator.
+ * @param x A %list of identical element and allocator types.
+ *
+ * The contents of @a x are moved into this %list (without copying).
+ * @a x is a valid, but unspecified %list
+ */
+ list&
+ operator=(list&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ /**
+ * @brief %List initializer list assignment operator.
+ * @param l An initializer_list of value_type.
+ *
+ * Replace the contents of the %list with copies of the elements
+ * in the initializer_list @a l. This is linear in l.size().
+ */
+ list&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->assign(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+
+ /**
+ * @brief Assigns a given value to a %list.
+ * @param n Number of elements to be assigned.
+ * @param val Value to be assigned.
+ *
+ * This function fills a %list with @a n copies of the given
+ * value. Note that the assignment completely changes the %list
+ * and that the resulting %list's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ void
+ assign(size_type __n, const value_type& __val)
+ { _M_fill_assign(__n, __val); }
+
+ /**
+ * @brief Assigns a range to a %list.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * This function fills a %list with copies of the elements in the
+ * range [@a first,@a last).
+ *
+ * Note that the assignment completely changes the %list and
+ * that the resulting %list's size is the same as the number of
+ * elements assigned. Old data may be lost.
+ */
+ template<typename _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ // Check whether it's an integral type. If so, it's not an iterator.
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_assign_dispatch(__first, __last, _Integral());
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Assigns an initializer_list to a %list.
+ * @param l An initializer_list of value_type.
+ *
+ * Replace the contents of the %list with copies of the elements
+ * in the initializer_list @a l. This is linear in l.size().
+ */
+ void
+ assign(initializer_list<value_type> __l)
+ { this->assign(__l.begin(), __l.end()); }
+#endif
+
+ /// Get a copy of the memory allocation object.
+ allocator_type
+ get_allocator() const
+ { return _Base::get_allocator(); }
+
+ // iterators
+ /**
+ * Returns a read/write iterator that points to the first element in the
+ * %list. Iteration is done in ordinary element order.
+ */
+ iterator
+ begin()
+ { return iterator(this->_M_impl._M_node._M_next); }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the
+ * first element in the %list. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ begin() const
+ { return const_iterator(this->_M_impl._M_node._M_next); }
+
+ /**
+ * Returns a read/write iterator that points one past the last
+ * element in the %list. Iteration is done in ordinary element
+ * order.
+ */
+ iterator
+ end()
+ { return iterator(&this->_M_impl._M_node); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past
+ * the last element in the %list. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ end() const
+ { return const_iterator(&this->_M_impl._M_node); }
+
+ /**
+ * Returns a read/write reverse iterator that points to the last
+ * element in the %list. Iteration is done in reverse element
+ * order.
+ */
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to
+ * the last element in the %list. Iteration is done in reverse
+ * element order.
+ */
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ /**
+ * Returns a read/write reverse iterator that points to one
+ * before the first element in the %list. Iteration is done in
+ * reverse element order.
+ */
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to one
+ * before the first element in the %list. Iteration is done in reverse
+ * element order.
+ */
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * Returns a read-only (constant) iterator that points to the
+ * first element in the %list. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ cbegin() const
+ { return const_iterator(this->_M_impl._M_node._M_next); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past
+ * the last element in the %list. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ cend() const
+ { return const_iterator(&this->_M_impl._M_node); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to
+ * the last element in the %list. Iteration is done in reverse
+ * element order.
+ */
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to one
+ * before the first element in the %list. Iteration is done in reverse
+ * element order.
+ */
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ // [23.2.2.2] capacity
+ /**
+ * Returns true if the %list is empty. (Thus begin() would equal
+ * end().)
+ */
+ bool
+ empty() const
+ { return this->_M_impl._M_node._M_next == &this->_M_impl._M_node; }
+
+ /** Returns the number of elements in the %list. */
+ size_type
+ size() const
+ { return std::distance(begin(), end()); }
+
+ /** Returns the size() of the largest possible %list. */
+ size_type
+ max_size() const
+ { return _M_get_Node_allocator().max_size(); }
+
+ /**
+ * @brief Resizes the %list to the specified number of elements.
+ * @param new_size Number of elements the %list should contain.
+ * @param x Data with which new elements should be populated.
+ *
+ * This function will %resize the %list to the specified number
+ * of elements. If the number is smaller than the %list's
+ * current size the %list is truncated, otherwise the %list is
+ * extended and new elements are populated with given data.
+ */
+ void
+ resize(size_type __new_size, value_type __x = value_type());
+
+ // element access
+ /**
+ * Returns a read/write reference to the data at the first
+ * element of the %list.
+ */
+ reference
+ front()
+ { return *begin(); }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the first
+ * element of the %list.
+ */
+ const_reference
+ front() const
+ { return *begin(); }
+
+ /**
+ * Returns a read/write reference to the data at the last element
+ * of the %list.
+ */
+ reference
+ back()
+ {
+ iterator __tmp = end();
+ --__tmp;
+ return *__tmp;
+ }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the last
+ * element of the %list.
+ */
+ const_reference
+ back() const
+ {
+ const_iterator __tmp = end();
+ --__tmp;
+ return *__tmp;
+ }
+
+ // [23.2.2.3] modifiers
+ /**
+ * @brief Add data to the front of the %list.
+ * @param x Data to be added.
+ *
+ * This is a typical stack operation. The function creates an
+ * element at the front of the %list and assigns the given data
+ * to it. Due to the nature of a %list this operation can be
+ * done in constant time, and does not invalidate iterators and
+ * references.
+ */
+ void
+ push_front(const value_type& __x)
+ { this->_M_insert(begin(), __x); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push_front(value_type&& __x)
+ { this->_M_insert(begin(), std::move(__x)); }
+
+ template<typename... _Args>
+ void
+ emplace_front(_Args&&... __args)
+ { this->_M_insert(begin(), std::forward<_Args>(__args)...); }
+#endif
+
+ /**
+ * @brief Removes first element.
+ *
+ * This is a typical stack operation. It shrinks the %list by
+ * one. Due to the nature of a %list this operation can be done
+ * in constant time, and only invalidates iterators/references to
+ * the element being removed.
+ *
+ * Note that no data is returned, and if the first element's data
+ * is needed, it should be retrieved before pop_front() is
+ * called.
+ */
+ void
+ pop_front()
+ { this->_M_erase(begin()); }
+
+ /**
+ * @brief Add data to the end of the %list.
+ * @param x Data to be added.
+ *
+ * This is a typical stack operation. The function creates an
+ * element at the end of the %list and assigns the given data to
+ * it. Due to the nature of a %list this operation can be done
+ * in constant time, and does not invalidate iterators and
+ * references.
+ */
+ void
+ push_back(const value_type& __x)
+ { this->_M_insert(end(), __x); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push_back(value_type&& __x)
+ { this->_M_insert(end(), std::move(__x)); }
+
+ template<typename... _Args>
+ void
+ emplace_back(_Args&&... __args)
+ { this->_M_insert(end(), std::forward<_Args>(__args)...); }
+#endif
+
+ /**
+ * @brief Removes last element.
+ *
+ * This is a typical stack operation. It shrinks the %list by
+ * one. Due to the nature of a %list this operation can be done
+ * in constant time, and only invalidates iterators/references to
+ * the element being removed.
+ *
+ * Note that no data is returned, and if the last element's data
+ * is needed, it should be retrieved before pop_back() is called.
+ */
+ void
+ pop_back()
+ { this->_M_erase(iterator(this->_M_impl._M_node._M_prev)); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Constructs object in %list before specified iterator.
+ * @param position A const_iterator into the %list.
+ * @param args Arguments.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert an object of type T constructed
+ * with T(std::forward<Args>(args)...) before the specified
+ * location. Due to the nature of a %list this operation can
+ * be done in constant time, and does not invalidate iterators
+ * and references.
+ */
+ template<typename... _Args>
+ iterator
+ emplace(iterator __position, _Args&&... __args);
+#endif
+
+ /**
+ * @brief Inserts given value into %list before specified iterator.
+ * @param position An iterator into the %list.
+ * @param x Data to be inserted.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert a copy of the given value before
+ * the specified location. Due to the nature of a %list this
+ * operation can be done in constant time, and does not
+ * invalidate iterators and references.
+ */
+ iterator
+ insert(iterator __position, const value_type& __x);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Inserts given rvalue into %list before specified iterator.
+ * @param position An iterator into the %list.
+ * @param x Data to be inserted.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert a copy of the given rvalue before
+ * the specified location. Due to the nature of a %list this
+ * operation can be done in constant time, and does not
+ * invalidate iterators and references.
+ */
+ iterator
+ insert(iterator __position, value_type&& __x)
+ { return emplace(__position, std::move(__x)); }
+
+ /**
+ * @brief Inserts the contents of an initializer_list into %list
+ * before specified iterator.
+ * @param p An iterator into the %list.
+ * @param l An initializer_list of value_type.
+ *
+ * This function will insert copies of the data in the
+ * initializer_list @a l into the %list before the location
+ * specified by @a p.
+ *
+ * This operation is linear in the number of elements inserted and
+ * does not invalidate iterators and references.
+ */
+ void
+ insert(iterator __p, initializer_list<value_type> __l)
+ { this->insert(__p, __l.begin(), __l.end()); }
+#endif
+
+ /**
+ * @brief Inserts a number of copies of given data into the %list.
+ * @param position An iterator into the %list.
+ * @param n Number of elements to be inserted.
+ * @param x Data to be inserted.
+ *
+ * This function will insert a specified number of copies of the
+ * given data before the location specified by @a position.
+ *
+ * This operation is linear in the number of elements inserted and
+ * does not invalidate iterators and references.
+ */
+ void
+ insert(iterator __position, size_type __n, const value_type& __x)
+ {
+ list __tmp(__n, __x, _M_get_Node_allocator());
+ splice(__position, __tmp);
+ }
+
+ /**
+ * @brief Inserts a range into the %list.
+ * @param position An iterator into the %list.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * This function will insert copies of the data in the range [@a
+ * first,@a last) into the %list before the location specified by
+ * @a position.
+ *
+ * This operation is linear in the number of elements inserted and
+ * does not invalidate iterators and references.
+ */
+ template<typename _InputIterator>
+ void
+ insert(iterator __position, _InputIterator __first,
+ _InputIterator __last)
+ {
+ list __tmp(__first, __last, _M_get_Node_allocator());
+ splice(__position, __tmp);
+ }
+
+ /**
+ * @brief Remove element at given position.
+ * @param position Iterator pointing to element to be erased.
+ * @return An iterator pointing to the next element (or end()).
+ *
+ * This function will erase the element at the given position and thus
+ * shorten the %list by one.
+ *
+ * Due to the nature of a %list this operation can be done in
+ * constant time, and only invalidates iterators/references to
+ * the element being removed. The user is also cautioned that
+ * this function only erases the element, and that if the element
+ * is itself a pointer, the pointed-to memory is not touched in
+ * any way. Managing the pointer is the user's responsibility.
+ */
+ iterator
+ erase(iterator __position);
+
+ /**
+ * @brief Remove a range of elements.
+ * @param first Iterator pointing to the first element to be erased.
+ * @param last Iterator pointing to one past the last element to be
+ * erased.
+ * @return An iterator pointing to the element pointed to by @a last
+ * prior to erasing (or end()).
+ *
+ * This function will erase the elements in the range @a
+ * [first,last) and shorten the %list accordingly.
+ *
+ * This operation is linear time in the size of the range and only
+ * invalidates iterators/references to the element being removed.
+ * The user is also cautioned that this function only erases the
+ * elements, and that if the elements themselves are pointers, the
+ * pointed-to memory is not touched in any way. Managing the pointer
+ * is the user's responsibility.
+ */
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ while (__first != __last)
+ __first = erase(__first);
+ return __last;
+ }
+
+ /**
+ * @brief Swaps data with another %list.
+ * @param x A %list of the same element and allocator types.
+ *
+ * This exchanges the elements between two lists in constant
+ * time. Note that the global std::swap() function is
+ * specialized such that std::swap(l1,l2) will feed to this
+ * function.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(list&& __x)
+#else
+ swap(list& __x)
+#endif
+ {
+ _List_node_base::swap(this->_M_impl._M_node, __x._M_impl._M_node);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 431. Swapping containers with unequal allocators.
+ std::__alloc_swap<typename _Base::_Node_alloc_type>::
+ _S_do_it(_M_get_Node_allocator(), __x._M_get_Node_allocator());
+ }
+
+ /**
+ * Erases all the elements. Note that this function only erases
+ * the elements, and that if the elements themselves are
+ * pointers, the pointed-to memory is not touched in any way.
+ * Managing the pointer is the user's responsibility.
+ */
+ void
+ clear()
+ {
+ _Base::_M_clear();
+ _Base::_M_init();
+ }
+
+ // [23.2.2.4] list operations
+ /**
+ * @brief Insert contents of another %list.
+ * @param position Iterator referencing the element to insert before.
+ * @param x Source list.
+ *
+ * The elements of @a x are inserted in constant time in front of
+ * the element referenced by @a position. @a x becomes an empty
+ * list.
+ *
+ * Requires this != @a x.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ splice(iterator __position, list&& __x)
+#else
+ splice(iterator __position, list& __x)
+#endif
+ {
+ if (!__x.empty())
+ {
+ _M_check_equal_allocators(__x);
+
+ this->_M_transfer(__position, __x.begin(), __x.end());
+ }
+ }
+
+ /**
+ * @brief Insert element from another %list.
+ * @param position Iterator referencing the element to insert before.
+ * @param x Source list.
+ * @param i Iterator referencing the element to move.
+ *
+ * Removes the element in list @a x referenced by @a i and
+ * inserts it into the current list before @a position.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ splice(iterator __position, list&& __x, iterator __i)
+#else
+ splice(iterator __position, list& __x, iterator __i)
+#endif
+ {
+ iterator __j = __i;
+ ++__j;
+ if (__position == __i || __position == __j)
+ return;
+
+ if (this != &__x)
+ _M_check_equal_allocators(__x);
+
+ this->_M_transfer(__position, __i, __j);
+ }
+
+ /**
+ * @brief Insert range from another %list.
+ * @param position Iterator referencing the element to insert before.
+ * @param x Source list.
+ * @param first Iterator referencing the start of range in x.
+ * @param last Iterator referencing the end of range in x.
+ *
+ * Removes elements in the range [first,last) and inserts them
+ * before @a position in constant time.
+ *
+ * Undefined if @a position is in [first,last).
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ splice(iterator __position, list&& __x, iterator __first,
+ iterator __last)
+#else
+ splice(iterator __position, list& __x, iterator __first,
+ iterator __last)
+#endif
+ {
+ if (__first != __last)
+ {
+ if (this != &__x)
+ _M_check_equal_allocators(__x);
+
+ this->_M_transfer(__position, __first, __last);
+ }
+ }
+
+ /**
+ * @brief Remove all elements equal to value.
+ * @param value The value to remove.
+ *
+ * Removes every element in the list equal to @a value.
+ * Remaining elements stay in list order. Note that this
+ * function only erases the elements, and that if the elements
+ * themselves are pointers, the pointed-to memory is not
+ * touched in any way. Managing the pointer is the user's
+ * responsibility.
+ */
+ void
+ remove(const _Tp& __value);
+
+ /**
+ * @brief Remove all elements satisfying a predicate.
+ * @param Predicate Unary predicate function or object.
+ *
+ * Removes every element in the list for which the predicate
+ * returns true. Remaining elements stay in list order. Note
+ * that this function only erases the elements, and that if the
+ * elements themselves are pointers, the pointed-to memory is
+ * not touched in any way. Managing the pointer is the user's
+ * responsibility.
+ */
+ template<typename _Predicate>
+ void
+ remove_if(_Predicate);
+
+ /**
+ * @brief Remove consecutive duplicate elements.
+ *
+ * For each consecutive set of elements with the same value,
+ * remove all but the first one. Remaining elements stay in
+ * list order. Note that this function only erases the
+ * elements, and that if the elements themselves are pointers,
+ * the pointed-to memory is not touched in any way. Managing
+ * the pointer is the user's responsibility.
+ */
+ void
+ unique();
+
+ /**
+ * @brief Remove consecutive elements satisfying a predicate.
+ * @param BinaryPredicate Binary predicate function or object.
+ *
+ * For each consecutive set of elements [first,last) that
+ * satisfy predicate(first,i) where i is an iterator in
+ * [first,last), remove all but the first one. Remaining
+ * elements stay in list order. Note that this function only
+ * erases the elements, and that if the elements themselves are
+ * pointers, the pointed-to memory is not touched in any way.
+ * Managing the pointer is the user's responsibility.
+ */
+ template<typename _BinaryPredicate>
+ void
+ unique(_BinaryPredicate);
+
+ /**
+ * @brief Merge sorted lists.
+ * @param x Sorted list to merge.
+ *
+ * Assumes that both @a x and this list are sorted according to
+ * operator<(). Merges elements of @a x into this list in
+ * sorted order, leaving @a x empty when complete. Elements in
+ * this list precede elements in @a x that are equal.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ merge(list&& __x);
+#else
+ merge(list& __x);
+#endif
+
+ /**
+ * @brief Merge sorted lists according to comparison function.
+ * @param x Sorted list to merge.
+ * @param StrictWeakOrdering Comparison function defining
+ * sort order.
+ *
+ * Assumes that both @a x and this list are sorted according to
+ * StrictWeakOrdering. Merges elements of @a x into this list
+ * in sorted order, leaving @a x empty when complete. Elements
+ * in this list precede elements in @a x that are equivalent
+ * according to StrictWeakOrdering().
+ */
+ template<typename _StrictWeakOrdering>
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ merge(list&&, _StrictWeakOrdering);
+#else
+ merge(list&, _StrictWeakOrdering);
+#endif
+
+ /**
+ * @brief Reverse the elements in list.
+ *
+ * Reverse the order of elements in the list in linear time.
+ */
+ void
+ reverse()
+ { this->_M_impl._M_node.reverse(); }
+
+ /**
+ * @brief Sort the elements.
+ *
+ * Sorts the elements of this list in NlogN time. Equivalent
+ * elements remain in list order.
+ */
+ void
+ sort();
+
+ /**
+ * @brief Sort the elements according to comparison function.
+ *
+ * Sorts the elements of this list in NlogN time. Equivalent
+ * elements remain in list order.
+ */
+ template<typename _StrictWeakOrdering>
+ void
+ sort(_StrictWeakOrdering);
+
+ protected:
+ // Internal constructor functions follow.
+
+ // Called by the range constructor to implement [23.1.1]/9
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
+ { _M_fill_initialize(static_cast<size_type>(__n), __x); }
+
+ // Called by the range constructor to implement [23.1.1]/9
+ template<typename _InputIterator>
+ void
+ _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type)
+ {
+ for (; __first != __last; ++__first)
+ push_back(*__first);
+ }
+
+ // Called by list(n,v,a), and the range constructor when it turns out
+ // to be the same thing.
+ void
+ _M_fill_initialize(size_type __n, const value_type& __x)
+ {
+ for (; __n > 0; --__n)
+ push_back(__x);
+ }
+
+
+ // Internal assign functions follow.
+
+ // Called by the range assign to implement [23.1.1]/9
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
+ { _M_fill_assign(__n, __val); }
+
+ // Called by the range assign to implement [23.1.1]/9
+ template<typename _InputIterator>
+ void
+ _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type);
+
+ // Called by assign(n,t), and the range assign when it turns out
+ // to be the same thing.
+ void
+ _M_fill_assign(size_type __n, const value_type& __val);
+
+
+ // Moves the elements from [first,last) before position.
+ void
+ _M_transfer(iterator __position, iterator __first, iterator __last)
+ { __position._M_node->transfer(__first._M_node, __last._M_node); }
+
+ // Inserts new element at position given and with value given.
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ _M_insert(iterator __position, const value_type& __x)
+ {
+ _Node* __tmp = _M_create_node(__x);
+ __tmp->hook(__position._M_node);
+ }
+#else
+ template<typename... _Args>
+ void
+ _M_insert(iterator __position, _Args&&... __args)
+ {
+ _Node* __tmp = _M_create_node(std::forward<_Args>(__args)...);
+ __tmp->hook(__position._M_node);
+ }
+#endif
+
+ // Erases element at position given.
+ void
+ _M_erase(iterator __position)
+ {
+ __position._M_node->unhook();
+ _Node* __n = static_cast<_Node*>(__position._M_node);
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ _M_get_Node_allocator().destroy(__n);
+#else
+ _M_get_Tp_allocator().destroy(&__n->_M_data);
+#endif
+ _M_put_node(__n);
+ }
+
+ // To implement the splice (and merge) bits of N1599.
+ void
+ _M_check_equal_allocators(list& __x)
+ {
+ if (std::__alloc_neq<typename _Base::_Node_alloc_type>::
+ _S_do_it(_M_get_Node_allocator(), __x._M_get_Node_allocator()))
+ __throw_runtime_error(__N("list::_M_check_equal_allocators"));
+ }
+ };
+
+ /**
+ * @brief List equality comparison.
+ * @param x A %list.
+ * @param y A %list of the same type as @a x.
+ * @return True iff the size and elements of the lists are equal.
+ *
+ * This is an equivalence relation. It is linear in the size of
+ * the lists. Lists are considered equivalent if their sizes are
+ * equal, and if corresponding elements compare equal.
+ */
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator==(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+ {
+ typedef typename list<_Tp, _Alloc>::const_iterator const_iterator;
+ const_iterator __end1 = __x.end();
+ const_iterator __end2 = __y.end();
+
+ const_iterator __i1 = __x.begin();
+ const_iterator __i2 = __y.begin();
+ while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2)
+ {
+ ++__i1;
+ ++__i2;
+ }
+ return __i1 == __end1 && __i2 == __end2;
+ }
+
+ /**
+ * @brief List ordering relation.
+ * @param x A %list.
+ * @param y A %list of the same type as @a x.
+ * @return True iff @a x is lexicographically less than @a y.
+ *
+ * This is a total ordering relation. It is linear in the size of the
+ * lists. The elements must be comparable with @c <.
+ *
+ * See std::lexicographical_compare() for how the determination is made.
+ */
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+ { return std::lexicographical_compare(__x.begin(), __x.end(),
+ __y.begin(), __y.end()); }
+
+ /// Based on operator==
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator!=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+ { return __y < __x; }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ /// See std::list::swap().
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y)
+ { __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(list<_Tp, _Alloc>&& __x, list<_Tp, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _STL_LIST_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_map.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_map.h
new file mode 100644
index 0000000..90e5239
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_map.h
@@ -0,0 +1,871 @@
+// Map implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_map.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_MAP_H
+#define _STL_MAP_H 1
+
+#include <bits/functexcept.h>
+#include <bits/concept_check.h>
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ /**
+ * @brief A standard container made up of (key,value) pairs, which can be
+ * retrieved based on a key, in logarithmic time.
+ *
+ * @ingroup associative_containers
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, a
+ * <a href="tables.html#66">reversible container</a>, and an
+ * <a href="tables.html#69">associative container</a> (using unique keys).
+ * For a @c map<Key,T> the key_type is Key, the mapped_type is T, and the
+ * value_type is std::pair<const Key,T>.
+ *
+ * Maps support bidirectional iterators.
+ *
+ * The private tree data is declared exactly the same way for map and
+ * multimap; the distinction is made entirely in how the tree functions are
+ * called (*_unique versus *_equal, same as the standard).
+ */
+ template <typename _Key, typename _Tp, typename _Compare = std::less<_Key>,
+ typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
+ class map
+ {
+ public:
+ typedef _Key key_type;
+ typedef _Tp mapped_type;
+ typedef std::pair<const _Key, _Tp> value_type;
+ typedef _Compare key_compare;
+ typedef _Alloc allocator_type;
+
+ private:
+ // concept requirements
+ typedef typename _Alloc::value_type _Alloc_value_type;
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires4(_Compare, bool, _Key, _Key,
+ _BinaryFunctionConcept)
+ __glibcxx_class_requires2(value_type, _Alloc_value_type, _SameTypeConcept)
+
+ public:
+ class value_compare
+ : public std::binary_function<value_type, value_type, bool>
+ {
+ friend class map<_Key, _Tp, _Compare, _Alloc>;
+ protected:
+ _Compare comp;
+
+ value_compare(_Compare __c)
+ : comp(__c) { }
+
+ public:
+ bool operator()(const value_type& __x, const value_type& __y) const
+ { return comp(__x.first, __y.first); }
+ };
+
+ private:
+ /// This turns a red-black tree into a [multi]map.
+ typedef typename _Alloc::template rebind<value_type>::other
+ _Pair_alloc_type;
+
+ typedef _Rb_tree<key_type, value_type, _Select1st<value_type>,
+ key_compare, _Pair_alloc_type> _Rep_type;
+
+ /// The actual tree structure.
+ _Rep_type _M_t;
+
+ public:
+ // many of these are specified differently in ISO, but the following are
+ // "functionally equivalent"
+ typedef typename _Pair_alloc_type::pointer pointer;
+ typedef typename _Pair_alloc_type::const_pointer const_pointer;
+ typedef typename _Pair_alloc_type::reference reference;
+ typedef typename _Pair_alloc_type::const_reference const_reference;
+ typedef typename _Rep_type::iterator iterator;
+ typedef typename _Rep_type::const_iterator const_iterator;
+ typedef typename _Rep_type::size_type size_type;
+ typedef typename _Rep_type::difference_type difference_type;
+ typedef typename _Rep_type::reverse_iterator reverse_iterator;
+ typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
+
+ // [23.3.1.1] construct/copy/destroy
+ // (get_allocator() is normally listed in this section, but seems to have
+ // been accidentally omitted in the printed standard)
+ /**
+ * @brief Default constructor creates no elements.
+ */
+ map()
+ : _M_t() { }
+
+ /**
+ * @brief Creates a %map with no elements.
+ * @param comp A comparison object.
+ * @param a An allocator object.
+ */
+ explicit
+ map(const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a) { }
+
+ /**
+ * @brief %Map copy constructor.
+ * @param x A %map of identical element and allocator types.
+ *
+ * The newly-created %map uses a copy of the allocation object
+ * used by @a x.
+ */
+ map(const map& __x)
+ : _M_t(__x._M_t) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Map move constructor.
+ * @param x A %map of identical element and allocator types.
+ *
+ * The newly-created %map contains the exact contents of @a x.
+ * The contents of @a x are a valid, but unspecified %map.
+ */
+ map(map&& __x)
+ : _M_t(std::forward<_Rep_type>(__x._M_t)) { }
+
+ /**
+ * @brief Builds a %map from an initializer_list.
+ * @param l An initializer_list.
+ * @param comp A comparison object.
+ * @param a An allocator object.
+ *
+ * Create a %map consisting of copies of the elements in the
+ * initializer_list @a l.
+ * This is linear in N if the range is already sorted, and NlogN
+ * otherwise (where N is @a l.size()).
+ */
+ map(initializer_list<value_type> __l,
+ const _Compare& __c = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _M_t(__c, __a)
+ { _M_t._M_insert_unique(__l.begin(), __l.end()); }
+#endif
+
+ /**
+ * @brief Builds a %map from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * Create a %map consisting of copies of the elements from [first,last).
+ * This is linear in N if the range is already sorted, and NlogN
+ * otherwise (where N is distance(first,last)).
+ */
+ template<typename _InputIterator>
+ map(_InputIterator __first, _InputIterator __last)
+ : _M_t()
+ { _M_t._M_insert_unique(__first, __last); }
+
+ /**
+ * @brief Builds a %map from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param comp A comparison functor.
+ * @param a An allocator object.
+ *
+ * Create a %map consisting of copies of the elements from [first,last).
+ * This is linear in N if the range is already sorted, and NlogN
+ * otherwise (where N is distance(first,last)).
+ */
+ template<typename _InputIterator>
+ map(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_unique(__first, __last); }
+
+ // FIXME There is no dtor declared, but we should have something
+ // generated by Doxygen. I don't know what tags to add to this
+ // paragraph to make that happen:
+ /**
+ * The dtor only erases the elements, and note that if the elements
+ * themselves are pointers, the pointed-to memory is not touched in any
+ * way. Managing the pointer is the user's responsibility.
+ */
+
+ /**
+ * @brief %Map assignment operator.
+ * @param x A %map of identical element and allocator types.
+ *
+ * All the elements of @a x are copied, but unlike the copy constructor,
+ * the allocator object is not copied.
+ */
+ map&
+ operator=(const map& __x)
+ {
+ _M_t = __x._M_t;
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Map move assignment operator.
+ * @param x A %map of identical element and allocator types.
+ *
+ * The contents of @a x are moved into this map (without copying).
+ * @a x is a valid, but unspecified %map.
+ */
+ map&
+ operator=(map&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ /**
+ * @brief %Map list assignment operator.
+ * @param l An initializer_list.
+ *
+ * This function fills a %map with copies of the elements in the
+ * initializer list @a l.
+ *
+ * Note that the assignment completely changes the %map and
+ * that the resulting %map's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ map&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+
+ /// Get a copy of the memory allocation object.
+ allocator_type
+ get_allocator() const
+ { return _M_t.get_allocator(); }
+
+ // iterators
+ /**
+ * Returns a read/write iterator that points to the first pair in the
+ * %map.
+ * Iteration is done in ascending order according to the keys.
+ */
+ iterator
+ begin()
+ { return _M_t.begin(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the first pair
+ * in the %map. Iteration is done in ascending order according to the
+ * keys.
+ */
+ const_iterator
+ begin() const
+ { return _M_t.begin(); }
+
+ /**
+ * Returns a read/write iterator that points one past the last
+ * pair in the %map. Iteration is done in ascending order
+ * according to the keys.
+ */
+ iterator
+ end()
+ { return _M_t.end(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the last
+ * pair in the %map. Iteration is done in ascending order according to
+ * the keys.
+ */
+ const_iterator
+ end() const
+ { return _M_t.end(); }
+
+ /**
+ * Returns a read/write reverse iterator that points to the last pair in
+ * the %map. Iteration is done in descending order according to the
+ * keys.
+ */
+ reverse_iterator
+ rbegin()
+ { return _M_t.rbegin(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to the
+ * last pair in the %map. Iteration is done in descending order
+ * according to the keys.
+ */
+ const_reverse_iterator
+ rbegin() const
+ { return _M_t.rbegin(); }
+
+ /**
+ * Returns a read/write reverse iterator that points to one before the
+ * first pair in the %map. Iteration is done in descending order
+ * according to the keys.
+ */
+ reverse_iterator
+ rend()
+ { return _M_t.rend(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to one
+ * before the first pair in the %map. Iteration is done in descending
+ * order according to the keys.
+ */
+ const_reverse_iterator
+ rend() const
+ { return _M_t.rend(); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * Returns a read-only (constant) iterator that points to the first pair
+ * in the %map. Iteration is done in ascending order according to the
+ * keys.
+ */
+ const_iterator
+ cbegin() const
+ { return _M_t.begin(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the last
+ * pair in the %map. Iteration is done in ascending order according to
+ * the keys.
+ */
+ const_iterator
+ cend() const
+ { return _M_t.end(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to the
+ * last pair in the %map. Iteration is done in descending order
+ * according to the keys.
+ */
+ const_reverse_iterator
+ crbegin() const
+ { return _M_t.rbegin(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to one
+ * before the first pair in the %map. Iteration is done in descending
+ * order according to the keys.
+ */
+ const_reverse_iterator
+ crend() const
+ { return _M_t.rend(); }
+#endif
+
+ // capacity
+ /** Returns true if the %map is empty. (Thus begin() would equal
+ * end().)
+ */
+ bool
+ empty() const
+ { return _M_t.empty(); }
+
+ /** Returns the size of the %map. */
+ size_type
+ size() const
+ { return _M_t.size(); }
+
+ /** Returns the maximum size of the %map. */
+ size_type
+ max_size() const
+ { return _M_t.max_size(); }
+
+ // [23.3.1.2] element access
+ /**
+ * @brief Subscript ( @c [] ) access to %map data.
+ * @param k The key for which data should be retrieved.
+ * @return A reference to the data of the (key,data) %pair.
+ *
+ * Allows for easy lookup with the subscript ( @c [] )
+ * operator. Returns data associated with the key specified in
+ * subscript. If the key does not exist, a pair with that key
+ * is created using default values, which is then returned.
+ *
+ * Lookup requires logarithmic time.
+ */
+ mapped_type&
+ operator[](const key_type& __k)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_DefaultConstructibleConcept<mapped_type>)
+
+ iterator __i = lower_bound(__k);
+ // __i->first is greater than or equivalent to __k.
+ if (__i == end() || key_comp()(__k, (*__i).first))
+ __i = insert(__i, value_type(__k, mapped_type()));
+ return (*__i).second;
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 464. Suggestion for new member functions in standard containers.
+ /**
+ * @brief Access to %map data.
+ * @param k The key for which data should be retrieved.
+ * @return A reference to the data whose key is equivalent to @a k, if
+ * such a data is present in the %map.
+ * @throw std::out_of_range If no such data is present.
+ */
+ mapped_type&
+ at(const key_type& __k)
+ {
+ iterator __i = lower_bound(__k);
+ if (__i == end() || key_comp()(__k, (*__i).first))
+ __throw_out_of_range(__N("map::at"));
+ return (*__i).second;
+ }
+
+ const mapped_type&
+ at(const key_type& __k) const
+ {
+ const_iterator __i = lower_bound(__k);
+ if (__i == end() || key_comp()(__k, (*__i).first))
+ __throw_out_of_range(__N("map::at"));
+ return (*__i).second;
+ }
+
+ // modifiers
+ /**
+ * @brief Attempts to insert a std::pair into the %map.
+
+ * @param x Pair to be inserted (see std::make_pair for easy creation
+ * of pairs).
+
+ * @return A pair, of which the first element is an iterator that
+ * points to the possibly inserted pair, and the second is
+ * a bool that is true if the pair was actually inserted.
+ *
+ * This function attempts to insert a (key, value) %pair into the %map.
+ * A %map relies on unique keys and thus a %pair is only inserted if its
+ * first element (the key) is not already present in the %map.
+ *
+ * Insertion requires logarithmic time.
+ */
+ std::pair<iterator, bool>
+ insert(const value_type& __x)
+ { return _M_t._M_insert_unique(__x); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Attempts to insert a list of std::pairs into the %map.
+ * @param list A std::initializer_list<value_type> of pairs to be
+ * inserted.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ void
+ insert(std::initializer_list<value_type> __list)
+ { insert (__list.begin(), __list.end()); }
+#endif
+
+ /**
+ * @brief Attempts to insert a std::pair into the %map.
+ * @param position An iterator that serves as a hint as to where the
+ * pair should be inserted.
+ * @param x Pair to be inserted (see std::make_pair for easy creation
+ * of pairs).
+ * @return An iterator that points to the element with key of @a x (may
+ * or may not be the %pair passed in).
+ *
+
+ * This function is not concerned about whether the insertion
+ * took place, and thus does not return a boolean like the
+ * single-argument insert() does. Note that the first
+ * parameter is only a hint and can potentially improve the
+ * performance of the insertion process. A bad hint would
+ * cause no gains in efficiency.
+ *
+ * See
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html
+ * for more on "hinting".
+ *
+ * Insertion requires logarithmic time (if the hint is not taken).
+ */
+ iterator
+ insert(iterator __position, const value_type& __x)
+ { return _M_t._M_insert_unique_(__position, __x); }
+
+ /**
+ * @brief Template function that attempts to insert a range of elements.
+ * @param first Iterator pointing to the start of the range to be
+ * inserted.
+ * @param last Iterator pointing to the end of the range.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ { _M_t._M_insert_unique(__first, __last); }
+
+ /**
+ * @brief Erases an element from a %map.
+ * @param position An iterator pointing to the element to be erased.
+ *
+ * This function erases an element, pointed to by the given
+ * iterator, from a %map. Note that this function only erases
+ * the element, and that if the element is itself a pointer,
+ * the pointed-to memory is not touched in any way. Managing
+ * the pointer is the user's responsibility.
+ */
+ void
+ erase(iterator __position)
+ { _M_t.erase(__position); }
+
+ /**
+ * @brief Erases elements according to the provided key.
+ * @param x Key of element to be erased.
+ * @return The number of elements erased.
+ *
+ * This function erases all the elements located by the given key from
+ * a %map.
+ * Note that this function only erases the element, and that if
+ * the element is itself a pointer, the pointed-to memory is not touched
+ * in any way. Managing the pointer is the user's responsibility.
+ */
+ size_type
+ erase(const key_type& __x)
+ { return _M_t.erase(__x); }
+
+ /**
+ * @brief Erases a [first,last) range of elements from a %map.
+ * @param first Iterator pointing to the start of the range to be
+ * erased.
+ * @param last Iterator pointing to the end of the range to be erased.
+ *
+ * This function erases a sequence of elements from a %map.
+ * Note that this function only erases the element, and that if
+ * the element is itself a pointer, the pointed-to memory is not touched
+ * in any way. Managing the pointer is the user's responsibility.
+ */
+ void
+ erase(iterator __first, iterator __last)
+ { _M_t.erase(__first, __last); }
+
+ /**
+ * @brief Swaps data with another %map.
+ * @param x A %map of the same element and allocator types.
+ *
+ * This exchanges the elements between two maps in constant
+ * time. (It is only swapping a pointer, an integer, and an
+ * instance of the @c Compare type (which itself is often
+ * stateless and empty), so it should be quite fast.) Note
+ * that the global std::swap() function is specialized such
+ * that std::swap(m1,m2) will feed to this function.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(map&& __x)
+#else
+ swap(map& __x)
+#endif
+ { _M_t.swap(__x._M_t); }
+
+ /**
+ * Erases all elements in a %map. Note that this function only
+ * erases the elements, and that if the elements themselves are
+ * pointers, the pointed-to memory is not touched in any way.
+ * Managing the pointer is the user's responsibility.
+ */
+ void
+ clear()
+ { _M_t.clear(); }
+
+ // observers
+ /**
+ * Returns the key comparison object out of which the %map was
+ * constructed.
+ */
+ key_compare
+ key_comp() const
+ { return _M_t.key_comp(); }
+
+ /**
+ * Returns a value comparison object, built from the key comparison
+ * object out of which the %map was constructed.
+ */
+ value_compare
+ value_comp() const
+ { return value_compare(_M_t.key_comp()); }
+
+ // [23.3.1.3] map operations
+ /**
+ * @brief Tries to locate an element in a %map.
+ * @param x Key of (key, value) %pair to be located.
+ * @return Iterator pointing to sought-after element, or end() if not
+ * found.
+ *
+ * This function takes a key and tries to locate the element with which
+ * the key matches. If successful the function returns an iterator
+ * pointing to the sought after %pair. If unsuccessful it returns the
+ * past-the-end ( @c end() ) iterator.
+ */
+ iterator
+ find(const key_type& __x)
+ { return _M_t.find(__x); }
+
+ /**
+ * @brief Tries to locate an element in a %map.
+ * @param x Key of (key, value) %pair to be located.
+ * @return Read-only (constant) iterator pointing to sought-after
+ * element, or end() if not found.
+ *
+ * This function takes a key and tries to locate the element with which
+ * the key matches. If successful the function returns a constant
+ * iterator pointing to the sought after %pair. If unsuccessful it
+ * returns the past-the-end ( @c end() ) iterator.
+ */
+ const_iterator
+ find(const key_type& __x) const
+ { return _M_t.find(__x); }
+
+ /**
+ * @brief Finds the number of elements with given key.
+ * @param x Key of (key, value) pairs to be located.
+ * @return Number of elements with specified key.
+ *
+ * This function only makes sense for multimaps; for map the result will
+ * either be 0 (not present) or 1 (present).
+ */
+ size_type
+ count(const key_type& __x) const
+ { return _M_t.find(__x) == _M_t.end() ? 0 : 1; }
+
+ /**
+ * @brief Finds the beginning of a subsequence matching given key.
+ * @param x Key of (key, value) pair to be located.
+ * @return Iterator pointing to first element equal to or greater
+ * than key, or end().
+ *
+ * This function returns the first element of a subsequence of elements
+ * that matches the given key. If unsuccessful it returns an iterator
+ * pointing to the first element that has a greater value than given key
+ * or end() if no such element exists.
+ */
+ iterator
+ lower_bound(const key_type& __x)
+ { return _M_t.lower_bound(__x); }
+
+ /**
+ * @brief Finds the beginning of a subsequence matching given key.
+ * @param x Key of (key, value) pair to be located.
+ * @return Read-only (constant) iterator pointing to first element
+ * equal to or greater than key, or end().
+ *
+ * This function returns the first element of a subsequence of elements
+ * that matches the given key. If unsuccessful it returns an iterator
+ * pointing to the first element that has a greater value than given key
+ * or end() if no such element exists.
+ */
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return _M_t.lower_bound(__x); }
+
+ /**
+ * @brief Finds the end of a subsequence matching given key.
+ * @param x Key of (key, value) pair to be located.
+ * @return Iterator pointing to the first element
+ * greater than key, or end().
+ */
+ iterator
+ upper_bound(const key_type& __x)
+ { return _M_t.upper_bound(__x); }
+
+ /**
+ * @brief Finds the end of a subsequence matching given key.
+ * @param x Key of (key, value) pair to be located.
+ * @return Read-only (constant) iterator pointing to first iterator
+ * greater than key, or end().
+ */
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return _M_t.upper_bound(__x); }
+
+ /**
+ * @brief Finds a subsequence matching given key.
+ * @param x Key of (key, value) pairs to be located.
+ * @return Pair of iterators that possibly points to the subsequence
+ * matching given key.
+ *
+ * This function is equivalent to
+ * @code
+ * std::make_pair(c.lower_bound(val),
+ * c.upper_bound(val))
+ * @endcode
+ * (but is faster than making the calls separately).
+ *
+ * This function probably only makes sense for multimaps.
+ */
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __x)
+ { return _M_t.equal_range(__x); }
+
+ /**
+ * @brief Finds a subsequence matching given key.
+ * @param x Key of (key, value) pairs to be located.
+ * @return Pair of read-only (constant) iterators that possibly points
+ * to the subsequence matching given key.
+ *
+ * This function is equivalent to
+ * @code
+ * std::make_pair(c.lower_bound(val),
+ * c.upper_bound(val))
+ * @endcode
+ * (but is faster than making the calls separately).
+ *
+ * This function probably only makes sense for multimaps.
+ */
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __x) const
+ { return _M_t.equal_range(__x); }
+
+ template<typename _K1, typename _T1, typename _C1, typename _A1>
+ friend bool
+ operator==(const map<_K1, _T1, _C1, _A1>&,
+ const map<_K1, _T1, _C1, _A1>&);
+
+ template<typename _K1, typename _T1, typename _C1, typename _A1>
+ friend bool
+ operator<(const map<_K1, _T1, _C1, _A1>&,
+ const map<_K1, _T1, _C1, _A1>&);
+ };
+
+ /**
+ * @brief Map equality comparison.
+ * @param x A %map.
+ * @param y A %map of the same type as @a x.
+ * @return True iff the size and elements of the maps are equal.
+ *
+ * This is an equivalence relation. It is linear in the size of the
+ * maps. Maps are considered equivalent if their sizes are equal,
+ * and if corresponding elements compare equal.
+ */
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator==(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+ const map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return __x._M_t == __y._M_t; }
+
+ /**
+ * @brief Map ordering relation.
+ * @param x A %map.
+ * @param y A %map of the same type as @a x.
+ * @return True iff @a x is lexicographically less than @a y.
+ *
+ * This is a total ordering relation. It is linear in the size of the
+ * maps. The elements must be comparable with @c <.
+ *
+ * See std::lexicographical_compare() for how the determination is made.
+ */
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator<(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+ const map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return __x._M_t < __y._M_t; }
+
+ /// Based on operator==
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator!=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+ const map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ /// Based on operator<
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator>(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+ const map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return __y < __x; }
+
+ /// Based on operator<
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator<=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+ const map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ /// Based on operator<
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator>=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+ const map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ /// See std::map::swap().
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline void
+ swap(map<_Key, _Tp, _Compare, _Alloc>& __x,
+ map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline void
+ swap(map<_Key, _Tp, _Compare, _Alloc>&& __x,
+ map<_Key, _Tp, _Compare, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline void
+ swap(map<_Key, _Tp, _Compare, _Alloc>& __x,
+ map<_Key, _Tp, _Compare, _Alloc>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _STL_MAP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_multimap.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_multimap.h
new file mode 100644
index 0000000..484537c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_multimap.h
@@ -0,0 +1,800 @@
+// Multimap implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_multimap.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_MULTIMAP_H
+#define _STL_MULTIMAP_H 1
+
+#include <bits/concept_check.h>
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ /**
+ * @brief A standard container made up of (key,value) pairs, which can be
+ * retrieved based on a key, in logarithmic time.
+ *
+ * @ingroup associative_containers
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, a
+ * <a href="tables.html#66">reversible container</a>, and an
+ * <a href="tables.html#69">associative container</a> (using equivalent
+ * keys). For a @c multimap<Key,T> the key_type is Key, the mapped_type
+ * is T, and the value_type is std::pair<const Key,T>.
+ *
+ * Multimaps support bidirectional iterators.
+ *
+ * The private tree data is declared exactly the same way for map and
+ * multimap; the distinction is made entirely in how the tree functions are
+ * called (*_unique versus *_equal, same as the standard).
+ */
+ template <typename _Key, typename _Tp,
+ typename _Compare = std::less<_Key>,
+ typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
+ class multimap
+ {
+ public:
+ typedef _Key key_type;
+ typedef _Tp mapped_type;
+ typedef std::pair<const _Key, _Tp> value_type;
+ typedef _Compare key_compare;
+ typedef _Alloc allocator_type;
+
+ private:
+ // concept requirements
+ typedef typename _Alloc::value_type _Alloc_value_type;
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires4(_Compare, bool, _Key, _Key,
+ _BinaryFunctionConcept)
+ __glibcxx_class_requires2(value_type, _Alloc_value_type, _SameTypeConcept)
+
+ public:
+ class value_compare
+ : public std::binary_function<value_type, value_type, bool>
+ {
+ friend class multimap<_Key, _Tp, _Compare, _Alloc>;
+ protected:
+ _Compare comp;
+
+ value_compare(_Compare __c)
+ : comp(__c) { }
+
+ public:
+ bool operator()(const value_type& __x, const value_type& __y) const
+ { return comp(__x.first, __y.first); }
+ };
+
+ private:
+ /// This turns a red-black tree into a [multi]map.
+ typedef typename _Alloc::template rebind<value_type>::other
+ _Pair_alloc_type;
+
+ typedef _Rb_tree<key_type, value_type, _Select1st<value_type>,
+ key_compare, _Pair_alloc_type> _Rep_type;
+ /// The actual tree structure.
+ _Rep_type _M_t;
+
+ public:
+ // many of these are specified differently in ISO, but the following are
+ // "functionally equivalent"
+ typedef typename _Pair_alloc_type::pointer pointer;
+ typedef typename _Pair_alloc_type::const_pointer const_pointer;
+ typedef typename _Pair_alloc_type::reference reference;
+ typedef typename _Pair_alloc_type::const_reference const_reference;
+ typedef typename _Rep_type::iterator iterator;
+ typedef typename _Rep_type::const_iterator const_iterator;
+ typedef typename _Rep_type::size_type size_type;
+ typedef typename _Rep_type::difference_type difference_type;
+ typedef typename _Rep_type::reverse_iterator reverse_iterator;
+ typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
+
+ // [23.3.2] construct/copy/destroy
+ // (get_allocator() is also listed in this section)
+ /**
+ * @brief Default constructor creates no elements.
+ */
+ multimap()
+ : _M_t() { }
+
+ /**
+ * @brief Creates a %multimap with no elements.
+ * @param comp A comparison object.
+ * @param a An allocator object.
+ */
+ explicit
+ multimap(const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a) { }
+
+ /**
+ * @brief %Multimap copy constructor.
+ * @param x A %multimap of identical element and allocator types.
+ *
+ * The newly-created %multimap uses a copy of the allocation object
+ * used by @a x.
+ */
+ multimap(const multimap& __x)
+ : _M_t(__x._M_t) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Multimap move constructor.
+ * @param x A %multimap of identical element and allocator types.
+ *
+ * The newly-created %multimap contains the exact contents of @a x.
+ * The contents of @a x are a valid, but unspecified %multimap.
+ */
+ multimap(multimap&& __x)
+ : _M_t(std::forward<_Rep_type>(__x._M_t)) { }
+
+ /**
+ * @brief Builds a %multimap from an initializer_list.
+ * @param l An initializer_list.
+ * @param comp A comparison functor.
+ * @param a An allocator object.
+ *
+ * Create a %multimap consisting of copies of the elements from
+ * the initializer_list. This is linear in N if the list is already
+ * sorted, and NlogN otherwise (where N is @a __l.size()).
+ */
+ multimap(initializer_list<value_type> __l,
+ const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_equal(__l.begin(), __l.end()); }
+#endif
+
+ /**
+ * @brief Builds a %multimap from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * Create a %multimap consisting of copies of the elements from
+ * [first,last). This is linear in N if the range is already sorted,
+ * and NlogN otherwise (where N is distance(first,last)).
+ */
+ template<typename _InputIterator>
+ multimap(_InputIterator __first, _InputIterator __last)
+ : _M_t()
+ { _M_t._M_insert_equal(__first, __last); }
+
+ /**
+ * @brief Builds a %multimap from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param comp A comparison functor.
+ * @param a An allocator object.
+ *
+ * Create a %multimap consisting of copies of the elements from
+ * [first,last). This is linear in N if the range is already sorted,
+ * and NlogN otherwise (where N is distance(first,last)).
+ */
+ template<typename _InputIterator>
+ multimap(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_equal(__first, __last); }
+
+ // FIXME There is no dtor declared, but we should have something generated
+ // by Doxygen. I don't know what tags to add to this paragraph to make
+ // that happen:
+ /**
+ * The dtor only erases the elements, and note that if the elements
+ * themselves are pointers, the pointed-to memory is not touched in any
+ * way. Managing the pointer is the user's responsibility.
+ */
+
+ /**
+ * @brief %Multimap assignment operator.
+ * @param x A %multimap of identical element and allocator types.
+ *
+ * All the elements of @a x are copied, but unlike the copy constructor,
+ * the allocator object is not copied.
+ */
+ multimap&
+ operator=(const multimap& __x)
+ {
+ _M_t = __x._M_t;
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Multimap move assignment operator.
+ * @param x A %multimap of identical element and allocator types.
+ *
+ * The contents of @a x are moved into this multimap (without copying).
+ * @a x is a valid, but unspecified multimap.
+ */
+ multimap&
+ operator=(multimap&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ /**
+ * @brief %Multimap list assignment operator.
+ * @param l An initializer_list.
+ *
+ * This function fills a %multimap with copies of the elements
+ * in the initializer list @a l.
+ *
+ * Note that the assignment completely changes the %multimap and
+ * that the resulting %multimap's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ multimap&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+
+ /// Get a copy of the memory allocation object.
+ allocator_type
+ get_allocator() const
+ { return _M_t.get_allocator(); }
+
+ // iterators
+ /**
+ * Returns a read/write iterator that points to the first pair in the
+ * %multimap. Iteration is done in ascending order according to the
+ * keys.
+ */
+ iterator
+ begin()
+ { return _M_t.begin(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the first pair
+ * in the %multimap. Iteration is done in ascending order according to
+ * the keys.
+ */
+ const_iterator
+ begin() const
+ { return _M_t.begin(); }
+
+ /**
+ * Returns a read/write iterator that points one past the last pair in
+ * the %multimap. Iteration is done in ascending order according to the
+ * keys.
+ */
+ iterator
+ end()
+ { return _M_t.end(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the last
+ * pair in the %multimap. Iteration is done in ascending order according
+ * to the keys.
+ */
+ const_iterator
+ end() const
+ { return _M_t.end(); }
+
+ /**
+ * Returns a read/write reverse iterator that points to the last pair in
+ * the %multimap. Iteration is done in descending order according to the
+ * keys.
+ */
+ reverse_iterator
+ rbegin()
+ { return _M_t.rbegin(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to the
+ * last pair in the %multimap. Iteration is done in descending order
+ * according to the keys.
+ */
+ const_reverse_iterator
+ rbegin() const
+ { return _M_t.rbegin(); }
+
+ /**
+ * Returns a read/write reverse iterator that points to one before the
+ * first pair in the %multimap. Iteration is done in descending order
+ * according to the keys.
+ */
+ reverse_iterator
+ rend()
+ { return _M_t.rend(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to one
+ * before the first pair in the %multimap. Iteration is done in
+ * descending order according to the keys.
+ */
+ const_reverse_iterator
+ rend() const
+ { return _M_t.rend(); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * Returns a read-only (constant) iterator that points to the first pair
+ * in the %multimap. Iteration is done in ascending order according to
+ * the keys.
+ */
+ const_iterator
+ cbegin() const
+ { return _M_t.begin(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the last
+ * pair in the %multimap. Iteration is done in ascending order according
+ * to the keys.
+ */
+ const_iterator
+ cend() const
+ { return _M_t.end(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to the
+ * last pair in the %multimap. Iteration is done in descending order
+ * according to the keys.
+ */
+ const_reverse_iterator
+ crbegin() const
+ { return _M_t.rbegin(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to one
+ * before the first pair in the %multimap. Iteration is done in
+ * descending order according to the keys.
+ */
+ const_reverse_iterator
+ crend() const
+ { return _M_t.rend(); }
+#endif
+
+ // capacity
+ /** Returns true if the %multimap is empty. */
+ bool
+ empty() const
+ { return _M_t.empty(); }
+
+ /** Returns the size of the %multimap. */
+ size_type
+ size() const
+ { return _M_t.size(); }
+
+ /** Returns the maximum size of the %multimap. */
+ size_type
+ max_size() const
+ { return _M_t.max_size(); }
+
+ // modifiers
+ /**
+ * @brief Inserts a std::pair into the %multimap.
+ * @param x Pair to be inserted (see std::make_pair for easy creation
+ * of pairs).
+ * @return An iterator that points to the inserted (key,value) pair.
+ *
+ * This function inserts a (key, value) pair into the %multimap.
+ * Contrary to a std::map the %multimap does not rely on unique keys and
+ * thus multiple pairs with the same key can be inserted.
+ *
+ * Insertion requires logarithmic time.
+ */
+ iterator
+ insert(const value_type& __x)
+ { return _M_t._M_insert_equal(__x); }
+
+ /**
+ * @brief Inserts a std::pair into the %multimap.
+ * @param position An iterator that serves as a hint as to where the
+ * pair should be inserted.
+ * @param x Pair to be inserted (see std::make_pair for easy creation
+ * of pairs).
+ * @return An iterator that points to the inserted (key,value) pair.
+ *
+ * This function inserts a (key, value) pair into the %multimap.
+ * Contrary to a std::map the %multimap does not rely on unique keys and
+ * thus multiple pairs with the same key can be inserted.
+ * Note that the first parameter is only a hint and can potentially
+ * improve the performance of the insertion process. A bad hint would
+ * cause no gains in efficiency.
+ *
+ * For more on "hinting," see:
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html
+ *
+ * Insertion requires logarithmic time (if the hint is not taken).
+ */
+ iterator
+ insert(iterator __position, const value_type& __x)
+ { return _M_t._M_insert_equal_(__position, __x); }
+
+ /**
+ * @brief A template function that attempts to insert a range
+ * of elements.
+ * @param first Iterator pointing to the start of the range to be
+ * inserted.
+ * @param last Iterator pointing to the end of the range.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ { _M_t._M_insert_equal(__first, __last); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Attempts to insert a list of std::pairs into the %multimap.
+ * @param list A std::initializer_list<value_type> of pairs to be
+ * inserted.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ void
+ insert(initializer_list<value_type> __l)
+ { this->insert(__l.begin(), __l.end()); }
+#endif
+
+ /**
+ * @brief Erases an element from a %multimap.
+ * @param position An iterator pointing to the element to be erased.
+ *
+ * This function erases an element, pointed to by the given iterator,
+ * from a %multimap. Note that this function only erases the element,
+ * and that if the element is itself a pointer, the pointed-to memory is
+ * not touched in any way. Managing the pointer is the user's
+ * responsibility.
+ */
+ void
+ erase(iterator __position)
+ { _M_t.erase(__position); }
+
+ /**
+ * @brief Erases elements according to the provided key.
+ * @param x Key of element to be erased.
+ * @return The number of elements erased.
+ *
+ * This function erases all elements located by the given key from a
+ * %multimap.
+ * Note that this function only erases the element, and that if
+ * the element is itself a pointer, the pointed-to memory is not touched
+ * in any way. Managing the pointer is the user's responsibility.
+ */
+ size_type
+ erase(const key_type& __x)
+ { return _M_t.erase(__x); }
+
+ /**
+ * @brief Erases a [first,last) range of elements from a %multimap.
+ * @param first Iterator pointing to the start of the range to be
+ * erased.
+ * @param last Iterator pointing to the end of the range to be erased.
+ *
+ * This function erases a sequence of elements from a %multimap.
+ * Note that this function only erases the elements, and that if
+ * the elements themselves are pointers, the pointed-to memory is not
+ * touched in any way. Managing the pointer is the user's responsibility.
+ */
+ void
+ erase(iterator __first, iterator __last)
+ { _M_t.erase(__first, __last); }
+
+ /**
+ * @brief Swaps data with another %multimap.
+ * @param x A %multimap of the same element and allocator types.
+ *
+ * This exchanges the elements between two multimaps in constant time.
+ * (It is only swapping a pointer, an integer, and an instance of
+ * the @c Compare type (which itself is often stateless and empty), so it
+ * should be quite fast.)
+ * Note that the global std::swap() function is specialized such that
+ * std::swap(m1,m2) will feed to this function.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(multimap&& __x)
+#else
+ swap(multimap& __x)
+#endif
+ { _M_t.swap(__x._M_t); }
+
+ /**
+ * Erases all elements in a %multimap. Note that this function only
+ * erases the elements, and that if the elements themselves are pointers,
+ * the pointed-to memory is not touched in any way. Managing the pointer
+ * is the user's responsibility.
+ */
+ void
+ clear()
+ { _M_t.clear(); }
+
+ // observers
+ /**
+ * Returns the key comparison object out of which the %multimap
+ * was constructed.
+ */
+ key_compare
+ key_comp() const
+ { return _M_t.key_comp(); }
+
+ /**
+ * Returns a value comparison object, built from the key comparison
+ * object out of which the %multimap was constructed.
+ */
+ value_compare
+ value_comp() const
+ { return value_compare(_M_t.key_comp()); }
+
+ // multimap operations
+ /**
+ * @brief Tries to locate an element in a %multimap.
+ * @param x Key of (key, value) pair to be located.
+ * @return Iterator pointing to sought-after element,
+ * or end() if not found.
+ *
+ * This function takes a key and tries to locate the element with which
+ * the key matches. If successful the function returns an iterator
+ * pointing to the sought after %pair. If unsuccessful it returns the
+ * past-the-end ( @c end() ) iterator.
+ */
+ iterator
+ find(const key_type& __x)
+ { return _M_t.find(__x); }
+
+ /**
+ * @brief Tries to locate an element in a %multimap.
+ * @param x Key of (key, value) pair to be located.
+ * @return Read-only (constant) iterator pointing to sought-after
+ * element, or end() if not found.
+ *
+ * This function takes a key and tries to locate the element with which
+ * the key matches. If successful the function returns a constant
+ * iterator pointing to the sought after %pair. If unsuccessful it
+ * returns the past-the-end ( @c end() ) iterator.
+ */
+ const_iterator
+ find(const key_type& __x) const
+ { return _M_t.find(__x); }
+
+ /**
+ * @brief Finds the number of elements with given key.
+ * @param x Key of (key, value) pairs to be located.
+ * @return Number of elements with specified key.
+ */
+ size_type
+ count(const key_type& __x) const
+ { return _M_t.count(__x); }
+
+ /**
+ * @brief Finds the beginning of a subsequence matching given key.
+ * @param x Key of (key, value) pair to be located.
+ * @return Iterator pointing to first element equal to or greater
+ * than key, or end().
+ *
+ * This function returns the first element of a subsequence of elements
+ * that matches the given key. If unsuccessful it returns an iterator
+ * pointing to the first element that has a greater value than given key
+ * or end() if no such element exists.
+ */
+ iterator
+ lower_bound(const key_type& __x)
+ { return _M_t.lower_bound(__x); }
+
+ /**
+ * @brief Finds the beginning of a subsequence matching given key.
+ * @param x Key of (key, value) pair to be located.
+ * @return Read-only (constant) iterator pointing to first element
+ * equal to or greater than key, or end().
+ *
+ * This function returns the first element of a subsequence of elements
+ * that matches the given key. If unsuccessful the iterator will point
+ * to the next greatest element or, if no such greater element exists, to
+ * end().
+ */
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return _M_t.lower_bound(__x); }
+
+ /**
+ * @brief Finds the end of a subsequence matching given key.
+ * @param x Key of (key, value) pair to be located.
+ * @return Iterator pointing to the first element
+ * greater than key, or end().
+ */
+ iterator
+ upper_bound(const key_type& __x)
+ { return _M_t.upper_bound(__x); }
+
+ /**
+ * @brief Finds the end of a subsequence matching given key.
+ * @param x Key of (key, value) pair to be located.
+ * @return Read-only (constant) iterator pointing to first iterator
+ * greater than key, or end().
+ */
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return _M_t.upper_bound(__x); }
+
+ /**
+ * @brief Finds a subsequence matching given key.
+ * @param x Key of (key, value) pairs to be located.
+ * @return Pair of iterators that possibly points to the subsequence
+ * matching given key.
+ *
+ * This function is equivalent to
+ * @code
+ * std::make_pair(c.lower_bound(val),
+ * c.upper_bound(val))
+ * @endcode
+ * (but is faster than making the calls separately).
+ */
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __x)
+ { return _M_t.equal_range(__x); }
+
+ /**
+ * @brief Finds a subsequence matching given key.
+ * @param x Key of (key, value) pairs to be located.
+ * @return Pair of read-only (constant) iterators that possibly points
+ * to the subsequence matching given key.
+ *
+ * This function is equivalent to
+ * @code
+ * std::make_pair(c.lower_bound(val),
+ * c.upper_bound(val))
+ * @endcode
+ * (but is faster than making the calls separately).
+ */
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __x) const
+ { return _M_t.equal_range(__x); }
+
+ template<typename _K1, typename _T1, typename _C1, typename _A1>
+ friend bool
+ operator==(const multimap<_K1, _T1, _C1, _A1>&,
+ const multimap<_K1, _T1, _C1, _A1>&);
+
+ template<typename _K1, typename _T1, typename _C1, typename _A1>
+ friend bool
+ operator<(const multimap<_K1, _T1, _C1, _A1>&,
+ const multimap<_K1, _T1, _C1, _A1>&);
+ };
+
+ /**
+ * @brief Multimap equality comparison.
+ * @param x A %multimap.
+ * @param y A %multimap of the same type as @a x.
+ * @return True iff the size and elements of the maps are equal.
+ *
+ * This is an equivalence relation. It is linear in the size of the
+ * multimaps. Multimaps are considered equivalent if their sizes are equal,
+ * and if corresponding elements compare equal.
+ */
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator==(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return __x._M_t == __y._M_t; }
+
+ /**
+ * @brief Multimap ordering relation.
+ * @param x A %multimap.
+ * @param y A %multimap of the same type as @a x.
+ * @return True iff @a x is lexicographically less than @a y.
+ *
+ * This is a total ordering relation. It is linear in the size of the
+ * multimaps. The elements must be comparable with @c <.
+ *
+ * See std::lexicographical_compare() for how the determination is made.
+ */
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator<(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return __x._M_t < __y._M_t; }
+
+ /// Based on operator==
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator!=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ /// Based on operator<
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator>(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return __y < __x; }
+
+ /// Based on operator<
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator<=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ /// Based on operator<
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline bool
+ operator>=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ /// See std::multimap::swap().
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline void
+ swap(multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline void
+ swap(multimap<_Key, _Tp, _Compare, _Alloc>&& __x,
+ multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+ inline void
+ swap(multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+ multimap<_Key, _Tp, _Compare, _Alloc>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _STL_MULTIMAP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_multiset.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_multiset.h
new file mode 100644
index 0000000..b5c710f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_multiset.h
@@ -0,0 +1,697 @@
+// Multiset implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_multiset.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_MULTISET_H
+#define _STL_MULTISET_H 1
+
+#include <bits/concept_check.h>
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ /**
+ * @brief A standard container made up of elements, which can be retrieved
+ * in logarithmic time.
+ *
+ * @ingroup associative_containers
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, a
+ * <a href="tables.html#66">reversible container</a>, and an
+ * <a href="tables.html#69">associative container</a> (using equivalent
+ * keys). For a @c multiset<Key> the key_type and value_type are Key.
+ *
+ * Multisets support bidirectional iterators.
+ *
+ * The private tree data is declared exactly the same way for set and
+ * multiset; the distinction is made entirely in how the tree functions are
+ * called (*_unique versus *_equal, same as the standard).
+ */
+ template <typename _Key, typename _Compare = std::less<_Key>,
+ typename _Alloc = std::allocator<_Key> >
+ class multiset
+ {
+ // concept requirements
+ typedef typename _Alloc::value_type _Alloc_value_type;
+ __glibcxx_class_requires(_Key, _SGIAssignableConcept)
+ __glibcxx_class_requires4(_Compare, bool, _Key, _Key,
+ _BinaryFunctionConcept)
+ __glibcxx_class_requires2(_Key, _Alloc_value_type, _SameTypeConcept)
+
+ public:
+ // typedefs:
+ typedef _Key key_type;
+ typedef _Key value_type;
+ typedef _Compare key_compare;
+ typedef _Compare value_compare;
+ typedef _Alloc allocator_type;
+
+ private:
+ /// This turns a red-black tree into a [multi]set.
+ typedef typename _Alloc::template rebind<_Key>::other _Key_alloc_type;
+
+ typedef _Rb_tree<key_type, value_type, _Identity<value_type>,
+ key_compare, _Key_alloc_type> _Rep_type;
+ /// The actual tree structure.
+ _Rep_type _M_t;
+
+ public:
+ typedef typename _Key_alloc_type::pointer pointer;
+ typedef typename _Key_alloc_type::const_pointer const_pointer;
+ typedef typename _Key_alloc_type::reference reference;
+ typedef typename _Key_alloc_type::const_reference const_reference;
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 103. set::iterator is required to be modifiable,
+ // but this allows modification of keys.
+ typedef typename _Rep_type::const_iterator iterator;
+ typedef typename _Rep_type::const_iterator const_iterator;
+ typedef typename _Rep_type::const_reverse_iterator reverse_iterator;
+ typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
+ typedef typename _Rep_type::size_type size_type;
+ typedef typename _Rep_type::difference_type difference_type;
+
+ // allocation/deallocation
+ /**
+ * @brief Default constructor creates no elements.
+ */
+ multiset()
+ : _M_t() { }
+
+ /**
+ * @brief Creates a %multiset with no elements.
+ * @param comp Comparator to use.
+ * @param a An allocator object.
+ */
+ explicit
+ multiset(const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a) { }
+
+ /**
+ * @brief Builds a %multiset from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * Create a %multiset consisting of copies of the elements from
+ * [first,last). This is linear in N if the range is already sorted,
+ * and NlogN otherwise (where N is distance(first,last)).
+ */
+ template<typename _InputIterator>
+ multiset(_InputIterator __first, _InputIterator __last)
+ : _M_t()
+ { _M_t._M_insert_equal(__first, __last); }
+
+ /**
+ * @brief Builds a %multiset from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param comp A comparison functor.
+ * @param a An allocator object.
+ *
+ * Create a %multiset consisting of copies of the elements from
+ * [first,last). This is linear in N if the range is already sorted,
+ * and NlogN otherwise (where N is distance(first,last)).
+ */
+ template<typename _InputIterator>
+ multiset(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_equal(__first, __last); }
+
+ /**
+ * @brief %Multiset copy constructor.
+ * @param x A %multiset of identical element and allocator types.
+ *
+ * The newly-created %multiset uses a copy of the allocation object used
+ * by @a x.
+ */
+ multiset(const multiset& __x)
+ : _M_t(__x._M_t) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Multiset move constructor.
+ * @param x A %multiset of identical element and allocator types.
+ *
+ * The newly-created %multiset contains the exact contents of @a x.
+ * The contents of @a x are a valid, but unspecified %multiset.
+ */
+ multiset(multiset&& __x)
+ : _M_t(std::forward<_Rep_type>(__x._M_t)) { }
+
+ /**
+ * @brief Builds a %multiset from an initializer_list.
+ * @param l An initializer_list.
+ * @param comp A comparison functor.
+ * @param a An allocator object.
+ *
+ * Create a %multiset consisting of copies of the elements from
+ * the list. This is linear in N if the list is already sorted,
+ * and NlogN otherwise (where N is @a l.size()).
+ */
+ multiset(initializer_list<value_type> __l,
+ const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_equal(__l.begin(), __l.end()); }
+#endif
+
+ /**
+ * @brief %Multiset assignment operator.
+ * @param x A %multiset of identical element and allocator types.
+ *
+ * All the elements of @a x are copied, but unlike the copy constructor,
+ * the allocator object is not copied.
+ */
+ multiset&
+ operator=(const multiset& __x)
+ {
+ _M_t = __x._M_t;
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Multiset move assignment operator.
+ * @param x A %multiset of identical element and allocator types.
+ *
+ * The contents of @a x are moved into this %multiset (without copying).
+ * @a x is a valid, but unspecified %multiset.
+ */
+ multiset&
+ operator=(multiset&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ /**
+ * @brief %Multiset list assignment operator.
+ * @param l An initializer_list.
+ *
+ * This function fills a %multiset with copies of the elements in the
+ * initializer list @a l.
+ *
+ * Note that the assignment completely changes the %multiset and
+ * that the resulting %multiset's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ multiset&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+
+ // accessors:
+
+ /// Returns the comparison object.
+ key_compare
+ key_comp() const
+ { return _M_t.key_comp(); }
+ /// Returns the comparison object.
+ value_compare
+ value_comp() const
+ { return _M_t.key_comp(); }
+ /// Returns the memory allocation object.
+ allocator_type
+ get_allocator() const
+ { return _M_t.get_allocator(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * element in the %multiset. Iteration is done in ascending order
+ * according to the keys.
+ */
+ iterator
+ begin() const
+ { return _M_t.begin(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the last
+ * element in the %multiset. Iteration is done in ascending order
+ * according to the keys.
+ */
+ iterator
+ end() const
+ { return _M_t.end(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to the
+ * last element in the %multiset. Iteration is done in descending order
+ * according to the keys.
+ */
+ reverse_iterator
+ rbegin() const
+ { return _M_t.rbegin(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to the
+ * last element in the %multiset. Iteration is done in descending order
+ * according to the keys.
+ */
+ reverse_iterator
+ rend() const
+ { return _M_t.rend(); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * element in the %multiset. Iteration is done in ascending order
+ * according to the keys.
+ */
+ iterator
+ cbegin() const
+ { return _M_t.begin(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the last
+ * element in the %multiset. Iteration is done in ascending order
+ * according to the keys.
+ */
+ iterator
+ cend() const
+ { return _M_t.end(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to the
+ * last element in the %multiset. Iteration is done in descending order
+ * according to the keys.
+ */
+ reverse_iterator
+ crbegin() const
+ { return _M_t.rbegin(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to the
+ * last element in the %multiset. Iteration is done in descending order
+ * according to the keys.
+ */
+ reverse_iterator
+ crend() const
+ { return _M_t.rend(); }
+#endif
+
+ /// Returns true if the %set is empty.
+ bool
+ empty() const
+ { return _M_t.empty(); }
+
+ /// Returns the size of the %set.
+ size_type
+ size() const
+ { return _M_t.size(); }
+
+ /// Returns the maximum size of the %set.
+ size_type
+ max_size() const
+ { return _M_t.max_size(); }
+
+ /**
+ * @brief Swaps data with another %multiset.
+ * @param x A %multiset of the same element and allocator types.
+ *
+ * This exchanges the elements between two multisets in constant time.
+ * (It is only swapping a pointer, an integer, and an instance of the @c
+ * Compare type (which itself is often stateless and empty), so it should
+ * be quite fast.)
+ * Note that the global std::swap() function is specialized such that
+ * std::swap(s1,s2) will feed to this function.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(multiset&& __x)
+#else
+ swap(multiset& __x)
+#endif
+ { _M_t.swap(__x._M_t); }
+
+ // insert/erase
+ /**
+ * @brief Inserts an element into the %multiset.
+ * @param x Element to be inserted.
+ * @return An iterator that points to the inserted element.
+ *
+ * This function inserts an element into the %multiset. Contrary
+ * to a std::set the %multiset does not rely on unique keys and thus
+ * multiple copies of the same element can be inserted.
+ *
+ * Insertion requires logarithmic time.
+ */
+ iterator
+ insert(const value_type& __x)
+ { return _M_t._M_insert_equal(__x); }
+
+ /**
+ * @brief Inserts an element into the %multiset.
+ * @param position An iterator that serves as a hint as to where the
+ * element should be inserted.
+ * @param x Element to be inserted.
+ * @return An iterator that points to the inserted element.
+ *
+ * This function inserts an element into the %multiset. Contrary
+ * to a std::set the %multiset does not rely on unique keys and thus
+ * multiple copies of the same element can be inserted.
+ *
+ * Note that the first parameter is only a hint and can potentially
+ * improve the performance of the insertion process. A bad hint would
+ * cause no gains in efficiency.
+ *
+ * See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html
+ * for more on "hinting".
+ *
+ * Insertion requires logarithmic time (if the hint is not taken).
+ */
+ iterator
+ insert(iterator __position, const value_type& __x)
+ { return _M_t._M_insert_equal_(__position, __x); }
+
+ /**
+ * @brief A template function that attempts to insert a range of elements.
+ * @param first Iterator pointing to the start of the range to be
+ * inserted.
+ * @param last Iterator pointing to the end of the range.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ { _M_t._M_insert_equal(__first, __last); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Attempts to insert a list of elements into the %multiset.
+ * @param list A std::initializer_list<value_type> of elements
+ * to be inserted.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ void
+ insert(initializer_list<value_type> __l)
+ { this->insert(__l.begin(), __l.end()); }
+#endif
+
+ /**
+ * @brief Erases an element from a %multiset.
+ * @param position An iterator pointing to the element to be erased.
+ *
+ * This function erases an element, pointed to by the given iterator,
+ * from a %multiset. Note that this function only erases the element,
+ * and that if the element is itself a pointer, the pointed-to memory is
+ * not touched in any way. Managing the pointer is the user's
+ * responsibility.
+ */
+ void
+ erase(iterator __position)
+ { _M_t.erase(__position); }
+
+ /**
+ * @brief Erases elements according to the provided key.
+ * @param x Key of element to be erased.
+ * @return The number of elements erased.
+ *
+ * This function erases all elements located by the given key from a
+ * %multiset.
+ * Note that this function only erases the element, and that if
+ * the element is itself a pointer, the pointed-to memory is not touched
+ * in any way. Managing the pointer is the user's responsibility.
+ */
+ size_type
+ erase(const key_type& __x)
+ { return _M_t.erase(__x); }
+
+ /**
+ * @brief Erases a [first,last) range of elements from a %multiset.
+ * @param first Iterator pointing to the start of the range to be
+ * erased.
+ * @param last Iterator pointing to the end of the range to be erased.
+ *
+ * This function erases a sequence of elements from a %multiset.
+ * Note that this function only erases the elements, and that if
+ * the elements themselves are pointers, the pointed-to memory is not
+ * touched in any way. Managing the pointer is the user's responsibility.
+ */
+ void
+ erase(iterator __first, iterator __last)
+ { _M_t.erase(__first, __last); }
+
+ /**
+ * Erases all elements in a %multiset. Note that this function only
+ * erases the elements, and that if the elements themselves are pointers,
+ * the pointed-to memory is not touched in any way. Managing the pointer
+ * is the user's responsibility.
+ */
+ void
+ clear()
+ { _M_t.clear(); }
+
+ // multiset operations:
+
+ /**
+ * @brief Finds the number of elements with given key.
+ * @param x Key of elements to be located.
+ * @return Number of elements with specified key.
+ */
+ size_type
+ count(const key_type& __x) const
+ { return _M_t.count(__x); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ //@{
+ /**
+ * @brief Tries to locate an element in a %set.
+ * @param x Element to be located.
+ * @return Iterator pointing to sought-after element, or end() if not
+ * found.
+ *
+ * This function takes a key and tries to locate the element with which
+ * the key matches. If successful the function returns an iterator
+ * pointing to the sought after element. If unsuccessful it returns the
+ * past-the-end ( @c end() ) iterator.
+ */
+ iterator
+ find(const key_type& __x)
+ { return _M_t.find(__x); }
+
+ const_iterator
+ find(const key_type& __x) const
+ { return _M_t.find(__x); }
+ //@}
+
+ //@{
+ /**
+ * @brief Finds the beginning of a subsequence matching given key.
+ * @param x Key to be located.
+ * @return Iterator pointing to first element equal to or greater
+ * than key, or end().
+ *
+ * This function returns the first element of a subsequence of elements
+ * that matches the given key. If unsuccessful it returns an iterator
+ * pointing to the first element that has a greater value than given key
+ * or end() if no such element exists.
+ */
+ iterator
+ lower_bound(const key_type& __x)
+ { return _M_t.lower_bound(__x); }
+
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return _M_t.lower_bound(__x); }
+ //@}
+
+ //@{
+ /**
+ * @brief Finds the end of a subsequence matching given key.
+ * @param x Key to be located.
+ * @return Iterator pointing to the first element
+ * greater than key, or end().
+ */
+ iterator
+ upper_bound(const key_type& __x)
+ { return _M_t.upper_bound(__x); }
+
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return _M_t.upper_bound(__x); }
+ //@}
+
+ //@{
+ /**
+ * @brief Finds a subsequence matching given key.
+ * @param x Key to be located.
+ * @return Pair of iterators that possibly points to the subsequence
+ * matching given key.
+ *
+ * This function is equivalent to
+ * @code
+ * std::make_pair(c.lower_bound(val),
+ * c.upper_bound(val))
+ * @endcode
+ * (but is faster than making the calls separately).
+ *
+ * This function probably only makes sense for multisets.
+ */
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __x)
+ { return _M_t.equal_range(__x); }
+
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __x) const
+ { return _M_t.equal_range(__x); }
+
+ template<typename _K1, typename _C1, typename _A1>
+ friend bool
+ operator==(const multiset<_K1, _C1, _A1>&,
+ const multiset<_K1, _C1, _A1>&);
+
+ template<typename _K1, typename _C1, typename _A1>
+ friend bool
+ operator< (const multiset<_K1, _C1, _A1>&,
+ const multiset<_K1, _C1, _A1>&);
+ };
+
+ /**
+ * @brief Multiset equality comparison.
+ * @param x A %multiset.
+ * @param y A %multiset of the same type as @a x.
+ * @return True iff the size and elements of the multisets are equal.
+ *
+ * This is an equivalence relation. It is linear in the size of the
+ * multisets.
+ * Multisets are considered equivalent if their sizes are equal, and if
+ * corresponding elements compare equal.
+ */
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator==(const multiset<_Key, _Compare, _Alloc>& __x,
+ const multiset<_Key, _Compare, _Alloc>& __y)
+ { return __x._M_t == __y._M_t; }
+
+ /**
+ * @brief Multiset ordering relation.
+ * @param x A %multiset.
+ * @param y A %multiset of the same type as @a x.
+ * @return True iff @a x is lexicographically less than @a y.
+ *
+ * This is a total ordering relation. It is linear in the size of the
+ * maps. The elements must be comparable with @c <.
+ *
+ * See std::lexicographical_compare() for how the determination is made.
+ */
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator<(const multiset<_Key, _Compare, _Alloc>& __x,
+ const multiset<_Key, _Compare, _Alloc>& __y)
+ { return __x._M_t < __y._M_t; }
+
+ /// Returns !(x == y).
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator!=(const multiset<_Key, _Compare, _Alloc>& __x,
+ const multiset<_Key, _Compare, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ /// Returns y < x.
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator>(const multiset<_Key,_Compare,_Alloc>& __x,
+ const multiset<_Key,_Compare,_Alloc>& __y)
+ { return __y < __x; }
+
+ /// Returns !(y < x)
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator<=(const multiset<_Key, _Compare, _Alloc>& __x,
+ const multiset<_Key, _Compare, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ /// Returns !(x < y)
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator>=(const multiset<_Key, _Compare, _Alloc>& __x,
+ const multiset<_Key, _Compare, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ /// See std::multiset::swap().
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline void
+ swap(multiset<_Key, _Compare, _Alloc>& __x,
+ multiset<_Key, _Compare, _Alloc>& __y)
+ { __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline void
+ swap(multiset<_Key, _Compare, _Alloc>&& __x,
+ multiset<_Key, _Compare, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline void
+ swap(multiset<_Key, _Compare, _Alloc>& __x,
+ multiset<_Key, _Compare, _Alloc>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _STL_MULTISET_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_numeric.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_numeric.h
new file mode 100644
index 0000000..5edf2bc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_numeric.h
@@ -0,0 +1,373 @@
+// Numeric functions implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_numeric.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_NUMERIC_H
+#define _STL_NUMERIC_H 1
+
+#include <bits/concept_check.h>
+#include <debug/debug.h>
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @brief Create a range of sequentially increasing values.
+ *
+ * For each element in the range @p [first,last) assigns @p value and
+ * increments @p value as if by @p ++value.
+ *
+ * @param first Start of range.
+ * @param last End of range.
+ * @param value Starting value.
+ * @return Nothing.
+ */
+ template<typename _ForwardIterator, typename _Tp>
+ void
+ iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
+ _ForwardIterator>)
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first)
+ {
+ *__first = __value;
+ ++__value;
+ }
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P)
+
+ /**
+ * @brief Accumulate values in a range.
+ *
+ * Accumulates the values in the range [first,last) using operator+(). The
+ * initial value is @a init. The values are processed in order.
+ *
+ * @param first Start of range.
+ * @param last End of range.
+ * @param init Starting value to add other values to.
+ * @return The final sum.
+ */
+ template<typename _InputIterator, typename _Tp>
+ inline _Tp
+ accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first)
+ __init = __init + *__first;
+ return __init;
+ }
+
+ /**
+ * @brief Accumulate values in a range with operation.
+ *
+ * Accumulates the values in the range [first,last) using the function
+ * object @a binary_op. The initial value is @a init. The values are
+ * processed in order.
+ *
+ * @param first Start of range.
+ * @param last End of range.
+ * @param init Starting value to add other values to.
+ * @param binary_op Function object to accumulate with.
+ * @return The final sum.
+ */
+ template<typename _InputIterator, typename _Tp, typename _BinaryOperation>
+ inline _Tp
+ accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
+ _BinaryOperation __binary_op)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for (; __first != __last; ++__first)
+ __init = __binary_op(__init, *__first);
+ return __init;
+ }
+
+ /**
+ * @brief Compute inner product of two ranges.
+ *
+ * Starting with an initial value of @a init, multiplies successive
+ * elements from the two ranges and adds each product into the accumulated
+ * value using operator+(). The values in the ranges are processed in
+ * order.
+ *
+ * @param first1 Start of range 1.
+ * @param last1 End of range 1.
+ * @param first2 Start of range 2.
+ * @param init Starting value to add other values to.
+ * @return The final inner product.
+ */
+ template<typename _InputIterator1, typename _InputIterator2, typename _Tp>
+ inline _Tp
+ inner_product(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _Tp __init)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+
+ for (; __first1 != __last1; ++__first1, ++__first2)
+ __init = __init + (*__first1 * *__first2);
+ return __init;
+ }
+
+ /**
+ * @brief Compute inner product of two ranges.
+ *
+ * Starting with an initial value of @a init, applies @a binary_op2 to
+ * successive elements from the two ranges and accumulates each result into
+ * the accumulated value using @a binary_op1. The values in the ranges are
+ * processed in order.
+ *
+ * @param first1 Start of range 1.
+ * @param last1 End of range 1.
+ * @param first2 Start of range 2.
+ * @param init Starting value to add other values to.
+ * @param binary_op1 Function object to accumulate with.
+ * @param binary_op2 Function object to apply to pairs of input values.
+ * @return The final inner product.
+ */
+ template<typename _InputIterator1, typename _InputIterator2, typename _Tp,
+ typename _BinaryOperation1, typename _BinaryOperation2>
+ inline _Tp
+ inner_product(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _Tp __init,
+ _BinaryOperation1 __binary_op1,
+ _BinaryOperation2 __binary_op2)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+
+ for (; __first1 != __last1; ++__first1, ++__first2)
+ __init = __binary_op1(__init, __binary_op2(*__first1, *__first2));
+ return __init;
+ }
+
+ /**
+ * @brief Return list of partial sums
+ *
+ * Accumulates the values in the range [first,last) using operator+().
+ * As each successive input value is added into the total, that partial sum
+ * is written to @a result. Therefore, the first value in result is the
+ * first value of the input, the second value in result is the sum of the
+ * first and second input values, and so on.
+ *
+ * @param first Start of input range.
+ * @param last End of input range.
+ * @param result Output to write sums to.
+ * @return Iterator pointing just beyond the values written to result.
+ */
+ template<typename _InputIterator, typename _OutputIterator>
+ _OutputIterator
+ partial_sum(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result)
+ {
+ typedef typename iterator_traits<_InputIterator>::value_type _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __result;
+ _ValueType __value = *__first;
+ *__result = __value;
+ while (++__first != __last)
+ {
+ __value = __value + *__first;
+ *++__result = __value;
+ }
+ return ++__result;
+ }
+
+ /**
+ * @brief Return list of partial sums
+ *
+ * Accumulates the values in the range [first,last) using operator+().
+ * As each successive input value is added into the total, that partial sum
+ * is written to @a result. Therefore, the first value in result is the
+ * first value of the input, the second value in result is the sum of the
+ * first and second input values, and so on.
+ *
+ * @param first Start of input range.
+ * @param last End of input range.
+ * @param result Output to write sums to.
+ * @return Iterator pointing just beyond the values written to result.
+ */
+ template<typename _InputIterator, typename _OutputIterator,
+ typename _BinaryOperation>
+ _OutputIterator
+ partial_sum(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, _BinaryOperation __binary_op)
+ {
+ typedef typename iterator_traits<_InputIterator>::value_type _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __result;
+ _ValueType __value = *__first;
+ *__result = __value;
+ while (++__first != __last)
+ {
+ __value = __binary_op(__value, *__first);
+ *++__result = __value;
+ }
+ return ++__result;
+ }
+
+ /**
+ * @brief Return differences between adjacent values.
+ *
+ * Computes the difference between adjacent values in the range
+ * [first,last) using operator-() and writes the result to @a result.
+ *
+ * @param first Start of input range.
+ * @param last End of input range.
+ * @param result Output to write sums to.
+ * @return Iterator pointing just beyond the values written to result.
+ */
+ template<typename _InputIterator, typename _OutputIterator>
+ _OutputIterator
+ adjacent_difference(_InputIterator __first,
+ _InputIterator __last, _OutputIterator __result)
+ {
+ typedef typename iterator_traits<_InputIterator>::value_type _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __result;
+ _ValueType __value = *__first;
+ *__result = __value;
+ while (++__first != __last)
+ {
+ _ValueType __tmp = *__first;
+ *++__result = __tmp - __value;
+ __value = __tmp;
+ }
+ return ++__result;
+ }
+
+ /**
+ * @brief Return differences between adjacent values.
+ *
+ * Computes the difference between adjacent values in the range
+ * [first,last) using the function object @a binary_op and writes the
+ * result to @a result.
+ *
+ * @param first Start of input range.
+ * @param last End of input range.
+ * @param result Output to write sums to.
+ * @return Iterator pointing just beyond the values written to result.
+ */
+ template<typename _InputIterator, typename _OutputIterator,
+ typename _BinaryOperation>
+ _OutputIterator
+ adjacent_difference(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, _BinaryOperation __binary_op)
+ {
+ typedef typename iterator_traits<_InputIterator>::value_type _ValueType;
+
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ _ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return __result;
+ _ValueType __value = *__first;
+ *__result = __value;
+ while (++__first != __last)
+ {
+ _ValueType __tmp = *__first;
+ *++__result = __binary_op(__tmp, __value);
+ __value = __tmp;
+ }
+ return ++__result;
+ }
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _STL_NUMERIC_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_pair.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_pair.h
new file mode 100644
index 0000000..fd395ad
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_pair.h
@@ -0,0 +1,261 @@
+// Pair implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_pair.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_PAIR_H
+#define _STL_PAIR_H 1
+
+#include <bits/move.h> // for std::move / std::forward, std::decay, and
+ // std::swap
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /// pair holds two objects of arbitrary type.
+ template<class _T1, class _T2>
+ struct pair
+ {
+ typedef _T1 first_type; ///< @c first_type is the first bound type
+ typedef _T2 second_type; ///< @c second_type is the second bound type
+
+ _T1 first; ///< @c first is a copy of the first object
+ _T2 second; ///< @c second is a copy of the second object
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 265. std::pair::pair() effects overly restrictive
+ /** The default constructor creates @c first and @c second using their
+ * respective default constructors. */
+ pair()
+ : first(), second() { }
+
+ /** Two objects may be passed to a @c pair constructor to be copied. */
+ pair(const _T1& __a, const _T2& __b)
+ : first(__a), second(__b) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<class _U1, class _U2>
+ pair(_U1&& __x, _U2&& __y)
+ : first(std::forward<_U1>(__x)),
+ second(std::forward<_U2>(__y)) { }
+
+ pair(pair&& __p)
+ : first(std::move(__p.first)),
+ second(std::move(__p.second)) { }
+#endif
+
+ /** There is also a templated copy ctor for the @c pair class itself. */
+ template<class _U1, class _U2>
+ pair(const pair<_U1, _U2>& __p)
+ : first(__p.first),
+ second(__p.second) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<class _U1, class _U2>
+ pair(pair<_U1, _U2>&& __p)
+ : first(std::move(__p.first)),
+ second(std::move(__p.second)) { }
+
+ // http://gcc.gnu.org/ml/libstdc++/2007-08/msg00052.html
+ template<class _U1, class _Arg0, class... _Args>
+ pair(_U1&& __x, _Arg0&& __arg0, _Args&&... __args)
+ : first(std::forward<_U1>(__x)),
+ second(std::forward<_Arg0>(__arg0),
+ std::forward<_Args>(__args)...) { }
+
+ pair&
+ operator=(pair&& __p)
+ {
+ first = std::move(__p.first);
+ second = std::move(__p.second);
+ return *this;
+ }
+
+ template<class _U1, class _U2>
+ pair&
+ operator=(pair<_U1, _U2>&& __p)
+ {
+ first = std::move(__p.first);
+ second = std::move(__p.second);
+ return *this;
+ }
+
+ void
+ swap(pair&& __p)
+ {
+ using std::swap;
+ swap(first, __p.first);
+ swap(second, __p.second);
+ }
+#endif
+ };
+
+ /// Two pairs of the same type are equal iff their members are equal.
+ template<class _T1, class _T2>
+ inline bool
+ operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+ { return __x.first == __y.first && __x.second == __y.second; }
+
+ /// <http://gcc.gnu.org/onlinedocs/libstdc++/manual/utilities.html>
+ template<class _T1, class _T2>
+ inline bool
+ operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+ { return __x.first < __y.first
+ || (!(__y.first < __x.first) && __x.second < __y.second); }
+
+ /// Uses @c operator== to find the result.
+ template<class _T1, class _T2>
+ inline bool
+ operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+ { return !(__x == __y); }
+
+ /// Uses @c operator< to find the result.
+ template<class _T1, class _T2>
+ inline bool
+ operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+ { return __y < __x; }
+
+ /// Uses @c operator< to find the result.
+ template<class _T1, class _T2>
+ inline bool
+ operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+ { return !(__y < __x); }
+
+ /// Uses @c operator< to find the result.
+ template<class _T1, class _T2>
+ inline bool
+ operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+ { return !(__x < __y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /// See std::pair::swap().
+ // Note: no std::swap overloads in C++03 mode, this has performance
+ // implications, see, eg, libstdc++/38466.
+ template<class _T1, class _T2>
+ inline void
+ swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
+ { __x.swap(__y); }
+
+ template<class _T1, class _T2>
+ inline void
+ swap(pair<_T1, _T2>&& __x, pair<_T1, _T2>& __y)
+ { __x.swap(__y); }
+
+ template<class _T1, class _T2>
+ inline void
+ swap(pair<_T1, _T2>& __x, pair<_T1, _T2>&& __y)
+ { __x.swap(__y); }
+#endif
+
+ /**
+ * @brief A convenience wrapper for creating a pair from two objects.
+ * @param x The first object.
+ * @param y The second object.
+ * @return A newly-constructed pair<> object of the appropriate type.
+ *
+ * The standard requires that the objects be passed by reference-to-const,
+ * but LWG issue #181 says they should be passed by const value. We follow
+ * the LWG by default.
+ */
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 181. make_pair() unintended behavior
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ template<class _T1, class _T2>
+ inline pair<_T1, _T2>
+ make_pair(_T1 __x, _T2 __y)
+ { return pair<_T1, _T2>(__x, __y); }
+#else
+ template<typename _Tp>
+ class reference_wrapper;
+
+ // Helper which adds a reference to a type when given a reference_wrapper
+ template<typename _Tp>
+ struct __strip_reference_wrapper
+ {
+ typedef _Tp __type;
+ };
+
+ template<typename _Tp>
+ struct __strip_reference_wrapper<reference_wrapper<_Tp> >
+ {
+ typedef _Tp& __type;
+ };
+
+ template<typename _Tp>
+ struct __strip_reference_wrapper<const reference_wrapper<_Tp> >
+ {
+ typedef _Tp& __type;
+ };
+
+ template<typename _Tp>
+ struct __decay_and_strip
+ {
+ typedef typename __strip_reference_wrapper<
+ typename decay<_Tp>::type>::__type __type;
+ };
+
+ // NB: DR 706.
+ template<class _T1, class _T2>
+ inline pair<typename __decay_and_strip<_T1>::__type,
+ typename __decay_and_strip<_T2>::__type>
+ make_pair(_T1&& __x, _T2&& __y)
+ {
+ return pair<typename __decay_and_strip<_T1>::__type,
+ typename __decay_and_strip<_T2>::__type>
+ (std::forward<_T1>(__x), std::forward<_T2>(__y));
+ }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_PAIR_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_queue.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_queue.h
new file mode 100644
index 0000000..7479469
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_queue.h
@@ -0,0 +1,586 @@
+// Queue implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_queue.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_QUEUE_H
+#define _STL_QUEUE_H 1
+
+#include <bits/concept_check.h>
+#include <debug/debug.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @brief A standard container giving FIFO behavior.
+ *
+ * @ingroup sequences
+ *
+ * Meets many of the requirements of a
+ * <a href="tables.html#65">container</a>,
+ * but does not define anything to do with iterators. Very few of the
+ * other standard container interfaces are defined.
+ *
+ * This is not a true container, but an @e adaptor. It holds another
+ * container, and provides a wrapper interface to that container. The
+ * wrapper is what enforces strict first-in-first-out %queue behavior.
+ *
+ * The second template parameter defines the type of the underlying
+ * sequence/container. It defaults to std::deque, but it can be any type
+ * that supports @c front, @c back, @c push_back, and @c pop_front,
+ * such as std::list or an appropriate user-defined type.
+ *
+ * Members not found in "normal" containers are @c container_type,
+ * which is a typedef for the second Sequence parameter, and @c push and
+ * @c pop, which are standard %queue/FIFO operations.
+ */
+ template<typename _Tp, typename _Sequence = deque<_Tp> >
+ class queue
+ {
+ // concept requirements
+ typedef typename _Sequence::value_type _Sequence_value_type;
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires(_Sequence, _FrontInsertionSequenceConcept)
+ __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept)
+ __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
+
+ template<typename _Tp1, typename _Seq1>
+ friend bool
+ operator==(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&);
+
+ template<typename _Tp1, typename _Seq1>
+ friend bool
+ operator<(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&);
+
+ public:
+ typedef typename _Sequence::value_type value_type;
+ typedef typename _Sequence::reference reference;
+ typedef typename _Sequence::const_reference const_reference;
+ typedef typename _Sequence::size_type size_type;
+ typedef _Sequence container_type;
+
+ protected:
+ /**
+ * 'c' is the underlying container. Maintainers wondering why
+ * this isn't uglified as per style guidelines should note that
+ * this name is specified in the standard, [23.2.3.1]. (Why?
+ * Presumably for the same reason that it's protected instead
+ * of private: to allow derivation. But none of the other
+ * containers allow for derivation. Odd.)
+ */
+ _Sequence c;
+
+ public:
+ /**
+ * @brief Default constructor creates no elements.
+ */
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ explicit
+ queue(const _Sequence& __c = _Sequence())
+ : c(__c) { }
+#else
+ explicit
+ queue(const _Sequence& __c)
+ : c(__c) { }
+
+ explicit
+ queue(_Sequence&& __c = _Sequence())
+ : c(std::move(__c)) { }
+
+ queue(queue&& __q)
+ : c(std::move(__q.c)) { }
+
+ queue&
+ operator=(queue&& __q)
+ {
+ c = std::move(__q.c);
+ return *this;
+ }
+#endif
+
+ /**
+ * Returns true if the %queue is empty.
+ */
+ bool
+ empty() const
+ { return c.empty(); }
+
+ /** Returns the number of elements in the %queue. */
+ size_type
+ size() const
+ { return c.size(); }
+
+ /**
+ * Returns a read/write reference to the data at the first
+ * element of the %queue.
+ */
+ reference
+ front()
+ {
+ __glibcxx_requires_nonempty();
+ return c.front();
+ }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the first
+ * element of the %queue.
+ */
+ const_reference
+ front() const
+ {
+ __glibcxx_requires_nonempty();
+ return c.front();
+ }
+
+ /**
+ * Returns a read/write reference to the data at the last
+ * element of the %queue.
+ */
+ reference
+ back()
+ {
+ __glibcxx_requires_nonempty();
+ return c.back();
+ }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the last
+ * element of the %queue.
+ */
+ const_reference
+ back() const
+ {
+ __glibcxx_requires_nonempty();
+ return c.back();
+ }
+
+ /**
+ * @brief Add data to the end of the %queue.
+ * @param x Data to be added.
+ *
+ * This is a typical %queue operation. The function creates an
+ * element at the end of the %queue and assigns the given data
+ * to it. The time complexity of the operation depends on the
+ * underlying sequence.
+ */
+ void
+ push(const value_type& __x)
+ { c.push_back(__x); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push(value_type&& __x)
+ { c.push_back(std::move(__x)); }
+
+ template<typename... _Args>
+ void
+ emplace(_Args&&... __args)
+ { c.emplace_back(std::forward<_Args>(__args)...); }
+#endif
+
+ /**
+ * @brief Removes first element.
+ *
+ * This is a typical %queue operation. It shrinks the %queue by one.
+ * The time complexity of the operation depends on the underlying
+ * sequence.
+ *
+ * Note that no data is returned, and if the first element's
+ * data is needed, it should be retrieved before pop() is
+ * called.
+ */
+ void
+ pop()
+ {
+ __glibcxx_requires_nonempty();
+ c.pop_front();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ swap(queue&& __q)
+ { c.swap(__q.c); }
+#endif
+ };
+
+ /**
+ * @brief Queue equality comparison.
+ * @param x A %queue.
+ * @param y A %queue of the same type as @a x.
+ * @return True iff the size and elements of the queues are equal.
+ *
+ * This is an equivalence relation. Complexity and semantics depend on the
+ * underlying sequence type, but the expected rules are: this relation is
+ * linear in the size of the sequences, and queues are considered equivalent
+ * if their sequences compare equal.
+ */
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator==(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y)
+ { return __x.c == __y.c; }
+
+ /**
+ * @brief Queue ordering relation.
+ * @param x A %queue.
+ * @param y A %queue of the same type as @a x.
+ * @return True iff @a x is lexicographically less than @a y.
+ *
+ * This is an total ordering relation. Complexity and semantics
+ * depend on the underlying sequence type, but the expected rules
+ * are: this relation is linear in the size of the sequences, the
+ * elements must be comparable with @c <, and
+ * std::lexicographical_compare() is usually used to make the
+ * determination.
+ */
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator<(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y)
+ { return __x.c < __y.c; }
+
+ /// Based on operator==
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator!=(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y)
+ { return !(__x == __y); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator>(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y)
+ { return __y < __x; }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator<=(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y)
+ { return !(__y < __x); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator>=(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y)
+ { return !(__x < __y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Seq>
+ inline void
+ swap(queue<_Tp, _Seq>& __x, queue<_Tp, _Seq>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Seq>
+ inline void
+ swap(queue<_Tp, _Seq>&& __x, queue<_Tp, _Seq>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Seq>
+ inline void
+ swap(queue<_Tp, _Seq>& __x, queue<_Tp, _Seq>&& __y)
+ { __x.swap(__y); }
+#endif
+
+ /**
+ * @brief A standard container automatically sorting its contents.
+ *
+ * @ingroup sequences
+ *
+ * This is not a true container, but an @e adaptor. It holds
+ * another container, and provides a wrapper interface to that
+ * container. The wrapper is what enforces priority-based sorting
+ * and %queue behavior. Very few of the standard container/sequence
+ * interface requirements are met (e.g., iterators).
+ *
+ * The second template parameter defines the type of the underlying
+ * sequence/container. It defaults to std::vector, but it can be
+ * any type that supports @c front(), @c push_back, @c pop_back,
+ * and random-access iterators, such as std::deque or an
+ * appropriate user-defined type.
+ *
+ * The third template parameter supplies the means of making
+ * priority comparisons. It defaults to @c less<value_type> but
+ * can be anything defining a strict weak ordering.
+ *
+ * Members not found in "normal" containers are @c container_type,
+ * which is a typedef for the second Sequence parameter, and @c
+ * push, @c pop, and @c top, which are standard %queue operations.
+ *
+ * @note No equality/comparison operators are provided for
+ * %priority_queue.
+ *
+ * @note Sorting of the elements takes place as they are added to,
+ * and removed from, the %priority_queue using the
+ * %priority_queue's member functions. If you access the elements
+ * by other means, and change their data such that the sorting
+ * order would be different, the %priority_queue will not re-sort
+ * the elements for you. (How could it know to do so?)
+ */
+ template<typename _Tp, typename _Sequence = vector<_Tp>,
+ typename _Compare = less<typename _Sequence::value_type> >
+ class priority_queue
+ {
+ // concept requirements
+ typedef typename _Sequence::value_type _Sequence_value_type;
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires(_Sequence, _SequenceConcept)
+ __glibcxx_class_requires(_Sequence, _RandomAccessContainerConcept)
+ __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
+ __glibcxx_class_requires4(_Compare, bool, _Tp, _Tp,
+ _BinaryFunctionConcept)
+
+ public:
+ typedef typename _Sequence::value_type value_type;
+ typedef typename _Sequence::reference reference;
+ typedef typename _Sequence::const_reference const_reference;
+ typedef typename _Sequence::size_type size_type;
+ typedef _Sequence container_type;
+
+ protected:
+ // See queue::c for notes on these names.
+ _Sequence c;
+ _Compare comp;
+
+ public:
+ /**
+ * @brief Default constructor creates no elements.
+ */
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ explicit
+ priority_queue(const _Compare& __x = _Compare(),
+ const _Sequence& __s = _Sequence())
+ : c(__s), comp(__x)
+ { std::make_heap(c.begin(), c.end(), comp); }
+#else
+ explicit
+ priority_queue(const _Compare& __x,
+ const _Sequence& __s)
+ : c(__s), comp(__x)
+ { std::make_heap(c.begin(), c.end(), comp); }
+
+ explicit
+ priority_queue(const _Compare& __x = _Compare(),
+ _Sequence&& __s = _Sequence())
+ : c(std::move(__s)), comp(__x)
+ { std::make_heap(c.begin(), c.end(), comp); }
+#endif
+
+ /**
+ * @brief Builds a %queue from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param x A comparison functor describing a strict weak ordering.
+ * @param s An initial sequence with which to start.
+ *
+ * Begins by copying @a s, inserting a copy of the elements
+ * from @a [first,last) into the copy of @a s, then ordering
+ * the copy according to @a x.
+ *
+ * For more information on function objects, see the
+ * documentation on @link functors functor base
+ * classes@endlink.
+ */
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _InputIterator>
+ priority_queue(_InputIterator __first, _InputIterator __last,
+ const _Compare& __x = _Compare(),
+ const _Sequence& __s = _Sequence())
+ : c(__s), comp(__x)
+ {
+ __glibcxx_requires_valid_range(__first, __last);
+ c.insert(c.end(), __first, __last);
+ std::make_heap(c.begin(), c.end(), comp);
+ }
+#else
+ template<typename _InputIterator>
+ priority_queue(_InputIterator __first, _InputIterator __last,
+ const _Compare& __x,
+ const _Sequence& __s)
+ : c(__s), comp(__x)
+ {
+ __glibcxx_requires_valid_range(__first, __last);
+ c.insert(c.end(), __first, __last);
+ std::make_heap(c.begin(), c.end(), comp);
+ }
+
+ template<typename _InputIterator>
+ priority_queue(_InputIterator __first, _InputIterator __last,
+ const _Compare& __x = _Compare(),
+ _Sequence&& __s = _Sequence())
+ : c(std::move(__s)), comp(__x)
+ {
+ __glibcxx_requires_valid_range(__first, __last);
+ c.insert(c.end(), __first, __last);
+ std::make_heap(c.begin(), c.end(), comp);
+ }
+
+ priority_queue(priority_queue&& __pq)
+ : c(std::move(__pq.c)), comp(std::move(__pq.comp)) { }
+
+ priority_queue&
+ operator=(priority_queue&& __pq)
+ {
+ c = std::move(__pq.c);
+ comp = std::move(__pq.comp);
+ return *this;
+ }
+#endif
+
+ /**
+ * Returns true if the %queue is empty.
+ */
+ bool
+ empty() const
+ { return c.empty(); }
+
+ /** Returns the number of elements in the %queue. */
+ size_type
+ size() const
+ { return c.size(); }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the first
+ * element of the %queue.
+ */
+ const_reference
+ top() const
+ {
+ __glibcxx_requires_nonempty();
+ return c.front();
+ }
+
+ /**
+ * @brief Add data to the %queue.
+ * @param x Data to be added.
+ *
+ * This is a typical %queue operation.
+ * The time complexity of the operation depends on the underlying
+ * sequence.
+ */
+ void
+ push(const value_type& __x)
+ {
+ c.push_back(__x);
+ std::push_heap(c.begin(), c.end(), comp);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push(value_type&& __x)
+ {
+ c.push_back(std::move(__x));
+ std::push_heap(c.begin(), c.end(), comp);
+ }
+
+ template<typename... _Args>
+ void
+ emplace(_Args&&... __args)
+ {
+ c.emplace_back(std::forward<_Args>(__args)...);
+ std::push_heap(c.begin(), c.end(), comp);
+ }
+#endif
+
+ /**
+ * @brief Removes first element.
+ *
+ * This is a typical %queue operation. It shrinks the %queue
+ * by one. The time complexity of the operation depends on the
+ * underlying sequence.
+ *
+ * Note that no data is returned, and if the first element's
+ * data is needed, it should be retrieved before pop() is
+ * called.
+ */
+ void
+ pop()
+ {
+ __glibcxx_requires_nonempty();
+ std::pop_heap(c.begin(), c.end(), comp);
+ c.pop_back();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ swap(priority_queue&& __pq)
+ {
+ using std::swap;
+ c.swap(__pq.c);
+ swap(comp, __pq.comp);
+ }
+#endif
+ };
+
+ // No equality/comparison operators are provided for priority_queue.
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Sequence, typename _Compare>
+ inline void
+ swap(priority_queue<_Tp, _Sequence, _Compare>& __x,
+ priority_queue<_Tp, _Sequence, _Compare>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Sequence, typename _Compare>
+ inline void
+ swap(priority_queue<_Tp, _Sequence, _Compare>&& __x,
+ priority_queue<_Tp, _Sequence, _Compare>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Sequence, typename _Compare>
+ inline void
+ swap(priority_queue<_Tp, _Sequence, _Compare>& __x,
+ priority_queue<_Tp, _Sequence, _Compare>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_QUEUE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_raw_storage_iter.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_raw_storage_iter.h
new file mode 100644
index 0000000..de6cad9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_raw_storage_iter.h
@@ -0,0 +1,106 @@
+// -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_raw_storage_iter.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_RAW_STORAGE_ITERATOR_H
+#define _STL_RAW_STORAGE_ITERATOR_H 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * This iterator class lets algorithms store their results into
+ * uninitialized memory.
+ */
+ template <class _OutputIterator, class _Tp>
+ class raw_storage_iterator
+ : public iterator<output_iterator_tag, void, void, void, void>
+ {
+ protected:
+ _OutputIterator _M_iter;
+
+ public:
+ explicit
+ raw_storage_iterator(_OutputIterator __x)
+ : _M_iter(__x) {}
+
+ raw_storage_iterator&
+ operator*() { return *this; }
+
+ raw_storage_iterator&
+ operator=(const _Tp& __element)
+ {
+ std::_Construct(&*_M_iter, __element);
+ return *this;
+ }
+
+ raw_storage_iterator<_OutputIterator, _Tp>&
+ operator++()
+ {
+ ++_M_iter;
+ return *this;
+ }
+
+ raw_storage_iterator<_OutputIterator, _Tp>
+ operator++(int)
+ {
+ raw_storage_iterator<_OutputIterator, _Tp> __tmp = *this;
+ ++_M_iter;
+ return __tmp;
+ }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_relops.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_relops.h
new file mode 100644
index 0000000..4377c5f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_relops.h
@@ -0,0 +1,131 @@
+// std::rel_ops implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2004, 2005, 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the, 2009 Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file stl_relops.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ *
+ * Inclusion of this file has been removed from
+ * all of the other STL headers for safety reasons, except std_utility.h.
+ * For more information, see the thread of about twenty messages starting
+ * with http://gcc.gnu.org/ml/libstdc++/2001-01/msg00223.html, or
+ * http://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.ambiguous_overloads
+ *
+ * Short summary: the rel_ops operators should be avoided for the present.
+ */
+
+#ifndef _STL_RELOPS_H
+#define _STL_RELOPS_H 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ namespace rel_ops
+ {
+ /** @namespace std::rel_ops
+ * @brief The generated relational operators are sequestered here.
+ */
+
+ /**
+ * @brief Defines @c != for arbitrary types, in terms of @c ==.
+ * @param x A thing.
+ * @param y Another thing.
+ * @return x != y
+ *
+ * This function uses @c == to determine its result.
+ */
+ template <class _Tp>
+ inline bool
+ operator!=(const _Tp& __x, const _Tp& __y)
+ { return !(__x == __y); }
+
+ /**
+ * @brief Defines @c > for arbitrary types, in terms of @c <.
+ * @param x A thing.
+ * @param y Another thing.
+ * @return x > y
+ *
+ * This function uses @c < to determine its result.
+ */
+ template <class _Tp>
+ inline bool
+ operator>(const _Tp& __x, const _Tp& __y)
+ { return __y < __x; }
+
+ /**
+ * @brief Defines @c <= for arbitrary types, in terms of @c <.
+ * @param x A thing.
+ * @param y Another thing.
+ * @return x <= y
+ *
+ * This function uses @c < to determine its result.
+ */
+ template <class _Tp>
+ inline bool
+ operator<=(const _Tp& __x, const _Tp& __y)
+ { return !(__y < __x); }
+
+ /**
+ * @brief Defines @c >= for arbitrary types, in terms of @c <.
+ * @param x A thing.
+ * @param y Another thing.
+ * @return x >= y
+ *
+ * This function uses @c < to determine its result.
+ */
+ template <class _Tp>
+ inline bool
+ operator>=(const _Tp& __x, const _Tp& __y)
+ { return !(__x < __y); }
+
+ } // namespace rel_ops
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_RELOPS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_set.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_set.h
new file mode 100644
index 0000000..f06fe03
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_set.h
@@ -0,0 +1,708 @@
+// Set implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_set.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_SET_H
+#define _STL_SET_H 1
+
+#include <bits/concept_check.h>
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ /**
+ * @brief A standard container made up of unique keys, which can be
+ * retrieved in logarithmic time.
+ *
+ * @ingroup associative_containers
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, a
+ * <a href="tables.html#66">reversible container</a>, and an
+ * <a href="tables.html#69">associative container</a> (using unique keys).
+ *
+ * Sets support bidirectional iterators.
+ *
+ * @param Key Type of key objects.
+ * @param Compare Comparison function object type, defaults to less<Key>.
+ * @param Alloc Allocator type, defaults to allocator<Key>.
+ *
+ * The private tree data is declared exactly the same way for set and
+ * multiset; the distinction is made entirely in how the tree functions are
+ * called (*_unique versus *_equal, same as the standard).
+ */
+ template<typename _Key, typename _Compare = std::less<_Key>,
+ typename _Alloc = std::allocator<_Key> >
+ class set
+ {
+ // concept requirements
+ typedef typename _Alloc::value_type _Alloc_value_type;
+ __glibcxx_class_requires(_Key, _SGIAssignableConcept)
+ __glibcxx_class_requires4(_Compare, bool, _Key, _Key,
+ _BinaryFunctionConcept)
+ __glibcxx_class_requires2(_Key, _Alloc_value_type, _SameTypeConcept)
+
+ public:
+ // typedefs:
+ //@{
+ /// Public typedefs.
+ typedef _Key key_type;
+ typedef _Key value_type;
+ typedef _Compare key_compare;
+ typedef _Compare value_compare;
+ typedef _Alloc allocator_type;
+ //@}
+
+ private:
+ typedef typename _Alloc::template rebind<_Key>::other _Key_alloc_type;
+
+ typedef _Rb_tree<key_type, value_type, _Identity<value_type>,
+ key_compare, _Key_alloc_type> _Rep_type;
+ _Rep_type _M_t; // Red-black tree representing set.
+
+ public:
+ //@{
+ /// Iterator-related typedefs.
+ typedef typename _Key_alloc_type::pointer pointer;
+ typedef typename _Key_alloc_type::const_pointer const_pointer;
+ typedef typename _Key_alloc_type::reference reference;
+ typedef typename _Key_alloc_type::const_reference const_reference;
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 103. set::iterator is required to be modifiable,
+ // but this allows modification of keys.
+ typedef typename _Rep_type::const_iterator iterator;
+ typedef typename _Rep_type::const_iterator const_iterator;
+ typedef typename _Rep_type::const_reverse_iterator reverse_iterator;
+ typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
+ typedef typename _Rep_type::size_type size_type;
+ typedef typename _Rep_type::difference_type difference_type;
+ //@}
+
+ // allocation/deallocation
+ /**
+ * @brief Default constructor creates no elements.
+ */
+ set()
+ : _M_t() { }
+
+ /**
+ * @brief Creates a %set with no elements.
+ * @param comp Comparator to use.
+ * @param a An allocator object.
+ */
+ explicit
+ set(const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a) { }
+
+ /**
+ * @brief Builds a %set from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * Create a %set consisting of copies of the elements from [first,last).
+ * This is linear in N if the range is already sorted, and NlogN
+ * otherwise (where N is distance(first,last)).
+ */
+ template<typename _InputIterator>
+ set(_InputIterator __first, _InputIterator __last)
+ : _M_t()
+ { _M_t._M_insert_unique(__first, __last); }
+
+ /**
+ * @brief Builds a %set from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param comp A comparison functor.
+ * @param a An allocator object.
+ *
+ * Create a %set consisting of copies of the elements from [first,last).
+ * This is linear in N if the range is already sorted, and NlogN
+ * otherwise (where N is distance(first,last)).
+ */
+ template<typename _InputIterator>
+ set(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_unique(__first, __last); }
+
+ /**
+ * @brief %Set copy constructor.
+ * @param x A %set of identical element and allocator types.
+ *
+ * The newly-created %set uses a copy of the allocation object used
+ * by @a x.
+ */
+ set(const set& __x)
+ : _M_t(__x._M_t) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Set move constructor
+ * @param x A %set of identical element and allocator types.
+ *
+ * The newly-created %set contains the exact contents of @a x.
+ * The contents of @a x are a valid, but unspecified %set.
+ */
+ set(set&& __x)
+ : _M_t(std::forward<_Rep_type>(__x._M_t)) { }
+
+ /**
+ * @brief Builds a %set from an initializer_list.
+ * @param l An initializer_list.
+ * @param comp A comparison functor.
+ * @param a An allocator object.
+ *
+ * Create a %set consisting of copies of the elements in the list.
+ * This is linear in N if the list is already sorted, and NlogN
+ * otherwise (where N is @a l.size()).
+ */
+ set(initializer_list<value_type> __l,
+ const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_unique(__l.begin(), __l.end()); }
+#endif
+
+ /**
+ * @brief %Set assignment operator.
+ * @param x A %set of identical element and allocator types.
+ *
+ * All the elements of @a x are copied, but unlike the copy constructor,
+ * the allocator object is not copied.
+ */
+ set&
+ operator=(const set& __x)
+ {
+ _M_t = __x._M_t;
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Set move assignment operator.
+ * @param x A %set of identical element and allocator types.
+ *
+ * The contents of @a x are moved into this %set (without copying).
+ * @a x is a valid, but unspecified %set.
+ */
+ set&
+ operator=(set&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ /**
+ * @brief %Set list assignment operator.
+ * @param l An initializer_list.
+ *
+ * This function fills a %set with copies of the elements in the
+ * initializer list @a l.
+ *
+ * Note that the assignment completely changes the %set and
+ * that the resulting %set's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ set&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+
+ // accessors:
+
+ /// Returns the comparison object with which the %set was constructed.
+ key_compare
+ key_comp() const
+ { return _M_t.key_comp(); }
+ /// Returns the comparison object with which the %set was constructed.
+ value_compare
+ value_comp() const
+ { return _M_t.key_comp(); }
+ /// Returns the allocator object with which the %set was constructed.
+ allocator_type
+ get_allocator() const
+ { return _M_t.get_allocator(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * element in the %set. Iteration is done in ascending order according
+ * to the keys.
+ */
+ iterator
+ begin() const
+ { return _M_t.begin(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the last
+ * element in the %set. Iteration is done in ascending order according
+ * to the keys.
+ */
+ iterator
+ end() const
+ { return _M_t.end(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the last
+ * element in the %set. Iteration is done in descending order according
+ * to the keys.
+ */
+ reverse_iterator
+ rbegin() const
+ { return _M_t.rbegin(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to the
+ * last pair in the %set. Iteration is done in descending order
+ * according to the keys.
+ */
+ reverse_iterator
+ rend() const
+ { return _M_t.rend(); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * element in the %set. Iteration is done in ascending order according
+ * to the keys.
+ */
+ iterator
+ cbegin() const
+ { return _M_t.begin(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the last
+ * element in the %set. Iteration is done in ascending order according
+ * to the keys.
+ */
+ iterator
+ cend() const
+ { return _M_t.end(); }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the last
+ * element in the %set. Iteration is done in descending order according
+ * to the keys.
+ */
+ reverse_iterator
+ crbegin() const
+ { return _M_t.rbegin(); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to the
+ * last pair in the %set. Iteration is done in descending order
+ * according to the keys.
+ */
+ reverse_iterator
+ crend() const
+ { return _M_t.rend(); }
+#endif
+
+ /// Returns true if the %set is empty.
+ bool
+ empty() const
+ { return _M_t.empty(); }
+
+ /// Returns the size of the %set.
+ size_type
+ size() const
+ { return _M_t.size(); }
+
+ /// Returns the maximum size of the %set.
+ size_type
+ max_size() const
+ { return _M_t.max_size(); }
+
+ /**
+ * @brief Swaps data with another %set.
+ * @param x A %set of the same element and allocator types.
+ *
+ * This exchanges the elements between two sets in constant time.
+ * (It is only swapping a pointer, an integer, and an instance of
+ * the @c Compare type (which itself is often stateless and empty), so it
+ * should be quite fast.)
+ * Note that the global std::swap() function is specialized such that
+ * std::swap(s1,s2) will feed to this function.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(set&& __x)
+#else
+ swap(set& __x)
+#endif
+ { _M_t.swap(__x._M_t); }
+
+ // insert/erase
+ /**
+ * @brief Attempts to insert an element into the %set.
+ * @param x Element to be inserted.
+ * @return A pair, of which the first element is an iterator that points
+ * to the possibly inserted element, and the second is a bool
+ * that is true if the element was actually inserted.
+ *
+ * This function attempts to insert an element into the %set. A %set
+ * relies on unique keys and thus an element is only inserted if it is
+ * not already present in the %set.
+ *
+ * Insertion requires logarithmic time.
+ */
+ std::pair<iterator, bool>
+ insert(const value_type& __x)
+ {
+ std::pair<typename _Rep_type::iterator, bool> __p =
+ _M_t._M_insert_unique(__x);
+ return std::pair<iterator, bool>(__p.first, __p.second);
+ }
+
+ /**
+ * @brief Attempts to insert an element into the %set.
+ * @param position An iterator that serves as a hint as to where the
+ * element should be inserted.
+ * @param x Element to be inserted.
+ * @return An iterator that points to the element with key of @a x (may
+ * or may not be the element passed in).
+ *
+ * This function is not concerned about whether the insertion took place,
+ * and thus does not return a boolean like the single-argument insert()
+ * does. Note that the first parameter is only a hint and can
+ * potentially improve the performance of the insertion process. A bad
+ * hint would cause no gains in efficiency.
+ *
+ * For more on "hinting", see:
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html
+ *
+ * Insertion requires logarithmic time (if the hint is not taken).
+ */
+ iterator
+ insert(iterator __position, const value_type& __x)
+ { return _M_t._M_insert_unique_(__position, __x); }
+
+ /**
+ * @brief A template function that attempts to insert a range
+ * of elements.
+ * @param first Iterator pointing to the start of the range to be
+ * inserted.
+ * @param last Iterator pointing to the end of the range.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ { _M_t._M_insert_unique(__first, __last); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Attempts to insert a list of elements into the %set.
+ * @param list A std::initializer_list<value_type> of elements
+ * to be inserted.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ void
+ insert(initializer_list<value_type> __l)
+ { this->insert(__l.begin(), __l.end()); }
+#endif
+
+ /**
+ * @brief Erases an element from a %set.
+ * @param position An iterator pointing to the element to be erased.
+ *
+ * This function erases an element, pointed to by the given iterator,
+ * from a %set. Note that this function only erases the element, and
+ * that if the element is itself a pointer, the pointed-to memory is not
+ * touched in any way. Managing the pointer is the user's responsibility.
+ */
+ void
+ erase(iterator __position)
+ { _M_t.erase(__position); }
+
+ /**
+ * @brief Erases elements according to the provided key.
+ * @param x Key of element to be erased.
+ * @return The number of elements erased.
+ *
+ * This function erases all the elements located by the given key from
+ * a %set.
+ * Note that this function only erases the element, and that if
+ * the element is itself a pointer, the pointed-to memory is not touched
+ * in any way. Managing the pointer is the user's responsibility.
+ */
+ size_type
+ erase(const key_type& __x)
+ { return _M_t.erase(__x); }
+
+ /**
+ * @brief Erases a [first,last) range of elements from a %set.
+ * @param first Iterator pointing to the start of the range to be
+ * erased.
+ * @param last Iterator pointing to the end of the range to be erased.
+ *
+ * This function erases a sequence of elements from a %set.
+ * Note that this function only erases the element, and that if
+ * the element is itself a pointer, the pointed-to memory is not touched
+ * in any way. Managing the pointer is the user's responsibility.
+ */
+ void
+ erase(iterator __first, iterator __last)
+ { _M_t.erase(__first, __last); }
+
+ /**
+ * Erases all elements in a %set. Note that this function only erases
+ * the elements, and that if the elements themselves are pointers, the
+ * pointed-to memory is not touched in any way. Managing the pointer is
+ * the user's responsibility.
+ */
+ void
+ clear()
+ { _M_t.clear(); }
+
+ // set operations:
+
+ /**
+ * @brief Finds the number of elements.
+ * @param x Element to located.
+ * @return Number of elements with specified key.
+ *
+ * This function only makes sense for multisets; for set the result will
+ * either be 0 (not present) or 1 (present).
+ */
+ size_type
+ count(const key_type& __x) const
+ { return _M_t.find(__x) == _M_t.end() ? 0 : 1; }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ //@{
+ /**
+ * @brief Tries to locate an element in a %set.
+ * @param x Element to be located.
+ * @return Iterator pointing to sought-after element, or end() if not
+ * found.
+ *
+ * This function takes a key and tries to locate the element with which
+ * the key matches. If successful the function returns an iterator
+ * pointing to the sought after element. If unsuccessful it returns the
+ * past-the-end ( @c end() ) iterator.
+ */
+ iterator
+ find(const key_type& __x)
+ { return _M_t.find(__x); }
+
+ const_iterator
+ find(const key_type& __x) const
+ { return _M_t.find(__x); }
+ //@}
+
+ //@{
+ /**
+ * @brief Finds the beginning of a subsequence matching given key.
+ * @param x Key to be located.
+ * @return Iterator pointing to first element equal to or greater
+ * than key, or end().
+ *
+ * This function returns the first element of a subsequence of elements
+ * that matches the given key. If unsuccessful it returns an iterator
+ * pointing to the first element that has a greater value than given key
+ * or end() if no such element exists.
+ */
+ iterator
+ lower_bound(const key_type& __x)
+ { return _M_t.lower_bound(__x); }
+
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return _M_t.lower_bound(__x); }
+ //@}
+
+ //@{
+ /**
+ * @brief Finds the end of a subsequence matching given key.
+ * @param x Key to be located.
+ * @return Iterator pointing to the first element
+ * greater than key, or end().
+ */
+ iterator
+ upper_bound(const key_type& __x)
+ { return _M_t.upper_bound(__x); }
+
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return _M_t.upper_bound(__x); }
+ //@}
+
+ //@{
+ /**
+ * @brief Finds a subsequence matching given key.
+ * @param x Key to be located.
+ * @return Pair of iterators that possibly points to the subsequence
+ * matching given key.
+ *
+ * This function is equivalent to
+ * @code
+ * std::make_pair(c.lower_bound(val),
+ * c.upper_bound(val))
+ * @endcode
+ * (but is faster than making the calls separately).
+ *
+ * This function probably only makes sense for multisets.
+ */
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __x)
+ { return _M_t.equal_range(__x); }
+
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __x) const
+ { return _M_t.equal_range(__x); }
+ //@}
+
+ template<typename _K1, typename _C1, typename _A1>
+ friend bool
+ operator==(const set<_K1, _C1, _A1>&, const set<_K1, _C1, _A1>&);
+
+ template<typename _K1, typename _C1, typename _A1>
+ friend bool
+ operator<(const set<_K1, _C1, _A1>&, const set<_K1, _C1, _A1>&);
+ };
+
+
+ /**
+ * @brief Set equality comparison.
+ * @param x A %set.
+ * @param y A %set of the same type as @a x.
+ * @return True iff the size and elements of the sets are equal.
+ *
+ * This is an equivalence relation. It is linear in the size of the sets.
+ * Sets are considered equivalent if their sizes are equal, and if
+ * corresponding elements compare equal.
+ */
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator==(const set<_Key, _Compare, _Alloc>& __x,
+ const set<_Key, _Compare, _Alloc>& __y)
+ { return __x._M_t == __y._M_t; }
+
+ /**
+ * @brief Set ordering relation.
+ * @param x A %set.
+ * @param y A %set of the same type as @a x.
+ * @return True iff @a x is lexicographically less than @a y.
+ *
+ * This is a total ordering relation. It is linear in the size of the
+ * maps. The elements must be comparable with @c <.
+ *
+ * See std::lexicographical_compare() for how the determination is made.
+ */
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator<(const set<_Key, _Compare, _Alloc>& __x,
+ const set<_Key, _Compare, _Alloc>& __y)
+ { return __x._M_t < __y._M_t; }
+
+ /// Returns !(x == y).
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator!=(const set<_Key, _Compare, _Alloc>& __x,
+ const set<_Key, _Compare, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ /// Returns y < x.
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator>(const set<_Key, _Compare, _Alloc>& __x,
+ const set<_Key, _Compare, _Alloc>& __y)
+ { return __y < __x; }
+
+ /// Returns !(y < x)
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator<=(const set<_Key, _Compare, _Alloc>& __x,
+ const set<_Key, _Compare, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ /// Returns !(x < y)
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline bool
+ operator>=(const set<_Key, _Compare, _Alloc>& __x,
+ const set<_Key, _Compare, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ /// See std::set::swap().
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline void
+ swap(set<_Key, _Compare, _Alloc>& __x, set<_Key, _Compare, _Alloc>& __y)
+ { __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline void
+ swap(set<_Key, _Compare, _Alloc>&& __x, set<_Key, _Compare, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Key, typename _Compare, typename _Alloc>
+ inline void
+ swap(set<_Key, _Compare, _Alloc>& __x, set<_Key, _Compare, _Alloc>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _STL_SET_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_stack.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_stack.h
new file mode 100644
index 0000000..da301d4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_stack.h
@@ -0,0 +1,299 @@
+// Stack implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_stack.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_STACK_H
+#define _STL_STACK_H 1
+
+#include <bits/concept_check.h>
+#include <debug/debug.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @brief A standard container giving FILO behavior.
+ *
+ * @ingroup sequences
+ *
+ * Meets many of the requirements of a
+ * <a href="tables.html#65">container</a>,
+ * but does not define anything to do with iterators. Very few of the
+ * other standard container interfaces are defined.
+ *
+ * This is not a true container, but an @e adaptor. It holds
+ * another container, and provides a wrapper interface to that
+ * container. The wrapper is what enforces strict
+ * first-in-last-out %stack behavior.
+ *
+ * The second template parameter defines the type of the underlying
+ * sequence/container. It defaults to std::deque, but it can be
+ * any type that supports @c back, @c push_back, and @c pop_front,
+ * such as std::list, std::vector, or an appropriate user-defined
+ * type.
+ *
+ * Members not found in "normal" containers are @c container_type,
+ * which is a typedef for the second Sequence parameter, and @c
+ * push, @c pop, and @c top, which are standard %stack/FILO
+ * operations.
+ */
+ template<typename _Tp, typename _Sequence = deque<_Tp> >
+ class stack
+ {
+ // concept requirements
+ typedef typename _Sequence::value_type _Sequence_value_type;
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept)
+ __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
+
+ template<typename _Tp1, typename _Seq1>
+ friend bool
+ operator==(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&);
+
+ template<typename _Tp1, typename _Seq1>
+ friend bool
+ operator<(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&);
+
+ public:
+ typedef typename _Sequence::value_type value_type;
+ typedef typename _Sequence::reference reference;
+ typedef typename _Sequence::const_reference const_reference;
+ typedef typename _Sequence::size_type size_type;
+ typedef _Sequence container_type;
+
+ protected:
+ // See queue::c for notes on this name.
+ _Sequence c;
+
+ public:
+ // XXX removed old def ctor, added def arg to this one to match 14882
+ /**
+ * @brief Default constructor creates no elements.
+ */
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ explicit
+ stack(const _Sequence& __c = _Sequence())
+ : c(__c) { }
+#else
+ explicit
+ stack(const _Sequence& __c)
+ : c(__c) { }
+
+ explicit
+ stack(_Sequence&& __c = _Sequence())
+ : c(std::move(__c)) { }
+#endif
+
+ /**
+ * Returns true if the %stack is empty.
+ */
+ bool
+ empty() const
+ { return c.empty(); }
+
+ /** Returns the number of elements in the %stack. */
+ size_type
+ size() const
+ { return c.size(); }
+
+ /**
+ * Returns a read/write reference to the data at the first
+ * element of the %stack.
+ */
+ reference
+ top()
+ {
+ __glibcxx_requires_nonempty();
+ return c.back();
+ }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the first
+ * element of the %stack.
+ */
+ const_reference
+ top() const
+ {
+ __glibcxx_requires_nonempty();
+ return c.back();
+ }
+
+ /**
+ * @brief Add data to the top of the %stack.
+ * @param x Data to be added.
+ *
+ * This is a typical %stack operation. The function creates an
+ * element at the top of the %stack and assigns the given data
+ * to it. The time complexity of the operation depends on the
+ * underlying sequence.
+ */
+ void
+ push(const value_type& __x)
+ { c.push_back(__x); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push(value_type&& __x)
+ { c.push_back(std::move(__x)); }
+
+ template<typename... _Args>
+ void
+ emplace(_Args&&... __args)
+ { c.emplace_back(std::forward<_Args>(__args)...); }
+#endif
+
+ /**
+ * @brief Removes first element.
+ *
+ * This is a typical %stack operation. It shrinks the %stack
+ * by one. The time complexity of the operation depends on the
+ * underlying sequence.
+ *
+ * Note that no data is returned, and if the first element's
+ * data is needed, it should be retrieved before pop() is
+ * called.
+ */
+ void
+ pop()
+ {
+ __glibcxx_requires_nonempty();
+ c.pop_back();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ swap(stack&& __s)
+ { c.swap(__s.c); }
+#endif
+ };
+
+ /**
+ * @brief Stack equality comparison.
+ * @param x A %stack.
+ * @param y A %stack of the same type as @a x.
+ * @return True iff the size and elements of the stacks are equal.
+ *
+ * This is an equivalence relation. Complexity and semantics
+ * depend on the underlying sequence type, but the expected rules
+ * are: this relation is linear in the size of the sequences, and
+ * stacks are considered equivalent if their sequences compare
+ * equal.
+ */
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator==(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
+ { return __x.c == __y.c; }
+
+ /**
+ * @brief Stack ordering relation.
+ * @param x A %stack.
+ * @param y A %stack of the same type as @a x.
+ * @return True iff @a x is lexicographically less than @a y.
+ *
+ * This is an total ordering relation. Complexity and semantics
+ * depend on the underlying sequence type, but the expected rules
+ * are: this relation is linear in the size of the sequences, the
+ * elements must be comparable with @c <, and
+ * std::lexicographical_compare() is usually used to make the
+ * determination.
+ */
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator<(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
+ { return __x.c < __y.c; }
+
+ /// Based on operator==
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator!=(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
+ { return !(__x == __y); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator>(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
+ { return __y < __x; }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator<=(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
+ { return !(__y < __x); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator>=(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
+ { return !(__x < __y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Seq>
+ inline void
+ swap(stack<_Tp, _Seq>& __x, stack<_Tp, _Seq>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Seq>
+ inline void
+ swap(stack<_Tp, _Seq>&& __x, stack<_Tp, _Seq>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Seq>
+ inline void
+ swap(stack<_Tp, _Seq>& __x, stack<_Tp, _Seq>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_STACK_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_tempbuf.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_tempbuf.h
new file mode 100644
index 0000000..a3b0810
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_tempbuf.h
@@ -0,0 +1,206 @@
+// Temporary buffer implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_tempbuf.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_TEMPBUF_H
+#define _STL_TEMPBUF_H 1
+
+#include <bits/stl_algobase.h>
+#include <bits/stl_construct.h>
+#include <bits/stl_uninitialized.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @brief Allocates a temporary buffer.
+ * @param len The number of objects of type Tp.
+ * @return See full description.
+ *
+ * Reinventing the wheel, but this time with prettier spokes!
+ *
+ * This function tries to obtain storage for @c len adjacent Tp
+ * objects. The objects themselves are not constructed, of course.
+ * A pair<> is returned containing "the buffer s address and
+ * capacity (in the units of sizeof(Tp)), or a pair of 0 values if
+ * no storage can be obtained." Note that the capacity obtained
+ * may be less than that requested if the memory is unavailable;
+ * you should compare len with the .second return value.
+ *
+ * Provides the nothrow exception guarantee.
+ */
+ template<typename _Tp>
+ pair<_Tp*, ptrdiff_t>
+ get_temporary_buffer(ptrdiff_t __len)
+ {
+ const ptrdiff_t __max =
+ __gnu_cxx::__numeric_traits<ptrdiff_t>::__max / sizeof(_Tp);
+ if (__len > __max)
+ __len = __max;
+
+ while (__len > 0)
+ {
+ _Tp* __tmp = static_cast<_Tp*>(::operator new(__len * sizeof(_Tp),
+ std::nothrow));
+ if (__tmp != 0)
+ return std::pair<_Tp*, ptrdiff_t>(__tmp, __len);
+ __len /= 2;
+ }
+ return std::pair<_Tp*, ptrdiff_t>(static_cast<_Tp*>(0), 0);
+ }
+
+ /**
+ * @brief The companion to get_temporary_buffer().
+ * @param p A buffer previously allocated by get_temporary_buffer.
+ * @return None.
+ *
+ * Frees the memory pointed to by p.
+ */
+ template<typename _Tp>
+ inline void
+ return_temporary_buffer(_Tp* __p)
+ { ::operator delete(__p, std::nothrow); }
+
+
+ /**
+ * This class is used in two places: stl_algo.h and ext/memory,
+ * where it is wrapped as the temporary_buffer class. See
+ * temporary_buffer docs for more notes.
+ */
+ template<typename _ForwardIterator, typename _Tp>
+ class _Temporary_buffer
+ {
+ // concept requirements
+ __glibcxx_class_requires(_ForwardIterator, _ForwardIteratorConcept)
+
+ public:
+ typedef _Tp value_type;
+ typedef value_type* pointer;
+ typedef pointer iterator;
+ typedef ptrdiff_t size_type;
+
+ protected:
+ size_type _M_original_len;
+ size_type _M_len;
+ pointer _M_buffer;
+
+ public:
+ /// As per Table mumble.
+ size_type
+ size() const
+ { return _M_len; }
+
+ /// Returns the size requested by the constructor; may be >size().
+ size_type
+ requested_size() const
+ { return _M_original_len; }
+
+ /// As per Table mumble.
+ iterator
+ begin()
+ { return _M_buffer; }
+
+ /// As per Table mumble.
+ iterator
+ end()
+ { return _M_buffer + _M_len; }
+
+ /**
+ * Constructs a temporary buffer of a size somewhere between
+ * zero and the size of the given range.
+ */
+ _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last);
+
+ ~_Temporary_buffer()
+ {
+ std::_Destroy(_M_buffer, _M_buffer + _M_len);
+ std::return_temporary_buffer(_M_buffer);
+ }
+
+ private:
+ // Disable copy constructor and assignment operator.
+ _Temporary_buffer(const _Temporary_buffer&);
+
+ void
+ operator=(const _Temporary_buffer&);
+ };
+
+ template<typename _ForwardIterator, typename _Tp>
+ _Temporary_buffer<_ForwardIterator, _Tp>::
+ _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last)
+ : _M_original_len(std::distance(__first, __last)),
+ _M_len(0), _M_buffer(0)
+ {
+ __try
+ {
+ std::pair<pointer, size_type> __p(std::get_temporary_buffer<
+ value_type>(_M_original_len));
+ _M_buffer = __p.first;
+ _M_len = __p.second;
+ if (!__is_pod(_Tp) && _M_len > 0)
+ std::uninitialized_fill_n(_M_buffer, _M_len, *__first);
+ }
+ __catch(...)
+ {
+ std::return_temporary_buffer(_M_buffer);
+ _M_buffer = 0;
+ _M_len = 0;
+ __throw_exception_again;
+ }
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_TEMPBUF_H */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_tree.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_tree.h
new file mode 100644
index 0000000..2e56736
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_tree.h
@@ -0,0 +1,1495 @@
+// RB tree implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ */
+
+/** @file stl_tree.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_TREE_H
+#define _STL_TREE_H 1
+
+#include <bits/stl_algobase.h>
+#include <bits/allocator.h>
+#include <bits/stl_function.h>
+#include <bits/cpp_type_traits.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Red-black tree class, designed for use in implementing STL
+ // associative containers (set, multiset, map, and multimap). The
+ // insertion and deletion algorithms are based on those in Cormen,
+ // Leiserson, and Rivest, Introduction to Algorithms (MIT Press,
+ // 1990), except that
+ //
+ // (1) the header cell is maintained with links not only to the root
+ // but also to the leftmost node of the tree, to enable constant
+ // time begin(), and to the rightmost node of the tree, to enable
+ // linear time performance when used with the generic set algorithms
+ // (set_union, etc.)
+ //
+ // (2) when a node being deleted has two children its successor node
+ // is relinked into its place, rather than copied, so that the only
+ // iterators invalidated are those referring to the deleted node.
+
+ enum _Rb_tree_color { _S_red = false, _S_black = true };
+
+ struct _Rb_tree_node_base
+ {
+ typedef _Rb_tree_node_base* _Base_ptr;
+ typedef const _Rb_tree_node_base* _Const_Base_ptr;
+
+ _Rb_tree_color _M_color;
+ _Base_ptr _M_parent;
+ _Base_ptr _M_left;
+ _Base_ptr _M_right;
+
+ static _Base_ptr
+ _S_minimum(_Base_ptr __x)
+ {
+ while (__x->_M_left != 0) __x = __x->_M_left;
+ return __x;
+ }
+
+ static _Const_Base_ptr
+ _S_minimum(_Const_Base_ptr __x)
+ {
+ while (__x->_M_left != 0) __x = __x->_M_left;
+ return __x;
+ }
+
+ static _Base_ptr
+ _S_maximum(_Base_ptr __x)
+ {
+ while (__x->_M_right != 0) __x = __x->_M_right;
+ return __x;
+ }
+
+ static _Const_Base_ptr
+ _S_maximum(_Const_Base_ptr __x)
+ {
+ while (__x->_M_right != 0) __x = __x->_M_right;
+ return __x;
+ }
+ };
+
+ template<typename _Val>
+ struct _Rb_tree_node : public _Rb_tree_node_base
+ {
+ typedef _Rb_tree_node<_Val>* _Link_type;
+ _Val _M_value_field;
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ _Rb_tree_node(_Args&&... __args)
+ : _Rb_tree_node_base(),
+ _M_value_field(std::forward<_Args>(__args)...) { }
+#endif
+ };
+
+ _Rb_tree_node_base*
+ _Rb_tree_increment(_Rb_tree_node_base* __x);
+
+ const _Rb_tree_node_base*
+ _Rb_tree_increment(const _Rb_tree_node_base* __x);
+
+ _Rb_tree_node_base*
+ _Rb_tree_decrement(_Rb_tree_node_base* __x);
+
+ const _Rb_tree_node_base*
+ _Rb_tree_decrement(const _Rb_tree_node_base* __x);
+
+ template<typename _Tp>
+ struct _Rb_tree_iterator
+ {
+ typedef _Tp value_type;
+ typedef _Tp& reference;
+ typedef _Tp* pointer;
+
+ typedef bidirectional_iterator_tag iterator_category;
+ typedef ptrdiff_t difference_type;
+
+ typedef _Rb_tree_iterator<_Tp> _Self;
+ typedef _Rb_tree_node_base::_Base_ptr _Base_ptr;
+ typedef _Rb_tree_node<_Tp>* _Link_type;
+
+ _Rb_tree_iterator()
+ : _M_node() { }
+
+ explicit
+ _Rb_tree_iterator(_Link_type __x)
+ : _M_node(__x) { }
+
+ reference
+ operator*() const
+ { return static_cast<_Link_type>(_M_node)->_M_value_field; }
+
+ pointer
+ operator->() const
+ { return &static_cast<_Link_type>(_M_node)->_M_value_field; }
+
+ _Self&
+ operator++()
+ {
+ _M_node = _Rb_tree_increment(_M_node);
+ return *this;
+ }
+
+ _Self
+ operator++(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _Rb_tree_increment(_M_node);
+ return __tmp;
+ }
+
+ _Self&
+ operator--()
+ {
+ _M_node = _Rb_tree_decrement(_M_node);
+ return *this;
+ }
+
+ _Self
+ operator--(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _Rb_tree_decrement(_M_node);
+ return __tmp;
+ }
+
+ bool
+ operator==(const _Self& __x) const
+ { return _M_node == __x._M_node; }
+
+ bool
+ operator!=(const _Self& __x) const
+ { return _M_node != __x._M_node; }
+
+ _Base_ptr _M_node;
+ };
+
+ template<typename _Tp>
+ struct _Rb_tree_const_iterator
+ {
+ typedef _Tp value_type;
+ typedef const _Tp& reference;
+ typedef const _Tp* pointer;
+
+ typedef _Rb_tree_iterator<_Tp> iterator;
+
+ typedef bidirectional_iterator_tag iterator_category;
+ typedef ptrdiff_t difference_type;
+
+ typedef _Rb_tree_const_iterator<_Tp> _Self;
+ typedef _Rb_tree_node_base::_Const_Base_ptr _Base_ptr;
+ typedef const _Rb_tree_node<_Tp>* _Link_type;
+
+ _Rb_tree_const_iterator()
+ : _M_node() { }
+
+ explicit
+ _Rb_tree_const_iterator(_Link_type __x)
+ : _M_node(__x) { }
+
+ _Rb_tree_const_iterator(const iterator& __it)
+ : _M_node(__it._M_node) { }
+
+ reference
+ operator*() const
+ { return static_cast<_Link_type>(_M_node)->_M_value_field; }
+
+ pointer
+ operator->() const
+ { return &static_cast<_Link_type>(_M_node)->_M_value_field; }
+
+ _Self&
+ operator++()
+ {
+ _M_node = _Rb_tree_increment(_M_node);
+ return *this;
+ }
+
+ _Self
+ operator++(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _Rb_tree_increment(_M_node);
+ return __tmp;
+ }
+
+ _Self&
+ operator--()
+ {
+ _M_node = _Rb_tree_decrement(_M_node);
+ return *this;
+ }
+
+ _Self
+ operator--(int)
+ {
+ _Self __tmp = *this;
+ _M_node = _Rb_tree_decrement(_M_node);
+ return __tmp;
+ }
+
+ bool
+ operator==(const _Self& __x) const
+ { return _M_node == __x._M_node; }
+
+ bool
+ operator!=(const _Self& __x) const
+ { return _M_node != __x._M_node; }
+
+ _Base_ptr _M_node;
+ };
+
+ template<typename _Val>
+ inline bool
+ operator==(const _Rb_tree_iterator<_Val>& __x,
+ const _Rb_tree_const_iterator<_Val>& __y)
+ { return __x._M_node == __y._M_node; }
+
+ template<typename _Val>
+ inline bool
+ operator!=(const _Rb_tree_iterator<_Val>& __x,
+ const _Rb_tree_const_iterator<_Val>& __y)
+ { return __x._M_node != __y._M_node; }
+
+ void
+ _Rb_tree_insert_and_rebalance(const bool __insert_left,
+ _Rb_tree_node_base* __x,
+ _Rb_tree_node_base* __p,
+ _Rb_tree_node_base& __header);
+
+ _Rb_tree_node_base*
+ _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z,
+ _Rb_tree_node_base& __header);
+
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc = allocator<_Val> >
+ class _Rb_tree
+ {
+ typedef typename _Alloc::template rebind<_Rb_tree_node<_Val> >::other
+ _Node_allocator;
+
+ protected:
+ typedef _Rb_tree_node_base* _Base_ptr;
+ typedef const _Rb_tree_node_base* _Const_Base_ptr;
+
+ public:
+ typedef _Key key_type;
+ typedef _Val value_type;
+ typedef value_type* pointer;
+ typedef const value_type* const_pointer;
+ typedef value_type& reference;
+ typedef const value_type& const_reference;
+ typedef _Rb_tree_node<_Val>* _Link_type;
+ typedef const _Rb_tree_node<_Val>* _Const_Link_type;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Alloc allocator_type;
+
+ _Node_allocator&
+ _M_get_Node_allocator()
+ { return *static_cast<_Node_allocator*>(&this->_M_impl); }
+
+ const _Node_allocator&
+ _M_get_Node_allocator() const
+ { return *static_cast<const _Node_allocator*>(&this->_M_impl); }
+
+ allocator_type
+ get_allocator() const
+ { return allocator_type(_M_get_Node_allocator()); }
+
+ protected:
+ _Link_type
+ _M_get_node()
+ { return _M_impl._Node_allocator::allocate(1); }
+
+ void
+ _M_put_node(_Link_type __p)
+ { _M_impl._Node_allocator::deallocate(__p, 1); }
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ _Link_type
+ _M_create_node(const value_type& __x)
+ {
+ _Link_type __tmp = _M_get_node();
+ __try
+ { get_allocator().construct(&__tmp->_M_value_field, __x); }
+ __catch(...)
+ {
+ _M_put_node(__tmp);
+ __throw_exception_again;
+ }
+ return __tmp;
+ }
+
+ void
+ _M_destroy_node(_Link_type __p)
+ {
+ get_allocator().destroy(&__p->_M_value_field);
+ _M_put_node(__p);
+ }
+#else
+ template<typename... _Args>
+ _Link_type
+ _M_create_node(_Args&&... __args)
+ {
+ _Link_type __tmp = _M_get_node();
+ __try
+ {
+ _M_get_Node_allocator().construct(__tmp,
+ std::forward<_Args>(__args)...);
+ }
+ __catch(...)
+ {
+ _M_put_node(__tmp);
+ __throw_exception_again;
+ }
+ return __tmp;
+ }
+
+ void
+ _M_destroy_node(_Link_type __p)
+ {
+ _M_get_Node_allocator().destroy(__p);
+ _M_put_node(__p);
+ }
+#endif
+
+ _Link_type
+ _M_clone_node(_Const_Link_type __x)
+ {
+ _Link_type __tmp = _M_create_node(__x->_M_value_field);
+ __tmp->_M_color = __x->_M_color;
+ __tmp->_M_left = 0;
+ __tmp->_M_right = 0;
+ return __tmp;
+ }
+
+ protected:
+ template<typename _Key_compare,
+ bool _Is_pod_comparator = __is_pod(_Key_compare)>
+ struct _Rb_tree_impl : public _Node_allocator
+ {
+ _Key_compare _M_key_compare;
+ _Rb_tree_node_base _M_header;
+ size_type _M_node_count; // Keeps track of size of tree.
+
+ _Rb_tree_impl()
+ : _Node_allocator(), _M_key_compare(), _M_header(),
+ _M_node_count(0)
+ { _M_initialize(); }
+
+ _Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a)
+ : _Node_allocator(__a), _M_key_compare(__comp), _M_header(),
+ _M_node_count(0)
+ { _M_initialize(); }
+
+ private:
+ void
+ _M_initialize()
+ {
+ this->_M_header._M_color = _S_red;
+ this->_M_header._M_parent = 0;
+ this->_M_header._M_left = &this->_M_header;
+ this->_M_header._M_right = &this->_M_header;
+ }
+ };
+
+ _Rb_tree_impl<_Compare> _M_impl;
+
+ protected:
+ _Base_ptr&
+ _M_root()
+ { return this->_M_impl._M_header._M_parent; }
+
+ _Const_Base_ptr
+ _M_root() const
+ { return this->_M_impl._M_header._M_parent; }
+
+ _Base_ptr&
+ _M_leftmost()
+ { return this->_M_impl._M_header._M_left; }
+
+ _Const_Base_ptr
+ _M_leftmost() const
+ { return this->_M_impl._M_header._M_left; }
+
+ _Base_ptr&
+ _M_rightmost()
+ { return this->_M_impl._M_header._M_right; }
+
+ _Const_Base_ptr
+ _M_rightmost() const
+ { return this->_M_impl._M_header._M_right; }
+
+ _Link_type
+ _M_begin()
+ { return static_cast<_Link_type>(this->_M_impl._M_header._M_parent); }
+
+ _Const_Link_type
+ _M_begin() const
+ {
+ return static_cast<_Const_Link_type>
+ (this->_M_impl._M_header._M_parent);
+ }
+
+ _Link_type
+ _M_end()
+ { return static_cast<_Link_type>(&this->_M_impl._M_header); }
+
+ _Const_Link_type
+ _M_end() const
+ { return static_cast<_Const_Link_type>(&this->_M_impl._M_header); }
+
+ static const_reference
+ _S_value(_Const_Link_type __x)
+ { return __x->_M_value_field; }
+
+ static const _Key&
+ _S_key(_Const_Link_type __x)
+ { return _KeyOfValue()(_S_value(__x)); }
+
+ static _Link_type
+ _S_left(_Base_ptr __x)
+ { return static_cast<_Link_type>(__x->_M_left); }
+
+ static _Const_Link_type
+ _S_left(_Const_Base_ptr __x)
+ { return static_cast<_Const_Link_type>(__x->_M_left); }
+
+ static _Link_type
+ _S_right(_Base_ptr __x)
+ { return static_cast<_Link_type>(__x->_M_right); }
+
+ static _Const_Link_type
+ _S_right(_Const_Base_ptr __x)
+ { return static_cast<_Const_Link_type>(__x->_M_right); }
+
+ static const_reference
+ _S_value(_Const_Base_ptr __x)
+ { return static_cast<_Const_Link_type>(__x)->_M_value_field; }
+
+ static const _Key&
+ _S_key(_Const_Base_ptr __x)
+ { return _KeyOfValue()(_S_value(__x)); }
+
+ static _Base_ptr
+ _S_minimum(_Base_ptr __x)
+ { return _Rb_tree_node_base::_S_minimum(__x); }
+
+ static _Const_Base_ptr
+ _S_minimum(_Const_Base_ptr __x)
+ { return _Rb_tree_node_base::_S_minimum(__x); }
+
+ static _Base_ptr
+ _S_maximum(_Base_ptr __x)
+ { return _Rb_tree_node_base::_S_maximum(__x); }
+
+ static _Const_Base_ptr
+ _S_maximum(_Const_Base_ptr __x)
+ { return _Rb_tree_node_base::_S_maximum(__x); }
+
+ public:
+ typedef _Rb_tree_iterator<value_type> iterator;
+ typedef _Rb_tree_const_iterator<value_type> const_iterator;
+
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ private:
+ iterator
+ _M_insert_(_Const_Base_ptr __x, _Const_Base_ptr __y,
+ const value_type& __v);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 233. Insertion hints in associative containers.
+ iterator
+ _M_insert_lower(_Base_ptr __x, _Base_ptr __y, const value_type& __v);
+
+ iterator
+ _M_insert_equal_lower(const value_type& __x);
+
+ _Link_type
+ _M_copy(_Const_Link_type __x, _Link_type __p);
+
+ void
+ _M_erase(_Link_type __x);
+
+ iterator
+ _M_lower_bound(_Link_type __x, _Link_type __y,
+ const _Key& __k);
+
+ const_iterator
+ _M_lower_bound(_Const_Link_type __x, _Const_Link_type __y,
+ const _Key& __k) const;
+
+ iterator
+ _M_upper_bound(_Link_type __x, _Link_type __y,
+ const _Key& __k);
+
+ const_iterator
+ _M_upper_bound(_Const_Link_type __x, _Const_Link_type __y,
+ const _Key& __k) const;
+
+ public:
+ // allocation/deallocation
+ _Rb_tree() { }
+
+ _Rb_tree(const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_impl(__comp, __a) { }
+
+ _Rb_tree(const _Rb_tree& __x)
+ : _M_impl(__x._M_impl._M_key_compare, __x._M_get_Node_allocator())
+ {
+ if (__x._M_root() != 0)
+ {
+ _M_root() = _M_copy(__x._M_begin(), _M_end());
+ _M_leftmost() = _S_minimum(_M_root());
+ _M_rightmost() = _S_maximum(_M_root());
+ _M_impl._M_node_count = __x._M_impl._M_node_count;
+ }
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ _Rb_tree(_Rb_tree&& __x);
+#endif
+
+ ~_Rb_tree()
+ { _M_erase(_M_begin()); }
+
+ _Rb_tree&
+ operator=(const _Rb_tree& __x);
+
+ // Accessors.
+ _Compare
+ key_comp() const
+ { return _M_impl._M_key_compare; }
+
+ iterator
+ begin()
+ {
+ return iterator(static_cast<_Link_type>
+ (this->_M_impl._M_header._M_left));
+ }
+
+ const_iterator
+ begin() const
+ {
+ return const_iterator(static_cast<_Const_Link_type>
+ (this->_M_impl._M_header._M_left));
+ }
+
+ iterator
+ end()
+ { return iterator(static_cast<_Link_type>(&this->_M_impl._M_header)); }
+
+ const_iterator
+ end() const
+ {
+ return const_iterator(static_cast<_Const_Link_type>
+ (&this->_M_impl._M_header));
+ }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+ bool
+ empty() const
+ { return _M_impl._M_node_count == 0; }
+
+ size_type
+ size() const
+ { return _M_impl._M_node_count; }
+
+ size_type
+ max_size() const
+ { return _M_get_Node_allocator().max_size(); }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(_Rb_tree&& __t);
+#else
+ swap(_Rb_tree& __t);
+#endif
+
+ // Insert/erase.
+ pair<iterator, bool>
+ _M_insert_unique(const value_type& __x);
+
+ iterator
+ _M_insert_equal(const value_type& __x);
+
+ iterator
+ _M_insert_unique_(const_iterator __position, const value_type& __x);
+
+ iterator
+ _M_insert_equal_(const_iterator __position, const value_type& __x);
+
+ template<typename _InputIterator>
+ void
+ _M_insert_unique(_InputIterator __first, _InputIterator __last);
+
+ template<typename _InputIterator>
+ void
+ _M_insert_equal(_InputIterator __first, _InputIterator __last);
+
+ void
+ erase(iterator __position);
+
+ void
+ erase(const_iterator __position);
+
+ size_type
+ erase(const key_type& __x);
+
+ void
+ erase(iterator __first, iterator __last);
+
+ void
+ erase(const_iterator __first, const_iterator __last);
+
+ void
+ erase(const key_type* __first, const key_type* __last);
+
+ void
+ clear()
+ {
+ _M_erase(_M_begin());
+ _M_leftmost() = _M_end();
+ _M_root() = 0;
+ _M_rightmost() = _M_end();
+ _M_impl._M_node_count = 0;
+ }
+
+ // Set operations.
+ iterator
+ find(const key_type& __k);
+
+ const_iterator
+ find(const key_type& __k) const;
+
+ size_type
+ count(const key_type& __k) const;
+
+ iterator
+ lower_bound(const key_type& __k)
+ { return _M_lower_bound(_M_begin(), _M_end(), __k); }
+
+ const_iterator
+ lower_bound(const key_type& __k) const
+ { return _M_lower_bound(_M_begin(), _M_end(), __k); }
+
+ iterator
+ upper_bound(const key_type& __k)
+ { return _M_upper_bound(_M_begin(), _M_end(), __k); }
+
+ const_iterator
+ upper_bound(const key_type& __k) const
+ { return _M_upper_bound(_M_begin(), _M_end(), __k); }
+
+ pair<iterator, iterator>
+ equal_range(const key_type& __k);
+
+ pair<const_iterator, const_iterator>
+ equal_range(const key_type& __k) const;
+
+ // Debugging.
+ bool
+ __rb_verify() const;
+ };
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline bool
+ operator==(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+ const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+ {
+ return __x.size() == __y.size()
+ && std::equal(__x.begin(), __x.end(), __y.begin());
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline bool
+ operator<(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+ const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+ {
+ return std::lexicographical_compare(__x.begin(), __x.end(),
+ __y.begin(), __y.end());
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline bool
+ operator!=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+ const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline bool
+ operator>(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+ const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+ { return __y < __x; }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline bool
+ operator<=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+ const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline bool
+ operator>=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+ const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline void
+ swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+ { __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _Rb_tree(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&& __x)
+ : _M_impl(__x._M_impl._M_key_compare, __x._M_get_Node_allocator())
+ {
+ if (__x._M_root() != 0)
+ {
+ _M_root() = __x._M_root();
+ _M_leftmost() = __x._M_leftmost();
+ _M_rightmost() = __x._M_rightmost();
+ _M_root()->_M_parent = _M_end();
+
+ __x._M_root() = 0;
+ __x._M_leftmost() = __x._M_end();
+ __x._M_rightmost() = __x._M_end();
+
+ this->_M_impl._M_node_count = __x._M_impl._M_node_count;
+ __x._M_impl._M_node_count = 0;
+ }
+ }
+#endif
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ operator=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x)
+ {
+ if (this != &__x)
+ {
+ // Note that _Key may be a constant type.
+ clear();
+ _M_impl._M_key_compare = __x._M_impl._M_key_compare;
+ if (__x._M_root() != 0)
+ {
+ _M_root() = _M_copy(__x._M_begin(), _M_end());
+ _M_leftmost() = _S_minimum(_M_root());
+ _M_rightmost() = _S_maximum(_M_root());
+ _M_impl._M_node_count = __x._M_impl._M_node_count;
+ }
+ }
+ return *this;
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_insert_(_Const_Base_ptr __x, _Const_Base_ptr __p, const _Val& __v)
+ {
+ bool __insert_left = (__x != 0 || __p == _M_end()
+ || _M_impl._M_key_compare(_KeyOfValue()(__v),
+ _S_key(__p)));
+
+ _Link_type __z = _M_create_node(__v);
+
+ _Rb_tree_insert_and_rebalance(__insert_left, __z,
+ const_cast<_Base_ptr>(__p),
+ this->_M_impl._M_header);
+ ++_M_impl._M_node_count;
+ return iterator(__z);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_insert_lower(_Base_ptr __x, _Base_ptr __p, const _Val& __v)
+ {
+ bool __insert_left = (__x != 0 || __p == _M_end()
+ || !_M_impl._M_key_compare(_S_key(__p),
+ _KeyOfValue()(__v)));
+
+ _Link_type __z = _M_create_node(__v);
+
+ _Rb_tree_insert_and_rebalance(__insert_left, __z, __p,
+ this->_M_impl._M_header);
+ ++_M_impl._M_node_count;
+ return iterator(__z);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_insert_equal_lower(const _Val& __v)
+ {
+ _Link_type __x = _M_begin();
+ _Link_type __y = _M_end();
+ while (__x != 0)
+ {
+ __y = __x;
+ __x = !_M_impl._M_key_compare(_S_key(__x), _KeyOfValue()(__v)) ?
+ _S_left(__x) : _S_right(__x);
+ }
+ return _M_insert_lower(__x, __y, __v);
+ }
+
+ template<typename _Key, typename _Val, typename _KoV,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::_Link_type
+ _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::
+ _M_copy(_Const_Link_type __x, _Link_type __p)
+ {
+ // Structural copy. __x and __p must be non-null.
+ _Link_type __top = _M_clone_node(__x);
+ __top->_M_parent = __p;
+
+ __try
+ {
+ if (__x->_M_right)
+ __top->_M_right = _M_copy(_S_right(__x), __top);
+ __p = __top;
+ __x = _S_left(__x);
+
+ while (__x != 0)
+ {
+ _Link_type __y = _M_clone_node(__x);
+ __p->_M_left = __y;
+ __y->_M_parent = __p;
+ if (__x->_M_right)
+ __y->_M_right = _M_copy(_S_right(__x), __y);
+ __p = __y;
+ __x = _S_left(__x);
+ }
+ }
+ __catch(...)
+ {
+ _M_erase(__top);
+ __throw_exception_again;
+ }
+ return __top;
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_erase(_Link_type __x)
+ {
+ // Erase without rebalancing.
+ while (__x != 0)
+ {
+ _M_erase(_S_right(__x));
+ _Link_type __y = _S_left(__x);
+ _M_destroy_node(__x);
+ __x = __y;
+ }
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_lower_bound(_Link_type __x, _Link_type __y,
+ const _Key& __k)
+ {
+ while (__x != 0)
+ if (!_M_impl._M_key_compare(_S_key(__x), __k))
+ __y = __x, __x = _S_left(__x);
+ else
+ __x = _S_right(__x);
+ return iterator(__y);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::const_iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_lower_bound(_Const_Link_type __x, _Const_Link_type __y,
+ const _Key& __k) const
+ {
+ while (__x != 0)
+ if (!_M_impl._M_key_compare(_S_key(__x), __k))
+ __y = __x, __x = _S_left(__x);
+ else
+ __x = _S_right(__x);
+ return const_iterator(__y);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_upper_bound(_Link_type __x, _Link_type __y,
+ const _Key& __k)
+ {
+ while (__x != 0)
+ if (_M_impl._M_key_compare(__k, _S_key(__x)))
+ __y = __x, __x = _S_left(__x);
+ else
+ __x = _S_right(__x);
+ return iterator(__y);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::const_iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_upper_bound(_Const_Link_type __x, _Const_Link_type __y,
+ const _Key& __k) const
+ {
+ while (__x != 0)
+ if (_M_impl._M_key_compare(__k, _S_key(__x)))
+ __y = __x, __x = _S_left(__x);
+ else
+ __x = _S_right(__x);
+ return const_iterator(__y);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::iterator,
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::iterator>
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ equal_range(const _Key& __k)
+ {
+ _Link_type __x = _M_begin();
+ _Link_type __y = _M_end();
+ while (__x != 0)
+ {
+ if (_M_impl._M_key_compare(_S_key(__x), __k))
+ __x = _S_right(__x);
+ else if (_M_impl._M_key_compare(__k, _S_key(__x)))
+ __y = __x, __x = _S_left(__x);
+ else
+ {
+ _Link_type __xu(__x), __yu(__y);
+ __y = __x, __x = _S_left(__x);
+ __xu = _S_right(__xu);
+ return pair<iterator,
+ iterator>(_M_lower_bound(__x, __y, __k),
+ _M_upper_bound(__xu, __yu, __k));
+ }
+ }
+ return pair<iterator, iterator>(iterator(__y),
+ iterator(__y));
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::const_iterator,
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::const_iterator>
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ equal_range(const _Key& __k) const
+ {
+ _Const_Link_type __x = _M_begin();
+ _Const_Link_type __y = _M_end();
+ while (__x != 0)
+ {
+ if (_M_impl._M_key_compare(_S_key(__x), __k))
+ __x = _S_right(__x);
+ else if (_M_impl._M_key_compare(__k, _S_key(__x)))
+ __y = __x, __x = _S_left(__x);
+ else
+ {
+ _Const_Link_type __xu(__x), __yu(__y);
+ __y = __x, __x = _S_left(__x);
+ __xu = _S_right(__xu);
+ return pair<const_iterator,
+ const_iterator>(_M_lower_bound(__x, __y, __k),
+ _M_upper_bound(__xu, __yu, __k));
+ }
+ }
+ return pair<const_iterator, const_iterator>(const_iterator(__y),
+ const_iterator(__y));
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&& __t)
+#else
+ swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __t)
+#endif
+ {
+ if (_M_root() == 0)
+ {
+ if (__t._M_root() != 0)
+ {
+ _M_root() = __t._M_root();
+ _M_leftmost() = __t._M_leftmost();
+ _M_rightmost() = __t._M_rightmost();
+ _M_root()->_M_parent = _M_end();
+
+ __t._M_root() = 0;
+ __t._M_leftmost() = __t._M_end();
+ __t._M_rightmost() = __t._M_end();
+ }
+ }
+ else if (__t._M_root() == 0)
+ {
+ __t._M_root() = _M_root();
+ __t._M_leftmost() = _M_leftmost();
+ __t._M_rightmost() = _M_rightmost();
+ __t._M_root()->_M_parent = __t._M_end();
+
+ _M_root() = 0;
+ _M_leftmost() = _M_end();
+ _M_rightmost() = _M_end();
+ }
+ else
+ {
+ std::swap(_M_root(),__t._M_root());
+ std::swap(_M_leftmost(),__t._M_leftmost());
+ std::swap(_M_rightmost(),__t._M_rightmost());
+
+ _M_root()->_M_parent = _M_end();
+ __t._M_root()->_M_parent = __t._M_end();
+ }
+ // No need to swap header's color as it does not change.
+ std::swap(this->_M_impl._M_node_count, __t._M_impl._M_node_count);
+ std::swap(this->_M_impl._M_key_compare, __t._M_impl._M_key_compare);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 431. Swapping containers with unequal allocators.
+ std::__alloc_swap<_Node_allocator>::
+ _S_do_it(_M_get_Node_allocator(), __t._M_get_Node_allocator());
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::iterator, bool>
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_insert_unique(const _Val& __v)
+ {
+ _Link_type __x = _M_begin();
+ _Link_type __y = _M_end();
+ bool __comp = true;
+ while (__x != 0)
+ {
+ __y = __x;
+ __comp = _M_impl._M_key_compare(_KeyOfValue()(__v), _S_key(__x));
+ __x = __comp ? _S_left(__x) : _S_right(__x);
+ }
+ iterator __j = iterator(__y);
+ if (__comp)
+ {
+ if (__j == begin())
+ return pair<iterator, bool>(_M_insert_(__x, __y, __v), true);
+ else
+ --__j;
+ }
+ if (_M_impl._M_key_compare(_S_key(__j._M_node), _KeyOfValue()(__v)))
+ return pair<iterator, bool>(_M_insert_(__x, __y, __v), true);
+ return pair<iterator, bool>(__j, false);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_insert_equal(const _Val& __v)
+ {
+ _Link_type __x = _M_begin();
+ _Link_type __y = _M_end();
+ while (__x != 0)
+ {
+ __y = __x;
+ __x = _M_impl._M_key_compare(_KeyOfValue()(__v), _S_key(__x)) ?
+ _S_left(__x) : _S_right(__x);
+ }
+ return _M_insert_(__x, __y, __v);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_insert_unique_(const_iterator __position, const _Val& __v)
+ {
+ // end()
+ if (__position._M_node == _M_end())
+ {
+ if (size() > 0
+ && _M_impl._M_key_compare(_S_key(_M_rightmost()),
+ _KeyOfValue()(__v)))
+ return _M_insert_(0, _M_rightmost(), __v);
+ else
+ return _M_insert_unique(__v).first;
+ }
+ else if (_M_impl._M_key_compare(_KeyOfValue()(__v),
+ _S_key(__position._M_node)))
+ {
+ // First, try before...
+ const_iterator __before = __position;
+ if (__position._M_node == _M_leftmost()) // begin()
+ return _M_insert_(_M_leftmost(), _M_leftmost(), __v);
+ else if (_M_impl._M_key_compare(_S_key((--__before)._M_node),
+ _KeyOfValue()(__v)))
+ {
+ if (_S_right(__before._M_node) == 0)
+ return _M_insert_(0, __before._M_node, __v);
+ else
+ return _M_insert_(__position._M_node,
+ __position._M_node, __v);
+ }
+ else
+ return _M_insert_unique(__v).first;
+ }
+ else if (_M_impl._M_key_compare(_S_key(__position._M_node),
+ _KeyOfValue()(__v)))
+ {
+ // ... then try after.
+ const_iterator __after = __position;
+ if (__position._M_node == _M_rightmost())
+ return _M_insert_(0, _M_rightmost(), __v);
+ else if (_M_impl._M_key_compare(_KeyOfValue()(__v),
+ _S_key((++__after)._M_node)))
+ {
+ if (_S_right(__position._M_node) == 0)
+ return _M_insert_(0, __position._M_node, __v);
+ else
+ return _M_insert_(__after._M_node, __after._M_node, __v);
+ }
+ else
+ return _M_insert_unique(__v).first;
+ }
+ else
+ // Equivalent keys.
+ return iterator(static_cast<_Link_type>
+ (const_cast<_Base_ptr>(__position._M_node)));
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_insert_equal_(const_iterator __position, const _Val& __v)
+ {
+ // end()
+ if (__position._M_node == _M_end())
+ {
+ if (size() > 0
+ && !_M_impl._M_key_compare(_KeyOfValue()(__v),
+ _S_key(_M_rightmost())))
+ return _M_insert_(0, _M_rightmost(), __v);
+ else
+ return _M_insert_equal(__v);
+ }
+ else if (!_M_impl._M_key_compare(_S_key(__position._M_node),
+ _KeyOfValue()(__v)))
+ {
+ // First, try before...
+ const_iterator __before = __position;
+ if (__position._M_node == _M_leftmost()) // begin()
+ return _M_insert_(_M_leftmost(), _M_leftmost(), __v);
+ else if (!_M_impl._M_key_compare(_KeyOfValue()(__v),
+ _S_key((--__before)._M_node)))
+ {
+ if (_S_right(__before._M_node) == 0)
+ return _M_insert_(0, __before._M_node, __v);
+ else
+ return _M_insert_(__position._M_node,
+ __position._M_node, __v);
+ }
+ else
+ return _M_insert_equal(__v);
+ }
+ else
+ {
+ // ... then try after.
+ const_iterator __after = __position;
+ if (__position._M_node == _M_rightmost())
+ return _M_insert_(0, _M_rightmost(), __v);
+ else if (!_M_impl._M_key_compare(_S_key((++__after)._M_node),
+ _KeyOfValue()(__v)))
+ {
+ if (_S_right(__position._M_node) == 0)
+ return _M_insert_(0, __position._M_node, __v);
+ else
+ return _M_insert_(__after._M_node, __after._M_node, __v);
+ }
+ else
+ return _M_insert_equal_lower(__v);
+ }
+ }
+
+ template<typename _Key, typename _Val, typename _KoV,
+ typename _Cmp, typename _Alloc>
+ template<class _II>
+ void
+ _Rb_tree<_Key, _Val, _KoV, _Cmp, _Alloc>::
+ _M_insert_unique(_II __first, _II __last)
+ {
+ for (; __first != __last; ++__first)
+ _M_insert_unique_(end(), *__first);
+ }
+
+ template<typename _Key, typename _Val, typename _KoV,
+ typename _Cmp, typename _Alloc>
+ template<class _II>
+ void
+ _Rb_tree<_Key, _Val, _KoV, _Cmp, _Alloc>::
+ _M_insert_equal(_II __first, _II __last)
+ {
+ for (; __first != __last; ++__first)
+ _M_insert_equal_(end(), *__first);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ erase(iterator __position)
+ {
+ _Link_type __y =
+ static_cast<_Link_type>(_Rb_tree_rebalance_for_erase
+ (__position._M_node,
+ this->_M_impl._M_header));
+ _M_destroy_node(__y);
+ --_M_impl._M_node_count;
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ inline void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ erase(const_iterator __position)
+ {
+ _Link_type __y =
+ static_cast<_Link_type>(_Rb_tree_rebalance_for_erase
+ (const_cast<_Base_ptr>(__position._M_node),
+ this->_M_impl._M_header));
+ _M_destroy_node(__y);
+ --_M_impl._M_node_count;
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ erase(const _Key& __x)
+ {
+ pair<iterator, iterator> __p = equal_range(__x);
+ const size_type __old_size = size();
+ erase(__p.first, __p.second);
+ return __old_size - size();
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ erase(iterator __first, iterator __last)
+ {
+ if (__first == begin() && __last == end())
+ clear();
+ else
+ while (__first != __last)
+ erase(__first++);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ erase(const_iterator __first, const_iterator __last)
+ {
+ if (__first == begin() && __last == end())
+ clear();
+ else
+ while (__first != __last)
+ erase(__first++);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ erase(const _Key* __first, const _Key* __last)
+ {
+ while (__first != __last)
+ erase(*__first++);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ find(const _Key& __k)
+ {
+ iterator __j = _M_lower_bound(_M_begin(), _M_end(), __k);
+ return (__j == end()
+ || _M_impl._M_key_compare(__k,
+ _S_key(__j._M_node))) ? end() : __j;
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::const_iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ find(const _Key& __k) const
+ {
+ const_iterator __j = _M_lower_bound(_M_begin(), _M_end(), __k);
+ return (__j == end()
+ || _M_impl._M_key_compare(__k,
+ _S_key(__j._M_node))) ? end() : __j;
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ count(const _Key& __k) const
+ {
+ pair<const_iterator, const_iterator> __p = equal_range(__k);
+ const size_type __n = std::distance(__p.first, __p.second);
+ return __n;
+ }
+
+ unsigned int
+ _Rb_tree_black_count(const _Rb_tree_node_base* __node,
+ const _Rb_tree_node_base* __root);
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ bool
+ _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::__rb_verify() const
+ {
+ if (_M_impl._M_node_count == 0 || begin() == end())
+ return _M_impl._M_node_count == 0 && begin() == end()
+ && this->_M_impl._M_header._M_left == _M_end()
+ && this->_M_impl._M_header._M_right == _M_end();
+
+ unsigned int __len = _Rb_tree_black_count(_M_leftmost(), _M_root());
+ for (const_iterator __it = begin(); __it != end(); ++__it)
+ {
+ _Const_Link_type __x = static_cast<_Const_Link_type>(__it._M_node);
+ _Const_Link_type __L = _S_left(__x);
+ _Const_Link_type __R = _S_right(__x);
+
+ if (__x->_M_color == _S_red)
+ if ((__L && __L->_M_color == _S_red)
+ || (__R && __R->_M_color == _S_red))
+ return false;
+
+ if (__L && _M_impl._M_key_compare(_S_key(__x), _S_key(__L)))
+ return false;
+ if (__R && _M_impl._M_key_compare(_S_key(__R), _S_key(__x)))
+ return false;
+
+ if (!__L && !__R && _Rb_tree_black_count(__x, _M_root()) != __len)
+ return false;
+ }
+
+ if (_M_leftmost() != _Rb_tree_node_base::_S_minimum(_M_root()))
+ return false;
+ if (_M_rightmost() != _Rb_tree_node_base::_S_maximum(_M_root()))
+ return false;
+ return true;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_uninitialized.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_uninitialized.h
new file mode 100644
index 0000000..11a66c7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_uninitialized.h
@@ -0,0 +1,478 @@
+// Raw memory manipulators -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_uninitialized.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_UNINITIALIZED_H
+#define _STL_UNINITIALIZED_H 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<bool>
+ struct __uninitialized_copy
+ {
+ template<typename _InputIterator, typename _ForwardIterator>
+ static _ForwardIterator
+ uninitialized_copy(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result)
+ {
+ _ForwardIterator __cur = __result;
+ __try
+ {
+ for (; __first != __last; ++__first, ++__cur)
+ ::new(static_cast<void*>(&*__cur)) typename
+ iterator_traits<_ForwardIterator>::value_type(*__first);
+ return __cur;
+ }
+ __catch(...)
+ {
+ std::_Destroy(__result, __cur);
+ __throw_exception_again;
+ }
+ }
+ };
+
+ template<>
+ struct __uninitialized_copy<true>
+ {
+ template<typename _InputIterator, typename _ForwardIterator>
+ static _ForwardIterator
+ uninitialized_copy(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result)
+ { return std::copy(__first, __last, __result); }
+ };
+
+ /**
+ * @brief Copies the range [first,last) into result.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @return result + (first - last)
+ *
+ * Like copy(), but does not require an initialized output range.
+ */
+ template<typename _InputIterator, typename _ForwardIterator>
+ inline _ForwardIterator
+ uninitialized_copy(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result)
+ {
+ typedef typename iterator_traits<_InputIterator>::value_type
+ _ValueType1;
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType2;
+
+ return std::__uninitialized_copy<(__is_pod(_ValueType1)
+ && __is_pod(_ValueType2))>::
+ uninitialized_copy(__first, __last, __result);
+ }
+
+
+ template<bool>
+ struct __uninitialized_fill
+ {
+ template<typename _ForwardIterator, typename _Tp>
+ static void
+ uninitialized_fill(_ForwardIterator __first,
+ _ForwardIterator __last, const _Tp& __x)
+ {
+ _ForwardIterator __cur = __first;
+ __try
+ {
+ for (; __cur != __last; ++__cur)
+ std::_Construct(&*__cur, __x);
+ }
+ __catch(...)
+ {
+ std::_Destroy(__first, __cur);
+ __throw_exception_again;
+ }
+ }
+ };
+
+ template<>
+ struct __uninitialized_fill<true>
+ {
+ template<typename _ForwardIterator, typename _Tp>
+ static void
+ uninitialized_fill(_ForwardIterator __first,
+ _ForwardIterator __last, const _Tp& __x)
+ { std::fill(__first, __last, __x); }
+ };
+
+ /**
+ * @brief Copies the value x into the range [first,last).
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param x The source value.
+ * @return Nothing.
+ *
+ * Like fill(), but does not require an initialized output range.
+ */
+ template<typename _ForwardIterator, typename _Tp>
+ inline void
+ uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __x)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+
+ std::__uninitialized_fill<__is_pod(_ValueType)>::
+ uninitialized_fill(__first, __last, __x);
+ }
+
+
+ template<bool>
+ struct __uninitialized_fill_n
+ {
+ template<typename _ForwardIterator, typename _Size, typename _Tp>
+ static void
+ uninitialized_fill_n(_ForwardIterator __first, _Size __n,
+ const _Tp& __x)
+ {
+ _ForwardIterator __cur = __first;
+ __try
+ {
+ for (; __n > 0; --__n, ++__cur)
+ std::_Construct(&*__cur, __x);
+ }
+ __catch(...)
+ {
+ std::_Destroy(__first, __cur);
+ __throw_exception_again;
+ }
+ }
+ };
+
+ template<>
+ struct __uninitialized_fill_n<true>
+ {
+ template<typename _ForwardIterator, typename _Size, typename _Tp>
+ static void
+ uninitialized_fill_n(_ForwardIterator __first, _Size __n,
+ const _Tp& __x)
+ { std::fill_n(__first, __n, __x); }
+ };
+
+ /**
+ * @brief Copies the value x into the range [first,first+n).
+ * @param first An input iterator.
+ * @param n The number of copies to make.
+ * @param x The source value.
+ * @return Nothing.
+ *
+ * Like fill_n(), but does not require an initialized output range.
+ */
+ template<typename _ForwardIterator, typename _Size, typename _Tp>
+ inline void
+ uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+
+ std::__uninitialized_fill_n<__is_pod(_ValueType)>::
+ uninitialized_fill_n(__first, __n, __x);
+ }
+
+ // Extensions: versions of uninitialized_copy, uninitialized_fill,
+ // and uninitialized_fill_n that take an allocator parameter.
+ // We dispatch back to the standard versions when we're given the
+ // default allocator. For nondefault allocators we do not use
+ // any of the POD optimizations.
+
+ template<typename _InputIterator, typename _ForwardIterator,
+ typename _Allocator>
+ _ForwardIterator
+ __uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result, _Allocator& __alloc)
+ {
+ _ForwardIterator __cur = __result;
+ __try
+ {
+ for (; __first != __last; ++__first, ++__cur)
+ __alloc.construct(&*__cur, *__first);
+ return __cur;
+ }
+ __catch(...)
+ {
+ std::_Destroy(__result, __cur, __alloc);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _InputIterator, typename _ForwardIterator, typename _Tp>
+ inline _ForwardIterator
+ __uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result, allocator<_Tp>&)
+ { return std::uninitialized_copy(__first, __last, __result); }
+
+ template<typename _InputIterator, typename _ForwardIterator,
+ typename _Allocator>
+ inline _ForwardIterator
+ __uninitialized_move_a(_InputIterator __first, _InputIterator __last,
+ _ForwardIterator __result, _Allocator& __alloc)
+ {
+ return std::__uninitialized_copy_a(_GLIBCXX_MAKE_MOVE_ITERATOR(__first),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__last),
+ __result, __alloc);
+ }
+
+ template<typename _ForwardIterator, typename _Tp, typename _Allocator>
+ void
+ __uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __x, _Allocator& __alloc)
+ {
+ _ForwardIterator __cur = __first;
+ __try
+ {
+ for (; __cur != __last; ++__cur)
+ __alloc.construct(&*__cur, __x);
+ }
+ __catch(...)
+ {
+ std::_Destroy(__first, __cur, __alloc);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _ForwardIterator, typename _Tp, typename _Tp2>
+ inline void
+ __uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __x, allocator<_Tp2>&)
+ { std::uninitialized_fill(__first, __last, __x); }
+
+ template<typename _ForwardIterator, typename _Size, typename _Tp,
+ typename _Allocator>
+ void
+ __uninitialized_fill_n_a(_ForwardIterator __first, _Size __n,
+ const _Tp& __x, _Allocator& __alloc)
+ {
+ _ForwardIterator __cur = __first;
+ __try
+ {
+ for (; __n > 0; --__n, ++__cur)
+ __alloc.construct(&*__cur, __x);
+ }
+ __catch(...)
+ {
+ std::_Destroy(__first, __cur, __alloc);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _ForwardIterator, typename _Size, typename _Tp,
+ typename _Tp2>
+ inline void
+ __uninitialized_fill_n_a(_ForwardIterator __first, _Size __n,
+ const _Tp& __x, allocator<_Tp2>&)
+ { std::uninitialized_fill_n(__first, __n, __x); }
+
+
+ // Extensions: __uninitialized_copy_move, __uninitialized_move_copy,
+ // __uninitialized_fill_move, __uninitialized_move_fill.
+ // All of these algorithms take a user-supplied allocator, which is used
+ // for construction and destruction.
+
+ // __uninitialized_copy_move
+ // Copies [first1, last1) into [result, result + (last1 - first1)), and
+ // move [first2, last2) into
+ // [result, result + (last1 - first1) + (last2 - first2)).
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _ForwardIterator, typename _Allocator>
+ inline _ForwardIterator
+ __uninitialized_copy_move(_InputIterator1 __first1,
+ _InputIterator1 __last1,
+ _InputIterator2 __first2,
+ _InputIterator2 __last2,
+ _ForwardIterator __result,
+ _Allocator& __alloc)
+ {
+ _ForwardIterator __mid = std::__uninitialized_copy_a(__first1, __last1,
+ __result,
+ __alloc);
+ __try
+ {
+ return std::__uninitialized_move_a(__first2, __last2, __mid, __alloc);
+ }
+ __catch(...)
+ {
+ std::_Destroy(__result, __mid, __alloc);
+ __throw_exception_again;
+ }
+ }
+
+ // __uninitialized_move_copy
+ // Moves [first1, last1) into [result, result + (last1 - first1)), and
+ // copies [first2, last2) into
+ // [result, result + (last1 - first1) + (last2 - first2)).
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _ForwardIterator, typename _Allocator>
+ inline _ForwardIterator
+ __uninitialized_move_copy(_InputIterator1 __first1,
+ _InputIterator1 __last1,
+ _InputIterator2 __first2,
+ _InputIterator2 __last2,
+ _ForwardIterator __result,
+ _Allocator& __alloc)
+ {
+ _ForwardIterator __mid = std::__uninitialized_move_a(__first1, __last1,
+ __result,
+ __alloc);
+ __try
+ {
+ return std::__uninitialized_copy_a(__first2, __last2, __mid, __alloc);
+ }
+ __catch(...)
+ {
+ std::_Destroy(__result, __mid, __alloc);
+ __throw_exception_again;
+ }
+ }
+
+ // __uninitialized_fill_move
+ // Fills [result, mid) with x, and moves [first, last) into
+ // [mid, mid + (last - first)).
+ template<typename _ForwardIterator, typename _Tp, typename _InputIterator,
+ typename _Allocator>
+ inline _ForwardIterator
+ __uninitialized_fill_move(_ForwardIterator __result, _ForwardIterator __mid,
+ const _Tp& __x, _InputIterator __first,
+ _InputIterator __last, _Allocator& __alloc)
+ {
+ std::__uninitialized_fill_a(__result, __mid, __x, __alloc);
+ __try
+ {
+ return std::__uninitialized_move_a(__first, __last, __mid, __alloc);
+ }
+ __catch(...)
+ {
+ std::_Destroy(__result, __mid, __alloc);
+ __throw_exception_again;
+ }
+ }
+
+ // __uninitialized_move_fill
+ // Moves [first1, last1) into [first2, first2 + (last1 - first1)), and
+ // fills [first2 + (last1 - first1), last2) with x.
+ template<typename _InputIterator, typename _ForwardIterator, typename _Tp,
+ typename _Allocator>
+ inline void
+ __uninitialized_move_fill(_InputIterator __first1, _InputIterator __last1,
+ _ForwardIterator __first2,
+ _ForwardIterator __last2, const _Tp& __x,
+ _Allocator& __alloc)
+ {
+ _ForwardIterator __mid2 = std::__uninitialized_move_a(__first1, __last1,
+ __first2,
+ __alloc);
+ __try
+ {
+ std::__uninitialized_fill_a(__mid2, __last2, __x, __alloc);
+ }
+ __catch(...)
+ {
+ std::_Destroy(__first2, __mid2, __alloc);
+ __throw_exception_again;
+ }
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _InputIterator, typename _Size,
+ typename _ForwardIterator>
+ _ForwardIterator
+ __uninitialized_copy_n(_InputIterator __first, _Size __n,
+ _ForwardIterator __result, input_iterator_tag)
+ {
+ _ForwardIterator __cur = __result;
+ __try
+ {
+ for (; __n > 0; --__n, ++__first, ++__cur)
+ ::new(static_cast<void*>(&*__cur)) typename
+ iterator_traits<_ForwardIterator>::value_type(*__first);
+ return __cur;
+ }
+ __catch(...)
+ {
+ std::_Destroy(__result, __cur);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _RandomAccessIterator, typename _Size,
+ typename _ForwardIterator>
+ inline _ForwardIterator
+ __uninitialized_copy_n(_RandomAccessIterator __first, _Size __n,
+ _ForwardIterator __result,
+ random_access_iterator_tag)
+ { return std::uninitialized_copy(__first, __first + __n, __result); }
+
+ /**
+ * @brief Copies the range [first,first+n) into result.
+ * @param first An input iterator.
+ * @param n The number of elements to copy.
+ * @param result An output iterator.
+ * @return result + n
+ *
+ * Like copy_n(), but does not require an initialized output range.
+ */
+ template<typename _InputIterator, typename _Size, typename _ForwardIterator>
+ inline _ForwardIterator
+ uninitialized_copy_n(_InputIterator __first, _Size __n,
+ _ForwardIterator __result)
+ { return std::__uninitialized_copy_n(__first, __n, __result,
+ std::__iterator_category(__first)); }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_UNINITIALIZED_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_vector.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_vector.h
new file mode 100644
index 0000000..9af983d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stl_vector.h
@@ -0,0 +1,1233 @@
+// Vector implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file stl_vector.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STL_VECTOR_H
+#define _STL_VECTOR_H 1
+
+#include <bits/stl_iterator_base_funcs.h>
+#include <bits/functexcept.h>
+#include <bits/concept_check.h>
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ /// See bits/stl_deque.h's _Deque_base for an explanation.
+ template<typename _Tp, typename _Alloc>
+ struct _Vector_base
+ {
+ typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
+
+ struct _Vector_impl
+ : public _Tp_alloc_type
+ {
+ typename _Tp_alloc_type::pointer _M_start;
+ typename _Tp_alloc_type::pointer _M_finish;
+ typename _Tp_alloc_type::pointer _M_end_of_storage;
+
+ _Vector_impl()
+ : _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0)
+ { }
+
+ _Vector_impl(_Tp_alloc_type const& __a)
+ : _Tp_alloc_type(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)
+ { }
+ };
+
+ public:
+ typedef _Alloc allocator_type;
+
+ _Tp_alloc_type&
+ _M_get_Tp_allocator()
+ { return *static_cast<_Tp_alloc_type*>(&this->_M_impl); }
+
+ const _Tp_alloc_type&
+ _M_get_Tp_allocator() const
+ { return *static_cast<const _Tp_alloc_type*>(&this->_M_impl); }
+
+ allocator_type
+ get_allocator() const
+ { return allocator_type(_M_get_Tp_allocator()); }
+
+ _Vector_base()
+ : _M_impl() { }
+
+ _Vector_base(const allocator_type& __a)
+ : _M_impl(__a) { }
+
+ _Vector_base(size_t __n, const allocator_type& __a)
+ : _M_impl(__a)
+ {
+ this->_M_impl._M_start = this->_M_allocate(__n);
+ this->_M_impl._M_finish = this->_M_impl._M_start;
+ this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ _Vector_base(_Vector_base&& __x)
+ : _M_impl(__x._M_get_Tp_allocator())
+ {
+ this->_M_impl._M_start = __x._M_impl._M_start;
+ this->_M_impl._M_finish = __x._M_impl._M_finish;
+ this->_M_impl._M_end_of_storage = __x._M_impl._M_end_of_storage;
+ __x._M_impl._M_start = 0;
+ __x._M_impl._M_finish = 0;
+ __x._M_impl._M_end_of_storage = 0;
+ }
+#endif
+
+ ~_Vector_base()
+ { _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start); }
+
+ public:
+ _Vector_impl _M_impl;
+
+ typename _Tp_alloc_type::pointer
+ _M_allocate(size_t __n)
+ { return __n != 0 ? _M_impl.allocate(__n) : 0; }
+
+ void
+ _M_deallocate(typename _Tp_alloc_type::pointer __p, size_t __n)
+ {
+ if (__p)
+ _M_impl.deallocate(__p, __n);
+ }
+ };
+
+
+ /**
+ * @brief A standard container which offers fixed time access to
+ * individual elements in any order.
+ *
+ * @ingroup sequences
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, a
+ * <a href="tables.html#66">reversible container</a>, and a
+ * <a href="tables.html#67">sequence</a>, including the
+ * <a href="tables.html#68">optional sequence requirements</a> with the
+ * %exception of @c push_front and @c pop_front.
+ *
+ * In some terminology a %vector can be described as a dynamic
+ * C-style array, it offers fast and efficient access to individual
+ * elements in any order and saves the user from worrying about
+ * memory and size allocation. Subscripting ( @c [] ) access is
+ * also provided as with C-style arrays.
+ */
+ template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
+ class vector : protected _Vector_base<_Tp, _Alloc>
+ {
+ // Concept requirements.
+ typedef typename _Alloc::value_type _Alloc_value_type;
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept)
+
+ typedef _Vector_base<_Tp, _Alloc> _Base;
+ typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
+
+ public:
+ typedef _Tp value_type;
+ typedef typename _Tp_alloc_type::pointer pointer;
+ typedef typename _Tp_alloc_type::const_pointer const_pointer;
+ typedef typename _Tp_alloc_type::reference reference;
+ typedef typename _Tp_alloc_type::const_reference const_reference;
+ typedef __gnu_cxx::__normal_iterator<pointer, vector> iterator;
+ typedef __gnu_cxx::__normal_iterator<const_pointer, vector>
+ const_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Alloc allocator_type;
+
+ protected:
+ using _Base::_M_allocate;
+ using _Base::_M_deallocate;
+ using _Base::_M_impl;
+ using _Base::_M_get_Tp_allocator;
+
+ public:
+ // [23.2.4.1] construct/copy/destroy
+ // (assign() and get_allocator() are also listed in this section)
+ /**
+ * @brief Default constructor creates no elements.
+ */
+ vector()
+ : _Base() { }
+
+ /**
+ * @brief Creates a %vector with no elements.
+ * @param a An allocator object.
+ */
+ explicit
+ vector(const allocator_type& __a)
+ : _Base(__a) { }
+
+ /**
+ * @brief Creates a %vector with copies of an exemplar element.
+ * @param n The number of elements to initially create.
+ * @param value An element to copy.
+ * @param a An allocator.
+ *
+ * This constructor fills the %vector with @a n copies of @a value.
+ */
+ explicit
+ vector(size_type __n, const value_type& __value = value_type(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __a)
+ { _M_fill_initialize(__n, __value); }
+
+ /**
+ * @brief %Vector copy constructor.
+ * @param x A %vector of identical element and allocator types.
+ *
+ * The newly-created %vector uses a copy of the allocation
+ * object used by @a x. All the elements of @a x are copied,
+ * but any extra memory in
+ * @a x (for fast expansion) will not be copied.
+ */
+ vector(const vector& __x)
+ : _Base(__x.size(), __x._M_get_Tp_allocator())
+ { this->_M_impl._M_finish =
+ std::__uninitialized_copy_a(__x.begin(), __x.end(),
+ this->_M_impl._M_start,
+ _M_get_Tp_allocator());
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Vector move constructor.
+ * @param x A %vector of identical element and allocator types.
+ *
+ * The newly-created %vector contains the exact contents of @a x.
+ * The contents of @a x are a valid, but unspecified %vector.
+ */
+ vector(vector&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+
+ /**
+ * @brief Builds a %vector from an initializer list.
+ * @param l An initializer_list.
+ * @param a An allocator.
+ *
+ * Create a %vector consisting of copies of the elements in the
+ * initializer_list @a l.
+ *
+ * This will call the element type's copy constructor N times
+ * (where N is @a l.size()) and do no memory reallocation.
+ */
+ vector(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ _M_range_initialize(__l.begin(), __l.end(),
+ random_access_iterator_tag());
+ }
+#endif
+
+ /**
+ * @brief Builds a %vector from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param a An allocator.
+ *
+ * Create a %vector consisting of copies of the elements from
+ * [first,last).
+ *
+ * If the iterators are forward, bidirectional, or
+ * random-access, then this will call the elements' copy
+ * constructor N times (where N is distance(first,last)) and do
+ * no memory reallocation. But if only input iterators are
+ * used, then this will do at most 2N calls to the copy
+ * constructor, and logN memory reallocations.
+ */
+ template<typename _InputIterator>
+ vector(_InputIterator __first, _InputIterator __last,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ // Check whether it's an integral type. If so, it's not an iterator.
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_initialize_dispatch(__first, __last, _Integral());
+ }
+
+ /**
+ * The dtor only erases the elements, and note that if the
+ * elements themselves are pointers, the pointed-to memory is
+ * not touched in any way. Managing the pointer is the user's
+ * responsibility.
+ */
+ ~vector()
+ { std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator()); }
+
+ /**
+ * @brief %Vector assignment operator.
+ * @param x A %vector of identical element and allocator types.
+ *
+ * All the elements of @a x are copied, but any extra memory in
+ * @a x (for fast expansion) will not be copied. Unlike the
+ * copy constructor, the allocator object is not copied.
+ */
+ vector&
+ operator=(const vector& __x);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief %Vector move assignment operator.
+ * @param x A %vector of identical element and allocator types.
+ *
+ * The contents of @a x are moved into this %vector (without copying).
+ * @a x is a valid, but unspecified %vector.
+ */
+ vector&
+ operator=(vector&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ /**
+ * @brief %Vector list assignment operator.
+ * @param l An initializer_list.
+ *
+ * This function fills a %vector with copies of the elements in the
+ * initializer list @a l.
+ *
+ * Note that the assignment completely changes the %vector and
+ * that the resulting %vector's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ vector&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->assign(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+
+ /**
+ * @brief Assigns a given value to a %vector.
+ * @param n Number of elements to be assigned.
+ * @param val Value to be assigned.
+ *
+ * This function fills a %vector with @a n copies of the given
+ * value. Note that the assignment completely changes the
+ * %vector and that the resulting %vector's size is the same as
+ * the number of elements assigned. Old data may be lost.
+ */
+ void
+ assign(size_type __n, const value_type& __val)
+ { _M_fill_assign(__n, __val); }
+
+ /**
+ * @brief Assigns a range to a %vector.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * This function fills a %vector with copies of the elements in the
+ * range [first,last).
+ *
+ * Note that the assignment completely changes the %vector and
+ * that the resulting %vector's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ template<typename _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ // Check whether it's an integral type. If so, it's not an iterator.
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_assign_dispatch(__first, __last, _Integral());
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Assigns an initializer list to a %vector.
+ * @param l An initializer_list.
+ *
+ * This function fills a %vector with copies of the elements in the
+ * initializer list @a l.
+ *
+ * Note that the assignment completely changes the %vector and
+ * that the resulting %vector's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ void
+ assign(initializer_list<value_type> __l)
+ { this->assign(__l.begin(), __l.end()); }
+#endif
+
+ /// Get a copy of the memory allocation object.
+ using _Base::get_allocator;
+
+ // iterators
+ /**
+ * Returns a read/write iterator that points to the first
+ * element in the %vector. Iteration is done in ordinary
+ * element order.
+ */
+ iterator
+ begin()
+ { return iterator(this->_M_impl._M_start); }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the
+ * first element in the %vector. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ begin() const
+ { return const_iterator(this->_M_impl._M_start); }
+
+ /**
+ * Returns a read/write iterator that points one past the last
+ * element in the %vector. Iteration is done in ordinary
+ * element order.
+ */
+ iterator
+ end()
+ { return iterator(this->_M_impl._M_finish); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past
+ * the last element in the %vector. Iteration is done in
+ * ordinary element order.
+ */
+ const_iterator
+ end() const
+ { return const_iterator(this->_M_impl._M_finish); }
+
+ /**
+ * Returns a read/write reverse iterator that points to the
+ * last element in the %vector. Iteration is done in reverse
+ * element order.
+ */
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to the last element in the %vector. Iteration is done in
+ * reverse element order.
+ */
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ /**
+ * Returns a read/write reverse iterator that points to one
+ * before the first element in the %vector. Iteration is done
+ * in reverse element order.
+ */
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to one before the first element in the %vector. Iteration
+ * is done in reverse element order.
+ */
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * Returns a read-only (constant) iterator that points to the
+ * first element in the %vector. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ cbegin() const
+ { return const_iterator(this->_M_impl._M_start); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past
+ * the last element in the %vector. Iteration is done in
+ * ordinary element order.
+ */
+ const_iterator
+ cend() const
+ { return const_iterator(this->_M_impl._M_finish); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to the last element in the %vector. Iteration is done in
+ * reverse element order.
+ */
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to one before the first element in the %vector. Iteration
+ * is done in reverse element order.
+ */
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ // [23.2.4.2] capacity
+ /** Returns the number of elements in the %vector. */
+ size_type
+ size() const
+ { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }
+
+ /** Returns the size() of the largest possible %vector. */
+ size_type
+ max_size() const
+ { return _M_get_Tp_allocator().max_size(); }
+
+ /**
+ * @brief Resizes the %vector to the specified number of elements.
+ * @param new_size Number of elements the %vector should contain.
+ * @param x Data with which new elements should be populated.
+ *
+ * This function will %resize the %vector to the specified
+ * number of elements. If the number is smaller than the
+ * %vector's current size the %vector is truncated, otherwise
+ * the %vector is extended and new elements are populated with
+ * given data.
+ */
+ void
+ resize(size_type __new_size, value_type __x = value_type())
+ {
+ if (__new_size < size())
+ _M_erase_at_end(this->_M_impl._M_start + __new_size);
+ else
+ insert(end(), __new_size - size(), __x);
+ }
+
+ /**
+ * Returns the total number of elements that the %vector can
+ * hold before needing to allocate more memory.
+ */
+ size_type
+ capacity() const
+ { return size_type(this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start); }
+
+ /**
+ * Returns true if the %vector is empty. (Thus begin() would
+ * equal end().)
+ */
+ bool
+ empty() const
+ { return begin() == end(); }
+
+ /**
+ * @brief Attempt to preallocate enough memory for specified number of
+ * elements.
+ * @param n Number of elements required.
+ * @throw std::length_error If @a n exceeds @c max_size().
+ *
+ * This function attempts to reserve enough memory for the
+ * %vector to hold the specified number of elements. If the
+ * number requested is more than max_size(), length_error is
+ * thrown.
+ *
+ * The advantage of this function is that if optimal code is a
+ * necessity and the user can determine the number of elements
+ * that will be required, the user can reserve the memory in
+ * %advance, and thus prevent a possible reallocation of memory
+ * and copying of %vector data.
+ */
+ void
+ reserve(size_type __n);
+
+ // element access
+ /**
+ * @brief Subscript access to the data contained in the %vector.
+ * @param n The index of the element for which data should be
+ * accessed.
+ * @return Read/write reference to data.
+ *
+ * This operator allows for easy, array-style, data access.
+ * Note that data access with this operator is unchecked and
+ * out_of_range lookups are not defined. (For checked lookups
+ * see at().)
+ */
+ reference
+ operator[](size_type __n)
+ { return *(this->_M_impl._M_start + __n); }
+
+ /**
+ * @brief Subscript access to the data contained in the %vector.
+ * @param n The index of the element for which data should be
+ * accessed.
+ * @return Read-only (constant) reference to data.
+ *
+ * This operator allows for easy, array-style, data access.
+ * Note that data access with this operator is unchecked and
+ * out_of_range lookups are not defined. (For checked lookups
+ * see at().)
+ */
+ const_reference
+ operator[](size_type __n) const
+ { return *(this->_M_impl._M_start + __n); }
+
+ protected:
+ /// Safety check used only from at().
+ void
+ _M_range_check(size_type __n) const
+ {
+ if (__n >= this->size())
+ __throw_out_of_range(__N("vector::_M_range_check"));
+ }
+
+ public:
+ /**
+ * @brief Provides access to the data contained in the %vector.
+ * @param n The index of the element for which data should be
+ * accessed.
+ * @return Read/write reference to data.
+ * @throw std::out_of_range If @a n is an invalid index.
+ *
+ * This function provides for safer data access. The parameter
+ * is first checked that it is in the range of the vector. The
+ * function throws out_of_range if the check fails.
+ */
+ reference
+ at(size_type __n)
+ {
+ _M_range_check(__n);
+ return (*this)[__n];
+ }
+
+ /**
+ * @brief Provides access to the data contained in the %vector.
+ * @param n The index of the element for which data should be
+ * accessed.
+ * @return Read-only (constant) reference to data.
+ * @throw std::out_of_range If @a n is an invalid index.
+ *
+ * This function provides for safer data access. The parameter
+ * is first checked that it is in the range of the vector. The
+ * function throws out_of_range if the check fails.
+ */
+ const_reference
+ at(size_type __n) const
+ {
+ _M_range_check(__n);
+ return (*this)[__n];
+ }
+
+ /**
+ * Returns a read/write reference to the data at the first
+ * element of the %vector.
+ */
+ reference
+ front()
+ { return *begin(); }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the first
+ * element of the %vector.
+ */
+ const_reference
+ front() const
+ { return *begin(); }
+
+ /**
+ * Returns a read/write reference to the data at the last
+ * element of the %vector.
+ */
+ reference
+ back()
+ { return *(end() - 1); }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the
+ * last element of the %vector.
+ */
+ const_reference
+ back() const
+ { return *(end() - 1); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 464. Suggestion for new member functions in standard containers.
+ // data access
+ /**
+ * Returns a pointer such that [data(), data() + size()) is a valid
+ * range. For a non-empty %vector, data() == &front().
+ */
+ pointer
+ data()
+ { return pointer(this->_M_impl._M_start); }
+
+ const_pointer
+ data() const
+ { return const_pointer(this->_M_impl._M_start); }
+
+ // [23.2.4.3] modifiers
+ /**
+ * @brief Add data to the end of the %vector.
+ * @param x Data to be added.
+ *
+ * This is a typical stack operation. The function creates an
+ * element at the end of the %vector and assigns the given data
+ * to it. Due to the nature of a %vector this operation can be
+ * done in constant time if the %vector has preallocated space
+ * available.
+ */
+ void
+ push_back(const value_type& __x)
+ {
+ if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
+ {
+ this->_M_impl.construct(this->_M_impl._M_finish, __x);
+ ++this->_M_impl._M_finish;
+ }
+ else
+ _M_insert_aux(end(), __x);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push_back(value_type&& __x)
+ { emplace_back(std::move(__x)); }
+
+ template<typename... _Args>
+ void
+ emplace_back(_Args&&... __args);
+#endif
+
+ /**
+ * @brief Removes last element.
+ *
+ * This is a typical stack operation. It shrinks the %vector by one.
+ *
+ * Note that no data is returned, and if the last element's
+ * data is needed, it should be retrieved before pop_back() is
+ * called.
+ */
+ void
+ pop_back()
+ {
+ --this->_M_impl._M_finish;
+ this->_M_impl.destroy(this->_M_impl._M_finish);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Inserts an object in %vector before specified iterator.
+ * @param position An iterator into the %vector.
+ * @param args Arguments.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert an object of type T constructed
+ * with T(std::forward<Args>(args)...) before the specified location.
+ * Note that this kind of operation could be expensive for a %vector
+ * and if it is frequently used the user should consider using
+ * std::list.
+ */
+ template<typename... _Args>
+ iterator
+ emplace(iterator __position, _Args&&... __args);
+#endif
+
+ /**
+ * @brief Inserts given value into %vector before specified iterator.
+ * @param position An iterator into the %vector.
+ * @param x Data to be inserted.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert a copy of the given value before
+ * the specified location. Note that this kind of operation
+ * could be expensive for a %vector and if it is frequently
+ * used the user should consider using std::list.
+ */
+ iterator
+ insert(iterator __position, const value_type& __x);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Inserts given rvalue into %vector before specified iterator.
+ * @param position An iterator into the %vector.
+ * @param x Data to be inserted.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert a copy of the given rvalue before
+ * the specified location. Note that this kind of operation
+ * could be expensive for a %vector and if it is frequently
+ * used the user should consider using std::list.
+ */
+ iterator
+ insert(iterator __position, value_type&& __x)
+ { return emplace(__position, std::move(__x)); }
+
+ /**
+ * @brief Inserts an initializer_list into the %vector.
+ * @param position An iterator into the %vector.
+ * @param l An initializer_list.
+ *
+ * This function will insert copies of the data in the
+ * initializer_list @a l into the %vector before the location
+ * specified by @a position.
+ *
+ * Note that this kind of operation could be expensive for a
+ * %vector and if it is frequently used the user should
+ * consider using std::list.
+ */
+ void
+ insert(iterator __position, initializer_list<value_type> __l)
+ { this->insert(__position, __l.begin(), __l.end()); }
+#endif
+
+ /**
+ * @brief Inserts a number of copies of given data into the %vector.
+ * @param position An iterator into the %vector.
+ * @param n Number of elements to be inserted.
+ * @param x Data to be inserted.
+ *
+ * This function will insert a specified number of copies of
+ * the given data before the location specified by @a position.
+ *
+ * Note that this kind of operation could be expensive for a
+ * %vector and if it is frequently used the user should
+ * consider using std::list.
+ */
+ void
+ insert(iterator __position, size_type __n, const value_type& __x)
+ { _M_fill_insert(__position, __n, __x); }
+
+ /**
+ * @brief Inserts a range into the %vector.
+ * @param position An iterator into the %vector.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * This function will insert copies of the data in the range
+ * [first,last) into the %vector before the location specified
+ * by @a pos.
+ *
+ * Note that this kind of operation could be expensive for a
+ * %vector and if it is frequently used the user should
+ * consider using std::list.
+ */
+ template<typename _InputIterator>
+ void
+ insert(iterator __position, _InputIterator __first,
+ _InputIterator __last)
+ {
+ // Check whether it's an integral type. If so, it's not an iterator.
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_insert_dispatch(__position, __first, __last, _Integral());
+ }
+
+ /**
+ * @brief Remove element at given position.
+ * @param position Iterator pointing to element to be erased.
+ * @return An iterator pointing to the next element (or end()).
+ *
+ * This function will erase the element at the given position and thus
+ * shorten the %vector by one.
+ *
+ * Note This operation could be expensive and if it is
+ * frequently used the user should consider using std::list.
+ * The user is also cautioned that this function only erases
+ * the element, and that if the element is itself a pointer,
+ * the pointed-to memory is not touched in any way. Managing
+ * the pointer is the user's responsibility.
+ */
+ iterator
+ erase(iterator __position);
+
+ /**
+ * @brief Remove a range of elements.
+ * @param first Iterator pointing to the first element to be erased.
+ * @param last Iterator pointing to one past the last element to be
+ * erased.
+ * @return An iterator pointing to the element pointed to by @a last
+ * prior to erasing (or end()).
+ *
+ * This function will erase the elements in the range [first,last) and
+ * shorten the %vector accordingly.
+ *
+ * Note This operation could be expensive and if it is
+ * frequently used the user should consider using std::list.
+ * The user is also cautioned that this function only erases
+ * the elements, and that if the elements themselves are
+ * pointers, the pointed-to memory is not touched in any way.
+ * Managing the pointer is the user's responsibility.
+ */
+ iterator
+ erase(iterator __first, iterator __last);
+
+ /**
+ * @brief Swaps data with another %vector.
+ * @param x A %vector of the same element and allocator types.
+ *
+ * This exchanges the elements between two vectors in constant time.
+ * (Three pointers, so it should be quite fast.)
+ * Note that the global std::swap() function is specialized such that
+ * std::swap(v1,v2) will feed to this function.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(vector&& __x)
+#else
+ swap(vector& __x)
+#endif
+ {
+ std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
+ std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
+ std::swap(this->_M_impl._M_end_of_storage,
+ __x._M_impl._M_end_of_storage);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 431. Swapping containers with unequal allocators.
+ std::__alloc_swap<_Tp_alloc_type>::_S_do_it(_M_get_Tp_allocator(),
+ __x._M_get_Tp_allocator());
+ }
+
+ /**
+ * Erases all the elements. Note that this function only erases the
+ * elements, and that if the elements themselves are pointers, the
+ * pointed-to memory is not touched in any way. Managing the pointer is
+ * the user's responsibility.
+ */
+ void
+ clear()
+ { _M_erase_at_end(this->_M_impl._M_start); }
+
+ protected:
+ /**
+ * Memory expansion handler. Uses the member allocation function to
+ * obtain @a n bytes of memory, and then copies [first,last) into it.
+ */
+ template<typename _ForwardIterator>
+ pointer
+ _M_allocate_and_copy(size_type __n,
+ _ForwardIterator __first, _ForwardIterator __last)
+ {
+ pointer __result = this->_M_allocate(__n);
+ __try
+ {
+ std::__uninitialized_copy_a(__first, __last, __result,
+ _M_get_Tp_allocator());
+ return __result;
+ }
+ __catch(...)
+ {
+ _M_deallocate(__result, __n);
+ __throw_exception_again;
+ }
+ }
+
+
+ // Internal constructor functions follow.
+
+ // Called by the range constructor to implement [23.1.1]/9
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_initialize_dispatch(_Integer __n, _Integer __value, __true_type)
+ {
+ this->_M_impl._M_start = _M_allocate(static_cast<size_type>(__n));
+ this->_M_impl._M_end_of_storage =
+ this->_M_impl._M_start + static_cast<size_type>(__n);
+ _M_fill_initialize(static_cast<size_type>(__n), __value);
+ }
+
+ // Called by the range constructor to implement [23.1.1]/9
+ template<typename _InputIterator>
+ void
+ _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::
+ iterator_category _IterCategory;
+ _M_range_initialize(__first, __last, _IterCategory());
+ }
+
+ // Called by the second initialize_dispatch above
+ template<typename _InputIterator>
+ void
+ _M_range_initialize(_InputIterator __first,
+ _InputIterator __last, std::input_iterator_tag)
+ {
+ for (; __first != __last; ++__first)
+ push_back(*__first);
+ }
+
+ // Called by the second initialize_dispatch above
+ template<typename _ForwardIterator>
+ void
+ _M_range_initialize(_ForwardIterator __first,
+ _ForwardIterator __last, std::forward_iterator_tag)
+ {
+ const size_type __n = std::distance(__first, __last);
+ this->_M_impl._M_start = this->_M_allocate(__n);
+ this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
+ this->_M_impl._M_finish =
+ std::__uninitialized_copy_a(__first, __last,
+ this->_M_impl._M_start,
+ _M_get_Tp_allocator());
+ }
+
+ // Called by the first initialize_dispatch above and by the
+ // vector(n,value,a) constructor.
+ void
+ _M_fill_initialize(size_type __n, const value_type& __value)
+ {
+ std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish = this->_M_impl._M_end_of_storage;
+ }
+
+
+ // Internal assign functions follow. The *_aux functions do the actual
+ // assignment work for the range versions.
+
+ // Called by the range assign to implement [23.1.1]/9
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
+ { _M_fill_assign(__n, __val); }
+
+ // Called by the range assign to implement [23.1.1]/9
+ template<typename _InputIterator>
+ void
+ _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::
+ iterator_category _IterCategory;
+ _M_assign_aux(__first, __last, _IterCategory());
+ }
+
+ // Called by the second assign_dispatch above
+ template<typename _InputIterator>
+ void
+ _M_assign_aux(_InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag);
+
+ // Called by the second assign_dispatch above
+ template<typename _ForwardIterator>
+ void
+ _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag);
+
+ // Called by assign(n,t), and the range assign when it turns out
+ // to be the same thing.
+ void
+ _M_fill_assign(size_type __n, const value_type& __val);
+
+
+ // Internal insert functions follow.
+
+ // Called by the range insert to implement [23.1.1]/9
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val,
+ __true_type)
+ { _M_fill_insert(__pos, __n, __val); }
+
+ // Called by the range insert to implement [23.1.1]/9
+ template<typename _InputIterator>
+ void
+ _M_insert_dispatch(iterator __pos, _InputIterator __first,
+ _InputIterator __last, __false_type)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::
+ iterator_category _IterCategory;
+ _M_range_insert(__pos, __first, __last, _IterCategory());
+ }
+
+ // Called by the second insert_dispatch above
+ template<typename _InputIterator>
+ void
+ _M_range_insert(iterator __pos, _InputIterator __first,
+ _InputIterator __last, std::input_iterator_tag);
+
+ // Called by the second insert_dispatch above
+ template<typename _ForwardIterator>
+ void
+ _M_range_insert(iterator __pos, _ForwardIterator __first,
+ _ForwardIterator __last, std::forward_iterator_tag);
+
+ // Called by insert(p,n,x), and the range insert when it turns out to be
+ // the same thing.
+ void
+ _M_fill_insert(iterator __pos, size_type __n, const value_type& __x);
+
+ // Called by insert(p,x)
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ _M_insert_aux(iterator __position, const value_type& __x);
+#else
+ template<typename... _Args>
+ void
+ _M_insert_aux(iterator __position, _Args&&... __args);
+#endif
+
+ // Called by the latter.
+ size_type
+ _M_check_len(size_type __n, const char* __s) const
+ {
+ if (max_size() - size() < __n)
+ __throw_length_error(__N(__s));
+
+ const size_type __len = size() + std::max(size(), __n);
+ return (__len < size() || __len > max_size()) ? max_size() : __len;
+ }
+
+ // Internal erase functions follow.
+
+ // Called by erase(q1,q2), clear(), resize(), _M_fill_assign,
+ // _M_assign_aux.
+ void
+ _M_erase_at_end(pointer __pos)
+ {
+ std::_Destroy(__pos, this->_M_impl._M_finish, _M_get_Tp_allocator());
+ this->_M_impl._M_finish = __pos;
+ }
+ };
+
+
+ /**
+ * @brief Vector equality comparison.
+ * @param x A %vector.
+ * @param y A %vector of the same type as @a x.
+ * @return True iff the size and elements of the vectors are equal.
+ *
+ * This is an equivalence relation. It is linear in the size of the
+ * vectors. Vectors are considered equivalent if their sizes are equal,
+ * and if corresponding elements compare equal.
+ */
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+ { return (__x.size() == __y.size()
+ && std::equal(__x.begin(), __x.end(), __y.begin())); }
+
+ /**
+ * @brief Vector ordering relation.
+ * @param x A %vector.
+ * @param y A %vector of the same type as @a x.
+ * @return True iff @a x is lexicographically less than @a y.
+ *
+ * This is a total ordering relation. It is linear in the size of the
+ * vectors. The elements must be comparable with @c <.
+ *
+ * See std::lexicographical_compare() for how the determination is made.
+ */
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+ { return std::lexicographical_compare(__x.begin(), __x.end(),
+ __y.begin(), __y.end()); }
+
+ /// Based on operator==
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator!=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+ { return __y < __x; }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ /// Based on operator<
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ /// See std::vector::swap().
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
+ { __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(vector<_Tp, _Alloc>&& __x, vector<_Tp, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _STL_VECTOR_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stream_iterator.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stream_iterator.h
new file mode 100644
index 0000000..fce6c26
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stream_iterator.h
@@ -0,0 +1,211 @@
+// Stream iterators
+
+// Copyright (C) 2001, 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file stream_iterator.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STREAM_ITERATOR_H
+#define _STREAM_ITERATOR_H 1
+
+#pragma GCC system_header
+
+#include <debug/debug.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /// Provides input iterator semantics for streams.
+ template<typename _Tp, typename _CharT = char,
+ typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>
+ class istream_iterator
+ : public iterator<input_iterator_tag, _Tp, _Dist, const _Tp*, const _Tp&>
+ {
+ public:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef basic_istream<_CharT, _Traits> istream_type;
+
+ private:
+ istream_type* _M_stream;
+ _Tp _M_value;
+ bool _M_ok;
+
+ public:
+ /// Construct end of input stream iterator.
+ istream_iterator()
+ : _M_stream(0), _M_value(), _M_ok(false) {}
+
+ /// Construct start of input stream iterator.
+ istream_iterator(istream_type& __s)
+ : _M_stream(&__s)
+ { _M_read(); }
+
+ istream_iterator(const istream_iterator& __obj)
+ : _M_stream(__obj._M_stream), _M_value(__obj._M_value),
+ _M_ok(__obj._M_ok)
+ { }
+
+ const _Tp&
+ operator*() const
+ {
+ __glibcxx_requires_cond(_M_ok,
+ _M_message(__gnu_debug::__msg_deref_istream)
+ ._M_iterator(*this));
+ return _M_value;
+ }
+
+ const _Tp*
+ operator->() const { return &(operator*()); }
+
+ istream_iterator&
+ operator++()
+ {
+ __glibcxx_requires_cond(_M_ok,
+ _M_message(__gnu_debug::__msg_inc_istream)
+ ._M_iterator(*this));
+ _M_read();
+ return *this;
+ }
+
+ istream_iterator
+ operator++(int)
+ {
+ __glibcxx_requires_cond(_M_ok,
+ _M_message(__gnu_debug::__msg_inc_istream)
+ ._M_iterator(*this));
+ istream_iterator __tmp = *this;
+ _M_read();
+ return __tmp;
+ }
+
+ bool
+ _M_equal(const istream_iterator& __x) const
+ { return (_M_ok == __x._M_ok) && (!_M_ok || _M_stream == __x._M_stream); }
+
+ private:
+ void
+ _M_read()
+ {
+ _M_ok = (_M_stream && *_M_stream) ? true : false;
+ if (_M_ok)
+ {
+ *_M_stream >> _M_value;
+ _M_ok = *_M_stream ? true : false;
+ }
+ }
+ };
+
+ /// Return true if x and y are both end or not end, or x and y are the same.
+ template<typename _Tp, typename _CharT, typename _Traits, typename _Dist>
+ inline bool
+ operator==(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
+ const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
+ { return __x._M_equal(__y); }
+
+ /// Return false if x and y are both end or not end, or x and y are the same.
+ template <class _Tp, class _CharT, class _Traits, class _Dist>
+ inline bool
+ operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
+ const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
+ { return !__x._M_equal(__y); }
+
+ /**
+ * @brief Provides output iterator semantics for streams.
+ *
+ * This class provides an iterator to write to an ostream. The type Tp is
+ * the only type written by this iterator and there must be an
+ * operator<<(Tp) defined.
+ *
+ * @param Tp The type to write to the ostream.
+ * @param CharT The ostream char_type.
+ * @param Traits The ostream char_traits.
+ */
+ template<typename _Tp, typename _CharT = char,
+ typename _Traits = char_traits<_CharT> >
+ class ostream_iterator
+ : public iterator<output_iterator_tag, void, void, void, void>
+ {
+ public:
+ //@{
+ /// Public typedef
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef basic_ostream<_CharT, _Traits> ostream_type;
+ //@}
+
+ private:
+ ostream_type* _M_stream;
+ const _CharT* _M_string;
+
+ public:
+ /// Construct from an ostream.
+ ostream_iterator(ostream_type& __s) : _M_stream(&__s), _M_string(0) {}
+
+ /**
+ * Construct from an ostream.
+ *
+ * The delimiter string @a c is written to the stream after every Tp
+ * written to the stream. The delimiter is not copied, and thus must
+ * not be destroyed while this iterator is in use.
+ *
+ * @param s Underlying ostream to write to.
+ * @param c CharT delimiter string to insert.
+ */
+ ostream_iterator(ostream_type& __s, const _CharT* __c)
+ : _M_stream(&__s), _M_string(__c) { }
+
+ /// Copy constructor.
+ ostream_iterator(const ostream_iterator& __obj)
+ : _M_stream(__obj._M_stream), _M_string(__obj._M_string) { }
+
+ /// Writes @a value to underlying ostream using operator<<. If
+ /// constructed with delimiter string, writes delimiter to ostream.
+ ostream_iterator&
+ operator=(const _Tp& __value)
+ {
+ __glibcxx_requires_cond(_M_stream != 0,
+ _M_message(__gnu_debug::__msg_output_ostream)
+ ._M_iterator(*this));
+ *_M_stream << __value;
+ if (_M_string) *_M_stream << _M_string;
+ return *this;
+ }
+
+ ostream_iterator&
+ operator*()
+ { return *this; }
+
+ ostream_iterator&
+ operator++()
+ { return *this; }
+
+ ostream_iterator&
+ operator++(int)
+ { return *this; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/streambuf.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/streambuf.tcc
new file mode 100644
index 0000000..f3e6ce7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/streambuf.tcc
@@ -0,0 +1,174 @@
+// Stream buffer classes -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file streambuf.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 27.5 Stream buffers
+//
+
+#ifndef _STREAMBUF_TCC
+#define _STREAMBUF_TCC 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, typename _Traits>
+ streamsize
+ basic_streambuf<_CharT, _Traits>::
+ xsgetn(char_type* __s, streamsize __n)
+ {
+ streamsize __ret = 0;
+ while (__ret < __n)
+ {
+ const streamsize __buf_len = this->egptr() - this->gptr();
+ if (__buf_len)
+ {
+ const streamsize __remaining = __n - __ret;
+ const streamsize __len = std::min(__buf_len, __remaining);
+ traits_type::copy(__s, this->gptr(), __len);
+ __ret += __len;
+ __s += __len;
+ this->gbump(__len);
+ }
+
+ if (__ret < __n)
+ {
+ const int_type __c = this->uflow();
+ if (!traits_type::eq_int_type(__c, traits_type::eof()))
+ {
+ traits_type::assign(*__s++, traits_type::to_char_type(__c));
+ ++__ret;
+ }
+ else
+ break;
+ }
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ streamsize
+ basic_streambuf<_CharT, _Traits>::
+ xsputn(const char_type* __s, streamsize __n)
+ {
+ streamsize __ret = 0;
+ while (__ret < __n)
+ {
+ const streamsize __buf_len = this->epptr() - this->pptr();
+ if (__buf_len)
+ {
+ const streamsize __remaining = __n - __ret;
+ const streamsize __len = std::min(__buf_len, __remaining);
+ traits_type::copy(this->pptr(), __s, __len);
+ __ret += __len;
+ __s += __len;
+ this->pbump(__len);
+ }
+
+ if (__ret < __n)
+ {
+ int_type __c = this->overflow(traits_type::to_int_type(*__s));
+ if (!traits_type::eq_int_type(__c, traits_type::eof()))
+ {
+ ++__ret;
+ ++__s;
+ }
+ else
+ break;
+ }
+ }
+ return __ret;
+ }
+
+ // Conceivably, this could be used to implement buffer-to-buffer
+ // copies, if this was ever desired in an un-ambiguous way by the
+ // standard.
+ template<typename _CharT, typename _Traits>
+ streamsize
+ __copy_streambufs_eof(basic_streambuf<_CharT, _Traits>* __sbin,
+ basic_streambuf<_CharT, _Traits>* __sbout,
+ bool& __ineof)
+ {
+ streamsize __ret = 0;
+ __ineof = true;
+ typename _Traits::int_type __c = __sbin->sgetc();
+ while (!_Traits::eq_int_type(__c, _Traits::eof()))
+ {
+ __c = __sbout->sputc(_Traits::to_char_type(__c));
+ if (_Traits::eq_int_type(__c, _Traits::eof()))
+ {
+ __ineof = false;
+ break;
+ }
+ ++__ret;
+ __c = __sbin->snextc();
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline streamsize
+ __copy_streambufs(basic_streambuf<_CharT, _Traits>* __sbin,
+ basic_streambuf<_CharT, _Traits>* __sbout)
+ {
+ bool __ineof;
+ return __copy_streambufs_eof(__sbin, __sbout, __ineof);
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class basic_streambuf<char>;
+ extern template
+ streamsize
+ __copy_streambufs(basic_streambuf<char>*,
+ basic_streambuf<char>*);
+ extern template
+ streamsize
+ __copy_streambufs_eof(basic_streambuf<char>*,
+ basic_streambuf<char>*, bool&);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class basic_streambuf<wchar_t>;
+ extern template
+ streamsize
+ __copy_streambufs(basic_streambuf<wchar_t>*,
+ basic_streambuf<wchar_t>*);
+ extern template
+ streamsize
+ __copy_streambufs_eof(basic_streambuf<wchar_t>*,
+ basic_streambuf<wchar_t>*, bool&);
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/streambuf_iterator.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/streambuf_iterator.h
new file mode 100644
index 0000000..d02b555
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/streambuf_iterator.h
@@ -0,0 +1,392 @@
+// Streambuf iterators
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file streambuf_iterator.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _STREAMBUF_ITERATOR_H
+#define _STREAMBUF_ITERATOR_H 1
+
+#pragma GCC system_header
+
+#include <streambuf>
+#include <debug/debug.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // 24.5.3 Template class istreambuf_iterator
+ /// Provides input iterator semantics for streambufs.
+ template<typename _CharT, typename _Traits>
+ class istreambuf_iterator
+ : public iterator<input_iterator_tag, _CharT, typename _Traits::off_type,
+ _CharT*, _CharT&>
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef typename _Traits::int_type int_type;
+ typedef basic_streambuf<_CharT, _Traits> streambuf_type;
+ typedef basic_istream<_CharT, _Traits> istream_type;
+ //@}
+
+ template<typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+ ostreambuf_iterator<_CharT2> >::__type
+ copy(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
+ ostreambuf_iterator<_CharT2>);
+
+ template<bool _IsMove, typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+ _CharT2*>::__type
+ __copy_move_a2(istreambuf_iterator<_CharT2>,
+ istreambuf_iterator<_CharT2>, _CharT2*);
+
+ template<typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+ istreambuf_iterator<_CharT2> >::__type
+ find(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
+ const _CharT2&);
+
+ private:
+ // 24.5.3 istreambuf_iterator
+ // p 1
+ // If the end of stream is reached (streambuf_type::sgetc()
+ // returns traits_type::eof()), the iterator becomes equal to
+ // the "end of stream" iterator value.
+ // NB: This implementation assumes the "end of stream" value
+ // is EOF, or -1.
+ mutable streambuf_type* _M_sbuf;
+ mutable int_type _M_c;
+
+ public:
+ /// Construct end of input stream iterator.
+ istreambuf_iterator() throw()
+ : _M_sbuf(0), _M_c(traits_type::eof()) { }
+
+ /// Construct start of input stream iterator.
+ istreambuf_iterator(istream_type& __s) throw()
+ : _M_sbuf(__s.rdbuf()), _M_c(traits_type::eof()) { }
+
+ /// Construct start of streambuf iterator.
+ istreambuf_iterator(streambuf_type* __s) throw()
+ : _M_sbuf(__s), _M_c(traits_type::eof()) { }
+
+ /// Return the current character pointed to by iterator. This returns
+ /// streambuf.sgetc(). It cannot be assigned. NB: The result of
+ /// operator*() on an end of stream is undefined.
+ char_type
+ operator*() const
+ {
+#ifdef _GLIBCXX_DEBUG_PEDANTIC
+ // Dereferencing a past-the-end istreambuf_iterator is a
+ // libstdc++ extension
+ __glibcxx_requires_cond(!_M_at_eof(),
+ _M_message(__gnu_debug::__msg_deref_istreambuf)
+ ._M_iterator(*this));
+#endif
+ return traits_type::to_char_type(_M_get());
+ }
+
+ /// Advance the iterator. Calls streambuf.sbumpc().
+ istreambuf_iterator&
+ operator++()
+ {
+ __glibcxx_requires_cond(!_M_at_eof(),
+ _M_message(__gnu_debug::__msg_inc_istreambuf)
+ ._M_iterator(*this));
+ if (_M_sbuf)
+ {
+ _M_sbuf->sbumpc();
+ _M_c = traits_type::eof();
+ }
+ return *this;
+ }
+
+ /// Advance the iterator. Calls streambuf.sbumpc().
+ istreambuf_iterator
+ operator++(int)
+ {
+ __glibcxx_requires_cond(!_M_at_eof(),
+ _M_message(__gnu_debug::__msg_inc_istreambuf)
+ ._M_iterator(*this));
+
+ istreambuf_iterator __old = *this;
+ if (_M_sbuf)
+ {
+ __old._M_c = _M_sbuf->sbumpc();
+ _M_c = traits_type::eof();
+ }
+ return __old;
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 110 istreambuf_iterator::equal not const
+ // NB: there is also number 111 (NAD, Future) pending on this function.
+ /// Return true both iterators are end or both are not end.
+ bool
+ equal(const istreambuf_iterator& __b) const
+ { return _M_at_eof() == __b._M_at_eof(); }
+
+ private:
+ int_type
+ _M_get() const
+ {
+ const int_type __eof = traits_type::eof();
+ int_type __ret = __eof;
+ if (_M_sbuf)
+ {
+ if (!traits_type::eq_int_type(_M_c, __eof))
+ __ret = _M_c;
+ else if (!traits_type::eq_int_type((__ret = _M_sbuf->sgetc()),
+ __eof))
+ _M_c = __ret;
+ else
+ _M_sbuf = 0;
+ }
+ return __ret;
+ }
+
+ bool
+ _M_at_eof() const
+ {
+ const int_type __eof = traits_type::eof();
+ return traits_type::eq_int_type(_M_get(), __eof);
+ }
+ };
+
+ template<typename _CharT, typename _Traits>
+ inline bool
+ operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
+ const istreambuf_iterator<_CharT, _Traits>& __b)
+ { return __a.equal(__b); }
+
+ template<typename _CharT, typename _Traits>
+ inline bool
+ operator!=(const istreambuf_iterator<_CharT, _Traits>& __a,
+ const istreambuf_iterator<_CharT, _Traits>& __b)
+ { return !__a.equal(__b); }
+
+ /// Provides output iterator semantics for streambufs.
+ template<typename _CharT, typename _Traits>
+ class ostreambuf_iterator
+ : public iterator<output_iterator_tag, void, void, void, void>
+ {
+ public:
+ // Types:
+ //@{
+ /// Public typedefs
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef basic_streambuf<_CharT, _Traits> streambuf_type;
+ typedef basic_ostream<_CharT, _Traits> ostream_type;
+ //@}
+
+ template<typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+ ostreambuf_iterator<_CharT2> >::__type
+ copy(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
+ ostreambuf_iterator<_CharT2>);
+
+ private:
+ streambuf_type* _M_sbuf;
+ bool _M_failed;
+
+ public:
+ /// Construct output iterator from ostream.
+ ostreambuf_iterator(ostream_type& __s) throw ()
+ : _M_sbuf(__s.rdbuf()), _M_failed(!_M_sbuf) { }
+
+ /// Construct output iterator from streambuf.
+ ostreambuf_iterator(streambuf_type* __s) throw ()
+ : _M_sbuf(__s), _M_failed(!_M_sbuf) { }
+
+ /// Write character to streambuf. Calls streambuf.sputc().
+ ostreambuf_iterator&
+ operator=(_CharT __c)
+ {
+ if (!_M_failed &&
+ _Traits::eq_int_type(_M_sbuf->sputc(__c), _Traits::eof()))
+ _M_failed = true;
+ return *this;
+ }
+
+ /// Return *this.
+ ostreambuf_iterator&
+ operator*()
+ { return *this; }
+
+ /// Return *this.
+ ostreambuf_iterator&
+ operator++(int)
+ { return *this; }
+
+ /// Return *this.
+ ostreambuf_iterator&
+ operator++()
+ { return *this; }
+
+ /// Return true if previous operator=() failed.
+ bool
+ failed() const throw()
+ { return _M_failed; }
+
+ ostreambuf_iterator&
+ _M_put(const _CharT* __ws, streamsize __len)
+ {
+ if (__builtin_expect(!_M_failed, true)
+ && __builtin_expect(this->_M_sbuf->sputn(__ws, __len) != __len,
+ false))
+ _M_failed = true;
+ return *this;
+ }
+ };
+
+ // Overloads for streambuf iterators.
+ template<typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ ostreambuf_iterator<_CharT> >::__type
+ copy(istreambuf_iterator<_CharT> __first,
+ istreambuf_iterator<_CharT> __last,
+ ostreambuf_iterator<_CharT> __result)
+ {
+ if (__first._M_sbuf && !__last._M_sbuf && !__result._M_failed)
+ {
+ bool __ineof;
+ __copy_streambufs_eof(__first._M_sbuf, __result._M_sbuf, __ineof);
+ if (!__ineof)
+ __result._M_failed = true;
+ }
+ return __result;
+ }
+
+ template<bool _IsMove, typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ ostreambuf_iterator<_CharT> >::__type
+ __copy_move_a2(_CharT* __first, _CharT* __last,
+ ostreambuf_iterator<_CharT> __result)
+ {
+ const streamsize __num = __last - __first;
+ if (__num > 0)
+ __result._M_put(__first, __num);
+ return __result;
+ }
+
+ template<bool _IsMove, typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ ostreambuf_iterator<_CharT> >::__type
+ __copy_move_a2(const _CharT* __first, const _CharT* __last,
+ ostreambuf_iterator<_CharT> __result)
+ {
+ const streamsize __num = __last - __first;
+ if (__num > 0)
+ __result._M_put(__first, __num);
+ return __result;
+ }
+
+ template<bool _IsMove, typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ _CharT*>::__type
+ __copy_move_a2(istreambuf_iterator<_CharT> __first,
+ istreambuf_iterator<_CharT> __last, _CharT* __result)
+ {
+ typedef istreambuf_iterator<_CharT> __is_iterator_type;
+ typedef typename __is_iterator_type::traits_type traits_type;
+ typedef typename __is_iterator_type::streambuf_type streambuf_type;
+ typedef typename traits_type::int_type int_type;
+
+ if (__first._M_sbuf && !__last._M_sbuf)
+ {
+ streambuf_type* __sb = __first._M_sbuf;
+ int_type __c = __sb->sgetc();
+ while (!traits_type::eq_int_type(__c, traits_type::eof()))
+ {
+ const streamsize __n = __sb->egptr() - __sb->gptr();
+ if (__n > 1)
+ {
+ traits_type::copy(__result, __sb->gptr(), __n);
+ __sb->gbump(__n);
+ __result += __n;
+ __c = __sb->underflow();
+ }
+ else
+ {
+ *__result++ = traits_type::to_char_type(__c);
+ __c = __sb->snextc();
+ }
+ }
+ }
+ return __result;
+ }
+
+ template<typename _CharT>
+ typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+ istreambuf_iterator<_CharT> >::__type
+ find(istreambuf_iterator<_CharT> __first,
+ istreambuf_iterator<_CharT> __last, const _CharT& __val)
+ {
+ typedef istreambuf_iterator<_CharT> __is_iterator_type;
+ typedef typename __is_iterator_type::traits_type traits_type;
+ typedef typename __is_iterator_type::streambuf_type streambuf_type;
+ typedef typename traits_type::int_type int_type;
+
+ if (__first._M_sbuf && !__last._M_sbuf)
+ {
+ const int_type __ival = traits_type::to_int_type(__val);
+ streambuf_type* __sb = __first._M_sbuf;
+ int_type __c = __sb->sgetc();
+ while (!traits_type::eq_int_type(__c, traits_type::eof())
+ && !traits_type::eq_int_type(__c, __ival))
+ {
+ streamsize __n = __sb->egptr() - __sb->gptr();
+ if (__n > 1)
+ {
+ const _CharT* __p = traits_type::find(__sb->gptr(),
+ __n, __val);
+ if (__p)
+ __n = __p - __sb->gptr();
+ __sb->gbump(__n);
+ __c = __sb->sgetc();
+ }
+ else
+ __c = __sb->snextc();
+ }
+
+ if (!traits_type::eq_int_type(__c, traits_type::eof()))
+ __first._M_c = __c;
+ else
+ __first._M_sbuf = 0;
+ }
+ return __first;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stringfwd.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stringfwd.h
new file mode 100644
index 0000000..c63e777
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/stringfwd.h
@@ -0,0 +1,77 @@
+// String support -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file stringfwd.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 21 Strings library
+//
+
+#ifndef _STRINGFWD_H
+#define _STRINGFWD_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _Alloc>
+ class allocator;
+
+ template<class _CharT>
+ struct char_traits;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT>,
+ typename _Alloc = allocator<_CharT> >
+ class basic_string;
+
+ template<> struct char_traits<char>;
+
+ typedef basic_string<char> string;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<> struct char_traits<wchar_t>;
+
+ typedef basic_string<wchar_t> wstring;
+#endif
+
+#if (defined(__GXX_EXPERIMENTAL_CXX0X__) \
+ && defined(_GLIBCXX_USE_C99_STDINT_TR1))
+
+ template<> struct char_traits<char16_t>;
+ template<> struct char_traits<char32_t>;
+
+ typedef basic_string<char16_t> u16string;
+ typedef basic_string<char32_t> u32string;
+
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif // _STRINGFWD_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/unique_ptr.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/unique_ptr.h
new file mode 100644
index 0000000..b686d11
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/unique_ptr.h
@@ -0,0 +1,450 @@
+// unique_ptr implementation -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file unique_ptr.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _UNIQUE_PTR_H
+#define _UNIQUE_PTR_H 1
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#endif
+
+#include <bits/c++config.h>
+#include <debug/debug.h>
+#include <type_traits>
+#include <utility>
+#include <tuple>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @addtogroup pointer_abstractions
+ * @{
+ */
+
+ /// Primary template, default_delete.
+ template<typename _Tp>
+ struct default_delete
+ {
+ default_delete() { }
+
+ template<typename _Up>
+ default_delete(const default_delete<_Up>&) { }
+
+ void
+ operator()(_Tp* __ptr) const
+ {
+ static_assert(sizeof(_Tp)>0,
+ "can't delete pointer to incomplete type");
+ delete __ptr;
+ }
+ };
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 740 - omit specialization for array objects with a compile time length
+ /// Specialization, default_delete.
+ template<typename _Tp>
+ struct default_delete<_Tp[]>
+ {
+ void
+ operator()(_Tp* __ptr) const
+ {
+ static_assert(sizeof(_Tp)>0,
+ "can't delete pointer to incomplete type");
+ delete [] __ptr;
+ }
+ };
+
+ /// 20.7.12.2 unique_ptr for single objects.
+ template <typename _Tp, typename _Tp_Deleter = default_delete<_Tp> >
+ class unique_ptr
+ {
+ typedef std::tuple<_Tp*, _Tp_Deleter> __tuple_type;
+ typedef __tuple_type unique_ptr::* __unspecified_bool_type;
+ typedef _Tp* unique_ptr::* __unspecified_pointer_type;
+
+ public:
+ typedef _Tp* pointer;
+ typedef _Tp element_type;
+ typedef _Tp_Deleter deleter_type;
+
+ // Constructors.
+ unique_ptr()
+ : _M_t(pointer(), deleter_type())
+ { static_assert(!std::is_pointer<deleter_type>::value,
+ "constructed with null function pointer deleter"); }
+
+ explicit
+ unique_ptr(pointer __p)
+ : _M_t(__p, deleter_type())
+ { static_assert(!std::is_pointer<deleter_type>::value,
+ "constructed with null function pointer deleter"); }
+
+ unique_ptr(pointer __p,
+ typename std::conditional<std::is_reference<deleter_type>::value,
+ deleter_type, const deleter_type&>::type __d)
+ : _M_t(__p, __d) { }
+
+ unique_ptr(pointer __p,
+ typename std::remove_reference<deleter_type>::type&& __d)
+ : _M_t(std::move(__p), std::move(__d))
+ { static_assert(!std::is_reference<deleter_type>::value,
+ "rvalue deleter bound to reference"); }
+
+ // Move constructors.
+ unique_ptr(unique_ptr&& __u)
+ : _M_t(__u.release(), std::forward<deleter_type>(__u.get_deleter())) { }
+
+ template<typename _Up, typename _Up_Deleter>
+ unique_ptr(unique_ptr<_Up, _Up_Deleter>&& __u)
+ : _M_t(__u.release(), std::forward<deleter_type>(__u.get_deleter()))
+ { }
+
+ // Destructor.
+ ~unique_ptr() { reset(); }
+
+ // Assignment.
+ unique_ptr&
+ operator=(unique_ptr&& __u)
+ {
+ reset(__u.release());
+ get_deleter() = std::move(__u.get_deleter());
+ return *this;
+ }
+
+ template<typename _Up, typename _Up_Deleter>
+ unique_ptr&
+ operator=(unique_ptr<_Up, _Up_Deleter>&& __u)
+ {
+ reset(__u.release());
+ get_deleter() = std::move(__u.get_deleter());
+ return *this;
+ }
+
+ unique_ptr&
+ operator=(__unspecified_pointer_type)
+ {
+ reset();
+ return *this;
+ }
+
+ // Observers.
+ typename std::add_lvalue_reference<element_type>::type operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(get() != 0);
+ return *get();
+ }
+
+ pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(get() != 0);
+ return get();
+ }
+
+ pointer
+ get() const
+ { return std::get<0>(_M_t); }
+
+ typename std::add_lvalue_reference<deleter_type>::type
+ get_deleter()
+ { return std::get<1>(_M_t); }
+
+ typename std::add_lvalue_reference<
+ typename std::add_const<deleter_type>::type
+ >::type
+ get_deleter() const
+ { return std::get<1>(_M_t); }
+
+ operator __unspecified_bool_type () const
+ { return get() == 0 ? 0 : &unique_ptr::_M_t; }
+
+ // Modifiers.
+ pointer
+ release()
+ {
+ pointer __p = get();
+ std::get<0>(_M_t) = 0;
+ return __p;
+ }
+
+ void
+ reset(pointer __p = pointer())
+ {
+ if (__p != get())
+ {
+ get_deleter()(get());
+ std::get<0>(_M_t) = __p;
+ }
+ }
+
+ void
+ swap(unique_ptr&& __u)
+ {
+ using std::swap;
+ swap(_M_t, __u._M_t);
+ }
+
+ // Disable copy from lvalue.
+ unique_ptr(const unique_ptr&) = delete;
+
+ template<typename _Up, typename _Up_Deleter>
+ unique_ptr(const unique_ptr<_Up, _Up_Deleter>&) = delete;
+
+ unique_ptr& operator=(const unique_ptr&) = delete;
+
+ template<typename _Up, typename _Up_Deleter>
+ unique_ptr& operator=(const unique_ptr<_Up, _Up_Deleter>&) = delete;
+
+ private:
+ __tuple_type _M_t;
+ };
+
+ /// 20.7.12.3 unique_ptr for array objects with a runtime length
+ // [unique.ptr.runtime]
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 740 - omit specialization for array objects with a compile time length
+ template<typename _Tp, typename _Tp_Deleter>
+ class unique_ptr<_Tp[], _Tp_Deleter>
+ {
+ typedef std::tuple<_Tp*, _Tp_Deleter> __tuple_type;
+ typedef __tuple_type unique_ptr::* __unspecified_bool_type;
+ typedef _Tp* unique_ptr::* __unspecified_pointer_type;
+
+ public:
+ typedef _Tp* pointer;
+ typedef _Tp element_type;
+ typedef _Tp_Deleter deleter_type;
+
+ // Constructors.
+ unique_ptr()
+ : _M_t(pointer(), deleter_type())
+ { static_assert(!std::is_pointer<deleter_type>::value,
+ "constructed with null function pointer deleter"); }
+
+ explicit
+ unique_ptr(pointer __p)
+ : _M_t(__p, deleter_type())
+ { static_assert(!std::is_pointer<deleter_type>::value,
+ "constructed with null function pointer deleter"); }
+
+ unique_ptr(pointer __p,
+ typename std::conditional<std::is_reference<deleter_type>::value,
+ deleter_type, const deleter_type&>::type __d)
+ : _M_t(__p, __d) { }
+
+ unique_ptr(pointer __p,
+ typename std::remove_reference<deleter_type>::type && __d)
+ : _M_t(std::move(__p), std::move(__d))
+ { static_assert(!std::is_reference<deleter_type>::value,
+ "rvalue deleter bound to reference"); }
+
+ // Move constructors.
+ unique_ptr(unique_ptr&& __u)
+ : _M_t(__u.release(), std::forward<deleter_type>(__u.get_deleter())) { }
+
+ template<typename _Up, typename _Up_Deleter>
+ unique_ptr(unique_ptr<_Up, _Up_Deleter>&& __u)
+ : _M_t(__u.release(), std::forward<deleter_type>(__u.get_deleter()))
+ { }
+
+ // Destructor.
+ ~unique_ptr() { reset(); }
+
+ // Assignment.
+ unique_ptr&
+ operator=(unique_ptr&& __u)
+ {
+ reset(__u.release());
+ get_deleter() = std::move(__u.get_deleter());
+ return *this;
+ }
+
+ template<typename _Up, typename _Up_Deleter>
+ unique_ptr&
+ operator=(unique_ptr<_Up, _Up_Deleter>&& __u)
+ {
+ reset(__u.release());
+ get_deleter() = std::move(__u.get_deleter());
+ return *this;
+ }
+
+ unique_ptr&
+ operator=(__unspecified_pointer_type)
+ {
+ reset();
+ return *this;
+ }
+
+ // Observers.
+ typename std::add_lvalue_reference<element_type>::type
+ operator[](size_t __i) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(get() != 0);
+ return get()[__i];
+ }
+
+ pointer
+ get() const
+ { return std::get<0>(_M_t); }
+
+ typename std::add_lvalue_reference<deleter_type>::type
+ get_deleter()
+ { return std::get<1>(_M_t); }
+
+ typename std::add_lvalue_reference<
+ typename std::add_const<deleter_type>::type
+ >::type
+ get_deleter() const
+ { return std::get<1>(_M_t); }
+
+ operator __unspecified_bool_type () const
+ { return get() == 0 ? 0 : &unique_ptr::_M_t; }
+
+ // Modifiers.
+ pointer
+ release()
+ {
+ pointer __p = get();
+ std::get<0>(_M_t) = 0;
+ return __p;
+ }
+
+ void
+ reset(pointer __p = pointer())
+ {
+ if (__p != get())
+ {
+ get_deleter()(get());
+ std::get<0>(_M_t) = __p;
+ }
+ }
+
+ // DR 821.
+ template<typename _Up>
+ void reset(_Up) = delete;
+
+ void
+ swap(unique_ptr&& __u)
+ {
+ using std::swap;
+ swap(_M_t, __u._M_t);
+ }
+
+ // Disable copy from lvalue.
+ unique_ptr(const unique_ptr&) = delete;
+ unique_ptr& operator=(const unique_ptr&) = delete;
+
+ // Disable construction from convertible pointer types.
+ // (N2315 - 20.6.5.3.1)
+ template<typename _Up>
+ unique_ptr(_Up*, typename
+ std::conditional<std::is_reference<deleter_type>::value,
+ deleter_type, const deleter_type&>::type,
+ typename std::enable_if<std::is_convertible<_Up*,
+ pointer>::value>::type* = 0) = delete;
+
+ template<typename _Up>
+ unique_ptr(_Up*, typename std::remove_reference<deleter_type>::type&&,
+ typename std::enable_if<std::is_convertible<_Up*,
+ pointer>::value>::type* = 0) = delete;
+
+ template<typename _Up>
+ explicit
+ unique_ptr(_Up*, typename std::enable_if<std::is_convertible<_Up*,
+ pointer>::value>::type* = 0) = delete;
+
+ private:
+ __tuple_type _M_t;
+ };
+
+ template<typename _Tp, typename _Tp_Deleter>
+ inline void
+ swap(unique_ptr<_Tp, _Tp_Deleter>& __x,
+ unique_ptr<_Tp, _Tp_Deleter>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Tp_Deleter>
+ inline void
+ swap(unique_ptr<_Tp, _Tp_Deleter>&& __x,
+ unique_ptr<_Tp, _Tp_Deleter>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Tp_Deleter>
+ inline void
+ swap(unique_ptr<_Tp, _Tp_Deleter>& __x,
+ unique_ptr<_Tp, _Tp_Deleter>&& __y)
+ { __x.swap(__y); }
+
+ template<typename _Tp, typename _Tp_Deleter,
+ typename _Up, typename _Up_Deleter>
+ inline bool
+ operator==(const unique_ptr<_Tp, _Tp_Deleter>& __x,
+ const unique_ptr<_Up, _Up_Deleter>& __y)
+ { return __x.get() == __y.get(); }
+
+ template<typename _Tp, typename _Tp_Deleter,
+ typename _Up, typename _Up_Deleter>
+ inline bool
+ operator!=(const unique_ptr<_Tp, _Tp_Deleter>& __x,
+ const unique_ptr<_Up, _Up_Deleter>& __y)
+ { return !(__x.get() == __y.get()); }
+
+ template<typename _Tp, typename _Tp_Deleter,
+ typename _Up, typename _Up_Deleter>
+ inline bool
+ operator<(const unique_ptr<_Tp, _Tp_Deleter>& __x,
+ const unique_ptr<_Up, _Up_Deleter>& __y)
+ { return __x.get() < __y.get(); }
+
+ template<typename _Tp, typename _Tp_Deleter,
+ typename _Up, typename _Up_Deleter>
+ inline bool
+ operator<=(const unique_ptr<_Tp, _Tp_Deleter>& __x,
+ const unique_ptr<_Up, _Up_Deleter>& __y)
+ { return !(__y.get() < __x.get()); }
+
+ template<typename _Tp, typename _Tp_Deleter,
+ typename _Up, typename _Up_Deleter>
+ inline bool
+ operator>(const unique_ptr<_Tp, _Tp_Deleter>& __x,
+ const unique_ptr<_Up, _Up_Deleter>& __y)
+ { return __y.get() < __x.get(); }
+
+ template<typename _Tp, typename _Tp_Deleter,
+ typename _Up, typename _Up_Deleter>
+ inline bool
+ operator>=(const unique_ptr<_Tp, _Tp_Deleter>& __x,
+ const unique_ptr<_Up, _Up_Deleter>& __y)
+ { return !(__x.get() < __y.get()); }
+
+ // @} group pointer_abstractions
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _UNIQUE_PTR_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/valarray_after.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/valarray_after.h
new file mode 100644
index 0000000..e4093f1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/valarray_after.h
@@ -0,0 +1,549 @@
+// The template and inlines for the -*- C++ -*- internal _Meta class.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file valarray_after.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
+
+#ifndef _VALARRAY_AFTER_H
+#define _VALARRAY_AFTER_H 1
+
+#pragma GCC system_header
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ //
+ // gslice_array closure.
+ //
+ template<class _Dom>
+ class _GBase
+ {
+ public:
+ typedef typename _Dom::value_type value_type;
+
+ _GBase (const _Dom& __e, const valarray<size_t>& __i)
+ : _M_expr (__e), _M_index(__i) {}
+
+ value_type
+ operator[] (size_t __i) const
+ { return _M_expr[_M_index[__i]]; }
+
+ size_t
+ size () const
+ { return _M_index.size(); }
+
+ private:
+ const _Dom& _M_expr;
+ const valarray<size_t>& _M_index;
+ };
+
+ template<typename _Tp>
+ class _GBase<_Array<_Tp> >
+ {
+ public:
+ typedef _Tp value_type;
+
+ _GBase (_Array<_Tp> __a, const valarray<size_t>& __i)
+ : _M_array (__a), _M_index(__i) {}
+
+ value_type
+ operator[] (size_t __i) const
+ { return _M_array._M_data[_M_index[__i]]; }
+
+ size_t
+ size () const
+ { return _M_index.size(); }
+
+ private:
+ const _Array<_Tp> _M_array;
+ const valarray<size_t>& _M_index;
+ };
+
+ template<class _Dom>
+ struct _GClos<_Expr, _Dom>
+ : _GBase<_Dom>
+ {
+ typedef _GBase<_Dom> _Base;
+ typedef typename _Base::value_type value_type;
+
+ _GClos (const _Dom& __e, const valarray<size_t>& __i)
+ : _Base (__e, __i) {}
+ };
+
+ template<typename _Tp>
+ struct _GClos<_ValArray, _Tp>
+ : _GBase<_Array<_Tp> >
+ {
+ typedef _GBase<_Array<_Tp> > _Base;
+ typedef typename _Base::value_type value_type;
+
+ _GClos (_Array<_Tp> __a, const valarray<size_t>& __i)
+ : _Base (__a, __i) {}
+ };
+
+ //
+ // indirect_array closure
+ //
+ template<class _Dom>
+ class _IBase
+ {
+ public:
+ typedef typename _Dom::value_type value_type;
+
+ _IBase (const _Dom& __e, const valarray<size_t>& __i)
+ : _M_expr (__e), _M_index (__i) {}
+
+ value_type
+ operator[] (size_t __i) const
+ { return _M_expr[_M_index[__i]]; }
+
+ size_t
+ size() const
+ { return _M_index.size(); }
+
+ private:
+ const _Dom& _M_expr;
+ const valarray<size_t>& _M_index;
+ };
+
+ template<class _Dom>
+ struct _IClos<_Expr, _Dom>
+ : _IBase<_Dom>
+ {
+ typedef _IBase<_Dom> _Base;
+ typedef typename _Base::value_type value_type;
+
+ _IClos (const _Dom& __e, const valarray<size_t>& __i)
+ : _Base (__e, __i) {}
+ };
+
+ template<typename _Tp>
+ struct _IClos<_ValArray, _Tp>
+ : _IBase<valarray<_Tp> >
+ {
+ typedef _IBase<valarray<_Tp> > _Base;
+ typedef _Tp value_type;
+
+ _IClos (const valarray<_Tp>& __a, const valarray<size_t>& __i)
+ : _Base (__a, __i) {}
+ };
+
+ //
+ // class _Expr
+ //
+ template<class _Clos, typename _Tp>
+ class _Expr
+ {
+ public:
+ typedef _Tp value_type;
+
+ _Expr(const _Clos&);
+
+ const _Clos& operator()() const;
+
+ value_type operator[](size_t) const;
+ valarray<value_type> operator[](slice) const;
+ valarray<value_type> operator[](const gslice&) const;
+ valarray<value_type> operator[](const valarray<bool>&) const;
+ valarray<value_type> operator[](const valarray<size_t>&) const;
+
+ _Expr<_UnClos<__unary_plus, std::_Expr, _Clos>, value_type>
+ operator+() const;
+
+ _Expr<_UnClos<__negate, std::_Expr, _Clos>, value_type>
+ operator-() const;
+
+ _Expr<_UnClos<__bitwise_not, std::_Expr, _Clos>, value_type>
+ operator~() const;
+
+ _Expr<_UnClos<__logical_not, std::_Expr, _Clos>, bool>
+ operator!() const;
+
+ size_t size() const;
+ value_type sum() const;
+
+ valarray<value_type> shift(int) const;
+ valarray<value_type> cshift(int) const;
+
+ value_type min() const;
+ value_type max() const;
+
+ valarray<value_type> apply(value_type (*)(const value_type&)) const;
+ valarray<value_type> apply(value_type (*)(value_type)) const;
+
+ private:
+ const _Clos _M_closure;
+ };
+
+ template<class _Clos, typename _Tp>
+ inline
+ _Expr<_Clos, _Tp>::_Expr(const _Clos& __c) : _M_closure(__c) {}
+
+ template<class _Clos, typename _Tp>
+ inline const _Clos&
+ _Expr<_Clos, _Tp>::operator()() const
+ { return _M_closure; }
+
+ template<class _Clos, typename _Tp>
+ inline _Tp
+ _Expr<_Clos, _Tp>::operator[](size_t __i) const
+ { return _M_closure[__i]; }
+
+ template<class _Clos, typename _Tp>
+ inline valarray<_Tp>
+ _Expr<_Clos, _Tp>::operator[](slice __s) const
+ {
+ valarray<_Tp> __v = valarray<_Tp>(*this)[__s];
+ return __v;
+ }
+
+ template<class _Clos, typename _Tp>
+ inline valarray<_Tp>
+ _Expr<_Clos, _Tp>::operator[](const gslice& __gs) const
+ {
+ valarray<_Tp> __v = valarray<_Tp>(*this)[__gs];
+ return __v;
+ }
+
+ template<class _Clos, typename _Tp>
+ inline valarray<_Tp>
+ _Expr<_Clos, _Tp>::operator[](const valarray<bool>& __m) const
+ {
+ valarray<_Tp> __v = valarray<_Tp>(*this)[__m];
+ return __v;
+ }
+
+ template<class _Clos, typename _Tp>
+ inline valarray<_Tp>
+ _Expr<_Clos, _Tp>::operator[](const valarray<size_t>& __i) const
+ {
+ valarray<_Tp> __v = valarray<_Tp>(*this)[__i];
+ return __v;
+ }
+
+ template<class _Clos, typename _Tp>
+ inline size_t
+ _Expr<_Clos, _Tp>::size() const
+ { return _M_closure.size(); }
+
+ template<class _Clos, typename _Tp>
+ inline valarray<_Tp>
+ _Expr<_Clos, _Tp>::shift(int __n) const
+ {
+ valarray<_Tp> __v = valarray<_Tp>(*this).shift(__n);
+ return __v;
+ }
+
+ template<class _Clos, typename _Tp>
+ inline valarray<_Tp>
+ _Expr<_Clos, _Tp>::cshift(int __n) const
+ {
+ valarray<_Tp> __v = valarray<_Tp>(*this).cshift(__n);
+ return __v;
+ }
+
+ template<class _Clos, typename _Tp>
+ inline valarray<_Tp>
+ _Expr<_Clos, _Tp>::apply(_Tp __f(const _Tp&)) const
+ {
+ valarray<_Tp> __v = valarray<_Tp>(*this).apply(__f);
+ return __v;
+ }
+
+ template<class _Clos, typename _Tp>
+ inline valarray<_Tp>
+ _Expr<_Clos, _Tp>::apply(_Tp __f(_Tp)) const
+ {
+ valarray<_Tp> __v = valarray<_Tp>(*this).apply(__f);
+ return __v;
+ }
+
+ // XXX: replace this with a more robust summation algorithm.
+ template<class _Clos, typename _Tp>
+ inline _Tp
+ _Expr<_Clos, _Tp>::sum() const
+ {
+ size_t __n = _M_closure.size();
+ if (__n == 0)
+ return _Tp();
+ else
+ {
+ _Tp __s = _M_closure[--__n];
+ while (__n != 0)
+ __s += _M_closure[--__n];
+ return __s;
+ }
+ }
+
+ template<class _Clos, typename _Tp>
+ inline _Tp
+ _Expr<_Clos, _Tp>::min() const
+ { return __valarray_min(_M_closure); }
+
+ template<class _Clos, typename _Tp>
+ inline _Tp
+ _Expr<_Clos, _Tp>::max() const
+ { return __valarray_max(_M_closure); }
+
+ template<class _Dom, typename _Tp>
+ inline _Expr<_UnClos<__logical_not, _Expr, _Dom>, bool>
+ _Expr<_Dom, _Tp>::operator!() const
+ {
+ typedef _UnClos<__logical_not, std::_Expr, _Dom> _Closure;
+ return _Expr<_Closure, bool>(_Closure(this->_M_closure));
+ }
+
+#define _DEFINE_EXPR_UNARY_OPERATOR(_Op, _Name) \
+ template<class _Dom, typename _Tp> \
+ inline _Expr<_UnClos<_Name, std::_Expr, _Dom>, _Tp> \
+ _Expr<_Dom, _Tp>::operator _Op() const \
+ { \
+ typedef _UnClos<_Name, std::_Expr, _Dom> _Closure; \
+ return _Expr<_Closure, _Tp>(_Closure(this->_M_closure)); \
+ }
+
+ _DEFINE_EXPR_UNARY_OPERATOR(+, __unary_plus)
+ _DEFINE_EXPR_UNARY_OPERATOR(-, __negate)
+ _DEFINE_EXPR_UNARY_OPERATOR(~, __bitwise_not)
+
+#undef _DEFINE_EXPR_UNARY_OPERATOR
+
+#define _DEFINE_EXPR_BINARY_OPERATOR(_Op, _Name) \
+ template<class _Dom1, class _Dom2> \
+ inline _Expr<_BinClos<_Name, _Expr, _Expr, _Dom1, _Dom2>, \
+ typename __fun<_Name, typename _Dom1::value_type>::result_type> \
+ operator _Op(const _Expr<_Dom1, typename _Dom1::value_type>& __v, \
+ const _Expr<_Dom2, typename _Dom2::value_type>& __w) \
+ { \
+ typedef typename _Dom1::value_type _Arg; \
+ typedef typename __fun<_Name, _Arg>::result_type _Value; \
+ typedef _BinClos<_Name, _Expr, _Expr, _Dom1, _Dom2> _Closure; \
+ return _Expr<_Closure, _Value>(_Closure(__v(), __w())); \
+ } \
+ \
+ template<class _Dom> \
+ inline _Expr<_BinClos<_Name, _Expr, _Constant, _Dom, \
+ typename _Dom::value_type>, \
+ typename __fun<_Name, typename _Dom::value_type>::result_type> \
+ operator _Op(const _Expr<_Dom, typename _Dom::value_type>& __v, \
+ const typename _Dom::value_type& __t) \
+ { \
+ typedef typename _Dom::value_type _Arg; \
+ typedef typename __fun<_Name, _Arg>::result_type _Value; \
+ typedef _BinClos<_Name, _Expr, _Constant, _Dom, _Arg> _Closure; \
+ return _Expr<_Closure, _Value>(_Closure(__v(), __t)); \
+ } \
+ \
+ template<class _Dom> \
+ inline _Expr<_BinClos<_Name, _Constant, _Expr, \
+ typename _Dom::value_type, _Dom>, \
+ typename __fun<_Name, typename _Dom::value_type>::result_type> \
+ operator _Op(const typename _Dom::value_type& __t, \
+ const _Expr<_Dom, typename _Dom::value_type>& __v) \
+ { \
+ typedef typename _Dom::value_type _Arg; \
+ typedef typename __fun<_Name, _Arg>::result_type _Value; \
+ typedef _BinClos<_Name, _Constant, _Expr, _Arg, _Dom> _Closure; \
+ return _Expr<_Closure, _Value>(_Closure(__t, __v())); \
+ } \
+ \
+ template<class _Dom> \
+ inline _Expr<_BinClos<_Name, _Expr, _ValArray, \
+ _Dom, typename _Dom::value_type>, \
+ typename __fun<_Name, typename _Dom::value_type>::result_type> \
+ operator _Op(const _Expr<_Dom,typename _Dom::value_type>& __e, \
+ const valarray<typename _Dom::value_type>& __v) \
+ { \
+ typedef typename _Dom::value_type _Arg; \
+ typedef typename __fun<_Name, _Arg>::result_type _Value; \
+ typedef _BinClos<_Name, _Expr, _ValArray, _Dom, _Arg> _Closure; \
+ return _Expr<_Closure, _Value>(_Closure(__e(), __v)); \
+ } \
+ \
+ template<class _Dom> \
+ inline _Expr<_BinClos<_Name, _ValArray, _Expr, \
+ typename _Dom::value_type, _Dom>, \
+ typename __fun<_Name, typename _Dom::value_type>::result_type> \
+ operator _Op(const valarray<typename _Dom::value_type>& __v, \
+ const _Expr<_Dom, typename _Dom::value_type>& __e) \
+ { \
+ typedef typename _Dom::value_type _Tp; \
+ typedef typename __fun<_Name, _Tp>::result_type _Value; \
+ typedef _BinClos<_Name, _ValArray, _Expr, _Tp, _Dom> _Closure; \
+ return _Expr<_Closure, _Value>(_Closure(__v, __e ())); \
+ }
+
+ _DEFINE_EXPR_BINARY_OPERATOR(+, __plus)
+ _DEFINE_EXPR_BINARY_OPERATOR(-, __minus)
+ _DEFINE_EXPR_BINARY_OPERATOR(*, __multiplies)
+ _DEFINE_EXPR_BINARY_OPERATOR(/, __divides)
+ _DEFINE_EXPR_BINARY_OPERATOR(%, __modulus)
+ _DEFINE_EXPR_BINARY_OPERATOR(^, __bitwise_xor)
+ _DEFINE_EXPR_BINARY_OPERATOR(&, __bitwise_and)
+ _DEFINE_EXPR_BINARY_OPERATOR(|, __bitwise_or)
+ _DEFINE_EXPR_BINARY_OPERATOR(<<, __shift_left)
+ _DEFINE_EXPR_BINARY_OPERATOR(>>, __shift_right)
+ _DEFINE_EXPR_BINARY_OPERATOR(&&, __logical_and)
+ _DEFINE_EXPR_BINARY_OPERATOR(||, __logical_or)
+ _DEFINE_EXPR_BINARY_OPERATOR(==, __equal_to)
+ _DEFINE_EXPR_BINARY_OPERATOR(!=, __not_equal_to)
+ _DEFINE_EXPR_BINARY_OPERATOR(<, __less)
+ _DEFINE_EXPR_BINARY_OPERATOR(>, __greater)
+ _DEFINE_EXPR_BINARY_OPERATOR(<=, __less_equal)
+ _DEFINE_EXPR_BINARY_OPERATOR(>=, __greater_equal)
+
+#undef _DEFINE_EXPR_BINARY_OPERATOR
+
+#define _DEFINE_EXPR_UNARY_FUNCTION(_Name) \
+ template<class _Dom> \
+ inline _Expr<_UnClos<__##_Name, _Expr, _Dom>, \
+ typename _Dom::value_type> \
+ _Name(const _Expr<_Dom, typename _Dom::value_type>& __e) \
+ { \
+ typedef typename _Dom::value_type _Tp; \
+ typedef _UnClos<__##_Name, _Expr, _Dom> _Closure; \
+ return _Expr<_Closure, _Tp>(_Closure(__e())); \
+ } \
+ \
+ template<typename _Tp> \
+ inline _Expr<_UnClos<__##_Name, _ValArray, _Tp>, _Tp> \
+ _Name(const valarray<_Tp>& __v) \
+ { \
+ typedef _UnClos<__##_Name, _ValArray, _Tp> _Closure; \
+ return _Expr<_Closure, _Tp>(_Closure(__v)); \
+ }
+
+ _DEFINE_EXPR_UNARY_FUNCTION(abs)
+ _DEFINE_EXPR_UNARY_FUNCTION(cos)
+ _DEFINE_EXPR_UNARY_FUNCTION(acos)
+ _DEFINE_EXPR_UNARY_FUNCTION(cosh)
+ _DEFINE_EXPR_UNARY_FUNCTION(sin)
+ _DEFINE_EXPR_UNARY_FUNCTION(asin)
+ _DEFINE_EXPR_UNARY_FUNCTION(sinh)
+ _DEFINE_EXPR_UNARY_FUNCTION(tan)
+ _DEFINE_EXPR_UNARY_FUNCTION(tanh)
+ _DEFINE_EXPR_UNARY_FUNCTION(atan)
+ _DEFINE_EXPR_UNARY_FUNCTION(exp)
+ _DEFINE_EXPR_UNARY_FUNCTION(log)
+ _DEFINE_EXPR_UNARY_FUNCTION(log10)
+ _DEFINE_EXPR_UNARY_FUNCTION(sqrt)
+
+#undef _DEFINE_EXPR_UNARY_FUNCTION
+
+#define _DEFINE_EXPR_BINARY_FUNCTION(_Fun) \
+ template<class _Dom1, class _Dom2> \
+ inline _Expr<_BinClos<__##_Fun, _Expr, _Expr, _Dom1, _Dom2>, \
+ typename _Dom1::value_type> \
+ _Fun(const _Expr<_Dom1, typename _Dom1::value_type>& __e1, \
+ const _Expr<_Dom2, typename _Dom2::value_type>& __e2) \
+ { \
+ typedef typename _Dom1::value_type _Tp; \
+ typedef _BinClos<__##_Fun, _Expr, _Expr, _Dom1, _Dom2> _Closure; \
+ return _Expr<_Closure, _Tp>(_Closure(__e1(), __e2())); \
+ } \
+ \
+ template<class _Dom> \
+ inline _Expr<_BinClos<__##_Fun, _Expr, _ValArray, _Dom, \
+ typename _Dom::value_type>, \
+ typename _Dom::value_type> \
+ _Fun(const _Expr<_Dom, typename _Dom::value_type>& __e, \
+ const valarray<typename _Dom::value_type>& __v) \
+ { \
+ typedef typename _Dom::value_type _Tp; \
+ typedef _BinClos<__##_Fun, _Expr, _ValArray, _Dom, _Tp> _Closure; \
+ return _Expr<_Closure, _Tp>(_Closure(__e(), __v)); \
+ } \
+ \
+ template<class _Dom> \
+ inline _Expr<_BinClos<__##_Fun, _ValArray, _Expr, \
+ typename _Dom::value_type, _Dom>, \
+ typename _Dom::value_type> \
+ _Fun(const valarray<typename _Dom::valarray>& __v, \
+ const _Expr<_Dom, typename _Dom::value_type>& __e) \
+ { \
+ typedef typename _Dom::value_type _Tp; \
+ typedef _BinClos<__##_Fun, _ValArray, _Expr, _Tp, _Dom> _Closure; \
+ return _Expr<_Closure, _Tp>(_Closure(__v, __e())); \
+ } \
+ \
+ template<class _Dom> \
+ inline _Expr<_BinClos<__##_Fun, _Expr, _Constant, _Dom, \
+ typename _Dom::value_type>, \
+ typename _Dom::value_type> \
+ _Fun(const _Expr<_Dom, typename _Dom::value_type>& __e, \
+ const typename _Dom::value_type& __t) \
+ { \
+ typedef typename _Dom::value_type _Tp; \
+ typedef _BinClos<__##_Fun, _Expr, _Constant, _Dom, _Tp> _Closure;\
+ return _Expr<_Closure, _Tp>(_Closure(__e(), __t)); \
+ } \
+ \
+ template<class _Dom> \
+ inline _Expr<_BinClos<__##_Fun, _Constant, _Expr, \
+ typename _Dom::value_type, _Dom>, \
+ typename _Dom::value_type> \
+ _Fun(const typename _Dom::value_type& __t, \
+ const _Expr<_Dom, typename _Dom::value_type>& __e) \
+ { \
+ typedef typename _Dom::value_type _Tp; \
+ typedef _BinClos<__##_Fun, _Constant, _Expr, _Tp, _Dom> _Closure; \
+ return _Expr<_Closure, _Tp>(_Closure(__t, __e())); \
+ } \
+ \
+ template<typename _Tp> \
+ inline _Expr<_BinClos<__##_Fun, _ValArray, _ValArray, _Tp, _Tp>, _Tp> \
+ _Fun(const valarray<_Tp>& __v, const valarray<_Tp>& __w) \
+ { \
+ typedef _BinClos<__##_Fun, _ValArray, _ValArray, _Tp, _Tp> _Closure; \
+ return _Expr<_Closure, _Tp>(_Closure(__v, __w)); \
+ } \
+ \
+ template<typename _Tp> \
+ inline _Expr<_BinClos<__##_Fun, _ValArray, _Constant, _Tp, _Tp>, _Tp> \
+ _Fun(const valarray<_Tp>& __v, const _Tp& __t) \
+ { \
+ typedef _BinClos<__##_Fun, _ValArray, _Constant, _Tp, _Tp> _Closure; \
+ return _Expr<_Closure, _Tp>(_Closure(__v, __t)); \
+ } \
+ \
+ template<typename _Tp> \
+ inline _Expr<_BinClos<__##_Fun, _Constant, _ValArray, _Tp, _Tp>, _Tp> \
+ _Fun(const _Tp& __t, const valarray<_Tp>& __v) \
+ { \
+ typedef _BinClos<__##_Fun, _Constant, _ValArray, _Tp, _Tp> _Closure; \
+ return _Expr<_Closure, _Tp>(_Closure(__t, __v)); \
+ }
+
+_DEFINE_EXPR_BINARY_FUNCTION(atan2)
+_DEFINE_EXPR_BINARY_FUNCTION(pow)
+
+#undef _DEFINE_EXPR_BINARY_FUNCTION
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _CPP_VALARRAY_AFTER_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/valarray_array.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/valarray_array.h
new file mode 100644
index 0000000..492891b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/valarray_array.h
@@ -0,0 +1,699 @@
+// The template and inlines for the -*- C++ -*- internal _Array helper class.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file valarray_array.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
+
+#ifndef _VALARRAY_ARRAY_H
+#define _VALARRAY_ARRAY_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/cpp_type_traits.h>
+#include <cstdlib>
+#include <new>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ //
+ // Helper functions on raw pointers
+ //
+
+ // We get memory by the old fashion way
+ inline void*
+ __valarray_get_memory(size_t __n)
+ { return operator new(__n); }
+
+ template<typename _Tp>
+ inline _Tp*__restrict__
+ __valarray_get_storage(size_t __n)
+ {
+ return static_cast<_Tp*__restrict__>
+ (std::__valarray_get_memory(__n * sizeof(_Tp)));
+ }
+
+ // Return memory to the system
+ inline void
+ __valarray_release_memory(void* __p)
+ { operator delete(__p); }
+
+ // Turn a raw-memory into an array of _Tp filled with _Tp()
+ // This is required in 'valarray<T> v(n);'
+ template<typename _Tp, bool>
+ struct _Array_default_ctor
+ {
+ // Please note that this isn't exception safe. But
+ // valarrays aren't required to be exception safe.
+ inline static void
+ _S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
+ {
+ while (__b != __e)
+ new(__b++) _Tp();
+ }
+ };
+
+ template<typename _Tp>
+ struct _Array_default_ctor<_Tp, true>
+ {
+ // For fundamental types, it suffices to say 'memset()'
+ inline static void
+ _S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
+ { __builtin_memset(__b, 0, (__e - __b) * sizeof(_Tp)); }
+ };
+
+ template<typename _Tp>
+ inline void
+ __valarray_default_construct(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
+ {
+ _Array_default_ctor<_Tp, __is_scalar<_Tp>::__value>::_S_do_it(__b, __e);
+ }
+
+ // Turn a raw-memory into an array of _Tp filled with __t
+ // This is the required in valarray<T> v(n, t). Also
+ // used in valarray<>::resize().
+ template<typename _Tp, bool>
+ struct _Array_init_ctor
+ {
+ // Please note that this isn't exception safe. But
+ // valarrays aren't required to be exception safe.
+ inline static void
+ _S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e, const _Tp __t)
+ {
+ while (__b != __e)
+ new(__b++) _Tp(__t);
+ }
+ };
+
+ template<typename _Tp>
+ struct _Array_init_ctor<_Tp, true>
+ {
+ inline static void
+ _S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e, const _Tp __t)
+ {
+ while (__b != __e)
+ *__b++ = __t;
+ }
+ };
+
+ template<typename _Tp>
+ inline void
+ __valarray_fill_construct(_Tp* __restrict__ __b, _Tp* __restrict__ __e,
+ const _Tp __t)
+ {
+ _Array_init_ctor<_Tp, __is_pod(_Tp)>::_S_do_it(__b, __e, __t);
+ }
+
+ //
+ // copy-construct raw array [__o, *) from plain array [__b, __e)
+ // We can't just say 'memcpy()'
+ //
+ template<typename _Tp, bool>
+ struct _Array_copy_ctor
+ {
+ // Please note that this isn't exception safe. But
+ // valarrays aren't required to be exception safe.
+ inline static void
+ _S_do_it(const _Tp* __restrict__ __b, const _Tp* __restrict__ __e,
+ _Tp* __restrict__ __o)
+ {
+ while (__b != __e)
+ new(__o++) _Tp(*__b++);
+ }
+ };
+
+ template<typename _Tp>
+ struct _Array_copy_ctor<_Tp, true>
+ {
+ inline static void
+ _S_do_it(const _Tp* __restrict__ __b, const _Tp* __restrict__ __e,
+ _Tp* __restrict__ __o)
+ { __builtin_memcpy(__o, __b, (__e - __b) * sizeof(_Tp)); }
+ };
+
+ template<typename _Tp>
+ inline void
+ __valarray_copy_construct(const _Tp* __restrict__ __b,
+ const _Tp* __restrict__ __e,
+ _Tp* __restrict__ __o)
+ {
+ _Array_copy_ctor<_Tp, __is_pod(_Tp)>::_S_do_it(__b, __e, __o);
+ }
+
+ // copy-construct raw array [__o, *) from strided array __a[<__n : __s>]
+ template<typename _Tp>
+ inline void
+ __valarray_copy_construct (const _Tp* __restrict__ __a, size_t __n,
+ size_t __s, _Tp* __restrict__ __o)
+ {
+ if (__is_pod(_Tp))
+ while (__n--)
+ {
+ *__o++ = *__a;
+ __a += __s;
+ }
+ else
+ while (__n--)
+ {
+ new(__o++) _Tp(*__a);
+ __a += __s;
+ }
+ }
+
+ // copy-construct raw array [__o, *) from indexed array __a[__i[<__n>]]
+ template<typename _Tp>
+ inline void
+ __valarray_copy_construct (const _Tp* __restrict__ __a,
+ const size_t* __restrict__ __i,
+ _Tp* __restrict__ __o, size_t __n)
+ {
+ if (__is_pod(_Tp))
+ while (__n--)
+ *__o++ = __a[*__i++];
+ else
+ while (__n--)
+ new (__o++) _Tp(__a[*__i++]);
+ }
+
+ // Do the necessary cleanup when we're done with arrays.
+ template<typename _Tp>
+ inline void
+ __valarray_destroy_elements(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
+ {
+ if (!__is_pod(_Tp))
+ while (__b != __e)
+ {
+ __b->~_Tp();
+ ++__b;
+ }
+ }
+
+ // Fill a plain array __a[<__n>] with __t
+ template<typename _Tp>
+ inline void
+ __valarray_fill(_Tp* __restrict__ __a, size_t __n, const _Tp& __t)
+ {
+ while (__n--)
+ *__a++ = __t;
+ }
+
+ // fill strided array __a[<__n-1 : __s>] with __t
+ template<typename _Tp>
+ inline void
+ __valarray_fill(_Tp* __restrict__ __a, size_t __n,
+ size_t __s, const _Tp& __t)
+ {
+ for (size_t __i = 0; __i < __n; ++__i, __a += __s)
+ *__a = __t;
+ }
+
+ // fill indirect array __a[__i[<__n>]] with __i
+ template<typename _Tp>
+ inline void
+ __valarray_fill(_Tp* __restrict__ __a, const size_t* __restrict__ __i,
+ size_t __n, const _Tp& __t)
+ {
+ for (size_t __j = 0; __j < __n; ++__j, ++__i)
+ __a[*__i] = __t;
+ }
+
+ // copy plain array __a[<__n>] in __b[<__n>]
+ // For non-fundamental types, it is wrong to say 'memcpy()'
+ template<typename _Tp, bool>
+ struct _Array_copier
+ {
+ inline static void
+ _S_do_it(const _Tp* __restrict__ __a, size_t __n, _Tp* __restrict__ __b)
+ {
+ while(__n--)
+ *__b++ = *__a++;
+ }
+ };
+
+ template<typename _Tp>
+ struct _Array_copier<_Tp, true>
+ {
+ inline static void
+ _S_do_it(const _Tp* __restrict__ __a, size_t __n, _Tp* __restrict__ __b)
+ { __builtin_memcpy(__b, __a, __n * sizeof (_Tp)); }
+ };
+
+ // Copy a plain array __a[<__n>] into a play array __b[<>]
+ template<typename _Tp>
+ inline void
+ __valarray_copy(const _Tp* __restrict__ __a, size_t __n,
+ _Tp* __restrict__ __b)
+ {
+ _Array_copier<_Tp, __is_pod(_Tp)>::_S_do_it(__a, __n, __b);
+ }
+
+ // Copy strided array __a[<__n : __s>] in plain __b[<__n>]
+ template<typename _Tp>
+ inline void
+ __valarray_copy(const _Tp* __restrict__ __a, size_t __n, size_t __s,
+ _Tp* __restrict__ __b)
+ {
+ for (size_t __i = 0; __i < __n; ++__i, ++__b, __a += __s)
+ *__b = *__a;
+ }
+
+ // Copy a plain array __a[<__n>] into a strided array __b[<__n : __s>]
+ template<typename _Tp>
+ inline void
+ __valarray_copy(const _Tp* __restrict__ __a, _Tp* __restrict__ __b,
+ size_t __n, size_t __s)
+ {
+ for (size_t __i = 0; __i < __n; ++__i, ++__a, __b += __s)
+ *__b = *__a;
+ }
+
+ // Copy strided array __src[<__n : __s1>] into another
+ // strided array __dst[< : __s2>]. Their sizes must match.
+ template<typename _Tp>
+ inline void
+ __valarray_copy(const _Tp* __restrict__ __src, size_t __n, size_t __s1,
+ _Tp* __restrict__ __dst, size_t __s2)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ __dst[__i * __s2] = __src[__i * __s1];
+ }
+
+ // Copy an indexed array __a[__i[<__n>]] in plain array __b[<__n>]
+ template<typename _Tp>
+ inline void
+ __valarray_copy(const _Tp* __restrict__ __a,
+ const size_t* __restrict__ __i,
+ _Tp* __restrict__ __b, size_t __n)
+ {
+ for (size_t __j = 0; __j < __n; ++__j, ++__b, ++__i)
+ *__b = __a[*__i];
+ }
+
+ // Copy a plain array __a[<__n>] in an indexed array __b[__i[<__n>]]
+ template<typename _Tp>
+ inline void
+ __valarray_copy(const _Tp* __restrict__ __a, size_t __n,
+ _Tp* __restrict__ __b, const size_t* __restrict__ __i)
+ {
+ for (size_t __j = 0; __j < __n; ++__j, ++__a, ++__i)
+ __b[*__i] = *__a;
+ }
+
+ // Copy the __n first elements of an indexed array __src[<__i>] into
+ // another indexed array __dst[<__j>].
+ template<typename _Tp>
+ inline void
+ __valarray_copy(const _Tp* __restrict__ __src, size_t __n,
+ const size_t* __restrict__ __i,
+ _Tp* __restrict__ __dst, const size_t* __restrict__ __j)
+ {
+ for (size_t __k = 0; __k < __n; ++__k)
+ __dst[*__j++] = __src[*__i++];
+ }
+
+ //
+ // Compute the sum of elements in range [__f, __l)
+ // This is a naive algorithm. It suffers from cancelling.
+ // In the future try to specialize
+ // for _Tp = float, double, long double using a more accurate
+ // algorithm.
+ //
+ template<typename _Tp>
+ inline _Tp
+ __valarray_sum(const _Tp* __restrict__ __f, const _Tp* __restrict__ __l)
+ {
+ _Tp __r = _Tp();
+ while (__f != __l)
+ __r += *__f++;
+ return __r;
+ }
+
+ // Compute the product of all elements in range [__f, __l)
+ template<typename _Tp>
+ inline _Tp
+ __valarray_product(const _Tp* __restrict__ __f,
+ const _Tp* __restrict__ __l)
+ {
+ _Tp __r = _Tp(1);
+ while (__f != __l)
+ __r = __r * *__f++;
+ return __r;
+ }
+
+ // Compute the min/max of an array-expression
+ template<typename _Ta>
+ inline typename _Ta::value_type
+ __valarray_min(const _Ta& __a)
+ {
+ size_t __s = __a.size();
+ typedef typename _Ta::value_type _Value_type;
+ _Value_type __r = __s == 0 ? _Value_type() : __a[0];
+ for (size_t __i = 1; __i < __s; ++__i)
+ {
+ _Value_type __t = __a[__i];
+ if (__t < __r)
+ __r = __t;
+ }
+ return __r;
+ }
+
+ template<typename _Ta>
+ inline typename _Ta::value_type
+ __valarray_max(const _Ta& __a)
+ {
+ size_t __s = __a.size();
+ typedef typename _Ta::value_type _Value_type;
+ _Value_type __r = __s == 0 ? _Value_type() : __a[0];
+ for (size_t __i = 1; __i < __s; ++__i)
+ {
+ _Value_type __t = __a[__i];
+ if (__t > __r)
+ __r = __t;
+ }
+ return __r;
+ }
+
+ //
+ // Helper class _Array, first layer of valarray abstraction.
+ // All operations on valarray should be forwarded to this class
+ // whenever possible. -- gdr
+ //
+
+ template<typename _Tp>
+ struct _Array
+ {
+ explicit _Array(size_t);
+ explicit _Array(_Tp* const __restrict__);
+ explicit _Array(const valarray<_Tp>&);
+ _Array(const _Tp* __restrict__, size_t);
+
+ _Tp* begin() const;
+
+ _Tp* const __restrict__ _M_data;
+ };
+
+
+ // Copy-construct plain array __b[<__n>] from indexed array __a[__i[<__n>]]
+ template<typename _Tp>
+ inline void
+ __valarray_copy_construct(_Array<_Tp> __a, _Array<size_t> __i,
+ _Array<_Tp> __b, size_t __n)
+ { std::__valarray_copy_construct(__a._M_data, __i._M_data,
+ __b._M_data, __n); }
+
+ // Copy-construct plain array __b[<__n>] from strided array __a[<__n : __s>]
+ template<typename _Tp>
+ inline void
+ __valarray_copy_construct(_Array<_Tp> __a, size_t __n, size_t __s,
+ _Array<_Tp> __b)
+ { std::__valarray_copy_construct(__a._M_data, __n, __s, __b._M_data); }
+
+ template<typename _Tp>
+ inline void
+ __valarray_fill (_Array<_Tp> __a, size_t __n, const _Tp& __t)
+ { std::__valarray_fill(__a._M_data, __n, __t); }
+
+ template<typename _Tp>
+ inline void
+ __valarray_fill(_Array<_Tp> __a, size_t __n, size_t __s, const _Tp& __t)
+ { std::__valarray_fill(__a._M_data, __n, __s, __t); }
+
+ template<typename _Tp>
+ inline void
+ __valarray_fill(_Array<_Tp> __a, _Array<size_t> __i,
+ size_t __n, const _Tp& __t)
+ { std::__valarray_fill(__a._M_data, __i._M_data, __n, __t); }
+
+ // Copy a plain array __a[<__n>] into a play array __b[<>]
+ template<typename _Tp>
+ inline void
+ __valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b)
+ { std::__valarray_copy(__a._M_data, __n, __b._M_data); }
+
+ // Copy strided array __a[<__n : __s>] in plain __b[<__n>]
+ template<typename _Tp>
+ inline void
+ __valarray_copy(_Array<_Tp> __a, size_t __n, size_t __s, _Array<_Tp> __b)
+ { std::__valarray_copy(__a._M_data, __n, __s, __b._M_data); }
+
+ // Copy a plain array __a[<__n>] into a strided array __b[<__n : __s>]
+ template<typename _Tp>
+ inline void
+ __valarray_copy(_Array<_Tp> __a, _Array<_Tp> __b, size_t __n, size_t __s)
+ { __valarray_copy(__a._M_data, __b._M_data, __n, __s); }
+
+ // Copy strided array __src[<__n : __s1>] into another
+ // strided array __dst[< : __s2>]. Their sizes must match.
+ template<typename _Tp>
+ inline void
+ __valarray_copy(_Array<_Tp> __a, size_t __n, size_t __s1,
+ _Array<_Tp> __b, size_t __s2)
+ { std::__valarray_copy(__a._M_data, __n, __s1, __b._M_data, __s2); }
+
+ // Copy an indexed array __a[__i[<__n>]] in plain array __b[<__n>]
+ template<typename _Tp>
+ inline void
+ __valarray_copy(_Array<_Tp> __a, _Array<size_t> __i,
+ _Array<_Tp> __b, size_t __n)
+ { std::__valarray_copy(__a._M_data, __i._M_data, __b._M_data, __n); }
+
+ // Copy a plain array __a[<__n>] in an indexed array __b[__i[<__n>]]
+ template<typename _Tp>
+ inline void
+ __valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b,
+ _Array<size_t> __i)
+ { std::__valarray_copy(__a._M_data, __n, __b._M_data, __i._M_data); }
+
+ // Copy the __n first elements of an indexed array __src[<__i>] into
+ // another indexed array __dst[<__j>].
+ template<typename _Tp>
+ inline void
+ __valarray_copy(_Array<_Tp> __src, size_t __n, _Array<size_t> __i,
+ _Array<_Tp> __dst, _Array<size_t> __j)
+ {
+ std::__valarray_copy(__src._M_data, __n, __i._M_data,
+ __dst._M_data, __j._M_data);
+ }
+
+ template<typename _Tp>
+ inline
+ _Array<_Tp>::_Array(size_t __n)
+ : _M_data(__valarray_get_storage<_Tp>(__n))
+ { std::__valarray_default_construct(_M_data, _M_data + __n); }
+
+ template<typename _Tp>
+ inline
+ _Array<_Tp>::_Array(_Tp* const __restrict__ __p)
+ : _M_data (__p) {}
+
+ template<typename _Tp>
+ inline
+ _Array<_Tp>::_Array(const valarray<_Tp>& __v)
+ : _M_data (__v._M_data) {}
+
+ template<typename _Tp>
+ inline
+ _Array<_Tp>::_Array(const _Tp* __restrict__ __b, size_t __s)
+ : _M_data(__valarray_get_storage<_Tp>(__s))
+ { std::__valarray_copy_construct(__b, __s, _M_data); }
+
+ template<typename _Tp>
+ inline _Tp*
+ _Array<_Tp>::begin () const
+ { return _M_data; }
+
+#define _DEFINE_ARRAY_FUNCTION(_Op, _Name) \
+ template<typename _Tp> \
+ inline void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, size_t __n, const _Tp& __t) \
+ { \
+ for (_Tp* __p = __a._M_data; __p < __a._M_data + __n; ++__p) \
+ *__p _Op##= __t; \
+ } \
+ \
+ template<typename _Tp> \
+ inline void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b) \
+ { \
+ _Tp* __p = __a._M_data; \
+ for (_Tp* __q = __b._M_data; __q < __b._M_data + __n; ++__p, ++__q) \
+ *__p _Op##= *__q; \
+ } \
+ \
+ template<typename _Tp, class _Dom> \
+ void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, \
+ const _Expr<_Dom, _Tp>& __e, size_t __n) \
+ { \
+ _Tp* __p(__a._M_data); \
+ for (size_t __i = 0; __i < __n; ++__i, ++__p) \
+ *__p _Op##= __e[__i]; \
+ } \
+ \
+ template<typename _Tp> \
+ inline void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, size_t __n, size_t __s, \
+ _Array<_Tp> __b) \
+ { \
+ _Tp* __q(__b._M_data); \
+ for (_Tp* __p = __a._M_data; __p < __a._M_data + __s * __n; \
+ __p += __s, ++__q) \
+ *__p _Op##= *__q; \
+ } \
+ \
+ template<typename _Tp> \
+ inline void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, _Array<_Tp> __b, \
+ size_t __n, size_t __s) \
+ { \
+ _Tp* __q(__b._M_data); \
+ for (_Tp* __p = __a._M_data; __p < __a._M_data + __n; \
+ ++__p, __q += __s) \
+ *__p _Op##= *__q; \
+ } \
+ \
+ template<typename _Tp, class _Dom> \
+ void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, size_t __s, \
+ const _Expr<_Dom, _Tp>& __e, size_t __n) \
+ { \
+ _Tp* __p(__a._M_data); \
+ for (size_t __i = 0; __i < __n; ++__i, __p += __s) \
+ *__p _Op##= __e[__i]; \
+ } \
+ \
+ template<typename _Tp> \
+ inline void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, _Array<size_t> __i, \
+ _Array<_Tp> __b, size_t __n) \
+ { \
+ _Tp* __q(__b._M_data); \
+ for (size_t* __j = __i._M_data; __j < __i._M_data + __n; \
+ ++__j, ++__q) \
+ __a._M_data[*__j] _Op##= *__q; \
+ } \
+ \
+ template<typename _Tp> \
+ inline void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, size_t __n, \
+ _Array<_Tp> __b, _Array<size_t> __i) \
+ { \
+ _Tp* __p(__a._M_data); \
+ for (size_t* __j = __i._M_data; __j<__i._M_data + __n; \
+ ++__j, ++__p) \
+ *__p _Op##= __b._M_data[*__j]; \
+ } \
+ \
+ template<typename _Tp, class _Dom> \
+ void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, _Array<size_t> __i, \
+ const _Expr<_Dom, _Tp>& __e, size_t __n) \
+ { \
+ size_t* __j(__i._M_data); \
+ for (size_t __k = 0; __k<__n; ++__k, ++__j) \
+ __a._M_data[*__j] _Op##= __e[__k]; \
+ } \
+ \
+ template<typename _Tp> \
+ void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, _Array<bool> __m, \
+ _Array<_Tp> __b, size_t __n) \
+ { \
+ bool* __ok(__m._M_data); \
+ _Tp* __p(__a._M_data); \
+ for (_Tp* __q = __b._M_data; __q < __b._M_data + __n; \
+ ++__q, ++__ok, ++__p) \
+ { \
+ while (! *__ok) \
+ { \
+ ++__ok; \
+ ++__p; \
+ } \
+ *__p _Op##= *__q; \
+ } \
+ } \
+ \
+ template<typename _Tp> \
+ void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, size_t __n, \
+ _Array<_Tp> __b, _Array<bool> __m) \
+ { \
+ bool* __ok(__m._M_data); \
+ _Tp* __q(__b._M_data); \
+ for (_Tp* __p = __a._M_data; __p < __a._M_data + __n; \
+ ++__p, ++__ok, ++__q) \
+ { \
+ while (! *__ok) \
+ { \
+ ++__ok; \
+ ++__q; \
+ } \
+ *__p _Op##= *__q; \
+ } \
+ } \
+ \
+ template<typename _Tp, class _Dom> \
+ void \
+ _Array_augmented_##_Name(_Array<_Tp> __a, _Array<bool> __m, \
+ const _Expr<_Dom, _Tp>& __e, size_t __n) \
+ { \
+ bool* __ok(__m._M_data); \
+ _Tp* __p(__a._M_data); \
+ for (size_t __i = 0; __i < __n; ++__i, ++__ok, ++__p) \
+ { \
+ while (! *__ok) \
+ { \
+ ++__ok; \
+ ++__p; \
+ } \
+ *__p _Op##= __e[__i]; \
+ } \
+ }
+
+ _DEFINE_ARRAY_FUNCTION(+, __plus)
+ _DEFINE_ARRAY_FUNCTION(-, __minus)
+ _DEFINE_ARRAY_FUNCTION(*, __multiplies)
+ _DEFINE_ARRAY_FUNCTION(/, __divides)
+ _DEFINE_ARRAY_FUNCTION(%, __modulus)
+ _DEFINE_ARRAY_FUNCTION(^, __bitwise_xor)
+ _DEFINE_ARRAY_FUNCTION(|, __bitwise_or)
+ _DEFINE_ARRAY_FUNCTION(&, __bitwise_and)
+ _DEFINE_ARRAY_FUNCTION(<<, __shift_left)
+ _DEFINE_ARRAY_FUNCTION(>>, __shift_right)
+
+#undef _DEFINE_ARRAY_FUNCTION
+
+_GLIBCXX_END_NAMESPACE
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/valarray_array.tcc>
+#endif
+
+#endif /* _ARRAY_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/valarray_array.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/valarray_array.tcc
new file mode 100644
index 0000000..15cb7b1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/valarray_array.tcc
@@ -0,0 +1,241 @@
+// The template and inlines for the -*- C++ -*- internal _Array helper class.
+
+// Copyright (C) 1997, 1998, 1999, 2003, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file valarray_array.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
+
+#ifndef _VALARRAY_ARRAY_TCC
+#define _VALARRAY_ARRAY_TCC 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _Tp>
+ void
+ __valarray_fill(_Array<_Tp> __a, size_t __n, _Array<bool> __m,
+ const _Tp& __t)
+ {
+ _Tp* __p = __a._M_data;
+ bool* __ok (__m._M_data);
+ for (size_t __i=0; __i < __n; ++__i, ++__ok, ++__p)
+ {
+ while (!*__ok)
+ {
+ ++__ok;
+ ++__p;
+ }
+ *__p = __t;
+ }
+ }
+
+ // Copy n elements of a into consecutive elements of b. When m is
+ // false, the corresponding element of a is skipped. m must contain
+ // at least n true elements. a must contain at least n elements and
+ // enough elements to match up with m through the nth true element
+ // of m. I.e. if n is 10, m has 15 elements with 5 false followed
+ // by 10 true, a must have 15 elements.
+ template<typename _Tp>
+ void
+ __valarray_copy(_Array<_Tp> __a, _Array<bool> __m, _Array<_Tp> __b,
+ size_t __n)
+ {
+ _Tp* __p (__a._M_data);
+ bool* __ok (__m._M_data);
+ for (_Tp* __q = __b._M_data; __q < __b._M_data + __n;
+ ++__q, ++__ok, ++__p)
+ {
+ while (! *__ok)
+ {
+ ++__ok;
+ ++__p;
+ }
+ *__q = *__p;
+ }
+ }
+
+ // Copy n consecutive elements from a into elements of b. Elements
+ // of b are skipped if the corresponding element of m is false. m
+ // must contain at least n true elements. b must have at least as
+ // many elements as the index of the nth true element of m. I.e. if
+ // m has 15 elements with 5 false followed by 10 true, b must have
+ // at least 15 elements.
+ template<typename _Tp>
+ void
+ __valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b,
+ _Array<bool> __m)
+ {
+ _Tp* __q (__b._M_data);
+ bool* __ok (__m._M_data);
+ for (_Tp* __p = __a._M_data; __p < __a._M_data+__n;
+ ++__p, ++__ok, ++__q)
+ {
+ while (! *__ok)
+ {
+ ++__ok;
+ ++__q;
+ }
+ *__q = *__p;
+ }
+ }
+
+ // Copy n elements from a into elements of b. Elements of a are
+ // skipped if the corresponding element of m is false. Elements of
+ // b are skipped if the corresponding element of k is false. m and
+ // k must contain at least n true elements. a and b must have at
+ // least as many elements as the index of the nth true element of m.
+ template<typename _Tp>
+ void
+ __valarray_copy(_Array<_Tp> __a, _Array<bool> __m, size_t __n,
+ _Array<_Tp> __b, _Array<bool> __k)
+ {
+ _Tp* __p (__a._M_data);
+ _Tp* __q (__b._M_data);
+ bool* __srcok (__m._M_data);
+ bool* __dstok (__k._M_data);
+ for (size_t __i = 0; __i < __n;
+ ++__srcok, ++__p, ++__dstok, ++__q, ++__i)
+ {
+ while (! *__srcok)
+ {
+ ++__srcok;
+ ++__p;
+ }
+ while (! *__dstok)
+ {
+ ++__dstok;
+ ++__q;
+ }
+ *__q = *__p;
+ }
+ }
+
+ // Copy n consecutive elements of e into consecutive elements of a.
+ // I.e. a[i] = e[i].
+ template<typename _Tp, class _Dom>
+ void
+ __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n, _Array<_Tp> __a)
+ {
+ _Tp* __p (__a._M_data);
+ for (size_t __i = 0; __i < __n; ++__i, ++__p)
+ *__p = __e[__i];
+ }
+
+ // Copy n consecutive elements of e into elements of a using stride
+ // s. I.e., a[0] = e[0], a[s] = e[1], a[2*s] = e[2].
+ template<typename _Tp, class _Dom>
+ void
+ __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n,
+ _Array<_Tp> __a, size_t __s)
+ {
+ _Tp* __p (__a._M_data);
+ for (size_t __i = 0; __i < __n; ++__i, __p += __s)
+ *__p = __e[__i];
+ }
+
+ // Copy n consecutive elements of e into elements of a indexed by
+ // contents of i. I.e., a[i[0]] = e[0].
+ template<typename _Tp, class _Dom>
+ void
+ __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n,
+ _Array<_Tp> __a, _Array<size_t> __i)
+ {
+ size_t* __j (__i._M_data);
+ for (size_t __k = 0; __k < __n; ++__k, ++__j)
+ __a._M_data[*__j] = __e[__k];
+ }
+
+ // Copy n elements of e indexed by contents of f into elements of a
+ // indexed by contents of i. I.e., a[i[0]] = e[f[0]].
+ template<typename _Tp>
+ void
+ __valarray_copy(_Array<_Tp> __e, _Array<size_t> __f,
+ size_t __n,
+ _Array<_Tp> __a, _Array<size_t> __i)
+ {
+ size_t* __g (__f._M_data);
+ size_t* __j (__i._M_data);
+ for (size_t __k = 0; __k < __n; ++__k, ++__j, ++__g)
+ __a._M_data[*__j] = __e._M_data[*__g];
+ }
+
+ // Copy n consecutive elements of e into elements of a. Elements of
+ // a are skipped if the corresponding element of m is false. m must
+ // have at least n true elements and a must have at least as many
+ // elements as the index of the nth true element of m. I.e. if m
+ // has 5 false followed by 10 true elements and n == 10, a must have
+ // at least 15 elements.
+ template<typename _Tp, class _Dom>
+ void
+ __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n,
+ _Array<_Tp> __a, _Array<bool> __m)
+ {
+ bool* __ok (__m._M_data);
+ _Tp* __p (__a._M_data);
+ for (size_t __i = 0; __i < __n; ++__i, ++__ok, ++__p)
+ {
+ while (! *__ok)
+ {
+ ++__ok;
+ ++__p;
+ }
+ *__p = __e[__i];
+ }
+ }
+
+
+ template<typename _Tp, class _Dom>
+ void
+ __valarray_copy_construct(const _Expr<_Dom, _Tp>& __e, size_t __n,
+ _Array<_Tp> __a)
+ {
+ _Tp* __p (__a._M_data);
+ for (size_t __i = 0; __i < __n; ++__i, ++__p)
+ new (__p) _Tp(__e[__i]);
+ }
+
+
+ template<typename _Tp>
+ void
+ __valarray_copy_construct(_Array<_Tp> __a, _Array<bool> __m,
+ _Array<_Tp> __b, size_t __n)
+ {
+ _Tp* __p (__a._M_data);
+ bool* __ok (__m._M_data);
+ for (_Tp* __q = __b._M_data; __q < __b._M_data+__n; ++__q, ++__ok, ++__p)
+ {
+ while (! *__ok)
+ {
+ ++__ok;
+ ++__p;
+ }
+ new (__q) _Tp(*__p);
+ }
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _VALARRAY_ARRAY_TCC */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/valarray_before.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/valarray_before.h
new file mode 100644
index 0000000..444129b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/valarray_before.h
@@ -0,0 +1,730 @@
+// The template and inlines for the -*- C++ -*- internal _Meta class.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file valarray_before.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
+
+#ifndef _VALARRAY_BEFORE_H
+#define _VALARRAY_BEFORE_H 1
+
+#pragma GCC system_header
+
+#include <bits/slice_array.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ //
+ // Implementing a loosened valarray return value is tricky.
+ // First we need to meet 26.3.1/3: we should not add more than
+ // two levels of template nesting. Therefore we resort to template
+ // template to "flatten" loosened return value types.
+ // At some point we use partial specialization to remove one level
+ // template nesting due to _Expr<>
+ //
+
+ // This class is NOT defined. It doesn't need to.
+ template<typename _Tp1, typename _Tp2> class _Constant;
+
+ // Implementations of unary functions applied to valarray<>s.
+ // I use hard-coded object functions here instead of a generic
+ // approach like pointers to function:
+ // 1) correctness: some functions take references, others values.
+ // we can't deduce the correct type afterwards.
+ // 2) efficiency -- object functions can be easily inlined
+ // 3) be Koenig-lookup-friendly
+
+ struct __abs
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return abs(__t); }
+ };
+
+ struct __cos
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return cos(__t); }
+ };
+
+ struct __acos
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return acos(__t); }
+ };
+
+ struct __cosh
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return cosh(__t); }
+ };
+
+ struct __sin
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return sin(__t); }
+ };
+
+ struct __asin
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return asin(__t); }
+ };
+
+ struct __sinh
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return sinh(__t); }
+ };
+
+ struct __tan
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return tan(__t); }
+ };
+
+ struct __atan
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return atan(__t); }
+ };
+
+ struct __tanh
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return tanh(__t); }
+ };
+
+ struct __exp
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return exp(__t); }
+ };
+
+ struct __log
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return log(__t); }
+ };
+
+ struct __log10
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return log10(__t); }
+ };
+
+ struct __sqrt
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return sqrt(__t); }
+ };
+
+ // In the past, we used to tailor operator applications semantics
+ // to the specialization of standard function objects (i.e. plus<>, etc.)
+ // That is incorrect. Therefore we provide our own surrogates.
+
+ struct __unary_plus
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return +__t; }
+ };
+
+ struct __negate
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return -__t; }
+ };
+
+ struct __bitwise_not
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __t) const
+ { return ~__t; }
+ };
+
+ struct __plus
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x + __y; }
+ };
+
+ struct __minus
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x - __y; }
+ };
+
+ struct __multiplies
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x * __y; }
+ };
+
+ struct __divides
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x / __y; }
+ };
+
+ struct __modulus
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x % __y; }
+ };
+
+ struct __bitwise_xor
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x ^ __y; }
+ };
+
+ struct __bitwise_and
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x & __y; }
+ };
+
+ struct __bitwise_or
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x | __y; }
+ };
+
+ struct __shift_left
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x << __y; }
+ };
+
+ struct __shift_right
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x >> __y; }
+ };
+
+ struct __logical_and
+ {
+ template<typename _Tp>
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x && __y; }
+ };
+
+ struct __logical_or
+ {
+ template<typename _Tp>
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x || __y; }
+ };
+
+ struct __logical_not
+ {
+ template<typename _Tp>
+ bool operator()(const _Tp& __x) const { return !__x; }
+ };
+
+ struct __equal_to
+ {
+ template<typename _Tp>
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x == __y; }
+ };
+
+ struct __not_equal_to
+ {
+ template<typename _Tp>
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x != __y; }
+ };
+
+ struct __less
+ {
+ template<typename _Tp>
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x < __y; }
+ };
+
+ struct __greater
+ {
+ template<typename _Tp>
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x > __y; }
+ };
+
+ struct __less_equal
+ {
+ template<typename _Tp>
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x <= __y; }
+ };
+
+ struct __greater_equal
+ {
+ template<typename _Tp>
+ bool operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x >= __y; }
+ };
+
+ // The few binary functions we miss.
+ struct __atan2
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return atan2(__x, __y); }
+ };
+
+ struct __pow
+ {
+ template<typename _Tp>
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
+ { return pow(__x, __y); }
+ };
+
+
+ // We need these bits in order to recover the return type of
+ // some functions/operators now that we're no longer using
+ // function templates.
+ template<typename, typename _Tp>
+ struct __fun
+ {
+ typedef _Tp result_type;
+ };
+
+ // several specializations for relational operators.
+ template<typename _Tp>
+ struct __fun<__logical_not, _Tp>
+ {
+ typedef bool result_type;
+ };
+
+ template<typename _Tp>
+ struct __fun<__logical_and, _Tp>
+ {
+ typedef bool result_type;
+ };
+
+ template<typename _Tp>
+ struct __fun<__logical_or, _Tp>
+ {
+ typedef bool result_type;
+ };
+
+ template<typename _Tp>
+ struct __fun<__less, _Tp>
+ {
+ typedef bool result_type;
+ };
+
+ template<typename _Tp>
+ struct __fun<__greater, _Tp>
+ {
+ typedef bool result_type;
+ };
+
+ template<typename _Tp>
+ struct __fun<__less_equal, _Tp>
+ {
+ typedef bool result_type;
+ };
+
+ template<typename _Tp>
+ struct __fun<__greater_equal, _Tp>
+ {
+ typedef bool result_type;
+ };
+
+ template<typename _Tp>
+ struct __fun<__equal_to, _Tp>
+ {
+ typedef bool result_type;
+ };
+
+ template<typename _Tp>
+ struct __fun<__not_equal_to, _Tp>
+ {
+ typedef bool result_type;
+ };
+
+ //
+ // Apply function taking a value/const reference closure
+ //
+
+ template<typename _Dom, typename _Arg>
+ class _FunBase
+ {
+ public:
+ typedef typename _Dom::value_type value_type;
+
+ _FunBase(const _Dom& __e, value_type __f(_Arg))
+ : _M_expr(__e), _M_func(__f) {}
+
+ value_type operator[](size_t __i) const
+ { return _M_func (_M_expr[__i]); }
+
+ size_t size() const { return _M_expr.size ();}
+
+ private:
+ const _Dom& _M_expr;
+ value_type (*_M_func)(_Arg);
+ };
+
+ template<class _Dom>
+ struct _ValFunClos<_Expr,_Dom> : _FunBase<_Dom, typename _Dom::value_type>
+ {
+ typedef _FunBase<_Dom, typename _Dom::value_type> _Base;
+ typedef typename _Base::value_type value_type;
+ typedef value_type _Tp;
+
+ _ValFunClos(const _Dom& __e, _Tp __f(_Tp)) : _Base(__e, __f) {}
+ };
+
+ template<typename _Tp>
+ struct _ValFunClos<_ValArray,_Tp> : _FunBase<valarray<_Tp>, _Tp>
+ {
+ typedef _FunBase<valarray<_Tp>, _Tp> _Base;
+ typedef _Tp value_type;
+
+ _ValFunClos(const valarray<_Tp>& __v, _Tp __f(_Tp)) : _Base(__v, __f) {}
+ };
+
+ template<class _Dom>
+ struct _RefFunClos<_Expr, _Dom>
+ : _FunBase<_Dom, const typename _Dom::value_type&>
+ {
+ typedef _FunBase<_Dom, const typename _Dom::value_type&> _Base;
+ typedef typename _Base::value_type value_type;
+ typedef value_type _Tp;
+
+ _RefFunClos(const _Dom& __e, _Tp __f(const _Tp&))
+ : _Base(__e, __f) {}
+ };
+
+ template<typename _Tp>
+ struct _RefFunClos<_ValArray, _Tp>
+ : _FunBase<valarray<_Tp>, const _Tp&>
+ {
+ typedef _FunBase<valarray<_Tp>, const _Tp&> _Base;
+ typedef _Tp value_type;
+
+ _RefFunClos(const valarray<_Tp>& __v, _Tp __f(const _Tp&))
+ : _Base(__v, __f) {}
+ };
+
+ //
+ // Unary expression closure.
+ //
+
+ template<class _Oper, class _Arg>
+ class _UnBase
+ {
+ public:
+ typedef typename _Arg::value_type _Vt;
+ typedef typename __fun<_Oper, _Vt>::result_type value_type;
+
+ _UnBase(const _Arg& __e) : _M_expr(__e) {}
+
+ value_type operator[](size_t __i) const
+ { return _Oper()(_M_expr[__i]); }
+
+ size_t size() const { return _M_expr.size(); }
+
+ private:
+ const _Arg& _M_expr;
+ };
+
+ template<class _Oper, class _Dom>
+ struct _UnClos<_Oper, _Expr, _Dom>
+ : _UnBase<_Oper, _Dom>
+ {
+ typedef _Dom _Arg;
+ typedef _UnBase<_Oper, _Dom> _Base;
+ typedef typename _Base::value_type value_type;
+
+ _UnClos(const _Arg& __e) : _Base(__e) {}
+ };
+
+ template<class _Oper, typename _Tp>
+ struct _UnClos<_Oper, _ValArray, _Tp>
+ : _UnBase<_Oper, valarray<_Tp> >
+ {
+ typedef valarray<_Tp> _Arg;
+ typedef _UnBase<_Oper, valarray<_Tp> > _Base;
+ typedef typename _Base::value_type value_type;
+
+ _UnClos(const _Arg& __e) : _Base(__e) {}
+ };
+
+
+ //
+ // Binary expression closure.
+ //
+
+ template<class _Oper, class _FirstArg, class _SecondArg>
+ class _BinBase
+ {
+ public:
+ typedef typename _FirstArg::value_type _Vt;
+ typedef typename __fun<_Oper, _Vt>::result_type value_type;
+
+ _BinBase(const _FirstArg& __e1, const _SecondArg& __e2)
+ : _M_expr1(__e1), _M_expr2(__e2) {}
+
+ value_type operator[](size_t __i) const
+ { return _Oper()(_M_expr1[__i], _M_expr2[__i]); }
+
+ size_t size() const { return _M_expr1.size(); }
+
+ private:
+ const _FirstArg& _M_expr1;
+ const _SecondArg& _M_expr2;
+ };
+
+
+ template<class _Oper, class _Clos>
+ class _BinBase2
+ {
+ public:
+ typedef typename _Clos::value_type _Vt;
+ typedef typename __fun<_Oper, _Vt>::result_type value_type;
+
+ _BinBase2(const _Clos& __e, const _Vt& __t)
+ : _M_expr1(__e), _M_expr2(__t) {}
+
+ value_type operator[](size_t __i) const
+ { return _Oper()(_M_expr1[__i], _M_expr2); }
+
+ size_t size() const { return _M_expr1.size(); }
+
+ private:
+ const _Clos& _M_expr1;
+ const _Vt& _M_expr2;
+ };
+
+ template<class _Oper, class _Clos>
+ class _BinBase1
+ {
+ public:
+ typedef typename _Clos::value_type _Vt;
+ typedef typename __fun<_Oper, _Vt>::result_type value_type;
+
+ _BinBase1(const _Vt& __t, const _Clos& __e)
+ : _M_expr1(__t), _M_expr2(__e) {}
+
+ value_type operator[](size_t __i) const
+ { return _Oper()(_M_expr1, _M_expr2[__i]); }
+
+ size_t size() const { return _M_expr2.size(); }
+
+ private:
+ const _Vt& _M_expr1;
+ const _Clos& _M_expr2;
+ };
+
+ template<class _Oper, class _Dom1, class _Dom2>
+ struct _BinClos<_Oper, _Expr, _Expr, _Dom1, _Dom2>
+ : _BinBase<_Oper, _Dom1, _Dom2>
+ {
+ typedef _BinBase<_Oper, _Dom1, _Dom2> _Base;
+ typedef typename _Base::value_type value_type;
+
+ _BinClos(const _Dom1& __e1, const _Dom2& __e2) : _Base(__e1, __e2) {}
+ };
+
+ template<class _Oper, typename _Tp>
+ struct _BinClos<_Oper,_ValArray, _ValArray, _Tp, _Tp>
+ : _BinBase<_Oper, valarray<_Tp>, valarray<_Tp> >
+ {
+ typedef _BinBase<_Oper, valarray<_Tp>, valarray<_Tp> > _Base;
+ typedef typename _Base::value_type value_type;
+
+ _BinClos(const valarray<_Tp>& __v, const valarray<_Tp>& __w)
+ : _Base(__v, __w) {}
+ };
+
+ template<class _Oper, class _Dom>
+ struct _BinClos<_Oper, _Expr, _ValArray, _Dom, typename _Dom::value_type>
+ : _BinBase<_Oper, _Dom, valarray<typename _Dom::value_type> >
+ {
+ typedef typename _Dom::value_type _Tp;
+ typedef _BinBase<_Oper,_Dom,valarray<_Tp> > _Base;
+ typedef typename _Base::value_type value_type;
+
+ _BinClos(const _Dom& __e1, const valarray<_Tp>& __e2)
+ : _Base(__e1, __e2) {}
+ };
+
+ template<class _Oper, class _Dom>
+ struct _BinClos<_Oper, _ValArray, _Expr, typename _Dom::value_type, _Dom>
+ : _BinBase<_Oper, valarray<typename _Dom::value_type>,_Dom>
+ {
+ typedef typename _Dom::value_type _Tp;
+ typedef _BinBase<_Oper, valarray<_Tp>, _Dom> _Base;
+ typedef typename _Base::value_type value_type;
+
+ _BinClos(const valarray<_Tp>& __e1, const _Dom& __e2)
+ : _Base(__e1, __e2) {}
+ };
+
+ template<class _Oper, class _Dom>
+ struct _BinClos<_Oper, _Expr, _Constant, _Dom, typename _Dom::value_type>
+ : _BinBase2<_Oper, _Dom>
+ {
+ typedef typename _Dom::value_type _Tp;
+ typedef _BinBase2<_Oper,_Dom> _Base;
+ typedef typename _Base::value_type value_type;
+
+ _BinClos(const _Dom& __e1, const _Tp& __e2) : _Base(__e1, __e2) {}
+ };
+
+ template<class _Oper, class _Dom>
+ struct _BinClos<_Oper, _Constant, _Expr, typename _Dom::value_type, _Dom>
+ : _BinBase1<_Oper, _Dom>
+ {
+ typedef typename _Dom::value_type _Tp;
+ typedef _BinBase1<_Oper, _Dom> _Base;
+ typedef typename _Base::value_type value_type;
+
+ _BinClos(const _Tp& __e1, const _Dom& __e2) : _Base(__e1, __e2) {}
+ };
+
+ template<class _Oper, typename _Tp>
+ struct _BinClos<_Oper, _ValArray, _Constant, _Tp, _Tp>
+ : _BinBase2<_Oper, valarray<_Tp> >
+ {
+ typedef _BinBase2<_Oper,valarray<_Tp> > _Base;
+ typedef typename _Base::value_type value_type;
+
+ _BinClos(const valarray<_Tp>& __v, const _Tp& __t) : _Base(__v, __t) {}
+ };
+
+ template<class _Oper, typename _Tp>
+ struct _BinClos<_Oper, _Constant, _ValArray, _Tp, _Tp>
+ : _BinBase1<_Oper, valarray<_Tp> >
+ {
+ typedef _BinBase1<_Oper, valarray<_Tp> > _Base;
+ typedef typename _Base::value_type value_type;
+
+ _BinClos(const _Tp& __t, const valarray<_Tp>& __v) : _Base(__t, __v) {}
+ };
+
+ //
+ // slice_array closure.
+ //
+ template<typename _Dom>
+ class _SBase
+ {
+ public:
+ typedef typename _Dom::value_type value_type;
+
+ _SBase (const _Dom& __e, const slice& __s)
+ : _M_expr (__e), _M_slice (__s) {}
+
+ value_type
+ operator[] (size_t __i) const
+ { return _M_expr[_M_slice.start () + __i * _M_slice.stride ()]; }
+
+ size_t
+ size() const
+ { return _M_slice.size (); }
+
+ private:
+ const _Dom& _M_expr;
+ const slice& _M_slice;
+ };
+
+ template<typename _Tp>
+ class _SBase<_Array<_Tp> >
+ {
+ public:
+ typedef _Tp value_type;
+
+ _SBase (_Array<_Tp> __a, const slice& __s)
+ : _M_array (__a._M_data+__s.start()), _M_size (__s.size()),
+ _M_stride (__s.stride()) {}
+
+ value_type
+ operator[] (size_t __i) const
+ { return _M_array._M_data[__i * _M_stride]; }
+
+ size_t
+ size() const
+ { return _M_size; }
+
+ private:
+ const _Array<_Tp> _M_array;
+ const size_t _M_size;
+ const size_t _M_stride;
+ };
+
+ template<class _Dom>
+ struct _SClos<_Expr, _Dom>
+ : _SBase<_Dom>
+ {
+ typedef _SBase<_Dom> _Base;
+ typedef typename _Base::value_type value_type;
+
+ _SClos (const _Dom& __e, const slice& __s) : _Base (__e, __s) {}
+ };
+
+ template<typename _Tp>
+ struct _SClos<_ValArray, _Tp>
+ : _SBase<_Array<_Tp> >
+ {
+ typedef _SBase<_Array<_Tp> > _Base;
+ typedef _Tp value_type;
+
+ _SClos (_Array<_Tp> __a, const slice& __s) : _Base (__a, __s) {}
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _CPP_VALARRAY_BEFORE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/vector.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/vector.tcc
new file mode 100644
index 0000000..8f67493
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bits/vector.tcc
@@ -0,0 +1,681 @@
+// Vector implementation (out of line) -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file vector.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _VECTOR_TCC
+#define _VECTOR_TCC 1
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ template<typename _Tp, typename _Alloc>
+ void
+ vector<_Tp, _Alloc>::
+ reserve(size_type __n)
+ {
+ if (__n > this->max_size())
+ __throw_length_error(__N("vector::reserve"));
+ if (this->capacity() < __n)
+ {
+ const size_type __old_size = size();
+ pointer __tmp = _M_allocate_and_copy(__n,
+ _GLIBCXX_MAKE_MOVE_ITERATOR(this->_M_impl._M_start),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(this->_M_impl._M_finish));
+ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(this->_M_impl._M_start,
+ this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start);
+ this->_M_impl._M_start = __tmp;
+ this->_M_impl._M_finish = __tmp + __old_size;
+ this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
+ }
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ template<typename... _Args>
+ void
+ vector<_Tp, _Alloc>::
+ emplace_back(_Args&&... __args)
+ {
+ if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
+ {
+ this->_M_impl.construct(this->_M_impl._M_finish,
+ std::forward<_Args>(__args)...);
+ ++this->_M_impl._M_finish;
+ }
+ else
+ _M_insert_aux(end(), std::forward<_Args>(__args)...);
+ }
+#endif
+
+ template<typename _Tp, typename _Alloc>
+ typename vector<_Tp, _Alloc>::iterator
+ vector<_Tp, _Alloc>::
+ insert(iterator __position, const value_type& __x)
+ {
+ const size_type __n = __position - begin();
+ if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage
+ && __position == end())
+ {
+ this->_M_impl.construct(this->_M_impl._M_finish, __x);
+ ++this->_M_impl._M_finish;
+ }
+ else
+ {
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
+ {
+ _Tp __x_copy = __x;
+ _M_insert_aux(__position, std::move(__x_copy));
+ }
+ else
+#endif
+ _M_insert_aux(__position, __x);
+ }
+ return iterator(this->_M_impl._M_start + __n);
+ }
+
+ template<typename _Tp, typename _Alloc>
+ typename vector<_Tp, _Alloc>::iterator
+ vector<_Tp, _Alloc>::
+ erase(iterator __position)
+ {
+ if (__position + 1 != end())
+ _GLIBCXX_MOVE3(__position + 1, end(), __position);
+ --this->_M_impl._M_finish;
+ this->_M_impl.destroy(this->_M_impl._M_finish);
+ return __position;
+ }
+
+ template<typename _Tp, typename _Alloc>
+ typename vector<_Tp, _Alloc>::iterator
+ vector<_Tp, _Alloc>::
+ erase(iterator __first, iterator __last)
+ {
+ if (__last != end())
+ _GLIBCXX_MOVE3(__last, end(), __first);
+ _M_erase_at_end(__first.base() + (end() - __last));
+ return __first;
+ }
+
+ template<typename _Tp, typename _Alloc>
+ vector<_Tp, _Alloc>&
+ vector<_Tp, _Alloc>::
+ operator=(const vector<_Tp, _Alloc>& __x)
+ {
+ if (&__x != this)
+ {
+ const size_type __xlen = __x.size();
+ if (__xlen > capacity())
+ {
+ pointer __tmp = _M_allocate_and_copy(__xlen, __x.begin(),
+ __x.end());
+ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(this->_M_impl._M_start,
+ this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start);
+ this->_M_impl._M_start = __tmp;
+ this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __xlen;
+ }
+ else if (size() >= __xlen)
+ {
+ std::_Destroy(std::copy(__x.begin(), __x.end(), begin()),
+ end(), _M_get_Tp_allocator());
+ }
+ else
+ {
+ std::copy(__x._M_impl._M_start, __x._M_impl._M_start + size(),
+ this->_M_impl._M_start);
+ std::__uninitialized_copy_a(__x._M_impl._M_start + size(),
+ __x._M_impl._M_finish,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ }
+ this->_M_impl._M_finish = this->_M_impl._M_start + __xlen;
+ }
+ return *this;
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ vector<_Tp, _Alloc>::
+ _M_fill_assign(size_t __n, const value_type& __val)
+ {
+ if (__n > capacity())
+ {
+ vector __tmp(__n, __val, _M_get_Tp_allocator());
+ __tmp.swap(*this);
+ }
+ else if (__n > size())
+ {
+ std::fill(begin(), end(), __val);
+ std::__uninitialized_fill_n_a(this->_M_impl._M_finish,
+ __n - size(), __val,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish += __n - size();
+ }
+ else
+ _M_erase_at_end(std::fill_n(this->_M_impl._M_start, __n, __val));
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename _InputIterator>
+ void
+ vector<_Tp, _Alloc>::
+ _M_assign_aux(_InputIterator __first, _InputIterator __last,
+ std::input_iterator_tag)
+ {
+ pointer __cur(this->_M_impl._M_start);
+ for (; __first != __last && __cur != this->_M_impl._M_finish;
+ ++__cur, ++__first)
+ *__cur = *__first;
+ if (__first == __last)
+ _M_erase_at_end(__cur);
+ else
+ insert(end(), __first, __last);
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename _ForwardIterator>
+ void
+ vector<_Tp, _Alloc>::
+ _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag)
+ {
+ const size_type __len = std::distance(__first, __last);
+
+ if (__len > capacity())
+ {
+ pointer __tmp(_M_allocate_and_copy(__len, __first, __last));
+ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(this->_M_impl._M_start,
+ this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start);
+ this->_M_impl._M_start = __tmp;
+ this->_M_impl._M_finish = this->_M_impl._M_start + __len;
+ this->_M_impl._M_end_of_storage = this->_M_impl._M_finish;
+ }
+ else if (size() >= __len)
+ _M_erase_at_end(std::copy(__first, __last, this->_M_impl._M_start));
+ else
+ {
+ _ForwardIterator __mid = __first;
+ std::advance(__mid, size());
+ std::copy(__first, __mid, this->_M_impl._M_start);
+ this->_M_impl._M_finish =
+ std::__uninitialized_copy_a(__mid, __last,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ }
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ template<typename... _Args>
+ typename vector<_Tp, _Alloc>::iterator
+ vector<_Tp, _Alloc>::
+ emplace(iterator __position, _Args&&... __args)
+ {
+ const size_type __n = __position - begin();
+ if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage
+ && __position == end())
+ {
+ this->_M_impl.construct(this->_M_impl._M_finish,
+ std::forward<_Args>(__args)...);
+ ++this->_M_impl._M_finish;
+ }
+ else
+ _M_insert_aux(__position, std::forward<_Args>(__args)...);
+ return iterator(this->_M_impl._M_start + __n);
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename... _Args>
+ void
+ vector<_Tp, _Alloc>::
+ _M_insert_aux(iterator __position, _Args&&... __args)
+#else
+ template<typename _Tp, typename _Alloc>
+ void
+ vector<_Tp, _Alloc>::
+ _M_insert_aux(iterator __position, const _Tp& __x)
+#endif
+ {
+ if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
+ {
+ this->_M_impl.construct(this->_M_impl._M_finish,
+ _GLIBCXX_MOVE(*(this->_M_impl._M_finish
+ - 1)));
+ ++this->_M_impl._M_finish;
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ _Tp __x_copy = __x;
+#endif
+ _GLIBCXX_MOVE_BACKWARD3(__position.base(),
+ this->_M_impl._M_finish - 2,
+ this->_M_impl._M_finish - 1);
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ *__position = __x_copy;
+#else
+ *__position = _Tp(std::forward<_Args>(__args)...);
+#endif
+ }
+ else
+ {
+ const size_type __len =
+ _M_check_len(size_type(1), "vector::_M_insert_aux");
+ const size_type __elems_before = __position - begin();
+ pointer __new_start(this->_M_allocate(__len));
+ pointer __new_finish(__new_start);
+ __try
+ {
+ // The order of the three operations is dictated by the C++0x
+ // case, where the moves could alter a new element belonging
+ // to the existing vector. This is an issue only for callers
+ // taking the element by const lvalue ref (see 23.1/13).
+ this->_M_impl.construct(__new_start + __elems_before,
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ std::forward<_Args>(__args)...);
+#else
+ __x);
+#endif
+ __new_finish = 0;
+
+ __new_finish =
+ std::__uninitialized_move_a(this->_M_impl._M_start,
+ __position.base(), __new_start,
+ _M_get_Tp_allocator());
+ ++__new_finish;
+
+ __new_finish =
+ std::__uninitialized_move_a(__position.base(),
+ this->_M_impl._M_finish,
+ __new_finish,
+ _M_get_Tp_allocator());
+ }
+ __catch(...)
+ {
+ if (!__new_finish)
+ this->_M_impl.destroy(__new_start + __elems_before);
+ else
+ std::_Destroy(__new_start, __new_finish, _M_get_Tp_allocator());
+ _M_deallocate(__new_start, __len);
+ __throw_exception_again;
+ }
+ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(this->_M_impl._M_start,
+ this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start);
+ this->_M_impl._M_start = __new_start;
+ this->_M_impl._M_finish = __new_finish;
+ this->_M_impl._M_end_of_storage = __new_start + __len;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ void
+ vector<_Tp, _Alloc>::
+ _M_fill_insert(iterator __position, size_type __n, const value_type& __x)
+ {
+ if (__n != 0)
+ {
+ if (size_type(this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_finish) >= __n)
+ {
+ value_type __x_copy = __x;
+ const size_type __elems_after = end() - __position;
+ pointer __old_finish(this->_M_impl._M_finish);
+ if (__elems_after > __n)
+ {
+ std::__uninitialized_move_a(this->_M_impl._M_finish - __n,
+ this->_M_impl._M_finish,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish += __n;
+ _GLIBCXX_MOVE_BACKWARD3(__position.base(),
+ __old_finish - __n, __old_finish);
+ std::fill(__position.base(), __position.base() + __n,
+ __x_copy);
+ }
+ else
+ {
+ std::__uninitialized_fill_n_a(this->_M_impl._M_finish,
+ __n - __elems_after,
+ __x_copy,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish += __n - __elems_after;
+ std::__uninitialized_move_a(__position.base(), __old_finish,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish += __elems_after;
+ std::fill(__position.base(), __old_finish, __x_copy);
+ }
+ }
+ else
+ {
+ const size_type __len =
+ _M_check_len(__n, "vector::_M_fill_insert");
+ const size_type __elems_before = __position - begin();
+ pointer __new_start(this->_M_allocate(__len));
+ pointer __new_finish(__new_start);
+ __try
+ {
+ // See _M_insert_aux above.
+ std::__uninitialized_fill_n_a(__new_start + __elems_before,
+ __n, __x,
+ _M_get_Tp_allocator());
+ __new_finish = 0;
+
+ __new_finish =
+ std::__uninitialized_move_a(this->_M_impl._M_start,
+ __position.base(),
+ __new_start,
+ _M_get_Tp_allocator());
+ __new_finish += __n;
+
+ __new_finish =
+ std::__uninitialized_move_a(__position.base(),
+ this->_M_impl._M_finish,
+ __new_finish,
+ _M_get_Tp_allocator());
+ }
+ __catch(...)
+ {
+ if (!__new_finish)
+ std::_Destroy(__new_start + __elems_before,
+ __new_start + __elems_before + __n,
+ _M_get_Tp_allocator());
+ else
+ std::_Destroy(__new_start, __new_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(__new_start, __len);
+ __throw_exception_again;
+ }
+ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(this->_M_impl._M_start,
+ this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start);
+ this->_M_impl._M_start = __new_start;
+ this->_M_impl._M_finish = __new_finish;
+ this->_M_impl._M_end_of_storage = __new_start + __len;
+ }
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename _InputIterator>
+ void
+ vector<_Tp, _Alloc>::
+ _M_range_insert(iterator __pos, _InputIterator __first,
+ _InputIterator __last, std::input_iterator_tag)
+ {
+ for (; __first != __last; ++__first)
+ {
+ __pos = insert(__pos, *__first);
+ ++__pos;
+ }
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename _ForwardIterator>
+ void
+ vector<_Tp, _Alloc>::
+ _M_range_insert(iterator __position, _ForwardIterator __first,
+ _ForwardIterator __last, std::forward_iterator_tag)
+ {
+ if (__first != __last)
+ {
+ const size_type __n = std::distance(__first, __last);
+ if (size_type(this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_finish) >= __n)
+ {
+ const size_type __elems_after = end() - __position;
+ pointer __old_finish(this->_M_impl._M_finish);
+ if (__elems_after > __n)
+ {
+ std::__uninitialized_move_a(this->_M_impl._M_finish - __n,
+ this->_M_impl._M_finish,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish += __n;
+ _GLIBCXX_MOVE_BACKWARD3(__position.base(),
+ __old_finish - __n, __old_finish);
+ std::copy(__first, __last, __position);
+ }
+ else
+ {
+ _ForwardIterator __mid = __first;
+ std::advance(__mid, __elems_after);
+ std::__uninitialized_copy_a(__mid, __last,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish += __n - __elems_after;
+ std::__uninitialized_move_a(__position.base(),
+ __old_finish,
+ this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish += __elems_after;
+ std::copy(__first, __mid, __position);
+ }
+ }
+ else
+ {
+ const size_type __len =
+ _M_check_len(__n, "vector::_M_range_insert");
+ pointer __new_start(this->_M_allocate(__len));
+ pointer __new_finish(__new_start);
+ __try
+ {
+ __new_finish =
+ std::__uninitialized_move_a(this->_M_impl._M_start,
+ __position.base(),
+ __new_start,
+ _M_get_Tp_allocator());
+ __new_finish =
+ std::__uninitialized_copy_a(__first, __last,
+ __new_finish,
+ _M_get_Tp_allocator());
+ __new_finish =
+ std::__uninitialized_move_a(__position.base(),
+ this->_M_impl._M_finish,
+ __new_finish,
+ _M_get_Tp_allocator());
+ }
+ __catch(...)
+ {
+ std::_Destroy(__new_start, __new_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(__new_start, __len);
+ __throw_exception_again;
+ }
+ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ _M_deallocate(this->_M_impl._M_start,
+ this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start);
+ this->_M_impl._M_start = __new_start;
+ this->_M_impl._M_finish = __new_finish;
+ this->_M_impl._M_end_of_storage = __new_start + __len;
+ }
+ }
+ }
+
+
+ // vector<bool>
+
+ template<typename _Alloc>
+ void
+ vector<bool, _Alloc>::
+ reserve(size_type __n)
+ {
+ if (__n > this->max_size())
+ __throw_length_error(__N("vector::reserve"));
+ if (this->capacity() < __n)
+ {
+ _Bit_type* __q = this->_M_allocate(__n);
+ this->_M_impl._M_finish = _M_copy_aligned(begin(), end(),
+ iterator(__q, 0));
+ this->_M_deallocate();
+ this->_M_impl._M_start = iterator(__q, 0);
+ this->_M_impl._M_end_of_storage = (__q + (__n + int(_S_word_bit) - 1)
+ / int(_S_word_bit));
+ }
+ }
+
+ template<typename _Alloc>
+ void
+ vector<bool, _Alloc>::
+ _M_fill_insert(iterator __position, size_type __n, bool __x)
+ {
+ if (__n == 0)
+ return;
+ if (capacity() - size() >= __n)
+ {
+ std::copy_backward(__position, end(),
+ this->_M_impl._M_finish + difference_type(__n));
+ std::fill(__position, __position + difference_type(__n), __x);
+ this->_M_impl._M_finish += difference_type(__n);
+ }
+ else
+ {
+ const size_type __len =
+ _M_check_len(__n, "vector<bool>::_M_fill_insert");
+ _Bit_type * __q = this->_M_allocate(__len);
+ iterator __i = _M_copy_aligned(begin(), __position,
+ iterator(__q, 0));
+ std::fill(__i, __i + difference_type(__n), __x);
+ this->_M_impl._M_finish = std::copy(__position, end(),
+ __i + difference_type(__n));
+ this->_M_deallocate();
+ this->_M_impl._M_end_of_storage = (__q + ((__len
+ + int(_S_word_bit) - 1)
+ / int(_S_word_bit)));
+ this->_M_impl._M_start = iterator(__q, 0);
+ }
+ }
+
+ template<typename _Alloc>
+ template<typename _ForwardIterator>
+ void
+ vector<bool, _Alloc>::
+ _M_insert_range(iterator __position, _ForwardIterator __first,
+ _ForwardIterator __last, std::forward_iterator_tag)
+ {
+ if (__first != __last)
+ {
+ size_type __n = std::distance(__first, __last);
+ if (capacity() - size() >= __n)
+ {
+ std::copy_backward(__position, end(),
+ this->_M_impl._M_finish
+ + difference_type(__n));
+ std::copy(__first, __last, __position);
+ this->_M_impl._M_finish += difference_type(__n);
+ }
+ else
+ {
+ const size_type __len =
+ _M_check_len(__n, "vector<bool>::_M_insert_range");
+ _Bit_type * __q = this->_M_allocate(__len);
+ iterator __i = _M_copy_aligned(begin(), __position,
+ iterator(__q, 0));
+ __i = std::copy(__first, __last, __i);
+ this->_M_impl._M_finish = std::copy(__position, end(), __i);
+ this->_M_deallocate();
+ this->_M_impl._M_end_of_storage = (__q
+ + ((__len
+ + int(_S_word_bit) - 1)
+ / int(_S_word_bit)));
+ this->_M_impl._M_start = iterator(__q, 0);
+ }
+ }
+ }
+
+ template<typename _Alloc>
+ void
+ vector<bool, _Alloc>::
+ _M_insert_aux(iterator __position, bool __x)
+ {
+ if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage)
+ {
+ std::copy_backward(__position, this->_M_impl._M_finish,
+ this->_M_impl._M_finish + 1);
+ *__position = __x;
+ ++this->_M_impl._M_finish;
+ }
+ else
+ {
+ const size_type __len =
+ _M_check_len(size_type(1), "vector<bool>::_M_insert_aux");
+ _Bit_type * __q = this->_M_allocate(__len);
+ iterator __i = _M_copy_aligned(begin(), __position,
+ iterator(__q, 0));
+ *__i++ = __x;
+ this->_M_impl._M_finish = std::copy(__position, end(), __i);
+ this->_M_deallocate();
+ this->_M_impl._M_end_of_storage = (__q + ((__len
+ + int(_S_word_bit) - 1)
+ / int(_S_word_bit)));
+ this->_M_impl._M_start = iterator(__q, 0);
+ }
+ }
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#endif /* _VECTOR_TCC */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bitset b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bitset
new file mode 100644
index 0000000..5ca4429
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/bitset
@@ -0,0 +1,1396 @@
+// <bitset> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/bitset
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_BITSET
+#define _GLIBCXX_BITSET 1
+
+#pragma GCC system_header
+
+#include <cstddef> // For size_t
+#include <string>
+#include <bits/functexcept.h> // For invalid_argument, out_of_range,
+ // overflow_error
+#include <iosfwd>
+#include <cxxabi-forced.h>
+
+#define _GLIBCXX_BITSET_BITS_PER_WORD (__CHAR_BIT__ * sizeof(unsigned long))
+#define _GLIBCXX_BITSET_WORDS(__n) \
+ ((__n) < 1 ? 0 : ((__n) + _GLIBCXX_BITSET_BITS_PER_WORD - 1) \
+ / _GLIBCXX_BITSET_BITS_PER_WORD)
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
+ /**
+ * Base class, general case. It is a class invariant that _Nw will be
+ * nonnegative.
+ *
+ * See documentation for bitset.
+ */
+ template<size_t _Nw>
+ struct _Base_bitset
+ {
+ typedef unsigned long _WordT;
+
+ /// 0 is the least significant word.
+ _WordT _M_w[_Nw];
+
+ _Base_bitset()
+ { _M_do_reset(); }
+
+ _Base_bitset(unsigned long __val)
+ {
+ _M_do_reset();
+ _M_w[0] = __val;
+ }
+
+ static size_t
+ _S_whichword(size_t __pos )
+ { return __pos / _GLIBCXX_BITSET_BITS_PER_WORD; }
+
+ static size_t
+ _S_whichbyte(size_t __pos )
+ { return (__pos % _GLIBCXX_BITSET_BITS_PER_WORD) / __CHAR_BIT__; }
+
+ static size_t
+ _S_whichbit(size_t __pos )
+ { return __pos % _GLIBCXX_BITSET_BITS_PER_WORD; }
+
+ static _WordT
+ _S_maskbit(size_t __pos )
+ { return (static_cast<_WordT>(1)) << _S_whichbit(__pos); }
+
+ _WordT&
+ _M_getword(size_t __pos)
+ { return _M_w[_S_whichword(__pos)]; }
+
+ _WordT
+ _M_getword(size_t __pos) const
+ { return _M_w[_S_whichword(__pos)]; }
+
+ _WordT&
+ _M_hiword()
+ { return _M_w[_Nw - 1]; }
+
+ _WordT
+ _M_hiword() const
+ { return _M_w[_Nw - 1]; }
+
+ void
+ _M_do_and(const _Base_bitset<_Nw>& __x)
+ {
+ for (size_t __i = 0; __i < _Nw; __i++)
+ _M_w[__i] &= __x._M_w[__i];
+ }
+
+ void
+ _M_do_or(const _Base_bitset<_Nw>& __x)
+ {
+ for (size_t __i = 0; __i < _Nw; __i++)
+ _M_w[__i] |= __x._M_w[__i];
+ }
+
+ void
+ _M_do_xor(const _Base_bitset<_Nw>& __x)
+ {
+ for (size_t __i = 0; __i < _Nw; __i++)
+ _M_w[__i] ^= __x._M_w[__i];
+ }
+
+ void
+ _M_do_left_shift(size_t __shift);
+
+ void
+ _M_do_right_shift(size_t __shift);
+
+ void
+ _M_do_flip()
+ {
+ for (size_t __i = 0; __i < _Nw; __i++)
+ _M_w[__i] = ~_M_w[__i];
+ }
+
+ void
+ _M_do_set()
+ {
+ for (size_t __i = 0; __i < _Nw; __i++)
+ _M_w[__i] = ~static_cast<_WordT>(0);
+ }
+
+ void
+ _M_do_reset()
+ { __builtin_memset(_M_w, 0, _Nw * sizeof(_WordT)); }
+
+ bool
+ _M_is_equal(const _Base_bitset<_Nw>& __x) const
+ {
+ for (size_t __i = 0; __i < _Nw; ++__i)
+ if (_M_w[__i] != __x._M_w[__i])
+ return false;
+ return true;
+ }
+
+ size_t
+ _M_are_all_aux() const
+ {
+ for (size_t __i = 0; __i < _Nw - 1; __i++)
+ if (_M_w[__i] != ~static_cast<_WordT>(0))
+ return 0;
+ return ((_Nw - 1) * _GLIBCXX_BITSET_BITS_PER_WORD
+ + __builtin_popcountl(_M_hiword()));
+ }
+
+ bool
+ _M_is_any() const
+ {
+ for (size_t __i = 0; __i < _Nw; __i++)
+ if (_M_w[__i] != static_cast<_WordT>(0))
+ return true;
+ return false;
+ }
+
+ size_t
+ _M_do_count() const
+ {
+ size_t __result = 0;
+ for (size_t __i = 0; __i < _Nw; __i++)
+ __result += __builtin_popcountl(_M_w[__i]);
+ return __result;
+ }
+
+ unsigned long
+ _M_do_to_ulong() const;
+
+ // find first "on" bit
+ size_t
+ _M_do_find_first(size_t __not_found) const;
+
+ // find the next "on" bit that follows "prev"
+ size_t
+ _M_do_find_next(size_t __prev, size_t __not_found) const;
+ };
+
+ // Definitions of non-inline functions from _Base_bitset.
+ template<size_t _Nw>
+ void
+ _Base_bitset<_Nw>::_M_do_left_shift(size_t __shift)
+ {
+ if (__builtin_expect(__shift != 0, 1))
+ {
+ const size_t __wshift = __shift / _GLIBCXX_BITSET_BITS_PER_WORD;
+ const size_t __offset = __shift % _GLIBCXX_BITSET_BITS_PER_WORD;
+
+ if (__offset == 0)
+ for (size_t __n = _Nw - 1; __n >= __wshift; --__n)
+ _M_w[__n] = _M_w[__n - __wshift];
+ else
+ {
+ const size_t __sub_offset = (_GLIBCXX_BITSET_BITS_PER_WORD
+ - __offset);
+ for (size_t __n = _Nw - 1; __n > __wshift; --__n)
+ _M_w[__n] = ((_M_w[__n - __wshift] << __offset)
+ | (_M_w[__n - __wshift - 1] >> __sub_offset));
+ _M_w[__wshift] = _M_w[0] << __offset;
+ }
+
+ std::fill(_M_w + 0, _M_w + __wshift, static_cast<_WordT>(0));
+ }
+ }
+
+ template<size_t _Nw>
+ void
+ _Base_bitset<_Nw>::_M_do_right_shift(size_t __shift)
+ {
+ if (__builtin_expect(__shift != 0, 1))
+ {
+ const size_t __wshift = __shift / _GLIBCXX_BITSET_BITS_PER_WORD;
+ const size_t __offset = __shift % _GLIBCXX_BITSET_BITS_PER_WORD;
+ const size_t __limit = _Nw - __wshift - 1;
+
+ if (__offset == 0)
+ for (size_t __n = 0; __n <= __limit; ++__n)
+ _M_w[__n] = _M_w[__n + __wshift];
+ else
+ {
+ const size_t __sub_offset = (_GLIBCXX_BITSET_BITS_PER_WORD
+ - __offset);
+ for (size_t __n = 0; __n < __limit; ++__n)
+ _M_w[__n] = ((_M_w[__n + __wshift] >> __offset)
+ | (_M_w[__n + __wshift + 1] << __sub_offset));
+ _M_w[__limit] = _M_w[_Nw-1] >> __offset;
+ }
+
+ std::fill(_M_w + __limit + 1, _M_w + _Nw, static_cast<_WordT>(0));
+ }
+ }
+
+ template<size_t _Nw>
+ unsigned long
+ _Base_bitset<_Nw>::_M_do_to_ulong() const
+ {
+ for (size_t __i = 1; __i < _Nw; ++__i)
+ if (_M_w[__i])
+ __throw_overflow_error(__N("_Base_bitset::_M_do_to_ulong"));
+ return _M_w[0];
+ }
+
+ template<size_t _Nw>
+ size_t
+ _Base_bitset<_Nw>::_M_do_find_first(size_t __not_found) const
+ {
+ for (size_t __i = 0; __i < _Nw; __i++)
+ {
+ _WordT __thisword = _M_w[__i];
+ if (__thisword != static_cast<_WordT>(0))
+ return (__i * _GLIBCXX_BITSET_BITS_PER_WORD
+ + __builtin_ctzl(__thisword));
+ }
+ // not found, so return an indication of failure.
+ return __not_found;
+ }
+
+ template<size_t _Nw>
+ size_t
+ _Base_bitset<_Nw>::_M_do_find_next(size_t __prev, size_t __not_found) const
+ {
+ // make bound inclusive
+ ++__prev;
+
+ // check out of bounds
+ if (__prev >= _Nw * _GLIBCXX_BITSET_BITS_PER_WORD)
+ return __not_found;
+
+ // search first word
+ size_t __i = _S_whichword(__prev);
+ _WordT __thisword = _M_w[__i];
+
+ // mask off bits below bound
+ __thisword &= (~static_cast<_WordT>(0)) << _S_whichbit(__prev);
+
+ if (__thisword != static_cast<_WordT>(0))
+ return (__i * _GLIBCXX_BITSET_BITS_PER_WORD
+ + __builtin_ctzl(__thisword));
+
+ // check subsequent words
+ __i++;
+ for (; __i < _Nw; __i++)
+ {
+ __thisword = _M_w[__i];
+ if (__thisword != static_cast<_WordT>(0))
+ return (__i * _GLIBCXX_BITSET_BITS_PER_WORD
+ + __builtin_ctzl(__thisword));
+ }
+ // not found, so return an indication of failure.
+ return __not_found;
+ } // end _M_do_find_next
+
+ /**
+ * Base class, specialization for a single word.
+ *
+ * See documentation for bitset.
+ */
+ template<>
+ struct _Base_bitset<1>
+ {
+ typedef unsigned long _WordT;
+ _WordT _M_w;
+
+ _Base_bitset(void)
+ : _M_w(0)
+ { }
+
+ _Base_bitset(unsigned long __val)
+ : _M_w(__val)
+ { }
+
+ static size_t
+ _S_whichword(size_t __pos )
+ { return __pos / _GLIBCXX_BITSET_BITS_PER_WORD; }
+
+ static size_t
+ _S_whichbyte(size_t __pos )
+ { return (__pos % _GLIBCXX_BITSET_BITS_PER_WORD) / __CHAR_BIT__; }
+
+ static size_t
+ _S_whichbit(size_t __pos )
+ { return __pos % _GLIBCXX_BITSET_BITS_PER_WORD; }
+
+ static _WordT
+ _S_maskbit(size_t __pos )
+ { return (static_cast<_WordT>(1)) << _S_whichbit(__pos); }
+
+ _WordT&
+ _M_getword(size_t)
+ { return _M_w; }
+
+ _WordT
+ _M_getword(size_t) const
+ { return _M_w; }
+
+ _WordT&
+ _M_hiword()
+ { return _M_w; }
+
+ _WordT
+ _M_hiword() const
+ { return _M_w; }
+
+ void
+ _M_do_and(const _Base_bitset<1>& __x)
+ { _M_w &= __x._M_w; }
+
+ void
+ _M_do_or(const _Base_bitset<1>& __x)
+ { _M_w |= __x._M_w; }
+
+ void
+ _M_do_xor(const _Base_bitset<1>& __x)
+ { _M_w ^= __x._M_w; }
+
+ void
+ _M_do_left_shift(size_t __shift)
+ { _M_w <<= __shift; }
+
+ void
+ _M_do_right_shift(size_t __shift)
+ { _M_w >>= __shift; }
+
+ void
+ _M_do_flip()
+ { _M_w = ~_M_w; }
+
+ void
+ _M_do_set()
+ { _M_w = ~static_cast<_WordT>(0); }
+
+ void
+ _M_do_reset()
+ { _M_w = 0; }
+
+ bool
+ _M_is_equal(const _Base_bitset<1>& __x) const
+ { return _M_w == __x._M_w; }
+
+ size_t
+ _M_are_all_aux() const
+ { return __builtin_popcountl(_M_w); }
+
+ bool
+ _M_is_any() const
+ { return _M_w != 0; }
+
+ size_t
+ _M_do_count() const
+ { return __builtin_popcountl(_M_w); }
+
+ unsigned long
+ _M_do_to_ulong() const
+ { return _M_w; }
+
+ size_t
+ _M_do_find_first(size_t __not_found) const
+ {
+ if (_M_w != 0)
+ return __builtin_ctzl(_M_w);
+ else
+ return __not_found;
+ }
+
+ // find the next "on" bit that follows "prev"
+ size_t
+ _M_do_find_next(size_t __prev, size_t __not_found) const
+ {
+ ++__prev;
+ if (__prev >= ((size_t) _GLIBCXX_BITSET_BITS_PER_WORD))
+ return __not_found;
+
+ _WordT __x = _M_w >> __prev;
+ if (__x != 0)
+ return __builtin_ctzl(__x) + __prev;
+ else
+ return __not_found;
+ }
+ };
+
+ /**
+ * Base class, specialization for no storage (zero-length %bitset).
+ *
+ * See documentation for bitset.
+ */
+ template<>
+ struct _Base_bitset<0>
+ {
+ typedef unsigned long _WordT;
+
+ _Base_bitset()
+ { }
+
+ _Base_bitset(unsigned long)
+ { }
+
+ static size_t
+ _S_whichword(size_t __pos )
+ { return __pos / _GLIBCXX_BITSET_BITS_PER_WORD; }
+
+ static size_t
+ _S_whichbyte(size_t __pos )
+ { return (__pos % _GLIBCXX_BITSET_BITS_PER_WORD) / __CHAR_BIT__; }
+
+ static size_t
+ _S_whichbit(size_t __pos )
+ { return __pos % _GLIBCXX_BITSET_BITS_PER_WORD; }
+
+ static _WordT
+ _S_maskbit(size_t __pos )
+ { return (static_cast<_WordT>(1)) << _S_whichbit(__pos); }
+
+ // This would normally give access to the data. The bounds-checking
+ // in the bitset class will prevent the user from getting this far,
+ // but (1) it must still return an lvalue to compile, and (2) the
+ // user might call _Unchecked_set directly, in which case this /needs/
+ // to fail. Let's not penalize zero-length users unless they actually
+ // make an unchecked call; all the memory ugliness is therefore
+ // localized to this single should-never-get-this-far function.
+ _WordT&
+ _M_getword(size_t) const
+ {
+ __throw_out_of_range(__N("_Base_bitset::_M_getword"));
+ return *new _WordT;
+ }
+
+ _WordT
+ _M_hiword() const
+ { return 0; }
+
+ void
+ _M_do_and(const _Base_bitset<0>&)
+ { }
+
+ void
+ _M_do_or(const _Base_bitset<0>&)
+ { }
+
+ void
+ _M_do_xor(const _Base_bitset<0>&)
+ { }
+
+ void
+ _M_do_left_shift(size_t)
+ { }
+
+ void
+ _M_do_right_shift(size_t)
+ { }
+
+ void
+ _M_do_flip()
+ { }
+
+ void
+ _M_do_set()
+ { }
+
+ void
+ _M_do_reset()
+ { }
+
+ // Are all empty bitsets equal to each other? Are they equal to
+ // themselves? How to compare a thing which has no state? What is
+ // the sound of one zero-length bitset clapping?
+ bool
+ _M_is_equal(const _Base_bitset<0>&) const
+ { return true; }
+
+ size_t
+ _M_are_all_aux() const
+ { return 0; }
+
+ bool
+ _M_is_any() const
+ { return false; }
+
+ size_t
+ _M_do_count() const
+ { return 0; }
+
+ unsigned long
+ _M_do_to_ulong() const
+ { return 0; }
+
+ // Normally "not found" is the size, but that could also be
+ // misinterpreted as an index in this corner case. Oh well.
+ size_t
+ _M_do_find_first(size_t) const
+ { return 0; }
+
+ size_t
+ _M_do_find_next(size_t, size_t) const
+ { return 0; }
+ };
+
+
+ // Helper class to zero out the unused high-order bits in the highest word.
+ template<size_t _Extrabits>
+ struct _Sanitize
+ {
+ static void _S_do_sanitize(unsigned long& __val)
+ { __val &= ~((~static_cast<unsigned long>(0)) << _Extrabits); }
+ };
+
+ template<>
+ struct _Sanitize<0>
+ { static void _S_do_sanitize(unsigned long) {} };
+
+ /**
+ * @brief The %bitset class represents a @e fixed-size sequence of bits.
+ *
+ * @ingroup containers
+ *
+ * (Note that %bitset does @e not meet the formal requirements of a
+ * <a href="tables.html#65">container</a>. Mainly, it lacks iterators.)
+ *
+ * The template argument, @a Nb, may be any non-negative number,
+ * specifying the number of bits (e.g., "0", "12", "1024*1024").
+ *
+ * In the general unoptimized case, storage is allocated in word-sized
+ * blocks. Let B be the number of bits in a word, then (Nb+(B-1))/B
+ * words will be used for storage. B - Nb%B bits are unused. (They are
+ * the high-order bits in the highest word.) It is a class invariant
+ * that those unused bits are always zero.
+ *
+ * If you think of %bitset as "a simple array of bits," be aware that
+ * your mental picture is reversed: a %bitset behaves the same way as
+ * bits in integers do, with the bit at index 0 in the "least significant
+ * / right-hand" position, and the bit at index Nb-1 in the "most
+ * significant / left-hand" position. Thus, unlike other containers, a
+ * %bitset's index "counts from right to left," to put it very loosely.
+ *
+ * This behavior is preserved when translating to and from strings. For
+ * example, the first line of the following program probably prints
+ * "b('a') is 0001100001" on a modern ASCII system.
+ *
+ * @code
+ * #include <bitset>
+ * #include <iostream>
+ * #include <sstream>
+ *
+ * using namespace std;
+ *
+ * int main()
+ * {
+ * long a = 'a';
+ * bitset<10> b(a);
+ *
+ * cout << "b('a') is " << b << endl;
+ *
+ * ostringstream s;
+ * s << b;
+ * string str = s.str();
+ * cout << "index 3 in the string is " << str[3] << " but\n"
+ * << "index 3 in the bitset is " << b[3] << endl;
+ * }
+ * @endcode
+ *
+ * Also see:
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt12ch33s02.html
+ * for a description of extensions.
+ *
+ * Most of the actual code isn't contained in %bitset<> itself, but in the
+ * base class _Base_bitset. The base class works with whole words, not with
+ * individual bits. This allows us to specialize _Base_bitset for the
+ * important special case where the %bitset is only a single word.
+ *
+ * Extra confusion can result due to the fact that the storage for
+ * _Base_bitset @e is a regular array, and is indexed as such. This is
+ * carefully encapsulated.
+ */
+ template<size_t _Nb>
+ class bitset
+ : private _Base_bitset<_GLIBCXX_BITSET_WORDS(_Nb)>
+ {
+ private:
+ typedef _Base_bitset<_GLIBCXX_BITSET_WORDS(_Nb)> _Base;
+ typedef unsigned long _WordT;
+
+ void
+ _M_do_sanitize()
+ {
+ _Sanitize<_Nb % _GLIBCXX_BITSET_BITS_PER_WORD>::
+ _S_do_sanitize(this->_M_hiword());
+ }
+
+ public:
+ /**
+ * This encapsulates the concept of a single bit. An instance of this
+ * class is a proxy for an actual bit; this way the individual bit
+ * operations are done as faster word-size bitwise instructions.
+ *
+ * Most users will never need to use this class directly; conversions
+ * to and from bool are automatic and should be transparent. Overloaded
+ * operators help to preserve the illusion.
+ *
+ * (On a typical system, this "bit %reference" is 64 times the size of
+ * an actual bit. Ha.)
+ */
+ class reference
+ {
+ friend class bitset;
+
+ _WordT *_M_wp;
+ size_t _M_bpos;
+
+ // left undefined
+ reference();
+
+ public:
+ reference(bitset& __b, size_t __pos)
+ {
+ _M_wp = &__b._M_getword(__pos);
+ _M_bpos = _Base::_S_whichbit(__pos);
+ }
+
+ ~reference()
+ { }
+
+ // For b[i] = __x;
+ reference&
+ operator=(bool __x)
+ {
+ if (__x)
+ *_M_wp |= _Base::_S_maskbit(_M_bpos);
+ else
+ *_M_wp &= ~_Base::_S_maskbit(_M_bpos);
+ return *this;
+ }
+
+ // For b[i] = b[__j];
+ reference&
+ operator=(const reference& __j)
+ {
+ if ((*(__j._M_wp) & _Base::_S_maskbit(__j._M_bpos)))
+ *_M_wp |= _Base::_S_maskbit(_M_bpos);
+ else
+ *_M_wp &= ~_Base::_S_maskbit(_M_bpos);
+ return *this;
+ }
+
+ // Flips the bit
+ bool
+ operator~() const
+ { return (*(_M_wp) & _Base::_S_maskbit(_M_bpos)) == 0; }
+
+ // For __x = b[i];
+ operator bool() const
+ { return (*(_M_wp) & _Base::_S_maskbit(_M_bpos)) != 0; }
+
+ // For b[i].flip();
+ reference&
+ flip()
+ {
+ *_M_wp ^= _Base::_S_maskbit(_M_bpos);
+ return *this;
+ }
+ };
+ friend class reference;
+
+ // 23.3.5.1 constructors:
+ /// All bits set to zero.
+ bitset()
+ { }
+
+ /// Initial bits bitwise-copied from a single word (others set to zero).
+ bitset(unsigned long __val)
+ : _Base(__val)
+ { _M_do_sanitize(); }
+
+ /**
+ * @brief Use a subset of a string.
+ * @param s A string of '0' and '1' characters.
+ * @param position Index of the first character in @a s to use;
+ * defaults to zero.
+ * @throw std::out_of_range If @a pos is bigger the size of @a s.
+ * @throw std::invalid_argument If a character appears in the string
+ * which is neither '0' nor '1'.
+ */
+ template<class _CharT, class _Traits, class _Alloc>
+ explicit
+ bitset(const std::basic_string<_CharT, _Traits, _Alloc>& __s,
+ size_t __position = 0)
+ : _Base()
+ {
+ if (__position > __s.size())
+ __throw_out_of_range(__N("bitset::bitset initial position "
+ "not valid"));
+ _M_copy_from_string(__s, __position,
+ std::basic_string<_CharT, _Traits, _Alloc>::npos,
+ _CharT('0'), _CharT('1'));
+ }
+
+ /**
+ * @brief Use a subset of a string.
+ * @param s A string of '0' and '1' characters.
+ * @param position Index of the first character in @a s to use.
+ * @param n The number of characters to copy.
+ * @throw std::out_of_range If @a pos is bigger the size of @a s.
+ * @throw std::invalid_argument If a character appears in the string
+ * which is neither '0' nor '1'.
+ */
+ template<class _CharT, class _Traits, class _Alloc>
+ bitset(const std::basic_string<_CharT, _Traits, _Alloc>& __s,
+ size_t __position, size_t __n)
+ : _Base()
+ {
+ if (__position > __s.size())
+ __throw_out_of_range(__N("bitset::bitset initial position "
+ "not valid"));
+ _M_copy_from_string(__s, __position, __n, _CharT('0'), _CharT('1'));
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 396. what are characters zero and one.
+ template<class _CharT, class _Traits, class _Alloc>
+ bitset(const std::basic_string<_CharT, _Traits, _Alloc>& __s,
+ size_t __position, size_t __n,
+ _CharT __zero, _CharT __one = _CharT('1'))
+ : _Base()
+ {
+ if (__position > __s.size())
+ __throw_out_of_range(__N("bitset::bitset initial position "
+ "not valid"));
+ _M_copy_from_string(__s, __position, __n, __zero, __one);
+ }
+
+ // 23.3.5.2 bitset operations:
+ //@{
+ /**
+ * @brief Operations on bitsets.
+ * @param rhs A same-sized bitset.
+ *
+ * These should be self-explanatory.
+ */
+ bitset<_Nb>&
+ operator&=(const bitset<_Nb>& __rhs)
+ {
+ this->_M_do_and(__rhs);
+ return *this;
+ }
+
+ bitset<_Nb>&
+ operator|=(const bitset<_Nb>& __rhs)
+ {
+ this->_M_do_or(__rhs);
+ return *this;
+ }
+
+ bitset<_Nb>&
+ operator^=(const bitset<_Nb>& __rhs)
+ {
+ this->_M_do_xor(__rhs);
+ return *this;
+ }
+ //@}
+
+ //@{
+ /**
+ * @brief Operations on bitsets.
+ * @param position The number of places to shift.
+ *
+ * These should be self-explanatory.
+ */
+ bitset<_Nb>&
+ operator<<=(size_t __position)
+ {
+ if (__builtin_expect(__position < _Nb, 1))
+ {
+ this->_M_do_left_shift(__position);
+ this->_M_do_sanitize();
+ }
+ else
+ this->_M_do_reset();
+ return *this;
+ }
+
+ bitset<_Nb>&
+ operator>>=(size_t __position)
+ {
+ if (__builtin_expect(__position < _Nb, 1))
+ {
+ this->_M_do_right_shift(__position);
+ this->_M_do_sanitize();
+ }
+ else
+ this->_M_do_reset();
+ return *this;
+ }
+ //@}
+
+ //@{
+ /**
+ * These versions of single-bit set, reset, flip, and test are
+ * extensions from the SGI version. They do no range checking.
+ * @ingroup SGIextensions
+ */
+ bitset<_Nb>&
+ _Unchecked_set(size_t __pos)
+ {
+ this->_M_getword(__pos) |= _Base::_S_maskbit(__pos);
+ return *this;
+ }
+
+ bitset<_Nb>&
+ _Unchecked_set(size_t __pos, int __val)
+ {
+ if (__val)
+ this->_M_getword(__pos) |= _Base::_S_maskbit(__pos);
+ else
+ this->_M_getword(__pos) &= ~_Base::_S_maskbit(__pos);
+ return *this;
+ }
+
+ bitset<_Nb>&
+ _Unchecked_reset(size_t __pos)
+ {
+ this->_M_getword(__pos) &= ~_Base::_S_maskbit(__pos);
+ return *this;
+ }
+
+ bitset<_Nb>&
+ _Unchecked_flip(size_t __pos)
+ {
+ this->_M_getword(__pos) ^= _Base::_S_maskbit(__pos);
+ return *this;
+ }
+
+ bool
+ _Unchecked_test(size_t __pos) const
+ { return ((this->_M_getword(__pos) & _Base::_S_maskbit(__pos))
+ != static_cast<_WordT>(0)); }
+ //@}
+
+ // Set, reset, and flip.
+ /**
+ * @brief Sets every bit to true.
+ */
+ bitset<_Nb>&
+ set()
+ {
+ this->_M_do_set();
+ this->_M_do_sanitize();
+ return *this;
+ }
+
+ /**
+ * @brief Sets a given bit to a particular value.
+ * @param position The index of the bit.
+ * @param val Either true or false, defaults to true.
+ * @throw std::out_of_range If @a pos is bigger the size of the %set.
+ */
+ bitset<_Nb>&
+ set(size_t __position, bool __val = true)
+ {
+ if (__position >= _Nb)
+ __throw_out_of_range(__N("bitset::set"));
+ return _Unchecked_set(__position, __val);
+ }
+
+ /**
+ * @brief Sets every bit to false.
+ */
+ bitset<_Nb>&
+ reset()
+ {
+ this->_M_do_reset();
+ return *this;
+ }
+
+ /**
+ * @brief Sets a given bit to false.
+ * @param position The index of the bit.
+ * @throw std::out_of_range If @a pos is bigger the size of the %set.
+ *
+ * Same as writing @c set(pos,false).
+ */
+ bitset<_Nb>&
+ reset(size_t __position)
+ {
+ if (__position >= _Nb)
+ __throw_out_of_range(__N("bitset::reset"));
+ return _Unchecked_reset(__position);
+ }
+
+ /**
+ * @brief Toggles every bit to its opposite value.
+ */
+ bitset<_Nb>&
+ flip()
+ {
+ this->_M_do_flip();
+ this->_M_do_sanitize();
+ return *this;
+ }
+
+ /**
+ * @brief Toggles a given bit to its opposite value.
+ * @param position The index of the bit.
+ * @throw std::out_of_range If @a pos is bigger the size of the %set.
+ */
+ bitset<_Nb>&
+ flip(size_t __position)
+ {
+ if (__position >= _Nb)
+ __throw_out_of_range(__N("bitset::flip"));
+ return _Unchecked_flip(__position);
+ }
+
+ /// See the no-argument flip().
+ bitset<_Nb>
+ operator~() const
+ { return bitset<_Nb>(*this).flip(); }
+
+ //@{
+ /**
+ * @brief Array-indexing support.
+ * @param position Index into the %bitset.
+ * @return A bool for a 'const %bitset'. For non-const bitsets, an
+ * instance of the reference proxy class.
+ * @note These operators do no range checking and throw no exceptions,
+ * as required by DR 11 to the standard.
+ *
+ * _GLIBCXX_RESOLVE_LIB_DEFECTS Note that this implementation already
+ * resolves DR 11 (items 1 and 2), but does not do the range-checking
+ * required by that DR's resolution. -pme
+ * The DR has since been changed: range-checking is a precondition
+ * (users' responsibility), and these functions must not throw. -pme
+ */
+ reference
+ operator[](size_t __position)
+ { return reference(*this,__position); }
+
+ bool
+ operator[](size_t __position) const
+ { return _Unchecked_test(__position); }
+ //@}
+
+ /**
+ * @brief Returns a numerical interpretation of the %bitset.
+ * @return The integral equivalent of the bits.
+ * @throw std::overflow_error If there are too many bits to be
+ * represented in an @c unsigned @c long.
+ */
+ unsigned long
+ to_ulong() const
+ { return this->_M_do_to_ulong(); }
+
+ /**
+ * @brief Returns a character interpretation of the %bitset.
+ * @return The string equivalent of the bits.
+ *
+ * Note the ordering of the bits: decreasing character positions
+ * correspond to increasing bit positions (see the main class notes for
+ * an example).
+ */
+ template<class _CharT, class _Traits, class _Alloc>
+ std::basic_string<_CharT, _Traits, _Alloc>
+ to_string() const
+ {
+ std::basic_string<_CharT, _Traits, _Alloc> __result;
+ _M_copy_to_string(__result, _CharT('0'), _CharT('1'));
+ return __result;
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 396. what are characters zero and one.
+ template<class _CharT, class _Traits, class _Alloc>
+ std::basic_string<_CharT, _Traits, _Alloc>
+ to_string(_CharT __zero, _CharT __one = _CharT('1')) const
+ {
+ std::basic_string<_CharT, _Traits, _Alloc> __result;
+ _M_copy_to_string(__result, __zero, __one);
+ return __result;
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 434. bitset::to_string() hard to use.
+ template<class _CharT, class _Traits>
+ std::basic_string<_CharT, _Traits, std::allocator<_CharT> >
+ to_string() const
+ { return to_string<_CharT, _Traits, std::allocator<_CharT> >(); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 853. to_string needs updating with zero and one.
+ template<class _CharT, class _Traits>
+ std::basic_string<_CharT, _Traits, std::allocator<_CharT> >
+ to_string(_CharT __zero, _CharT __one = _CharT('1')) const
+ { return to_string<_CharT, _Traits,
+ std::allocator<_CharT> >(__zero, __one); }
+
+ template<class _CharT>
+ std::basic_string<_CharT, std::char_traits<_CharT>,
+ std::allocator<_CharT> >
+ to_string() const
+ {
+ return to_string<_CharT, std::char_traits<_CharT>,
+ std::allocator<_CharT> >();
+ }
+
+ template<class _CharT>
+ std::basic_string<_CharT, std::char_traits<_CharT>,
+ std::allocator<_CharT> >
+ to_string(_CharT __zero, _CharT __one = _CharT('1')) const
+ {
+ return to_string<_CharT, std::char_traits<_CharT>,
+ std::allocator<_CharT> >(__zero, __one);
+ }
+
+ std::basic_string<char, std::char_traits<char>, std::allocator<char> >
+ to_string() const
+ {
+ return to_string<char, std::char_traits<char>,
+ std::allocator<char> >();
+ }
+
+ std::basic_string<char, std::char_traits<char>, std::allocator<char> >
+ to_string(char __zero, char __one = '1') const
+ {
+ return to_string<char, std::char_traits<char>,
+ std::allocator<char> >(__zero, __one);
+ }
+
+ // Helper functions for string operations.
+ template<class _CharT, class _Traits>
+ void
+ _M_copy_from_ptr(const _CharT*, size_t, size_t, size_t,
+ _CharT, _CharT);
+
+ template<class _CharT, class _Traits, class _Alloc>
+ void
+ _M_copy_from_string(const std::basic_string<_CharT,
+ _Traits, _Alloc>& __s, size_t __pos, size_t __n,
+ _CharT __zero, _CharT __one)
+ { _M_copy_from_ptr<_CharT, _Traits>(__s.data(), __s.size(), __pos, __n,
+ __zero, __one); }
+
+ template<class _CharT, class _Traits, class _Alloc>
+ void
+ _M_copy_to_string(std::basic_string<_CharT, _Traits, _Alloc>&,
+ _CharT, _CharT) const;
+
+ // NB: Backward compat.
+ template<class _CharT, class _Traits, class _Alloc>
+ void
+ _M_copy_from_string(const std::basic_string<_CharT,
+ _Traits, _Alloc>& __s, size_t __pos, size_t __n)
+ { _M_copy_from_string(__s, __pos, __n, _CharT('0'), _CharT('1')); }
+
+ template<class _CharT, class _Traits, class _Alloc>
+ void
+ _M_copy_to_string(std::basic_string<_CharT, _Traits,_Alloc>& __s) const
+ { _M_copy_to_string(__s, _CharT('0'), _CharT('1')); }
+
+ /// Returns the number of bits which are set.
+ size_t
+ count() const
+ { return this->_M_do_count(); }
+
+ /// Returns the total number of bits.
+ size_t
+ size() const
+ { return _Nb; }
+
+ //@{
+ /// These comparisons for equality/inequality are, well, @e bitwise.
+ bool
+ operator==(const bitset<_Nb>& __rhs) const
+ { return this->_M_is_equal(__rhs); }
+
+ bool
+ operator!=(const bitset<_Nb>& __rhs) const
+ { return !this->_M_is_equal(__rhs); }
+ //@}
+
+ /**
+ * @brief Tests the value of a bit.
+ * @param position The index of a bit.
+ * @return The value at @a pos.
+ * @throw std::out_of_range If @a pos is bigger the size of the %set.
+ */
+ bool
+ test(size_t __position) const
+ {
+ if (__position >= _Nb)
+ __throw_out_of_range(__N("bitset::test"));
+ return _Unchecked_test(__position);
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 693. std::bitset::all() missing.
+ /**
+ * @brief Tests whether all the bits are on.
+ * @return True if all the bits are set.
+ */
+ bool
+ all() const
+ { return this->_M_are_all_aux() == _Nb; }
+
+ /**
+ * @brief Tests whether any of the bits are on.
+ * @return True if at least one bit is set.
+ */
+ bool
+ any() const
+ { return this->_M_is_any(); }
+
+ /**
+ * @brief Tests whether any of the bits are on.
+ * @return True if none of the bits are set.
+ */
+ bool
+ none() const
+ { return !this->_M_is_any(); }
+
+ //@{
+ /// Self-explanatory.
+ bitset<_Nb>
+ operator<<(size_t __position) const
+ { return bitset<_Nb>(*this) <<= __position; }
+
+ bitset<_Nb>
+ operator>>(size_t __position) const
+ { return bitset<_Nb>(*this) >>= __position; }
+ //@}
+
+ /**
+ * @brief Finds the index of the first "on" bit.
+ * @return The index of the first bit set, or size() if not found.
+ * @ingroup SGIextensions
+ * @sa _Find_next
+ */
+ size_t
+ _Find_first() const
+ { return this->_M_do_find_first(_Nb); }
+
+ /**
+ * @brief Finds the index of the next "on" bit after prev.
+ * @return The index of the next bit set, or size() if not found.
+ * @param prev Where to start searching.
+ * @ingroup SGIextensions
+ * @sa _Find_first
+ */
+ size_t
+ _Find_next(size_t __prev ) const
+ { return this->_M_do_find_next(__prev, _Nb); }
+ };
+
+ // Definitions of non-inline member functions.
+ template<size_t _Nb>
+ template<class _CharT, class _Traits>
+ void
+ bitset<_Nb>::
+ _M_copy_from_ptr(const _CharT* __s, size_t __len,
+ size_t __pos, size_t __n, _CharT __zero, _CharT __one)
+ {
+ reset();
+ const size_t __nbits = std::min(_Nb, std::min(__n, __len - __pos));
+ for (size_t __i = __nbits; __i > 0; --__i)
+ {
+ const _CharT __c = __s[__pos + __nbits - __i];
+ if (_Traits::eq(__c, __zero))
+ ;
+ else if (_Traits::eq(__c, __one))
+ _Unchecked_set(__i - 1);
+ else
+ __throw_invalid_argument(__N("bitset::_M_copy_from_ptr"));
+ }
+ }
+
+ template<size_t _Nb>
+ template<class _CharT, class _Traits, class _Alloc>
+ void
+ bitset<_Nb>::
+ _M_copy_to_string(std::basic_string<_CharT, _Traits, _Alloc>& __s,
+ _CharT __zero, _CharT __one) const
+ {
+ __s.assign(_Nb, __zero);
+ for (size_t __i = _Nb; __i > 0; --__i)
+ if (_Unchecked_test(__i - 1))
+ _Traits::assign(__s[_Nb - __i], __one);
+ }
+
+ // 23.3.5.3 bitset operations:
+ //@{
+ /**
+ * @brief Global bitwise operations on bitsets.
+ * @param x A bitset.
+ * @param y A bitset of the same size as @a x.
+ * @return A new bitset.
+ *
+ * These should be self-explanatory.
+ */
+ template<size_t _Nb>
+ inline bitset<_Nb>
+ operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y)
+ {
+ bitset<_Nb> __result(__x);
+ __result &= __y;
+ return __result;
+ }
+
+ template<size_t _Nb>
+ inline bitset<_Nb>
+ operator|(const bitset<_Nb>& __x, const bitset<_Nb>& __y)
+ {
+ bitset<_Nb> __result(__x);
+ __result |= __y;
+ return __result;
+ }
+
+ template <size_t _Nb>
+ inline bitset<_Nb>
+ operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y)
+ {
+ bitset<_Nb> __result(__x);
+ __result ^= __y;
+ return __result;
+ }
+ //@}
+
+ //@{
+ /**
+ * @brief Global I/O operators for bitsets.
+ *
+ * Direct I/O between streams and bitsets is supported. Output is
+ * straightforward. Input will skip whitespace, only accept '0' and '1'
+ * characters, and will only extract as many digits as the %bitset will
+ * hold.
+ */
+ template<class _CharT, class _Traits, size_t _Nb>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
+ {
+ typedef typename _Traits::char_type char_type;
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ std::basic_string<_CharT, _Traits> __tmp;
+ __tmp.reserve(_Nb);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 303. Bitset input operator underspecified
+ const char_type __zero = __is.widen('0');
+ const char_type __one = __is.widen('1');
+
+ typename __ios_base::iostate __state = __ios_base::goodbit;
+ typename __istream_type::sentry __sentry(__is);
+ if (__sentry)
+ {
+ __try
+ {
+ for (size_t __i = _Nb; __i > 0; --__i)
+ {
+ static typename _Traits::int_type __eof = _Traits::eof();
+
+ typename _Traits::int_type __c1 = __is.rdbuf()->sbumpc();
+ if (_Traits::eq_int_type(__c1, __eof))
+ {
+ __state |= __ios_base::eofbit;
+ break;
+ }
+ else
+ {
+ const char_type __c2 = _Traits::to_char_type(__c1);
+ if (_Traits::eq(__c2, __zero))
+ __tmp.push_back(__zero);
+ else if (_Traits::eq(__c2, __one))
+ __tmp.push_back(__one);
+ else if (_Traits::
+ eq_int_type(__is.rdbuf()->sputbackc(__c2),
+ __eof))
+ {
+ __state |= __ios_base::failbit;
+ break;
+ }
+ }
+ }
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ __is._M_setstate(__ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { __is._M_setstate(__ios_base::badbit); }
+ }
+
+ if (__tmp.empty() && _Nb)
+ __state |= __ios_base::failbit;
+ else
+ __x._M_copy_from_string(__tmp, static_cast<size_t>(0), _Nb,
+ __zero, __one);
+ if (__state)
+ __is.setstate(__state);
+ return __is;
+ }
+
+ template <class _CharT, class _Traits, size_t _Nb>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const bitset<_Nb>& __x)
+ {
+ std::basic_string<_CharT, _Traits> __tmp;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 396. what are characters zero and one.
+ const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__os.getloc());
+ __x._M_copy_to_string(__tmp, __ct.widen('0'), __ct.widen('1'));
+ return __os << __tmp;
+ }
+ //@}
+
+_GLIBCXX_END_NESTED_NAMESPACE
+
+#undef _GLIBCXX_BITSET_WORDS
+#undef _GLIBCXX_BITSET_BITS_PER_WORD
+
+#ifdef _GLIBCXX_DEBUG
+# include <debug/bitset>
+#endif
+
+#endif /* _GLIBCXX_BITSET */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/c++0x_warning.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/c++0x_warning.h
new file mode 100644
index 0000000..b74f339
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/c++0x_warning.h
@@ -0,0 +1,36 @@
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/c++0x_warning.h
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _CXX0X_WARNING_H
+#define _CXX0X_WARNING_H 1
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+#error This file requires compiler and library support for the upcoming \
+ISO C++ standard, C++0x. This support is currently experimental, and must be \
+enabled with the -std=c++0x or -std=gnu++0x compiler options.
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cassert b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cassert
new file mode 100644
index 0000000..186de0f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cassert
@@ -0,0 +1,45 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file cassert
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c assert.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 19.2 Assertions
+//
+
+// No include guards on this header...
+
+#pragma GCC system_header
+
+#include <assert.h>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ccomplex b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ccomplex
new file mode 100644
index 0000000..e347e17
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ccomplex
@@ -0,0 +1,44 @@
+// <ccomplex> -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/ccomplex
+ * This is a Standard C++ Library header.
+ */
+
+#pragma GCC system_header
+
+#ifndef _GLIBCXX_CCOMPLEX
+#define _GLIBCXX_CCOMPLEX 1
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <complex>
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cctype b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cctype
new file mode 100644
index 0000000..44ef4d4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cctype
@@ -0,0 +1,101 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cctype
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c ctype.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: <ccytpe>
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <ctype.h>
+
+#ifndef _GLIBCXX_CCTYPE
+#define _GLIBCXX_CCTYPE 1
+
+// Get rid of those macros defined in <ctype.h> in lieu of real functions.
+#undef isalnum
+#undef isalpha
+#undef iscntrl
+#undef isdigit
+#undef isgraph
+#undef islower
+#undef isprint
+#undef ispunct
+#undef isspace
+#undef isupper
+#undef isxdigit
+#undef tolower
+#undef toupper
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::isalnum;
+ using ::isalpha;
+ using ::iscntrl;
+ using ::isdigit;
+ using ::isgraph;
+ using ::islower;
+ using ::isprint;
+ using ::ispunct;
+ using ::isspace;
+ using ::isupper;
+ using ::isxdigit;
+ using ::tolower;
+ using ::toupper;
+
+_GLIBCXX_END_NAMESPACE
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/cctype>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/cctype>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cerrno b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cerrno
new file mode 100644
index 0000000..3716429
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cerrno
@@ -0,0 +1,53 @@
+// The -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file cerrno
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c errno.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 19.3 Error numbers
+//
+
+#pragma GCC system_header
+
+#include <errno.h>
+
+#ifndef _GLIBCXX_CERRNO
+#define _GLIBCXX_CERRNO 1
+
+// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
+#ifndef errno
+#define errno errno
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cfenv b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cfenv
new file mode 100644
index 0000000..9b02c8c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cfenv
@@ -0,0 +1,61 @@
+// <cfenv> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cfenv
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_CFENV
+#define _GLIBCXX_CFENV 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <bits/c++config.h>
+#if _GLIBCXX_HAVE_FENV_H
+# include <fenv.h>
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/cfenv>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/cfenv>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+#endif // _GLIBCXX_CFENV
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cfloat b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cfloat
new file mode 100644
index 0000000..54eb778
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cfloat
@@ -0,0 +1,60 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cfloat
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c float.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 18.2.2 Implementation properties: C library
+//
+
+#pragma GCC system_header
+
+#include <float.h>
+
+#ifndef _GLIBCXX_CFLOAT
+#define _GLIBCXX_CFLOAT 1
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# ifndef DECIMAL_DIG
+# define DECIMAL_DIG __DECIMAL_DIG__
+# endif
+# ifndef FLT_EVAL_METHOD
+# define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
+# endif
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/chrono b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/chrono
new file mode 100644
index 0000000..aaa9646
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/chrono
@@ -0,0 +1,672 @@
+// <chrono> -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/chrono
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_CHRONO
+#define _GLIBCXX_CHRONO 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#ifdef _GLIBCXX_INCLUDE_AS_TR1
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <ratio>
+#include <type_traits>
+#include <limits>
+#include <ctime>
+
+#ifdef _GLIBCXX_USE_C99_STDINT_TR1
+
+namespace std
+{
+ /**
+ * @defgroup chrono Time
+ * @ingroup utilities
+ *
+ * Classes and functions for time.
+ * @{
+ */
+
+ /** @namespace std::chrono
+ * @brief ISO C++ 0x entities sub namespace for time and date.
+ */
+ namespace chrono
+ {
+ template<typename _Rep, typename _Period = ratio<1>>
+ struct duration;
+
+ template<typename _Clock, typename _Duration = typename _Clock::duration>
+ struct time_point;
+ }
+
+ // 20.8.2.3 specialization of common_type (for duration)
+ template<typename _Rep1, typename _Period1, typename _Rep2, typename _Period2>
+ struct common_type<chrono::duration<_Rep1, _Period1>,
+ chrono::duration<_Rep2, _Period2>>
+ {
+ typedef chrono::duration<typename common_type<_Rep1, _Rep2>::type,
+ ratio<__static_gcd<_Period1::num, _Period2::num>::value,
+ (_Period1::den / __static_gcd<_Period1::den, _Period2::den>::value)
+ * _Period2::den>> type;
+ };
+
+ // 20.8.2.3 specialization of common_type (for time_point)
+ template<typename _Clock, typename _Duration1, typename _Duration2>
+ struct common_type<chrono::time_point<_Clock, _Duration1>,
+ chrono::time_point<_Clock, _Duration2>>
+ {
+ typedef chrono::time_point<_Clock,
+ typename common_type<_Duration1, _Duration2>::type> type;
+ };
+
+ namespace chrono
+ {
+ // Primary template for duration_cast impl.
+ template<typename _ToDuration, typename _CF, typename _CR,
+ bool _NumIsOne = false, bool _DenIsOne = false>
+ struct __duration_cast_impl
+ {
+ template<typename _Rep, typename _Period>
+ static _ToDuration __cast(const duration<_Rep, _Period>& __d)
+ {
+ return _ToDuration(static_cast<
+ typename _ToDuration::rep>(static_cast<_CR>(__d.count())
+ * static_cast<_CR>(_CF::num)
+ / static_cast<_CR>(_CF::den)));
+ }
+ };
+
+ template<typename _ToDuration, typename _CF, typename _CR>
+ struct __duration_cast_impl<_ToDuration, _CF, _CR, true, true>
+ {
+ template<typename _Rep, typename _Period>
+ static _ToDuration __cast(const duration<_Rep, _Period>& __d)
+ {
+ return _ToDuration(
+ static_cast<typename _ToDuration::rep>(__d.count()));
+ }
+ };
+
+ template<typename _ToDuration, typename _CF, typename _CR>
+ struct __duration_cast_impl<_ToDuration, _CF, _CR, true, false>
+ {
+ template<typename _Rep, typename _Period>
+ static _ToDuration __cast(const duration<_Rep, _Period>& __d)
+ {
+ return _ToDuration(static_cast<typename _ToDuration::rep>(
+ static_cast<_CR>(__d.count()) / static_cast<_CR>(_CF::den)));
+ }
+ };
+
+ template<typename _ToDuration, typename _CF, typename _CR>
+ struct __duration_cast_impl<_ToDuration, _CF, _CR, false, true>
+ {
+ template<typename _Rep, typename _Period>
+ static _ToDuration __cast(const duration<_Rep, _Period>& __d)
+ {
+ return _ToDuration(static_cast<typename _ToDuration::rep>(
+ static_cast<_CR>(__d.count()) * static_cast<_CR>(_CF::num)));
+ }
+ };
+
+ /// duration_cast
+ template<typename _ToDuration, typename _Rep, typename _Period>
+ inline _ToDuration
+ duration_cast(const duration<_Rep, _Period>& __d)
+ {
+ typedef typename
+ ratio_divide<_Period, typename _ToDuration::period>::type __cf;
+ typedef typename
+ common_type<typename _ToDuration::rep, _Rep, intmax_t>::type __cr;
+
+ return __duration_cast_impl<_ToDuration, __cf, __cr,
+ __cf::num == 1, __cf::den == 1>::__cast(__d);
+ }
+
+ /// treat_as_floating_point
+ template<typename _Rep>
+ struct treat_as_floating_point
+ : is_floating_point<_Rep>
+ { };
+
+ /// duration_values
+ template<typename _Rep>
+ struct duration_values
+ {
+ static const _Rep
+ zero()
+ { return _Rep(0); }
+
+ static const _Rep
+ max()
+ { return numeric_limits<_Rep>::max(); }
+
+ static const _Rep
+ min()
+ { return numeric_limits<_Rep>::min(); }
+ };
+
+ template<typename _Tp>
+ struct __is_duration
+ : std::false_type
+ { };
+
+ template<typename _Rep, typename _Period>
+ struct __is_duration<duration<_Rep, _Period>>
+ : std::true_type
+ { };
+
+ template<typename T>
+ struct __is_ratio
+ : std::false_type
+ { };
+
+ template<intmax_t _Num, intmax_t _Den>
+ struct __is_ratio<ratio<_Num, _Den>>
+ : std::true_type
+ { };
+
+ /// duration
+ template<typename _Rep, typename _Period>
+ struct duration
+ {
+ static_assert(!__is_duration<_Rep>::value, "rep cannot be a duration");
+ static_assert(__is_ratio<_Period>::value,
+ "period must be a specialization of ratio");
+ static_assert(_Period::num > 0, "period must be positive");
+
+ typedef _Rep rep;
+ typedef _Period period;
+
+ // 20.8.3.1 construction / copy / destroy
+ duration() = default;
+
+ template<typename _Rep2>
+ explicit duration(_Rep2 const& __rep)
+ : __r(static_cast<rep>(__rep))
+ {
+ static_assert(is_convertible<_Rep2,rep>::value
+ && (treat_as_floating_point<rep>::value
+ || !treat_as_floating_point<_Rep2>::value),
+ "cannot construct integral duration with floating point type");
+ }
+
+ template<typename _Rep2, typename _Period2>
+ duration(const duration<_Rep2, _Period2>& __d)
+ : __r(duration_cast<duration>(__d).count())
+ {
+ static_assert(treat_as_floating_point<rep>::value == true
+ || ratio_divide<_Period2, period>::type::den == 1,
+ "the resulting duration is not exactly representable");
+ }
+
+ ~duration() = default;
+ duration(const duration&) = default;
+ duration& operator=(const duration&) = default;
+
+ // 20.8.3.2 observer
+ rep
+ count() const
+ { return __r; }
+
+ // 20.8.3.3 arithmetic
+ duration
+ operator+() const
+ { return *this; }
+
+ duration
+ operator-() const
+ { return duration(-__r); }
+
+ duration&
+ operator++()
+ {
+ ++__r;
+ return *this;
+ }
+
+ duration
+ operator++(int)
+ { return duration(__r++); }
+
+ duration&
+ operator--()
+ {
+ --__r;
+ return *this;
+ }
+
+ duration
+ operator--(int)
+ { return duration(__r--); }
+
+ duration&
+ operator+=(const duration& __d)
+ {
+ __r += __d.count();
+ return *this;
+ }
+
+ duration&
+ operator-=(const duration& __d)
+ {
+ __r -= __d.count();
+ return *this;
+ }
+
+ duration&
+ operator*=(const rep& __rhs)
+ {
+ __r *= __rhs;
+ return *this;
+ }
+
+ duration&
+ operator/=(const rep& __rhs)
+ {
+ __r /= __rhs;
+ return *this;
+ }
+
+ // 20.8.3.4 special values
+ // TODO: These should be constexprs.
+ static const duration
+ zero()
+ { return duration(duration_values<rep>::zero()); }
+
+ static const duration
+ min()
+ { return duration(duration_values<rep>::min()); }
+
+ static const duration
+ max()
+ { return duration(duration_values<rep>::max()); }
+
+ private:
+ rep __r;
+ };
+
+ template<typename _Rep1, typename _Period1,
+ typename _Rep2, typename _Period2>
+ inline typename common_type<duration<_Rep1, _Period1>,
+ duration<_Rep2, _Period2>>::type
+ operator+(const duration<_Rep1, _Period1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ {
+ typedef typename common_type<duration<_Rep1, _Period1>,
+ duration<_Rep2, _Period2>>::type __ct;
+ return __ct(__lhs) += __rhs;
+ }
+
+ template<typename _Rep1, typename _Period1,
+ typename _Rep2, typename _Period2>
+ inline typename common_type<duration<_Rep1, _Period1>,
+ duration<_Rep2, _Period2>>::type
+ operator-(const duration<_Rep1, _Period1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ {
+ typedef typename common_type<duration<_Rep1, _Period1>,
+ duration<_Rep2, _Period2>>::type __ct;
+ return __ct(__lhs) -= __rhs;
+ }
+
+ template<typename _Rep1, typename _Period, typename _Rep2>
+ inline duration<typename common_type<_Rep1, _Rep2>::type, _Period>
+ operator*(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
+ {
+ typedef typename common_type<_Rep1, _Rep2>::type __cr;
+ return duration<__cr, _Period>(__d) *= __s;
+ }
+
+ template<typename _Rep1, typename _Period, typename _Rep2>
+ inline duration<typename common_type<_Rep1, _Rep2>::type, _Period>
+ operator*(const _Rep2& __s, const duration<_Rep1, _Period>& __d)
+ { return __d * __s; }
+
+ template<typename _Tp, typename _Up, typename _Ep = void>
+ struct __division_impl;
+
+ template<typename _Rep1, typename _Period, typename _Rep2>
+ struct __division_impl<duration<_Rep1, _Period>, _Rep2,
+ typename enable_if<!__is_duration<_Rep2>::value>::type>
+ {
+ typedef typename common_type<_Rep1, _Rep2>::type __cr;
+ typedef
+ duration<typename common_type<_Rep1, _Rep2>::type, _Period> __rt;
+
+ static __rt
+ __divide(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
+ { return duration<__cr, _Period>(__d) /= __s; }
+ };
+
+ template<typename _Rep1, typename _Period1,
+ typename _Rep2, typename _Period2>
+ struct __division_impl<duration<_Rep1, _Period1>,
+ duration<_Rep2, _Period2>>
+ {
+ typedef typename common_type<duration<_Rep1, _Period1>,
+ duration<_Rep2, _Period2>>::type __ct;
+ typedef typename common_type<_Rep1, _Rep2>::type __rt;
+
+ static __rt
+ __divide(const duration<_Rep1, _Period1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ { return __ct(__lhs).count() / __ct(__rhs).count(); }
+ };
+
+ template<typename _Rep, typename _Period, typename _Up>
+ inline typename __division_impl<duration<_Rep, _Period>, _Up>::__rt
+ operator/(const duration<_Rep, _Period>& __d, const _Up& __u)
+ {
+ return
+ __division_impl<duration<_Rep, _Period>, _Up>::__divide(__d, __u);
+ }
+
+ // comparisons
+ template<typename _Rep1, typename _Period1,
+ typename _Rep2, typename _Period2>
+ inline bool
+ operator==(const duration<_Rep1, _Period1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ {
+ typedef typename common_type<duration<_Rep1, _Period1>,
+ duration<_Rep2, _Period2>>::type __ct;
+ return __ct(__lhs).count() == __ct(__rhs).count();
+ }
+
+ template<typename _Rep1, typename _Period1,
+ typename _Rep2, typename _Period2>
+ inline bool
+ operator<(const duration<_Rep1, _Period1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ {
+ typedef typename common_type<duration<_Rep1, _Period1>,
+ duration<_Rep2, _Period2>>::type __ct;
+ return __ct(__lhs).count() < __ct(__rhs).count();
+ }
+
+ template<typename _Rep1, typename _Period1,
+ typename _Rep2, typename _Period2>
+ inline bool
+ operator!=(const duration<_Rep1, _Period1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ { return !(__lhs == __rhs); }
+
+ template<typename _Rep1, typename _Period1,
+ typename _Rep2, typename _Period2>
+ inline bool
+ operator<=(const duration<_Rep1, _Period1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ { return !(__rhs < __lhs); }
+
+ template<typename _Rep1, typename _Period1,
+ typename _Rep2, typename _Period2>
+ inline bool
+ operator>(const duration<_Rep1, _Period1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ { return __rhs < __lhs; }
+
+ template<typename _Rep1, typename _Period1,
+ typename _Rep2, typename _Period2>
+ inline bool
+ operator>=(const duration<_Rep1, _Period1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ { return !(__lhs < __rhs); }
+
+ /// nanoseconds
+ typedef duration<int64_t, nano> nanoseconds;
+
+ /// microseconds
+ typedef duration<int64_t, micro> microseconds;
+
+ /// milliseconds
+ typedef duration<int64_t, milli> milliseconds;
+
+ /// seconds
+ typedef duration<int64_t > seconds;
+
+ /// minutes
+ typedef duration<int, ratio< 60>> minutes;
+
+ /// hours
+ typedef duration<int, ratio<3600>> hours;
+
+ /// time_point
+ template<typename _Clock, typename _Duration>
+ struct time_point
+ {
+ typedef _Clock clock;
+ typedef _Duration duration;
+ typedef typename duration::rep rep;
+ typedef typename duration::period period;
+
+ time_point() : __d(duration::zero())
+ { }
+
+ explicit time_point(const duration& __dur)
+ : __d(duration::zero() + __dur)
+ { }
+
+ // conversions
+ template<typename _Duration2>
+ time_point(const time_point<clock, _Duration2>& __t)
+ : __d(__t.time_since_epoch())
+ { }
+
+ // observer
+ duration
+ time_since_epoch() const
+ { return __d; }
+
+ // arithmetic
+ time_point&
+ operator+=(const duration& __dur)
+ {
+ __d += __dur;
+ return *this;
+ }
+
+ time_point&
+ operator-=(const duration& __dur)
+ {
+ __d -= __dur;
+ return *this;
+ }
+
+ // special values
+ // TODO: These should be constexprs.
+ static const time_point
+ min()
+ { return time_point(duration::min()); }
+
+ static const time_point
+ max()
+ { return time_point(duration::max()); }
+
+ private:
+ duration __d;
+ };
+
+ /// time_point_cast
+ template<typename _ToDuration, typename _Clock, typename _Duration>
+ inline time_point<_Clock, _ToDuration>
+ time_point_cast(const time_point<_Clock, _Duration>& __t)
+ {
+ return time_point<_Clock, _ToDuration>(
+ duration_cast<_ToDuration>(__t.time_since_epoch()));
+ }
+
+ template<typename _Clock, typename _Duration1,
+ typename _Rep2, typename _Period2>
+ inline time_point<_Clock,
+ typename common_type<_Duration1, duration<_Rep2, _Period2>>::type>
+ operator+(const time_point<_Clock, _Duration1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ {
+ typedef time_point<_Clock,
+ typename common_type<_Duration1,
+ duration<_Rep2, _Period2>>::type> __ct;
+ return __ct(__lhs) += __rhs;
+ }
+
+ template<typename _Rep1, typename _Period1,
+ typename _Clock, typename _Duration2>
+ inline time_point<_Clock,
+ typename common_type<duration<_Rep1, _Period1>, _Duration2>::type>
+ operator+(const duration<_Rep1, _Period1>& __lhs,
+ const time_point<_Clock, _Duration2>& __rhs)
+ { return __rhs + __lhs; }
+
+ template<typename _Clock, typename _Duration1,
+ typename _Rep2, typename _Period2>
+ inline time_point<_Clock,
+ typename common_type<_Duration1, duration<_Rep2, _Period2>>::type>
+ operator-(const time_point<_Clock, _Duration1>& __lhs,
+ const duration<_Rep2, _Period2>& __rhs)
+ { return __lhs + (-__rhs); }
+
+ template<typename _Clock, typename _Duration1, typename _Duration2>
+ inline typename common_type<_Duration1, _Duration2>::type
+ operator-(const time_point<_Clock, _Duration1>& __lhs,
+ const time_point<_Clock, _Duration2>& __rhs)
+ { return __lhs.time_since_epoch() - __rhs.time_since_epoch(); }
+
+ template<typename _Clock, typename _Duration1, typename _Duration2>
+ inline bool
+ operator==(const time_point<_Clock, _Duration1>& __lhs,
+ const time_point<_Clock, _Duration2>& __rhs)
+ { return __lhs.time_since_epoch() == __rhs.time_since_epoch(); }
+
+ template<typename _Clock, typename _Duration1, typename _Duration2>
+ inline bool
+ operator!=(const time_point<_Clock, _Duration1>& __lhs,
+ const time_point<_Clock, _Duration2>& __rhs)
+ { return !(__lhs == __rhs); }
+
+ template<typename _Clock, typename _Duration1, typename _Duration2>
+ inline bool
+ operator<(const time_point<_Clock, _Duration1>& __lhs,
+ const time_point<_Clock, _Duration2>& __rhs)
+ { return __lhs.time_since_epoch() < __rhs.time_since_epoch(); }
+
+ template<typename _Clock, typename _Duration1, typename _Duration2>
+ inline bool
+ operator<=(const time_point<_Clock, _Duration1>& __lhs,
+ const time_point<_Clock, _Duration2>& __rhs)
+ { return !(__rhs < __lhs); }
+
+ template<typename _Clock, typename _Duration1, typename _Duration2>
+ inline bool
+ operator>(const time_point<_Clock, _Duration1>& __lhs,
+ const time_point<_Clock, _Duration2>& __rhs)
+ { return __rhs < __lhs; }
+
+ template<typename _Clock, typename _Duration1, typename _Duration2>
+ inline bool
+ operator>=(const time_point<_Clock, _Duration1>& __lhs,
+ const time_point<_Clock, _Duration2>& __rhs)
+ { return !(__lhs < __rhs); }
+
+ /// system_clock
+ struct system_clock
+ {
+#ifdef _GLIBCXX_USE_CLOCK_REALTIME
+ typedef chrono::nanoseconds duration;
+#elif defined(_GLIBCXX_USE_GETTIMEOFDAY)
+ typedef chrono::microseconds duration;
+#else
+ typedef chrono::seconds duration;
+#endif
+
+ typedef duration::rep rep;
+ typedef duration::period period;
+ typedef chrono::time_point<system_clock, duration> time_point;
+
+ static const bool is_monotonic = false;
+
+ static time_point
+ now();
+
+ // Map to C API
+ static std::time_t
+ to_time_t(const time_point& __t)
+ {
+ return std::time_t(
+ duration_cast<chrono::seconds>(__t.time_since_epoch()).count());
+ }
+
+ static time_point
+ from_time_t(std::time_t __t)
+ {
+ return time_point_cast<system_clock::duration>(
+ chrono::time_point<system_clock, chrono::seconds>(
+ chrono::seconds(__t)));
+ }
+
+ // TODO: requires constexpr
+ /*
+ static_assert(
+ system_clock::duration::min() <
+ system_clock::duration::zero(),
+ "a clock's minimum duration cannot be less than its epoch");
+ */
+ };
+
+#ifdef _GLIBCXX_USE_CLOCK_MONOTONIC
+ /// monotonic_clock
+ struct monotonic_clock
+ {
+ typedef chrono::nanoseconds duration;
+ typedef duration::rep rep;
+ typedef duration::period period;
+ typedef chrono::time_point<monotonic_clock, duration> time_point;
+
+ static const bool is_monotonic = true;
+
+ static time_point
+ now();
+ };
+#else
+ typedef system_clock monotonic_clock;
+#endif
+
+ typedef system_clock high_resolution_clock;
+ } // namespace chrono
+
+ // @} group chrono
+} // namespace std
+
+#endif //_GLIBCXX_USE_C99_STDINT_TR1
+
+#endif //__GXX_EXPERIMENTAL_CXX0X__
+
+#endif //_GLIBCXX_CHRONO
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cinttypes b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cinttypes
new file mode 100644
index 0000000..5ed1a21
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cinttypes
@@ -0,0 +1,71 @@
+// <cinttypes> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cinttypes
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_CINTTYPES
+#define _GLIBCXX_CINTTYPES 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <cstdint>
+
+// For 8.11.1/1 (see C99, Note 184)
+#if _GLIBCXX_HAVE_INTTYPES_H
+# ifndef __STDC_FORMAT_MACROS
+# define _UNDEF__STDC_FORMAT_MACROS
+# define __STDC_FORMAT_MACROS
+# endif
+# include <inttypes.h>
+# ifdef _UNDEF__STDC_FORMAT_MACROS
+# undef __STDC_FORMAT_MACROS
+# undef _UNDEF__STDC_FORMAT_MACROS
+# endif
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/cinttypes>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/cinttypes>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+#endif // _GLIBCXX_CINTTYPES
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ciso646 b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ciso646
new file mode 100644
index 0000000..a3c3f9b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ciso646
@@ -0,0 +1,33 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ciso646
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c iso646.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/climits b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/climits
new file mode 100644
index 0000000..943d69e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/climits
@@ -0,0 +1,60 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/climits
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c limits.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 18.2.2 Implementation properties: C library
+//
+
+#pragma GCC system_header
+
+#include <limits.h>
+
+#ifndef _GLIBCXX_CLIMITS
+#define _GLIBCXX_CLIMITS 1
+
+#ifndef LLONG_MIN
+#define LLONG_MIN (-__LONG_LONG_MAX__ - 1)
+#endif
+
+#ifndef LLONG_MAX
+#define LLONG_MAX __LONG_LONG_MAX__
+#endif
+
+#ifndef ULLONG_MAX
+#define ULLONG_MAX (__LONG_LONG_MAX__ * 2ULL + 1)
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/clocale b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/clocale
new file mode 100644
index 0000000..eb955c9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/clocale
@@ -0,0 +1,61 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file clocale
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c locale.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 18.2.2 Implementation properties: C library
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <locale.h>
+
+#ifndef _GLIBCXX_CLOCALE
+#define _GLIBCXX_CLOCALE 1
+
+// Get rid of those macros defined in <locale.h> in lieu of real functions.
+#undef setlocale
+#undef localeconv
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::lconv;
+ using ::setlocale;
+ using ::localeconv;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cmath b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cmath
new file mode 100644
index 0000000..9a63a01
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cmath
@@ -0,0 +1,631 @@
+// -*- C++ -*- C forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cmath
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c math.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 26.5 C library
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/cpp_type_traits.h>
+#include <ext/type_traits.h>
+#include <math.h>
+
+#ifndef _GLIBCXX_CMATH
+#define _GLIBCXX_CMATH 1
+
+// Get rid of those macros defined in <math.h> in lieu of real functions.
+#undef abs
+#undef div
+#undef acos
+#undef asin
+#undef atan
+#undef atan2
+#undef ceil
+#undef cos
+#undef cosh
+#undef exp
+#undef fabs
+#undef floor
+#undef fmod
+#undef frexp
+#undef ldexp
+#undef log
+#undef log10
+#undef modf
+#undef pow
+#undef sin
+#undef sinh
+#undef sqrt
+#undef tan
+#undef tanh
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Forward declaration of a helper function. This really should be
+ // an `exported' forward declaration.
+ template<typename _Tp>
+ _Tp __cmath_power(_Tp, unsigned int);
+
+ template<typename _Tp>
+ inline _Tp
+ __pow_helper(_Tp __x, int __n)
+ {
+ return __n < 0
+ ? _Tp(1)/__cmath_power(__x, -__n)
+ : __cmath_power(__x, __n);
+ }
+
+ inline double
+ abs(double __x)
+ { return __builtin_fabs(__x); }
+
+ inline float
+ abs(float __x)
+ { return __builtin_fabsf(__x); }
+
+ inline long double
+ abs(long double __x)
+ { return __builtin_fabsl(__x); }
+
+ using ::acos;
+
+ inline float
+ acos(float __x)
+ { return __builtin_acosf(__x); }
+
+ inline long double
+ acos(long double __x)
+ { return __builtin_acosl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ acos(_Tp __x)
+ { return __builtin_acos(__x); }
+
+ using ::asin;
+
+ inline float
+ asin(float __x)
+ { return __builtin_asinf(__x); }
+
+ inline long double
+ asin(long double __x)
+ { return __builtin_asinl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ asin(_Tp __x)
+ { return __builtin_asin(__x); }
+
+ using ::atan;
+
+ inline float
+ atan(float __x)
+ { return __builtin_atanf(__x); }
+
+ inline long double
+ atan(long double __x)
+ { return __builtin_atanl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ atan(_Tp __x)
+ { return __builtin_atan(__x); }
+
+ using ::atan2;
+
+ inline float
+ atan2(float __y, float __x)
+ { return __builtin_atan2f(__y, __x); }
+
+ inline long double
+ atan2(long double __y, long double __x)
+ { return __builtin_atan2l(__y, __x); }
+
+ template<typename _Tp, typename _Up>
+ inline
+ typename __gnu_cxx::__promote_2<
+ typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
+ && __is_arithmetic<_Up>::__value,
+ _Tp>::__type, _Up>::__type
+ atan2(_Tp __y, _Up __x)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return atan2(__type(__y), __type(__x));
+ }
+
+ using ::ceil;
+
+ inline float
+ ceil(float __x)
+ { return __builtin_ceilf(__x); }
+
+ inline long double
+ ceil(long double __x)
+ { return __builtin_ceill(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ ceil(_Tp __x)
+ { return __builtin_ceil(__x); }
+
+ using ::cos;
+
+ inline float
+ cos(float __x)
+ { return __builtin_cosf(__x); }
+
+ inline long double
+ cos(long double __x)
+ { return __builtin_cosl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ cos(_Tp __x)
+ { return __builtin_cos(__x); }
+
+ using ::cosh;
+
+ inline float
+ cosh(float __x)
+ { return __builtin_coshf(__x); }
+
+ inline long double
+ cosh(long double __x)
+ { return __builtin_coshl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ cosh(_Tp __x)
+ { return __builtin_cosh(__x); }
+
+ using ::exp;
+
+ inline float
+ exp(float __x)
+ { return __builtin_expf(__x); }
+
+ inline long double
+ exp(long double __x)
+ { return __builtin_expl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ exp(_Tp __x)
+ { return __builtin_exp(__x); }
+
+ using ::fabs;
+
+ inline float
+ fabs(float __x)
+ { return __builtin_fabsf(__x); }
+
+ inline long double
+ fabs(long double __x)
+ { return __builtin_fabsl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ fabs(_Tp __x)
+ { return __builtin_fabs(__x); }
+
+ using ::floor;
+
+ inline float
+ floor(float __x)
+ { return __builtin_floorf(__x); }
+
+ inline long double
+ floor(long double __x)
+ { return __builtin_floorl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ floor(_Tp __x)
+ { return __builtin_floor(__x); }
+
+ using ::fmod;
+
+ inline float
+ fmod(float __x, float __y)
+ { return __builtin_fmodf(__x, __y); }
+
+ inline long double
+ fmod(long double __x, long double __y)
+ { return __builtin_fmodl(__x, __y); }
+
+ using ::frexp;
+
+ inline float
+ frexp(float __x, int* __exp)
+ { return __builtin_frexpf(__x, __exp); }
+
+ inline long double
+ frexp(long double __x, int* __exp)
+ { return __builtin_frexpl(__x, __exp); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ frexp(_Tp __x, int* __exp)
+ { return __builtin_frexp(__x, __exp); }
+
+ using ::ldexp;
+
+ inline float
+ ldexp(float __x, int __exp)
+ { return __builtin_ldexpf(__x, __exp); }
+
+ inline long double
+ ldexp(long double __x, int __exp)
+ { return __builtin_ldexpl(__x, __exp); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ ldexp(_Tp __x, int __exp)
+ { return __builtin_ldexp(__x, __exp); }
+
+ using ::log;
+
+ inline float
+ log(float __x)
+ { return __builtin_logf(__x); }
+
+ inline long double
+ log(long double __x)
+ { return __builtin_logl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ log(_Tp __x)
+ { return __builtin_log(__x); }
+
+ using ::log10;
+
+ inline float
+ log10(float __x)
+ { return __builtin_log10f(__x); }
+
+ inline long double
+ log10(long double __x)
+ { return __builtin_log10l(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ log10(_Tp __x)
+ { return __builtin_log10(__x); }
+
+ using ::modf;
+
+ inline float
+ modf(float __x, float* __iptr)
+ { return __builtin_modff(__x, __iptr); }
+
+ inline long double
+ modf(long double __x, long double* __iptr)
+ { return __builtin_modfl(__x, __iptr); }
+
+ using ::pow;
+
+ inline float
+ pow(float __x, float __y)
+ { return __builtin_powf(__x, __y); }
+
+ inline long double
+ pow(long double __x, long double __y)
+ { return __builtin_powl(__x, __y); }
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 550. What should the return type of pow(float,int) be?
+ inline double
+ pow(double __x, int __i)
+ { return __builtin_powi(__x, __i); }
+
+ inline float
+ pow(float __x, int __n)
+ { return __builtin_powif(__x, __n); }
+
+ inline long double
+ pow(long double __x, int __n)
+ { return __builtin_powil(__x, __n); }
+#endif
+
+ template<typename _Tp, typename _Up>
+ inline
+ typename __gnu_cxx::__promote_2<
+ typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
+ && __is_arithmetic<_Up>::__value,
+ _Tp>::__type, _Up>::__type
+ pow(_Tp __x, _Up __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return pow(__type(__x), __type(__y));
+ }
+
+ using ::sin;
+
+ inline float
+ sin(float __x)
+ { return __builtin_sinf(__x); }
+
+ inline long double
+ sin(long double __x)
+ { return __builtin_sinl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ sin(_Tp __x)
+ { return __builtin_sin(__x); }
+
+ using ::sinh;
+
+ inline float
+ sinh(float __x)
+ { return __builtin_sinhf(__x); }
+
+ inline long double
+ sinh(long double __x)
+ { return __builtin_sinhl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ sinh(_Tp __x)
+ { return __builtin_sinh(__x); }
+
+ using ::sqrt;
+
+ inline float
+ sqrt(float __x)
+ { return __builtin_sqrtf(__x); }
+
+ inline long double
+ sqrt(long double __x)
+ { return __builtin_sqrtl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ sqrt(_Tp __x)
+ { return __builtin_sqrt(__x); }
+
+ using ::tan;
+
+ inline float
+ tan(float __x)
+ { return __builtin_tanf(__x); }
+
+ inline long double
+ tan(long double __x)
+ { return __builtin_tanl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ tan(_Tp __x)
+ { return __builtin_tan(__x); }
+
+ using ::tanh;
+
+ inline float
+ tanh(float __x)
+ { return __builtin_tanhf(__x); }
+
+ inline long double
+ tanh(long double __x)
+ { return __builtin_tanhl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+ double>::__type
+ tanh(_Tp __x)
+ { return __builtin_tanh(__x); }
+
+_GLIBCXX_END_NAMESPACE
+
+#if _GLIBCXX_USE_C99_MATH
+#if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
+
+// These are possible macros imported from C99-land.
+#undef fpclassify
+#undef isfinite
+#undef isinf
+#undef isnan
+#undef isnormal
+#undef signbit
+#undef isgreater
+#undef isgreaterequal
+#undef isless
+#undef islessequal
+#undef islessgreater
+#undef isunordered
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ fpclassify(_Tp __f)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
+ FP_SUBNORMAL, FP_ZERO, __type(__f));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ isfinite(_Tp __f)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_isfinite(__type(__f));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ isinf(_Tp __f)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_isinf(__type(__f));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ isnan(_Tp __f)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_isnan(__type(__f));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ isnormal(_Tp __f)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_isnormal(__type(__f));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ signbit(_Tp __f)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_signbit(__type(__f));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ isgreater(_Tp __f1, _Tp __f2)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_isgreater(__type(__f1), __type(__f2));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ isgreaterequal(_Tp __f1, _Tp __f2)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_isgreaterequal(__type(__f1), __type(__f2));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ isless(_Tp __f1, _Tp __f2)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_isless(__type(__f1), __type(__f2));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ islessequal(_Tp __f1, _Tp __f2)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_islessequal(__type(__f1), __type(__f2));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ islessgreater(_Tp __f1, _Tp __f2)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_islessgreater(__type(__f1), __type(__f2));
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
+ int>::__type
+ isunordered(_Tp __f1, _Tp __f2)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __builtin_isunordered(__type(__f1), __type(__f2));
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */
+#endif
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/cmath.tcc>
+#endif
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/cmath>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/cmath>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/complex b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/complex
new file mode 100644
index 0000000..4c0d3fb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/complex
@@ -0,0 +1,1587 @@
+// The template and inlines for the -*- C++ -*- complex number classes.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/complex
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 14882: 26.2 Complex Numbers
+// Note: this is not a conforming implementation.
+// Initially implemented by Ulrich Drepper <drepper@cygnus.com>
+// Improved by Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr>
+//
+
+#ifndef _GLIBCXX_COMPLEX
+#define _GLIBCXX_COMPLEX 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/cpp_type_traits.h>
+#include <ext/type_traits.h>
+#include <cmath>
+#include <sstream>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @defgroup complex_numbers Complex Numbers
+ * @ingroup numerics
+ *
+ * Classes and functions for complex numbers.
+ * @{
+ */
+
+ // Forward declarations.
+ template<typename _Tp> class complex;
+ template<> class complex<float>;
+ template<> class complex<double>;
+ template<> class complex<long double>;
+
+ /// Return magnitude of @a z.
+ template<typename _Tp> _Tp abs(const complex<_Tp>&);
+ /// Return phase angle of @a z.
+ template<typename _Tp> _Tp arg(const complex<_Tp>&);
+ /// Return @a z magnitude squared.
+ template<typename _Tp> _Tp norm(const complex<_Tp>&);
+
+ /// Return complex conjugate of @a z.
+ template<typename _Tp> complex<_Tp> conj(const complex<_Tp>&);
+ /// Return complex with magnitude @a rho and angle @a theta.
+ template<typename _Tp> complex<_Tp> polar(const _Tp&, const _Tp& = 0);
+
+ // Transcendentals:
+ /// Return complex cosine of @a z.
+ template<typename _Tp> complex<_Tp> cos(const complex<_Tp>&);
+ /// Return complex hyperbolic cosine of @a z.
+ template<typename _Tp> complex<_Tp> cosh(const complex<_Tp>&);
+ /// Return complex base e exponential of @a z.
+ template<typename _Tp> complex<_Tp> exp(const complex<_Tp>&);
+ /// Return complex natural logarithm of @a z.
+ template<typename _Tp> complex<_Tp> log(const complex<_Tp>&);
+ /// Return complex base 10 logarithm of @a z.
+ template<typename _Tp> complex<_Tp> log10(const complex<_Tp>&);
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ // DR 844.
+ /// Return @a x to the @a y'th power.
+ template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&, int);
+#endif
+ /// Return @a x to the @a y'th power.
+ template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&, const _Tp&);
+ /// Return @a x to the @a y'th power.
+ template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&,
+ const complex<_Tp>&);
+ /// Return @a x to the @a y'th power.
+ template<typename _Tp> complex<_Tp> pow(const _Tp&, const complex<_Tp>&);
+ /// Return complex sine of @a z.
+ template<typename _Tp> complex<_Tp> sin(const complex<_Tp>&);
+ /// Return complex hyperbolic sine of @a z.
+ template<typename _Tp> complex<_Tp> sinh(const complex<_Tp>&);
+ /// Return complex square root of @a z.
+ template<typename _Tp> complex<_Tp> sqrt(const complex<_Tp>&);
+ /// Return complex tangent of @a z.
+ template<typename _Tp> complex<_Tp> tan(const complex<_Tp>&);
+ /// Return complex hyperbolic tangent of @a z.
+ template<typename _Tp> complex<_Tp> tanh(const complex<_Tp>&);
+
+
+ // 26.2.2 Primary template class complex
+ /**
+ * Template to represent complex numbers.
+ *
+ * Specializations for float, double, and long double are part of the
+ * library. Results with any other type are not guaranteed.
+ *
+ * @param Tp Type of real and imaginary values.
+ */
+ template<typename _Tp>
+ struct complex
+ {
+ /// Value typedef.
+ typedef _Tp value_type;
+
+ /// Default constructor. First parameter is x, second parameter is y.
+ /// Unspecified parameters default to 0.
+ complex(const _Tp& __r = _Tp(), const _Tp& __i = _Tp())
+ : _M_real(__r), _M_imag(__i) { }
+
+ // Lets the compiler synthesize the copy constructor
+ // complex (const complex<_Tp>&);
+ /// Copy constructor.
+ template<typename _Up>
+ complex(const complex<_Up>& __z)
+ : _M_real(__z.real()), _M_imag(__z.imag()) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 387. std::complex over-encapsulated.
+ _Tp real() const
+ { return _M_real; }
+
+ _Tp imag() const
+ { return _M_imag; }
+#else
+ /// Return real part of complex number.
+ _Tp& real()
+ { return _M_real; }
+
+ /// Return real part of complex number.
+ const _Tp& real() const
+ { return _M_real; }
+
+ /// Return imaginary part of complex number.
+ _Tp& imag()
+ { return _M_imag; }
+
+ /// Return imaginary part of complex number.
+ const _Tp& imag() const
+ { return _M_imag; }
+#endif
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 387. std::complex over-encapsulated.
+ void real(_Tp __val)
+ { _M_real = __val; }
+
+ void imag(_Tp __val)
+ { _M_imag = __val; }
+
+ /// Assign this complex number to scalar @a t.
+ complex<_Tp>& operator=(const _Tp&);
+
+ /// Add @a t to this complex number.
+ // 26.2.5/1
+ complex<_Tp>&
+ operator+=(const _Tp& __t)
+ {
+ _M_real += __t;
+ return *this;
+ }
+
+ /// Subtract @a t from this complex number.
+ // 26.2.5/3
+ complex<_Tp>&
+ operator-=(const _Tp& __t)
+ {
+ _M_real -= __t;
+ return *this;
+ }
+
+ /// Multiply this complex number by @a t.
+ complex<_Tp>& operator*=(const _Tp&);
+ /// Divide this complex number by @a t.
+ complex<_Tp>& operator/=(const _Tp&);
+
+ // Lets the compiler synthesize the
+ // copy and assignment operator
+ // complex<_Tp>& operator= (const complex<_Tp>&);
+ /// Assign this complex number to complex @a z.
+ template<typename _Up>
+ complex<_Tp>& operator=(const complex<_Up>&);
+ /// Add @a z to this complex number.
+ template<typename _Up>
+ complex<_Tp>& operator+=(const complex<_Up>&);
+ /// Subtract @a z from this complex number.
+ template<typename _Up>
+ complex<_Tp>& operator-=(const complex<_Up>&);
+ /// Multiply this complex number by @a z.
+ template<typename _Up>
+ complex<_Tp>& operator*=(const complex<_Up>&);
+ /// Divide this complex number by @a z.
+ template<typename _Up>
+ complex<_Tp>& operator/=(const complex<_Up>&);
+
+ const complex& __rep() const
+ { return *this; }
+
+ private:
+ _Tp _M_real;
+ _Tp _M_imag;
+ };
+
+ template<typename _Tp>
+ complex<_Tp>&
+ complex<_Tp>::operator=(const _Tp& __t)
+ {
+ _M_real = __t;
+ _M_imag = _Tp();
+ return *this;
+ }
+
+ // 26.2.5/5
+ template<typename _Tp>
+ complex<_Tp>&
+ complex<_Tp>::operator*=(const _Tp& __t)
+ {
+ _M_real *= __t;
+ _M_imag *= __t;
+ return *this;
+ }
+
+ // 26.2.5/7
+ template<typename _Tp>
+ complex<_Tp>&
+ complex<_Tp>::operator/=(const _Tp& __t)
+ {
+ _M_real /= __t;
+ _M_imag /= __t;
+ return *this;
+ }
+
+ template<typename _Tp>
+ template<typename _Up>
+ complex<_Tp>&
+ complex<_Tp>::operator=(const complex<_Up>& __z)
+ {
+ _M_real = __z.real();
+ _M_imag = __z.imag();
+ return *this;
+ }
+
+ // 26.2.5/9
+ template<typename _Tp>
+ template<typename _Up>
+ complex<_Tp>&
+ complex<_Tp>::operator+=(const complex<_Up>& __z)
+ {
+ _M_real += __z.real();
+ _M_imag += __z.imag();
+ return *this;
+ }
+
+ // 26.2.5/11
+ template<typename _Tp>
+ template<typename _Up>
+ complex<_Tp>&
+ complex<_Tp>::operator-=(const complex<_Up>& __z)
+ {
+ _M_real -= __z.real();
+ _M_imag -= __z.imag();
+ return *this;
+ }
+
+ // 26.2.5/13
+ // XXX: This is a grammar school implementation.
+ template<typename _Tp>
+ template<typename _Up>
+ complex<_Tp>&
+ complex<_Tp>::operator*=(const complex<_Up>& __z)
+ {
+ const _Tp __r = _M_real * __z.real() - _M_imag * __z.imag();
+ _M_imag = _M_real * __z.imag() + _M_imag * __z.real();
+ _M_real = __r;
+ return *this;
+ }
+
+ // 26.2.5/15
+ // XXX: This is a grammar school implementation.
+ template<typename _Tp>
+ template<typename _Up>
+ complex<_Tp>&
+ complex<_Tp>::operator/=(const complex<_Up>& __z)
+ {
+ const _Tp __r = _M_real * __z.real() + _M_imag * __z.imag();
+ const _Tp __n = std::norm(__z);
+ _M_imag = (_M_imag * __z.real() - _M_real * __z.imag()) / __n;
+ _M_real = __r / __n;
+ return *this;
+ }
+
+ // Operators:
+ //@{
+ /// Return new complex value @a x plus @a y.
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator+(const complex<_Tp>& __x, const complex<_Tp>& __y)
+ {
+ complex<_Tp> __r = __x;
+ __r += __y;
+ return __r;
+ }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator+(const complex<_Tp>& __x, const _Tp& __y)
+ {
+ complex<_Tp> __r = __x;
+ __r += __y;
+ return __r;
+ }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator+(const _Tp& __x, const complex<_Tp>& __y)
+ {
+ complex<_Tp> __r = __y;
+ __r += __x;
+ return __r;
+ }
+ //@}
+
+ //@{
+ /// Return new complex value @a x minus @a y.
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
+ {
+ complex<_Tp> __r = __x;
+ __r -= __y;
+ return __r;
+ }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator-(const complex<_Tp>& __x, const _Tp& __y)
+ {
+ complex<_Tp> __r = __x;
+ __r -= __y;
+ return __r;
+ }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator-(const _Tp& __x, const complex<_Tp>& __y)
+ {
+ complex<_Tp> __r(__x, -__y.imag());
+ __r -= __y.real();
+ return __r;
+ }
+ //@}
+
+ //@{
+ /// Return new complex value @a x times @a y.
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator*(const complex<_Tp>& __x, const complex<_Tp>& __y)
+ {
+ complex<_Tp> __r = __x;
+ __r *= __y;
+ return __r;
+ }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator*(const complex<_Tp>& __x, const _Tp& __y)
+ {
+ complex<_Tp> __r = __x;
+ __r *= __y;
+ return __r;
+ }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator*(const _Tp& __x, const complex<_Tp>& __y)
+ {
+ complex<_Tp> __r = __y;
+ __r *= __x;
+ return __r;
+ }
+ //@}
+
+ //@{
+ /// Return new complex value @a x divided by @a y.
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator/(const complex<_Tp>& __x, const complex<_Tp>& __y)
+ {
+ complex<_Tp> __r = __x;
+ __r /= __y;
+ return __r;
+ }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator/(const complex<_Tp>& __x, const _Tp& __y)
+ {
+ complex<_Tp> __r = __x;
+ __r /= __y;
+ return __r;
+ }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator/(const _Tp& __x, const complex<_Tp>& __y)
+ {
+ complex<_Tp> __r = __x;
+ __r /= __y;
+ return __r;
+ }
+ //@}
+
+ /// Return @a x.
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator+(const complex<_Tp>& __x)
+ { return __x; }
+
+ /// Return complex negation of @a x.
+ template<typename _Tp>
+ inline complex<_Tp>
+ operator-(const complex<_Tp>& __x)
+ { return complex<_Tp>(-__x.real(), -__x.imag()); }
+
+ //@{
+ /// Return true if @a x is equal to @a y.
+ template<typename _Tp>
+ inline bool
+ operator==(const complex<_Tp>& __x, const complex<_Tp>& __y)
+ { return __x.real() == __y.real() && __x.imag() == __y.imag(); }
+
+ template<typename _Tp>
+ inline bool
+ operator==(const complex<_Tp>& __x, const _Tp& __y)
+ { return __x.real() == __y && __x.imag() == _Tp(); }
+
+ template<typename _Tp>
+ inline bool
+ operator==(const _Tp& __x, const complex<_Tp>& __y)
+ { return __x == __y.real() && _Tp() == __y.imag(); }
+ //@}
+
+ //@{
+ /// Return false if @a x is equal to @a y.
+ template<typename _Tp>
+ inline bool
+ operator!=(const complex<_Tp>& __x, const complex<_Tp>& __y)
+ { return __x.real() != __y.real() || __x.imag() != __y.imag(); }
+
+ template<typename _Tp>
+ inline bool
+ operator!=(const complex<_Tp>& __x, const _Tp& __y)
+ { return __x.real() != __y || __x.imag() != _Tp(); }
+
+ template<typename _Tp>
+ inline bool
+ operator!=(const _Tp& __x, const complex<_Tp>& __y)
+ { return __x != __y.real() || _Tp() != __y.imag(); }
+ //@}
+
+ /// Extraction operator for complex values.
+ template<typename _Tp, typename _CharT, class _Traits>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
+ {
+ _Tp __re_x, __im_x;
+ _CharT __ch;
+ __is >> __ch;
+ if (__ch == '(')
+ {
+ __is >> __re_x >> __ch;
+ if (__ch == ',')
+ {
+ __is >> __im_x >> __ch;
+ if (__ch == ')')
+ __x = complex<_Tp>(__re_x, __im_x);
+ else
+ __is.setstate(ios_base::failbit);
+ }
+ else if (__ch == ')')
+ __x = __re_x;
+ else
+ __is.setstate(ios_base::failbit);
+ }
+ else
+ {
+ __is.putback(__ch);
+ __is >> __re_x;
+ __x = __re_x;
+ }
+ return __is;
+ }
+
+ /// Insertion operator for complex values.
+ template<typename _Tp, typename _CharT, class _Traits>
+ basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
+ {
+ basic_ostringstream<_CharT, _Traits> __s;
+ __s.flags(__os.flags());
+ __s.imbue(__os.getloc());
+ __s.precision(__os.precision());
+ __s << '(' << __x.real() << ',' << __x.imag() << ')';
+ return __os << __s.str();
+ }
+
+ // Values
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp>
+ inline _Tp
+ real(const complex<_Tp>& __z)
+ { return __z.real(); }
+
+ template<typename _Tp>
+ inline _Tp
+ imag(const complex<_Tp>& __z)
+ { return __z.imag(); }
+#else
+ template<typename _Tp>
+ inline _Tp&
+ real(complex<_Tp>& __z)
+ { return __z.real(); }
+
+ template<typename _Tp>
+ inline const _Tp&
+ real(const complex<_Tp>& __z)
+ { return __z.real(); }
+
+ template<typename _Tp>
+ inline _Tp&
+ imag(complex<_Tp>& __z)
+ { return __z.imag(); }
+
+ template<typename _Tp>
+ inline const _Tp&
+ imag(const complex<_Tp>& __z)
+ { return __z.imag(); }
+#endif
+
+ // 26.2.7/3 abs(__z): Returns the magnitude of __z.
+ template<typename _Tp>
+ inline _Tp
+ __complex_abs(const complex<_Tp>& __z)
+ {
+ _Tp __x = __z.real();
+ _Tp __y = __z.imag();
+ const _Tp __s = std::max(abs(__x), abs(__y));
+ if (__s == _Tp()) // well ...
+ return __s;
+ __x /= __s;
+ __y /= __s;
+ return __s * sqrt(__x * __x + __y * __y);
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline float
+ __complex_abs(__complex__ float __z) { return __builtin_cabsf(__z); }
+
+ inline double
+ __complex_abs(__complex__ double __z) { return __builtin_cabs(__z); }
+
+ inline long double
+ __complex_abs(const __complex__ long double& __z)
+ { return __builtin_cabsl(__z); }
+
+ template<typename _Tp>
+ inline _Tp
+ abs(const complex<_Tp>& __z) { return __complex_abs(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline _Tp
+ abs(const complex<_Tp>& __z) { return __complex_abs(__z); }
+#endif
+
+
+ // 26.2.7/4: arg(__z): Returns the phase angle of __z.
+ template<typename _Tp>
+ inline _Tp
+ __complex_arg(const complex<_Tp>& __z)
+ { return atan2(__z.imag(), __z.real()); }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline float
+ __complex_arg(__complex__ float __z) { return __builtin_cargf(__z); }
+
+ inline double
+ __complex_arg(__complex__ double __z) { return __builtin_carg(__z); }
+
+ inline long double
+ __complex_arg(const __complex__ long double& __z)
+ { return __builtin_cargl(__z); }
+
+ template<typename _Tp>
+ inline _Tp
+ arg(const complex<_Tp>& __z) { return __complex_arg(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline _Tp
+ arg(const complex<_Tp>& __z) { return __complex_arg(__z); }
+#endif
+
+ // 26.2.7/5: norm(__z) returns the squared magnitude of __z.
+ // As defined, norm() is -not- a norm is the common mathematical
+ // sens used in numerics. The helper class _Norm_helper<> tries to
+ // distinguish between builtin floating point and the rest, so as
+ // to deliver an answer as close as possible to the real value.
+ template<bool>
+ struct _Norm_helper
+ {
+ template<typename _Tp>
+ static inline _Tp _S_do_it(const complex<_Tp>& __z)
+ {
+ const _Tp __x = __z.real();
+ const _Tp __y = __z.imag();
+ return __x * __x + __y * __y;
+ }
+ };
+
+ template<>
+ struct _Norm_helper<true>
+ {
+ template<typename _Tp>
+ static inline _Tp _S_do_it(const complex<_Tp>& __z)
+ {
+ _Tp __res = std::abs(__z);
+ return __res * __res;
+ }
+ };
+
+ template<typename _Tp>
+ inline _Tp
+ norm(const complex<_Tp>& __z)
+ {
+ return _Norm_helper<__is_floating<_Tp>::__value
+ && !_GLIBCXX_FAST_MATH>::_S_do_it(__z);
+ }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ polar(const _Tp& __rho, const _Tp& __theta)
+ { return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ conj(const complex<_Tp>& __z)
+ { return complex<_Tp>(__z.real(), -__z.imag()); }
+
+ // Transcendentals
+
+ // 26.2.8/1 cos(__z): Returns the cosine of __z.
+ template<typename _Tp>
+ inline complex<_Tp>
+ __complex_cos(const complex<_Tp>& __z)
+ {
+ const _Tp __x = __z.real();
+ const _Tp __y = __z.imag();
+ return complex<_Tp>(cos(__x) * cosh(__y), -sin(__x) * sinh(__y));
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_cos(__complex__ float __z) { return __builtin_ccosf(__z); }
+
+ inline __complex__ double
+ __complex_cos(__complex__ double __z) { return __builtin_ccos(__z); }
+
+ inline __complex__ long double
+ __complex_cos(const __complex__ long double& __z)
+ { return __builtin_ccosl(__z); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ cos(const complex<_Tp>& __z) { return __complex_cos(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline complex<_Tp>
+ cos(const complex<_Tp>& __z) { return __complex_cos(__z); }
+#endif
+
+ // 26.2.8/2 cosh(__z): Returns the hyperbolic cosine of __z.
+ template<typename _Tp>
+ inline complex<_Tp>
+ __complex_cosh(const complex<_Tp>& __z)
+ {
+ const _Tp __x = __z.real();
+ const _Tp __y = __z.imag();
+ return complex<_Tp>(cosh(__x) * cos(__y), sinh(__x) * sin(__y));
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_cosh(__complex__ float __z) { return __builtin_ccoshf(__z); }
+
+ inline __complex__ double
+ __complex_cosh(__complex__ double __z) { return __builtin_ccosh(__z); }
+
+ inline __complex__ long double
+ __complex_cosh(const __complex__ long double& __z)
+ { return __builtin_ccoshl(__z); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ cosh(const complex<_Tp>& __z) { return __complex_cosh(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline complex<_Tp>
+ cosh(const complex<_Tp>& __z) { return __complex_cosh(__z); }
+#endif
+
+ // 26.2.8/3 exp(__z): Returns the complex base e exponential of x
+ template<typename _Tp>
+ inline complex<_Tp>
+ __complex_exp(const complex<_Tp>& __z)
+ { return std::polar(exp(__z.real()), __z.imag()); }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_exp(__complex__ float __z) { return __builtin_cexpf(__z); }
+
+ inline __complex__ double
+ __complex_exp(__complex__ double __z) { return __builtin_cexp(__z); }
+
+ inline __complex__ long double
+ __complex_exp(const __complex__ long double& __z)
+ { return __builtin_cexpl(__z); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ exp(const complex<_Tp>& __z) { return __complex_exp(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline complex<_Tp>
+ exp(const complex<_Tp>& __z) { return __complex_exp(__z); }
+#endif
+
+ // 26.2.8/5 log(__z): Returns the natural complex logarithm of __z.
+ // The branch cut is along the negative axis.
+ template<typename _Tp>
+ inline complex<_Tp>
+ __complex_log(const complex<_Tp>& __z)
+ { return complex<_Tp>(log(std::abs(__z)), std::arg(__z)); }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_log(__complex__ float __z) { return __builtin_clogf(__z); }
+
+ inline __complex__ double
+ __complex_log(__complex__ double __z) { return __builtin_clog(__z); }
+
+ inline __complex__ long double
+ __complex_log(const __complex__ long double& __z)
+ { return __builtin_clogl(__z); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ log(const complex<_Tp>& __z) { return __complex_log(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline complex<_Tp>
+ log(const complex<_Tp>& __z) { return __complex_log(__z); }
+#endif
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ log10(const complex<_Tp>& __z)
+ { return std::log(__z) / log(_Tp(10.0)); }
+
+ // 26.2.8/10 sin(__z): Returns the sine of __z.
+ template<typename _Tp>
+ inline complex<_Tp>
+ __complex_sin(const complex<_Tp>& __z)
+ {
+ const _Tp __x = __z.real();
+ const _Tp __y = __z.imag();
+ return complex<_Tp>(sin(__x) * cosh(__y), cos(__x) * sinh(__y));
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_sin(__complex__ float __z) { return __builtin_csinf(__z); }
+
+ inline __complex__ double
+ __complex_sin(__complex__ double __z) { return __builtin_csin(__z); }
+
+ inline __complex__ long double
+ __complex_sin(const __complex__ long double& __z)
+ { return __builtin_csinl(__z); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ sin(const complex<_Tp>& __z) { return __complex_sin(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline complex<_Tp>
+ sin(const complex<_Tp>& __z) { return __complex_sin(__z); }
+#endif
+
+ // 26.2.8/11 sinh(__z): Returns the hyperbolic sine of __z.
+ template<typename _Tp>
+ inline complex<_Tp>
+ __complex_sinh(const complex<_Tp>& __z)
+ {
+ const _Tp __x = __z.real();
+ const _Tp __y = __z.imag();
+ return complex<_Tp>(sinh(__x) * cos(__y), cosh(__x) * sin(__y));
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_sinh(__complex__ float __z) { return __builtin_csinhf(__z); }
+
+ inline __complex__ double
+ __complex_sinh(__complex__ double __z) { return __builtin_csinh(__z); }
+
+ inline __complex__ long double
+ __complex_sinh(const __complex__ long double& __z)
+ { return __builtin_csinhl(__z); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ sinh(const complex<_Tp>& __z) { return __complex_sinh(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline complex<_Tp>
+ sinh(const complex<_Tp>& __z) { return __complex_sinh(__z); }
+#endif
+
+ // 26.2.8/13 sqrt(__z): Returns the complex square root of __z.
+ // The branch cut is on the negative axis.
+ template<typename _Tp>
+ complex<_Tp>
+ __complex_sqrt(const complex<_Tp>& __z)
+ {
+ _Tp __x = __z.real();
+ _Tp __y = __z.imag();
+
+ if (__x == _Tp())
+ {
+ _Tp __t = sqrt(abs(__y) / 2);
+ return complex<_Tp>(__t, __y < _Tp() ? -__t : __t);
+ }
+ else
+ {
+ _Tp __t = sqrt(2 * (std::abs(__z) + abs(__x)));
+ _Tp __u = __t / 2;
+ return __x > _Tp()
+ ? complex<_Tp>(__u, __y / __t)
+ : complex<_Tp>(abs(__y) / __t, __y < _Tp() ? -__u : __u);
+ }
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_sqrt(__complex__ float __z) { return __builtin_csqrtf(__z); }
+
+ inline __complex__ double
+ __complex_sqrt(__complex__ double __z) { return __builtin_csqrt(__z); }
+
+ inline __complex__ long double
+ __complex_sqrt(const __complex__ long double& __z)
+ { return __builtin_csqrtl(__z); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ sqrt(const complex<_Tp>& __z) { return __complex_sqrt(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline complex<_Tp>
+ sqrt(const complex<_Tp>& __z) { return __complex_sqrt(__z); }
+#endif
+
+ // 26.2.8/14 tan(__z): Return the complex tangent of __z.
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ __complex_tan(const complex<_Tp>& __z)
+ { return std::sin(__z) / std::cos(__z); }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_tan(__complex__ float __z) { return __builtin_ctanf(__z); }
+
+ inline __complex__ double
+ __complex_tan(__complex__ double __z) { return __builtin_ctan(__z); }
+
+ inline __complex__ long double
+ __complex_tan(const __complex__ long double& __z)
+ { return __builtin_ctanl(__z); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ tan(const complex<_Tp>& __z) { return __complex_tan(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline complex<_Tp>
+ tan(const complex<_Tp>& __z) { return __complex_tan(__z); }
+#endif
+
+
+ // 26.2.8/15 tanh(__z): Returns the hyperbolic tangent of __z.
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ __complex_tanh(const complex<_Tp>& __z)
+ { return std::sinh(__z) / std::cosh(__z); }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_tanh(__complex__ float __z) { return __builtin_ctanhf(__z); }
+
+ inline __complex__ double
+ __complex_tanh(__complex__ double __z) { return __builtin_ctanh(__z); }
+
+ inline __complex__ long double
+ __complex_tanh(const __complex__ long double& __z)
+ { return __builtin_ctanhl(__z); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ tanh(const complex<_Tp>& __z) { return __complex_tanh(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline complex<_Tp>
+ tanh(const complex<_Tp>& __z) { return __complex_tanh(__z); }
+#endif
+
+
+ // 26.2.8/9 pow(__x, __y): Returns the complex power base of __x
+ // raised to the __y-th power. The branch
+ // cut is on the negative axis.
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 844. complex pow return type is ambiguous.
+ template<typename _Tp>
+ inline complex<_Tp>
+ pow(const complex<_Tp>& __z, int __n)
+ { return std::__pow_helper(__z, __n); }
+#endif
+
+ template<typename _Tp>
+ complex<_Tp>
+ pow(const complex<_Tp>& __x, const _Tp& __y)
+ {
+#ifndef _GLIBCXX_USE_C99_COMPLEX
+ if (__x == _Tp())
+ return _Tp();
+#endif
+ if (__x.imag() == _Tp() && __x.real() > _Tp())
+ return pow(__x.real(), __y);
+
+ complex<_Tp> __t = std::log(__x);
+ return std::polar(exp(__y * __t.real()), __y * __t.imag());
+ }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ __complex_pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
+ { return __x == _Tp() ? _Tp() : std::exp(__y * std::log(__x)); }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_pow(__complex__ float __x, __complex__ float __y)
+ { return __builtin_cpowf(__x, __y); }
+
+ inline __complex__ double
+ __complex_pow(__complex__ double __x, __complex__ double __y)
+ { return __builtin_cpow(__x, __y); }
+
+ inline __complex__ long double
+ __complex_pow(const __complex__ long double& __x,
+ const __complex__ long double& __y)
+ { return __builtin_cpowl(__x, __y); }
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
+ { return __complex_pow(__x.__rep(), __y.__rep()); }
+#else
+ template<typename _Tp>
+ inline complex<_Tp>
+ pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
+ { return __complex_pow(__x, __y); }
+#endif
+
+ template<typename _Tp>
+ inline complex<_Tp>
+ pow(const _Tp& __x, const complex<_Tp>& __y)
+ {
+ return __x > _Tp() ? std::polar(pow(__x, __y.real()),
+ __y.imag() * log(__x))
+ : std::pow(complex<_Tp>(__x), __y);
+ }
+
+ // 26.2.3 complex specializations
+ // complex<float> specialization
+ template<>
+ struct complex<float>
+ {
+ typedef float value_type;
+ typedef __complex__ float _ComplexT;
+
+ complex(_ComplexT __z) : _M_value(__z) { }
+
+ complex(float __r = 0.0f, float __i = 0.0f)
+ {
+ __real__ _M_value = __r;
+ __imag__ _M_value = __i;
+ }
+
+ explicit complex(const complex<double>&);
+ explicit complex(const complex<long double>&);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 387. std::complex over-encapsulated.
+ float real() const
+ { return __real__ _M_value; }
+
+ float imag() const
+ { return __imag__ _M_value; }
+#else
+ float& real()
+ { return __real__ _M_value; }
+
+ const float& real() const
+ { return __real__ _M_value; }
+
+ float& imag()
+ { return __imag__ _M_value; }
+
+ const float& imag() const
+ { return __imag__ _M_value; }
+#endif
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 387. std::complex over-encapsulated.
+ void real(float __val)
+ { __real__ _M_value = __val; }
+
+ void imag(float __val)
+ { __imag__ _M_value = __val; }
+
+ complex<float>&
+ operator=(float __f)
+ {
+ __real__ _M_value = __f;
+ __imag__ _M_value = 0.0f;
+ return *this;
+ }
+
+ complex<float>&
+ operator+=(float __f)
+ {
+ __real__ _M_value += __f;
+ return *this;
+ }
+
+ complex<float>&
+ operator-=(float __f)
+ {
+ __real__ _M_value -= __f;
+ return *this;
+ }
+
+ complex<float>&
+ operator*=(float __f)
+ {
+ _M_value *= __f;
+ return *this;
+ }
+
+ complex<float>&
+ operator/=(float __f)
+ {
+ _M_value /= __f;
+ return *this;
+ }
+
+ // Let the compiler synthesize the copy and assignment
+ // operator. It always does a pretty good job.
+ // complex& operator=(const complex&);
+
+ template<typename _Tp>
+ complex<float>&
+ operator=(const complex<_Tp>& __z)
+ {
+ __real__ _M_value = __z.real();
+ __imag__ _M_value = __z.imag();
+ return *this;
+ }
+
+ template<typename _Tp>
+ complex<float>&
+ operator+=(const complex<_Tp>& __z)
+ {
+ __real__ _M_value += __z.real();
+ __imag__ _M_value += __z.imag();
+ return *this;
+ }
+
+ template<class _Tp>
+ complex<float>&
+ operator-=(const complex<_Tp>& __z)
+ {
+ __real__ _M_value -= __z.real();
+ __imag__ _M_value -= __z.imag();
+ return *this;
+ }
+
+ template<class _Tp>
+ complex<float>&
+ operator*=(const complex<_Tp>& __z)
+ {
+ _ComplexT __t;
+ __real__ __t = __z.real();
+ __imag__ __t = __z.imag();
+ _M_value *= __t;
+ return *this;
+ }
+
+ template<class _Tp>
+ complex<float>&
+ operator/=(const complex<_Tp>& __z)
+ {
+ _ComplexT __t;
+ __real__ __t = __z.real();
+ __imag__ __t = __z.imag();
+ _M_value /= __t;
+ return *this;
+ }
+
+ const _ComplexT& __rep() const { return _M_value; }
+
+ private:
+ _ComplexT _M_value;
+ };
+
+ // 26.2.3 complex specializations
+ // complex<double> specialization
+ template<>
+ struct complex<double>
+ {
+ typedef double value_type;
+ typedef __complex__ double _ComplexT;
+
+ complex(_ComplexT __z) : _M_value(__z) { }
+
+ complex(double __r = 0.0, double __i = 0.0)
+ {
+ __real__ _M_value = __r;
+ __imag__ _M_value = __i;
+ }
+
+ complex(const complex<float>& __z)
+ : _M_value(__z.__rep()) { }
+
+ explicit complex(const complex<long double>&);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 387. std::complex over-encapsulated.
+ double real() const
+ { return __real__ _M_value; }
+
+ double imag() const
+ { return __imag__ _M_value; }
+#else
+ double& real()
+ { return __real__ _M_value; }
+
+ const double& real() const
+ { return __real__ _M_value; }
+
+ double& imag()
+ { return __imag__ _M_value; }
+
+ const double& imag() const
+ { return __imag__ _M_value; }
+#endif
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 387. std::complex over-encapsulated.
+ void real(double __val)
+ { __real__ _M_value = __val; }
+
+ void imag(double __val)
+ { __imag__ _M_value = __val; }
+
+ complex<double>&
+ operator=(double __d)
+ {
+ __real__ _M_value = __d;
+ __imag__ _M_value = 0.0;
+ return *this;
+ }
+
+ complex<double>&
+ operator+=(double __d)
+ {
+ __real__ _M_value += __d;
+ return *this;
+ }
+
+ complex<double>&
+ operator-=(double __d)
+ {
+ __real__ _M_value -= __d;
+ return *this;
+ }
+
+ complex<double>&
+ operator*=(double __d)
+ {
+ _M_value *= __d;
+ return *this;
+ }
+
+ complex<double>&
+ operator/=(double __d)
+ {
+ _M_value /= __d;
+ return *this;
+ }
+
+ // The compiler will synthesize this, efficiently.
+ // complex& operator=(const complex&);
+
+ template<typename _Tp>
+ complex<double>&
+ operator=(const complex<_Tp>& __z)
+ {
+ __real__ _M_value = __z.real();
+ __imag__ _M_value = __z.imag();
+ return *this;
+ }
+
+ template<typename _Tp>
+ complex<double>&
+ operator+=(const complex<_Tp>& __z)
+ {
+ __real__ _M_value += __z.real();
+ __imag__ _M_value += __z.imag();
+ return *this;
+ }
+
+ template<typename _Tp>
+ complex<double>&
+ operator-=(const complex<_Tp>& __z)
+ {
+ __real__ _M_value -= __z.real();
+ __imag__ _M_value -= __z.imag();
+ return *this;
+ }
+
+ template<typename _Tp>
+ complex<double>&
+ operator*=(const complex<_Tp>& __z)
+ {
+ _ComplexT __t;
+ __real__ __t = __z.real();
+ __imag__ __t = __z.imag();
+ _M_value *= __t;
+ return *this;
+ }
+
+ template<typename _Tp>
+ complex<double>&
+ operator/=(const complex<_Tp>& __z)
+ {
+ _ComplexT __t;
+ __real__ __t = __z.real();
+ __imag__ __t = __z.imag();
+ _M_value /= __t;
+ return *this;
+ }
+
+ const _ComplexT& __rep() const { return _M_value; }
+
+ private:
+ _ComplexT _M_value;
+ };
+
+ // 26.2.3 complex specializations
+ // complex<long double> specialization
+ template<>
+ struct complex<long double>
+ {
+ typedef long double value_type;
+ typedef __complex__ long double _ComplexT;
+
+ complex(_ComplexT __z) : _M_value(__z) { }
+
+ complex(long double __r = 0.0L, long double __i = 0.0L)
+ {
+ __real__ _M_value = __r;
+ __imag__ _M_value = __i;
+ }
+
+ complex(const complex<float>& __z)
+ : _M_value(__z.__rep()) { }
+
+ complex(const complex<double>& __z)
+ : _M_value(__z.__rep()) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 387. std::complex over-encapsulated.
+ long double real() const
+ { return __real__ _M_value; }
+
+ long double imag() const
+ { return __imag__ _M_value; }
+#else
+ long double& real()
+ { return __real__ _M_value; }
+
+ const long double& real() const
+ { return __real__ _M_value; }
+
+ long double& imag()
+ { return __imag__ _M_value; }
+
+ const long double& imag() const
+ { return __imag__ _M_value; }
+#endif
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 387. std::complex over-encapsulated.
+ void real(long double __val)
+ { __real__ _M_value = __val; }
+
+ void imag(long double __val)
+ { __imag__ _M_value = __val; }
+
+ complex<long double>&
+ operator=(long double __r)
+ {
+ __real__ _M_value = __r;
+ __imag__ _M_value = 0.0L;
+ return *this;
+ }
+
+ complex<long double>&
+ operator+=(long double __r)
+ {
+ __real__ _M_value += __r;
+ return *this;
+ }
+
+ complex<long double>&
+ operator-=(long double __r)
+ {
+ __real__ _M_value -= __r;
+ return *this;
+ }
+
+ complex<long double>&
+ operator*=(long double __r)
+ {
+ _M_value *= __r;
+ return *this;
+ }
+
+ complex<long double>&
+ operator/=(long double __r)
+ {
+ _M_value /= __r;
+ return *this;
+ }
+
+ // The compiler knows how to do this efficiently
+ // complex& operator=(const complex&);
+
+ template<typename _Tp>
+ complex<long double>&
+ operator=(const complex<_Tp>& __z)
+ {
+ __real__ _M_value = __z.real();
+ __imag__ _M_value = __z.imag();
+ return *this;
+ }
+
+ template<typename _Tp>
+ complex<long double>&
+ operator+=(const complex<_Tp>& __z)
+ {
+ __real__ _M_value += __z.real();
+ __imag__ _M_value += __z.imag();
+ return *this;
+ }
+
+ template<typename _Tp>
+ complex<long double>&
+ operator-=(const complex<_Tp>& __z)
+ {
+ __real__ _M_value -= __z.real();
+ __imag__ _M_value -= __z.imag();
+ return *this;
+ }
+
+ template<typename _Tp>
+ complex<long double>&
+ operator*=(const complex<_Tp>& __z)
+ {
+ _ComplexT __t;
+ __real__ __t = __z.real();
+ __imag__ __t = __z.imag();
+ _M_value *= __t;
+ return *this;
+ }
+
+ template<typename _Tp>
+ complex<long double>&
+ operator/=(const complex<_Tp>& __z)
+ {
+ _ComplexT __t;
+ __real__ __t = __z.real();
+ __imag__ __t = __z.imag();
+ _M_value /= __t;
+ return *this;
+ }
+
+ const _ComplexT& __rep() const { return _M_value; }
+
+ private:
+ _ComplexT _M_value;
+ };
+
+ // These bits have to be at the end of this file, so that the
+ // specializations have all been defined.
+ inline
+ complex<float>::complex(const complex<double>& __z)
+ : _M_value(__z.__rep()) { }
+
+ inline
+ complex<float>::complex(const complex<long double>& __z)
+ : _M_value(__z.__rep()) { }
+
+ inline
+ complex<double>::complex(const complex<long double>& __z)
+ : _M_value(__z.__rep()) { }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template istream& operator>>(istream&, complex<float>&);
+ extern template ostream& operator<<(ostream&, const complex<float>&);
+ extern template istream& operator>>(istream&, complex<double>&);
+ extern template ostream& operator<<(ostream&, const complex<double>&);
+ extern template istream& operator>>(istream&, complex<long double>&);
+ extern template ostream& operator<<(ostream&, const complex<long double>&);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template wistream& operator>>(wistream&, complex<float>&);
+ extern template wostream& operator<<(wostream&, const complex<float>&);
+ extern template wistream& operator>>(wistream&, complex<double>&);
+ extern template wostream& operator<<(wostream&, const complex<double>&);
+ extern template wistream& operator>>(wistream&, complex<long double>&);
+ extern template wostream& operator<<(wostream&, const complex<long double>&);
+#endif
+#endif
+
+ // @} group complex_numbers
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // See ext/type_traits.h for the primary template.
+ template<typename _Tp, typename _Up>
+ struct __promote_2<std::complex<_Tp>, _Up>
+ {
+ public:
+ typedef std::complex<typename __promote_2<_Tp, _Up>::__type> __type;
+ };
+
+ template<typename _Tp, typename _Up>
+ struct __promote_2<_Tp, std::complex<_Up> >
+ {
+ public:
+ typedef std::complex<typename __promote_2<_Tp, _Up>::__type> __type;
+ };
+
+ template<typename _Tp, typename _Up>
+ struct __promote_2<std::complex<_Tp>, std::complex<_Up> >
+ {
+ public:
+ typedef std::complex<typename __promote_2<_Tp, _Up>::__type> __type;
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/complex>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/complex>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Forward declarations.
+ // DR 781.
+ template<typename _Tp> std::complex<_Tp> proj(const std::complex<_Tp>&);
+
+ template<typename _Tp>
+ std::complex<_Tp>
+ __complex_proj(const std::complex<_Tp>& __z)
+ {
+ const _Tp __den = (__z.real() * __z.real()
+ + __z.imag() * __z.imag() + _Tp(1.0));
+
+ return std::complex<_Tp>((_Tp(2.0) * __z.real()) / __den,
+ (_Tp(2.0) * __z.imag()) / __den);
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX
+ inline __complex__ float
+ __complex_proj(__complex__ float __z)
+ { return __builtin_cprojf(__z); }
+
+ inline __complex__ double
+ __complex_proj(__complex__ double __z)
+ { return __builtin_cproj(__z); }
+
+ inline __complex__ long double
+ __complex_proj(const __complex__ long double& __z)
+ { return __builtin_cprojl(__z); }
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ proj(const std::complex<_Tp>& __z)
+ { return __complex_proj(__z.__rep()); }
+#else
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ proj(const std::complex<_Tp>& __z)
+ { return __complex_proj(__z); }
+#endif
+
+ template<typename _Tp>
+ inline std::complex<typename __gnu_cxx::__promote<_Tp>::__type>
+ proj(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return std::proj(std::complex<__type>(__x));
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
+#endif /* _GLIBCXX_COMPLEX */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/complex.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/complex.h
new file mode 100644
index 0000000..7dc5926
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/complex.h
@@ -0,0 +1,42 @@
+// -*- C++ -*- compatibility header.
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file complex.h
+ * This is a Standard C++ Library header.
+ */
+
+#include <bits/c++config.h>
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# include <ccomplex>
+#else
+# if _GLIBCXX_HAVE_COMPLEX_H
+# include_next <complex.h>
+# endif
+#endif
+
+#ifndef _GLIBCXX_COMPLEX_H
+#define _GLIBCXX_COMPLEX_H 1
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/condition_variable b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/condition_variable
new file mode 100644
index 0000000..64f2bb7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/condition_variable
@@ -0,0 +1,225 @@
+// <condition_variable> -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file condition_variable
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_CONDITION_VARIABLE
+#define _GLIBCXX_CONDITION_VARIABLE 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#include <chrono>
+#include <mutex> // unique_lock
+
+#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
+
+namespace std
+{
+ /**
+ * @defgroup condition_variables Condition Variables
+ * @ingroup concurrency
+ *
+ * Classes for condition_variable support.
+ * @{
+ */
+
+ /// condition_variable
+ class condition_variable
+ {
+ typedef chrono::system_clock __clock_t;
+ typedef __gthread_cond_t __native_type;
+ __native_type _M_cond;
+
+ public:
+ typedef __native_type* native_handle_type;
+
+ condition_variable();
+ ~condition_variable();
+
+ condition_variable(const condition_variable&) = delete;
+ condition_variable& operator=(const condition_variable&) = delete;
+
+ void
+ notify_one();
+
+ void
+ notify_all();
+
+ void
+ wait(unique_lock<mutex>& __lock);
+
+ template<typename _Predicate>
+ void
+ wait(unique_lock<mutex>& __lock, _Predicate __p)
+ {
+ while (!__p())
+ wait(__lock);
+ }
+
+ template<typename _Duration>
+ bool
+ wait_until(unique_lock<mutex>& __lock,
+ const chrono::time_point<__clock_t, _Duration>& __atime)
+ { return __wait_until_impl(__lock, __atime); }
+
+ template<typename _Clock, typename _Duration>
+ bool
+ wait_until(unique_lock<mutex>& __lock,
+ const chrono::time_point<_Clock, _Duration>& __atime)
+ {
+ // DR 887 - Sync unknown clock to known clock.
+ typename _Clock::time_point __c_entry = _Clock::now();
+ __clock_t::time_point __s_entry = __clock_t::now();
+ chrono::nanoseconds __delta = __atime - __c_entry;
+ __clock_t::time_point __s_atime = __s_entry + __delta;
+
+ return __wait_until_impl(__lock, __s_atime);
+ }
+
+ template<typename _Clock, typename _Duration, typename _Predicate>
+ bool
+ wait_until(unique_lock<mutex>& __lock,
+ const chrono::time_point<_Clock, _Duration>& __atime,
+ _Predicate __p)
+ {
+ while (!__p())
+ if (!wait_until(__lock, __atime))
+ return __p();
+
+ return true;
+ }
+
+ template<typename _Rep, typename _Period>
+ bool
+ wait_for(unique_lock<mutex>& __lock,
+ const chrono::duration<_Rep, _Period>& __rtime)
+ { return wait_until(__lock, __clock_t::now() + __rtime); }
+
+ template<typename _Rep, typename _Period, typename _Predicate>
+ bool
+ wait_for(unique_lock<mutex>& __lock,
+ const chrono::duration<_Rep, _Period>& __rtime,
+ _Predicate __p)
+ { return wait_until(__lock, __clock_t::now() + __rtime, std::move(__p)); }
+
+ native_handle_type
+ native_handle()
+ { return &_M_cond; }
+
+ private:
+ template<typename _Clock, typename _Duration>
+ bool
+ __wait_until_impl(unique_lock<mutex>& __lock,
+ const chrono::time_point<_Clock, _Duration>& __atime)
+ {
+ chrono::time_point<__clock_t, chrono::seconds> __s =
+ chrono::time_point_cast<chrono::seconds>(__atime);
+
+ chrono::nanoseconds __ns =
+ chrono::duration_cast<chrono::nanoseconds>(__atime - __s);
+
+ __gthread_time_t __ts =
+ {
+ static_cast<std::time_t>(__s.time_since_epoch().count()),
+ static_cast<long>(__ns.count())
+ };
+
+ __gthread_cond_timedwait(&_M_cond, __lock.mutex()->native_handle(),
+ &__ts);
+
+ return _Clock::now() < __atime;
+ }
+ };
+
+ /// condition_variable_any
+ // Like above, only mutex may not have try_lock.
+ class condition_variable_any
+ {
+ typedef __gthread_cond_t __native_type;
+ __native_type _M_cond;
+
+ public:
+ typedef __native_type* native_handle_type;
+
+ condition_variable_any();
+ ~condition_variable_any();
+
+ condition_variable_any(const condition_variable_any&) = delete;
+ condition_variable_any& operator=(const condition_variable_any&) = delete;
+
+ void
+ notify_one();
+
+ void
+ notify_all();
+
+ template<typename _Lock>
+ void
+ wait(_Lock& __lock);
+
+ template<typename _Lock, typename _Predicate>
+ void
+ wait(_Lock& __lock, _Predicate __p);
+
+ template<typename _Lock, typename _Clock, typename _Duration>
+ bool
+ wait_until(_Lock& __lock,
+ const chrono::time_point<_Clock, _Duration>& __atime);
+
+ template<typename _Lock, typename _Clock,
+ typename _Duration, typename _Predicate>
+ bool
+ wait_until(_Lock& __lock,
+ const chrono::time_point<_Clock, _Duration>& __atime,
+ _Predicate __p);
+
+ template<typename _Lock, typename _Rep, typename _Period>
+ bool
+ wait_for(_Lock& __lock, const chrono::duration<_Rep, _Period>& __rtime);
+
+ template<typename _Lock, typename _Rep,
+ typename _Period, typename _Predicate>
+ bool
+ wait_for(_Lock& __lock,
+ const chrono::duration<_Rep, _Period>& __rtime, _Predicate __p);
+
+ native_handle_type
+ native_handle()
+ { return &_M_cond; }
+ };
+
+ // @} group condition_variables
+}
+
+#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_CONDITION_VARIABLE
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/csetjmp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/csetjmp
new file mode 100644
index 0000000..6d7ecab
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/csetjmp
@@ -0,0 +1,64 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file csetjmp
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c setjmp.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 20.4.6 C library
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <setjmp.h>
+
+#ifndef _GLIBCXX_CSETJMP
+#define _GLIBCXX_CSETJMP 1
+
+// Get rid of those macros defined in <setjmp.h> in lieu of real functions.
+#undef longjmp
+
+// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
+#ifndef setjmp
+#define setjmp(env) setjmp (env)
+#endif
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::jmp_buf;
+ using ::longjmp;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/csignal b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/csignal
new file mode 100644
index 0000000..41af5e6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/csignal
@@ -0,0 +1,60 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file csignal
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c signal.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 20.4.6 C library
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <signal.h>
+
+#ifndef _GLIBCXX_CSIGNAL
+#define _GLIBCXX_CSIGNAL 1
+
+// Get rid of those macros defined in <signal.h> in lieu of real functions.
+#undef raise
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::sig_atomic_t;
+ using ::signal;
+ using ::raise;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdarg b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdarg
new file mode 100644
index 0000000..73327b1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdarg
@@ -0,0 +1,60 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cstdarg
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c stdarg.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 20.4.6 C library
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <stdarg.h>
+
+#ifndef _GLIBCXX_CSTDARG
+#define _GLIBCXX_CSTDARG 1
+
+// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
+#ifndef va_end
+#define va_end(ap) va_end (ap)
+#endif
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::va_list;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdatomic b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdatomic
new file mode 100644
index 0000000..7489d97
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdatomic
@@ -0,0 +1,848 @@
+// -*- C++ -*- header.
+
+// Copyright (C) 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file cstdatomic
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c stdatomic.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+// Based on "C++ Atomic Types and Operations" by Hans Boehm and Lawrence Crowl.
+// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html
+
+#ifndef _GLIBCXX_STDATOMIC
+#define _GLIBCXX_STDATOMIC 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#endif
+
+#include <stdatomic.h>
+#include <cstddef>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @addtogroup atomics
+ * @{
+ */
+
+ /// kill_dependency
+ template<typename _Tp>
+ inline _Tp
+ kill_dependency(_Tp __y)
+ {
+ _Tp ret(__y);
+ return ret;
+ }
+
+ inline memory_order
+ __calculate_memory_order(memory_order __m)
+ {
+ const bool __cond1 = __m == memory_order_release;
+ const bool __cond2 = __m == memory_order_acq_rel;
+ memory_order __mo1(__cond1 ? memory_order_relaxed : __m);
+ memory_order __mo2(__cond2 ? memory_order_acquire : __mo1);
+ return __mo2;
+ }
+
+ //
+ // Three nested namespaces for atomic implementation details.
+ //
+ // The nested namespace inlined into std:: is determined by the value
+ // of the _GLIBCXX_ATOMIC_PROPERTY macro and the resulting
+ // ATOMIC_*_LOCK_FREE macros. See file stdatomic.h.
+ //
+ // 0 == __atomic0 == Never lock-free
+ // 1 == __atomic1 == Best available, sometimes lock-free
+ // 2 == __atomic2 == Always lock-free
+#include <bits/atomic_0.h>
+#include <bits/atomic_2.h>
+
+ /// atomic
+ /// 29.4.3, Generic atomic type, primary class template.
+ template<typename _Tp>
+ struct atomic
+ {
+ private:
+ _Tp _M_i;
+
+ public:
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(_Tp __i) : _M_i(__i) { }
+
+ operator _Tp() const volatile;
+
+ _Tp
+ operator=(_Tp __i) volatile { store(__i); return __i; }
+
+ bool
+ is_lock_free() const volatile;
+
+ void
+ store(_Tp, memory_order = memory_order_seq_cst) volatile;
+
+ _Tp
+ load(memory_order = memory_order_seq_cst) const volatile;
+
+ _Tp
+ exchange(_Tp __i, memory_order = memory_order_seq_cst) volatile;
+
+ bool
+ compare_exchange_weak(_Tp&, _Tp, memory_order, memory_order) volatile;
+
+ bool
+ compare_exchange_strong(_Tp&, _Tp, memory_order, memory_order) volatile;
+
+ bool
+ compare_exchange_weak(_Tp&, _Tp,
+ memory_order = memory_order_seq_cst) volatile;
+
+ bool
+ compare_exchange_strong(_Tp&, _Tp,
+ memory_order = memory_order_seq_cst) volatile;
+ };
+
+
+ /// Partial specialization for pointer types.
+ template<typename _Tp>
+ struct atomic<_Tp*> : atomic_address
+ {
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(_Tp* __v) : atomic_address(__v) { }
+
+ void
+ store(_Tp*, memory_order = memory_order_seq_cst) volatile;
+
+ _Tp*
+ load(memory_order = memory_order_seq_cst) const volatile;
+
+ _Tp*
+ exchange(_Tp*, memory_order = memory_order_seq_cst) volatile;
+
+ bool
+ compare_exchange_weak(_Tp*&, _Tp*, memory_order, memory_order) volatile;
+
+ bool
+ compare_exchange_strong(_Tp*&, _Tp*, memory_order, memory_order) volatile;
+
+ bool
+ compare_exchange_weak(_Tp*&, _Tp*,
+ memory_order = memory_order_seq_cst) volatile;
+
+ bool
+ compare_exchange_strong(_Tp*&, _Tp*,
+ memory_order = memory_order_seq_cst) volatile;
+
+ _Tp*
+ fetch_add(ptrdiff_t, memory_order = memory_order_seq_cst) volatile;
+
+ _Tp*
+ fetch_sub(ptrdiff_t, memory_order = memory_order_seq_cst) volatile;
+
+ operator _Tp*() const volatile
+ { return load(); }
+
+ _Tp*
+ operator=(_Tp* __v) volatile
+ {
+ store(__v);
+ return __v;
+ }
+
+ _Tp*
+ operator++(int) volatile { return fetch_add(1); }
+
+ _Tp*
+ operator--(int) volatile { return fetch_sub(1); }
+
+ _Tp*
+ operator++() volatile { return fetch_add(1) + 1; }
+
+ _Tp*
+ operator--() volatile { return fetch_sub(1) - 1; }
+
+ _Tp*
+ operator+=(ptrdiff_t __d) volatile
+ { return fetch_add(__d) + __d; }
+
+ _Tp*
+ operator-=(ptrdiff_t __d) volatile
+ { return fetch_sub(__d) - __d; }
+ };
+
+
+ /// Explicit specialization for void*
+ template<>
+ struct atomic<void*> : public atomic_address
+ {
+ typedef void* __integral_type;
+ typedef atomic_address __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for bool.
+ template<>
+ struct atomic<bool> : public atomic_bool
+ {
+ typedef bool __integral_type;
+ typedef atomic_bool __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for char.
+ template<>
+ struct atomic<char> : public atomic_char
+ {
+ typedef char __integral_type;
+ typedef atomic_char __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for signed char.
+ template<>
+ struct atomic<signed char> : public atomic_schar
+ {
+ typedef signed char __integral_type;
+ typedef atomic_schar __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for unsigned char.
+ template<>
+ struct atomic<unsigned char> : public atomic_uchar
+ {
+ typedef unsigned char __integral_type;
+ typedef atomic_uchar __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for short.
+ template<>
+ struct atomic<short> : public atomic_short
+ {
+ typedef short __integral_type;
+ typedef atomic_short __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for unsigned short.
+ template<>
+ struct atomic<unsigned short> : public atomic_ushort
+ {
+ typedef unsigned short __integral_type;
+ typedef atomic_ushort __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for int.
+ template<>
+ struct atomic<int> : atomic_int
+ {
+ typedef int __integral_type;
+ typedef atomic_int __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for unsigned int.
+ template<>
+ struct atomic<unsigned int> : public atomic_uint
+ {
+ typedef unsigned int __integral_type;
+ typedef atomic_uint __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for long.
+ template<>
+ struct atomic<long> : public atomic_long
+ {
+ typedef long __integral_type;
+ typedef atomic_long __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for unsigned long.
+ template<>
+ struct atomic<unsigned long> : public atomic_ulong
+ {
+ typedef unsigned long __integral_type;
+ typedef atomic_ulong __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for long long.
+ template<>
+ struct atomic<long long> : public atomic_llong
+ {
+ typedef long long __integral_type;
+ typedef atomic_llong __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for unsigned long long.
+ template<>
+ struct atomic<unsigned long long> : public atomic_ullong
+ {
+ typedef unsigned long long __integral_type;
+ typedef atomic_ullong __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for wchar_t.
+ template<>
+ struct atomic<wchar_t> : public atomic_wchar_t
+ {
+ typedef wchar_t __integral_type;
+ typedef atomic_wchar_t __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for char16_t.
+ template<>
+ struct atomic<char16_t> : public atomic_char16_t
+ {
+ typedef char16_t __integral_type;
+ typedef atomic_char16_t __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+ /// Explicit specialization for char32_t.
+ template<>
+ struct atomic<char32_t> : public atomic_char32_t
+ {
+ typedef char32_t __integral_type;
+ typedef atomic_char32_t __base_type;
+
+ atomic() = default;
+ ~atomic() = default;
+ atomic(const atomic&) = delete;
+ atomic& operator=(const atomic&) = delete;
+
+ atomic(__integral_type __i) : __base_type(__i) { }
+
+ using __base_type::operator __integral_type;
+ using __base_type::operator=;
+ };
+
+
+ template<typename _Tp>
+ _Tp*
+ atomic<_Tp*>::load(memory_order __m) const volatile
+ { return static_cast<_Tp*>(atomic_address::load(__m)); }
+
+ template<typename _Tp>
+ _Tp*
+ atomic<_Tp*>::exchange(_Tp* __v, memory_order __m) volatile
+ { return static_cast<_Tp*>(atomic_address::exchange(__v, __m)); }
+
+ template<typename _Tp>
+ bool
+ atomic<_Tp*>::compare_exchange_weak(_Tp*& __r, _Tp* __v, memory_order __m1,
+ memory_order __m2) volatile
+ {
+ void** __vr = reinterpret_cast<void**>(&__r);
+ void* __vv = static_cast<void*>(__v);
+ return atomic_address::compare_exchange_weak(*__vr, __vv, __m1, __m2);
+ }
+
+ template<typename _Tp>
+ bool
+ atomic<_Tp*>::compare_exchange_strong(_Tp*& __r, _Tp* __v,
+ memory_order __m1,
+ memory_order __m2) volatile
+ {
+ void** __vr = reinterpret_cast<void**>(&__r);
+ void* __vv = static_cast<void*>(__v);
+ return atomic_address::compare_exchange_strong(*__vr, __vv, __m1, __m2);
+ }
+
+ template<typename _Tp>
+ bool
+ atomic<_Tp*>::compare_exchange_weak(_Tp*& __r, _Tp* __v,
+ memory_order __m) volatile
+ {
+ return compare_exchange_weak(__r, __v, __m,
+ __calculate_memory_order(__m));
+ }
+
+ template<typename _Tp>
+ bool
+ atomic<_Tp*>::compare_exchange_strong(_Tp*& __r, _Tp* __v,
+ memory_order __m) volatile
+ {
+ return compare_exchange_strong(__r, __v, __m,
+ __calculate_memory_order(__m));
+ }
+
+ template<typename _Tp>
+ _Tp*
+ atomic<_Tp*>::fetch_add(ptrdiff_t __d, memory_order __m) volatile
+ {
+ void* __p = atomic_fetch_add_explicit(this, sizeof(_Tp) * __d, __m);
+ return static_cast<_Tp*>(__p);
+ }
+
+ template<typename _Tp>
+ _Tp*
+ atomic<_Tp*>::fetch_sub(ptrdiff_t __d, memory_order __m) volatile
+ {
+ void* __p = atomic_fetch_sub_explicit(this, sizeof(_Tp) * __d, __m);
+ return static_cast<_Tp*>(__p);
+ }
+
+ // Convenience function definitions, atomic_flag.
+ inline bool
+ atomic_flag_test_and_set_explicit(volatile atomic_flag* __a, memory_order __m)
+ { return __a->test_and_set(__m); }
+
+ inline void
+ atomic_flag_clear_explicit(volatile atomic_flag* __a, memory_order __m)
+ { return __a->clear(__m); }
+
+
+ // Convenience function definitions, atomic_address.
+ inline bool
+ atomic_is_lock_free(const volatile atomic_address* __a)
+ { return __a->is_lock_free(); }
+
+ inline void
+ atomic_store(volatile atomic_address* __a, void* __v)
+ { __a->store(__v); }
+
+ inline void
+ atomic_store_explicit(volatile atomic_address* __a, void* __v,
+ memory_order __m)
+ { __a->store(__v, __m); }
+
+ inline void*
+ atomic_load(const volatile atomic_address* __a)
+ { return __a->load(); }
+
+ inline void*
+ atomic_load_explicit(const volatile atomic_address* __a, memory_order __m)
+ { return __a->load(__m); }
+
+ inline void*
+ atomic_exchange(volatile atomic_address* __a, void* __v)
+ { return __a->exchange(__v); }
+
+ inline void*
+ atomic_exchange_explicit(volatile atomic_address* __a, void* __v,
+ memory_order __m)
+ { return __a->exchange(__v, __m); }
+
+ inline bool
+ atomic_compare_exchange_weak(volatile atomic_address* __a,
+ void** __v1, void* __v2)
+ {
+ return __a->compare_exchange_weak(*__v1, __v2, memory_order_seq_cst,
+ memory_order_seq_cst);
+ }
+
+ inline bool
+ atomic_compare_exchange_strong(volatile atomic_address* __a,
+ void** __v1, void* __v2)
+ {
+ return __a->compare_exchange_strong(*__v1, __v2, memory_order_seq_cst,
+ memory_order_seq_cst);
+ }
+
+ inline bool
+ atomic_compare_exchange_weak_explicit(volatile atomic_address* __a,
+ void** __v1, void* __v2,
+ memory_order __m1, memory_order __m2)
+ { return __a->compare_exchange_weak(*__v1, __v2, __m1, __m2); }
+
+ inline bool
+ atomic_compare_exchange_strong_explicit(volatile atomic_address* __a,
+ void** __v1, void* __v2,
+ memory_order __m1, memory_order __m2)
+ { return __a->compare_exchange_strong(*__v1, __v2, __m1, __m2); }
+
+ inline void*
+ atomic_fetch_add_explicit(volatile atomic_address* __a, ptrdiff_t __d,
+ memory_order __m)
+ { return __a->fetch_add(__d, __m); }
+
+ inline void*
+ atomic_fetch_add(volatile atomic_address* __a, ptrdiff_t __d)
+ { return __a->fetch_add(__d); }
+
+ inline void*
+ atomic_fetch_sub_explicit(volatile atomic_address* __a, ptrdiff_t __d,
+ memory_order __m)
+ { return __a->fetch_sub(__d, __m); }
+
+ inline void*
+ atomic_fetch_sub(volatile atomic_address* __a, ptrdiff_t __d)
+ { return __a->fetch_sub(__d); }
+
+
+ // Convenience function definitions, atomic_bool.
+ inline bool
+ atomic_is_lock_free(const volatile atomic_bool* __a)
+ { return __a->is_lock_free(); }
+
+ inline void
+ atomic_store(volatile atomic_bool* __a, bool __i)
+ { __a->store(__i); }
+
+ inline void
+ atomic_store_explicit(volatile atomic_bool* __a, bool __i, memory_order __m)
+ { __a->store(__i, __m); }
+
+ inline bool
+ atomic_load(const volatile atomic_bool* __a)
+ { return __a->load(); }
+
+ inline bool
+ atomic_load_explicit(const volatile atomic_bool* __a, memory_order __m)
+ { return __a->load(__m); }
+
+ inline bool
+ atomic_exchange(volatile atomic_bool* __a, bool __i)
+ { return __a->exchange(__i); }
+
+ inline bool
+ atomic_exchange_explicit(volatile atomic_bool* __a, bool __i,
+ memory_order __m)
+ { return __a->exchange(__i, __m); }
+
+ inline bool
+ atomic_compare_exchange_weak(volatile atomic_bool* __a, bool* __i1, bool __i2)
+ {
+ return __a->compare_exchange_weak(*__i1, __i2, memory_order_seq_cst,
+ memory_order_seq_cst);
+ }
+
+ inline bool
+ atomic_compare_exchange_strong(volatile atomic_bool* __a,
+ bool* __i1, bool __i2)
+ {
+ return __a->compare_exchange_strong(*__i1, __i2, memory_order_seq_cst,
+ memory_order_seq_cst);
+ }
+
+ inline bool
+ atomic_compare_exchange_weak_explicit(volatile atomic_bool* __a, bool* __i1,
+ bool __i2, memory_order __m1,
+ memory_order __m2)
+ { return __a->compare_exchange_weak(*__i1, __i2, __m1, __m2); }
+
+ inline bool
+ atomic_compare_exchange_strong_explicit(volatile atomic_bool* __a,
+ bool* __i1, bool __i2,
+ memory_order __m1, memory_order __m2)
+ { return __a->compare_exchange_strong(*__i1, __i2, __m1, __m2); }
+
+
+
+ // Free standing functions. Template argument should be constricted
+ // to intergral types as specified in the standard.
+ template<typename _ITp>
+ inline void
+ atomic_store_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+ memory_order __m)
+ { __a->store(__i, __m); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_load_explicit(const volatile __atomic_base<_ITp>* __a,
+ memory_order __m)
+ { return __a->load(__m); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_exchange_explicit(volatile __atomic_base<_ITp>* __a,
+ _ITp __i, memory_order __m)
+ { return __a->exchange(__i, __m); }
+
+ template<typename _ITp>
+ inline bool
+ atomic_compare_exchange_weak_explicit(volatile __atomic_base<_ITp>* __a,
+ _ITp* __i1, _ITp __i2,
+ memory_order __m1, memory_order __m2)
+ { return __a->compare_exchange_weak(*__i1, __i2, __m1, __m2); }
+
+ template<typename _ITp>
+ inline bool
+ atomic_compare_exchange_strong_explicit(volatile __atomic_base<_ITp>* __a,
+ _ITp* __i1, _ITp __i2,
+ memory_order __m1,
+ memory_order __m2)
+ { return __a->compare_exchange_strong(*__i1, __i2, __m1, __m2); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_fetch_add_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+ memory_order __m)
+ { return __a->fetch_add(__i, __m); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_fetch_sub_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+ memory_order __m)
+ { return __a->fetch_sub(__i, __m); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_fetch_and_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+ memory_order __m)
+ { return __a->fetch_and(__i, __m); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_fetch_or_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+ memory_order __m)
+ { return __a->fetch_or(__i, __m); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_fetch_xor_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+ memory_order __m)
+ { return __a->fetch_xor(__i, __m); }
+
+ template<typename _ITp>
+ inline bool
+ atomic_is_lock_free(const volatile __atomic_base<_ITp>* __a)
+ { return __a->is_lock_free(); }
+
+ template<typename _ITp>
+ inline void
+ atomic_store(volatile __atomic_base<_ITp>* __a, _ITp __i)
+ { atomic_store_explicit(__a, __i, memory_order_seq_cst); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_load(const volatile __atomic_base<_ITp>* __a)
+ { return atomic_load_explicit(__a, memory_order_seq_cst); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_exchange(volatile __atomic_base<_ITp>* __a, _ITp __i)
+ { return atomic_exchange_explicit(__a, __i, memory_order_seq_cst); }
+
+ template<typename _ITp>
+ inline bool
+ atomic_compare_exchange_weak(volatile __atomic_base<_ITp>* __a,
+ _ITp* __i1, _ITp __i2)
+ {
+ return atomic_compare_exchange_weak_explicit(__a, __i1, __i2,
+ memory_order_seq_cst,
+ memory_order_seq_cst);
+ }
+
+ template<typename _ITp>
+ inline bool
+ atomic_compare_exchange_strong(volatile __atomic_base<_ITp>* __a,
+ _ITp* __i1, _ITp __i2)
+ {
+ return atomic_compare_exchange_strong_explicit(__a, __i1, __i2,
+ memory_order_seq_cst,
+ memory_order_seq_cst);
+ }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_fetch_add(volatile __atomic_base<_ITp>* __a, _ITp __i)
+ { return atomic_fetch_add_explicit(__a, __i, memory_order_seq_cst); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_fetch_sub(volatile __atomic_base<_ITp>* __a, _ITp __i)
+ { return atomic_fetch_sub_explicit(__a, __i, memory_order_seq_cst); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_fetch_and(volatile __atomic_base<_ITp>* __a, _ITp __i)
+ { return atomic_fetch_and_explicit(__a, __i, memory_order_seq_cst); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_fetch_or(volatile __atomic_base<_ITp>* __a, _ITp __i)
+ { return atomic_fetch_or_explicit(__a, __i, memory_order_seq_cst); }
+
+ template<typename _ITp>
+ inline _ITp
+ atomic_fetch_xor(volatile __atomic_base<_ITp>* __a, _ITp __i)
+ { return atomic_fetch_xor_explicit(__a, __i, memory_order_seq_cst); }
+
+ // @} group atomics
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdbool b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdbool
new file mode 100644
index 0000000..3012c46
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdbool
@@ -0,0 +1,44 @@
+// <cstdbool> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cstdbool
+ * This is a Standard C++ Library header.
+ */
+
+#pragma GCC system_header
+
+#ifndef _GLIBCXX_CSTDBOOL
+#define _GLIBCXX_CSTDBOOL 1
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+# include <bits/c++config.h>
+# if _GLIBCXX_HAVE_STDBOOL_H
+# include <stdbool.h>
+# endif
+#endif
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstddef b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstddef
new file mode 100644
index 0000000..bb16e75
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstddef
@@ -0,0 +1,56 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file cstddef
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c stddef.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 18.1 Types
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <stddef.h>
+
+#ifndef _GLIBCXX_CSTDDEF
+#define _GLIBCXX_CSTDDEF 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::ptrdiff_t;
+ using ::size_t;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdint b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdint
new file mode 100644
index 0000000..0927f8a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdint
@@ -0,0 +1,79 @@
+// <cstdint> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cstdint
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_CSTDINT
+#define _GLIBCXX_CSTDINT 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <bits/c++config.h>
+
+// For 8.22.1/1 (see C99, Notes 219, 220, 222)
+#if _GLIBCXX_HAVE_STDINT_H
+# ifndef __STDC_LIMIT_MACROS
+# define _UNDEF__STDC_LIMIT_MACROS
+# define __STDC_LIMIT_MACROS
+# endif
+# ifndef __STDC_CONSTANT_MACROS
+# define _UNDEF__STDC_CONSTANT_MACROS
+# define __STDC_CONSTANT_MACROS
+# endif
+# include <stdint.h>
+# ifdef _UNDEF__STDC_LIMIT_MACROS
+# undef __STDC_LIMIT_MACROS
+# undef _UNDEF__STDC_LIMIT_MACROS
+# endif
+# ifdef _UNDEF__STDC_CONSTANT_MACROS
+# undef __STDC_CONSTANT_MACROS
+# undef _UNDEF__STDC_CONSTANT_MACROS
+# endif
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/cstdint>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/cstdint>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+#endif // _GLIBCXX_CSTDINT
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdio b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdio
new file mode 100644
index 0000000..93ab5ea
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdio
@@ -0,0 +1,205 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cstdio
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c stdio.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 27.8.2 C Library files
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <cstddef>
+#include <stdio.h>
+
+#ifndef _GLIBCXX_CSTDIO
+#define _GLIBCXX_CSTDIO 1
+
+// Get rid of those macros defined in <stdio.h> in lieu of real functions.
+#undef clearerr
+#undef fclose
+#undef feof
+#undef ferror
+#undef fflush
+#undef fgetc
+#undef fgetpos
+#undef fgets
+#undef fopen
+#undef fprintf
+#undef fputc
+#undef fputs
+#undef fread
+#undef freopen
+#undef fscanf
+#undef fseek
+#undef fsetpos
+#undef ftell
+#undef fwrite
+#undef getc
+#undef getchar
+#undef gets
+#undef perror
+#undef printf
+#undef putc
+#undef putchar
+#undef puts
+#undef remove
+#undef rename
+#undef rewind
+#undef scanf
+#undef setbuf
+#undef setvbuf
+#undef sprintf
+#undef sscanf
+#undef tmpfile
+#undef tmpnam
+#undef ungetc
+#undef vfprintf
+#undef vprintf
+#undef vsprintf
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::FILE;
+ using ::fpos_t;
+
+ using ::clearerr;
+ using ::fclose;
+ using ::feof;
+ using ::ferror;
+ using ::fflush;
+ using ::fgetc;
+ using ::fgetpos;
+ using ::fgets;
+ using ::fopen;
+ using ::fprintf;
+ using ::fputc;
+ using ::fputs;
+ using ::fread;
+ using ::freopen;
+ using ::fscanf;
+ using ::fseek;
+ using ::fsetpos;
+ using ::ftell;
+ using ::fwrite;
+ using ::getc;
+ using ::getchar;
+ using ::gets;
+ using ::perror;
+ using ::printf;
+ using ::putc;
+ using ::putchar;
+ using ::puts;
+ using ::remove;
+ using ::rename;
+ using ::rewind;
+ using ::scanf;
+ using ::setbuf;
+ using ::setvbuf;
+ using ::sprintf;
+ using ::sscanf;
+ using ::tmpfile;
+ using ::tmpnam;
+ using ::ungetc;
+ using ::vfprintf;
+ using ::vprintf;
+ using ::vsprintf;
+
+_GLIBCXX_END_NAMESPACE
+
+#if _GLIBCXX_USE_C99 || defined __UCLIBC__
+
+#undef snprintf
+#undef vfscanf
+#undef vscanf
+#undef vsnprintf
+#undef vsscanf
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
+ extern "C" int
+ (snprintf)(char * restrict, size_t, const char * restrict, ...);
+ extern "C" int
+ (vfscanf)(FILE * restrict, const char * restrict, __gnuc_va_list);
+ extern "C" int (vscanf)(const char * restrict, __gnuc_va_list);
+ extern "C" int
+ (vsnprintf)(char * restrict, size_t, const char * restrict, __gnuc_va_list);
+ extern "C" int
+ (vsscanf)(const char * restrict, const char * restrict, __gnuc_va_list);
+#endif
+
+#if !_GLIBCXX_USE_C99_DYNAMIC
+ using ::snprintf;
+ using ::vfscanf;
+ using ::vscanf;
+ using ::vsnprintf;
+ using ::vsscanf;
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::__gnu_cxx::snprintf;
+ using ::__gnu_cxx::vfscanf;
+ using ::__gnu_cxx::vscanf;
+ using ::__gnu_cxx::vsnprintf;
+ using ::__gnu_cxx::vsscanf;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif // _GLIBCXX_USE_C99
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/cstdio>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/cstdio>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdlib b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdlib
new file mode 100644
index 0000000..a29031e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstdlib
@@ -0,0 +1,242 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cstdlib
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c stdlib.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 20.4.6 C library
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <cstddef>
+
+#ifndef _GLIBCXX_CSTDLIB
+#define _GLIBCXX_CSTDLIB 1
+
+#if !_GLIBCXX_HOSTED
+// The C standard does not require a freestanding implementation to
+// provide <stdlib.h>. However, the C++ standard does still require
+// <cstdlib> -- but only the functionality mentioned in
+// [lib.support.start.term].
+
+#define EXIT_SUCCESS 0
+#define EXIT_FAILURE 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ extern "C" void abort(void);
+ extern "C" int atexit(void (*)());
+ extern "C" void exit(int);
+
+_GLIBCXX_END_NAMESPACE
+
+#else
+
+#include <stdlib.h>
+
+// Get rid of those macros defined in <stdlib.h> in lieu of real functions.
+#undef abort
+#undef abs
+#undef atexit
+#undef atof
+#undef atoi
+#undef atol
+#undef bsearch
+#undef calloc
+#undef div
+#undef exit
+#undef free
+#undef getenv
+#undef labs
+#undef ldiv
+#undef malloc
+#undef mblen
+#undef mbstowcs
+#undef mbtowc
+#undef qsort
+#undef rand
+#undef realloc
+#undef srand
+#undef strtod
+#undef strtol
+#undef strtoul
+#undef system
+#undef wcstombs
+#undef wctomb
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::div_t;
+ using ::ldiv_t;
+
+ using ::abort;
+ using ::abs;
+ using ::atexit;
+ using ::atof;
+ using ::atoi;
+ using ::atol;
+ using ::bsearch;
+ using ::calloc;
+ using ::div;
+ using ::exit;
+ using ::free;
+ using ::getenv;
+ using ::labs;
+ using ::ldiv;
+ using ::malloc;
+#ifdef _GLIBCXX_HAVE_MBSTATE_T
+ using ::mblen;
+ using ::mbstowcs;
+ using ::mbtowc;
+#endif // _GLIBCXX_HAVE_MBSTATE_T
+ using ::qsort;
+ using ::rand;
+ using ::realloc;
+ using ::srand;
+ using ::strtod;
+ using ::strtol;
+ using ::strtoul;
+ using ::system;
+#ifdef _GLIBCXX_USE_WCHAR_T
+ using ::wcstombs;
+ using ::wctomb;
+#endif // _GLIBCXX_USE_WCHAR_T
+
+ inline long
+ abs(long __i) { return labs(__i); }
+
+ inline ldiv_t
+ div(long __i, long __j) { return ldiv(__i, __j); }
+
+_GLIBCXX_END_NAMESPACE
+
+#if _GLIBCXX_USE_C99
+
+#undef _Exit
+#undef llabs
+#undef lldiv
+#undef atoll
+#undef strtoll
+#undef strtoull
+#undef strtof
+#undef strtold
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+ using ::lldiv_t;
+#endif
+#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
+ extern "C" void (_Exit)(int);
+#endif
+#if !_GLIBCXX_USE_C99_DYNAMIC
+ using ::_Exit;
+#endif
+
+ inline long long
+ abs(long long __x) { return __x >= 0 ? __x : -__x; }
+
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+ using ::llabs;
+
+ inline lldiv_t
+ div(long long __n, long long __d)
+ { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
+
+ using ::lldiv;
+#endif
+
+#if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+ extern "C" long long int (atoll)(const char *);
+ extern "C" long long int
+ (strtoll)(const char * restrict, char ** restrict, int);
+ extern "C" unsigned long long int
+ (strtoull)(const char * restrict, char ** restrict, int);
+#endif
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+ using ::atoll;
+ using ::strtoll;
+ using ::strtoull;
+#endif
+ using ::strtof;
+ using ::strtold;
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+ using ::__gnu_cxx::lldiv_t;
+#endif
+ using ::__gnu_cxx::_Exit;
+ using ::__gnu_cxx::abs;
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+ using ::__gnu_cxx::llabs;
+ using ::__gnu_cxx::div;
+ using ::__gnu_cxx::lldiv;
+#endif
+ using ::__gnu_cxx::atoll;
+ using ::__gnu_cxx::strtof;
+ using ::__gnu_cxx::strtoll;
+ using ::__gnu_cxx::strtoull;
+ using ::__gnu_cxx::strtold;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif // _GLIBCXX_USE_C99
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/cstdlib>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/cstdlib>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+#endif
+
+#endif // !_GLIBCXX_HOSTED
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstring b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstring
new file mode 100644
index 0000000..de0ce24
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cstring
@@ -0,0 +1,123 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file cstring
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c string.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 20.4.6 C library
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <cstddef>
+#include <string.h>
+
+#ifndef _GLIBCXX_CSTRING
+#define _GLIBCXX_CSTRING 1
+
+// Get rid of those macros defined in <string.h> in lieu of real functions.
+#undef memchr
+#undef memcmp
+#undef memcpy
+#undef memmove
+#undef memset
+#undef strcat
+#undef strchr
+#undef strcmp
+#undef strcoll
+#undef strcpy
+#undef strcspn
+#undef strerror
+#undef strlen
+#undef strncat
+#undef strncmp
+#undef strncpy
+#undef strpbrk
+#undef strrchr
+#undef strspn
+#undef strstr
+#undef strtok
+#undef strxfrm
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::memchr;
+ using ::memcmp;
+ using ::memcpy;
+ using ::memmove;
+ using ::memset;
+ using ::strcat;
+ using ::strcmp;
+ using ::strcoll;
+ using ::strcpy;
+ using ::strcspn;
+ using ::strerror;
+ using ::strlen;
+ using ::strncat;
+ using ::strncmp;
+ using ::strncpy;
+ using ::strspn;
+ using ::strtok;
+ using ::strxfrm;
+ using ::strchr;
+ using ::strpbrk;
+ using ::strrchr;
+ using ::strstr;
+
+#ifndef __CORRECT_ISO_CPP_STRING_H_PROTO
+ inline void*
+ memchr(void* __p, int __c, size_t __n)
+ { return memchr(const_cast<const void*>(__p), __c, __n); }
+
+ inline char*
+ strchr(char* __s1, int __n)
+ { return __builtin_strchr(const_cast<const char*>(__s1), __n); }
+
+ inline char*
+ strpbrk(char* __s1, const char* __s2)
+ { return __builtin_strpbrk(const_cast<const char*>(__s1), __s2); }
+
+ inline char*
+ strrchr(char* __s1, int __n)
+ { return __builtin_strrchr(const_cast<const char*>(__s1), __n); }
+
+ inline char*
+ strstr(char* __s1, const char* __s2)
+ { return __builtin_strstr(const_cast<const char*>(__s1), __s2); }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ctgmath b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ctgmath
new file mode 100644
index 0000000..3c6fcf7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ctgmath
@@ -0,0 +1,41 @@
+// <ctgmath> -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/ctgmath
+ * This is a Standard C++ Library header.
+ */
+
+#pragma GCC system_header
+
+#ifndef _GLIBCXX_CTGMATH
+#define _GLIBCXX_CTGMATH 1
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+# include <cmath>
+#endif
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ctime b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ctime
new file mode 100644
index 0000000..e236cf4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ctime
@@ -0,0 +1,78 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/ctime
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c time.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 20.5 Date and time
+//
+
+#pragma GCC system_header
+
+#include <cstddef>
+#include <time.h>
+
+#ifndef _GLIBCXX_CTIME
+#define _GLIBCXX_CTIME 1
+
+// Get rid of those macros defined in <time.h> in lieu of real functions.
+#undef clock
+#undef difftime
+#undef mktime
+#undef time
+#undef asctime
+#undef ctime
+#undef gmtime
+#undef localtime
+#undef strftime
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::clock_t;
+ using ::time_t;
+ using ::tm;
+
+ using ::clock;
+ using ::difftime;
+ using ::mktime;
+ using ::time;
+ using ::asctime;
+ using ::ctime;
+ using ::gmtime;
+ using ::localtime;
+ using ::strftime;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cwchar b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cwchar
new file mode 100644
index 0000000..e5ea07e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cwchar
@@ -0,0 +1,291 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cwchar
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c wchar.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: 21.4
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <cstddef>
+
+#if _GLIBCXX_HAVE_WCHAR_H
+#include <wchar.h>
+#endif
+
+#ifndef _GLIBCXX_CWCHAR
+#define _GLIBCXX_CWCHAR 1
+
+// Need to do a bit of trickery here with mbstate_t as char_traits
+// assumes it is in wchar.h, regardless of wchar_t specializations.
+#ifndef _GLIBCXX_HAVE_MBSTATE_T
+extern "C"
+{
+ typedef struct
+ {
+ int __fill[6];
+ } mbstate_t;
+}
+#endif
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::mbstate_t;
+
+_GLIBCXX_END_NAMESPACE
+
+// Get rid of those macros defined in <wchar.h> in lieu of real functions.
+#undef btowc
+#undef fgetwc
+#undef fgetws
+#undef fputwc
+#undef fputws
+#undef fwide
+#undef fwprintf
+#undef fwscanf
+#undef getwc
+#undef getwchar
+#undef mbrlen
+#undef mbrtowc
+#undef mbsinit
+#undef mbsrtowcs
+#undef putwc
+#undef putwchar
+#undef swprintf
+#undef swscanf
+#undef ungetwc
+#undef vfwprintf
+#if _GLIBCXX_HAVE_VFWSCANF
+# undef vfwscanf
+#endif
+#undef vswprintf
+#if _GLIBCXX_HAVE_VSWSCANF
+# undef vswscanf
+#endif
+#undef vwprintf
+#if _GLIBCXX_HAVE_VWSCANF
+# undef vwscanf
+#endif
+#undef wcrtomb
+#undef wcscat
+#undef wcschr
+#undef wcscmp
+#undef wcscoll
+#undef wcscpy
+#undef wcscspn
+#undef wcsftime
+#undef wcslen
+#undef wcsncat
+#undef wcsncmp
+#undef wcsncpy
+#undef wcspbrk
+#undef wcsrchr
+#undef wcsrtombs
+#undef wcsspn
+#undef wcsstr
+#undef wcstod
+#if _GLIBCXX_HAVE_WCSTOF
+# undef wcstof
+#endif
+#undef wcstok
+#undef wcstol
+#undef wcstoul
+#undef wcsxfrm
+#undef wctob
+#undef wmemchr
+#undef wmemcmp
+#undef wmemcpy
+#undef wmemmove
+#undef wmemset
+#undef wprintf
+#undef wscanf
+
+#if _GLIBCXX_USE_WCHAR_T
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::wint_t;
+
+ using ::btowc;
+ using ::fgetwc;
+ using ::fgetws;
+ using ::fputwc;
+ using ::fputws;
+ using ::fwide;
+ using ::fwprintf;
+ using ::fwscanf;
+ using ::getwc;
+ using ::getwchar;
+ using ::mbrlen;
+ using ::mbrtowc;
+ using ::mbsinit;
+ using ::mbsrtowcs;
+ using ::putwc;
+ using ::putwchar;
+ using ::swprintf;
+ using ::swscanf;
+ using ::ungetwc;
+ using ::vfwprintf;
+#if _GLIBCXX_HAVE_VFWSCANF
+ using ::vfwscanf;
+#endif
+ using ::vswprintf;
+#if _GLIBCXX_HAVE_VSWSCANF
+ using ::vswscanf;
+#endif
+ using ::vwprintf;
+#if _GLIBCXX_HAVE_VWSCANF
+ using ::vwscanf;
+#endif
+ using ::wcrtomb;
+ using ::wcscat;
+ using ::wcscmp;
+ using ::wcscoll;
+ using ::wcscpy;
+ using ::wcscspn;
+ using ::wcsftime;
+ using ::wcslen;
+ using ::wcsncat;
+ using ::wcsncmp;
+ using ::wcsncpy;
+ using ::wcsrtombs;
+ using ::wcsspn;
+ using ::wcstod;
+#if _GLIBCXX_HAVE_WCSTOF
+ using ::wcstof;
+#endif
+ using ::wcstok;
+ using ::wcstol;
+ using ::wcstoul;
+ using ::wcsxfrm;
+ using ::wctob;
+ using ::wmemcmp;
+ using ::wmemcpy;
+ using ::wmemmove;
+ using ::wmemset;
+ using ::wprintf;
+ using ::wscanf;
+ using ::wcschr;
+ using ::wcspbrk;
+ using ::wcsrchr;
+ using ::wcsstr;
+ using ::wmemchr;
+
+#ifndef __CORRECT_ISO_CPP_WCHAR_H_PROTO
+ inline wchar_t*
+ wcschr(wchar_t* __p, wchar_t __c)
+ { return wcschr(const_cast<const wchar_t*>(__p), __c); }
+
+ inline wchar_t*
+ wcspbrk(wchar_t* __s1, const wchar_t* __s2)
+ { return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
+
+ inline wchar_t*
+ wcsrchr(wchar_t* __p, wchar_t __c)
+ { return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
+
+ inline wchar_t*
+ wcsstr(wchar_t* __s1, const wchar_t* __s2)
+ { return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
+
+ inline wchar_t*
+ wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
+ { return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#if _GLIBCXX_USE_C99
+
+#undef wcstold
+#undef wcstoll
+#undef wcstoull
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
+ extern "C" long double
+ (wcstold)(const wchar_t * restrict, wchar_t ** restrict);
+#endif
+#if !_GLIBCXX_USE_C99_DYNAMIC
+ using ::wcstold;
+#endif
+#if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+ extern "C" long long int
+ (wcstoll)(const wchar_t * restrict, wchar_t ** restrict, int);
+ extern "C" unsigned long long int
+ (wcstoull)(const wchar_t * restrict, wchar_t ** restrict, int);
+#endif
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+ using ::wcstoll;
+ using ::wcstoull;
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::__gnu_cxx::wcstold;
+ using ::__gnu_cxx::wcstoll;
+ using ::__gnu_cxx::wcstoull;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
+#endif //_GLIBCXX_USE_WCHAR_T
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/cwchar>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/cwchar>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cwctype b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cwctype
new file mode 100644
index 0000000..4e94fec
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cwctype
@@ -0,0 +1,126 @@
+// -*- C++ -*- forwarding header.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/cwctype
+ * This is a Standard C++ Library file. You should @c #include this file
+ * in your programs, rather than any of the "*.h" implementation files.
+ *
+ * This is the C++ version of the Standard C Library header @c wctype.h,
+ * and its contents are (mostly) the same as that header, but are all
+ * contained in the namespace @c std (except for names which are defined
+ * as macros in C).
+ */
+
+//
+// ISO C++ 14882: <cwctype>
+//
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+
+#if _GLIBCXX_HAVE_WCTYPE_H
+#include <wctype.h>
+#endif
+
+#ifndef _GLIBCXX_CWCTYPE
+#define _GLIBCXX_CWCTYPE 1
+
+// Get rid of those macros defined in <wctype.h> in lieu of real functions.
+#undef iswalnum
+#undef iswalpha
+#if _GLIBCXX_HAVE_ISWBLANK
+# undef iswblank
+#endif
+#undef iswcntrl
+#undef iswctype
+#undef iswdigit
+#undef iswgraph
+#undef iswlower
+#undef iswprint
+#undef iswpunct
+#undef iswspace
+#undef iswupper
+#undef iswxdigit
+#undef towctrans
+#undef towlower
+#undef towupper
+#undef wctrans
+#undef wctype
+
+#if _GLIBCXX_USE_WCHAR_T
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using ::wctrans_t;
+ using ::wctype_t;
+ using ::wint_t;
+
+ using ::iswalnum;
+ using ::iswalpha;
+#if _GLIBCXX_HAVE_ISWBLANK
+ using ::iswblank;
+#endif
+ using ::iswcntrl;
+ using ::iswctype;
+ using ::iswdigit;
+ using ::iswgraph;
+ using ::iswlower;
+ using ::iswprint;
+ using ::iswpunct;
+ using ::iswspace;
+ using ::iswupper;
+ using ::iswxdigit;
+ using ::towctrans;
+ using ::towlower;
+ using ::towupper;
+ using ::wctrans;
+ using ::wctype;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif //_GLIBCXX_USE_WCHAR_T
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/cwctype>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/cwctype>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cxxabi-forced.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cxxabi-forced.h
new file mode 100644
index 0000000..e0cf1d0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cxxabi-forced.h
@@ -0,0 +1,51 @@
+// cxxabi.h subset for inclusion by other library headers -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// GCC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef _CXXABI_FORCED_H
+#define _CXXABI_FORCED_H 1
+
+#pragma GCC visibility push(default)
+
+#ifdef __cplusplus
+namespace __cxxabiv1
+{
+ /**
+ * @brief Thrown as part of forced unwinding.
+ * @ingroup exceptions
+ *
+ * A magic placeholder class that can be caught by reference to
+ * recognize forced unwinding.
+ */
+ class __forced_unwind
+ {
+ virtual ~__forced_unwind() throw();
+ virtual void __pure_dummy() = 0; // prevent catch by value
+ };
+}
+#endif // __cplusplus
+
+#pragma GCC visibility pop
+
+#endif // __CXXABI_FORCED_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cxxabi.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cxxabi.h
new file mode 100644
index 0000000..bfdd8e5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/cxxabi.h
@@ -0,0 +1,608 @@
+// new abi support -*- C++ -*-
+
+// Copyright (C) 2000, 2002, 2003, 2004, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// GCC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Written by Nathan Sidwell, Codesourcery LLC, <nathan@codesourcery.com>
+
+/* This file declares the new abi entry points into the runtime. It is not
+ normally necessary for user programs to include this header, or use the
+ entry points directly. However, this header is available should that be
+ needed.
+
+ Some of the entry points are intended for both C and C++, thus this header
+ is includable from both C and C++. Though the C++ specific parts are not
+ available in C, naturally enough. */
+
+/** @file cxxabi.h
+ * The header provides an interface to the C++ ABI.
+ */
+
+#ifndef _CXXABI_H
+#define _CXXABI_H 1
+
+#pragma GCC visibility push(default)
+
+#include <stddef.h>
+#include <bits/cxxabi_tweaks.h>
+#include <cxxabi-forced.h>
+
+#ifdef __cplusplus
+#define _GLIBCXX_NOTHROW throw()
+#else
+#define _GLIBCXX_NOTHROW __attribute__((nothrow))
+#endif
+
+#ifdef __cplusplus
+namespace __cxxabiv1
+{
+ extern "C"
+ {
+#endif
+
+ typedef __cxa_cdtor_return_type (*__cxa_cdtor_type)(void *);
+
+ // Allocate array.
+ void*
+ __cxa_vec_new(size_t __element_count, size_t __element_size,
+ size_t __padding_size, __cxa_cdtor_type constructor,
+ __cxa_cdtor_type destructor);
+
+ void*
+ __cxa_vec_new2(size_t __element_count, size_t __element_size,
+ size_t __padding_size, __cxa_cdtor_type constructor,
+ __cxa_cdtor_type destructor, void *(*__alloc) (size_t),
+ void (*__dealloc) (void*));
+
+ void*
+ __cxa_vec_new3(size_t __element_count, size_t __element_size,
+ size_t __padding_size, __cxa_cdtor_type constructor,
+ __cxa_cdtor_type destructor, void *(*__alloc) (size_t),
+ void (*__dealloc) (void*, size_t));
+
+ // Construct array.
+ __cxa_vec_ctor_return_type
+ __cxa_vec_ctor(void* __array_address, size_t __element_count,
+ size_t __element_size, __cxa_cdtor_type constructor,
+ __cxa_cdtor_type destructor);
+
+ __cxa_vec_ctor_return_type
+ __cxa_vec_cctor(void* dest_array, void* src_array, size_t element_count,
+ size_t element_size,
+ __cxa_cdtor_return_type (*constructor) (void*, void*),
+ __cxa_cdtor_type destructor);
+
+ // Destruct array.
+ void
+ __cxa_vec_dtor(void* __array_address, size_t __element_count,
+ size_t __element_size, __cxa_cdtor_type destructor);
+
+ void
+ __cxa_vec_cleanup(void* __array_address, size_t __element_count,
+ size_t __element_size, __cxa_cdtor_type destructor);
+
+ // Destruct and release array.
+ void
+ __cxa_vec_delete(void* __array_address, size_t __element_size,
+ size_t __padding_size, __cxa_cdtor_type destructor);
+
+ void
+ __cxa_vec_delete2(void* __array_address, size_t __element_size,
+ size_t __padding_size, __cxa_cdtor_type destructor,
+ void (*__dealloc) (void*));
+
+ void
+ __cxa_vec_delete3(void* __array_address, size_t __element_size,
+ size_t __padding_size, __cxa_cdtor_type destructor,
+ void (*__dealloc) (void*, size_t));
+
+ int
+ __cxa_guard_acquire(__guard*);
+
+ void
+ __cxa_guard_release(__guard*);
+
+ void
+ __cxa_guard_abort(__guard*);
+
+ // Pure virtual functions.
+ void
+ __cxa_pure_virtual(void);
+
+ // Exception handling.
+ void
+ __cxa_bad_cast();
+
+ void
+ __cxa_bad_typeid();
+
+ // DSO destruction.
+ int
+ __cxa_atexit(void (*)(void*), void*, void*) _GLIBCXX_NOTHROW;
+
+ int
+ __cxa_finalize(void*);
+
+
+ /**
+ * @brief Demangling routine.
+ * ABI-mandated entry point in the C++ runtime library for demangling.
+ *
+ * @param __mangled_name A NUL-terminated character string
+ * containing the name to be demangled.
+ *
+ * @param __output_buffer A region of memory, allocated with
+ * malloc, of @a *__length bytes, into which the demangled name is
+ * stored. If @a __output_buffer is not long enough, it is
+ * expanded using realloc. @a __output_buffer may instead be NULL;
+ * in that case, the demangled name is placed in a region of memory
+ * allocated with malloc.
+ *
+ * @param __length If @a __length is non-NULL, the length of the
+ * buffer containing the demangled name is placed in @a *__length.
+ *
+ * @param __status @a *__status is set to one of the following values:
+ * 0: The demangling operation succeeded.
+ * -1: A memory allocation failiure occurred.
+ * -2: @a mangled_name is not a valid name under the C++ ABI mangling rules.
+ * -3: One of the arguments is invalid.
+ *
+ * @return A pointer to the start of the NUL-terminated demangled
+ * name, or NULL if the demangling fails. The caller is
+ * responsible for deallocating this memory using @c free.
+ *
+ * The demangling is performed using the C++ ABI mangling rules,
+ * with GNU extensions. For example, this function is used in
+ * __gnu_cxx::__verbose_terminate_handler.
+ *
+ * See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt12ch39.html
+ * for other examples of use.
+ *
+ * @note The same demangling functionality is available via
+ * libiberty (@c <libiberty/demangle.h> and @c libiberty.a) in GCC
+ * 3.1 and later, but that requires explicit installation (@c
+ * --enable-install-libiberty) and uses a different API, although
+ * the ABI is unchanged.
+ */
+ char*
+ __cxa_demangle(const char* __mangled_name, char* __output_buffer,
+ size_t* __length, int* __status);
+#ifdef __cplusplus
+ }
+} // namespace __cxxabiv1
+#endif
+
+#ifdef __cplusplus
+
+#include <typeinfo>
+
+namespace __cxxabiv1
+{
+ // Type information for int, float etc.
+ class __fundamental_type_info : public std::type_info
+ {
+ public:
+ explicit
+ __fundamental_type_info(const char* __n) : std::type_info(__n) { }
+
+ virtual
+ ~__fundamental_type_info();
+ };
+
+ // Type information for array objects.
+ class __array_type_info : public std::type_info
+ {
+ public:
+ explicit
+ __array_type_info(const char* __n) : std::type_info(__n) { }
+
+ virtual
+ ~__array_type_info();
+ };
+
+ // Type information for functions (both member and non-member).
+ class __function_type_info : public std::type_info
+ {
+ public:
+ explicit
+ __function_type_info(const char* __n) : std::type_info(__n) { }
+
+ virtual
+ ~__function_type_info();
+
+ protected:
+ // Implementation defined member function.
+ virtual bool
+ __is_function_p() const;
+ };
+
+ // Type information for enumerations.
+ class __enum_type_info : public std::type_info
+ {
+ public:
+ explicit
+ __enum_type_info(const char* __n) : std::type_info(__n) { }
+
+ virtual
+ ~__enum_type_info();
+ };
+
+ // Common type information for simple pointers and pointers to member.
+ class __pbase_type_info : public std::type_info
+ {
+ public:
+ unsigned int __flags; // Qualification of the target object.
+ const std::type_info* __pointee; // Type of pointed to object.
+
+ explicit
+ __pbase_type_info(const char* __n, int __quals,
+ const std::type_info* __type)
+ : std::type_info(__n), __flags(__quals), __pointee(__type)
+ { }
+
+ virtual
+ ~__pbase_type_info();
+
+ // Implementation defined type.
+ enum __masks
+ {
+ __const_mask = 0x1,
+ __volatile_mask = 0x2,
+ __restrict_mask = 0x4,
+ __incomplete_mask = 0x8,
+ __incomplete_class_mask = 0x10
+ };
+
+ protected:
+ __pbase_type_info(const __pbase_type_info&);
+
+ __pbase_type_info&
+ operator=(const __pbase_type_info&);
+
+ // Implementation defined member functions.
+ virtual bool
+ __do_catch(const std::type_info* __thr_type, void** __thr_obj,
+ unsigned int __outer) const;
+
+ inline virtual bool
+ __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
+ unsigned __outer) const;
+ };
+
+ // Type information for simple pointers.
+ class __pointer_type_info : public __pbase_type_info
+ {
+ public:
+ explicit
+ __pointer_type_info(const char* __n, int __quals,
+ const std::type_info* __type)
+ : __pbase_type_info (__n, __quals, __type) { }
+
+
+ virtual
+ ~__pointer_type_info();
+
+ protected:
+ // Implementation defined member functions.
+ virtual bool
+ __is_pointer_p() const;
+
+ virtual bool
+ __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
+ unsigned __outer) const;
+ };
+
+ class __class_type_info;
+
+ // Type information for a pointer to member variable.
+ class __pointer_to_member_type_info : public __pbase_type_info
+ {
+ public:
+ __class_type_info* __context; // Class of the member.
+
+ explicit
+ __pointer_to_member_type_info(const char* __n, int __quals,
+ const std::type_info* __type,
+ __class_type_info* __klass)
+ : __pbase_type_info(__n, __quals, __type), __context(__klass) { }
+
+ virtual
+ ~__pointer_to_member_type_info();
+
+ protected:
+ __pointer_to_member_type_info(const __pointer_to_member_type_info&);
+
+ __pointer_to_member_type_info&
+ operator=(const __pointer_to_member_type_info&);
+
+ // Implementation defined member function.
+ virtual bool
+ __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
+ unsigned __outer) const;
+ };
+
+ // Helper class for __vmi_class_type.
+ class __base_class_type_info
+ {
+ public:
+ const __class_type_info* __base_type; // Base class type.
+ long __offset_flags; // Offset and info.
+
+ enum __offset_flags_masks
+ {
+ __virtual_mask = 0x1,
+ __public_mask = 0x2,
+ __hwm_bit = 2,
+ __offset_shift = 8 // Bits to shift offset.
+ };
+
+ // Implementation defined member functions.
+ bool
+ __is_virtual_p() const
+ { return __offset_flags & __virtual_mask; }
+
+ bool
+ __is_public_p() const
+ { return __offset_flags & __public_mask; }
+
+ ptrdiff_t
+ __offset() const
+ {
+ // This shift, being of a signed type, is implementation
+ // defined. GCC implements such shifts as arithmetic, which is
+ // what we want.
+ return static_cast<ptrdiff_t>(__offset_flags) >> __offset_shift;
+ }
+ };
+
+ // Type information for a class.
+ class __class_type_info : public std::type_info
+ {
+ public:
+ explicit
+ __class_type_info (const char *__n) : type_info(__n) { }
+
+ virtual
+ ~__class_type_info ();
+
+ // Implementation defined types.
+ // The type sub_kind tells us about how a base object is contained
+ // within a derived object. We often do this lazily, hence the
+ // UNKNOWN value. At other times we may use NOT_CONTAINED to mean
+ // not publicly contained.
+ enum __sub_kind
+ {
+ // We have no idea.
+ __unknown = 0,
+
+ // Not contained within us (in some circumstances this might
+ // mean not contained publicly)
+ __not_contained,
+
+ // Contained ambiguously.
+ __contained_ambig,
+
+ // Via a virtual path.
+ __contained_virtual_mask = __base_class_type_info::__virtual_mask,
+
+ // Via a public path.
+ __contained_public_mask = __base_class_type_info::__public_mask,
+
+ // Contained within us.
+ __contained_mask = 1 << __base_class_type_info::__hwm_bit,
+
+ __contained_private = __contained_mask,
+ __contained_public = __contained_mask | __contained_public_mask
+ };
+
+ struct __upcast_result;
+ struct __dyncast_result;
+
+ protected:
+ // Implementation defined member functions.
+ virtual bool
+ __do_upcast(const __class_type_info* __dst_type, void**__obj_ptr) const;
+
+ virtual bool
+ __do_catch(const type_info* __thr_type, void** __thr_obj,
+ unsigned __outer) const;
+
+ public:
+ // Helper for upcast. See if DST is us, or one of our bases.
+ // Return false if not found, true if found.
+ virtual bool
+ __do_upcast(const __class_type_info* __dst, const void* __obj,
+ __upcast_result& __restrict __result) const;
+
+ // Indicate whether SRC_PTR of type SRC_TYPE is contained publicly
+ // within OBJ_PTR. OBJ_PTR points to a base object of our type,
+ // which is the destination type. SRC2DST indicates how SRC
+ // objects might be contained within this type. If SRC_PTR is one
+ // of our SRC_TYPE bases, indicate the virtuality. Returns
+ // not_contained for non containment or private containment.
+ inline __sub_kind
+ __find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
+ const __class_type_info* __src_type,
+ const void* __src_ptr) const;
+
+ // Helper for dynamic cast. ACCESS_PATH gives the access from the
+ // most derived object to this base. DST_TYPE indicates the
+ // desired type we want. OBJ_PTR points to a base of our type
+ // within the complete object. SRC_TYPE indicates the static type
+ // started from and SRC_PTR points to that base within the most
+ // derived object. Fill in RESULT with what we find. Return true
+ // if we have located an ambiguous match.
+ virtual bool
+ __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
+ const __class_type_info* __dst_type, const void* __obj_ptr,
+ const __class_type_info* __src_type, const void* __src_ptr,
+ __dyncast_result& __result) const;
+
+ // Helper for find_public_subobj. SRC2DST indicates how SRC_TYPE
+ // bases are inherited by the type started from -- which is not
+ // necessarily the current type. The current type will be a base
+ // of the destination type. OBJ_PTR points to the current base.
+ virtual __sub_kind
+ __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
+ const __class_type_info* __src_type,
+ const void* __src_ptr) const;
+ };
+
+ // Type information for a class with a single non-virtual base.
+ class __si_class_type_info : public __class_type_info
+ {
+ public:
+ const __class_type_info* __base_type;
+
+ explicit
+ __si_class_type_info(const char *__n, const __class_type_info *__base)
+ : __class_type_info(__n), __base_type(__base) { }
+
+ virtual
+ ~__si_class_type_info();
+
+ protected:
+ __si_class_type_info(const __si_class_type_info&);
+
+ __si_class_type_info&
+ operator=(const __si_class_type_info&);
+
+ // Implementation defined member functions.
+ virtual bool
+ __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
+ const __class_type_info* __dst_type, const void* __obj_ptr,
+ const __class_type_info* __src_type, const void* __src_ptr,
+ __dyncast_result& __result) const;
+
+ virtual __sub_kind
+ __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
+ const __class_type_info* __src_type,
+ const void* __sub_ptr) const;
+
+ virtual bool
+ __do_upcast(const __class_type_info*__dst, const void*__obj,
+ __upcast_result& __restrict __result) const;
+ };
+
+ // Type information for a class with multiple and/or virtual bases.
+ class __vmi_class_type_info : public __class_type_info
+ {
+ public:
+ unsigned int __flags; // Details about the class hierarchy.
+ unsigned int __base_count; // Number of direct bases.
+
+ // The array of bases uses the trailing array struct hack so this
+ // class is not constructable with a normal constructor. It is
+ // internally generated by the compiler.
+ __base_class_type_info __base_info[1]; // Array of bases.
+
+ explicit
+ __vmi_class_type_info(const char* __n, int ___flags)
+ : __class_type_info(__n), __flags(___flags), __base_count(0) { }
+
+ virtual
+ ~__vmi_class_type_info();
+
+ // Implementation defined types.
+ enum __flags_masks
+ {
+ __non_diamond_repeat_mask = 0x1, // Distinct instance of repeated base.
+ __diamond_shaped_mask = 0x2, // Diamond shaped multiple inheritance.
+ __flags_unknown_mask = 0x10
+ };
+
+ protected:
+ // Implementation defined member functions.
+ virtual bool
+ __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
+ const __class_type_info* __dst_type, const void* __obj_ptr,
+ const __class_type_info* __src_type, const void* __src_ptr,
+ __dyncast_result& __result) const;
+
+ virtual __sub_kind
+ __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
+ const __class_type_info* __src_type,
+ const void* __src_ptr) const;
+
+ virtual bool
+ __do_upcast(const __class_type_info* __dst, const void* __obj,
+ __upcast_result& __restrict __result) const;
+ };
+
+ // Dynamic cast runtime.
+ // src2dst has the following possible values
+ // >-1: src_type is a unique public non-virtual base of dst_type
+ // dst_ptr + src2dst == src_ptr
+ // -1: unspecified relationship
+ // -2: src_type is not a public base of dst_type
+ // -3: src_type is a multiple public non-virtual base of dst_type
+ extern "C" void*
+ __dynamic_cast(const void* __src_ptr, // Starting object.
+ const __class_type_info* __src_type, // Static type of object.
+ const __class_type_info* __dst_type, // Desired target type.
+ ptrdiff_t __src2dst); // How src and dst are related.
+
+
+ // Returns the type_info for the currently handled exception [15.3/8], or
+ // null if there is none.
+ extern "C" std::type_info*
+ __cxa_current_exception_type();
+
+ // A magic placeholder class that can be caught by reference
+ // to recognize foreign exceptions.
+ class __foreign_exception
+ {
+ virtual ~__foreign_exception() throw();
+ virtual void __pure_dummy() = 0; // prevent catch by value
+ };
+
+} // namespace __cxxabiv1
+
+/** @namespace abi
+ * @brief The cross-vendor C++ Application Binary Interface. A
+ * namespace alias to __cxxabiv1, but user programs should use the
+ * alias `abi'.
+ *
+ * A brief overview of an ABI is given in the libstdc++ FAQ, question
+ * 5.8 (you may have a copy of the FAQ locally, or you can view the online
+ * version at http://gcc.gnu.org/onlinedocs/libstdc++/faq/index.html#5_8).
+ *
+ * GCC subscribes to a cross-vendor ABI for C++, sometimes
+ * called the IA64 ABI because it happens to be the native ABI for that
+ * platform. It is summarized at http://www.codesourcery.com/cxx-abi/
+ * along with the current specification.
+ *
+ * For users of GCC greater than or equal to 3.x, entry points are
+ * available in <cxxabi.h>, which notes, <em>"It is not normally
+ * necessary for user programs to include this header, or use the
+ * entry points directly. However, this header is available should
+ * that be needed."</em>
+*/
+namespace abi = __cxxabiv1;
+
+#endif // __cplusplus
+
+#pragma GCC visibility pop
+
+#endif // __CXXABI_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/bitset b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/bitset
new file mode 100644
index 0000000..b493442
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/bitset
@@ -0,0 +1,369 @@
+// Debugging bitset implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/bitset
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_BITSET
+#define _GLIBCXX_DEBUG_BITSET
+
+#include <bitset>
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+
+namespace std
+{
+namespace __debug
+{
+ template<size_t _Nb>
+ class bitset
+ : public _GLIBCXX_STD_D::bitset<_Nb>,
+ public __gnu_debug::_Safe_sequence_base
+ {
+ typedef _GLIBCXX_STD_D::bitset<_Nb> _Base;
+ typedef __gnu_debug::_Safe_sequence_base _Safe_base;
+
+ public:
+ // bit reference:
+ class reference
+ : private _Base::reference, public __gnu_debug::_Safe_iterator_base
+ {
+ typedef typename _Base::reference _Base_ref;
+
+ friend class bitset;
+ reference();
+
+ reference(const _Base_ref& __base, bitset* __seq)
+ : _Base_ref(__base), _Safe_iterator_base(__seq, false)
+ { }
+
+ public:
+ reference(const reference& __x)
+ : _Base_ref(__x), _Safe_iterator_base(__x, false)
+ { }
+
+ reference&
+ operator=(bool __x)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
+ _M_message(__gnu_debug::__msg_bad_bitset_write)
+ ._M_iterator(*this));
+ *static_cast<_Base_ref*>(this) = __x;
+ return *this;
+ }
+
+ reference&
+ operator=(const reference& __x)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __x._M_singular(),
+ _M_message(__gnu_debug::__msg_bad_bitset_read)
+ ._M_iterator(__x));
+ _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
+ _M_message(__gnu_debug::__msg_bad_bitset_write)
+ ._M_iterator(*this));
+ *static_cast<_Base_ref*>(this) = __x;
+ return *this;
+ }
+
+ bool
+ operator~() const
+ {
+ _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
+ _M_message(__gnu_debug::__msg_bad_bitset_read)
+ ._M_iterator(*this));
+ return ~(*static_cast<const _Base_ref*>(this));
+ }
+
+ operator bool() const
+ {
+ _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
+ _M_message(__gnu_debug::__msg_bad_bitset_read)
+ ._M_iterator(*this));
+ return *static_cast<const _Base_ref*>(this);
+ }
+
+ reference&
+ flip()
+ {
+ _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
+ _M_message(__gnu_debug::__msg_bad_bitset_flip)
+ ._M_iterator(*this));
+ _Base_ref::flip();
+ return *this;
+ }
+ };
+
+ // 23.3.5.1 constructors:
+ bitset() : _Base() { }
+
+ bitset(unsigned long __val) : _Base(__val) { }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ explicit
+ bitset(const std::basic_string<_CharT, _Traits, _Alloc>& __str,
+ typename std::basic_string<_CharT, _Traits, _Alloc>::size_type
+ __pos = 0,
+ typename std::basic_string<_CharT, _Traits, _Alloc>::size_type
+ __n = (std::basic_string<_CharT, _Traits, _Alloc>::npos))
+ : _Base(__str, __pos, __n) { }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 396. what are characters zero and one.
+ template<class _CharT, class _Traits, class _Alloc>
+ bitset(const std::basic_string<_CharT, _Traits, _Alloc>& __str,
+ typename std::basic_string<_CharT, _Traits, _Alloc>::size_type
+ __pos,
+ typename std::basic_string<_CharT, _Traits, _Alloc>::size_type
+ __n,
+ _CharT __zero, _CharT __one = _CharT('1'))
+ : _Base(__str, __pos, __n, __zero, __one) { }
+
+ bitset(const _Base& __x) : _Base(__x), _Safe_base() { }
+
+ // 23.3.5.2 bitset operations:
+ bitset<_Nb>&
+ operator&=(const bitset<_Nb>& __rhs)
+ {
+ _M_base() &= __rhs;
+ return *this;
+ }
+
+ bitset<_Nb>&
+ operator|=(const bitset<_Nb>& __rhs)
+ {
+ _M_base() |= __rhs;
+ return *this;
+ }
+
+ bitset<_Nb>&
+ operator^=(const bitset<_Nb>& __rhs)
+ {
+ _M_base() ^= __rhs;
+ return *this;
+ }
+
+ bitset<_Nb>&
+ operator<<=(size_t __pos)
+ {
+ _M_base() <<= __pos;
+ return *this;
+ }
+
+ bitset<_Nb>&
+ operator>>=(size_t __pos)
+ {
+ _M_base() >>= __pos;
+ return *this;
+ }
+
+ bitset<_Nb>&
+ set()
+ {
+ _Base::set();
+ return *this;
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 186. bitset::set() second parameter should be bool
+ bitset<_Nb>&
+ set(size_t __pos, bool __val = true)
+ {
+ _Base::set(__pos, __val);
+ return *this;
+ }
+
+ bitset<_Nb>&
+ reset()
+ {
+ _Base::reset();
+ return *this;
+ }
+
+ bitset<_Nb>&
+ reset(size_t __pos)
+ {
+ _Base::reset(__pos);
+ return *this;
+ }
+
+ bitset<_Nb> operator~() const { return bitset(~_M_base()); }
+
+ bitset<_Nb>&
+ flip()
+ {
+ _Base::flip();
+ return *this;
+ }
+
+ bitset<_Nb>&
+ flip(size_t __pos)
+ {
+ _Base::flip(__pos);
+ return *this;
+ }
+
+ // element access:
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 11. Bitset minor problems
+ reference
+ operator[](size_t __pos)
+ {
+ __glibcxx_check_subscript(__pos);
+ return reference(_M_base()[__pos], this);
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 11. Bitset minor problems
+ bool
+ operator[](size_t __pos) const
+ {
+ __glibcxx_check_subscript(__pos);
+ return _M_base()[__pos];
+ }
+
+ using _Base::to_ulong;
+
+ template <typename _CharT, typename _Traits, typename _Alloc>
+ std::basic_string<_CharT, _Traits, _Alloc>
+ to_string() const
+ { return _M_base().template to_string<_CharT, _Traits, _Alloc>(); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 396. what are characters zero and one.
+ template<class _CharT, class _Traits, class _Alloc>
+ std::basic_string<_CharT, _Traits, _Alloc>
+ to_string(_CharT __zero, _CharT __one = _CharT('1')) const
+ {
+ return _M_base().template
+ to_string<_CharT, _Traits, _Alloc>(__zero, __one);
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 434. bitset::to_string() hard to use.
+ template<typename _CharT, typename _Traits>
+ std::basic_string<_CharT, _Traits, std::allocator<_CharT> >
+ to_string() const
+ { return to_string<_CharT, _Traits, std::allocator<_CharT> >(); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 853. to_string needs updating with zero and one.
+ template<class _CharT, class _Traits>
+ std::basic_string<_CharT, _Traits, std::allocator<_CharT> >
+ to_string(_CharT __zero, _CharT __one = _CharT('1')) const
+ { return to_string<_CharT, _Traits,
+ std::allocator<_CharT> >(__zero, __one); }
+
+ template<typename _CharT>
+ std::basic_string<_CharT, std::char_traits<_CharT>,
+ std::allocator<_CharT> >
+ to_string() const
+ {
+ return to_string<_CharT, std::char_traits<_CharT>,
+ std::allocator<_CharT> >();
+ }
+
+ template<class _CharT>
+ std::basic_string<_CharT, std::char_traits<_CharT>,
+ std::allocator<_CharT> >
+ to_string(_CharT __zero, _CharT __one = _CharT('1')) const
+ {
+ return to_string<_CharT, std::char_traits<_CharT>,
+ std::allocator<_CharT> >(__zero, __one);
+ }
+
+ std::basic_string<char, std::char_traits<char>, std::allocator<char> >
+ to_string() const
+ {
+ return to_string<char,std::char_traits<char>,std::allocator<char> >();
+ }
+
+ std::basic_string<char, std::char_traits<char>, std::allocator<char> >
+ to_string(char __zero, char __one = '1') const
+ {
+ return to_string<char, std::char_traits<char>,
+ std::allocator<char> >(__zero, __one);
+ }
+
+ using _Base::count;
+ using _Base::size;
+
+ bool
+ operator==(const bitset<_Nb>& __rhs) const
+ { return _M_base() == __rhs; }
+
+ bool
+ operator!=(const bitset<_Nb>& __rhs) const
+ { return _M_base() != __rhs; }
+
+ using _Base::test;
+ using _Base::all;
+ using _Base::any;
+ using _Base::none;
+
+ bitset<_Nb>
+ operator<<(size_t __pos) const
+ { return bitset<_Nb>(_M_base() << __pos); }
+
+ bitset<_Nb>
+ operator>>(size_t __pos) const
+ { return bitset<_Nb>(_M_base() >> __pos); }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+ };
+
+ template<size_t _Nb>
+ bitset<_Nb>
+ operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y)
+ { return bitset<_Nb>(__x) &= __y; }
+
+ template<size_t _Nb>
+ bitset<_Nb>
+ operator|(const bitset<_Nb>& __x, const bitset<_Nb>& __y)
+ { return bitset<_Nb>(__x) |= __y; }
+
+ template<size_t _Nb>
+ bitset<_Nb>
+ operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y)
+ { return bitset<_Nb>(__x) ^= __y; }
+
+ template<typename _CharT, typename _Traits, size_t _Nb>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
+ { return __is >> __x._M_base(); }
+
+ template<typename _CharT, typename _Traits, size_t _Nb>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const bitset<_Nb>& __x)
+ { return __os << __x._M_base(); }
+} // namespace __debug
+} // namespace std
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/debug.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/debug.h
new file mode 100644
index 0000000..305299b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/debug.h
@@ -0,0 +1,130 @@
+// Debugging support implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/debug.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_MACRO_SWITCH_H
+#define _GLIBCXX_DEBUG_MACRO_SWITCH_H 1
+
+/** Macros and namespaces used by the implementation outside of debug
+ * wrappers to verify certain properties. The __glibcxx_requires_xxx
+ * macros are merely wrappers around the __glibcxx_check_xxx wrappers
+ * when we are compiling with debug mode, but disappear when we are
+ * in release mode so that there is no checking performed in, e.g.,
+ * the standard library algorithms.
+*/
+
+// Debug mode namespaces.
+
+/**
+ * @namespace std::__debug
+ * @brief GNU debug code, replaces standard behavior with debug behavior.
+ */
+namespace std
+{
+ namespace __debug { }
+}
+
+/** @namespace __gnu_debug
+ * @brief GNU debug classes for public use.
+*/
+namespace __gnu_debug
+{
+ using namespace std::__debug;
+}
+
+#ifndef _GLIBCXX_DEBUG
+
+# define _GLIBCXX_DEBUG_ASSERT(_Condition)
+# define _GLIBCXX_DEBUG_PEDASSERT(_Condition)
+# define _GLIBCXX_DEBUG_ONLY(_Statement) ;
+# define __glibcxx_requires_cond(_Cond,_Msg)
+# define __glibcxx_requires_valid_range(_First,_Last)
+# define __glibcxx_requires_sorted(_First,_Last)
+# define __glibcxx_requires_sorted_pred(_First,_Last,_Pred)
+# define __glibcxx_requires_sorted_set(_First1,_Last1,_First2)
+# define __glibcxx_requires_sorted_set_pred(_First1,_Last1,_First2,_Pred)
+# define __glibcxx_requires_partitioned_lower(_First,_Last,_Value)
+# define __glibcxx_requires_partitioned_upper(_First,_Last,_Value)
+# define __glibcxx_requires_partitioned_lower_pred(_First,_Last,_Value,_Pred)
+# define __glibcxx_requires_partitioned_upper_pred(_First,_Last,_Value,_Pred)
+# define __glibcxx_requires_heap(_First,_Last)
+# define __glibcxx_requires_heap_pred(_First,_Last,_Pred)
+# define __glibcxx_requires_nonempty()
+# define __glibcxx_requires_string(_String)
+# define __glibcxx_requires_string_len(_String,_Len)
+# define __glibcxx_requires_subscript(_N)
+
+#else
+
+# include <debug/macros.h>
+
+#define _GLIBCXX_DEBUG_ASSERT(_Condition) __glibcxx_assert(_Condition)
+
+#ifdef _GLIBCXX_DEBUG_PEDANTIC
+# define _GLIBCXX_DEBUG_PEDASSERT(_Condition) _GLIBCXX_DEBUG_ASSERT(_Condition)
+#else
+# define _GLIBCXX_DEBUG_PEDASSERT(_Condition)
+#endif
+
+# define _GLIBCXX_DEBUG_ONLY(_Statement) _Statement
+
+# define __glibcxx_requires_cond(_Cond,_Msg) _GLIBCXX_DEBUG_VERIFY(_Cond,_Msg)
+# define __glibcxx_requires_valid_range(_First,_Last) \
+ __glibcxx_check_valid_range(_First,_Last)
+# define __glibcxx_requires_sorted(_First,_Last) \
+ __glibcxx_check_sorted(_First,_Last)
+# define __glibcxx_requires_sorted_pred(_First,_Last,_Pred) \
+ __glibcxx_check_sorted_pred(_First,_Last,_Pred)
+# define __glibcxx_requires_sorted_set(_First1,_Last1,_First2) \
+ __glibcxx_check_sorted_set(_First1,_Last1,_First2)
+# define __glibcxx_requires_sorted_set_pred(_First1,_Last1,_First2,_Pred) \
+ __glibcxx_check_sorted_set_pred(_First1,_Last1,_First2,_Pred)
+# define __glibcxx_requires_partitioned_lower(_First,_Last,_Value) \
+ __glibcxx_check_partitioned_lower(_First,_Last,_Value)
+# define __glibcxx_requires_partitioned_upper(_First,_Last,_Value) \
+ __glibcxx_check_partitioned_upper(_First,_Last,_Value)
+# define __glibcxx_requires_partitioned_lower_pred(_First,_Last,_Value,_Pred) \
+ __glibcxx_check_partitioned_lower_pred(_First,_Last,_Value,_Pred)
+# define __glibcxx_requires_partitioned_upper_pred(_First,_Last,_Value,_Pred) \
+ __glibcxx_check_partitioned_upper_pred(_First,_Last,_Value,_Pred)
+# define __glibcxx_requires_heap(_First,_Last) \
+ __glibcxx_check_heap(_First,_Last)
+# define __glibcxx_requires_heap_pred(_First,_Last,_Pred) \
+ __glibcxx_check_heap_pred(_First,_Last,_Pred)
+# define __glibcxx_requires_nonempty() __glibcxx_check_nonempty()
+# define __glibcxx_requires_string(_String) __glibcxx_check_string(_String)
+# define __glibcxx_requires_string_len(_String,_Len) \
+ __glibcxx_check_string_len(_String,_Len)
+# define __glibcxx_requires_subscript(_N) __glibcxx_check_subscript(_N)
+
+# include <debug/functions.h>
+# include <debug/formatter.h>
+
+#endif
+
+#endif // _GLIBCXX_DEBUG_MACRO_SWITCH_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/deque b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/deque
new file mode 100644
index 0000000..b481fd1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/deque
@@ -0,0 +1,515 @@
+// Debugging deque implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/deque
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_DEQUE
+#define _GLIBCXX_DEBUG_DEQUE 1
+
+#include <deque>
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+
+namespace std
+{
+namespace __debug
+{
+ template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
+ class deque
+ : public _GLIBCXX_STD_D::deque<_Tp, _Allocator>,
+ public __gnu_debug::_Safe_sequence<deque<_Tp, _Allocator> >
+ {
+ typedef _GLIBCXX_STD_D::deque<_Tp, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<deque> _Safe_base;
+
+ public:
+ typedef typename _Base::reference reference;
+ typedef typename _Base::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator,deque>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,deque>
+ const_iterator;
+
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+
+ typedef _Tp value_type;
+ typedef _Allocator allocator_type;
+ typedef typename _Base::pointer pointer;
+ typedef typename _Base::const_pointer const_pointer;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ // 23.2.1.1 construct/copy/destroy:
+ explicit deque(const _Allocator& __a = _Allocator())
+ : _Base(__a) { }
+
+ explicit deque(size_type __n, const _Tp& __value = _Tp(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__n, __value, __a) { }
+
+ template<class _InputIterator>
+ deque(_InputIterator __first, _InputIterator __last,
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__first, __last), __last, __a)
+ { }
+
+ deque(const deque& __x)
+ : _Base(__x), _Safe_base() { }
+
+ deque(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ deque(deque&& __x)
+ : _Base(std::forward<deque>(__x)), _Safe_base()
+ { this->_M_swap(__x); }
+
+ deque(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __a), _Safe_base() { }
+#endif
+
+ ~deque() { }
+
+ deque&
+ operator=(const deque& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ deque&
+ operator=(deque&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ deque&
+ operator=(initializer_list<value_type> __l)
+ {
+ *static_cast<_Base*>(this) = __l;
+ this->_M_invalidate_all();
+ return *this;
+ }
+#endif
+
+ template<class _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::assign(__first, __last);
+ this->_M_invalidate_all();
+ }
+
+ void
+ assign(size_type __n, const _Tp& __t)
+ {
+ _Base::assign(__n, __t);
+ this->_M_invalidate_all();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ assign(initializer_list<value_type> __l)
+ {
+ _Base::assign(__l);
+ this->_M_invalidate_all();
+ }
+#endif
+
+ using _Base::get_allocator;
+
+ // iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ // 23.2.1.2 capacity:
+ using _Base::size;
+ using _Base::max_size;
+
+ void
+ resize(size_type __sz, _Tp __c = _Tp())
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_After_nth_from<_Base_const_iterator> _After_nth;
+
+ bool __invalidate_all = __sz > this->size();
+ if (__sz < this->size())
+ this->_M_invalidate_if(_After_nth(__sz, _M_base().begin()));
+
+ _Base::resize(__sz, __c);
+
+ if (__invalidate_all)
+ this->_M_invalidate_all();
+ }
+
+ using _Base::empty;
+
+ // element access:
+ reference
+ operator[](size_type __n)
+ {
+ __glibcxx_check_subscript(__n);
+ return _M_base()[__n];
+ }
+
+ const_reference
+ operator[](size_type __n) const
+ {
+ __glibcxx_check_subscript(__n);
+ return _M_base()[__n];
+ }
+
+ using _Base::at;
+
+ reference
+ front()
+ {
+ __glibcxx_check_nonempty();
+ return _Base::front();
+ }
+
+ const_reference
+ front() const
+ {
+ __glibcxx_check_nonempty();
+ return _Base::front();
+ }
+
+ reference
+ back()
+ {
+ __glibcxx_check_nonempty();
+ return _Base::back();
+ }
+
+ const_reference
+ back() const
+ {
+ __glibcxx_check_nonempty();
+ return _Base::back();
+ }
+
+ // 23.2.1.3 modifiers:
+ void
+ push_front(const _Tp& __x)
+ {
+ _Base::push_front(__x);
+ this->_M_invalidate_all();
+ }
+
+ void
+ push_back(const _Tp& __x)
+ {
+ _Base::push_back(__x);
+ this->_M_invalidate_all();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push_front(_Tp&& __x)
+ { emplace_front(std::move(__x)); }
+
+ void
+ push_back(_Tp&& __x)
+ { emplace_back(std::move(__x)); }
+
+ template<typename... _Args>
+ void
+ emplace_front(_Args&&... __args)
+ {
+ _Base::emplace_front(std::forward<_Args>(__args)...);
+ this->_M_invalidate_all();
+ }
+
+ template<typename... _Args>
+ void
+ emplace_back(_Args&&... __args)
+ {
+ _Base::emplace_back(std::forward<_Args>(__args)...);
+ this->_M_invalidate_all();
+ }
+
+ template<typename... _Args>
+ iterator
+ emplace(iterator __position, _Args&&... __args)
+ {
+ __glibcxx_check_insert(__position);
+ typename _Base::iterator __res = _Base::emplace(__position.base(),
+ std::forward<_Args>(__args)...);
+ this->_M_invalidate_all();
+ return iterator(__res, this);
+ }
+#endif
+
+ iterator
+ insert(iterator __position, const _Tp& __x)
+ {
+ __glibcxx_check_insert(__position);
+ typename _Base::iterator __res = _Base::insert(__position.base(), __x);
+ this->_M_invalidate_all();
+ return iterator(__res, this);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ iterator
+ insert(iterator __position, _Tp&& __x)
+ { return emplace(__position, std::move(__x)); }
+
+ void
+ insert(iterator __p, initializer_list<value_type> __l)
+ {
+ _Base::insert(__p, __l);
+ this->_M_invalidate_all();
+ }
+#endif
+
+ void
+ insert(iterator __position, size_type __n, const _Tp& __x)
+ {
+ __glibcxx_check_insert(__position);
+ _Base::insert(__position.base(), __n, __x);
+ this->_M_invalidate_all();
+ }
+
+ template<class _InputIterator>
+ void
+ insert(iterator __position,
+ _InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_insert_range(__position, __first, __last);
+ _Base::insert(__position.base(), __first, __last);
+ this->_M_invalidate_all();
+ }
+
+ void
+ pop_front()
+ {
+ __glibcxx_check_nonempty();
+ iterator __victim = begin();
+ __victim._M_invalidate();
+ _Base::pop_front();
+ }
+
+ void
+ pop_back()
+ {
+ __glibcxx_check_nonempty();
+ iterator __victim = end();
+ --__victim;
+ __victim._M_invalidate();
+ _Base::pop_back();
+ }
+
+ iterator
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ if (__position == begin() || __position == end()-1)
+ {
+ __position._M_invalidate();
+ return iterator(_Base::erase(__position.base()), this);
+ }
+ else
+ {
+ typename _Base::iterator __res = _Base::erase(__position.base());
+ this->_M_invalidate_all();
+ return iterator(__res, this);
+ }
+ }
+
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+ if (__first == begin() || __last == end())
+ {
+ this->_M_detach_singular();
+ for (iterator __position = __first; __position != __last; )
+ {
+ iterator __victim = __position++;
+ __victim._M_invalidate();
+ }
+ __try
+ {
+ return iterator(_Base::erase(__first.base(), __last.base()),
+ this);
+ }
+ __catch(...)
+ {
+ this->_M_revalidate_singular();
+ __throw_exception_again;
+ }
+ }
+ else
+ {
+ typename _Base::iterator __res = _Base::erase(__first.base(),
+ __last.base());
+ this->_M_invalidate_all();
+ return iterator(__res, this);
+ }
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(deque&& __x)
+#else
+ swap(deque& __x)
+#endif
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+ };
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator==(const deque<_Tp, _Alloc>& __lhs,
+ const deque<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator!=(const deque<_Tp, _Alloc>& __lhs,
+ const deque<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<(const deque<_Tp, _Alloc>& __lhs,
+ const deque<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<=(const deque<_Tp, _Alloc>& __lhs,
+ const deque<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>=(const deque<_Tp, _Alloc>& __lhs,
+ const deque<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>(const deque<_Tp, _Alloc>& __lhs,
+ const deque<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(deque<_Tp, _Alloc>& __lhs, deque<_Tp, _Alloc>& __rhs)
+ { __lhs.swap(__rhs); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(deque<_Tp, _Alloc>&& __lhs, deque<_Tp, _Alloc>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(deque<_Tp, _Alloc>& __lhs, deque<_Tp, _Alloc>&& __rhs)
+ { __lhs.swap(__rhs); }
+#endif
+
+} // namespace __debug
+} // namespace std
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/formatter.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/formatter.h
new file mode 100644
index 0000000..0538edb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/formatter.h
@@ -0,0 +1,392 @@
+// Debug-mode error formatting implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/formatter.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_FORMATTER_H
+#define _GLIBCXX_DEBUG_FORMATTER_H 1
+
+#include <typeinfo>
+#include <debug/debug.h>
+
+namespace __gnu_debug
+{
+ using std::type_info;
+
+ /** Determine if the two types are the same. */
+ template<typename _Type1, typename _Type2>
+ struct __is_same
+ {
+ static const bool value = false;
+ };
+
+ template<typename _Type>
+ struct __is_same<_Type, _Type>
+ {
+ static const bool value = true;
+ };
+
+ template<bool> struct __truth { };
+
+ class _Safe_sequence_base;
+
+ template<typename _Iterator, typename _Sequence>
+ class _Safe_iterator;
+
+ template<typename _Sequence>
+ class _Safe_sequence;
+
+ enum _Debug_msg_id
+ {
+ // General checks
+ __msg_valid_range,
+ __msg_insert_singular,
+ __msg_insert_different,
+ __msg_erase_bad,
+ __msg_erase_different,
+ __msg_subscript_oob,
+ __msg_empty,
+ __msg_unpartitioned,
+ __msg_unpartitioned_pred,
+ __msg_unsorted,
+ __msg_unsorted_pred,
+ __msg_not_heap,
+ __msg_not_heap_pred,
+ // std::bitset checks
+ __msg_bad_bitset_write,
+ __msg_bad_bitset_read,
+ __msg_bad_bitset_flip,
+ // std::list checks
+ __msg_self_splice,
+ __msg_splice_alloc,
+ __msg_splice_bad,
+ __msg_splice_other,
+ __msg_splice_overlap,
+ // iterator checks
+ __msg_init_singular,
+ __msg_init_copy_singular,
+ __msg_init_const_singular,
+ __msg_copy_singular,
+ __msg_bad_deref,
+ __msg_bad_inc,
+ __msg_bad_dec,
+ __msg_iter_subscript_oob,
+ __msg_advance_oob,
+ __msg_retreat_oob,
+ __msg_iter_compare_bad,
+ __msg_compare_different,
+ __msg_iter_order_bad,
+ __msg_order_different,
+ __msg_distance_bad,
+ __msg_distance_different,
+ // istream_iterator
+ __msg_deref_istream,
+ __msg_inc_istream,
+ // ostream_iterator
+ __msg_output_ostream,
+ // istreambuf_iterator
+ __msg_deref_istreambuf,
+ __msg_inc_istreambuf
+ };
+
+ class _Error_formatter
+ {
+ /// Whether an iterator is constant, mutable, or unknown
+ enum _Constness
+ {
+ __unknown_constness,
+ __const_iterator,
+ __mutable_iterator,
+ __last_constness
+ };
+
+ // The state of the iterator (fine-grained), if we know it.
+ enum _Iterator_state
+ {
+ __unknown_state,
+ __singular, // singular, may still be attached to a sequence
+ __begin, // dereferenceable, and at the beginning
+ __middle, // dereferenceable, not at the beginning
+ __end, // past-the-end, may be at beginning if sequence empty
+ __last_state
+ };
+
+ // Tags denoting the type of parameter for construction
+ struct _Is_iterator { };
+ struct _Is_sequence { };
+
+ // A parameter that may be referenced by an error message
+ struct _Parameter
+ {
+ enum
+ {
+ __unused_param,
+ __iterator,
+ __sequence,
+ __integer,
+ __string
+ } _M_kind;
+
+ union
+ {
+ // When _M_kind == __iterator
+ struct
+ {
+ const char* _M_name;
+ const void* _M_address;
+ const type_info* _M_type;
+ _Constness _M_constness;
+ _Iterator_state _M_state;
+ const void* _M_sequence;
+ const type_info* _M_seq_type;
+ } _M_iterator;
+
+ // When _M_kind == __sequence
+ struct
+ {
+ const char* _M_name;
+ const void* _M_address;
+ const type_info* _M_type;
+ } _M_sequence;
+
+ // When _M_kind == __integer
+ struct
+ {
+ const char* _M_name;
+ long _M_value;
+ } _M_integer;
+
+ // When _M_kind == __string
+ struct
+ {
+ const char* _M_name;
+ const char* _M_value;
+ } _M_string;
+ } _M_variant;
+
+ _Parameter() : _M_kind(__unused_param), _M_variant() { }
+
+ _Parameter(long __value, const char* __name)
+ : _M_kind(__integer), _M_variant()
+ {
+ _M_variant._M_integer._M_name = __name;
+ _M_variant._M_integer._M_value = __value;
+ }
+
+ _Parameter(const char* __value, const char* __name)
+ : _M_kind(__string), _M_variant()
+ {
+ _M_variant._M_string._M_name = __name;
+ _M_variant._M_string._M_value = __value;
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ _Parameter(const _Safe_iterator<_Iterator, _Sequence>& __it,
+ const char* __name, _Is_iterator)
+ : _M_kind(__iterator), _M_variant()
+ {
+ _M_variant._M_iterator._M_name = __name;
+ _M_variant._M_iterator._M_address = &__it;
+ _M_variant._M_iterator._M_type = &typeid(__it);
+ _M_variant._M_iterator._M_constness =
+ __is_same<_Safe_iterator<_Iterator, _Sequence>,
+ typename _Sequence::iterator>::
+ value? __mutable_iterator : __const_iterator;
+ _M_variant._M_iterator._M_sequence = __it._M_get_sequence();
+ _M_variant._M_iterator._M_seq_type = &typeid(_Sequence);
+
+ if (__it._M_singular())
+ _M_variant._M_iterator._M_state = __singular;
+ else
+ {
+ bool __is_begin = __it._M_is_begin();
+ bool __is_end = __it._M_is_end();
+ if (__is_end)
+ _M_variant._M_iterator._M_state = __end;
+ else if (__is_begin)
+ _M_variant._M_iterator._M_state = __begin;
+ else
+ _M_variant._M_iterator._M_state = __middle;
+ }
+ }
+
+ template<typename _Type>
+ _Parameter(const _Type*& __it, const char* __name, _Is_iterator)
+ : _M_kind(__iterator), _M_variant()
+ {
+ _M_variant._M_iterator._M_name = __name;
+ _M_variant._M_iterator._M_address = &__it;
+ _M_variant._M_iterator._M_type = &typeid(__it);
+ _M_variant._M_iterator._M_constness = __mutable_iterator;
+ _M_variant._M_iterator._M_state = __it? __unknown_state : __singular;
+ _M_variant._M_iterator._M_sequence = 0;
+ _M_variant._M_iterator._M_seq_type = 0;
+ }
+
+ template<typename _Type>
+ _Parameter(_Type*& __it, const char* __name, _Is_iterator)
+ : _M_kind(__iterator), _M_variant()
+ {
+ _M_variant._M_iterator._M_name = __name;
+ _M_variant._M_iterator._M_address = &__it;
+ _M_variant._M_iterator._M_type = &typeid(__it);
+ _M_variant._M_iterator._M_constness = __const_iterator;
+ _M_variant._M_iterator._M_state = __it? __unknown_state : __singular;
+ _M_variant._M_iterator._M_sequence = 0;
+ _M_variant._M_iterator._M_seq_type = 0;
+ }
+
+ template<typename _Iterator>
+ _Parameter(const _Iterator& __it, const char* __name, _Is_iterator)
+ : _M_kind(__iterator), _M_variant()
+ {
+ _M_variant._M_iterator._M_name = __name;
+ _M_variant._M_iterator._M_address = &__it;
+ _M_variant._M_iterator._M_type = &typeid(__it);
+ _M_variant._M_iterator._M_constness = __unknown_constness;
+ _M_variant._M_iterator._M_state =
+ __gnu_debug::__check_singular(__it)? __singular : __unknown_state;
+ _M_variant._M_iterator._M_sequence = 0;
+ _M_variant._M_iterator._M_seq_type = 0;
+ }
+
+ template<typename _Sequence>
+ _Parameter(const _Safe_sequence<_Sequence>& __seq,
+ const char* __name, _Is_sequence)
+ : _M_kind(__sequence), _M_variant()
+ {
+ _M_variant._M_sequence._M_name = __name;
+ _M_variant._M_sequence._M_address =
+ static_cast<const _Sequence*>(&__seq);
+ _M_variant._M_sequence._M_type = &typeid(_Sequence);
+ }
+
+ template<typename _Sequence>
+ _Parameter(const _Sequence& __seq, const char* __name, _Is_sequence)
+ : _M_kind(__sequence), _M_variant()
+ {
+ _M_variant._M_sequence._M_name = __name;
+ _M_variant._M_sequence._M_address = &__seq;
+ _M_variant._M_sequence._M_type = &typeid(_Sequence);
+ }
+
+ void
+ _M_print_field(const _Error_formatter* __formatter,
+ const char* __name) const;
+
+ void
+ _M_print_description(const _Error_formatter* __formatter) const;
+ };
+
+ friend struct _Parameter;
+
+ public:
+ template<typename _Iterator>
+ const _Error_formatter&
+ _M_iterator(const _Iterator& __it, const char* __name = 0) const
+ {
+ if (_M_num_parameters < size_t(__max_parameters))
+ _M_parameters[_M_num_parameters++] = _Parameter(__it, __name,
+ _Is_iterator());
+ return *this;
+ }
+
+ const _Error_formatter&
+ _M_integer(long __value, const char* __name = 0) const
+ {
+ if (_M_num_parameters < size_t(__max_parameters))
+ _M_parameters[_M_num_parameters++] = _Parameter(__value, __name);
+ return *this;
+ }
+
+ const _Error_formatter&
+ _M_string(const char* __value, const char* __name = 0) const
+ {
+ if (_M_num_parameters < size_t(__max_parameters))
+ _M_parameters[_M_num_parameters++] = _Parameter(__value, __name);
+ return *this;
+ }
+
+ template<typename _Sequence>
+ const _Error_formatter&
+ _M_sequence(const _Sequence& __seq, const char* __name = 0) const
+ {
+ if (_M_num_parameters < size_t(__max_parameters))
+ _M_parameters[_M_num_parameters++] = _Parameter(__seq, __name,
+ _Is_sequence());
+ return *this;
+ }
+
+ const _Error_formatter&
+ _M_message(const char* __text) const
+ { _M_text = __text; return *this; }
+
+ const _Error_formatter&
+ _M_message(_Debug_msg_id __id) const;
+
+ void
+ _M_error() const;
+
+ private:
+ _Error_formatter(const char* __file, size_t __line)
+ : _M_file(__file), _M_line(__line), _M_num_parameters(0), _M_text(0),
+ _M_max_length(78), _M_column(1), _M_first_line(true), _M_wordwrap(false)
+ { _M_get_max_length(); }
+
+ template<typename _Tp>
+ void
+ _M_format_word(char*, int, const char*, _Tp) const;
+
+ void
+ _M_print_word(const char* __word) const;
+
+ void
+ _M_print_string(const char* __string) const;
+
+ void
+ _M_get_max_length() const;
+
+ enum { __max_parameters = 9 };
+
+ const char* _M_file;
+ size_t _M_line;
+ mutable _Parameter _M_parameters[__max_parameters];
+ mutable size_t _M_num_parameters;
+ mutable const char* _M_text;
+ mutable size_t _M_max_length;
+ enum { _M_indent = 4 } ;
+ mutable size_t _M_column;
+ mutable bool _M_first_line;
+ mutable bool _M_wordwrap;
+
+ public:
+ static _Error_formatter
+ _M_at(const char* __file, size_t __line)
+ { return _Error_formatter(__file, __line); }
+ };
+} // namespace __gnu_debug
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/functions.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/functions.h
new file mode 100644
index 0000000..a4b1d78
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/functions.h
@@ -0,0 +1,383 @@
+// Debugging support implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/functions.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_FUNCTIONS_H
+#define _GLIBCXX_DEBUG_FUNCTIONS_H 1
+
+#include <bits/c++config.h>
+#include <cstddef> // for ptrdiff_t
+#include <bits/stl_iterator_base_types.h> // for iterator_traits, categories
+#include <bits/cpp_type_traits.h> // for __is_integer
+
+namespace __gnu_debug
+{
+ template<typename _Iterator, typename _Sequence>
+ class _Safe_iterator;
+
+ // An arbitrary iterator pointer is not singular.
+ inline bool
+ __check_singular_aux(const void*) { return false; }
+
+ // We may have an iterator that derives from _Safe_iterator_base but isn't
+ // a _Safe_iterator.
+ template<typename _Iterator>
+ inline bool
+ __check_singular(_Iterator& __x)
+ { return __check_singular_aux(&__x); }
+
+ /** Non-NULL pointers are nonsingular. */
+ template<typename _Tp>
+ inline bool
+ __check_singular(const _Tp* __ptr)
+ { return __ptr == 0; }
+
+ /** Safe iterators know if they are singular. */
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ __check_singular(const _Safe_iterator<_Iterator, _Sequence>& __x)
+ { return __x._M_singular(); }
+
+ /** Assume that some arbitrary iterator is dereferenceable, because we
+ can't prove that it isn't. */
+ template<typename _Iterator>
+ inline bool
+ __check_dereferenceable(_Iterator&)
+ { return true; }
+
+ /** Non-NULL pointers are dereferenceable. */
+ template<typename _Tp>
+ inline bool
+ __check_dereferenceable(const _Tp* __ptr)
+ { return __ptr; }
+
+ /** Safe iterators know if they are singular. */
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ __check_dereferenceable(const _Safe_iterator<_Iterator, _Sequence>& __x)
+ { return __x._M_dereferenceable(); }
+
+ /** If the distance between two random access iterators is
+ * nonnegative, assume the range is valid.
+ */
+ template<typename _RandomAccessIterator>
+ inline bool
+ __valid_range_aux2(const _RandomAccessIterator& __first,
+ const _RandomAccessIterator& __last,
+ std::random_access_iterator_tag)
+ { return __last - __first >= 0; }
+
+ /** Can't test for a valid range with input iterators, because
+ * iteration may be destructive. So we just assume that the range
+ * is valid.
+ */
+ template<typename _InputIterator>
+ inline bool
+ __valid_range_aux2(const _InputIterator&, const _InputIterator&,
+ std::input_iterator_tag)
+ { return true; }
+
+ /** We say that integral types for a valid range, and defer to other
+ * routines to realize what to do with integral types instead of
+ * iterators.
+ */
+ template<typename _Integral>
+ inline bool
+ __valid_range_aux(const _Integral&, const _Integral&, std::__true_type)
+ { return true; }
+
+ /** We have iterators, so figure out what kind of iterators that are
+ * to see if we can check the range ahead of time.
+ */
+ template<typename _InputIterator>
+ inline bool
+ __valid_range_aux(const _InputIterator& __first,
+ const _InputIterator& __last, std::__false_type)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::iterator_category
+ _Category;
+ return __valid_range_aux2(__first, __last, _Category());
+ }
+
+ /** Don't know what these iterators are, or if they are even
+ * iterators (we may get an integral type for InputIterator), so
+ * see if they are integral and pass them on to the next phase
+ * otherwise.
+ */
+ template<typename _InputIterator>
+ inline bool
+ __valid_range(const _InputIterator& __first, const _InputIterator& __last)
+ {
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ return __valid_range_aux(__first, __last, _Integral());
+ }
+
+ /** Safe iterators know how to check if they form a valid range. */
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ __valid_range(const _Safe_iterator<_Iterator, _Sequence>& __first,
+ const _Safe_iterator<_Iterator, _Sequence>& __last)
+ { return __first._M_valid_range(__last); }
+
+ /* Checks that [first, last) is a valid range, and then returns
+ * __first. This routine is useful when we can't use a separate
+ * assertion statement because, e.g., we are in a constructor.
+ */
+ template<typename _InputIterator>
+ inline _InputIterator
+ __check_valid_range(const _InputIterator& __first,
+ const _InputIterator& __last
+ __attribute__((__unused__)))
+ {
+ _GLIBCXX_DEBUG_ASSERT(__valid_range(__first, __last));
+ return __first;
+ }
+
+ /** Checks that __s is non-NULL or __n == 0, and then returns __s. */
+ template<typename _CharT, typename _Integer>
+ inline const _CharT*
+ __check_string(const _CharT* __s,
+ const _Integer& __n __attribute__((__unused__)))
+ {
+#ifdef _GLIBCXX_DEBUG_PEDANTIC
+ _GLIBCXX_DEBUG_ASSERT(__s != 0 || __n == 0);
+#endif
+ return __s;
+ }
+
+ /** Checks that __s is non-NULL and then returns __s. */
+ template<typename _CharT>
+ inline const _CharT*
+ __check_string(const _CharT* __s)
+ {
+#ifdef _GLIBCXX_DEBUG_PEDANTIC
+ _GLIBCXX_DEBUG_ASSERT(__s != 0);
+#endif
+ return __s;
+ }
+
+ // Can't check if an input iterator sequence is sorted, because we
+ // can't step through the sequence.
+ template<typename _InputIterator>
+ inline bool
+ __check_sorted_aux(const _InputIterator&, const _InputIterator&,
+ std::input_iterator_tag)
+ { return true; }
+
+ // Can verify if a forward iterator sequence is in fact sorted using
+ // std::__is_sorted
+ template<typename _ForwardIterator>
+ inline bool
+ __check_sorted_aux(_ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag)
+ {
+ if (__first == __last)
+ return true;
+
+ _ForwardIterator __next = __first;
+ for (++__next; __next != __last; __first = __next, ++__next)
+ if (*__next < *__first)
+ return false;
+
+ return true;
+ }
+
+ // Can't check if an input iterator sequence is sorted, because we can't step
+ // through the sequence.
+ template<typename _InputIterator, typename _Predicate>
+ inline bool
+ __check_sorted_aux(const _InputIterator&, const _InputIterator&,
+ _Predicate, std::input_iterator_tag)
+ { return true; }
+
+ // Can verify if a forward iterator sequence is in fact sorted using
+ // std::__is_sorted
+ template<typename _ForwardIterator, typename _Predicate>
+ inline bool
+ __check_sorted_aux(_ForwardIterator __first, _ForwardIterator __last,
+ _Predicate __pred, std::forward_iterator_tag)
+ {
+ if (__first == __last)
+ return true;
+
+ _ForwardIterator __next = __first;
+ for (++__next; __next != __last; __first = __next, ++__next)
+ if (__pred(*__next, *__first))
+ return false;
+
+ return true;
+ }
+
+ // Determine if a sequence is sorted.
+ template<typename _InputIterator>
+ inline bool
+ __check_sorted(const _InputIterator& __first, const _InputIterator& __last)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::iterator_category
+ _Category;
+
+ // Verify that the < operator for elements in the sequence is a
+ // StrictWeakOrdering by checking that it is irreflexive.
+ _GLIBCXX_DEBUG_ASSERT(__first == __last || !(*__first < *__first));
+
+ return __check_sorted_aux(__first, __last, _Category());
+ }
+
+ template<typename _InputIterator, typename _Predicate>
+ inline bool
+ __check_sorted(const _InputIterator& __first, const _InputIterator& __last,
+ _Predicate __pred)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::iterator_category
+ _Category;
+
+ // Verify that the predicate is StrictWeakOrdering by checking that it
+ // is irreflexive.
+ _GLIBCXX_DEBUG_ASSERT(__first == __last || !__pred(*__first, *__first));
+
+ return __check_sorted_aux(__first, __last, __pred, _Category());
+ }
+
+ template<typename _InputIterator>
+ inline bool
+ __check_sorted_set_aux(const _InputIterator& __first,
+ const _InputIterator& __last,
+ std::__true_type)
+ { return __check_sorted(__first, __last); }
+
+ template<typename _InputIterator>
+ inline bool
+ __check_sorted_set_aux(const _InputIterator&,
+ const _InputIterator&,
+ std::__false_type)
+ { return true; }
+
+ template<typename _InputIterator, typename _Predicate>
+ inline bool
+ __check_sorted_set_aux(const _InputIterator& __first,
+ const _InputIterator& __last,
+ _Predicate __pred, std::__true_type)
+ { return __check_sorted(__first, __last, __pred); }
+
+ template<typename _InputIterator, typename _Predicate>
+ inline bool
+ __check_sorted_set_aux(const _InputIterator&,
+ const _InputIterator&, _Predicate,
+ std::__false_type)
+ { return true; }
+
+ // ... special variant used in std::merge, std::includes, std::set_*.
+ template<typename _InputIterator1, typename _InputIterator2>
+ inline bool
+ __check_sorted_set(const _InputIterator1& __first,
+ const _InputIterator1& __last,
+ const _InputIterator2&)
+ {
+ typedef typename std::iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename std::iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ typedef typename std::__are_same<_ValueType1, _ValueType2>::__type
+ _SameType;
+ return __check_sorted_set_aux(__first, __last, _SameType());
+ }
+
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _Predicate>
+ inline bool
+ __check_sorted_set(const _InputIterator1& __first,
+ const _InputIterator1& __last,
+ const _InputIterator2&, _Predicate __pred)
+ {
+ typedef typename std::iterator_traits<_InputIterator1>::value_type
+ _ValueType1;
+ typedef typename std::iterator_traits<_InputIterator2>::value_type
+ _ValueType2;
+
+ typedef typename std::__are_same<_ValueType1, _ValueType2>::__type
+ _SameType;
+ return __check_sorted_set_aux(__first, __last, __pred, _SameType());
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 270. Binary search requirements overly strict
+ // Determine if a sequence is partitioned w.r.t. this element.
+ template<typename _ForwardIterator, typename _Tp>
+ inline bool
+ __check_partitioned_lower(_ForwardIterator __first,
+ _ForwardIterator __last, const _Tp& __value)
+ {
+ while (__first != __last && *__first < __value)
+ ++__first;
+ while (__first != __last && !(*__first < __value))
+ ++__first;
+ return __first == __last;
+ }
+
+ template<typename _ForwardIterator, typename _Tp>
+ inline bool
+ __check_partitioned_upper(_ForwardIterator __first,
+ _ForwardIterator __last, const _Tp& __value)
+ {
+ while (__first != __last && !(__value < *__first))
+ ++__first;
+ while (__first != __last && __value < *__first)
+ ++__first;
+ return __first == __last;
+ }
+
+ // Determine if a sequence is partitioned w.r.t. this element.
+ template<typename _ForwardIterator, typename _Tp, typename _Pred>
+ inline bool
+ __check_partitioned_lower(_ForwardIterator __first,
+ _ForwardIterator __last, const _Tp& __value,
+ _Pred __pred)
+ {
+ while (__first != __last && bool(__pred(*__first, __value)))
+ ++__first;
+ while (__first != __last && !bool(__pred(*__first, __value)))
+ ++__first;
+ return __first == __last;
+ }
+
+ template<typename _ForwardIterator, typename _Tp, typename _Pred>
+ inline bool
+ __check_partitioned_upper(_ForwardIterator __first,
+ _ForwardIterator __last, const _Tp& __value,
+ _Pred __pred)
+ {
+ while (__first != __last && !bool(__pred(__value, *__first)))
+ ++__first;
+ while (__first != __last && bool(__pred(__value, *__first)))
+ ++__first;
+ return __first == __last;
+ }
+} // namespace __gnu_debug
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/list b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/list
new file mode 100644
index 0000000..39f763a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/list
@@ -0,0 +1,653 @@
+// Debugging list implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/list
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_LIST
+#define _GLIBCXX_DEBUG_LIST 1
+
+#include <list>
+#include <bits/stl_algo.h>
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+
+namespace std
+{
+namespace __debug
+{
+ template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
+ class list
+ : public _GLIBCXX_STD_D::list<_Tp, _Allocator>,
+ public __gnu_debug::_Safe_sequence<list<_Tp, _Allocator> >
+ {
+ typedef _GLIBCXX_STD_D::list<_Tp, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<list> _Safe_base;
+
+ public:
+ typedef typename _Base::reference reference;
+ typedef typename _Base::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, list>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator, list>
+ const_iterator;
+
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+
+ typedef _Tp value_type;
+ typedef _Allocator allocator_type;
+ typedef typename _Base::pointer pointer;
+ typedef typename _Base::const_pointer const_pointer;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ // 23.2.2.1 construct/copy/destroy:
+ explicit list(const _Allocator& __a = _Allocator())
+ : _Base(__a) { }
+
+ explicit list(size_type __n, const _Tp& __value = _Tp(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__n, __value, __a) { }
+
+ template<class _InputIterator>
+ list(_InputIterator __first, _InputIterator __last,
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__first, __last), __last, __a)
+ { }
+
+
+ list(const list& __x)
+ : _Base(__x), _Safe_base() { }
+
+ list(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ list(list&& __x)
+ : _Base(std::forward<list>(__x)), _Safe_base()
+ { this->_M_swap(__x); }
+
+ list(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __a), _Safe_base() { }
+#endif
+
+ ~list() { }
+
+ list&
+ operator=(const list& __x)
+ {
+ static_cast<_Base&>(*this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ list&
+ operator=(list&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ list&
+ operator=(initializer_list<value_type> __l)
+ {
+ static_cast<_Base&>(*this) = __l;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ void
+ assign(initializer_list<value_type> __l)
+ {
+ _Base::assign(__l);
+ this->_M_invalidate_all();
+ }
+#endif
+
+ template<class _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::assign(__first, __last);
+ this->_M_invalidate_all();
+ }
+
+ void
+ assign(size_type __n, const _Tp& __t)
+ {
+ _Base::assign(__n, __t);
+ this->_M_invalidate_all();
+ }
+
+ using _Base::get_allocator;
+
+ // iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ // 23.2.2.2 capacity:
+ using _Base::empty;
+ using _Base::size;
+ using _Base::max_size;
+
+ void
+ resize(size_type __sz, _Tp __c = _Tp())
+ {
+ this->_M_detach_singular();
+
+ // if __sz < size(), invalidate all iterators in [begin+__sz, end())
+ iterator __victim = begin();
+ iterator __end = end();
+ for (size_type __i = __sz; __victim != __end && __i > 0; --__i)
+ ++__victim;
+
+ while (__victim != __end)
+ {
+ iterator __real_victim = __victim++;
+ __real_victim._M_invalidate();
+ }
+
+ __try
+ {
+ _Base::resize(__sz, __c);
+ }
+ __catch(...)
+ {
+ this->_M_revalidate_singular();
+ __throw_exception_again;
+ }
+ }
+
+ // element access:
+ reference
+ front()
+ {
+ __glibcxx_check_nonempty();
+ return _Base::front();
+ }
+
+ const_reference
+ front() const
+ {
+ __glibcxx_check_nonempty();
+ return _Base::front();
+ }
+
+ reference
+ back()
+ {
+ __glibcxx_check_nonempty();
+ return _Base::back();
+ }
+
+ const_reference
+ back() const
+ {
+ __glibcxx_check_nonempty();
+ return _Base::back();
+ }
+
+ // 23.2.2.3 modifiers:
+ using _Base::push_front;
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ using _Base::emplace_front;
+#endif
+
+ void
+ pop_front()
+ {
+ __glibcxx_check_nonempty();
+ iterator __victim = begin();
+ __victim._M_invalidate();
+ _Base::pop_front();
+ }
+
+ using _Base::push_back;
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ using _Base::emplace_back;
+#endif
+
+ void
+ pop_back()
+ {
+ __glibcxx_check_nonempty();
+ iterator __victim = end();
+ --__victim;
+ __victim._M_invalidate();
+ _Base::pop_back();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ iterator
+ emplace(iterator __position, _Args&&... __args)
+ {
+ __glibcxx_check_insert(__position);
+ return iterator(_Base::emplace(__position.base(),
+ std::forward<_Args>(__args)...), this);
+ }
+#endif
+
+ iterator
+ insert(iterator __position, const _Tp& __x)
+ {
+ __glibcxx_check_insert(__position);
+ return iterator(_Base::insert(__position.base(), __x), this);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ iterator
+ insert(iterator __position, _Tp&& __x)
+ { return emplace(__position, std::move(__x)); }
+
+ void
+ insert(iterator __p, initializer_list<value_type> __l)
+ {
+ __glibcxx_check_insert(__p);
+ _Base::insert(__p, __l);
+ }
+#endif
+
+ void
+ insert(iterator __position, size_type __n, const _Tp& __x)
+ {
+ __glibcxx_check_insert(__position);
+ _Base::insert(__position.base(), __n, __x);
+ }
+
+ template<class _InputIterator>
+ void
+ insert(iterator __position, _InputIterator __first,
+ _InputIterator __last)
+ {
+ __glibcxx_check_insert_range(__position, __first, __last);
+ _Base::insert(__position.base(), __first, __last);
+ }
+
+ iterator
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ __position._M_invalidate();
+ return iterator(_Base::erase(__position.base()), this);
+ }
+
+ iterator
+ erase(iterator __position, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__position, __last);
+ for (iterator __victim = __position; __victim != __last; )
+ {
+ iterator __old = __victim;
+ ++__victim;
+ __old._M_invalidate();
+ }
+ return iterator(_Base::erase(__position.base(), __last.base()), this);
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(list&& __x)
+#else
+ swap(list& __x)
+#endif
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ }
+
+ // 23.2.2.4 list operations:
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ splice(iterator __position, list&& __x)
+#else
+ splice(iterator __position, list& __x)
+#endif
+ {
+ _GLIBCXX_DEBUG_VERIFY(&__x != this,
+ _M_message(__gnu_debug::__msg_self_splice)
+ ._M_sequence(*this, "this"));
+ this->splice(__position, _GLIBCXX_MOVE(__x), __x.begin(), __x.end());
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ splice(iterator __position, list&& __x, iterator __i)
+#else
+ splice(iterator __position, list& __x, iterator __i)
+#endif
+ {
+ __glibcxx_check_insert(__position);
+
+ // We used to perform the splice_alloc check: not anymore, redundant
+ // after implementing the relevant bits of N1599.
+
+ _GLIBCXX_DEBUG_VERIFY(__i._M_dereferenceable(),
+ _M_message(__gnu_debug::__msg_splice_bad)
+ ._M_iterator(__i, "__i"));
+ _GLIBCXX_DEBUG_VERIFY(__i._M_attached_to(&__x),
+ _M_message(__gnu_debug::__msg_splice_other)
+ ._M_iterator(__i, "__i")._M_sequence(__x, "__x"));
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 250. splicing invalidates iterators
+ this->_M_transfer_iter(__i);
+ _Base::splice(__position.base(), _GLIBCXX_MOVE(__x._M_base()),
+ __i.base());
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ splice(iterator __position, list&& __x, iterator __first,
+ iterator __last)
+#else
+ splice(iterator __position, list& __x, iterator __first,
+ iterator __last)
+#endif
+ {
+ __glibcxx_check_insert(__position);
+ __glibcxx_check_valid_range(__first, __last);
+ _GLIBCXX_DEBUG_VERIFY(__first._M_attached_to(&__x),
+ _M_message(__gnu_debug::__msg_splice_other)
+ ._M_sequence(__x, "x")
+ ._M_iterator(__first, "first"));
+
+ // We used to perform the splice_alloc check: not anymore, redundant
+ // after implementing the relevant bits of N1599.
+
+ for (iterator __tmp = __first; __tmp != __last; )
+ {
+ _GLIBCXX_DEBUG_VERIFY(&__x != this || __tmp != __position,
+ _M_message(__gnu_debug::__msg_splice_overlap)
+ ._M_iterator(__tmp, "position")
+ ._M_iterator(__first, "first")
+ ._M_iterator(__last, "last"));
+ iterator __victim = __tmp++;
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 250. splicing invalidates iterators
+ this->_M_transfer_iter(__victim);
+ }
+
+ _Base::splice(__position.base(), _GLIBCXX_MOVE(__x._M_base()),
+ __first.base(), __last.base());
+ }
+
+ void
+ remove(const _Tp& __value)
+ {
+ for (iterator __x = begin(); __x.base() != _Base::end(); )
+ {
+ if (*__x == __value)
+ __x = erase(__x);
+ else
+ ++__x;
+ }
+ }
+
+ template<class _Predicate>
+ void
+ remove_if(_Predicate __pred)
+ {
+ for (iterator __x = begin(); __x.base() != _Base::end(); )
+ {
+ if (__pred(*__x))
+ __x = erase(__x);
+ else
+ ++__x;
+ }
+ }
+
+ void
+ unique()
+ {
+ iterator __first = begin();
+ iterator __last = end();
+ if (__first == __last)
+ return;
+ iterator __next = __first;
+ while (++__next != __last)
+ {
+ if (*__first == *__next)
+ erase(__next);
+ else
+ __first = __next;
+ __next = __first;
+ }
+ }
+
+ template<class _BinaryPredicate>
+ void
+ unique(_BinaryPredicate __binary_pred)
+ {
+ iterator __first = begin();
+ iterator __last = end();
+ if (__first == __last)
+ return;
+ iterator __next = __first;
+ while (++__next != __last)
+ {
+ if (__binary_pred(*__first, *__next))
+ erase(__next);
+ else
+ __first = __next;
+ __next = __first;
+ }
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ merge(list&& __x)
+#else
+ merge(list& __x)
+#endif
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 300. list::merge() specification incomplete
+ if (this != &__x)
+ {
+ __glibcxx_check_sorted(_Base::begin(), _Base::end());
+ __glibcxx_check_sorted(__x.begin().base(), __x.end().base());
+ for (iterator __tmp = __x.begin(); __tmp != __x.end();)
+ {
+ iterator __victim = __tmp++;
+ this->_M_transfer_iter(__victim);
+ }
+ _Base::merge(_GLIBCXX_MOVE(__x._M_base()));
+ }
+ }
+
+ template<class _Compare>
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ merge(list&& __x, _Compare __comp)
+#else
+ merge(list& __x, _Compare __comp)
+#endif
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 300. list::merge() specification incomplete
+ if (this != &__x)
+ {
+ __glibcxx_check_sorted_pred(_Base::begin(), _Base::end(),
+ __comp);
+ __glibcxx_check_sorted_pred(__x.begin().base(), __x.end().base(),
+ __comp);
+ for (iterator __tmp = __x.begin(); __tmp != __x.end();)
+ {
+ iterator __victim = __tmp++;
+ this->_M_transfer_iter(__victim);
+ }
+ _Base::merge(_GLIBCXX_MOVE(__x._M_base()), __comp);
+ }
+ }
+
+ void
+ sort() { _Base::sort(); }
+
+ template<typename _StrictWeakOrdering>
+ void
+ sort(_StrictWeakOrdering __pred) { _Base::sort(__pred); }
+
+ using _Base::reverse;
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator==(const list<_Tp, _Alloc>& __lhs,
+ const list<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator!=(const list<_Tp, _Alloc>& __lhs,
+ const list<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<(const list<_Tp, _Alloc>& __lhs,
+ const list<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<=(const list<_Tp, _Alloc>& __lhs,
+ const list<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>=(const list<_Tp, _Alloc>& __lhs,
+ const list<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>(const list<_Tp, _Alloc>& __lhs,
+ const list<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(list<_Tp, _Alloc>& __lhs, list<_Tp, _Alloc>& __rhs)
+ { __lhs.swap(__rhs); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(list<_Tp, _Alloc>&& __lhs, list<_Tp, _Alloc>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(list<_Tp, _Alloc>& __lhs, list<_Tp, _Alloc>&& __rhs)
+ { __lhs.swap(__rhs); }
+#endif
+
+} // namespace __debug
+} // namespace std
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/macros.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/macros.h
new file mode 100644
index 0000000..1a8ce69
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/macros.h
@@ -0,0 +1,246 @@
+// Debugging support implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/macros.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_MACROS_H
+#define _GLIBCXX_DEBUG_MACROS_H 1
+
+/**
+ * Macros used by the implementation to verify certain
+ * properties. These macros may only be used directly by the debug
+ * wrappers. Note that these are macros (instead of the more obviously
+ * "correct" choice of making them functions) because we need line and
+ * file information at the call site, to minimize the distance between
+ * the user error and where the error is reported.
+ *
+ */
+#define _GLIBCXX_DEBUG_VERIFY(_Condition,_ErrorMessage) \
+ do \
+ { \
+ if (! (_Condition)) \
+ __gnu_debug::_Error_formatter::_M_at(__FILE__, __LINE__) \
+ ._ErrorMessage._M_error(); \
+ } while (false)
+
+// Verify that [_First, _Last) forms a valid iterator range.
+#define __glibcxx_check_valid_range(_First,_Last) \
+_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__valid_range(_First, _Last), \
+ _M_message(__gnu_debug::__msg_valid_range) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last))
+
+/** Verify that we can insert into *this with the iterator _Position.
+ * Insertion into a container at a specific position requires that
+ * the iterator be nonsingular (i.e., either dereferenceable or
+ * past-the-end) and that it reference the sequence we are inserting
+ * into. Note that this macro is only valid when the container is a
+ * _Safe_sequence and the iterator is a _Safe_iterator.
+*/
+#define __glibcxx_check_insert(_Position) \
+_GLIBCXX_DEBUG_VERIFY(!_Position._M_singular(), \
+ _M_message(__gnu_debug::__msg_insert_singular) \
+ ._M_sequence(*this, "this") \
+ ._M_iterator(_Position, #_Position)); \
+_GLIBCXX_DEBUG_VERIFY(_Position._M_attached_to(this), \
+ _M_message(__gnu_debug::__msg_insert_different) \
+ ._M_sequence(*this, "this") \
+ ._M_iterator(_Position, #_Position))
+
+/** Verify that we can insert the values in the iterator range
+ * [_First, _Last) into *this with the iterator _Position. Insertion
+ * into a container at a specific position requires that the iterator
+ * be nonsingular (i.e., either dereferenceable or past-the-end),
+ * that it reference the sequence we are inserting into, and that the
+ * iterator range [_First, Last) is a valid (possibly empty)
+ * range. Note that this macro is only valid when the container is a
+ * _Safe_sequence and the iterator is a _Safe_iterator.
+ *
+ * @tbd We would like to be able to check for noninterference of
+ * _Position and the range [_First, _Last), but that can't (in
+ * general) be done.
+*/
+#define __glibcxx_check_insert_range(_Position,_First,_Last) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(!_Position._M_singular(), \
+ _M_message(__gnu_debug::__msg_insert_singular) \
+ ._M_sequence(*this, "this") \
+ ._M_iterator(_Position, #_Position)); \
+_GLIBCXX_DEBUG_VERIFY(_Position._M_attached_to(this), \
+ _M_message(__gnu_debug::__msg_insert_different) \
+ ._M_sequence(*this, "this") \
+ ._M_iterator(_Position, #_Position))
+
+/** Verify that we can erase the element referenced by the iterator
+ * _Position. We can erase the element if the _Position iterator is
+ * dereferenceable and references this sequence.
+*/
+#define __glibcxx_check_erase(_Position) \
+_GLIBCXX_DEBUG_VERIFY(_Position._M_dereferenceable(), \
+ _M_message(__gnu_debug::__msg_erase_bad) \
+ ._M_sequence(*this, "this") \
+ ._M_iterator(_Position, #_Position)); \
+_GLIBCXX_DEBUG_VERIFY(_Position._M_attached_to(this), \
+ _M_message(__gnu_debug::__msg_erase_different) \
+ ._M_sequence(*this, "this") \
+ ._M_iterator(_Position, #_Position))
+
+/** Verify that we can erase the elements in the iterator range
+ * [_First, _Last). We can erase the elements if [_First, _Last) is a
+ * valid iterator range within this sequence.
+*/
+#define __glibcxx_check_erase_range(_First,_Last) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(_First._M_attached_to(this), \
+ _M_message(__gnu_debug::__msg_erase_different) \
+ ._M_sequence(*this, "this") \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last))
+
+// Verify that the subscript _N is less than the container's size.
+#define __glibcxx_check_subscript(_N) \
+_GLIBCXX_DEBUG_VERIFY(_N < this->size(), \
+ _M_message(__gnu_debug::__msg_subscript_oob) \
+ ._M_sequence(*this, "this") \
+ ._M_integer(_N, #_N) \
+ ._M_integer(this->size(), "size"))
+
+// Verify that the container is nonempty
+#define __glibcxx_check_nonempty() \
+_GLIBCXX_DEBUG_VERIFY(! this->empty(), \
+ _M_message(__gnu_debug::__msg_empty) \
+ ._M_sequence(*this, "this"))
+
+// Verify that the iterator range [_First, _Last) is sorted
+#define __glibcxx_check_sorted(_First,_Last) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_sorted(_First, _Last), \
+ _M_message(__gnu_debug::__msg_unsorted) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last))
+
+/** Verify that the iterator range [_First, _Last) is sorted by the
+ predicate _Pred. */
+#define __glibcxx_check_sorted_pred(_First,_Last,_Pred) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_sorted(_First, _Last, _Pred), \
+ _M_message(__gnu_debug::__msg_unsorted_pred) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last) \
+ ._M_string(#_Pred))
+
+// Special variant for std::merge, std::includes, std::set_*
+#define __glibcxx_check_sorted_set(_First1,_Last1,_First2) \
+__glibcxx_check_valid_range(_First1,_Last1); \
+_GLIBCXX_DEBUG_VERIFY( \
+ __gnu_debug::__check_sorted_set(_First1, _Last1, _First2), \
+ _M_message(__gnu_debug::__msg_unsorted) \
+ ._M_iterator(_First1, #_First1) \
+ ._M_iterator(_Last1, #_Last1))
+
+// Likewise with a _Pred.
+#define __glibcxx_check_sorted_set_pred(_First1,_Last1,_First2,_Pred) \
+__glibcxx_check_valid_range(_First1,_Last1); \
+_GLIBCXX_DEBUG_VERIFY( \
+ __gnu_debug::__check_sorted_set(_First1, _Last1, _First2, _Pred), \
+ _M_message(__gnu_debug::__msg_unsorted_pred) \
+ ._M_iterator(_First1, #_First1) \
+ ._M_iterator(_Last1, #_Last1) \
+ ._M_string(#_Pred))
+
+/** Verify that the iterator range [_First, _Last) is partitioned
+ w.r.t. the value _Value. */
+#define __glibcxx_check_partitioned_lower(_First,_Last,_Value) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_lower(_First, _Last, \
+ _Value), \
+ _M_message(__gnu_debug::__msg_unpartitioned) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last) \
+ ._M_string(#_Value))
+
+#define __glibcxx_check_partitioned_upper(_First,_Last,_Value) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_upper(_First, _Last, \
+ _Value), \
+ _M_message(__gnu_debug::__msg_unpartitioned) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last) \
+ ._M_string(#_Value))
+
+/** Verify that the iterator range [_First, _Last) is partitioned
+ w.r.t. the value _Value and predicate _Pred. */
+#define __glibcxx_check_partitioned_lower_pred(_First,_Last,_Value,_Pred) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_lower(_First, _Last, \
+ _Value, _Pred), \
+ _M_message(__gnu_debug::__msg_unpartitioned_pred) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last) \
+ ._M_string(#_Pred) \
+ ._M_string(#_Value))
+
+/** Verify that the iterator range [_First, _Last) is partitioned
+ w.r.t. the value _Value and predicate _Pred. */
+#define __glibcxx_check_partitioned_upper_pred(_First,_Last,_Value,_Pred) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_upper(_First, _Last, \
+ _Value, _Pred), \
+ _M_message(__gnu_debug::__msg_unpartitioned_pred) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last) \
+ ._M_string(#_Pred) \
+ ._M_string(#_Value))
+
+// Verify that the iterator range [_First, _Last) is a heap
+#define __glibcxx_check_heap(_First,_Last) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(std::__is_heap(_First, _Last), \
+ _M_message(__gnu_debug::__msg_not_heap) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last))
+
+/** Verify that the iterator range [_First, _Last) is a heap
+ w.r.t. the predicate _Pred. */
+#define __glibcxx_check_heap_pred(_First,_Last,_Pred) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(std::__is_heap(_First, _Last, _Pred), \
+ _M_message(__gnu_debug::__msg_not_heap_pred) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last) \
+ ._M_string(#_Pred))
+
+#ifdef _GLIBCXX_DEBUG_PEDANTIC
+# define __glibcxx_check_string(_String) _GLIBCXX_DEBUG_ASSERT(_String != 0)
+# define __glibcxx_check_string_len(_String,_Len) \
+ _GLIBCXX_DEBUG_ASSERT(_String != 0 || _Len == 0)
+#else
+# define __glibcxx_check_string(_String)
+# define __glibcxx_check_string_len(_String,_Len)
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/map b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/map
new file mode 100644
index 0000000..2d16b71
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/map
@@ -0,0 +1,37 @@
+// Debugging map/multimap implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2006, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/map
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_MAP
+#define _GLIBCXX_DEBUG_MAP 1
+
+#include <map>
+#include <debug/map.h>
+#include <debug/multimap.h>
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/map.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/map.h
new file mode 100644
index 0000000..de1e5a5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/map.h
@@ -0,0 +1,412 @@
+// Debugging map implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/map.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_MAP_H
+#define _GLIBCXX_DEBUG_MAP_H 1
+
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+#include <utility>
+
+namespace std
+{
+namespace __debug
+{
+ template<typename _Key, typename _Tp, typename _Compare = std::less<_Key>,
+ typename _Allocator = std::allocator<std::pair<const _Key, _Tp> > >
+ class map
+ : public _GLIBCXX_STD_D::map<_Key, _Tp, _Compare, _Allocator>,
+ public __gnu_debug::_Safe_sequence<map<_Key, _Tp, _Compare, _Allocator> >
+ {
+ typedef _GLIBCXX_STD_D::map<_Key, _Tp, _Compare, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<map> _Safe_base;
+
+ public:
+ // types:
+ typedef _Key key_type;
+ typedef _Tp mapped_type;
+ typedef std::pair<const _Key, _Tp> value_type;
+ typedef _Compare key_compare;
+ typedef _Allocator allocator_type;
+ typedef typename _Base::reference reference;
+ typedef typename _Base::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, map>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator, map>
+ const_iterator;
+
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+ typedef typename _Base::pointer pointer;
+ typedef typename _Base::const_pointer const_pointer;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ using _Base::value_compare;
+
+ // 23.3.1.1 construct/copy/destroy:
+ explicit map(const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__comp, __a) { }
+
+ template<typename _InputIterator>
+ map(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__first, __last), __last,
+ __comp, __a), _Safe_base() { }
+
+ map(const map& __x)
+ : _Base(__x), _Safe_base() { }
+
+ map(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ map(map&& __x)
+ : _Base(std::forward<map>(__x)), _Safe_base()
+ { this->_M_swap(__x); }
+
+ map(initializer_list<value_type> __l,
+ const _Compare& __c = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __c, __a), _Safe_base() { }
+#endif
+
+ ~map() { }
+
+ map&
+ operator=(const map& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ map&
+ operator=(map&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ map&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+#endif
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 133. map missing get_allocator()
+ using _Base::get_allocator;
+
+ // iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ // capacity:
+ using _Base::empty;
+ using _Base::size;
+ using _Base::max_size;
+
+ // 23.3.1.2 element access:
+ using _Base::operator[];
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 464. Suggestion for new member functions in standard containers.
+ using _Base::at;
+
+ // modifiers:
+ std::pair<iterator, bool>
+ insert(const value_type& __x)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, bool> __res = _Base::insert(__x);
+ return std::pair<iterator, bool>(iterator(__res.first, this),
+ __res.second);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ insert(std::initializer_list<value_type> __list)
+ { _Base::insert(__list); }
+#endif
+
+ iterator
+ insert(iterator __position, const value_type& __x)
+ {
+ __glibcxx_check_insert(__position);
+ return iterator(_Base::insert(__position.base(), __x), this);
+ }
+
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first, __last);
+ }
+
+ void
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ __position._M_invalidate();
+ _Base::erase(__position.base());
+ }
+
+ size_type
+ erase(const key_type& __x)
+ {
+ iterator __victim = find(__x);
+ if (__victim == end())
+ return 0;
+ else
+ {
+ __victim._M_invalidate();
+ _Base::erase(__victim.base());
+ return 1;
+ }
+ }
+
+ void
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+ while (__first != __last)
+ this->erase(__first++);
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(map&& __x)
+#else
+ swap(map& __x)
+#endif
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ void
+ clear()
+ { this->erase(begin(), end()); }
+
+ // observers:
+ using _Base::key_comp;
+ using _Base::value_comp;
+
+ // 23.3.1.3 map operations:
+ iterator
+ find(const key_type& __x)
+ { return iterator(_Base::find(__x), this); }
+
+ const_iterator
+ find(const key_type& __x) const
+ { return const_iterator(_Base::find(__x), this); }
+
+ using _Base::count;
+
+ iterator
+ lower_bound(const key_type& __x)
+ { return iterator(_Base::lower_bound(__x), this); }
+
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return const_iterator(_Base::lower_bound(__x), this); }
+
+ iterator
+ upper_bound(const key_type& __x)
+ { return iterator(_Base::upper_bound(__x), this); }
+
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return const_iterator(_Base::upper_bound(__x), this); }
+
+ std::pair<iterator,iterator>
+ equal_range(const key_type& __x)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ std::pair<const_iterator,const_iterator>
+ equal_range(const key_type& __x) const
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ std::pair<_Base_const_iterator, _Base_const_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator==(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator!=(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator<(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator<=(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator>=(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator>(const map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const map<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline void
+ swap(map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ map<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { __lhs.swap(__rhs); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline void
+ swap(map<_Key, _Tp, _Compare, _Allocator>&& __lhs,
+ map<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline void
+ swap(map<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ map<_Key, _Tp, _Compare, _Allocator>&& __rhs)
+ { __lhs.swap(__rhs); }
+#endif
+
+} // namespace __debug
+} // namespace std
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/multimap.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/multimap.h
new file mode 100644
index 0000000..42741da
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/multimap.h
@@ -0,0 +1,400 @@
+// Debugging multimap implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/multimap.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_MULTIMAP_H
+#define _GLIBCXX_DEBUG_MULTIMAP_H 1
+
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+#include <utility>
+
+namespace std
+{
+namespace __debug
+{
+ template<typename _Key, typename _Tp, typename _Compare = std::less<_Key>,
+ typename _Allocator = std::allocator<std::pair<const _Key, _Tp> > >
+ class multimap
+ : public _GLIBCXX_STD_D::multimap<_Key, _Tp, _Compare, _Allocator>,
+ public __gnu_debug::_Safe_sequence<multimap<_Key, _Tp,
+ _Compare, _Allocator> >
+ {
+ typedef _GLIBCXX_STD_D::multimap<_Key, _Tp, _Compare, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<multimap> _Safe_base;
+
+ public:
+ // types:
+ typedef _Key key_type;
+ typedef _Tp mapped_type;
+ typedef std::pair<const _Key, _Tp> value_type;
+ typedef _Compare key_compare;
+ typedef _Allocator allocator_type;
+ typedef typename _Base::reference reference;
+ typedef typename _Base::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, multimap>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,
+ multimap> const_iterator;
+
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+ typedef typename _Base::pointer pointer;
+ typedef typename _Base::const_pointer const_pointer;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ using _Base::value_compare;
+
+ // 23.3.1.1 construct/copy/destroy:
+ explicit multimap(const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__comp, __a) { }
+
+ template<typename _InputIterator>
+ multimap(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__first, __last), __last,
+ __comp, __a) { }
+
+ multimap(const multimap& __x)
+ : _Base(__x), _Safe_base() { }
+
+ multimap(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ multimap(multimap&& __x)
+ : _Base(std::forward<multimap>(__x)), _Safe_base()
+ { this->_M_swap(__x); }
+
+ multimap(initializer_list<value_type> __l,
+ const _Compare& __c = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __c, __a), _Safe_base() { }
+#endif
+
+ ~multimap() { }
+
+ multimap&
+ operator=(const multimap& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ multimap&
+ operator=(multimap&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ multimap&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+#endif
+
+ using _Base::get_allocator;
+
+ // iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ // capacity:
+ using _Base::empty;
+ using _Base::size;
+ using _Base::max_size;
+
+ // modifiers:
+ iterator
+ insert(const value_type& __x)
+ { return iterator(_Base::insert(__x), this); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ insert(std::initializer_list<value_type> __list)
+ { _Base::insert(__list); }
+#endif
+
+ iterator
+ insert(iterator __position, const value_type& __x)
+ {
+ __glibcxx_check_insert(__position);
+ return iterator(_Base::insert(__position.base(), __x), this);
+ }
+
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first, __last);
+ }
+
+ void
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ __position._M_invalidate();
+ _Base::erase(__position.base());
+ }
+
+ size_type
+ erase(const key_type& __x)
+ {
+ std::pair<iterator, iterator> __victims = this->equal_range(__x);
+ size_type __count = 0;
+ while (__victims.first != __victims.second)
+ {
+ iterator __victim = __victims.first++;
+ __victim._M_invalidate();
+ _Base::erase(__victim.base());
+ ++__count;
+ }
+ return __count;
+ }
+
+ void
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+ while (__first != __last)
+ this->erase(__first++);
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(multimap&& __x)
+#else
+ swap(multimap& __x)
+#endif
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ void
+ clear()
+ { this->erase(begin(), end()); }
+
+ // observers:
+ using _Base::key_comp;
+ using _Base::value_comp;
+
+ // 23.3.1.3 multimap operations:
+ iterator
+ find(const key_type& __x)
+ { return iterator(_Base::find(__x), this); }
+
+ const_iterator
+ find(const key_type& __x) const
+ { return const_iterator(_Base::find(__x), this); }
+
+ using _Base::count;
+
+ iterator
+ lower_bound(const key_type& __x)
+ { return iterator(_Base::lower_bound(__x), this); }
+
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return const_iterator(_Base::lower_bound(__x), this); }
+
+ iterator
+ upper_bound(const key_type& __x)
+ { return iterator(_Base::upper_bound(__x), this); }
+
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return const_iterator(_Base::upper_bound(__x), this); }
+
+ std::pair<iterator,iterator>
+ equal_range(const key_type& __x)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ std::pair<const_iterator,const_iterator>
+ equal_range(const key_type& __x) const
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ std::pair<_Base_const_iterator, _Base_const_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator==(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator!=(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator<(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator<=(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator>=(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline bool
+ operator>(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline void
+ swap(multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { __lhs.swap(__rhs); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline void
+ swap(multimap<_Key, _Tp, _Compare, _Allocator>&& __lhs,
+ multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ template<typename _Key, typename _Tp,
+ typename _Compare, typename _Allocator>
+ inline void
+ swap(multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
+ multimap<_Key, _Tp, _Compare, _Allocator>&& __rhs)
+ { __lhs.swap(__rhs); }
+#endif
+
+} // namespace __debug
+} // namespace std
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/multiset.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/multiset.h
new file mode 100644
index 0000000..3e4ee86
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/multiset.h
@@ -0,0 +1,396 @@
+// Debugging multiset implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/multiset.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_MULTISET_H
+#define _GLIBCXX_DEBUG_MULTISET_H 1
+
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+#include <utility>
+
+namespace std
+{
+namespace __debug
+{
+ template<typename _Key, typename _Compare = std::less<_Key>,
+ typename _Allocator = std::allocator<_Key> >
+ class multiset
+ : public _GLIBCXX_STD_D::multiset<_Key, _Compare, _Allocator>,
+ public __gnu_debug::_Safe_sequence<multiset<_Key, _Compare, _Allocator> >
+ {
+ typedef _GLIBCXX_STD_D::multiset<_Key, _Compare, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<multiset> _Safe_base;
+
+ public:
+ // types:
+ typedef _Key key_type;
+ typedef _Key value_type;
+ typedef _Compare key_compare;
+ typedef _Compare value_compare;
+ typedef _Allocator allocator_type;
+ typedef typename _Base::reference reference;
+ typedef typename _Base::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, multiset>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,
+ multiset> const_iterator;
+
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+ typedef typename _Base::pointer pointer;
+ typedef typename _Base::const_pointer const_pointer;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ // 23.3.3.1 construct/copy/destroy:
+ explicit multiset(const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__comp, __a) { }
+
+ template<typename _InputIterator>
+ multiset(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__first, __last), __last,
+ __comp, __a) { }
+
+ multiset(const multiset& __x)
+ : _Base(__x), _Safe_base() { }
+
+ multiset(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ multiset(multiset&& __x)
+ : _Base(std::forward<multiset>(__x)), _Safe_base()
+ { this->_M_swap(__x); }
+
+ multiset(initializer_list<value_type> __l,
+ const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __comp, __a), _Safe_base() { }
+#endif
+
+ ~multiset() { }
+
+ multiset&
+ operator=(const multiset& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ multiset&
+ operator=(multiset&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ multiset&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+#endif
+
+ using _Base::get_allocator;
+
+ // iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ // capacity:
+ using _Base::empty;
+ using _Base::size;
+ using _Base::max_size;
+
+ // modifiers:
+ iterator
+ insert(const value_type& __x)
+ { return iterator(_Base::insert(__x), this); }
+
+ iterator
+ insert(iterator __position, const value_type& __x)
+ {
+ __glibcxx_check_insert(__position);
+ return iterator(_Base::insert(__position.base(), __x), this);
+ }
+
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first, __last);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ insert(initializer_list<value_type> __l)
+ { _Base::insert(__l); }
+#endif
+
+ void
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ __position._M_invalidate();
+ _Base::erase(__position.base());
+ }
+
+ size_type
+ erase(const key_type& __x)
+ {
+ std::pair<iterator, iterator> __victims = this->equal_range(__x);
+ size_type __count = 0;
+ while (__victims.first != __victims.second)
+ {
+ iterator __victim = __victims.first++;
+ __victim._M_invalidate();
+ _Base::erase(__victim.base());
+ ++__count;
+ }
+ return __count;
+ }
+
+ void
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+ while (__first != __last)
+ this->erase(__first++);
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(multiset&& __x)
+#else
+ swap(multiset& __x)
+#endif
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ void
+ clear()
+ { this->erase(begin(), end()); }
+
+ // observers:
+ using _Base::key_comp;
+ using _Base::value_comp;
+
+ // multiset operations:
+ iterator
+ find(const key_type& __x)
+ { return iterator(_Base::find(__x), this); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ const_iterator
+ find(const key_type& __x) const
+ { return const_iterator(_Base::find(__x), this); }
+
+ using _Base::count;
+
+ iterator
+ lower_bound(const key_type& __x)
+ { return iterator(_Base::lower_bound(__x), this); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return const_iterator(_Base::lower_bound(__x), this); }
+
+ iterator
+ upper_bound(const key_type& __x)
+ { return iterator(_Base::upper_bound(__x), this); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return const_iterator(_Base::upper_bound(__x), this); }
+
+ std::pair<iterator,iterator>
+ equal_range(const key_type& __x)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ std::pair<const_iterator,const_iterator>
+ equal_range(const key_type& __x) const
+ {
+ typedef typename _Base::const_iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator==(const multiset<_Key, _Compare, _Allocator>& __lhs,
+ const multiset<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator!=(const multiset<_Key, _Compare, _Allocator>& __lhs,
+ const multiset<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator<(const multiset<_Key, _Compare, _Allocator>& __lhs,
+ const multiset<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator<=(const multiset<_Key, _Compare, _Allocator>& __lhs,
+ const multiset<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator>=(const multiset<_Key, _Compare, _Allocator>& __lhs,
+ const multiset<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator>(const multiset<_Key, _Compare, _Allocator>& __lhs,
+ const multiset<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ void
+ swap(multiset<_Key, _Compare, _Allocator>& __x,
+ multiset<_Key, _Compare, _Allocator>& __y)
+ { return __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Compare, typename _Allocator>
+ void
+ swap(multiset<_Key, _Compare, _Allocator>&& __x,
+ multiset<_Key, _Compare, _Allocator>& __y)
+ { return __x.swap(__y); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ void
+ swap(multiset<_Key, _Compare, _Allocator>& __x,
+ multiset<_Key, _Compare, _Allocator>&& __y)
+ { return __x.swap(__y); }
+#endif
+
+} // namespace __debug
+} // namespace std
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/safe_base.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/safe_base.h
new file mode 100644
index 0000000..1bef5e7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/safe_base.h
@@ -0,0 +1,220 @@
+// Safe sequence/iterator base implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/safe_base.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_SAFE_BASE_H
+#define _GLIBCXX_DEBUG_SAFE_BASE_H 1
+
+#include <ext/concurrence.h>
+
+namespace __gnu_debug
+{
+ class _Safe_sequence_base;
+
+ /** \brief Basic functionality for a "safe" iterator.
+ *
+ * The %_Safe_iterator_base base class implements the functionality
+ * of a safe iterator that is not specific to a particular iterator
+ * type. It contains a pointer back to the sequence it references
+ * along with iterator version information and pointers to form a
+ * doubly-linked list of iterators referenced by the container.
+ *
+ * This class must not perform any operations that can throw an
+ * exception, or the exception guarantees of derived iterators will
+ * be broken.
+ */
+ class _Safe_iterator_base
+ {
+ public:
+ /** The sequence this iterator references; may be NULL to indicate
+ a singular iterator. */
+ _Safe_sequence_base* _M_sequence;
+
+ /** The version number of this iterator. The sentinel value 0 is
+ * used to indicate an invalidated iterator (i.e., one that is
+ * singular because of an operation on the container). This
+ * version number must equal the version number in the sequence
+ * referenced by _M_sequence for the iterator to be
+ * non-singular.
+ */
+ unsigned int _M_version;
+
+ /** Pointer to the previous iterator in the sequence's list of
+ iterators. Only valid when _M_sequence != NULL. */
+ _Safe_iterator_base* _M_prior;
+
+ /** Pointer to the next iterator in the sequence's list of
+ iterators. Only valid when _M_sequence != NULL. */
+ _Safe_iterator_base* _M_next;
+
+ protected:
+ /** Initializes the iterator and makes it singular. */
+ _Safe_iterator_base()
+ : _M_sequence(0), _M_version(0), _M_prior(0), _M_next(0)
+ { }
+
+ /** Initialize the iterator to reference the sequence pointed to
+ * by @p__seq. @p __constant is true when we are initializing a
+ * constant iterator, and false if it is a mutable iterator. Note
+ * that @p __seq may be NULL, in which case the iterator will be
+ * singular. Otherwise, the iterator will reference @p __seq and
+ * be nonsingular.
+ */
+ _Safe_iterator_base(const _Safe_sequence_base* __seq, bool __constant)
+ : _M_sequence(0), _M_version(0), _M_prior(0), _M_next(0)
+ { this->_M_attach(const_cast<_Safe_sequence_base*>(__seq), __constant); }
+
+ /** Initializes the iterator to reference the same sequence that
+ @p __x does. @p __constant is true if this is a constant
+ iterator, and false if it is mutable. */
+ _Safe_iterator_base(const _Safe_iterator_base& __x, bool __constant)
+ : _M_sequence(0), _M_version(0), _M_prior(0), _M_next(0)
+ { this->_M_attach(__x._M_sequence, __constant); }
+
+ _Safe_iterator_base&
+ operator=(const _Safe_iterator_base&);
+
+ explicit
+ _Safe_iterator_base(const _Safe_iterator_base&);
+
+ ~_Safe_iterator_base() { this->_M_detach(); }
+
+ /** For use in _Safe_iterator. */
+ __gnu_cxx::__mutex& _M_get_mutex();
+
+ public:
+ /** Attaches this iterator to the given sequence, detaching it
+ * from whatever sequence it was attached to originally. If the
+ * new sequence is the NULL pointer, the iterator is left
+ * unattached.
+ */
+ void _M_attach(_Safe_sequence_base* __seq, bool __constant);
+
+ /** Likewise, but not thread-safe. */
+ void _M_attach_single(_Safe_sequence_base* __seq, bool __constant);
+
+ /** Detach the iterator for whatever sequence it is attached to,
+ * if any.
+ */
+ void _M_detach();
+
+ /** Likewise, but not thread-safe. */
+ void _M_detach_single();
+
+ /** Determines if we are attached to the given sequence. */
+ bool _M_attached_to(const _Safe_sequence_base* __seq) const
+ { return _M_sequence == __seq; }
+
+ /** Is this iterator singular? */
+ bool _M_singular() const;
+
+ /** Can we compare this iterator to the given iterator @p __x?
+ Returns true if both iterators are nonsingular and reference
+ the same sequence. */
+ bool _M_can_compare(const _Safe_iterator_base& __x) const;
+ };
+
+ /**
+ * @brief Base class that supports tracking of iterators that
+ * reference a sequence.
+ *
+ * The %_Safe_sequence_base class provides basic support for
+ * tracking iterators into a sequence. Sequences that track
+ * iterators must derived from %_Safe_sequence_base publicly, so
+ * that safe iterators (which inherit _Safe_iterator_base) can
+ * attach to them. This class contains two linked lists of
+ * iterators, one for constant iterators and one for mutable
+ * iterators, and a version number that allows very fast
+ * invalidation of all iterators that reference the container.
+ *
+ * This class must ensure that no operation on it may throw an
+ * exception, otherwise "safe" sequences may fail to provide the
+ * exception-safety guarantees required by the C++ standard.
+ */
+ class _Safe_sequence_base
+ {
+ public:
+ /// The list of mutable iterators that reference this container
+ _Safe_iterator_base* _M_iterators;
+
+ /// The list of constant iterators that reference this container
+ _Safe_iterator_base* _M_const_iterators;
+
+ /// The container version number. This number may never be 0.
+ mutable unsigned int _M_version;
+
+ protected:
+ // Initialize with a version number of 1 and no iterators
+ _Safe_sequence_base()
+ : _M_iterators(0), _M_const_iterators(0), _M_version(1)
+ { }
+
+ /** Notify all iterators that reference this sequence that the
+ sequence is being destroyed. */
+ ~_Safe_sequence_base()
+ { this->_M_detach_all(); }
+
+ /** Detach all iterators, leaving them singular. */
+ void
+ _M_detach_all();
+
+ /** Detach all singular iterators.
+ * @post for all iterators i attached to this sequence,
+ * i->_M_version == _M_version.
+ */
+ void
+ _M_detach_singular();
+
+ /** Revalidates all attached singular iterators. This method may
+ * be used to validate iterators that were invalidated before
+ * (but for some reason, such as an exception, need to become
+ * valid again).
+ */
+ void
+ _M_revalidate_singular();
+
+ /** Swap this sequence with the given sequence. This operation
+ * also swaps ownership of the iterators, so that when the
+ * operation is complete all iterators that originally referenced
+ * one container now reference the other container.
+ */
+ void
+ _M_swap(_Safe_sequence_base& __x);
+
+ /** For use in _Safe_sequence. */
+ __gnu_cxx::__mutex& _M_get_mutex();
+
+ public:
+ /** Invalidates all iterators. */
+ void
+ _M_invalidate_all() const
+ { if (++_M_version == 0) _M_version = 1; }
+ };
+} // namespace __gnu_debug
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/safe_iterator.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/safe_iterator.h
new file mode 100644
index 0000000..dbdb32e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/safe_iterator.h
@@ -0,0 +1,643 @@
+// Safe iterator implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/safe_iterator.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_SAFE_ITERATOR_H
+#define _GLIBCXX_DEBUG_SAFE_ITERATOR_H 1
+
+#include <debug/debug.h>
+#include <debug/macros.h>
+#include <debug/functions.h>
+#include <debug/formatter.h>
+#include <debug/safe_base.h>
+#include <bits/stl_pair.h>
+#include <ext/type_traits.h>
+
+namespace __gnu_debug
+{
+ /** Iterators that derive from _Safe_iterator_base but that aren't
+ * _Safe_iterators can be determined singular or non-singular via
+ * _Safe_iterator_base.
+ */
+ inline bool
+ __check_singular_aux(const _Safe_iterator_base* __x)
+ { return __x->_M_singular(); }
+
+ /** \brief Safe iterator wrapper.
+ *
+ * The class template %_Safe_iterator is a wrapper around an
+ * iterator that tracks the iterator's movement among sequences and
+ * checks that operations performed on the "safe" iterator are
+ * legal. In additional to the basic iterator operations (which are
+ * validated, and then passed to the underlying iterator),
+ * %_Safe_iterator has member functions for iterator invalidation,
+ * attaching/detaching the iterator from sequences, and querying
+ * the iterator's state.
+ */
+ template<typename _Iterator, typename _Sequence>
+ class _Safe_iterator : public _Safe_iterator_base
+ {
+ typedef _Safe_iterator _Self;
+
+ /** The precision to which we can calculate the distance between
+ * two iterators.
+ */
+ enum _Distance_precision
+ {
+ __dp_equality, //< Can compare iterator equality, only
+ __dp_sign, //< Can determine equality and ordering
+ __dp_exact //< Can determine distance precisely
+ };
+
+ /// The underlying iterator
+ _Iterator _M_current;
+
+ /// Determine if this is a constant iterator.
+ bool
+ _M_constant() const
+ {
+ typedef typename _Sequence::const_iterator const_iterator;
+ return __is_same<const_iterator, _Safe_iterator>::value;
+ }
+
+ typedef std::iterator_traits<_Iterator> _Traits;
+
+ public:
+ typedef _Iterator _Base_iterator;
+ typedef typename _Traits::iterator_category iterator_category;
+ typedef typename _Traits::value_type value_type;
+ typedef typename _Traits::difference_type difference_type;
+ typedef typename _Traits::reference reference;
+ typedef typename _Traits::pointer pointer;
+
+ /// @post the iterator is singular and unattached
+ _Safe_iterator() : _M_current() { }
+
+ /**
+ * @brief Safe iterator construction from an unsafe iterator and
+ * its sequence.
+ *
+ * @pre @p seq is not NULL
+ * @post this is not singular
+ */
+ _Safe_iterator(const _Iterator& __i, const _Sequence* __seq)
+ : _Safe_iterator_base(__seq, _M_constant()), _M_current(__i)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
+ _M_message(__msg_init_singular)
+ ._M_iterator(*this, "this"));
+ }
+
+ /**
+ * @brief Copy construction.
+ * @pre @p x is not singular
+ */
+ _Safe_iterator(const _Safe_iterator& __x)
+ : _Safe_iterator_base(__x, _M_constant()), _M_current(__x._M_current)
+ {
+ _GLIBCXX_DEBUG_VERIFY(!__x._M_singular(),
+ _M_message(__msg_init_copy_singular)
+ ._M_iterator(*this, "this")
+ ._M_iterator(__x, "other"));
+ }
+
+ /**
+ * @brief Converting constructor from a mutable iterator to a
+ * constant iterator.
+ *
+ * @pre @p x is not singular
+ */
+ template<typename _MutableIterator>
+ _Safe_iterator(
+ const _Safe_iterator<_MutableIterator,
+ typename __gnu_cxx::__enable_if<(std::__are_same<_MutableIterator,
+ typename _Sequence::iterator::_Base_iterator>::__value),
+ _Sequence>::__type>& __x)
+ : _Safe_iterator_base(__x, _M_constant()), _M_current(__x.base())
+ {
+ _GLIBCXX_DEBUG_VERIFY(!__x._M_singular(),
+ _M_message(__msg_init_const_singular)
+ ._M_iterator(*this, "this")
+ ._M_iterator(__x, "other"));
+ }
+
+ /**
+ * @brief Copy assignment.
+ * @pre @p x is not singular
+ */
+ _Safe_iterator&
+ operator=(const _Safe_iterator& __x)
+ {
+ _GLIBCXX_DEBUG_VERIFY(!__x._M_singular(),
+ _M_message(__msg_copy_singular)
+ ._M_iterator(*this, "this")
+ ._M_iterator(__x, "other"));
+ _M_current = __x._M_current;
+ this->_M_attach(static_cast<_Sequence*>(__x._M_sequence));
+ return *this;
+ }
+
+ /**
+ * @brief Iterator dereference.
+ * @pre iterator is dereferenceable
+ */
+ reference
+ operator*() const
+ {
+
+ _GLIBCXX_DEBUG_VERIFY(this->_M_dereferenceable(),
+ _M_message(__msg_bad_deref)
+ ._M_iterator(*this, "this"));
+ return *_M_current;
+ }
+
+ /**
+ * @brief Iterator dereference.
+ * @pre iterator is dereferenceable
+ * @todo Make this correct w.r.t. iterators that return proxies
+ * @todo Use addressof() instead of & operator
+ */
+ pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_dereferenceable(),
+ _M_message(__msg_bad_deref)
+ ._M_iterator(*this, "this"));
+ return &*_M_current;
+ }
+
+ // ------ Input iterator requirements ------
+ /**
+ * @brief Iterator preincrement
+ * @pre iterator is incrementable
+ */
+ _Safe_iterator&
+ operator++()
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_incrementable(),
+ _M_message(__msg_bad_inc)
+ ._M_iterator(*this, "this"));
+ ++_M_current;
+ return *this;
+ }
+
+ /**
+ * @brief Iterator postincrement
+ * @pre iterator is incrementable
+ */
+ _Safe_iterator
+ operator++(int)
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_incrementable(),
+ _M_message(__msg_bad_inc)
+ ._M_iterator(*this, "this"));
+ _Safe_iterator __tmp(*this);
+ ++_M_current;
+ return __tmp;
+ }
+
+ // ------ Bidirectional iterator requirements ------
+ /**
+ * @brief Iterator predecrement
+ * @pre iterator is decrementable
+ */
+ _Safe_iterator&
+ operator--()
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_decrementable(),
+ _M_message(__msg_bad_dec)
+ ._M_iterator(*this, "this"));
+ --_M_current;
+ return *this;
+ }
+
+ /**
+ * @brief Iterator postdecrement
+ * @pre iterator is decrementable
+ */
+ _Safe_iterator
+ operator--(int)
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_decrementable(),
+ _M_message(__msg_bad_dec)
+ ._M_iterator(*this, "this"));
+ _Safe_iterator __tmp(*this);
+ --_M_current;
+ return __tmp;
+ }
+
+ // ------ Random access iterator requirements ------
+ reference
+ operator[](const difference_type& __n) const
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_can_advance(__n)
+ && this->_M_can_advance(__n+1),
+ _M_message(__msg_iter_subscript_oob)
+ ._M_iterator(*this)._M_integer(__n));
+
+ return _M_current[__n];
+ }
+
+ _Safe_iterator&
+ operator+=(const difference_type& __n)
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_can_advance(__n),
+ _M_message(__msg_advance_oob)
+ ._M_iterator(*this)._M_integer(__n));
+ _M_current += __n;
+ return *this;
+ }
+
+ _Safe_iterator
+ operator+(const difference_type& __n) const
+ {
+ _Safe_iterator __tmp(*this);
+ __tmp += __n;
+ return __tmp;
+ }
+
+ _Safe_iterator&
+ operator-=(const difference_type& __n)
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_can_advance(-__n),
+ _M_message(__msg_retreat_oob)
+ ._M_iterator(*this)._M_integer(__n));
+ _M_current += -__n;
+ return *this;
+ }
+
+ _Safe_iterator
+ operator-(const difference_type& __n) const
+ {
+ _Safe_iterator __tmp(*this);
+ __tmp -= __n;
+ return __tmp;
+ }
+
+ // ------ Utilities ------
+ /**
+ * @brief Return the underlying iterator
+ */
+ _Iterator
+ base() const { return _M_current; }
+
+ /**
+ * @brief Conversion to underlying non-debug iterator to allow
+ * better interaction with non-debug containers.
+ */
+ operator _Iterator() const { return _M_current; }
+
+ /** Attach iterator to the given sequence. */
+ void
+ _M_attach(const _Sequence* __seq)
+ {
+ _Safe_iterator_base::_M_attach(const_cast<_Sequence*>(__seq),
+ _M_constant());
+ }
+
+ /** Likewise, but not thread-safe. */
+ void
+ _M_attach_single(const _Sequence* __seq)
+ {
+ _Safe_iterator_base::_M_attach_single(const_cast<_Sequence*>(__seq),
+ _M_constant());
+ }
+
+ /** Invalidate the iterator, making it singular. */
+ void
+ _M_invalidate();
+
+ /** Likewise, but not thread-safe. */
+ void
+ _M_invalidate_single();
+
+ /// Is the iterator dereferenceable?
+ bool
+ _M_dereferenceable() const
+ { return !this->_M_singular() && !_M_is_end(); }
+
+ /// Is the iterator incrementable?
+ bool
+ _M_incrementable() const { return this->_M_dereferenceable(); }
+
+ // Is the iterator decrementable?
+ bool
+ _M_decrementable() const { return !_M_singular() && !_M_is_begin(); }
+
+ // Can we advance the iterator @p __n steps (@p __n may be negative)
+ bool
+ _M_can_advance(const difference_type& __n) const;
+
+ // Is the iterator range [*this, __rhs) valid?
+ template<typename _Other>
+ bool
+ _M_valid_range(const _Safe_iterator<_Other, _Sequence>& __rhs) const;
+
+ // The sequence this iterator references.
+ const _Sequence*
+ _M_get_sequence() const
+ { return static_cast<const _Sequence*>(_M_sequence); }
+
+ /** Determine the distance between two iterators with some known
+ * precision.
+ */
+ template<typename _Iterator1, typename _Iterator2>
+ static std::pair<difference_type, _Distance_precision>
+ _M_get_distance(const _Iterator1& __lhs, const _Iterator2& __rhs)
+ {
+ typedef typename std::iterator_traits<_Iterator1>::iterator_category
+ _Category;
+ return _M_get_distance(__lhs, __rhs, _Category());
+ }
+
+ template<typename _Iterator1, typename _Iterator2>
+ static std::pair<difference_type, _Distance_precision>
+ _M_get_distance(const _Iterator1& __lhs, const _Iterator2& __rhs,
+ std::random_access_iterator_tag)
+ {
+ return std::make_pair(__rhs.base() - __lhs.base(), __dp_exact);
+ }
+
+ template<typename _Iterator1, typename _Iterator2>
+ static std::pair<difference_type, _Distance_precision>
+ _M_get_distance(const _Iterator1& __lhs, const _Iterator2& __rhs,
+ std::forward_iterator_tag)
+ {
+ return std::make_pair(__lhs.base() == __rhs.base()? 0 : 1,
+ __dp_equality);
+ }
+
+ /// Is this iterator equal to the sequence's begin() iterator?
+ bool _M_is_begin() const
+ { return *this == static_cast<const _Sequence*>(_M_sequence)->begin(); }
+
+ /// Is this iterator equal to the sequence's end() iterator?
+ bool _M_is_end() const
+ { return *this == static_cast<const _Sequence*>(_M_sequence)->end(); }
+ };
+
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline bool
+ operator==(const _Safe_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_compare_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_compare_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() == __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ operator==(const _Safe_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_compare_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_compare_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() == __rhs.base();
+ }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline bool
+ operator!=(const _Safe_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_compare_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_compare_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() != __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ operator!=(const _Safe_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_compare_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_compare_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() != __rhs.base();
+ }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline bool
+ operator<(const _Safe_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() < __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ operator<(const _Safe_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() < __rhs.base();
+ }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline bool
+ operator<=(const _Safe_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() <= __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ operator<=(const _Safe_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() <= __rhs.base();
+ }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline bool
+ operator>(const _Safe_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() > __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ operator>(const _Safe_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() > __rhs.base();
+ }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline bool
+ operator>=(const _Safe_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() >= __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ operator>=(const _Safe_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() >= __rhs.base();
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // According to the resolution of DR179 not only the various comparison
+ // operators but also operator- must accept mixed iterator/const_iterator
+ // parameters.
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline typename _Safe_iterator<_IteratorL, _Sequence>::difference_type
+ operator-(const _Safe_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_distance_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_distance_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() - __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline typename _Safe_iterator<_Iterator, _Sequence>::difference_type
+ operator-(const _Safe_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_distance_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_distance_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() - __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline _Safe_iterator<_Iterator, _Sequence>
+ operator+(typename _Safe_iterator<_Iterator,_Sequence>::difference_type __n,
+ const _Safe_iterator<_Iterator, _Sequence>& __i)
+ { return __i + __n; }
+} // namespace __gnu_debug
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <debug/safe_iterator.tcc>
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/safe_iterator.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/safe_iterator.tcc
new file mode 100644
index 0000000..d4f2aee
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/safe_iterator.tcc
@@ -0,0 +1,143 @@
+// Debugging iterator implementation (out of line) -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/safe_iterator.tcc
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_SAFE_ITERATOR_TCC
+#define _GLIBCXX_DEBUG_SAFE_ITERATOR_TCC 1
+
+namespace __gnu_debug
+{
+ template<typename _Iterator, typename _Sequence>
+ bool
+ _Safe_iterator<_Iterator, _Sequence>::
+ _M_can_advance(const difference_type& __n) const
+ {
+ typedef typename _Sequence::const_iterator const_iterator;
+
+ if (this->_M_singular())
+ return false;
+ if (__n == 0)
+ return true;
+ if (__n < 0)
+ {
+ const_iterator __begin =
+ static_cast<const _Sequence*>(_M_sequence)->begin();
+ std::pair<difference_type, _Distance_precision> __dist =
+ this->_M_get_distance(__begin, *this);
+ bool __ok = ((__dist.second == __dp_exact && __dist.first >= -__n)
+ || (__dist.second != __dp_exact && __dist.first > 0));
+ return __ok;
+ }
+ else
+ {
+ const_iterator __end =
+ static_cast<const _Sequence*>(_M_sequence)->end();
+ std::pair<difference_type, _Distance_precision> __dist =
+ this->_M_get_distance(*this, __end);
+ bool __ok = ((__dist.second == __dp_exact && __dist.first >= __n)
+ || (__dist.second != __dp_exact && __dist.first > 0));
+ return __ok;
+ }
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ template<typename _Other>
+ bool
+ _Safe_iterator<_Iterator, _Sequence>::
+ _M_valid_range(const _Safe_iterator<_Other, _Sequence>& __rhs) const
+ {
+ if (!_M_can_compare(__rhs))
+ return false;
+
+ /* Determine if we can order the iterators without the help of
+ the container */
+ std::pair<difference_type, _Distance_precision> __dist =
+ this->_M_get_distance(*this, __rhs);
+ switch (__dist.second) {
+ case __dp_equality:
+ if (__dist.first == 0)
+ return true;
+ break;
+
+ case __dp_sign:
+ case __dp_exact:
+ return __dist.first >= 0;
+ }
+
+ /* We can only test for equality, but check if one of the
+ iterators is at an extreme. */
+ if (_M_is_begin() || __rhs._M_is_end())
+ return true;
+ else if (_M_is_end() || __rhs._M_is_begin())
+ return false;
+
+ // Assume that this is a valid range; we can't check anything else
+ return true;
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ void
+ _Safe_iterator<_Iterator, _Sequence>::
+ _M_invalidate()
+ {
+ __gnu_cxx::__scoped_lock sentry(this->_M_get_mutex());
+ _M_invalidate_single();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ void
+ _Safe_iterator<_Iterator, _Sequence>::
+ _M_invalidate_single()
+ {
+ typedef typename _Sequence::iterator iterator;
+ typedef typename _Sequence::const_iterator const_iterator;
+
+ if (!this->_M_singular())
+ {
+ for (_Safe_iterator_base* __iter = _M_sequence->_M_iterators;
+ __iter; __iter = __iter->_M_next)
+ {
+ iterator* __victim = static_cast<iterator*>(__iter);
+ if (this->base() == __victim->base())
+ __victim->_M_version = 0;
+ }
+
+ for (_Safe_iterator_base* __iter2 = _M_sequence->_M_const_iterators;
+ __iter2; __iter2 = __iter2->_M_next)
+ {
+ const_iterator* __victim = static_cast<const_iterator*>(__iter2);
+ if (__victim->base() == this->base())
+ __victim->_M_version = 0;
+ }
+ _M_version = 0;
+ }
+ }
+} // namespace __gnu_debug
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/safe_sequence.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/safe_sequence.h
new file mode 100644
index 0000000..bbeac1d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/safe_sequence.h
@@ -0,0 +1,183 @@
+// Safe sequence implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/safe_sequence.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_SAFE_SEQUENCE_H
+#define _GLIBCXX_DEBUG_SAFE_SEQUENCE_H 1
+
+#include <debug/debug.h>
+#include <debug/macros.h>
+#include <debug/functions.h>
+#include <debug/safe_base.h>
+
+namespace __gnu_debug
+{
+ template<typename _Iterator, typename _Sequence>
+ class _Safe_iterator;
+
+ /** A simple function object that returns true if the passed-in
+ * value is not equal to the stored value. It saves typing over
+ * using both bind1st and not_equal.
+ */
+ template<typename _Type>
+ class _Not_equal_to
+ {
+ _Type __value;
+
+ public:
+ explicit _Not_equal_to(const _Type& __v) : __value(__v) { }
+
+ bool
+ operator()(const _Type& __x) const
+ { return __value != __x; }
+ };
+
+ /** A function object that returns true when the given random access
+ iterator is at least @c n steps away from the given iterator. */
+ template<typename _Iterator>
+ class _After_nth_from
+ {
+ typedef typename std::iterator_traits<_Iterator>::difference_type
+ difference_type;
+
+ _Iterator _M_base;
+ difference_type _M_n;
+
+ public:
+ _After_nth_from(const difference_type& __n, const _Iterator& __base)
+ : _M_base(__base), _M_n(__n) { }
+
+ bool
+ operator()(const _Iterator& __x) const
+ { return __x - _M_base >= _M_n; }
+ };
+
+ /**
+ * @brief Base class for constructing a "safe" sequence type that
+ * tracks iterators that reference it.
+ *
+ * The class template %_Safe_sequence simplifies the construction of
+ * "safe" sequences that track the iterators that reference the
+ * sequence, so that the iterators are notified of changes in the
+ * sequence that may affect their operation, e.g., if the container
+ * invalidates its iterators or is destructed. This class template
+ * may only be used by deriving from it and passing the name of the
+ * derived class as its template parameter via the curiously
+ * recurring template pattern. The derived class must have @c
+ * iterator and @const_iterator types that are instantiations of
+ * class template _Safe_iterator for this sequence. Iterators will
+ * then be tracked automatically.
+ */
+ template<typename _Sequence>
+ class _Safe_sequence : public _Safe_sequence_base
+ {
+ public:
+ /** Invalidates all iterators @c x that reference this sequence,
+ are not singular, and for which @c pred(x) returns @c
+ true. The user of this routine should be careful not to make
+ copies of the iterators passed to @p pred, as the copies may
+ interfere with the invalidation. */
+ template<typename _Predicate>
+ void
+ _M_invalidate_if(_Predicate __pred);
+
+ /** Transfers all iterators that reference this memory location
+ to this sequence from whatever sequence they are attached
+ to. */
+ template<typename _Iterator>
+ void
+ _M_transfer_iter(const _Safe_iterator<_Iterator, _Sequence>& __x);
+ };
+
+ template<typename _Sequence>
+ template<typename _Predicate>
+ void
+ _Safe_sequence<_Sequence>::
+ _M_invalidate_if(_Predicate __pred)
+ {
+ typedef typename _Sequence::iterator iterator;
+ typedef typename _Sequence::const_iterator const_iterator;
+
+ __gnu_cxx::__scoped_lock sentry(this->_M_get_mutex());
+ for (_Safe_iterator_base* __iter = _M_iterators; __iter;)
+ {
+ iterator* __victim = static_cast<iterator*>(__iter);
+ __iter = __iter->_M_next;
+ if (!__victim->_M_singular())
+ {
+ if (__pred(__victim->base()))
+ __victim->_M_invalidate_single();
+ }
+ }
+
+ for (_Safe_iterator_base* __iter2 = _M_const_iterators; __iter2;)
+ {
+ const_iterator* __victim = static_cast<const_iterator*>(__iter2);
+ __iter2 = __iter2->_M_next;
+ if (!__victim->_M_singular())
+ {
+ if (__pred(__victim->base()))
+ __victim->_M_invalidate_single();
+ }
+ }
+ }
+
+ template<typename _Sequence>
+ template<typename _Iterator>
+ void
+ _Safe_sequence<_Sequence>::
+ _M_transfer_iter(const _Safe_iterator<_Iterator, _Sequence>& __x)
+ {
+ _Safe_sequence_base* __from = __x._M_sequence;
+ if (!__from)
+ return;
+
+ typedef typename _Sequence::iterator iterator;
+ typedef typename _Sequence::const_iterator const_iterator;
+
+ __gnu_cxx::__scoped_lock sentry(this->_M_get_mutex());
+ for (_Safe_iterator_base* __iter = __from->_M_iterators; __iter;)
+ {
+ iterator* __victim = static_cast<iterator*>(__iter);
+ __iter = __iter->_M_next;
+ if (!__victim->_M_singular() && __victim->base() == __x.base())
+ __victim->_M_attach_single(static_cast<_Sequence*>(this));
+ }
+
+ for (_Safe_iterator_base* __iter2 = __from->_M_const_iterators;
+ __iter2;)
+ {
+ const_iterator* __victim = static_cast<const_iterator*>(__iter2);
+ __iter2 = __iter2->_M_next;
+ if (!__victim->_M_singular() && __victim->base() == __x.base())
+ __victim->_M_attach_single(static_cast<_Sequence*>(this));
+ }
+ }
+} // namespace __gnu_debug
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/set b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/set
new file mode 100644
index 0000000..34f3ea5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/set
@@ -0,0 +1,37 @@
+// Debugging set/multiset implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/set
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_SET
+#define _GLIBCXX_DEBUG_SET 1
+
+#include <set>
+#include <debug/set.h>
+#include <debug/multiset.h>
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/set.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/set.h
new file mode 100644
index 0000000..a025b3d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/set.h
@@ -0,0 +1,401 @@
+// Debugging set implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/set.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_SET_H
+#define _GLIBCXX_DEBUG_SET_H 1
+
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+#include <utility>
+
+namespace std
+{
+namespace __debug
+{
+ template<typename _Key, typename _Compare = std::less<_Key>,
+ typename _Allocator = std::allocator<_Key> >
+ class set
+ : public _GLIBCXX_STD_D::set<_Key,_Compare,_Allocator>,
+ public __gnu_debug::_Safe_sequence<set<_Key, _Compare, _Allocator> >
+ {
+ typedef _GLIBCXX_STD_D::set<_Key, _Compare, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<set> _Safe_base;
+
+ public:
+ // types:
+ typedef _Key key_type;
+ typedef _Key value_type;
+ typedef _Compare key_compare;
+ typedef _Compare value_compare;
+ typedef _Allocator allocator_type;
+ typedef typename _Base::reference reference;
+ typedef typename _Base::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, set>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator, set>
+ const_iterator;
+
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+ typedef typename _Base::pointer pointer;
+ typedef typename _Base::const_pointer const_pointer;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ // 23.3.3.1 construct/copy/destroy:
+ explicit set(const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__comp, __a) { }
+
+ template<typename _InputIterator>
+ set(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__first, __last), __last,
+ __comp, __a) { }
+
+ set(const set& __x)
+ : _Base(__x), _Safe_base() { }
+
+ set(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ set(set&& __x)
+ : _Base(std::forward<set>(__x)), _Safe_base()
+ { this->_M_swap(__x); }
+
+ set(initializer_list<value_type> __l,
+ const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __comp, __a), _Safe_base() { }
+#endif
+
+ ~set() { }
+
+ set&
+ operator=(const set& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ set&
+ operator=(set&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ set&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+#endif
+
+ using _Base::get_allocator;
+
+ // iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ // capacity:
+ using _Base::empty;
+ using _Base::size;
+ using _Base::max_size;
+
+ // modifiers:
+ std::pair<iterator, bool>
+ insert(const value_type& __x)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, bool> __res = _Base::insert(__x);
+ return std::pair<iterator, bool>(iterator(__res.first, this),
+ __res.second);
+ }
+
+ iterator
+ insert(iterator __position, const value_type& __x)
+ {
+ __glibcxx_check_insert(__position);
+ return iterator(_Base::insert(__position.base(), __x), this);
+ }
+
+ template <typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first, __last);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ insert(initializer_list<value_type> __l)
+ { _Base::insert(__l); }
+#endif
+
+ void
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ __position._M_invalidate();
+ _Base::erase(__position.base());
+ }
+
+ size_type
+ erase(const key_type& __x)
+ {
+ iterator __victim = find(__x);
+ if (__victim == end())
+ return 0;
+ else
+ {
+ __victim._M_invalidate();
+ _Base::erase(__victim.base());
+ return 1;
+ }
+ }
+
+ void
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+
+ while (__first != __last)
+ this->erase(__first++);
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(set&& __x)
+#else
+ swap(set& __x)
+#endif
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ void
+ clear()
+ { this->erase(begin(), end()); }
+
+ // observers:
+ using _Base::key_comp;
+ using _Base::value_comp;
+
+ // set operations:
+ iterator
+ find(const key_type& __x)
+ { return iterator(_Base::find(__x), this); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ const_iterator
+ find(const key_type& __x) const
+ { return const_iterator(_Base::find(__x), this); }
+
+ using _Base::count;
+
+ iterator
+ lower_bound(const key_type& __x)
+ { return iterator(_Base::lower_bound(__x), this); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return const_iterator(_Base::lower_bound(__x), this); }
+
+ iterator
+ upper_bound(const key_type& __x)
+ { return iterator(_Base::upper_bound(__x), this); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return const_iterator(_Base::upper_bound(__x), this); }
+
+ std::pair<iterator,iterator>
+ equal_range(const key_type& __x)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ std::pair<const_iterator,const_iterator>
+ equal_range(const key_type& __x) const
+ {
+ typedef typename _Base::const_iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator==(const set<_Key, _Compare, _Allocator>& __lhs,
+ const set<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator!=(const set<_Key, _Compare, _Allocator>& __lhs,
+ const set<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator<(const set<_Key, _Compare, _Allocator>& __lhs,
+ const set<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator<=(const set<_Key, _Compare, _Allocator>& __lhs,
+ const set<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator>=(const set<_Key, _Compare, _Allocator>& __lhs,
+ const set<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator>(const set<_Key, _Compare, _Allocator>& __lhs,
+ const set<_Key, _Compare, _Allocator>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ void
+ swap(set<_Key, _Compare, _Allocator>& __x,
+ set<_Key, _Compare, _Allocator>& __y)
+ { return __x.swap(__y); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Key, typename _Compare, typename _Allocator>
+ void
+ swap(set<_Key, _Compare, _Allocator>&& __x,
+ set<_Key, _Compare, _Allocator>& __y)
+ { return __x.swap(__y); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ void
+ swap(set<_Key, _Compare, _Allocator>& __x,
+ set<_Key, _Compare, _Allocator>&& __y)
+ { return __x.swap(__y); }
+#endif
+
+} // namespace __debug
+} // namespace std
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/string b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/string
new file mode 100644
index 0000000..d88989a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/string
@@ -0,0 +1,1074 @@
+// Debugging string implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2005, 2006, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/string
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_STRING
+#define _GLIBCXX_DEBUG_STRING 1
+
+#include <string>
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+
+namespace __gnu_debug
+{
+ template<typename _CharT, typename _Traits = std::char_traits<_CharT>,
+ typename _Allocator = std::allocator<_CharT> >
+ class basic_string
+ : public std::basic_string<_CharT, _Traits, _Allocator>,
+ public __gnu_debug::_Safe_sequence<basic_string<_CharT, _Traits,
+ _Allocator> >
+ {
+ typedef std::basic_string<_CharT, _Traits, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<basic_string> _Safe_base;
+
+ public:
+ // types:
+ typedef _Traits traits_type;
+ typedef typename _Traits::char_type value_type;
+ typedef _Allocator allocator_type;
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+ typedef typename _Base::reference reference;
+ typedef typename _Base::const_reference const_reference;
+ typedef typename _Base::pointer pointer;
+ typedef typename _Base::const_pointer const_pointer;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, basic_string>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,
+ basic_string> const_iterator;
+
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ using _Base::npos;
+
+ // 21.3.1 construct/copy/destroy:
+ explicit basic_string(const _Allocator& __a = _Allocator())
+ : _Base(__a)
+ { }
+
+ // Provides conversion from a release-mode string to a debug-mode string
+ basic_string(const _Base& __base) : _Base(__base), _Safe_base() { }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 42. string ctors specify wrong default allocator
+ basic_string(const basic_string& __str)
+ : _Base(__str, 0, _Base::npos, __str.get_allocator()), _Safe_base()
+ { }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 42. string ctors specify wrong default allocator
+ basic_string(const basic_string& __str, size_type __pos,
+ size_type __n = _Base::npos,
+ const _Allocator& __a = _Allocator())
+ : _Base(__str, __pos, __n, __a)
+ { }
+
+ basic_string(const _CharT* __s, size_type __n,
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_string(__s, __n), __n, __a)
+ { }
+
+ basic_string(const _CharT* __s, const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_string(__s), __a)
+ { this->assign(__s); }
+
+ basic_string(size_type __n, _CharT __c,
+ const _Allocator& __a = _Allocator())
+ : _Base(__n, __c, __a)
+ { }
+
+ template<typename _InputIterator>
+ basic_string(_InputIterator __begin, _InputIterator __end,
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__begin, __end), __end, __a)
+ { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
+ : _Base(__l, __a)
+ { }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ ~basic_string() { }
+
+ basic_string&
+ operator=(const basic_string& __str)
+ {
+ *static_cast<_Base*>(this) = __str;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ operator=(const _CharT* __s)
+ {
+ __glibcxx_check_string(__s);
+ *static_cast<_Base*>(this) = __s;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ operator=(_CharT __c)
+ {
+ *static_cast<_Base*>(this) = __c;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ basic_string&
+ operator=(initializer_list<_CharT> __l)
+ {
+ *static_cast<_Base*>(this) = __l;
+ this->_M_invalidate_all();
+ return *this;
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ // 21.3.2 iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+ // 21.3.3 capacity:
+ using _Base::size;
+ using _Base::length;
+ using _Base::max_size;
+
+ void
+ resize(size_type __n, _CharT __c)
+ {
+ _Base::resize(__n, __c);
+ this->_M_invalidate_all();
+ }
+
+ void
+ resize(size_type __n)
+ { this->resize(__n, _CharT()); }
+
+ using _Base::capacity;
+ using _Base::reserve;
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ }
+
+ using _Base::empty;
+
+ // 21.3.4 element access:
+ const_reference
+ operator[](size_type __pos) const
+ {
+ _GLIBCXX_DEBUG_VERIFY(__pos <= this->size(),
+ _M_message(__gnu_debug::__msg_subscript_oob)
+ ._M_sequence(*this, "this")
+ ._M_integer(__pos, "__pos")
+ ._M_integer(this->size(), "size"));
+ return _M_base()[__pos];
+ }
+
+ reference
+ operator[](size_type __pos)
+ {
+#ifdef _GLIBCXX_DEBUG_PEDANTIC
+ __glibcxx_check_subscript(__pos);
+#else
+ // as an extension v3 allows s[s.size()] when s is non-const.
+ _GLIBCXX_DEBUG_VERIFY(__pos <= this->size(),
+ _M_message(__gnu_debug::__msg_subscript_oob)
+ ._M_sequence(*this, "this")
+ ._M_integer(__pos, "__pos")
+ ._M_integer(this->size(), "size"));
+#endif
+ return _M_base()[__pos];
+ }
+
+ using _Base::at;
+
+ // 21.3.5 modifiers:
+ basic_string&
+ operator+=(const basic_string& __str)
+ {
+ _M_base() += __str;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ operator+=(const _CharT* __s)
+ {
+ __glibcxx_check_string(__s);
+ _M_base() += __s;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ operator+=(_CharT __c)
+ {
+ _M_base() += __c;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ basic_string&
+ operator+=(initializer_list<_CharT> __l)
+ {
+ _M_base() += __l;
+ this->_M_invalidate_all();
+ return *this;
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ basic_string&
+ append(const basic_string& __str)
+ {
+ _Base::append(__str);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ append(const basic_string& __str, size_type __pos, size_type __n)
+ {
+ _Base::append(__str, __pos, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ append(const _CharT* __s, size_type __n)
+ {
+ __glibcxx_check_string_len(__s, __n);
+ _Base::append(__s, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ append(const _CharT* __s)
+ {
+ __glibcxx_check_string(__s);
+ _Base::append(__s);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ append(size_type __n, _CharT __c)
+ {
+ _Base::append(__n, __c);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ template<typename _InputIterator>
+ basic_string&
+ append(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::append(__first, __last);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 7. string clause minor problems
+ void
+ push_back(_CharT __c)
+ {
+ _Base::push_back(__c);
+ this->_M_invalidate_all();
+ }
+
+ basic_string&
+ assign(const basic_string& __x)
+ {
+ _Base::assign(__x);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ assign(const basic_string& __str, size_type __pos, size_type __n)
+ {
+ _Base::assign(__str, __pos, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ assign(const _CharT* __s, size_type __n)
+ {
+ __glibcxx_check_string_len(__s, __n);
+ _Base::assign(__s, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ assign(const _CharT* __s)
+ {
+ __glibcxx_check_string(__s);
+ _Base::assign(__s);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ assign(size_type __n, _CharT __c)
+ {
+ _Base::assign(__n, __c);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ template<typename _InputIterator>
+ basic_string&
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::assign(__first, __last);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ basic_string&
+ assign(initializer_list<_CharT> __l)
+ {
+ _Base::assign(__l);
+ this->_M_invalidate_all();
+ return *this;
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ basic_string&
+ insert(size_type __pos1, const basic_string& __str)
+ {
+ _Base::insert(__pos1, __str);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ insert(size_type __pos1, const basic_string& __str,
+ size_type __pos2, size_type __n)
+ {
+ _Base::insert(__pos1, __str, __pos2, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ insert(size_type __pos, const _CharT* __s, size_type __n)
+ {
+ __glibcxx_check_string(__s);
+ _Base::insert(__pos, __s, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ insert(size_type __pos, const _CharT* __s)
+ {
+ __glibcxx_check_string(__s);
+ _Base::insert(__pos, __s);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ insert(size_type __pos, size_type __n, _CharT __c)
+ {
+ _Base::insert(__pos, __n, __c);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ iterator
+ insert(iterator __p, _CharT __c)
+ {
+ __glibcxx_check_insert(__p);
+ typename _Base::iterator __res = _Base::insert(__p.base(), __c);
+ this->_M_invalidate_all();
+ return iterator(__res, this);
+ }
+
+ void
+ insert(iterator __p, size_type __n, _CharT __c)
+ {
+ __glibcxx_check_insert(__p);
+ _Base::insert(__p.base(), __n, __c);
+ this->_M_invalidate_all();
+ }
+
+ template<typename _InputIterator>
+ void
+ insert(iterator __p, _InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_insert_range(__p, __first, __last);
+ _Base::insert(__p.base(), __first, __last);
+ this->_M_invalidate_all();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ insert(iterator __p, initializer_list<_CharT> __l)
+ {
+ _Base::insert(__p, __l);
+ this->_M_invalidate_all();
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ basic_string&
+ erase(size_type __pos = 0, size_type __n = _Base::npos)
+ {
+ _Base::erase(__pos, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ iterator
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ typename _Base::iterator __res = _Base::erase(__position.base());
+ this->_M_invalidate_all();
+ return iterator(__res, this);
+ }
+
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+ typename _Base::iterator __res = _Base::erase(__first.base(),
+ __last.base());
+ this->_M_invalidate_all();
+ return iterator(__res, this);
+ }
+
+ basic_string&
+ replace(size_type __pos1, size_type __n1, const basic_string& __str)
+ {
+ _Base::replace(__pos1, __n1, __str);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(size_type __pos1, size_type __n1, const basic_string& __str,
+ size_type __pos2, size_type __n2)
+ {
+ _Base::replace(__pos1, __n1, __str, __pos2, __n2);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(size_type __pos, size_type __n1, const _CharT* __s,
+ size_type __n2)
+ {
+ __glibcxx_check_string_len(__s, __n2);
+ _Base::replace(__pos, __n1, __s, __n2);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(size_type __pos, size_type __n1, const _CharT* __s)
+ {
+ __glibcxx_check_string(__s);
+ _Base::replace(__pos, __n1, __s);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
+ {
+ _Base::replace(__pos, __n1, __n2, __c);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(iterator __i1, iterator __i2, const basic_string& __str)
+ {
+ __glibcxx_check_erase_range(__i1, __i2);
+ _Base::replace(__i1.base(), __i2.base(), __str);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n)
+ {
+ __glibcxx_check_erase_range(__i1, __i2);
+ __glibcxx_check_string_len(__s, __n);
+ _Base::replace(__i1.base(), __i2.base(), __s, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(iterator __i1, iterator __i2, const _CharT* __s)
+ {
+ __glibcxx_check_erase_range(__i1, __i2);
+ __glibcxx_check_string(__s);
+ _Base::replace(__i1.base(), __i2.base(), __s);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
+ {
+ __glibcxx_check_erase_range(__i1, __i2);
+ _Base::replace(__i1.base(), __i2.base(), __n, __c);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ template<typename _InputIterator>
+ basic_string&
+ replace(iterator __i1, iterator __i2,
+ _InputIterator __j1, _InputIterator __j2)
+ {
+ __glibcxx_check_erase_range(__i1, __i2);
+ __glibcxx_check_valid_range(__j1, __j2);
+ _Base::replace(__i1.base(), __i2.base(), __j1, __j2);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ basic_string& replace(iterator __i1, iterator __i2,
+ initializer_list<_CharT> __l)
+ {
+ __glibcxx_check_erase_range(__i1, __i2);
+ _Base::replace(__i1.base(), __i2.base(), __l);
+ this->_M_invalidate_all();
+ return *this;
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ size_type
+ copy(_CharT* __s, size_type __n, size_type __pos = 0) const
+ {
+ __glibcxx_check_string_len(__s, __n);
+ return _Base::copy(__s, __n, __pos);
+ }
+
+ void
+ swap(basic_string<_CharT,_Traits,_Allocator>& __x)
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ this->_M_invalidate_all();
+ __x._M_invalidate_all();
+ }
+
+ // 21.3.6 string operations:
+ const _CharT*
+ c_str() const
+ {
+ const _CharT* __res = _Base::c_str();
+ this->_M_invalidate_all();
+ return __res;
+ }
+
+ const _CharT*
+ data() const
+ {
+ const _CharT* __res = _Base::data();
+ this->_M_invalidate_all();
+ return __res;
+ }
+
+ using _Base::get_allocator;
+
+ size_type
+ find(const basic_string& __str, size_type __pos = 0) const
+ { return _Base::find(__str, __pos); }
+
+ size_type
+ find(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find(__s, __pos, __n);
+ }
+
+ size_type
+ find(const _CharT* __s, size_type __pos = 0) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find(__s, __pos);
+ }
+
+ size_type
+ find(_CharT __c, size_type __pos = 0) const
+ { return _Base::find(__c, __pos); }
+
+ size_type
+ rfind(const basic_string& __str, size_type __pos = _Base::npos) const
+ { return _Base::rfind(__str, __pos); }
+
+ size_type
+ rfind(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_check_string_len(__s, __n);
+ return _Base::rfind(__s, __pos, __n);
+ }
+
+ size_type
+ rfind(const _CharT* __s, size_type __pos = _Base::npos) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::rfind(__s, __pos);
+ }
+
+ size_type
+ rfind(_CharT __c, size_type __pos = _Base::npos) const
+ { return _Base::rfind(__c, __pos); }
+
+ size_type
+ find_first_of(const basic_string& __str, size_type __pos = 0) const
+ { return _Base::find_first_of(__str, __pos); }
+
+ size_type
+ find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find_first_of(__s, __pos, __n);
+ }
+
+ size_type
+ find_first_of(const _CharT* __s, size_type __pos = 0) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find_first_of(__s, __pos);
+ }
+
+ size_type
+ find_first_of(_CharT __c, size_type __pos = 0) const
+ { return _Base::find_first_of(__c, __pos); }
+
+ size_type
+ find_last_of(const basic_string& __str,
+ size_type __pos = _Base::npos) const
+ { return _Base::find_last_of(__str, __pos); }
+
+ size_type
+ find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find_last_of(__s, __pos, __n);
+ }
+
+ size_type
+ find_last_of(const _CharT* __s, size_type __pos = _Base::npos) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find_last_of(__s, __pos);
+ }
+
+ size_type
+ find_last_of(_CharT __c, size_type __pos = _Base::npos) const
+ { return _Base::find_last_of(__c, __pos); }
+
+ size_type
+ find_first_not_of(const basic_string& __str, size_type __pos = 0) const
+ { return _Base::find_first_not_of(__str, __pos); }
+
+ size_type
+ find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_check_string_len(__s, __n);
+ return _Base::find_first_not_of(__s, __pos, __n);
+ }
+
+ size_type
+ find_first_not_of(const _CharT* __s, size_type __pos = 0) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find_first_not_of(__s, __pos);
+ }
+
+ size_type
+ find_first_not_of(_CharT __c, size_type __pos = 0) const
+ { return _Base::find_first_not_of(__c, __pos); }
+
+ size_type
+ find_last_not_of(const basic_string& __str,
+ size_type __pos = _Base::npos) const
+ { return _Base::find_last_not_of(__str, __pos); }
+
+ size_type
+ find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find_last_not_of(__s, __pos, __n);
+ }
+
+ size_type
+ find_last_not_of(const _CharT* __s, size_type __pos = _Base::npos) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find_last_not_of(__s, __pos);
+ }
+
+ size_type
+ find_last_not_of(_CharT __c, size_type __pos = _Base::npos) const
+ { return _Base::find_last_not_of(__c, __pos); }
+
+ basic_string
+ substr(size_type __pos = 0, size_type __n = _Base::npos) const
+ { return basic_string(_Base::substr(__pos, __n)); }
+
+ int
+ compare(const basic_string& __str) const
+ { return _Base::compare(__str); }
+
+ int
+ compare(size_type __pos1, size_type __n1,
+ const basic_string& __str) const
+ { return _Base::compare(__pos1, __n1, __str); }
+
+ int
+ compare(size_type __pos1, size_type __n1, const basic_string& __str,
+ size_type __pos2, size_type __n2) const
+ { return _Base::compare(__pos1, __n1, __str, __pos2, __n2); }
+
+ int
+ compare(const _CharT* __s) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::compare(__s);
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 5. string::compare specification questionable
+ int
+ compare(size_type __pos1, size_type __n1, const _CharT* __s) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::compare(__pos1, __n1, __s);
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 5. string::compare specification questionable
+ int
+ compare(size_type __pos1, size_type __n1,const _CharT* __s,
+ size_type __n2) const
+ {
+ __glibcxx_check_string_len(__s, __n2);
+ return _Base::compare(__pos1, __n1, __s, __n2);
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ using _Safe_base::_M_invalidate_all;
+ };
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline basic_string<_CharT,_Traits,_Allocator>
+ operator+(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return basic_string<_CharT,_Traits,_Allocator>(__lhs) += __rhs; }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline basic_string<_CharT,_Traits,_Allocator>
+ operator+(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ {
+ __glibcxx_check_string(__lhs);
+ return basic_string<_CharT,_Traits,_Allocator>(__lhs) += __rhs;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline basic_string<_CharT,_Traits,_Allocator>
+ operator+(_CharT __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return basic_string<_CharT,_Traits,_Allocator>(1, __lhs) += __rhs; }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline basic_string<_CharT,_Traits,_Allocator>
+ operator+(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_check_string(__rhs);
+ return basic_string<_CharT,_Traits,_Allocator>(__lhs) += __rhs;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline basic_string<_CharT,_Traits,_Allocator>
+ operator+(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ _CharT __rhs)
+ { return basic_string<_CharT,_Traits,_Allocator>(__lhs) += __rhs; }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator==(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator==(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ {
+ __glibcxx_check_string(__lhs);
+ return __lhs == __rhs._M_base();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator==(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_check_string(__rhs);
+ return __lhs._M_base() == __rhs;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator!=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator!=(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ {
+ __glibcxx_check_string(__lhs);
+ return __lhs != __rhs._M_base();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator!=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_check_string(__rhs);
+ return __lhs._M_base() != __rhs;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator<(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator<(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ {
+ __glibcxx_check_string(__lhs);
+ return __lhs < __rhs._M_base();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator<(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_check_string(__rhs);
+ return __lhs._M_base() < __rhs;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator<=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator<=(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ {
+ __glibcxx_check_string(__lhs);
+ return __lhs <= __rhs._M_base();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator<=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_check_string(__rhs);
+ return __lhs._M_base() <= __rhs;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator>=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator>=(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ {
+ __glibcxx_check_string(__lhs);
+ return __lhs >= __rhs._M_base();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator>=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_check_string(__rhs);
+ return __lhs._M_base() >= __rhs;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator>(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator>(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ {
+ __glibcxx_check_string(__lhs);
+ return __lhs > __rhs._M_base();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator>(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_check_string(__rhs);
+ return __lhs._M_base() > __rhs;
+ }
+
+ // 21.3.7.8:
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline void
+ swap(basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const basic_string<_CharT, _Traits, _Allocator>& __str)
+ { return __os << __str._M_base(); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ std::basic_istream<_CharT,_Traits>&
+ operator>>(std::basic_istream<_CharT,_Traits>& __is,
+ basic_string<_CharT,_Traits,_Allocator>& __str)
+ {
+ std::basic_istream<_CharT,_Traits>& __res = __is >> __str._M_base();
+ __str._M_invalidate_all();
+ return __res;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ std::basic_istream<_CharT,_Traits>&
+ getline(std::basic_istream<_CharT,_Traits>& __is,
+ basic_string<_CharT,_Traits,_Allocator>& __str, _CharT __delim)
+ {
+ std::basic_istream<_CharT,_Traits>& __res = getline(__is,
+ __str._M_base(),
+ __delim);
+ __str._M_invalidate_all();
+ return __res;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ std::basic_istream<_CharT,_Traits>&
+ getline(std::basic_istream<_CharT,_Traits>& __is,
+ basic_string<_CharT,_Traits,_Allocator>& __str)
+ {
+ std::basic_istream<_CharT,_Traits>& __res = getline(__is,
+ __str._M_base());
+ __str._M_invalidate_all();
+ return __res;
+ }
+
+ typedef basic_string<char> string;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ typedef basic_string<wchar_t> wstring;
+#endif
+
+} // namespace __gnu_debug
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/unordered_map b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/unordered_map
new file mode 100644
index 0000000..fd7c31e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/unordered_map
@@ -0,0 +1,608 @@
+// Debugging unordered_map/unordered_multimap implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/unordered_map
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_UNORDERED_MAP
+#define _GLIBCXX_DEBUG_UNORDERED_MAP 1
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# include <unordered_map>
+#else
+# include <c++0x_warning.h>
+#endif
+
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+#include <initializer_list>
+
+namespace std
+{
+namespace __debug
+{
+ template<typename _Key, typename _Tp,
+ typename _Hash = std::hash<_Key>,
+ typename _Pred = std::equal_to<_Key>,
+ typename _Alloc = std::allocator<_Key> >
+ class unordered_map
+ : public _GLIBCXX_STD_D::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>,
+ public __gnu_debug::_Safe_sequence<unordered_map<_Key, _Tp, _Hash,
+ _Pred, _Alloc> >
+ {
+ typedef _GLIBCXX_STD_D::unordered_map<_Key, _Tp, _Hash,
+ _Pred, _Alloc> _Base;
+ typedef __gnu_debug::_Safe_sequence<unordered_map> _Safe_base;
+
+ public:
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ typedef typename _Base::key_type key_type;
+ typedef typename _Base::value_type value_type;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator,
+ unordered_map> iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,
+ unordered_map> const_iterator;
+
+ explicit
+ unordered_map(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __eql, __a) { }
+
+ template<typename _InputIterator>
+ unordered_map(_InputIterator __f, _InputIterator __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n,
+ __hf, __eql, __a), _Safe_base() { }
+
+ unordered_map(const unordered_map& __x)
+ : _Base(__x), _Safe_base() { }
+
+ unordered_map(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+ unordered_map(unordered_map&& __x)
+ : _Base(std::forward<unordered_map>(__x)), _Safe_base() { }
+
+ unordered_map(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __n, __hf, __eql, __a), _Safe_base() { }
+
+ unordered_map&
+ operator=(const unordered_map& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ unordered_map&
+ operator=(unordered_map&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ unordered_map&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+
+ void
+ swap(unordered_map&& __x)
+ {
+ _Base::swap(__x);
+ _Safe_base::_M_swap(__x);
+ }
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ }
+
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ // local versions
+ using _Base::begin;
+ using _Base::end;
+ using _Base::cbegin;
+ using _Base::cend;
+
+ std::pair<iterator, bool>
+ insert(const value_type& __obj)
+ {
+ typedef std::pair<typename _Base::iterator, bool> __pair_type;
+ __pair_type __res = _Base::insert(__obj);
+ return std::make_pair(iterator(__res.first, this), __res.second);
+ }
+
+ iterator
+ insert(iterator, const value_type& __obj)
+ {
+ typedef std::pair<typename _Base::iterator, bool> __pair_type;
+ __pair_type __res = _Base::insert(__obj);
+ return iterator(__res.first, this);
+ }
+
+ const_iterator
+ insert(const_iterator, const value_type& __obj)
+ {
+ typedef std::pair<typename _Base::iterator, bool> __pair_type;
+ __pair_type __res = _Base::insert(__obj);
+ return const_iterator(__res.first, this);
+ }
+
+ void
+ insert(std::initializer_list<value_type> __l)
+ { _Base::insert(__l); }
+
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first, __last);
+ }
+
+ iterator
+ find(const key_type& __key)
+ { return iterator(_Base::find(__key), this); }
+
+ const_iterator
+ find(const key_type& __key) const
+ { return const_iterator(_Base::find(__key), this); }
+
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __key)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ typedef std::pair<_Base_iterator, _Base_iterator> __pair_type;
+ __pair_type __res = _Base::equal_range(__key);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __key) const
+ {
+ typedef typename _Base::const_iterator _Base_iterator;
+ typedef std::pair<_Base_iterator, _Base_iterator> __pair_type;
+ __pair_type __res = _Base::equal_range(__key);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ size_type
+ erase(const key_type& __key)
+ {
+ size_type __ret(0);
+ iterator __victim(_Base::find(__key), this);
+ if (__victim != end())
+ {
+ this->erase(__victim);
+ __ret = 1;
+ }
+ return __ret;
+ }
+
+ iterator
+ erase(iterator __it)
+ {
+ __glibcxx_check_erase(__it);
+ __it._M_invalidate();
+ return iterator(_Base::erase(__it.base()), this);
+ }
+
+ const_iterator
+ erase(const_iterator __it)
+ {
+ __glibcxx_check_erase(__it);
+ __it._M_invalidate();
+ return const_iterator(_Base::erase(__it.base()), this);
+ }
+
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ __glibcxx_check_erase_range(__first, __last);
+ for (iterator __tmp = __first; __tmp != __last;)
+ {
+ iterator __victim = __tmp++;
+ __victim._M_invalidate();
+ }
+ return iterator(_Base::erase(__first.base(),
+ __last.base()), this);
+ }
+
+ const_iterator
+ erase(const_iterator __first, const_iterator __last)
+ {
+ __glibcxx_check_erase_range(__first, __last);
+ for (const_iterator __tmp = __first; __tmp != __last;)
+ {
+ const_iterator __victim = __tmp++;
+ __victim._M_invalidate();
+ }
+ return const_iterator(_Base::erase(__first.base(),
+ __last.base()), this);
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Key, typename _Tp, typename _Hash,
+ typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
+ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Key, typename _Tp, typename _Hash,
+ typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&& __x,
+ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Key, typename _Tp, typename _Hash,
+ typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
+ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&& __y)
+ { __x.swap(__y); }
+
+
+ template<typename _Key, typename _Tp,
+ typename _Hash = std::hash<_Key>,
+ typename _Pred = std::equal_to<_Key>,
+ typename _Alloc = std::allocator<_Key> >
+ class unordered_multimap
+ : public _GLIBCXX_STD_D::unordered_multimap<_Key, _Tp, _Hash,
+ _Pred, _Alloc>,
+ public __gnu_debug::_Safe_sequence<unordered_multimap<_Key, _Tp, _Hash,
+ _Pred, _Alloc> >
+ {
+ typedef _GLIBCXX_STD_D::unordered_multimap<_Key, _Tp, _Hash,
+ _Pred, _Alloc> _Base;
+ typedef __gnu_debug::_Safe_sequence<unordered_multimap> _Safe_base;
+
+ public:
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ typedef typename _Base::key_type key_type;
+ typedef typename _Base::value_type value_type;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator,
+ unordered_multimap> iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,
+ unordered_multimap> const_iterator;
+
+ explicit
+ unordered_multimap(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __eql, __a) { }
+
+ template<typename _InputIterator>
+ unordered_multimap(_InputIterator __f, _InputIterator __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n,
+ __hf, __eql, __a), _Safe_base() { }
+
+ unordered_multimap(const unordered_multimap& __x)
+ : _Base(__x), _Safe_base() { }
+
+ unordered_multimap(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+ unordered_multimap(unordered_multimap&& __x)
+ : _Base(std::forward<unordered_multimap>(__x)), _Safe_base() { }
+
+ unordered_multimap(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __n, __hf, __eql, __a), _Safe_base() { }
+
+ unordered_multimap&
+ operator=(const unordered_multimap& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ unordered_multimap&
+ operator=(unordered_multimap&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ unordered_multimap&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+
+ void
+ swap(unordered_multimap&& __x)
+ {
+ _Base::swap(__x);
+ _Safe_base::_M_swap(__x);
+ }
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ }
+
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ // local versions
+ using _Base::begin;
+ using _Base::end;
+ using _Base::cbegin;
+ using _Base::cend;
+
+ iterator
+ insert(const value_type& __obj)
+ { return iterator(_Base::insert(__obj), this); }
+
+ iterator
+ insert(iterator, const value_type& __obj)
+ { return iterator(_Base::insert(__obj), this); }
+
+ const_iterator
+ insert(const_iterator, const value_type& __obj)
+ { return const_iterator(_Base::insert(__obj), this); }
+
+ void
+ insert(std::initializer_list<value_type> __l)
+ { _Base::insert(__l); }
+
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first, __last);
+ }
+
+ iterator
+ find(const key_type& __key)
+ { return iterator(_Base::find(__key), this); }
+
+ const_iterator
+ find(const key_type& __key) const
+ { return const_iterator(_Base::find(__key), this); }
+
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __key)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ typedef std::pair<_Base_iterator, _Base_iterator> __pair_type;
+ __pair_type __res = _Base::equal_range(__key);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __key) const
+ {
+ typedef typename _Base::const_iterator _Base_iterator;
+ typedef std::pair<_Base_iterator, _Base_iterator> __pair_type;
+ __pair_type __res = _Base::equal_range(__key);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ size_type
+ erase(const key_type& __key)
+ {
+ size_type __ret(0);
+ iterator __victim(_Base::find(__key), this);
+ if (__victim != end())
+ {
+ this->erase(__victim);
+ __ret = 1;
+ }
+ return __ret;
+ }
+
+ iterator
+ erase(iterator __it)
+ {
+ __glibcxx_check_erase(__it);
+ __it._M_invalidate();
+ return iterator(_Base::erase(__it.base()), this);
+ }
+
+ const_iterator
+ erase(const_iterator __it)
+ {
+ __glibcxx_check_erase(__it);
+ __it._M_invalidate();
+ return const_iterator(_Base::erase(__it.base()), this);
+ }
+
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ __glibcxx_check_erase_range(__first, __last);
+ for (iterator __tmp = __first; __tmp != __last;)
+ {
+ iterator __victim = __tmp++;
+ __victim._M_invalidate();
+ }
+ return iterator(_Base::erase(__first.base(),
+ __last.base()), this);
+ }
+
+ const_iterator
+ erase(const_iterator __first, const_iterator __last)
+ {
+ __glibcxx_check_erase_range(__first, __last);
+ for (const_iterator __tmp = __first; __tmp != __last;)
+ {
+ const_iterator __victim = __tmp++;
+ __victim._M_invalidate();
+ }
+ return const_iterator(_Base::erase(__first.base(),
+ __last.base()), this);
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Key, typename _Tp, typename _Hash,
+ typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
+ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Key, typename _Tp, typename _Hash,
+ typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&& __x,
+ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Key, typename _Tp, typename _Hash,
+ typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
+ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&& __y)
+ { __x.swap(__y); }
+
+} // namespace __debug
+} // namespace std
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/unordered_set b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/unordered_set
new file mode 100644
index 0000000..d340442
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/unordered_set
@@ -0,0 +1,601 @@
+// Debugging unordered_set/unordered_multiset implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/unordered_set
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_UNORDERED_SET
+#define _GLIBCXX_DEBUG_UNORDERED_SET 1
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# include <unordered_set>
+#else
+# include <c++0x_warning.h>
+#endif
+
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+#include <initializer_list>
+
+namespace std
+{
+namespace __debug
+{
+ template<typename _Value,
+ typename _Hash = std::hash<_Value>,
+ typename _Pred = std::equal_to<_Value>,
+ typename _Alloc = std::allocator<_Value> >
+ class unordered_set
+ : public _GLIBCXX_STD_D::unordered_set<_Value, _Hash, _Pred, _Alloc>,
+ public __gnu_debug::_Safe_sequence<unordered_set<_Value, _Hash,
+ _Pred, _Alloc> >
+ {
+ typedef _GLIBCXX_STD_D::unordered_set<_Value, _Hash,
+ _Pred, _Alloc> _Base;
+ typedef __gnu_debug::_Safe_sequence<unordered_set> _Safe_base;
+
+ public:
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ typedef typename _Base::key_type key_type;
+ typedef typename _Base::value_type value_type;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator,
+ unordered_set> iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,
+ unordered_set> const_iterator;
+
+ explicit
+ unordered_set(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __eql, __a) { }
+
+ template<typename _InputIterator>
+ unordered_set(_InputIterator __f, _InputIterator __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n,
+ __hf, __eql, __a), _Safe_base() { }
+
+ unordered_set(const unordered_set& __x)
+ : _Base(__x), _Safe_base() { }
+
+ unordered_set(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+ unordered_set(unordered_set&& __x)
+ : _Base(std::forward<unordered_set>(__x)), _Safe_base() { }
+
+ unordered_set(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __n, __hf, __eql, __a), _Safe_base() { }
+
+ unordered_set&
+ operator=(const unordered_set& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ unordered_set&
+ operator=(unordered_set&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ unordered_set&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+
+ void
+ swap(unordered_set&& __x)
+ {
+ _Base::swap(__x);
+ _Safe_base::_M_swap(__x);
+ }
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ }
+
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ // local versions
+ using _Base::begin;
+ using _Base::end;
+ using _Base::cbegin;
+ using _Base::cend;
+
+ std::pair<iterator, bool>
+ insert(const value_type& __obj)
+ {
+ typedef std::pair<typename _Base::iterator, bool> __pair_type;
+ __pair_type __res = _Base::insert(__obj);
+ return std::make_pair(iterator(__res.first, this), __res.second);
+ }
+
+ iterator
+ insert(iterator, const value_type& __obj)
+ {
+ typedef std::pair<typename _Base::iterator, bool> __pair_type;
+ __pair_type __res = _Base::insert(__obj);
+ return iterator(__res.first, this);
+ }
+
+ const_iterator
+ insert(const_iterator, const value_type& __obj)
+ {
+ typedef std::pair<typename _Base::iterator, bool> __pair_type;
+ __pair_type __res = _Base::insert(__obj);
+ return const_iterator(__res.first, this);
+ }
+
+ void
+ insert(std::initializer_list<value_type> __l)
+ { _Base::insert(__l); }
+
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first, __last);
+ }
+
+ iterator
+ find(const key_type& __key)
+ { return iterator(_Base::find(__key), this); }
+
+ const_iterator
+ find(const key_type& __key) const
+ { return const_iterator(_Base::find(__key), this); }
+
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __key)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ typedef std::pair<_Base_iterator, _Base_iterator> __pair_type;
+ __pair_type __res = _Base::equal_range(__key);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __key) const
+ {
+ typedef typename _Base::const_iterator _Base_iterator;
+ typedef std::pair<_Base_iterator, _Base_iterator> __pair_type;
+ __pair_type __res = _Base::equal_range(__key);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ size_type
+ erase(const key_type& __key)
+ {
+ size_type __ret(0);
+ iterator __victim(_Base::find(__key), this);
+ if (__victim != end())
+ {
+ this->erase(__victim);
+ __ret = 1;
+ }
+ return __ret;
+ }
+
+ iterator
+ erase(iterator __it)
+ {
+ __glibcxx_check_erase(__it);
+ __it._M_invalidate();
+ return iterator(_Base::erase(__it.base()), this);
+ }
+
+ const_iterator
+ erase(const_iterator __it)
+ {
+ __glibcxx_check_erase(__it);
+ __it._M_invalidate();
+ return const_iterator(_Base::erase(__it.base()), this);
+ }
+
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ __glibcxx_check_erase_range(__first, __last);
+ for (iterator __tmp = __first; __tmp != __last;)
+ {
+ iterator __victim = __tmp++;
+ __victim._M_invalidate();
+ }
+ return iterator(_Base::erase(__first.base(),
+ __last.base()), this);
+ }
+
+ const_iterator
+ erase(const_iterator __first, const_iterator __last)
+ {
+ __glibcxx_check_erase_range(__first, __last);
+ for (const_iterator __tmp = __first; __tmp != __last;)
+ {
+ const_iterator __victim = __tmp++;
+ __victim._M_invalidate();
+ }
+ return const_iterator(_Base::erase(__first.base(),
+ __last.base()), this);
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
+ unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_set<_Value, _Hash, _Pred, _Alloc>&& __x,
+ unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
+ unordered_set<_Value, _Hash, _Pred, _Alloc>&& __y)
+ { __x.swap(__y); }
+
+
+ template<typename _Value,
+ typename _Hash = std::hash<_Value>,
+ typename _Pred = std::equal_to<_Value>,
+ typename _Alloc = std::allocator<_Value> >
+ class unordered_multiset
+ : public _GLIBCXX_STD_D::unordered_multiset<_Value, _Hash, _Pred, _Alloc>,
+ public __gnu_debug::_Safe_sequence<unordered_multiset<_Value, _Hash,
+ _Pred, _Alloc> >
+ {
+ typedef _GLIBCXX_STD_D::unordered_multiset<_Value, _Hash,
+ _Pred, _Alloc> _Base;
+ typedef __gnu_debug::_Safe_sequence<unordered_multiset> _Safe_base;
+
+ public:
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ typedef typename _Base::key_type key_type;
+ typedef typename _Base::value_type value_type;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator,
+ unordered_multiset> iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,
+ unordered_multiset> const_iterator;
+
+ explicit
+ unordered_multiset(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __eql, __a) { }
+
+ template<typename _InputIterator>
+ unordered_multiset(_InputIterator __f, _InputIterator __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n,
+ __hf, __eql, __a), _Safe_base() { }
+
+ unordered_multiset(const unordered_multiset& __x)
+ : _Base(__x), _Safe_base() { }
+
+ unordered_multiset(const _Base& __x)
+ : _Base(__x), _Safe_base() { }
+
+ unordered_multiset(unordered_multiset&& __x)
+ : _Base(std::forward<unordered_multiset>(__x)), _Safe_base() { }
+
+ unordered_multiset(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __n, __hf, __eql, __a), _Safe_base() { }
+
+ unordered_multiset&
+ operator=(const unordered_multiset& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ unordered_multiset&
+ operator=(unordered_multiset&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ unordered_multiset&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+
+ void
+ swap(unordered_multiset&& __x)
+ {
+ _Base::swap(__x);
+ _Safe_base::_M_swap(__x);
+ }
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ }
+
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ // local versions
+ using _Base::begin;
+ using _Base::end;
+ using _Base::cbegin;
+ using _Base::cend;
+
+ iterator
+ insert(const value_type& __obj)
+ { return iterator(_Base::insert(__obj), this); }
+
+ iterator
+ insert(iterator, const value_type& __obj)
+ { return iterator(_Base::insert(__obj), this); }
+
+ const_iterator
+ insert(const_iterator, const value_type& __obj)
+ { return const_iterator(_Base::insert(__obj), this); }
+
+ void
+ insert(std::initializer_list<value_type> __l)
+ { _Base::insert(__l); }
+
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first, __last);
+ }
+
+ iterator
+ find(const key_type& __key)
+ { return iterator(_Base::find(__key), this); }
+
+ const_iterator
+ find(const key_type& __key) const
+ { return const_iterator(_Base::find(__key), this); }
+
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __key)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ typedef std::pair<_Base_iterator, _Base_iterator> __pair_type;
+ __pair_type __res = _Base::equal_range(__key);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __key) const
+ {
+ typedef typename _Base::const_iterator _Base_iterator;
+ typedef std::pair<_Base_iterator, _Base_iterator> __pair_type;
+ __pair_type __res = _Base::equal_range(__key);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ size_type
+ erase(const key_type& __key)
+ {
+ size_type __ret(0);
+ iterator __victim(_Base::find(__key), this);
+ if (__victim != end())
+ {
+ this->erase(__victim);
+ __ret = 1;
+ }
+ return __ret;
+ }
+
+ iterator
+ erase(iterator __it)
+ {
+ __glibcxx_check_erase(__it);
+ __it._M_invalidate();
+ return iterator(_Base::erase(__it.base()), this);
+ }
+
+ const_iterator
+ erase(const_iterator __it)
+ {
+ __glibcxx_check_erase(__it);
+ __it._M_invalidate();
+ return const_iterator(_Base::erase(__it.base()), this);
+ }
+
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ __glibcxx_check_erase_range(__first, __last);
+ for (iterator __tmp = __first; __tmp != __last;)
+ {
+ iterator __victim = __tmp++;
+ __victim._M_invalidate();
+ }
+ return iterator(_Base::erase(__first.base(),
+ __last.base()), this);
+ }
+
+ const_iterator
+ erase(const_iterator __first, const_iterator __last)
+ {
+ __glibcxx_check_erase_range(__first, __last);
+ for (const_iterator __tmp = __first; __tmp != __last;)
+ {
+ const_iterator __victim = __tmp++;
+ __victim._M_invalidate();
+ }
+ return const_iterator(_Base::erase(__first.base(),
+ __last.base()), this);
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
+ unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>&& __x,
+ unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
+ inline void
+ swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
+ unordered_multiset<_Value, _Hash, _Pred, _Alloc>&& __y)
+ { __x.swap(__y); }
+
+} // namespace __debug
+} // namespace std
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/vector b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/vector
new file mode 100644
index 0000000..97ab7bf
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/debug/vector
@@ -0,0 +1,551 @@
+// Debugging vector implementation -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/vector
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_VECTOR
+#define _GLIBCXX_DEBUG_VECTOR 1
+
+#include <vector>
+#include <utility>
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+
+namespace std
+{
+namespace __debug
+{
+ template<typename _Tp,
+ typename _Allocator = std::allocator<_Tp> >
+ class vector
+ : public _GLIBCXX_STD_D::vector<_Tp, _Allocator>,
+ public __gnu_debug::_Safe_sequence<vector<_Tp, _Allocator> >
+ {
+ typedef _GLIBCXX_STD_D::vector<_Tp, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<vector> _Safe_base;
+
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_After_nth_from<_Base_const_iterator> _After_nth;
+
+ public:
+ typedef typename _Base::reference reference;
+ typedef typename _Base::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator,vector>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,vector>
+ const_iterator;
+
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+
+ typedef _Tp value_type;
+ typedef _Allocator allocator_type;
+ typedef typename _Base::pointer pointer;
+ typedef typename _Base::const_pointer const_pointer;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ // 23.2.4.1 construct/copy/destroy:
+ explicit vector(const _Allocator& __a = _Allocator())
+ : _Base(__a), _M_guaranteed_capacity(0) { }
+
+ explicit vector(size_type __n, const _Tp& __value = _Tp(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__n, __value, __a), _M_guaranteed_capacity(__n) { }
+
+ template<class _InputIterator>
+ vector(_InputIterator __first, _InputIterator __last,
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__first, __last),
+ __last, __a),
+ _M_guaranteed_capacity(0)
+ { _M_update_guaranteed_capacity(); }
+
+ vector(const vector& __x)
+ : _Base(__x), _Safe_base(), _M_guaranteed_capacity(__x.size()) { }
+
+ /// Construction from a release-mode vector
+ vector(const _Base& __x)
+ : _Base(__x), _Safe_base(), _M_guaranteed_capacity(__x.size()) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ vector(vector&& __x)
+ : _Base(std::forward<vector>(__x)), _Safe_base(),
+ _M_guaranteed_capacity(this->size())
+ {
+ this->_M_swap(__x);
+ __x._M_guaranteed_capacity = 0;
+ }
+
+ vector(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __a), _Safe_base(),
+ _M_guaranteed_capacity(__l.size()) { }
+#endif
+
+ ~vector() { }
+
+ vector&
+ operator=(const vector& __x)
+ {
+ static_cast<_Base&>(*this) = __x;
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ vector&
+ operator=(vector&& __x)
+ {
+ // NB: DR 675.
+ clear();
+ swap(__x);
+ return *this;
+ }
+
+ vector&
+ operator=(initializer_list<value_type> __l)
+ {
+ static_cast<_Base&>(*this) = __l;
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ return *this;
+ }
+#endif
+
+ template<typename _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::assign(__first, __last);
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ }
+
+ void
+ assign(size_type __n, const _Tp& __u)
+ {
+ _Base::assign(__n, __u);
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ assign(initializer_list<value_type> __l)
+ {
+ _Base::assign(__l);
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ }
+#endif
+
+ using _Base::get_allocator;
+
+ // iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ const_iterator
+ cbegin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_Base::end(), this); }
+
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ // 23.2.4.2 capacity:
+ using _Base::size;
+ using _Base::max_size;
+
+ void
+ resize(size_type __sz, _Tp __c = _Tp())
+ {
+ bool __realloc = _M_requires_reallocation(__sz);
+ if (__sz < this->size())
+ this->_M_invalidate_if(_After_nth(__sz, _M_base().begin()));
+ _Base::resize(__sz, __c);
+ if (__realloc)
+ this->_M_invalidate_all();
+ }
+
+ size_type
+ capacity() const
+ {
+#ifdef _GLIBCXX_DEBUG_PEDANTIC
+ return _M_guaranteed_capacity;
+#else
+ return _Base::capacity();
+#endif
+ }
+
+ using _Base::empty;
+
+ void
+ reserve(size_type __n)
+ {
+ bool __realloc = _M_requires_reallocation(__n);
+ _Base::reserve(__n);
+ if (__n > _M_guaranteed_capacity)
+ _M_guaranteed_capacity = __n;
+ if (__realloc)
+ this->_M_invalidate_all();
+ }
+
+ // element access:
+ reference
+ operator[](size_type __n)
+ {
+ __glibcxx_check_subscript(__n);
+ return _M_base()[__n];
+ }
+
+ const_reference
+ operator[](size_type __n) const
+ {
+ __glibcxx_check_subscript(__n);
+ return _M_base()[__n];
+ }
+
+ using _Base::at;
+
+ reference
+ front()
+ {
+ __glibcxx_check_nonempty();
+ return _Base::front();
+ }
+
+ const_reference
+ front() const
+ {
+ __glibcxx_check_nonempty();
+ return _Base::front();
+ }
+
+ reference
+ back()
+ {
+ __glibcxx_check_nonempty();
+ return _Base::back();
+ }
+
+ const_reference
+ back() const
+ {
+ __glibcxx_check_nonempty();
+ return _Base::back();
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 464. Suggestion for new member functions in standard containers.
+ using _Base::data;
+
+ // 23.2.4.3 modifiers:
+ void
+ push_back(const _Tp& __x)
+ {
+ bool __realloc = _M_requires_reallocation(this->size() + 1);
+ _Base::push_back(__x);
+ if (__realloc)
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Up = _Tp>
+ typename __gnu_cxx::__enable_if<!std::__are_same<_Up, bool>::__value,
+ void>::__type
+ push_back(_Tp&& __x)
+ { emplace_back(std::move(__x)); }
+
+ template<typename... _Args>
+ void
+ emplace_back(_Args&&... __args)
+ {
+ bool __realloc = _M_requires_reallocation(this->size() + 1);
+ _Base::emplace_back(std::forward<_Args>(__args)...);
+ if (__realloc)
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ }
+#endif
+
+ void
+ pop_back()
+ {
+ __glibcxx_check_nonempty();
+ iterator __victim = end() - 1;
+ __victim._M_invalidate();
+ _Base::pop_back();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ iterator
+ emplace(iterator __position, _Args&&... __args)
+ {
+ __glibcxx_check_insert(__position);
+ bool __realloc = _M_requires_reallocation(this->size() + 1);
+ difference_type __offset = __position - begin();
+ typename _Base::iterator __res = _Base::emplace(__position.base(),
+ std::forward<_Args>(__args)...);
+ if (__realloc)
+ this->_M_invalidate_all();
+ else
+ this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
+ _M_update_guaranteed_capacity();
+ return iterator(__res, this);
+ }
+#endif
+
+ iterator
+ insert(iterator __position, const _Tp& __x)
+ {
+ __glibcxx_check_insert(__position);
+ bool __realloc = _M_requires_reallocation(this->size() + 1);
+ difference_type __offset = __position - begin();
+ typename _Base::iterator __res = _Base::insert(__position.base(),__x);
+ if (__realloc)
+ this->_M_invalidate_all();
+ else
+ this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
+ _M_update_guaranteed_capacity();
+ return iterator(__res, this);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Up = _Tp>
+ typename __gnu_cxx::__enable_if<!std::__are_same<_Up, bool>::__value,
+ iterator>::__type
+ insert(iterator __position, _Tp&& __x)
+ { return emplace(__position, std::move(__x)); }
+
+ void
+ insert(iterator __position, initializer_list<value_type> __l)
+ { this->insert(__position, __l.begin(), __l.end()); }
+#endif
+
+ void
+ insert(iterator __position, size_type __n, const _Tp& __x)
+ {
+ __glibcxx_check_insert(__position);
+ bool __realloc = _M_requires_reallocation(this->size() + __n);
+ difference_type __offset = __position - begin();
+ _Base::insert(__position.base(), __n, __x);
+ if (__realloc)
+ this->_M_invalidate_all();
+ else
+ this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
+ _M_update_guaranteed_capacity();
+ }
+
+ template<class _InputIterator>
+ void
+ insert(iterator __position,
+ _InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_insert_range(__position, __first, __last);
+
+ /* Hard to guess if invalidation will occur, because __last
+ - __first can't be calculated in all cases, so we just
+ punt here by checking if it did occur. */
+ typename _Base::iterator __old_begin = _M_base().begin();
+ difference_type __offset = __position - begin();
+ _Base::insert(__position.base(), __first, __last);
+
+ if (_M_base().begin() != __old_begin)
+ this->_M_invalidate_all();
+ else
+ this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
+ _M_update_guaranteed_capacity();
+ }
+
+ iterator
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ difference_type __offset = __position - begin();
+ typename _Base::iterator __res = _Base::erase(__position.base());
+ this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
+ return iterator(__res, this);
+ }
+
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+
+ difference_type __offset = __first - begin();
+ typename _Base::iterator __res = _Base::erase(__first.base(),
+ __last.base());
+ this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
+ return iterator(__res, this);
+ }
+
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(vector&& __x)
+#else
+ swap(vector& __x)
+#endif
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ std::swap(_M_guaranteed_capacity, __x._M_guaranteed_capacity);
+ }
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ _M_guaranteed_capacity = 0;
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ size_type _M_guaranteed_capacity;
+
+ bool
+ _M_requires_reallocation(size_type __elements)
+ { return __elements > this->capacity(); }
+
+ void
+ _M_update_guaranteed_capacity()
+ {
+ if (this->size() > _M_guaranteed_capacity)
+ _M_guaranteed_capacity = this->size();
+ }
+ };
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator==(const vector<_Tp, _Alloc>& __lhs,
+ const vector<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator!=(const vector<_Tp, _Alloc>& __lhs,
+ const vector<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<(const vector<_Tp, _Alloc>& __lhs,
+ const vector<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<=(const vector<_Tp, _Alloc>& __lhs,
+ const vector<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>=(const vector<_Tp, _Alloc>& __lhs,
+ const vector<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>(const vector<_Tp, _Alloc>& __lhs,
+ const vector<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(vector<_Tp, _Alloc>& __lhs, vector<_Tp, _Alloc>& __rhs)
+ { __lhs.swap(__rhs); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(vector<_Tp, _Alloc>&& __lhs, vector<_Tp, _Alloc>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(vector<_Tp, _Alloc>& __lhs, vector<_Tp, _Alloc>&& __rhs)
+ { __lhs.swap(__rhs); }
+#endif
+
+} // namespace __debug
+} // namespace std
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/deque b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/deque
new file mode 100644
index 0000000..8f64b00
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/deque
@@ -0,0 +1,75 @@
+// <deque> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/deque
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_DEQUE
+#define _GLIBCXX_DEQUE 1
+
+#pragma GCC system_header
+
+#include <bits/stl_algobase.h>
+#include <bits/allocator.h>
+#include <bits/stl_construct.h>
+#include <bits/stl_uninitialized.h>
+#include <bits/stl_deque.h>
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/deque.tcc>
+#endif
+
+#ifdef _GLIBCXX_DEBUG
+# include <debug/deque>
+#endif
+
+#endif /* _GLIBCXX_DEQUE */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/exception b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/exception
new file mode 100644
index 0000000..7fa929b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/exception
@@ -0,0 +1,151 @@
+// Exception Handling support header for -*- C++ -*-
+
+// Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+// 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation
+//
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// GCC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file exception
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef __EXCEPTION__
+#define __EXCEPTION__
+
+#pragma GCC visibility push(default)
+
+#include <bits/c++config.h>
+
+extern "C++" {
+
+namespace std
+{
+ /**
+ * @defgroup exceptions Exceptions
+ * @ingroup diagnostics
+ *
+ * Classes and functions for reporting errors via exception classes.
+ * @{
+ */
+
+ /**
+ * @brief Base class for all library exceptions.
+ *
+ * This is the base class for all exceptions thrown by the standard
+ * library, and by certain language expressions. You are free to derive
+ * your own %exception classes, or use a different hierarchy, or to
+ * throw non-class data (e.g., fundamental types).
+ */
+ class exception
+ {
+ public:
+ exception() throw() { }
+ virtual ~exception() throw();
+
+ /** Returns a C-style character string describing the general cause
+ * of the current error. */
+ virtual const char* what() const throw();
+ };
+
+ /** If an %exception is thrown which is not listed in a function's
+ * %exception specification, one of these may be thrown. */
+ class bad_exception : public exception
+ {
+ public:
+ bad_exception() throw() { }
+
+ // This declaration is not useless:
+ // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
+ virtual ~bad_exception() throw();
+
+ // See comment in eh_exception.cc.
+ virtual const char* what() const throw();
+ };
+
+ /// If you write a replacement %terminate handler, it must be of this type.
+ typedef void (*terminate_handler) ();
+
+ /// If you write a replacement %unexpected handler, it must be of this type.
+ typedef void (*unexpected_handler) ();
+
+ /// Takes a new handler function as an argument, returns the old function.
+ terminate_handler set_terminate(terminate_handler) throw();
+
+ /** The runtime will call this function if %exception handling must be
+ * abandoned for any reason. It can also be called by the user. */
+ void terminate() __attribute__ ((__noreturn__));
+
+ /// Takes a new handler function as an argument, returns the old function.
+ unexpected_handler set_unexpected(unexpected_handler) throw();
+
+ /** The runtime will call this function if an %exception is thrown which
+ * violates the function's %exception specification. */
+ void unexpected() __attribute__ ((__noreturn__));
+
+ /** [18.6.4]/1: "Returns true after completing evaluation of a
+ * throw-expression until either completing initialization of the
+ * exception-declaration in the matching handler or entering @c unexpected()
+ * due to the throw; or after entering @c terminate() for any reason
+ * other than an explicit call to @c terminate(). [Note: This includes
+ * stack unwinding [15.2]. end note]"
+ *
+ * 2: "When @c uncaught_exception() is true, throwing an %exception can
+ * result in a call of @c terminate() (15.5.1)."
+ */
+ bool uncaught_exception() throw();
+
+ // @} group exceptions
+} // namespace std
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ /**
+ * @brief A replacement for the standard terminate_handler which
+ * prints more information about the terminating exception (if any)
+ * on stderr.
+ *
+ * @ingroup exceptions
+ *
+ * Call
+ * @code
+ * std::set_terminate(__gnu_cxx::__verbose_terminate_handler)
+ * @endcode
+ * to use. For more info, see
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt02ch06s02.html
+ *
+ * In 3.4 and later, this is on by default.
+ */
+ void __verbose_terminate_handler();
+
+_GLIBCXX_END_NAMESPACE
+
+} // extern "C++"
+
+#pragma GCC visibility pop
+
+#if (defined(__GXX_EXPERIMENTAL_CXX0X__) \
+ && defined(_GLIBCXX_ATOMIC_BUILTINS_4))
+#include <exception_ptr.h>
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/exception_defines.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/exception_defines.h
new file mode 100644
index 0000000..951d96f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/exception_defines.h
@@ -0,0 +1,49 @@
+// -fno-exceptions Support -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+//
+// ISO C++ 14882: 19.1 Exception classes
+//
+
+/** @file exception_defines.h
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _EXCEPTION_DEFINES_H
+#define _EXCEPTION_DEFINES_H 1
+
+#ifndef __EXCEPTIONS
+// Iff -fno-exceptions, transform error handling code to work without it.
+# define __try if (true)
+# define __catch(X) if (false)
+# define __throw_exception_again
+#else
+// Else proceed normally.
+# define __try try
+# define __catch(X) catch(X)
+# define __throw_exception_again throw
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/exception_ptr.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/exception_ptr.h
new file mode 100644
index 0000000..b24ec21
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/exception_ptr.h
@@ -0,0 +1,171 @@
+// Exception Handling support header (exception_ptr class) for -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation
+//
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// GCC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file exception_ptr.h
+ * This is an internal header file, included by other headers and the
+ * implementation. You should not attempt to use it directly.
+ */
+
+#ifndef _EXCEPTION_PTR_H
+#define _EXCEPTION_PTR_H
+
+#pragma GCC visibility push(default)
+
+#include <bits/c++config.h>
+#include <exception_defines.h>
+
+#if !defined(_GLIBCXX_ATOMIC_BUILTINS_4)
+# error This platform does not support exception propagation.
+#endif
+
+extern "C++" {
+
+namespace std
+{
+ /**
+ * @addtogroup exceptions
+ * @{
+ */
+
+ // Hide the free operators from other types
+ namespace __exception_ptr
+ {
+ /**
+ * @brief An opaque pointer to an arbitrary exception.
+ */
+ class exception_ptr;
+ }
+
+ using __exception_ptr::exception_ptr;
+
+ /** Obtain an %exception_ptr to the currently handled exception. If there
+ * is none, or the currently handled exception is foreign, return the null
+ * value.
+ */
+ exception_ptr current_exception() throw();
+
+ /// Throw the object pointed to by the %exception_ptr.
+ void rethrow_exception(exception_ptr) __attribute__ ((__noreturn__));
+
+ /// Obtain an %exception_ptr pointing to a copy of the supplied object.
+ template<typename _Ex>
+ exception_ptr
+ copy_exception(_Ex __ex) throw();
+
+ namespace __exception_ptr
+ {
+ bool
+ operator==(const exception_ptr&, const exception_ptr&) throw();
+
+ bool
+ operator!=(const exception_ptr&, const exception_ptr&) throw();
+
+ class exception_ptr
+ {
+ void* _M_exception_object;
+
+ explicit exception_ptr(void* __e) throw();
+
+ void _M_addref() throw();
+ void _M_release() throw();
+
+ void *_M_get() const throw();
+
+ void _M_safe_bool_dummy();
+
+ friend exception_ptr std::current_exception() throw();
+ friend void std::rethrow_exception(exception_ptr);
+
+ public:
+ exception_ptr() throw();
+
+ typedef void (exception_ptr::*__safe_bool)();
+
+ // For construction from nullptr or 0.
+ exception_ptr(__safe_bool) throw();
+
+ exception_ptr(const exception_ptr&) throw();
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ exception_ptr(exception_ptr&& __o) throw()
+ : _M_exception_object(__o._M_exception_object)
+ { __o._M_exception_object = 0; }
+#endif
+
+ exception_ptr&
+ operator=(const exception_ptr&) throw();
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ exception_ptr&
+ operator=(exception_ptr&& __o) throw()
+ {
+ exception_ptr(static_cast<exception_ptr&&>(__o)).swap(*this);
+ return *this;
+ }
+#endif
+
+ ~exception_ptr() throw();
+
+ void
+ swap(exception_ptr&) throw();
+
+#ifdef _GLIBCXX_EH_PTR_COMPAT
+ // Retained for compatibility with CXXABI_1.3.
+ bool operator!() const throw();
+ operator __safe_bool() const throw();
+#endif
+
+ friend bool
+ operator==(const exception_ptr&, const exception_ptr&) throw();
+
+ const type_info*
+ __cxa_exception_type() const throw();
+ };
+
+ } // namespace __exception_ptr
+
+
+ template<typename _Ex>
+ exception_ptr
+ copy_exception(_Ex __ex) throw()
+ {
+ __try
+ {
+ throw __ex;
+ }
+ __catch(...)
+ {
+ return current_exception ();
+ }
+ }
+
+ // @} group exceptions
+} // namespace std
+
+} // extern "C++"
+
+#pragma GCC visibility pop
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/algorithm b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/algorithm
new file mode 100644
index 0000000..3337d6c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/algorithm
@@ -0,0 +1,524 @@
+// Algorithm extensions -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file ext/algorithm
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _EXT_ALGORITHM
+#define _EXT_ALGORITHM 1
+
+#pragma GCC system_header
+
+#include <algorithm>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::ptrdiff_t;
+ using std::min;
+ using std::pair;
+ using std::input_iterator_tag;
+ using std::random_access_iterator_tag;
+ using std::iterator_traits;
+
+ //--------------------------------------------------
+ // copy_n (not part of the C++ standard)
+
+ template<typename _InputIterator, typename _Size, typename _OutputIterator>
+ pair<_InputIterator, _OutputIterator>
+ __copy_n(_InputIterator __first, _Size __count,
+ _OutputIterator __result,
+ input_iterator_tag)
+ {
+ for ( ; __count > 0; --__count)
+ {
+ *__result = *__first;
+ ++__first;
+ ++__result;
+ }
+ return pair<_InputIterator, _OutputIterator>(__first, __result);
+ }
+
+ template<typename _RAIterator, typename _Size, typename _OutputIterator>
+ inline pair<_RAIterator, _OutputIterator>
+ __copy_n(_RAIterator __first, _Size __count,
+ _OutputIterator __result,
+ random_access_iterator_tag)
+ {
+ _RAIterator __last = __first + __count;
+ return pair<_RAIterator, _OutputIterator>(__last, std::copy(__first,
+ __last,
+ __result));
+ }
+
+ /**
+ * @brief Copies the range [first,first+count) into [result,result+count).
+ * @param first An input iterator.
+ * @param count The number of elements to copy.
+ * @param result An output iterator.
+ * @return A std::pair composed of first+count and result+count.
+ *
+ * This is an SGI extension.
+ * This inline function will boil down to a call to @c memmove whenever
+ * possible. Failing that, if random access iterators are passed, then the
+ * loop count will be known (and therefore a candidate for compiler
+ * optimizations such as unrolling).
+ * @ingroup SGIextensions
+ */
+ template<typename _InputIterator, typename _Size, typename _OutputIterator>
+ inline pair<_InputIterator, _OutputIterator>
+ copy_n(_InputIterator __first, _Size __count, _OutputIterator __result)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>)
+
+ return __copy_n(__first, __count, __result,
+ std::__iterator_category(__first));
+ }
+
+ template<typename _InputIterator1, typename _InputIterator2>
+ int
+ __lexicographical_compare_3way(_InputIterator1 __first1,
+ _InputIterator1 __last1,
+ _InputIterator2 __first2,
+ _InputIterator2 __last2)
+ {
+ while (__first1 != __last1 && __first2 != __last2)
+ {
+ if (*__first1 < *__first2)
+ return -1;
+ if (*__first2 < *__first1)
+ return 1;
+ ++__first1;
+ ++__first2;
+ }
+ if (__first2 == __last2)
+ return !(__first1 == __last1);
+ else
+ return -1;
+ }
+
+ inline int
+ __lexicographical_compare_3way(const unsigned char* __first1,
+ const unsigned char* __last1,
+ const unsigned char* __first2,
+ const unsigned char* __last2)
+ {
+ const ptrdiff_t __len1 = __last1 - __first1;
+ const ptrdiff_t __len2 = __last2 - __first2;
+ const int __result = __builtin_memcmp(__first1, __first2,
+ min(__len1, __len2));
+ return __result != 0 ? __result
+ : (__len1 == __len2 ? 0 : (__len1 < __len2 ? -1 : 1));
+ }
+
+ inline int
+ __lexicographical_compare_3way(const char* __first1, const char* __last1,
+ const char* __first2, const char* __last2)
+ {
+#if CHAR_MAX == SCHAR_MAX
+ return __lexicographical_compare_3way((const signed char*) __first1,
+ (const signed char*) __last1,
+ (const signed char*) __first2,
+ (const signed char*) __last2);
+#else
+ return __lexicographical_compare_3way((const unsigned char*) __first1,
+ (const unsigned char*) __last1,
+ (const unsigned char*) __first2,
+ (const unsigned char*) __last2);
+#endif
+ }
+
+ /**
+ * @brief @c memcmp on steroids.
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @param last2 An input iterator.
+ * @return An int, as with @c memcmp.
+ *
+ * The return value will be less than zero if the first range is
+ * "lexigraphically less than" the second, greater than zero if the second
+ * range is "lexigraphically less than" the first, and zero otherwise.
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ */
+ template<typename _InputIterator1, typename _InputIterator2>
+ int
+ lexicographical_compare_3way(_InputIterator1 __first1,
+ _InputIterator1 __last1,
+ _InputIterator2 __first2,
+ _InputIterator2 __last2)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_InputIterator1>::value_type>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_InputIterator2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ return __lexicographical_compare_3way(__first1, __last1, __first2,
+ __last2);
+ }
+
+ // count and count_if: this version, whose return type is void, was present
+ // in the HP STL, and is retained as an extension for backward compatibility.
+ template<typename _InputIterator, typename _Tp, typename _Size>
+ void
+ count(_InputIterator __first, _InputIterator __last,
+ const _Tp& __value,
+ _Size& __n)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_EqualityComparableConcept<
+ typename iterator_traits<_InputIterator>::value_type >)
+ __glibcxx_function_requires(_EqualityComparableConcept<_Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for ( ; __first != __last; ++__first)
+ if (*__first == __value)
+ ++__n;
+ }
+
+ template<typename _InputIterator, typename _Predicate, typename _Size>
+ void
+ count_if(_InputIterator __first, _InputIterator __last,
+ _Predicate __pred,
+ _Size& __n)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ for ( ; __first != __last; ++__first)
+ if (__pred(*__first))
+ ++__n;
+ }
+
+ // random_sample and random_sample_n (extensions, not part of the standard).
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<typename _ForwardIterator, typename _OutputIterator,
+ typename _Distance>
+ _OutputIterator
+ random_sample_n(_ForwardIterator __first, _ForwardIterator __last,
+ _OutputIterator __out, const _Distance __n)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ _Distance __remaining = std::distance(__first, __last);
+ _Distance __m = min(__n, __remaining);
+
+ while (__m > 0)
+ {
+ if ((std::rand() % __remaining) < __m)
+ {
+ *__out = *__first;
+ ++__out;
+ --__m;
+ }
+ --__remaining;
+ ++__first;
+ }
+ return __out;
+ }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<typename _ForwardIterator, typename _OutputIterator,
+ typename _Distance, typename _RandomNumberGenerator>
+ _OutputIterator
+ random_sample_n(_ForwardIterator __first, _ForwardIterator __last,
+ _OutputIterator __out, const _Distance __n,
+ _RandomNumberGenerator& __rand)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_function_requires(_UnaryFunctionConcept<
+ _RandomNumberGenerator, _Distance, _Distance>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ _Distance __remaining = std::distance(__first, __last);
+ _Distance __m = min(__n, __remaining);
+
+ while (__m > 0)
+ {
+ if (__rand(__remaining) < __m)
+ {
+ *__out = *__first;
+ ++__out;
+ --__m;
+ }
+ --__remaining;
+ ++__first;
+ }
+ return __out;
+ }
+
+ template<typename _InputIterator, typename _RandomAccessIterator,
+ typename _Distance>
+ _RandomAccessIterator
+ __random_sample(_InputIterator __first, _InputIterator __last,
+ _RandomAccessIterator __out,
+ const _Distance __n)
+ {
+ _Distance __m = 0;
+ _Distance __t = __n;
+ for ( ; __first != __last && __m < __n; ++__m, ++__first)
+ __out[__m] = *__first;
+
+ while (__first != __last)
+ {
+ ++__t;
+ _Distance __M = std::rand() % (__t);
+ if (__M < __n)
+ __out[__M] = *__first;
+ ++__first;
+ }
+ return __out + __m;
+ }
+
+ template<typename _InputIterator, typename _RandomAccessIterator,
+ typename _RandomNumberGenerator, typename _Distance>
+ _RandomAccessIterator
+ __random_sample(_InputIterator __first, _InputIterator __last,
+ _RandomAccessIterator __out,
+ _RandomNumberGenerator& __rand,
+ const _Distance __n)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_UnaryFunctionConcept<
+ _RandomNumberGenerator, _Distance, _Distance>)
+
+ _Distance __m = 0;
+ _Distance __t = __n;
+ for ( ; __first != __last && __m < __n; ++__m, ++__first)
+ __out[__m] = *__first;
+
+ while (__first != __last)
+ {
+ ++__t;
+ _Distance __M = __rand(__t);
+ if (__M < __n)
+ __out[__M] = *__first;
+ ++__first;
+ }
+ return __out + __m;
+ }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<typename _InputIterator, typename _RandomAccessIterator>
+ inline _RandomAccessIterator
+ random_sample(_InputIterator __first, _InputIterator __last,
+ _RandomAccessIterator __out_first,
+ _RandomAccessIterator __out_last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_valid_range(__out_first, __out_last);
+
+ return __random_sample(__first, __last,
+ __out_first, __out_last - __out_first);
+ }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<typename _InputIterator, typename _RandomAccessIterator,
+ typename _RandomNumberGenerator>
+ inline _RandomAccessIterator
+ random_sample(_InputIterator __first, _InputIterator __last,
+ _RandomAccessIterator __out_first,
+ _RandomAccessIterator __out_last,
+ _RandomNumberGenerator& __rand)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_valid_range(__out_first, __out_last);
+
+ return __random_sample(__first, __last,
+ __out_first, __rand,
+ __out_last - __out_first);
+ }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<typename _RandomAccessIterator>
+ inline bool
+ is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_RandomAccessIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ return std::__is_heap(__first, __last - __first);
+ }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<typename _RandomAccessIterator, typename _StrictWeakOrdering>
+ inline bool
+ is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _StrictWeakOrdering __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_StrictWeakOrdering,
+ typename iterator_traits<_RandomAccessIterator>::value_type,
+ typename iterator_traits<_RandomAccessIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ return std::__is_heap(__first, __comp, __last - __first);
+ }
+
+ // is_sorted, a predicated testing whether a range is sorted in
+ // nondescending order. This is an extension, not part of the C++
+ // standard.
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<typename _ForwardIterator>
+ bool
+ is_sorted(_ForwardIterator __first, _ForwardIterator __last)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return true;
+
+ _ForwardIterator __next = __first;
+ for (++__next; __next != __last; __first = __next, ++__next)
+ if (*__next < *__first)
+ return false;
+ return true;
+ }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<typename _ForwardIterator, typename _StrictWeakOrdering>
+ bool
+ is_sorted(_ForwardIterator __first, _ForwardIterator __last,
+ _StrictWeakOrdering __comp)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_StrictWeakOrdering,
+ typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return true;
+
+ _ForwardIterator __next = __first;
+ for (++__next; __next != __last; __first = __next, ++__next)
+ if (__comp(*__next, *__first))
+ return false;
+ return true;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _EXT_ALGORITHM */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/array_allocator.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/array_allocator.h
new file mode 100644
index 0000000..f36f273
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/array_allocator.h
@@ -0,0 +1,154 @@
+// array allocator -*- C++ -*-
+
+// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/array_allocator.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _ARRAY_ALLOCATOR_H
+#define _ARRAY_ALLOCATOR_H 1
+
+#include <cstddef>
+#include <new>
+#include <bits/functexcept.h>
+#include <tr1/array>
+#include <bits/move.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+ using std::ptrdiff_t;
+
+ /// Base class.
+ template<typename _Tp>
+ class array_allocator_base
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+
+ pointer
+ address(reference __x) const { return &__x; }
+
+ const_pointer
+ address(const_reference __x) const { return &__x; }
+
+ void
+ deallocate(pointer, size_type)
+ {
+ // Does nothing.
+ }
+
+ size_type
+ max_size() const throw()
+ { return size_t(-1) / sizeof(_Tp); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 402. wrong new expression in [some_] allocator::construct
+ void
+ construct(pointer __p, const _Tp& __val)
+ { ::new((void *)__p) value_type(__val); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ void
+ construct(pointer __p, _Args&&... __args)
+ { ::new((void *)__p) _Tp(std::forward<_Args>(__args)...); }
+#endif
+
+ void
+ destroy(pointer __p) { __p->~_Tp(); }
+ };
+
+ /**
+ * @brief An allocator that uses previously allocated memory.
+ * This memory can be externally, globally, or otherwise allocated.
+ * @ingroup allocators
+ */
+ template<typename _Tp, typename _Array = std::tr1::array<_Tp, 1> >
+ class array_allocator : public array_allocator_base<_Tp>
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+ typedef _Array array_type;
+
+ private:
+ array_type* _M_array;
+ size_type _M_used;
+
+ public:
+ template<typename _Tp1, typename _Array1 = _Array>
+ struct rebind
+ { typedef array_allocator<_Tp1, _Array1> other; };
+
+ array_allocator(array_type* __array = NULL) throw()
+ : _M_array(__array), _M_used(size_type()) { }
+
+ array_allocator(const array_allocator& __o) throw()
+ : _M_array(__o._M_array), _M_used(__o._M_used) { }
+
+ template<typename _Tp1, typename _Array1>
+ array_allocator(const array_allocator<_Tp1, _Array1>&) throw()
+ : _M_array(NULL), _M_used(size_type()) { }
+
+ ~array_allocator() throw() { }
+
+ pointer
+ allocate(size_type __n, const void* = 0)
+ {
+ if (_M_array == 0 || _M_used + __n > _M_array->size())
+ std::__throw_bad_alloc();
+ pointer __ret = _M_array->begin() + _M_used;
+ _M_used += __n;
+ return __ret;
+ }
+ };
+
+ template<typename _Tp, typename _Array>
+ inline bool
+ operator==(const array_allocator<_Tp, _Array>&,
+ const array_allocator<_Tp, _Array>&)
+ { return true; }
+
+ template<typename _Tp, typename _Array>
+ inline bool
+ operator!=(const array_allocator<_Tp, _Array>&,
+ const array_allocator<_Tp, _Array>&)
+ { return false; }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/atomicity.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/atomicity.h
new file mode 100644
index 0000000..bb891e8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/atomicity.h
@@ -0,0 +1,113 @@
+// Support for atomic operations -*- C++ -*-
+
+// Copyright (C) 2004, 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file atomicity.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_ATOMICITY_H
+#define _GLIBCXX_ATOMICITY_H 1
+
+#include <bits/c++config.h>
+#include <bits/gthr.h>
+#include <bits/atomic_word.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // Functions for portable atomic access.
+ // To abstract locking primitives across all thread policies, use:
+ // __exchange_and_add_dispatch
+ // __atomic_add_dispatch
+#ifdef _GLIBCXX_ATOMIC_BUILTINS_4
+ static inline _Atomic_word
+ __exchange_and_add(volatile _Atomic_word* __mem, int __val)
+ { return __sync_fetch_and_add(__mem, __val); }
+
+ static inline void
+ __atomic_add(volatile _Atomic_word* __mem, int __val)
+ { __sync_fetch_and_add(__mem, __val); }
+#else
+ _Atomic_word
+ __attribute__ ((__unused__))
+ __exchange_and_add(volatile _Atomic_word*, int);
+
+ void
+ __attribute__ ((__unused__))
+ __atomic_add(volatile _Atomic_word*, int);
+#endif
+
+ static inline _Atomic_word
+ __exchange_and_add_single(_Atomic_word* __mem, int __val)
+ {
+ _Atomic_word __result = *__mem;
+ *__mem += __val;
+ return __result;
+ }
+
+ static inline void
+ __atomic_add_single(_Atomic_word* __mem, int __val)
+ { *__mem += __val; }
+
+ static inline _Atomic_word
+ __attribute__ ((__unused__))
+ __exchange_and_add_dispatch(_Atomic_word* __mem, int __val)
+ {
+#ifdef __GTHREADS
+ if (__gthread_active_p())
+ return __exchange_and_add(__mem, __val);
+ else
+ return __exchange_and_add_single(__mem, __val);
+#else
+ return __exchange_and_add_single(__mem, __val);
+#endif
+ }
+
+ static inline void
+ __attribute__ ((__unused__))
+ __atomic_add_dispatch(_Atomic_word* __mem, int __val)
+ {
+#ifdef __GTHREADS
+ if (__gthread_active_p())
+ __atomic_add(__mem, __val);
+ else
+ __atomic_add_single(__mem, __val);
+#else
+ __atomic_add_single(__mem, __val);
+#endif
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+// Even if the CPU doesn't need a memory barrier, we need to ensure
+// that the compiler doesn't reorder memory accesses across the
+// barriers.
+#ifndef _GLIBCXX_READ_MEM_BARRIER
+#define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("":::"memory")
+#endif
+#ifndef _GLIBCXX_WRITE_MEM_BARRIER
+#define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("":::"memory")
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/bitmap_allocator.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/bitmap_allocator.h
new file mode 100644
index 0000000..3ad08fb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/bitmap_allocator.h
@@ -0,0 +1,1145 @@
+// Bitmap Allocator. -*- C++ -*-
+
+// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/bitmap_allocator.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _BITMAP_ALLOCATOR_H
+#define _BITMAP_ALLOCATOR_H 1
+
+#include <cstddef> // For std::size_t, and ptrdiff_t.
+#include <bits/functexcept.h> // For __throw_bad_alloc().
+#include <utility> // For std::pair.
+#include <functional> // For greater_equal, and less_equal.
+#include <new> // For operator new.
+#include <debug/debug.h> // _GLIBCXX_DEBUG_ASSERT
+#include <ext/concurrence.h>
+#include <bits/move.h>
+
+/** @brief The constant in the expression below is the alignment
+ * required in bytes.
+ */
+#define _BALLOC_ALIGN_BYTES 8
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+ using std::ptrdiff_t;
+
+ namespace __detail
+ {
+ /** @class __mini_vector bitmap_allocator.h bitmap_allocator.h
+ *
+ * @brief __mini_vector<> is a stripped down version of the
+ * full-fledged std::vector<>.
+ *
+ * It is to be used only for built-in types or PODs. Notable
+ * differences are:
+ *
+ * @detail
+ * 1. Not all accessor functions are present.
+ * 2. Used ONLY for PODs.
+ * 3. No Allocator template argument. Uses ::operator new() to get
+ * memory, and ::operator delete() to free it.
+ * Caveat: The dtor does NOT free the memory allocated, so this a
+ * memory-leaking vector!
+ */
+ template<typename _Tp>
+ class __mini_vector
+ {
+ __mini_vector(const __mini_vector&);
+ __mini_vector& operator=(const __mini_vector&);
+
+ public:
+ typedef _Tp value_type;
+ typedef _Tp* pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef pointer iterator;
+
+ private:
+ pointer _M_start;
+ pointer _M_finish;
+ pointer _M_end_of_storage;
+
+ size_type
+ _M_space_left() const throw()
+ { return _M_end_of_storage - _M_finish; }
+
+ pointer
+ allocate(size_type __n)
+ { return static_cast<pointer>(::operator new(__n * sizeof(_Tp))); }
+
+ void
+ deallocate(pointer __p, size_type)
+ { ::operator delete(__p); }
+
+ public:
+ // Members used: size(), push_back(), pop_back(),
+ // insert(iterator, const_reference), erase(iterator),
+ // begin(), end(), back(), operator[].
+
+ __mini_vector() : _M_start(0), _M_finish(0),
+ _M_end_of_storage(0)
+ { }
+
+#if 0
+ ~__mini_vector()
+ {
+ if (this->_M_start)
+ {
+ this->deallocate(this->_M_start, this->_M_end_of_storage
+ - this->_M_start);
+ }
+ }
+#endif
+
+ size_type
+ size() const throw()
+ { return _M_finish - _M_start; }
+
+ iterator
+ begin() const throw()
+ { return this->_M_start; }
+
+ iterator
+ end() const throw()
+ { return this->_M_finish; }
+
+ reference
+ back() const throw()
+ { return *(this->end() - 1); }
+
+ reference
+ operator[](const size_type __pos) const throw()
+ { return this->_M_start[__pos]; }
+
+ void
+ insert(iterator __pos, const_reference __x);
+
+ void
+ push_back(const_reference __x)
+ {
+ if (this->_M_space_left())
+ {
+ *this->end() = __x;
+ ++this->_M_finish;
+ }
+ else
+ this->insert(this->end(), __x);
+ }
+
+ void
+ pop_back() throw()
+ { --this->_M_finish; }
+
+ void
+ erase(iterator __pos) throw();
+
+ void
+ clear() throw()
+ { this->_M_finish = this->_M_start; }
+ };
+
+ // Out of line function definitions.
+ template<typename _Tp>
+ void __mini_vector<_Tp>::
+ insert(iterator __pos, const_reference __x)
+ {
+ if (this->_M_space_left())
+ {
+ size_type __to_move = this->_M_finish - __pos;
+ iterator __dest = this->end();
+ iterator __src = this->end() - 1;
+
+ ++this->_M_finish;
+ while (__to_move)
+ {
+ *__dest = *__src;
+ --__dest; --__src; --__to_move;
+ }
+ *__pos = __x;
+ }
+ else
+ {
+ size_type __new_size = this->size() ? this->size() * 2 : 1;
+ iterator __new_start = this->allocate(__new_size);
+ iterator __first = this->begin();
+ iterator __start = __new_start;
+ while (__first != __pos)
+ {
+ *__start = *__first;
+ ++__start; ++__first;
+ }
+ *__start = __x;
+ ++__start;
+ while (__first != this->end())
+ {
+ *__start = *__first;
+ ++__start; ++__first;
+ }
+ if (this->_M_start)
+ this->deallocate(this->_M_start, this->size());
+
+ this->_M_start = __new_start;
+ this->_M_finish = __start;
+ this->_M_end_of_storage = this->_M_start + __new_size;
+ }
+ }
+
+ template<typename _Tp>
+ void __mini_vector<_Tp>::
+ erase(iterator __pos) throw()
+ {
+ while (__pos + 1 != this->end())
+ {
+ *__pos = __pos[1];
+ ++__pos;
+ }
+ --this->_M_finish;
+ }
+
+
+ template<typename _Tp>
+ struct __mv_iter_traits
+ {
+ typedef typename _Tp::value_type value_type;
+ typedef typename _Tp::difference_type difference_type;
+ };
+
+ template<typename _Tp>
+ struct __mv_iter_traits<_Tp*>
+ {
+ typedef _Tp value_type;
+ typedef ptrdiff_t difference_type;
+ };
+
+ enum
+ {
+ bits_per_byte = 8,
+ bits_per_block = sizeof(size_t) * size_t(bits_per_byte)
+ };
+
+ template<typename _ForwardIterator, typename _Tp, typename _Compare>
+ _ForwardIterator
+ __lower_bound(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __val, _Compare __comp)
+ {
+ typedef typename __mv_iter_traits<_ForwardIterator>::value_type
+ _ValueType;
+ typedef typename __mv_iter_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+ _DistanceType __len = __last - __first;
+ _DistanceType __half;
+ _ForwardIterator __middle;
+
+ while (__len > 0)
+ {
+ __half = __len >> 1;
+ __middle = __first;
+ __middle += __half;
+ if (__comp(*__middle, __val))
+ {
+ __first = __middle;
+ ++__first;
+ __len = __len - __half - 1;
+ }
+ else
+ __len = __half;
+ }
+ return __first;
+ }
+
+ template<typename _InputIterator, typename _Predicate>
+ inline _InputIterator
+ __find_if(_InputIterator __first, _InputIterator __last, _Predicate __p)
+ {
+ while (__first != __last && !__p(*__first))
+ ++__first;
+ return __first;
+ }
+
+ /** @brief The number of Blocks pointed to by the address pair
+ * passed to the function.
+ */
+ template<typename _AddrPair>
+ inline size_t
+ __num_blocks(_AddrPair __ap)
+ { return (__ap.second - __ap.first) + 1; }
+
+ /** @brief The number of Bit-maps pointed to by the address pair
+ * passed to the function.
+ */
+ template<typename _AddrPair>
+ inline size_t
+ __num_bitmaps(_AddrPair __ap)
+ { return __num_blocks(__ap) / size_t(bits_per_block); }
+
+ // _Tp should be a pointer type.
+ template<typename _Tp>
+ class _Inclusive_between
+ : public std::unary_function<typename std::pair<_Tp, _Tp>, bool>
+ {
+ typedef _Tp pointer;
+ pointer _M_ptr_value;
+ typedef typename std::pair<_Tp, _Tp> _Block_pair;
+
+ public:
+ _Inclusive_between(pointer __ptr) : _M_ptr_value(__ptr)
+ { }
+
+ bool
+ operator()(_Block_pair __bp) const throw()
+ {
+ if (std::less_equal<pointer>()(_M_ptr_value, __bp.second)
+ && std::greater_equal<pointer>()(_M_ptr_value, __bp.first))
+ return true;
+ else
+ return false;
+ }
+ };
+
+ // Used to pass a Functor to functions by reference.
+ template<typename _Functor>
+ class _Functor_Ref
+ : public std::unary_function<typename _Functor::argument_type,
+ typename _Functor::result_type>
+ {
+ _Functor& _M_fref;
+
+ public:
+ typedef typename _Functor::argument_type argument_type;
+ typedef typename _Functor::result_type result_type;
+
+ _Functor_Ref(_Functor& __fref) : _M_fref(__fref)
+ { }
+
+ result_type
+ operator()(argument_type __arg)
+ { return _M_fref(__arg); }
+ };
+
+ /** @class _Ffit_finder bitmap_allocator.h bitmap_allocator.h
+ *
+ * @brief The class which acts as a predicate for applying the
+ * first-fit memory allocation policy for the bitmap allocator.
+ */
+ // _Tp should be a pointer type, and _Alloc is the Allocator for
+ // the vector.
+ template<typename _Tp>
+ class _Ffit_finder
+ : public std::unary_function<typename std::pair<_Tp, _Tp>, bool>
+ {
+ typedef typename std::pair<_Tp, _Tp> _Block_pair;
+ typedef typename __detail::__mini_vector<_Block_pair> _BPVector;
+ typedef typename _BPVector::difference_type _Counter_type;
+
+ size_t* _M_pbitmap;
+ _Counter_type _M_data_offset;
+
+ public:
+ _Ffit_finder() : _M_pbitmap(0), _M_data_offset(0)
+ { }
+
+ bool
+ operator()(_Block_pair __bp) throw()
+ {
+ // Set the _rover to the last physical location bitmap,
+ // which is the bitmap which belongs to the first free
+ // block. Thus, the bitmaps are in exact reverse order of
+ // the actual memory layout. So, we count down the bitmaps,
+ // which is the same as moving up the memory.
+
+ // If the used count stored at the start of the Bit Map headers
+ // is equal to the number of Objects that the current Block can
+ // store, then there is definitely no space for another single
+ // object, so just return false.
+ _Counter_type __diff =
+ __gnu_cxx::__detail::__num_bitmaps(__bp);
+
+ if (*(reinterpret_cast<size_t*>
+ (__bp.first) - (__diff + 1))
+ == __gnu_cxx::__detail::__num_blocks(__bp))
+ return false;
+
+ size_t* __rover = reinterpret_cast<size_t*>(__bp.first) - 1;
+
+ for (_Counter_type __i = 0; __i < __diff; ++__i)
+ {
+ _M_data_offset = __i;
+ if (*__rover)
+ {
+ _M_pbitmap = __rover;
+ return true;
+ }
+ --__rover;
+ }
+ return false;
+ }
+
+
+ size_t*
+ _M_get() const throw()
+ { return _M_pbitmap; }
+
+ _Counter_type
+ _M_offset() const throw()
+ { return _M_data_offset * size_t(bits_per_block); }
+ };
+
+
+ /** @class _Bitmap_counter bitmap_allocator.h bitmap_allocator.h
+ *
+ * @brief The bitmap counter which acts as the bitmap
+ * manipulator, and manages the bit-manipulation functions and
+ * the searching and identification functions on the bit-map.
+ */
+ // _Tp should be a pointer type.
+ template<typename _Tp>
+ class _Bitmap_counter
+ {
+ typedef typename __detail::__mini_vector<typename std::pair<_Tp, _Tp> >
+ _BPVector;
+ typedef typename _BPVector::size_type _Index_type;
+ typedef _Tp pointer;
+
+ _BPVector& _M_vbp;
+ size_t* _M_curr_bmap;
+ size_t* _M_last_bmap_in_block;
+ _Index_type _M_curr_index;
+
+ public:
+ // Use the 2nd parameter with care. Make sure that such an
+ // entry exists in the vector before passing that particular
+ // index to this ctor.
+ _Bitmap_counter(_BPVector& Rvbp, long __index = -1) : _M_vbp(Rvbp)
+ { this->_M_reset(__index); }
+
+ void
+ _M_reset(long __index = -1) throw()
+ {
+ if (__index == -1)
+ {
+ _M_curr_bmap = 0;
+ _M_curr_index = static_cast<_Index_type>(-1);
+ return;
+ }
+
+ _M_curr_index = __index;
+ _M_curr_bmap = reinterpret_cast<size_t*>
+ (_M_vbp[_M_curr_index].first) - 1;
+
+ _GLIBCXX_DEBUG_ASSERT(__index <= (long)_M_vbp.size() - 1);
+
+ _M_last_bmap_in_block = _M_curr_bmap
+ - ((_M_vbp[_M_curr_index].second
+ - _M_vbp[_M_curr_index].first + 1)
+ / size_t(bits_per_block) - 1);
+ }
+
+ // Dangerous Function! Use with extreme care. Pass to this
+ // function ONLY those values that are known to be correct,
+ // otherwise this will mess up big time.
+ void
+ _M_set_internal_bitmap(size_t* __new_internal_marker) throw()
+ { _M_curr_bmap = __new_internal_marker; }
+
+ bool
+ _M_finished() const throw()
+ { return(_M_curr_bmap == 0); }
+
+ _Bitmap_counter&
+ operator++() throw()
+ {
+ if (_M_curr_bmap == _M_last_bmap_in_block)
+ {
+ if (++_M_curr_index == _M_vbp.size())
+ _M_curr_bmap = 0;
+ else
+ this->_M_reset(_M_curr_index);
+ }
+ else
+ --_M_curr_bmap;
+ return *this;
+ }
+
+ size_t*
+ _M_get() const throw()
+ { return _M_curr_bmap; }
+
+ pointer
+ _M_base() const throw()
+ { return _M_vbp[_M_curr_index].first; }
+
+ _Index_type
+ _M_offset() const throw()
+ {
+ return size_t(bits_per_block)
+ * ((reinterpret_cast<size_t*>(this->_M_base())
+ - _M_curr_bmap) - 1);
+ }
+
+ _Index_type
+ _M_where() const throw()
+ { return _M_curr_index; }
+ };
+
+ /** @brief Mark a memory address as allocated by re-setting the
+ * corresponding bit in the bit-map.
+ */
+ inline void
+ __bit_allocate(size_t* __pbmap, size_t __pos) throw()
+ {
+ size_t __mask = 1 << __pos;
+ __mask = ~__mask;
+ *__pbmap &= __mask;
+ }
+
+ /** @brief Mark a memory address as free by setting the
+ * corresponding bit in the bit-map.
+ */
+ inline void
+ __bit_free(size_t* __pbmap, size_t __pos) throw()
+ {
+ size_t __mask = 1 << __pos;
+ *__pbmap |= __mask;
+ }
+ } // namespace __detail
+
+ /** @brief Generic Version of the bsf instruction.
+ */
+ inline size_t
+ _Bit_scan_forward(size_t __num)
+ { return static_cast<size_t>(__builtin_ctzl(__num)); }
+
+ /** @class free_list bitmap_allocator.h bitmap_allocator.h
+ *
+ * @brief The free list class for managing chunks of memory to be
+ * given to and returned by the bitmap_allocator.
+ */
+ class free_list
+ {
+ typedef size_t* value_type;
+ typedef __detail::__mini_vector<value_type> vector_type;
+ typedef vector_type::iterator iterator;
+ typedef __mutex __mutex_type;
+
+ struct _LT_pointer_compare
+ {
+ bool
+ operator()(const size_t* __pui,
+ const size_t __cui) const throw()
+ { return *__pui < __cui; }
+ };
+
+#if defined __GTHREADS
+ __mutex_type&
+ _M_get_mutex()
+ {
+ static __mutex_type _S_mutex;
+ return _S_mutex;
+ }
+#endif
+
+ vector_type&
+ _M_get_free_list()
+ {
+ static vector_type _S_free_list;
+ return _S_free_list;
+ }
+
+ /** @brief Performs validation of memory based on their size.
+ *
+ * @param __addr The pointer to the memory block to be
+ * validated.
+ *
+ * @detail Validates the memory block passed to this function and
+ * appropriately performs the action of managing the free list of
+ * blocks by adding this block to the free list or deleting this
+ * or larger blocks from the free list.
+ */
+ void
+ _M_validate(size_t* __addr) throw()
+ {
+ vector_type& __free_list = _M_get_free_list();
+ const vector_type::size_type __max_size = 64;
+ if (__free_list.size() >= __max_size)
+ {
+ // Ok, the threshold value has been reached. We determine
+ // which block to remove from the list of free blocks.
+ if (*__addr >= *__free_list.back())
+ {
+ // Ok, the new block is greater than or equal to the
+ // last block in the list of free blocks. We just free
+ // the new block.
+ ::operator delete(static_cast<void*>(__addr));
+ return;
+ }
+ else
+ {
+ // Deallocate the last block in the list of free lists,
+ // and insert the new one in its correct position.
+ ::operator delete(static_cast<void*>(__free_list.back()));
+ __free_list.pop_back();
+ }
+ }
+
+ // Just add the block to the list of free lists unconditionally.
+ iterator __temp = __gnu_cxx::__detail::__lower_bound
+ (__free_list.begin(), __free_list.end(),
+ *__addr, _LT_pointer_compare());
+
+ // We may insert the new free list before _temp;
+ __free_list.insert(__temp, __addr);
+ }
+
+ /** @brief Decides whether the wastage of memory is acceptable for
+ * the current memory request and returns accordingly.
+ *
+ * @param __block_size The size of the block available in the free
+ * list.
+ *
+ * @param __required_size The required size of the memory block.
+ *
+ * @return true if the wastage incurred is acceptable, else returns
+ * false.
+ */
+ bool
+ _M_should_i_give(size_t __block_size,
+ size_t __required_size) throw()
+ {
+ const size_t __max_wastage_percentage = 36;
+ if (__block_size >= __required_size &&
+ (((__block_size - __required_size) * 100 / __block_size)
+ < __max_wastage_percentage))
+ return true;
+ else
+ return false;
+ }
+
+ public:
+ /** @brief This function returns the block of memory to the
+ * internal free list.
+ *
+ * @param __addr The pointer to the memory block that was given
+ * by a call to the _M_get function.
+ */
+ inline void
+ _M_insert(size_t* __addr) throw()
+ {
+#if defined __GTHREADS
+ __gnu_cxx::__scoped_lock __bfl_lock(_M_get_mutex());
+#endif
+ // Call _M_validate to decide what should be done with
+ // this particular free list.
+ this->_M_validate(reinterpret_cast<size_t*>(__addr) - 1);
+ // See discussion as to why this is 1!
+ }
+
+ /** @brief This function gets a block of memory of the specified
+ * size from the free list.
+ *
+ * @param __sz The size in bytes of the memory required.
+ *
+ * @return A pointer to the new memory block of size at least
+ * equal to that requested.
+ */
+ size_t*
+ _M_get(size_t __sz) throw(std::bad_alloc);
+
+ /** @brief This function just clears the internal Free List, and
+ * gives back all the memory to the OS.
+ */
+ void
+ _M_clear();
+ };
+
+
+ // Forward declare the class.
+ template<typename _Tp>
+ class bitmap_allocator;
+
+ // Specialize for void:
+ template<>
+ class bitmap_allocator<void>
+ {
+ public:
+ typedef void* pointer;
+ typedef const void* const_pointer;
+
+ // Reference-to-void members are impossible.
+ typedef void value_type;
+ template<typename _Tp1>
+ struct rebind
+ {
+ typedef bitmap_allocator<_Tp1> other;
+ };
+ };
+
+ /**
+ * @brief Bitmap Allocator, primary template.
+ * @ingroup allocators
+ */
+ template<typename _Tp>
+ class bitmap_allocator : private free_list
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+ typedef free_list::__mutex_type __mutex_type;
+
+ template<typename _Tp1>
+ struct rebind
+ {
+ typedef bitmap_allocator<_Tp1> other;
+ };
+
+ private:
+ template<size_t _BSize, size_t _AlignSize>
+ struct aligned_size
+ {
+ enum
+ {
+ modulus = _BSize % _AlignSize,
+ value = _BSize + (modulus ? _AlignSize - (modulus) : 0)
+ };
+ };
+
+ struct _Alloc_block
+ {
+ char __M_unused[aligned_size<sizeof(value_type),
+ _BALLOC_ALIGN_BYTES>::value];
+ };
+
+
+ typedef typename std::pair<_Alloc_block*, _Alloc_block*> _Block_pair;
+
+ typedef typename
+ __detail::__mini_vector<_Block_pair> _BPVector;
+
+#if defined _GLIBCXX_DEBUG
+ // Complexity: O(lg(N)). Where, N is the number of block of size
+ // sizeof(value_type).
+ void
+ _S_check_for_free_blocks() throw()
+ {
+ typedef typename
+ __gnu_cxx::__detail::_Ffit_finder<_Alloc_block*> _FFF;
+ _FFF __fff;
+ typedef typename _BPVector::iterator _BPiter;
+ _BPiter __bpi =
+ __gnu_cxx::__detail::__find_if
+ (_S_mem_blocks.begin(), _S_mem_blocks.end(),
+ __gnu_cxx::__detail::_Functor_Ref<_FFF>(__fff));
+
+ _GLIBCXX_DEBUG_ASSERT(__bpi == _S_mem_blocks.end());
+ }
+#endif
+
+ /** @brief Responsible for exponentially growing the internal
+ * memory pool.
+ *
+ * @throw std::bad_alloc. If memory can not be allocated.
+ *
+ * @detail Complexity: O(1), but internally depends upon the
+ * complexity of the function free_list::_M_get. The part where
+ * the bitmap headers are written has complexity: O(X),where X
+ * is the number of blocks of size sizeof(value_type) within
+ * the newly acquired block. Having a tight bound.
+ */
+ void
+ _S_refill_pool() throw(std::bad_alloc)
+ {
+#if defined _GLIBCXX_DEBUG
+ _S_check_for_free_blocks();
+#endif
+
+ const size_t __num_bitmaps = (_S_block_size
+ / size_t(__detail::bits_per_block));
+ const size_t __size_to_allocate = sizeof(size_t)
+ + _S_block_size * sizeof(_Alloc_block)
+ + __num_bitmaps * sizeof(size_t);
+
+ size_t* __temp =
+ reinterpret_cast<size_t*>
+ (this->_M_get(__size_to_allocate));
+ *__temp = 0;
+ ++__temp;
+
+ // The Header information goes at the Beginning of the Block.
+ _Block_pair __bp =
+ std::make_pair(reinterpret_cast<_Alloc_block*>
+ (__temp + __num_bitmaps),
+ reinterpret_cast<_Alloc_block*>
+ (__temp + __num_bitmaps)
+ + _S_block_size - 1);
+
+ // Fill the Vector with this information.
+ _S_mem_blocks.push_back(__bp);
+
+ size_t __bit_mask = 0; // 0 Indicates all Allocated.
+ __bit_mask = ~__bit_mask; // 1 Indicates all Free.
+
+ for (size_t __i = 0; __i < __num_bitmaps; ++__i)
+ __temp[__i] = __bit_mask;
+
+ _S_block_size *= 2;
+ }
+
+
+ static _BPVector _S_mem_blocks;
+ static size_t _S_block_size;
+ static __gnu_cxx::__detail::
+ _Bitmap_counter<_Alloc_block*> _S_last_request;
+ static typename _BPVector::size_type _S_last_dealloc_index;
+#if defined __GTHREADS
+ static __mutex_type _S_mut;
+#endif
+
+ public:
+
+ /** @brief Allocates memory for a single object of size
+ * sizeof(_Tp).
+ *
+ * @throw std::bad_alloc. If memory can not be allocated.
+ *
+ * @detail Complexity: Worst case complexity is O(N), but that
+ * is hardly ever hit. If and when this particular case is
+ * encountered, the next few cases are guaranteed to have a
+ * worst case complexity of O(1)! That's why this function
+ * performs very well on average. You can consider this
+ * function to have a complexity referred to commonly as:
+ * Amortized Constant time.
+ */
+ pointer
+ _M_allocate_single_object() throw(std::bad_alloc)
+ {
+#if defined __GTHREADS
+ __gnu_cxx::__scoped_lock __bit_lock(_S_mut);
+#endif
+
+ // The algorithm is something like this: The last_request
+ // variable points to the last accessed Bit Map. When such a
+ // condition occurs, we try to find a free block in the
+ // current bitmap, or succeeding bitmaps until the last bitmap
+ // is reached. If no free block turns up, we resort to First
+ // Fit method.
+
+ // WARNING: Do not re-order the condition in the while
+ // statement below, because it relies on C++'s short-circuit
+ // evaluation. The return from _S_last_request->_M_get() will
+ // NOT be dereference able if _S_last_request->_M_finished()
+ // returns true. This would inevitably lead to a NULL pointer
+ // dereference if tinkered with.
+ while (_S_last_request._M_finished() == false
+ && (*(_S_last_request._M_get()) == 0))
+ {
+ _S_last_request.operator++();
+ }
+
+ if (__builtin_expect(_S_last_request._M_finished() == true, false))
+ {
+ // Fall Back to First Fit algorithm.
+ typedef typename
+ __gnu_cxx::__detail::_Ffit_finder<_Alloc_block*> _FFF;
+ _FFF __fff;
+ typedef typename _BPVector::iterator _BPiter;
+ _BPiter __bpi =
+ __gnu_cxx::__detail::__find_if
+ (_S_mem_blocks.begin(), _S_mem_blocks.end(),
+ __gnu_cxx::__detail::_Functor_Ref<_FFF>(__fff));
+
+ if (__bpi != _S_mem_blocks.end())
+ {
+ // Search was successful. Ok, now mark the first bit from
+ // the right as 0, meaning Allocated. This bit is obtained
+ // by calling _M_get() on __fff.
+ size_t __nz_bit = _Bit_scan_forward(*__fff._M_get());
+ __detail::__bit_allocate(__fff._M_get(), __nz_bit);
+
+ _S_last_request._M_reset(__bpi - _S_mem_blocks.begin());
+
+ // Now, get the address of the bit we marked as allocated.
+ pointer __ret = reinterpret_cast<pointer>
+ (__bpi->first + __fff._M_offset() + __nz_bit);
+ size_t* __puse_count =
+ reinterpret_cast<size_t*>
+ (__bpi->first)
+ - (__gnu_cxx::__detail::__num_bitmaps(*__bpi) + 1);
+
+ ++(*__puse_count);
+ return __ret;
+ }
+ else
+ {
+ // Search was unsuccessful. We Add more memory to the
+ // pool by calling _S_refill_pool().
+ _S_refill_pool();
+
+ // _M_Reset the _S_last_request structure to the first
+ // free block's bit map.
+ _S_last_request._M_reset(_S_mem_blocks.size() - 1);
+
+ // Now, mark that bit as allocated.
+ }
+ }
+
+ // _S_last_request holds a pointer to a valid bit map, that
+ // points to a free block in memory.
+ size_t __nz_bit = _Bit_scan_forward(*_S_last_request._M_get());
+ __detail::__bit_allocate(_S_last_request._M_get(), __nz_bit);
+
+ pointer __ret = reinterpret_cast<pointer>
+ (_S_last_request._M_base() + _S_last_request._M_offset() + __nz_bit);
+
+ size_t* __puse_count = reinterpret_cast<size_t*>
+ (_S_mem_blocks[_S_last_request._M_where()].first)
+ - (__gnu_cxx::__detail::
+ __num_bitmaps(_S_mem_blocks[_S_last_request._M_where()]) + 1);
+
+ ++(*__puse_count);
+ return __ret;
+ }
+
+ /** @brief Deallocates memory that belongs to a single object of
+ * size sizeof(_Tp).
+ *
+ * @detail Complexity: O(lg(N)), but the worst case is not hit
+ * often! This is because containers usually deallocate memory
+ * close to each other and this case is handled in O(1) time by
+ * the deallocate function.
+ */
+ void
+ _M_deallocate_single_object(pointer __p) throw()
+ {
+#if defined __GTHREADS
+ __gnu_cxx::__scoped_lock __bit_lock(_S_mut);
+#endif
+ _Alloc_block* __real_p = reinterpret_cast<_Alloc_block*>(__p);
+
+ typedef typename _BPVector::iterator _Iterator;
+ typedef typename _BPVector::difference_type _Difference_type;
+
+ _Difference_type __diff;
+ long __displacement;
+
+ _GLIBCXX_DEBUG_ASSERT(_S_last_dealloc_index >= 0);
+
+
+ if (__gnu_cxx::__detail::_Inclusive_between<_Alloc_block*>
+ (__real_p) (_S_mem_blocks[_S_last_dealloc_index]))
+ {
+ _GLIBCXX_DEBUG_ASSERT(_S_last_dealloc_index
+ <= _S_mem_blocks.size() - 1);
+
+ // Initial Assumption was correct!
+ __diff = _S_last_dealloc_index;
+ __displacement = __real_p - _S_mem_blocks[__diff].first;
+ }
+ else
+ {
+ _Iterator _iter = __gnu_cxx::__detail::
+ __find_if(_S_mem_blocks.begin(),
+ _S_mem_blocks.end(),
+ __gnu_cxx::__detail::
+ _Inclusive_between<_Alloc_block*>(__real_p));
+
+ _GLIBCXX_DEBUG_ASSERT(_iter != _S_mem_blocks.end());
+
+ __diff = _iter - _S_mem_blocks.begin();
+ __displacement = __real_p - _S_mem_blocks[__diff].first;
+ _S_last_dealloc_index = __diff;
+ }
+
+ // Get the position of the iterator that has been found.
+ const size_t __rotate = (__displacement
+ % size_t(__detail::bits_per_block));
+ size_t* __bitmapC =
+ reinterpret_cast<size_t*>
+ (_S_mem_blocks[__diff].first) - 1;
+ __bitmapC -= (__displacement / size_t(__detail::bits_per_block));
+
+ __detail::__bit_free(__bitmapC, __rotate);
+ size_t* __puse_count = reinterpret_cast<size_t*>
+ (_S_mem_blocks[__diff].first)
+ - (__gnu_cxx::__detail::__num_bitmaps(_S_mem_blocks[__diff]) + 1);
+
+ _GLIBCXX_DEBUG_ASSERT(*__puse_count != 0);
+
+ --(*__puse_count);
+
+ if (__builtin_expect(*__puse_count == 0, false))
+ {
+ _S_block_size /= 2;
+
+ // We can safely remove this block.
+ // _Block_pair __bp = _S_mem_blocks[__diff];
+ this->_M_insert(__puse_count);
+ _S_mem_blocks.erase(_S_mem_blocks.begin() + __diff);
+
+ // Reset the _S_last_request variable to reflect the
+ // erased block. We do this to protect future requests
+ // after the last block has been removed from a particular
+ // memory Chunk, which in turn has been returned to the
+ // free list, and hence had been erased from the vector,
+ // so the size of the vector gets reduced by 1.
+ if ((_Difference_type)_S_last_request._M_where() >= __diff--)
+ _S_last_request._M_reset(__diff);
+
+ // If the Index into the vector of the region of memory
+ // that might hold the next address that will be passed to
+ // deallocated may have been invalidated due to the above
+ // erase procedure being called on the vector, hence we
+ // try to restore this invariant too.
+ if (_S_last_dealloc_index >= _S_mem_blocks.size())
+ {
+ _S_last_dealloc_index =(__diff != -1 ? __diff : 0);
+ _GLIBCXX_DEBUG_ASSERT(_S_last_dealloc_index >= 0);
+ }
+ }
+ }
+
+ public:
+ bitmap_allocator() throw()
+ { }
+
+ bitmap_allocator(const bitmap_allocator&)
+ { }
+
+ template<typename _Tp1>
+ bitmap_allocator(const bitmap_allocator<_Tp1>&) throw()
+ { }
+
+ ~bitmap_allocator() throw()
+ { }
+
+ pointer
+ allocate(size_type __n)
+ {
+ if (__builtin_expect(__n > this->max_size(), false))
+ std::__throw_bad_alloc();
+
+ if (__builtin_expect(__n == 1, true))
+ return this->_M_allocate_single_object();
+ else
+ {
+ const size_type __b = __n * sizeof(value_type);
+ return reinterpret_cast<pointer>(::operator new(__b));
+ }
+ }
+
+ pointer
+ allocate(size_type __n, typename bitmap_allocator<void>::const_pointer)
+ { return allocate(__n); }
+
+ void
+ deallocate(pointer __p, size_type __n) throw()
+ {
+ if (__builtin_expect(__p != 0, true))
+ {
+ if (__builtin_expect(__n == 1, true))
+ this->_M_deallocate_single_object(__p);
+ else
+ ::operator delete(__p);
+ }
+ }
+
+ pointer
+ address(reference __r) const
+ { return &__r; }
+
+ const_pointer
+ address(const_reference __r) const
+ { return &__r; }
+
+ size_type
+ max_size() const throw()
+ { return size_type(-1) / sizeof(value_type); }
+
+ void
+ construct(pointer __p, const_reference __data)
+ { ::new((void *)__p) value_type(__data); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ void
+ construct(pointer __p, _Args&&... __args)
+ { ::new((void *)__p) _Tp(std::forward<_Args>(__args)...); }
+#endif
+
+ void
+ destroy(pointer __p)
+ { __p->~value_type(); }
+ };
+
+ template<typename _Tp1, typename _Tp2>
+ bool
+ operator==(const bitmap_allocator<_Tp1>&,
+ const bitmap_allocator<_Tp2>&) throw()
+ { return true; }
+
+ template<typename _Tp1, typename _Tp2>
+ bool
+ operator!=(const bitmap_allocator<_Tp1>&,
+ const bitmap_allocator<_Tp2>&) throw()
+ { return false; }
+
+ // Static member definitions.
+ template<typename _Tp>
+ typename bitmap_allocator<_Tp>::_BPVector
+ bitmap_allocator<_Tp>::_S_mem_blocks;
+
+ template<typename _Tp>
+ size_t bitmap_allocator<_Tp>::_S_block_size =
+ 2 * size_t(__detail::bits_per_block);
+
+ template<typename _Tp>
+ typename __gnu_cxx::bitmap_allocator<_Tp>::_BPVector::size_type
+ bitmap_allocator<_Tp>::_S_last_dealloc_index = 0;
+
+ template<typename _Tp>
+ __gnu_cxx::__detail::_Bitmap_counter
+ <typename bitmap_allocator<_Tp>::_Alloc_block*>
+ bitmap_allocator<_Tp>::_S_last_request(_S_mem_blocks);
+
+#if defined __GTHREADS
+ template<typename _Tp>
+ typename bitmap_allocator<_Tp>::__mutex_type
+ bitmap_allocator<_Tp>::_S_mut;
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/cast.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/cast.h
new file mode 100644
index 0000000..3ffad7c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/cast.h
@@ -0,0 +1,113 @@
+// <cast.h> -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef _CAST_H
+#define _CAST_H 1
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx);
+
+ /**
+ * These functions are here to allow containers to support non standard
+ * pointer types. For normal pointers, these resolve to the use of the
+ * standard cast operation. For other types the functions will perform
+ * the apprpriate cast to/from the custom pointer class so long as that
+ * class meets the following conditions:
+ * 1) has a typedef element_type which names tehe type it points to.
+ * 2) has a get() const method which returns element_type*.
+ * 3) has a constructor which can take one element_type* argument.
+ */
+
+ /**
+ * This type supports the semantics of the pointer cast operators (below.)
+ */
+ template<typename _ToType>
+ struct _Caster
+ { typedef typename _ToType::element_type* type; };
+
+ template<typename _ToType>
+ struct _Caster<_ToType*>
+ { typedef _ToType* type; };
+
+ /**
+ * Casting operations for cases where _FromType is not a standard pointer.
+ * _ToType can be a standard or non-standard pointer. Given that _FromType
+ * is not a pointer, it must have a get() method that returns the standard
+ * pointer equivalent of the address it points to, and must have an
+ * element_type typedef which names the type it points to.
+ */
+ template<typename _ToType, typename _FromType>
+ inline _ToType
+ __static_pointer_cast(const _FromType& __arg)
+ { return _ToType(static_cast<typename _Caster<_ToType>::
+ type>(__arg.get())); }
+
+ template<typename _ToType, typename _FromType>
+ inline _ToType
+ __dynamic_pointer_cast(const _FromType& __arg)
+ { return _ToType(dynamic_cast<typename _Caster<_ToType>::
+ type>(__arg.get())); }
+
+ template<typename _ToType, typename _FromType>
+ inline _ToType
+ __const_pointer_cast(const _FromType& __arg)
+ { return _ToType(const_cast<typename _Caster<_ToType>::
+ type>(__arg.get())); }
+
+ template<typename _ToType, typename _FromType>
+ inline _ToType
+ __reinterpret_pointer_cast(const _FromType& __arg)
+ { return _ToType(reinterpret_cast<typename _Caster<_ToType>::
+ type>(__arg.get())); }
+
+ /**
+ * Casting operations for cases where _FromType is a standard pointer.
+ * _ToType can be a standard or non-standard pointer.
+ */
+ template<typename _ToType, typename _FromType>
+ inline _ToType
+ __static_pointer_cast(_FromType* __arg)
+ { return _ToType(static_cast<typename _Caster<_ToType>::
+ type>(__arg)); }
+
+ template<typename _ToType, typename _FromType>
+ inline _ToType
+ __dynamic_pointer_cast(_FromType* __arg)
+ { return _ToType(dynamic_cast<typename _Caster<_ToType>::
+ type>(__arg)); }
+
+ template<typename _ToType, typename _FromType>
+ inline _ToType
+ __const_pointer_cast(_FromType* __arg)
+ { return _ToType(const_cast<typename _Caster<_ToType>::
+ type>(__arg)); }
+
+ template<typename _ToType, typename _FromType>
+ inline _ToType
+ __reinterpret_pointer_cast(_FromType* __arg)
+ { return _ToType(reinterpret_cast<typename _Caster<_ToType>::
+ type>(__arg)); }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif // _CAST_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/codecvt_specializations.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/codecvt_specializations.h
new file mode 100644
index 0000000..89adb3f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/codecvt_specializations.h
@@ -0,0 +1,507 @@
+// Locale support (codecvt) -*- C++ -*-
+
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+//
+// ISO C++ 14882: 22.2.1.5 Template class codecvt
+//
+
+// Written by Benjamin Kosnik <bkoz@redhat.com>
+
+/** @file ext/codecvt_specializations.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _EXT_CODECVT_SPECIALIZATIONS_H
+#define _EXT_CODECVT_SPECIALIZATIONS_H 1
+
+#include <bits/c++config.h>
+#include <locale>
+#include <iconv.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ /// Extension to use iconv for dealing with character encodings.
+ // This includes conversions and comparisons between various character
+ // sets. This object encapsulates data that may need to be shared between
+ // char_traits, codecvt and ctype.
+ class encoding_state
+ {
+ public:
+ // Types:
+ // NB: A conversion descriptor subsumes and enhances the
+ // functionality of a simple state type such as mbstate_t.
+ typedef iconv_t descriptor_type;
+
+ protected:
+ // Name of internal character set encoding.
+ std::string _M_int_enc;
+
+ // Name of external character set encoding.
+ std::string _M_ext_enc;
+
+ // Conversion descriptor between external encoding to internal encoding.
+ descriptor_type _M_in_desc;
+
+ // Conversion descriptor between internal encoding to external encoding.
+ descriptor_type _M_out_desc;
+
+ // The byte-order marker for the external encoding, if necessary.
+ int _M_ext_bom;
+
+ // The byte-order marker for the internal encoding, if necessary.
+ int _M_int_bom;
+
+ // Number of external bytes needed to construct one complete
+ // character in the internal encoding.
+ // NB: -1 indicates variable, or stateful, encodings.
+ int _M_bytes;
+
+ public:
+ explicit
+ encoding_state()
+ : _M_in_desc(0), _M_out_desc(0), _M_ext_bom(0), _M_int_bom(0), _M_bytes(0)
+ { }
+
+ explicit
+ encoding_state(const char* __int, const char* __ext,
+ int __ibom = 0, int __ebom = 0, int __bytes = 1)
+ : _M_int_enc(__int), _M_ext_enc(__ext), _M_in_desc(0), _M_out_desc(0),
+ _M_ext_bom(__ebom), _M_int_bom(__ibom), _M_bytes(__bytes)
+ { init(); }
+
+ // 21.1.2 traits typedefs
+ // p4
+ // typedef STATE_T state_type
+ // requires: state_type shall meet the requirements of
+ // CopyConstructible types (20.1.3)
+ // NB: This does not preserve the actual state of the conversion
+ // descriptor member, but it does duplicate the encoding
+ // information.
+ encoding_state(const encoding_state& __obj) : _M_in_desc(0), _M_out_desc(0)
+ { construct(__obj); }
+
+ // Need assignment operator as well.
+ encoding_state&
+ operator=(const encoding_state& __obj)
+ {
+ construct(__obj);
+ return *this;
+ }
+
+ ~encoding_state()
+ { destroy(); }
+
+ bool
+ good() const throw()
+ {
+ const descriptor_type __err = (iconv_t)(-1);
+ bool __test = _M_in_desc && _M_in_desc != __err;
+ __test &= _M_out_desc && _M_out_desc != __err;
+ return __test;
+ }
+
+ int
+ character_ratio() const
+ { return _M_bytes; }
+
+ const std::string
+ internal_encoding() const
+ { return _M_int_enc; }
+
+ int
+ internal_bom() const
+ { return _M_int_bom; }
+
+ const std::string
+ external_encoding() const
+ { return _M_ext_enc; }
+
+ int
+ external_bom() const
+ { return _M_ext_bom; }
+
+ const descriptor_type&
+ in_descriptor() const
+ { return _M_in_desc; }
+
+ const descriptor_type&
+ out_descriptor() const
+ { return _M_out_desc; }
+
+ protected:
+ void
+ init()
+ {
+ const descriptor_type __err = (iconv_t)(-1);
+ const bool __have_encodings = _M_int_enc.size() && _M_ext_enc.size();
+ if (!_M_in_desc && __have_encodings)
+ {
+ _M_in_desc = iconv_open(_M_int_enc.c_str(), _M_ext_enc.c_str());
+ if (_M_in_desc == __err)
+ std::__throw_runtime_error(__N("encoding_state::_M_init "
+ "creating iconv input descriptor failed"));
+ }
+ if (!_M_out_desc && __have_encodings)
+ {
+ _M_out_desc = iconv_open(_M_ext_enc.c_str(), _M_int_enc.c_str());
+ if (_M_out_desc == __err)
+ std::__throw_runtime_error(__N("encoding_state::_M_init "
+ "creating iconv output descriptor failed"));
+ }
+ }
+
+ void
+ construct(const encoding_state& __obj)
+ {
+ destroy();
+ _M_int_enc = __obj._M_int_enc;
+ _M_ext_enc = __obj._M_ext_enc;
+ _M_ext_bom = __obj._M_ext_bom;
+ _M_int_bom = __obj._M_int_bom;
+ _M_bytes = __obj._M_bytes;
+ init();
+ }
+
+ void
+ destroy() throw()
+ {
+ const descriptor_type __err = (iconv_t)(-1);
+ if (_M_in_desc && _M_in_desc != __err)
+ {
+ iconv_close(_M_in_desc);
+ _M_in_desc = 0;
+ }
+ if (_M_out_desc && _M_out_desc != __err)
+ {
+ iconv_close(_M_out_desc);
+ _M_out_desc = 0;
+ }
+ }
+ };
+
+ /// encoding_char_traits
+ // Custom traits type with encoding_state for the state type, and the
+ // associated fpos<encoding_state> for the position type, all other
+ // bits equivalent to the required char_traits instantiations.
+ template<typename _CharT>
+ struct encoding_char_traits : public std::char_traits<_CharT>
+ {
+ typedef encoding_state state_type;
+ typedef typename std::fpos<state_type> pos_type;
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ using __gnu_cxx::encoding_state;
+
+ /// codecvt<InternT, _ExternT, encoding_state> specialization.
+ // This partial specialization takes advantage of iconv to provide
+ // code conversions between a large number of character encodings.
+ template<typename _InternT, typename _ExternT>
+ class codecvt<_InternT, _ExternT, encoding_state>
+ : public __codecvt_abstract_base<_InternT, _ExternT, encoding_state>
+ {
+ public:
+ // Types:
+ typedef codecvt_base::result result;
+ typedef _InternT intern_type;
+ typedef _ExternT extern_type;
+ typedef __gnu_cxx::encoding_state state_type;
+ typedef state_type::descriptor_type descriptor_type;
+
+ // Data Members:
+ static locale::id id;
+
+ explicit
+ codecvt(size_t __refs = 0)
+ : __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
+ { }
+
+ explicit
+ codecvt(state_type& __enc, size_t __refs = 0)
+ : __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
+ { }
+
+ protected:
+ virtual
+ ~codecvt() { }
+
+ virtual result
+ do_out(state_type& __state, const intern_type* __from,
+ const intern_type* __from_end, const intern_type*& __from_next,
+ extern_type* __to, extern_type* __to_end,
+ extern_type*& __to_next) const;
+
+ virtual result
+ do_unshift(state_type& __state, extern_type* __to,
+ extern_type* __to_end, extern_type*& __to_next) const;
+
+ virtual result
+ do_in(state_type& __state, const extern_type* __from,
+ const extern_type* __from_end, const extern_type*& __from_next,
+ intern_type* __to, intern_type* __to_end,
+ intern_type*& __to_next) const;
+
+ virtual int
+ do_encoding() const throw();
+
+ virtual bool
+ do_always_noconv() const throw();
+
+ virtual int
+ do_length(state_type&, const extern_type* __from,
+ const extern_type* __end, size_t __max) const;
+
+ virtual int
+ do_max_length() const throw();
+ };
+
+ template<typename _InternT, typename _ExternT>
+ locale::id
+ codecvt<_InternT, _ExternT, encoding_state>::id;
+
+ // This adaptor works around the signature problems of the second
+ // argument to iconv(): SUSv2 and others use 'const char**', but glibc 2.2
+ // uses 'char**', which matches the POSIX 1003.1-2001 standard.
+ // Using this adaptor, g++ will do the work for us.
+ template<typename _Tp>
+ inline size_t
+ __iconv_adaptor(size_t(*__func)(iconv_t, _Tp, size_t*, char**, size_t*),
+ iconv_t __cd, char** __inbuf, size_t* __inbytes,
+ char** __outbuf, size_t* __outbytes)
+ { return __func(__cd, (_Tp)__inbuf, __inbytes, __outbuf, __outbytes); }
+
+ template<typename _InternT, typename _ExternT>
+ codecvt_base::result
+ codecvt<_InternT, _ExternT, encoding_state>::
+ do_out(state_type& __state, const intern_type* __from,
+ const intern_type* __from_end, const intern_type*& __from_next,
+ extern_type* __to, extern_type* __to_end,
+ extern_type*& __to_next) const
+ {
+ result __ret = codecvt_base::error;
+ if (__state.good())
+ {
+ const descriptor_type& __desc = __state.out_descriptor();
+ const size_t __fmultiple = sizeof(intern_type);
+ size_t __fbytes = __fmultiple * (__from_end - __from);
+ const size_t __tmultiple = sizeof(extern_type);
+ size_t __tbytes = __tmultiple * (__to_end - __to);
+
+ // Argument list for iconv specifies a byte sequence. Thus,
+ // all to/from arrays must be brutally casted to char*.
+ char* __cto = reinterpret_cast<char*>(__to);
+ char* __cfrom;
+ size_t __conv;
+
+ // Some encodings need a byte order marker as the first item
+ // in the byte stream, to designate endian-ness. The default
+ // value for the byte order marker is NULL, so if this is
+ // the case, it's not necessary and we can just go on our
+ // merry way.
+ int __int_bom = __state.internal_bom();
+ if (__int_bom)
+ {
+ size_t __size = __from_end - __from;
+ intern_type* __cfixed = static_cast<intern_type*>
+ (__builtin_alloca(sizeof(intern_type) * (__size + 1)));
+ __cfixed[0] = static_cast<intern_type>(__int_bom);
+ char_traits<intern_type>::copy(__cfixed + 1, __from, __size);
+ __cfrom = reinterpret_cast<char*>(__cfixed);
+ __conv = __iconv_adaptor(iconv, __desc, &__cfrom,
+ &__fbytes, &__cto, &__tbytes);
+ }
+ else
+ {
+ intern_type* __cfixed = const_cast<intern_type*>(__from);
+ __cfrom = reinterpret_cast<char*>(__cfixed);
+ __conv = __iconv_adaptor(iconv, __desc, &__cfrom, &__fbytes,
+ &__cto, &__tbytes);
+ }
+
+ if (__conv != size_t(-1))
+ {
+ __from_next = reinterpret_cast<const intern_type*>(__cfrom);
+ __to_next = reinterpret_cast<extern_type*>(__cto);
+ __ret = codecvt_base::ok;
+ }
+ else
+ {
+ if (__fbytes < __fmultiple * (__from_end - __from))
+ {
+ __from_next = reinterpret_cast<const intern_type*>(__cfrom);
+ __to_next = reinterpret_cast<extern_type*>(__cto);
+ __ret = codecvt_base::partial;
+ }
+ else
+ __ret = codecvt_base::error;
+ }
+ }
+ return __ret;
+ }
+
+ template<typename _InternT, typename _ExternT>
+ codecvt_base::result
+ codecvt<_InternT, _ExternT, encoding_state>::
+ do_unshift(state_type& __state, extern_type* __to,
+ extern_type* __to_end, extern_type*& __to_next) const
+ {
+ result __ret = codecvt_base::error;
+ if (__state.good())
+ {
+ const descriptor_type& __desc = __state.in_descriptor();
+ const size_t __tmultiple = sizeof(intern_type);
+ size_t __tlen = __tmultiple * (__to_end - __to);
+
+ // Argument list for iconv specifies a byte sequence. Thus,
+ // all to/from arrays must be brutally casted to char*.
+ char* __cto = reinterpret_cast<char*>(__to);
+ size_t __conv = __iconv_adaptor(iconv,__desc, NULL, NULL,
+ &__cto, &__tlen);
+
+ if (__conv != size_t(-1))
+ {
+ __to_next = reinterpret_cast<extern_type*>(__cto);
+ if (__tlen == __tmultiple * (__to_end - __to))
+ __ret = codecvt_base::noconv;
+ else if (__tlen == 0)
+ __ret = codecvt_base::ok;
+ else
+ __ret = codecvt_base::partial;
+ }
+ else
+ __ret = codecvt_base::error;
+ }
+ return __ret;
+ }
+
+ template<typename _InternT, typename _ExternT>
+ codecvt_base::result
+ codecvt<_InternT, _ExternT, encoding_state>::
+ do_in(state_type& __state, const extern_type* __from,
+ const extern_type* __from_end, const extern_type*& __from_next,
+ intern_type* __to, intern_type* __to_end,
+ intern_type*& __to_next) const
+ {
+ result __ret = codecvt_base::error;
+ if (__state.good())
+ {
+ const descriptor_type& __desc = __state.in_descriptor();
+ const size_t __fmultiple = sizeof(extern_type);
+ size_t __flen = __fmultiple * (__from_end - __from);
+ const size_t __tmultiple = sizeof(intern_type);
+ size_t __tlen = __tmultiple * (__to_end - __to);
+
+ // Argument list for iconv specifies a byte sequence. Thus,
+ // all to/from arrays must be brutally casted to char*.
+ char* __cto = reinterpret_cast<char*>(__to);
+ char* __cfrom;
+ size_t __conv;
+
+ // Some encodings need a byte order marker as the first item
+ // in the byte stream, to designate endian-ness. The default
+ // value for the byte order marker is NULL, so if this is
+ // the case, it's not necessary and we can just go on our
+ // merry way.
+ int __ext_bom = __state.external_bom();
+ if (__ext_bom)
+ {
+ size_t __size = __from_end - __from;
+ extern_type* __cfixed = static_cast<extern_type*>
+ (__builtin_alloca(sizeof(extern_type) * (__size + 1)));
+ __cfixed[0] = static_cast<extern_type>(__ext_bom);
+ char_traits<extern_type>::copy(__cfixed + 1, __from, __size);
+ __cfrom = reinterpret_cast<char*>(__cfixed);
+ __conv = __iconv_adaptor(iconv, __desc, &__cfrom,
+ &__flen, &__cto, &__tlen);
+ }
+ else
+ {
+ extern_type* __cfixed = const_cast<extern_type*>(__from);
+ __cfrom = reinterpret_cast<char*>(__cfixed);
+ __conv = __iconv_adaptor(iconv, __desc, &__cfrom,
+ &__flen, &__cto, &__tlen);
+ }
+
+
+ if (__conv != size_t(-1))
+ {
+ __from_next = reinterpret_cast<const extern_type*>(__cfrom);
+ __to_next = reinterpret_cast<intern_type*>(__cto);
+ __ret = codecvt_base::ok;
+ }
+ else
+ {
+ if (__flen < static_cast<size_t>(__from_end - __from))
+ {
+ __from_next = reinterpret_cast<const extern_type*>(__cfrom);
+ __to_next = reinterpret_cast<intern_type*>(__cto);
+ __ret = codecvt_base::partial;
+ }
+ else
+ __ret = codecvt_base::error;
+ }
+ }
+ return __ret;
+ }
+
+ template<typename _InternT, typename _ExternT>
+ int
+ codecvt<_InternT, _ExternT, encoding_state>::
+ do_encoding() const throw()
+ {
+ int __ret = 0;
+ if (sizeof(_ExternT) <= sizeof(_InternT))
+ __ret = sizeof(_InternT) / sizeof(_ExternT);
+ return __ret;
+ }
+
+ template<typename _InternT, typename _ExternT>
+ bool
+ codecvt<_InternT, _ExternT, encoding_state>::
+ do_always_noconv() const throw()
+ { return false; }
+
+ template<typename _InternT, typename _ExternT>
+ int
+ codecvt<_InternT, _ExternT, encoding_state>::
+ do_length(state_type&, const extern_type* __from,
+ const extern_type* __end, size_t __max) const
+ { return std::min(__max, static_cast<size_t>(__end - __from)); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 74. Garbled text for codecvt::do_max_length
+ template<typename _InternT, typename _ExternT>
+ int
+ codecvt<_InternT, _ExternT, encoding_state>::
+ do_max_length() const throw()
+ { return 1; }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/concurrence.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/concurrence.h
new file mode 100644
index 0000000..71f8cd0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/concurrence.h
@@ -0,0 +1,322 @@
+// Support for concurrent programing -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file concurrence.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _CONCURRENCE_H
+#define _CONCURRENCE_H 1
+
+#include <exception>
+#include <bits/gthr.h>
+#include <bits/functexcept.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // Available locking policies:
+ // _S_single single-threaded code that doesn't need to be locked.
+ // _S_mutex multi-threaded code that requires additional support
+ // from gthr.h or abstraction layers in concurrence.h.
+ // _S_atomic multi-threaded code using atomic operations.
+ enum _Lock_policy { _S_single, _S_mutex, _S_atomic };
+
+ // Compile time constant that indicates prefered locking policy in
+ // the current configuration.
+ static const _Lock_policy __default_lock_policy =
+#ifdef __GTHREADS
+#if (defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2) \
+ && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4))
+ _S_atomic;
+#else
+ _S_mutex;
+#endif
+#else
+ _S_single;
+#endif
+
+ // NB: As this is used in libsupc++, need to only depend on
+ // exception. No stdexception classes, no use of std::string.
+ class __concurrence_lock_error : public std::exception
+ {
+ public:
+ virtual char const*
+ what() const throw()
+ { return "__gnu_cxx::__concurrence_lock_error"; }
+ };
+
+ class __concurrence_unlock_error : public std::exception
+ {
+ public:
+ virtual char const*
+ what() const throw()
+ { return "__gnu_cxx::__concurrence_unlock_error"; }
+ };
+
+ class __concurrence_broadcast_error : public std::exception
+ {
+ public:
+ virtual char const*
+ what() const throw()
+ { return "__gnu_cxx::__concurrence_broadcast_error"; }
+ };
+
+ class __concurrence_wait_error : public std::exception
+ {
+ public:
+ virtual char const*
+ what() const throw()
+ { return "__gnu_cxx::__concurrence_wait_error"; }
+ };
+
+ // Substitute for concurrence_error object in the case of -fno-exceptions.
+ inline void
+ __throw_concurrence_lock_error()
+ {
+#if __EXCEPTIONS
+ throw __concurrence_lock_error();
+#else
+ __builtin_abort();
+#endif
+ }
+
+ inline void
+ __throw_concurrence_unlock_error()
+ {
+#if __EXCEPTIONS
+ throw __concurrence_unlock_error();
+#else
+ __builtin_abort();
+#endif
+ }
+
+#ifdef __GTHREAD_HAS_COND
+ inline void
+ __throw_concurrence_broadcast_error()
+ {
+#if __EXCEPTIONS
+ throw __concurrence_broadcast_error();
+#else
+ __builtin_abort();
+#endif
+ }
+
+ inline void
+ __throw_concurrence_wait_error()
+ {
+#if __EXCEPTIONS
+ throw __concurrence_wait_error();
+#else
+ __builtin_abort();
+#endif
+ }
+#endif
+
+ class __mutex
+ {
+ private:
+ __gthread_mutex_t _M_mutex;
+
+ __mutex(const __mutex&);
+ __mutex& operator=(const __mutex&);
+
+ public:
+ __mutex()
+ {
+#if __GTHREADS
+ if (__gthread_active_p())
+ {
+#if defined __GTHREAD_MUTEX_INIT
+ __gthread_mutex_t __tmp = __GTHREAD_MUTEX_INIT;
+ _M_mutex = __tmp;
+#else
+ __GTHREAD_MUTEX_INIT_FUNCTION(&_M_mutex);
+#endif
+ }
+#endif
+ }
+
+ void lock()
+ {
+#if __GTHREADS
+ if (__gthread_active_p())
+ {
+ if (__gthread_mutex_lock(&_M_mutex) != 0)
+ __throw_concurrence_lock_error();
+ }
+#endif
+ }
+
+ void unlock()
+ {
+#if __GTHREADS
+ if (__gthread_active_p())
+ {
+ if (__gthread_mutex_unlock(&_M_mutex) != 0)
+ __throw_concurrence_unlock_error();
+ }
+#endif
+ }
+
+ __gthread_mutex_t* gthread_mutex(void)
+ { return &_M_mutex; }
+ };
+
+ class __recursive_mutex
+ {
+ private:
+ __gthread_recursive_mutex_t _M_mutex;
+
+ __recursive_mutex(const __recursive_mutex&);
+ __recursive_mutex& operator=(const __recursive_mutex&);
+
+ public:
+ __recursive_mutex()
+ {
+#if __GTHREADS
+ if (__gthread_active_p())
+ {
+#if defined __GTHREAD_RECURSIVE_MUTEX_INIT
+ __gthread_recursive_mutex_t __tmp = __GTHREAD_RECURSIVE_MUTEX_INIT;
+ _M_mutex = __tmp;
+#else
+ __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION(&_M_mutex);
+#endif
+ }
+#endif
+ }
+
+ void lock()
+ {
+#if __GTHREADS
+ if (__gthread_active_p())
+ {
+ if (__gthread_recursive_mutex_lock(&_M_mutex) != 0)
+ __throw_concurrence_lock_error();
+ }
+#endif
+ }
+
+ void unlock()
+ {
+#if __GTHREADS
+ if (__gthread_active_p())
+ {
+ if (__gthread_recursive_mutex_unlock(&_M_mutex) != 0)
+ __throw_concurrence_unlock_error();
+ }
+#endif
+ }
+
+ __gthread_recursive_mutex_t* gthread_recursive_mutex(void)
+ { return &_M_mutex; }
+ };
+
+ /// Scoped lock idiom.
+ // Acquire the mutex here with a constructor call, then release with
+ // the destructor call in accordance with RAII style.
+ class __scoped_lock
+ {
+ public:
+ typedef __mutex __mutex_type;
+
+ private:
+ __mutex_type& _M_device;
+
+ __scoped_lock(const __scoped_lock&);
+ __scoped_lock& operator=(const __scoped_lock&);
+
+ public:
+ explicit __scoped_lock(__mutex_type& __name) : _M_device(__name)
+ { _M_device.lock(); }
+
+ ~__scoped_lock() throw()
+ { _M_device.unlock(); }
+ };
+
+#ifdef __GTHREAD_HAS_COND
+ class __cond
+ {
+ private:
+ __gthread_cond_t _M_cond;
+
+ __cond(const __cond&);
+ __cond& operator=(const __cond&);
+
+ public:
+ __cond()
+ {
+#if __GTHREADS
+ if (__gthread_active_p())
+ {
+#if defined __GTHREAD_COND_INIT
+ __gthread_cond_t __tmp = __GTHREAD_COND_INIT;
+ _M_cond = __tmp;
+#else
+ __GTHREAD_COND_INIT_FUNCTION(&_M_cond);
+#endif
+ }
+#endif
+ }
+
+ void broadcast()
+ {
+#if __GTHREADS
+ if (__gthread_active_p())
+ {
+ if (__gthread_cond_broadcast(&_M_cond) != 0)
+ __throw_concurrence_broadcast_error();
+ }
+#endif
+ }
+
+ void wait(__mutex *mutex)
+ {
+#if __GTHREADS
+ {
+ if (__gthread_cond_wait(&_M_cond, mutex->gthread_mutex()) != 0)
+ __throw_concurrence_wait_error();
+ }
+#endif
+ }
+
+ void wait_recursive(__recursive_mutex *mutex)
+ {
+#if __GTHREADS
+ {
+ if (__gthread_cond_wait_recursive(&_M_cond,
+ mutex->gthread_recursive_mutex())
+ != 0)
+ __throw_concurrence_wait_error();
+ }
+#endif
+ }
+ };
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/debug_allocator.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/debug_allocator.h
new file mode 100644
index 0000000..18d8049
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/debug_allocator.h
@@ -0,0 +1,124 @@
+// Allocators -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996-1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file ext/debug_allocator.h
+ * This file is a GNU extension to the Standard C++ Library.
+ * You should only include this header if you are using GCC 3 or later.
+ */
+
+#ifndef _DEBUG_ALLOCATOR_H
+#define _DEBUG_ALLOCATOR_H 1
+
+#include <stdexcept>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+
+ /**
+ * @brief A meta-allocator with debugging bits, as per [20.4].
+ * @ingroup allocators
+ *
+ * This is precisely the allocator defined in the C++ Standard.
+ * - all allocation calls operator new
+ * - all deallocation calls operator delete
+ */
+ template<typename _Alloc>
+ class debug_allocator
+ {
+ public:
+ typedef typename _Alloc::size_type size_type;
+ typedef typename _Alloc::difference_type difference_type;
+ typedef typename _Alloc::pointer pointer;
+ typedef typename _Alloc::const_pointer const_pointer;
+ typedef typename _Alloc::reference reference;
+ typedef typename _Alloc::const_reference const_reference;
+ typedef typename _Alloc::value_type value_type;
+
+ private:
+ // _M_extra is the number of objects that correspond to the
+ // extra space where debug information is stored.
+ size_type _M_extra;
+
+ _Alloc _M_allocator;
+
+ public:
+ debug_allocator()
+ {
+ const size_t __obj_size = sizeof(value_type);
+ _M_extra = (sizeof(size_type) + __obj_size - 1) / __obj_size;
+ }
+
+ pointer
+ allocate(size_type __n)
+ {
+ pointer __res = _M_allocator.allocate(__n + _M_extra);
+ size_type* __ps = reinterpret_cast<size_type*>(__res);
+ *__ps = __n;
+ return __res + _M_extra;
+ }
+
+ pointer
+ allocate(size_type __n, const void* __hint)
+ {
+ pointer __res = _M_allocator.allocate(__n + _M_extra, __hint);
+ size_type* __ps = reinterpret_cast<size_type*>(__res);
+ *__ps = __n;
+ return __res + _M_extra;
+ }
+
+ void
+ deallocate(pointer __p, size_type __n)
+ {
+ if (__p)
+ {
+ pointer __real_p = __p - _M_extra;
+ if (*reinterpret_cast<size_type*>(__real_p) != __n)
+ {
+ throw std::runtime_error("debug_allocator::deallocate"
+ " wrong size");
+ }
+ _M_allocator.deallocate(__real_p, __n + _M_extra);
+ }
+ else
+ throw std::runtime_error("debug_allocator::deallocate null pointer");
+ }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/enc_filebuf.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/enc_filebuf.h
new file mode 100644
index 0000000..4f83567
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/enc_filebuf.h
@@ -0,0 +1,62 @@
+// filebuf with encoding state type -*- C++ -*-
+
+// Copyright (C) 2002, 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/enc_filebuf.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _EXT_ENC_FILEBUF_H
+#define _EXT_ENC_FILEBUF_H 1
+
+#include <fstream>
+#include <locale>
+#include <ext/codecvt_specializations.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ /// class enc_filebuf.
+ template<typename _CharT>
+ class enc_filebuf
+ : public std::basic_filebuf<_CharT, encoding_char_traits<_CharT> >
+ {
+ public:
+ typedef encoding_char_traits<_CharT> traits_type;
+ typedef typename traits_type::state_type state_type;
+ typedef typename traits_type::pos_type pos_type;
+
+ enc_filebuf(state_type& __state)
+ : std::basic_filebuf<_CharT, encoding_char_traits<_CharT> >()
+ { this->_M_state_beg = __state; }
+
+ private:
+ // concept requirements:
+ // Set state type to something useful.
+ // Something more than copyconstructible is needed here, so
+ // require default and copy constructible + assignment operator.
+ __glibcxx_class_requires(state_type, _SGIAssignableConcept)
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/extptr_allocator.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/extptr_allocator.h
new file mode 100644
index 0000000..fab6b1d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/extptr_allocator.h
@@ -0,0 +1,176 @@
+// <extptr_allocator.h> -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/**
+ * @file ext/extptr_allocator.h
+ * @author Bob Walters
+ *
+ * An example allocator which uses an alternative pointer type from
+ * bits/pointer.h. Supports test cases which confirm container support
+ * for alternative pointers.
+ */
+
+#ifndef _EXTPTR_ALLOCATOR_H
+#define _EXTPTR_ALLOCATOR_H 1
+
+#include <memory>
+#include <limits>
+#include <ext/pointer.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ /**
+ * @brief An example allocator which uses a non-standard pointer type.
+ * @ingroup allocators
+ *
+ * This allocator specifies that containers use a 'relative pointer' as it's
+ * pointer type. (See ext/pointer.h) Memory allocation in this example
+ * is still performed using std::allocator.
+ */
+ template<typename _Tp>
+ class _ExtPtr_allocator
+ {
+ public:
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+
+ // Note the non-standard pointer types.
+ typedef _Pointer_adapter<_Relative_pointer_impl<_Tp> > pointer;
+ typedef _Pointer_adapter<_Relative_pointer_impl<const _Tp> >
+ const_pointer;
+
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+
+ template<typename _Up>
+ struct rebind
+ { typedef _ExtPtr_allocator<_Up> other; };
+
+ _ExtPtr_allocator() throw()
+ : _M_real_alloc() { }
+
+ _ExtPtr_allocator(const _ExtPtr_allocator &__rarg) throw()
+ : _M_real_alloc(__rarg._M_real_alloc) { }
+
+ template<typename _Up>
+ _ExtPtr_allocator(const _ExtPtr_allocator<_Up>& __rarg) throw()
+ : _M_real_alloc(__rarg._M_getUnderlyingImp()) { }
+
+ ~_ExtPtr_allocator() throw()
+ { }
+
+ pointer address(reference __x) const
+ { return &__x; }
+
+ const_pointer address(const_reference __x) const
+ { return &__x; }
+
+ pointer allocate(size_type __n, void* __hint = 0)
+ { return _M_real_alloc.allocate(__n,__hint); }
+
+ void deallocate(pointer __p, size_type __n)
+ { _M_real_alloc.deallocate(__p.get(), __n); }
+
+ size_type max_size() const throw()
+ { return std::numeric_limits<size_type>::max() / sizeof(_Tp); }
+
+ void construct(pointer __p, const _Tp& __val)
+ { ::new(__p.get()) _Tp(__val); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ void
+ construct(pointer __p, _Args&&... __args)
+ { ::new(__p.get()) _Tp(std::forward<_Args>(__args)...); }
+#endif
+
+ void destroy(pointer __p)
+ { __p->~_Tp(); }
+
+ template<typename _Up>
+ inline bool
+ operator==(const _ExtPtr_allocator<_Up>& __rarg)
+ { return _M_real_alloc == __rarg._M_getUnderlyingImp(); }
+
+ inline bool
+ operator==(const _ExtPtr_allocator& __rarg)
+ { return _M_real_alloc == __rarg._M_real_alloc; }
+
+ template<typename _Up>
+ inline bool
+ operator!=(const _ExtPtr_allocator<_Up>& __rarg)
+ { return _M_real_alloc != __rarg._M_getUnderlyingImp(); }
+
+ inline bool
+ operator!=(const _ExtPtr_allocator& __rarg)
+ { return _M_real_alloc != __rarg._M_real_alloc; }
+
+ template<typename _Up>
+ inline friend void
+ swap(_ExtPtr_allocator<_Up>&, _ExtPtr_allocator<_Up>&);
+
+ // A method specific to this implementation.
+ const std::allocator<_Tp>&
+ _M_getUnderlyingImp() const
+ { return _M_real_alloc; }
+
+ private:
+ std::allocator<_Tp> _M_real_alloc;
+ };
+
+ // _ExtPtr_allocator<void> specialization.
+ template<>
+ class _ExtPtr_allocator<void>
+ {
+ public:
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef void value_type;
+
+ // Note the non-standard pointer types
+ typedef _Pointer_adapter<_Relative_pointer_impl<void> > pointer;
+ typedef _Pointer_adapter<_Relative_pointer_impl<const void> >
+ const_pointer;
+
+ template<typename _Up>
+ struct rebind
+ { typedef _ExtPtr_allocator<_Up> other; };
+
+ private:
+ std::allocator<void> _M_real_alloc;
+ };
+
+ template<typename _Tp>
+ inline void
+ swap(_ExtPtr_allocator<_Tp>& __larg, _ExtPtr_allocator<_Tp>& __rarg)
+ {
+ std::allocator<_Tp> __tmp( __rarg._M_real_alloc );
+ __rarg._M_real_alloc = __larg._M_real_alloc;
+ __larg._M_real_alloc = __tmp;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _EXTPTR_ALLOCATOR_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/functional b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/functional
new file mode 100644
index 0000000..30afd58
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/functional
@@ -0,0 +1,425 @@
+// Functional extensions -*- C++ -*-
+
+// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file ext/functional
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _EXT_FUNCTIONAL
+#define _EXT_FUNCTIONAL 1
+
+#pragma GCC system_header
+
+#include <functional>
+#include <cstddef>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+ using std::unary_function;
+ using std::binary_function;
+ using std::mem_fun1_t;
+ using std::const_mem_fun1_t;
+ using std::mem_fun1_ref_t;
+ using std::const_mem_fun1_ref_t;
+
+ /** The @c identity_element functions are not part of the C++
+ * standard; SGI provided them as an extension. Its argument is an
+ * operation, and its return value is the identity element for that
+ * operation. It is overloaded for addition and multiplication,
+ * and you can overload it for your own nefarious operations.
+ *
+ * @addtogroup SGIextensions
+ * @{
+ */
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Tp>
+ inline _Tp
+ identity_element(std::plus<_Tp>)
+ { return _Tp(0); }
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Tp>
+ inline _Tp
+ identity_element(std::multiplies<_Tp>)
+ { return _Tp(1); }
+ /** @} */
+
+ /** As an extension to the binders, SGI provided composition functors and
+ * wrapper functions to aid in their creation. The @c unary_compose
+ * functor is constructed from two functions/functors, @c f and @c g.
+ * Calling @c operator() with a single argument @c x returns @c f(g(x)).
+ * The function @c compose1 takes the two functions and constructs a
+ * @c unary_compose variable for you.
+ *
+ * @c binary_compose is constructed from three functors, @c f, @c g1,
+ * and @c g2. Its @c operator() returns @c f(g1(x),g2(x)). The function
+ * @compose2 takes f, g1, and g2, and constructs the @c binary_compose
+ * instance for you. For example, if @c f returns an int, then
+ * \code
+ * int answer = (compose2(f,g1,g2))(x);
+ * \endcode
+ * is equivalent to
+ * \code
+ * int temp1 = g1(x);
+ * int temp2 = g2(x);
+ * int answer = f(temp1,temp2);
+ * \endcode
+ * But the first form is more compact, and can be passed around as a
+ * functor to other algorithms.
+ *
+ * @addtogroup SGIextensions
+ * @{
+ */
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Operation1, class _Operation2>
+ class unary_compose
+ : public unary_function<typename _Operation2::argument_type,
+ typename _Operation1::result_type>
+ {
+ protected:
+ _Operation1 _M_fn1;
+ _Operation2 _M_fn2;
+
+ public:
+ unary_compose(const _Operation1& __x, const _Operation2& __y)
+ : _M_fn1(__x), _M_fn2(__y) {}
+
+ typename _Operation1::result_type
+ operator()(const typename _Operation2::argument_type& __x) const
+ { return _M_fn1(_M_fn2(__x)); }
+ };
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Operation1, class _Operation2>
+ inline unary_compose<_Operation1, _Operation2>
+ compose1(const _Operation1& __fn1, const _Operation2& __fn2)
+ { return unary_compose<_Operation1,_Operation2>(__fn1, __fn2); }
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Operation1, class _Operation2, class _Operation3>
+ class binary_compose
+ : public unary_function<typename _Operation2::argument_type,
+ typename _Operation1::result_type>
+ {
+ protected:
+ _Operation1 _M_fn1;
+ _Operation2 _M_fn2;
+ _Operation3 _M_fn3;
+
+ public:
+ binary_compose(const _Operation1& __x, const _Operation2& __y,
+ const _Operation3& __z)
+ : _M_fn1(__x), _M_fn2(__y), _M_fn3(__z) { }
+
+ typename _Operation1::result_type
+ operator()(const typename _Operation2::argument_type& __x) const
+ { return _M_fn1(_M_fn2(__x), _M_fn3(__x)); }
+ };
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Operation1, class _Operation2, class _Operation3>
+ inline binary_compose<_Operation1, _Operation2, _Operation3>
+ compose2(const _Operation1& __fn1, const _Operation2& __fn2,
+ const _Operation3& __fn3)
+ { return binary_compose<_Operation1, _Operation2, _Operation3>
+ (__fn1, __fn2, __fn3); }
+ /** @} */
+
+ /** As an extension, SGI provided a functor called @c identity. When a
+ * functor is required but no operations are desired, this can be used as a
+ * pass-through. Its @c operator() returns its argument unchanged.
+ *
+ * @addtogroup SGIextensions
+ */
+ template <class _Tp>
+ struct identity : public std::_Identity<_Tp> {};
+
+ /** @c select1st and @c select2nd are extensions provided by SGI. Their
+ * @c operator()s
+ * take a @c std::pair as an argument, and return either the first member
+ * or the second member, respectively. They can be used (especially with
+ * the composition functors) to "strip" data from a sequence before
+ * performing the remainder of an algorithm.
+ *
+ * @addtogroup SGIextensions
+ * @{
+ */
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Pair>
+ struct select1st : public std::_Select1st<_Pair> {};
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Pair>
+ struct select2nd : public std::_Select2nd<_Pair> {};
+ /** @} */
+
+ // extension documented next
+ template <class _Arg1, class _Arg2>
+ struct _Project1st : public binary_function<_Arg1, _Arg2, _Arg1>
+ {
+ _Arg1
+ operator()(const _Arg1& __x, const _Arg2&) const
+ { return __x; }
+ };
+
+ template <class _Arg1, class _Arg2>
+ struct _Project2nd : public binary_function<_Arg1, _Arg2, _Arg2>
+ {
+ _Arg2
+ operator()(const _Arg1&, const _Arg2& __y) const
+ { return __y; }
+ };
+
+ /** The @c operator() of the @c project1st functor takes two arbitrary
+ * arguments and returns the first one, while @c project2nd returns the
+ * second one. They are extensions provided by SGI.
+ *
+ * @addtogroup SGIextensions
+ * @{
+ */
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Arg1, class _Arg2>
+ struct project1st : public _Project1st<_Arg1, _Arg2> {};
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Arg1, class _Arg2>
+ struct project2nd : public _Project2nd<_Arg1, _Arg2> {};
+ /** @} */
+
+ // extension documented next
+ template <class _Result>
+ struct _Constant_void_fun
+ {
+ typedef _Result result_type;
+ result_type _M_val;
+
+ _Constant_void_fun(const result_type& __v) : _M_val(__v) {}
+
+ const result_type&
+ operator()() const
+ { return _M_val; }
+ };
+
+ template <class _Result, class _Argument>
+ struct _Constant_unary_fun
+ {
+ typedef _Argument argument_type;
+ typedef _Result result_type;
+ result_type _M_val;
+
+ _Constant_unary_fun(const result_type& __v) : _M_val(__v) {}
+
+ const result_type&
+ operator()(const _Argument&) const
+ { return _M_val; }
+ };
+
+ template <class _Result, class _Arg1, class _Arg2>
+ struct _Constant_binary_fun
+ {
+ typedef _Arg1 first_argument_type;
+ typedef _Arg2 second_argument_type;
+ typedef _Result result_type;
+ _Result _M_val;
+
+ _Constant_binary_fun(const _Result& __v) : _M_val(__v) {}
+
+ const result_type&
+ operator()(const _Arg1&, const _Arg2&) const
+ { return _M_val; }
+ };
+
+ /** These three functors are each constructed from a single arbitrary
+ * variable/value. Later, their @c operator()s completely ignore any
+ * arguments passed, and return the stored value.
+ * - @c constant_void_fun's @c operator() takes no arguments
+ * - @c constant_unary_fun's @c operator() takes one argument (ignored)
+ * - @c constant_binary_fun's @c operator() takes two arguments (ignored)
+ *
+ * The helper creator functions @c constant0, @c constant1, and
+ * @c constant2 each take a "result" argument and construct variables of
+ * the appropriate functor type.
+ *
+ * @addtogroup SGIextensions
+ * @{
+ */
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Result>
+ struct constant_void_fun
+ : public _Constant_void_fun<_Result>
+ {
+ constant_void_fun(const _Result& __v)
+ : _Constant_void_fun<_Result>(__v) {}
+ };
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Result, class _Argument = _Result>
+ struct constant_unary_fun : public _Constant_unary_fun<_Result, _Argument>
+ {
+ constant_unary_fun(const _Result& __v)
+ : _Constant_unary_fun<_Result, _Argument>(__v) {}
+ };
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Result, class _Arg1 = _Result, class _Arg2 = _Arg1>
+ struct constant_binary_fun
+ : public _Constant_binary_fun<_Result, _Arg1, _Arg2>
+ {
+ constant_binary_fun(const _Result& __v)
+ : _Constant_binary_fun<_Result, _Arg1, _Arg2>(__v) {}
+ };
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Result>
+ inline constant_void_fun<_Result>
+ constant0(const _Result& __val)
+ { return constant_void_fun<_Result>(__val); }
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Result>
+ inline constant_unary_fun<_Result, _Result>
+ constant1(const _Result& __val)
+ { return constant_unary_fun<_Result, _Result>(__val); }
+
+ /// An \link SGIextensions SGI extension \endlink.
+ template <class _Result>
+ inline constant_binary_fun<_Result,_Result,_Result>
+ constant2(const _Result& __val)
+ { return constant_binary_fun<_Result, _Result, _Result>(__val); }
+ /** @} */
+
+ /** The @c subtractive_rng class is documented on
+ * <a href="http://www.sgi.com/tech/stl/">SGI's site</a>.
+ * Note that this code assumes that @c int is 32 bits.
+ *
+ * @ingroup SGIextensions
+ */
+ class subtractive_rng
+ : public unary_function<unsigned int, unsigned int>
+ {
+ private:
+ unsigned int _M_table[55];
+ size_t _M_index1;
+ size_t _M_index2;
+
+ public:
+ /// Returns a number less than the argument.
+ unsigned int
+ operator()(unsigned int __limit)
+ {
+ _M_index1 = (_M_index1 + 1) % 55;
+ _M_index2 = (_M_index2 + 1) % 55;
+ _M_table[_M_index1] = _M_table[_M_index1] - _M_table[_M_index2];
+ return _M_table[_M_index1] % __limit;
+ }
+
+ void
+ _M_initialize(unsigned int __seed)
+ {
+ unsigned int __k = 1;
+ _M_table[54] = __seed;
+ size_t __i;
+ for (__i = 0; __i < 54; __i++)
+ {
+ size_t __ii = (21 * (__i + 1) % 55) - 1;
+ _M_table[__ii] = __k;
+ __k = __seed - __k;
+ __seed = _M_table[__ii];
+ }
+ for (int __loop = 0; __loop < 4; __loop++)
+ {
+ for (__i = 0; __i < 55; __i++)
+ _M_table[__i] = _M_table[__i] - _M_table[(1 + __i + 30) % 55];
+ }
+ _M_index1 = 0;
+ _M_index2 = 31;
+ }
+
+ /// Ctor allowing you to initialize the seed.
+ subtractive_rng(unsigned int __seed)
+ { _M_initialize(__seed); }
+
+ /// Default ctor; initializes its state with some number you don't see.
+ subtractive_rng()
+ { _M_initialize(161803398u); }
+ };
+
+ // Mem_fun adaptor helper functions mem_fun1 and mem_fun1_ref,
+ // provided for backward compatibility, they are no longer part of
+ // the C++ standard.
+
+ template <class _Ret, class _Tp, class _Arg>
+ inline mem_fun1_t<_Ret, _Tp, _Arg>
+ mem_fun1(_Ret (_Tp::*__f)(_Arg))
+ { return mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
+
+ template <class _Ret, class _Tp, class _Arg>
+ inline const_mem_fun1_t<_Ret, _Tp, _Arg>
+ mem_fun1(_Ret (_Tp::*__f)(_Arg) const)
+ { return const_mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
+
+ template <class _Ret, class _Tp, class _Arg>
+ inline mem_fun1_ref_t<_Ret, _Tp, _Arg>
+ mem_fun1_ref(_Ret (_Tp::*__f)(_Arg))
+ { return mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
+
+ template <class _Ret, class _Tp, class _Arg>
+ inline const_mem_fun1_ref_t<_Ret, _Tp, _Arg>
+ mem_fun1_ref(_Ret (_Tp::*__f)(_Arg) const)
+ { return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/hash_map b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/hash_map
new file mode 100644
index 0000000..469429c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/hash_map
@@ -0,0 +1,590 @@
+// Hashing map implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2004, 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file backward/hash_map
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _HASH_MAP
+#define _HASH_MAP 1
+
+#include "backward_warning.h"
+#include <bits/c++config.h>
+#include <backward/hashtable.h>
+#include <bits/concept_check.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::equal_to;
+ using std::allocator;
+ using std::pair;
+ using std::_Select1st;
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<class _Key, class _Tp, class _HashFn = hash<_Key>,
+ class _EqualKey = equal_to<_Key>, class _Alloc = allocator<_Tp> >
+ class hash_map
+ {
+ private:
+ typedef hashtable<pair<const _Key, _Tp>,_Key, _HashFn,
+ _Select1st<pair<const _Key, _Tp> >,
+ _EqualKey, _Alloc> _Ht;
+
+ _Ht _M_ht;
+
+ public:
+ typedef typename _Ht::key_type key_type;
+ typedef _Tp data_type;
+ typedef _Tp mapped_type;
+ typedef typename _Ht::value_type value_type;
+ typedef typename _Ht::hasher hasher;
+ typedef typename _Ht::key_equal key_equal;
+
+ typedef typename _Ht::size_type size_type;
+ typedef typename _Ht::difference_type difference_type;
+ typedef typename _Ht::pointer pointer;
+ typedef typename _Ht::const_pointer const_pointer;
+ typedef typename _Ht::reference reference;
+ typedef typename _Ht::const_reference const_reference;
+
+ typedef typename _Ht::iterator iterator;
+ typedef typename _Ht::const_iterator const_iterator;
+
+ typedef typename _Ht::allocator_type allocator_type;
+
+ hasher
+ hash_funct() const
+ { return _M_ht.hash_funct(); }
+
+ key_equal
+ key_eq() const
+ { return _M_ht.key_eq(); }
+
+ allocator_type
+ get_allocator() const
+ { return _M_ht.get_allocator(); }
+
+ hash_map()
+ : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
+
+ explicit
+ hash_map(size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
+
+ hash_map(size_type __n, const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
+
+ hash_map(size_type __n, const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a) {}
+
+ template<class _InputIterator>
+ hash_map(_InputIterator __f, _InputIterator __l)
+ : _M_ht(100, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_map(_InputIterator __f, _InputIterator __l, size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a)
+ { _M_ht.insert_unique(__f, __l); }
+
+ size_type
+ size() const
+ { return _M_ht.size(); }
+
+ size_type
+ max_size() const
+ { return _M_ht.max_size(); }
+
+ bool
+ empty() const
+ { return _M_ht.empty(); }
+
+ void
+ swap(hash_map& __hs)
+ { _M_ht.swap(__hs._M_ht); }
+
+ template<class _K1, class _T1, class _HF, class _EqK, class _Al>
+ friend bool
+ operator== (const hash_map<_K1, _T1, _HF, _EqK, _Al>&,
+ const hash_map<_K1, _T1, _HF, _EqK, _Al>&);
+
+ iterator
+ begin()
+ { return _M_ht.begin(); }
+
+ iterator
+ end()
+ { return _M_ht.end(); }
+
+ const_iterator
+ begin() const
+ { return _M_ht.begin(); }
+
+ const_iterator
+ end() const
+ { return _M_ht.end(); }
+
+ pair<iterator, bool>
+ insert(const value_type& __obj)
+ { return _M_ht.insert_unique(__obj); }
+
+ template<class _InputIterator>
+ void
+ insert(_InputIterator __f, _InputIterator __l)
+ { _M_ht.insert_unique(__f, __l); }
+
+ pair<iterator, bool>
+ insert_noresize(const value_type& __obj)
+ { return _M_ht.insert_unique_noresize(__obj); }
+
+ iterator
+ find(const key_type& __key)
+ { return _M_ht.find(__key); }
+
+ const_iterator
+ find(const key_type& __key) const
+ { return _M_ht.find(__key); }
+
+ _Tp&
+ operator[](const key_type& __key)
+ { return _M_ht.find_or_insert(value_type(__key, _Tp())).second; }
+
+ size_type
+ count(const key_type& __key) const
+ { return _M_ht.count(__key); }
+
+ pair<iterator, iterator>
+ equal_range(const key_type& __key)
+ { return _M_ht.equal_range(__key); }
+
+ pair<const_iterator, const_iterator>
+ equal_range(const key_type& __key) const
+ { return _M_ht.equal_range(__key); }
+
+ size_type
+ erase(const key_type& __key)
+ {return _M_ht.erase(__key); }
+
+ void
+ erase(iterator __it)
+ { _M_ht.erase(__it); }
+
+ void
+ erase(iterator __f, iterator __l)
+ { _M_ht.erase(__f, __l); }
+
+ void
+ clear()
+ { _M_ht.clear(); }
+
+ void
+ resize(size_type __hint)
+ { _M_ht.resize(__hint); }
+
+ size_type
+ bucket_count() const
+ { return _M_ht.bucket_count(); }
+
+ size_type
+ max_bucket_count() const
+ { return _M_ht.max_bucket_count(); }
+
+ size_type
+ elems_in_bucket(size_type __n) const
+ { return _M_ht.elems_in_bucket(__n); }
+ };
+
+ template<class _Key, class _Tp, class _HashFn, class _EqlKey, class _Alloc>
+ inline bool
+ operator==(const hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm1,
+ const hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm2)
+ { return __hm1._M_ht == __hm2._M_ht; }
+
+ template<class _Key, class _Tp, class _HashFn, class _EqlKey, class _Alloc>
+ inline bool
+ operator!=(const hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm1,
+ const hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm2)
+ { return !(__hm1 == __hm2); }
+
+ template<class _Key, class _Tp, class _HashFn, class _EqlKey, class _Alloc>
+ inline void
+ swap(hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm1,
+ hash_map<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm2)
+ { __hm1.swap(__hm2); }
+
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<class _Key, class _Tp,
+ class _HashFn = hash<_Key>,
+ class _EqualKey = equal_to<_Key>,
+ class _Alloc = allocator<_Tp> >
+ class hash_multimap
+ {
+ // concept requirements
+ __glibcxx_class_requires(_Key, _SGIAssignableConcept)
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires3(_HashFn, size_t, _Key, _UnaryFunctionConcept)
+ __glibcxx_class_requires3(_EqualKey, _Key, _Key, _BinaryPredicateConcept)
+
+ private:
+ typedef hashtable<pair<const _Key, _Tp>, _Key, _HashFn,
+ _Select1st<pair<const _Key, _Tp> >, _EqualKey, _Alloc>
+ _Ht;
+
+ _Ht _M_ht;
+
+ public:
+ typedef typename _Ht::key_type key_type;
+ typedef _Tp data_type;
+ typedef _Tp mapped_type;
+ typedef typename _Ht::value_type value_type;
+ typedef typename _Ht::hasher hasher;
+ typedef typename _Ht::key_equal key_equal;
+
+ typedef typename _Ht::size_type size_type;
+ typedef typename _Ht::difference_type difference_type;
+ typedef typename _Ht::pointer pointer;
+ typedef typename _Ht::const_pointer const_pointer;
+ typedef typename _Ht::reference reference;
+ typedef typename _Ht::const_reference const_reference;
+
+ typedef typename _Ht::iterator iterator;
+ typedef typename _Ht::const_iterator const_iterator;
+
+ typedef typename _Ht::allocator_type allocator_type;
+
+ hasher
+ hash_funct() const
+ { return _M_ht.hash_funct(); }
+
+ key_equal
+ key_eq() const
+ { return _M_ht.key_eq(); }
+
+ allocator_type
+ get_allocator() const
+ { return _M_ht.get_allocator(); }
+
+ hash_multimap()
+ : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
+
+ explicit
+ hash_multimap(size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
+
+ hash_multimap(size_type __n, const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
+
+ hash_multimap(size_type __n, const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a) {}
+
+ template<class _InputIterator>
+ hash_multimap(_InputIterator __f, _InputIterator __l)
+ : _M_ht(100, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a)
+ { _M_ht.insert_equal(__f, __l); }
+
+ size_type
+ size() const
+ { return _M_ht.size(); }
+
+ size_type
+ max_size() const
+ { return _M_ht.max_size(); }
+
+ bool
+ empty() const
+ { return _M_ht.empty(); }
+
+ void
+ swap(hash_multimap& __hs)
+ { _M_ht.swap(__hs._M_ht); }
+
+ template<class _K1, class _T1, class _HF, class _EqK, class _Al>
+ friend bool
+ operator==(const hash_multimap<_K1, _T1, _HF, _EqK, _Al>&,
+ const hash_multimap<_K1, _T1, _HF, _EqK, _Al>&);
+
+ iterator
+ begin()
+ { return _M_ht.begin(); }
+
+ iterator
+ end()
+ { return _M_ht.end(); }
+
+ const_iterator
+ begin() const
+ { return _M_ht.begin(); }
+
+ const_iterator
+ end() const
+ { return _M_ht.end(); }
+
+ iterator
+ insert(const value_type& __obj)
+ { return _M_ht.insert_equal(__obj); }
+
+ template<class _InputIterator>
+ void
+ insert(_InputIterator __f, _InputIterator __l)
+ { _M_ht.insert_equal(__f,__l); }
+
+ iterator
+ insert_noresize(const value_type& __obj)
+ { return _M_ht.insert_equal_noresize(__obj); }
+
+ iterator
+ find(const key_type& __key)
+ { return _M_ht.find(__key); }
+
+ const_iterator
+ find(const key_type& __key) const
+ { return _M_ht.find(__key); }
+
+ size_type
+ count(const key_type& __key) const
+ { return _M_ht.count(__key); }
+
+ pair<iterator, iterator>
+ equal_range(const key_type& __key)
+ { return _M_ht.equal_range(__key); }
+
+ pair<const_iterator, const_iterator>
+ equal_range(const key_type& __key) const
+ { return _M_ht.equal_range(__key); }
+
+ size_type
+ erase(const key_type& __key)
+ { return _M_ht.erase(__key); }
+
+ void
+ erase(iterator __it)
+ { _M_ht.erase(__it); }
+
+ void
+ erase(iterator __f, iterator __l)
+ { _M_ht.erase(__f, __l); }
+
+ void
+ clear()
+ { _M_ht.clear(); }
+
+ void
+ resize(size_type __hint)
+ { _M_ht.resize(__hint); }
+
+ size_type
+ bucket_count() const
+ { return _M_ht.bucket_count(); }
+
+ size_type
+ max_bucket_count() const
+ { return _M_ht.max_bucket_count(); }
+
+ size_type
+ elems_in_bucket(size_type __n) const
+ { return _M_ht.elems_in_bucket(__n); }
+ };
+
+ template<class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
+ inline bool
+ operator==(const hash_multimap<_Key, _Tp, _HF, _EqKey, _Alloc>& __hm1,
+ const hash_multimap<_Key, _Tp, _HF, _EqKey, _Alloc>& __hm2)
+ { return __hm1._M_ht == __hm2._M_ht; }
+
+ template<class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
+ inline bool
+ operator!=(const hash_multimap<_Key, _Tp, _HF, _EqKey, _Alloc>& __hm1,
+ const hash_multimap<_Key, _Tp, _HF, _EqKey, _Alloc>& __hm2)
+ { return !(__hm1 == __hm2); }
+
+ template<class _Key, class _Tp, class _HashFn, class _EqlKey, class _Alloc>
+ inline void
+ swap(hash_multimap<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm1,
+ hash_multimap<_Key, _Tp, _HashFn, _EqlKey, _Alloc>& __hm2)
+ { __hm1.swap(__hm2); }
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Specialization of insert_iterator so that it will work for hash_map
+ // and hash_multimap.
+ template<class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc>
+ class insert_iterator<__gnu_cxx::hash_map<_Key, _Tp, _HashFn,
+ _EqKey, _Alloc> >
+ {
+ protected:
+ typedef __gnu_cxx::hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc>
+ _Container;
+ _Container* container;
+
+ public:
+ typedef _Container container_type;
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ insert_iterator(_Container& __x)
+ : container(&__x) {}
+
+ insert_iterator(_Container& __x, typename _Container::iterator)
+ : container(&__x) {}
+
+ insert_iterator<_Container>&
+ operator=(const typename _Container::value_type& __value)
+ {
+ container->insert(__value);
+ return *this;
+ }
+
+ insert_iterator<_Container>&
+ operator*()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++() { return *this; }
+
+ insert_iterator<_Container>&
+ operator++(int)
+ { return *this; }
+ };
+
+ template<class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc>
+ class insert_iterator<__gnu_cxx::hash_multimap<_Key, _Tp, _HashFn,
+ _EqKey, _Alloc> >
+ {
+ protected:
+ typedef __gnu_cxx::hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc>
+ _Container;
+ _Container* container;
+ typename _Container::iterator iter;
+
+ public:
+ typedef _Container container_type;
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ insert_iterator(_Container& __x)
+ : container(&__x) {}
+
+ insert_iterator(_Container& __x, typename _Container::iterator)
+ : container(&__x) {}
+
+ insert_iterator<_Container>&
+ operator=(const typename _Container::value_type& __value)
+ {
+ container->insert(__value);
+ return *this;
+ }
+
+ insert_iterator<_Container>&
+ operator*()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++(int)
+ { return *this; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/hash_set b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/hash_set
new file mode 100644
index 0000000..32fa220
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/hash_set
@@ -0,0 +1,558 @@
+// Hashing set implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2004, 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file backward/hash_set
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _HASH_SET
+#define _HASH_SET 1
+
+#include "backward_warning.h"
+#include <bits/c++config.h>
+#include <backward/hashtable.h>
+#include <bits/concept_check.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::equal_to;
+ using std::allocator;
+ using std::pair;
+ using std::_Identity;
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<class _Value, class _HashFcn = hash<_Value>,
+ class _EqualKey = equal_to<_Value>,
+ class _Alloc = allocator<_Value> >
+ class hash_set
+ {
+ // concept requirements
+ __glibcxx_class_requires(_Value, _SGIAssignableConcept)
+ __glibcxx_class_requires3(_HashFcn, size_t, _Value, _UnaryFunctionConcept)
+ __glibcxx_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept)
+
+ private:
+ typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
+ _EqualKey, _Alloc> _Ht;
+ _Ht _M_ht;
+
+ public:
+ typedef typename _Ht::key_type key_type;
+ typedef typename _Ht::value_type value_type;
+ typedef typename _Ht::hasher hasher;
+ typedef typename _Ht::key_equal key_equal;
+
+ typedef typename _Ht::size_type size_type;
+ typedef typename _Ht::difference_type difference_type;
+ typedef typename _Alloc::pointer pointer;
+ typedef typename _Alloc::const_pointer const_pointer;
+ typedef typename _Alloc::reference reference;
+ typedef typename _Alloc::const_reference const_reference;
+
+ typedef typename _Ht::const_iterator iterator;
+ typedef typename _Ht::const_iterator const_iterator;
+
+ typedef typename _Ht::allocator_type allocator_type;
+
+ hasher
+ hash_funct() const
+ { return _M_ht.hash_funct(); }
+
+ key_equal
+ key_eq() const
+ { return _M_ht.key_eq(); }
+
+ allocator_type
+ get_allocator() const
+ { return _M_ht.get_allocator(); }
+
+ hash_set()
+ : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
+
+ explicit
+ hash_set(size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
+
+ hash_set(size_type __n, const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
+
+ hash_set(size_type __n, const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a) {}
+
+ template<class _InputIterator>
+ hash_set(_InputIterator __f, _InputIterator __l)
+ : _M_ht(100, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_set(_InputIterator __f, _InputIterator __l, size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_set(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type())
+ { _M_ht.insert_unique(__f, __l); }
+
+ template<class _InputIterator>
+ hash_set(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a)
+ { _M_ht.insert_unique(__f, __l); }
+
+ size_type
+ size() const
+ { return _M_ht.size(); }
+
+ size_type
+ max_size() const
+ { return _M_ht.max_size(); }
+
+ bool
+ empty() const
+ { return _M_ht.empty(); }
+
+ void
+ swap(hash_set& __hs)
+ { _M_ht.swap(__hs._M_ht); }
+
+ template<class _Val, class _HF, class _EqK, class _Al>
+ friend bool
+ operator==(const hash_set<_Val, _HF, _EqK, _Al>&,
+ const hash_set<_Val, _HF, _EqK, _Al>&);
+
+ iterator
+ begin() const
+ { return _M_ht.begin(); }
+
+ iterator
+ end() const
+ { return _M_ht.end(); }
+
+ pair<iterator, bool>
+ insert(const value_type& __obj)
+ {
+ pair<typename _Ht::iterator, bool> __p = _M_ht.insert_unique(__obj);
+ return pair<iterator,bool>(__p.first, __p.second);
+ }
+
+ template<class _InputIterator>
+ void
+ insert(_InputIterator __f, _InputIterator __l)
+ { _M_ht.insert_unique(__f, __l); }
+
+ pair<iterator, bool>
+ insert_noresize(const value_type& __obj)
+ {
+ pair<typename _Ht::iterator, bool> __p
+ = _M_ht.insert_unique_noresize(__obj);
+ return pair<iterator, bool>(__p.first, __p.second);
+ }
+
+ iterator
+ find(const key_type& __key) const
+ { return _M_ht.find(__key); }
+
+ size_type
+ count(const key_type& __key) const
+ { return _M_ht.count(__key); }
+
+ pair<iterator, iterator>
+ equal_range(const key_type& __key) const
+ { return _M_ht.equal_range(__key); }
+
+ size_type
+ erase(const key_type& __key)
+ {return _M_ht.erase(__key); }
+
+ void
+ erase(iterator __it)
+ { _M_ht.erase(__it); }
+
+ void
+ erase(iterator __f, iterator __l)
+ { _M_ht.erase(__f, __l); }
+
+ void
+ clear()
+ { _M_ht.clear(); }
+
+ void
+ resize(size_type __hint)
+ { _M_ht.resize(__hint); }
+
+ size_type
+ bucket_count() const
+ { return _M_ht.bucket_count(); }
+
+ size_type
+ max_bucket_count() const
+ { return _M_ht.max_bucket_count(); }
+
+ size_type
+ elems_in_bucket(size_type __n) const
+ { return _M_ht.elems_in_bucket(__n); }
+ };
+
+ template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
+ inline bool
+ operator==(const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { return __hs1._M_ht == __hs2._M_ht; }
+
+ template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
+ inline bool
+ operator!=(const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { return !(__hs1 == __hs2); }
+
+ template<class _Val, class _HashFcn, class _EqualKey, class _Alloc>
+ inline void
+ swap(hash_set<_Val, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ hash_set<_Val, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { __hs1.swap(__hs2); }
+
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<class _Value,
+ class _HashFcn = hash<_Value>,
+ class _EqualKey = equal_to<_Value>,
+ class _Alloc = allocator<_Value> >
+ class hash_multiset
+ {
+ // concept requirements
+ __glibcxx_class_requires(_Value, _SGIAssignableConcept)
+ __glibcxx_class_requires3(_HashFcn, size_t, _Value, _UnaryFunctionConcept)
+ __glibcxx_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept)
+
+ private:
+ typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
+ _EqualKey, _Alloc> _Ht;
+ _Ht _M_ht;
+
+ public:
+ typedef typename _Ht::key_type key_type;
+ typedef typename _Ht::value_type value_type;
+ typedef typename _Ht::hasher hasher;
+ typedef typename _Ht::key_equal key_equal;
+
+ typedef typename _Ht::size_type size_type;
+ typedef typename _Ht::difference_type difference_type;
+ typedef typename _Alloc::pointer pointer;
+ typedef typename _Alloc::const_pointer const_pointer;
+ typedef typename _Alloc::reference reference;
+ typedef typename _Alloc::const_reference const_reference;
+
+ typedef typename _Ht::const_iterator iterator;
+ typedef typename _Ht::const_iterator const_iterator;
+
+ typedef typename _Ht::allocator_type allocator_type;
+
+ hasher
+ hash_funct() const
+ { return _M_ht.hash_funct(); }
+
+ key_equal
+ key_eq() const
+ { return _M_ht.key_eq(); }
+
+ allocator_type
+ get_allocator() const
+ { return _M_ht.get_allocator(); }
+
+ hash_multiset()
+ : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
+
+ explicit
+ hash_multiset(size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
+
+ hash_multiset(size_type __n, const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type()) {}
+
+ hash_multiset(size_type __n, const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a) {}
+
+ template<class _InputIterator>
+ hash_multiset(_InputIterator __f, _InputIterator __l)
+ : _M_ht(100, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n)
+ : _M_ht(__n, hasher(), key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf)
+ : _M_ht(__n, __hf, key_equal(), allocator_type())
+ { _M_ht.insert_equal(__f, __l); }
+
+ template<class _InputIterator>
+ hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _M_ht(__n, __hf, __eql, __a)
+ { _M_ht.insert_equal(__f, __l); }
+
+ size_type
+ size() const
+ { return _M_ht.size(); }
+
+ size_type
+ max_size() const
+ { return _M_ht.max_size(); }
+
+ bool
+ empty() const
+ { return _M_ht.empty(); }
+
+ void
+ swap(hash_multiset& hs)
+ { _M_ht.swap(hs._M_ht); }
+
+ template<class _Val, class _HF, class _EqK, class _Al>
+ friend bool
+ operator==(const hash_multiset<_Val, _HF, _EqK, _Al>&,
+ const hash_multiset<_Val, _HF, _EqK, _Al>&);
+
+ iterator
+ begin() const
+ { return _M_ht.begin(); }
+
+ iterator
+ end() const
+ { return _M_ht.end(); }
+
+ iterator
+ insert(const value_type& __obj)
+ { return _M_ht.insert_equal(__obj); }
+
+ template<class _InputIterator>
+ void
+ insert(_InputIterator __f, _InputIterator __l)
+ { _M_ht.insert_equal(__f,__l); }
+
+ iterator
+ insert_noresize(const value_type& __obj)
+ { return _M_ht.insert_equal_noresize(__obj); }
+
+ iterator
+ find(const key_type& __key) const
+ { return _M_ht.find(__key); }
+
+ size_type
+ count(const key_type& __key) const
+ { return _M_ht.count(__key); }
+
+ pair<iterator, iterator>
+ equal_range(const key_type& __key) const
+ { return _M_ht.equal_range(__key); }
+
+ size_type
+ erase(const key_type& __key)
+ { return _M_ht.erase(__key); }
+
+ void
+ erase(iterator __it)
+ { _M_ht.erase(__it); }
+
+ void
+ erase(iterator __f, iterator __l)
+ { _M_ht.erase(__f, __l); }
+
+ void
+ clear()
+ { _M_ht.clear(); }
+
+ void
+ resize(size_type __hint)
+ { _M_ht.resize(__hint); }
+
+ size_type
+ bucket_count() const
+ { return _M_ht.bucket_count(); }
+
+ size_type
+ max_bucket_count() const
+ { return _M_ht.max_bucket_count(); }
+
+ size_type
+ elems_in_bucket(size_type __n) const
+ { return _M_ht.elems_in_bucket(__n); }
+ };
+
+ template<class _Val, class _HashFcn, class _EqualKey, class _Alloc>
+ inline bool
+ operator==(const hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ const hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { return __hs1._M_ht == __hs2._M_ht; }
+
+ template<class _Val, class _HashFcn, class _EqualKey, class _Alloc>
+ inline bool
+ operator!=(const hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ const hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { return !(__hs1 == __hs2); }
+
+ template<class _Val, class _HashFcn, class _EqualKey, class _Alloc>
+ inline void
+ swap(hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs1,
+ hash_multiset<_Val, _HashFcn, _EqualKey, _Alloc>& __hs2)
+ { __hs1.swap(__hs2); }
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Specialization of insert_iterator so that it will work for hash_set
+ // and hash_multiset.
+ template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
+ class insert_iterator<__gnu_cxx::hash_set<_Value, _HashFcn,
+ _EqualKey, _Alloc> >
+ {
+ protected:
+ typedef __gnu_cxx::hash_set<_Value, _HashFcn, _EqualKey, _Alloc>
+ _Container;
+ _Container* container;
+
+ public:
+ typedef _Container container_type;
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ insert_iterator(_Container& __x)
+ : container(&__x) {}
+
+ insert_iterator(_Container& __x, typename _Container::iterator)
+ : container(&__x) {}
+
+ insert_iterator<_Container>&
+ operator=(const typename _Container::value_type& __value)
+ {
+ container->insert(__value);
+ return *this;
+ }
+
+ insert_iterator<_Container>&
+ operator*()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++(int)
+ { return *this; }
+ };
+
+ template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
+ class insert_iterator<__gnu_cxx::hash_multiset<_Value, _HashFcn,
+ _EqualKey, _Alloc> >
+ {
+ protected:
+ typedef __gnu_cxx::hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc>
+ _Container;
+ _Container* container;
+ typename _Container::iterator iter;
+
+ public:
+ typedef _Container container_type;
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ insert_iterator(_Container& __x)
+ : container(&__x) {}
+
+ insert_iterator(_Container& __x, typename _Container::iterator)
+ : container(&__x) {}
+
+ insert_iterator<_Container>&
+ operator=(const typename _Container::value_type& __value)
+ {
+ container->insert(__value);
+ return *this;
+ }
+
+ insert_iterator<_Container>&
+ operator*()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++(int) { return *this; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/iterator b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/iterator
new file mode 100644
index 0000000..83b4b57
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/iterator
@@ -0,0 +1,113 @@
+// HP/SGI iterator extensions -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file ext/iterator
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _EXT_ITERATOR
+#define _EXT_ITERATOR 1
+
+#pragma GCC system_header
+
+#include <bits/concept_check.h>
+#include <iterator>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // There are two signatures for distance. In addition to the one
+ // taking two iterators and returning a result, there is another
+ // taking two iterators and a reference-to-result variable, and
+ // returning nothing. The latter seems to be an SGI extension.
+ // -- pedwards
+ template<typename _InputIterator, typename _Distance>
+ inline void
+ __distance(_InputIterator __first, _InputIterator __last,
+ _Distance& __n, std::input_iterator_tag)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ while (__first != __last)
+ {
+ ++__first;
+ ++__n;
+ }
+ }
+
+ template<typename _RandomAccessIterator, typename _Distance>
+ inline void
+ __distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Distance& __n, std::random_access_iterator_tag)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __n += __last - __first;
+ }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<typename _InputIterator, typename _Distance>
+ inline void
+ distance(_InputIterator __first, _InputIterator __last,
+ _Distance& __n)
+ {
+ // concept requirements -- taken care of in __distance
+ __distance(__first, __last, __n, std::__iterator_category(__first));
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/malloc_allocator.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/malloc_allocator.h
new file mode 100644
index 0000000..4c4a72a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/malloc_allocator.h
@@ -0,0 +1,134 @@
+// Allocator that wraps "C" malloc -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/malloc_allocator.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _MALLOC_ALLOCATOR_H
+#define _MALLOC_ALLOCATOR_H 1
+
+#include <cstdlib>
+#include <new>
+#include <bits/functexcept.h>
+#include <bits/move.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+ using std::ptrdiff_t;
+
+ /**
+ * @brief An allocator that uses malloc.
+ * @ingroup allocators
+ *
+ * This is precisely the allocator defined in the C++ Standard.
+ * - all allocation calls malloc
+ * - all deallocation calls free
+ */
+ template<typename _Tp>
+ class malloc_allocator
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+
+ template<typename _Tp1>
+ struct rebind
+ { typedef malloc_allocator<_Tp1> other; };
+
+ malloc_allocator() throw() { }
+
+ malloc_allocator(const malloc_allocator&) throw() { }
+
+ template<typename _Tp1>
+ malloc_allocator(const malloc_allocator<_Tp1>&) throw() { }
+
+ ~malloc_allocator() throw() { }
+
+ pointer
+ address(reference __x) const { return &__x; }
+
+ const_pointer
+ address(const_reference __x) const { return &__x; }
+
+ // NB: __n is permitted to be 0. The C++ standard says nothing
+ // about what the return value is when __n == 0.
+ pointer
+ allocate(size_type __n, const void* = 0)
+ {
+ if (__builtin_expect(__n > this->max_size(), false))
+ std::__throw_bad_alloc();
+
+ pointer __ret = static_cast<_Tp*>(std::malloc(__n * sizeof(_Tp)));
+ if (!__ret)
+ std::__throw_bad_alloc();
+ return __ret;
+ }
+
+ // __p is not permitted to be a null pointer.
+ void
+ deallocate(pointer __p, size_type)
+ { std::free(static_cast<void*>(__p)); }
+
+ size_type
+ max_size() const throw()
+ { return size_t(-1) / sizeof(_Tp); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 402. wrong new expression in [some_] allocator::construct
+ void
+ construct(pointer __p, const _Tp& __val)
+ { ::new((void *)__p) value_type(__val); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ void
+ construct(pointer __p, _Args&&... __args)
+ { ::new((void *)__p) _Tp(std::forward<_Args>(__args)...); }
+#endif
+
+ void
+ destroy(pointer __p) { __p->~_Tp(); }
+ };
+
+ template<typename _Tp>
+ inline bool
+ operator==(const malloc_allocator<_Tp>&, const malloc_allocator<_Tp>&)
+ { return true; }
+
+ template<typename _Tp>
+ inline bool
+ operator!=(const malloc_allocator<_Tp>&, const malloc_allocator<_Tp>&)
+ { return false; }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/memory b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/memory
new file mode 100644
index 0000000..7776d73
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/memory
@@ -0,0 +1,195 @@
+// Memory extensions -*- C++ -*-
+
+// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file ext/memory
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _EXT_MEMORY
+#define _EXT_MEMORY 1
+
+#pragma GCC system_header
+
+#include <memory>
+#include <bits/stl_tempbuf.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::ptrdiff_t;
+ using std::pair;
+ using std::__iterator_category;
+ using std::_Temporary_buffer;
+
+ template<typename _InputIter, typename _Size, typename _ForwardIter>
+ pair<_InputIter, _ForwardIter>
+ __uninitialized_copy_n(_InputIter __first, _Size __count,
+ _ForwardIter __result, std::input_iterator_tag)
+ {
+ _ForwardIter __cur = __result;
+ __try
+ {
+ for (; __count > 0 ; --__count, ++__first, ++__cur)
+ std::_Construct(&*__cur, *__first);
+ return pair<_InputIter, _ForwardIter>(__first, __cur);
+ }
+ __catch(...)
+ {
+ std::_Destroy(__result, __cur);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _RandomAccessIter, typename _Size, typename _ForwardIter>
+ inline pair<_RandomAccessIter, _ForwardIter>
+ __uninitialized_copy_n(_RandomAccessIter __first, _Size __count,
+ _ForwardIter __result,
+ std::random_access_iterator_tag)
+ {
+ _RandomAccessIter __last = __first + __count;
+ return (pair<_RandomAccessIter, _ForwardIter>
+ (__last, std::uninitialized_copy(__first, __last, __result)));
+ }
+
+ template<typename _InputIter, typename _Size, typename _ForwardIter>
+ inline pair<_InputIter, _ForwardIter>
+ __uninitialized_copy_n(_InputIter __first, _Size __count,
+ _ForwardIter __result)
+ { return __gnu_cxx::__uninitialized_copy_n(__first, __count, __result,
+ __iterator_category(__first)); }
+
+ /**
+ * @brief Copies the range [first,last) into result.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @return result + (first - last)
+ * @ingroup SGIextensions
+ *
+ * Like copy(), but does not require an initialized output range.
+ */
+ template<typename _InputIter, typename _Size, typename _ForwardIter>
+ inline pair<_InputIter, _ForwardIter>
+ uninitialized_copy_n(_InputIter __first, _Size __count,
+ _ForwardIter __result)
+ { return __gnu_cxx::__uninitialized_copy_n(__first, __count, __result,
+ __iterator_category(__first)); }
+
+
+ // An alternative version of uninitialized_copy_n that constructs
+ // and destroys objects with a user-provided allocator.
+ template<typename _InputIter, typename _Size, typename _ForwardIter,
+ typename _Allocator>
+ pair<_InputIter, _ForwardIter>
+ __uninitialized_copy_n_a(_InputIter __first, _Size __count,
+ _ForwardIter __result,
+ _Allocator __alloc)
+ {
+ _ForwardIter __cur = __result;
+ __try
+ {
+ for (; __count > 0 ; --__count, ++__first, ++__cur)
+ __alloc.construct(&*__cur, *__first);
+ return pair<_InputIter, _ForwardIter>(__first, __cur);
+ }
+ __catch(...)
+ {
+ std::_Destroy(__result, __cur, __alloc);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _InputIter, typename _Size, typename _ForwardIter,
+ typename _Tp>
+ inline pair<_InputIter, _ForwardIter>
+ __uninitialized_copy_n_a(_InputIter __first, _Size __count,
+ _ForwardIter __result,
+ std::allocator<_Tp>)
+ {
+ return __gnu_cxx::uninitialized_copy_n(__first, __count, __result);
+ }
+
+ /**
+ * This class provides similar behavior and semantics of the standard
+ * functions get_temporary_buffer() and return_temporary_buffer(), but
+ * encapsulated in a type vaguely resembling a standard container.
+ *
+ * By default, a temporary_buffer<Iter> stores space for objects of
+ * whatever type the Iter iterator points to. It is constructed from a
+ * typical [first,last) range, and provides the begin(), end(), size()
+ * functions, as well as requested_size(). For non-trivial types, copies
+ * of *first will be used to initialize the storage.
+ *
+ * @c malloc is used to obtain underlying storage.
+ *
+ * Like get_temporary_buffer(), not all the requested memory may be
+ * available. Ideally, the created buffer will be large enough to hold a
+ * copy of [first,last), but if size() is less than requested_size(),
+ * then this didn't happen.
+ *
+ * @ingroup SGIextensions
+ */
+ template <class _ForwardIterator, class _Tp
+ = typename std::iterator_traits<_ForwardIterator>::value_type >
+ struct temporary_buffer : public _Temporary_buffer<_ForwardIterator, _Tp>
+ {
+ /// Requests storage large enough to hold a copy of [first,last).
+ temporary_buffer(_ForwardIterator __first, _ForwardIterator __last)
+ : _Temporary_buffer<_ForwardIterator, _Tp>(__first, __last) { }
+
+ /// Destroys objects and frees storage.
+ ~temporary_buffer() { }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/mt_allocator.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/mt_allocator.h
new file mode 100644
index 0000000..f03f3a6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/mt_allocator.h
@@ -0,0 +1,751 @@
+// MT-optimized allocator -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/mt_allocator.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _MT_ALLOCATOR_H
+#define _MT_ALLOCATOR_H 1
+
+#include <new>
+#include <cstdlib>
+#include <bits/functexcept.h>
+#include <ext/atomicity.h>
+#include <bits/move.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+ using std::ptrdiff_t;
+
+ typedef void (*__destroy_handler)(void*);
+
+ /// Base class for pool object.
+ struct __pool_base
+ {
+ // Using short int as type for the binmap implies we are never
+ // caching blocks larger than 32768 with this allocator.
+ typedef unsigned short int _Binmap_type;
+
+ // Variables used to configure the behavior of the allocator,
+ // assigned and explained in detail below.
+ struct _Tune
+ {
+ // Compile time constants for the default _Tune values.
+ enum { _S_align = 8 };
+ enum { _S_max_bytes = 128 };
+ enum { _S_min_bin = 8 };
+ enum { _S_chunk_size = 4096 - 4 * sizeof(void*) };
+ enum { _S_max_threads = 4096 };
+ enum { _S_freelist_headroom = 10 };
+
+ // Alignment needed.
+ // NB: In any case must be >= sizeof(_Block_record), that
+ // is 4 on 32 bit machines and 8 on 64 bit machines.
+ size_t _M_align;
+
+ // Allocation requests (after round-up to power of 2) below
+ // this value will be handled by the allocator. A raw new/
+ // call will be used for requests larger than this value.
+ // NB: Must be much smaller than _M_chunk_size and in any
+ // case <= 32768.
+ size_t _M_max_bytes;
+
+ // Size in bytes of the smallest bin.
+ // NB: Must be a power of 2 and >= _M_align (and of course
+ // much smaller than _M_max_bytes).
+ size_t _M_min_bin;
+
+ // In order to avoid fragmenting and minimize the number of
+ // new() calls we always request new memory using this
+ // value. Based on previous discussions on the libstdc++
+ // mailing list we have chosen the value below.
+ // See http://gcc.gnu.org/ml/libstdc++/2001-07/msg00077.html
+ // NB: At least one order of magnitude > _M_max_bytes.
+ size_t _M_chunk_size;
+
+ // The maximum number of supported threads. For
+ // single-threaded operation, use one. Maximum values will
+ // vary depending on details of the underlying system. (For
+ // instance, Linux 2.4.18 reports 4070 in
+ // /proc/sys/kernel/threads-max, while Linux 2.6.6 reports
+ // 65534)
+ size_t _M_max_threads;
+
+ // Each time a deallocation occurs in a threaded application
+ // we make sure that there are no more than
+ // _M_freelist_headroom % of used memory on the freelist. If
+ // the number of additional records is more than
+ // _M_freelist_headroom % of the freelist, we move these
+ // records back to the global pool.
+ size_t _M_freelist_headroom;
+
+ // Set to true forces all allocations to use new().
+ bool _M_force_new;
+
+ explicit
+ _Tune()
+ : _M_align(_S_align), _M_max_bytes(_S_max_bytes), _M_min_bin(_S_min_bin),
+ _M_chunk_size(_S_chunk_size), _M_max_threads(_S_max_threads),
+ _M_freelist_headroom(_S_freelist_headroom),
+ _M_force_new(std::getenv("GLIBCXX_FORCE_NEW") ? true : false)
+ { }
+
+ explicit
+ _Tune(size_t __align, size_t __maxb, size_t __minbin, size_t __chunk,
+ size_t __maxthreads, size_t __headroom, bool __force)
+ : _M_align(__align), _M_max_bytes(__maxb), _M_min_bin(__minbin),
+ _M_chunk_size(__chunk), _M_max_threads(__maxthreads),
+ _M_freelist_headroom(__headroom), _M_force_new(__force)
+ { }
+ };
+
+ struct _Block_address
+ {
+ void* _M_initial;
+ _Block_address* _M_next;
+ };
+
+ const _Tune&
+ _M_get_options() const
+ { return _M_options; }
+
+ void
+ _M_set_options(_Tune __t)
+ {
+ if (!_M_init)
+ _M_options = __t;
+ }
+
+ bool
+ _M_check_threshold(size_t __bytes)
+ { return __bytes > _M_options._M_max_bytes || _M_options._M_force_new; }
+
+ size_t
+ _M_get_binmap(size_t __bytes)
+ { return _M_binmap[__bytes]; }
+
+ size_t
+ _M_get_align()
+ { return _M_options._M_align; }
+
+ explicit
+ __pool_base()
+ : _M_options(_Tune()), _M_binmap(NULL), _M_init(false) { }
+
+ explicit
+ __pool_base(const _Tune& __options)
+ : _M_options(__options), _M_binmap(NULL), _M_init(false) { }
+
+ private:
+ explicit
+ __pool_base(const __pool_base&);
+
+ __pool_base&
+ operator=(const __pool_base&);
+
+ protected:
+ // Configuration options.
+ _Tune _M_options;
+
+ _Binmap_type* _M_binmap;
+
+ // Configuration of the pool object via _M_options can happen
+ // after construction but before initialization. After
+ // initialization is complete, this variable is set to true.
+ bool _M_init;
+ };
+
+
+ /**
+ * @brief Data describing the underlying memory pool, parameterized on
+ * threading support.
+ */
+ template<bool _Thread>
+ class __pool;
+
+ /// Specialization for single thread.
+ template<>
+ class __pool<false> : public __pool_base
+ {
+ public:
+ union _Block_record
+ {
+ // Points to the block_record of the next free block.
+ _Block_record* _M_next;
+ };
+
+ struct _Bin_record
+ {
+ // An "array" of pointers to the first free block.
+ _Block_record** _M_first;
+
+ // A list of the initial addresses of all allocated blocks.
+ _Block_address* _M_address;
+ };
+
+ void
+ _M_initialize_once()
+ {
+ if (__builtin_expect(_M_init == false, false))
+ _M_initialize();
+ }
+
+ void
+ _M_destroy() throw();
+
+ char*
+ _M_reserve_block(size_t __bytes, const size_t __thread_id);
+
+ void
+ _M_reclaim_block(char* __p, size_t __bytes);
+
+ size_t
+ _M_get_thread_id() { return 0; }
+
+ const _Bin_record&
+ _M_get_bin(size_t __which)
+ { return _M_bin[__which]; }
+
+ void
+ _M_adjust_freelist(const _Bin_record&, _Block_record*, size_t)
+ { }
+
+ explicit __pool()
+ : _M_bin(NULL), _M_bin_size(1) { }
+
+ explicit __pool(const __pool_base::_Tune& __tune)
+ : __pool_base(__tune), _M_bin(NULL), _M_bin_size(1) { }
+
+ private:
+ // An "array" of bin_records each of which represents a specific
+ // power of 2 size. Memory to this "array" is allocated in
+ // _M_initialize().
+ _Bin_record* _M_bin;
+
+ // Actual value calculated in _M_initialize().
+ size_t _M_bin_size;
+
+ void
+ _M_initialize();
+ };
+
+#ifdef __GTHREADS
+ /// Specialization for thread enabled, via gthreads.h.
+ template<>
+ class __pool<true> : public __pool_base
+ {
+ public:
+ // Each requesting thread is assigned an id ranging from 1 to
+ // _S_max_threads. Thread id 0 is used as a global memory pool.
+ // In order to get constant performance on the thread assignment
+ // routine, we keep a list of free ids. When a thread first
+ // requests memory we remove the first record in this list and
+ // stores the address in a __gthread_key. When initializing the
+ // __gthread_key we specify a destructor. When this destructor
+ // (i.e. the thread dies) is called, we return the thread id to
+ // the front of this list.
+ struct _Thread_record
+ {
+ // Points to next free thread id record. NULL if last record in list.
+ _Thread_record* _M_next;
+
+ // Thread id ranging from 1 to _S_max_threads.
+ size_t _M_id;
+ };
+
+ union _Block_record
+ {
+ // Points to the block_record of the next free block.
+ _Block_record* _M_next;
+
+ // The thread id of the thread which has requested this block.
+ size_t _M_thread_id;
+ };
+
+ struct _Bin_record
+ {
+ // An "array" of pointers to the first free block for each
+ // thread id. Memory to this "array" is allocated in
+ // _S_initialize() for _S_max_threads + global pool 0.
+ _Block_record** _M_first;
+
+ // A list of the initial addresses of all allocated blocks.
+ _Block_address* _M_address;
+
+ // An "array" of counters used to keep track of the amount of
+ // blocks that are on the freelist/used for each thread id.
+ // - Note that the second part of the allocated _M_used "array"
+ // actually hosts (atomic) counters of reclaimed blocks: in
+ // _M_reserve_block and in _M_reclaim_block those numbers are
+ // subtracted from the first ones to obtain the actual size
+ // of the "working set" of the given thread.
+ // - Memory to these "arrays" is allocated in _S_initialize()
+ // for _S_max_threads + global pool 0.
+ size_t* _M_free;
+ size_t* _M_used;
+
+ // Each bin has its own mutex which is used to ensure data
+ // integrity while changing "ownership" on a block. The mutex
+ // is initialized in _S_initialize().
+ __gthread_mutex_t* _M_mutex;
+ };
+
+ // XXX GLIBCXX_ABI Deprecated
+ void
+ _M_initialize(__destroy_handler);
+
+ void
+ _M_initialize_once()
+ {
+ if (__builtin_expect(_M_init == false, false))
+ _M_initialize();
+ }
+
+ void
+ _M_destroy() throw();
+
+ char*
+ _M_reserve_block(size_t __bytes, const size_t __thread_id);
+
+ void
+ _M_reclaim_block(char* __p, size_t __bytes);
+
+ const _Bin_record&
+ _M_get_bin(size_t __which)
+ { return _M_bin[__which]; }
+
+ void
+ _M_adjust_freelist(const _Bin_record& __bin, _Block_record* __block,
+ size_t __thread_id)
+ {
+ if (__gthread_active_p())
+ {
+ __block->_M_thread_id = __thread_id;
+ --__bin._M_free[__thread_id];
+ ++__bin._M_used[__thread_id];
+ }
+ }
+
+ // XXX GLIBCXX_ABI Deprecated
+ void
+ _M_destroy_thread_key(void*);
+
+ size_t
+ _M_get_thread_id();
+
+ explicit __pool()
+ : _M_bin(NULL), _M_bin_size(1), _M_thread_freelist(NULL)
+ { }
+
+ explicit __pool(const __pool_base::_Tune& __tune)
+ : __pool_base(__tune), _M_bin(NULL), _M_bin_size(1),
+ _M_thread_freelist(NULL)
+ { }
+
+ private:
+ // An "array" of bin_records each of which represents a specific
+ // power of 2 size. Memory to this "array" is allocated in
+ // _M_initialize().
+ _Bin_record* _M_bin;
+
+ // Actual value calculated in _M_initialize().
+ size_t _M_bin_size;
+
+ _Thread_record* _M_thread_freelist;
+ void* _M_thread_freelist_initial;
+
+ void
+ _M_initialize();
+ };
+#endif
+
+ template<template <bool> class _PoolTp, bool _Thread>
+ struct __common_pool
+ {
+ typedef _PoolTp<_Thread> pool_type;
+
+ static pool_type&
+ _S_get_pool()
+ {
+ static pool_type _S_pool;
+ return _S_pool;
+ }
+ };
+
+ template<template <bool> class _PoolTp, bool _Thread>
+ struct __common_pool_base;
+
+ template<template <bool> class _PoolTp>
+ struct __common_pool_base<_PoolTp, false>
+ : public __common_pool<_PoolTp, false>
+ {
+ using __common_pool<_PoolTp, false>::_S_get_pool;
+
+ static void
+ _S_initialize_once()
+ {
+ static bool __init;
+ if (__builtin_expect(__init == false, false))
+ {
+ _S_get_pool()._M_initialize_once();
+ __init = true;
+ }
+ }
+ };
+
+#ifdef __GTHREADS
+ template<template <bool> class _PoolTp>
+ struct __common_pool_base<_PoolTp, true>
+ : public __common_pool<_PoolTp, true>
+ {
+ using __common_pool<_PoolTp, true>::_S_get_pool;
+
+ static void
+ _S_initialize()
+ { _S_get_pool()._M_initialize_once(); }
+
+ static void
+ _S_initialize_once()
+ {
+ static bool __init;
+ if (__builtin_expect(__init == false, false))
+ {
+ if (__gthread_active_p())
+ {
+ // On some platforms, __gthread_once_t is an aggregate.
+ static __gthread_once_t __once = __GTHREAD_ONCE_INIT;
+ __gthread_once(&__once, _S_initialize);
+ }
+
+ // Double check initialization. May be necessary on some
+ // systems for proper construction when not compiling with
+ // thread flags.
+ _S_get_pool()._M_initialize_once();
+ __init = true;
+ }
+ }
+ };
+#endif
+
+ /// Policy for shared __pool objects.
+ template<template <bool> class _PoolTp, bool _Thread>
+ struct __common_pool_policy : public __common_pool_base<_PoolTp, _Thread>
+ {
+ template<typename _Tp1, template <bool> class _PoolTp1 = _PoolTp,
+ bool _Thread1 = _Thread>
+ struct _M_rebind
+ { typedef __common_pool_policy<_PoolTp1, _Thread1> other; };
+
+ using __common_pool_base<_PoolTp, _Thread>::_S_get_pool;
+ using __common_pool_base<_PoolTp, _Thread>::_S_initialize_once;
+ };
+
+
+ template<typename _Tp, template <bool> class _PoolTp, bool _Thread>
+ struct __per_type_pool
+ {
+ typedef _Tp value_type;
+ typedef _PoolTp<_Thread> pool_type;
+
+ static pool_type&
+ _S_get_pool()
+ {
+ // Sane defaults for the _PoolTp.
+ typedef typename pool_type::_Block_record _Block_record;
+ const static size_t __a = (__alignof__(_Tp) >= sizeof(_Block_record)
+ ? __alignof__(_Tp) : sizeof(_Block_record));
+
+ typedef typename __pool_base::_Tune _Tune;
+ static _Tune _S_tune(__a, sizeof(_Tp) * 64,
+ sizeof(_Tp) * 2 >= __a ? sizeof(_Tp) * 2 : __a,
+ sizeof(_Tp) * size_t(_Tune::_S_chunk_size),
+ _Tune::_S_max_threads,
+ _Tune::_S_freelist_headroom,
+ std::getenv("GLIBCXX_FORCE_NEW") ? true : false);
+ static pool_type _S_pool(_S_tune);
+ return _S_pool;
+ }
+ };
+
+ template<typename _Tp, template <bool> class _PoolTp, bool _Thread>
+ struct __per_type_pool_base;
+
+ template<typename _Tp, template <bool> class _PoolTp>
+ struct __per_type_pool_base<_Tp, _PoolTp, false>
+ : public __per_type_pool<_Tp, _PoolTp, false>
+ {
+ using __per_type_pool<_Tp, _PoolTp, false>::_S_get_pool;
+
+ static void
+ _S_initialize_once()
+ {
+ static bool __init;
+ if (__builtin_expect(__init == false, false))
+ {
+ _S_get_pool()._M_initialize_once();
+ __init = true;
+ }
+ }
+ };
+
+ #ifdef __GTHREADS
+ template<typename _Tp, template <bool> class _PoolTp>
+ struct __per_type_pool_base<_Tp, _PoolTp, true>
+ : public __per_type_pool<_Tp, _PoolTp, true>
+ {
+ using __per_type_pool<_Tp, _PoolTp, true>::_S_get_pool;
+
+ static void
+ _S_initialize()
+ { _S_get_pool()._M_initialize_once(); }
+
+ static void
+ _S_initialize_once()
+ {
+ static bool __init;
+ if (__builtin_expect(__init == false, false))
+ {
+ if (__gthread_active_p())
+ {
+ // On some platforms, __gthread_once_t is an aggregate.
+ static __gthread_once_t __once = __GTHREAD_ONCE_INIT;
+ __gthread_once(&__once, _S_initialize);
+ }
+
+ // Double check initialization. May be necessary on some
+ // systems for proper construction when not compiling with
+ // thread flags.
+ _S_get_pool()._M_initialize_once();
+ __init = true;
+ }
+ }
+ };
+#endif
+
+ /// Policy for individual __pool objects.
+ template<typename _Tp, template <bool> class _PoolTp, bool _Thread>
+ struct __per_type_pool_policy
+ : public __per_type_pool_base<_Tp, _PoolTp, _Thread>
+ {
+ template<typename _Tp1, template <bool> class _PoolTp1 = _PoolTp,
+ bool _Thread1 = _Thread>
+ struct _M_rebind
+ { typedef __per_type_pool_policy<_Tp1, _PoolTp1, _Thread1> other; };
+
+ using __per_type_pool_base<_Tp, _PoolTp, _Thread>::_S_get_pool;
+ using __per_type_pool_base<_Tp, _PoolTp, _Thread>::_S_initialize_once;
+ };
+
+
+ /// Base class for _Tp dependent member functions.
+ template<typename _Tp>
+ class __mt_alloc_base
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+
+ pointer
+ address(reference __x) const
+ { return &__x; }
+
+ const_pointer
+ address(const_reference __x) const
+ { return &__x; }
+
+ size_type
+ max_size() const throw()
+ { return size_t(-1) / sizeof(_Tp); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 402. wrong new expression in [some_] allocator::construct
+ void
+ construct(pointer __p, const _Tp& __val)
+ { ::new((void *)__p) _Tp(__val); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ void
+ construct(pointer __p, _Args&&... __args)
+ { ::new((void *)__p) _Tp(std::forward<_Args>(__args)...); }
+#endif
+
+ void
+ destroy(pointer __p) { __p->~_Tp(); }
+ };
+
+#ifdef __GTHREADS
+#define __thread_default true
+#else
+#define __thread_default false
+#endif
+
+ /**
+ * @brief This is a fixed size (power of 2) allocator which - when
+ * compiled with thread support - will maintain one freelist per
+ * size per thread plus a "global" one. Steps are taken to limit
+ * the per thread freelist sizes (by returning excess back to
+ * the "global" list).
+ * @ingroup allocators
+ *
+ * Further details:
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt12ch32.html
+ */
+ template<typename _Tp,
+ typename _Poolp = __common_pool_policy<__pool, __thread_default> >
+ class __mt_alloc : public __mt_alloc_base<_Tp>
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+ typedef _Poolp __policy_type;
+ typedef typename _Poolp::pool_type __pool_type;
+
+ template<typename _Tp1, typename _Poolp1 = _Poolp>
+ struct rebind
+ {
+ typedef typename _Poolp1::template _M_rebind<_Tp1>::other pol_type;
+ typedef __mt_alloc<_Tp1, pol_type> other;
+ };
+
+ __mt_alloc() throw() { }
+
+ __mt_alloc(const __mt_alloc&) throw() { }
+
+ template<typename _Tp1, typename _Poolp1>
+ __mt_alloc(const __mt_alloc<_Tp1, _Poolp1>&) throw() { }
+
+ ~__mt_alloc() throw() { }
+
+ pointer
+ allocate(size_type __n, const void* = 0);
+
+ void
+ deallocate(pointer __p, size_type __n);
+
+ const __pool_base::_Tune
+ _M_get_options()
+ {
+ // Return a copy, not a reference, for external consumption.
+ return __policy_type::_S_get_pool()._M_get_options();
+ }
+
+ void
+ _M_set_options(__pool_base::_Tune __t)
+ { __policy_type::_S_get_pool()._M_set_options(__t); }
+ };
+
+ template<typename _Tp, typename _Poolp>
+ typename __mt_alloc<_Tp, _Poolp>::pointer
+ __mt_alloc<_Tp, _Poolp>::
+ allocate(size_type __n, const void*)
+ {
+ if (__builtin_expect(__n > this->max_size(), false))
+ std::__throw_bad_alloc();
+
+ __policy_type::_S_initialize_once();
+
+ // Requests larger than _M_max_bytes are handled by operator
+ // new/delete directly.
+ __pool_type& __pool = __policy_type::_S_get_pool();
+ const size_t __bytes = __n * sizeof(_Tp);
+ if (__pool._M_check_threshold(__bytes))
+ {
+ void* __ret = ::operator new(__bytes);
+ return static_cast<_Tp*>(__ret);
+ }
+
+ // Round up to power of 2 and figure out which bin to use.
+ const size_t __which = __pool._M_get_binmap(__bytes);
+ const size_t __thread_id = __pool._M_get_thread_id();
+
+ // Find out if we have blocks on our freelist. If so, go ahead
+ // and use them directly without having to lock anything.
+ char* __c;
+ typedef typename __pool_type::_Bin_record _Bin_record;
+ const _Bin_record& __bin = __pool._M_get_bin(__which);
+ if (__bin._M_first[__thread_id])
+ {
+ // Already reserved.
+ typedef typename __pool_type::_Block_record _Block_record;
+ _Block_record* __block = __bin._M_first[__thread_id];
+ __bin._M_first[__thread_id] = __block->_M_next;
+
+ __pool._M_adjust_freelist(__bin, __block, __thread_id);
+ __c = reinterpret_cast<char*>(__block) + __pool._M_get_align();
+ }
+ else
+ {
+ // Null, reserve.
+ __c = __pool._M_reserve_block(__bytes, __thread_id);
+ }
+ return static_cast<_Tp*>(static_cast<void*>(__c));
+ }
+
+ template<typename _Tp, typename _Poolp>
+ void
+ __mt_alloc<_Tp, _Poolp>::
+ deallocate(pointer __p, size_type __n)
+ {
+ if (__builtin_expect(__p != 0, true))
+ {
+ // Requests larger than _M_max_bytes are handled by
+ // operators new/delete directly.
+ __pool_type& __pool = __policy_type::_S_get_pool();
+ const size_t __bytes = __n * sizeof(_Tp);
+ if (__pool._M_check_threshold(__bytes))
+ ::operator delete(__p);
+ else
+ __pool._M_reclaim_block(reinterpret_cast<char*>(__p), __bytes);
+ }
+ }
+
+ template<typename _Tp, typename _Poolp>
+ inline bool
+ operator==(const __mt_alloc<_Tp, _Poolp>&, const __mt_alloc<_Tp, _Poolp>&)
+ { return true; }
+
+ template<typename _Tp, typename _Poolp>
+ inline bool
+ operator!=(const __mt_alloc<_Tp, _Poolp>&, const __mt_alloc<_Tp, _Poolp>&)
+ { return false; }
+
+#undef __thread_default
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/new_allocator.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/new_allocator.h
new file mode 100644
index 0000000..290c73a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/new_allocator.h
@@ -0,0 +1,130 @@
+// Allocator that wraps operator new -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/new_allocator.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _NEW_ALLOCATOR_H
+#define _NEW_ALLOCATOR_H 1
+
+#include <new>
+#include <bits/functexcept.h>
+#include <bits/move.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+ using std::ptrdiff_t;
+
+ /**
+ * @brief An allocator that uses global new, as per [20.4].
+ * @ingroup allocators
+ *
+ * This is precisely the allocator defined in the C++ Standard.
+ * - all allocation calls operator new
+ * - all deallocation calls operator delete
+ */
+ template<typename _Tp>
+ class new_allocator
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+
+ template<typename _Tp1>
+ struct rebind
+ { typedef new_allocator<_Tp1> other; };
+
+ new_allocator() throw() { }
+
+ new_allocator(const new_allocator&) throw() { }
+
+ template<typename _Tp1>
+ new_allocator(const new_allocator<_Tp1>&) throw() { }
+
+ ~new_allocator() throw() { }
+
+ pointer
+ address(reference __x) const { return &__x; }
+
+ const_pointer
+ address(const_reference __x) const { return &__x; }
+
+ // NB: __n is permitted to be 0. The C++ standard says nothing
+ // about what the return value is when __n == 0.
+ pointer
+ allocate(size_type __n, const void* = 0)
+ {
+ if (__builtin_expect(__n > this->max_size(), false))
+ std::__throw_bad_alloc();
+
+ return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
+ }
+
+ // __p is not permitted to be a null pointer.
+ void
+ deallocate(pointer __p, size_type)
+ { ::operator delete(__p); }
+
+ size_type
+ max_size() const throw()
+ { return size_t(-1) / sizeof(_Tp); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 402. wrong new expression in [some_] allocator::construct
+ void
+ construct(pointer __p, const _Tp& __val)
+ { ::new((void *)__p) _Tp(__val); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ void
+ construct(pointer __p, _Args&&... __args)
+ { ::new((void *)__p) _Tp(std::forward<_Args>(__args)...); }
+#endif
+
+ void
+ destroy(pointer __p) { __p->~_Tp(); }
+ };
+
+ template<typename _Tp>
+ inline bool
+ operator==(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
+ { return true; }
+
+ template<typename _Tp>
+ inline bool
+ operator!=(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
+ { return false; }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/numeric b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/numeric
new file mode 100644
index 0000000..5df5ee2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/numeric
@@ -0,0 +1,146 @@
+// Numeric extensions -*- C++ -*-
+
+// Copyright (C) 2002, 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file ext/numeric
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _EXT_NUMERIC
+#define _EXT_NUMERIC 1
+
+#pragma GCC system_header
+
+#include <bits/concept_check.h>
+#include <numeric>
+
+#include <ext/functional> // For identity_element
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // Returns __x ** __n, where __n >= 0. _Note that "multiplication"
+ // is required to be associative, but not necessarily commutative.
+ template<typename _Tp, typename _Integer, typename _MonoidOperation>
+ _Tp
+ __power(_Tp __x, _Integer __n, _MonoidOperation __monoid_op)
+ {
+ if (__n == 0)
+ return identity_element(__monoid_op);
+ else
+ {
+ while ((__n & 1) == 0)
+ {
+ __n >>= 1;
+ __x = __monoid_op(__x, __x);
+ }
+
+ _Tp __result = __x;
+ __n >>= 1;
+ while (__n != 0)
+ {
+ __x = __monoid_op(__x, __x);
+ if ((__n & 1) != 0)
+ __result = __monoid_op(__result, __x);
+ __n >>= 1;
+ }
+ return __result;
+ }
+ }
+
+ template<typename _Tp, typename _Integer>
+ inline _Tp
+ __power(_Tp __x, _Integer __n)
+ { return __power(__x, __n, std::multiplies<_Tp>()); }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ // Alias for the internal name __power. Note that power is an extension,
+ // not part of the C++ standard.
+ template<typename _Tp, typename _Integer, typename _MonoidOperation>
+ inline _Tp
+ power(_Tp __x, _Integer __n, _MonoidOperation __monoid_op)
+ { return __power(__x, __n, __monoid_op); }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template<typename _Tp, typename _Integer>
+ inline _Tp
+ power(_Tp __x, _Integer __n)
+ { return __power(__x, __n); }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ // iota is not part of the C++ standard. It is an extension.
+ template<typename _ForwardIter, typename _Tp>
+ void
+ iota(_ForwardIter __first, _ForwardIter __last, _Tp __value)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>)
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp,
+ typename std::iterator_traits<_ForwardIter>::value_type>)
+
+ while (__first != __last)
+ *__first++ = __value++;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/numeric_traits.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/numeric_traits.h
new file mode 100644
index 0000000..57fcf9c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/numeric_traits.h
@@ -0,0 +1,135 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/numeric_traits.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _EXT_NUMERIC_TRAITS
+#define _EXT_NUMERIC_TRAITS 1
+
+#pragma GCC system_header
+
+#include <bits/cpp_type_traits.h>
+#include <ext/type_traits.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // Compile time constants for builtin types.
+ // Sadly std::numeric_limits member functions cannot be used for this.
+#define __glibcxx_signed(_Tp) ((_Tp)(-1) < 0)
+#define __glibcxx_digits(_Tp) \
+ (sizeof(_Tp) * __CHAR_BIT__ - __glibcxx_signed(_Tp))
+
+#define __glibcxx_min(_Tp) \
+ (__glibcxx_signed(_Tp) ? (_Tp)1 << __glibcxx_digits(_Tp) : (_Tp)0)
+
+#define __glibcxx_max(_Tp) \
+ (__glibcxx_signed(_Tp) ? \
+ (((((_Tp)1 << (__glibcxx_digits(_Tp) - 1)) - 1) << 1) + 1) : ~(_Tp)0)
+
+ template<typename _Value>
+ struct __numeric_traits_integer
+ {
+ // Only integers for initialization of member constant.
+ static const _Value __min = __glibcxx_min(_Value);
+ static const _Value __max = __glibcxx_max(_Value);
+
+ // NB: these two also available in std::numeric_limits as compile
+ // time constants, but <limits> is big and we avoid including it.
+ static const bool __is_signed = __glibcxx_signed(_Value);
+ static const int __digits = __glibcxx_digits(_Value);
+ };
+
+ template<typename _Value>
+ const _Value __numeric_traits_integer<_Value>::__min;
+
+ template<typename _Value>
+ const _Value __numeric_traits_integer<_Value>::__max;
+
+ template<typename _Value>
+ const bool __numeric_traits_integer<_Value>::__is_signed;
+
+ template<typename _Value>
+ const int __numeric_traits_integer<_Value>::__digits;
+
+#undef __glibcxx_signed
+#undef __glibcxx_digits
+#undef __glibcxx_min
+#undef __glibcxx_max
+
+#define __glibcxx_floating(_Tp, _Fval, _Dval, _LDval) \
+ (std::__are_same<_Tp, float>::__value ? _Fval \
+ : std::__are_same<_Tp, double>::__value ? _Dval : _LDval)
+
+#define __glibcxx_max_digits10(_Tp) \
+ (2 + __glibcxx_floating(_Tp, __FLT_MANT_DIG__, __DBL_MANT_DIG__, \
+ __LDBL_MANT_DIG__) * 3010 / 10000)
+
+#define __glibcxx_digits10(_Tp) \
+ __glibcxx_floating(_Tp, __FLT_DIG__, __DBL_DIG__, __LDBL_DIG__)
+
+#define __glibcxx_max_exponent10(_Tp) \
+ __glibcxx_floating(_Tp, __FLT_MAX_10_EXP__, __DBL_MAX_10_EXP__, \
+ __LDBL_MAX_10_EXP__)
+
+ template<typename _Value>
+ struct __numeric_traits_floating
+ {
+ // Only floating point types. See N1822.
+ static const int __max_digits10 = __glibcxx_max_digits10(_Value);
+
+ // See above comment...
+ static const bool __is_signed = true;
+ static const int __digits10 = __glibcxx_digits10(_Value);
+ static const int __max_exponent10 = __glibcxx_max_exponent10(_Value);
+ };
+
+ template<typename _Value>
+ const int __numeric_traits_floating<_Value>::__max_digits10;
+
+ template<typename _Value>
+ const bool __numeric_traits_floating<_Value>::__is_signed;
+
+ template<typename _Value>
+ const int __numeric_traits_floating<_Value>::__digits10;
+
+ template<typename _Value>
+ const int __numeric_traits_floating<_Value>::__max_exponent10;
+
+ template<typename _Value>
+ struct __numeric_traits
+ : public __conditional_type<std::__is_integer<_Value>::__value,
+ __numeric_traits_integer<_Value>,
+ __numeric_traits_floating<_Value> >::__type
+ { };
+
+_GLIBCXX_END_NAMESPACE
+
+#undef __glibcxx_floating
+#undef __glibcxx_max_digits10
+#undef __glibcxx_digits10
+#undef __glibcxx_max_exponent10
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/assoc_container.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/assoc_container.hpp
new file mode 100644
index 0000000..7bccb88
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/assoc_container.hpp
@@ -0,0 +1,683 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file assoc_container.hpp
+ * Contains associative containers.
+ */
+
+#ifndef PB_DS_ASSOC_CNTNR_HPP
+#define PB_DS_ASSOC_CNTNR_HPP
+
+#include <ext/typelist.h>
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <ext/pb_ds/detail/standard_policies.hpp>
+#include <ext/pb_ds/detail/container_base_dispatch.hpp>
+#include <ext/pb_ds/detail/basic_tree_policy/traits.hpp>
+
+namespace __gnu_pbds
+{
+#define PB_DS_BASE_C_DEC \
+ detail::container_base_dispatch<Key, Mapped, Tag, Policy_Tl, Allocator>::type
+
+ // An abstract basic associative container.
+ template<typename Key,
+ typename Mapped,
+ typename Tag,
+ typename Policy_Tl,
+ typename Allocator>
+ class container_base : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef typename PB_DS_BASE_C_DEC base_type;
+
+ public:
+ typedef Tag container_category;
+ typedef Allocator allocator_type;
+ typedef typename allocator_type::size_type size_type;
+ typedef typename allocator_type::difference_type difference_type;
+
+ // key_type
+ typedef typename allocator_type::template rebind<Key>::other::value_type key_type;
+ typedef typename allocator_type::template rebind<key_type>::other key_rebind;
+ typedef typename key_rebind::reference key_reference;
+ typedef typename key_rebind::const_reference const_key_reference;
+ typedef typename key_rebind::pointer key_pointer;
+ typedef typename key_rebind::const_pointer const_key_pointer;
+
+ // mapped_type
+ typedef Mapped mapped_type;
+ typedef typename allocator_type::template rebind<mapped_type>::other mapped_rebind;
+ typedef typename mapped_rebind::reference mapped_reference;
+ typedef typename mapped_rebind::const_reference const_mapped_reference;
+ typedef typename mapped_rebind::pointer mapped_pointer;
+ typedef typename mapped_rebind::const_pointer const_mapped_pointer;
+
+ // value_type
+ typedef typename base_type::value_type value_type;
+ typedef typename allocator_type::template rebind<value_type>::other value_rebind;
+ typedef typename value_rebind::reference reference;
+ typedef typename value_rebind::const_reference const_reference;
+ typedef typename value_rebind::pointer pointer;
+ typedef typename value_rebind::const_pointer const_pointer;
+
+ // iterators
+ typedef typename base_type::iterator iterator;
+ typedef typename base_type::const_iterator const_iterator;
+ typedef typename base_type::point_iterator point_iterator;
+ typedef typename base_type::const_point_iterator const_point_iterator;
+
+ virtual
+ ~container_base() { }
+
+ protected:
+#define PB_DS_CLASS_NAME container_base
+#include <ext/pb_ds/detail/constructors_destructor_fn_imps.hpp>
+#undef PB_DS_CLASS_NAME
+ };
+
+#undef PB_DS_BASE_C_DEC
+
+
+#define PB_DS_BASE_C_DEC \
+ container_base<Key, Mapped, Tag, typename __gnu_cxx::typelist::append< \
+ typename __gnu_cxx::typelist::create4<Hash_Fn, Eq_Fn, Resize_Policy, detail::integral_constant<int, Store_Hash> >::type, Policy_TL>::type, Allocator>
+
+ // An abstract basic hash-based associative container.
+ template<typename Key,
+ typename Mapped,
+ typename Hash_Fn,
+ typename Eq_Fn,
+ typename Resize_Policy,
+ bool Store_Hash,
+ typename Tag,
+ typename Policy_TL,
+ typename Allocator>
+ class basic_hash_table : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ virtual
+ ~basic_hash_table() { }
+
+ protected:
+#define PB_DS_CLASS_NAME basic_hash_table
+#include <ext/pb_ds/detail/constructors_destructor_fn_imps.hpp>
+#undef PB_DS_CLASS_NAME
+
+ private:
+ basic_hash_table&
+ operator=(const base_type&);
+ };
+
+#undef PB_DS_BASE_C_DEC
+
+
+#define PB_DS_BASE_C_DEC \
+ basic_hash_table<Key, Mapped, Hash_Fn, Eq_Fn, Resize_Policy, Store_Hash, \
+ cc_hash_tag, \
+ typename __gnu_cxx::typelist::create1<Comb_Hash_Fn>::type, Allocator>
+
+ // A concrete collision-chaining hash-based associative container.
+ template<typename Key,
+ typename Mapped,
+ typename Hash_Fn = typename detail::default_hash_fn<Key>::type,
+ typename Eq_Fn = typename detail::default_eq_fn<Key>::type,
+ typename Comb_Hash_Fn = detail::default_comb_hash_fn::type,
+ typename Resize_Policy = typename detail::default_resize_policy<Comb_Hash_Fn>::type,
+ bool Store_Hash = detail::default_store_hash,
+ typename Allocator = std::allocator<char> >
+ class cc_hash_table : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ typedef Hash_Fn hash_fn;
+ typedef Eq_Fn eq_fn;
+ typedef Resize_Policy resize_policy;
+ typedef Comb_Hash_Fn comb_hash_fn;
+
+ // Default constructor.
+ cc_hash_table() { }
+
+ // Constructor taking some policy objects. r_hash_fn will be
+ // copied by the Hash_Fn object of the container object.
+ cc_hash_table(const hash_fn& h)
+ : base_type(h) { }
+
+ // Constructor taking some policy objects. r_hash_fn will be
+ // copied by the hash_fn object of the container object, and
+ // r_eq_fn will be copied by the eq_fn object of the container
+ // object.
+ cc_hash_table(const hash_fn& h, const eq_fn& e)
+ : base_type(h, e) { }
+
+ // Constructor taking some policy objects. r_hash_fn will be
+ // copied by the hash_fn object of the container object, r_eq_fn
+ // will be copied by the eq_fn object of the container object, and
+ // r_comb_hash_fn will be copied by the comb_hash_fn object of the
+ // container object.
+ cc_hash_table(const hash_fn& h, const eq_fn& e, const comb_hash_fn& ch)
+ : base_type(h, e, ch) { }
+
+ // Constructor taking some policy objects. r_hash_fn will be
+ // copied by the hash_fn object of the container object, r_eq_fn
+ // will be copied by the eq_fn object of the container object,
+ // r_comb_hash_fn will be copied by the comb_hash_fn object of the
+ // container object, and r_resize_policy will be copied by the
+ // resize_policy object of the container object.
+ cc_hash_table(const hash_fn& h, const eq_fn& e, const comb_hash_fn& ch,
+ const resize_policy& rp)
+ : base_type(h, e, ch, rp) { }
+
+ // Constructor taking __iterators to a range of value_types. The
+ // value_types between first_it and last_it will be inserted into
+ // the container object.
+ template<typename It>
+ cc_hash_table(It first, It last)
+ { base_type::copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects. The value_types between first_it and
+ // last_it will be inserted into the container object.
+ template<typename It>
+ cc_hash_table(It first, It last, const hash_fn& h)
+ : base_type(h)
+ { copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects The value_types between first_it and
+ // last_it will be inserted into the container object. r_hash_fn
+ // will be copied by the hash_fn object of the container object,
+ // and r_eq_fn will be copied by the eq_fn object of the container
+ // object.
+ template<typename It>
+ cc_hash_table(It first, It last, const hash_fn& h, const eq_fn& e)
+ : base_type(h, e)
+ { copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects The value_types between first_it and
+ // last_it will be inserted into the container object. r_hash_fn
+ // will be copied by the hash_fn object of the container object,
+ // r_eq_fn will be copied by the eq_fn object of the container
+ // object, and r_comb_hash_fn will be copied by the comb_hash_fn
+ // object of the container object.
+ template<typename It>
+ cc_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
+ const comb_hash_fn& ch)
+ : base_type(h, e, ch)
+ { copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects The value_types between first_it and
+ // last_it will be inserted into the container object. r_hash_fn
+ // will be copied by the hash_fn object of the container object,
+ // r_eq_fn will be copied by the eq_fn object of the container
+ // object, r_comb_hash_fn will be copied by the comb_hash_fn
+ // object of the container object, and r_resize_policy will be
+ // copied by the resize_policy object of the container object.
+ template<typename It>
+ cc_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
+ const comb_hash_fn& ch, const resize_policy& rp)
+ : base_type(h, e, ch, rp)
+ { copy_from_range(first, last); }
+
+ cc_hash_table(const cc_hash_table& other)
+ : base_type((const base_type&)other)
+ { }
+
+ virtual
+ ~cc_hash_table() { }
+
+ cc_hash_table&
+ operator=(const cc_hash_table& other)
+ {
+ if (this != &other)
+ {
+ cc_hash_table tmp(other);
+ swap(tmp);
+ }
+ return *this;
+ }
+
+ void
+ swap(cc_hash_table& other)
+ { base_type::swap(other); }
+ };
+
+#undef PB_DS_BASE_C_DEC
+
+
+#define PB_DS_BASE_C_DEC \
+ basic_hash_table<Key, Mapped, Hash_Fn, Eq_Fn, Resize_Policy, Store_Hash, \
+ gp_hash_tag, \
+ typename __gnu_cxx::typelist::create2<Comb_Probe_Fn, Probe_Fn>::type, Allocator>
+
+ // A concrete general-probing hash-based associative container.
+ template<typename Key,
+ typename Mapped,
+ typename Hash_Fn = typename detail::default_hash_fn<Key>::type,
+ typename Eq_Fn = typename detail::default_eq_fn<Key>::type,
+ typename Comb_Probe_Fn = detail::default_comb_hash_fn::type,
+ typename Probe_Fn = typename detail::default_probe_fn<Comb_Probe_Fn>::type,
+ typename Resize_Policy = typename detail::default_resize_policy<Comb_Probe_Fn>::type,
+ bool Store_Hash = detail::default_store_hash,
+ typename Allocator = std::allocator<char> >
+ class gp_hash_table : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ typedef Hash_Fn hash_fn;
+ typedef Eq_Fn eq_fn;
+ typedef Comb_Probe_Fn comb_probe_fn;
+ typedef Probe_Fn probe_fn;
+ typedef Resize_Policy resize_policy;
+
+ // Default constructor.
+ gp_hash_table() { }
+
+ // Constructor taking some policy objects. r_hash_fn will be
+ // copied by the hash_fn object of the container object.
+ gp_hash_table(const hash_fn& h)
+ : base_type(h) { }
+
+ // Constructor taking some policy objects. r_hash_fn will be
+ // copied by the hash_fn object of the container object, and
+ // r_eq_fn will be copied by the eq_fn object of the container
+ // object.
+ gp_hash_table(const hash_fn& h, const eq_fn& e)
+ : base_type(h, e) { }
+
+ // Constructor taking some policy objects. r_hash_fn will be
+ // copied by the hash_fn object of the container object, r_eq_fn
+ // will be copied by the eq_fn object of the container object, and
+ // r_comb_probe_fn will be copied by the comb_probe_fn object of
+ // the container object.
+ gp_hash_table(const hash_fn& h, const eq_fn& e, const comb_probe_fn& cp)
+ : base_type(h, e, cp) { }
+
+ // Constructor taking some policy objects. r_hash_fn will be
+ // copied by the hash_fn object of the container object, r_eq_fn
+ // will be copied by the eq_fn object of the container object,
+ // r_comb_probe_fn will be copied by the comb_probe_fn object of
+ // the container object, and r_probe_fn will be copied by the
+ // probe_fn object of the container object.
+ gp_hash_table(const hash_fn& h, const eq_fn& e, const comb_probe_fn& cp,
+ const probe_fn& p)
+ : base_type(h, e, cp, p) { }
+
+ // Constructor taking some policy objects. r_hash_fn will be
+ // copied by the hash_fn object of the container object, r_eq_fn
+ // will be copied by the eq_fn object of the container object,
+ // r_comb_probe_fn will be copied by the comb_probe_fn object of
+ // the container object, r_probe_fn will be copied by the probe_fn
+ // object of the container object, and r_resize_policy will be
+ // copied by the Resize_Policy object of the container object.
+ gp_hash_table(const hash_fn& h, const eq_fn& e, const comb_probe_fn& cp,
+ const probe_fn& p, const resize_policy& rp)
+ : base_type(h, e, cp, p, rp) { }
+
+ // Constructor taking __iterators to a range of value_types. The
+ // value_types between first_it and last_it will be inserted into
+ // the container object.
+ template<typename It>
+ gp_hash_table(It first, It last)
+ { base_type::copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects. The value_types between first_it and
+ // last_it will be inserted into the container object. r_hash_fn
+ // will be copied by the hash_fn object of the container object.
+ template<typename It>
+ gp_hash_table(It first, It last, const hash_fn& h)
+ : base_type(h)
+ { base_type::copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects. The value_types between first_it and
+ // last_it will be inserted into the container object. r_hash_fn
+ // will be copied by the hash_fn object of the container object,
+ // and r_eq_fn will be copied by the eq_fn object of the container
+ // object.
+ template<typename It>
+ gp_hash_table(It first, It last, const hash_fn& h, const eq_fn& e)
+ : base_type(h, e)
+ { base_type::copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects. The value_types between first_it and
+ // last_it will be inserted into the container object. r_hash_fn
+ // will be copied by the hash_fn object of the container object,
+ // r_eq_fn will be copied by the eq_fn object of the container
+ // object, and r_comb_probe_fn will be copied by the comb_probe_fn
+ // object of the container object.
+ template<typename It>
+ gp_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
+ const comb_probe_fn& cp)
+ : base_type(h, e, cp)
+ { base_type::copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects. The value_types between first_it and
+ // last_it will be inserted into the container object. r_hash_fn
+ // will be copied by the hash_fn object of the container object,
+ // r_eq_fn will be copied by the eq_fn object of the container
+ // object, r_comb_probe_fn will be copied by the comb_probe_fn
+ // object of the container object, and r_probe_fn will be copied
+ // by the probe_fn object of the container object.
+ template<typename It>
+ gp_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
+ const comb_probe_fn& cp, const probe_fn& p)
+ : base_type(h, e, cp, p)
+ { base_type::copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects. The value_types between first_it and
+ // last_it will be inserted into the container object. r_hash_fn
+ // will be copied by the hash_fn object of the container object,
+ // r_eq_fn will be copied by the eq_fn object of the container
+ // object, r_comb_probe_fn will be copied by the comb_probe_fn
+ // object of the container object, r_probe_fn will be copied by
+ // the probe_fn object of the container object, and
+ // r_resize_policy will be copied by the resize_policy object of
+ // the container object.
+ template<typename It>
+ gp_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
+ const comb_probe_fn& cp, const probe_fn& p,
+ const resize_policy& rp)
+ : base_type(h, e, cp, p, rp)
+ { base_type::copy_from_range(first, last); }
+
+ gp_hash_table(const gp_hash_table& other)
+ : base_type((const base_type&)other)
+ { }
+
+ virtual
+ ~gp_hash_table() { }
+
+ gp_hash_table&
+ operator=(const gp_hash_table& other)
+ {
+ if (this != &other)
+ {
+ gp_hash_table tmp(other);
+ swap(tmp);
+ }
+ return *this;
+ }
+
+ void
+ swap(gp_hash_table& other)
+ { base_type::swap(other); }
+ };
+
+#undef PB_DS_BASE_C_DEC
+
+
+#define PB_DS_BASE_C_DEC \
+ container_base<Key, Mapped, Tag, Policy_Tl, Allocator>
+
+ // An abstract basic tree-like (tree, trie) associative container.
+ template<typename Key, typename Mapped, typename Tag,
+ typename Node_Update, typename Policy_Tl, typename Allocator>
+ class basic_tree : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ typedef Node_Update node_update;
+
+ virtual
+ ~basic_tree() { }
+
+ protected:
+#define PB_DS_CLASS_NAME basic_tree
+#include <ext/pb_ds/detail/constructors_destructor_fn_imps.hpp>
+#undef PB_DS_CLASS_NAME
+ };
+
+#undef PB_DS_BASE_C_DEC
+
+
+#define PB_DS_TREE_NODE_AND_IT_TRAITS_C_DEC \
+ detail::tree_traits<Key, Mapped,Cmp_Fn,Node_Update,Tag, Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ basic_tree<Key,Mapped,Tag,typename PB_DS_TREE_NODE_AND_IT_TRAITS_C_DEC::node_update, \
+ typename __gnu_cxx::typelist::create2<Cmp_Fn, PB_DS_TREE_NODE_AND_IT_TRAITS_C_DEC >::type, Allocator>
+
+ // A concrete basic tree-based associative container.
+ template<typename Key, typename Mapped, typename Cmp_Fn = std::less<Key>,
+ typename Tag = rb_tree_tag,
+ template<typename Const_Node_Iterator, typename Node_Iterator, typename Cmp_Fn_, typename Allocator_>
+ class Node_Update = __gnu_pbds::null_tree_node_update,
+ typename Allocator = std::allocator<char> >
+ class tree : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ // Comparison functor type.
+ typedef Cmp_Fn cmp_fn;
+
+ tree() { }
+
+ // Constructor taking some policy objects. r_cmp_fn will be copied
+ // by the Cmp_Fn object of the container object.
+ tree(const cmp_fn& c)
+ : base_type(c) { }
+
+ // Constructor taking __iterators to a range of value_types. The
+ // value_types between first_it and last_it will be inserted into
+ // the container object.
+ template<typename It>
+ tree(It first, It last)
+ { base_type::copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects The value_types between first_it and
+ // last_it will be inserted into the container object. r_cmp_fn
+ // will be copied by the cmp_fn object of the container object.
+ template<typename It>
+ tree(It first, It last, const cmp_fn& c)
+ : base_type(c)
+ { base_type::copy_from_range(first, last); }
+
+ tree(const tree& other)
+ : base_type((const base_type&)other) { }
+
+ virtual
+ ~tree() { }
+
+ tree&
+ operator=(const tree& other)
+ {
+ if (this != &other)
+ {
+ tree tmp(other);
+ swap(tmp);
+ }
+ return *this;
+ }
+
+ void
+ swap(tree& other)
+ { base_type::swap(other); }
+ };
+
+#undef PB_DS_BASE_C_DEC
+#undef PB_DS_TREE_NODE_AND_IT_TRAITS_C_DEC
+
+
+#define PB_DS_TRIE_NODE_AND_ITS_TRAITS \
+ detail::trie_traits<Key,Mapped,E_Access_Traits,Node_Update,Tag,Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ basic_tree<Key,Mapped,Tag, typename PB_DS_TRIE_NODE_AND_ITS_TRAITS::node_update, \
+ typename __gnu_cxx::typelist::create2<E_Access_Traits, PB_DS_TRIE_NODE_AND_ITS_TRAITS >::type, Allocator>
+
+ // A concrete basic trie-based associative container.
+ template<typename Key,
+ typename Mapped,
+ typename E_Access_Traits = typename detail::default_trie_e_access_traits<Key>::type,
+ typename Tag = pat_trie_tag,
+ template<typename Const_Node_Iterator,
+ typename Node_Iterator,
+ typename E_Access_Traits_,
+ typename Allocator_>
+ class Node_Update = null_trie_node_update,
+ typename Allocator = std::allocator<char> >
+ class trie : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ // Element access traits type.
+ typedef E_Access_Traits e_access_traits;
+
+ trie() { }
+
+ // Constructor taking some policy objects. r_e_access_traits will
+ // be copied by the E_Access_Traits object of the container
+ // object.
+ trie(const e_access_traits& t)
+ : base_type(t) { }
+
+ // Constructor taking __iterators to a range of value_types. The
+ // value_types between first_it and last_it will be inserted into
+ // the container object.
+ template<typename It>
+ trie(It first, It last)
+ { base_type::copy_from_range(first, last); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects. The value_types between first_it and
+ // last_it will be inserted into the container object.
+ template<typename It>
+ trie(It first, It last, const e_access_traits& t)
+ : base_type(t)
+ { base_type::copy_from_range(first, last); }
+
+ trie(const trie& other)
+ : base_type((const base_type&)other) { }
+
+ virtual
+ ~trie() { }
+
+ trie&
+ operator=(const trie& other)
+ {
+ if (this != &other)
+ {
+ trie tmp(other);
+ swap(tmp);
+ }
+ return *this;
+ }
+
+ void
+ swap(trie& other)
+ { base_type::swap(other); }
+ };
+
+#undef PB_DS_BASE_C_DEC
+#undef PB_DS_TRIE_NODE_AND_ITS_TRAITS
+
+
+#define PB_DS_BASE_C_DEC \
+ container_base<Key, Mapped, list_update_tag, \
+ typename __gnu_cxx::typelist::create2<Eq_Fn, Update_Policy>::type, Allocator>
+
+ // A list-update based associative container.
+ template<typename Key,
+ typename Mapped,
+ class Eq_Fn = typename detail::default_eq_fn<Key>::type,
+ class Update_Policy = detail::default_update_policy::type,
+ class Allocator = std::allocator<char> >
+ class list_update : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ typedef Eq_Fn eq_fn;
+ typedef Update_Policy update_policy;
+ typedef Allocator allocator;
+
+ list_update() { }
+
+ // Constructor taking __iterators to a range of value_types. The
+ // value_types between first_it and last_it will be inserted into
+ // the container object.
+ template<typename It>
+ list_update(It first, It last)
+ { base_type::copy_from_range(first, last); }
+
+ list_update(const list_update& other)
+ : base_type((const base_type&)other) { }
+
+ virtual
+ ~list_update() { }
+
+ list_update&
+ operator=(const list_update& other)
+ {
+ if (this !=& other)
+ {
+ list_update tmp(other);
+ swap(tmp);
+ }
+ return *this;
+ }
+
+ void
+ swap(list_update& other)
+ { base_type::swap(other); }
+ };
+
+#undef PB_DS_BASE_C_DEC
+
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp
new file mode 100644
index 0000000..0ca90db
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp
@@ -0,0 +1,173 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file basic_tree_policy_base.hpp
+ * Contains a base class for tree_like policies.
+ */
+
+#ifndef PB_DS_TREE_LIKE_POLICY_BASE_HPP
+#define PB_DS_TREE_LIKE_POLICY_BASE_HPP
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_C_DEC \
+ basic_tree_policy_base< \
+ Const_Node_Iterator, \
+ Node_Iterator, \
+ Allocator>
+
+ template<typename Const_Node_Iterator,
+ typename Node_Iterator,
+ typename Allocator>
+ struct basic_tree_policy_base
+ {
+ protected:
+ typedef typename Node_Iterator::value_type it_type;
+
+ typedef typename std::iterator_traits< it_type>::value_type value_type;
+
+ typedef typename value_type::first_type key_type;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ key_type>::type>::other::const_reference
+ const_key_reference;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ value_type>::type>::other::const_reference
+ const_reference;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ value_type>::type>::other::reference
+ reference;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ value_type>::type>::other::const_pointer
+ const_pointer;
+
+ static inline const_key_reference
+ extract_key(const_reference r_val)
+ {
+ return (r_val.first);
+ }
+
+ virtual it_type
+ end() = 0;
+
+ it_type
+ end_iterator() const
+ {
+ return (const_cast<PB_DS_CLASS_C_DEC* >(this)->end());
+ }
+
+ virtual
+ ~basic_tree_policy_base()
+ { }
+ };
+
+ template<typename Const_Node_Iterator, typename Allocator>
+ struct basic_tree_policy_base<
+ Const_Node_Iterator,
+ Const_Node_Iterator,
+ Allocator>
+ {
+ protected:
+ typedef typename Const_Node_Iterator::value_type it_type;
+
+ typedef typename std::iterator_traits< it_type>::value_type value_type;
+
+ typedef value_type key_type;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ key_type>::type>::other::const_reference
+ const_key_reference;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ value_type>::type>::other::const_reference
+ const_reference;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ value_type>::type>::other::reference
+ reference;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ value_type>::type>::other::const_pointer
+ const_pointer;
+
+ static inline const_key_reference
+ extract_key(const_reference r_val)
+ {
+ return (r_val);
+ }
+
+ virtual it_type
+ end() const = 0;
+
+ it_type
+ end_iterator() const
+ {
+ return (end());
+ }
+
+ virtual
+ ~basic_tree_policy_base()
+ { }
+ };
+
+#undef PB_DS_CLASS_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_TREE_LIKE_POLICY_BASE_HPP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp
new file mode 100644
index 0000000..757b909
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp
@@ -0,0 +1,67 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file null_node_metadata.hpp
+ * Contains an implementation class for tree-like classes.
+ */
+
+#ifndef PB_DS_NULL_NODE_METADATA_HPP
+#define PB_DS_NULL_NODE_METADATA_HPP
+
+#include <ext/pb_ds/detail/types_traits.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Key, class Data, class Allocator>
+ struct dumconst_node_iterator
+ {
+ private:
+ typedef typename types_traits<Key, Data, Allocator, false>::pointer const_iterator;
+
+ public:
+ typedef const_iterator value_type;
+ typedef const_iterator const_reference;
+ typedef const_reference reference;
+ };
+
+ struct null_node_metadata
+ { };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/basic_tree_policy/traits.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/basic_tree_policy/traits.hpp
new file mode 100644
index 0000000..b30829a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/basic_tree_policy/traits.hpp
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file traits.hpp
+ * Contains an implementation class for tree-like classes.
+ */
+
+#ifndef PB_DS_NODE_AND_IT_TRAITS_HPP
+#define PB_DS_NODE_AND_IT_TRAITS_HPP
+
+#include <ext/pb_ds/detail/types_traits.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/traits.hpp>
+#include <ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp>
+#include <ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Key,
+ typename Data,
+ class Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn_,
+ class Allocator>
+ class Node_Update,
+ class Tag,
+ class Allocator>
+ struct tree_traits;
+
+ template<typename Key,
+ typename Data,
+ class E_Access_Traits,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class E_Access_Traits_,
+ class Allocator>
+ class Node_Update,
+ class Tag,
+ class Allocator>
+ struct trie_traits;
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#include <ext/pb_ds/detail/rb_tree_map_/traits.hpp>
+#include <ext/pb_ds/detail/splay_tree_/traits.hpp>
+#include <ext/pb_ds/detail/ov_tree_map_/traits.hpp>
+#include <ext/pb_ds/detail/pat_trie_/traits.hpp>
+
+#endif // #ifndef PB_DS_NODE_AND_IT_TRAITS_HPP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/basic_types.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/basic_types.hpp
new file mode 100644
index 0000000..aac1397
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/basic_types.hpp
@@ -0,0 +1,211 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file basic_types.hpp
+ * Contains basic types used by containers.
+ */
+
+#ifndef PB_DS_BASIC_TYPES_HPP
+#define PB_DS_BASIC_TYPES_HPP
+
+#include <algorithm>
+#include <utility>
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Key, typename Mapped, typename Allocator, bool Store_Hash>
+ struct value_type_base;
+
+ /**
+ * Specialization of value_type_base for the case where the hash value
+ * is not stored alongside each value.
+ **/
+ template<typename Key, typename Mapped, typename Allocator>
+ struct value_type_base<Key, Mapped, Allocator, false>
+ {
+ typedef typename Allocator::template rebind<Mapped>::other mapped_type_allocator;
+ typedef typename mapped_type_allocator::value_type mapped_type;
+ typedef typename mapped_type_allocator::pointer mapped_pointer;
+ typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
+ typedef typename mapped_type_allocator::reference mapped_reference;
+ typedef typename mapped_type_allocator::const_reference const_mapped_reference;
+
+ typedef typename Allocator::template rebind<std::pair<const Key, Mapped> >::other value_type_allocator;
+ typedef typename value_type_allocator::value_type value_type;
+ typedef typename value_type_allocator::pointer pointer;
+ typedef typename value_type_allocator::const_pointer const_pointer;
+ typedef typename value_type_allocator::reference reference;
+ typedef typename value_type_allocator::const_reference const_reference;
+
+ struct stored_value_type
+ {
+ value_type m_value;
+ };
+ };
+
+ /**
+ * Specialization of value_type_base for the case where the hash value
+ * is stored alongside each value.
+ **/
+ template<typename Key, typename Mapped, typename Allocator>
+ struct value_type_base<Key, Mapped, Allocator, true>
+ {
+ typedef typename Allocator::template rebind<Mapped>::other mapped_type_allocator;
+ typedef typename mapped_type_allocator::value_type mapped_type;
+ typedef typename mapped_type_allocator::pointer mapped_pointer;
+ typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
+ typedef typename mapped_type_allocator::reference mapped_reference;
+ typedef typename mapped_type_allocator::const_reference const_mapped_reference;
+
+ typedef typename Allocator::template rebind<std::pair<const Key, Mapped> >::other value_type_allocator;
+ typedef typename value_type_allocator::value_type value_type;
+ typedef typename value_type_allocator::pointer pointer;
+ typedef typename value_type_allocator::const_pointer const_pointer;
+ typedef typename value_type_allocator::reference reference;
+ typedef typename value_type_allocator::const_reference const_reference;
+
+ struct stored_value_type
+ {
+ value_type m_value;
+ typename Allocator::size_type m_hash;
+ };
+ };
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ value_type_base<Key, null_mapped_type, Allocator, false>
+
+ /**
+ * Specialization of value_type_base for the case where the hash value
+ * is not stored alongside each value.
+ **/
+ template<typename Key, typename Allocator>
+ struct value_type_base<Key, null_mapped_type, Allocator, false>
+ {
+ typedef typename Allocator::template rebind<null_mapped_type>::other mapped_type_allocator;
+ typedef typename mapped_type_allocator::value_type mapped_type;
+ typedef typename mapped_type_allocator::pointer mapped_pointer;
+ typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
+ typedef typename mapped_type_allocator::reference mapped_reference;
+ typedef typename mapped_type_allocator::const_reference const_mapped_reference;
+
+ typedef Key value_type;
+
+ typedef typename Allocator::template rebind<value_type>::other value_type_allocator;
+ typedef typename value_type_allocator::pointer pointer;
+ typedef typename value_type_allocator::const_pointer const_pointer;
+ typedef typename value_type_allocator::reference reference;
+ typedef typename value_type_allocator::const_reference const_reference;
+
+ struct stored_value_type
+ {
+ value_type m_value;
+ };
+
+ static null_mapped_type s_null_mapped;
+ };
+
+ PB_DS_CLASS_T_DEC
+ null_mapped_type PB_DS_CLASS_C_DEC::s_null_mapped;
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ value_type_base<Key, null_mapped_type, Allocator, true>
+
+ /**
+ * Specialization of value_type_base for the case where the hash value
+ * is stored alongside each value.
+ **/
+ template<typename Key, typename Allocator>
+ struct value_type_base<Key, null_mapped_type, Allocator, true>
+ {
+ typedef typename Allocator::template rebind<null_mapped_type>::other mapped_type_allocator;
+ typedef typename mapped_type_allocator::value_type mapped_type;
+ typedef typename mapped_type_allocator::pointer mapped_pointer;
+ typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
+ typedef typename mapped_type_allocator::reference mapped_reference;
+ typedef typename mapped_type_allocator::const_reference const_mapped_reference;
+
+ typedef Key value_type;
+
+ typedef typename Allocator::template rebind<value_type>::other value_type_allocator;
+ typedef typename value_type_allocator::pointer pointer;
+ typedef typename value_type_allocator::const_pointer const_pointer;
+ typedef typename value_type_allocator::reference reference;
+ typedef typename value_type_allocator::const_reference const_reference;
+
+ struct stored_value_type
+ {
+ value_type m_value;
+ typename Allocator::size_type m_hash;
+ };
+
+ static null_mapped_type s_null_mapped;
+ };
+
+ PB_DS_CLASS_T_DEC
+ null_mapped_type PB_DS_CLASS_C_DEC::s_null_mapped;
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+ template<typename Key, typename Mapped>
+ struct no_throw_copies
+ {
+ typedef integral_constant<int, is_simple<Key>::value && is_simple<Mapped>::value> indicator;
+ };
+
+ template<typename Key>
+ struct no_throw_copies<Key, null_mapped_type>
+ {
+ typedef integral_constant<int, is_simple<Key>::value> indicator;
+ };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp
new file mode 100644
index 0000000..7315d95
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp
@@ -0,0 +1,497 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file bin_search_tree_.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+/*
+ * This implementation uses an idea from the SGI STL (using a "header" node
+ * which is needed for efficient iteration).
+ */
+
+#include <ext/pb_ds/exception.hpp>
+#include <ext/pb_ds/detail/eq_fn/eq_by_less.hpp>
+#include <ext/pb_ds/detail/types_traits.hpp>
+#include <ext/pb_ds/detail/debug_map_base.hpp>
+#include <ext/pb_ds/tree_policy.hpp>
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/tree_trace_base.hpp>
+#include <utility>
+#include <functional>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Mapped, class Cmp_Fn, \
+ class Node_And_It_Traits, class Allocator>
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_CLASS_NAME \
+ bin_search_tree_data_
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_CLASS_NAME \
+ bin_search_tree_no_data_
+#endif
+
+#define PB_DS_CLASS_C_DEC \
+ PB_DS_CLASS_NAME< \
+ Key, \
+ Mapped, \
+ Cmp_Fn, \
+ Node_And_It_Traits, \
+ Allocator>
+
+#define PB_DS_TYPES_TRAITS_C_DEC \
+ types_traits< \
+ Key, \
+ Mapped, \
+ Allocator, \
+ false>
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_DEBUG_MAP_BASE_C_DEC \
+ debug_map_base<Key, eq_by_less<Key, Cmp_Fn>, \
+ typename Allocator::template rebind<Key>::other::const_reference>
+#endif
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_V2F(X) (X).first
+#define PB_DS_V2S(X) (X).second
+#define PB_DS_EP2VP(X)& ((X)->m_value)
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_V2F(X) (X)
+#define PB_DS_V2S(X) Mapped_Data()
+#define PB_DS_EP2VP(X)& ((X)->m_value.first)
+#endif
+
+#ifdef PB_DS_TREE_TRACE
+#define PB_DS_TREE_TRACE_BASE_C_DEC \
+ tree_trace_base< \
+ typename Node_And_It_Traits::const_node_iterator, \
+ typename Node_And_It_Traits::node_iterator, \
+ Cmp_Fn, \
+ true, \
+ Allocator>
+#endif
+
+ /**
+ * class description = "8i|\|4ree $34rc|-| 7r33 74813.">
+ **/
+ template<typename Key,
+ typename Mapped,
+ class Cmp_Fn,
+ class Node_And_It_Traits,
+ class Allocator>
+ class PB_DS_CLASS_NAME :
+#ifdef _GLIBCXX_DEBUG
+ public PB_DS_DEBUG_MAP_BASE_C_DEC,
+#endif
+#ifdef PB_DS_TREE_TRACE
+ public PB_DS_TREE_TRACE_BASE_C_DEC,
+#endif
+ public Cmp_Fn,
+ public PB_DS_TYPES_TRAITS_C_DEC,
+ public Node_And_It_Traits::node_update
+ {
+
+ protected:
+ typedef
+ typename Allocator::template rebind<
+ typename Node_And_It_Traits::node>::other
+ node_allocator;
+
+ typedef typename node_allocator::value_type node;
+
+ typedef typename node_allocator::pointer node_pointer;
+
+ typedef PB_DS_TYPES_TRAITS_C_DEC traits_base;
+
+ typedef
+ typename Node_And_It_Traits::null_node_update_pointer
+ null_node_update_pointer;
+
+ private:
+ typedef cond_dealtor< node, Allocator> cond_dealtor_t;
+
+#ifdef _GLIBCXX_DEBUG
+ typedef PB_DS_DEBUG_MAP_BASE_C_DEC debug_base;
+#endif
+
+ public:
+
+ typedef typename Allocator::size_type size_type;
+
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef typename PB_DS_TYPES_TRAITS_C_DEC::key_type key_type;
+
+ typedef typename PB_DS_TYPES_TRAITS_C_DEC::key_pointer key_pointer;
+
+ typedef
+ typename PB_DS_TYPES_TRAITS_C_DEC::const_key_pointer
+ const_key_pointer;
+
+ typedef typename PB_DS_TYPES_TRAITS_C_DEC::key_reference key_reference;
+
+ typedef
+ typename PB_DS_TYPES_TRAITS_C_DEC::const_key_reference
+ const_key_reference;
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ typedef typename PB_DS_TYPES_TRAITS_C_DEC::mapped_type mapped_type;
+
+ typedef
+ typename PB_DS_TYPES_TRAITS_C_DEC::mapped_pointer
+ mapped_pointer;
+
+ typedef
+ typename PB_DS_TYPES_TRAITS_C_DEC::const_mapped_pointer
+ const_mapped_pointer;
+
+ typedef
+ typename PB_DS_TYPES_TRAITS_C_DEC::mapped_reference
+ mapped_reference;
+
+ typedef
+ typename PB_DS_TYPES_TRAITS_C_DEC::const_mapped_reference
+ const_mapped_reference;
+#endif
+
+ typedef typename PB_DS_TYPES_TRAITS_C_DEC::value_type value_type;
+
+ typedef typename PB_DS_TYPES_TRAITS_C_DEC::pointer pointer;
+
+ typedef typename PB_DS_TYPES_TRAITS_C_DEC::const_pointer const_pointer;
+
+ typedef typename PB_DS_TYPES_TRAITS_C_DEC::reference reference;
+
+ typedef
+ typename PB_DS_TYPES_TRAITS_C_DEC::const_reference
+ const_reference;
+
+ typedef
+ typename Node_And_It_Traits::const_point_iterator
+ const_point_iterator;
+
+ typedef const_point_iterator const_iterator;
+
+ typedef typename Node_And_It_Traits::point_iterator point_iterator;
+
+ typedef point_iterator iterator;
+
+ typedef
+ typename Node_And_It_Traits::const_reverse_iterator
+ const_reverse_iterator;
+
+ typedef typename Node_And_It_Traits::reverse_iterator reverse_iterator;
+
+ typedef
+ typename Node_And_It_Traits::const_node_iterator
+ const_node_iterator;
+
+ typedef typename Node_And_It_Traits::node_iterator node_iterator;
+
+ typedef Cmp_Fn cmp_fn;
+
+ typedef Allocator allocator_type;
+
+ typedef typename Node_And_It_Traits::node_update node_update;
+
+ public:
+
+ PB_DS_CLASS_NAME();
+
+ PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn);
+
+ PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn, const node_update& r_update);
+
+ PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other);
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ ~PB_DS_CLASS_NAME();
+
+ inline bool
+ empty() const;
+
+ inline size_type
+ size() const;
+
+ inline size_type
+ max_size() const;
+
+ Cmp_Fn&
+ get_cmp_fn();
+
+ const Cmp_Fn&
+ get_cmp_fn() const;
+
+ inline point_iterator
+ lower_bound(const_key_reference r_key);
+
+ inline const_point_iterator
+ lower_bound(const_key_reference r_key) const;
+
+ inline point_iterator
+ upper_bound(const_key_reference r_key);
+
+ inline const_point_iterator
+ upper_bound(const_key_reference r_key) const;
+
+ inline point_iterator
+ find(const_key_reference r_key);
+
+ inline const_point_iterator
+ find(const_key_reference r_key) const;
+
+ inline iterator
+ begin();
+
+ inline const_iterator
+ begin() const;
+
+ inline iterator
+ end();
+
+ inline const_iterator
+ end() const;
+
+ inline reverse_iterator
+ rbegin();
+
+ inline const_reverse_iterator
+ rbegin() const;
+
+ inline reverse_iterator
+ rend();
+
+ inline const_reverse_iterator
+ rend() const;
+
+ inline const_node_iterator
+ node_begin() const;
+
+ inline node_iterator
+ node_begin();
+
+ inline const_node_iterator
+ node_end() const;
+
+ inline node_iterator
+ node_end();
+
+ void
+ clear();
+
+ protected:
+
+ void
+ value_swap(PB_DS_CLASS_C_DEC& other);
+
+ void
+ initialize_min_max();
+
+ inline iterator
+ insert_imp_empty(const_reference r_value);
+
+ inline iterator
+ insert_leaf_new(const_reference r_value, node_pointer p_nd, bool left_nd);
+
+ inline node_pointer
+ get_new_node_for_leaf_insert(const_reference r_val, false_type);
+
+ inline node_pointer
+ get_new_node_for_leaf_insert(const_reference r_val, true_type);
+
+ inline void
+ actual_erase_node(node_pointer p_nd);
+
+ inline std::pair<node_pointer, bool>
+ erase(node_pointer p_nd);
+
+ inline void
+ update_min_max_for_erased_node(node_pointer p_nd);
+
+ static void
+ clear_imp(node_pointer p_nd);
+
+ inline std::pair<
+ point_iterator,
+ bool>
+ insert_leaf(const_reference r_value);
+
+ inline void
+ rotate_left(node_pointer p_x);
+
+ inline void
+ rotate_right(node_pointer p_y);
+
+ inline void
+ rotate_parent(node_pointer p_nd);
+
+ inline void
+ apply_update(node_pointer p_nd, null_node_update_pointer);
+
+ template<typename Node_Update_>
+ inline void
+ apply_update(node_pointer p_nd, Node_Update_* p_update);
+
+ inline void
+ update_to_top(node_pointer p_nd, null_node_update_pointer);
+
+ template<typename Node_Update_>
+ inline void
+ update_to_top(node_pointer p_nd, Node_Update_* p_update);
+
+ bool
+ join_prep(PB_DS_CLASS_C_DEC& other);
+
+ void
+ join_finish(PB_DS_CLASS_C_DEC& other);
+
+ bool
+ split_prep(const_key_reference r_key, PB_DS_CLASS_C_DEC& other);
+
+ void
+ split_finish(PB_DS_CLASS_C_DEC& other);
+
+ size_type
+ recursive_count(node_pointer p_nd) const;
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+
+ void
+ structure_only_assert_valid() const;
+
+ void
+ assert_node_consistent(const node_pointer p_nd) const;
+#endif
+
+ private:
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_iterators() const;
+
+ void
+ assert_consistent_with_debug_base() const;
+
+ void
+ assert_node_consistent_with_left(const node_pointer p_nd) const;
+
+ void
+ assert_node_consistent_with_right(const node_pointer p_nd) const;
+
+ void
+ assert_consistent_with_debug_base(const node_pointer p_nd) const;
+
+ void
+ assert_min() const;
+
+ void
+ assert_min_imp(const node_pointer p_nd) const;
+
+ void
+ assert_max() const;
+
+ void
+ assert_max_imp(const node_pointer p_nd) const;
+
+ void
+ assert_size() const;
+
+ typedef std::pair< const_pointer, const_pointer> node_consistent_t;
+
+ node_consistent_t
+ assert_node_consistent_(const node_pointer p_nd) const;
+#endif
+
+ void
+ initialize();
+
+ node_pointer
+ recursive_copy_node(const node_pointer p_nd);
+
+ protected:
+ node_pointer m_p_head;
+
+ size_type m_size;
+
+ static node_allocator s_node_allocator;
+ };
+
+#include <ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+
+#undef PB_DS_CLASS_T_DEC
+
+#undef PB_DS_CLASS_NAME
+
+#undef PB_DS_TYPES_TRAITS_C_DEC
+
+#undef PB_DS_DEBUG_MAP_BASE_C_DEC
+
+#ifdef PB_DS_TREE_TRACE
+#undef PB_DS_TREE_TRACE_BASE_C_DEC
+#endif
+
+#undef PB_DS_V2F
+#undef PB_DS_EP2VP
+#undef PB_DS_V2S
+
+ } // namespace detail
+} // namespace __gnu_pbds
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/cond_dtor_entry_dealtor.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/cond_dtor_entry_dealtor.hpp
new file mode 100644
index 0000000..370574c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/cond_dtor_entry_dealtor.hpp
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file cond_dtor_entry_dealtor.hpp
+ * Contains a binary tree container conditional deallocator
+ */
+
+class bin_search_tree_cond_dtor_entry_dealtor_
+{
+public:
+ inline
+ bin_search_tree_cond_dtor_entry_dealtor_(node_pointer p_nd) : m_p_nd(p_nd),
+ m_no_action_dtor(false)
+ { }
+
+ inline void
+ set_no_action_dtor()
+ {
+ m_no_action_dtor = true;
+ }
+
+ inline
+ ~bin_search_tree_cond_dtor_entry_dealtor_()
+ {
+ if (m_no_action_dtor)
+ return;
+
+ typename Allocator::template rebind<Node>::other().
+ deallocate(m_p_nd, 1);
+ }
+
+protected:
+ node_pointer m_p_nd;
+
+ bool m_no_action_dtor;
+};
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/cond_key_dtor_entry_dealtor.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/cond_key_dtor_entry_dealtor.hpp
new file mode 100644
index 0000000..612eceb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/cond_key_dtor_entry_dealtor.hpp
@@ -0,0 +1,81 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file cond_key_dtor_entry_dealtor.hpp
+ * Contains a binary tree container conditional deallocator
+ */
+
+class bin_seach_tree_cond_key_dtor_entry_dealtor_
+{
+public:
+ inline
+ bin_seach_tree_cond_key_dtor_entry_dealtor_(node_pointer p_nd) : m_p_nd(p_nd),
+ m_no_action_dtor(false),
+ m_key_destruct(false)
+ { }
+
+ inline void
+ set_no_action_dtor()
+ {
+ m_no_action_dtor = true;
+ }
+
+ inline void
+ set_key_destruct()
+ {
+ m_key_destruct = true;
+ }
+
+ inline
+ ~bin_seach_tree_cond_key_dtor_entry_dealtor_()
+ {
+ if (m_no_action_dtor)
+ return;
+
+ if (m_key_destruct)
+ m_p_nd->m_value.first.~Key();
+
+ bin_tree_base::s_alloc.deallocate(m_p_nd, 1);
+ }
+
+protected:
+ node_pointer m_p_nd;
+
+ bool m_no_action_dtor;
+
+ bool m_key_destruct;
+};
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..925d204
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,218 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_allocator
+PB_DS_CLASS_C_DEC::s_node_allocator;
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME() : m_p_head(s_node_allocator.allocate(1)), m_size(0)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn) :
+ Cmp_Fn(r_cmp_fn), m_p_head(s_node_allocator.allocate(1)), m_size(0)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn, const node_update& r_node_update) :
+ Cmp_Fn(r_cmp_fn),
+ node_update(r_node_update),
+ m_p_head(s_node_allocator.allocate(1)),
+ m_size(0)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) :
+#ifdef _GLIBCXX_DEBUG
+ debug_base(other),
+#endif
+#ifdef PB_DS_TREE_TRACE
+ PB_DS_TREE_TRACE_BASE_C_DEC(other),
+#endif
+ Cmp_Fn(other),
+ node_update(other),
+ m_p_head(s_node_allocator.allocate(1)),
+ m_size(0)
+{
+ initialize();
+ m_size = other.m_size;
+ _GLIBCXX_DEBUG_ONLY(other.structure_only_assert_valid();)
+
+ __try
+ {
+ m_p_head->m_p_parent = recursive_copy_node(other.m_p_head->m_p_parent);
+ if (m_p_head->m_p_parent != NULL)
+ m_p_head->m_p_parent->m_p_parent = m_p_head;
+ m_size = other.m_size;
+ initialize_min_max();
+ }
+ __catch(...)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::clear();)
+ s_node_allocator.deallocate(m_p_head, 1);
+ __throw_exception_again;
+ }
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.structure_only_assert_valid();)
+ value_swap(other);
+ std::swap((Cmp_Fn& )(*this), (Cmp_Fn& )other);
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.structure_only_assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+value_swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(debug_base::swap(other);)
+ std::swap(m_p_head, other.m_p_head);
+ std::swap(m_size, other.m_size);
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~PB_DS_CLASS_NAME()
+{
+ clear();
+ s_node_allocator.deallocate(m_p_head, 1);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+initialize()
+{
+ m_p_head->m_p_parent = NULL;
+ m_p_head->m_p_left = m_p_head;
+ m_p_head->m_p_right = m_p_head;
+ m_size = 0;
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+recursive_copy_node(const node_pointer p_nd)
+{
+ if (p_nd == NULL)
+ return (NULL);
+
+ node_pointer p_ret = s_node_allocator.allocate(1);
+ __try
+ {
+ new (p_ret) node(*p_nd);
+ }
+ __catch(...)
+ {
+ s_node_allocator.deallocate(p_ret, 1);
+ __throw_exception_again;
+ }
+
+ p_ret->m_p_left = p_ret->m_p_right = NULL;
+
+ __try
+ {
+ p_ret->m_p_left = recursive_copy_node(p_nd->m_p_left);
+ p_ret->m_p_right = recursive_copy_node(p_nd->m_p_right);
+ }
+ __catch(...)
+ {
+ clear_imp(p_ret);
+ __throw_exception_again;
+ }
+
+ if (p_ret->m_p_left != NULL)
+ p_ret->m_p_left->m_p_parent = p_ret;
+
+ if (p_ret->m_p_right != NULL)
+ p_ret->m_p_right->m_p_parent = p_ret;
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_ret);)
+ return p_ret;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+initialize_min_max()
+{
+ if (m_p_head->m_p_parent == NULL)
+ {
+ m_p_head->m_p_left = m_p_head->m_p_right = m_p_head;
+ return;
+ }
+
+ {
+ node_pointer p_min = m_p_head->m_p_parent;
+ while (p_min->m_p_left != NULL)
+ p_min = p_min->m_p_left;
+ m_p_head->m_p_left = p_min;
+ }
+
+ {
+ node_pointer p_max = m_p_head->m_p_parent;
+ while (p_max->m_p_right != NULL)
+ p_max = p_max->m_p_right;
+ m_p_head->m_p_right = p_max;
+ }
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp
new file mode 100644
index 0000000..e3447bd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp
@@ -0,0 +1,272 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ structure_only_assert_valid();
+ assert_consistent_with_debug_base();
+ assert_size();
+ assert_iterators();
+ if (m_p_head->m_p_parent == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_size == 0);
+ }
+ else
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ }
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+structure_only_assert_valid() const
+{
+ _GLIBCXX_DEBUG_ASSERT(m_p_head != NULL);
+ if (m_p_head->m_p_parent == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_left == m_p_head);
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_right == m_p_head);
+ }
+ else
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_parent->m_p_parent == m_p_head);
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_left != m_p_head);
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_right != m_p_head);
+ }
+
+ if (m_p_head->m_p_parent != NULL)
+ assert_node_consistent(m_p_head->m_p_parent);
+ assert_min();
+ assert_max();
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_node_consistent(const node_pointer p_nd) const
+{
+ assert_node_consistent_(p_nd);
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_consistent_t
+PB_DS_CLASS_C_DEC::
+assert_node_consistent_(const node_pointer p_nd) const
+{
+ if (p_nd == NULL)
+ return (std::make_pair((const_pointer)NULL,(const_pointer)NULL));
+
+ assert_node_consistent_with_left(p_nd);
+ assert_node_consistent_with_right(p_nd);
+
+ const std::pair<const_pointer, const_pointer>
+ l_range = assert_node_consistent_(p_nd->m_p_left);
+
+ if (l_range.second != NULL)
+ _GLIBCXX_DEBUG_ASSERT(Cmp_Fn::operator()(PB_DS_V2F(*l_range.second),
+ PB_DS_V2F(p_nd->m_value)));
+
+ const std::pair<const_pointer, const_pointer>
+ r_range = assert_node_consistent_(p_nd->m_p_right);
+
+ if (r_range.first != NULL)
+ _GLIBCXX_DEBUG_ASSERT(Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value),
+ PB_DS_V2F(*r_range.first)));
+
+ return (std::make_pair((l_range.first != NULL)? l_range.first :& p_nd->m_value,(r_range.second != NULL)? r_range.second :& p_nd->m_value));
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_node_consistent_with_left(const node_pointer p_nd) const
+{
+ if (p_nd->m_p_left == NULL)
+ return;
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_left->m_p_parent == p_nd);
+ _GLIBCXX_DEBUG_ASSERT(!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value),
+ PB_DS_V2F(p_nd->m_p_left->m_value)));
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_node_consistent_with_right(const node_pointer p_nd) const
+{
+ if (p_nd->m_p_right == NULL)
+ return;
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_right->m_p_parent == p_nd);
+ _GLIBCXX_DEBUG_ASSERT(!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_p_right->m_value),
+ PB_DS_V2F(p_nd->m_value)));
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_min() const
+{
+ assert_min_imp(m_p_head->m_p_parent);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_min_imp(const node_pointer p_nd) const
+{
+ if (p_nd == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_left == m_p_head);
+ return;
+ }
+
+ if (p_nd->m_p_left == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_nd == m_p_head->m_p_left);
+ return;
+ }
+ assert_min_imp(p_nd->m_p_left);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_max() const
+{
+ assert_max_imp(m_p_head->m_p_parent);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_max_imp(const node_pointer p_nd) const
+{
+ if (p_nd == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_right == m_p_head);
+ return;
+ }
+
+ if (p_nd->m_p_right == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_nd == m_p_head->m_p_right);
+ return;
+ }
+
+ assert_max_imp(p_nd->m_p_right);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_iterators() const
+{
+ size_type iterated_num = 0;
+ const_iterator prev_it = end();
+ for (const_iterator it = begin(); it != end(); ++it)
+ {
+ ++iterated_num;
+ _GLIBCXX_DEBUG_ASSERT(lower_bound(PB_DS_V2F(*it)).m_p_nd == it.m_p_nd);
+ const_iterator upper_bound_it = upper_bound(PB_DS_V2F(*it));
+ --upper_bound_it;
+ _GLIBCXX_DEBUG_ASSERT(upper_bound_it.m_p_nd == it.m_p_nd);
+
+ if (prev_it != end())
+ _GLIBCXX_DEBUG_ASSERT(Cmp_Fn::operator()(PB_DS_V2F(*prev_it),
+ PB_DS_V2F(*it)));
+ prev_it = it;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(iterated_num == m_size);
+ size_type reverse_iterated_num = 0;
+ const_reverse_iterator reverse_prev_it = rend();
+ for (const_reverse_iterator reverse_it = rbegin(); reverse_it != rend();
+ ++reverse_it)
+ {
+ ++reverse_iterated_num;
+ _GLIBCXX_DEBUG_ASSERT(lower_bound(
+ PB_DS_V2F(*reverse_it)).m_p_nd == reverse_it.m_p_nd);
+
+ const_iterator upper_bound_it = upper_bound(PB_DS_V2F(*reverse_it));
+ --upper_bound_it;
+ _GLIBCXX_DEBUG_ASSERT(upper_bound_it.m_p_nd == reverse_it.m_p_nd);
+ if (reverse_prev_it != rend())
+ _GLIBCXX_DEBUG_ASSERT(!Cmp_Fn::operator()(PB_DS_V2F(*reverse_prev_it),
+ PB_DS_V2F(*reverse_it)));
+ reverse_prev_it = reverse_it;
+ }
+ _GLIBCXX_DEBUG_ASSERT(reverse_iterated_num == m_size);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_consistent_with_debug_base() const
+{
+ debug_base::check_size(m_size);
+ assert_consistent_with_debug_base(m_p_head->m_p_parent);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_consistent_with_debug_base(const node_pointer p_nd) const
+{
+ if (p_nd == NULL)
+ return;
+ debug_base::check_key_exists(PB_DS_V2F(p_nd->m_value));
+ assert_consistent_with_debug_base(p_nd->m_p_left);
+ assert_consistent_with_debug_base(p_nd->m_p_right);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_size() const
+{
+ _GLIBCXX_DEBUG_ASSERT(recursive_count(m_p_head->m_p_parent) == m_size);
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp
new file mode 100644
index 0000000..a000c74
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp
@@ -0,0 +1,120 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+actual_erase_node(node_pointer p_z)
+{
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ --m_size;
+
+ _GLIBCXX_DEBUG_ONLY(erase_existing(PB_DS_V2F(p_z->m_value)));
+
+ p_z->~node();
+
+ s_node_allocator.deallocate(p_z, 1);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+update_min_max_for_erased_node(node_pointer p_z)
+{
+ if (m_size == 1)
+ {
+ m_p_head->m_p_left = m_p_head->m_p_right = m_p_head;
+
+ return;
+ }
+
+ if (m_p_head->m_p_left == p_z)
+ {
+ iterator it(p_z);
+
+ ++it;
+
+ m_p_head->m_p_left = it.m_p_nd;
+ }
+ else if (m_p_head->m_p_right == p_z)
+ {
+ iterator it(p_z);
+
+ --it;
+
+ m_p_head->m_p_right = it.m_p_nd;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+
+ clear_imp(m_p_head->m_p_parent);
+
+ m_size = 0;
+
+ initialize();
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::clear();)
+
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear_imp(node_pointer p_nd)
+{
+ if (p_nd == NULL)
+ return;
+
+ clear_imp(p_nd->m_p_left);
+
+ clear_imp(p_nd->m_p_right);
+
+ p_nd->~node();
+
+ s_node_allocator.deallocate(p_nd, 1);
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp
new file mode 100644
index 0000000..413304b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp
@@ -0,0 +1,182 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+lower_bound(const_key_reference r_key) const
+{
+ node_pointer p_pot = m_p_head;
+ node_pointer p_nd = m_p_head->m_p_parent;
+
+ while (p_nd != NULL)
+ if (Cmp_Fn::operator()(
+ PB_DS_V2F(p_nd->m_value),
+ r_key))
+ p_nd = p_nd->m_p_right;
+ else
+ {
+ p_pot = p_nd;
+
+ p_nd = p_nd->m_p_left;
+ }
+
+ return (iterator(p_pot));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+lower_bound(const_key_reference r_key)
+{
+ node_pointer p_pot = m_p_head;
+ node_pointer p_nd = m_p_head->m_p_parent;
+
+ while (p_nd != NULL)
+ if (Cmp_Fn::operator()(
+ PB_DS_V2F(p_nd->m_value),
+ r_key))
+ p_nd = p_nd->m_p_right;
+ else
+ {
+ p_pot = p_nd;
+
+ p_nd = p_nd->m_p_left;
+ }
+
+ return (iterator(p_pot));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+upper_bound(const_key_reference r_key) const
+{
+ node_pointer p_pot = m_p_head;
+ node_pointer p_nd = m_p_head->m_p_parent;
+
+ while (p_nd != NULL)
+ if (Cmp_Fn::operator()(r_key,
+ PB_DS_V2F(p_nd->m_value)))
+ {
+ p_pot = p_nd,
+
+ p_nd = p_nd->m_p_left;
+ }
+ else
+ p_nd = p_nd->m_p_right;
+
+ return (const_iterator(p_pot));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+upper_bound(const_key_reference r_key)
+{
+ node_pointer p_pot = m_p_head;
+ node_pointer p_nd = m_p_head->m_p_parent;
+
+ while (p_nd != NULL)
+ if (Cmp_Fn::operator()(r_key,
+ PB_DS_V2F(p_nd->m_value)))
+ {
+ p_pot = p_nd,
+
+ p_nd = p_nd->m_p_left;
+ }
+ else
+ p_nd = p_nd->m_p_right;
+
+ return (point_iterator(p_pot));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+find(const_key_reference r_key)
+{
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+
+ node_pointer p_pot = m_p_head;
+ node_pointer p_nd = m_p_head->m_p_parent;
+
+ while (p_nd != NULL)
+ if (!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), r_key))
+ {
+ p_pot = p_nd;
+
+ p_nd = p_nd->m_p_left;
+ }
+ else
+ p_nd = p_nd->m_p_right;
+
+ return point_iterator((p_pot != m_p_head&& Cmp_Fn::operator()(
+ r_key,
+ PB_DS_V2F(p_pot->m_value)))?
+ m_p_head : p_pot);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+find(const_key_reference r_key) const
+{
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+
+ node_pointer p_pot = m_p_head;
+ node_pointer p_nd = m_p_head->m_p_parent;
+
+ while (p_nd != NULL)
+ if (!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), r_key))
+ {
+ p_pot = p_nd;
+
+ p_nd = p_nd->m_p_left;
+ }
+ else
+ p_nd = p_nd->m_p_right;
+
+ return const_point_iterator((p_pot != m_p_head&& Cmp_Fn::operator()(
+ r_key,
+ PB_DS_V2F(p_pot->m_value)))?
+ m_p_head : p_pot);
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp
new file mode 100644
index 0000000..b3e4611
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp
@@ -0,0 +1,64 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file info_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+empty() const
+{
+ return (m_size == 0);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size() const
+{
+ return (m_size);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+max_size() const
+{
+ return (s_node_allocator.max_size());
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp
new file mode 100644
index 0000000..3abf0a0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp
@@ -0,0 +1,211 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline std::pair<typename PB_DS_CLASS_C_DEC::point_iterator, bool>
+PB_DS_CLASS_C_DEC::
+insert_leaf(const_reference r_value)
+{
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+
+ if (m_size == 0)
+ return (std::make_pair(
+ insert_imp_empty(r_value),
+ true));
+
+ node_pointer p_nd = m_p_head->m_p_parent;
+ node_pointer p_pot = m_p_head;
+
+ while (p_nd != NULL)
+ if (!Cmp_Fn::operator()(
+ PB_DS_V2F(p_nd->m_value),
+ PB_DS_V2F(r_value)))
+ {
+ p_pot = p_nd;
+
+ p_nd = p_nd->m_p_left;
+ }
+ else
+ p_nd = p_nd->m_p_right;
+
+ if (p_pot == m_p_head)
+ return (std::make_pair(
+ insert_leaf_new(r_value, m_p_head->m_p_right, false),
+ true));
+
+ if (!Cmp_Fn::operator()(
+ PB_DS_V2F(r_value),
+ PB_DS_V2F(p_pot->m_value)))
+ {
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(
+ PB_DS_V2F(r_value)));
+
+ return (std::make_pair(p_pot, false));
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(
+ PB_DS_V2F(r_value)));
+
+ p_nd = p_pot->m_p_left;
+ if (p_nd == NULL)
+ return (std::make_pair(
+ insert_leaf_new(r_value, p_pot, true),
+ true));
+
+ while (p_nd->m_p_right != NULL)
+ p_nd = p_nd->m_p_right;
+
+ return (std::make_pair(
+ insert_leaf_new(r_value, p_nd, false),
+ true));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+insert_leaf_new(const_reference r_value, node_pointer p_nd, bool left_nd)
+{
+ node_pointer p_new_nd =
+ get_new_node_for_leaf_insert( r_value, traits_base::m_no_throw_copies_indicator);
+
+ if (left_nd)
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_left == NULL);
+ _GLIBCXX_DEBUG_ASSERT(Cmp_Fn::operator()(
+ PB_DS_V2F(r_value),
+ PB_DS_V2F(p_nd->m_value)));
+
+ p_nd->m_p_left = p_new_nd;
+
+ if (m_p_head->m_p_left == p_nd)
+ m_p_head->m_p_left = p_new_nd;
+ }
+ else
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_right == NULL);
+ _GLIBCXX_DEBUG_ASSERT(Cmp_Fn::operator()(
+ PB_DS_V2F(p_nd->m_value),
+ PB_DS_V2F(r_value)));
+
+ p_nd->m_p_right = p_new_nd;
+
+ if (m_p_head->m_p_right == p_nd)
+ m_p_head->m_p_right = p_new_nd;
+ }
+
+ p_new_nd->m_p_parent = p_nd;
+
+ p_new_nd->m_p_left = p_new_nd->m_p_right = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_nd));
+
+ update_to_top(p_new_nd, (node_update* )this);
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(
+ PB_DS_V2F(r_value)));
+
+ return (iterator(p_new_nd));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+insert_imp_empty(const_reference r_value)
+{
+ node_pointer p_new_node =
+ get_new_node_for_leaf_insert( r_value, traits_base::m_no_throw_copies_indicator);
+
+ m_p_head->m_p_left = m_p_head->m_p_right =
+ m_p_head->m_p_parent = p_new_node;
+
+ p_new_node->m_p_parent = m_p_head;
+
+ p_new_node->m_p_left = p_new_node->m_p_right = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(
+ PB_DS_V2F(r_value)));
+
+ update_to_top(m_p_head->m_p_parent, (node_update* )this);
+
+ return (iterator(p_new_node));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+get_new_node_for_leaf_insert(const_reference r_val, false_type)
+{
+ node_pointer p_new_nd = s_node_allocator.allocate(1);
+
+ cond_dealtor_t cond(p_new_nd);
+
+ new (const_cast<void* >(
+ static_cast<const void* >(&p_new_nd->m_value)))
+ typename node::value_type(r_val);
+
+ cond.set_no_action();
+
+ p_new_nd->m_p_left = p_new_nd->m_p_right = NULL;
+
+ ++m_size;
+
+ return (p_new_nd);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+get_new_node_for_leaf_insert(const_reference r_val, true_type)
+{
+ node_pointer p_new_nd = s_node_allocator.allocate(1);
+
+ new (const_cast<void* >(
+ static_cast<const void* >(&p_new_nd->m_value)))
+ typename node::value_type(r_val);
+
+ p_new_nd->m_p_left = p_new_nd->m_p_right = NULL;
+
+ ++m_size;
+
+ return (p_new_nd);
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp
new file mode 100644
index 0000000..ed7f1b1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp
@@ -0,0 +1,136 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file iterators_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+begin()
+{
+ return (iterator(m_p_head->m_p_left));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+begin() const
+{
+ return (const_iterator(m_p_head->m_p_left));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+end()
+{
+ return (iterator(m_p_head));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+end() const
+{
+ return (const_iterator(m_p_head));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reverse_iterator
+PB_DS_CLASS_C_DEC::
+rbegin() const
+{
+ return (const_reverse_iterator(m_p_head->m_p_right));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::reverse_iterator
+PB_DS_CLASS_C_DEC::
+rbegin()
+{
+ return (reverse_iterator(m_p_head->m_p_right));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::reverse_iterator
+PB_DS_CLASS_C_DEC::
+rend()
+{
+ return (reverse_iterator(m_p_head));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reverse_iterator
+PB_DS_CLASS_C_DEC::
+rend() const
+{
+ return (const_reverse_iterator(m_p_head));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_node_iterator
+PB_DS_CLASS_C_DEC::
+node_begin() const
+{
+ return (const_node_iterator(m_p_head->m_p_parent));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_iterator
+PB_DS_CLASS_C_DEC::
+node_begin()
+{
+ return (node_iterator(m_p_head->m_p_parent));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_node_iterator
+PB_DS_CLASS_C_DEC::
+node_end() const
+{
+ return (const_node_iterator(NULL));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_iterator
+PB_DS_CLASS_C_DEC::
+node_end()
+{
+ return (node_iterator(NULL));
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp
new file mode 100644
index 0000000..365f02b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp
@@ -0,0 +1,237 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file node_iterators.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+#ifndef PB_DS_BIN_SEARCH_TREE_NODE_ITERATORS_HPP
+#define PB_DS_BIN_SEARCH_TREE_NODE_ITERATORS_HPP
+
+#include <ext/pb_ds/tag_and_trait.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC \
+ bin_search_tree_const_node_it_< \
+ Node, \
+ Const_Iterator, \
+ Iterator, \
+ Allocator>
+
+ // Const node iterator.
+ template<typename Node,
+ class Const_Iterator,
+ class Iterator,
+ class Allocator>
+ class bin_search_tree_const_node_it_
+ {
+ private:
+
+ private:
+ typedef
+ typename Allocator::template rebind<
+ Node>::other::pointer
+ node_pointer;
+
+ public:
+
+ // Category.
+ typedef trivial_iterator_tag iterator_category;
+
+ // Difference type.
+ typedef trivial_iterator_difference_type difference_type;
+
+ // __Iterator's value type.
+ typedef Const_Iterator value_type;
+
+ // __Iterator's reference type.
+ typedef Const_Iterator reference;
+
+ // __Iterator's __const reference type.
+ typedef Const_Iterator const_reference;
+
+ // Metadata type.
+ typedef typename Node::metadata_type metadata_type;
+
+ // Const metadata reference type.
+ typedef
+ typename Allocator::template rebind<
+ metadata_type>::other::const_reference
+ const_metadata_reference;
+
+ public:
+
+ // Default constructor.
+ /*
+ inline
+ bin_search_tree_const_node_it_()
+ */
+
+ inline
+ bin_search_tree_const_node_it_(const node_pointer p_nd = NULL) : m_p_nd(const_cast<node_pointer>(p_nd))
+ { }
+
+ // Access.
+ inline const_reference
+ operator*() const
+ {
+ return (Const_Iterator(m_p_nd));
+ }
+
+ // Metadata access.
+ inline const_metadata_reference
+ get_metadata() const
+ {
+ return (m_p_nd->get_metadata());
+ }
+
+ // Returns the __const node iterator associated with the left node.
+ inline PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC
+ get_l_child() const
+ {
+ return (PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC(m_p_nd->m_p_left));
+ }
+
+ // Returns the __const node iterator associated with the right node.
+ inline PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC
+ get_r_child() const
+ {
+ return (PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC(m_p_nd->m_p_right));
+ }
+
+ // Compares to a different iterator object.
+ inline bool
+ operator==(const PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC& other) const
+ {
+ return (m_p_nd == other.m_p_nd);
+ }
+
+ // Compares (negatively) to a different iterator object.
+ inline bool
+ operator!=(const PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC& other) const
+ {
+ return (m_p_nd != other.m_p_nd);
+ }
+
+ public:
+ node_pointer m_p_nd;
+ };
+
+#define PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC \
+ bin_search_tree_node_it_< \
+ Node, \
+ Const_Iterator, \
+ Iterator, \
+ Allocator>
+
+ // Node iterator.
+ template<typename Node,
+ class Const_Iterator,
+ class Iterator,
+ class Allocator>
+ class bin_search_tree_node_it_ :
+ public PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC
+
+ {
+
+ private:
+ typedef
+ typename Allocator::template rebind<
+ Node>::other::pointer
+ node_pointer;
+
+ public:
+
+ // __Iterator's value type.
+ typedef Iterator value_type;
+
+ // __Iterator's reference type.
+ typedef Iterator reference;
+
+ // __Iterator's __const reference type.
+ typedef Iterator const_reference;
+
+ public:
+
+ // Default constructor.
+ /*
+ inline
+ bin_search_tree_node_it_();
+ */
+
+ inline
+ bin_search_tree_node_it_(const node_pointer p_nd = NULL) : PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC(
+ const_cast<node_pointer>(p_nd))
+ { }
+
+ // Access.
+ inline Iterator
+ operator*() const
+ {
+ return (Iterator(PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC::m_p_nd));
+ }
+
+ // Returns the node iterator associated with the left node.
+ inline PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC
+ get_l_child() const
+ {
+ return (PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC(
+ PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC::m_p_nd->m_p_left));
+ }
+
+ // Returns the node iterator associated with the right node.
+ inline PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC
+ get_r_child() const
+ {
+ return (PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC(
+ PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC::m_p_nd->m_p_right));
+ }
+
+ };
+
+#undef PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC
+
+#undef PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_BIN_SEARCH_TREE_NODE_ITERATORS_HPP
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp
new file mode 100644
index 0000000..bb249e0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp
@@ -0,0 +1,381 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file point_iterators.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+#ifndef PB_DS_BIN_SEARCH_TREE_FIND_ITERATORS_HPP
+#define PB_DS_BIN_SEARCH_TREE_FIND_ITERATORS_HPP
+
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_TREE_CONST_IT_C_DEC \
+ bin_search_tree_const_it_< \
+ Node_Pointer, \
+ Value_Type, \
+ Pointer, \
+ Const_Pointer, \
+ Reference, \
+ Const_Reference, \
+ Is_Forward_Iterator, \
+ Allocator>
+
+#define PB_DS_TREE_CONST_ODIR_IT_C_DEC \
+ bin_search_tree_const_it_< \
+ Node_Pointer, \
+ Value_Type, \
+ Pointer, \
+ Const_Pointer, \
+ Reference, \
+ Const_Reference, \
+ !Is_Forward_Iterator, \
+ Allocator>
+
+#define PB_DS_TREE_IT_C_DEC \
+ bin_search_tree_it_< \
+ Node_Pointer, \
+ Value_Type, \
+ Pointer, \
+ Const_Pointer, \
+ Reference, \
+ Const_Reference, \
+ Is_Forward_Iterator, \
+ Allocator>
+
+#define PB_DS_TREE_ODIR_IT_C_DEC \
+ bin_search_tree_it_< \
+ Node_Pointer, \
+ Value_Type, \
+ Pointer, \
+ Const_Pointer, \
+ Reference, \
+ Const_Reference, \
+ !Is_Forward_Iterator, \
+ Allocator>
+
+ // Const iterator.
+ template<typename Node_Pointer,
+ typename Value_Type,
+ typename Pointer,
+ typename Const_Pointer,
+ typename Reference,
+ typename Const_Reference,
+ bool Is_Forward_Iterator,
+ class Allocator>
+ class bin_search_tree_const_it_
+ {
+
+ public:
+
+ typedef std::bidirectional_iterator_tag iterator_category;
+
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef Value_Type value_type;
+
+ typedef Pointer pointer;
+
+ typedef Const_Pointer const_pointer;
+
+ typedef Reference reference;
+
+ typedef Const_Reference const_reference;
+
+ public:
+
+ inline
+ bin_search_tree_const_it_(const Node_Pointer p_nd = NULL)
+ : m_p_nd(const_cast<Node_Pointer>(p_nd))
+ { }
+
+ inline
+ bin_search_tree_const_it_(const PB_DS_TREE_CONST_ODIR_IT_C_DEC& other)
+ : m_p_nd(other.m_p_nd)
+ { }
+
+ inline
+ PB_DS_TREE_CONST_IT_C_DEC&
+ operator=(const PB_DS_TREE_CONST_IT_C_DEC& other)
+ {
+ m_p_nd = other.m_p_nd;
+ return *this;
+ }
+
+ inline
+ PB_DS_TREE_CONST_IT_C_DEC&
+ operator=(const PB_DS_TREE_CONST_ODIR_IT_C_DEC& other)
+ {
+ m_p_nd = other.m_p_nd;
+ return *this;
+ }
+
+ inline const_pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd != NULL);
+ return &m_p_nd->m_value;
+ }
+
+ inline const_reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd != NULL);
+ return m_p_nd->m_value;
+ }
+
+ inline bool
+ operator==(const PB_DS_TREE_CONST_IT_C_DEC & other) const
+ { return m_p_nd == other.m_p_nd; }
+
+ inline bool
+ operator==(const PB_DS_TREE_CONST_ODIR_IT_C_DEC & other) const
+ { return m_p_nd == other.m_p_nd; }
+
+ inline bool
+ operator!=(const PB_DS_TREE_CONST_IT_C_DEC& other) const
+ { return m_p_nd != other.m_p_nd; }
+
+ inline bool
+ operator!=(const PB_DS_TREE_CONST_ODIR_IT_C_DEC& other) const
+ { return m_p_nd != other.m_p_nd; }
+
+ inline PB_DS_TREE_CONST_IT_C_DEC&
+ operator++()
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd != NULL);
+ inc(integral_constant<int,Is_Forward_Iterator>());
+ return *this;
+ }
+
+ inline PB_DS_TREE_CONST_IT_C_DEC
+ operator++(int)
+ {
+ PB_DS_TREE_CONST_IT_C_DEC ret_it(m_p_nd);
+ operator++();
+ return ret_it;
+ }
+
+ inline PB_DS_TREE_CONST_IT_C_DEC&
+ operator--()
+ {
+ dec(integral_constant<int,Is_Forward_Iterator>());
+ return *this;
+ }
+
+ inline PB_DS_TREE_CONST_IT_C_DEC
+ operator--(int)
+ {
+ PB_DS_TREE_CONST_IT_C_DEC ret_it(m_p_nd);
+ operator--();
+ return ret_it;
+ }
+
+ protected:
+ inline void
+ inc(false_type)
+ { dec(true_type()); }
+
+ void
+ inc(true_type)
+ {
+ if (m_p_nd->special()&&
+ m_p_nd->m_p_parent->m_p_parent == m_p_nd)
+ {
+ m_p_nd = m_p_nd->m_p_left;
+ return;
+ }
+
+ if (m_p_nd->m_p_right != NULL)
+ {
+ m_p_nd = m_p_nd->m_p_right;
+ while (m_p_nd->m_p_left != NULL)
+ m_p_nd = m_p_nd->m_p_left;
+ return;
+ }
+
+ Node_Pointer p_y = m_p_nd->m_p_parent;
+ while (m_p_nd == p_y->m_p_right)
+ {
+ m_p_nd = p_y;
+ p_y = p_y->m_p_parent;
+ }
+
+ if (m_p_nd->m_p_right != p_y)
+ m_p_nd = p_y;
+ }
+
+ inline void
+ dec(false_type)
+ { inc(true_type()); }
+
+ void
+ dec(true_type)
+ {
+ if (m_p_nd->special() && m_p_nd->m_p_parent->m_p_parent == m_p_nd)
+ {
+ m_p_nd = m_p_nd->m_p_right;
+ return;
+ }
+
+ if (m_p_nd->m_p_left != NULL)
+ {
+ Node_Pointer p_y = m_p_nd->m_p_left;
+ while (p_y->m_p_right != NULL)
+ p_y = p_y->m_p_right;
+ m_p_nd = p_y;
+ return;
+ }
+
+ Node_Pointer p_y = m_p_nd->m_p_parent;
+ while (m_p_nd == p_y->m_p_left)
+ {
+ m_p_nd = p_y;
+ p_y = p_y->m_p_parent;
+ }
+ if (m_p_nd->m_p_left != p_y)
+ m_p_nd = p_y;
+ }
+
+ public:
+ Node_Pointer m_p_nd;
+ };
+
+ // Iterator.
+ template<typename Node_Pointer,
+ typename Value_Type,
+ typename Pointer,
+ typename Const_Pointer,
+ typename Reference,
+ typename Const_Reference,
+ bool Is_Forward_Iterator,
+ class Allocator>
+ class bin_search_tree_it_ :
+ public PB_DS_TREE_CONST_IT_C_DEC
+
+ {
+
+ public:
+
+ inline
+ bin_search_tree_it_(const Node_Pointer p_nd = NULL)
+ : PB_DS_TREE_CONST_IT_C_DEC((Node_Pointer)p_nd)
+ { }
+
+ inline
+ bin_search_tree_it_(const PB_DS_TREE_ODIR_IT_C_DEC& other)
+ : PB_DS_TREE_CONST_IT_C_DEC(other.m_p_nd)
+ { }
+
+ inline
+ PB_DS_TREE_IT_C_DEC&
+ operator=(const PB_DS_TREE_IT_C_DEC& other)
+ {
+ base_it_type::m_p_nd = other.m_p_nd;
+ return *this;
+ }
+
+ inline
+ PB_DS_TREE_IT_C_DEC&
+ operator=(const PB_DS_TREE_ODIR_IT_C_DEC& other)
+ {
+ base_it_type::m_p_nd = other.m_p_nd;
+ return *this;
+ }
+
+ inline typename PB_DS_TREE_CONST_IT_C_DEC::pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_it_type::m_p_nd != NULL);
+ return &base_it_type::m_p_nd->m_value;
+ }
+
+ inline typename PB_DS_TREE_CONST_IT_C_DEC::reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_it_type::m_p_nd != NULL);
+ return base_it_type::m_p_nd->m_value;
+ }
+
+ inline PB_DS_TREE_IT_C_DEC&
+ operator++()
+ {
+ PB_DS_TREE_CONST_IT_C_DEC:: operator++();
+ return *this;
+ }
+
+ inline PB_DS_TREE_IT_C_DEC
+ operator++(int)
+ {
+ PB_DS_TREE_IT_C_DEC ret_it(base_it_type::m_p_nd);
+ operator++();
+ return ret_it;
+ }
+
+ inline PB_DS_TREE_IT_C_DEC&
+ operator--()
+ {
+ PB_DS_TREE_CONST_IT_C_DEC:: operator--();
+ return *this;
+ }
+
+ inline PB_DS_TREE_IT_C_DEC
+ operator--(int)
+ {
+ PB_DS_TREE_IT_C_DEC ret_it(base_it_type::m_p_nd);
+ operator--();
+ return ret_it;
+ }
+
+ protected:
+ typedef PB_DS_TREE_CONST_IT_C_DEC base_it_type;
+ };
+
+#undef PB_DS_TREE_CONST_IT_C_DEC
+#undef PB_DS_TREE_CONST_ODIR_IT_C_DEC
+#undef PB_DS_TREE_IT_C_DEC
+#undef PB_DS_TREE_ODIR_IT_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp
new file mode 100644
index 0000000..63f307d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp
@@ -0,0 +1,56 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file policy_access_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+Cmp_Fn&
+PB_DS_CLASS_C_DEC::
+get_cmp_fn()
+{
+ return (*this);
+}
+
+PB_DS_CLASS_T_DEC
+const Cmp_Fn&
+PB_DS_CLASS_C_DEC::
+get_cmp_fn() const
+{
+ return (*this);
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp
new file mode 100644
index 0000000..667ef84
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp
@@ -0,0 +1,120 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file r_erase_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+actual_erase_node(node_pointer p_z)
+{
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ --m_size;
+
+ _GLIBCXX_DEBUG_ONLY(erase_existing(PB_DS_V2F(p_z->m_value)));
+
+ p_z->~node();
+
+ s_node_allocator.deallocate(p_z, 1);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+update_min_max_for_erased_node(node_pointer p_z)
+{
+ if (m_size == 1)
+ {
+ m_p_head->m_p_left = m_p_head->m_p_right = m_p_head;
+
+ return;
+ }
+
+ if (m_p_head->m_p_left == p_z)
+ {
+ iterator it(p_z);
+
+ ++it;
+
+ m_p_head->m_p_left = it.m_p_nd;
+ }
+ else if (m_p_head->m_p_right == p_z)
+ {
+ iterator it(p_z);
+
+ --it;
+
+ m_p_head->m_p_right = it.m_p_nd;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+
+ clear_imp(m_p_head->m_p_parent);
+
+ m_size = 0;
+
+ initialize();
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::clear();)
+
+ _GLIBCXX_DEBUG_ONLY(structure_only_assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear_imp(node_pointer p_nd)
+{
+ if (p_nd == NULL)
+ return;
+
+ clear_imp(p_nd->m_p_left);
+
+ clear_imp(p_nd->m_p_right);
+
+ p_nd->~Node();
+
+ s_node_allocator.deallocate(p_nd, 1);
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp
new file mode 100644
index 0000000..0598657
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp
@@ -0,0 +1,156 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file rotate_fn_imps.hpp
+ * Contains imps for rotating nodes.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+rotate_left(node_pointer p_x)
+{
+ node_pointer p_y = p_x->m_p_right;
+
+ p_x->m_p_right = p_y->m_p_left;
+
+ if (p_y->m_p_left != NULL)
+ p_y->m_p_left->m_p_parent = p_x;
+
+ p_y->m_p_parent = p_x->m_p_parent;
+
+ if (p_x == m_p_head->m_p_parent)
+ m_p_head->m_p_parent = p_y;
+ else if (p_x == p_x->m_p_parent->m_p_left)
+ p_x->m_p_parent->m_p_left = p_y;
+ else
+ p_x->m_p_parent->m_p_right = p_y;
+
+ p_y->m_p_left = p_x;
+ p_x->m_p_parent = p_y;
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_x);)
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_y);)
+
+ apply_update(p_x, (node_update* )this);
+ apply_update(p_x->m_p_parent, (node_update* )this);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+rotate_right(node_pointer p_x)
+{
+ node_pointer p_y = p_x->m_p_left;
+
+ p_x->m_p_left = p_y->m_p_right;
+
+ if (p_y->m_p_right != NULL)
+ p_y->m_p_right->m_p_parent = p_x;
+
+ p_y->m_p_parent = p_x->m_p_parent;
+
+ if (p_x == m_p_head->m_p_parent)
+ m_p_head->m_p_parent = p_y;
+ else if (p_x == p_x->m_p_parent->m_p_right)
+ p_x->m_p_parent->m_p_right = p_y;
+ else
+ p_x->m_p_parent->m_p_left = p_y;
+
+ p_y->m_p_right = p_x;
+ p_x->m_p_parent = p_y;
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_x);)
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_y);)
+
+ apply_update(p_x, (node_update* )this);
+ apply_update(p_x->m_p_parent, (node_update* )this);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+rotate_parent(node_pointer p_nd)
+{
+ node_pointer p_parent = p_nd->m_p_parent;
+
+ if (p_nd == p_parent->m_p_left)
+ rotate_right(p_parent);
+ else
+ rotate_left(p_parent);
+
+ _GLIBCXX_DEBUG_ASSERT(p_parent->m_p_parent = p_nd);
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_left == p_parent ||
+ p_nd->m_p_right == p_parent);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+apply_update(node_pointer /*p_nd*/, null_node_update_pointer /*p_update*/)
+{ }
+
+PB_DS_CLASS_T_DEC
+template<typename Node_Update_>
+inline void
+PB_DS_CLASS_C_DEC::
+apply_update(node_pointer p_nd, Node_Update_* /*p_update*/)
+{
+ node_update::operator()(
+ node_iterator(p_nd),
+ const_node_iterator(static_cast<node_pointer>(NULL)));
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Node_Update_>
+inline void
+PB_DS_CLASS_C_DEC::
+update_to_top(node_pointer p_nd, Node_Update_* p_update)
+{
+ while (p_nd != m_p_head)
+ {
+ apply_update(p_nd, p_update);
+
+ p_nd = p_nd->m_p_parent;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+update_to_top(node_pointer /*p_nd*/, null_node_update_pointer /*p_update*/)
+{ }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp
new file mode 100644
index 0000000..9d2bd6d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp
@@ -0,0 +1,146 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_join_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+bool
+PB_DS_CLASS_C_DEC::
+join_prep(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ if (other.m_size == 0)
+ return false;
+
+ if (m_size == 0)
+ {
+ value_swap(other);
+ return false;
+ }
+
+ const bool greater = Cmp_Fn::operator()(PB_DS_V2F(m_p_head->m_p_right->m_value), PB_DS_V2F(other.m_p_head->m_p_left->m_value));
+
+ const bool lesser = Cmp_Fn::operator()(PB_DS_V2F(other.m_p_head->m_p_right->m_value), PB_DS_V2F(m_p_head->m_p_left->m_value));
+
+ if (!greater && !lesser)
+ __throw_join_error();
+
+ if (lesser)
+ value_swap(other);
+
+ m_size += other.m_size;
+ _GLIBCXX_DEBUG_ONLY(debug_base::join(other);)
+ return true;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+join_finish(PB_DS_CLASS_C_DEC& other)
+{
+ initialize_min_max();
+ other.initialize();
+}
+
+PB_DS_CLASS_T_DEC
+bool
+PB_DS_CLASS_C_DEC::
+split_prep(const_key_reference r_key, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ other.clear();
+
+ if (m_size == 0)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return false;
+ }
+
+ if (Cmp_Fn::operator()(r_key, PB_DS_V2F(m_p_head->m_p_left->m_value)))
+ {
+ value_swap(other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return false;
+ }
+
+ if (!Cmp_Fn::operator()(r_key, PB_DS_V2F(m_p_head->m_p_right->m_value)))
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return false;
+ }
+
+ if (m_size == 1)
+ {
+ value_swap(other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return false;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::split(r_key,(Cmp_Fn& )(*this), other);)
+ return true;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+split_finish(PB_DS_CLASS_C_DEC& other)
+{
+ other.initialize_min_max();
+ other.m_size = std::distance(other.begin(), other.end());
+ m_size -= other.m_size;
+ initialize_min_max();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+recursive_count(node_pointer p) const
+{
+ if (p == NULL)
+ return 0;
+ return 1 + recursive_count(p->m_p_left) + recursive_count(p->m_p_right);
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/traits.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/traits.hpp
new file mode 100644
index 0000000..58c30c3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/bin_search_tree_/traits.hpp
@@ -0,0 +1,250 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file traits.hpp
+ * Contains an implementation for bin_search_tree_.
+ */
+
+#ifndef PB_DS_BIN_SEARCH_TREE_NODE_AND_IT_TRAITS_HPP
+#define PB_DS_BIN_SEARCH_TREE_NODE_AND_IT_TRAITS_HPP
+
+#include <ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Key,
+ typename Mapped,
+ class Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn,
+ class Allocator>
+ class Node_Update,
+ class Node,
+ class Allocator>
+ struct bin_search_tree_traits
+ {
+ private:
+ typedef
+ types_traits<
+ Key,
+ Mapped,
+ Allocator,
+ false>
+ type_traits;
+
+ public:
+ typedef Node node;
+
+ typedef
+ bin_search_tree_const_it_<
+ typename Allocator::template rebind<
+ node>::other::pointer,
+ typename type_traits::value_type,
+ typename type_traits::pointer,
+ typename type_traits::const_pointer,
+ typename type_traits::reference,
+ typename type_traits::const_reference,
+ true,
+ Allocator>
+ const_point_iterator;
+
+ typedef
+ bin_search_tree_it_<
+ typename Allocator::template rebind<
+ node>::other::pointer,
+ typename type_traits::value_type,
+ typename type_traits::pointer,
+ typename type_traits::const_pointer,
+ typename type_traits::reference,
+ typename type_traits::const_reference,
+ true,
+ Allocator>
+ point_iterator;
+
+ typedef
+ bin_search_tree_const_it_<
+ typename Allocator::template rebind<
+ node>::other::pointer,
+ typename type_traits::value_type,
+ typename type_traits::pointer,
+ typename type_traits::const_pointer,
+ typename type_traits::reference,
+ typename type_traits::const_reference,
+ false,
+ Allocator>
+ const_reverse_iterator;
+
+ typedef
+ bin_search_tree_it_<
+ typename Allocator::template rebind<
+ node>::other::pointer,
+ typename type_traits::value_type,
+ typename type_traits::pointer,
+ typename type_traits::const_pointer,
+ typename type_traits::reference,
+ typename type_traits::const_reference,
+ false,
+ Allocator>
+ reverse_iterator;
+
+ typedef
+ bin_search_tree_const_node_it_<
+ Node,
+ const_point_iterator,
+ point_iterator,
+ Allocator>
+ const_node_iterator;
+
+ typedef
+ bin_search_tree_node_it_<
+ Node,
+ const_point_iterator,
+ point_iterator,
+ Allocator>
+ node_iterator;
+
+ typedef
+ Node_Update<
+ const_node_iterator,
+ node_iterator,
+ Cmp_Fn,
+ Allocator>
+ node_update;
+
+ typedef
+ __gnu_pbds::null_tree_node_update<
+ const_node_iterator,
+ node_iterator,
+ Cmp_Fn,
+ Allocator>*
+ null_node_update_pointer;
+ };
+
+ template<typename Key,
+ class Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn,
+ class Allocator>
+ class Node_Update,
+ class Node,
+ class Allocator>
+ struct bin_search_tree_traits<
+ Key,
+ null_mapped_type,
+ Cmp_Fn,
+ Node_Update,
+ Node,
+ Allocator>
+ {
+ private:
+ typedef
+ types_traits<
+ Key,
+ null_mapped_type,
+ Allocator,
+ false>
+ type_traits;
+
+ public:
+ typedef Node node;
+
+ typedef
+ bin_search_tree_const_it_<
+ typename Allocator::template rebind<
+ node>::other::pointer,
+ typename type_traits::value_type,
+ typename type_traits::pointer,
+ typename type_traits::const_pointer,
+ typename type_traits::reference,
+ typename type_traits::const_reference,
+ true,
+ Allocator>
+ const_point_iterator;
+
+ typedef const_point_iterator point_iterator;
+
+ typedef
+ bin_search_tree_const_it_<
+ typename Allocator::template rebind<
+ node>::other::pointer,
+ typename type_traits::value_type,
+ typename type_traits::pointer,
+ typename type_traits::const_pointer,
+ typename type_traits::reference,
+ typename type_traits::const_reference,
+ false,
+ Allocator>
+ const_reverse_iterator;
+
+ typedef const_reverse_iterator reverse_iterator;
+
+ typedef
+ bin_search_tree_const_node_it_<
+ Node,
+ const_point_iterator,
+ point_iterator,
+ Allocator>
+ const_node_iterator;
+
+ typedef const_node_iterator node_iterator;
+
+ typedef
+ Node_Update<
+ const_node_iterator,
+ node_iterator,
+ Cmp_Fn,
+ Allocator>
+ node_update;
+
+ typedef
+ __gnu_pbds::null_tree_node_update<
+ const_node_iterator,
+ node_iterator,
+ Cmp_Fn,
+ Allocator>*
+ null_node_update_pointer;
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_BIN_SEARCH_TREE_NODE_AND_IT_TRAITS_HPP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp
new file mode 100644
index 0000000..576cba2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp
@@ -0,0 +1,357 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file binary_heap_.hpp
+ * Contains an implementation class for a binary heap.
+ */
+
+#ifndef PB_DS_BINARY_HEAP_HPP
+#define PB_DS_BINARY_HEAP_HPP
+
+/*
+ * Based on CLRS.
+ */
+
+#include <queue>
+#include <algorithm>
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/binary_heap_/entry_cmp.hpp>
+#include <ext/pb_ds/detail/binary_heap_/entry_pred.hpp>
+#include <ext/pb_ds/detail/binary_heap_/resize_policy.hpp>
+#include <ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp>
+#include <ext/pb_ds/detail/binary_heap_/const_iterator.hpp>
+#ifdef PB_DS_BINARY_HEAP_TRACE_
+#include <iostream>
+#endif
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ binary_heap_<Value_Type, Cmp_Fn, Allocator>
+
+#define PB_DS_ENTRY_CMP_DEC \
+ entry_cmp<Value_Type, Cmp_Fn, is_simple<Value_Type>::value, Allocator>::type
+
+#define PB_DS_RESIZE_POLICY_DEC \
+ __gnu_pbds::detail::resize_policy<typename Allocator::size_type>
+
+ /**
+ * class description = "Base class for some types of h3ap$">
+ **/
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+ class binary_heap_ : public PB_DS_ENTRY_CMP_DEC,
+ public PB_DS_RESIZE_POLICY_DEC
+ {
+
+ private:
+ enum
+ {
+ simple_value = is_simple<Value_Type>::value
+ };
+
+ typedef integral_constant<int, simple_value> no_throw_copies_t;
+
+ typedef
+ typename Allocator::template rebind<
+ Value_Type>::other
+ value_allocator;
+
+ typedef
+ typename __conditional_type<
+ simple_value,
+ Value_Type,
+ typename value_allocator::pointer>::__type
+ entry;
+
+ typedef
+ typename Allocator::template rebind<
+ entry>::other
+ entry_allocator;
+
+ typedef typename entry_allocator::pointer entry_pointer;
+
+ typedef typename PB_DS_ENTRY_CMP_DEC entry_cmp;
+
+ typedef PB_DS_RESIZE_POLICY_DEC resize_policy;
+
+ typedef
+ cond_dealtor<
+ Value_Type,
+ Allocator>
+ cond_dealtor_t;
+
+ public:
+
+ typedef typename Allocator::size_type size_type;
+
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef Value_Type value_type;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::pointer
+ pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_pointer
+ const_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::reference
+ reference;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_reference
+ const_reference;
+
+ typedef
+ binary_heap_const_point_iterator_<
+ value_type,
+ entry,
+ simple_value,
+ Allocator>
+ const_point_iterator;
+
+ typedef const_point_iterator point_iterator;
+
+ typedef
+ binary_heap_const_iterator_<
+ value_type,
+ entry,
+ simple_value,
+ Allocator>
+ const_iterator;
+
+ typedef const_iterator iterator;
+
+ typedef Cmp_Fn cmp_fn;
+
+ typedef Allocator allocator_type;
+
+ public:
+
+ binary_heap_();
+
+ binary_heap_(const Cmp_Fn& r_cmp_fn);
+
+ binary_heap_(const PB_DS_CLASS_C_DEC& other);
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ ~binary_heap_();
+
+ inline bool
+ empty() const;
+
+ inline size_type
+ size() const;
+
+ inline size_type
+ max_size() const;
+
+ Cmp_Fn&
+ get_cmp_fn();
+
+ const Cmp_Fn&
+ get_cmp_fn() const;
+
+ inline point_iterator
+ push(const_reference r_val);
+
+ void
+ modify(point_iterator it, const_reference r_new_val);
+
+ inline const_reference
+ top() const;
+
+ inline void
+ pop();
+
+ inline void
+ erase(point_iterator it);
+
+ template<typename Pred>
+ typename PB_DS_CLASS_C_DEC::size_type
+ erase_if(Pred pred);
+
+ inline static void
+ erase_at(entry_pointer a_entries, size_type size, false_type);
+
+ inline static void
+ erase_at(entry_pointer a_entries, size_type size, true_type);
+
+ inline iterator
+ begin();
+
+ inline const_iterator
+ begin() const;
+
+ inline iterator
+ end();
+
+ inline const_iterator
+ end() const;
+
+ void
+ clear();
+
+ template<typename Pred>
+ void
+ split(Pred pred, PB_DS_CLASS_C_DEC& other);
+
+ void
+ join(PB_DS_CLASS_C_DEC& other);
+
+#ifdef PB_DS_BINARY_HEAP_TRACE_
+ void
+ trace() const;
+#endif
+
+ protected:
+
+ template<typename It>
+ void
+ copy_from_range(It first_it, It last_it);
+
+ private:
+
+ void
+ value_swap(PB_DS_CLASS_C_DEC& other);
+
+ inline void
+ insert_value(const_reference r_val, false_type);
+
+ inline void
+ insert_value(value_type val, true_type);
+
+ inline void
+ insert_entry(entry e);
+
+ inline void
+ resize_for_insert_if_needed();
+
+ inline void
+ swap_value_imp(entry_pointer p_e, value_type new_val, true_type);
+
+ inline void
+ swap_value_imp(entry_pointer p_e, const_reference r_new_val, false_type);
+
+ void
+ fix(entry_pointer p_e);
+
+ inline const_reference
+ top_imp(true_type) const;
+
+ inline const_reference
+ top_imp(false_type) const;
+
+ inline static size_type
+ left_child(size_type i);
+
+ inline static size_type
+ right_child(size_type i);
+
+ inline static size_type
+ parent(size_type i);
+
+ inline void
+ resize_for_erase_if_needed();
+
+ template<typename Pred>
+ size_type
+ partition(Pred pred);
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+
+#ifdef PB_DS_BINARY_HEAP_TRACE_
+ void
+ trace_entry(const entry& r_e, false_type) const;
+
+ void
+ trace_entry(const entry& r_e, true_type) const;
+#endif
+
+ private:
+ static entry_allocator s_entry_allocator;
+
+ static value_allocator s_value_allocator;
+
+ static no_throw_copies_t s_no_throw_copies_ind;
+
+ size_type m_size;
+
+ size_type m_actual_size;
+
+ entry_pointer m_a_entries;
+ };
+
+#include <ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/binary_heap_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp>
+#include <ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/binary_heap_/trace_fn_imps.hpp>
+#include <ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp>
+#include <ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp>
+#include <ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp>
+#include <ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_ENTRY_CMP_DEC
+#undef PB_DS_RESIZE_POLICY_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/const_iterator.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/const_iterator.hpp
new file mode 100644
index 0000000..9cb13f9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/const_iterator.hpp
@@ -0,0 +1,152 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file const_iterator.hpp
+ * Contains an iterator class returned by the table's const find and insert
+ * methods.
+ */
+
+#ifndef PB_DS_BINARY_HEAP_CONST_ITERATOR_HPP
+#define PB_DS_BINARY_HEAP_CONST_ITERATOR_HPP
+
+#include <ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_C_DEC \
+ binary_heap_const_iterator_<Value_Type, Entry, Simple, Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ binary_heap_const_point_iterator_<Value_Type, Entry, Simple, Allocator>
+
+ // Const point-type iterator.
+ template<typename Value_Type,
+ typename Entry,
+ bool Simple,
+ class Allocator>
+ class binary_heap_const_iterator_ : public PB_DS_BASE_C_DEC
+ {
+
+ private:
+ typedef typename PB_DS_BASE_C_DEC::entry_pointer entry_pointer;
+
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+
+ // Category.
+ typedef std::forward_iterator_tag iterator_category;
+
+ // Difference type.
+ typedef typename Allocator::difference_type difference_type;
+
+ // Iterator's value type.
+ typedef typename base_type::value_type value_type;
+
+ // Iterator's pointer type.
+ typedef typename base_type::pointer pointer;
+
+ // Iterator's const pointer type.
+ typedef typename base_type::const_pointer const_pointer;
+
+ // Iterator's reference type.
+ typedef typename base_type::reference reference;
+
+ // Iterator's const reference type.
+ typedef typename base_type::const_reference const_reference;
+
+ public:
+
+ inline
+ binary_heap_const_iterator_(entry_pointer p_e) : base_type(p_e)
+ { }
+
+ // Default constructor.
+ inline
+ binary_heap_const_iterator_()
+ { }
+
+ // Copy constructor.
+ inline
+ binary_heap_const_iterator_(const PB_DS_CLASS_C_DEC& other) : base_type(other)
+ { }
+
+ // Compares content to a different iterator object.
+ inline bool
+ operator==(const PB_DS_CLASS_C_DEC& other) const
+ {
+ return base_type::m_p_e == other.m_p_e;
+ }
+
+ // Compares content (negatively) to a different iterator object.
+ inline bool
+ operator!=(const PB_DS_CLASS_C_DEC& other) const
+ {
+ return base_type::m_p_e != other.m_p_e;
+ }
+
+ inline PB_DS_CLASS_C_DEC&
+ operator++()
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_p_e != NULL);
+ inc();
+ return *this;
+ }
+
+ inline PB_DS_CLASS_C_DEC
+ operator++(int)
+ {
+ PB_DS_CLASS_C_DEC ret_it(base_type::m_p_e);
+ operator++();
+ return ret_it;
+ }
+
+ private:
+ void
+ inc()
+ { ++base_type::m_p_e; }
+ };
+
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_BASE_C_DEC
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp
new file mode 100644
index 0000000..d4013db
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp
@@ -0,0 +1,144 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file const_point_iterator.hpp
+ * Contains an iterator class returned by the table's const find and insert
+ * methods.
+ */
+
+#ifndef PB_DS_BINARY_HEAP_CONST_FIND_ITERATOR_HPP
+#define PB_DS_BINARY_HEAP_CONST_FIND_ITERATOR_HPP
+
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ // Const point-type iterator.
+ template<typename Value_Type, typename Entry, bool Simple,
+ typename Allocator>
+ class binary_heap_const_point_iterator_
+ {
+ protected:
+ typedef typename Allocator::template rebind<Entry>::other::pointer entry_pointer;
+
+ public:
+ // Category.
+ typedef trivial_iterator_tag iterator_category;
+
+ // Difference type.
+ typedef trivial_iterator_difference_type difference_type;
+
+ // Iterator's value type.
+ typedef Value_Type value_type;
+
+ // Iterator's pointer type.
+ typedef typename Allocator::template rebind<value_type>::other::pointer
+ pointer;
+
+ // Iterator's const pointer type.
+ typedef
+ typename Allocator::template rebind<value_type>::other::const_pointer
+ const_pointer;
+
+ // Iterator's reference type.
+ typedef
+ typename Allocator::template rebind<value_type>::other::reference
+ reference;
+
+ // Iterator's const reference type.
+ typedef
+ typename Allocator::template rebind<value_type>::other::const_reference
+ const_reference;
+
+ inline
+ binary_heap_const_point_iterator_(entry_pointer p_e) : m_p_e(p_e)
+ { }
+
+ // Default constructor.
+ inline
+ binary_heap_const_point_iterator_() : m_p_e(NULL) { }
+
+ // Copy constructor.
+ inline
+ binary_heap_const_point_iterator_(const binary_heap_const_point_iterator_& other)
+ : m_p_e(other.m_p_e)
+ { }
+
+ // Access.
+ inline const_pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_e != NULL);
+ return to_ptr(integral_constant<int, Simple>());
+ }
+
+ // Access.
+ inline const_reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_e != NULL);
+ return *to_ptr(integral_constant<int, Simple>());
+ }
+
+ // Compares content to a different iterator object.
+ inline bool
+ operator==(const binary_heap_const_point_iterator_& other) const
+ { return m_p_e == other.m_p_e; }
+
+ // Compares content (negatively) to a different iterator object.
+ inline bool
+ operator!=(const binary_heap_const_point_iterator_& other) const
+ { return m_p_e != other.m_p_e; }
+
+ private:
+ inline const_pointer
+ to_ptr(true_type) const
+ { return m_p_e; }
+
+ inline const_pointer
+ to_ptr(false_type) const
+ { return *m_p_e; }
+
+ public:
+ entry_pointer m_p_e;
+ };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/constructors_destructor_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..a77a025
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,159 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation class for binary_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::entry_allocator
+PB_DS_CLASS_C_DEC::s_entry_allocator;
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::value_allocator
+PB_DS_CLASS_C_DEC::s_value_allocator;
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::no_throw_copies_t
+PB_DS_CLASS_C_DEC::s_no_throw_copies_ind;
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+ while (first_it != last_it)
+ {
+ insert_value(*first_it, s_no_throw_copies_ind);
+ ++first_it;
+ }
+
+ std::make_heap(m_a_entries, m_a_entries + m_size, static_cast<entry_cmp& >(*this));
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+binary_heap_() :
+ m_size(0),
+ m_actual_size(resize_policy::min_size),
+ m_a_entries(s_entry_allocator.allocate(m_actual_size))
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+binary_heap_(const Cmp_Fn& r_cmp_fn) :
+ entry_cmp(r_cmp_fn),
+ m_size(0),
+ m_actual_size(resize_policy::min_size),
+ m_a_entries(s_entry_allocator.allocate(m_actual_size))
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+binary_heap_(const PB_DS_CLASS_C_DEC& other) :
+ entry_cmp(other),
+ resize_policy(other),
+ m_size(0),
+ m_actual_size(other.m_actual_size),
+ m_a_entries(s_entry_allocator.allocate(m_actual_size))
+{
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(m_a_entries != other.m_a_entries);
+
+ const_iterator first_it = other.begin();
+ const_iterator last_it = other.end();
+
+ __try
+ {
+ while (first_it != last_it)
+ {
+ insert_value(*first_it, s_no_throw_copies_ind);
+ ++first_it;
+ }
+ }
+ __catch(...)
+ {
+ for (size_type i = 0; i < m_size; ++i)
+ erase_at(m_a_entries, i, s_no_throw_copies_ind);
+
+ s_entry_allocator.deallocate(m_a_entries, m_actual_size);
+ __throw_exception_again;
+ }
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(m_a_entries != other.m_a_entries);
+
+ value_swap(other);
+ std::swap((entry_cmp& )(*this), (entry_cmp& )other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+value_swap(PB_DS_CLASS_C_DEC& other)
+{
+ std::swap(m_a_entries, other.m_a_entries);
+ std::swap(m_size, other.m_size);
+ std::swap(m_actual_size, other.m_actual_size);
+ static_cast<resize_policy*>(this)->swap(other);
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~binary_heap_()
+{
+ for (size_type i = 0; i < m_size; ++i)
+ erase_at(m_a_entries, i, s_no_throw_copies_ind);
+ s_entry_allocator.deallocate(m_a_entries, m_actual_size);
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp
new file mode 100644
index 0000000..fcfecfd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+#ifdef PB_DS_REGRESSION
+ s_entry_allocator.check_allocated(m_a_entries, m_actual_size);
+#endif
+
+ resize_policy::assert_valid();
+ _GLIBCXX_DEBUG_ASSERT(m_size <= m_actual_size);
+ for (size_type i = 0; i < m_size; ++i)
+ {
+#ifdef PB_DS_REGRESSION
+ s_value_allocator.check_allocated(m_a_entries[i], 1);
+#endif
+
+ if (left_child(i) < m_size)
+ _GLIBCXX_DEBUG_ASSERT(!entry_cmp::operator()(m_a_entries[i], m_a_entries[left_child(i)]));
+
+ _GLIBCXX_DEBUG_ASSERT(parent(left_child(i)) == i);
+
+ if (right_child(i) < m_size)
+ _GLIBCXX_DEBUG_ASSERT(!entry_cmp::operator()(m_a_entries[i], m_a_entries[right_child(i)]));
+
+ _GLIBCXX_DEBUG_ASSERT(parent(right_child(i)) == i);
+ }
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/entry_cmp.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/entry_cmp.hpp
new file mode 100644
index 0000000..b0a9b5b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/entry_cmp.hpp
@@ -0,0 +1,93 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file entry_cmp.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+#ifndef PB_DS_BINARY_HEAP_ENTRY_CMP_HPP
+#define PB_DS_BINARY_HEAP_ENTRY_CMP_HPP
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Value_Type,
+ class Cmp_Fn,
+ bool No_Throw,
+ class Allocator>
+ struct entry_cmp
+ {
+ typedef Cmp_Fn type;
+ };
+
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+ struct entry_cmp<
+ Value_Type,
+ Cmp_Fn,
+ false,
+ Allocator>
+ {
+ public:
+ typedef
+ typename Allocator::template rebind<
+ Value_Type>::other::const_pointer
+ entry;
+
+ struct type : public Cmp_Fn
+ {
+ public:
+ inline
+ type()
+ { }
+
+ inline
+ type(const Cmp_Fn& other) : Cmp_Fn(other)
+ { }
+
+ inline bool
+ operator()(entry p_lhs, entry p_rhs) const
+ {
+ return Cmp_Fn::operator()(*p_lhs, * p_rhs);
+ }
+ };
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_BINARY_HEAP_ENTRY_CMP_HPP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/entry_pred.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/entry_pred.hpp
new file mode 100644
index 0000000..185529e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/entry_pred.hpp
@@ -0,0 +1,93 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file entry_pred.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+#ifndef PB_DS_BINARY_HEAP_ENTRY_PRED_HPP
+#define PB_DS_BINARY_HEAP_ENTRY_PRED_HPP
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Value_Type,
+ class Pred,
+ bool No_Throw,
+ class Allocator>
+ struct entry_pred
+ {
+ typedef Pred type;
+ };
+
+ template<typename Value_Type, class Pred, class Allocator>
+ struct entry_pred<
+ Value_Type,
+ Pred,
+ false,
+ Allocator>
+ {
+ public:
+ typedef
+ typename Allocator::template rebind<
+ Value_Type>::other::const_pointer
+ entry;
+
+ struct type : public Pred
+ {
+ public:
+ inline
+ type()
+ { }
+
+ inline
+ type(const Pred& other) : Pred(other)
+ { }
+
+ inline bool
+ operator()(entry p_v) const
+ {
+ return Pred::operator()(*p_v);
+ }
+ };
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_BINARY_HEAP_ENTRY_PRED_HPP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp
new file mode 100644
index 0000000..30f3a48
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp
@@ -0,0 +1,246 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ for (size_type i = 0; i < m_size; ++i)
+ erase_at(m_a_entries, i, s_no_throw_copies_ind);
+
+ __try
+ {
+ const size_type actual_size = resize_policy::get_new_size_for_arbitrary(0);
+
+ entry_pointer a_entries = s_entry_allocator.allocate(actual_size);
+
+ resize_policy::notify_arbitrary(actual_size);
+
+ s_entry_allocator.deallocate(m_a_entries, m_actual_size);
+
+ m_actual_size = actual_size;
+
+ m_a_entries = a_entries;
+ }
+ __catch(...)
+ { }
+
+ m_size = 0;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase_at(entry_pointer a_entries, size_type i, false_type)
+{
+ a_entries[i]->~value_type();
+
+ s_value_allocator.deallocate(a_entries[i], 1);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase_at(entry_pointer, size_type, true_type)
+{ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+pop()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!empty());
+
+ erase_at(m_a_entries, 0, s_no_throw_copies_ind);
+
+ std::pop_heap(m_a_entries, m_a_entries + m_size, static_cast<entry_cmp& >(*this));
+
+ resize_for_erase_if_needed();
+
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ --m_size;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ typedef
+ typename entry_pred<
+ value_type,
+ Pred,
+ simple_value,
+ Allocator>::type
+ pred_t;
+
+ const size_type left = partition(pred_t(pred));
+
+ _GLIBCXX_DEBUG_ASSERT(m_size >= left);
+
+ const size_type ersd = m_size - left;
+
+ for (size_type i = left; i < m_size; ++i)
+ erase_at(m_a_entries, i, s_no_throw_copies_ind);
+
+ __try
+ {
+ const size_type actual_size =
+ resize_policy::get_new_size_for_arbitrary(left);
+
+ entry_pointer a_entries = s_entry_allocator.allocate(actual_size);
+
+ std::copy(m_a_entries, m_a_entries + left, a_entries);
+
+ s_entry_allocator.deallocate(m_a_entries, m_actual_size);
+
+ m_actual_size = actual_size;
+
+ resize_policy::notify_arbitrary(m_actual_size);
+ }
+ __catch(...)
+ { };
+
+ m_size = left;
+
+ std::make_heap(m_a_entries, m_a_entries + m_size, static_cast<entry_cmp& >(*this));
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ return ersd;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+erase(point_iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!empty());
+
+ const size_type fix_pos = it.m_p_e - m_a_entries;
+
+ std::swap(*it.m_p_e, m_a_entries[m_size - 1]);
+
+ erase_at(m_a_entries, m_size - 1, s_no_throw_copies_ind);
+
+ resize_for_erase_if_needed();
+
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ --m_size;
+
+ _GLIBCXX_DEBUG_ASSERT(fix_pos <= m_size);
+
+ if (fix_pos != m_size)
+ fix(m_a_entries + fix_pos);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+resize_for_erase_if_needed()
+{
+ if (!resize_policy::resize_needed_for_shrink(m_size))
+ return;
+
+ __try
+ {
+ const size_type new_actual_size =
+ resize_policy::get_new_size_for_shrink();
+
+ entry_pointer a_new_entries = s_entry_allocator.allocate(new_actual_size);
+
+ resize_policy::notify_shrink_resize();
+
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ std::copy(m_a_entries, m_a_entries + m_size - 1, a_new_entries);
+
+ s_entry_allocator.deallocate(m_a_entries, m_actual_size);
+
+ m_actual_size = new_actual_size;
+
+ m_a_entries = a_new_entries;
+ }
+ __catch(...)
+ { }
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+partition(Pred pred)
+{
+ size_type left = 0;
+ size_type right = m_size - 1;
+
+ while (right + 1 != left)
+ {
+ _GLIBCXX_DEBUG_ASSERT(left <= m_size);
+
+ if (!pred(m_a_entries[left]))
+ ++left;
+ else if (pred(m_a_entries[right]))
+ --right;
+ else
+ {
+ _GLIBCXX_DEBUG_ASSERT(left < right);
+
+ std::swap(m_a_entries[left], m_a_entries[right]);
+
+ ++left;
+ --right;
+ }
+ }
+
+ return left;
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp
new file mode 100644
index 0000000..28d4a8c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp
@@ -0,0 +1,91 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reference
+PB_DS_CLASS_C_DEC::
+top() const
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!empty());
+
+ return top_imp(s_no_throw_copies_ind);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reference
+PB_DS_CLASS_C_DEC::
+top_imp(true_type) const
+{
+ return* m_a_entries;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reference
+PB_DS_CLASS_C_DEC::
+top_imp(false_type) const
+{
+ return** m_a_entries;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+left_child(size_type i)
+{
+ return i* 2 + 1;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+right_child(size_type i)
+{
+ return i* 2 + 2;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+parent(size_type i)
+{
+ return (i - 1) / 2;
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp
new file mode 100644
index 0000000..d292793
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp
@@ -0,0 +1,64 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file info_fn_imps.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+empty() const
+{
+ return (m_size == 0);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size() const
+{
+ return (m_size);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+max_size() const
+{
+ return (s_entry_allocator.max_size());
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp
new file mode 100644
index 0000000..f13a3cb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp
@@ -0,0 +1,183 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+push(const_reference r_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ insert_value(r_val, s_no_throw_copies_ind);
+ std::push_heap(m_a_entries, m_a_entries + m_size,
+ static_cast<entry_cmp&>(*this));
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return point_iterator(m_a_entries);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+insert_value(value_type val, true_type)
+{
+ resize_for_insert_if_needed();
+
+ m_a_entries[m_size++] = val;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+insert_value(const_reference r_val, false_type)
+{
+ resize_for_insert_if_needed();
+ pointer p_new = s_value_allocator.allocate(1);
+ cond_dealtor_t cond(p_new);
+ new (p_new) value_type(r_val);
+ cond.set_no_action();
+ m_a_entries[m_size++] = p_new;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+insert_entry(entry e)
+{
+ resize_for_insert_if_needed();
+ m_a_entries[m_size++] = e;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+resize_for_insert_if_needed()
+{
+ if (!resize_policy::resize_needed_for_grow(m_size))
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_size < m_actual_size);
+ return;
+ }
+
+ const size_type new_actual_size = resize_policy::get_new_size_for_grow();
+ entry_pointer a_new_entries = s_entry_allocator.allocate(new_actual_size);
+ resize_policy::notify_grow_resize();
+ std::copy(m_a_entries, m_a_entries + m_size, a_new_entries);
+ s_entry_allocator.deallocate(m_a_entries, m_actual_size);
+ m_actual_size = new_actual_size;
+ m_a_entries = a_new_entries;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+modify(point_iterator it, const_reference r_new_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ swap_value_imp(it.m_p_e, r_new_val, s_no_throw_copies_ind);
+ fix(it.m_p_e);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+fix(entry_pointer p_e)
+{
+ size_type i = p_e - m_a_entries;
+ if (i > 0 && entry_cmp::operator()(m_a_entries[parent(i)], m_a_entries[i]))
+ {
+ size_type parent_i = parent(i);
+ while (i > 0
+ && entry_cmp::operator()(m_a_entries[parent_i], m_a_entries[i]))
+ {
+ std::swap(m_a_entries[i], m_a_entries[parent_i]);
+ i = parent_i;
+ parent_i = parent(i);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return;
+ }
+
+ while (i < m_size)
+ {
+ const size_type left_child_i = left_child(i);
+ const size_type right_child_i = right_child(i);
+ _GLIBCXX_DEBUG_ASSERT(right_child_i > left_child_i);
+ const bool smaller_than_left_child = left_child_i < m_size &&
+ entry_cmp::operator()(m_a_entries[i], m_a_entries[left_child_i]);
+
+ const bool smaller_than_right_child = right_child_i < m_size &&
+ entry_cmp::operator()(m_a_entries[i], m_a_entries[right_child_i]);
+
+ const bool swap_with_r_child = smaller_than_right_child && (!smaller_than_left_child || entry_cmp::operator()(m_a_entries[left_child_i], m_a_entries[right_child_i]));
+
+ const bool swap_with_l_child = !swap_with_r_child && smaller_than_left_child;
+
+ if (swap_with_l_child)
+ {
+ std::swap(m_a_entries[i], m_a_entries[left_child_i]);
+ i = left_child_i;
+ }
+ else if (swap_with_r_child)
+ {
+ std::swap(m_a_entries[i], m_a_entries[right_child_i]);
+ i = right_child_i;
+ }
+ else
+ i = m_size;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+swap_value_imp(entry_pointer p_e, value_type new_val, true_type)
+{
+ * p_e = new_val;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+swap_value_imp(entry_pointer p_e, const_reference r_new_val, false_type)
+{
+ value_type tmp(r_new_val);
+ (*p_e)->swap(tmp);
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp
new file mode 100644
index 0000000..db0a64e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file iterators_fn_imps.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+begin()
+{
+ return (iterator(m_a_entries));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+begin() const
+{
+ return (const_iterator(m_a_entries));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+end()
+{
+ return (iterator(m_a_entries + m_size));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+end() const
+{
+ return (const_iterator(m_a_entries + m_size));
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp
new file mode 100644
index 0000000..11a7b89
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp
@@ -0,0 +1,56 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file policy_access_fn_imps.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+PB_DS_CLASS_T_DEC
+Cmp_Fn&
+PB_DS_CLASS_C_DEC::
+get_cmp_fn()
+{
+ return (*this);
+}
+
+PB_DS_CLASS_T_DEC
+const Cmp_Fn&
+PB_DS_CLASS_C_DEC::
+get_cmp_fn() const
+{
+ return (*this);
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/resize_policy.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/resize_policy.hpp
new file mode 100644
index 0000000..588fb3d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/resize_policy.hpp
@@ -0,0 +1,253 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file resize_policy.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+#ifndef PB_DS_BINARY_HEAP_RESIZE_POLICY_HPP
+#define PB_DS_BINARY_HEAP_RESIZE_POLICY_HPP
+
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC template<typename Size_Type>
+
+#define PB_DS_CLASS_C_DEC resize_policy<Size_Type>
+
+ template<typename Size_Type>
+ class resize_policy
+ {
+ public:
+ typedef Size_Type size_type;
+
+ enum
+ {
+ min_size = 16
+ };
+
+ public:
+ inline
+ resize_policy();
+
+ inline void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ inline bool
+ resize_needed_for_grow(size_type size) const;
+
+ inline bool
+ resize_needed_for_shrink(size_type size) const;
+
+ inline bool
+ grow_needed(size_type size) const;
+
+ inline bool
+ shrink_needed(size_type size) const;
+
+ inline size_type
+ get_new_size_for_grow() const;
+
+ inline size_type
+ get_new_size_for_shrink() const;
+
+ size_type
+ get_new_size_for_arbitrary(size_type size) const;
+
+ inline void
+ notify_grow_resize();
+
+ inline void
+ notify_shrink_resize();
+
+ void
+ notify_arbitrary(size_type actual_size);
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+
+#ifdef PB_DS_BINARY_HEAP_TRACE_
+ void
+ trace() const;
+#endif
+
+ private:
+ enum
+ {
+ ratio = 8,
+ factor = 2
+ };
+
+ private:
+ size_type m_next_shrink_size;
+ size_type m_next_grow_size;
+ };
+
+ PB_DS_CLASS_T_DEC
+ inline
+ PB_DS_CLASS_C_DEC::
+ resize_policy() :
+ m_next_shrink_size(0),
+ m_next_grow_size(min_size)
+ { _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ swap(PB_DS_CLASS_C_DEC& other)
+ {
+ std::swap(m_next_shrink_size, other.m_next_shrink_size);
+ std::swap(m_next_grow_size, other.m_next_grow_size);
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline bool
+ PB_DS_CLASS_C_DEC::
+ resize_needed_for_grow(size_type size) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(size <= m_next_grow_size);
+ return size == m_next_grow_size;
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline bool
+ PB_DS_CLASS_C_DEC::
+ resize_needed_for_shrink(size_type size) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(size <= m_next_grow_size);
+ return size == m_next_shrink_size;
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ get_new_size_for_grow() const
+ { return m_next_grow_size* factor; }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ get_new_size_for_shrink() const
+ {
+ const size_type half_size = m_next_grow_size / factor;
+ return std::max(static_cast<size_type>(min_size), half_size);
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ get_new_size_for_arbitrary(size_type size) const
+ {
+ size_type ret = min_size;
+ while (ret < size)
+ ret *= factor;
+ return ret;
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ notify_grow_resize()
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(m_next_grow_size >= min_size);
+ m_next_grow_size *= factor;
+ m_next_shrink_size = m_next_grow_size / ratio;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ notify_shrink_resize()
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ m_next_shrink_size /= factor;
+ if (m_next_shrink_size == 1)
+ m_next_shrink_size = 0;
+
+ m_next_grow_size =
+ std::max(m_next_grow_size / factor, static_cast<size_type>(min_size));
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ notify_arbitrary(size_type actual_size)
+ {
+ m_next_grow_size = actual_size;
+ m_next_shrink_size = m_next_grow_size / ratio;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+#ifdef _GLIBCXX_DEBUG
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ assert_valid() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_next_shrink_size == 0 ||
+ m_next_shrink_size* ratio == m_next_grow_size);
+
+ _GLIBCXX_DEBUG_ASSERT(m_next_grow_size >= min_size);
+ }
+#endif
+
+#ifdef PB_DS_BINARY_HEAP_TRACE_
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ trace() const
+ {
+ std::cerr << "shrink = " << m_next_shrink_size <<
+ " grow = " << m_next_grow_size << std::endl;
+ }
+#endif
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+} // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp
new file mode 100644
index 0000000..04b7d54
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp
@@ -0,0 +1,172 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_join_fn_imps.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+void
+PB_DS_CLASS_C_DEC::
+split(Pred pred, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ typedef
+ typename entry_pred<
+ value_type,
+ Pred,
+ simple_value,
+ Allocator>::type
+ pred_t;
+
+ const size_type left = partition(pred_t(pred));
+
+ _GLIBCXX_DEBUG_ASSERT(m_size >= left);
+
+ const size_type ersd = m_size - left;
+
+ _GLIBCXX_DEBUG_ASSERT(m_size >= ersd);
+
+ const size_type actual_size =
+ resize_policy::get_new_size_for_arbitrary(left);
+
+ const size_type other_actual_size =
+ other.get_new_size_for_arbitrary(ersd);
+
+ entry_pointer a_entries = NULL;
+ entry_pointer a_other_entries = NULL;
+
+ __try
+ {
+ a_entries = s_entry_allocator.allocate(actual_size);
+
+ a_other_entries = s_entry_allocator.allocate(other_actual_size);
+ }
+ __catch(...)
+ {
+ if (a_entries != NULL)
+ s_entry_allocator.deallocate(a_entries, actual_size);
+
+ if (a_other_entries != NULL)
+ s_entry_allocator.deallocate(a_other_entries, other_actual_size);
+
+ __throw_exception_again;
+ };
+
+ for (size_type i = 0; i < other.m_size; ++i)
+ erase_at(other.m_a_entries, i, s_no_throw_copies_ind);
+
+ _GLIBCXX_DEBUG_ASSERT(actual_size >= left);
+ std::copy(m_a_entries, m_a_entries + left, a_entries);
+ std::copy(m_a_entries + left, m_a_entries + m_size, a_other_entries);
+
+ s_entry_allocator.deallocate(m_a_entries, m_actual_size);
+ s_entry_allocator.deallocate(other.m_a_entries, other.m_actual_size);
+
+ m_actual_size = actual_size;
+ other.m_actual_size = other_actual_size;
+
+ m_size = left;
+ other.m_size = ersd;
+
+ m_a_entries = a_entries;
+ other.m_a_entries = a_other_entries;
+
+ std::make_heap(m_a_entries, m_a_entries + m_size, static_cast<entry_cmp& >(*this));
+ std::make_heap(other.m_a_entries, other.m_a_entries + other.m_size, static_cast<entry_cmp& >(other));
+
+ resize_policy::notify_arbitrary(m_actual_size);
+ other.notify_arbitrary(other.m_actual_size);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+join(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ const size_type len = m_size + other.m_size;
+ const size_type actual_size = resize_policy::get_new_size_for_arbitrary(len);
+
+ entry_pointer a_entries = NULL;
+ entry_pointer a_other_entries = NULL;
+
+ __try
+ {
+ a_entries = s_entry_allocator.allocate(actual_size);
+ a_other_entries = s_entry_allocator.allocate(resize_policy::min_size);
+ }
+ __catch(...)
+ {
+ if (a_entries != NULL)
+ s_entry_allocator.deallocate(a_entries, actual_size);
+
+ if (a_other_entries != NULL)
+ s_entry_allocator.deallocate(a_other_entries, resize_policy::min_size);
+
+ __throw_exception_again;
+ }
+
+ std::copy(m_a_entries, m_a_entries + m_size, a_entries);
+ std::copy(other.m_a_entries, other.m_a_entries + other.m_size, a_entries + m_size);
+
+ s_entry_allocator.deallocate(m_a_entries, m_actual_size);
+ m_a_entries = a_entries;
+ m_size = len;
+ m_actual_size = actual_size;
+
+ resize_policy::notify_arbitrary(actual_size);
+
+ std::make_heap(m_a_entries, m_a_entries + m_size, static_cast<entry_cmp& >(*this));
+
+ s_entry_allocator.deallocate(other.m_a_entries, other.m_actual_size);
+ other.m_a_entries = a_other_entries;
+ other.m_size = 0;
+ other.m_actual_size = resize_policy::min_size;
+
+ other.notify_arbitrary(resize_policy::min_size);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/trace_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/trace_fn_imps.hpp
new file mode 100644
index 0000000..36bd66f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binary_heap_/trace_fn_imps.hpp
@@ -0,0 +1,78 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trace_fn_imps.hpp
+ * Contains an implementation class for a binary_heap.
+ */
+
+#ifdef PB_DS_BINARY_HEAP_TRACE_
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace() const
+{
+ std::cerr << this << std::endl;
+
+ std::cerr << m_a_entries << std::endl;
+
+ for (size_type i = 0; i < m_size; ++i)
+ trace_entry(m_a_entries[i], s_no_throw_copies_ind);
+
+ std::cerr << std::endl;
+
+ std::cerr << "size = " << m_size << " " << "actual_size = " << m_actual_size << std::endl;
+
+ resize_policy::trace();
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace_entry(const entry& r_e, false_type) const
+{
+ std::cout << r_e << " " <<* r_e << std::endl;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace_entry(const entry& r_e, true_type) const
+{
+ std::cout << r_e << std::endl;
+}
+
+#endif // #ifdef PB_DS_BINARY_HEAP_TRACE_
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp
new file mode 100644
index 0000000..3b4d6e9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp
@@ -0,0 +1,116 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file binomial_heap_.hpp
+ * Contains an implementation class for a binomial heap.
+ */
+
+/*
+ * Binomial heap.
+ * Vuillemin J is the mastah.
+ * Modified from CLRS.
+ */
+
+#include <debug/debug.h>
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ binomial_heap_<Value_Type, Cmp_Fn, Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ binomial_heap_base_<Value_Type, Cmp_Fn, Allocator>
+
+ /**
+ * class description = "8y|\|0|\/|i41 h34p 74813">
+ **/
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+ class binomial_heap_ : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+ typedef typename base_type::node_pointer node_pointer;
+ typedef typename base_type::const_node_pointer const_node_pointer;
+
+ public:
+ typedef Value_Type value_type;
+ typedef typename Allocator::size_type size_type;
+ typedef typename Allocator::difference_type difference_type;
+ typedef typename base_type::pointer pointer;
+ typedef typename base_type::const_pointer const_pointer;
+ typedef typename base_type::reference reference;
+ typedef typename base_type::const_reference const_reference;
+ typedef typename base_type::const_point_iterator const_point_iterator;
+ typedef typename base_type::point_iterator point_iterator;
+ typedef typename base_type::const_iterator const_iterator;
+ typedef typename base_type::iterator iterator;
+ typedef typename base_type::cmp_fn cmp_fn;
+ typedef typename base_type::allocator_type allocator_type;
+
+ binomial_heap_();
+
+ binomial_heap_(const Cmp_Fn& r_cmp_fn);
+
+ binomial_heap_(const PB_DS_CLASS_C_DEC& other);
+
+ ~binomial_heap_();
+
+ protected:
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+ };
+
+#include <ext/pb_ds/detail/binomial_heap_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+
+#undef PB_DS_CLASS_T_DEC
+
+#undef PB_DS_BASE_C_DEC
+ } // namespace detail
+} // namespace __gnu_pbds
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_/constructors_destructor_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..ef0937e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,61 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation for binomial_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+binomial_heap_()
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+binomial_heap_(const Cmp_Fn& r_cmp_fn) :
+ PB_DS_BASE_C_DEC(r_cmp_fn)
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+binomial_heap_(const PB_DS_CLASS_C_DEC& other) :
+ PB_DS_BASE_C_DEC(other)
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~binomial_heap_() { }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp
new file mode 100644
index 0000000..10bec69
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp
@@ -0,0 +1,49 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation for binomial_heap_.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{ base_type::assert_valid(true); }
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp
new file mode 100644
index 0000000..1d66d1b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp
@@ -0,0 +1,234 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file binomial_heap_base_.hpp
+ * Contains an implementation class for a base of binomial heaps.
+ */
+
+#ifndef PB_DS_BINOMIAL_HEAP_BASE_HPP
+#define PB_DS_BINOMIAL_HEAP_BASE_HPP
+
+/*
+ * Binomial heap base.
+ * Vuillemin J is the mastah.
+ * Modified from CLRS.
+ */
+
+#include <debug/debug.h>
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ binomial_heap_base_<Value_Type, Cmp_Fn, Allocator>
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_BASE_C_DEC \
+ left_child_next_sibling_heap_<Value_Type, Cmp_Fn, \
+ typename Allocator::size_type, \
+ Allocator, false>
+#else
+#define PB_DS_BASE_C_DEC \
+ left_child_next_sibling_heap_<Value_Type, Cmp_Fn, \
+ typename Allocator::size_type, Allocator>
+#endif
+
+ /**
+ * class description = "8y|\|0|\/|i41 h34p 74813">
+ **/
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+ class binomial_heap_base_ : public PB_DS_BASE_C_DEC
+ {
+
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ protected:
+ typedef typename base_type::node node;
+
+ typedef typename base_type::node_pointer node_pointer;
+
+ typedef typename base_type::const_node_pointer const_node_pointer;
+
+ public:
+
+ typedef typename Allocator::size_type size_type;
+
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef Value_Type value_type;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::pointer
+ pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_pointer
+ const_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::reference
+ reference;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_reference
+ const_reference;
+
+ typedef
+ typename PB_DS_BASE_C_DEC::const_point_iterator
+ const_point_iterator;
+
+ typedef typename PB_DS_BASE_C_DEC::point_iterator point_iterator;
+
+ typedef typename PB_DS_BASE_C_DEC::const_iterator const_iterator;
+
+ typedef typename PB_DS_BASE_C_DEC::iterator iterator;
+
+ typedef Cmp_Fn cmp_fn;
+
+ typedef Allocator allocator_type;
+
+ public:
+
+ inline point_iterator
+ push(const_reference r_val);
+
+ void
+ modify(point_iterator it, const_reference r_new_val);
+
+ inline const_reference
+ top() const;
+
+ void
+ pop();
+
+ void
+ erase(point_iterator it);
+
+ inline void
+ clear();
+
+ template<typename Pred>
+ size_type
+ erase_if(Pred pred);
+
+ template<typename Pred>
+ void
+ split(Pred pred, PB_DS_CLASS_C_DEC& other);
+
+ void
+ join(PB_DS_CLASS_C_DEC& other);
+
+ protected:
+
+ binomial_heap_base_();
+
+ binomial_heap_base_(const Cmp_Fn& r_cmp_fn);
+
+ binomial_heap_base_(const PB_DS_CLASS_C_DEC& other);
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ ~binomial_heap_base_();
+
+ template<typename It>
+ void
+ copy_from_range(It first_it, It last_it);
+
+ inline void
+ find_max();
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid(bool strictly_binomial) const;
+
+ void
+ assert_max() const;
+#endif
+
+ private:
+
+ inline node_pointer
+ fix(node_pointer p_nd) const;
+
+ inline void
+ insert_node(node_pointer p_nd);
+
+ inline void
+ remove_parentless_node(node_pointer p_nd);
+
+ inline node_pointer
+ join(node_pointer p_lhs, node_pointer p_rhs) const;
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_node_consistent(const_node_pointer, bool, bool) const;
+#endif
+
+ protected:
+ node_pointer m_p_max;
+ };
+
+#include <ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp>
+#include <ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_BASE_C_DEC
+
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..274c933
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,97 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation class for a base of binomial heaps.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+ while (first_it != last_it)
+ push(*(first_it++));
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid(false);)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+binomial_heap_base_() :
+ m_p_max(NULL)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(false);)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+binomial_heap_base_(const Cmp_Fn& r_cmp_fn) :
+ PB_DS_BASE_C_DEC(r_cmp_fn),
+ m_p_max(NULL)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(false);)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+binomial_heap_base_(const PB_DS_CLASS_C_DEC& other) :
+ PB_DS_BASE_C_DEC(other),
+ m_p_max(NULL)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(false);)
+ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(false);)
+
+ base_type::swap(other);
+
+ std::swap(m_p_max, other.m_p_max);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid(false);)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~binomial_heap_base_()
+{ }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp
new file mode 100644
index 0000000..9a07f0e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp
@@ -0,0 +1,98 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation class for a base of binomial heaps.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid(bool strictly_binomial) const
+{
+ base_type::assert_valid();
+ assert_node_consistent(base_type::m_p_root, strictly_binomial, true);
+ assert_max();
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_max() const
+{
+ if (m_p_max == NULL)
+ return;
+ _GLIBCXX_DEBUG_ASSERT(base_type::parent(m_p_max) == NULL);
+ for (const_iterator it = base_type::begin(); it != base_type::end(); ++it)
+ _GLIBCXX_DEBUG_ASSERT(!Cmp_Fn::operator()(m_p_max->m_value,
+ it.m_p_nd->m_value));
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_node_consistent(const_node_pointer p_nd, bool strictly_binomial,
+ bool increasing) const
+{
+ _GLIBCXX_DEBUG_ASSERT(increasing || strictly_binomial);
+ base_type::assert_node_consistent(p_nd, false);
+ if (p_nd == NULL)
+ return;
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata == base_type::degree(p_nd));
+ _GLIBCXX_DEBUG_ASSERT(base_type::size_under_node(p_nd) ==
+ static_cast<size_type>(1 << p_nd->m_metadata));
+ assert_node_consistent(p_nd->m_p_next_sibling, strictly_binomial, increasing);
+ assert_node_consistent(p_nd->m_p_l_child, true, false);
+ if (p_nd->m_p_next_sibling != NULL)
+ {
+ if (increasing)
+ {
+ if (strictly_binomial)
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata
+ < p_nd->m_p_next_sibling->m_metadata);
+ else
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata
+ <= p_nd->m_p_next_sibling->m_metadata);
+ }
+ else
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata
+ > p_nd->m_p_next_sibling->m_metadata);
+ }
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp
new file mode 100644
index 0000000..a4cf90c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp
@@ -0,0 +1,192 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation class for a base of binomial heaps.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+pop()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+
+ if (m_p_max == NULL)
+ find_max();
+
+ _GLIBCXX_DEBUG_ASSERT(m_p_max != NULL);
+
+ node_pointer p_nd = m_p_max;
+
+ remove_parentless_node(m_p_max);
+
+ base_type::actual_erase_node(p_nd);
+
+ m_p_max = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+remove_parentless_node(node_pointer p_nd)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+ _GLIBCXX_DEBUG_ASSERT(base_type::parent(p_nd) == NULL);
+
+ node_pointer p_cur_root = p_nd == base_type::m_p_root?
+ p_nd->m_p_next_sibling :
+ base_type::m_p_root;
+
+ if (p_cur_root != NULL)
+ p_cur_root->m_p_prev_or_parent = NULL;
+
+ if (p_nd->m_p_prev_or_parent != NULL)
+ p_nd->m_p_prev_or_parent->m_p_next_sibling = p_nd->m_p_next_sibling;
+
+ if (p_nd->m_p_next_sibling != NULL)
+ p_nd->m_p_next_sibling->m_p_prev_or_parent = p_nd->m_p_prev_or_parent;
+
+ node_pointer p_child = p_nd->m_p_l_child;
+
+ if (p_child != NULL)
+ {
+ p_child->m_p_prev_or_parent = NULL;
+
+ while (p_child->m_p_next_sibling != NULL)
+ p_child = p_child->m_p_next_sibling;
+ }
+
+ m_p_max = NULL;
+
+ base_type::m_p_root = join(p_cur_root, p_child);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ base_type::clear();
+
+ m_p_max = NULL;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase(point_iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+
+ base_type::bubble_to_top(it.m_p_nd);
+
+ remove_parentless_node(it.m_p_nd);
+
+ base_type::actual_erase_node(it.m_p_nd);
+
+ m_p_max = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ }
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+
+ if (base_type::empty())
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+
+ return 0;
+ }
+
+ base_type::to_linked_list();
+
+ node_pointer p_out = base_type::prune(pred);
+
+ size_type ersd = 0;
+
+ while (p_out != NULL)
+ {
+ ++ersd;
+
+ node_pointer p_next = p_out->m_p_next_sibling;
+
+ base_type::actual_erase_node(p_out);
+
+ p_out = p_next;
+ }
+
+ node_pointer p_cur = base_type::m_p_root;
+
+ base_type::m_p_root = NULL;
+
+ while (p_cur != NULL)
+ {
+ node_pointer p_next = p_cur->m_p_next_sibling;
+
+ p_cur->m_p_l_child = p_cur->m_p_prev_or_parent = NULL;
+
+ p_cur->m_metadata = 0;
+
+ p_cur->m_p_next_sibling = base_type::m_p_root;
+
+ if (base_type::m_p_root != NULL)
+ base_type::m_p_root->m_p_prev_or_parent = p_cur;
+
+ base_type::m_p_root = p_cur;
+
+ base_type::m_p_root = fix(base_type::m_p_root);
+
+ p_cur = p_next;
+ }
+
+ m_p_max = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+
+ return ersd;
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp
new file mode 100644
index 0000000..ad7f651
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains an implementation class for a base of binomial heaps.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reference
+PB_DS_CLASS_C_DEC::
+top() const
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(false);)
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+
+ if (m_p_max == NULL)
+ const_cast<PB_DS_CLASS_C_DEC* >(this)->find_max();
+
+ _GLIBCXX_DEBUG_ASSERT(m_p_max != NULL);
+ return m_p_max->m_value;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+find_max()
+{
+ node_pointer p_cur = base_type::m_p_root;
+
+ m_p_max = p_cur;
+
+ while (p_cur != NULL)
+ {
+ if (Cmp_Fn::operator()(m_p_max->m_value, p_cur->m_value))
+ m_p_max = p_cur;
+
+ p_cur = p_cur->m_p_next_sibling;
+ }
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp
new file mode 100644
index 0000000..e67d0df
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp
@@ -0,0 +1,216 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains an implementation class for a base of binomial heaps.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+push(const_reference r_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+
+ node_pointer p_nd = base_type::get_new_node_for_insert(r_val);
+
+ insert_node(p_nd);
+
+ m_p_max = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+
+ return point_iterator(p_nd);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+insert_node(node_pointer p_nd)
+{
+ if (base_type::m_p_root == NULL)
+ {
+ p_nd->m_p_next_sibling = p_nd->m_p_prev_or_parent =
+ p_nd->m_p_l_child = NULL;
+
+ p_nd->m_metadata = 0;
+
+ base_type::m_p_root = p_nd;
+
+ return;
+ }
+
+ if (base_type::m_p_root->m_metadata > 0)
+ {
+ p_nd->m_p_prev_or_parent = p_nd->m_p_l_child = NULL;
+
+ p_nd->m_p_next_sibling = base_type::m_p_root;
+
+ base_type::m_p_root->m_p_prev_or_parent = p_nd;
+
+ base_type::m_p_root = p_nd;
+
+ p_nd->m_metadata = 0;
+
+ return;
+ }
+
+ if (Cmp_Fn::operator()(base_type::m_p_root->m_value, p_nd->m_value))
+ {
+ p_nd->m_p_next_sibling = base_type::m_p_root->m_p_next_sibling;
+
+ p_nd->m_p_prev_or_parent = NULL;
+
+ p_nd->m_metadata = 1;
+
+ p_nd->m_p_l_child = base_type::m_p_root;
+
+ base_type::m_p_root->m_p_prev_or_parent = p_nd;
+
+ base_type::m_p_root->m_p_next_sibling = NULL;
+
+ base_type::m_p_root = p_nd;
+ }
+ else
+ {
+ p_nd->m_p_next_sibling = NULL;
+
+ p_nd->m_p_l_child = NULL;
+
+ p_nd->m_p_prev_or_parent = base_type::m_p_root;
+
+ p_nd->m_metadata = 0;
+
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_p_root->m_p_l_child == 0);
+ base_type::m_p_root->m_p_l_child = p_nd;
+
+ base_type::m_p_root->m_metadata = 1;
+ }
+
+ base_type::m_p_root = fix(base_type::m_p_root);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+fix(node_pointer p_nd) const
+{
+ while (p_nd->m_p_next_sibling != NULL&&
+ p_nd->m_metadata == p_nd->m_p_next_sibling->m_metadata)
+ {
+ node_pointer p_next = p_nd->m_p_next_sibling;
+
+ if (Cmp_Fn::operator()(p_nd->m_value, p_next->m_value))
+ {
+ p_next->m_p_prev_or_parent =
+ p_nd->m_p_prev_or_parent;
+
+ if (p_nd->m_p_prev_or_parent != NULL)
+ p_nd->m_p_prev_or_parent->m_p_next_sibling = p_next;
+
+ base_type::make_child_of(p_nd, p_next);
+
+ ++p_next->m_metadata;
+
+ p_nd = p_next;
+ }
+ else
+ {
+ p_nd->m_p_next_sibling = p_next->m_p_next_sibling;
+
+ if (p_nd->m_p_next_sibling != NULL)
+ p_next->m_p_next_sibling = NULL;
+
+ base_type::make_child_of(p_next, p_nd);
+
+ ++p_nd->m_metadata;
+ }
+ }
+
+ if (p_nd->m_p_next_sibling != NULL)
+ p_nd->m_p_next_sibling->m_p_prev_or_parent = p_nd;
+
+ return p_nd;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+modify(point_iterator it, const_reference r_new_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ node_pointer p_nd = it.m_p_nd;
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd, false);)
+
+ const bool bubble_up = Cmp_Fn::operator()(p_nd->m_value, r_new_val);
+
+ p_nd->m_value = r_new_val;
+
+ if (bubble_up)
+ {
+ node_pointer p_parent = base_type::parent(p_nd);
+
+ while (p_parent != NULL&&
+ Cmp_Fn::operator()(p_parent->m_value, p_nd->m_value))
+ {
+ base_type::swap_with_parent(p_nd, p_parent);
+
+ p_parent = base_type::parent(p_nd);
+ }
+
+ if (p_nd->m_p_prev_or_parent == NULL)
+ base_type::m_p_root = p_nd;
+
+ m_p_max = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+
+ return;
+ }
+
+ base_type::bubble_to_top(p_nd);
+
+ remove_parentless_node(p_nd);
+
+ insert_node(p_nd);
+
+ m_p_max = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp
new file mode 100644
index 0000000..a701937
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp
@@ -0,0 +1,232 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_join_fn_imps.hpp
+ * Contains an implementation class for a base of binomial heaps.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+void
+PB_DS_CLASS_C_DEC::
+split(Pred pred, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(true);)
+
+ other.clear();
+
+ if (base_type::empty())
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(true);)
+
+ return;
+ }
+
+ base_type::to_linked_list();
+
+ node_pointer p_out = base_type::prune(pred);
+
+ while (p_out != NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_size > 0);
+ --base_type::m_size;
+
+ ++other.m_size;
+
+ node_pointer p_next = p_out->m_p_next_sibling;
+
+ p_out->m_p_l_child = p_out->m_p_prev_or_parent = NULL;
+
+ p_out->m_metadata = 0;
+
+ p_out->m_p_next_sibling = other.m_p_root;
+
+ if (other.m_p_root != NULL)
+ other.m_p_root->m_p_prev_or_parent = p_out;
+
+ other.m_p_root = p_out;
+
+ other.m_p_root = other.fix(other.m_p_root);
+
+ p_out = p_next;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(true);)
+
+ node_pointer p_cur = base_type::m_p_root;
+
+ base_type::m_p_root = NULL;
+
+ while (p_cur != NULL)
+ {
+ node_pointer p_next = p_cur->m_p_next_sibling;
+
+ p_cur->m_p_l_child = p_cur->m_p_prev_or_parent = NULL;
+
+ p_cur->m_metadata = 0;
+
+ p_cur->m_p_next_sibling = base_type::m_p_root;
+
+ if (base_type::m_p_root != NULL)
+ base_type::m_p_root->m_p_prev_or_parent = p_cur;
+
+ base_type::m_p_root = p_cur;
+
+ base_type::m_p_root = fix(base_type::m_p_root);
+
+ p_cur = p_next;
+ }
+
+ m_p_max = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(true);)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+join(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(true);)
+
+ node_pointer p_other = other.m_p_root;
+
+ if (p_other != NULL)
+ do
+ {
+ node_pointer p_next = p_other->m_p_next_sibling;
+
+ std::swap(p_other->m_p_next_sibling, p_other->m_p_prev_or_parent);
+
+ p_other = p_next;
+ }
+ while (p_other != NULL);
+
+ base_type::m_p_root = join(base_type::m_p_root, other.m_p_root);
+ base_type::m_size += other.m_size;
+ m_p_max = NULL;
+
+ other.m_p_root = NULL;
+ other.m_size = 0;
+ other.m_p_max = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true);)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(true);)
+ }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+join(node_pointer p_lhs, node_pointer p_rhs) const
+{
+ node_pointer p_ret = NULL;
+
+ node_pointer p_cur = NULL;
+
+ while (p_lhs != NULL || p_rhs != NULL)
+ {
+ if (p_rhs == NULL)
+ {
+ if (p_cur == NULL)
+ p_ret = p_cur = p_lhs;
+ else
+ {
+ p_cur->m_p_next_sibling = p_lhs;
+
+ p_lhs->m_p_prev_or_parent = p_cur;
+ }
+
+ p_cur = p_lhs = NULL;
+ }
+ else if (p_lhs == NULL || p_rhs->m_metadata < p_lhs->m_metadata)
+ {
+ if (p_cur == NULL)
+ {
+ p_ret = p_cur = p_rhs;
+
+ p_rhs = p_rhs->m_p_prev_or_parent;
+ }
+ else
+ {
+ p_cur->m_p_next_sibling = p_rhs;
+
+ p_rhs = p_rhs->m_p_prev_or_parent;
+
+ p_cur->m_p_next_sibling->m_p_prev_or_parent = p_cur;
+
+ p_cur = p_cur->m_p_next_sibling;
+ }
+ }
+ else if (p_lhs->m_metadata < p_rhs->m_metadata)
+ {
+ if (p_cur == NULL)
+ p_ret = p_cur = p_lhs;
+ else
+ {
+ p_cur->m_p_next_sibling = p_lhs;
+
+ p_lhs->m_p_prev_or_parent = p_cur;
+
+ p_cur = p_cur->m_p_next_sibling;
+ }
+
+ p_lhs = p_cur->m_p_next_sibling;
+ }
+ else
+ {
+ node_pointer p_next_rhs = p_rhs->m_p_prev_or_parent;
+
+ p_rhs->m_p_next_sibling = p_lhs;
+
+ p_lhs = fix(p_rhs);
+
+ p_rhs = p_next_rhs;
+ }
+ }
+
+ if (p_cur != NULL)
+ p_cur->m_p_next_sibling = NULL;
+
+ if (p_ret != NULL)
+ p_ret->m_p_prev_or_parent = NULL;
+
+ return p_ret;
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp
new file mode 100644
index 0000000..f5efabe
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp
@@ -0,0 +1,636 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file cc_ht_map_.hpp
+ * Contains an implementation class for cc_ht_map_.
+ */
+
+#include <utility>
+#include <iterator>
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp>
+#include <ext/pb_ds/detail/types_traits.hpp>
+#include <ext/pb_ds/exception.hpp>
+#include <ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp>
+#ifdef _GLIBCXX_DEBUG
+#include <ext/pb_ds/detail/debug_map_base.hpp>
+#endif
+#ifdef PB_DS_HT_MAP_TRACE_
+#include <iostream>
+#endif
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Mapped, typename Hash_Fn, \
+ typename Eq_Fn, typename Allocator, bool Store_Hash, \
+ typename Comb_Hash_Fn, typename Resize_Policy>
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_CLASS_NAME cc_ht_map_data_
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_CLASS_NAME cc_ht_map_no_data_
+#endif
+
+#define PB_DS_CLASS_C_DEC \
+ PB_DS_CLASS_NAME<Key, Mapped, Hash_Fn, Eq_Fn, Allocator, \
+ Store_Hash, Comb_Hash_Fn, Resize_Policy>
+
+#define PB_DS_HASH_EQ_FN_C_DEC \
+ hash_eq_fn<Key, Eq_Fn, Allocator, Store_Hash>
+
+#define PB_DS_RANGED_HASH_FN_C_DEC \
+ ranged_hash_fn<Key, Hash_Fn, Allocator, Comb_Hash_Fn, Store_Hash>
+
+#define PB_DS_TYPES_TRAITS_C_DEC \
+ types_traits<Key, Mapped, Allocator, Store_Hash>
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_DEBUG_MAP_BASE_C_DEC \
+ debug_map_base<Key, Eq_Fn, typename Allocator::template rebind<Key>::other::const_reference>
+#endif
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_V2F(X) (X).first
+#define PB_DS_V2S(X) (X).second
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_V2F(X) (X)
+#define PB_DS_V2S(X) Mapped_Data()
+#endif
+
+ // <011i$i0|\|-<|-|4i|\|i|\|g |-|4$|-| 74813.
+ template<typename Key,
+ typename Mapped,
+ typename Hash_Fn,
+ typename Eq_Fn,
+ typename Allocator,
+ bool Store_Hash,
+ typename Comb_Hash_Fn,
+ typename Resize_Policy >
+ class PB_DS_CLASS_NAME:
+#ifdef _GLIBCXX_DEBUG
+ protected PB_DS_DEBUG_MAP_BASE_C_DEC,
+#endif
+ public PB_DS_HASH_EQ_FN_C_DEC,
+ public Resize_Policy,
+ public PB_DS_RANGED_HASH_FN_C_DEC,
+ public PB_DS_TYPES_TRAITS_C_DEC
+ {
+ private:
+ typedef PB_DS_TYPES_TRAITS_C_DEC traits_base;
+ typedef typename traits_base::comp_hash comp_hash;
+ typedef typename traits_base::value_type value_type_;
+ typedef typename traits_base::pointer pointer_;
+ typedef typename traits_base::const_pointer const_pointer_;
+ typedef typename traits_base::reference reference_;
+ typedef typename traits_base::const_reference const_reference_;
+
+ struct entry : public traits_base::stored_value_type
+ {
+ typename Allocator::template rebind<entry>::other::pointer m_p_next;
+ };
+
+ typedef cond_dealtor<entry, Allocator> cond_dealtor_t;
+
+ typedef typename Allocator::template rebind<entry>::other entry_allocator;
+ typedef typename entry_allocator::pointer entry_pointer;
+ typedef typename entry_allocator::const_pointer const_entry_pointer;
+ typedef typename entry_allocator::reference entry_reference;
+ typedef typename entry_allocator::const_reference const_entry_reference;
+
+ typedef typename Allocator::template rebind<entry_pointer>::other entry_pointer_allocator;
+ typedef typename entry_pointer_allocator::pointer entry_pointer_array;
+
+ typedef PB_DS_RANGED_HASH_FN_C_DEC ranged_hash_fn_base;
+ typedef PB_DS_HASH_EQ_FN_C_DEC hash_eq_fn_base;
+ typedef Resize_Policy resize_base;
+
+#ifdef _GLIBCXX_DEBUG
+ typedef PB_DS_DEBUG_MAP_BASE_C_DEC debug_base;
+#endif
+
+#define PB_DS_GEN_POS std::pair<entry_pointer, typename Allocator::size_type>
+
+#include <ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp>
+#include <ext/pb_ds/detail/unordered_iterator/point_iterator.hpp>
+#include <ext/pb_ds/detail/unordered_iterator/const_iterator.hpp>
+#include <ext/pb_ds/detail/unordered_iterator/iterator.hpp>
+
+#undef PB_DS_GEN_POS
+
+ public:
+ typedef Allocator allocator_type;
+ typedef typename Allocator::size_type size_type;
+ typedef typename Allocator::difference_type difference_type;
+ typedef Hash_Fn hash_fn;
+ typedef Eq_Fn eq_fn;
+ typedef Comb_Hash_Fn comb_hash_fn;
+ typedef Resize_Policy resize_policy;
+
+ enum
+ {
+ store_hash = Store_Hash
+ };
+
+ typedef typename traits_base::key_type key_type;
+ typedef typename traits_base::key_pointer key_pointer;
+ typedef typename traits_base::const_key_pointer const_key_pointer;
+ typedef typename traits_base::key_reference key_reference;
+ typedef typename traits_base::const_key_reference const_key_reference;
+ typedef typename traits_base::mapped_type mapped_type;
+ typedef typename traits_base::mapped_pointer mapped_pointer;
+ typedef typename traits_base::const_mapped_pointer const_mapped_pointer;
+ typedef typename traits_base::mapped_reference mapped_reference;
+ typedef typename traits_base::const_mapped_reference const_mapped_reference;
+ typedef typename traits_base::value_type value_type;
+ typedef typename traits_base::pointer pointer;
+ typedef typename traits_base::const_pointer const_pointer;
+ typedef typename traits_base::reference reference;
+ typedef typename traits_base::const_reference const_reference;
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ typedef point_iterator_ point_iterator;
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+ typedef const_point_iterator_ point_iterator;
+#endif
+
+ typedef const_point_iterator_ const_point_iterator;
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ typedef iterator_ iterator;
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+ typedef const_iterator_ iterator;
+#endif
+
+ typedef const_iterator_ const_iterator;
+
+ PB_DS_CLASS_NAME();
+
+ PB_DS_CLASS_NAME(const Hash_Fn&);
+
+ PB_DS_CLASS_NAME(const Hash_Fn&, const Eq_Fn&);
+
+ PB_DS_CLASS_NAME(const Hash_Fn&, const Eq_Fn&, const Comb_Hash_Fn&);
+
+ PB_DS_CLASS_NAME(const Hash_Fn&, const Eq_Fn&, const Comb_Hash_Fn&,
+ const Resize_Policy&);
+
+ PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC&);
+
+ virtual
+ ~PB_DS_CLASS_NAME();
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+
+ template<typename It>
+ void
+ copy_from_range(It, It);
+
+ void
+ initialize();
+
+ inline size_type
+ size() const;
+
+ inline size_type
+ max_size() const;
+
+ inline bool
+ empty() const;
+
+ Hash_Fn&
+ get_hash_fn();
+
+ const Hash_Fn&
+ get_hash_fn() const;
+
+ Eq_Fn&
+ get_eq_fn();
+
+ const Eq_Fn&
+ get_eq_fn() const;
+
+ Comb_Hash_Fn&
+ get_comb_hash_fn();
+
+ const Comb_Hash_Fn&
+ get_comb_hash_fn() const;
+
+ Resize_Policy&
+ get_resize_policy();
+
+ const Resize_Policy&
+ get_resize_policy() const;
+
+ inline std::pair<point_iterator, bool>
+ insert(const_reference r_val)
+ { return insert_imp(r_val, traits_base::m_store_extra_indicator); }
+
+ inline mapped_reference
+ operator[](const_key_reference r_key)
+ {
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ return (subscript_imp(r_key, traits_base::m_store_extra_indicator));
+#else
+ insert(r_key);
+ return traits_base::s_null_mapped;
+#endif
+ }
+
+ inline point_iterator
+ find(const_key_reference);
+
+ inline const_point_iterator
+ find(const_key_reference) const;
+
+ inline point_iterator
+ find_end();
+
+ inline const_point_iterator
+ find_end() const;
+
+ inline bool
+ erase(const_key_reference);
+
+ template<typename Pred>
+ inline size_type
+ erase_if(Pred);
+
+ void
+ clear();
+
+ inline iterator
+ begin();
+
+ inline const_iterator
+ begin() const;
+
+ inline iterator
+ end();
+
+ inline const_iterator
+ end() const;
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+
+#ifdef PB_DS_HT_MAP_TRACE_
+ void
+ trace() const;
+#endif
+
+ private:
+ void
+ deallocate_all();
+
+ inline bool
+ do_resize_if_needed();
+
+ inline void
+ do_resize_if_needed_no_throw();
+
+ void
+ resize_imp(size_type new_size);
+
+ void
+ do_resize(size_type new_size);
+
+ void
+ resize_imp_no_exceptions(size_type, entry_pointer_array, size_type);
+
+ inline entry_pointer
+ resize_imp_no_exceptions_reassign_pointer(entry_pointer, entry_pointer_array, false_type);
+
+ inline entry_pointer
+ resize_imp_no_exceptions_reassign_pointer(entry_pointer, entry_pointer_array, true_type);
+
+ void
+ deallocate_links_in_list(entry_pointer);
+
+ inline entry_pointer
+ get_entry(const_reference, false_type);
+
+ inline entry_pointer
+ get_entry(const_reference, true_type);
+
+ inline void
+ rels_entry(entry_pointer);
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ inline mapped_reference
+ subscript_imp(const_key_reference r_key, false_type)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ const size_type pos = ranged_hash_fn_base::operator()(r_key);
+ entry_pointer p_e = m_entries[pos];
+ resize_base::notify_insert_search_start();
+
+ while (p_e != NULL
+ && !hash_eq_fn_base::operator()(p_e->m_value.first, r_key))
+ {
+ resize_base::notify_insert_search_collision();
+ p_e = p_e->m_p_next;
+ }
+
+ resize_base::notify_insert_search_end();
+ if (p_e != NULL)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);)
+ return (p_e->m_value.second);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ return insert_new_imp(value_type(r_key, mapped_type()), pos)->second;
+ }
+
+ inline mapped_reference
+ subscript_imp(const_key_reference r_key, true_type)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ comp_hash pos_hash_pair = ranged_hash_fn_base::operator()(r_key);
+ entry_pointer p_e = m_entries[pos_hash_pair.first];
+ resize_base::notify_insert_search_start();
+ while (p_e != NULL &&
+ !hash_eq_fn_base::operator()(p_e->m_value.first, p_e->m_hash, r_key, pos_hash_pair.second))
+ {
+ resize_base::notify_insert_search_collision();
+ p_e = p_e->m_p_next;
+ }
+
+ resize_base::notify_insert_search_end();
+ if (p_e != NULL)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);)
+ return p_e->m_value.second;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ return insert_new_imp(value_type(r_key, mapped_type()),
+ pos_hash_pair)->second;
+ }
+#endif
+
+ inline std::pair<point_iterator, bool>
+ insert_imp(const_reference, false_type);
+
+ inline std::pair<point_iterator, bool>
+ insert_imp(const_reference, true_type);
+
+ inline pointer
+ insert_new_imp(const_reference r_val, size_type pos)
+ {
+ if (do_resize_if_needed())
+ pos = ranged_hash_fn_base::operator()(PB_DS_V2F(r_val));
+
+ // Following lines might throw an exception.
+ entry_pointer p_e = get_entry(r_val, traits_base::m_no_throw_copies_indicator);
+
+ // At this point no exceptions can be thrown.
+ p_e->m_p_next = m_entries[pos];
+ m_entries[pos] = p_e;
+ resize_base::notify_inserted(++m_num_used_e);
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(r_val));)
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return &p_e->m_value;
+ }
+
+ inline pointer
+ insert_new_imp(const_reference r_val, comp_hash& r_pos_hash_pair)
+ {
+ // Following lines might throw an exception.
+ if (do_resize_if_needed())
+ r_pos_hash_pair = ranged_hash_fn_base::operator()(PB_DS_V2F(r_val));
+
+ entry_pointer p_e = get_entry(r_val, traits_base::m_no_throw_copies_indicator);
+
+ // At this point no exceptions can be thrown.
+ p_e->m_hash = r_pos_hash_pair.second;
+ p_e->m_p_next = m_entries[r_pos_hash_pair.first];
+ m_entries[r_pos_hash_pair.first] = p_e;
+ resize_base::notify_inserted(++m_num_used_e);
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(r_val));)
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return &p_e->m_value;
+ }
+
+ inline pointer
+ find_key_pointer(const_key_reference r_key, false_type)
+ {
+ entry_pointer p_e = m_entries[ranged_hash_fn_base::operator()(r_key)];
+ resize_base::notify_find_search_start();
+ while (p_e != NULL &&
+ !hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), r_key))
+ {
+ resize_base::notify_find_search_collision();
+ p_e = p_e->m_p_next;
+ }
+
+ resize_base::notify_find_search_end();
+
+#ifdef _GLIBCXX_DEBUG
+ if (p_e == NULL)
+ debug_base::check_key_does_not_exist(r_key);
+ else
+ debug_base::check_key_exists(r_key);
+#endif
+ return &p_e->m_value;
+ }
+
+ inline pointer
+ find_key_pointer(const_key_reference r_key, true_type)
+ {
+ comp_hash pos_hash_pair = ranged_hash_fn_base::operator()(r_key);
+ entry_pointer p_e = m_entries[pos_hash_pair.first];
+ resize_base::notify_find_search_start();
+ while (p_e != NULL &&
+ !hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value),
+ p_e->m_hash,
+ r_key, pos_hash_pair.second))
+ {
+ resize_base::notify_find_search_collision();
+ p_e = p_e->m_p_next;
+ }
+
+ resize_base::notify_find_search_end();
+
+#ifdef _GLIBCXX_DEBUG
+ if (p_e == NULL)
+ debug_base::check_key_does_not_exist(r_key);
+ else
+ debug_base::check_key_exists(r_key);
+#endif
+ return &p_e->m_value;
+ }
+
+ inline bool
+ erase_in_pos_imp(const_key_reference, size_type);
+
+ inline bool
+ erase_in_pos_imp(const_key_reference, const comp_hash&);
+
+ inline void
+ erase_entry_pointer(entry_pointer&);
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ void
+ inc_it_state(pointer& r_p_value,
+ std::pair<entry_pointer, size_type>& r_pos) const
+ {
+ inc_it_state((const_mapped_pointer& )r_p_value, r_pos);
+ }
+#endif
+
+ void
+ inc_it_state(const_pointer& r_p_value,
+ std::pair<entry_pointer, size_type>& r_pos) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(r_p_value != NULL);
+ r_pos.first = r_pos.first->m_p_next;
+ if (r_pos.first != NULL)
+ {
+ r_p_value = &r_pos.first->m_value;
+ return;
+ }
+
+ for (++r_pos.second; r_pos.second < m_num_e; ++r_pos.second)
+ if (m_entries[r_pos.second] != NULL)
+ {
+ r_pos.first = m_entries[r_pos.second];
+ r_p_value = &r_pos.first->m_value;
+ return;
+ }
+ r_p_value = NULL;
+ }
+
+ void
+ get_start_it_state(pointer& r_p_value,
+ std::pair<entry_pointer, size_type>& r_pos) const
+ {
+ for (r_pos.second = 0; r_pos.second < m_num_e; ++r_pos.second)
+ if (m_entries[r_pos.second] != NULL)
+ {
+ r_pos.first = m_entries[r_pos.second];
+ r_p_value = &r_pos.first->m_value;
+ return;
+ }
+ r_p_value = NULL;
+ }
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_entry_pointer_array_valid(const entry_pointer_array) const;
+
+ void
+ assert_entry_pointer_valid(const entry_pointer, true_type) const;
+
+ void
+ assert_entry_pointer_valid(const entry_pointer, false_type) const;
+#endif
+
+#ifdef PB_DS_HT_MAP_TRACE_
+ void
+ trace_list(const_entry_pointer) const;
+#endif
+
+ private:
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ friend class iterator_;
+#endif
+
+ friend class const_iterator_;
+
+ static entry_allocator s_entry_allocator;
+ static entry_pointer_allocator s_entry_pointer_allocator;
+ static iterator s_end_it;
+ static const_iterator s_const_end_it;
+ static point_iterator s_find_end_it;
+ static const_point_iterator s_const_find_end_it;
+
+ size_type m_num_e;
+ size_type m_num_used_e;
+ entry_pointer_array m_entries;
+
+ enum
+ {
+ store_hash_ok = !Store_Hash
+ || !is_same<Hash_Fn, __gnu_pbds::null_hash_fn>::value
+ };
+
+ PB_DS_STATIC_ASSERT(sth, store_hash_ok);
+ };
+
+#include <ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/policy_access_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/iterators_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_HASH_EQ_FN_C_DEC
+#undef PB_DS_RANGED_HASH_FN_C_DEC
+#undef PB_DS_TYPES_TRAITS_C_DEC
+#undef PB_DS_DEBUG_MAP_BASE_C_DEC
+#undef PB_DS_CLASS_NAME
+#undef PB_DS_V2F
+#undef PB_DS_V2S
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp
new file mode 100644
index 0000000..1a61893
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp
@@ -0,0 +1,83 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file cmp_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s entire container comparison related
+ * functions.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename Other_HT_Map_Type>
+bool
+PB_DS_CLASS_C_DEC::
+operator==(const Other_HT_Map_Type& other) const
+{ return cmp_with_other(other); }
+
+PB_DS_CLASS_T_DEC
+template<typename Other_Map_Type>
+bool
+PB_DS_CLASS_C_DEC::
+cmp_with_other(const Other_Map_Type& other) const
+{
+ if (size() != other.size())
+ return false;
+
+ for (typename Other_Map_Type::const_iterator it = other.begin();
+ it != other.end(); ++it)
+ {
+ const_key_reference r_key = const_key_reference(PB_DS_V2F(*it));
+
+ const_mapped_pointer p_mapped_value =
+ const_cast<PB_DS_CLASS_C_DEC& >(*this).
+ find_key_pointer(r_key, traits_base::m_store_extra_indicator);
+
+ if (p_mapped_value == NULL)
+ return false;
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ if (p_mapped_value->second != it->second)
+ return false;
+#endif
+ }
+ return true;
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Other_HT_Map_Type>
+bool
+PB_DS_CLASS_C_DEC::
+operator!=(const Other_HT_Map_Type& other) const
+{ return !operator==(other); }
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/cond_key_dtor_entry_dealtor.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/cond_key_dtor_entry_dealtor.hpp
new file mode 100644
index 0000000..fa3f31d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/cond_key_dtor_entry_dealtor.hpp
@@ -0,0 +1,117 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file cond_key_dtor_entry_dealtor.hpp
+ * Contains a conditional key destructor, used for exception handling.
+ */
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC template<typename HT_Map>
+#define PB_DS_CLASS_C_DEC PB_DS_CKDED_CLASS_NAME<HT_Map>
+
+ /**
+ * A conditional key destructor, used for exception handling.
+ **/
+ template<typename HT_Map>
+ class PB_DS_CKDED_CLASS_NAME
+ {
+ public:
+ typedef typename HT_Map::entry entry;
+ typedef typename HT_Map::entry_allocator entry_allocator;
+ typedef typename HT_Map::key_type key_type;
+
+ inline
+ PB_DS_CKDED_CLASS_NAME(entry_allocator* p_a, entry* p_e);
+
+ inline
+ ~PB_DS_CKDED_CLASS_NAME();
+
+ inline void
+ set_key_destruct();
+
+ inline void
+ set_no_action_destructor();
+
+ protected:
+ entry_allocator* const m_p_a;
+ entry* const m_p_e;
+
+ bool m_key_destruct;
+ bool m_no_action_destructor;
+ };
+
+ PB_DS_CLASS_T_DEC
+ inline
+ PB_DS_CLASS_C_DEC::
+ PB_DS_CKDED_CLASS_NAME(entry_allocator* p_a, entry* p_e)
+ : m_p_a(p_a), m_p_e(p_e), m_key_destruct(false),
+ m_no_action_destructor(false)
+ { }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ set_key_destruct()
+ { m_key_destruct = true; }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ set_no_action_destructor()
+ { m_no_action_destructor = true; }
+
+ PB_DS_CLASS_T_DEC
+ inline
+ PB_DS_CLASS_C_DEC::
+ ~PB_DS_CKDED_CLASS_NAME()
+ {
+ if (m_no_action_destructor)
+ return;
+ if (m_key_destruct)
+ m_p_e->m_value.first.~key_type();
+ m_p_a->deallocate(m_p_e, 1);
+ }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp
new file mode 100644
index 0000000..5711153
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp
@@ -0,0 +1,191 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructor_destructor_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s constructors, destructor,
+ * and related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::entry_allocator
+PB_DS_CLASS_C_DEC::s_entry_allocator;
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::entry_pointer_allocator
+PB_DS_CLASS_C_DEC::s_entry_pointer_allocator;
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+ while (first_it != last_it)
+ insert(*(first_it++));
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME() :
+ ranged_hash_fn_base(resize_base::get_nearest_larger_size(1)),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_pointer_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn) :
+ ranged_hash_fn_base(resize_base::get_nearest_larger_size(1), r_hash_fn),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_pointer_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn) :
+ PB_DS_HASH_EQ_FN_C_DEC(r_eq_fn),
+ ranged_hash_fn_base(resize_base::get_nearest_larger_size(1), r_hash_fn),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_pointer_allocator.allocate(m_num_e))
+{
+ std::fill(m_entries, m_entries + m_num_e, (entry_pointer)NULL);
+ Resize_Policy::notify_cleared();
+ ranged_hash_fn_base::notify_resized(m_num_e);
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn, const Comb_Hash_Fn& r_comb_hash_fn) :
+ PB_DS_HASH_EQ_FN_C_DEC(r_eq_fn),
+ ranged_hash_fn_base(resize_base::get_nearest_larger_size(1),
+ r_hash_fn, r_comb_hash_fn),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_pointer_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn, const Comb_Hash_Fn& r_comb_hash_fn, const Resize_Policy& r_resize_policy) :
+ PB_DS_HASH_EQ_FN_C_DEC(r_eq_fn),
+ Resize_Policy(r_resize_policy),
+ ranged_hash_fn_base(resize_base::get_nearest_larger_size(1),
+ r_hash_fn, r_comb_hash_fn),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_pointer_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) :
+#ifdef _GLIBCXX_DEBUG
+ debug_base(other),
+#endif
+ PB_DS_HASH_EQ_FN_C_DEC(other),
+ resize_base(other), ranged_hash_fn_base(other),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(m_entries = s_entry_pointer_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ __try
+ {
+ copy_from_range(other.begin(), other.end());
+ }
+ __catch(...)
+ {
+ deallocate_all();
+ __throw_exception_again;
+ }
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~PB_DS_CLASS_NAME()
+{ deallocate_all(); }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid());
+
+ std::swap(m_entries, other.m_entries);
+ std::swap(m_num_e, other.m_num_e);
+ std::swap(m_num_used_e, other.m_num_used_e);
+ ranged_hash_fn_base::swap(other);
+ hash_eq_fn_base::swap(other);
+ resize_base::swap(other);
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::swap(other));
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid());
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+deallocate_all()
+{
+ clear();
+ s_entry_pointer_allocator.deallocate(m_entries, m_num_e);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+initialize()
+{
+ std::fill(m_entries, m_entries + m_num_e, entry_pointer(NULL));
+ Resize_Policy::notify_resized(m_num_e);
+ Resize_Policy::notify_cleared();
+ ranged_hash_fn_base::notify_resized(m_num_e);
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..4f1cce6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructor_destructor_no_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s constructors, destructor,
+ * and related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+constructor_insert_new_imp(const_mapped_reference r_val, size_type pos,
+ false_type)
+{
+ // Following lines might throw an exception.
+ entry_pointer p = get_entry(r_val, traits_base::s_no_throw_copies_indicator);
+
+ // At this point no exceptions can be thrown.
+ p->m_p_next = m_entries[pos];
+ m_entries[pos] = p;
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(r_key);)
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..a2b6fa1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
@@ -0,0 +1,56 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructor_destructor_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s constructors, destructor,
+ * and related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+constructor_insert_new_imp(const_reference r_val, size_type pos, true_type)
+{
+ // Following lines might throw an exception.
+ entry_pointer p = get_entry(r_val, traits_base::s_no_throw_copies_indicator);
+
+ // At this point no exceptions can be thrown.
+ p->m_p_next = m_entries[pos];
+ p->m_hash = ranged_hash_fn_base::operator()((const_key_reference)(PB_DS_V2F(p->m_value))).second;
+
+ m_entries[pos] = p;
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(r_key);)
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp
new file mode 100644
index 0000000..4219eef
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp
@@ -0,0 +1,74 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s debug-mode functions.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ debug_base::check_size(m_num_used_e);
+ assert_entry_pointer_array_valid(m_entries);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_entry_pointer_array_valid(const entry_pointer_array a_p_entries) const
+{
+ size_type iterated_num_used_e = 0;
+ for (size_type pos = 0; pos < m_num_e; ++pos)
+ {
+ entry_pointer p_e = a_p_entries[pos];
+ while (p_e != NULL)
+ {
+ ++iterated_num_used_e;
+ assert_entry_pointer_valid(p_e, traits_base::m_store_extra_indicator);
+ p_e = p_e->m_p_next;
+ }
+ }
+ _GLIBCXX_DEBUG_ASSERT(iterated_num_used_e == m_num_used_e);
+}
+
+#include <ext/pb_ds/detail/cc_hash_table_map_/debug_store_hash_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/debug_no_store_hash_fn_imps.hpp>
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/debug_no_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/debug_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..770bed3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/debug_no_store_hash_fn_imps.hpp
@@ -0,0 +1,49 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_no_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s debug-mode functions.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_entry_pointer_valid(const entry_pointer p, false_type) const
+{ debug_base::check_key_exists(PB_DS_V2F(p->m_value)); }
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/debug_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/debug_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..3d17671
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/debug_store_hash_fn_imps.hpp
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s debug-mode functions.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_entry_pointer_valid(const entry_pointer p_e, true_type) const
+{
+ debug_base::check_key_exists(PB_DS_V2F(p_e->m_value));
+ comp_hash pos_hash_pair = ranged_hash_fn_base::operator()(PB_DS_V2F(p_e->m_value));
+ _GLIBCXX_DEBUG_ASSERT(p_e->m_hash == pos_hash_pair.second);
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp
new file mode 100644
index 0000000..fa09f73
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp
@@ -0,0 +1,91 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file entry_list_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s entry-list related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+deallocate_links_in_list(entry_pointer p_e)
+{
+ while (p_e != NULL)
+ {
+ entry_pointer p_dealloc_e = p_e;
+ p_e = p_e->m_p_next;
+ s_entry_allocator.deallocate(p_dealloc_e, 1);
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::entry_pointer
+PB_DS_CLASS_C_DEC::
+get_entry(const_reference r_val, true_type)
+{
+ // Following line might throw an exception.
+ entry_pointer p_e = s_entry_allocator.allocate(1);
+
+ // Following lines* cannot* throw an exception.
+ new (&p_e->m_value) value_type(r_val);
+ return p_e;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::entry_pointer
+PB_DS_CLASS_C_DEC::
+get_entry(const_reference r_val, false_type)
+{
+ // Following line might throw an exception.
+ entry_pointer p_e = s_entry_allocator.allocate(1);
+ cond_dealtor_t cond(p_e);
+
+ // Following lines might throw an exception.
+ new (&p_e->m_value) value_type(r_val);
+ cond.set_no_action();
+ return p_e;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+rels_entry(entry_pointer p_e)
+{
+ // The following lines cannot throw exceptions (unless if key-data dtors do).
+ p_e->m_value.~value_type();
+ s_entry_allocator.deallocate(p_e, 1);
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp
new file mode 100644
index 0000000..9f9178b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp
@@ -0,0 +1,103 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s erase related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+erase_entry_pointer(entry_pointer& r_p_e)
+{
+ _GLIBCXX_DEBUG_ONLY(debug_base::erase_existing(PB_DS_V2F(r_p_e->m_value)));
+
+ entry_pointer p_e = r_p_e;
+ r_p_e = r_p_e->m_p_next;
+ rels_entry(p_e);
+ _GLIBCXX_DEBUG_ASSERT(m_num_used_e > 0);
+ resize_base::notify_erased(--m_num_used_e);
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ size_type num_ersd = 0;
+ for (size_type pos = 0; pos < m_num_e; ++pos)
+ {
+ while (m_entries[pos] != NULL && pred(m_entries[pos]->m_value))
+ {
+ ++num_ersd;
+ entry_pointer p_next_e = m_entries[pos]->m_p_next;
+ erase_entry_pointer(m_entries[pos]);
+ m_entries[pos] = p_next_e;
+ }
+
+ entry_pointer p_e = m_entries[pos];
+ while (p_e != NULL && p_e->m_p_next != NULL)
+ {
+ if (pred(p_e->m_p_next->m_value))
+ {
+ ++num_ersd;
+ erase_entry_pointer(p_e->m_p_next);
+ }
+ else
+ p_e = p_e->m_p_next;
+ }
+ }
+
+ do_resize_if_needed_no_throw();
+ return num_ersd;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ for (size_type pos = 0; pos < m_num_e; ++pos)
+ while (m_entries[pos] != NULL)
+ erase_entry_pointer(m_entries[pos]);
+ do_resize_if_needed_no_throw();
+ resize_base::notify_cleared();
+}
+
+#include <ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp>
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..d24fc31
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp
@@ -0,0 +1,101 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_no_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s erase related functions,
+ * when the hash value is not stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+erase(const_key_reference r_key)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return erase_in_pos_imp(r_key, ranged_hash_fn_base::operator()(r_key));
+}
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+erase_in_pos_imp(const_key_reference r_key, size_type pos)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ entry_pointer p_e = m_entries[pos];
+ resize_base::notify_erase_search_start();
+ if (p_e == NULL)
+ {
+ resize_base::notify_erase_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return false;
+ }
+
+ if (hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), r_key))
+ {
+ resize_base::notify_erase_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base:: check_key_exists(r_key);)
+ erase_entry_pointer(m_entries[pos]);
+ do_resize_if_needed_no_throw();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return true;
+ }
+
+ while (true)
+ {
+ entry_pointer p_next_e = p_e->m_p_next;
+ if (p_next_e == NULL)
+ {
+ resize_base::notify_erase_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return false;
+ }
+
+ if (hash_eq_fn_base::operator()(PB_DS_V2F(p_next_e->m_value), r_key))
+ {
+ resize_base::notify_erase_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);)
+ erase_entry_pointer(p_e->m_p_next);
+ do_resize_if_needed_no_throw();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return true;
+ }
+ resize_base::notify_erase_search_collision();
+ p_e = p_next_e;
+ }
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..d72df69
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp
@@ -0,0 +1,95 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s erase related functions,
+ * when the hash value is stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+erase_in_pos_imp(const_key_reference r_key, const comp_hash& r_pos_hash_pair)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ entry_pointer p_e = m_entries[r_pos_hash_pair.first];
+ resize_base::notify_erase_search_start();
+ if (p_e == NULL)
+ {
+ resize_base::notify_erase_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base:: check_key_does_not_exist(r_key);)
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return false;
+ }
+
+ if (hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), p_e->m_hash,
+ r_key, r_pos_hash_pair.second))
+ {
+ resize_base::notify_erase_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);)
+ erase_entry_pointer(m_entries[r_pos_hash_pair.first]);
+ do_resize_if_needed_no_throw();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return true;
+ }
+
+ while (true)
+ {
+ entry_pointer p_next_e = p_e->m_p_next;
+ if (p_next_e == NULL)
+ {
+ resize_base::notify_erase_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return false;
+ }
+
+ if (hash_eq_fn_base::operator()(PB_DS_V2F(p_next_e->m_value),
+ p_next_e->m_hash, r_key,
+ r_pos_hash_pair.second))
+ {
+ resize_base::notify_erase_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);)
+ erase_entry_pointer(p_e->m_p_next);
+ do_resize_if_needed_no_throw();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return true;
+ }
+ resize_base::notify_erase_search_collision();
+ p_e = p_next_e;
+ }
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp
new file mode 100644
index 0000000..6ca9a03
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp
@@ -0,0 +1,71 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s find related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+find(const_key_reference r_key)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return find_key_pointer(r_key, traits_base::m_store_extra_indicator);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+find(const_key_reference r_key) const
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return const_cast<PB_DS_CLASS_C_DEC& >(*this).find_key_pointer(r_key,
+ traits_base::m_store_extra_indicator);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+find_end()
+{ return NULL; }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+find_end() const
+{ return NULL; }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/find_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/find_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..1db51c9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/find_store_hash_fn_imps.hpp
@@ -0,0 +1,41 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s find related functions,
+ * when the hash value is stored.
+ */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp
new file mode 100644
index 0000000..dc1519d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp
@@ -0,0 +1,100 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file info_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s entire container info related
+ * functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size() const
+{ return m_num_used_e; }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+max_size() const
+{ return m_entry_allocator.max_size(); }
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+empty() const
+{ return (size() == 0); }
+
+PB_DS_CLASS_T_DEC
+template<typename Other_HT_Map_Type>
+bool
+PB_DS_CLASS_C_DEC::
+operator==(const Other_HT_Map_Type& other) const
+{ return cmp_with_other(other); }
+
+PB_DS_CLASS_T_DEC
+template<typename Other_Map_Type>
+bool
+PB_DS_CLASS_C_DEC::
+cmp_with_other(const Other_Map_Type& other) const
+{
+ if (size() != other.size())
+ return false;
+
+ for (typename Other_Map_Type::const_iterator it = other.begin();
+ it != other.end(); ++it)
+ {
+ const_key_reference r_key =(const_key_reference)PB_DS_V2F(*it);
+ const_mapped_pointer p_mapped_value =
+ const_cast<PB_DS_CLASS_C_DEC& >(*this).
+ find_key_pointer(r_key, traits_base::m_store_extra_indicator);
+
+ if (p_mapped_value == NULL)
+ return false;
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ if (p_mapped_value->second != it->second)
+ return false;
+#endif
+ }
+ return true;
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Other_HT_Map_Type>
+bool
+PB_DS_CLASS_C_DEC::
+operator!=(const Other_HT_Map_Type& other) const
+{ return !operator==(other); }
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/insert_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/insert_fn_imps.hpp
new file mode 100644
index 0000000..0679dbe
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/insert_fn_imps.hpp
@@ -0,0 +1,43 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s insert related functions.
+ */
+
+#include <ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp>
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..7215ccd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_no_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s insert related functions,
+ * when the hash value is not stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline std::pair<typename PB_DS_CLASS_C_DEC::point_iterator, bool>
+PB_DS_CLASS_C_DEC::
+insert_imp(const_reference r_val, false_type)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ const_key_reference r_key = PB_DS_V2F(r_val);
+ const size_type pos = ranged_hash_fn_base::operator()(r_key);
+ entry_pointer p_e = m_entries[pos];
+ resize_base::notify_insert_search_start();
+
+ while (p_e != NULL && !hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value),
+ r_key))
+ {
+ resize_base::notify_insert_search_collision();
+ p_e = p_e->m_p_next;
+ }
+
+ resize_base::notify_insert_search_end();
+ if (p_e != NULL)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);)
+ return std::make_pair(&p_e->m_value, false);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ return std::make_pair(insert_new_imp(r_val, pos), true);
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..fbc284f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp
@@ -0,0 +1,71 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s insert related functions,
+ * when the hash value is stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline std::pair<typename PB_DS_CLASS_C_DEC::point_iterator, bool>
+PB_DS_CLASS_C_DEC::
+insert_imp(const_reference r_val, true_type)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ const_key_reference key = PB_DS_V2F(r_val);
+ comp_hash pos_hash_pair = ranged_hash_fn_base::operator()(key);
+ entry_pointer p_e = m_entries[pos_hash_pair.first];
+ resize_base::notify_insert_search_start();
+
+ while (p_e != NULL && !hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value),
+ p_e->m_hash,
+ key, pos_hash_pair.second))
+ {
+ resize_base::notify_insert_search_collision();
+ p_e = p_e->m_p_next;
+ }
+
+ resize_base::notify_insert_search_end();
+ if (p_e != NULL)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(key);)
+ return std::make_pair(&p_e->m_value, false);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(key);)
+ return std::make_pair(insert_new_imp(r_val, pos_hash_pair), true);
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/iterators_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/iterators_fn_imps.hpp
new file mode 100644
index 0000000..a7592b7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/iterators_fn_imps.hpp
@@ -0,0 +1,83 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file iterators_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s iterators related functions, e.g.,
+ * begin().
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::s_end_it;
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::s_const_end_it;
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+begin()
+{
+ pointer p_value;
+ std::pair<entry_pointer, size_type> pos;
+ get_start_it_state(p_value, pos);
+ return iterator(p_value, pos, this);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+end()
+{ return s_end_it; }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+begin() const
+{
+ pointer p_value;
+ std::pair<entry_pointer, size_type> pos;
+ get_start_it_state(p_value, pos);
+ return const_iterator(p_value, pos, this);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+end() const
+{ return s_const_end_it; }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/policy_access_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/policy_access_fn_imps.hpp
new file mode 100644
index 0000000..9a661b3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/policy_access_fn_imps.hpp
@@ -0,0 +1,88 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file policy_access_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s policy access
+ * functions.
+ */
+
+PB_DS_CLASS_T_DEC
+Hash_Fn&
+PB_DS_CLASS_C_DEC::
+get_hash_fn()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Hash_Fn&
+PB_DS_CLASS_C_DEC::
+get_hash_fn() const
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+Eq_Fn&
+PB_DS_CLASS_C_DEC::
+get_eq_fn()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Eq_Fn&
+PB_DS_CLASS_C_DEC::
+get_eq_fn() const
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+Comb_Hash_Fn&
+PB_DS_CLASS_C_DEC::
+get_comb_hash_fn()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Comb_Hash_Fn&
+PB_DS_CLASS_C_DEC::
+get_comb_hash_fn() const
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+Resize_Policy&
+PB_DS_CLASS_C_DEC::
+get_resize_policy()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Resize_Policy&
+PB_DS_CLASS_C_DEC::
+get_resize_policy() const
+{ return *this; }
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp
new file mode 100644
index 0000000..66333ec
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp
@@ -0,0 +1,133 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file resize_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s resize related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+do_resize_if_needed()
+{
+ if (!resize_base::is_resize_needed())
+ return false;
+ resize_imp(resize_base::get_new_size(m_num_e, m_num_used_e));
+ return true;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+do_resize(size_type len)
+{ resize_imp(resize_base::get_nearest_larger_size(len)); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+do_resize_if_needed_no_throw()
+{
+ if (!resize_base::is_resize_needed())
+ return;
+
+ __try
+ {
+ resize_imp(resize_base::get_new_size(m_num_e, m_num_used_e));
+ }
+ __catch(...)
+ { }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+resize_imp(size_type new_size)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ if (new_size == m_num_e)
+ return;
+
+ const size_type old_size = m_num_e;
+ entry_pointer_array a_p_entries_resized;
+
+ // Following line might throw an exception.
+ ranged_hash_fn_base::notify_resized(new_size);
+
+ __try
+ {
+ // Following line might throw an exception.
+ a_p_entries_resized = s_entry_pointer_allocator.allocate(new_size);
+ m_num_e = new_size;
+ }
+ __catch(...)
+ {
+ ranged_hash_fn_base::notify_resized(old_size);
+ __throw_exception_again;
+ }
+
+ // At this point no exceptions can be thrown.
+ resize_imp_no_exceptions(new_size, a_p_entries_resized, old_size);
+ Resize_Policy::notify_resized(new_size);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+resize_imp_no_exceptions(size_type new_size, entry_pointer_array a_p_entries_resized, size_type old_size)
+{
+ std::fill(a_p_entries_resized, a_p_entries_resized + m_num_e,
+ entry_pointer(NULL));
+
+ for (size_type pos = 0; pos < old_size; ++pos)
+ {
+ entry_pointer p_e = m_entries[pos];
+ while (p_e != NULL)
+ p_e = resize_imp_no_exceptions_reassign_pointer(p_e, a_p_entries_resized, traits_base::m_store_extra_indicator);
+ }
+
+ m_num_e = new_size;
+ _GLIBCXX_DEBUG_ONLY(assert_entry_pointer_array_valid(a_p_entries_resized);)
+ s_entry_pointer_allocator.deallocate(m_entries, old_size);
+ m_entries = a_p_entries_resized;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+#include <ext/pb_ds/detail/cc_hash_table_map_/resize_no_store_hash_fn_imps.hpp>
+#include <ext/pb_ds/detail/cc_hash_table_map_/resize_store_hash_fn_imps.hpp>
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/resize_no_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/resize_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..6577630
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/resize_no_store_hash_fn_imps.hpp
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file resize_no_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s resize related functions, when the
+ * hash value is not stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::entry_pointer
+PB_DS_CLASS_C_DEC::
+resize_imp_no_exceptions_reassign_pointer(entry_pointer p_e, entry_pointer_array a_p_entries_resized, false_type)
+{
+ const size_type hash_pos =
+ ranged_hash_fn_base::operator()(PB_DS_V2F(p_e->m_value));
+
+ entry_pointer const p_next_e = p_e->m_p_next;
+ p_e->m_p_next = a_p_entries_resized[hash_pos];
+ a_p_entries_resized[hash_pos] = p_e;
+ return p_next_e;
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/resize_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/resize_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..c1adb61
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/resize_store_hash_fn_imps.hpp
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file resize_store_hash_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s resize related functions, when the
+ * hash value is stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::entry_pointer
+PB_DS_CLASS_C_DEC::
+resize_imp_no_exceptions_reassign_pointer(entry_pointer p_e, entry_pointer_array a_p_entries_resized, true_type)
+{
+ const comp_hash pos_hash_pair =
+ ranged_hash_fn_base::operator()(PB_DS_V2F(p_e->m_value), p_e->m_hash);
+
+ entry_pointer const p_next_e = p_e->m_p_next;
+ p_e->m_p_next = a_p_entries_resized[pos_hash_pair.first];
+ a_p_entries_resized[pos_hash_pair.first] = p_e;
+ return p_next_e;
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp
new file mode 100644
index 0000000..0d5ec85
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file size_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s entire container size related
+ * functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size() const
+{ return m_num_used_e; }
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+empty() const
+{ return (size() == 0); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+max_size() const
+{ return s_entry_allocator.max_size(); }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/standard_policies.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/standard_policies.hpp
new file mode 100644
index 0000000..b9c1ee2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/standard_policies.hpp
@@ -0,0 +1,46 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file standard_policies.hpp
+ * Contains standard policies for cc_ht_map types.
+ */
+
+#ifndef PB_DS_CC_HT_MAP_STANDARD_POLICIES_HPP
+#define PB_DS_CC_HT_MAP_STANDARD_POLICIES_HPP
+
+#include <ext/pb_ds/detail/standard_policies.hpp>
+
+#endif // #ifndef PB_DS_CC_HT_MAP_STANDARD_POLICIES_HPP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp
new file mode 100644
index 0000000..6fa5676
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trace_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s trace-mode functions.
+ */
+
+#ifdef PB_DS_HT_MAP_TRACE_
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace() const
+{
+ std::cerr << static_cast<unsigned long>(m_num_e) << " "
+ << static_cast<unsigned long>(m_num_used_e) << std::endl;
+
+ for (size_type i = 0; i < m_num_e; ++i)
+ {
+ std::cerr << static_cast<unsigned long>(i) << " ";
+ trace_list(m_entries[i]);
+ std::cerr << std::endl;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace_list(const_entry_pointer p_l) const
+{
+ size_type iterated_num_used_e = 0;
+ while (p_l != NULL)
+ {
+ std::cerr << PB_DS_V2F(p_l->m_value) << " ";
+ p_l = p_l->m_p_next;
+ }
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cond_dealtor.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cond_dealtor.hpp
new file mode 100644
index 0000000..1ee48a2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/cond_dealtor.hpp
@@ -0,0 +1,125 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file cond_dealtor.hpp
+ * Contains a conditional deallocator.
+ */
+
+#ifndef PB_DS_COND_DEALTOR_HPP
+#define PB_DS_COND_DEALTOR_HPP
+
+namespace __gnu_pbds
+{
+
+ namespace detail
+ {
+
+#define PB_DS_COND_DEALTOR_CLASS_T_DEC \
+ template<typename Entry, class Allocator>
+
+#define PB_DS_COND_DEALTOR_CLASS_C_DEC \
+ cond_dealtor< \
+ Entry, \
+ Allocator>
+
+ template<typename Entry, class Allocator>
+ class cond_dealtor
+ {
+ public:
+ typedef
+ typename Allocator::template rebind<Entry>::other
+ entry_allocator;
+
+ typedef typename entry_allocator::pointer entry_pointer;
+
+ public:
+ inline
+ cond_dealtor(entry_pointer p_e);
+
+ inline
+ ~cond_dealtor();
+
+ inline void
+ set_no_action();
+
+ private:
+ entry_pointer m_p_e;
+
+ bool m_no_action_destructor;
+
+ static entry_allocator s_alloc;
+ };
+
+ PB_DS_COND_DEALTOR_CLASS_T_DEC
+ typename PB_DS_COND_DEALTOR_CLASS_C_DEC::entry_allocator
+ PB_DS_COND_DEALTOR_CLASS_C_DEC::s_alloc;
+
+ PB_DS_COND_DEALTOR_CLASS_T_DEC
+ inline
+ PB_DS_COND_DEALTOR_CLASS_C_DEC::
+ cond_dealtor(entry_pointer p_e) :
+ m_p_e(p_e),
+ m_no_action_destructor(false)
+ { }
+
+ PB_DS_COND_DEALTOR_CLASS_T_DEC
+ inline void
+ PB_DS_COND_DEALTOR_CLASS_C_DEC::
+ set_no_action()
+ {
+ m_no_action_destructor = true;
+ }
+
+ PB_DS_COND_DEALTOR_CLASS_T_DEC
+ inline
+ PB_DS_COND_DEALTOR_CLASS_C_DEC::
+ ~cond_dealtor()
+ {
+ if (m_no_action_destructor)
+ return;
+
+ s_alloc.deallocate(m_p_e, 1);
+ }
+
+#undef PB_DS_COND_DEALTOR_CLASS_T_DEC
+#undef PB_DS_COND_DEALTOR_CLASS_C_DEC
+
+ } // namespace detail
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_COND_DEALTOR_HPP
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/constructors_destructor_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..20c9988
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,103 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains constructors_destructor_fn_imps applicable to different containers.
+ */
+
+inline
+PB_DS_CLASS_NAME()
+{ }
+
+inline
+PB_DS_CLASS_NAME(const PB_DS_CLASS_NAME& other)
+: base_type((const base_type&)other)
+{ }
+
+template<typename T0>
+inline
+PB_DS_CLASS_NAME(T0 t0) : base_type(t0)
+{ }
+
+template<typename T0, typename T1>
+inline
+PB_DS_CLASS_NAME(T0 t0, T1 t1) : base_type(t0, t1)
+{ }
+
+template<typename T0, typename T1, typename T2>
+inline
+PB_DS_CLASS_NAME(T0 t0, T1 t1, T2 t2) : base_type(t0, t1, t2)
+{ }
+
+template<typename T0, typename T1, typename T2, typename T3>
+inline
+PB_DS_CLASS_NAME(T0 t0, T1 t1, T2 t2, T3 t3)
+: base_type(t0, t1, t2, t3)
+{ }
+
+template<typename T0, typename T1, typename T2, typename T3, typename T4>
+inline
+PB_DS_CLASS_NAME(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4)
+: base_type(t0, t1, t2, t3, t4)
+{ }
+
+template<typename T0, typename T1, typename T2, typename T3, typename T4,
+ typename T5>
+inline
+PB_DS_CLASS_NAME(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5)
+: base_type(t0, t1, t2, t3, t4, t5)
+{ }
+
+template<typename T0, typename T1, typename T2, typename T3, typename T4,
+ typename T5, typename T6>
+inline
+PB_DS_CLASS_NAME(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6)
+: base_type(t0, t1, t2, t3, t4, t5, t6)
+{ }
+
+template<typename T0, typename T1, typename T2, typename T3, typename T4,
+ typename T5, typename T6, typename T7>
+inline
+PB_DS_CLASS_NAME(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7)
+: base_type(t0, t1, t2, t3, t4, t5, t6, t7)
+{ }
+
+template<typename T0, typename T1, typename T2, typename T3, typename T4,
+ typename T5, typename T6, typename T7, typename T8>
+inline
+PB_DS_CLASS_NAME(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8)
+: base_type(t0, t1, t2, t3, t4, t5, t6, t7, t8)
+{ }
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/container_base_dispatch.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/container_base_dispatch.hpp
new file mode 100644
index 0000000..7f8d87a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/container_base_dispatch.hpp
@@ -0,0 +1,332 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file container_base_dispatch.hpp
+ * Contains an associative container dispatching base.
+ */
+
+#ifndef PB_DS_ASSOC_CNTNR_BASE_DS_DISPATCHER_HPP
+#define PB_DS_ASSOC_CNTNR_BASE_DS_DISPATCHER_HPP
+
+#include <ext/typelist.h>
+
+#define PB_DS_DATA_TRUE_INDICATOR
+#include <ext/pb_ds/detail/list_update_map_/lu_map_.hpp>
+#undef PB_DS_DATA_TRUE_INDICATOR
+
+#define PB_DS_DATA_FALSE_INDICATOR
+#include <ext/pb_ds/detail/list_update_map_/lu_map_.hpp>
+#undef PB_DS_DATA_FALSE_INDICATOR
+
+#define PB_DS_DATA_TRUE_INDICATOR
+#include <ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp>
+#undef PB_DS_DATA_TRUE_INDICATOR
+
+#define PB_DS_DATA_FALSE_INDICATOR
+#include <ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp>
+#undef PB_DS_DATA_FALSE_INDICATOR
+
+#define PB_DS_DATA_TRUE_INDICATOR
+#include <ext/pb_ds/detail/splay_tree_/splay_tree_.hpp>
+#undef PB_DS_DATA_TRUE_INDICATOR
+
+#define PB_DS_DATA_FALSE_INDICATOR
+#include <ext/pb_ds/detail/splay_tree_/splay_tree_.hpp>
+#undef PB_DS_DATA_FALSE_INDICATOR
+
+#define PB_DS_DATA_TRUE_INDICATOR
+#include <ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp>
+#undef PB_DS_DATA_TRUE_INDICATOR
+
+#define PB_DS_DATA_FALSE_INDICATOR
+#include <ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp>
+#undef PB_DS_DATA_FALSE_INDICATOR
+
+#define PB_DS_DATA_TRUE_INDICATOR
+#include <ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp>
+#undef PB_DS_DATA_TRUE_INDICATOR
+
+#define PB_DS_DATA_FALSE_INDICATOR
+#include <ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp>
+#undef PB_DS_DATA_FALSE_INDICATOR
+
+#define PB_DS_DATA_TRUE_INDICATOR
+#include <ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp>
+#undef PB_DS_DATA_TRUE_INDICATOR
+
+#define PB_DS_DATA_FALSE_INDICATOR
+#include <ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp>
+#undef PB_DS_DATA_FALSE_INDICATOR
+
+#define PB_DS_DATA_TRUE_INDICATOR
+#include <ext/pb_ds/detail/pat_trie_/pat_trie_.hpp>
+#undef PB_DS_DATA_TRUE_INDICATOR
+
+#define PB_DS_DATA_FALSE_INDICATOR
+#include <ext/pb_ds/detail/pat_trie_/pat_trie_.hpp>
+#undef PB_DS_DATA_FALSE_INDICATOR
+
+namespace __gnu_pbds
+{
+namespace detail
+{
+ // Primary template.
+ template<typename Key, typename Mapped, typename Data_Structure_Taq,
+ typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch;
+
+ template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, Mapped, list_update_tag,
+ Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+
+ public:
+ typedef lu_map_data_<Key, Mapped, at0t, Alloc, at1t> type;
+ };
+
+ template<typename Key, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, null_mapped_type, list_update_tag,
+ Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+
+ public:
+ typedef lu_map_no_data_<Key, null_mapped_type, at0t, Alloc, at1t> type;
+ };
+
+ template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, Mapped, pat_trie_tag, Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+
+ public:
+ typedef pat_trie_data_<Key, Mapped, at1t, Alloc> type;
+ };
+
+ template<typename Key, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, null_mapped_type, pat_trie_tag,
+ Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+
+ public:
+ typedef pat_trie_no_data_<Key, null_mapped_type, at1t, Alloc> type;
+ };
+
+ template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, Mapped, rb_tree_tag, Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+
+ public:
+ typedef rb_tree_data_<Key, Mapped, at0t, at1t, Alloc> type;
+ };
+
+ template<typename Key, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, null_mapped_type, rb_tree_tag,
+ Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+
+ public:
+ typedef rb_tree_no_data_<Key, null_mapped_type, at0t, at1t, Alloc> type;
+ };
+
+ template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, Mapped, splay_tree_tag,
+ Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+
+ public:
+ typedef splay_tree_data_<Key, Mapped, at0t, at1t, Alloc> type;
+ };
+
+ template<typename Key, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, null_mapped_type, splay_tree_tag,
+ Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+
+ public:
+ typedef splay_tree_no_data_<Key, null_mapped_type, at0t, at1t, Alloc> type;
+ };
+
+ template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, Mapped, ov_tree_tag, Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+
+ public:
+ typedef ov_tree_data_<Key, Mapped, at0t, at1t, Alloc> type;
+ };
+
+ template<typename Key, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, null_mapped_type, ov_tree_tag,
+ Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+
+ public:
+ typedef ov_tree_no_data_<Key, null_mapped_type, at0t, at1t, Alloc> type;
+ };
+
+ template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, Mapped, cc_hash_tag, Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 2> at2;
+ typedef typename at2::type at2t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 3> at3;
+ typedef typename at3::type at3t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 4> at4;
+ typedef typename at4::type at4t;
+
+ public:
+ typedef cc_ht_map_data_<Key, Mapped, at0t, at1t, Alloc, at3t::value,
+ at4t, at2t> type;
+ };
+
+ template<typename Key, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, null_mapped_type, cc_hash_tag,
+ Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 2> at2;
+ typedef typename at2::type at2t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 3> at3;
+ typedef typename at3::type at3t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 4> at4;
+ typedef typename at4::type at4t;
+
+ public:
+ typedef cc_ht_map_no_data_<Key, null_mapped_type, at0t, at1t, Alloc,
+ at3t::value, at4t, at2t> type;
+ };
+
+ template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, Mapped, gp_hash_tag, Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 2> at2;
+ typedef typename at2::type at2t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 3> at3;
+ typedef typename at3::type at3t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 4> at4;
+ typedef typename at4::type at4t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 5> at5;
+ typedef typename at5::type at5t;
+
+ public:
+ typedef gp_ht_map_data_<Key, Mapped, at0t, at1t, Alloc, at3t::value,
+ at4t, at5t, at2t> type;
+ };
+
+ template<typename Key, typename Policy_Tl, typename Alloc>
+ struct container_base_dispatch<Key, null_mapped_type, gp_hash_tag,
+ Policy_Tl, Alloc>
+ {
+ private:
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
+ typedef typename at1::type at1t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 2> at2;
+ typedef typename at2::type at2t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 3> at3;
+ typedef typename at3::type at3t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 4> at4;
+ typedef typename at4::type at4t;
+ typedef __gnu_cxx::typelist::at_index<Policy_Tl, 5> at5;
+ typedef typename at5::type at5t;
+
+ public:
+ typedef gp_ht_map_no_data_<Key, null_mapped_type, at0t, at1t, Alloc,
+ at3t::value, at4t, at5t, at2t> type;
+ };
+} // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/debug_map_base.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/debug_map_base.hpp
new file mode 100644
index 0000000..6f2defb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/debug_map_base.hpp
@@ -0,0 +1,360 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_map_base.hpp
+ * Contains a debug-mode base for all maps.
+ */
+
+#ifndef PB_DS_DEBUG_MAP_BASE_HPP
+#define PB_DS_DEBUG_MAP_BASE_HPP
+
+#ifdef _GLIBCXX_DEBUG
+
+#include <list>
+#include <utility>
+#include <cstdlib>
+#include <iostream>
+#include <ext/throw_allocator.h>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ // Need std::pair ostream extractor.
+ template<typename _CharT, typename _Traits, typename _Tp1, typename _Tp2>
+ inline std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __out,
+ const std::pair<_Tp1, _Tp2>& p)
+ { return (__out << '(' << p.first << ',' << p.second << ')'); }
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, class Eq_Fn, typename Const_Key_Reference>
+
+#define PB_DS_CLASS_C_DEC \
+ debug_map_base<Key, Eq_Fn, Const_Key_Reference>
+
+ template<typename Key, class Eq_Fn, typename Const_Key_Reference>
+ class debug_map_base
+ {
+ private:
+ typedef typename std::allocator< Key> key_allocator;
+
+ typedef typename key_allocator::size_type size_type;
+
+ typedef Const_Key_Reference const_key_reference;
+
+ protected:
+ debug_map_base();
+
+ debug_map_base(const PB_DS_CLASS_C_DEC& other);
+
+ ~debug_map_base();
+
+ inline void
+ insert_new(const_key_reference r_key);
+
+ inline void
+ erase_existing(const_key_reference r_key);
+
+ void
+ clear();
+
+ inline void
+ check_key_exists(const_key_reference r_key) const;
+
+ inline void
+ check_key_does_not_exist(const_key_reference r_key) const;
+
+ inline void
+ check_size(size_type size) const;
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ template<typename Cmp_Fn>
+ void
+ split(const_key_reference, Cmp_Fn, PB_DS_CLASS_C_DEC&);
+
+ void
+ join(PB_DS_CLASS_C_DEC& other);
+
+ private:
+ typedef std::list< Key> key_set;
+ typedef typename key_set::iterator key_set_iterator;
+ typedef typename key_set::const_iterator const_key_set_iterator;
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+
+ const_key_set_iterator
+ find(const_key_reference r_key) const;
+
+ key_set_iterator
+ find(const_key_reference r_key);
+
+ key_set m_key_set;
+ Eq_Fn m_eq;
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ debug_map_base()
+ { _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ debug_map_base(const PB_DS_CLASS_C_DEC& other) : m_key_set(other.m_key_set)
+ { _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ~debug_map_base()
+ { _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ insert_new(const_key_reference r_key)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ __gnu_cxx::throw_allocator<char> alloc;
+ const double orig_throw_prob = alloc.get_throw_prob();
+ alloc.set_throw_prob(0);
+ if (find(r_key) != m_key_set.end())
+ {
+ std::cerr << "insert_new" << r_key << std::endl;
+ std::abort();
+ }
+
+ __try
+ {
+ m_key_set.push_back(r_key);
+ }
+ __catch(...)
+ {
+ std::cerr << "insert_new" << r_key << std::endl;
+ std::abort();
+ }
+ alloc.set_throw_prob(orig_throw_prob);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ erase_existing(const_key_reference r_key)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ key_set_iterator it = find(r_key);
+ if (it == m_key_set.end())
+ {
+ std::cerr << "erase_existing" << r_key << std::endl;
+ std::abort();
+ }
+ m_key_set.erase(it);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ clear()
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ m_key_set.clear();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ check_key_exists(const_key_reference r_key) const
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ if (find(r_key) == m_key_set.end())
+ {
+ std::cerr << "check_key_exists" << r_key << std::endl;
+ std::abort();
+ }
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ check_key_does_not_exist(const_key_reference r_key) const
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ if (find(r_key) != m_key_set.end())
+ {
+ using std::cerr;
+ using std::endl;
+ cerr << "check_key_does_not_exist" << r_key << endl;
+ std::abort();
+ }
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ check_size(size_type size) const
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ const size_type key_set_size = m_key_set.size();
+ if (size != key_set_size)
+ {
+ std::cerr << "check_size " << size
+ << " " << key_set_size << std::endl;
+ std::abort();
+ }
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ swap(PB_DS_CLASS_C_DEC& other)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ m_key_set.swap(other.m_key_set);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::const_key_set_iterator
+ PB_DS_CLASS_C_DEC::
+ find(const_key_reference r_key) const
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ typedef const_key_set_iterator iterator_type;
+ for (iterator_type it = m_key_set.begin(); it != m_key_set.end(); ++it)
+ if (m_eq(*it, r_key))
+ return it;
+ return m_key_set.end();
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::key_set_iterator
+ PB_DS_CLASS_C_DEC::
+ find(const_key_reference r_key)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ key_set_iterator it = m_key_set.begin();
+ while (it != m_key_set.end())
+ {
+ if (m_eq(*it, r_key))
+ return it;
+ ++it;
+ }
+ return it;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+#ifdef _GLIBCXX_DEBUG
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ assert_valid() const
+ {
+ const_key_set_iterator prime_it = m_key_set.begin();
+ while (prime_it != m_key_set.end())
+ {
+ const_key_set_iterator sec_it = prime_it;
+ ++sec_it;
+ while (sec_it != m_key_set.end())
+ {
+ _GLIBCXX_DEBUG_ASSERT(!m_eq(*sec_it, *prime_it));
+ _GLIBCXX_DEBUG_ASSERT(!m_eq(*prime_it, *sec_it));
+ ++sec_it;
+ }
+ ++prime_it;
+ }
+ }
+#endif
+
+ PB_DS_CLASS_T_DEC
+ template<typename Cmp_Fn>
+ void
+ PB_DS_CLASS_C_DEC::
+ split(const_key_reference r_key, Cmp_Fn cmp_fn, PB_DS_CLASS_C_DEC& other)
+ {
+ __gnu_cxx::throw_allocator<char> alloc;
+ const double orig_throw_prob = alloc.get_throw_prob();
+ alloc.set_throw_prob(0);
+ other.clear();
+ key_set_iterator it = m_key_set.begin();
+ while (it != m_key_set.end())
+ if (cmp_fn(r_key, * it))
+ {
+ other.insert_new(*it);
+ it = m_key_set.erase(it);
+ }
+ else
+ ++it;
+ alloc.set_throw_prob(orig_throw_prob);
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ join(PB_DS_CLASS_C_DEC& other)
+ {
+ __gnu_cxx::throw_allocator<char> alloc;
+ const double orig_throw_prob = alloc.get_throw_prob();
+ alloc.set_throw_prob(0);
+ key_set_iterator it = other.m_key_set.begin();
+ while (it != other.m_key_set.end())
+ {
+ insert_new(*it);
+ it = other.m_key_set.erase(it);
+ }
+ _GLIBCXX_DEBUG_ASSERT(other.m_key_set.empty());
+ alloc.set_throw_prob(orig_throw_prob);
+ }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+} // namespace detail
+} // namespace __gnu_pbds
+
+#endif
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/eq_fn/eq_by_less.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/eq_fn/eq_by_less.hpp
new file mode 100644
index 0000000..ec95bca
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/eq_fn/eq_by_less.hpp
@@ -0,0 +1,68 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file eq_by_less.hpp
+ * Contains an equivalence function.
+ */
+
+#ifndef PB_DS_EQ_BY_LESS_HPP
+#define PB_DS_EQ_BY_LESS_HPP
+
+#include <utility>
+#include <functional>
+#include <vector>
+#include <assert.h>
+#include <ext/pb_ds/detail/types_traits.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Key, class Cmp_Fn>
+ struct eq_by_less : private Cmp_Fn
+ {
+ bool
+ operator()(const Key& r_lhs, const Key& r_rhs) const
+ {
+ const bool l = Cmp_Fn::operator()(r_lhs, r_rhs);
+ const bool g = Cmp_Fn::operator()(r_rhs, r_lhs);
+ return !(l || g);
+ }
+ };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_EQ_BY_LESS_HPP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp
new file mode 100644
index 0000000..b21c252
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp
@@ -0,0 +1,179 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file hash_eq_fn.hpp
+ * Contains 2 eqivalence functions, one employing a hash value,
+ * and one ignoring it.
+ */
+
+#ifndef PB_DS_HASH_EQ_FN_HPP
+#define PB_DS_HASH_EQ_FN_HPP
+
+#include <utility>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Key, class Eq_Fn, class Allocator, bool Store_Hash>
+ struct hash_eq_fn;
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, class Eq_Fn, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ hash_eq_fn<Key, Eq_Fn, Allocator, false>
+
+ /**
+ * Specialization 1- The client requests that hash values not be stored.
+ **/
+ template<typename Key, class Eq_Fn, class Allocator>
+ struct hash_eq_fn<Key, Eq_Fn, Allocator, false> : public Eq_Fn
+ {
+ typedef Eq_Fn eq_fn_base;
+
+ typedef typename Allocator::template rebind<Key>::other key_allocator;
+
+ typedef typename key_allocator::const_reference const_key_reference;
+
+ hash_eq_fn();
+
+ hash_eq_fn(const Eq_Fn& r_eq_fn);
+
+ inline bool
+ operator()(const_key_reference r_lhs_key, const_key_reference r_rhs_key) const;
+
+ inline void
+ swap(const PB_DS_CLASS_C_DEC& other);
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ hash_eq_fn()
+ { }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ swap(const PB_DS_CLASS_C_DEC& other)
+ { std::swap((Eq_Fn& )(*this), (Eq_Fn& )other); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ hash_eq_fn(const Eq_Fn& r_eq_fn) :
+ Eq_Fn(r_eq_fn)
+ { }
+
+ PB_DS_CLASS_T_DEC
+ inline bool
+ PB_DS_CLASS_C_DEC::
+ operator()(const_key_reference r_lhs_key, const_key_reference r_rhs_key) const
+ { return (eq_fn_base::operator()(r_lhs_key, r_rhs_key)); }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, class Eq_Fn, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ hash_eq_fn<Key, Eq_Fn, Allocator, true>
+
+ /**
+ * Specialization 2- The client requests that hash values be stored.
+ **/
+ template<typename Key, class Eq_Fn, class Allocator>
+ struct hash_eq_fn<Key, Eq_Fn, Allocator, true> :
+ public Eq_Fn
+ {
+ typedef typename Allocator::size_type size_type;
+
+ typedef Eq_Fn eq_fn_base;
+
+ typedef typename Allocator::template rebind<Key>::other key_allocator;
+
+ typedef typename key_allocator::const_reference const_key_reference;
+
+ hash_eq_fn();
+
+ hash_eq_fn(const Eq_Fn& r_eq_fn);
+
+ inline bool
+ operator()(const_key_reference r_lhs_key, size_type lhs_hash,
+ const_key_reference r_rhs_key, size_type rhs_hash) const;
+
+ inline void
+ swap(const PB_DS_CLASS_C_DEC& other);
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ hash_eq_fn()
+ { }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ hash_eq_fn(const Eq_Fn& r_eq_fn) :
+ Eq_Fn(r_eq_fn)
+ { }
+
+ PB_DS_CLASS_T_DEC
+ inline bool
+ PB_DS_CLASS_C_DEC::
+ operator()(const_key_reference r_lhs_key, size_type lhs_hash,
+ const_key_reference r_rhs_key, size_type rhs_hash) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(!eq_fn_base::operator()(r_lhs_key, r_rhs_key)
+ || lhs_hash == rhs_hash);
+
+ return (lhs_hash == rhs_hash &&
+ eq_fn_base::operator()(r_lhs_key, r_rhs_key));
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ swap(const PB_DS_CLASS_C_DEC& other)
+ { std::swap((Eq_Fn& )(*this), (Eq_Fn& )(other)); }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp
new file mode 100644
index 0000000..4ac145d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp
@@ -0,0 +1,223 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructor_destructor_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s constructors, destructor,
+ * and related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::entry_allocator
+PB_DS_CLASS_C_DEC::s_entry_allocator;
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+ while (first_it != last_it)
+ insert(*(first_it++));
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME()
+: ranged_probe_fn_base(resize_base::get_nearest_larger_size(1)),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn)
+: ranged_probe_fn_base(resize_base::get_nearest_larger_size(1), r_hash_fn),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn)
+: hash_eq_fn_base(r_eq_fn),
+ ranged_probe_fn_base(resize_base::get_nearest_larger_size(1), r_hash_fn),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn,
+ const Comb_Probe_Fn& r_comb_hash_fn)
+: hash_eq_fn_base(r_eq_fn),
+ ranged_probe_fn_base(resize_base::get_nearest_larger_size(1),
+ r_hash_fn, r_comb_hash_fn),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn,
+ const Comb_Probe_Fn& comb_hash_fn, const Probe_Fn& prober)
+: hash_eq_fn_base(r_eq_fn),
+ ranged_probe_fn_base(resize_base::get_nearest_larger_size(1),
+ r_hash_fn, comb_hash_fn, prober),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn,
+ const Comb_Probe_Fn& comb_hash_fn, const Probe_Fn& prober,
+ const Resize_Policy& r_resize_policy)
+: hash_eq_fn_base(r_eq_fn), resize_base(r_resize_policy),
+ ranged_probe_fn_base(resize_base::get_nearest_larger_size(1),
+ r_hash_fn, comb_hash_fn, prober),
+ m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
+ m_entries(s_entry_allocator.allocate(m_num_e))
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) :
+#ifdef _GLIBCXX_DEBUG
+ debug_base(other),
+#endif
+ hash_eq_fn_base(other),
+ resize_base(other),
+ ranged_probe_fn_base(other),
+ m_num_e(other.m_num_e),
+ m_num_used_e(other.m_num_used_e),
+ m_entries(s_entry_allocator.allocate(m_num_e))
+{
+ for (size_type i = 0; i < m_num_e; ++i)
+ m_entries[i].m_stat = (entry_status)empty_entry_status;
+
+ __try
+ {
+ for (size_type i = 0; i < m_num_e; ++i)
+ {
+ m_entries[i].m_stat = other.m_entries[i].m_stat;
+ if (m_entries[i].m_stat == valid_entry_status)
+ new (m_entries + i) entry(other.m_entries[i]);
+ }
+ }
+ __catch(...)
+ {
+ deallocate_all();
+ __throw_exception_again;
+ }
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~PB_DS_CLASS_NAME()
+{ deallocate_all(); }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid());
+ std::swap(m_num_e, other.m_num_e);
+ std::swap(m_num_used_e, other.m_num_used_e);
+ std::swap(m_entries, other.m_entries);
+ ranged_probe_fn_base::swap(other);
+ hash_eq_fn_base::swap(other);
+ resize_base::swap(other);
+ _GLIBCXX_DEBUG_ONLY(debug_base::swap(other));
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid());
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+deallocate_all()
+{
+ clear();
+ erase_all_valid_entries(m_entries, m_num_e);
+ s_entry_allocator.deallocate(m_entries, m_num_e);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase_all_valid_entries(entry_array a_entries_resized, size_type len)
+{
+ for (size_type pos = 0; pos < len; ++pos)
+ {
+ entry_pointer p_e = &a_entries_resized[pos];
+ if (p_e->m_stat == valid_entry_status)
+ p_e->m_value.~value_type();
+ }
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+initialize()
+{
+ Resize_Policy::notify_resized(m_num_e);
+ Resize_Policy::notify_cleared();
+ ranged_probe_fn_base::notify_resized(m_num_e);
+ for (size_type i = 0; i < m_num_e; ++i)
+ m_entries[i].m_stat = empty_entry_status;
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..ec80698
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructor_destructor_no_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s constructors, destructor,
+ * and related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+constructor_insert_new_imp(const_mapped_reference r_val, size_type pos,
+ false_type)
+{
+ _GLIBCXX_DEBUG_ASSERT(m_entries[pos].m_stat != valid_entry_status)k;
+ entry* const p_e = m_entries + pos;
+ new (&p_e->m_value) mapped_value_type(r_val);
+ p_e->m_stat = valid_entry_status;
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(p_e->m_value.first);)
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..5f30487
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructor_destructor_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s constructors, destructor,
+ * and related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+constructor_insert_new_imp(const_mapped_reference r_val, size_type pos,
+ true_type)
+{
+ _GLIBCXX_DEBUG_ASSERT(m_entries[pos].m_stat != valid_entry_status);
+ entry* const p_e = m_entries + pos;
+ new (&p_e->m_value) mapped_value_type(r_val);
+ p_e->m_hash = ranged_probe_fn_base::operator()(PB_DS_V2F(r_val)).second;
+ p_e->m_stat = valid_entry_status;
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(p_e->m_value.first);)
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp
new file mode 100644
index 0000000..d7018c6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s debug-mode functions.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ debug_base::check_size(m_num_used_e);
+ assert_entry_array_valid(m_entries, traits_base::m_store_extra_indicator);
+}
+
+#include <ext/pb_ds/detail/gp_hash_table_map_/debug_no_store_hash_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/debug_store_hash_fn_imps.hpp>
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/debug_no_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/debug_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..86b4d7d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/debug_no_store_hash_fn_imps.hpp
@@ -0,0 +1,71 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_no_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s debug-mode functions.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_entry_array_valid(const entry_array a_entries, false_type) const
+{
+ size_type iterated_num_used_e = 0;
+ for (size_type pos = 0; pos < m_num_e; ++pos)
+ {
+ const_entry_pointer p_e = &a_entries[pos];
+ switch(p_e->m_stat)
+ {
+ case empty_entry_status:
+ case erased_entry_status:
+ break;
+ case valid_entry_status:
+ {
+ const_key_reference r_key = PB_DS_V2F(p_e->m_value);
+ debug_base::check_key_exists(r_key);
+ ++iterated_num_used_e;
+ break;
+ }
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+ }
+ _GLIBCXX_DEBUG_ASSERT(iterated_num_used_e == m_num_used_e);
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/debug_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/debug_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..961f143
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/debug_store_hash_fn_imps.hpp
@@ -0,0 +1,77 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s debug-mode functions.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_entry_array_valid(const entry_array a_entries, true_type) const
+{
+ size_type iterated_num_used_e = 0;
+
+ for (size_type pos = 0; pos < m_num_e; ++pos)
+ {
+ const_entry_pointer p_e =& a_entries[pos];
+ switch(p_e->m_stat)
+ {
+ case empty_entry_status:
+ case erased_entry_status:
+ break;
+ case valid_entry_status:
+ {
+ const_key_reference r_key = PB_DS_V2F(p_e->m_value);
+ debug_base::check_key_exists(r_key);
+
+ const comp_hash pos_hash_pair = ranged_probe_fn_base::operator()(r_key);
+
+ _GLIBCXX_DEBUG_ASSERT(p_e->m_hash == pos_hash_pair.second);
+ ++iterated_num_used_e;
+ break;
+ }
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(iterated_num_used_e == m_num_used_e);
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp
new file mode 100644
index 0000000..68878eb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp
@@ -0,0 +1,100 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s erase related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+erase_entry(entry_pointer p_e)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_e->m_stat = valid_entry_status);
+ _GLIBCXX_DEBUG_ONLY(debug_base::erase_existing(PB_DS_V2F(p_e->m_value));)
+ p_e->m_value.~value_type();
+ p_e->m_stat = erased_entry_status;
+ _GLIBCXX_DEBUG_ASSERT(m_num_used_e > 0);
+ resize_base::notify_erased(--m_num_used_e);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ for (size_type pos = 0; pos < m_num_e; ++pos)
+ {
+ entry_pointer p_e = &m_entries[pos];
+ if (p_e->m_stat == valid_entry_status)
+ erase_entry(p_e);
+ }
+ do_resize_if_needed_no_throw();
+ resize_base::notify_cleared();
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ size_type num_ersd = 0;
+ for (size_type pos = 0; pos < m_num_e; ++pos)
+ {
+ entry_pointer p_e = &m_entries[pos];
+ if (p_e->m_stat == valid_entry_status)
+ if (pred(p_e->m_value))
+ {
+ ++num_ersd;
+ erase_entry(p_e);
+ }
+ }
+
+ do_resize_if_needed_no_throw();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ return num_ersd;
+}
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+erase(const_key_reference r_key)
+{ return erase_imp(r_key, traits_base::m_store_extra_indicator); }
+
+#include <ext/pb_ds/detail/gp_hash_table_map_/erase_no_store_hash_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/erase_store_hash_fn_imps.hpp>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/erase_no_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/erase_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..40d578e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/erase_no_store_hash_fn_imps.hpp
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_no_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s erase related functions,
+ * when the hash value is not stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+erase_imp(const_key_reference r_key, false_type)
+{
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ size_type hash = ranged_probe_fn_base::operator()(r_key);
+ size_type i;
+ resize_base::notify_erase_search_start();
+
+ for (i = 0; i < m_num_e; ++i)
+ {
+ const size_type pos = ranged_probe_fn_base::operator()(r_key, hash, i);
+ entry* const p_e = m_entries + pos;
+ switch(p_e->m_stat)
+ {
+ case empty_entry_status:
+ {
+ resize_base::notify_erase_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(
+ r_key));
+ return false;
+ }
+ break;
+ case valid_entry_status:
+ if (hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), r_key))
+ {
+ resize_base::notify_erase_search_end();
+ erase_entry(p_e);
+ do_resize_if_needed_no_throw();
+ return true;
+ }
+ break;
+ case erased_entry_status:
+ break;
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+ resize_base::notify_erase_search_collision();
+ }
+ resize_base::notify_erase_search_end();
+ return false;
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/erase_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/erase_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..8155a52
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/erase_store_hash_fn_imps.hpp
@@ -0,0 +1,86 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s erase related functions,
+ * when the hash value is stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+erase_imp(const_key_reference r_key, true_type)
+{
+ const comp_hash pos_hash_pair = ranged_probe_fn_base::operator()(r_key);
+ size_type i;
+ resize_base::notify_erase_search_start();
+ for (i = 0; i < m_num_e; ++i)
+ {
+ const size_type pos = ranged_probe_fn_base::operator()(r_key, pos_hash_pair.second, i);
+
+ entry* const p_e = m_entries + pos;
+ switch(p_e->m_stat)
+ {
+ case empty_entry_status:
+ {
+ resize_base::notify_erase_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(
+ r_key));
+ return false;
+ }
+ break;
+ case valid_entry_status:
+ if (hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), p_e->m_hash,
+ r_key, pos_hash_pair.second))
+ {
+ resize_base::notify_erase_search_end();
+ erase_entry(p_e);
+ do_resize_if_needed_no_throw();
+ return true;
+ }
+ break;
+ case erased_entry_status:
+ break;
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+
+ resize_base::notify_erase_search_collision();
+ }
+ resize_base::notify_erase_search_end();
+ return false;
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp
new file mode 100644
index 0000000..69d5376
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s find related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+find(const_key_reference r_key)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return find_key_pointer(r_key, traits_base::m_store_extra_indicator);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+find(const_key_reference r_key) const
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return const_cast<PB_DS_CLASS_C_DEC&>(*this).find_key_pointer(r_key, traits_base::m_store_extra_indicator);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+find_end()
+{ return NULL; }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+find_end() const
+{ return NULL; }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/find_no_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/find_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..298604c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/find_no_store_hash_fn_imps.hpp
@@ -0,0 +1,46 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_no_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s find related functions,
+ * when the hash value is not stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::pointer
+PB_DS_CLASS_C_DEC::
+find_key_pointer(const_key_reference r_key, false_type)
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/find_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/find_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..a44b832
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/find_store_hash_fn_imps.hpp
@@ -0,0 +1,40 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s insert related functions,
+ * when the hash value is stored.
+ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp
new file mode 100644
index 0000000..4741afe
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp
@@ -0,0 +1,677 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file gp_ht_map_.hpp
+ * Contains an implementation class for gp_ht_map_.
+ */
+
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp>
+#include <ext/pb_ds/detail/types_traits.hpp>
+#include <ext/pb_ds/exception.hpp>
+#include <ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp>
+#include <utility>
+#ifdef PB_DS_HT_MAP_TRACE_
+#include <iostream>
+#endif
+#ifdef _GLIBCXX_DEBUG
+#include <ext/pb_ds/detail/debug_map_base.hpp>
+#endif
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Mapped, typename Hash_Fn, typename Eq_Fn, \
+ typename Allocator, bool Store_Hash, typename Comb_Probe_Fn, \
+ typename Probe_Fn, typename Resize_Policy>
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_CLASS_NAME gp_ht_map_data_
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_CLASS_NAME gp_ht_map_no_data_
+#endif
+
+#define PB_DS_CLASS_C_DEC \
+ PB_DS_CLASS_NAME<Key, Mapped, Hash_Fn, Eq_Fn, Allocator, \
+ Store_Hash, Comb_Probe_Fn, Probe_Fn, Resize_Policy>
+
+#define PB_DS_HASH_EQ_FN_C_DEC \
+ hash_eq_fn<Key, Eq_Fn, Allocator, Store_Hash>
+
+#define PB_DS_RANGED_PROBE_FN_C_DEC \
+ ranged_probe_fn<Key, Hash_Fn, Allocator, Comb_Probe_Fn, Probe_Fn, Store_Hash>
+
+#define PB_DS_TYPES_TRAITS_C_DEC \
+ types_traits<Key, Mapped, Allocator, Store_Hash>
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_DEBUG_MAP_BASE_C_DEC \
+ debug_map_base<Key, Eq_Fn, typename Allocator::template rebind<Key>::other::const_reference>
+#endif
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_V2F(X) (X).first
+#define PB_DS_V2S(X) (X).second
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_V2F(X) (X)
+#define PB_DS_V2S(X) Mapped()
+#endif
+
+ template<typename Key,
+ typename Mapped,
+ typename Hash_Fn,
+ typename Eq_Fn,
+ typename Allocator,
+ bool Store_Hash,
+ typename Comb_Probe_Fn,
+ typename Probe_Fn,
+ typename Resize_Policy>
+ class PB_DS_CLASS_NAME :
+#ifdef _GLIBCXX_DEBUG
+ protected PB_DS_DEBUG_MAP_BASE_C_DEC,
+#endif
+ public PB_DS_HASH_EQ_FN_C_DEC,
+ public Resize_Policy,
+ public PB_DS_RANGED_PROBE_FN_C_DEC,
+ public PB_DS_TYPES_TRAITS_C_DEC
+ {
+ private:
+ typedef PB_DS_TYPES_TRAITS_C_DEC traits_base;
+ typedef typename traits_base::value_type value_type_;
+ typedef typename traits_base::pointer pointer_;
+ typedef typename traits_base::const_pointer const_pointer_;
+ typedef typename traits_base::reference reference_;
+ typedef typename traits_base::const_reference const_reference_;
+ typedef typename traits_base::comp_hash comp_hash;
+
+ enum entry_status
+ {
+ empty_entry_status,
+ valid_entry_status,
+ erased_entry_status
+ } __attribute__ ((packed));
+
+ struct entry : public traits_base::stored_value_type
+ {
+ entry_status m_stat;
+ };
+
+ typedef typename Allocator::template rebind<entry>::other entry_allocator;
+ typedef typename entry_allocator::pointer entry_pointer;
+ typedef typename entry_allocator::const_pointer const_entry_pointer;
+ typedef typename entry_allocator::reference entry_reference;
+ typedef typename entry_allocator::const_reference const_entry_reference;
+ typedef typename entry_allocator::pointer entry_array;
+
+ typedef PB_DS_RANGED_PROBE_FN_C_DEC ranged_probe_fn_base;
+
+#ifdef _GLIBCXX_DEBUG
+ typedef PB_DS_DEBUG_MAP_BASE_C_DEC debug_base;
+#endif
+
+ typedef PB_DS_HASH_EQ_FN_C_DEC hash_eq_fn_base;
+ typedef Resize_Policy resize_base;
+
+#define PB_DS_GEN_POS typename Allocator::size_type
+
+#include <ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp>
+#include <ext/pb_ds/detail/unordered_iterator/point_iterator.hpp>
+#include <ext/pb_ds/detail/unordered_iterator/const_iterator.hpp>
+#include <ext/pb_ds/detail/unordered_iterator/iterator.hpp>
+
+#undef PB_DS_GEN_POS
+
+ public:
+ typedef Allocator allocator_type;
+ typedef typename Allocator::size_type size_type;
+ typedef typename Allocator::difference_type difference_type;
+ typedef Hash_Fn hash_fn;
+ typedef Eq_Fn eq_fn;
+ typedef Probe_Fn probe_fn;
+ typedef Comb_Probe_Fn comb_probe_fn;
+ typedef Resize_Policy resize_policy;
+
+ enum
+ {
+ store_hash = Store_Hash
+ };
+
+ typedef typename traits_base::key_type key_type;
+ typedef typename traits_base::key_pointer key_pointer;
+ typedef typename traits_base::const_key_pointer const_key_pointer;
+ typedef typename traits_base::key_reference key_reference;
+ typedef typename traits_base::const_key_reference const_key_reference;
+ typedef typename traits_base::mapped_type mapped_type;
+ typedef typename traits_base::mapped_pointer mapped_pointer;
+ typedef typename traits_base::const_mapped_pointer const_mapped_pointer;
+ typedef typename traits_base::mapped_reference mapped_reference;
+ typedef typename traits_base::const_mapped_reference const_mapped_reference;
+ typedef typename traits_base::value_type value_type;
+ typedef typename traits_base::pointer pointer;
+ typedef typename traits_base::const_pointer const_pointer;
+ typedef typename traits_base::reference reference;
+ typedef typename traits_base::const_reference const_reference;
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ typedef point_iterator_ point_iterator;
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+ typedef const_point_iterator_ point_iterator;
+#endif
+
+ typedef const_point_iterator_ const_point_iterator;
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ typedef iterator_ iterator;
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+ typedef const_iterator_ iterator;
+#endif
+
+ typedef const_iterator_ const_iterator;
+
+ PB_DS_CLASS_NAME();
+
+ PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC&);
+
+ PB_DS_CLASS_NAME(const Hash_Fn&);
+
+ PB_DS_CLASS_NAME(const Hash_Fn&, const Eq_Fn&);
+
+ PB_DS_CLASS_NAME(const Hash_Fn&, const Eq_Fn&, const Comb_Probe_Fn&);
+
+ PB_DS_CLASS_NAME(const Hash_Fn&, const Eq_Fn&, const Comb_Probe_Fn&,
+ const Probe_Fn&);
+
+ PB_DS_CLASS_NAME(const Hash_Fn&, const Eq_Fn&, const Comb_Probe_Fn&,
+ const Probe_Fn&, const Resize_Policy&);
+
+ template<typename It>
+ void
+ copy_from_range(It first_it, It last_it);
+
+ virtual
+ ~PB_DS_CLASS_NAME();
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ inline size_type
+ size() const;
+
+ inline size_type
+ max_size() const;
+
+ inline bool
+ empty() const;
+
+ Hash_Fn&
+ get_hash_fn();
+
+ const Hash_Fn&
+ get_hash_fn() const;
+
+ Eq_Fn&
+ get_eq_fn();
+
+ const Eq_Fn&
+ get_eq_fn() const;
+
+ Probe_Fn&
+ get_probe_fn();
+
+ const Probe_Fn&
+ get_probe_fn() const;
+
+ Comb_Probe_Fn&
+ get_comb_probe_fn();
+
+ const Comb_Probe_Fn&
+ get_comb_probe_fn() const;
+
+ Resize_Policy&
+ get_resize_policy();
+
+ const Resize_Policy&
+ get_resize_policy() const;
+
+ inline std::pair<point_iterator, bool>
+ insert(const_reference r_val)
+ {
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ return insert_imp(r_val, traits_base::m_store_extra_indicator);
+ }
+
+ inline mapped_reference
+ operator[](const_key_reference r_key)
+ {
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ return subscript_imp(r_key, traits_base::m_store_extra_indicator);
+#else
+ insert(r_key);
+ return traits_base::s_null_mapped;
+#endif
+ }
+
+ inline point_iterator
+ find(const_key_reference r_key);
+
+ inline const_point_iterator
+ find(const_key_reference r_key) const;
+
+ inline point_iterator
+ find_end();
+
+ inline const_point_iterator
+ find_end() const;
+
+ inline bool
+ erase(const_key_reference r_key);
+
+ template<typename Pred>
+ inline size_type
+ erase_if(Pred prd);
+
+ void
+ clear();
+
+ inline iterator
+ begin();
+
+ inline const_iterator
+ begin() const;
+
+ inline iterator
+ end();
+
+ inline const_iterator
+ end() const;
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+
+#ifdef PB_DS_HT_MAP_TRACE_
+ void
+ trace() const;
+#endif
+
+ private:
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ friend class iterator_;
+#endif
+
+ friend class const_iterator_;
+
+ void
+ deallocate_all();
+
+ void
+ initialize();
+
+ void
+ erase_all_valid_entries(entry_array, size_type);
+
+ inline bool
+ do_resize_if_needed();
+
+ inline void
+ do_resize_if_needed_no_throw();
+
+ void
+ resize_imp(size_type);
+
+ virtual void
+ do_resize(size_type);
+
+ void
+ resize_imp(entry_array, size_type);
+
+ inline void
+ resize_imp_reassign(entry_pointer, entry_array, false_type);
+
+ inline void
+ resize_imp_reassign(entry_pointer, entry_array, true_type);
+
+ inline size_type
+ find_ins_pos(const_key_reference, false_type);
+
+ inline comp_hash
+ find_ins_pos(const_key_reference, true_type);
+
+ inline std::pair<point_iterator, bool>
+ insert_imp(const_reference, false_type);
+
+ inline std::pair<point_iterator, bool>
+ insert_imp(const_reference, true_type);
+
+ inline pointer
+ insert_new_imp(const_reference r_val, size_type pos)
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_entries[pos].m_stat != valid_entry_status);
+
+ if (do_resize_if_needed())
+ pos = find_ins_pos(PB_DS_V2F(r_val),
+ traits_base::m_store_extra_indicator);
+
+ _GLIBCXX_DEBUG_ASSERT(m_entries[pos].m_stat != valid_entry_status);
+
+ entry* const p_e = m_entries + pos;
+ new (&p_e->m_value) value_type(r_val);
+ p_e->m_stat = valid_entry_status;
+ resize_base::notify_inserted(++m_num_used_e);
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(p_e->m_value));)
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return &p_e->m_value;
+ }
+
+ inline pointer
+ insert_new_imp(const_reference r_val, comp_hash& r_pos_hash_pair)
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_entries[r_pos_hash_pair.first].m_stat !=
+ valid_entry_status);
+
+ if (do_resize_if_needed())
+ r_pos_hash_pair = find_ins_pos(PB_DS_V2F(r_val),
+ traits_base::m_store_extra_indicator);
+
+ _GLIBCXX_DEBUG_ASSERT(m_entries[r_pos_hash_pair.first].m_stat !=
+ valid_entry_status);
+
+ entry* const p_e = m_entries + r_pos_hash_pair.first;
+ new (&p_e->m_value) value_type(r_val);
+ p_e->m_hash = r_pos_hash_pair.second;
+ p_e->m_stat = valid_entry_status;
+
+ resize_base::notify_inserted(++m_num_used_e);
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(p_e->m_value));)
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return &p_e->m_value;
+ }
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ inline mapped_reference
+ subscript_imp(const_key_reference key, false_type)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ const size_type pos = find_ins_pos(key,
+ traits_base::m_store_extra_indicator);
+
+ entry_pointer p_e = &m_entries[pos];
+ if (p_e->m_stat != valid_entry_status)
+ return insert_new_imp(value_type(key, mapped_type()), pos)->second;
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(key);)
+ return p_e->m_value.second;
+ }
+
+ inline mapped_reference
+ subscript_imp(const_key_reference key, true_type)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ comp_hash pos_hash_pair =
+ find_ins_pos(key, traits_base::m_store_extra_indicator);
+
+ if (m_entries[pos_hash_pair.first].m_stat != valid_entry_status)
+ return insert_new_imp(value_type(key, mapped_type()),
+ pos_hash_pair)->second;
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(key));
+ return (m_entries + pos_hash_pair.first)->m_value.second;
+ }
+#endif
+
+ inline pointer
+ find_key_pointer(const_key_reference key, false_type)
+ {
+ const size_type hash = ranged_probe_fn_base::operator()(key);
+ size_type i;
+ resize_base::notify_find_search_start();
+
+ // Loop until entry is found or until all possible entries accessed.
+ for (i = 0; i < m_num_e; ++i)
+ {
+ const size_type pos = ranged_probe_fn_base::operator()(key, hash, i);
+
+ entry* const p_e = m_entries + pos;
+ switch (p_e->m_stat)
+ {
+ case empty_entry_status:
+ {
+ resize_base::notify_find_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(key);)
+
+ return NULL;
+ }
+ break;
+ case valid_entry_status:
+ if (hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), key))
+ {
+ resize_base::notify_find_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(key);)
+
+ return pointer(&p_e->m_value);
+ }
+ break;
+ case erased_entry_status:
+ break;
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+
+ resize_base::notify_find_search_collision();
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(key);)
+ resize_base::notify_find_search_end();
+ return NULL;
+ }
+
+ inline pointer
+ find_key_pointer(const_key_reference key, true_type)
+ {
+ comp_hash pos_hash_pair = ranged_probe_fn_base::operator()(key);
+ size_type i;
+ resize_base::notify_find_search_start();
+
+ // Loop until entry is found or until all possible entries accessed.
+ for (i = 0; i < m_num_e; ++i)
+ {
+ const size_type pos =
+ ranged_probe_fn_base::operator()(key, pos_hash_pair.second, i);
+
+ entry* const p_e = m_entries + pos;
+
+ switch(p_e->m_stat)
+ {
+ case empty_entry_status:
+ {
+ resize_base::notify_find_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(key);)
+
+ return NULL;
+ }
+ break;
+ case valid_entry_status:
+ if (hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value),
+ p_e->m_hash,
+ key, pos_hash_pair.second))
+ {
+ resize_base::notify_find_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(key);)
+ return pointer(&p_e->m_value);
+ }
+ break;
+ case erased_entry_status:
+ break;
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+
+ resize_base::notify_find_search_collision();
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(key);)
+ resize_base::notify_find_search_end();
+ return NULL;
+ }
+
+ inline bool
+ erase_imp(const_key_reference, true_type);
+
+ inline bool
+ erase_imp(const_key_reference, false_type);
+
+ inline void
+ erase_entry(entry_pointer p_e);
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ void
+ inc_it_state(pointer& r_p_value, size_type& r_pos) const
+ { inc_it_state((const_mapped_pointer& )r_p_value, r_pos); }
+#endif
+
+ void
+ inc_it_state(const_pointer& r_p_value, size_type& r_pos) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(r_p_value != NULL);
+ for (++r_pos; r_pos < m_num_e; ++r_pos)
+ {
+ const_entry_pointer p_e =& m_entries[r_pos];
+ if (p_e->m_stat == valid_entry_status)
+ {
+ r_p_value =& p_e->m_value;
+ return;
+ }
+ }
+ r_p_value = NULL;
+ }
+
+ void
+ get_start_it_state(const_pointer& r_p_value, size_type& r_pos) const
+ {
+ for (r_pos = 0; r_pos < m_num_e; ++r_pos)
+ {
+ const_entry_pointer p_e = &m_entries[r_pos];
+ if (p_e->m_stat == valid_entry_status)
+ {
+ r_p_value = &p_e->m_value;
+ return;
+ }
+ }
+ r_p_value = NULL;
+ }
+
+ void
+ get_start_it_state(pointer& r_p_value, size_type& r_pos)
+ {
+ for (r_pos = 0; r_pos < m_num_e; ++r_pos)
+ {
+ entry_pointer p_e = &m_entries[r_pos];
+ if (p_e->m_stat == valid_entry_status)
+ {
+ r_p_value = &p_e->m_value;
+ return;
+ }
+ }
+ r_p_value = NULL;
+ }
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_entry_array_valid(const entry_array, false_type) const;
+
+ void
+ assert_entry_array_valid(const entry_array, true_type) const;
+#endif
+
+ static entry_allocator s_entry_allocator;
+ static iterator s_end_it;
+ static const_iterator s_const_end_it;
+
+ size_type m_num_e;
+ size_type m_num_used_e;
+ entry_pointer m_entries;
+
+ enum
+ {
+ store_hash_ok = !Store_Hash
+ || !is_same<Hash_Fn, __gnu_pbds::null_hash_fn>::value
+ };
+
+ PB_DS_STATIC_ASSERT(sth, store_hash_ok);
+ };
+
+#include <ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/policy_access_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/iterator_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_HASH_EQ_FN_C_DEC
+#undef PB_DS_RANGED_PROBE_FN_C_DEC
+#undef PB_DS_TYPES_TRAITS_C_DEC
+#undef PB_DS_DEBUG_MAP_BASE_C_DEC
+#undef PB_DS_CLASS_NAME
+#undef PB_DS_V2F
+#undef PB_DS_V2S
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp
new file mode 100644
index 0000000..423a928
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file info_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s entire container info related
+ * functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size() const
+{ return m_num_used_e; }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+max_size() const
+{ return s_entry_allocator.max_size(); }
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+empty() const
+{ return (size() == 0); }
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp
new file mode 100644
index 0000000..101ce8c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp
@@ -0,0 +1,43 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s insert related functions.
+ */
+
+#include <ext/pb_ds/detail/gp_hash_table_map_/insert_no_store_hash_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/insert_store_hash_fn_imps.hpp>
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/insert_no_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/insert_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..3227a4a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/insert_no_store_hash_fn_imps.hpp
@@ -0,0 +1,111 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_no_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s insert related functions,
+ * when the hash value is not stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+find_ins_pos(const_key_reference r_key, false_type)
+{
+ size_type hash = ranged_probe_fn_base::operator()(r_key);
+ size_type i;
+
+ /* The insertion position is initted to a non-legal value to indicate
+ * that it has not been initted yet.
+ */
+ size_type ins_pos = m_num_e;
+ resize_base::notify_insert_search_start();
+ for (i = 0; i < m_num_e; ++i)
+ {
+ const size_type pos = ranged_probe_fn_base::operator()(r_key, hash, i);
+ _GLIBCXX_DEBUG_ASSERT(pos < m_num_e);
+ entry* const p_e = m_entries + pos;
+ switch(p_e->m_stat)
+ {
+ case empty_entry_status:
+ {
+ resize_base::notify_insert_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ return (ins_pos == m_num_e) ? pos : ins_pos;
+ }
+ break;
+ case erased_entry_status:
+ if (ins_pos == m_num_e)
+ ins_pos = pos;
+ break;
+ case valid_entry_status:
+ if (hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), r_key))
+ {
+ resize_base::notify_insert_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);)
+ return pos;
+ }
+ break;
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+
+ resize_base::notify_insert_search_collision();
+ }
+ resize_base::notify_insert_search_end();
+ if (ins_pos == m_num_e)
+ __throw_insert_error();
+ return ins_pos;
+}
+
+PB_DS_CLASS_T_DEC
+inline std::pair<typename PB_DS_CLASS_C_DEC::point_iterator, bool>
+PB_DS_CLASS_C_DEC::
+insert_imp(const_reference r_val, false_type)
+{
+ const_key_reference r_key = PB_DS_V2F(r_val);
+ const size_type pos = find_ins_pos(r_key,
+ traits_base::m_store_extra_indicator);
+
+ if (m_entries[pos].m_stat == valid_entry_status)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);)
+ return std::make_pair(&(m_entries + pos)->m_value, false);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key));
+ return std::make_pair(insert_new_imp(r_val, pos), true);
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/insert_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/insert_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..f4310b6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/insert_store_hash_fn_imps.hpp
@@ -0,0 +1,118 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s find related functions,
+ * when the hash value is stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::comp_hash
+PB_DS_CLASS_C_DEC::
+find_ins_pos(const_key_reference r_key, true_type)
+{
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ comp_hash pos_hash_pair = ranged_probe_fn_base::operator()(r_key);
+
+ size_type i;
+
+ /* The insertion position is initted to a non-legal value to indicate
+ * that it has not been initted yet.
+ */
+ size_type ins_pos = m_num_e;
+ resize_base::notify_insert_search_start();
+ for (i = 0; i < m_num_e; ++i)
+ {
+ const size_type pos = ranged_probe_fn_base::operator()(r_key, pos_hash_pair.second, i);
+
+ entry* const p_e = m_entries + pos;
+ switch(p_e->m_stat)
+ {
+ case empty_entry_status:
+ {
+ resize_base::notify_insert_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+
+ return ((ins_pos == m_num_e) ?
+ std::make_pair(pos, pos_hash_pair.second) :
+ std::make_pair(ins_pos, pos_hash_pair.second));
+ }
+ break;
+ case erased_entry_status:
+ if (ins_pos == m_num_e)
+ ins_pos = pos;
+ break;
+ case valid_entry_status:
+ if (hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), p_e->m_hash,
+ r_key, pos_hash_pair.second))
+ {
+ resize_base::notify_insert_search_end();
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);)
+ return std::make_pair(pos, pos_hash_pair.second);
+ }
+ break;
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+ resize_base::notify_insert_search_collision();
+ }
+ resize_base::notify_insert_search_end();
+ if (ins_pos == m_num_e)
+ __throw_insert_error();
+ return std::make_pair(ins_pos, pos_hash_pair.second);
+}
+
+PB_DS_CLASS_T_DEC
+inline std::pair<typename PB_DS_CLASS_C_DEC::point_iterator, bool>
+PB_DS_CLASS_C_DEC::
+insert_imp(const_reference r_val, true_type)
+{
+ const_key_reference r_key = PB_DS_V2F(r_val);
+ comp_hash pos_hash_pair = find_ins_pos(r_key,
+ traits_base::m_store_extra_indicator);
+
+ _GLIBCXX_DEBUG_ASSERT(pos_hash_pair.first < m_num_e);
+ entry_pointer p_e =& m_entries[pos_hash_pair.first];
+ if (p_e->m_stat == valid_entry_status)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key));
+ return std::make_pair(&p_e->m_value, false);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key));
+ return std::make_pair(insert_new_imp(r_val, pos_hash_pair), true);
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/iterator_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/iterator_fn_imps.hpp
new file mode 100644
index 0000000..ff1f80f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/iterator_fn_imps.hpp
@@ -0,0 +1,83 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file iterator_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s iterators related functions, e.g.,
+ * begin().
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::s_end_it;
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::s_const_end_it;
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+begin()
+{
+ pointer_ p_value;
+ size_type pos;
+ get_start_it_state(p_value, pos);
+ return iterator(p_value, pos, this);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+end()
+{ return s_end_it; }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+begin() const
+{
+ const_pointer_ p_value;
+ size_type pos;
+ get_start_it_state(p_value, pos);
+ return const_iterator(p_value, pos, this);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+end() const
+{ return s_const_end_it; }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/policy_access_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/policy_access_fn_imps.hpp
new file mode 100644
index 0000000..b1a3f7a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/policy_access_fn_imps.hpp
@@ -0,0 +1,100 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file policy_access_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s policy agpess
+ * functions.
+ */
+
+PB_DS_CLASS_T_DEC
+Hash_Fn&
+PB_DS_CLASS_C_DEC::
+get_hash_fn()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Hash_Fn&
+PB_DS_CLASS_C_DEC::
+get_hash_fn() const
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+Eq_Fn&
+PB_DS_CLASS_C_DEC::
+get_eq_fn()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Eq_Fn&
+PB_DS_CLASS_C_DEC::
+get_eq_fn() const
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+Probe_Fn&
+PB_DS_CLASS_C_DEC::
+get_probe_fn()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Probe_Fn&
+PB_DS_CLASS_C_DEC::
+get_probe_fn() const
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+Comb_Probe_Fn&
+PB_DS_CLASS_C_DEC::
+get_comb_probe_fn()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Comb_Probe_Fn&
+PB_DS_CLASS_C_DEC::
+get_comb_probe_fn() const
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+Resize_Policy&
+PB_DS_CLASS_C_DEC::
+get_resize_policy()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Resize_Policy&
+PB_DS_CLASS_C_DEC::
+get_resize_policy() const
+{ return *this; }
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp
new file mode 100644
index 0000000..82a8ab0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp
@@ -0,0 +1,137 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file resize_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s resize related functions.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+do_resize_if_needed()
+{
+ if (!resize_base::is_resize_needed())
+ return false;
+ resize_imp(resize_base::get_new_size(m_num_e, m_num_used_e));
+ return true;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+do_resize(size_type n)
+{ resize_imp(resize_base::get_nearest_larger_size(n)); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+do_resize_if_needed_no_throw()
+{
+ if (!resize_base::is_resize_needed())
+ return;
+
+ __try
+ {
+ resize_imp(resize_base::get_new_size(m_num_e, m_num_used_e));
+ }
+ __catch(...)
+ { }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+resize_imp(size_type new_size)
+{
+#ifdef PB_DS_REGRESSION
+ typename Allocator::group_throw_prob_adjustor adjust(m_num_e);
+#endif
+
+ if (new_size == m_num_e)
+ return;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ const size_type old_size = m_num_e;
+ entry_array a_entries_resized = NULL;
+
+ // Following line might throw an exception.
+ a_entries_resized = s_entry_allocator.allocate(new_size);
+
+ ranged_probe_fn_base::notify_resized(new_size);
+ m_num_e = new_size;
+
+ for (size_type i = 0; i < m_num_e; ++i)
+ a_entries_resized[i].m_stat = empty_entry_status;
+
+ __try
+ {
+ resize_imp(a_entries_resized, old_size);
+ }
+ __catch(...)
+ {
+ erase_all_valid_entries(a_entries_resized, new_size);
+ m_num_e = old_size;
+ s_entry_allocator.deallocate(a_entries_resized, new_size);
+ ranged_probe_fn_base::notify_resized(old_size);
+ __throw_exception_again;
+ }
+
+ // At this point no exceptions can be thrown.
+ _GLIBCXX_DEBUG_ONLY(assert_entry_array_valid(a_entries_resized, traits_base::m_store_extra_indicator);)
+
+ Resize_Policy::notify_resized(new_size);
+ erase_all_valid_entries(m_entries, old_size);
+ s_entry_allocator.deallocate(m_entries, old_size);
+ m_entries = a_entries_resized;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+resize_imp(entry_array a_entries_resized, size_type old_size)
+{
+ for (size_type pos = 0; pos < old_size; ++pos)
+ if (m_entries[pos].m_stat == valid_entry_status)
+ resize_imp_reassign(m_entries + pos, a_entries_resized,
+ traits_base::m_store_extra_indicator);
+}
+
+#include <ext/pb_ds/detail/gp_hash_table_map_/resize_no_store_hash_fn_imps.hpp>
+#include <ext/pb_ds/detail/gp_hash_table_map_/resize_store_hash_fn_imps.hpp>
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/resize_no_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/resize_no_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..1d2839e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/resize_no_store_hash_fn_imps.hpp
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file resize_no_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s resize related functions, when the
+ * hash value is not stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+resize_imp_reassign(entry_pointer p_e, entry_array a_entries_resized,
+ false_type)
+{
+ const_key_reference r_key = PB_DS_V2F(p_e->m_value);
+ size_type hash = ranged_probe_fn_base::operator()(r_key);
+ size_type i;
+ for (i = 0; i < m_num_e; ++i)
+ {
+ const size_type pos = ranged_probe_fn_base::operator()(r_key, hash, i);
+ entry_pointer p_new_e = a_entries_resized + pos;
+ switch(p_new_e->m_stat)
+ {
+ case empty_entry_status:
+ new (&p_new_e->m_value) value_type(p_e->m_value);
+ p_new_e->m_stat = valid_entry_status;
+ return;
+ case erased_entry_status:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ break;
+ case valid_entry_status:
+ break;
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+ }
+ __throw_insert_error();
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/resize_store_hash_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/resize_store_hash_fn_imps.hpp
new file mode 100644
index 0000000..765e962
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/resize_store_hash_fn_imps.hpp
@@ -0,0 +1,74 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file resize_store_hash_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s resize related functions, when the
+ * hash value is stored.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+resize_imp_reassign(entry_pointer p_e, entry_array a_entries_resized,
+ true_type)
+{
+ const_key_reference r_key = PB_DS_V2F(p_e->m_value);
+ size_type hash = ranged_probe_fn_base::operator()(r_key, p_e->m_hash);
+
+ size_type i;
+ for (i = 0; i < m_num_e; ++i)
+ {
+ const size_type pos = ranged_probe_fn_base::operator()(r_key, hash, i);
+ entry_pointer p_new_e = a_entries_resized + pos;
+ switch(p_new_e->m_stat)
+ {
+ case empty_entry_status:
+ new (&p_new_e->m_value) value_type(p_e->m_value);
+ p_new_e->m_hash = hash;
+ p_new_e->m_stat = valid_entry_status;
+ return;
+ case erased_entry_status:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ break;
+ case valid_entry_status:
+ break;
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+ }
+ __throw_insert_error();
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/standard_policies.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/standard_policies.hpp
new file mode 100644
index 0000000..479725f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/standard_policies.hpp
@@ -0,0 +1,74 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file standard_policies.hpp
+ * Contains standard policies for gp_ht_map types.
+ */
+
+#ifndef PB_DS_GP_HT_MAP_STANDARD_POLICIES_HPP
+#define PB_DS_GP_HT_MAP_STANDARD_POLICIES_HPP
+
+#include <ext/pb_ds/detail/standard_policies.hpp>
+#include <ext/pb_ds/ht_load_check_resize_trigger.hpp>
+#include <ext/pb_ds/linear_probe_fn.hpp>
+#include <ext/pb_ds/quadratic_probe_fn.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Comb_Probe_Fn>
+ struct default_probe_fn
+ {
+ private:
+ typedef typename Comb_Probe_Fn::size_type size_type;
+
+ public:
+ typedef
+ typename __conditional_type<
+ is_same<
+ __gnu_pbds::direct_mask_range_hashing<size_t>,
+ Comb_Probe_Fn>::value,
+ __gnu_pbds::linear_probe_fn<size_type>,
+ __gnu_pbds::quadratic_probe_fn<size_type> >::__type
+ type;
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp
new file mode 100644
index 0000000..c3fe13c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp
@@ -0,0 +1,74 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trace_fn_imps.hpp
+ * Contains implementations of gp_ht_map_'s trace-mode functions.
+ */
+
+#ifdef PB_DS_HT_MAP_TRACE_
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace() const
+{
+ std::cerr << static_cast<unsigned long>(m_num_e) << " " <<
+ static_cast<unsigned long>(m_num_used_e) << std::endl;
+
+ for (size_type i = 0; i < m_num_e; ++i)
+ {
+ std::cerr << static_cast<unsigned long>(i) << " ";
+
+ switch(m_entries[i].m_stat)
+ {
+ case empty_entry_status:
+ std::cerr << "<empty>";
+ break;
+ case erased_entry_status:
+ std::cerr << "<erased>";
+ break;
+ case valid_entry_status:
+ std::cerr << PB_DS_V2F(m_entries[i].m_value);
+ break;
+ default:
+ _GLIBCXX_DEBUG_ASSERT(0);
+ };
+
+ std::cerr << std::endl;
+ }
+}
+
+#endif // #ifdef PB_DS_HT_MAP_TRACE_
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/direct_mask_range_hashing_imp.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/direct_mask_range_hashing_imp.hpp
new file mode 100644
index 0000000..caf7848
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/direct_mask_range_hashing_imp.hpp
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file direct_mask_range_hashing_imp.hpp
+ * Contains a range-hashing policy implementation
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{ mask_based_base::swap(other); }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+notify_resized(size_type size)
+{ mask_based_base::notify_resized(size); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+operator()(size_type hash) const
+{ return mask_based_base::range_hash(hash); }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/direct_mod_range_hashing_imp.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/direct_mod_range_hashing_imp.hpp
new file mode 100644
index 0000000..17d57b2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/direct_mod_range_hashing_imp.hpp
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file direct_mod_range_hashing_imp.hpp
+ * Contains a range-hashing policy implementation
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{ mod_based_base::swap(other); }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+notify_resized(size_type n)
+{ mod_based_base::notify_resized(n); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+operator()(size_type hash) const
+{ return mod_based_base::range_hash(hash); }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/linear_probe_fn_imp.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/linear_probe_fn_imp.hpp
new file mode 100644
index 0000000..e7b2644
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/linear_probe_fn_imp.hpp
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file linear_probe_fn_imp.hpp
+ * Contains a probe policy implementation
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{ }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+operator()(size_type i) const
+{
+ return (i);
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/mask_based_range_hashing.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/mask_based_range_hashing.hpp
new file mode 100644
index 0000000..936abbe
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/mask_based_range_hashing.hpp
@@ -0,0 +1,107 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file mask_based_range_hashing.hpp
+ * Contains a range hashing policy base.
+ */
+
+#ifndef PB_DS_MASK_BASED_RANGE_HASHING_HPP
+#define PB_DS_MASK_BASED_RANGE_HASHING_HPP
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC template<typename Size_Type>
+#define PB_DS_CLASS_C_DEC mask_based_range_hashing<Size_Type>
+
+ template<typename Size_Type>
+ class mask_based_range_hashing
+ {
+ protected:
+ typedef Size_Type size_type;
+
+ void
+ swap(mask_based_range_hashing& other)
+ { std::swap(m_mask, other.m_mask); }
+
+ void
+ notify_resized(size_type size);
+
+ inline size_type
+ range_hash(size_type hash) const
+ { return size_type(hash & m_mask); }
+
+ private:
+ size_type m_mask;
+ const static size_type s_num_bits_in_size_type;
+ const static size_type s_highest_bit_1;
+ };
+
+ PB_DS_CLASS_T_DEC
+ const typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::s_num_bits_in_size_type =
+ sizeof(typename PB_DS_CLASS_C_DEC::size_type) << 3;
+
+ PB_DS_CLASS_T_DEC
+ const typename PB_DS_CLASS_C_DEC::size_type PB_DS_CLASS_C_DEC::s_highest_bit_1 = static_cast<typename PB_DS_CLASS_C_DEC::size_type>(1) << (s_num_bits_in_size_type - 1);
+
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ notify_resized(size_type size)
+ {
+ size_type i = 0;
+ while (size ^ s_highest_bit_1)
+ {
+ size <<= 1;
+ ++i;
+ }
+
+ m_mask = 1;
+ i += 2;
+ while (i++ < s_num_bits_in_size_type)
+ m_mask = (m_mask << 1) ^ 1;
+ }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/mod_based_range_hashing.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/mod_based_range_hashing.hpp
new file mode 100644
index 0000000..2610e04
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/mod_based_range_hashing.hpp
@@ -0,0 +1,108 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file mod_based_range_hashing.hpp
+ * Contains a range hashing policy base.
+ */
+
+#ifndef PB_DS_MOD_BASED_RANGE_HASHING_HPP
+#define PB_DS_MOD_BASED_RANGE_HASHING_HPP
+
+namespace __gnu_pbds
+{
+
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Size_Type>
+
+#define PB_DS_CLASS_C_DEC \
+ mod_based_range_hashing< \
+ Size_Type>
+
+ template<typename Size_Type>
+ class mod_based_range_hashing
+ {
+ protected:
+ typedef Size_Type size_type;
+
+ protected:
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ void
+ notify_resized(size_type size);
+
+ inline size_type
+ range_hash(size_type hash) const;
+
+ private:
+ size_type m_size;
+ };
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ swap(PB_DS_CLASS_C_DEC& other)
+ {
+ std::swap(m_size, other.m_size);
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ notify_resized(size_type size)
+ {
+ m_size = size;
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ range_hash(size_type hash) const
+ {
+ return (hash % m_size);
+ }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+ } // namespace detail
+
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_MOD_BASED_RANGE_HASHING_HPP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/probe_fn_base.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/probe_fn_base.hpp
new file mode 100644
index 0000000..970cfc1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/probe_fn_base.hpp
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file probe_fn_base.hpp
+ * Contains a probe policy base.
+ */
+
+#ifndef PB_DS_PROBE_FN_BASE_HPP
+#define PB_DS_PROBE_FN_BASE_HPP
+
+#include <functional>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Allocator>
+ class probe_fn_base
+ {
+ protected:
+ ~probe_fn_base() { }
+ };
+} // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/quadratic_probe_fn_imp.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/quadratic_probe_fn_imp.hpp
new file mode 100644
index 0000000..4c7a6c4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/quadratic_probe_fn_imp.hpp
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file quadratic_probe_fn_imp.hpp
+ * Contains a probe policy implementation
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{ }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+operator()(size_type i) const
+{
+ return (i* i);
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp
new file mode 100644
index 0000000..2489927
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp
@@ -0,0 +1,359 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file ranged_hash_fn.hpp
+ * Contains a unified ranged hash functor, allowing the hash tables
+ * to deal with a single class for ranged hashing.
+ */
+
+#ifndef PB_DS_RANGED_HASH_FN_HPP
+#define PB_DS_RANGED_HASH_FN_HPP
+
+#include <ext/pb_ds/detail/basic_types.hpp>
+#include <utility>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Key, typename Hash_Fn, typename Allocator,
+ typename Comb_Hash_Fn, bool Store_Hash>
+ class ranged_hash_fn;
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Hash_Fn, typename Allocator, \
+ typename Comb_Hash_Fn>
+
+#define PB_DS_CLASS_C_DEC \
+ ranged_hash_fn<Key, Hash_Fn, Allocator, Comb_Hash_Fn, false>
+
+ /**
+ * Specialization 1
+ * The client supplies a hash function and a ranged hash function,
+ * and requests that hash values not be stored.
+ **/
+ template<typename Key, typename Hash_Fn, typename Allocator,
+ typename Comb_Hash_Fn>
+ class ranged_hash_fn< Key, Hash_Fn, Allocator, Comb_Hash_Fn, false>
+ : public Hash_Fn, public Comb_Hash_Fn
+ {
+ protected:
+ typedef typename Allocator::size_type size_type;
+ typedef Hash_Fn hash_fn_base;
+ typedef Comb_Hash_Fn comb_hash_fn_base;
+ typedef typename Allocator::template rebind< Key>::other key_allocator;
+ typedef typename key_allocator::const_reference const_key_reference;
+
+ ranged_hash_fn(size_type);
+
+ ranged_hash_fn(size_type, const Hash_Fn&);
+
+ ranged_hash_fn(size_type, const Hash_Fn&, const Comb_Hash_Fn&);
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+
+ void
+ notify_resized(size_type);
+
+ inline size_type
+ operator()(const_key_reference) const;
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size)
+ { Comb_Hash_Fn::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size, const Hash_Fn& r_hash_fn)
+ : Hash_Fn(r_hash_fn)
+ { Comb_Hash_Fn::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size, const Hash_Fn& r_hash_fn,
+ const Comb_Hash_Fn& r_comb_hash_fn)
+ : Hash_Fn(r_hash_fn), Comb_Hash_Fn(r_comb_hash_fn)
+ { comb_hash_fn_base::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ swap(PB_DS_CLASS_C_DEC& other)
+ {
+ comb_hash_fn_base::swap(other);
+ std::swap((Hash_Fn& )(*this), (Hash_Fn& )other);
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ notify_resized(size_type size)
+ { comb_hash_fn_base::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ operator()(const_key_reference r_key) const
+ { return (comb_hash_fn_base::operator()(hash_fn_base::operator()(r_key)));}
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Hash_Fn, typename Allocator, \
+ typename Comb_Hash_Fn>
+
+#define PB_DS_CLASS_C_DEC \
+ ranged_hash_fn<Key,Hash_Fn, Allocator, Comb_Hash_Fn, true>
+
+ /**
+ * Specialization 2
+ * The client supplies a hash function and a ranged hash function,
+ * and requests that hash values be stored.
+ **/
+ template<typename Key, typename Hash_Fn, typename Allocator,
+ typename Comb_Hash_Fn>
+ class ranged_hash_fn<Key, Hash_Fn, Allocator, Comb_Hash_Fn, true>
+ : public Hash_Fn, public Comb_Hash_Fn
+ {
+ protected:
+ typedef typename Allocator::size_type size_type;
+ typedef std::pair<size_type, size_type> comp_hash;
+ typedef Hash_Fn hash_fn_base;
+ typedef Comb_Hash_Fn comb_hash_fn_base;
+ typedef typename Allocator::template rebind<Key>::other key_allocator;
+ typedef typename key_allocator::const_reference const_key_reference;
+
+ ranged_hash_fn(size_type);
+
+ ranged_hash_fn(size_type, const Hash_Fn&);
+
+ ranged_hash_fn(size_type, const Hash_Fn&, const Comb_Hash_Fn&);
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+
+ void
+ notify_resized(size_type);
+
+ inline comp_hash
+ operator()(const_key_reference) const;
+
+ inline comp_hash
+ operator()(const_key_reference, size_type) const;
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size)
+ { Comb_Hash_Fn::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size, const Hash_Fn& r_hash_fn) :
+ Hash_Fn(r_hash_fn)
+ { Comb_Hash_Fn::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size, const Hash_Fn& r_hash_fn,
+ const Comb_Hash_Fn& r_comb_hash_fn)
+ : Hash_Fn(r_hash_fn), Comb_Hash_Fn(r_comb_hash_fn)
+ { comb_hash_fn_base::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ swap(PB_DS_CLASS_C_DEC& other)
+ {
+ comb_hash_fn_base::swap(other);
+ std::swap((Hash_Fn& )(*this), (Hash_Fn& )other);
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ notify_resized(size_type size)
+ { comb_hash_fn_base::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::comp_hash
+ PB_DS_CLASS_C_DEC::
+ operator()(const_key_reference r_key) const
+ {
+ const size_type hash = hash_fn_base::operator()(r_key);
+ return std::make_pair(comb_hash_fn_base::operator()(hash), hash);
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::comp_hash
+ PB_DS_CLASS_C_DEC::
+ operator()
+#ifdef _GLIBCXX_DEBUG
+ (const_key_reference r_key, size_type hash) const
+#else
+ (const_key_reference /*r_key*/, size_type hash) const
+#endif
+ {
+ _GLIBCXX_DEBUG_ASSERT(hash == hash_fn_base::operator()(r_key));
+ return std::make_pair(comb_hash_fn_base::operator()(hash), hash);
+ }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Allocator, typename Comb_Hash_Fn>
+
+#define PB_DS_CLASS_C_DEC \
+ ranged_hash_fn<Key, null_hash_fn, Allocator, Comb_Hash_Fn, false>
+
+ /**
+ * Specialization 3
+ * The client does not supply a hash function (by specifying
+ * null_hash_fn as the Hash_Fn parameter), and requests that hash
+ * values not be stored.
+ **/
+ template<typename Key, typename Allocator, typename Comb_Hash_Fn>
+ class ranged_hash_fn<Key, null_hash_fn, Allocator, Comb_Hash_Fn, false>
+ : public null_hash_fn, public Comb_Hash_Fn
+ {
+ protected:
+ typedef typename Allocator::size_type size_type;
+ typedef Comb_Hash_Fn comb_hash_fn_base;
+
+ ranged_hash_fn(size_type);
+
+ ranged_hash_fn(size_type, const Comb_Hash_Fn&);
+
+ ranged_hash_fn(size_type, const null_hash_fn&, const Comb_Hash_Fn&);
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size)
+ { Comb_Hash_Fn::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size, const Comb_Hash_Fn& r_comb_hash_fn) :
+ Comb_Hash_Fn(r_comb_hash_fn)
+ { }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size, const null_hash_fn& r_null_hash_fn,
+ const Comb_Hash_Fn& r_comb_hash_fn)
+ : Comb_Hash_Fn(r_comb_hash_fn)
+ { }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ swap(PB_DS_CLASS_C_DEC& other)
+ { comb_hash_fn_base::swap(other); }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Allocator, typename Comb_Hash_Fn>
+
+#define PB_DS_CLASS_C_DEC \
+ ranged_hash_fn<Key, null_hash_fn, Allocator, Comb_Hash_Fn, true>
+
+ /**
+ * Specialization 4
+ * The client does not supply a hash function (by specifying
+ * null_hash_fn as the Hash_Fn parameter), and requests that hash
+ * values be stored.
+ **/
+ template<typename Key, typename Allocator, typename Comb_Hash_Fn>
+ class ranged_hash_fn<Key, null_hash_fn, Allocator, Comb_Hash_Fn, true>
+ : public null_hash_fn, public Comb_Hash_Fn
+ {
+ protected:
+ typedef typename Allocator::size_type size_type;
+ typedef Comb_Hash_Fn comb_hash_fn_base;
+
+ ranged_hash_fn(size_type);
+
+ ranged_hash_fn(size_type, const Comb_Hash_Fn&);
+
+ ranged_hash_fn(size_type, const null_hash_fn&, const Comb_Hash_Fn&);
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size)
+ { Comb_Hash_Fn::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size, const Comb_Hash_Fn& r_comb_hash_fn)
+ : Comb_Hash_Fn(r_comb_hash_fn)
+ { }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_hash_fn(size_type size, const null_hash_fn& r_null_hash_fn,
+ const Comb_Hash_Fn& r_comb_hash_fn)
+ : Comb_Hash_Fn(r_comb_hash_fn)
+ { }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ swap(PB_DS_CLASS_C_DEC& other)
+ { comb_hash_fn_base::swap(other); }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp
new file mode 100644
index 0000000..ddfba9d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp
@@ -0,0 +1,327 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file ranged_probe_fn.hpp
+ * Contains a unified ranged probe functor, allowing the probe tables to deal with
+ * a single class for ranged probeing.
+ */
+
+#ifndef PB_DS_RANGED_PROBE_FN_HPP
+#define PB_DS_RANGED_PROBE_FN_HPP
+
+#include <ext/pb_ds/detail/basic_types.hpp>
+#include <utility>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Key, typename Hash_Fn, typename Allocator,
+ typename Comb_Probe_Fn, typename Probe_Fn, bool Store_Hash>
+ class ranged_probe_fn;
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Hash_Fn, typename Allocator, \
+ typename Comb_Probe_Fn, typename Probe_Fn>
+
+#define PB_DS_CLASS_C_DEC \
+ ranged_probe_fn<Key, Hash_Fn, Allocator, Comb_Probe_Fn, Probe_Fn, false>
+
+ /**
+ * Specialization 1
+ * The client supplies a probe function and a ranged probe
+ * function, and requests that hash values not be stored.
+ **/
+ template<typename Key, typename Hash_Fn, typename Allocator,
+ typename Comb_Probe_Fn, typename Probe_Fn>
+ class ranged_probe_fn<Key, Hash_Fn, Allocator, Comb_Probe_Fn,
+ Probe_Fn, false>
+ : public Hash_Fn, public Comb_Probe_Fn, public Probe_Fn
+ {
+ protected:
+ typedef typename Allocator::size_type size_type;
+ typedef Comb_Probe_Fn comb_probe_fn_base;
+ typedef Hash_Fn hash_fn_base;
+ typedef Probe_Fn probe_fn_base;
+ typedef typename Allocator::template rebind<Key>::other key_allocator;
+ typedef typename key_allocator::const_reference const_key_reference;
+
+ ranged_probe_fn(size_type);
+
+ ranged_probe_fn(size_type, const Hash_Fn&);
+
+ ranged_probe_fn(size_type, const Hash_Fn&, const Comb_Probe_Fn&);
+
+ ranged_probe_fn(size_type, const Hash_Fn&, const Comb_Probe_Fn&,
+ const Probe_Fn&);
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+
+ void
+ notify_resized(size_type);
+
+ inline size_type
+ operator()(const_key_reference) const;
+
+ inline size_type
+ operator()(const_key_reference, size_type, size_type) const;
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_probe_fn(size_type size)
+ { Comb_Probe_Fn::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_probe_fn(size_type size, const Hash_Fn& r_hash_fn)
+ : Hash_Fn(r_hash_fn)
+ { Comb_Probe_Fn::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_probe_fn(size_type size, const Hash_Fn& r_hash_fn,
+ const Comb_Probe_Fn& r_comb_probe_fn)
+ : Hash_Fn(r_hash_fn), Comb_Probe_Fn(r_comb_probe_fn)
+ { comb_probe_fn_base::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_probe_fn(size_type size, const Hash_Fn& r_hash_fn,
+ const Comb_Probe_Fn& r_comb_probe_fn,
+ const Probe_Fn& r_probe_fn)
+ : Hash_Fn(r_hash_fn), Comb_Probe_Fn(r_comb_probe_fn), Probe_Fn(r_probe_fn)
+ { comb_probe_fn_base::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ swap(PB_DS_CLASS_C_DEC& other)
+ {
+ comb_probe_fn_base::swap(other);
+ std::swap((Hash_Fn& )(*this), (Hash_Fn&)other);
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ notify_resized(size_type size)
+ { comb_probe_fn_base::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ operator()(const_key_reference r_key) const
+ { return comb_probe_fn_base::operator()(hash_fn_base::operator()(r_key)); }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ operator()(const_key_reference, size_type hash, size_type i) const
+ {
+ return comb_probe_fn_base::operator()(hash + probe_fn_base::operator()(i));
+ }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Hash_Fn, typename Allocator, \
+ typename Comb_Probe_Fn, typename Probe_Fn>
+
+#define PB_DS_CLASS_C_DEC \
+ ranged_probe_fn<Key, Hash_Fn, Allocator, Comb_Probe_Fn, Probe_Fn, true>
+
+ /**
+ * Specialization 2- The client supplies a probe function and a ranged
+ * probe function, and requests that hash values not be stored.
+ **/
+ template<typename Key, typename Hash_Fn, typename Allocator,
+ typename Comb_Probe_Fn, typename Probe_Fn>
+ class ranged_probe_fn<Key, Hash_Fn, Allocator, Comb_Probe_Fn,
+ Probe_Fn, true>
+ : public Hash_Fn, public Comb_Probe_Fn, public Probe_Fn
+ {
+ protected:
+ typedef typename Allocator::size_type size_type;
+ typedef std::pair<size_type, size_type> comp_hash;
+ typedef Comb_Probe_Fn comb_probe_fn_base;
+ typedef Hash_Fn hash_fn_base;
+ typedef Probe_Fn probe_fn_base;
+ typedef typename Allocator::template rebind<Key>::other key_allocator;
+ typedef typename key_allocator::const_reference const_key_reference;
+
+ ranged_probe_fn(size_type);
+
+ ranged_probe_fn(size_type, const Hash_Fn&);
+
+ ranged_probe_fn(size_type, const Hash_Fn&,
+ const Comb_Probe_Fn&);
+
+ ranged_probe_fn(size_type, const Hash_Fn&, const Comb_Probe_Fn&,
+ const Probe_Fn&);
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+
+ void
+ notify_resized(size_type);
+
+ inline comp_hash
+ operator()(const_key_reference) const;
+
+ inline size_type
+ operator()(const_key_reference, size_type, size_type) const;
+
+ inline size_type
+ operator()(const_key_reference, size_type) const;
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_probe_fn(size_type size)
+ { Comb_Probe_Fn::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_probe_fn(size_type size, const Hash_Fn& r_hash_fn)
+ : Hash_Fn(r_hash_fn)
+ { Comb_Probe_Fn::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_probe_fn(size_type size, const Hash_Fn& r_hash_fn,
+ const Comb_Probe_Fn& r_comb_probe_fn)
+ : Hash_Fn(r_hash_fn), Comb_Probe_Fn(r_comb_probe_fn)
+ { comb_probe_fn_base::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ranged_probe_fn(size_type size, const Hash_Fn& r_hash_fn,
+ const Comb_Probe_Fn& r_comb_probe_fn,
+ const Probe_Fn& r_probe_fn)
+ : Hash_Fn(r_hash_fn), Comb_Probe_Fn(r_comb_probe_fn), Probe_Fn(r_probe_fn)
+ { comb_probe_fn_base::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ swap(PB_DS_CLASS_C_DEC& other)
+ {
+ comb_probe_fn_base::swap(other);
+ std::swap((Hash_Fn& )(*this), (Hash_Fn& )other);
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ notify_resized(size_type size)
+ { comb_probe_fn_base::notify_resized(size); }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::comp_hash
+ PB_DS_CLASS_C_DEC::
+ operator()(const_key_reference r_key) const
+ {
+ const size_type hash = hash_fn_base::operator()(r_key);
+ return std::make_pair(comb_probe_fn_base::operator()(hash), hash);
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ operator()(const_key_reference, size_type hash, size_type i) const
+ {
+ return comb_probe_fn_base::operator()(hash + probe_fn_base::operator()(i));
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ operator()
+#ifdef _GLIBCXX_DEBUG
+ (const_key_reference r_key, size_type hash) const
+#else
+ (const_key_reference /*r_key*/, size_type hash) const
+#endif
+ {
+ _GLIBCXX_DEBUG_ASSERT(hash == hash_fn_base::operator()(r_key));
+ return hash;
+ }
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+ /**
+ * Specialization 3 and 4
+ * The client does not supply a hash function or probe function,
+ * and requests that hash values not be stored.
+ **/
+ template<typename Key, typename Allocator, typename Comb_Probe_Fn>
+ class ranged_probe_fn<Key, null_hash_fn, Allocator, Comb_Probe_Fn,
+ null_probe_fn, false>
+ : public Comb_Probe_Fn, public null_hash_fn, public null_probe_fn
+ {
+ protected:
+ typedef typename Allocator::size_type size_type;
+ typedef Comb_Probe_Fn comb_probe_fn_base;
+ typedef typename Allocator::template rebind<Key>::other key_allocator;
+ typedef typename key_allocator::const_reference const_key_reference;
+
+ ranged_probe_fn(size_type size)
+ { Comb_Probe_Fn::notify_resized(size); }
+
+ ranged_probe_fn(size_type, const Comb_Probe_Fn& r_comb_probe_fn)
+ : Comb_Probe_Fn(r_comb_probe_fn)
+ { }
+
+ ranged_probe_fn(size_type, const null_hash_fn&,
+ const Comb_Probe_Fn& r_comb_probe_fn,
+ const null_probe_fn&)
+ : Comb_Probe_Fn(r_comb_probe_fn)
+ { }
+
+ void
+ swap(ranged_probe_fn& other)
+ { comb_probe_fn_base::swap(other); }
+ };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp
new file mode 100644
index 0000000..dad6451
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_probe_fn.hpp
+ * Contains a sample probe policy.
+ */
+
+#ifndef PB_DS_SAMPLE_PROBE_FN_HPP
+#define PB_DS_SAMPLE_PROBE_FN_HPP
+
+// A sample probe policy.
+class sample_probe_fn
+{
+
+public:
+
+ // Size type.
+ typedef size_t size_type;
+
+public:
+
+ // Default constructor.
+ sample_probe_fn();
+
+ // Copy constructor.
+ sample_probe_fn(const sample_probe_fn& other);
+
+ // Swaps content.
+ inline void
+ swap(sample_probe_fn& other);
+
+protected:
+
+ // Returns the i-th offset from the hash value of some key r_key.
+ inline size_type
+ operator()(const_key_reference r_key, size_type i) const;
+
+};
+
+#endif // #ifndef PB_DS_SAMPLE_PROBE_FN_HPP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp
new file mode 100644
index 0000000..0912e7f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp
@@ -0,0 +1,77 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_range_hashing.hpp
+ * Contains a range hashing policy.
+ */
+
+#ifndef PB_DS_SAMPLE_RANGE_HASHING_HPP
+#define PB_DS_SAMPLE_RANGE_HASHING_HPP
+
+// A sample range-hashing functor.
+class sample_range_hashing
+{
+
+public:
+
+ // Size type.
+ typedef size_t size_type;
+
+public:
+
+ // Default constructor.
+ sample_range_hashing();
+
+ // Copy constructor.
+ sample_range_hashing(const sample_range_hashing& other);
+
+ // Swaps content.
+ inline void
+ swap(sample_range_hashing& other);
+
+protected:
+
+ // Notifies the policy object that the container's __size has changed to size.
+ void
+ notify_resized(size_type size);
+
+ // Transforms the __hash value hash into a ranged-hash value.
+ inline size_type
+ operator()(size_type hash) const;
+
+};
+
+#endif // #ifndef PB_DS_SAMPLE_RANGE_HASHING_HPP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp
new file mode 100644
index 0000000..6120231
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp
@@ -0,0 +1,77 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_ranged_hash_fn.hpp
+ * Contains a ranged hash policy.
+ */
+
+#ifndef PB_DS_SAMPLE_RANGED_HASH_FN_HPP
+#define PB_DS_SAMPLE_RANGED_HASH_FN_HPP
+
+// A sample ranged-hash functor.
+class sample_ranged_hash_fn
+{
+
+public:
+
+ // Size type.
+ typedef size_t size_type;
+
+public:
+
+ // Default constructor.
+ sample_ranged_hash_fn();
+
+ // Copy constructor.
+ sample_ranged_hash_fn(const sample_ranged_hash_fn& other);
+
+ // Swaps content.
+ inline void
+ swap(sample_ranged_hash_fn& other);
+
+protected:
+
+ // Notifies the policy object that the container's __size has changed to size.
+ void
+ notify_resized(size_type size);
+
+ // Transforms r_key into a position within the table.
+ inline size_type
+ operator()(const_key_reference r_key) const;
+
+};
+
+#endif // #ifndef PB_DS_SAMPLE_RANGED_HASH_FN_HPP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp
new file mode 100644
index 0000000..915f108
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp
@@ -0,0 +1,77 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_ranged_probe_fn.hpp
+ * Contains a ranged probe policy.
+ */
+
+#ifndef PB_DS_SAMPLE_RANGED_PROBE_FN_HPP
+#define PB_DS_SAMPLE_RANGED_PROBE_FN_HPP
+
+// A sample ranged-probe functor.
+class sample_ranged_probe_fn
+{
+
+public:
+
+ // Size type.
+ typedef size_t size_type;
+
+public:
+
+ // Default constructor.
+ sample_ranged_probe_fn();
+
+ // Copy constructor.
+ sample_ranged_probe_fn(const sample_ranged_probe_fn& other);
+
+ // Swaps content.
+ inline void
+ swap(sample_ranged_probe_fn& other);
+
+protected:
+
+ // Notifies the policy object that the container's __size has changed to size.
+ void
+ notify_resized(size_type size);
+
+ // Transforms the const key reference r_key into the i-th position within the table. This method is called for each collision within the probe sequence.
+ inline size_type
+ operator()(const_key_reference r_key, size_t hash, size_type i) const;
+
+};
+
+#endif // #ifndef PB_DS_SAMPLE_RANGED_PROBE_FN_HPP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp
new file mode 100644
index 0000000..5955df1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp
@@ -0,0 +1,162 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file const_iterator.hpp
+ * Contains an iterator class returned by the table's const find and insert
+ * methods.
+ */
+
+#ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_CONST_ITERATOR_HPP
+#define PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_CONST_ITERATOR_HPP
+
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/const_point_iterator.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_C_DEC \
+ left_child_next_sibling_heap_const_iterator_<Node, Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ left_child_next_sibling_heap_node_const_point_iterator_<Node, Allocator>
+
+ // Const point-type iterator.
+ template<typename Node, class Allocator>
+ class left_child_next_sibling_heap_const_iterator_ : public PB_DS_BASE_C_DEC
+ {
+
+ private:
+ typedef typename PB_DS_BASE_C_DEC::node_pointer node_pointer;
+
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+
+ // Category.
+ typedef std::forward_iterator_tag iterator_category;
+
+ // Difference type.
+ typedef typename Allocator::difference_type difference_type;
+
+ // Iterator's value type.
+ typedef typename base_type::value_type value_type;
+
+ // Iterator's pointer type.
+ typedef typename base_type::pointer pointer;
+
+ // Iterator's const pointer type.
+ typedef typename base_type::const_pointer const_pointer;
+
+ // Iterator's reference type.
+ typedef typename base_type::reference reference;
+
+ // Iterator's const reference type.
+ typedef typename base_type::const_reference const_reference;
+
+ public:
+
+ inline
+ left_child_next_sibling_heap_const_iterator_(node_pointer p_nd) : base_type(p_nd)
+ { }
+
+ // Default constructor.
+ inline
+ left_child_next_sibling_heap_const_iterator_()
+ { }
+
+ // Copy constructor.
+ inline
+ left_child_next_sibling_heap_const_iterator_(const PB_DS_CLASS_C_DEC& other) : base_type(other)
+ { }
+
+ // Compares content to a different iterator object.
+ inline bool
+ operator==(const PB_DS_CLASS_C_DEC& other) const
+ { return (base_type::m_p_nd == other.m_p_nd); }
+
+ // Compares content (negatively) to a different iterator object.
+ inline bool
+ operator!=(const PB_DS_CLASS_C_DEC& other) const
+ { return (base_type::m_p_nd != other.m_p_nd); }
+
+ inline PB_DS_CLASS_C_DEC&
+ operator++()
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_p_nd != NULL);
+ inc();
+ return (*this);
+ }
+
+ inline PB_DS_CLASS_C_DEC
+ operator++(int)
+ {
+ PB_DS_CLASS_C_DEC ret_it(base_type::m_p_nd);
+ operator++();
+ return (ret_it);
+ }
+
+ private:
+ void
+ inc()
+ {
+ if (base_type::m_p_nd->m_p_next_sibling != NULL)
+ {
+ base_type::m_p_nd = base_type::m_p_nd->m_p_next_sibling;
+ while (base_type::m_p_nd->m_p_l_child != NULL)
+ base_type::m_p_nd = base_type::m_p_nd->m_p_l_child;
+ return;
+ }
+
+ while (true)
+ {
+ node_pointer p_next = base_type::m_p_nd;
+ base_type::m_p_nd = base_type::m_p_nd->m_p_prev_or_parent;
+ if (base_type::m_p_nd == NULL || base_type::m_p_nd->m_p_l_child == p_next)
+ return;
+ }
+ }
+ };
+
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_BASE_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/const_point_iterator.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/const_point_iterator.hpp
new file mode 100644
index 0000000..7d68252
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/const_point_iterator.hpp
@@ -0,0 +1,154 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file const_point_iterator.hpp
+ * Contains an iterator class returned by the table's const find and insert
+ * methods.
+ */
+
+#ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_CONST_FIND_ITERATOR_HPP
+#define PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_CONST_FIND_ITERATOR_HPP
+
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Node, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ left_child_next_sibling_heap_node_const_point_iterator_<Node, Allocator>
+
+ // Const point-type iterator.
+ template<typename Node, class Allocator>
+ class left_child_next_sibling_heap_node_const_point_iterator_
+ {
+
+ protected:
+ typedef typename Allocator::template rebind<Node>::other::pointer node_pointer;
+
+ public:
+
+ // Category.
+ typedef trivial_iterator_tag iterator_category;
+
+ // Difference type.
+ typedef trivial_iterator_difference_type difference_type;
+
+ // Iterator's value type.
+ typedef typename Node::value_type value_type;
+
+ // Iterator's pointer type.
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::pointer
+ pointer;
+
+ // Iterator's const pointer type.
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_pointer
+ const_pointer;
+
+ // Iterator's reference type.
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::reference
+ reference;
+
+ // Iterator's const reference type.
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_reference
+ const_reference;
+
+ public:
+
+ inline
+ left_child_next_sibling_heap_node_const_point_iterator_(node_pointer p_nd) : m_p_nd(p_nd)
+ { }
+
+ // Default constructor.
+ inline
+ left_child_next_sibling_heap_node_const_point_iterator_() : m_p_nd(NULL)
+ { }
+
+ // Copy constructor.
+ inline
+ left_child_next_sibling_heap_node_const_point_iterator_(const PB_DS_CLASS_C_DEC& other) : m_p_nd(other.m_p_nd)
+ { }
+
+ // Access.
+ inline const_pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd != NULL);
+ return &m_p_nd->m_value;
+ }
+
+ // Access.
+ inline const_reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd != NULL);
+ return m_p_nd->m_value;
+ }
+
+ // Compares content to a different iterator object.
+ inline bool
+ operator==(const PB_DS_CLASS_C_DEC& other) const
+ { return m_p_nd == other.m_p_nd; }
+
+ // Compares content (negatively) to a different iterator object.
+ inline bool
+ operator!=(const PB_DS_CLASS_C_DEC& other) const
+ { return m_p_nd != other.m_p_nd; }
+
+ public:
+ node_pointer m_p_nd;
+ };
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..ea05725
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,152 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation class for left_child_next_sibling_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_allocator
+PB_DS_CLASS_C_DEC::s_node_allocator;
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::no_throw_copies_t
+PB_DS_CLASS_C_DEC::s_no_throw_copies_ind;
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+left_child_next_sibling_heap_() :
+ m_p_root(NULL),
+ m_size(0)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+left_child_next_sibling_heap_(const Cmp_Fn& r_cmp_fn) :
+ Cmp_Fn(r_cmp_fn),
+ m_p_root(NULL),
+ m_size(0)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+left_child_next_sibling_heap_(const PB_DS_CLASS_C_DEC& other)
+: Cmp_Fn(other), m_p_root(NULL), m_size(0)
+{
+ m_size = other.m_size;
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ m_p_root = recursive_copy_node(other.m_p_root);
+ m_size = other.m_size;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ value_swap(other);
+ std::swap((Cmp_Fn& )(*this), (Cmp_Fn& )other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+value_swap(PB_DS_CLASS_C_DEC& other)
+{
+ std::swap(m_p_root, other.m_p_root);
+ std::swap(m_size, other.m_size);
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~left_child_next_sibling_heap_()
+{
+ clear();
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+recursive_copy_node(const_node_pointer p_nd)
+{
+ if (p_nd == NULL)
+ return (NULL);
+
+ node_pointer p_ret = s_node_allocator.allocate(1);
+
+ __try
+ {
+ new (p_ret) node(*p_nd);
+ }
+ __catch(...)
+ {
+ s_node_allocator.deallocate(p_ret, 1);
+ __throw_exception_again;
+ }
+
+ p_ret->m_p_l_child = p_ret->m_p_next_sibling =
+ p_ret->m_p_prev_or_parent = NULL;
+
+ __try
+ {
+ p_ret->m_p_l_child = recursive_copy_node(p_nd->m_p_l_child);
+ p_ret->m_p_next_sibling = recursive_copy_node(p_nd->m_p_next_sibling);
+ }
+ __catch(...)
+ {
+ clear_imp(p_ret);
+ __throw_exception_again;
+ }
+
+ if (p_ret->m_p_l_child != NULL)
+ p_ret->m_p_l_child->m_p_prev_or_parent = p_ret;
+
+ if (p_ret->m_p_next_sibling != NULL)
+ p_ret->m_p_next_sibling->m_p_prev_or_parent =
+ p_nd->m_p_next_sibling->m_p_prev_or_parent == p_nd ? p_ret : NULL;
+
+ return p_ret;
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp
new file mode 100644
index 0000000..86871ac
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp
@@ -0,0 +1,141 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation class for left_child_next_sibling_heap_.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ _GLIBCXX_DEBUG_ASSERT(m_p_root == NULL || m_p_root->m_p_prev_or_parent == NULL);
+
+ if (m_p_root != NULL)
+ assert_node_consistent(m_p_root, Single_Link_Roots);
+ assert_size();
+ assert_iterators();
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_node_consistent(const_node_pointer p_nd, bool single_link) const
+{
+ if (p_nd == NULL)
+ return;
+
+ assert_node_consistent(p_nd->m_p_l_child, false);
+ assert_node_consistent(p_nd->m_p_next_sibling, single_link);
+
+ if (single_link)
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_prev_or_parent == NULL);
+ else if (p_nd->m_p_next_sibling != NULL)
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_next_sibling->m_p_prev_or_parent == p_nd);
+
+ if (p_nd->m_p_l_child == NULL)
+ return;
+
+ const_node_pointer p_child = p_nd->m_p_l_child;
+ while (p_child != NULL)
+ {
+ const_node_pointer p_next_child = p_child->m_p_next_sibling;
+ _GLIBCXX_DEBUG_ASSERT(!Cmp_Fn::operator()(p_nd->m_value, p_child->m_value));
+ p_child = p_next_child;
+ }
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_l_child->m_p_prev_or_parent == p_nd);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_iterators() const
+{
+ const size_type calc_size = std::distance(begin(), end());
+ if (calc_size == size())
+ return;
+ _GLIBCXX_DEBUG_ASSERT(0);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_size() const
+{
+ if (size_from_node(m_p_root) == m_size)
+ return;
+ _GLIBCXX_DEBUG_ASSERT(0);
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size_under_node(const_node_pointer p_nd)
+{ return 1 + size_from_node(p_nd->m_p_l_child); }
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size_from_node(const_node_pointer p_nd)
+{
+ size_type ret = 0;
+ while (p_nd != NULL)
+ {
+ ret += 1 + size_from_node(p_nd->m_p_l_child);
+ p_nd = p_nd->m_p_next_sibling;
+ }
+ return ret;
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+degree(const_node_pointer p_nd)
+{
+ size_type ret = 0;
+ const_node_pointer p_child = p_nd->m_p_l_child;
+ while (p_child != NULL)
+ {
+ ++ret;
+ p_child = p_child->m_p_next_sibling;
+ }
+ return ret;
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp
new file mode 100644
index 0000000..9fa09f4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp
@@ -0,0 +1,150 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation class for left_child_next_sibling_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ clear_imp(m_p_root);
+ _GLIBCXX_DEBUG_ASSERT(m_size == 0);
+ m_p_root = NULL;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+actual_erase_node(node_pointer p_nd)
+{
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ --m_size;
+ p_nd->~node();
+ s_node_allocator.deallocate(p_nd, 1);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear_imp(node_pointer p_nd)
+{
+ while (p_nd != NULL)
+ {
+ clear_imp(p_nd->m_p_l_child);
+ node_pointer p_next = p_nd->m_p_next_sibling;
+ actual_erase_node(p_nd);
+ p_nd = p_next;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+to_linked_list()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ node_pointer p_cur = m_p_root;
+ while (p_cur != NULL)
+ if (p_cur->m_p_l_child != NULL)
+ {
+ node_pointer p_child_next = p_cur->m_p_l_child->m_p_next_sibling;
+ p_cur->m_p_l_child->m_p_next_sibling = p_cur->m_p_next_sibling;
+ p_cur->m_p_next_sibling = p_cur->m_p_l_child;
+ p_cur->m_p_l_child = p_child_next;
+ }
+ else
+ p_cur = p_cur->m_p_next_sibling;
+
+#ifdef _GLIBCXX_DEBUG
+ const_node_pointer p_counter = m_p_root;
+ size_type count = 0;
+ while (p_counter != NULL)
+ {
+ ++count;
+ _GLIBCXX_DEBUG_ASSERT(p_counter->m_p_l_child == NULL);
+ p_counter = p_counter->m_p_next_sibling;
+ }
+ _GLIBCXX_DEBUG_ASSERT(count == m_size);
+#endif
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+prune(Pred pred)
+{
+ node_pointer p_cur = m_p_root;
+ m_p_root = NULL;
+ node_pointer p_out = NULL;
+ while (p_cur != NULL)
+ {
+ node_pointer p_next = p_cur->m_p_next_sibling;
+ if (pred(p_cur->m_value))
+ {
+ p_cur->m_p_next_sibling = p_out;
+ if (p_out != NULL)
+ p_out->m_p_prev_or_parent = p_cur;
+ p_out = p_cur;
+ }
+ else
+ {
+ p_cur->m_p_next_sibling = m_p_root;
+ if (m_p_root != NULL)
+ m_p_root->m_p_prev_or_parent = p_cur;
+ m_p_root = p_cur;
+ }
+ p_cur = p_next;
+ }
+ return p_out;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+bubble_to_top(node_pointer p_nd)
+{
+ node_pointer p_parent = parent(p_nd);
+ while (p_parent != NULL)
+ {
+ swap_with_parent(p_nd, p_parent);
+ p_parent = parent(p_nd);
+ }
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp
new file mode 100644
index 0000000..75e6561
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp
@@ -0,0 +1,64 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file info_fn_imps.hpp
+ * Contains an implementation class for left_child_next_sibling_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+empty() const
+{
+ return (m_size == 0);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size() const
+{
+ return (m_size);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+max_size() const
+{
+ return (s_node_allocator.max_size());
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp
new file mode 100644
index 0000000..926ccd3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp
@@ -0,0 +1,175 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains an implementation class for left_child_next_sibling_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+get_new_node_for_insert(const_reference r_val)
+{
+ return get_new_node_for_insert(r_val, s_no_throw_copies_ind);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+get_new_node_for_insert(const_reference r_val, false_type)
+{
+ node_pointer p_new_nd = s_node_allocator.allocate(1);
+
+ cond_dealtor_t cond(p_new_nd);
+
+ new (const_cast<void* >(
+ static_cast<const void* >(&p_new_nd->m_value)))
+ typename node::value_type(r_val);
+
+ cond.set_no_action();
+
+ ++m_size;
+
+ return (p_new_nd);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+get_new_node_for_insert(const_reference r_val, true_type)
+{
+ node_pointer p_new_nd = s_node_allocator.allocate(1);
+
+ new (const_cast<void* >(
+ static_cast<const void* >(&p_new_nd->m_value)))
+ typename node::value_type(r_val);
+
+ ++m_size;
+
+ return (p_new_nd);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+make_child_of(node_pointer p_nd, node_pointer p_new_parent)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_new_parent != NULL);
+
+ p_nd->m_p_next_sibling = p_new_parent->m_p_l_child;
+
+ if (p_new_parent->m_p_l_child != NULL)
+ p_new_parent->m_p_l_child->m_p_prev_or_parent = p_nd;
+
+ p_nd->m_p_prev_or_parent = p_new_parent;
+
+ p_new_parent->m_p_l_child = p_nd;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+parent(node_pointer p_nd)
+{
+ while (true)
+ {
+ node_pointer p_pot = p_nd->m_p_prev_or_parent;
+
+ if (p_pot == NULL || p_pot->m_p_l_child == p_nd)
+ return p_pot;
+
+ p_nd = p_pot;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+swap_with_parent(node_pointer p_nd, node_pointer p_parent)
+{
+ if (p_parent == m_p_root)
+ m_p_root = p_nd;
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_parent != NULL);
+ _GLIBCXX_DEBUG_ASSERT(parent(p_nd) == p_parent);
+
+ const bool nd_direct_child = p_parent->m_p_l_child == p_nd;
+ const bool parent_root = p_parent->m_p_prev_or_parent == NULL;
+ const bool parent_direct_child =
+ !parent_root&& p_parent->m_p_prev_or_parent->m_p_l_child == p_parent;
+
+ std::swap(p_parent->m_p_prev_or_parent, p_nd->m_p_prev_or_parent);
+ std::swap(p_parent->m_p_next_sibling, p_nd->m_p_next_sibling);
+ std::swap(p_parent->m_p_l_child, p_nd->m_p_l_child);
+ std::swap(p_parent->m_metadata, p_nd->m_metadata);
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_l_child != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_parent->m_p_prev_or_parent != NULL);
+
+ if (p_nd->m_p_next_sibling != NULL)
+ p_nd->m_p_next_sibling->m_p_prev_or_parent = p_nd;
+
+ if (p_parent->m_p_next_sibling != NULL)
+ p_parent->m_p_next_sibling->m_p_prev_or_parent = p_parent;
+
+ if (p_parent->m_p_l_child != NULL)
+ p_parent->m_p_l_child->m_p_prev_or_parent = p_parent;
+
+ if (parent_direct_child)
+ p_nd->m_p_prev_or_parent->m_p_l_child = p_nd;
+ else if (!parent_root)
+ p_nd->m_p_prev_or_parent->m_p_next_sibling = p_nd;
+
+ if (!nd_direct_child)
+ {
+ p_nd->m_p_l_child->m_p_prev_or_parent = p_nd;
+
+ p_parent->m_p_prev_or_parent->m_p_next_sibling = p_parent;
+ }
+ else
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_l_child == p_nd);
+ _GLIBCXX_DEBUG_ASSERT(p_parent->m_p_prev_or_parent == p_parent);
+
+ p_nd->m_p_l_child = p_parent;
+ p_parent->m_p_prev_or_parent = p_nd;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(parent(p_parent) == p_nd);
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp
new file mode 100644
index 0000000..dca70fd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp
@@ -0,0 +1,88 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file iterators_fn_imps.hpp
+ * Contains an implementation class for left_child_next_sibling_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+begin()
+{
+ node_pointer p_nd = m_p_root;
+
+ if (p_nd == NULL)
+ return (iterator(NULL));
+
+ while (p_nd->m_p_l_child != NULL)
+ p_nd = p_nd->m_p_l_child;
+
+ return (iterator(p_nd));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+begin() const
+{
+ node_pointer p_nd = m_p_root;
+
+ if (p_nd == NULL)
+ return (const_iterator(NULL));
+
+ while (p_nd->m_p_l_child != NULL)
+ p_nd = p_nd->m_p_l_child;
+
+ return (const_iterator(p_nd));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+end()
+{
+ return (iterator(NULL));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+end() const
+{
+ return (const_iterator(NULL));
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp
new file mode 100644
index 0000000..34ad4be
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp
@@ -0,0 +1,349 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file left_child_next_sibling_heap_.hpp
+ * Contains an implementation class for a basic heap.
+ */
+
+#ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_HPP
+#define PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_HPP
+
+/*
+ * Based on CLRS.
+ */
+
+#include <iterator>
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/node.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/const_point_iterator.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp>
+#ifdef PB_DS_LC_NS_HEAP_TRACE_
+#include <iostream>
+#endif
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_CLASS_T_DEC \
+ template< \
+ typename Value_Type, \
+ class Cmp_Fn, \
+ typename Node_Metadata, \
+ class Allocator, \
+ bool Single_Link_Roots>
+#else
+#define PB_DS_CLASS_T_DEC \
+ template< \
+ typename Value_Type, \
+ class Cmp_Fn, \
+ typename Node_Metadata, \
+ class Allocator>
+#endif
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_CLASS_C_DEC \
+ left_child_next_sibling_heap_< \
+ Value_Type, \
+ Cmp_Fn, \
+ Node_Metadata, \
+ Allocator, \
+ Single_Link_Roots>
+#else
+#define PB_DS_CLASS_C_DEC \
+ left_child_next_sibling_heap_< \
+ Value_Type, \
+ Cmp_Fn, \
+ Node_Metadata, \
+ Allocator>
+#endif
+
+ /**
+ * class description = "Base class for some types of h3ap$">
+ **/
+#ifdef _GLIBCXX_DEBUG
+ template<typename Value_Type,
+ class Cmp_Fn,
+ typename Node_Metadata,
+ class Allocator,
+ bool Single_Link_Roots>
+#else
+ template<typename Value_Type,
+ class Cmp_Fn,
+ typename Node_Metadata,
+ class Allocator>
+#endif
+ class left_child_next_sibling_heap_ : public Cmp_Fn
+ {
+
+ protected:
+ typedef
+ typename Allocator::template rebind<
+ left_child_next_sibling_heap_node_<
+ Value_Type,
+ Node_Metadata,
+ Allocator> >::other
+ node_allocator;
+
+ typedef typename node_allocator::value_type node;
+
+ typedef typename node_allocator::pointer node_pointer;
+
+ typedef typename node_allocator::const_pointer const_node_pointer;
+
+ typedef Node_Metadata node_metadata;
+
+ typedef std::pair< node_pointer, node_pointer> node_pointer_pair;
+
+ private:
+ typedef cond_dealtor< node, Allocator> cond_dealtor_t;
+
+ enum
+ {
+ simple_value = is_simple<Value_Type>::value
+ };
+
+ typedef integral_constant<int, simple_value> no_throw_copies_t;
+
+ public:
+
+ typedef typename Allocator::size_type size_type;
+
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef Value_Type value_type;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::pointer
+ pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_pointer
+ const_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::reference
+ reference;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_reference
+ const_reference;
+
+ typedef
+ left_child_next_sibling_heap_node_const_point_iterator_<
+ node,
+ Allocator>
+ const_point_iterator;
+
+ typedef const_point_iterator point_iterator;
+
+ typedef
+ left_child_next_sibling_heap_const_iterator_<
+ node,
+ Allocator>
+ const_iterator;
+
+ typedef const_iterator iterator;
+
+ typedef Cmp_Fn cmp_fn;
+
+ typedef Allocator allocator_type;
+
+ public:
+
+ left_child_next_sibling_heap_();
+
+ left_child_next_sibling_heap_(const Cmp_Fn& r_cmp_fn);
+
+ left_child_next_sibling_heap_(const PB_DS_CLASS_C_DEC& other);
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ ~left_child_next_sibling_heap_();
+
+ inline bool
+ empty() const;
+
+ inline size_type
+ size() const;
+
+ inline size_type
+ max_size() const;
+
+ Cmp_Fn&
+ get_cmp_fn();
+
+ const Cmp_Fn&
+ get_cmp_fn() const;
+
+ inline iterator
+ begin();
+
+ inline const_iterator
+ begin() const;
+
+ inline iterator
+ end();
+
+ inline const_iterator
+ end() const;
+
+ void
+ clear();
+
+#ifdef PB_DS_LC_NS_HEAP_TRACE_
+ void
+ trace() const;
+#endif
+
+ protected:
+
+ inline node_pointer
+ get_new_node_for_insert(const_reference r_val);
+
+ inline static void
+ make_child_of(node_pointer p_nd, node_pointer p_new_parent);
+
+ void
+ value_swap(PB_DS_CLASS_C_DEC& other);
+
+ inline static node_pointer
+ parent(node_pointer p_nd);
+
+ inline void
+ swap_with_parent(node_pointer p_nd, node_pointer p_parent);
+
+ void
+ bubble_to_top(node_pointer p_nd);
+
+ inline void
+ actual_erase_node(node_pointer p_nd);
+
+ void
+ clear_imp(node_pointer p_nd);
+
+ void
+ to_linked_list();
+
+ template<typename Pred>
+ node_pointer
+ prune(Pred pred);
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+
+ void
+ assert_node_consistent(const_node_pointer p_nd, bool single_link) const;
+
+ static size_type
+ size_under_node(const_node_pointer p_nd);
+
+ static size_type
+ degree(const_node_pointer p_nd);
+#endif
+
+#ifdef PB_DS_LC_NS_HEAP_TRACE_
+ static void
+ trace_node(const_node_pointer, size_type level);
+#endif
+
+ protected:
+ node_pointer m_p_root;
+
+ size_type m_size;
+
+ private:
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_iterators() const;
+
+ void
+ assert_size() const;
+
+ static size_type
+ size_from_node(const_node_pointer p_nd);
+#endif
+
+ node_pointer
+ recursive_copy_node(const_node_pointer p_nd);
+
+ inline node_pointer
+ get_new_node_for_insert(const_reference r_val, false_type);
+
+ inline node_pointer
+ get_new_node_for_insert(const_reference r_val, true_type);
+
+#ifdef PB_DS_LC_NS_HEAP_TRACE_
+ template<typename Metadata_>
+ static void
+ trace_node_metadata(const_node_pointer p_nd, type_to_type<Metadata_>);
+
+ static void
+ trace_node_metadata(const_node_pointer, type_to_type<null_left_child_next_sibling_heap_node_metadata>);
+#endif
+
+ private:
+ static node_allocator s_node_allocator;
+
+ static no_throw_copies_t s_no_throw_copies_ind;
+ };
+
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/policy_access_fn_imps.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_CLASS_T_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/node.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/node.hpp
new file mode 100644
index 0000000..1cdfe28
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/node.hpp
@@ -0,0 +1,123 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file node.hpp
+ * Contains an implementation struct for this type of heap's node.
+ */
+
+#ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_NODE_HPP
+#define PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_NODE_HPP
+
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Value_Type, typename Metadata_Type, class Allocator>
+ struct left_child_next_sibling_heap_node_
+ {
+ private:
+ typedef
+ left_child_next_sibling_heap_node_<
+ Value_Type,
+ Metadata_Type,
+ Allocator>
+ this_type;
+
+ public:
+ typedef typename Allocator::size_type size_type;
+
+ typedef
+ typename Allocator::template rebind<
+ this_type>::other::pointer
+ node_pointer;
+
+ typedef Value_Type value_type;
+
+ typedef Metadata_Type metadata_type;
+
+ public:
+ value_type m_value;
+
+ metadata_type m_metadata;
+
+ node_pointer m_p_l_child;
+
+ node_pointer m_p_next_sibling;
+
+ node_pointer m_p_prev_or_parent;
+ };
+
+ template<typename Value_Type, class Allocator>
+ struct left_child_next_sibling_heap_node_<
+ Value_Type,
+ null_left_child_next_sibling_heap_node_metadata,
+ Allocator>
+ {
+ private:
+ typedef
+ left_child_next_sibling_heap_node_<
+ Value_Type,
+ null_left_child_next_sibling_heap_node_metadata,
+ Allocator>
+ this_type;
+
+ public:
+ typedef typename Allocator::size_type size_type;
+
+ typedef
+ typename Allocator::template rebind<
+ this_type>::other::pointer
+ node_pointer;
+
+ typedef Value_Type value_type;
+
+ public:
+ value_type m_value;
+
+ node_pointer m_p_l_child;
+
+ node_pointer m_p_next_sibling;
+
+ node_pointer m_p_prev_or_parent;
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_NODE_HPP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp
new file mode 100644
index 0000000..040466e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file null_metadata.hpp
+ * Contains an implementation struct for this type of heap's node.
+ */
+
+#ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_NULL_METADATA_HPP
+#define PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_NULL_METADATA_HPP
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ struct null_left_child_next_sibling_heap_node_metadata
+ { };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_NULL_METADATA_HPP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/policy_access_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/policy_access_fn_imps.hpp
new file mode 100644
index 0000000..350b4d0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/policy_access_fn_imps.hpp
@@ -0,0 +1,52 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file policy_access_fn_imps.hpp
+ * Contains an implementation class for left_child_next_sibling_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+Cmp_Fn&
+PB_DS_CLASS_C_DEC::
+get_cmp_fn()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Cmp_Fn&
+PB_DS_CLASS_C_DEC::
+get_cmp_fn() const
+{ return *this; }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp
new file mode 100644
index 0000000..2b90cfa
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp
@@ -0,0 +1,95 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trace_fn_imps.hpp
+ * Contains an implementation class for left_child_next_sibling_heap_.
+ */
+
+#ifdef PB_DS_LC_NS_HEAP_TRACE_
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace() const
+{
+ std::cerr << std::endl;
+
+ trace_node(m_p_root, 0);
+
+ std::cerr << std::endl;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace_node(const_node_pointer p_nd, size_type level)
+{
+ while (p_nd != NULL)
+ {
+ for (size_type i = 0; i < level; ++i)
+ std::cerr << ' ';
+
+ std::cerr << p_nd <<
+ " prev = " << p_nd->m_p_prev_or_parent <<
+ " next " << p_nd->m_p_next_sibling <<
+ " left = " << p_nd->m_p_l_child << " ";
+
+ trace_node_metadata(p_nd, type_to_type<node_metadata>());
+
+ std::cerr << p_nd->m_value << std::endl;
+
+ trace_node(p_nd->m_p_l_child, level + 1);
+
+ p_nd = p_nd->m_p_next_sibling;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Metadata_>
+void
+PB_DS_CLASS_C_DEC::
+trace_node_metadata(const_node_pointer p_nd, type_to_type<Metadata_>)
+{
+ std::cerr << "(" << p_nd->m_metadata << ") ";
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace_node_metadata(const_node_pointer, type_to_type<null_left_child_next_sibling_heap_node_metadata>)
+{ }
+
+#endif // #ifdef PB_DS_LC_NS_HEAP_TRACE_
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp
new file mode 100644
index 0000000..c998c3e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp
@@ -0,0 +1,141 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructor_destructor_fn_imps.hpp
+ * Contains implementations of PB_DS_CLASS_NAME.
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::entry_allocator
+PB_DS_CLASS_C_DEC::s_entry_allocator;
+
+PB_DS_CLASS_T_DEC
+Eq_Fn PB_DS_CLASS_C_DEC::s_eq_fn;
+
+PB_DS_CLASS_T_DEC
+null_lu_metadata PB_DS_CLASS_C_DEC::s_null_lu_metadata;
+
+PB_DS_CLASS_T_DEC
+Update_Policy PB_DS_CLASS_C_DEC::s_update_policy;
+
+PB_DS_CLASS_T_DEC
+type_to_type<
+ typename PB_DS_CLASS_C_DEC::update_metadata> PB_DS_CLASS_C_DEC::s_metadata_type_indicator;
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+ while (first_it != last_it)
+ insert(*(first_it++));
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME() : m_p_l(NULL)
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(It first_it, It last_it) : m_p_l(NULL)
+{
+ copy_from_range(first_it, last_it);
+ _GLIBCXX_DEBUG_ONLY(assert_valid(););
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) :
+#ifdef _GLIBCXX_DEBUG
+ debug_base(),
+#endif
+m_p_l(NULL)
+{
+ __try
+ {
+ for (const_iterator it = other.begin(); it != other.end(); ++it)
+ {
+ entry_pointer p_l = allocate_new_entry(*it,
+ PB_DS_TYPES_TRAITS_C_DEC::m_no_throw_copies_indicator);
+
+ p_l->m_p_next = m_p_l;
+ m_p_l = p_l;
+ }
+ }
+ __catch(...)
+ {
+ deallocate_all();
+ __throw_exception_again;
+ }
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(debug_base::swap(other);)
+ std::swap(m_p_l, other.m_p_l);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+deallocate_all()
+{
+ entry_pointer p_l = m_p_l;
+ while (p_l != NULL)
+ {
+ entry_pointer p_next_l = p_l->m_p_next;
+ actual_erase_entry(p_l);
+ p_l = p_next_l;
+ }
+ m_p_l = NULL;
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~PB_DS_CLASS_NAME()
+{ deallocate_all(); }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp
new file mode 100644
index 0000000..95e9e22
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp
@@ -0,0 +1,57 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains implementations of cc_ht_map_'s debug-mode functions.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ size_type calc_size = 0;
+ for (const_iterator it = begin(); it != end(); ++it)
+ {
+ debug_base::check_key_exists(PB_DS_V2F(*it));
+ ++calc_size;
+ }
+ debug_base::check_size(calc_size);
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/entry_metadata_base.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/entry_metadata_base.hpp
new file mode 100644
index 0000000..021ef50
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/entry_metadata_base.hpp
@@ -0,0 +1,60 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file entry_metadata_base.hpp
+ * Contains an implementation for a list update map.
+ */
+
+#ifndef PB_DS_LU_MAP_ENTRY_METADATA_BASE_HPP
+#define PB_DS_LU_MAP_ENTRY_METADATA_BASE_HPP
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Metadata>
+ struct lu_map_entry_metadata_base
+ {
+ Metadata m_update_metadata;
+ };
+
+ template<>
+ struct lu_map_entry_metadata_base<null_lu_metadata>
+ { };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp
new file mode 100644
index 0000000..cdc5920
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp
@@ -0,0 +1,135 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains implementations of lu_map_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+erase(const_key_reference r_key)
+{
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ if (m_p_l == NULL)
+ return false;
+
+ if (s_eq_fn(r_key, PB_DS_V2F(m_p_l->m_value)))
+ {
+ entry_pointer p_next = m_p_l->m_p_next;
+ actual_erase_entry(m_p_l);
+ m_p_l = p_next;
+ return true;
+ }
+
+ entry_pointer p_l = m_p_l;
+ while (p_l->m_p_next != NULL)
+ if (s_eq_fn(r_key, PB_DS_V2F(p_l->m_p_next->m_value)))
+ {
+ erase_next(p_l);
+ return true;
+ }
+ else
+ p_l = p_l->m_p_next;
+ return false;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ deallocate_all();
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ size_type num_ersd = 0;
+ while (m_p_l != NULL && pred(m_p_l->m_value))
+ {
+ entry_pointer p_next = m_p_l->m_p_next;
+ ++num_ersd;
+ actual_erase_entry(m_p_l);
+ m_p_l = p_next;
+ }
+
+ if (m_p_l == NULL)
+ return num_ersd;
+
+ entry_pointer p_l = m_p_l;
+ while (p_l->m_p_next != NULL)
+ {
+ if (pred(p_l->m_p_next->m_value))
+ {
+ ++num_ersd;
+ erase_next(p_l);
+ }
+ else
+ p_l = p_l->m_p_next;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ return num_ersd;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase_next(entry_pointer p_l)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_l != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_l != m_p_l);
+ _GLIBCXX_DEBUG_ASSERT(p_l->m_p_next != NULL);
+ entry_pointer p_next_l = p_l->m_p_next->m_p_next;
+ actual_erase_entry(p_l->m_p_next);
+ p_l->m_p_next = p_next_l;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+actual_erase_entry(entry_pointer p_l)
+{
+ _GLIBCXX_DEBUG_ONLY(debug_base::erase_existing(PB_DS_V2F(p_l->m_value));)
+ p_l->~entry();
+ s_entry_allocator.deallocate(p_l, 1);
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp
new file mode 100644
index 0000000..50347ac
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp
@@ -0,0 +1,90 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains implementations of lu_map_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::entry_pointer
+PB_DS_CLASS_C_DEC::
+find_imp(const_key_reference r_key) const
+{
+ if (m_p_l == NULL)
+ return NULL;
+ if (s_eq_fn(r_key, PB_DS_V2F(m_p_l->m_value)))
+ {
+ apply_update(m_p_l, s_metadata_type_indicator);
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);)
+ return m_p_l;
+ }
+
+ entry_pointer p_l = m_p_l;
+ while (p_l->m_p_next != NULL)
+ {
+ entry_pointer p_next = p_l->m_p_next;
+ if (s_eq_fn(r_key, PB_DS_V2F(p_next->m_value)))
+ {
+ if (apply_update(p_next, s_metadata_type_indicator))
+ {
+ p_l->m_p_next = p_next->m_p_next;
+ p_next->m_p_next = m_p_l;
+ m_p_l = p_next;
+ return m_p_l;
+ }
+ return p_next;
+ }
+ else
+ p_l = p_next;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ return NULL;
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Metadata>
+inline bool
+PB_DS_CLASS_C_DEC::
+apply_update(entry_pointer p_l, type_to_type<Metadata>)
+{ return s_update_policy(p_l->m_update_metadata); }
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+apply_update(entry_pointer, type_to_type<null_lu_metadata>)
+{ return s_update_policy(s_null_lu_metadata); }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp
new file mode 100644
index 0000000..5ad3970
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp
@@ -0,0 +1,57 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file info_fn_imps.hpp
+ * Contains implementations of lu_map_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size() const
+{ return std::distance(begin(), end()); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+max_size() const
+{ return s_entry_allocator.max_size(); }
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+empty() const
+{ return (m_p_l == NULL); }
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp
new file mode 100644
index 0000000..5efe2a1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp
@@ -0,0 +1,106 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains implementations of lu_map_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline std::pair<
+ typename PB_DS_CLASS_C_DEC::point_iterator,
+ bool>
+PB_DS_CLASS_C_DEC::
+insert(const_reference r_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ entry_pointer p_l = find_imp(PB_DS_V2F(r_val));
+
+ if (p_l != NULL)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(PB_DS_V2F(r_val));)
+ return std::make_pair(point_iterator(&p_l->m_value), false);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(PB_DS_V2F(r_val));)
+
+ p_l = allocate_new_entry(r_val, traits_base::m_no_throw_copies_indicator);
+ p_l->m_p_next = m_p_l;
+ m_p_l = p_l;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return std::make_pair(point_iterator(&p_l->m_value), true);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::entry_pointer
+PB_DS_CLASS_C_DEC::
+allocate_new_entry(const_reference r_val, false_type)
+{
+ entry_pointer p_l = s_entry_allocator.allocate(1);
+ cond_dealtor_t cond(p_l);
+ new (const_cast<void* >(static_cast<const void* >(&p_l->m_value)))
+ value_type(r_val);
+
+ cond.set_no_action();
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(r_val));)
+ init_entry_metadata(p_l, s_metadata_type_indicator);
+ return p_l;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::entry_pointer
+PB_DS_CLASS_C_DEC::
+allocate_new_entry(const_reference r_val, true_type)
+{
+ entry_pointer p_l = s_entry_allocator.allocate(1);
+ new (&p_l->m_value) value_type(r_val);
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(r_val));)
+ init_entry_metadata(p_l, s_metadata_type_indicator);
+ return p_l;
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Metadata>
+inline void
+PB_DS_CLASS_C_DEC::
+init_entry_metadata(entry_pointer p_l, type_to_type<Metadata>)
+{ new (&p_l->m_update_metadata) Metadata(s_update_policy()); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+init_entry_metadata(entry_pointer, type_to_type<null_lu_metadata>)
+{ }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp
new file mode 100644
index 0000000..e3247c5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp
@@ -0,0 +1,80 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file iterators_fn_imps.hpp
+ * Contains implementations of lu_map_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+begin()
+{
+ if (m_p_l == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(empty());
+ return end();
+ }
+ return iterator(&m_p_l->m_value, m_p_l, this);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+begin() const
+{
+ if (m_p_l == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(empty());
+ return end();
+ }
+ return iterator(&m_p_l->m_value, m_p_l, const_cast<PB_DS_CLASS_C_DEC* >(this));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+end()
+{ return iterator(NULL, NULL, this); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+end() const
+{
+ return const_iterator(NULL, NULL, const_cast<PB_DS_CLASS_C_DEC* const>(this));
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/lu_map_.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/lu_map_.hpp
new file mode 100644
index 0000000..0e9336b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/lu_map_.hpp
@@ -0,0 +1,359 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file lu_map_.hpp
+ * Contains a list update map.
+ */
+
+#include <utility>
+#include <iterator>
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <ext/pb_ds/detail/types_traits.hpp>
+#include <ext/pb_ds/detail/list_update_map_/entry_metadata_base.hpp>
+#include <ext/pb_ds/exception.hpp>
+#ifdef _GLIBCXX_DEBUG
+#include <ext/pb_ds/detail/debug_map_base.hpp>
+#endif
+#ifdef PB_DS_LU_MAP_TRACE_
+#include <iostream>
+#endif
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Mapped, class Eq_Fn, \
+ class Allocator, class Update_Policy>
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_CLASS_NAME lu_map_data_
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_CLASS_NAME lu_map_no_data_
+#endif
+
+#define PB_DS_CLASS_C_DEC \
+ PB_DS_CLASS_NAME<Key, Mapped, Eq_Fn, Allocator, Update_Policy>
+
+#define PB_DS_TYPES_TRAITS_C_DEC \
+ types_traits<Key, Mapped, Allocator, false>
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_DEBUG_MAP_BASE_C_DEC \
+ debug_map_base<Key, Eq_Fn, \
+ typename Allocator::template rebind<Key>::other::const_reference>
+#endif
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_V2F(X) (X).first
+#define PB_DS_V2S(X) (X).second
+#define PB_DS_EP2VP(X)& ((X)->m_value)
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_V2F(X) (X)
+#define PB_DS_V2S(X) Mapped_Data()
+#define PB_DS_EP2VP(X)& ((X)->m_value.first)
+#endif
+
+ /* Skip to the lu, my darling. */
+ // list-based (with updates) associative container.
+ template<typename Key,
+ typename Mapped,
+ class Eq_Fn,
+ class Allocator,
+ class Update_Policy>
+ class PB_DS_CLASS_NAME :
+#ifdef _GLIBCXX_DEBUG
+ protected PB_DS_DEBUG_MAP_BASE_C_DEC,
+#endif
+ public PB_DS_TYPES_TRAITS_C_DEC
+ {
+ private:
+ typedef PB_DS_TYPES_TRAITS_C_DEC traits_base;
+
+ struct entry
+ : public lu_map_entry_metadata_base<typename Update_Policy::metadata_type>
+ {
+ typename traits_base::value_type m_value;
+ typename Allocator::template rebind<entry>::other::pointer m_p_next;
+ };
+
+ typedef typename Allocator::template rebind<entry>::other entry_allocator;
+ typedef typename entry_allocator::pointer entry_pointer;
+ typedef typename entry_allocator::const_pointer const_entry_pointer;
+ typedef typename entry_allocator::reference entry_reference;
+ typedef typename entry_allocator::const_reference const_entry_reference;
+
+ typedef typename Allocator::template rebind<entry_pointer>::other entry_pointer_allocator;
+ typedef typename entry_pointer_allocator::pointer entry_pointer_array;
+
+ typedef typename traits_base::value_type value_type_;
+ typedef typename traits_base::pointer pointer_;
+ typedef typename traits_base::const_pointer const_pointer_;
+ typedef typename traits_base::reference reference_;
+ typedef typename traits_base::const_reference const_reference_;
+
+#define PB_DS_GEN_POS entry_pointer
+
+#include <ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp>
+#include <ext/pb_ds/detail/unordered_iterator/point_iterator.hpp>
+#include <ext/pb_ds/detail/unordered_iterator/const_iterator.hpp>
+#include <ext/pb_ds/detail/unordered_iterator/iterator.hpp>
+
+#undef PB_DS_GEN_POS
+
+
+#ifdef _GLIBCXX_DEBUG
+ typedef PB_DS_DEBUG_MAP_BASE_C_DEC debug_base;
+#endif
+
+ typedef cond_dealtor<entry, Allocator> cond_dealtor_t;
+
+ public:
+ typedef Allocator allocator_type;
+ typedef typename Allocator::size_type size_type;
+ typedef typename Allocator::difference_type difference_type;
+ typedef Eq_Fn eq_fn;
+ typedef Update_Policy update_policy;
+ typedef typename Update_Policy::metadata_type update_metadata;
+ typedef typename traits_base::key_type key_type;
+ typedef typename traits_base::key_pointer key_pointer;
+ typedef typename traits_base::const_key_pointer const_key_pointer;
+ typedef typename traits_base::key_reference key_reference;
+ typedef typename traits_base::const_key_reference const_key_reference;
+ typedef typename traits_base::mapped_type mapped_type;
+ typedef typename traits_base::mapped_pointer mapped_pointer;
+ typedef typename traits_base::const_mapped_pointer const_mapped_pointer;
+ typedef typename traits_base::mapped_reference mapped_reference;
+ typedef typename traits_base::const_mapped_reference const_mapped_reference;
+ typedef typename traits_base::value_type value_type;
+ typedef typename traits_base::pointer pointer;
+ typedef typename traits_base::const_pointer const_pointer;
+ typedef typename traits_base::reference reference;
+ typedef typename traits_base::const_reference const_reference;
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ typedef point_iterator_ point_iterator;
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+ typedef const_point_iterator_ point_iterator;
+#endif
+
+ typedef const_point_iterator_ const_point_iterator;
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ typedef iterator_ iterator;
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+ typedef const_iterator_ iterator;
+#endif
+
+ typedef const_iterator_ const_iterator;
+
+ public:
+ PB_DS_CLASS_NAME();
+
+ PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC&);
+
+ virtual
+ ~PB_DS_CLASS_NAME();
+
+ template<typename It>
+ PB_DS_CLASS_NAME(It first_it, It last_it);
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+
+ inline size_type
+ size() const;
+
+ inline size_type
+ max_size() const;
+
+ inline bool
+ empty() const;
+
+ inline mapped_reference
+ operator[](const_key_reference r_key)
+ {
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return insert(std::make_pair(r_key, mapped_type())).first->second;
+#else
+ insert(r_key);
+ return traits_base::s_null_mapped;
+#endif
+ }
+
+ inline std::pair<point_iterator, bool>
+ insert(const_reference);
+
+ inline point_iterator
+ find(const_key_reference r_key)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ entry_pointer p_e = find_imp(r_key);
+ return point_iterator(p_e == NULL ? NULL: &p_e->m_value);
+ }
+
+ inline const_point_iterator
+ find(const_key_reference r_key) const
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ entry_pointer p_e = find_imp(r_key);
+ return const_point_iterator(p_e == NULL ? NULL: &p_e->m_value);
+ }
+
+ inline bool
+ erase(const_key_reference);
+
+ template<typename Pred>
+ inline size_type
+ erase_if(Pred);
+
+ void
+ clear();
+
+ inline iterator
+ begin();
+
+ inline const_iterator
+ begin() const;
+
+ inline iterator
+ end();
+
+ inline const_iterator
+ end() const;
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+
+#ifdef PB_DS_LU_MAP_TRACE_
+ void
+ trace() const;
+#endif
+
+ protected:
+
+ template<typename It>
+ void
+ copy_from_range(It, It);
+
+ private:
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ friend class iterator_;
+#endif
+
+ friend class const_iterator_;
+
+ inline entry_pointer
+ allocate_new_entry(const_reference, false_type);
+
+ inline entry_pointer
+ allocate_new_entry(const_reference, true_type);
+
+ template<typename Metadata>
+ inline static void
+ init_entry_metadata(entry_pointer, type_to_type<Metadata>);
+
+ inline static void
+ init_entry_metadata(entry_pointer, type_to_type<null_lu_metadata>);
+
+ void
+ deallocate_all();
+
+ void
+ erase_next(entry_pointer);
+
+ void
+ actual_erase_entry(entry_pointer);
+
+ void
+ inc_it_state(const_pointer& r_p_value, entry_pointer& r_pos) const
+ {
+ r_pos = r_pos->m_p_next;
+ r_p_value = (r_pos == NULL) ? NULL : &r_pos->m_value;
+ }
+
+ template<typename Metadata>
+ inline static bool
+ apply_update(entry_pointer, type_to_type<Metadata>);
+
+ inline static bool
+ apply_update(entry_pointer, type_to_type<null_lu_metadata>);
+
+ inline entry_pointer
+ find_imp(const_key_reference) const;
+
+ static entry_allocator s_entry_allocator;
+ static Eq_Fn s_eq_fn;
+ static Update_Policy s_update_policy;
+ static type_to_type<update_metadata> s_metadata_type_indicator;
+ static null_lu_metadata s_null_lu_metadata;
+
+ mutable entry_pointer m_p_l;
+ };
+
+#include <ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp>
+#include <ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp>
+#include <ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp>
+#include <ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_TYPES_TRAITS_C_DEC
+#undef PB_DS_DEBUG_MAP_BASE_C_DEC
+#undef PB_DS_CLASS_NAME
+#undef PB_DS_V2F
+#undef PB_DS_EP2VP
+#undef PB_DS_V2S
+
+ } // namespace detail
+} // namespace __gnu_pbds
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp
new file mode 100644
index 0000000..908aacc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trace_fn_imps.hpp
+ * Contains implementations of lu_map_.
+ */
+
+#ifdef PB_DS_LU_MAP_TRACE_
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace() const
+{
+ std::cerr << m_p_l << std::endl << std::endl;
+ const_entry_pointer p_l = m_p_l;
+ while (p_l != NULL)
+ {
+ std::cerr << PB_DS_V2F(p_l->m_value) << std::endl;
+ p_l = p_l->m_p_next;
+ }
+ std::cerr << std::endl;
+}
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp
new file mode 100644
index 0000000..4ef7fe4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp
@@ -0,0 +1,86 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file counter_lu_metadata.hpp
+ * Contains implementation of a lu counter policy's metadata.
+ */
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Size_Type>
+ class counter_lu_policy_base;
+
+ // A list-update metadata type that moves elements to the front of
+ // the list based on the counter algorithm.
+ template<typename Size_Type = size_t>
+ class counter_lu_metadata
+ {
+ public:
+ typedef Size_Type size_type;
+
+ private:
+ counter_lu_metadata(size_type init_count) : m_count(init_count)
+ { }
+
+ friend class counter_lu_policy_base<size_type>;
+
+ mutable size_type m_count;
+ };
+
+ template<typename Size_Type>
+ class counter_lu_policy_base
+ {
+ protected:
+ typedef Size_Type size_type;
+
+ counter_lu_metadata<size_type>
+ operator()(size_type max_size) const
+ { return counter_lu_metadata<Size_Type>(std::rand() % max_size); }
+
+ template<typename Metadata_Reference>
+ bool
+ operator()(Metadata_Reference r_data, size_type m_max_count) const
+ {
+ if (++r_data.m_count != m_max_count)
+ return false;
+ r_data.m_count = 0;
+ return true;
+ }
+ };
+ } // namespace detail
+} // namespace __gnu_pbds
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_policy/counter_lu_policy_imp.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_policy/counter_lu_policy_imp.hpp
new file mode 100644
index 0000000..f74a9fb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_policy/counter_lu_policy_imp.hpp
@@ -0,0 +1,51 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file counter_lu_policy_imp.hpp
+ * Contains a lu counter policy implementation.
+ */
+
+PB_DS_CLASS_T_DEC
+detail::counter_lu_metadata<typename Allocator::size_type>
+PB_DS_CLASS_C_DEC::
+operator()() const
+{ return (base_type::operator()(max_count)); }
+
+PB_DS_CLASS_T_DEC
+bool
+PB_DS_CLASS_C_DEC::
+operator()(metadata_reference r_data) const
+{ return (base_type::operator()(r_data, max_count)); }
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_policy/mtf_lu_policy_imp.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_policy/mtf_lu_policy_imp.hpp
new file mode 100644
index 0000000..34426c5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_policy/mtf_lu_policy_imp.hpp
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file mtf_lu_policy_imp.hpp
+ * Contains a move-to-front policy implementation.
+ */
+
+PB_DS_CLASS_T_DEC
+null_lu_metadata PB_DS_CLASS_C_DEC::s_metadata;
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::metadata_type
+PB_DS_CLASS_C_DEC::
+operator()() const
+{ return s_metadata; }
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+operator()(metadata_reference /*r_data*/) const
+{ return true; }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_policy/sample_update_policy.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_policy/sample_update_policy.hpp
new file mode 100644
index 0000000..c5da1e9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/list_update_policy/sample_update_policy.hpp
@@ -0,0 +1,74 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_update_policy.hpp
+ * Contains a sample policy for list update containers.
+ */
+
+#ifndef PB_DS_SAMPLE_UPDATE_POLICY_HPP
+#define PB_DS_SAMPLE_UPDATE_POLICY_HPP
+
+// A sample list-update policy.
+struct sample_update_policy
+{
+ // Default constructor.
+ sample_update_policy();
+
+ // Copy constructor.
+ sample_update_policy(const sample_update_policy&);
+
+ // Swaps content.
+ inline void
+ swap(sample_update_policy& other);
+
+protected:
+ // Metadata on which this functor operates.
+ typedef some_metadata_type metadata_type;
+
+ // Creates a metadata object.
+ metadata_type
+ operator()() const;
+
+ // Decides whether a metadata object should be moved to the front of
+ // the list. A list-update based containers object will call this
+ // method to decide whether to move a node to the front of the
+ // list. The method shoule return true if the node should be moved
+ // to the front of the list.
+ bool
+ operator()(metadata_reference) const;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/cond_dtor.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/cond_dtor.hpp
new file mode 100644
index 0000000..e2c4b9a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/cond_dtor.hpp
@@ -0,0 +1,74 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file cond_dtor.hpp
+ * Contains a conditional destructor
+ */
+
+template<typename Size_Type>
+class cond_dtor
+{
+public:
+ cond_dtor(value_vector a_vec, iterator& r_last_it, Size_Type total_size)
+ : m_a_vec(a_vec), m_r_last_it(r_last_it), m_max_size(total_size),
+ m_no_action(false)
+ { }
+
+ ~cond_dtor()
+ {
+ if (m_no_action)
+ return;
+ iterator it = m_a_vec;
+ while (it != m_r_last_it)
+ {
+ it->~value_type();
+ ++it;
+ }
+
+ if (m_max_size > 0)
+ value_allocator().deallocate(m_a_vec, m_max_size);
+ }
+
+ inline void
+ set_no_action()
+ { m_no_action = true; }
+
+protected:
+ value_vector m_a_vec;
+ iterator& m_r_last_it;
+ const Size_Type m_max_size;
+ bool m_no_action;
+};
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..545b981
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,273 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation class for ov_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::value_allocator
+PB_DS_CLASS_C_DEC::s_value_alloc;
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::metadata_allocator
+PB_DS_CLASS_C_DEC::s_metadata_alloc;
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_OV_TREE_CLASS_NAME() :
+ m_a_values(NULL),
+ m_a_metadata(NULL),
+ m_end_it(NULL),
+ m_size(0)
+{ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_OV_TREE_CLASS_NAME(const Cmp_Fn& r_cmp_fn) :
+ cmp_fn_base(r_cmp_fn),
+ m_a_values(NULL),
+ m_a_metadata(NULL),
+ m_end_it(NULL),
+ m_size(0)
+{ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_OV_TREE_CLASS_NAME(const Cmp_Fn& r_cmp_fn, const node_update& r_node_update) :
+ cmp_fn_base(r_cmp_fn),
+ node_update(r_node_update),
+ m_a_values(NULL),
+ m_a_metadata(NULL),
+ m_end_it(NULL),
+ m_size(0)
+{ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_OV_TREE_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) :
+#ifdef _GLIBCXX_DEBUG
+ debug_base(other),
+#endif
+#ifdef PB_DS_TREE_TRACE
+ PB_DS_TREE_TRACE_BASE_C_DEC(other),
+#endif
+ cmp_fn_base(other),
+ node_update(other),
+ m_a_values(NULL),
+ m_a_metadata(NULL),
+ m_end_it(NULL),
+ m_size(0)
+{
+ copy_from_ordered_range(other.begin(), other.end());
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+inline void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ typedef
+ std::map<
+ key_type,
+ mapped_type,
+ Cmp_Fn,
+ typename Allocator::template rebind<
+ value_type>::other>
+ map_type;
+#else
+ typedef
+ std::set<
+ key_type,
+ Cmp_Fn,
+ typename Allocator::template rebind<
+ Key>::other>
+ map_type;
+#endif
+
+ map_type m(first_it, last_it);
+ copy_from_ordered_range(m.begin(), m.end());
+}
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_ordered_range(It first_it, It last_it)
+{
+ const size_type len = std::distance(first_it, last_it);
+ if (len == 0)
+ return;
+
+ value_vector a_values = s_value_alloc.allocate(len);
+ iterator target_it = a_values;
+ It source_it = first_it;
+ It source_end_it = last_it;
+
+ cond_dtor<size_type> cd(a_values, target_it, len);
+ while (source_it != source_end_it)
+ {
+ new (const_cast<void* >(static_cast<const void* >(target_it)))
+ value_type(*source_it++);
+
+ ++target_it;
+ }
+
+ reallocate_metadata((node_update* )this, len);
+ cd.set_no_action();
+ m_a_values = a_values;
+ m_size = len;
+ m_end_it = m_a_values + m_size;
+ update(PB_DS_node_begin_imp(), (node_update* )this);
+
+#ifdef _GLIBCXX_DEBUG
+ const_iterator dbg_it = m_a_values;
+ while (dbg_it != m_end_it)
+ {
+ debug_base::insert_new(PB_DS_V2F(*dbg_it));
+ dbg_it++;
+ }
+ PB_DS_CLASS_C_DEC::assert_valid();
+#endif
+}
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_ordered_range(It first_it, It last_it, It other_first_it,
+ It other_last_it)
+{
+ clear();
+ const size_type len = std::distance(first_it, last_it)
+ + std::distance(other_first_it, other_last_it);
+
+ value_vector a_values = s_value_alloc.allocate(len);
+
+ iterator target_it = a_values;
+ It source_it = first_it;
+ It source_end_it = last_it;
+
+ cond_dtor<size_type> cd(a_values, target_it, len);
+ while (source_it != source_end_it)
+ {
+ new (const_cast<void* >(static_cast<const void* >(target_it)))
+ value_type(*source_it++);
+ ++target_it;
+ }
+
+ source_it = other_first_it;
+ source_end_it = other_last_it;
+
+ while (source_it != source_end_it)
+ {
+ new (const_cast<void* >(static_cast<const void* >(target_it)))
+ value_type(*source_it++);
+ ++target_it;
+ }
+
+ reallocate_metadata((node_update* )this, len);
+ cd.set_no_action();
+ m_a_values = a_values;
+ m_size = len;
+ m_end_it = m_a_values + m_size;
+ update(PB_DS_node_begin_imp(), (node_update* )this);
+
+#ifdef _GLIBCXX_DEBUG
+ const_iterator dbg_it = m_a_values;
+ while (dbg_it != m_end_it)
+ {
+ debug_base::insert_new(PB_DS_V2F(*dbg_it));
+ dbg_it++;
+ }
+ PB_DS_CLASS_C_DEC::assert_valid();
+#endif
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ value_swap(other);
+ std::swap((Cmp_Fn& )(*this), (Cmp_Fn& )other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+value_swap(PB_DS_CLASS_C_DEC& other)
+{
+ std::swap(m_a_values, other.m_a_values);
+ std::swap(m_a_metadata, other.m_a_metadata);
+ std::swap(m_size, other.m_size);
+ std::swap(m_end_it, other.m_end_it);
+ _GLIBCXX_DEBUG_ONLY(debug_base::swap(other);)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~PB_DS_OV_TREE_CLASS_NAME()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ cond_dtor<size_type> cd(m_a_values, m_end_it, m_size);
+ reallocate_metadata((node_update* )this, 0);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+update(node_iterator /*it*/, null_node_update_pointer)
+{ }
+
+PB_DS_CLASS_T_DEC
+template<typename Node_Update>
+void
+PB_DS_CLASS_C_DEC::
+update(node_iterator nd_it, Node_Update* p_update)
+{
+ const_node_iterator end_it = PB_DS_node_end_imp();
+ if (nd_it == end_it)
+ return;
+ update(nd_it.get_l_child(), p_update);
+ update(nd_it.get_r_child(), p_update);
+ node_update::operator()(nd_it, end_it);
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp
new file mode 100644
index 0000000..c32a8af
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp
@@ -0,0 +1,84 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation class for ov_tree_.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ std::cout << "av1" << std::endl;
+
+ if (m_a_values == NULL || m_end_it == NULL || m_size == 0)
+ _GLIBCXX_DEBUG_ASSERT(m_a_values == NULL && m_end_it == NULL && m_size == 0);
+
+ std::cout << "av2" << std::endl;
+ assert_iterators();
+ std::cout << "av3" << std::endl;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_iterators() const
+{
+ debug_base::check_size(m_size);
+ size_type iterated_num = 0;
+ const_iterator prev_it = end();
+ _GLIBCXX_DEBUG_ASSERT( m_end_it == m_a_values + m_size);
+ for (const_iterator it = begin(); it != end(); ++it)
+ {
+ ++iterated_num;
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(PB_DS_V2F(*it));)
+ _GLIBCXX_DEBUG_ASSERT(lower_bound(PB_DS_V2F(*it)) == it);
+ const_iterator upper_bound_it = upper_bound(PB_DS_V2F(*it));
+ --upper_bound_it;
+ _GLIBCXX_DEBUG_ASSERT(upper_bound_it == it);
+ if (prev_it != end())
+ _GLIBCXX_DEBUG_ASSERT(Cmp_Fn::operator()(PB_DS_V2F(*prev_it),
+ PB_DS_V2F(*it)));
+ prev_it = it;
+ }
+ _GLIBCXX_DEBUG_ASSERT(iterated_num == m_size);
+}
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp
new file mode 100644
index 0000000..618306d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp
@@ -0,0 +1,193 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation class for ov_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ if (m_size == 0)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return;
+ }
+ else
+ {
+ reallocate_metadata((node_update* )this, 0);
+ cond_dtor<size_type> cd(m_a_values, m_end_it, m_size);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::clear();)
+ m_a_values = NULL;
+ m_size = 0;
+ m_end_it = m_a_values;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+#ifdef PB_DS_REGRESSION
+ typename Allocator::group_throw_prob_adjustor adjust(m_size);
+#endif
+
+ size_type new_size = 0;
+ size_type num_val_ersd = 0;
+ iterator source_it = m_a_values;
+ for (source_it = begin(); source_it != m_end_it; ++source_it)
+ if (!pred(*source_it))
+ ++new_size;
+ else
+ ++num_val_ersd;
+
+ if (new_size == 0)
+ {
+ clear();
+ return num_val_ersd;
+ }
+
+ value_vector a_new_values = s_value_alloc.allocate(new_size);
+ iterator target_it = a_new_values;
+ cond_dtor<size_type> cd(a_new_values, target_it, new_size);
+ _GLIBCXX_DEBUG_ONLY(debug_base::clear());
+ for (source_it = begin(); source_it != m_end_it; ++source_it)
+ {
+ if (!pred(*source_it))
+ {
+ new (const_cast<void*>(static_cast<const void* >(target_it)))
+ value_type(*source_it);
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(*source_it)));
+ ++target_it;
+ }
+ }
+
+ reallocate_metadata((node_update* )this, new_size);
+ cd.set_no_action();
+
+ {
+ cond_dtor<size_type> cd1(m_a_values, m_end_it, m_size);
+ }
+
+ m_a_values = a_new_values;
+ m_size = new_size;
+ m_end_it = target_it;
+ update(node_begin(), (node_update* )this);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return num_val_ersd;
+}
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+It
+PB_DS_CLASS_C_DEC::
+erase_imp(It it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ if (it == end())
+ return end();
+
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::check_key_exists(PB_DS_V2F(*it));)
+
+#ifdef PB_DS_REGRESSION
+ typename Allocator::group_throw_prob_adjustor adjust(m_size);
+#endif
+
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ value_vector a_values = s_value_alloc.allocate(m_size - 1);
+ iterator source_it = begin();
+ iterator source_end_it = end();
+ iterator target_it = a_values;
+ iterator ret_it = end();
+
+ cond_dtor<size_type> cd(a_values, target_it, m_size - 1);
+
+ _GLIBCXX_DEBUG_ONLY(size_type cnt = 0;)
+
+ while (source_it != source_end_it)
+ {
+ if (source_it != it)
+ {
+ _GLIBCXX_DEBUG_ONLY(++cnt;)
+ _GLIBCXX_DEBUG_ASSERT(cnt != m_size);
+ new (const_cast<void* >(static_cast<const void* >(target_it)))
+ value_type(*source_it);
+
+ ++target_it;
+ }
+ else
+ ret_it = target_it;
+ ++source_it;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ reallocate_metadata((node_update* )this, m_size - 1);
+ cd.set_no_action();
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::erase_existing(PB_DS_V2F(*it));)
+ {
+ cond_dtor<size_type> cd1(m_a_values, m_end_it, m_size);
+ }
+
+ m_a_values = a_values;
+ --m_size;
+ m_end_it = m_a_values + m_size;
+ update(node_begin(), (node_update* )this);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return It(ret_it);
+}
+
+PB_DS_CLASS_T_DEC
+bool
+PB_DS_CLASS_C_DEC::
+erase(const_key_reference r_key)
+{
+ point_iterator it = find(r_key);
+ if (it == end())
+ return false;
+ erase(it);
+ return true;
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp
new file mode 100644
index 0000000..c9421af
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp
@@ -0,0 +1,60 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file info_fn_imps.hpp
+ * Contains an implementation class for ov_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size() const
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return m_size;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+max_size() const
+{ return s_value_alloc.max_size(); }
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+empty() const
+{ return size() == 0; }
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp
new file mode 100644
index 0000000..91d277b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp
@@ -0,0 +1,63 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains an implementation class for ov_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+reallocate_metadata(null_node_update_pointer, size_type)
+{ }
+
+PB_DS_CLASS_T_DEC
+template<typename Node_Update_>
+void
+PB_DS_CLASS_C_DEC::
+reallocate_metadata(Node_Update_* , size_type new_size)
+{
+ metadata_pointer a_new_metadata_vec =(new_size == 0) ? NULL : s_metadata_alloc.allocate(new_size);
+
+ if (m_a_metadata != NULL)
+ {
+ for (size_type i = 0; i < m_size; ++i)
+ m_a_metadata[i].~metadata_type();
+ s_metadata_alloc.deallocate(m_a_metadata, m_size);
+ }
+ std::swap(m_a_metadata, a_new_metadata_vec);
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp
new file mode 100644
index 0000000..7652c4c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp
@@ -0,0 +1,103 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file iterators_fn_imps.hpp
+ * Contains an implementation class for ov_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_node_iterator
+PB_DS_CLASS_C_DEC::
+node_begin() const
+{ return PB_DS_node_begin_imp(); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_node_iterator
+PB_DS_CLASS_C_DEC::
+node_end() const
+{ return PB_DS_node_end_imp(); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_iterator
+PB_DS_CLASS_C_DEC::
+node_begin()
+{ return PB_DS_node_begin_imp(); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_iterator
+PB_DS_CLASS_C_DEC::
+node_end()
+{ return PB_DS_node_end_imp(); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_node_iterator
+PB_DS_CLASS_C_DEC::
+PB_DS_node_begin_imp() const
+{
+ return const_node_iterator(const_cast<pointer>(mid_pointer(begin(), end())),
+ const_cast<pointer>(begin()),
+ const_cast<pointer>(end()),(m_a_metadata == NULL)?
+ NULL :
+ mid_pointer(m_a_metadata, m_a_metadata + m_size));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_node_iterator
+PB_DS_CLASS_C_DEC::
+PB_DS_node_end_imp() const
+{
+ return const_node_iterator(end(), end(), end(),
+ (m_a_metadata == NULL) ? NULL : m_a_metadata + m_size);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_iterator
+PB_DS_CLASS_C_DEC::
+PB_DS_node_begin_imp()
+{
+ return node_iterator(mid_pointer(begin(), end()), begin(), end(),
+ (m_a_metadata == NULL) ? NULL : mid_pointer(m_a_metadata, m_a_metadata + m_size));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_iterator
+PB_DS_CLASS_C_DEC::
+PB_DS_node_end_imp()
+{
+ return node_iterator(end(), end(),
+ end(),(m_a_metadata == NULL) ? NULL : m_a_metadata + m_size);
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp
new file mode 100644
index 0000000..68fedc0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp
@@ -0,0 +1,292 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file node_iterators.hpp
+ * Contains an implementation class for ov_tree_.
+ */
+
+#ifndef PB_DS_OV_TREE_NODE_ITERATORS_HPP
+#define PB_DS_OV_TREE_NODE_ITERATORS_HPP
+
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_OV_TREE_CONST_NODE_ITERATOR_C_DEC \
+ ov_tree_node_const_it_<Value_Type, Metadata_Type, Allocator>
+
+ // Const node reference.
+ template<typename Value_Type, typename Metadata_Type, class Allocator>
+ class ov_tree_node_const_it_
+ {
+
+ protected:
+ typedef
+ typename Allocator::template rebind<
+ Value_Type>::other::pointer
+ pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Value_Type>::other::const_pointer
+ const_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Metadata_Type>::other::const_pointer
+ const_metadata_pointer;
+
+ typedef PB_DS_OV_TREE_CONST_NODE_ITERATOR_C_DEC this_type;
+
+ protected:
+
+ template<typename Ptr>
+ inline static Ptr
+ mid_pointer(Ptr p_begin, Ptr p_end)
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_end >= p_begin);
+ return (p_begin + (p_end - p_begin) / 2);
+ }
+
+ public:
+
+ typedef trivial_iterator_tag iterator_category;
+
+ typedef trivial_iterator_difference_type difference_type;
+
+ typedef
+ typename Allocator::template rebind<
+ Value_Type>::other::const_pointer
+ value_type;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ Value_Type>::type>::other::const_pointer
+ reference;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ Value_Type>::type>::other::const_pointer
+ const_reference;
+
+ typedef Metadata_Type metadata_type;
+
+ typedef
+ typename Allocator::template rebind<
+ metadata_type>::other::const_reference
+ const_metadata_reference;
+
+ public:
+ inline
+ ov_tree_node_const_it_(const_pointer p_nd = NULL, const_pointer p_begin_nd = NULL, const_pointer p_end_nd = NULL, const_metadata_pointer p_metadata = NULL) : m_p_value(const_cast<pointer>(p_nd)), m_p_begin_value(const_cast<pointer>(p_begin_nd)), m_p_end_value(const_cast<pointer>(p_end_nd)), m_p_metadata(p_metadata)
+ { }
+
+ inline const_reference
+ operator*() const
+ { return m_p_value; }
+
+ inline const_metadata_reference
+ get_metadata() const
+ {
+ enum
+ {
+ has_metadata = !is_same<Metadata_Type, null_node_metadata>::value
+ };
+
+ PB_DS_STATIC_ASSERT(should_have_metadata, has_metadata);
+ _GLIBCXX_DEBUG_ASSERT(m_p_metadata != NULL);
+ return *m_p_metadata;
+ }
+
+ inline this_type
+ get_l_child() const
+ {
+ if (m_p_begin_value == m_p_value)
+ return (this_type(m_p_begin_value, m_p_begin_value, m_p_begin_value));
+
+ const_metadata_pointer p_begin_metadata =
+ m_p_metadata - (m_p_value - m_p_begin_value);
+
+ return (this_type(mid_pointer(m_p_begin_value, m_p_value),
+ m_p_begin_value,
+ m_p_value,
+ mid_pointer(p_begin_metadata, m_p_metadata)));
+ }
+
+ inline this_type
+ get_r_child() const
+ {
+ if (m_p_value == m_p_end_value)
+ return (this_type(m_p_end_value, m_p_end_value, m_p_end_value));
+
+ const_metadata_pointer p_end_metadata =
+ m_p_metadata + (m_p_end_value - m_p_value);
+
+ return (this_type(mid_pointer(m_p_value + 1, m_p_end_value),
+ m_p_value + 1,
+ m_p_end_value,(m_p_metadata == NULL) ?
+ NULL : mid_pointer(m_p_metadata + 1, p_end_metadata)));
+ }
+
+ inline bool
+ operator==(const this_type& other) const
+ {
+ const bool is_end = m_p_begin_value == m_p_end_value;
+ const bool is_other_end = other.m_p_begin_value == other.m_p_end_value;
+
+ if (is_end)
+ return (is_other_end);
+
+ if (is_other_end)
+ return (is_end);
+
+ return m_p_value == other.m_p_value;
+ }
+
+ inline bool
+ operator!=(const this_type& other) const
+ { return !operator==(other); }
+
+ public:
+ pointer m_p_value;
+ pointer m_p_begin_value;
+ pointer m_p_end_value;
+
+ const_metadata_pointer m_p_metadata;
+ };
+
+#define PB_DS_OV_TREE_NODE_ITERATOR_C_DEC \
+ ov_tree_node_it_<Value_Type, Metadata_Type, Allocator>
+
+ // Node reference.
+ template<typename Value_Type, typename Metadata_Type, class Allocator>
+ class ov_tree_node_it_ : public PB_DS_OV_TREE_CONST_NODE_ITERATOR_C_DEC
+ {
+
+ private:
+ typedef PB_DS_OV_TREE_NODE_ITERATOR_C_DEC this_type;
+
+ typedef PB_DS_OV_TREE_CONST_NODE_ITERATOR_C_DEC base_type;
+
+ typedef typename base_type::pointer pointer;
+
+ typedef typename base_type::const_pointer const_pointer;
+
+ typedef
+ typename base_type::const_metadata_pointer
+ const_metadata_pointer;
+
+ public:
+
+ typedef trivial_iterator_tag iterator_category;
+
+ typedef trivial_iterator_difference_type difference_type;
+
+ typedef
+ typename Allocator::template rebind<
+ Value_Type>::other::pointer
+ value_type;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ Value_Type>::type>::other::pointer
+ reference;
+
+ typedef
+ typename Allocator::template rebind<
+ typename remove_const<
+ Value_Type>::type>::other::pointer
+ const_reference;
+
+ public:
+ inline
+ ov_tree_node_it_(const_pointer p_nd = NULL, const_pointer p_begin_nd = NULL, const_pointer p_end_nd = NULL, const_metadata_pointer p_metadata = NULL) : base_type(p_nd, p_begin_nd, p_end_nd, p_metadata)
+ { }
+
+ // Access.
+ inline reference
+ operator*() const
+ { return reference(base_type::m_p_value); }
+
+ // Returns the node reference associated with the left node.
+ inline ov_tree_node_it_
+ get_l_child() const
+ {
+ if (base_type::m_p_begin_value == base_type::m_p_value)
+ return (this_type(base_type::m_p_begin_value, base_type::m_p_begin_value, base_type::m_p_begin_value));
+
+ const_metadata_pointer p_begin_metadata =
+ base_type::m_p_metadata - (base_type::m_p_value - base_type::m_p_begin_value);
+
+ return (this_type(base_type::mid_pointer(base_type::m_p_begin_value, base_type::m_p_value),
+ base_type::m_p_begin_value,
+ base_type::m_p_value,
+ base_type::mid_pointer(p_begin_metadata, base_type::m_p_metadata)));
+ }
+
+ // Returns the node reference associated with the right node.
+ inline ov_tree_node_it_
+ get_r_child() const
+ {
+ if (base_type::m_p_value == base_type::m_p_end_value)
+ return (this_type(base_type::m_p_end_value, base_type::m_p_end_value, base_type::m_p_end_value));
+
+ const_metadata_pointer p_end_metadata =
+ base_type::m_p_metadata + (base_type::m_p_end_value - base_type::m_p_value);
+
+ return (this_type(base_type::mid_pointer(base_type::m_p_value + 1, base_type::m_p_end_value),
+ base_type::m_p_value + 1,
+ base_type::m_p_end_value,(base_type::m_p_metadata == NULL)?
+ NULL : base_type::mid_pointer(base_type::m_p_metadata + 1, p_end_metadata)));
+ }
+
+ };
+
+#undef PB_DS_OV_TREE_NODE_ITERATOR_C_DEC
+#undef PB_DS_OV_TREE_CONST_NODE_ITERATOR_C_DEC
+
+} // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp
new file mode 100644
index 0000000..f331f0f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp
@@ -0,0 +1,522 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file ov_tree_map_.hpp
+ * Contains an implementation class for ov_tree_.
+ */
+
+#include <map>
+#include <set>
+#include <ext/pb_ds/tree_policy.hpp>
+#include <ext/pb_ds/detail/eq_fn/eq_by_less.hpp>
+#include <ext/pb_ds/detail/types_traits.hpp>
+#include <ext/pb_ds/detail/debug_map_base.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/exception.hpp>
+#include <ext/pb_ds/detail/tree_trace_base.hpp>
+#include <utility>
+#include <functional>
+#include <algorithm>
+#include <vector>
+#include <assert.h>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Mapped, class Cmp_Fn, \
+ class Node_And_It_Traits, class Allocator>
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_OV_TREE_CLASS_NAME ov_tree_data_
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_OV_TREE_CLASS_NAME ov_tree_no_data_
+#endif
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_CONST_NODE_ITERATOR_NAME ov_tree_const_node_iterator_data_
+#else
+#define PB_DS_CONST_NODE_ITERATOR_NAME ov_tree_const_node_iterator_no_data_
+#endif
+
+#define PB_DS_CLASS_C_DEC \
+ PB_DS_OV_TREE_CLASS_NAME<Key, Mapped, Cmp_Fn, Node_And_It_Traits, Allocator>
+
+#define PB_DS_TYPES_TRAITS_C_DEC \
+ types_traits<Key, Mapped, Allocator, false>
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_DEBUG_MAP_BASE_C_DEC \
+ debug_map_base<Key, eq_by_less<Key, Cmp_Fn>, \
+ typename Allocator::template rebind<Key>::other::const_reference>
+#endif
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_V2F(X) (X).first
+#define PB_DS_V2S(X) (X).second
+#define PB_DS_EP2VP(X)& ((X)->m_value)
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_V2F(X) (X)
+#define PB_DS_V2S(X) Mapped_Data()
+#define PB_DS_EP2VP(X)& ((X)->m_value.first)
+#endif
+
+#ifdef PB_DS_TREE_TRACE
+#define PB_DS_TREE_TRACE_BASE_C_DEC \
+ tree_trace_base<typename Node_And_It_Traits::const_node_iterator, \
+ typename Node_And_It_Traits::node_iterator, \
+ Cmp_Fn, false, Allocator>
+#endif
+
+ // Ordered-vector tree associative-container.
+ template<typename Key, typename Mapped, class Cmp_Fn,
+ class Node_And_It_Traits, class Allocator>
+ class PB_DS_OV_TREE_CLASS_NAME :
+#ifdef _GLIBCXX_DEBUG
+ protected PB_DS_DEBUG_MAP_BASE_C_DEC,
+#endif
+#ifdef PB_DS_TREE_TRACE
+ public PB_DS_TREE_TRACE_BASE_C_DEC,
+#endif
+ public Cmp_Fn,
+ public Node_And_It_Traits::node_update,
+ public PB_DS_TYPES_TRAITS_C_DEC
+ {
+ private:
+ typedef PB_DS_TYPES_TRAITS_C_DEC traits_base;
+
+ typedef typename remove_const<typename traits_base::value_type>::type non_const_value_type;
+
+ typedef typename Allocator::template rebind<non_const_value_type>::other value_allocator;
+ typedef typename value_allocator::pointer value_vector;
+
+
+ typedef Cmp_Fn cmp_fn_base;
+
+#ifdef _GLIBCXX_DEBUG
+ typedef PB_DS_DEBUG_MAP_BASE_C_DEC debug_base;
+#endif
+
+ typedef typename traits_base::pointer mapped_pointer_;
+ typedef typename traits_base::const_pointer const_mapped_pointer_;
+
+ typedef typename Node_And_It_Traits::metadata_type metadata_type;
+
+ typedef typename Allocator::template rebind<metadata_type>::other metadata_allocator;
+ typedef typename metadata_allocator::pointer metadata_pointer;
+ typedef typename metadata_allocator::const_reference const_metadata_reference;
+ typedef typename metadata_allocator::reference metadata_reference;
+
+ typedef
+ typename Node_And_It_Traits::null_node_update_pointer
+ null_node_update_pointer;
+
+ public:
+
+ typedef Allocator allocator_type;
+ typedef typename Allocator::size_type size_type;
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef Cmp_Fn cmp_fn;
+
+ typedef typename Node_And_It_Traits::node_update node_update;
+
+ typedef typename traits_base::key_type key_type;
+ typedef typename traits_base::key_pointer key_pointer;
+ typedef typename traits_base::const_key_pointer const_key_pointer;
+ typedef typename traits_base::key_reference key_reference;
+ typedef typename traits_base::const_key_reference const_key_reference;
+ typedef typename traits_base::mapped_type mapped_type;
+ typedef typename traits_base::mapped_pointer mapped_pointer;
+ typedef typename traits_base::const_mapped_pointer const_mapped_pointer;
+ typedef typename traits_base::mapped_reference mapped_reference;
+ typedef typename traits_base::const_mapped_reference const_mapped_reference;
+ typedef typename traits_base::value_type value_type;
+ typedef typename traits_base::pointer pointer;
+ typedef typename traits_base::const_pointer const_pointer;
+ typedef typename traits_base::reference reference;
+ typedef typename traits_base::const_reference const_reference;
+
+ typedef const_pointer const_point_iterator;
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ typedef pointer point_iterator;
+#else
+ typedef const_point_iterator point_iterator;
+#endif
+
+ typedef const_point_iterator const_iterator;
+
+ typedef point_iterator iterator;
+
+#include <ext/pb_ds/detail/ov_tree_map_/cond_dtor.hpp>
+
+ typedef
+ typename Node_And_It_Traits::const_node_iterator
+ const_node_iterator;
+
+ typedef typename Node_And_It_Traits::node_iterator node_iterator;
+
+ public:
+
+ PB_DS_OV_TREE_CLASS_NAME();
+
+ PB_DS_OV_TREE_CLASS_NAME(const Cmp_Fn&);
+
+ PB_DS_OV_TREE_CLASS_NAME(const Cmp_Fn&, const node_update&);
+
+ PB_DS_OV_TREE_CLASS_NAME(const PB_DS_CLASS_C_DEC&);
+
+ ~PB_DS_OV_TREE_CLASS_NAME();
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+
+ template<typename It>
+ void
+ copy_from_range(It, It);
+
+ inline size_type
+ max_size() const;
+
+ inline bool
+ empty() const;
+
+ inline size_type
+ size() const;
+
+ Cmp_Fn&
+ get_cmp_fn();
+
+ const Cmp_Fn&
+ get_cmp_fn() const;
+
+ inline mapped_reference
+ operator[](const_key_reference r_key)
+ {
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ point_iterator it = lower_bound(r_key);
+ if (it != end() && !Cmp_Fn::operator()(r_key, PB_DS_V2F(*it)))
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key));
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return it->second;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return (insert_new_val(it, std::make_pair(r_key, mapped_type()))->second);
+#else
+ insert(r_key);
+ return traits_base::s_null_mapped;
+#endif
+ }
+
+ inline std::pair<point_iterator, bool>
+ insert(const_reference r_value)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ const_key_reference r_key = PB_DS_V2F(r_value);
+ point_iterator it = lower_bound(r_key);
+
+ if (it != end()&& !Cmp_Fn::operator()(r_key, PB_DS_V2F(*it)))
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key));
+ return std::make_pair(it, false);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return std::make_pair(insert_new_val(it, r_value), true);
+ }
+
+ inline point_iterator
+ lower_bound(const_key_reference r_key)
+ {
+ pointer it = m_a_values;
+ pointer e_it = m_a_values + m_size;
+ while (it != e_it)
+ {
+ pointer mid_it = it + ((e_it - it) >> 1);
+ if (cmp_fn_base::operator()(PB_DS_V2F(*mid_it), r_key))
+ it = ++mid_it;
+ else
+ e_it = mid_it;
+ }
+ return it;
+ }
+
+ inline const_point_iterator
+ lower_bound(const_key_reference r_key) const
+ { return const_cast<PB_DS_CLASS_C_DEC& >(*this).lower_bound(r_key); }
+
+ inline point_iterator
+ upper_bound(const_key_reference r_key)
+ {
+ iterator pot_it = lower_bound(r_key);
+ if (pot_it != end()&& !Cmp_Fn::operator()(r_key, PB_DS_V2F(*pot_it)))
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key));
+ return ++pot_it;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key));
+ return pot_it;
+ }
+
+ inline const_point_iterator
+ upper_bound(const_key_reference r_key) const
+ { return const_cast<PB_DS_CLASS_C_DEC&>(*this).upper_bound(r_key); }
+
+ inline point_iterator
+ find(const_key_reference r_key)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ iterator pot_it = lower_bound(r_key);
+ if (pot_it != end() && !Cmp_Fn::operator()(r_key, PB_DS_V2F(*pot_it)))
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key));
+ return pot_it;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key));
+ return end();
+ }
+
+ inline const_point_iterator
+ find(const_key_reference r_key) const
+ { return (const_cast<PB_DS_CLASS_C_DEC& >(*this).find(r_key)); }
+
+ bool
+ erase(const_key_reference);
+
+ template<typename Pred>
+ inline size_type
+ erase_if(Pred);
+
+ inline iterator
+ erase(iterator it)
+ { return erase_imp<iterator>(it); }
+
+ void
+ clear();
+
+ void
+ join(PB_DS_CLASS_C_DEC&);
+
+ void
+ split(const_key_reference, PB_DS_CLASS_C_DEC&);
+
+ inline iterator
+ begin()
+ { return m_a_values; }
+
+ inline const_iterator
+ begin() const
+ { return m_a_values; }
+
+ inline iterator
+ end()
+ { return m_end_it; }
+
+ inline const_iterator
+ end() const
+ { return m_end_it; }
+
+ inline const_node_iterator
+ node_begin() const;
+
+ inline const_node_iterator
+ node_end() const;
+
+ inline node_iterator
+ node_begin();
+
+ inline node_iterator
+ node_end();
+
+ private:
+
+ inline void
+ update(node_iterator /*it*/, null_node_update_pointer);
+
+ template<typename Node_Update>
+ void
+ update(node_iterator, Node_Update*);
+
+ void
+ reallocate_metadata(null_node_update_pointer, size_type);
+
+ template<typename Node_Update_>
+ void
+ reallocate_metadata(Node_Update_*, size_type);
+
+ template<typename It>
+ void
+ copy_from_ordered_range(It, It);
+
+ void
+ value_swap(PB_DS_CLASS_C_DEC&);
+
+ template<typename It>
+ void
+ copy_from_ordered_range(It, It, It, It);
+
+ template<typename Ptr>
+ inline static Ptr
+ mid_pointer(Ptr p_begin, Ptr p_end)
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_end >= p_begin);
+ return (p_begin + (p_end - p_begin) / 2);
+ }
+
+ inline iterator
+ insert_new_val(iterator it, const_reference r_value)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+#ifdef PB_DS_REGRESSION
+ typename Allocator::group_throw_prob_adjustor adjust(m_size);
+#endif
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(PB_DS_V2F(r_value)));
+
+ value_vector a_values = s_value_alloc.allocate(m_size + 1);
+
+ iterator source_it = begin();
+ iterator source_end_it = end();
+ iterator target_it = a_values;
+ iterator ret_it;
+
+ cond_dtor<size_type> cd(a_values, target_it, m_size + 1);
+ while (source_it != it)
+ {
+ new (const_cast<void* >(static_cast<const void* >(target_it)))
+ value_type(*source_it++);
+ ++target_it;
+ }
+
+ new (const_cast<void* >(static_cast<const void* >(ret_it = target_it)))
+ value_type(r_value);
+ ++target_it;
+
+ while (source_it != source_end_it)
+ {
+ new (const_cast<void* >(static_cast<const void* >(target_it)))
+ value_type(*source_it++);
+ ++target_it;
+ }
+
+ reallocate_metadata((node_update* )this, m_size + 1);
+ cd.set_no_action();
+ if (m_size != 0)
+ {
+ cond_dtor<size_type> cd1(m_a_values, m_end_it, m_size);
+ }
+
+ ++m_size;
+ m_a_values = a_values;
+ m_end_it = m_a_values + m_size;
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(r_value)));
+ update(node_begin(), (node_update* )this);
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ return ret_it;
+ }
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+
+ void
+ assert_iterators() const;
+#endif
+
+ template<typename It>
+ It
+ erase_imp(It it);
+
+ inline const_node_iterator
+ PB_DS_node_begin_imp() const;
+
+ inline const_node_iterator
+ PB_DS_node_end_imp() const;
+
+ inline node_iterator
+ PB_DS_node_begin_imp();
+
+ inline node_iterator
+ PB_DS_node_end_imp();
+
+ private:
+ static value_allocator s_value_alloc;
+ static metadata_allocator s_metadata_alloc;
+
+ value_vector m_a_values;
+ metadata_pointer m_a_metadata;
+ iterator m_end_it;
+ size_type m_size;
+ };
+
+#include <ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp>
+#include <ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp>
+#include <ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp>
+#include <ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_OV_TREE_CLASS_NAME
+#undef PB_DS_TYPES_TRAITS_C_DEC
+#undef PB_DS_DEBUG_MAP_BASE_C_DEC
+#ifdef PB_DS_TREE_TRACE
+#undef PB_DS_TREE_TRACE_BASE_C_DEC
+#endif
+
+#undef PB_DS_V2F
+#undef PB_DS_EP2VP
+#undef PB_DS_V2S
+#undef PB_DS_CONST_NODE_ITERATOR_NAME
+
+ } // namespace detail
+} // namespace __gnu_pbds
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/policy_access_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/policy_access_fn_imps.hpp
new file mode 100644
index 0000000..c06d6f8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/policy_access_fn_imps.hpp
@@ -0,0 +1,51 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file policy_access_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+Cmp_Fn&
+PB_DS_CLASS_C_DEC::
+get_cmp_fn()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Cmp_Fn&
+PB_DS_CLASS_C_DEC::
+get_cmp_fn() const
+{ return *this; }
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp
new file mode 100644
index 0000000..76bb6fa
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp
@@ -0,0 +1,137 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_join_fn_imps.hpp
+ * Contains an implementation class for ov_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+split(const_key_reference r_key, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ if (m_size == 0)
+ {
+ other.clear();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return;
+ }
+
+ if (Cmp_Fn::operator()(r_key, PB_DS_V2F(*begin())))
+ {
+ value_swap(other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return;
+ }
+
+ if (!Cmp_Fn::operator()(r_key, PB_DS_V2F(*(end() - 1))))
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return;
+ }
+
+ if (m_size == 1)
+ {
+ value_swap(other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::join(other);)
+ iterator it = upper_bound(r_key);
+ PB_DS_CLASS_C_DEC new_other(other, other);
+ new_other.copy_from_ordered_range(it, end());
+ PB_DS_CLASS_C_DEC new_this(*this, * this);
+ new_this.copy_from_ordered_range(begin(), it);
+
+ // No exceptions from this point.
+ _GLIBCXX_DEBUG_ONLY(debug_base::split(r_key,(Cmp_Fn& )(*this), other);)
+ other.update(other.node_begin(), (node_update* )(&other));
+ update(node_begin(), (node_update* )this);
+ other.value_swap(new_other);
+ value_swap(new_this);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+join(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ if (other.m_size == 0)
+ return;
+
+ if (m_size == 0)
+ {
+ value_swap(other);
+ return;
+ }
+
+ const bool greater = Cmp_Fn::operator()(PB_DS_V2F(*(end() - 1)),
+ PB_DS_V2F(*other.begin()));
+
+ const bool lesser = Cmp_Fn::operator()(PB_DS_V2F(*(other.end() - 1)),
+ PB_DS_V2F(*begin()));
+
+ if (!greater && !lesser)
+ __throw_join_error();
+
+ PB_DS_CLASS_C_DEC new_this(*this, *this);
+
+ if (greater)
+ new_this.copy_from_ordered_range(begin(), end(),
+ other.begin(), other.end());
+ else
+ new_this.copy_from_ordered_range(other.begin(), other.end(),
+ begin(), end());
+
+ // No exceptions from this point.
+ _GLIBCXX_DEBUG_ONLY(debug_base::join(other);)
+ value_swap(new_this);
+ other.clear();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/traits.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/traits.hpp
new file mode 100644
index 0000000..63cb0f7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/ov_tree_map_/traits.hpp
@@ -0,0 +1,183 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file traits.hpp
+ * Contains an implementation class for ov_tree_.
+ */
+
+#ifndef PB_DS_OV_TREE_NODE_AND_IT_TRAITS_HPP
+#define PB_DS_OV_TREE_NODE_AND_IT_TRAITS_HPP
+
+#include <ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Key,
+ typename Mapped,
+ class Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn_,
+ class Allocator_>
+ class Node_Update,
+ class Allocator>
+ struct tree_traits<
+ Key,
+ Mapped,
+ Cmp_Fn,
+ Node_Update,
+ ov_tree_tag,
+ Allocator>
+ {
+ private:
+ typedef
+ typename types_traits<
+ Key,
+ Mapped,
+ Allocator,
+ false>::value_type
+ value_type;
+
+ public:
+ typedef
+ typename tree_node_metadata_selector<
+ Key,
+ Mapped,
+ Cmp_Fn,
+ Node_Update,
+ Allocator>::type
+ metadata_type;
+
+ typedef
+ ov_tree_node_const_it_<
+ value_type,
+ metadata_type,
+ Allocator>
+ const_node_iterator;
+
+ typedef
+ ov_tree_node_it_<
+ value_type,
+ metadata_type,
+ Allocator>
+ node_iterator;
+
+ typedef
+ Node_Update<
+ const_node_iterator,
+ node_iterator,
+ Cmp_Fn,
+ Allocator>
+ node_update;
+
+ typedef
+ __gnu_pbds::null_tree_node_update<
+ const_node_iterator,
+ node_iterator,
+ Cmp_Fn,
+ Allocator>*
+ null_node_update_pointer;
+ };
+
+ template<typename Key,
+ class Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn_,
+ class Allocator_>
+ class Node_Update,
+ class Allocator>
+ struct tree_traits<
+ Key,
+ null_mapped_type,
+ Cmp_Fn,
+ Node_Update,
+ ov_tree_tag,
+ Allocator>
+ {
+ private:
+ typedef
+ typename types_traits<
+ Key,
+ null_mapped_type,
+ Allocator,
+ false>::value_type
+ value_type;
+
+ public:
+ typedef
+ typename tree_node_metadata_selector<
+ Key,
+ null_mapped_type,
+ Cmp_Fn,
+ Node_Update,
+ Allocator>::type
+ metadata_type;
+
+ typedef
+ ov_tree_node_const_it_<
+ value_type,
+ metadata_type,
+ Allocator>
+ const_node_iterator;
+
+ typedef const_node_iterator node_iterator;
+
+ typedef
+ Node_Update<
+ const_node_iterator,
+ const_node_iterator,
+ Cmp_Fn,
+ Allocator>
+ node_update;
+
+ typedef
+ __gnu_pbds::null_tree_node_update<
+ const_node_iterator,
+ node_iterator,
+ Cmp_Fn,
+ Allocator>*
+ null_node_update_pointer;
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_OV_TREE_NODE_AND_IT_TRAITS_HPP
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/constructors_destructor_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..e292ed5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,91 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation class for a pairing heap.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+ while (first_it != last_it)
+ push(*(first_it++));
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+pairing_heap_()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+pairing_heap_(const Cmp_Fn& r_cmp_fn) :
+ PB_DS_BASE_C_DEC(r_cmp_fn)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+pairing_heap_(const PB_DS_CLASS_C_DEC& other) :
+ PB_DS_BASE_C_DEC(other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ PB_DS_BASE_C_DEC::swap(other);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~pairing_heap_()
+{ }
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp
new file mode 100644
index 0000000..7c9fc13
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation class for a pairing heap.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_p_root == NULL
+ || base_type::m_p_root->m_p_next_sibling == NULL);
+ base_type::assert_valid();
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp
new file mode 100644
index 0000000..905be10
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp
@@ -0,0 +1,236 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation class for a pairing heap.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+pop()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+
+ node_pointer p_new_root = join_node_children(base_type::m_p_root);
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_new_root, false);)
+ if (p_new_root != NULL)
+ p_new_root->m_p_prev_or_parent = NULL;
+
+ base_type::actual_erase_node(base_type::m_p_root);
+ base_type::m_p_root = p_new_root;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase(point_iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+ remove_node(it.m_p_nd);
+ base_type::actual_erase_node(it.m_p_nd);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+remove_node(node_pointer p_nd)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+ node_pointer p_new_child = join_node_children(p_nd);
+
+#ifdef _GLIBCXX_DEBUG
+ if (p_new_child != NULL)
+ base_type::assert_node_consistent(p_new_child, false);
+#endif
+
+ if (p_nd == base_type::m_p_root)
+ {
+ if (p_new_child != NULL)
+ p_new_child->m_p_prev_or_parent = NULL;
+ base_type::m_p_root = p_new_child;
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(base_type::m_p_root, false);)
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_prev_or_parent != NULL);
+ if (p_nd->m_p_prev_or_parent->m_p_l_child == p_nd)
+ {
+ if (p_new_child != NULL)
+ {
+ p_new_child->m_p_prev_or_parent = p_nd->m_p_prev_or_parent;
+ p_new_child->m_p_next_sibling = p_nd->m_p_next_sibling;
+ if (p_new_child->m_p_next_sibling != NULL)
+ p_new_child->m_p_next_sibling->m_p_prev_or_parent = p_new_child;
+ p_nd->m_p_prev_or_parent->m_p_l_child = p_new_child;
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd->m_p_prev_or_parent, false);)
+ return;
+ }
+
+ p_nd->m_p_prev_or_parent->m_p_l_child = p_nd->m_p_next_sibling;
+ if (p_nd->m_p_next_sibling != NULL)
+ p_nd->m_p_next_sibling->m_p_prev_or_parent = p_nd->m_p_prev_or_parent;
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd->m_p_prev_or_parent, false);)
+ return;
+ }
+
+ if (p_new_child != NULL)
+ {
+ p_new_child->m_p_prev_or_parent = p_nd->m_p_prev_or_parent;
+ p_new_child->m_p_next_sibling = p_nd->m_p_next_sibling;
+ if (p_new_child->m_p_next_sibling != NULL)
+ p_new_child->m_p_next_sibling->m_p_prev_or_parent = p_new_child;
+ p_new_child->m_p_prev_or_parent->m_p_next_sibling = p_new_child;
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd->m_p_prev_or_parent, false);)
+ return;
+ }
+
+ p_nd->m_p_prev_or_parent->m_p_next_sibling = p_nd->m_p_next_sibling;
+ if (p_nd->m_p_next_sibling != NULL)
+ p_nd->m_p_next_sibling->m_p_prev_or_parent = p_nd->m_p_prev_or_parent;
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd->m_p_prev_or_parent, false);)
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+join_node_children(node_pointer p_nd)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+ node_pointer p_ret = p_nd->m_p_l_child;
+ if (p_ret == NULL)
+ return NULL;
+ while (p_ret->m_p_next_sibling != NULL)
+ p_ret = forward_join(p_ret, p_ret->m_p_next_sibling);
+ while (p_ret->m_p_prev_or_parent != p_nd)
+ p_ret = back_join(p_ret->m_p_prev_or_parent, p_ret);
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_ret, false);)
+ return p_ret;
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+forward_join(node_pointer p_nd, node_pointer p_next)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_next_sibling == p_next);
+ if (Cmp_Fn::operator()(p_nd->m_value, p_next->m_value))
+ {
+ p_next->m_p_prev_or_parent = p_nd->m_p_prev_or_parent;
+ base_type::make_child_of(p_nd, p_next);
+ return p_next->m_p_next_sibling == NULL
+ ? p_next : p_next->m_p_next_sibling;
+ }
+
+ if (p_next->m_p_next_sibling != NULL)
+ {
+ p_next->m_p_next_sibling->m_p_prev_or_parent = p_nd;
+ p_nd->m_p_next_sibling = p_next->m_p_next_sibling;
+ base_type::make_child_of(p_next, p_nd);
+ return p_nd->m_p_next_sibling;
+ }
+
+ p_nd->m_p_next_sibling = NULL;
+ base_type::make_child_of(p_next, p_nd);
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd, false));
+ return p_nd;
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+back_join(node_pointer p_nd, node_pointer p_next)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_next->m_p_next_sibling == NULL);
+
+ if (Cmp_Fn::operator()(p_nd->m_value, p_next->m_value))
+ {
+ p_next->m_p_prev_or_parent = p_nd->m_p_prev_or_parent;
+ base_type::make_child_of(p_nd, p_next);
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_next, false));
+ return p_next;
+ }
+
+ p_nd->m_p_next_sibling = NULL;
+ base_type::make_child_of(p_next, p_nd);
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd, false));
+ return p_nd;
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ if (base_type::empty())
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return 0;
+ }
+ base_type::to_linked_list();
+ node_pointer p_out = base_type::prune(pred);
+ size_type ersd = 0;
+ while (p_out != NULL)
+ {
+ ++ersd;
+ node_pointer p_next = p_out->m_p_next_sibling;
+ base_type::actual_erase_node(p_out);
+ p_out = p_next;
+ }
+
+ node_pointer p_cur = base_type::m_p_root;
+ base_type::m_p_root = NULL;
+ while (p_cur != NULL)
+ {
+ node_pointer p_next = p_cur->m_p_next_sibling;
+ p_cur->m_p_l_child = p_cur->m_p_next_sibling = p_cur->m_p_prev_or_parent = NULL;
+
+ push_imp(p_cur);
+ p_cur = p_next;
+ }
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return ersd;
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp
new file mode 100644
index 0000000..85efd70
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp
@@ -0,0 +1,50 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains an implementation class for a pairing heap.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reference
+PB_DS_CLASS_C_DEC::
+top() const
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+
+ return base_type::m_p_root->m_value;
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp
new file mode 100644
index 0000000..b00e9d1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp
@@ -0,0 +1,101 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains an implementation class for a pairing heap.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+push(const_reference r_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ node_pointer p_new_nd = base_type::get_new_node_for_insert(r_val);
+
+ push_imp(p_new_nd);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ return point_iterator(p_new_nd);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+push_imp(node_pointer p_nd)
+{
+ p_nd->m_p_l_child = NULL;
+
+ if (base_type::m_p_root == NULL)
+ {
+ p_nd->m_p_next_sibling = p_nd->m_p_prev_or_parent = NULL;
+
+ base_type::m_p_root = p_nd;
+ }
+ else if (Cmp_Fn::operator()(base_type::m_p_root->m_value, p_nd->m_value))
+ {
+ p_nd->m_p_next_sibling = p_nd->m_p_prev_or_parent = NULL;
+
+ base_type::make_child_of(base_type::m_p_root, p_nd);
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd, false));
+
+ base_type::m_p_root = p_nd;
+ }
+ else
+ {
+ base_type::make_child_of(p_nd, base_type::m_p_root);
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(base_type::m_p_root, false));
+ }
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+modify(point_iterator it, const_reference r_new_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ remove_node(it.m_p_nd);
+
+ it.m_p_nd->m_value = r_new_val;
+
+ push_imp(it.m_p_nd);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp
new file mode 100644
index 0000000..e19bcb6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp
@@ -0,0 +1,216 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file pairing_heap_.hpp
+ * Contains an implementation class for a pairing heap.
+ */
+
+/*
+ * Pairing heap:
+ * Michael L. Fredman, Robert Sedgewick, Daniel Dominic Sleator,
+ * and Robert Endre Tarjan, The Pairing Heap:
+ * A New Form of Self-Adjusting Heap, Algorithmica, 1(1):111-129, 1986.
+ */
+
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ pairing_heap_<Value_Type, Cmp_Fn, Allocator>
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_BASE_C_DEC \
+ left_child_next_sibling_heap_< \
+ Value_Type, \
+ Cmp_Fn, \
+ null_left_child_next_sibling_heap_node_metadata, \
+ Allocator, \
+ false>
+#else
+#define PB_DS_BASE_C_DEC \
+ left_child_next_sibling_heap_< \
+ Value_Type, \
+ Cmp_Fn, \
+ null_left_child_next_sibling_heap_node_metadata, \
+ Allocator>
+#endif
+
+ /**
+ * class description = "P4ri|\|g h3ap$">
+ **/
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+ class pairing_heap_ : public PB_DS_BASE_C_DEC
+ {
+
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ typedef typename base_type::node_pointer node_pointer;
+
+ public:
+
+ typedef typename Allocator::size_type size_type;
+
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef Value_Type value_type;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::pointer
+ pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_pointer
+ const_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::reference
+ reference;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_reference
+ const_reference;
+
+ typedef
+ typename PB_DS_BASE_C_DEC::const_point_iterator
+ const_point_iterator;
+
+ typedef typename PB_DS_BASE_C_DEC::point_iterator point_iterator;
+
+ typedef typename PB_DS_BASE_C_DEC::const_iterator const_iterator;
+
+ typedef typename PB_DS_BASE_C_DEC::iterator iterator;
+
+ typedef Cmp_Fn cmp_fn;
+
+ typedef Allocator allocator_type;
+
+
+ pairing_heap_();
+
+ pairing_heap_(const Cmp_Fn& r_cmp_fn);
+
+ pairing_heap_(const PB_DS_CLASS_C_DEC& other);
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ ~pairing_heap_();
+
+ inline point_iterator
+ push(const_reference r_val);
+
+ void
+ modify(point_iterator it, const_reference r_new_val);
+
+ inline const_reference
+ top() const;
+
+ void
+ pop();
+
+ void
+ erase(point_iterator it);
+
+ template<typename Pred>
+ size_type
+ erase_if(Pred pred);
+
+ template<typename Pred>
+ void
+ split(Pred pred, PB_DS_CLASS_C_DEC& other);
+
+ void
+ join(PB_DS_CLASS_C_DEC& other);
+
+ protected:
+
+ template<typename It>
+ void
+ copy_from_range(It first_it, It last_it);
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+
+ private:
+
+ inline void
+ push_imp(node_pointer p_nd);
+
+ node_pointer
+ join_node_children(node_pointer p_nd);
+
+ node_pointer
+ forward_join(node_pointer p_nd, node_pointer p_next);
+
+ node_pointer
+ back_join(node_pointer p_nd, node_pointer p_next);
+
+ void
+ remove_node(node_pointer p_nd);
+
+ };
+
+#include <ext/pb_ds/detail/pairing_heap_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp>
+#include <ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_BASE_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp
new file mode 100644
index 0000000..85d4ddf
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp
@@ -0,0 +1,140 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_join_fn_imps.hpp
+ * Contains an implementation class for a pairing heap.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+void
+PB_DS_CLASS_C_DEC::
+split(Pred pred, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ other.clear();
+
+ if (base_type::empty())
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ return;
+ }
+
+ base_type::to_linked_list();
+
+ node_pointer p_out = base_type::prune(pred);
+
+ while (p_out != NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_size > 0);
+ --base_type::m_size;
+
+ ++other.m_size;
+
+ node_pointer p_next = p_out->m_p_next_sibling;
+
+ p_out->m_p_l_child = p_out->m_p_next_sibling = p_out->m_p_prev_or_parent = NULL;
+
+ other.push_imp(p_out);
+
+ p_out = p_next;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ node_pointer p_cur = base_type::m_p_root;
+
+ base_type::m_p_root = NULL;
+
+ while (p_cur != NULL)
+ {
+ node_pointer p_next = p_cur->m_p_next_sibling;
+
+ p_cur->m_p_l_child = p_cur->m_p_next_sibling = p_cur->m_p_prev_or_parent = NULL;
+
+ push_imp(p_cur);
+
+ p_cur = p_next;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+join(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ if (other.m_p_root == NULL)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ return;
+ }
+
+ if (base_type::m_p_root == NULL)
+ base_type::m_p_root = other.m_p_root;
+ else if (Cmp_Fn::operator()(base_type::m_p_root->m_value, other.m_p_root->m_value))
+ {
+ base_type::make_child_of(base_type::m_p_root, other.m_p_root);
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(other.m_p_root, false));
+
+ base_type::m_p_root = other.m_p_root;
+ }
+ else
+ {
+ base_type::make_child_of(other.m_p_root, base_type::m_p_root);
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(base_type::m_p_root, false));
+ }
+
+ base_type::m_size += other.m_size;
+
+ other.m_p_root = NULL;
+ other.m_size = 0;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/child_iterator.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/child_iterator.hpp
new file mode 100644
index 0000000..15f349e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/child_iterator.hpp
@@ -0,0 +1,93 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file child_iterator.hpp
+ * Contains a iterator for a patricia tree.
+ */
+
+struct iterator : public const_iterator
+{
+public:
+ typedef std::forward_iterator_tag iterator_category;
+ typedef typename Allocator::difference_type difference_type;
+ typedef node_pointer value_type;
+ typedef node_pointer_pointer pointer;
+ typedef node_pointer_reference reference;
+
+ inline
+ iterator(node_pointer_pointer p_p_cur = NULL,
+ node_pointer_pointer p_p_end = NULL)
+ : const_iterator(p_p_cur, p_p_end)
+ { }
+
+ inline bool
+ operator==(const iterator& other) const
+ { return const_iterator::m_p_p_cur == other.m_p_p_cur; }
+
+ inline bool
+ operator!=(const iterator& other) const
+ { return const_iterator::m_p_p_cur != other.m_p_p_cur; }
+
+ inline iterator&
+ operator++()
+ {
+ const_iterator::operator++();
+ return *this;
+ }
+
+ inline iterator
+ operator++(int)
+ {
+ iterator ret_it(*this);
+ operator++();
+ return ret_it;
+ }
+
+ node_pointer_pointer
+ operator->()
+ {
+ _GLIBCXX_DEBUG_ONLY(const_iterator::assert_referencible();)
+ return const_iterator::m_p_p_cur;
+ }
+
+ node_pointer
+ operator*()
+ {
+ _GLIBCXX_DEBUG_ONLY(const_iterator::assert_referencible();)
+ return *const_iterator::m_p_p_cur;
+ }
+};
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/cond_dtor_entry_dealtor.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/cond_dtor_entry_dealtor.hpp
new file mode 100644
index 0000000..184b986
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/cond_dtor_entry_dealtor.hpp
@@ -0,0 +1,79 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file cond_dtor_entry_dealtor.hpp
+ * Contains a binary tree container conditional deallocator
+ */
+
+class cond_dealtor
+{
+public:
+ inline
+ cond_dealtor(leaf_pointer p_nd) : m_p_nd(p_nd),
+ m_no_action_dtor(false),
+ m_call_destructor(false)
+ { }
+
+ inline void
+ set_no_action_dtor()
+ {
+ m_no_action_dtor = true;
+ }
+
+ inline void
+ set_call_destructor()
+ {
+ m_call_destructor = true;
+ }
+
+ inline
+ ~cond_dealtor()
+ {
+ if (m_no_action_dtor)
+ return;
+
+ if (m_call_destructor)
+ m_p_nd->~leaf();
+
+ s_leaf_allocator.deallocate(m_p_nd, 1);
+ }
+
+protected:
+ leaf_pointer m_p_nd;
+ bool m_no_action_dtor;
+ bool m_call_destructor;
+};
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp
new file mode 100644
index 0000000..bc349cf
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp
@@ -0,0 +1,111 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file const_child_iterator.hpp
+ * Contains a const_iterator for a patricia tree.
+ */
+
+struct const_iterator
+{
+public:
+ typedef std::forward_iterator_tag iterator_category;
+
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef node_pointer value_type;
+
+ typedef node_pointer_pointer pointer;
+
+ typedef node_pointer_reference reference;
+
+public:
+ inline
+ const_iterator(node_pointer_pointer p_p_cur = NULL,
+ node_pointer_pointer p_p_end = NULL)
+ : m_p_p_cur(p_p_cur), m_p_p_end(p_p_end)
+ { }
+
+ inline bool
+ operator==(const const_iterator& other) const
+ { return m_p_p_cur == other.m_p_p_cur; }
+
+ inline bool
+ operator!=(const const_iterator& other) const
+ { return m_p_p_cur != other.m_p_p_cur; }
+
+ inline const_iterator&
+ operator++()
+ {
+ do
+ ++m_p_p_cur;
+ while (m_p_p_cur != m_p_p_end&& * m_p_p_cur == NULL);
+ return *this;
+ }
+
+ inline const_iterator
+ operator++(int)
+ {
+ const_iterator ret_it(*this);
+ operator++();
+ return ret_it;
+ }
+
+ const node_pointer_pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_referencible();)
+ return (m_p_p_cur);
+ }
+
+ const_node_pointer
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_referencible();)
+ return (*m_p_p_cur);
+ }
+
+protected:
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_referencible() const
+ { _GLIBCXX_DEBUG_ASSERT(m_p_p_cur != m_p_p_end&& * m_p_p_cur != NULL); }
+#endif
+
+public:
+ node_pointer_pointer m_p_p_cur;
+ node_pointer_pointer m_p_p_end;
+};
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..ca38f93
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,214 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::head_allocator
+PB_DS_CLASS_C_DEC::s_head_allocator;
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::internal_node_allocator
+PB_DS_CLASS_C_DEC::s_internal_node_allocator;
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::leaf_allocator
+PB_DS_CLASS_C_DEC::s_leaf_allocator;
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME() :
+ m_p_head(s_head_allocator.allocate(1)),
+ m_size(0)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const e_access_traits& r_e_access_traits) :
+ synth_e_access_traits(r_e_access_traits),
+ m_p_head(s_head_allocator.allocate(1)),
+ m_size(0)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) :
+#ifdef _GLIBCXX_DEBUG
+ debug_base(other),
+#endif
+ synth_e_access_traits(other),
+ node_update(other),
+ m_p_head(s_head_allocator.allocate(1)),
+ m_size(0)
+{
+ initialize();
+ m_size = other.m_size;
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ if (other.m_p_head->m_p_parent == NULL)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return;
+ }
+ __try
+ {
+ m_p_head->m_p_parent = recursive_copy_node(other.m_p_head->m_p_parent);
+ }
+ __catch(...)
+ {
+ s_head_allocator.deallocate(m_p_head, 1);
+ __throw_exception_again;
+ }
+
+ m_p_head->m_p_min = leftmost_descendant(m_p_head->m_p_parent);
+ m_p_head->m_p_max = rightmost_descendant(m_p_head->m_p_parent);
+ m_p_head->m_p_parent->m_p_parent = m_p_head;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ value_swap(other);
+ std::swap((e_access_traits& )(*this), (e_access_traits& )other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+value_swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(debug_base::swap(other);)
+ std::swap(m_p_head, other.m_p_head);
+ std::swap(m_size, other.m_size);
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~PB_DS_CLASS_NAME()
+{
+ clear();
+ s_head_allocator.deallocate(m_p_head, 1);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+initialize()
+{
+ new (m_p_head) head();
+ m_p_head->m_p_parent = NULL;
+ m_p_head->m_p_min = m_p_head;
+ m_p_head->m_p_max = m_p_head;
+ m_size = 0;
+}
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+ while (first_it != last_it)
+ insert(*(first_it++));
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+recursive_copy_node(const_node_pointer p_other_nd)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_other_nd != NULL);
+ if (p_other_nd->m_type == pat_trie_leaf_node_type)
+ {
+ const_leaf_pointer p_other_leaf = static_cast<const_leaf_pointer>(p_other_nd);
+
+ leaf_pointer p_new_lf = s_leaf_allocator.allocate(1);
+ cond_dealtor cond(p_new_lf);
+ new (p_new_lf) leaf(p_other_leaf->value());
+ apply_update(p_new_lf, (node_update* )this);
+ cond.set_no_action_dtor();
+ return (p_new_lf);
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_other_nd->m_type == pat_trie_internal_node_type);
+ node_pointer a_p_children[internal_node::arr_size];
+ size_type child_i = 0;
+ const_internal_node_pointer p_other_internal_nd =
+ static_cast<const_internal_node_pointer>(p_other_nd);
+
+ typename internal_node::const_iterator child_it =
+ p_other_internal_nd->begin();
+
+ internal_node_pointer p_ret;
+ __try
+ {
+ while (child_it != p_other_internal_nd->end())
+ a_p_children[child_i++] = recursive_copy_node(*(child_it++));
+ p_ret = s_internal_node_allocator.allocate(1);
+ }
+ __catch(...)
+ {
+ while (child_i-- > 0)
+ clear_imp(a_p_children[child_i]);
+ __throw_exception_again;
+ }
+
+ new (p_ret) internal_node(p_other_internal_nd->get_e_ind(),
+ pref_begin(a_p_children[0]));
+
+ --child_i;
+ _GLIBCXX_DEBUG_ASSERT(child_i > 1);
+ do
+ p_ret->add_child(a_p_children[child_i], pref_begin(a_p_children[child_i]),
+ pref_end(a_p_children[child_i]), this);
+ while (child_i-- > 0);
+ apply_update(p_ret, (node_update* )this);
+ return p_ret;
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp
new file mode 100644
index 0000000..de75657
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp
@@ -0,0 +1,117 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation class for pat_trie_.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ if (m_p_head->m_p_parent != NULL)
+ m_p_head->m_p_parent->assert_valid(this);
+ assert_iterators();
+ assert_reverse_iterators();
+ if (m_p_head->m_p_parent == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_min == m_p_head);
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_max == m_p_head);
+ _GLIBCXX_DEBUG_ASSERT(empty());
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_min->m_type == pat_trie_leaf_node_type);
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_max->m_type == pat_trie_leaf_node_type);
+ _GLIBCXX_DEBUG_ASSERT(!empty());
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_iterators() const
+{
+ size_type calc_size = 0;
+ for (const_iterator it = begin(); it != end(); ++it)
+ {
+ ++calc_size;
+ debug_base::check_key_exists(PB_DS_V2F(*it));
+ _GLIBCXX_DEBUG_ASSERT(lower_bound(PB_DS_V2F(*it)) == it);
+ _GLIBCXX_DEBUG_ASSERT(--upper_bound(PB_DS_V2F(*it)) == it);
+ }
+ _GLIBCXX_DEBUG_ASSERT(calc_size == m_size);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_reverse_iterators() const
+{
+ size_type calc_size = 0;
+ for (const_reverse_iterator it = rbegin(); it != rend(); ++it)
+ {
+ ++calc_size;
+ const_node_pointer p_nd =
+ const_cast<PB_DS_CLASS_C_DEC* >(this)->find_imp(PB_DS_V2F(*it));
+ _GLIBCXX_DEBUG_ASSERT(p_nd == it.m_p_nd);
+ }
+ _GLIBCXX_DEBUG_ASSERT(calc_size == m_size);
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+recursive_count_leafs(const_node_pointer p_nd)
+{
+ if (p_nd == NULL)
+ return (0);
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ return (1);
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_type == pat_trie_internal_node_type);
+ size_type ret = 0;
+ for (typename internal_node::const_iterator it =
+ static_cast<const_internal_node_pointer>(p_nd)->begin();
+ it != static_cast<const_internal_node_pointer>(p_nd)->end();
+ ++it)
+ ret += recursive_count_leafs(*it);
+ return ret;
+}
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp
new file mode 100644
index 0000000..9098818
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp
@@ -0,0 +1,319 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+erase(const_key_reference r_key)
+{
+ node_pointer p_nd = find_imp(r_key);
+ if (p_nd == NULL || p_nd->m_type == pat_trie_internal_node_type)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key));
+ return false;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_type == pat_trie_leaf_node_type);
+ if (!synth_e_access_traits::equal_keys(PB_DS_V2F(reinterpret_cast<leaf_pointer>(p_nd)->value()), r_key))
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key));
+ return false;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key));
+ erase_leaf(static_cast<leaf_pointer>(p_nd));
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return true;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase_fixup(internal_node_pointer p_nd)
+{
+ _GLIBCXX_DEBUG_ASSERT(std::distance(p_nd->begin(), p_nd->end()) >= 1);
+ if (std::distance(p_nd->begin(), p_nd->end()) == 1)
+ {
+ node_pointer p_parent = p_nd->m_p_parent;
+ if (p_parent == m_p_head)
+ m_p_head->m_p_parent =* p_nd->begin();
+ else
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_parent->m_type == pat_trie_internal_node_type);
+ node_pointer p_new_child =* p_nd->begin();
+ static_cast<internal_node_pointer>(p_parent)->replace_child(
+ p_new_child,
+ pref_begin(p_new_child),
+ pref_end(p_new_child),
+ this);
+ }
+ (*p_nd->begin())->m_p_parent = p_nd->m_p_parent;
+ p_nd->~internal_node();
+ s_internal_node_allocator.deallocate(p_nd, 1);
+
+ if (p_parent == m_p_head)
+ return;
+
+ _GLIBCXX_DEBUG_ASSERT(p_parent->m_type == pat_trie_internal_node_type);
+ p_nd = static_cast<internal_node_pointer>(p_parent);
+ }
+
+ while (true)
+ {
+ _GLIBCXX_DEBUG_ASSERT(std::distance(p_nd->begin(), p_nd->end()) > 1);
+ p_nd->update_prefixes(this);
+ apply_update(p_nd, (node_update* )this);
+ _GLIBCXX_DEBUG_ONLY(p_nd->assert_valid(this);)
+ if (p_nd->m_p_parent->m_type == pat_trie_head_node_type)
+ return;
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_parent->m_type ==
+ pat_trie_internal_node_type);
+
+ p_nd = static_cast<internal_node_pointer>(p_nd->m_p_parent);
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+actual_erase_leaf(leaf_pointer p_l)
+{
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ --m_size;
+ _GLIBCXX_DEBUG_ONLY(erase_existing(PB_DS_V2F(p_l->value())));
+ p_l->~leaf();
+ s_leaf_allocator.deallocate(p_l, 1);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ if (empty())
+ return;
+
+ clear_imp(m_p_head->m_p_parent);
+ m_size = 0;
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(debug_base::clear();)
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear_imp(node_pointer p_nd)
+{
+ if (p_nd->m_type == pat_trie_internal_node_type)
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_type == pat_trie_internal_node_type);
+ for (typename internal_node::iterator it =
+ static_cast<internal_node_pointer>(p_nd)->begin();
+ it != static_cast<internal_node_pointer>(p_nd)->end();
+ ++it)
+ {
+ node_pointer p_child =* it;
+ clear_imp(p_child);
+ }
+ s_internal_node_allocator.deallocate(static_cast<internal_node_pointer>(p_nd), 1);
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_type == pat_trie_leaf_node_type);
+ static_cast<leaf_pointer>(p_nd)->~leaf();
+ s_leaf_allocator.deallocate(static_cast<leaf_pointer>(p_nd), 1);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+erase(const_iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+
+ if (it == end())
+ return it;
+
+ const_iterator ret_it = it;
+ ++ret_it;
+ _GLIBCXX_DEBUG_ASSERT(it.m_p_nd->m_type == pat_trie_leaf_node_type);
+ erase_leaf(static_cast<leaf_pointer>(it.m_p_nd));
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ return ret_it;
+}
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+erase(iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+
+ if (it == end())
+ return it;
+ iterator ret_it = it;
+ ++ret_it;
+ _GLIBCXX_DEBUG_ASSERT(it.m_p_nd->m_type == pat_trie_leaf_node_type);
+ erase_leaf(static_cast<leaf_pointer>(it.m_p_nd));
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ return ret_it;
+}
+#endif // #ifdef PB_DS_DATA_TRUE_INDICATOR
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reverse_iterator
+PB_DS_CLASS_C_DEC::
+erase(const_reverse_iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+
+ if (it.m_p_nd == m_p_head)
+ return it;
+ const_reverse_iterator ret_it = it;
+ ++ret_it;
+
+ _GLIBCXX_DEBUG_ASSERT(it.m_p_nd->m_type == pat_trie_leaf_node_type);
+ erase_leaf(static_cast<leaf_pointer>(it.m_p_nd));
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ return ret_it;
+}
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::reverse_iterator
+PB_DS_CLASS_C_DEC::
+erase(reverse_iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+
+ if (it.m_p_nd == m_p_head)
+ return it;
+ reverse_iterator ret_it = it;
+ ++ret_it;
+
+ _GLIBCXX_DEBUG_ASSERT(it.m_p_nd->m_type == pat_trie_leaf_node_type);
+ erase_leaf(static_cast<leaf_pointer>(it.m_p_nd));
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ return ret_it;
+}
+#endif // #ifdef PB_DS_DATA_TRUE_INDICATOR
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ size_type num_ersd = 0;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ iterator it = begin();
+ while (it != end())
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ if (pred(*it))
+ {
+ ++num_ersd;
+ it = erase(it);
+ }
+ else
+ ++it;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return num_ersd;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase_leaf(leaf_pointer p_l)
+{
+ update_min_max_for_erased_leaf(p_l);
+ if (p_l->m_p_parent->m_type == pat_trie_head_node_type)
+ {
+ _GLIBCXX_DEBUG_ASSERT(size() == 1);
+ clear();
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(size() > 1);
+ _GLIBCXX_DEBUG_ASSERT(p_l->m_p_parent->m_type ==
+ pat_trie_internal_node_type);
+
+ internal_node_pointer p_parent =
+ static_cast<internal_node_pointer>(p_l->m_p_parent);
+
+ p_parent->remove_child(p_l);
+ erase_fixup(p_parent);
+ actual_erase_leaf(p_l);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+update_min_max_for_erased_leaf(leaf_pointer p_l)
+{
+ if (m_size == 1)
+ {
+ m_p_head->m_p_min = m_p_head;
+ m_p_head->m_p_max = m_p_head;
+ return;
+ }
+
+ if (p_l == static_cast<const_leaf_pointer>(m_p_head->m_p_min))
+ {
+ iterator it(p_l);
+ ++it;
+ m_p_head->m_p_min = it.m_p_nd;
+ return;
+ }
+
+ if (p_l == static_cast<const_leaf_pointer>(m_p_head->m_p_max))
+ {
+ iterator it(p_l);
+ --it;
+ m_p_head->m_p_max = it.m_p_nd;
+ }
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp
new file mode 100644
index 0000000..2552ead
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp
@@ -0,0 +1,269 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+find(const_key_reference r_key)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ node_pointer p_nd = find_imp(r_key);
+
+ if (p_nd == NULL || p_nd->m_type != pat_trie_leaf_node_type)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ return end();
+ }
+
+ if (synth_e_access_traits::equal_keys(PB_DS_V2F(static_cast<leaf_pointer>(p_nd)->value()), r_key))
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key));
+ return iterator(p_nd);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ return end();
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+find(const_key_reference r_key) const
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ const_node_pointer p_nd = const_cast<PB_DS_CLASS_C_DEC* >(this)->find_imp(r_key);
+
+ if (p_nd == NULL || p_nd->m_type != pat_trie_leaf_node_type)
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ return end();
+ }
+
+ if (synth_e_access_traits::equal_keys(PB_DS_V2F(static_cast<const_leaf_pointer>(p_nd)->value()), r_key))
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key));
+ return const_iterator(const_cast<node_pointer>(p_nd));
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);)
+ return end();
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+find_imp(const_key_reference r_key)
+{
+ if (empty())
+ return (NULL);
+
+ typename synth_e_access_traits::const_iterator b_it =
+ synth_e_access_traits::begin(r_key);
+ typename synth_e_access_traits::const_iterator e_it =
+ synth_e_access_traits::end(r_key);
+
+ node_pointer p_nd = m_p_head->m_p_parent;
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+
+ while (p_nd->m_type != pat_trie_leaf_node_type)
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_type == pat_trie_internal_node_type);
+ node_pointer p_next_nd = static_cast<internal_node_pointer>(p_nd)->get_child_node(b_it, e_it, this);
+
+ if (p_next_nd == NULL)
+ return p_nd;
+ p_nd = p_next_nd;
+ }
+ return p_nd;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+lower_bound_imp(const_key_reference r_key)
+{
+ if (empty())
+ return (m_p_head);
+
+ node_pointer p_nd = m_p_head->m_p_parent;
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+
+ typename PB_DS_CLASS_C_DEC::const_e_iterator b_it =
+ synth_e_access_traits::begin(r_key);
+
+ typename PB_DS_CLASS_C_DEC::const_e_iterator e_it =
+ synth_e_access_traits::end(r_key);
+
+ size_type checked_ind = 0;
+ while (true)
+ {
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ {
+ if (!synth_e_access_traits::cmp_keys(PB_DS_V2F(static_cast<const_leaf_pointer>(p_nd)->value()), r_key))
+ return p_nd;
+ iterator it(p_nd);
+ ++it;
+ return it.m_p_nd;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_type == pat_trie_internal_node_type);
+ const size_type new_checked_ind =
+ static_cast<internal_node_pointer>(p_nd)->get_e_ind();
+
+ p_nd =
+ static_cast<internal_node_pointer>(p_nd)->get_lower_bound_child_node( b_it, e_it, checked_ind, this);
+ checked_ind = new_checked_ind;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+lower_bound(const_key_reference r_key)
+{ return point_iterator(lower_bound_imp(r_key)); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+lower_bound(const_key_reference r_key) const
+{
+ return const_point_iterator(const_cast<PB_DS_CLASS_C_DEC* >(this)->lower_bound_imp(r_key));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+upper_bound(const_key_reference r_key)
+{
+ point_iterator l_bound_it = lower_bound(r_key);
+
+ _GLIBCXX_DEBUG_ASSERT(l_bound_it == end() ||
+ !synth_e_access_traits::cmp_keys(PB_DS_V2F(*l_bound_it),
+ r_key));
+
+ if (l_bound_it == end() ||
+ synth_e_access_traits::cmp_keys(r_key, PB_DS_V2F(*l_bound_it)))
+ return l_bound_it;
+
+ return ++l_bound_it;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+upper_bound(const_key_reference r_key) const
+{
+ const_point_iterator l_bound_it = lower_bound(r_key);
+
+ _GLIBCXX_DEBUG_ASSERT(l_bound_it == end() ||
+ !synth_e_access_traits::cmp_keys(PB_DS_V2F(*l_bound_it),
+ r_key));
+
+ if (l_bound_it == end() ||
+ synth_e_access_traits::cmp_keys(r_key, PB_DS_V2F(*l_bound_it)))
+ return l_bound_it;
+ return ++l_bound_it;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_e_iterator
+PB_DS_CLASS_C_DEC::
+pref_begin(const_node_pointer p_nd)
+{
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ return (synth_e_access_traits::begin(PB_DS_V2F(static_cast<const_leaf_pointer>(p_nd)->value())));
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_type == pat_trie_internal_node_type);
+ return static_cast<const_internal_node_pointer>(p_nd)->pref_b_it();
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_e_iterator
+PB_DS_CLASS_C_DEC::
+pref_end(const_node_pointer p_nd)
+{
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ return (synth_e_access_traits::end(PB_DS_V2F(static_cast<const_leaf_pointer>(p_nd)->value())));
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_type == pat_trie_internal_node_type);
+ return static_cast<const_internal_node_pointer>(p_nd)->pref_e_it();
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_leaf_pointer
+PB_DS_CLASS_C_DEC::
+leftmost_descendant(const_node_pointer p_nd)
+{
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ return static_cast<const_leaf_pointer>(p_nd);
+ return static_cast<const_internal_node_pointer>(p_nd)->leftmost_descendant();
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::leaf_pointer
+PB_DS_CLASS_C_DEC::
+leftmost_descendant(node_pointer p_nd)
+{
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ return static_cast<leaf_pointer>(p_nd);
+ return static_cast<internal_node_pointer>(p_nd)->leftmost_descendant();
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_leaf_pointer
+PB_DS_CLASS_C_DEC::
+rightmost_descendant(const_node_pointer p_nd)
+{
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ return static_cast<const_leaf_pointer>(p_nd);
+ return static_cast<const_internal_node_pointer>(p_nd)->rightmost_descendant();
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::leaf_pointer
+PB_DS_CLASS_C_DEC::
+rightmost_descendant(node_pointer p_nd)
+{
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ return static_cast<leaf_pointer>(p_nd);
+ return static_cast<internal_node_pointer>(p_nd)->rightmost_descendant();
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/head.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/head.hpp
new file mode 100644
index 0000000..0c73812
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/head.hpp
@@ -0,0 +1,124 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file head.hpp
+ * Contains a leaf for a patricia tree.
+ */
+
+#ifndef PB_DS_PAT_TRIE_IHEAD_HPP
+#define PB_DS_PAT_TRIE_IHEAD_HPP
+
+#include <ext/pb_ds/detail/pat_trie_/node_base.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Type_Traits, typename E_Access_Traits, \
+ typename Metadata, typename Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ pat_trie_head<Type_Traits, E_Access_Traits, Metadata, Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ pat_trie_node_base<Type_Traits, E_Access_Traits, Metadata, Allocator>
+
+ template<typename Type_Traits,
+ typename E_Access_Traits,
+ typename Metadata,
+ typename Allocator>
+ struct pat_trie_head : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef E_Access_Traits e_access_traits;
+
+ typedef
+ typename Allocator::template rebind<
+ e_access_traits>::other::const_pointer
+ const_e_access_traits_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ PB_DS_BASE_C_DEC>::other::pointer
+ node_pointer;
+
+#ifdef _GLIBCXX_DEBUG
+ typedef
+ typename PB_DS_BASE_C_DEC::subtree_debug_info
+ subtree_debug_info;
+#endif
+
+ public:
+ pat_trie_head();
+
+#ifdef _GLIBCXX_DEBUG
+ virtual subtree_debug_info
+ assert_valid_imp(const_e_access_traits_pointer p_traits) const;
+#endif
+
+ public:
+ node_pointer m_p_min;
+
+ node_pointer m_p_max;
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ pat_trie_head() : PB_DS_BASE_C_DEC(pat_trie_head_node_type)
+ { }
+
+#ifdef _GLIBCXX_DEBUG
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::subtree_debug_info
+ PB_DS_CLASS_C_DEC::
+ assert_valid_imp(const_e_access_traits_pointer /*p_traits*/) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(false);
+ return subtree_debug_info();
+ }
+#endif
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_BASE_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp
new file mode 100644
index 0000000..81d7096
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file info_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+empty() const
+{ return (m_size == 0); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+size() const
+{ return m_size; }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+max_size() const
+{ return s_internal_node_allocator.max_size(); }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp
new file mode 100644
index 0000000..e604974
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp
@@ -0,0 +1,465 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_join_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+join(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(););
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(););
+ split_join_branch_bag bag;
+ if (!join_prep(other, bag))
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid(););
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(););
+ return;
+ }
+
+ m_p_head->m_p_parent = rec_join(m_p_head->m_p_parent,
+ other.m_p_head->m_p_parent, 0, bag);
+
+ m_p_head->m_p_parent->m_p_parent = m_p_head;
+ m_size += other.m_size;
+ other.initialize();
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(););
+ m_p_head->m_p_min = leftmost_descendant(m_p_head->m_p_parent);
+ m_p_head->m_p_max = rightmost_descendant(m_p_head->m_p_parent);
+ _GLIBCXX_DEBUG_ONLY(assert_valid(););
+}
+
+PB_DS_CLASS_T_DEC
+bool
+PB_DS_CLASS_C_DEC::
+join_prep(PB_DS_CLASS_C_DEC& other, split_join_branch_bag& r_bag)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ if (other.m_size == 0)
+ return false;
+
+ if (m_size == 0)
+ {
+ value_swap(other);
+ return false;
+ }
+
+ const bool greater = synth_e_access_traits::cmp_keys(PB_DS_V2F(static_cast<const_leaf_pointer>(
+ m_p_head->m_p_max)->value()),PB_DS_V2F(static_cast<const_leaf_pointer>(
+ other.m_p_head->m_p_min)->value()));
+
+ const bool lesser = synth_e_access_traits::cmp_keys(PB_DS_V2F(static_cast<const_leaf_pointer>(
+ other.m_p_head->m_p_max)->value()),PB_DS_V2F(static_cast<const_leaf_pointer>(m_p_head->m_p_min)->value()));
+
+ if (!greater && !lesser)
+ __throw_join_error();
+
+ rec_join_prep(m_p_head->m_p_parent, other.m_p_head->m_p_parent, r_bag);
+ _GLIBCXX_DEBUG_ONLY(debug_base::join(other);)
+ return true;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+rec_join_prep(const_node_pointer p_l, const_node_pointer p_r, split_join_branch_bag& r_bag)
+{
+ if (p_l->m_type == pat_trie_leaf_node_type)
+ {
+ if (p_r->m_type == pat_trie_leaf_node_type)
+ {
+ rec_join_prep(static_cast<const_leaf_pointer>(p_l),
+ static_cast<const_leaf_pointer>(p_r), r_bag);
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_r->m_type == pat_trie_internal_node_type);
+ rec_join_prep(static_cast<const_leaf_pointer>(p_l),
+ static_cast<const_internal_node_pointer>(p_r), r_bag);
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_l->m_type == pat_trie_internal_node_type);
+ if (p_r->m_type == pat_trie_leaf_node_type)
+ {
+ rec_join_prep(static_cast<const_internal_node_pointer>(p_l),
+ static_cast<const_leaf_pointer>(p_r), r_bag);
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_r->m_type == pat_trie_internal_node_type);
+
+ rec_join_prep(static_cast<const_internal_node_pointer>(p_l),
+ static_cast<const_internal_node_pointer>(p_r), r_bag);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+rec_join_prep(const_leaf_pointer /*p_l*/, const_leaf_pointer /*p_r*/,
+ split_join_branch_bag& r_bag)
+{ r_bag.add_branch(); }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+rec_join_prep(const_leaf_pointer /*p_l*/, const_internal_node_pointer /*p_r*/,
+ split_join_branch_bag& r_bag)
+{ r_bag.add_branch(); }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+rec_join_prep(const_internal_node_pointer /*p_l*/, const_leaf_pointer /*p_r*/,
+ split_join_branch_bag& r_bag)
+{ r_bag.add_branch(); }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+rec_join_prep(const_internal_node_pointer p_l, const_internal_node_pointer p_r,
+ split_join_branch_bag& r_bag)
+{
+ if (p_l->get_e_ind() == p_r->get_e_ind() &&
+ synth_e_access_traits::equal_prefixes(p_l->pref_b_it(), p_l->pref_e_it(),
+ p_r->pref_b_it(), p_r->pref_e_it()))
+ {
+ for (typename internal_node::const_iterator it = p_r->begin();
+ it != p_r->end(); ++ it)
+ {
+ const_node_pointer p_l_join_child = p_l->get_join_child(*it, this);
+ if (p_l_join_child != NULL)
+ rec_join_prep(p_l_join_child, * it, r_bag);
+ }
+ return;
+ }
+
+ if (p_r->get_e_ind() < p_l->get_e_ind() &&
+ p_r->should_be_mine(p_l->pref_b_it(), p_l->pref_e_it(), 0, this))
+ {
+ const_node_pointer p_r_join_child = p_r->get_join_child(p_l, this);
+ if (p_r_join_child != NULL)
+ rec_join_prep(p_r_join_child, p_l, r_bag);
+ return;
+ }
+
+ if (p_r->get_e_ind() < p_l->get_e_ind() &&
+ p_r->should_be_mine(p_l->pref_b_it(), p_l->pref_e_it(), 0, this))
+ {
+ const_node_pointer p_r_join_child = p_r->get_join_child(p_l, this);
+ if (p_r_join_child != NULL)
+ rec_join_prep(p_r_join_child, p_l, r_bag);
+ return;
+ }
+ r_bag.add_branch();
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+rec_join(node_pointer p_l, node_pointer p_r, size_type checked_ind, split_join_branch_bag& r_bag)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_r != NULL);
+ if (p_l == NULL)
+ {
+ apply_update(p_r, (node_update* )this);
+ return (p_r);
+ }
+
+ if (p_l->m_type == pat_trie_leaf_node_type)
+ {
+ if (p_r->m_type == pat_trie_leaf_node_type)
+ {
+ node_pointer p_ret = rec_join(static_cast<leaf_pointer>(p_l),
+ static_cast<leaf_pointer>(p_r), r_bag);
+ apply_update(p_ret, (node_update* )this);
+ return p_ret;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_r->m_type == pat_trie_internal_node_type);
+ node_pointer p_ret = rec_join(static_cast<leaf_pointer>(p_l),
+ static_cast<internal_node_pointer>(p_r),
+ checked_ind, r_bag);
+ apply_update(p_ret, (node_update* )this);
+ return p_ret;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_l->m_type == pat_trie_internal_node_type);
+ if (p_r->m_type == pat_trie_leaf_node_type)
+ {
+ node_pointer p_ret = rec_join(static_cast<internal_node_pointer>(p_l),
+ static_cast<leaf_pointer>(p_r),
+ checked_ind, r_bag);
+ apply_update(p_ret, (node_update* )this);
+ return p_ret;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_r->m_type == pat_trie_internal_node_type);
+ node_pointer p_ret = rec_join(static_cast<internal_node_pointer>(p_l),
+ static_cast<internal_node_pointer>(p_r),
+ r_bag);
+
+ apply_update(p_ret, (node_update* )this);
+ return p_ret;
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+rec_join(leaf_pointer p_l, leaf_pointer p_r, split_join_branch_bag& r_bag)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_r != NULL);
+ if (p_l == NULL)
+ return (p_r);
+ node_pointer p_ret = insert_branch(p_l, p_r, r_bag);
+ _GLIBCXX_DEBUG_ASSERT(recursive_count_leafs(p_ret) == 2);
+ return p_ret;
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+rec_join(leaf_pointer p_l, internal_node_pointer p_r, size_type checked_ind,
+ split_join_branch_bag& r_bag)
+{
+#ifdef _GLIBCXX_DEBUG
+ const size_type lhs_leafs = recursive_count_leafs(p_l);
+ const size_type rhs_leafs = recursive_count_leafs(p_r);
+#endif
+
+ _GLIBCXX_DEBUG_ASSERT(p_r != NULL);
+ node_pointer p_ret = rec_join(p_r, p_l, checked_ind, r_bag);
+ _GLIBCXX_DEBUG_ASSERT(recursive_count_leafs(p_ret) == lhs_leafs + rhs_leafs);
+ return p_ret;
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+rec_join(internal_node_pointer p_l, leaf_pointer p_r, size_type checked_ind, split_join_branch_bag& r_bag)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_l != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_r != NULL);
+
+#ifdef _GLIBCXX_DEBUG
+ const size_type lhs_leafs = recursive_count_leafs(p_l);
+ const size_type rhs_leafs = recursive_count_leafs(p_r);
+#endif
+
+ if (!p_l->should_be_mine(pref_begin(p_r), pref_end(p_r), checked_ind, this))
+ {
+ node_pointer p_ret = insert_branch(p_l, p_r, r_bag);
+ _GLIBCXX_DEBUG_ONLY(p_ret->assert_valid(this);)
+ _GLIBCXX_DEBUG_ASSERT(recursive_count_leafs(p_ret) ==
+ lhs_leafs + rhs_leafs);
+ return p_ret;
+ }
+
+ node_pointer p_pot_child = p_l->add_child(p_r, pref_begin(p_r),
+ pref_end(p_r), this);
+ if (p_pot_child != p_r)
+ {
+ node_pointer p_new_child = rec_join(p_pot_child, p_r, p_l->get_e_ind(),
+ r_bag);
+
+ p_l->replace_child(p_new_child, pref_begin(p_new_child),
+ pref_end(p_new_child), this);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(p_l->assert_valid(this));
+ _GLIBCXX_DEBUG_ASSERT(recursive_count_leafs(p_l) == lhs_leafs + rhs_leafs);
+ return p_l;
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+rec_join(internal_node_pointer p_l, internal_node_pointer p_r, split_join_branch_bag& r_bag)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_l != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_r != NULL);
+
+#ifdef _GLIBCXX_DEBUG
+ const size_type lhs_leafs = recursive_count_leafs(p_l);
+ const size_type rhs_leafs = recursive_count_leafs(p_r);
+#endif
+
+ if (p_l->get_e_ind() == p_r->get_e_ind() &&
+ synth_e_access_traits::equal_prefixes(p_l->pref_b_it(), p_l->pref_e_it(),
+ p_r->pref_b_it(), p_r->pref_e_it()))
+ {
+ for (typename internal_node::iterator it = p_r->begin();
+ it != p_r->end(); ++ it)
+ {
+ node_pointer p_new_child = rec_join(p_l->get_join_child(*it, this),
+ * it, 0, r_bag);
+ p_l->replace_child(p_new_child, pref_begin(p_new_child),
+ pref_end(p_new_child), this);
+ }
+
+ p_r->~internal_node();
+ s_internal_node_allocator.deallocate(p_r, 1);
+ _GLIBCXX_DEBUG_ONLY(p_l->assert_valid(this);)
+ _GLIBCXX_DEBUG_ASSERT(recursive_count_leafs(p_l) == lhs_leafs + rhs_leafs);
+ return p_l;
+ }
+
+ if (p_l->get_e_ind() < p_r->get_e_ind() &&
+ p_l->should_be_mine(p_r->pref_b_it(), p_r->pref_e_it(), 0, this))
+ {
+ node_pointer p_new_child = rec_join(p_l->get_join_child(p_r, this),
+ p_r, 0, r_bag);
+ p_l->replace_child(p_new_child, pref_begin(p_new_child),
+ pref_end(p_new_child), this);
+ _GLIBCXX_DEBUG_ONLY(p_l->assert_valid(this);)
+ return p_l;
+ }
+
+ if (p_r->get_e_ind() < p_l->get_e_ind() &&
+ p_r->should_be_mine(p_l->pref_b_it(), p_l->pref_e_it(), 0, this))
+ {
+ node_pointer p_new_child = rec_join(p_r->get_join_child(p_l, this), p_l,
+ 0, r_bag);
+
+ p_r->replace_child(p_new_child, pref_begin(p_new_child),
+ pref_end(p_new_child), this);
+
+ _GLIBCXX_DEBUG_ONLY(p_r->assert_valid(this);)
+ _GLIBCXX_DEBUG_ASSERT(recursive_count_leafs(p_r) == lhs_leafs + rhs_leafs);
+ return p_r;
+ }
+
+ node_pointer p_ret = insert_branch(p_l, p_r, r_bag);
+ _GLIBCXX_DEBUG_ONLY(p_ret->assert_valid(this);)
+ _GLIBCXX_DEBUG_ASSERT(recursive_count_leafs(p_ret) == lhs_leafs + rhs_leafs);
+ return p_ret;
+}
+
+PB_DS_CLASS_T_DEC
+inline std::pair<typename PB_DS_CLASS_C_DEC::iterator, bool>
+PB_DS_CLASS_C_DEC::
+insert(const_reference r_val)
+{
+ node_pointer p_lf = find_imp(PB_DS_V2F(r_val));
+ if (p_lf != NULL && p_lf->m_type == pat_trie_leaf_node_type &&
+ synth_e_access_traits::equal_keys(PB_DS_V2F(static_cast<leaf_pointer>(p_lf)->value()), PB_DS_V2F(r_val)))
+ {
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(PB_DS_V2F(r_val)));
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return std::make_pair(iterator(p_lf), false);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(PB_DS_V2F(r_val)));
+
+ leaf_pointer p_new_lf = s_leaf_allocator.allocate(1);
+ cond_dealtor cond(p_new_lf);
+
+ new (p_new_lf) leaf(r_val);
+ apply_update(p_new_lf, (node_update* )this);
+ cond.set_call_destructor();
+ split_join_branch_bag bag;
+ bag.add_branch();
+ m_p_head->m_p_parent = rec_join(m_p_head->m_p_parent, p_new_lf, 0, bag);
+ m_p_head->m_p_parent->m_p_parent = m_p_head;
+ cond.set_no_action_dtor();
+ ++m_size;
+ update_min_max_for_inserted_leaf(p_new_lf);
+ _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(r_val));)
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return std::make_pair(point_iterator(p_new_lf), true);
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+keys_diff_ind(typename e_access_traits::const_iterator b_l, typename e_access_traits::const_iterator e_l, typename e_access_traits::const_iterator b_r, typename e_access_traits::const_iterator e_r)
+{
+ size_type diff_pos = 0;
+ while (b_l != e_l)
+ {
+ if (b_r == e_r)
+ return (diff_pos);
+ if (e_access_traits::e_pos(*b_l) != e_access_traits::e_pos(*b_r))
+ return (diff_pos);
+ ++b_l;
+ ++b_r;
+ ++diff_pos;
+ }
+ _GLIBCXX_DEBUG_ASSERT(b_r != e_r);
+ return diff_pos;
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::internal_node_pointer
+PB_DS_CLASS_C_DEC::
+insert_branch(node_pointer p_l, node_pointer p_r, split_join_branch_bag& r_bag)
+{
+ typename synth_e_access_traits::const_iterator left_b_it = pref_begin(p_l);
+ typename synth_e_access_traits::const_iterator left_e_it = pref_end(p_l);
+ typename synth_e_access_traits::const_iterator right_b_it = pref_begin(p_r);
+ typename synth_e_access_traits::const_iterator right_e_it = pref_end(p_r);
+
+ const size_type diff_ind = keys_diff_ind(left_b_it, left_e_it,
+ right_b_it, right_e_it);
+
+ internal_node_pointer p_new_nd = r_bag.get_branch();
+ new (p_new_nd) internal_node(diff_ind, left_b_it);
+ p_new_nd->add_child(p_l, left_b_it, left_e_it, this);
+ p_new_nd->add_child(p_r, right_b_it, right_e_it, this);
+ p_l->m_p_parent = p_new_nd;
+ p_r->m_p_parent = p_new_nd;
+ _GLIBCXX_DEBUG_ONLY(p_new_nd->assert_valid(this);)
+ return (p_new_nd);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+update_min_max_for_inserted_leaf(leaf_pointer p_new_lf)
+{
+ if (m_p_head->m_p_min == m_p_head ||
+ synth_e_access_traits::cmp_keys(PB_DS_V2F(p_new_lf->value()),
+ PB_DS_V2F(static_cast<const_leaf_pointer>(m_p_head->m_p_min)->value())))
+ m_p_head->m_p_min = p_new_lf;
+
+ if (m_p_head->m_p_max == m_p_head ||
+ synth_e_access_traits::cmp_keys(PB_DS_V2F(static_cast<const_leaf_pointer>(m_p_head->m_p_max)->value()), PB_DS_V2F(p_new_lf->value())))
+ m_p_head->m_p_max = p_new_lf;
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/internal_node.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/internal_node.hpp
new file mode 100644
index 0000000..bf2f429
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/internal_node.hpp
@@ -0,0 +1,599 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file internal_node.hpp
+ * Contains an internal PB_DS_BASE_C_DEC for a patricia tree.
+ */
+
+#ifndef PB_DS_PAT_TRIE_INTERNAL_NODE_HPP
+#define PB_DS_PAT_TRIE_INTERNAL_NODE_HPP
+
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Type_Traits, typename E_Access_Traits, \
+ typename Metadata, typename Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ pat_trie_internal_node<Type_Traits, E_Access_Traits, Metadata, Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ pat_trie_node_base<Type_Traits, E_Access_Traits, Metadata, Allocator>
+
+#define PB_DS_LEAF_C_DEC \
+ pat_trie_leaf<Type_Traits, E_Access_Traits, Metadata, Allocator>
+
+ template<typename Type_Traits,
+ typename E_Access_Traits,
+ typename Metadata,
+ typename Allocator>
+ struct pat_trie_internal_node : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+ typedef Type_Traits type_traits;
+ typedef typename type_traits::value_type value_type;
+ typedef typename Allocator::size_type size_type;
+
+ typedef E_Access_Traits e_access_traits;
+ typedef typename e_access_traits::const_iterator const_e_iterator;
+ typedef typename Allocator::template rebind<e_access_traits>::other access_rebind;
+ typedef typename access_rebind::const_pointer const_e_access_traits_pointer;
+
+ typedef typename Allocator::template rebind<base_type>::other base_rebind;
+ typedef typename base_rebind::pointer node_pointer;
+ typedef typename base_rebind::const_pointer const_node_pointer;
+
+ typedef PB_DS_LEAF_C_DEC leaf;
+ typedef typename Allocator::template rebind<leaf>::other leaf_rebind;
+ typedef typename leaf_rebind::pointer leaf_pointer;
+ typedef typename leaf_rebind::const_pointer const_leaf_pointer;
+
+ typedef typename Allocator::template rebind<pat_trie_internal_node>::other internal_node_rebind;
+ typedef typename internal_node_rebind::pointer internal_node_pointer;
+ typedef typename internal_node_rebind::const_pointer const_internal_node_pointer;
+
+#ifdef _GLIBCXX_DEBUG
+ typedef typename base_type::subtree_debug_info subtree_debug_info;
+
+ virtual subtree_debug_info
+ assert_valid_imp(const_e_access_traits_pointer) const;
+#endif
+
+ inline size_type
+ get_pref_pos(const_e_iterator, const_e_iterator,
+ const_e_access_traits_pointer) const;
+
+ public:
+ typedef typename Allocator::template rebind<node_pointer>::other node_pointer_rebind;
+ typedef typename node_pointer_rebind::pointer node_pointer_pointer;
+ typedef typename node_pointer_rebind::reference node_pointer_reference;
+
+ enum
+ {
+ arr_size = E_Access_Traits::max_size + 1
+ };
+ PB_DS_STATIC_ASSERT(min_arr_size, arr_size >= 2);
+
+#include <ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp>
+#include <ext/pb_ds/detail/pat_trie_/child_iterator.hpp>
+
+ pat_trie_internal_node(size_type, const const_e_iterator);
+
+ void
+ update_prefixes(const_e_access_traits_pointer);
+
+ const_iterator
+ begin() const;
+
+ iterator
+ begin();
+
+ const_iterator
+ end() const;
+
+ iterator
+ end();
+
+ inline node_pointer
+ get_child_node(const_e_iterator, const_e_iterator,
+ const_e_access_traits_pointer);
+
+ inline const_node_pointer
+ get_child_node(const_e_iterator, const_e_iterator,
+ const_e_access_traits_pointer) const;
+
+ inline iterator
+ get_child_it(const_e_iterator, const_e_iterator,
+ const_e_access_traits_pointer);
+
+ inline node_pointer
+ get_lower_bound_child_node(const_e_iterator, const_e_iterator,
+ size_type, const_e_access_traits_pointer);
+
+ inline node_pointer
+ add_child(node_pointer, const_e_iterator, const_e_iterator,
+ const_e_access_traits_pointer);
+
+ inline const_node_pointer
+ get_join_child(const_node_pointer, const_e_access_traits_pointer) const;
+
+ inline node_pointer
+ get_join_child(node_pointer, const_e_access_traits_pointer);
+
+ void
+ remove_child(node_pointer p_nd);
+
+ iterator
+ remove_child(iterator it);
+
+ void
+ replace_child(node_pointer, const_e_iterator, const_e_iterator,
+ const_e_access_traits_pointer);
+
+ inline const_e_iterator
+ pref_b_it() const;
+
+ inline const_e_iterator
+ pref_e_it() const;
+
+ inline size_type
+ get_e_ind() const;
+
+ bool
+ should_be_mine(const_e_iterator, const_e_iterator, size_type,
+ const_e_access_traits_pointer) const;
+
+ leaf_pointer
+ leftmost_descendant();
+
+ const_leaf_pointer
+ leftmost_descendant() const;
+
+ leaf_pointer
+ rightmost_descendant();
+
+ const_leaf_pointer
+ rightmost_descendant() const;
+
+#ifdef _GLIBCXX_DEBUG
+ size_type
+ e_ind() const;
+#endif
+
+ private:
+ pat_trie_internal_node(const pat_trie_internal_node&);
+
+ size_type
+ get_begin_pos() const;
+
+ const size_type m_e_ind;
+ const_e_iterator m_pref_b_it;
+ const_e_iterator m_pref_e_it;
+ node_pointer m_a_p_children[arr_size];
+ static leaf_rebind s_leaf_alloc;
+ static internal_node_rebind s_internal_node_alloc;
+ };
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::leaf_rebind
+ PB_DS_CLASS_C_DEC::s_leaf_alloc;
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::internal_node_rebind
+ PB_DS_CLASS_C_DEC::s_internal_node_alloc;
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ get_pref_pos(const_e_iterator b_it, const_e_iterator e_it,
+ const_e_access_traits_pointer p_traits) const
+ {
+ if (static_cast<size_t>(std::distance(b_it, e_it)) <= m_e_ind)
+ return 0;
+ std::advance(b_it, m_e_ind);
+ return 1 + p_traits->e_pos(*b_it);
+ }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ pat_trie_internal_node(size_type len, const const_e_iterator it) :
+ PB_DS_BASE_C_DEC(pat_trie_internal_node_type),
+ m_e_ind(len), m_pref_b_it(it), m_pref_e_it(it)
+ {
+ std::advance(m_pref_e_it, m_e_ind);
+ std::fill(m_a_p_children, m_a_p_children + arr_size,
+ static_cast<node_pointer>(NULL));
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ update_prefixes(const_e_access_traits_pointer p_traits)
+ {
+ node_pointer p_first = *begin();
+ if (p_first->m_type == pat_trie_leaf_node_type)
+ {
+ const_leaf_pointer p = static_cast<const_leaf_pointer>(p_first);
+ m_pref_b_it = p_traits->begin(e_access_traits::extract_key(p->value()));
+ }
+ else
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_first->m_type == pat_trie_internal_node_type);
+ m_pref_b_it = static_cast<internal_node_pointer>(p_first)->pref_b_it();
+ }
+ m_pref_e_it = m_pref_b_it;
+ std::advance(m_pref_e_it, m_e_ind);
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::const_iterator
+ PB_DS_CLASS_C_DEC::
+ begin() const
+ {
+ typedef node_pointer_pointer pointer_type;
+ pointer_type p = const_cast<pointer_type>(m_a_p_children);
+ return const_iterator(p + get_begin_pos(), p + arr_size);
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::iterator
+ PB_DS_CLASS_C_DEC::
+ begin()
+ {
+ return iterator(m_a_p_children + get_begin_pos(),
+ m_a_p_children + arr_size);
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::const_iterator
+ PB_DS_CLASS_C_DEC::
+ end() const
+ {
+ typedef node_pointer_pointer pointer_type;
+ pointer_type p = const_cast<pointer_type>(m_a_p_children) + arr_size;
+ return const_iterator(p, p);
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::iterator
+ PB_DS_CLASS_C_DEC::
+ end()
+ { return iterator(m_a_p_children + arr_size, m_a_p_children + arr_size); }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::node_pointer
+ PB_DS_CLASS_C_DEC::
+ get_child_node(const_e_iterator b_it, const_e_iterator e_it,
+ const_e_access_traits_pointer p_traits)
+ {
+ const size_type i = get_pref_pos(b_it, e_it, p_traits);
+ _GLIBCXX_DEBUG_ASSERT(i < arr_size);
+ return m_a_p_children[i];
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::iterator
+ PB_DS_CLASS_C_DEC::
+ get_child_it(const_e_iterator b_it, const_e_iterator e_it,
+ const_e_access_traits_pointer p_traits)
+ {
+ const size_type i = get_pref_pos(b_it, e_it, p_traits);
+ _GLIBCXX_DEBUG_ASSERT(i < arr_size);
+ _GLIBCXX_DEBUG_ASSERT(m_a_p_children[i] != NULL);
+ return iterator(m_a_p_children + i, m_a_p_children + i);
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::const_node_pointer
+ PB_DS_CLASS_C_DEC::
+ get_child_node(const_e_iterator b_it, const_e_iterator e_it,
+ const_e_access_traits_pointer p_traits) const
+ { return const_cast<node_pointer>(get_child_node(b_it, e_it, p_traits)); }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::node_pointer
+ PB_DS_CLASS_C_DEC::
+ get_lower_bound_child_node(const_e_iterator b_it, const_e_iterator e_it,
+ size_type checked_ind,
+ const_e_access_traits_pointer p_traits)
+ {
+ if (!should_be_mine(b_it, e_it, checked_ind, p_traits))
+ {
+ if (p_traits->cmp_prefixes(b_it, e_it, m_pref_b_it, m_pref_e_it, true))
+ return leftmost_descendant();
+ return rightmost_descendant();
+ }
+
+ size_type i = get_pref_pos(b_it, e_it, p_traits);
+ _GLIBCXX_DEBUG_ASSERT(i < arr_size);
+
+ if (m_a_p_children[i] != NULL)
+ return m_a_p_children[i];
+
+ while (++i < arr_size)
+ if (m_a_p_children[i] != NULL)
+ {
+ if (m_a_p_children[i]->m_type == pat_trie_leaf_node_type)
+ return m_a_p_children[i];
+
+ _GLIBCXX_DEBUG_ASSERT(m_a_p_children[i]->m_type == pat_trie_internal_node_type);
+
+ return static_cast<internal_node_pointer>(m_a_p_children[i])->leftmost_descendant();
+ }
+
+ return rightmost_descendant();
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::node_pointer
+ PB_DS_CLASS_C_DEC::
+ add_child(node_pointer p_nd, const_e_iterator b_it, const_e_iterator e_it,
+ const_e_access_traits_pointer p_traits)
+ {
+ const size_type i = get_pref_pos(b_it, e_it, p_traits);
+ _GLIBCXX_DEBUG_ASSERT(i < arr_size);
+ if (m_a_p_children[i] == NULL)
+ {
+ m_a_p_children[i] = p_nd;
+ p_nd->m_p_parent = this;
+ return p_nd;
+ }
+ return m_a_p_children[i];
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::const_node_pointer
+ PB_DS_CLASS_C_DEC::
+ get_join_child(const_node_pointer p_nd, const_e_access_traits_pointer p_traits) const
+ {
+ node_pointer p = const_cast<node_pointer>(p_nd);
+ return const_cast<internal_node_pointer>(this)->get_join_child(p, p_traits);
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::node_pointer
+ PB_DS_CLASS_C_DEC::
+ get_join_child(node_pointer p_nd, const_e_access_traits_pointer p_traits)
+ {
+ size_type i;
+ const_e_iterator b_it;
+ const_e_iterator e_it;
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ {
+ typename Type_Traits::const_key_reference r_key =
+ e_access_traits::extract_key(static_cast<const_leaf_pointer>(p_nd)->value());
+
+ b_it = p_traits->begin(r_key);
+ e_it = p_traits->end(r_key);
+ }
+ else
+ {
+ b_it = static_cast<internal_node_pointer>(p_nd)->pref_b_it();
+ e_it = static_cast<internal_node_pointer>(p_nd)->pref_e_it();
+ }
+ i = get_pref_pos(b_it, e_it, p_traits);
+ _GLIBCXX_DEBUG_ASSERT(i < arr_size);
+ return m_a_p_children[i];
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ remove_child(node_pointer p_nd)
+ {
+ size_type i = 0;
+ for (; i < arr_size; ++i)
+ if (m_a_p_children[i] == p_nd)
+ {
+ m_a_p_children[i] = NULL;
+ return;
+ }
+ _GLIBCXX_DEBUG_ASSERT(i != arr_size);
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::iterator
+ PB_DS_CLASS_C_DEC::
+ remove_child(iterator it)
+ {
+ iterator ret = it;
+ ++ret;
+ * it.m_p_p_cur = NULL;
+ return ret;
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ replace_child(node_pointer p_nd, const_e_iterator b_it,
+ const_e_iterator e_it,
+ const_e_access_traits_pointer p_traits)
+ {
+ const size_type i = get_pref_pos(b_it, e_it, p_traits);
+ _GLIBCXX_DEBUG_ASSERT(i < arr_size);
+ m_a_p_children[i] = p_nd;
+ p_nd->m_p_parent = this;
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::const_e_iterator
+ PB_DS_CLASS_C_DEC::
+ pref_b_it() const
+ { return m_pref_b_it; }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::const_e_iterator
+ PB_DS_CLASS_C_DEC::
+ pref_e_it() const
+ { return m_pref_e_it; }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ get_e_ind() const
+ { return m_e_ind; }
+
+ PB_DS_CLASS_T_DEC
+ bool
+ PB_DS_CLASS_C_DEC::
+ should_be_mine(const_e_iterator b_it, const_e_iterator e_it,
+ size_type checked_ind,
+ const_e_access_traits_pointer p_traits) const
+ {
+ if (m_e_ind == 0)
+ return true;
+
+ const size_type num_es = std::distance(b_it, e_it);
+ if (num_es < m_e_ind)
+ return false;
+
+ const_e_iterator key_b_it = b_it;
+ std::advance(key_b_it, checked_ind);
+ const_e_iterator key_e_it = b_it;
+ std::advance(key_e_it, m_e_ind);
+
+ const_e_iterator value_b_it = m_pref_b_it;
+ std::advance(value_b_it, checked_ind);
+ const_e_iterator value_e_it = m_pref_b_it;
+ std::advance(value_e_it, m_e_ind);
+
+ return p_traits->equal_prefixes(key_b_it, key_e_it, value_b_it,
+ value_e_it);
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::leaf_pointer
+ PB_DS_CLASS_C_DEC::
+ leftmost_descendant()
+ {
+ node_pointer p_pot =* begin();
+ if (p_pot->m_type == pat_trie_leaf_node_type)
+ return (static_cast<leaf_pointer>(p_pot));
+ _GLIBCXX_DEBUG_ASSERT(p_pot->m_type == pat_trie_internal_node_type);
+ return static_cast<internal_node_pointer>(p_pot)->leftmost_descendant();
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::const_leaf_pointer
+ PB_DS_CLASS_C_DEC::
+ leftmost_descendant() const
+ {
+ return const_cast<internal_node_pointer>(this)->leftmost_descendant();
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::leaf_pointer
+ PB_DS_CLASS_C_DEC::
+ rightmost_descendant()
+ {
+ const size_type num_children = std::distance(begin(), end());
+ _GLIBCXX_DEBUG_ASSERT(num_children >= 2);
+
+ iterator it = begin();
+ std::advance(it, num_children - 1);
+ node_pointer p_pot =* it;
+ if (p_pot->m_type == pat_trie_leaf_node_type)
+ return static_cast<leaf_pointer>(p_pot);
+ _GLIBCXX_DEBUG_ASSERT(p_pot->m_type == pat_trie_internal_node_type);
+ return static_cast<internal_node_pointer>(p_pot)->rightmost_descendant();
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::const_leaf_pointer
+ PB_DS_CLASS_C_DEC::
+ rightmost_descendant() const
+ {
+ return const_cast<internal_node_pointer>(this)->rightmost_descendant();
+ }
+
+#ifdef _GLIBCXX_DEBUG
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ e_ind() const
+ { return m_e_ind; }
+#endif
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ get_begin_pos() const
+ {
+ size_type i;
+ for (i = 0; i < arr_size && m_a_p_children[i] == NULL; ++i)
+ ;
+ return i;
+ }
+
+#ifdef _GLIBCXX_DEBUG
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::subtree_debug_info
+ PB_DS_CLASS_C_DEC::
+ assert_valid_imp(const_e_access_traits_pointer p_traits) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_type == pat_trie_internal_node_type);
+ _GLIBCXX_DEBUG_ASSERT(static_cast<size_type>(std::distance(pref_b_it(), pref_e_it())) == m_e_ind);
+ _GLIBCXX_DEBUG_ASSERT(std::distance(begin(), end()) >= 2);
+
+ for (typename pat_trie_internal_node::const_iterator it = begin();
+ it != end(); ++it)
+ {
+ const_node_pointer p_nd =* it;
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_parent == this);
+ subtree_debug_info child_ret = p_nd->assert_valid_imp(p_traits);
+
+ _GLIBCXX_DEBUG_ASSERT(static_cast<size_type>(std::distance(child_ret.first, child_ret.second)) >= m_e_ind);
+ _GLIBCXX_DEBUG_ASSERT(should_be_mine(child_ret.first, child_ret.second, 0, p_traits));
+ _GLIBCXX_DEBUG_ASSERT(get_pref_pos(child_ret.first, child_ret.second, p_traits) == static_cast<size_type>(it.m_p_p_cur - m_a_p_children));
+ }
+ return std::make_pair(pref_b_it(), pref_e_it());
+ }
+#endif
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_BASE_C_DEC
+#undef PB_DS_LEAF_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp
new file mode 100644
index 0000000..9902d96
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp
@@ -0,0 +1,120 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file iterators_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+begin()
+{ return iterator(m_p_head->m_p_min); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+begin() const
+{ return const_iterator(m_p_head->m_p_min); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+end()
+{ return iterator(m_p_head); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+end() const
+{ return const_iterator(m_p_head); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reverse_iterator
+PB_DS_CLASS_C_DEC::
+rbegin() const
+{
+ if (empty())
+ return rend();
+ return --end();
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::reverse_iterator
+PB_DS_CLASS_C_DEC::
+rbegin()
+{
+ if (empty())
+ return rend();
+ return --end();
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::reverse_iterator
+PB_DS_CLASS_C_DEC::
+rend()
+{ return reverse_iterator(m_p_head); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reverse_iterator
+PB_DS_CLASS_C_DEC::
+rend() const
+{ return const_reverse_iterator(m_p_head); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_node_iterator
+PB_DS_CLASS_C_DEC::
+node_begin() const
+{ return const_node_iterator(m_p_head->m_p_parent, this); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_iterator
+PB_DS_CLASS_C_DEC::
+node_begin()
+{ return node_iterator(m_p_head->m_p_parent, this); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_node_iterator
+PB_DS_CLASS_C_DEC::
+node_end() const
+{ return const_node_iterator(NULL, this); }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_iterator
+PB_DS_CLASS_C_DEC::
+node_end()
+{ return node_iterator(NULL, this); }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/leaf.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/leaf.hpp
new file mode 100644
index 0000000..91cf14f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/leaf.hpp
@@ -0,0 +1,171 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file leaf.hpp
+ * Contains a pat_trie_leaf for a patricia tree.
+ */
+
+#ifndef PB_DS_PAT_TRIE_LEAF_HPP
+#define PB_DS_PAT_TRIE_LEAF_HPP
+
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template< \
+ class Type_Traits, \
+ class E_Access_Traits, \
+ class Metadata, \
+ class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ pat_trie_leaf< \
+ Type_Traits, \
+ E_Access_Traits, \
+ Metadata, \
+ Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ pat_trie_node_base< \
+ Type_Traits, \
+ E_Access_Traits, \
+ Metadata, \
+ Allocator>
+
+#define PB_DS_PAT_TRIE_SUBTREE_DEBUG_INFO_C_DEC \
+ pat_trie_subtree_debug_info< \
+ Type_Traits, \
+ E_Access_Traits, \
+ Allocator>
+
+ template<typename Type_Traits,
+ class E_Access_Traits,
+ class Metadata,
+ class Allocator>
+ struct pat_trie_leaf : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef typename Type_Traits::value_type value_type;
+
+ typedef typename Type_Traits::const_reference const_reference;
+
+ typedef typename Type_Traits::reference reference;
+
+ typedef
+ typename Allocator::template rebind<
+ E_Access_Traits>::other::const_pointer
+ const_e_access_traits_pointer;
+
+#ifdef _GLIBCXX_DEBUG
+ typedef
+ typename PB_DS_BASE_C_DEC::subtree_debug_info
+ subtree_debug_info;
+#endif
+
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ pat_trie_leaf(const_reference r_val);
+
+ inline reference
+ value();
+
+ inline const_reference
+ value() const;
+
+#ifdef _GLIBCXX_DEBUG
+ virtual subtree_debug_info
+ assert_valid_imp(const_e_access_traits_pointer p_traits) const;
+
+ virtual
+ ~pat_trie_leaf();
+#endif
+
+ private:
+ pat_trie_leaf(const PB_DS_CLASS_C_DEC& other);
+
+ value_type m_value;
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ pat_trie_leaf(const_reference r_val) :
+ PB_DS_BASE_C_DEC(pat_trie_leaf_node_type), m_value(r_val)
+ { }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::reference
+ PB_DS_CLASS_C_DEC::
+ value()
+ { return m_value; }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::const_reference
+ PB_DS_CLASS_C_DEC::
+ value() const
+ { return m_value; }
+
+#ifdef _GLIBCXX_DEBUG
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::subtree_debug_info
+ PB_DS_CLASS_C_DEC::
+ assert_valid_imp(const_e_access_traits_pointer p_traits) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_type == pat_trie_leaf_node_type);
+ subtree_debug_info ret;
+ const_reference r_val = value();
+ return std::make_pair(p_traits->begin(p_traits->extract_key(r_val)),
+ p_traits->end(p_traits->extract_key(r_val)));
+ }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ ~pat_trie_leaf() { }
+#endif
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_BASE_C_DEC
+#undef PB_DS_PAT_TRIE_SUBTREE_DEBUG_INFO_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/node_base.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/node_base.hpp
new file mode 100644
index 0000000..bb13068
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/node_base.hpp
@@ -0,0 +1,128 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file node_base.hpp
+ * Contains a pat_trie_node_base base for a patricia tree.
+ */
+
+#ifndef PB_DS_PAT_TRIE_NODE_BASE_HPP
+#define PB_DS_PAT_TRIE_NODE_BASE_HPP
+
+#include <ext/pb_ds/detail/pat_trie_/node_metadata_base.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Type_Traits, typename E_Access_Traits, \
+ typename Metadata, typename Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ pat_trie_node_base<Type_Traits, E_Access_Traits, Metadata, Allocator>
+
+#define PB_DS_PAT_TRIE_SUBTREE_DEBUG_INFO_C_DEC \
+ pat_trie_subtree_debug_info<Type_Traits, E_Access_Traits, Allocator>
+
+ enum pat_trie_node_type
+ {
+ pat_trie_internal_node_type,
+ pat_trie_leaf_node_type,
+ pat_trie_head_node_type
+ };
+
+ template<typename Type_Traits,
+ typename E_Access_Traits,
+ typename Metadata,
+ typename Allocator>
+ struct pat_trie_node_base : public pat_trie_node_metadata_base<
+ Metadata,
+ Allocator>
+ {
+ public:
+ typedef
+ typename Allocator::template rebind<
+ pat_trie_node_base>::other::pointer
+ node_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ E_Access_Traits>::other::const_pointer
+ const_e_access_traits_pointer;
+
+#ifdef _GLIBCXX_DEBUG
+ typedef
+ std::pair<
+ typename E_Access_Traits::const_iterator,
+ typename E_Access_Traits::const_iterator>
+ subtree_debug_info;
+#endif
+
+ pat_trie_node_base(pat_trie_node_type type);
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid(const_e_access_traits_pointer p_traits) const;
+
+ virtual subtree_debug_info
+ assert_valid_imp(const_e_access_traits_pointer p_traits) const = 0;
+#endif
+
+ node_pointer m_p_parent;
+ const pat_trie_node_type m_type;
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ pat_trie_node_base(pat_trie_node_type type) : m_type(type)
+ { }
+
+#ifdef _GLIBCXX_DEBUG
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ assert_valid(const_e_access_traits_pointer p_traits) const
+ { assert_valid_imp(p_traits); }
+#endif
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_PAT_TRIE_SUBTREE_DEBUG_INFO_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/node_iterators.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/node_iterators.hpp
new file mode 100644
index 0000000..3725009
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/node_iterators.hpp
@@ -0,0 +1,338 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file node_iterators.hpp
+ * Contains an implementation class for pat_trie_.
+ */
+
+#ifndef PB_DS_PAT_TRIE_NODE_ITERATORS_HPP
+#define PB_DS_PAT_TRIE_NODE_ITERATORS_HPP
+
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_PAT_TRIE_CONST_NODE_ITERATOR_C_DEC \
+ pat_trie_const_node_it_< \
+ Node, \
+ Leaf, \
+ Head, \
+ Internal_Node, \
+ Const_Iterator, \
+ Iterator, \
+ E_Access_Traits, \
+ Allocator>
+
+#define PB_DS_PAT_TRIE_NODE_ITERATOR_C_DEC \
+ pat_trie_node_it_< \
+ Node, \
+ Leaf, \
+ Head, \
+ Internal_Node, \
+ Const_Iterator, \
+ Iterator, \
+ E_Access_Traits, \
+ Allocator>
+
+ // Const node iterator.
+ template<typename Node,
+ class Leaf,
+ class Head,
+ class Internal_Node,
+ class Const_Iterator,
+ class Iterator,
+ class E_Access_Traits,
+ class Allocator>
+ class pat_trie_const_node_it_
+ {
+ protected:
+ typedef
+ typename Allocator::template rebind<
+ Node>::other::pointer
+ node_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Leaf>::other::const_pointer
+ const_leaf_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Leaf>::other::pointer
+ leaf_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Internal_Node>::other::pointer
+ internal_node_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Internal_Node>::other::const_pointer
+ const_internal_node_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ E_Access_Traits>::other::const_pointer
+ const_e_access_traits_pointer;
+
+ private:
+ inline typename E_Access_Traits::const_iterator
+ pref_begin() const
+ {
+ if (m_p_nd->m_type == pat_trie_leaf_node_type)
+ return (m_p_traits->begin(
+ m_p_traits->extract_key(
+ static_cast<const_leaf_pointer>(m_p_nd)->value())));
+
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd->m_type == pat_trie_internal_node_type);
+
+ return (static_cast<const_internal_node_pointer>(m_p_nd)->pref_b_it());
+ }
+
+ inline typename E_Access_Traits::const_iterator
+ pref_end() const
+ {
+ if (m_p_nd->m_type == pat_trie_leaf_node_type)
+ return (m_p_traits->end(
+ m_p_traits->extract_key(
+ static_cast<const_leaf_pointer>(m_p_nd)->value())));
+
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd->m_type == pat_trie_internal_node_type);
+
+ return (static_cast<const_internal_node_pointer>(m_p_nd)->pref_e_it());
+ }
+
+ public:
+
+ // Size type.
+ typedef typename Allocator::size_type size_type;
+
+ // Category.
+ typedef trivial_iterator_tag iterator_category;
+
+ // Difference type.
+ typedef trivial_iterator_difference_type difference_type;
+
+ // __Iterator's value type.
+ typedef Const_Iterator value_type;
+
+ // __Iterator's reference type.
+ typedef value_type reference;
+
+ // __Iterator's __const reference type.
+ typedef value_type const_reference;
+
+ // Element access traits.
+ typedef E_Access_Traits e_access_traits;
+
+ // A key's element __const iterator.
+ typedef typename e_access_traits::const_iterator const_e_iterator;
+
+ // Metadata type.
+ typedef typename Node::metadata_type metadata_type;
+
+ // Const metadata reference type.
+ typedef
+ typename Allocator::template rebind<
+ metadata_type>::other::const_reference
+ const_metadata_reference;
+
+ // Default constructor.
+ /*
+ inline
+ pat_trie_const_node_it_()
+ */
+ inline
+ pat_trie_const_node_it_(node_pointer p_nd = NULL,
+ const_e_access_traits_pointer p_traits = NULL)
+ : m_p_nd(const_cast<node_pointer>(p_nd)), m_p_traits(p_traits)
+ { }
+
+ // Subtree valid prefix.
+ inline std::pair<const_e_iterator, const_e_iterator>
+ valid_prefix() const
+ { return std::make_pair(pref_begin(), pref_end()); }
+
+ // Const access; returns the __const iterator* associated with
+ // the current leaf.
+ inline const_reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(num_children() == 0);
+ return Const_Iterator(m_p_nd);
+ }
+
+ // Metadata access.
+ inline const_metadata_reference
+ get_metadata() const
+ { return m_p_nd->get_metadata(); }
+
+ // Returns the number of children in the corresponding node.
+ inline size_type
+ num_children() const
+ {
+ if (m_p_nd->m_type == pat_trie_leaf_node_type)
+ return 0;
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd->m_type == pat_trie_internal_node_type);
+ return std::distance(static_cast<internal_node_pointer>(m_p_nd)->begin(), static_cast<internal_node_pointer>(m_p_nd)->end());
+ }
+
+ // Returns a __const node __iterator to the corresponding node's
+ // i-th child.
+ PB_DS_PAT_TRIE_CONST_NODE_ITERATOR_C_DEC
+ get_child(size_type i) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd->m_type == pat_trie_internal_node_type);
+ typename Internal_Node::iterator it =
+ static_cast<internal_node_pointer>(m_p_nd)->begin();
+
+ std::advance(it, i);
+ return PB_DS_PAT_TRIE_CONST_NODE_ITERATOR_C_DEC(*it, m_p_traits);
+ }
+
+ // Compares content to a different iterator object.
+ inline bool
+ operator==(const PB_DS_PAT_TRIE_CONST_NODE_ITERATOR_C_DEC& other) const
+ { return (m_p_nd == other.m_p_nd); }
+
+ // Compares content (negatively) to a different iterator object.
+ inline bool
+ operator!=(const PB_DS_PAT_TRIE_CONST_NODE_ITERATOR_C_DEC& other) const
+ { return m_p_nd != other.m_p_nd; }
+
+ private:
+
+ friend class PB_DS_CLASS_C_DEC;
+
+ public:
+ node_pointer m_p_nd;
+
+ const_e_access_traits_pointer m_p_traits;
+ };
+
+ // Node iterator.
+ template<typename Node,
+ class Leaf,
+ class Head,
+ class Internal_Node,
+ class Const_Iterator,
+ class Iterator,
+ class E_Access_Traits,
+ class Allocator>
+ class pat_trie_node_it_ :
+ public PB_DS_PAT_TRIE_CONST_NODE_ITERATOR_C_DEC
+
+ {
+ private:
+ typedef
+ typename Allocator::template rebind<
+ Node>::other::pointer
+ node_pointer;
+
+ typedef Iterator iterator;
+
+ typedef PB_DS_PAT_TRIE_CONST_NODE_ITERATOR_C_DEC base_type;
+
+ typedef
+ typename base_type::const_e_access_traits_pointer
+ const_e_access_traits_pointer;
+
+ typedef typename base_type::internal_node_pointer internal_node_pointer;
+
+ public:
+
+ // Size type.
+ typedef
+ typename PB_DS_PAT_TRIE_CONST_NODE_ITERATOR_C_DEC::size_type
+ size_type;
+
+ // __Iterator's value type.
+ typedef Iterator value_type;
+
+ // __Iterator's reference type.
+ typedef value_type reference;
+
+ // __Iterator's __const reference type.
+ typedef value_type const_reference;
+
+ // Default constructor.
+ /*
+ inline
+ pat_trie_node_it_() ;
+ */
+
+ inline
+ pat_trie_node_it_(node_pointer p_nd = NULL, const_e_access_traits_pointer p_traits = NULL) : base_type(p_nd, p_traits)
+ { }
+
+ // Access; returns the iterator* associated with the current leaf.
+ inline reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::num_children() == 0);
+ return Iterator(base_type::m_p_nd);
+
+ }
+
+ // Returns a node __iterator to the corresponding node's i-th child.
+ PB_DS_PAT_TRIE_NODE_ITERATOR_C_DEC
+ get_child(size_type i) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_p_nd->m_type == pat_trie_internal_node_type);
+
+ typename Internal_Node::iterator it =
+ static_cast<internal_node_pointer>(base_type::m_p_nd)->begin();
+
+ std::advance(it, i);
+ return PB_DS_PAT_TRIE_NODE_ITERATOR_C_DEC(*it, base_type::m_p_traits);
+ }
+
+ private:
+ friend class PB_DS_CLASS_C_DEC;
+ };
+
+#undef PB_DS_PAT_TRIE_CONST_NODE_ITERATOR_C_DEC
+#undef PB_DS_PAT_TRIE_NODE_ITERATOR_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/node_metadata_base.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/node_metadata_base.hpp
new file mode 100644
index 0000000..36272ed
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/node_metadata_base.hpp
@@ -0,0 +1,86 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file node_metadata_base.hpp
+ * Contains an internal PB_DS_BASE_C_DEC for a patricia tree.
+ */
+
+#ifndef PB_DS_PAT_TRIE_NODE_METADATA_BASE_HPP
+#define PB_DS_PAT_TRIE_NODE_METADATA_BASE_HPP
+
+#include <ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Metadata, class Allocator>
+ struct pat_trie_node_metadata_base
+ {
+ public:
+ typedef Metadata metadata_type;
+
+ typedef
+ typename Allocator::template rebind<
+ metadata_type>::other::const_reference
+ const_metadata_reference;
+
+ public:
+ inline const_metadata_reference
+ get_metadata() const
+ {
+ return (m_metadata);
+ }
+
+ public:
+ metadata_type m_metadata;
+ };
+
+ template<typename Allocator>
+ struct pat_trie_node_metadata_base<
+ null_node_metadata,
+ Allocator>
+ {
+ public:
+ typedef null_node_metadata metadata_type;
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_PAT_TRIE_NODE_BASE_HPP
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp
new file mode 100644
index 0000000..f6f4209
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp
@@ -0,0 +1,515 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file pat_trie_.hpp
+ * Contains an implementation class for a patricia tree.
+ */
+
+/**
+ * This implementation loosely borrows ideas from:
+ * 1) "Fast Mergeable Integer Maps", Okasaki, Gill 1998
+ * 2) "Ptset: Sets of integers implemented as Patricia trees",
+ * Jean-Christophe Filliatr, 2000
+ **/
+
+#include <ext/pb_ds/detail/pat_trie_/synth_e_access_traits.hpp>
+#include <ext/pb_ds/detail/pat_trie_/node_base.hpp>
+#include <ext/pb_ds/exception.hpp>
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <ext/pb_ds/detail/eq_fn/eq_by_less.hpp>
+#include <ext/pb_ds/detail/types_traits.hpp>
+#include <ext/pb_ds/tree_policy.hpp>
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <iterator>
+#include <utility>
+#include <algorithm>
+#include <functional>
+#include <assert.h>
+#include <list>
+#ifdef _GLIBCXX_DEBUG
+#include <ext/pb_ds/detail/debug_map_base.hpp>
+#endif
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Mapped, typename Node_And_It_Traits, \
+ typename Allocator>
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_CLASS_NAME pat_trie_data_
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_CLASS_NAME pat_trie_no_data_
+#endif
+
+#define PB_DS_CLASS_C_DEC \
+ PB_DS_CLASS_NAME<Key, Mapped, Node_And_It_Traits, Allocator>
+
+#define PB_DS_TYPES_TRAITS_C_DEC \
+ types_traits<Key, Mapped, Allocator, false>
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_DEBUG_MAP_BASE_C_DEC \
+ debug_map_base<Key, eq_by_less<Key, \
+ std::less<Key> >, typename Allocator::template rebind<Key>::other::const_reference>
+#endif
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_V2F(X) (X).first
+#define PB_DS_V2S(X) (X).second
+#define PB_DS_EP2VP(X)& ((X)->m_value)
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_V2F(X) (X)
+#define PB_DS_V2S(X) Mapped_Data()
+#define PB_DS_EP2VP(X)& ((X)->m_value.first)
+#endif
+
+ /**
+ * class description = PATRICIA trie implementation.">
+ **/
+ template<typename Key,
+ typename Mapped,
+ typename Node_And_It_Traits,
+ typename Allocator>
+ class PB_DS_CLASS_NAME :
+#ifdef _GLIBCXX_DEBUG
+ public PB_DS_DEBUG_MAP_BASE_C_DEC,
+#endif
+ public Node_And_It_Traits::synth_e_access_traits,
+ public Node_And_It_Traits::node_update,
+ public PB_DS_TYPES_TRAITS_C_DEC
+ {
+ private:
+ typedef PB_DS_TYPES_TRAITS_C_DEC traits_base;
+
+ typedef typename Node_And_It_Traits::synth_e_access_traits synth_e_access_traits;
+ typedef typename Allocator::template rebind<synth_e_access_traits>::other::const_pointer const_e_access_traits_pointer;
+ typedef typename synth_e_access_traits::const_iterator const_e_iterator;
+
+ typedef typename Node_And_It_Traits::node node;
+ typedef typename Allocator::template rebind<node>::other::const_pointer const_node_pointer;
+
+ typedef typename Allocator::template rebind<node>::other::pointer node_pointer;
+
+ typedef typename Node_And_It_Traits::head head;
+ typedef typename Allocator::template rebind<head>::other head_allocator;
+ typedef typename head_allocator::pointer head_pointer;
+
+ typedef typename Node_And_It_Traits::leaf leaf;
+ typedef typename Allocator::template rebind<leaf>::other leaf_allocator;
+ typedef typename leaf_allocator::const_pointer const_leaf_pointer;
+ typedef typename leaf_allocator::pointer leaf_pointer;
+
+ typedef typename Node_And_It_Traits::internal_node internal_node;
+ typedef typename Allocator::template rebind<internal_node>::other internal_node_allocator;
+ typedef typename internal_node_allocator::const_pointer const_internal_node_pointer;
+ typedef typename internal_node_allocator::pointer internal_node_pointer;
+
+#include <ext/pb_ds/detail/pat_trie_/cond_dtor_entry_dealtor.hpp>
+
+#ifdef _GLIBCXX_DEBUG
+ typedef PB_DS_DEBUG_MAP_BASE_C_DEC debug_base;
+#endif
+
+#include <ext/pb_ds/detail/pat_trie_/split_join_branch_bag.hpp>
+
+ typedef typename Node_And_It_Traits::null_node_update_pointer null_node_update_pointer;
+
+ public:
+ typedef pat_trie_tag container_category;
+ typedef Allocator allocator_type;
+ typedef typename Allocator::size_type size_type;
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef typename traits_base::key_type key_type;
+ typedef typename traits_base::key_pointer key_pointer;
+ typedef typename traits_base::const_key_pointer const_key_pointer;
+ typedef typename traits_base::key_reference key_reference;
+ typedef typename traits_base::const_key_reference const_key_reference;
+ typedef typename traits_base::mapped_type mapped_type;
+ typedef typename traits_base::mapped_pointer mapped_pointer;
+ typedef typename traits_base::const_mapped_pointer const_mapped_pointer;
+ typedef typename traits_base::mapped_reference mapped_reference;
+ typedef typename traits_base::const_mapped_reference const_mapped_reference;
+ typedef typename traits_base::value_type value_type;
+ typedef typename traits_base::pointer pointer;
+ typedef typename traits_base::const_pointer const_pointer;
+ typedef typename traits_base::reference reference;
+ typedef typename traits_base::const_reference const_reference;
+
+ typedef typename Node_And_It_Traits::const_iterator const_point_iterator;
+ typedef typename Node_And_It_Traits::iterator point_iterator;
+ typedef const_point_iterator const_iterator;
+ typedef point_iterator iterator;
+
+ typedef typename Node_And_It_Traits::const_reverse_iterator const_reverse_iterator;
+ typedef typename Node_And_It_Traits::reverse_iterator reverse_iterator;
+ typedef typename Node_And_It_Traits::const_node_iterator const_node_iterator;
+ typedef typename Node_And_It_Traits::node_iterator node_iterator;
+ typedef typename Node_And_It_Traits::e_access_traits e_access_traits;
+ typedef typename Node_And_It_Traits::node_update node_update;
+
+ PB_DS_CLASS_NAME();
+
+ PB_DS_CLASS_NAME(const e_access_traits&);
+
+ PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC&);
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+
+ ~PB_DS_CLASS_NAME();
+
+ inline bool
+ empty() const;
+
+ inline size_type
+ size() const;
+
+ inline size_type
+ max_size() const;
+
+ e_access_traits&
+ get_e_access_traits();
+
+ const e_access_traits&
+ get_e_access_traits() const;
+
+ node_update&
+ get_node_update();
+
+ const node_update&
+ get_node_update() const;
+
+ inline std::pair<point_iterator, bool>
+ insert(const_reference);
+
+ inline mapped_reference
+ operator[](const_key_reference r_key)
+ {
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ return insert(std::make_pair(r_key, mapped_type())).first->second;
+#else
+ insert(r_key);
+ return traits_base::s_null_mapped;
+#endif
+ }
+
+ inline point_iterator
+ find(const_key_reference);
+
+ inline const_point_iterator
+ find(const_key_reference) const;
+
+ inline point_iterator
+ lower_bound(const_key_reference);
+
+ inline const_point_iterator
+ lower_bound(const_key_reference) const;
+
+ inline point_iterator
+ upper_bound(const_key_reference);
+
+ inline const_point_iterator
+ upper_bound(const_key_reference) const;
+
+ void
+ clear();
+
+ inline bool
+ erase(const_key_reference);
+
+ inline const_iterator
+ erase(const_iterator);
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ inline iterator
+ erase(iterator);
+#endif
+
+ inline const_reverse_iterator
+ erase(const_reverse_iterator);
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ inline reverse_iterator
+ erase(reverse_iterator);
+#endif
+
+ template<typename Pred>
+ inline size_type
+ erase_if(Pred);
+
+ void
+ join(PB_DS_CLASS_C_DEC&);
+
+ void
+ split(const_key_reference, PB_DS_CLASS_C_DEC&);
+
+ inline iterator
+ begin();
+
+ inline const_iterator
+ begin() const;
+
+ inline iterator
+ end();
+
+ inline const_iterator
+ end() const;
+
+ inline reverse_iterator
+ rbegin();
+
+ inline const_reverse_iterator
+ rbegin() const;
+
+ inline reverse_iterator
+ rend();
+
+ inline const_reverse_iterator
+ rend() const;
+
+ inline const_node_iterator
+ node_begin() const;
+
+ inline node_iterator
+ node_begin();
+
+ inline const_node_iterator
+ node_end() const;
+
+ inline node_iterator
+ node_end();
+
+#ifdef PB_DS_PAT_TRIE_TRACE_
+ void
+ trace() const;
+#endif
+
+ protected:
+
+ template<typename It>
+ void
+ copy_from_range(It, It);
+
+ void
+ value_swap(PB_DS_CLASS_C_DEC&);
+
+ node_pointer
+ recursive_copy_node(const_node_pointer);
+
+ private:
+
+ void
+ initialize();
+
+ inline void
+ apply_update(node_pointer, null_node_update_pointer);
+
+ template<typename Node_Update_>
+ inline void
+ apply_update(node_pointer, Node_Update_*);
+
+ bool
+ join_prep(PB_DS_CLASS_C_DEC&, split_join_branch_bag&);
+
+ void
+ rec_join_prep(const_node_pointer, const_node_pointer,
+ split_join_branch_bag&);
+
+ void
+ rec_join_prep(const_leaf_pointer, const_leaf_pointer,
+ split_join_branch_bag&);
+
+ void
+ rec_join_prep(const_leaf_pointer, const_internal_node_pointer,
+ split_join_branch_bag&);
+
+ void
+ rec_join_prep(const_internal_node_pointer, const_leaf_pointer,
+ split_join_branch_bag&);
+
+ void
+ rec_join_prep(const_internal_node_pointer, const_internal_node_pointer,
+ split_join_branch_bag&);
+
+ node_pointer
+ rec_join(node_pointer, node_pointer, size_type, split_join_branch_bag&);
+
+ node_pointer
+ rec_join(leaf_pointer, leaf_pointer, split_join_branch_bag&);
+
+ node_pointer
+ rec_join(leaf_pointer, internal_node_pointer, size_type,
+ split_join_branch_bag&);
+
+ node_pointer
+ rec_join(internal_node_pointer, leaf_pointer, size_type,
+ split_join_branch_bag&);
+
+ node_pointer
+ rec_join(internal_node_pointer, internal_node_pointer,
+ split_join_branch_bag&);
+
+ size_type
+ keys_diff_ind(typename e_access_traits::const_iterator, typename e_access_traits::const_iterator, typename e_access_traits::const_iterator, typename e_access_traits::const_iterator);
+
+ internal_node_pointer
+ insert_branch(node_pointer, node_pointer, split_join_branch_bag&);
+
+ void
+ update_min_max_for_inserted_leaf(leaf_pointer);
+
+ void
+ erase_leaf(leaf_pointer);
+
+ inline void
+ actual_erase_leaf(leaf_pointer);
+
+ void
+ clear_imp(node_pointer);
+
+ void
+ erase_fixup(internal_node_pointer);
+
+ void
+ update_min_max_for_erased_leaf(leaf_pointer);
+
+ static inline const_e_iterator
+ pref_begin(const_node_pointer);
+
+ static inline const_e_iterator
+ pref_end(const_node_pointer);
+
+ inline node_pointer
+ find_imp(const_key_reference);
+
+ inline node_pointer
+ lower_bound_imp(const_key_reference);
+
+ inline node_pointer
+ upper_bound_imp(const_key_reference);
+
+ inline static const_leaf_pointer
+ leftmost_descendant(const_node_pointer);
+
+ inline static leaf_pointer
+ leftmost_descendant(node_pointer);
+
+ inline static const_leaf_pointer
+ rightmost_descendant(const_node_pointer);
+
+ inline static leaf_pointer
+ rightmost_descendant(node_pointer);
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+
+ void
+ assert_iterators() const;
+
+ void
+ assert_reverse_iterators() const;
+
+ static size_type
+ recursive_count_leafs(const_node_pointer);
+#endif
+
+#ifdef PB_DS_PAT_TRIE_TRACE_
+ static void
+ trace_node(const_node_pointer, size_type);
+
+ template<typename Metadata_>
+ static void
+ trace_node_metadata(const_node_pointer, type_to_type<Metadata_>);
+
+ static void
+ trace_node_metadata(const_node_pointer, type_to_type<null_node_metadata>);
+#endif
+
+ leaf_pointer
+ split_prep(const_key_reference, PB_DS_CLASS_C_DEC&,
+ split_join_branch_bag&);
+
+ node_pointer
+ rec_split(node_pointer, const_e_iterator, const_e_iterator,
+ PB_DS_CLASS_C_DEC&, split_join_branch_bag&);
+
+ void
+ split_insert_branch(size_type, const_e_iterator,
+ typename internal_node::iterator,
+ size_type, split_join_branch_bag&);
+
+ static head_allocator s_head_allocator;
+ static internal_node_allocator s_internal_node_allocator;
+ static leaf_allocator s_leaf_allocator;
+
+ head_pointer m_p_head;
+ size_type m_size;
+ };
+
+#include <ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp>
+#include <ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp>
+#include <ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp>
+#include <ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp>
+#include <ext/pb_ds/detail/pat_trie_/policy_access_fn_imps.hpp>
+#include <ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp>
+#include <ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp>
+#include <ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_NAME
+#undef PB_DS_TYPES_TRAITS_C_DEC
+#undef PB_DS_DEBUG_MAP_BASE_C_DEC
+#undef PB_DS_V2F
+#undef PB_DS_EP2VP
+#undef PB_DS_V2S
+
+ } // namespace detail
+} // namespace __gnu_pbds
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/point_iterators.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/point_iterators.hpp
new file mode 100644
index 0000000..cada907
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/point_iterators.hpp
@@ -0,0 +1,484 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file point_iterators.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+#ifndef PB_DS_PAT_TRIE_FIND_ITERATORS_HPP
+#define PB_DS_PAT_TRIE_FIND_ITERATORS_HPP
+
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CONST_IT_C_DEC \
+ pat_trie_const_it_< \
+ Type_Traits, \
+ Node, \
+ Leaf, \
+ Head, \
+ Internal_Node, \
+ Is_Forward_Iterator, \
+ Allocator>
+
+#define PB_DS_CONST_ODIR_IT_C_DEC \
+ pat_trie_const_it_< \
+ Type_Traits, \
+ Node, \
+ Leaf, \
+ Head, \
+ Internal_Node, \
+ !Is_Forward_Iterator, \
+ Allocator>
+
+#define PB_DS_IT_C_DEC \
+ pat_trie_it_< \
+ Type_Traits, \
+ Node, \
+ Leaf, \
+ Head, \
+ Internal_Node, \
+ Is_Forward_Iterator, \
+ Allocator>
+
+#define PB_DS_ODIR_IT_C_DEC \
+ pat_trie_it_< \
+ Type_Traits, \
+ Node, \
+ Leaf, \
+ Head, \
+ Internal_Node, \
+ !Is_Forward_Iterator, \
+ Allocator>
+
+
+ // Const iterator.
+ template<typename Type_Traits,
+ class Node,
+ class Leaf,
+ class Head,
+ class Internal_Node,
+ bool Is_Forward_Iterator,
+ class Allocator>
+ class pat_trie_const_it_
+ {
+
+ private:
+ typedef
+ typename Allocator::template rebind<
+ Node>::other::pointer
+ node_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Leaf>::other::const_pointer
+ const_leaf_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Leaf>::other::pointer
+ leaf_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Head>::other::pointer
+ head_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Internal_Node>::other::pointer
+ internal_node_pointer;
+
+ public:
+
+ typedef std::bidirectional_iterator_tag iterator_category;
+
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef typename Type_Traits::value_type value_type;
+
+ typedef typename Type_Traits::pointer pointer;
+
+ typedef typename Type_Traits::const_pointer const_pointer;
+
+ typedef typename Type_Traits::reference reference;
+
+ typedef typename Type_Traits::const_reference const_reference;
+
+ public:
+
+ inline
+ pat_trie_const_it_(node_pointer p_nd = NULL) : m_p_nd(p_nd)
+ { }
+
+ inline
+ pat_trie_const_it_(const PB_DS_CONST_ODIR_IT_C_DEC& other)
+ : m_p_nd(other.m_p_nd)
+ { }
+
+ inline
+ PB_DS_CONST_IT_C_DEC&
+ operator=(const PB_DS_CONST_IT_C_DEC& other)
+ {
+ m_p_nd = other.m_p_nd;
+ return *this;
+ }
+
+ inline
+ PB_DS_CONST_IT_C_DEC&
+ operator=(const PB_DS_CONST_ODIR_IT_C_DEC& other)
+ {
+ m_p_nd = other.m_p_nd;
+ return *this;
+ }
+
+ inline const_pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd->m_type == pat_trie_leaf_node_type);
+ return &static_cast<leaf_pointer>(m_p_nd)->value();
+ }
+
+ inline const_reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd->m_type == pat_trie_leaf_node_type);
+ return static_cast<leaf_pointer>(m_p_nd)->value();
+ }
+
+ inline bool
+ operator==(const PB_DS_CONST_IT_C_DEC& other) const
+ { return (m_p_nd == other.m_p_nd); }
+
+ inline bool
+ operator==(const PB_DS_CONST_ODIR_IT_C_DEC& other) const
+ { return (m_p_nd == other.m_p_nd); }
+
+ inline bool
+ operator!=(const PB_DS_CONST_IT_C_DEC& other) const
+ { return (m_p_nd != other.m_p_nd); }
+
+ inline bool
+ operator!=(const PB_DS_CONST_ODIR_IT_C_DEC& other) const
+ { return (m_p_nd != other.m_p_nd); }
+
+ inline PB_DS_CONST_IT_C_DEC&
+ operator++()
+ {
+ inc(integral_constant<int,Is_Forward_Iterator>());
+ return *this;
+ }
+
+ inline PB_DS_CONST_IT_C_DEC
+ operator++(int)
+ {
+ PB_DS_CONST_IT_C_DEC ret_it(m_p_nd);
+ operator++();
+ return ret_it;
+ }
+
+ inline PB_DS_CONST_IT_C_DEC&
+ operator--()
+ {
+ dec(integral_constant<int,Is_Forward_Iterator>());
+ return *this;
+ }
+
+ inline PB_DS_CONST_IT_C_DEC
+ operator--(int)
+ {
+ PB_DS_CONST_IT_C_DEC ret_it(m_p_nd);
+ operator--();
+ return ret_it;
+ }
+
+ protected:
+ inline void
+ inc(false_type)
+ { dec(true_type()); }
+
+ void
+ inc(true_type)
+ {
+ if (m_p_nd->m_type == pat_trie_head_node_type)
+ {
+ m_p_nd = static_cast<head_pointer>(m_p_nd)->m_p_min;
+ return;
+ }
+
+ node_pointer p_y = m_p_nd->m_p_parent;
+ while (p_y->m_type != pat_trie_head_node_type &&
+ get_larger_sibling(m_p_nd) == NULL)
+ {
+ m_p_nd = p_y;
+ p_y = p_y->m_p_parent;
+ }
+
+ if (p_y->m_type == pat_trie_head_node_type)
+ {
+ m_p_nd = p_y;
+ return;
+ }
+ m_p_nd = leftmost_descendant(get_larger_sibling(m_p_nd));
+ }
+
+ inline void
+ dec(false_type)
+ { inc(true_type()); }
+
+ void
+ dec(true_type)
+ {
+ if (m_p_nd->m_type == pat_trie_head_node_type)
+ {
+ m_p_nd = static_cast<head_pointer>(m_p_nd)->m_p_max;
+ return;
+ }
+
+ node_pointer p_y = m_p_nd->m_p_parent;
+ while (p_y->m_type != pat_trie_head_node_type &&
+ get_smaller_sibling(m_p_nd) == NULL)
+ {
+ m_p_nd = p_y;
+ p_y = p_y->m_p_parent;
+ }
+
+ if (p_y->m_type == pat_trie_head_node_type)
+ {
+ m_p_nd = p_y;
+ return;
+ }
+ m_p_nd = rightmost_descendant(get_smaller_sibling(m_p_nd));
+ }
+
+ inline static node_pointer
+ get_larger_sibling(node_pointer p_nd)
+ {
+ internal_node_pointer p_parent =
+ static_cast<internal_node_pointer>(p_nd->m_p_parent);
+
+ typename Internal_Node::iterator it = p_parent->begin();
+ while (*it != p_nd)
+ ++it;
+
+ typename Internal_Node::iterator next_it = it;
+ ++next_it;
+ return ((next_it == p_parent->end())? NULL :* next_it);
+ }
+
+ inline static node_pointer
+ get_smaller_sibling(node_pointer p_nd)
+ {
+ internal_node_pointer p_parent =
+ static_cast<internal_node_pointer>(p_nd->m_p_parent);
+
+ typename Internal_Node::iterator it = p_parent->begin();
+
+ if (*it == p_nd)
+ return (NULL);
+ typename Internal_Node::iterator prev_it;
+ do
+ {
+ prev_it = it;
+ ++it;
+ if (*it == p_nd)
+ return (*prev_it);
+ }
+ while (true);
+
+ _GLIBCXX_DEBUG_ASSERT(false);
+ return (NULL);
+ }
+
+ inline static leaf_pointer
+ leftmost_descendant(node_pointer p_nd)
+ {
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ return static_cast<leaf_pointer>(p_nd);
+ return static_cast<internal_node_pointer>(p_nd)->leftmost_descendant();
+ }
+
+ inline static leaf_pointer
+ rightmost_descendant(node_pointer p_nd)
+ {
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ return static_cast<leaf_pointer>(p_nd);
+ return static_cast<internal_node_pointer>(p_nd)->rightmost_descendant();
+ }
+
+ public:
+ node_pointer m_p_nd;
+ };
+
+ // Iterator.
+ template<typename Type_Traits,
+ class Node,
+ class Leaf,
+ class Head,
+ class Internal_Node,
+ bool Is_Forward_Iterator,
+ class Allocator>
+ class pat_trie_it_ :
+ public PB_DS_CONST_IT_C_DEC
+
+ {
+ private:
+ typedef
+ typename Allocator::template rebind<
+ Node>::other::pointer
+ node_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Leaf>::other::const_pointer
+ const_leaf_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Leaf>::other::pointer
+ leaf_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Head>::other::pointer
+ head_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ Internal_Node>::other::pointer
+ internal_node_pointer;
+
+ public:
+ typedef typename Type_Traits::value_type value_type;
+
+ typedef typename Type_Traits::const_pointer const_pointer;
+
+ typedef typename Type_Traits::pointer pointer;
+
+ typedef typename Type_Traits::const_reference const_reference;
+
+ typedef typename Type_Traits::reference reference;
+
+ inline
+ pat_trie_it_(node_pointer p_nd = NULL) : PB_DS_CONST_IT_C_DEC((node_pointer)p_nd)
+ { }
+
+ inline
+ pat_trie_it_(const PB_DS_ODIR_IT_C_DEC& other) : PB_DS_CONST_IT_C_DEC(other.m_p_nd)
+ { }
+
+ inline
+ PB_DS_IT_C_DEC&
+ operator=(const PB_DS_IT_C_DEC& other)
+ {
+ base_it_type::m_p_nd = other.m_p_nd;
+ return *this;
+ }
+
+ inline
+ PB_DS_IT_C_DEC&
+ operator=(const PB_DS_ODIR_IT_C_DEC& other)
+ {
+ base_it_type::m_p_nd = other.m_p_nd;
+ return *this;
+ }
+
+ inline pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_it_type::m_p_nd->m_type == pat_trie_leaf_node_type);
+
+ return &static_cast<leaf_pointer>(base_it_type::m_p_nd)->value();
+ }
+
+ inline reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_it_type::m_p_nd->m_type == pat_trie_leaf_node_type);
+ return static_cast<leaf_pointer>(base_it_type::m_p_nd)->value();
+ }
+
+ inline PB_DS_IT_C_DEC&
+ operator++()
+ {
+ PB_DS_CONST_IT_C_DEC::
+ operator++();
+ return *this;
+ }
+
+ inline PB_DS_IT_C_DEC
+ operator++(int)
+ {
+ PB_DS_IT_C_DEC ret_it(base_it_type::m_p_nd);
+ operator++();
+ return ret_it;
+ }
+
+ inline PB_DS_IT_C_DEC&
+ operator--()
+ {
+ PB_DS_CONST_IT_C_DEC::operator--();
+ return *this;
+ }
+
+ inline PB_DS_IT_C_DEC
+ operator--(int)
+ {
+ PB_DS_IT_C_DEC ret_it(base_it_type::m_p_nd);
+ operator--();
+ return ret_it;
+ }
+
+ protected:
+ typedef PB_DS_CONST_IT_C_DEC base_it_type;
+
+ friend class PB_DS_CLASS_C_DEC;
+ };
+
+#undef PB_DS_CONST_IT_C_DEC
+#undef PB_DS_CONST_ODIR_IT_C_DEC
+#undef PB_DS_IT_C_DEC
+#undef PB_DS_ODIR_IT_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/policy_access_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/policy_access_fn_imps.hpp
new file mode 100644
index 0000000..79bfe42
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/policy_access_fn_imps.hpp
@@ -0,0 +1,63 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file policy_access_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::e_access_traits&
+PB_DS_CLASS_C_DEC::
+get_e_access_traits()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const typename PB_DS_CLASS_C_DEC::e_access_traits&
+PB_DS_CLASS_C_DEC::
+get_e_access_traits() const
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_update&
+PB_DS_CLASS_C_DEC::
+get_node_update()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const typename PB_DS_CLASS_C_DEC::node_update&
+PB_DS_CLASS_C_DEC::
+get_node_update() const
+{ return *this; }
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp
new file mode 100644
index 0000000..52edf25
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp
@@ -0,0 +1,103 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file r_erase_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+actual_erase_node(node_pointer p_z)
+{
+ _GLIBCXX_DEBUG_ASSERT(m_size > 0);
+ --m_size;
+ _GLIBCXX_DEBUG_ONLY(erase_existing(PB_DS_V2F(p_z->m_value)));
+ p_z->~node();
+ s_node_allocator.deallocate(p_z, 1);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+update_min_max_for_erased_node(node_pointer p_z)
+{
+ if (m_size == 1)
+ {
+ m_p_head->m_p_left = m_p_head->m_p_right = m_p_head;
+ return;
+ }
+
+ if (m_p_head->m_p_left == p_z)
+ {
+ iterator it(p_z);
+ ++it;
+ m_p_head->m_p_left = it.m_p_nd;
+ }
+ else if (m_p_head->m_p_right == p_z)
+ {
+ iterator it(p_z);
+ --it;
+ m_p_head->m_p_right = it.m_p_nd;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true, true);)
+ clear_imp(m_p_head->m_p_parent);
+ m_size = 0;
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(debug_base::clear();)
+ _GLIBCXX_DEBUG_ONLY(assert_valid(true, true);)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear_imp(node_pointer p_nd)
+{
+ if (p_nd == NULL)
+ return;
+ clear_imp(p_nd->m_p_left);
+ clear_imp(p_nd->m_p_right);
+ p_nd->~Node();
+ s_node_allocator.deallocate(p_nd, 1);
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp
new file mode 100644
index 0000000..c0809fa
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp
@@ -0,0 +1,150 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file rotate_fn_imps.hpp
+ * Contains imps for rotating nodes.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+rotate_left(node_pointer p_x)
+{
+ node_pointer p_y = p_x->m_p_right;
+ p_x->m_p_right = p_y->m_p_left;
+
+ if (p_y->m_p_left != NULL)
+ p_y->m_p_left->m_p_parent = p_x;
+
+ p_y->m_p_parent = p_x->m_p_parent;
+ if (p_x == m_p_head->m_p_parent)
+ m_p_head->m_p_parent = p_y;
+ else if (p_x == p_x->m_p_parent->m_p_left)
+ p_x->m_p_parent->m_p_left = p_y;
+ else
+ p_x->m_p_parent->m_p_right = p_y;
+
+ p_y->m_p_left = p_x;
+ p_x->m_p_parent = p_y;
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_x);)
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_y);)
+
+ apply_update(p_x, (Node_Update* )this);
+ apply_update(p_x->m_p_parent, (Node_Update* )this);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+rotate_right(node_pointer p_x)
+{
+ node_pointer p_y = p_x->m_p_left;
+ p_x->m_p_left = p_y->m_p_right;
+
+ if (p_y->m_p_right != NULL)
+ p_y->m_p_right->m_p_parent = p_x;
+
+ p_y->m_p_parent = p_x->m_p_parent;
+ if (p_x == m_p_head->m_p_parent)
+ m_p_head->m_p_parent = p_y;
+ else if (p_x == p_x->m_p_parent->m_p_right)
+ p_x->m_p_parent->m_p_right = p_y;
+ else
+ p_x->m_p_parent->m_p_left = p_y;
+
+ p_y->m_p_right = p_x;
+ p_x->m_p_parent = p_y;
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_x);)
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_y);)
+
+ apply_update(p_x, (Node_Update* )this);
+ apply_update(p_x->m_p_parent, (Node_Update* )this);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+rotate_parent(node_pointer p_nd)
+{
+ node_pointer p_parent = p_nd->m_p_parent;
+ if (p_nd == p_parent->m_p_left)
+ rotate_right(p_parent);
+ else
+ rotate_left(p_parent);
+ _GLIBCXX_DEBUG_ASSERT(p_parent->m_p_parent = p_nd);
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_left == p_parent || p_nd->m_p_right == p_parent);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+apply_update(node_pointer /*p_nd*/, __gnu_pbds::null_node_update* /*p_update*/)
+{ }
+
+PB_DS_CLASS_T_DEC
+template<typename Node_Update_>
+inline void
+PB_DS_CLASS_C_DEC::
+apply_update(node_pointer p_nd, Node_Update_* p_update)
+{
+ p_update->operator()(& PB_DS_V2F(p_nd->m_value),(p_nd->m_p_left == NULL) ?
+ NULL :
+ & PB_DS_V2F(p_nd->m_p_left->m_value),(p_nd->m_p_right == NULL) ?
+ NULL :
+ & PB_DS_V2F(p_nd->m_p_right->m_value));
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Node_Update_>
+inline void
+PB_DS_CLASS_C_DEC::
+update_to_top(node_pointer p_nd, Node_Update_* p_update)
+{
+ while (p_nd != m_p_head)
+ {
+ apply_update(p_nd, p_update);
+ p_nd = p_nd->m_p_parent;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+update_to_top(node_pointer /*p_nd*/, __gnu_pbds::null_node_update* /*p_update*/)
+{ }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp
new file mode 100644
index 0000000..9779a4b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp
@@ -0,0 +1,254 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_fn_imps.hpp
+ * Contains an implementation class for bin_search_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+split(const_key_reference r_key, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid(););
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(););
+ split_join_branch_bag bag;
+ leaf_pointer p_split_lf = split_prep(r_key, other, bag);
+ if (p_split_lf == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(bag.empty());
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(!bag.empty());
+ other.clear();
+ m_p_head->m_p_parent = rec_split(m_p_head->m_p_parent,
+ pref_begin(p_split_lf),
+ pref_end(p_split_lf),
+ other,
+ bag);
+
+ m_p_head->m_p_parent->m_p_parent = m_p_head;
+
+ other.m_p_head->m_p_max = m_p_head->m_p_max;
+ m_p_head->m_p_max = rightmost_descendant(m_p_head->m_p_parent);
+ other.m_p_head->m_p_min =
+ other.leftmost_descendant(other.m_p_head->m_p_parent);
+
+ other.m_size = std::distance(other.PB_DS_CLASS_C_DEC::begin(),
+ other.PB_DS_CLASS_C_DEC::end());
+ m_size -= other.m_size;
+ _GLIBCXX_DEBUG_ONLY(assert_valid(););
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(););
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::leaf_pointer
+PB_DS_CLASS_C_DEC::
+split_prep(const_key_reference r_key, PB_DS_CLASS_C_DEC& other, split_join_branch_bag& r_bag)
+{
+ _GLIBCXX_DEBUG_ASSERT(r_bag.empty());
+ if (m_size == 0)
+ {
+ other.clear();
+ _GLIBCXX_DEBUG_ONLY(assert_valid(););
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(););
+ return (NULL);
+ }
+
+ if (synth_e_access_traits::cmp_keys(r_key,
+ PB_DS_V2F(static_cast<const_leaf_pointer>(m_p_head->m_p_min)->value())))
+ {
+ other.clear();
+ value_swap(other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid(););
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(););
+ return (NULL);
+ }
+
+ if (!synth_e_access_traits::cmp_keys(r_key,
+ PB_DS_V2F(static_cast<const_leaf_pointer>(m_p_head->m_p_max)->value())))
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid(););
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid(););
+ return (NULL);
+ }
+
+ iterator it = lower_bound(r_key);
+
+ if (!synth_e_access_traits::equal_keys(PB_DS_V2F(*it), r_key))
+ --it;
+
+ node_pointer p_nd = it.m_p_nd;
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_type == pat_trie_leaf_node_type);
+ leaf_pointer p_ret_l = static_cast<leaf_pointer>(p_nd);
+ while (p_nd->m_type != pat_trie_head_node_type)
+ {
+ r_bag.add_branch();
+ p_nd = p_nd->m_p_parent;
+ }
+ _GLIBCXX_DEBUG_ONLY(debug_base::split(r_key,(synth_e_access_traits& )(*this), other);)
+
+ return (p_ret_l);
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+rec_split(node_pointer p_nd, const_e_iterator b_it, const_e_iterator e_it, PB_DS_CLASS_C_DEC& other, split_join_branch_bag& r_bag)
+{
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ {
+ _GLIBCXX_DEBUG_ASSERT(other.m_p_head->m_p_parent == NULL);
+ return (p_nd);
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_type == pat_trie_internal_node_type);
+ internal_node_pointer p_internal_nd = static_cast<internal_node_pointer>(p_nd);
+
+ node_pointer p_child_ret = rec_split(p_internal_nd->get_child_node(b_it, e_it, this), b_it, e_it, other, r_bag);
+
+ _GLIBCXX_DEBUG_ONLY(p_child_ret->assert_valid(this);)
+ p_internal_nd->replace_child(p_child_ret, b_it, e_it, this);
+ apply_update(p_internal_nd, (node_update* )this);
+
+ typename internal_node::iterator child_it =
+ p_internal_nd->get_child_it(b_it, e_it, this);
+
+ const size_type lhs_num_children =
+ std::distance(p_internal_nd->begin(), child_it) + 1;
+
+ _GLIBCXX_DEBUG_ASSERT(lhs_num_children > 0);
+
+ size_type rhs_num_children =
+ std::distance(p_internal_nd->begin(), p_internal_nd->end()) -
+ lhs_num_children;
+
+ if (rhs_num_children == 0)
+ {
+ apply_update(p_internal_nd, (node_update* )this);
+ return (p_internal_nd);
+ }
+
+ ++child_it;
+ other.split_insert_branch(p_internal_nd->get_e_ind(),
+ b_it, child_it, rhs_num_children, r_bag);
+
+ child_it = p_internal_nd->get_child_it(b_it, e_it, this);
+ ++child_it;
+ while (rhs_num_children != 0)
+ {
+ child_it = p_internal_nd->remove_child(child_it);
+ --rhs_num_children;
+ }
+
+ apply_update(p_internal_nd, (node_update* )this);
+ _GLIBCXX_DEBUG_ASSERT(std::distance(p_internal_nd->begin(),
+ p_internal_nd->end()) >= 1);
+
+ if (std::distance(p_internal_nd->begin(), p_internal_nd->end()) > 1)
+ {
+ p_internal_nd->update_prefixes(this);
+ _GLIBCXX_DEBUG_ONLY(p_internal_nd->assert_valid(this);)
+ apply_update(p_internal_nd, (node_update* )this);
+ return (p_internal_nd);
+ }
+
+ node_pointer p_ret =* p_internal_nd->begin();
+ p_internal_nd->~internal_node();
+ s_internal_node_allocator.deallocate(p_internal_nd, 1);
+ apply_update(p_ret, (node_update* )this);
+ return (p_ret);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+split_insert_branch(size_type e_ind, const_e_iterator b_it, typename internal_node::iterator child_b_it, size_type num_children, split_join_branch_bag& r_bag)
+{
+#ifdef _GLIBCXX_DEBUG
+ if (m_p_head->m_p_parent != NULL)
+ m_p_head->m_p_parent->assert_valid(this);
+#endif
+
+ const size_type total_num_children =((m_p_head->m_p_parent == NULL)? 0 : 1) + num_children;
+
+ if (total_num_children == 0)
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_parent == NULL);
+ return;
+ }
+
+ if (total_num_children == 1)
+ {
+ if (m_p_head->m_p_parent != NULL)
+ {
+ _GLIBCXX_DEBUG_ONLY(m_p_head->m_p_parent->assert_valid(this);)
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_parent == NULL);
+ m_p_head->m_p_parent =* child_b_it;
+ m_p_head->m_p_parent->m_p_parent = m_p_head;
+ apply_update(m_p_head->m_p_parent, (node_update* )this);
+ _GLIBCXX_DEBUG_ONLY(m_p_head->m_p_parent->assert_valid(this);)
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(total_num_children > 1);
+ internal_node_pointer p_new_root = r_bag.get_branch();
+ new (p_new_root) internal_node(e_ind, b_it);
+ size_type num_inserted = 0;
+ while (num_inserted++ < num_children)
+ {
+ _GLIBCXX_DEBUG_ONLY((*child_b_it)->assert_valid(this);)
+ p_new_root->add_child(*child_b_it, pref_begin(*child_b_it),
+ pref_end(*child_b_it), this);
+ ++child_b_it;
+ }
+
+ if (m_p_head->m_p_parent != NULL)
+ p_new_root->add_child(m_p_head->m_p_parent,
+ pref_begin(m_p_head->m_p_parent),
+ pref_end(m_p_head->m_p_parent), this);
+
+ m_p_head->m_p_parent = p_new_root;
+ p_new_root->m_p_parent = m_p_head;
+ apply_update(m_p_head->m_p_parent, (node_update* )this);
+ _GLIBCXX_DEBUG_ONLY(m_p_head->m_p_parent->assert_valid(this);)
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/split_join_branch_bag.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/split_join_branch_bag.hpp
new file mode 100644
index 0000000..9cecae5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/split_join_branch_bag.hpp
@@ -0,0 +1,93 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_join_branch_bag.hpp
+ * Contains an implementation class for pat_trie_.
+ */
+
+class split_join_branch_bag
+{
+private:
+ typedef
+ std::list<
+ internal_node_pointer,
+ typename Allocator::template rebind<
+ internal_node_pointer>::other>
+ bag_t;
+
+public:
+
+ void
+ add_branch()
+ {
+ internal_node_pointer p_nd = s_internal_node_allocator.allocate(1);
+ __try
+ {
+ m_bag.push_back(p_nd);
+ }
+ __catch(...)
+ {
+ s_internal_node_allocator.deallocate(p_nd, 1);
+ __throw_exception_again;
+ }
+ }
+
+ internal_node_pointer
+ get_branch()
+ {
+ _GLIBCXX_DEBUG_ASSERT(!m_bag.empty());
+ internal_node_pointer p_nd =* m_bag.begin();
+ m_bag.pop_front();
+ return p_nd;
+ }
+
+ ~split_join_branch_bag()
+ {
+ while (!m_bag.empty())
+ {
+ internal_node_pointer p_nd =* m_bag.begin();
+ s_internal_node_allocator.deallocate(p_nd, 1);
+ m_bag.pop_front();
+ }
+ }
+
+ inline bool
+ empty() const
+ { return m_bag.empty(); }
+
+private:
+ bag_t m_bag;
+};
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/synth_e_access_traits.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/synth_e_access_traits.hpp
new file mode 100644
index 0000000..abf5f11
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/synth_e_access_traits.hpp
@@ -0,0 +1,229 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file synth_e_access_traits.hpp
+ * Contains an implementation class for a patricia tree.
+ */
+
+#ifndef PB_DS_SYNTH_E_ACCESS_TRAITS_HPP
+#define PB_DS_SYNTH_E_ACCESS_TRAITS_HPP
+
+#include <ext/pb_ds/detail/type_utils.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC \
+ template<typename Type_Traits, bool Set, class E_Access_Traits>
+
+#define PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC \
+ synth_e_access_traits< \
+ Type_Traits, \
+ Set, \
+ E_Access_Traits>
+
+ template<typename Type_Traits, bool Set, class E_Access_Traits>
+ struct synth_e_access_traits : public E_Access_Traits
+ {
+
+ private:
+ typedef E_Access_Traits base_type;
+
+ typedef Type_Traits type_traits;
+
+ typedef typename type_traits::const_key_reference const_key_reference;
+
+ typedef typename type_traits::const_reference const_reference;
+
+ public:
+ synth_e_access_traits();
+
+ synth_e_access_traits(const E_Access_Traits& r_traits);
+
+ inline bool
+ equal_prefixes(typename base_type::const_iterator b_l, typename base_type::const_iterator e_l, typename base_type::const_iterator b_r, typename base_type::const_iterator e_r, bool compare_after = true) const;
+
+ bool
+ equal_keys(const_key_reference r_lhs_key, const_key_reference r_rhs_key) const;
+
+ bool
+ cmp_prefixes(typename base_type::const_iterator b_l, typename base_type::const_iterator e_l, typename base_type::const_iterator b_r, typename base_type::const_iterator e_r, bool compare_after = false) const;
+
+ bool
+ cmp_keys(const_key_reference r_lhs_key, const_key_reference r_rhs_key) const;
+
+ inline static const_key_reference
+ extract_key(const_reference r_val);
+
+#ifdef _GLIBCXX_DEBUG
+ bool
+ operator()(const_key_reference r_lhs, const_key_reference r_rhs);
+#endif
+
+ private:
+ inline static const_key_reference
+ extract_key(const_reference r_val, true_type);
+
+ inline static const_key_reference
+ extract_key(const_reference r_val, false_type);
+
+ private:
+ static integral_constant<int,Set> s_set_ind;
+ };
+
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ integral_constant<int,Set>
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::s_set_ind;
+
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::
+ synth_e_access_traits()
+ { }
+
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::
+ synth_e_access_traits(const E_Access_Traits& r_traits) :
+ E_Access_Traits(r_traits)
+ { }
+
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ inline bool
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::
+ equal_prefixes(typename base_type::const_iterator b_l, typename base_type::const_iterator e_l, typename base_type::const_iterator b_r, typename base_type::const_iterator e_r, bool compare_after /*= false */) const
+ {
+ while (b_l != e_l)
+ {
+ if (b_r == e_r)
+ return (false);
+ if (base_type::e_pos(*b_l) != base_type::e_pos(*b_r))
+ return (false);
+ ++b_l;
+ ++b_r;
+ }
+ return (!compare_after || b_r == e_r);
+ }
+
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ bool
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::
+ equal_keys(const_key_reference r_lhs_key, const_key_reference r_rhs_key) const
+ {
+ return (equal_prefixes(base_type::begin(r_lhs_key),
+ base_type::end(r_lhs_key),
+ base_type::begin(r_rhs_key),
+ base_type::end(r_rhs_key),
+ true));
+ }
+
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ bool
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::
+ cmp_prefixes(typename base_type::const_iterator b_l, typename base_type::const_iterator e_l, typename base_type::const_iterator b_r, typename base_type::const_iterator e_r, bool compare_after /* = false*/) const
+ {
+ while (b_l != e_l)
+ {
+ if (b_r == e_r)
+ return (false);
+ const typename base_type::size_type l_pos =
+ base_type::e_pos(*b_l);
+ const typename base_type::size_type r_pos =
+ base_type::e_pos(*b_r);
+ if (l_pos != r_pos)
+ return (l_pos < r_pos);
+ ++b_l;
+ ++b_r;
+ }
+
+ if (!compare_after)
+ return (false);
+ return (b_r != e_r);
+ }
+
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ bool
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::
+ cmp_keys(const_key_reference r_lhs_key, const_key_reference r_rhs_key) const
+ {
+ return (cmp_prefixes(base_type::begin(r_lhs_key),
+ base_type::end(r_lhs_key),
+ base_type::begin(r_rhs_key),
+ base_type::end(r_rhs_key),
+ true));
+ }
+
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ inline typename PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::const_key_reference
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::
+ extract_key(const_reference r_val)
+ {
+ return (extract_key(r_val, s_set_ind));
+ }
+
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ inline typename PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::const_key_reference
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::
+ extract_key(const_reference r_val, true_type)
+ {
+ return (r_val);
+ }
+
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ inline typename PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::const_key_reference
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::
+ extract_key(const_reference r_val, false_type)
+ {
+ return (r_val.first);
+ }
+
+#ifdef _GLIBCXX_DEBUG
+ PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+ bool
+ PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC::
+ operator()(const_key_reference r_lhs, const_key_reference r_rhs)
+ {
+ return (cmp_keys(r_lhs, r_rhs));
+ }
+#endif
+
+#undef PB_DS_SYNTH_E_ACCESS_TRAITS_T_DEC
+#undef PB_DS_SYNTH_E_ACCESS_TRAITS_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp
new file mode 100644
index 0000000..e4b2094
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp
@@ -0,0 +1,113 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trace_fn_imps.hpp
+ * Contains an implementation class for pat_trie_.
+ */
+
+#ifdef PB_DS_PAT_TRIE_TRACE_
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace() const
+{
+ std::cerr << std::endl;
+ if (m_p_head->m_p_parent == NULL)
+ return;
+ trace_node(m_p_head->m_p_parent, 0);
+ std::cerr << std::endl;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace_node(const_node_pointer p_nd, size_type level)
+{
+ for (size_type i = 0; i < level; ++i)
+ std::cerr << ' ';
+ std::cerr << p_nd << " ";
+ std::cerr << ((p_nd->m_type == pat_trie_leaf_node_type) ? "l " : "i ");
+
+ trace_node_metadata(p_nd, type_to_type<typename node::metadata_type>());
+ typename e_access_traits::const_iterator el_it = pref_begin(p_nd);
+ while (el_it != pref_end(p_nd))
+ {
+ std::cerr <<* el_it;
+ ++el_it;
+ }
+
+ if (p_nd->m_type == pat_trie_leaf_node_type)
+ {
+ std::cerr << std::endl;
+ return;
+ }
+
+ const_internal_node_pointer p_internal =
+ static_cast<const_internal_node_pointer>(p_nd);
+
+ std::cerr << " " <<
+ static_cast<unsigned long>(p_internal->get_e_ind()) << std::endl;
+
+ const size_type num_children = std::distance(p_internal->begin(),
+ p_internal->end());
+
+ for (size_type child_i = 0; child_i < num_children; ++child_i)
+ {
+ typename internal_node::const_iterator child_it =
+ p_internal->begin();
+ std::advance(child_it, num_children - child_i - 1);
+ trace_node(*child_it, level + 1);
+ }
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Metadata_>
+void
+PB_DS_CLASS_C_DEC::
+trace_node_metadata(const_node_pointer p_nd, type_to_type<Metadata_>)
+{
+ std::cerr << "(" << static_cast<unsigned long>(p_nd->get_metadata()) << ") ";
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace_node_metadata(const_node_pointer, type_to_type<null_node_metadata>)
+{ }
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/traits.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/traits.hpp
new file mode 100644
index 0000000..c8e7f58
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/traits.hpp
@@ -0,0 +1,350 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file traits.hpp
+ * Contains an implementation class for pat_trie_.
+ */
+
+#ifndef PB_DS_PAT_TRIE_NODE_AND_IT_TRAITS_HPP
+#define PB_DS_PAT_TRIE_NODE_AND_IT_TRAITS_HPP
+
+#include <ext/pb_ds/detail/pat_trie_/node_base.hpp>
+#include <ext/pb_ds/detail/pat_trie_/head.hpp>
+#include <ext/pb_ds/detail/pat_trie_/leaf.hpp>
+#include <ext/pb_ds/detail/pat_trie_/internal_node.hpp>
+#include <ext/pb_ds/detail/pat_trie_/point_iterators.hpp>
+#include <ext/pb_ds/detail/pat_trie_/node_iterators.hpp>
+#include <ext/pb_ds/detail/pat_trie_/synth_e_access_traits.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Key,
+ typename Mapped,
+ class E_Access_Traits,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn_,
+ class Allocator_>
+ class Node_Update,
+ class Allocator>
+ struct trie_traits<
+ Key,
+ Mapped,
+ E_Access_Traits,
+ Node_Update,
+ pat_trie_tag,
+ Allocator>
+ {
+ private:
+ typedef types_traits< Key, Mapped, Allocator, false> type_traits;
+
+ public:
+ typedef
+ typename trie_node_metadata_selector<
+ Key,
+ Mapped,
+ E_Access_Traits,
+ Node_Update,
+ Allocator>::type
+ metadata_type;
+
+ typedef E_Access_Traits e_access_traits;
+
+ typedef
+ __gnu_pbds::detail::synth_e_access_traits<
+ type_traits,
+ false,
+ e_access_traits>
+ synth_e_access_traits;
+
+ typedef
+ pat_trie_node_base<
+ type_traits,
+ synth_e_access_traits,
+ metadata_type,
+ Allocator>
+ node;
+
+ typedef
+ pat_trie_leaf<
+ type_traits,
+ synth_e_access_traits,
+ metadata_type,
+ Allocator>
+ leaf;
+
+ typedef
+ pat_trie_head<
+ type_traits,
+ synth_e_access_traits,
+ metadata_type,
+ Allocator>
+ head;
+
+ typedef
+ pat_trie_internal_node<
+ type_traits,
+ synth_e_access_traits,
+ metadata_type,
+ Allocator>
+ internal_node;
+
+ typedef
+ pat_trie_const_it_<
+ type_traits,
+ node,
+ leaf,
+ head,
+ internal_node,
+ true,
+ Allocator>
+ const_iterator;
+
+ typedef
+ pat_trie_it_<
+ type_traits,
+ node,
+ leaf,
+ head,
+ internal_node,
+ true,
+ Allocator>
+ iterator;
+
+ typedef
+ pat_trie_const_it_<
+ type_traits,
+ node,
+ leaf,
+ head,
+ internal_node,
+ false,
+ Allocator>
+ const_reverse_iterator;
+
+ typedef
+ pat_trie_it_<
+ type_traits,
+ node,
+ leaf,
+ head,
+ internal_node,
+ false,
+ Allocator>
+ reverse_iterator;
+
+ typedef
+ pat_trie_const_node_it_<
+ node,
+ leaf,
+ head,
+ internal_node,
+ const_iterator,
+ iterator,
+ synth_e_access_traits,
+ Allocator>
+ const_node_iterator;
+
+ typedef
+ pat_trie_node_it_<
+ node,
+ leaf,
+ head,
+ internal_node,
+ const_iterator,
+ iterator,
+ synth_e_access_traits,
+ Allocator>
+ node_iterator;
+
+ typedef
+ Node_Update<
+ const_node_iterator,
+ node_iterator,
+ E_Access_Traits,
+ Allocator>
+ node_update;
+
+ typedef
+ __gnu_pbds::null_trie_node_update<
+ const_node_iterator,
+ node_iterator,
+ E_Access_Traits,
+ Allocator>*
+ null_node_update_pointer;
+ };
+
+ template<typename Key,
+ class E_Access_Traits,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn_,
+ class Allocator_>
+ class Node_Update,
+ class Allocator>
+ struct trie_traits<
+ Key,
+ null_mapped_type,
+ E_Access_Traits,
+ Node_Update,
+ pat_trie_tag,
+ Allocator>
+ {
+ private:
+ typedef
+ types_traits<
+ Key,
+ null_mapped_type,
+ Allocator,
+ false>
+ type_traits;
+
+ public:
+ typedef
+ typename trie_node_metadata_selector<
+ Key,
+ null_mapped_type,
+ E_Access_Traits,
+ Node_Update,
+ Allocator>::type
+ metadata_type;
+
+ typedef E_Access_Traits e_access_traits;
+
+ typedef
+ __gnu_pbds::detail::synth_e_access_traits<
+ type_traits,
+ true,
+ e_access_traits>
+ synth_e_access_traits;
+
+ typedef
+ pat_trie_node_base<
+ type_traits,
+ synth_e_access_traits,
+ metadata_type,
+ Allocator>
+ node;
+
+ typedef
+ pat_trie_leaf<
+ type_traits,
+ synth_e_access_traits,
+ metadata_type,
+ Allocator>
+ leaf;
+
+ typedef
+ pat_trie_head<
+ type_traits,
+ synth_e_access_traits,
+ metadata_type,
+ Allocator>
+ head;
+
+ typedef
+ pat_trie_internal_node<
+ type_traits,
+ synth_e_access_traits,
+ metadata_type,
+ Allocator>
+ internal_node;
+
+ typedef
+ pat_trie_const_it_<
+ type_traits,
+ node,
+ leaf,
+ head,
+ internal_node,
+ true,
+ Allocator>
+ const_iterator;
+
+ typedef const_iterator iterator;
+
+ typedef
+ pat_trie_const_it_<
+ type_traits,
+ node,
+ leaf,
+ head,
+ internal_node,
+ false,
+ Allocator>
+ const_reverse_iterator;
+
+ typedef const_reverse_iterator reverse_iterator;
+
+ typedef
+ pat_trie_const_node_it_<
+ node,
+ leaf,
+ head,
+ internal_node,
+ const_iterator,
+ iterator,
+ synth_e_access_traits,
+ Allocator>
+ const_node_iterator;
+
+ typedef const_node_iterator node_iterator;
+
+ typedef
+ Node_Update<
+ const_node_iterator,
+ node_iterator,
+ E_Access_Traits,
+ Allocator>
+ node_update;
+
+ typedef
+ __gnu_pbds::null_trie_node_update<
+ const_node_iterator,
+ const_node_iterator,
+ E_Access_Traits,
+ Allocator>*
+ null_node_update_pointer;
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_PAT_TRIE_NODE_AND_IT_TRAITS_HPP
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp
new file mode 100644
index 0000000..6d275e7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file update_fn_imps.hpp
+ * Contains an implementation class for pat_trie_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+apply_update(node_pointer /*p_nd*/, null_node_update_pointer)
+{ }
+
+PB_DS_CLASS_T_DEC
+template<typename Node_Update_>
+inline void
+PB_DS_CLASS_C_DEC::
+apply_update(node_pointer p_nd, Node_Update_* /*p_update*/)
+{
+ Node_Update_::operator()(node_iterator(p_nd, this),
+ const_node_iterator(NULL, this));
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/priority_queue_base_dispatch.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/priority_queue_base_dispatch.hpp
new file mode 100644
index 0000000..ad05c4f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/priority_queue_base_dispatch.hpp
@@ -0,0 +1,91 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file priority_queue_base_dispatch.hpp
+ * Contains an pqiative container dispatching base.
+ */
+
+#ifndef PB_DS_PRIORITY_QUEUE_BASE_DS_DISPATCHER_HPP
+#define PB_DS_PRIORITY_QUEUE_BASE_DS_DISPATCHER_HPP
+
+#include <ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp>
+#include <ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp>
+#include <ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp>
+#include <ext/pb_ds/detail/binary_heap_/binary_heap_.hpp>
+#include <ext/pb_ds/detail/thin_heap_/thin_heap_.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Value_Type, typename Cmp_Fn, typename Tag, typename Allocator>
+ struct priority_queue_base_dispatch;
+
+ template<typename Value_Type, typename Cmp_Fn, typename Allocator>
+ struct priority_queue_base_dispatch<Value_Type, Cmp_Fn, pairing_heap_tag, Allocator>
+ {
+ typedef pairing_heap_< Value_Type, Cmp_Fn, Allocator> type;
+ };
+
+ template<typename Value_Type, typename Cmp_Fn, typename Allocator>
+ struct priority_queue_base_dispatch<Value_Type, Cmp_Fn, binomial_heap_tag, Allocator>
+ {
+ typedef binomial_heap_< Value_Type, Cmp_Fn, Allocator> type;
+ };
+
+ template<typename Value_Type, typename Cmp_Fn, typename Allocator>
+ struct priority_queue_base_dispatch<Value_Type, Cmp_Fn, rc_binomial_heap_tag, Allocator>
+ {
+ typedef rc_binomial_heap_< Value_Type, Cmp_Fn, Allocator> type;
+ };
+
+ template<typename Value_Type, typename Cmp_Fn, typename Allocator>
+ struct priority_queue_base_dispatch<Value_Type, Cmp_Fn, binary_heap_tag, Allocator>
+ {
+ typedef binary_heap_< Value_Type, Cmp_Fn, Allocator> type;
+ };
+
+ template<typename Value_Type, typename Cmp_Fn, typename Allocator>
+ struct priority_queue_base_dispatch<Value_Type, Cmp_Fn, thin_heap_tag, Allocator>
+ {
+ typedef thin_heap_< Value_Type, Cmp_Fn, Allocator> type;
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_PRIORITY_QUEUE_BASE_DS_DISPATCHER_HPP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/constructors_destructor_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..1abfe21
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,100 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation for rb_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+ while (first_it != last_it)
+ insert(*(first_it++));
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME()
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn) :
+ base_type(r_cmp_fn)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn, const node_update& r_node_update) :
+ base_type(r_cmp_fn, r_node_update)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) :
+ base_type(other)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ base_type::swap(other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+initialize()
+{ base_type::m_p_head->m_red = true; }
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp
new file mode 100644
index 0000000..18ecc42
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp
@@ -0,0 +1,78 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation for rb_tree_.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+assert_node_consistent(const node_pointer p_nd) const
+{
+ if (p_nd == NULL)
+ return 1;
+
+ const size_type l_height = assert_node_consistent(p_nd->m_p_left);
+ const size_type r_height = assert_node_consistent(p_nd->m_p_right);
+ if (p_nd->m_red)
+ {
+ _GLIBCXX_DEBUG_ASSERT(is_effectively_black(p_nd->m_p_left));
+ _GLIBCXX_DEBUG_ASSERT(is_effectively_black(p_nd->m_p_right));
+ }
+ _GLIBCXX_DEBUG_ASSERT(l_height == r_height);
+ return (p_nd->m_red ? 0 : 1) + l_height;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ base_type::assert_valid();
+ const node_pointer p_head = base_type::m_p_head;
+ _GLIBCXX_DEBUG_ASSERT(p_head->m_red);
+ if (p_head->m_p_parent != NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(!p_head->m_p_parent->m_red);
+ assert_node_consistent(p_head->m_p_parent);
+ }
+}
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp
new file mode 100644
index 0000000..685b8a5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp
@@ -0,0 +1,289 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation for rb_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+erase(const_key_reference r_key)
+{
+ point_iterator it = find(r_key);
+ if (it == base_type::end())
+ return false;
+ erase(it);
+ return true;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+erase(iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ if (it == base_type::end())
+ return it;
+
+ iterator ret_it = it;
+ ++ret_it;
+ erase_node(it.m_p_nd);
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ return ret_it;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::reverse_iterator
+PB_DS_CLASS_C_DEC::
+erase(reverse_iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ if (it.m_p_nd == base_type::m_p_head)
+ return it;
+
+ reverse_iterator ret_it = it;
+ ++ret_it;
+ erase_node(it.m_p_nd);
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ return ret_it;
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ size_type num_ersd = 0;
+ iterator it = base_type::begin();
+ while (it != base_type::end())
+ {
+ if (pred(*it))
+ {
+ ++num_ersd;
+ it = erase(it);
+ }
+ else
+ ++it;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return num_ersd;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase_node(node_pointer p_nd)
+{
+ remove_node(p_nd);
+ base_type::actual_erase_node(p_nd);
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+remove_node(node_pointer p_z)
+{
+ update_min_max_for_erased_node(p_z);
+ node_pointer p_y = p_z;
+ node_pointer p_x = NULL;
+ node_pointer p_new_x_parent = NULL;
+
+ if (p_y->m_p_left == NULL)
+ p_x = p_y->m_p_right;
+ else if (p_y->m_p_right == NULL)
+ p_x = p_y->m_p_left;
+ else
+ {
+ p_y = p_y->m_p_right;
+ while (p_y->m_p_left != NULL)
+ p_y = p_y->m_p_left;
+ p_x = p_y->m_p_right;
+ }
+
+ if (p_y == p_z)
+ {
+ p_new_x_parent = p_y->m_p_parent;
+ if (p_x != NULL)
+ p_x->m_p_parent = p_y->m_p_parent;
+
+ if (base_type::m_p_head->m_p_parent == p_z)
+ base_type::m_p_head->m_p_parent = p_x;
+ else if (p_z->m_p_parent->m_p_left == p_z)
+ {
+ p_y->m_p_left = p_z->m_p_parent;
+ p_z->m_p_parent->m_p_left = p_x;
+ }
+ else
+ {
+ p_y->m_p_left = NULL;
+ p_z->m_p_parent->m_p_right = p_x;
+ }
+ }
+ else
+ {
+ p_z->m_p_left->m_p_parent = p_y;
+ p_y->m_p_left = p_z->m_p_left;
+ if (p_y != p_z->m_p_right)
+ {
+ p_new_x_parent = p_y->m_p_parent;
+ if (p_x != NULL)
+ p_x->m_p_parent = p_y->m_p_parent;
+ p_y->m_p_parent->m_p_left = p_x;
+ p_y->m_p_right = p_z->m_p_right;
+ p_z->m_p_right->m_p_parent = p_y;
+ }
+ else
+ p_new_x_parent = p_y;
+
+ if (base_type::m_p_head->m_p_parent == p_z)
+ base_type::m_p_head->m_p_parent = p_y;
+ else if (p_z->m_p_parent->m_p_left == p_z)
+ p_z->m_p_parent->m_p_left = p_y;
+ else
+ p_z->m_p_parent->m_p_right = p_y;
+
+ p_y->m_p_parent = p_z->m_p_parent;
+ std::swap(p_y->m_red, p_z->m_red);
+ p_y = p_z;
+ }
+
+ update_to_top(p_new_x_parent, (node_update* )this);
+
+ if (p_y->m_red)
+ return;
+
+ remove_fixup(p_x, p_new_x_parent);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+remove_fixup(node_pointer p_x, node_pointer p_new_x_parent)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_x == NULL || p_x->m_p_parent == p_new_x_parent);
+
+ while (p_x != base_type::m_p_head->m_p_parent && is_effectively_black(p_x))
+ if (p_x == p_new_x_parent->m_p_left)
+ {
+ node_pointer p_w = p_new_x_parent->m_p_right;
+ if (p_w->m_red)
+ {
+ p_w->m_red = false;
+ p_new_x_parent->m_red = true;
+ base_type::rotate_left(p_new_x_parent);
+ p_w = p_new_x_parent->m_p_right;
+ }
+
+ if (is_effectively_black(p_w->m_p_left)
+ && is_effectively_black(p_w->m_p_right))
+ {
+ p_w->m_red = true;
+ p_x = p_new_x_parent;
+ p_new_x_parent = p_new_x_parent->m_p_parent;
+ }
+ else
+ {
+ if (is_effectively_black(p_w->m_p_right))
+ {
+ if (p_w->m_p_left != NULL)
+ p_w->m_p_left->m_red = false;
+
+ p_w->m_red = true;
+ base_type::rotate_right(p_w);
+ p_w = p_new_x_parent->m_p_right;
+ }
+
+ p_w->m_red = p_new_x_parent->m_red;
+ p_new_x_parent->m_red = false;
+
+ if (p_w->m_p_right != NULL)
+ p_w->m_p_right->m_red = false;
+
+ base_type::rotate_left(p_new_x_parent);
+ update_to_top(p_new_x_parent, (node_update* )this);
+ break;
+ }
+ }
+ else
+ {
+ node_pointer p_w = p_new_x_parent->m_p_left;
+ if (p_w->m_red == true)
+ {
+ p_w->m_red = false;
+ p_new_x_parent->m_red = true;
+ base_type::rotate_right(p_new_x_parent);
+ p_w = p_new_x_parent->m_p_left;
+ }
+
+ if (is_effectively_black(p_w->m_p_right)
+ && is_effectively_black(p_w->m_p_left))
+ {
+ p_w->m_red = true;
+ p_x = p_new_x_parent;
+ p_new_x_parent = p_new_x_parent->m_p_parent;
+ }
+ else
+ {
+ if (is_effectively_black(p_w->m_p_left))
+ {
+ if (p_w->m_p_right != NULL)
+ p_w->m_p_right->m_red = false;
+
+ p_w->m_red = true;
+ base_type::rotate_left(p_w);
+ p_w = p_new_x_parent->m_p_left;
+ }
+
+ p_w->m_red = p_new_x_parent->m_red;
+ p_new_x_parent->m_red = false;
+
+ if (p_w->m_p_left != NULL)
+ p_w->m_p_left->m_red = false;
+
+ base_type::rotate_right(p_new_x_parent);
+ update_to_top(p_new_x_parent, (node_update* )this);
+ break;
+ }
+ }
+
+ if (p_x != NULL)
+ p_x->m_red = false;
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/find_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/find_fn_imps.hpp
new file mode 100644
index 0000000..9378e15
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/find_fn_imps.hpp
@@ -0,0 +1,39 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains an implementation for rb_tree_.
+ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp
new file mode 100644
index 0000000..6b43b1a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp
@@ -0,0 +1,46 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file info_fn_imps.hpp
+ * Contains an implementation for rb_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+is_effectively_black(const node_pointer p_nd)
+{ return (p_nd == NULL || !p_nd->m_red); }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp
new file mode 100644
index 0000000..16a5d1e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp
@@ -0,0 +1,115 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains an implementation for rb_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline std::pair<typename PB_DS_CLASS_C_DEC::point_iterator, bool>
+PB_DS_CLASS_C_DEC::
+insert(const_reference r_value)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ std::pair<point_iterator, bool> ins_pair = base_type::insert_leaf(r_value);
+ if (ins_pair.second == true)
+ {
+ ins_pair.first.m_p_nd->m_red = true;
+ _GLIBCXX_DEBUG_ONLY(this->structure_only_assert_valid();)
+ insert_fixup(ins_pair.first.m_p_nd);
+ }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return ins_pair;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+insert_fixup(node_pointer p_nd)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_red == true);
+ while (p_nd != base_type::m_p_head->m_p_parent && p_nd->m_p_parent->m_red)
+ {
+ if (p_nd->m_p_parent == p_nd->m_p_parent->m_p_parent->m_p_left)
+ {
+ node_pointer p_y = p_nd->m_p_parent->m_p_parent->m_p_right;
+ if (p_y != NULL && p_y->m_red)
+ {
+ p_nd->m_p_parent->m_red = false;
+ p_y->m_red = false;
+ p_nd->m_p_parent->m_p_parent->m_red = true;
+ p_nd = p_nd->m_p_parent->m_p_parent;
+ }
+ else
+ {
+ if (p_nd == p_nd->m_p_parent->m_p_right)
+ {
+ p_nd = p_nd->m_p_parent;
+ base_type::rotate_left(p_nd);
+ }
+ p_nd->m_p_parent->m_red = false;
+ p_nd->m_p_parent->m_p_parent->m_red = true;
+ base_type::rotate_right(p_nd->m_p_parent->m_p_parent);
+ }
+ }
+ else
+ {
+ node_pointer p_y = p_nd->m_p_parent->m_p_parent->m_p_left;
+ if (p_y != NULL && p_y->m_red)
+ {
+ p_nd->m_p_parent->m_red = false;
+ p_y->m_red = false;
+ p_nd->m_p_parent->m_p_parent->m_red = true;
+ p_nd = p_nd->m_p_parent->m_p_parent;
+ }
+ else
+ {
+ if (p_nd == p_nd->m_p_parent->m_p_left)
+ {
+ p_nd = p_nd->m_p_parent;
+ base_type::rotate_right(p_nd);
+ }
+ p_nd->m_p_parent->m_red = false;
+ p_nd->m_p_parent->m_p_parent->m_red = true;
+ base_type::rotate_left(p_nd->m_p_parent->m_p_parent);
+ }
+ }
+ }
+
+ base_type::update_to_top(p_nd, (node_update* )this);
+ base_type::m_p_head->m_p_parent->m_red = false;
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/node.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/node.hpp
new file mode 100644
index 0000000..3f24c76
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/node.hpp
@@ -0,0 +1,138 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file node.hpp
+ * Contains an implementation for rb_tree_.
+ */
+
+#ifndef PB_DS_RB_TREE_NODE_HPP
+#define PB_DS_RB_TREE_NODE_HPP
+
+#include <ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Value_Type, class Metadata, class Allocator>
+ struct rb_tree_node_
+ {
+ public:
+ typedef Value_Type value_type;
+ typedef Metadata metadata_type;
+
+ typedef
+ typename Allocator::template rebind<
+ rb_tree_node_<
+ Value_Type,
+ Metadata,
+ Allocator> >::other::pointer
+ node_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ metadata_type>::other::reference
+ metadata_reference;
+
+ typedef
+ typename Allocator::template rebind<
+ metadata_type>::other::const_reference
+ const_metadata_reference;
+
+ inline bool
+ special() const
+ { return m_red; }
+
+ inline const_metadata_reference
+ get_metadata() const
+ { return m_metadata; }
+
+ inline metadata_reference
+ get_metadata()
+ { return m_metadata; }
+
+#ifdef PB_DS_BIN_SEARCH_TREE_TRACE_
+ void
+ trace() const
+ {
+ std::cout << PB_DS_V2F(m_value) <<(m_red? " <r> " : " <b> ")
+ << "(" << m_metadata << ")";
+ }
+#endif
+
+ node_pointer m_p_left;
+ node_pointer m_p_right;
+ node_pointer m_p_parent;
+ value_type m_value;
+ bool m_red;
+ metadata_type m_metadata;
+ };
+
+ template<typename Value_Type, class Allocator>
+ struct rb_tree_node_<Value_Type, null_node_metadata, Allocator>
+ {
+ public:
+ typedef Value_Type value_type;
+ typedef null_node_metadata metadata_type;
+
+ typedef
+ typename Allocator::template rebind<
+ rb_tree_node_<
+ Value_Type,
+ null_node_metadata,
+ Allocator> >::other::pointer
+ node_pointer;
+
+ inline bool
+ special() const
+ { return m_red; }
+
+#ifdef PB_DS_BIN_SEARCH_TREE_TRACE_
+ void
+ trace() const
+ { std::cout << PB_DS_V2F(m_value) <<(m_red? " <r> " : " <b> "); }
+#endif
+
+ node_pointer m_p_left;
+ node_pointer m_p_right;
+ node_pointer m_p_parent;
+ value_type m_value;
+ bool m_red;
+ };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp
new file mode 100644
index 0000000..9010def
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp
@@ -0,0 +1,280 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file rb_tree_.hpp
+ * Contains an implementation for rb_tree_.
+ */
+/*
+ * This implementation uses an idea from the SGI STL (using a "header" node
+ * which is needed for efficient iteration).
+ */
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#ifndef PB_DS_BIN_SEARCH_TREE_HPP__DATA_TRUE_INDICATOR
+#define PB_DS_BIN_SEARCH_TREE_HPP__DATA_TRUE_INDICATOR
+#include <ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp>
+#endif
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#ifndef PB_DS_BIN_SEARCH_TREE_HPP__DATA_FALSE_INDICATOR
+#define PB_DS_BIN_SEARCH_TREE_HPP__DATA_FALSE_INDICATOR
+#include <ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp>
+#endif
+#endif
+
+#include <ext/pb_ds/detail/standard_policies.hpp>
+#include <ext/pb_ds/detail/basic_types.hpp>
+#include <utility>
+#include <vector>
+#include <assert.h>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Mapped, typename Cmp_Fn, \
+ typename Node_And_It_Traits, typename Allocator>
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_CLASS_NAME rb_tree_data_
+#endif
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_BASE_CLASS_NAME bin_search_tree_data_
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_CLASS_NAME rb_tree_no_data_
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_BASE_CLASS_NAME bin_search_tree_no_data_
+#endif
+
+#define PB_DS_CLASS_C_DEC \
+ PB_DS_CLASS_NAME<Key, Mapped, Cmp_Fn, Node_And_It_Traits, Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ PB_DS_BASE_CLASS_NAME<Key, Mapped, Cmp_Fn, Node_And_It_Traits, Allocator>
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_V2F(X) (X).first
+#define PB_DS_V2S(X) (X).second
+#define PB_DS_EP2VP(X)& ((X)->m_value)
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_V2F(X) (X)
+#define PB_DS_V2S(X) Mapped_Data()
+#define PB_DS_EP2VP(X)& ((X)->m_value.first)
+#endif
+
+ template<typename Key,
+ typename Mapped,
+ typename Cmp_Fn,
+ typename Node_And_It_Traits,
+ typename Allocator>
+ class PB_DS_CLASS_NAME : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+ typedef typename base_type::node_pointer node_pointer;
+
+ public:
+ typedef Cmp_Fn cmp_fn;
+ typedef Allocator allocator_type;
+ typedef typename Allocator::size_type size_type;
+ typedef typename Allocator::difference_type difference_type;
+ typedef typename base_type::key_type key_type;
+ typedef typename base_type::key_pointer key_pointer;
+ typedef typename base_type::const_key_pointer const_key_pointer;
+ typedef typename base_type::key_reference key_reference;
+ typedef typename base_type::const_key_reference const_key_reference;
+ typedef typename base_type::mapped_type mapped_type;
+ typedef typename base_type::mapped_pointer mapped_pointer;
+ typedef typename base_type::const_mapped_pointer const_mapped_pointer;
+ typedef typename base_type::mapped_reference mapped_reference;
+ typedef typename base_type::const_mapped_reference const_mapped_reference;
+ typedef typename base_type::value_type value_type;
+ typedef typename base_type::pointer pointer;
+ typedef typename base_type::const_pointer const_pointer;
+ typedef typename base_type::reference reference;
+ typedef typename base_type::const_reference const_reference;
+ typedef typename base_type::point_iterator point_iterator;
+ typedef typename base_type::const_iterator const_point_iterator;
+ typedef typename base_type::iterator iterator;
+ typedef typename base_type::const_iterator const_iterator;
+ typedef typename base_type::reverse_iterator reverse_iterator;
+ typedef typename base_type::const_reverse_iterator const_reverse_iterator;
+ typedef typename base_type::node_update node_update;
+
+
+ PB_DS_CLASS_NAME();
+
+ PB_DS_CLASS_NAME(const Cmp_Fn&);
+
+ PB_DS_CLASS_NAME(const Cmp_Fn&, const node_update&);
+
+ PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC&);
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+
+ template<typename It>
+ void
+ copy_from_range(It, It);
+
+ inline std::pair<point_iterator, bool>
+ insert(const_reference);
+
+ inline mapped_reference
+ operator[](const_key_reference r_key)
+ {
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ std::pair<point_iterator, bool> ins_pair =
+ base_type::insert_leaf(value_type(r_key, mapped_type()));
+
+ if (ins_pair.second == true)
+ {
+ ins_pair.first.m_p_nd->m_red = true;
+ _GLIBCXX_DEBUG_ONLY(this->structure_only_assert_valid();)
+ insert_fixup(ins_pair.first.m_p_nd);
+ }
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return ins_pair.first.m_p_nd->m_value.second;
+#else
+ insert(r_key);
+ return base_type::s_null_mapped;
+#endif
+ }
+
+ inline bool
+ erase(const_key_reference);
+
+ inline iterator
+ erase(iterator);
+
+ inline reverse_iterator
+ erase(reverse_iterator);
+
+ template<typename Pred>
+ inline size_type
+ erase_if(Pred);
+
+ void
+ join(PB_DS_CLASS_C_DEC&);
+
+ void
+ split(const_key_reference, PB_DS_CLASS_C_DEC&);
+
+ protected:
+
+ private:
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+
+ size_type
+ assert_node_consistent(const node_pointer) const;
+#endif
+
+ inline static bool
+ is_effectively_black(const node_pointer);
+
+ void
+ initialize();
+
+ void
+ insert_fixup(node_pointer);
+
+ void
+ erase_node(node_pointer);
+
+ void
+ remove_node(node_pointer);
+
+ void
+ remove_fixup(node_pointer, node_pointer);
+
+ void
+ split_imp(node_pointer, PB_DS_CLASS_C_DEC&);
+
+ inline node_pointer
+ split_min();
+
+ std::pair<node_pointer, node_pointer>
+ split_min_imp();
+
+ void
+ join_imp(node_pointer, node_pointer);
+
+ std::pair<node_pointer, node_pointer>
+ find_join_pos_right(node_pointer, size_type, size_type);
+
+ std::pair<node_pointer, node_pointer>
+ find_join_pos_left(node_pointer, size_type, size_type);
+
+ inline size_type
+ black_height(node_pointer);
+
+ void
+ split_at_node(node_pointer, PB_DS_CLASS_C_DEC&);
+ };
+
+#include <ext/pb_ds/detail/rb_tree_map_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp>
+#include <ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_CLASS_NAME
+#undef PB_DS_BASE_CLASS_NAME
+#undef PB_DS_BASE_C_DEC
+#undef PB_DS_V2F
+#undef PB_DS_EP2VP
+#undef PB_DS_V2S
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp
new file mode 100644
index 0000000..9776a8d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp
@@ -0,0 +1,313 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_join_fn_imps.hpp
+ * Contains an implementation for rb_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+join(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.base_type::assert_valid();)
+ if (base_type::join_prep(other) == false)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return;
+ }
+
+ const node_pointer p_x = other.split_min();
+ join_imp(p_x, other.m_p_head->m_p_parent);
+ base_type::join_finish(other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.base_type::assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+join_imp(node_pointer p_x, node_pointer p_r)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_x != NULL);
+ if (p_r != NULL)
+ p_r->m_red = false;
+
+ const size_type h = black_height(base_type::m_p_head->m_p_parent);
+ const size_type other_h = black_height(p_r);
+ node_pointer p_x_l;
+ node_pointer p_x_r;
+ std::pair<node_pointer, node_pointer> join_pos;
+ const bool right_join = h >= other_h;
+ if (right_join)
+ {
+ join_pos = find_join_pos_right(base_type::m_p_head->m_p_parent,
+ h, other_h);
+ p_x_l = join_pos.first;
+ p_x_r = p_r;
+ }
+ else
+ {
+ p_x_l = base_type::m_p_head->m_p_parent;
+ base_type::m_p_head->m_p_parent = p_r;
+ if (p_r != NULL)
+ p_r->m_p_parent = base_type::m_p_head;
+
+ join_pos = find_join_pos_left(base_type::m_p_head->m_p_parent,
+ h, other_h);
+ p_x_r = join_pos.first;
+ }
+
+ node_pointer p_parent = join_pos.second;
+ if (p_parent == base_type::m_p_head)
+ {
+ base_type::m_p_head->m_p_parent = p_x;
+ p_x->m_p_parent = base_type::m_p_head;
+ }
+ else
+ {
+ p_x->m_p_parent = p_parent;
+ if (right_join)
+ p_x->m_p_parent->m_p_right = p_x;
+ else
+ p_x->m_p_parent->m_p_left = p_x;
+ }
+
+ p_x->m_p_left = p_x_l;
+ if (p_x_l != NULL)
+ p_x_l->m_p_parent = p_x;
+
+ p_x->m_p_right = p_x_r;
+ if (p_x_r != NULL)
+ p_x_r->m_p_parent = p_x;
+
+ p_x->m_red = true;
+
+ base_type::initialize_min_max();
+ _GLIBCXX_DEBUG_ONLY(base_type::structure_only_assert_valid();)
+ base_type::update_to_top(p_x, (node_update* )this);
+ insert_fixup(p_x);
+ _GLIBCXX_DEBUG_ONLY(base_type::structure_only_assert_valid());
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+split_min()
+{
+ node_pointer p_min = base_type::m_p_head->m_p_left;
+
+#ifdef _GLIBCXX_DEBUG
+ const node_pointer p_head = base_type::m_p_head;
+ _GLIBCXX_DEBUG_ASSERT(p_min != p_head);
+#endif
+
+ remove_node(p_min);
+ return p_min;
+}
+
+PB_DS_CLASS_T_DEC
+std::pair<
+ typename PB_DS_CLASS_C_DEC::node_pointer,
+ typename PB_DS_CLASS_C_DEC::node_pointer>
+PB_DS_CLASS_C_DEC::
+find_join_pos_right(node_pointer p_l, size_type h_l, size_type h_r)
+{
+ _GLIBCXX_DEBUG_ASSERT(h_l >= h_r);
+
+ if (base_type::m_p_head->m_p_parent == NULL)
+ return (std::make_pair((node_pointer)NULL, base_type::m_p_head));
+
+ node_pointer p_l_parent = base_type::m_p_head;
+ while (h_l > h_r)
+ {
+ if (p_l->m_red == false)
+ {
+ _GLIBCXX_DEBUG_ASSERT(h_l > 0);
+ --h_l;
+ }
+
+ p_l_parent = p_l;
+ p_l = p_l->m_p_right;
+ }
+
+ if (!is_effectively_black(p_l))
+ {
+ p_l_parent = p_l;
+ p_l = p_l->m_p_right;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(is_effectively_black(p_l));
+ _GLIBCXX_DEBUG_ASSERT(black_height(p_l) == h_r);
+ _GLIBCXX_DEBUG_ASSERT(p_l == NULL || p_l->m_p_parent == p_l_parent);
+ return std::make_pair(p_l, p_l_parent);
+}
+
+PB_DS_CLASS_T_DEC
+std::pair<
+ typename PB_DS_CLASS_C_DEC::node_pointer,
+ typename PB_DS_CLASS_C_DEC::node_pointer>
+PB_DS_CLASS_C_DEC::
+find_join_pos_left(node_pointer p_r, size_type h_l, size_type h_r)
+{
+ _GLIBCXX_DEBUG_ASSERT(h_r > h_l);
+ if (base_type::m_p_head->m_p_parent == NULL)
+ return (std::make_pair((node_pointer)NULL,
+ base_type::m_p_head));
+ node_pointer p_r_parent = base_type::m_p_head;
+ while (h_r > h_l)
+ {
+ if (p_r->m_red == false)
+ {
+ _GLIBCXX_DEBUG_ASSERT(h_r > 0);
+ --h_r;
+ }
+
+ p_r_parent = p_r;
+ p_r = p_r->m_p_left;
+ }
+
+ if (!is_effectively_black(p_r))
+ {
+ p_r_parent = p_r;
+ p_r = p_r->m_p_left;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(is_effectively_black(p_r));
+ _GLIBCXX_DEBUG_ASSERT(black_height(p_r) == h_l);
+ _GLIBCXX_DEBUG_ASSERT(p_r == NULL || p_r->m_p_parent == p_r_parent);
+ return std::make_pair(p_r, p_r_parent);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+black_height(node_pointer p_nd)
+{
+ size_type h = 1;
+ while (p_nd != NULL)
+ {
+ if (p_nd->m_red == false)
+ ++h;
+ p_nd = p_nd->m_p_left;
+ }
+ return h;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+split(const_key_reference r_key, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_valid();)
+
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid());
+ _GLIBCXX_DEBUG_ONLY(other.base_type::assert_valid();)
+
+ if (base_type::split_prep(r_key, other) == false)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid());
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(base_type::structure_only_assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.base_type::structure_only_assert_valid();)
+ node_pointer p_nd = upper_bound(r_key).m_p_nd;
+ do
+ {
+ node_pointer p_next_nd = p_nd->m_p_parent;
+ if (Cmp_Fn::operator()(r_key, PB_DS_V2F(p_nd->m_value)))
+ split_at_node(p_nd, other);
+
+ _GLIBCXX_DEBUG_ONLY(base_type::structure_only_assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.base_type::structure_only_assert_valid();)
+ p_nd = p_next_nd;
+ }
+ while (p_nd != base_type::m_p_head);
+
+ base_type::split_finish(other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+split_at_node(node_pointer p_nd, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+
+ node_pointer p_l = p_nd->m_p_left;
+ node_pointer p_r = p_nd->m_p_right;
+ node_pointer p_parent = p_nd->m_p_parent;
+ if (p_parent == base_type::m_p_head)
+ {
+ base_type::m_p_head->m_p_parent = p_l;
+ if (p_l != NULL)
+ {
+ p_l->m_p_parent = base_type::m_p_head;
+ p_l->m_red = false;
+ }
+ }
+ else
+ {
+ if (p_parent->m_p_left == p_nd)
+ p_parent->m_p_left = p_l;
+ else
+ p_parent->m_p_right = p_l;
+
+ if (p_l != NULL)
+ p_l->m_p_parent = p_parent;
+
+ update_to_top(p_parent, (node_update* )this);
+
+ if (!p_nd->m_red)
+ remove_fixup(p_l, p_parent);
+ }
+
+ base_type::initialize_min_max();
+ other.join_imp(p_nd, p_r);
+ _GLIBCXX_DEBUG_ONLY(base_type::structure_only_assert_valid());
+ _GLIBCXX_DEBUG_ONLY(other.base_type::structure_only_assert_valid());
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/traits.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/traits.hpp
new file mode 100644
index 0000000..531d8e4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rb_tree_map_/traits.hpp
@@ -0,0 +1,124 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file traits.hpp
+ * Contains an implementation for rb_tree_.
+ */
+
+#ifndef PB_DS_RB_TREE_NODE_AND_IT_TRAITS_HPP
+#define PB_DS_RB_TREE_NODE_AND_IT_TRAITS_HPP
+
+#include <ext/pb_ds/detail/rb_tree_map_/node.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Key,
+ typename Mapped,
+ typename Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn_,
+ class Allocator_>
+ class Node_Update,
+ typename Allocator>
+ struct tree_traits<
+ Key,
+ Mapped,
+ Cmp_Fn,
+ Node_Update,
+ rb_tree_tag,
+ Allocator> : public bin_search_tree_traits<
+ Key,
+ Mapped,
+ Cmp_Fn,
+ Node_Update,
+ rb_tree_node_<
+ typename types_traits<
+ Key,
+ Mapped,
+ Allocator,
+ false>::value_type,
+ typename tree_node_metadata_selector<
+ Key,
+ Mapped,
+ Cmp_Fn,
+ Node_Update,
+ Allocator>::type,
+ Allocator>,
+ Allocator>
+ { };
+
+ template<typename Key,
+ class Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn_,
+ class Allocator_>
+ class Node_Update,
+ class Allocator>
+ struct tree_traits<
+ Key,
+ null_mapped_type,
+ Cmp_Fn,
+ Node_Update,
+ rb_tree_tag,
+ Allocator> : public bin_search_tree_traits<
+ Key,
+ null_mapped_type,
+ Cmp_Fn,
+ Node_Update,
+ rb_tree_node_<
+ typename types_traits<
+ Key,
+ null_mapped_type,
+ Allocator,
+ false>::value_type,
+ typename tree_node_metadata_selector<
+ Key,
+ null_mapped_type,
+ Cmp_Fn,
+ Node_Update,
+ Allocator>::type,
+ Allocator>,
+ Allocator>
+ { };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/constructors_destructor_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..bf4dcfe
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,88 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation for rc_binomial_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+rc_binomial_heap_()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+rc_binomial_heap_(const Cmp_Fn& r_cmp_fn) :
+ PB_DS_BASE_C_DEC(r_cmp_fn)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+rc_binomial_heap_(const PB_DS_CLASS_C_DEC& other) :
+ PB_DS_BASE_C_DEC(other)
+{
+ make_binomial_heap();
+
+ base_type::find_max();
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~rc_binomial_heap_()
+{ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ base_type::swap(other);
+
+ m_rc.swap(other.m_rc);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp
new file mode 100644
index 0000000..0194905
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp
@@ -0,0 +1,121 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation for rc_binomial_heap_.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ base_type::assert_valid(false);
+ if (!base_type::empty())
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_p_max != NULL);
+ base_type::assert_max();
+ }
+
+ m_rc.assert_valid();
+
+ if (m_rc.empty())
+ {
+ base_type::assert_valid(true);
+ _GLIBCXX_DEBUG_ASSERT(next_2_pointer(base_type::m_p_root) == NULL);
+ return;
+ }
+
+ const_node_pointer p_nd = next_2_pointer(base_type::m_p_root);
+ typename rc_t::const_iterator it = m_rc.end();
+ --it;
+
+ while (p_nd != NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(*it == p_nd);
+ const_node_pointer p_next = p_nd->m_p_next_sibling;
+ _GLIBCXX_DEBUG_ASSERT(p_next != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata == p_next->m_metadata);
+ _GLIBCXX_DEBUG_ASSERT(p_next->m_p_next_sibling == NULL ||
+ p_next->m_metadata < p_next->m_p_next_sibling->m_metadata);
+
+ --it;
+ p_nd = next_2_pointer(next_after_0_pointer(p_nd));
+ }
+ _GLIBCXX_DEBUG_ASSERT(it + 1 == m_rc.begin());
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::const_node_pointer
+PB_DS_CLASS_C_DEC::
+next_2_pointer(const_node_pointer p_nd)
+{
+ if (p_nd == NULL)
+ return NULL;
+
+ node_pointer p_next = p_nd->m_p_next_sibling;
+
+ if (p_next == NULL)
+ return NULL;
+
+ if (p_nd->m_metadata == p_next->m_metadata)
+ return p_nd;
+
+ return next_2_pointer(p_next);
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::const_node_pointer
+PB_DS_CLASS_C_DEC::
+next_after_0_pointer(const_node_pointer p_nd)
+{
+ if (p_nd == NULL)
+ return NULL;
+
+ node_pointer p_next = p_nd->m_p_next_sibling;
+
+ if (p_next == NULL)
+ return NULL;
+
+ if (p_nd->m_metadata < p_next->m_metadata)
+ return p_next;
+
+ return next_after_0_pointer(p_next);
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp
new file mode 100644
index 0000000..1113ffa
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp
@@ -0,0 +1,107 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation for rc_binomial_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+pop()
+{
+ make_binomial_heap();
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+ base_type::pop();
+ base_type::find_max();
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ base_type::clear();
+ m_rc.clear();
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+make_binomial_heap()
+{
+ node_pointer p_nd = base_type::m_p_root;
+ while (p_nd != NULL)
+ {
+ node_pointer p_next = p_nd->m_p_next_sibling;
+ if (p_next == NULL)
+ p_nd = p_next;
+ else if (p_nd->m_metadata == p_next->m_metadata)
+ p_nd = link_with_next_sibling(p_nd);
+ else if (p_nd->m_metadata < p_next->m_metadata)
+ p_nd = p_next;
+#ifdef _GLIBCXX_DEBUG
+ else
+ _GLIBCXX_DEBUG_ASSERT(0);
+#endif
+ }
+
+ m_rc.clear();
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ make_binomial_heap();
+ const size_type ersd = base_type::erase_if(pred);
+ base_type::find_max();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return ersd;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase(point_iterator it)
+{
+ make_binomial_heap();
+ base_type::erase(it);
+ base_type::find_max();
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp
new file mode 100644
index 0000000..aef4b92
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp
@@ -0,0 +1,154 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains an implementation for rc_binomial_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+push(const_reference r_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ make_0_exposed();
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ node_pointer p_nd = base_type::get_new_node_for_insert(r_val);
+
+ p_nd->m_p_l_child = p_nd->m_p_prev_or_parent = NULL;
+ p_nd->m_metadata = 0;
+
+ if (base_type::m_p_max == NULL || Cmp_Fn::operator()(base_type::m_p_max->m_value, r_val))
+ base_type::m_p_max = p_nd;
+
+ p_nd->m_p_next_sibling = base_type::m_p_root;
+
+ if (base_type::m_p_root != NULL)
+ base_type::m_p_root->m_p_prev_or_parent = p_nd;
+
+ base_type::m_p_root = p_nd;
+
+ if (p_nd->m_p_next_sibling != NULL&& p_nd->m_p_next_sibling->m_metadata == 0)
+ m_rc.push(p_nd);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ return point_iterator(p_nd);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+modify(point_iterator it, const_reference r_new_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ make_binomial_heap();
+
+ base_type::modify(it, r_new_val);
+
+ base_type::find_max();
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+link_with_next_sibling(node_pointer p_nd)
+{
+ node_pointer p_next = p_nd->m_p_next_sibling;
+
+ _GLIBCXX_DEBUG_ASSERT(p_next != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_next->m_p_prev_or_parent == p_nd);
+
+ if (Cmp_Fn::operator()(p_nd->m_value, p_next->m_value))
+ {
+ p_next->m_p_prev_or_parent = p_nd->m_p_prev_or_parent;
+
+ if (p_next->m_p_prev_or_parent == NULL)
+ base_type::m_p_root = p_next;
+ else
+ p_next->m_p_prev_or_parent->m_p_next_sibling = p_next;
+
+ if (base_type::m_p_max == p_nd)
+ base_type::m_p_max = p_next;
+
+ base_type::make_child_of(p_nd, p_next);
+
+ ++p_next->m_metadata;
+
+ return p_next;
+ }
+
+ p_nd->m_p_next_sibling = p_next->m_p_next_sibling;
+
+ if (p_nd->m_p_next_sibling != NULL)
+ p_nd->m_p_next_sibling->m_p_prev_or_parent = p_nd;
+
+ if (base_type::m_p_max == p_next)
+ base_type::m_p_max = p_nd;
+
+ base_type::make_child_of(p_next, p_nd);
+
+ ++p_nd->m_metadata;
+
+ return p_nd;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+make_0_exposed()
+{
+ if (m_rc.empty())
+ return;
+
+ node_pointer p_nd = m_rc.top();
+
+ m_rc.pop();
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_next_sibling != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata == p_nd->m_p_next_sibling->m_metadata);
+
+ node_pointer p_res = link_with_next_sibling(p_nd);
+
+ if (p_res->m_p_next_sibling != NULL&& p_res->m_metadata == p_res->m_p_next_sibling->m_metadata)
+ m_rc.push(p_res);
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp
new file mode 100644
index 0000000..9b70acc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp
@@ -0,0 +1,262 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file rc.hpp
+ * Contains a redundant (binary counter).
+ */
+
+#ifndef PB_DS_RC_HPP
+#define PB_DS_RC_HPP
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Node, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ rc<Node, Allocator>
+
+ template<typename Node, class Allocator>
+ class rc
+ {
+ private:
+ typedef Allocator allocator_type;
+
+ typedef typename allocator_type::size_type size_type;
+
+ typedef Node node;
+
+ typedef
+ typename allocator_type::template rebind<
+ node>::other::pointer
+ node_pointer;
+
+ typedef
+ typename allocator_type::template rebind<
+ node_pointer>::other::pointer
+ entry_pointer;
+
+ typedef
+ typename allocator_type::template rebind<
+ node_pointer>::other::const_pointer
+ const_entry_pointer;
+
+ enum
+ {
+ max_entries = sizeof(size_type) << 3
+ };
+
+ public:
+ typedef node_pointer entry;
+
+ typedef const_entry_pointer const_iterator;
+
+ public:
+ rc();
+
+ rc(const PB_DS_CLASS_C_DEC& other);
+
+ inline void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ inline void
+ push(entry p_nd);
+
+ inline node_pointer
+ top() const;
+
+ inline void
+ pop();
+
+ inline bool
+ empty() const;
+
+ inline size_type
+ size() const;
+
+ void
+ clear();
+
+ const const_iterator
+ begin() const;
+
+ const const_iterator
+ end() const;
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+
+#ifdef PB_DS_RC_BINOMIAL_HEAP_TRACE_
+ void
+ trace() const;
+#endif
+
+ private:
+ node_pointer m_a_entries[max_entries];
+
+ size_type m_over_top;
+ };
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ rc() : m_over_top(0)
+ { _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+ PB_DS_CLASS_T_DEC
+ PB_DS_CLASS_C_DEC::
+ rc(const PB_DS_CLASS_C_DEC& other) : m_over_top(0)
+ { _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ swap(PB_DS_CLASS_C_DEC& other)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ const size_type over_top = std::max(m_over_top, other.m_over_top);
+
+ for (size_type i = 0; i < over_top; ++i)
+ std::swap(m_a_entries[i], other.m_a_entries[i]);
+
+ std::swap(m_over_top, other.m_over_top);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ push(entry p_nd)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(m_over_top < max_entries);
+ m_a_entries[m_over_top++] = p_nd;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline void
+ PB_DS_CLASS_C_DEC::
+ pop()
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!empty());
+ --m_over_top;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::node_pointer
+ PB_DS_CLASS_C_DEC::
+ top() const
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!empty());
+ return *(m_a_entries + m_over_top - 1);
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline bool
+ PB_DS_CLASS_C_DEC::
+ empty() const
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return m_over_top == 0;
+ }
+
+ PB_DS_CLASS_T_DEC
+ inline typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ size() const
+ { return m_over_top; }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ clear()
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ m_over_top = 0;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+ PB_DS_CLASS_T_DEC
+ const typename PB_DS_CLASS_C_DEC::const_iterator
+ PB_DS_CLASS_C_DEC::
+ begin() const
+ { return& m_a_entries[0]; }
+
+ PB_DS_CLASS_T_DEC
+ const typename PB_DS_CLASS_C_DEC::const_iterator
+ PB_DS_CLASS_C_DEC::
+ end() const
+ { return& m_a_entries[m_over_top]; }
+
+#ifdef _GLIBCXX_DEBUG
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ assert_valid() const
+ { _GLIBCXX_DEBUG_ASSERT(m_over_top < max_entries); }
+#endif
+
+#ifdef PB_DS_RC_BINOMIAL_HEAP_TRACE_
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ trace() const
+ {
+ std::cout << "rc" << std::endl;
+ for (size_type i = 0; i < m_over_top; ++i)
+ std::cerr << m_a_entries[i] << std::endl;
+ std::cout << std::endl;
+ }
+#endif
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+} // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp
new file mode 100644
index 0000000..762e29b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp
@@ -0,0 +1,198 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file rc_binomial_heap_.hpp
+ * Contains an implementation for rc_binomial_heap_.
+ */
+
+/*
+ * Redundant-counter binomial heap.
+ */
+
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp>
+#include <ext/pb_ds/detail/rc_binomial_heap_/rc.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ rc_binomial_heap_<Value_Type, Cmp_Fn, Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ binomial_heap_base_<Value_Type, Cmp_Fn, Allocator>
+
+#define PB_DS_RC_C_DEC \
+ rc<typename PB_DS_BASE_C_DEC::node, Allocator>
+
+ /**
+ * class description = "8y|\|0|\/|i41 h34p 74813">
+ **/
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+ class rc_binomial_heap_ : public PB_DS_BASE_C_DEC
+ {
+
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ typedef typename base_type::node_pointer node_pointer;
+
+ typedef typename base_type::const_node_pointer const_node_pointer;
+
+ typedef PB_DS_RC_C_DEC rc_t;
+
+ public:
+
+ typedef typename Allocator::size_type size_type;
+
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef Value_Type value_type;
+
+ typedef typename base_type::pointer pointer;
+
+ typedef typename base_type::const_pointer const_pointer;
+
+ typedef typename base_type::reference reference;
+
+ typedef typename base_type::const_reference const_reference;
+
+ typedef typename base_type::const_point_iterator const_point_iterator;
+
+ typedef typename base_type::point_iterator point_iterator;
+
+ typedef typename base_type::const_iterator const_iterator;
+
+ typedef typename base_type::iterator iterator;
+
+ typedef typename base_type::cmp_fn cmp_fn;
+
+ typedef typename base_type::allocator_type allocator_type;
+
+ public:
+
+ rc_binomial_heap_();
+
+ rc_binomial_heap_(const Cmp_Fn& r_cmp_fn);
+
+ rc_binomial_heap_(const PB_DS_CLASS_C_DEC& other);
+
+ ~rc_binomial_heap_();
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ inline point_iterator
+ push(const_reference r_val);
+
+ void
+ modify(point_iterator it, const_reference r_new_val);
+
+ inline void
+ pop();
+
+ void
+ erase(point_iterator it);
+
+ inline void
+ clear();
+
+ template<typename Pred>
+ size_type
+ erase_if(Pred pred);
+
+ template<typename Pred>
+ void
+ split(Pred pred, PB_DS_CLASS_C_DEC& other);
+
+ void
+ join(PB_DS_CLASS_C_DEC& other);
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+
+#ifdef PB_DS_RC_BINOMIAL_HEAP_TRACE_
+ void
+ trace() const;
+#endif
+
+ private:
+
+ inline node_pointer
+ link_with_next_sibling(node_pointer p_nd);
+
+ void
+ make_0_exposed();
+
+ void
+ make_binomial_heap();
+
+#ifdef _GLIBCXX_DEBUG
+ static const_node_pointer
+ next_2_pointer(const_node_pointer p_nd);
+
+ static const_node_pointer
+ next_after_0_pointer(const_node_pointer p_nd);
+#endif
+
+ private:
+ rc_t m_rc;
+ };
+
+#include <ext/pb_ds/detail/rc_binomial_heap_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/rc_binomial_heap_/trace_fn_imps.hpp>
+#include <ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/rc_binomial_heap_/split_join_fn_imps.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+
+#undef PB_DS_CLASS_T_DEC
+
+#undef PB_DS_BASE_C_DEC
+
+#undef PB_DS_RC_C_DEC
+ } // namespace detail
+} // namespace __gnu_pbds
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/split_join_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/split_join_fn_imps.hpp
new file mode 100644
index 0000000..26965ae
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/split_join_fn_imps.hpp
@@ -0,0 +1,81 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_join_fn_imps.hpp
+ * Contains an implementation for rc_binomial_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+void
+PB_DS_CLASS_C_DEC::
+split(Pred pred, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ make_binomial_heap();
+ other.make_binomial_heap();
+
+ base_type::split(pred, other);
+
+ base_type::find_max();
+ other.find_max();
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+join(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ make_binomial_heap();
+ other.make_binomial_heap();
+
+ base_type::join(other);
+
+ base_type::find_max();
+ other.find_max();
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/trace_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/trace_fn_imps.hpp
new file mode 100644
index 0000000..1fb3b8b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/rc_binomial_heap_/trace_fn_imps.hpp
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trace_fn_imps.hpp
+ * Contains an implementation for rc_binomial_heap_.
+ */
+
+#ifdef PB_DS_RC_BINOMIAL_HEAP_TRACE_
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace() const
+{
+ base_type::trace();
+
+ m_rc.trace();
+}
+
+#endif // #ifdef PB_DS_RC_BINOMIAL_HEAP_TRACE_
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp
new file mode 100644
index 0000000..94cd515
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp
@@ -0,0 +1,211 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file cc_hash_max_collision_check_resize_trigger_imp.hpp
+ * Contains a resize trigger implementation.
+ */
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+cc_hash_max_collision_check_resize_trigger(float load) :
+ m_load(load),
+ m_size(0),
+ m_num_col(0),
+ m_max_col(0),
+ m_resize_needed(false)
+{ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_find_search_start()
+{ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_find_search_collision()
+{ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_find_search_end()
+{ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_insert_search_start()
+{ m_num_col = 0; }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_insert_search_collision()
+{ ++m_num_col; }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_insert_search_end()
+{ calc_resize_needed(); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erase_search_start()
+{ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erase_search_collision()
+{ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erase_search_end()
+{ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_inserted(size_type)
+{ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erased(size_type)
+{ m_resize_needed = true; }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+notify_cleared()
+{ m_resize_needed = false; }
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+is_resize_needed() const
+{ return m_resize_needed; }
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+is_grow_needed(size_type /*size*/, size_type /*num_used_e*/) const
+{ return m_num_col >= m_max_col; }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+notify_resized(size_type new_size)
+{
+ m_size = new_size;
+
+#ifdef PB_DS_HT_MAP_RESIZE_TRACE_
+ std::cerr << "chmccrt::notify_resized "
+ << static_cast<unsigned long>(new_size) << std::endl;
+#endif
+
+ calc_max_num_coll();
+ calc_resize_needed();
+ m_num_col = 0;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+calc_max_num_coll()
+{
+ // max_col <-- \sqrt{2 load \ln( 2 m \ln( m ) ) }
+ const double ln_arg = 2 * m_size * std::log(double(m_size));
+ m_max_col = size_type(std::ceil(std::sqrt(2 * m_load * std::log(ln_arg))));
+
+#ifdef PB_DS_HT_MAP_RESIZE_TRACE_
+ std::cerr << "chmccrt::calc_max_num_coll "
+ << static_cast<unsigned long>(m_size) << " "
+ << static_cast<unsigned long>(m_max_col) << std::endl;
+#endif
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+notify_externally_resized(size_type new_size)
+{ notify_resized(new_size); }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ std::swap(m_load, other.m_load);
+ std::swap(m_size, other.m_size);
+ std::swap(m_num_col, other.m_num_col);
+ std::swap(m_max_col, other.m_max_col);
+ std::swap(m_resize_needed, other.m_resize_needed);
+}
+
+PB_DS_CLASS_T_DEC
+inline float
+PB_DS_CLASS_C_DEC::
+get_load() const
+{
+ PB_DS_STATIC_ASSERT(access, external_load_access);
+ return m_load;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+calc_resize_needed()
+{ m_resize_needed = m_resize_needed || m_num_col >= m_max_col; }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+set_load(float load)
+{
+ PB_DS_STATIC_ASSERT(access, external_load_access);
+ m_load = load;
+ calc_max_num_coll();
+ calc_resize_needed();
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/hash_exponential_size_policy_imp.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/hash_exponential_size_policy_imp.hpp
new file mode 100644
index 0000000..b58f2ec
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/hash_exponential_size_policy_imp.hpp
@@ -0,0 +1,90 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file hash_exponential_size_policy_imp.hpp
+ * Contains a resize size policy implementation.
+ */
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+hash_exponential_size_policy(size_type start_size, size_type grow_factor) :
+ m_start_size(start_size),
+ m_grow_factor(grow_factor)
+{ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ std::swap(m_start_size, other.m_start_size);
+ std::swap(m_grow_factor, other.m_grow_factor);
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+get_nearest_larger_size(size_type size) const
+{
+ size_type ret = m_start_size;
+ while (ret <= size)
+ {
+ const size_type next_ret = ret* m_grow_factor;
+ if (next_ret < ret)
+ __throw_insert_error();
+ ret = next_ret;
+ }
+ return ret;
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+get_nearest_smaller_size(size_type size) const
+{
+ size_type ret = m_start_size;
+ while (true)
+ {
+ const size_type next_ret = ret* m_grow_factor;
+ if (next_ret < ret)
+ __throw_resize_error();
+ if (next_ret >= size)
+ return (ret);
+ ret = next_ret;
+ }
+ return ret;
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp
new file mode 100644
index 0000000..3403b09
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp
@@ -0,0 +1,289 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file hash_load_check_resize_trigger_imp.hpp
+ * Contains a resize trigger implementation.
+ */
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+hash_load_check_resize_trigger(float load_min, float load_max)
+: m_load_min(load_min), m_load_max(load_max), m_next_shrink_size(0),
+ m_next_grow_size(0), m_resize_needed(false)
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_find_search_start()
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_find_search_collision()
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_find_search_end()
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_insert_search_start()
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_insert_search_collision()
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_insert_search_end()
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erase_search_start()
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erase_search_collision()
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erase_search_end()
+{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_inserted(size_type num_entries)
+{
+ m_resize_needed = (num_entries >= m_next_grow_size);
+ size_base::set_size(num_entries);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erased(size_type num_entries)
+{
+ size_base::set_size(num_entries);
+ m_resize_needed = num_entries <= m_next_shrink_size;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+is_resize_needed() const
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return m_resize_needed;
+}
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+is_grow_needed(size_type /*size*/, size_type num_entries) const
+{
+ _GLIBCXX_DEBUG_ASSERT(m_resize_needed);
+ return num_entries >= m_next_grow_size;
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~hash_load_check_resize_trigger() { }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+notify_resized(size_type new_size)
+{
+ m_resize_needed = false;
+ m_next_grow_size = size_type(m_load_max * new_size - 1);
+ m_next_shrink_size = size_type(m_load_min * new_size);
+
+#ifdef PB_DS_HT_MAP_RESIZE_TRACE_
+ std::cerr << "hlcrt::notify_resized " <<
+ static_cast<unsigned long>(new_size) << " " <<
+ static_cast<unsigned long>(m_load_min) << " " <<
+ static_cast<unsigned long>(m_load_max) << " " <<
+ static_cast<unsigned long>(m_next_shrink_size) << " " <<
+ static_cast<unsigned long>(m_next_grow_size) << " " << std::endl;
+#endif
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+notify_externally_resized(size_type new_size)
+{
+ m_resize_needed = false;
+ size_type new_grow_size = size_type(m_load_max * new_size - 1);
+ size_type new_shrink_size = size_type(m_load_min * new_size);
+ if (new_grow_size >= m_next_grow_size)
+ {
+ _GLIBCXX_DEBUG_ASSERT(new_shrink_size > m_next_shrink_size);
+ m_next_grow_size = new_grow_size;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+#ifdef PB_DS_HT_MAP_RESIZE_TRACE_
+ std::cerr << "hlcrt::notify_externally_resized1 " <<
+ static_cast<unsigned long>(new_size) << " " <<
+ static_cast<unsigned long>(m_load_min) << " " <<
+ static_cast<unsigned long>(m_load_max) << " " <<
+ static_cast<unsigned long>(m_next_shrink_size) << " " <<
+ static_cast<unsigned long>(m_next_grow_size) << " " << std::endl;
+#endif
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(new_shrink_size <= m_next_shrink_size);
+ m_next_shrink_size = new_shrink_size;
+
+#ifdef PB_DS_HT_MAP_RESIZE_TRACE_
+ std::cerr << "hlcrt::notify_externally_resized2 " <<
+ static_cast<unsigned long>(new_size) << " " <<
+ static_cast<unsigned long>(m_load_min) << " " <<
+ static_cast<unsigned long>(m_load_max) << " " <<
+ static_cast<unsigned long>(m_next_shrink_size) << " " <<
+ static_cast<unsigned long>(m_next_grow_size) << " " << std::endl;
+#endif
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+notify_cleared()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ size_base::set_size(0);
+ m_resize_needed = (0 < m_next_shrink_size);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ size_base::swap(other);
+ std::swap(m_load_min, other.m_load_min);
+ std::swap(m_load_max, other.m_load_max);
+ std::swap(m_resize_needed, other.m_resize_needed);
+ std::swap(m_next_grow_size, other.m_next_grow_size);
+ std::swap(m_next_shrink_size, other.m_next_shrink_size);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+inline std::pair<float, float>
+PB_DS_CLASS_C_DEC::
+get_loads() const
+{
+ PB_DS_STATIC_ASSERT(access, external_load_access);
+ return std::make_pair(m_load_min, m_load_max);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+set_loads(std::pair<float, float> load_pair)
+{
+ PB_DS_STATIC_ASSERT(access, external_load_access);
+ const float old_load_min = m_load_min;
+ const float old_load_max = m_load_max;
+ const size_type old_next_shrink_size = m_next_shrink_size;
+ const size_type old_next_grow_size = m_next_grow_size;
+ const bool old_resize_needed = m_resize_needed;
+
+ __try
+ {
+ m_load_min = load_pair.first;
+ m_load_max = load_pair.second;
+ do_resize(static_cast<size_type>(size_base::get_size() / ((m_load_min + m_load_max) / 2)));
+ }
+ __catch(...)
+ {
+ m_load_min = old_load_min;
+ m_load_max = old_load_max;
+ m_next_shrink_size = old_next_shrink_size;
+ m_next_grow_size = old_next_grow_size;
+ m_resize_needed = old_resize_needed;
+ __throw_exception_again;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+do_resize(size_type)
+{ std::abort(); }
+
+#ifdef _GLIBCXX_DEBUG
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ _GLIBCXX_DEBUG_ASSERT(m_load_max > m_load_min);
+ _GLIBCXX_DEBUG_ASSERT(m_next_grow_size >= m_next_shrink_size);
+}
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_size_base.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_size_base.hpp
new file mode 100644
index 0000000..c29b3d5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_size_base.hpp
@@ -0,0 +1,94 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file hash_load_check_resize_trigger_size_base.hpp
+ * Contains an base holding size for some resize policies.
+ */
+
+#ifndef PB_DS_HASH_LOAD_CHECK_RESIZE_TRIGGER_SIZE_BASE_HPP
+#define PB_DS_HASH_LOAD_CHECK_RESIZE_TRIGGER_SIZE_BASE_HPP
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ // Primary template.
+ template<typename Size_Type, bool Hold_Size>
+ class hash_load_check_resize_trigger_size_base;
+
+ // Specializations.
+ template<typename Size_Type>
+ class hash_load_check_resize_trigger_size_base<Size_Type, true>
+ {
+ protected:
+ typedef Size_Type size_type;
+
+ hash_load_check_resize_trigger_size_base(): m_size(0)
+ { }
+
+ inline void
+ swap(hash_load_check_resize_trigger_size_base& other)
+ { std::swap(m_size, other.m_size); }
+
+ inline void
+ set_size(size_type size)
+ { m_size = size; }
+
+ inline size_type
+ get_size() const
+ { return m_size; }
+
+ private:
+ size_type m_size;
+ };
+
+ template<typename Size_Type>
+ class hash_load_check_resize_trigger_size_base<Size_Type, false>
+ {
+ protected:
+ typedef Size_Type size_type;
+
+ protected:
+ inline void
+ swap(hash_load_check_resize_trigger_size_base& other) { }
+
+ inline void
+ set_size(size_type size) { }
+ };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp
new file mode 100644
index 0000000..a28f5ed
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp
@@ -0,0 +1,161 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file hash_prime_size_policy_imp.hpp
+ * Contains a resize size policy implementation.
+ */
+
+#pragma GCC system_header
+
+namespace detail
+{
+ enum
+ {
+ num_distinct_sizes_32_bit = 30,
+ num_distinct_sizes_64_bit = 62,
+ num_distinct_sizes = sizeof(std::size_t) != 8 ?
+ num_distinct_sizes_32_bit : num_distinct_sizes_64_bit,
+ };
+
+ // Originally taken from the SGI implementation; acknowledged in the docs.
+ // Further modified (for 64 bits) from tr1's hashtable.
+ static const std::size_t g_a_sizes[num_distinct_sizes_64_bit] =
+ {
+ /* 0 */ 5ul,
+ /* 1 */ 11ul,
+ /* 2 */ 23ul,
+ /* 3 */ 47ul,
+ /* 4 */ 97ul,
+ /* 5 */ 199ul,
+ /* 6 */ 409ul,
+ /* 7 */ 823ul,
+ /* 8 */ 1741ul,
+ /* 9 */ 3469ul,
+ /* 10 */ 6949ul,
+ /* 11 */ 14033ul,
+ /* 12 */ 28411ul,
+ /* 13 */ 57557ul,
+ /* 14 */ 116731ul,
+ /* 15 */ 236897ul,
+ /* 16 */ 480881ul,
+ /* 17 */ 976369ul,
+ /* 18 */ 1982627ul,
+ /* 19 */ 4026031ul,
+ /* 20 */ 8175383ul,
+ /* 21 */ 16601593ul,
+ /* 22 */ 33712729ul,
+ /* 23 */ 68460391ul,
+ /* 24 */ 139022417ul,
+ /* 25 */ 282312799ul,
+ /* 26 */ 573292817ul,
+ /* 27 */ 1164186217ul,
+ /* 28 */ 2364114217ul,
+ /* 29 */ 4294967291ul,
+ /* 30 */ (std::size_t)8589934583ull,
+ /* 31 */ (std::size_t)17179869143ull,
+ /* 32 */ (std::size_t)34359738337ull,
+ /* 33 */ (std::size_t)68719476731ull,
+ /* 34 */ (std::size_t)137438953447ull,
+ /* 35 */ (std::size_t)274877906899ull,
+ /* 36 */ (std::size_t)549755813881ull,
+ /* 37 */ (std::size_t)1099511627689ull,
+ /* 38 */ (std::size_t)2199023255531ull,
+ /* 39 */ (std::size_t)4398046511093ull,
+ /* 40 */ (std::size_t)8796093022151ull,
+ /* 41 */ (std::size_t)17592186044399ull,
+ /* 42 */ (std::size_t)35184372088777ull,
+ /* 43 */ (std::size_t)70368744177643ull,
+ /* 44 */ (std::size_t)140737488355213ull,
+ /* 45 */ (std::size_t)281474976710597ull,
+ /* 46 */ (std::size_t)562949953421231ull,
+ /* 47 */ (std::size_t)1125899906842597ull,
+ /* 48 */ (std::size_t)2251799813685119ull,
+ /* 49 */ (std::size_t)4503599627370449ull,
+ /* 50 */ (std::size_t)9007199254740881ull,
+ /* 51 */ (std::size_t)18014398509481951ull,
+ /* 52 */ (std::size_t)36028797018963913ull,
+ /* 53 */ (std::size_t)72057594037927931ull,
+ /* 54 */ (std::size_t)144115188075855859ull,
+ /* 55 */ (std::size_t)288230376151711717ull,
+ /* 56 */ (std::size_t)576460752303423433ull,
+ /* 57 */ (std::size_t)1152921504606846883ull,
+ /* 58 */ (std::size_t)2305843009213693951ull,
+ /* 59 */ (std::size_t)4611686018427387847ull,
+ /* 60 */ (std::size_t)9223372036854775783ull,
+ /* 61 */ (std::size_t)18446744073709551557ull,
+ };
+
+} // namespace detail
+
+PB_DS_CLASS_T_DEC
+inline
+PB_DS_CLASS_C_DEC::
+hash_prime_size_policy(size_type n) : m_start_size(n)
+{ m_start_size = get_nearest_larger_size(n); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{ std::swap(m_start_size, other.m_start_size); }
+
+PB_DS_CLASS_T_DEC
+inline PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+get_nearest_larger_size(size_type n) const
+{
+ const std::size_t* const p_upper = std::upper_bound(detail::g_a_sizes,
+ detail::g_a_sizes + detail::num_distinct_sizes, n);
+
+ if (p_upper == detail::g_a_sizes + detail::num_distinct_sizes)
+ __throw_resize_error();
+ return *p_upper;
+}
+
+PB_DS_CLASS_T_DEC
+inline PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+get_nearest_smaller_size(size_type n) const
+{
+ const size_t* p_lower = std::lower_bound(detail::g_a_sizes,
+ detail::g_a_sizes + detail::num_distinct_sizes, n);
+
+ if (*p_lower >= n && p_lower != detail::g_a_sizes)
+ --p_lower;
+ if (*p_lower < m_start_size)
+ return m_start_size;
+ return *p_lower;
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/hash_standard_resize_policy_imp.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/hash_standard_resize_policy_imp.hpp
new file mode 100644
index 0000000..39cf7dc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/hash_standard_resize_policy_imp.hpp
@@ -0,0 +1,249 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file hash_standard_resize_policy_imp.hpp
+ * Contains a resize policy implementation.
+ */
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+hash_standard_resize_policy()
+: m_size(Size_Policy::get_nearest_larger_size(1))
+{ trigger_policy_base::notify_externally_resized(m_size); }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+hash_standard_resize_policy(const Size_Policy& r_size_policy)
+: Size_Policy(r_size_policy), m_size(Size_Policy::get_nearest_larger_size(1))
+{ trigger_policy_base::notify_externally_resized(m_size); }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+hash_standard_resize_policy(const Size_Policy& r_size_policy,
+ const Trigger_Policy& r_trigger_policy)
+: Size_Policy(r_size_policy), Trigger_Policy(r_trigger_policy),
+ m_size(Size_Policy::get_nearest_larger_size(1))
+{ trigger_policy_base::notify_externally_resized(m_size); }
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~hash_standard_resize_policy()
+{ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ trigger_policy_base::swap(other);
+ size_policy_base::swap(other);
+ std::swap(m_size, other.m_size);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_find_search_start()
+{ trigger_policy_base::notify_find_search_start(); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_find_search_collision()
+{ trigger_policy_base::notify_find_search_collision(); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_find_search_end()
+{ trigger_policy_base::notify_find_search_end(); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_insert_search_start()
+{ trigger_policy_base::notify_insert_search_start(); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_insert_search_collision()
+{ trigger_policy_base::notify_insert_search_collision(); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_insert_search_end()
+{ trigger_policy_base::notify_insert_search_end(); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erase_search_start()
+{ trigger_policy_base::notify_erase_search_start(); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erase_search_collision()
+{ trigger_policy_base::notify_erase_search_collision(); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erase_search_end()
+{ trigger_policy_base::notify_erase_search_end(); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_inserted(size_type num_e)
+{ trigger_policy_base::notify_inserted(num_e); }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+notify_erased(size_type num_e)
+{ trigger_policy_base::notify_erased(num_e); }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+notify_cleared()
+{ trigger_policy_base::notify_cleared(); }
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+is_resize_needed() const
+{ return trigger_policy_base::is_resize_needed(); }
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+get_new_size(size_type size, size_type num_used_e) const
+{
+ if (trigger_policy_base::is_grow_needed(size, num_used_e))
+ return size_policy_base::get_nearest_larger_size(size);
+ return size_policy_base::get_nearest_smaller_size(size);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+notify_resized(size_type new_size)
+{
+ trigger_policy_base::notify_resized(new_size);
+ m_size = new_size;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+get_actual_size() const
+{
+ PB_DS_STATIC_ASSERT(access, external_size_access);
+ return m_size;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+resize(size_type new_size)
+{
+ PB_DS_STATIC_ASSERT(access, external_size_access);
+ size_type actual_size = size_policy_base::get_nearest_larger_size(1);
+ while (actual_size < new_size)
+ {
+ const size_type pot = size_policy_base::get_nearest_larger_size(actual_size);
+
+ if (pot == actual_size && pot < new_size)
+ __throw_resize_error();
+ actual_size = pot;
+ }
+
+ if (actual_size > 0)
+ --actual_size;
+
+ const size_type old_size = m_size;
+ __try
+ {
+ do_resize(actual_size - 1);
+ }
+ __catch(insert_error& )
+ {
+ m_size = old_size;
+ __throw_resize_error();
+ }
+ __catch(...)
+ {
+ m_size = old_size;
+ __throw_exception_again;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+do_resize(size_type)
+{
+ // Do nothing
+}
+
+PB_DS_CLASS_T_DEC
+Trigger_Policy&
+PB_DS_CLASS_C_DEC::
+get_trigger_policy()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Trigger_Policy&
+PB_DS_CLASS_C_DEC::
+get_trigger_policy() const
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+Size_Policy&
+PB_DS_CLASS_C_DEC::
+get_size_policy()
+{ return *this; }
+
+PB_DS_CLASS_T_DEC
+const Size_Policy&
+PB_DS_CLASS_C_DEC::
+get_size_policy() const
+{ return *this; }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp
new file mode 100644
index 0000000..ed70b95
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp
@@ -0,0 +1,125 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_resize_policy.hpp
+ * Contains a sample resize policy for hash tables.
+ */
+
+#ifndef PB_DS_SAMPLE_RESIZE_POLICY_HPP
+#define PB_DS_SAMPLE_RESIZE_POLICY_HPP
+
+// A sample resize policy.
+class sample_resize_policy
+{
+public:
+
+ // Size type.
+ typedef size_t size_type;
+
+ // Default constructor.
+ sample_resize_policy();
+
+ // Copy constructor.
+ sample_range_hashing(const sample_resize_policy& other);
+
+ // Swaps content.
+ inline void
+ swap(sample_resize_policy& other);
+
+protected:
+
+ // Notifies a search started.
+ inline void
+ notify_insert_search_start();
+
+ // Notifies a search encountered a collision.
+ inline void
+ notify_insert_search_collision();
+
+ // Notifies a search ended.
+ inline void
+ notify_insert_search_end();
+
+ // Notifies a search started.
+ inline void
+ notify_find_search_start();
+
+ // Notifies a search encountered a collision.
+ inline void
+ notify_find_search_collision();
+
+ // Notifies a search ended.
+ inline void
+ notify_find_search_end();
+
+ // Notifies a search started.
+ inline void
+ notify_erase_search_start();
+
+ // Notifies a search encountered a collision.
+ inline void
+ notify_erase_search_collision();
+
+ // Notifies a search ended.
+ inline void
+ notify_erase_search_end();
+
+ // Notifies an element was inserted.
+ inline void
+ notify_inserted(size_type num_e);
+
+ // Notifies an element was erased.
+ inline void
+ notify_erased(size_type num_e);
+
+ // Notifies the table was cleared.
+ void
+ notify_cleared();
+
+ // Notifies the table was resized to new_size.
+ void
+ notify_resized(size_type new_size);
+
+ // Queries whether a resize is needed.
+ inline bool
+ is_resize_needed() const;
+
+ // Queries what the new size should be.
+ size_type
+ get_new_size(size_type size, size_type num_used_e) const;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/sample_resize_trigger.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/sample_resize_trigger.hpp
new file mode 100644
index 0000000..a27dd94
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/sample_resize_trigger.hpp
@@ -0,0 +1,137 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_resize_trigger.hpp
+ * Contains a sample resize trigger policy class.
+ */
+
+#ifndef PB_DS_SAMPLE_RESIZE_TRIGGER_HPP
+#define PB_DS_SAMPLE_RESIZE_TRIGGER_HPP
+
+// A sample resize trigger policy.
+class sample_resize_trigger
+{
+public:
+
+ // Size type.
+ typedef size_t size_type;
+
+ // Default constructor.
+ sample_resize_trigger();
+
+ // Copy constructor.
+ sample_range_hashing(const sample_resize_trigger& other);
+
+ // Swaps content.
+ inline void
+ swap(sample_resize_trigger& other);
+
+protected:
+
+ // Notifies a search started.
+ inline void
+ notify_insert_search_start();
+
+ // Notifies a search encountered a collision.
+ inline void
+ notify_insert_search_collision();
+
+ // Notifies a search ended.
+ inline void
+ notify_insert_search_end();
+
+ // Notifies a search started.
+ inline void
+ notify_find_search_start();
+
+ // Notifies a search encountered a collision.
+ inline void
+ notify_find_search_collision();
+
+ // Notifies a search ended.
+ inline void
+ notify_find_search_end();
+
+ // Notifies a search started.
+ inline void
+ notify_erase_search_start();
+
+ // Notifies a search encountered a collision.
+ inline void
+ notify_erase_search_collision();
+
+ // Notifies a search ended.
+ inline void
+ notify_erase_search_end();
+
+ // Notifies an element was inserted. the total number of entries in
+ // the table is num_entries.
+ inline void
+ notify_inserted(size_type num_entries);
+
+ // Notifies an element was erased.
+ inline void
+ notify_erased(size_type num_entries);
+
+ // Notifies the table was cleared.
+ void
+ notify_cleared();
+
+ // Notifies the table was resized as a result of this object's
+ // signifying that a resize is needed.
+ void
+ notify_resized(size_type new_size);
+
+ // Notifies the table was resized externally.
+ void
+ notify_externally_resized(size_type new_size);
+
+ // Queries whether a resize is needed.
+ inline bool
+ is_resize_needed() const;
+
+ // Queries whether a grow is needed.
+ inline bool
+ is_grow_needed(size_type size, size_type num_entries) const;
+
+private:
+
+ // Resizes to new_size.
+ virtual void
+ do_resize(size_type new_size);
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp
new file mode 100644
index 0000000..1f2d3a9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_size_policy.hpp
+ * Contains a sample size resize-policy.
+ */
+
+#ifndef PB_DS_SAMPLE_SIZE_POLICY_HPP
+#define PB_DS_SAMPLE_SIZE_POLICY_HPP
+
+// A sample size policy.
+class sample_size_policy
+{
+public:
+
+ // Size type.
+ typedef size_t size_type;
+
+ // Default constructor.
+ sample_size_policy();
+
+ // Copy constructor.
+ sample_range_hashing(const sample_size_policy& other);
+
+ // Swaps content.
+ inline void
+ swap(sample_size_policy& other);
+
+protected:
+
+ // Given a __size size, returns a __size that is larger.
+ inline size_type
+ get_nearest_larger_size(size_type size) const;
+
+ // Given a __size size, returns a __size that is smaller.
+ inline size_type
+ get_nearest_smaller_size(size_type size) const;
+};
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/constructors_destructor_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..2225895
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,102 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation class for splay_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+ while (first_it != last_it)
+ insert(*(first_it++));
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME()
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn) :
+ base_type(r_cmp_fn)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn, const node_update& r_node_update) :
+ base_type(r_cmp_fn, r_node_update)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) :
+ base_type(other)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ base_type::swap(other);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+initialize()
+{ base_type::m_p_head->m_special = true; }
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp
new file mode 100644
index 0000000..084e25d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp
@@ -0,0 +1,74 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation class for splay_tree_.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ base_type::assert_valid();
+ const node_pointer p_head = base_type::m_p_head;
+ assert_special_imp(p_head);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_special_imp(const node_pointer p_nd) const
+{
+ if (p_nd == NULL)
+ return;
+
+ if (p_nd == base_type::m_p_head)
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_special);
+ assert_special_imp(p_nd->m_p_parent);
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(!p_nd->m_special);
+ assert_special_imp(p_nd->m_p_left);
+ assert_special_imp(p_nd->m_p_right);
+}
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp
new file mode 100644
index 0000000..508f586
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp
@@ -0,0 +1,157 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation class for splay_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline bool
+PB_DS_CLASS_C_DEC::
+erase(const_key_reference r_key)
+{
+ point_iterator it = find(r_key);
+ if (it == base_type::end())
+ return false;
+ erase(it);
+ return true;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+erase(iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ if (it == base_type::end())
+ return it;
+ iterator ret_it = it;
+ ++ret_it;
+ erase_node(it.m_p_nd);
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ return ret_it;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::reverse_iterator
+PB_DS_CLASS_C_DEC::
+erase(reverse_iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ if (it.m_p_nd == base_type::m_p_head)
+ return (it);
+ reverse_iterator ret_it = it;
+ ++ret_it;
+ erase_node(it.m_p_nd);
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ return ret_it;
+}
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ size_type num_ersd = 0;
+ iterator it = base_type::begin();
+ while (it != base_type::end())
+ {
+ if (pred(*it))
+ {
+ ++num_ersd;
+ it = erase(it);
+ }
+ else
+ ++it;
+ }
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return num_ersd;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase_node(node_pointer p_nd)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+ splay(p_nd);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(p_nd == this->m_p_head->m_p_parent);
+
+ node_pointer p_l = p_nd->m_p_left;
+ node_pointer p_r = p_nd->m_p_right;
+
+ base_type::update_min_max_for_erased_node(p_nd);
+ base_type::actual_erase_node(p_nd);
+ if (p_r == NULL)
+ {
+ base_type::m_p_head->m_p_parent = p_l;
+ if (p_l != NULL)
+ p_l->m_p_parent = base_type::m_p_head;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ return;
+ }
+
+ node_pointer p_target_r = leftmost(p_r);
+ _GLIBCXX_DEBUG_ASSERT(p_target_r != NULL);
+ p_r->m_p_parent = base_type::m_p_head;
+ base_type::m_p_head->m_p_parent = p_r;
+ splay(p_target_r);
+
+ _GLIBCXX_DEBUG_ONLY(p_target_r->m_p_left = NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_target_r->m_p_parent == this->m_p_head);
+ _GLIBCXX_DEBUG_ASSERT(this->m_p_head->m_p_parent == p_target_r);
+
+ p_target_r->m_p_left = p_l;
+ if (p_l != NULL)
+ p_l->m_p_parent = p_target_r;
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ apply_update(p_target_r, (node_update* )this);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+leftmost(node_pointer p_nd)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+ while (p_nd->m_p_left != NULL)
+ p_nd = p_nd->m_p_left;
+ return p_nd;
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp
new file mode 100644
index 0000000..182425a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp
@@ -0,0 +1,99 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains an implementation class for splay_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+find(const_key_reference r_key)
+{
+ node_pointer p_found = find_imp(r_key);
+ if (p_found != base_type::m_p_head)
+ splay(p_found);
+ return point_iterator(p_found);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_point_iterator
+PB_DS_CLASS_C_DEC::
+find(const_key_reference r_key) const
+{
+ const node_pointer p_found = find_imp(r_key);
+ if (p_found != base_type::m_p_head)
+ const_cast<PB_DS_CLASS_C_DEC* >(this)->splay(p_found);
+ return point_iterator(p_found);
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+find_imp(const_key_reference r_key)
+{
+ _GLIBCXX_DEBUG_ONLY(base_type::structure_only_assert_valid();)
+ node_pointer p_nd = base_type::m_p_head->m_p_parent;
+ while (p_nd != NULL)
+ if (!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), r_key))
+ {
+ if (!Cmp_Fn::operator()(r_key, PB_DS_V2F(p_nd->m_value)))
+ return p_nd;
+ p_nd = p_nd->m_p_left;
+ }
+ else
+ p_nd = p_nd->m_p_right;
+ return base_type::m_p_head;
+}
+
+PB_DS_CLASS_T_DEC
+inline const typename PB_DS_CLASS_C_DEC::node_pointer
+PB_DS_CLASS_C_DEC::
+find_imp(const_key_reference r_key) const
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ node_pointer p_nd = base_type::m_p_head->m_p_parent;
+ while (p_nd != NULL)
+ if (!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), r_key))
+ {
+ if (!Cmp_Fn::operator()(r_key, PB_DS_V2F(p_nd->m_value)))
+ return p_nd;
+ p_nd = p_nd->m_p_left;
+ }
+ else
+ p_nd = p_nd->m_p_right;
+ return base_type::m_p_head;
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/info_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/info_fn_imps.hpp
new file mode 100644
index 0000000..636b9ab
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/info_fn_imps.hpp
@@ -0,0 +1,39 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file info_fn_imps.hpp
+ * Contains an implementation.
+ */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp
new file mode 100644
index 0000000..e9ae987
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp
@@ -0,0 +1,93 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains an implementation class for splay_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline std::pair<typename PB_DS_CLASS_C_DEC::point_iterator, bool>
+PB_DS_CLASS_C_DEC::
+insert(const_reference r_value)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ std::pair<point_iterator, bool> ins_pair = insert_leaf_imp(r_value);
+ ins_pair.first.m_p_nd->m_special = false;
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ splay(ins_pair.first.m_p_nd);
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ return ins_pair;
+}
+
+PB_DS_CLASS_T_DEC
+inline std::pair<typename PB_DS_CLASS_C_DEC::point_iterator, bool>
+PB_DS_CLASS_C_DEC::
+insert_leaf_imp(const_reference r_value)
+{
+ _GLIBCXX_DEBUG_ONLY(base_type::structure_only_assert_valid();)
+ if (base_type::m_size == 0)
+ return std::make_pair(base_type::insert_imp_empty(r_value), true);
+
+ node_pointer p_nd = base_type::m_p_head->m_p_parent;
+ node_pointer p_pot = base_type::m_p_head;
+
+ while (p_nd != NULL)
+ if (!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), PB_DS_V2F(r_value)))
+ {
+ if (!Cmp_Fn::operator()(PB_DS_V2F(r_value), PB_DS_V2F(p_nd->m_value)))
+ {
+ return std::make_pair(point_iterator(p_nd), false);
+ }
+ p_pot = p_nd;
+ p_nd = p_nd->m_p_left;
+ }
+ else
+ p_nd = p_nd->m_p_right;
+
+ if (p_pot == base_type::m_p_head)
+ return std::make_pair(base_type::insert_leaf_new(r_value, base_type::m_p_head->m_p_right, false), true);
+
+ _GLIBCXX_DEBUG_ONLY(base_type::check_key_does_not_exist(PB_DS_V2F(r_value)));
+
+ p_nd = p_pot->m_p_left;
+ if (p_nd == NULL)
+ return (std::make_pair(base_type::insert_leaf_new(r_value, p_pot, true), true));
+
+ while (p_nd->m_p_right != NULL)
+ p_nd = p_nd->m_p_right;
+
+ return std::make_pair(insert_leaf_new(r_value, p_nd, false), true);
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/node.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/node.hpp
new file mode 100644
index 0000000..fbf398d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/node.hpp
@@ -0,0 +1,125 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file node.hpp
+ * Contains an implementation struct for splay_tree_'s node.
+ */
+
+#ifndef PB_DS_SPLAY_TREE_NODE_HPP
+#define PB_DS_SPLAY_TREE_NODE_HPP
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Value_Type, class Metadata, class Allocator>
+ struct splay_tree_node_
+ {
+ public:
+ typedef Value_Type value_type;
+ typedef Metadata metadata_type;
+
+ typedef
+ typename Allocator::template rebind<
+ splay_tree_node_<Value_Type, Metadata, Allocator> >::other::pointer
+ node_pointer;
+
+ typedef
+ typename Allocator::template rebind<metadata_type>::other::reference
+ metadata_reference;
+
+ typedef
+ typename Allocator::template rebind<metadata_type>::other::const_reference
+ const_metadata_reference;
+
+#ifdef PB_DS_BIN_SEARCH_TREE_TRACE_
+ void
+ trace() const
+ { std::cout << PB_DS_V2F(m_value) << "(" << m_metadata << ")"; }
+#endif
+
+ inline bool
+ special() const
+ { return m_special; }
+
+ inline const_metadata_reference
+ get_metadata() const
+ { return m_metadata; }
+
+ inline metadata_reference
+ get_metadata()
+ { return m_metadata; }
+
+ value_type m_value;
+ bool m_special;
+ node_pointer m_p_left;
+ node_pointer m_p_right;
+ node_pointer m_p_parent;
+ metadata_type m_metadata;
+ };
+
+ template<typename Value_Type, typename Allocator>
+ struct splay_tree_node_<Value_Type, null_node_metadata, Allocator>
+ {
+ public:
+ typedef Value_Type value_type;
+ typedef null_node_metadata metadata_type;
+
+ typedef
+ typename Allocator::template rebind<
+ splay_tree_node_<Value_Type, null_node_metadata, Allocator> >::other::pointer
+ node_pointer;
+
+ inline bool
+ special() const
+ { return m_special; }
+
+#ifdef PB_DS_BIN_SEARCH_TREE_TRACE_
+ void
+ trace() const
+ { std::cout << PB_DS_V2F(m_value); }
+#endif
+
+ node_pointer m_p_left;
+ node_pointer m_p_right;
+ node_pointer m_p_parent;
+ value_type m_value;
+ bool m_special;
+ };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp
new file mode 100644
index 0000000..e4f3556
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp
@@ -0,0 +1,283 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file splay_fn_imps.hpp
+ * Contains an implementation class for splay_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+splay(node_pointer p_nd)
+{
+ while (p_nd->m_p_parent != base_type::m_p_head)
+ {
+#ifdef _GLIBCXX_DEBUG
+ {
+ node_pointer p_head = base_type::m_p_head;
+ assert_special_imp(p_head);
+ }
+#endif
+
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd);)
+
+ if (p_nd->m_p_parent->m_p_parent == base_type::m_p_head)
+ {
+ base_type::rotate_parent(p_nd);
+ _GLIBCXX_DEBUG_ASSERT(p_nd == this->m_p_head->m_p_parent);
+ }
+ else
+ {
+ const node_pointer p_parent = p_nd->m_p_parent;
+ const node_pointer p_grandparent = p_parent->m_p_parent;
+
+#ifdef _GLIBCXX_DEBUG
+ const size_type total =
+ base_type::recursive_count(p_grandparent);
+ _GLIBCXX_DEBUG_ASSERT(total >= 3);
+#endif
+
+ if (p_parent->m_p_left == p_nd &&
+ p_grandparent->m_p_right == p_parent)
+ splay_zig_zag_left(p_nd, p_parent, p_grandparent);
+ else if (p_parent->m_p_right == p_nd &&
+ p_grandparent->m_p_left == p_parent)
+ splay_zig_zag_right(p_nd, p_parent, p_grandparent);
+ else if (p_parent->m_p_left == p_nd &&
+ p_grandparent->m_p_left == p_parent)
+ splay_zig_zig_left(p_nd, p_parent, p_grandparent);
+ else
+ splay_zig_zig_right(p_nd, p_parent, p_grandparent);
+ _GLIBCXX_DEBUG_ASSERT(total ==this->recursive_count(p_nd));
+ }
+
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd);)
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+splay_zig_zag_left(node_pointer p_nd, node_pointer p_parent,
+ node_pointer p_grandparent)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_parent == p_nd->m_p_parent);
+ _GLIBCXX_DEBUG_ASSERT(p_grandparent == p_parent->m_p_parent);
+
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_grandparent);)
+
+ _GLIBCXX_DEBUG_ASSERT(p_parent->m_p_left == p_nd &&
+ p_grandparent->m_p_right == p_parent);
+
+ splay_zz_start(p_nd, p_parent, p_grandparent);
+
+ node_pointer p_b = p_nd->m_p_right;
+ node_pointer p_c = p_nd->m_p_left;
+
+ p_nd->m_p_right = p_parent;
+ p_parent->m_p_parent = p_nd;
+
+ p_nd->m_p_left = p_grandparent;
+ p_grandparent->m_p_parent = p_nd;
+
+ p_parent->m_p_left = p_b;
+ if (p_b != NULL)
+ p_b->m_p_parent = p_parent;
+
+ p_grandparent->m_p_right = p_c;
+ if (p_c != NULL)
+ p_c->m_p_parent = p_grandparent;
+
+ splay_zz_end(p_nd, p_parent, p_grandparent);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+splay_zig_zag_right(node_pointer p_nd, node_pointer p_parent,
+ node_pointer p_grandparent)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_parent == p_nd->m_p_parent);
+ _GLIBCXX_DEBUG_ASSERT(p_grandparent == p_parent->m_p_parent);
+
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_grandparent);)
+
+ _GLIBCXX_DEBUG_ASSERT(p_parent->m_p_right == p_nd &&
+ p_grandparent->m_p_left == p_parent);
+
+ splay_zz_start(p_nd, p_parent, p_grandparent);
+
+ node_pointer p_b = p_nd->m_p_left;
+ node_pointer p_c = p_nd->m_p_right;
+
+ p_nd->m_p_left = p_parent;
+ p_parent->m_p_parent = p_nd;
+
+ p_nd->m_p_right = p_grandparent;
+ p_grandparent->m_p_parent = p_nd;
+
+ p_parent->m_p_right = p_b;
+ if (p_b != NULL)
+ p_b->m_p_parent = p_parent;
+
+ p_grandparent->m_p_left = p_c;
+ if (p_c != NULL)
+ p_c->m_p_parent = p_grandparent;
+
+ splay_zz_end(p_nd, p_parent, p_grandparent);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+splay_zig_zig_left(node_pointer p_nd, node_pointer p_parent,
+ node_pointer p_grandparent)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_parent == p_nd->m_p_parent);
+ _GLIBCXX_DEBUG_ASSERT(p_grandparent == p_parent->m_p_parent);
+
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_grandparent);)
+
+ _GLIBCXX_DEBUG_ASSERT(p_parent->m_p_left == p_nd &&
+ p_nd->m_p_parent->m_p_parent->m_p_left == p_nd->m_p_parent);
+
+ splay_zz_start(p_nd, p_parent, p_grandparent);
+
+ node_pointer p_b = p_nd->m_p_right;
+ node_pointer p_c = p_parent->m_p_right;
+
+ p_nd->m_p_right = p_parent;
+ p_parent->m_p_parent = p_nd;
+
+ p_parent->m_p_right = p_grandparent;
+ p_grandparent->m_p_parent = p_parent;
+
+ p_parent->m_p_left = p_b;
+ if (p_b != NULL)
+ p_b->m_p_parent = p_parent;
+
+ p_grandparent->m_p_left = p_c;
+ if (p_c != NULL)
+ p_c->m_p_parent = p_grandparent;
+
+ splay_zz_end(p_nd, p_parent, p_grandparent);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+splay_zig_zig_right(node_pointer p_nd, node_pointer p_parent,
+ node_pointer p_grandparent)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_parent == p_nd->m_p_parent);
+ _GLIBCXX_DEBUG_ASSERT(p_grandparent == p_parent->m_p_parent);
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_grandparent);)
+ _GLIBCXX_DEBUG_ASSERT(p_parent->m_p_right == p_nd &&
+ p_nd->m_p_parent->m_p_parent->m_p_right == p_nd->m_p_parent);
+
+ splay_zz_start(p_nd, p_parent, p_grandparent);
+
+ node_pointer p_b = p_nd->m_p_left;
+ node_pointer p_c = p_parent->m_p_left;
+
+ p_nd->m_p_left = p_parent;
+ p_parent->m_p_parent = p_nd;
+
+ p_parent->m_p_left = p_grandparent;
+ p_grandparent->m_p_parent = p_parent;
+
+ p_parent->m_p_right = p_b;
+ if (p_b != NULL)
+ p_b->m_p_parent = p_parent;
+
+ p_grandparent->m_p_right = p_c;
+ if (p_c != NULL)
+ p_c->m_p_parent = p_grandparent;
+
+ base_type::update_to_top(p_grandparent, (node_update* )this);
+ splay_zz_end(p_nd, p_parent, p_grandparent);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+splay_zz_start(node_pointer p_nd,
+#ifdef _GLIBCXX_DEBUG
+ node_pointer p_parent,
+#else
+ node_pointer /*p_parent*/,
+#endif
+ node_pointer p_grandparent)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_parent != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_grandparent != NULL);
+
+ const bool grandparent_head = p_grandparent->m_p_parent == base_type::m_p_head;
+
+ if (grandparent_head)
+ {
+ base_type::m_p_head->m_p_parent = base_type::m_p_head->m_p_parent;
+ p_nd->m_p_parent = base_type::m_p_head;
+ return;
+ }
+
+ node_pointer p_greatgrandparent = p_grandparent->m_p_parent;
+
+ p_nd->m_p_parent = p_greatgrandparent;
+
+ if (p_grandparent == p_greatgrandparent->m_p_left)
+ p_greatgrandparent->m_p_left = p_nd;
+ else
+ p_greatgrandparent->m_p_right = p_nd;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+splay_zz_end(node_pointer p_nd, node_pointer p_parent,
+ node_pointer p_grandparent)
+{
+ if (p_nd->m_p_parent == base_type::m_p_head)
+ base_type::m_p_head->m_p_parent = p_nd;
+
+ apply_update(p_grandparent, (node_update* )this);
+ apply_update(p_parent, (node_update* )this);
+ apply_update(p_nd, (node_update* )this);
+
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd);)
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp
new file mode 100644
index 0000000..959893e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp
@@ -0,0 +1,298 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file splay_tree_.hpp
+ * Contains an implementation class for splay_tree_.
+ */
+/*
+ * This implementation uses an idea from the SGI STL (using a "header" node
+ * which is needed for efficient iteration). Following is the SGI STL
+ * copyright.
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ */
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#ifndef PB_DS_BIN_SEARCH_TREE_HPP__DATA_TRUE_INDICATOR
+#define PB_DS_BIN_SEARCH_TREE_HPP__DATA_TRUE_INDICATOR
+#include <ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp>
+#endif
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#ifndef PB_DS_BIN_SEARCH_TREE_HPP__DATA_FALSE_INDICATOR
+#define PB_DS_BIN_SEARCH_TREE_HPP__DATA_FALSE_INDICATOR
+#include <ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp>
+#endif
+#endif
+
+#include <utility>
+#include <vector>
+#include <assert.h>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+#define PB_DS_CLASS_T_DEC \
+ template<typename Key, typename Mapped, typename Cmp_Fn, \
+ typename Node_And_It_Traits, typename Allocator>
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_CLASS_NAME splay_tree_data_
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_CLASS_NAME splay_tree_no_data_
+#endif
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_BASE_CLASS_NAME bin_search_tree_data_
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_BASE_CLASS_NAME bin_search_tree_no_data_
+#endif
+
+#define PB_DS_CLASS_C_DEC \
+ PB_DS_CLASS_NAME<Key, Mapped, Cmp_Fn, Node_And_It_Traits, Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ PB_DS_BASE_CLASS_NAME<Key, Mapped, Cmp_Fn, Node_And_It_Traits, Allocator>
+
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+#define PB_DS_V2F(X) (X).first
+#define PB_DS_V2S(X) (X).second
+#define PB_DS_EP2VP(X)& ((X)->m_value)
+#endif
+
+#ifdef PB_DS_DATA_FALSE_INDICATOR
+#define PB_DS_V2F(X) (X)
+#define PB_DS_V2S(X) Mapped_Data()
+#define PB_DS_EP2VP(X)& ((X)->m_value.first)
+#endif
+
+ // $p14y 7r33 7481.
+ template<typename Key, typename Mapped, typename Cmp_Fn,
+ typename Node_And_It_Traits, typename Allocator>
+ class PB_DS_CLASS_NAME : public PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+ typedef typename base_type::node_pointer node_pointer;
+
+ public:
+ typedef Allocator allocator_type;
+ typedef typename Allocator::size_type size_type;
+ typedef typename Allocator::difference_type difference_type;
+ typedef Cmp_Fn cmp_fn;
+ typedef typename base_type::key_type key_type;
+ typedef typename base_type::key_pointer key_pointer;
+ typedef typename base_type::const_key_pointer const_key_pointer;
+ typedef typename base_type::key_reference key_reference;
+ typedef typename base_type::const_key_reference const_key_reference;
+ typedef typename base_type::mapped_type mapped_type;
+ typedef typename base_type::mapped_pointer mapped_pointer;
+ typedef typename base_type::const_mapped_pointer const_mapped_pointer;
+ typedef typename base_type::mapped_reference mapped_reference;
+ typedef typename base_type::const_mapped_reference const_mapped_reference;
+ typedef typename base_type::value_type value_type;
+ typedef typename base_type::pointer pointer;
+ typedef typename base_type::const_pointer const_pointer;
+ typedef typename base_type::reference reference;
+ typedef typename base_type::const_reference const_reference;
+ typedef typename base_type::point_iterator point_iterator;
+ typedef typename base_type::const_iterator const_point_iterator;
+ typedef typename base_type::iterator iterator;
+ typedef typename base_type::const_iterator const_iterator;
+ typedef typename base_type::reverse_iterator reverse_iterator;
+ typedef typename base_type::const_reverse_iterator const_reverse_iterator;
+ typedef typename base_type::node_update node_update;
+
+ PB_DS_CLASS_NAME();
+
+ PB_DS_CLASS_NAME(const Cmp_Fn&);
+
+ PB_DS_CLASS_NAME(const Cmp_Fn&, const node_update&);
+
+ PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC&);
+
+ void
+ swap(PB_DS_CLASS_C_DEC&);
+
+ template<typename It>
+ void
+ copy_from_range(It, It);
+
+ void
+ initialize();
+
+ inline std::pair<point_iterator, bool>
+ insert(const_reference r_value);
+
+ inline mapped_reference
+ operator[](const_key_reference r_key)
+ {
+#ifdef PB_DS_DATA_TRUE_INDICATOR
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ std::pair<point_iterator, bool> ins_pair =
+ insert_leaf_imp(value_type(r_key, mapped_type()));
+
+ ins_pair.first.m_p_nd->m_special = false;
+ _GLIBCXX_DEBUG_ONLY(base_type::assert_valid());
+ splay(ins_pair.first.m_p_nd);
+ _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
+ return ins_pair.first.m_p_nd->m_value.second;
+#else
+ insert(r_key);
+ return base_type::s_null_mapped;
+#endif
+ }
+
+ inline point_iterator
+ find(const_key_reference);
+
+ inline const_point_iterator
+ find(const_key_reference) const;
+
+ inline bool
+ erase(const_key_reference);
+
+ inline iterator
+ erase(iterator it);
+
+ inline reverse_iterator
+ erase(reverse_iterator);
+
+ template<typename Pred>
+ inline size_type
+ erase_if(Pred);
+
+ void
+ join(PB_DS_CLASS_C_DEC&);
+
+ void
+ split(const_key_reference, PB_DS_CLASS_C_DEC&);
+
+ private:
+ inline std::pair<point_iterator, bool>
+ insert_leaf_imp(const_reference);
+
+ inline node_pointer
+ find_imp(const_key_reference);
+
+ inline const node_pointer
+ find_imp(const_key_reference) const;
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+
+ void
+ assert_special_imp(const node_pointer) const;
+#endif
+
+ void
+ splay(node_pointer);
+
+ inline void
+ splay_zig_zag_left(node_pointer, node_pointer, node_pointer);
+
+ inline void
+ splay_zig_zag_right(node_pointer, node_pointer, node_pointer);
+
+ inline void
+ splay_zig_zig_left(node_pointer, node_pointer, node_pointer);
+
+ inline void
+ splay_zig_zig_right(node_pointer, node_pointer, node_pointer);
+
+ inline void
+ splay_zz_start(node_pointer, node_pointer, node_pointer);
+
+ inline void
+ splay_zz_end(node_pointer, node_pointer, node_pointer);
+
+ inline node_pointer
+ leftmost(node_pointer);
+
+ void
+ erase_node(node_pointer);
+ };
+
+#include <ext/pb_ds/detail/splay_tree_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp>
+#include <ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp>
+#include <ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_CLASS_NAME
+#undef PB_DS_BASE_CLASS_NAME
+#undef PB_DS_BASE_C_DEC
+#undef PB_DS_V2F
+#undef PB_DS_EP2VP
+#undef PB_DS_V2S
+ } // namespace detail
+} // namespace __gnu_pbds
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp
new file mode 100644
index 0000000..7f0b2cb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp
@@ -0,0 +1,112 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_join_fn_imps.hpp
+ * Contains an implementation class for splay_tree_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+join(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ if (base_type::join_prep(other) == false)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ return;
+ }
+
+ node_pointer p_target_r = other.leftmost(other.m_p_head);
+ _GLIBCXX_DEBUG_ASSERT(p_target_r != NULL);
+ other.splay(p_target_r);
+
+ _GLIBCXX_DEBUG_ASSERT(p_target_r == other.m_p_head->m_p_parent);
+ _GLIBCXX_DEBUG_ASSERT(p_target_r->m_p_left == NULL);
+
+ p_target_r->m_p_left = base_type::m_p_head->m_p_parent;
+
+ _GLIBCXX_DEBUG_ASSERT(p_target_r->m_p_left != NULL);
+ p_target_r->m_p_left->m_p_parent = p_target_r;
+
+ base_type::m_p_head->m_p_parent = p_target_r;
+ p_target_r->m_p_parent = base_type::m_p_head;
+ apply_update(p_target_r, (node_update* )this);
+
+ base_type::join_finish(other);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+split(const_key_reference r_key, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid());
+
+ if (base_type::split_prep(r_key, other) == false)
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid());
+ return;
+ }
+
+ node_pointer p_upper_bound = upper_bound(r_key).m_p_nd;
+ _GLIBCXX_DEBUG_ASSERT(p_upper_bound != NULL);
+
+ splay(p_upper_bound);
+ _GLIBCXX_DEBUG_ASSERT(p_upper_bound->m_p_parent == this->m_p_head);
+
+ node_pointer p_new_root = p_upper_bound->m_p_left;
+ _GLIBCXX_DEBUG_ASSERT(p_new_root != NULL);
+
+ base_type::m_p_head->m_p_parent = p_new_root;
+ p_new_root->m_p_parent = base_type::m_p_head;
+ other.m_p_head->m_p_parent = p_upper_bound;
+ p_upper_bound->m_p_parent = other.m_p_head;
+ p_upper_bound->m_p_left = NULL;
+ apply_update(p_upper_bound, (node_update* )this);
+ base_type::split_finish(other);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid());
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid());
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/traits.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/traits.hpp
new file mode 100644
index 0000000..cfedc35
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/splay_tree_/traits.hpp
@@ -0,0 +1,113 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file traits.hpp
+ * Contains an implementation for splay_tree_.
+ */
+
+#ifndef PB_DS_SPLAY_TREE_NODE_AND_IT_TRAITS_HPP
+#define PB_DS_SPLAY_TREE_NODE_AND_IT_TRAITS_HPP
+
+#include <ext/pb_ds/detail/splay_tree_/node.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Key,
+ typename Mapped,
+ class Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn_,
+ class Allocator_>
+ class Node_Update,
+ class Allocator>
+ struct tree_traits<
+ Key,
+ Mapped,
+ Cmp_Fn,
+ Node_Update,
+ splay_tree_tag,
+ Allocator> : public bin_search_tree_traits<
+ Key,
+ Mapped,
+ Cmp_Fn,
+ Node_Update,
+ splay_tree_node_<
+ typename types_traits<
+ Key,
+ Mapped,
+ Allocator,
+ false>::value_type,
+ typename tree_node_metadata_selector<
+ Key,
+ Mapped,
+ Cmp_Fn,
+ Node_Update,
+ Allocator>::type,
+ Allocator>,
+ Allocator>
+ { };
+
+ template<typename Key,
+ class Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn_,
+ class Allocator_>
+ class Node_Update,
+ class Allocator>
+ struct tree_traits<Key, null_mapped_type, Cmp_Fn, Node_Update,
+ splay_tree_tag, Allocator>
+ : public bin_search_tree_traits<Key, null_mapped_type, Cmp_Fn,
+ Node_Update,
+ splay_tree_node_<typename types_traits<Key, null_mapped_type, Allocator, false>::value_type,
+ typename tree_node_metadata_selector<
+ Key,
+ null_mapped_type,
+ Cmp_Fn,
+ Node_Update,
+ Allocator>::type,
+ Allocator>,
+ Allocator>
+ { };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_SPLAY_TREE_NODE_AND_IT_TRAITS_HPP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/standard_policies.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/standard_policies.hpp
new file mode 100644
index 0000000..cfbfbb0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/standard_policies.hpp
@@ -0,0 +1,136 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file standard_policies.hpp
+ * Contains standard policies for containers.
+ */
+
+#ifndef PB_DS_STANDARD_POLICIES_HPP
+#define PB_DS_STANDARD_POLICIES_HPP
+
+#include <memory>
+#include <ext/pb_ds/hash_policy.hpp>
+#include <ext/pb_ds/list_update_policy.hpp>
+#include <ext/pb_ds/tree_policy.hpp>
+#include <ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp>
+#include <ext/pb_ds/trie_policy.hpp>
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <tr1/functional>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Key>
+ struct default_hash_fn
+ {
+ typedef std::tr1::hash<Key> type;
+ };
+
+ template<typename Key>
+ struct default_eq_fn
+ {
+ typedef std::equal_to<Key> type;
+ };
+
+ enum
+ {
+ default_store_hash = false
+ };
+
+ struct default_comb_hash_fn
+ {
+ typedef __gnu_pbds::direct_mask_range_hashing<> type;
+ };
+
+ template<typename Comb_Hash_Fn>
+ struct default_resize_policy
+ {
+ private:
+ typedef typename Comb_Hash_Fn::size_type size_type;
+
+ typedef __gnu_pbds::direct_mask_range_hashing<size_type> default_fn;
+ typedef is_same<default_fn, Comb_Hash_Fn> same_type;
+ typedef __gnu_pbds::hash_exponential_size_policy<size_type> iftrue;
+ typedef __gnu_pbds::hash_prime_size_policy iffalse;
+ typedef __conditional_type<same_type::value, iftrue, iffalse> cond_type;
+ typedef typename cond_type::__type size_policy_type;
+
+ typedef __gnu_pbds::hash_load_check_resize_trigger<false, size_type> trigger;
+
+ public:
+ typedef __gnu_pbds::hash_standard_resize_policy<size_policy_type, trigger, false, size_type> type;
+ };
+
+ struct default_update_policy
+ {
+ typedef __gnu_pbds::move_to_front_lu_policy<> type;
+ };
+
+ template<typename Comb_Probe_Fn>
+ struct default_probe_fn
+ {
+ private:
+ typedef typename Comb_Probe_Fn::size_type size_type;
+
+ typedef __gnu_pbds::direct_mask_range_hashing<size_type> default_fn;
+ typedef is_same<default_fn, Comb_Probe_Fn> same_type;
+ typedef __gnu_pbds::linear_probe_fn<size_type> iftrue;
+ typedef __gnu_pbds::quadratic_probe_fn<size_type> iffalse;
+ typedef __conditional_type<same_type::value, iftrue, iffalse> cond_type;
+
+ public:
+ typedef typename cond_type::__type type;
+ };
+
+ template<typename Key>
+ struct default_trie_e_access_traits;
+
+ template<typename Char, class Char_Traits>
+ struct default_trie_e_access_traits<std::basic_string<Char, Char_Traits, std::allocator<char> > >
+ {
+ private:
+ typedef std::basic_string<Char, Char_Traits, std::allocator<char> > string_type;
+
+ public:
+ typedef __gnu_pbds::string_trie_e_access_traits<string_type> type;
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_STANDARD_POLICIES_HPP
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp
new file mode 100644
index 0000000..4d2c45c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp
@@ -0,0 +1,106 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file constructors_destructor_fn_imps.hpp
+ * Contains an implementation for thin_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename It>
+void
+PB_DS_CLASS_C_DEC::
+copy_from_range(It first_it, It last_it)
+{
+ while (first_it != last_it)
+ push(*(first_it++));
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+thin_heap_() :
+ m_p_max(NULL)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+thin_heap_(const Cmp_Fn& r_cmp_fn) :
+ PB_DS_BASE_C_DEC(r_cmp_fn),
+ m_p_max(NULL)
+{
+ initialize();
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+thin_heap_(const PB_DS_CLASS_C_DEC& other) :
+ PB_DS_BASE_C_DEC(other)
+{
+ initialize();
+ m_p_max = base_type::m_p_root;
+ for (node_pointer p_nd = base_type::m_p_root; p_nd != NULL; p_nd = p_nd->m_p_next_sibling)
+ if (Cmp_Fn::operator()(m_p_max->m_value, p_nd->m_value))
+ m_p_max = p_nd;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+swap(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ base_type::swap(other);
+ std::swap(m_p_max, other.m_p_max);
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~thin_heap_()
+{ }
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+initialize()
+{ std::fill(m_a_aux, m_a_aux + max_rank, static_cast<node_pointer>(NULL)); }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp
new file mode 100644
index 0000000..f7abe35
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp
@@ -0,0 +1,112 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file debug_fn_imps.hpp
+ * Contains an implementation for thin_heap_.
+ */
+
+#ifdef _GLIBCXX_DEBUG
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_valid() const
+{
+ base_type::assert_valid();
+ assert_node_consistent(base_type::m_p_root, true);
+ assert_max();
+ assert_aux_null();
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_aux_null() const
+{
+ for (size_type i = 0; i < max_rank; ++i)
+ _GLIBCXX_DEBUG_ASSERT(m_a_aux[i] == NULL);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_max() const
+{
+ if (m_p_max == NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::empty());
+ return;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+ _GLIBCXX_DEBUG_ASSERT(base_type::parent(m_p_max) == NULL);
+ _GLIBCXX_DEBUG_ASSERT(m_p_max->m_p_prev_or_parent == NULL);
+ for (const_iterator it = base_type::begin(); it != base_type::end(); ++it)
+ _GLIBCXX_DEBUG_ASSERT(!Cmp_Fn::operator()(m_p_max->m_value, it.m_p_nd->m_value));
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+assert_node_consistent(const_node_pointer p_nd, bool root) const
+{
+ base_type::assert_node_consistent(p_nd, root);
+ if (p_nd == NULL)
+ return;
+
+ assert_node_consistent(p_nd->m_p_next_sibling, root);
+ assert_node_consistent(p_nd->m_p_l_child, false);
+ if (!root)
+ {
+ if (p_nd->m_metadata == 0)
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_next_sibling == NULL);
+ else
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata == p_nd->m_p_next_sibling->m_metadata + 1);
+ }
+
+ if (p_nd->m_p_l_child != NULL)
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_l_child->m_metadata + 1 == base_type::degree(p_nd));
+
+ const bool unmarked_valid =(p_nd->m_p_l_child == NULL&& p_nd->m_metadata == 0) ||(p_nd->m_p_l_child != NULL&& p_nd->m_metadata == p_nd->m_p_l_child->m_metadata + 1);
+
+ const bool marked_valid =(p_nd->m_p_l_child == NULL&& p_nd->m_metadata == 1) ||(p_nd->m_p_l_child != NULL&& p_nd->m_metadata == p_nd->m_p_l_child->m_metadata + 2);
+
+ _GLIBCXX_DEBUG_ASSERT(unmarked_valid || marked_valid);
+ if (root)
+ _GLIBCXX_DEBUG_ASSERT(unmarked_valid);
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp
new file mode 100644
index 0000000..69afcd3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp
@@ -0,0 +1,296 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file erase_fn_imps.hpp
+ * Contains an implementation for thin_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+pop()
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+
+ _GLIBCXX_DEBUG_ASSERT(m_p_max != NULL);
+
+ node_pointer p_nd = m_p_max;
+
+ remove_max_node();
+
+ base_type::actual_erase_node(p_nd);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+remove_max_node()
+{
+ to_aux_except_max();
+
+ make_from_aux();
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+to_aux_except_max()
+{
+ node_pointer p_add = base_type::m_p_root;
+
+ while (p_add != m_p_max)
+ {
+ node_pointer p_next_add = p_add->m_p_next_sibling;
+
+ add_to_aux(p_add);
+
+ p_add = p_next_add;
+ }
+
+ p_add = m_p_max->m_p_l_child;
+
+ while (p_add != NULL)
+ {
+ node_pointer p_next_add = p_add->m_p_next_sibling;
+
+ p_add->m_metadata = p_add->m_p_l_child == NULL?
+ 0 :
+ p_add->m_p_l_child->m_metadata + 1;
+
+ add_to_aux(p_add);
+
+ p_add = p_next_add;
+ }
+
+ p_add = m_p_max->m_p_next_sibling;
+
+ while (p_add != NULL)
+ {
+ node_pointer p_next_add = p_add->m_p_next_sibling;
+
+ add_to_aux(p_add);
+
+ p_add = p_next_add;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+add_to_aux(node_pointer p_nd)
+{
+ size_type r = p_nd->m_metadata;
+
+ while (m_a_aux[r] != NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata < rank_bound());
+
+ if (Cmp_Fn::operator()(m_a_aux[r]->m_value, p_nd->m_value))
+ make_child_of(m_a_aux[r], p_nd);
+ else
+ {
+ make_child_of(p_nd, m_a_aux[r]);
+
+ p_nd = m_a_aux[r];
+ }
+
+ m_a_aux[r] = NULL;
+
+ ++r;
+ }
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata < rank_bound());
+
+ m_a_aux[r] = p_nd;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+make_child_of(node_pointer p_nd, node_pointer p_new_parent)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata == p_new_parent->m_metadata);
+ _GLIBCXX_DEBUG_ASSERT(m_a_aux[p_nd->m_metadata] == p_nd ||
+ m_a_aux[p_nd->m_metadata] == p_new_parent);
+
+ ++p_new_parent->m_metadata;
+
+ base_type::make_child_of(p_nd, p_new_parent);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+make_from_aux()
+{
+ base_type::m_p_root = m_p_max = NULL;
+
+ const size_type rnk_bnd = rank_bound();
+
+ size_type i = 0;
+
+ while (i < rnk_bnd)
+ {
+ if (m_a_aux[i] != NULL)
+ {
+ make_root_and_link(m_a_aux[i]);
+
+ m_a_aux[i] = NULL;
+ }
+
+ ++i;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(assert_aux_null();)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+remove_node(node_pointer p_nd)
+{
+ node_pointer p_parent = p_nd;
+ while (base_type::parent(p_parent) != NULL)
+ p_parent = base_type::parent(p_parent);
+
+ base_type::bubble_to_top(p_nd);
+
+ m_p_max = p_nd;
+
+ node_pointer p_fix = base_type::m_p_root;
+ while (p_fix != NULL&& p_fix->m_p_next_sibling != p_parent)
+ p_fix = p_fix->m_p_next_sibling;
+
+ if (p_fix != NULL)
+ p_fix->m_p_next_sibling = p_nd;
+
+ remove_max_node();
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+clear()
+{
+ base_type::clear();
+
+ m_p_max = NULL;
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+erase(point_iterator it)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+
+ node_pointer p_nd = it.m_p_nd;
+
+ remove_node(p_nd);
+
+ base_type::actual_erase_node(p_nd);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+erase_if(Pred pred)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ if (base_type::empty())
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ return 0;
+ }
+
+ base_type::to_linked_list();
+
+ node_pointer p_out = base_type::prune(pred);
+
+ size_type ersd = 0;
+
+ while (p_out != NULL)
+ {
+ ++ersd;
+
+ node_pointer p_next = p_out->m_p_next_sibling;
+
+ base_type::actual_erase_node(p_out);
+
+ p_out = p_next;
+ }
+
+ node_pointer p_cur = base_type::m_p_root;
+
+ m_p_max = base_type::m_p_root = NULL;
+
+ while (p_cur != NULL)
+ {
+ node_pointer p_next = p_cur->m_p_next_sibling;
+
+ make_root_and_link(p_cur);
+
+ p_cur = p_next;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ return ersd;
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+rank_bound()
+{
+ const std::size_t* const p_upper =
+ std::upper_bound( g_a_rank_bounds, g_a_rank_bounds + num_distinct_rank_bounds, base_type::m_size);
+
+ if (p_upper == g_a_rank_bounds + num_distinct_rank_bounds)
+ return max_rank;
+
+ return (p_upper - g_a_rank_bounds);
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp
new file mode 100644
index 0000000..52407e6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp
@@ -0,0 +1,51 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file find_fn_imps.hpp
+ * Contains an implementation for thin_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_reference
+PB_DS_CLASS_C_DEC::
+top() const
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ASSERT(!base_type::empty());
+
+ _GLIBCXX_DEBUG_ASSERT(m_p_max != NULL);
+ return m_p_max->m_value;
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp
new file mode 100644
index 0000000..7a6952f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp
@@ -0,0 +1,326 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file insert_fn_imps.hpp
+ * Contains an implementation for thin_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::point_iterator
+PB_DS_CLASS_C_DEC::
+push(const_reference r_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ node_pointer p_nd = base_type::get_new_node_for_insert(r_val);
+
+ p_nd->m_metadata = 0;
+
+ p_nd->m_p_prev_or_parent = p_nd->m_p_l_child = NULL;
+
+ if (base_type::m_p_root == NULL)
+ {
+ p_nd->m_p_next_sibling = NULL;
+
+ m_p_max = base_type::m_p_root = p_nd;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ return point_iterator(p_nd);
+ }
+
+ p_nd->m_p_next_sibling = base_type::m_p_root;
+
+ base_type::m_p_root->m_p_prev_or_parent = NULL;
+
+ base_type::m_p_root = p_nd;
+
+ update_max(p_nd);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ return point_iterator(p_nd);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+make_root(node_pointer p_nd)
+{
+ p_nd->m_metadata =
+ p_nd->m_p_l_child == NULL?
+ 0 :
+ 1 + p_nd->m_p_l_child->m_metadata;
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+make_root_and_link(node_pointer p_nd)
+{
+ make_root(p_nd);
+
+ p_nd->m_p_prev_or_parent = NULL;
+
+ p_nd->m_p_next_sibling = base_type::m_p_root;
+
+ if (base_type::m_p_root != NULL)
+ base_type::m_p_root->m_p_prev_or_parent = NULL;
+
+ base_type::m_p_root = p_nd;
+
+ update_max(p_nd);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+fix(node_pointer p_y)
+{
+ while (true)
+ {
+ if (p_y->m_p_prev_or_parent == NULL)
+ {
+ fix_root(p_y);
+
+ return;
+ }
+ else if (p_y->m_metadata == 1&& p_y->m_p_next_sibling == NULL)
+ {
+ if (p_y->m_p_l_child != NULL)
+ {
+ fix_sibling_rank_1_unmarked(p_y);
+
+ return;
+ }
+
+ fix_sibling_rank_1_marked(p_y);
+
+ p_y = p_y->m_p_prev_or_parent;
+ }
+ else if (p_y->m_metadata > p_y->m_p_next_sibling->m_metadata + 1)
+ {
+ _GLIBCXX_DEBUG_ASSERT(p_y->m_p_l_child != NULL);
+
+ if (p_y->m_metadata != p_y->m_p_l_child->m_metadata + 2)
+ {
+ fix_sibling_general_unmarked(p_y);
+
+ return;
+ }
+
+ fix_sibling_general_marked(p_y);
+
+ p_y = p_y->m_p_prev_or_parent;
+ }
+ else if ((p_y->m_p_l_child == NULL&&
+ p_y->m_metadata == 2) ||(p_y->m_p_l_child != NULL&&
+ p_y->m_metadata == p_y->m_p_l_child->m_metadata + 3))
+ {
+ node_pointer p_z = p_y->m_p_prev_or_parent;
+
+ fix_child(p_y);
+
+ p_y = p_z;
+ }
+ else
+ return;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+fix_root(node_pointer p_y)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent == NULL);
+
+ make_root(p_y);
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_y, true);)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+fix_sibling_rank_1_unmarked(node_pointer p_y)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent != NULL);
+
+ _GLIBCXX_DEBUG_ONLY(node_pointer p_w = p_y->m_p_l_child;)
+ _GLIBCXX_DEBUG_ASSERT(p_w != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_w->m_p_next_sibling == NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_y->m_p_next_sibling == NULL);
+
+ p_y->m_p_next_sibling = p_y->m_p_l_child;
+
+ p_y->m_p_next_sibling->m_p_prev_or_parent = p_y;
+
+ p_y->m_p_l_child = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_y, false);)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+fix_sibling_rank_1_marked(node_pointer p_y)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_y->m_p_l_child == NULL);
+
+ p_y->m_metadata = 0;
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_y, false);)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+fix_sibling_general_unmarked(node_pointer p_y)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent != NULL);
+
+ node_pointer p_w = p_y->m_p_l_child;
+ _GLIBCXX_DEBUG_ASSERT(p_w != NULL);
+ _GLIBCXX_DEBUG_ASSERT(p_w->m_p_next_sibling != NULL);
+
+ p_y->m_p_l_child = p_w->m_p_next_sibling;
+ p_w->m_p_next_sibling->m_p_prev_or_parent = p_y;
+
+ p_w->m_p_next_sibling = p_y->m_p_next_sibling;
+ _GLIBCXX_DEBUG_ASSERT(p_w->m_p_next_sibling != NULL);
+ p_w->m_p_next_sibling->m_p_prev_or_parent = p_w;
+
+ p_y->m_p_next_sibling = p_w;
+ p_w->m_p_prev_or_parent = p_y;
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_y, false);)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+fix_sibling_general_marked(node_pointer p_y)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent != NULL);
+
+ --p_y->m_metadata;
+
+ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_y, false);)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+fix_child(node_pointer p_y)
+{
+ _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent != NULL);
+
+ if (p_y->m_p_next_sibling != NULL)
+ p_y->m_p_next_sibling->m_p_prev_or_parent = p_y->m_p_prev_or_parent;
+
+ if (p_y->m_p_prev_or_parent->m_p_l_child == p_y)
+ p_y->m_p_prev_or_parent->m_p_l_child = p_y->m_p_next_sibling;
+ else
+ p_y->m_p_prev_or_parent->m_p_next_sibling = p_y->m_p_next_sibling;
+
+ make_root_and_link(p_y);
+}
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+modify(point_iterator it, const_reference r_new_val)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ node_pointer p_nd = it.m_p_nd;
+
+ _GLIBCXX_DEBUG_ASSERT(p_nd != NULL);
+
+ const bool smaller = Cmp_Fn::operator()(r_new_val, p_nd->m_value);
+
+ p_nd->m_value = r_new_val;
+
+ if (smaller)
+ {
+ remove_node(p_nd);
+
+ p_nd->m_p_l_child = NULL;
+
+ make_root_and_link(p_nd);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ return;
+ }
+
+ if (p_nd->m_p_prev_or_parent == NULL)
+ {
+ update_max(p_nd);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+
+ return;
+ }
+
+ node_pointer p_y = p_nd->m_p_prev_or_parent;
+ _GLIBCXX_DEBUG_ASSERT(p_y != NULL);
+
+ if (p_nd->m_p_next_sibling != NULL)
+ p_nd->m_p_next_sibling->m_p_prev_or_parent = p_y;
+
+ if (p_y->m_p_l_child == p_nd)
+ p_y->m_p_l_child = p_nd->m_p_next_sibling;
+ else
+ p_y->m_p_next_sibling = p_nd->m_p_next_sibling;
+
+ fix(p_y);
+
+ make_root_and_link(p_nd);
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+update_max(node_pointer p_nd)
+{
+ if (m_p_max == NULL || Cmp_Fn::operator()(m_p_max->m_value, p_nd->m_value))
+ m_p_max = p_nd;
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp
new file mode 100644
index 0000000..6acb7bd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp
@@ -0,0 +1,126 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file split_join_fn_imps.hpp
+ * Contains an implementation for thin_heap_.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename Pred>
+void
+PB_DS_CLASS_C_DEC::
+split(Pred pred, PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ other.clear();
+
+ if (base_type::empty())
+ {
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ return;
+ }
+
+ base_type::to_linked_list();
+
+ node_pointer p_out = base_type::prune(pred);
+
+ while (p_out != NULL)
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_size > 0);
+ --base_type::m_size;
+
+ ++other.m_size;
+
+ node_pointer p_next = p_out->m_p_next_sibling;
+
+ other.make_root_and_link(p_out);
+
+ p_out = p_next;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ node_pointer p_cur = base_type::m_p_root;
+
+ m_p_max = NULL;
+
+ base_type::m_p_root = NULL;
+
+ while (p_cur != NULL)
+ {
+ node_pointer p_next = p_cur->m_p_next_sibling;
+
+ make_root_and_link(p_cur);
+
+ p_cur = p_next;
+ }
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ }
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+join(PB_DS_CLASS_C_DEC& other)
+{
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+
+ node_pointer p_other = other.m_p_root;
+
+ while (p_other != NULL)
+ {
+ node_pointer p_next = p_other->m_p_next_sibling;
+
+ make_root_and_link(p_other);
+
+ p_other = p_next;
+ }
+
+ base_type::m_size += other.m_size;
+
+ other.m_p_root = NULL;
+ other.m_size = 0;
+ other.m_p_max = NULL;
+
+ _GLIBCXX_DEBUG_ONLY(assert_valid();)
+ _GLIBCXX_DEBUG_ONLY(other.assert_valid();)
+ }
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp
new file mode 100644
index 0000000..88fa04b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp
@@ -0,0 +1,351 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file thin_heap_.hpp
+ * Contains an implementation class for a thin heap.
+ */
+
+#ifndef PB_DS_THIN_HEAP_HPP
+#define PB_DS_THIN_HEAP_HPP
+
+/*
+ * Thin heaps.
+ * Tarjan and Kaplan.
+ */
+
+#include <algorithm>
+#include <ext/pb_ds/detail/cond_dealtor.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp>
+#include <ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp>
+#include <debug/debug.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ thin_heap_<Value_Type, Cmp_Fn, Allocator>
+
+#ifdef _GLIBCXX_DEBUG
+#define PB_DS_BASE_C_DEC \
+ left_child_next_sibling_heap_<Value_Type, Cmp_Fn, \
+ typename Allocator::size_type, Allocator, true>
+#else
+#define PB_DS_BASE_C_DEC \
+ left_child_next_sibling_heap_<Value_Type, Cmp_Fn, \
+ typename Allocator::size_type, Allocator>
+#endif
+
+ /**
+ * class description = "t|-|i|\| h34p">
+ **/
+ template<typename Value_Type, class Cmp_Fn, class Allocator>
+ class thin_heap_ : public PB_DS_BASE_C_DEC
+ {
+
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ protected:
+ typedef typename base_type::node node;
+
+ typedef typename base_type::node_pointer node_pointer;
+
+ typedef typename base_type::const_node_pointer const_node_pointer;
+
+ public:
+
+ typedef typename Allocator::size_type size_type;
+
+ typedef typename Allocator::difference_type difference_type;
+
+ typedef Value_Type value_type;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::pointer
+ pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_pointer
+ const_pointer;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::reference
+ reference;
+
+ typedef
+ typename Allocator::template rebind<
+ value_type>::other::const_reference
+ const_reference;
+
+ typedef
+ typename PB_DS_BASE_C_DEC::const_point_iterator
+ const_point_iterator;
+
+ typedef typename PB_DS_BASE_C_DEC::point_iterator point_iterator;
+
+ typedef typename PB_DS_BASE_C_DEC::const_iterator const_iterator;
+
+ typedef typename PB_DS_BASE_C_DEC::iterator iterator;
+
+ typedef Cmp_Fn cmp_fn;
+
+ typedef Allocator allocator_type;
+
+ public:
+
+ inline point_iterator
+ push(const_reference r_val);
+
+ void
+ modify(point_iterator it, const_reference r_new_val);
+
+ inline const_reference
+ top() const;
+
+ void
+ pop();
+
+ void
+ erase(point_iterator it);
+
+ inline void
+ clear();
+
+ template<typename Pred>
+ size_type
+ erase_if(Pred pred);
+
+ template<typename Pred>
+ void
+ split(Pred pred, PB_DS_CLASS_C_DEC& other);
+
+ void
+ join(PB_DS_CLASS_C_DEC& other);
+
+ protected:
+
+ thin_heap_();
+
+ thin_heap_(const Cmp_Fn& r_cmp_fn);
+
+ thin_heap_(const PB_DS_CLASS_C_DEC& other);
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ ~thin_heap_();
+
+ template<typename It>
+ void
+ copy_from_range(It first_it, It last_it);
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+
+ void
+ assert_max() const;
+#endif
+
+#ifdef PB_DS_THIN_HEAP_TRACE_
+ void
+ trace() const;
+#endif
+
+ private:
+ enum
+ {
+ max_rank = (sizeof(size_type) << 4) + 2
+ };
+
+ private:
+
+ void
+ initialize();
+
+ inline void
+ update_max(node_pointer p_nd);
+
+ inline void
+ fix(node_pointer p_nd);
+
+ inline void
+ fix_root(node_pointer p_y);
+
+ inline void
+ fix_sibling_rank_1_unmarked(node_pointer p_y);
+
+ inline void
+ fix_sibling_rank_1_marked(node_pointer p_y);
+
+ inline void
+ fix_sibling_general_unmarked(node_pointer p_y);
+
+ inline void
+ fix_sibling_general_marked(node_pointer p_y);
+
+ inline void
+ fix_child(node_pointer p_y);
+
+ inline static void
+ make_root(node_pointer p_nd);
+
+ inline void
+ make_root_and_link(node_pointer p_nd);
+
+ inline void
+ remove_max_node();
+
+ void
+ to_aux_except_max();
+
+ inline void
+ add_to_aux(node_pointer p_nd);
+
+ inline void
+ make_from_aux();
+
+ inline size_type
+ rank_bound();
+
+ inline void
+ make_child_of(node_pointer p_nd, node_pointer p_new_parent);
+
+ inline void
+ remove_node(node_pointer p_nd);
+
+ inline node_pointer
+ join(node_pointer p_lhs, node_pointer p_rhs) const;
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_node_consistent(const_node_pointer p_nd, bool root) const;
+
+ void
+ assert_aux_null() const;
+#endif
+
+ private:
+ node_pointer m_p_max;
+
+ node_pointer m_a_aux[max_rank];
+ };
+
+ enum
+ {
+ num_distinct_rank_bounds = 48
+ };
+
+ // Taken from the SGI implementation; acknowledged in the docs.
+ static const std::size_t g_a_rank_bounds[num_distinct_rank_bounds] =
+ {
+ /* Dealing cards... */
+ /* 0 */ 0ul,
+ /* 1 */ 1ul,
+ /* 2 */ 1ul,
+ /* 3 */ 2ul,
+ /* 4 */ 4ul,
+ /* 5 */ 6ul,
+ /* 6 */ 11ul,
+ /* 7 */ 17ul,
+ /* 8 */ 29ul,
+ /* 9 */ 46ul,
+ /* 10 */ 76ul,
+ /* 11 */ 122ul,
+ /* 12 */ 199ul,
+ /* 13 */ 321ul,
+ /* 14 */ 521ul,
+ /* 15 */ 842ul,
+ /* 16 */ 1364ul,
+ /* 17 */ 2206ul,
+ /* 18 */ 3571ul,
+ /* 19 */ 5777ul,
+ /* 20 */ 9349ul,
+ /* 21 */ 15126ul,
+ /* 22 */ 24476ul,
+ /* 23 */ 39602ul,
+ /* 24 */ 64079ul,
+ /* 25 */ 103681ul,
+ /* 26 */ 167761ul,
+ /* 27 */ 271442ul,
+ /* 28 */ 439204ul,
+ /* 29 */ 710646ul,
+ /* 30 */ 1149851ul,
+ /* 31 */ 1860497ul,
+ /* 32 */ 3010349ul,
+ /* 33 */ 4870846ul,
+ /* 34 */ 7881196ul,
+ /* 35 */ 12752042ul,
+ /* 36 */ 20633239ul,
+ /* 37 */ 33385282ul,
+ /* 38 */ 54018521ul,
+ /* 39 */ 87403803ul,
+ /* 40 */ 141422324ul,
+ /* 41 */ 228826127ul,
+ /* 42 */ 370248451ul,
+ /* 43 */ 599074578ul,
+ /* 44 */ 969323029ul,
+ /* 45 */ 1568397607ul,
+ /* 46 */ 2537720636ul,
+ /* 47 */ 4106118243ul
+ /* Pot's good, let's play */
+ };
+
+#include <ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp>
+#include <ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp>
+#include <ext/pb_ds/detail/thin_heap_/trace_fn_imps.hpp>
+#include <ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp>
+#include <ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp>
+#include <ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp>
+#include <ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_BASE_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/trace_fn_imps.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/trace_fn_imps.hpp
new file mode 100644
index 0000000..fc309d5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/thin_heap_/trace_fn_imps.hpp
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trace_fn_imps.hpp
+ * Contains an implementation class for left_child_next_sibling_heap_.
+ */
+
+#ifdef PB_DS_THIN_HEAP_TRACE_
+
+PB_DS_CLASS_T_DEC
+void
+PB_DS_CLASS_C_DEC::
+trace() const
+{
+ std::cerr << std::endl;
+
+ std::cerr << "m_p_max " << m_p_max << std::endl;
+
+ base_type::trace();
+}
+
+#endif // #ifdef PB_DS_THIN_HEAP_TRACE_
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp
new file mode 100644
index 0000000..c182886
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp
@@ -0,0 +1,116 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file node_metadata_selector.hpp
+ * Contains an implementation class for trees.
+ */
+
+#ifndef PB_DS_TREE_NODE_METADATA_SELECTOR_HPP
+#define PB_DS_TREE_NODE_METADATA_SELECTOR_HPP
+
+#include <ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp>
+#include <ext/pb_ds/detail/types_traits.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Node_Update, bool Null>
+ struct tree_metadata_helper
+ {
+ typedef typename Node_Update::metadata_type type;
+ };
+
+ template<typename Node_Update>
+ struct tree_metadata_helper<
+ Node_Update,
+ true>
+ {
+ typedef null_node_metadata type;
+ };
+
+ template<typename Key,
+ typename Data,
+ class Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Const_Iterator,
+ class Cmp_Fn_,
+ class Allocator_>
+ class Node_Update,
+ class Allocator>
+ struct tree_node_metadata_selector
+ {
+ private:
+ typedef
+ dumconst_node_iterator<
+ Key,
+ Data,
+ Allocator>
+ dumconst_node_it;
+
+ enum
+ {
+ null_update =
+ is_same<
+ Node_Update<
+ dumconst_node_it,
+ dumconst_node_it,
+ Cmp_Fn,
+ Allocator>,
+ null_tree_node_update<
+ dumconst_node_it,
+ dumconst_node_it,
+ Cmp_Fn,
+ Allocator> >::value
+ };
+
+ public:
+ typedef
+ typename tree_metadata_helper<
+ Node_Update<
+ dumconst_node_it,
+ dumconst_node_it,
+ Cmp_Fn,
+ Allocator>,
+ null_update>::type
+ type;
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_TREE_NODE_METADATA_SELECTOR_HPP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/tree_policy/null_node_update_imp.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/tree_policy/null_node_update_imp.hpp
new file mode 100644
index 0000000..006a3eb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/tree_policy/null_node_update_imp.hpp
@@ -0,0 +1,50 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file null_node_update_imp.hpp
+ * Contains an implementation of null_node_update.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename Const_Node_Iterator_,
+ typename Node_Iterator_,
+ class Cmp_Fn_,
+ typename Allocator_>
+inline void
+PB_DS_CLASS_C_DEC::
+swap(null_tree_node_update< Const_Node_Iterator_, Node_Iterator_, Cmp_Fn_, Allocator_>& /*other*/)
+{ }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp
new file mode 100644
index 0000000..1d33767
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp
@@ -0,0 +1,141 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file order_statistics_imp.hpp
+ * Contains forward declarations for order_statistics_key
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+find_by_order(size_type order)
+{
+ node_iterator it = node_begin();
+
+ node_iterator end_it = node_end();
+
+ while (it != end_it)
+ {
+ node_iterator l_it = it.get_l_child();
+
+ const size_type o = (l_it == end_it)?
+ 0 :
+ l_it.get_metadata();
+
+ if (order == o)
+ return (*it);
+ else if (order < o)
+ it = l_it;
+ else
+ {
+ order -= o + 1;
+
+ it = it.get_r_child();
+ }
+ }
+
+ return (PB_DS_BASE_C_DEC::end_iterator());
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+find_by_order(size_type order) const
+{
+ return (const_cast<PB_DS_CLASS_C_DEC* >(this)->find_by_order(order));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+order_of_key(const_key_reference r_key) const
+{
+ const_node_iterator it = node_begin();
+
+ const_node_iterator end_it = node_end();
+
+ const cmp_fn& r_cmp_fn =
+ const_cast<PB_DS_CLASS_C_DEC* >(this)->get_cmp_fn();
+
+ size_type ord = 0;
+
+ while (it != end_it)
+ {
+ const_node_iterator l_it = it.get_l_child();
+
+ if (r_cmp_fn(r_key, extract_key(*(*it))))
+ it = l_it;
+ else if (r_cmp_fn(extract_key(*(*it)), r_key))
+ {
+
+ ord += (l_it == end_it)?
+ 1 :
+ 1 + l_it.get_metadata();
+
+ it = it.get_r_child();
+ }
+ else
+ {
+ ord += (l_it == end_it)?
+ 0 :
+ l_it.get_metadata();
+
+ it = end_it;
+ }
+ }
+
+ return (ord);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+operator()(node_iterator node_it, const_node_iterator end_nd_it) const
+{
+ node_iterator l_child_it = node_it.get_l_child();
+ const size_type l_rank =(l_child_it == end_nd_it)? 0 : l_child_it.get_metadata();
+
+ node_iterator r_child_it = node_it.get_r_child();
+ const size_type r_rank =(r_child_it == end_nd_it)? 0 : r_child_it.get_metadata();
+
+ const_cast<metadata_reference>(node_it.get_metadata())=
+ 1 + l_rank + r_rank;
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~tree_order_statistics_node_update()
+{ }
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/tree_policy/sample_tree_node_update.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/tree_policy/sample_tree_node_update.hpp
new file mode 100644
index 0000000..6ea6899
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/tree_policy/sample_tree_node_update.hpp
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_tree_node_update.hpp
+ * Contains a samle node update functor.
+ */
+
+#ifndef PB_DS_SAMPLE_TREE_NODE_UPDATOR_HPP
+#define PB_DS_SAMPLE_TREE_NODE_UPDATOR_HPP
+
+// A sample node updator.
+template<typename Const_Node_Iterator,
+
+ class Node_Iterator,
+
+ class Cmp_Fn,
+
+ class Allocator
+ >
+class sample_tree_node_update
+{
+
+public:
+
+ // Metadata type.
+ typedef size_t metadata_type;
+
+protected:
+
+ // Default constructor.
+ sample_tree_node_update();
+
+ // Updates the rank of a node through a node_iterator node_it; end_nd_it is the end node iterator.
+ inline void
+ operator()(node_iterator node_it, const_node_iterator end_nd_it) const;
+
+};
+
+#endif // #ifndef PB_DS_SAMPLE_TREE_NODE_UPDATOR_HPP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/tree_trace_base.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/tree_trace_base.hpp
new file mode 100644
index 0000000..e4bd656
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/tree_trace_base.hpp
@@ -0,0 +1,209 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file tree_trace_base.hpp
+ * Contains tree-related policies.
+ */
+
+#ifndef PB_DS_TREE_TRACE_BASE_HPP
+#define PB_DS_TREE_TRACE_BASE_HPP
+
+#ifdef PB_DS_TREE_TRACE
+
+#include <ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp>
+#include <ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp>
+
+namespace __gnu_pbds
+{
+
+ namespace detail
+ {
+
+#ifdef PB_DS_TREE_TRACE
+
+#define PB_DS_CLASS_T_DEC \
+ template< \
+ class Const_Node_Iterator, \
+ class Node_Iterator, \
+ class Cmp_Fn, \
+ bool Node_Based, \
+ class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ tree_trace_base< \
+ Const_Node_Iterator, \
+ Node_Iterator, \
+ Cmp_Fn, \
+ Node_Based, \
+ Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ basic_tree_policy_base< \
+ Const_Node_Iterator, \
+ Node_Iterator, \
+ Allocator>
+
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class Cmp_Fn,
+ bool Node_Based,
+ class Allocator>
+ class tree_trace_base : private PB_DS_BASE_C_DEC
+ {
+ public:
+ void
+ trace() const;
+
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ typedef Const_Node_Iterator const_node_iterator;
+
+ typedef typename Allocator::size_type size_type;
+
+ private:
+ void
+ trace_node(const_node_iterator nd_it, size_type level) const;
+
+ virtual bool
+ empty() const = 0;
+
+ virtual const_node_iterator
+ node_begin() const = 0;
+
+ virtual const_node_iterator
+ node_end() const = 0;
+
+ static void
+ print_node_pointer(Const_Node_Iterator nd_it, integral_constant<int,true>);
+
+ static void
+ print_node_pointer(Const_Node_Iterator nd_it, integral_constant<int,false>);
+
+ template<typename Metadata_>
+ static void
+ trace_it_metadata(Const_Node_Iterator nd_it, type_to_type<Metadata_>);
+
+ static void
+ trace_it_metadata(Const_Node_Iterator, type_to_type<null_node_metadata>);
+ };
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ trace() const
+ {
+ if (empty())
+ return;
+
+ trace_node(node_begin(), 0);
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ trace_node(const_node_iterator nd_it, size_type level) const
+ {
+ if (nd_it.get_r_child() != node_end())
+ trace_node(nd_it.get_r_child(), level + 1);
+
+ for (size_type i = 0; i < level; ++i)
+ std::cerr << ' ';
+
+ print_node_pointer(nd_it, integral_constant<int,Node_Based>());
+ std::cerr << base_type::extract_key(*(*nd_it));
+
+ typedef
+ type_to_type<
+ typename const_node_iterator::metadata_type>
+ m_type_ind_t;
+
+ trace_it_metadata(nd_it, m_type_ind_t());
+
+ std::cerr << std::endl;
+
+ if (nd_it.get_l_child() != node_end())
+ trace_node(nd_it.get_l_child(), level + 1);
+ }
+
+ PB_DS_CLASS_T_DEC
+ template<typename Metadata_>
+ void
+ PB_DS_CLASS_C_DEC::
+ trace_it_metadata(Const_Node_Iterator nd_it, type_to_type<Metadata_>)
+ {
+ std::cerr << " (" <<
+ static_cast<unsigned long>(nd_it.get_metadata()) << ") ";
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ trace_it_metadata(Const_Node_Iterator, type_to_type<null_node_metadata>)
+ { }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ print_node_pointer(Const_Node_Iterator nd_it, integral_constant<int,true>)
+ {
+ std::cerr << nd_it.m_p_nd << " ";
+ }
+
+ PB_DS_CLASS_T_DEC
+ void
+ PB_DS_CLASS_C_DEC::
+ print_node_pointer(Const_Node_Iterator nd_it, integral_constant<int,false>)
+ {
+ std::cerr <<* nd_it << " ";
+ }
+
+#undef PB_DS_CLASS_T_DEC
+
+#undef PB_DS_CLASS_C_DEC
+
+#undef PB_DS_BASE_C_DEC
+
+#endif // #ifdef PB_DS_TREE_TRACE
+
+ } // namespace detail
+
+} // namespace __gnu_pbds
+
+#endif // #ifdef PB_DS_TREE_TRACE
+
+#endif // #ifndef PB_DS_TREE_TRACE_BASE_HPP
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp
new file mode 100644
index 0000000..b4de31f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp
@@ -0,0 +1,116 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file node_metadata_selector.hpp
+ * Contains an implementation class for tries.
+ */
+
+#ifndef PB_DS_TRIE_NODE_METADATA_SELECTOR_HPP
+#define PB_DS_TRIE_NODE_METADATA_SELECTOR_HPP
+
+#include <ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp>
+#include <ext/pb_ds/detail/types_traits.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+ template<typename Node_Update, bool Null>
+ struct trie_metadata_helper
+ {
+ typedef typename Node_Update::metadata_type type;
+ };
+
+ template<typename Node_Update>
+ struct trie_metadata_helper<
+ Node_Update,
+ true>
+ {
+ typedef null_node_metadata type;
+ };
+
+ template<typename Key,
+ typename Data,
+ class Cmp_Fn,
+ template<typename Const_Node_Iterator,
+ class Const_Iterator,
+ class Cmp_Fn_,
+ class Allocator_>
+ class Node_Update,
+ class Allocator>
+ struct trie_node_metadata_selector
+ {
+ private:
+ typedef
+ dumconst_node_iterator<
+ Key,
+ Data,
+ Allocator>
+ dumconst_node_it;
+
+ enum
+ {
+ null_update =
+ is_same<
+ Node_Update<
+ dumconst_node_it,
+ dumconst_node_it,
+ Cmp_Fn,
+ Allocator>,
+ null_trie_node_update<
+ dumconst_node_it,
+ dumconst_node_it,
+ Cmp_Fn,
+ Allocator> >::value
+ };
+
+ public:
+ typedef
+ typename trie_metadata_helper<
+ Node_Update<
+ dumconst_node_it,
+ dumconst_node_it,
+ Cmp_Fn,
+ Allocator>,
+ null_update>::type
+ type;
+ };
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_TRIE_NODE_METADATA_SELECTOR_HPP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/null_node_update_imp.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/null_node_update_imp.hpp
new file mode 100644
index 0000000..65245e9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/null_node_update_imp.hpp
@@ -0,0 +1,50 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file null_node_update_imp.hpp
+ * Contains an implementation of null_node_update.
+ */
+
+PB_DS_CLASS_T_DEC
+template<typename Const_Node_Iterator_,
+ typename Node_Iterator_,
+ class E_Access_Traits_,
+ typename Allocator_>
+inline void
+PB_DS_CLASS_C_DEC::
+swap(null_trie_node_update< Const_Node_Iterator_, Node_Iterator_, E_Access_Traits_, Allocator_>& /*other*/)
+{ }
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp
new file mode 100644
index 0000000..4e27ac2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp
@@ -0,0 +1,183 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file order_statistics_imp.hpp
+ * Contains forward declarations for order_statistics_key
+ */
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::iterator
+PB_DS_CLASS_C_DEC::
+find_by_order(size_type order)
+{
+ if (empty())
+ return (end());
+
+ ++order;
+
+ node_iterator nd_it = node_begin();
+
+ node_iterator end_nd_it = node_end();
+
+ while (true)
+ {
+ if (order > nd_it.get_metadata())
+ return (++base_type::rightmost_it(nd_it));
+
+ const size_type num_children = nd_it.num_children();
+
+ if (num_children == 0)
+ return (*nd_it);
+
+ for (size_type i = 0; i < num_children; ++i)
+ {
+ node_iterator child_nd_it = nd_it.get_child(i);
+
+ if (order <= child_nd_it.get_metadata())
+ {
+ i = num_children;
+
+ nd_it = child_nd_it;
+ }
+ else
+ order -= child_nd_it.get_metadata();
+ }
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+find_by_order(size_type order) const
+{
+ return (const_cast<PB_DS_CLASS_C_DEC* >(this)->find_by_order(order));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+order_of_key(const_key_reference r_key) const
+{
+ const E_Access_Traits& r_traits =
+ const_cast<PB_DS_CLASS_C_DEC* >(this)->get_e_access_traits();
+
+ return (order_of_prefix(
+ r_traits.begin(r_key),
+ r_traits.end(r_key)));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+order_of_prefix(typename e_access_traits::const_iterator b, typename e_access_traits::const_iterator e) const
+{
+ if (empty())
+ return (0);
+
+ const E_Access_Traits& r_traits =
+ const_cast<PB_DS_CLASS_C_DEC* >(this)->get_e_access_traits();
+
+ const_node_iterator nd_it = node_begin();
+
+ const_node_iterator end_nd_it = node_end();
+
+ size_type ord = 0;
+
+ while (true)
+ {
+ const size_type num_children = nd_it.num_children();
+
+ if (num_children == 0)
+ {
+ const_key_reference r_key =
+ base_type::extract_key(*(*nd_it));
+
+ typename e_access_traits::const_iterator key_b =
+ r_traits.begin(r_key);
+
+ typename e_access_traits::const_iterator key_e =
+ r_traits.end(r_key);
+
+ return ((base_type::less( key_b, key_e, b, e, r_traits))?
+ ord + 1 :
+ ord);
+ }
+
+ const_node_iterator next_nd_it = end_nd_it;
+
+ size_type i = num_children - 1;
+
+ do
+ {
+ const_node_iterator child_nd_it = nd_it.get_child(i);
+
+ if (next_nd_it != end_nd_it)
+ ord += child_nd_it.get_metadata();
+ else if (!base_type::less(
+ b, e,
+ child_nd_it.valid_prefix().first,
+ child_nd_it.valid_prefix().second,
+ r_traits))
+ next_nd_it = child_nd_it;
+ }
+ while (i-- > 0);
+
+ if (next_nd_it == end_nd_it)
+ return (ord);
+
+ nd_it = next_nd_it;
+ }
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+operator()(node_iterator nd_it, const_node_iterator /*end_nd_it*/) const
+{
+ const size_type num_children = nd_it.num_children();
+
+ size_type children_rank = 0;
+
+ for (size_type i = 0; i < num_children; ++i)
+ children_rank += nd_it.get_child(i).get_metadata();
+
+ const_cast<size_type& >(nd_it.get_metadata()) =(num_children == 0)? 1 : children_rank;
+}
+
+PB_DS_CLASS_T_DEC
+PB_DS_CLASS_C_DEC::
+~trie_order_statistics_node_update()
+{ }
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/prefix_search_node_update_imp.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/prefix_search_node_update_imp.hpp
new file mode 100644
index 0000000..cdd8989
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/prefix_search_node_update_imp.hpp
@@ -0,0 +1,151 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file prefix_search_node_update_imp.hpp
+ * Contains an implementation of prefix_search_node_update.
+ */
+
+PB_DS_CLASS_T_DEC
+std::pair<
+ typename PB_DS_CLASS_C_DEC::const_iterator,
+ typename PB_DS_CLASS_C_DEC::const_iterator>
+PB_DS_CLASS_C_DEC::
+prefix_range(const_key_reference r_key) const
+{
+ const e_access_traits& r_traits = get_e_access_traits();
+
+ return (prefix_range(
+ r_traits.begin(r_key),
+ r_traits.end(r_key)));
+}
+
+PB_DS_CLASS_T_DEC
+std::pair<
+ typename PB_DS_CLASS_C_DEC::iterator,
+ typename PB_DS_CLASS_C_DEC::iterator>
+PB_DS_CLASS_C_DEC::
+prefix_range(const_key_reference r_key)
+{
+ return (prefix_range(
+ get_e_access_traits().begin(r_key),
+ get_e_access_traits().end(r_key)));
+}
+
+PB_DS_CLASS_T_DEC
+std::pair<
+ typename PB_DS_CLASS_C_DEC::const_iterator,
+ typename PB_DS_CLASS_C_DEC::const_iterator>
+PB_DS_CLASS_C_DEC::
+prefix_range(typename e_access_traits::const_iterator b, typename e_access_traits::const_iterator e) const
+{
+ const std::pair<iterator, iterator> non_const_ret =
+ const_cast<PB_DS_CLASS_C_DEC* >(this)->prefix_range(b, e);
+
+ return (std::make_pair(
+ const_iterator(non_const_ret.first),
+ const_iterator(non_const_ret.second)));
+}
+
+PB_DS_CLASS_T_DEC
+std::pair<
+ typename PB_DS_CLASS_C_DEC::iterator,
+ typename PB_DS_CLASS_C_DEC::iterator>
+PB_DS_CLASS_C_DEC::
+prefix_range(typename e_access_traits::const_iterator b, typename e_access_traits::const_iterator e)
+{
+ Node_Iterator nd_it = node_begin();
+ Node_Iterator end_nd_it = node_end();
+
+ const e_access_traits& r_traits =
+ get_e_access_traits();
+
+ const size_type given_range_length = std::distance(b, e);
+
+ while (true)
+ {
+ if (nd_it == end_nd_it)
+ return (std::make_pair(end(), end()));
+
+ const size_type common_range_length =
+ PB_DS_BASE_C_DEC::common_prefix_len(nd_it, b, e, r_traits);
+
+ if (common_range_length >= given_range_length)
+ {
+ iterator ret_b = leftmost_it(nd_it);
+
+ iterator ret_e = rightmost_it(nd_it);
+
+ return (std::make_pair(ret_b, ++ret_e));
+ }
+
+ nd_it = next_child(nd_it, b, e, end_nd_it, r_traits);
+ }
+}
+
+PB_DS_CLASS_T_DEC
+typename PB_DS_CLASS_C_DEC::node_iterator
+PB_DS_CLASS_C_DEC::
+next_child(node_iterator nd_it, typename e_access_traits::const_iterator b, typename e_access_traits::const_iterator e, node_iterator end_nd_it, const e_access_traits& r_traits)
+{
+ const size_type num_children = nd_it.num_children();
+
+ node_iterator ret = end_nd_it;
+
+ size_type max_length = 0;
+
+ for (size_type i = 0; i < num_children; ++i)
+ {
+ node_iterator pot = nd_it.get_child(i);
+
+ const size_type common_range_length =
+ PB_DS_BASE_C_DEC::common_prefix_len( pot, b, e, r_traits);
+
+ if (common_range_length > max_length)
+ {
+ ret = pot;
+
+ max_length = common_range_length;
+ }
+ }
+
+ return (ret);
+}
+
+PB_DS_CLASS_T_DEC
+inline void
+PB_DS_CLASS_C_DEC::
+operator()(node_iterator /*nd_it*/, const_node_iterator /*end_nd_it*/) const
+{ }
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/sample_trie_e_access_traits.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/sample_trie_e_access_traits.hpp
new file mode 100644
index 0000000..34fbe0c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/sample_trie_e_access_traits.hpp
@@ -0,0 +1,89 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_trie_e_access_traits.hpp
+ * Contains a sample probe policy.
+ */
+
+#ifndef PB_DS_SAMPLE_TRIE_E_ACCESS_TRAITS_HPP
+#define PB_DS_SAMPLE_TRIE_E_ACCESS_TRAITS_HPP
+
+// A sample trie element-access traits.
+class sample_trie_e_access_traits
+{
+
+public:
+
+ // Size type.
+ typedef size_t size_type;
+
+ // Key type.
+ typedef std::string key_type;
+
+ // Const key reference type.
+ typedef
+ typename Allocator::template rebind<
+ key_type>::other::const_reference
+ const_key_reference;
+
+ // Element const iterator type.
+ typedef std::string::const_iterator const_iterator;
+
+ // Element type.
+ typedef char e_type;
+
+ enum
+ {
+ max_size = 4
+ };
+
+public:
+
+ // Returns a const_iterator to the first element of r_key.
+ inline static const_iterator
+ begin(const_key_reference r_key);
+
+ // Returns a const_iterator to the after-last element of r_key.
+ inline static const_iterator
+ end(const_key_reference r_key);
+
+ // Maps an element to a position.
+ inline static size_type
+ e_pos(e_type e);
+
+};
+
+#endif // #ifndef PB_DS_SAMPLE_TRIE_E_ACCESS_TRAITS_HPP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/sample_trie_node_update.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/sample_trie_node_update.hpp
new file mode 100644
index 0000000..55fd997
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/sample_trie_node_update.hpp
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file sample_trie_node_update.hpp
+ * Contains a samle node update functor.
+ */
+
+#ifndef PB_DS_SAMPLE_TRIE_NODE_UPDATOR_HPP
+#define PB_DS_SAMPLE_TRIE_NODE_UPDATOR_HPP
+
+// A sample node updator.
+template<typename Const_Node_Iterator,
+
+ class Node_Iterator,
+
+ class E_Access_Traits,
+
+ class Allocator
+ >
+class sample_trie_node_update
+{
+
+public:
+
+ // Metadata type.
+ typedef size_t metadata_type;
+
+protected:
+
+ // Default constructor.
+ sample_trie_node_update();
+
+ // Updates the rank of a node through a node_iterator node_it; end_nd_it is the end node iterator.
+ inline void
+ operator()(node_iterator node_it, const_node_iterator end_nd_it) const;
+
+};
+
+#endif // #ifndef PB_DS_SAMPLE_TRIE_NODE_UPDATOR_HPP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/string_trie_e_access_traits_imp.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/string_trie_e_access_traits_imp.hpp
new file mode 100644
index 0000000..228a4a5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/string_trie_e_access_traits_imp.hpp
@@ -0,0 +1,99 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file string_trie_e_access_traits_imp.hpp
+ * Contains a policy for extracting character positions from
+ * a string for a vector-based PATRICIA tree
+ */
+
+PB_DS_CLASS_T_DEC
+detail::integral_constant<int, Reverse> PB_DS_CLASS_C_DEC::s_rev_ind;
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::size_type
+PB_DS_CLASS_C_DEC::
+e_pos(e_type e)
+{
+ return (static_cast<size_type>(e - min_e_val));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+begin(const_key_reference r_key)
+{
+ return (begin_imp(r_key, s_rev_ind));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+end(const_key_reference r_key)
+{
+ return (end_imp(r_key, s_rev_ind));
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+begin_imp(const_key_reference r_key, detail::false_type)
+{
+ return (r_key.begin());
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+begin_imp(const_key_reference r_key, detail::true_type)
+{
+ return (r_key.rbegin());
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+end_imp(const_key_reference r_key, detail::false_type)
+{
+ return (r_key.end());
+}
+
+PB_DS_CLASS_T_DEC
+inline typename PB_DS_CLASS_C_DEC::const_iterator
+PB_DS_CLASS_C_DEC::
+end_imp(const_key_reference r_key, detail::true_type)
+{
+ return (r_key.rend());
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/trie_policy_base.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/trie_policy_base.hpp
new file mode 100644
index 0000000..db912a0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/trie_policy/trie_policy_base.hpp
@@ -0,0 +1,249 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trie_policy_base.hpp
+ * Contains an implementation of trie_policy_base.
+ */
+
+#ifndef PB_DS_TRIE_POLICY_BASE_HPP
+#define PB_DS_TRIE_POLICY_BASE_HPP
+
+#include <ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+
+#define PB_DS_CLASS_T_DEC \
+ template< \
+ class Const_Node_Iterator, \
+ class Node_Iterator, \
+ class E_Access_Traits, \
+ typename Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ trie_policy_base< \
+ Const_Node_Iterator, \
+ Node_Iterator, \
+ E_Access_Traits, \
+ Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ basic_tree_policy_base< \
+ Const_Node_Iterator, \
+ Node_Iterator, \
+ Allocator>
+
+ template<typename Const_Node_Iterator,
+ class Node_Iterator,
+ class E_Access_Traits,
+ class Allocator>
+ class trie_policy_base : public PB_DS_BASE_C_DEC
+ {
+
+ public:
+
+ typedef E_Access_Traits e_access_traits;
+
+ typedef Allocator allocator_type;
+
+ typedef typename allocator_type::size_type size_type;
+
+ typedef null_node_metadata metadata_type;
+
+ typedef Const_Node_Iterator const_node_iterator;
+
+ typedef Node_Iterator node_iterator;
+
+ typedef typename const_node_iterator::value_type const_iterator;
+
+ typedef typename node_iterator::value_type iterator;
+
+ public:
+
+ typedef typename PB_DS_BASE_C_DEC::key_type key_type;
+
+ typedef
+ typename PB_DS_BASE_C_DEC::const_key_reference
+ const_key_reference;
+
+ protected:
+
+ virtual const_iterator
+ end() const = 0;
+
+ virtual iterator
+ end() = 0;
+
+ virtual const_node_iterator
+ node_begin() const = 0;
+
+ virtual node_iterator
+ node_begin() = 0;
+
+ virtual const_node_iterator
+ node_end() const = 0;
+
+ virtual node_iterator
+ node_end() = 0;
+
+ virtual const e_access_traits&
+ get_e_access_traits() const = 0;
+
+ private:
+ typedef
+ std::pair<
+ typename e_access_traits::const_iterator,
+ typename e_access_traits::const_iterator>
+ prefix_range_t;
+
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ protected:
+ static size_type
+ common_prefix_len(node_iterator nd_it, typename e_access_traits::const_iterator b_r, typename e_access_traits::const_iterator e_r, const e_access_traits& r_traits);
+
+ static iterator
+ leftmost_it(node_iterator nd_it);
+
+ static iterator
+ rightmost_it(node_iterator nd_it);
+
+ static bool
+ less(typename e_access_traits::const_iterator b_l, typename e_access_traits::const_iterator e_l, typename e_access_traits::const_iterator b_r, typename e_access_traits::const_iterator e_r, const e_access_traits& r_traits);
+ };
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::size_type
+ PB_DS_CLASS_C_DEC::
+ common_prefix_len(node_iterator nd_it, typename e_access_traits::const_iterator b_r, typename e_access_traits::const_iterator e_r, const e_access_traits& r_traits)
+ {
+ prefix_range_t pref_range = nd_it.valid_prefix();
+
+ typename e_access_traits::const_iterator b_l = pref_range.first;
+ typename e_access_traits::const_iterator e_l = pref_range.second;
+
+ const size_type range_length_l =
+ std::distance(b_l, e_l);
+
+ const size_type range_length_r =
+ std::distance(b_r, e_r);
+
+ if (range_length_r < range_length_l)
+ {
+ std::swap(b_l, b_r);
+
+ std::swap(e_l, e_r);
+ }
+
+ size_type ret = 0;
+
+ while (b_l != e_l)
+ {
+ if (r_traits.e_pos(*b_l) != r_traits.e_pos(*b_r))
+ return (ret);
+
+ ++ret;
+
+ ++b_l;
+
+ ++b_r;
+ }
+
+ return (ret);
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::iterator
+ PB_DS_CLASS_C_DEC::
+ leftmost_it(node_iterator nd_it)
+ {
+ if (nd_it.num_children() == 0)
+ return (*nd_it);
+
+ return (leftmost_it(nd_it.get_child(0)));
+ }
+
+ PB_DS_CLASS_T_DEC
+ typename PB_DS_CLASS_C_DEC::iterator
+ PB_DS_CLASS_C_DEC::
+ rightmost_it(node_iterator nd_it)
+ {
+ const size_type num_children = nd_it.num_children();
+
+ if (num_children == 0)
+ return (*nd_it);
+
+ return (rightmost_it(nd_it.get_child(num_children - 1)));
+ }
+
+ PB_DS_CLASS_T_DEC
+ bool
+ PB_DS_CLASS_C_DEC::
+ less(typename e_access_traits::const_iterator b_l, typename e_access_traits::const_iterator e_l, typename e_access_traits::const_iterator b_r, typename e_access_traits::const_iterator e_r, const e_access_traits& r_traits)
+ {
+ while (b_l != e_l)
+ {
+ if (b_r == e_r)
+ return (false);
+
+ size_type l_pos =
+ r_traits.e_pos(*b_l);
+ size_type r_pos =
+ r_traits.e_pos(*b_r);
+
+ if (l_pos != r_pos)
+ return (l_pos < r_pos);
+
+ ++b_l;
+ ++b_r;
+ }
+
+ return (b_r != e_r);
+ }
+
+#undef PB_DS_CLASS_T_DEC
+
+#undef PB_DS_CLASS_C_DEC
+
+#undef PB_DS_BASE_C_DEC
+
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif // #ifndef PB_DS_TRIE_POLICY_BASE_HPP
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/type_utils.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/type_utils.hpp
new file mode 100644
index 0000000..55f349a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/type_utils.hpp
@@ -0,0 +1,167 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file type_utils.hpp
+ * Contains utilities for handnling types. All of these classes are based on
+ * "Modern C++" by Andrei Alxandrescu.
+ */
+
+#ifndef PB_DS_TYPE_UTILS_HPP
+#define PB_DS_TYPE_UTILS_HPP
+
+#include <cstddef>
+#include <utility>
+#include <tr1/type_traits>
+#include <ext/type_traits.h>
+#include <ext/numeric_traits.h>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ using std::tr1::is_same;
+ using std::tr1::is_const;
+ using std::tr1::is_pointer;
+ using std::tr1::is_reference;
+ using std::tr1::is_fundamental;
+ using std::tr1::is_member_object_pointer;
+ using std::tr1::is_member_pointer;
+ using std::tr1::is_base_of;
+ using std::tr1::remove_const;
+ using std::tr1::remove_reference;
+
+ // Need integral_const<bool, true> <-> integral_const<int, 1>, so
+ // because of this use the following typedefs instead of importing
+ // std::tr1's.
+ using std::tr1::integral_constant;
+ typedef std::tr1::integral_constant<int, 1> true_type;
+ typedef std::tr1::integral_constant<int, 0> false_type;
+
+ using __gnu_cxx::__conditional_type;
+ using __gnu_cxx::__numeric_traits;
+
+ template<typename T>
+ struct is_const_pointer
+ {
+ enum
+ {
+ value = is_const<T>::value && is_pointer<T>::value
+ };
+ };
+
+ template<typename T>
+ struct is_const_reference
+ {
+ enum
+ {
+ value = is_const<T>::value && is_reference<T>::value
+ };
+ };
+
+ template<typename T>
+ struct is_simple
+ {
+ enum
+ {
+ value = is_fundamental<typename remove_const<T>::type>::value
+ || is_pointer<typename remove_const<T>::type>::value
+ || is_member_pointer<T>::value
+ };
+ };
+
+ template<typename T>
+ class is_pair
+ {
+ private:
+ template<typename U>
+ struct is_pair_imp
+ {
+ enum
+ {
+ value = 0
+ };
+ };
+
+ template<typename U, typename V>
+ struct is_pair_imp<std::pair<U,V> >
+ {
+ enum
+ {
+ value = 1
+ };
+ };
+
+ public:
+ enum
+ {
+ value = is_pair_imp<T>::value
+ };
+ };
+
+ // Use C++0x's static_assert if possible.
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#define PB_DS_STATIC_ASSERT(UNIQUE, E) static_assert(E, #UNIQUE)
+#else
+ template<bool>
+ struct __static_assert;
+
+ template<>
+ struct __static_assert<true>
+ { };
+
+ template<int>
+ struct __static_assert_dumclass
+ {
+ enum
+ {
+ v = 1
+ };
+ };
+
+#define PB_DS_STATIC_ASSERT(UNIQUE, E) \
+ typedef __gnu_pbds::detail::__static_assert_dumclass<sizeof(__gnu_pbds::detail::__static_assert<bool(E)>)> UNIQUE##__static_assert_type
+
+#endif
+
+ template<typename Type>
+ struct type_to_type
+ {
+ typedef Type type;
+ };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/types_traits.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/types_traits.hpp
new file mode 100644
index 0000000..6d5a078
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/types_traits.hpp
@@ -0,0 +1,82 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file types_traits.hpp
+ * Contains a traits class of types used by containers.
+ */
+
+#ifndef PB_DS_TYPES_TRAITS_HPP
+#define PB_DS_TYPES_TRAITS_HPP
+
+#include <ext/pb_ds/detail/basic_types.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <utility>
+
+namespace __gnu_pbds
+{
+ namespace detail
+ {
+ template<typename Key, typename Mapped, typename Alloc, bool Store_Extra>
+ struct vt_base_selector
+ {
+ typedef value_type_base<Key, Mapped, Alloc, Store_Extra> type;
+ };
+
+ template<typename Key, typename Mapped, typename Alloc, bool Store_Extra>
+ struct types_traits
+ : public vt_base_selector<Key, Mapped, Alloc, Store_Extra>::type
+ {
+ typedef typename Alloc::template rebind<Key>::other key_allocator;
+ typedef typename key_allocator::value_type key_type;
+ typedef typename key_allocator::pointer key_pointer;
+ typedef typename key_allocator::const_pointer const_key_pointer;
+ typedef typename key_allocator::reference key_reference;
+ typedef typename key_allocator::const_reference const_key_reference;
+ typedef typename Alloc::size_type size_type;
+
+ // Extra value (used when the extra value is stored with each value).
+ typedef std::pair<size_type, size_type> comp_hash;
+
+ typedef integral_constant<int, Store_Extra> store_extra;
+ store_extra m_store_extra_indicator;
+
+ typedef typename no_throw_copies<Key, Mapped>::indicator no_throw_copies;
+ no_throw_copies m_no_throw_copies_indicator;
+ };
+ } // namespace detail
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp
new file mode 100644
index 0000000..38d4eb1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp
@@ -0,0 +1,129 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file const_iterator.hpp
+ * Contains an iterator class used for const ranging over the elements of the
+ * table.
+ */
+
+// Const range-type iterator.
+class const_iterator_ :
+ public const_point_iterator_
+
+{
+
+public:
+
+ // Category.
+ typedef std::forward_iterator_tag iterator_category;
+
+ // Difference type.
+ typedef typename Allocator::difference_type difference_type;
+
+ // Iterator's value type.
+ typedef value_type_ value_type;
+
+ // Iterator's pointer type.
+ typedef pointer_ pointer;
+
+ // Iterator's const pointer type.
+ typedef const_pointer_ const_pointer;
+
+ // Iterator's reference type.
+ typedef reference_ reference;
+
+ // Iterator's const reference type.
+ typedef const_reference_ const_reference;
+
+public:
+
+ // Default constructor.
+ inline
+ const_iterator_()
+
+ : m_p_tbl(NULL)
+ { }
+
+ // Increments.
+ inline const_iterator_&
+ operator++()
+ {
+ m_p_tbl->inc_it_state(base_type::m_p_value, m_pos);
+
+ return (*this);
+ }
+
+ // Increments.
+ inline const_iterator_
+ operator++(int)
+ {
+ const_iterator_ ret =* this;
+
+ m_p_tbl->inc_it_state(base_type::m_p_value, m_pos);
+
+ return (ret);
+ }
+
+protected:
+
+ typedef const_point_iterator_ base_type;
+
+protected:
+
+ /**
+ * Constructor used by the table to initiate the generalized
+ * pointer and position (e.g., this is called from within a find()
+ * of a table.
+ * */
+ inline
+ const_iterator_(const_pointer_ p_value, PB_DS_GEN_POS pos, const PB_DS_CLASS_C_DEC* p_tbl) : const_point_iterator_(p_value),
+ m_p_tbl(p_tbl),
+ m_pos(pos)
+ { }
+
+protected:
+
+ /**
+ * Pointer to the table object which created the iterator (used for
+ * incrementing its position.
+ * */
+ const PB_DS_CLASS_C_DEC* m_p_tbl;
+
+ PB_DS_GEN_POS m_pos;
+
+ friend class PB_DS_CLASS_C_DEC;
+};
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp
new file mode 100644
index 0000000..bc0b2ad
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp
@@ -0,0 +1,151 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file const_point_iterator.hpp
+ * Contains an iterator class returned by the tables' const find and insert
+ * methods.
+ */
+
+class point_iterator_;
+
+// Const point-type iterator.
+class const_point_iterator_
+{
+
+public:
+
+ // Category.
+ typedef trivial_iterator_tag iterator_category;
+
+ // Difference type.
+ typedef trivial_iterator_difference_type difference_type;
+
+ // Iterator's value type.
+ typedef value_type_ value_type;
+
+ // Iterator's pointer type.
+ typedef pointer_ pointer;
+
+ // Iterator's const pointer type.
+ typedef const_pointer_ const_pointer;
+
+ // Iterator's reference type.
+ typedef reference_ reference;
+
+ // Iterator's const reference type.
+ typedef const_reference_ const_reference;
+
+public:
+
+ inline
+ const_point_iterator_(const_pointer p_value) : m_p_value(p_value)
+ { }
+
+ // Default constructor.
+ inline
+ const_point_iterator_()
+
+ : m_p_value(NULL)
+ { }
+
+ // Copy constructor.
+ inline
+ const_point_iterator_(const const_point_iterator_& other)
+
+ : m_p_value(other.m_p_value)
+ { }
+
+ // Copy constructor.
+ inline
+ const_point_iterator_(const point_iterator_& other)
+
+ : m_p_value(other.m_p_value)
+ { }
+
+ // Access.
+ inline const_pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_value != NULL);
+
+ return (m_p_value);
+ }
+
+ // Access.
+ inline const_reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_value != NULL);
+
+ return (*m_p_value);
+ }
+
+ // Compares content to a different iterator object.
+ inline bool
+ operator==(const point_iterator_& other) const
+ {
+ return (m_p_value == other.m_p_value);
+ }
+
+ // Compares content to a different iterator object.
+ inline bool
+ operator==(const const_point_iterator_& other) const
+ {
+ return (m_p_value == other.m_p_value);
+ }
+
+ // Compares content (negatively) to a different iterator object.
+ inline bool
+ operator!=(const point_iterator_& other) const
+ {
+ return (m_p_value != other.m_p_value);
+ }
+
+ // Compares content (negatively) to a different iterator object.
+ inline bool
+ operator!=(const const_point_iterator_& other) const
+ {
+ return (m_p_value != other.m_p_value);
+ }
+
+protected:
+ const_pointer m_p_value;
+
+ friend class point_iterator_;
+
+ friend class PB_DS_CLASS_C_DEC;
+};
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/unordered_iterator/iterator.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/unordered_iterator/iterator.hpp
new file mode 100644
index 0000000..3e21aba
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/unordered_iterator/iterator.hpp
@@ -0,0 +1,150 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file iterator.hpp
+ * Contains an iterator_ class used for ranging over the elements of the
+ * table.
+ */
+
+// Range-type iterator.
+class iterator_ :
+ public const_iterator_
+
+{
+
+public:
+
+ // Category.
+ typedef std::forward_iterator_tag iterator_category;
+
+ // Difference type.
+ typedef typename Allocator::difference_type difference_type;
+
+ // Iterator's value type.
+ typedef value_type_ value_type;
+
+ // Iterator's pointer type.
+ typedef pointer_ pointer;
+
+ // Iterator's const pointer type.
+ typedef const_pointer_ const_pointer;
+
+ // Iterator's reference type.
+ typedef reference_ reference;
+
+ // Iterator's const reference type.
+ typedef const_reference_ const_reference;
+
+public:
+
+ // Default constructor.
+ inline
+ iterator_()
+
+ : const_iterator_(NULL, PB_DS_GEN_POS(), NULL)
+ { }
+
+ // Conversion to a point-type iterator.
+ inline
+ operator point_iterator_()
+ {
+ return (point_iterator_(
+ const_cast<pointer>(const_iterator_::m_p_value)));
+ }
+
+ // Conversion to a point-type iterator.
+ inline
+ operator const point_iterator_() const
+ {
+ return (point_iterator_(
+ const_cast<pointer>(const_iterator_::m_p_value)));
+ }
+
+ // Access.
+ inline pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_p_value != NULL);
+
+ return (const_cast<pointer>(base_type::m_p_value));
+ }
+
+ // Access.
+ inline reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(base_type::m_p_value != NULL);
+
+ return (const_cast<reference>(*base_type::m_p_value));
+ }
+
+ // Increments.
+ inline iterator_&
+ operator++()
+ {
+ base_type::m_p_tbl->inc_it_state(base_type::m_p_value, base_type::m_pos);
+
+ return (*this);
+ }
+
+ // Increments.
+ inline iterator_
+ operator++(int)
+ {
+ iterator_ ret =* this;
+
+ base_type::m_p_tbl->inc_it_state(base_type::m_p_value, base_type::m_pos);
+
+ return (ret);
+ }
+
+protected:
+ typedef const_iterator_ base_type;
+
+protected:
+
+ /**
+ * Constructor used by the table to initiate the generalized
+ * pointer and position (e.g., this is called from within a find()
+ * of a table.
+ * */
+ inline
+ iterator_(pointer p_value, PB_DS_GEN_POS pos, PB_DS_CLASS_C_DEC* p_tbl) : const_iterator_(p_value, pos, p_tbl)
+ { }
+
+ friend class PB_DS_CLASS_C_DEC;
+};
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp
new file mode 100644
index 0000000..37ce900
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp
@@ -0,0 +1,143 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file point_iterator.hpp
+ * Contains an iterator class returned by the tables' find and insert
+ * methods.
+ */
+
+// Find type iterator.
+class point_iterator_
+{
+
+public:
+
+ // Category.
+ typedef trivial_iterator_tag iterator_category;
+
+ // Difference type.
+ typedef trivial_iterator_difference_type difference_type;
+
+ // Iterator's value type.
+ typedef value_type_ value_type;
+
+ // Iterator's pointer type.
+ typedef pointer_ pointer;
+
+ // Iterator's const pointer type.
+ typedef const_pointer_ const_pointer;
+
+ // Iterator's reference type.
+ typedef reference_ reference;
+
+ // Iterator's const reference type.
+ typedef const_reference_ const_reference;
+
+public:
+
+ // Default constructor.
+ inline
+ point_iterator_()
+
+ : m_p_value(NULL)
+ { }
+
+ // Copy constructor.
+ inline
+ point_iterator_(const point_iterator_& other)
+
+ : m_p_value(other.m_p_value)
+ { }
+
+ // Access.
+ inline pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_value != NULL);
+
+ return (m_p_value);
+ }
+
+ // Access.
+ inline reference
+ operator*() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(m_p_value != NULL);
+
+ return (*m_p_value);
+ }
+
+ // Compares content to a different iterator object.
+ inline bool
+ operator==(const point_iterator_& other) const
+ {
+ return (m_p_value == other.m_p_value);
+ }
+
+ // Compares content to a different iterator object.
+ inline bool
+ operator==(const const_point_iterator_& other) const
+ {
+ return (m_p_value == other.m_p_value);
+ }
+
+ // Compares content to a different iterator object.
+ inline bool
+ operator!=(const point_iterator_& other) const
+ {
+ return (m_p_value != other.m_p_value);
+ }
+
+ // Compares content (negatively) to a different iterator object.
+ inline bool
+ operator!=(const const_point_iterator_& other) const
+ {
+ return (m_p_value != other.m_p_value);
+ }
+
+ inline
+ point_iterator_(pointer p_value) : m_p_value(p_value)
+ { }
+
+protected:
+ friend class const_point_iterator_;
+
+ friend class PB_DS_CLASS_C_DEC;
+
+protected:
+ pointer m_p_value;
+};
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/exception.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/exception.hpp
new file mode 100644
index 0000000..4f796b1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/exception.hpp
@@ -0,0 +1,103 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file exception.hpp
+ * Contains exception classes.
+ */
+
+#ifndef PB_DS_EXCEPTION_HPP
+#define PB_DS_EXCEPTION_HPP
+
+#include <stdexcept>
+#include <cstdlib>
+
+namespace __gnu_pbds
+{
+ // Base class for exceptions.
+ struct container_error : public std::logic_error
+ {
+ container_error()
+ : std::logic_error(__N("__gnu_pbds::container_error")) { }
+ };
+
+ // An entry cannot be inserted into a container object for logical
+ // reasons (not, e.g., if memory is unabvailable, in which case
+ // the allocator_type's exception will be thrown).
+ struct insert_error : public container_error { };
+
+ // A join cannot be performed logical reasons (i.e., the ranges of
+ // the two container objects being joined overlaps.
+ struct join_error : public container_error { };
+
+ // A container cannot be resized.
+ struct resize_error : public container_error { };
+
+#if __EXCEPTIONS
+ inline void
+ __throw_container_error(void)
+ { throw container_error(); }
+
+ inline void
+ __throw_insert_error(void)
+ { throw insert_error(); }
+
+ inline void
+ __throw_join_error(void)
+ { throw join_error(); }
+
+ inline void
+ __throw_resize_error(void)
+ { throw resize_error(); }
+#else
+ inline void
+ __throw_container_error(void)
+ { std::abort(); }
+
+ inline void
+ __throw_insert_error(void)
+ { std::abort(); }
+
+ inline void
+ __throw_join_error(void)
+ { std::abort(); }
+
+ inline void
+ __throw_resize_error(void)
+ { std::abort(); }
+#endif
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/hash_policy.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/hash_policy.hpp
new file mode 100644
index 0000000..24c0c45
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/hash_policy.hpp
@@ -0,0 +1,604 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file hash_policy.hpp
+ * Contains hash-related policies.
+ */
+
+#ifndef PB_DS_HASH_POLICY_HPP
+#define PB_DS_HASH_POLICY_HPP
+
+#include <algorithm>
+#include <vector>
+#include <cmath>
+#include <ext/pb_ds/exception.hpp>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/hash_fn/mask_based_range_hashing.hpp>
+#include <ext/pb_ds/detail/hash_fn/mod_based_range_hashing.hpp>
+#include <ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_size_base.hpp>
+
+namespace __gnu_pbds
+{
+ // A null hash function, indicating that the combining hash function
+ // is actually a ranged hash function.
+ struct null_hash_fn
+ { };
+
+ // A null probe function, indicating that the combining probe
+ // function is actually a ranged probe function.
+ struct null_probe_fn
+ { };
+
+#define PB_DS_CLASS_T_DEC template<typename Size_Type>
+#define PB_DS_CLASS_C_DEC linear_probe_fn<Size_Type>
+
+ // A probe sequence policy using fixed increments.
+ template<typename Size_Type = size_t>
+ class linear_probe_fn
+ {
+ public:
+ typedef Size_Type size_type;
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ protected:
+ // Returns the i-th offset from the hash value.
+ inline size_type
+ operator()(size_type i) const;
+ };
+
+#include <ext/pb_ds/detail/hash_fn/linear_probe_fn_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC template<typename Size_Type>
+#define PB_DS_CLASS_C_DEC quadratic_probe_fn<Size_Type>
+
+ // A probe sequence policy using square increments.
+ template<typename Size_Type = size_t>
+ class quadratic_probe_fn
+ {
+ public:
+ typedef Size_Type size_type;
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ protected:
+ // Returns the i-th offset from the hash value.
+ inline size_type
+ operator()(size_type i) const;
+ };
+
+#include <ext/pb_ds/detail/hash_fn/quadratic_probe_fn_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC template<typename Size_Type>
+#define PB_DS_CLASS_C_DEC direct_mask_range_hashing<Size_Type>
+
+ // A mask range-hashing class (uses a bit-mask).
+ template<typename Size_Type = size_t>
+ class direct_mask_range_hashing
+ : public detail::mask_based_range_hashing<Size_Type>
+ {
+ private:
+ typedef detail::mask_based_range_hashing<Size_Type> mask_based_base;
+
+ public:
+ typedef Size_Type size_type;
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ protected:
+ void
+ notify_resized(size_type size);
+
+ // Transforms the __hash value hash into a ranged-hash value
+ // (using a bit-mask).
+ inline size_type
+ operator()(size_type hash) const;
+ };
+
+#include <ext/pb_ds/detail/hash_fn/direct_mask_range_hashing_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC template<typename Size_Type>
+#define PB_DS_CLASS_C_DEC direct_mod_range_hashing<Size_Type>
+
+ // A mod range-hashing class (uses the modulo function).
+ template<typename Size_Type = size_t>
+ class direct_mod_range_hashing
+ : public detail::mod_based_range_hashing<Size_Type>
+ {
+ public:
+ typedef Size_Type size_type;
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ protected:
+ void
+ notify_resized(size_type size);
+
+ // Transforms the __hash value hash into a ranged-hash value
+ // (using a modulo operation).
+ inline size_type
+ operator()(size_type hash) const;
+
+ private:
+ typedef detail::mod_based_range_hashing<size_type> mod_based_base;
+ };
+
+#include <ext/pb_ds/detail/hash_fn/direct_mod_range_hashing_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC template<bool External_Load_Access, typename Size_Type>
+#define PB_DS_CLASS_C_DEC hash_load_check_resize_trigger<External_Load_Access, Size_Type>
+#define PB_DS_SIZE_BASE_C_DEC detail::hash_load_check_resize_trigger_size_base<Size_Type, External_Load_Access>
+
+ // A resize trigger policy based on a load check. It keeps the
+ // load factor between some load factors load_min and load_max.
+ template<bool External_Load_Access = false, typename Size_Type = size_t>
+ class hash_load_check_resize_trigger : private PB_DS_SIZE_BASE_C_DEC
+ {
+ public:
+ typedef Size_Type size_type;
+
+ enum
+ {
+ external_load_access = External_Load_Access
+ };
+
+ // Default constructor, or constructor taking load_min and
+ // load_max load factors between which this policy will keep the
+ // actual load.
+ hash_load_check_resize_trigger(float load_min = 0.125,
+ float load_max = 0.5);
+
+ void
+ swap(hash_load_check_resize_trigger& other);
+
+ virtual
+ ~hash_load_check_resize_trigger();
+
+ // Returns a pair of the minimal and maximal loads, respectively.
+ inline std::pair<float, float>
+ get_loads() const;
+
+ // Sets the loads through a pair of the minimal and maximal
+ // loads, respectively.
+ void
+ set_loads(std::pair<float, float> load_pair);
+
+ protected:
+ inline void
+ notify_insert_search_start();
+
+ inline void
+ notify_insert_search_collision();
+
+ inline void
+ notify_insert_search_end();
+
+ inline void
+ notify_find_search_start();
+
+ inline void
+ notify_find_search_collision();
+
+ inline void
+ notify_find_search_end();
+
+ inline void
+ notify_erase_search_start();
+
+ inline void
+ notify_erase_search_collision();
+
+ inline void
+ notify_erase_search_end();
+
+ // Notifies an element was inserted. The total number of entries
+ // in the table is num_entries.
+ inline void
+ notify_inserted(size_type num_entries);
+
+ inline void
+ notify_erased(size_type num_entries);
+
+ // Notifies the table was cleared.
+ void
+ notify_cleared();
+
+ // Notifies the table was resized as a result of this object's
+ // signifying that a resize is needed.
+ void
+ notify_resized(size_type new_size);
+
+ void
+ notify_externally_resized(size_type new_size);
+
+ inline bool
+ is_resize_needed() const;
+
+ inline bool
+ is_grow_needed(size_type size, size_type num_entries) const;
+
+ private:
+ virtual void
+ do_resize(size_type new_size);
+
+ typedef PB_DS_SIZE_BASE_C_DEC size_base;
+
+#ifdef _GLIBCXX_DEBUG
+ void
+ assert_valid() const;
+#endif
+
+ float m_load_min;
+ float m_load_max;
+ size_type m_next_shrink_size;
+ size_type m_next_grow_size;
+ bool m_resize_needed;
+ };
+
+#include <ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_SIZE_BASE_C_DEC
+
+#define PB_DS_CLASS_T_DEC template<bool External_Load_Access, typename Size_Type>
+#define PB_DS_CLASS_C_DEC cc_hash_max_collision_check_resize_trigger<External_Load_Access, Size_Type>
+
+ // A resize trigger policy based on collision checks. It keeps the
+ // simulated load factor lower than some given load factor.
+ template<bool External_Load_Access = false, typename Size_Type = size_t>
+ class cc_hash_max_collision_check_resize_trigger
+ {
+ public:
+ typedef Size_Type size_type;
+
+ enum
+ {
+ external_load_access = External_Load_Access
+ };
+
+ // Default constructor, or constructor taking load, a __load
+ // factor which it will attempt to maintain.
+ cc_hash_max_collision_check_resize_trigger(float load = 0.5);
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ // Returns the current load.
+ inline float
+ get_load() const;
+
+ // Sets the load; does not resize the container.
+ void
+ set_load(float load);
+
+ protected:
+ inline void
+ notify_insert_search_start();
+
+ inline void
+ notify_insert_search_collision();
+
+ inline void
+ notify_insert_search_end();
+
+ inline void
+ notify_find_search_start();
+
+ inline void
+ notify_find_search_collision();
+
+ inline void
+ notify_find_search_end();
+
+ inline void
+ notify_erase_search_start();
+
+ inline void
+ notify_erase_search_collision();
+
+ inline void
+ notify_erase_search_end();
+
+ inline void
+ notify_inserted(size_type num_entries);
+
+ inline void
+ notify_erased(size_type num_entries);
+
+ void
+ notify_cleared();
+
+ // Notifies the table was resized as a result of this object's
+ // signifying that a resize is needed.
+ void
+ notify_resized(size_type new_size);
+
+ void
+ notify_externally_resized(size_type new_size);
+
+ inline bool
+ is_resize_needed() const;
+
+ inline bool
+ is_grow_needed(size_type size, size_type num_entries) const;
+
+ private:
+ void
+ calc_max_num_coll();
+
+ inline void
+ calc_resize_needed();
+
+ float m_load;
+ size_type m_size;
+ size_type m_num_col;
+ size_type m_max_col;
+ bool m_resize_needed;
+ };
+
+#include <ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC template<typename Size_Type>
+#define PB_DS_CLASS_C_DEC hash_exponential_size_policy<Size_Type>
+
+ // A size policy whose sequence of sizes form an exponential
+ // sequence (typically powers of 2.
+ template<typename Size_Type = size_t>
+ class hash_exponential_size_policy
+ {
+ public:
+ typedef Size_Type size_type;
+
+ // Default constructor, or onstructor taking a start_size, or
+ // constructor taking a start size and grow_factor. The policy
+ // will use the sequence of sizes start_size, start_size*
+ // grow_factor, start_size* grow_factor^2, ...
+ hash_exponential_size_policy(size_type start_size = 8,
+ size_type grow_factor = 2);
+
+ void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ protected:
+ size_type
+ get_nearest_larger_size(size_type size) const;
+
+ size_type
+ get_nearest_smaller_size(size_type size) const;
+
+ private:
+ size_type m_start_size;
+ size_type m_grow_factor;
+ };
+
+#include <ext/pb_ds/detail/resize_policy/hash_exponential_size_policy_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC
+#define PB_DS_CLASS_C_DEC hash_prime_size_policy
+
+ // A size policy whose sequence of sizes form a nearly-exponential
+ // sequence of primes.
+ class hash_prime_size_policy
+ {
+ public:
+ // Size type.
+ typedef size_t size_type;
+
+ // Default constructor, or onstructor taking a start_size The
+ // policy will use the sequence of sizes approximately
+ // start_size, start_size* 2, start_size* 2^2, ...
+ hash_prime_size_policy(size_type start_size = 8);
+
+ inline void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ protected:
+ size_type
+ get_nearest_larger_size(size_type size) const;
+
+ size_type
+ get_nearest_smaller_size(size_type size) const;
+
+ private:
+ size_type m_start_size;
+ };
+
+#include <ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC template<typename Size_Policy, typename Trigger_Policy, bool External_Size_Access, typename Size_Type>
+
+#define PB_DS_CLASS_C_DEC hash_standard_resize_policy<Size_Policy, Trigger_Policy, External_Size_Access, Size_Type>
+
+ // A resize policy which delegates operations to size and trigger policies.
+ template<typename Size_Policy = hash_exponential_size_policy<>,
+ typename Trigger_Policy = hash_load_check_resize_trigger<>,
+ bool External_Size_Access = false,
+ typename Size_Type = size_t>
+ class hash_standard_resize_policy
+ : public Size_Policy, public Trigger_Policy
+ {
+ public:
+ typedef Size_Type size_type;
+ typedef Trigger_Policy trigger_policy;
+ typedef Size_Policy size_policy;
+
+ enum
+ {
+ external_size_access = External_Size_Access
+ };
+
+ // Default constructor.
+ hash_standard_resize_policy();
+
+ // constructor taking some policies r_size_policy will be copied
+ // by the Size_Policy object of this object.
+ hash_standard_resize_policy(const Size_Policy& r_size_policy);
+
+ // constructor taking some policies. r_size_policy will be
+ // copied by the Size_Policy object of this
+ // object. r_trigger_policy will be copied by the Trigger_Policy
+ // object of this object.
+ hash_standard_resize_policy(const Size_Policy& r_size_policy,
+ const Trigger_Policy& r_trigger_policy);
+
+ virtual
+ ~hash_standard_resize_policy();
+
+ inline void
+ swap(PB_DS_CLASS_C_DEC& other);
+
+ // Access to the Size_Policy object used.
+ Size_Policy&
+ get_size_policy();
+
+ // Const access to the Size_Policy object used.
+ const Size_Policy&
+ get_size_policy() const;
+
+ // Access to the Trigger_Policy object used.
+ Trigger_Policy&
+ get_trigger_policy();
+
+ // Access to the Trigger_Policy object used.
+ const Trigger_Policy&
+ get_trigger_policy() const;
+
+ // Returns the actual size of the container.
+ inline size_type
+ get_actual_size() const;
+
+ // Resizes the container to suggested_new_size, a suggested size
+ // (the actual size will be determined by the Size_Policy
+ // object).
+ void
+ resize(size_type suggested_new_size);
+
+ protected:
+ inline void
+ notify_insert_search_start();
+
+ inline void
+ notify_insert_search_collision();
+
+ inline void
+ notify_insert_search_end();
+
+ inline void
+ notify_find_search_start();
+
+ inline void
+ notify_find_search_collision();
+
+ inline void
+ notify_find_search_end();
+
+ inline void
+ notify_erase_search_start();
+
+ inline void
+ notify_erase_search_collision();
+
+ inline void
+ notify_erase_search_end();
+
+ inline void
+ notify_inserted(size_type num_e);
+
+ inline void
+ notify_erased(size_type num_e);
+
+ void
+ notify_cleared();
+
+ void
+ notify_resized(size_type new_size);
+
+ inline bool
+ is_resize_needed() const;
+
+ // Queries what the new size should be, when the container is
+ // resized naturally. The current __size of the container is
+ // size, and the number of used entries within the container is
+ // num_used_e.
+ size_type
+ get_new_size(size_type size, size_type num_used_e) const;
+
+ private:
+ // Resizes to new_size.
+ virtual void
+ do_resize(size_type new_size);
+
+ typedef Trigger_Policy trigger_policy_base;
+
+ typedef Size_Policy size_policy_base;
+
+ size_type m_size;
+ };
+
+#include <ext/pb_ds/detail/resize_policy/hash_standard_resize_policy_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/list_update_policy.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/list_update_policy.hpp
new file mode 100644
index 0000000..ec05b69
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/list_update_policy.hpp
@@ -0,0 +1,136 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file list_update_policy.hpp
+ * Contains policies for list update containers.
+ */
+
+#ifndef PB_DS_LU_POLICY_HPP
+#define PB_DS_LU_POLICY_HPP
+
+#include <cstdlib>
+#include <ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp>
+
+namespace __gnu_pbds
+{
+ // A null type that means that each link in a list-based container
+ // does not actually need metadata.
+ struct null_lu_metadata
+ { };
+
+#define PB_DS_CLASS_T_DEC template<typename Allocator>
+#define PB_DS_CLASS_C_DEC move_to_front_lu_policy<Allocator>
+
+ // A list-update policy that unconditionally moves elements to the
+ // front of the list.
+ template<typename Allocator = std::allocator<char> >
+ class move_to_front_lu_policy
+ {
+ public:
+ typedef Allocator allocator_type;
+
+ // Metadata on which this functor operates.
+ typedef null_lu_metadata metadata_type;
+
+ // Reference to metadata on which this functor operates.
+ typedef typename allocator_type::template rebind<metadata_type>::other metadata_rebind;
+ typedef typename metadata_rebind::reference metadata_reference;
+
+ // Creates a metadata object.
+ metadata_type
+ operator()() const;
+
+ // Decides whether a metadata object should be moved to the front
+ // of the list.
+ inline bool
+ operator()(metadata_reference r_metadata) const;
+
+ private:
+ static null_lu_metadata s_metadata;
+ };
+
+#include <ext/pb_ds/detail/list_update_policy/mtf_lu_policy_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC template<size_t Max_Count, class Allocator>
+#define PB_DS_CLASS_C_DEC counter_lu_policy<Max_Count, Allocator>
+
+ // A list-update policy that moves elements to the front of the list
+ // based on the counter algorithm.
+ template<size_t Max_Count = 5, typename Allocator = std::allocator<char> >
+ class counter_lu_policy
+ : private detail::counter_lu_policy_base<typename Allocator::size_type>
+ {
+ public:
+ typedef Allocator allocator_type;
+
+ enum
+ {
+ max_count = Max_Count
+ };
+
+ typedef typename allocator_type::size_type size_type;
+
+ // Metadata on which this functor operates.
+ typedef detail::counter_lu_metadata<size_type> metadata_type;
+
+ // Reference to metadata on which this functor operates.
+ typedef typename Allocator::template rebind<metadata_type>::other metadata_rebind;
+ typedef typename metadata_rebind::reference metadata_reference;
+
+ // Creates a metadata object.
+ metadata_type
+ operator()() const;
+
+ // Decides whether a metadata object should be moved to the front
+ // of the list.
+ bool
+ operator()(metadata_reference r_metadata) const;
+
+ private:
+ typedef detail::counter_lu_policy_base<typename Allocator::size_type> base_type;
+ };
+
+#include <ext/pb_ds/detail/list_update_policy/counter_lu_policy_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/priority_queue.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/priority_queue.hpp
new file mode 100644
index 0000000..531f70c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/priority_queue.hpp
@@ -0,0 +1,125 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file priority_queue.hpp
+ * Contains priority_queues.
+ */
+
+#ifndef PB_DS_PRIORITY_QUEUE_HPP
+#define PB_DS_PRIORITY_QUEUE_HPP
+
+#include <ext/pb_ds/tag_and_trait.hpp>
+#include <ext/pb_ds/detail/priority_queue_base_dispatch.hpp>
+#include <ext/pb_ds/detail/standard_policies.hpp>
+
+namespace __gnu_pbds
+{
+ // A priority queue.
+ template<typename Value_Type,
+ typename Cmp_Fn = std::less<Value_Type>,
+ typename Tag = pairing_heap_tag,
+ typename Allocator = std::allocator<char> >
+ class priority_queue
+ : public detail::priority_queue_base_dispatch<Value_Type,Cmp_Fn,Tag,Allocator>::type
+ {
+ private:
+ typedef typename detail::priority_queue_base_dispatch<Value_Type,Cmp_Fn,Tag,Allocator>::type base_type;
+
+ public:
+ typedef Value_Type value_type;
+ typedef Cmp_Fn cmp_fn;
+ typedef Tag container_category;
+ typedef Allocator allocator_type;
+ typedef typename allocator_type::size_type size_type;
+ typedef typename allocator_type::difference_type difference_type;
+
+ typedef typename allocator_type::template rebind<value_type>::other value_rebind;
+ typedef typename value_rebind::reference reference;
+ typedef typename value_rebind::const_reference const_reference;
+ typedef typename value_rebind::pointer pointer;
+ typedef typename value_rebind::const_pointer const_pointer;
+
+ typedef typename base_type::const_point_iterator const_point_iterator;
+ typedef typename base_type::point_iterator point_iterator;
+ typedef typename base_type::const_iterator const_iterator;
+ typedef typename base_type::iterator iterator;
+
+ priority_queue() { }
+
+ // Constructor taking some policy objects. r_cmp_fn will be copied
+ // by the Cmp_Fn object of the container object.
+ priority_queue(const cmp_fn& r_cmp_fn) : base_type(r_cmp_fn) { }
+
+ // Constructor taking __iterators to a range of value_types. The
+ // value_types between first_it and last_it will be inserted into
+ // the container object.
+ template<typename It>
+ priority_queue(It first_it, It last_it)
+ { base_type::copy_from_range(first_it, last_it); }
+
+ // Constructor taking __iterators to a range of value_types and
+ // some policy objects The value_types between first_it and
+ // last_it will be inserted into the container object. r_cmp_fn
+ // will be copied by the cmp_fn object of the container object.
+ template<typename It>
+ priority_queue(It first_it, It last_it, const cmp_fn& r_cmp_fn)
+ : base_type(r_cmp_fn)
+ { base_type::copy_from_range(first_it, last_it); }
+
+ priority_queue(const priority_queue& other)
+ : base_type((const base_type& )other) { }
+
+ virtual
+ ~priority_queue() { }
+
+ priority_queue&
+ operator=(const priority_queue& other)
+ {
+ if (this != &other)
+ {
+ priority_queue tmp(other);
+ swap(tmp);
+ }
+ return *this;
+ }
+
+ void
+ swap(priority_queue& other)
+ { base_type::swap(other); }
+ };
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/tag_and_trait.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/tag_and_trait.hpp
new file mode 100644
index 0000000..ccd2533
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/tag_and_trait.hpp
@@ -0,0 +1,363 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file tag_and_trait.hpp
+ * Contains tags and traits, e.g., ones describing underlying
+ * data structures.
+ */
+
+#ifndef PB_DS_TAG_AND_TRAIT_HPP
+#define PB_DS_TAG_AND_TRAIT_HPP
+
+#include <ext/pb_ds/detail/type_utils.hpp>
+
+/**
+ * @namespace __gnu_pbds
+ * @brief GNU extensions for policy-based data structures for public use.
+ */
+namespace __gnu_pbds
+{
+ // A trivial iterator tag. Signifies that the iterators has none of
+ // the STL's movement abilities.
+ struct trivial_iterator_tag
+ { };
+
+ // Prohibit moving trivial iterators.
+ typedef void trivial_iterator_difference_type;
+
+
+ // Signifies a basic invalidation guarantee that any iterator,
+ // pointer, or reference to a container object's mapped value type
+ // is valid as long as the container is not modified.
+ struct basic_invalidation_guarantee
+ { };
+
+ // Signifies an invalidation guarantee that includes all those of
+ // its base, and additionally, that any point-type iterator,
+ // pointer, or reference to a container object's mapped value type
+ // is valid as long as its corresponding entry has not be erased,
+ // regardless of modifications to the container object.
+ struct point_invalidation_guarantee : public basic_invalidation_guarantee
+ { };
+
+ // Signifies an invalidation guarantee that includes all those of
+ // its base, and additionally, that any range-type iterator
+ // (including the returns of begin() and end()) is in the correct
+ // relative positions to other range-type iterators as long as its
+ // corresponding entry has not be erased, regardless of
+ // modifications to the container object.
+ struct range_invalidation_guarantee : public point_invalidation_guarantee
+ { };
+
+
+ /// A mapped-policy indicating that an associative container is a set.
+ // XXX should this be a trait of the form is_set<T> ??
+ struct null_mapped_type { };
+
+
+ /// Base data structure tag.
+ struct container_tag
+ { };
+
+ /// Basic string container, inclusive of strings, ropes, etc.
+ struct string_tag : public container_tag { };
+
+ /// Basic sequence.
+ struct sequence_tag : public container_tag { };
+
+ /// Basic associative-container.
+ struct associative_container_tag : public container_tag { };
+
+ /// Basic hash.
+ struct basic_hash_tag : public associative_container_tag { };
+
+ /// Collision-chaining hash.
+ struct cc_hash_tag : public basic_hash_tag { };
+
+ /// General-probing hash.
+ struct gp_hash_tag : public basic_hash_tag { };
+
+ /// Basic tree.
+ struct basic_tree_tag : public associative_container_tag { };
+
+ /// tree.
+ struct tree_tag : public basic_tree_tag { };
+
+ /// Red-black tree.
+ struct rb_tree_tag : public tree_tag { };
+
+ /// Splay tree.
+ struct splay_tree_tag : public tree_tag { };
+
+ /// Ordered-vector tree.
+ struct ov_tree_tag : public tree_tag { };
+
+ /// trie.
+ struct trie_tag : public basic_tree_tag { };
+
+ /// PATRICIA trie.
+ struct pat_trie_tag : public trie_tag { };
+
+ /// List-update.
+ struct list_update_tag : public associative_container_tag { };
+
+ /// Basic priority-queue.
+ struct priority_queue_tag : public container_tag { };
+
+ /// Pairing-heap.
+ struct pairing_heap_tag : public priority_queue_tag { };
+
+ /// Binomial-heap.
+ struct binomial_heap_tag : public priority_queue_tag { };
+
+ /// Redundant-counter binomial-heap.
+ struct rc_binomial_heap_tag : public priority_queue_tag { };
+
+ /// Binary-heap (array-based).
+ struct binary_heap_tag : public priority_queue_tag { };
+
+ /// Thin heap.
+ struct thin_heap_tag : public priority_queue_tag { };
+
+
+ /// Base traits type for containers.
+ template<typename Tag>
+ struct container_traits_base;
+
+ template<>
+ struct container_traits_base<cc_hash_tag>
+ {
+ typedef cc_hash_tag container_category;
+ typedef point_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = false,
+ erase_can_throw = false,
+ split_join_can_throw = false,
+ reverse_iteration = false
+ };
+ };
+
+ template<>
+ struct container_traits_base<gp_hash_tag>
+ {
+ typedef gp_hash_tag container_category;
+ typedef basic_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = false,
+ erase_can_throw = false,
+ split_join_can_throw = false,
+ reverse_iteration = false
+ };
+ };
+
+ template<>
+ struct container_traits_base<rb_tree_tag>
+ {
+ typedef rb_tree_tag container_category;
+ typedef range_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = true,
+ erase_can_throw = false,
+ split_join_can_throw = false,
+ reverse_iteration = true
+ };
+ };
+
+ template<>
+ struct container_traits_base<splay_tree_tag>
+ {
+ typedef splay_tree_tag container_category;
+ typedef range_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = true,
+ erase_can_throw = false,
+ split_join_can_throw = false,
+ reverse_iteration = true
+ };
+ };
+
+ template<>
+ struct container_traits_base<ov_tree_tag>
+ {
+ typedef ov_tree_tag container_category;
+ typedef basic_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = true,
+ erase_can_throw = true,
+ split_join_can_throw = true,
+ reverse_iteration = false
+ };
+ };
+
+ template<>
+ struct container_traits_base<pat_trie_tag>
+ {
+ typedef pat_trie_tag container_category;
+ typedef range_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = true,
+ erase_can_throw = false,
+ split_join_can_throw = true,
+ reverse_iteration = true
+ };
+ };
+
+ template<>
+ struct container_traits_base<list_update_tag>
+ {
+ typedef list_update_tag container_category;
+ typedef point_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = false,
+ erase_can_throw = false,
+ split_join_can_throw = false,
+ reverse_iteration = false
+ };
+ };
+
+
+ template<>
+ struct container_traits_base<pairing_heap_tag>
+ {
+ typedef pairing_heap_tag container_category;
+ typedef point_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = false,
+ erase_can_throw = false,
+ split_join_can_throw = false,
+ reverse_iteration = false
+ };
+ };
+
+ template<>
+ struct container_traits_base<thin_heap_tag>
+ {
+ typedef thin_heap_tag container_category;
+ typedef point_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = false,
+ erase_can_throw = false,
+ split_join_can_throw = false,
+ reverse_iteration = false
+ };
+ };
+
+ template<>
+ struct container_traits_base<binomial_heap_tag>
+ {
+ typedef binomial_heap_tag container_category;
+ typedef point_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = false,
+ erase_can_throw = false,
+ split_join_can_throw = false,
+ reverse_iteration = false
+ };
+ };
+
+ template<>
+ struct container_traits_base<rc_binomial_heap_tag>
+ {
+ typedef rc_binomial_heap_tag container_category;
+ typedef point_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = false,
+ erase_can_throw = false,
+ split_join_can_throw = false,
+ reverse_iteration = false
+ };
+ };
+
+ template<>
+ struct container_traits_base<binary_heap_tag>
+ {
+ typedef binary_heap_tag container_category;
+ typedef basic_invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = false,
+ erase_can_throw = false,
+ split_join_can_throw = true,
+ reverse_iteration = false
+ };
+ };
+
+
+ /// container_traits
+ // See Matt Austern for the name, S. Meyers MEFC++ #2, others.
+ template<typename Cntnr>
+ struct container_traits
+ : public container_traits_base<typename Cntnr::container_category>
+ {
+ typedef Cntnr container_type;
+ typedef typename Cntnr::container_category container_category;
+ typedef container_traits_base<container_category> base_type;
+ typedef typename base_type::invalidation_guarantee invalidation_guarantee;
+
+ enum
+ {
+ order_preserving = base_type::order_preserving,
+ erase_can_throw = base_type::erase_can_throw,
+ split_join_can_throw = base_type::split_join_can_throw,
+ reverse_iteration = base_type::reverse_iteration
+ };
+ };
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/tree_policy.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/tree_policy.hpp
new file mode 100644
index 0000000..990860e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/tree_policy.hpp
@@ -0,0 +1,162 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file tree_policy.hpp
+ * Contains tree-related policies.
+ */
+
+#ifndef PB_DS_TREE_POLICY_HPP
+#define PB_DS_TREE_POLICY_HPP
+
+#include <iterator>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp>
+
+namespace __gnu_pbds
+{
+ // A null node updator, indicating that no node updates are required.
+ template<typename Const_Node_Iterator,
+ typename Node_Iterator,
+ typename Cmp_Fn,
+ typename Allocator>
+ struct null_tree_node_update
+ { };
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Const_Node_Iterator, class Node_Iterator, class Cmp_Fn, class Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ tree_order_statistics_node_update<Const_Node_Iterator, Node_Iterator, Cmp_Fn, Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ detail::basic_tree_policy_base<Const_Node_Iterator, Node_Iterator, Allocator>
+
+ // Functor updating ranks of entrees.
+ template<typename Const_Node_Iterator, typename Node_Iterator,
+ typename Cmp_Fn, typename Allocator>
+ class tree_order_statistics_node_update : private PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ typedef Cmp_Fn cmp_fn;
+ typedef Allocator allocator_type;
+ typedef typename allocator_type::size_type size_type;
+ typedef typename base_type::key_type key_type;
+ typedef typename base_type::const_key_reference const_key_reference;
+
+ typedef size_type metadata_type;
+ typedef Const_Node_Iterator const_node_iterator;
+ typedef Node_Iterator node_iterator;
+ typedef typename const_node_iterator::value_type const_iterator;
+ typedef typename node_iterator::value_type iterator;
+
+ // Finds an entry by __order. Returns a const_iterator to the
+ // entry with the __order order, or a const_iterator to the
+ // container object's end if order is at least the size of the
+ // container object.
+ inline const_iterator
+ find_by_order(size_type order) const;
+
+ // Finds an entry by __order. Returns an iterator to the entry
+ // with the __order order, or an iterator to the container
+ // object's end if order is at least the size of the container
+ // object.
+ inline iterator
+ find_by_order(size_type order);
+
+ // Returns the order of a key within a sequence. For exapmle, if
+ // r_key is the smallest key, this method will return 0; if r_key
+ // is a key between the smallest and next key, this method will
+ // return 1; if r_key is a key larger than the largest key, this
+ // method will return the size of r_c.
+ inline size_type
+ order_of_key(const_key_reference r_key) const;
+
+ private:
+ // Const reference to the container's value-type.
+ typedef typename base_type::const_reference const_reference;
+
+ // Const pointer to the container's value-type.
+ typedef typename base_type::const_pointer const_pointer;
+
+ typedef typename allocator_type::template rebind<metadata_type>::other metadata_rebind;
+ // Const metadata reference.
+ typedef typename metadata_rebind::const_reference const_metadata_reference;
+
+ // Metadata reference.
+ typedef typename metadata_rebind::reference metadata_reference;
+
+ // Returns the const_node_iterator associated with the tree's root node.
+ virtual const_node_iterator
+ node_begin() const = 0;
+
+ // Returns the node_iterator associated with the tree's root node.
+ virtual node_iterator
+ node_begin() = 0;
+
+ // Returns the const_node_iterator associated with a just-after leaf node.
+ virtual const_node_iterator
+ node_end() const = 0;
+
+ // Returns the node_iterator associated with a just-after leaf node.
+ virtual node_iterator
+ node_end() = 0;
+
+ // Access to the cmp_fn object.
+ virtual cmp_fn&
+ get_cmp_fn() = 0;
+
+ protected:
+ // Updates the rank of a node through a node_iterator node_it;
+ // end_nd_it is the end node iterator.
+ inline void
+ operator()(node_iterator node_it, const_node_iterator end_nd_it) const;
+
+ virtual
+ ~tree_order_statistics_node_update();
+ };
+
+#include <ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_BASE_C_DEC
+
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/trie_policy.hpp b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/trie_policy.hpp
new file mode 100644
index 0000000..c10591b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pb_ds/trie_policy.hpp
@@ -0,0 +1,355 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/**
+ * @file trie_policy.hpp
+ * Contains trie-related policies.
+ */
+
+#ifndef PB_DS_TRIE_POLICY_HPP
+#define PB_DS_TRIE_POLICY_HPP
+
+#include <string>
+#include <ext/pb_ds/detail/type_utils.hpp>
+#include <ext/pb_ds/detail/trie_policy/trie_policy_base.hpp>
+
+namespace __gnu_pbds
+{
+ // A null node updator, indicating that no node updates are required.
+ template<typename Const_Node_Iterator,
+ typename Node_Iterator,
+ typename E_Access_Traits,
+ typename Allocator>
+ struct null_trie_node_update
+ { };
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename String, typename String::value_type Min_E_Val, typename String::value_type Max_E_Val, bool Reverse, typename Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ string_trie_e_access_traits<String, Min_E_Val,Max_E_Val,Reverse,Allocator>
+
+ // Element access traits for string types.
+ template<typename String = std::string,
+ typename String::value_type Min_E_Val = detail::__numeric_traits<typename String::value_type>::__min,
+ typename String::value_type Max_E_Val = detail::__numeric_traits<typename String::value_type>::__max,
+ bool Reverse = false,
+ typename Allocator = std::allocator<char> >
+ struct string_trie_e_access_traits
+ {
+ public:
+ typedef typename Allocator::size_type size_type;
+ typedef String key_type;
+ typedef typename Allocator::template rebind<key_type>::other key_rebind;
+ typedef typename key_rebind::const_reference const_key_reference;
+
+ enum
+ {
+ reverse = Reverse
+ };
+
+ // Element const iterator type.
+ typedef typename detail::__conditional_type<Reverse, typename String::const_reverse_iterator, typename String::const_iterator>::__type const_iterator;
+
+ // Element type.
+ typedef typename std::iterator_traits<const_iterator>::value_type e_type;
+
+ enum
+ {
+ min_e_val = Min_E_Val,
+ max_e_val = Max_E_Val,
+ max_size = max_e_val - min_e_val + 1
+ };
+ PB_DS_STATIC_ASSERT(min_max_size, max_size >= 2);
+
+ // Returns a const_iterator to the first element of
+ // const_key_reference agumnet.
+ inline static const_iterator
+ begin(const_key_reference);
+
+ // Returns a const_iterator to the after-last element of
+ // const_key_reference argument.
+ inline static const_iterator
+ end(const_key_reference);
+
+ // Maps an element to a position.
+ inline static size_type
+ e_pos(e_type e);
+
+ private:
+
+ inline static const_iterator
+ begin_imp(const_key_reference, detail::false_type);
+
+ inline static const_iterator
+ begin_imp(const_key_reference, detail::true_type);
+
+ inline static const_iterator
+ end_imp(const_key_reference, detail::false_type);
+
+ inline static const_iterator
+ end_imp(const_key_reference, detail::true_type);
+
+ static detail::integral_constant<int, Reverse> s_rev_ind;
+ };
+
+#include <ext/pb_ds/detail/trie_policy/string_trie_e_access_traits_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_T_DEC \
+ template<typename Const_Node_Iterator,typename Node_Iterator,class E_Access_Traits, typename Allocator>
+
+#define PB_DS_CLASS_C_DEC \
+ trie_prefix_search_node_update<Const_Node_Iterator, Node_Iterator, E_Access_Traits,Allocator>
+
+#define PB_DS_BASE_C_DEC \
+ detail::trie_policy_base<Const_Node_Iterator,Node_Iterator,E_Access_Traits, Allocator>
+
+ // A node updator that allows tries to be searched for the range of
+ // values that match a certain prefix.
+ template<typename Const_Node_Iterator,
+ typename Node_Iterator,
+ typename E_Access_Traits,
+ typename Allocator>
+ class trie_prefix_search_node_update : private PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ typedef typename base_type::key_type key_type;
+ typedef typename base_type::const_key_reference const_key_reference;
+
+ // Element access traits.
+ typedef E_Access_Traits e_access_traits;
+
+ // Const element iterator.
+ typedef typename e_access_traits::const_iterator const_e_iterator;
+
+ // Allocator type.
+ typedef Allocator allocator_type;
+
+ // Size type.
+ typedef typename allocator_type::size_type size_type;
+ typedef detail::null_node_metadata metadata_type;
+ typedef Const_Node_Iterator const_node_iterator;
+ typedef Node_Iterator node_iterator;
+ typedef typename const_node_iterator::value_type const_iterator;
+ typedef typename node_iterator::value_type iterator;
+
+ // Finds the const iterator range corresponding to all values
+ // whose prefixes match r_key.
+ std::pair<const_iterator, const_iterator>
+ prefix_range(const_key_reference) const;
+
+ // Finds the iterator range corresponding to all values whose
+ // prefixes match r_key.
+ std::pair<iterator, iterator>
+ prefix_range(const_key_reference);
+
+ // Finds the const iterator range corresponding to all values
+ // whose prefixes match [b, e).
+ std::pair<const_iterator, const_iterator>
+ prefix_range(const_e_iterator, const_e_iterator) const;
+
+ // Finds the iterator range corresponding to all values whose
+ // prefixes match [b, e).
+ std::pair<iterator, iterator>
+ prefix_range(const_e_iterator, const_e_iterator);
+
+ protected:
+ // Called to update a node's metadata.
+ inline void
+ operator()(node_iterator node_it, const_node_iterator end_nd_it) const;
+
+ private:
+ // Returns the const iterator associated with the just-after last element.
+ virtual const_iterator
+ end() const = 0;
+
+ // Returns the iterator associated with the just-after last element.
+ virtual iterator
+ end() = 0;
+
+ // Returns the const_node_iterator associated with the trie's root node.
+ virtual const_node_iterator
+ node_begin() const = 0;
+
+ // Returns the node_iterator associated with the trie's root node.
+ virtual node_iterator
+ node_begin() = 0;
+
+ // Returns the const_node_iterator associated with a just-after leaf node.
+ virtual const_node_iterator
+ node_end() const = 0;
+
+ // Returns the node_iterator associated with a just-after leaf node.
+ virtual node_iterator
+ node_end() = 0;
+
+ // Access to the cmp_fn object.
+ virtual const e_access_traits&
+ get_e_access_traits() const = 0;
+
+ node_iterator
+ next_child(node_iterator, const_e_iterator, const_e_iterator,
+ node_iterator, const e_access_traits&);
+ };
+
+#include <ext/pb_ds/detail/trie_policy/prefix_search_node_update_imp.hpp>
+
+#undef PB_DS_CLASS_C_DEC
+
+#define PB_DS_CLASS_C_DEC \
+ trie_order_statistics_node_update<Const_Node_Iterator, Node_Iterator,E_Access_Traits, Allocator>
+
+ // Functor updating ranks of entrees.
+ template<typename Const_Node_Iterator,
+ typename Node_Iterator,
+ typename E_Access_Traits,
+ typename Allocator>
+ class trie_order_statistics_node_update : private PB_DS_BASE_C_DEC
+ {
+ private:
+ typedef PB_DS_BASE_C_DEC base_type;
+
+ public:
+ typedef E_Access_Traits e_access_traits;
+ typedef typename e_access_traits::const_iterator const_e_iterator;
+ typedef Allocator allocator_type;
+ typedef typename allocator_type::size_type size_type;
+ typedef typename base_type::key_type key_type;
+ typedef typename base_type::const_key_reference const_key_reference;
+
+ typedef size_type metadata_type;
+ typedef Const_Node_Iterator const_node_iterator;
+ typedef Node_Iterator node_iterator;
+ typedef typename const_node_iterator::value_type const_iterator;
+ typedef typename node_iterator::value_type iterator;
+
+ // Finds an entry by __order. Returns a const_iterator to the
+ // entry with the __order order, or a const_iterator to the
+ // container object's end if order is at least the size of the
+ // container object.
+ inline const_iterator
+ find_by_order(size_type) const;
+
+ // Finds an entry by __order. Returns an iterator to the entry
+ // with the __order order, or an iterator to the container
+ // object's end if order is at least the size of the container
+ // object.
+ inline iterator
+ find_by_order(size_type);
+
+ // Returns the order of a key within a sequence. For exapmle, if
+ // r_key is the smallest key, this method will return 0; if r_key
+ // is a key between the smallest and next key, this method will
+ // return 1; if r_key is a key larger than the largest key, this
+ // method will return the size of r_c.
+ inline size_type
+ order_of_key(const_key_reference) const;
+
+ // Returns the order of a prefix within a sequence. For exapmle,
+ // if [b, e] is the smallest prefix, this method will return 0; if
+ // r_key is a key between the smallest and next key, this method
+ // will return 1; if r_key is a key larger than the largest key,
+ // this method will return the size of r_c.
+ inline size_type
+ order_of_prefix(const_e_iterator, const_e_iterator) const;
+
+ private:
+ typedef typename base_type::const_reference const_reference;
+ typedef typename base_type::const_pointer const_pointer;
+
+ typedef typename Allocator::template rebind<metadata_type>::other metadata_rebind;
+ typedef typename metadata_rebind::const_reference const_metadata_reference;
+ typedef typename metadata_rebind::reference metadata_reference;
+
+ // Returns true if the container is empty.
+ virtual bool
+ empty() const = 0;
+
+ // Returns the iterator associated with the trie's first element.
+ virtual iterator
+ begin() = 0;
+
+ // Returns the iterator associated with the trie's
+ // just-after-last element.
+ virtual iterator
+ end() = 0;
+
+ // Returns the const_node_iterator associated with the trie's root node.
+ virtual const_node_iterator
+ node_begin() const = 0;
+
+ // Returns the node_iterator associated with the trie's root node.
+ virtual node_iterator
+ node_begin() = 0;
+
+ // Returns the const_node_iterator associated with a just-after
+ // leaf node.
+ virtual const_node_iterator
+ node_end() const = 0;
+
+ // Returns the node_iterator associated with a just-after leaf node.
+ virtual node_iterator
+ node_end() = 0;
+
+ // Access to the cmp_fn object.
+ virtual e_access_traits&
+ get_e_access_traits() = 0;
+
+ protected:
+ // Updates the rank of a node through a node_iterator node_it;
+ // end_nd_it is the end node iterator.
+ inline void
+ operator()(node_iterator, const_node_iterator) const;
+
+ // Destructor.
+ virtual
+ ~trie_order_statistics_node_update();
+ };
+
+#include <ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp>
+
+#undef PB_DS_CLASS_T_DEC
+#undef PB_DS_CLASS_C_DEC
+#undef PB_DS_BASE_C_DEC
+
+} // namespace __gnu_pbds
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pod_char_traits.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pod_char_traits.h
new file mode 100644
index 0000000..2797c1b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pod_char_traits.h
@@ -0,0 +1,182 @@
+// POD character, std::char_traits specialization -*- C++ -*-
+
+// Copyright (C) 2002, 2003, 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/pod_char_traits.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+// Gabriel Dos Reis <gdr@integrable-solutions.net>
+// Benjamin Kosnik <bkoz@redhat.com>
+
+#ifndef _POD_CHAR_TRAITS_H
+#define _POD_CHAR_TRAITS_H 1
+
+#include <string>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // POD character abstraction.
+ // NB: The char_type parameter is a subset of int_type, as to allow
+ // int_type to properly hold the full range of char_type values as
+ // well as EOF.
+ /// @brief A POD class that serves as a character abstraction class.
+ template<typename V, typename I, typename S = std::mbstate_t>
+ struct character
+ {
+ typedef V value_type;
+ typedef I int_type;
+ typedef S state_type;
+ typedef character<V, I, S> char_type;
+
+ value_type value;
+
+ template<typename V2>
+ static char_type
+ from(const V2& v)
+ {
+ char_type ret = { static_cast<value_type>(v) };
+ return ret;
+ }
+
+ template<typename V2>
+ static V2
+ to(const char_type& c)
+ {
+ V2 ret = { static_cast<V2>(c.value) };
+ return ret;
+ }
+
+ };
+
+ template<typename V, typename I, typename S>
+ inline bool
+ operator==(const character<V, I, S>& lhs, const character<V, I, S>& rhs)
+ { return lhs.value == rhs.value; }
+
+ template<typename V, typename I, typename S>
+ inline bool
+ operator<(const character<V, I, S>& lhs, const character<V, I, S>& rhs)
+ { return lhs.value < rhs.value; }
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /// char_traits<__gnu_cxx::character> specialization.
+ template<typename V, typename I, typename S>
+ struct char_traits<__gnu_cxx::character<V, I, S> >
+ {
+ typedef __gnu_cxx::character<V, I, S> char_type;
+ typedef typename char_type::int_type int_type;
+ typedef typename char_type::state_type state_type;
+ typedef fpos<state_type> pos_type;
+ typedef streamoff off_type;
+
+ static void
+ assign(char_type& __c1, const char_type& __c2)
+ { __c1 = __c2; }
+
+ static bool
+ eq(const char_type& __c1, const char_type& __c2)
+ { return __c1 == __c2; }
+
+ static bool
+ lt(const char_type& __c1, const char_type& __c2)
+ { return __c1 < __c2; }
+
+ static int
+ compare(const char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ if (!eq(__s1[__i], __s2[__i]))
+ return lt(__s1[__i], __s2[__i]) ? -1 : 1;
+ return 0;
+ }
+
+ static size_t
+ length(const char_type* __s)
+ {
+ const char_type* __p = __s;
+ while (__p->value)
+ ++__p;
+ return (__p - __s);
+ }
+
+ static const char_type*
+ find(const char_type* __s, size_t __n, const char_type& __a)
+ {
+ for (const char_type* __p = __s; size_t(__p - __s) < __n; ++__p)
+ if (*__p == __a)
+ return __p;
+ return 0;
+ }
+
+ static char_type*
+ move(char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ return static_cast<char_type*>
+ (__builtin_memmove(__s1, __s2, __n * sizeof(char_type)));
+ }
+
+ static char_type*
+ copy(char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ std::copy(__s2, __s2 + __n, __s1);
+ return __s1;
+ }
+
+ static char_type*
+ assign(char_type* __s, size_t __n, char_type __a)
+ {
+ std::fill_n(__s, __n, __a);
+ return __s;
+ }
+
+ static char_type
+ to_char_type(const int_type& __i)
+ { return char_type::template from(__i); }
+
+ static int_type
+ to_int_type(const char_type& __c)
+ { return char_type::template to<int_type>(__c); }
+
+ static bool
+ eq_int_type(const int_type& __c1, const int_type& __c2)
+ { return __c1 == __c2; }
+
+ static int_type
+ eof()
+ {
+ int_type __r = { -1 };
+ return __r;
+ }
+
+ static int_type
+ not_eof(const int_type& __c)
+ { return eq_int_type(__c, eof()) ? int_type() : __c; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pointer.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pointer.h
new file mode 100644
index 0000000..5aac7f1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pointer.h
@@ -0,0 +1,551 @@
+// Custom pointer adapter and sample storage policies
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/**
+ * @file ext/pointer.h
+ * @author Bob Walters
+ *
+ * Provides reusable _Pointer_adapter for assisting in the development of
+ * custom pointer types that can be used with the standard containers via
+ * the allocator::pointer and allocator::const_pointer typedefs.
+ */
+
+#ifndef _POINTER_H
+#define _POINTER_H 1
+
+#include <iosfwd>
+#include <bits/stl_iterator_base_types.h>
+#include <ext/cast.h>
+#include <ext/type_traits.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ /**
+ * @brief A storage policy for use with _Pointer_adapter<> which yields a
+ * standard pointer.
+ *
+ * A _Storage_policy is required to provide 4 things:
+ * 1) A get() API for returning the stored pointer value.
+ * 2) An set() API for storing a pointer value.
+ * 3) An element_type typedef to define the type this points to.
+ * 4) An operator<() to support pointer comparison.
+ * 5) An operator==() to support pointer comparison.
+ */
+ template<typename _Tp>
+ class _Std_pointer_impl
+ {
+ public:
+ // the type this pointer points to.
+ typedef _Tp element_type;
+
+ // A method to fetch the pointer value as a standard T* value;
+ inline _Tp*
+ get() const
+ { return _M_value; }
+
+ // A method to set the pointer value, from a standard T* value;
+ inline void
+ set(element_type* __arg)
+ { _M_value = __arg; }
+
+ // Comparison of pointers
+ inline bool
+ operator<(const _Std_pointer_impl& __rarg) const
+ { return (_M_value < __rarg._M_value); }
+
+ inline bool
+ operator==(const _Std_pointer_impl& __rarg) const
+ { return (_M_value == __rarg._M_value); }
+
+ private:
+ element_type* _M_value;
+ };
+
+ /**
+ * @brief A storage policy for use with _Pointer_adapter<> which stores
+ * the pointer's address as an offset value which is relative to
+ * its own address.
+ *
+ * This is intended for pointers
+ * within shared memory regions which might be mapped at different
+ * addresses by different processes. For null pointers, a value of 1 is
+ * used. (0 is legitimate sometimes for nodes in circularly linked lists)
+ * This value was chosen as the least likely to generate an incorrect null,
+ * As there is no reason why any normal pointer would point 1 byte into
+ * its own pointer address.
+ */
+ template<typename _Tp>
+ class _Relative_pointer_impl
+ {
+ public:
+ typedef _Tp element_type;
+
+ _Tp*
+ get() const
+ {
+ if (_M_diff == 1)
+ return 0;
+ else
+ return reinterpret_cast<_Tp*>(reinterpret_cast<_UIntPtrType>(this)
+ + _M_diff);
+ }
+
+ void
+ set(_Tp* __arg)
+ {
+ if (!__arg)
+ _M_diff = 1;
+ else
+ _M_diff = reinterpret_cast<_UIntPtrType>(__arg)
+ - reinterpret_cast<_UIntPtrType>(this);
+ }
+
+ // Comparison of pointers
+ inline bool
+ operator<(const _Relative_pointer_impl& __rarg) const
+ { return (reinterpret_cast<_UIntPtrType>(this->get())
+ < reinterpret_cast<_UIntPtrType>(__rarg.get())); }
+
+ inline bool
+ operator==(const _Relative_pointer_impl& __rarg) const
+ { return (reinterpret_cast<_UIntPtrType>(this->get())
+ == reinterpret_cast<_UIntPtrType>(__rarg.get())); }
+
+ private:
+ typedef __gnu_cxx::__conditional_type<
+ (sizeof(unsigned long) >= sizeof(void*)),
+ unsigned long, unsigned long long>::__type _UIntPtrType;
+ _UIntPtrType _M_diff;
+ };
+
+ /**
+ * Relative_pointer_impl needs a specialization for const T because of
+ * the casting done during pointer arithmetic.
+ */
+ template<typename _Tp>
+ class _Relative_pointer_impl<const _Tp>
+ {
+ public:
+ typedef const _Tp element_type;
+
+ const _Tp*
+ get() const
+ {
+ if (_M_diff == 1)
+ return 0;
+ else
+ return reinterpret_cast<const _Tp*>
+ (reinterpret_cast<_UIntPtrType>(this) + _M_diff);
+ }
+
+ void
+ set(const _Tp* __arg)
+ {
+ if (!__arg)
+ _M_diff = 1;
+ else
+ _M_diff = reinterpret_cast<_UIntPtrType>(__arg)
+ - reinterpret_cast<_UIntPtrType>(this);
+ }
+
+ // Comparison of pointers
+ inline bool
+ operator<(const _Relative_pointer_impl& __rarg) const
+ { return (reinterpret_cast<_UIntPtrType>(this->get())
+ < reinterpret_cast<_UIntPtrType>(__rarg.get())); }
+
+ inline bool
+ operator==(const _Relative_pointer_impl& __rarg) const
+ { return (reinterpret_cast<_UIntPtrType>(this->get())
+ == reinterpret_cast<_UIntPtrType>(__rarg.get())); }
+
+ private:
+ typedef __gnu_cxx::__conditional_type
+ <(sizeof(unsigned long) >= sizeof(void*)),
+ unsigned long, unsigned long long>::__type _UIntPtrType;
+ _UIntPtrType _M_diff;
+ };
+
+ /**
+ * The specialization on this type helps resolve the problem of
+ * reference to void, and eliminates the need to specialize _Pointer_adapter
+ * for cases of void*, const void*, and so on.
+ */
+ struct _Invalid_type { };
+
+ template<typename _Tp>
+ struct _Reference_type
+ { typedef _Tp& reference; };
+
+ template<>
+ struct _Reference_type<void>
+ { typedef _Invalid_type& reference; };
+
+ template<>
+ struct _Reference_type<const void>
+ { typedef const _Invalid_type& reference; };
+
+ template<>
+ struct _Reference_type<volatile void>
+ { typedef volatile _Invalid_type& reference; };
+
+ template<>
+ struct _Reference_type<volatile const void>
+ { typedef const volatile _Invalid_type& reference; };
+
+ /**
+ * This structure accomodates the way in which std::iterator_traits<>
+ * is normally specialized for const T*, so that value_type is still T.
+ */
+ template<typename _Tp>
+ struct _Unqualified_type
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct _Unqualified_type<const _Tp>
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct _Unqualified_type<volatile _Tp>
+ { typedef volatile _Tp type; };
+
+ template<typename _Tp>
+ struct _Unqualified_type<volatile const _Tp>
+ { typedef volatile _Tp type; };
+
+ /**
+ * The following provides an 'alternative pointer' that works with the
+ * containers when specified as the pointer typedef of the allocator.
+ *
+ * The pointer type used with the containers doesn't have to be this class,
+ * but it must support the implicit conversions, pointer arithmetic,
+ * comparison operators, etc. that are supported by this class, and avoid
+ * raising compile-time ambiguities. Because creating a working pointer can
+ * be challenging, this pointer template was designed to wrapper an
+ * easier storage policy type, so that it becomes reusable for creating
+ * other pointer types.
+ *
+ * A key point of this class is also that it allows container writers to
+ * 'assume' Alocator::pointer is a typedef for a normal pointer. This class
+ * supports most of the conventions of a true pointer, and can, for instance
+ * handle implicit conversion to const and base class pointer types. The
+ * only impositions on container writers to support extended pointers are:
+ * 1) use the Allocator::pointer typedef appropriately for pointer types.
+ * 2) if you need pointer casting, use the __pointer_cast<> functions
+ * from ext/cast.h. This allows pointer cast operations to be overloaded
+ * is necessary by custom pointers.
+ *
+ * Note: The const qualifier works with this pointer adapter as follows:
+ *
+ * _Tp* == _Pointer_adapter<_Std_pointer_impl<_Tp> >;
+ * const _Tp* == _Pointer_adapter<_Std_pointer_impl<const _Tp> >;
+ * _Tp* const == const _Pointer_adapter<_Std_pointer_impl<_Tp> >;
+ * const _Tp* const == const _Pointer_adapter<_Std_pointer_impl<const _Tp> >;
+ */
+ template<typename _Storage_policy>
+ class _Pointer_adapter : public _Storage_policy
+ {
+ public:
+ typedef typename _Storage_policy::element_type element_type;
+
+ // These are needed for iterator_traits
+ typedef std::random_access_iterator_tag iterator_category;
+ typedef typename _Unqualified_type<element_type>::type value_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef _Pointer_adapter pointer;
+ typedef typename _Reference_type<element_type>::reference reference;
+
+ // Reminder: 'const' methods mean that the method is valid when the
+ // pointer is immutable, and has nothing to do with whether the
+ // 'pointee' is const.
+
+ // Default Constructor (Convert from element_type*)
+ _Pointer_adapter(element_type* __arg = 0)
+ { _Storage_policy::set(__arg); }
+
+ // Copy constructor from _Pointer_adapter of same type.
+ _Pointer_adapter(const _Pointer_adapter& __arg)
+ { _Storage_policy::set(__arg.get()); }
+
+ // Convert from _Up* if conversion to element_type* is valid.
+ template<typename _Up>
+ _Pointer_adapter(_Up* __arg)
+ { _Storage_policy::set(__arg); }
+
+ // Conversion from another _Pointer_adapter if _Up if static cast is
+ // valid.
+ template<typename _Up>
+ _Pointer_adapter(const _Pointer_adapter<_Up>& __arg)
+ { _Storage_policy::set(__arg.get()); }
+
+ // Destructor
+ ~_Pointer_adapter() { }
+
+ // Assignment operator
+ _Pointer_adapter&
+ operator=(const _Pointer_adapter& __arg)
+ {
+ _Storage_policy::set(__arg.get());
+ return *this;
+ }
+
+ template<typename _Up>
+ _Pointer_adapter&
+ operator=(const _Pointer_adapter<_Up>& __arg)
+ {
+ _Storage_policy::set(__arg.get());
+ return *this;
+ }
+
+ template<typename _Up>
+ _Pointer_adapter&
+ operator=(_Up* __arg)
+ {
+ _Storage_policy::set(__arg);
+ return *this;
+ }
+
+ // Operator*, returns element_type&
+ inline reference
+ operator*() const
+ { return *(_Storage_policy::get()); }
+
+ // Operator->, returns element_type*
+ inline element_type*
+ operator->() const
+ { return _Storage_policy::get(); }
+
+ // Operator[], returns a element_type& to the item at that loc.
+ inline reference
+ operator[](std::ptrdiff_t __index) const
+ { return _Storage_policy::get()[__index]; }
+
+ // To allow implicit conversion to "bool", for "if (ptr)..."
+ private:
+ typedef element_type*(_Pointer_adapter::*__unspecified_bool_type)() const;
+
+ public:
+ operator __unspecified_bool_type() const
+ {
+ return _Storage_policy::get() == 0 ? 0 :
+ &_Pointer_adapter::operator->;
+ }
+
+ // ! operator (for: if (!ptr)...)
+ inline bool
+ operator!() const
+ { return (_Storage_policy::get() == 0); }
+
+ // Pointer differences
+ inline friend std::ptrdiff_t
+ operator-(const _Pointer_adapter& __lhs, element_type* __rhs)
+ { return (__lhs.get() - __rhs); }
+
+ inline friend std::ptrdiff_t
+ operator-(element_type* __lhs, const _Pointer_adapter& __rhs)
+ { return (__lhs - __rhs.get()); }
+
+ template<typename _Up>
+ inline friend std::ptrdiff_t
+ operator-(const _Pointer_adapter& __lhs, _Up* __rhs)
+ { return (__lhs.get() - __rhs); }
+
+ template<typename _Up>
+ inline friend std::ptrdiff_t
+ operator-(_Up* __lhs, const _Pointer_adapter& __rhs)
+ { return (__lhs - __rhs.get()); }
+
+ template<typename _Up>
+ inline std::ptrdiff_t
+ operator-(const _Pointer_adapter<_Up>& __rhs) const
+ { return (_Storage_policy::get() - __rhs.get()); }
+
+ // Pointer math
+ // Note: There is a reason for all this overloading based on different
+ // integer types. In some libstdc++-v3 test cases, a templated
+ // operator+ is declared which can match any types. This operator
+ // tends to "steal" the recognition of _Pointer_adapter's own operator+
+ // unless the integer type matches perfectly.
+
+#define _CXX_POINTER_ARITH_OPERATOR_SET(INT_TYPE) \
+ inline friend _Pointer_adapter \
+ operator+(const _Pointer_adapter& __lhs, INT_TYPE __offset) \
+ { return _Pointer_adapter(__lhs.get() + __offset); } \
+\
+ inline friend _Pointer_adapter \
+ operator+(INT_TYPE __offset, const _Pointer_adapter& __rhs) \
+ { return _Pointer_adapter(__rhs.get() + __offset); } \
+\
+ inline friend _Pointer_adapter \
+ operator-(const _Pointer_adapter& __lhs, INT_TYPE __offset) \
+ { return _Pointer_adapter(__lhs.get() - __offset); } \
+\
+ inline _Pointer_adapter& \
+ operator+=(INT_TYPE __offset) \
+ { \
+ _Storage_policy::set(_Storage_policy::get() + __offset); \
+ return *this; \
+ } \
+\
+ inline _Pointer_adapter& \
+ operator-=(INT_TYPE __offset) \
+ { \
+ _Storage_policy::set(_Storage_policy::get() - __offset); \
+ return *this; \
+ } \
+// END of _CXX_POINTER_ARITH_OPERATOR_SET macro
+
+ // Expand into the various pointer arithmatic operators needed.
+ _CXX_POINTER_ARITH_OPERATOR_SET(short);
+ _CXX_POINTER_ARITH_OPERATOR_SET(unsigned short);
+ _CXX_POINTER_ARITH_OPERATOR_SET(int);
+ _CXX_POINTER_ARITH_OPERATOR_SET(unsigned int);
+ _CXX_POINTER_ARITH_OPERATOR_SET(long);
+ _CXX_POINTER_ARITH_OPERATOR_SET(unsigned long);
+
+ // Mathematical Manipulators
+ inline _Pointer_adapter&
+ operator++()
+ {
+ _Storage_policy::set(_Storage_policy::get() + 1);
+ return *this;
+ }
+
+ inline _Pointer_adapter
+ operator++(int __unused)
+ {
+ _Pointer_adapter tmp(*this);
+ _Storage_policy::set(_Storage_policy::get() + 1);
+ return tmp;
+ }
+
+ inline _Pointer_adapter&
+ operator--()
+ {
+ _Storage_policy::set(_Storage_policy::get() - 1);
+ return *this;
+ }
+
+ inline _Pointer_adapter
+ operator--(int)
+ {
+ _Pointer_adapter tmp(*this);
+ _Storage_policy::set(_Storage_policy::get() - 1);
+ return tmp;
+ }
+
+ }; // class _Pointer_adapter
+
+
+#define _GCC_CXX_POINTER_COMPARISON_OPERATION_SET(OPERATOR,BLANK) \
+ template<typename _Tp1, typename _Tp2> \
+ inline bool \
+ operator OPERATOR##BLANK (const _Pointer_adapter<_Tp1>& __lhs, _Tp2 __rhs) \
+ { return __lhs.get() OPERATOR##BLANK __rhs; } \
+\
+ template<typename _Tp1, typename _Tp2> \
+ inline bool \
+ operator OPERATOR##BLANK (_Tp1 __lhs, const _Pointer_adapter<_Tp2>& __rhs) \
+ { return __lhs OPERATOR##BLANK __rhs.get(); } \
+\
+ template<typename _Tp1, typename _Tp2> \
+ inline bool \
+ operator OPERATOR##BLANK (const _Pointer_adapter<_Tp1>& __lhs, \
+ const _Pointer_adapter<_Tp2>& __rhs) \
+ { return __lhs.get() OPERATOR##BLANK __rhs.get(); } \
+\
+// End GCC_CXX_POINTER_COMPARISON_OPERATION_SET Macro
+
+ // Expand into the various comparison operators needed.
+ _GCC_CXX_POINTER_COMPARISON_OPERATION_SET(==,);
+ _GCC_CXX_POINTER_COMPARISON_OPERATION_SET(!=,);
+ _GCC_CXX_POINTER_COMPARISON_OPERATION_SET(<,);
+ _GCC_CXX_POINTER_COMPARISON_OPERATION_SET(<=,);
+ _GCC_CXX_POINTER_COMPARISON_OPERATION_SET(>,);
+ _GCC_CXX_POINTER_COMPARISON_OPERATION_SET(>=,);
+
+ // These are here for expressions like "ptr == 0", "ptr != 0"
+ template<typename _Tp>
+ inline bool
+ operator==(const _Pointer_adapter<_Tp>& __lhs, int __rhs)
+ { return __lhs.get() == reinterpret_cast<void*>(__rhs); }
+
+ template<typename _Tp>
+ inline bool
+ operator==(int __lhs, const _Pointer_adapter<_Tp>& __rhs)
+ { return __rhs.get() == reinterpret_cast<void*>(__lhs); }
+
+ template<typename _Tp>
+ inline bool
+ operator!=(const _Pointer_adapter<_Tp>& __lhs, int __rhs)
+ { return __lhs.get() != reinterpret_cast<void*>(__rhs); }
+
+ template<typename _Tp>
+ inline bool
+ operator!=(int __lhs, const _Pointer_adapter<_Tp>& __rhs)
+ { return __rhs.get() != reinterpret_cast<void*>(__lhs); }
+
+ /**
+ * Comparison operators for _Pointer_adapter defer to the base class'es
+ * comparison operators, when possible.
+ */
+ template<typename _Tp>
+ inline bool
+ operator==(const _Pointer_adapter<_Tp>& __lhs,
+ const _Pointer_adapter<_Tp>& __rhs)
+ { return __lhs._Tp::operator==(__rhs); }
+
+ template<typename _Tp>
+ inline bool
+ operator<=(const _Pointer_adapter<_Tp>& __lhs,
+ const _Pointer_adapter<_Tp>& __rhs)
+ { return __lhs._Tp::operator<(__rhs) || __lhs._Tp::operator==(__rhs); }
+
+ template<typename _Tp>
+ inline bool
+ operator!=(const _Pointer_adapter<_Tp>& __lhs,
+ const _Pointer_adapter<_Tp>& __rhs)
+ { return !(__lhs._Tp::operator==(__rhs)); }
+
+ template<typename _Tp>
+ inline bool
+ operator>(const _Pointer_adapter<_Tp>& __lhs,
+ const _Pointer_adapter<_Tp>& __rhs)
+ { return !(__lhs._Tp::operator<(__rhs) || __lhs._Tp::operator==(__rhs)); }
+
+ template<typename _Tp>
+ inline bool
+ operator>=(const _Pointer_adapter<_Tp>& __lhs,
+ const _Pointer_adapter<_Tp>& __rhs)
+ { return !(__lhs._Tp::operator<(__rhs)); }
+
+ template<typename _CharT, typename _Traits, typename _StoreT>
+ inline std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const _Pointer_adapter<_StoreT>& __p)
+ { return (__os << __p.get()); }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif // _POINTER_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pool_allocator.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pool_allocator.h
new file mode 100644
index 0000000..87d145d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/pool_allocator.h
@@ -0,0 +1,263 @@
+// Allocators -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1996-1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file ext/pool_allocator.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _POOL_ALLOCATOR_H
+#define _POOL_ALLOCATOR_H 1
+
+#include <bits/c++config.h>
+#include <cstdlib>
+#include <new>
+#include <bits/functexcept.h>
+#include <ext/atomicity.h>
+#include <ext/concurrence.h>
+#include <bits/move.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+ using std::ptrdiff_t;
+
+ /**
+ * @brief Base class for __pool_alloc.
+ *
+ * Uses various allocators to fulfill underlying requests (and makes as
+ * few requests as possible when in default high-speed pool mode).
+ *
+ * Important implementation properties:
+ * 0. If globally mandated, then allocate objects from new
+ * 1. If the clients request an object of size > _S_max_bytes, the resulting
+ * object will be obtained directly from new
+ * 2. In all other cases, we allocate an object of size exactly
+ * _S_round_up(requested_size). Thus the client has enough size
+ * information that we can return the object to the proper free list
+ * without permanently losing part of the object.
+ */
+ class __pool_alloc_base
+ {
+ protected:
+
+ enum { _S_align = 8 };
+ enum { _S_max_bytes = 128 };
+ enum { _S_free_list_size = (size_t)_S_max_bytes / (size_t)_S_align };
+
+ union _Obj
+ {
+ union _Obj* _M_free_list_link;
+ char _M_client_data[1]; // The client sees this.
+ };
+
+ static _Obj* volatile _S_free_list[_S_free_list_size];
+
+ // Chunk allocation state.
+ static char* _S_start_free;
+ static char* _S_end_free;
+ static size_t _S_heap_size;
+
+ size_t
+ _M_round_up(size_t __bytes)
+ { return ((__bytes + (size_t)_S_align - 1) & ~((size_t)_S_align - 1)); }
+
+ _Obj* volatile*
+ _M_get_free_list(size_t __bytes);
+
+ __mutex&
+ _M_get_mutex();
+
+ // Returns an object of size __n, and optionally adds to size __n
+ // free list.
+ void*
+ _M_refill(size_t __n);
+
+ // Allocates a chunk for nobjs of size size. nobjs may be reduced
+ // if it is inconvenient to allocate the requested number.
+ char*
+ _M_allocate_chunk(size_t __n, int& __nobjs);
+ };
+
+
+ /**
+ * @brief Allocator using a memory pool with a single lock.
+ * @ingroup allocators
+ */
+ template<typename _Tp>
+ class __pool_alloc : private __pool_alloc_base
+ {
+ private:
+ static _Atomic_word _S_force_new;
+
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+
+ template<typename _Tp1>
+ struct rebind
+ { typedef __pool_alloc<_Tp1> other; };
+
+ __pool_alloc() throw() { }
+
+ __pool_alloc(const __pool_alloc&) throw() { }
+
+ template<typename _Tp1>
+ __pool_alloc(const __pool_alloc<_Tp1>&) throw() { }
+
+ ~__pool_alloc() throw() { }
+
+ pointer
+ address(reference __x) const { return &__x; }
+
+ const_pointer
+ address(const_reference __x) const { return &__x; }
+
+ size_type
+ max_size() const throw()
+ { return size_t(-1) / sizeof(_Tp); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 402. wrong new expression in [some_] allocator::construct
+ void
+ construct(pointer __p, const _Tp& __val)
+ { ::new((void *)__p) _Tp(__val); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ void
+ construct(pointer __p, _Args&&... __args)
+ { ::new((void *)__p) _Tp(std::forward<_Args>(__args)...); }
+#endif
+
+ void
+ destroy(pointer __p) { __p->~_Tp(); }
+
+ pointer
+ allocate(size_type __n, const void* = 0);
+
+ void
+ deallocate(pointer __p, size_type __n);
+ };
+
+ template<typename _Tp>
+ inline bool
+ operator==(const __pool_alloc<_Tp>&, const __pool_alloc<_Tp>&)
+ { return true; }
+
+ template<typename _Tp>
+ inline bool
+ operator!=(const __pool_alloc<_Tp>&, const __pool_alloc<_Tp>&)
+ { return false; }
+
+ template<typename _Tp>
+ _Atomic_word
+ __pool_alloc<_Tp>::_S_force_new;
+
+ template<typename _Tp>
+ _Tp*
+ __pool_alloc<_Tp>::allocate(size_type __n, const void*)
+ {
+ pointer __ret = 0;
+ if (__builtin_expect(__n != 0, true))
+ {
+ if (__builtin_expect(__n > this->max_size(), false))
+ std::__throw_bad_alloc();
+
+ // If there is a race through here, assume answer from getenv
+ // will resolve in same direction. Inspired by techniques
+ // to efficiently support threading found in basic_string.h.
+ if (_S_force_new == 0)
+ {
+ if (std::getenv("GLIBCXX_FORCE_NEW"))
+ __atomic_add_dispatch(&_S_force_new, 1);
+ else
+ __atomic_add_dispatch(&_S_force_new, -1);
+ }
+
+ const size_t __bytes = __n * sizeof(_Tp);
+ if (__bytes > size_t(_S_max_bytes) || _S_force_new > 0)
+ __ret = static_cast<_Tp*>(::operator new(__bytes));
+ else
+ {
+ _Obj* volatile* __free_list = _M_get_free_list(__bytes);
+
+ __scoped_lock sentry(_M_get_mutex());
+ _Obj* __restrict__ __result = *__free_list;
+ if (__builtin_expect(__result == 0, 0))
+ __ret = static_cast<_Tp*>(_M_refill(_M_round_up(__bytes)));
+ else
+ {
+ *__free_list = __result->_M_free_list_link;
+ __ret = reinterpret_cast<_Tp*>(__result);
+ }
+ if (__builtin_expect(__ret == 0, 0))
+ std::__throw_bad_alloc();
+ }
+ }
+ return __ret;
+ }
+
+ template<typename _Tp>
+ void
+ __pool_alloc<_Tp>::deallocate(pointer __p, size_type __n)
+ {
+ if (__builtin_expect(__n != 0 && __p != 0, true))
+ {
+ const size_t __bytes = __n * sizeof(_Tp);
+ if (__bytes > static_cast<size_t>(_S_max_bytes) || _S_force_new > 0)
+ ::operator delete(__p);
+ else
+ {
+ _Obj* volatile* __free_list = _M_get_free_list(__bytes);
+ _Obj* __q = reinterpret_cast<_Obj*>(__p);
+
+ __scoped_lock sentry(_M_get_mutex());
+ __q ->_M_free_list_link = *__free_list;
+ *__free_list = __q;
+ }
+ }
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/rb_tree b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/rb_tree
new file mode 100644
index 0000000..185d02e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/rb_tree
@@ -0,0 +1,93 @@
+// rb_tree extension -*- C++ -*-
+
+// Copyright (C) 2002, 2003, 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file ext/rb_tree
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _RB_TREE
+#define _RB_TREE 1
+
+#pragma GCC system_header
+
+#include <bits/stl_tree.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::_Rb_tree;
+ using std::allocator;
+
+ // Class rb_tree is not part of the C++ standard. It is provided for
+ // compatibility with the HP STL.
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template <class _Key, class _Value, class _KeyOfValue, class _Compare,
+ class _Alloc = allocator<_Value> >
+ struct rb_tree
+ : public _Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc>
+ {
+ typedef _Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc> _Base;
+ typedef typename _Base::allocator_type allocator_type;
+
+ rb_tree(const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__comp, __a) { }
+
+ ~rb_tree() { }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/rc_string_base.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/rc_string_base.h
new file mode 100644
index 0000000..dce5e06
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/rc_string_base.h
@@ -0,0 +1,718 @@
+// Reference-counted versatile string base -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/rc_string_base.h
+ * This file is a GNU extension to the Standard C++ Library.
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _RC_STRING_BASE_H
+#define _RC_STRING_BASE_H 1
+
+#include <ext/atomicity.h>
+#include <bits/stl_iterator_base_funcs.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ /**
+ * Documentation? What's that?
+ * Nathan Myers <ncm@cantrip.org>.
+ *
+ * A string looks like this:
+ *
+ * @code
+ * [_Rep]
+ * _M_length
+ * [__rc_string_base<char_type>] _M_capacity
+ * _M_dataplus _M_refcount
+ * _M_p ----------------> unnamed array of char_type
+ * @endcode
+ *
+ * Where the _M_p points to the first character in the string, and
+ * you cast it to a pointer-to-_Rep and subtract 1 to get a
+ * pointer to the header.
+ *
+ * This approach has the enormous advantage that a string object
+ * requires only one allocation. All the ugliness is confined
+ * within a single pair of inline functions, which each compile to
+ * a single "add" instruction: _Rep::_M_refdata(), and
+ * __rc_string_base::_M_rep(); and the allocation function which gets a
+ * block of raw bytes and with room enough and constructs a _Rep
+ * object at the front.
+ *
+ * The reason you want _M_data pointing to the character array and
+ * not the _Rep is so that the debugger can see the string
+ * contents. (Probably we should add a non-inline member to get
+ * the _Rep for the debugger to use, so users can check the actual
+ * string length.)
+ *
+ * Note that the _Rep object is a POD so that you can have a
+ * static "empty string" _Rep object already "constructed" before
+ * static constructors have run. The reference-count encoding is
+ * chosen so that a 0 indicates one reference, so you never try to
+ * destroy the empty-string _Rep object.
+ *
+ * All but the last paragraph is considered pretty conventional
+ * for a C++ string implementation.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ class __rc_string_base
+ : protected __vstring_utility<_CharT, _Traits, _Alloc>
+ {
+ public:
+ typedef _Traits traits_type;
+ typedef typename _Traits::char_type value_type;
+ typedef _Alloc allocator_type;
+
+ typedef __vstring_utility<_CharT, _Traits, _Alloc> _Util_Base;
+ typedef typename _Util_Base::_CharT_alloc_type _CharT_alloc_type;
+ typedef typename _CharT_alloc_type::size_type size_type;
+
+ private:
+ // _Rep: string representation
+ // Invariants:
+ // 1. String really contains _M_length + 1 characters: due to 21.3.4
+ // must be kept null-terminated.
+ // 2. _M_capacity >= _M_length
+ // Allocated memory is always (_M_capacity + 1) * sizeof(_CharT).
+ // 3. _M_refcount has three states:
+ // -1: leaked, one reference, no ref-copies allowed, non-const.
+ // 0: one reference, non-const.
+ // n>0: n + 1 references, operations require a lock, const.
+ // 4. All fields == 0 is an empty string, given the extra storage
+ // beyond-the-end for a null terminator; thus, the shared
+ // empty string representation needs no constructor.
+ struct _Rep
+ {
+ union
+ {
+ struct
+ {
+ size_type _M_length;
+ size_type _M_capacity;
+ _Atomic_word _M_refcount;
+ } _M_info;
+
+ // Only for alignment purposes.
+ _CharT _M_align;
+ };
+
+ typedef typename _Alloc::template rebind<_Rep>::other _Rep_alloc_type;
+
+ _CharT*
+ _M_refdata() throw()
+ { return reinterpret_cast<_CharT*>(this + 1); }
+
+ _CharT*
+ _M_refcopy() throw()
+ {
+ __atomic_add_dispatch(&_M_info._M_refcount, 1);
+ return _M_refdata();
+ } // XXX MT
+
+ void
+ _M_set_length(size_type __n)
+ {
+ _M_info._M_refcount = 0; // One reference.
+ _M_info._M_length = __n;
+ // grrr. (per 21.3.4)
+ // You cannot leave those LWG people alone for a second.
+ traits_type::assign(_M_refdata()[__n], _CharT());
+ }
+
+ // Create & Destroy
+ static _Rep*
+ _S_create(size_type, size_type, const _Alloc&);
+
+ void
+ _M_destroy(const _Alloc&) throw();
+
+ _CharT*
+ _M_clone(const _Alloc&, size_type __res = 0);
+ };
+
+ struct _Rep_empty
+ : public _Rep
+ {
+ _CharT _M_terminal;
+ };
+
+ static _Rep_empty _S_empty_rep;
+
+ // The maximum number of individual char_type elements of an
+ // individual string is determined by _S_max_size. This is the
+ // value that will be returned by max_size(). (Whereas npos
+ // is the maximum number of bytes the allocator can allocate.)
+ // If one was to divvy up the theoretical largest size string,
+ // with a terminating character and m _CharT elements, it'd
+ // look like this:
+ // npos = sizeof(_Rep) + (m * sizeof(_CharT)) + sizeof(_CharT)
+ // + sizeof(_Rep) - 1
+ // (NB: last two terms for rounding reasons, see _M_create below)
+ // Solving for m:
+ // m = ((npos - 2 * sizeof(_Rep) + 1) / sizeof(_CharT)) - 1
+ // In addition, this implementation halves this amount.
+ enum { _S_max_size = (((static_cast<size_type>(-1) - 2 * sizeof(_Rep)
+ + 1) / sizeof(_CharT)) - 1) / 2 };
+
+ // Data Member (private):
+ mutable typename _Util_Base::template _Alloc_hider<_Alloc> _M_dataplus;
+
+ void
+ _M_data(_CharT* __p)
+ { _M_dataplus._M_p = __p; }
+
+ _Rep*
+ _M_rep() const
+ { return &((reinterpret_cast<_Rep*>(_M_data()))[-1]); }
+
+ _CharT*
+ _M_grab(const _Alloc& __alloc) const
+ {
+ return (!_M_is_leaked() && _M_get_allocator() == __alloc)
+ ? _M_rep()->_M_refcopy() : _M_rep()->_M_clone(__alloc);
+ }
+
+ void
+ _M_dispose()
+ {
+ if (__exchange_and_add_dispatch(&_M_rep()->_M_info._M_refcount,
+ -1) <= 0)
+ _M_rep()->_M_destroy(_M_get_allocator());
+ } // XXX MT
+
+ bool
+ _M_is_leaked() const
+ { return _M_rep()->_M_info._M_refcount < 0; }
+
+ void
+ _M_set_sharable()
+ { _M_rep()->_M_info._M_refcount = 0; }
+
+ void
+ _M_leak_hard();
+
+ // _S_construct_aux is used to implement the 21.3.1 para 15 which
+ // requires special behaviour if _InIterator is an integral type
+ template<typename _InIterator>
+ static _CharT*
+ _S_construct_aux(_InIterator __beg, _InIterator __end,
+ const _Alloc& __a, std::__false_type)
+ {
+ typedef typename iterator_traits<_InIterator>::iterator_category _Tag;
+ return _S_construct(__beg, __end, __a, _Tag());
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ static _CharT*
+ _S_construct_aux(_Integer __beg, _Integer __end,
+ const _Alloc& __a, std::__true_type)
+ { return _S_construct(static_cast<size_type>(__beg), __end, __a); }
+
+ template<typename _InIterator>
+ static _CharT*
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a)
+ {
+ typedef typename std::__is_integer<_InIterator>::__type _Integral;
+ return _S_construct_aux(__beg, __end, __a, _Integral());
+ }
+
+ // For Input Iterators, used in istreambuf_iterators, etc.
+ template<typename _InIterator>
+ static _CharT*
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
+ std::input_iterator_tag);
+
+ // For forward_iterators up to random_access_iterators, used for
+ // string::iterator, _CharT*, etc.
+ template<typename _FwdIterator>
+ static _CharT*
+ _S_construct(_FwdIterator __beg, _FwdIterator __end, const _Alloc& __a,
+ std::forward_iterator_tag);
+
+ static _CharT*
+ _S_construct(size_type __req, _CharT __c, const _Alloc& __a);
+
+ public:
+ size_type
+ _M_max_size() const
+ { return size_type(_S_max_size); }
+
+ _CharT*
+ _M_data() const
+ { return _M_dataplus._M_p; }
+
+ size_type
+ _M_length() const
+ { return _M_rep()->_M_info._M_length; }
+
+ size_type
+ _M_capacity() const
+ { return _M_rep()->_M_info._M_capacity; }
+
+ bool
+ _M_is_shared() const
+ { return _M_rep()->_M_info._M_refcount > 0; }
+
+ void
+ _M_set_leaked()
+ { _M_rep()->_M_info._M_refcount = -1; }
+
+ void
+ _M_leak() // for use in begin() & non-const op[]
+ {
+ if (!_M_is_leaked())
+ _M_leak_hard();
+ }
+
+ void
+ _M_set_length(size_type __n)
+ { _M_rep()->_M_set_length(__n); }
+
+ __rc_string_base()
+ : _M_dataplus(_S_empty_rep._M_refcopy()) { }
+
+ __rc_string_base(const _Alloc& __a);
+
+ __rc_string_base(const __rc_string_base& __rcs);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ __rc_string_base(__rc_string_base&& __rcs)
+ : _M_dataplus(__rcs._M_get_allocator(), __rcs._M_data())
+ { __rcs._M_data(_S_empty_rep._M_refcopy()); }
+#endif
+
+ __rc_string_base(size_type __n, _CharT __c, const _Alloc& __a);
+
+ template<typename _InputIterator>
+ __rc_string_base(_InputIterator __beg, _InputIterator __end,
+ const _Alloc& __a);
+
+ ~__rc_string_base()
+ { _M_dispose(); }
+
+ allocator_type&
+ _M_get_allocator()
+ { return _M_dataplus; }
+
+ const allocator_type&
+ _M_get_allocator() const
+ { return _M_dataplus; }
+
+ void
+ _M_swap(__rc_string_base& __rcs);
+
+ void
+ _M_assign(const __rc_string_base& __rcs);
+
+ void
+ _M_reserve(size_type __res);
+
+ void
+ _M_mutate(size_type __pos, size_type __len1, const _CharT* __s,
+ size_type __len2);
+
+ void
+ _M_erase(size_type __pos, size_type __n);
+
+ void
+ _M_clear()
+ { _M_erase(size_type(0), _M_length()); }
+
+ bool
+ _M_compare(const __rc_string_base&) const
+ { return false; }
+ };
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename __rc_string_base<_CharT, _Traits, _Alloc>::_Rep_empty
+ __rc_string_base<_CharT, _Traits, _Alloc>::_S_empty_rep;
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ typename __rc_string_base<_CharT, _Traits, _Alloc>::_Rep*
+ __rc_string_base<_CharT, _Traits, _Alloc>::_Rep::
+ _S_create(size_type __capacity, size_type __old_capacity,
+ const _Alloc& __alloc)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 83. String::npos vs. string::max_size()
+ if (__capacity > size_type(_S_max_size))
+ std::__throw_length_error(__N("__rc_string_base::_Rep::_S_create"));
+
+ // The standard places no restriction on allocating more memory
+ // than is strictly needed within this layer at the moment or as
+ // requested by an explicit application call to reserve().
+
+ // Many malloc implementations perform quite poorly when an
+ // application attempts to allocate memory in a stepwise fashion
+ // growing each allocation size by only 1 char. Additionally,
+ // it makes little sense to allocate less linear memory than the
+ // natural blocking size of the malloc implementation.
+ // Unfortunately, we would need a somewhat low-level calculation
+ // with tuned parameters to get this perfect for any particular
+ // malloc implementation. Fortunately, generalizations about
+ // common features seen among implementations seems to suffice.
+
+ // __pagesize need not match the actual VM page size for good
+ // results in practice, thus we pick a common value on the low
+ // side. __malloc_header_size is an estimate of the amount of
+ // overhead per memory allocation (in practice seen N * sizeof
+ // (void*) where N is 0, 2 or 4). According to folklore,
+ // picking this value on the high side is better than
+ // low-balling it (especially when this algorithm is used with
+ // malloc implementations that allocate memory blocks rounded up
+ // to a size which is a power of 2).
+ const size_type __pagesize = 4096;
+ const size_type __malloc_header_size = 4 * sizeof(void*);
+
+ // The below implements an exponential growth policy, necessary to
+ // meet amortized linear time requirements of the library: see
+ // http://gcc.gnu.org/ml/libstdc++/2001-07/msg00085.html.
+ if (__capacity > __old_capacity && __capacity < 2 * __old_capacity)
+ {
+ __capacity = 2 * __old_capacity;
+ // Never allocate a string bigger than _S_max_size.
+ if (__capacity > size_type(_S_max_size))
+ __capacity = size_type(_S_max_size);
+ }
+
+ // NB: Need an array of char_type[__capacity], plus a terminating
+ // null char_type() element, plus enough for the _Rep data structure,
+ // plus sizeof(_Rep) - 1 to upper round to a size multiple of
+ // sizeof(_Rep).
+ // Whew. Seemingly so needy, yet so elemental.
+ size_type __size = ((__capacity + 1) * sizeof(_CharT)
+ + 2 * sizeof(_Rep) - 1);
+
+ const size_type __adj_size = __size + __malloc_header_size;
+ if (__adj_size > __pagesize && __capacity > __old_capacity)
+ {
+ const size_type __extra = __pagesize - __adj_size % __pagesize;
+ __capacity += __extra / sizeof(_CharT);
+ if (__capacity > size_type(_S_max_size))
+ __capacity = size_type(_S_max_size);
+ __size = (__capacity + 1) * sizeof(_CharT) + 2 * sizeof(_Rep) - 1;
+ }
+
+ // NB: Might throw, but no worries about a leak, mate: _Rep()
+ // does not throw.
+ _Rep* __place = _Rep_alloc_type(__alloc).allocate(__size / sizeof(_Rep));
+ _Rep* __p = new (__place) _Rep;
+ __p->_M_info._M_capacity = __capacity;
+ return __p;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __rc_string_base<_CharT, _Traits, _Alloc>::_Rep::
+ _M_destroy(const _Alloc& __a) throw ()
+ {
+ const size_type __size = ((_M_info._M_capacity + 1) * sizeof(_CharT)
+ + 2 * sizeof(_Rep) - 1);
+ _Rep_alloc_type(__a).deallocate(this, __size / sizeof(_Rep));
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ _CharT*
+ __rc_string_base<_CharT, _Traits, _Alloc>::_Rep::
+ _M_clone(const _Alloc& __alloc, size_type __res)
+ {
+ // Requested capacity of the clone.
+ const size_type __requested_cap = _M_info._M_length + __res;
+ _Rep* __r = _Rep::_S_create(__requested_cap, _M_info._M_capacity,
+ __alloc);
+
+ if (_M_info._M_length)
+ _S_copy(__r->_M_refdata(), _M_refdata(), _M_info._M_length);
+
+ __r->_M_set_length(_M_info._M_length);
+ return __r->_M_refdata();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ __rc_string_base(const _Alloc& __a)
+ : _M_dataplus(__a, _S_construct(size_type(), _CharT(), __a)) { }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ __rc_string_base(const __rc_string_base& __rcs)
+ : _M_dataplus(__rcs._M_get_allocator(),
+ __rcs._M_grab(__rcs._M_get_allocator())) { }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ __rc_string_base(size_type __n, _CharT __c, const _Alloc& __a)
+ : _M_dataplus(__a, _S_construct(__n, __c, __a)) { }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InputIterator>
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ __rc_string_base(_InputIterator __beg, _InputIterator __end,
+ const _Alloc& __a)
+ : _M_dataplus(__a, _S_construct(__beg, __end, __a)) { }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ _M_leak_hard()
+ {
+ if (_M_is_shared())
+ _M_erase(0, 0);
+ _M_set_leaked();
+ }
+
+ // NB: This is the special case for Input Iterators, used in
+ // istreambuf_iterators, etc.
+ // Input Iterators have a cost structure very different from
+ // pointers, calling for a different coding style.
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InIterator>
+ _CharT*
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
+ std::input_iterator_tag)
+ {
+ if (__beg == __end && __a == _Alloc())
+ return _S_empty_rep._M_refcopy();
+
+ // Avoid reallocation for common case.
+ _CharT __buf[128];
+ size_type __len = 0;
+ while (__beg != __end && __len < sizeof(__buf) / sizeof(_CharT))
+ {
+ __buf[__len++] = *__beg;
+ ++__beg;
+ }
+ _Rep* __r = _Rep::_S_create(__len, size_type(0), __a);
+ _S_copy(__r->_M_refdata(), __buf, __len);
+ __try
+ {
+ while (__beg != __end)
+ {
+ if (__len == __r->_M_info._M_capacity)
+ {
+ // Allocate more space.
+ _Rep* __another = _Rep::_S_create(__len + 1, __len, __a);
+ _S_copy(__another->_M_refdata(), __r->_M_refdata(), __len);
+ __r->_M_destroy(__a);
+ __r = __another;
+ }
+ __r->_M_refdata()[__len++] = *__beg;
+ ++__beg;
+ }
+ }
+ __catch(...)
+ {
+ __r->_M_destroy(__a);
+ __throw_exception_again;
+ }
+ __r->_M_set_length(__len);
+ return __r->_M_refdata();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InIterator>
+ _CharT*
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
+ std::forward_iterator_tag)
+ {
+ if (__beg == __end && __a == _Alloc())
+ return _S_empty_rep._M_refcopy();
+
+ // NB: Not required, but considered best practice.
+ if (__builtin_expect(__is_null_pointer(__beg) && __beg != __end, 0))
+ std::__throw_logic_error(__N("__rc_string_base::"
+ "_S_construct NULL not valid"));
+
+ const size_type __dnew = static_cast<size_type>(std::distance(__beg,
+ __end));
+ // Check for out_of_range and length_error exceptions.
+ _Rep* __r = _Rep::_S_create(__dnew, size_type(0), __a);
+ __try
+ { _S_copy_chars(__r->_M_refdata(), __beg, __end); }
+ __catch(...)
+ {
+ __r->_M_destroy(__a);
+ __throw_exception_again;
+ }
+ __r->_M_set_length(__dnew);
+ return __r->_M_refdata();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ _CharT*
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ _S_construct(size_type __n, _CharT __c, const _Alloc& __a)
+ {
+ if (__n == 0 && __a == _Alloc())
+ return _S_empty_rep._M_refcopy();
+
+ // Check for out_of_range and length_error exceptions.
+ _Rep* __r = _Rep::_S_create(__n, size_type(0), __a);
+ if (__n)
+ _S_assign(__r->_M_refdata(), __n, __c);
+
+ __r->_M_set_length(__n);
+ return __r->_M_refdata();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ _M_swap(__rc_string_base& __rcs)
+ {
+ if (_M_is_leaked())
+ _M_set_sharable();
+ if (__rcs._M_is_leaked())
+ __rcs._M_set_sharable();
+
+ _CharT* __tmp = _M_data();
+ _M_data(__rcs._M_data());
+ __rcs._M_data(__tmp);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 431. Swapping containers with unequal allocators.
+ std::__alloc_swap<allocator_type>::_S_do_it(_M_get_allocator(),
+ __rcs._M_get_allocator());
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ _M_assign(const __rc_string_base& __rcs)
+ {
+ if (_M_rep() != __rcs._M_rep())
+ {
+ _CharT* __tmp = __rcs._M_grab(_M_get_allocator());
+ _M_dispose();
+ _M_data(__tmp);
+ }
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ _M_reserve(size_type __res)
+ {
+ // Make sure we don't shrink below the current size.
+ if (__res < _M_length())
+ __res = _M_length();
+
+ if (__res != _M_capacity() || _M_is_shared())
+ {
+ _CharT* __tmp = _M_rep()->_M_clone(_M_get_allocator(),
+ __res - _M_length());
+ _M_dispose();
+ _M_data(__tmp);
+ }
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ _M_mutate(size_type __pos, size_type __len1, const _CharT* __s,
+ size_type __len2)
+ {
+ const size_type __how_much = _M_length() - __pos - __len1;
+
+ _Rep* __r = _Rep::_S_create(_M_length() + __len2 - __len1,
+ _M_capacity(), _M_get_allocator());
+
+ if (__pos)
+ _S_copy(__r->_M_refdata(), _M_data(), __pos);
+ if (__s && __len2)
+ _S_copy(__r->_M_refdata() + __pos, __s, __len2);
+ if (__how_much)
+ _S_copy(__r->_M_refdata() + __pos + __len2,
+ _M_data() + __pos + __len1, __how_much);
+
+ _M_dispose();
+ _M_data(__r->_M_refdata());
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __rc_string_base<_CharT, _Traits, _Alloc>::
+ _M_erase(size_type __pos, size_type __n)
+ {
+ const size_type __new_size = _M_length() - __n;
+ const size_type __how_much = _M_length() - __pos - __n;
+
+ if (_M_is_shared())
+ {
+ // Must reallocate.
+ _Rep* __r = _Rep::_S_create(__new_size, _M_capacity(),
+ _M_get_allocator());
+
+ if (__pos)
+ _S_copy(__r->_M_refdata(), _M_data(), __pos);
+ if (__how_much)
+ _S_copy(__r->_M_refdata() + __pos,
+ _M_data() + __pos + __n, __how_much);
+
+ _M_dispose();
+ _M_data(__r->_M_refdata());
+ }
+ else if (__how_much && __n)
+ {
+ // Work in-place.
+ _S_move(_M_data() + __pos,
+ _M_data() + __pos + __n, __how_much);
+ }
+
+ _M_rep()->_M_set_length(__new_size);
+ }
+
+ template<>
+ inline bool
+ __rc_string_base<char, std::char_traits<char>,
+ std::allocator<char> >::
+ _M_compare(const __rc_string_base& __rcs) const
+ {
+ if (_M_rep() == __rcs._M_rep())
+ return true;
+ return false;
+ }
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ inline bool
+ __rc_string_base<wchar_t, std::char_traits<wchar_t>,
+ std::allocator<wchar_t> >::
+ _M_compare(const __rc_string_base& __rcs) const
+ {
+ if (_M_rep() == __rcs._M_rep())
+ return true;
+ return false;
+ }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _RC_STRING_BASE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/rope b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/rope
new file mode 100644
index 0000000..462c8f5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/rope
@@ -0,0 +1,2958 @@
+// SGI's rope class -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file ext/rope
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _ROPE
+#define _ROPE 1
+
+#include <algorithm>
+#include <iosfwd>
+#include <bits/stl_construct.h>
+#include <bits/stl_uninitialized.h>
+#include <bits/stl_function.h>
+#include <bits/stl_numeric.h>
+#include <bits/allocator.h>
+#include <bits/gthr.h>
+#include <tr1/functional>
+
+# ifdef __GC
+# define __GC_CONST const
+# else
+# define __GC_CONST // constant except for deallocation
+# endif
+
+#include <ext/memory> // For uninitialized_copy_n
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ namespace __detail
+ {
+ enum { _S_max_rope_depth = 45 };
+ enum _Tag {_S_leaf, _S_concat, _S_substringfn, _S_function};
+ } // namespace __detail
+
+ using std::size_t;
+ using std::ptrdiff_t;
+ using std::allocator;
+ using std::_Destroy;
+
+ // See libstdc++/36832.
+ template<typename _ForwardIterator, typename _Allocator>
+ void
+ _Destroy_const(_ForwardIterator __first,
+ _ForwardIterator __last, _Allocator __alloc)
+ {
+ for (; __first != __last; ++__first)
+ __alloc.destroy(&*__first);
+ }
+
+ template<typename _ForwardIterator, typename _Tp>
+ inline void
+ _Destroy_const(_ForwardIterator __first,
+ _ForwardIterator __last, allocator<_Tp>)
+ { _Destroy(__first, __last); }
+
+ // The _S_eos function is used for those functions that
+ // convert to/from C-like strings to detect the end of the string.
+
+ // The end-of-C-string character.
+ // This is what the draft standard says it should be.
+ template <class _CharT>
+ inline _CharT
+ _S_eos(_CharT*)
+ { return _CharT(); }
+
+ // Test for basic character types.
+ // For basic character types leaves having a trailing eos.
+ template <class _CharT>
+ inline bool
+ _S_is_basic_char_type(_CharT*)
+ { return false; }
+
+ template <class _CharT>
+ inline bool
+ _S_is_one_byte_char_type(_CharT*)
+ { return false; }
+
+ inline bool
+ _S_is_basic_char_type(char*)
+ { return true; }
+
+ inline bool
+ _S_is_one_byte_char_type(char*)
+ { return true; }
+
+ inline bool
+ _S_is_basic_char_type(wchar_t*)
+ { return true; }
+
+ // Store an eos iff _CharT is a basic character type.
+ // Do not reference _S_eos if it isn't.
+ template <class _CharT>
+ inline void
+ _S_cond_store_eos(_CharT&) { }
+
+ inline void
+ _S_cond_store_eos(char& __c)
+ { __c = 0; }
+
+ inline void
+ _S_cond_store_eos(wchar_t& __c)
+ { __c = 0; }
+
+ // char_producers are logically functions that generate a section of
+ // a string. These can be converted to ropes. The resulting rope
+ // invokes the char_producer on demand. This allows, for example,
+ // files to be viewed as ropes without reading the entire file.
+ template <class _CharT>
+ class char_producer
+ {
+ public:
+ virtual ~char_producer() { };
+
+ virtual void
+ operator()(size_t __start_pos, size_t __len,
+ _CharT* __buffer) = 0;
+ // Buffer should really be an arbitrary output iterator.
+ // That way we could flatten directly into an ostream, etc.
+ // This is thoroughly impossible, since iterator types don't
+ // have runtime descriptions.
+ };
+
+ // Sequence buffers:
+ //
+ // Sequence must provide an append operation that appends an
+ // array to the sequence. Sequence buffers are useful only if
+ // appending an entire array is cheaper than appending element by element.
+ // This is true for many string representations.
+ // This should perhaps inherit from ostream<sequence::value_type>
+ // and be implemented correspondingly, so that they can be used
+ // for formatted. For the sake of portability, we don't do this yet.
+ //
+ // For now, sequence buffers behave as output iterators. But they also
+ // behave a little like basic_ostringstream<sequence::value_type> and a
+ // little like containers.
+
+ template<class _Sequence, size_t _Buf_sz = 100>
+ class sequence_buffer
+ : public std::iterator<std::output_iterator_tag, void, void, void, void>
+ {
+ public:
+ typedef typename _Sequence::value_type value_type;
+ protected:
+ _Sequence* _M_prefix;
+ value_type _M_buffer[_Buf_sz];
+ size_t _M_buf_count;
+ public:
+
+ void
+ flush()
+ {
+ _M_prefix->append(_M_buffer, _M_buffer + _M_buf_count);
+ _M_buf_count = 0;
+ }
+
+ ~sequence_buffer()
+ { flush(); }
+
+ sequence_buffer()
+ : _M_prefix(0), _M_buf_count(0) { }
+
+ sequence_buffer(const sequence_buffer& __x)
+ {
+ _M_prefix = __x._M_prefix;
+ _M_buf_count = __x._M_buf_count;
+ std::copy(__x._M_buffer, __x._M_buffer + __x._M_buf_count, _M_buffer);
+ }
+
+ sequence_buffer(sequence_buffer& __x)
+ {
+ __x.flush();
+ _M_prefix = __x._M_prefix;
+ _M_buf_count = 0;
+ }
+
+ sequence_buffer(_Sequence& __s)
+ : _M_prefix(&__s), _M_buf_count(0) { }
+
+ sequence_buffer&
+ operator=(sequence_buffer& __x)
+ {
+ __x.flush();
+ _M_prefix = __x._M_prefix;
+ _M_buf_count = 0;
+ return *this;
+ }
+
+ sequence_buffer&
+ operator=(const sequence_buffer& __x)
+ {
+ _M_prefix = __x._M_prefix;
+ _M_buf_count = __x._M_buf_count;
+ std::copy(__x._M_buffer, __x._M_buffer + __x._M_buf_count, _M_buffer);
+ return *this;
+ }
+
+ void
+ push_back(value_type __x)
+ {
+ if (_M_buf_count < _Buf_sz)
+ {
+ _M_buffer[_M_buf_count] = __x;
+ ++_M_buf_count;
+ }
+ else
+ {
+ flush();
+ _M_buffer[0] = __x;
+ _M_buf_count = 1;
+ }
+ }
+
+ void
+ append(value_type* __s, size_t __len)
+ {
+ if (__len + _M_buf_count <= _Buf_sz)
+ {
+ size_t __i = _M_buf_count;
+ for (size_t __j = 0; __j < __len; __i++, __j++)
+ _M_buffer[__i] = __s[__j];
+ _M_buf_count += __len;
+ }
+ else if (0 == _M_buf_count)
+ _M_prefix->append(__s, __s + __len);
+ else
+ {
+ flush();
+ append(__s, __len);
+ }
+ }
+
+ sequence_buffer&
+ write(value_type* __s, size_t __len)
+ {
+ append(__s, __len);
+ return *this;
+ }
+
+ sequence_buffer&
+ put(value_type __x)
+ {
+ push_back(__x);
+ return *this;
+ }
+
+ sequence_buffer&
+ operator=(const value_type& __rhs)
+ {
+ push_back(__rhs);
+ return *this;
+ }
+
+ sequence_buffer&
+ operator*()
+ { return *this; }
+
+ sequence_buffer&
+ operator++()
+ { return *this; }
+
+ sequence_buffer
+ operator++(int)
+ { return *this; }
+ };
+
+ // The following should be treated as private, at least for now.
+ template<class _CharT>
+ class _Rope_char_consumer
+ {
+ public:
+ // If we had member templates, these should not be virtual.
+ // For now we need to use run-time parametrization where
+ // compile-time would do. Hence this should all be private
+ // for now.
+ // The symmetry with char_producer is accidental and temporary.
+ virtual ~_Rope_char_consumer() { };
+
+ virtual bool
+ operator()(const _CharT* __buffer, size_t __len) = 0;
+ };
+
+ // First a lot of forward declarations. The standard seems to require
+ // much stricter "declaration before use" than many of the implementations
+ // that preceded it.
+ template<class _CharT, class _Alloc = allocator<_CharT> >
+ class rope;
+
+ template<class _CharT, class _Alloc>
+ struct _Rope_RopeConcatenation;
+
+ template<class _CharT, class _Alloc>
+ struct _Rope_RopeLeaf;
+
+ template<class _CharT, class _Alloc>
+ struct _Rope_RopeFunction;
+
+ template<class _CharT, class _Alloc>
+ struct _Rope_RopeSubstring;
+
+ template<class _CharT, class _Alloc>
+ class _Rope_iterator;
+
+ template<class _CharT, class _Alloc>
+ class _Rope_const_iterator;
+
+ template<class _CharT, class _Alloc>
+ class _Rope_char_ref_proxy;
+
+ template<class _CharT, class _Alloc>
+ class _Rope_char_ptr_proxy;
+
+ template<class _CharT, class _Alloc>
+ bool
+ operator==(const _Rope_char_ptr_proxy<_CharT, _Alloc>& __x,
+ const _Rope_char_ptr_proxy<_CharT, _Alloc>& __y);
+
+ template<class _CharT, class _Alloc>
+ _Rope_const_iterator<_CharT, _Alloc>
+ operator-(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ ptrdiff_t __n);
+
+ template<class _CharT, class _Alloc>
+ _Rope_const_iterator<_CharT, _Alloc>
+ operator+(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ ptrdiff_t __n);
+
+ template<class _CharT, class _Alloc>
+ _Rope_const_iterator<_CharT, _Alloc>
+ operator+(ptrdiff_t __n,
+ const _Rope_const_iterator<_CharT, _Alloc>& __x);
+
+ template<class _CharT, class _Alloc>
+ bool
+ operator==(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ const _Rope_const_iterator<_CharT, _Alloc>& __y);
+
+ template<class _CharT, class _Alloc>
+ bool
+ operator<(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ const _Rope_const_iterator<_CharT, _Alloc>& __y);
+
+ template<class _CharT, class _Alloc>
+ ptrdiff_t
+ operator-(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ const _Rope_const_iterator<_CharT, _Alloc>& __y);
+
+ template<class _CharT, class _Alloc>
+ _Rope_iterator<_CharT, _Alloc>
+ operator-(const _Rope_iterator<_CharT, _Alloc>& __x, ptrdiff_t __n);
+
+ template<class _CharT, class _Alloc>
+ _Rope_iterator<_CharT, _Alloc>
+ operator+(const _Rope_iterator<_CharT, _Alloc>& __x, ptrdiff_t __n);
+
+ template<class _CharT, class _Alloc>
+ _Rope_iterator<_CharT, _Alloc>
+ operator+(ptrdiff_t __n, const _Rope_iterator<_CharT, _Alloc>& __x);
+
+ template<class _CharT, class _Alloc>
+ bool
+ operator==(const _Rope_iterator<_CharT, _Alloc>& __x,
+ const _Rope_iterator<_CharT, _Alloc>& __y);
+
+ template<class _CharT, class _Alloc>
+ bool
+ operator<(const _Rope_iterator<_CharT, _Alloc>& __x,
+ const _Rope_iterator<_CharT, _Alloc>& __y);
+
+ template<class _CharT, class _Alloc>
+ ptrdiff_t
+ operator-(const _Rope_iterator<_CharT, _Alloc>& __x,
+ const _Rope_iterator<_CharT, _Alloc>& __y);
+
+ template<class _CharT, class _Alloc>
+ rope<_CharT, _Alloc>
+ operator+(const rope<_CharT, _Alloc>& __left,
+ const rope<_CharT, _Alloc>& __right);
+
+ template<class _CharT, class _Alloc>
+ rope<_CharT, _Alloc>
+ operator+(const rope<_CharT, _Alloc>& __left, const _CharT* __right);
+
+ template<class _CharT, class _Alloc>
+ rope<_CharT, _Alloc>
+ operator+(const rope<_CharT, _Alloc>& __left, _CharT __right);
+
+ // Some helpers, so we can use power on ropes.
+ // See below for why this isn't local to the implementation.
+
+ // This uses a nonstandard refcount convention.
+ // The result has refcount 0.
+ template<class _CharT, class _Alloc>
+ struct _Rope_Concat_fn
+ : public std::binary_function<rope<_CharT, _Alloc>, rope<_CharT, _Alloc>,
+ rope<_CharT, _Alloc> >
+ {
+ rope<_CharT, _Alloc>
+ operator()(const rope<_CharT, _Alloc>& __x,
+ const rope<_CharT, _Alloc>& __y)
+ { return __x + __y; }
+ };
+
+ template <class _CharT, class _Alloc>
+ inline rope<_CharT, _Alloc>
+ identity_element(_Rope_Concat_fn<_CharT, _Alloc>)
+ { return rope<_CharT, _Alloc>(); }
+
+ // Class _Refcount_Base provides a type, _RC_t, a data member,
+ // _M_ref_count, and member functions _M_incr and _M_decr, which perform
+ // atomic preincrement/predecrement. The constructor initializes
+ // _M_ref_count.
+ struct _Refcount_Base
+ {
+ // The type _RC_t
+ typedef size_t _RC_t;
+
+ // The data member _M_ref_count
+ volatile _RC_t _M_ref_count;
+
+ // Constructor
+ __gthread_mutex_t _M_ref_count_lock;
+
+ _Refcount_Base(_RC_t __n) : _M_ref_count(__n), _M_ref_count_lock()
+ {
+#ifdef __GTHREAD_MUTEX_INIT
+ __gthread_mutex_t __tmp = __GTHREAD_MUTEX_INIT;
+ _M_ref_count_lock = __tmp;
+#elif defined(__GTHREAD_MUTEX_INIT_FUNCTION)
+ __GTHREAD_MUTEX_INIT_FUNCTION (&_M_ref_count_lock);
+#else
+#error __GTHREAD_MUTEX_INIT or __GTHREAD_MUTEX_INIT_FUNCTION should be defined by gthr.h abstraction layer, report problem to libstdc++@gcc.gnu.org.
+#endif
+ }
+
+ void
+ _M_incr()
+ {
+ __gthread_mutex_lock(&_M_ref_count_lock);
+ ++_M_ref_count;
+ __gthread_mutex_unlock(&_M_ref_count_lock);
+ }
+
+ _RC_t
+ _M_decr()
+ {
+ __gthread_mutex_lock(&_M_ref_count_lock);
+ volatile _RC_t __tmp = --_M_ref_count;
+ __gthread_mutex_unlock(&_M_ref_count_lock);
+ return __tmp;
+ }
+ };
+
+ //
+ // What follows should really be local to rope. Unfortunately,
+ // that doesn't work, since it makes it impossible to define generic
+ // equality on rope iterators. According to the draft standard, the
+ // template parameters for such an equality operator cannot be inferred
+ // from the occurrence of a member class as a parameter.
+ // (SGI compilers in fact allow this, but the __result wouldn't be
+ // portable.)
+ // Similarly, some of the static member functions are member functions
+ // only to avoid polluting the global namespace, and to circumvent
+ // restrictions on type inference for template functions.
+ //
+
+ //
+ // The internal data structure for representing a rope. This is
+ // private to the implementation. A rope is really just a pointer
+ // to one of these.
+ //
+ // A few basic functions for manipulating this data structure
+ // are members of _RopeRep. Most of the more complex algorithms
+ // are implemented as rope members.
+ //
+ // Some of the static member functions of _RopeRep have identically
+ // named functions in rope that simply invoke the _RopeRep versions.
+
+#define __ROPE_DEFINE_ALLOCS(__a) \
+ __ROPE_DEFINE_ALLOC(_CharT,_Data) /* character data */ \
+ typedef _Rope_RopeConcatenation<_CharT,__a> __C; \
+ __ROPE_DEFINE_ALLOC(__C,_C) \
+ typedef _Rope_RopeLeaf<_CharT,__a> __L; \
+ __ROPE_DEFINE_ALLOC(__L,_L) \
+ typedef _Rope_RopeFunction<_CharT,__a> __F; \
+ __ROPE_DEFINE_ALLOC(__F,_F) \
+ typedef _Rope_RopeSubstring<_CharT,__a> __S; \
+ __ROPE_DEFINE_ALLOC(__S,_S)
+
+ // Internal rope nodes potentially store a copy of the allocator
+ // instance used to allocate them. This is mostly redundant.
+ // But the alternative would be to pass allocator instances around
+ // in some form to nearly all internal functions, since any pointer
+ // assignment may result in a zero reference count and thus require
+ // deallocation.
+
+#define __STATIC_IF_SGI_ALLOC /* not static */
+
+ template <class _CharT, class _Alloc>
+ struct _Rope_rep_base
+ : public _Alloc
+ {
+ typedef _Alloc allocator_type;
+
+ allocator_type
+ get_allocator() const
+ { return *static_cast<const _Alloc*>(this); }
+
+ allocator_type&
+ _M_get_allocator()
+ { return *static_cast<_Alloc*>(this); }
+
+ const allocator_type&
+ _M_get_allocator() const
+ { return *static_cast<const _Alloc*>(this); }
+
+ _Rope_rep_base(size_t __size, const allocator_type&)
+ : _M_size(__size) { }
+
+ size_t _M_size;
+
+# define __ROPE_DEFINE_ALLOC(_Tp, __name) \
+ typedef typename \
+ _Alloc::template rebind<_Tp>::other __name##Alloc; \
+ static _Tp* __name##_allocate(size_t __n) \
+ { return __name##Alloc().allocate(__n); } \
+ static void __name##_deallocate(_Tp *__p, size_t __n) \
+ { __name##Alloc().deallocate(__p, __n); }
+ __ROPE_DEFINE_ALLOCS(_Alloc)
+# undef __ROPE_DEFINE_ALLOC
+ };
+
+ template<class _CharT, class _Alloc>
+ struct _Rope_RopeRep
+ : public _Rope_rep_base<_CharT, _Alloc>
+# ifndef __GC
+ , _Refcount_Base
+# endif
+ {
+ public:
+ __detail::_Tag _M_tag:8;
+ bool _M_is_balanced:8;
+ unsigned char _M_depth;
+ __GC_CONST _CharT* _M_c_string;
+ __gthread_mutex_t _M_c_string_lock;
+ /* Flattened version of string, if needed. */
+ /* typically 0. */
+ /* If it's not 0, then the memory is owned */
+ /* by this node. */
+ /* In the case of a leaf, this may point to */
+ /* the same memory as the data field. */
+ typedef typename _Rope_rep_base<_CharT, _Alloc>::allocator_type
+ allocator_type;
+
+ using _Rope_rep_base<_CharT, _Alloc>::get_allocator;
+ using _Rope_rep_base<_CharT, _Alloc>::_M_get_allocator;
+
+ _Rope_RopeRep(__detail::_Tag __t, int __d, bool __b, size_t __size,
+ const allocator_type& __a)
+ : _Rope_rep_base<_CharT, _Alloc>(__size, __a),
+#ifndef __GC
+ _Refcount_Base(1),
+#endif
+ _M_tag(__t), _M_is_balanced(__b), _M_depth(__d), _M_c_string(0)
+#ifdef __GTHREAD_MUTEX_INIT
+ {
+ // Do not copy a POSIX/gthr mutex once in use. However, bits are bits.
+ __gthread_mutex_t __tmp = __GTHREAD_MUTEX_INIT;
+ _M_c_string_lock = __tmp;
+ }
+#else
+ { __GTHREAD_MUTEX_INIT_FUNCTION (&_M_c_string_lock); }
+#endif
+#ifdef __GC
+ void
+ _M_incr () { }
+#endif
+ static void
+ _S_free_string(__GC_CONST _CharT*, size_t __len,
+ allocator_type& __a);
+#define __STL_FREE_STRING(__s, __l, __a) _S_free_string(__s, __l, __a);
+ // Deallocate data section of a leaf.
+ // This shouldn't be a member function.
+ // But its hard to do anything else at the
+ // moment, because it's templatized w.r.t.
+ // an allocator.
+ // Does nothing if __GC is defined.
+#ifndef __GC
+ void _M_free_c_string();
+ void _M_free_tree();
+ // Deallocate t. Assumes t is not 0.
+ void
+ _M_unref_nonnil()
+ {
+ if (0 == _M_decr())
+ _M_free_tree();
+ }
+
+ void
+ _M_ref_nonnil()
+ { _M_incr(); }
+
+ static void
+ _S_unref(_Rope_RopeRep* __t)
+ {
+ if (0 != __t)
+ __t->_M_unref_nonnil();
+ }
+
+ static void
+ _S_ref(_Rope_RopeRep* __t)
+ {
+ if (0 != __t)
+ __t->_M_incr();
+ }
+
+ static void
+ _S_free_if_unref(_Rope_RopeRep* __t)
+ {
+ if (0 != __t && 0 == __t->_M_ref_count)
+ __t->_M_free_tree();
+ }
+# else /* __GC */
+ void _M_unref_nonnil() { }
+ void _M_ref_nonnil() { }
+ static void _S_unref(_Rope_RopeRep*) { }
+ static void _S_ref(_Rope_RopeRep*) { }
+ static void _S_free_if_unref(_Rope_RopeRep*) { }
+# endif
+protected:
+ _Rope_RopeRep&
+ operator=(const _Rope_RopeRep&);
+
+ _Rope_RopeRep(const _Rope_RopeRep&);
+ };
+
+ template<class _CharT, class _Alloc>
+ struct _Rope_RopeLeaf
+ : public _Rope_RopeRep<_CharT, _Alloc>
+ {
+ public:
+ // Apparently needed by VC++
+ // The data fields of leaves are allocated with some
+ // extra space, to accommodate future growth and for basic
+ // character types, to hold a trailing eos character.
+ enum { _S_alloc_granularity = 8 };
+
+ static size_t
+ _S_rounded_up_size(size_t __n)
+ {
+ size_t __size_with_eos;
+
+ if (_S_is_basic_char_type((_CharT*)0))
+ __size_with_eos = __n + 1;
+ else
+ __size_with_eos = __n;
+#ifdef __GC
+ return __size_with_eos;
+#else
+ // Allow slop for in-place expansion.
+ return ((__size_with_eos + size_t(_S_alloc_granularity) - 1)
+ &~ (size_t(_S_alloc_granularity) - 1));
+#endif
+ }
+ __GC_CONST _CharT* _M_data; /* Not necessarily 0 terminated. */
+ /* The allocated size is */
+ /* _S_rounded_up_size(size), except */
+ /* in the GC case, in which it */
+ /* doesn't matter. */
+ typedef typename _Rope_rep_base<_CharT,_Alloc>::allocator_type
+ allocator_type;
+
+ _Rope_RopeLeaf(__GC_CONST _CharT* __d, size_t __size,
+ const allocator_type& __a)
+ : _Rope_RopeRep<_CharT, _Alloc>(__detail::_S_leaf, 0, true,
+ __size, __a), _M_data(__d)
+ {
+ if (_S_is_basic_char_type((_CharT *)0))
+ {
+ // already eos terminated.
+ this->_M_c_string = __d;
+ }
+ }
+ // The constructor assumes that d has been allocated with
+ // the proper allocator and the properly padded size.
+ // In contrast, the destructor deallocates the data:
+#ifndef __GC
+ ~_Rope_RopeLeaf() throw()
+ {
+ if (_M_data != this->_M_c_string)
+ this->_M_free_c_string();
+
+ __STL_FREE_STRING(_M_data, this->_M_size, this->_M_get_allocator());
+ }
+#endif
+protected:
+ _Rope_RopeLeaf&
+ operator=(const _Rope_RopeLeaf&);
+
+ _Rope_RopeLeaf(const _Rope_RopeLeaf&);
+ };
+
+ template<class _CharT, class _Alloc>
+ struct _Rope_RopeConcatenation
+ : public _Rope_RopeRep<_CharT, _Alloc>
+ {
+ public:
+ _Rope_RopeRep<_CharT, _Alloc>* _M_left;
+ _Rope_RopeRep<_CharT, _Alloc>* _M_right;
+
+ typedef typename _Rope_rep_base<_CharT, _Alloc>::allocator_type
+ allocator_type;
+
+ _Rope_RopeConcatenation(_Rope_RopeRep<_CharT, _Alloc>* __l,
+ _Rope_RopeRep<_CharT, _Alloc>* __r,
+ const allocator_type& __a)
+ : _Rope_RopeRep<_CharT, _Alloc>(__detail::_S_concat,
+ std::max(__l->_M_depth,
+ __r->_M_depth) + 1,
+ false,
+ __l->_M_size + __r->_M_size, __a),
+ _M_left(__l), _M_right(__r)
+ { }
+#ifndef __GC
+ ~_Rope_RopeConcatenation() throw()
+ {
+ this->_M_free_c_string();
+ _M_left->_M_unref_nonnil();
+ _M_right->_M_unref_nonnil();
+ }
+#endif
+protected:
+ _Rope_RopeConcatenation&
+ operator=(const _Rope_RopeConcatenation&);
+
+ _Rope_RopeConcatenation(const _Rope_RopeConcatenation&);
+ };
+
+ template<class _CharT, class _Alloc>
+ struct _Rope_RopeFunction
+ : public _Rope_RopeRep<_CharT, _Alloc>
+ {
+ public:
+ char_producer<_CharT>* _M_fn;
+#ifndef __GC
+ bool _M_delete_when_done; // Char_producer is owned by the
+ // rope and should be explicitly
+ // deleted when the rope becomes
+ // inaccessible.
+#else
+ // In the GC case, we either register the rope for
+ // finalization, or not. Thus the field is unnecessary;
+ // the information is stored in the collector data structures.
+ // We do need a finalization procedure to be invoked by the
+ // collector.
+ static void
+ _S_fn_finalization_proc(void * __tree, void *)
+ { delete ((_Rope_RopeFunction *)__tree) -> _M_fn; }
+#endif
+ typedef typename _Rope_rep_base<_CharT, _Alloc>::allocator_type
+ allocator_type;
+
+ _Rope_RopeFunction(char_producer<_CharT>* __f, size_t __size,
+ bool __d, const allocator_type& __a)
+ : _Rope_RopeRep<_CharT, _Alloc>(__detail::_S_function, 0, true, __size, __a)
+ , _M_fn(__f)
+#ifndef __GC
+ , _M_delete_when_done(__d)
+#endif
+ {
+#ifdef __GC
+ if (__d)
+ {
+ GC_REGISTER_FINALIZER(this, _Rope_RopeFunction::
+ _S_fn_finalization_proc, 0, 0, 0);
+ }
+#endif
+ }
+#ifndef __GC
+ ~_Rope_RopeFunction() throw()
+ {
+ this->_M_free_c_string();
+ if (_M_delete_when_done)
+ delete _M_fn;
+ }
+# endif
+ protected:
+ _Rope_RopeFunction&
+ operator=(const _Rope_RopeFunction&);
+
+ _Rope_RopeFunction(const _Rope_RopeFunction&);
+ };
+ // Substring results are usually represented using just
+ // concatenation nodes. But in the case of very long flat ropes
+ // or ropes with a functional representation that isn't practical.
+ // In that case, we represent the __result as a special case of
+ // RopeFunction, whose char_producer points back to the rope itself.
+ // In all cases except repeated substring operations and
+ // deallocation, we treat the __result as a RopeFunction.
+ template<class _CharT, class _Alloc>
+ struct _Rope_RopeSubstring
+ : public _Rope_RopeFunction<_CharT, _Alloc>,
+ public char_producer<_CharT>
+ {
+ public:
+ // XXX this whole class should be rewritten.
+ _Rope_RopeRep<_CharT,_Alloc>* _M_base; // not 0
+ size_t _M_start;
+
+ virtual void
+ operator()(size_t __start_pos, size_t __req_len,
+ _CharT* __buffer)
+ {
+ switch(_M_base->_M_tag)
+ {
+ case __detail::_S_function:
+ case __detail::_S_substringfn:
+ {
+ char_producer<_CharT>* __fn =
+ ((_Rope_RopeFunction<_CharT,_Alloc>*)_M_base)->_M_fn;
+ (*__fn)(__start_pos + _M_start, __req_len, __buffer);
+ }
+ break;
+ case __detail::_S_leaf:
+ {
+ __GC_CONST _CharT* __s =
+ ((_Rope_RopeLeaf<_CharT,_Alloc>*)_M_base)->_M_data;
+ uninitialized_copy_n(__s + __start_pos + _M_start, __req_len,
+ __buffer);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ typedef typename _Rope_rep_base<_CharT, _Alloc>::allocator_type
+ allocator_type;
+
+ _Rope_RopeSubstring(_Rope_RopeRep<_CharT, _Alloc>* __b, size_t __s,
+ size_t __l, const allocator_type& __a)
+ : _Rope_RopeFunction<_CharT, _Alloc>(this, __l, false, __a),
+ char_producer<_CharT>(), _M_base(__b), _M_start(__s)
+ {
+#ifndef __GC
+ _M_base->_M_ref_nonnil();
+#endif
+ this->_M_tag = __detail::_S_substringfn;
+ }
+ virtual ~_Rope_RopeSubstring() throw()
+ {
+#ifndef __GC
+ _M_base->_M_unref_nonnil();
+ // _M_free_c_string(); -- done by parent class
+#endif
+ }
+ };
+
+ // Self-destructing pointers to Rope_rep.
+ // These are not conventional smart pointers. Their
+ // only purpose in life is to ensure that unref is called
+ // on the pointer either at normal exit or if an exception
+ // is raised. It is the caller's responsibility to
+ // adjust reference counts when these pointers are initialized
+ // or assigned to. (This convention significantly reduces
+ // the number of potentially expensive reference count
+ // updates.)
+#ifndef __GC
+ template<class _CharT, class _Alloc>
+ struct _Rope_self_destruct_ptr
+ {
+ _Rope_RopeRep<_CharT, _Alloc>* _M_ptr;
+
+ ~_Rope_self_destruct_ptr()
+ { _Rope_RopeRep<_CharT, _Alloc>::_S_unref(_M_ptr); }
+#ifdef __EXCEPTIONS
+ _Rope_self_destruct_ptr() : _M_ptr(0) { };
+#else
+ _Rope_self_destruct_ptr() { };
+#endif
+ _Rope_self_destruct_ptr(_Rope_RopeRep<_CharT, _Alloc>* __p)
+ : _M_ptr(__p) { }
+
+ _Rope_RopeRep<_CharT, _Alloc>&
+ operator*()
+ { return *_M_ptr; }
+
+ _Rope_RopeRep<_CharT, _Alloc>*
+ operator->()
+ { return _M_ptr; }
+
+ operator _Rope_RopeRep<_CharT, _Alloc>*()
+ { return _M_ptr; }
+
+ _Rope_self_destruct_ptr&
+ operator=(_Rope_RopeRep<_CharT, _Alloc>* __x)
+ { _M_ptr = __x; return *this; }
+ };
+#endif
+
+ // Dereferencing a nonconst iterator has to return something
+ // that behaves almost like a reference. It's not possible to
+ // return an actual reference since assignment requires extra
+ // work. And we would get into the same problems as with the
+ // CD2 version of basic_string.
+ template<class _CharT, class _Alloc>
+ class _Rope_char_ref_proxy
+ {
+ friend class rope<_CharT, _Alloc>;
+ friend class _Rope_iterator<_CharT, _Alloc>;
+ friend class _Rope_char_ptr_proxy<_CharT, _Alloc>;
+#ifdef __GC
+ typedef _Rope_RopeRep<_CharT, _Alloc>* _Self_destruct_ptr;
+#else
+ typedef _Rope_self_destruct_ptr<_CharT, _Alloc> _Self_destruct_ptr;
+#endif
+ typedef _Rope_RopeRep<_CharT, _Alloc> _RopeRep;
+ typedef rope<_CharT, _Alloc> _My_rope;
+ size_t _M_pos;
+ _CharT _M_current;
+ bool _M_current_valid;
+ _My_rope* _M_root; // The whole rope.
+ public:
+ _Rope_char_ref_proxy(_My_rope* __r, size_t __p)
+ : _M_pos(__p), _M_current(), _M_current_valid(false), _M_root(__r) { }
+
+ _Rope_char_ref_proxy(const _Rope_char_ref_proxy& __x)
+ : _M_pos(__x._M_pos), _M_current(__x._M_current),
+ _M_current_valid(false), _M_root(__x._M_root) { }
+
+ // Don't preserve cache if the reference can outlive the
+ // expression. We claim that's not possible without calling
+ // a copy constructor or generating reference to a proxy
+ // reference. We declare the latter to have undefined semantics.
+ _Rope_char_ref_proxy(_My_rope* __r, size_t __p, _CharT __c)
+ : _M_pos(__p), _M_current(__c), _M_current_valid(true), _M_root(__r) { }
+
+ inline operator _CharT () const;
+
+ _Rope_char_ref_proxy&
+ operator=(_CharT __c);
+
+ _Rope_char_ptr_proxy<_CharT, _Alloc> operator&() const;
+
+ _Rope_char_ref_proxy&
+ operator=(const _Rope_char_ref_proxy& __c)
+ { return operator=((_CharT)__c); }
+ };
+
+ template<class _CharT, class __Alloc>
+ inline void
+ swap(_Rope_char_ref_proxy <_CharT, __Alloc > __a,
+ _Rope_char_ref_proxy <_CharT, __Alloc > __b)
+ {
+ _CharT __tmp = __a;
+ __a = __b;
+ __b = __tmp;
+ }
+
+ template<class _CharT, class _Alloc>
+ class _Rope_char_ptr_proxy
+ {
+ // XXX this class should be rewritten.
+ friend class _Rope_char_ref_proxy<_CharT, _Alloc>;
+ size_t _M_pos;
+ rope<_CharT,_Alloc>* _M_root; // The whole rope.
+ public:
+ _Rope_char_ptr_proxy(const _Rope_char_ref_proxy<_CharT,_Alloc>& __x)
+ : _M_pos(__x._M_pos), _M_root(__x._M_root) { }
+
+ _Rope_char_ptr_proxy(const _Rope_char_ptr_proxy& __x)
+ : _M_pos(__x._M_pos), _M_root(__x._M_root) { }
+
+ _Rope_char_ptr_proxy() { }
+
+ _Rope_char_ptr_proxy(_CharT* __x)
+ : _M_root(0), _M_pos(0) { }
+
+ _Rope_char_ptr_proxy&
+ operator=(const _Rope_char_ptr_proxy& __x)
+ {
+ _M_pos = __x._M_pos;
+ _M_root = __x._M_root;
+ return *this;
+ }
+
+ template<class _CharT2, class _Alloc2>
+ friend bool
+ operator==(const _Rope_char_ptr_proxy<_CharT2, _Alloc2>& __x,
+ const _Rope_char_ptr_proxy<_CharT2, _Alloc2>& __y);
+
+ _Rope_char_ref_proxy<_CharT, _Alloc> operator*() const
+ { return _Rope_char_ref_proxy<_CharT, _Alloc>(_M_root, _M_pos); }
+ };
+
+ // Rope iterators:
+ // Unlike in the C version, we cache only part of the stack
+ // for rope iterators, since they must be efficiently copyable.
+ // When we run out of cache, we have to reconstruct the iterator
+ // value.
+ // Pointers from iterators are not included in reference counts.
+ // Iterators are assumed to be thread private. Ropes can
+ // be shared.
+
+ template<class _CharT, class _Alloc>
+ class _Rope_iterator_base
+ : public std::iterator<std::random_access_iterator_tag, _CharT>
+ {
+ friend class rope<_CharT, _Alloc>;
+ public:
+ typedef _Alloc _allocator_type; // used in _Rope_rotate, VC++ workaround
+ typedef _Rope_RopeRep<_CharT, _Alloc> _RopeRep;
+ // Borland doesn't want this to be protected.
+ protected:
+ enum { _S_path_cache_len = 4 }; // Must be <= 9.
+ enum { _S_iterator_buf_len = 15 };
+ size_t _M_current_pos;
+ _RopeRep* _M_root; // The whole rope.
+ size_t _M_leaf_pos; // Starting position for current leaf
+ __GC_CONST _CharT* _M_buf_start;
+ // Buffer possibly
+ // containing current char.
+ __GC_CONST _CharT* _M_buf_ptr;
+ // Pointer to current char in buffer.
+ // != 0 ==> buffer valid.
+ __GC_CONST _CharT* _M_buf_end;
+ // One past __last valid char in buffer.
+ // What follows is the path cache. We go out of our
+ // way to make this compact.
+ // Path_end contains the bottom section of the path from
+ // the root to the current leaf.
+ const _RopeRep* _M_path_end[_S_path_cache_len];
+ int _M_leaf_index; // Last valid __pos in path_end;
+ // _M_path_end[0] ... _M_path_end[leaf_index-1]
+ // point to concatenation nodes.
+ unsigned char _M_path_directions;
+ // (path_directions >> __i) & 1 is 1
+ // iff we got from _M_path_end[leaf_index - __i - 1]
+ // to _M_path_end[leaf_index - __i] by going to the
+ // __right. Assumes path_cache_len <= 9.
+ _CharT _M_tmp_buf[_S_iterator_buf_len];
+ // Short buffer for surrounding chars.
+ // This is useful primarily for
+ // RopeFunctions. We put the buffer
+ // here to avoid locking in the
+ // multithreaded case.
+ // The cached path is generally assumed to be valid
+ // only if the buffer is valid.
+ static void _S_setbuf(_Rope_iterator_base& __x);
+ // Set buffer contents given
+ // path cache.
+ static void _S_setcache(_Rope_iterator_base& __x);
+ // Set buffer contents and
+ // path cache.
+ static void _S_setcache_for_incr(_Rope_iterator_base& __x);
+ // As above, but assumes path
+ // cache is valid for previous posn.
+ _Rope_iterator_base() { }
+
+ _Rope_iterator_base(_RopeRep* __root, size_t __pos)
+ : _M_current_pos(__pos), _M_root(__root), _M_buf_ptr(0) { }
+
+ void _M_incr(size_t __n);
+ void _M_decr(size_t __n);
+ public:
+ size_t
+ index() const
+ { return _M_current_pos; }
+
+ _Rope_iterator_base(const _Rope_iterator_base& __x)
+ {
+ if (0 != __x._M_buf_ptr)
+ *this = __x;
+ else
+ {
+ _M_current_pos = __x._M_current_pos;
+ _M_root = __x._M_root;
+ _M_buf_ptr = 0;
+ }
+ }
+ };
+
+ template<class _CharT, class _Alloc>
+ class _Rope_iterator;
+
+ template<class _CharT, class _Alloc>
+ class _Rope_const_iterator
+ : public _Rope_iterator_base<_CharT, _Alloc>
+ {
+ friend class rope<_CharT, _Alloc>;
+ protected:
+ typedef _Rope_RopeRep<_CharT, _Alloc> _RopeRep;
+ // The one from the base class may not be directly visible.
+ _Rope_const_iterator(const _RopeRep* __root, size_t __pos)
+ : _Rope_iterator_base<_CharT, _Alloc>(const_cast<_RopeRep*>(__root),
+ __pos)
+ // Only nonconst iterators modify root ref count
+ { }
+ public:
+ typedef _CharT reference; // Really a value. Returning a reference
+ // Would be a mess, since it would have
+ // to be included in refcount.
+ typedef const _CharT* pointer;
+
+ public:
+ _Rope_const_iterator() { };
+
+ _Rope_const_iterator(const _Rope_const_iterator& __x)
+ : _Rope_iterator_base<_CharT,_Alloc>(__x) { }
+
+ _Rope_const_iterator(const _Rope_iterator<_CharT,_Alloc>& __x);
+
+ _Rope_const_iterator(const rope<_CharT, _Alloc>& __r, size_t __pos)
+ : _Rope_iterator_base<_CharT,_Alloc>(__r._M_tree_ptr, __pos) { }
+
+ _Rope_const_iterator&
+ operator=(const _Rope_const_iterator& __x)
+ {
+ if (0 != __x._M_buf_ptr)
+ *(static_cast<_Rope_iterator_base<_CharT, _Alloc>*>(this)) = __x;
+ else
+ {
+ this->_M_current_pos = __x._M_current_pos;
+ this->_M_root = __x._M_root;
+ this->_M_buf_ptr = 0;
+ }
+ return(*this);
+ }
+
+ reference
+ operator*()
+ {
+ if (0 == this->_M_buf_ptr)
+ _S_setcache(*this);
+ return *this->_M_buf_ptr;
+ }
+
+ // Without this const version, Rope iterators do not meet the
+ // requirements of an Input Iterator.
+ reference
+ operator*() const
+ {
+ return *const_cast<_Rope_const_iterator&>(*this);
+ }
+
+ _Rope_const_iterator&
+ operator++()
+ {
+ __GC_CONST _CharT* __next;
+ if (0 != this->_M_buf_ptr
+ && (__next = this->_M_buf_ptr + 1) < this->_M_buf_end)
+ {
+ this->_M_buf_ptr = __next;
+ ++this->_M_current_pos;
+ }
+ else
+ this->_M_incr(1);
+ return *this;
+ }
+
+ _Rope_const_iterator&
+ operator+=(ptrdiff_t __n)
+ {
+ if (__n >= 0)
+ this->_M_incr(__n);
+ else
+ this->_M_decr(-__n);
+ return *this;
+ }
+
+ _Rope_const_iterator&
+ operator--()
+ {
+ this->_M_decr(1);
+ return *this;
+ }
+
+ _Rope_const_iterator&
+ operator-=(ptrdiff_t __n)
+ {
+ if (__n >= 0)
+ this->_M_decr(__n);
+ else
+ this->_M_incr(-__n);
+ return *this;
+ }
+
+ _Rope_const_iterator
+ operator++(int)
+ {
+ size_t __old_pos = this->_M_current_pos;
+ this->_M_incr(1);
+ return _Rope_const_iterator<_CharT,_Alloc>(this->_M_root, __old_pos);
+ // This makes a subsequent dereference expensive.
+ // Perhaps we should instead copy the iterator
+ // if it has a valid cache?
+ }
+
+ _Rope_const_iterator
+ operator--(int)
+ {
+ size_t __old_pos = this->_M_current_pos;
+ this->_M_decr(1);
+ return _Rope_const_iterator<_CharT,_Alloc>(this->_M_root, __old_pos);
+ }
+
+ template<class _CharT2, class _Alloc2>
+ friend _Rope_const_iterator<_CharT2, _Alloc2>
+ operator-(const _Rope_const_iterator<_CharT2, _Alloc2>& __x,
+ ptrdiff_t __n);
+
+ template<class _CharT2, class _Alloc2>
+ friend _Rope_const_iterator<_CharT2, _Alloc2>
+ operator+(const _Rope_const_iterator<_CharT2, _Alloc2>& __x,
+ ptrdiff_t __n);
+
+ template<class _CharT2, class _Alloc2>
+ friend _Rope_const_iterator<_CharT2, _Alloc2>
+ operator+(ptrdiff_t __n,
+ const _Rope_const_iterator<_CharT2, _Alloc2>& __x);
+
+ reference
+ operator[](size_t __n)
+ { return rope<_CharT, _Alloc>::_S_fetch(this->_M_root,
+ this->_M_current_pos + __n); }
+
+ template<class _CharT2, class _Alloc2>
+ friend bool
+ operator==(const _Rope_const_iterator<_CharT2, _Alloc2>& __x,
+ const _Rope_const_iterator<_CharT2, _Alloc2>& __y);
+
+ template<class _CharT2, class _Alloc2>
+ friend bool
+ operator<(const _Rope_const_iterator<_CharT2, _Alloc2>& __x,
+ const _Rope_const_iterator<_CharT2, _Alloc2>& __y);
+
+ template<class _CharT2, class _Alloc2>
+ friend ptrdiff_t
+ operator-(const _Rope_const_iterator<_CharT2, _Alloc2>& __x,
+ const _Rope_const_iterator<_CharT2, _Alloc2>& __y);
+ };
+
+ template<class _CharT, class _Alloc>
+ class _Rope_iterator
+ : public _Rope_iterator_base<_CharT, _Alloc>
+ {
+ friend class rope<_CharT, _Alloc>;
+ protected:
+ typedef typename _Rope_iterator_base<_CharT, _Alloc>::_RopeRep _RopeRep;
+ rope<_CharT, _Alloc>* _M_root_rope;
+
+ // root is treated as a cached version of this, and is used to
+ // detect changes to the underlying rope.
+
+ // Root is included in the reference count. This is necessary
+ // so that we can detect changes reliably. Unfortunately, it
+ // requires careful bookkeeping for the nonGC case.
+ _Rope_iterator(rope<_CharT, _Alloc>* __r, size_t __pos)
+ : _Rope_iterator_base<_CharT, _Alloc>(__r->_M_tree_ptr, __pos),
+ _M_root_rope(__r)
+ { _RopeRep::_S_ref(this->_M_root);
+ if (!(__r -> empty()))
+ _S_setcache(*this);
+ }
+
+ void _M_check();
+ public:
+ typedef _Rope_char_ref_proxy<_CharT, _Alloc> reference;
+ typedef _Rope_char_ref_proxy<_CharT, _Alloc>* pointer;
+
+ rope<_CharT, _Alloc>&
+ container()
+ { return *_M_root_rope; }
+
+ _Rope_iterator()
+ {
+ this->_M_root = 0; // Needed for reference counting.
+ };
+
+ _Rope_iterator(const _Rope_iterator& __x)
+ : _Rope_iterator_base<_CharT, _Alloc>(__x)
+ {
+ _M_root_rope = __x._M_root_rope;
+ _RopeRep::_S_ref(this->_M_root);
+ }
+
+ _Rope_iterator(rope<_CharT, _Alloc>& __r, size_t __pos);
+
+ ~_Rope_iterator()
+ { _RopeRep::_S_unref(this->_M_root); }
+
+ _Rope_iterator&
+ operator=(const _Rope_iterator& __x)
+ {
+ _RopeRep* __old = this->_M_root;
+
+ _RopeRep::_S_ref(__x._M_root);
+ if (0 != __x._M_buf_ptr)
+ {
+ _M_root_rope = __x._M_root_rope;
+ *(static_cast<_Rope_iterator_base<_CharT, _Alloc>*>(this)) = __x;
+ }
+ else
+ {
+ this->_M_current_pos = __x._M_current_pos;
+ this->_M_root = __x._M_root;
+ _M_root_rope = __x._M_root_rope;
+ this->_M_buf_ptr = 0;
+ }
+ _RopeRep::_S_unref(__old);
+ return(*this);
+ }
+
+ reference
+ operator*()
+ {
+ _M_check();
+ if (0 == this->_M_buf_ptr)
+ return _Rope_char_ref_proxy<_CharT, _Alloc>(_M_root_rope,
+ this->_M_current_pos);
+ else
+ return _Rope_char_ref_proxy<_CharT, _Alloc>(_M_root_rope,
+ this->_M_current_pos,
+ *this->_M_buf_ptr);
+ }
+
+ // See above comment.
+ reference
+ operator*() const
+ {
+ return *const_cast<_Rope_iterator&>(*this);
+ }
+
+ _Rope_iterator&
+ operator++()
+ {
+ this->_M_incr(1);
+ return *this;
+ }
+
+ _Rope_iterator&
+ operator+=(ptrdiff_t __n)
+ {
+ if (__n >= 0)
+ this->_M_incr(__n);
+ else
+ this->_M_decr(-__n);
+ return *this;
+ }
+
+ _Rope_iterator&
+ operator--()
+ {
+ this->_M_decr(1);
+ return *this;
+ }
+
+ _Rope_iterator&
+ operator-=(ptrdiff_t __n)
+ {
+ if (__n >= 0)
+ this->_M_decr(__n);
+ else
+ this->_M_incr(-__n);
+ return *this;
+ }
+
+ _Rope_iterator
+ operator++(int)
+ {
+ size_t __old_pos = this->_M_current_pos;
+ this->_M_incr(1);
+ return _Rope_iterator<_CharT,_Alloc>(_M_root_rope, __old_pos);
+ }
+
+ _Rope_iterator
+ operator--(int)
+ {
+ size_t __old_pos = this->_M_current_pos;
+ this->_M_decr(1);
+ return _Rope_iterator<_CharT,_Alloc>(_M_root_rope, __old_pos);
+ }
+
+ reference
+ operator[](ptrdiff_t __n)
+ { return _Rope_char_ref_proxy<_CharT, _Alloc>(_M_root_rope,
+ this->_M_current_pos
+ + __n); }
+
+ template<class _CharT2, class _Alloc2>
+ friend bool
+ operator==(const _Rope_iterator<_CharT2, _Alloc2>& __x,
+ const _Rope_iterator<_CharT2, _Alloc2>& __y);
+
+ template<class _CharT2, class _Alloc2>
+ friend bool
+ operator<(const _Rope_iterator<_CharT2, _Alloc2>& __x,
+ const _Rope_iterator<_CharT2, _Alloc2>& __y);
+
+ template<class _CharT2, class _Alloc2>
+ friend ptrdiff_t
+ operator-(const _Rope_iterator<_CharT2, _Alloc2>& __x,
+ const _Rope_iterator<_CharT2, _Alloc2>& __y);
+
+ template<class _CharT2, class _Alloc2>
+ friend _Rope_iterator<_CharT2, _Alloc2>
+ operator-(const _Rope_iterator<_CharT2, _Alloc2>& __x, ptrdiff_t __n);
+
+ template<class _CharT2, class _Alloc2>
+ friend _Rope_iterator<_CharT2, _Alloc2>
+ operator+(const _Rope_iterator<_CharT2, _Alloc2>& __x, ptrdiff_t __n);
+
+ template<class _CharT2, class _Alloc2>
+ friend _Rope_iterator<_CharT2, _Alloc2>
+ operator+(ptrdiff_t __n, const _Rope_iterator<_CharT2, _Alloc2>& __x);
+ };
+
+
+ template <class _CharT, class _Alloc>
+ struct _Rope_base
+ : public _Alloc
+ {
+ typedef _Alloc allocator_type;
+
+ allocator_type
+ get_allocator() const
+ { return *static_cast<const _Alloc*>(this); }
+
+ allocator_type&
+ _M_get_allocator()
+ { return *static_cast<_Alloc*>(this); }
+
+ const allocator_type&
+ _M_get_allocator() const
+ { return *static_cast<const _Alloc*>(this); }
+
+ typedef _Rope_RopeRep<_CharT, _Alloc> _RopeRep;
+ // The one in _Base may not be visible due to template rules.
+
+ _Rope_base(_RopeRep* __t, const allocator_type&)
+ : _M_tree_ptr(__t) { }
+
+ _Rope_base(const allocator_type&) { }
+
+ // The only data member of a rope:
+ _RopeRep *_M_tree_ptr;
+
+#define __ROPE_DEFINE_ALLOC(_Tp, __name) \
+ typedef typename \
+ _Alloc::template rebind<_Tp>::other __name##Alloc; \
+ static _Tp* __name##_allocate(size_t __n) \
+ { return __name##Alloc().allocate(__n); } \
+ static void __name##_deallocate(_Tp *__p, size_t __n) \
+ { __name##Alloc().deallocate(__p, __n); }
+ __ROPE_DEFINE_ALLOCS(_Alloc)
+#undef __ROPE_DEFINE_ALLOC
+
+ protected:
+ _Rope_base&
+ operator=(const _Rope_base&);
+
+ _Rope_base(const _Rope_base&);
+ };
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template <class _CharT, class _Alloc>
+ class rope : public _Rope_base<_CharT, _Alloc>
+ {
+ public:
+ typedef _CharT value_type;
+ typedef ptrdiff_t difference_type;
+ typedef size_t size_type;
+ typedef _CharT const_reference;
+ typedef const _CharT* const_pointer;
+ typedef _Rope_iterator<_CharT, _Alloc> iterator;
+ typedef _Rope_const_iterator<_CharT, _Alloc> const_iterator;
+ typedef _Rope_char_ref_proxy<_CharT, _Alloc> reference;
+ typedef _Rope_char_ptr_proxy<_CharT, _Alloc> pointer;
+
+ friend class _Rope_iterator<_CharT, _Alloc>;
+ friend class _Rope_const_iterator<_CharT, _Alloc>;
+ friend struct _Rope_RopeRep<_CharT, _Alloc>;
+ friend class _Rope_iterator_base<_CharT, _Alloc>;
+ friend class _Rope_char_ptr_proxy<_CharT, _Alloc>;
+ friend class _Rope_char_ref_proxy<_CharT, _Alloc>;
+ friend struct _Rope_RopeSubstring<_CharT, _Alloc>;
+
+ protected:
+ typedef _Rope_base<_CharT, _Alloc> _Base;
+ typedef typename _Base::allocator_type allocator_type;
+ using _Base::_M_tree_ptr;
+ using _Base::get_allocator;
+ using _Base::_M_get_allocator;
+ typedef __GC_CONST _CharT* _Cstrptr;
+
+ static _CharT _S_empty_c_str[1];
+
+ static bool
+ _S_is0(_CharT __c)
+ { return __c == _S_eos((_CharT*)0); }
+
+ enum { _S_copy_max = 23 };
+ // For strings shorter than _S_copy_max, we copy to
+ // concatenate.
+
+ typedef _Rope_RopeRep<_CharT, _Alloc> _RopeRep;
+ typedef _Rope_RopeConcatenation<_CharT, _Alloc> _RopeConcatenation;
+ typedef _Rope_RopeLeaf<_CharT, _Alloc> _RopeLeaf;
+ typedef _Rope_RopeFunction<_CharT, _Alloc> _RopeFunction;
+ typedef _Rope_RopeSubstring<_CharT, _Alloc> _RopeSubstring;
+
+ // Retrieve a character at the indicated position.
+ static _CharT _S_fetch(_RopeRep* __r, size_type __pos);
+
+#ifndef __GC
+ // Obtain a pointer to the character at the indicated position.
+ // The pointer can be used to change the character.
+ // If such a pointer cannot be produced, as is frequently the
+ // case, 0 is returned instead.
+ // (Returns nonzero only if all nodes in the path have a refcount
+ // of 1.)
+ static _CharT* _S_fetch_ptr(_RopeRep* __r, size_type __pos);
+#endif
+
+ static bool
+ _S_apply_to_pieces(// should be template parameter
+ _Rope_char_consumer<_CharT>& __c,
+ const _RopeRep* __r,
+ size_t __begin, size_t __end);
+ // begin and end are assumed to be in range.
+
+#ifndef __GC
+ static void
+ _S_unref(_RopeRep* __t)
+ { _RopeRep::_S_unref(__t); }
+
+ static void
+ _S_ref(_RopeRep* __t)
+ { _RopeRep::_S_ref(__t); }
+
+#else /* __GC */
+ static void _S_unref(_RopeRep*) { }
+ static void _S_ref(_RopeRep*) { }
+#endif
+
+#ifdef __GC
+ typedef _Rope_RopeRep<_CharT, _Alloc>* _Self_destruct_ptr;
+#else
+ typedef _Rope_self_destruct_ptr<_CharT, _Alloc> _Self_destruct_ptr;
+#endif
+
+ // _Result is counted in refcount.
+ static _RopeRep* _S_substring(_RopeRep* __base,
+ size_t __start, size_t __endp1);
+
+ static _RopeRep* _S_concat_char_iter(_RopeRep* __r,
+ const _CharT* __iter, size_t __slen);
+ // Concatenate rope and char ptr, copying __s.
+ // Should really take an arbitrary iterator.
+ // Result is counted in refcount.
+ static _RopeRep* _S_destr_concat_char_iter(_RopeRep* __r,
+ const _CharT* __iter,
+ size_t __slen)
+ // As above, but one reference to __r is about to be
+ // destroyed. Thus the pieces may be recycled if all
+ // relevant reference counts are 1.
+#ifdef __GC
+ // We can't really do anything since refcounts are unavailable.
+ { return _S_concat_char_iter(__r, __iter, __slen); }
+#else
+ ;
+#endif
+
+ static _RopeRep* _S_concat(_RopeRep* __left, _RopeRep* __right);
+ // General concatenation on _RopeRep. _Result
+ // has refcount of 1. Adjusts argument refcounts.
+
+ public:
+ void
+ apply_to_pieces(size_t __begin, size_t __end,
+ _Rope_char_consumer<_CharT>& __c) const
+ { _S_apply_to_pieces(__c, this->_M_tree_ptr, __begin, __end); }
+
+ protected:
+
+ static size_t
+ _S_rounded_up_size(size_t __n)
+ { return _RopeLeaf::_S_rounded_up_size(__n); }
+
+ static size_t
+ _S_allocated_capacity(size_t __n)
+ {
+ if (_S_is_basic_char_type((_CharT*)0))
+ return _S_rounded_up_size(__n) - 1;
+ else
+ return _S_rounded_up_size(__n);
+
+ }
+
+ // Allocate and construct a RopeLeaf using the supplied allocator
+ // Takes ownership of s instead of copying.
+ static _RopeLeaf*
+ _S_new_RopeLeaf(__GC_CONST _CharT *__s,
+ size_t __size, allocator_type& __a)
+ {
+ _RopeLeaf* __space = typename _Base::_LAlloc(__a).allocate(1);
+ return new(__space) _RopeLeaf(__s, __size, __a);
+ }
+
+ static _RopeConcatenation*
+ _S_new_RopeConcatenation(_RopeRep* __left, _RopeRep* __right,
+ allocator_type& __a)
+ {
+ _RopeConcatenation* __space = typename _Base::_CAlloc(__a).allocate(1);
+ return new(__space) _RopeConcatenation(__left, __right, __a);
+ }
+
+ static _RopeFunction*
+ _S_new_RopeFunction(char_producer<_CharT>* __f,
+ size_t __size, bool __d, allocator_type& __a)
+ {
+ _RopeFunction* __space = typename _Base::_FAlloc(__a).allocate(1);
+ return new(__space) _RopeFunction(__f, __size, __d, __a);
+ }
+
+ static _RopeSubstring*
+ _S_new_RopeSubstring(_Rope_RopeRep<_CharT,_Alloc>* __b, size_t __s,
+ size_t __l, allocator_type& __a)
+ {
+ _RopeSubstring* __space = typename _Base::_SAlloc(__a).allocate(1);
+ return new(__space) _RopeSubstring(__b, __s, __l, __a);
+ }
+
+ static _RopeLeaf*
+ _S_RopeLeaf_from_unowned_char_ptr(const _CharT *__s,
+ size_t __size, allocator_type& __a)
+#define __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __size, __a) \
+ _S_RopeLeaf_from_unowned_char_ptr(__s, __size, __a)
+ {
+ if (0 == __size)
+ return 0;
+ _CharT* __buf = __a.allocate(_S_rounded_up_size(__size));
+
+ __uninitialized_copy_n_a(__s, __size, __buf, __a);
+ _S_cond_store_eos(__buf[__size]);
+ __try
+ { return _S_new_RopeLeaf(__buf, __size, __a); }
+ __catch(...)
+ {
+ _RopeRep::__STL_FREE_STRING(__buf, __size, __a);
+ __throw_exception_again;
+ }
+ }
+
+ // Concatenation of nonempty strings.
+ // Always builds a concatenation node.
+ // Rebalances if the result is too deep.
+ // Result has refcount 1.
+ // Does not increment left and right ref counts even though
+ // they are referenced.
+ static _RopeRep*
+ _S_tree_concat(_RopeRep* __left, _RopeRep* __right);
+
+ // Concatenation helper functions
+ static _RopeLeaf*
+ _S_leaf_concat_char_iter(_RopeLeaf* __r,
+ const _CharT* __iter, size_t __slen);
+ // Concatenate by copying leaf.
+ // should take an arbitrary iterator
+ // result has refcount 1.
+#ifndef __GC
+ static _RopeLeaf*
+ _S_destr_leaf_concat_char_iter(_RopeLeaf* __r,
+ const _CharT* __iter, size_t __slen);
+ // A version that potentially clobbers __r if __r->_M_ref_count == 1.
+#endif
+
+ private:
+
+ static size_t _S_char_ptr_len(const _CharT* __s);
+ // slightly generalized strlen
+
+ rope(_RopeRep* __t, const allocator_type& __a = allocator_type())
+ : _Base(__t, __a) { }
+
+
+ // Copy __r to the _CharT buffer.
+ // Returns __buffer + __r->_M_size.
+ // Assumes that buffer is uninitialized.
+ static _CharT* _S_flatten(_RopeRep* __r, _CharT* __buffer);
+
+ // Again, with explicit starting position and length.
+ // Assumes that buffer is uninitialized.
+ static _CharT* _S_flatten(_RopeRep* __r,
+ size_t __start, size_t __len,
+ _CharT* __buffer);
+
+ static const unsigned long
+ _S_min_len[__detail::_S_max_rope_depth + 1];
+
+ static bool
+ _S_is_balanced(_RopeRep* __r)
+ { return (__r->_M_size >= _S_min_len[__r->_M_depth]); }
+
+ static bool
+ _S_is_almost_balanced(_RopeRep* __r)
+ { return (__r->_M_depth == 0
+ || __r->_M_size >= _S_min_len[__r->_M_depth - 1]); }
+
+ static bool
+ _S_is_roughly_balanced(_RopeRep* __r)
+ { return (__r->_M_depth <= 1
+ || __r->_M_size >= _S_min_len[__r->_M_depth - 2]); }
+
+ // Assumes the result is not empty.
+ static _RopeRep*
+ _S_concat_and_set_balanced(_RopeRep* __left, _RopeRep* __right)
+ {
+ _RopeRep* __result = _S_concat(__left, __right);
+ if (_S_is_balanced(__result))
+ __result->_M_is_balanced = true;
+ return __result;
+ }
+
+ // The basic rebalancing operation. Logically copies the
+ // rope. The result has refcount of 1. The client will
+ // usually decrement the reference count of __r.
+ // The result is within height 2 of balanced by the above
+ // definition.
+ static _RopeRep* _S_balance(_RopeRep* __r);
+
+ // Add all unbalanced subtrees to the forest of balanced trees.
+ // Used only by balance.
+ static void _S_add_to_forest(_RopeRep*__r, _RopeRep** __forest);
+
+ // Add __r to forest, assuming __r is already balanced.
+ static void _S_add_leaf_to_forest(_RopeRep* __r, _RopeRep** __forest);
+
+ // Print to stdout, exposing structure
+ static void _S_dump(_RopeRep* __r, int __indent = 0);
+
+ // Return -1, 0, or 1 if __x < __y, __x == __y, or __x > __y resp.
+ static int _S_compare(const _RopeRep* __x, const _RopeRep* __y);
+
+ public:
+ bool
+ empty() const
+ { return 0 == this->_M_tree_ptr; }
+
+ // Comparison member function. This is public only for those
+ // clients that need a ternary comparison. Others
+ // should use the comparison operators below.
+ int
+ compare(const rope& __y) const
+ { return _S_compare(this->_M_tree_ptr, __y._M_tree_ptr); }
+
+ rope(const _CharT* __s, const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ this->_M_tree_ptr =
+ __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, _S_char_ptr_len(__s),
+ _M_get_allocator());
+ }
+
+ rope(const _CharT* __s, size_t __len,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ this->_M_tree_ptr =
+ __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __len, _M_get_allocator());
+ }
+
+ // Should perhaps be templatized with respect to the iterator type
+ // and use Sequence_buffer. (It should perhaps use sequence_buffer
+ // even now.)
+ rope(const _CharT* __s, const _CharT* __e,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ this->_M_tree_ptr =
+ __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __e - __s, _M_get_allocator());
+ }
+
+ rope(const const_iterator& __s, const const_iterator& __e,
+ const allocator_type& __a = allocator_type())
+ : _Base(_S_substring(__s._M_root, __s._M_current_pos,
+ __e._M_current_pos), __a)
+ { }
+
+ rope(const iterator& __s, const iterator& __e,
+ const allocator_type& __a = allocator_type())
+ : _Base(_S_substring(__s._M_root, __s._M_current_pos,
+ __e._M_current_pos), __a)
+ { }
+
+ rope(_CharT __c, const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ _CharT* __buf = this->_Data_allocate(_S_rounded_up_size(1));
+
+ _M_get_allocator().construct(__buf, __c);
+ __try
+ {
+ this->_M_tree_ptr = _S_new_RopeLeaf(__buf, 1,
+ _M_get_allocator());
+ }
+ __catch(...)
+ {
+ _RopeRep::__STL_FREE_STRING(__buf, 1, _M_get_allocator());
+ __throw_exception_again;
+ }
+ }
+
+ rope(size_t __n, _CharT __c,
+ const allocator_type& __a = allocator_type());
+
+ rope(const allocator_type& __a = allocator_type())
+ : _Base(0, __a) { }
+
+ // Construct a rope from a function that can compute its members
+ rope(char_producer<_CharT> *__fn, size_t __len, bool __delete_fn,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ this->_M_tree_ptr = (0 == __len) ?
+ 0 : _S_new_RopeFunction(__fn, __len, __delete_fn, __a);
+ }
+
+ rope(const rope& __x, const allocator_type& __a = allocator_type())
+ : _Base(__x._M_tree_ptr, __a)
+ { _S_ref(this->_M_tree_ptr); }
+
+ ~rope() throw()
+ { _S_unref(this->_M_tree_ptr); }
+
+ rope&
+ operator=(const rope& __x)
+ {
+ _RopeRep* __old = this->_M_tree_ptr;
+ this->_M_tree_ptr = __x._M_tree_ptr;
+ _S_ref(this->_M_tree_ptr);
+ _S_unref(__old);
+ return *this;
+ }
+
+ void
+ clear()
+ {
+ _S_unref(this->_M_tree_ptr);
+ this->_M_tree_ptr = 0;
+ }
+
+ void
+ push_back(_CharT __x)
+ {
+ _RopeRep* __old = this->_M_tree_ptr;
+ this->_M_tree_ptr
+ = _S_destr_concat_char_iter(this->_M_tree_ptr, &__x, 1);
+ _S_unref(__old);
+ }
+
+ void
+ pop_back()
+ {
+ _RopeRep* __old = this->_M_tree_ptr;
+ this->_M_tree_ptr = _S_substring(this->_M_tree_ptr,
+ 0, this->_M_tree_ptr->_M_size - 1);
+ _S_unref(__old);
+ }
+
+ _CharT
+ back() const
+ { return _S_fetch(this->_M_tree_ptr, this->_M_tree_ptr->_M_size - 1); }
+
+ void
+ push_front(_CharT __x)
+ {
+ _RopeRep* __old = this->_M_tree_ptr;
+ _RopeRep* __left =
+ __STL_ROPE_FROM_UNOWNED_CHAR_PTR(&__x, 1, _M_get_allocator());
+ __try
+ {
+ this->_M_tree_ptr = _S_concat(__left, this->_M_tree_ptr);
+ _S_unref(__old);
+ _S_unref(__left);
+ }
+ __catch(...)
+ {
+ _S_unref(__left);
+ __throw_exception_again;
+ }
+ }
+
+ void
+ pop_front()
+ {
+ _RopeRep* __old = this->_M_tree_ptr;
+ this->_M_tree_ptr
+ = _S_substring(this->_M_tree_ptr, 1, this->_M_tree_ptr->_M_size);
+ _S_unref(__old);
+ }
+
+ _CharT
+ front() const
+ { return _S_fetch(this->_M_tree_ptr, 0); }
+
+ void
+ balance()
+ {
+ _RopeRep* __old = this->_M_tree_ptr;
+ this->_M_tree_ptr = _S_balance(this->_M_tree_ptr);
+ _S_unref(__old);
+ }
+
+ void
+ copy(_CharT* __buffer) const
+ {
+ _Destroy_const(__buffer, __buffer + size(), _M_get_allocator());
+ _S_flatten(this->_M_tree_ptr, __buffer);
+ }
+
+ // This is the copy function from the standard, but
+ // with the arguments reordered to make it consistent with the
+ // rest of the interface.
+ // Note that this guaranteed not to compile if the draft standard
+ // order is assumed.
+ size_type
+ copy(size_type __pos, size_type __n, _CharT* __buffer) const
+ {
+ size_t __size = size();
+ size_t __len = (__pos + __n > __size? __size - __pos : __n);
+
+ _Destroy_const(__buffer, __buffer + __len, _M_get_allocator());
+ _S_flatten(this->_M_tree_ptr, __pos, __len, __buffer);
+ return __len;
+ }
+
+ // Print to stdout, exposing structure. May be useful for
+ // performance debugging.
+ void
+ dump()
+ { _S_dump(this->_M_tree_ptr); }
+
+ // Convert to 0 terminated string in new allocated memory.
+ // Embedded 0s in the input do not terminate the copy.
+ const _CharT* c_str() const;
+
+ // As above, but also use the flattened representation as
+ // the new rope representation.
+ const _CharT* replace_with_c_str();
+
+ // Reclaim memory for the c_str generated flattened string.
+ // Intentionally undocumented, since it's hard to say when this
+ // is safe for multiple threads.
+ void
+ delete_c_str ()
+ {
+ if (0 == this->_M_tree_ptr)
+ return;
+ if (__detail::_S_leaf == this->_M_tree_ptr->_M_tag &&
+ ((_RopeLeaf*)this->_M_tree_ptr)->_M_data ==
+ this->_M_tree_ptr->_M_c_string)
+ {
+ // Representation shared
+ return;
+ }
+#ifndef __GC
+ this->_M_tree_ptr->_M_free_c_string();
+#endif
+ this->_M_tree_ptr->_M_c_string = 0;
+ }
+
+ _CharT
+ operator[] (size_type __pos) const
+ { return _S_fetch(this->_M_tree_ptr, __pos); }
+
+ _CharT
+ at(size_type __pos) const
+ {
+ // if (__pos >= size()) throw out_of_range; // XXX
+ return (*this)[__pos];
+ }
+
+ const_iterator
+ begin() const
+ { return(const_iterator(this->_M_tree_ptr, 0)); }
+
+ // An easy way to get a const iterator from a non-const container.
+ const_iterator
+ const_begin() const
+ { return(const_iterator(this->_M_tree_ptr, 0)); }
+
+ const_iterator
+ end() const
+ { return(const_iterator(this->_M_tree_ptr, size())); }
+
+ const_iterator
+ const_end() const
+ { return(const_iterator(this->_M_tree_ptr, size())); }
+
+ size_type
+ size() const
+ { return(0 == this->_M_tree_ptr? 0 : this->_M_tree_ptr->_M_size); }
+
+ size_type
+ length() const
+ { return size(); }
+
+ size_type
+ max_size() const
+ {
+ return _S_min_len[int(__detail::_S_max_rope_depth) - 1] - 1;
+ // Guarantees that the result can be sufficiently
+ // balanced. Longer ropes will probably still work,
+ // but it's harder to make guarantees.
+ }
+
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ const_rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ const_rend() const
+ { return const_reverse_iterator(begin()); }
+
+ template<class _CharT2, class _Alloc2>
+ friend rope<_CharT2, _Alloc2>
+ operator+(const rope<_CharT2, _Alloc2>& __left,
+ const rope<_CharT2, _Alloc2>& __right);
+
+ template<class _CharT2, class _Alloc2>
+ friend rope<_CharT2, _Alloc2>
+ operator+(const rope<_CharT2, _Alloc2>& __left, const _CharT2* __right);
+
+ template<class _CharT2, class _Alloc2>
+ friend rope<_CharT2, _Alloc2>
+ operator+(const rope<_CharT2, _Alloc2>& __left, _CharT2 __right);
+
+ // The symmetric cases are intentionally omitted, since they're
+ // presumed to be less common, and we don't handle them as well.
+
+ // The following should really be templatized. The first
+ // argument should be an input iterator or forward iterator with
+ // value_type _CharT.
+ rope&
+ append(const _CharT* __iter, size_t __n)
+ {
+ _RopeRep* __result =
+ _S_destr_concat_char_iter(this->_M_tree_ptr, __iter, __n);
+ _S_unref(this->_M_tree_ptr);
+ this->_M_tree_ptr = __result;
+ return *this;
+ }
+
+ rope&
+ append(const _CharT* __c_string)
+ {
+ size_t __len = _S_char_ptr_len(__c_string);
+ append(__c_string, __len);
+ return(*this);
+ }
+
+ rope&
+ append(const _CharT* __s, const _CharT* __e)
+ {
+ _RopeRep* __result =
+ _S_destr_concat_char_iter(this->_M_tree_ptr, __s, __e - __s);
+ _S_unref(this->_M_tree_ptr);
+ this->_M_tree_ptr = __result;
+ return *this;
+ }
+
+ rope&
+ append(const_iterator __s, const_iterator __e)
+ {
+ _Self_destruct_ptr __appendee(_S_substring(__s._M_root,
+ __s._M_current_pos,
+ __e._M_current_pos));
+ _RopeRep* __result = _S_concat(this->_M_tree_ptr,
+ (_RopeRep*)__appendee);
+ _S_unref(this->_M_tree_ptr);
+ this->_M_tree_ptr = __result;
+ return *this;
+ }
+
+ rope&
+ append(_CharT __c)
+ {
+ _RopeRep* __result =
+ _S_destr_concat_char_iter(this->_M_tree_ptr, &__c, 1);
+ _S_unref(this->_M_tree_ptr);
+ this->_M_tree_ptr = __result;
+ return *this;
+ }
+
+ rope&
+ append()
+ { return append(_CharT()); } // XXX why?
+
+ rope&
+ append(const rope& __y)
+ {
+ _RopeRep* __result = _S_concat(this->_M_tree_ptr, __y._M_tree_ptr);
+ _S_unref(this->_M_tree_ptr);
+ this->_M_tree_ptr = __result;
+ return *this;
+ }
+
+ rope&
+ append(size_t __n, _CharT __c)
+ {
+ rope<_CharT,_Alloc> __last(__n, __c);
+ return append(__last);
+ }
+
+ void
+ swap(rope& __b)
+ {
+ _RopeRep* __tmp = this->_M_tree_ptr;
+ this->_M_tree_ptr = __b._M_tree_ptr;
+ __b._M_tree_ptr = __tmp;
+ }
+
+ protected:
+ // Result is included in refcount.
+ static _RopeRep*
+ replace(_RopeRep* __old, size_t __pos1,
+ size_t __pos2, _RopeRep* __r)
+ {
+ if (0 == __old)
+ {
+ _S_ref(__r);
+ return __r;
+ }
+ _Self_destruct_ptr __left(_S_substring(__old, 0, __pos1));
+ _Self_destruct_ptr __right(_S_substring(__old, __pos2, __old->_M_size));
+ _RopeRep* __result;
+
+ if (0 == __r)
+ __result = _S_concat(__left, __right);
+ else
+ {
+ _Self_destruct_ptr __left_result(_S_concat(__left, __r));
+ __result = _S_concat(__left_result, __right);
+ }
+ return __result;
+ }
+
+ public:
+ void
+ insert(size_t __p, const rope& __r)
+ {
+ _RopeRep* __result =
+ replace(this->_M_tree_ptr, __p, __p, __r._M_tree_ptr);
+ _S_unref(this->_M_tree_ptr);
+ this->_M_tree_ptr = __result;
+ }
+
+ void
+ insert(size_t __p, size_t __n, _CharT __c)
+ {
+ rope<_CharT,_Alloc> __r(__n,__c);
+ insert(__p, __r);
+ }
+
+ void
+ insert(size_t __p, const _CharT* __i, size_t __n)
+ {
+ _Self_destruct_ptr __left(_S_substring(this->_M_tree_ptr, 0, __p));
+ _Self_destruct_ptr __right(_S_substring(this->_M_tree_ptr,
+ __p, size()));
+ _Self_destruct_ptr __left_result(_S_concat_char_iter(__left, __i, __n));
+ // _S_ destr_concat_char_iter should be safe here.
+ // But as it stands it's probably not a win, since __left
+ // is likely to have additional references.
+ _RopeRep* __result = _S_concat(__left_result, __right);
+ _S_unref(this->_M_tree_ptr);
+ this->_M_tree_ptr = __result;
+ }
+
+ void
+ insert(size_t __p, const _CharT* __c_string)
+ { insert(__p, __c_string, _S_char_ptr_len(__c_string)); }
+
+ void
+ insert(size_t __p, _CharT __c)
+ { insert(__p, &__c, 1); }
+
+ void
+ insert(size_t __p)
+ {
+ _CharT __c = _CharT();
+ insert(__p, &__c, 1);
+ }
+
+ void
+ insert(size_t __p, const _CharT* __i, const _CharT* __j)
+ {
+ rope __r(__i, __j);
+ insert(__p, __r);
+ }
+
+ void
+ insert(size_t __p, const const_iterator& __i,
+ const const_iterator& __j)
+ {
+ rope __r(__i, __j);
+ insert(__p, __r);
+ }
+
+ void
+ insert(size_t __p, const iterator& __i,
+ const iterator& __j)
+ {
+ rope __r(__i, __j);
+ insert(__p, __r);
+ }
+
+ // (position, length) versions of replace operations:
+
+ void
+ replace(size_t __p, size_t __n, const rope& __r)
+ {
+ _RopeRep* __result =
+ replace(this->_M_tree_ptr, __p, __p + __n, __r._M_tree_ptr);
+ _S_unref(this->_M_tree_ptr);
+ this->_M_tree_ptr = __result;
+ }
+
+ void
+ replace(size_t __p, size_t __n,
+ const _CharT* __i, size_t __i_len)
+ {
+ rope __r(__i, __i_len);
+ replace(__p, __n, __r);
+ }
+
+ void
+ replace(size_t __p, size_t __n, _CharT __c)
+ {
+ rope __r(__c);
+ replace(__p, __n, __r);
+ }
+
+ void
+ replace(size_t __p, size_t __n, const _CharT* __c_string)
+ {
+ rope __r(__c_string);
+ replace(__p, __n, __r);
+ }
+
+ void
+ replace(size_t __p, size_t __n,
+ const _CharT* __i, const _CharT* __j)
+ {
+ rope __r(__i, __j);
+ replace(__p, __n, __r);
+ }
+
+ void
+ replace(size_t __p, size_t __n,
+ const const_iterator& __i, const const_iterator& __j)
+ {
+ rope __r(__i, __j);
+ replace(__p, __n, __r);
+ }
+
+ void
+ replace(size_t __p, size_t __n,
+ const iterator& __i, const iterator& __j)
+ {
+ rope __r(__i, __j);
+ replace(__p, __n, __r);
+ }
+
+ // Single character variants:
+ void
+ replace(size_t __p, _CharT __c)
+ {
+ iterator __i(this, __p);
+ *__i = __c;
+ }
+
+ void
+ replace(size_t __p, const rope& __r)
+ { replace(__p, 1, __r); }
+
+ void
+ replace(size_t __p, const _CharT* __i, size_t __i_len)
+ { replace(__p, 1, __i, __i_len); }
+
+ void
+ replace(size_t __p, const _CharT* __c_string)
+ { replace(__p, 1, __c_string); }
+
+ void
+ replace(size_t __p, const _CharT* __i, const _CharT* __j)
+ { replace(__p, 1, __i, __j); }
+
+ void
+ replace(size_t __p, const const_iterator& __i,
+ const const_iterator& __j)
+ { replace(__p, 1, __i, __j); }
+
+ void
+ replace(size_t __p, const iterator& __i,
+ const iterator& __j)
+ { replace(__p, 1, __i, __j); }
+
+ // Erase, (position, size) variant.
+ void
+ erase(size_t __p, size_t __n)
+ {
+ _RopeRep* __result = replace(this->_M_tree_ptr, __p,
+ __p + __n, 0);
+ _S_unref(this->_M_tree_ptr);
+ this->_M_tree_ptr = __result;
+ }
+
+ // Erase, single character
+ void
+ erase(size_t __p)
+ { erase(__p, __p + 1); }
+
+ // Insert, iterator variants.
+ iterator
+ insert(const iterator& __p, const rope& __r)
+ {
+ insert(__p.index(), __r);
+ return __p;
+ }
+
+ iterator
+ insert(const iterator& __p, size_t __n, _CharT __c)
+ {
+ insert(__p.index(), __n, __c);
+ return __p;
+ }
+
+ iterator insert(const iterator& __p, _CharT __c)
+ {
+ insert(__p.index(), __c);
+ return __p;
+ }
+
+ iterator
+ insert(const iterator& __p )
+ {
+ insert(__p.index());
+ return __p;
+ }
+
+ iterator
+ insert(const iterator& __p, const _CharT* c_string)
+ {
+ insert(__p.index(), c_string);
+ return __p;
+ }
+
+ iterator
+ insert(const iterator& __p, const _CharT* __i, size_t __n)
+ {
+ insert(__p.index(), __i, __n);
+ return __p;
+ }
+
+ iterator
+ insert(const iterator& __p, const _CharT* __i,
+ const _CharT* __j)
+ {
+ insert(__p.index(), __i, __j);
+ return __p;
+ }
+
+ iterator
+ insert(const iterator& __p,
+ const const_iterator& __i, const const_iterator& __j)
+ {
+ insert(__p.index(), __i, __j);
+ return __p;
+ }
+
+ iterator
+ insert(const iterator& __p,
+ const iterator& __i, const iterator& __j)
+ {
+ insert(__p.index(), __i, __j);
+ return __p;
+ }
+
+ // Replace, range variants.
+ void
+ replace(const iterator& __p, const iterator& __q, const rope& __r)
+ { replace(__p.index(), __q.index() - __p.index(), __r); }
+
+ void
+ replace(const iterator& __p, const iterator& __q, _CharT __c)
+ { replace(__p.index(), __q.index() - __p.index(), __c); }
+
+ void
+ replace(const iterator& __p, const iterator& __q,
+ const _CharT* __c_string)
+ { replace(__p.index(), __q.index() - __p.index(), __c_string); }
+
+ void
+ replace(const iterator& __p, const iterator& __q,
+ const _CharT* __i, size_t __n)
+ { replace(__p.index(), __q.index() - __p.index(), __i, __n); }
+
+ void
+ replace(const iterator& __p, const iterator& __q,
+ const _CharT* __i, const _CharT* __j)
+ { replace(__p.index(), __q.index() - __p.index(), __i, __j); }
+
+ void
+ replace(const iterator& __p, const iterator& __q,
+ const const_iterator& __i, const const_iterator& __j)
+ { replace(__p.index(), __q.index() - __p.index(), __i, __j); }
+
+ void
+ replace(const iterator& __p, const iterator& __q,
+ const iterator& __i, const iterator& __j)
+ { replace(__p.index(), __q.index() - __p.index(), __i, __j); }
+
+ // Replace, iterator variants.
+ void
+ replace(const iterator& __p, const rope& __r)
+ { replace(__p.index(), __r); }
+
+ void
+ replace(const iterator& __p, _CharT __c)
+ { replace(__p.index(), __c); }
+
+ void
+ replace(const iterator& __p, const _CharT* __c_string)
+ { replace(__p.index(), __c_string); }
+
+ void
+ replace(const iterator& __p, const _CharT* __i, size_t __n)
+ { replace(__p.index(), __i, __n); }
+
+ void
+ replace(const iterator& __p, const _CharT* __i, const _CharT* __j)
+ { replace(__p.index(), __i, __j); }
+
+ void
+ replace(const iterator& __p, const_iterator __i, const_iterator __j)
+ { replace(__p.index(), __i, __j); }
+
+ void
+ replace(const iterator& __p, iterator __i, iterator __j)
+ { replace(__p.index(), __i, __j); }
+
+ // Iterator and range variants of erase
+ iterator
+ erase(const iterator& __p, const iterator& __q)
+ {
+ size_t __p_index = __p.index();
+ erase(__p_index, __q.index() - __p_index);
+ return iterator(this, __p_index);
+ }
+
+ iterator
+ erase(const iterator& __p)
+ {
+ size_t __p_index = __p.index();
+ erase(__p_index, 1);
+ return iterator(this, __p_index);
+ }
+
+ rope
+ substr(size_t __start, size_t __len = 1) const
+ {
+ return rope<_CharT, _Alloc>(_S_substring(this->_M_tree_ptr,
+ __start,
+ __start + __len));
+ }
+
+ rope
+ substr(iterator __start, iterator __end) const
+ {
+ return rope<_CharT, _Alloc>(_S_substring(this->_M_tree_ptr,
+ __start.index(),
+ __end.index()));
+ }
+
+ rope
+ substr(iterator __start) const
+ {
+ size_t __pos = __start.index();
+ return rope<_CharT, _Alloc>(_S_substring(this->_M_tree_ptr,
+ __pos, __pos + 1));
+ }
+
+ rope
+ substr(const_iterator __start, const_iterator __end) const
+ {
+ // This might eventually take advantage of the cache in the
+ // iterator.
+ return rope<_CharT, _Alloc>(_S_substring(this->_M_tree_ptr,
+ __start.index(),
+ __end.index()));
+ }
+
+ rope<_CharT, _Alloc>
+ substr(const_iterator __start)
+ {
+ size_t __pos = __start.index();
+ return rope<_CharT, _Alloc>(_S_substring(this->_M_tree_ptr,
+ __pos, __pos + 1));
+ }
+
+ static const size_type npos;
+
+ size_type find(_CharT __c, size_type __pos = 0) const;
+
+ size_type
+ find(const _CharT* __s, size_type __pos = 0) const
+ {
+ size_type __result_pos;
+ const_iterator __result =
+ std::search(const_begin() + __pos, const_end(),
+ __s, __s + _S_char_ptr_len(__s));
+ __result_pos = __result.index();
+#ifndef __STL_OLD_ROPE_SEMANTICS
+ if (__result_pos == size())
+ __result_pos = npos;
+#endif
+ return __result_pos;
+ }
+
+ iterator
+ mutable_begin()
+ { return(iterator(this, 0)); }
+
+ iterator
+ mutable_end()
+ { return(iterator(this, size())); }
+
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+
+ reverse_iterator
+ mutable_rbegin()
+ { return reverse_iterator(mutable_end()); }
+
+ reverse_iterator
+ mutable_rend()
+ { return reverse_iterator(mutable_begin()); }
+
+ reference
+ mutable_reference_at(size_type __pos)
+ { return reference(this, __pos); }
+
+#ifdef __STD_STUFF
+ reference
+ operator[] (size_type __pos)
+ { return _char_ref_proxy(this, __pos); }
+
+ reference
+ at(size_type __pos)
+ {
+ // if (__pos >= size()) throw out_of_range; // XXX
+ return (*this)[__pos];
+ }
+
+ void resize(size_type __n, _CharT __c) { }
+ void resize(size_type __n) { }
+ void reserve(size_type __res_arg = 0) { }
+
+ size_type
+ capacity() const
+ { return max_size(); }
+
+ // Stuff below this line is dangerous because it's error prone.
+ // I would really like to get rid of it.
+ // copy function with funny arg ordering.
+ size_type
+ copy(_CharT* __buffer, size_type __n,
+ size_type __pos = 0) const
+ { return copy(__pos, __n, __buffer); }
+
+ iterator
+ end()
+ { return mutable_end(); }
+
+ iterator
+ begin()
+ { return mutable_begin(); }
+
+ reverse_iterator
+ rend()
+ { return mutable_rend(); }
+
+ reverse_iterator
+ rbegin()
+ { return mutable_rbegin(); }
+
+#else
+ const_iterator
+ end()
+ { return const_end(); }
+
+ const_iterator
+ begin()
+ { return const_begin(); }
+
+ const_reverse_iterator
+ rend()
+ { return const_rend(); }
+
+ const_reverse_iterator
+ rbegin()
+ { return const_rbegin(); }
+
+#endif
+ };
+
+ template <class _CharT, class _Alloc>
+ const typename rope<_CharT, _Alloc>::size_type
+ rope<_CharT, _Alloc>::npos = (size_type)(-1);
+
+ template <class _CharT, class _Alloc>
+ inline bool operator==(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ const _Rope_const_iterator<_CharT, _Alloc>& __y)
+ { return (__x._M_current_pos == __y._M_current_pos
+ && __x._M_root == __y._M_root); }
+
+ template <class _CharT, class _Alloc>
+ inline bool operator<(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ const _Rope_const_iterator<_CharT, _Alloc>& __y)
+ { return (__x._M_current_pos < __y._M_current_pos); }
+
+ template <class _CharT, class _Alloc>
+ inline bool operator!=(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ const _Rope_const_iterator<_CharT, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ template <class _CharT, class _Alloc>
+ inline bool operator>(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ const _Rope_const_iterator<_CharT, _Alloc>& __y)
+ { return __y < __x; }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator<=(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ const _Rope_const_iterator<_CharT, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator>=(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ const _Rope_const_iterator<_CharT, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ template <class _CharT, class _Alloc>
+ inline ptrdiff_t
+ operator-(const _Rope_const_iterator<_CharT, _Alloc>& __x,
+ const _Rope_const_iterator<_CharT, _Alloc>& __y)
+ { return (ptrdiff_t)__x._M_current_pos - (ptrdiff_t)__y._M_current_pos; }
+
+ template <class _CharT, class _Alloc>
+ inline _Rope_const_iterator<_CharT, _Alloc>
+ operator-(const _Rope_const_iterator<_CharT, _Alloc>& __x, ptrdiff_t __n)
+ { return _Rope_const_iterator<_CharT, _Alloc>(__x._M_root,
+ __x._M_current_pos - __n); }
+
+ template <class _CharT, class _Alloc>
+ inline _Rope_const_iterator<_CharT, _Alloc>
+ operator+(const _Rope_const_iterator<_CharT, _Alloc>& __x, ptrdiff_t __n)
+ { return _Rope_const_iterator<_CharT, _Alloc>(__x._M_root,
+ __x._M_current_pos + __n); }
+
+ template <class _CharT, class _Alloc>
+ inline _Rope_const_iterator<_CharT, _Alloc>
+ operator+(ptrdiff_t __n, const _Rope_const_iterator<_CharT, _Alloc>& __x)
+ { return _Rope_const_iterator<_CharT, _Alloc>(__x._M_root,
+ __x._M_current_pos + __n); }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator==(const _Rope_iterator<_CharT, _Alloc>& __x,
+ const _Rope_iterator<_CharT, _Alloc>& __y)
+ {return (__x._M_current_pos == __y._M_current_pos
+ && __x._M_root_rope == __y._M_root_rope); }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator<(const _Rope_iterator<_CharT, _Alloc>& __x,
+ const _Rope_iterator<_CharT, _Alloc>& __y)
+ { return (__x._M_current_pos < __y._M_current_pos); }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator!=(const _Rope_iterator<_CharT, _Alloc>& __x,
+ const _Rope_iterator<_CharT, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator>(const _Rope_iterator<_CharT, _Alloc>& __x,
+ const _Rope_iterator<_CharT, _Alloc>& __y)
+ { return __y < __x; }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator<=(const _Rope_iterator<_CharT, _Alloc>& __x,
+ const _Rope_iterator<_CharT, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator>=(const _Rope_iterator<_CharT, _Alloc>& __x,
+ const _Rope_iterator<_CharT, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ template <class _CharT, class _Alloc>
+ inline ptrdiff_t
+ operator-(const _Rope_iterator<_CharT, _Alloc>& __x,
+ const _Rope_iterator<_CharT, _Alloc>& __y)
+ { return ((ptrdiff_t)__x._M_current_pos
+ - (ptrdiff_t)__y._M_current_pos); }
+
+ template <class _CharT, class _Alloc>
+ inline _Rope_iterator<_CharT, _Alloc>
+ operator-(const _Rope_iterator<_CharT, _Alloc>& __x,
+ ptrdiff_t __n)
+ { return _Rope_iterator<_CharT, _Alloc>(__x._M_root_rope,
+ __x._M_current_pos - __n); }
+
+ template <class _CharT, class _Alloc>
+ inline _Rope_iterator<_CharT, _Alloc>
+ operator+(const _Rope_iterator<_CharT, _Alloc>& __x, ptrdiff_t __n)
+ { return _Rope_iterator<_CharT, _Alloc>(__x._M_root_rope,
+ __x._M_current_pos + __n); }
+
+ template <class _CharT, class _Alloc>
+ inline _Rope_iterator<_CharT, _Alloc>
+ operator+(ptrdiff_t __n, const _Rope_iterator<_CharT, _Alloc>& __x)
+ { return _Rope_iterator<_CharT, _Alloc>(__x._M_root_rope,
+ __x._M_current_pos + __n); }
+
+ template <class _CharT, class _Alloc>
+ inline rope<_CharT, _Alloc>
+ operator+(const rope<_CharT, _Alloc>& __left,
+ const rope<_CharT, _Alloc>& __right)
+ {
+ // Inlining this should make it possible to keep __left and
+ // __right in registers.
+ typedef rope<_CharT, _Alloc> rope_type;
+ return rope_type(rope_type::_S_concat(__left._M_tree_ptr,
+ __right._M_tree_ptr));
+ }
+
+ template <class _CharT, class _Alloc>
+ inline rope<_CharT, _Alloc>&
+ operator+=(rope<_CharT, _Alloc>& __left,
+ const rope<_CharT, _Alloc>& __right)
+ {
+ __left.append(__right);
+ return __left;
+ }
+
+ template <class _CharT, class _Alloc>
+ inline rope<_CharT, _Alloc>
+ operator+(const rope<_CharT, _Alloc>& __left,
+ const _CharT* __right)
+ {
+ typedef rope<_CharT, _Alloc> rope_type;
+ size_t __rlen = rope_type::_S_char_ptr_len(__right);
+ return rope_type(rope_type::_S_concat_char_iter(__left._M_tree_ptr,
+ __right, __rlen));
+ }
+
+ template <class _CharT, class _Alloc>
+ inline rope<_CharT, _Alloc>&
+ operator+=(rope<_CharT, _Alloc>& __left,
+ const _CharT* __right)
+ {
+ __left.append(__right);
+ return __left;
+ }
+
+ template <class _CharT, class _Alloc>
+ inline rope<_CharT, _Alloc>
+ operator+(const rope<_CharT, _Alloc>& __left, _CharT __right)
+ {
+ typedef rope<_CharT, _Alloc> rope_type;
+ return rope_type(rope_type::_S_concat_char_iter(__left._M_tree_ptr,
+ &__right, 1));
+ }
+
+ template <class _CharT, class _Alloc>
+ inline rope<_CharT, _Alloc>&
+ operator+=(rope<_CharT, _Alloc>& __left, _CharT __right)
+ {
+ __left.append(__right);
+ return __left;
+ }
+
+ template <class _CharT, class _Alloc>
+ bool
+ operator<(const rope<_CharT, _Alloc>& __left,
+ const rope<_CharT, _Alloc>& __right)
+ { return __left.compare(__right) < 0; }
+
+ template <class _CharT, class _Alloc>
+ bool
+ operator==(const rope<_CharT, _Alloc>& __left,
+ const rope<_CharT, _Alloc>& __right)
+ { return __left.compare(__right) == 0; }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator==(const _Rope_char_ptr_proxy<_CharT, _Alloc>& __x,
+ const _Rope_char_ptr_proxy<_CharT, _Alloc>& __y)
+ { return (__x._M_pos == __y._M_pos && __x._M_root == __y._M_root); }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator!=(const rope<_CharT, _Alloc>& __x,
+ const rope<_CharT, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator>(const rope<_CharT, _Alloc>& __x,
+ const rope<_CharT, _Alloc>& __y)
+ { return __y < __x; }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator<=(const rope<_CharT, _Alloc>& __x,
+ const rope<_CharT, _Alloc>& __y)
+ { return !(__y < __x); }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator>=(const rope<_CharT, _Alloc>& __x,
+ const rope<_CharT, _Alloc>& __y)
+ { return !(__x < __y); }
+
+ template <class _CharT, class _Alloc>
+ inline bool
+ operator!=(const _Rope_char_ptr_proxy<_CharT, _Alloc>& __x,
+ const _Rope_char_ptr_proxy<_CharT, _Alloc>& __y)
+ { return !(__x == __y); }
+
+ template<class _CharT, class _Traits, class _Alloc>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __o,
+ const rope<_CharT, _Alloc>& __r);
+
+ typedef rope<char> crope;
+ typedef rope<wchar_t> wrope;
+
+ inline crope::reference
+ __mutable_reference_at(crope& __c, size_t __i)
+ { return __c.mutable_reference_at(__i); }
+
+ inline wrope::reference
+ __mutable_reference_at(wrope& __c, size_t __i)
+ { return __c.mutable_reference_at(__i); }
+
+ template <class _CharT, class _Alloc>
+ inline void
+ swap(rope<_CharT, _Alloc>& __x, rope<_CharT, _Alloc>& __y)
+ { __x.swap(__y); }
+
+_GLIBCXX_END_NAMESPACE
+
+
+namespace std
+{
+namespace tr1
+{
+ template<>
+ struct hash<__gnu_cxx::crope>
+ {
+ size_t
+ operator()(const __gnu_cxx::crope& __str) const
+ {
+ size_t __size = __str.size();
+ if (0 == __size)
+ return 0;
+ return 13 * __str[0] + 5 * __str[__size - 1] + __size;
+ }
+ };
+
+
+ template<>
+ struct hash<__gnu_cxx::wrope>
+ {
+ size_t
+ operator()(const __gnu_cxx::wrope& __str) const
+ {
+ size_t __size = __str.size();
+ if (0 == __size)
+ return 0;
+ return 13 * __str[0] + 5 * __str[__size - 1] + __size;
+ }
+ };
+} // namespace tr1
+} // namespace std
+
+# include <ext/ropeimpl.h>
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/ropeimpl.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/ropeimpl.h
new file mode 100644
index 0000000..e79bca4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/ropeimpl.h
@@ -0,0 +1,1701 @@
+// SGI's rope class implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file ropeimpl.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#include <cstdio>
+#include <ostream>
+#include <bits/functexcept.h>
+
+#include <ext/algorithm> // For copy_n and lexicographical_compare_3way
+#include <ext/memory> // For uninitialized_copy_n
+#include <ext/numeric> // For power
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+ using std::printf;
+ using std::basic_ostream;
+ using std::__throw_length_error;
+ using std::_Destroy;
+ using std::uninitialized_fill_n;
+
+ // Set buf_start, buf_end, and buf_ptr appropriately, filling tmp_buf
+ // if necessary. Assumes _M_path_end[leaf_index] and leaf_pos are correct.
+ // Results in a valid buf_ptr if the iterator can be legitimately
+ // dereferenced.
+ template <class _CharT, class _Alloc>
+ void
+ _Rope_iterator_base<_CharT, _Alloc>::
+ _S_setbuf(_Rope_iterator_base<_CharT, _Alloc>& __x)
+ {
+ const _RopeRep* __leaf = __x._M_path_end[__x._M_leaf_index];
+ size_t __leaf_pos = __x._M_leaf_pos;
+ size_t __pos = __x._M_current_pos;
+
+ switch(__leaf->_M_tag)
+ {
+ case __detail::_S_leaf:
+ __x._M_buf_start = ((_Rope_RopeLeaf<_CharT, _Alloc>*)__leaf)->_M_data;
+ __x._M_buf_ptr = __x._M_buf_start + (__pos - __leaf_pos);
+ __x._M_buf_end = __x._M_buf_start + __leaf->_M_size;
+ break;
+ case __detail::_S_function:
+ case __detail::_S_substringfn:
+ {
+ size_t __len = _S_iterator_buf_len;
+ size_t __buf_start_pos = __leaf_pos;
+ size_t __leaf_end = __leaf_pos + __leaf->_M_size;
+ char_producer<_CharT>* __fn = ((_Rope_RopeFunction<_CharT,
+ _Alloc>*)__leaf)->_M_fn;
+ if (__buf_start_pos + __len <= __pos)
+ {
+ __buf_start_pos = __pos - __len / 4;
+ if (__buf_start_pos + __len > __leaf_end)
+ __buf_start_pos = __leaf_end - __len;
+ }
+ if (__buf_start_pos + __len > __leaf_end)
+ __len = __leaf_end - __buf_start_pos;
+ (*__fn)(__buf_start_pos - __leaf_pos, __len, __x._M_tmp_buf);
+ __x._M_buf_ptr = __x._M_tmp_buf + (__pos - __buf_start_pos);
+ __x._M_buf_start = __x._M_tmp_buf;
+ __x._M_buf_end = __x._M_tmp_buf + __len;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ // Set path and buffer inside a rope iterator. We assume that
+ // pos and root are already set.
+ template <class _CharT, class _Alloc>
+ void
+ _Rope_iterator_base<_CharT, _Alloc>::
+ _S_setcache(_Rope_iterator_base<_CharT, _Alloc>& __x)
+ {
+ const _RopeRep* __path[int(__detail::_S_max_rope_depth) + 1];
+ const _RopeRep* __curr_rope;
+ int __curr_depth = -1; /* index into path */
+ size_t __curr_start_pos = 0;
+ size_t __pos = __x._M_current_pos;
+ unsigned char __dirns = 0; // Bit vector marking right turns in the path
+
+ if (__pos >= __x._M_root->_M_size)
+ {
+ __x._M_buf_ptr = 0;
+ return;
+ }
+ __curr_rope = __x._M_root;
+ if (0 != __curr_rope->_M_c_string)
+ {
+ /* Treat the root as a leaf. */
+ __x._M_buf_start = __curr_rope->_M_c_string;
+ __x._M_buf_end = __curr_rope->_M_c_string + __curr_rope->_M_size;
+ __x._M_buf_ptr = __curr_rope->_M_c_string + __pos;
+ __x._M_path_end[0] = __curr_rope;
+ __x._M_leaf_index = 0;
+ __x._M_leaf_pos = 0;
+ return;
+ }
+ for(;;)
+ {
+ ++__curr_depth;
+ __path[__curr_depth] = __curr_rope;
+ switch(__curr_rope->_M_tag)
+ {
+ case __detail::_S_leaf:
+ case __detail::_S_function:
+ case __detail::_S_substringfn:
+ __x._M_leaf_pos = __curr_start_pos;
+ goto done;
+ case __detail::_S_concat:
+ {
+ _Rope_RopeConcatenation<_CharT, _Alloc>* __c =
+ (_Rope_RopeConcatenation<_CharT, _Alloc>*)__curr_rope;
+ _RopeRep* __left = __c->_M_left;
+ size_t __left_len = __left->_M_size;
+
+ __dirns <<= 1;
+ if (__pos >= __curr_start_pos + __left_len)
+ {
+ __dirns |= 1;
+ __curr_rope = __c->_M_right;
+ __curr_start_pos += __left_len;
+ }
+ else
+ __curr_rope = __left;
+ }
+ break;
+ }
+ }
+ done:
+ // Copy last section of path into _M_path_end.
+ {
+ int __i = -1;
+ int __j = __curr_depth + 1 - int(_S_path_cache_len);
+
+ if (__j < 0) __j = 0;
+ while (__j <= __curr_depth)
+ __x._M_path_end[++__i] = __path[__j++];
+ __x._M_leaf_index = __i;
+ }
+ __x._M_path_directions = __dirns;
+ _S_setbuf(__x);
+ }
+
+ // Specialized version of the above. Assumes that
+ // the path cache is valid for the previous position.
+ template <class _CharT, class _Alloc>
+ void
+ _Rope_iterator_base<_CharT, _Alloc>::
+ _S_setcache_for_incr(_Rope_iterator_base<_CharT, _Alloc>& __x)
+ {
+ int __current_index = __x._M_leaf_index;
+ const _RopeRep* __current_node = __x._M_path_end[__current_index];
+ size_t __len = __current_node->_M_size;
+ size_t __node_start_pos = __x._M_leaf_pos;
+ unsigned char __dirns = __x._M_path_directions;
+ _Rope_RopeConcatenation<_CharT, _Alloc>* __c;
+
+ if (__x._M_current_pos - __node_start_pos < __len)
+ {
+ /* More stuff in this leaf, we just didn't cache it. */
+ _S_setbuf(__x);
+ return;
+ }
+ // node_start_pos is starting position of last_node.
+ while (--__current_index >= 0)
+ {
+ if (!(__dirns & 1) /* Path turned left */)
+ break;
+ __current_node = __x._M_path_end[__current_index];
+ __c = (_Rope_RopeConcatenation<_CharT, _Alloc>*)__current_node;
+ // Otherwise we were in the right child. Thus we should pop
+ // the concatenation node.
+ __node_start_pos -= __c->_M_left->_M_size;
+ __dirns >>= 1;
+ }
+ if (__current_index < 0)
+ {
+ // We underflowed the cache. Punt.
+ _S_setcache(__x);
+ return;
+ }
+ __current_node = __x._M_path_end[__current_index];
+ __c = (_Rope_RopeConcatenation<_CharT, _Alloc>*)__current_node;
+ // current_node is a concatenation node. We are positioned on the first
+ // character in its right child.
+ // node_start_pos is starting position of current_node.
+ __node_start_pos += __c->_M_left->_M_size;
+ __current_node = __c->_M_right;
+ __x._M_path_end[++__current_index] = __current_node;
+ __dirns |= 1;
+ while (__detail::_S_concat == __current_node->_M_tag)
+ {
+ ++__current_index;
+ if (int(_S_path_cache_len) == __current_index)
+ {
+ int __i;
+ for (__i = 0; __i < int(_S_path_cache_len) - 1; __i++)
+ __x._M_path_end[__i] = __x._M_path_end[__i+1];
+ --__current_index;
+ }
+ __current_node =
+ ((_Rope_RopeConcatenation<_CharT, _Alloc>*)__current_node)->_M_left;
+ __x._M_path_end[__current_index] = __current_node;
+ __dirns <<= 1;
+ // node_start_pos is unchanged.
+ }
+ __x._M_leaf_index = __current_index;
+ __x._M_leaf_pos = __node_start_pos;
+ __x._M_path_directions = __dirns;
+ _S_setbuf(__x);
+ }
+
+ template <class _CharT, class _Alloc>
+ void
+ _Rope_iterator_base<_CharT, _Alloc>::
+ _M_incr(size_t __n)
+ {
+ _M_current_pos += __n;
+ if (0 != _M_buf_ptr)
+ {
+ size_t __chars_left = _M_buf_end - _M_buf_ptr;
+ if (__chars_left > __n)
+ _M_buf_ptr += __n;
+ else if (__chars_left == __n)
+ {
+ _M_buf_ptr += __n;
+ _S_setcache_for_incr(*this);
+ }
+ else
+ _M_buf_ptr = 0;
+ }
+ }
+
+ template <class _CharT, class _Alloc>
+ void
+ _Rope_iterator_base<_CharT, _Alloc>::
+ _M_decr(size_t __n)
+ {
+ if (0 != _M_buf_ptr)
+ {
+ size_t __chars_left = _M_buf_ptr - _M_buf_start;
+ if (__chars_left >= __n)
+ _M_buf_ptr -= __n;
+ else
+ _M_buf_ptr = 0;
+ }
+ _M_current_pos -= __n;
+ }
+
+ template <class _CharT, class _Alloc>
+ void
+ _Rope_iterator<_CharT, _Alloc>::
+ _M_check()
+ {
+ if (_M_root_rope->_M_tree_ptr != this->_M_root)
+ {
+ // _Rope was modified. Get things fixed up.
+ _RopeRep::_S_unref(this->_M_root);
+ this->_M_root = _M_root_rope->_M_tree_ptr;
+ _RopeRep::_S_ref(this->_M_root);
+ this->_M_buf_ptr = 0;
+ }
+ }
+
+ template <class _CharT, class _Alloc>
+ inline
+ _Rope_const_iterator<_CharT, _Alloc>::
+ _Rope_const_iterator(const _Rope_iterator<_CharT, _Alloc>& __x)
+ : _Rope_iterator_base<_CharT, _Alloc>(__x)
+ { }
+
+ template <class _CharT, class _Alloc>
+ inline
+ _Rope_iterator<_CharT, _Alloc>::
+ _Rope_iterator(rope<_CharT, _Alloc>& __r, size_t __pos)
+ : _Rope_iterator_base<_CharT,_Alloc>(__r._M_tree_ptr, __pos),
+ _M_root_rope(&__r)
+ { _RopeRep::_S_ref(this->_M_root); }
+
+ template <class _CharT, class _Alloc>
+ inline size_t
+ rope<_CharT, _Alloc>::
+ _S_char_ptr_len(const _CharT* __s)
+ {
+ const _CharT* __p = __s;
+
+ while (!_S_is0(*__p))
+ ++__p;
+ return (__p - __s);
+ }
+
+
+#ifndef __GC
+
+ template <class _CharT, class _Alloc>
+ inline void
+ _Rope_RopeRep<_CharT, _Alloc>::
+ _M_free_c_string()
+ {
+ _CharT* __cstr = _M_c_string;
+ if (0 != __cstr)
+ {
+ size_t __size = this->_M_size + 1;
+ _Destroy(__cstr, __cstr + __size, _M_get_allocator());
+ this->_Data_deallocate(__cstr, __size);
+ }
+ }
+
+ template <class _CharT, class _Alloc>
+ inline void
+ _Rope_RopeRep<_CharT, _Alloc>::
+ _S_free_string(_CharT* __s, size_t __n, allocator_type& __a)
+ {
+ if (!_S_is_basic_char_type((_CharT*)0))
+ _Destroy(__s, __s + __n, __a);
+
+ // This has to be a static member, so this gets a bit messy
+ __a.deallocate(__s,
+ _Rope_RopeLeaf<_CharT, _Alloc>::_S_rounded_up_size(__n));
+ }
+
+ // There are several reasons for not doing this with virtual destructors
+ // and a class specific delete operator:
+ // - A class specific delete operator can't easily get access to
+ // allocator instances if we need them.
+ // - Any virtual function would need a 4 or byte vtable pointer;
+ // this only requires a one byte tag per object.
+ template <class _CharT, class _Alloc>
+ void
+ _Rope_RopeRep<_CharT, _Alloc>::
+ _M_free_tree()
+ {
+ switch(_M_tag)
+ {
+ case __detail::_S_leaf:
+ {
+ _Rope_RopeLeaf<_CharT, _Alloc>* __l
+ = (_Rope_RopeLeaf<_CharT, _Alloc>*)this;
+ __l->_Rope_RopeLeaf<_CharT, _Alloc>::~_Rope_RopeLeaf();
+ _L_deallocate(__l, 1);
+ break;
+ }
+ case __detail::_S_concat:
+ {
+ _Rope_RopeConcatenation<_CharT,_Alloc>* __c
+ = (_Rope_RopeConcatenation<_CharT, _Alloc>*)this;
+ __c->_Rope_RopeConcatenation<_CharT, _Alloc>::
+ ~_Rope_RopeConcatenation();
+ _C_deallocate(__c, 1);
+ break;
+ }
+ case __detail::_S_function:
+ {
+ _Rope_RopeFunction<_CharT, _Alloc>* __f
+ = (_Rope_RopeFunction<_CharT, _Alloc>*)this;
+ __f->_Rope_RopeFunction<_CharT, _Alloc>::~_Rope_RopeFunction();
+ _F_deallocate(__f, 1);
+ break;
+ }
+ case __detail::_S_substringfn:
+ {
+ _Rope_RopeSubstring<_CharT, _Alloc>* __ss =
+ (_Rope_RopeSubstring<_CharT, _Alloc>*)this;
+ __ss->_Rope_RopeSubstring<_CharT, _Alloc>::
+ ~_Rope_RopeSubstring();
+ _S_deallocate(__ss, 1);
+ break;
+ }
+ }
+ }
+#else
+
+ template <class _CharT, class _Alloc>
+ inline void
+ _Rope_RopeRep<_CharT, _Alloc>::
+ _S_free_string(const _CharT*, size_t, allocator_type)
+ { }
+
+#endif
+
+ // Concatenate a C string onto a leaf rope by copying the rope data.
+ // Used for short ropes.
+ template <class _CharT, class _Alloc>
+ typename rope<_CharT, _Alloc>::_RopeLeaf*
+ rope<_CharT, _Alloc>::
+ _S_leaf_concat_char_iter(_RopeLeaf* __r, const _CharT* __iter, size_t __len)
+ {
+ size_t __old_len = __r->_M_size;
+ _CharT* __new_data = (_CharT*)
+ _Data_allocate(_S_rounded_up_size(__old_len + __len));
+ _RopeLeaf* __result;
+
+ uninitialized_copy_n(__r->_M_data, __old_len, __new_data);
+ uninitialized_copy_n(__iter, __len, __new_data + __old_len);
+ _S_cond_store_eos(__new_data[__old_len + __len]);
+ __try
+ {
+ __result = _S_new_RopeLeaf(__new_data, __old_len + __len,
+ __r->_M_get_allocator());
+ }
+ __catch(...)
+ {
+ _RopeRep::__STL_FREE_STRING(__new_data, __old_len + __len,
+ __r->_M_get_allocator());
+ __throw_exception_again;
+ }
+ return __result;
+ }
+
+#ifndef __GC
+ // As above, but it's OK to clobber original if refcount is 1
+ template <class _CharT, class _Alloc>
+ typename rope<_CharT,_Alloc>::_RopeLeaf*
+ rope<_CharT, _Alloc>::
+ _S_destr_leaf_concat_char_iter(_RopeLeaf* __r, const _CharT* __iter,
+ size_t __len)
+ {
+ if (__r->_M_ref_count > 1)
+ return _S_leaf_concat_char_iter(__r, __iter, __len);
+ size_t __old_len = __r->_M_size;
+ if (_S_allocated_capacity(__old_len) >= __old_len + __len)
+ {
+ // The space has been partially initialized for the standard
+ // character types. But that doesn't matter for those types.
+ uninitialized_copy_n(__iter, __len, __r->_M_data + __old_len);
+ if (_S_is_basic_char_type((_CharT*)0))
+ _S_cond_store_eos(__r->_M_data[__old_len + __len]);
+ else if (__r->_M_c_string != __r->_M_data && 0 != __r->_M_c_string)
+ {
+ __r->_M_free_c_string();
+ __r->_M_c_string = 0;
+ }
+ __r->_M_size = __old_len + __len;
+ __r->_M_ref_count = 2;
+ return __r;
+ }
+ else
+ {
+ _RopeLeaf* __result = _S_leaf_concat_char_iter(__r, __iter, __len);
+ return __result;
+ }
+ }
+#endif
+
+ // Assumes left and right are not 0.
+ // Does not increment (nor decrement on exception) child reference counts.
+ // Result has ref count 1.
+ template <class _CharT, class _Alloc>
+ typename rope<_CharT, _Alloc>::_RopeRep*
+ rope<_CharT, _Alloc>::
+ _S_tree_concat(_RopeRep* __left, _RopeRep* __right)
+ {
+ _RopeConcatenation* __result = _S_new_RopeConcatenation(__left, __right,
+ __left->
+ _M_get_allocator());
+ size_t __depth = __result->_M_depth;
+
+ if (__depth > 20
+ && (__result->_M_size < 1000
+ || __depth > size_t(__detail::_S_max_rope_depth)))
+ {
+ _RopeRep* __balanced;
+
+ __try
+ {
+ __balanced = _S_balance(__result);
+ __result->_M_unref_nonnil();
+ }
+ __catch(...)
+ {
+ _C_deallocate(__result,1);
+ __throw_exception_again;
+ }
+ // In case of exception, we need to deallocate
+ // otherwise dangling result node. But caller
+ // still owns its children. Thus unref is
+ // inappropriate.
+ return __balanced;
+ }
+ else
+ return __result;
+ }
+
+ template <class _CharT, class _Alloc>
+ typename rope<_CharT, _Alloc>::_RopeRep*
+ rope<_CharT, _Alloc>::
+ _S_concat_char_iter(_RopeRep* __r, const _CharT*__s, size_t __slen)
+ {
+ _RopeRep* __result;
+ if (0 == __slen)
+ {
+ _S_ref(__r);
+ return __r;
+ }
+ if (0 == __r)
+ return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen,
+ __r->_M_get_allocator());
+ if (__r->_M_tag == __detail::_S_leaf
+ && __r->_M_size + __slen <= size_t(_S_copy_max))
+ {
+ __result = _S_leaf_concat_char_iter((_RopeLeaf*)__r, __s, __slen);
+ return __result;
+ }
+ if (__detail::_S_concat == __r->_M_tag
+ && __detail::_S_leaf == ((_RopeConcatenation*) __r)->_M_right->_M_tag)
+ {
+ _RopeLeaf* __right =
+ (_RopeLeaf* )(((_RopeConcatenation* )__r)->_M_right);
+ if (__right->_M_size + __slen <= size_t(_S_copy_max))
+ {
+ _RopeRep* __left = ((_RopeConcatenation*)__r)->_M_left;
+ _RopeRep* __nright =
+ _S_leaf_concat_char_iter((_RopeLeaf*)__right, __s, __slen);
+ __left->_M_ref_nonnil();
+ __try
+ { __result = _S_tree_concat(__left, __nright); }
+ __catch(...)
+ {
+ _S_unref(__left);
+ _S_unref(__nright);
+ __throw_exception_again;
+ }
+ return __result;
+ }
+ }
+ _RopeRep* __nright =
+ __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, __r->_M_get_allocator());
+ __try
+ {
+ __r->_M_ref_nonnil();
+ __result = _S_tree_concat(__r, __nright);
+ }
+ __catch(...)
+ {
+ _S_unref(__r);
+ _S_unref(__nright);
+ __throw_exception_again;
+ }
+ return __result;
+ }
+
+#ifndef __GC
+ template <class _CharT, class _Alloc>
+ typename rope<_CharT,_Alloc>::_RopeRep*
+ rope<_CharT,_Alloc>::
+ _S_destr_concat_char_iter(_RopeRep* __r, const _CharT* __s, size_t __slen)
+ {
+ _RopeRep* __result;
+ if (0 == __r)
+ return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen,
+ __r->_M_get_allocator());
+ size_t __count = __r->_M_ref_count;
+ size_t __orig_size = __r->_M_size;
+ if (__count > 1)
+ return _S_concat_char_iter(__r, __s, __slen);
+ if (0 == __slen)
+ {
+ __r->_M_ref_count = 2; // One more than before
+ return __r;
+ }
+ if (__orig_size + __slen <= size_t(_S_copy_max)
+ && __detail::_S_leaf == __r->_M_tag)
+ {
+ __result = _S_destr_leaf_concat_char_iter((_RopeLeaf*)__r, __s,
+ __slen);
+ return __result;
+ }
+ if (__detail::_S_concat == __r->_M_tag)
+ {
+ _RopeLeaf* __right = (_RopeLeaf*)(((_RopeConcatenation*)
+ __r)->_M_right);
+ if (__detail::_S_leaf == __right->_M_tag
+ && __right->_M_size + __slen <= size_t(_S_copy_max))
+ {
+ _RopeRep* __new_right =
+ _S_destr_leaf_concat_char_iter(__right, __s, __slen);
+ if (__right == __new_right)
+ __new_right->_M_ref_count = 1;
+ else
+ __right->_M_unref_nonnil();
+ __r->_M_ref_count = 2; // One more than before.
+ ((_RopeConcatenation*)__r)->_M_right = __new_right;
+ __r->_M_size = __orig_size + __slen;
+ if (0 != __r->_M_c_string)
+ {
+ __r->_M_free_c_string();
+ __r->_M_c_string = 0;
+ }
+ return __r;
+ }
+ }
+ _RopeRep* __right =
+ __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, __r->_M_get_allocator());
+ __r->_M_ref_nonnil();
+ __try
+ { __result = _S_tree_concat(__r, __right); }
+ __catch(...)
+ {
+ _S_unref(__r);
+ _S_unref(__right);
+ __throw_exception_again;
+ }
+ return __result;
+ }
+#endif /* !__GC */
+
+ template <class _CharT, class _Alloc>
+ typename rope<_CharT, _Alloc>::_RopeRep*
+ rope<_CharT, _Alloc>::
+ _S_concat(_RopeRep* __left, _RopeRep* __right)
+ {
+ if (0 == __left)
+ {
+ _S_ref(__right);
+ return __right;
+ }
+ if (0 == __right)
+ {
+ __left->_M_ref_nonnil();
+ return __left;
+ }
+ if (__detail::_S_leaf == __right->_M_tag)
+ {
+ if (__detail::_S_leaf == __left->_M_tag)
+ {
+ if (__right->_M_size + __left->_M_size <= size_t(_S_copy_max))
+ return _S_leaf_concat_char_iter((_RopeLeaf*)__left,
+ ((_RopeLeaf*)__right)->_M_data,
+ __right->_M_size);
+ }
+ else if (__detail::_S_concat == __left->_M_tag
+ && __detail::_S_leaf == ((_RopeConcatenation*)
+ __left)->_M_right->_M_tag)
+ {
+ _RopeLeaf* __leftright =
+ (_RopeLeaf*)(((_RopeConcatenation*)__left)->_M_right);
+ if (__leftright->_M_size
+ + __right->_M_size <= size_t(_S_copy_max))
+ {
+ _RopeRep* __leftleft = ((_RopeConcatenation*)__left)->_M_left;
+ _RopeRep* __rest = _S_leaf_concat_char_iter(__leftright,
+ ((_RopeLeaf*)
+ __right)->
+ _M_data,
+ __right->_M_size);
+ __leftleft->_M_ref_nonnil();
+ __try
+ { return(_S_tree_concat(__leftleft, __rest)); }
+ __catch(...)
+ {
+ _S_unref(__leftleft);
+ _S_unref(__rest);
+ __throw_exception_again;
+ }
+ }
+ }
+ }
+ __left->_M_ref_nonnil();
+ __right->_M_ref_nonnil();
+ __try
+ { return(_S_tree_concat(__left, __right)); }
+ __catch(...)
+ {
+ _S_unref(__left);
+ _S_unref(__right);
+ __throw_exception_again;
+ }
+ }
+
+ template <class _CharT, class _Alloc>
+ typename rope<_CharT, _Alloc>::_RopeRep*
+ rope<_CharT, _Alloc>::
+ _S_substring(_RopeRep* __base, size_t __start, size_t __endp1)
+ {
+ if (0 == __base)
+ return 0;
+ size_t __len = __base->_M_size;
+ size_t __adj_endp1;
+ const size_t __lazy_threshold = 128;
+
+ if (__endp1 >= __len)
+ {
+ if (0 == __start)
+ {
+ __base->_M_ref_nonnil();
+ return __base;
+ }
+ else
+ __adj_endp1 = __len;
+
+ }
+ else
+ __adj_endp1 = __endp1;
+
+ switch(__base->_M_tag)
+ {
+ case __detail::_S_concat:
+ {
+ _RopeConcatenation* __c = (_RopeConcatenation*)__base;
+ _RopeRep* __left = __c->_M_left;
+ _RopeRep* __right = __c->_M_right;
+ size_t __left_len = __left->_M_size;
+ _RopeRep* __result;
+
+ if (__adj_endp1 <= __left_len)
+ return _S_substring(__left, __start, __endp1);
+ else if (__start >= __left_len)
+ return _S_substring(__right, __start - __left_len,
+ __adj_endp1 - __left_len);
+ _Self_destruct_ptr __left_result(_S_substring(__left,
+ __start,
+ __left_len));
+ _Self_destruct_ptr __right_result(_S_substring(__right, 0,
+ __endp1
+ - __left_len));
+ __result = _S_concat(__left_result, __right_result);
+ return __result;
+ }
+ case __detail::_S_leaf:
+ {
+ _RopeLeaf* __l = (_RopeLeaf*)__base;
+ _RopeLeaf* __result;
+ size_t __result_len;
+ if (__start >= __adj_endp1)
+ return 0;
+ __result_len = __adj_endp1 - __start;
+ if (__result_len > __lazy_threshold)
+ goto lazy;
+#ifdef __GC
+ const _CharT* __section = __l->_M_data + __start;
+ __result = _S_new_RopeLeaf(__section, __result_len,
+ __base->_M_get_allocator());
+ __result->_M_c_string = 0; // Not eos terminated.
+#else
+ // We should sometimes create substring node instead.
+ __result = __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__l->_M_data + __start,
+ __result_len,
+ __base->
+ _M_get_allocator());
+#endif
+ return __result;
+ }
+ case __detail::_S_substringfn:
+ // Avoid introducing multiple layers of substring nodes.
+ {
+ _RopeSubstring* __old = (_RopeSubstring*)__base;
+ size_t __result_len;
+ if (__start >= __adj_endp1)
+ return 0;
+ __result_len = __adj_endp1 - __start;
+ if (__result_len > __lazy_threshold)
+ {
+ _RopeSubstring* __result =
+ _S_new_RopeSubstring(__old->_M_base,
+ __start + __old->_M_start,
+ __adj_endp1 - __start,
+ __base->_M_get_allocator());
+ return __result;
+
+ } // *** else fall through: ***
+ }
+ case __detail::_S_function:
+ {
+ _RopeFunction* __f = (_RopeFunction*)__base;
+ _CharT* __section;
+ size_t __result_len;
+ if (__start >= __adj_endp1)
+ return 0;
+ __result_len = __adj_endp1 - __start;
+
+ if (__result_len > __lazy_threshold)
+ goto lazy;
+ __section = (_CharT*)
+ _Data_allocate(_S_rounded_up_size(__result_len));
+ __try
+ { (*(__f->_M_fn))(__start, __result_len, __section); }
+ __catch(...)
+ {
+ _RopeRep::__STL_FREE_STRING(__section, __result_len,
+ __base->_M_get_allocator());
+ __throw_exception_again;
+ }
+ _S_cond_store_eos(__section[__result_len]);
+ return _S_new_RopeLeaf(__section, __result_len,
+ __base->_M_get_allocator());
+ }
+ }
+ lazy:
+ {
+ // Create substring node.
+ return _S_new_RopeSubstring(__base, __start, __adj_endp1 - __start,
+ __base->_M_get_allocator());
+ }
+ }
+
+ template<class _CharT>
+ class _Rope_flatten_char_consumer
+ : public _Rope_char_consumer<_CharT>
+ {
+ private:
+ _CharT* _M_buf_ptr;
+ public:
+
+ _Rope_flatten_char_consumer(_CharT* __buffer)
+ { _M_buf_ptr = __buffer; };
+
+ ~_Rope_flatten_char_consumer() {}
+
+ bool
+ operator()(const _CharT* __leaf, size_t __n)
+ {
+ uninitialized_copy_n(__leaf, __n, _M_buf_ptr);
+ _M_buf_ptr += __n;
+ return true;
+ }
+ };
+
+ template<class _CharT>
+ class _Rope_find_char_char_consumer
+ : public _Rope_char_consumer<_CharT>
+ {
+ private:
+ _CharT _M_pattern;
+ public:
+ size_t _M_count; // Number of nonmatching characters
+
+ _Rope_find_char_char_consumer(_CharT __p)
+ : _M_pattern(__p), _M_count(0) {}
+
+ ~_Rope_find_char_char_consumer() {}
+
+ bool
+ operator()(const _CharT* __leaf, size_t __n)
+ {
+ size_t __i;
+ for (__i = 0; __i < __n; __i++)
+ {
+ if (__leaf[__i] == _M_pattern)
+ {
+ _M_count += __i;
+ return false;
+ }
+ }
+ _M_count += __n; return true;
+ }
+ };
+
+ template<class _CharT, class _Traits>
+ // Here _CharT is both the stream and rope character type.
+ class _Rope_insert_char_consumer
+ : public _Rope_char_consumer<_CharT>
+ {
+ private:
+ typedef basic_ostream<_CharT,_Traits> _Insert_ostream;
+ _Insert_ostream& _M_o;
+ public:
+ _Rope_insert_char_consumer(_Insert_ostream& __writer)
+ : _M_o(__writer) {};
+ ~_Rope_insert_char_consumer() { };
+ // Caller is presumed to own the ostream
+ bool operator() (const _CharT* __leaf, size_t __n);
+ // Returns true to continue traversal.
+ };
+
+ template<class _CharT, class _Traits>
+ bool
+ _Rope_insert_char_consumer<_CharT, _Traits>::
+ operator()(const _CharT* __leaf, size_t __n)
+ {
+ size_t __i;
+ // We assume that formatting is set up correctly for each element.
+ for (__i = 0; __i < __n; __i++)
+ _M_o.put(__leaf[__i]);
+ return true;
+ }
+
+ template <class _CharT, class _Alloc>
+ bool
+ rope<_CharT, _Alloc>::
+ _S_apply_to_pieces(_Rope_char_consumer<_CharT>& __c,
+ const _RopeRep* __r, size_t __begin, size_t __end)
+ {
+ if (0 == __r)
+ return true;
+ switch(__r->_M_tag)
+ {
+ case __detail::_S_concat:
+ {
+ _RopeConcatenation* __conc = (_RopeConcatenation*)__r;
+ _RopeRep* __left = __conc->_M_left;
+ size_t __left_len = __left->_M_size;
+ if (__begin < __left_len)
+ {
+ size_t __left_end = std::min(__left_len, __end);
+ if (!_S_apply_to_pieces(__c, __left, __begin, __left_end))
+ return false;
+ }
+ if (__end > __left_len)
+ {
+ _RopeRep* __right = __conc->_M_right;
+ size_t __right_start = std::max(__left_len, __begin);
+ if (!_S_apply_to_pieces(__c, __right,
+ __right_start - __left_len,
+ __end - __left_len))
+ return false;
+ }
+ }
+ return true;
+ case __detail::_S_leaf:
+ {
+ _RopeLeaf* __l = (_RopeLeaf*)__r;
+ return __c(__l->_M_data + __begin, __end - __begin);
+ }
+ case __detail::_S_function:
+ case __detail::_S_substringfn:
+ {
+ _RopeFunction* __f = (_RopeFunction*)__r;
+ size_t __len = __end - __begin;
+ bool __result;
+ _CharT* __buffer =
+ (_CharT*)_Alloc().allocate(__len * sizeof(_CharT));
+ __try
+ {
+ (*(__f->_M_fn))(__begin, __len, __buffer);
+ __result = __c(__buffer, __len);
+ _Alloc().deallocate(__buffer, __len * sizeof(_CharT));
+ }
+ __catch(...)
+ {
+ _Alloc().deallocate(__buffer, __len * sizeof(_CharT));
+ __throw_exception_again;
+ }
+ return __result;
+ }
+ default:
+ return false;
+ }
+ }
+
+ template<class _CharT, class _Traits>
+ inline void
+ _Rope_fill(basic_ostream<_CharT, _Traits>& __o, size_t __n)
+ {
+ char __f = __o.fill();
+ size_t __i;
+
+ for (__i = 0; __i < __n; __i++)
+ __o.put(__f);
+ }
+
+
+ template <class _CharT>
+ inline bool
+ _Rope_is_simple(_CharT*)
+ { return false; }
+
+ inline bool
+ _Rope_is_simple(char*)
+ { return true; }
+
+ inline bool
+ _Rope_is_simple(wchar_t*)
+ { return true; }
+
+ template<class _CharT, class _Traits, class _Alloc>
+ basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __o,
+ const rope<_CharT, _Alloc>& __r)
+ {
+ size_t __w = __o.width();
+ bool __left = bool(__o.flags() & std::ios::left);
+ size_t __pad_len;
+ size_t __rope_len = __r.size();
+ _Rope_insert_char_consumer<_CharT, _Traits> __c(__o);
+ bool __is_simple = _Rope_is_simple((_CharT*)0);
+
+ if (__rope_len < __w)
+ __pad_len = __w - __rope_len;
+ else
+ __pad_len = 0;
+
+ if (!__is_simple)
+ __o.width(__w / __rope_len);
+ __try
+ {
+ if (__is_simple && !__left && __pad_len > 0)
+ _Rope_fill(__o, __pad_len);
+ __r.apply_to_pieces(0, __r.size(), __c);
+ if (__is_simple && __left && __pad_len > 0)
+ _Rope_fill(__o, __pad_len);
+ if (!__is_simple)
+ __o.width(__w);
+ }
+ __catch(...)
+ {
+ if (!__is_simple)
+ __o.width(__w);
+ __throw_exception_again;
+ }
+ return __o;
+ }
+
+ template <class _CharT, class _Alloc>
+ _CharT*
+ rope<_CharT, _Alloc>::
+ _S_flatten(_RopeRep* __r, size_t __start, size_t __len,
+ _CharT* __buffer)
+ {
+ _Rope_flatten_char_consumer<_CharT> __c(__buffer);
+ _S_apply_to_pieces(__c, __r, __start, __start + __len);
+ return(__buffer + __len);
+ }
+
+ template <class _CharT, class _Alloc>
+ size_t
+ rope<_CharT, _Alloc>::
+ find(_CharT __pattern, size_t __start) const
+ {
+ _Rope_find_char_char_consumer<_CharT> __c(__pattern);
+ _S_apply_to_pieces(__c, this->_M_tree_ptr, __start, size());
+ size_type __result_pos = __start + __c._M_count;
+#ifndef __STL_OLD_ROPE_SEMANTICS
+ if (__result_pos == size())
+ __result_pos = npos;
+#endif
+ return __result_pos;
+ }
+
+ template <class _CharT, class _Alloc>
+ _CharT*
+ rope<_CharT, _Alloc>::
+ _S_flatten(_RopeRep* __r, _CharT* __buffer)
+ {
+ if (0 == __r)
+ return __buffer;
+ switch(__r->_M_tag)
+ {
+ case __detail::_S_concat:
+ {
+ _RopeConcatenation* __c = (_RopeConcatenation*)__r;
+ _RopeRep* __left = __c->_M_left;
+ _RopeRep* __right = __c->_M_right;
+ _CharT* __rest = _S_flatten(__left, __buffer);
+ return _S_flatten(__right, __rest);
+ }
+ case __detail::_S_leaf:
+ {
+ _RopeLeaf* __l = (_RopeLeaf*)__r;
+ return copy_n(__l->_M_data, __l->_M_size, __buffer).second;
+ }
+ case __detail::_S_function:
+ case __detail::_S_substringfn:
+ // We don't yet do anything with substring nodes.
+ // This needs to be fixed before ropefiles will work well.
+ {
+ _RopeFunction* __f = (_RopeFunction*)__r;
+ (*(__f->_M_fn))(0, __f->_M_size, __buffer);
+ return __buffer + __f->_M_size;
+ }
+ default:
+ return 0;
+ }
+ }
+
+ // This needs work for _CharT != char
+ template <class _CharT, class _Alloc>
+ void
+ rope<_CharT, _Alloc>::
+ _S_dump(_RopeRep* __r, int __indent)
+ {
+ for (int __i = 0; __i < __indent; __i++)
+ putchar(' ');
+ if (0 == __r)
+ {
+ printf("NULL\n");
+ return;
+ }
+ if (_S_concat == __r->_M_tag)
+ {
+ _RopeConcatenation* __c = (_RopeConcatenation*)__r;
+ _RopeRep* __left = __c->_M_left;
+ _RopeRep* __right = __c->_M_right;
+
+#ifdef __GC
+ printf("Concatenation %p (depth = %d, len = %ld, %s balanced)\n",
+ __r, __r->_M_depth, __r->_M_size,
+ __r->_M_is_balanced? "" : "not");
+#else
+ printf("Concatenation %p (rc = %ld, depth = %d, "
+ "len = %ld, %s balanced)\n",
+ __r, __r->_M_ref_count, __r->_M_depth, __r->_M_size,
+ __r->_M_is_balanced? "" : "not");
+#endif
+ _S_dump(__left, __indent + 2);
+ _S_dump(__right, __indent + 2);
+ return;
+ }
+ else
+ {
+ char* __kind;
+
+ switch (__r->_M_tag)
+ {
+ case __detail::_S_leaf:
+ __kind = "Leaf";
+ break;
+ case __detail::_S_function:
+ __kind = "Function";
+ break;
+ case __detail::_S_substringfn:
+ __kind = "Function representing substring";
+ break;
+ default:
+ __kind = "(corrupted kind field!)";
+ }
+#ifdef __GC
+ printf("%s %p (depth = %d, len = %ld) ",
+ __kind, __r, __r->_M_depth, __r->_M_size);
+#else
+ printf("%s %p (rc = %ld, depth = %d, len = %ld) ",
+ __kind, __r, __r->_M_ref_count, __r->_M_depth, __r->_M_size);
+#endif
+ if (_S_is_one_byte_char_type((_CharT*)0))
+ {
+ const int __max_len = 40;
+ _Self_destruct_ptr __prefix(_S_substring(__r, 0, __max_len));
+ _CharT __buffer[__max_len + 1];
+ bool __too_big = __r->_M_size > __prefix->_M_size;
+
+ _S_flatten(__prefix, __buffer);
+ __buffer[__prefix->_M_size] = _S_eos((_CharT*)0);
+ printf("%s%s\n", (char*)__buffer,
+ __too_big? "...\n" : "\n");
+ }
+ else
+ printf("\n");
+ }
+ }
+
+ template <class _CharT, class _Alloc>
+ const unsigned long
+ rope<_CharT, _Alloc>::
+ _S_min_len[int(__detail::_S_max_rope_depth) + 1] = {
+ /* 0 */1, /* 1 */2, /* 2 */3, /* 3 */5, /* 4 */8, /* 5 */13, /* 6 */21,
+ /* 7 */34, /* 8 */55, /* 9 */89, /* 10 */144, /* 11 */233, /* 12 */377,
+ /* 13 */610, /* 14 */987, /* 15 */1597, /* 16 */2584, /* 17 */4181,
+ /* 18 */6765, /* 19 */10946, /* 20 */17711, /* 21 */28657, /* 22 */46368,
+ /* 23 */75025, /* 24 */121393, /* 25 */196418, /* 26 */317811,
+ /* 27 */514229, /* 28 */832040, /* 29 */1346269, /* 30 */2178309,
+ /* 31 */3524578, /* 32 */5702887, /* 33 */9227465, /* 34 */14930352,
+ /* 35 */24157817, /* 36 */39088169, /* 37 */63245986, /* 38 */102334155,
+ /* 39 */165580141, /* 40 */267914296, /* 41 */433494437,
+ /* 42 */701408733, /* 43 */1134903170, /* 44 */1836311903,
+ /* 45 */2971215073u };
+ // These are Fibonacci numbers < 2**32.
+
+ template <class _CharT, class _Alloc>
+ typename rope<_CharT, _Alloc>::_RopeRep*
+ rope<_CharT, _Alloc>::
+ _S_balance(_RopeRep* __r)
+ {
+ _RopeRep* __forest[int(__detail::_S_max_rope_depth) + 1];
+ _RopeRep* __result = 0;
+ int __i;
+ // Invariant:
+ // The concatenation of forest in descending order is equal to __r.
+ // __forest[__i]._M_size >= _S_min_len[__i]
+ // __forest[__i]._M_depth = __i
+ // References from forest are included in refcount.
+
+ for (__i = 0; __i <= int(__detail::_S_max_rope_depth); ++__i)
+ __forest[__i] = 0;
+ __try
+ {
+ _S_add_to_forest(__r, __forest);
+ for (__i = 0; __i <= int(__detail::_S_max_rope_depth); ++__i)
+ if (0 != __forest[__i])
+ {
+#ifndef __GC
+ _Self_destruct_ptr __old(__result);
+#endif
+ __result = _S_concat(__forest[__i], __result);
+ __forest[__i]->_M_unref_nonnil();
+#if !defined(__GC) && defined(__EXCEPTIONS)
+ __forest[__i] = 0;
+#endif
+ }
+ }
+ __catch(...)
+ {
+ for(__i = 0; __i <= int(__detail::_S_max_rope_depth); __i++)
+ _S_unref(__forest[__i]);
+ __throw_exception_again;
+ }
+
+ if (__result->_M_depth > int(__detail::_S_max_rope_depth))
+ __throw_length_error(__N("rope::_S_balance"));
+ return(__result);
+ }
+
+ template <class _CharT, class _Alloc>
+ void
+ rope<_CharT, _Alloc>::
+ _S_add_to_forest(_RopeRep* __r, _RopeRep** __forest)
+ {
+ if (__r->_M_is_balanced)
+ {
+ _S_add_leaf_to_forest(__r, __forest);
+ return;
+ }
+
+ {
+ _RopeConcatenation* __c = (_RopeConcatenation*)__r;
+
+ _S_add_to_forest(__c->_M_left, __forest);
+ _S_add_to_forest(__c->_M_right, __forest);
+ }
+ }
+
+
+ template <class _CharT, class _Alloc>
+ void
+ rope<_CharT, _Alloc>::
+ _S_add_leaf_to_forest(_RopeRep* __r, _RopeRep** __forest)
+ {
+ _RopeRep* __insertee; // included in refcount
+ _RopeRep* __too_tiny = 0; // included in refcount
+ int __i; // forest[0..__i-1] is empty
+ size_t __s = __r->_M_size;
+
+ for (__i = 0; __s >= _S_min_len[__i+1]/* not this bucket */; ++__i)
+ {
+ if (0 != __forest[__i])
+ {
+#ifndef __GC
+ _Self_destruct_ptr __old(__too_tiny);
+#endif
+ __too_tiny = _S_concat_and_set_balanced(__forest[__i],
+ __too_tiny);
+ __forest[__i]->_M_unref_nonnil();
+ __forest[__i] = 0;
+ }
+ }
+ {
+#ifndef __GC
+ _Self_destruct_ptr __old(__too_tiny);
+#endif
+ __insertee = _S_concat_and_set_balanced(__too_tiny, __r);
+ }
+ // Too_tiny dead, and no longer included in refcount.
+ // Insertee is live and included.
+ for (;; ++__i)
+ {
+ if (0 != __forest[__i])
+ {
+#ifndef __GC
+ _Self_destruct_ptr __old(__insertee);
+#endif
+ __insertee = _S_concat_and_set_balanced(__forest[__i],
+ __insertee);
+ __forest[__i]->_M_unref_nonnil();
+ __forest[__i] = 0;
+ }
+ if (__i == int(__detail::_S_max_rope_depth)
+ || __insertee->_M_size < _S_min_len[__i+1])
+ {
+ __forest[__i] = __insertee;
+ // refcount is OK since __insertee is now dead.
+ return;
+ }
+ }
+ }
+
+ template <class _CharT, class _Alloc>
+ _CharT
+ rope<_CharT, _Alloc>::
+ _S_fetch(_RopeRep* __r, size_type __i)
+ {
+ __GC_CONST _CharT* __cstr = __r->_M_c_string;
+
+ if (0 != __cstr)
+ return __cstr[__i];
+ for(;;)
+ {
+ switch(__r->_M_tag)
+ {
+ case __detail::_S_concat:
+ {
+ _RopeConcatenation* __c = (_RopeConcatenation*)__r;
+ _RopeRep* __left = __c->_M_left;
+ size_t __left_len = __left->_M_size;
+
+ if (__i >= __left_len)
+ {
+ __i -= __left_len;
+ __r = __c->_M_right;
+ }
+ else
+ __r = __left;
+ }
+ break;
+ case __detail::_S_leaf:
+ {
+ _RopeLeaf* __l = (_RopeLeaf*)__r;
+ return __l->_M_data[__i];
+ }
+ case __detail::_S_function:
+ case __detail::_S_substringfn:
+ {
+ _RopeFunction* __f = (_RopeFunction*)__r;
+ _CharT __result;
+
+ (*(__f->_M_fn))(__i, 1, &__result);
+ return __result;
+ }
+ }
+ }
+ }
+
+#ifndef __GC
+ // Return a uniquely referenced character slot for the given
+ // position, or 0 if that's not possible.
+ template <class _CharT, class _Alloc>
+ _CharT*
+ rope<_CharT, _Alloc>::
+ _S_fetch_ptr(_RopeRep* __r, size_type __i)
+ {
+ _RopeRep* __clrstack[__detail::_S_max_rope_depth];
+ size_t __csptr = 0;
+
+ for(;;)
+ {
+ if (__r->_M_ref_count > 1)
+ return 0;
+ switch(__r->_M_tag)
+ {
+ case __detail::_S_concat:
+ {
+ _RopeConcatenation* __c = (_RopeConcatenation*)__r;
+ _RopeRep* __left = __c->_M_left;
+ size_t __left_len = __left->_M_size;
+
+ if (__c->_M_c_string != 0)
+ __clrstack[__csptr++] = __c;
+ if (__i >= __left_len)
+ {
+ __i -= __left_len;
+ __r = __c->_M_right;
+ }
+ else
+ __r = __left;
+ }
+ break;
+ case __detail::_S_leaf:
+ {
+ _RopeLeaf* __l = (_RopeLeaf*)__r;
+ if (__l->_M_c_string != __l->_M_data && __l->_M_c_string != 0)
+ __clrstack[__csptr++] = __l;
+ while (__csptr > 0)
+ {
+ -- __csptr;
+ _RopeRep* __d = __clrstack[__csptr];
+ __d->_M_free_c_string();
+ __d->_M_c_string = 0;
+ }
+ return __l->_M_data + __i;
+ }
+ case __detail::_S_function:
+ case __detail::_S_substringfn:
+ return 0;
+ }
+ }
+ }
+#endif /* __GC */
+
+ // The following could be implemented trivially using
+ // lexicographical_compare_3way.
+ // We do a little more work to avoid dealing with rope iterators for
+ // flat strings.
+ template <class _CharT, class _Alloc>
+ int
+ rope<_CharT, _Alloc>::
+ _S_compare (const _RopeRep* __left, const _RopeRep* __right)
+ {
+ size_t __left_len;
+ size_t __right_len;
+
+ if (0 == __right)
+ return 0 != __left;
+ if (0 == __left)
+ return -1;
+ __left_len = __left->_M_size;
+ __right_len = __right->_M_size;
+ if (__detail::_S_leaf == __left->_M_tag)
+ {
+ _RopeLeaf* __l = (_RopeLeaf*) __left;
+ if (__detail::_S_leaf == __right->_M_tag)
+ {
+ _RopeLeaf* __r = (_RopeLeaf*) __right;
+ return lexicographical_compare_3way(__l->_M_data,
+ __l->_M_data + __left_len,
+ __r->_M_data, __r->_M_data
+ + __right_len);
+ }
+ else
+ {
+ const_iterator __rstart(__right, 0);
+ const_iterator __rend(__right, __right_len);
+ return lexicographical_compare_3way(__l->_M_data, __l->_M_data
+ + __left_len,
+ __rstart, __rend);
+ }
+ }
+ else
+ {
+ const_iterator __lstart(__left, 0);
+ const_iterator __lend(__left, __left_len);
+ if (__detail::_S_leaf == __right->_M_tag)
+ {
+ _RopeLeaf* __r = (_RopeLeaf*) __right;
+ return lexicographical_compare_3way(__lstart, __lend,
+ __r->_M_data, __r->_M_data
+ + __right_len);
+ }
+ else
+ {
+ const_iterator __rstart(__right, 0);
+ const_iterator __rend(__right, __right_len);
+ return lexicographical_compare_3way(__lstart, __lend,
+ __rstart, __rend);
+ }
+ }
+ }
+
+ // Assignment to reference proxies.
+ template <class _CharT, class _Alloc>
+ _Rope_char_ref_proxy<_CharT, _Alloc>&
+ _Rope_char_ref_proxy<_CharT, _Alloc>::
+ operator=(_CharT __c)
+ {
+ _RopeRep* __old = _M_root->_M_tree_ptr;
+#ifndef __GC
+ // First check for the case in which everything is uniquely
+ // referenced. In that case we can do this destructively.
+ _CharT* __ptr = _My_rope::_S_fetch_ptr(__old, _M_pos);
+ if (0 != __ptr)
+ {
+ *__ptr = __c;
+ return *this;
+ }
+#endif
+ _Self_destruct_ptr __left(_My_rope::_S_substring(__old, 0, _M_pos));
+ _Self_destruct_ptr __right(_My_rope::_S_substring(__old, _M_pos + 1,
+ __old->_M_size));
+ _Self_destruct_ptr __result_left(_My_rope::
+ _S_destr_concat_char_iter(__left,
+ &__c, 1));
+
+ _RopeRep* __result = _My_rope::_S_concat(__result_left, __right);
+#ifndef __GC
+ _RopeRep::_S_unref(__old);
+#endif
+ _M_root->_M_tree_ptr = __result;
+ return *this;
+ }
+
+ template <class _CharT, class _Alloc>
+ inline _Rope_char_ref_proxy<_CharT, _Alloc>::
+ operator _CharT() const
+ {
+ if (_M_current_valid)
+ return _M_current;
+ else
+ return _My_rope::_S_fetch(_M_root->_M_tree_ptr, _M_pos);
+ }
+
+ template <class _CharT, class _Alloc>
+ _Rope_char_ptr_proxy<_CharT, _Alloc>
+ _Rope_char_ref_proxy<_CharT, _Alloc>::
+ operator&() const
+ { return _Rope_char_ptr_proxy<_CharT, _Alloc>(*this); }
+
+ template <class _CharT, class _Alloc>
+ rope<_CharT, _Alloc>::
+ rope(size_t __n, _CharT __c, const allocator_type& __a)
+ : _Base(__a)
+ {
+ rope<_CharT,_Alloc> __result;
+ const size_t __exponentiate_threshold = 32;
+ size_t __exponent;
+ size_t __rest;
+ _CharT* __rest_buffer;
+ _RopeRep* __remainder;
+ rope<_CharT, _Alloc> __remainder_rope;
+
+ if (0 == __n)
+ return;
+
+ __exponent = __n / __exponentiate_threshold;
+ __rest = __n % __exponentiate_threshold;
+ if (0 == __rest)
+ __remainder = 0;
+ else
+ {
+ __rest_buffer = this->_Data_allocate(_S_rounded_up_size(__rest));
+ __uninitialized_fill_n_a(__rest_buffer, __rest, __c,
+ _M_get_allocator());
+ _S_cond_store_eos(__rest_buffer[__rest]);
+ __try
+ { __remainder = _S_new_RopeLeaf(__rest_buffer, __rest,
+ _M_get_allocator()); }
+ __catch(...)
+ {
+ _RopeRep::__STL_FREE_STRING(__rest_buffer, __rest,
+ _M_get_allocator());
+ __throw_exception_again;
+ }
+ }
+ __remainder_rope._M_tree_ptr = __remainder;
+ if (__exponent != 0)
+ {
+ _CharT* __base_buffer =
+ this->_Data_allocate(_S_rounded_up_size(__exponentiate_threshold));
+ _RopeLeaf* __base_leaf;
+ rope __base_rope;
+ __uninitialized_fill_n_a(__base_buffer, __exponentiate_threshold, __c,
+ _M_get_allocator());
+ _S_cond_store_eos(__base_buffer[__exponentiate_threshold]);
+ __try
+ {
+ __base_leaf = _S_new_RopeLeaf(__base_buffer,
+ __exponentiate_threshold,
+ _M_get_allocator());
+ }
+ __catch(...)
+ {
+ _RopeRep::__STL_FREE_STRING(__base_buffer,
+ __exponentiate_threshold,
+ _M_get_allocator());
+ __throw_exception_again;
+ }
+ __base_rope._M_tree_ptr = __base_leaf;
+ if (1 == __exponent)
+ __result = __base_rope;
+ else
+ __result = power(__base_rope, __exponent,
+ _Rope_Concat_fn<_CharT, _Alloc>());
+
+ if (0 != __remainder)
+ __result += __remainder_rope;
+ }
+ else
+ __result = __remainder_rope;
+
+ this->_M_tree_ptr = __result._M_tree_ptr;
+ this->_M_tree_ptr->_M_ref_nonnil();
+ }
+
+ template<class _CharT, class _Alloc>
+ _CharT
+ rope<_CharT, _Alloc>::_S_empty_c_str[1];
+
+ template<class _CharT, class _Alloc>
+ const _CharT*
+ rope<_CharT, _Alloc>::
+ c_str() const
+ {
+ if (0 == this->_M_tree_ptr)
+ {
+ _S_empty_c_str[0] = _S_eos((_CharT*)0); // Possibly redundant,
+ // but probably fast.
+ return _S_empty_c_str;
+ }
+ __gthread_mutex_lock (&this->_M_tree_ptr->_M_c_string_lock);
+ __GC_CONST _CharT* __result = this->_M_tree_ptr->_M_c_string;
+ if (0 == __result)
+ {
+ size_t __s = size();
+ __result = this->_Data_allocate(__s + 1);
+ _S_flatten(this->_M_tree_ptr, __result);
+ __result[__s] = _S_eos((_CharT*)0);
+ this->_M_tree_ptr->_M_c_string = __result;
+ }
+ __gthread_mutex_unlock (&this->_M_tree_ptr->_M_c_string_lock);
+ return(__result);
+ }
+
+ template<class _CharT, class _Alloc>
+ const _CharT* rope<_CharT, _Alloc>::
+ replace_with_c_str()
+ {
+ if (0 == this->_M_tree_ptr)
+ {
+ _S_empty_c_str[0] = _S_eos((_CharT*)0);
+ return _S_empty_c_str;
+ }
+ __GC_CONST _CharT* __old_c_string = this->_M_tree_ptr->_M_c_string;
+ if (__detail::_S_leaf == this->_M_tree_ptr->_M_tag
+ && 0 != __old_c_string)
+ return(__old_c_string);
+ size_t __s = size();
+ _CharT* __result = this->_Data_allocate(_S_rounded_up_size(__s));
+ _S_flatten(this->_M_tree_ptr, __result);
+ __result[__s] = _S_eos((_CharT*)0);
+ this->_M_tree_ptr->_M_unref_nonnil();
+ this->_M_tree_ptr = _S_new_RopeLeaf(__result, __s,
+ this->_M_get_allocator());
+ return(__result);
+ }
+
+ // Algorithm specializations. More should be added.
+
+ template<class _Rope_iterator> // was templated on CharT and Alloc
+ void // VC++ workaround
+ _Rope_rotate(_Rope_iterator __first,
+ _Rope_iterator __middle,
+ _Rope_iterator __last)
+ {
+ typedef typename _Rope_iterator::value_type _CharT;
+ typedef typename _Rope_iterator::_allocator_type _Alloc;
+
+ rope<_CharT, _Alloc>& __r(__first.container());
+ rope<_CharT, _Alloc> __prefix = __r.substr(0, __first.index());
+ rope<_CharT, _Alloc> __suffix =
+ __r.substr(__last.index(), __r.size() - __last.index());
+ rope<_CharT, _Alloc> __part1 =
+ __r.substr(__middle.index(), __last.index() - __middle.index());
+ rope<_CharT, _Alloc> __part2 =
+ __r.substr(__first.index(), __middle.index() - __first.index());
+ __r = __prefix;
+ __r += __part1;
+ __r += __part2;
+ __r += __suffix;
+ }
+
+#if !defined(__GNUC__)
+ // Appears to confuse g++
+ inline void
+ rotate(_Rope_iterator<char, __STL_DEFAULT_ALLOCATOR(char)> __first,
+ _Rope_iterator<char, __STL_DEFAULT_ALLOCATOR(char)> __middle,
+ _Rope_iterator<char, __STL_DEFAULT_ALLOCATOR(char)> __last)
+ { _Rope_rotate(__first, __middle, __last); }
+#endif
+
+# if 0
+ // Probably not useful for several reasons:
+ // - for SGIs 7.1 compiler and probably some others,
+ // this forces lots of rope<wchar_t, ...> instantiations, creating a
+ // code bloat and compile time problem. (Fixed in 7.2.)
+ // - wchar_t is 4 bytes wide on most UNIX platforms, making it
+ // unattractive for unicode strings. Unsigned short may be a better
+ // character type.
+ inline void
+ rotate(_Rope_iterator<wchar_t, __STL_DEFAULT_ALLOCATOR(char)> __first,
+ _Rope_iterator<wchar_t, __STL_DEFAULT_ALLOCATOR(char)> __middle,
+ _Rope_iterator<wchar_t, __STL_DEFAULT_ALLOCATOR(char)> __last)
+ { _Rope_rotate(__first, __middle, __last); }
+# endif
+
+_GLIBCXX_END_NAMESPACE
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/slist b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/slist
new file mode 100644
index 0000000..a34e36e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/slist
@@ -0,0 +1,1077 @@
+// Singly-linked list implementation -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2004, 2005, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file ext/slist
+ * This file is a GNU extension to the Standard C++ Library (possibly
+ * containing extensions from the HP/SGI STL subset).
+ */
+
+#ifndef _SLIST
+#define _SLIST 1
+
+#include <algorithm>
+#include <bits/allocator.h>
+#include <bits/stl_construct.h>
+#include <bits/stl_uninitialized.h>
+#include <bits/concept_check.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
+ using std::ptrdiff_t;
+ using std::_Construct;
+ using std::_Destroy;
+ using std::allocator;
+ using std::__true_type;
+ using std::__false_type;
+
+ struct _Slist_node_base
+ {
+ _Slist_node_base* _M_next;
+ };
+
+ inline _Slist_node_base*
+ __slist_make_link(_Slist_node_base* __prev_node,
+ _Slist_node_base* __new_node)
+ {
+ __new_node->_M_next = __prev_node->_M_next;
+ __prev_node->_M_next = __new_node;
+ return __new_node;
+ }
+
+ inline _Slist_node_base*
+ __slist_previous(_Slist_node_base* __head,
+ const _Slist_node_base* __node)
+ {
+ while (__head && __head->_M_next != __node)
+ __head = __head->_M_next;
+ return __head;
+ }
+
+ inline const _Slist_node_base*
+ __slist_previous(const _Slist_node_base* __head,
+ const _Slist_node_base* __node)
+ {
+ while (__head && __head->_M_next != __node)
+ __head = __head->_M_next;
+ return __head;
+ }
+
+ inline void
+ __slist_splice_after(_Slist_node_base* __pos,
+ _Slist_node_base* __before_first,
+ _Slist_node_base* __before_last)
+ {
+ if (__pos != __before_first && __pos != __before_last)
+ {
+ _Slist_node_base* __first = __before_first->_M_next;
+ _Slist_node_base* __after = __pos->_M_next;
+ __before_first->_M_next = __before_last->_M_next;
+ __pos->_M_next = __first;
+ __before_last->_M_next = __after;
+ }
+ }
+
+ inline void
+ __slist_splice_after(_Slist_node_base* __pos, _Slist_node_base* __head)
+ {
+ _Slist_node_base* __before_last = __slist_previous(__head, 0);
+ if (__before_last != __head)
+ {
+ _Slist_node_base* __after = __pos->_M_next;
+ __pos->_M_next = __head->_M_next;
+ __head->_M_next = 0;
+ __before_last->_M_next = __after;
+ }
+ }
+
+ inline _Slist_node_base*
+ __slist_reverse(_Slist_node_base* __node)
+ {
+ _Slist_node_base* __result = __node;
+ __node = __node->_M_next;
+ __result->_M_next = 0;
+ while(__node)
+ {
+ _Slist_node_base* __next = __node->_M_next;
+ __node->_M_next = __result;
+ __result = __node;
+ __node = __next;
+ }
+ return __result;
+ }
+
+ inline size_t
+ __slist_size(_Slist_node_base* __node)
+ {
+ size_t __result = 0;
+ for (; __node != 0; __node = __node->_M_next)
+ ++__result;
+ return __result;
+ }
+
+ template <class _Tp>
+ struct _Slist_node : public _Slist_node_base
+ {
+ _Tp _M_data;
+ };
+
+ struct _Slist_iterator_base
+ {
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef std::forward_iterator_tag iterator_category;
+
+ _Slist_node_base* _M_node;
+
+ _Slist_iterator_base(_Slist_node_base* __x)
+ : _M_node(__x) {}
+
+ void
+ _M_incr()
+ { _M_node = _M_node->_M_next; }
+
+ bool
+ operator==(const _Slist_iterator_base& __x) const
+ { return _M_node == __x._M_node; }
+
+ bool
+ operator!=(const _Slist_iterator_base& __x) const
+ { return _M_node != __x._M_node; }
+ };
+
+ template <class _Tp, class _Ref, class _Ptr>
+ struct _Slist_iterator : public _Slist_iterator_base
+ {
+ typedef _Slist_iterator<_Tp, _Tp&, _Tp*> iterator;
+ typedef _Slist_iterator<_Tp, const _Tp&, const _Tp*> const_iterator;
+ typedef _Slist_iterator<_Tp, _Ref, _Ptr> _Self;
+
+ typedef _Tp value_type;
+ typedef _Ptr pointer;
+ typedef _Ref reference;
+ typedef _Slist_node<_Tp> _Node;
+
+ explicit
+ _Slist_iterator(_Node* __x)
+ : _Slist_iterator_base(__x) {}
+
+ _Slist_iterator()
+ : _Slist_iterator_base(0) {}
+
+ _Slist_iterator(const iterator& __x)
+ : _Slist_iterator_base(__x._M_node) {}
+
+ reference
+ operator*() const
+ { return ((_Node*) _M_node)->_M_data; }
+
+ pointer
+ operator->() const
+ { return &(operator*()); }
+
+ _Self&
+ operator++()
+ {
+ _M_incr();
+ return *this;
+ }
+
+ _Self
+ operator++(int)
+ {
+ _Self __tmp = *this;
+ _M_incr();
+ return __tmp;
+ }
+ };
+
+ template <class _Tp, class _Alloc>
+ struct _Slist_base
+ : public _Alloc::template rebind<_Slist_node<_Tp> >::other
+ {
+ typedef typename _Alloc::template rebind<_Slist_node<_Tp> >::other
+ _Node_alloc;
+ typedef _Alloc allocator_type;
+
+ allocator_type
+ get_allocator() const
+ { return *static_cast<const _Node_alloc*>(this); }
+
+ _Slist_base(const allocator_type& __a)
+ : _Node_alloc(__a)
+ { this->_M_head._M_next = 0; }
+
+ ~_Slist_base()
+ { _M_erase_after(&this->_M_head, 0); }
+
+ protected:
+ _Slist_node_base _M_head;
+
+ _Slist_node<_Tp>*
+ _M_get_node()
+ { return _Node_alloc::allocate(1); }
+
+ void
+ _M_put_node(_Slist_node<_Tp>* __p)
+ { _Node_alloc::deallocate(__p, 1); }
+
+ protected:
+ _Slist_node_base* _M_erase_after(_Slist_node_base* __pos)
+ {
+ _Slist_node<_Tp>* __next = (_Slist_node<_Tp>*) (__pos->_M_next);
+ _Slist_node_base* __next_next = __next->_M_next;
+ __pos->_M_next = __next_next;
+ get_allocator().destroy(&__next->_M_data);
+ _M_put_node(__next);
+ return __next_next;
+ }
+ _Slist_node_base* _M_erase_after(_Slist_node_base*, _Slist_node_base*);
+ };
+
+ template <class _Tp, class _Alloc>
+ _Slist_node_base*
+ _Slist_base<_Tp,_Alloc>::_M_erase_after(_Slist_node_base* __before_first,
+ _Slist_node_base* __last_node)
+ {
+ _Slist_node<_Tp>* __cur = (_Slist_node<_Tp>*) (__before_first->_M_next);
+ while (__cur != __last_node)
+ {
+ _Slist_node<_Tp>* __tmp = __cur;
+ __cur = (_Slist_node<_Tp>*) __cur->_M_next;
+ get_allocator().destroy(&__tmp->_M_data);
+ _M_put_node(__tmp);
+ }
+ __before_first->_M_next = __last_node;
+ return __last_node;
+ }
+
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
+ template <class _Tp, class _Alloc = allocator<_Tp> >
+ class slist : private _Slist_base<_Tp,_Alloc>
+ {
+ // concept requirements
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+
+ private:
+ typedef _Slist_base<_Tp,_Alloc> _Base;
+
+ public:
+ typedef _Tp value_type;
+ typedef value_type* pointer;
+ typedef const value_type* const_pointer;
+ typedef value_type& reference;
+ typedef const value_type& const_reference;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+
+ typedef _Slist_iterator<_Tp, _Tp&, _Tp*> iterator;
+ typedef _Slist_iterator<_Tp, const _Tp&, const _Tp*> const_iterator;
+
+ typedef typename _Base::allocator_type allocator_type;
+
+ allocator_type
+ get_allocator() const
+ { return _Base::get_allocator(); }
+
+ private:
+ typedef _Slist_node<_Tp> _Node;
+ typedef _Slist_node_base _Node_base;
+ typedef _Slist_iterator_base _Iterator_base;
+
+ _Node*
+ _M_create_node(const value_type& __x)
+ {
+ _Node* __node = this->_M_get_node();
+ __try
+ {
+ get_allocator().construct(&__node->_M_data, __x);
+ __node->_M_next = 0;
+ }
+ __catch(...)
+ {
+ this->_M_put_node(__node);
+ __throw_exception_again;
+ }
+ return __node;
+ }
+
+ _Node*
+ _M_create_node()
+ {
+ _Node* __node = this->_M_get_node();
+ __try
+ {
+ get_allocator().construct(&__node->_M_data, value_type());
+ __node->_M_next = 0;
+ }
+ __catch(...)
+ {
+ this->_M_put_node(__node);
+ __throw_exception_again;
+ }
+ return __node;
+ }
+
+ public:
+ explicit
+ slist(const allocator_type& __a = allocator_type())
+ : _Base(__a) {}
+
+ slist(size_type __n, const value_type& __x,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ { _M_insert_after_fill(&this->_M_head, __n, __x); }
+
+ explicit
+ slist(size_type __n)
+ : _Base(allocator_type())
+ { _M_insert_after_fill(&this->_M_head, __n, value_type()); }
+
+ // We don't need any dispatching tricks here, because
+ // _M_insert_after_range already does them.
+ template <class _InputIterator>
+ slist(_InputIterator __first, _InputIterator __last,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ { _M_insert_after_range(&this->_M_head, __first, __last); }
+
+ slist(const slist& __x)
+ : _Base(__x.get_allocator())
+ { _M_insert_after_range(&this->_M_head, __x.begin(), __x.end()); }
+
+ slist&
+ operator= (const slist& __x);
+
+ ~slist() {}
+
+ public:
+ // assign(), a generalized assignment member function. Two
+ // versions: one that takes a count, and one that takes a range.
+ // The range version is a member template, so we dispatch on whether
+ // or not the type is an integer.
+
+ void
+ assign(size_type __n, const _Tp& __val)
+ { _M_fill_assign(__n, __val); }
+
+ void
+ _M_fill_assign(size_type __n, const _Tp& __val);
+
+ template <class _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ _M_assign_dispatch(__first, __last, _Integral());
+ }
+
+ template <class _Integer>
+ void
+ _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
+ { _M_fill_assign((size_type) __n, (_Tp) __val); }
+
+ template <class _InputIterator>
+ void
+ _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type);
+
+ public:
+
+ iterator
+ begin()
+ { return iterator((_Node*)this->_M_head._M_next); }
+
+ const_iterator
+ begin() const
+ { return const_iterator((_Node*)this->_M_head._M_next);}
+
+ iterator
+ end()
+ { return iterator(0); }
+
+ const_iterator
+ end() const
+ { return const_iterator(0); }
+
+ // Experimental new feature: before_begin() returns a
+ // non-dereferenceable iterator that, when incremented, yields
+ // begin(). This iterator may be used as the argument to
+ // insert_after, erase_after, etc. Note that even for an empty
+ // slist, before_begin() is not the same iterator as end(). It
+ // is always necessary to increment before_begin() at least once to
+ // obtain end().
+ iterator
+ before_begin()
+ { return iterator((_Node*) &this->_M_head); }
+
+ const_iterator
+ before_begin() const
+ { return const_iterator((_Node*) &this->_M_head); }
+
+ size_type
+ size() const
+ { return __slist_size(this->_M_head._M_next); }
+
+ size_type
+ max_size() const
+ { return size_type(-1); }
+
+ bool
+ empty() const
+ { return this->_M_head._M_next == 0; }
+
+ void
+ swap(slist& __x)
+ { std::swap(this->_M_head._M_next, __x._M_head._M_next); }
+
+ public:
+
+ reference
+ front()
+ { return ((_Node*) this->_M_head._M_next)->_M_data; }
+
+ const_reference
+ front() const
+ { return ((_Node*) this->_M_head._M_next)->_M_data; }
+
+ void
+ push_front(const value_type& __x)
+ { __slist_make_link(&this->_M_head, _M_create_node(__x)); }
+
+ void
+ push_front()
+ { __slist_make_link(&this->_M_head, _M_create_node()); }
+
+ void
+ pop_front()
+ {
+ _Node* __node = (_Node*) this->_M_head._M_next;
+ this->_M_head._M_next = __node->_M_next;
+ get_allocator().destroy(&__node->_M_data);
+ this->_M_put_node(__node);
+ }
+
+ iterator
+ previous(const_iterator __pos)
+ { return iterator((_Node*) __slist_previous(&this->_M_head,
+ __pos._M_node)); }
+
+ const_iterator
+ previous(const_iterator __pos) const
+ { return const_iterator((_Node*) __slist_previous(&this->_M_head,
+ __pos._M_node)); }
+
+ private:
+ _Node*
+ _M_insert_after(_Node_base* __pos, const value_type& __x)
+ { return (_Node*) (__slist_make_link(__pos, _M_create_node(__x))); }
+
+ _Node*
+ _M_insert_after(_Node_base* __pos)
+ { return (_Node*) (__slist_make_link(__pos, _M_create_node())); }
+
+ void
+ _M_insert_after_fill(_Node_base* __pos,
+ size_type __n, const value_type& __x)
+ {
+ for (size_type __i = 0; __i < __n; ++__i)
+ __pos = __slist_make_link(__pos, _M_create_node(__x));
+ }
+
+ // Check whether it's an integral type. If so, it's not an iterator.
+ template <class _InIterator>
+ void
+ _M_insert_after_range(_Node_base* __pos,
+ _InIterator __first, _InIterator __last)
+ {
+ typedef typename std::__is_integer<_InIterator>::__type _Integral;
+ _M_insert_after_range(__pos, __first, __last, _Integral());
+ }
+
+ template <class _Integer>
+ void
+ _M_insert_after_range(_Node_base* __pos, _Integer __n, _Integer __x,
+ __true_type)
+ { _M_insert_after_fill(__pos, __n, __x); }
+
+ template <class _InIterator>
+ void
+ _M_insert_after_range(_Node_base* __pos,
+ _InIterator __first, _InIterator __last,
+ __false_type)
+ {
+ while (__first != __last)
+ {
+ __pos = __slist_make_link(__pos, _M_create_node(*__first));
+ ++__first;
+ }
+ }
+
+ public:
+ iterator
+ insert_after(iterator __pos, const value_type& __x)
+ { return iterator(_M_insert_after(__pos._M_node, __x)); }
+
+ iterator
+ insert_after(iterator __pos)
+ { return insert_after(__pos, value_type()); }
+
+ void
+ insert_after(iterator __pos, size_type __n, const value_type& __x)
+ { _M_insert_after_fill(__pos._M_node, __n, __x); }
+
+ // We don't need any dispatching tricks here, because
+ // _M_insert_after_range already does them.
+ template <class _InIterator>
+ void
+ insert_after(iterator __pos, _InIterator __first, _InIterator __last)
+ { _M_insert_after_range(__pos._M_node, __first, __last); }
+
+ iterator
+ insert(iterator __pos, const value_type& __x)
+ { return iterator(_M_insert_after(__slist_previous(&this->_M_head,
+ __pos._M_node),
+ __x)); }
+
+ iterator
+ insert(iterator __pos)
+ { return iterator(_M_insert_after(__slist_previous(&this->_M_head,
+ __pos._M_node),
+ value_type())); }
+
+ void
+ insert(iterator __pos, size_type __n, const value_type& __x)
+ { _M_insert_after_fill(__slist_previous(&this->_M_head, __pos._M_node),
+ __n, __x); }
+
+ // We don't need any dispatching tricks here, because
+ // _M_insert_after_range already does them.
+ template <class _InIterator>
+ void
+ insert(iterator __pos, _InIterator __first, _InIterator __last)
+ { _M_insert_after_range(__slist_previous(&this->_M_head, __pos._M_node),
+ __first, __last); }
+
+ public:
+ iterator
+ erase_after(iterator __pos)
+ { return iterator((_Node*) this->_M_erase_after(__pos._M_node)); }
+
+ iterator
+ erase_after(iterator __before_first, iterator __last)
+ {
+ return iterator((_Node*) this->_M_erase_after(__before_first._M_node,
+ __last._M_node));
+ }
+
+ iterator
+ erase(iterator __pos)
+ {
+ return iterator((_Node*) this->_M_erase_after
+ (__slist_previous(&this->_M_head, __pos._M_node)));
+ }
+
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ return iterator((_Node*) this->_M_erase_after
+ (__slist_previous(&this->_M_head, __first._M_node),
+ __last._M_node));
+ }
+
+ void
+ resize(size_type new_size, const _Tp& __x);
+
+ void
+ resize(size_type new_size)
+ { resize(new_size, _Tp()); }
+
+ void
+ clear()
+ { this->_M_erase_after(&this->_M_head, 0); }
+
+ public:
+ // Moves the range [__before_first + 1, __before_last + 1) to *this,
+ // inserting it immediately after __pos. This is constant time.
+ void
+ splice_after(iterator __pos,
+ iterator __before_first, iterator __before_last)
+ {
+ if (__before_first != __before_last)
+ __slist_splice_after(__pos._M_node, __before_first._M_node,
+ __before_last._M_node);
+ }
+
+ // Moves the element that follows __prev to *this, inserting it
+ // immediately after __pos. This is constant time.
+ void
+ splice_after(iterator __pos, iterator __prev)
+ { __slist_splice_after(__pos._M_node,
+ __prev._M_node, __prev._M_node->_M_next); }
+
+ // Removes all of the elements from the list __x to *this, inserting
+ // them immediately after __pos. __x must not be *this. Complexity:
+ // linear in __x.size().
+ void
+ splice_after(iterator __pos, slist& __x)
+ { __slist_splice_after(__pos._M_node, &__x._M_head); }
+
+ // Linear in distance(begin(), __pos), and linear in __x.size().
+ void
+ splice(iterator __pos, slist& __x)
+ {
+ if (__x._M_head._M_next)
+ __slist_splice_after(__slist_previous(&this->_M_head, __pos._M_node),
+ &__x._M_head,
+ __slist_previous(&__x._M_head, 0)); }
+
+ // Linear in distance(begin(), __pos), and in distance(__x.begin(), __i).
+ void
+ splice(iterator __pos, slist& __x, iterator __i)
+ { __slist_splice_after(__slist_previous(&this->_M_head, __pos._M_node),
+ __slist_previous(&__x._M_head, __i._M_node),
+ __i._M_node); }
+
+ // Linear in distance(begin(), __pos), in distance(__x.begin(), __first),
+ // and in distance(__first, __last).
+ void
+ splice(iterator __pos, slist& __x, iterator __first, iterator __last)
+ {
+ if (__first != __last)
+ __slist_splice_after(__slist_previous(&this->_M_head, __pos._M_node),
+ __slist_previous(&__x._M_head, __first._M_node),
+ __slist_previous(__first._M_node,
+ __last._M_node));
+ }
+
+ public:
+ void
+ reverse()
+ {
+ if (this->_M_head._M_next)
+ this->_M_head._M_next = __slist_reverse(this->_M_head._M_next);
+ }
+
+ void
+ remove(const _Tp& __val);
+
+ void
+ unique();
+
+ void
+ merge(slist& __x);
+
+ void
+ sort();
+
+ template <class _Predicate>
+ void
+ remove_if(_Predicate __pred);
+
+ template <class _BinaryPredicate>
+ void
+ unique(_BinaryPredicate __pred);
+
+ template <class _StrictWeakOrdering>
+ void
+ merge(slist&, _StrictWeakOrdering);
+
+ template <class _StrictWeakOrdering>
+ void
+ sort(_StrictWeakOrdering __comp);
+ };
+
+ template <class _Tp, class _Alloc>
+ slist<_Tp, _Alloc>&
+ slist<_Tp, _Alloc>::operator=(const slist<_Tp, _Alloc>& __x)
+ {
+ if (&__x != this)
+ {
+ _Node_base* __p1 = &this->_M_head;
+ _Node* __n1 = (_Node*) this->_M_head._M_next;
+ const _Node* __n2 = (const _Node*) __x._M_head._M_next;
+ while (__n1 && __n2)
+ {
+ __n1->_M_data = __n2->_M_data;
+ __p1 = __n1;
+ __n1 = (_Node*) __n1->_M_next;
+ __n2 = (const _Node*) __n2->_M_next;
+ }
+ if (__n2 == 0)
+ this->_M_erase_after(__p1, 0);
+ else
+ _M_insert_after_range(__p1, const_iterator((_Node*)__n2),
+ const_iterator(0));
+ }
+ return *this;
+ }
+
+ template <class _Tp, class _Alloc>
+ void
+ slist<_Tp, _Alloc>::_M_fill_assign(size_type __n, const _Tp& __val)
+ {
+ _Node_base* __prev = &this->_M_head;
+ _Node* __node = (_Node*) this->_M_head._M_next;
+ for (; __node != 0 && __n > 0; --__n)
+ {
+ __node->_M_data = __val;
+ __prev = __node;
+ __node = (_Node*) __node->_M_next;
+ }
+ if (__n > 0)
+ _M_insert_after_fill(__prev, __n, __val);
+ else
+ this->_M_erase_after(__prev, 0);
+ }
+
+ template <class _Tp, class _Alloc>
+ template <class _InputIterator>
+ void
+ slist<_Tp, _Alloc>::_M_assign_dispatch(_InputIterator __first,
+ _InputIterator __last,
+ __false_type)
+ {
+ _Node_base* __prev = &this->_M_head;
+ _Node* __node = (_Node*) this->_M_head._M_next;
+ while (__node != 0 && __first != __last)
+ {
+ __node->_M_data = *__first;
+ __prev = __node;
+ __node = (_Node*) __node->_M_next;
+ ++__first;
+ }
+ if (__first != __last)
+ _M_insert_after_range(__prev, __first, __last);
+ else
+ this->_M_erase_after(__prev, 0);
+ }
+
+ template <class _Tp, class _Alloc>
+ inline bool
+ operator==(const slist<_Tp, _Alloc>& _SL1, const slist<_Tp, _Alloc>& _SL2)
+ {
+ typedef typename slist<_Tp,_Alloc>::const_iterator const_iterator;
+ const_iterator __end1 = _SL1.end();
+ const_iterator __end2 = _SL2.end();
+
+ const_iterator __i1 = _SL1.begin();
+ const_iterator __i2 = _SL2.begin();
+ while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2)
+ {
+ ++__i1;
+ ++__i2;
+ }
+ return __i1 == __end1 && __i2 == __end2;
+ }
+
+
+ template <class _Tp, class _Alloc>
+ inline bool
+ operator<(const slist<_Tp, _Alloc>& _SL1, const slist<_Tp, _Alloc>& _SL2)
+ { return std::lexicographical_compare(_SL1.begin(), _SL1.end(),
+ _SL2.begin(), _SL2.end()); }
+
+ template <class _Tp, class _Alloc>
+ inline bool
+ operator!=(const slist<_Tp, _Alloc>& _SL1, const slist<_Tp, _Alloc>& _SL2)
+ { return !(_SL1 == _SL2); }
+
+ template <class _Tp, class _Alloc>
+ inline bool
+ operator>(const slist<_Tp, _Alloc>& _SL1, const slist<_Tp, _Alloc>& _SL2)
+ { return _SL2 < _SL1; }
+
+ template <class _Tp, class _Alloc>
+ inline bool
+ operator<=(const slist<_Tp, _Alloc>& _SL1, const slist<_Tp, _Alloc>& _SL2)
+ { return !(_SL2 < _SL1); }
+
+ template <class _Tp, class _Alloc>
+ inline bool
+ operator>=(const slist<_Tp, _Alloc>& _SL1, const slist<_Tp, _Alloc>& _SL2)
+ { return !(_SL1 < _SL2); }
+
+ template <class _Tp, class _Alloc>
+ inline void
+ swap(slist<_Tp, _Alloc>& __x, slist<_Tp, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template <class _Tp, class _Alloc>
+ void
+ slist<_Tp, _Alloc>::resize(size_type __len, const _Tp& __x)
+ {
+ _Node_base* __cur = &this->_M_head;
+ while (__cur->_M_next != 0 && __len > 0)
+ {
+ --__len;
+ __cur = __cur->_M_next;
+ }
+ if (__cur->_M_next)
+ this->_M_erase_after(__cur, 0);
+ else
+ _M_insert_after_fill(__cur, __len, __x);
+ }
+
+ template <class _Tp, class _Alloc>
+ void
+ slist<_Tp, _Alloc>::remove(const _Tp& __val)
+ {
+ _Node_base* __cur = &this->_M_head;
+ while (__cur && __cur->_M_next)
+ {
+ if (((_Node*) __cur->_M_next)->_M_data == __val)
+ this->_M_erase_after(__cur);
+ else
+ __cur = __cur->_M_next;
+ }
+ }
+
+ template <class _Tp, class _Alloc>
+ void
+ slist<_Tp, _Alloc>::unique()
+ {
+ _Node_base* __cur = this->_M_head._M_next;
+ if (__cur)
+ {
+ while (__cur->_M_next)
+ {
+ if (((_Node*)__cur)->_M_data
+ == ((_Node*)(__cur->_M_next))->_M_data)
+ this->_M_erase_after(__cur);
+ else
+ __cur = __cur->_M_next;
+ }
+ }
+ }
+
+ template <class _Tp, class _Alloc>
+ void
+ slist<_Tp, _Alloc>::merge(slist<_Tp, _Alloc>& __x)
+ {
+ _Node_base* __n1 = &this->_M_head;
+ while (__n1->_M_next && __x._M_head._M_next)
+ {
+ if (((_Node*) __x._M_head._M_next)->_M_data
+ < ((_Node*) __n1->_M_next)->_M_data)
+ __slist_splice_after(__n1, &__x._M_head, __x._M_head._M_next);
+ __n1 = __n1->_M_next;
+ }
+ if (__x._M_head._M_next)
+ {
+ __n1->_M_next = __x._M_head._M_next;
+ __x._M_head._M_next = 0;
+ }
+ }
+
+ template <class _Tp, class _Alloc>
+ void
+ slist<_Tp, _Alloc>::sort()
+ {
+ if (this->_M_head._M_next && this->_M_head._M_next->_M_next)
+ {
+ slist __carry;
+ slist __counter[64];
+ int __fill = 0;
+ while (!empty())
+ {
+ __slist_splice_after(&__carry._M_head,
+ &this->_M_head, this->_M_head._M_next);
+ int __i = 0;
+ while (__i < __fill && !__counter[__i].empty())
+ {
+ __counter[__i].merge(__carry);
+ __carry.swap(__counter[__i]);
+ ++__i;
+ }
+ __carry.swap(__counter[__i]);
+ if (__i == __fill)
+ ++__fill;
+ }
+
+ for (int __i = 1; __i < __fill; ++__i)
+ __counter[__i].merge(__counter[__i-1]);
+ this->swap(__counter[__fill-1]);
+ }
+ }
+
+ template <class _Tp, class _Alloc>
+ template <class _Predicate>
+ void slist<_Tp, _Alloc>::remove_if(_Predicate __pred)
+ {
+ _Node_base* __cur = &this->_M_head;
+ while (__cur->_M_next)
+ {
+ if (__pred(((_Node*) __cur->_M_next)->_M_data))
+ this->_M_erase_after(__cur);
+ else
+ __cur = __cur->_M_next;
+ }
+ }
+
+ template <class _Tp, class _Alloc>
+ template <class _BinaryPredicate>
+ void
+ slist<_Tp, _Alloc>::unique(_BinaryPredicate __pred)
+ {
+ _Node* __cur = (_Node*) this->_M_head._M_next;
+ if (__cur)
+ {
+ while (__cur->_M_next)
+ {
+ if (__pred(((_Node*)__cur)->_M_data,
+ ((_Node*)(__cur->_M_next))->_M_data))
+ this->_M_erase_after(__cur);
+ else
+ __cur = (_Node*) __cur->_M_next;
+ }
+ }
+ }
+
+ template <class _Tp, class _Alloc>
+ template <class _StrictWeakOrdering>
+ void
+ slist<_Tp, _Alloc>::merge(slist<_Tp, _Alloc>& __x,
+ _StrictWeakOrdering __comp)
+ {
+ _Node_base* __n1 = &this->_M_head;
+ while (__n1->_M_next && __x._M_head._M_next)
+ {
+ if (__comp(((_Node*) __x._M_head._M_next)->_M_data,
+ ((_Node*) __n1->_M_next)->_M_data))
+ __slist_splice_after(__n1, &__x._M_head, __x._M_head._M_next);
+ __n1 = __n1->_M_next;
+ }
+ if (__x._M_head._M_next)
+ {
+ __n1->_M_next = __x._M_head._M_next;
+ __x._M_head._M_next = 0;
+ }
+ }
+
+ template <class _Tp, class _Alloc>
+ template <class _StrictWeakOrdering>
+ void
+ slist<_Tp, _Alloc>::sort(_StrictWeakOrdering __comp)
+ {
+ if (this->_M_head._M_next && this->_M_head._M_next->_M_next)
+ {
+ slist __carry;
+ slist __counter[64];
+ int __fill = 0;
+ while (!empty())
+ {
+ __slist_splice_after(&__carry._M_head,
+ &this->_M_head, this->_M_head._M_next);
+ int __i = 0;
+ while (__i < __fill && !__counter[__i].empty())
+ {
+ __counter[__i].merge(__carry, __comp);
+ __carry.swap(__counter[__i]);
+ ++__i;
+ }
+ __carry.swap(__counter[__i]);
+ if (__i == __fill)
+ ++__fill;
+ }
+
+ for (int __i = 1; __i < __fill; ++__i)
+ __counter[__i].merge(__counter[__i-1], __comp);
+ this->swap(__counter[__fill-1]);
+ }
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Specialization of insert_iterator so that insertions will be constant
+ // time rather than linear time.
+ template <class _Tp, class _Alloc>
+ class insert_iterator<__gnu_cxx::slist<_Tp, _Alloc> >
+ {
+ protected:
+ typedef __gnu_cxx::slist<_Tp, _Alloc> _Container;
+ _Container* container;
+ typename _Container::iterator iter;
+
+ public:
+ typedef _Container container_type;
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ insert_iterator(_Container& __x, typename _Container::iterator __i)
+ : container(&__x)
+ {
+ if (__i == __x.begin())
+ iter = __x.before_begin();
+ else
+ iter = __x.previous(__i);
+ }
+
+ insert_iterator<_Container>&
+ operator=(const typename _Container::value_type& __value)
+ {
+ iter = container->insert_after(iter, __value);
+ return *this;
+ }
+
+ insert_iterator<_Container>&
+ operator*()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++()
+ { return *this; }
+
+ insert_iterator<_Container>&
+ operator++(int)
+ { return *this; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/sso_string_base.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/sso_string_base.h
new file mode 100644
index 0000000..85a0d7c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/sso_string_base.h
@@ -0,0 +1,568 @@
+// Short-string-optimized versatile string base -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/sso_string_base.h
+ * This file is a GNU extension to the Standard C++ Library.
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _SSO_STRING_BASE_H
+#define _SSO_STRING_BASE_H 1
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ class __sso_string_base
+ : protected __vstring_utility<_CharT, _Traits, _Alloc>
+ {
+ public:
+ typedef _Traits traits_type;
+ typedef typename _Traits::char_type value_type;
+
+ typedef __vstring_utility<_CharT, _Traits, _Alloc> _Util_Base;
+ typedef typename _Util_Base::_CharT_alloc_type _CharT_alloc_type;
+ typedef typename _CharT_alloc_type::size_type size_type;
+
+ private:
+ // Data Members:
+ typename _Util_Base::template _Alloc_hider<_CharT_alloc_type>
+ _M_dataplus;
+ size_type _M_string_length;
+
+ enum { _S_local_capacity = 15 };
+
+ union
+ {
+ _CharT _M_local_data[_S_local_capacity + 1];
+ size_type _M_allocated_capacity;
+ };
+
+ void
+ _M_data(_CharT* __p)
+ { _M_dataplus._M_p = __p; }
+
+ void
+ _M_length(size_type __length)
+ { _M_string_length = __length; }
+
+ void
+ _M_capacity(size_type __capacity)
+ { _M_allocated_capacity = __capacity; }
+
+ bool
+ _M_is_local() const
+ { return _M_data() == _M_local_data; }
+
+ // Create & Destroy
+ _CharT*
+ _M_create(size_type&, size_type);
+
+ void
+ _M_dispose()
+ {
+ if (!_M_is_local())
+ _M_destroy(_M_allocated_capacity);
+ }
+
+ void
+ _M_destroy(size_type __size) throw()
+ { _M_get_allocator().deallocate(_M_data(), __size + 1); }
+
+ // _M_construct_aux is used to implement the 21.3.1 para 15 which
+ // requires special behaviour if _InIterator is an integral type
+ template<typename _InIterator>
+ void
+ _M_construct_aux(_InIterator __beg, _InIterator __end,
+ std::__false_type)
+ {
+ typedef typename iterator_traits<_InIterator>::iterator_category _Tag;
+ _M_construct(__beg, __end, _Tag());
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 438. Ambiguity in the "do the right thing" clause
+ template<typename _Integer>
+ void
+ _M_construct_aux(_Integer __beg, _Integer __end, std::__true_type)
+ { _M_construct(static_cast<size_type>(__beg), __end); }
+
+ template<typename _InIterator>
+ void
+ _M_construct(_InIterator __beg, _InIterator __end)
+ {
+ typedef typename std::__is_integer<_InIterator>::__type _Integral;
+ _M_construct_aux(__beg, __end, _Integral());
+ }
+
+ // For Input Iterators, used in istreambuf_iterators, etc.
+ template<typename _InIterator>
+ void
+ _M_construct(_InIterator __beg, _InIterator __end,
+ std::input_iterator_tag);
+
+ // For forward_iterators up to random_access_iterators, used for
+ // string::iterator, _CharT*, etc.
+ template<typename _FwdIterator>
+ void
+ _M_construct(_FwdIterator __beg, _FwdIterator __end,
+ std::forward_iterator_tag);
+
+ void
+ _M_construct(size_type __req, _CharT __c);
+
+ public:
+ size_type
+ _M_max_size() const
+ { return (_M_get_allocator().max_size() - 1) / 2; }
+
+ _CharT*
+ _M_data() const
+ { return _M_dataplus._M_p; }
+
+ size_type
+ _M_length() const
+ { return _M_string_length; }
+
+ size_type
+ _M_capacity() const
+ {
+ return _M_is_local() ? size_type(_S_local_capacity)
+ : _M_allocated_capacity;
+ }
+
+ bool
+ _M_is_shared() const
+ { return false; }
+
+ void
+ _M_set_leaked() { }
+
+ void
+ _M_leak() { }
+
+ void
+ _M_set_length(size_type __n)
+ {
+ _M_length(__n);
+ traits_type::assign(_M_data()[__n], _CharT());
+ }
+
+ __sso_string_base()
+ : _M_dataplus(_M_local_data)
+ { _M_set_length(0); }
+
+ __sso_string_base(const _Alloc& __a);
+
+ __sso_string_base(const __sso_string_base& __rcs);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ __sso_string_base(__sso_string_base&& __rcs);
+#endif
+
+ __sso_string_base(size_type __n, _CharT __c, const _Alloc& __a);
+
+ template<typename _InputIterator>
+ __sso_string_base(_InputIterator __beg, _InputIterator __end,
+ const _Alloc& __a);
+
+ ~__sso_string_base()
+ { _M_dispose(); }
+
+ _CharT_alloc_type&
+ _M_get_allocator()
+ { return _M_dataplus; }
+
+ const _CharT_alloc_type&
+ _M_get_allocator() const
+ { return _M_dataplus; }
+
+ void
+ _M_swap(__sso_string_base& __rcs);
+
+ void
+ _M_assign(const __sso_string_base& __rcs);
+
+ void
+ _M_reserve(size_type __res);
+
+ void
+ _M_mutate(size_type __pos, size_type __len1, const _CharT* __s,
+ size_type __len2);
+
+ void
+ _M_erase(size_type __pos, size_type __n);
+
+ void
+ _M_clear()
+ { _M_set_length(0); }
+
+ bool
+ _M_compare(const __sso_string_base&) const
+ { return false; }
+ };
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ _M_swap(__sso_string_base& __rcs)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 431. Swapping containers with unequal allocators.
+ std::__alloc_swap<_CharT_alloc_type>::_S_do_it(_M_get_allocator(),
+ __rcs._M_get_allocator());
+
+ if (_M_is_local())
+ if (__rcs._M_is_local())
+ {
+ if (_M_length() && __rcs._M_length())
+ {
+ _CharT __tmp_data[_S_local_capacity + 1];
+ traits_type::copy(__tmp_data, __rcs._M_local_data,
+ _S_local_capacity + 1);
+ traits_type::copy(__rcs._M_local_data, _M_local_data,
+ _S_local_capacity + 1);
+ traits_type::copy(_M_local_data, __tmp_data,
+ _S_local_capacity + 1);
+ }
+ else if (__rcs._M_length())
+ {
+ traits_type::copy(_M_local_data, __rcs._M_local_data,
+ _S_local_capacity + 1);
+ _M_length(__rcs._M_length());
+ __rcs._M_set_length(0);
+ return;
+ }
+ else if (_M_length())
+ {
+ traits_type::copy(__rcs._M_local_data, _M_local_data,
+ _S_local_capacity + 1);
+ __rcs._M_length(_M_length());
+ _M_set_length(0);
+ return;
+ }
+ }
+ else
+ {
+ const size_type __tmp_capacity = __rcs._M_allocated_capacity;
+ traits_type::copy(__rcs._M_local_data, _M_local_data,
+ _S_local_capacity + 1);
+ _M_data(__rcs._M_data());
+ __rcs._M_data(__rcs._M_local_data);
+ _M_capacity(__tmp_capacity);
+ }
+ else
+ {
+ const size_type __tmp_capacity = _M_allocated_capacity;
+ if (__rcs._M_is_local())
+ {
+ traits_type::copy(_M_local_data, __rcs._M_local_data,
+ _S_local_capacity + 1);
+ __rcs._M_data(_M_data());
+ _M_data(_M_local_data);
+ }
+ else
+ {
+ _CharT* __tmp_ptr = _M_data();
+ _M_data(__rcs._M_data());
+ __rcs._M_data(__tmp_ptr);
+ _M_capacity(__rcs._M_allocated_capacity);
+ }
+ __rcs._M_capacity(__tmp_capacity);
+ }
+
+ const size_type __tmp_length = _M_length();
+ _M_length(__rcs._M_length());
+ __rcs._M_length(__tmp_length);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ _CharT*
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ _M_create(size_type& __capacity, size_type __old_capacity)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 83. String::npos vs. string::max_size()
+ if (__capacity > _M_max_size())
+ std::__throw_length_error(__N("__sso_string_base::_M_create"));
+
+ // The below implements an exponential growth policy, necessary to
+ // meet amortized linear time requirements of the library: see
+ // http://gcc.gnu.org/ml/libstdc++/2001-07/msg00085.html.
+ if (__capacity > __old_capacity && __capacity < 2 * __old_capacity)
+ {
+ __capacity = 2 * __old_capacity;
+ // Never allocate a string bigger than max_size.
+ if (__capacity > _M_max_size())
+ __capacity = _M_max_size();
+ }
+
+ // NB: Need an array of char_type[__capacity], plus a terminating
+ // null char_type() element.
+ return _M_get_allocator().allocate(__capacity + 1);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ __sso_string_base(const _Alloc& __a)
+ : _M_dataplus(__a, _M_local_data)
+ { _M_set_length(0); }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ __sso_string_base(const __sso_string_base& __rcs)
+ : _M_dataplus(__rcs._M_get_allocator(), _M_local_data)
+ { _M_construct(__rcs._M_data(), __rcs._M_data() + __rcs._M_length()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ __sso_string_base(__sso_string_base&& __rcs)
+ : _M_dataplus(__rcs._M_get_allocator(), _M_local_data)
+ {
+ if (__rcs._M_is_local())
+ {
+ if (__rcs._M_length())
+ traits_type::copy(_M_local_data, __rcs._M_local_data,
+ _S_local_capacity + 1);
+ }
+ else
+ {
+ _M_data(__rcs._M_data());
+ _M_capacity(__rcs._M_allocated_capacity);
+ }
+
+ _M_length(__rcs._M_length());
+ __rcs._M_length(0);
+ __rcs._M_data(__rcs._M_local_data);
+ }
+#endif
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ __sso_string_base(size_type __n, _CharT __c, const _Alloc& __a)
+ : _M_dataplus(__a, _M_local_data)
+ { _M_construct(__n, __c); }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InputIterator>
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ __sso_string_base(_InputIterator __beg, _InputIterator __end,
+ const _Alloc& __a)
+ : _M_dataplus(__a, _M_local_data)
+ { _M_construct(__beg, __end); }
+
+ // NB: This is the special case for Input Iterators, used in
+ // istreambuf_iterators, etc.
+ // Input Iterators have a cost structure very different from
+ // pointers, calling for a different coding style.
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InIterator>
+ void
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ _M_construct(_InIterator __beg, _InIterator __end,
+ std::input_iterator_tag)
+ {
+ size_type __len = 0;
+ size_type __capacity = size_type(_S_local_capacity);
+
+ while (__beg != __end && __len < __capacity)
+ {
+ _M_data()[__len++] = *__beg;
+ ++__beg;
+ }
+
+ __try
+ {
+ while (__beg != __end)
+ {
+ if (__len == __capacity)
+ {
+ // Allocate more space.
+ __capacity = __len + 1;
+ _CharT* __another = _M_create(__capacity, __len);
+ _S_copy(__another, _M_data(), __len);
+ _M_dispose();
+ _M_data(__another);
+ _M_capacity(__capacity);
+ }
+ _M_data()[__len++] = *__beg;
+ ++__beg;
+ }
+ }
+ __catch(...)
+ {
+ _M_dispose();
+ __throw_exception_again;
+ }
+
+ _M_set_length(__len);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InIterator>
+ void
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ _M_construct(_InIterator __beg, _InIterator __end,
+ std::forward_iterator_tag)
+ {
+ // NB: Not required, but considered best practice.
+ if (__builtin_expect(__is_null_pointer(__beg) && __beg != __end, 0))
+ std::__throw_logic_error(__N("__sso_string_base::"
+ "_M_construct NULL not valid"));
+
+ size_type __dnew = static_cast<size_type>(std::distance(__beg, __end));
+
+ if (__dnew > size_type(_S_local_capacity))
+ {
+ _M_data(_M_create(__dnew, size_type(0)));
+ _M_capacity(__dnew);
+ }
+
+ // Check for out_of_range and length_error exceptions.
+ __try
+ { _S_copy_chars(_M_data(), __beg, __end); }
+ __catch(...)
+ {
+ _M_dispose();
+ __throw_exception_again;
+ }
+
+ _M_set_length(__dnew);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ _M_construct(size_type __n, _CharT __c)
+ {
+ if (__n > size_type(_S_local_capacity))
+ {
+ _M_data(_M_create(__n, size_type(0)));
+ _M_capacity(__n);
+ }
+
+ if (__n)
+ _S_assign(_M_data(), __n, __c);
+
+ _M_set_length(__n);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ _M_assign(const __sso_string_base& __rcs)
+ {
+ if (this != &__rcs)
+ {
+ const size_type __rsize = __rcs._M_length();
+ const size_type __capacity = _M_capacity();
+
+ if (__rsize > __capacity)
+ {
+ size_type __new_capacity = __rsize;
+ _CharT* __tmp = _M_create(__new_capacity, __capacity);
+ _M_dispose();
+ _M_data(__tmp);
+ _M_capacity(__new_capacity);
+ }
+
+ if (__rsize)
+ _S_copy(_M_data(), __rcs._M_data(), __rsize);
+
+ _M_set_length(__rsize);
+ }
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ _M_reserve(size_type __res)
+ {
+ // Make sure we don't shrink below the current size.
+ if (__res < _M_length())
+ __res = _M_length();
+
+ const size_type __capacity = _M_capacity();
+ if (__res != __capacity)
+ {
+ if (__res > __capacity
+ || __res > size_type(_S_local_capacity))
+ {
+ _CharT* __tmp = _M_create(__res, __capacity);
+ _S_copy(__tmp, _M_data(), _M_length() + 1);
+ _M_dispose();
+ _M_data(__tmp);
+ _M_capacity(__res);
+ }
+ else if (!_M_is_local())
+ {
+ _S_copy(_M_local_data, _M_data(), _M_length() + 1);
+ _M_destroy(__capacity);
+ _M_data(_M_local_data);
+ }
+ }
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ _M_mutate(size_type __pos, size_type __len1, const _CharT* __s,
+ const size_type __len2)
+ {
+ const size_type __how_much = _M_length() - __pos - __len1;
+
+ size_type __new_capacity = _M_length() + __len2 - __len1;
+ _CharT* __r = _M_create(__new_capacity, _M_capacity());
+
+ if (__pos)
+ _S_copy(__r, _M_data(), __pos);
+ if (__s && __len2)
+ _S_copy(__r + __pos, __s, __len2);
+ if (__how_much)
+ _S_copy(__r + __pos + __len2,
+ _M_data() + __pos + __len1, __how_much);
+
+ _M_dispose();
+ _M_data(__r);
+ _M_capacity(__new_capacity);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ void
+ __sso_string_base<_CharT, _Traits, _Alloc>::
+ _M_erase(size_type __pos, size_type __n)
+ {
+ const size_type __how_much = _M_length() - __pos - __n;
+
+ if (__how_much && __n)
+ _S_move(_M_data() + __pos, _M_data() + __pos + __n,
+ __how_much);
+
+ _M_set_length(_M_length() - __n);
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _SSO_STRING_BASE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/stdio_filebuf.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/stdio_filebuf.h
new file mode 100644
index 0000000..6efe4ea
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/stdio_filebuf.h
@@ -0,0 +1,157 @@
+// File descriptor layer for filebuf -*- C++ -*-
+
+// Copyright (C) 2002, 2003, 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/stdio_filebuf.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _STDIO_FILEBUF_H
+#define _STDIO_FILEBUF_H 1
+
+#pragma GCC system_header
+
+#include <fstream>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ /**
+ * @brief Provides a layer of compatibility for C/POSIX.
+ *
+ * This GNU extension provides extensions for working with standard C
+ * FILE*'s and POSIX file descriptors. It must be instantiated by the
+ * user with the type of character used in the file stream, e.g.,
+ * stdio_filebuf<char>.
+ */
+ template<typename _CharT, typename _Traits = std::char_traits<_CharT> >
+ class stdio_filebuf : public std::basic_filebuf<_CharT, _Traits>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+ typedef std::size_t size_t;
+
+ public:
+ /**
+ * deferred initialization
+ */
+ stdio_filebuf() : std::basic_filebuf<_CharT, _Traits>() {}
+
+ /**
+ * @param fd An open file descriptor.
+ * @param mode Same meaning as in a standard filebuf.
+ * @param size Optimal or preferred size of internal buffer, in chars.
+ *
+ * This constructor associates a file stream buffer with an open
+ * POSIX file descriptor. The file descriptor will be automatically
+ * closed when the stdio_filebuf is closed/destroyed.
+ */
+ stdio_filebuf(int __fd, std::ios_base::openmode __mode,
+ size_t __size = static_cast<size_t>(BUFSIZ));
+
+ /**
+ * @param f An open @c FILE*.
+ * @param mode Same meaning as in a standard filebuf.
+ * @param size Optimal or preferred size of internal buffer, in chars.
+ * Defaults to system's @c BUFSIZ.
+ *
+ * This constructor associates a file stream buffer with an open
+ * C @c FILE*. The @c FILE* will not be automatically closed when the
+ * stdio_filebuf is closed/destroyed.
+ */
+ stdio_filebuf(std::__c_file* __f, std::ios_base::openmode __mode,
+ size_t __size = static_cast<size_t>(BUFSIZ));
+
+ /**
+ * Closes the external data stream if the file descriptor constructor
+ * was used.
+ */
+ virtual
+ ~stdio_filebuf();
+
+ /**
+ * @return The underlying file descriptor.
+ *
+ * Once associated with an external data stream, this function can be
+ * used to access the underlying POSIX file descriptor. Note that
+ * there is no way for the library to track what you do with the
+ * descriptor, so be careful.
+ */
+ int
+ fd() { return this->_M_file.fd(); }
+
+ /**
+ * @return The underlying FILE*.
+ *
+ * This function can be used to access the underlying "C" file pointer.
+ * Note that there is no way for the library to track what you do
+ * with the file, so be careful.
+ */
+ std::__c_file*
+ file() { return this->_M_file.file(); }
+ };
+
+ template<typename _CharT, typename _Traits>
+ stdio_filebuf<_CharT, _Traits>::~stdio_filebuf()
+ { }
+
+ template<typename _CharT, typename _Traits>
+ stdio_filebuf<_CharT, _Traits>::
+ stdio_filebuf(int __fd, std::ios_base::openmode __mode, size_t __size)
+ {
+ this->_M_file.sys_open(__fd, __mode);
+ if (this->is_open())
+ {
+ this->_M_mode = __mode;
+ this->_M_buf_size = __size;
+ this->_M_allocate_internal_buffer();
+ this->_M_reading = false;
+ this->_M_writing = false;
+ this->_M_set_buffer(-1);
+ }
+ }
+
+ template<typename _CharT, typename _Traits>
+ stdio_filebuf<_CharT, _Traits>::
+ stdio_filebuf(std::__c_file* __f, std::ios_base::openmode __mode,
+ size_t __size)
+ {
+ this->_M_file.sys_open(__f, __mode);
+ if (this->is_open())
+ {
+ this->_M_mode = __mode;
+ this->_M_buf_size = __size;
+ this->_M_allocate_internal_buffer();
+ this->_M_reading = false;
+ this->_M_writing = false;
+ this->_M_set_buffer(-1);
+ }
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/stdio_sync_filebuf.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/stdio_sync_filebuf.h
new file mode 100644
index 0000000..9407e96
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/stdio_sync_filebuf.h
@@ -0,0 +1,279 @@
+// Iostreams wrapper for stdio FILE* -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/stdio_sync_filebuf.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _STDIO_SYNC_FILEBUF_H
+#define _STDIO_SYNC_FILEBUF_H 1
+
+#pragma GCC system_header
+
+#include <streambuf>
+#include <unistd.h>
+#include <cstdio>
+#include <bits/c++io.h> // For __c_file
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+#include <cwchar>
+#endif
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ /// class stdio_sync_filebuf.
+ template<typename _CharT, typename _Traits = std::char_traits<_CharT> >
+ class stdio_sync_filebuf : public std::basic_streambuf<_CharT, _Traits>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+
+ private:
+ // Underlying stdio FILE
+ std::__c_file* const _M_file;
+
+ // Last character gotten. This is used when pbackfail is
+ // called from basic_streambuf::sungetc()
+ int_type _M_unget_buf;
+
+ public:
+ explicit
+ stdio_sync_filebuf(std::__c_file* __f)
+ : _M_file(__f), _M_unget_buf(traits_type::eof())
+ { }
+
+ /**
+ * @return The underlying FILE*.
+ *
+ * This function can be used to access the underlying "C" file pointer.
+ * Note that there is no way for the library to track what you do
+ * with the file, so be careful.
+ */
+ std::__c_file* const
+ file() { return this->_M_file; }
+
+ protected:
+ int_type
+ syncgetc();
+
+ int_type
+ syncungetc(int_type __c);
+
+ int_type
+ syncputc(int_type __c);
+
+ virtual int_type
+ underflow()
+ {
+ int_type __c = this->syncgetc();
+ return this->syncungetc(__c);
+ }
+
+ virtual int_type
+ uflow()
+ {
+ // Store the gotten character in case we need to unget it.
+ _M_unget_buf = this->syncgetc();
+ return _M_unget_buf;
+ }
+
+ virtual int_type
+ pbackfail(int_type __c = traits_type::eof())
+ {
+ int_type __ret;
+ const int_type __eof = traits_type::eof();
+
+ // Check if the unget or putback was requested
+ if (traits_type::eq_int_type(__c, __eof)) // unget
+ {
+ if (!traits_type::eq_int_type(_M_unget_buf, __eof))
+ __ret = this->syncungetc(_M_unget_buf);
+ else // buffer invalid, fail.
+ __ret = __eof;
+ }
+ else // putback
+ __ret = this->syncungetc(__c);
+
+ // The buffered character is no longer valid, discard it.
+ _M_unget_buf = __eof;
+ return __ret;
+ }
+
+ virtual std::streamsize
+ xsgetn(char_type* __s, std::streamsize __n);
+
+ virtual int_type
+ overflow(int_type __c = traits_type::eof())
+ {
+ int_type __ret;
+ if (traits_type::eq_int_type(__c, traits_type::eof()))
+ {
+ if (std::fflush(_M_file))
+ __ret = traits_type::eof();
+ else
+ __ret = traits_type::not_eof(__c);
+ }
+ else
+ __ret = this->syncputc(__c);
+ return __ret;
+ }
+
+ virtual std::streamsize
+ xsputn(const char_type* __s, std::streamsize __n);
+
+ virtual int
+ sync()
+ { return std::fflush(_M_file); }
+
+ virtual std::streampos
+ seekoff(std::streamoff __off, std::ios_base::seekdir __dir,
+ std::ios_base::openmode = std::ios_base::in | std::ios_base::out)
+ {
+ std::streampos __ret(std::streamoff(-1));
+ int __whence;
+ if (__dir == std::ios_base::beg)
+ __whence = SEEK_SET;
+ else if (__dir == std::ios_base::cur)
+ __whence = SEEK_CUR;
+ else
+ __whence = SEEK_END;
+#ifdef _GLIBCXX_USE_LFS
+ if (!fseeko64(_M_file, __off, __whence))
+ __ret = std::streampos(ftello64(_M_file));
+#else
+ if (!fseek(_M_file, __off, __whence))
+ __ret = std::streampos(std::ftell(_M_file));
+#endif
+ return __ret;
+ }
+
+ virtual std::streampos
+ seekpos(std::streampos __pos,
+ std::ios_base::openmode __mode =
+ std::ios_base::in | std::ios_base::out)
+ { return seekoff(std::streamoff(__pos), std::ios_base::beg, __mode); }
+ };
+
+ template<>
+ inline stdio_sync_filebuf<char>::int_type
+ stdio_sync_filebuf<char>::syncgetc()
+ { return std::getc(_M_file); }
+
+ template<>
+ inline stdio_sync_filebuf<char>::int_type
+ stdio_sync_filebuf<char>::syncungetc(int_type __c)
+ { return std::ungetc(__c, _M_file); }
+
+ template<>
+ inline stdio_sync_filebuf<char>::int_type
+ stdio_sync_filebuf<char>::syncputc(int_type __c)
+ { return std::putc(__c, _M_file); }
+
+ template<>
+ inline std::streamsize
+ stdio_sync_filebuf<char>::xsgetn(char* __s, std::streamsize __n)
+ {
+ std::streamsize __ret = std::fread(__s, 1, __n, _M_file);
+ if (__ret > 0)
+ _M_unget_buf = traits_type::to_int_type(__s[__ret - 1]);
+ else
+ _M_unget_buf = traits_type::eof();
+ return __ret;
+ }
+
+ template<>
+ inline std::streamsize
+ stdio_sync_filebuf<char>::xsputn(const char* __s, std::streamsize __n)
+ { return std::fwrite(__s, 1, __n, _M_file); }
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ inline stdio_sync_filebuf<wchar_t>::int_type
+ stdio_sync_filebuf<wchar_t>::syncgetc()
+ { return std::getwc(_M_file); }
+
+ template<>
+ inline stdio_sync_filebuf<wchar_t>::int_type
+ stdio_sync_filebuf<wchar_t>::syncungetc(int_type __c)
+ { return std::ungetwc(__c, _M_file); }
+
+ template<>
+ inline stdio_sync_filebuf<wchar_t>::int_type
+ stdio_sync_filebuf<wchar_t>::syncputc(int_type __c)
+ { return std::putwc(__c, _M_file); }
+
+ template<>
+ inline std::streamsize
+ stdio_sync_filebuf<wchar_t>::xsgetn(wchar_t* __s, std::streamsize __n)
+ {
+ std::streamsize __ret = 0;
+ const int_type __eof = traits_type::eof();
+ while (__n--)
+ {
+ int_type __c = this->syncgetc();
+ if (traits_type::eq_int_type(__c, __eof))
+ break;
+ __s[__ret] = traits_type::to_char_type(__c);
+ ++__ret;
+ }
+
+ if (__ret > 0)
+ _M_unget_buf = traits_type::to_int_type(__s[__ret - 1]);
+ else
+ _M_unget_buf = traits_type::eof();
+ return __ret;
+ }
+
+ template<>
+ inline std::streamsize
+ stdio_sync_filebuf<wchar_t>::xsputn(const wchar_t* __s,
+ std::streamsize __n)
+ {
+ std::streamsize __ret = 0;
+ const int_type __eof = traits_type::eof();
+ while (__n--)
+ {
+ if (traits_type::eq_int_type(this->syncputc(*__s++), __eof))
+ break;
+ ++__ret;
+ }
+ return __ret;
+ }
+#endif
+
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template class stdio_sync_filebuf<char>;
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template class stdio_sync_filebuf<wchar_t>;
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/string_conversions.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/string_conversions.h
new file mode 100644
index 0000000..36c19e0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/string_conversions.h
@@ -0,0 +1,94 @@
+// String Conversions -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef _STRING_CONVERSIONS_H
+#define _STRING_CONVERSIONS_H 1
+
+#pragma GCC system_header
+
+#include <ext/numeric_traits.h>
+#include <bits/functexcept.h>
+#include <cstddef>
+#include <cstdlib>
+#include <cwchar>
+#include <cstdio>
+#include <cerrno>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // Helper for all the sto* functions.
+ template<typename _TRet, typename _Ret = _TRet, typename _CharT,
+ typename... _Base>
+ _Ret
+ __stoa(_TRet (*__convf) (const _CharT*, _CharT**, _Base...),
+ const char* __name, const _CharT* __str, std::size_t* __idx,
+ _Base... __base)
+ {
+ _Ret __ret;
+
+ _CharT* __endptr;
+ errno = 0;
+ const _TRet __tmp = __convf(__str, &__endptr, __base...);
+
+ if (__endptr == __str)
+ std::__throw_invalid_argument(__name);
+ else if (errno == ERANGE
+ || (std::__are_same<_Ret, int>::__value
+ && (__tmp < __numeric_traits<int>::__min
+ || __tmp > __numeric_traits<int>::__max)))
+ std::__throw_out_of_range(__name);
+ else
+ __ret = __tmp;
+
+ if (__idx)
+ *__idx = __endptr - __str;
+
+ return __ret;
+ }
+
+ // Helper for the to_string / to_wstring functions.
+ template<typename _String, typename _CharT = typename _String::value_type>
+ _String
+ __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*,
+ __builtin_va_list), std::size_t __n,
+ const _CharT* __fmt, ...)
+ {
+ // XXX Eventually the result will be constructed in place in
+ // the C++0x string, likely with the help of internal hooks.
+ _CharT* __s = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __n));
+
+ __builtin_va_list __args;
+ __builtin_va_start(__args, __fmt);
+
+ const int __len = __convf(__s, __n, __fmt, __args);
+
+ __builtin_va_end(__args);
+
+ return _String(__s, __s + __len);
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif // _STRING_CONVERSIONS_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/throw_allocator.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/throw_allocator.h
new file mode 100644
index 0000000..c87408f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/throw_allocator.h
@@ -0,0 +1,448 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice
+// and this permission notice appear in supporting documentation. None
+// of the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied
+// warranty.
+
+/** @file ext/throw_allocator.h
+ * This file is a GNU extension to the Standard C++ Library.
+ *
+ * Contains an exception-throwing allocator, useful for testing
+ * exception safety. In addition, allocation addresses are stored and
+ * sanity checked.
+ */
+
+#ifndef _THROW_ALLOCATOR_H
+#define _THROW_ALLOCATOR_H 1
+
+#include <cmath>
+#include <ctime>
+#include <map>
+#include <set>
+#include <string>
+#include <ostream>
+#include <stdexcept>
+#include <utility>
+#include <tr1/random>
+#include <bits/functexcept.h>
+#include <bits/move.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ class twister_rand_gen
+ {
+ private:
+ std::tr1::mt19937 _M_generator;
+
+ public:
+ twister_rand_gen(unsigned int s = static_cast<unsigned int>(std::time(0)));
+
+ void
+ init(unsigned int);
+
+ double
+ get_prob();
+ };
+
+ /**
+ * @brief Thown by throw_allocator.
+ * @ingroup exceptions
+ */
+ struct forced_exception_error : public std::exception
+ { };
+
+ // Substitute for concurrence_error object in the case of -fno-exceptions.
+ inline void
+ __throw_forced_exception_error()
+ {
+#if __EXCEPTIONS
+ throw forced_exception_error();
+#else
+ __builtin_abort();
+#endif
+ }
+
+ /// Base class.
+ class throw_allocator_base
+ {
+ public:
+ void
+ init(unsigned long seed);
+
+ static void
+ set_throw_prob(double throw_prob);
+
+ static double
+ get_throw_prob();
+
+ static void
+ set_label(size_t l);
+
+ static bool
+ empty();
+
+ struct group_throw_prob_adjustor
+ {
+ group_throw_prob_adjustor(size_t size) : _M_throw_prob_orig(_S_throw_prob)
+ {
+ _S_throw_prob =
+ 1 - std::pow(double(1 - _S_throw_prob), double(0.5 / (size + 1)));
+ }
+
+ ~group_throw_prob_adjustor()
+ { _S_throw_prob = _M_throw_prob_orig; }
+
+ private:
+ const double _M_throw_prob_orig;
+ };
+
+ struct zero_throw_prob_adjustor
+ {
+ zero_throw_prob_adjustor() : _M_throw_prob_orig(_S_throw_prob)
+ { _S_throw_prob = 0; }
+
+ ~zero_throw_prob_adjustor()
+ { _S_throw_prob = _M_throw_prob_orig; }
+
+ private:
+ const double _M_throw_prob_orig;
+ };
+
+ protected:
+ static void
+ insert(void*, size_t);
+
+ static void
+ erase(void*, size_t);
+
+ static void
+ throw_conditionally();
+
+ // See if a particular address and size has been allocated by this
+ // allocator.
+ static void
+ check_allocated(void*, size_t);
+
+ // See if a given label has been allocated by this allocator.
+ static void
+ check_allocated(size_t);
+
+ private:
+ typedef std::pair<size_t, size_t> alloc_data_type;
+ typedef std::map<void*, alloc_data_type> map_type;
+ typedef map_type::value_type entry_type;
+ typedef map_type::const_iterator const_iterator;
+ typedef map_type::const_reference const_reference;
+
+ friend std::ostream&
+ operator<<(std::ostream&, const throw_allocator_base&);
+
+ static entry_type
+ make_entry(void*, size_t);
+
+ static void
+ print_to_string(std::string&);
+
+ static void
+ print_to_string(std::string&, const_reference);
+
+ static twister_rand_gen _S_g;
+ static map_type _S_map;
+ static double _S_throw_prob;
+ static size_t _S_label;
+ };
+
+ /**
+ * @brief Allocator class with logging and exception control.
+ * @ingroup allocators
+ */
+ template<typename T>
+ class throw_allocator : public throw_allocator_base
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef T value_type;
+ typedef value_type* pointer;
+ typedef const value_type* const_pointer;
+ typedef value_type& reference;
+ typedef const value_type& const_reference;
+
+
+ template<typename U>
+ struct rebind
+ {
+ typedef throw_allocator<U> other;
+ };
+
+ throw_allocator() throw() { }
+
+ throw_allocator(const throw_allocator&) throw() { }
+
+ template<typename U>
+ throw_allocator(const throw_allocator<U>&) throw() { }
+
+ ~throw_allocator() throw() { }
+
+ size_type
+ max_size() const throw()
+ { return std::allocator<value_type>().max_size(); }
+
+ pointer
+ allocate(size_type __n, std::allocator<void>::const_pointer hint = 0)
+ {
+ if (__builtin_expect(__n > this->max_size(), false))
+ std::__throw_bad_alloc();
+
+ throw_conditionally();
+ value_type* const a = std::allocator<value_type>().allocate(__n, hint);
+ insert(a, sizeof(value_type) * __n);
+ return a;
+ }
+
+ void
+ construct(pointer __p, const T& val)
+ { return std::allocator<value_type>().construct(__p, val); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename... _Args>
+ void
+ construct(pointer __p, _Args&&... __args)
+ {
+ return std::allocator<value_type>().
+ construct(__p, std::forward<_Args>(__args)...);
+ }
+#endif
+
+ void
+ destroy(pointer __p)
+ { std::allocator<value_type>().destroy(__p); }
+
+ void
+ deallocate(pointer __p, size_type __n)
+ {
+ erase(__p, sizeof(value_type) * __n);
+ std::allocator<value_type>().deallocate(__p, __n);
+ }
+
+ void
+ check_allocated(pointer __p, size_type __n)
+ { throw_allocator_base::check_allocated(__p, sizeof(value_type) * __n); }
+
+ void
+ check_allocated(size_type label)
+ { throw_allocator_base::check_allocated(label); }
+ };
+
+ template<typename T>
+ inline bool
+ operator==(const throw_allocator<T>&, const throw_allocator<T>&)
+ { return true; }
+
+ template<typename T>
+ inline bool
+ operator!=(const throw_allocator<T>&, const throw_allocator<T>&)
+ { return false; }
+
+ std::ostream&
+ operator<<(std::ostream& os, const throw_allocator_base& alloc)
+ {
+ std::string error;
+ throw_allocator_base::print_to_string(error);
+ os << error;
+ return os;
+ }
+
+ // XXX Should be in .cc.
+ twister_rand_gen::
+ twister_rand_gen(unsigned int seed) : _M_generator(seed) { }
+
+ void
+ twister_rand_gen::
+ init(unsigned int seed)
+ { _M_generator.seed(seed); }
+
+ double
+ twister_rand_gen::
+ get_prob()
+ {
+ const double min = _M_generator.min();
+ const double res = static_cast<const double>(_M_generator() - min);
+ const double range = static_cast<const double>(_M_generator.max() - min);
+ const double ret = res / range;
+ _GLIBCXX_DEBUG_ASSERT(ret >= 0 && ret <= 1);
+ return ret;
+ }
+
+ twister_rand_gen throw_allocator_base::_S_g;
+
+ throw_allocator_base::map_type
+ throw_allocator_base::_S_map;
+
+ double throw_allocator_base::_S_throw_prob;
+
+ size_t throw_allocator_base::_S_label = 0;
+
+ throw_allocator_base::entry_type
+ throw_allocator_base::make_entry(void* p, size_t size)
+ { return std::make_pair(p, alloc_data_type(_S_label, size)); }
+
+ void
+ throw_allocator_base::init(unsigned long seed)
+ { _S_g.init(seed); }
+
+ void
+ throw_allocator_base::set_throw_prob(double throw_prob)
+ { _S_throw_prob = throw_prob; }
+
+ double
+ throw_allocator_base::get_throw_prob()
+ { return _S_throw_prob; }
+
+ void
+ throw_allocator_base::set_label(size_t l)
+ { _S_label = l; }
+
+ void
+ throw_allocator_base::insert(void* p, size_t size)
+ {
+ const_iterator found_it = _S_map.find(p);
+ if (found_it != _S_map.end())
+ {
+ std::string error("throw_allocator_base::insert");
+ error += "double insert!";
+ error += '\n';
+ print_to_string(error, make_entry(p, size));
+ print_to_string(error, *found_it);
+ std::__throw_logic_error(error.c_str());
+ }
+ _S_map.insert(make_entry(p, size));
+ }
+
+ bool
+ throw_allocator_base::empty()
+ { return _S_map.empty(); }
+
+ void
+ throw_allocator_base::erase(void* p, size_t size)
+ {
+ check_allocated(p, size);
+ _S_map.erase(p);
+ }
+
+ void
+ throw_allocator_base::check_allocated(void* p, size_t size)
+ {
+ const_iterator found_it = _S_map.find(p);
+ if (found_it == _S_map.end())
+ {
+ std::string error("throw_allocator_base::check_allocated by value ");
+ error += "null erase!";
+ error += '\n';
+ print_to_string(error, make_entry(p, size));
+ std::__throw_logic_error(error.c_str());
+ }
+
+ if (found_it->second.second != size)
+ {
+ std::string error("throw_allocator_base::check_allocated by value ");
+ error += "wrong-size erase!";
+ error += '\n';
+ print_to_string(error, make_entry(p, size));
+ print_to_string(error, *found_it);
+ std::__throw_logic_error(error.c_str());
+ }
+ }
+
+ void
+ throw_allocator_base::check_allocated(size_t label)
+ {
+ std::string found;
+ const_iterator it = _S_map.begin();
+ while (it != _S_map.end())
+ {
+ if (it->second.first == label)
+ {
+ print_to_string(found, *it);
+ }
+ ++it;
+ }
+
+ if (!found.empty())
+ {
+ std::string error("throw_allocator_base::check_allocated by label ");
+ error += '\n';
+ error += found;
+ std::__throw_logic_error(error.c_str());
+ }
+ }
+
+ void
+ throw_allocator_base::throw_conditionally()
+ {
+ if (_S_g.get_prob() < _S_throw_prob)
+ __throw_forced_exception_error();
+ }
+
+ void
+ throw_allocator_base::print_to_string(std::string& s)
+ {
+ const_iterator begin = throw_allocator_base::_S_map.begin();
+ const_iterator end = throw_allocator_base::_S_map.end();
+ for (; begin != end; ++begin)
+ print_to_string(s, *begin);
+ }
+
+ void
+ throw_allocator_base::print_to_string(std::string& s, const_reference ref)
+ {
+ char buf[40];
+ const char tab('\t');
+ s += "address: ";
+ __builtin_sprintf(buf, "%p", ref.first);
+ s += buf;
+ s += tab;
+ s += "label: ";
+ unsigned long l = static_cast<unsigned long>(ref.second.first);
+ __builtin_sprintf(buf, "%lu", l);
+ s += buf;
+ s += tab;
+ s += "size: ";
+ l = static_cast<unsigned long>(ref.second.second);
+ __builtin_sprintf(buf, "%lu", l);
+ s += buf;
+ s += '\n';
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/type_traits.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/type_traits.h
new file mode 100644
index 0000000..b24ce4e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/type_traits.h
@@ -0,0 +1,204 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/type_traits.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _EXT_TYPE_TRAITS
+#define _EXT_TYPE_TRAITS 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/cpp_type_traits.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // Define a nested type if some predicate holds.
+ template<bool, typename>
+ struct __enable_if
+ { };
+
+ template<typename _Tp>
+ struct __enable_if<true, _Tp>
+ { typedef _Tp __type; };
+
+
+ // Conditional expression for types. If true, first, if false, second.
+ template<bool _Cond, typename _Iftrue, typename _Iffalse>
+ struct __conditional_type
+ { typedef _Iftrue __type; };
+
+ template<typename _Iftrue, typename _Iffalse>
+ struct __conditional_type<false, _Iftrue, _Iffalse>
+ { typedef _Iffalse __type; };
+
+
+ // Given an integral builtin type, return the corresponding unsigned type.
+ template<typename _Tp>
+ struct __add_unsigned
+ {
+ private:
+ typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
+
+ public:
+ typedef typename __if_type::__type __type;
+ };
+
+ template<>
+ struct __add_unsigned<char>
+ { typedef unsigned char __type; };
+
+ template<>
+ struct __add_unsigned<signed char>
+ { typedef unsigned char __type; };
+
+ template<>
+ struct __add_unsigned<short>
+ { typedef unsigned short __type; };
+
+ template<>
+ struct __add_unsigned<int>
+ { typedef unsigned int __type; };
+
+ template<>
+ struct __add_unsigned<long>
+ { typedef unsigned long __type; };
+
+ template<>
+ struct __add_unsigned<long long>
+ { typedef unsigned long long __type; };
+
+ // Declare but don't define.
+ template<>
+ struct __add_unsigned<bool>;
+
+ template<>
+ struct __add_unsigned<wchar_t>;
+
+
+ // Given an integral builtin type, return the corresponding signed type.
+ template<typename _Tp>
+ struct __remove_unsigned
+ {
+ private:
+ typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
+
+ public:
+ typedef typename __if_type::__type __type;
+ };
+
+ template<>
+ struct __remove_unsigned<char>
+ { typedef signed char __type; };
+
+ template<>
+ struct __remove_unsigned<unsigned char>
+ { typedef signed char __type; };
+
+ template<>
+ struct __remove_unsigned<unsigned short>
+ { typedef short __type; };
+
+ template<>
+ struct __remove_unsigned<unsigned int>
+ { typedef int __type; };
+
+ template<>
+ struct __remove_unsigned<unsigned long>
+ { typedef long __type; };
+
+ template<>
+ struct __remove_unsigned<unsigned long long>
+ { typedef long long __type; };
+
+ // Declare but don't define.
+ template<>
+ struct __remove_unsigned<bool>;
+
+ template<>
+ struct __remove_unsigned<wchar_t>;
+
+
+ // For use in string and vstring.
+ template<typename _Type>
+ inline bool
+ __is_null_pointer(_Type* __ptr)
+ { return __ptr == 0; }
+
+ template<typename _Type>
+ inline bool
+ __is_null_pointer(_Type)
+ { return false; }
+
+
+ // For complex and cmath
+ template<typename _Tp, bool = std::__is_integer<_Tp>::__value>
+ struct __promote
+ { typedef double __type; };
+
+ template<typename _Tp>
+ struct __promote<_Tp, false>
+ { typedef _Tp __type; };
+
+ template<typename _Tp, typename _Up>
+ struct __promote_2
+ {
+ private:
+ typedef typename __promote<_Tp>::__type __type1;
+ typedef typename __promote<_Up>::__type __type2;
+
+ public:
+ typedef __typeof__(__type1() + __type2()) __type;
+ };
+
+ template<typename _Tp, typename _Up, typename _Vp>
+ struct __promote_3
+ {
+ private:
+ typedef typename __promote<_Tp>::__type __type1;
+ typedef typename __promote<_Up>::__type __type2;
+ typedef typename __promote<_Vp>::__type __type3;
+
+ public:
+ typedef __typeof__(__type1() + __type2() + __type3()) __type;
+ };
+
+ template<typename _Tp, typename _Up, typename _Vp, typename _Wp>
+ struct __promote_4
+ {
+ private:
+ typedef typename __promote<_Tp>::__type __type1;
+ typedef typename __promote<_Up>::__type __type2;
+ typedef typename __promote<_Vp>::__type __type3;
+ typedef typename __promote<_Wp>::__type __type4;
+
+ public:
+ typedef __typeof__(__type1() + __type2() + __type3() + __type4()) __type;
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/typelist.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/typelist.h
new file mode 100644
index 0000000..ff1cac7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/typelist.h
@@ -0,0 +1,544 @@
+// -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
+
+// Permission to use, copy, modify, sell, and distribute this software
+// is hereby granted without fee, provided that the above copyright
+// notice appears in all copies, and that both that copyright notice and
+// this permission notice appear in supporting documentation. None of
+// the above authors, nor IBM Haifa Research Laboratories, make any
+// representation about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied warranty.
+
+/**
+ * @file typelist.h
+ * Contains typelist_chain definitions.
+ * Typelists are an idea by Andrei Alexandrescu.
+ */
+
+#ifndef _TYPELIST_H
+#define _TYPELIST_H 1
+
+#include <ext/type_traits.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+/** @namespace __gnu_cxx::typelist
+ * @brief GNU typelist extensions for public compile-time use.
+*/
+namespace typelist
+{
+ struct null_type { };
+
+ template<typename Root>
+ struct node
+ {
+ typedef Root root;
+ };
+
+ // Forward declarations of functors.
+ template<typename Hd, typename Typelist>
+ struct chain
+ {
+ typedef Hd head;
+ typedef Typelist tail;
+ };
+
+ // Apply all typelist types to unary functor.
+ template<typename Fn, typename Typelist>
+ void
+ apply(Fn&, Typelist);
+
+ /// Apply all typelist types to generator functor.
+ template<typename Gn, typename Typelist>
+ void
+ apply_generator(Gn&, Typelist);
+
+ // Apply all typelist types and values to generator functor.
+ template<typename Gn, typename TypelistT, typename TypelistV>
+ void
+ apply_generator(Gn&, TypelistT, TypelistV);
+
+ template<typename Typelist0, typename Typelist1>
+ struct append;
+
+ template<typename Typelist_Typelist>
+ struct append_typelist;
+
+ template<typename Typelist, typename T>
+ struct contains;
+
+ template<typename Typelist, template<typename T> class Pred>
+ struct filter;
+
+ template<typename Typelist, int i>
+ struct at_index;
+
+ template<typename Typelist, template<typename T> class Transform>
+ struct transform;
+
+ template<typename Typelist_Typelist>
+ struct flatten;
+
+ template<typename Typelist>
+ struct from_first;
+
+ template<typename T1>
+ struct create1;
+
+ template<typename T1, typename T2>
+ struct create2;
+
+ template<typename T1, typename T2, typename T3>
+ struct create3;
+
+ template<typename T1, typename T2, typename T3, typename T4>
+ struct create4;
+
+ template<typename T1, typename T2, typename T3, typename T4, typename T5>
+ struct create5;
+
+ template<typename T1, typename T2, typename T3,
+ typename T4, typename T5, typename T6>
+ struct create6;
+} // namespace typelist
+
+_GLIBCXX_END_NAMESPACE
+
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+namespace typelist
+{
+namespace detail
+{
+ template<typename Fn, typename Typelist_Chain>
+ struct apply_;
+
+ template<typename Fn, typename Hd, typename Tl>
+ struct apply_<Fn, chain<Hd, Tl> >
+ {
+ void
+ operator()(Fn& f)
+ {
+ f.operator()(Hd());
+ apply_<Fn, Tl> next;
+ next(f);
+ }
+ };
+
+ template<typename Fn>
+ struct apply_<Fn, null_type>
+ {
+ void
+ operator()(Fn&) { }
+ };
+
+ template<typename Gn, typename Typelist_Chain>
+ struct apply_generator1_;
+
+ template<typename Gn, typename Hd, typename Tl>
+ struct apply_generator1_<Gn, chain<Hd, Tl> >
+ {
+ void
+ operator()(Gn& g)
+ {
+ g.template operator()<Hd>();
+ apply_generator1_<Gn, Tl> next;
+ next(g);
+ }
+ };
+
+ template<typename Gn>
+ struct apply_generator1_<Gn, null_type>
+ {
+ void
+ operator()(Gn&) { }
+ };
+
+ template<typename Gn, typename TypelistT_Chain, typename TypelistV_Chain>
+ struct apply_generator2_;
+
+ template<typename Gn, typename Hd1, typename TlT, typename Hd2, typename TlV>
+ struct apply_generator2_<Gn, chain<Hd1, TlT>, chain<Hd2, TlV> >
+ {
+ void
+ operator()(Gn& g)
+ {
+ g.template operator()<Hd1, Hd2>();
+ apply_generator2_<Gn, TlT, TlV> next;
+ next(g);
+ }
+ };
+
+ template<typename Gn>
+ struct apply_generator2_<Gn, null_type, null_type>
+ {
+ void
+ operator()(Gn&) { }
+ };
+
+ template<typename Typelist_Chain0, typename Typelist_Chain1>
+ struct append_;
+
+ template<typename Hd, typename Tl, typename Typelist_Chain>
+ struct append_<chain<Hd, Tl>, Typelist_Chain>
+ {
+ private:
+ typedef append_<Tl, Typelist_Chain> append_type;
+
+ public:
+ typedef chain<Hd, typename append_type::type> type;
+ };
+
+ template<typename Typelist_Chain>
+ struct append_<null_type, Typelist_Chain>
+ {
+ typedef Typelist_Chain type;
+ };
+
+ template<typename Typelist_Chain>
+ struct append_<Typelist_Chain, null_type>
+ {
+ typedef Typelist_Chain type;
+ };
+
+ template<>
+ struct append_<null_type, null_type>
+ {
+ typedef null_type type;
+ };
+
+ template<typename Typelist_Typelist_Chain>
+ struct append_typelist_;
+
+ template<typename Hd>
+ struct append_typelist_<chain<Hd, null_type> >
+ {
+ typedef chain<Hd, null_type> type;
+ };
+
+ template<typename Hd, typename Tl>
+ struct append_typelist_<chain< Hd, Tl> >
+ {
+ private:
+ typedef typename append_typelist_<Tl>::type rest_type;
+
+ public:
+ typedef typename append<Hd, node<rest_type> >::type::root type;
+ };
+
+ template<typename Typelist_Chain, typename T>
+ struct contains_;
+
+ template<typename T>
+ struct contains_<null_type, T>
+ {
+ enum
+ {
+ value = false
+ };
+ };
+
+ template<typename Hd, typename Tl, typename T>
+ struct contains_<chain<Hd, Tl>, T>
+ {
+ enum
+ {
+ value = contains_<Tl, T>::value
+ };
+ };
+
+ template<typename Tl, typename T>
+ struct contains_<chain<T, Tl>, T>
+ {
+ enum
+ {
+ value = true
+ };
+ };
+
+ template<typename Typelist_Chain, template<typename T> class Pred>
+ struct chain_filter_;
+
+ template<template<typename T> class Pred>
+ struct chain_filter_<null_type, Pred>
+ {
+ typedef null_type type;
+ };
+
+ template<typename Hd, typename Tl, template<typename T> class Pred>
+ struct chain_filter_<chain<Hd, Tl>, Pred>
+ {
+ private:
+ enum
+ {
+ include_hd = Pred<Hd>::value
+ };
+
+ typedef typename chain_filter_<Tl, Pred>::type rest_type;
+ typedef chain<Hd, rest_type> chain_type;
+
+ public:
+ typedef typename __conditional_type<include_hd, chain_type, rest_type>::__type type;
+ };
+
+ template<typename Typelist_Chain, int i>
+ struct chain_at_index_;
+
+ template<typename Hd, typename Tl>
+ struct chain_at_index_<chain<Hd, Tl>, 0>
+ {
+ typedef Hd type;
+ };
+
+ template<typename Hd, typename Tl, int i>
+ struct chain_at_index_<chain<Hd, Tl>, i>
+ {
+ typedef typename chain_at_index_<Tl, i - 1>::type type;
+ };
+
+ template<class Typelist_Chain, template<typename T> class Transform>
+ struct chain_transform_;
+
+ template<template<typename T> class Transform>
+ struct chain_transform_<null_type, Transform>
+ {
+ typedef null_type type;
+ };
+
+ template<class Hd, class Tl, template<typename T> class Transform>
+ struct chain_transform_<chain<Hd, Tl>, Transform>
+ {
+ private:
+ typedef typename chain_transform_<Tl, Transform>::type rest_type;
+ typedef typename Transform<Hd>::type transform_type;
+
+ public:
+ typedef chain<transform_type, rest_type> type;
+ };
+
+ template<typename Typelist_Typelist_Chain>
+ struct chain_flatten_;
+
+ template<typename Hd_Tl>
+ struct chain_flatten_<chain<Hd_Tl, null_type> >
+ {
+ typedef typename Hd_Tl::root type;
+ };
+
+ template<typename Hd_Typelist, class Tl_Typelist>
+ struct chain_flatten_<chain<Hd_Typelist, Tl_Typelist> >
+ {
+ private:
+ typedef typename chain_flatten_<Tl_Typelist>::type rest_type;
+ typedef append<Hd_Typelist, node<rest_type> > append_type;
+ public:
+ typedef typename append_type::type::root type;
+ };
+} // namespace detail
+} // namespace typelist
+
+_GLIBCXX_END_NAMESPACE
+
+#define _GLIBCXX_TYPELIST_CHAIN1(X0) __gnu_cxx::typelist::chain<X0, __gnu_cxx::typelist::null_type>
+#define _GLIBCXX_TYPELIST_CHAIN2(X0, X1) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN1(X1) >
+#define _GLIBCXX_TYPELIST_CHAIN3(X0, X1, X2) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN2(X1, X2) >
+#define _GLIBCXX_TYPELIST_CHAIN4(X0, X1, X2, X3) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN3(X1, X2, X3) >
+#define _GLIBCXX_TYPELIST_CHAIN5(X0, X1, X2, X3, X4) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN4(X1, X2, X3, X4) >
+#define _GLIBCXX_TYPELIST_CHAIN6(X0, X1, X2, X3, X4, X5) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN5(X1, X2, X3, X4, X5) >
+#define _GLIBCXX_TYPELIST_CHAIN7(X0, X1, X2, X3, X4, X5, X6) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN6(X1, X2, X3, X4, X5, X6) >
+#define _GLIBCXX_TYPELIST_CHAIN8(X0, X1, X2, X3, X4, X5, X6, X7) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN7(X1, X2, X3, X4, X5, X6, X7) >
+#define _GLIBCXX_TYPELIST_CHAIN9(X0, X1, X2, X3, X4, X5, X6, X7, X8) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN8(X1, X2, X3, X4, X5, X6, X7, X8) >
+#define _GLIBCXX_TYPELIST_CHAIN10(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN9(X1, X2, X3, X4, X5, X6, X7, X8, X9) >
+#define _GLIBCXX_TYPELIST_CHAIN11(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN10(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) >
+#define _GLIBCXX_TYPELIST_CHAIN12(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN11(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) >
+#define _GLIBCXX_TYPELIST_CHAIN13(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN12(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) >
+#define _GLIBCXX_TYPELIST_CHAIN14(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN13(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) >
+#define _GLIBCXX_TYPELIST_CHAIN15(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN14(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) >
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+namespace typelist
+{
+ template<typename Fn, typename Typelist>
+ void
+ apply(Fn& fn, Typelist)
+ {
+ detail::apply_<Fn, typename Typelist::root> a;
+ a(fn);
+ }
+
+ template<typename Fn, typename Typelist>
+ void
+ apply_generator(Fn& fn, Typelist)
+ {
+ detail::apply_generator1_<Fn, typename Typelist::root> a;
+ a(fn);
+ }
+
+ template<typename Fn, typename TypelistT, typename TypelistV>
+ void
+ apply_generator(Fn& fn, TypelistT, TypelistV)
+ {
+ typedef typename TypelistT::root rootT;
+ typedef typename TypelistV::root rootV;
+ detail::apply_generator2_<Fn, rootT, rootV> a;
+ a(fn);
+ }
+
+ template<typename Typelist0, typename Typelist1>
+ struct append
+ {
+ private:
+ typedef typename Typelist0::root root0_type;
+ typedef typename Typelist1::root root1_type;
+ typedef detail::append_<root0_type, root1_type> append_type;
+
+ public:
+ typedef node<typename append_type::type> type;
+ };
+
+ template<typename Typelist_Typelist>
+ struct append_typelist
+ {
+ private:
+ typedef typename Typelist_Typelist::root root_type;
+ typedef detail::append_typelist_<root_type> append_type;
+
+ public:
+ typedef node<typename append_type::type> type;
+ };
+
+ template<typename Typelist, typename T>
+ struct contains
+ {
+ private:
+ typedef typename Typelist::root root_type;
+
+ public:
+ enum
+ {
+ value = detail::contains_<root_type, T>::value
+ };
+ };
+
+ template<typename Typelist, template<typename T> class Pred>
+ struct filter
+ {
+ private:
+ typedef typename Typelist::root root_type;
+ typedef detail::chain_filter_<root_type, Pred> filter_type;
+
+ public:
+ typedef node<typename filter_type::type> type;
+ };
+
+ template<typename Typelist, int i>
+ struct at_index
+ {
+ private:
+ typedef typename Typelist::root root_type;
+ typedef detail::chain_at_index_<root_type, i> index_type;
+
+ public:
+ typedef typename index_type::type type;
+ };
+
+ template<typename Typelist, template<typename T> class Transform>
+ struct transform
+ {
+ private:
+ typedef typename Typelist::root root_type;
+ typedef detail::chain_transform_<root_type, Transform> transform_type;
+
+ public:
+ typedef node<typename transform_type::type> type;
+ };
+
+ template<typename Typelist_Typelist>
+ struct flatten
+ {
+ private:
+ typedef typename Typelist_Typelist::root root_type;
+ typedef typename detail::chain_flatten_<root_type>::type flatten_type;
+
+ public:
+ typedef node<flatten_type> type;
+ };
+
+ template<typename Typelist>
+ struct from_first
+ {
+ private:
+ typedef typename at_index<Typelist, 0>::type first_type;
+
+ public:
+ typedef node<chain<first_type, null_type> > type;
+ };
+
+ template<typename T1>
+ struct create1
+ {
+ typedef node<_GLIBCXX_TYPELIST_CHAIN1(T1)> type;
+ };
+
+ template<typename T1, typename T2>
+ struct create2
+ {
+ typedef node<_GLIBCXX_TYPELIST_CHAIN2(T1,T2)> type;
+ };
+
+ template<typename T1, typename T2, typename T3>
+ struct create3
+ {
+ typedef node<_GLIBCXX_TYPELIST_CHAIN3(T1,T2,T3)> type;
+ };
+
+ template<typename T1, typename T2, typename T3, typename T4>
+ struct create4
+ {
+ typedef node<_GLIBCXX_TYPELIST_CHAIN4(T1,T2,T3,T4)> type;
+ };
+
+ template<typename T1, typename T2, typename T3,
+ typename T4, typename T5>
+ struct create5
+ {
+ typedef node<_GLIBCXX_TYPELIST_CHAIN5(T1,T2,T3,T4,T5)> type;
+ };
+
+ template<typename T1, typename T2, typename T3,
+ typename T4, typename T5, typename T6>
+ struct create6
+ {
+ typedef node<_GLIBCXX_TYPELIST_CHAIN6(T1,T2,T3,T4,T5,T6)> type;
+ };
+} // namespace typelist
+_GLIBCXX_END_NAMESPACE
+
+
+#endif
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/vstring.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/vstring.h
new file mode 100644
index 0000000..f15d6c6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/vstring.h
@@ -0,0 +1,2575 @@
+// Versatile string -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/vstring.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _VSTRING_H
+#define _VSTRING_H 1
+
+#pragma GCC system_header
+
+#include <initializer_list>
+#include <ext/vstring_util.h>
+#include <ext/rc_string_base.h>
+#include <ext/sso_string_base.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ /**
+ * @class __versa_string vstring.h
+ * @brief Managing sequences of characters and character-like objects.
+ */
+
+ // Template class __versa_string
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ class __versa_string
+ : private _Base<_CharT, _Traits, _Alloc>
+ {
+ typedef _Base<_CharT, _Traits, _Alloc> __vstring_base;
+ typedef typename __vstring_base::_CharT_alloc_type _CharT_alloc_type;
+
+ // Types:
+ public:
+ typedef _Traits traits_type;
+ typedef typename _Traits::char_type value_type;
+ typedef _Alloc allocator_type;
+ typedef typename _CharT_alloc_type::size_type size_type;
+ typedef typename _CharT_alloc_type::difference_type difference_type;
+ typedef typename _CharT_alloc_type::reference reference;
+ typedef typename _CharT_alloc_type::const_reference const_reference;
+ typedef typename _CharT_alloc_type::pointer pointer;
+ typedef typename _CharT_alloc_type::const_pointer const_pointer;
+ typedef __gnu_cxx::__normal_iterator<pointer, __versa_string> iterator;
+ typedef __gnu_cxx::__normal_iterator<const_pointer, __versa_string>
+ const_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+
+ // Data Member (public):
+ /// Value returned by various member functions when they fail.
+ static const size_type npos = static_cast<size_type>(-1);
+
+ private:
+ size_type
+ _M_check(size_type __pos, const char* __s) const
+ {
+ if (__pos > this->size())
+ std::__throw_out_of_range(__N(__s));
+ return __pos;
+ }
+
+ void
+ _M_check_length(size_type __n1, size_type __n2, const char* __s) const
+ {
+ if (this->max_size() - (this->size() - __n1) < __n2)
+ std::__throw_length_error(__N(__s));
+ }
+
+ // NB: _M_limit doesn't check for a bad __pos value.
+ size_type
+ _M_limit(size_type __pos, size_type __off) const
+ {
+ const bool __testoff = __off < this->size() - __pos;
+ return __testoff ? __off : this->size() - __pos;
+ }
+
+ // True if _Rep and source do not overlap.
+ bool
+ _M_disjunct(const _CharT* __s) const
+ {
+ return (std::less<const _CharT*>()(__s, this->_M_data())
+ || std::less<const _CharT*>()(this->_M_data()
+ + this->size(), __s));
+ }
+
+ // For the internal use we have functions similar to `begin'/`end'
+ // but they do not call _M_leak.
+ iterator
+ _M_ibegin() const
+ { return iterator(this->_M_data()); }
+
+ iterator
+ _M_iend() const
+ { return iterator(this->_M_data() + this->_M_length()); }
+
+ public:
+ // Construct/copy/destroy:
+ // NB: We overload ctors in some cases instead of using default
+ // arguments, per 17.4.4.4 para. 2 item 2.
+
+ /**
+ * @brief Default constructor creates an empty string.
+ */
+ __versa_string()
+ : __vstring_base() { }
+
+ /**
+ * @brief Construct an empty string using allocator @a a.
+ */
+ explicit
+ __versa_string(const _Alloc& __a)
+ : __vstring_base(__a) { }
+
+ // NB: per LWG issue 42, semantics different from IS:
+ /**
+ * @brief Construct string with copy of value of @a str.
+ * @param __str Source string.
+ */
+ __versa_string(const __versa_string& __str)
+ : __vstring_base(__str) { }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief String move constructor.
+ * @param __str Source string.
+ *
+ * The newly-constructed %string contains the exact contents of
+ * @a str. The contents of @a str are a valid, but unspecified
+ * string.
+ */
+ __versa_string(__versa_string&& __str)
+ : __vstring_base(std::forward<__vstring_base>(__str)) { }
+
+ /**
+ * @brief Construct string from an initializer list.
+ * @param __l std::initializer_list of characters.
+ * @param __a Allocator to use (default is default allocator).
+ */
+ __versa_string(std::initializer_list<_CharT> __l,
+ const _Alloc& __a = _Alloc())
+ : __vstring_base(__l.begin(), __l.end(), __a) { }
+#endif
+
+ /**
+ * @brief Construct string as copy of a substring.
+ * @param __str Source string.
+ * @param __pos Index of first character to copy from.
+ * @param __n Number of characters to copy (default remainder).
+ */
+ __versa_string(const __versa_string& __str, size_type __pos,
+ size_type __n = npos)
+ : __vstring_base(__str._M_data()
+ + __str._M_check(__pos,
+ "__versa_string::__versa_string"),
+ __str._M_data() + __str._M_limit(__pos, __n)
+ + __pos, _Alloc()) { }
+
+ /**
+ * @brief Construct string as copy of a substring.
+ * @param __str Source string.
+ * @param __pos Index of first character to copy from.
+ * @param __n Number of characters to copy.
+ * @param __a Allocator to use.
+ */
+ __versa_string(const __versa_string& __str, size_type __pos,
+ size_type __n, const _Alloc& __a)
+ : __vstring_base(__str._M_data()
+ + __str._M_check(__pos,
+ "__versa_string::__versa_string"),
+ __str._M_data() + __str._M_limit(__pos, __n)
+ + __pos, __a) { }
+
+ /**
+ * @brief Construct string initialized by a character array.
+ * @param __s Source character array.
+ * @param __n Number of characters to copy.
+ * @param __a Allocator to use (default is default allocator).
+ *
+ * NB: @a __s must have at least @a __n characters, '\\0' has no special
+ * meaning.
+ */
+ __versa_string(const _CharT* __s, size_type __n,
+ const _Alloc& __a = _Alloc())
+ : __vstring_base(__s, __s + __n, __a) { }
+
+ /**
+ * @brief Construct string as copy of a C string.
+ * @param __s Source C string.
+ * @param __a Allocator to use (default is default allocator).
+ */
+ __versa_string(const _CharT* __s, const _Alloc& __a = _Alloc())
+ : __vstring_base(__s, __s ? __s + traits_type::length(__s) :
+ __s + npos, __a) { }
+
+ /**
+ * @brief Construct string as multiple characters.
+ * @param __n Number of characters.
+ * @param __c Character to use.
+ * @param __a Allocator to use (default is default allocator).
+ */
+ __versa_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
+ : __vstring_base(__n, __c, __a) { }
+
+ /**
+ * @brief Construct string as copy of a range.
+ * @param __beg Start of range.
+ * @param __end End of range.
+ * @param __a Allocator to use (default is default allocator).
+ */
+ template<class _InputIterator>
+ __versa_string(_InputIterator __beg, _InputIterator __end,
+ const _Alloc& __a = _Alloc())
+ : __vstring_base(__beg, __end, __a) { }
+
+ /**
+ * @brief Destroy the string instance.
+ */
+ ~__versa_string() { }
+
+ /**
+ * @brief Assign the value of @a str to this string.
+ * @param __str Source string.
+ */
+ __versa_string&
+ operator=(const __versa_string& __str)
+ { return this->assign(__str); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief String move assignment operator.
+ * @param __str Source string.
+ *
+ * The contents of @a __str are moved into this string (without
+ * copying). @a __str is a valid, but unspecified string.
+ */
+ __versa_string&
+ operator=(__versa_string&& __str)
+ {
+ if (this != &__str)
+ this->swap(__str);
+ return *this;
+ }
+
+ /**
+ * @brief Set value to string constructed from initializer list.
+ * @param __l std::initializer_list.
+ */
+ __versa_string&
+ operator=(std::initializer_list<_CharT> __l)
+ {
+ this->assign(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+
+ /**
+ * @brief Copy contents of @a __s into this string.
+ * @param __s Source null-terminated string.
+ */
+ __versa_string&
+ operator=(const _CharT* __s)
+ { return this->assign(__s); }
+
+ /**
+ * @brief Set value to string of length 1.
+ * @param __c Source character.
+ *
+ * Assigning to a character makes this string length 1 and
+ * (*this)[0] == @a __c.
+ */
+ __versa_string&
+ operator=(_CharT __c)
+ {
+ this->assign(1, __c);
+ return *this;
+ }
+
+ // Iterators:
+ /**
+ * Returns a read/write iterator that points to the first character in
+ * the %string. Unshares the string.
+ */
+ iterator
+ begin()
+ {
+ this->_M_leak();
+ return iterator(this->_M_data());
+ }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * character in the %string.
+ */
+ const_iterator
+ begin() const
+ { return const_iterator(this->_M_data()); }
+
+ /**
+ * Returns a read/write iterator that points one past the last
+ * character in the %string. Unshares the string.
+ */
+ iterator
+ end()
+ {
+ this->_M_leak();
+ return iterator(this->_M_data() + this->size());
+ }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the
+ * last character in the %string.
+ */
+ const_iterator
+ end() const
+ { return const_iterator(this->_M_data() + this->size()); }
+
+ /**
+ * Returns a read/write reverse iterator that points to the last
+ * character in the %string. Iteration is done in reverse element
+ * order. Unshares the string.
+ */
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(this->end()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to the last character in the %string. Iteration is done in
+ * reverse element order.
+ */
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(this->end()); }
+
+ /**
+ * Returns a read/write reverse iterator that points to one before the
+ * first character in the %string. Iteration is done in reverse
+ * element order. Unshares the string.
+ */
+ reverse_iterator
+ rend()
+ { return reverse_iterator(this->begin()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to one before the first character in the %string. Iteration
+ * is done in reverse element order.
+ */
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(this->begin()); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * Returns a read-only (constant) iterator that points to the first
+ * character in the %string.
+ */
+ const_iterator
+ cbegin() const
+ { return const_iterator(this->_M_data()); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past the
+ * last character in the %string.
+ */
+ const_iterator
+ cend() const
+ { return const_iterator(this->_M_data() + this->size()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to the last character in the %string. Iteration is done in
+ * reverse element order.
+ */
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(this->end()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points
+ * to one before the first character in the %string. Iteration
+ * is done in reverse element order.
+ */
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(this->begin()); }
+#endif
+
+ public:
+ // Capacity:
+ /// Returns the number of characters in the string, not including any
+ /// null-termination.
+ size_type
+ size() const
+ { return this->_M_length(); }
+
+ /// Returns the number of characters in the string, not including any
+ /// null-termination.
+ size_type
+ length() const
+ { return this->_M_length(); }
+
+ /// Returns the size() of the largest possible %string.
+ size_type
+ max_size() const
+ { return this->_M_max_size(); }
+
+ /**
+ * @brief Resizes the %string to the specified number of characters.
+ * @param __n Number of characters the %string should contain.
+ * @param __c Character to fill any new elements.
+ *
+ * This function will %resize the %string to the specified
+ * number of characters. If the number is smaller than the
+ * %string's current size the %string is truncated, otherwise
+ * the %string is extended and new elements are set to @a __c.
+ */
+ void
+ resize(size_type __n, _CharT __c);
+
+ /**
+ * @brief Resizes the %string to the specified number of characters.
+ * @param __n Number of characters the %string should contain.
+ *
+ * This function will resize the %string to the specified
+ * length. If the new size is smaller than the %string's
+ * current size the %string is truncated, otherwise the %string
+ * is extended and new characters are default-constructed. For
+ * basic types such as char, this means setting them to 0.
+ */
+ void
+ resize(size_type __n)
+ { this->resize(__n, _CharT()); }
+
+ /**
+ * Returns the total number of characters that the %string can
+ * hold before needing to allocate more memory.
+ */
+ size_type
+ capacity() const
+ { return this->_M_capacity(); }
+
+ /**
+ * @brief Attempt to preallocate enough memory for specified number of
+ * characters.
+ * @param __res_arg Number of characters required.
+ * @throw std::length_error If @a __res_arg exceeds @c max_size().
+ *
+ * This function attempts to reserve enough memory for the
+ * %string to hold the specified number of characters. If the
+ * number requested is more than max_size(), length_error is
+ * thrown.
+ *
+ * The advantage of this function is that if optimal code is a
+ * necessity and the user can determine the string length that
+ * will be required, the user can reserve the memory in
+ * %advance, and thus prevent a possible reallocation of memory
+ * and copying of %string data.
+ */
+ void
+ reserve(size_type __res_arg = 0)
+ { this->_M_reserve(__res_arg); }
+
+ /**
+ * Erases the string, making it empty.
+ */
+ void
+ clear()
+ { this->_M_clear(); }
+
+ /**
+ * Returns true if the %string is empty. Equivalent to *this == "".
+ */
+ bool
+ empty() const
+ { return this->size() == 0; }
+
+ // Element access:
+ /**
+ * @brief Subscript access to the data contained in the %string.
+ * @param __pos The index of the character to access.
+ * @return Read-only (constant) reference to the character.
+ *
+ * This operator allows for easy, array-style, data access.
+ * Note that data access with this operator is unchecked and
+ * out_of_range lookups are not defined. (For checked lookups
+ * see at().)
+ */
+ const_reference
+ operator[] (size_type __pos) const
+ {
+ _GLIBCXX_DEBUG_ASSERT(__pos <= this->size());
+ return this->_M_data()[__pos];
+ }
+
+ /**
+ * @brief Subscript access to the data contained in the %string.
+ * @param __pos The index of the character to access.
+ * @return Read/write reference to the character.
+ *
+ * This operator allows for easy, array-style, data access.
+ * Note that data access with this operator is unchecked and
+ * out_of_range lookups are not defined. (For checked lookups
+ * see at().) Unshares the string.
+ */
+ reference
+ operator[](size_type __pos)
+ {
+ // allow pos == size() as v3 extension:
+ _GLIBCXX_DEBUG_ASSERT(__pos <= this->size());
+ // but be strict in pedantic mode:
+ _GLIBCXX_DEBUG_PEDASSERT(__pos < this->size());
+ this->_M_leak();
+ return this->_M_data()[__pos];
+ }
+
+ /**
+ * @brief Provides access to the data contained in the %string.
+ * @param __n The index of the character to access.
+ * @return Read-only (const) reference to the character.
+ * @throw std::out_of_range If @a __n is an invalid index.
+ *
+ * This function provides for safer data access. The parameter
+ * is first checked that it is in the range of the string. The
+ * function throws out_of_range if the check fails.
+ */
+ const_reference
+ at(size_type __n) const
+ {
+ if (__n >= this->size())
+ std::__throw_out_of_range(__N("__versa_string::at"));
+ return this->_M_data()[__n];
+ }
+
+ /**
+ * @brief Provides access to the data contained in the %string.
+ * @param __n The index of the character to access.
+ * @return Read/write reference to the character.
+ * @throw std::out_of_range If @a __n is an invalid index.
+ *
+ * This function provides for safer data access. The parameter
+ * is first checked that it is in the range of the string. The
+ * function throws out_of_range if the check fails. Success
+ * results in unsharing the string.
+ */
+ reference
+ at(size_type __n)
+ {
+ if (__n >= this->size())
+ std::__throw_out_of_range(__N("__versa_string::at"));
+ this->_M_leak();
+ return this->_M_data()[__n];
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * Returns a read/write reference to the data at the first
+ * element of the %string.
+ */
+ reference
+ front()
+ { return *begin(); }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the first
+ * element of the %string.
+ */
+ const_reference
+ front() const
+ { return *begin(); }
+
+ /**
+ * Returns a read/write reference to the data at the last
+ * element of the %string.
+ */
+ reference
+ back()
+ { return *(end() - 1); }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the
+ * last element of the %string.
+ */
+ const_reference
+ back() const
+ { return *(end() - 1); }
+#endif
+
+ // Modifiers:
+ /**
+ * @brief Append a string to this string.
+ * @param __str The string to append.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ operator+=(const __versa_string& __str)
+ { return this->append(__str); }
+
+ /**
+ * @brief Append a C string.
+ * @param __s The C string to append.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ operator+=(const _CharT* __s)
+ { return this->append(__s); }
+
+ /**
+ * @brief Append a character.
+ * @param __c The character to append.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ operator+=(_CharT __c)
+ {
+ this->push_back(__c);
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Append an initializer_list of characters.
+ * @param __l The initializer_list of characters to be appended.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ operator+=(std::initializer_list<_CharT> __l)
+ { return this->append(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ /**
+ * @brief Append a string to this string.
+ * @param __str The string to append.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ append(const __versa_string& __str)
+ { return _M_append(__str._M_data(), __str.size()); }
+
+ /**
+ * @brief Append a substring.
+ * @param __str The string to append.
+ * @param __pos Index of the first character of str to append.
+ * @param __n The number of characters to append.
+ * @return Reference to this string.
+ * @throw std::out_of_range if @a pos is not a valid index.
+ *
+ * This function appends @a __n characters from @a __str
+ * starting at @a __pos to this string. If @a __n is is larger
+ * than the number of available characters in @a __str, the
+ * remainder of @a __str is appended.
+ */
+ __versa_string&
+ append(const __versa_string& __str, size_type __pos, size_type __n)
+ { return _M_append(__str._M_data()
+ + __str._M_check(__pos, "__versa_string::append"),
+ __str._M_limit(__pos, __n)); }
+
+ /**
+ * @brief Append a C substring.
+ * @param __s The C string to append.
+ * @param __n The number of characters to append.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ append(const _CharT* __s, size_type __n)
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ _M_check_length(size_type(0), __n, "__versa_string::append");
+ return _M_append(__s, __n);
+ }
+
+ /**
+ * @brief Append a C string.
+ * @param __s The C string to append.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ append(const _CharT* __s)
+ {
+ __glibcxx_requires_string(__s);
+ const size_type __n = traits_type::length(__s);
+ _M_check_length(size_type(0), __n, "__versa_string::append");
+ return _M_append(__s, __n);
+ }
+
+ /**
+ * @brief Append multiple characters.
+ * @param __n The number of characters to append.
+ * @param __c The character to use.
+ * @return Reference to this string.
+ *
+ * Appends n copies of c to this string.
+ */
+ __versa_string&
+ append(size_type __n, _CharT __c)
+ { return _M_replace_aux(this->size(), size_type(0), __n, __c); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Append an initializer_list of characters.
+ * @param __l The initializer_list of characters to append.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ append(std::initializer_list<_CharT> __l)
+ { return this->append(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ /**
+ * @brief Append a range of characters.
+ * @param __first Iterator referencing the first character to append.
+ * @param __last Iterator marking the end of the range.
+ * @return Reference to this string.
+ *
+ * Appends characters in the range [first,last) to this string.
+ */
+ template<class _InputIterator>
+ __versa_string&
+ append(_InputIterator __first, _InputIterator __last)
+ { return this->replace(_M_iend(), _M_iend(), __first, __last); }
+
+ /**
+ * @brief Append a single character.
+ * @param __c Character to append.
+ */
+ void
+ push_back(_CharT __c)
+ {
+ const size_type __size = this->size();
+ if (__size + 1 > this->capacity() || this->_M_is_shared())
+ this->_M_mutate(__size, size_type(0), 0, size_type(1));
+ traits_type::assign(this->_M_data()[__size], __c);
+ this->_M_set_length(__size + 1);
+ }
+
+ /**
+ * @brief Set value to contents of another string.
+ * @param __str Source string to use.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ assign(const __versa_string& __str)
+ {
+ this->_M_assign(__str);
+ return *this;
+ }
+
+ /**
+ * @brief Set value to a substring of a string.
+ * @param __str The string to use.
+ * @param __pos Index of the first character of str.
+ * @param __n Number of characters to use.
+ * @return Reference to this string.
+ * @throw std::out_of_range if @a __pos is not a valid index.
+ *
+ * This function sets this string to the substring of @a __str
+ * consisting of @a __n characters at @a __pos. If @a __n is
+ * is larger than the number of available characters in @a
+ * __str, the remainder of @a __str is used.
+ */
+ __versa_string&
+ assign(const __versa_string& __str, size_type __pos, size_type __n)
+ { return _M_replace(size_type(0), this->size(), __str._M_data()
+ + __str._M_check(__pos, "__versa_string::assign"),
+ __str._M_limit(__pos, __n)); }
+
+ /**
+ * @brief Set value to a C substring.
+ * @param __s The C string to use.
+ * @param __n Number of characters to use.
+ * @return Reference to this string.
+ *
+ * This function sets the value of this string to the first @a
+ * __n characters of @a __s. If @a __n is is larger than the
+ * number of available characters in @a __s, the remainder of
+ * @a __s is used.
+ */
+ __versa_string&
+ assign(const _CharT* __s, size_type __n)
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ return _M_replace(size_type(0), this->size(), __s, __n);
+ }
+
+ /**
+ * @brief Set value to contents of a C string.
+ * @param __s The C string to use.
+ * @return Reference to this string.
+ *
+ * This function sets the value of this string to the value of
+ * @a __s. The data is copied, so there is no dependence on @a
+ * __s once the function returns.
+ */
+ __versa_string&
+ assign(const _CharT* __s)
+ {
+ __glibcxx_requires_string(__s);
+ return _M_replace(size_type(0), this->size(), __s,
+ traits_type::length(__s));
+ }
+
+ /**
+ * @brief Set value to multiple characters.
+ * @param __n Length of the resulting string.
+ * @param __c The character to use.
+ * @return Reference to this string.
+ *
+ * This function sets the value of this string to @a __n copies of
+ * character @a __c.
+ */
+ __versa_string&
+ assign(size_type __n, _CharT __c)
+ { return _M_replace_aux(size_type(0), this->size(), __n, __c); }
+
+ /**
+ * @brief Set value to a range of characters.
+ * @param __first Iterator referencing the first character to append.
+ * @param __last Iterator marking the end of the range.
+ * @return Reference to this string.
+ *
+ * Sets value of string to characters in the range
+ * [first,last).
+ */
+ template<class _InputIterator>
+ __versa_string&
+ assign(_InputIterator __first, _InputIterator __last)
+ { return this->replace(_M_ibegin(), _M_iend(), __first, __last); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Set value to an initializer_list of characters.
+ * @param __l The initializer_list of characters to assign.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ assign(std::initializer_list<_CharT> __l)
+ { return this->assign(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ /**
+ * @brief Insert multiple characters.
+ * @param __p Iterator referencing location in string to insert at.
+ * @param __n Number of characters to insert
+ * @param __c The character to insert.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Inserts @a __n copies of character @a __c starting at the
+ * position referenced by iterator @a __p. If adding
+ * characters causes the length to exceed max_size(),
+ * length_error is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ void
+ insert(iterator __p, size_type __n, _CharT __c)
+ { this->replace(__p, __p, __n, __c); }
+
+ /**
+ * @brief Insert a range of characters.
+ * @param __p Iterator referencing location in string to insert at.
+ * @param __beg Start of range.
+ * @param __end End of range.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Inserts characters in range [beg,end). If adding characters
+ * causes the length to exceed max_size(), length_error is
+ * thrown. The value of the string doesn't change if an error
+ * is thrown.
+ */
+ template<class _InputIterator>
+ void
+ insert(iterator __p, _InputIterator __beg, _InputIterator __end)
+ { this->replace(__p, __p, __beg, __end); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Insert an initializer_list of characters.
+ * @param __p Iterator referencing location in string to insert at.
+ * @param __l The initializer_list of characters to insert.
+ * @throw std::length_error If new length exceeds @c max_size().
+ */
+ void
+ insert(iterator __p, std::initializer_list<_CharT> __l)
+ { this->insert(__p, __l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ /**
+ * @brief Insert value of a string.
+ * @param __pos1 Iterator referencing location in string to insert at.
+ * @param __str The string to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Inserts value of @a __str starting at @a __pos1. If adding
+ * characters causes the length to exceed max_size(),
+ * length_error is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ __versa_string&
+ insert(size_type __pos1, const __versa_string& __str)
+ { return this->replace(__pos1, size_type(0),
+ __str._M_data(), __str.size()); }
+
+ /**
+ * @brief Insert a substring.
+ * @param __pos1 Iterator referencing location in string to insert at.
+ * @param __str The string to insert.
+ * @param __pos2 Start of characters in str to insert.
+ * @param __n Number of characters to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a __pos1 > size() or
+ * @a __pos2 > @a __str.size().
+ *
+ * Starting at @a __pos1, insert @a __n character of @a __str
+ * beginning with @a __pos2. If adding characters causes the
+ * length to exceed max_size(), length_error is thrown. If @a
+ * __pos1 is beyond the end of this string or @a __pos2 is
+ * beyond the end of @a __str, out_of_range is thrown. The
+ * value of the string doesn't change if an error is thrown.
+ */
+ __versa_string&
+ insert(size_type __pos1, const __versa_string& __str,
+ size_type __pos2, size_type __n)
+ { return this->replace(__pos1, size_type(0), __str._M_data()
+ + __str._M_check(__pos2, "__versa_string::insert"),
+ __str._M_limit(__pos2, __n)); }
+
+ /**
+ * @brief Insert a C substring.
+ * @param __pos Iterator referencing location in string to insert at.
+ * @param __s The C string to insert.
+ * @param __n The number of characters to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a __pos is beyond the end of this
+ * string.
+ *
+ * Inserts the first @a __n characters of @a __s starting at @a
+ * __pos. If adding characters causes the length to exceed
+ * max_size(), length_error is thrown. If @a __pos is beyond
+ * end(), out_of_range is thrown. The value of the string
+ * doesn't change if an error is thrown.
+ */
+ __versa_string&
+ insert(size_type __pos, const _CharT* __s, size_type __n)
+ { return this->replace(__pos, size_type(0), __s, __n); }
+
+ /**
+ * @brief Insert a C string.
+ * @param __pos Iterator referencing location in string to insert at.
+ * @param __s The C string to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a __pos is beyond the end of this
+ * string.
+ *
+ * Inserts the first @a __n characters of @a __s starting at @a
+ * __pos. If adding characters causes the length to exceed
+ * max_size(), length_error is thrown. If @a __pos is beyond
+ * end(), out_of_range is thrown. The value of the string
+ * doesn't change if an error is thrown.
+ */
+ __versa_string&
+ insert(size_type __pos, const _CharT* __s)
+ {
+ __glibcxx_requires_string(__s);
+ return this->replace(__pos, size_type(0), __s,
+ traits_type::length(__s));
+ }
+
+ /**
+ * @brief Insert multiple characters.
+ * @param __pos Index in string to insert at.
+ * @param __n Number of characters to insert
+ * @param __c The character to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ * @throw std::out_of_range If @a __pos is beyond the end of this
+ * string.
+ *
+ * Inserts @a __n copies of character @a __c starting at index
+ * @a __pos. If adding characters causes the length to exceed
+ * max_size(), length_error is thrown. If @a __pos > length(),
+ * out_of_range is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ __versa_string&
+ insert(size_type __pos, size_type __n, _CharT __c)
+ { return _M_replace_aux(_M_check(__pos, "__versa_string::insert"),
+ size_type(0), __n, __c); }
+
+ /**
+ * @brief Insert one character.
+ * @param __p Iterator referencing position in string to insert at.
+ * @param __c The character to insert.
+ * @return Iterator referencing newly inserted char.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Inserts character @a __c at position referenced by @a __p.
+ * If adding character causes the length to exceed max_size(),
+ * length_error is thrown. If @a __p is beyond end of string,
+ * out_of_range is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ iterator
+ insert(iterator __p, _CharT __c)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(__p >= _M_ibegin() && __p <= _M_iend());
+ const size_type __pos = __p - _M_ibegin();
+ _M_replace_aux(__pos, size_type(0), size_type(1), __c);
+ this->_M_set_leaked();
+ return iterator(this->_M_data() + __pos);
+ }
+
+ /**
+ * @brief Remove characters.
+ * @param __pos Index of first character to remove (default 0).
+ * @param __n Number of characters to remove (default remainder).
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a __pos is beyond the end of this
+ * string.
+ *
+ * Removes @a __n characters from this string starting at @a
+ * __pos. The length of the string is reduced by @a __n. If
+ * there are < @a __n characters to remove, the remainder of
+ * the string is truncated. If @a __p is beyond end of string,
+ * out_of_range is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ __versa_string&
+ erase(size_type __pos = 0, size_type __n = npos)
+ {
+ this->_M_erase(_M_check(__pos, "__versa_string::erase"),
+ _M_limit(__pos, __n));
+ return *this;
+ }
+
+ /**
+ * @brief Remove one character.
+ * @param __position Iterator referencing the character to remove.
+ * @return iterator referencing same location after removal.
+ *
+ * Removes the character at @a __position from this string. The
+ * value of the string doesn't change if an error is thrown.
+ */
+ iterator
+ erase(iterator __position)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(__position >= _M_ibegin()
+ && __position < _M_iend());
+ const size_type __pos = __position - _M_ibegin();
+ this->_M_erase(__pos, size_type(1));
+ this->_M_set_leaked();
+ return iterator(this->_M_data() + __pos);
+ }
+
+ /**
+ * @brief Remove a range of characters.
+ * @param __first Iterator referencing the first character to remove.
+ * @param __last Iterator referencing the end of the range.
+ * @return Iterator referencing location of first after removal.
+ *
+ * Removes the characters in the range [first,last) from this
+ * string. The value of the string doesn't change if an error
+ * is thrown.
+ */
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(__first >= _M_ibegin() && __first <= __last
+ && __last <= _M_iend());
+ const size_type __pos = __first - _M_ibegin();
+ this->_M_erase(__pos, __last - __first);
+ this->_M_set_leaked();
+ return iterator(this->_M_data() + __pos);
+ }
+
+ /**
+ * @brief Replace characters with value from another string.
+ * @param __pos Index of first character to replace.
+ * @param __n Number of characters to be replaced.
+ * @param __str String to insert.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a __pos is beyond the end of this
+ * string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos,pos+n) from this
+ * string. In place, the value of @a __str is inserted. If @a
+ * __pos is beyond end of string, out_of_range is thrown. If
+ * the length of the result exceeds max_size(), length_error is
+ * thrown. The value of the string doesn't change if an error
+ * is thrown.
+ */
+ __versa_string&
+ replace(size_type __pos, size_type __n, const __versa_string& __str)
+ { return this->replace(__pos, __n, __str._M_data(), __str.size()); }
+
+ /**
+ * @brief Replace characters with value from another string.
+ * @param __pos1 Index of first character to replace.
+ * @param __n1 Number of characters to be replaced.
+ * @param __str String to insert.
+ * @param __pos2 Index of first character of str to use.
+ * @param __n2 Number of characters from str to use.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a __pos1 > size() or @a __pos2 >
+ * str.size().
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos1,pos1 + n) from
+ * this string. In place, the value of @a __str is inserted.
+ * If @a __pos is beyond end of string, out_of_range is thrown.
+ * If the length of the result exceeds max_size(), length_error
+ * is thrown. The value of the string doesn't change if an
+ * error is thrown.
+ */
+ __versa_string&
+ replace(size_type __pos1, size_type __n1, const __versa_string& __str,
+ size_type __pos2, size_type __n2)
+ {
+ return this->replace(__pos1, __n1, __str._M_data()
+ + __str._M_check(__pos2,
+ "__versa_string::replace"),
+ __str._M_limit(__pos2, __n2));
+ }
+
+ /**
+ * @brief Replace characters with value of a C substring.
+ * @param __pos Index of first character to replace.
+ * @param __n1 Number of characters to be replaced.
+ * @param __s C string to insert.
+ * @param __n2 Number of characters from @a __s to use.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a __pos1 > size().
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos,pos + n1) from this
+ * string. In place, the first @a __n2 characters of @a __s
+ * are inserted, or all of @a __s if @a __n2 is too large. If
+ * @a __pos is beyond end of string, out_of_range is thrown.
+ * If the length of result exceeds max_size(), length_error is
+ * thrown. The value of the string doesn't change if an error
+ * is thrown.
+ */
+ __versa_string&
+ replace(size_type __pos, size_type __n1, const _CharT* __s,
+ size_type __n2)
+ {
+ __glibcxx_requires_string_len(__s, __n2);
+ return _M_replace(_M_check(__pos, "__versa_string::replace"),
+ _M_limit(__pos, __n1), __s, __n2);
+ }
+
+ /**
+ * @brief Replace characters with value of a C string.
+ * @param __pos Index of first character to replace.
+ * @param __n1 Number of characters to be replaced.
+ * @param __s C string to insert.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a __pos > size().
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos,pos + n1) from this
+ * string. In place, the first @a __n characters of @a __s are
+ * inserted. If @a pos is beyond end of string, out_of_range
+ * is thrown. If the length of result exceeds max_size(),
+ * length_error is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ __versa_string&
+ replace(size_type __pos, size_type __n1, const _CharT* __s)
+ {
+ __glibcxx_requires_string(__s);
+ return this->replace(__pos, __n1, __s, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Replace characters with multiple characters.
+ * @param __pos Index of first character to replace.
+ * @param __n1 Number of characters to be replaced.
+ * @param __n2 Number of characters to insert.
+ * @param __c Character to insert.
+ * @return Reference to this string.
+ * @throw std::out_of_range If @a __pos > size().
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [pos,pos + n1) from this
+ * string. In place, @a __n2 copies of @a __c are inserted.
+ * If @a __pos is beyond end of string, out_of_range is thrown.
+ * If the length of result exceeds max_size(), length_error is
+ * thrown. The value of the string doesn't change if an error
+ * is thrown.
+ */
+ __versa_string&
+ replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
+ { return _M_replace_aux(_M_check(__pos, "__versa_string::replace"),
+ _M_limit(__pos, __n1), __n2, __c); }
+
+ /**
+ * @brief Replace range of characters with string.
+ * @param __i1 Iterator referencing start of range to replace.
+ * @param __i2 Iterator referencing end of range to replace.
+ * @param __str String value to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, the
+ * value of @a __str is inserted. If the length of result
+ * exceeds max_size(), length_error is thrown. The value of
+ * the string doesn't change if an error is thrown.
+ */
+ __versa_string&
+ replace(iterator __i1, iterator __i2, const __versa_string& __str)
+ { return this->replace(__i1, __i2, __str._M_data(), __str.size()); }
+
+ /**
+ * @brief Replace range of characters with C substring.
+ * @param __i1 Iterator referencing start of range to replace.
+ * @param __i2 Iterator referencing end of range to replace.
+ * @param __s C string value to insert.
+ * @param __n Number of characters from s to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, the
+ * first @a n characters of @a __s are inserted. If the length
+ * of result exceeds max_size(), length_error is thrown. The
+ * value of the string doesn't change if an error is thrown.
+ */
+ __versa_string&
+ replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1, __s, __n);
+ }
+
+ /**
+ * @brief Replace range of characters with C string.
+ * @param __i1 Iterator referencing start of range to replace.
+ * @param __i2 Iterator referencing end of range to replace.
+ * @param __s C string value to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, the
+ * characters of @a __s are inserted. If the length of result
+ * exceeds max_size(), length_error is thrown. The value of
+ * the string doesn't change if an error is thrown.
+ */
+ __versa_string&
+ replace(iterator __i1, iterator __i2, const _CharT* __s)
+ {
+ __glibcxx_requires_string(__s);
+ return this->replace(__i1, __i2, __s, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Replace range of characters with multiple characters
+ * @param __i1 Iterator referencing start of range to replace.
+ * @param __i2 Iterator referencing end of range to replace.
+ * @param __n Number of characters to insert.
+ * @param __c Character to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, @a
+ * __n copies of @a __c are inserted. If the length of result
+ * exceeds max_size(), length_error is thrown. The value of
+ * the string doesn't change if an error is thrown.
+ */
+ __versa_string&
+ replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __c);
+ }
+
+ /**
+ * @brief Replace range of characters with range.
+ * @param __i1 Iterator referencing start of range to replace.
+ * @param __i2 Iterator referencing end of range to replace.
+ * @param __k1 Iterator referencing start of range to insert.
+ * @param __k2 Iterator referencing end of range to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place,
+ * characters in the range [k1,k2) are inserted. If the length
+ * of result exceeds max_size(), length_error is thrown. The
+ * value of the string doesn't change if an error is thrown.
+ */
+ template<class _InputIterator>
+ __versa_string&
+ replace(iterator __i1, iterator __i2,
+ _InputIterator __k1, _InputIterator __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ typedef typename std::__is_integer<_InputIterator>::__type _Integral;
+ return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral());
+ }
+
+ // Specializations for the common case of pointer and iterator:
+ // useful to avoid the overhead of temporary buffering in _M_replace.
+ __versa_string&
+ replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1, __k2 - __k1);
+ }
+
+ __versa_string&
+ replace(iterator __i1, iterator __i2,
+ const _CharT* __k1, const _CharT* __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1, __k2 - __k1);
+ }
+
+ __versa_string&
+ replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1.base(), __k2 - __k1);
+ }
+
+ __versa_string&
+ replace(iterator __i1, iterator __i2,
+ const_iterator __k1, const_iterator __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1.base(), __k2 - __k1);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Replace range of characters with initializer_list.
+ * @param __i1 Iterator referencing start of range to replace.
+ * @param __i2 Iterator referencing end of range to replace.
+ * @param __l The initializer_list of characters to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place,
+ * characters in the range [k1,k2) are inserted. If the length
+ * of result exceeds max_size(), length_error is thrown. The
+ * value of the string doesn't change if an error is thrown.
+ */
+ __versa_string& replace(iterator __i1, iterator __i2,
+ std::initializer_list<_CharT> __l)
+ { return this->replace(__i1, __i2, __l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+ private:
+ template<class _Integer>
+ __versa_string&
+ _M_replace_dispatch(iterator __i1, iterator __i2, _Integer __n,
+ _Integer __val, std::__true_type)
+ { return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __val); }
+
+ template<class _InputIterator>
+ __versa_string&
+ _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
+ _InputIterator __k2, std::__false_type);
+
+ __versa_string&
+ _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
+ _CharT __c);
+
+ __versa_string&
+ _M_replace(size_type __pos, size_type __len1, const _CharT* __s,
+ const size_type __len2);
+
+ __versa_string&
+ _M_append(const _CharT* __s, size_type __n);
+
+ public:
+
+ /**
+ * @brief Copy substring into C string.
+ * @param __s C string to copy value into.
+ * @param __n Number of characters to copy.
+ * @param __pos Index of first character to copy.
+ * @return Number of characters actually copied
+ * @throw std::out_of_range If pos > size().
+ *
+ * Copies up to @a __n characters starting at @a __pos into the
+ * C string @a s. If @a __pos is greater than size(),
+ * out_of_range is thrown.
+ */
+ size_type
+ copy(_CharT* __s, size_type __n, size_type __pos = 0) const;
+
+ /**
+ * @brief Swap contents with another string.
+ * @param __s String to swap with.
+ *
+ * Exchanges the contents of this string with that of @a __s in
+ * constant time.
+ */
+ void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ swap(__versa_string&& __s)
+#else
+ swap(__versa_string& __s)
+#endif
+ { this->_M_swap(__s); }
+
+ // String operations:
+ /**
+ * @brief Return const pointer to null-terminated contents.
+ *
+ * This is a handle to internal data. Do not modify or dire things may
+ * happen.
+ */
+ const _CharT*
+ c_str() const
+ { return this->_M_data(); }
+
+ /**
+ * @brief Return const pointer to contents.
+ *
+ * This is a handle to internal data. Do not modify or dire things may
+ * happen.
+ */
+ const _CharT*
+ data() const
+ { return this->_M_data(); }
+
+ /**
+ * @brief Return copy of allocator used to construct this string.
+ */
+ allocator_type
+ get_allocator() const
+ { return allocator_type(this->_M_get_allocator()); }
+
+ /**
+ * @brief Find position of a C substring.
+ * @param __s C string to locate.
+ * @param __pos Index of character to search from.
+ * @param __n Number of characters from @a __s to search for.
+ * @return Index of start of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for the first @a
+ * __n characters in @a __s within this string. If found,
+ * returns the index where it begins. If not found, returns
+ * npos.
+ */
+ size_type
+ find(const _CharT* __s, size_type __pos, size_type __n) const;
+
+ /**
+ * @brief Find position of a string.
+ * @param __str String to locate.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of start of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for value of @a
+ * __str within this string. If found, returns the index where
+ * it begins. If not found, returns npos.
+ */
+ size_type
+ find(const __versa_string& __str, size_type __pos = 0) const
+ { return this->find(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find position of a C string.
+ * @param __s C string to locate.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of start of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for the value of @a
+ * __s within this string. If found, returns the index where
+ * it begins. If not found, returns npos.
+ */
+ size_type
+ find(const _CharT* __s, size_type __pos = 0) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->find(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find position of a character.
+ * @param __c Character to locate.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for @a __c within
+ * this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
+ size_type
+ find(_CharT __c, size_type __pos = 0) const;
+
+ /**
+ * @brief Find last position of a string.
+ * @param __str String to locate.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of start of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for value of @a
+ * __str within this string. If found, returns the index where
+ * it begins. If not found, returns npos.
+ */
+ size_type
+ rfind(const __versa_string& __str, size_type __pos = npos) const
+ { return this->rfind(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find last position of a C substring.
+ * @param __s C string to locate.
+ * @param __pos Index of character to search back from.
+ * @param __n Number of characters from s to search for.
+ * @return Index of start of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for the first @a
+ * __n characters in @a __s within this string. If found,
+ * returns the index where it begins. If not found, returns
+ * npos.
+ */
+ size_type
+ rfind(const _CharT* __s, size_type __pos, size_type __n) const;
+
+ /**
+ * @brief Find last position of a C string.
+ * @param __s C string to locate.
+ * @param __pos Index of character to start search at (default end).
+ * @return Index of start of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for the value of
+ * @a __s within this string. If found, returns the index
+ * where it begins. If not found, returns npos.
+ */
+ size_type
+ rfind(const _CharT* __s, size_type __pos = npos) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->rfind(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find last position of a character.
+ * @param __c Character to locate.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for @a __c within
+ * this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
+ size_type
+ rfind(_CharT __c, size_type __pos = npos) const;
+
+ /**
+ * @brief Find position of a character of string.
+ * @param __str String containing characters to locate.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for one of the characters of
+ * @a __str within this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
+ size_type
+ find_first_of(const __versa_string& __str, size_type __pos = 0) const
+ { return this->find_first_of(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find position of a character of C substring.
+ * @param __s String containing characters to locate.
+ * @param __pos Index of character to search from.
+ * @param __n Number of characters from s to search for.
+ * @return Index of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for one of the
+ * first @a __n characters of @a __s within this string. If
+ * found, returns the index where it was found. If not found,
+ * returns npos.
+ */
+ size_type
+ find_first_of(const _CharT* __s, size_type __pos, size_type __n) const;
+
+ /**
+ * @brief Find position of a character of C string.
+ * @param __s String containing characters to locate.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for one of the
+ * characters of @a __s within this string. If found, returns
+ * the index where it was found. If not found, returns npos.
+ */
+ size_type
+ find_first_of(const _CharT* __s, size_type __pos = 0) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->find_first_of(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find position of a character.
+ * @param __c Character to locate.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for the character
+ * @a __c within this string. If found, returns the index
+ * where it was found. If not found, returns npos.
+ *
+ * Note: equivalent to find(c, pos).
+ */
+ size_type
+ find_first_of(_CharT __c, size_type __pos = 0) const
+ { return this->find(__c, __pos); }
+
+ /**
+ * @brief Find last position of a character of string.
+ * @param __str String containing characters to locate.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for one of the
+ * characters of @a __str within this string. If found,
+ * returns the index where it was found. If not found, returns
+ * npos.
+ */
+ size_type
+ find_last_of(const __versa_string& __str, size_type __pos = npos) const
+ { return this->find_last_of(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find last position of a character of C substring.
+ * @param __s C string containing characters to locate.
+ * @param __pos Index of character to search back from.
+ * @param __n Number of characters from s to search for.
+ * @return Index of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for one of the
+ * first @a __n characters of @a __s within this string. If
+ * found, returns the index where it was found. If not found,
+ * returns npos.
+ */
+ size_type
+ find_last_of(const _CharT* __s, size_type __pos, size_type __n) const;
+
+ /**
+ * @brief Find last position of a character of C string.
+ * @param __s C string containing characters to locate.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for one of the
+ * characters of @a __s within this string. If found, returns
+ * the index where it was found. If not found, returns npos.
+ */
+ size_type
+ find_last_of(const _CharT* __s, size_type __pos = npos) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->find_last_of(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find last position of a character.
+ * @param __c Character to locate.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for @a __c within
+ * this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ *
+ * Note: equivalent to rfind(c, pos).
+ */
+ size_type
+ find_last_of(_CharT __c, size_type __pos = npos) const
+ { return this->rfind(__c, __pos); }
+
+ /**
+ * @brief Find position of a character not in string.
+ * @param __str String containing characters to avoid.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for a character not
+ * contained in @a __str within this string. If found, returns
+ * the index where it was found. If not found, returns npos.
+ */
+ size_type
+ find_first_not_of(const __versa_string& __str, size_type __pos = 0) const
+ { return this->find_first_not_of(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find position of a character not in C substring.
+ * @param __s C string containing characters to avoid.
+ * @param __pos Index of character to search from.
+ * @param __n Number of characters from s to consider.
+ * @return Index of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for a character not
+ * contained in the first @a __n characters of @a __s within
+ * this string. If found, returns the index where it was
+ * found. If not found, returns npos.
+ */
+ size_type
+ find_first_not_of(const _CharT* __s, size_type __pos,
+ size_type __n) const;
+
+ /**
+ * @brief Find position of a character not in C string.
+ * @param __s C string containing characters to avoid.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for a character not
+ * contained in @a __s within this string. If found, returns
+ * the index where it was found. If not found, returns npos.
+ */
+ size_type
+ find_first_not_of(const _CharT* __s, size_type __pos = 0) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->find_first_not_of(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find position of a different character.
+ * @param __c Character to avoid.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ *
+ * Starting from @a __pos, searches forward for a character
+ * other than @a __c within this string. If found, returns the
+ * index where it was found. If not found, returns npos.
+ */
+ size_type
+ find_first_not_of(_CharT __c, size_type __pos = 0) const;
+
+ /**
+ * @brief Find last position of a character not in string.
+ * @param __str String containing characters to avoid.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for a character
+ * not contained in @a __str within this string. If found,
+ * returns the index where it was found. If not found, returns
+ * npos.
+ */
+ size_type
+ find_last_not_of(const __versa_string& __str,
+ size_type __pos = npos) const
+ { return this->find_last_not_of(__str.data(), __pos, __str.size()); }
+
+ /**
+ * @brief Find last position of a character not in C substring.
+ * @param __s C string containing characters to avoid.
+ * @param __pos Index of character to search back from.
+ * @param __n Number of characters from s to consider.
+ * @return Index of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for a character
+ * not contained in the first @a __n characters of @a __s
+ * within this string. If found, returns the index where it
+ * was found. If not found, returns npos.
+ */
+ size_type
+ find_last_not_of(const _CharT* __s, size_type __pos,
+ size_type __n) const;
+ /**
+ * @brief Find last position of a character not in C string.
+ * @param __s C string containing characters to avoid.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for a character
+ * not contained in @a __s within this string. If found,
+ * returns the index where it was found. If not found, returns
+ * npos.
+ */
+ size_type
+ find_last_not_of(const _CharT* __s, size_type __pos = npos) const
+ {
+ __glibcxx_requires_string(__s);
+ return this->find_last_not_of(__s, __pos, traits_type::length(__s));
+ }
+
+ /**
+ * @brief Find last position of a different character.
+ * @param __c Character to avoid.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ *
+ * Starting from @a __pos, searches backward for a character
+ * other than @a __c within this string. If found, returns the
+ * index where it was found. If not found, returns npos.
+ */
+ size_type
+ find_last_not_of(_CharT __c, size_type __pos = npos) const;
+
+ /**
+ * @brief Get a substring.
+ * @param __pos Index of first character (default 0).
+ * @param __n Number of characters in substring (default remainder).
+ * @return The new string.
+ * @throw std::out_of_range If pos > size().
+ *
+ * Construct and return a new string using the @a __n
+ * characters starting at @a __pos. If the string is too
+ * short, use the remainder of the characters. If @a __pos is
+ * beyond the end of the string, out_of_range is thrown.
+ */
+ __versa_string
+ substr(size_type __pos = 0, size_type __n = npos) const
+ {
+ return __versa_string(*this, _M_check(__pos, "__versa_string::substr"),
+ __n);
+ }
+
+ /**
+ * @brief Compare to a string.
+ * @param __str String to compare against.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Returns an integer < 0 if this string is ordered before @a
+ * __str, 0 if their values are equivalent, or > 0 if this
+ * string is ordered after @a __str. Determines the effective
+ * length rlen of the strings to compare as the smallest of
+ * size() and str.size(). The function then compares the two
+ * strings by calling traits::compare(data(), str.data(),rlen).
+ * If the result of the comparison is nonzero returns it,
+ * otherwise the shorter one is ordered first.
+ */
+ int
+ compare(const __versa_string& __str) const
+ {
+ if (this->_M_compare(__str))
+ return 0;
+
+ const size_type __size = this->size();
+ const size_type __osize = __str.size();
+ const size_type __len = std::min(__size, __osize);
+
+ int __r = traits_type::compare(this->_M_data(), __str.data(), __len);
+ if (!__r)
+ __r = _S_compare(__size, __osize);
+ return __r;
+ }
+
+ /**
+ * @brief Compare substring to a string.
+ * @param __pos Index of first character of substring.
+ * @param __n Number of characters in substring.
+ * @param __str String to compare against.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Form the substring of this string from the @a __n characters
+ * starting at @a __pos. Returns an integer < 0 if the
+ * substring is ordered before @a __str, 0 if their values are
+ * equivalent, or > 0 if the substring is ordered after @a
+ * __str. Determines the effective length rlen of the strings
+ * to compare as the smallest of the length of the substring
+ * and @a __str.size(). The function then compares the two
+ * strings by calling
+ * traits::compare(substring.data(),str.data(),rlen). If the
+ * result of the comparison is nonzero returns it, otherwise
+ * the shorter one is ordered first.
+ */
+ int
+ compare(size_type __pos, size_type __n,
+ const __versa_string& __str) const;
+
+ /**
+ * @brief Compare substring to a substring.
+ * @param __pos1 Index of first character of substring.
+ * @param __n1 Number of characters in substring.
+ * @param __str String to compare against.
+ * @param __pos2 Index of first character of substring of str.
+ * @param __n2 Number of characters in substring of str.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Form the substring of this string from the @a __n1
+ * characters starting at @a __pos1. Form the substring of @a
+ * __str from the @a __n2 characters starting at @a __pos2.
+ * Returns an integer < 0 if this substring is ordered before
+ * the substring of @a __str, 0 if their values are equivalent,
+ * or > 0 if this substring is ordered after the substring of
+ * @a __str. Determines the effective length rlen of the
+ * strings to compare as the smallest of the lengths of the
+ * substrings. The function then compares the two strings by
+ * calling
+ * traits::compare(substring.data(),str.substr(pos2,n2).data(),rlen).
+ * If the result of the comparison is nonzero returns it,
+ * otherwise the shorter one is ordered first.
+ */
+ int
+ compare(size_type __pos1, size_type __n1, const __versa_string& __str,
+ size_type __pos2, size_type __n2) const;
+
+ /**
+ * @brief Compare to a C string.
+ * @param __s C string to compare against.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Returns an integer < 0 if this string is ordered before @a
+ * __s, 0 if their values are equivalent, or > 0 if this string
+ * is ordered after @a __s. Determines the effective length
+ * rlen of the strings to compare as the smallest of size() and
+ * the length of a string constructed from @a __s. The
+ * function then compares the two strings by calling
+ * traits::compare(data(),s,rlen). If the result of the
+ * comparison is nonzero returns it, otherwise the shorter one
+ * is ordered first.
+ */
+ int
+ compare(const _CharT* __s) const;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 5 String::compare specification questionable
+ /**
+ * @brief Compare substring to a C string.
+ * @param __pos Index of first character of substring.
+ * @param __n1 Number of characters in substring.
+ * @param __s C string to compare against.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Form the substring of this string from the @a __n1
+ * characters starting at @a __pos. Returns an integer < 0 if
+ * the substring is ordered before @a __s, 0 if their values
+ * are equivalent, or > 0 if the substring is ordered after @a
+ * __s. Determines the effective length rlen of the strings to
+ * compare as the smallest of the length of the substring and
+ * the length of a string constructed from @a __s. The
+ * function then compares the two string by calling
+ * traits::compare(substring.data(),s,rlen). If the result of
+ * the comparison is nonzero returns it, otherwise the shorter
+ * one is ordered first.
+ */
+ int
+ compare(size_type __pos, size_type __n1, const _CharT* __s) const;
+
+ /**
+ * @brief Compare substring against a character array.
+ * @param __pos1 Index of first character of substring.
+ * @param __n1 Number of characters in substring.
+ * @param __s character array to compare against.
+ * @param __n2 Number of characters of s.
+ * @return Integer < 0, 0, or > 0.
+ *
+ * Form the substring of this string from the @a __n1
+ * characters starting at @a __pos1. Form a string from the
+ * first @a __n2 characters of @a __s. Returns an integer < 0
+ * if this substring is ordered before the string from @a __s,
+ * 0 if their values are equivalent, or > 0 if this substring
+ * is ordered after the string from @a __s. Determines the
+ * effective length rlen of the strings to compare as the
+ * smallest of the length of the substring and @a __n2. The
+ * function then compares the two strings by calling
+ * traits::compare(substring.data(),s,rlen). If the result of
+ * the comparison is nonzero returns it, otherwise the shorter
+ * one is ordered first.
+ *
+ * NB: s must have at least n2 characters, '\\0' has no special
+ * meaning.
+ */
+ int
+ compare(size_type __pos, size_type __n1, const _CharT* __s,
+ size_type __n2) const;
+ };
+
+ // operator+
+ /**
+ * @brief Concatenate two strings.
+ * @param __lhs First string.
+ * @param __rhs Last string.
+ * @return New string with value of @a __lhs followed by @a __rhs.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>
+ operator+(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs);
+
+ /**
+ * @brief Concatenate C string and string.
+ * @param __lhs First string.
+ * @param __rhs Last string.
+ * @return New string with value of @a __lhs followed by @a __rhs.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>
+ operator+(const _CharT* __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs);
+
+ /**
+ * @brief Concatenate character and string.
+ * @param __lhs First string.
+ * @param __rhs Last string.
+ * @return New string with @a __lhs followed by @a __rhs.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>
+ operator+(_CharT __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs);
+
+ /**
+ * @brief Concatenate string and C string.
+ * @param __lhs First string.
+ * @param __rhs Last string.
+ * @return New string with @a __lhs followed by @a __rhs.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>
+ operator+(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const _CharT* __rhs);
+
+ /**
+ * @brief Concatenate string and character.
+ * @param __lhs First string.
+ * @param __rhs Last string.
+ * @return New string with @a __lhs followed by @a __rhs.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>
+ operator+(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ _CharT __rhs);
+
+ // operator ==
+ /**
+ * @brief Test equivalence of two strings.
+ * @param __lhs First string.
+ * @param __rhs Second string.
+ * @return True if @a __lhs.compare(@a __rhs) == 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator==(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return __lhs.compare(__rhs) == 0; }
+
+ template<typename _CharT,
+ template <typename, typename, typename> class _Base>
+ inline typename __enable_if<std::__is_char<_CharT>::__value, bool>::__type
+ operator==(const __versa_string<_CharT, std::char_traits<_CharT>,
+ std::allocator<_CharT>, _Base>& __lhs,
+ const __versa_string<_CharT, std::char_traits<_CharT>,
+ std::allocator<_CharT>, _Base>& __rhs)
+ { return (__lhs.size() == __rhs.size()
+ && !std::char_traits<_CharT>::compare(__lhs.data(), __rhs.data(),
+ __lhs.size())); }
+
+ /**
+ * @brief Test equivalence of C string and string.
+ * @param __lhs C string.
+ * @param __rhs String.
+ * @return True if @a __rhs.compare(@a __lhs) == 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator==(const _CharT* __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return __rhs.compare(__lhs) == 0; }
+
+ /**
+ * @brief Test equivalence of string and C string.
+ * @param __lhs String.
+ * @param __rhs C string.
+ * @return True if @a __lhs.compare(@a __rhs) == 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator==(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) == 0; }
+
+ // operator !=
+ /**
+ * @brief Test difference of two strings.
+ * @param __lhs First string.
+ * @param __rhs Second string.
+ * @return True if @a __lhs.compare(@a __rhs) != 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator!=(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return !(__lhs == __rhs); }
+
+ /**
+ * @brief Test difference of C string and string.
+ * @param __lhs C string.
+ * @param __rhs String.
+ * @return True if @a __rhs.compare(@a __lhs) != 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator!=(const _CharT* __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return !(__lhs == __rhs); }
+
+ /**
+ * @brief Test difference of string and C string.
+ * @param __lhs String.
+ * @param __rhs C string.
+ * @return True if @a __lhs.compare(@a __rhs) != 0. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator!=(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const _CharT* __rhs)
+ { return !(__lhs == __rhs); }
+
+ // operator <
+ /**
+ * @brief Test if string precedes string.
+ * @param __lhs First string.
+ * @param __rhs Second string.
+ * @return True if @a __lhs precedes @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator<(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return __lhs.compare(__rhs) < 0; }
+
+ /**
+ * @brief Test if string precedes C string.
+ * @param __lhs String.
+ * @param __rhs C string.
+ * @return True if @a __lhs precedes @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator<(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) < 0; }
+
+ /**
+ * @brief Test if C string precedes string.
+ * @param __lhs C string.
+ * @param __rhs String.
+ * @return True if @a __lhs precedes @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator<(const _CharT* __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return __rhs.compare(__lhs) > 0; }
+
+ // operator >
+ /**
+ * @brief Test if string follows string.
+ * @param __lhs First string.
+ * @param __rhs Second string.
+ * @return True if @a __lhs follows @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator>(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return __lhs.compare(__rhs) > 0; }
+
+ /**
+ * @brief Test if string follows C string.
+ * @param __lhs String.
+ * @param __rhs C string.
+ * @return True if @a __lhs follows @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator>(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) > 0; }
+
+ /**
+ * @brief Test if C string follows string.
+ * @param __lhs C string.
+ * @param __rhs String.
+ * @return True if @a __lhs follows @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator>(const _CharT* __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return __rhs.compare(__lhs) < 0; }
+
+ // operator <=
+ /**
+ * @brief Test if string doesn't follow string.
+ * @param __lhs First string.
+ * @param __rhs Second string.
+ * @return True if @a __lhs doesn't follow @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator<=(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return __lhs.compare(__rhs) <= 0; }
+
+ /**
+ * @brief Test if string doesn't follow C string.
+ * @param __lhs String.
+ * @param __rhs C string.
+ * @return True if @a __lhs doesn't follow @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator<=(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) <= 0; }
+
+ /**
+ * @brief Test if C string doesn't follow string.
+ * @param __lhs C string.
+ * @param __rhs String.
+ * @return True if @a __lhs doesn't follow @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator<=(const _CharT* __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return __rhs.compare(__lhs) >= 0; }
+
+ // operator >=
+ /**
+ * @brief Test if string doesn't precede string.
+ * @param __lhs First string.
+ * @param __rhs Second string.
+ * @return True if @a __lhs doesn't precede @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator>=(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return __lhs.compare(__rhs) >= 0; }
+
+ /**
+ * @brief Test if string doesn't precede C string.
+ * @param __lhs String.
+ * @param __rhs C string.
+ * @return True if @a __lhs doesn't precede @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator>=(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const _CharT* __rhs)
+ { return __lhs.compare(__rhs) >= 0; }
+
+ /**
+ * @brief Test if C string doesn't precede string.
+ * @param __lhs C string.
+ * @param __rhs String.
+ * @return True if @a __lhs doesn't precede @a __rhs. False otherwise.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline bool
+ operator>=(const _CharT* __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { return __rhs.compare(__lhs) <= 0; }
+
+ /**
+ * @brief Swap contents of two strings.
+ * @param __lhs First string.
+ * @param __rhs Second string.
+ *
+ * Exchanges the contents of @a __lhs and @a __rhs in constant time.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline void
+ swap(__versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { __lhs.swap(__rhs); }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline void
+ swap(__versa_string<_CharT, _Traits, _Alloc, _Base>&& __lhs,
+ __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline void
+ swap(__versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ __versa_string<_CharT, _Traits, _Alloc, _Base>&& __rhs)
+ { __lhs.swap(__rhs); }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @brief Read stream into a string.
+ * @param __is Input stream.
+ * @param __str Buffer to store into.
+ * @return Reference to the input stream.
+ *
+ * Stores characters from @a __is into @a __str until whitespace is
+ * found, the end of the stream is encountered, or str.max_size()
+ * is reached. If is.width() is non-zero, that is the limit on the
+ * number of characters stored into @a __str. Any previous
+ * contents of @a __str are erased.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __is,
+ __gnu_cxx::__versa_string<_CharT, _Traits,
+ _Alloc, _Base>& __str);
+
+ /**
+ * @brief Write string to a stream.
+ * @param __os Output stream.
+ * @param __str String to write out.
+ * @return Reference to the output stream.
+ *
+ * Output characters of @a __str into os following the same rules as for
+ * writing a C string.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os,
+ const __gnu_cxx::__versa_string<_CharT, _Traits, _Alloc,
+ _Base>& __str)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 586. string inserter not a formatted function
+ return __ostream_insert(__os, __str.data(), __str.size());
+ }
+
+ /**
+ * @brief Read a line from stream into a string.
+ * @param __is Input stream.
+ * @param __str Buffer to store into.
+ * @param __delim Character marking end of line.
+ * @return Reference to the input stream.
+ *
+ * Stores characters from @a __is into @a __str until @a __delim is
+ * found, the end of the stream is encountered, or str.max_size()
+ * is reached. If is.width() is non-zero, that is the limit on the
+ * number of characters stored into @a __str. Any previous
+ * contents of @a __str are erased. If @a delim was encountered,
+ * it is extracted but not stored into @a __str.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ basic_istream<_CharT, _Traits>&
+ getline(basic_istream<_CharT, _Traits>& __is,
+ __gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>& __str,
+ _CharT __delim);
+
+ /**
+ * @brief Read a line from stream into a string.
+ * @param __is Input stream.
+ * @param __str Buffer to store into.
+ * @return Reference to the input stream.
+ *
+ * Stores characters from is into @a __str until '\n' is found, the
+ * end of the stream is encountered, or str.max_size() is reached.
+ * If is.width() is non-zero, that is the limit on the number of
+ * characters stored into @a __str. Any previous contents of @a
+ * __str are erased. If end of line was encountered, it is
+ * extracted but not stored into @a __str.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ inline basic_istream<_CharT, _Traits>&
+ getline(basic_istream<_CharT, _Traits>& __is,
+ __gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>& __str)
+ { return getline(__is, __str, __is.widen('\n')); }
+
+_GLIBCXX_END_NAMESPACE
+
+#if (defined(__GXX_EXPERIMENTAL_CXX0X__) && defined(_GLIBCXX_USE_C99))
+
+#include <ext/string_conversions.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ // 21.4 Numeric Conversions [string.conversions].
+ inline int
+ stoi(const __vstring& __str, std::size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa<long, int>(&std::strtol, "stoi", __str.c_str(),
+ __idx, __base); }
+
+ inline long
+ stol(const __vstring& __str, std::size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::strtol, "stol", __str.c_str(),
+ __idx, __base); }
+
+ inline unsigned long
+ stoul(const __vstring& __str, std::size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::strtoul, "stoul", __str.c_str(),
+ __idx, __base); }
+
+ inline long long
+ stoll(const __vstring& __str, std::size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::strtoll, "stoll", __str.c_str(),
+ __idx, __base); }
+
+ inline unsigned long long
+ stoull(const __vstring& __str, std::size_t* __idx, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::strtoull, "stoull", __str.c_str(),
+ __idx, __base); }
+
+ // NB: strtof vs strtod.
+ inline float
+ stof(const __vstring& __str, std::size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::strtof, "stof", __str.c_str(), __idx); }
+
+ inline double
+ stod(const __vstring& __str, std::size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::strtod, "stod", __str.c_str(), __idx); }
+
+ inline long double
+ stold(const __vstring& __str, std::size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::strtold, "stold", __str.c_str(), __idx); }
+
+ // NB: (v)snprintf vs sprintf.
+ inline __vstring
+ to_string(long long __val)
+ { return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf,
+ 4 * sizeof(long long),
+ "%lld", __val); }
+
+ inline __vstring
+ to_string(unsigned long long __val)
+ { return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf,
+ 4 * sizeof(unsigned long long),
+ "%llu", __val); }
+
+ inline __vstring
+ to_string(long double __val)
+ {
+ const int __n = __numeric_traits<long double>::__max_exponent10 + 20;
+ return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf, __n,
+ "%Lf", __val);
+ }
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ inline int
+ stoi(const __wvstring& __str, std::size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa<long, int>(&std::wcstol, "stoi", __str.c_str(),
+ __idx, __base); }
+
+ inline long
+ stol(const __wvstring& __str, std::size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::wcstol, "stol", __str.c_str(),
+ __idx, __base); }
+
+ inline unsigned long
+ stoul(const __wvstring& __str, std::size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::wcstoul, "stoul", __str.c_str(),
+ __idx, __base); }
+
+ inline long long
+ stoll(const __wvstring& __str, std::size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::wcstoll, "stoll", __str.c_str(),
+ __idx, __base); }
+
+ inline unsigned long long
+ stoull(const __wvstring& __str, std::size_t* __idx = 0, int __base = 10)
+ { return __gnu_cxx::__stoa(&std::wcstoull, "stoull", __str.c_str(),
+ __idx, __base); }
+
+ // NB: wcstof vs wcstod.
+ inline float
+ stof(const __wvstring& __str, std::size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::wcstof, "stof", __str.c_str(), __idx); }
+
+ inline double
+ stod(const __wvstring& __str, std::size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::wcstod, "stod", __str.c_str(), __idx); }
+
+ inline long double
+ stold(const __wvstring& __str, std::size_t* __idx = 0)
+ { return __gnu_cxx::__stoa(&std::wcstold, "stold", __str.c_str(), __idx); }
+
+ inline __wvstring
+ to_wstring(long long __val)
+ { return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
+ 4 * sizeof(long long),
+ L"%lld", __val); }
+
+ inline __wvstring
+ to_wstring(unsigned long long __val)
+ { return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
+ 4 * sizeof(unsigned long long),
+ L"%llu", __val); }
+
+ inline __wvstring
+ to_wstring(long double __val)
+ {
+ const int __n = __numeric_traits<long double>::__max_exponent10 + 20;
+ return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf, __n,
+ L"%Lf", __val);
+ }
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include "vstring.tcc"
+#endif
+
+#endif /* _VSTRING_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/vstring.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/vstring.tcc
new file mode 100644
index 0000000..9919389
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/vstring.tcc
@@ -0,0 +1,696 @@
+// Versatile string -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/vstring.tcc
+ * This file is a GNU extension to the Standard C++ Library.
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _VSTRING_TCC
+#define _VSTRING_TCC 1
+
+#pragma GCC system_header
+
+#include <cxxabi-forced.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ const typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::npos;
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ void
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ resize(size_type __n, _CharT __c)
+ {
+ const size_type __size = this->size();
+ if (__size < __n)
+ this->append(__n - __size, __c);
+ else if (__n < __size)
+ this->_M_erase(__n, __size - __n);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>&
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ _M_append(const _CharT* __s, size_type __n)
+ {
+ const size_type __len = __n + this->size();
+
+ if (__len <= this->capacity() && !this->_M_is_shared())
+ {
+ if (__n)
+ this->_S_copy(this->_M_data() + this->size(), __s, __n);
+ }
+ else
+ this->_M_mutate(this->size(), size_type(0), __s, __n);
+
+ this->_M_set_length(__len);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ template<typename _InputIterator>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>&
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
+ _InputIterator __k2, std::__false_type)
+ {
+ const __versa_string __s(__k1, __k2);
+ const size_type __n1 = __i2 - __i1;
+ return _M_replace(__i1 - _M_ibegin(), __n1, __s._M_data(),
+ __s.size());
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>&
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
+ _CharT __c)
+ {
+ _M_check_length(__n1, __n2, "__versa_string::_M_replace_aux");
+
+ const size_type __old_size = this->size();
+ const size_type __new_size = __old_size + __n2 - __n1;
+
+ if (__new_size <= this->capacity() && !this->_M_is_shared())
+ {
+ _CharT* __p = this->_M_data() + __pos1;
+
+ const size_type __how_much = __old_size - __pos1 - __n1;
+ if (__how_much && __n1 != __n2)
+ this->_S_move(__p + __n2, __p + __n1, __how_much);
+ }
+ else
+ this->_M_mutate(__pos1, __n1, 0, __n2);
+
+ if (__n2)
+ this->_S_assign(this->_M_data() + __pos1, __n2, __c);
+
+ this->_M_set_length(__new_size);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>&
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ _M_replace(size_type __pos, size_type __len1, const _CharT* __s,
+ const size_type __len2)
+ {
+ _M_check_length(__len1, __len2, "__versa_string::_M_replace");
+
+ const size_type __old_size = this->size();
+ const size_type __new_size = __old_size + __len2 - __len1;
+
+ if (__new_size <= this->capacity() && !this->_M_is_shared())
+ {
+ _CharT* __p = this->_M_data() + __pos;
+
+ const size_type __how_much = __old_size - __pos - __len1;
+ if (_M_disjunct(__s))
+ {
+ if (__how_much && __len1 != __len2)
+ this->_S_move(__p + __len2, __p + __len1, __how_much);
+ if (__len2)
+ this->_S_copy(__p, __s, __len2);
+ }
+ else
+ {
+ // Work in-place.
+ if (__len2 && __len2 <= __len1)
+ this->_S_move(__p, __s, __len2);
+ if (__how_much && __len1 != __len2)
+ this->_S_move(__p + __len2, __p + __len1, __how_much);
+ if (__len2 > __len1)
+ {
+ if (__s + __len2 <= __p + __len1)
+ this->_S_move(__p, __s, __len2);
+ else if (__s >= __p + __len1)
+ this->_S_copy(__p, __s + __len2 - __len1, __len2);
+ else
+ {
+ const size_type __nleft = (__p + __len1) - __s;
+ this->_S_move(__p, __s, __nleft);
+ this->_S_copy(__p + __nleft, __p + __len2,
+ __len2 - __nleft);
+ }
+ }
+ }
+ }
+ else
+ this->_M_mutate(__pos, __len1, __s, __len2);
+
+ this->_M_set_length(__new_size);
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>
+ operator+(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ {
+ __versa_string<_CharT, _Traits, _Alloc, _Base> __str;
+ __str.reserve(__lhs.size() + __rhs.size());
+ __str.append(__lhs);
+ __str.append(__rhs);
+ return __str;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>
+ operator+(const _CharT* __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ {
+ __glibcxx_requires_string(__lhs);
+ typedef __versa_string<_CharT, _Traits, _Alloc, _Base> __string_type;
+ typedef typename __string_type::size_type __size_type;
+ const __size_type __len = _Traits::length(__lhs);
+ __string_type __str;
+ __str.reserve(__len + __rhs.size());
+ __str.append(__lhs, __len);
+ __str.append(__rhs);
+ return __str;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>
+ operator+(_CharT __lhs,
+ const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+ {
+ __versa_string<_CharT, _Traits, _Alloc, _Base> __str;
+ __str.reserve(__rhs.size() + 1);
+ __str.push_back(__lhs);
+ __str.append(__rhs);
+ return __str;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>
+ operator+(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_requires_string(__rhs);
+ typedef __versa_string<_CharT, _Traits, _Alloc, _Base> __string_type;
+ typedef typename __string_type::size_type __size_type;
+ const __size_type __len = _Traits::length(__rhs);
+ __string_type __str;
+ __str.reserve(__lhs.size() + __len);
+ __str.append(__lhs);
+ __str.append(__rhs, __len);
+ return __str;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ __versa_string<_CharT, _Traits, _Alloc, _Base>
+ operator+(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+ _CharT __rhs)
+ {
+ __versa_string<_CharT, _Traits, _Alloc, _Base> __str;
+ __str.reserve(__lhs.size() + 1);
+ __str.append(__lhs);
+ __str.push_back(__rhs);
+ return __str;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ copy(_CharT* __s, size_type __n, size_type __pos) const
+ {
+ _M_check(__pos, "__versa_string::copy");
+ __n = _M_limit(__pos, __n);
+ __glibcxx_requires_string_len(__s, __n);
+ if (__n)
+ this->_S_copy(__s, this->_M_data() + __pos, __n);
+ // 21.3.5.7 par 3: do not append null. (good.)
+ return __n;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ find(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ const size_type __size = this->size();
+ const _CharT* __data = this->_M_data();
+
+ if (__n == 0)
+ return __pos <= __size ? __pos : npos;
+
+ if (__n <= __size)
+ {
+ for (; __pos <= __size - __n; ++__pos)
+ if (traits_type::eq(__data[__pos], __s[0])
+ && traits_type::compare(__data + __pos + 1,
+ __s + 1, __n - 1) == 0)
+ return __pos;
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ find(_CharT __c, size_type __pos) const
+ {
+ size_type __ret = npos;
+ const size_type __size = this->size();
+ if (__pos < __size)
+ {
+ const _CharT* __data = this->_M_data();
+ const size_type __n = __size - __pos;
+ const _CharT* __p = traits_type::find(__data + __pos, __n, __c);
+ if (__p)
+ __ret = __p - __data;
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ rfind(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ const size_type __size = this->size();
+ if (__n <= __size)
+ {
+ __pos = std::min(size_type(__size - __n), __pos);
+ const _CharT* __data = this->_M_data();
+ do
+ {
+ if (traits_type::compare(__data + __pos, __s, __n) == 0)
+ return __pos;
+ }
+ while (__pos-- > 0);
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ rfind(_CharT __c, size_type __pos) const
+ {
+ size_type __size = this->size();
+ if (__size)
+ {
+ if (--__size > __pos)
+ __size = __pos;
+ for (++__size; __size-- > 0; )
+ if (traits_type::eq(this->_M_data()[__size], __c))
+ return __size;
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ for (; __n && __pos < this->size(); ++__pos)
+ {
+ const _CharT* __p = traits_type::find(__s, __n,
+ this->_M_data()[__pos]);
+ if (__p)
+ return __pos;
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ size_type __size = this->size();
+ if (__size && __n)
+ {
+ if (--__size > __pos)
+ __size = __pos;
+ do
+ {
+ if (traits_type::find(__s, __n, this->_M_data()[__size]))
+ return __size;
+ }
+ while (__size-- != 0);
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ for (; __pos < this->size(); ++__pos)
+ if (!traits_type::find(__s, __n, this->_M_data()[__pos]))
+ return __pos;
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ find_first_not_of(_CharT __c, size_type __pos) const
+ {
+ for (; __pos < this->size(); ++__pos)
+ if (!traits_type::eq(this->_M_data()[__pos], __c))
+ return __pos;
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_requires_string_len(__s, __n);
+ size_type __size = this->size();
+ if (__size)
+ {
+ if (--__size > __pos)
+ __size = __pos;
+ do
+ {
+ if (!traits_type::find(__s, __n, this->_M_data()[__size]))
+ return __size;
+ }
+ while (__size--);
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ typename __versa_string<_CharT, _Traits, _Alloc, _Base>::size_type
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ find_last_not_of(_CharT __c, size_type __pos) const
+ {
+ size_type __size = this->size();
+ if (__size)
+ {
+ if (--__size > __pos)
+ __size = __pos;
+ do
+ {
+ if (!traits_type::eq(this->_M_data()[__size], __c))
+ return __size;
+ }
+ while (__size--);
+ }
+ return npos;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ int
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ compare(size_type __pos, size_type __n, const __versa_string& __str) const
+ {
+ _M_check(__pos, "__versa_string::compare");
+ __n = _M_limit(__pos, __n);
+ const size_type __osize = __str.size();
+ const size_type __len = std::min(__n, __osize);
+ int __r = traits_type::compare(this->_M_data() + __pos,
+ __str.data(), __len);
+ if (!__r)
+ __r = _S_compare(__n, __osize);
+ return __r;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ int
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ compare(size_type __pos1, size_type __n1, const __versa_string& __str,
+ size_type __pos2, size_type __n2) const
+ {
+ _M_check(__pos1, "__versa_string::compare");
+ __str._M_check(__pos2, "__versa_string::compare");
+ __n1 = _M_limit(__pos1, __n1);
+ __n2 = __str._M_limit(__pos2, __n2);
+ const size_type __len = std::min(__n1, __n2);
+ int __r = traits_type::compare(this->_M_data() + __pos1,
+ __str.data() + __pos2, __len);
+ if (!__r)
+ __r = _S_compare(__n1, __n2);
+ return __r;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ int
+ __versa_string<_CharT, _Traits, _Alloc, _Base>::
+ compare(const _CharT* __s) const
+ {
+ __glibcxx_requires_string(__s);
+ const size_type __size = this->size();
+ const size_type __osize = traits_type::length(__s);
+ const size_type __len = std::min(__size, __osize);
+ int __r = traits_type::compare(this->_M_data(), __s, __len);
+ if (!__r)
+ __r = _S_compare(__size, __osize);
+ return __r;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ int
+ __versa_string <_CharT, _Traits, _Alloc, _Base>::
+ compare(size_type __pos, size_type __n1, const _CharT* __s) const
+ {
+ __glibcxx_requires_string(__s);
+ _M_check(__pos, "__versa_string::compare");
+ __n1 = _M_limit(__pos, __n1);
+ const size_type __osize = traits_type::length(__s);
+ const size_type __len = std::min(__n1, __osize);
+ int __r = traits_type::compare(this->_M_data() + __pos, __s, __len);
+ if (!__r)
+ __r = _S_compare(__n1, __osize);
+ return __r;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ int
+ __versa_string <_CharT, _Traits, _Alloc, _Base>::
+ compare(size_type __pos, size_type __n1, const _CharT* __s,
+ size_type __n2) const
+ {
+ __glibcxx_requires_string_len(__s, __n2);
+ _M_check(__pos, "__versa_string::compare");
+ __n1 = _M_limit(__pos, __n1);
+ const size_type __len = std::min(__n1, __n2);
+ int __r = traits_type::compare(this->_M_data() + __pos, __s, __len);
+ if (!__r)
+ __r = _S_compare(__n1, __n2);
+ return __r;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __in,
+ __gnu_cxx::__versa_string<_CharT, _Traits,
+ _Alloc, _Base>& __str)
+ {
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+ typedef __gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>
+ __string_type;
+ typedef typename __istream_type::int_type __int_type;
+ typedef typename __string_type::size_type __size_type;
+ typedef ctype<_CharT> __ctype_type;
+ typedef typename __ctype_type::ctype_base __ctype_base;
+
+ __size_type __extracted = 0;
+ typename __ios_base::iostate __err = __ios_base::goodbit;
+ typename __istream_type::sentry __cerb(__in, false);
+ if (__cerb)
+ {
+ __try
+ {
+ // Avoid reallocation for common case.
+ __str.erase();
+ _CharT __buf[128];
+ __size_type __len = 0;
+ const streamsize __w = __in.width();
+ const __size_type __n = __w > 0 ? static_cast<__size_type>(__w)
+ : __str.max_size();
+ const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
+ const __int_type __eof = _Traits::eof();
+ __int_type __c = __in.rdbuf()->sgetc();
+
+ while (__extracted < __n
+ && !_Traits::eq_int_type(__c, __eof)
+ && !__ct.is(__ctype_base::space,
+ _Traits::to_char_type(__c)))
+ {
+ if (__len == sizeof(__buf) / sizeof(_CharT))
+ {
+ __str.append(__buf, sizeof(__buf) / sizeof(_CharT));
+ __len = 0;
+ }
+ __buf[__len++] = _Traits::to_char_type(__c);
+ ++__extracted;
+ __c = __in.rdbuf()->snextc();
+ }
+ __str.append(__buf, __len);
+
+ if (_Traits::eq_int_type(__c, __eof))
+ __err |= __ios_base::eofbit;
+ __in.width(0);
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(__ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 91. Description of operator>> and getline() for string<>
+ // might cause endless loop
+ __in._M_setstate(__ios_base::badbit);
+ }
+ }
+ // 211. operator>>(istream&, string&) doesn't set failbit
+ if (!__extracted)
+ __err |= __ios_base::failbit;
+ if (__err)
+ __in.setstate(__err);
+ return __in;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc,
+ template <typename, typename, typename> class _Base>
+ basic_istream<_CharT, _Traits>&
+ getline(basic_istream<_CharT, _Traits>& __in,
+ __gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>& __str,
+ _CharT __delim)
+ {
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+ typedef __gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>
+ __string_type;
+ typedef typename __istream_type::int_type __int_type;
+ typedef typename __string_type::size_type __size_type;
+
+ __size_type __extracted = 0;
+ const __size_type __n = __str.max_size();
+ typename __ios_base::iostate __err = __ios_base::goodbit;
+ typename __istream_type::sentry __cerb(__in, true);
+ if (__cerb)
+ {
+ __try
+ {
+ // Avoid reallocation for common case.
+ __str.erase();
+ _CharT __buf[128];
+ __size_type __len = 0;
+ const __int_type __idelim = _Traits::to_int_type(__delim);
+ const __int_type __eof = _Traits::eof();
+ __int_type __c = __in.rdbuf()->sgetc();
+
+ while (__extracted < __n
+ && !_Traits::eq_int_type(__c, __eof)
+ && !_Traits::eq_int_type(__c, __idelim))
+ {
+ if (__len == sizeof(__buf) / sizeof(_CharT))
+ {
+ __str.append(__buf, sizeof(__buf) / sizeof(_CharT));
+ __len = 0;
+ }
+ __buf[__len++] = _Traits::to_char_type(__c);
+ ++__extracted;
+ __c = __in.rdbuf()->snextc();
+ }
+ __str.append(__buf, __len);
+
+ if (_Traits::eq_int_type(__c, __eof))
+ __err |= __ios_base::eofbit;
+ else if (_Traits::eq_int_type(__c, __idelim))
+ {
+ ++__extracted;
+ __in.rdbuf()->sbumpc();
+ }
+ else
+ __err |= __ios_base::failbit;
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(__ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 91. Description of operator>> and getline() for string<>
+ // might cause endless loop
+ __in._M_setstate(__ios_base::badbit);
+ }
+ }
+ if (!__extracted)
+ __err |= __ios_base::failbit;
+ if (__err)
+ __in.setstate(__err);
+ return __in;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif // _VSTRING_TCC
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/vstring_fwd.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/vstring_fwd.h
new file mode 100644
index 0000000..c2a31d4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/vstring_fwd.h
@@ -0,0 +1,87 @@
+// Versatile string forward -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/vstring_fwd.h
+ * This file is a GNU extension to the Standard C++ Library.
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _VSTRING_FWD_H
+#define _VSTRING_FWD_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/char_traits.h>
+#include <bits/allocator.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ class __sso_string_base;
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ class __rc_string_base;
+
+ template<typename _CharT, typename _Traits = std::char_traits<_CharT>,
+ typename _Alloc = std::allocator<_CharT>,
+ template
+ <typename, typename, typename> class _Base = __sso_string_base>
+ class __versa_string;
+
+ typedef __versa_string<char> __vstring;
+ typedef __vstring __sso_string;
+ typedef
+ __versa_string<char, std::char_traits<char>,
+ std::allocator<char>, __rc_string_base> __rc_string;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ typedef __versa_string<wchar_t> __wvstring;
+ typedef __wvstring __wsso_string;
+ typedef
+ __versa_string<wchar_t, std::char_traits<wchar_t>,
+ std::allocator<wchar_t>, __rc_string_base> __wrc_string;
+#endif
+
+#if (defined(__GXX_EXPERIMENTAL_CXX0X__) \
+ && defined(_GLIBCXX_USE_C99_STDINT_TR1))
+
+ typedef __versa_string<char16_t> __u16vstring;
+ typedef __u16vstring __u16sso_string;
+ typedef
+ __versa_string<char16_t, std::char_traits<char16_t>,
+ std::allocator<char16_t>, __rc_string_base> __u16rc_string;
+
+ typedef __versa_string<char32_t> __u32vstring;
+ typedef __u32vstring __u32sso_string;
+ typedef
+ __versa_string<char32_t, std::char_traits<char32_t>,
+ std::allocator<char32_t>, __rc_string_base> __u32rc_string;
+
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _VSTRING_FWD_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/vstring_util.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/vstring_util.h
new file mode 100644
index 0000000..4042f70
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ext/vstring_util.h
@@ -0,0 +1,180 @@
+// Versatile string utility -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/vstring_util.h
+ * This file is a GNU extension to the Standard C++ Library.
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _VSTRING_UTIL_H
+#define _VSTRING_UTIL_H 1
+
+#pragma GCC system_header
+
+#include <ext/vstring_fwd.h>
+#include <debug/debug.h>
+#include <bits/stl_function.h> // For less
+#include <bits/functexcept.h>
+#include <bits/localefwd.h>
+#include <bits/ostream_insert.h>
+#include <bits/stl_iterator.h>
+#include <ext/numeric_traits.h>
+#include <bits/move.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ struct __vstring_utility
+ {
+ typedef typename _Alloc::template rebind<_CharT>::other _CharT_alloc_type;
+
+ typedef _Traits traits_type;
+ typedef typename _Traits::char_type value_type;
+ typedef typename _CharT_alloc_type::size_type size_type;
+ typedef typename _CharT_alloc_type::difference_type difference_type;
+ typedef typename _CharT_alloc_type::pointer pointer;
+ typedef typename _CharT_alloc_type::const_pointer const_pointer;
+
+ // For __sso_string.
+ typedef __gnu_cxx::
+ __normal_iterator<pointer, __gnu_cxx::
+ __versa_string<_CharT, _Traits, _Alloc,
+ __sso_string_base> >
+ __sso_iterator;
+ typedef __gnu_cxx::
+ __normal_iterator<const_pointer, __gnu_cxx::
+ __versa_string<_CharT, _Traits, _Alloc,
+ __sso_string_base> >
+ __const_sso_iterator;
+
+ // For __rc_string.
+ typedef __gnu_cxx::
+ __normal_iterator<pointer, __gnu_cxx::
+ __versa_string<_CharT, _Traits, _Alloc,
+ __rc_string_base> >
+ __rc_iterator;
+ typedef __gnu_cxx::
+ __normal_iterator<const_pointer, __gnu_cxx::
+ __versa_string<_CharT, _Traits, _Alloc,
+ __rc_string_base> >
+ __const_rc_iterator;
+
+ // NB: When the allocator is empty, deriving from it saves space
+ // (http://www.cantrip.org/emptyopt.html).
+ template<typename _Alloc1>
+ struct _Alloc_hider
+ : public _Alloc1
+ {
+ _Alloc_hider(_CharT* __ptr)
+ : _Alloc1(), _M_p(__ptr) { }
+
+ _Alloc_hider(const _Alloc1& __a, _CharT* __ptr)
+ : _Alloc1(__a), _M_p(__ptr) { }
+
+ _CharT* _M_p; // The actual data.
+ };
+
+ // When __n = 1 way faster than the general multichar
+ // traits_type::copy/move/assign.
+ static void
+ _S_copy(_CharT* __d, const _CharT* __s, size_type __n)
+ {
+ if (__n == 1)
+ traits_type::assign(*__d, *__s);
+ else
+ traits_type::copy(__d, __s, __n);
+ }
+
+ static void
+ _S_move(_CharT* __d, const _CharT* __s, size_type __n)
+ {
+ if (__n == 1)
+ traits_type::assign(*__d, *__s);
+ else
+ traits_type::move(__d, __s, __n);
+ }
+
+ static void
+ _S_assign(_CharT* __d, size_type __n, _CharT __c)
+ {
+ if (__n == 1)
+ traits_type::assign(*__d, __c);
+ else
+ traits_type::assign(__d, __n, __c);
+ }
+
+ // _S_copy_chars is a separate template to permit specialization
+ // to optimize for the common case of pointers as iterators.
+ template<typename _Iterator>
+ static void
+ _S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
+ {
+ for (; __k1 != __k2; ++__k1, ++__p)
+ traits_type::assign(*__p, *__k1); // These types are off.
+ }
+
+ static void
+ _S_copy_chars(_CharT* __p, __sso_iterator __k1, __sso_iterator __k2)
+ { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+
+ static void
+ _S_copy_chars(_CharT* __p, __const_sso_iterator __k1,
+ __const_sso_iterator __k2)
+ { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+
+ static void
+ _S_copy_chars(_CharT* __p, __rc_iterator __k1, __rc_iterator __k2)
+ { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+
+ static void
+ _S_copy_chars(_CharT* __p, __const_rc_iterator __k1,
+ __const_rc_iterator __k2)
+ { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+
+ static void
+ _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2)
+ { _S_copy(__p, __k1, __k2 - __k1); }
+
+ static void
+ _S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2)
+ { _S_copy(__p, __k1, __k2 - __k1); }
+
+ static int
+ _S_compare(size_type __n1, size_type __n2)
+ {
+ const difference_type __d = difference_type(__n1 - __n2);
+
+ if (__d > __numeric_traits_integer<int>::__max)
+ return __numeric_traits_integer<int>::__max;
+ else if (__d < __numeric_traits_integer<int>::__min)
+ return __numeric_traits_integer<int>::__min;
+ else
+ return int(__d);
+ }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _VSTRING_UTIL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/fenv.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/fenv.h
new file mode 100644
index 0000000..5db6d9d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/fenv.h
@@ -0,0 +1,58 @@
+// -*- C++ -*- compatibility header.
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file fenv.h
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_FENV_H
+#define _GLIBCXX_FENV_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#if _GLIBCXX_HAVE_FENV_H
+# include_next <fenv.h>
+#endif
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/cfenv>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/cfenv>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+#endif
+
+#endif // _GLIBCXX_FENV_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/forward_list b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/forward_list
new file mode 100644
index 0000000..40a0812
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/forward_list
@@ -0,0 +1,46 @@
+// <forward_list> -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file forward_list
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_FORWARD_LIST
+#define _GLIBCXX_FORWARD_LIST 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#include <bits/forward_list.h>
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/forward_list.tcc>
+#endif
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_FORWARD_LIST
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/fstream b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/fstream
new file mode 100644
index 0000000..88c1d14
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/fstream
@@ -0,0 +1,918 @@
+// File based streams -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file fstream
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 14882: 27.8 File-based streams
+//
+
+#ifndef _GLIBCXX_FSTREAM
+#define _GLIBCXX_FSTREAM 1
+
+#pragma GCC system_header
+
+#include <istream>
+#include <ostream>
+#include <bits/codecvt.h>
+#include <cstdio> // For BUFSIZ
+#include <bits/basic_file.h> // For __basic_file, __c_lock
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#include <string> // For std::string overloads.
+#endif
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // [27.8.1.1] template class basic_filebuf
+ /**
+ * @brief The actual work of input and output (for files).
+ * @ingroup io
+ *
+ * This class associates both its input and output sequence with an
+ * external disk file, and maintains a joint file position for both
+ * sequences. Many of its semantics are described in terms of similar
+ * behavior in the Standard C Library's @c FILE streams.
+ */
+ // Requirements on traits_type, specific to this class:
+ // traits_type::pos_type must be fpos<traits_type::state_type>
+ // traits_type::off_type must be streamoff
+ // traits_type::state_type must be Assignable and DefaultConstructible,
+ // and traits_type::state_type() must be the initial state for codecvt.
+ template<typename _CharT, typename _Traits>
+ class basic_filebuf : public basic_streambuf<_CharT, _Traits>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+
+ typedef basic_streambuf<char_type, traits_type> __streambuf_type;
+ typedef basic_filebuf<char_type, traits_type> __filebuf_type;
+ typedef __basic_file<char> __file_type;
+ typedef typename traits_type::state_type __state_type;
+ typedef codecvt<char_type, char, __state_type> __codecvt_type;
+
+ friend class ios_base; // For sync_with_stdio.
+
+ protected:
+ // Data Members:
+ // MT lock inherited from libio or other low-level io library.
+ __c_lock _M_lock;
+
+ // External buffer.
+ __file_type _M_file;
+
+ /// Place to stash in || out || in | out settings for current filebuf.
+ ios_base::openmode _M_mode;
+
+ // Beginning state type for codecvt.
+ __state_type _M_state_beg;
+
+ // During output, the state that corresponds to pptr(),
+ // during input, the state that corresponds to egptr() and
+ // _M_ext_next.
+ __state_type _M_state_cur;
+
+ // Not used for output. During input, the state that corresponds
+ // to eback() and _M_ext_buf.
+ __state_type _M_state_last;
+
+ /// Pointer to the beginning of internal buffer.
+ char_type* _M_buf;
+
+ /**
+ * Actual size of internal buffer. This number is equal to the size
+ * of the put area + 1 position, reserved for the overflow char of
+ * a full area.
+ */
+ size_t _M_buf_size;
+
+ // Set iff _M_buf is allocated memory from _M_allocate_internal_buffer.
+ bool _M_buf_allocated;
+
+ /**
+ * _M_reading == false && _M_writing == false for 'uncommitted' mode;
+ * _M_reading == true for 'read' mode;
+ * _M_writing == true for 'write' mode;
+ *
+ * NB: _M_reading == true && _M_writing == true is unused.
+ */
+ bool _M_reading;
+ bool _M_writing;
+
+ //@{
+ /**
+ * Necessary bits for putback buffer management.
+ *
+ * @note pbacks of over one character are not currently supported.
+ */
+ char_type _M_pback;
+ char_type* _M_pback_cur_save;
+ char_type* _M_pback_end_save;
+ bool _M_pback_init;
+ //@}
+
+ // Cached codecvt facet.
+ const __codecvt_type* _M_codecvt;
+
+ /**
+ * Buffer for external characters. Used for input when
+ * codecvt::always_noconv() == false. When valid, this corresponds
+ * to eback().
+ */
+ char* _M_ext_buf;
+
+ /**
+ * Size of buffer held by _M_ext_buf.
+ */
+ streamsize _M_ext_buf_size;
+
+ /**
+ * Pointers into the buffer held by _M_ext_buf that delimit a
+ * subsequence of bytes that have been read but not yet converted.
+ * When valid, _M_ext_next corresponds to egptr().
+ */
+ const char* _M_ext_next;
+ char* _M_ext_end;
+
+ /**
+ * Initializes pback buffers, and moves normal buffers to safety.
+ * Assumptions:
+ * _M_in_cur has already been moved back
+ */
+ void
+ _M_create_pback()
+ {
+ if (!_M_pback_init)
+ {
+ _M_pback_cur_save = this->gptr();
+ _M_pback_end_save = this->egptr();
+ this->setg(&_M_pback, &_M_pback, &_M_pback + 1);
+ _M_pback_init = true;
+ }
+ }
+
+ /**
+ * Deactivates pback buffer contents, and restores normal buffer.
+ * Assumptions:
+ * The pback buffer has only moved forward.
+ */
+ void
+ _M_destroy_pback() throw()
+ {
+ if (_M_pback_init)
+ {
+ // Length _M_in_cur moved in the pback buffer.
+ _M_pback_cur_save += this->gptr() != this->eback();
+ this->setg(_M_buf, _M_pback_cur_save, _M_pback_end_save);
+ _M_pback_init = false;
+ }
+ }
+
+ public:
+ // Constructors/destructor:
+ /**
+ * @brief Does not open any files.
+ *
+ * The default constructor initializes the parent class using its
+ * own default ctor.
+ */
+ basic_filebuf();
+
+ /**
+ * @brief The destructor closes the file first.
+ */
+ virtual
+ ~basic_filebuf()
+ { this->close(); }
+
+ // Members:
+ /**
+ * @brief Returns true if the external file is open.
+ */
+ bool
+ is_open() const throw()
+ { return _M_file.is_open(); }
+
+ /**
+ * @brief Opens an external file.
+ * @param s The name of the file.
+ * @param mode The open mode flags.
+ * @return @c this on success, NULL on failure
+ *
+ * If a file is already open, this function immediately fails.
+ * Otherwise it tries to open the file named @a s using the flags
+ * given in @a mode.
+ *
+ * Table 92, adapted here, gives the relation between openmode
+ * combinations and the equivalent fopen() flags.
+ * (NB: lines app, in|out|app, in|app, binary|app, binary|in|out|app,
+ * and binary|in|app per DR 596)
+ * +---------------------------------------------------------+
+ * | ios_base Flag combination stdio equivalent |
+ * |binary in out trunc app |
+ * +---------------------------------------------------------+
+ * | + "w" |
+ * | + + "a" |
+ * | + "a" |
+ * | + + "w" |
+ * | + "r" |
+ * | + + "r+" |
+ * | + + + "w+" |
+ * | + + + "a+" |
+ * | + + "a+" |
+ * +---------------------------------------------------------+
+ * | + + "wb" |
+ * | + + + "ab" |
+ * | + + "ab" |
+ * | + + + "wb" |
+ * | + + "rb" |
+ * | + + + "r+b" |
+ * | + + + + "w+b" |
+ * | + + + + "a+b" |
+ * | + + + "a+b" |
+ * +---------------------------------------------------------+
+ */
+ __filebuf_type*
+ open(const char* __s, ios_base::openmode __mode);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Opens an external file.
+ * @param s The name of the file.
+ * @param mode The open mode flags.
+ * @return @c this on success, NULL on failure
+ */
+ __filebuf_type*
+ open(const std::string& __s, ios_base::openmode __mode)
+ { return open(__s.c_str(), __mode); }
+#endif
+
+ /**
+ * @brief Closes the currently associated file.
+ * @return @c this on success, NULL on failure
+ *
+ * If no file is currently open, this function immediately fails.
+ *
+ * If a "put buffer area" exists, @c overflow(eof) is called to flush
+ * all the characters. The file is then closed.
+ *
+ * If any operations fail, this function also fails.
+ */
+ __filebuf_type*
+ close();
+
+ protected:
+ void
+ _M_allocate_internal_buffer();
+
+ void
+ _M_destroy_internal_buffer() throw();
+
+ // [27.8.1.4] overridden virtual functions
+ virtual streamsize
+ showmanyc();
+
+ // Stroustrup, 1998, p. 628
+ // underflow() and uflow() functions are called to get the next
+ // character from the real input source when the buffer is empty.
+ // Buffered input uses underflow()
+
+ virtual int_type
+ underflow();
+
+ virtual int_type
+ pbackfail(int_type __c = _Traits::eof());
+
+ // Stroustrup, 1998, p 648
+ // The overflow() function is called to transfer characters to the
+ // real output destination when the buffer is full. A call to
+ // overflow(c) outputs the contents of the buffer plus the
+ // character c.
+ // 27.5.2.4.5
+ // Consume some sequence of the characters in the pending sequence.
+ virtual int_type
+ overflow(int_type __c = _Traits::eof());
+
+ // Convert internal byte sequence to external, char-based
+ // sequence via codecvt.
+ bool
+ _M_convert_to_external(char_type*, streamsize);
+
+ /**
+ * @brief Manipulates the buffer.
+ * @param s Pointer to a buffer area.
+ * @param n Size of @a s.
+ * @return @c this
+ *
+ * If no file has been opened, and both @a s and @a n are zero, then
+ * the stream becomes unbuffered. Otherwise, @c s is used as a
+ * buffer; see
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch25s02.html
+ * for more.
+ */
+ virtual __streambuf_type*
+ setbuf(char_type* __s, streamsize __n);
+
+ virtual pos_type
+ seekoff(off_type __off, ios_base::seekdir __way,
+ ios_base::openmode __mode = ios_base::in | ios_base::out);
+
+ virtual pos_type
+ seekpos(pos_type __pos,
+ ios_base::openmode __mode = ios_base::in | ios_base::out);
+
+ // Common code for seekoff and seekpos
+ pos_type
+ _M_seek(off_type __off, ios_base::seekdir __way, __state_type __state);
+
+ virtual int
+ sync();
+
+ virtual void
+ imbue(const locale& __loc);
+
+ virtual streamsize
+ xsgetn(char_type* __s, streamsize __n);
+
+ virtual streamsize
+ xsputn(const char_type* __s, streamsize __n);
+
+ // Flushes output buffer, then writes unshift sequence.
+ bool
+ _M_terminate_output();
+
+ /**
+ * This function sets the pointers of the internal buffer, both get
+ * and put areas. Typically:
+ *
+ * __off == egptr() - eback() upon underflow/uflow ('read' mode);
+ * __off == 0 upon overflow ('write' mode);
+ * __off == -1 upon open, setbuf, seekoff/pos ('uncommitted' mode).
+ *
+ * NB: epptr() - pbase() == _M_buf_size - 1, since _M_buf_size
+ * reflects the actual allocated memory and the last cell is reserved
+ * for the overflow char of a full put area.
+ */
+ void
+ _M_set_buffer(streamsize __off)
+ {
+ const bool __testin = _M_mode & ios_base::in;
+ const bool __testout = _M_mode & ios_base::out;
+
+ if (__testin && __off > 0)
+ this->setg(_M_buf, _M_buf, _M_buf + __off);
+ else
+ this->setg(_M_buf, _M_buf, _M_buf);
+
+ if (__testout && __off == 0 && _M_buf_size > 1 )
+ this->setp(_M_buf, _M_buf + _M_buf_size - 1);
+ else
+ this->setp(NULL, NULL);
+ }
+ };
+
+ // [27.8.1.5] Template class basic_ifstream
+ /**
+ * @brief Controlling input for files.
+ * @ingroup io
+ *
+ * This class supports reading from named files, using the inherited
+ * functions from std::basic_istream. To control the associated
+ * sequence, an instance of std::basic_filebuf is used, which this page
+ * refers to as @c sb.
+ */
+ template<typename _CharT, typename _Traits>
+ class basic_ifstream : public basic_istream<_CharT, _Traits>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+
+ // Non-standard types:
+ typedef basic_filebuf<char_type, traits_type> __filebuf_type;
+ typedef basic_istream<char_type, traits_type> __istream_type;
+
+ private:
+ __filebuf_type _M_filebuf;
+
+ public:
+ // Constructors/Destructors:
+ /**
+ * @brief Default constructor.
+ *
+ * Initializes @c sb using its default constructor, and passes
+ * @c &sb to the base class initializer. Does not open any files
+ * (you haven't given it a filename to open).
+ */
+ basic_ifstream() : __istream_type(), _M_filebuf()
+ { this->init(&_M_filebuf); }
+
+ /**
+ * @brief Create an input file stream.
+ * @param s Null terminated string specifying the filename.
+ * @param mode Open file in specified mode (see std::ios_base).
+ *
+ * @c ios_base::in is automatically included in @a mode.
+ *
+ * Tip: When using std::string to hold the filename, you must use
+ * .c_str() before passing it to this constructor.
+ */
+ explicit
+ basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
+ : __istream_type(), _M_filebuf()
+ {
+ this->init(&_M_filebuf);
+ this->open(__s, __mode);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Create an input file stream.
+ * @param s std::string specifying the filename.
+ * @param mode Open file in specified mode (see std::ios_base).
+ *
+ * @c ios_base::in is automatically included in @a mode.
+ */
+ explicit
+ basic_ifstream(const std::string& __s,
+ ios_base::openmode __mode = ios_base::in)
+ : __istream_type(), _M_filebuf()
+ {
+ this->init(&_M_filebuf);
+ this->open(__s, __mode);
+ }
+#endif
+
+ /**
+ * @brief The destructor does nothing.
+ *
+ * The file is closed by the filebuf object, not the formatting
+ * stream.
+ */
+ ~basic_ifstream()
+ { }
+
+ // Members:
+ /**
+ * @brief Accessing the underlying buffer.
+ * @return The current basic_filebuf buffer.
+ *
+ * This hides both signatures of std::basic_ios::rdbuf().
+ */
+ __filebuf_type*
+ rdbuf() const
+ { return const_cast<__filebuf_type*>(&_M_filebuf); }
+
+ /**
+ * @brief Wrapper to test for an open file.
+ * @return @c rdbuf()->is_open()
+ */
+ bool
+ is_open()
+ { return _M_filebuf.is_open(); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 365. Lack of const-qualification in clause 27
+ bool
+ is_open() const
+ { return _M_filebuf.is_open(); }
+
+ /**
+ * @brief Opens an external file.
+ * @param s The name of the file.
+ * @param mode The open mode flags.
+ *
+ * Calls @c std::basic_filebuf::open(s,mode|in). If that function
+ * fails, @c failbit is set in the stream's error state.
+ *
+ * Tip: When using std::string to hold the filename, you must use
+ * .c_str() before passing it to this constructor.
+ */
+ void
+ open(const char* __s, ios_base::openmode __mode = ios_base::in)
+ {
+ if (!_M_filebuf.open(__s, __mode | ios_base::in))
+ this->setstate(ios_base::failbit);
+ else
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 409. Closing an fstream should clear error state
+ this->clear();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Opens an external file.
+ * @param s The name of the file.
+ * @param mode The open mode flags.
+ *
+ * Calls @c std::basic_filebuf::open(s,mode|in). If that function
+ * fails, @c failbit is set in the stream's error state.
+ */
+ void
+ open(const std::string& __s, ios_base::openmode __mode = ios_base::in)
+ {
+ if (!_M_filebuf.open(__s, __mode | ios_base::in))
+ this->setstate(ios_base::failbit);
+ else
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 409. Closing an fstream should clear error state
+ this->clear();
+ }
+#endif
+
+ /**
+ * @brief Close the file.
+ *
+ * Calls @c std::basic_filebuf::close(). If that function
+ * fails, @c failbit is set in the stream's error state.
+ */
+ void
+ close()
+ {
+ if (!_M_filebuf.close())
+ this->setstate(ios_base::failbit);
+ }
+ };
+
+
+ // [27.8.1.8] Template class basic_ofstream
+ /**
+ * @brief Controlling output for files.
+ * @ingroup io
+ *
+ * This class supports reading from named files, using the inherited
+ * functions from std::basic_ostream. To control the associated
+ * sequence, an instance of std::basic_filebuf is used, which this page
+ * refers to as @c sb.
+ */
+ template<typename _CharT, typename _Traits>
+ class basic_ofstream : public basic_ostream<_CharT,_Traits>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+
+ // Non-standard types:
+ typedef basic_filebuf<char_type, traits_type> __filebuf_type;
+ typedef basic_ostream<char_type, traits_type> __ostream_type;
+
+ private:
+ __filebuf_type _M_filebuf;
+
+ public:
+ // Constructors:
+ /**
+ * @brief Default constructor.
+ *
+ * Initializes @c sb using its default constructor, and passes
+ * @c &sb to the base class initializer. Does not open any files
+ * (you haven't given it a filename to open).
+ */
+ basic_ofstream(): __ostream_type(), _M_filebuf()
+ { this->init(&_M_filebuf); }
+
+ /**
+ * @brief Create an output file stream.
+ * @param s Null terminated string specifying the filename.
+ * @param mode Open file in specified mode (see std::ios_base).
+ *
+ * @c ios_base::out|ios_base::trunc is automatically included in
+ * @a mode.
+ *
+ * Tip: When using std::string to hold the filename, you must use
+ * .c_str() before passing it to this constructor.
+ */
+ explicit
+ basic_ofstream(const char* __s,
+ ios_base::openmode __mode = ios_base::out|ios_base::trunc)
+ : __ostream_type(), _M_filebuf()
+ {
+ this->init(&_M_filebuf);
+ this->open(__s, __mode);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Create an output file stream.
+ * @param s std::string specifying the filename.
+ * @param mode Open file in specified mode (see std::ios_base).
+ *
+ * @c ios_base::out|ios_base::trunc is automatically included in
+ * @a mode.
+ */
+ explicit
+ basic_ofstream(const std::string& __s,
+ ios_base::openmode __mode = ios_base::out|ios_base::trunc)
+ : __ostream_type(), _M_filebuf()
+ {
+ this->init(&_M_filebuf);
+ this->open(__s, __mode);
+ }
+#endif
+
+ /**
+ * @brief The destructor does nothing.
+ *
+ * The file is closed by the filebuf object, not the formatting
+ * stream.
+ */
+ ~basic_ofstream()
+ { }
+
+ // Members:
+ /**
+ * @brief Accessing the underlying buffer.
+ * @return The current basic_filebuf buffer.
+ *
+ * This hides both signatures of std::basic_ios::rdbuf().
+ */
+ __filebuf_type*
+ rdbuf() const
+ { return const_cast<__filebuf_type*>(&_M_filebuf); }
+
+ /**
+ * @brief Wrapper to test for an open file.
+ * @return @c rdbuf()->is_open()
+ */
+ bool
+ is_open()
+ { return _M_filebuf.is_open(); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 365. Lack of const-qualification in clause 27
+ bool
+ is_open() const
+ { return _M_filebuf.is_open(); }
+
+ /**
+ * @brief Opens an external file.
+ * @param s The name of the file.
+ * @param mode The open mode flags.
+ *
+ * Calls @c std::basic_filebuf::open(s,mode|out|trunc). If that
+ * function fails, @c failbit is set in the stream's error state.
+ *
+ * Tip: When using std::string to hold the filename, you must use
+ * .c_str() before passing it to this constructor.
+ */
+ void
+ open(const char* __s,
+ ios_base::openmode __mode = ios_base::out | ios_base::trunc)
+ {
+ if (!_M_filebuf.open(__s, __mode | ios_base::out))
+ this->setstate(ios_base::failbit);
+ else
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 409. Closing an fstream should clear error state
+ this->clear();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Opens an external file.
+ * @param s The name of the file.
+ * @param mode The open mode flags.
+ *
+ * Calls @c std::basic_filebuf::open(s,mode|out|trunc). If that
+ * function fails, @c failbit is set in the stream's error state.
+ */
+ void
+ open(const std::string& __s,
+ ios_base::openmode __mode = ios_base::out | ios_base::trunc)
+ {
+ if (!_M_filebuf.open(__s, __mode | ios_base::out))
+ this->setstate(ios_base::failbit);
+ else
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 409. Closing an fstream should clear error state
+ this->clear();
+ }
+#endif
+
+ /**
+ * @brief Close the file.
+ *
+ * Calls @c std::basic_filebuf::close(). If that function
+ * fails, @c failbit is set in the stream's error state.
+ */
+ void
+ close()
+ {
+ if (!_M_filebuf.close())
+ this->setstate(ios_base::failbit);
+ }
+ };
+
+
+ // [27.8.1.11] Template class basic_fstream
+ /**
+ * @brief Controlling input and output for files.
+ * @ingroup io
+ *
+ * This class supports reading from and writing to named files, using
+ * the inherited functions from std::basic_iostream. To control the
+ * associated sequence, an instance of std::basic_filebuf is used, which
+ * this page refers to as @c sb.
+ */
+ template<typename _CharT, typename _Traits>
+ class basic_fstream : public basic_iostream<_CharT, _Traits>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+
+ // Non-standard types:
+ typedef basic_filebuf<char_type, traits_type> __filebuf_type;
+ typedef basic_ios<char_type, traits_type> __ios_type;
+ typedef basic_iostream<char_type, traits_type> __iostream_type;
+
+ private:
+ __filebuf_type _M_filebuf;
+
+ public:
+ // Constructors/destructor:
+ /**
+ * @brief Default constructor.
+ *
+ * Initializes @c sb using its default constructor, and passes
+ * @c &sb to the base class initializer. Does not open any files
+ * (you haven't given it a filename to open).
+ */
+ basic_fstream()
+ : __iostream_type(), _M_filebuf()
+ { this->init(&_M_filebuf); }
+
+ /**
+ * @brief Create an input/output file stream.
+ * @param s Null terminated string specifying the filename.
+ * @param mode Open file in specified mode (see std::ios_base).
+ *
+ * Tip: When using std::string to hold the filename, you must use
+ * .c_str() before passing it to this constructor.
+ */
+ explicit
+ basic_fstream(const char* __s,
+ ios_base::openmode __mode = ios_base::in | ios_base::out)
+ : __iostream_type(NULL), _M_filebuf()
+ {
+ this->init(&_M_filebuf);
+ this->open(__s, __mode);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Create an input/output file stream.
+ * @param s Null terminated string specifying the filename.
+ * @param mode Open file in specified mode (see std::ios_base).
+ */
+ explicit
+ basic_fstream(const std::string& __s,
+ ios_base::openmode __mode = ios_base::in | ios_base::out)
+ : __iostream_type(NULL), _M_filebuf()
+ {
+ this->init(&_M_filebuf);
+ this->open(__s, __mode);
+ }
+#endif
+
+ /**
+ * @brief The destructor does nothing.
+ *
+ * The file is closed by the filebuf object, not the formatting
+ * stream.
+ */
+ ~basic_fstream()
+ { }
+
+ // Members:
+ /**
+ * @brief Accessing the underlying buffer.
+ * @return The current basic_filebuf buffer.
+ *
+ * This hides both signatures of std::basic_ios::rdbuf().
+ */
+ __filebuf_type*
+ rdbuf() const
+ { return const_cast<__filebuf_type*>(&_M_filebuf); }
+
+ /**
+ * @brief Wrapper to test for an open file.
+ * @return @c rdbuf()->is_open()
+ */
+ bool
+ is_open()
+ { return _M_filebuf.is_open(); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 365. Lack of const-qualification in clause 27
+ bool
+ is_open() const
+ { return _M_filebuf.is_open(); }
+
+ /**
+ * @brief Opens an external file.
+ * @param s The name of the file.
+ * @param mode The open mode flags.
+ *
+ * Calls @c std::basic_filebuf::open(s,mode). If that
+ * function fails, @c failbit is set in the stream's error state.
+ *
+ * Tip: When using std::string to hold the filename, you must use
+ * .c_str() before passing it to this constructor.
+ */
+ void
+ open(const char* __s,
+ ios_base::openmode __mode = ios_base::in | ios_base::out)
+ {
+ if (!_M_filebuf.open(__s, __mode))
+ this->setstate(ios_base::failbit);
+ else
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 409. Closing an fstream should clear error state
+ this->clear();
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Opens an external file.
+ * @param s The name of the file.
+ * @param mode The open mode flags.
+ *
+ * Calls @c std::basic_filebuf::open(s,mode). If that
+ * function fails, @c failbit is set in the stream's error state.
+ */
+ void
+ open(const std::string& __s,
+ ios_base::openmode __mode = ios_base::in | ios_base::out)
+ {
+ if (!_M_filebuf.open(__s, __mode))
+ this->setstate(ios_base::failbit);
+ else
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 409. Closing an fstream should clear error state
+ this->clear();
+ }
+#endif
+
+ /**
+ * @brief Close the file.
+ *
+ * Calls @c std::basic_filebuf::close(). If that function
+ * fails, @c failbit is set in the stream's error state.
+ */
+ void
+ close()
+ {
+ if (!_M_filebuf.close())
+ this->setstate(ios_base::failbit);
+ }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/fstream.tcc>
+#endif
+
+#endif /* _GLIBCXX_FSTREAM */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/functional b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/functional
new file mode 100644
index 0000000..8f4f42c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/functional
@@ -0,0 +1,78 @@
+// <functional> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file include/functional
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_FUNCTIONAL
+#define _GLIBCXX_FUNCTIONAL 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/stl_function.h>
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# include <typeinfo>
+# include <new>
+# include <tuple>
+# include <type_traits>
+# include <bits/stringfwd.h>
+# include <bits/functional_hash.h>
+# include <ext/type_traits.h>
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/functional>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/functional>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+#endif
+
+#endif // _GLIBCXX_FUNCTIONAL
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/initializer_list b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/initializer_list
new file mode 100644
index 0000000..6b8a202
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/initializer_list
@@ -0,0 +1,72 @@
+// std::initializer_list support -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// GCC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file initializer_list
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef __CXX_INITIALIZER_LIST
+#define __CXX_INITIALIZER_LIST
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+
+#pragma GCC visibility push(default)
+
+#include <cstddef>
+
+namespace std
+{
+ /// initializer_list
+ template<class _E>
+ class initializer_list
+ {
+ const _E* __array;
+ size_t __len;
+
+ // The compiler can call a private constructor.
+ initializer_list(const _E* __a, size_t __l)
+ : __array(__a), __len(__l) { }
+
+ public:
+ initializer_list()
+ : __array(NULL), __len(0) { }
+
+ // Number of elements.
+ size_t size() const
+ { return __len; }
+
+ // First element.
+ const _E* begin() const
+ { return __array; }
+
+ // One past the last element.
+ const _E* end() const
+ { return begin() + size(); }
+ };
+}
+
+#pragma GCC visibility pop
+#endif // C++0x
+#endif // __CXX_INITIALIZER_LIST
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/iomanip b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/iomanip
new file mode 100644
index 0000000..873c76f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/iomanip
@@ -0,0 +1,296 @@
+// Standard stream manipulators -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+// 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file iomanip
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 14882: 27.6.3 Standard manipulators
+//
+
+#ifndef _GLIBCXX_IOMANIP
+#define _GLIBCXX_IOMANIP 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <iosfwd>
+#include <bits/ios_base.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // [27.6.3] standard manipulators
+ // Also see DR 183.
+
+ struct _Resetiosflags { ios_base::fmtflags _M_mask; };
+
+ /**
+ * @brief Manipulator for @c setf.
+ * @param mask A format flags mask.
+ *
+ * Sent to a stream object, this manipulator resets the specified flags,
+ * via @e stream.setf(0,mask).
+ */
+ inline _Resetiosflags
+ resetiosflags(ios_base::fmtflags __mask)
+ {
+ _Resetiosflags __x;
+ __x._M_mask = __mask;
+ return __x;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f)
+ {
+ __is.setf(ios_base::fmtflags(0), __f._M_mask);
+ return __is;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os, _Resetiosflags __f)
+ {
+ __os.setf(ios_base::fmtflags(0), __f._M_mask);
+ return __os;
+ }
+
+
+ struct _Setiosflags { ios_base::fmtflags _M_mask; };
+
+ /**
+ * @brief Manipulator for @c setf.
+ * @param mask A format flags mask.
+ *
+ * Sent to a stream object, this manipulator sets the format flags
+ * to @a mask.
+ */
+ inline _Setiosflags
+ setiosflags(ios_base::fmtflags __mask)
+ {
+ _Setiosflags __x;
+ __x._M_mask = __mask;
+ return __x;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f)
+ {
+ __is.setf(__f._M_mask);
+ return __is;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os, _Setiosflags __f)
+ {
+ __os.setf(__f._M_mask);
+ return __os;
+ }
+
+
+ struct _Setbase { int _M_base; };
+
+ /**
+ * @brief Manipulator for @c setf.
+ * @param base A numeric base.
+ *
+ * Sent to a stream object, this manipulator changes the
+ * @c ios_base::basefield flags to @c oct, @c dec, or @c hex when @a base
+ * is 8, 10, or 16, accordingly, and to 0 if @a base is any other value.
+ */
+ inline _Setbase
+ setbase(int __base)
+ {
+ _Setbase __x;
+ __x._M_base = __base;
+ return __x;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f)
+ {
+ __is.setf(__f._M_base == 8 ? ios_base::oct :
+ __f._M_base == 10 ? ios_base::dec :
+ __f._M_base == 16 ? ios_base::hex :
+ ios_base::fmtflags(0), ios_base::basefield);
+ return __is;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os, _Setbase __f)
+ {
+ __os.setf(__f._M_base == 8 ? ios_base::oct :
+ __f._M_base == 10 ? ios_base::dec :
+ __f._M_base == 16 ? ios_base::hex :
+ ios_base::fmtflags(0), ios_base::basefield);
+ return __os;
+ }
+
+
+ template<typename _CharT>
+ struct _Setfill { _CharT _M_c; };
+
+ /**
+ * @brief Manipulator for @c fill.
+ * @param c The new fill character.
+ *
+ * Sent to a stream object, this manipulator calls @c fill(c) for that
+ * object.
+ */
+ template<typename _CharT>
+ inline _Setfill<_CharT>
+ setfill(_CharT __c)
+ {
+ _Setfill<_CharT> __x;
+ __x._M_c = __c;
+ return __x;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f)
+ {
+ __is.fill(__f._M_c);
+ return __is;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os, _Setfill<_CharT> __f)
+ {
+ __os.fill(__f._M_c);
+ return __os;
+ }
+
+
+ struct _Setprecision { int _M_n; };
+
+ /**
+ * @brief Manipulator for @c precision.
+ * @param n The new precision.
+ *
+ * Sent to a stream object, this manipulator calls @c precision(n) for
+ * that object.
+ */
+ inline _Setprecision
+ setprecision(int __n)
+ {
+ _Setprecision __x;
+ __x._M_n = __n;
+ return __x;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f)
+ {
+ __is.precision(__f._M_n);
+ return __is;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os, _Setprecision __f)
+ {
+ __os.precision(__f._M_n);
+ return __os;
+ }
+
+
+ struct _Setw { int _M_n; };
+
+ /**
+ * @brief Manipulator for @c width.
+ * @param n The new width.
+ *
+ * Sent to a stream object, this manipulator calls @c width(n) for
+ * that object.
+ */
+ inline _Setw
+ setw(int __n)
+ {
+ _Setw __x;
+ __x._M_n = __n;
+ return __x;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __is, _Setw __f)
+ {
+ __is.width(__f._M_n);
+ return __is;
+ }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os, _Setw __f)
+ {
+ __os.width(__f._M_n);
+ return __os;
+ }
+
+ // Inhibit implicit instantiations for required instantiations,
+ // which are defined via explicit instantiations elsewhere.
+ // NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
+ extern template ostream& operator<<(ostream&, _Setfill<char>);
+ extern template ostream& operator<<(ostream&, _Setiosflags);
+ extern template ostream& operator<<(ostream&, _Resetiosflags);
+ extern template ostream& operator<<(ostream&, _Setbase);
+ extern template ostream& operator<<(ostream&, _Setprecision);
+ extern template ostream& operator<<(ostream&, _Setw);
+ extern template istream& operator>>(istream&, _Setfill<char>);
+ extern template istream& operator>>(istream&, _Setiosflags);
+ extern template istream& operator>>(istream&, _Resetiosflags);
+ extern template istream& operator>>(istream&, _Setbase);
+ extern template istream& operator>>(istream&, _Setprecision);
+ extern template istream& operator>>(istream&, _Setw);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern template wostream& operator<<(wostream&, _Setfill<wchar_t>);
+ extern template wostream& operator<<(wostream&, _Setiosflags);
+ extern template wostream& operator<<(wostream&, _Resetiosflags);
+ extern template wostream& operator<<(wostream&, _Setbase);
+ extern template wostream& operator<<(wostream&, _Setprecision);
+ extern template wostream& operator<<(wostream&, _Setw);
+ extern template wistream& operator>>(wistream&, _Setfill<wchar_t>);
+ extern template wistream& operator>>(wistream&, _Setiosflags);
+ extern template wistream& operator>>(wistream&, _Resetiosflags);
+ extern template wistream& operator>>(wistream&, _Setbase);
+ extern template wistream& operator>>(wistream&, _Setprecision);
+ extern template wistream& operator>>(wistream&, _Setw);
+#endif
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _GLIBCXX_IOMANIP */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ios b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ios
new file mode 100644
index 0000000..d561ac6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ios
@@ -0,0 +1,47 @@
+// Iostreams base classes -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+// 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ios
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 14882: 27.4 Iostreams base classes
+//
+
+#ifndef _GLIBCXX_IOS
+#define _GLIBCXX_IOS 1
+
+#pragma GCC system_header
+
+#include <iosfwd>
+#include <exception> // For ios_base::failure
+#include <bits/char_traits.h> // For char_traits, streamoff, streamsize, fpos
+#include <bits/localefwd.h> // For class locale
+#include <bits/ios_base.h> // For ios_base declarations.
+#include <streambuf>
+#include <bits/basic_ios.h>
+
+#endif /* _GLIBCXX_IOS */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/iosfwd b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/iosfwd
new file mode 100644
index 0000000..9bba0ab
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/iosfwd
@@ -0,0 +1,160 @@
+// Forwarding declarations -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file iosfwd
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 14882: 27.2 Forward declarations
+//
+
+#ifndef _GLIBCXX_IOSFWD
+#define _GLIBCXX_IOSFWD 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/stringfwd.h> // For string forward declarations.
+#include <bits/postypes.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_ios;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_streambuf;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_istream;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_ostream;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_iostream;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT>,
+ typename _Alloc = allocator<_CharT> >
+ class basic_stringbuf;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT>,
+ typename _Alloc = allocator<_CharT> >
+ class basic_istringstream;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT>,
+ typename _Alloc = allocator<_CharT> >
+ class basic_ostringstream;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT>,
+ typename _Alloc = allocator<_CharT> >
+ class basic_stringstream;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_filebuf;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_ifstream;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_ofstream;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class basic_fstream;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class istreambuf_iterator;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT> >
+ class ostreambuf_iterator;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // Not included. (??? Apparently no LWG number?)
+ class ios_base;
+
+ /**
+ * @defgroup io I/O
+ *
+ * Nearly all of the I/O classes are parameterized on the type of
+ * characters they read and write. (The major exception is ios_base at
+ * the top of the hierarchy.) This is a change from pre-Standard
+ * streams, which were not templates.
+ *
+ * For ease of use and compatibility, all of the basic_* I/O-related
+ * classes are given typedef names for both of the builtin character
+ * widths (wide and narrow). The typedefs are the same as the
+ * pre-Standard names, for example:
+ *
+ * @code
+ * typedef basic_ifstream<char> ifstream;
+ * @endcode
+ *
+ * Because properly forward-declaring these classes can be difficult, you
+ * should not do it yourself. Instead, include the &lt;iosfwd&gt;
+ * header, which contains only declarations of all the I/O classes as
+ * well as the typedefs. Trying to forward-declare the typedefs
+ * themselves (e.g., "class ostream;") is not valid ISO C++.
+ *
+ * For more specific declarations, see
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch24.html
+ *
+ * @{
+ */
+ typedef basic_ios<char> ios; ///< @isiosfwd
+ typedef basic_streambuf<char> streambuf; ///< @isiosfwd
+ typedef basic_istream<char> istream; ///< @isiosfwd
+ typedef basic_ostream<char> ostream; ///< @isiosfwd
+ typedef basic_iostream<char> iostream; ///< @isiosfwd
+ typedef basic_stringbuf<char> stringbuf; ///< @isiosfwd
+ typedef basic_istringstream<char> istringstream; ///< @isiosfwd
+ typedef basic_ostringstream<char> ostringstream; ///< @isiosfwd
+ typedef basic_stringstream<char> stringstream; ///< @isiosfwd
+ typedef basic_filebuf<char> filebuf; ///< @isiosfwd
+ typedef basic_ifstream<char> ifstream; ///< @isiosfwd
+ typedef basic_ofstream<char> ofstream; ///< @isiosfwd
+ typedef basic_fstream<char> fstream; ///< @isiosfwd
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ typedef basic_ios<wchar_t> wios; ///< @isiosfwd
+ typedef basic_streambuf<wchar_t> wstreambuf; ///< @isiosfwd
+ typedef basic_istream<wchar_t> wistream; ///< @isiosfwd
+ typedef basic_ostream<wchar_t> wostream; ///< @isiosfwd
+ typedef basic_iostream<wchar_t> wiostream; ///< @isiosfwd
+ typedef basic_stringbuf<wchar_t> wstringbuf; ///< @isiosfwd
+ typedef basic_istringstream<wchar_t> wistringstream; ///< @isiosfwd
+ typedef basic_ostringstream<wchar_t> wostringstream; ///< @isiosfwd
+ typedef basic_stringstream<wchar_t> wstringstream; ///< @isiosfwd
+ typedef basic_filebuf<wchar_t> wfilebuf; ///< @isiosfwd
+ typedef basic_ifstream<wchar_t> wifstream; ///< @isiosfwd
+ typedef basic_ofstream<wchar_t> wofstream; ///< @isiosfwd
+ typedef basic_fstream<wchar_t> wfstream; ///< @isiosfwd
+#endif
+ /** @} */
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _GLIBCXX_IOSFWD */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/iostream b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/iostream
new file mode 100644
index 0000000..e14c4f3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/iostream
@@ -0,0 +1,76 @@
+// Standard iostream objects -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2005, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file iostream
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 14882: 27.3 Standard iostream objects
+//
+
+#ifndef _GLIBCXX_IOSTREAM
+#define _GLIBCXX_IOSTREAM 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <ostream>
+#include <istream>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @name Standard Stream Objects
+ *
+ * The &lt;iostream&gt; header declares the eight <em>standard stream
+ * objects</em>. For other declarations, see
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch24.html
+ * and the @link iosfwd I/O forward declarations @endlink
+ *
+ * They are required by default to cooperate with the global C library's
+ * @c FILE streams, and to be available during program startup and
+ * termination. For more information, see the HOWTO linked to above.
+ */
+ //@{
+ extern istream cin; ///< Linked to standard input
+ extern ostream cout; ///< Linked to standard output
+ extern ostream cerr; ///< Linked to standard error (unbuffered)
+ extern ostream clog; ///< Linked to standard error (buffered)
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ extern wistream wcin; ///< Linked to standard input
+ extern wostream wcout; ///< Linked to standard output
+ extern wostream wcerr; ///< Linked to standard error (unbuffered)
+ extern wostream wclog; ///< Linked to standard error (buffered)
+#endif
+ //@}
+
+ // For construction of filebuffers for cout, cin, cerr, clog et. al.
+ static ios_base::Init __ioinit;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _GLIBCXX_IOSTREAM */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/istream b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/istream
new file mode 100644
index 0000000..521be7f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/istream
@@ -0,0 +1,833 @@
+// Input streams -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+//
+// ISO C++ 14882: 27.6.1 Input streams
+//
+
+/** @file istream
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_ISTREAM
+#define _GLIBCXX_ISTREAM 1
+
+#pragma GCC system_header
+
+#include <ios>
+#include <ostream>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // [27.6.1.1] Template class basic_istream
+ /**
+ * @brief Controlling input.
+ * @ingroup io
+ *
+ * This is the base class for all input streams. It provides text
+ * formatting of all builtin types, and communicates with any class
+ * derived from basic_streambuf to do the actual input.
+ */
+ template<typename _CharT, typename _Traits>
+ class basic_istream : virtual public basic_ios<_CharT, _Traits>
+ {
+ public:
+ // Types (inherited from basic_ios (27.4.4)):
+ typedef _CharT char_type;
+ typedef typename _Traits::int_type int_type;
+ typedef typename _Traits::pos_type pos_type;
+ typedef typename _Traits::off_type off_type;
+ typedef _Traits traits_type;
+
+ // Non-standard Types:
+ typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
+ typedef basic_ios<_CharT, _Traits> __ios_type;
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
+ __num_get_type;
+ typedef ctype<_CharT> __ctype_type;
+
+ protected:
+ // Data Members:
+ /**
+ * The number of characters extracted in the previous unformatted
+ * function; see gcount().
+ */
+ streamsize _M_gcount;
+
+ public:
+ // [27.6.1.1.1] constructor/destructor
+ /**
+ * @brief Base constructor.
+ *
+ * This ctor is almost never called by the user directly, rather from
+ * derived classes' initialization lists, which pass a pointer to
+ * their own stream buffer.
+ */
+ explicit
+ basic_istream(__streambuf_type* __sb)
+ : _M_gcount(streamsize(0))
+ { this->init(__sb); }
+
+ /**
+ * @brief Base destructor.
+ *
+ * This does very little apart from providing a virtual base dtor.
+ */
+ virtual
+ ~basic_istream()
+ { _M_gcount = streamsize(0); }
+
+ // [27.6.1.1.2] prefix/suffix
+ class sentry;
+ friend class sentry;
+
+ // [27.6.1.2] formatted input
+ // [27.6.1.2.3] basic_istream::operator>>
+ //@{
+ /**
+ * @brief Interface for manipulators.
+ *
+ * Manipulators such as @c std::ws and @c std::dec use these
+ * functions in constructs like "std::cin >> std::ws". For more
+ * information, see the iomanip header.
+ */
+ __istream_type&
+ operator>>(__istream_type& (*__pf)(__istream_type&))
+ { return __pf(*this); }
+
+ __istream_type&
+ operator>>(__ios_type& (*__pf)(__ios_type&))
+ {
+ __pf(*this);
+ return *this;
+ }
+
+ __istream_type&
+ operator>>(ios_base& (*__pf)(ios_base&))
+ {
+ __pf(*this);
+ return *this;
+ }
+ //@}
+
+ // [27.6.1.2.2] arithmetic extractors
+ /**
+ * @name Arithmetic Extractors
+ *
+ * All the @c operator>> functions (aka <em>formatted input
+ * functions</em>) have some common behavior. Each starts by
+ * constructing a temporary object of type std::basic_istream::sentry
+ * with the second argument (noskipws) set to false. This has several
+ * effects, concluding with the setting of a status flag; see the
+ * sentry documentation for more.
+ *
+ * If the sentry status is good, the function tries to extract
+ * whatever data is appropriate for the type of the argument.
+ *
+ * If an exception is thrown during extraction, ios_base::badbit
+ * will be turned on in the stream's error state without causing an
+ * ios_base::failure to be thrown. The original exception will then
+ * be rethrown.
+ */
+ //@{
+ /**
+ * @brief Basic arithmetic extractors
+ * @param A variable of builtin type.
+ * @return @c *this if successful
+ *
+ * These functions use the stream's current locale (specifically, the
+ * @c num_get facet) to parse the input data.
+ */
+ __istream_type&
+ operator>>(bool& __n)
+ { return _M_extract(__n); }
+
+ __istream_type&
+ operator>>(short& __n);
+
+ __istream_type&
+ operator>>(unsigned short& __n)
+ { return _M_extract(__n); }
+
+ __istream_type&
+ operator>>(int& __n);
+
+ __istream_type&
+ operator>>(unsigned int& __n)
+ { return _M_extract(__n); }
+
+ __istream_type&
+ operator>>(long& __n)
+ { return _M_extract(__n); }
+
+ __istream_type&
+ operator>>(unsigned long& __n)
+ { return _M_extract(__n); }
+
+#ifdef _GLIBCXX_USE_LONG_LONG
+ __istream_type&
+ operator>>(long long& __n)
+ { return _M_extract(__n); }
+
+ __istream_type&
+ operator>>(unsigned long long& __n)
+ { return _M_extract(__n); }
+#endif
+
+ __istream_type&
+ operator>>(float& __f)
+ { return _M_extract(__f); }
+
+ __istream_type&
+ operator>>(double& __f)
+ { return _M_extract(__f); }
+
+ __istream_type&
+ operator>>(long double& __f)
+ { return _M_extract(__f); }
+
+ __istream_type&
+ operator>>(void*& __p)
+ { return _M_extract(__p); }
+
+ /**
+ * @brief Extracting into another streambuf.
+ * @param sb A pointer to a streambuf
+ *
+ * This function behaves like one of the basic arithmetic extractors,
+ * in that it also constructs a sentry object and has the same error
+ * handling behavior.
+ *
+ * If @a sb is NULL, the stream will set failbit in its error state.
+ *
+ * Characters are extracted from this stream and inserted into the
+ * @a sb streambuf until one of the following occurs:
+ *
+ * - the input stream reaches end-of-file,
+ * - insertion into the output buffer fails (in this case, the
+ * character that would have been inserted is not extracted), or
+ * - an exception occurs (and in this case is caught)
+ *
+ * If the function inserts no characters, failbit is set.
+ */
+ __istream_type&
+ operator>>(__streambuf_type* __sb);
+ //@}
+
+ // [27.6.1.3] unformatted input
+ /**
+ * @brief Character counting
+ * @return The number of characters extracted by the previous
+ * unformatted input function dispatched for this stream.
+ */
+ streamsize
+ gcount() const
+ { return _M_gcount; }
+
+ /**
+ * @name Unformatted Input Functions
+ *
+ * All the unformatted input functions have some common behavior.
+ * Each starts by constructing a temporary object of type
+ * std::basic_istream::sentry with the second argument (noskipws)
+ * set to true. This has several effects, concluding with the
+ * setting of a status flag; see the sentry documentation for more.
+ *
+ * If the sentry status is good, the function tries to extract
+ * whatever data is appropriate for the type of the argument.
+ *
+ * The number of characters extracted is stored for later retrieval
+ * by gcount().
+ *
+ * If an exception is thrown during extraction, ios_base::badbit
+ * will be turned on in the stream's error state without causing an
+ * ios_base::failure to be thrown. The original exception will then
+ * be rethrown.
+ */
+ //@{
+ /**
+ * @brief Simple extraction.
+ * @return A character, or eof().
+ *
+ * Tries to extract a character. If none are available, sets failbit
+ * and returns traits::eof().
+ */
+ int_type
+ get();
+
+ /**
+ * @brief Simple extraction.
+ * @param c The character in which to store data.
+ * @return *this
+ *
+ * Tries to extract a character and store it in @a c. If none are
+ * available, sets failbit and returns traits::eof().
+ *
+ * @note This function is not overloaded on signed char and
+ * unsigned char.
+ */
+ __istream_type&
+ get(char_type& __c);
+
+ /**
+ * @brief Simple multiple-character extraction.
+ * @param s Pointer to an array.
+ * @param n Maximum number of characters to store in @a s.
+ * @param delim A "stop" character.
+ * @return *this
+ *
+ * Characters are extracted and stored into @a s until one of the
+ * following happens:
+ *
+ * - @c n-1 characters are stored
+ * - the input sequence reaches EOF
+ * - the next character equals @a delim, in which case the character
+ * is not extracted
+ *
+ * If no characters are stored, failbit is set in the stream's error
+ * state.
+ *
+ * In any case, a null character is stored into the next location in
+ * the array.
+ *
+ * @note This function is not overloaded on signed char and
+ * unsigned char.
+ */
+ __istream_type&
+ get(char_type* __s, streamsize __n, char_type __delim);
+
+ /**
+ * @brief Simple multiple-character extraction.
+ * @param s Pointer to an array.
+ * @param n Maximum number of characters to store in @a s.
+ * @return *this
+ *
+ * Returns @c get(s,n,widen('\n')).
+ */
+ __istream_type&
+ get(char_type* __s, streamsize __n)
+ { return this->get(__s, __n, this->widen('\n')); }
+
+ /**
+ * @brief Extraction into another streambuf.
+ * @param sb A streambuf in which to store data.
+ * @param delim A "stop" character.
+ * @return *this
+ *
+ * Characters are extracted and inserted into @a sb until one of the
+ * following happens:
+ *
+ * - the input sequence reaches EOF
+ * - insertion into the output buffer fails (in this case, the
+ * character that would have been inserted is not extracted)
+ * - the next character equals @a delim (in this case, the character
+ * is not extracted)
+ * - an exception occurs (and in this case is caught)
+ *
+ * If no characters are stored, failbit is set in the stream's error
+ * state.
+ */
+ __istream_type&
+ get(__streambuf_type& __sb, char_type __delim);
+
+ /**
+ * @brief Extraction into another streambuf.
+ * @param sb A streambuf in which to store data.
+ * @return *this
+ *
+ * Returns @c get(sb,widen('\n')).
+ */
+ __istream_type&
+ get(__streambuf_type& __sb)
+ { return this->get(__sb, this->widen('\n')); }
+
+ /**
+ * @brief String extraction.
+ * @param s A character array in which to store the data.
+ * @param n Maximum number of characters to extract.
+ * @param delim A "stop" character.
+ * @return *this
+ *
+ * Extracts and stores characters into @a s until one of the
+ * following happens. Note that these criteria are required to be
+ * tested in the order listed here, to allow an input line to exactly
+ * fill the @a s array without setting failbit.
+ *
+ * -# the input sequence reaches end-of-file, in which case eofbit
+ * is set in the stream error state
+ * -# the next character equals @c delim, in which case the character
+ * is extracted (and therefore counted in @c gcount()) but not stored
+ * -# @c n-1 characters are stored, in which case failbit is set
+ * in the stream error state
+ *
+ * If no characters are extracted, failbit is set. (An empty line of
+ * input should therefore not cause failbit to be set.)
+ *
+ * In any case, a null character is stored in the next location in
+ * the array.
+ */
+ __istream_type&
+ getline(char_type* __s, streamsize __n, char_type __delim);
+
+ /**
+ * @brief String extraction.
+ * @param s A character array in which to store the data.
+ * @param n Maximum number of characters to extract.
+ * @return *this
+ *
+ * Returns @c getline(s,n,widen('\n')).
+ */
+ __istream_type&
+ getline(char_type* __s, streamsize __n)
+ { return this->getline(__s, __n, this->widen('\n')); }
+
+ /**
+ * @brief Discarding characters
+ * @param n Number of characters to discard.
+ * @param delim A "stop" character.
+ * @return *this
+ *
+ * Extracts characters and throws them away until one of the
+ * following happens:
+ * - if @a n @c != @c std::numeric_limits<int>::max(), @a n
+ * characters are extracted
+ * - the input sequence reaches end-of-file
+ * - the next character equals @a delim (in this case, the character
+ * is extracted); note that this condition will never occur if
+ * @a delim equals @c traits::eof().
+ *
+ * NB: Provide three overloads, instead of the single function
+ * (with defaults) mandated by the Standard: this leads to a
+ * better performing implementation, while still conforming to
+ * the Standard.
+ */
+ __istream_type&
+ ignore();
+
+ __istream_type&
+ ignore(streamsize __n);
+
+ __istream_type&
+ ignore(streamsize __n, int_type __delim);
+
+ /**
+ * @brief Looking ahead in the stream
+ * @return The next character, or eof().
+ *
+ * If, after constructing the sentry object, @c good() is false,
+ * returns @c traits::eof(). Otherwise reads but does not extract
+ * the next input character.
+ */
+ int_type
+ peek();
+
+ /**
+ * @brief Extraction without delimiters.
+ * @param s A character array.
+ * @param n Maximum number of characters to store.
+ * @return *this
+ *
+ * If the stream state is @c good(), extracts characters and stores
+ * them into @a s until one of the following happens:
+ * - @a n characters are stored
+ * - the input sequence reaches end-of-file, in which case the error
+ * state is set to @c failbit|eofbit.
+ *
+ * @note This function is not overloaded on signed char and
+ * unsigned char.
+ */
+ __istream_type&
+ read(char_type* __s, streamsize __n);
+
+ /**
+ * @brief Extraction until the buffer is exhausted, but no more.
+ * @param s A character array.
+ * @param n Maximum number of characters to store.
+ * @return The number of characters extracted.
+ *
+ * Extracts characters and stores them into @a s depending on the
+ * number of characters remaining in the streambuf's buffer,
+ * @c rdbuf()->in_avail(), called @c A here:
+ * - if @c A @c == @c -1, sets eofbit and extracts no characters
+ * - if @c A @c == @c 0, extracts no characters
+ * - if @c A @c > @c 0, extracts @c min(A,n)
+ *
+ * The goal is to empty the current buffer, and to not request any
+ * more from the external input sequence controlled by the streambuf.
+ */
+ streamsize
+ readsome(char_type* __s, streamsize __n);
+
+ /**
+ * @brief Unextracting a single character.
+ * @param c The character to push back into the input stream.
+ * @return *this
+ *
+ * If @c rdbuf() is not null, calls @c rdbuf()->sputbackc(c).
+ *
+ * If @c rdbuf() is null or if @c sputbackc() fails, sets badbit in
+ * the error state.
+ *
+ * @note Since no characters are extracted, the next call to
+ * @c gcount() will return 0, as required by DR 60.
+ */
+ __istream_type&
+ putback(char_type __c);
+
+ /**
+ * @brief Unextracting the previous character.
+ * @return *this
+ *
+ * If @c rdbuf() is not null, calls @c rdbuf()->sungetc(c).
+ *
+ * If @c rdbuf() is null or if @c sungetc() fails, sets badbit in
+ * the error state.
+ *
+ * @note Since no characters are extracted, the next call to
+ * @c gcount() will return 0, as required by DR 60.
+ */
+ __istream_type&
+ unget();
+
+ /**
+ * @brief Synchronizing the stream buffer.
+ * @return 0 on success, -1 on failure
+ *
+ * If @c rdbuf() is a null pointer, returns -1.
+ *
+ * Otherwise, calls @c rdbuf()->pubsync(), and if that returns -1,
+ * sets badbit and returns -1.
+ *
+ * Otherwise, returns 0.
+ *
+ * @note This function does not count the number of characters
+ * extracted, if any, and therefore does not affect the next
+ * call to @c gcount().
+ */
+ int
+ sync();
+
+ /**
+ * @brief Getting the current read position.
+ * @return A file position object.
+ *
+ * If @c fail() is not false, returns @c pos_type(-1) to indicate
+ * failure. Otherwise returns @c rdbuf()->pubseekoff(0,cur,in).
+ *
+ * @note This function does not count the number of characters
+ * extracted, if any, and therefore does not affect the next
+ * call to @c gcount().
+ */
+ pos_type
+ tellg();
+
+ /**
+ * @brief Changing the current read position.
+ * @param pos A file position object.
+ * @return *this
+ *
+ * If @c fail() is not true, calls @c rdbuf()->pubseekpos(pos). If
+ * that function fails, sets failbit.
+ *
+ * @note This function does not count the number of characters
+ * extracted, if any, and therefore does not affect the next
+ * call to @c gcount().
+ */
+ __istream_type&
+ seekg(pos_type);
+
+ /**
+ * @brief Changing the current read position.
+ * @param off A file offset object.
+ * @param dir The direction in which to seek.
+ * @return *this
+ *
+ * If @c fail() is not true, calls @c rdbuf()->pubseekoff(off,dir).
+ * If that function fails, sets failbit.
+ *
+ * @note This function does not count the number of characters
+ * extracted, if any, and therefore does not affect the next
+ * call to @c gcount().
+ */
+ __istream_type&
+ seekg(off_type, ios_base::seekdir);
+ //@}
+
+ protected:
+ basic_istream()
+ : _M_gcount(streamsize(0))
+ { this->init(0); }
+
+ template<typename _ValueT>
+ __istream_type&
+ _M_extract(_ValueT& __v);
+ };
+
+ // Explicit specialization declarations, defined in src/istream.cc.
+ template<>
+ basic_istream<char>&
+ basic_istream<char>::
+ getline(char_type* __s, streamsize __n, char_type __delim);
+
+ template<>
+ basic_istream<char>&
+ basic_istream<char>::
+ ignore(streamsize __n);
+
+ template<>
+ basic_istream<char>&
+ basic_istream<char>::
+ ignore(streamsize __n, int_type __delim);
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ basic_istream<wchar_t>&
+ basic_istream<wchar_t>::
+ getline(char_type* __s, streamsize __n, char_type __delim);
+
+ template<>
+ basic_istream<wchar_t>&
+ basic_istream<wchar_t>::
+ ignore(streamsize __n);
+
+ template<>
+ basic_istream<wchar_t>&
+ basic_istream<wchar_t>::
+ ignore(streamsize __n, int_type __delim);
+#endif
+
+ /**
+ * @brief Performs setup work for input streams.
+ *
+ * Objects of this class are created before all of the standard
+ * extractors are run. It is responsible for "exception-safe prefix and
+ * suffix operations," although only prefix actions are currently required
+ * by the standard.
+ */
+ template<typename _CharT, typename _Traits>
+ class basic_istream<_CharT, _Traits>::sentry
+ {
+ public:
+ /// Easy access to dependant types.
+ typedef _Traits traits_type;
+ typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::__ctype_type __ctype_type;
+ typedef typename _Traits::int_type __int_type;
+
+ /**
+ * @brief The constructor performs all the work.
+ * @param is The input stream to guard.
+ * @param noskipws Whether to consume whitespace or not.
+ *
+ * If the stream state is good (@a is.good() is true), then the
+ * following actions are performed, otherwise the sentry state is
+ * false ("not okay") and failbit is set in the stream state.
+ *
+ * The sentry's preparatory actions are:
+ *
+ * -# if the stream is tied to an output stream, @c is.tie()->flush()
+ * is called to synchronize the output sequence
+ * -# if @a noskipws is false, and @c ios_base::skipws is set in
+ * @c is.flags(), the sentry extracts and discards whitespace
+ * characters from the stream. The currently imbued locale is
+ * used to determine whether each character is whitespace.
+ *
+ * If the stream state is still good, then the sentry state becomes
+ * true ("okay").
+ */
+ explicit
+ sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws = false);
+
+ /**
+ * @brief Quick status checking.
+ * @return The sentry state.
+ *
+ * For ease of use, sentries may be converted to booleans. The
+ * return value is that of the sentry state (true == okay).
+ */
+ operator bool() const
+ { return _M_ok; }
+
+ private:
+ bool _M_ok;
+ };
+
+ // [27.6.1.2.3] character extraction templates
+ //@{
+ /**
+ * @brief Character extractors
+ * @param in An input stream.
+ * @param c A character reference.
+ * @return in
+ *
+ * Behaves like one of the formatted arithmetic extractors described in
+ * std::basic_istream. After constructing a sentry object with good
+ * status, this function extracts a character (if one is available) and
+ * stores it in @a c. Otherwise, sets failbit in the input stream.
+ */
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c);
+
+ template<class _Traits>
+ inline basic_istream<char, _Traits>&
+ operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
+ { return (__in >> reinterpret_cast<char&>(__c)); }
+
+ template<class _Traits>
+ inline basic_istream<char, _Traits>&
+ operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
+ { return (__in >> reinterpret_cast<char&>(__c)); }
+ //@}
+
+ //@{
+ /**
+ * @brief Character string extractors
+ * @param in An input stream.
+ * @param s A pointer to a character array.
+ * @return in
+ *
+ * Behaves like one of the formatted arithmetic extractors described in
+ * std::basic_istream. After constructing a sentry object with good
+ * status, this function extracts up to @c n characters and stores them
+ * into the array starting at @a s. @c n is defined as:
+ *
+ * - if @c width() is greater than zero, @c n is width()
+ * - otherwise @c n is "the number of elements of the largest array of
+ * @c char_type that can store a terminating @c eos." [27.6.1.2.3]/6
+ *
+ * Characters are extracted and stored until one of the following happens:
+ * - @c n-1 characters are stored
+ * - EOF is reached
+ * - the next character is whitespace according to the current locale
+ * - the next character is a null byte (i.e., @c charT() )
+ *
+ * @c width(0) is then called for the input stream.
+ *
+ * If no characters are extracted, sets failbit.
+ */
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s);
+
+ // Explicit specialization declaration, defined in src/istream.cc.
+ template<>
+ basic_istream<char>&
+ operator>>(basic_istream<char>& __in, char* __s);
+
+ template<class _Traits>
+ inline basic_istream<char, _Traits>&
+ operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
+ { return (__in >> reinterpret_cast<char*>(__s)); }
+
+ template<class _Traits>
+ inline basic_istream<char, _Traits>&
+ operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
+ { return (__in >> reinterpret_cast<char*>(__s)); }
+ //@}
+
+ // 27.6.1.5 Template class basic_iostream
+ /**
+ * @brief Merging istream and ostream capabilities.
+ * @ingroup io
+ *
+ * This class multiply inherits from the input and output stream classes
+ * simply to provide a single interface.
+ */
+ template<typename _CharT, typename _Traits>
+ class basic_iostream
+ : public basic_istream<_CharT, _Traits>,
+ public basic_ostream<_CharT, _Traits>
+ {
+ public:
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 271. basic_iostream missing typedefs
+ // Types (inherited):
+ typedef _CharT char_type;
+ typedef typename _Traits::int_type int_type;
+ typedef typename _Traits::pos_type pos_type;
+ typedef typename _Traits::off_type off_type;
+ typedef _Traits traits_type;
+
+ // Non-standard Types:
+ typedef basic_istream<_CharT, _Traits> __istream_type;
+ typedef basic_ostream<_CharT, _Traits> __ostream_type;
+
+ /**
+ * @brief Constructor does nothing.
+ *
+ * Both of the parent classes are initialized with the same
+ * streambuf pointer passed to this constructor.
+ */
+ explicit
+ basic_iostream(basic_streambuf<_CharT, _Traits>* __sb)
+ : __istream_type(__sb), __ostream_type(__sb) { }
+
+ /**
+ * @brief Destructor does nothing.
+ */
+ virtual
+ ~basic_iostream() { }
+
+ protected:
+ basic_iostream()
+ : __istream_type(), __ostream_type() { }
+ };
+
+ // [27.6.1.4] standard basic_istream manipulators
+ /**
+ * @brief Quick and easy way to eat whitespace
+ *
+ * This manipulator extracts whitespace characters, stopping when the
+ * next character is non-whitespace, or when the input sequence is empty.
+ * If the sequence is empty, @c eofbit is set in the stream, but not
+ * @c failbit.
+ *
+ * The current locale is used to distinguish whitespace characters.
+ *
+ * Example:
+ * @code
+ * MyClass mc;
+ *
+ * std::cin >> std::ws >> mc;
+ * @endcode
+ * will skip leading whitespace before calling operator>> on cin and your
+ * object. Note that the same effect can be achieved by creating a
+ * std::basic_istream::sentry inside your definition of operator>>.
+ */
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ ws(basic_istream<_CharT, _Traits>& __is);
+
+_GLIBCXX_END_NAMESPACE
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/istream.tcc>
+#endif
+
+#endif /* _GLIBCXX_ISTREAM */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/iterator b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/iterator
new file mode 100644
index 0000000..a15bdf9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/iterator
@@ -0,0 +1,70 @@
+// <iterator> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/iterator
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_ITERATOR
+#define _GLIBCXX_ITERATOR 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <cstddef>
+#include <bits/stl_iterator_base_types.h>
+#include <bits/stl_iterator_base_funcs.h>
+#include <bits/stl_iterator.h>
+#include <ostream>
+#include <istream>
+#include <bits/stream_iterator.h>
+#include <bits/streambuf_iterator.h>
+
+#endif /* _GLIBCXX_ITERATOR */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/limits b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/limits
new file mode 100644
index 0000000..41bf806
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/limits
@@ -0,0 +1,1256 @@
+// The template and inlines for the numeric_limits classes. -*- C++ -*-
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+// 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file limits
+ * This is a Standard C++ Library header.
+ */
+
+// Note: this is not a conforming implementation.
+// Written by Gabriel Dos Reis <gdr@codesourcery.com>
+
+//
+// ISO 14882:1998
+// 18.2.1
+//
+
+#ifndef _GLIBCXX_NUMERIC_LIMITS
+#define _GLIBCXX_NUMERIC_LIMITS 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+
+//
+// The numeric_limits<> traits document implementation-defined aspects
+// of fundamental arithmetic data types (integers and floating points).
+// From Standard C++ point of view, there are 13 such types:
+// * integers
+// bool (1)
+// char, signed char, unsigned char (3)
+// short, unsigned short (2)
+// int, unsigned (2)
+// long, unsigned long (2)
+//
+// * floating points
+// float (1)
+// double (1)
+// long double (1)
+//
+// GNU C++ understands (where supported by the host C-library)
+// * integer
+// long long, unsigned long long (2)
+//
+// which brings us to 15 fundamental arithmetic data types in GNU C++.
+//
+//
+// Since a numeric_limits<> is a bit tricky to get right, we rely on
+// an interface composed of macros which should be defined in config/os
+// or config/cpu when they differ from the generic (read arbitrary)
+// definitions given here.
+//
+
+// These values can be overridden in the target configuration file.
+// The default values are appropriate for many 32-bit targets.
+
+// GCC only intrinsically supports modulo integral types. The only remaining
+// integral exceptional values is division by zero. Only targets that do not
+// signal division by zero in some "hard to ignore" way should use false.
+#ifndef __glibcxx_integral_traps
+# define __glibcxx_integral_traps true
+#endif
+
+// float
+//
+
+// Default values. Should be overridden in configuration files if necessary.
+
+#ifndef __glibcxx_float_has_denorm_loss
+# define __glibcxx_float_has_denorm_loss false
+#endif
+#ifndef __glibcxx_float_traps
+# define __glibcxx_float_traps false
+#endif
+#ifndef __glibcxx_float_tinyness_before
+# define __glibcxx_float_tinyness_before false
+#endif
+
+// double
+
+// Default values. Should be overridden in configuration files if necessary.
+
+#ifndef __glibcxx_double_has_denorm_loss
+# define __glibcxx_double_has_denorm_loss false
+#endif
+#ifndef __glibcxx_double_traps
+# define __glibcxx_double_traps false
+#endif
+#ifndef __glibcxx_double_tinyness_before
+# define __glibcxx_double_tinyness_before false
+#endif
+
+// long double
+
+// Default values. Should be overridden in configuration files if necessary.
+
+#ifndef __glibcxx_long_double_has_denorm_loss
+# define __glibcxx_long_double_has_denorm_loss false
+#endif
+#ifndef __glibcxx_long_double_traps
+# define __glibcxx_long_double_traps false
+#endif
+#ifndef __glibcxx_long_double_tinyness_before
+# define __glibcxx_long_double_tinyness_before false
+#endif
+
+// You should not need to define any macros below this point.
+
+#define __glibcxx_signed(T) ((T)(-1) < 0)
+
+#define __glibcxx_min(T) \
+ (__glibcxx_signed (T) ? (T)1 << __glibcxx_digits (T) : (T)0)
+
+#define __glibcxx_max(T) \
+ (__glibcxx_signed (T) ? \
+ (((((T)1 << (__glibcxx_digits (T) - 1)) - 1) << 1) + 1) : ~(T)0)
+
+#define __glibcxx_digits(T) \
+ (sizeof(T) * __CHAR_BIT__ - __glibcxx_signed (T))
+
+// The fraction 643/2136 approximates log10(2) to 7 significant digits.
+#define __glibcxx_digits10(T) \
+ (__glibcxx_digits (T) * 643 / 2136)
+
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @brief Describes the rounding style for floating-point types.
+ *
+ * This is used in the std::numeric_limits class.
+ */
+ enum float_round_style
+ {
+ round_indeterminate = -1, ///< Self-explanatory.
+ round_toward_zero = 0, ///< Self-explanatory.
+ round_to_nearest = 1, ///< To the nearest representable value.
+ round_toward_infinity = 2, ///< Self-explanatory.
+ round_toward_neg_infinity = 3 ///< Self-explanatory.
+ };
+
+ /**
+ * @brief Describes the denormalization for floating-point types.
+ *
+ * These values represent the presence or absence of a variable number
+ * of exponent bits. This type is used in the std::numeric_limits class.
+ */
+ enum float_denorm_style
+ {
+ /// Indeterminate at compile time whether denormalized values are allowed.
+ denorm_indeterminate = -1,
+ /// The type does not allow denormalized values.
+ denorm_absent = 0,
+ /// The type allows denormalized values.
+ denorm_present = 1
+ };
+
+ /**
+ * @brief Part of std::numeric_limits.
+ *
+ * The @c static @c const members are usable as integral constant
+ * expressions.
+ *
+ * @note This is a separate class for purposes of efficiency; you
+ * should only access these members as part of an instantiation
+ * of the std::numeric_limits class.
+ */
+ struct __numeric_limits_base
+ {
+ /** This will be true for all fundamental types (which have
+ specializations), and false for everything else. */
+ static const bool is_specialized = false;
+
+ /** The number of @c radix digits that be represented without change: for
+ integer types, the number of non-sign bits in the mantissa; for
+ floating types, the number of @c radix digits in the mantissa. */
+ static const int digits = 0;
+ /** The number of base 10 digits that can be represented without change. */
+ static const int digits10 = 0;
+ /** True if the type is signed. */
+ static const bool is_signed = false;
+ /** True if the type is integer.
+ * Is this supposed to be "if the type is integral"?
+ */
+ static const bool is_integer = false;
+ /** True if the type uses an exact representation. "All integer types are
+ exact, but not all exact types are integer. For example, rational and
+ fixed-exponent representations are exact but not integer."
+ [18.2.1.2]/15 */
+ static const bool is_exact = false;
+ /** For integer types, specifies the base of the representation. For
+ floating types, specifies the base of the exponent representation. */
+ static const int radix = 0;
+
+ /** The minimum negative integer such that @c radix raised to the power of
+ (one less than that integer) is a normalized floating point number. */
+ static const int min_exponent = 0;
+ /** The minimum negative integer such that 10 raised to that power is in
+ the range of normalized floating point numbers. */
+ static const int min_exponent10 = 0;
+ /** The maximum positive integer such that @c radix raised to the power of
+ (one less than that integer) is a representable finite floating point
+ number. */
+ static const int max_exponent = 0;
+ /** The maximum positive integer such that 10 raised to that power is in
+ the range of representable finite floating point numbers. */
+ static const int max_exponent10 = 0;
+
+ /** True if the type has a representation for positive infinity. */
+ static const bool has_infinity = false;
+ /** True if the type has a representation for a quiet (non-signaling)
+ "Not a Number." */
+ static const bool has_quiet_NaN = false;
+ /** True if the type has a representation for a signaling
+ "Not a Number." */
+ static const bool has_signaling_NaN = false;
+ /** See std::float_denorm_style for more information. */
+ static const float_denorm_style has_denorm = denorm_absent;
+ /** "True if loss of accuracy is detected as a denormalization loss,
+ rather than as an inexact result." [18.2.1.2]/42 */
+ static const bool has_denorm_loss = false;
+
+ /** True if-and-only-if the type adheres to the IEC 559 standard, also
+ known as IEEE 754. (Only makes sense for floating point types.) */
+ static const bool is_iec559 = false;
+ /** "True if the set of values representable by the type is finite. All
+ built-in types are bounded, this member would be false for arbitrary
+ precision types." [18.2.1.2]/54 */
+ static const bool is_bounded = false;
+ /** True if the type is @e modulo, that is, if it is possible to add two
+ positive numbers and have a result that wraps around to a third number
+ that is less. Typically false for floating types, true for unsigned
+ integers, and true for signed integers. */
+ static const bool is_modulo = false;
+
+ /** True if trapping is implemented for this type. */
+ static const bool traps = false;
+ /** True if tininess is detected before rounding. (see IEC 559) */
+ static const bool tinyness_before = false;
+ /** See std::float_round_style for more information. This is only
+ meaningful for floating types; integer types will all be
+ round_toward_zero. */
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /**
+ * @brief Properties of fundamental types.
+ *
+ * This class allows a program to obtain information about the
+ * representation of a fundamental type on a given platform. For
+ * non-fundamental types, the functions will return 0 and the data
+ * members will all be @c false.
+ *
+ * _GLIBCXX_RESOLVE_LIB_DEFECTS: DRs 201 and 184 (hi Gaby!) are
+ * noted, but not incorporated in this documented (yet).
+ */
+ template<typename _Tp>
+ struct numeric_limits : public __numeric_limits_base
+ {
+ /** The minimum finite value, or for floating types with
+ denormalization, the minimum positive normalized value. */
+ static _Tp min() throw() { return static_cast<_Tp>(0); }
+ /** The maximum finite value. */
+ static _Tp max() throw() { return static_cast<_Tp>(0); }
+ /** The @e machine @e epsilon: the difference between 1 and the least
+ value greater than 1 that is representable. */
+ static _Tp epsilon() throw() { return static_cast<_Tp>(0); }
+ /** The maximum rounding error measurement (see LIA-1). */
+ static _Tp round_error() throw() { return static_cast<_Tp>(0); }
+ /** The representation of positive infinity, if @c has_infinity. */
+ static _Tp infinity() throw() { return static_cast<_Tp>(0); }
+ /** The representation of a quiet "Not a Number," if @c has_quiet_NaN. */
+ static _Tp quiet_NaN() throw() { return static_cast<_Tp>(0); }
+ /** The representation of a signaling "Not a Number," if
+ @c has_signaling_NaN. */
+ static _Tp signaling_NaN() throw() { return static_cast<_Tp>(0); }
+ /** The minimum positive denormalized value. For types where
+ @c has_denorm is false, this is the minimum positive normalized
+ value. */
+ static _Tp denorm_min() throw() { return static_cast<_Tp>(0); }
+ };
+
+ // Now there follow 15 explicit specializations. Yes, 15. Make sure
+ // you get the count right.
+
+ /// numeric_limits<bool> specialization.
+ template<>
+ struct numeric_limits<bool>
+ {
+ static const bool is_specialized = true;
+
+ static bool min() throw()
+ { return false; }
+ static bool max() throw()
+ { return true; }
+
+ static const int digits = 1;
+ static const int digits10 = 0;
+ static const bool is_signed = false;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static bool epsilon() throw()
+ { return false; }
+ static bool round_error() throw()
+ { return false; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static bool infinity() throw()
+ { return false; }
+ static bool quiet_NaN() throw()
+ { return false; }
+ static bool signaling_NaN() throw()
+ { return false; }
+ static bool denorm_min() throw()
+ { return false; }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = false;
+
+ // It is not clear what it means for a boolean type to trap.
+ // This is a DR on the LWG issue list. Here, I use integer
+ // promotion semantics.
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<char> specialization.
+ template<>
+ struct numeric_limits<char>
+ {
+ static const bool is_specialized = true;
+
+ static char min() throw()
+ { return __glibcxx_min(char); }
+ static char max() throw()
+ { return __glibcxx_max(char); }
+
+ static const int digits = __glibcxx_digits (char);
+ static const int digits10 = __glibcxx_digits10 (char);
+ static const bool is_signed = __glibcxx_signed (char);
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static char epsilon() throw()
+ { return 0; }
+ static char round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static char infinity() throw()
+ { return char(); }
+ static char quiet_NaN() throw()
+ { return char(); }
+ static char signaling_NaN() throw()
+ { return char(); }
+ static char denorm_min() throw()
+ { return static_cast<char>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<signed char> specialization.
+ template<>
+ struct numeric_limits<signed char>
+ {
+ static const bool is_specialized = true;
+
+ static signed char min() throw()
+ { return -__SCHAR_MAX__ - 1; }
+ static signed char max() throw()
+ { return __SCHAR_MAX__; }
+
+ static const int digits = __glibcxx_digits (signed char);
+ static const int digits10 = __glibcxx_digits10 (signed char);
+ static const bool is_signed = true;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static signed char epsilon() throw()
+ { return 0; }
+ static signed char round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static signed char infinity() throw()
+ { return static_cast<signed char>(0); }
+ static signed char quiet_NaN() throw()
+ { return static_cast<signed char>(0); }
+ static signed char signaling_NaN() throw()
+ { return static_cast<signed char>(0); }
+ static signed char denorm_min() throw()
+ { return static_cast<signed char>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<unsigned char> specialization.
+ template<>
+ struct numeric_limits<unsigned char>
+ {
+ static const bool is_specialized = true;
+
+ static unsigned char min() throw()
+ { return 0; }
+ static unsigned char max() throw()
+ { return __SCHAR_MAX__ * 2U + 1; }
+
+ static const int digits = __glibcxx_digits (unsigned char);
+ static const int digits10 = __glibcxx_digits10 (unsigned char);
+ static const bool is_signed = false;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static unsigned char epsilon() throw()
+ { return 0; }
+ static unsigned char round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static unsigned char infinity() throw()
+ { return static_cast<unsigned char>(0); }
+ static unsigned char quiet_NaN() throw()
+ { return static_cast<unsigned char>(0); }
+ static unsigned char signaling_NaN() throw()
+ { return static_cast<unsigned char>(0); }
+ static unsigned char denorm_min() throw()
+ { return static_cast<unsigned char>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<wchar_t> specialization.
+ template<>
+ struct numeric_limits<wchar_t>
+ {
+ static const bool is_specialized = true;
+
+ static wchar_t min() throw()
+ { return __glibcxx_min (wchar_t); }
+ static wchar_t max() throw()
+ { return __glibcxx_max (wchar_t); }
+
+ static const int digits = __glibcxx_digits (wchar_t);
+ static const int digits10 = __glibcxx_digits10 (wchar_t);
+ static const bool is_signed = __glibcxx_signed (wchar_t);
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static wchar_t epsilon() throw()
+ { return 0; }
+ static wchar_t round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static wchar_t infinity() throw()
+ { return wchar_t(); }
+ static wchar_t quiet_NaN() throw()
+ { return wchar_t(); }
+ static wchar_t signaling_NaN() throw()
+ { return wchar_t(); }
+ static wchar_t denorm_min() throw()
+ { return wchar_t(); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /// numeric_limits<char16_t> specialization.
+ template<>
+ struct numeric_limits<char16_t>
+ {
+ static const bool is_specialized = true;
+
+ static char16_t min() throw()
+ { return __glibcxx_min (char16_t); }
+ static char16_t max() throw()
+ { return __glibcxx_max (char16_t); }
+
+ static const int digits = __glibcxx_digits (char16_t);
+ static const int digits10 = __glibcxx_digits10 (char16_t);
+ static const bool is_signed = __glibcxx_signed (char16_t);
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static char16_t epsilon() throw()
+ { return 0; }
+ static char16_t round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static char16_t infinity() throw()
+ { return char16_t(); }
+ static char16_t quiet_NaN() throw()
+ { return char16_t(); }
+ static char16_t signaling_NaN() throw()
+ { return char16_t(); }
+ static char16_t denorm_min() throw()
+ { return char16_t(); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<char32_t> specialization.
+ template<>
+ struct numeric_limits<char32_t>
+ {
+ static const bool is_specialized = true;
+
+ static char32_t min() throw()
+ { return __glibcxx_min (char32_t); }
+ static char32_t max() throw()
+ { return __glibcxx_max (char32_t); }
+
+ static const int digits = __glibcxx_digits (char32_t);
+ static const int digits10 = __glibcxx_digits10 (char32_t);
+ static const bool is_signed = __glibcxx_signed (char32_t);
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static char32_t epsilon() throw()
+ { return 0; }
+ static char32_t round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static char32_t infinity() throw()
+ { return char32_t(); }
+ static char32_t quiet_NaN() throw()
+ { return char32_t(); }
+ static char32_t signaling_NaN() throw()
+ { return char32_t(); }
+ static char32_t denorm_min() throw()
+ { return char32_t(); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+#endif
+
+ /// numeric_limits<short> specialization.
+ template<>
+ struct numeric_limits<short>
+ {
+ static const bool is_specialized = true;
+
+ static short min() throw()
+ { return -__SHRT_MAX__ - 1; }
+ static short max() throw()
+ { return __SHRT_MAX__; }
+
+ static const int digits = __glibcxx_digits (short);
+ static const int digits10 = __glibcxx_digits10 (short);
+ static const bool is_signed = true;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static short epsilon() throw()
+ { return 0; }
+ static short round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static short infinity() throw()
+ { return short(); }
+ static short quiet_NaN() throw()
+ { return short(); }
+ static short signaling_NaN() throw()
+ { return short(); }
+ static short denorm_min() throw()
+ { return short(); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<unsigned short> specialization.
+ template<>
+ struct numeric_limits<unsigned short>
+ {
+ static const bool is_specialized = true;
+
+ static unsigned short min() throw()
+ { return 0; }
+ static unsigned short max() throw()
+ { return __SHRT_MAX__ * 2U + 1; }
+
+ static const int digits = __glibcxx_digits (unsigned short);
+ static const int digits10 = __glibcxx_digits10 (unsigned short);
+ static const bool is_signed = false;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static unsigned short epsilon() throw()
+ { return 0; }
+ static unsigned short round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static unsigned short infinity() throw()
+ { return static_cast<unsigned short>(0); }
+ static unsigned short quiet_NaN() throw()
+ { return static_cast<unsigned short>(0); }
+ static unsigned short signaling_NaN() throw()
+ { return static_cast<unsigned short>(0); }
+ static unsigned short denorm_min() throw()
+ { return static_cast<unsigned short>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<int> specialization.
+ template<>
+ struct numeric_limits<int>
+ {
+ static const bool is_specialized = true;
+
+ static int min() throw()
+ { return -__INT_MAX__ - 1; }
+ static int max() throw()
+ { return __INT_MAX__; }
+
+ static const int digits = __glibcxx_digits (int);
+ static const int digits10 = __glibcxx_digits10 (int);
+ static const bool is_signed = true;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static int epsilon() throw()
+ { return 0; }
+ static int round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static int infinity() throw()
+ { return static_cast<int>(0); }
+ static int quiet_NaN() throw()
+ { return static_cast<int>(0); }
+ static int signaling_NaN() throw()
+ { return static_cast<int>(0); }
+ static int denorm_min() throw()
+ { return static_cast<int>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<unsigned int> specialization.
+ template<>
+ struct numeric_limits<unsigned int>
+ {
+ static const bool is_specialized = true;
+
+ static unsigned int min() throw()
+ { return 0; }
+ static unsigned int max() throw()
+ { return __INT_MAX__ * 2U + 1; }
+
+ static const int digits = __glibcxx_digits (unsigned int);
+ static const int digits10 = __glibcxx_digits10 (unsigned int);
+ static const bool is_signed = false;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static unsigned int epsilon() throw()
+ { return 0; }
+ static unsigned int round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static unsigned int infinity() throw()
+ { return static_cast<unsigned int>(0); }
+ static unsigned int quiet_NaN() throw()
+ { return static_cast<unsigned int>(0); }
+ static unsigned int signaling_NaN() throw()
+ { return static_cast<unsigned int>(0); }
+ static unsigned int denorm_min() throw()
+ { return static_cast<unsigned int>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<long> specialization.
+ template<>
+ struct numeric_limits<long>
+ {
+ static const bool is_specialized = true;
+
+ static long min() throw()
+ { return -__LONG_MAX__ - 1; }
+ static long max() throw()
+ { return __LONG_MAX__; }
+
+ static const int digits = __glibcxx_digits (long);
+ static const int digits10 = __glibcxx_digits10 (long);
+ static const bool is_signed = true;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static long epsilon() throw()
+ { return 0; }
+ static long round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static long infinity() throw()
+ { return static_cast<long>(0); }
+ static long quiet_NaN() throw()
+ { return static_cast<long>(0); }
+ static long signaling_NaN() throw()
+ { return static_cast<long>(0); }
+ static long denorm_min() throw()
+ { return static_cast<long>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<unsigned long> specialization.
+ template<>
+ struct numeric_limits<unsigned long>
+ {
+ static const bool is_specialized = true;
+
+ static unsigned long min() throw()
+ { return 0; }
+ static unsigned long max() throw()
+ { return __LONG_MAX__ * 2UL + 1; }
+
+ static const int digits = __glibcxx_digits (unsigned long);
+ static const int digits10 = __glibcxx_digits10 (unsigned long);
+ static const bool is_signed = false;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static unsigned long epsilon() throw()
+ { return 0; }
+ static unsigned long round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static unsigned long infinity() throw()
+ { return static_cast<unsigned long>(0); }
+ static unsigned long quiet_NaN() throw()
+ { return static_cast<unsigned long>(0); }
+ static unsigned long signaling_NaN() throw()
+ { return static_cast<unsigned long>(0); }
+ static unsigned long denorm_min() throw()
+ { return static_cast<unsigned long>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<long long> specialization.
+ template<>
+ struct numeric_limits<long long>
+ {
+ static const bool is_specialized = true;
+
+ static long long min() throw()
+ { return -__LONG_LONG_MAX__ - 1; }
+ static long long max() throw()
+ { return __LONG_LONG_MAX__; }
+
+ static const int digits = __glibcxx_digits (long long);
+ static const int digits10 = __glibcxx_digits10 (long long);
+ static const bool is_signed = true;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static long long epsilon() throw()
+ { return 0; }
+ static long long round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static long long infinity() throw()
+ { return static_cast<long long>(0); }
+ static long long quiet_NaN() throw()
+ { return static_cast<long long>(0); }
+ static long long signaling_NaN() throw()
+ { return static_cast<long long>(0); }
+ static long long denorm_min() throw()
+ { return static_cast<long long>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<unsigned long long> specialization.
+ template<>
+ struct numeric_limits<unsigned long long>
+ {
+ static const bool is_specialized = true;
+
+ static unsigned long long min() throw()
+ { return 0; }
+ static unsigned long long max() throw()
+ { return __LONG_LONG_MAX__ * 2ULL + 1; }
+
+ static const int digits = __glibcxx_digits (unsigned long long);
+ static const int digits10 = __glibcxx_digits10 (unsigned long long);
+ static const bool is_signed = false;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static unsigned long long epsilon() throw()
+ { return 0; }
+ static unsigned long long round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static unsigned long long infinity() throw()
+ { return static_cast<unsigned long long>(0); }
+ static unsigned long long quiet_NaN() throw()
+ { return static_cast<unsigned long long>(0); }
+ static unsigned long long signaling_NaN() throw()
+ { return static_cast<unsigned long long>(0); }
+ static unsigned long long denorm_min() throw()
+ { return static_cast<unsigned long long>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcxx_integral_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ /// numeric_limits<float> specialization.
+ template<>
+ struct numeric_limits<float>
+ {
+ static const bool is_specialized = true;
+
+ static float min() throw()
+ { return __FLT_MIN__; }
+ static float max() throw()
+ { return __FLT_MAX__; }
+
+ static const int digits = __FLT_MANT_DIG__;
+ static const int digits10 = __FLT_DIG__;
+ static const bool is_signed = true;
+ static const bool is_integer = false;
+ static const bool is_exact = false;
+ static const int radix = __FLT_RADIX__;
+ static float epsilon() throw()
+ { return __FLT_EPSILON__; }
+ static float round_error() throw()
+ { return 0.5F; }
+
+ static const int min_exponent = __FLT_MIN_EXP__;
+ static const int min_exponent10 = __FLT_MIN_10_EXP__;
+ static const int max_exponent = __FLT_MAX_EXP__;
+ static const int max_exponent10 = __FLT_MAX_10_EXP__;
+
+ static const bool has_infinity = __FLT_HAS_INFINITY__;
+ static const bool has_quiet_NaN = __FLT_HAS_QUIET_NAN__;
+ static const bool has_signaling_NaN = has_quiet_NaN;
+ static const float_denorm_style has_denorm
+ = bool(__FLT_HAS_DENORM__) ? denorm_present : denorm_absent;
+ static const bool has_denorm_loss = __glibcxx_float_has_denorm_loss;
+
+ static float infinity() throw()
+ { return __builtin_huge_valf (); }
+ static float quiet_NaN() throw()
+ { return __builtin_nanf (""); }
+ static float signaling_NaN() throw()
+ { return __builtin_nansf (""); }
+ static float denorm_min() throw()
+ { return __FLT_DENORM_MIN__; }
+
+ static const bool is_iec559
+ = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
+ static const bool is_bounded = true;
+ static const bool is_modulo = false;
+
+ static const bool traps = __glibcxx_float_traps;
+ static const bool tinyness_before = __glibcxx_float_tinyness_before;
+ static const float_round_style round_style = round_to_nearest;
+ };
+
+#undef __glibcxx_float_has_denorm_loss
+#undef __glibcxx_float_traps
+#undef __glibcxx_float_tinyness_before
+
+ /// numeric_limits<double> specialization.
+ template<>
+ struct numeric_limits<double>
+ {
+ static const bool is_specialized = true;
+
+ static double min() throw()
+ { return __DBL_MIN__; }
+ static double max() throw()
+ { return __DBL_MAX__; }
+
+ static const int digits = __DBL_MANT_DIG__;
+ static const int digits10 = __DBL_DIG__;
+ static const bool is_signed = true;
+ static const bool is_integer = false;
+ static const bool is_exact = false;
+ static const int radix = __FLT_RADIX__;
+ static double epsilon() throw()
+ { return __DBL_EPSILON__; }
+ static double round_error() throw()
+ { return 0.5; }
+
+ static const int min_exponent = __DBL_MIN_EXP__;
+ static const int min_exponent10 = __DBL_MIN_10_EXP__;
+ static const int max_exponent = __DBL_MAX_EXP__;
+ static const int max_exponent10 = __DBL_MAX_10_EXP__;
+
+ static const bool has_infinity = __DBL_HAS_INFINITY__;
+ static const bool has_quiet_NaN = __DBL_HAS_QUIET_NAN__;
+ static const bool has_signaling_NaN = has_quiet_NaN;
+ static const float_denorm_style has_denorm
+ = bool(__DBL_HAS_DENORM__) ? denorm_present : denorm_absent;
+ static const bool has_denorm_loss = __glibcxx_double_has_denorm_loss;
+
+ static double infinity() throw()
+ { return __builtin_huge_val(); }
+ static double quiet_NaN() throw()
+ { return __builtin_nan (""); }
+ static double signaling_NaN() throw()
+ { return __builtin_nans (""); }
+ static double denorm_min() throw()
+ { return __DBL_DENORM_MIN__; }
+
+ static const bool is_iec559
+ = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
+ static const bool is_bounded = true;
+ static const bool is_modulo = false;
+
+ static const bool traps = __glibcxx_double_traps;
+ static const bool tinyness_before = __glibcxx_double_tinyness_before;
+ static const float_round_style round_style = round_to_nearest;
+ };
+
+#undef __glibcxx_double_has_denorm_loss
+#undef __glibcxx_double_traps
+#undef __glibcxx_double_tinyness_before
+
+ /// numeric_limits<long double> specialization.
+ template<>
+ struct numeric_limits<long double>
+ {
+ static const bool is_specialized = true;
+
+ static long double min() throw()
+ { return __LDBL_MIN__; }
+ static long double max() throw()
+ { return __LDBL_MAX__; }
+
+ static const int digits = __LDBL_MANT_DIG__;
+ static const int digits10 = __LDBL_DIG__;
+ static const bool is_signed = true;
+ static const bool is_integer = false;
+ static const bool is_exact = false;
+ static const int radix = __FLT_RADIX__;
+ static long double epsilon() throw()
+ { return __LDBL_EPSILON__; }
+ static long double round_error() throw()
+ { return 0.5L; }
+
+ static const int min_exponent = __LDBL_MIN_EXP__;
+ static const int min_exponent10 = __LDBL_MIN_10_EXP__;
+ static const int max_exponent = __LDBL_MAX_EXP__;
+ static const int max_exponent10 = __LDBL_MAX_10_EXP__;
+
+ static const bool has_infinity = __LDBL_HAS_INFINITY__;
+ static const bool has_quiet_NaN = __LDBL_HAS_QUIET_NAN__;
+ static const bool has_signaling_NaN = has_quiet_NaN;
+ static const float_denorm_style has_denorm
+ = bool(__LDBL_HAS_DENORM__) ? denorm_present : denorm_absent;
+ static const bool has_denorm_loss
+ = __glibcxx_long_double_has_denorm_loss;
+
+ static long double infinity() throw()
+ { return __builtin_huge_vall (); }
+ static long double quiet_NaN() throw()
+ { return __builtin_nanl (""); }
+ static long double signaling_NaN() throw()
+ { return __builtin_nansl (""); }
+ static long double denorm_min() throw()
+ { return __LDBL_DENORM_MIN__; }
+
+ static const bool is_iec559
+ = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
+ static const bool is_bounded = true;
+ static const bool is_modulo = false;
+
+ static const bool traps = __glibcxx_long_double_traps;
+ static const bool tinyness_before = __glibcxx_long_double_tinyness_before;
+ static const float_round_style round_style = round_to_nearest;
+ };
+
+#undef __glibcxx_long_double_has_denorm_loss
+#undef __glibcxx_long_double_traps
+#undef __glibcxx_long_double_tinyness_before
+
+_GLIBCXX_END_NAMESPACE
+
+#undef __glibcxx_signed
+#undef __glibcxx_min
+#undef __glibcxx_max
+#undef __glibcxx_digits
+#undef __glibcxx_digits10
+
+#endif // _GLIBCXX_NUMERIC_LIMITS
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/list b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/list
new file mode 100644
index 0000000..d199802
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/list
@@ -0,0 +1,74 @@
+// <list> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/list
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_LIST
+#define _GLIBCXX_LIST 1
+
+#pragma GCC system_header
+
+#include <bits/stl_algobase.h>
+#include <bits/allocator.h>
+#include <bits/stl_list.h>
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/list.tcc>
+#endif
+
+#ifdef _GLIBCXX_DEBUG
+# include <debug/list>
+#endif
+
+#endif /* _GLIBCXX_LIST */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/locale b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/locale
new file mode 100644
index 0000000..3504b77
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/locale
@@ -0,0 +1,45 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+// 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+/** @file locale
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_LOCALE
+#define _GLIBCXX_LOCALE 1
+
+#pragma GCC system_header
+
+#include <bits/localefwd.h>
+#include <bits/locale_classes.h>
+#include <bits/locale_facets.h>
+#include <bits/locale_facets_nonio.h>
+
+#endif /* _GLIBCXX_LOCALE */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/map b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/map
new file mode 100644
index 0000000..159bfb3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/map
@@ -0,0 +1,68 @@
+// <map> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/map
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_MAP
+#define _GLIBCXX_MAP 1
+
+#pragma GCC system_header
+
+#include <bits/stl_tree.h>
+#include <bits/stl_map.h>
+#include <bits/stl_multimap.h>
+
+#ifdef _GLIBCXX_DEBUG
+# include <debug/map>
+#endif
+
+#endif /* _GLIBCXX_MAP */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/memory b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/memory
new file mode 100644
index 0000000..9defd48
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/memory
@@ -0,0 +1,100 @@
+// <memory> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ * Copyright (c) 1997-1999
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+/** @file include/memory
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_MEMORY
+#define _GLIBCXX_MEMORY 1
+
+#pragma GCC system_header
+
+#include <bits/stl_algobase.h>
+#include <bits/allocator.h>
+#include <bits/stl_construct.h>
+#include <bits/stl_uninitialized.h>
+#include <bits/stl_tempbuf.h>
+#include <bits/stl_raw_storage_iter.h>
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# include <exception> // std::exception
+# include <typeinfo> // std::type_info in get_deleter
+# include <iosfwd> // std::basic_ostream
+# include <ext/atomicity.h>
+# include <ext/concurrence.h>
+# include <bits/functexcept.h>
+# include <bits/stl_function.h> // std::less
+# include <bits/unique_ptr.h>
+# include <debug/debug.h>
+# include <type_traits>
+# include <functional>
+# if _GLIBCXX_DEPRECATED
+# include <backward/auto_ptr.h>
+# endif
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/boost_sp_counted_base.h>
+# include <bits/shared_ptr.h>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/boost_sp_counted_base.h>
+# include <bits/shared_ptr.h>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+#else
+# include <backward/auto_ptr.h>
+#endif
+
+/**
+ * @defgroup memory Memory
+ * @ingroup utilities
+ *
+ * Components for memory allocation, deallocation, and management.
+ */
+
+#endif /* _GLIBCXX_MEMORY */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/atomic_word.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/atomic_word.h
new file mode 100644
index 0000000..f2bdbbc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/atomic_word.h
@@ -0,0 +1,47 @@
+// Low-level type for atomic operations -*- C++ -*-
+
+// Copyright (C) 2004, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file atomic_word.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_ATOMIC_WORD_H
+#define _GLIBCXX_ATOMIC_WORD_H 1
+
+typedef int _Atomic_word;
+
+// Define these two macros using the appropriate memory barrier for the target.
+// The commented out versions below are the defaults.
+// See ia64/atomic_word.h for an alternative approach.
+
+// This one prevents loads from being hoisted across the barrier;
+// in other words, this is a Load-Load acquire barrier.
+// This is necessary iff TARGET_RELAXED_ORDERING is defined in tm.h.
+// #define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("":::"memory")
+
+// This one prevents stores from being sunk across the barrier; in other
+// words, a Store-Store release barrier.
+// #define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("":::"memory")
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/basic_file.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/basic_file.h
new file mode 100644
index 0000000..eedb73b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/basic_file.h
@@ -0,0 +1,108 @@
+// Wrapper of C-language FILE struct -*- C++ -*-
+
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+//
+// ISO C++ 14882: 27.8 File-based streams
+//
+
+/** @file basic_file.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_BASIC_FILE_STDIO_H
+#define _GLIBCXX_BASIC_FILE_STDIO_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/c++io.h> // for __c_lock and __c_file
+#include <ios>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Generic declaration.
+ template<typename _CharT>
+ class __basic_file;
+
+ // Specialization.
+ template<>
+ class __basic_file<char>
+ {
+ // Underlying data source/sink.
+ __c_file* _M_cfile;
+
+ // True iff we opened _M_cfile, and thus must close it ourselves.
+ bool _M_cfile_created;
+
+ public:
+ __basic_file(__c_lock* __lock = 0);
+
+ __basic_file*
+ open(const char* __name, ios_base::openmode __mode, int __prot = 0664);
+
+ __basic_file*
+ sys_open(__c_file* __file, ios_base::openmode);
+
+ __basic_file*
+ sys_open(int __fd, ios_base::openmode __mode);
+
+ __basic_file*
+ close();
+
+ bool
+ is_open() const;
+
+ int
+ fd();
+
+ __c_file*
+ file();
+
+ ~__basic_file();
+
+ streamsize
+ xsputn(const char* __s, streamsize __n);
+
+ streamsize
+ xsputn_2(const char* __s1, streamsize __n1,
+ const char* __s2, streamsize __n2);
+
+ streamsize
+ xsgetn(char* __s, streamsize __n);
+
+ streamoff
+ seekoff(streamoff __off, ios_base::seekdir __way);
+
+ int
+ sync();
+
+ streamsize
+ showmanyc();
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/c++allocator.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/c++allocator.h
new file mode 100644
index 0000000..c33a124
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/c++allocator.h
@@ -0,0 +1,37 @@
+// Base to std::allocator -*- C++ -*-
+
+// Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file c++allocator.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_CXX_ALLOCATOR_H
+#define _GLIBCXX_CXX_ALLOCATOR_H 1
+
+// Define new_allocator as the base class to std::allocator.
+#include <ext/new_allocator.h>
+#define __glibcxx_base_allocator __gnu_cxx::new_allocator
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/c++config.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/c++config.h
new file mode 100644
index 0000000..d19d194
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/c++config.h
@@ -0,0 +1,1431 @@
+// Predefined symbols and macros -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file c++config.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_CXX_CONFIG_H
+#define _GLIBCXX_CXX_CONFIG_H 1
+
+// The current version of the C++ library in compressed ISO date format.
+#define __GLIBCXX__ 20091015
+
+// Macros for visibility.
+// _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
+// _GLIBCXX_VISIBILITY_ATTR
+# define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY 1
+
+#if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
+# define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ (#V)))
+#else
+# define _GLIBCXX_VISIBILITY_ATTR(V)
+#endif
+
+// Macros for deprecated.
+// _GLIBCXX_DEPRECATED
+// _GLIBCXX_DEPRECATED_ATTR
+#ifndef _GLIBCXX_DEPRECATED
+# define _GLIBCXX_DEPRECATED 1
+#endif
+
+#if defined(__DEPRECATED) && defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define _GLIBCXX_DEPRECATED_ATTR __attribute__ ((__deprecated__))
+#else
+# define _GLIBCXX_DEPRECATED_ATTR
+#endif
+
+// Macros for activating various namespace association modes.
+// _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
+// _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
+// _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
+
+// Guide to libstdc++ namespaces.
+/*
+ namespace std
+ {
+ namespace __debug { }
+ namespace __parallel { }
+ namespace __norm { } // __normative, __shadow, __replaced
+ namespace __cxx1998 { }
+
+ namespace tr1 { }
+ }
+*/
+#if __cplusplus
+
+#ifdef _GLIBCXX_DEBUG
+# define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1
+#endif
+
+#ifdef _GLIBCXX_PARALLEL
+# define _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL 1
+#endif
+
+# define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION 0
+
+// Defined if any namespace association modes are active.
+#if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG \
+ || _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL \
+ || _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
+# define _GLIBCXX_USE_NAMESPACE_ASSOCIATION 1
+#endif
+
+// Macros for namespace scope. Either namespace std:: or the name
+// of some nested namespace within it.
+// _GLIBCXX_STD
+// _GLIBCXX_STD_D
+// _GLIBCXX_STD_P
+//
+// Macros for enclosing namespaces and possibly nested namespaces.
+// _GLIBCXX_BEGIN_NAMESPACE
+// _GLIBCXX_END_NAMESPACE
+// _GLIBCXX_BEGIN_NESTED_NAMESPACE
+// _GLIBCXX_END_NESTED_NAMESPACE
+#ifndef _GLIBCXX_USE_NAMESPACE_ASSOCIATION
+# define _GLIBCXX_STD_D _GLIBCXX_STD
+# define _GLIBCXX_STD_P _GLIBCXX_STD
+# define _GLIBCXX_STD std
+# define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) _GLIBCXX_BEGIN_NAMESPACE(X)
+# define _GLIBCXX_END_NESTED_NAMESPACE _GLIBCXX_END_NAMESPACE
+# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
+# define _GLIBCXX_END_NAMESPACE }
+#else
+
+# if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION // && not anything else
+# define _GLIBCXX_STD_D _GLIBCXX_STD
+# define _GLIBCXX_STD_P _GLIBCXX_STD
+# define _GLIBCXX_STD _6
+# define _GLIBCXX_BEGIN_NAMESPACE(X) _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, _6)
+# define _GLIBCXX_END_NAMESPACE _GLIBCXX_END_NESTED_NAMESPACE
+# endif
+
+// debug
+# if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG && !_GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
+# define _GLIBCXX_STD_D __norm
+# define _GLIBCXX_STD_P _GLIBCXX_STD
+# define _GLIBCXX_STD __cxx1998
+# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
+# define _GLIBCXX_END_NAMESPACE }
+# define _GLIBCXX_EXTERN_TEMPLATE -1
+# endif
+
+// parallel
+# if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && !_GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
+# define _GLIBCXX_STD_D _GLIBCXX_STD
+# define _GLIBCXX_STD_P __norm
+# define _GLIBCXX_STD __cxx1998
+# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
+# define _GLIBCXX_END_NAMESPACE }
+# define _GLIBCXX_EXTERN_TEMPLATE -1
+# endif
+
+// debug + parallel
+# if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
+# define _GLIBCXX_STD_D __norm
+# define _GLIBCXX_STD_P __norm
+# define _GLIBCXX_STD __cxx1998
+# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
+# define _GLIBCXX_END_NAMESPACE }
+# define _GLIBCXX_EXTERN_TEMPLATE -1
+# endif
+
+# if __NO_INLINE__ && !__GXX_WEAK__
+# warning currently using namespace associated mode which may fail \
+ without inlining due to lack of weak symbols
+# endif
+
+# define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) namespace X { namespace Y _GLIBCXX_VISIBILITY_ATTR(default) {
+# define _GLIBCXX_END_NESTED_NAMESPACE } }
+#endif
+
+// Namespace associations for debug mode.
+#if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
+namespace std
+{
+ namespace __norm { }
+ inline namespace __debug { }
+ inline namespace __cxx1998 { }
+}
+#endif
+
+// Namespace associations for parallel mode.
+#if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
+namespace std
+{
+ namespace __norm { }
+ inline namespace __parallel { }
+ inline namespace __cxx1998 { }
+}
+#endif
+
+// Namespace associations for versioning mode.
+#if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
+namespace std
+{
+ inline namespace _6 { }
+}
+
+namespace __gnu_cxx
+{
+ inline namespace _6 { }
+}
+
+namespace std
+{
+ namespace tr1
+ {
+ inline namespace _6 { }
+ }
+}
+#endif
+
+// XXX GLIBCXX_ABI Deprecated
+// Define if compatibility should be provided for -mlong-double-64
+#undef _GLIBCXX_LONG_DOUBLE_COMPAT
+
+// Namespace associations for long double 128 mode.
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+namespace std
+{
+ inline namespace __gnu_cxx_ldbl128 { }
+}
+# define _GLIBCXX_LDBL_NAMESPACE __gnu_cxx_ldbl128::
+# define _GLIBCXX_BEGIN_LDBL_NAMESPACE namespace __gnu_cxx_ldbl128 {
+# define _GLIBCXX_END_LDBL_NAMESPACE }
+#else
+# define _GLIBCXX_LDBL_NAMESPACE
+# define _GLIBCXX_BEGIN_LDBL_NAMESPACE
+# define _GLIBCXX_END_LDBL_NAMESPACE
+#endif
+
+
+// Defines for C compatibility. In particular, define extern "C"
+// linkage only when using C++.
+# define _GLIBCXX_BEGIN_EXTERN_C extern "C" {
+# define _GLIBCXX_END_EXTERN_C }
+
+#else // !__cplusplus
+# undef _GLIBCXX_BEGIN_NAMESPACE
+# undef _GLIBCXX_END_NAMESPACE
+# define _GLIBCXX_BEGIN_NAMESPACE(X)
+# define _GLIBCXX_END_NAMESPACE
+# define _GLIBCXX_BEGIN_EXTERN_C
+# define _GLIBCXX_END_EXTERN_C
+#endif
+
+// First includes.
+
+// Pick up any OS-specific definitions.
+#include <bits/os_defines.h>
+
+// Pick up any CPU-specific definitions.
+#include <bits/cpu_defines.h>
+
+// Allow use of "export template." This is currently not a feature
+// that g++ supports.
+// #define _GLIBCXX_EXPORT_TEMPLATE 1
+
+// Allow use of the GNU syntax extension, "extern template." This
+// extension is fully documented in the g++ manual, but in a nutshell,
+// it inhibits all implicit instantiations and is used throughout the
+// library to avoid multiple weak definitions for required types that
+// are already explicitly instantiated in the library binary. This
+// substantially reduces the binary size of resulting executables.
+#ifndef _GLIBCXX_EXTERN_TEMPLATE
+# define _GLIBCXX_EXTERN_TEMPLATE 1
+#endif
+
+// Certain function definitions that are meant to be overridable from
+// user code are decorated with this macro. For some targets, this
+// macro causes these definitions to be weak.
+#ifndef _GLIBCXX_WEAK_DEFINITION
+# define _GLIBCXX_WEAK_DEFINITION
+#endif
+
+// Assert.
+// Avoid the use of assert, because we're trying to keep the <cassert>
+// include out of the mix.
+#if !defined(_GLIBCXX_DEBUG) && !defined(_GLIBCXX_PARALLEL)
+#define __glibcxx_assert(_Condition)
+#else
+_GLIBCXX_BEGIN_NAMESPACE(std)
+ // Avoid the use of assert, because we're trying to keep the <cassert>
+ // include out of the mix.
+ inline void
+ __replacement_assert(const char* __file, int __line,
+ const char* __function, const char* __condition)
+ {
+ __builtin_printf("%s:%d: %s: Assertion '%s' failed.\n", __file, __line,
+ __function, __condition);
+ __builtin_abort();
+ }
+_GLIBCXX_END_NAMESPACE
+
+#define __glibcxx_assert(_Condition) \
+ do \
+ { \
+ if (! (_Condition)) \
+ std::__replacement_assert(__FILE__, __LINE__, \
+ __PRETTY_FUNCTION__, #_Condition); \
+ } while (false)
+#endif
+
+// The remainder of the prewritten config is automatic; all the
+// user hooks are listed above.
+
+// Create a boolean flag to be used to determine if --fast-math is set.
+#ifdef __FAST_MATH__
+# define _GLIBCXX_FAST_MATH 1
+#else
+# define _GLIBCXX_FAST_MATH 0
+#endif
+
+// This marks string literals in header files to be extracted for eventual
+// translation. It is primarily used for messages in thrown exceptions; see
+// src/functexcept.cc. We use __N because the more traditional _N is used
+// for something else under certain OSes (see BADNAMES).
+#define __N(msgid) (msgid)
+
+// For example, <windows.h> is known to #define min and max as macros...
+#undef min
+#undef max
+
+// End of prewritten config; the discovered settings follow.
+/* config.h. Generated by configure. */
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the `acosf' function. */
+#define _GLIBCXX_HAVE_ACOSF 1
+
+/* Define to 1 if you have the `acosl' function. */
+/* #undef _GLIBCXX_HAVE_ACOSL */
+
+/* Define to 1 if you have the `asinf' function. */
+#define _GLIBCXX_HAVE_ASINF 1
+
+/* Define to 1 if you have the `asinl' function. */
+/* #undef _GLIBCXX_HAVE_ASINL */
+
+/* Define to 1 if the target assembler supports .symver directive. */
+#define _GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE 1
+
+/* Define to 1 if you have the `atan2f' function. */
+#define _GLIBCXX_HAVE_ATAN2F 1
+
+/* Define to 1 if you have the `atan2l' function. */
+/* #undef _GLIBCXX_HAVE_ATAN2L */
+
+/* Define to 1 if you have the `atanf' function. */
+#define _GLIBCXX_HAVE_ATANF 1
+
+/* Define to 1 if you have the `atanl' function. */
+/* #undef _GLIBCXX_HAVE_ATANL */
+
+/* Define to 1 if the target assembler supports thread-local storage. */
+/* #undef _GLIBCXX_HAVE_CC_TLS */
+
+/* Define to 1 if you have the `ceilf' function. */
+#define _GLIBCXX_HAVE_CEILF 1
+
+/* Define to 1 if you have the `ceill' function. */
+/* #undef _GLIBCXX_HAVE_CEILL */
+
+/* Define to 1 if you have the <complex.h> header file. */
+#define _GLIBCXX_HAVE_COMPLEX_H 1
+
+/* Define to 1 if you have the `cosf' function. */
+#define _GLIBCXX_HAVE_COSF 1
+
+/* Define to 1 if you have the `coshf' function. */
+#define _GLIBCXX_HAVE_COSHF 1
+
+/* Define to 1 if you have the `coshl' function. */
+/* #undef _GLIBCXX_HAVE_COSHL */
+
+/* Define to 1 if you have the `cosl' function. */
+/* #undef _GLIBCXX_HAVE_COSL */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define _GLIBCXX_HAVE_DLFCN_H 1
+
+/* Define if EBADMSG exists. */
+#define _GLIBCXX_HAVE_EBADMSG 1
+
+/* Define if ECANCELED exists. */
+#define _GLIBCXX_HAVE_ECANCELED 1
+
+/* Define if EIDRM exists. */
+#define _GLIBCXX_HAVE_EIDRM 1
+
+/* Define to 1 if you have the <endian.h> header file. */
+#define _GLIBCXX_HAVE_ENDIAN_H 1
+
+/* Define if ENODATA exists. */
+#define _GLIBCXX_HAVE_ENODATA 1
+
+/* Define if ENOLINK exists. */
+#define _GLIBCXX_HAVE_ENOLINK 1
+
+/* Define if ENOSR exists. */
+#define _GLIBCXX_HAVE_ENOSR 1
+
+/* Define if ENOSTR exists. */
+#define _GLIBCXX_HAVE_ENOSTR 1
+
+/* Define if ENOTRECOVERABLE exists. */
+#define _GLIBCXX_HAVE_ENOTRECOVERABLE 1
+
+/* Define if ENOTSUP exists. */
+#define _GLIBCXX_HAVE_ENOTSUP 1
+
+/* Define if EOVERFLOW exists. */
+#define _GLIBCXX_HAVE_EOVERFLOW 1
+
+/* Define if EOWNERDEAD exists. */
+#define _GLIBCXX_HAVE_EOWNERDEAD 1
+
+/* Define if EPROTO exists. */
+#define _GLIBCXX_HAVE_EPROTO 1
+
+/* Define if ETIME exists. */
+#define _GLIBCXX_HAVE_ETIME 1
+
+/* Define if ETXTBSY exists. */
+#define _GLIBCXX_HAVE_ETXTBSY 1
+
+/* Define to 1 if you have the `expf' function. */
+#define _GLIBCXX_HAVE_EXPF 1
+
+/* Define to 1 if you have the `expl' function. */
+/* #undef _GLIBCXX_HAVE_EXPL */
+
+/* Define to 1 if you have the `fabsf' function. */
+#define _GLIBCXX_HAVE_FABSF 1
+
+/* Define to 1 if you have the `fabsl' function. */
+/* #undef _GLIBCXX_HAVE_FABSL */
+
+/* Define to 1 if you have the <fenv.h> header file. */
+/* #undef _GLIBCXX_HAVE_FENV_H */
+
+/* Define to 1 if you have the `finite' function. */
+#define _GLIBCXX_HAVE_FINITE 1
+
+/* Define to 1 if you have the `finitef' function. */
+#define _GLIBCXX_HAVE_FINITEF 1
+
+/* Define to 1 if you have the `finitel' function. */
+/* #undef _GLIBCXX_HAVE_FINITEL */
+
+/* Define to 1 if you have the <float.h> header file. */
+#define _GLIBCXX_HAVE_FLOAT_H 1
+
+/* Define to 1 if you have the `floorf' function. */
+#define _GLIBCXX_HAVE_FLOORF 1
+
+/* Define to 1 if you have the `floorl' function. */
+/* #undef _GLIBCXX_HAVE_FLOORL */
+
+/* Define to 1 if you have the `fmodf' function. */
+#define _GLIBCXX_HAVE_FMODF 1
+
+/* Define to 1 if you have the `fmodl' function. */
+/* #undef _GLIBCXX_HAVE_FMODL */
+
+/* Define to 1 if you have the `fpclass' function. */
+/* #undef _GLIBCXX_HAVE_FPCLASS */
+
+/* Define to 1 if you have the <fp.h> header file. */
+/* #undef _GLIBCXX_HAVE_FP_H */
+
+/* Define to 1 if you have the `frexpf' function. */
+#define _GLIBCXX_HAVE_FREXPF 1
+
+/* Define to 1 if you have the `frexpl' function. */
+/* #undef _GLIBCXX_HAVE_FREXPL */
+
+/* Define if _Unwind_GetIPInfo is available. */
+#define _GLIBCXX_HAVE_GETIPINFO 1
+
+/* Define if gthr-default.h exists (meaning that threading support is
+ enabled). */
+#define _GLIBCXX_HAVE_GTHR_DEFAULT 1
+
+/* Define to 1 if you have the `hypot' function. */
+#define _GLIBCXX_HAVE_HYPOT 1
+
+/* Define to 1 if you have the `hypotf' function. */
+#define _GLIBCXX_HAVE_HYPOTF 1
+
+/* Define to 1 if you have the `hypotl' function. */
+/* #undef _GLIBCXX_HAVE_HYPOTL */
+
+/* Define if you have the iconv() function. */
+/* #undef _GLIBCXX_HAVE_ICONV */
+
+/* Define to 1 if you have the <ieeefp.h> header file. */
+/* #undef _GLIBCXX_HAVE_IEEEFP_H */
+
+/* Define if int64_t is available in <stdint.h>. */
+#define _GLIBCXX_HAVE_INT64_T 1
+
+/* Define if int64_t is a long. */
+/* #undef _GLIBCXX_HAVE_INT64_T_LONG */
+
+/* Define if int64_t is a long long. */
+#define _GLIBCXX_HAVE_INT64_T_LONG_LONG 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define _GLIBCXX_HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `isinf' function. */
+#define _GLIBCXX_HAVE_ISINF 1
+
+/* Define to 1 if you have the `isinff' function. */
+#define _GLIBCXX_HAVE_ISINFF 1
+
+/* Define to 1 if you have the `isinfl' function. */
+/* #undef _GLIBCXX_HAVE_ISINFL */
+
+/* Define to 1 if you have the `isnan' function. */
+#define _GLIBCXX_HAVE_ISNAN 1
+
+/* Define to 1 if you have the `isnanf' function. */
+#define _GLIBCXX_HAVE_ISNANF 1
+
+/* Define to 1 if you have the `isnanl' function. */
+/* #undef _GLIBCXX_HAVE_ISNANL */
+
+/* Defined if iswblank exists. */
+#define _GLIBCXX_HAVE_ISWBLANK 1
+
+/* Define if LC_MESSAGES is available in <locale.h>. */
+#define _GLIBCXX_HAVE_LC_MESSAGES 1
+
+/* Define to 1 if you have the `ldexpf' function. */
+#define _GLIBCXX_HAVE_LDEXPF 1
+
+/* Define to 1 if you have the `ldexpl' function. */
+/* #undef _GLIBCXX_HAVE_LDEXPL */
+
+/* Define to 1 if you have the <libintl.h> header file. */
+/* #undef _GLIBCXX_HAVE_LIBINTL_H */
+
+/* Only used in build directory testsuite_hooks.h. */
+/* #undef _GLIBCXX_HAVE_LIMIT_AS */
+
+/* Only used in build directory testsuite_hooks.h. */
+/* #undef _GLIBCXX_HAVE_LIMIT_DATA */
+
+/* Only used in build directory testsuite_hooks.h. */
+/* #undef _GLIBCXX_HAVE_LIMIT_FSIZE */
+
+/* Only used in build directory testsuite_hooks.h. */
+/* #undef _GLIBCXX_HAVE_LIMIT_RSS */
+
+/* Only used in build directory testsuite_hooks.h. */
+/* #undef _GLIBCXX_HAVE_LIMIT_VMEM */
+
+/* Define if futex syscall is available. */
+#define _GLIBCXX_HAVE_LINUX_FUTEX 1
+
+/* Define to 1 if you have the <locale.h> header file. */
+#define _GLIBCXX_HAVE_LOCALE_H 1
+
+/* Define to 1 if you have the `log10f' function. */
+#define _GLIBCXX_HAVE_LOG10F 1
+
+/* Define to 1 if you have the `log10l' function. */
+/* #undef _GLIBCXX_HAVE_LOG10L */
+
+/* Define to 1 if you have the `logf' function. */
+#define _GLIBCXX_HAVE_LOGF 1
+
+/* Define to 1 if you have the `logl' function. */
+/* #undef _GLIBCXX_HAVE_LOGL */
+
+/* Define to 1 if you have the <machine/endian.h> header file. */
+/* #undef _GLIBCXX_HAVE_MACHINE_ENDIAN_H */
+
+/* Define to 1 if you have the <machine/param.h> header file. */
+/* #undef _GLIBCXX_HAVE_MACHINE_PARAM_H */
+
+/* Define if mbstate_t exists in wchar.h. */
+#define _GLIBCXX_HAVE_MBSTATE_T 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define _GLIBCXX_HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `modf' function. */
+#define _GLIBCXX_HAVE_MODF 1
+
+/* Define to 1 if you have the `modff' function. */
+#define _GLIBCXX_HAVE_MODFF 1
+
+/* Define to 1 if you have the `modfl' function. */
+/* #undef _GLIBCXX_HAVE_MODFL */
+
+/* Define to 1 if you have the <nan.h> header file. */
+/* #undef _GLIBCXX_HAVE_NAN_H */
+
+/* Define if poll is available in <poll.h>. */
+#define _GLIBCXX_HAVE_POLL 1
+
+/* Define to 1 if you have the `powf' function. */
+#define _GLIBCXX_HAVE_POWF 1
+
+/* Define to 1 if you have the `powl' function. */
+/* #undef _GLIBCXX_HAVE_POWL */
+
+/* Define to 1 if you have the `qfpclass' function. */
+/* #undef _GLIBCXX_HAVE_QFPCLASS */
+
+/* Define to 1 if you have the `setenv' function. */
+/* #undef _GLIBCXX_HAVE_SETENV */
+
+/* Define to 1 if you have the `sincos' function. */
+/* #undef _GLIBCXX_HAVE_SINCOS */
+
+/* Define to 1 if you have the `sincosf' function. */
+/* #undef _GLIBCXX_HAVE_SINCOSF */
+
+/* Define to 1 if you have the `sincosl' function. */
+/* #undef _GLIBCXX_HAVE_SINCOSL */
+
+/* Define to 1 if you have the `sinf' function. */
+#define _GLIBCXX_HAVE_SINF 1
+
+/* Define to 1 if you have the `sinhf' function. */
+#define _GLIBCXX_HAVE_SINHF 1
+
+/* Define to 1 if you have the `sinhl' function. */
+/* #undef _GLIBCXX_HAVE_SINHL */
+
+/* Define to 1 if you have the `sinl' function. */
+/* #undef _GLIBCXX_HAVE_SINL */
+
+/* Define to 1 if you have the `sqrtf' function. */
+#define _GLIBCXX_HAVE_SQRTF 1
+
+/* Define to 1 if you have the `sqrtl' function. */
+/* #undef _GLIBCXX_HAVE_SQRTL */
+
+/* Define to 1 if you have the <stdbool.h> header file. */
+#define _GLIBCXX_HAVE_STDBOOL_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define _GLIBCXX_HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define _GLIBCXX_HAVE_STDLIB_H 1
+
+/* Define if strerror_l is available in <string.h>. */
+/* #undef _GLIBCXX_HAVE_STRERROR_L */
+
+/* Define if strerror_r is available in <string.h>. */
+#define _GLIBCXX_HAVE_STRERROR_R 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define _GLIBCXX_HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define _GLIBCXX_HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strtof' function. */
+#define _GLIBCXX_HAVE_STRTOF 1
+
+/* Define to 1 if you have the `strtold' function. */
+#define _GLIBCXX_HAVE_STRTOLD 1
+
+/* Define if strxfrm_l is available in <string.h>. */
+/* #undef _GLIBCXX_HAVE_STRXFRM_L */
+
+/* Define to 1 if you have the <sys/filio.h> header file. */
+/* #undef _GLIBCXX_HAVE_SYS_FILIO_H */
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#define _GLIBCXX_HAVE_SYS_IOCTL_H 1
+
+/* Define to 1 if you have the <sys/ipc.h> header file. */
+#define _GLIBCXX_HAVE_SYS_IPC_H 1
+
+/* Define to 1 if you have the <sys/isa_defs.h> header file. */
+/* #undef _GLIBCXX_HAVE_SYS_ISA_DEFS_H */
+
+/* Define to 1 if you have the <sys/machine.h> header file. */
+/* #undef _GLIBCXX_HAVE_SYS_MACHINE_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define _GLIBCXX_HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#define _GLIBCXX_HAVE_SYS_RESOURCE_H 1
+
+/* Define to 1 if you have the <sys/sem.h> header file. */
+#define _GLIBCXX_HAVE_SYS_SEM_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define _GLIBCXX_HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define _GLIBCXX_HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define _GLIBCXX_HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#define _GLIBCXX_HAVE_SYS_UIO_H 1
+
+/* Define if S_IFREG is available in <sys/stat.h>. */
+/* #undef _GLIBCXX_HAVE_S_IFREG */
+
+/* Define if S_IFREG is available in <sys/stat.h>. */
+#define _GLIBCXX_HAVE_S_ISREG 1
+
+/* Define to 1 if you have the `tanf' function. */
+#define _GLIBCXX_HAVE_TANF 1
+
+/* Define to 1 if you have the `tanhf' function. */
+#define _GLIBCXX_HAVE_TANHF 1
+
+/* Define to 1 if you have the `tanhl' function. */
+/* #undef _GLIBCXX_HAVE_TANHL */
+
+/* Define to 1 if you have the `tanl' function. */
+/* #undef _GLIBCXX_HAVE_TANL */
+
+/* Define to 1 if you have the <tgmath.h> header file. */
+#define _GLIBCXX_HAVE_TGMATH_H 1
+
+/* Define to 1 if the target supports thread-local storage. */
+/* #undef _GLIBCXX_HAVE_TLS */
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define _GLIBCXX_HAVE_UNISTD_H 1
+
+/* Defined if vfwscanf exists. */
+#define _GLIBCXX_HAVE_VFWSCANF 1
+
+/* Defined if vswscanf exists. */
+#define _GLIBCXX_HAVE_VSWSCANF 1
+
+/* Defined if vwscanf exists. */
+#define _GLIBCXX_HAVE_VWSCANF 1
+
+/* Define to 1 if you have the <wchar.h> header file. */
+#define _GLIBCXX_HAVE_WCHAR_H 1
+
+/* Defined if wcstof exists. */
+#define _GLIBCXX_HAVE_WCSTOF 1
+
+/* Define to 1 if you have the <wctype.h> header file. */
+#define _GLIBCXX_HAVE_WCTYPE_H 1
+
+/* Define if writev is available in <sys/uio.h>. */
+#define _GLIBCXX_HAVE_WRITEV 1
+
+/* Define to 1 if you have the `_acosf' function. */
+/* #undef _GLIBCXX_HAVE__ACOSF */
+
+/* Define to 1 if you have the `_acosl' function. */
+/* #undef _GLIBCXX_HAVE__ACOSL */
+
+/* Define to 1 if you have the `_asinf' function. */
+/* #undef _GLIBCXX_HAVE__ASINF */
+
+/* Define to 1 if you have the `_asinl' function. */
+/* #undef _GLIBCXX_HAVE__ASINL */
+
+/* Define to 1 if you have the `_atan2f' function. */
+/* #undef _GLIBCXX_HAVE__ATAN2F */
+
+/* Define to 1 if you have the `_atan2l' function. */
+/* #undef _GLIBCXX_HAVE__ATAN2L */
+
+/* Define to 1 if you have the `_atanf' function. */
+/* #undef _GLIBCXX_HAVE__ATANF */
+
+/* Define to 1 if you have the `_atanl' function. */
+/* #undef _GLIBCXX_HAVE__ATANL */
+
+/* Define to 1 if you have the `_ceilf' function. */
+/* #undef _GLIBCXX_HAVE__CEILF */
+
+/* Define to 1 if you have the `_ceill' function. */
+/* #undef _GLIBCXX_HAVE__CEILL */
+
+/* Define to 1 if you have the `_cosf' function. */
+/* #undef _GLIBCXX_HAVE__COSF */
+
+/* Define to 1 if you have the `_coshf' function. */
+/* #undef _GLIBCXX_HAVE__COSHF */
+
+/* Define to 1 if you have the `_coshl' function. */
+/* #undef _GLIBCXX_HAVE__COSHL */
+
+/* Define to 1 if you have the `_cosl' function. */
+/* #undef _GLIBCXX_HAVE__COSL */
+
+/* Define to 1 if you have the `_expf' function. */
+/* #undef _GLIBCXX_HAVE__EXPF */
+
+/* Define to 1 if you have the `_expl' function. */
+/* #undef _GLIBCXX_HAVE__EXPL */
+
+/* Define to 1 if you have the `_fabsf' function. */
+/* #undef _GLIBCXX_HAVE__FABSF */
+
+/* Define to 1 if you have the `_fabsl' function. */
+/* #undef _GLIBCXX_HAVE__FABSL */
+
+/* Define to 1 if you have the `_finite' function. */
+/* #undef _GLIBCXX_HAVE__FINITE */
+
+/* Define to 1 if you have the `_finitef' function. */
+/* #undef _GLIBCXX_HAVE__FINITEF */
+
+/* Define to 1 if you have the `_finitel' function. */
+/* #undef _GLIBCXX_HAVE__FINITEL */
+
+/* Define to 1 if you have the `_floorf' function. */
+/* #undef _GLIBCXX_HAVE__FLOORF */
+
+/* Define to 1 if you have the `_floorl' function. */
+/* #undef _GLIBCXX_HAVE__FLOORL */
+
+/* Define to 1 if you have the `_fmodf' function. */
+/* #undef _GLIBCXX_HAVE__FMODF */
+
+/* Define to 1 if you have the `_fmodl' function. */
+/* #undef _GLIBCXX_HAVE__FMODL */
+
+/* Define to 1 if you have the `_fpclass' function. */
+/* #undef _GLIBCXX_HAVE__FPCLASS */
+
+/* Define to 1 if you have the `_frexpf' function. */
+/* #undef _GLIBCXX_HAVE__FREXPF */
+
+/* Define to 1 if you have the `_frexpl' function. */
+/* #undef _GLIBCXX_HAVE__FREXPL */
+
+/* Define to 1 if you have the `_hypot' function. */
+/* #undef _GLIBCXX_HAVE__HYPOT */
+
+/* Define to 1 if you have the `_hypotf' function. */
+/* #undef _GLIBCXX_HAVE__HYPOTF */
+
+/* Define to 1 if you have the `_hypotl' function. */
+/* #undef _GLIBCXX_HAVE__HYPOTL */
+
+/* Define to 1 if you have the `_isinf' function. */
+/* #undef _GLIBCXX_HAVE__ISINF */
+
+/* Define to 1 if you have the `_isinff' function. */
+/* #undef _GLIBCXX_HAVE__ISINFF */
+
+/* Define to 1 if you have the `_isinfl' function. */
+/* #undef _GLIBCXX_HAVE__ISINFL */
+
+/* Define to 1 if you have the `_isnan' function. */
+/* #undef _GLIBCXX_HAVE__ISNAN */
+
+/* Define to 1 if you have the `_isnanf' function. */
+/* #undef _GLIBCXX_HAVE__ISNANF */
+
+/* Define to 1 if you have the `_isnanl' function. */
+/* #undef _GLIBCXX_HAVE__ISNANL */
+
+/* Define to 1 if you have the `_ldexpf' function. */
+/* #undef _GLIBCXX_HAVE__LDEXPF */
+
+/* Define to 1 if you have the `_ldexpl' function. */
+/* #undef _GLIBCXX_HAVE__LDEXPL */
+
+/* Define to 1 if you have the `_log10f' function. */
+/* #undef _GLIBCXX_HAVE__LOG10F */
+
+/* Define to 1 if you have the `_log10l' function. */
+/* #undef _GLIBCXX_HAVE__LOG10L */
+
+/* Define to 1 if you have the `_logf' function. */
+/* #undef _GLIBCXX_HAVE__LOGF */
+
+/* Define to 1 if you have the `_logl' function. */
+/* #undef _GLIBCXX_HAVE__LOGL */
+
+/* Define to 1 if you have the `_modf' function. */
+/* #undef _GLIBCXX_HAVE__MODF */
+
+/* Define to 1 if you have the `_modff' function. */
+/* #undef _GLIBCXX_HAVE__MODFF */
+
+/* Define to 1 if you have the `_modfl' function. */
+/* #undef _GLIBCXX_HAVE__MODFL */
+
+/* Define to 1 if you have the `_powf' function. */
+/* #undef _GLIBCXX_HAVE__POWF */
+
+/* Define to 1 if you have the `_powl' function. */
+/* #undef _GLIBCXX_HAVE__POWL */
+
+/* Define to 1 if you have the `_qfpclass' function. */
+/* #undef _GLIBCXX_HAVE__QFPCLASS */
+
+/* Define to 1 if you have the `_sincos' function. */
+/* #undef _GLIBCXX_HAVE__SINCOS */
+
+/* Define to 1 if you have the `_sincosf' function. */
+/* #undef _GLIBCXX_HAVE__SINCOSF */
+
+/* Define to 1 if you have the `_sincosl' function. */
+/* #undef _GLIBCXX_HAVE__SINCOSL */
+
+/* Define to 1 if you have the `_sinf' function. */
+/* #undef _GLIBCXX_HAVE__SINF */
+
+/* Define to 1 if you have the `_sinhf' function. */
+/* #undef _GLIBCXX_HAVE__SINHF */
+
+/* Define to 1 if you have the `_sinhl' function. */
+/* #undef _GLIBCXX_HAVE__SINHL */
+
+/* Define to 1 if you have the `_sinl' function. */
+/* #undef _GLIBCXX_HAVE__SINL */
+
+/* Define to 1 if you have the `_sqrtf' function. */
+/* #undef _GLIBCXX_HAVE__SQRTF */
+
+/* Define to 1 if you have the `_sqrtl' function. */
+/* #undef _GLIBCXX_HAVE__SQRTL */
+
+/* Define to 1 if you have the `_tanf' function. */
+/* #undef _GLIBCXX_HAVE__TANF */
+
+/* Define to 1 if you have the `_tanhf' function. */
+/* #undef _GLIBCXX_HAVE__TANHF */
+
+/* Define to 1 if you have the `_tanhl' function. */
+/* #undef _GLIBCXX_HAVE__TANHL */
+
+/* Define to 1 if you have the `_tanl' function. */
+/* #undef _GLIBCXX_HAVE__TANL */
+
+/* Define as const if the declaration of iconv() needs const. */
+/* #undef _GLIBCXX_ICONV_CONST */
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#define LT_OBJDIR ".libs/"
+
+/* Name of package */
+/* #undef _GLIBCXX_PACKAGE */
+
+/* Define to the address where bug reports for this package should be sent. */
+#define _GLIBCXX_PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define _GLIBCXX_PACKAGE_NAME "package-unused"
+
+/* Define to the full name and version of this package. */
+#define _GLIBCXX_PACKAGE_STRING "package-unused version-unused"
+
+/* Define to the one symbol short name of this package. */
+#define _GLIBCXX_PACKAGE_TARNAME "libstdc++"
+
+/* Define to the version of this package. */
+#define _GLIBCXX_PACKAGE__GLIBCXX_VERSION "version-unused"
+
+/* The size of a `char', as computed by sizeof. */
+/* #undef SIZEOF_CHAR */
+
+/* The size of a `int', as computed by sizeof. */
+/* #undef SIZEOF_INT */
+
+/* The size of a `long', as computed by sizeof. */
+/* #undef SIZEOF_LONG */
+
+/* The size of a `short', as computed by sizeof. */
+/* #undef SIZEOF_SHORT */
+
+/* The size of a `void *', as computed by sizeof. */
+/* #undef SIZEOF_VOID_P */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+/* #undef _GLIBCXX_VERSION */
+
+/* Define if builtin atomic operations for bool are supported on this host. */
+#define _GLIBCXX_ATOMIC_BUILTINS_1 1
+
+/* Define if builtin atomic operations for short are supported on this host.
+ */
+#define _GLIBCXX_ATOMIC_BUILTINS_2 1
+
+/* Define if builtin atomic operations for int are supported on this host. */
+#define _GLIBCXX_ATOMIC_BUILTINS_4 1
+
+/* Define if builtin atomic operations for long long are supported on this
+ host. */
+/* #undef _GLIBCXX_ATOMIC_BUILTINS_8 */
+
+/* Define to use concept checking code from the boost libraries. */
+/* #undef _GLIBCXX_CONCEPT_CHECKS */
+
+/* Define if a fully dynamic basic_string is wanted. */
+/* #undef _GLIBCXX_FULLY_DYNAMIC_STRING */
+
+/* Define if gthreads library is available. */
+#define _GLIBCXX_HAS_GTHREADS 1
+
+/* Define to 1 if a full hosted library is built, or 0 if freestanding. */
+#define _GLIBCXX_HOSTED 1
+
+/* Define if compatibility should be provided for -mlong-double-64. */
+
+/* Define if ptrdiff_t is int. */
+#define _GLIBCXX_PTRDIFF_T_IS_INT 1
+
+/* Define if using setrlimit to set resource limits during "make check" */
+/* #undef _GLIBCXX_RES_LIMITS */
+
+/* Define if size_t is unsigned int. */
+#define _GLIBCXX_SIZE_T_IS_UINT 1
+
+/* Define if the compiler is configured for setjmp/longjmp exceptions. */
+/* #undef _GLIBCXX_SJLJ_EXCEPTIONS */
+
+/* Define if EOF == -1, SEEK_CUR == 1, SEEK_END == 2. */
+#define _GLIBCXX_STDIO_MACROS 1
+
+/* Define to use symbol versioning in the shared library. */
+#define _GLIBCXX_SYMVER 1
+
+/* Define to use darwin versioning in the shared library. */
+/* #undef _GLIBCXX_SYMVER_DARWIN */
+
+/* Define to use GNU versioning in the shared library. */
+#define _GLIBCXX_SYMVER_GNU 1
+
+/* Define to use GNU namespace versioning in the shared library. */
+/* #undef _GLIBCXX_SYMVER_GNU_NAMESPACE */
+
+/* Define if C99 functions or macros from <wchar.h>, <math.h>, <complex.h>,
+ <stdio.h>, and <stdlib.h> can be used or exposed. */
+/* #undef _GLIBCXX_USE_C99 */
+
+/* Define if C99 functions in <complex.h> should be used in <complex>. Using
+ compiler builtins for these functions requires corresponding C99 library
+ functions to be present. */
+/* #undef _GLIBCXX_USE_C99_COMPLEX */
+
+/* Define if C99 functions in <complex.h> should be used in <tr1/complex>.
+ Using compiler builtins for these functions requires corresponding C99
+ library functions to be present. */
+#define _GLIBCXX_USE_C99_COMPLEX_TR1 1
+
+/* Define if C99 functions in <ctype.h> should be imported in <tr1/cctype> in
+ namespace std::tr1. */
+#define _GLIBCXX_USE_C99_CTYPE_TR1 1
+
+/* Define if C99 functions in <fenv.h> should be imported in <tr1/cfenv> in
+ namespace std::tr1. */
+/* #undef _GLIBCXX_USE_C99_FENV_TR1 */
+
+/* Define if C99 functions in <inttypes.h> should be imported in
+ <tr1/cinttypes> in namespace std::tr1. */
+#define _GLIBCXX_USE_C99_INTTYPES_TR1 1
+
+/* Define if wchar_t C99 functions in <inttypes.h> should be imported in
+ <tr1/cinttypes> in namespace std::tr1. */
+#define _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1 1
+
+/* Define if C99 functions or macros in <math.h> should be imported in <cmath>
+ in namespace std. */
+#define _GLIBCXX_USE_C99_MATH 1
+
+/* Define if C99 functions or macros in <math.h> should be imported in
+ <tr1/cmath> in namespace std::tr1. */
+/* #undef _GLIBCXX_USE_C99_MATH_TR1 */
+
+/* Define if C99 types in <stdint.h> should be imported in <tr1/cstdint> in
+ namespace std::tr1. */
+#define _GLIBCXX_USE_C99_STDINT_TR1 1
+
+/* Defined if clock_gettime has monotonic clock support. */
+/* #undef _GLIBCXX_USE_CLOCK_MONOTONIC */
+
+/* Defined if clock_gettime has realtime clock support. */
+/* #undef _GLIBCXX_USE_CLOCK_REALTIME */
+
+/* Defined if gettimeofday is available. */
+#define _GLIBCXX_USE_GETTIMEOFDAY 1
+
+/* Define if LFS support is available. */
+#define _GLIBCXX_USE_LFS 1
+
+/* Define if code specialized for long long should be used. */
+#define _GLIBCXX_USE_LONG_LONG 1
+
+/* Defined if nanosleep is available. */
+/* #undef _GLIBCXX_USE_NANOSLEEP */
+
+/* Define if NLS translations are to be used. */
+/* #undef _GLIBCXX_USE_NLS */
+
+/* Define if /dev/random and /dev/urandom are available for the random_device
+ of TR1 (Chapter 5.1). */
+#define _GLIBCXX_USE_RANDOM_TR1 1
+
+/* Defined if sched_yield is available. */
+/* #undef _GLIBCXX_USE_SCHED_YIELD */
+
+/* Define if code specialized for wchar_t should be used. */
+#define _GLIBCXX_USE_WCHAR_T 1
+
+#if defined (_GLIBCXX_HAVE__ACOSF) && ! defined (_GLIBCXX_HAVE_ACOSF)
+# define _GLIBCXX_HAVE_ACOSF 1
+# define acosf _acosf
+#endif
+
+#if defined (_GLIBCXX_HAVE__ACOSL) && ! defined (_GLIBCXX_HAVE_ACOSL)
+# define _GLIBCXX_HAVE_ACOSL 1
+# define acosl _acosl
+#endif
+
+#if defined (_GLIBCXX_HAVE__ASINF) && ! defined (_GLIBCXX_HAVE_ASINF)
+# define _GLIBCXX_HAVE_ASINF 1
+# define asinf _asinf
+#endif
+
+#if defined (_GLIBCXX_HAVE__ASINL) && ! defined (_GLIBCXX_HAVE_ASINL)
+# define _GLIBCXX_HAVE_ASINL 1
+# define asinl _asinl
+#endif
+
+#if defined (_GLIBCXX_HAVE__ATAN2F) && ! defined (_GLIBCXX_HAVE_ATAN2F)
+# define _GLIBCXX_HAVE_ATAN2F 1
+# define atan2f _atan2f
+#endif
+
+#if defined (_GLIBCXX_HAVE__ATAN2L) && ! defined (_GLIBCXX_HAVE_ATAN2L)
+# define _GLIBCXX_HAVE_ATAN2L 1
+# define atan2l _atan2l
+#endif
+
+#if defined (_GLIBCXX_HAVE__ATANF) && ! defined (_GLIBCXX_HAVE_ATANF)
+# define _GLIBCXX_HAVE_ATANF 1
+# define atanf _atanf
+#endif
+
+#if defined (_GLIBCXX_HAVE__ATANL) && ! defined (_GLIBCXX_HAVE_ATANL)
+# define _GLIBCXX_HAVE_ATANL 1
+# define atanl _atanl
+#endif
+
+#if defined (_GLIBCXX_HAVE__CEILF) && ! defined (_GLIBCXX_HAVE_CEILF)
+# define _GLIBCXX_HAVE_CEILF 1
+# define ceilf _ceilf
+#endif
+
+#if defined (_GLIBCXX_HAVE__CEILL) && ! defined (_GLIBCXX_HAVE_CEILL)
+# define _GLIBCXX_HAVE_CEILL 1
+# define ceill _ceill
+#endif
+
+#if defined (_GLIBCXX_HAVE__COSF) && ! defined (_GLIBCXX_HAVE_COSF)
+# define _GLIBCXX_HAVE_COSF 1
+# define cosf _cosf
+#endif
+
+#if defined (_GLIBCXX_HAVE__COSHF) && ! defined (_GLIBCXX_HAVE_COSHF)
+# define _GLIBCXX_HAVE_COSHF 1
+# define coshf _coshf
+#endif
+
+#if defined (_GLIBCXX_HAVE__COSHL) && ! defined (_GLIBCXX_HAVE_COSHL)
+# define _GLIBCXX_HAVE_COSHL 1
+# define coshl _coshl
+#endif
+
+#if defined (_GLIBCXX_HAVE__COSL) && ! defined (_GLIBCXX_HAVE_COSL)
+# define _GLIBCXX_HAVE_COSL 1
+# define cosl _cosl
+#endif
+
+#if defined (_GLIBCXX_HAVE__EXPF) && ! defined (_GLIBCXX_HAVE_EXPF)
+# define _GLIBCXX_HAVE_EXPF 1
+# define expf _expf
+#endif
+
+#if defined (_GLIBCXX_HAVE__EXPL) && ! defined (_GLIBCXX_HAVE_EXPL)
+# define _GLIBCXX_HAVE_EXPL 1
+# define expl _expl
+#endif
+
+#if defined (_GLIBCXX_HAVE__FABSF) && ! defined (_GLIBCXX_HAVE_FABSF)
+# define _GLIBCXX_HAVE_FABSF 1
+# define fabsf _fabsf
+#endif
+
+#if defined (_GLIBCXX_HAVE__FABSL) && ! defined (_GLIBCXX_HAVE_FABSL)
+# define _GLIBCXX_HAVE_FABSL 1
+# define fabsl _fabsl
+#endif
+
+#if defined (_GLIBCXX_HAVE__FINITE) && ! defined (_GLIBCXX_HAVE_FINITE)
+# define _GLIBCXX_HAVE_FINITE 1
+# define finite _finite
+#endif
+
+#if defined (_GLIBCXX_HAVE__FINITEF) && ! defined (_GLIBCXX_HAVE_FINITEF)
+# define _GLIBCXX_HAVE_FINITEF 1
+# define finitef _finitef
+#endif
+
+#if defined (_GLIBCXX_HAVE__FINITEL) && ! defined (_GLIBCXX_HAVE_FINITEL)
+# define _GLIBCXX_HAVE_FINITEL 1
+# define finitel _finitel
+#endif
+
+#if defined (_GLIBCXX_HAVE__FLOORF) && ! defined (_GLIBCXX_HAVE_FLOORF)
+# define _GLIBCXX_HAVE_FLOORF 1
+# define floorf _floorf
+#endif
+
+#if defined (_GLIBCXX_HAVE__FLOORL) && ! defined (_GLIBCXX_HAVE_FLOORL)
+# define _GLIBCXX_HAVE_FLOORL 1
+# define floorl _floorl
+#endif
+
+#if defined (_GLIBCXX_HAVE__FMODF) && ! defined (_GLIBCXX_HAVE_FMODF)
+# define _GLIBCXX_HAVE_FMODF 1
+# define fmodf _fmodf
+#endif
+
+#if defined (_GLIBCXX_HAVE__FMODL) && ! defined (_GLIBCXX_HAVE_FMODL)
+# define _GLIBCXX_HAVE_FMODL 1
+# define fmodl _fmodl
+#endif
+
+#if defined (_GLIBCXX_HAVE__FPCLASS) && ! defined (_GLIBCXX_HAVE_FPCLASS)
+# define _GLIBCXX_HAVE_FPCLASS 1
+# define fpclass _fpclass
+#endif
+
+#if defined (_GLIBCXX_HAVE__FREXPF) && ! defined (_GLIBCXX_HAVE_FREXPF)
+# define _GLIBCXX_HAVE_FREXPF 1
+# define frexpf _frexpf
+#endif
+
+#if defined (_GLIBCXX_HAVE__FREXPL) && ! defined (_GLIBCXX_HAVE_FREXPL)
+# define _GLIBCXX_HAVE_FREXPL 1
+# define frexpl _frexpl
+#endif
+
+#if defined (_GLIBCXX_HAVE__HYPOT) && ! defined (_GLIBCXX_HAVE_HYPOT)
+# define _GLIBCXX_HAVE_HYPOT 1
+# define hypot _hypot
+#endif
+
+#if defined (_GLIBCXX_HAVE__HYPOTF) && ! defined (_GLIBCXX_HAVE_HYPOTF)
+# define _GLIBCXX_HAVE_HYPOTF 1
+# define hypotf _hypotf
+#endif
+
+#if defined (_GLIBCXX_HAVE__HYPOTL) && ! defined (_GLIBCXX_HAVE_HYPOTL)
+# define _GLIBCXX_HAVE_HYPOTL 1
+# define hypotl _hypotl
+#endif
+
+#if defined (_GLIBCXX_HAVE__ISINF) && ! defined (_GLIBCXX_HAVE_ISINF)
+# define _GLIBCXX_HAVE_ISINF 1
+# define isinf _isinf
+#endif
+
+#if defined (_GLIBCXX_HAVE__ISINFF) && ! defined (_GLIBCXX_HAVE_ISINFF)
+# define _GLIBCXX_HAVE_ISINFF 1
+# define isinff _isinff
+#endif
+
+#if defined (_GLIBCXX_HAVE__ISINFL) && ! defined (_GLIBCXX_HAVE_ISINFL)
+# define _GLIBCXX_HAVE_ISINFL 1
+# define isinfl _isinfl
+#endif
+
+#if defined (_GLIBCXX_HAVE__ISNAN) && ! defined (_GLIBCXX_HAVE_ISNAN)
+# define _GLIBCXX_HAVE_ISNAN 1
+# define isnan _isnan
+#endif
+
+#if defined (_GLIBCXX_HAVE__ISNANF) && ! defined (_GLIBCXX_HAVE_ISNANF)
+# define _GLIBCXX_HAVE_ISNANF 1
+# define isnanf _isnanf
+#endif
+
+#if defined (_GLIBCXX_HAVE__ISNANL) && ! defined (_GLIBCXX_HAVE_ISNANL)
+# define _GLIBCXX_HAVE_ISNANL 1
+# define isnanl _isnanl
+#endif
+
+#if defined (_GLIBCXX_HAVE__LDEXPF) && ! defined (_GLIBCXX_HAVE_LDEXPF)
+# define _GLIBCXX_HAVE_LDEXPF 1
+# define ldexpf _ldexpf
+#endif
+
+#if defined (_GLIBCXX_HAVE__LDEXPL) && ! defined (_GLIBCXX_HAVE_LDEXPL)
+# define _GLIBCXX_HAVE_LDEXPL 1
+# define ldexpl _ldexpl
+#endif
+
+#if defined (_GLIBCXX_HAVE__LOG10F) && ! defined (_GLIBCXX_HAVE_LOG10F)
+# define _GLIBCXX_HAVE_LOG10F 1
+# define log10f _log10f
+#endif
+
+#if defined (_GLIBCXX_HAVE__LOG10L) && ! defined (_GLIBCXX_HAVE_LOG10L)
+# define _GLIBCXX_HAVE_LOG10L 1
+# define log10l _log10l
+#endif
+
+#if defined (_GLIBCXX_HAVE__LOGF) && ! defined (_GLIBCXX_HAVE_LOGF)
+# define _GLIBCXX_HAVE_LOGF 1
+# define logf _logf
+#endif
+
+#if defined (_GLIBCXX_HAVE__LOGL) && ! defined (_GLIBCXX_HAVE_LOGL)
+# define _GLIBCXX_HAVE_LOGL 1
+# define logl _logl
+#endif
+
+#if defined (_GLIBCXX_HAVE__MODF) && ! defined (_GLIBCXX_HAVE_MODF)
+# define _GLIBCXX_HAVE_MODF 1
+# define modf _modf
+#endif
+
+#if defined (_GLIBCXX_HAVE__MODFF) && ! defined (_GLIBCXX_HAVE_MODFF)
+# define _GLIBCXX_HAVE_MODFF 1
+# define modff _modff
+#endif
+
+#if defined (_GLIBCXX_HAVE__MODFL) && ! defined (_GLIBCXX_HAVE_MODFL)
+# define _GLIBCXX_HAVE_MODFL 1
+# define modfl _modfl
+#endif
+
+#if defined (_GLIBCXX_HAVE__POWF) && ! defined (_GLIBCXX_HAVE_POWF)
+# define _GLIBCXX_HAVE_POWF 1
+# define powf _powf
+#endif
+
+#if defined (_GLIBCXX_HAVE__POWL) && ! defined (_GLIBCXX_HAVE_POWL)
+# define _GLIBCXX_HAVE_POWL 1
+# define powl _powl
+#endif
+
+#if defined (_GLIBCXX_HAVE__QFPCLASS) && ! defined (_GLIBCXX_HAVE_QFPCLASS)
+# define _GLIBCXX_HAVE_QFPCLASS 1
+# define qfpclass _qfpclass
+#endif
+
+#if defined (_GLIBCXX_HAVE__SINCOS) && ! defined (_GLIBCXX_HAVE_SINCOS)
+# define _GLIBCXX_HAVE_SINCOS 1
+# define sincos _sincos
+#endif
+
+#if defined (_GLIBCXX_HAVE__SINCOSF) && ! defined (_GLIBCXX_HAVE_SINCOSF)
+# define _GLIBCXX_HAVE_SINCOSF 1
+# define sincosf _sincosf
+#endif
+
+#if defined (_GLIBCXX_HAVE__SINCOSL) && ! defined (_GLIBCXX_HAVE_SINCOSL)
+# define _GLIBCXX_HAVE_SINCOSL 1
+# define sincosl _sincosl
+#endif
+
+#if defined (_GLIBCXX_HAVE__SINF) && ! defined (_GLIBCXX_HAVE_SINF)
+# define _GLIBCXX_HAVE_SINF 1
+# define sinf _sinf
+#endif
+
+#if defined (_GLIBCXX_HAVE__SINHF) && ! defined (_GLIBCXX_HAVE_SINHF)
+# define _GLIBCXX_HAVE_SINHF 1
+# define sinhf _sinhf
+#endif
+
+#if defined (_GLIBCXX_HAVE__SINHL) && ! defined (_GLIBCXX_HAVE_SINHL)
+# define _GLIBCXX_HAVE_SINHL 1
+# define sinhl _sinhl
+#endif
+
+#if defined (_GLIBCXX_HAVE__SINL) && ! defined (_GLIBCXX_HAVE_SINL)
+# define _GLIBCXX_HAVE_SINL 1
+# define sinl _sinl
+#endif
+
+#if defined (_GLIBCXX_HAVE__SQRTF) && ! defined (_GLIBCXX_HAVE_SQRTF)
+# define _GLIBCXX_HAVE_SQRTF 1
+# define sqrtf _sqrtf
+#endif
+
+#if defined (_GLIBCXX_HAVE__SQRTL) && ! defined (_GLIBCXX_HAVE_SQRTL)
+# define _GLIBCXX_HAVE_SQRTL 1
+# define sqrtl _sqrtl
+#endif
+
+#if defined (_GLIBCXX_HAVE__STRTOF) && ! defined (_GLIBCXX_HAVE_STRTOF)
+# define _GLIBCXX_HAVE_STRTOF 1
+# define strtof _strtof
+#endif
+
+#if defined (_GLIBCXX_HAVE__STRTOLD) && ! defined (_GLIBCXX_HAVE_STRTOLD)
+# define _GLIBCXX_HAVE_STRTOLD 1
+# define strtold _strtold
+#endif
+
+#if defined (_GLIBCXX_HAVE__TANF) && ! defined (_GLIBCXX_HAVE_TANF)
+# define _GLIBCXX_HAVE_TANF 1
+# define tanf _tanf
+#endif
+
+#if defined (_GLIBCXX_HAVE__TANHF) && ! defined (_GLIBCXX_HAVE_TANHF)
+# define _GLIBCXX_HAVE_TANHF 1
+# define tanhf _tanhf
+#endif
+
+#if defined (_GLIBCXX_HAVE__TANHL) && ! defined (_GLIBCXX_HAVE_TANHL)
+# define _GLIBCXX_HAVE_TANHL 1
+# define tanhl _tanhl
+#endif
+
+#if defined (_GLIBCXX_HAVE__TANL) && ! defined (_GLIBCXX_HAVE_TANL)
+# define _GLIBCXX_HAVE_TANL 1
+# define tanl _tanl
+#endif
+
+#endif // _GLIBCXX_CXX_CONFIG_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/c++io.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/c++io.h
new file mode 100644
index 0000000..86ca53b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/c++io.h
@@ -0,0 +1,49 @@
+// Underlying io library details -*- C++ -*-
+
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file c++io.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// c_io_stdio.h - Defines for using "C" stdio.h
+
+#ifndef _GLIBCXX_CXX_IO_H
+#define _GLIBCXX_CXX_IO_H 1
+
+#include <cstdio>
+#include <cstddef>
+#include <bits/gthr.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ typedef __gthread_mutex_t __c_lock;
+
+ // for basic_file.h
+ typedef FILE __c_file;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/c++locale.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/c++locale.h
new file mode 100644
index 0000000..472ef55
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/c++locale.h
@@ -0,0 +1,91 @@
+// Wrapper for underlying C-language localization -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file c++locale.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.8 Standard locale categories.
+//
+
+// Written by Benjamin Kosnik <bkoz@redhat.com>
+
+#ifndef _GLIBCXX_CXX_LOCALE_H
+#define _GLIBCXX_CXX_LOCALE_H 1
+
+#pragma GCC system_header
+
+#include <clocale>
+#include <cstddef>
+
+#define _GLIBCXX_NUM_CATEGORIES 0
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ typedef int* __c_locale;
+
+ // Convert numeric value of type double and long double to string and
+ // return length of string. If vsnprintf is available use it, otherwise
+ // fall back to the unsafe vsprintf which, in general, can be dangerous
+ // and should be avoided.
+ inline int
+ __convert_from_v(const __c_locale&, char* __out,
+ const int __size __attribute__((__unused__)),
+ const char* __fmt, ...)
+ {
+ char* __old = std::setlocale(LC_NUMERIC, NULL);
+ char* __sav = NULL;
+ if (__builtin_strcmp(__old, "C"))
+ {
+ const size_t __len = __builtin_strlen(__old) + 1;
+ __sav = new char[__len];
+ __builtin_memcpy(__sav, __old, __len);
+ std::setlocale(LC_NUMERIC, "C");
+ }
+
+ __builtin_va_list __args;
+ __builtin_va_start(__args, __fmt);
+
+#ifdef _GLIBCXX_USE_C99
+ const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
+#else
+ const int __ret = __builtin_vsprintf(__out, __fmt, __args);
+#endif
+
+ __builtin_va_end(__args);
+
+ if (__sav)
+ {
+ std::setlocale(LC_NUMERIC, __sav);
+ delete [] __sav;
+ }
+ return __ret;
+ }
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/cpu_defines.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/cpu_defines.h
new file mode 100644
index 0000000..faf97e1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/cpu_defines.h
@@ -0,0 +1,33 @@
+// Specific definitions for generic platforms -*- C++ -*-
+
+// Copyright (C) 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file cpu_defines.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_CPU_DEFINES
+#define _GLIBCXX_CPU_DEFINES 1
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/ctype_base.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/ctype_base.h
new file mode 100644
index 0000000..7549c73
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/ctype_base.h
@@ -0,0 +1,63 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2006, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+/** @file ctype_base.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// Information as gleaned from /usr/include/ctype.h
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /// @brief Base class for ctype.
+ struct ctype_base
+ {
+ // Note: In uClibc, the following two types depend on configuration.
+
+ // Non-standard typedefs.
+ typedef const __ctype_touplow_t* __to_type;
+
+ // NB: Offsets into ctype<char>::_M_table force a particular size
+ // on the mask type. Because of this, we don't use an enum.
+ typedef __ctype_mask_t mask;
+ static const mask upper = _ISupper;
+ static const mask lower = _ISlower;
+ static const mask alpha = _ISalpha;
+ static const mask digit = _ISdigit;
+ static const mask xdigit = _ISxdigit;
+ static const mask space = _ISspace;
+ static const mask print = _ISprint;
+ static const mask graph = _ISalpha | _ISdigit | _ISpunct;
+ static const mask cntrl = _IScntrl;
+ static const mask punct = _ISpunct;
+ static const mask alnum = _ISalpha | _ISdigit;
+ };
+
+_GLIBCXX_END_NAMESPACE
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/ctype_inline.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/ctype_inline.h
new file mode 100644
index 0000000..1309416
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/ctype_inline.h
@@ -0,0 +1,73 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2000, 2002, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_inline.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
+// functions go in ctype.cc
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ bool
+ ctype<char>::
+ is(mask __m, char __c) const
+ { return _M_table[static_cast<unsigned char>(__c)] & __m; }
+
+ const char*
+ ctype<char>::
+ is(const char* __low, const char* __high, mask* __vec) const
+ {
+ while (__low < __high)
+ *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
+ return __high;
+ }
+
+ const char*
+ ctype<char>::
+ scan_is(mask __m, const char* __low, const char* __high) const
+ {
+ while (__low < __high
+ && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
+ ++__low;
+ return __low;
+ }
+
+ const char*
+ ctype<char>::
+ scan_not(mask __m, const char* __low, const char* __high) const
+ {
+ while (__low < __high
+ && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
+ ++__low;
+ return __low;
+ }
+
+_GLIBCXX_END_NAMESPACE
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/ctype_noninline.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/ctype_noninline.h
new file mode 100644
index 0000000..e7eac1b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/ctype_noninline.h
@@ -0,0 +1,92 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2006, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_noninline.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+// Information as gleaned from /usr/include/ctype.h
+
+ const ctype_base::mask*
+ ctype<char>::classic_table() throw()
+ { return __C_ctype_b; }
+
+ ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
+ size_t __refs)
+ : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
+ _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
+ {
+ _M_toupper = __C_ctype_toupper;
+ _M_tolower = __C_ctype_tolower;
+ _M_table = __table ? __table : __C_ctype_b;
+ memset(_M_widen, 0, sizeof(_M_widen));
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ }
+
+ ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
+ : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
+ _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
+ {
+ _M_toupper = __C_ctype_toupper;
+ _M_tolower = __C_ctype_tolower;
+ _M_table = __table ? __table : __C_ctype_b;
+ memset(_M_widen, 0, sizeof(_M_widen));
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ }
+
+ char
+ ctype<char>::do_toupper(char __c) const
+ { return _M_toupper[static_cast<unsigned char>(__c)]; }
+
+ const char*
+ ctype<char>::do_toupper(char* __low, const char* __high) const
+ {
+ while (__low < __high)
+ {
+ *__low = _M_toupper[static_cast<unsigned char>(*__low)];
+ ++__low;
+ }
+ return __high;
+ }
+
+ char
+ ctype<char>::do_tolower(char __c) const
+ { return _M_tolower[static_cast<unsigned char>(__c)]; }
+
+ const char*
+ ctype<char>::do_tolower(char* __low, const char* __high) const
+ {
+ while (__low < __high)
+ {
+ *__low = _M_tolower[static_cast<unsigned char>(*__low)];
+ ++__low;
+ }
+ return __high;
+ }
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/cxxabi_tweaks.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/cxxabi_tweaks.h
new file mode 100644
index 0000000..8354691
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/cxxabi_tweaks.h
@@ -0,0 +1,58 @@
+// Control various target specific ABI tweaks. Generic version.
+
+// Copyright (C) 2004, 2006, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file cxxabi_tweaks.h
+ * The header provides an CPU-variable interface to the C++ ABI.
+ */
+
+#ifndef _CXXABI_TWEAKS_H
+#define _CXXABI_TWEAKS_H 1
+
+#ifdef __cplusplus
+namespace __cxxabiv1
+{
+ extern "C"
+ {
+#endif
+
+ // The generic ABI uses the first byte of a 64-bit guard variable.
+#define _GLIBCXX_GUARD_TEST(x) (*(char *) (x) != 0)
+#define _GLIBCXX_GUARD_SET(x) *(char *) (x) = 1
+#define _GLIBCXX_GUARD_BIT __guard_test_bit (0, 1)
+#define _GLIBCXX_GUARD_PENDING_BIT __guard_test_bit (1, 1)
+#define _GLIBCXX_GUARD_WAITING_BIT __guard_test_bit (2, 1)
+ __extension__ typedef int __guard __attribute__((mode (__DI__)));
+
+ // __cxa_vec_ctor has void return type.
+ typedef void __cxa_vec_ctor_return_type;
+#define _GLIBCXX_CXA_VEC_CTOR_RETURN(x) return
+ // Constructors and destructors do not return a value.
+ typedef void __cxa_cdtor_return_type;
+
+#ifdef __cplusplus
+ }
+} // namespace __cxxabiv1
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/error_constants.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/error_constants.h
new file mode 100644
index 0000000..61c0349
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/error_constants.h
@@ -0,0 +1,175 @@
+// Specific definitions for generic platforms -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file error_constants.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_ERROR_CONSTANTS
+#define _GLIBCXX_ERROR_CONSTANTS 1
+
+#include <bits/c++config.h>
+#include <cerrno>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ enum class errc
+ {
+ address_family_not_supported = EAFNOSUPPORT,
+ address_in_use = EADDRINUSE,
+ address_not_available = EADDRNOTAVAIL,
+ already_connected = EISCONN,
+ argument_list_too_long = E2BIG,
+ argument_out_of_domain = EDOM,
+ bad_address = EFAULT,
+ bad_file_descriptor = EBADF,
+
+#ifdef _GLIBCXX_HAVE_EBADMSG
+ bad_message = EBADMSG,
+#endif
+
+ broken_pipe = EPIPE,
+ connection_aborted = ECONNABORTED,
+ connection_already_in_progress = EALREADY,
+ connection_refused = ECONNREFUSED,
+ connection_reset = ECONNRESET,
+ cross_device_link = EXDEV,
+ destination_address_required = EDESTADDRREQ,
+ device_or_resource_busy = EBUSY,
+ directory_not_empty = ENOTEMPTY,
+ executable_format_error = ENOEXEC,
+ file_exists = EEXIST,
+ file_too_large = EFBIG,
+ filename_too_long = ENAMETOOLONG,
+ function_not_supported = ENOSYS,
+ host_unreachable = EHOSTUNREACH,
+
+#ifdef _GLIBCXX_HAVE_EIDRM
+ identifier_removed = EIDRM,
+#endif
+
+ illegal_byte_sequence = EILSEQ,
+ inappropriate_io_control_operation = ENOTTY,
+ interrupted = EINTR,
+ invalid_argument = EINVAL,
+ invalid_seek = ESPIPE,
+ io_error = EIO,
+ is_a_directory = EISDIR,
+ message_size = EMSGSIZE,
+ network_down = ENETDOWN,
+ network_reset = ENETRESET,
+ network_unreachable = ENETUNREACH,
+ no_buffer_space = ENOBUFS,
+ no_child_process = ECHILD,
+
+#ifdef _GLIBCXX_HAVE_ENOLINK
+ no_link = ENOLINK,
+#endif
+
+ no_lock_available = ENOLCK,
+
+#ifdef _GLIBCXX_HAVE_ENODATA
+ no_message_available = ENODATA,
+#endif
+
+ no_message = ENOMSG,
+ no_protocol_option = ENOPROTOOPT,
+ no_space_on_device = ENOSPC,
+
+#ifdef _GLIBCXX_HAVE_ENOSR
+ no_stream_resources = ENOSR,
+#endif
+
+ no_such_device_or_address = ENXIO,
+ no_such_device = ENODEV,
+ no_such_file_or_directory = ENOENT,
+ no_such_process = ESRCH,
+ not_a_directory = ENOTDIR,
+ not_a_socket = ENOTSOCK,
+
+#ifdef _GLIBCXX_HAVE_ENOSTR
+ not_a_stream = ENOSTR,
+#endif
+
+ not_connected = ENOTCONN,
+ not_enough_memory = ENOMEM,
+
+#ifdef _GLIBCXX_HAVE_ENOTSUP
+ not_supported = ENOTSUP,
+#endif
+
+#ifdef _GLIBCXX_HAVE_ECANCELED
+ operation_canceled = ECANCELED,
+#endif
+
+ operation_in_progress = EINPROGRESS,
+ operation_not_permitted = EPERM,
+ operation_not_supported = EOPNOTSUPP,
+ operation_would_block = EWOULDBLOCK,
+
+#ifdef _GLIBCXX_HAVE_EOWNERDEAD
+ owner_dead = EOWNERDEAD,
+#endif
+
+ permission_denied = EACCES,
+
+#ifdef _GLIBCXX_HAVE_EPROTO
+ protocol_error = EPROTO,
+#endif
+
+ protocol_not_supported = EPROTONOSUPPORT,
+ read_only_file_system = EROFS,
+ resource_deadlock_would_occur = EDEADLK,
+ resource_unavailable_try_again = EAGAIN,
+ result_out_of_range = ERANGE,
+
+#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE
+ state_not_recoverable = ENOTRECOVERABLE,
+#endif
+
+#ifdef _GLIBCXX_HAVE_ETIME
+ stream_timeout = ETIME,
+#endif
+
+#ifdef _GLIBCXX_HAVE_ETXTBSY
+ text_file_busy = ETXTBSY,
+#endif
+
+ timed_out = ETIMEDOUT,
+ too_many_files_open_in_system = ENFILE,
+ too_many_files_open = EMFILE,
+ too_many_links = EMLINK,
+ too_many_symbolic_link_levels = ELOOP,
+
+#ifdef _GLIBCXX_HAVE_EOVERFLOW
+ value_too_large = EOVERFLOW,
+#endif
+
+ wrong_protocol_type = EPROTOTYPE
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/extc++.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/extc++.h
new file mode 100644
index 0000000..f0ccc42
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/extc++.h
@@ -0,0 +1,69 @@
+// C++ includes used for precompiling extensions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file extc++.h
+ * This is an implementation file for a precompiled header.
+ */
+
+#include <bits/stdtr1c++.h>
+
+#include <ext/algorithm>
+#include <ext/array_allocator.h>
+#include <ext/atomicity.h>
+#include <ext/bitmap_allocator.h>
+#include <ext/cast.h>
+#include <ext/concurrence.h>
+#include <ext/debug_allocator.h>
+#include <ext/extptr_allocator.h>
+#include <ext/functional>
+#include <ext/iterator>
+#include <ext/malloc_allocator.h>
+#include <ext/memory>
+#include <ext/mt_allocator.h>
+#include <ext/new_allocator.h>
+#include <ext/numeric>
+#include <ext/pod_char_traits.h>
+#include <ext/pointer.h>
+#include <ext/pool_allocator.h>
+#include <ext/rb_tree>
+#include <ext/rope>
+#include <ext/slist>
+#include <ext/stdio_filebuf.h>
+#include <ext/stdio_sync_filebuf.h>
+#include <ext/throw_allocator.h>
+#include <ext/typelist.h>
+#include <ext/type_traits.h>
+#include <ext/vstring.h>
+#include <ext/pb_ds/assoc_container.hpp>
+#include <ext/pb_ds/priority_queue.hpp>
+#include <ext/pb_ds/exception.hpp>
+#include <ext/pb_ds/hash_policy.hpp>
+#include <ext/pb_ds/list_update_policy.hpp>
+#include <ext/pb_ds/tree_policy.hpp>
+#include <ext/pb_ds/trie_policy.hpp>
+
+#ifdef _GLIBCXX_HAVE_ICONV
+ #include <ext/codecvt_specializations.h>
+ #include <ext/enc_filebuf.h>
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/gthr-default.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/gthr-default.h
new file mode 100644
index 0000000..6c6e890
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/gthr-default.h
@@ -0,0 +1,895 @@
+/* Threads compatibility routines for libgcc2 and libobjc. */
+/* Compile this one with gcc. */
+/* Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+ 2008, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef _GLIBCXX_GCC_GTHR_POSIX_H
+#define _GLIBCXX_GCC_GTHR_POSIX_H
+
+/* POSIX threads specific definitions.
+ Easy, since the interface is just one-to-one mapping. */
+
+#define __GTHREADS 1
+#define __GTHREADS_CXX0X 1
+
+/* Some implementations of <pthread.h> require this to be defined. */
+#if !defined(_REENTRANT) && defined(__osf__)
+#define _REENTRANT 1
+#endif
+
+#include <pthread.h>
+#include <unistd.h>
+
+typedef pthread_t __gthread_t;
+typedef pthread_key_t __gthread_key_t;
+typedef pthread_once_t __gthread_once_t;
+typedef pthread_mutex_t __gthread_mutex_t;
+typedef pthread_mutex_t __gthread_recursive_mutex_t;
+typedef pthread_cond_t __gthread_cond_t;
+typedef struct timespec __gthread_time_t;
+
+/* POSIX like conditional variables are supported. Please look at comments
+ in gthr.h for details. */
+#define __GTHREAD_HAS_COND 1
+
+#define __GTHREAD_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER
+#define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
+#if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
+#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+#elif defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
+#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+#else
+#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_function
+#endif
+#define __GTHREAD_COND_INIT PTHREAD_COND_INITIALIZER
+#define __GTHREAD_TIME_INIT {0,0}
+
+#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK
+# ifndef __gthrw_pragma
+# define __gthrw_pragma(pragma)
+# endif
+# define __gthrw2(name,name2,type) \
+ static __typeof(type) name __attribute__ ((__weakref__(#name2))); \
+ __gthrw_pragma(weak type)
+# define __gthrw_(name) __gthrw_ ## name
+#else
+# define __gthrw2(name,name2,type)
+# define __gthrw_(name) name
+#endif
+
+/* Typically, __gthrw_foo is a weak reference to symbol foo. */
+#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
+
+/* On Tru64, /usr/include/pthread.h uses #pragma extern_prefix "__" to
+ map a subset of the POSIX pthread API to mangled versions of their
+ names. */
+#if defined(__osf__) && defined(_PTHREAD_USE_MANGLED_NAMES_)
+#define __gthrw3(name) __gthrw2(__gthrw_ ## name, __ ## name, name)
+__gthrw3(pthread_once)
+__gthrw3(pthread_getspecific)
+__gthrw3(pthread_setspecific)
+
+__gthrw3(pthread_create)
+__gthrw3(pthread_join)
+__gthrw3(pthread_detach)
+__gthrw3(pthread_equal)
+__gthrw3(pthread_self)
+__gthrw3(pthread_cancel)
+__gthrw3(sched_yield)
+
+__gthrw3(pthread_mutex_lock)
+__gthrw3(pthread_mutex_trylock)
+#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS >= 0
+__gthrw3(pthread_mutex_timedlock)
+#endif
+#endif /* _POSIX_TIMEOUTS */
+__gthrw3(pthread_mutex_unlock)
+__gthrw3(pthread_mutex_init)
+__gthrw3(pthread_mutex_destroy)
+
+__gthrw3(pthread_cond_broadcast)
+__gthrw3(pthread_cond_signal)
+__gthrw3(pthread_cond_wait)
+__gthrw3(pthread_cond_timedwait)
+__gthrw3(pthread_cond_destroy)
+#else
+__gthrw(pthread_once)
+__gthrw(pthread_getspecific)
+__gthrw(pthread_setspecific)
+
+__gthrw(pthread_create)
+__gthrw(pthread_join)
+__gthrw(pthread_equal)
+__gthrw(pthread_self)
+__gthrw(pthread_detach)
+__gthrw(pthread_cancel)
+__gthrw(sched_yield)
+
+__gthrw(pthread_mutex_lock)
+__gthrw(pthread_mutex_trylock)
+#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS >= 0
+__gthrw(pthread_mutex_timedlock)
+#endif
+#endif /* _POSIX_TIMEOUTS */
+__gthrw(pthread_mutex_unlock)
+__gthrw(pthread_mutex_init)
+__gthrw(pthread_mutex_destroy)
+
+__gthrw(pthread_cond_broadcast)
+__gthrw(pthread_cond_signal)
+__gthrw(pthread_cond_wait)
+__gthrw(pthread_cond_timedwait)
+__gthrw(pthread_cond_destroy)
+#endif
+
+__gthrw(pthread_key_create)
+__gthrw(pthread_key_delete)
+__gthrw(pthread_mutexattr_init)
+__gthrw(pthread_mutexattr_settype)
+__gthrw(pthread_mutexattr_destroy)
+
+
+#if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)
+/* Objective-C. */
+#if defined(__osf__) && defined(_PTHREAD_USE_MANGLED_NAMES_)
+__gthrw3(pthread_cond_init)
+__gthrw3(pthread_exit)
+#else
+__gthrw(pthread_cond_init)
+__gthrw(pthread_exit)
+#endif /* __osf__ && _PTHREAD_USE_MANGLED_NAMES_ */
+#ifdef _POSIX_PRIORITY_SCHEDULING
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+__gthrw(sched_get_priority_max)
+__gthrw(sched_get_priority_min)
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _POSIX_PRIORITY_SCHEDULING */
+__gthrw(pthread_attr_destroy)
+__gthrw(pthread_attr_init)
+__gthrw(pthread_attr_setdetachstate)
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+__gthrw(pthread_getschedparam)
+__gthrw(pthread_setschedparam)
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _LIBOBJC || _LIBOBJC_WEAK */
+
+#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK
+
+/* On Solaris 2.6 up to 9, the libc exposes a POSIX threads interface even if
+ -pthreads is not specified. The functions are dummies and most return an
+ error value. However pthread_once returns 0 without invoking the routine
+ it is passed so we cannot pretend that the interface is active if -pthreads
+ is not specified. On Solaris 2.5.1, the interface is not exposed at all so
+ we need to play the usual game with weak symbols. On Solaris 10 and up, a
+ working interface is always exposed. On FreeBSD 6 and later, libc also
+ exposes a dummy POSIX threads interface, similar to what Solaris 2.6 up
+ to 9 does. FreeBSD >= 700014 even provides a pthread_cancel stub in libc,
+ which means the alternate __gthread_active_p below cannot be used there. */
+
+#if defined(__FreeBSD__) || (defined(__sun) && defined(__svr4__))
+
+static volatile int __gthread_active = -1;
+
+static void
+__gthread_trigger (void)
+{
+ __gthread_active = 1;
+}
+
+static inline int
+__gthread_active_p (void)
+{
+ static pthread_mutex_t __gthread_active_mutex = PTHREAD_MUTEX_INITIALIZER;
+ static pthread_once_t __gthread_active_once = PTHREAD_ONCE_INIT;
+
+ /* Avoid reading __gthread_active twice on the main code path. */
+ int __gthread_active_latest_value = __gthread_active;
+
+ /* This test is not protected to avoid taking a lock on the main code
+ path so every update of __gthread_active in a threaded program must
+ be atomic with regard to the result of the test. */
+ if (__builtin_expect (__gthread_active_latest_value < 0, 0))
+ {
+ if (__gthrw_(pthread_once))
+ {
+ /* If this really is a threaded program, then we must ensure that
+ __gthread_active has been set to 1 before exiting this block. */
+ __gthrw_(pthread_mutex_lock) (&__gthread_active_mutex);
+ __gthrw_(pthread_once) (&__gthread_active_once, __gthread_trigger);
+ __gthrw_(pthread_mutex_unlock) (&__gthread_active_mutex);
+ }
+
+ /* Make sure we'll never enter this block again. */
+ if (__gthread_active < 0)
+ __gthread_active = 0;
+
+ __gthread_active_latest_value = __gthread_active;
+ }
+
+ return __gthread_active_latest_value != 0;
+}
+
+#else /* neither FreeBSD nor Solaris */
+
+static inline int
+__gthread_active_p (void)
+{
+ static void *const __gthread_active_ptr
+ = __extension__ (void *) &__gthrw_(pthread_cancel);
+ return __gthread_active_ptr != 0;
+}
+
+#endif /* FreeBSD or Solaris */
+
+#else /* not __GXX_WEAK__ */
+
+/* Similar to Solaris, HP-UX 11 for PA-RISC provides stubs for pthread
+ calls in shared flavors of the HP-UX C library. Most of the stubs
+ have no functionality. The details are described in the "libc cumulative
+ patch" for each subversion of HP-UX 11. There are two special interfaces
+ provided for checking whether an application is linked to a pthread
+ library or not. However, these interfaces aren't available in early
+ libc versions. We also can't use pthread_once as some libc versions
+ call the init function. So, we use pthread_create to check whether it
+ is possible to create a thread or not. The stub implementation returns
+ the error number ENOSYS. */
+
+#if defined(__hppa__) && defined(__hpux__)
+
+#include <errno.h>
+
+static volatile int __gthread_active = -1;
+
+static void *
+__gthread_start (void *__arg __attribute__((unused)))
+{
+ return NULL;
+}
+
+static void __gthread_active_init (void) __attribute__((noinline));
+static void
+__gthread_active_init (void)
+{
+ static pthread_mutex_t __gthread_active_mutex = PTHREAD_MUTEX_INITIALIZER;
+ pthread_t __t;
+ pthread_attr_t __a;
+ int __result;
+
+ __gthrw_(pthread_mutex_lock) (&__gthread_active_mutex);
+ if (__gthread_active < 0)
+ {
+ __gthrw_(pthread_attr_init) (&__a);
+ __gthrw_(pthread_attr_setdetachstate) (&__a, PTHREAD_CREATE_DETACHED);
+ __result = __gthrw_(pthread_create) (&__t, &__a, __gthread_start, NULL);
+ if (__result != ENOSYS)
+ __gthread_active = 1;
+ else
+ __gthread_active = 0;
+ __gthrw_(pthread_attr_destroy) (&__a);
+ }
+ __gthrw_(pthread_mutex_unlock) (&__gthread_active_mutex);
+}
+
+static inline int
+__gthread_active_p (void)
+{
+ /* Avoid reading __gthread_active twice on the main code path. */
+ int __gthread_active_latest_value = __gthread_active;
+
+ /* This test is not protected to avoid taking a lock on the main code
+ path so every update of __gthread_active in a threaded program must
+ be atomic with regard to the result of the test. */
+ if (__builtin_expect (__gthread_active_latest_value < 0, 0))
+ {
+ __gthread_active_init ();
+ __gthread_active_latest_value = __gthread_active;
+ }
+
+ return __gthread_active_latest_value != 0;
+}
+
+#else /* not hppa-hpux */
+
+static inline int
+__gthread_active_p (void)
+{
+ return 1;
+}
+
+#endif /* hppa-hpux */
+
+#endif /* __GXX_WEAK__ */
+
+#ifdef _LIBOBJC
+
+/* This is the config.h file in libobjc/ */
+#include <config.h>
+
+#ifdef HAVE_SCHED_H
+# include <sched.h>
+#endif
+
+/* Key structure for maintaining thread specific storage */
+static pthread_key_t _objc_thread_storage;
+static pthread_attr_t _objc_thread_attribs;
+
+/* Thread local storage for a single thread */
+static void *thread_local_storage = NULL;
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem. */
+static inline int
+__gthread_objc_init_thread_system (void)
+{
+ if (__gthread_active_p ())
+ {
+ /* Initialize the thread storage key. */
+ if (__gthrw_(pthread_key_create) (&_objc_thread_storage, NULL) == 0)
+ {
+ /* The normal default detach state for threads is
+ * PTHREAD_CREATE_JOINABLE which causes threads to not die
+ * when you think they should. */
+ if (__gthrw_(pthread_attr_init) (&_objc_thread_attribs) == 0
+ && __gthrw_(pthread_attr_setdetachstate) (&_objc_thread_attribs,
+ PTHREAD_CREATE_DETACHED) == 0)
+ return 0;
+ }
+ }
+
+ return -1;
+}
+
+/* Close the threads subsystem. */
+static inline int
+__gthread_objc_close_thread_system (void)
+{
+ if (__gthread_active_p ()
+ && __gthrw_(pthread_key_delete) (_objc_thread_storage) == 0
+ && __gthrw_(pthread_attr_destroy) (&_objc_thread_attribs) == 0)
+ return 0;
+
+ return -1;
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution. */
+static inline objc_thread_t
+__gthread_objc_thread_detach (void (*func)(void *), void *arg)
+{
+ objc_thread_t thread_id;
+ pthread_t new_thread_handle;
+
+ if (!__gthread_active_p ())
+ return NULL;
+
+ if (!(__gthrw_(pthread_create) (&new_thread_handle, NULL, (void *) func, arg)))
+ thread_id = (objc_thread_t) new_thread_handle;
+ else
+ thread_id = NULL;
+
+ return thread_id;
+}
+
+/* Set the current thread's priority. */
+static inline int
+__gthread_objc_thread_set_priority (int priority)
+{
+ if (!__gthread_active_p ())
+ return -1;
+ else
+ {
+#ifdef _POSIX_PRIORITY_SCHEDULING
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+ pthread_t thread_id = __gthrw_(pthread_self) ();
+ int policy;
+ struct sched_param params;
+ int priority_min, priority_max;
+
+ if (__gthrw_(pthread_getschedparam) (thread_id, &policy, &params) == 0)
+ {
+ if ((priority_max = __gthrw_(sched_get_priority_max) (policy)) == -1)
+ return -1;
+
+ if ((priority_min = __gthrw_(sched_get_priority_min) (policy)) == -1)
+ return -1;
+
+ if (priority > priority_max)
+ priority = priority_max;
+ else if (priority < priority_min)
+ priority = priority_min;
+ params.sched_priority = priority;
+
+ /*
+ * The solaris 7 and several other man pages incorrectly state that
+ * this should be a pointer to policy but pthread.h is universally
+ * at odds with this.
+ */
+ if (__gthrw_(pthread_setschedparam) (thread_id, policy, &params) == 0)
+ return 0;
+ }
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _POSIX_PRIORITY_SCHEDULING */
+ return -1;
+ }
+}
+
+/* Return the current thread's priority. */
+static inline int
+__gthread_objc_thread_get_priority (void)
+{
+#ifdef _POSIX_PRIORITY_SCHEDULING
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+ if (__gthread_active_p ())
+ {
+ int policy;
+ struct sched_param params;
+
+ if (__gthrw_(pthread_getschedparam) (__gthrw_(pthread_self) (), &policy, &params) == 0)
+ return params.sched_priority;
+ else
+ return -1;
+ }
+ else
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _POSIX_PRIORITY_SCHEDULING */
+ return OBJC_THREAD_INTERACTIVE_PRIORITY;
+}
+
+/* Yield our process time to another thread. */
+static inline void
+__gthread_objc_thread_yield (void)
+{
+ if (__gthread_active_p ())
+ __gthrw_(sched_yield) ();
+}
+
+/* Terminate the current thread. */
+static inline int
+__gthread_objc_thread_exit (void)
+{
+ if (__gthread_active_p ())
+ /* exit the thread */
+ __gthrw_(pthread_exit) (&__objc_thread_exit_status);
+
+ /* Failed if we reached here */
+ return -1;
+}
+
+/* Returns an integer value which uniquely describes a thread. */
+static inline objc_thread_t
+__gthread_objc_thread_id (void)
+{
+ if (__gthread_active_p ())
+ return (objc_thread_t) __gthrw_(pthread_self) ();
+ else
+ return (objc_thread_t) 1;
+}
+
+/* Sets the thread's local storage pointer. */
+static inline int
+__gthread_objc_thread_set_data (void *value)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_setspecific) (_objc_thread_storage, value);
+ else
+ {
+ thread_local_storage = value;
+ return 0;
+ }
+}
+
+/* Returns the thread's local storage pointer. */
+static inline void *
+__gthread_objc_thread_get_data (void)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_getspecific) (_objc_thread_storage);
+ else
+ return thread_local_storage;
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex. */
+static inline int
+__gthread_objc_mutex_allocate (objc_mutex_t mutex)
+{
+ if (__gthread_active_p ())
+ {
+ mutex->backend = objc_malloc (sizeof (pthread_mutex_t));
+
+ if (__gthrw_(pthread_mutex_init) ((pthread_mutex_t *) mutex->backend, NULL))
+ {
+ objc_free (mutex->backend);
+ mutex->backend = NULL;
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+/* Deallocate a mutex. */
+static inline int
+__gthread_objc_mutex_deallocate (objc_mutex_t mutex)
+{
+ if (__gthread_active_p ())
+ {
+ int count;
+
+ /*
+ * Posix Threads specifically require that the thread be unlocked
+ * for __gthrw_(pthread_mutex_destroy) to work.
+ */
+
+ do
+ {
+ count = __gthrw_(pthread_mutex_unlock) ((pthread_mutex_t *) mutex->backend);
+ if (count < 0)
+ return -1;
+ }
+ while (count);
+
+ if (__gthrw_(pthread_mutex_destroy) ((pthread_mutex_t *) mutex->backend))
+ return -1;
+
+ objc_free (mutex->backend);
+ mutex->backend = NULL;
+ }
+ return 0;
+}
+
+/* Grab a lock on a mutex. */
+static inline int
+__gthread_objc_mutex_lock (objc_mutex_t mutex)
+{
+ if (__gthread_active_p ()
+ && __gthrw_(pthread_mutex_lock) ((pthread_mutex_t *) mutex->backend) != 0)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+/* Try to grab a lock on a mutex. */
+static inline int
+__gthread_objc_mutex_trylock (objc_mutex_t mutex)
+{
+ if (__gthread_active_p ()
+ && __gthrw_(pthread_mutex_trylock) ((pthread_mutex_t *) mutex->backend) != 0)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+/* Unlock the mutex */
+static inline int
+__gthread_objc_mutex_unlock (objc_mutex_t mutex)
+{
+ if (__gthread_active_p ()
+ && __gthrw_(pthread_mutex_unlock) ((pthread_mutex_t *) mutex->backend) != 0)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition. */
+static inline int
+__gthread_objc_condition_allocate (objc_condition_t condition)
+{
+ if (__gthread_active_p ())
+ {
+ condition->backend = objc_malloc (sizeof (pthread_cond_t));
+
+ if (__gthrw_(pthread_cond_init) ((pthread_cond_t *) condition->backend, NULL))
+ {
+ objc_free (condition->backend);
+ condition->backend = NULL;
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+/* Deallocate a condition. */
+static inline int
+__gthread_objc_condition_deallocate (objc_condition_t condition)
+{
+ if (__gthread_active_p ())
+ {
+ if (__gthrw_(pthread_cond_destroy) ((pthread_cond_t *) condition->backend))
+ return -1;
+
+ objc_free (condition->backend);
+ condition->backend = NULL;
+ }
+ return 0;
+}
+
+/* Wait on the condition */
+static inline int
+__gthread_objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_cond_wait) ((pthread_cond_t *) condition->backend,
+ (pthread_mutex_t *) mutex->backend);
+ else
+ return 0;
+}
+
+/* Wake up all threads waiting on this condition. */
+static inline int
+__gthread_objc_condition_broadcast (objc_condition_t condition)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_cond_broadcast) ((pthread_cond_t *) condition->backend);
+ else
+ return 0;
+}
+
+/* Wake up one thread waiting on this condition. */
+static inline int
+__gthread_objc_condition_signal (objc_condition_t condition)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_cond_signal) ((pthread_cond_t *) condition->backend);
+ else
+ return 0;
+}
+
+#else /* _LIBOBJC */
+
+static inline int
+__gthread_create (__gthread_t *__threadid, void *(*__func) (void*),
+ void *__args)
+{
+ return __gthrw_(pthread_create) (__threadid, NULL, __func, __args);
+}
+
+static inline int
+__gthread_join (__gthread_t __threadid, void **__value_ptr)
+{
+ return __gthrw_(pthread_join) (__threadid, __value_ptr);
+}
+
+static inline int
+__gthread_detach (__gthread_t __threadid)
+{
+ return __gthrw_(pthread_detach) (__threadid);
+}
+
+static inline int
+__gthread_equal (__gthread_t __t1, __gthread_t __t2)
+{
+ return __gthrw_(pthread_equal) (__t1, __t2);
+}
+
+static inline __gthread_t
+__gthread_self (void)
+{
+ return __gthrw_(pthread_self) ();
+}
+
+static inline int
+__gthread_yield (void)
+{
+ return __gthrw_(sched_yield) ();
+}
+
+static inline int
+__gthread_once (__gthread_once_t *__once, void (*__func) (void))
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_once) (__once, __func);
+ else
+ return -1;
+}
+
+static inline int
+__gthread_key_create (__gthread_key_t *__key, void (*__dtor) (void *))
+{
+ return __gthrw_(pthread_key_create) (__key, __dtor);
+}
+
+static inline int
+__gthread_key_delete (__gthread_key_t __key)
+{
+ return __gthrw_(pthread_key_delete) (__key);
+}
+
+static inline void *
+__gthread_getspecific (__gthread_key_t __key)
+{
+ return __gthrw_(pthread_getspecific) (__key);
+}
+
+static inline int
+__gthread_setspecific (__gthread_key_t __key, const void *__ptr)
+{
+ return __gthrw_(pthread_setspecific) (__key, __ptr);
+}
+
+static inline int
+__gthread_mutex_destroy (__gthread_mutex_t *__mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_destroy) (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_mutex_lock (__gthread_mutex_t *__mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_lock) (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_mutex_trylock (__gthread_mutex_t *__mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_trylock) (__mutex);
+ else
+ return 0;
+}
+
+#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS >= 0
+static inline int
+__gthread_mutex_timedlock (__gthread_mutex_t *__mutex,
+ const __gthread_time_t *__abs_timeout)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_timedlock) (__mutex, __abs_timeout);
+ else
+ return 0;
+}
+#endif
+#endif
+
+static inline int
+__gthread_mutex_unlock (__gthread_mutex_t *__mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_unlock) (__mutex);
+ else
+ return 0;
+}
+
+#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+static inline int
+__gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *__mutex)
+{
+ if (__gthread_active_p ())
+ {
+ pthread_mutexattr_t __attr;
+ int __r;
+
+ __r = __gthrw_(pthread_mutexattr_init) (&__attr);
+ if (!__r)
+ __r = __gthrw_(pthread_mutexattr_settype) (&__attr,
+ PTHREAD_MUTEX_RECURSIVE);
+ if (!__r)
+ __r = __gthrw_(pthread_mutex_init) (__mutex, &__attr);
+ if (!__r)
+ __r = __gthrw_(pthread_mutexattr_destroy) (&__attr);
+ return __r;
+ }
+ return 0;
+}
+#endif
+
+static inline int
+__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_mutex_lock (__mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_mutex_trylock (__mutex);
+}
+
+#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS >= 0
+static inline int
+__gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t *__mutex,
+ const __gthread_time_t *__abs_timeout)
+{
+ return __gthread_mutex_timedlock (__mutex, __abs_timeout);
+}
+#endif
+#endif
+
+static inline int
+__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_mutex_unlock (__mutex);
+}
+
+static inline int
+__gthread_cond_broadcast (__gthread_cond_t *__cond)
+{
+ return __gthrw_(pthread_cond_broadcast) (__cond);
+}
+
+static inline int
+__gthread_cond_signal (__gthread_cond_t *__cond)
+{
+ return __gthrw_(pthread_cond_signal) (__cond);
+}
+
+static inline int
+__gthread_cond_wait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex)
+{
+ return __gthrw_(pthread_cond_wait) (__cond, __mutex);
+}
+
+static inline int
+__gthread_cond_timedwait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex,
+ const __gthread_time_t *__abs_timeout)
+{
+ return __gthrw_(pthread_cond_timedwait) (__cond, __mutex, __abs_timeout);
+}
+
+static inline int
+__gthread_cond_wait_recursive (__gthread_cond_t *__cond,
+ __gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_cond_wait (__cond, __mutex);
+}
+
+static inline int
+__gthread_cond_timedwait_recursive (__gthread_cond_t *__cond,
+ __gthread_recursive_mutex_t *__mutex,
+ const __gthread_time_t *__abs_timeout)
+{
+ return __gthread_cond_timedwait (__cond, __mutex, __abs_timeout);
+}
+
+static inline int
+__gthread_cond_destroy (__gthread_cond_t* __cond)
+{
+ return __gthrw_(pthread_cond_destroy) (__cond);
+}
+
+#endif /* _LIBOBJC */
+
+#endif /* ! _GLIBCXX_GCC_GTHR_POSIX_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/gthr-posix.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/gthr-posix.h
new file mode 100644
index 0000000..6c6e890
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/gthr-posix.h
@@ -0,0 +1,895 @@
+/* Threads compatibility routines for libgcc2 and libobjc. */
+/* Compile this one with gcc. */
+/* Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+ 2008, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef _GLIBCXX_GCC_GTHR_POSIX_H
+#define _GLIBCXX_GCC_GTHR_POSIX_H
+
+/* POSIX threads specific definitions.
+ Easy, since the interface is just one-to-one mapping. */
+
+#define __GTHREADS 1
+#define __GTHREADS_CXX0X 1
+
+/* Some implementations of <pthread.h> require this to be defined. */
+#if !defined(_REENTRANT) && defined(__osf__)
+#define _REENTRANT 1
+#endif
+
+#include <pthread.h>
+#include <unistd.h>
+
+typedef pthread_t __gthread_t;
+typedef pthread_key_t __gthread_key_t;
+typedef pthread_once_t __gthread_once_t;
+typedef pthread_mutex_t __gthread_mutex_t;
+typedef pthread_mutex_t __gthread_recursive_mutex_t;
+typedef pthread_cond_t __gthread_cond_t;
+typedef struct timespec __gthread_time_t;
+
+/* POSIX like conditional variables are supported. Please look at comments
+ in gthr.h for details. */
+#define __GTHREAD_HAS_COND 1
+
+#define __GTHREAD_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER
+#define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
+#if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
+#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+#elif defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
+#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+#else
+#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_function
+#endif
+#define __GTHREAD_COND_INIT PTHREAD_COND_INITIALIZER
+#define __GTHREAD_TIME_INIT {0,0}
+
+#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK
+# ifndef __gthrw_pragma
+# define __gthrw_pragma(pragma)
+# endif
+# define __gthrw2(name,name2,type) \
+ static __typeof(type) name __attribute__ ((__weakref__(#name2))); \
+ __gthrw_pragma(weak type)
+# define __gthrw_(name) __gthrw_ ## name
+#else
+# define __gthrw2(name,name2,type)
+# define __gthrw_(name) name
+#endif
+
+/* Typically, __gthrw_foo is a weak reference to symbol foo. */
+#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
+
+/* On Tru64, /usr/include/pthread.h uses #pragma extern_prefix "__" to
+ map a subset of the POSIX pthread API to mangled versions of their
+ names. */
+#if defined(__osf__) && defined(_PTHREAD_USE_MANGLED_NAMES_)
+#define __gthrw3(name) __gthrw2(__gthrw_ ## name, __ ## name, name)
+__gthrw3(pthread_once)
+__gthrw3(pthread_getspecific)
+__gthrw3(pthread_setspecific)
+
+__gthrw3(pthread_create)
+__gthrw3(pthread_join)
+__gthrw3(pthread_detach)
+__gthrw3(pthread_equal)
+__gthrw3(pthread_self)
+__gthrw3(pthread_cancel)
+__gthrw3(sched_yield)
+
+__gthrw3(pthread_mutex_lock)
+__gthrw3(pthread_mutex_trylock)
+#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS >= 0
+__gthrw3(pthread_mutex_timedlock)
+#endif
+#endif /* _POSIX_TIMEOUTS */
+__gthrw3(pthread_mutex_unlock)
+__gthrw3(pthread_mutex_init)
+__gthrw3(pthread_mutex_destroy)
+
+__gthrw3(pthread_cond_broadcast)
+__gthrw3(pthread_cond_signal)
+__gthrw3(pthread_cond_wait)
+__gthrw3(pthread_cond_timedwait)
+__gthrw3(pthread_cond_destroy)
+#else
+__gthrw(pthread_once)
+__gthrw(pthread_getspecific)
+__gthrw(pthread_setspecific)
+
+__gthrw(pthread_create)
+__gthrw(pthread_join)
+__gthrw(pthread_equal)
+__gthrw(pthread_self)
+__gthrw(pthread_detach)
+__gthrw(pthread_cancel)
+__gthrw(sched_yield)
+
+__gthrw(pthread_mutex_lock)
+__gthrw(pthread_mutex_trylock)
+#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS >= 0
+__gthrw(pthread_mutex_timedlock)
+#endif
+#endif /* _POSIX_TIMEOUTS */
+__gthrw(pthread_mutex_unlock)
+__gthrw(pthread_mutex_init)
+__gthrw(pthread_mutex_destroy)
+
+__gthrw(pthread_cond_broadcast)
+__gthrw(pthread_cond_signal)
+__gthrw(pthread_cond_wait)
+__gthrw(pthread_cond_timedwait)
+__gthrw(pthread_cond_destroy)
+#endif
+
+__gthrw(pthread_key_create)
+__gthrw(pthread_key_delete)
+__gthrw(pthread_mutexattr_init)
+__gthrw(pthread_mutexattr_settype)
+__gthrw(pthread_mutexattr_destroy)
+
+
+#if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)
+/* Objective-C. */
+#if defined(__osf__) && defined(_PTHREAD_USE_MANGLED_NAMES_)
+__gthrw3(pthread_cond_init)
+__gthrw3(pthread_exit)
+#else
+__gthrw(pthread_cond_init)
+__gthrw(pthread_exit)
+#endif /* __osf__ && _PTHREAD_USE_MANGLED_NAMES_ */
+#ifdef _POSIX_PRIORITY_SCHEDULING
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+__gthrw(sched_get_priority_max)
+__gthrw(sched_get_priority_min)
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _POSIX_PRIORITY_SCHEDULING */
+__gthrw(pthread_attr_destroy)
+__gthrw(pthread_attr_init)
+__gthrw(pthread_attr_setdetachstate)
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+__gthrw(pthread_getschedparam)
+__gthrw(pthread_setschedparam)
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _LIBOBJC || _LIBOBJC_WEAK */
+
+#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK
+
+/* On Solaris 2.6 up to 9, the libc exposes a POSIX threads interface even if
+ -pthreads is not specified. The functions are dummies and most return an
+ error value. However pthread_once returns 0 without invoking the routine
+ it is passed so we cannot pretend that the interface is active if -pthreads
+ is not specified. On Solaris 2.5.1, the interface is not exposed at all so
+ we need to play the usual game with weak symbols. On Solaris 10 and up, a
+ working interface is always exposed. On FreeBSD 6 and later, libc also
+ exposes a dummy POSIX threads interface, similar to what Solaris 2.6 up
+ to 9 does. FreeBSD >= 700014 even provides a pthread_cancel stub in libc,
+ which means the alternate __gthread_active_p below cannot be used there. */
+
+#if defined(__FreeBSD__) || (defined(__sun) && defined(__svr4__))
+
+static volatile int __gthread_active = -1;
+
+static void
+__gthread_trigger (void)
+{
+ __gthread_active = 1;
+}
+
+static inline int
+__gthread_active_p (void)
+{
+ static pthread_mutex_t __gthread_active_mutex = PTHREAD_MUTEX_INITIALIZER;
+ static pthread_once_t __gthread_active_once = PTHREAD_ONCE_INIT;
+
+ /* Avoid reading __gthread_active twice on the main code path. */
+ int __gthread_active_latest_value = __gthread_active;
+
+ /* This test is not protected to avoid taking a lock on the main code
+ path so every update of __gthread_active in a threaded program must
+ be atomic with regard to the result of the test. */
+ if (__builtin_expect (__gthread_active_latest_value < 0, 0))
+ {
+ if (__gthrw_(pthread_once))
+ {
+ /* If this really is a threaded program, then we must ensure that
+ __gthread_active has been set to 1 before exiting this block. */
+ __gthrw_(pthread_mutex_lock) (&__gthread_active_mutex);
+ __gthrw_(pthread_once) (&__gthread_active_once, __gthread_trigger);
+ __gthrw_(pthread_mutex_unlock) (&__gthread_active_mutex);
+ }
+
+ /* Make sure we'll never enter this block again. */
+ if (__gthread_active < 0)
+ __gthread_active = 0;
+
+ __gthread_active_latest_value = __gthread_active;
+ }
+
+ return __gthread_active_latest_value != 0;
+}
+
+#else /* neither FreeBSD nor Solaris */
+
+static inline int
+__gthread_active_p (void)
+{
+ static void *const __gthread_active_ptr
+ = __extension__ (void *) &__gthrw_(pthread_cancel);
+ return __gthread_active_ptr != 0;
+}
+
+#endif /* FreeBSD or Solaris */
+
+#else /* not __GXX_WEAK__ */
+
+/* Similar to Solaris, HP-UX 11 for PA-RISC provides stubs for pthread
+ calls in shared flavors of the HP-UX C library. Most of the stubs
+ have no functionality. The details are described in the "libc cumulative
+ patch" for each subversion of HP-UX 11. There are two special interfaces
+ provided for checking whether an application is linked to a pthread
+ library or not. However, these interfaces aren't available in early
+ libc versions. We also can't use pthread_once as some libc versions
+ call the init function. So, we use pthread_create to check whether it
+ is possible to create a thread or not. The stub implementation returns
+ the error number ENOSYS. */
+
+#if defined(__hppa__) && defined(__hpux__)
+
+#include <errno.h>
+
+static volatile int __gthread_active = -1;
+
+static void *
+__gthread_start (void *__arg __attribute__((unused)))
+{
+ return NULL;
+}
+
+static void __gthread_active_init (void) __attribute__((noinline));
+static void
+__gthread_active_init (void)
+{
+ static pthread_mutex_t __gthread_active_mutex = PTHREAD_MUTEX_INITIALIZER;
+ pthread_t __t;
+ pthread_attr_t __a;
+ int __result;
+
+ __gthrw_(pthread_mutex_lock) (&__gthread_active_mutex);
+ if (__gthread_active < 0)
+ {
+ __gthrw_(pthread_attr_init) (&__a);
+ __gthrw_(pthread_attr_setdetachstate) (&__a, PTHREAD_CREATE_DETACHED);
+ __result = __gthrw_(pthread_create) (&__t, &__a, __gthread_start, NULL);
+ if (__result != ENOSYS)
+ __gthread_active = 1;
+ else
+ __gthread_active = 0;
+ __gthrw_(pthread_attr_destroy) (&__a);
+ }
+ __gthrw_(pthread_mutex_unlock) (&__gthread_active_mutex);
+}
+
+static inline int
+__gthread_active_p (void)
+{
+ /* Avoid reading __gthread_active twice on the main code path. */
+ int __gthread_active_latest_value = __gthread_active;
+
+ /* This test is not protected to avoid taking a lock on the main code
+ path so every update of __gthread_active in a threaded program must
+ be atomic with regard to the result of the test. */
+ if (__builtin_expect (__gthread_active_latest_value < 0, 0))
+ {
+ __gthread_active_init ();
+ __gthread_active_latest_value = __gthread_active;
+ }
+
+ return __gthread_active_latest_value != 0;
+}
+
+#else /* not hppa-hpux */
+
+static inline int
+__gthread_active_p (void)
+{
+ return 1;
+}
+
+#endif /* hppa-hpux */
+
+#endif /* __GXX_WEAK__ */
+
+#ifdef _LIBOBJC
+
+/* This is the config.h file in libobjc/ */
+#include <config.h>
+
+#ifdef HAVE_SCHED_H
+# include <sched.h>
+#endif
+
+/* Key structure for maintaining thread specific storage */
+static pthread_key_t _objc_thread_storage;
+static pthread_attr_t _objc_thread_attribs;
+
+/* Thread local storage for a single thread */
+static void *thread_local_storage = NULL;
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem. */
+static inline int
+__gthread_objc_init_thread_system (void)
+{
+ if (__gthread_active_p ())
+ {
+ /* Initialize the thread storage key. */
+ if (__gthrw_(pthread_key_create) (&_objc_thread_storage, NULL) == 0)
+ {
+ /* The normal default detach state for threads is
+ * PTHREAD_CREATE_JOINABLE which causes threads to not die
+ * when you think they should. */
+ if (__gthrw_(pthread_attr_init) (&_objc_thread_attribs) == 0
+ && __gthrw_(pthread_attr_setdetachstate) (&_objc_thread_attribs,
+ PTHREAD_CREATE_DETACHED) == 0)
+ return 0;
+ }
+ }
+
+ return -1;
+}
+
+/* Close the threads subsystem. */
+static inline int
+__gthread_objc_close_thread_system (void)
+{
+ if (__gthread_active_p ()
+ && __gthrw_(pthread_key_delete) (_objc_thread_storage) == 0
+ && __gthrw_(pthread_attr_destroy) (&_objc_thread_attribs) == 0)
+ return 0;
+
+ return -1;
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution. */
+static inline objc_thread_t
+__gthread_objc_thread_detach (void (*func)(void *), void *arg)
+{
+ objc_thread_t thread_id;
+ pthread_t new_thread_handle;
+
+ if (!__gthread_active_p ())
+ return NULL;
+
+ if (!(__gthrw_(pthread_create) (&new_thread_handle, NULL, (void *) func, arg)))
+ thread_id = (objc_thread_t) new_thread_handle;
+ else
+ thread_id = NULL;
+
+ return thread_id;
+}
+
+/* Set the current thread's priority. */
+static inline int
+__gthread_objc_thread_set_priority (int priority)
+{
+ if (!__gthread_active_p ())
+ return -1;
+ else
+ {
+#ifdef _POSIX_PRIORITY_SCHEDULING
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+ pthread_t thread_id = __gthrw_(pthread_self) ();
+ int policy;
+ struct sched_param params;
+ int priority_min, priority_max;
+
+ if (__gthrw_(pthread_getschedparam) (thread_id, &policy, &params) == 0)
+ {
+ if ((priority_max = __gthrw_(sched_get_priority_max) (policy)) == -1)
+ return -1;
+
+ if ((priority_min = __gthrw_(sched_get_priority_min) (policy)) == -1)
+ return -1;
+
+ if (priority > priority_max)
+ priority = priority_max;
+ else if (priority < priority_min)
+ priority = priority_min;
+ params.sched_priority = priority;
+
+ /*
+ * The solaris 7 and several other man pages incorrectly state that
+ * this should be a pointer to policy but pthread.h is universally
+ * at odds with this.
+ */
+ if (__gthrw_(pthread_setschedparam) (thread_id, policy, &params) == 0)
+ return 0;
+ }
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _POSIX_PRIORITY_SCHEDULING */
+ return -1;
+ }
+}
+
+/* Return the current thread's priority. */
+static inline int
+__gthread_objc_thread_get_priority (void)
+{
+#ifdef _POSIX_PRIORITY_SCHEDULING
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+ if (__gthread_active_p ())
+ {
+ int policy;
+ struct sched_param params;
+
+ if (__gthrw_(pthread_getschedparam) (__gthrw_(pthread_self) (), &policy, &params) == 0)
+ return params.sched_priority;
+ else
+ return -1;
+ }
+ else
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _POSIX_PRIORITY_SCHEDULING */
+ return OBJC_THREAD_INTERACTIVE_PRIORITY;
+}
+
+/* Yield our process time to another thread. */
+static inline void
+__gthread_objc_thread_yield (void)
+{
+ if (__gthread_active_p ())
+ __gthrw_(sched_yield) ();
+}
+
+/* Terminate the current thread. */
+static inline int
+__gthread_objc_thread_exit (void)
+{
+ if (__gthread_active_p ())
+ /* exit the thread */
+ __gthrw_(pthread_exit) (&__objc_thread_exit_status);
+
+ /* Failed if we reached here */
+ return -1;
+}
+
+/* Returns an integer value which uniquely describes a thread. */
+static inline objc_thread_t
+__gthread_objc_thread_id (void)
+{
+ if (__gthread_active_p ())
+ return (objc_thread_t) __gthrw_(pthread_self) ();
+ else
+ return (objc_thread_t) 1;
+}
+
+/* Sets the thread's local storage pointer. */
+static inline int
+__gthread_objc_thread_set_data (void *value)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_setspecific) (_objc_thread_storage, value);
+ else
+ {
+ thread_local_storage = value;
+ return 0;
+ }
+}
+
+/* Returns the thread's local storage pointer. */
+static inline void *
+__gthread_objc_thread_get_data (void)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_getspecific) (_objc_thread_storage);
+ else
+ return thread_local_storage;
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex. */
+static inline int
+__gthread_objc_mutex_allocate (objc_mutex_t mutex)
+{
+ if (__gthread_active_p ())
+ {
+ mutex->backend = objc_malloc (sizeof (pthread_mutex_t));
+
+ if (__gthrw_(pthread_mutex_init) ((pthread_mutex_t *) mutex->backend, NULL))
+ {
+ objc_free (mutex->backend);
+ mutex->backend = NULL;
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+/* Deallocate a mutex. */
+static inline int
+__gthread_objc_mutex_deallocate (objc_mutex_t mutex)
+{
+ if (__gthread_active_p ())
+ {
+ int count;
+
+ /*
+ * Posix Threads specifically require that the thread be unlocked
+ * for __gthrw_(pthread_mutex_destroy) to work.
+ */
+
+ do
+ {
+ count = __gthrw_(pthread_mutex_unlock) ((pthread_mutex_t *) mutex->backend);
+ if (count < 0)
+ return -1;
+ }
+ while (count);
+
+ if (__gthrw_(pthread_mutex_destroy) ((pthread_mutex_t *) mutex->backend))
+ return -1;
+
+ objc_free (mutex->backend);
+ mutex->backend = NULL;
+ }
+ return 0;
+}
+
+/* Grab a lock on a mutex. */
+static inline int
+__gthread_objc_mutex_lock (objc_mutex_t mutex)
+{
+ if (__gthread_active_p ()
+ && __gthrw_(pthread_mutex_lock) ((pthread_mutex_t *) mutex->backend) != 0)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+/* Try to grab a lock on a mutex. */
+static inline int
+__gthread_objc_mutex_trylock (objc_mutex_t mutex)
+{
+ if (__gthread_active_p ()
+ && __gthrw_(pthread_mutex_trylock) ((pthread_mutex_t *) mutex->backend) != 0)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+/* Unlock the mutex */
+static inline int
+__gthread_objc_mutex_unlock (objc_mutex_t mutex)
+{
+ if (__gthread_active_p ()
+ && __gthrw_(pthread_mutex_unlock) ((pthread_mutex_t *) mutex->backend) != 0)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition. */
+static inline int
+__gthread_objc_condition_allocate (objc_condition_t condition)
+{
+ if (__gthread_active_p ())
+ {
+ condition->backend = objc_malloc (sizeof (pthread_cond_t));
+
+ if (__gthrw_(pthread_cond_init) ((pthread_cond_t *) condition->backend, NULL))
+ {
+ objc_free (condition->backend);
+ condition->backend = NULL;
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+/* Deallocate a condition. */
+static inline int
+__gthread_objc_condition_deallocate (objc_condition_t condition)
+{
+ if (__gthread_active_p ())
+ {
+ if (__gthrw_(pthread_cond_destroy) ((pthread_cond_t *) condition->backend))
+ return -1;
+
+ objc_free (condition->backend);
+ condition->backend = NULL;
+ }
+ return 0;
+}
+
+/* Wait on the condition */
+static inline int
+__gthread_objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_cond_wait) ((pthread_cond_t *) condition->backend,
+ (pthread_mutex_t *) mutex->backend);
+ else
+ return 0;
+}
+
+/* Wake up all threads waiting on this condition. */
+static inline int
+__gthread_objc_condition_broadcast (objc_condition_t condition)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_cond_broadcast) ((pthread_cond_t *) condition->backend);
+ else
+ return 0;
+}
+
+/* Wake up one thread waiting on this condition. */
+static inline int
+__gthread_objc_condition_signal (objc_condition_t condition)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_cond_signal) ((pthread_cond_t *) condition->backend);
+ else
+ return 0;
+}
+
+#else /* _LIBOBJC */
+
+static inline int
+__gthread_create (__gthread_t *__threadid, void *(*__func) (void*),
+ void *__args)
+{
+ return __gthrw_(pthread_create) (__threadid, NULL, __func, __args);
+}
+
+static inline int
+__gthread_join (__gthread_t __threadid, void **__value_ptr)
+{
+ return __gthrw_(pthread_join) (__threadid, __value_ptr);
+}
+
+static inline int
+__gthread_detach (__gthread_t __threadid)
+{
+ return __gthrw_(pthread_detach) (__threadid);
+}
+
+static inline int
+__gthread_equal (__gthread_t __t1, __gthread_t __t2)
+{
+ return __gthrw_(pthread_equal) (__t1, __t2);
+}
+
+static inline __gthread_t
+__gthread_self (void)
+{
+ return __gthrw_(pthread_self) ();
+}
+
+static inline int
+__gthread_yield (void)
+{
+ return __gthrw_(sched_yield) ();
+}
+
+static inline int
+__gthread_once (__gthread_once_t *__once, void (*__func) (void))
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_once) (__once, __func);
+ else
+ return -1;
+}
+
+static inline int
+__gthread_key_create (__gthread_key_t *__key, void (*__dtor) (void *))
+{
+ return __gthrw_(pthread_key_create) (__key, __dtor);
+}
+
+static inline int
+__gthread_key_delete (__gthread_key_t __key)
+{
+ return __gthrw_(pthread_key_delete) (__key);
+}
+
+static inline void *
+__gthread_getspecific (__gthread_key_t __key)
+{
+ return __gthrw_(pthread_getspecific) (__key);
+}
+
+static inline int
+__gthread_setspecific (__gthread_key_t __key, const void *__ptr)
+{
+ return __gthrw_(pthread_setspecific) (__key, __ptr);
+}
+
+static inline int
+__gthread_mutex_destroy (__gthread_mutex_t *__mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_destroy) (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_mutex_lock (__gthread_mutex_t *__mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_lock) (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_mutex_trylock (__gthread_mutex_t *__mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_trylock) (__mutex);
+ else
+ return 0;
+}
+
+#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS >= 0
+static inline int
+__gthread_mutex_timedlock (__gthread_mutex_t *__mutex,
+ const __gthread_time_t *__abs_timeout)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_timedlock) (__mutex, __abs_timeout);
+ else
+ return 0;
+}
+#endif
+#endif
+
+static inline int
+__gthread_mutex_unlock (__gthread_mutex_t *__mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_unlock) (__mutex);
+ else
+ return 0;
+}
+
+#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+static inline int
+__gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *__mutex)
+{
+ if (__gthread_active_p ())
+ {
+ pthread_mutexattr_t __attr;
+ int __r;
+
+ __r = __gthrw_(pthread_mutexattr_init) (&__attr);
+ if (!__r)
+ __r = __gthrw_(pthread_mutexattr_settype) (&__attr,
+ PTHREAD_MUTEX_RECURSIVE);
+ if (!__r)
+ __r = __gthrw_(pthread_mutex_init) (__mutex, &__attr);
+ if (!__r)
+ __r = __gthrw_(pthread_mutexattr_destroy) (&__attr);
+ return __r;
+ }
+ return 0;
+}
+#endif
+
+static inline int
+__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_mutex_lock (__mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_mutex_trylock (__mutex);
+}
+
+#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS >= 0
+static inline int
+__gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t *__mutex,
+ const __gthread_time_t *__abs_timeout)
+{
+ return __gthread_mutex_timedlock (__mutex, __abs_timeout);
+}
+#endif
+#endif
+
+static inline int
+__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_mutex_unlock (__mutex);
+}
+
+static inline int
+__gthread_cond_broadcast (__gthread_cond_t *__cond)
+{
+ return __gthrw_(pthread_cond_broadcast) (__cond);
+}
+
+static inline int
+__gthread_cond_signal (__gthread_cond_t *__cond)
+{
+ return __gthrw_(pthread_cond_signal) (__cond);
+}
+
+static inline int
+__gthread_cond_wait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex)
+{
+ return __gthrw_(pthread_cond_wait) (__cond, __mutex);
+}
+
+static inline int
+__gthread_cond_timedwait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex,
+ const __gthread_time_t *__abs_timeout)
+{
+ return __gthrw_(pthread_cond_timedwait) (__cond, __mutex, __abs_timeout);
+}
+
+static inline int
+__gthread_cond_wait_recursive (__gthread_cond_t *__cond,
+ __gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_cond_wait (__cond, __mutex);
+}
+
+static inline int
+__gthread_cond_timedwait_recursive (__gthread_cond_t *__cond,
+ __gthread_recursive_mutex_t *__mutex,
+ const __gthread_time_t *__abs_timeout)
+{
+ return __gthread_cond_timedwait (__cond, __mutex, __abs_timeout);
+}
+
+static inline int
+__gthread_cond_destroy (__gthread_cond_t* __cond)
+{
+ return __gthrw_(pthread_cond_destroy) (__cond);
+}
+
+#endif /* _LIBOBJC */
+
+#endif /* ! _GLIBCXX_GCC_GTHR_POSIX_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/gthr-single.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/gthr-single.h
new file mode 100644
index 0000000..f2b132a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/gthr-single.h
@@ -0,0 +1,292 @@
+/* Threads compatibility routines for libgcc2 and libobjc. */
+/* Compile this one with gcc. */
+/* Copyright (C) 1997, 1999, 2000, 2004, 2008, 2009
+ Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef _GLIBCXX_GCC_GTHR_SINGLE_H
+#define _GLIBCXX_GCC_GTHR_SINGLE_H
+
+/* Just provide compatibility for mutex handling. */
+
+typedef int __gthread_key_t;
+typedef int __gthread_once_t;
+typedef int __gthread_mutex_t;
+typedef int __gthread_recursive_mutex_t;
+
+#define __GTHREAD_ONCE_INIT 0
+#define __GTHREAD_MUTEX_INIT 0
+#define __GTHREAD_RECURSIVE_MUTEX_INIT 0
+
+#define _GLIBCXX_UNUSED __attribute__((unused))
+
+#ifdef _LIBOBJC
+
+/* Thread local storage for a single thread */
+static void *thread_local_storage = NULL;
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem. */
+static inline int
+__gthread_objc_init_thread_system (void)
+{
+ /* No thread support available */
+ return -1;
+}
+
+/* Close the threads subsystem. */
+static inline int
+__gthread_objc_close_thread_system (void)
+{
+ /* No thread support available */
+ return -1;
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution. */
+static inline objc_thread_t
+__gthread_objc_thread_detach (void (* func)(void *), void * arg _GLIBCXX_UNUSED)
+{
+ /* No thread support available */
+ return NULL;
+}
+
+/* Set the current thread's priority. */
+static inline int
+__gthread_objc_thread_set_priority (int priority _GLIBCXX_UNUSED)
+{
+ /* No thread support available */
+ return -1;
+}
+
+/* Return the current thread's priority. */
+static inline int
+__gthread_objc_thread_get_priority (void)
+{
+ return OBJC_THREAD_INTERACTIVE_PRIORITY;
+}
+
+/* Yield our process time to another thread. */
+static inline void
+__gthread_objc_thread_yield (void)
+{
+ return;
+}
+
+/* Terminate the current thread. */
+static inline int
+__gthread_objc_thread_exit (void)
+{
+ /* No thread support available */
+ /* Should we really exit the program */
+ /* exit (&__objc_thread_exit_status); */
+ return -1;
+}
+
+/* Returns an integer value which uniquely describes a thread. */
+static inline objc_thread_t
+__gthread_objc_thread_id (void)
+{
+ /* No thread support, use 1. */
+ return (objc_thread_t) 1;
+}
+
+/* Sets the thread's local storage pointer. */
+static inline int
+__gthread_objc_thread_set_data (void *value)
+{
+ thread_local_storage = value;
+ return 0;
+}
+
+/* Returns the thread's local storage pointer. */
+static inline void *
+__gthread_objc_thread_get_data (void)
+{
+ return thread_local_storage;
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex. */
+static inline int
+__gthread_objc_mutex_allocate (objc_mutex_t mutex _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+/* Deallocate a mutex. */
+static inline int
+__gthread_objc_mutex_deallocate (objc_mutex_t mutex _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+/* Grab a lock on a mutex. */
+static inline int
+__gthread_objc_mutex_lock (objc_mutex_t mutex _GLIBCXX_UNUSED)
+{
+ /* There can only be one thread, so we always get the lock */
+ return 0;
+}
+
+/* Try to grab a lock on a mutex. */
+static inline int
+__gthread_objc_mutex_trylock (objc_mutex_t mutex _GLIBCXX_UNUSED)
+{
+ /* There can only be one thread, so we always get the lock */
+ return 0;
+}
+
+/* Unlock the mutex */
+static inline int
+__gthread_objc_mutex_unlock (objc_mutex_t mutex _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition. */
+static inline int
+__gthread_objc_condition_allocate (objc_condition_t condition _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+/* Deallocate a condition. */
+static inline int
+__gthread_objc_condition_deallocate (objc_condition_t condition _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+/* Wait on the condition */
+static inline int
+__gthread_objc_condition_wait (objc_condition_t condition _GLIBCXX_UNUSED,
+ objc_mutex_t mutex _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+/* Wake up all threads waiting on this condition. */
+static inline int
+__gthread_objc_condition_broadcast (objc_condition_t condition _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+/* Wake up one thread waiting on this condition. */
+static inline int
+__gthread_objc_condition_signal (objc_condition_t condition _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+#else /* _LIBOBJC */
+
+static inline int
+__gthread_active_p (void)
+{
+ return 0;
+}
+
+static inline int
+__gthread_once (__gthread_once_t *__once _GLIBCXX_UNUSED, void (*__func) (void) _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+static inline int _GLIBCXX_UNUSED
+__gthread_key_create (__gthread_key_t *__key _GLIBCXX_UNUSED, void (*__func) (void *) _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+static int _GLIBCXX_UNUSED
+__gthread_key_delete (__gthread_key_t __key _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+static inline void *
+__gthread_getspecific (__gthread_key_t __key _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+static inline int
+__gthread_setspecific (__gthread_key_t __key _GLIBCXX_UNUSED, const void *__v _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+static inline int
+__gthread_mutex_destroy (__gthread_mutex_t *__mutex _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+static inline int
+__gthread_mutex_lock (__gthread_mutex_t *__mutex _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+static inline int
+__gthread_mutex_trylock (__gthread_mutex_t *__mutex _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+static inline int
+__gthread_mutex_unlock (__gthread_mutex_t *__mutex _GLIBCXX_UNUSED)
+{
+ return 0;
+}
+
+static inline int
+__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_mutex_lock (__mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_mutex_trylock (__mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
+{
+ return __gthread_mutex_unlock (__mutex);
+}
+
+#endif /* _LIBOBJC */
+
+#undef _GLIBCXX_UNUSED
+
+#endif /* ! _GLIBCXX_GCC_GTHR_SINGLE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/gthr-tpf.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/gthr-tpf.h
new file mode 100644
index 0000000..eb619e0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/gthr-tpf.h
@@ -0,0 +1,229 @@
+/* Threads compatibility routines for libgcc2 and libobjc.
+ Compile this one with gcc.
+ Copyright (C) 2004, 2005, 2008, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+/* TPF needs its own version of gthr-*.h because TPF always links to
+ the thread library. However, for performance reasons we still do not
+ want to issue thread api calls unless a check is made to see that we
+ are running as a thread. */
+
+#ifndef _GLIBCXX_GCC_GTHR_TPF_H
+#define _GLIBCXX_GCC_GTHR_TPF_H
+
+/* POSIX threads specific definitions.
+ Easy, since the interface is just one-to-one mapping. */
+
+#define __GTHREADS 1
+
+/* Some implementations of <pthread.h> require this to be defined. */
+#ifndef _REENTRANT
+#define _REENTRANT 1
+#endif
+
+#include <pthread.h>
+#include <unistd.h>
+
+typedef pthread_key_t __gthread_key_t;
+typedef pthread_once_t __gthread_once_t;
+typedef pthread_mutex_t __gthread_mutex_t;
+typedef pthread_mutex_t __gthread_recursive_mutex_t;
+
+#if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
+#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+#elif defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
+#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+#endif
+
+#define __GTHREAD_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER
+#define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
+#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_function
+
+#define NOTATHREAD 00
+#define ECBBASEPTR (unsigned long int) *(unsigned int *)0x00000514u
+#define ECBPG2PTR ECBBASEPTR + 0x1000
+#define CE2THRCPTR *((unsigned char *)(ECBPG2PTR + 16))
+#define __tpf_pthread_active() (CE2THRCPTR != NOTATHREAD)
+
+#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK
+# define __gthrw(name) \
+ static __typeof(name) __gthrw_ ## name __attribute__ ((__weakref__(#name)));
+# define __gthrw_(name) __gthrw_ ## name
+#else
+# define __gthrw(name)
+# define __gthrw_(name) name
+#endif
+
+__gthrw(pthread_once)
+__gthrw(pthread_key_create)
+__gthrw(pthread_key_delete)
+__gthrw(pthread_getspecific)
+__gthrw(pthread_setspecific)
+__gthrw(pthread_create)
+
+__gthrw(pthread_mutex_lock)
+__gthrw(pthread_mutex_trylock)
+__gthrw(pthread_mutex_unlock)
+__gthrw(pthread_mutexattr_init)
+__gthrw(pthread_mutexattr_settype)
+__gthrw(pthread_mutexattr_destroy)
+__gthrw(pthread_mutex_init)
+__gthrw(pthread_mutex_destroy)
+
+static inline int
+__gthread_active_p (void)
+{
+ return 1;
+}
+
+static inline int
+__gthread_once (__gthread_once_t *__once, void (*__func) (void))
+{
+ if (__tpf_pthread_active ())
+ return __gthrw_(pthread_once) (__once, __func);
+ else
+ return -1;
+}
+
+static inline int
+__gthread_key_create (__gthread_key_t *__key, void (*__dtor) (void *))
+{
+ if (__tpf_pthread_active ())
+ return __gthrw_(pthread_key_create) (__key, __dtor);
+ else
+ return -1;
+}
+
+static inline int
+__gthread_key_delete (__gthread_key_t __key)
+{
+ if (__tpf_pthread_active ())
+ return __gthrw_(pthread_key_delete) (__key);
+ else
+ return -1;
+}
+
+static inline void *
+__gthread_getspecific (__gthread_key_t __key)
+{
+ if (__tpf_pthread_active ())
+ return __gthrw_(pthread_getspecific) (__key);
+ else
+ return NULL;
+}
+
+static inline int
+__gthread_setspecific (__gthread_key_t __key, const void *__ptr)
+{
+ if (__tpf_pthread_active ())
+ return __gthrw_(pthread_setspecific) (__key, __ptr);
+ else
+ return -1;
+}
+
+static inline int
+__gthread_mutex_destroy (__gthread_mutex_t *__mutex)
+{
+ if (__tpf_pthread_active ())
+ return __gthrw_(pthread_mutex_destroy) (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_mutex_lock (__gthread_mutex_t *__mutex)
+{
+ if (__tpf_pthread_active ())
+ return __gthrw_(pthread_mutex_lock) (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_mutex_trylock (__gthread_mutex_t *__mutex)
+{
+ if (__tpf_pthread_active ())
+ return __gthrw_(pthread_mutex_trylock) (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_mutex_unlock (__gthread_mutex_t *__mutex)
+{
+ if (__tpf_pthread_active ())
+ return __gthrw_(pthread_mutex_unlock) (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
+{
+ if (__tpf_pthread_active ())
+ return __gthread_mutex_lock (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
+{
+ if (__tpf_pthread_active ())
+ return __gthread_mutex_trylock (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
+{
+ if (__tpf_pthread_active ())
+ return __gthread_mutex_unlock (__mutex);
+ else
+ return 0;
+}
+
+static inline int
+__gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *__mutex)
+{
+ if (__tpf_pthread_active ())
+ {
+ pthread_mutexattr_t __attr;
+ int __r;
+
+ __r = __gthrw_(pthread_mutexattr_init) (&__attr);
+ if (!__r)
+ __r = __gthrw_(pthread_mutexattr_settype) (&__attr,
+ PTHREAD_MUTEX_RECURSIVE);
+ if (!__r)
+ __r = __gthrw_(pthread_mutex_init) (__mutex, &__attr);
+ if (!__r)
+ __r = __gthrw_(pthread_mutexattr_destroy) (&__attr);
+ return __r;
+ }
+ return 0;
+}
+
+
+#endif /* ! _GLIBCXX_GCC_GTHR_TPF_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/gthr.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/gthr.h
new file mode 100644
index 0000000..35d9b7e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/gthr.h
@@ -0,0 +1,173 @@
+/* Threads compatibility routines for libgcc2. */
+/* Compile this one with gcc. */
+/* Copyright (C) 1997, 1998, 2004, 2008, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef _GLIBCXX_GCC_GTHR_H
+#define _GLIBCXX_GCC_GTHR_H
+
+#ifndef _GLIBCXX_HIDE_EXPORTS
+#pragma GCC visibility push(default)
+#endif
+
+/* If this file is compiled with threads support, it must
+ #define __GTHREADS 1
+ to indicate that threads support is present. Also it has define
+ function
+ int __gthread_active_p ()
+ that returns 1 if thread system is active, 0 if not.
+
+ The threads interface must define the following types:
+ __gthread_key_t
+ __gthread_once_t
+ __gthread_mutex_t
+ __gthread_recursive_mutex_t
+
+ The threads interface must define the following macros:
+
+ __GTHREAD_ONCE_INIT
+ to initialize __gthread_once_t
+ __GTHREAD_MUTEX_INIT
+ to initialize __gthread_mutex_t to get a fast
+ non-recursive mutex.
+ __GTHREAD_MUTEX_INIT_FUNCTION
+ some systems can't initialize a mutex without a
+ function call. On such systems, define this to a
+ function which looks like this:
+ void __GTHREAD_MUTEX_INIT_FUNCTION (__gthread_mutex_t *)
+ Don't define __GTHREAD_MUTEX_INIT in this case
+ __GTHREAD_RECURSIVE_MUTEX_INIT
+ __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION
+ as above, but for a recursive mutex.
+
+ The threads interface must define the following static functions:
+
+ int __gthread_once (__gthread_once_t *once, void (*func) ())
+
+ int __gthread_key_create (__gthread_key_t *keyp, void (*dtor) (void *))
+ int __gthread_key_delete (__gthread_key_t key)
+
+ void *__gthread_getspecific (__gthread_key_t key)
+ int __gthread_setspecific (__gthread_key_t key, const void *ptr)
+
+ int __gthread_mutex_destroy (__gthread_mutex_t *mutex);
+
+ int __gthread_mutex_lock (__gthread_mutex_t *mutex);
+ int __gthread_mutex_trylock (__gthread_mutex_t *mutex);
+ int __gthread_mutex_unlock (__gthread_mutex_t *mutex);
+
+ int __gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *mutex);
+ int __gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *mutex);
+ int __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex);
+
+ The following are supported in POSIX threads only. They are required to
+ fix a deadlock in static initialization inside libsupc++. The header file
+ gthr-posix.h defines a symbol __GTHREAD_HAS_COND to signify that these extra
+ features are supported.
+
+ Types:
+ __gthread_cond_t
+
+ Macros:
+ __GTHREAD_COND_INIT
+ __GTHREAD_COND_INIT_FUNCTION
+
+ Interface:
+ int __gthread_cond_broadcast (__gthread_cond_t *cond);
+ int __gthread_cond_wait (__gthread_cond_t *cond, __gthread_mutex_t *mutex);
+ int __gthread_cond_wait_recursive (__gthread_cond_t *cond,
+ __gthread_recursive_mutex_t *mutex);
+
+ All functions returning int should return zero on success or the error
+ number. If the operation is not supported, -1 is returned.
+
+ If the following are also defined, you should
+ #define __GTHREADS_CXX0X 1
+ to enable the c++0x thread library.
+
+ Types:
+ __gthread_t
+ __gthread_time_t
+
+ Interface:
+ int __gthread_create (__gthread_t *thread, void *(*func) (void*),
+ void *args);
+ int __gthread_join (__gthread_t thread, void **value_ptr);
+ int __gthread_detach (__gthread_t thread);
+ int __gthread_equal (__gthread_t t1, __gthread_t t2);
+ __gthread_t __gthread_self (void);
+ int __gthread_yield (void);
+
+ int __gthread_mutex_timedlock (__gthread_mutex_t *m,
+ const __gthread_time_t *abs_timeout);
+ int __gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t *m,
+ const __gthread_time_t *abs_time);
+
+ int __gthread_cond_signal (__gthread_cond_t *cond);
+ int __gthread_cond_timedwait (__gthread_cond_t *cond,
+ __gthread_mutex_t *mutex,
+ const __gthread_time_t *abs_timeout);
+ int __gthread_cond_timedwait_recursive (__gthread_cond_t *cond,
+ __gthread_recursive_mutex_t *mutex,
+ const __gthread_time_t *abs_time)
+
+ Currently supported threads packages are
+ TPF threads with -D__tpf__
+ POSIX/Unix98 threads with -D_PTHREADS
+ POSIX/Unix95 threads with -D_PTHREADS95
+ DCE threads with -D_DCE_THREADS
+ Solaris/UI threads with -D_SOLARIS_THREADS
+
+*/
+
+/* Check first for thread specific defines. */
+#if defined (_GLIBCXX___tpf_GLIBCXX___)
+#include <bits/gthr-tpf.h>
+#elif _GLIBCXX__PTHREADS
+#include <bits/gthr-posix.h>
+#elif _GLIBCXX__PTHREADS95
+#include <bits/gthr-posix95.h>
+#elif _GLIBCXX__DCE_THREADS
+#include <bits/gthr-dce.h>
+#elif _GLIBCXX__SOLARIS_THREADS
+#include <bits/gthr-solaris.h>
+
+/* Include GTHREAD_FILE if one is defined. */
+#elif defined(_GLIBCXX_HAVE_GTHR_DEFAULT)
+#if __GXX_WEAK__
+#ifndef _GLIBCXX_GTHREAD_USE_WEAK
+#define _GLIBCXX_GTHREAD_USE_WEAK 1
+#endif
+#endif
+#include <bits/gthr-default.h>
+
+/* Fallback to single thread definitions. */
+#else
+#include <bits/gthr-single.h>
+#endif
+
+#ifndef _GLIBCXX_HIDE_EXPORTS
+#pragma GCC visibility pop
+#endif
+
+#endif /* ! _GLIBCXX_GCC_GTHR_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/messages_members.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/messages_members.h
new file mode 100644
index 0000000..a149950
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/messages_members.h
@@ -0,0 +1,90 @@
+// std::messages implementation details, generic version -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file messages_members.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
+//
+
+// Written by Benjamin Kosnik <bkoz@redhat.com>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // Non-virtual member functions.
+ template<typename _CharT>
+ messages<_CharT>::messages(size_t __refs)
+ : facet(__refs)
+ { _M_c_locale_messages = _S_get_c_locale(); }
+
+ template<typename _CharT>
+ messages<_CharT>::messages(__c_locale, const char*, size_t __refs)
+ : facet(__refs)
+ { _M_c_locale_messages = _S_get_c_locale(); }
+
+ template<typename _CharT>
+ typename messages<_CharT>::catalog
+ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
+ const char*) const
+ { return this->do_open(__s, __loc); }
+
+ // Virtual member functions.
+ template<typename _CharT>
+ messages<_CharT>::~messages()
+ { _S_destroy_c_locale(_M_c_locale_messages); }
+
+ template<typename _CharT>
+ typename messages<_CharT>::catalog
+ messages<_CharT>::do_open(const basic_string<char>&, const locale&) const
+ { return 0; }
+
+ template<typename _CharT>
+ typename messages<_CharT>::string_type
+ messages<_CharT>::do_get(catalog, int, int,
+ const string_type& __dfault) const
+ { return __dfault; }
+
+ template<typename _CharT>
+ void
+ messages<_CharT>::do_close(catalog) const
+ { }
+
+ // messages_byname
+ template<typename _CharT>
+ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
+ : messages<_CharT>(__refs)
+ {
+ if (__builtin_strcmp(__s, "C") != 0
+ && __builtin_strcmp(__s, "POSIX") != 0)
+ {
+ this->_S_destroy_c_locale(this->_M_c_locale_messages);
+ this->_S_create_c_locale(this->_M_c_locale_messages, __s);
+ }
+ }
+
+_GLIBCXX_END_NAMESPACE
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/os_defines.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/os_defines.h
new file mode 100644
index 0000000..f9d11d1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/os_defines.h
@@ -0,0 +1,44 @@
+// Specific definitions for GNU/Linux with uClibc -*- C++ -*-
+
+// Copyright (C) 2000, 2001, 2002, 2003, 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file os_defines.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_OS_DEFINES
+#define _GLIBCXX_OS_DEFINES 1
+
+// System-specific #define, typedefs, corrections, etc, go here. This
+// file will come before all others.
+
+// This keeps isanum, et al from being propagated as macros.
+#define __NO_CTYPE 1
+
+#include <features.h>
+
+// We must not see the optimized string functions GNU libc defines.
+#define __NO_STRING_INLINES
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/stdc++.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/stdc++.h
new file mode 100644
index 0000000..5782fa3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/stdc++.h
@@ -0,0 +1,111 @@
+// C++ includes used for precompiling -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file stdc++.h
+ * This is an implementation file for a precompiled header.
+ */
+
+// 17.4.1.2 Headers
+
+// C
+#include <cassert>
+#include <cctype>
+#include <cerrno>
+#include <cfloat>
+#include <ciso646>
+#include <climits>
+#include <clocale>
+#include <cmath>
+#include <csetjmp>
+#include <csignal>
+#include <cstdarg>
+#include <cstddef>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#include <ccomplex>
+#include <cfenv>
+#include <cinttypes>
+#include <cstdatomic>
+#include <cstdbool>
+#include <cstdint>
+#include <ctgmath>
+#include <cwchar>
+#include <cwctype>
+#endif
+
+// C++
+#include <algorithm>
+#include <bitset>
+#include <complex>
+#include <deque>
+#include <exception>
+#include <fstream>
+#include <functional>
+#include <iomanip>
+#include <ios>
+#include <iosfwd>
+#include <iostream>
+#include <istream>
+#include <iterator>
+#include <limits>
+#include <list>
+#include <locale>
+#include <map>
+#include <memory>
+#include <new>
+#include <numeric>
+#include <ostream>
+#include <queue>
+#include <set>
+#include <sstream>
+#include <stack>
+#include <stdexcept>
+#include <streambuf>
+#include <string>
+#include <typeinfo>
+#include <utility>
+#include <valarray>
+#include <vector>
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#include <array>
+#include <chrono>
+#include <condition_variable>
+#include <forward_list>
+#include <mutex>
+#include <random>
+#include <ratio>
+#include <regex>
+#include <system_error>
+#include <thread>
+#include <tuple>
+#include <type_traits>
+#include <unordered_map>
+#include <unordered_set>
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/stdtr1c++.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/stdtr1c++.h
new file mode 100644
index 0000000..8ed9cb6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/stdtr1c++.h
@@ -0,0 +1,53 @@
+// C++ includes used for precompiling TR1 -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file stdtr1c++.h
+ * This is an implementation file for a precompiled header.
+ */
+
+#include <bits/stdc++.h>
+
+#include <tr1/array>
+#include <tr1/cctype>
+#include <tr1/cfenv>
+#include <tr1/cfloat>
+#include <tr1/cinttypes>
+#include <tr1/climits>
+#include <tr1/cmath>
+#include <tr1/complex>
+#include <tr1/cstdarg>
+#include <tr1/cstdbool>
+#include <tr1/cstdint>
+#include <tr1/cstdio>
+#include <tr1/cstdlib>
+#include <tr1/ctgmath>
+#include <tr1/ctime>
+#include <tr1/cwchar>
+#include <tr1/cwctype>
+#include <tr1/functional>
+#include <tr1/random>
+#include <tr1/tuple>
+#include <tr1/unordered_map>
+#include <tr1/unordered_set>
+#include <tr1/utility>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/time_members.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/time_members.h
new file mode 100644
index 0000000..d06faf4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mips-linux-uclibc/bits/time_members.h
@@ -0,0 +1,90 @@
+// std::time_get, std::time_put implementation, generic version -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file time_members.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
+//
+
+// Written by Benjamin Kosnik <bkoz@redhat.com>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT>
+ __timepunct<_CharT>::__timepunct(size_t __refs)
+ : facet(__refs), _M_data(NULL)
+ {
+ _M_name_timepunct = _S_get_c_name();
+ _M_initialize_timepunct();
+ }
+
+ template<typename _CharT>
+ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
+ : facet(__refs), _M_data(__cache)
+ {
+ _M_name_timepunct = _S_get_c_name();
+ _M_initialize_timepunct();
+ }
+
+ template<typename _CharT>
+ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
+ size_t __refs)
+ : facet(__refs), _M_data(NULL)
+ {
+ if (__builtin_strcmp(__s, _S_get_c_name()) != 0)
+ {
+ const size_t __len = __builtin_strlen(__s) + 1;
+ char* __tmp = new char[__len];
+ __builtin_memcpy(__tmp, __s, __len);
+ _M_name_timepunct = __tmp;
+ }
+ else
+ _M_name_timepunct = _S_get_c_name();
+
+ __try
+ { _M_initialize_timepunct(__cloc); }
+ __catch(...)
+ {
+ if (_M_name_timepunct != _S_get_c_name())
+ delete [] _M_name_timepunct;
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _CharT>
+ __timepunct<_CharT>::~__timepunct()
+ {
+ if (_M_name_timepunct != _S_get_c_name())
+ delete [] _M_name_timepunct;
+ delete _M_data;
+ _S_destroy_c_locale(_M_c_locale_timepunct);
+ }
+
+_GLIBCXX_END_NAMESPACE
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mutex b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mutex
new file mode 100644
index 0000000..62b314b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/mutex
@@ -0,0 +1,774 @@
+// <mutex> -*- C++ -*-
+
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file mutex
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_MUTEX
+#define _GLIBCXX_MUTEX 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#include <tuple>
+#include <cstddef>
+#include <chrono>
+#include <exception>
+#include <type_traits>
+#include <functional>
+#include <system_error>
+#include <bits/functexcept.h>
+#include <bits/gthr.h>
+#include <bits/move.h> // for std::swap
+
+#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
+
+namespace std
+{
+ /**
+ * @defgroup mutexes Mutexes
+ * @ingroup concurrency
+ *
+ * Classes for mutex support.
+ * @{
+ */
+
+ /// mutex
+ class mutex
+ {
+ typedef __gthread_mutex_t __native_type;
+ __native_type _M_mutex;
+
+ public:
+ typedef __native_type* native_handle_type;
+
+ mutex()
+ {
+ // XXX EAGAIN, ENOMEM, EPERM, EBUSY(may), EINVAL(may)
+#ifdef __GTHREAD_MUTEX_INIT
+ __native_type __tmp = __GTHREAD_MUTEX_INIT;
+ _M_mutex = __tmp;
+#else
+ __GTHREAD_MUTEX_INIT_FUNCTION(&_M_mutex);
+#endif
+ }
+
+ mutex(const mutex&) = delete;
+ mutex& operator=(const mutex&) = delete;
+
+ void
+ lock()
+ {
+ int __e = __gthread_mutex_lock(&_M_mutex);
+
+ // EINVAL, EAGAIN, EBUSY, EINVAL, EDEADLK(may)
+ if (__e)
+ __throw_system_error(__e);
+ }
+
+ bool
+ try_lock()
+ {
+ // XXX EINVAL, EAGAIN, EBUSY
+ return !__gthread_mutex_trylock(&_M_mutex);
+ }
+
+ void
+ unlock()
+ {
+ // XXX EINVAL, EAGAIN, EPERM
+ __gthread_mutex_unlock(&_M_mutex);
+ }
+
+ native_handle_type
+ native_handle()
+ { return &_M_mutex; }
+ };
+
+ /// recursive_mutex
+ class recursive_mutex
+ {
+ typedef __gthread_recursive_mutex_t __native_type;
+ __native_type _M_mutex;
+
+ public:
+ typedef __native_type* native_handle_type;
+
+ recursive_mutex()
+ {
+ // XXX EAGAIN, ENOMEM, EPERM, EBUSY(may), EINVAL(may)
+#ifdef __GTHREAD_RECURSIVE_MUTEX_INIT
+ __native_type __tmp = __GTHREAD_RECURSIVE_MUTEX_INIT;
+ _M_mutex = __tmp;
+#else
+ __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION(&_M_mutex);
+#endif
+ }
+
+ recursive_mutex(const recursive_mutex&) = delete;
+ recursive_mutex& operator=(const recursive_mutex&) = delete;
+
+ void
+ lock()
+ {
+ int __e = __gthread_recursive_mutex_lock(&_M_mutex);
+
+ // EINVAL, EAGAIN, EBUSY, EINVAL, EDEADLK(may)
+ if (__e)
+ __throw_system_error(__e);
+ }
+
+ bool
+ try_lock()
+ {
+ // XXX EINVAL, EAGAIN, EBUSY
+ return !__gthread_recursive_mutex_trylock(&_M_mutex);
+ }
+
+ void
+ unlock()
+ {
+ // XXX EINVAL, EAGAIN, EBUSY
+ __gthread_recursive_mutex_unlock(&_M_mutex);
+ }
+
+ native_handle_type
+ native_handle()
+ { return &_M_mutex; }
+ };
+
+ /// timed_mutex
+ class timed_mutex
+ {
+ typedef __gthread_mutex_t __native_type;
+
+#ifdef _GLIBCXX_USE_CLOCK_MONOTONIC
+ typedef chrono::monotonic_clock __clock_t;
+#else
+ typedef chrono::high_resolution_clock __clock_t;
+#endif
+
+ __native_type _M_mutex;
+
+ public:
+ typedef __native_type* native_handle_type;
+
+ timed_mutex()
+ {
+#ifdef __GTHREAD_MUTEX_INIT
+ __native_type __tmp = __GTHREAD_MUTEX_INIT;
+ _M_mutex = __tmp;
+#else
+ __GTHREAD_MUTEX_INIT_FUNCTION(&_M_mutex);
+#endif
+ }
+
+ timed_mutex(const timed_mutex&) = delete;
+ timed_mutex& operator=(const timed_mutex&) = delete;
+
+ void
+ lock()
+ {
+ int __e = __gthread_mutex_lock(&_M_mutex);
+
+ // EINVAL, EAGAIN, EBUSY, EINVAL, EDEADLK(may)
+ if (__e)
+ __throw_system_error(__e);
+ }
+
+ bool
+ try_lock()
+ {
+ // XXX EINVAL, EAGAIN, EBUSY
+ return !__gthread_mutex_trylock(&_M_mutex);
+ }
+
+ template <class _Rep, class _Period>
+ bool
+ try_lock_for(const chrono::duration<_Rep, _Period>& __rtime)
+ { return __try_lock_for_impl(__rtime); }
+
+ template <class _Clock, class _Duration>
+ bool
+ try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime)
+ {
+ chrono::time_point<_Clock, chrono::seconds> __s =
+ chrono::time_point_cast<chrono::seconds>(__atime);
+
+ chrono::nanoseconds __ns =
+ chrono::duration_cast<chrono::nanoseconds>(__atime - __s);
+
+ __gthread_time_t __ts = {
+ static_cast<std::time_t>(__s.time_since_epoch().count()),
+ static_cast<long>(__ns.count())
+ };
+
+ return !__gthread_mutex_timedlock(&_M_mutex, &__ts);
+ }
+
+ void
+ unlock()
+ {
+ // XXX EINVAL, EAGAIN, EBUSY
+ __gthread_mutex_unlock(&_M_mutex);
+ }
+
+ native_handle_type
+ native_handle()
+ { return &_M_mutex; }
+
+ private:
+ template<typename _Rep, typename _Period>
+ typename enable_if<
+ ratio_less_equal<__clock_t::period, _Period>::value, bool>::type
+ __try_lock_for_impl(const chrono::duration<_Rep, _Period>& __rtime)
+ {
+ __clock_t::time_point __atime = __clock_t::now()
+ + chrono::duration_cast<__clock_t::duration>(__rtime);
+
+ return try_lock_until(__atime);
+ }
+
+ template <typename _Rep, typename _Period>
+ typename enable_if<
+ !ratio_less_equal<__clock_t::period, _Period>::value, bool>::type
+ __try_lock_for_impl(const chrono::duration<_Rep, _Period>& __rtime)
+ {
+ __clock_t::time_point __atime = __clock_t::now()
+ + ++chrono::duration_cast<__clock_t::duration>(__rtime);
+
+ return try_lock_until(__atime);
+ }
+ };
+
+ /// recursive_timed_mutex
+ class recursive_timed_mutex
+ {
+ typedef __gthread_recursive_mutex_t __native_type;
+
+#ifdef _GLIBCXX_USE_CLOCK_MONOTONIC
+ typedef chrono::monotonic_clock __clock_t;
+#else
+ typedef chrono::high_resolution_clock __clock_t;
+#endif
+
+ __native_type _M_mutex;
+
+ public:
+ typedef __native_type* native_handle_type;
+
+ recursive_timed_mutex()
+ {
+ // XXX EAGAIN, ENOMEM, EPERM, EBUSY(may), EINVAL(may)
+#ifdef __GTHREAD_RECURSIVE_MUTEX_INIT
+ __native_type __tmp = __GTHREAD_RECURSIVE_MUTEX_INIT;
+ _M_mutex = __tmp;
+#else
+ __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION(&_M_mutex);
+#endif
+ }
+
+ recursive_timed_mutex(const recursive_timed_mutex&) = delete;
+ recursive_timed_mutex& operator=(const recursive_timed_mutex&) = delete;
+
+ void
+ lock()
+ {
+ int __e = __gthread_recursive_mutex_lock(&_M_mutex);
+
+ // EINVAL, EAGAIN, EBUSY, EINVAL, EDEADLK(may)
+ if (__e)
+ __throw_system_error(__e);
+ }
+
+ bool
+ try_lock()
+ {
+ // XXX EINVAL, EAGAIN, EBUSY
+ return !__gthread_recursive_mutex_trylock(&_M_mutex);
+ }
+
+ template <class _Rep, class _Period>
+ bool
+ try_lock_for(const chrono::duration<_Rep, _Period>& __rtime)
+ { return __try_lock_for_impl(__rtime); }
+
+ template <class _Clock, class _Duration>
+ bool
+ try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime)
+ {
+ chrono::time_point<_Clock, chrono::seconds> __s =
+ chrono::time_point_cast<chrono::seconds>(__atime);
+
+ chrono::nanoseconds __ns =
+ chrono::duration_cast<chrono::nanoseconds>(__atime - __s);
+
+ __gthread_time_t __ts = {
+ static_cast<std::time_t>(__s.time_since_epoch().count()),
+ static_cast<long>(__ns.count())
+ };
+
+ return !__gthread_recursive_mutex_timedlock(&_M_mutex, &__ts);
+ }
+
+ void
+ unlock()
+ {
+ // XXX EINVAL, EAGAIN, EBUSY
+ __gthread_recursive_mutex_unlock(&_M_mutex);
+ }
+
+ native_handle_type
+ native_handle()
+ { return &_M_mutex; }
+
+ private:
+ template<typename _Rep, typename _Period>
+ typename enable_if<
+ ratio_less_equal<__clock_t::period, _Period>::value, bool>::type
+ __try_lock_for_impl(const chrono::duration<_Rep, _Period>& __rtime)
+ {
+ __clock_t::time_point __atime = __clock_t::now()
+ + chrono::duration_cast<__clock_t::duration>(__rtime);
+
+ return try_lock_until(__atime);
+ }
+
+ template <typename _Rep, typename _Period>
+ typename enable_if<
+ !ratio_less_equal<__clock_t::period, _Period>::value, bool>::type
+ __try_lock_for_impl(const chrono::duration<_Rep, _Period>& __rtime)
+ {
+ __clock_t::time_point __atime = __clock_t::now()
+ + ++chrono::duration_cast<__clock_t::duration>(__rtime);
+
+ return try_lock_until(__atime);
+ }
+ };
+
+ /// Do not acquire ownership of the mutex.
+ struct defer_lock_t { };
+
+ /// Try to acquire ownership of the mutex without blocking.
+ struct try_to_lock_t { };
+
+ /// Assume the calling thread has already obtained mutex ownership
+ /// and manage it.
+ struct adopt_lock_t { };
+
+ extern const defer_lock_t defer_lock;
+ extern const try_to_lock_t try_to_lock;
+ extern const adopt_lock_t adopt_lock;
+
+ /**
+ * @brief Thrown to indicate errors with lock operations.
+ *
+ * @ingroup exceptions
+ */
+ class lock_error : public exception
+ {
+ public:
+ virtual const char*
+ what() const throw();
+ };
+
+ /// @brief Scoped lock idiom.
+ // Acquire the mutex here with a constructor call, then release with
+ // the destructor call in accordance with RAII style.
+ template<typename _Mutex>
+ class lock_guard
+ {
+ public:
+ typedef _Mutex mutex_type;
+
+ explicit lock_guard(mutex_type& __m) : _M_device(__m)
+ { _M_device.lock(); }
+
+ lock_guard(mutex_type& __m, adopt_lock_t __a) : _M_device(__m)
+ { _M_device.lock(); }
+
+ ~lock_guard()
+ { _M_device.unlock(); }
+
+ lock_guard(const lock_guard&) = delete;
+ lock_guard& operator=(const lock_guard&) = delete;
+
+ private:
+ mutex_type& _M_device;
+ };
+
+ /// unique_lock
+ template<typename _Mutex>
+ class unique_lock
+ {
+ public:
+ typedef _Mutex mutex_type;
+
+ unique_lock()
+ : _M_device(0), _M_owns(false)
+ { }
+
+ explicit unique_lock(mutex_type& __m)
+ : _M_device(&__m), _M_owns(false)
+ {
+ lock();
+ _M_owns = true;
+ }
+
+ unique_lock(mutex_type& __m, defer_lock_t)
+ : _M_device(&__m), _M_owns(false)
+ { }
+
+ unique_lock(mutex_type& __m, try_to_lock_t)
+ : _M_device(&__m), _M_owns(_M_device->try_lock())
+ { }
+
+ unique_lock(mutex_type& __m, adopt_lock_t)
+ : _M_device(&__m), _M_owns(true)
+ {
+ // XXX calling thread owns mutex
+ }
+
+ template<typename _Clock, typename _Duration>
+ unique_lock(mutex_type& __m,
+ const chrono::time_point<_Clock, _Duration>& __atime)
+ : _M_device(&__m), _M_owns(_M_device->try_lock_until(__atime))
+ { }
+
+ template<typename _Rep, typename _Period>
+ unique_lock(mutex_type& __m,
+ const chrono::duration<_Rep, _Period>& __rtime)
+ : _M_device(&__m), _M_owns(_M_device->try_lock_for(__rtime))
+ { }
+
+ ~unique_lock()
+ {
+ if (_M_owns)
+ unlock();
+ }
+
+ unique_lock(const unique_lock&) = delete;
+ unique_lock& operator=(const unique_lock&) = delete;
+
+ unique_lock(unique_lock&& __u)
+ : _M_device(__u._M_device), _M_owns(__u._M_owns)
+ {
+ __u._M_device = 0;
+ __u._M_owns = false;
+ }
+
+ unique_lock& operator=(unique_lock&& __u)
+ {
+ if(_M_owns)
+ unlock();
+
+ unique_lock(std::move(__u)).swap(*this);
+
+ __u._M_device = 0;
+ __u._M_owns = false;
+
+ return *this;
+ }
+
+ void
+ lock()
+ {
+ if (!_M_device)
+ __throw_system_error(int(errc::operation_not_permitted));
+ else if (_M_owns)
+ __throw_system_error(int(errc::resource_deadlock_would_occur));
+ else
+ {
+ _M_device->lock();
+ _M_owns = true;
+ }
+ }
+
+ bool
+ try_lock()
+ {
+ if (!_M_device)
+ __throw_system_error(int(errc::operation_not_permitted));
+ else if (_M_owns)
+ __throw_system_error(int(errc::resource_deadlock_would_occur));
+ else
+ {
+ _M_owns = _M_device->try_lock();
+ return _M_owns;
+ }
+ }
+
+ template<typename _Clock, typename _Duration>
+ bool
+ try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime)
+ {
+ if (!_M_device)
+ __throw_system_error(int(errc::operation_not_permitted));
+ else if (_M_owns)
+ __throw_system_error(int(errc::resource_deadlock_would_occur));
+ else
+ {
+ _M_owns = _M_device->try_lock_until(__atime);
+ return _M_owns;
+ }
+ }
+
+ template<typename _Rep, typename _Period>
+ bool
+ try_lock_for(const chrono::duration<_Rep, _Period>& __rtime)
+ {
+ if (!_M_device)
+ __throw_system_error(int(errc::operation_not_permitted));
+ else if (_M_owns)
+ __throw_system_error(int(errc::resource_deadlock_would_occur));
+ else
+ {
+ _M_owns = _M_device->try_lock_for(__rtime);
+ return _M_owns;
+ }
+ }
+
+ void
+ unlock()
+ {
+ if (!_M_owns)
+ __throw_system_error(int(errc::operation_not_permitted));
+ else if (_M_device)
+ {
+ _M_device->unlock();
+ _M_owns = false;
+ }
+ }
+
+ void
+ swap(unique_lock&& __u)
+ {
+ std::swap(_M_device, __u._M_device);
+ std::swap(_M_owns, __u._M_owns);
+ }
+
+ mutex_type*
+ release()
+ {
+ mutex_type* __ret = _M_device;
+ _M_device = 0;
+ _M_owns = false;
+ return __ret;
+ }
+
+ bool
+ owns_lock() const
+ { return _M_owns; }
+
+ /* explicit */ operator bool () const
+ { return owns_lock(); }
+
+ mutex_type*
+ mutex() const
+ { return _M_device; }
+
+ private:
+ mutex_type* _M_device;
+ bool _M_owns; // XXX use atomic_bool
+ };
+
+ template<typename _Mutex>
+ inline void
+ swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Mutex>
+ inline void
+ swap(unique_lock<_Mutex>&& __x, unique_lock<_Mutex>& __y)
+ { __x.swap(__y); }
+
+ template<typename _Mutex>
+ inline void
+ swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>&& __y)
+ { __x.swap(__y); }
+
+ template<int _Idx>
+ struct __unlock_impl
+ {
+ template<typename... _Lock>
+ static void
+ __do_unlock(tuple<_Lock&...>& __locks)
+ {
+ std::get<_Idx>(__locks).unlock();
+ __unlock_impl<_Idx - 1>::__do_unlock(__locks);
+ }
+ };
+
+ template<>
+ struct __unlock_impl<-1>
+ {
+ template<typename... _Lock>
+ static void
+ __do_unlock(tuple<_Lock&...>&)
+ { }
+ };
+
+ template<int _Idx, bool _Continue = true>
+ struct __try_lock_impl
+ {
+ template<typename... _Lock>
+ static int
+ __do_try_lock(tuple<_Lock&...>& __locks)
+ {
+ if(std::get<_Idx>(__locks).try_lock())
+ {
+ return __try_lock_impl<_Idx + 1,
+ _Idx + 2 < sizeof...(_Lock)>::__do_try_lock(__locks);
+ }
+ else
+ {
+ __unlock_impl<_Idx>::__do_unlock(__locks);
+ return _Idx;
+ }
+ }
+ };
+
+ template<int _Idx>
+ struct __try_lock_impl<_Idx, false>
+ {
+ template<typename... _Lock>
+ static int
+ __do_try_lock(tuple<_Lock&...>& __locks)
+ {
+ if(std::get<_Idx>(__locks).try_lock())
+ return -1;
+ else
+ {
+ __unlock_impl<_Idx>::__do_unlock(__locks);
+ return _Idx;
+ }
+ }
+ };
+
+ /** @brief Generic try_lock.
+ * @param __l1 Meets Mutex requirements (try_lock() may throw).
+ * @param __l2 Meets Mutex requirements (try_lock() may throw).
+ * @param __l3 Meets Mutex requirements (try_lock() may throw).
+ * @return Returns -1 if all try_lock() calls return true. Otherwise returns
+ * a 0-based index corresponding to the argument that returned false.
+ * @post Either all arguments are locked, or none will be.
+ *
+ * Sequentially calls try_lock() on each argument.
+ */
+ template<typename _Lock1, typename _Lock2, typename... _Lock3>
+ int
+ try_lock(_Lock1& __l1, _Lock2& __l2, _Lock3&... __l3)
+ {
+ tuple<_Lock1&, _Lock2&, _Lock3&...> __locks(__l1, __l2, __l3...);
+ return __try_lock_impl<0>::__do_try_lock(__locks);
+ }
+
+ /// lock
+ template<typename _L1, typename _L2, typename ..._L3>
+ void
+ lock(_L1&, _L2&, _L3&...);
+
+ /// once_flag
+ struct once_flag
+ {
+ private:
+ typedef __gthread_once_t __native_type;
+ __native_type _M_once;
+
+ public:
+ once_flag()
+ {
+ __native_type __tmp = __GTHREAD_ONCE_INIT;
+ _M_once = __tmp;
+ }
+
+ once_flag(const once_flag&) = delete;
+ once_flag& operator=(const once_flag&) = delete;
+
+ template<typename _Callable, typename... _Args>
+ friend void
+ call_once(once_flag& __once, _Callable __f, _Args&&... __args);
+ };
+
+#ifdef _GLIBCXX_HAVE_TLS
+ extern __thread void* __once_callable;
+ extern __thread void (*__once_call)();
+
+ template<typename _Callable>
+ inline void
+ __once_call_impl()
+ {
+ (*(_Callable*)__once_callable)();
+ }
+#else
+ extern function<void()> __once_functor;
+
+ extern void
+ __set_once_functor_lock_ptr(unique_lock<mutex>*);
+
+ extern mutex&
+ __get_once_mutex();
+#endif
+
+ extern "C" void __once_proxy();
+
+ /// call_once
+ template<typename _Callable, typename... _Args>
+ void
+ call_once(once_flag& __once, _Callable __f, _Args&&... __args)
+ {
+#ifdef _GLIBCXX_HAVE_TLS
+ auto __bound_functor = bind(__f, __args...);
+ __once_callable = &__bound_functor;
+ __once_call = &__once_call_impl<decltype(__bound_functor)>;
+#else
+ unique_lock<mutex> __functor_lock(__get_once_mutex());
+ __once_functor = bind(__f, __args...);
+ __set_once_functor_lock_ptr(&__functor_lock);
+#endif
+
+ int __e = __gthread_once(&(__once._M_once), &__once_proxy);
+
+#ifndef _GLIBCXX_HAVE_TLS
+ if (__functor_lock)
+ __set_once_functor_lock_ptr(0);
+#endif
+
+ if (__e)
+ __throw_system_error(__e);
+ }
+
+ // @} group mutexes
+}
+
+#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_MUTEX
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/new b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/new
new file mode 100644
index 0000000..d411502
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/new
@@ -0,0 +1,112 @@
+// The -*- C++ -*- dynamic memory management header.
+
+// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+// 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation
+
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// GCC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file new
+ * This is a Standard C++ Library header.
+ *
+ * The header @c new defines several functions to manage dynamic memory and
+ * handling memory allocation errors; see
+ * http://gcc.gnu.org/onlinedocs/libstdc++/18_support/howto.html#4 for more.
+ */
+
+#ifndef _NEW
+#define _NEW
+
+#include <cstddef>
+#include <exception>
+
+#pragma GCC visibility push(default)
+
+extern "C++" {
+
+namespace std
+{
+ /**
+ * @brief Exception possibly thrown by @c new.
+ * @ingroup exceptions
+ *
+ * @c bad_alloc (or classes derived from it) is used to report allocation
+ * errors from the throwing forms of @c new. */
+ class bad_alloc : public exception
+ {
+ public:
+ bad_alloc() throw() { }
+
+ // This declaration is not useless:
+ // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
+ virtual ~bad_alloc() throw();
+
+ // See comment in eh_exception.cc.
+ virtual const char* what() const throw();
+ };
+
+ struct nothrow_t { };
+
+ extern const nothrow_t nothrow;
+
+ /** If you write your own error handler to be called by @c new, it must
+ * be of this type. */
+ typedef void (*new_handler)();
+
+ /// Takes a replacement handler as the argument, returns the
+ /// previous handler.
+ new_handler set_new_handler(new_handler) throw();
+} // namespace std
+
+//@{
+/** These are replaceable signatures:
+ * - normal single new and delete (no arguments, throw @c bad_alloc on error)
+ * - normal array new and delete (same)
+ * - @c nothrow single new and delete (take a @c nothrow argument, return
+ * @c NULL on error)
+ * - @c nothrow array new and delete (same)
+ *
+ * Placement new and delete signatures (take a memory address argument,
+ * does nothing) may not be replaced by a user's program.
+*/
+void* operator new(std::size_t) throw (std::bad_alloc);
+void* operator new[](std::size_t) throw (std::bad_alloc);
+void operator delete(void*) throw();
+void operator delete[](void*) throw();
+void* operator new(std::size_t, const std::nothrow_t&) throw();
+void* operator new[](std::size_t, const std::nothrow_t&) throw();
+void operator delete(void*, const std::nothrow_t&) throw();
+void operator delete[](void*, const std::nothrow_t&) throw();
+
+// Default placement versions of operator new.
+inline void* operator new(std::size_t, void* __p) throw() { return __p; }
+inline void* operator new[](std::size_t, void* __p) throw() { return __p; }
+
+// Default placement versions of operator delete.
+inline void operator delete (void*, void*) throw() { }
+inline void operator delete[](void*, void*) throw() { }
+//@}
+} // extern "C++"
+
+#pragma GCC visibility pop
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/numeric b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/numeric
new file mode 100644
index 0000000..43d76d9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/numeric
@@ -0,0 +1,78 @@
+// <numeric> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/numeric
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_NUMERIC
+#define _GLIBCXX_NUMERIC 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <cstddef>
+#include <bits/stl_iterator_base_types.h>
+#include <bits/stl_numeric.h>
+
+#ifdef _GLIBCXX_PARALLEL
+# include <parallel/numeric>
+#endif
+
+/**
+ * @defgroup numerics Numerics
+ *
+ * Components for performing numeric operations. Includes support for
+ * for complex number types, random number generation, numeric
+ * (n-at-a-time) arrays, generalized numeric algorithms, and special
+ * math functions.
+ */
+
+#endif /* _GLIBCXX_NUMERIC */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ostream b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ostream
new file mode 100644
index 0000000..c49b36f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ostream
@@ -0,0 +1,568 @@
+// Output streams -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ostream
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 14882: 27.6.2 Output streams
+//
+
+#ifndef _GLIBCXX_OSTREAM
+#define _GLIBCXX_OSTREAM 1
+
+#pragma GCC system_header
+
+#include <ios>
+#include <bits/ostream_insert.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // [27.6.2.1] Template class basic_ostream
+ /**
+ * @brief Controlling output.
+ * @ingroup io
+ *
+ * This is the base class for all output streams. It provides text
+ * formatting of all builtin types, and communicates with any class
+ * derived from basic_streambuf to do the actual output.
+ */
+ template<typename _CharT, typename _Traits>
+ class basic_ostream : virtual public basic_ios<_CharT, _Traits>
+ {
+ public:
+ // Types (inherited from basic_ios (27.4.4)):
+ typedef _CharT char_type;
+ typedef typename _Traits::int_type int_type;
+ typedef typename _Traits::pos_type pos_type;
+ typedef typename _Traits::off_type off_type;
+ typedef _Traits traits_type;
+
+ // Non-standard Types:
+ typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
+ typedef basic_ios<_CharT, _Traits> __ios_type;
+ typedef basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
+ __num_put_type;
+ typedef ctype<_CharT> __ctype_type;
+
+ // [27.6.2.2] constructor/destructor
+ /**
+ * @brief Base constructor.
+ *
+ * This ctor is almost never called by the user directly, rather from
+ * derived classes' initialization lists, which pass a pointer to
+ * their own stream buffer.
+ */
+ explicit
+ basic_ostream(__streambuf_type* __sb)
+ { this->init(__sb); }
+
+ /**
+ * @brief Base destructor.
+ *
+ * This does very little apart from providing a virtual base dtor.
+ */
+ virtual
+ ~basic_ostream() { }
+
+ // [27.6.2.3] prefix/suffix
+ class sentry;
+ friend class sentry;
+
+ // [27.6.2.5] formatted output
+ // [27.6.2.5.3] basic_ostream::operator<<
+ //@{
+ /**
+ * @brief Interface for manipulators.
+ *
+ * Manipulators such as @c std::endl and @c std::hex use these
+ * functions in constructs like "std::cout << std::endl". For more
+ * information, see the iomanip header.
+ */
+ __ostream_type&
+ operator<<(__ostream_type& (*__pf)(__ostream_type&))
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // The inserters for manipulators are *not* formatted output functions.
+ return __pf(*this);
+ }
+
+ __ostream_type&
+ operator<<(__ios_type& (*__pf)(__ios_type&))
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // The inserters for manipulators are *not* formatted output functions.
+ __pf(*this);
+ return *this;
+ }
+
+ __ostream_type&
+ operator<<(ios_base& (*__pf) (ios_base&))
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // The inserters for manipulators are *not* formatted output functions.
+ __pf(*this);
+ return *this;
+ }
+ //@}
+
+ // [27.6.2.5.2] arithmetic inserters
+ /**
+ * @name Arithmetic Inserters
+ *
+ * All the @c operator<< functions (aka <em>formatted output
+ * functions</em>) have some common behavior. Each starts by
+ * constructing a temporary object of type std::basic_ostream::sentry.
+ * This can have several effects, concluding with the setting of a
+ * status flag; see the sentry documentation for more.
+ *
+ * If the sentry status is good, the function tries to generate
+ * whatever data is appropriate for the type of the argument.
+ *
+ * If an exception is thrown during insertion, ios_base::badbit
+ * will be turned on in the stream's error state without causing an
+ * ios_base::failure to be thrown. The original exception will then
+ * be rethrown.
+ */
+ //@{
+ /**
+ * @brief Basic arithmetic inserters
+ * @param A variable of builtin type.
+ * @return @c *this if successful
+ *
+ * These functions use the stream's current locale (specifically, the
+ * @c num_get facet) to perform numeric formatting.
+ */
+ __ostream_type&
+ operator<<(long __n)
+ { return _M_insert(__n); }
+
+ __ostream_type&
+ operator<<(unsigned long __n)
+ { return _M_insert(__n); }
+
+ __ostream_type&
+ operator<<(bool __n)
+ { return _M_insert(__n); }
+
+ __ostream_type&
+ operator<<(short __n);
+
+ __ostream_type&
+ operator<<(unsigned short __n)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 117. basic_ostream uses nonexistent num_put member functions.
+ return _M_insert(static_cast<unsigned long>(__n));
+ }
+
+ __ostream_type&
+ operator<<(int __n);
+
+ __ostream_type&
+ operator<<(unsigned int __n)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 117. basic_ostream uses nonexistent num_put member functions.
+ return _M_insert(static_cast<unsigned long>(__n));
+ }
+
+#ifdef _GLIBCXX_USE_LONG_LONG
+ __ostream_type&
+ operator<<(long long __n)
+ { return _M_insert(__n); }
+
+ __ostream_type&
+ operator<<(unsigned long long __n)
+ { return _M_insert(__n); }
+#endif
+
+ __ostream_type&
+ operator<<(double __f)
+ { return _M_insert(__f); }
+
+ __ostream_type&
+ operator<<(float __f)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 117. basic_ostream uses nonexistent num_put member functions.
+ return _M_insert(static_cast<double>(__f));
+ }
+
+ __ostream_type&
+ operator<<(long double __f)
+ { return _M_insert(__f); }
+
+ __ostream_type&
+ operator<<(const void* __p)
+ { return _M_insert(__p); }
+
+ /**
+ * @brief Extracting from another streambuf.
+ * @param sb A pointer to a streambuf
+ *
+ * This function behaves like one of the basic arithmetic extractors,
+ * in that it also constructs a sentry object and has the same error
+ * handling behavior.
+ *
+ * If @a sb is NULL, the stream will set failbit in its error state.
+ *
+ * Characters are extracted from @a sb and inserted into @c *this
+ * until one of the following occurs:
+ *
+ * - the input stream reaches end-of-file,
+ * - insertion into the output sequence fails (in this case, the
+ * character that would have been inserted is not extracted), or
+ * - an exception occurs while getting a character from @a sb, which
+ * sets failbit in the error state
+ *
+ * If the function inserts no characters, failbit is set.
+ */
+ __ostream_type&
+ operator<<(__streambuf_type* __sb);
+ //@}
+
+ // [27.6.2.6] unformatted output functions
+ /**
+ * @name Unformatted Output Functions
+ *
+ * All the unformatted output functions have some common behavior.
+ * Each starts by constructing a temporary object of type
+ * std::basic_ostream::sentry. This has several effects, concluding
+ * with the setting of a status flag; see the sentry documentation
+ * for more.
+ *
+ * If the sentry status is good, the function tries to generate
+ * whatever data is appropriate for the type of the argument.
+ *
+ * If an exception is thrown during insertion, ios_base::badbit
+ * will be turned on in the stream's error state. If badbit is on in
+ * the stream's exceptions mask, the exception will be rethrown
+ * without completing its actions.
+ */
+ //@{
+ /**
+ * @brief Simple insertion.
+ * @param c The character to insert.
+ * @return *this
+ *
+ * Tries to insert @a c.
+ *
+ * @note This function is not overloaded on signed char and
+ * unsigned char.
+ */
+ __ostream_type&
+ put(char_type __c);
+
+ // Core write functionality, without sentry.
+ void
+ _M_write(const char_type* __s, streamsize __n)
+ {
+ const streamsize __put = this->rdbuf()->sputn(__s, __n);
+ if (__put != __n)
+ this->setstate(ios_base::badbit);
+ }
+
+ /**
+ * @brief Character string insertion.
+ * @param s The array to insert.
+ * @param n Maximum number of characters to insert.
+ * @return *this
+ *
+ * Characters are copied from @a s and inserted into the stream until
+ * one of the following happens:
+ *
+ * - @a n characters are inserted
+ * - inserting into the output sequence fails (in this case, badbit
+ * will be set in the stream's error state)
+ *
+ * @note This function is not overloaded on signed char and
+ * unsigned char.
+ */
+ __ostream_type&
+ write(const char_type* __s, streamsize __n);
+ //@}
+
+ /**
+ * @brief Synchronizing the stream buffer.
+ * @return *this
+ *
+ * If @c rdbuf() is a null pointer, changes nothing.
+ *
+ * Otherwise, calls @c rdbuf()->pubsync(), and if that returns -1,
+ * sets badbit.
+ */
+ __ostream_type&
+ flush();
+
+ // [27.6.2.4] seek members
+ /**
+ * @brief Getting the current write position.
+ * @return A file position object.
+ *
+ * If @c fail() is not false, returns @c pos_type(-1) to indicate
+ * failure. Otherwise returns @c rdbuf()->pubseekoff(0,cur,out).
+ */
+ pos_type
+ tellp();
+
+ /**
+ * @brief Changing the current write position.
+ * @param pos A file position object.
+ * @return *this
+ *
+ * If @c fail() is not true, calls @c rdbuf()->pubseekpos(pos). If
+ * that function fails, sets failbit.
+ */
+ __ostream_type&
+ seekp(pos_type);
+
+ /**
+ * @brief Changing the current write position.
+ * @param off A file offset object.
+ * @param dir The direction in which to seek.
+ * @return *this
+ *
+ * If @c fail() is not true, calls @c rdbuf()->pubseekoff(off,dir).
+ * If that function fails, sets failbit.
+ */
+ __ostream_type&
+ seekp(off_type, ios_base::seekdir);
+
+ protected:
+ basic_ostream()
+ { this->init(0); }
+
+ template<typename _ValueT>
+ __ostream_type&
+ _M_insert(_ValueT __v);
+ };
+
+ /**
+ * @brief Performs setup work for output streams.
+ *
+ * Objects of this class are created before all of the standard
+ * inserters are run. It is responsible for "exception-safe prefix and
+ * suffix operations."
+ */
+ template <typename _CharT, typename _Traits>
+ class basic_ostream<_CharT, _Traits>::sentry
+ {
+ // Data Members:
+ bool _M_ok;
+ basic_ostream<_CharT, _Traits>& _M_os;
+
+ public:
+ /**
+ * @brief The constructor performs preparatory work.
+ * @param os The output stream to guard.
+ *
+ * If the stream state is good (@a os.good() is true), then if the
+ * stream is tied to another output stream, @c is.tie()->flush()
+ * is called to synchronize the output sequences.
+ *
+ * If the stream state is still good, then the sentry state becomes
+ * true ("okay").
+ */
+ explicit
+ sentry(basic_ostream<_CharT, _Traits>& __os);
+
+ /**
+ * @brief Possibly flushes the stream.
+ *
+ * If @c ios_base::unitbuf is set in @c os.flags(), and
+ * @c std::uncaught_exception() is true, the sentry destructor calls
+ * @c flush() on the output stream.
+ */
+ ~sentry()
+ {
+ // XXX MT
+ if (bool(_M_os.flags() & ios_base::unitbuf) && !uncaught_exception())
+ {
+ // Can't call flush directly or else will get into recursive lock.
+ if (_M_os.rdbuf() && _M_os.rdbuf()->pubsync() == -1)
+ _M_os.setstate(ios_base::badbit);
+ }
+ }
+
+ /**
+ * @brief Quick status checking.
+ * @return The sentry state.
+ *
+ * For ease of use, sentries may be converted to booleans. The
+ * return value is that of the sentry state (true == okay).
+ */
+ operator bool() const
+ { return _M_ok; }
+ };
+
+ // [27.6.2.5.4] character insertion templates
+ //@{
+ /**
+ * @brief Character inserters
+ * @param out An output stream.
+ * @param c A character.
+ * @return out
+ *
+ * Behaves like one of the formatted arithmetic inserters described in
+ * std::basic_ostream. After constructing a sentry object with good
+ * status, this function inserts a single character and any required
+ * padding (as determined by [22.2.2.2.2]). @c out.width(0) is then
+ * called.
+ *
+ * If @a c is of type @c char and the character type of the stream is not
+ * @c char, the character is widened before insertion.
+ */
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
+ { return __ostream_insert(__out, &__c, 1); }
+
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
+ { return (__out << __out.widen(__c)); }
+
+ // Specialization
+ template <class _Traits>
+ inline basic_ostream<char, _Traits>&
+ operator<<(basic_ostream<char, _Traits>& __out, char __c)
+ { return __ostream_insert(__out, &__c, 1); }
+
+ // Signed and unsigned
+ template<class _Traits>
+ inline basic_ostream<char, _Traits>&
+ operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
+ { return (__out << static_cast<char>(__c)); }
+
+ template<class _Traits>
+ inline basic_ostream<char, _Traits>&
+ operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
+ { return (__out << static_cast<char>(__c)); }
+ //@}
+
+ //@{
+ /**
+ * @brief String inserters
+ * @param out An output stream.
+ * @param s A character string.
+ * @return out
+ * @pre @a s must be a non-NULL pointer
+ *
+ * Behaves like one of the formatted arithmetic inserters described in
+ * std::basic_ostream. After constructing a sentry object with good
+ * status, this function inserts @c traits::length(s) characters starting
+ * at @a s, widened if necessary, followed by any required padding (as
+ * determined by [22.2.2.2.2]). @c out.width(0) is then called.
+ */
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
+ {
+ if (!__s)
+ __out.setstate(ios_base::badbit);
+ else
+ __ostream_insert(__out, __s,
+ static_cast<streamsize>(_Traits::length(__s)));
+ return __out;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits> &
+ operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s);
+
+ // Partial specializations
+ template<class _Traits>
+ inline basic_ostream<char, _Traits>&
+ operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
+ {
+ if (!__s)
+ __out.setstate(ios_base::badbit);
+ else
+ __ostream_insert(__out, __s,
+ static_cast<streamsize>(_Traits::length(__s)));
+ return __out;
+ }
+
+ // Signed and unsigned
+ template<class _Traits>
+ inline basic_ostream<char, _Traits>&
+ operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
+ { return (__out << reinterpret_cast<const char*>(__s)); }
+
+ template<class _Traits>
+ inline basic_ostream<char, _Traits> &
+ operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
+ { return (__out << reinterpret_cast<const char*>(__s)); }
+ //@}
+
+ // [27.6.2.7] standard basic_ostream manipulators
+ /**
+ * @brief Write a newline and flush the stream.
+ *
+ * This manipulator is often mistakenly used when a simple newline is
+ * desired, leading to poor buffering performance. See
+ * http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#2 for more
+ * on this subject.
+ */
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ endl(basic_ostream<_CharT, _Traits>& __os)
+ { return flush(__os.put(__os.widen('\n'))); }
+
+ /**
+ * @brief Write a null character into the output sequence.
+ *
+ * "Null character" is @c CharT() by definition. For CharT of @c char,
+ * this correctly writes the ASCII @c NUL character string terminator.
+ */
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ ends(basic_ostream<_CharT, _Traits>& __os)
+ { return __os.put(_CharT()); }
+
+ /**
+ * @brief Flushes the output stream.
+ *
+ * This manipulator simply calls the stream's @c flush() member function.
+ */
+ template<typename _CharT, typename _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ flush(basic_ostream<_CharT, _Traits>& __os)
+ { return __os.flush(); }
+
+_GLIBCXX_END_NAMESPACE
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/ostream.tcc>
+#endif
+
+#endif /* _GLIBCXX_OSTREAM */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/algo.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/algo.h
new file mode 100644
index 0000000..a0fbd8d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/algo.h
@@ -0,0 +1,2364 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/algo.h
+ * @brief Parallel STL function calls corresponding to the stl_algo.h header.
+ *
+ * The functions defined here mainly do case switches and
+ * call the actual parallelized versions in other files.
+ * Inlining policy: Functions that basically only contain one function call,
+ * are declared inline.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler and Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_ALGO_H
+#define _GLIBCXX_PARALLEL_ALGO_H 1
+
+#include <parallel/algorithmfwd.h>
+#include <bits/stl_algobase.h>
+#include <bits/stl_algo.h>
+#include <parallel/iterator.h>
+#include <parallel/base.h>
+#include <parallel/sort.h>
+#include <parallel/workstealing.h>
+#include <parallel/par_loop.h>
+#include <parallel/omp_loop.h>
+#include <parallel/omp_loop_static.h>
+#include <parallel/for_each_selectors.h>
+#include <parallel/for_each.h>
+#include <parallel/find.h>
+#include <parallel/find_selectors.h>
+#include <parallel/search.h>
+#include <parallel/random_shuffle.h>
+#include <parallel/partition.h>
+#include <parallel/merge.h>
+#include <parallel/unique_copy.h>
+#include <parallel/set_operations.h>
+
+namespace std
+{
+namespace __parallel
+{
+ // Sequential fallback
+ template<typename InputIterator, typename Function>
+ inline Function
+ for_each(InputIterator begin, InputIterator end, Function f,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::for_each(begin, end, f); }
+
+
+ // Sequential fallback for input iterator case
+ template<typename InputIterator, typename Function, typename IteratorTag>
+ inline Function
+ for_each_switch(InputIterator begin, InputIterator end, Function f,
+ IteratorTag)
+ { return for_each(begin, end, f, __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators
+ template<typename RandomAccessIterator, typename Function>
+ Function
+ for_each_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ Function f, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_balanced)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().for_each_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ bool dummy;
+ __gnu_parallel::for_each_selector<RandomAccessIterator> functionality;
+
+ return __gnu_parallel::
+ for_each_template_random_access(begin, end, f, functionality,
+ __gnu_parallel::dummy_reduct(),
+ true, dummy, -1, parallelism_tag);
+ }
+ else
+ return for_each(begin, end, f, __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface
+ template<typename Iterator, typename Function>
+ inline Function
+ for_each(Iterator begin, Iterator end, Function f,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef std::iterator_traits<Iterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ return for_each_switch(begin, end, f, iterator_category(),
+ parallelism_tag);
+ }
+
+ template<typename Iterator, typename Function>
+ inline Function
+ for_each(Iterator begin, Iterator end, Function f)
+ {
+ typedef std::iterator_traits<Iterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ return for_each_switch(begin, end, f, iterator_category());
+ }
+
+
+ // Sequential fallback
+ template<typename InputIterator, typename T>
+ inline InputIterator
+ find(InputIterator begin, InputIterator end, const T& val,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::find(begin, end, val); }
+
+ // Sequential fallback for input iterator case
+ template<typename InputIterator, typename T, typename IteratorTag>
+ inline InputIterator
+ find_switch(InputIterator begin, InputIterator end, const T& val,
+ IteratorTag)
+ { return _GLIBCXX_STD_P::find(begin, end, val); }
+
+ // Parallel find for random access iterators
+ template<typename RandomAccessIterator, typename T>
+ RandomAccessIterator
+ find_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ const T& val, random_access_iterator_tag)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+
+ if (_GLIBCXX_PARALLEL_CONDITION(true))
+ {
+ binder2nd<__gnu_parallel::equal_to<value_type, const T&> >
+ comp(__gnu_parallel::equal_to<value_type, const T&>(), val);
+ return __gnu_parallel::find_template(begin, end, begin, comp,
+ __gnu_parallel::
+ find_if_selector()).first;
+ }
+ else
+ return _GLIBCXX_STD_P::find(begin, end, val);
+ }
+
+ // Public interface
+ template<typename InputIterator, typename T>
+ inline InputIterator
+ find(InputIterator begin, InputIterator end, const T& val)
+ {
+ typedef std::iterator_traits<InputIterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ return find_switch(begin, end, val, iterator_category());
+ }
+
+ // Sequential fallback
+ template<typename InputIterator, typename Predicate>
+ inline InputIterator
+ find_if(InputIterator begin, InputIterator end, Predicate pred,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::find_if(begin, end, pred); }
+
+ // Sequential fallback for input iterator case
+ template<typename InputIterator, typename Predicate, typename IteratorTag>
+ inline InputIterator
+ find_if_switch(InputIterator begin, InputIterator end, Predicate pred,
+ IteratorTag)
+ { return _GLIBCXX_STD_P::find_if(begin, end, pred); }
+
+ // Parallel find_if for random access iterators
+ template<typename RandomAccessIterator, typename Predicate>
+ RandomAccessIterator
+ find_if_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ Predicate pred, random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(true))
+ return __gnu_parallel::find_template(begin, end, begin, pred,
+ __gnu_parallel::
+ find_if_selector()).first;
+ else
+ return _GLIBCXX_STD_P::find_if(begin, end, pred);
+ }
+
+ // Public interface
+ template<typename InputIterator, typename Predicate>
+ inline InputIterator
+ find_if(InputIterator begin, InputIterator end, Predicate pred)
+ {
+ typedef std::iterator_traits<InputIterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ return find_if_switch(begin, end, pred, iterator_category());
+ }
+
+ // Sequential fallback
+ template<typename InputIterator, typename ForwardIterator>
+ inline InputIterator
+ find_first_of(InputIterator begin1, InputIterator end1,
+ ForwardIterator begin2, ForwardIterator end2,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::find_first_of(begin1, end1, begin2, end2); }
+
+ // Sequential fallback
+ template<typename InputIterator, typename ForwardIterator,
+ typename BinaryPredicate>
+ inline InputIterator
+ find_first_of(InputIterator begin1, InputIterator end1,
+ ForwardIterator begin2, ForwardIterator end2,
+ BinaryPredicate comp, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::find_first_of(begin1, end1, begin2, end2, comp); }
+
+ // Sequential fallback for input iterator type
+ template<typename InputIterator, typename ForwardIterator,
+ typename IteratorTag1, typename IteratorTag2>
+ inline InputIterator
+ find_first_of_switch(InputIterator begin1, InputIterator end1,
+ ForwardIterator begin2, ForwardIterator end2,
+ IteratorTag1, IteratorTag2)
+ { return find_first_of(begin1, end1, begin2, end2,
+ __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators
+ template<typename RandomAccessIterator, typename ForwardIterator,
+ typename BinaryPredicate, typename IteratorTag>
+ inline RandomAccessIterator
+ find_first_of_switch(RandomAccessIterator begin1,
+ RandomAccessIterator end1,
+ ForwardIterator begin2, ForwardIterator end2,
+ BinaryPredicate comp, random_access_iterator_tag,
+ IteratorTag)
+ {
+ return __gnu_parallel::
+ find_template(begin1, end1, begin1, comp,
+ __gnu_parallel::find_first_of_selector
+ <ForwardIterator>(begin2, end2)).first;
+ }
+
+ // Sequential fallback for input iterator type
+ template<typename InputIterator, typename ForwardIterator,
+ typename BinaryPredicate, typename IteratorTag1,
+ typename IteratorTag2>
+ inline InputIterator
+ find_first_of_switch(InputIterator begin1, InputIterator end1,
+ ForwardIterator begin2, ForwardIterator end2,
+ BinaryPredicate comp, IteratorTag1, IteratorTag2)
+ { return find_first_of(begin1, end1, begin2, end2, comp,
+ __gnu_parallel::sequential_tag()); }
+
+ // Public interface
+ template<typename InputIterator, typename ForwardIterator,
+ typename BinaryPredicate>
+ inline InputIterator
+ find_first_of(InputIterator begin1, InputIterator end1,
+ ForwardIterator begin2, ForwardIterator end2,
+ BinaryPredicate comp)
+ {
+ typedef std::iterator_traits<InputIterator> iteratori_traits;
+ typedef std::iterator_traits<ForwardIterator> iteratorf_traits;
+ typedef typename iteratori_traits::iterator_category iteratori_category;
+ typedef typename iteratorf_traits::iterator_category iteratorf_category;
+
+ return find_first_of_switch(begin1, end1, begin2, end2, comp,
+ iteratori_category(), iteratorf_category());
+ }
+
+ // Public interface, insert default comparator
+ template<typename InputIterator, typename ForwardIterator>
+ inline InputIterator
+ find_first_of(InputIterator begin1, InputIterator end1,
+ ForwardIterator begin2, ForwardIterator end2)
+ {
+ typedef std::iterator_traits<InputIterator> iteratori_traits;
+ typedef std::iterator_traits<ForwardIterator> iteratorf_traits;
+ typedef typename iteratori_traits::value_type valuei_type;
+ typedef typename iteratorf_traits::value_type valuef_type;
+
+ return find_first_of(begin1, end1, begin2, end2, __gnu_parallel::
+ equal_to<valuei_type, valuef_type>());
+ }
+
+ // Sequential fallback
+ template<typename InputIterator, typename OutputIterator>
+ inline OutputIterator
+ unique_copy(InputIterator begin1, InputIterator end1, OutputIterator out,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::unique_copy(begin1, end1, out); }
+
+ // Sequential fallback
+ template<typename InputIterator, typename OutputIterator,
+ typename Predicate>
+ inline OutputIterator
+ unique_copy(InputIterator begin1, InputIterator end1, OutputIterator out,
+ Predicate pred, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::unique_copy(begin1, end1, out, pred); }
+
+ // Sequential fallback for input iterator case
+ template<typename InputIterator, typename OutputIterator,
+ typename Predicate, typename IteratorTag1, typename IteratorTag2>
+ inline OutputIterator
+ unique_copy_switch(InputIterator begin, InputIterator last,
+ OutputIterator out, Predicate pred,
+ IteratorTag1, IteratorTag2)
+ { return _GLIBCXX_STD_P::unique_copy(begin, last, out, pred); }
+
+ // Parallel unique_copy for random access iterators
+ template<typename RandomAccessIterator, typename RandomAccessOutputIterator,
+ typename Predicate>
+ RandomAccessOutputIterator
+ unique_copy_switch(RandomAccessIterator begin, RandomAccessIterator last,
+ RandomAccessOutputIterator out, Predicate pred,
+ random_access_iterator_tag, random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(last - begin)
+ > __gnu_parallel::_Settings::get().unique_copy_minimal_n))
+ return __gnu_parallel::parallel_unique_copy(begin, last, out, pred);
+ else
+ return _GLIBCXX_STD_P::unique_copy(begin, last, out, pred);
+ }
+
+ // Public interface
+ template<typename InputIterator, typename OutputIterator>
+ inline OutputIterator
+ unique_copy(InputIterator begin1, InputIterator end1, OutputIterator out)
+ {
+ typedef std::iterator_traits<InputIterator> iteratori_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori_traits::iterator_category iteratori_category;
+ typedef typename iteratori_traits::value_type value_type;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return unique_copy_switch(begin1, end1, out, equal_to<value_type>(),
+ iteratori_category(), iteratoro_category());
+ }
+
+ // Public interface
+ template<typename InputIterator, typename OutputIterator, typename Predicate>
+ inline OutputIterator
+ unique_copy(InputIterator begin1, InputIterator end1, OutputIterator out,
+ Predicate pred)
+ {
+ typedef std::iterator_traits<InputIterator> iteratori_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori_traits::iterator_category iteratori_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return unique_copy_switch(begin1, end1, out, pred, iteratori_category(),
+ iteratoro_category());
+ }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator>
+ inline OutputIterator
+ set_union(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::set_union(begin1, end1, begin2, end2, out); }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Predicate>
+ inline OutputIterator
+ set_union(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, Predicate pred,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::set_union(begin1, end1,
+ begin2, end2, out, pred); }
+
+ // Sequential fallback for input iterator case
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate, typename OutputIterator,
+ typename IteratorTag1, typename IteratorTag2, typename IteratorTag3>
+ inline OutputIterator
+ set_union_switch(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator result, Predicate pred, IteratorTag1,
+ IteratorTag2, IteratorTag3)
+ { return _GLIBCXX_STD_P::set_union(begin1, end1,
+ begin2, end2, result, pred); }
+
+ // Parallel set_union for random access iterators
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename OutputRandomAccessIterator, typename Predicate>
+ OutputRandomAccessIterator
+ set_union_switch(RandomAccessIterator1 begin1, RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, RandomAccessIterator2 end2,
+ OutputRandomAccessIterator result, Predicate pred,
+ random_access_iterator_tag, random_access_iterator_tag,
+ random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end1 - begin1)
+ >= __gnu_parallel::_Settings::get().set_union_minimal_n
+ || static_cast<__gnu_parallel::sequence_index_t>(end2 - begin2)
+ >= __gnu_parallel::_Settings::get().set_union_minimal_n))
+ return __gnu_parallel::parallel_set_union(begin1, end1,
+ begin2, end2, result, pred);
+ else
+ return _GLIBCXX_STD_P::set_union(begin1, end1,
+ begin2, end2, result, pred);
+ }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator>
+ inline OutputIterator
+ set_union(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2, OutputIterator out)
+ {
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+ typedef typename iteratori1_traits::value_type value1_type;
+ typedef typename iteratori2_traits::value_type value2_type;
+
+ return set_union_switch(begin1, end1, begin2, end2, out,
+ __gnu_parallel::less<value1_type, value2_type>(),
+ iteratori1_category(), iteratori2_category(),
+ iteratoro_category());
+ }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Predicate>
+ inline OutputIterator
+ set_union(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, Predicate pred)
+ {
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return set_union_switch(begin1, end1, begin2, end2, out, pred,
+ iteratori1_category(), iteratori2_category(),
+ iteratoro_category());
+ }
+
+ // Sequential fallback.
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator>
+ inline OutputIterator
+ set_intersection(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::set_intersection(begin1, end1,
+ begin2, end2, out); }
+
+ // Sequential fallback.
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Predicate>
+ inline OutputIterator
+ set_intersection(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, Predicate pred,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::set_intersection(begin1, end1, begin2, end2,
+ out, pred); }
+
+ // Sequential fallback for input iterator case
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate, typename OutputIterator,
+ typename IteratorTag1, typename IteratorTag2,
+ typename IteratorTag3>
+ inline OutputIterator
+ set_intersection_switch(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator result, Predicate pred,
+ IteratorTag1, IteratorTag2, IteratorTag3)
+ { return _GLIBCXX_STD_P::set_intersection(begin1, end1, begin2,
+ end2, result, pred); }
+
+ // Parallel set_intersection for random access iterators
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename OutputRandomAccessIterator, typename Predicate>
+ OutputRandomAccessIterator
+ set_intersection_switch(RandomAccessIterator1 begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2,
+ RandomAccessIterator2 end2,
+ OutputRandomAccessIterator result,
+ Predicate pred,
+ random_access_iterator_tag,
+ random_access_iterator_tag,
+ random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end1 - begin1)
+ >= __gnu_parallel::_Settings::get().set_union_minimal_n
+ || static_cast<__gnu_parallel::sequence_index_t>(end2 - begin2)
+ >= __gnu_parallel::_Settings::get().set_union_minimal_n))
+ return __gnu_parallel::parallel_set_intersection(begin1, end1, begin2,
+ end2, result, pred);
+ else
+ return _GLIBCXX_STD_P::set_intersection(begin1, end1, begin2,
+ end2, result, pred);
+ }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator>
+ inline OutputIterator
+ set_intersection(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out)
+ {
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+ typedef typename iteratori1_traits::value_type value1_type;
+ typedef typename iteratori2_traits::value_type value2_type;
+
+ return set_intersection_switch(begin1, end1, begin2, end2, out,
+ __gnu_parallel::
+ less<value1_type, value2_type>(),
+ iteratori1_category(),
+ iteratori2_category(),
+ iteratoro_category());
+ }
+
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Predicate>
+ inline OutputIterator
+ set_intersection(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, Predicate pred)
+ {
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return set_intersection_switch(begin1, end1, begin2, end2, out, pred,
+ iteratori1_category(),
+ iteratori2_category(),
+ iteratoro_category());
+ }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator>
+ inline OutputIterator
+ set_symmetric_difference(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::set_symmetric_difference(begin1,end1,
+ begin2, end2, out); }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Predicate>
+ inline OutputIterator
+ set_symmetric_difference(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, Predicate pred,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::set_symmetric_difference(begin1, end1, begin2,
+ end2, out, pred); }
+
+ // Sequential fallback for input iterator case
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate, typename OutputIterator,
+ typename IteratorTag1, typename IteratorTag2,
+ typename IteratorTag3>
+ inline OutputIterator
+ set_symmetric_difference_switch(InputIterator1 begin1,
+ InputIterator1 end1,
+ InputIterator2 begin2,
+ InputIterator2 end2,
+ OutputIterator result, Predicate pred,
+ IteratorTag1, IteratorTag2, IteratorTag3)
+ { return _GLIBCXX_STD_P::set_symmetric_difference(begin1, end1,
+ begin2, end2,
+ result, pred); }
+
+ // Parallel set_symmetric_difference for random access iterators
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename OutputRandomAccessIterator, typename Predicate>
+ OutputRandomAccessIterator
+ set_symmetric_difference_switch(RandomAccessIterator1 begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2,
+ RandomAccessIterator2 end2,
+ OutputRandomAccessIterator result,
+ Predicate pred,
+ random_access_iterator_tag,
+ random_access_iterator_tag,
+ random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end1 - begin1)
+ >= __gnu_parallel::_Settings::get().set_symmetric_difference_minimal_n
+ || static_cast<__gnu_parallel::sequence_index_t>(end2 - begin2)
+ >= __gnu_parallel::_Settings::get().set_symmetric_difference_minimal_n))
+ return __gnu_parallel::parallel_set_symmetric_difference(begin1, end1,
+ begin2, end2,
+ result, pred);
+ else
+ return _GLIBCXX_STD_P::set_symmetric_difference(begin1, end1,
+ begin2, end2,
+ result, pred);
+ }
+
+ // Public interface.
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator>
+ inline OutputIterator
+ set_symmetric_difference(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out)
+ {
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+ typedef typename iteratori1_traits::value_type value1_type;
+ typedef typename iteratori2_traits::value_type value2_type;
+
+ return set_symmetric_difference_switch(begin1, end1, begin2, end2, out,
+ __gnu_parallel::
+ less<value1_type, value2_type>(),
+ iteratori1_category(),
+ iteratori2_category(),
+ iteratoro_category());
+ }
+
+ // Public interface.
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Predicate>
+ inline OutputIterator
+ set_symmetric_difference(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, Predicate pred)
+ {
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return set_symmetric_difference_switch(begin1, end1, begin2, end2, out,
+ pred, iteratori1_category(),
+ iteratori2_category(),
+ iteratoro_category());
+ }
+
+ // Sequential fallback.
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator>
+ inline OutputIterator
+ set_difference(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::set_difference(begin1,end1, begin2, end2, out); }
+
+ // Sequential fallback.
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Predicate>
+ inline OutputIterator
+ set_difference(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, Predicate pred,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::set_difference(begin1, end1,
+ begin2, end2, out, pred); }
+
+ // Sequential fallback for input iterator case.
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate, typename OutputIterator,
+ typename IteratorTag1, typename IteratorTag2, typename IteratorTag3>
+ inline OutputIterator
+ set_difference_switch(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator result, Predicate pred,
+ IteratorTag1, IteratorTag2, IteratorTag3)
+ { return _GLIBCXX_STD_P::set_difference(begin1, end1,
+ begin2, end2, result, pred); }
+
+ // Parallel set_difference for random access iterators
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename OutputRandomAccessIterator, typename Predicate>
+ OutputRandomAccessIterator
+ set_difference_switch(RandomAccessIterator1 begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2,
+ RandomAccessIterator2 end2,
+ OutputRandomAccessIterator result, Predicate pred,
+ random_access_iterator_tag,
+ random_access_iterator_tag,
+ random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end1 - begin1)
+ >= __gnu_parallel::_Settings::get().set_difference_minimal_n
+ || static_cast<__gnu_parallel::sequence_index_t>(end2 - begin2)
+ >= __gnu_parallel::_Settings::get().set_difference_minimal_n))
+ return __gnu_parallel::parallel_set_difference(begin1, end1,
+ begin2, end2,
+ result, pred);
+ else
+ return _GLIBCXX_STD_P::set_difference(begin1, end1,
+ begin2, end2, result, pred);
+ }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator>
+ inline OutputIterator
+ set_difference(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out)
+ {
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+ typedef typename iteratori1_traits::value_type value1_type;
+ typedef typename iteratori2_traits::value_type value2_type;
+
+ return set_difference_switch(begin1, end1, begin2, end2, out,
+ __gnu_parallel::
+ less<value1_type, value2_type>(),
+ iteratori1_category(),
+ iteratori2_category(),
+ iteratoro_category());
+ }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Predicate>
+ inline OutputIterator
+ set_difference(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator out, Predicate pred)
+ {
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return set_difference_switch(begin1, end1, begin2, end2, out, pred,
+ iteratori1_category(),
+ iteratori2_category(),
+ iteratoro_category());
+ }
+
+ // Sequential fallback
+ template<typename ForwardIterator>
+ inline ForwardIterator
+ adjacent_find(ForwardIterator begin, ForwardIterator end,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::adjacent_find(begin, end); }
+
+ // Sequential fallback
+ template<typename ForwardIterator, typename BinaryPredicate>
+ inline ForwardIterator
+ adjacent_find(ForwardIterator begin, ForwardIterator end,
+ BinaryPredicate binary_pred, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::adjacent_find(begin, end, binary_pred); }
+
+ // Parallel algorithm for random access iterators
+ template<typename RandomAccessIterator>
+ RandomAccessIterator
+ adjacent_find_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ random_access_iterator_tag)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+
+ if (_GLIBCXX_PARALLEL_CONDITION(true))
+ {
+ RandomAccessIterator spot = __gnu_parallel::
+ find_template(begin, end - 1, begin, equal_to<value_type>(),
+ __gnu_parallel::adjacent_find_selector()).first;
+ if (spot == (end - 1))
+ return end;
+ else
+ return spot;
+ }
+ else
+ return adjacent_find(begin, end, __gnu_parallel::sequential_tag());
+ }
+
+ // Sequential fallback for input iterator case
+ template<typename ForwardIterator, typename IteratorTag>
+ inline ForwardIterator
+ adjacent_find_switch(ForwardIterator begin, ForwardIterator end,
+ IteratorTag)
+ { return adjacent_find(begin, end, __gnu_parallel::sequential_tag()); }
+
+ // Public interface
+ template<typename ForwardIterator>
+ inline ForwardIterator
+ adjacent_find(ForwardIterator begin, ForwardIterator end)
+ {
+ typedef iterator_traits<ForwardIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return adjacent_find_switch(begin, end, iterator_category());
+ }
+
+ // Sequential fallback for input iterator case
+ template<typename ForwardIterator, typename BinaryPredicate,
+ typename IteratorTag>
+ inline ForwardIterator
+ adjacent_find_switch(ForwardIterator begin, ForwardIterator end,
+ BinaryPredicate pred, IteratorTag)
+ { return adjacent_find(begin, end, pred,
+ __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators
+ template<typename RandomAccessIterator, typename BinaryPredicate>
+ RandomAccessIterator
+ adjacent_find_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ BinaryPredicate pred, random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(true))
+ return __gnu_parallel::find_template(begin, end, begin, pred,
+ __gnu_parallel::
+ adjacent_find_selector()).first;
+ else
+ return adjacent_find(begin, end, pred,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface
+ template<typename ForwardIterator, typename BinaryPredicate>
+ inline ForwardIterator
+ adjacent_find(ForwardIterator begin, ForwardIterator end,
+ BinaryPredicate pred)
+ {
+ typedef iterator_traits<ForwardIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return adjacent_find_switch(begin, end, pred, iterator_category());
+ }
+
+ // Sequential fallback
+ template<typename InputIterator, typename T>
+ inline typename iterator_traits<InputIterator>::difference_type
+ count(InputIterator begin, InputIterator end, const T& value,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::count(begin, end, value); }
+
+ // Parallel code for random access iterators
+ template<typename RandomAccessIterator, typename T>
+ typename iterator_traits<RandomAccessIterator>::difference_type
+ count_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ const T& value, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_unbalanced)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef __gnu_parallel::sequence_index_t sequence_index_t;
+
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().count_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ __gnu_parallel::count_selector<RandomAccessIterator, difference_type>
+ functionality;
+ difference_type res = 0;
+ __gnu_parallel::
+ for_each_template_random_access(begin, end, value,
+ functionality,
+ std::plus<sequence_index_t>(),
+ res, res, -1, parallelism_tag);
+ return res;
+ }
+ else
+ return count(begin, end, value, __gnu_parallel::sequential_tag());
+ }
+
+ // Sequential fallback for input iterator case.
+ template<typename InputIterator, typename T, typename IteratorTag>
+ inline typename iterator_traits<InputIterator>::difference_type
+ count_switch(InputIterator begin, InputIterator end, const T& value,
+ IteratorTag)
+ { return count(begin, end, value, __gnu_parallel::sequential_tag()); }
+
+ // Public interface.
+ template<typename InputIterator, typename T>
+ inline typename iterator_traits<InputIterator>::difference_type
+ count(InputIterator begin, InputIterator end, const T& value,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return count_switch(begin, end, value, iterator_category(),
+ parallelism_tag);
+ }
+
+ template<typename InputIterator, typename T>
+ inline typename iterator_traits<InputIterator>::difference_type
+ count(InputIterator begin, InputIterator end, const T& value)
+ {
+ typedef iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return count_switch(begin, end, value, iterator_category());
+ }
+
+
+ // Sequential fallback.
+ template<typename InputIterator, typename Predicate>
+ inline typename iterator_traits<InputIterator>::difference_type
+ count_if(InputIterator begin, InputIterator end, Predicate pred,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::count_if(begin, end, pred); }
+
+ // Parallel count_if for random access iterators
+ template<typename RandomAccessIterator, typename Predicate>
+ typename iterator_traits<RandomAccessIterator>::difference_type
+ count_if_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ Predicate pred, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_unbalanced)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef __gnu_parallel::sequence_index_t sequence_index_t;
+
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().count_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ difference_type res = 0;
+ __gnu_parallel::
+ count_if_selector<RandomAccessIterator, difference_type>
+ functionality;
+ __gnu_parallel::
+ for_each_template_random_access(begin, end, pred,
+ functionality,
+ std::plus<sequence_index_t>(),
+ res, res, -1, parallelism_tag);
+ return res;
+ }
+ else
+ return count_if(begin, end, pred, __gnu_parallel::sequential_tag());
+ }
+
+ // Sequential fallback for input iterator case.
+ template<typename InputIterator, typename Predicate, typename IteratorTag>
+ inline typename iterator_traits<InputIterator>::difference_type
+ count_if_switch(InputIterator begin, InputIterator end, Predicate pred,
+ IteratorTag)
+ { return count_if(begin, end, pred, __gnu_parallel::sequential_tag()); }
+
+ // Public interface.
+ template<typename InputIterator, typename Predicate>
+ inline typename iterator_traits<InputIterator>::difference_type
+ count_if(InputIterator begin, InputIterator end, Predicate pred,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return count_if_switch(begin, end, pred, iterator_category(),
+ parallelism_tag);
+ }
+
+ template<typename InputIterator, typename Predicate>
+ inline typename iterator_traits<InputIterator>::difference_type
+ count_if(InputIterator begin, InputIterator end, Predicate pred)
+ {
+ typedef iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return count_if_switch(begin, end, pred, iterator_category());
+ }
+
+
+ // Sequential fallback.
+ template<typename ForwardIterator1, typename ForwardIterator2>
+ inline ForwardIterator1
+ search(ForwardIterator1 begin1, ForwardIterator1 end1,
+ ForwardIterator2 begin2, ForwardIterator2 end2,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::search(begin1, end1, begin2, end2); }
+
+ // Parallel algorithm for random access iterator
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2>
+ RandomAccessIterator1
+ search_switch(RandomAccessIterator1 begin1, RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, RandomAccessIterator2 end2,
+ random_access_iterator_tag, random_access_iterator_tag)
+ {
+ typedef std::iterator_traits<RandomAccessIterator1> iterator1_traits;
+ typedef typename iterator1_traits::value_type value1_type;
+ typedef std::iterator_traits<RandomAccessIterator2> iterator2_traits;
+ typedef typename iterator2_traits::value_type value2_type;
+
+ if (_GLIBCXX_PARALLEL_CONDITION(true))
+ return __gnu_parallel::
+ search_template(begin1, end1, begin2, end2, __gnu_parallel::
+ equal_to<value1_type, value2_type>());
+ else
+ return search(begin1, end1, begin2, end2,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Sequential fallback for input iterator case
+ template<typename ForwardIterator1, typename ForwardIterator2,
+ typename IteratorTag1, typename IteratorTag2>
+ inline ForwardIterator1
+ search_switch(ForwardIterator1 begin1, ForwardIterator1 end1,
+ ForwardIterator2 begin2, ForwardIterator2 end2,
+ IteratorTag1, IteratorTag2)
+ { return search(begin1, end1, begin2, end2,
+ __gnu_parallel::sequential_tag()); }
+
+ // Public interface.
+ template<typename ForwardIterator1, typename ForwardIterator2>
+ inline ForwardIterator1
+ search(ForwardIterator1 begin1, ForwardIterator1 end1,
+ ForwardIterator2 begin2, ForwardIterator2 end2)
+ {
+ typedef std::iterator_traits<ForwardIterator1> iterator1_traits;
+ typedef typename iterator1_traits::iterator_category iterator1_category;
+ typedef std::iterator_traits<ForwardIterator2> iterator2_traits;
+ typedef typename iterator2_traits::iterator_category iterator2_category;
+
+ return search_switch(begin1, end1, begin2, end2,
+ iterator1_category(), iterator2_category());
+ }
+
+ // Public interface.
+ template<typename ForwardIterator1, typename ForwardIterator2,
+ typename BinaryPredicate>
+ inline ForwardIterator1
+ search(ForwardIterator1 begin1, ForwardIterator1 end1,
+ ForwardIterator2 begin2, ForwardIterator2 end2,
+ BinaryPredicate pred, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::search(begin1, end1, begin2, end2, pred); }
+
+ // Parallel algorithm for random access iterator.
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename BinaryPredicate>
+ RandomAccessIterator1
+ search_switch(RandomAccessIterator1 begin1, RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, RandomAccessIterator2 end2,
+ BinaryPredicate pred,
+ random_access_iterator_tag, random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(true))
+ return __gnu_parallel::search_template(begin1, end1,
+ begin2, end2, pred);
+ else
+ return search(begin1, end1, begin2, end2, pred,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Sequential fallback for input iterator case
+ template<typename ForwardIterator1, typename ForwardIterator2,
+ typename BinaryPredicate, typename IteratorTag1,
+ typename IteratorTag2>
+ inline ForwardIterator1
+ search_switch(ForwardIterator1 begin1, ForwardIterator1 end1,
+ ForwardIterator2 begin2, ForwardIterator2 end2,
+ BinaryPredicate pred, IteratorTag1, IteratorTag2)
+ { return search(begin1, end1, begin2, end2, pred,
+ __gnu_parallel::sequential_tag()); }
+
+ // Public interface
+ template<typename ForwardIterator1, typename ForwardIterator2,
+ typename BinaryPredicate>
+ inline ForwardIterator1
+ search(ForwardIterator1 begin1, ForwardIterator1 end1,
+ ForwardIterator2 begin2, ForwardIterator2 end2,
+ BinaryPredicate pred)
+ {
+ typedef std::iterator_traits<ForwardIterator1> iterator1_traits;
+ typedef typename iterator1_traits::iterator_category iterator1_category;
+ typedef std::iterator_traits<ForwardIterator2> iterator2_traits;
+ typedef typename iterator2_traits::iterator_category iterator2_category;
+ return search_switch(begin1, end1, begin2, end2, pred,
+ iterator1_category(), iterator2_category());
+ }
+
+ // Sequential fallback
+ template<typename ForwardIterator, typename Integer, typename T>
+ inline ForwardIterator
+ search_n(ForwardIterator begin, ForwardIterator end, Integer count,
+ const T& val, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::search_n(begin, end, count, val); }
+
+ // Sequential fallback
+ template<typename ForwardIterator, typename Integer, typename T,
+ typename BinaryPredicate>
+ inline ForwardIterator
+ search_n(ForwardIterator begin, ForwardIterator end, Integer count,
+ const T& val, BinaryPredicate binary_pred,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::search_n(begin, end, count, val, binary_pred); }
+
+ // Public interface.
+ template<typename ForwardIterator, typename Integer, typename T>
+ inline ForwardIterator
+ search_n(ForwardIterator begin, ForwardIterator end, Integer count,
+ const T& val)
+ {
+ typedef typename iterator_traits<ForwardIterator>::value_type value_type;
+ return search_n(begin, end, count, val,
+ __gnu_parallel::equal_to<value_type, T>());
+ }
+
+ // Parallel algorithm for random access iterators.
+ template<typename RandomAccessIterator, typename Integer,
+ typename T, typename BinaryPredicate>
+ RandomAccessIterator
+ search_n_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ Integer count, const T& val, BinaryPredicate binary_pred,
+ random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(true))
+ {
+ __gnu_parallel::pseudo_sequence<T, Integer> ps(val, count);
+ return __gnu_parallel::search_template(begin, end, ps.begin(),
+ ps.end(), binary_pred);
+ }
+ else
+ return std::__search_n(begin, end, count, val,
+ binary_pred, random_access_iterator_tag());
+ }
+
+ // Sequential fallback for input iterator case.
+ template<typename ForwardIterator, typename Integer, typename T,
+ typename BinaryPredicate, typename IteratorTag>
+ inline ForwardIterator
+ search_n_switch(ForwardIterator begin, ForwardIterator end, Integer count,
+ const T& val, BinaryPredicate binary_pred, IteratorTag)
+ { return __search_n(begin, end, count, val, binary_pred, IteratorTag()); }
+
+ // Public interface.
+ template<typename ForwardIterator, typename Integer, typename T,
+ typename BinaryPredicate>
+ inline ForwardIterator
+ search_n(ForwardIterator begin, ForwardIterator end, Integer count,
+ const T& val, BinaryPredicate binary_pred)
+ {
+ return search_n_switch(begin, end, count, val, binary_pred,
+ typename std::iterator_traits<ForwardIterator>::
+ iterator_category());
+ }
+
+
+ // Sequential fallback.
+ template<typename InputIterator, typename OutputIterator,
+ typename UnaryOperation>
+ inline OutputIterator
+ transform(InputIterator begin, InputIterator end, OutputIterator result,
+ UnaryOperation unary_op, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::transform(begin, end, result, unary_op); }
+
+ // Parallel unary transform for random access iterators.
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename UnaryOperation>
+ RandomAccessIterator2
+ transform1_switch(RandomAccessIterator1 begin, RandomAccessIterator1 end,
+ RandomAccessIterator2 result, UnaryOperation unary_op,
+ random_access_iterator_tag, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_balanced)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().transform_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ bool dummy = true;
+ typedef __gnu_parallel::iterator_pair<RandomAccessIterator1,
+ RandomAccessIterator2, random_access_iterator_tag> ip;
+ ip begin_pair(begin, result), end_pair(end, result + (end - begin));
+ __gnu_parallel::transform1_selector<ip> functionality;
+ __gnu_parallel::
+ for_each_template_random_access(begin_pair, end_pair,
+ unary_op, functionality,
+ __gnu_parallel::dummy_reduct(),
+ dummy, dummy, -1, parallelism_tag);
+ return functionality.finish_iterator;
+ }
+ else
+ return transform(begin, end, result, unary_op,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Sequential fallback for input iterator case.
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename UnaryOperation, typename IteratorTag1,
+ typename IteratorTag2>
+ inline RandomAccessIterator2
+ transform1_switch(RandomAccessIterator1 begin, RandomAccessIterator1 end,
+ RandomAccessIterator2 result, UnaryOperation unary_op,
+ IteratorTag1, IteratorTag2)
+ { return transform(begin, end, result, unary_op,
+ __gnu_parallel::sequential_tag()); }
+
+ // Public interface.
+ template<typename InputIterator, typename OutputIterator,
+ typename UnaryOperation>
+ inline OutputIterator
+ transform(InputIterator begin, InputIterator end, OutputIterator result,
+ UnaryOperation unary_op,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef std::iterator_traits<InputIterator> iteratori_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori_traits::iterator_category iteratori_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return transform1_switch(begin, end, result, unary_op,
+ iteratori_category(), iteratoro_category(),
+ parallelism_tag);
+ }
+
+ template<typename InputIterator, typename OutputIterator,
+ typename UnaryOperation>
+ inline OutputIterator
+ transform(InputIterator begin, InputIterator end, OutputIterator result,
+ UnaryOperation unary_op)
+ {
+ typedef std::iterator_traits<InputIterator> iteratori_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori_traits::iterator_category iteratori_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return transform1_switch(begin, end, result, unary_op,
+ iteratori_category(), iteratoro_category());
+ }
+
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename BinaryOperation>
+ inline OutputIterator
+ transform(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, OutputIterator result,
+ BinaryOperation binary_op, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::transform(begin1, end1,
+ begin2, result, binary_op); }
+
+ // Parallel binary transform for random access iterators.
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename RandomAccessIterator3, typename BinaryOperation>
+ RandomAccessIterator3
+ transform2_switch(RandomAccessIterator1 begin1, RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2,
+ RandomAccessIterator3 result, BinaryOperation binary_op,
+ random_access_iterator_tag, random_access_iterator_tag,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_balanced)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ (end1 - begin1) >=
+ __gnu_parallel::_Settings::get().transform_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ bool dummy = true;
+ typedef __gnu_parallel::iterator_triple<RandomAccessIterator1,
+ RandomAccessIterator2, RandomAccessIterator3,
+ random_access_iterator_tag> ip;
+ ip begin_triple(begin1, begin2, result),
+ end_triple(end1, begin2 + (end1 - begin1),
+ result + (end1 - begin1));
+ __gnu_parallel::transform2_selector<ip> functionality;
+ __gnu_parallel::
+ for_each_template_random_access(begin_triple, end_triple,
+ binary_op, functionality,
+ __gnu_parallel::dummy_reduct(),
+ dummy, dummy, -1,
+ parallelism_tag);
+ return functionality.finish_iterator;
+ }
+ else
+ return transform(begin1, end1, begin2, result, binary_op,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Sequential fallback for input iterator case.
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename BinaryOperation,
+ typename tag1, typename tag2, typename tag3>
+ inline OutputIterator
+ transform2_switch(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, OutputIterator result,
+ BinaryOperation binary_op, tag1, tag2, tag3)
+ { return transform(begin1, end1, begin2, result, binary_op,
+ __gnu_parallel::sequential_tag()); }
+
+ // Public interface.
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename BinaryOperation>
+ inline OutputIterator
+ transform(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, OutputIterator result,
+ BinaryOperation binary_op,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return transform2_switch(begin1, end1, begin2, result, binary_op,
+ iteratori1_category(), iteratori2_category(),
+ iteratoro_category(), parallelism_tag);
+ }
+
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename BinaryOperation>
+ inline OutputIterator
+ transform(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, OutputIterator result,
+ BinaryOperation binary_op)
+ {
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return transform2_switch(begin1, end1, begin2, result, binary_op,
+ iteratori1_category(), iteratori2_category(),
+ iteratoro_category());
+ }
+
+ // Sequential fallback
+ template<typename ForwardIterator, typename T>
+ inline void
+ replace(ForwardIterator begin, ForwardIterator end, const T& old_value,
+ const T& new_value, __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::replace(begin, end, old_value, new_value); }
+
+ // Sequential fallback for input iterator case
+ template<typename ForwardIterator, typename T, typename IteratorTag>
+ inline void
+ replace_switch(ForwardIterator begin, ForwardIterator end,
+ const T& old_value, const T& new_value, IteratorTag)
+ { replace(begin, end, old_value, new_value,
+ __gnu_parallel::sequential_tag()); }
+
+ // Parallel replace for random access iterators
+ template<typename RandomAccessIterator, typename T>
+ inline void
+ replace_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ const T& old_value, const T& new_value,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_balanced)
+ {
+ // XXX parallel version is where?
+ replace(begin, end, old_value, new_value,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface
+ template<typename ForwardIterator, typename T>
+ inline void
+ replace(ForwardIterator begin, ForwardIterator end, const T& old_value,
+ const T& new_value, __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef iterator_traits<ForwardIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ replace_switch(begin, end, old_value, new_value, iterator_category(),
+ parallelism_tag);
+ }
+
+ template<typename ForwardIterator, typename T>
+ inline void
+ replace(ForwardIterator begin, ForwardIterator end, const T& old_value,
+ const T& new_value)
+ {
+ typedef iterator_traits<ForwardIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ replace_switch(begin, end, old_value, new_value, iterator_category());
+ }
+
+
+ // Sequential fallback
+ template<typename ForwardIterator, typename Predicate, typename T>
+ inline void
+ replace_if(ForwardIterator begin, ForwardIterator end, Predicate pred,
+ const T& new_value, __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::replace_if(begin, end, pred, new_value); }
+
+ // Sequential fallback for input iterator case
+ template<typename ForwardIterator, typename Predicate, typename T,
+ typename IteratorTag>
+ inline void
+ replace_if_switch(ForwardIterator begin, ForwardIterator end,
+ Predicate pred, const T& new_value, IteratorTag)
+ { replace_if(begin, end, pred, new_value,
+ __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators.
+ template<typename RandomAccessIterator, typename Predicate, typename T>
+ void
+ replace_if_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ Predicate pred, const T& new_value,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_balanced)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().replace_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ bool dummy;
+ __gnu_parallel::
+ replace_if_selector<RandomAccessIterator, Predicate, T>
+ functionality(new_value);
+ __gnu_parallel::
+ for_each_template_random_access(begin, end, pred,
+ functionality,
+ __gnu_parallel::dummy_reduct(),
+ true, dummy, -1, parallelism_tag);
+ }
+ else
+ replace_if(begin, end, pred, new_value,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface.
+ template<typename ForwardIterator, typename Predicate, typename T>
+ inline void
+ replace_if(ForwardIterator begin, ForwardIterator end,
+ Predicate pred, const T& new_value,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef std::iterator_traits<ForwardIterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ replace_if_switch(begin, end, pred, new_value, iterator_category(),
+ parallelism_tag);
+ }
+
+ template<typename ForwardIterator, typename Predicate, typename T>
+ inline void
+ replace_if(ForwardIterator begin, ForwardIterator end,
+ Predicate pred, const T& new_value)
+ {
+ typedef std::iterator_traits<ForwardIterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ replace_if_switch(begin, end, pred, new_value, iterator_category());
+ }
+
+ // Sequential fallback
+ template<typename ForwardIterator, typename Generator>
+ inline void
+ generate(ForwardIterator begin, ForwardIterator end, Generator gen,
+ __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::generate(begin, end, gen); }
+
+ // Sequential fallback for input iterator case.
+ template<typename ForwardIterator, typename Generator, typename IteratorTag>
+ inline void
+ generate_switch(ForwardIterator begin, ForwardIterator end, Generator gen,
+ IteratorTag)
+ { generate(begin, end, gen, __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators.
+ template<typename RandomAccessIterator, typename Generator>
+ void
+ generate_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ Generator gen, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_balanced)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().generate_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ bool dummy;
+ __gnu_parallel::generate_selector<RandomAccessIterator>
+ functionality;
+ __gnu_parallel::
+ for_each_template_random_access(begin, end, gen, functionality,
+ __gnu_parallel::dummy_reduct(),
+ true, dummy, -1, parallelism_tag);
+ }
+ else
+ generate(begin, end, gen, __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface.
+ template<typename ForwardIterator, typename Generator>
+ inline void
+ generate(ForwardIterator begin, ForwardIterator end,
+ Generator gen, __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef std::iterator_traits<ForwardIterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ generate_switch(begin, end, gen, iterator_category(), parallelism_tag);
+ }
+
+ template<typename ForwardIterator, typename Generator>
+ inline void
+ generate(ForwardIterator begin, ForwardIterator end, Generator gen)
+ {
+ typedef std::iterator_traits<ForwardIterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ generate_switch(begin, end, gen, iterator_category());
+ }
+
+
+ // Sequential fallback.
+ template<typename OutputIterator, typename Size, typename Generator>
+ inline OutputIterator
+ generate_n(OutputIterator begin, Size n, Generator gen,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::generate_n(begin, n, gen); }
+
+ // Sequential fallback for input iterator case.
+ template<typename OutputIterator, typename Size, typename Generator,
+ typename IteratorTag>
+ inline OutputIterator
+ generate_n_switch(OutputIterator begin, Size n, Generator gen, IteratorTag)
+ { return generate_n(begin, n, gen, __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators.
+ template<typename RandomAccessIterator, typename Size, typename Generator>
+ inline RandomAccessIterator
+ generate_n_switch(RandomAccessIterator begin, Size n, Generator gen,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_balanced)
+ {
+ // XXX parallel version is where?
+ return generate_n(begin, n, gen, __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface.
+ template<typename OutputIterator, typename Size, typename Generator>
+ inline OutputIterator
+ generate_n(OutputIterator begin, Size n, Generator gen,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef std::iterator_traits<OutputIterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ return generate_n_switch(begin, n, gen, iterator_category(),
+ parallelism_tag);
+ }
+
+ template<typename OutputIterator, typename Size, typename Generator>
+ inline OutputIterator
+ generate_n(OutputIterator begin, Size n, Generator gen)
+ {
+ typedef std::iterator_traits<OutputIterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ return generate_n_switch(begin, n, gen, iterator_category());
+ }
+
+
+ // Sequential fallback.
+ template<typename RandomAccessIterator>
+ inline void
+ random_shuffle(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::random_shuffle(begin, end); }
+
+ // Sequential fallback.
+ template<typename RandomAccessIterator, typename RandomNumberGenerator>
+ inline void
+ random_shuffle(RandomAccessIterator begin, RandomAccessIterator end,
+ RandomNumberGenerator& rand, __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::random_shuffle(begin, end, rand); }
+
+
+ /** @brief Functor wrapper for std::rand(). */
+ template<typename must_be_int = int>
+ struct c_rand_number
+ {
+ int
+ operator()(int limit)
+ { return rand() % limit; }
+ };
+
+ // Fill in random number generator.
+ template<typename RandomAccessIterator>
+ inline void
+ random_shuffle(RandomAccessIterator begin, RandomAccessIterator end)
+ {
+ c_rand_number<> r;
+ // Parallelization still possible.
+ __gnu_parallel::random_shuffle(begin, end, r);
+ }
+
+ // Parallel algorithm for random access iterators.
+ template<typename RandomAccessIterator, typename RandomNumberGenerator>
+ void
+ random_shuffle(RandomAccessIterator begin, RandomAccessIterator end,
+ RandomNumberGenerator& rand)
+ {
+ if (begin == end)
+ return;
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().random_shuffle_minimal_n))
+ __gnu_parallel::parallel_random_shuffle(begin, end, rand);
+ else
+ __gnu_parallel::sequential_random_shuffle(begin, end, rand);
+ }
+
+ // Sequential fallback.
+ template<typename ForwardIterator, typename Predicate>
+ inline ForwardIterator
+ partition(ForwardIterator begin, ForwardIterator end,
+ Predicate pred, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::partition(begin, end, pred); }
+
+ // Sequential fallback for input iterator case.
+ template<typename ForwardIterator, typename Predicate, typename IteratorTag>
+ inline ForwardIterator
+ partition_switch(ForwardIterator begin, ForwardIterator end,
+ Predicate pred, IteratorTag)
+ { return partition(begin, end, pred, __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators.
+ template<typename RandomAccessIterator, typename Predicate>
+ RandomAccessIterator
+ partition_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ Predicate pred, random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().partition_minimal_n))
+ {
+ typedef typename std::iterator_traits<RandomAccessIterator>::
+ difference_type difference_type;
+ difference_type middle = __gnu_parallel::
+ parallel_partition(begin, end, pred,
+ __gnu_parallel::get_max_threads());
+ return begin + middle;
+ }
+ else
+ return partition(begin, end, pred, __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface.
+ template<typename ForwardIterator, typename Predicate>
+ inline ForwardIterator
+ partition(ForwardIterator begin, ForwardIterator end, Predicate pred)
+ {
+ typedef iterator_traits<ForwardIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return partition_switch(begin, end, pred, iterator_category());
+ }
+
+ // sort interface
+
+ // Sequential fallback
+ template<typename RandomAccessIterator>
+ inline void
+ sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::sort(begin, end); }
+
+ // Sequential fallback
+ template<typename RandomAccessIterator, typename Comparator>
+ inline void
+ sort(RandomAccessIterator begin, RandomAccessIterator end, Comparator comp,
+ __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::sort<RandomAccessIterator, Comparator>(begin, end,
+ comp); }
+
+ // Public interface
+ template<typename RandomAccessIterator, typename Comparator,
+ typename Parallelism>
+ void
+ sort(RandomAccessIterator begin, RandomAccessIterator end, Comparator comp,
+ Parallelism parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+
+ if (begin != end)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin) >=
+ __gnu_parallel::_Settings::get().sort_minimal_n))
+ __gnu_parallel::parallel_sort<false>(begin, end, comp, parallelism);
+ else
+ sort(begin, end, comp, __gnu_parallel::sequential_tag());
+ }
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ sort(RandomAccessIterator begin, RandomAccessIterator end)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ sort(begin, end, std::less<value_type>(),
+ __gnu_parallel::default_parallel_tag());
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::default_parallel_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::parallel_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::multiway_mergesort_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::multiway_mergesort_sampling_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::multiway_mergesort_exact_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::quicksort_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::balanced_quicksort_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface
+ template<typename RandomAccessIterator, typename Comparator>
+ void
+ sort(RandomAccessIterator begin, RandomAccessIterator end, Comparator comp)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ sort(begin, end, comp, __gnu_parallel::default_parallel_tag());
+ }
+
+
+ // stable_sort interface
+
+
+ // Sequential fallback
+ template<typename RandomAccessIterator>
+ inline void
+ stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::stable_sort(begin, end); }
+
+ // Sequential fallback
+ template<typename RandomAccessIterator, typename Comparator>
+ inline void
+ stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::stable_sort<RandomAccessIterator, Comparator>(
+ begin, end, comp); }
+
+ // Public interface
+ template<typename RandomAccessIterator, typename Comparator,
+ typename Parallelism>
+ void
+ stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, Parallelism parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+
+ if (begin != end)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin) >=
+ __gnu_parallel::_Settings::get().sort_minimal_n))
+ __gnu_parallel::parallel_sort<true>(begin, end, comp, parallelism);
+ else
+ stable_sort(begin, end, comp, __gnu_parallel::sequential_tag());
+ }
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ stable_sort(RandomAccessIterator begin, RandomAccessIterator end)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ stable_sort(begin, end, std::less<value_type>(),
+ __gnu_parallel::default_parallel_tag());
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::default_parallel_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ stable_sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::parallel_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ stable_sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::multiway_mergesort_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ stable_sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::quicksort_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ stable_sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ __gnu_parallel::balanced_quicksort_tag parallelism)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ stable_sort(begin, end, std::less<value_type>(), parallelism);
+ }
+
+ // Public interface
+ template<typename RandomAccessIterator, typename Comparator>
+ void
+ stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ stable_sort(begin, end, comp, __gnu_parallel::default_parallel_tag());
+ }
+
+
+// // Sequential fallback
+// template<typename RandomAccessIterator>
+// inline void
+// stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+// __gnu_parallel::sequential_tag)
+// { return _GLIBCXX_STD_P::stable_sort(begin, end); }
+//
+// // Sequential fallback
+// template<typename RandomAccessIterator, typename Comparator>
+// inline void
+// stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+// Comparator comp, __gnu_parallel::sequential_tag)
+// { return _GLIBCXX_STD_P::stable_sort(begin, end, comp); }
+//
+// template<typename RandomAccessIterator>
+// void
+// stable_sort(RandomAccessIterator begin, RandomAccessIterator end)
+// {
+// typedef iterator_traits<RandomAccessIterator> traits_type;
+// typedef typename traits_type::value_type value_type;
+// stable_sort(begin, end, std::less<value_type>());
+// }
+//
+// // Parallel algorithm for random access iterators
+// template<typename RandomAccessIterator, typename Comparator>
+// void
+// stable_sort(RandomAccessIterator begin, RandomAccessIterator end,
+// Comparator comp)
+// {
+// if (begin != end)
+// {
+// if (_GLIBCXX_PARALLEL_CONDITION(
+// static_cast<__gnu_parallel::sequence_index_t>(end - begin) >=
+// __gnu_parallel::_Settings::get().sort_minimal_n))
+// __gnu_parallel::parallel_sort(begin, end, comp,
+// __gnu_parallel::parallel_tag());
+// else
+// stable_sort(begin, end, comp, __gnu_parallel::sequential_tag());
+// }
+// }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator>
+ inline OutputIterator
+ merge(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ InputIterator2 end2, OutputIterator result,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::merge(begin1, end1, begin2, end2, result); }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Comparator>
+ inline OutputIterator
+ merge(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ InputIterator2 end2, OutputIterator result, Comparator comp,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::merge(begin1, end1, begin2, end2, result, comp); }
+
+ // Sequential fallback for input iterator case
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Comparator,
+ typename IteratorTag1, typename IteratorTag2, typename IteratorTag3>
+ inline OutputIterator
+ merge_switch(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator result, Comparator comp,
+ IteratorTag1, IteratorTag2, IteratorTag3)
+ { return _GLIBCXX_STD_P::merge(begin1, end1, begin2, end2,
+ result, comp); }
+
+ // Parallel algorithm for random access iterators
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Comparator>
+ OutputIterator
+ merge_switch(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ OutputIterator result, Comparator comp,
+ random_access_iterator_tag, random_access_iterator_tag,
+ random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ (static_cast<__gnu_parallel::sequence_index_t>(end1 - begin1)
+ >= __gnu_parallel::_Settings::get().merge_minimal_n
+ || static_cast<__gnu_parallel::sequence_index_t>(end2 - begin2)
+ >= __gnu_parallel::_Settings::get().merge_minimal_n)))
+ return __gnu_parallel::parallel_merge_advance(begin1, end1,
+ begin2, end2,
+ result, (end1 - begin1)
+ + (end2 - begin2), comp);
+ else
+ return __gnu_parallel::merge_advance(begin1, end1, begin2, end2,
+ result, (end1 - begin1)
+ + (end2 - begin2), comp);
+ }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator, typename Comparator>
+ inline OutputIterator
+ merge(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ InputIterator2 end2, OutputIterator result, Comparator comp)
+ {
+ typedef typename iterator_traits<InputIterator1>::value_type value_type;
+
+ typedef std::iterator_traits<InputIterator1> iteratori1_traits;
+ typedef std::iterator_traits<InputIterator2> iteratori2_traits;
+ typedef std::iterator_traits<OutputIterator> iteratoro_traits;
+ typedef typename iteratori1_traits::iterator_category
+ iteratori1_category;
+ typedef typename iteratori2_traits::iterator_category
+ iteratori2_category;
+ typedef typename iteratoro_traits::iterator_category iteratoro_category;
+
+ return merge_switch(begin1, end1, begin2, end2, result, comp,
+ iteratori1_category(), iteratori2_category(),
+ iteratoro_category());
+ }
+
+
+ // Public interface, insert default comparator
+ template<typename InputIterator1, typename InputIterator2,
+ typename OutputIterator>
+ inline OutputIterator
+ merge(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ InputIterator2 end2, OutputIterator result)
+ {
+ typedef std::iterator_traits<InputIterator1> iterator1_traits;
+ typedef std::iterator_traits<InputIterator2> iterator2_traits;
+ typedef typename iterator1_traits::value_type value1_type;
+ typedef typename iterator2_traits::value_type value2_type;
+
+ return merge(begin1, end1, begin2, end2, result,
+ __gnu_parallel::less<value1_type, value2_type>());
+ }
+
+ // Sequential fallback
+ template<typename RandomAccessIterator>
+ inline void
+ nth_element(RandomAccessIterator begin, RandomAccessIterator nth,
+ RandomAccessIterator end, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::nth_element(begin, nth, end); }
+
+ // Sequential fallback
+ template<typename RandomAccessIterator, typename Comparator>
+ inline void
+ nth_element(RandomAccessIterator begin, RandomAccessIterator nth,
+ RandomAccessIterator end, Comparator comp,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::nth_element(begin, nth, end, comp); }
+
+ // Public interface
+ template<typename RandomAccessIterator, typename Comparator>
+ inline void
+ nth_element(RandomAccessIterator begin, RandomAccessIterator nth,
+ RandomAccessIterator end, Comparator comp)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().nth_element_minimal_n))
+ __gnu_parallel::parallel_nth_element(begin, nth, end, comp);
+ else
+ nth_element(begin, nth, end, comp, __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ nth_element(RandomAccessIterator begin, RandomAccessIterator nth,
+ RandomAccessIterator end)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ nth_element(begin, nth, end, std::less<value_type>());
+ }
+
+ // Sequential fallback
+ template<typename RandomAccessIterator, typename _Compare>
+ inline void
+ partial_sort(RandomAccessIterator begin, RandomAccessIterator middle,
+ RandomAccessIterator end, _Compare comp,
+ __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::partial_sort(begin, middle, end, comp); }
+
+ // Sequential fallback
+ template<typename RandomAccessIterator>
+ inline void
+ partial_sort(RandomAccessIterator begin, RandomAccessIterator middle,
+ RandomAccessIterator end, __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::partial_sort(begin, middle, end); }
+
+ // Public interface, parallel algorithm for random access iterators
+ template<typename RandomAccessIterator, typename _Compare>
+ void
+ partial_sort(RandomAccessIterator begin, RandomAccessIterator middle,
+ RandomAccessIterator end, _Compare comp)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().partial_sort_minimal_n))
+ __gnu_parallel::parallel_partial_sort(begin, middle, end, comp);
+ else
+ partial_sort(begin, middle, end, comp,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface, insert default comparator
+ template<typename RandomAccessIterator>
+ inline void
+ partial_sort(RandomAccessIterator begin, RandomAccessIterator middle,
+ RandomAccessIterator end)
+ {
+ typedef iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ partial_sort(begin, middle, end, std::less<value_type>());
+ }
+
+ // Sequential fallback
+ template<typename ForwardIterator>
+ inline ForwardIterator
+ max_element(ForwardIterator begin, ForwardIterator end,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::max_element(begin, end); }
+
+ // Sequential fallback
+ template<typename ForwardIterator, typename Comparator>
+ inline ForwardIterator
+ max_element(ForwardIterator begin, ForwardIterator end, Comparator comp,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::max_element(begin, end, comp); }
+
+ // Sequential fallback for input iterator case
+ template<typename ForwardIterator, typename Comparator, typename IteratorTag>
+ inline ForwardIterator
+ max_element_switch(ForwardIterator begin, ForwardIterator end,
+ Comparator comp, IteratorTag)
+ { return max_element(begin, end, comp, __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators
+ template<typename RandomAccessIterator, typename Comparator>
+ RandomAccessIterator
+ max_element_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_balanced)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().max_element_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ RandomAccessIterator res(begin);
+ __gnu_parallel::identity_selector<RandomAccessIterator>
+ functionality;
+ __gnu_parallel::
+ for_each_template_random_access(begin, end,
+ __gnu_parallel::nothing(),
+ functionality,
+ __gnu_parallel::
+ max_element_reduct<Comparator,
+ RandomAccessIterator>(comp),
+ res, res, -1, parallelism_tag);
+ return res;
+ }
+ else
+ return max_element(begin, end, comp, __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface, insert default comparator
+ template<typename ForwardIterator>
+ inline ForwardIterator
+ max_element(ForwardIterator begin, ForwardIterator end,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef typename iterator_traits<ForwardIterator>::value_type value_type;
+ return max_element(begin, end, std::less<value_type>(), parallelism_tag);
+ }
+
+ template<typename ForwardIterator>
+ inline ForwardIterator
+ max_element(ForwardIterator begin, ForwardIterator end)
+ {
+ typedef typename iterator_traits<ForwardIterator>::value_type value_type;
+ return max_element(begin, end, std::less<value_type>());
+ }
+
+ // Public interface
+ template<typename ForwardIterator, typename Comparator>
+ inline ForwardIterator
+ max_element(ForwardIterator begin, ForwardIterator end, Comparator comp,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef iterator_traits<ForwardIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return max_element_switch(begin, end, comp, iterator_category(),
+ parallelism_tag);
+ }
+
+ template<typename ForwardIterator, typename Comparator>
+ inline ForwardIterator
+ max_element(ForwardIterator begin, ForwardIterator end, Comparator comp)
+ {
+ typedef iterator_traits<ForwardIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return max_element_switch(begin, end, comp, iterator_category());
+ }
+
+
+ // Sequential fallback
+ template<typename ForwardIterator>
+ inline ForwardIterator
+ min_element(ForwardIterator begin, ForwardIterator end,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::min_element(begin, end); }
+
+ // Sequential fallback
+ template<typename ForwardIterator, typename Comparator>
+ inline ForwardIterator
+ min_element(ForwardIterator begin, ForwardIterator end, Comparator comp,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::min_element(begin, end, comp); }
+
+ // Sequential fallback for input iterator case
+ template<typename ForwardIterator, typename Comparator, typename IteratorTag>
+ inline ForwardIterator
+ min_element_switch(ForwardIterator begin, ForwardIterator end,
+ Comparator comp, IteratorTag)
+ { return min_element(begin, end, comp, __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators
+ template<typename RandomAccessIterator, typename Comparator>
+ RandomAccessIterator
+ min_element_switch(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_balanced)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().min_element_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ RandomAccessIterator res(begin);
+ __gnu_parallel::identity_selector<RandomAccessIterator>
+ functionality;
+ __gnu_parallel::
+ for_each_template_random_access(begin, end,
+ __gnu_parallel::nothing(),
+ functionality,
+ __gnu_parallel::
+ min_element_reduct<Comparator,
+ RandomAccessIterator>(comp),
+ res, res, -1, parallelism_tag);
+ return res;
+ }
+ else
+ return min_element(begin, end, comp, __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface, insert default comparator
+ template<typename ForwardIterator>
+ inline ForwardIterator
+ min_element(ForwardIterator begin, ForwardIterator end,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef typename iterator_traits<ForwardIterator>::value_type value_type;
+ return min_element(begin, end, std::less<value_type>(), parallelism_tag);
+ }
+
+ template<typename ForwardIterator>
+ inline ForwardIterator
+ min_element(ForwardIterator begin, ForwardIterator end)
+ {
+ typedef typename iterator_traits<ForwardIterator>::value_type value_type;
+ return min_element(begin, end, std::less<value_type>());
+ }
+
+ // Public interface
+ template<typename ForwardIterator, typename Comparator>
+ inline ForwardIterator
+ min_element(ForwardIterator begin, ForwardIterator end, Comparator comp,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef iterator_traits<ForwardIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return min_element_switch(begin, end, comp, iterator_category(),
+ parallelism_tag);
+ }
+
+ template<typename ForwardIterator, typename Comparator>
+ inline ForwardIterator
+ min_element(ForwardIterator begin, ForwardIterator end, Comparator comp)
+ {
+ typedef iterator_traits<ForwardIterator> traits_type;
+ typedef typename traits_type::iterator_category iterator_category;
+ return min_element_switch(begin, end, comp, iterator_category());
+ }
+} // end namespace
+} // end namespace
+
+#endif /* _GLIBCXX_PARALLEL_ALGO_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/algobase.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/algobase.h
new file mode 100644
index 0000000..aaffb3e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/algobase.h
@@ -0,0 +1,281 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/algobase.h
+ * @brief Parallel STL function calls corresponding to the
+ * stl_algobase.h header. The functions defined here mainly do case
+ * switches and call the actual parallelized versions in other files.
+ * Inlining policy: Functions that basically only contain one
+ * function call, are declared inline.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler and Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_ALGOBASE_H
+#define _GLIBCXX_PARALLEL_ALGOBASE_H 1
+
+#include <bits/stl_algobase.h>
+#include <parallel/base.h>
+#include <parallel/tags.h>
+#include <parallel/settings.h>
+#include <parallel/find.h>
+#include <parallel/find_selectors.h>
+
+namespace std
+{
+namespace __parallel
+{
+ // NB: equal and lexicographical_compare require mismatch.
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2>
+ inline pair<InputIterator1, InputIterator2>
+ mismatch(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::mismatch(begin1, end1, begin2); }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate>
+ inline pair<InputIterator1, InputIterator2>
+ mismatch(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ Predicate pred, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::mismatch(begin1, end1, begin2, pred); }
+
+ // Sequential fallback for input iterator case
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate, typename IteratorTag1, typename IteratorTag2>
+ inline pair<InputIterator1, InputIterator2>
+ mismatch_switch(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, Predicate pred, IteratorTag1,
+ IteratorTag2)
+ { return _GLIBCXX_STD_P::mismatch(begin1, end1, begin2, pred); }
+
+ // Parallel mismatch for random access iterators
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename Predicate>
+ pair<RandomAccessIterator1, RandomAccessIterator2>
+ mismatch_switch(RandomAccessIterator1 begin1, RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, Predicate pred,
+ random_access_iterator_tag, random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(true))
+ {
+ RandomAccessIterator1 res =
+ __gnu_parallel::find_template(begin1, end1, begin2, pred,
+ __gnu_parallel::
+ mismatch_selector()).first;
+ return make_pair(res , begin2 + (res - begin1));
+ }
+ else
+ return _GLIBCXX_STD_P::mismatch(begin1, end1, begin2, pred);
+ }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2>
+ inline pair<InputIterator1, InputIterator2>
+ mismatch(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2)
+ {
+ typedef std::iterator_traits<InputIterator1> iterator1_traits;
+ typedef std::iterator_traits<InputIterator2> iterator2_traits;
+ typedef typename iterator1_traits::value_type value1_type;
+ typedef typename iterator2_traits::value_type value2_type;
+ typedef typename iterator1_traits::iterator_category iterator1_category;
+ typedef typename iterator2_traits::iterator_category iterator2_category;
+
+ typedef __gnu_parallel::equal_to<value1_type, value2_type> equal_to_type;
+
+ return mismatch_switch(begin1, end1, begin2, equal_to_type(),
+ iterator1_category(), iterator2_category());
+ }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate>
+ inline pair<InputIterator1, InputIterator2>
+ mismatch(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ Predicate pred)
+ {
+ typedef std::iterator_traits<InputIterator1> iterator1_traits;
+ typedef std::iterator_traits<InputIterator2> iterator2_traits;
+ typedef typename iterator1_traits::iterator_category iterator1_category;
+ typedef typename iterator2_traits::iterator_category iterator2_category;
+
+ return mismatch_switch(begin1, end1, begin2, pred, iterator1_category(),
+ iterator2_category());
+ }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2>
+ inline bool
+ equal(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::equal(begin1, end1, begin2); }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate>
+ inline bool
+ equal(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ Predicate pred, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::equal(begin1, end1, begin2, pred); }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2>
+ inline bool
+ equal(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2)
+ { return mismatch(begin1, end1, begin2).first == end1; }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate>
+ inline bool
+ equal(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ Predicate pred)
+ { return mismatch(begin1, end1, begin2, pred).first == end1; }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2>
+ inline bool
+ lexicographical_compare(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::lexicographical_compare(begin1, end1,
+ begin2, end2); }
+
+ // Sequential fallback
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate>
+ inline bool
+ lexicographical_compare(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ Predicate pred, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::lexicographical_compare(begin1, end1,
+ begin2, end2, pred); }
+
+ // Sequential fallback for input iterator case
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate, typename IteratorTag1, typename IteratorTag2>
+ inline bool
+ lexicographical_compare_switch(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ Predicate pred, IteratorTag1, IteratorTag2)
+ { return _GLIBCXX_STD_P::lexicographical_compare(begin1, end1,
+ begin2, end2, pred); }
+
+ // Parallel lexicographical_compare for random access iterators
+ // Limitation: Both valuetypes must be the same
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename Predicate>
+ bool
+ lexicographical_compare_switch(RandomAccessIterator1 begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2,
+ RandomAccessIterator2 end2, Predicate pred,
+ random_access_iterator_tag,
+ random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(true))
+ {
+ typedef iterator_traits<RandomAccessIterator1> traits1_type;
+ typedef typename traits1_type::value_type value1_type;
+
+ typedef iterator_traits<RandomAccessIterator2> traits2_type;
+ typedef typename traits2_type::value_type value2_type;
+
+ typedef __gnu_parallel::equal_from_less<Predicate, value1_type,
+ value2_type> equal_type;
+
+ // Longer sequence in first place.
+ if ((end1 - begin1) < (end2 - begin2))
+ {
+ typedef pair<RandomAccessIterator1, RandomAccessIterator2>
+ pair_type;
+ pair_type mm = mismatch_switch(begin1, end1, begin2,
+ equal_type(pred),
+ random_access_iterator_tag(),
+ random_access_iterator_tag());
+
+ return (mm.first == end1) || bool(pred(*mm.first, *mm.second));
+ }
+ else
+ {
+ typedef pair<RandomAccessIterator2, RandomAccessIterator1>
+ pair_type;
+ pair_type mm = mismatch_switch(begin2, end2, begin1,
+ equal_type(pred),
+ random_access_iterator_tag(),
+ random_access_iterator_tag());
+
+ return (mm.first != end2) && bool(pred(*mm.second, *mm.first));
+ }
+ }
+ else
+ return _GLIBCXX_STD_P::lexicographical_compare(begin1, end1,
+ begin2, end2, pred);
+ }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2>
+ inline bool
+ lexicographical_compare(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2)
+ {
+ typedef iterator_traits<InputIterator1> traits1_type;
+ typedef typename traits1_type::value_type value1_type;
+ typedef typename traits1_type::iterator_category iterator1_category;
+
+ typedef iterator_traits<InputIterator2> traits2_type;
+ typedef typename traits2_type::value_type value2_type;
+ typedef typename traits2_type::iterator_category iterator2_category;
+ typedef __gnu_parallel::less<value1_type, value2_type> less_type;
+
+ return lexicographical_compare_switch(begin1, end1, begin2, end2,
+ less_type(), iterator1_category(),
+ iterator2_category());
+ }
+
+ // Public interface
+ template<typename InputIterator1, typename InputIterator2,
+ typename Predicate>
+ inline bool
+ lexicographical_compare(InputIterator1 begin1, InputIterator1 end1,
+ InputIterator2 begin2, InputIterator2 end2,
+ Predicate pred)
+ {
+ typedef iterator_traits<InputIterator1> traits1_type;
+ typedef typename traits1_type::iterator_category iterator1_category;
+
+ typedef iterator_traits<InputIterator2> traits2_type;
+ typedef typename traits2_type::iterator_category iterator2_category;
+
+ return lexicographical_compare_switch(begin1, end1, begin2, end2, pred,
+ iterator1_category(),
+ iterator2_category());
+ }
+} // end namespace
+} // end namespace
+
+#endif /* _GLIBCXX_PARALLEL_ALGOBASE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/algorithm b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/algorithm
new file mode 100644
index 0000000..3c93d5b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/algorithm
@@ -0,0 +1,40 @@
+// Algorithm extensions -*- C++ -*-
+
+// Copyright (C) 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/algorithm
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _PARALLEL_ALGORITHM
+#define _PARALLEL_ALGORITHM 1
+
+#pragma GCC system_header
+
+#include <algorithm>
+#include <parallel/algorithmfwd.h>
+#include <parallel/algobase.h>
+#include <parallel/algo.h>
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/algorithmfwd.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/algorithmfwd.h
new file mode 100644
index 0000000..7c3b3f2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/algorithmfwd.h
@@ -0,0 +1,898 @@
+// <algorithm> parallel extensions -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/algorithmfwd.h
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_PARALLEL_ALGORITHMFWD_H
+#define _GLIBCXX_PARALLEL_ALGORITHMFWD_H 1
+
+#pragma GCC system_header
+
+#include <parallel/tags.h>
+#include <parallel/settings.h>
+
+namespace std
+{
+namespace __parallel
+{
+ template<typename _FIter>
+ _FIter
+ adjacent_find(_FIter, _FIter);
+
+ template<typename _FIter>
+ _FIter
+ adjacent_find(_FIter, _FIter, __gnu_parallel::sequential_tag);
+
+ template<typename _FIter, typename _IterTag>
+ _FIter
+ adjacent_find_switch(_FIter, _FIter, _IterTag);
+
+ template<typename _RAIter>
+ _RAIter
+ adjacent_find_switch(_RAIter, _RAIter, random_access_iterator_tag);
+
+
+ template<typename _FIter, typename _BiPredicate>
+ _FIter
+ adjacent_find(_FIter, _FIter, _BiPredicate);
+
+ template<typename _FIter, typename _BiPredicate>
+ _FIter
+ adjacent_find(_FIter, _FIter, _BiPredicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _FIter, typename _BiPredicate, typename _IterTag>
+ _FIter
+ adjacent_find_switch(_FIter, _FIter, _BiPredicate, _IterTag);
+
+ template<typename _RAIter, typename _BiPredicate>
+ _RAIter
+ adjacent_find_switch(_RAIter, _RAIter, _BiPredicate,
+ random_access_iterator_tag);
+
+
+ template<typename _IIter, typename _Tp>
+ typename iterator_traits<_IIter>::difference_type
+ count(_IIter, _IIter, const _Tp&);
+
+ template<typename _IIter, typename _Tp>
+ typename iterator_traits<_IIter>::difference_type
+ count(_IIter, _IIter, const _Tp&, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _Tp>
+ typename iterator_traits<_IIter>::difference_type
+ count(_IIter, _IIter, const _Tp&, __gnu_parallel::_Parallelism);
+
+ template<typename _IIter, typename _Tp, typename _IterTag>
+ typename iterator_traits<_IIter>::difference_type
+ count_switch(_IIter, _IIter, const _Tp&, _IterTag);
+
+ template<typename _RAIter, typename _Tp>
+ typename iterator_traits<_RAIter>::difference_type
+ count_switch(_RAIter, _RAIter, const _Tp&, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_unbalanced);
+
+
+ template<typename _IIter, typename _Predicate>
+ typename iterator_traits<_IIter>::difference_type
+ count_if(_IIter, _IIter, _Predicate);
+
+ template<typename _IIter, typename _Predicate>
+ typename iterator_traits<_IIter>::difference_type
+ count_if(_IIter, _IIter, _Predicate, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _Predicate>
+ typename iterator_traits<_IIter>::difference_type
+ count_if(_IIter, _IIter, _Predicate, __gnu_parallel::_Parallelism);
+
+ template<typename _IIter, typename _Predicate, typename _IterTag>
+ typename iterator_traits<_IIter>::difference_type
+ count_if_switch(_IIter, _IIter, _Predicate, _IterTag);
+
+ template<typename _RAIter, typename _Predicate>
+ typename iterator_traits<_RAIter>::difference_type
+ count_if_switch(_RAIter, _RAIter, _Predicate, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_unbalanced);
+
+ // algobase.h
+ template<typename _IIter1, typename _IIter2>
+ bool
+ equal(_IIter1, _IIter1, _IIter2, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename Predicate>
+ bool
+ equal(_IIter1, _IIter1, _IIter2, Predicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2>
+ bool
+ equal(_IIter1, _IIter1, _IIter2);
+
+ template<typename _IIter1, typename _IIter2, typename Predicate>
+ bool
+ equal(_IIter1, _IIter1, _IIter2, Predicate);
+
+ template<typename _IIter, typename _Tp>
+ _IIter
+ find(_IIter, _IIter, const _Tp&, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _Tp>
+ _IIter
+ find(_IIter, _IIter, const _Tp& val);
+
+ template<typename _IIter, typename _Tp, typename _IterTag>
+ _IIter
+ find_switch(_IIter, _IIter, const _Tp&, _IterTag);
+
+ template<typename _RAIter, typename _Tp>
+ _RAIter
+ find_switch(_RAIter, _RAIter, const _Tp&, random_access_iterator_tag);
+
+ template<typename _IIter, typename _Predicate>
+ _IIter
+ find_if(_IIter, _IIter, _Predicate, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _Predicate>
+ _IIter
+ find_if(_IIter, _IIter, _Predicate);
+
+ template<typename _IIter, typename _Predicate, typename _IterTag>
+ _IIter
+ find_if_switch(_IIter, _IIter, _Predicate, _IterTag);
+
+ template<typename _RAIter, typename _Predicate>
+ _RAIter
+ find_if_switch(_RAIter, _RAIter, _Predicate, random_access_iterator_tag);
+
+ template<typename _IIter, typename _FIter>
+ _IIter
+ find_first_of(_IIter, _IIter, _FIter, _FIter,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _FIter, typename _BiPredicate>
+ _IIter
+ find_first_of(_IIter, _IIter, _FIter, _FIter, _BiPredicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _FIter, typename _BiPredicate>
+ _IIter
+ find_first_of(_IIter, _IIter, _FIter, _FIter, _BiPredicate);
+
+ template<typename _IIter, typename _FIter>
+ _IIter
+ find_first_of(_IIter, _IIter, _FIter, _FIter);
+
+ template<typename _IIter, typename _FIter,
+ typename _IterTag1, typename _IterTag2>
+ _IIter
+ find_first_of_switch(_IIter, _IIter, _FIter, _FIter, _IterTag1, _IterTag2);
+
+ template<typename _RAIter, typename _FIter, typename _BiPredicate,
+ typename _IterTag>
+ _RAIter
+ find_first_of_switch(_RAIter, _RAIter, _FIter, _FIter, _BiPredicate,
+ random_access_iterator_tag, _IterTag);
+
+ template<typename _IIter, typename _FIter, typename _BiPredicate,
+ typename _IterTag1, typename _IterTag2>
+ _IIter
+ find_first_of_switch(_IIter, _IIter, _FIter, _FIter, _BiPredicate,
+ _IterTag1, _IterTag2);
+
+
+ template<typename _IIter, typename _Function>
+ _Function
+ for_each(_IIter, _IIter, _Function);
+
+ template<typename _IIter, typename _Function>
+ _Function
+ for_each(_IIter, _IIter, _Function, __gnu_parallel::sequential_tag);
+
+ template<typename _Iterator, typename _Function>
+ _Function
+ for_each(_Iterator, _Iterator, _Function, __gnu_parallel::_Parallelism);
+
+ template<typename _IIter, typename _Function, typename _IterTag>
+ _Function
+ for_each_switch(_IIter, _IIter, _Function, _IterTag);
+
+ template<typename _RAIter, typename _Function>
+ _Function
+ for_each_switch(_RAIter, _RAIter, _Function, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_balanced);
+
+
+ template<typename _FIter, typename _Generator>
+ void
+ generate(_FIter, _FIter, _Generator);
+
+ template<typename _FIter, typename _Generator>
+ void
+ generate(_FIter, _FIter, _Generator, __gnu_parallel::sequential_tag);
+
+ template<typename _FIter, typename _Generator>
+ void
+ generate(_FIter, _FIter, _Generator, __gnu_parallel::_Parallelism);
+
+ template<typename _FIter, typename _Generator, typename _IterTag>
+ void
+ generate_switch(_FIter, _FIter, _Generator, _IterTag);
+
+ template<typename _RAIter, typename _Generator>
+ void
+ generate_switch(_RAIter, _RAIter, _Generator, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_balanced);
+
+ template<typename _OIter, typename _Size, typename _Generator>
+ _OIter
+ generate_n(_OIter, _Size, _Generator);
+
+ template<typename _OIter, typename _Size, typename _Generator>
+ _OIter
+ generate_n(_OIter, _Size, _Generator, __gnu_parallel::sequential_tag);
+
+ template<typename _OIter, typename _Size, typename _Generator>
+ _OIter
+ generate_n(_OIter, _Size, _Generator, __gnu_parallel::_Parallelism);
+
+ template<typename _OIter, typename _Size, typename _Generator,
+ typename _IterTag>
+ _OIter
+ generate_n_switch(_OIter, _Size, _Generator, _IterTag);
+
+ template<typename _RAIter, typename _Size, typename _Generator>
+ _RAIter
+ generate_n_switch(_RAIter, _Size, _Generator, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_balanced);
+
+ template<typename _IIter1, typename _IIter2>
+ bool
+ lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _Predicate>
+ bool
+ lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2, _Predicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2>
+ bool
+ lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2);
+
+ template<typename _IIter1, typename _IIter2, typename _Predicate>
+ bool
+ lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2, _Predicate);
+
+ template<typename _IIter1, typename _IIter2,
+ typename _Predicate, typename _IterTag1, typename _IterTag2>
+ bool
+ lexicographical_compare_switch(_IIter1, _IIter1, _IIter2, _IIter2,
+ _Predicate, _IterTag1, _IterTag2);
+
+ template<typename _RAIter1, typename _RAIter2, typename _Predicate>
+ bool
+ lexicographical_compare_switch(_RAIter1, _RAIter1, _RAIter2, _RAIter2,
+ _Predicate, random_access_iterator_tag,
+ random_access_iterator_tag);
+
+ // algo.h
+ template<typename _IIter1, typename _IIter2>
+ pair<_IIter1, _IIter2>
+ mismatch(_IIter1, _IIter1, _IIter2, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _Predicate>
+ pair<_IIter1, _IIter2>
+ mismatch(_IIter1, _IIter1, _IIter2, _Predicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2>
+ pair<_IIter1, _IIter2>
+ mismatch(_IIter1, _IIter1, _IIter2);
+
+ template<typename _IIter1, typename _IIter2, typename _Predicate>
+ pair<_IIter1, _IIter2>
+ mismatch(_IIter1, _IIter1, _IIter2, _Predicate);
+
+ template<typename _IIter1, typename _IIter2, typename _Predicate,
+ typename _IterTag1, typename _IterTag2>
+ pair<_IIter1, _IIter2>
+ mismatch_switch(_IIter1, _IIter1, _IIter2, _Predicate,
+ _IterTag1, _IterTag2);
+
+ template<typename _RAIter1, typename _RAIter2, typename _Predicate>
+ pair<_RAIter1, _RAIter2>
+ mismatch_switch(_RAIter1, _RAIter1, _RAIter2, _Predicate,
+ random_access_iterator_tag, random_access_iterator_tag);
+
+ template<typename _FIter1, typename _FIter2>
+ _FIter1
+ search(_FIter1, _FIter1, _FIter2, _FIter2, __gnu_parallel::sequential_tag);
+
+ template<typename _FIter1, typename _FIter2>
+ _FIter1
+ search(_FIter1, _FIter1, _FIter2, _FIter2);
+
+ template<typename _FIter1, typename _FIter2, typename _BiPredicate>
+ _FIter1
+ search(_FIter1, _FIter1, _FIter2, _FIter2, _BiPredicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _FIter1, typename _FIter2, typename _BiPredicate>
+ _FIter1
+ search(_FIter1, _FIter1, _FIter2, _FIter2, _BiPredicate);
+
+ template<typename _RAIter1, typename _RAIter2>
+ _RAIter1
+ search_switch(_RAIter1, _RAIter1, _RAIter2, _RAIter2,
+ random_access_iterator_tag, random_access_iterator_tag);
+
+ template<typename _FIter1, typename _FIter2, typename _IterTag1,
+ typename _IterTag2>
+ _FIter1
+ search_switch(_FIter1, _FIter1, _FIter2, _FIter2, _IterTag1, _IterTag2);
+
+ template<typename _RAIter1, typename _RAIter2, typename _BiPredicate>
+ _RAIter1
+ search_switch(_RAIter1, _RAIter1, _RAIter2, _RAIter2, _BiPredicate,
+ random_access_iterator_tag, random_access_iterator_tag);
+
+ template<typename _FIter1, typename _FIter2, typename _BiPredicate,
+ typename _IterTag1, typename _IterTag2>
+ _FIter1
+ search_switch(_FIter1, _FIter1, _FIter2, _FIter2, _BiPredicate,
+ _IterTag1, _IterTag2);
+
+ template<typename _FIter, typename _Integer, typename _Tp>
+ _FIter
+ search_n(_FIter, _FIter, _Integer, const _Tp&,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _FIter, typename _Integer, typename _Tp,
+ typename _BiPredicate>
+ _FIter
+ search_n(_FIter, _FIter, _Integer, const _Tp&, _BiPredicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _FIter, typename _Integer, typename _Tp>
+ _FIter
+ search_n(_FIter, _FIter, _Integer, const _Tp&);
+
+ template<typename _FIter, typename _Integer, typename _Tp,
+ typename _BiPredicate>
+ _FIter
+ search_n(_FIter, _FIter, _Integer, const _Tp&, _BiPredicate);
+
+ template<typename _RAIter, typename _Integer, typename _Tp,
+ typename _BiPredicate>
+ _RAIter
+ search_n_switch(_RAIter, _RAIter, _Integer, const _Tp&,
+ _BiPredicate, random_access_iterator_tag);
+
+ template<typename _FIter, typename _Integer, typename _Tp,
+ typename _BiPredicate, typename _IterTag>
+ _FIter
+ search_n_switch(_FIter, _FIter, _Integer, const _Tp&,
+ _BiPredicate, _IterTag);
+
+
+ template<typename _IIter, typename _OIter, typename UnaryOperation>
+ _OIter
+ transform(_IIter, _IIter, _OIter, UnaryOperation);
+
+ template<typename _IIter, typename _OIter, typename UnaryOperation>
+ _OIter
+ transform(_IIter, _IIter, _OIter, UnaryOperation,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _OIter, typename UnaryOperation>
+ _OIter
+ transform(_IIter, _IIter, _OIter, UnaryOperation,
+ __gnu_parallel::_Parallelism);
+
+ template<typename _IIter, typename _OIter, typename UnaryOperation,
+ typename _IterTag1, typename _IterTag2>
+ _OIter
+ transform1_switch(_IIter, _IIter, _OIter, UnaryOperation,
+ _IterTag1, _IterTag2);
+
+
+ template<typename _RAIIter, typename _RAOIter, typename UnaryOperation>
+ _RAOIter
+ transform1_switch(_RAIIter, _RAIIter, _RAOIter, UnaryOperation,
+ random_access_iterator_tag, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_balanced);
+
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _BiOperation>
+ _OIter
+ transform(_IIter1, _IIter1, _IIter2, _OIter, _BiOperation);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _BiOperation>
+ _OIter
+ transform(_IIter1, _IIter1, _IIter2, _OIter, _BiOperation,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _BiOperation>
+ _OIter
+ transform(_IIter1, _IIter1, _IIter2, _OIter, _BiOperation,
+ __gnu_parallel::_Parallelism);
+
+ template<typename _RAIter1, typename _RAIter2, typename _RAIter3,
+ typename _BiOperation>
+ _RAIter3
+ transform2_switch(_RAIter1, _RAIter1, _RAIter2, _RAIter3, _BiOperation,
+ random_access_iterator_tag, random_access_iterator_tag,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_balanced);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _BiOperation, typename _Tag1,
+ typename _Tag2, typename _Tag3>
+ _OIter
+ transform2_switch(_IIter1, _IIter1, _IIter2, _OIter, _BiOperation,
+ _Tag1, _Tag2, _Tag3);
+
+
+ template<typename _FIter, typename _Tp>
+ void
+ replace(_FIter, _FIter, const _Tp&, const _Tp&);
+
+ template<typename _FIter, typename _Tp>
+ void
+ replace(_FIter, _FIter, const _Tp&, const _Tp&,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _FIter, typename _Tp>
+ void
+ replace(_FIter, _FIter, const _Tp&, const _Tp&,
+ __gnu_parallel::_Parallelism);
+
+ template<typename _FIter, typename _Tp, typename _IterTag>
+ void
+ replace_switch(_FIter, _FIter, const _Tp&, const _Tp&, _IterTag);
+
+ template<typename _RAIter, typename _Tp>
+ void
+ replace_switch(_RAIter, _RAIter, const _Tp&, const _Tp&,
+ random_access_iterator_tag, __gnu_parallel::_Parallelism);
+
+
+ template<typename _FIter, typename _Predicate, typename _Tp>
+ void
+ replace_if(_FIter, _FIter, _Predicate, const _Tp&);
+
+ template<typename _FIter, typename _Predicate, typename _Tp>
+ void
+ replace_if(_FIter, _FIter, _Predicate, const _Tp&,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _FIter, typename _Predicate, typename _Tp>
+ void
+ replace_if(_FIter, _FIter, _Predicate, const _Tp&,
+ __gnu_parallel::_Parallelism);
+
+ template<typename _FIter, typename _Predicate, typename _Tp,
+ typename _IterTag>
+ void
+ replace_if_switch(_FIter, _FIter, _Predicate, const _Tp&, _IterTag);
+
+ template<typename _RAIter, typename _Predicate, typename _Tp>
+ void
+ replace_if_switch(_RAIter, _RAIter, _Predicate, const _Tp&,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism);
+
+
+ template<typename _FIter>
+ _FIter
+ max_element(_FIter, _FIter);
+
+ template<typename _FIter>
+ _FIter
+ max_element(_FIter, _FIter, __gnu_parallel::sequential_tag);
+
+ template<typename _FIter>
+ _FIter
+ max_element(_FIter, _FIter, __gnu_parallel::_Parallelism);
+
+ template<typename _FIter, typename _Compare>
+ _FIter
+ max_element(_FIter, _FIter, _Compare);
+
+ template<typename _FIter, typename _Compare>
+ _FIter
+ max_element(_FIter, _FIter, _Compare, __gnu_parallel::sequential_tag);
+
+ template<typename _FIter, typename _Compare>
+ _FIter
+ max_element(_FIter, _FIter, _Compare, __gnu_parallel::_Parallelism);
+
+ template<typename _FIter, typename _Compare, typename _IterTag>
+ _FIter
+ max_element_switch(_FIter, _FIter, _Compare, _IterTag);
+
+ template<typename _RAIter, typename _Compare>
+ _RAIter
+ max_element_switch(_RAIter, _RAIter, _Compare, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_balanced);
+
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Compare>
+ _OIter
+ merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Compare>
+ _OIter
+ merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Compare, typename _IterTag1, typename _IterTag2,
+ typename _IterTag3>
+ _OIter
+ merge_switch(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare,
+ _IterTag1, _IterTag2, _IterTag3);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Compare>
+ _OIter
+ merge_switch(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare,
+ random_access_iterator_tag, random_access_iterator_tag,
+ random_access_iterator_tag);
+
+
+ template<typename _FIter>
+ _FIter
+ min_element(_FIter, _FIter);
+
+ template<typename _FIter>
+ _FIter
+ min_element(_FIter, _FIter, __gnu_parallel::sequential_tag);
+
+ template<typename _FIter>
+ _FIter
+ min_element(_FIter, _FIter, __gnu_parallel::_Parallelism parallelism_tag);
+
+ template<typename _FIter, typename _Compare>
+ _FIter
+ min_element(_FIter, _FIter, _Compare);
+
+ template<typename _FIter, typename _Compare>
+ _FIter
+ min_element(_FIter, _FIter, _Compare, __gnu_parallel::sequential_tag);
+
+ template<typename _FIter, typename _Compare>
+ _FIter
+ min_element(_FIter, _FIter, _Compare, __gnu_parallel::_Parallelism);
+
+ template<typename _FIter, typename _Compare, typename _IterTag>
+ _FIter
+ min_element_switch(_FIter, _FIter, _Compare, _IterTag);
+
+ template<typename _RAIter, typename _Compare>
+ _RAIter
+ min_element_switch(_RAIter, _RAIter, _Compare, random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_balanced);
+
+ template<typename _RAIter>
+ void
+ nth_element(_RAIter, _RAIter, _RAIter, __gnu_parallel::sequential_tag);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ nth_element(_RAIter, _RAIter, _RAIter, _Compare,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ nth_element(_RAIter, _RAIter, _RAIter, _Compare);
+
+ template<typename _RAIter>
+ void
+ nth_element(_RAIter, _RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ partial_sort(_RAIter, _RAIter, _RAIter, _Compare,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _RAIter>
+ void
+ partial_sort(_RAIter, _RAIter, _RAIter, __gnu_parallel::sequential_tag);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ partial_sort(_RAIter, _RAIter, _RAIter, _Compare);
+
+ template<typename _RAIter>
+ void
+ partial_sort(_RAIter, _RAIter, _RAIter);
+
+ template<typename _FIter, typename Predicate>
+ _FIter
+ partition(_FIter, _FIter, Predicate, __gnu_parallel::sequential_tag);
+
+ template<typename _FIter, typename Predicate>
+ _FIter
+ partition(_FIter, _FIter, Predicate);
+
+ template<typename _FIter, typename Predicate, typename _IterTag>
+ _FIter
+ partition_switch(_FIter, _FIter, Predicate, _IterTag);
+
+ template<typename _RAIter, typename Predicate>
+ _RAIter
+ partition_switch(_RAIter, _RAIter, Predicate, random_access_iterator_tag);
+
+ template<typename _RAIter>
+ void
+ random_shuffle(_RAIter, _RAIter, __gnu_parallel::sequential_tag);
+
+ template<typename _RAIter, typename _RandomNumberGenerator>
+ void
+ random_shuffle(_RAIter, _RAIter, _RandomNumberGenerator&,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _RAIter>
+ void
+ random_shuffle(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _RandomNumberGenerator>
+ void
+ random_shuffle(_RAIter, _RAIter, _RandomNumberGenerator&);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename Predicate>
+ _OIter
+ set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, Predicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Predicate>
+ _OIter
+ set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Predicate);
+
+ template<typename _IIter1, typename _IIter2, typename _Predicate,
+ typename _OIter, typename _IterTag1, typename _IterTag2,
+ typename _IterTag3>
+ _OIter
+ set_union_switch(_IIter1, _IIter1, _IIter2, _IIter2, _OIter,
+ _Predicate, _IterTag1, _IterTag2, _IterTag3);
+
+ template<typename _RAIter1, typename _RAIter2, typename _Output_RAIter,
+ typename _Predicate>
+ _Output_RAIter
+ set_union_switch(_RAIter1, _RAIter1, _RAIter2, _RAIter2, _Output_RAIter,
+ _Predicate, random_access_iterator_tag,
+ random_access_iterator_tag, random_access_iterator_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Predicate>
+ _OIter
+ set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Predicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Predicate>
+ _OIter
+ set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Predicate);
+
+ template<typename _IIter1, typename _IIter2, typename _Predicate,
+ typename _OIter, typename _IterTag1, typename _IterTag2,
+ typename _IterTag3>
+ _OIter
+ set_intersection_switch(_IIter1, _IIter1, _IIter2, _IIter2, _OIter,
+ _Predicate, _IterTag1, _IterTag2, _IterTag3);
+
+ template<typename _RAIter1, typename _RAIter2, typename _Output_RAIter,
+ typename _Predicate>
+ _Output_RAIter
+ set_intersection_switch(_RAIter1, _RAIter1, _RAIter2, _RAIter2,
+ _Output_RAIter, _Predicate,
+ random_access_iterator_tag,
+ random_access_iterator_tag,
+ random_access_iterator_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Predicate>
+ _OIter
+ set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter,
+ _Predicate, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Predicate>
+ _OIter
+ set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter,
+ _Predicate);
+
+ template<typename _IIter1, typename _IIter2, typename _Predicate,
+ typename _OIter, typename _IterTag1, typename _IterTag2,
+ typename _IterTag3>
+ _OIter
+ set_symmetric_difference_switch(_IIter1, _IIter1, _IIter2, _IIter2,
+ _OIter, _Predicate, _IterTag1, _IterTag2,
+ _IterTag3);
+
+ template<typename _RAIter1, typename _RAIter2, typename _Output_RAIter,
+ typename _Predicate>
+ _Output_RAIter
+ set_symmetric_difference_switch(_RAIter1, _RAIter1, _RAIter2, _RAIter2,
+ _Output_RAIter, _Predicate,
+ random_access_iterator_tag,
+ random_access_iterator_tag,
+ random_access_iterator_tag);
+
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Predicate>
+ _OIter
+ set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Predicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter>
+ _OIter
+ set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+ template<typename _IIter1, typename _IIter2, typename _OIter,
+ typename _Predicate>
+ _OIter
+ set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Predicate);
+
+ template<typename _IIter1, typename _IIter2, typename _Predicate,
+ typename _OIter, typename _IterTag1, typename _IterTag2,
+ typename _IterTag3>
+ _OIter
+ set_difference_switch(_IIter1, _IIter1, _IIter2, _IIter2, _OIter,
+ _Predicate, _IterTag1, _IterTag2, _IterTag3);
+
+ template<typename _RAIter1, typename _RAIter2, typename _Output_RAIter,
+ typename _Predicate>
+ _Output_RAIter
+ set_difference_switch(_RAIter1, _RAIter1, _RAIter2, _RAIter2,
+ _Output_RAIter, _Predicate,
+ random_access_iterator_tag,
+ random_access_iterator_tag,
+ random_access_iterator_tag);
+
+
+ template<typename _RAIter>
+ void
+ sort(_RAIter, _RAIter, __gnu_parallel::sequential_tag);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ sort(_RAIter, _RAIter, _Compare, __gnu_parallel::sequential_tag);
+
+ template<typename _RAIter>
+ void
+ sort(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ sort(_RAIter, _RAIter, _Compare);
+
+ template<typename _RAIter>
+ void
+ stable_sort(_RAIter, _RAIter, __gnu_parallel::sequential_tag);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ stable_sort(_RAIter, _RAIter, _Compare, __gnu_parallel::sequential_tag);
+
+ template<typename _RAIter>
+ void
+ stable_sort(_RAIter, _RAIter);
+
+ template<typename _RAIter, typename _Compare>
+ void
+ stable_sort(_RAIter, _RAIter, _Compare);
+
+ template<typename _IIter, typename _OIter>
+ _OIter
+ unique_copy(_IIter, _IIter, _OIter, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _OIter, typename _Predicate>
+ _OIter
+ unique_copy(_IIter, _IIter, _OIter, _Predicate,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _OIter>
+ _OIter
+ unique_copy(_IIter, _IIter, _OIter);
+
+ template<typename _IIter, typename _OIter, typename _Predicate>
+ _OIter
+ unique_copy(_IIter, _IIter, _OIter, _Predicate);
+
+ template<typename _IIter, typename _OIter, typename _Predicate,
+ typename _IterTag1, typename _IterTag2>
+ _OIter
+ unique_copy_switch(_IIter, _IIter, _OIter, _Predicate,
+ _IterTag1, _IterTag2);
+
+ template<typename _RAIter, typename _RandomAccess_OIter, typename _Predicate>
+ _RandomAccess_OIter
+ unique_copy_switch(_RAIter, _RAIter, _RandomAccess_OIter, _Predicate,
+ random_access_iterator_tag, random_access_iterator_tag);
+} // end namespace __parallel
+} // end namespace std
+
+#endif /* _GLIBCXX_PARALLEL_ALGORITHMFWD_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/balanced_quicksort.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/balanced_quicksort.h
new file mode 100644
index 0000000..2310110
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/balanced_quicksort.h
@@ -0,0 +1,477 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/balanced_quicksort.h
+ * @brief Implementation of a dynamically load-balanced parallel quicksort.
+ *
+ * It works in-place and needs only logarithmic extra memory.
+ * The algorithm is similar to the one proposed in
+ *
+ * P. Tsigas and Y. Zhang.
+ * A simple, fast parallel implementation of quicksort and
+ * its performance evaluation on SUN enterprise 10000.
+ * In 11th Euromicro Conference on Parallel, Distributed and
+ * Network-Based Processing, page 372, 2003.
+ *
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_BALANCED_QUICKSORT_H
+#define _GLIBCXX_PARALLEL_BALANCED_QUICKSORT_H 1
+
+#include <parallel/basic_iterator.h>
+#include <bits/stl_algo.h>
+
+#include <parallel/settings.h>
+#include <parallel/partition.h>
+#include <parallel/random_number.h>
+#include <parallel/queue.h>
+#include <functional>
+
+#if _GLIBCXX_ASSERTIONS
+#include <parallel/checkers.h>
+#endif
+
+namespace __gnu_parallel
+{
+/** @brief Information local to one thread in the parallel quicksort run. */
+template<typename RandomAccessIterator>
+ struct QSBThreadLocal
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ /** @brief Continuous part of the sequence, described by an
+ iterator pair. */
+ typedef std::pair<RandomAccessIterator, RandomAccessIterator> Piece;
+
+ /** @brief Initial piece to work on. */
+ Piece initial;
+
+ /** @brief Work-stealing queue. */
+ RestrictedBoundedConcurrentQueue<Piece> leftover_parts;
+
+ /** @brief Number of threads involved in this algorithm. */
+ thread_index_t num_threads;
+
+ /** @brief Pointer to a counter of elements left over to sort. */
+ volatile difference_type* elements_leftover;
+
+ /** @brief The complete sequence to sort. */
+ Piece global;
+
+ /** @brief Constructor.
+ * @param queue_size Size of the work-stealing queue. */
+ QSBThreadLocal(int queue_size) : leftover_parts(queue_size) { }
+ };
+
+/** @brief Balanced quicksort divide step.
+ * @param begin Begin iterator of subsequence.
+ * @param end End iterator of subsequence.
+ * @param comp Comparator.
+ * @param num_threads Number of threads that are allowed to work on
+ * this part.
+ * @pre @c (end-begin)>=1 */
+template<typename RandomAccessIterator, typename Comparator>
+ typename std::iterator_traits<RandomAccessIterator>::difference_type
+ qsb_divide(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, thread_index_t num_threads)
+ {
+ _GLIBCXX_PARALLEL_ASSERT(num_threads > 0);
+
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ RandomAccessIterator pivot_pos =
+ median_of_three_iterators(begin, begin + (end - begin) / 2,
+ end - 1, comp);
+
+#if defined(_GLIBCXX_ASSERTIONS)
+ // Must be in between somewhere.
+ difference_type n = end - begin;
+
+ _GLIBCXX_PARALLEL_ASSERT(
+ (!comp(*pivot_pos, *begin) && !comp(*(begin + n / 2), *pivot_pos))
+ || (!comp(*pivot_pos, *begin) && !comp(*(end - 1), *pivot_pos))
+ || (!comp(*pivot_pos, *(begin + n / 2)) && !comp(*begin, *pivot_pos))
+ || (!comp(*pivot_pos, *(begin + n / 2)) && !comp(*(end - 1), *pivot_pos))
+ || (!comp(*pivot_pos, *(end - 1)) && !comp(*begin, *pivot_pos))
+ || (!comp(*pivot_pos, *(end - 1)) && !comp(*(begin + n / 2), *pivot_pos)));
+#endif
+
+ // Swap pivot value to end.
+ if (pivot_pos != (end - 1))
+ std::swap(*pivot_pos, *(end - 1));
+ pivot_pos = end - 1;
+
+ __gnu_parallel::binder2nd<Comparator, value_type, value_type, bool>
+ pred(comp, *pivot_pos);
+
+ // Divide, returning end - begin - 1 in the worst case.
+ difference_type split_pos = parallel_partition(
+ begin, end - 1, pred, num_threads);
+
+ // Swap back pivot to middle.
+ std::swap(*(begin + split_pos), *pivot_pos);
+ pivot_pos = begin + split_pos;
+
+#if _GLIBCXX_ASSERTIONS
+ RandomAccessIterator r;
+ for (r = begin; r != pivot_pos; ++r)
+ _GLIBCXX_PARALLEL_ASSERT(comp(*r, *pivot_pos));
+ for (; r != end; ++r)
+ _GLIBCXX_PARALLEL_ASSERT(!comp(*r, *pivot_pos));
+#endif
+
+ return split_pos;
+ }
+
+/** @brief Quicksort conquer step.
+ * @param tls Array of thread-local storages.
+ * @param begin Begin iterator of subsequence.
+ * @param end End iterator of subsequence.
+ * @param comp Comparator.
+ * @param iam Number of the thread processing this function.
+ * @param num_threads
+ * Number of threads that are allowed to work on this part. */
+template<typename RandomAccessIterator, typename Comparator>
+ void
+ qsb_conquer(QSBThreadLocal<RandomAccessIterator>** tls,
+ RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp,
+ thread_index_t iam, thread_index_t num_threads,
+ bool parent_wait)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ difference_type n = end - begin;
+
+ if (num_threads <= 1 || n <= 1)
+ {
+ tls[iam]->initial.first = begin;
+ tls[iam]->initial.second = end;
+
+ qsb_local_sort_with_helping(tls, comp, iam, parent_wait);
+
+ return;
+ }
+
+ // Divide step.
+ difference_type split_pos = qsb_divide(begin, end, comp, num_threads);
+
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(0 <= split_pos && split_pos < (end - begin));
+#endif
+
+ thread_index_t num_threads_leftside =
+ std::max<thread_index_t>(1, std::min<thread_index_t>(
+ num_threads - 1, split_pos * num_threads / n));
+
+# pragma omp atomic
+ *tls[iam]->elements_leftover -= (difference_type)1;
+
+ // Conquer step.
+# pragma omp parallel num_threads(2)
+ {
+ bool wait;
+ if(omp_get_num_threads() < 2)
+ wait = false;
+ else
+ wait = parent_wait;
+
+# pragma omp sections
+ {
+# pragma omp section
+ {
+ qsb_conquer(tls, begin, begin + split_pos, comp,
+ iam,
+ num_threads_leftside,
+ wait);
+ wait = parent_wait;
+ }
+ // The pivot_pos is left in place, to ensure termination.
+# pragma omp section
+ {
+ qsb_conquer(tls, begin + split_pos + 1, end, comp,
+ iam + num_threads_leftside,
+ num_threads - num_threads_leftside,
+ wait);
+ wait = parent_wait;
+ }
+ }
+ }
+ }
+
+/**
+ * @brief Quicksort step doing load-balanced local sort.
+ * @param tls Array of thread-local storages.
+ * @param comp Comparator.
+ * @param iam Number of the thread processing this function.
+ */
+template<typename RandomAccessIterator, typename Comparator>
+ void
+ qsb_local_sort_with_helping(QSBThreadLocal<RandomAccessIterator>** tls,
+ Comparator& comp, int iam, bool wait)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef std::pair<RandomAccessIterator, RandomAccessIterator> Piece;
+
+ QSBThreadLocal<RandomAccessIterator>& tl = *tls[iam];
+
+ difference_type base_case_n =
+ _Settings::get().sort_qsb_base_case_maximal_n;
+ if (base_case_n < 2)
+ base_case_n = 2;
+ thread_index_t num_threads = tl.num_threads;
+
+ // Every thread has its own random number generator.
+ random_number rng(iam + 1);
+
+ Piece current = tl.initial;
+
+ difference_type elements_done = 0;
+#if _GLIBCXX_ASSERTIONS
+ difference_type total_elements_done = 0;
+#endif
+
+ for (;;)
+ {
+ // Invariant: current must be a valid (maybe empty) range.
+ RandomAccessIterator begin = current.first, end = current.second;
+ difference_type n = end - begin;
+
+ if (n > base_case_n)
+ {
+ // Divide.
+ RandomAccessIterator pivot_pos = begin + rng(n);
+
+ // Swap pivot_pos value to end.
+ if (pivot_pos != (end - 1))
+ std::swap(*pivot_pos, *(end - 1));
+ pivot_pos = end - 1;
+
+ __gnu_parallel::binder2nd
+ <Comparator, value_type, value_type, bool>
+ pred(comp, *pivot_pos);
+
+ // Divide, leave pivot unchanged in last place.
+ RandomAccessIterator split_pos1, split_pos2;
+ split_pos1 = __gnu_sequential::partition(begin, end - 1, pred);
+
+ // Left side: < pivot_pos; right side: >= pivot_pos.
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(begin <= split_pos1 && split_pos1 < end);
+#endif
+ // Swap pivot back to middle.
+ if (split_pos1 != pivot_pos)
+ std::swap(*split_pos1, *pivot_pos);
+ pivot_pos = split_pos1;
+
+ // In case all elements are equal, split_pos1 == 0.
+ if ((split_pos1 + 1 - begin) < (n >> 7)
+ || (end - split_pos1) < (n >> 7))
+ {
+ // Very unequal split, one part smaller than one 128th
+ // elements not strictly larger than the pivot.
+ __gnu_parallel::unary_negate<__gnu_parallel::binder1st
+ <Comparator, value_type, value_type, bool>, value_type>
+ pred(__gnu_parallel::binder1st
+ <Comparator, value_type, value_type, bool>(comp,
+ *pivot_pos));
+
+ // Find other end of pivot-equal range.
+ split_pos2 = __gnu_sequential::partition(split_pos1 + 1,
+ end, pred);
+ }
+ else
+ // Only skip the pivot.
+ split_pos2 = split_pos1 + 1;
+
+ // Elements equal to pivot are done.
+ elements_done += (split_pos2 - split_pos1);
+#if _GLIBCXX_ASSERTIONS
+ total_elements_done += (split_pos2 - split_pos1);
+#endif
+ // Always push larger part onto stack.
+ if (((split_pos1 + 1) - begin) < (end - (split_pos2)))
+ {
+ // Right side larger.
+ if ((split_pos2) != end)
+ tl.leftover_parts.push_front(std::make_pair(split_pos2,
+ end));
+
+ //current.first = begin; //already set anyway
+ current.second = split_pos1;
+ continue;
+ }
+ else
+ {
+ // Left side larger.
+ if (begin != split_pos1)
+ tl.leftover_parts.push_front(std::make_pair(begin,
+ split_pos1));
+
+ current.first = split_pos2;
+ //current.second = end; //already set anyway
+ continue;
+ }
+ }
+ else
+ {
+ __gnu_sequential::sort(begin, end, comp);
+ elements_done += n;
+#if _GLIBCXX_ASSERTIONS
+ total_elements_done += n;
+#endif
+
+ // Prefer own stack, small pieces.
+ if (tl.leftover_parts.pop_front(current))
+ continue;
+
+# pragma omp atomic
+ *tl.elements_leftover -= elements_done;
+
+ elements_done = 0;
+
+#if _GLIBCXX_ASSERTIONS
+ double search_start = omp_get_wtime();
+#endif
+
+ // Look for new work.
+ bool successfully_stolen = false;
+ while (wait && *tl.elements_leftover > 0 && !successfully_stolen
+#if _GLIBCXX_ASSERTIONS
+ // Possible dead-lock.
+ && (omp_get_wtime() < (search_start + 1.0))
+#endif
+ )
+ {
+ thread_index_t victim;
+ victim = rng(num_threads);
+
+ // Large pieces.
+ successfully_stolen = (victim != iam)
+ && tls[victim]->leftover_parts.pop_back(current);
+ if (!successfully_stolen)
+ yield();
+#if !defined(__ICC) && !defined(__ECC)
+# pragma omp flush
+#endif
+ }
+
+#if _GLIBCXX_ASSERTIONS
+ if (omp_get_wtime() >= (search_start + 1.0))
+ {
+ sleep(1);
+ _GLIBCXX_PARALLEL_ASSERT(omp_get_wtime()
+ < (search_start + 1.0));
+ }
+#endif
+ if (!successfully_stolen)
+ {
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(*tl.elements_leftover == 0);
+#endif
+ return;
+ }
+ }
+ }
+ }
+
+/** @brief Top-level quicksort routine.
+ * @param begin Begin iterator of sequence.
+ * @param end End iterator of sequence.
+ * @param comp Comparator.
+ * @param num_threads Number of threads that are allowed to work on
+ * this part.
+ */
+template<typename RandomAccessIterator, typename Comparator>
+ void
+ parallel_sort_qsb(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp,
+ thread_index_t num_threads)
+ {
+ _GLIBCXX_CALL(end - begin)
+
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef std::pair<RandomAccessIterator, RandomAccessIterator> Piece;
+
+ typedef QSBThreadLocal<RandomAccessIterator> tls_type;
+
+ difference_type n = end - begin;
+
+ if (n <= 1)
+ return;
+
+ // At least one element per processor.
+ if (num_threads > n)
+ num_threads = static_cast<thread_index_t>(n);
+
+ // Initialize thread local storage
+ tls_type** tls = new tls_type*[num_threads];
+ difference_type queue_size = num_threads * (thread_index_t)(log2(n) + 1);
+ for (thread_index_t t = 0; t < num_threads; ++t)
+ tls[t] = new QSBThreadLocal<RandomAccessIterator>(queue_size);
+
+ // There can never be more than ceil(log2(n)) ranges on the stack, because
+ // 1. Only one processor pushes onto the stack
+ // 2. The largest range has at most length n
+ // 3. Each range is larger than half of the range remaining
+ volatile difference_type elements_leftover = n;
+ for (int i = 0; i < num_threads; ++i)
+ {
+ tls[i]->elements_leftover = &elements_leftover;
+ tls[i]->num_threads = num_threads;
+ tls[i]->global = std::make_pair(begin, end);
+
+ // Just in case nothing is left to assign.
+ tls[i]->initial = std::make_pair(end, end);
+ }
+
+ // Main recursion call.
+ qsb_conquer(tls, begin, begin + n, comp, 0, num_threads, true);
+
+#if _GLIBCXX_ASSERTIONS
+ // All stack must be empty.
+ Piece dummy;
+ for (int i = 1; i < num_threads; ++i)
+ _GLIBCXX_PARALLEL_ASSERT(!tls[i]->leftover_parts.pop_back(dummy));
+#endif
+
+ for (int i = 0; i < num_threads; ++i)
+ delete tls[i];
+ delete[] tls;
+ }
+} // namespace __gnu_parallel
+
+#endif /* _GLIBCXX_PARALLEL_BALANCED_QUICKSORT_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/base.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/base.h
new file mode 100644
index 0000000..7f855df
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/base.h
@@ -0,0 +1,471 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/base.h
+ * @brief Sequential helper functions.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_BASE_H
+#define _GLIBCXX_PARALLEL_BASE_H 1
+
+#include <functional>
+#include <omp.h>
+#include <parallel/features.h>
+#include <parallel/basic_iterator.h>
+#include <parallel/parallel.h>
+
+
+// Parallel mode namespaces.
+
+/**
+ * @namespace std::__parallel
+ * @brief GNU parallel code, replaces standard behavior with parallel behavior.
+ */
+namespace std
+{
+ namespace __parallel { }
+}
+
+/**
+ * @namespace __gnu_parallel
+ * @brief GNU parallel code for public use.
+ */
+namespace __gnu_parallel
+{
+ // Import all the parallel versions of components in namespace std.
+ using namespace std::__parallel;
+}
+
+/**
+ * @namespace __gnu_sequential
+ * @brief GNU sequential classes for public use.
+ */
+namespace __gnu_sequential
+{
+ // Import whatever is the serial version.
+#ifdef _GLIBCXX_PARALLEL
+ using namespace std::__norm;
+#else
+ using namespace std;
+#endif
+}
+
+
+namespace __gnu_parallel
+{
+ // NB: Including this file cannot produce (unresolved) symbols from
+ // the OpenMP runtime unless the parallel mode is actually invoked
+ // and active, which imples that the OpenMP runtime is actually
+ // going to be linked in.
+ inline int
+ get_max_threads()
+ {
+ int __i = omp_get_max_threads();
+ return __i > 1 ? __i : 1;
+ }
+
+
+ inline bool
+ is_parallel(const _Parallelism __p) { return __p != sequential; }
+
+
+ // XXX remove std::duplicates from here if possible,
+ // XXX but keep minimal dependencies.
+
+/** @brief Calculates the rounded-down logarithm of @c n for base 2.
+ * @param n Argument.
+ * @return Returns 0 for any argument <1.
+ */
+template<typename Size>
+ inline Size
+ __log2(Size n)
+ {
+ Size k;
+ for (k = 0; n > 1; n >>= 1)
+ ++k;
+ return k;
+ }
+
+/** @brief Encode two integers into one __gnu_parallel::lcas_t.
+ * @param a First integer, to be encoded in the most-significant @c
+ * lcas_t_bits/2 bits.
+ * @param b Second integer, to be encoded in the least-significant
+ * @c lcas_t_bits/2 bits.
+ * @return __gnu_parallel::lcas_t value encoding @c a and @c b.
+ * @see decode2
+ */
+inline lcas_t
+encode2(int a, int b) //must all be non-negative, actually
+{
+ return (((lcas_t)a) << (lcas_t_bits / 2)) | (((lcas_t)b) << 0);
+}
+
+/** @brief Decode two integers from one __gnu_parallel::lcas_t.
+ * @param x __gnu_parallel::lcas_t to decode integers from.
+ * @param a First integer, to be decoded from the most-significant
+ * @c lcas_t_bits/2 bits of @c x.
+ * @param b Second integer, to be encoded in the least-significant
+ * @c lcas_t_bits/2 bits of @c x.
+ * @see encode2
+ */
+inline void
+decode2(lcas_t x, int& a, int& b)
+{
+ a = (int)((x >> (lcas_t_bits / 2)) & lcas_t_mask);
+ b = (int)((x >> 0 ) & lcas_t_mask);
+}
+
+/** @brief Equivalent to std::min. */
+template<typename T>
+ const T&
+ min(const T& a, const T& b)
+ { return (a < b) ? a : b; }
+
+/** @brief Equivalent to std::max. */
+template<typename T>
+ const T&
+ max(const T& a, const T& b)
+ { return (a > b) ? a : b; }
+
+/** @brief Constructs predicate for equality from strict weak
+ * ordering predicate
+ */
+// XXX comparator at the end, as per others
+template<typename Comparator, typename T1, typename T2>
+ class equal_from_less : public std::binary_function<T1, T2, bool>
+ {
+ private:
+ Comparator& comp;
+
+ public:
+ equal_from_less(Comparator& _comp) : comp(_comp) { }
+
+ bool operator()(const T1& a, const T2& b)
+ {
+ return !comp(a, b) && !comp(b, a);
+ }
+ };
+
+
+/** @brief Similar to std::binder1st,
+ * but giving the argument types explicitly. */
+template<typename _Predicate, typename argument_type>
+ class unary_negate
+ : public std::unary_function<argument_type, bool>
+ {
+ protected:
+ _Predicate _M_pred;
+
+ public:
+ explicit
+ unary_negate(const _Predicate& __x) : _M_pred(__x) { }
+
+ bool
+ operator()(const argument_type& __x)
+ { return !_M_pred(__x); }
+ };
+
+/** @brief Similar to std::binder1st,
+ * but giving the argument types explicitly. */
+template<typename _Operation, typename first_argument_type,
+ typename second_argument_type, typename result_type>
+ class binder1st
+ : public std::unary_function<second_argument_type, result_type>
+ {
+ protected:
+ _Operation op;
+ first_argument_type value;
+
+ public:
+ binder1st(const _Operation& __x,
+ const first_argument_type& __y)
+ : op(__x), value(__y) { }
+
+ result_type
+ operator()(const second_argument_type& __x)
+ { return op(value, __x); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 109. Missing binders for non-const sequence elements
+ result_type
+ operator()(second_argument_type& __x) const
+ { return op(value, __x); }
+ };
+
+/**
+ * @brief Similar to std::binder2nd, but giving the argument types
+ * explicitly.
+ */
+template<typename _Operation, typename first_argument_type,
+ typename second_argument_type, typename result_type>
+ class binder2nd
+ : public std::unary_function<first_argument_type, result_type>
+ {
+ protected:
+ _Operation op;
+ second_argument_type value;
+
+ public:
+ binder2nd(const _Operation& __x,
+ const second_argument_type& __y)
+ : op(__x), value(__y) { }
+
+ result_type
+ operator()(const first_argument_type& __x) const
+ { return op(__x, value); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 109. Missing binders for non-const sequence elements
+ result_type
+ operator()(first_argument_type& __x)
+ { return op(__x, value); }
+ };
+
+/** @brief Similar to std::equal_to, but allows two different types. */
+template<typename T1, typename T2>
+ struct equal_to : std::binary_function<T1, T2, bool>
+ {
+ bool operator()(const T1& t1, const T2& t2) const
+ { return t1 == t2; }
+ };
+
+/** @brief Similar to std::less, but allows two different types. */
+template<typename T1, typename T2>
+ struct less : std::binary_function<T1, T2, bool>
+ {
+ bool
+ operator()(const T1& t1, const T2& t2) const
+ { return t1 < t2; }
+
+ bool
+ operator()(const T2& t2, const T1& t1) const
+ { return t2 < t1; }
+ };
+
+// Partial specialization for one type. Same as std::less.
+template<typename _Tp>
+struct less<_Tp, _Tp> : public std::binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x < __y; }
+ };
+
+
+ /** @brief Similar to std::plus, but allows two different types. */
+template<typename _Tp1, typename _Tp2>
+ struct plus : public std::binary_function<_Tp1, _Tp2, _Tp1>
+ {
+ typedef __typeof__(*static_cast<_Tp1*>(NULL)
+ + *static_cast<_Tp2*>(NULL)) result;
+
+ result
+ operator()(const _Tp1& __x, const _Tp2& __y) const
+ { return __x + __y; }
+ };
+
+// Partial specialization for one type. Same as std::plus.
+template<typename _Tp>
+ struct plus<_Tp, _Tp> : public std::binary_function<_Tp, _Tp, _Tp>
+ {
+ typedef __typeof__(*static_cast<_Tp*>(NULL)
+ + *static_cast<_Tp*>(NULL)) result;
+
+ result
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x + __y; }
+ };
+
+
+/** @brief Similar to std::multiplies, but allows two different types. */
+template<typename _Tp1, typename _Tp2>
+ struct multiplies : public std::binary_function<_Tp1, _Tp2, _Tp1>
+ {
+ typedef __typeof__(*static_cast<_Tp1*>(NULL)
+ * *static_cast<_Tp2*>(NULL)) result;
+
+ result
+ operator()(const _Tp1& __x, const _Tp2& __y) const
+ { return __x * __y; }
+ };
+
+// Partial specialization for one type. Same as std::multiplies.
+template<typename _Tp>
+ struct multiplies<_Tp, _Tp> : public std::binary_function<_Tp, _Tp, _Tp>
+ {
+ typedef __typeof__(*static_cast<_Tp*>(NULL)
+ * *static_cast<_Tp*>(NULL)) result;
+
+ result
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x * __y; }
+ };
+
+
+template<typename T, typename _DifferenceTp>
+ class pseudo_sequence;
+
+/** @brief Iterator associated with __gnu_parallel::pseudo_sequence.
+ * If features the usual random-access iterator functionality.
+ * @param T Sequence value type.
+ * @param difference_type Sequence difference type.
+ */
+template<typename T, typename _DifferenceTp>
+ class pseudo_sequence_iterator
+ {
+ public:
+ typedef _DifferenceTp difference_type;
+
+ private:
+ typedef pseudo_sequence_iterator<T, _DifferenceTp> type;
+
+ const T& val;
+ difference_type pos;
+
+ public:
+ pseudo_sequence_iterator(const T& val, difference_type pos)
+ : val(val), pos(pos) { }
+
+ // Pre-increment operator.
+ type&
+ operator++()
+ {
+ ++pos;
+ return *this;
+ }
+
+ // Post-increment operator.
+ const type
+ operator++(int)
+ { return type(pos++); }
+
+ const T&
+ operator*() const
+ { return val; }
+
+ const T&
+ operator[](difference_type) const
+ { return val; }
+
+ bool
+ operator==(const type& i2)
+ { return pos == i2.pos; }
+
+ difference_type
+ operator!=(const type& i2)
+ { return pos != i2.pos; }
+
+ difference_type
+ operator-(const type& i2)
+ { return pos - i2.pos; }
+ };
+
+/** @brief Sequence that conceptually consists of multiple copies of
+ the same element.
+ * The copies are not stored explicitly, of course.
+ * @param T Sequence value type.
+ * @param difference_type Sequence difference type.
+ */
+template<typename T, typename _DifferenceTp>
+ class pseudo_sequence
+ {
+ typedef pseudo_sequence<T, _DifferenceTp> type;
+
+ public:
+ typedef _DifferenceTp difference_type;
+
+ // Better case down to uint64, than up to _DifferenceTp.
+ typedef pseudo_sequence_iterator<T, uint64> iterator;
+
+ /** @brief Constructor.
+ * @param val Element of the sequence.
+ * @param count Number of (virtual) copies.
+ */
+ pseudo_sequence(const T& val, difference_type count)
+ : val(val), count(count) { }
+
+ /** @brief Begin iterator. */
+ iterator
+ begin() const
+ { return iterator(val, 0); }
+
+ /** @brief End iterator. */
+ iterator
+ end() const
+ { return iterator(val, count); }
+
+ private:
+ const T& val;
+ difference_type count;
+ };
+
+/** @brief Functor that does nothing */
+template<typename _ValueTp>
+ class void_functor
+ {
+ inline void
+ operator()(const _ValueTp& v) const { }
+ };
+
+/** @brief Compute the median of three referenced elements,
+ according to @c comp.
+ * @param a First iterator.
+ * @param b Second iterator.
+ * @param c Third iterator.
+ * @param comp Comparator.
+ */
+template<typename RandomAccessIterator, typename Comparator>
+ RandomAccessIterator
+ median_of_three_iterators(RandomAccessIterator a, RandomAccessIterator b,
+ RandomAccessIterator c, Comparator& comp)
+ {
+ if (comp(*a, *b))
+ if (comp(*b, *c))
+ return b;
+ else
+ if (comp(*a, *c))
+ return c;
+ else
+ return a;
+ else
+ {
+ // Just swap a and b.
+ if (comp(*a, *c))
+ return a;
+ else
+ if (comp(*b, *c))
+ return c;
+ else
+ return b;
+ }
+ }
+
+#define _GLIBCXX_PARALLEL_ASSERT(_Condition) __glibcxx_assert(_Condition)
+
+} //namespace __gnu_parallel
+
+#endif /* _GLIBCXX_PARALLEL_BASE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/basic_iterator.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/basic_iterator.h
new file mode 100644
index 0000000..c5c067a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/basic_iterator.h
@@ -0,0 +1,42 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/basic_iterator.h
+ * @brief Includes the original header files concerned with iterators
+ * except for stream iterators.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_BASIC_ITERATOR_H
+#define _GLIBCXX_PARALLEL_BASIC_ITERATOR_H 1
+
+#include <bits/c++config.h>
+#include <cstddef>
+#include <bits/stl_iterator_base_types.h>
+#include <bits/stl_iterator_base_funcs.h>
+#include <bits/stl_iterator.h>
+
+#endif /* _GLIBCXX_PARALLEL_BASIC_ITERATOR_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/checkers.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/checkers.h
new file mode 100644
index 0000000..819e8ad
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/checkers.h
@@ -0,0 +1,154 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/checkers.h
+ * @brief Routines for checking the correctness of algorithm results.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_CHECKERS_H
+#define _GLIBCXX_PARALLEL_CHECKERS_H 1
+
+#include <functional>
+#include <cstdio>
+#include <bits/stl_algobase.h>
+
+namespace __gnu_parallel
+{
+ /**
+ * @brief Check whether @c [begin, @c end) is sorted according to @c comp.
+ * @param begin Begin iterator of sequence.
+ * @param end End iterator of sequence.
+ * @param comp Comparator.
+ * @return @c true if sorted, @c false otherwise.
+ */
+ // XXX Comparator default template argument
+ template<typename InputIterator, typename Comparator>
+ bool
+ is_sorted(InputIterator begin, InputIterator end,
+ Comparator comp
+ = std::less<typename std::iterator_traits<InputIterator>::
+ value_type>())
+ {
+ if (begin == end)
+ return true;
+
+ InputIterator current(begin), recent(begin);
+
+ unsigned long long position = 1;
+ for (current++; current != end; current++)
+ {
+ if (comp(*current, *recent))
+ {
+ printf("is_sorted: check failed before position %i.\n",
+ position);
+ return false;
+ }
+ recent = current;
+ position++;
+ }
+
+ return true;
+ }
+
+ /**
+ * @brief Check whether @c [begin, @c end) is sorted according to @c comp.
+ * Prints the position in case an unordered pair is found.
+ * @param begin Begin iterator of sequence.
+ * @param end End iterator of sequence.
+ * @param first_failure The first failure is returned in this variable.
+ * @param comp Comparator.
+ * @return @c true if sorted, @c false otherwise.
+ */
+ // XXX Comparator default template argument
+ template<typename InputIterator, typename Comparator>
+ bool
+ is_sorted_failure(InputIterator begin, InputIterator end,
+ InputIterator& first_failure,
+ Comparator comp
+ = std::less<typename std::iterator_traits<InputIterator>::
+ value_type>())
+ {
+ if (begin == end)
+ return true;
+
+ InputIterator current(begin), recent(begin);
+
+ unsigned long long position = 1;
+ for (current++; current != end; current++)
+ {
+ if (comp(*current, *recent))
+ {
+ first_failure = current;
+ printf("is_sorted: check failed before position %lld.\n",
+ position);
+ return false;
+ }
+ recent = current;
+ position++;
+ }
+
+ first_failure = end;
+ return true;
+ }
+
+ /**
+ * @brief Check whether @c [begin, @c end) is sorted according to @c comp.
+ * Prints all unordered pair, including the surrounding two elements.
+ * @param begin Begin iterator of sequence.
+ * @param end End iterator of sequence.
+ * @param comp Comparator.
+ * @return @c true if sorted, @c false otherwise.
+ */
+ template<typename InputIterator, typename Comparator>
+ bool
+ // XXX Comparator default template argument
+ is_sorted_print_failures(InputIterator begin, InputIterator end,
+ Comparator comp
+ = std::less<typename std::iterator_traits
+ <InputIterator>::value_type>())
+ {
+ if (begin == end)
+ return true;
+
+ InputIterator recent(begin);
+ bool ok = true;
+
+ for (InputIterator pos(begin + 1); pos != end; pos++)
+ {
+ if (comp(*pos, *recent))
+ {
+ printf("%ld: %d %d %d %d\n", pos - begin, *(pos - 2),
+ *(pos- 1), *pos, *(pos + 1));
+ ok = false;
+ }
+ recent = pos;
+ }
+ return ok;
+ }
+}
+
+#endif /* _GLIBCXX_PARALLEL_CHECKERS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/compatibility.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/compatibility.h
new file mode 100644
index 0000000..a5726dd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/compatibility.h
@@ -0,0 +1,350 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/compatibility.h
+ * @brief Compatibility layer, mostly concerned with atomic operations.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_COMPATIBILITY_H
+#define _GLIBCXX_PARALLEL_COMPATIBILITY_H 1
+
+#include <parallel/types.h>
+#include <parallel/base.h>
+
+#if defined(__SUNPRO_CC) && defined(__sparc)
+#include <sys/atomic.h>
+#endif
+
+#if !defined(_WIN32) || defined (__CYGWIN__)
+#include <sched.h>
+#endif
+
+#if defined(_MSC_VER)
+#include <Windows.h>
+#include <intrin.h>
+#undef max
+#undef min
+#endif
+
+#ifdef __MINGW32__
+// Including <windows.h> will drag in all the windows32 names. Since
+// that can cause user code portability problems, we just declare the
+// one needed function here.
+extern "C"
+__attribute((dllimport)) void __attribute__((stdcall)) Sleep (unsigned long);
+#endif
+
+namespace __gnu_parallel
+{
+#if defined(__ICC)
+ template<typename must_be_int = int>
+ int32 faa32(int32* x, int32 inc)
+ {
+ asm volatile("lock xadd %0,%1"
+ : "=r" (inc), "=m" (*x)
+ : "0" (inc)
+ : "memory");
+ return inc;
+ }
+#if defined(__x86_64)
+ template<typename must_be_int = int>
+ int64 faa64(int64* x, int64 inc)
+ {
+ asm volatile("lock xadd %0,%1"
+ : "=r" (inc), "=m" (*x)
+ : "0" (inc)
+ : "memory");
+ return inc;
+ }
+#endif
+#endif
+
+ // atomic functions only work on integers
+
+ /** @brief Add a value to a variable, atomically.
+ *
+ * Implementation is heavily platform-dependent.
+ * @param ptr Pointer to a 32-bit signed integer.
+ * @param addend Value to add.
+ */
+ inline int32
+ fetch_and_add_32(volatile int32* ptr, int32 addend)
+ {
+#if defined(__ICC) //x86 version
+ return _InterlockedExchangeAdd((void*)ptr, addend);
+#elif defined(__ECC) //IA-64 version
+ return _InterlockedExchangeAdd((void*)ptr, addend);
+#elif defined(__ICL) || defined(_MSC_VER)
+ return _InterlockedExchangeAdd(reinterpret_cast<volatile long*>(ptr),
+ addend);
+#elif defined(__GNUC__)
+ return __sync_fetch_and_add(ptr, addend);
+#elif defined(__SUNPRO_CC) && defined(__sparc)
+ volatile int32 before, after;
+ do
+ {
+ before = *ptr;
+ after = before + addend;
+ } while (atomic_cas_32((volatile unsigned int*)ptr, before,
+ after) != before);
+ return before;
+#else //fallback, slow
+#pragma message("slow fetch_and_add_32")
+ int32 res;
+#pragma omp critical
+ {
+ res = *ptr;
+ *(ptr) += addend;
+ }
+ return res;
+#endif
+ }
+
+ /** @brief Add a value to a variable, atomically.
+ *
+ * Implementation is heavily platform-dependent.
+ * @param ptr Pointer to a 64-bit signed integer.
+ * @param addend Value to add.
+ */
+ inline int64
+ fetch_and_add_64(volatile int64* ptr, int64 addend)
+ {
+#if defined(__ICC) && defined(__x86_64) //x86 version
+ return faa64<int>((int64*)ptr, addend);
+#elif defined(__ECC) //IA-64 version
+ return _InterlockedExchangeAdd64((void*)ptr, addend);
+#elif defined(__ICL) || defined(_MSC_VER)
+#ifndef _WIN64
+ _GLIBCXX_PARALLEL_ASSERT(false); //not available in this case
+ return 0;
+#else
+ return _InterlockedExchangeAdd64(ptr, addend);
+#endif
+#elif defined(__GNUC__) && defined(__x86_64)
+ return __sync_fetch_and_add(ptr, addend);
+#elif defined(__GNUC__) && defined(__i386) && \
+ (defined(__i686) || defined(__pentium4) || defined(__athlon))
+ return __sync_fetch_and_add(ptr, addend);
+#elif defined(__SUNPRO_CC) && defined(__sparc)
+ volatile int64 before, after;
+ do
+ {
+ before = *ptr;
+ after = before + addend;
+ } while (atomic_cas_64((volatile unsigned long long*)ptr, before,
+ after) != before);
+ return before;
+#else //fallback, slow
+#if defined(__GNUC__) && defined(__i386)
+ // XXX doesn't work with -march=native
+ //#warning "please compile with -march=i686 or better"
+#endif
+#pragma message("slow fetch_and_add_64")
+ int64 res;
+#pragma omp critical
+ {
+ res = *ptr;
+ *(ptr) += addend;
+ }
+ return res;
+#endif
+ }
+
+ /** @brief Add a value to a variable, atomically.
+ *
+ * Implementation is heavily platform-dependent.
+ * @param ptr Pointer to a signed integer.
+ * @param addend Value to add.
+ */
+ template<typename T>
+ inline T
+ fetch_and_add(volatile T* ptr, T addend)
+ {
+ if (sizeof(T) == sizeof(int32))
+ return (T)fetch_and_add_32((volatile int32*) ptr, (int32)addend);
+ else if (sizeof(T) == sizeof(int64))
+ return (T)fetch_and_add_64((volatile int64*) ptr, (int64)addend);
+ else
+ _GLIBCXX_PARALLEL_ASSERT(false);
+ }
+
+
+#if defined(__ICC)
+
+ template<typename must_be_int = int>
+ inline int32
+ cas32(volatile int32* ptr, int32 old, int32 nw)
+ {
+ int32 before;
+ __asm__ __volatile__("lock; cmpxchgl %1,%2"
+ : "=a"(before)
+ : "q"(nw), "m"(*(volatile long long*)(ptr)), "0"(old)
+ : "memory");
+ return before;
+ }
+
+#if defined(__x86_64)
+ template<typename must_be_int = int>
+ inline int64
+ cas64(volatile int64 *ptr, int64 old, int64 nw)
+ {
+ int64 before;
+ __asm__ __volatile__("lock; cmpxchgq %1,%2"
+ : "=a"(before)
+ : "q"(nw), "m"(*(volatile long long*)(ptr)), "0"(old)
+ : "memory");
+ return before;
+ }
+#endif
+
+#endif
+
+ /** @brief Compare @c *ptr and @c comparand. If equal, let @c
+ * *ptr=replacement and return @c true, return @c false otherwise.
+ *
+ * Implementation is heavily platform-dependent.
+ * @param ptr Pointer to 32-bit signed integer.
+ * @param comparand Compare value.
+ * @param replacement Replacement value.
+ */
+ inline bool
+ compare_and_swap_32(volatile int32* ptr, int32 comparand, int32 replacement)
+ {
+#if defined(__ICC) //x86 version
+ return _InterlockedCompareExchange((void*)ptr, replacement,
+ comparand) == comparand;
+#elif defined(__ECC) //IA-64 version
+ return _InterlockedCompareExchange((void*)ptr, replacement,
+ comparand) == comparand;
+#elif defined(__ICL) || defined(_MSC_VER)
+ return _InterlockedCompareExchange(reinterpret_cast<volatile long*>(ptr),
+ replacement, comparand) == comparand;
+#elif defined(__GNUC__)
+ return __sync_bool_compare_and_swap(ptr, comparand, replacement);
+#elif defined(__SUNPRO_CC) && defined(__sparc)
+ return atomic_cas_32((volatile unsigned int*)ptr, comparand,
+ replacement) == comparand;
+#else
+#pragma message("slow compare_and_swap_32")
+ bool res = false;
+#pragma omp critical
+ {
+ if (*ptr == comparand)
+ {
+ *ptr = replacement;
+ res = true;
+ }
+ }
+ return res;
+#endif
+ }
+
+ /** @brief Compare @c *ptr and @c comparand. If equal, let @c
+ * *ptr=replacement and return @c true, return @c false otherwise.
+ *
+ * Implementation is heavily platform-dependent.
+ * @param ptr Pointer to 64-bit signed integer.
+ * @param comparand Compare value.
+ * @param replacement Replacement value.
+ */
+ inline bool
+ compare_and_swap_64(volatile int64* ptr, int64 comparand, int64 replacement)
+ {
+#if defined(__ICC) && defined(__x86_64) //x86 version
+ return cas64<int>(ptr, comparand, replacement) == comparand;
+#elif defined(__ECC) //IA-64 version
+ return _InterlockedCompareExchange64((void*)ptr, replacement,
+ comparand) == comparand;
+#elif defined(__ICL) || defined(_MSC_VER)
+#ifndef _WIN64
+ _GLIBCXX_PARALLEL_ASSERT(false); //not available in this case
+ return 0;
+#else
+ return _InterlockedCompareExchange64(ptr, replacement,
+ comparand) == comparand;
+#endif
+
+#elif defined(__GNUC__) && defined(__x86_64)
+ return __sync_bool_compare_and_swap(ptr, comparand, replacement);
+#elif defined(__GNUC__) && defined(__i386) && \
+ (defined(__i686) || defined(__pentium4) || defined(__athlon))
+ return __sync_bool_compare_and_swap(ptr, comparand, replacement);
+#elif defined(__SUNPRO_CC) && defined(__sparc)
+ return atomic_cas_64((volatile unsigned long long*)ptr,
+ comparand, replacement) == comparand;
+#else
+#if defined(__GNUC__) && defined(__i386)
+ // XXX -march=native
+ //#warning "please compile with -march=i686 or better"
+#endif
+#pragma message("slow compare_and_swap_64")
+ bool res = false;
+#pragma omp critical
+ {
+ if (*ptr == comparand)
+ {
+ *ptr = replacement;
+ res = true;
+ }
+ }
+ return res;
+#endif
+ }
+
+ /** @brief Compare @c *ptr and @c comparand. If equal, let @c
+ * *ptr=replacement and return @c true, return @c false otherwise.
+ *
+ * Implementation is heavily platform-dependent.
+ * @param ptr Pointer to signed integer.
+ * @param comparand Compare value.
+ * @param replacement Replacement value. */
+ template<typename T>
+ inline bool
+ compare_and_swap(volatile T* ptr, T comparand, T replacement)
+ {
+ if (sizeof(T) == sizeof(int32))
+ return compare_and_swap_32((volatile int32*) ptr, (int32)comparand, (int32)replacement);
+ else if (sizeof(T) == sizeof(int64))
+ return compare_and_swap_64((volatile int64*) ptr, (int64)comparand, (int64)replacement);
+ else
+ _GLIBCXX_PARALLEL_ASSERT(false);
+ }
+
+ /** @brief Yield the control to another thread, without waiting for
+ the end to the time slice. */
+ inline void
+ yield()
+ {
+#if defined (_WIN32) && !defined (__CYGWIN__)
+ Sleep(0);
+#else
+ sched_yield();
+#endif
+ }
+} // end namespace
+
+#endif /* _GLIBCXX_PARALLEL_COMPATIBILITY_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/compiletime_settings.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/compiletime_settings.h
new file mode 100644
index 0000000..e7e31d0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/compiletime_settings.h
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/compiletime_settings.h
+ * @brief Defines on options concerning debugging and performance, at
+ * compile-time.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#include <cstdio>
+
+/** @brief Determine verbosity level of the parallel mode.
+ * Level 1 prints a message each time a parallel-mode function is entered. */
+#define _GLIBCXX_VERBOSE_LEVEL 0
+
+/** @def _GLIBCXX_CALL
+ * @brief Macro to produce log message when entering a function.
+ * @param n Input size.
+ * @see _GLIBCXX_VERBOSE_LEVEL */
+#if (_GLIBCXX_VERBOSE_LEVEL == 0)
+#define _GLIBCXX_CALL(n)
+#endif
+#if (_GLIBCXX_VERBOSE_LEVEL == 1)
+#define _GLIBCXX_CALL(n) \
+ printf(" %s:\niam = %d, n = %ld, num_threads = %d\n", \
+ __PRETTY_FUNCTION__, omp_get_thread_num(), (n), get_max_threads());
+#endif
+
+#ifndef _GLIBCXX_SCALE_DOWN_FPU
+/** @brief Use floating-point scaling instead of modulo for mapping
+ * random numbers to a range. This can be faster on certain CPUs. */
+#define _GLIBCXX_SCALE_DOWN_FPU 0
+#endif
+
+#ifndef _GLIBCXX_ASSERTIONS
+/** @brief Switch on many _GLIBCXX_PARALLEL_ASSERTions in parallel code.
+ * Should be switched on only locally. */
+#define _GLIBCXX_ASSERTIONS 0
+#endif
+
+#ifndef _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_L1
+/** @brief Switch on many _GLIBCXX_PARALLEL_ASSERTions in parallel code.
+ * Consider the size of the L1 cache for
+ * __gnu_parallel::parallel_random_shuffle(). */
+#define _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_L1 0
+#endif
+#ifndef _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_TLB
+/** @brief Switch on many _GLIBCXX_PARALLEL_ASSERTions in parallel code.
+ * Consider the size of the TLB for
+ * __gnu_parallel::parallel_random_shuffle(). */
+#define _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_TLB 0
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/equally_split.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/equally_split.h
new file mode 100644
index 0000000..ee4bfee
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/equally_split.h
@@ -0,0 +1,87 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/equally_split.h
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_EQUALLY_SPLIT_H
+#define _GLIBCXX_PARALLEL_EQUALLY_SPLIT_H 1
+
+namespace __gnu_parallel
+{
+/** @brief Function to split a sequence into parts of almost equal size.
+ *
+ * The resulting sequence s of length num_threads+1 contains the splitting
+ * positions when splitting the range [0,n) into parts of almost
+ * equal size (plus minus 1). The first entry is 0, the last one
+ * n. There may result empty parts.
+ * @param n Number of elements
+ * @param num_threads Number of parts
+ * @param s Splitters
+ * @returns End of splitter sequence, i. e. @c s+num_threads+1 */
+template<typename difference_type, typename OutputIterator>
+ OutputIterator
+ equally_split(difference_type n, thread_index_t num_threads, OutputIterator s)
+ {
+ difference_type chunk_length = n / num_threads;
+ difference_type num_longer_chunks = n % num_threads;
+ difference_type pos = 0;
+ for (thread_index_t i = 0; i < num_threads; ++i)
+ {
+ *s++ = pos;
+ pos += (i < num_longer_chunks) ? (chunk_length + 1) : chunk_length;
+ }
+ *s++ = n;
+ return s;
+ }
+
+
+/** @brief Function to split a sequence into parts of almost equal size.
+ *
+ * Returns the position of the splitting point between
+ * thread number thread_no (included) and
+ * thread number thread_no+1 (excluded).
+ * @param n Number of elements
+ * @param num_threads Number of parts
+ * @returns _SplittingAlgorithm point */
+template<typename difference_type>
+ difference_type
+ equally_split_point(difference_type n,
+ thread_index_t num_threads,
+ thread_index_t thread_no)
+ {
+ difference_type chunk_length = n / num_threads;
+ difference_type num_longer_chunks = n % num_threads;
+ if (thread_no < num_longer_chunks)
+ return thread_no * (chunk_length + 1);
+ else
+ return num_longer_chunks * (chunk_length + 1)
+ + (thread_no - num_longer_chunks) * chunk_length;
+ }
+}
+
+#endif /* _GLIBCXX_PARALLEL_EQUALLY_SPLIT_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/features.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/features.h
new file mode 100644
index 0000000..417606e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/features.h
@@ -0,0 +1,104 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/features.h
+ * @brief Defines on whether to include algorithm variants.
+ *
+ * Less variants reduce executable size and compile time.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_FEATURES_H
+#define _GLIBCXX_PARALLEL_FEATURES_H 1
+
+#ifndef _GLIBCXX_MERGESORT
+/** @def _GLIBCXX_MERGESORT
+ * @brief Include parallel multi-way mergesort.
+ * @see __gnu_parallel::_Settings::sort_algorithm */
+#define _GLIBCXX_MERGESORT 1
+#endif
+
+#ifndef _GLIBCXX_QUICKSORT
+/** @def _GLIBCXX_QUICKSORT
+ * @brief Include parallel unbalanced quicksort.
+ * @see __gnu_parallel::_Settings::sort_algorithm */
+#define _GLIBCXX_QUICKSORT 1
+#endif
+
+#ifndef _GLIBCXX_BAL_QUICKSORT
+/** @def _GLIBCXX_BAL_QUICKSORT
+ * @brief Include parallel dynamically load-balanced quicksort.
+ * @see __gnu_parallel::_Settings::sort_algorithm */
+#define _GLIBCXX_BAL_QUICKSORT 1
+#endif
+
+#ifndef _GLIBCXX_FIND_GROWING_BLOCKS
+/** @brief Include the growing blocks variant for std::find.
+ * @see __gnu_parallel::_Settings::find_algorithm */
+#define _GLIBCXX_FIND_GROWING_BLOCKS 1
+#endif
+
+#ifndef _GLIBCXX_FIND_CONSTANT_SIZE_BLOCKS
+/** @brief Include the equal-sized blocks variant for std::find.
+ * @see __gnu_parallel::_Settings::find_algorithm */
+#define _GLIBCXX_FIND_CONSTANT_SIZE_BLOCKS 1
+#endif
+
+#ifndef _GLIBCXX_FIND_EQUAL_SPLIT
+/** @def _GLIBCXX_FIND_EQUAL_SPLIT
+ * @brief Include the equal splitting variant for std::find.
+ * @see __gnu_parallel::_Settings::find_algorithm */
+#define _GLIBCXX_FIND_EQUAL_SPLIT 1
+#endif
+
+
+#ifndef _GLIBCXX_TREE_INITIAL_SPLITTING
+/** @def _GLIBCXX_TREE_INITIAL_SPLITTING
+ * @brief Include the initial splitting variant for
+ * _Rb_tree::insert_unique(InputIterator beg, InputIterator end).
+ * @see __gnu_parallel::_Rb_tree */
+#define _GLIBCXX_TREE_INITIAL_SPLITTING 1
+#endif
+
+#ifndef _GLIBCXX_TREE_DYNAMIC_BALANCING
+/** @def _GLIBCXX_TREE_DYNAMIC_BALANCING
+ * @brief Include the dynamic balancing variant for
+ * _Rb_tree::insert_unique(InputIterator beg, InputIterator end).
+ * @see __gnu_parallel::_Rb_tree */
+#define _GLIBCXX_TREE_DYNAMIC_BALANCING 1
+#endif
+
+#ifndef _GLIBCXX_TREE_FULL_COPY
+/** @def _GLIBCXX_TREE_FULL_COPY
+ * @brief In order to sort the input sequence of
+ * _Rb_tree::insert_unique(InputIterator beg, InputIterator end) a
+ * full copy of the input elements is done.
+ * @see __gnu_parallel::_Rb_tree */
+#define _GLIBCXX_TREE_FULL_COPY 1
+#endif
+
+
+#endif /* _GLIBCXX_PARALLEL_FEATURES_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/find.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/find.h
new file mode 100644
index 0000000..0597cc5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/find.h
@@ -0,0 +1,401 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/find.h
+ * @brief Parallel implementation base for std::find(), std::equal()
+ * and related functions.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze and Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_FIND_H
+#define _GLIBCXX_PARALLEL_FIND_H 1
+
+#include <bits/stl_algobase.h>
+
+#include <parallel/features.h>
+#include <parallel/parallel.h>
+#include <parallel/compatibility.h>
+#include <parallel/equally_split.h>
+
+namespace __gnu_parallel
+{
+/**
+ * @brief Parallel std::find, switch for different algorithms.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence. Must have same
+ * length as first sequence.
+ * @param pred Find predicate.
+ * @param selector Functionality (e. g. std::find_if (), std::equal(),...)
+ * @return Place of finding in both sequences.
+ */
+template<typename RandomAccessIterator1,
+ typename RandomAccessIterator2,
+ typename Pred,
+ typename Selector>
+ inline std::pair<RandomAccessIterator1, RandomAccessIterator2>
+ find_template(RandomAccessIterator1 begin1, RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, Pred pred, Selector selector)
+ {
+ switch (_Settings::get().find_algorithm)
+ {
+ case GROWING_BLOCKS:
+ return find_template(begin1, end1, begin2, pred, selector,
+ growing_blocks_tag());
+ case CONSTANT_SIZE_BLOCKS:
+ return find_template(begin1, end1, begin2, pred, selector,
+ constant_size_blocks_tag());
+ case EQUAL_SPLIT:
+ return find_template(begin1, end1, begin2, pred, selector,
+ equal_split_tag());
+ default:
+ _GLIBCXX_PARALLEL_ASSERT(false);
+ return std::make_pair(begin1, begin2);
+ }
+ }
+
+#if _GLIBCXX_FIND_EQUAL_SPLIT
+
+/**
+ * @brief Parallel std::find, equal splitting variant.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence. Second sequence
+ * must have same length as first sequence.
+ * @param pred Find predicate.
+ * @param selector Functionality (e. g. std::find_if (), std::equal(),...)
+ * @return Place of finding in both sequences.
+ */
+template<typename RandomAccessIterator1,
+ typename RandomAccessIterator2,
+ typename Pred,
+ typename Selector>
+ std::pair<RandomAccessIterator1, RandomAccessIterator2>
+ find_template(RandomAccessIterator1 begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2,
+ Pred pred,
+ Selector selector,
+ equal_split_tag)
+ {
+ _GLIBCXX_CALL(end1 - begin1)
+
+ typedef std::iterator_traits<RandomAccessIterator1> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef typename traits_type::value_type value_type;
+
+ difference_type length = end1 - begin1;
+ difference_type result = length;
+ difference_type* borders;
+
+ omp_lock_t result_lock;
+ omp_init_lock(&result_lock);
+
+ thread_index_t num_threads = get_max_threads();
+# pragma omp parallel num_threads(num_threads)
+ {
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+ borders = new difference_type[num_threads + 1];
+ equally_split(length, num_threads, borders);
+ } //single
+
+ thread_index_t iam = omp_get_thread_num();
+ difference_type start = borders[iam], stop = borders[iam + 1];
+
+ RandomAccessIterator1 i1 = begin1 + start;
+ RandomAccessIterator2 i2 = begin2 + start;
+ for (difference_type pos = start; pos < stop; ++pos)
+ {
+ #pragma omp flush(result)
+ // Result has been set to something lower.
+ if (result < pos)
+ break;
+
+ if (selector(i1, i2, pred))
+ {
+ omp_set_lock(&result_lock);
+ if (pos < result)
+ result = pos;
+ omp_unset_lock(&result_lock);
+ break;
+ }
+ ++i1;
+ ++i2;
+ }
+ } //parallel
+
+ omp_destroy_lock(&result_lock);
+ delete[] borders;
+
+ return
+ std::pair<RandomAccessIterator1, RandomAccessIterator2>(begin1 + result,
+ begin2 + result);
+ }
+
+#endif
+
+#if _GLIBCXX_FIND_GROWING_BLOCKS
+
+/**
+ * @brief Parallel std::find, growing block size variant.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence. Second sequence
+ * must have same length as first sequence.
+ * @param pred Find predicate.
+ * @param selector Functionality (e. g. std::find_if (), std::equal(),...)
+ * @return Place of finding in both sequences.
+ * @see __gnu_parallel::_Settings::find_sequential_search_size
+ * @see __gnu_parallel::_Settings::find_initial_block_size
+ * @see __gnu_parallel::_Settings::find_maximum_block_size
+ * @see __gnu_parallel::_Settings::find_increasing_factor
+ *
+ * There are two main differences between the growing blocks and
+ * the constant-size blocks variants.
+ * 1. For GB, the block size grows; for CSB, the block size is fixed.
+
+ * 2. For GB, the blocks are allocated dynamically;
+ * for CSB, the blocks are allocated in a predetermined manner,
+ * namely spacial round-robin.
+ */
+template<typename RandomAccessIterator1,
+ typename RandomAccessIterator2,
+ typename Pred,
+ typename Selector>
+ std::pair<RandomAccessIterator1, RandomAccessIterator2>
+ find_template(RandomAccessIterator1 begin1, RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, Pred pred, Selector selector,
+ growing_blocks_tag)
+ {
+ _GLIBCXX_CALL(end1 - begin1)
+
+ typedef std::iterator_traits<RandomAccessIterator1> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef typename traits_type::value_type value_type;
+
+ const _Settings& __s = _Settings::get();
+
+ difference_type length = end1 - begin1;
+
+ difference_type sequential_search_size =
+ std::min<difference_type>(length, __s.find_sequential_search_size);
+
+ // Try it sequentially first.
+ std::pair<RandomAccessIterator1, RandomAccessIterator2> find_seq_result =
+ selector.sequential_algorithm(
+ begin1, begin1 + sequential_search_size, begin2, pred);
+
+ if (find_seq_result.first != (begin1 + sequential_search_size))
+ return find_seq_result;
+
+ // Index of beginning of next free block (after sequential find).
+ difference_type next_block_start = sequential_search_size;
+ difference_type result = length;
+
+ omp_lock_t result_lock;
+ omp_init_lock(&result_lock);
+
+ thread_index_t num_threads = get_max_threads();
+# pragma omp parallel shared(result) num_threads(num_threads)
+ {
+# pragma omp single
+ num_threads = omp_get_num_threads();
+
+ // Not within first k elements -> start parallel.
+ thread_index_t iam = omp_get_thread_num();
+
+ difference_type block_size = __s.find_initial_block_size;
+ difference_type start =
+ fetch_and_add<difference_type>(&next_block_start, block_size);
+
+ // Get new block, update pointer to next block.
+ difference_type stop =
+ std::min<difference_type>(length, start + block_size);
+
+ std::pair<RandomAccessIterator1, RandomAccessIterator2> local_result;
+
+ while (start < length)
+ {
+# pragma omp flush(result)
+ // Get new value of result.
+ if (result < start)
+ {
+ // No chance to find first element.
+ break;
+ }
+
+ local_result = selector.sequential_algorithm(
+ begin1 + start, begin1 + stop, begin2 + start, pred);
+ if (local_result.first != (begin1 + stop))
+ {
+ omp_set_lock(&result_lock);
+ if ((local_result.first - begin1) < result)
+ {
+ result = local_result.first - begin1;
+
+ // Result cannot be in future blocks, stop algorithm.
+ fetch_and_add<difference_type>(&next_block_start, length);
+ }
+ omp_unset_lock(&result_lock);
+ }
+
+ block_size =
+ std::min<difference_type>(block_size * __s.find_increasing_factor,
+ __s.find_maximum_block_size);
+
+ // Get new block, update pointer to next block.
+ start =
+ fetch_and_add<difference_type>(&next_block_start, block_size);
+ stop = ((length < (start + block_size))
+ ? length : (start + block_size));
+ }
+ } //parallel
+
+ omp_destroy_lock(&result_lock);
+
+ // Return iterator on found element.
+ return
+ std::pair<RandomAccessIterator1, RandomAccessIterator2>(begin1 + result,
+ begin2 + result);
+ }
+
+#endif
+
+#if _GLIBCXX_FIND_CONSTANT_SIZE_BLOCKS
+
+/**
+ * @brief Parallel std::find, constant block size variant.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence. Second sequence
+ * must have same length as first sequence.
+ * @param pred Find predicate.
+ * @param selector Functionality (e. g. std::find_if (), std::equal(),...)
+ * @return Place of finding in both sequences.
+ * @see __gnu_parallel::_Settings::find_sequential_search_size
+ * @see __gnu_parallel::_Settings::find_block_size
+ * There are two main differences between the growing blocks and the
+ * constant-size blocks variants.
+ * 1. For GB, the block size grows; for CSB, the block size is fixed.
+ * 2. For GB, the blocks are allocated dynamically; for CSB, the
+ * blocks are allocated in a predetermined manner, namely spacial
+ * round-robin.
+ */
+template<typename RandomAccessIterator1,
+ typename RandomAccessIterator2,
+ typename Pred,
+ typename Selector>
+ std::pair<RandomAccessIterator1, RandomAccessIterator2>
+ find_template(RandomAccessIterator1 begin1, RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, Pred pred, Selector selector,
+ constant_size_blocks_tag)
+ {
+ _GLIBCXX_CALL(end1 - begin1)
+ typedef std::iterator_traits<RandomAccessIterator1> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef typename traits_type::value_type value_type;
+
+ const _Settings& __s = _Settings::get();
+
+ difference_type length = end1 - begin1;
+
+ difference_type sequential_search_size = std::min<difference_type>(
+ length, __s.find_sequential_search_size);
+
+ // Try it sequentially first.
+ std::pair<RandomAccessIterator1, RandomAccessIterator2> find_seq_result =
+ selector.sequential_algorithm(begin1, begin1 + sequential_search_size,
+ begin2, pred);
+
+ if (find_seq_result.first != (begin1 + sequential_search_size))
+ return find_seq_result;
+
+ difference_type result = length;
+ omp_lock_t result_lock;
+ omp_init_lock(&result_lock);
+
+ // Not within first sequential_search_size elements -> start parallel.
+
+ thread_index_t num_threads = get_max_threads();
+# pragma omp parallel shared(result) num_threads(num_threads)
+ {
+# pragma omp single
+ num_threads = omp_get_num_threads();
+
+ thread_index_t iam = omp_get_thread_num();
+ difference_type block_size = __s.find_initial_block_size;
+
+ // First element of thread's current iteration.
+ difference_type iteration_start = sequential_search_size;
+
+ // Where to work (initialization).
+ difference_type start = iteration_start + iam * block_size;
+ difference_type stop =
+ std::min<difference_type>(length, start + block_size);
+
+ std::pair<RandomAccessIterator1, RandomAccessIterator2> local_result;
+
+ while (start < length)
+ {
+ // Get new value of result.
+# pragma omp flush(result)
+ // No chance to find first element.
+ if (result < start)
+ break;
+ local_result = selector.sequential_algorithm(
+ begin1 + start, begin1 + stop,
+ begin2 + start, pred);
+ if (local_result.first != (begin1 + stop))
+ {
+ omp_set_lock(&result_lock);
+ if ((local_result.first - begin1) < result)
+ result = local_result.first - begin1;
+ omp_unset_lock(&result_lock);
+ // Will not find better value in its interval.
+ break;
+ }
+
+ iteration_start += num_threads * block_size;
+
+ // Where to work.
+ start = iteration_start + iam * block_size;
+ stop = std::min<difference_type>(length, start + block_size);
+ }
+ } //parallel
+
+ omp_destroy_lock(&result_lock);
+
+ // Return iterator on found element.
+ return
+ std::pair<RandomAccessIterator1, RandomAccessIterator2>(begin1 + result,
+ begin2 + result);
+ }
+#endif
+} // end namespace
+
+#endif /* _GLIBCXX_PARALLEL_FIND_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/find_selectors.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/find_selectors.h
new file mode 100644
index 0000000..3cbc1b8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/find_selectors.h
@@ -0,0 +1,192 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/find_selectors.h
+ * @brief Function objects representing different tasks to be plugged
+ * into the parallel find algorithm.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_FIND_SELECTORS_H
+#define _GLIBCXX_PARALLEL_FIND_SELECTORS_H 1
+
+#include <parallel/tags.h>
+#include <parallel/basic_iterator.h>
+#include <bits/stl_pair.h>
+
+namespace __gnu_parallel
+{
+ /** @brief Base class of all __gnu_parallel::find_template selectors. */
+ struct generic_find_selector
+ { };
+
+ /**
+ * @brief Test predicate on a single element, used for std::find()
+ * and std::find_if ().
+ */
+ struct find_if_selector : public generic_find_selector
+ {
+ /** @brief Test on one position.
+ * @param i1 Iterator on first sequence.
+ * @param i2 Iterator on second sequence (unused).
+ * @param pred Find predicate.
+ */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename Pred>
+ bool
+ operator()(RandomAccessIterator1 i1, RandomAccessIterator2 i2, Pred pred)
+ { return pred(*i1); }
+
+ /** @brief Corresponding sequential algorithm on a sequence.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence.
+ * @param pred Find predicate.
+ */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename Pred>
+ std::pair<RandomAccessIterator1, RandomAccessIterator2>
+ sequential_algorithm(RandomAccessIterator1 begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, Pred pred)
+ { return std::make_pair(find_if(begin1, end1, pred,
+ sequential_tag()), begin2); }
+ };
+
+ /** @brief Test predicate on two adjacent elements. */
+ struct adjacent_find_selector : public generic_find_selector
+ {
+ /** @brief Test on one position.
+ * @param i1 Iterator on first sequence.
+ * @param i2 Iterator on second sequence (unused).
+ * @param pred Find predicate.
+ */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename Pred>
+ bool
+ operator()(RandomAccessIterator1 i1, RandomAccessIterator2 i2, Pred pred)
+ {
+ // Passed end iterator is one short.
+ return pred(*i1, *(i1 + 1));
+ }
+
+ /** @brief Corresponding sequential algorithm on a sequence.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence.
+ * @param pred Find predicate.
+ */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename Pred>
+ std::pair<RandomAccessIterator1, RandomAccessIterator2>
+ sequential_algorithm(RandomAccessIterator1 begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, Pred pred)
+ {
+ // Passed end iterator is one short.
+ RandomAccessIterator1 spot = adjacent_find(begin1, end1 + 1,
+ pred, sequential_tag());
+ if (spot == (end1 + 1))
+ spot = end1;
+ return std::make_pair(spot, begin2);
+ }
+ };
+
+ /** @brief Test inverted predicate on a single element. */
+ struct mismatch_selector : public generic_find_selector
+ {
+ /**
+ * @brief Test on one position.
+ * @param i1 Iterator on first sequence.
+ * @param i2 Iterator on second sequence (unused).
+ * @param pred Find predicate.
+ */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename Pred>
+ bool
+ operator()(RandomAccessIterator1 i1, RandomAccessIterator2 i2, Pred pred)
+ { return !pred(*i1, *i2); }
+
+ /**
+ * @brief Corresponding sequential algorithm on a sequence.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence.
+ * @param pred Find predicate.
+ */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename Pred>
+ std::pair<RandomAccessIterator1, RandomAccessIterator2>
+ sequential_algorithm(RandomAccessIterator1 begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, Pred pred)
+ { return mismatch(begin1, end1, begin2, pred, sequential_tag()); }
+ };
+
+
+ /** @brief Test predicate on several elements. */
+ template<typename ForwardIterator>
+ struct find_first_of_selector : public generic_find_selector
+ {
+ ForwardIterator begin;
+ ForwardIterator end;
+
+ explicit find_first_of_selector(ForwardIterator begin, ForwardIterator end)
+ : begin(begin), end(end) { }
+
+ /** @brief Test on one position.
+ * @param i1 Iterator on first sequence.
+ * @param i2 Iterator on second sequence (unused).
+ * @param pred Find predicate. */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename Pred>
+ bool
+ operator()(RandomAccessIterator1 i1, RandomAccessIterator2 i2, Pred pred)
+ {
+ for (ForwardIterator pos_in_candidates = begin;
+ pos_in_candidates != end; ++pos_in_candidates)
+ if (pred(*i1, *pos_in_candidates))
+ return true;
+ return false;
+ }
+
+ /** @brief Corresponding sequential algorithm on a sequence.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence.
+ * @param pred Find predicate. */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename Pred>
+ std::pair<RandomAccessIterator1, RandomAccessIterator2>
+ sequential_algorithm(RandomAccessIterator1 begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2 begin2, Pred pred)
+ { return std::make_pair(find_first_of(begin1, end1, begin, end, pred,
+ sequential_tag()), begin2); }
+ };
+}
+
+#endif /* _GLIBCXX_PARALLEL_FIND_SELECTORS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/for_each.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/for_each.h
new file mode 100644
index 0000000..61158f8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/for_each.h
@@ -0,0 +1,97 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/for_each.h
+ * @brief Main interface for embarrassingly parallel functions.
+ *
+ * The explicit implementation are in other header files, like
+ * workstealing.h, par_loop.h, omp_loop.h, and omp_loop_static.h.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_FOR_EACH_H
+#define _GLIBCXX_PARALLEL_FOR_EACH_H 1
+
+#include <parallel/settings.h>
+#include <parallel/par_loop.h>
+#include <parallel/omp_loop.h>
+#include <parallel/workstealing.h>
+
+namespace __gnu_parallel
+{
+ /** @brief Chose the desired algorithm by evaluating @c parallelism_tag.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param user_op A user-specified functor (comparator, predicate,
+ * associative operator,...)
+ * @param functionality functor to "process" an element with
+ * user_op (depends on desired functionality, e. g. accumulate,
+ * for_each,...
+ * @param reduction Reduction functor.
+ * @param reduction_start Initial value for reduction.
+ * @param output Output iterator.
+ * @param bound Maximum number of elements processed.
+ * @param parallelism_tag Parallelization method */
+ template<typename InputIterator, typename UserOp,
+ typename Functionality, typename Red, typename Result>
+ UserOp
+ for_each_template_random_access(InputIterator begin, InputIterator end,
+ UserOp user_op,
+ Functionality& functionality,
+ Red reduction, Result reduction_start,
+ Result& output, typename
+ std::iterator_traits<InputIterator>::
+ difference_type bound,
+ _Parallelism parallelism_tag)
+ {
+ if (parallelism_tag == parallel_unbalanced)
+ return for_each_template_random_access_ed(begin, end, user_op,
+ functionality, reduction,
+ reduction_start,
+ output, bound);
+ else if (parallelism_tag == parallel_omp_loop)
+ return for_each_template_random_access_omp_loop(begin, end, user_op,
+ functionality,
+ reduction,
+ reduction_start,
+ output, bound);
+ else if (parallelism_tag == parallel_omp_loop_static)
+ return for_each_template_random_access_omp_loop(begin, end, user_op,
+ functionality,
+ reduction,
+ reduction_start,
+ output, bound);
+ else //e. g. parallel_balanced
+ return for_each_template_random_access_workstealing(begin, end,
+ user_op,
+ functionality,
+ reduction,
+ reduction_start,
+ output, bound);
+ }
+}
+
+#endif /* _GLIBCXX_PARALLEL_FOR_EACH_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/for_each_selectors.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/for_each_selectors.h
new file mode 100644
index 0000000..b46d30f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/for_each_selectors.h
@@ -0,0 +1,360 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/for_each_selectors.h
+ * @brief Functors representing different tasks to be plugged into the
+ * generic parallelization methods for embarrassingly parallel functions.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_FOR_EACH_SELECTORS_H
+#define _GLIBCXX_PARALLEL_FOR_EACH_SELECTORS_H 1
+
+#include <parallel/basic_iterator.h>
+
+namespace __gnu_parallel
+{
+
+ /** @brief Generic selector for embarrassingly parallel functions. */
+ template<typename It>
+ struct generic_for_each_selector
+ {
+ /** @brief Iterator on last element processed; needed for some
+ * algorithms (e. g. std::transform()).
+ */
+ It finish_iterator;
+ };
+
+
+ /** @brief std::for_each() selector. */
+ template<typename It>
+ struct for_each_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Functor execution.
+ * @param o Operator.
+ * @param i Iterator referencing object. */
+ template<typename Op>
+ bool
+ operator()(Op& o, It i)
+ {
+ o(*i);
+ return true;
+ }
+ };
+
+ /** @brief std::generate() selector. */
+ template<typename It>
+ struct generate_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Functor execution.
+ * @param o Operator.
+ * @param i Iterator referencing object. */
+ template<typename Op>
+ bool
+ operator()(Op& o, It i)
+ {
+ *i = o();
+ return true;
+ }
+ };
+
+ /** @brief std::fill() selector. */
+ template<typename It>
+ struct fill_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Functor execution.
+ * @param v Current value.
+ * @param i Iterator referencing object. */
+ template<typename Val>
+ bool
+ operator()(Val& v, It i)
+ {
+ *i = v;
+ return true;
+ }
+ };
+
+ /** @brief std::transform() selector, one input sequence variant. */
+ template<typename It>
+ struct transform1_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Functor execution.
+ * @param o Operator.
+ * @param i Iterator referencing object. */
+ template<typename Op>
+ bool
+ operator()(Op& o, It i)
+ {
+ *i.second = o(*i.first);
+ return true;
+ }
+ };
+
+ /** @brief std::transform() selector, two input sequences variant. */
+ template<typename It>
+ struct transform2_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Functor execution.
+ * @param o Operator.
+ * @param i Iterator referencing object. */
+ template<typename Op>
+ bool
+ operator()(Op& o, It i)
+ {
+ *i.third = o(*i.first, *i.second);
+ return true;
+ }
+ };
+
+ /** @brief std::replace() selector. */
+ template<typename It, typename T>
+ struct replace_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Value to replace with. */
+ const T& new_val;
+
+ /** @brief Constructor
+ * @param new_val Value to replace with. */
+ explicit
+ replace_selector(const T &new_val) : new_val(new_val) {}
+
+ /** @brief Functor execution.
+ * @param v Current value.
+ * @param i Iterator referencing object. */
+ bool
+ operator()(T& v, It i)
+ {
+ if (*i == v)
+ *i = new_val;
+ return true;
+ }
+ };
+
+ /** @brief std::replace() selector. */
+ template<typename It, typename Op, typename T>
+ struct replace_if_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Value to replace with. */
+ const T& new_val;
+
+ /** @brief Constructor.
+ * @param new_val Value to replace with. */
+ explicit
+ replace_if_selector(const T &new_val) : new_val(new_val) { }
+
+ /** @brief Functor execution.
+ * @param o Operator.
+ * @param i Iterator referencing object. */
+ bool
+ operator()(Op& o, It i)
+ {
+ if (o(*i))
+ *i = new_val;
+ return true;
+ }
+ };
+
+ /** @brief std::count() selector. */
+ template<typename It, typename Diff>
+ struct count_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Functor execution.
+ * @param v Current value.
+ * @param i Iterator referencing object.
+ * @return 1 if count, 0 if does not count. */
+ template<typename Val>
+ Diff
+ operator()(Val& v, It i)
+ { return (v == *i) ? 1 : 0; }
+ };
+
+ /** @brief std::count_if () selector. */
+ template<typename It, typename Diff>
+ struct count_if_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Functor execution.
+ * @param o Operator.
+ * @param i Iterator referencing object.
+ * @return 1 if count, 0 if does not count. */
+ template<typename Op>
+ Diff
+ operator()(Op& o, It i)
+ { return (o(*i)) ? 1 : 0; }
+ };
+
+ /** @brief std::accumulate() selector. */
+ template<typename It>
+ struct accumulate_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Functor execution.
+ * @param o Operator (unused).
+ * @param i Iterator referencing object.
+ * @return The current value. */
+ template<typename Op>
+ typename std::iterator_traits<It>::value_type operator()(Op o, It i)
+ { return *i; }
+ };
+
+ /** @brief std::inner_product() selector. */
+ template<typename It, typename It2, typename T>
+ struct inner_product_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Begin iterator of first sequence. */
+ It begin1_iterator;
+
+ /** @brief Begin iterator of second sequence. */
+ It2 begin2_iterator;
+
+ /** @brief Constructor.
+ * @param b1 Begin iterator of first sequence.
+ * @param b2 Begin iterator of second sequence. */
+ explicit
+ inner_product_selector(It b1, It2 b2)
+ : begin1_iterator(b1), begin2_iterator(b2) { }
+
+ /** @brief Functor execution.
+ * @param mult Multiplication functor.
+ * @param current Iterator referencing object.
+ * @return Inner product elemental result. */
+ template<typename Op>
+ T
+ operator()(Op mult, It current)
+ {
+ typename std::iterator_traits<It>::difference_type position
+ = current - begin1_iterator;
+ return mult(*current, *(begin2_iterator + position));
+ }
+ };
+
+ /** @brief Selector that just returns the passed iterator. */
+ template<typename It>
+ struct identity_selector : public generic_for_each_selector<It>
+ {
+ /** @brief Functor execution.
+ * @param o Operator (unused).
+ * @param i Iterator referencing object.
+ * @return Passed iterator. */
+ template<typename Op>
+ It
+ operator()(Op o, It i)
+ { return i; }
+ };
+
+ /** @brief Selector that returns the difference between two adjacent
+ * elements.
+ */
+ template<typename It>
+ struct adjacent_difference_selector : public generic_for_each_selector<It>
+ {
+ template<typename Op>
+ bool
+ operator()(Op& o, It i)
+ {
+ typename It::first_type go_back_one = i.first;
+ --go_back_one;
+ *i.second = o(*i.first, *go_back_one);
+ return true;
+ }
+ };
+
+ // XXX move into type_traits?
+ /** @brief Functor doing nothing
+ *
+ * For some reduction tasks (this is not a function object, but is
+ * passed as selector dummy parameter.
+ */
+ struct nothing
+ {
+ /** @brief Functor execution.
+ * @param i Iterator referencing object. */
+ template<typename It>
+ void
+ operator()(It i) { }
+ };
+
+ /** @brief Reduction function doing nothing. */
+ struct dummy_reduct
+ {
+ bool
+ operator()(bool /*x*/, bool /*y*/) const
+ { return true; }
+ };
+
+ /** @brief Reduction for finding the maximum element, using a comparator. */
+ template<typename Comp, typename It>
+ struct min_element_reduct
+ {
+ Comp& comp;
+
+ explicit
+ min_element_reduct(Comp &c) : comp(c) { }
+
+ It
+ operator()(It x, It y)
+ {
+ if (comp(*x, *y))
+ return x;
+ else
+ return y;
+ }
+ };
+
+ /** @brief Reduction for finding the maximum element, using a comparator. */
+ template<typename Comp, typename It>
+ struct max_element_reduct
+ {
+ Comp& comp;
+
+ explicit
+ max_element_reduct(Comp& c) : comp(c) { }
+
+ It
+ operator()(It x, It y)
+ {
+ if (comp(*x, *y))
+ return y;
+ else
+ return x;
+ }
+ };
+
+ /** @brief General reduction, using a binary operator. */
+ template<typename BinOp>
+ struct accumulate_binop_reduct
+ {
+ BinOp& binop;
+
+ explicit
+ accumulate_binop_reduct(BinOp& b) : binop(b) { }
+
+ template<typename Result, typename Addend>
+ Result
+ operator()(const Result& x, const Addend& y)
+ { return binop(x, y); }
+ };
+}
+
+#endif /* _GLIBCXX_PARALLEL_FOR_EACH_SELECTORS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/iterator.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/iterator.h
new file mode 100644
index 0000000..c9bfd5a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/iterator.h
@@ -0,0 +1,200 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/iterator.h
+ * @brief Helper iterator classes for the std::transform() functions.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_ITERATOR_H
+#define _GLIBCXX_PARALLEL_ITERATOR_H 1
+
+#include <parallel/basic_iterator.h>
+#include <bits/stl_pair.h>
+
+namespace __gnu_parallel
+{
+ /** @brief A pair of iterators. The usual iterator operations are
+ * applied to both child iterators.
+ */
+ template<typename Iterator1, typename Iterator2, typename IteratorCategory>
+ class iterator_pair : public std::pair<Iterator1, Iterator2>
+ {
+ private:
+ typedef iterator_pair<Iterator1, Iterator2, IteratorCategory> type;
+ typedef std::pair<Iterator1, Iterator2> base_type;
+
+ public:
+ typedef IteratorCategory iterator_category;
+ typedef void value_type;
+
+ typedef std::iterator_traits<Iterator1> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef type* pointer;
+ typedef type& reference;
+
+ iterator_pair() { }
+
+ iterator_pair(const Iterator1& first, const Iterator2& second)
+ : base_type(first, second) { }
+
+ // Pre-increment operator.
+ type&
+ operator++()
+ {
+ ++base_type::first;
+ ++base_type::second;
+ return *this;
+ }
+
+ // Post-increment operator.
+ const type
+ operator++(int)
+ { return type(base_type::first++, base_type::second++); }
+
+ // Pre-decrement operator.
+ type&
+ operator--()
+ {
+ --base_type::first;
+ --base_type::second;
+ return *this;
+ }
+
+ // Post-decrement operator.
+ const type
+ operator--(int)
+ { return type(base_type::first--, base_type::second--); }
+
+ // Type conversion.
+ operator Iterator2() const
+ { return base_type::second; }
+
+ type&
+ operator=(const type& other)
+ {
+ base_type::first = other.first;
+ base_type::second = other.second;
+ return *this;
+ }
+
+ type
+ operator+(difference_type delta) const
+ { return type(base_type::first + delta, base_type::second + delta); }
+
+ difference_type
+ operator-(const type& other) const
+ { return base_type::first - other.first; }
+ };
+
+
+ /** @brief A triple of iterators. The usual iterator operations are
+ applied to all three child iterators.
+ */
+ template<typename Iterator1, typename Iterator2, typename Iterator3,
+ typename IteratorCategory>
+ class iterator_triple
+ {
+ private:
+ typedef iterator_triple<Iterator1, Iterator2, Iterator3,
+ IteratorCategory> type;
+
+ public:
+ typedef IteratorCategory iterator_category;
+ typedef void value_type;
+ typedef typename std::iterator_traits<Iterator1>::difference_type
+ difference_type;
+ typedef type* pointer;
+ typedef type& reference;
+
+ Iterator1 first;
+ Iterator2 second;
+ Iterator3 third;
+
+ iterator_triple() { }
+
+ iterator_triple(const Iterator1& _first, const Iterator2& _second,
+ const Iterator3& _third)
+ {
+ first = _first;
+ second = _second;
+ third = _third;
+ }
+
+ // Pre-increment operator.
+ type&
+ operator++()
+ {
+ ++first;
+ ++second;
+ ++third;
+ return *this;
+ }
+
+ // Post-increment operator.
+ const type
+ operator++(int)
+ { return type(first++, second++, third++); }
+
+ // Pre-decrement operator.
+ type&
+ operator--()
+ {
+ --first;
+ --second;
+ --third;
+ return *this;
+ }
+
+ // Post-decrement operator.
+ const type
+ operator--(int)
+ { return type(first--, second--, third--); }
+
+ // Type conversion.
+ operator Iterator3() const
+ { return third; }
+
+ type&
+ operator=(const type& other)
+ {
+ first = other.first;
+ second = other.second;
+ third = other.third;
+ return *this;
+ }
+
+ type
+ operator+(difference_type delta) const
+ { return type(first + delta, second + delta, third + delta); }
+
+ difference_type
+ operator-(const type& other) const
+ { return first - other.first; }
+ };
+}
+
+#endif /* _GLIBCXX_PARALLEL_ITERATOR_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/list_partition.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/list_partition.h
new file mode 100644
index 0000000..a359a3f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/list_partition.h
@@ -0,0 +1,176 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/list_partition.h
+ * @brief Functionality to split sequence referenced by only input
+ * iterators.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Leonor Frias Moya and Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_LIST_PARTITION_H
+#define _GLIBCXX_PARALLEL_LIST_PARTITION_H 1
+
+#include <parallel/parallel.h>
+#include <vector>
+
+namespace __gnu_parallel
+{
+ /** @brief Shrinks and doubles the ranges.
+ * @param os_starts Start positions worked on (oversampled).
+ * @param count_to_two Counts up to 2.
+ * @param range_length Current length of a chunk.
+ * @param make_twice Whether the @c os_starts is allowed to be
+ * grown or not
+ */
+ template<typename InputIterator>
+ void
+ shrink_and_double(std::vector<InputIterator>& os_starts,
+ size_t& count_to_two, size_t& range_length,
+ const bool make_twice)
+ {
+ ++count_to_two;
+ if (not make_twice or count_to_two < 2)
+ shrink(os_starts, count_to_two, range_length);
+ else
+ {
+ os_starts.resize((os_starts.size() - 1) * 2 + 1);
+ count_to_two = 0;
+ }
+ }
+
+ /** @brief Combines two ranges into one and thus halves the number of ranges.
+ * @param os_starts Start positions worked on (oversampled).
+ * @param count_to_two Counts up to 2.
+ * @param range_length Current length of a chunk. */
+ template<typename InputIterator>
+ void
+ shrink(std::vector<InputIterator>& os_starts, size_t& count_to_two,
+ size_t& range_length)
+ {
+ for (typename std::vector<InputIterator>::size_type i = 0;
+ i <= (os_starts.size() / 2); ++i)
+ os_starts[i] = os_starts[i * 2];
+ range_length *= 2;
+ }
+
+ /** @brief Splits a sequence given by input iterators into parts of
+ * almost equal size
+ *
+ * The function needs only one pass over the sequence.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param starts Start iterators for the resulting parts, dimension
+ * @c num_parts+1. For convenience, @c starts @c [num_parts]
+ * contains the end iterator of the sequence.
+ * @param lengths Length of the resulting parts.
+ * @param num_parts Number of parts to split the sequence into.
+ * @param f Functor to be applied to each element by traversing it
+ * @param oversampling Oversampling factor. If 0, then the
+ * partitions will differ in at most @f$ \sqrt{\mathrm{end} -
+ * \mathrm{begin}} @f$ elements. Otherwise, the ratio between the
+ * longest and the shortest part is bounded by @f$
+ * 1/(\mathrm{oversampling} \cdot \mathrm{num\_parts}) @f$.
+ * @return Length of the whole sequence.
+ */
+ template<typename InputIterator, typename FunctorType>
+ size_t
+ list_partition(const InputIterator begin, const InputIterator end,
+ InputIterator* starts, size_t* lengths, const int num_parts,
+ FunctorType& f, int oversampling = 0)
+ {
+ bool make_twice = false;
+
+ // The resizing algorithm is chosen according to the oversampling factor.
+ if (oversampling == 0)
+ {
+ make_twice = true;
+ oversampling = 1;
+ }
+
+ std::vector<InputIterator> os_starts(2 * oversampling * num_parts + 1);
+
+ os_starts[0]= begin;
+ InputIterator prev = begin, it = begin;
+ size_t dist_limit = 0, dist = 0;
+ size_t cur = 1, next = 1;
+ size_t range_length = 1;
+ size_t count_to_two = 0;
+ while (it != end)
+ {
+ cur = next;
+ for (; cur < os_starts.size() and it != end; ++cur)
+ {
+ for (dist_limit += range_length;
+ dist < dist_limit and it != end; ++dist)
+ {
+ f(it);
+ ++it;
+ }
+ os_starts[cur] = it;
+ }
+
+ // Must compare for end and not cur < os_starts.size() , because
+ // cur could be == os_starts.size() as well
+ if (it == end)
+ break;
+
+ shrink_and_double(os_starts, count_to_two, range_length, make_twice);
+ next = os_starts.size() / 2 + 1;
+ }
+
+ // Calculation of the parts (one must be extracted from current
+ // because the partition beginning at end, consists only of
+ // itself).
+ size_t size_part = (cur - 1) / num_parts;
+ int size_greater = static_cast<int>((cur - 1) % num_parts);
+ starts[0] = os_starts[0];
+
+ size_t index = 0;
+
+ // Smallest partitions.
+ for (int i = 1; i < (num_parts + 1 - size_greater); ++i)
+ {
+ lengths[i - 1] = size_part * range_length;
+ index += size_part;
+ starts[i] = os_starts[index];
+ }
+
+ // Biggest partitions.
+ for (int i = num_parts + 1 - size_greater; i <= num_parts; ++i)
+ {
+ lengths[i - 1] = (size_part+1) * range_length;
+ index += (size_part+1);
+ starts[i] = os_starts[index];
+ }
+
+ // Correction of the end size (the end iteration has not finished).
+ lengths[num_parts - 1] -= (dist_limit - dist);
+
+ return dist;
+ }
+}
+
+#endif /* _GLIBCXX_PARALLEL_LIST_PARTITION_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/losertree.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/losertree.h
new file mode 100644
index 0000000..6dbd592
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/losertree.h
@@ -0,0 +1,1021 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/losertree.h
+* @brief Many generic loser tree variants.
+* This file is a GNU parallel extension to the Standard C++ Library.
+*/
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_LOSERTREE_H
+#define _GLIBCXX_PARALLEL_LOSERTREE_H 1
+
+#include <functional>
+
+#include <bits/stl_algobase.h>
+#include <parallel/features.h>
+#include <parallel/base.h>
+
+namespace __gnu_parallel
+{
+
+/**
+ * @brief Guarded loser/tournament tree.
+ *
+ * The smallest element is at the top.
+ *
+ * Guarding is done explicitly through one flag sup per element,
+ * inf is not needed due to a better initialization routine. This
+ * is a well-performing variant.
+ *
+ * @param T the element type
+ * @param Comparator the comparator to use, defaults to std::less<T>
+ */
+template<typename T, typename Comparator>
+class LoserTreeBase
+{
+protected:
+ /** @brief Internal representation of a LoserTree element. */
+ struct Loser
+ {
+ /** @brief flag, true iff this is a "maximum" sentinel. */
+ bool sup;
+ /** @brief index of the source sequence. */
+ int source;
+ /** @brief key of the element in the LoserTree. */
+ T key;
+ };
+
+ unsigned int ik, k, offset;
+
+ /** log_2{k} */
+ unsigned int _M_log_k;
+
+ /** @brief LoserTree elements. */
+ Loser* losers;
+
+ /** @brief Comparator to use. */
+ Comparator comp;
+
+ /**
+ * @brief State flag that determines whether the LoserTree is empty.
+ *
+ * Only used for building the LoserTree.
+ */
+ bool first_insert;
+
+public:
+ /**
+ * @brief The constructor.
+ *
+ * @param _k The number of sequences to merge.
+ * @param _comp The comparator to use.
+ */
+ LoserTreeBase(unsigned int _k, Comparator _comp)
+ : comp(_comp)
+ {
+ ik = _k;
+
+ // Compute log_2{k} for the Loser Tree
+ _M_log_k = __log2(ik - 1) + 1;
+
+ // Next greater power of 2.
+ k = 1 << _M_log_k;
+ offset = k;
+
+ // Avoid default-constructing losers[].key
+ losers = static_cast<Loser*>(::operator new(2 * k * sizeof(Loser)));
+ for (unsigned int i = ik - 1; i < k; ++i)
+ losers[i + k].sup = true;
+
+ first_insert = true;
+ }
+
+ /**
+ * @brief The destructor.
+ */
+ ~LoserTreeBase()
+ { ::operator delete(losers); }
+
+ /**
+ * @brief Initializes the sequence "source" with the element "key".
+ *
+ * @param key the element to insert
+ * @param source index of the source sequence
+ * @param sup flag that determines whether the value to insert is an
+ * explicit supremum.
+ */
+ inline void
+ insert_start(const T& key, int source, bool sup)
+ {
+ unsigned int pos = k + source;
+
+ if(first_insert)
+ {
+ // Construct all keys, so we can easily deconstruct them.
+ for (unsigned int i = 0; i < (2 * k); ++i)
+ new(&(losers[i].key)) T(key);
+ first_insert = false;
+ }
+ else
+ new(&(losers[pos].key)) T(key);
+
+ losers[pos].sup = sup;
+ losers[pos].source = source;
+ }
+
+ /**
+ * @return the index of the sequence with the smallest element.
+ */
+ int get_min_source()
+ { return losers[0].source; }
+};
+
+/**
+ * @brief Stable LoserTree variant.
+ *
+ * Provides the stable implementations of insert_start, init_winner,
+ * init and delete_min_insert.
+ *
+ * Unstable variant is done using partial specialisation below.
+ */
+template<bool stable/* default == true */, typename T, typename Comparator>
+class LoserTree : public LoserTreeBase<T, Comparator>
+{
+ typedef LoserTreeBase<T, Comparator> Base;
+ using Base::k;
+ using Base::losers;
+ using Base::first_insert;
+
+public:
+ LoserTree(unsigned int _k, Comparator _comp)
+ : Base::LoserTreeBase(_k, _comp)
+ {}
+
+ unsigned int
+ init_winner(unsigned int root)
+ {
+ if (root >= k)
+ {
+ return root;
+ }
+ else
+ {
+ unsigned int left = init_winner (2 * root);
+ unsigned int right = init_winner (2 * root + 1);
+ if (losers[right].sup
+ || (!losers[left].sup
+ && !comp(losers[right].key, losers[left].key)))
+ {
+ // Left one is less or equal.
+ losers[root] = losers[right];
+ return left;
+ }
+ else
+ {
+ // Right one is less.
+ losers[root] = losers[left];
+ return right;
+ }
+ }
+ }
+
+ void init()
+ { losers[0] = losers[init_winner(1)]; }
+
+ /**
+ * @brief Delete the smallest element and insert a new element from
+ * the previously smallest element's sequence.
+ *
+ * This implementation is stable.
+ */
+ // Do not pass a const reference since key will be used as local variable.
+ void delete_min_insert(T key, bool sup)
+ {
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+
+ int source = losers[0].source;
+ for (unsigned int pos = (k + source) / 2; pos > 0; pos /= 2)
+ {
+ // The smaller one gets promoted, ties are broken by source.
+ if ((sup && (!losers[pos].sup || losers[pos].source < source))
+ || (!sup && !losers[pos].sup
+ && ((comp(losers[pos].key, key))
+ || (!comp(key, losers[pos].key)
+ && losers[pos].source < source))))
+ {
+ // The other one is smaller.
+ std::swap(losers[pos].sup, sup);
+ std::swap(losers[pos].source, source);
+ std::swap(losers[pos].key, key);
+ }
+ }
+
+ losers[0].sup = sup;
+ losers[0].source = source;
+ losers[0].key = key;
+ }
+};
+
+/**
+ * @brief Unstable LoserTree variant.
+ *
+ * Stability (non-stable here) is selected with partial specialization.
+ */
+template<typename T, typename Comparator>
+class LoserTree</* stable == */false, T, Comparator> :
+ public LoserTreeBase<T, Comparator>
+{
+ typedef LoserTreeBase<T, Comparator> Base;
+ using Base::_M_log_k;
+ using Base::k;
+ using Base::losers;
+ using Base::first_insert;
+
+public:
+ LoserTree(unsigned int _k, Comparator _comp)
+ : Base::LoserTreeBase(_k, _comp)
+ {}
+
+ /**
+ * Computes the winner of the competition at position "root".
+ *
+ * Called recursively (starting at 0) to build the initial tree.
+ *
+ * @param root index of the "game" to start.
+ */
+ unsigned int
+ init_winner (unsigned int root)
+ {
+ if (root >= k)
+ {
+ return root;
+ }
+ else
+ {
+ unsigned int left = init_winner (2 * root);
+ unsigned int right = init_winner (2 * root + 1);
+ if (losers[right].sup ||
+ (!losers[left].sup
+ && !comp(losers[right].key, losers[left].key)))
+ {
+ // Left one is less or equal.
+ losers[root] = losers[right];
+ return left;
+ }
+ else
+ {
+ // Right one is less.
+ losers[root] = losers[left];
+ return right;
+ }
+ }
+ }
+
+ inline void
+ init()
+ { losers[0] = losers[init_winner(1)]; }
+
+ /**
+ * Delete the key smallest element and insert the element key instead.
+ *
+ * @param key the key to insert
+ * @param sup true iff key is an explicitly marked supremum
+ */
+ // Do not pass a const reference since key will be used as local variable.
+ inline void
+ delete_min_insert(T key, bool sup)
+ {
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+
+ int source = losers[0].source;
+ for (unsigned int pos = (k + source) / 2; pos > 0; pos /= 2)
+ {
+ // The smaller one gets promoted.
+ if (sup || (!losers[pos].sup && comp(losers[pos].key, key)))
+ {
+ // The other one is smaller.
+ std::swap(losers[pos].sup, sup);
+ std::swap(losers[pos].source, source);
+ std::swap(losers[pos].key, key);
+ }
+ }
+
+ losers[0].sup = sup;
+ losers[0].source = source;
+ losers[0].key = key;
+ }
+};
+
+
+/**
+ * @brief Base class of Loser Tree implementation using pointers.
+ */
+template<typename T, typename Comparator>
+class LoserTreePointerBase
+{
+protected:
+ /** @brief Internal representation of LoserTree elements. */
+ struct Loser
+ {
+ bool sup;
+ int source;
+ const T* keyp;
+ };
+
+ unsigned int ik, k, offset;
+ Loser* losers;
+ Comparator comp;
+
+public:
+ LoserTreePointerBase(unsigned int _k, Comparator _comp = std::less<T>())
+ : comp(_comp)
+ {
+ ik = _k;
+
+ // Next greater power of 2.
+ k = 1 << (__log2(ik - 1) + 1);
+ offset = k;
+ losers = new Loser[k * 2];
+ for (unsigned int i = ik - 1; i < k; i++)
+ losers[i + k].sup = true;
+ }
+
+ ~LoserTreePointerBase()
+ { ::operator delete[](losers); }
+
+ int get_min_source()
+ { return losers[0].source; }
+
+ void insert_start(const T& key, int source, bool sup)
+ {
+ unsigned int pos = k + source;
+
+ losers[pos].sup = sup;
+ losers[pos].source = source;
+ losers[pos].keyp = &key;
+ }
+};
+
+/**
+ * @brief Stable LoserTree implementation.
+ *
+ * The unstable variant is implemented using partial instantiation below.
+ */
+template<bool stable/* default == true */, typename T, typename Comparator>
+class LoserTreePointer : public LoserTreePointerBase<T, Comparator>
+{
+ typedef LoserTreePointerBase<T, Comparator> Base;
+ using Base::k;
+ using Base::losers;
+
+public:
+ LoserTreePointer(unsigned int _k, Comparator _comp = std::less<T>())
+ : Base::LoserTreePointerBase(_k, _comp)
+ {}
+
+ unsigned int
+ init_winner(unsigned int root)
+ {
+ if (root >= k)
+ {
+ return root;
+ }
+ else
+ {
+ unsigned int left = init_winner (2 * root);
+ unsigned int right = init_winner (2 * root + 1);
+ if (losers[right].sup
+ || (!losers[left].sup && !comp(*losers[right].keyp,
+ *losers[left].keyp)))
+ {
+ // Left one is less or equal.
+ losers[root] = losers[right];
+ return left;
+ }
+ else
+ {
+ // Right one is less.
+ losers[root] = losers[left];
+ return right;
+ }
+ }
+ }
+
+ void init()
+ { losers[0] = losers[init_winner(1)]; }
+
+ void delete_min_insert(const T& key, bool sup)
+ {
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+
+ const T* keyp = &key;
+ int source = losers[0].source;
+ for (unsigned int pos = (k + source) / 2; pos > 0; pos /= 2)
+ {
+ // The smaller one gets promoted, ties are broken by source.
+ if ((sup && (!losers[pos].sup || losers[pos].source < source)) ||
+ (!sup && !losers[pos].sup &&
+ ((comp(*losers[pos].keyp, *keyp)) ||
+ (!comp(*keyp, *losers[pos].keyp)
+ && losers[pos].source < source))))
+ {
+ // The other one is smaller.
+ std::swap(losers[pos].sup, sup);
+ std::swap(losers[pos].source, source);
+ std::swap(losers[pos].keyp, keyp);
+ }
+ }
+
+ losers[0].sup = sup;
+ losers[0].source = source;
+ losers[0].keyp = keyp;
+ }
+};
+
+/**
+ * @brief Unstable LoserTree implementation.
+ *
+ * The stable variant is above.
+ */
+template<typename T, typename Comparator>
+class LoserTreePointer</* stable == */false, T, Comparator> :
+ public LoserTreePointerBase<T, Comparator>
+{
+ typedef LoserTreePointerBase<T, Comparator> Base;
+ using Base::k;
+ using Base::losers;
+
+public:
+ LoserTreePointer(unsigned int _k, Comparator _comp = std::less<T>())
+ : Base::LoserTreePointerBase(_k, _comp)
+ {}
+
+ unsigned int
+ init_winner(unsigned int root)
+ {
+ if (root >= k)
+ {
+ return root;
+ }
+ else
+ {
+ unsigned int left = init_winner (2 * root);
+ unsigned int right = init_winner (2 * root + 1);
+ if (losers[right].sup
+ || (!losers[left].sup
+ && !comp(*losers[right].keyp, *losers[left].keyp)))
+ {
+ // Left one is less or equal.
+ losers[root] = losers[right];
+ return left;
+ }
+ else
+ {
+ // Right one is less.
+ losers[root] = losers[left];
+ return right;
+ }
+ }
+ }
+
+ void init()
+ { losers[0] = losers[init_winner(1)]; }
+
+ void delete_min_insert(const T& key, bool sup)
+ {
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+
+ const T* keyp = &key;
+ int source = losers[0].source;
+ for (unsigned int pos = (k + source) / 2; pos > 0; pos /= 2)
+ {
+ // The smaller one gets promoted.
+ if (sup || (!losers[pos].sup && comp(*losers[pos].keyp, *keyp)))
+ {
+ // The other one is smaller.
+ std::swap(losers[pos].sup, sup);
+ std::swap(losers[pos].source, source);
+ std::swap(losers[pos].keyp, keyp);
+ }
+ }
+
+ losers[0].sup = sup;
+ losers[0].source = source;
+ losers[0].keyp = keyp;
+ }
+};
+
+/** @brief Base class for unguarded LoserTree implementation.
+ *
+ * The whole element is copied into the tree structure.
+ *
+ * No guarding is done, therefore not a single input sequence must
+ * run empty. Unused sequence heads are marked with a sentinel which
+ * is &gt; all elements that are to be merged.
+ *
+ * This is a very fast variant.
+ */
+template<typename T, typename Comparator>
+class LoserTreeUnguardedBase
+{
+protected:
+ struct Loser
+ {
+ int source;
+ T key;
+ };
+
+ unsigned int ik, k, offset;
+ Loser* losers;
+ Comparator comp;
+
+public:
+ inline
+ LoserTreeUnguardedBase(unsigned int _k, const T _sentinel,
+ Comparator _comp = std::less<T>())
+ : comp(_comp)
+ {
+ ik = _k;
+
+ // Next greater power of 2.
+ k = 1 << (__log2(ik - 1) + 1);
+ offset = k;
+ // Avoid default-constructing losers[].key
+ losers = static_cast<Loser*>(::operator new(2 * k * sizeof(Loser)));
+
+ for (unsigned int i = k + ik - 1; i < (2 * k); ++i)
+ {
+ losers[i].key = _sentinel;
+ losers[i].source = -1;
+ }
+ }
+
+ inline ~LoserTreeUnguardedBase()
+ { ::operator delete(losers); }
+
+ inline int
+ get_min_source()
+ {
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+ return losers[0].source;
+ }
+
+ inline void
+ insert_start(const T& key, int source, bool)
+ {
+ unsigned int pos = k + source;
+
+ new(&(losers[pos].key)) T(key);
+ losers[pos].source = source;
+ }
+};
+
+/**
+ * @brief Stable implementation of unguarded LoserTree.
+ *
+ * Unstable variant is selected below with partial specialization.
+ */
+template<bool stable/* default == true */, typename T, typename Comparator>
+class LoserTreeUnguarded : public LoserTreeUnguardedBase<T, Comparator>
+{
+ typedef LoserTreeUnguardedBase<T, Comparator> Base;
+ using Base::k;
+ using Base::losers;
+
+public:
+ LoserTreeUnguarded(unsigned int _k, const T _sentinel,
+ Comparator _comp = std::less<T>())
+ : Base::LoserTreeUnguardedBase(_k, _sentinel, _comp)
+ {}
+
+ unsigned int
+ init_winner(unsigned int root)
+ {
+ if (root >= k)
+ {
+ return root;
+ }
+ else
+ {
+ unsigned int left = init_winner (2 * root);
+ unsigned int right = init_winner (2 * root + 1);
+ if (!comp(losers[right].key, losers[left].key))
+ {
+ // Left one is less or equal.
+ losers[root] = losers[right];
+ return left;
+ }
+ else
+ {
+ // Right one is less.
+ losers[root] = losers[left];
+ return right;
+ }
+ }
+ }
+
+ inline void
+ init()
+ {
+ losers[0] = losers[init_winner(1)];
+
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top at the beginning (0 sequences!)
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+ }
+
+ // Do not pass a const reference since key will be used as local variable.
+ inline void
+ delete_min_insert(T key, bool)
+ {
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+
+ int source = losers[0].source;
+ for (unsigned int pos = (k + source) / 2; pos > 0; pos /= 2)
+ {
+ // The smaller one gets promoted, ties are broken by source.
+ if (comp(losers[pos].key, key)
+ || (!comp(key, losers[pos].key) && losers[pos].source < source))
+ {
+ // The other one is smaller.
+ std::swap(losers[pos].source, source);
+ std::swap(losers[pos].key, key);
+ }
+ }
+
+ losers[0].source = source;
+ losers[0].key = key;
+ }
+};
+
+/**
+ * @brief Non-Stable implementation of unguarded LoserTree.
+ *
+ * Stable implementation is above.
+ */
+template<typename T, typename Comparator>
+class LoserTreeUnguarded</* stable == */false, T, Comparator> :
+ public LoserTreeUnguardedBase<T, Comparator>
+{
+ typedef LoserTreeUnguardedBase<T, Comparator> Base;
+ using Base::k;
+ using Base::losers;
+
+public:
+ LoserTreeUnguarded(unsigned int _k, const T _sentinel,
+ Comparator _comp = std::less<T>())
+ : Base::LoserTreeUnguardedBase(_k, _sentinel, _comp)
+ {}
+
+ unsigned int
+ init_winner (unsigned int root)
+ {
+ if (root >= k)
+ {
+ return root;
+ }
+ else
+ {
+ unsigned int left = init_winner (2 * root);
+ unsigned int right = init_winner (2 * root + 1);
+
+#if _GLIBCXX_ASSERTIONS
+ // If left one is sentinel then right one must be, too.
+ if (losers[left].source == -1)
+ _GLIBCXX_PARALLEL_ASSERT(losers[right].source == -1);
+#endif
+
+ if (!comp(losers[right].key, losers[left].key))
+ {
+ // Left one is less or equal.
+ losers[root] = losers[right];
+ return left;
+ }
+ else
+ {
+ // Right one is less.
+ losers[root] = losers[left];
+ return right;
+ }
+ }
+ }
+
+ inline void
+ init()
+ {
+ losers[0] = losers[init_winner(1)];
+
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top at the beginning (0 sequences!)
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+ }
+
+ // Do not pass a const reference since key will be used as local variable.
+ inline void
+ delete_min_insert(T key, bool)
+ {
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+
+ int source = losers[0].source;
+ for (unsigned int pos = (k + source) / 2; pos > 0; pos /= 2)
+ {
+ // The smaller one gets promoted.
+ if (comp(losers[pos].key, key))
+ {
+ // The other one is smaller.
+ std::swap(losers[pos].source, source);
+ std::swap(losers[pos].key, key);
+ }
+ }
+
+ losers[0].source = source;
+ losers[0].key = key;
+ }
+};
+
+/** @brief Unguarded loser tree, keeping only pointers to the
+* elements in the tree structure.
+*
+* No guarding is done, therefore not a single input sequence must
+* run empty. This is a very fast variant.
+*/
+template<typename T, typename Comparator>
+class LoserTreePointerUnguardedBase
+{
+protected:
+ struct Loser
+ {
+ int source;
+ const T* keyp;
+ };
+
+ unsigned int ik, k, offset;
+ Loser* losers;
+ Comparator comp;
+
+public:
+
+ inline
+ LoserTreePointerUnguardedBase(unsigned int _k, const T& _sentinel,
+ Comparator _comp = std::less<T>())
+ : comp(_comp)
+ {
+ ik = _k;
+
+ // Next greater power of 2.
+ k = 1 << (__log2(ik - 1) + 1);
+ offset = k;
+ // Avoid default-constructing losers[].key
+ losers = new Loser[2 * k];
+
+ for (unsigned int i = k + ik - 1; i < (2 * k); ++i)
+ {
+ losers[i].keyp = &_sentinel;
+ losers[i].source = -1;
+ }
+ }
+
+ inline ~LoserTreePointerUnguardedBase()
+ { delete[] losers; }
+
+ inline int
+ get_min_source()
+ {
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+ return losers[0].source;
+ }
+
+ inline void
+ insert_start(const T& key, int source, bool)
+ {
+ unsigned int pos = k + source;
+
+ losers[pos].keyp = &key;
+ losers[pos].source = source;
+ }
+};
+
+/**
+ * @brief Stable unguarded LoserTree variant storing pointers.
+ *
+ * Unstable variant is implemented below using partial specialization.
+ */
+template<bool stable/* default == true */, typename T, typename Comparator>
+class LoserTreePointerUnguarded :
+ public LoserTreePointerUnguardedBase<T, Comparator>
+{
+ typedef LoserTreePointerUnguardedBase<T, Comparator> Base;
+ using Base::k;
+ using Base::losers;
+
+public:
+ LoserTreePointerUnguarded(unsigned int _k, const T& _sentinel,
+ Comparator _comp = std::less<T>())
+ : Base::LoserTreePointerUnguardedBase(_k, _sentinel, _comp)
+ {}
+
+ unsigned int
+ init_winner(unsigned int root)
+ {
+ if (root >= k)
+ {
+ return root;
+ }
+ else
+ {
+ unsigned int left = init_winner (2 * root);
+ unsigned int right = init_winner (2 * root + 1);
+ if (!comp(*losers[right].keyp, *losers[left].keyp))
+ {
+ // Left one is less or equal.
+ losers[root] = losers[right];
+ return left;
+ }
+ else
+ {
+ // Right one is less.
+ losers[root] = losers[left];
+ return right;
+ }
+ }
+ }
+
+ inline void
+ init()
+ {
+ losers[0] = losers[init_winner(1)];
+
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top at the beginning (0 sequences!)
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+ }
+
+ inline void
+ delete_min_insert(const T& key, bool sup)
+ {
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+
+ const T* keyp = &key;
+ int source = losers[0].source;
+ for (unsigned int pos = (k + source) / 2; pos > 0; pos /= 2)
+ {
+ // The smaller one gets promoted, ties are broken by source.
+ if (comp(*losers[pos].keyp, *keyp)
+ || (!comp(*keyp, *losers[pos].keyp) && losers[pos].source < source))
+ {
+ // The other one is smaller.
+ std::swap(losers[pos].source, source);
+ std::swap(losers[pos].keyp, keyp);
+ }
+ }
+
+ losers[0].source = source;
+ losers[0].keyp = keyp;
+ }
+};
+
+/**
+ * @brief Unstable unguarded LoserTree variant storing pointers.
+ *
+ * Stable variant is above.
+ */
+template<typename T, typename Comparator>
+class LoserTreePointerUnguarded</* stable == */false, T, Comparator> :
+ public LoserTreePointerUnguardedBase<T, Comparator>
+{
+ typedef LoserTreePointerUnguardedBase<T, Comparator> Base;
+ using Base::k;
+ using Base::losers;
+
+public:
+ LoserTreePointerUnguarded(unsigned int _k, const T& _sentinel,
+ Comparator _comp = std::less<T>())
+ : Base::LoserTreePointerUnguardedBase(_k, _sentinel, _comp)
+ {}
+
+ unsigned int
+ init_winner(unsigned int root)
+ {
+ if (root >= k)
+ {
+ return root;
+ }
+ else
+ {
+ unsigned int left = init_winner (2 * root);
+ unsigned int right = init_winner (2 * root + 1);
+
+#if _GLIBCXX_ASSERTIONS
+ // If left one is sentinel then right one must be, too.
+ if (losers[left].source == -1)
+ _GLIBCXX_PARALLEL_ASSERT(losers[right].source == -1);
+#endif
+
+ if (!comp(*losers[right].keyp, *losers[left].keyp))
+ {
+ // Left one is less or equal.
+ losers[root] = losers[right];
+ return left;
+ }
+ else
+ {
+ // Right one is less.
+ losers[root] = losers[left];
+ return right;
+ }
+ }
+ }
+
+ inline void
+ init()
+ {
+ losers[0] = losers[init_winner(1)];
+
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top at the beginning (0 sequences!)
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+ }
+
+ inline void
+ delete_min_insert(const T& key, bool sup)
+ {
+#if _GLIBCXX_ASSERTIONS
+ // no dummy sequence can ever be at the top!
+ _GLIBCXX_PARALLEL_ASSERT(losers[0].source != -1);
+#endif
+
+ const T* keyp = &key;
+ int source = losers[0].source;
+ for (unsigned int pos = (k + source) / 2; pos > 0; pos /= 2)
+ {
+ // The smaller one gets promoted.
+ if (comp(*(losers[pos].keyp), *keyp))
+ {
+ // The other one is smaller.
+ std::swap(losers[pos].source, source);
+ std::swap(losers[pos].keyp, keyp);
+ }
+ }
+
+ losers[0].source = source;
+ losers[0].keyp = keyp;
+ }
+};
+
+} // namespace __gnu_parallel
+
+#endif /* _GLIBCXX_PARALLEL_LOSERTREE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/merge.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/merge.h
new file mode 100644
index 0000000..d947e25
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/merge.h
@@ -0,0 +1,261 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/merge.h
+ * @brief Parallel implementation of std::merge().
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_MERGE_H
+#define _GLIBCXX_PARALLEL_MERGE_H 1
+
+#include <parallel/basic_iterator.h>
+#include <bits/stl_algo.h>
+
+namespace __gnu_parallel
+{
+ /** @brief Merge routine being able to merge only the @c max_length
+ * smallest elements.
+ *
+ * The @c begin iterators are advanced accordingly, they might not
+ * reach @c end, in contrast to the usual variant.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence.
+ * @param end2 End iterator of second sequence.
+ * @param target Target begin iterator.
+ * @param max_length Maximum number of elements to merge.
+ * @param comp Comparator.
+ * @return Output end iterator. */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename OutputIterator, typename _DifferenceTp,
+ typename Comparator>
+ OutputIterator
+ merge_advance_usual(RandomAccessIterator1& begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2& begin2,
+ RandomAccessIterator2 end2, OutputIterator target,
+ _DifferenceTp max_length, Comparator comp)
+ {
+ typedef _DifferenceTp difference_type;
+ while (begin1 != end1 && begin2 != end2 && max_length > 0)
+ {
+ // array1[i1] < array0[i0]
+ if (comp(*begin2, *begin1))
+ *target++ = *begin2++;
+ else
+ *target++ = *begin1++;
+ --max_length;
+ }
+
+ if (begin1 != end1)
+ {
+ target = std::copy(begin1, begin1 + max_length, target);
+ begin1 += max_length;
+ }
+ else
+ {
+ target = std::copy(begin2, begin2 + max_length, target);
+ begin2 += max_length;
+ }
+ return target;
+ }
+
+ /** @brief Merge routine being able to merge only the @c max_length
+ * smallest elements.
+ *
+ * The @c begin iterators are advanced accordingly, they might not
+ * reach @c end, in contrast to the usual variant.
+ * Specially designed code should allow the compiler to generate
+ * conditional moves instead of branches.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence.
+ * @param end2 End iterator of second sequence.
+ * @param target Target begin iterator.
+ * @param max_length Maximum number of elements to merge.
+ * @param comp Comparator.
+ * @return Output end iterator. */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename OutputIterator, typename _DifferenceTp,
+ typename Comparator>
+ OutputIterator
+ merge_advance_movc(RandomAccessIterator1& begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2& begin2,
+ RandomAccessIterator2 end2,
+ OutputIterator target,
+ _DifferenceTp max_length, Comparator comp)
+ {
+ typedef _DifferenceTp difference_type;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::value_type
+ value_type1;
+ typedef typename std::iterator_traits<RandomAccessIterator2>::value_type
+ value_type2;
+
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(max_length >= 0);
+#endif
+
+ while (begin1 != end1 && begin2 != end2 && max_length > 0)
+ {
+ RandomAccessIterator1 next1 = begin1 + 1;
+ RandomAccessIterator2 next2 = begin2 + 1;
+ value_type1 element1 = *begin1;
+ value_type2 element2 = *begin2;
+
+ if (comp(element2, element1))
+ {
+ element1 = element2;
+ begin2 = next2;
+ }
+ else
+ begin1 = next1;
+
+ *target = element1;
+
+ ++target;
+ --max_length;
+ }
+ if (begin1 != end1)
+ {
+ target = std::copy(begin1, begin1 + max_length, target);
+ begin1 += max_length;
+ }
+ else
+ {
+ target = std::copy(begin2, begin2 + max_length, target);
+ begin2 += max_length;
+ }
+ return target;
+ }
+
+ /** @brief Merge routine being able to merge only the @c max_length
+ * smallest elements.
+ *
+ * The @c begin iterators are advanced accordingly, they might not
+ * reach @c end, in contrast to the usual variant.
+ * Static switch on whether to use the conditional-move variant.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence.
+ * @param end2 End iterator of second sequence.
+ * @param target Target begin iterator.
+ * @param max_length Maximum number of elements to merge.
+ * @param comp Comparator.
+ * @return Output end iterator. */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename OutputIterator, typename _DifferenceTp,
+ typename Comparator>
+ inline OutputIterator
+ merge_advance(RandomAccessIterator1& begin1, RandomAccessIterator1 end1,
+ RandomAccessIterator2& begin2, RandomAccessIterator2 end2,
+ OutputIterator target, _DifferenceTp max_length,
+ Comparator comp)
+ {
+ _GLIBCXX_CALL(max_length)
+
+ return merge_advance_movc(begin1, end1, begin2, end2, target,
+ max_length, comp);
+ }
+
+ /** @brief Merge routine fallback to sequential in case the
+ iterators of the two input sequences are of different type.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence.
+ * @param end2 End iterator of second sequence.
+ * @param target Target begin iterator.
+ * @param max_length Maximum number of elements to merge.
+ * @param comp Comparator.
+ * @return Output end iterator. */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename RandomAccessIterator3, typename Comparator>
+ inline RandomAccessIterator3
+ parallel_merge_advance(RandomAccessIterator1& begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator2& begin2,
+ // different iterators, parallel implementation
+ // not available
+ RandomAccessIterator2 end2,
+ RandomAccessIterator3 target, typename
+ std::iterator_traits<RandomAccessIterator1>::
+ difference_type max_length, Comparator comp)
+ { return merge_advance(begin1, end1, begin2, end2, target,
+ max_length, comp); }
+
+ /** @brief Parallel merge routine being able to merge only the @c
+ * max_length smallest elements.
+ *
+ * The @c begin iterators are advanced accordingly, they might not
+ * reach @c end, in contrast to the usual variant.
+ * The functionality is projected onto parallel_multiway_merge.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence.
+ * @param end2 End iterator of second sequence.
+ * @param target Target begin iterator.
+ * @param max_length Maximum number of elements to merge.
+ * @param comp Comparator.
+ * @return Output end iterator.
+ */
+ template<typename RandomAccessIterator1, typename RandomAccessIterator3,
+ typename Comparator>
+ inline RandomAccessIterator3
+ parallel_merge_advance(RandomAccessIterator1& begin1,
+ RandomAccessIterator1 end1,
+ RandomAccessIterator1& begin2,
+ RandomAccessIterator1 end2,
+ RandomAccessIterator3 target, typename
+ std::iterator_traits<RandomAccessIterator1>::
+ difference_type max_length, Comparator comp)
+ {
+ typedef typename
+ std::iterator_traits<RandomAccessIterator1>::value_type value_type;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::
+ difference_type difference_type1 /* == difference_type2 */;
+ typedef typename std::iterator_traits<RandomAccessIterator3>::
+ difference_type difference_type3;
+ typedef typename std::pair<RandomAccessIterator1, RandomAccessIterator1>
+ iterator_pair;
+
+ iterator_pair
+ seqs[2] = { std::make_pair(begin1, end1),
+ std::make_pair(begin2, end2) };
+ RandomAccessIterator3
+ target_end = parallel_multiway_merge
+ < /* stable = */ true, /* sentinels = */ false>(
+ seqs, seqs + 2, target,
+ multiway_merge_exact_splitting
+ < /* stable = */ true, iterator_pair*,
+ Comparator, difference_type1>,
+ max_length, comp, omp_get_max_threads());
+
+ return target_end;
+ }
+} //namespace __gnu_parallel
+
+#endif /* _GLIBCXX_PARALLEL_MERGE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/multiseq_selection.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/multiseq_selection.h
new file mode 100644
index 0000000..6ef3d22
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/multiseq_selection.h
@@ -0,0 +1,633 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/multiseq_selection.h
+ * @brief Functions to find elements of a certain global rank in
+ * multiple sorted sequences. Also serves for splitting such
+ * sequence sets.
+ *
+ * The algorithm description can be found in
+ *
+ * P. J. Varman, S. D. Scheufler, B. R. Iyer, and G. R. Ricard.
+ * Merging Multiple Lists on Hierarchical-Memory Multiprocessors.
+ * Journal of Parallel and Distributed Computing, 12(2):171–177, 1991.
+ *
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_MULTISEQ_SELECTION_H
+#define _GLIBCXX_PARALLEL_MULTISEQ_SELECTION_H 1
+
+#include <vector>
+#include <queue>
+
+#include <bits/stl_algo.h>
+
+#include <parallel/sort.h>
+
+namespace __gnu_parallel
+{
+ /** @brief Compare a pair of types lexicographically, ascending. */
+ template<typename T1, typename T2, typename Comparator>
+ class lexicographic
+ : public std::binary_function<std::pair<T1, T2>, std::pair<T1, T2>, bool>
+ {
+ private:
+ Comparator& comp;
+
+ public:
+ lexicographic(Comparator& _comp) : comp(_comp) { }
+
+ bool
+ operator()(const std::pair<T1, T2>& p1,
+ const std::pair<T1, T2>& p2) const
+ {
+ if (comp(p1.first, p2.first))
+ return true;
+
+ if (comp(p2.first, p1.first))
+ return false;
+
+ // Firsts are equal.
+ return p1.second < p2.second;
+ }
+ };
+
+ /** @brief Compare a pair of types lexicographically, descending. */
+ template<typename T1, typename T2, typename Comparator>
+ class lexicographic_reverse : public std::binary_function<T1, T2, bool>
+ {
+ private:
+ Comparator& comp;
+
+ public:
+ lexicographic_reverse(Comparator& _comp) : comp(_comp) { }
+
+ bool
+ operator()(const std::pair<T1, T2>& p1,
+ const std::pair<T1, T2>& p2) const
+ {
+ if (comp(p2.first, p1.first))
+ return true;
+
+ if (comp(p1.first, p2.first))
+ return false;
+
+ // Firsts are equal.
+ return p2.second < p1.second;
+ }
+ };
+
+ /**
+ * @brief Splits several sorted sequences at a certain global rank,
+ * resulting in a splitting point for each sequence.
+ * The sequences are passed via a sequence of random-access
+ * iterator pairs, none of the sequences may be empty. If there
+ * are several equal elements across the split, the ones on the
+ * left side will be chosen from sequences with smaller number.
+ * @param begin_seqs Begin of the sequence of iterator pairs.
+ * @param end_seqs End of the sequence of iterator pairs.
+ * @param rank The global rank to partition at.
+ * @param begin_offsets A random-access sequence begin where the
+ * result will be stored in. Each element of the sequence is an
+ * iterator that points to the first element on the greater part of
+ * the respective sequence.
+ * @param comp The ordering functor, defaults to std::less<T>.
+ */
+ template<typename RanSeqs, typename RankType, typename RankIterator,
+ typename Comparator>
+ void
+ multiseq_partition(RanSeqs begin_seqs, RanSeqs end_seqs,
+ RankType rank,
+ RankIterator begin_offsets,
+ Comparator comp = std::less<
+ typename std::iterator_traits<typename
+ std::iterator_traits<RanSeqs>::value_type::
+ first_type>::value_type>()) // std::less<T>
+ {
+ _GLIBCXX_CALL(end_seqs - begin_seqs)
+
+ typedef typename std::iterator_traits<RanSeqs>::value_type::first_type
+ It;
+ typedef typename std::iterator_traits<It>::difference_type
+ difference_type;
+ typedef typename std::iterator_traits<It>::value_type value_type;
+
+ lexicographic<value_type, int, Comparator> lcomp(comp);
+ lexicographic_reverse<value_type, int, Comparator> lrcomp(comp);
+
+ // Number of sequences, number of elements in total (possibly
+ // including padding).
+ difference_type m = std::distance(begin_seqs, end_seqs), N = 0,
+ nmax, n, r;
+
+ for (int i = 0; i < m; i++)
+ {
+ N += std::distance(begin_seqs[i].first, begin_seqs[i].second);
+ _GLIBCXX_PARALLEL_ASSERT(
+ std::distance(begin_seqs[i].first, begin_seqs[i].second) > 0);
+ }
+
+ if (rank == N)
+ {
+ for (int i = 0; i < m; i++)
+ begin_offsets[i] = begin_seqs[i].second; // Very end.
+ // Return m - 1;
+ return;
+ }
+
+ _GLIBCXX_PARALLEL_ASSERT(m != 0);
+ _GLIBCXX_PARALLEL_ASSERT(N != 0);
+ _GLIBCXX_PARALLEL_ASSERT(rank >= 0);
+ _GLIBCXX_PARALLEL_ASSERT(rank < N);
+
+ difference_type* ns = new difference_type[m];
+ difference_type* a = new difference_type[m];
+ difference_type* b = new difference_type[m];
+ difference_type l;
+
+ ns[0] = std::distance(begin_seqs[0].first, begin_seqs[0].second);
+ nmax = ns[0];
+ for (int i = 0; i < m; i++)
+ {
+ ns[i] = std::distance(begin_seqs[i].first, begin_seqs[i].second);
+ nmax = std::max(nmax, ns[i]);
+ }
+
+ r = __log2(nmax) + 1;
+
+ // Pad all lists to this length, at least as long as any ns[i],
+ // equality iff nmax = 2^k - 1.
+ l = (1ULL << r) - 1;
+
+ // From now on, including padding.
+ N = l * m;
+
+ for (int i = 0; i < m; i++)
+ {
+ a[i] = 0;
+ b[i] = l;
+ }
+ n = l / 2;
+
+ // Invariants:
+ // 0 <= a[i] <= ns[i], 0 <= b[i] <= l
+
+#define S(i) (begin_seqs[i].first)
+
+ // Initial partition.
+ std::vector<std::pair<value_type, int> > sample;
+
+ for (int i = 0; i < m; i++)
+ if (n < ns[i]) //sequence long enough
+ sample.push_back(std::make_pair(S(i)[n], i));
+ __gnu_sequential::sort(sample.begin(), sample.end(), lcomp);
+
+ for (int i = 0; i < m; i++) //conceptual infinity
+ if (n >= ns[i]) //sequence too short, conceptual infinity
+ sample.push_back(std::make_pair(S(i)[0] /*dummy element*/, i));
+
+ difference_type localrank = rank * m / N ;
+
+ int j;
+ for (j = 0; j < localrank && ((n + 1) <= ns[sample[j].second]); ++j)
+ a[sample[j].second] += n + 1;
+ for (; j < m; j++)
+ b[sample[j].second] -= n + 1;
+
+ // Further refinement.
+ while (n > 0)
+ {
+ n /= 2;
+
+ int lmax_seq = -1; // to avoid warning
+ const value_type* lmax = NULL; // impossible to avoid the warning?
+ for (int i = 0; i < m; i++)
+ {
+ if (a[i] > 0)
+ {
+ if (!lmax)
+ {
+ lmax = &(S(i)[a[i] - 1]);
+ lmax_seq = i;
+ }
+ else
+ {
+ // Max, favor rear sequences.
+ if (!comp(S(i)[a[i] - 1], *lmax))
+ {
+ lmax = &(S(i)[a[i] - 1]);
+ lmax_seq = i;
+ }
+ }
+ }
+ }
+
+ int i;
+ for (i = 0; i < m; i++)
+ {
+ difference_type middle = (b[i] + a[i]) / 2;
+ if (lmax && middle < ns[i] &&
+ lcomp(std::make_pair(S(i)[middle], i),
+ std::make_pair(*lmax, lmax_seq)))
+ a[i] = std::min(a[i] + n + 1, ns[i]);
+ else
+ b[i] -= n + 1;
+ }
+
+ difference_type leftsize = 0, total = 0;
+ for (int i = 0; i < m; i++)
+ {
+ leftsize += a[i] / (n + 1);
+ total += l / (n + 1);
+ }
+
+ difference_type skew = static_cast<difference_type>
+ (static_cast<uint64>(total) * rank / N - leftsize);
+
+ if (skew > 0)
+ {
+ // Move to the left, find smallest.
+ std::priority_queue<std::pair<value_type, int>,
+ std::vector<std::pair<value_type, int> >,
+ lexicographic_reverse<value_type, int, Comparator> >
+ pq(lrcomp);
+
+ for (int i = 0; i < m; i++)
+ if (b[i] < ns[i])
+ pq.push(std::make_pair(S(i)[b[i]], i));
+
+ for (; skew != 0 && !pq.empty(); --skew)
+ {
+ int source = pq.top().second;
+ pq.pop();
+
+ a[source] = std::min(a[source] + n + 1, ns[source]);
+ b[source] += n + 1;
+
+ if (b[source] < ns[source])
+ pq.push(std::make_pair(S(source)[b[source]], source));
+ }
+ }
+ else if (skew < 0)
+ {
+ // Move to the right, find greatest.
+ std::priority_queue<std::pair<value_type, int>,
+ std::vector<std::pair<value_type, int> >,
+ lexicographic<value_type, int, Comparator> > pq(lcomp);
+
+ for (int i = 0; i < m; i++)
+ if (a[i] > 0)
+ pq.push(std::make_pair(S(i)[a[i] - 1], i));
+
+ for (; skew != 0; ++skew)
+ {
+ int source = pq.top().second;
+ pq.pop();
+
+ a[source] -= n + 1;
+ b[source] -= n + 1;
+
+ if (a[source] > 0)
+ pq.push(std::make_pair(S(source)[a[source] - 1], source));
+ }
+ }
+ }
+
+ // Postconditions:
+ // a[i] == b[i] in most cases, except when a[i] has been clamped
+ // because of having reached the boundary
+
+ // Now return the result, calculate the offset.
+
+ // Compare the keys on both edges of the border.
+
+ // Maximum of left edge, minimum of right edge.
+ value_type* maxleft = NULL;
+ value_type* minright = NULL;
+ for (int i = 0; i < m; i++)
+ {
+ if (a[i] > 0)
+ {
+ if (!maxleft)
+ maxleft = &(S(i)[a[i] - 1]);
+ else
+ {
+ // Max, favor rear sequences.
+ if (!comp(S(i)[a[i] - 1], *maxleft))
+ maxleft = &(S(i)[a[i] - 1]);
+ }
+ }
+ if (b[i] < ns[i])
+ {
+ if (!minright)
+ minright = &(S(i)[b[i]]);
+ else
+ {
+ // Min, favor fore sequences.
+ if (comp(S(i)[b[i]], *minright))
+ minright = &(S(i)[b[i]]);
+ }
+ }
+ }
+
+ int seq = 0;
+ for (int i = 0; i < m; i++)
+ begin_offsets[i] = S(i) + a[i];
+
+ delete[] ns;
+ delete[] a;
+ delete[] b;
+ }
+
+
+ /**
+ * @brief Selects the element at a certain global rank from several
+ * sorted sequences.
+ *
+ * The sequences are passed via a sequence of random-access
+ * iterator pairs, none of the sequences may be empty.
+ * @param begin_seqs Begin of the sequence of iterator pairs.
+ * @param end_seqs End of the sequence of iterator pairs.
+ * @param rank The global rank to partition at.
+ * @param offset The rank of the selected element in the global
+ * subsequence of elements equal to the selected element. If the
+ * selected element is unique, this number is 0.
+ * @param comp The ordering functor, defaults to std::less.
+ */
+ template<typename T, typename RanSeqs, typename RankType,
+ typename Comparator>
+ T
+ multiseq_selection(RanSeqs begin_seqs, RanSeqs end_seqs, RankType rank,
+ RankType& offset, Comparator comp = std::less<T>())
+ {
+ _GLIBCXX_CALL(end_seqs - begin_seqs)
+
+ typedef typename std::iterator_traits<RanSeqs>::value_type::first_type
+ It;
+ typedef typename std::iterator_traits<It>::difference_type
+ difference_type;
+
+ lexicographic<T, int, Comparator> lcomp(comp);
+ lexicographic_reverse<T, int, Comparator> lrcomp(comp);
+
+ // Number of sequences, number of elements in total (possibly
+ // including padding).
+ difference_type m = std::distance(begin_seqs, end_seqs);
+ difference_type N = 0;
+ difference_type nmax, n, r;
+
+ for (int i = 0; i < m; i++)
+ N += std::distance(begin_seqs[i].first, begin_seqs[i].second);
+
+ if (m == 0 || N == 0 || rank < 0 || rank >= N)
+ {
+ // Result undefined when there is no data or rank is outside bounds.
+ throw std::exception();
+ }
+
+
+ difference_type* ns = new difference_type[m];
+ difference_type* a = new difference_type[m];
+ difference_type* b = new difference_type[m];
+ difference_type l;
+
+ ns[0] = std::distance(begin_seqs[0].first, begin_seqs[0].second);
+ nmax = ns[0];
+ for (int i = 0; i < m; ++i)
+ {
+ ns[i] = std::distance(begin_seqs[i].first, begin_seqs[i].second);
+ nmax = std::max(nmax, ns[i]);
+ }
+
+ r = __log2(nmax) + 1;
+
+ // Pad all lists to this length, at least as long as any ns[i],
+ // equality iff nmax = 2^k - 1
+ l = pow2(r) - 1;
+
+ // From now on, including padding.
+ N = l * m;
+
+ for (int i = 0; i < m; ++i)
+ {
+ a[i] = 0;
+ b[i] = l;
+ }
+ n = l / 2;
+
+ // Invariants:
+ // 0 <= a[i] <= ns[i], 0 <= b[i] <= l
+
+#define S(i) (begin_seqs[i].first)
+
+ // Initial partition.
+ std::vector<std::pair<T, int> > sample;
+
+ for (int i = 0; i < m; i++)
+ if (n < ns[i])
+ sample.push_back(std::make_pair(S(i)[n], i));
+ __gnu_sequential::sort(sample.begin(), sample.end(),
+ lcomp, sequential_tag());
+
+ // Conceptual infinity.
+ for (int i = 0; i < m; i++)
+ if (n >= ns[i])
+ sample.push_back(std::make_pair(S(i)[0] /*dummy element*/, i));
+
+ difference_type localrank = rank * m / N ;
+
+ int j;
+ for (j = 0; j < localrank && ((n + 1) <= ns[sample[j].second]); ++j)
+ a[sample[j].second] += n + 1;
+ for (; j < m; ++j)
+ b[sample[j].second] -= n + 1;
+
+ // Further refinement.
+ while (n > 0)
+ {
+ n /= 2;
+
+ const T* lmax = NULL;
+ for (int i = 0; i < m; ++i)
+ {
+ if (a[i] > 0)
+ {
+ if (!lmax)
+ lmax = &(S(i)[a[i] - 1]);
+ else
+ {
+ if (comp(*lmax, S(i)[a[i] - 1])) //max
+ lmax = &(S(i)[a[i] - 1]);
+ }
+ }
+ }
+
+ int i;
+ for (i = 0; i < m; i++)
+ {
+ difference_type middle = (b[i] + a[i]) / 2;
+ if (lmax && middle < ns[i] && comp(S(i)[middle], *lmax))
+ a[i] = std::min(a[i] + n + 1, ns[i]);
+ else
+ b[i] -= n + 1;
+ }
+
+ difference_type leftsize = 0, total = 0;
+ for (int i = 0; i < m; ++i)
+ {
+ leftsize += a[i] / (n + 1);
+ total += l / (n + 1);
+ }
+
+ difference_type skew = ((unsigned long long)total * rank / N
+ - leftsize);
+
+ if (skew > 0)
+ {
+ // Move to the left, find smallest.
+ std::priority_queue<std::pair<T, int>,
+ std::vector<std::pair<T, int> >,
+ lexicographic_reverse<T, int, Comparator> > pq(lrcomp);
+
+ for (int i = 0; i < m; ++i)
+ if (b[i] < ns[i])
+ pq.push(std::make_pair(S(i)[b[i]], i));
+
+ for (; skew != 0 && !pq.empty(); --skew)
+ {
+ int source = pq.top().second;
+ pq.pop();
+
+ a[source] = std::min(a[source] + n + 1, ns[source]);
+ b[source] += n + 1;
+
+ if (b[source] < ns[source])
+ pq.push(std::make_pair(S(source)[b[source]], source));
+ }
+ }
+ else if (skew < 0)
+ {
+ // Move to the right, find greatest.
+ std::priority_queue<std::pair<T, int>,
+ std::vector<std::pair<T, int> >,
+ lexicographic<T, int, Comparator> > pq(lcomp);
+
+ for (int i = 0; i < m; ++i)
+ if (a[i] > 0)
+ pq.push(std::make_pair(S(i)[a[i] - 1], i));
+
+ for (; skew != 0; ++skew)
+ {
+ int source = pq.top().second;
+ pq.pop();
+
+ a[source] -= n + 1;
+ b[source] -= n + 1;
+
+ if (a[source] > 0)
+ pq.push(std::make_pair(S(source)[a[source] - 1], source));
+ }
+ }
+ }
+
+ // Postconditions:
+ // a[i] == b[i] in most cases, except when a[i] has been clamped
+ // because of having reached the boundary
+
+ // Now return the result, calculate the offset.
+
+ // Compare the keys on both edges of the border.
+
+ // Maximum of left edge, minimum of right edge.
+ bool maxleftset = false, minrightset = false;
+
+ // Impossible to avoid the warning?
+ T maxleft, minright;
+ for (int i = 0; i < m; ++i)
+ {
+ if (a[i] > 0)
+ {
+ if (!maxleftset)
+ {
+ maxleft = S(i)[a[i] - 1];
+ maxleftset = true;
+ }
+ else
+ {
+ // Max.
+ if (comp(maxleft, S(i)[a[i] - 1]))
+ maxleft = S(i)[a[i] - 1];
+ }
+ }
+ if (b[i] < ns[i])
+ {
+ if (!minrightset)
+ {
+ minright = S(i)[b[i]];
+ minrightset = true;
+ }
+ else
+ {
+ // Min.
+ if (comp(S(i)[b[i]], minright))
+ minright = S(i)[b[i]];
+ }
+ }
+ }
+
+ // Minright is the splitter, in any case.
+
+ if (!maxleftset || comp(minright, maxleft))
+ {
+ // Good luck, everything is split unambiguously.
+ offset = 0;
+ }
+ else
+ {
+ // We have to calculate an offset.
+ offset = 0;
+
+ for (int i = 0; i < m; ++i)
+ {
+ difference_type lb = std::lower_bound(S(i), S(i) + ns[i],
+ minright,
+ comp) - S(i);
+ offset += a[i] - lb;
+ }
+ }
+
+ delete[] ns;
+ delete[] a;
+ delete[] b;
+
+ return minright;
+ }
+}
+
+#undef S
+
+#endif /* _GLIBCXX_PARALLEL_MULTISEQ_SELECTION_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/multiway_merge.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/multiway_merge.h
new file mode 100644
index 0000000..fe32053
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/multiway_merge.h
@@ -0,0 +1,2140 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/multiway_merge.h
+* @brief Implementation of sequential and parallel multiway merge.
+*
+* Explanations on the high-speed merging routines in the appendix of
+*
+* P. Sanders.
+* Fast priority queues for cached memory.
+* ACM Journal of Experimental Algorithmics, 5, 2000.
+*
+* This file is a GNU parallel extension to the Standard C++ Library.
+*/
+
+// Written by Johannes Singler and Manuel Holtgrewe.
+
+#ifndef _GLIBCXX_PARALLEL_MULTIWAY_MERGE_H
+#define _GLIBCXX_PARALLEL_MULTIWAY_MERGE_H
+
+#include <vector>
+
+#include <bits/stl_algo.h>
+#include <parallel/features.h>
+#include <parallel/parallel.h>
+#include <parallel/losertree.h>
+#if _GLIBCXX_ASSERTIONS
+#include <parallel/checkers.h>
+#endif
+
+/** @brief Length of a sequence described by a pair of iterators. */
+#define _GLIBCXX_PARALLEL_LENGTH(s) ((s).second - (s).first)
+
+namespace __gnu_parallel
+{
+
+// Announce guarded and unguarded iterator.
+
+template<typename RandomAccessIterator, typename Comparator>
+ class guarded_iterator;
+
+// Making the arguments const references seems to dangerous,
+// the user-defined comparator might not be const.
+template<typename RandomAccessIterator, typename Comparator>
+ inline bool
+ operator<(guarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ guarded_iterator<RandomAccessIterator, Comparator>& bi2);
+
+template<typename RandomAccessIterator, typename Comparator>
+ inline bool
+ operator<=(guarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ guarded_iterator<RandomAccessIterator, Comparator>& bi2);
+
+/** @brief Iterator wrapper supporting an implicit supremum at the end
+ * of the sequence, dominating all comparisons.
+ *
+ * The implicit supremum comes with a performance cost.
+ *
+ * Deriving from RandomAccessIterator is not possible since
+ * RandomAccessIterator need not be a class.
+ */
+template<typename RandomAccessIterator, typename Comparator>
+ class guarded_iterator
+ {
+ private:
+ /** @brief Current iterator position. */
+ RandomAccessIterator current;
+
+ /** @brief End iterator of the sequence. */
+ RandomAccessIterator end;
+
+ /** @brief Comparator. */
+ Comparator& comp;
+
+ public:
+ /** @brief Constructor. Sets iterator to beginning of sequence.
+ * @param begin Begin iterator of sequence.
+ * @param end End iterator of sequence.
+ * @param comp Comparator provided for associated overloaded
+ * compare operators. */
+ guarded_iterator(RandomAccessIterator begin,
+ RandomAccessIterator end, Comparator& comp)
+ : current(begin), end(end), comp(comp)
+ { }
+
+ /** @brief Pre-increment operator.
+ * @return This. */
+ guarded_iterator<RandomAccessIterator, Comparator>&
+ operator++()
+ {
+ ++current;
+ return *this;
+ }
+
+ /** @brief Dereference operator.
+ * @return Referenced element. */
+ typename std::iterator_traits<RandomAccessIterator>::value_type&
+ operator*()
+ { return *current; }
+
+ /** @brief Convert to wrapped iterator.
+ * @return Wrapped iterator. */
+ operator RandomAccessIterator()
+ { return current; }
+
+ friend bool
+ operator< <RandomAccessIterator, Comparator>(
+ guarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ guarded_iterator<RandomAccessIterator, Comparator>& bi2);
+
+ friend bool
+ operator<= <RandomAccessIterator, Comparator>(
+ guarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ guarded_iterator<RandomAccessIterator, Comparator>& bi2);
+ };
+
+/** @brief Compare two elements referenced by guarded iterators.
+ * @param bi1 First iterator.
+ * @param bi2 Second iterator.
+ * @return @c True if less. */
+template<typename RandomAccessIterator, typename Comparator>
+ inline bool
+ operator<(guarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ guarded_iterator<RandomAccessIterator, Comparator>& bi2)
+ {
+ if (bi1.current == bi1.end) //bi1 is sup
+ return bi2.current == bi2.end; //bi2 is not sup
+ if (bi2.current == bi2.end) //bi2 is sup
+ return true;
+ return (bi1.comp)(*bi1, *bi2); //normal compare
+ }
+
+/** @brief Compare two elements referenced by guarded iterators.
+ * @param bi1 First iterator.
+ * @param bi2 Second iterator.
+ * @return @c True if less equal. */
+template<typename RandomAccessIterator, typename Comparator>
+ inline bool
+ operator<=(guarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ guarded_iterator<RandomAccessIterator, Comparator>& bi2)
+ {
+ if (bi2.current == bi2.end) //bi1 is sup
+ return bi1.current != bi1.end; //bi2 is not sup
+ if (bi1.current == bi1.end) //bi2 is sup
+ return false;
+ return !(bi1.comp)(*bi2, *bi1); //normal compare
+ }
+
+template<typename RandomAccessIterator, typename Comparator>
+ class unguarded_iterator;
+
+template<typename RandomAccessIterator, typename Comparator>
+ inline bool
+ operator<(unguarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ unguarded_iterator<RandomAccessIterator, Comparator>& bi2);
+
+template<typename RandomAccessIterator, typename Comparator>
+ inline bool
+ operator<=(unguarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ unguarded_iterator<RandomAccessIterator, Comparator>& bi2);
+
+template<typename RandomAccessIterator, typename Comparator>
+ class unguarded_iterator
+ {
+ private:
+ /** @brief Current iterator position. */
+ RandomAccessIterator current;
+ /** @brief Comparator. */
+ mutable Comparator& comp;
+
+ public:
+ /** @brief Constructor. Sets iterator to beginning of sequence.
+ * @param begin Begin iterator of sequence.
+ * @param end Unused, only for compatibility.
+ * @param comp Unused, only for compatibility. */
+ unguarded_iterator(RandomAccessIterator begin,
+ RandomAccessIterator end, Comparator& comp)
+ : current(begin), comp(comp)
+ { }
+
+ /** @brief Pre-increment operator.
+ * @return This. */
+ unguarded_iterator<RandomAccessIterator, Comparator>&
+ operator++()
+ {
+ ++current;
+ return *this;
+ }
+
+ /** @brief Dereference operator.
+ * @return Referenced element. */
+ typename std::iterator_traits<RandomAccessIterator>::value_type&
+ operator*()
+ { return *current; }
+
+ /** @brief Convert to wrapped iterator.
+ * @return Wrapped iterator. */
+ operator RandomAccessIterator()
+ { return current; }
+
+ friend bool
+ operator< <RandomAccessIterator, Comparator>(
+ unguarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ unguarded_iterator<RandomAccessIterator, Comparator>& bi2);
+
+ friend bool
+ operator<= <RandomAccessIterator, Comparator>(
+ unguarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ unguarded_iterator<RandomAccessIterator, Comparator>& bi2);
+ };
+
+/** @brief Compare two elements referenced by unguarded iterators.
+ * @param bi1 First iterator.
+ * @param bi2 Second iterator.
+ * @return @c True if less. */
+template<typename RandomAccessIterator, typename Comparator>
+ inline bool
+ operator<(unguarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ unguarded_iterator<RandomAccessIterator, Comparator>& bi2)
+ {
+ // Normal compare.
+ return (bi1.comp)(*bi1, *bi2);
+ }
+
+/** @brief Compare two elements referenced by unguarded iterators.
+ * @param bi1 First iterator.
+ * @param bi2 Second iterator.
+ * @return @c True if less equal. */
+template<typename RandomAccessIterator, typename Comparator>
+ inline bool
+ operator<=(unguarded_iterator<RandomAccessIterator, Comparator>& bi1,
+ unguarded_iterator<RandomAccessIterator, Comparator>& bi2)
+ {
+ // Normal compare.
+ return !(bi1.comp)(*bi2, *bi1);
+ }
+
+/** @brief Highly efficient 3-way merging procedure.
+ *
+ * Merging is done with the algorithm implementation described by Peter
+ * Sanders. Basically, the idea is to minimize the number of necessary
+ * comparison after merging out an element. The implementation trick
+ * that makes this fast is that the order of the sequences is stored
+ * in the instruction pointer (translated into labels in C++).
+ *
+ * This works well for merging up to 4 sequences.
+ *
+ * Note that making the merging stable does <em>not</em> come at a
+ * performance hit.
+ *
+ * Whether the merging is done guarded or unguarded is selected by the
+ * used iterator class.
+ *
+ * @param seqs_begin Begin iterator of iterator pair input sequence.
+ * @param seqs_end End iterator of iterator pair input sequence.
+ * @param target Begin iterator out output sequence.
+ * @param comp Comparator.
+ * @param length Maximum length to merge, less equal than the
+ * total number of elements available.
+ *
+ * @return End iterator of output sequence.
+ */
+template<template<typename RAI, typename C> class iterator,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+ RandomAccessIterator3
+ multiway_merge_3_variant(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ _DifferenceTp length, Comparator comp)
+ {
+ _GLIBCXX_CALL(length);
+
+ typedef _DifferenceTp difference_type;
+
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::value_type
+ value_type;
+
+ if (length == 0)
+ return target;
+
+#if _GLIBCXX_ASSERTIONS
+ _DifferenceTp orig_length = length;
+#endif
+
+ iterator<RandomAccessIterator1, Comparator>
+ seq0(seqs_begin[0].first, seqs_begin[0].second, comp),
+ seq1(seqs_begin[1].first, seqs_begin[1].second, comp),
+ seq2(seqs_begin[2].first, seqs_begin[2].second, comp);
+
+ if (seq0 <= seq1)
+ {
+ if (seq1 <= seq2)
+ goto s012;
+ else
+ if (seq2 < seq0)
+ goto s201;
+ else
+ goto s021;
+ }
+ else
+ {
+ if (seq1 <= seq2)
+ {
+ if (seq0 <= seq2)
+ goto s102;
+ else
+ goto s120;
+ }
+ else
+ goto s210;
+ }
+#define _GLIBCXX_PARALLEL_MERGE_3_CASE(a,b,c,c0,c1) \
+ s ## a ## b ## c : \
+ *target = *seq ## a; \
+ ++target; \
+ --length; \
+ ++seq ## a; \
+ if (length == 0) goto finish; \
+ if (seq ## a c0 seq ## b) goto s ## a ## b ## c; \
+ if (seq ## a c1 seq ## c) goto s ## b ## a ## c; \
+ goto s ## b ## c ## a;
+
+ _GLIBCXX_PARALLEL_MERGE_3_CASE(0, 1, 2, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_3_CASE(1, 2, 0, <=, < );
+ _GLIBCXX_PARALLEL_MERGE_3_CASE(2, 0, 1, < , < );
+ _GLIBCXX_PARALLEL_MERGE_3_CASE(1, 0, 2, < , <=);
+ _GLIBCXX_PARALLEL_MERGE_3_CASE(0, 2, 1, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_3_CASE(2, 1, 0, < , < );
+
+#undef _GLIBCXX_PARALLEL_MERGE_3_CASE
+
+ finish:
+ ;
+
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(
+ ((RandomAccessIterator1)seq0 - seqs_begin[0].first) +
+ ((RandomAccessIterator1)seq1 - seqs_begin[1].first) +
+ ((RandomAccessIterator1)seq2 - seqs_begin[2].first)
+ == orig_length);
+#endif
+
+ seqs_begin[0].first = seq0;
+ seqs_begin[1].first = seq1;
+ seqs_begin[2].first = seq2;
+
+ return target;
+ }
+
+/**
+ * @brief Highly efficient 4-way merging procedure.
+ *
+ * Merging is done with the algorithm implementation described by Peter
+ * Sanders. Basically, the idea is to minimize the number of necessary
+ * comparison after merging out an element. The implementation trick
+ * that makes this fast is that the order of the sequences is stored
+ * in the instruction pointer (translated into goto labels in C++).
+ *
+ * This works well for merging up to 4 sequences.
+ *
+ * Note that making the merging stable does <em>not</em> come at a
+ * performance hit.
+ *
+ * Whether the merging is done guarded or unguarded is selected by the
+ * used iterator class.
+ *
+ * @param seqs_begin Begin iterator of iterator pair input sequence.
+ * @param seqs_end End iterator of iterator pair input sequence.
+ * @param target Begin iterator out output sequence.
+ * @param comp Comparator.
+ * @param length Maximum length to merge, less equal than the
+ * total number of elements available.
+ *
+ * @return End iterator of output sequence.
+ */
+template<template<typename RAI, typename C> class iterator,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+ RandomAccessIterator3
+ multiway_merge_4_variant(RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ _DifferenceTp length, Comparator comp)
+ {
+ _GLIBCXX_CALL(length);
+ typedef _DifferenceTp difference_type;
+
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::value_type
+ value_type;
+
+ iterator<RandomAccessIterator1, Comparator>
+ seq0(seqs_begin[0].first, seqs_begin[0].second, comp),
+ seq1(seqs_begin[1].first, seqs_begin[1].second, comp),
+ seq2(seqs_begin[2].first, seqs_begin[2].second, comp),
+ seq3(seqs_begin[3].first, seqs_begin[3].second, comp);
+
+#define _GLIBCXX_PARALLEL_DECISION(a,b,c,d) { \
+ if (seq ## d < seq ## a) goto s ## d ## a ## b ## c; \
+ if (seq ## d < seq ## b) goto s ## a ## d ## b ## c; \
+ if (seq ## d < seq ## c) goto s ## a ## b ## d ## c; \
+ goto s ## a ## b ## c ## d; }
+
+ if (seq0 <= seq1)
+ {
+ if (seq1 <= seq2)
+ _GLIBCXX_PARALLEL_DECISION(0,1,2,3)
+ else
+ if (seq2 < seq0)
+ _GLIBCXX_PARALLEL_DECISION(2,0,1,3)
+ else
+ _GLIBCXX_PARALLEL_DECISION(0,2,1,3)
+ }
+ else
+ {
+ if (seq1 <= seq2)
+ {
+ if (seq0 <= seq2)
+ _GLIBCXX_PARALLEL_DECISION(1,0,2,3)
+ else
+ _GLIBCXX_PARALLEL_DECISION(1,2,0,3)
+ }
+ else
+ _GLIBCXX_PARALLEL_DECISION(2,1,0,3)
+ }
+
+#define _GLIBCXX_PARALLEL_MERGE_4_CASE(a,b,c,d,c0,c1,c2) \
+ s ## a ## b ## c ## d: \
+ if (length == 0) goto finish; \
+ *target = *seq ## a; \
+ ++target; \
+ --length; \
+ ++seq ## a; \
+ if (seq ## a c0 seq ## b) goto s ## a ## b ## c ## d; \
+ if (seq ## a c1 seq ## c) goto s ## b ## a ## c ## d; \
+ if (seq ## a c2 seq ## d) goto s ## b ## c ## a ## d; \
+ goto s ## b ## c ## d ## a;
+
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 1, 2, 3, <=, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 1, 3, 2, <=, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 2, 1, 3, <=, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 2, 3, 1, <=, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 3, 1, 2, <=, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(0, 3, 2, 1, <=, <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 0, 2, 3, < , <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 0, 3, 2, < , <=, <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 2, 0, 3, <=, < , <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 2, 3, 0, <=, <=, < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 3, 0, 2, <=, < , <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(1, 3, 2, 0, <=, <=, < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 0, 1, 3, < , < , <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 0, 3, 1, < , <=, < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 1, 0, 3, < , < , <=);
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 1, 3, 0, < , <=, < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 3, 0, 1, <=, < , < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(2, 3, 1, 0, <=, < , < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 0, 1, 2, < , < , < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 0, 2, 1, < , < , < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 1, 0, 2, < , < , < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 1, 2, 0, < , < , < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 2, 0, 1, < , < , < );
+ _GLIBCXX_PARALLEL_MERGE_4_CASE(3, 2, 1, 0, < , < , < );
+
+#undef _GLIBCXX_PARALLEL_MERGE_4_CASE
+#undef _GLIBCXX_PARALLEL_DECISION
+
+ finish:
+ ;
+
+ seqs_begin[0].first = seq0;
+ seqs_begin[1].first = seq1;
+ seqs_begin[2].first = seq2;
+ seqs_begin[3].first = seq3;
+
+ return target;
+ }
+
+/** @brief Multi-way merging procedure for a high branching factor,
+ * guarded case.
+ *
+ * This merging variant uses a LoserTree class as selected by <tt>LT</tt>.
+ *
+ * Stability is selected through the used LoserTree class <tt>LT</tt>.
+ *
+ * At least one non-empty sequence is required.
+ *
+ * @param seqs_begin Begin iterator of iterator pair input sequence.
+ * @param seqs_end End iterator of iterator pair input sequence.
+ * @param target Begin iterator out output sequence.
+ * @param comp Comparator.
+ * @param length Maximum length to merge, less equal than the
+ * total number of elements available.
+ *
+ * @return End iterator of output sequence.
+ */
+template<typename LT,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+ RandomAccessIterator3
+ multiway_merge_loser_tree(RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ _DifferenceTp length, Comparator comp)
+ {
+ _GLIBCXX_CALL(length)
+
+ typedef _DifferenceTp difference_type;
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::value_type
+ value_type;
+
+ int k = static_cast<int>(seqs_end - seqs_begin);
+
+ LT lt(k, comp);
+
+ // Default value for potentially non-default-constructible types.
+ value_type* arbitrary_element = NULL;
+
+ for (int t = 0; t < k; ++t)
+ {
+ if(arbitrary_element == NULL
+ && _GLIBCXX_PARALLEL_LENGTH(seqs_begin[t]) > 0)
+ arbitrary_element = &(*seqs_begin[t].first);
+ }
+
+ for (int t = 0; t < k; ++t)
+ {
+ if (seqs_begin[t].first == seqs_begin[t].second)
+ lt.insert_start(*arbitrary_element, t, true);
+ else
+ lt.insert_start(*seqs_begin[t].first, t, false);
+ }
+
+ lt.init();
+
+ int source;
+
+ for (difference_type i = 0; i < length; ++i)
+ {
+ //take out
+ source = lt.get_min_source();
+
+ *(target++) = *(seqs_begin[source].first++);
+
+ // Feed.
+ if (seqs_begin[source].first == seqs_begin[source].second)
+ lt.delete_min_insert(*arbitrary_element, true);
+ else
+ // Replace from same source.
+ lt.delete_min_insert(*seqs_begin[source].first, false);
+ }
+
+ return target;
+ }
+
+/** @brief Multi-way merging procedure for a high branching factor,
+ * unguarded case.
+ *
+ * Merging is done using the LoserTree class <tt>LT</tt>.
+ *
+ * Stability is selected by the used LoserTrees.
+ *
+ * @pre No input will run out of elements during the merge.
+ *
+ * @param seqs_begin Begin iterator of iterator pair input sequence.
+ * @param seqs_end End iterator of iterator pair input sequence.
+ * @param target Begin iterator out output sequence.
+ * @param comp Comparator.
+ * @param length Maximum length to merge, less equal than the
+ * total number of elements available.
+ *
+ * @return End iterator of output sequence.
+ */
+template<typename LT,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp, typename Comparator>
+ RandomAccessIterator3
+ multiway_merge_loser_tree_unguarded(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ const typename std::iterator_traits<typename std::iterator_traits<
+ RandomAccessIteratorIterator>::value_type::first_type>::value_type&
+ sentinel,
+ _DifferenceTp length,
+ Comparator comp)
+ {
+ _GLIBCXX_CALL(length)
+ typedef _DifferenceTp difference_type;
+
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::value_type
+ value_type;
+
+ int k = seqs_end - seqs_begin;
+
+ LT lt(k, sentinel, comp);
+
+ for (int t = 0; t < k; ++t)
+ {
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(seqs_begin[t].first != seqs_begin[t].second);
+#endif
+ lt.insert_start(*seqs_begin[t].first, t, false);
+ }
+
+ lt.init();
+
+ int source;
+
+#if _GLIBCXX_ASSERTIONS
+ difference_type i = 0;
+#endif
+
+ RandomAccessIterator3 target_end = target + length;
+ while (target < target_end)
+ {
+ // Take out.
+ source = lt.get_min_source();
+
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(0 <= source && source < k);
+ _GLIBCXX_PARALLEL_ASSERT(i == 0
+ || !comp(*(seqs_begin[source].first), *(target - 1)));
+#endif
+
+ // Feed.
+ *(target++) = *(seqs_begin[source].first++);
+
+#if _GLIBCXX_ASSERTIONS
+ ++i;
+#endif
+ // Replace from same source.
+ lt.delete_min_insert(*seqs_begin[source].first, false);
+ }
+
+ return target;
+ }
+
+
+/** @brief Multi-way merging procedure for a high branching factor,
+ * requiring sentinels to exist.
+ *
+ * @param stable The value must the same as for the used LoserTrees.
+ * @param UnguardedLoserTree Loser Tree variant to use for the unguarded
+ * merging.
+ * @param GuardedLoserTree Loser Tree variant to use for the guarded
+ * merging.
+ *
+ * @param seqs_begin Begin iterator of iterator pair input sequence.
+ * @param seqs_end End iterator of iterator pair input sequence.
+ * @param target Begin iterator out output sequence.
+ * @param comp Comparator.
+ * @param length Maximum length to merge, less equal than the
+ * total number of elements available.
+ *
+ * @return End iterator of output sequence.
+ */
+template<
+ typename UnguardedLoserTree,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+ RandomAccessIterator3
+ multiway_merge_loser_tree_sentinel(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ const typename std::iterator_traits<typename std::iterator_traits<
+ RandomAccessIteratorIterator>::value_type::first_type>::value_type&
+ sentinel,
+ _DifferenceTp length,
+ Comparator comp)
+ {
+ _GLIBCXX_CALL(length)
+
+ typedef _DifferenceTp difference_type;
+ typedef std::iterator_traits<RandomAccessIteratorIterator> traits_type;
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::value_type
+ value_type;
+
+ RandomAccessIterator3 target_end;
+
+ for (RandomAccessIteratorIterator s = seqs_begin; s != seqs_end; ++s)
+ // Move the sequends end behind the sentinel spots. This has the
+ // effect that the sentinel appears to be within the sequence. Then,
+ // we can use the unguarded variant if we merge out as many
+ // non-sentinel elements as we have.
+ ++((*s).second);
+
+ target_end = multiway_merge_loser_tree_unguarded
+ <UnguardedLoserTree>
+ (seqs_begin, seqs_end, target, sentinel, length, comp);
+
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(target_end == target + length);
+ _GLIBCXX_PARALLEL_ASSERT(is_sorted(target, target_end, comp));
+#endif
+
+ // Restore the sequence ends so the sentinels are not contained in the
+ // sequence any more (see comment in loop above).
+ for (RandomAccessIteratorIterator s = seqs_begin; s != seqs_end; ++s)
+ --((*s).second);
+
+ return target_end;
+ }
+
+/**
+ * @brief Traits for determining whether the loser tree should
+ * use pointers or copies.
+ *
+ * The field "use_pointer" is used to determine whether to use pointers in
+ * the loser trees or whether to copy the values into the loser tree.
+ *
+ * The default behavior is to use pointers if the data type is 4 times as
+ * big as the pointer to it.
+ *
+ * Specialize for your data type to customize the behavior.
+ *
+ * Example:
+ *
+ * template<>
+ * struct loser_tree_traits<int>
+ * { static const bool use_pointer = false; };
+ *
+ * template<>
+ * struct loser_tree_traits<heavyweight_type>
+ * { static const bool use_pointer = true; };
+ *
+ * @param T type to give the loser tree traits for.
+ */
+template <typename T>
+struct loser_tree_traits
+{
+ /**
+ * @brief True iff to use pointers instead of values in loser trees.
+ *
+ * The default behavior is to use pointers if the data type is four
+ * times as big as the pointer to it.
+ */
+ static const bool use_pointer = (sizeof(T) > 4 * sizeof(T*));
+};
+
+/**
+ * @brief Switch for 3-way merging with sentinels turned off.
+ *
+ * Note that 3-way merging is always stable!
+ */
+template<
+ bool sentinels /*default == false*/,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+struct multiway_merge_3_variant_sentinel_switch
+{
+ RandomAccessIterator3 operator()(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ _DifferenceTp length, Comparator comp)
+ {
+ return multiway_merge_3_variant<guarded_iterator>(
+ seqs_begin, seqs_end, target, length, comp);
+ }
+};
+
+/**
+ * @brief Switch for 3-way merging with sentinels turned on.
+ *
+ * Note that 3-way merging is always stable!
+ */
+template<
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+struct multiway_merge_3_variant_sentinel_switch
+ <true, RandomAccessIteratorIterator, RandomAccessIterator3,
+ _DifferenceTp, Comparator>
+{
+ RandomAccessIterator3 operator()(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ _DifferenceTp length, Comparator comp)
+ {
+ return multiway_merge_3_variant<unguarded_iterator>(
+ seqs_begin, seqs_end, target, length, comp);
+ }
+};
+
+/**
+ * @brief Switch for 4-way merging with sentinels turned off.
+ *
+ * Note that 4-way merging is always stable!
+ */
+template<
+ bool sentinels /*default == false*/,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+struct multiway_merge_4_variant_sentinel_switch
+{
+ RandomAccessIterator3 operator()(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ _DifferenceTp length, Comparator comp)
+ {
+ return multiway_merge_4_variant<guarded_iterator>(
+ seqs_begin, seqs_end, target, length, comp);
+ }
+};
+
+/**
+ * @brief Switch for 4-way merging with sentinels turned on.
+ *
+ * Note that 4-way merging is always stable!
+ */
+template<
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+struct multiway_merge_4_variant_sentinel_switch
+ <true, RandomAccessIteratorIterator, RandomAccessIterator3,
+ _DifferenceTp, Comparator>
+{
+ RandomAccessIterator3 operator()(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ _DifferenceTp length, Comparator comp)
+ {
+ return multiway_merge_4_variant<unguarded_iterator>(
+ seqs_begin, seqs_end, target, length, comp);
+ }
+};
+
+/**
+ * @brief Switch for k-way merging with sentinels turned on.
+ */
+template<
+ bool sentinels,
+ bool stable,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+struct multiway_merge_k_variant_sentinel_switch
+{
+ RandomAccessIterator3 operator()(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ const typename std::iterator_traits<typename std::iterator_traits<
+ RandomAccessIteratorIterator>::value_type::first_type>::value_type&
+ sentinel,
+ _DifferenceTp length, Comparator comp)
+ {
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::value_type
+ value_type;
+
+ return multiway_merge_loser_tree_sentinel<
+ typename __gnu_cxx::__conditional_type<
+ loser_tree_traits<value_type>::use_pointer
+ , LoserTreePointerUnguarded<stable, value_type, Comparator>
+ , LoserTreeUnguarded<stable, value_type, Comparator>
+ >::__type>(seqs_begin, seqs_end, target, sentinel, length, comp);
+ }
+};
+
+/**
+ * @brief Switch for k-way merging with sentinels turned off.
+ */
+template<
+ bool stable,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+struct multiway_merge_k_variant_sentinel_switch
+ <false, stable, RandomAccessIteratorIterator, RandomAccessIterator3,
+ _DifferenceTp, Comparator>
+{
+ RandomAccessIterator3 operator()(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ const typename std::iterator_traits<typename std::iterator_traits<
+ RandomAccessIteratorIterator>::value_type::first_type>::value_type&
+ sentinel,
+ _DifferenceTp length, Comparator comp)
+ {
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::value_type
+ value_type;
+
+ return multiway_merge_loser_tree<
+ typename __gnu_cxx::__conditional_type<
+ loser_tree_traits<value_type>::use_pointer
+ , LoserTreePointer<stable, value_type, Comparator>
+ , LoserTree<stable, value_type, Comparator>
+ >::__type >(seqs_begin, seqs_end, target, length, comp);
+ }
+};
+
+/** @brief Sequential multi-way merging switch.
+ *
+ * The _GLIBCXX_PARALLEL_DECISION is based on the branching factor and
+ * runtime settings.
+ * @param seqs_begin Begin iterator of iterator pair input sequence.
+ * @param seqs_end End iterator of iterator pair input sequence.
+ * @param target Begin iterator out output sequence.
+ * @param comp Comparator.
+ * @param length Maximum length to merge, possibly larger than the
+ * number of elements available.
+ * @param stable Stable merging incurs a performance penalty.
+ * @param sentinel The sequences have a sentinel element.
+ * @return End iterator of output sequence. */
+template<
+ bool stable,
+ bool sentinels,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Comparator>
+ RandomAccessIterator3
+ sequential_multiway_merge(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ const typename std::iterator_traits<typename std::iterator_traits<
+ RandomAccessIteratorIterator>::value_type::first_type>::value_type&
+ sentinel,
+ _DifferenceTp length, Comparator comp)
+ {
+ _GLIBCXX_CALL(length)
+
+ typedef _DifferenceTp difference_type;
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::value_type
+ value_type;
+
+#if _GLIBCXX_ASSERTIONS
+ for (RandomAccessIteratorIterator s = seqs_begin; s != seqs_end; ++s)
+ {
+ _GLIBCXX_PARALLEL_ASSERT(is_sorted((*s).first, (*s).second, comp));
+ }
+#endif
+
+ _DifferenceTp total_length = 0;
+ for (RandomAccessIteratorIterator s = seqs_begin; s != seqs_end; ++s)
+ total_length += _GLIBCXX_PARALLEL_LENGTH(*s);
+
+ length = std::min<_DifferenceTp>(length, total_length);
+
+ if(length == 0)
+ return target;
+
+ RandomAccessIterator3 return_target = target;
+ int k = static_cast<int>(seqs_end - seqs_begin);
+
+ switch (k)
+ {
+ case 0:
+ break;
+ case 1:
+ return_target = std::copy(seqs_begin[0].first,
+ seqs_begin[0].first + length,
+ target);
+ seqs_begin[0].first += length;
+ break;
+ case 2:
+ return_target = merge_advance(seqs_begin[0].first,
+ seqs_begin[0].second,
+ seqs_begin[1].first,
+ seqs_begin[1].second,
+ target, length, comp);
+ break;
+ case 3:
+ return_target = multiway_merge_3_variant_sentinel_switch<
+ sentinels
+ , RandomAccessIteratorIterator
+ , RandomAccessIterator3
+ , _DifferenceTp
+ , Comparator>()(seqs_begin, seqs_end, target, length, comp);
+ break;
+ case 4:
+ return_target = multiway_merge_4_variant_sentinel_switch<
+ sentinels
+ , RandomAccessIteratorIterator
+ , RandomAccessIterator3
+ , _DifferenceTp
+ , Comparator>()(seqs_begin, seqs_end, target, length, comp);
+ break;
+ default:
+ return_target = multiway_merge_k_variant_sentinel_switch<
+ sentinels
+ , stable
+ , RandomAccessIteratorIterator
+ , RandomAccessIterator3
+ , _DifferenceTp
+ , Comparator>()(seqs_begin, seqs_end, target, sentinel, length, comp);
+ break;
+ }
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(is_sorted(target, target + length, comp));
+#endif
+
+ return return_target;
+ }
+
+/**
+ * @brief Stable sorting functor.
+ *
+ * Used to reduce code instanciation in multiway_merge_sampling_splitting.
+ */
+template<bool stable, class RandomAccessIterator, class StrictWeakOrdering>
+struct sampling_sorter
+{
+ void operator()(RandomAccessIterator first, RandomAccessIterator last,
+ StrictWeakOrdering comp)
+ { __gnu_sequential::stable_sort(first, last, comp); }
+};
+
+/**
+ * @brief Non-stable sorting functor.
+ *
+ * Used to reduce code instantiation in multiway_merge_sampling_splitting.
+ */
+template<class RandomAccessIterator, class StrictWeakOrdering>
+struct sampling_sorter<false, RandomAccessIterator, StrictWeakOrdering>
+{
+ void operator()(RandomAccessIterator first, RandomAccessIterator last,
+ StrictWeakOrdering comp)
+ { __gnu_sequential::sort(first, last, comp); }
+};
+
+/**
+ * @brief Sampling based splitting for parallel multiway-merge routine.
+ */
+template<
+ bool stable
+ , typename RandomAccessIteratorIterator
+ , typename Comparator
+ , typename difference_type>
+void multiway_merge_sampling_splitting(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ difference_type length, difference_type total_length, Comparator comp,
+ std::vector<std::pair<difference_type, difference_type> > *pieces)
+{
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+ typedef typename std::iterator_traits<RandomAccessIterator1>::value_type
+ value_type;
+
+ // k sequences.
+ int k = static_cast<int>(seqs_end - seqs_begin);
+
+ int num_threads = omp_get_num_threads();
+
+ difference_type num_samples =
+ __gnu_parallel::_Settings::get().merge_oversampling * num_threads;
+
+ value_type* samples = static_cast<value_type*>(
+ ::operator new(sizeof(value_type) * k * num_samples));
+ // Sample.
+ for (int s = 0; s < k; ++s)
+ for (difference_type i = 0; i < num_samples; ++i)
+ {
+ difference_type sample_index =
+ static_cast<difference_type>(
+ _GLIBCXX_PARALLEL_LENGTH(seqs_begin[s])
+ * (double(i + 1) / (num_samples + 1))
+ * (double(length) / total_length));
+ new(&(samples[s * num_samples + i]))
+ value_type(seqs_begin[s].first[sample_index]);
+ }
+
+ // Sort stable or non-stable, depending on value of template parameter
+ // "stable".
+ sampling_sorter<stable, value_type*, Comparator>()(
+ samples, samples + (num_samples * k), comp);
+
+ for (int slab = 0; slab < num_threads; ++slab)
+ // For each slab / processor.
+ for (int seq = 0; seq < k; ++seq)
+ {
+ // For each sequence.
+ if (slab > 0)
+ pieces[slab][seq].first =
+ std::upper_bound(
+ seqs_begin[seq].first,
+ seqs_begin[seq].second,
+ samples[num_samples * k * slab / num_threads],
+ comp)
+ - seqs_begin[seq].first;
+ else
+ // Absolute beginning.
+ pieces[slab][seq].first = 0;
+ if ((slab + 1) < num_threads)
+ pieces[slab][seq].second =
+ std::upper_bound(
+ seqs_begin[seq].first,
+ seqs_begin[seq].second,
+ samples[num_samples * k * (slab + 1) /
+ num_threads], comp)
+ - seqs_begin[seq].first;
+ else
+ // Absolute end.
+ pieces[slab][seq].second = _GLIBCXX_PARALLEL_LENGTH(seqs_begin[seq]);
+ }
+ ::operator delete(samples);
+}
+
+/**
+ * @brief Exact splitting for parallel multiway-merge routine.
+ *
+ * None of the passed sequences may be empty.
+ */
+template<
+ bool stable
+ , typename RandomAccessIteratorIterator
+ , typename Comparator
+ , typename difference_type>
+void multiway_merge_exact_splitting(
+ RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ difference_type length, difference_type total_length, Comparator comp,
+ std::vector<std::pair<difference_type, difference_type> > *pieces)
+{
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+
+ const bool tight = (total_length == length);
+
+ // k sequences.
+ const int k = static_cast<int>(seqs_end - seqs_begin);
+
+ const int num_threads = omp_get_num_threads();
+
+ // (Settings::multiway_merge_splitting == __gnu_parallel::_Settings::EXACT).
+ std::vector<RandomAccessIterator1>* offsets =
+ new std::vector<RandomAccessIterator1>[num_threads];
+ std::vector<
+ std::pair<RandomAccessIterator1, RandomAccessIterator1>
+ > se(k);
+
+ copy(seqs_begin, seqs_end, se.begin());
+
+ difference_type* borders =
+ new difference_type[num_threads + 1];
+ equally_split(length, num_threads, borders);
+
+ for (int s = 0; s < (num_threads - 1); ++s)
+ {
+ offsets[s].resize(k);
+ multiseq_partition(
+ se.begin(), se.end(), borders[s + 1],
+ offsets[s].begin(), comp);
+
+ // Last one also needed and available.
+ if (!tight)
+ {
+ offsets[num_threads - 1].resize(k);
+ multiseq_partition(se.begin(), se.end(),
+ difference_type(length),
+ offsets[num_threads - 1].begin(), comp);
+ }
+ }
+ delete[] borders;
+
+ for (int slab = 0; slab < num_threads; ++slab)
+ {
+ // For each slab / processor.
+ for (int seq = 0; seq < k; ++seq)
+ {
+ // For each sequence.
+ if (slab == 0)
+ {
+ // Absolute beginning.
+ pieces[slab][seq].first = 0;
+ }
+ else
+ pieces[slab][seq].first =
+ pieces[slab - 1][seq].second;
+ if (!tight || slab < (num_threads - 1))
+ pieces[slab][seq].second =
+ offsets[slab][seq] - seqs_begin[seq].first;
+ else
+ {
+ // slab == num_threads - 1
+ pieces[slab][seq].second =
+ _GLIBCXX_PARALLEL_LENGTH(seqs_begin[seq]);
+ }
+ }
+ }
+ delete[] offsets;
+}
+
+/** @brief Parallel multi-way merge routine.
+ *
+ * The _GLIBCXX_PARALLEL_DECISION is based on the branching factor
+ * and runtime settings.
+ *
+ * Must not be called if the number of sequences is 1.
+ *
+ * @param Splitter functor to split input (either exact or sampling based)
+ *
+ * @param seqs_begin Begin iterator of iterator pair input sequence.
+ * @param seqs_end End iterator of iterator pair input sequence.
+ * @param target Begin iterator out output sequence.
+ * @param comp Comparator.
+ * @param length Maximum length to merge, possibly larger than the
+ * number of elements available.
+ * @param stable Stable merging incurs a performance penalty.
+ * @param sentinel Ignored.
+ * @return End iterator of output sequence.
+ */
+template<
+ bool stable,
+ bool sentinels,
+ typename RandomAccessIteratorIterator,
+ typename RandomAccessIterator3,
+ typename _DifferenceTp,
+ typename Splitter,
+ typename Comparator
+ >
+ RandomAccessIterator3
+ parallel_multiway_merge(RandomAccessIteratorIterator seqs_begin,
+ RandomAccessIteratorIterator seqs_end,
+ RandomAccessIterator3 target,
+ Splitter splitter,
+ _DifferenceTp length,
+ Comparator comp,
+ thread_index_t num_threads)
+ {
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(seqs_end - seqs_begin > 1);
+#endif
+
+ _GLIBCXX_CALL(length)
+
+ typedef _DifferenceTp difference_type;
+ typedef typename std::iterator_traits<RandomAccessIteratorIterator>
+ ::value_type::first_type
+ RandomAccessIterator1;
+ typedef typename
+ std::iterator_traits<RandomAccessIterator1>::value_type value_type;
+
+ // Leave only non-empty sequences.
+ typedef std::pair<RandomAccessIterator1, RandomAccessIterator1> seq_type;
+ seq_type* ne_seqs = new seq_type[seqs_end - seqs_begin];
+ int k = 0;
+ difference_type total_length = 0;
+ for (RandomAccessIteratorIterator raii = seqs_begin;
+ raii != seqs_end; ++raii)
+ {
+ _DifferenceTp seq_length = _GLIBCXX_PARALLEL_LENGTH(*raii);
+ if(seq_length > 0)
+ {
+ total_length += seq_length;
+ ne_seqs[k++] = *raii;
+ }
+ }
+
+ _GLIBCXX_CALL(total_length)
+
+ length = std::min<_DifferenceTp>(length, total_length);
+
+ if (total_length == 0 || k == 0)
+ {
+ delete[] ne_seqs;
+ return target;
+ }
+
+ std::vector<std::pair<difference_type, difference_type> >* pieces;
+
+ num_threads = static_cast<thread_index_t>
+ (std::min<difference_type>(num_threads, total_length));
+
+# pragma omp parallel num_threads (num_threads)
+ {
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+ // Thread t will have to merge pieces[iam][0..k - 1]
+ pieces = new std::vector<
+ std::pair<difference_type, difference_type> >[num_threads];
+ for (int s = 0; s < num_threads; ++s)
+ pieces[s].resize(k);
+
+ difference_type num_samples =
+ __gnu_parallel::_Settings::get().merge_oversampling *
+ num_threads;
+
+ splitter(ne_seqs, ne_seqs + k, length, total_length,
+ comp, pieces);
+ } //single
+
+ thread_index_t iam = omp_get_thread_num();
+
+ difference_type target_position = 0;
+
+ for (int c = 0; c < k; ++c)
+ target_position += pieces[iam][c].first;
+
+ seq_type* chunks = new seq_type[k];
+
+ for (int s = 0; s < k; ++s)
+ {
+ chunks[s] = std::make_pair(
+ ne_seqs[s].first + pieces[iam][s].first,
+ ne_seqs[s].first + pieces[iam][s].second);
+ }
+
+ if(length > target_position)
+ sequential_multiway_merge<stable, sentinels>(
+ chunks, chunks + k, target + target_position,
+ *(seqs_begin->second), length - target_position, comp);
+
+ delete[] chunks;
+ } // parallel
+
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(is_sorted(target, target + length, comp));
+#endif
+
+ k = 0;
+ // Update ends of sequences.
+ for (RandomAccessIteratorIterator raii = seqs_begin;
+ raii != seqs_end; ++raii)
+ {
+ _DifferenceTp length = _GLIBCXX_PARALLEL_LENGTH(*raii);
+ if(length > 0)
+ (*raii).first += pieces[num_threads - 1][k++].second;
+ }
+
+ delete[] pieces;
+ delete[] ne_seqs;
+
+ return target + length;
+ }
+
+/**
+ * @brief Multiway Merge Frontend.
+ *
+ * Merge the sequences specified by seqs_begin and seqs_end into
+ * target. seqs_begin and seqs_end must point to a sequence of
+ * pairs. These pairs must contain an iterator to the beginning
+ * of a sequence in their first entry and an iterator the end of
+ * the same sequence in their second entry.
+ *
+ * Ties are broken arbitrarily. See stable_multiway_merge for a variant
+ * that breaks ties by sequence number but is slower.
+ *
+ * The first entries of the pairs (i.e. the begin iterators) will be moved
+ * forward.
+ *
+ * The output sequence has to provide enough space for all elements
+ * that are written to it.
+ *
+ * This function will merge the input sequences:
+ *
+ * - not stable
+ * - parallel, depending on the input size and Settings
+ * - using sampling for splitting
+ * - not using sentinels
+ *
+ * Example:
+ *
+ * <pre>
+ * int sequences[10][10];
+ * for (int i = 0; i < 10; ++i)
+ * for (int j = 0; i < 10; ++j)
+ * sequences[i][j] = j;
+ *
+ * int out[33];
+ * std::vector<std::pair<int*> > seqs;
+ * for (int i = 0; i < 10; ++i)
+ * { seqs.push(std::make_pair<int*>(sequences[i], sequences[i] + 10)) }
+ *
+ * multiway_merge(seqs.begin(), seqs.end(), target, std::less<int>(), 33);
+ * </pre>
+ *
+ * @see stable_multiway_merge
+ *
+ * @pre All input sequences must be sorted.
+ * @pre Target must provide enough space to merge out length elements or
+ * the number of elements in all sequences, whichever is smaller.
+ *
+ * @post [target, return value) contains merged elements from the
+ * input sequences.
+ * @post return value - target = min(length, number of elements in all
+ * sequences).
+ *
+ * @param RandomAccessIteratorPairIterator iterator over sequence
+ * of pairs of iterators
+ * @param RandomAccessIteratorOut iterator over target sequence
+ * @param _DifferenceTp difference type for the sequence
+ * @param Comparator strict weak ordering type to compare elements
+ * in sequences
+ *
+ * @param seqs_begin begin of sequence sequence
+ * @param seqs_end end of sequence sequence
+ * @param target target sequence to merge to.
+ * @param comp strict weak ordering to use for element comparison.
+ * @param length Maximum length to merge, possibly larger than the
+ * number of elements available.
+ *
+ * @return end iterator of output sequence
+ */
+// multiway_merge
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+multiway_merge(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , __gnu_parallel::sequential_tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute multiway merge *sequentially*.
+ return sequential_multiway_merge
+ </* stable = */ false, /* sentinels = */ false>
+ (seqs_begin, seqs_end, target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+multiway_merge(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , __gnu_parallel::exact_tag tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((seqs_end - seqs_begin > 1) &&
+ _GLIBCXX_PARALLEL_CONDITION(
+ ((seqs_end - seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((sequence_index_t)length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* stable = */ false, /* sentinels = */ false>(
+ seqs_begin, seqs_end, target,
+ multiway_merge_exact_splitting</* stable = */ false,
+ typename std::iterator_traits<RandomAccessIteratorPairIterator>
+ ::value_type*, Comparator, _DifferenceTp>,
+ static_cast<difference_type>(length), comp, tag.get_num_threads());
+ else
+ return sequential_multiway_merge
+ </* stable = */ false, /* sentinels = */ false>(
+ seqs_begin, seqs_end, target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+multiway_merge(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , __gnu_parallel::sampling_tag tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((seqs_end - seqs_begin > 1) &&
+ _GLIBCXX_PARALLEL_CONDITION(
+ ((seqs_end - seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((sequence_index_t)length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* stable = */ false, /* sentinels = */ false>(
+ seqs_begin, seqs_end,
+ target,
+ multiway_merge_exact_splitting</* stable = */ false,
+ typename std::iterator_traits<RandomAccessIteratorPairIterator>
+ ::value_type*, Comparator, _DifferenceTp>,
+ static_cast<difference_type>(length), comp, tag.get_num_threads());
+ else
+ return sequential_multiway_merge
+ </* stable = */ false, /* sentinels = */ false>(
+ seqs_begin, seqs_end,
+ target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+multiway_merge(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , parallel_tag tag = parallel_tag(0))
+{
+ return multiway_merge(seqs_begin, seqs_end, target, length, comp,
+ exact_tag(tag.get_num_threads()));
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+multiway_merge(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , default_parallel_tag tag)
+{
+ return multiway_merge(seqs_begin, seqs_end, target, length, comp,
+ exact_tag(tag.get_num_threads()));
+}
+
+// stable_multiway_merge
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+stable_multiway_merge(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , __gnu_parallel::sequential_tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute multiway merge *sequentially*.
+ return sequential_multiway_merge
+ </* stable = */ true, /* sentinels = */ false>
+ (seqs_begin, seqs_end, target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+stable_multiway_merge(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , __gnu_parallel::exact_tag tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((seqs_end - seqs_begin > 1) &&
+ _GLIBCXX_PARALLEL_CONDITION(
+ ((seqs_end - seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((sequence_index_t)length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* stable = */ true, /* sentinels = */ false>(
+ seqs_begin, seqs_end,
+ target,
+ multiway_merge_exact_splitting</* stable = */ true,
+ typename std::iterator_traits<RandomAccessIteratorPairIterator>
+ ::value_type*, Comparator, _DifferenceTp>,
+ static_cast<difference_type>(length), comp, tag.get_num_threads());
+ else
+ return sequential_multiway_merge</* stable = */ true,
+ /* sentinels = */ false>(
+ seqs_begin, seqs_end,
+ target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+stable_multiway_merge(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , sampling_tag tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((seqs_end - seqs_begin > 1) &&
+ _GLIBCXX_PARALLEL_CONDITION(
+ ((seqs_end - seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((sequence_index_t)length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* stable = */ true, /* sentinels = */ false>(
+ seqs_begin, seqs_end,
+ target,
+ multiway_merge_sampling_splitting</* stable = */ true,
+ typename std::iterator_traits<RandomAccessIteratorPairIterator>
+ ::value_type*, Comparator, _DifferenceTp>,
+ static_cast<difference_type>(length), comp, tag.get_num_threads());
+ else
+ return sequential_multiway_merge
+ </* stable = */ true, /* sentinels = */ false>(
+ seqs_begin, seqs_end,
+ target, *(seqs_begin->second), length, comp);
+}
+
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+stable_multiway_merge(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , parallel_tag tag = parallel_tag(0))
+{
+ return stable_multiway_merge(seqs_begin, seqs_end, target, length, comp,
+ exact_tag(tag.get_num_threads()));
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+stable_multiway_merge(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , default_parallel_tag tag)
+{
+ return stable_multiway_merge(seqs_begin, seqs_end, target, length, comp,
+ exact_tag(tag.get_num_threads()));
+}
+
+/**
+ * @brief Multiway Merge Frontend.
+ *
+ * Merge the sequences specified by seqs_begin and seqs_end into
+ * target. seqs_begin and seqs_end must point to a sequence of
+ * pairs. These pairs must contain an iterator to the beginning
+ * of a sequence in their first entry and an iterator the end of
+ * the same sequence in their second entry.
+ *
+ * Ties are broken arbitrarily. See stable_multiway_merge for a variant
+ * that breaks ties by sequence number but is slower.
+ *
+ * The first entries of the pairs (i.e. the begin iterators) will be moved
+ * forward accordingly.
+ *
+ * The output sequence has to provide enough space for all elements
+ * that are written to it.
+ *
+ * This function will merge the input sequences:
+ *
+ * - not stable
+ * - parallel, depending on the input size and Settings
+ * - using sampling for splitting
+ * - using sentinels
+ *
+ * You have to take care that the element the end iterator points to is
+ * readable and contains a value that is greater than any other non-sentinel
+ * value in all sequences.
+ *
+ * Example:
+ *
+ * <pre>
+ * int sequences[10][11];
+ * for (int i = 0; i < 10; ++i)
+ * for (int j = 0; i < 11; ++j)
+ * sequences[i][j] = j; // last one is sentinel!
+ *
+ * int out[33];
+ * std::vector<std::pair<int*> > seqs;
+ * for (int i = 0; i < 10; ++i)
+ * { seqs.push(std::make_pair<int*>(sequences[i], sequences[i] + 10)) }
+ *
+ * multiway_merge(seqs.begin(), seqs.end(), target, std::less<int>(), 33);
+ * </pre>
+ *
+ * @pre All input sequences must be sorted.
+ * @pre Target must provide enough space to merge out length elements or
+ * the number of elements in all sequences, whichever is smaller.
+ * @pre For each @c i, @c seqs_begin[i].second must be the end
+ * marker of the sequence, but also reference the one more sentinel
+ * element.
+ *
+ * @post [target, return value) contains merged elements from the
+ * input sequences.
+ * @post return value - target = min(length, number of elements in all
+ * sequences).
+ *
+ * @see stable_multiway_merge_sentinels
+ *
+ * @param RandomAccessIteratorPairIterator iterator over sequence
+ * of pairs of iterators
+ * @param RandomAccessIteratorOut iterator over target sequence
+ * @param _DifferenceTp difference type for the sequence
+ * @param Comparator strict weak ordering type to compare elements
+ * in sequences
+ *
+ * @param seqs_begin begin of sequence sequence
+ * @param seqs_end end of sequence sequence
+ * @param target target sequence to merge to.
+ * @param comp strict weak ordering to use for element comparison.
+ * @param length Maximum length to merge, possibly larger than the
+ * number of elements available.
+ *
+ * @return end iterator of output sequence
+ */
+// multiway_merge_sentinels
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+multiway_merge_sentinels(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , __gnu_parallel::sequential_tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute multiway merge *sequentially*.
+ return sequential_multiway_merge
+ </* stable = */ false, /* sentinels = */ true>
+ (seqs_begin, seqs_end,
+ target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+multiway_merge_sentinels(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , __gnu_parallel::exact_tag tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((seqs_end - seqs_begin > 1) &&
+ _GLIBCXX_PARALLEL_CONDITION(
+ ((seqs_end - seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((sequence_index_t)length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* stable = */ false, /* sentinels = */ true>(
+ seqs_begin, seqs_end,
+ target,
+ multiway_merge_exact_splitting</* stable = */ false,
+ typename std::iterator_traits<RandomAccessIteratorPairIterator>
+ ::value_type*, Comparator, _DifferenceTp>,
+ static_cast<difference_type>(length), comp, tag.get_num_threads());
+ else
+ return sequential_multiway_merge
+ </* stable = */ false, /* sentinels = */ true>(
+ seqs_begin, seqs_end,
+ target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+multiway_merge_sentinels(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , sampling_tag tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((seqs_end - seqs_begin > 1) &&
+ _GLIBCXX_PARALLEL_CONDITION(
+ ((seqs_end - seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((sequence_index_t)length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* stable = */ false, /* sentinels = */ true>
+ (seqs_begin, seqs_end, target,
+ multiway_merge_sampling_splitting</* stable = */ false,
+ typename std::iterator_traits<RandomAccessIteratorPairIterator>
+ ::value_type*, Comparator, _DifferenceTp>,
+ static_cast<difference_type>(length), comp, tag.get_num_threads());
+ else
+ return sequential_multiway_merge
+ </* stable = */false, /* sentinels = */ true>(
+ seqs_begin, seqs_end,
+ target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+multiway_merge_sentinels(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , parallel_tag tag = parallel_tag(0))
+{
+ return multiway_merge_sentinels(seqs_begin, seqs_end, target, length, comp,
+ exact_tag(tag.get_num_threads()));
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+multiway_merge_sentinels(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , default_parallel_tag tag)
+{
+ return multiway_merge_sentinels(seqs_begin, seqs_end, target, length, comp,
+ exact_tag(tag.get_num_threads()));
+}
+
+// stable_multiway_merge_sentinels
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+stable_multiway_merge_sentinels(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , __gnu_parallel::sequential_tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute multiway merge *sequentially*.
+ return sequential_multiway_merge
+ </* stable = */ true, /* sentinels = */ true>
+ (seqs_begin, seqs_end, target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+stable_multiway_merge_sentinels(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , __gnu_parallel::exact_tag tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((seqs_end - seqs_begin > 1) &&
+ _GLIBCXX_PARALLEL_CONDITION(
+ ((seqs_end - seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((sequence_index_t)length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* stable = */ true, /* sentinels = */ true>(
+ seqs_begin, seqs_end,
+ target,
+ multiway_merge_exact_splitting</* stable = */ true,
+ typename std::iterator_traits<RandomAccessIteratorPairIterator>
+ ::value_type*, Comparator, _DifferenceTp>,
+ static_cast<difference_type>(length), comp, tag.get_num_threads());
+ else
+ return sequential_multiway_merge
+ </* stable = */ true, /* sentinels = */ true>(
+ seqs_begin, seqs_end, target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+stable_multiway_merge_sentinels(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , sampling_tag tag)
+{
+ typedef _DifferenceTp difference_type;
+ _GLIBCXX_CALL(seqs_end - seqs_begin)
+
+ // catch special case: no sequences
+ if (seqs_begin == seqs_end)
+ return target;
+
+ // Execute merge; maybe parallel, depending on the number of merged
+ // elements and the number of sequences and global thresholds in
+ // Settings.
+ if ((seqs_end - seqs_begin > 1) &&
+ _GLIBCXX_PARALLEL_CONDITION(
+ ((seqs_end - seqs_begin) >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_k)
+ && ((sequence_index_t)length >=
+ __gnu_parallel::_Settings::get().multiway_merge_minimal_n)))
+ return parallel_multiway_merge
+ </* stable = */ true, /* sentinels = */ true>(
+ seqs_begin, seqs_end,
+ target,
+ multiway_merge_sampling_splitting</* stable = */ true,
+ typename std::iterator_traits<RandomAccessIteratorPairIterator>
+ ::value_type*, Comparator, _DifferenceTp>,
+ static_cast<difference_type>(length), comp, tag.get_num_threads());
+ else
+ return sequential_multiway_merge
+ </* stable = */ true, /* sentinels = */ true>(
+ seqs_begin, seqs_end,
+ target, *(seqs_begin->second), length, comp);
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+stable_multiway_merge_sentinels(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , parallel_tag tag = parallel_tag(0))
+{
+ return stable_multiway_merge_sentinels(seqs_begin, seqs_end, target, length, comp,
+ exact_tag(tag.get_num_threads()));
+}
+
+// public interface
+template<
+ typename RandomAccessIteratorPairIterator
+ , typename RandomAccessIteratorOut
+ , typename _DifferenceTp
+ , typename Comparator>
+RandomAccessIteratorOut
+stable_multiway_merge_sentinels(RandomAccessIteratorPairIterator seqs_begin
+ , RandomAccessIteratorPairIterator seqs_end
+ , RandomAccessIteratorOut target
+ , _DifferenceTp length, Comparator comp
+ , default_parallel_tag tag)
+{
+ return stable_multiway_merge_sentinels(seqs_begin, seqs_end, target, length, comp,
+ exact_tag(tag.get_num_threads()));
+}
+
+}; // namespace __gnu_parallel
+
+#endif /* _GLIBCXX_PARALLEL_MULTIWAY_MERGE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/multiway_mergesort.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/multiway_mergesort.h
new file mode 100644
index 0000000..11dd885
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/multiway_mergesort.h
@@ -0,0 +1,475 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/multiway_mergesort.h
+ * @brief Parallel multiway merge sort.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_MULTIWAY_MERGESORT_H
+#define _GLIBCXX_PARALLEL_MULTIWAY_MERGESORT_H 1
+
+#include <vector>
+
+#include <parallel/basic_iterator.h>
+#include <bits/stl_algo.h>
+#include <parallel/parallel.h>
+#include <parallel/multiway_merge.h>
+
+namespace __gnu_parallel
+{
+
+/** @brief Subsequence description. */
+template<typename _DifferenceTp>
+ struct Piece
+ {
+ typedef _DifferenceTp difference_type;
+
+ /** @brief Begin of subsequence. */
+ difference_type begin;
+
+ /** @brief End of subsequence. */
+ difference_type end;
+ };
+
+/** @brief Data accessed by all threads.
+ *
+ * PMWMS = parallel multiway mergesort */
+template<typename RandomAccessIterator>
+ struct PMWMSSortingData
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ /** @brief Number of threads involved. */
+ thread_index_t num_threads;
+
+ /** @brief Input begin. */
+ RandomAccessIterator source;
+
+ /** @brief Start indices, per thread. */
+ difference_type* starts;
+
+ /** @brief Storage in which to sort. */
+ value_type** temporary;
+
+ /** @brief Samples. */
+ value_type* samples;
+
+ /** @brief Offsets to add to the found positions. */
+ difference_type* offsets;
+
+ /** @brief Pieces of data to merge @c [thread][sequence] */
+ std::vector<Piece<difference_type> >* pieces;
+};
+
+/**
+ * @brief Select samples from a sequence.
+ * @param sd Pointer to algorithm data. Result will be placed in
+ * @c sd->samples.
+ * @param num_samples Number of samples to select.
+ */
+template<typename RandomAccessIterator, typename _DifferenceTp>
+ void
+ determine_samples(PMWMSSortingData<RandomAccessIterator>* sd,
+ _DifferenceTp num_samples)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef _DifferenceTp difference_type;
+
+ thread_index_t iam = omp_get_thread_num();
+
+ difference_type* es = new difference_type[num_samples + 2];
+
+ equally_split(sd->starts[iam + 1] - sd->starts[iam],
+ num_samples + 1, es);
+
+ for (difference_type i = 0; i < num_samples; ++i)
+ ::new(&(sd->samples[iam * num_samples + i]))
+ value_type(sd->source[sd->starts[iam] + es[i + 1]]);
+
+ delete[] es;
+ }
+
+/** @brief Split consistently. */
+template<bool exact, typename RandomAccessIterator,
+ typename Comparator, typename SortingPlacesIterator>
+ struct split_consistently
+ {
+ };
+
+/** @brief Split by exact splitting. */
+template<typename RandomAccessIterator, typename Comparator,
+ typename SortingPlacesIterator>
+ struct split_consistently
+ <true, RandomAccessIterator, Comparator, SortingPlacesIterator>
+ {
+ void operator()(
+ const thread_index_t iam,
+ PMWMSSortingData<RandomAccessIterator>* sd,
+ Comparator& comp,
+ const typename
+ std::iterator_traits<RandomAccessIterator>::difference_type
+ num_samples)
+ const
+ {
+# pragma omp barrier
+
+ std::vector<std::pair<SortingPlacesIterator, SortingPlacesIterator> >
+ seqs(sd->num_threads);
+ for (thread_index_t s = 0; s < sd->num_threads; s++)
+ seqs[s] = std::make_pair(sd->temporary[s],
+ sd->temporary[s]
+ + (sd->starts[s + 1] - sd->starts[s]));
+
+ std::vector<SortingPlacesIterator> offsets(sd->num_threads);
+
+ // if not last thread
+ if (iam < sd->num_threads - 1)
+ multiseq_partition(seqs.begin(), seqs.end(),
+ sd->starts[iam + 1], offsets.begin(), comp);
+
+ for (int seq = 0; seq < sd->num_threads; seq++)
+ {
+ // for each sequence
+ if (iam < (sd->num_threads - 1))
+ sd->pieces[iam][seq].end = offsets[seq] - seqs[seq].first;
+ else
+ // very end of this sequence
+ sd->pieces[iam][seq].end =
+ sd->starts[seq + 1] - sd->starts[seq];
+ }
+
+# pragma omp barrier
+
+ for (thread_index_t seq = 0; seq < sd->num_threads; seq++)
+ {
+ // For each sequence.
+ if (iam > 0)
+ sd->pieces[iam][seq].begin = sd->pieces[iam - 1][seq].end;
+ else
+ // Absolute beginning.
+ sd->pieces[iam][seq].begin = 0;
+ }
+ }
+ };
+
+/** @brief Split by sampling. */
+template<typename RandomAccessIterator, typename Comparator,
+ typename SortingPlacesIterator>
+ struct split_consistently<false, RandomAccessIterator, Comparator,
+ SortingPlacesIterator>
+ {
+ void operator()(
+ const thread_index_t iam,
+ PMWMSSortingData<RandomAccessIterator>* sd,
+ Comparator& comp,
+ const typename
+ std::iterator_traits<RandomAccessIterator>::difference_type
+ num_samples)
+ const
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ determine_samples(sd, num_samples);
+
+# pragma omp barrier
+
+# pragma omp single
+ __gnu_sequential::sort(sd->samples,
+ sd->samples + (num_samples * sd->num_threads),
+ comp);
+
+# pragma omp barrier
+
+ for (thread_index_t s = 0; s < sd->num_threads; ++s)
+ {
+ // For each sequence.
+ if (num_samples * iam > 0)
+ sd->pieces[iam][s].begin =
+ std::lower_bound(sd->temporary[s],
+ sd->temporary[s]
+ + (sd->starts[s + 1] - sd->starts[s]),
+ sd->samples[num_samples * iam],
+ comp)
+ - sd->temporary[s];
+ else
+ // Absolute beginning.
+ sd->pieces[iam][s].begin = 0;
+
+ if ((num_samples * (iam + 1)) < (num_samples * sd->num_threads))
+ sd->pieces[iam][s].end =
+ std::lower_bound(sd->temporary[s],
+ sd->temporary[s]
+ + (sd->starts[s + 1] - sd->starts[s]),
+ sd->samples[num_samples * (iam + 1)],
+ comp)
+ - sd->temporary[s];
+ else
+ // Absolute end.
+ sd->pieces[iam][s].end = sd->starts[s + 1] - sd->starts[s];
+ }
+ }
+ };
+
+template<bool stable, typename RandomAccessIterator, typename Comparator>
+ struct possibly_stable_sort
+ {
+ };
+
+template<typename RandomAccessIterator, typename Comparator>
+ struct possibly_stable_sort<true, RandomAccessIterator, Comparator>
+ {
+ void operator()(const RandomAccessIterator& begin,
+ const RandomAccessIterator& end, Comparator& comp) const
+ {
+ __gnu_sequential::stable_sort(begin, end, comp);
+ }
+ };
+
+template<typename RandomAccessIterator, typename Comparator>
+ struct possibly_stable_sort<false, RandomAccessIterator, Comparator>
+ {
+ void operator()(const RandomAccessIterator begin,
+ const RandomAccessIterator end, Comparator& comp) const
+ {
+ __gnu_sequential::sort(begin, end, comp);
+ }
+ };
+
+template<bool stable, typename SeqRandomAccessIterator,
+ typename RandomAccessIterator, typename Comparator,
+ typename DiffType>
+ struct possibly_stable_multiway_merge
+ {
+ };
+
+template<typename SeqRandomAccessIterator, typename RandomAccessIterator,
+ typename Comparator, typename DiffType>
+ struct possibly_stable_multiway_merge
+ <true, SeqRandomAccessIterator, RandomAccessIterator, Comparator,
+ DiffType>
+ {
+ void operator()(const SeqRandomAccessIterator& seqs_begin,
+ const SeqRandomAccessIterator& seqs_end,
+ const RandomAccessIterator& target,
+ Comparator& comp,
+ DiffType length_am) const
+ {
+ stable_multiway_merge(seqs_begin, seqs_end, target, length_am, comp,
+ sequential_tag());
+ }
+ };
+
+template<typename SeqRandomAccessIterator, typename RandomAccessIterator,
+ typename Comparator, typename DiffType>
+ struct possibly_stable_multiway_merge
+ <false, SeqRandomAccessIterator, RandomAccessIterator, Comparator,
+ DiffType>
+ {
+ void operator()(const SeqRandomAccessIterator& seqs_begin,
+ const SeqRandomAccessIterator& seqs_end,
+ const RandomAccessIterator& target,
+ Comparator& comp,
+ DiffType length_am) const
+ {
+ multiway_merge(seqs_begin, seqs_end, target, length_am, comp,
+ sequential_tag());
+ }
+ };
+
+/** @brief PMWMS code executed by each thread.
+ * @param sd Pointer to algorithm data.
+ * @param comp Comparator.
+ */
+template<bool stable, bool exact, typename RandomAccessIterator,
+ typename Comparator>
+ void
+ parallel_sort_mwms_pu(PMWMSSortingData<RandomAccessIterator>* sd,
+ Comparator& comp)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ thread_index_t iam = omp_get_thread_num();
+
+ // Length of this thread's chunk, before merging.
+ difference_type length_local = sd->starts[iam + 1] - sd->starts[iam];
+
+ // Sort in temporary storage, leave space for sentinel.
+
+ typedef value_type* SortingPlacesIterator;
+
+ sd->temporary[iam] =
+ static_cast<value_type*>(
+ ::operator new(sizeof(value_type) * (length_local + 1)));
+
+ // Copy there.
+ std::uninitialized_copy(sd->source + sd->starts[iam],
+ sd->source + sd->starts[iam] + length_local,
+ sd->temporary[iam]);
+
+ possibly_stable_sort<stable, SortingPlacesIterator, Comparator>()
+ (sd->temporary[iam], sd->temporary[iam] + length_local, comp);
+
+ // Invariant: locally sorted subsequence in sd->temporary[iam],
+ // sd->temporary[iam] + length_local.
+
+ // No barrier here: Synchronization is done by the splitting routine.
+
+ difference_type num_samples =
+ _Settings::get().sort_mwms_oversampling * sd->num_threads - 1;
+ split_consistently
+ <exact, RandomAccessIterator, Comparator, SortingPlacesIterator>()
+ (iam, sd, comp, num_samples);
+
+ // Offset from target begin, length after merging.
+ difference_type offset = 0, length_am = 0;
+ for (thread_index_t s = 0; s < sd->num_threads; s++)
+ {
+ length_am += sd->pieces[iam][s].end - sd->pieces[iam][s].begin;
+ offset += sd->pieces[iam][s].begin;
+ }
+
+ typedef std::vector<
+ std::pair<SortingPlacesIterator, SortingPlacesIterator> >
+ seq_vector_type;
+ seq_vector_type seqs(sd->num_threads);
+
+ for (int s = 0; s < sd->num_threads; ++s)
+ {
+ seqs[s] =
+ std::make_pair(sd->temporary[s] + sd->pieces[iam][s].begin,
+ sd->temporary[s] + sd->pieces[iam][s].end);
+ }
+
+ possibly_stable_multiway_merge<
+ stable,
+ typename seq_vector_type::iterator,
+ RandomAccessIterator,
+ Comparator, difference_type>()
+ (seqs.begin(), seqs.end(),
+ sd->source + offset, comp,
+ length_am);
+
+# pragma omp barrier
+
+ ::operator delete(sd->temporary[iam]);
+ }
+
+/** @brief PMWMS main call.
+ * @param begin Begin iterator of sequence.
+ * @param end End iterator of sequence.
+ * @param comp Comparator.
+ * @param n Length of sequence.
+ * @param num_threads Number of threads to use.
+ */
+template<bool stable, bool exact, typename RandomAccessIterator,
+ typename Comparator>
+ void
+ parallel_sort_mwms(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp,
+ thread_index_t num_threads)
+ {
+ _GLIBCXX_CALL(end - begin)
+
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ difference_type n = end - begin;
+
+ if (n <= 1)
+ return;
+
+ // at least one element per thread
+ if (num_threads > n)
+ num_threads = static_cast<thread_index_t>(n);
+
+ // shared variables
+ PMWMSSortingData<RandomAccessIterator> sd;
+ difference_type* starts;
+
+# pragma omp parallel num_threads(num_threads)
+ {
+ num_threads = omp_get_num_threads(); //no more threads than requested
+
+# pragma omp single
+ {
+ sd.num_threads = num_threads;
+ sd.source = begin;
+
+ sd.temporary = new value_type*[num_threads];
+
+ if (!exact)
+ {
+ difference_type size =
+ (_Settings::get().sort_mwms_oversampling * num_threads - 1)
+ * num_threads;
+ sd.samples = static_cast<value_type*>(
+ ::operator new(size * sizeof(value_type)));
+ }
+ else
+ sd.samples = NULL;
+
+ sd.offsets = new difference_type[num_threads - 1];
+ sd.pieces = new std::vector<Piece<difference_type> >[num_threads];
+ for (int s = 0; s < num_threads; ++s)
+ sd.pieces[s].resize(num_threads);
+ starts = sd.starts = new difference_type[num_threads + 1];
+
+ difference_type chunk_length = n / num_threads;
+ difference_type split = n % num_threads;
+ difference_type pos = 0;
+ for (int i = 0; i < num_threads; ++i)
+ {
+ starts[i] = pos;
+ pos += (i < split) ? (chunk_length + 1) : chunk_length;
+ }
+ starts[num_threads] = pos;
+ } //single
+
+ // Now sort in parallel.
+ parallel_sort_mwms_pu<stable, exact>(&sd, comp);
+ } //parallel
+
+ delete[] starts;
+ delete[] sd.temporary;
+
+ if (!exact)
+ ::operator delete(sd.samples);
+
+ delete[] sd.offsets;
+ delete[] sd.pieces;
+ }
+} //namespace __gnu_parallel
+
+#endif /* _GLIBCXX_PARALLEL_MULTIWAY_MERGESORT_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/numeric b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/numeric
new file mode 100644
index 0000000..33b1411
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/numeric
@@ -0,0 +1,500 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/**
+ * @file parallel/numeric
+*
+ * @brief Parallel STL function calls corresponding to stl_numeric.h.
+ * The functions defined here mainly do case switches and
+ * call the actual parallelized versions in other files.
+ * Inlining policy: Functions that basically only contain one function call,
+ * are declared inline.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler and Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_NUMERIC_H
+#define _GLIBCXX_PARALLEL_NUMERIC_H 1
+
+#include <numeric>
+#include <functional>
+#include <parallel/numericfwd.h>
+#include <parallel/iterator.h>
+#include <parallel/for_each.h>
+#include <parallel/for_each_selectors.h>
+#include <parallel/partial_sum.h>
+
+namespace std
+{
+namespace __parallel
+{
+ // Sequential fallback.
+ template<typename InputIterator, typename T>
+ inline T
+ accumulate(InputIterator begin, InputIterator end, T init,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::accumulate(begin, end, init); }
+
+ template<typename InputIterator, typename T, typename BinaryOperation>
+ inline T
+ accumulate(InputIterator begin, InputIterator end, T init,
+ BinaryOperation binary_op, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::accumulate(begin, end, init, binary_op); }
+
+ // Sequential fallback for input iterator case.
+ template<typename InputIterator, typename T, typename IteratorTag>
+ inline T
+ accumulate_switch(InputIterator begin, InputIterator end,
+ T init, IteratorTag)
+ { return accumulate(begin, end, init, __gnu_parallel::sequential_tag()); }
+
+ template<typename InputIterator, typename T, typename BinaryOperation,
+ typename IteratorTag>
+ inline T
+ accumulate_switch(InputIterator begin, InputIterator end, T init,
+ BinaryOperation binary_op, IteratorTag)
+ { return accumulate(begin, end, init, binary_op,
+ __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators.
+ template<typename _RandomAccessIterator, typename T,
+ typename BinaryOperation>
+ T
+ accumulate_switch(_RandomAccessIterator begin, _RandomAccessIterator end,
+ T init, BinaryOperation binary_op,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_unbalanced)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().accumulate_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ T res = init;
+ __gnu_parallel::accumulate_selector<_RandomAccessIterator>
+ my_selector;
+ __gnu_parallel::
+ for_each_template_random_access_ed(begin, end,
+ __gnu_parallel::nothing(),
+ my_selector,
+ __gnu_parallel::
+ accumulate_binop_reduct
+ <BinaryOperation>(binary_op),
+ res, res, -1);
+ return res;
+ }
+ else
+ return accumulate(begin, end, init, binary_op,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface.
+ template<typename InputIterator, typename T>
+ inline T
+ accumulate(InputIterator begin, InputIterator end, T init,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef std::iterator_traits<InputIterator> iterator_traits;
+ typedef typename iterator_traits::value_type value_type;
+ typedef typename iterator_traits::iterator_category iterator_category;
+
+ return accumulate_switch(begin, end, init,
+ __gnu_parallel::plus<T, value_type>(),
+ iterator_category(), parallelism_tag);
+ }
+
+ template<typename InputIterator, typename T>
+ inline T
+ accumulate(InputIterator begin, InputIterator end, T init)
+ {
+ typedef std::iterator_traits<InputIterator> iterator_traits;
+ typedef typename iterator_traits::value_type value_type;
+ typedef typename iterator_traits::iterator_category iterator_category;
+
+ return accumulate_switch(begin, end, init,
+ __gnu_parallel::plus<T, value_type>(),
+ iterator_category());
+ }
+
+ template<typename InputIterator, typename T, typename BinaryOperation>
+ inline T
+ accumulate(InputIterator begin, InputIterator end, T init,
+ BinaryOperation binary_op,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef iterator_traits<InputIterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ return accumulate_switch(begin, end, init, binary_op,
+ iterator_category(), parallelism_tag);
+ }
+
+ template<typename InputIterator, typename T, typename BinaryOperation>
+ inline T
+ accumulate(InputIterator begin, InputIterator end, T init,
+ BinaryOperation binary_op)
+ {
+ typedef iterator_traits<InputIterator> iterator_traits;
+ typedef typename iterator_traits::iterator_category iterator_category;
+ return accumulate_switch(begin, end, init, binary_op,
+ iterator_category());
+ }
+
+
+ // Sequential fallback.
+ template<typename InputIterator1, typename InputIterator2, typename T>
+ inline T
+ inner_product(InputIterator1 first1, InputIterator1 last1,
+ InputIterator2 first2, T init,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::inner_product(first1, last1, first2, init); }
+
+ template<typename InputIterator1, typename InputIterator2, typename T,
+ typename BinaryFunction1, typename BinaryFunction2>
+ inline T
+ inner_product(InputIterator1 first1, InputIterator1 last1,
+ InputIterator2 first2, T init, BinaryFunction1 binary_op1,
+ BinaryFunction2 binary_op2, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::inner_product(first1, last1, first2, init,
+ binary_op1, binary_op2); }
+
+ // Parallel algorithm for random access iterators.
+ template<typename RandomAccessIterator1, typename RandomAccessIterator2,
+ typename T, typename BinaryFunction1, typename BinaryFunction2>
+ T
+ inner_product_switch(RandomAccessIterator1 first1,
+ RandomAccessIterator1 last1,
+ RandomAccessIterator2 first2, T init,
+ BinaryFunction1 binary_op1,
+ BinaryFunction2 binary_op2,
+ random_access_iterator_tag,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_unbalanced)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION((last1 - first1)
+ >= __gnu_parallel::_Settings::get().
+ accumulate_minimal_n
+ && __gnu_parallel::
+ is_parallel(parallelism_tag)))
+ {
+ T res = init;
+ __gnu_parallel::
+ inner_product_selector<RandomAccessIterator1,
+ RandomAccessIterator2, T> my_selector(first1, first2);
+ __gnu_parallel::
+ for_each_template_random_access_ed(first1, last1, binary_op2,
+ my_selector, binary_op1,
+ res, res, -1);
+ return res;
+ }
+ else
+ return inner_product(first1, last1, first2, init,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // No parallelism for input iterators.
+ template<typename InputIterator1, typename InputIterator2, typename T,
+ typename BinaryFunction1, typename BinaryFunction2,
+ typename IteratorTag1, typename IteratorTag2>
+ inline T
+ inner_product_switch(InputIterator1 first1, InputIterator1 last1,
+ InputIterator2 first2, T init,
+ BinaryFunction1 binary_op1,
+ BinaryFunction2 binary_op2,
+ IteratorTag1, IteratorTag2)
+ { return inner_product(first1, last1, first2, init,
+ binary_op1, binary_op2,
+ __gnu_parallel::sequential_tag()); }
+
+ template<typename InputIterator1, typename InputIterator2, typename T,
+ typename BinaryFunction1, typename BinaryFunction2>
+ inline T
+ inner_product(InputIterator1 first1, InputIterator1 last1,
+ InputIterator2 first2, T init, BinaryFunction1 binary_op1,
+ BinaryFunction2 binary_op2,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef iterator_traits<InputIterator1> traits1_type;
+ typedef typename traits1_type::iterator_category iterator1_category;
+
+ typedef iterator_traits<InputIterator2> traits2_type;
+ typedef typename traits2_type::iterator_category iterator2_category;
+
+ return inner_product_switch(first1, last1, first2, init, binary_op1,
+ binary_op2, iterator1_category(),
+ iterator2_category(), parallelism_tag);
+ }
+
+ template<typename InputIterator1, typename InputIterator2, typename T,
+ typename BinaryFunction1, typename BinaryFunction2>
+ inline T
+ inner_product(InputIterator1 first1, InputIterator1 last1,
+ InputIterator2 first2, T init, BinaryFunction1 binary_op1,
+ BinaryFunction2 binary_op2)
+ {
+ typedef iterator_traits<InputIterator1> traits1_type;
+ typedef typename traits1_type::iterator_category iterator1_category;
+
+ typedef iterator_traits<InputIterator2> traits2_type;
+ typedef typename traits2_type::iterator_category iterator2_category;
+
+ return inner_product_switch(first1, last1, first2, init, binary_op1,
+ binary_op2, iterator1_category(),
+ iterator2_category());
+ }
+
+ template<typename InputIterator1, typename InputIterator2, typename T>
+ inline T
+ inner_product(InputIterator1 first1, InputIterator1 last1,
+ InputIterator2 first2, T init,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef iterator_traits<InputIterator1> traits_type1;
+ typedef typename traits_type1::value_type value_type1;
+ typedef iterator_traits<InputIterator2> traits_type2;
+ typedef typename traits_type2::value_type value_type2;
+
+ typedef typename
+ __gnu_parallel::multiplies<value_type1, value_type2>::result
+ multiplies_result_type;
+ return inner_product(first1, last1, first2, init,
+ __gnu_parallel::plus<T, multiplies_result_type>(),
+ __gnu_parallel::
+ multiplies<value_type1, value_type2>(),
+ parallelism_tag);
+ }
+
+ template<typename InputIterator1, typename InputIterator2, typename T>
+ inline T
+ inner_product(InputIterator1 first1, InputIterator1 last1,
+ InputIterator2 first2, T init)
+ {
+ typedef iterator_traits<InputIterator1> traits_type1;
+ typedef typename traits_type1::value_type value_type1;
+ typedef iterator_traits<InputIterator2> traits_type2;
+ typedef typename traits_type2::value_type value_type2;
+
+ typedef typename
+ __gnu_parallel::multiplies<value_type1, value_type2>::result
+ multiplies_result_type;
+ return inner_product(first1, last1, first2, init,
+ __gnu_parallel::plus<T, multiplies_result_type>(),
+ __gnu_parallel::
+ multiplies<value_type1, value_type2>());
+ }
+
+ // Sequential fallback.
+ template<typename InputIterator, typename OutputIterator>
+ inline OutputIterator
+ partial_sum(InputIterator begin, InputIterator end, OutputIterator result,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::partial_sum(begin, end, result); }
+
+ // Sequential fallback.
+ template<typename InputIterator, typename OutputIterator,
+ typename BinaryOperation>
+ inline OutputIterator
+ partial_sum(InputIterator begin, InputIterator end, OutputIterator result,
+ BinaryOperation bin_op, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::partial_sum(begin, end, result, bin_op); }
+
+ // Sequential fallback for input iterator case.
+ template<typename InputIterator, typename OutputIterator,
+ typename BinaryOperation, typename IteratorTag1,
+ typename IteratorTag2>
+ inline OutputIterator
+ partial_sum_switch(InputIterator begin, InputIterator end,
+ OutputIterator result, BinaryOperation bin_op,
+ IteratorTag1, IteratorTag2)
+ { return _GLIBCXX_STD_P::partial_sum(begin, end, result, bin_op); }
+
+ // Parallel algorithm for random access iterators.
+ template<typename InputIterator, typename OutputIterator,
+ typename BinaryOperation>
+ OutputIterator
+ partial_sum_switch(InputIterator begin, InputIterator end,
+ OutputIterator result, BinaryOperation bin_op,
+ random_access_iterator_tag, random_access_iterator_tag)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().partial_sum_minimal_n))
+ return __gnu_parallel::parallel_partial_sum(begin, end,
+ result, bin_op);
+ else
+ return partial_sum(begin, end, result, bin_op,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface.
+ template<typename InputIterator, typename OutputIterator>
+ inline OutputIterator
+ partial_sum(InputIterator begin, InputIterator end, OutputIterator result)
+ {
+ typedef typename iterator_traits<InputIterator>::value_type value_type;
+ return partial_sum(begin, end, result, std::plus<value_type>());
+ }
+
+ // Public interface
+ template<typename InputIterator, typename OutputIterator,
+ typename BinaryOperation>
+ inline OutputIterator
+ partial_sum(InputIterator begin, InputIterator end, OutputIterator result,
+ BinaryOperation binary_op)
+ {
+ typedef iterator_traits<InputIterator> traitsi_type;
+ typedef typename traitsi_type::iterator_category iteratori_category;
+
+ typedef iterator_traits<OutputIterator> traitso_type;
+ typedef typename traitso_type::iterator_category iteratoro_category;
+
+ return partial_sum_switch(begin, end, result, binary_op,
+ iteratori_category(), iteratoro_category());
+ }
+
+ // Sequential fallback.
+ template<typename InputIterator, typename OutputIterator>
+ inline OutputIterator
+ adjacent_difference(InputIterator begin, InputIterator end,
+ OutputIterator result, __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::adjacent_difference(begin, end, result); }
+
+ // Sequential fallback.
+ template<typename InputIterator, typename OutputIterator,
+ typename BinaryOperation>
+ inline OutputIterator
+ adjacent_difference(InputIterator begin, InputIterator end,
+ OutputIterator result, BinaryOperation bin_op,
+ __gnu_parallel::sequential_tag)
+ { return _GLIBCXX_STD_P::adjacent_difference(begin, end, result, bin_op); }
+
+ // Sequential fallback for input iterator case.
+ template<typename InputIterator, typename OutputIterator,
+ typename BinaryOperation, typename IteratorTag1,
+ typename IteratorTag2>
+ inline OutputIterator
+ adjacent_difference_switch(InputIterator begin, InputIterator end,
+ OutputIterator result, BinaryOperation bin_op,
+ IteratorTag1, IteratorTag2)
+ { return adjacent_difference(begin, end, result, bin_op,
+ __gnu_parallel::sequential_tag()); }
+
+ // Parallel algorithm for random access iterators.
+ template<typename InputIterator, typename OutputIterator,
+ typename BinaryOperation>
+ OutputIterator
+ adjacent_difference_switch(InputIterator begin, InputIterator end,
+ OutputIterator result, BinaryOperation bin_op,
+ random_access_iterator_tag,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism_tag
+ = __gnu_parallel::parallel_balanced)
+ {
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::_Settings::get().adjacent_difference_minimal_n
+ && __gnu_parallel::is_parallel(parallelism_tag)))
+ {
+ bool dummy = true;
+ typedef __gnu_parallel::iterator_pair<InputIterator, OutputIterator,
+ random_access_iterator_tag> ip;
+ *result = *begin;
+ ip begin_pair(begin + 1, result + 1),
+ end_pair(end, result + (end - begin));
+ __gnu_parallel::adjacent_difference_selector<ip> functionality;
+ __gnu_parallel::
+ for_each_template_random_access_ed(begin_pair, end_pair, bin_op,
+ functionality,
+ __gnu_parallel::dummy_reduct(),
+ dummy, dummy, -1);
+ return functionality.finish_iterator;
+ }
+ else
+ return adjacent_difference(begin, end, result, bin_op,
+ __gnu_parallel::sequential_tag());
+ }
+
+ // Public interface.
+ template<typename InputIterator, typename OutputIterator>
+ inline OutputIterator
+ adjacent_difference(InputIterator begin, InputIterator end,
+ OutputIterator result,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ return adjacent_difference(begin, end, result, std::minus<value_type>(),
+ parallelism_tag);
+ }
+
+ template<typename InputIterator, typename OutputIterator>
+ inline OutputIterator
+ adjacent_difference(InputIterator begin, InputIterator end,
+ OutputIterator result)
+ {
+ typedef iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ return adjacent_difference(begin, end, result, std::minus<value_type>());
+ }
+
+ template<typename InputIterator, typename OutputIterator,
+ typename BinaryOperation>
+ inline OutputIterator
+ adjacent_difference(InputIterator begin, InputIterator end,
+ OutputIterator result, BinaryOperation binary_op,
+ __gnu_parallel::_Parallelism parallelism_tag)
+ {
+ typedef iterator_traits<InputIterator> traitsi_type;
+ typedef typename traitsi_type::iterator_category iteratori_category;
+
+ typedef iterator_traits<OutputIterator> traitso_type;
+ typedef typename traitso_type::iterator_category iteratoro_category;
+
+ return adjacent_difference_switch(begin, end, result, binary_op,
+ iteratori_category(),
+ iteratoro_category(), parallelism_tag);
+ }
+
+ template<typename InputIterator, typename OutputIterator,
+ typename BinaryOperation>
+ inline OutputIterator
+ adjacent_difference(InputIterator begin, InputIterator end,
+ OutputIterator result, BinaryOperation binary_op)
+ {
+ typedef iterator_traits<InputIterator> traitsi_type;
+ typedef typename traitsi_type::iterator_category iteratori_category;
+
+ typedef iterator_traits<OutputIterator> traitso_type;
+ typedef typename traitso_type::iterator_category iteratoro_category;
+
+ return adjacent_difference_switch(begin, end, result, binary_op,
+ iteratori_category(),
+ iteratoro_category());
+ }
+} // end namespace
+} // end namespace
+
+#endif /* _GLIBCXX_NUMERIC_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/numericfwd.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/numericfwd.h
new file mode 100644
index 0000000..af2d041
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/numericfwd.h
@@ -0,0 +1,203 @@
+// <numeric> parallel extensions -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/numericfwd.h
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_PARALLEL_NUMERICFWD_H
+#define _GLIBCXX_PARALLEL_NUMERICFWD_H 1
+
+#pragma GCC system_header
+
+#include <parallel/tags.h>
+#include <parallel/settings.h>
+
+namespace std
+{
+namespace __parallel
+{
+ template<typename _IIter, typename _Tp>
+ _Tp
+ accumulate(_IIter, _IIter, _Tp);
+
+ template<typename _IIter, typename _Tp>
+ _Tp
+ accumulate(_IIter, _IIter, _Tp, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _Tp>
+ _Tp
+ accumulate(_IIter, _IIter, _Tp, __gnu_parallel::_Parallelism);
+
+ template<typename _IIter, typename _Tp, typename _Tag>
+ _Tp
+ accumulate_switch(_IIter, _IIter, _Tp, _Tag);
+
+ template<typename _IIter, typename _Tp, typename _BinaryOper>
+ _Tp
+ accumulate(_IIter, _IIter, _Tp, _BinaryOper);
+
+ template<typename _IIter, typename _Tp, typename _BinaryOper>
+ _Tp
+ accumulate(_IIter, _IIter, _Tp, _BinaryOper,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _Tp, typename _BinaryOper>
+ _Tp
+ accumulate(_IIter, _IIter, _Tp, _BinaryOper,
+ __gnu_parallel::_Parallelism);
+
+ template<typename _IIter, typename _Tp, typename _BinaryOper,
+ typename _Tag>
+ _Tp
+ accumulate_switch(_IIter, _IIter, _Tp, _BinaryOper, _Tag);
+
+ template<typename _RAIter, typename _Tp, typename _BinaryOper>
+ _Tp
+ accumulate_switch(_RAIter, _RAIter, _Tp, _BinaryOper,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_unbalanced);
+
+ template<typename _IIter, typename _OIter>
+ _OIter
+ adjacent_difference(_IIter, _IIter, _OIter);
+
+ template<typename _IIter, typename _OIter, typename _BinaryOper>
+ _OIter
+ adjacent_difference(_IIter, _IIter, _OIter, _BinaryOper);
+
+ template<typename _IIter, typename _OIter>
+ _OIter
+ adjacent_difference(_IIter, _IIter, _OIter,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _OIter, typename _BinaryOper>
+ _OIter
+ adjacent_difference(_IIter, _IIter, _OIter, _BinaryOper,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _OIter>
+ _OIter
+ adjacent_difference(_IIter, _IIter, _OIter,
+ __gnu_parallel::_Parallelism);
+
+ template<typename _IIter, typename _OIter, typename _BinaryOper>
+ _OIter
+ adjacent_difference(_IIter, _IIter, _OIter, _BinaryOper,
+ __gnu_parallel::_Parallelism);
+
+ template<typename _IIter, typename _OIter, typename _BinaryOper,
+ typename _Tag1, typename _Tag2>
+ _OIter
+ adjacent_difference_switch(_IIter, _IIter, _OIter, _BinaryOper,
+ _Tag1, _Tag2);
+
+ template<typename _IIter, typename _OIter, typename _BinaryOper>
+ _OIter
+ adjacent_difference_switch(_IIter, _IIter, _OIter, _BinaryOper,
+ random_access_iterator_tag,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism parallelism
+ = __gnu_parallel::parallel_unbalanced);
+
+ template<typename _IIter1, typename _IIter2, typename _Tp>
+ _Tp
+ inner_product(_IIter1, _IIter1, _IIter2, _Tp);
+
+ template<typename _IIter1, typename _IIter2, typename _Tp>
+ _Tp
+ inner_product(_IIter1, _IIter1, _IIter2, _Tp,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _Tp>
+ _Tp
+ inner_product(_IIter1, _IIter1, _IIter2, _Tp,
+ __gnu_parallel::_Parallelism);
+
+ template<typename _IIter1, typename _IIter2, typename _Tp,
+ typename _BinaryFunction1, typename _BinaryFunction2>
+ _Tp
+ inner_product(_IIter1, _IIter1, _IIter2, _Tp,
+ _BinaryFunction1, _BinaryFunction2);
+
+ template<typename _IIter1, typename _IIter2, typename _Tp,
+ typename _BinaryFunction1, typename _BinaryFunction2>
+ _Tp
+ inner_product(_IIter1, _IIter1, _IIter2, _Tp, _BinaryFunction1,
+ _BinaryFunction2, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter1, typename _IIter2, typename _Tp,
+ typename BinaryFunction1, typename BinaryFunction2>
+ _Tp
+ inner_product(_IIter1, _IIter1, _IIter2, _Tp, BinaryFunction1,
+ BinaryFunction2, __gnu_parallel::_Parallelism);
+
+ template<typename _RAIter1, typename _RAIter2, typename _Tp,
+ typename BinaryFunction1, typename BinaryFunction2>
+ _Tp
+ inner_product_switch(_RAIter1, _RAIter1, _RAIter2, _Tp, BinaryFunction1,
+ BinaryFunction2, random_access_iterator_tag,
+ random_access_iterator_tag,
+ __gnu_parallel::_Parallelism
+ = __gnu_parallel::parallel_unbalanced);
+
+ template<typename _IIter1, typename _IIter2, typename _Tp,
+ typename _BinaryFunction1, typename _BinaryFunction2,
+ typename _Tag1, typename _Tag2>
+ _Tp
+ inner_product_switch(_IIter1, _IIter1, _IIter2, _Tp, _BinaryFunction1,
+ _BinaryFunction2, _Tag1, _Tag2);
+
+
+ template<typename _IIter, typename _OIter>
+ _OIter
+ partial_sum(_IIter, _IIter, _OIter, __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _OIter, typename _BinaryOper>
+ _OIter
+ partial_sum(_IIter, _IIter, _OIter, _BinaryOper,
+ __gnu_parallel::sequential_tag);
+
+ template<typename _IIter, typename _OIter>
+ _OIter
+ partial_sum(_IIter, _IIter, _OIter result);
+
+ template<typename _IIter, typename _OIter, typename _BinaryOper>
+ _OIter
+ partial_sum(_IIter, _IIter, _OIter, _BinaryOper);
+
+ template<typename _IIter, typename _OIter, typename _BinaryOper,
+ typename _Tag1, typename _Tag2>
+ _OIter
+ partial_sum_switch(_IIter, _IIter, _OIter, _BinaryOper, _Tag1, _Tag2);
+
+ template<typename _IIter, typename _OIter, typename _BinaryOper>
+ _OIter
+ partial_sum_switch(_IIter, _IIter, _OIter, _BinaryOper,
+ random_access_iterator_tag, random_access_iterator_tag);
+} // end namespace
+} // end namespace
+
+#endif /* _GLIBCXX_PARALLEL_NUMERICFWD_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/omp_loop.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/omp_loop.h
new file mode 100644
index 0000000..66f6d44
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/omp_loop.h
@@ -0,0 +1,118 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/omp_loop.h
+ * @brief Parallelization of embarrassingly parallel execution by
+ * means of an OpenMP for loop.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_OMP_LOOP_H
+#define _GLIBCXX_PARALLEL_OMP_LOOP_H 1
+
+#include <omp.h>
+
+#include <parallel/settings.h>
+#include <parallel/basic_iterator.h>
+#include <parallel/base.h>
+
+namespace __gnu_parallel
+{
+/** @brief Embarrassingly parallel algorithm for random access
+ * iterators, using an OpenMP for loop.
+ *
+ * @param begin Begin iterator of element sequence.
+ * @param end End iterator of element sequence.
+ * @param o User-supplied functor (comparator, predicate, adding
+ * functor, etc.).
+ * @param f Functor to "process" an element with op (depends on
+ * desired functionality, e. g. for std::for_each(), ...).
+ * @param r Functor to "add" a single result to the already
+ * processed elements (depends on functionality).
+ * @param base Base value for reduction.
+ * @param output Pointer to position where final result is written to
+ * @param bound Maximum number of elements processed (e. g. for
+ * std::count_n()).
+ * @return User-supplied functor (that may contain a part of the result).
+ */
+template<typename RandomAccessIterator,
+ typename Op,
+ typename Fu,
+ typename Red,
+ typename Result>
+ Op
+ for_each_template_random_access_omp_loop(RandomAccessIterator begin,
+ RandomAccessIterator end,
+ Op o, Fu& f, Red r, Result base,
+ Result& output,
+ typename std::iterator_traits
+ <RandomAccessIterator>::
+ difference_type bound)
+ {
+ typedef typename
+ std::iterator_traits<RandomAccessIterator>::difference_type
+ difference_type;
+
+ difference_type length = end - begin;
+ thread_index_t num_threads =
+ __gnu_parallel::min<difference_type>(get_max_threads(), length);
+
+ Result *thread_results;
+
+# pragma omp parallel num_threads(num_threads)
+ {
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+ thread_results = new Result[num_threads];
+
+ for (thread_index_t i = 0; i < num_threads; ++i)
+ thread_results[i] = Result();
+ }
+
+ thread_index_t iam = omp_get_thread_num();
+
+# pragma omp for schedule(dynamic, _Settings::get().workstealing_chunk_size)
+ for (difference_type pos = 0; pos < length; ++pos)
+ thread_results[iam] =
+ r(thread_results[iam], f(o, begin+pos));
+ } //parallel
+
+ for (thread_index_t i = 0; i < num_threads; ++i)
+ output = r(output, thread_results[i]);
+
+ delete [] thread_results;
+
+ // Points to last element processed (needed as return value for
+ // some algorithms like transform).
+ f.finish_iterator = begin + length;
+
+ return o;
+ }
+
+} // end namespace
+
+#endif /* _GLIBCXX_PARALLEL_OMP_LOOP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/omp_loop_static.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/omp_loop_static.h
new file mode 100644
index 0000000..5236183
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/omp_loop_static.h
@@ -0,0 +1,117 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/omp_loop_static.h
+ * @brief Parallelization of embarrassingly parallel execution by
+ * means of an OpenMP for loop with static scheduling.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_OMP_LOOP_STATIC_H
+#define _GLIBCXX_PARALLEL_OMP_LOOP_STATIC_H 1
+
+#include <omp.h>
+
+#include <parallel/settings.h>
+#include <parallel/basic_iterator.h>
+
+namespace __gnu_parallel
+{
+
+ /** @brief Embarrassingly parallel algorithm for random access
+ * iterators, using an OpenMP for loop with static scheduling.
+ *
+ * @param begin Begin iterator of element sequence.
+ * @param end End iterator of element sequence.
+ * @param o User-supplied functor (comparator, predicate, adding
+ * functor, ...).
+ * @param f Functor to "process" an element with op (depends on
+ * desired functionality, e. g. for std::for_each(), ...).
+ * @param r Functor to "add" a single result to the already processed
+ * elements (depends on functionality).
+ * @param base Base value for reduction.
+ * @param output Pointer to position where final result is written to
+ * @param bound Maximum number of elements processed (e. g. for
+ * std::count_n()).
+ * @return User-supplied functor (that may contain a part of the result).
+ */
+template<typename RandomAccessIterator,
+ typename Op,
+ typename Fu,
+ typename Red,
+ typename Result>
+ Op
+ for_each_template_random_access_omp_loop_static(RandomAccessIterator begin,
+ RandomAccessIterator end,
+ Op o, Fu& f, Red r,
+ Result base, Result& output,
+ typename std::iterator_traits
+ <RandomAccessIterator>::
+ difference_type bound)
+ {
+ typedef typename
+ std::iterator_traits<RandomAccessIterator>::difference_type
+ difference_type;
+
+ difference_type length = end - begin;
+ thread_index_t num_threads =
+ std::min<difference_type>(get_max_threads(), length);
+
+ Result *thread_results;
+
+# pragma omp parallel num_threads(num_threads)
+ {
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+ thread_results = new Result[num_threads];
+
+ for (thread_index_t i = 0; i < num_threads; ++i)
+ thread_results[i] = Result();
+ }
+
+ thread_index_t iam = omp_get_thread_num();
+
+# pragma omp for schedule(static, _Settings::get().workstealing_chunk_size)
+ for (difference_type pos = 0; pos < length; ++pos)
+ thread_results[iam] = r(thread_results[iam], f(o, begin+pos));
+ } //parallel
+
+ for (thread_index_t i = 0; i < num_threads; ++i)
+ output = r(output, thread_results[i]);
+
+ delete [] thread_results;
+
+ // Points to last element processed (needed as return value for
+ // some algorithms like transform).
+ f.finish_iterator = begin + length;
+
+ return o;
+ }
+
+} // end namespace
+
+#endif /* _GLIBCXX_PARALLEL_OMP_LOOP_STATIC_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/par_loop.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/par_loop.h
new file mode 100644
index 0000000..be61d4c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/par_loop.h
@@ -0,0 +1,135 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/par_loop.h
+ * @brief Parallelization of embarrassingly parallel execution by
+ * means of equal splitting.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_PAR_LOOP_H
+#define _GLIBCXX_PARALLEL_PAR_LOOP_H 1
+
+#include <omp.h>
+#include <parallel/settings.h>
+#include <parallel/base.h>
+#include <parallel/equally_split.h>
+
+namespace __gnu_parallel
+{
+
+/** @brief Embarrassingly parallel algorithm for random access
+ * iterators, using hand-crafted parallelization by equal splitting
+ * the work.
+ *
+ * @param begin Begin iterator of element sequence.
+ * @param end End iterator of element sequence.
+ * @param o User-supplied functor (comparator, predicate, adding
+ * functor, ...)
+ * @param f Functor to "process" an element with op (depends on
+ * desired functionality, e. g. for std::for_each(), ...).
+ * @param r Functor to "add" a single result to the already
+ * processed elements (depends on functionality).
+ * @param base Base value for reduction.
+ * @param output Pointer to position where final result is written to
+ * @param bound Maximum number of elements processed (e. g. for
+ * std::count_n()).
+ * @return User-supplied functor (that may contain a part of the result).
+ */
+template<typename RandomAccessIterator,
+ typename Op,
+ typename Fu,
+ typename Red,
+ typename Result>
+ Op
+ for_each_template_random_access_ed(RandomAccessIterator begin,
+ RandomAccessIterator end,
+ Op o, Fu& f, Red r, Result base,
+ Result& output,
+ typename std::iterator_traits
+ <RandomAccessIterator>::
+ difference_type bound)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+ const difference_type length = end - begin;
+ Result *thread_results;
+ bool* constructed;
+
+ thread_index_t num_threads =
+ __gnu_parallel::min<difference_type>(get_max_threads(), length);
+
+# pragma omp parallel num_threads(num_threads)
+ {
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+ thread_results = static_cast<Result*>(
+ ::operator new(num_threads * sizeof(Result)));
+ constructed = new bool[num_threads];
+ }
+
+ thread_index_t iam = omp_get_thread_num();
+
+ // Neutral element.
+ Result* reduct = static_cast<Result*>(::operator new(sizeof(Result)));
+
+ difference_type
+ start = equally_split_point(length, num_threads, iam),
+ stop = equally_split_point(length, num_threads, iam + 1);
+
+ if (start < stop)
+ {
+ new(reduct) Result(f(o, begin + start));
+ ++start;
+ constructed[iam] = true;
+ }
+ else
+ constructed[iam] = false;
+
+ for (; start < stop; ++start)
+ *reduct = r(*reduct, f(o, begin + start));
+
+ thread_results[iam] = *reduct;
+ } //parallel
+
+ for (thread_index_t i = 0; i < num_threads; ++i)
+ if (constructed[i])
+ output = r(output, thread_results[i]);
+
+ // Points to last element processed (needed as return value for
+ // some algorithms like transform).
+ f.finish_iterator = begin + length;
+
+ delete[] thread_results;
+ delete[] constructed;
+
+ return o;
+ }
+
+} // end namespace
+
+#endif /* _GLIBCXX_PARALLEL_PAR_LOOP_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/parallel.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/parallel.h
new file mode 100644
index 0000000..c4bfc05
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/parallel.h
@@ -0,0 +1,42 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/parallel.h
+ * @brief End-user include file. Provides advanced settings and
+ * tuning options.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze and Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_PARALLEL_H
+#define _GLIBCXX_PARALLEL_PARALLEL_H 1
+
+#include <parallel/features.h>
+#include <parallel/compiletime_settings.h>
+#include <parallel/types.h>
+#include <parallel/tags.h>
+#include <parallel/settings.h>
+
+#endif /* _GLIBCXX_PARALLEL_PARALLEL_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/partial_sum.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/partial_sum.h
new file mode 100644
index 0000000..9263093
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/partial_sum.h
@@ -0,0 +1,220 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/partial_sum.h
+ * @brief Parallel implementation of std::partial_sum(), i. e. prefix
+ * sums.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_PARTIAL_SUM_H
+#define _GLIBCXX_PARALLEL_PARTIAL_SUM_H 1
+
+#include <omp.h>
+#include <new>
+#include <bits/stl_algobase.h>
+#include <parallel/parallel.h>
+#include <parallel/numericfwd.h>
+
+namespace __gnu_parallel
+{
+ // Problem: there is no 0-element given.
+
+/** @brief Base case prefix sum routine.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param result Begin iterator of output sequence.
+ * @param bin_op Associative binary function.
+ * @param value Start value. Must be passed since the neutral
+ * element is unknown in general.
+ * @return End iterator of output sequence. */
+template<typename InputIterator,
+ typename OutputIterator,
+ typename BinaryOperation>
+ OutputIterator
+ parallel_partial_sum_basecase(InputIterator begin, InputIterator end,
+ OutputIterator result, BinaryOperation bin_op,
+ typename std::iterator_traits
+ <InputIterator>::value_type value)
+ {
+ if (begin == end)
+ return result;
+
+ while (begin != end)
+ {
+ value = bin_op(value, *begin);
+ *result = value;
+ ++result;
+ ++begin;
+ }
+ return result;
+ }
+
+/** @brief Parallel partial sum implementation, two-phase approach,
+ no recursion.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param result Begin iterator of output sequence.
+ * @param bin_op Associative binary function.
+ * @param n Length of sequence.
+ * @param num_threads Number of threads to use.
+ * @return End iterator of output sequence.
+ */
+template<typename InputIterator,
+ typename OutputIterator,
+ typename BinaryOperation>
+ OutputIterator
+ parallel_partial_sum_linear(InputIterator begin, InputIterator end,
+ OutputIterator result, BinaryOperation bin_op,
+ typename std::iterator_traits
+ <InputIterator>::difference_type n)
+ {
+ typedef std::iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ if (begin == end)
+ return result;
+
+ thread_index_t num_threads =
+ std::min<difference_type>(get_max_threads(), n - 1);
+
+ if (num_threads < 2)
+ {
+ *result = *begin;
+ return parallel_partial_sum_basecase(
+ begin + 1, end, result + 1, bin_op, *begin);
+ }
+
+ difference_type* borders;
+ value_type* sums;
+
+ const _Settings& __s = _Settings::get();
+
+# pragma omp parallel num_threads(num_threads)
+ {
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+
+ borders = new difference_type[num_threads + 2];
+
+ if (__s.partial_sum_dilation == 1.0f)
+ equally_split(n, num_threads + 1, borders);
+ else
+ {
+ difference_type chunk_length =
+ ((double)n
+ / ((double)num_threads + __s.partial_sum_dilation)),
+ borderstart = n - num_threads * chunk_length;
+ borders[0] = 0;
+ for (int i = 1; i < (num_threads + 1); ++i)
+ {
+ borders[i] = borderstart;
+ borderstart += chunk_length;
+ }
+ borders[num_threads + 1] = n;
+ }
+
+ sums = static_cast<value_type*>(::operator new(sizeof(value_type)
+ * num_threads));
+ OutputIterator target_end;
+ } //single
+
+ thread_index_t iam = omp_get_thread_num();
+ if (iam == 0)
+ {
+ *result = *begin;
+ parallel_partial_sum_basecase(begin + 1, begin + borders[1],
+ result + 1, bin_op, *begin);
+ ::new(&(sums[iam])) value_type(*(result + borders[1] - 1));
+ }
+ else
+ {
+ ::new(&(sums[iam]))
+ value_type(std::accumulate(begin + borders[iam] + 1,
+ begin + borders[iam + 1],
+ *(begin + borders[iam]),
+ bin_op,
+ __gnu_parallel::sequential_tag()));
+ }
+
+# pragma omp barrier
+
+# pragma omp single
+ parallel_partial_sum_basecase(
+ sums + 1, sums + num_threads, sums + 1, bin_op, sums[0]);
+
+# pragma omp barrier
+
+ // Still same team.
+ parallel_partial_sum_basecase(begin + borders[iam + 1],
+ begin + borders[iam + 2],
+ result + borders[iam + 1], bin_op,
+ sums[iam]);
+ } //parallel
+
+ ::operator delete(sums);
+ delete[] borders;
+
+ return result + n;
+ }
+
+/** @brief Parallel partial sum front-end.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param result Begin iterator of output sequence.
+ * @param bin_op Associative binary function.
+ * @return End iterator of output sequence. */
+template<typename InputIterator,
+ typename OutputIterator,
+ typename BinaryOperation>
+ OutputIterator
+ parallel_partial_sum(InputIterator begin, InputIterator end,
+ OutputIterator result, BinaryOperation bin_op)
+ {
+ _GLIBCXX_CALL(begin - end)
+
+ typedef std::iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ difference_type n = end - begin;
+
+ switch (_Settings::get().partial_sum_algorithm)
+ {
+ case LINEAR:
+ // Need an initial offset.
+ return parallel_partial_sum_linear(begin, end, result, bin_op, n);
+ default:
+ // Partial_sum algorithm not implemented.
+ _GLIBCXX_PARALLEL_ASSERT(0);
+ return result + n;
+ }
+ }
+}
+
+#endif /* _GLIBCXX_PARALLEL_PARTIAL_SUM_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/partition.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/partition.h
new file mode 100644
index 0000000..b88133c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/partition.h
@@ -0,0 +1,429 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/partition.h
+ * @brief Parallel implementation of std::partition(),
+ * std::nth_element(), and std::partial_sort().
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler and Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_PARTITION_H
+#define _GLIBCXX_PARALLEL_PARTITION_H 1
+
+#include <parallel/basic_iterator.h>
+#include <parallel/sort.h>
+#include <parallel/random_number.h>
+#include <bits/stl_algo.h>
+#include <parallel/parallel.h>
+
+/** @brief Decide whether to declare certain variables volatile. */
+#define _GLIBCXX_VOLATILE volatile
+
+namespace __gnu_parallel
+{
+/** @brief Parallel implementation of std::partition.
+ * @param begin Begin iterator of input sequence to split.
+ * @param end End iterator of input sequence to split.
+ * @param pred Partition predicate, possibly including some kind of pivot.
+ * @param num_threads Maximum number of threads to use for this task.
+ * @return Number of elements not fulfilling the predicate. */
+template<typename RandomAccessIterator, typename Predicate>
+ typename std::iterator_traits<RandomAccessIterator>::difference_type
+ parallel_partition(RandomAccessIterator begin, RandomAccessIterator end,
+ Predicate pred, thread_index_t num_threads)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ difference_type n = end - begin;
+
+ _GLIBCXX_CALL(n)
+
+ const _Settings& __s = _Settings::get();
+
+ // Shared.
+ _GLIBCXX_VOLATILE difference_type left = 0, right = n - 1;
+ _GLIBCXX_VOLATILE difference_type leftover_left, leftover_right;
+ _GLIBCXX_VOLATILE difference_type leftnew, rightnew;
+
+ bool* reserved_left = NULL, * reserved_right = NULL;
+
+ difference_type chunk_size;
+
+ omp_lock_t result_lock;
+ omp_init_lock(&result_lock);
+
+ //at least two chunks per thread
+ if(right - left + 1 >= 2 * num_threads * chunk_size)
+# pragma omp parallel num_threads(num_threads)
+ {
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+ reserved_left = new bool[num_threads];
+ reserved_right = new bool[num_threads];
+
+ if (__s.partition_chunk_share > 0.0)
+ chunk_size = std::max<difference_type>(__s.partition_chunk_size,
+ (double)n * __s.partition_chunk_share
+ / (double)num_threads);
+ else
+ chunk_size = __s.partition_chunk_size;
+ }
+
+ while (right - left + 1 >= 2 * num_threads * chunk_size)
+ {
+# pragma omp single
+ {
+ difference_type num_chunks = (right - left + 1) / chunk_size;
+
+ for (int r = 0; r < num_threads; ++r)
+ {
+ reserved_left[r] = false;
+ reserved_right[r] = false;
+ }
+ leftover_left = 0;
+ leftover_right = 0;
+ } //implicit barrier
+
+ // Private.
+ difference_type thread_left, thread_left_border,
+ thread_right, thread_right_border;
+ thread_left = left + 1;
+
+ // Just to satisfy the condition below.
+ thread_left_border = thread_left - 1;
+ thread_right = n - 1;
+ thread_right_border = thread_right + 1;
+
+ bool iam_finished = false;
+ while (!iam_finished)
+ {
+ if (thread_left > thread_left_border)
+ {
+ omp_set_lock(&result_lock);
+ if (left + (chunk_size - 1) > right)
+ iam_finished = true;
+ else
+ {
+ thread_left = left;
+ thread_left_border = left + (chunk_size - 1);
+ left += chunk_size;
+ }
+ omp_unset_lock(&result_lock);
+ }
+
+ if (thread_right < thread_right_border)
+ {
+ omp_set_lock(&result_lock);
+ if (left > right - (chunk_size - 1))
+ iam_finished = true;
+ else
+ {
+ thread_right = right;
+ thread_right_border = right - (chunk_size - 1);
+ right -= chunk_size;
+ }
+ omp_unset_lock(&result_lock);
+ }
+
+ if (iam_finished)
+ break;
+
+ // Swap as usual.
+ while (thread_left < thread_right)
+ {
+ while (pred(begin[thread_left])
+ && thread_left <= thread_left_border)
+ ++thread_left;
+ while (!pred(begin[thread_right])
+ && thread_right >= thread_right_border)
+ --thread_right;
+
+ if (thread_left > thread_left_border
+ || thread_right < thread_right_border)
+ // Fetch new chunk(s).
+ break;
+
+ std::swap(begin[thread_left], begin[thread_right]);
+ ++thread_left;
+ --thread_right;
+ }
+ }
+
+ // Now swap the leftover chunks to the right places.
+ if (thread_left <= thread_left_border)
+# pragma omp atomic
+ ++leftover_left;
+ if (thread_right >= thread_right_border)
+# pragma omp atomic
+ ++leftover_right;
+
+# pragma omp barrier
+
+# pragma omp single
+ {
+ leftnew = left - leftover_left * chunk_size;
+ rightnew = right + leftover_right * chunk_size;
+ }
+
+# pragma omp barrier
+
+ // <=> thread_left_border + (chunk_size - 1) >= leftnew
+ if (thread_left <= thread_left_border
+ && thread_left_border >= leftnew)
+ {
+ // Chunk already in place, reserve spot.
+ reserved_left[(left - (thread_left_border + 1)) / chunk_size]
+ = true;
+ }
+
+ // <=> thread_right_border - (chunk_size - 1) <= rightnew
+ if (thread_right >= thread_right_border
+ && thread_right_border <= rightnew)
+ {
+ // Chunk already in place, reserve spot.
+ reserved_right[((thread_right_border - 1) - right)
+ / chunk_size] = true;
+ }
+
+# pragma omp barrier
+
+ if (thread_left <= thread_left_border
+ && thread_left_border < leftnew)
+ {
+ // Find spot and swap.
+ difference_type swapstart = -1;
+ omp_set_lock(&result_lock);
+ for (int r = 0; r < leftover_left; ++r)
+ if (!reserved_left[r])
+ {
+ reserved_left[r] = true;
+ swapstart = left - (r + 1) * chunk_size;
+ break;
+ }
+ omp_unset_lock(&result_lock);
+
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(swapstart != -1);
+#endif
+
+ std::swap_ranges(begin + thread_left_border
+ - (chunk_size - 1),
+ begin + thread_left_border + 1,
+ begin + swapstart);
+ }
+
+ if (thread_right >= thread_right_border
+ && thread_right_border > rightnew)
+ {
+ // Find spot and swap
+ difference_type swapstart = -1;
+ omp_set_lock(&result_lock);
+ for (int r = 0; r < leftover_right; ++r)
+ if (!reserved_right[r])
+ {
+ reserved_right[r] = true;
+ swapstart = right + r * chunk_size + 1;
+ break;
+ }
+ omp_unset_lock(&result_lock);
+
+#if _GLIBCXX_ASSERTIONS
+ _GLIBCXX_PARALLEL_ASSERT(swapstart != -1);
+#endif
+
+ std::swap_ranges(begin + thread_right_border,
+ begin + thread_right_border + chunk_size,
+ begin + swapstart);
+ }
+#if _GLIBCXX_ASSERTIONS
+# pragma omp barrier
+
+# pragma omp single
+ {
+ for (int r = 0; r < leftover_left; ++r)
+ _GLIBCXX_PARALLEL_ASSERT(reserved_left[r]);
+ for (int r = 0; r < leftover_right; ++r)
+ _GLIBCXX_PARALLEL_ASSERT(reserved_right[r]);
+ }
+
+# pragma omp barrier
+#endif
+
+# pragma omp barrier
+
+ left = leftnew;
+ right = rightnew;
+ }
+# pragma omp flush(left, right)
+ } // end "recursion" //parallel
+
+ difference_type final_left = left, final_right = right;
+
+ while (final_left < final_right)
+ {
+ // Go right until key is geq than pivot.
+ while (pred(begin[final_left]) && final_left < final_right)
+ ++final_left;
+
+ // Go left until key is less than pivot.
+ while (!pred(begin[final_right]) && final_left < final_right)
+ --final_right;
+
+ if (final_left == final_right)
+ break;
+ std::swap(begin[final_left], begin[final_right]);
+ ++final_left;
+ --final_right;
+ }
+
+ // All elements on the left side are < piv, all elements on the
+ // right are >= piv
+ delete[] reserved_left;
+ delete[] reserved_right;
+
+ omp_destroy_lock(&result_lock);
+
+ // Element "between" final_left and final_right might not have
+ // been regarded yet
+ if (final_left < n && !pred(begin[final_left]))
+ // Really swapped.
+ return final_left;
+ else
+ return final_left + 1;
+ }
+
+/**
+ * @brief Parallel implementation of std::nth_element().
+ * @param begin Begin iterator of input sequence.
+ * @param nth Iterator of element that must be in position afterwards.
+ * @param end End iterator of input sequence.
+ * @param comp Comparator.
+ */
+template<typename RandomAccessIterator, typename Comparator>
+ void
+ parallel_nth_element(RandomAccessIterator begin, RandomAccessIterator nth,
+ RandomAccessIterator end, Comparator comp)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ _GLIBCXX_CALL(end - begin)
+
+ RandomAccessIterator split;
+ random_number rng;
+
+ difference_type minimum_length =
+ std::max<difference_type>(2, _Settings::get().partition_minimal_n);
+
+ // Break if input range to small.
+ while (static_cast<sequence_index_t>(end - begin) >= minimum_length)
+ {
+ difference_type n = end - begin;
+
+ RandomAccessIterator pivot_pos = begin + rng(n);
+
+ // Swap pivot_pos value to end.
+ if (pivot_pos != (end - 1))
+ std::swap(*pivot_pos, *(end - 1));
+ pivot_pos = end - 1;
+
+ // XXX Comparator must have first_value_type, second_value_type,
+ // result_type
+ // Comparator == __gnu_parallel::lexicographic<S, int,
+ // __gnu_parallel::less<S, S> >
+ // pivot_pos == std::pair<S, int>*
+ // XXX binder2nd only for RandomAccessIterators??
+ __gnu_parallel::binder2nd<Comparator, value_type, value_type, bool>
+ pred(comp, *pivot_pos);
+
+ // Divide, leave pivot unchanged in last place.
+ RandomAccessIterator split_pos1, split_pos2;
+ split_pos1 = begin + parallel_partition(begin, end - 1, pred,
+ get_max_threads());
+
+ // Left side: < pivot_pos; right side: >= pivot_pos
+
+ // Swap pivot back to middle.
+ if (split_pos1 != pivot_pos)
+ std::swap(*split_pos1, *pivot_pos);
+ pivot_pos = split_pos1;
+
+ // In case all elements are equal, split_pos1 == 0
+ if ((split_pos1 + 1 - begin) < (n >> 7)
+ || (end - split_pos1) < (n >> 7))
+ {
+ // Very unequal split, one part smaller than one 128th
+ // elements not strictly larger than the pivot.
+ __gnu_parallel::unary_negate<__gnu_parallel::
+ binder1st<Comparator, value_type, value_type, bool>, value_type>
+ pred(__gnu_parallel::binder1st<Comparator, value_type,
+ value_type, bool>(comp, *pivot_pos));
+
+ // Find other end of pivot-equal range.
+ split_pos2 = __gnu_sequential::partition(split_pos1 + 1,
+ end, pred);
+ }
+ else
+ // Only skip the pivot.
+ split_pos2 = split_pos1 + 1;
+
+ // Compare iterators.
+ if (split_pos2 <= nth)
+ begin = split_pos2;
+ else if (nth < split_pos1)
+ end = split_pos1;
+ else
+ break;
+ }
+
+ // Only at most _Settings::partition_minimal_n elements left.
+ __gnu_sequential::sort(begin, end, comp);
+ }
+
+/** @brief Parallel implementation of std::partial_sort().
+* @param begin Begin iterator of input sequence.
+* @param middle Sort until this position.
+* @param end End iterator of input sequence.
+* @param comp Comparator. */
+template<typename RandomAccessIterator, typename Comparator>
+ void
+ parallel_partial_sort(RandomAccessIterator begin,
+ RandomAccessIterator middle,
+ RandomAccessIterator end, Comparator comp)
+ {
+ parallel_nth_element(begin, middle, end, comp);
+ std::sort(begin, middle, comp);
+ }
+
+} //namespace __gnu_parallel
+
+#undef _GLIBCXX_VOLATILE
+
+#endif /* _GLIBCXX_PARALLEL_PARTITION_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/queue.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/queue.h
new file mode 100644
index 0000000..9686a9a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/queue.h
@@ -0,0 +1,149 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/queue.h
+ * @brief Lock-free double-ended queue.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_QUEUE_H
+#define _GLIBCXX_PARALLEL_QUEUE_H 1
+
+#include <parallel/types.h>
+#include <parallel/base.h>
+#include <parallel/compatibility.h>
+
+/** @brief Decide whether to declare certain variable volatile in this file. */
+#define _GLIBCXX_VOLATILE volatile
+
+namespace __gnu_parallel
+{
+ /**@brief Double-ended queue of bounded size, allowing lock-free
+ * atomic access. push_front() and pop_front() must not be called
+ * concurrently to each other, while pop_back() can be called
+ * concurrently at all times.
+ * @c empty(), @c size(), and @c top() are intentionally not provided.
+ * Calling them would not make sense in a concurrent setting.
+ * @param T Contained element type. */
+ template<typename T>
+ class RestrictedBoundedConcurrentQueue
+ {
+ private:
+ /** @brief Array of elements, seen as cyclic buffer. */
+ T* base;
+
+ /** @brief Maximal number of elements contained at the same time. */
+ sequence_index_t max_size;
+
+ /** @brief Cyclic begin and end pointers contained in one
+ atomically changeable value. */
+ _GLIBCXX_VOLATILE lcas_t borders;
+
+ public:
+ /** @brief Constructor. Not to be called concurrent, of course.
+ * @param max_size Maximal number of elements to be contained. */
+ RestrictedBoundedConcurrentQueue(sequence_index_t max_size)
+ {
+ this->max_size = max_size;
+ base = new T[max_size];
+ borders = encode2(0, 0);
+#pragma omp flush
+ }
+
+ /** @brief Destructor. Not to be called concurrent, of course. */
+ ~RestrictedBoundedConcurrentQueue()
+ { delete[] base; }
+
+ /** @brief Pushes one element into the queue at the front end.
+ * Must not be called concurrently with pop_front(). */
+ void
+ push_front(const T& t)
+ {
+ lcas_t former_borders = borders;
+ int former_front, former_back;
+ decode2(former_borders, former_front, former_back);
+ *(base + former_front % max_size) = t;
+#if _GLIBCXX_ASSERTIONS
+ // Otherwise: front - back > max_size eventually.
+ _GLIBCXX_PARALLEL_ASSERT(((former_front + 1) - former_back)
+ <= max_size);
+#endif
+ fetch_and_add(&borders, encode2(1, 0));
+ }
+
+ /** @brief Pops one element from the queue at the front end.
+ * Must not be called concurrently with pop_front(). */
+ bool
+ pop_front(T& t)
+ {
+ int former_front, former_back;
+#pragma omp flush
+ decode2(borders, former_front, former_back);
+ while (former_front > former_back)
+ {
+ // Chance.
+ lcas_t former_borders = encode2(former_front, former_back);
+ lcas_t new_borders = encode2(former_front - 1, former_back);
+ if (compare_and_swap(&borders, former_borders, new_borders))
+ {
+ t = *(base + (former_front - 1) % max_size);
+ return true;
+ }
+#pragma omp flush
+ decode2(borders, former_front, former_back);
+ }
+ return false;
+ }
+
+ /** @brief Pops one element from the queue at the front end.
+ * Must not be called concurrently with pop_front(). */
+ bool
+ pop_back(T& t) //queue behavior
+ {
+ int former_front, former_back;
+#pragma omp flush
+ decode2(borders, former_front, former_back);
+ while (former_front > former_back)
+ {
+ // Chance.
+ lcas_t former_borders = encode2(former_front, former_back);
+ lcas_t new_borders = encode2(former_front, former_back + 1);
+ if (compare_and_swap(&borders, former_borders, new_borders))
+ {
+ t = *(base + former_back % max_size);
+ return true;
+ }
+#pragma omp flush
+ decode2(borders, former_front, former_back);
+ }
+ return false;
+ }
+ };
+} //namespace __gnu_parallel
+
+#undef _GLIBCXX_VOLATILE
+
+#endif /* _GLIBCXX_PARALLEL_QUEUE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/quicksort.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/quicksort.h
new file mode 100644
index 0000000..712b479
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/quicksort.h
@@ -0,0 +1,179 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/quicksort.h
+ * @brief Implementation of a unbalanced parallel quicksort (in-place).
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_QUICKSORT_H
+#define _GLIBCXX_PARALLEL_QUICKSORT_H 1
+
+#include <parallel/parallel.h>
+#include <parallel/partition.h>
+
+namespace __gnu_parallel
+{
+ /** @brief Unbalanced quicksort divide step.
+ * @param begin Begin iterator of subsequence.
+ * @param end End iterator of subsequence.
+ * @param comp Comparator.
+ * @param pivot_rank Desired rank of the pivot.
+ * @param num_samples Choose pivot from that many samples.
+ * @param num_threads Number of threads that are allowed to work on
+ * this part.
+ */
+ template<typename RandomAccessIterator, typename Comparator>
+ typename std::iterator_traits<RandomAccessIterator>::difference_type
+ parallel_sort_qs_divide(RandomAccessIterator begin,
+ RandomAccessIterator end,
+ Comparator comp, typename std::iterator_traits
+ <RandomAccessIterator>::difference_type pivot_rank,
+ typename std::iterator_traits
+ <RandomAccessIterator>::difference_type
+ num_samples, thread_index_t num_threads)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ difference_type n = end - begin;
+ num_samples = std::min(num_samples, n);
+
+ // Allocate uninitialized, to avoid default constructor.
+ value_type* samples =
+ static_cast<value_type*>(::operator new(num_samples
+ * sizeof(value_type)));
+
+ for (difference_type s = 0; s < num_samples; ++s)
+ {
+ const unsigned long long index = static_cast<unsigned long long>(s)
+ * n / num_samples;
+ ::new(&(samples[s])) value_type(begin[index]);
+ }
+
+ __gnu_sequential::sort(samples, samples + num_samples, comp);
+
+ value_type& pivot = samples[pivot_rank * num_samples / n];
+
+ __gnu_parallel::binder2nd<Comparator, value_type, value_type, bool>
+ pred(comp, pivot);
+ difference_type split =
+ parallel_partition(begin, end, pred, num_threads);
+
+ ::operator delete(samples);
+
+ return split;
+ }
+
+ /** @brief Unbalanced quicksort conquer step.
+ * @param begin Begin iterator of subsequence.
+ * @param end End iterator of subsequence.
+ * @param comp Comparator.
+ * @param num_threads Number of threads that are allowed to work on
+ * this part.
+ */
+ template<typename RandomAccessIterator, typename Comparator>
+ void
+ parallel_sort_qs_conquer(RandomAccessIterator begin,
+ RandomAccessIterator end,
+ Comparator comp,
+ thread_index_t num_threads)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ if (num_threads <= 1)
+ {
+ __gnu_sequential::sort(begin, end, comp);
+ return;
+ }
+
+ difference_type n = end - begin, pivot_rank;
+
+ if (n <= 1)
+ return;
+
+ thread_index_t num_threads_left;
+
+ if ((num_threads % 2) == 1)
+ num_threads_left = num_threads / 2 + 1;
+ else
+ num_threads_left = num_threads / 2;
+
+ pivot_rank = n * num_threads_left / num_threads;
+
+ difference_type split =
+ parallel_sort_qs_divide(begin, end, comp, pivot_rank,
+ _Settings::get().sort_qs_num_samples_preset,
+ num_threads);
+
+#pragma omp parallel sections num_threads(2)
+ {
+#pragma omp section
+ parallel_sort_qs_conquer(begin, begin + split,
+ comp, num_threads_left);
+#pragma omp section
+ parallel_sort_qs_conquer(begin + split, end,
+ comp, num_threads - num_threads_left);
+ }
+ }
+
+
+
+ /** @brief Unbalanced quicksort main call.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator input sequence, ignored.
+ * @param comp Comparator.
+ * @param num_threads Number of threads that are allowed to work on
+ * this part.
+ */
+ template<typename RandomAccessIterator, typename Comparator>
+ void
+ parallel_sort_qs(RandomAccessIterator begin,
+ RandomAccessIterator end,
+ Comparator comp,
+ thread_index_t num_threads)
+ {
+ _GLIBCXX_CALL(n)
+
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ difference_type n = end - begin;
+
+ // At least one element per processor.
+ if (num_threads > n)
+ num_threads = static_cast<thread_index_t>(n);
+
+ parallel_sort_qs_conquer(begin, begin + n, comp, num_threads);
+ }
+
+} //namespace __gnu_parallel
+
+#endif /* _GLIBCXX_PARALLEL_QUICKSORT_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/random_number.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/random_number.h
new file mode 100644
index 0000000..7e821a4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/random_number.h
@@ -0,0 +1,124 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/random_number.h
+ * @brief Random number generator based on the Mersenne twister.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_RANDOM_NUMBER_H
+#define _GLIBCXX_PARALLEL_RANDOM_NUMBER_H 1
+
+#include <parallel/types.h>
+#include <tr1/random>
+
+namespace __gnu_parallel
+{
+ /** @brief Random number generator, based on the Mersenne twister. */
+ class random_number
+ {
+ private:
+ std::tr1::mt19937 mt;
+ uint64 supremum;
+ uint64 RAND_SUP;
+ double supremum_reciprocal;
+ double RAND_SUP_REC;
+
+ // Assumed to be twice as long as the usual random number.
+ uint64 cache;
+
+ // Bit results.
+ int bits_left;
+
+ static uint32
+ scale_down(uint64 x,
+#if _GLIBCXX_SCALE_DOWN_FPU
+ uint64 /*supremum*/, double supremum_reciprocal)
+#else
+ uint64 supremum, double /*supremum_reciprocal*/)
+#endif
+ {
+#if _GLIBCXX_SCALE_DOWN_FPU
+ return uint32(x * supremum_reciprocal);
+#else
+ return static_cast<uint32>(x % supremum);
+#endif
+ }
+
+ public:
+ /** @brief Default constructor. Seed with 0. */
+ random_number()
+ : mt(0), supremum(0x100000000ULL),
+ RAND_SUP(1ULL << (sizeof(uint32) * 8)),
+ supremum_reciprocal(double(supremum) / double(RAND_SUP)),
+ RAND_SUP_REC(1.0 / double(RAND_SUP)),
+ cache(0), bits_left(0) { }
+
+ /** @brief Constructor.
+ * @param seed Random seed.
+ * @param supremum Generate integer random numbers in the
+ * interval @c [0,supremum). */
+ random_number(uint32 seed, uint64 supremum = 0x100000000ULL)
+ : mt(seed), supremum(supremum),
+ RAND_SUP(1ULL << (sizeof(uint32) * 8)),
+ supremum_reciprocal(double(supremum) / double(RAND_SUP)),
+ RAND_SUP_REC(1.0 / double(RAND_SUP)),
+ cache(0), bits_left(0) { }
+
+ /** @brief Generate unsigned random 32-bit integer. */
+ uint32
+ operator()()
+ { return scale_down(mt(), supremum, supremum_reciprocal); }
+
+ /** @brief Generate unsigned random 32-bit integer in the
+ interval @c [0,local_supremum). */
+ uint32
+ operator()(uint64 local_supremum)
+ {
+ return scale_down(mt(), local_supremum,
+ double(local_supremum * RAND_SUP_REC));
+ }
+
+ /** @brief Generate a number of random bits, run-time parameter.
+ * @param bits Number of bits to generate. */
+ unsigned long
+ genrand_bits(int bits)
+ {
+ unsigned long res = cache & ((1 << bits) - 1);
+ cache = cache >> bits;
+ bits_left -= bits;
+ if (bits_left < 32)
+ {
+ cache |= ((uint64(mt())) << bits_left);
+ bits_left += 32;
+ }
+ return res;
+ }
+};
+
+} // namespace __gnu_parallel
+
+#endif /* _GLIBCXX_PARALLEL_RANDOM_NUMBER_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/random_shuffle.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/random_shuffle.h
new file mode 100644
index 0000000..6e0ebef
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/random_shuffle.h
@@ -0,0 +1,519 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/random_shuffle.h
+ * @brief Parallel implementation of std::random_shuffle().
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_RANDOM_SHUFFLE_H
+#define _GLIBCXX_PARALLEL_RANDOM_SHUFFLE_H 1
+
+#include <limits>
+#include <bits/stl_numeric.h>
+#include <parallel/parallel.h>
+#include <parallel/random_number.h>
+
+namespace __gnu_parallel
+{
+/** @brief Type to hold the index of a bin.
+ *
+ * Since many variables of this type are allocated, it should be
+ * chosen as small as possible.
+ */
+typedef unsigned short bin_index;
+
+/** @brief Data known to every thread participating in
+ __gnu_parallel::parallel_random_shuffle(). */
+template<typename RandomAccessIterator>
+ struct DRandomShufflingGlobalData
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ /** @brief Begin iterator of the source. */
+ RandomAccessIterator& source;
+
+ /** @brief Temporary arrays for each thread. */
+ value_type** temporaries;
+
+ /** @brief Two-dimensional array to hold the thread-bin distribution.
+ *
+ * Dimensions (num_threads + 1) x (num_bins + 1). */
+ difference_type** dist;
+
+ /** @brief Start indexes of the threads' chunks. */
+ difference_type* starts;
+
+ /** @brief Number of the thread that will further process the
+ corresponding bin. */
+ thread_index_t* bin_proc;
+
+ /** @brief Number of bins to distribute to. */
+ int num_bins;
+
+ /** @brief Number of bits needed to address the bins. */
+ int num_bits;
+
+ /** @brief Constructor. */
+ DRandomShufflingGlobalData(RandomAccessIterator& _source)
+ : source(_source) { }
+ };
+
+/** @brief Local data for a thread participating in
+ __gnu_parallel::parallel_random_shuffle().
+ */
+template<typename RandomAccessIterator, typename RandomNumberGenerator>
+ struct DRSSorterPU
+ {
+ /** @brief Number of threads participating in total. */
+ int num_threads;
+
+ /** @brief Begin index for bins taken care of by this thread. */
+ bin_index bins_begin;
+
+ /** @brief End index for bins taken care of by this thread. */
+ bin_index bins_end;
+
+ /** @brief Random seed for this thread. */
+ uint32 seed;
+
+ /** @brief Pointer to global data. */
+ DRandomShufflingGlobalData<RandomAccessIterator>* sd;
+ };
+
+/** @brief Generate a random number in @c [0,2^logp).
+ * @param logp Logarithm (basis 2) of the upper range bound.
+ * @param rng Random number generator to use.
+ */
+template<typename RandomNumberGenerator>
+ inline int
+ random_number_pow2(int logp, RandomNumberGenerator& rng)
+ { return rng.genrand_bits(logp); }
+
+/** @brief Random shuffle code executed by each thread.
+ * @param pus Array of thread-local data records. */
+template<typename RandomAccessIterator, typename RandomNumberGenerator>
+ void
+ parallel_random_shuffle_drs_pu(DRSSorterPU<RandomAccessIterator,
+ RandomNumberGenerator>* pus)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ thread_index_t iam = omp_get_thread_num();
+ DRSSorterPU<RandomAccessIterator, RandomNumberGenerator>* d = &pus[iam];
+ DRandomShufflingGlobalData<RandomAccessIterator>* sd = d->sd;
+
+ // Indexing: dist[bin][processor]
+ difference_type length = sd->starts[iam + 1] - sd->starts[iam];
+ bin_index* oracles = new bin_index[length];
+ difference_type* dist = new difference_type[sd->num_bins + 1];
+ bin_index* bin_proc = new bin_index[sd->num_bins];
+ value_type** temporaries = new value_type*[d->num_threads];
+
+ // Compute oracles and count appearances.
+ for (bin_index b = 0; b < sd->num_bins + 1; ++b)
+ dist[b] = 0;
+ int num_bits = sd->num_bits;
+
+ random_number rng(d->seed);
+
+ // First main loop.
+ for (difference_type i = 0; i < length; ++i)
+ {
+ bin_index oracle = random_number_pow2(num_bits, rng);
+ oracles[i] = oracle;
+
+ // To allow prefix (partial) sum.
+ ++(dist[oracle + 1]);
+ }
+
+ for (bin_index b = 0; b < sd->num_bins + 1; ++b)
+ sd->dist[b][iam + 1] = dist[b];
+
+# pragma omp barrier
+
+# pragma omp single
+ {
+ // Sum up bins, sd->dist[s + 1][d->num_threads] now contains the
+ // total number of items in bin s
+ for (bin_index s = 0; s < sd->num_bins; ++s)
+ __gnu_sequential::partial_sum(sd->dist[s + 1],
+ sd->dist[s + 1] + d->num_threads + 1,
+ sd->dist[s + 1]);
+ }
+
+# pragma omp barrier
+
+ sequence_index_t offset = 0, global_offset = 0;
+ for (bin_index s = 0; s < d->bins_begin; ++s)
+ global_offset += sd->dist[s + 1][d->num_threads];
+
+# pragma omp barrier
+
+ for (bin_index s = d->bins_begin; s < d->bins_end; ++s)
+ {
+ for (int t = 0; t < d->num_threads + 1; ++t)
+ sd->dist[s + 1][t] += offset;
+ offset = sd->dist[s + 1][d->num_threads];
+ }
+
+ sd->temporaries[iam] = static_cast<value_type*>(
+ ::operator new(sizeof(value_type) * offset));
+
+# pragma omp barrier
+
+ // Draw local copies to avoid false sharing.
+ for (bin_index b = 0; b < sd->num_bins + 1; ++b)
+ dist[b] = sd->dist[b][iam];
+ for (bin_index b = 0; b < sd->num_bins; ++b)
+ bin_proc[b] = sd->bin_proc[b];
+ for (thread_index_t t = 0; t < d->num_threads; ++t)
+ temporaries[t] = sd->temporaries[t];
+
+ RandomAccessIterator source = sd->source;
+ difference_type start = sd->starts[iam];
+
+ // Distribute according to oracles, second main loop.
+ for (difference_type i = 0; i < length; ++i)
+ {
+ bin_index target_bin = oracles[i];
+ thread_index_t target_p = bin_proc[target_bin];
+
+ // Last column [d->num_threads] stays unchanged.
+ ::new(&(temporaries[target_p][dist[target_bin + 1]++]))
+ value_type(*(source + i + start));
+ }
+
+ delete[] oracles;
+ delete[] dist;
+ delete[] bin_proc;
+ delete[] temporaries;
+
+# pragma omp barrier
+
+ // Shuffle bins internally.
+ for (bin_index b = d->bins_begin; b < d->bins_end; ++b)
+ {
+ value_type* begin =
+ sd->temporaries[iam] +
+ ((b == d->bins_begin) ? 0 : sd->dist[b][d->num_threads]),
+ * end =
+ sd->temporaries[iam] + sd->dist[b + 1][d->num_threads];
+ sequential_random_shuffle(begin, end, rng);
+ std::copy(begin, end, sd->source + global_offset +
+ ((b == d->bins_begin) ? 0 : sd->dist[b][d->num_threads]));
+ }
+
+ ::operator delete(sd->temporaries[iam]);
+ }
+
+/** @brief Round up to the next greater power of 2.
+ * @param x Integer to round up */
+template<typename T>
+ T
+ round_up_to_pow2(T x)
+ {
+ if (x <= 1)
+ return 1;
+ else
+ return (T)1 << (__log2(x - 1) + 1);
+ }
+
+/** @brief Main parallel random shuffle step.
+ * @param begin Begin iterator of sequence.
+ * @param end End iterator of sequence.
+ * @param n Length of sequence.
+ * @param num_threads Number of threads to use.
+ * @param rng Random number generator to use.
+ */
+template<typename RandomAccessIterator, typename RandomNumberGenerator>
+ void
+ parallel_random_shuffle_drs(RandomAccessIterator begin,
+ RandomAccessIterator end,
+ typename std::iterator_traits
+ <RandomAccessIterator>::difference_type n,
+ thread_index_t num_threads,
+ RandomNumberGenerator& rng)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ _GLIBCXX_CALL(n)
+
+ const _Settings& __s = _Settings::get();
+
+ if (num_threads > n)
+ num_threads = static_cast<thread_index_t>(n);
+
+ bin_index num_bins, num_bins_cache;
+
+#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_L1
+ // Try the L1 cache first.
+
+ // Must fit into L1.
+ num_bins_cache = std::max<difference_type>(
+ 1, n / (__s.L1_cache_size_lb / sizeof(value_type)));
+ num_bins_cache = round_up_to_pow2(num_bins_cache);
+
+ // No more buckets than TLB entries, power of 2
+ // Power of 2 and at least one element per bin, at most the TLB size.
+ num_bins = std::min<difference_type>(n, num_bins_cache);
+
+#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_TLB
+ // 2 TLB entries needed per bin.
+ num_bins = std::min<difference_type>(__s.TLB_size / 2, num_bins);
+#endif
+ num_bins = round_up_to_pow2(num_bins);
+
+ if (num_bins < num_bins_cache)
+ {
+#endif
+ // Now try the L2 cache
+ // Must fit into L2
+ num_bins_cache = static_cast<bin_index>(std::max<difference_type>(
+ 1, n / (__s.L2_cache_size / sizeof(value_type))));
+ num_bins_cache = round_up_to_pow2(num_bins_cache);
+
+ // No more buckets than TLB entries, power of 2.
+ num_bins = static_cast<bin_index>(
+ std::min(n, static_cast<difference_type>(num_bins_cache)));
+ // Power of 2 and at least one element per bin, at most the TLB size.
+#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_TLB
+ // 2 TLB entries needed per bin.
+ num_bins = std::min(
+ static_cast<difference_type>(__s.TLB_size / 2), num_bins);
+#endif
+ num_bins = round_up_to_pow2(num_bins);
+#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_L1
+ }
+#endif
+
+ num_threads = std::min<bin_index>(num_threads, num_bins);
+
+ if (num_threads <= 1)
+ return sequential_random_shuffle(begin, end, rng);
+
+ DRandomShufflingGlobalData<RandomAccessIterator> sd(begin);
+ DRSSorterPU<RandomAccessIterator, random_number >* pus;
+ difference_type* starts;
+
+# pragma omp parallel num_threads(num_threads)
+ {
+ thread_index_t num_threads = omp_get_num_threads();
+# pragma omp single
+ {
+ pus = new DRSSorterPU<RandomAccessIterator, random_number>
+ [num_threads];
+
+ sd.temporaries = new value_type*[num_threads];
+ sd.dist = new difference_type*[num_bins + 1];
+ sd.bin_proc = new thread_index_t[num_bins];
+ for (bin_index b = 0; b < num_bins + 1; ++b)
+ sd.dist[b] = new difference_type[num_threads + 1];
+ for (bin_index b = 0; b < (num_bins + 1); ++b)
+ {
+ sd.dist[0][0] = 0;
+ sd.dist[b][0] = 0;
+ }
+ starts = sd.starts = new difference_type[num_threads + 1];
+ int bin_cursor = 0;
+ sd.num_bins = num_bins;
+ sd.num_bits = __log2(num_bins);
+
+ difference_type chunk_length = n / num_threads,
+ split = n % num_threads, start = 0;
+ difference_type bin_chunk_length = num_bins / num_threads,
+ bin_split = num_bins % num_threads;
+ for (thread_index_t i = 0; i < num_threads; ++i)
+ {
+ starts[i] = start;
+ start += (i < split) ? (chunk_length + 1) : chunk_length;
+ int j = pus[i].bins_begin = bin_cursor;
+
+ // Range of bins for this processor.
+ bin_cursor += (i < bin_split) ?
+ (bin_chunk_length + 1) : bin_chunk_length;
+ pus[i].bins_end = bin_cursor;
+ for (; j < bin_cursor; ++j)
+ sd.bin_proc[j] = i;
+ pus[i].num_threads = num_threads;
+ pus[i].seed = rng(std::numeric_limits<uint32>::max());
+ pus[i].sd = &sd;
+ }
+ starts[num_threads] = start;
+ } //single
+ // Now shuffle in parallel.
+ parallel_random_shuffle_drs_pu(pus);
+ } // parallel
+
+ delete[] starts;
+ delete[] sd.bin_proc;
+ for (int s = 0; s < (num_bins + 1); ++s)
+ delete[] sd.dist[s];
+ delete[] sd.dist;
+ delete[] sd.temporaries;
+
+ delete[] pus;
+ }
+
+/** @brief Sequential cache-efficient random shuffle.
+ * @param begin Begin iterator of sequence.
+ * @param end End iterator of sequence.
+ * @param rng Random number generator to use.
+ */
+template<typename RandomAccessIterator, typename RandomNumberGenerator>
+ void
+ sequential_random_shuffle(RandomAccessIterator begin,
+ RandomAccessIterator end,
+ RandomNumberGenerator& rng)
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ difference_type n = end - begin;
+ const _Settings& __s = _Settings::get();
+
+ bin_index num_bins, num_bins_cache;
+
+#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_L1
+ // Try the L1 cache first, must fit into L1.
+ num_bins_cache =
+ std::max<difference_type>
+ (1, n / (__s.L1_cache_size_lb / sizeof(value_type)));
+ num_bins_cache = round_up_to_pow2(num_bins_cache);
+
+ // No more buckets than TLB entries, power of 2
+ // Power of 2 and at least one element per bin, at most the TLB size
+ num_bins = std::min(n, (difference_type)num_bins_cache);
+#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_TLB
+ // 2 TLB entries needed per bin
+ num_bins = std::min((difference_type)__s.TLB_size / 2, num_bins);
+#endif
+ num_bins = round_up_to_pow2(num_bins);
+
+ if (num_bins < num_bins_cache)
+ {
+#endif
+ // Now try the L2 cache, must fit into L2.
+ num_bins_cache =
+ static_cast<bin_index>(std::max<difference_type>(
+ 1, n / (__s.L2_cache_size / sizeof(value_type))));
+ num_bins_cache = round_up_to_pow2(num_bins_cache);
+
+ // No more buckets than TLB entries, power of 2
+ // Power of 2 and at least one element per bin, at most the TLB size.
+ num_bins = static_cast<bin_index>
+ (std::min(n, static_cast<difference_type>(num_bins_cache)));
+
+#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_TLB
+ // 2 TLB entries needed per bin
+ num_bins =
+ std::min<difference_type>(__s.TLB_size / 2, num_bins);
+#endif
+ num_bins = round_up_to_pow2(num_bins);
+#if _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_L1
+ }
+#endif
+
+ int num_bits = __log2(num_bins);
+
+ if (num_bins > 1)
+ {
+ value_type* target = static_cast<value_type*>(
+ ::operator new(sizeof(value_type) * n));
+ bin_index* oracles = new bin_index[n];
+ difference_type* dist0 = new difference_type[num_bins + 1],
+ * dist1 = new difference_type[num_bins + 1];
+
+ for (int b = 0; b < num_bins + 1; ++b)
+ dist0[b] = 0;
+
+ random_number bitrng(rng(0xFFFFFFFF));
+
+ for (difference_type i = 0; i < n; ++i)
+ {
+ bin_index oracle = random_number_pow2(num_bits, bitrng);
+ oracles[i] = oracle;
+
+ // To allow prefix (partial) sum.
+ ++(dist0[oracle + 1]);
+ }
+
+ // Sum up bins.
+ __gnu_sequential::partial_sum(dist0, dist0 + num_bins + 1, dist0);
+
+ for (int b = 0; b < num_bins + 1; ++b)
+ dist1[b] = dist0[b];
+
+ // Distribute according to oracles.
+ for (difference_type i = 0; i < n; ++i)
+ ::new(&(target[(dist0[oracles[i]])++])) value_type(*(begin + i));
+
+ for (int b = 0; b < num_bins; ++b)
+ {
+ sequential_random_shuffle(target + dist1[b],
+ target + dist1[b + 1],
+ rng);
+ }
+
+ // Copy elements back.
+ std::copy(target, target + n, begin);
+
+ delete[] dist0;
+ delete[] dist1;
+ delete[] oracles;
+ ::operator delete(target);
+ }
+ else
+ __gnu_sequential::random_shuffle(begin, end, rng);
+ }
+
+/** @brief Parallel random public call.
+ * @param begin Begin iterator of sequence.
+ * @param end End iterator of sequence.
+ * @param rng Random number generator to use.
+ */
+template<typename RandomAccessIterator, typename RandomNumberGenerator>
+ inline void
+ parallel_random_shuffle(RandomAccessIterator begin,
+ RandomAccessIterator end,
+ RandomNumberGenerator rng = random_number())
+ {
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+ difference_type n = end - begin;
+ parallel_random_shuffle_drs(begin, end, n, get_max_threads(), rng) ;
+ }
+
+}
+
+#endif /* _GLIBCXX_PARALLEL_RANDOM_SHUFFLE_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/search.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/search.h
new file mode 100644
index 0000000..31a8534
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/search.h
@@ -0,0 +1,172 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/search.h
+ * @brief Parallel implementation base for std::search() and
+ * std::search_n().
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_SEARCH_H
+#define _GLIBCXX_PARALLEL_SEARCH_H 1
+
+#include <bits/stl_algobase.h>
+
+#include <parallel/parallel.h>
+#include <parallel/equally_split.h>
+
+
+namespace __gnu_parallel
+{
+ /**
+ * @brief Precalculate advances for Knuth-Morris-Pratt algorithm.
+ * @param elements Begin iterator of sequence to search for.
+ * @param length Length of sequence to search for.
+ * @param advances Returned offsets.
+ */
+template<typename RandomAccessIterator, typename _DifferenceTp>
+ void
+ calc_borders(RandomAccessIterator elements, _DifferenceTp length,
+ _DifferenceTp* off)
+ {
+ typedef _DifferenceTp difference_type;
+
+ off[0] = -1;
+ if (length > 1)
+ off[1] = 0;
+ difference_type k = 0;
+ for (difference_type j = 2; j <= length; j++)
+ {
+ while ((k >= 0) && !(elements[k] == elements[j-1]))
+ k = off[k];
+ off[j] = ++k;
+ }
+ }
+
+ // Generic parallel find algorithm (requires random access iterator).
+
+ /** @brief Parallel std::search.
+ * @param begin1 Begin iterator of first sequence.
+ * @param end1 End iterator of first sequence.
+ * @param begin2 Begin iterator of second sequence.
+ * @param end2 End iterator of second sequence.
+ * @param pred Find predicate.
+ * @return Place of finding in first sequences. */
+template<typename _RandomAccessIterator1,
+ typename _RandomAccessIterator2,
+ typename Pred>
+ _RandomAccessIterator1
+ search_template(_RandomAccessIterator1 begin1, _RandomAccessIterator1 end1,
+ _RandomAccessIterator2 begin2, _RandomAccessIterator2 end2,
+ Pred pred)
+ {
+ typedef std::iterator_traits<_RandomAccessIterator1> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ _GLIBCXX_CALL((end1 - begin1) + (end2 - begin2));
+
+ difference_type pattern_length = end2 - begin2;
+
+ // Pattern too short.
+ if(pattern_length <= 0)
+ return end1;
+
+ // Last point to start search.
+ difference_type input_length = (end1 - begin1) - pattern_length;
+
+ // Where is first occurrence of pattern? defaults to end.
+ difference_type result = (end1 - begin1);
+ difference_type *splitters;
+
+ // Pattern too long.
+ if (input_length < 0)
+ return end1;
+
+ omp_lock_t result_lock;
+ omp_init_lock(&result_lock);
+
+ thread_index_t num_threads =
+ std::max<difference_type>(1,
+ std::min<difference_type>(input_length, get_max_threads()));
+
+ difference_type advances[pattern_length];
+ calc_borders(begin2, pattern_length, advances);
+
+# pragma omp parallel num_threads(num_threads)
+ {
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+ splitters = new difference_type[num_threads + 1];
+ equally_split(input_length, num_threads, splitters);
+ }
+
+ thread_index_t iam = omp_get_thread_num();
+
+ difference_type start = splitters[iam], stop = splitters[iam + 1];
+
+ difference_type pos_in_pattern = 0;
+ bool found_pattern = false;
+
+ while (start <= stop && !found_pattern)
+ {
+ // Get new value of result.
+ #pragma omp flush(result)
+ // No chance for this thread to find first occurrence.
+ if (result < start)
+ break;
+ while (pred(begin1[start + pos_in_pattern],
+ begin2[pos_in_pattern]))
+ {
+ ++pos_in_pattern;
+ if (pos_in_pattern == pattern_length)
+ {
+ // Found new candidate for result.
+ omp_set_lock(&result_lock);
+ result = std::min(result, start);
+ omp_unset_lock(&result_lock);
+
+ found_pattern = true;
+ break;
+ }
+ }
+ // Make safe jump.
+ start += (pos_in_pattern - advances[pos_in_pattern]);
+ pos_in_pattern =
+ (advances[pos_in_pattern] < 0) ? 0 : advances[pos_in_pattern];
+ }
+ } //parallel
+
+ omp_destroy_lock(&result_lock);
+
+ delete[] splitters;
+
+ // Return iterator on found element.
+ return (begin1 + result);
+ }
+} // end namespace
+
+#endif /* _GLIBCXX_PARALLEL_SEARCH_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/set_operations.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/set_operations.h
new file mode 100644
index 0000000..2800819
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/set_operations.h
@@ -0,0 +1,524 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/**
+ * @file parallel/set_operations.h
+ * @brief Parallel implementations of set operations for random-access
+ * iterators.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Marius Elvert and Felix Bondarenko.
+
+#ifndef _GLIBCXX_PARALLEL_SET_OPERATIONS_H
+#define _GLIBCXX_PARALLEL_SET_OPERATIONS_H 1
+
+#include <omp.h>
+
+#include <parallel/settings.h>
+#include <parallel/multiseq_selection.h>
+
+namespace __gnu_parallel
+{
+template<typename InputIterator, typename OutputIterator>
+ OutputIterator
+ copy_tail(std::pair<InputIterator, InputIterator> b,
+ std::pair<InputIterator, InputIterator> e, OutputIterator r)
+ {
+ if (b.first != e.first)
+ {
+ do
+ {
+ *r++ = *b.first++;
+ }
+ while (b.first != e.first);
+ }
+ else
+ {
+ while (b.second != e.second)
+ *r++ = *b.second++;
+ }
+ return r;
+ }
+
+template<typename InputIterator,
+ typename OutputIterator,
+ typename Comparator>
+ struct symmetric_difference_func
+ {
+ typedef std::iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef typename std::pair<InputIterator, InputIterator> iterator_pair;
+
+ symmetric_difference_func(Comparator c) : comp(c) {}
+
+ Comparator comp;
+
+ OutputIterator
+ invoke(InputIterator a, InputIterator b,
+ InputIterator c, InputIterator d,
+ OutputIterator r) const
+ {
+ while (a != b && c != d)
+ {
+ if (comp(*a, *c))
+ {
+ *r = *a;
+ ++a;
+ ++r;
+ }
+ else if (comp(*c, *a))
+ {
+ *r = *c;
+ ++c;
+ ++r;
+ }
+ else
+ {
+ ++a;
+ ++c;
+ }
+ }
+ return std::copy(c, d, std::copy(a, b, r));
+ }
+
+ difference_type
+ count(InputIterator a, InputIterator b,
+ InputIterator c, InputIterator d) const
+ {
+ difference_type counter = 0;
+
+ while (a != b && c != d)
+ {
+ if (comp(*a, *c))
+ {
+ ++a;
+ ++counter;
+ }
+ else if (comp(*c, *a))
+ {
+ ++c;
+ ++counter;
+ }
+ else
+ {
+ ++a;
+ ++c;
+ }
+ }
+
+ return counter + (b - a) + (d - c);
+ }
+
+ OutputIterator
+ first_empty(InputIterator c, InputIterator d, OutputIterator out) const
+ { return std::copy(c, d, out); }
+
+ OutputIterator
+ second_empty(InputIterator a, InputIterator b, OutputIterator out) const
+ { return std::copy(a, b, out); }
+ };
+
+
+template<typename InputIterator,
+ typename OutputIterator,
+ typename Comparator>
+ struct difference_func
+ {
+ typedef std::iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef typename std::pair<InputIterator, InputIterator> iterator_pair;
+
+ difference_func(Comparator c) : comp(c) {}
+
+ Comparator comp;
+
+ OutputIterator
+ invoke(InputIterator a, InputIterator b, InputIterator c, InputIterator d,
+ OutputIterator r) const
+ {
+ while (a != b && c != d)
+ {
+ if (comp(*a, *c))
+ {
+ *r = *a;
+ ++a;
+ ++r;
+ }
+ else if (comp(*c, *a))
+ { ++c; }
+ else
+ {
+ ++a;
+ ++c;
+ }
+ }
+ return std::copy(a, b, r);
+ }
+
+ difference_type
+ count(InputIterator a, InputIterator b,
+ InputIterator c, InputIterator d) const
+ {
+ difference_type counter = 0;
+
+ while (a != b && c != d)
+ {
+ if (comp(*a, *c))
+ {
+ ++a;
+ ++counter;
+ }
+ else if (comp(*c, *a))
+ { ++c; }
+ else
+ { ++a; ++c; }
+ }
+
+ return counter + (b - a);
+ }
+
+ inline OutputIterator
+ first_empty(InputIterator c, InputIterator d, OutputIterator out) const
+ { return out; }
+
+ inline OutputIterator
+ second_empty(InputIterator a, InputIterator b, OutputIterator out) const
+ { return std::copy(a, b, out); }
+ };
+
+
+template<typename InputIterator,
+ typename OutputIterator,
+ typename Comparator>
+ struct intersection_func
+ {
+ typedef std::iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef typename std::pair<InputIterator, InputIterator> iterator_pair;
+
+ intersection_func(Comparator c) : comp(c) {}
+
+ Comparator comp;
+
+ OutputIterator
+ invoke(InputIterator a, InputIterator b, InputIterator c, InputIterator d,
+ OutputIterator r) const
+ {
+ while (a != b && c != d)
+ {
+ if (comp(*a, *c))
+ { ++a; }
+ else if (comp(*c, *a))
+ { ++c; }
+ else
+ {
+ *r = *a;
+ ++a;
+ ++c;
+ ++r;
+ }
+ }
+
+ return r;
+ }
+
+ difference_type
+ count(InputIterator a, InputIterator b,
+ InputIterator c, InputIterator d) const
+ {
+ difference_type counter = 0;
+
+ while (a != b && c != d)
+ {
+ if (comp(*a, *c))
+ { ++a; }
+ else if (comp(*c, *a))
+ { ++c; }
+ else
+ {
+ ++a;
+ ++c;
+ ++counter;
+ }
+ }
+
+ return counter;
+ }
+
+ inline OutputIterator
+ first_empty(InputIterator c, InputIterator d, OutputIterator out) const
+ { return out; }
+
+ inline OutputIterator
+ second_empty(InputIterator a, InputIterator b, OutputIterator out) const
+ { return out; }
+ };
+
+template<class InputIterator, class OutputIterator, class Comparator>
+ struct union_func
+ {
+ typedef typename std::iterator_traits<InputIterator>::difference_type
+ difference_type;
+
+ union_func(Comparator c) : comp(c) {}
+
+ Comparator comp;
+
+ OutputIterator
+ invoke(InputIterator a, const InputIterator b, InputIterator c,
+ const InputIterator d, OutputIterator r) const
+ {
+ while (a != b && c != d)
+ {
+ if (comp(*a, *c))
+ {
+ *r = *a;
+ ++a;
+ }
+ else if (comp(*c, *a))
+ {
+ *r = *c;
+ ++c;
+ }
+ else
+ {
+ *r = *a;
+ ++a;
+ ++c;
+ }
+ ++r;
+ }
+ return std::copy(c, d, std::copy(a, b, r));
+ }
+
+ difference_type
+ count(InputIterator a, InputIterator b,
+ InputIterator c, InputIterator d) const
+ {
+ difference_type counter = 0;
+
+ while (a != b && c != d)
+ {
+ if (comp(*a, *c))
+ { ++a; }
+ else if (comp(*c, *a))
+ { ++c; }
+ else
+ {
+ ++a;
+ ++c;
+ }
+ ++counter;
+ }
+
+ counter += (b - a);
+ counter += (d - c);
+ return counter;
+ }
+
+ inline OutputIterator
+ first_empty(InputIterator c, InputIterator d, OutputIterator out) const
+ { return std::copy(c, d, out); }
+
+ inline OutputIterator
+ second_empty(InputIterator a, InputIterator b, OutputIterator out) const
+ { return std::copy(a, b, out); }
+ };
+
+template<typename InputIterator,
+ typename OutputIterator,
+ typename Operation>
+ OutputIterator
+ parallel_set_operation(InputIterator begin1, InputIterator end1,
+ InputIterator begin2, InputIterator end2,
+ OutputIterator result, Operation op)
+ {
+ _GLIBCXX_CALL((end1 - begin1) + (end2 - begin2))
+
+ typedef std::iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+ typedef typename std::pair<InputIterator, InputIterator> iterator_pair;
+
+ if (begin1 == end1)
+ return op.first_empty(begin2, end2, result);
+
+ if (begin2 == end2)
+ return op.second_empty(begin1, end1, result);
+
+ const difference_type size = (end1 - begin1) + (end2 - begin2);
+
+ const iterator_pair sequence[ 2 ] =
+ { std::make_pair(begin1, end1), std::make_pair(begin2, end2) } ;
+ OutputIterator return_value = result;
+ difference_type *borders;
+ iterator_pair *block_begins;
+ difference_type* lengths;
+
+ thread_index_t num_threads =
+ std::min<difference_type>(get_max_threads(),
+ std::min(end1 - begin1, end2 - begin2));
+
+# pragma omp parallel num_threads(num_threads)
+ {
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+
+ borders = new difference_type[num_threads + 2];
+ equally_split(size, num_threads + 1, borders);
+ block_begins = new iterator_pair[num_threads + 1];
+ // Very start.
+ block_begins[0] = std::make_pair(begin1, begin2);
+ lengths = new difference_type[num_threads];
+ } //single
+
+ thread_index_t iam = omp_get_thread_num();
+
+ // Result from multiseq_partition.
+ InputIterator offset[2];
+ const difference_type rank = borders[iam + 1];
+
+ multiseq_partition(sequence, sequence + 2, rank, offset, op.comp);
+
+ // allowed to read?
+ // together
+ // *(offset[ 0 ] - 1) == *offset[ 1 ]
+ if (offset[ 0 ] != begin1 && offset[ 1 ] != end2
+ && !op.comp(*(offset[ 0 ] - 1), *offset[ 1 ])
+ && !op.comp(*offset[ 1 ], *(offset[ 0 ] - 1)))
+ {
+ // Avoid split between globally equal elements: move one to
+ // front in first sequence.
+ --offset[ 0 ];
+ }
+
+ iterator_pair block_end = block_begins[ iam + 1 ] =
+ iterator_pair(offset[ 0 ], offset[ 1 ]);
+
+ // Make sure all threads have their block_begin result written out.
+# pragma omp barrier
+
+ iterator_pair block_begin = block_begins[ iam ];
+
+ // Begin working for the first block, while the others except
+ // the last start to count.
+ if (iam == 0)
+ {
+ // The first thread can copy already.
+ lengths[ iam ] = op.invoke(block_begin.first, block_end.first,
+ block_begin.second, block_end.second,
+ result)
+ - result;
+ }
+ else
+ {
+ lengths[ iam ] = op.count(block_begin.first, block_end.first,
+ block_begin.second, block_end.second);
+ }
+
+ // Make sure everyone wrote their lengths.
+# pragma omp barrier
+
+ OutputIterator r = result;
+
+ if (iam == 0)
+ {
+ // Do the last block.
+ for (int i = 0; i < num_threads; ++i)
+ r += lengths[i];
+
+ block_begin = block_begins[num_threads];
+
+ // Return the result iterator of the last block.
+ return_value = op.invoke(
+ block_begin.first, end1, block_begin.second, end2, r);
+
+ }
+ else
+ {
+ for (int i = 0; i < iam; ++i)
+ r += lengths[ i ];
+
+ // Reset begins for copy pass.
+ op.invoke(block_begin.first, block_end.first,
+ block_begin.second, block_end.second, r);
+ }
+ }
+ return return_value;
+ }
+
+
+template<typename InputIterator,
+ typename OutputIterator,
+ typename Comparator>
+ inline OutputIterator
+ parallel_set_union(InputIterator begin1, InputIterator end1,
+ InputIterator begin2, InputIterator end2,
+ OutputIterator result, Comparator comp)
+ {
+ return parallel_set_operation(begin1, end1, begin2, end2, result,
+ union_func< InputIterator, OutputIterator, Comparator>(comp));
+ }
+
+template<typename InputIterator,
+ typename OutputIterator,
+ typename Comparator>
+ inline OutputIterator
+ parallel_set_intersection(InputIterator begin1, InputIterator end1,
+ InputIterator begin2, InputIterator end2,
+ OutputIterator result, Comparator comp)
+ {
+ return parallel_set_operation(begin1, end1, begin2, end2, result,
+ intersection_func<InputIterator, OutputIterator, Comparator>(comp));
+ }
+
+template<typename InputIterator,
+ typename OutputIterator,
+ typename Comparator>
+ inline OutputIterator
+ parallel_set_difference(InputIterator begin1, InputIterator end1,
+ InputIterator begin2, InputIterator end2,
+ OutputIterator result, Comparator comp)
+ {
+ return parallel_set_operation(begin1, end1, begin2, end2, result,
+ difference_func<InputIterator, OutputIterator, Comparator>(comp));
+ }
+
+template<typename InputIterator,
+ typename OutputIterator,
+ typename Comparator>
+ inline OutputIterator
+ parallel_set_symmetric_difference(InputIterator begin1, InputIterator end1,
+ InputIterator begin2, InputIterator end2,
+ OutputIterator result, Comparator comp)
+ {
+ return parallel_set_operation(begin1, end1, begin2, end2, result,
+ symmetric_difference_func<InputIterator, OutputIterator, Comparator>
+ (comp));
+ }
+
+}
+
+#endif /* _GLIBCXX_PARALLEL_SET_OPERATIONS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/settings.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/settings.h
new file mode 100644
index 0000000..946e39c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/settings.h
@@ -0,0 +1,281 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/settings.h
+ * @brief Runtime settings and tuning parameters, heuristics to decide
+ * whether to use parallelized algorithms.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ *
+ * @section parallelization_decision
+ * The decision whether to run an algorithm in parallel.
+ *
+ * There are several ways the user can switch on and off the parallel
+ * execution of an algorithm, both at compile- and run-time.
+ *
+ * Only sequential execution can be forced at compile-time. This
+ * reduces code size and protects code parts that have
+ * non-thread-safe side effects.
+ *
+ * Ultimately, forcing parallel execution at compile-time makes
+ * sense. Often, the sequential algorithm implementation is used as
+ * a subroutine, so no reduction in code size can be achieved. Also,
+ * the machine the program is run on might have only one processor
+ * core, so to avoid overhead, the algorithm is executed
+ * sequentially.
+ *
+ * To force sequential execution of an algorithm ultimately at
+ * compile-time, the user must add the tag
+ * __gnu_parallel::sequential_tag() to the end of the parameter list,
+ * e. g.
+ *
+ * \code
+ * std::sort(v.begin(), v.end(), __gnu_parallel::sequential_tag());
+ * \endcode
+ *
+ * This is compatible with all overloaded algorithm variants. No
+ * additional code will be instantiated, at all. The same holds for
+ * most algorithm calls with iterators not providing random access.
+ *
+ * If the algorithm call is not forced to be executed sequentially
+ * at compile-time, the decision is made at run-time.
+ * The global variable __gnu_parallel::_Settings::algorithm_strategy
+ * is checked. It is a tristate variable corresponding to:
+ *
+ * a. force_sequential, meaning the sequential algorithm is executed.
+ * b. force_parallel, meaning the parallel algorithm is executed.
+ * c. heuristic
+ *
+ * For heuristic, the parallel algorithm implementation is called
+ * only if the input size is sufficiently large. For most
+ * algorithms, the input size is the (combined) length of the input
+ * sequence(s). The threshold can be set by the user, individually
+ * for each algorithm. The according variables are called
+ * __gnu_parallel::_Settings::[algorithm]_minimal_n .
+ *
+ * For some of the algorithms, there are even more tuning options,
+ * e. g. the ability to choose from multiple algorithm variants. See
+ * below for details.
+ */
+
+// Written by Johannes Singler and Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_SETTINGS_H
+#define _GLIBCXX_PARALLEL_SETTINGS_H 1
+
+#include <parallel/types.h>
+
+/**
+ * @brief Determine at compile(?)-time if the parallel variant of an
+ * algorithm should be called.
+ * @param c A condition that is convertible to bool that is overruled by
+ * __gnu_parallel::_Settings::algorithm_strategy. Usually a decision
+ * based on the input size.
+ */
+#define _GLIBCXX_PARALLEL_CONDITION(c) (__gnu_parallel::_Settings::get().algorithm_strategy != __gnu_parallel::force_sequential && ((__gnu_parallel::get_max_threads() > 1 && (c)) || __gnu_parallel::_Settings::get().algorithm_strategy == __gnu_parallel::force_parallel))
+
+/*
+inline bool
+parallel_condition(bool c)
+{
+ bool ret = false;
+ const _Settings& s = _Settings::get();
+ if (s.algorithm_strategy != force_seqential)
+ {
+ if (s.algorithm_strategy == force_parallel)
+ ret = true;
+ else
+ ret = get_max_threads() > 1 && c;
+ }
+ return ret;
+}
+*/
+
+namespace __gnu_parallel
+{
+ /// class _Settings
+ /// Run-time settings for the parallel mode, including all tunable parameters.
+ struct _Settings
+ {
+ _AlgorithmStrategy algorithm_strategy;
+
+ _SortAlgorithm sort_algorithm;
+ _PartialSumAlgorithm partial_sum_algorithm;
+ _MultiwayMergeAlgorithm multiway_merge_algorithm;
+ _FindAlgorithm find_algorithm;
+
+ _SplittingAlgorithm sort_splitting;
+ _SplittingAlgorithm merge_splitting;
+ _SplittingAlgorithm multiway_merge_splitting;
+
+ // Per-algorithm settings.
+
+ /// Minimal input size for accumulate.
+ sequence_index_t accumulate_minimal_n;
+
+ /// Minimal input size for adjacent_difference.
+ unsigned int adjacent_difference_minimal_n;
+
+ /// Minimal input size for count and count_if.
+ sequence_index_t count_minimal_n;
+
+ /// Minimal input size for fill.
+ sequence_index_t fill_minimal_n;
+
+ /// Block size increase factor for find.
+ double find_increasing_factor;
+
+ /// Initial block size for find.
+ sequence_index_t find_initial_block_size;
+
+ /// Maximal block size for find.
+ sequence_index_t find_maximum_block_size;
+
+ /// Start with looking for this many elements sequentially, for find.
+ sequence_index_t find_sequential_search_size;
+
+ /// Minimal input size for for_each.
+ sequence_index_t for_each_minimal_n;
+
+ /// Minimal input size for generate.
+ sequence_index_t generate_minimal_n;
+
+ /// Minimal input size for max_element.
+ sequence_index_t max_element_minimal_n;
+
+ /// Minimal input size for merge.
+ sequence_index_t merge_minimal_n;
+
+ /// Oversampling factor for merge.
+ unsigned int merge_oversampling;
+
+ /// Minimal input size for min_element.
+ sequence_index_t min_element_minimal_n;
+
+ /// Minimal input size for multiway_merge.
+ sequence_index_t multiway_merge_minimal_n;
+
+ /// Oversampling factor for multiway_merge.
+ int multiway_merge_minimal_k;
+
+ /// Oversampling factor for multiway_merge.
+ unsigned int multiway_merge_oversampling;
+
+ /// Minimal input size for nth_element.
+ sequence_index_t nth_element_minimal_n;
+
+ /// Chunk size for partition.
+ sequence_index_t partition_chunk_size;
+
+ /// Chunk size for partition, relative to input size. If > 0.0,
+ /// this value overrides partition_chunk_size.
+ double partition_chunk_share;
+
+ /// Minimal input size for partition.
+ sequence_index_t partition_minimal_n;
+
+ /// Minimal input size for partial_sort.
+ sequence_index_t partial_sort_minimal_n;
+
+ /// Ratio for partial_sum. Assume "sum and write result" to be
+ /// this factor slower than just "sum".
+ float partial_sum_dilation;
+
+ /// Minimal input size for partial_sum.
+ unsigned int partial_sum_minimal_n;
+
+ /// Minimal input size for random_shuffle.
+ unsigned int random_shuffle_minimal_n;
+
+ /// Minimal input size for replace and replace_if.
+ sequence_index_t replace_minimal_n;
+
+ /// Minimal input size for set_difference.
+ sequence_index_t set_difference_minimal_n;
+
+ /// Minimal input size for set_intersection.
+ sequence_index_t set_intersection_minimal_n;
+
+ /// Minimal input size for set_symmetric_difference.
+ sequence_index_t set_symmetric_difference_minimal_n;
+
+ /// Minimal input size for set_union.
+ sequence_index_t set_union_minimal_n;
+
+ /// Minimal input size for parallel sorting.
+ sequence_index_t sort_minimal_n;
+
+ /// Oversampling factor for parallel std::sort (MWMS).
+ unsigned int sort_mwms_oversampling;
+
+ /// Such many samples to take to find a good pivot (quicksort).
+ unsigned int sort_qs_num_samples_preset;
+
+ /// Maximal subsequence length to switch to unbalanced base case.
+ /// Applies to std::sort with dynamically load-balanced quicksort.
+ sequence_index_t sort_qsb_base_case_maximal_n;
+
+ /// Minimal input size for parallel std::transform.
+ sequence_index_t transform_minimal_n;
+
+ /// Minimal input size for unique_copy.
+ sequence_index_t unique_copy_minimal_n;
+
+ sequence_index_t workstealing_chunk_size;
+
+ // Hardware dependent tuning parameters.
+
+ /// Size of the L1 cache in bytes (underestimation).
+ unsigned long long L1_cache_size;
+
+ /// Size of the L2 cache in bytes (underestimation).
+ unsigned long long L2_cache_size;
+
+ /// Size of the Translation Lookaside Buffer (underestimation).
+ unsigned int TLB_size;
+
+ /// Overestimation of cache line size. Used to avoid false
+ /// sharing, i. e. elements of different threads are at least this
+ /// amount apart.
+ unsigned int cache_line_size;
+
+ // Statistics.
+
+ /// The number of stolen ranges in load-balanced quicksort.
+ sequence_index_t qsb_steals;
+
+ /// Get the global settings.
+ static const _Settings&
+ get() throw();
+
+ /// Set the global settings.
+ static void
+ set(_Settings&) throw();
+
+ explicit
+ _Settings() : algorithm_strategy(heuristic), sort_algorithm(MWMS), partial_sum_algorithm(LINEAR), multiway_merge_algorithm(LOSER_TREE), find_algorithm(CONSTANT_SIZE_BLOCKS), sort_splitting(EXACT), merge_splitting(EXACT), multiway_merge_splitting(EXACT), accumulate_minimal_n(1000), adjacent_difference_minimal_n(1000), count_minimal_n(1000), fill_minimal_n(1000), find_increasing_factor(2.0), find_initial_block_size(256), find_maximum_block_size(8192), find_sequential_search_size(256), for_each_minimal_n(1000), generate_minimal_n(1000), max_element_minimal_n(1000), merge_minimal_n(1000), merge_oversampling(10), min_element_minimal_n(1000), multiway_merge_minimal_n(1000), multiway_merge_minimal_k(2), multiway_merge_oversampling(10), nth_element_minimal_n(1000), partition_chunk_size(1000), partition_chunk_share(0.0), partition_minimal_n(1000), partial_sort_minimal_n(1000), partial_sum_dilation(1.0f), partial_sum_minimal_n(1000), random_shuffle_minimal_n(1000), replace_minimal_n(1000), set_difference_minimal_n(1000), set_intersection_minimal_n(1000), set_symmetric_difference_minimal_n(1000), set_union_minimal_n(1000), sort_minimal_n(1000), sort_mwms_oversampling(10), sort_qs_num_samples_preset(100), sort_qsb_base_case_maximal_n(100), transform_minimal_n(1000), unique_copy_minimal_n(10000), workstealing_chunk_size(100), L1_cache_size(16 << 10), L2_cache_size(256 << 10), TLB_size(128), cache_line_size(64), qsb_steals(0)
+ { }
+ };
+}
+
+#endif /* _GLIBCXX_PARALLEL_SETTINGS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/sort.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/sort.h
new file mode 100644
index 0000000..de226e8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/sort.h
@@ -0,0 +1,229 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/sort.h
+ * @brief Parallel sorting algorithm switch.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler.
+
+#ifndef _GLIBCXX_PARALLEL_SORT_H
+#define _GLIBCXX_PARALLEL_SORT_H 1
+
+#include <parallel/basic_iterator.h>
+#include <parallel/features.h>
+#include <parallel/parallel.h>
+
+#if _GLIBCXX_ASSERTIONS
+#include <parallel/checkers.h>
+#endif
+
+#if _GLIBCXX_MERGESORT
+#include <parallel/multiway_mergesort.h>
+#endif
+
+#if _GLIBCXX_QUICKSORT
+#include <parallel/quicksort.h>
+#endif
+
+#if _GLIBCXX_BAL_QUICKSORT
+#include <parallel/balanced_quicksort.h>
+#endif
+
+namespace __gnu_parallel
+{
+ //prototype
+ template<bool stable, typename RandomAccessIterator,
+ typename Comparator, typename Parallelism>
+ void
+ parallel_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, Parallelism parallelism);
+
+ /**
+ * @brief Choose multiway mergesort, splitting variant at run-time,
+ * for parallel sorting.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param comp Comparator.
+ * @callgraph
+ */
+ template<bool stable, typename RandomAccessIterator, typename Comparator>
+ inline void
+ parallel_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, multiway_mergesort_tag parallelism)
+ {
+ _GLIBCXX_CALL(end - begin)
+
+ if(_Settings::get().sort_splitting == EXACT)
+ parallel_sort_mwms<stable, true>
+ (begin, end, comp, parallelism.get_num_threads());
+ else
+ parallel_sort_mwms<stable, false>
+ (begin, end, comp, parallelism.get_num_threads());
+ }
+
+ /**
+ * @brief Choose multiway mergesort with exact splitting,
+ * for parallel sorting.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param comp Comparator.
+ * @callgraph
+ */
+ template<bool stable, typename RandomAccessIterator, typename Comparator>
+ inline void
+ parallel_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, multiway_mergesort_exact_tag parallelism)
+ {
+ _GLIBCXX_CALL(end - begin)
+
+ parallel_sort_mwms<stable, true>
+ (begin, end, comp, parallelism.get_num_threads());
+ }
+
+ /**
+ * @brief Choose multiway mergesort with splitting by sampling,
+ * for parallel sorting.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param comp Comparator.
+ * @callgraph
+ */
+ template<bool stable, typename RandomAccessIterator, typename Comparator>
+ inline void
+ parallel_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, multiway_mergesort_sampling_tag parallelism)
+ {
+ _GLIBCXX_CALL(end - begin)
+
+ parallel_sort_mwms<stable, false>
+ (begin, end, comp, parallelism.get_num_threads());
+ }
+
+ /**
+ * @brief Choose quicksort for parallel sorting.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param comp Comparator.
+ * @callgraph
+ */
+ template<bool stable, typename RandomAccessIterator, typename Comparator>
+ inline void
+ parallel_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, quicksort_tag parallelism)
+ {
+ _GLIBCXX_CALL(end - begin)
+
+ _GLIBCXX_PARALLEL_ASSERT(stable == false);
+
+ parallel_sort_qs(begin, end, comp, parallelism.get_num_threads());
+ }
+
+ /**
+ * @brief Choose balanced quicksort for parallel sorting.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param comp Comparator.
+ * @param stable Sort stable.
+ * @callgraph
+ */
+ template<bool stable, typename RandomAccessIterator, typename Comparator>
+ inline void
+ parallel_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, balanced_quicksort_tag parallelism)
+ {
+ _GLIBCXX_CALL(end - begin)
+
+ _GLIBCXX_PARALLEL_ASSERT(stable == false);
+
+ parallel_sort_qsb(begin, end, comp, parallelism.get_num_threads());
+ }
+
+
+ /**
+ * @brief Choose multiway mergesort with exact splitting,
+ * for parallel sorting.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param comp Comparator.
+ * @callgraph
+ */
+ template<bool stable, typename RandomAccessIterator, typename Comparator>
+ inline void
+ parallel_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, default_parallel_tag parallelism)
+ {
+ _GLIBCXX_CALL(end - begin)
+
+ parallel_sort<stable>
+ (begin, end, comp,
+ multiway_mergesort_exact_tag(parallelism.get_num_threads()));
+ }
+
+
+ /**
+ * @brief Choose a parallel sorting algorithm.
+ * @param begin Begin iterator of input sequence.
+ * @param end End iterator of input sequence.
+ * @param comp Comparator.
+ * @param stable Sort stable.
+ * @callgraph
+ */
+ template<bool stable, typename RandomAccessIterator, typename Comparator>
+ inline void
+ parallel_sort(RandomAccessIterator begin, RandomAccessIterator end,
+ Comparator comp, parallel_tag parallelism)
+ {
+ _GLIBCXX_CALL(end - begin)
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ if (false) ;
+#if _GLIBCXX_MERGESORT
+ else if (stable || _Settings::get().sort_algorithm == MWMS)
+ {
+ if(_Settings::get().sort_splitting == EXACT)
+ parallel_sort_mwms<stable, true>
+ (begin, end, comp, parallelism.get_num_threads());
+ else
+ parallel_sort_mwms<false, false>
+ (begin, end, comp, parallelism.get_num_threads());
+ }
+#endif
+#if _GLIBCXX_QUICKSORT
+ else if (_Settings::get().sort_algorithm == QS)
+ parallel_sort_qs(begin, end, comp, parallelism.get_num_threads());
+#endif
+#if _GLIBCXX_BAL_QUICKSORT
+ else if (_Settings::get().sort_algorithm == QS_BALANCED)
+ parallel_sort_qsb(begin, end, comp, parallelism.get_num_threads());
+#endif
+ else
+ __gnu_sequential::sort(begin, end, comp);
+ }
+} // end namespace __gnu_parallel
+
+#endif /* _GLIBCXX_PARALLEL_SORT_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/tags.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/tags.h
new file mode 100644
index 0000000..bc1a7e5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/tags.h
@@ -0,0 +1,191 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/**
+ * @file parallel/tags.h
+ * @brief Tags for compile-time selection.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler and Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_TAGS_H
+#define _GLIBCXX_PARALLEL_TAGS_H 1
+
+#include <omp.h>
+#include <parallel/types.h>
+
+namespace __gnu_parallel
+{
+ /** @brief Forces sequential execution at compile time. */
+ struct sequential_tag { };
+
+ /** @brief Recommends parallel execution at compile time,
+ * optionally using a user-specified number of threads. */
+ struct parallel_tag
+ {
+ private:
+ thread_index_t num_threads;
+
+ public:
+ /** @brief Default constructor. Use default number of threads. */
+ parallel_tag()
+ {
+ this->num_threads = 0;
+ }
+
+ /** @brief Default constructor. Recommend number of threads to use.
+ * @param num_threads Desired number of threads. */
+ parallel_tag(thread_index_t num_threads)
+ {
+ this->num_threads = num_threads;
+ }
+
+ /** @brief Find out desired number of threads.
+ * @return Desired number of threads. */
+ inline thread_index_t get_num_threads()
+ {
+ if(num_threads == 0)
+ return omp_get_max_threads();
+ else
+ return num_threads;
+ }
+
+ /** @brief Set the desired number of threads.
+ * @param num_threads Desired number of threads. */
+ inline void set_num_threads(thread_index_t num_threads)
+ {
+ this->num_threads = num_threads;
+ }
+ };
+
+ /** @brief Recommends parallel execution using the
+ default parallel algorithm. */
+ struct default_parallel_tag : public parallel_tag
+ {
+ default_parallel_tag() { }
+ default_parallel_tag(thread_index_t num_threads)
+ : parallel_tag(num_threads) { }
+ };
+
+ /** @brief Recommends parallel execution using dynamic
+ load-balancing at compile time. */
+ struct balanced_tag : public parallel_tag { };
+
+ /** @brief Recommends parallel execution using static
+ load-balancing at compile time. */
+ struct unbalanced_tag : public parallel_tag { };
+
+ /** @brief Recommends parallel execution using OpenMP dynamic
+ load-balancing at compile time. */
+ struct omp_loop_tag : public parallel_tag { };
+
+ /** @brief Recommends parallel execution using OpenMP static
+ load-balancing at compile time. */
+ struct omp_loop_static_tag : public parallel_tag { };
+
+
+ /** @brief Base class for for std::find() variants. */
+ struct find_tag { };
+
+
+ /** @brief Forces parallel merging
+ * with exact splitting, at compile time. */
+ struct exact_tag : public parallel_tag
+ {
+ exact_tag() { }
+ exact_tag(thread_index_t num_threads)
+ : parallel_tag(num_threads) { }
+ };
+
+ /** @brief Forces parallel merging
+ * with exact splitting, at compile time. */
+ struct sampling_tag : public parallel_tag
+ {
+ sampling_tag() { }
+ sampling_tag(thread_index_t num_threads)
+ : parallel_tag(num_threads) { }
+ };
+
+
+ /** @brief Forces parallel sorting using multiway mergesort
+ * at compile time. */
+ struct multiway_mergesort_tag : public parallel_tag
+ {
+ multiway_mergesort_tag() { }
+ multiway_mergesort_tag(thread_index_t num_threads)
+ : parallel_tag(num_threads) { }
+ };
+
+ /** @brief Forces parallel sorting using multiway mergesort
+ * with exact splitting at compile time. */
+ struct multiway_mergesort_exact_tag : public parallel_tag
+ {
+ multiway_mergesort_exact_tag() { }
+ multiway_mergesort_exact_tag(thread_index_t num_threads)
+ : parallel_tag(num_threads) { }
+ };
+
+ /** @brief Forces parallel sorting using multiway mergesort
+ * with splitting by sampling at compile time. */
+ struct multiway_mergesort_sampling_tag : public parallel_tag
+ {
+ multiway_mergesort_sampling_tag() { }
+ multiway_mergesort_sampling_tag(thread_index_t num_threads)
+ : parallel_tag(num_threads) { }
+ };
+
+ /** @brief Forces parallel sorting using unbalanced quicksort
+ * at compile time. */
+ struct quicksort_tag : public parallel_tag
+ {
+ quicksort_tag() { }
+ quicksort_tag(thread_index_t num_threads)
+ : parallel_tag(num_threads) { }
+ };
+
+ /** @brief Forces parallel sorting using balanced quicksort
+ * at compile time. */
+ struct balanced_quicksort_tag : public parallel_tag
+ {
+ balanced_quicksort_tag() { }
+ balanced_quicksort_tag(thread_index_t num_threads)
+ : parallel_tag(num_threads) { }
+ };
+
+
+ /** @brief Selects the growing block size variant for std::find().
+ @see _GLIBCXX_FIND_GROWING_BLOCKS */
+ struct growing_blocks_tag : public find_tag { };
+
+ /** @brief Selects the constant block size variant for std::find().
+ @see _GLIBCXX_FIND_CONSTANT_SIZE_BLOCKS */
+ struct constant_size_blocks_tag : public find_tag { };
+
+ /** @brief Selects the equal splitting variant for std::find().
+ @see _GLIBCXX_FIND_EQUAL_SPLIT */
+ struct equal_split_tag : public find_tag { };
+}
+
+#endif /* _GLIBCXX_PARALLEL_TAGS_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/types.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/types.h
new file mode 100644
index 0000000..053dfff
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/types.h
@@ -0,0 +1,155 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/types.h
+ * @brief Basic types and typedefs.
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Johannes Singler and Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_TYPES_H
+#define _GLIBCXX_PARALLEL_TYPES_H 1
+
+#include <cstdlib>
+
+namespace __gnu_parallel
+{
+ // Enumerated types.
+
+ /// Run-time equivalents for the compile-time tags.
+ enum _Parallelism
+ {
+ /// Not parallel.
+ sequential,
+
+ /// Parallel unbalanced (equal-sized chunks).
+ parallel_unbalanced,
+
+ /// Parallel balanced (work-stealing).
+ parallel_balanced,
+
+ /// Parallel with OpenMP dynamic load-balancing.
+ parallel_omp_loop,
+
+ /// Parallel with OpenMP static load-balancing.
+ parallel_omp_loop_static,
+
+ /// Parallel with OpenMP taskqueue construct.
+ parallel_taskqueue
+ };
+
+ /// Strategies for run-time algorithm selection:
+ // force_sequential, force_parallel, heuristic.
+ enum _AlgorithmStrategy
+ {
+ heuristic,
+ force_sequential,
+ force_parallel
+ };
+
+ /// Sorting algorithms:
+ // multi-way mergesort, quicksort, load-balanced quicksort.
+ enum _SortAlgorithm
+ {
+ MWMS,
+ QS,
+ QS_BALANCED
+ };
+
+ /// Merging algorithms:
+ // bubblesort-alike, loser-tree variants, enum sentinel.
+ enum _MultiwayMergeAlgorithm
+ {
+ LOSER_TREE
+ };
+
+ /// Partial sum algorithms: recursive, linear.
+ enum _PartialSumAlgorithm
+ {
+ RECURSIVE,
+ LINEAR
+ };
+
+ /// Sorting/merging algorithms: sampling, exact.
+ enum _SplittingAlgorithm
+ {
+ SAMPLING,
+ EXACT
+ };
+
+ /// Find algorithms:
+ // growing blocks, equal-sized blocks, equal splitting.
+ enum _FindAlgorithm
+ {
+ GROWING_BLOCKS,
+ CONSTANT_SIZE_BLOCKS,
+ EQUAL_SPLIT
+ };
+
+ /// Integer Types.
+ // XXX need to use <cstdint>
+ /** @brief 16-bit signed integer. */
+ typedef short int16;
+
+ /** @brief 16-bit unsigned integer. */
+ typedef unsigned short uint16;
+
+ /** @brief 32-bit signed integer. */
+ typedef int int32;
+
+ /** @brief 32-bit unsigned integer. */
+ typedef unsigned int uint32;
+
+ /** @brief 64-bit signed integer. */
+ typedef long long int64;
+
+ /** @brief 64-bit unsigned integer. */
+ typedef unsigned long long uint64;
+
+ /**
+ * @brief Unsigned integer to index elements.
+ * The total number of elements for each algorithm must fit into this type.
+ */
+ typedef uint64 sequence_index_t;
+
+ /**
+ * @brief Unsigned integer to index a thread number.
+ * The maximum thread number (for each processor) must fit into this type.
+ */
+ typedef uint16 thread_index_t;
+
+ // XXX atomics interface?
+ /// Longest compare-and-swappable integer type on this platform.
+ typedef int64 lcas_t;
+
+ // XXX numeric_limits::digits?
+ /// Number of bits of ::lcas_t.
+ static const int lcas_t_bits = sizeof(lcas_t) * 8;
+
+ /// ::lcas_t with the right half of bits set to 1.
+ static const lcas_t lcas_t_mask = ((lcas_t(1) << (lcas_t_bits / 2)) - 1);
+}
+
+#endif /* _GLIBCXX_PARALLEL_TYPES_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/unique_copy.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/unique_copy.h
new file mode 100644
index 0000000..a83c2c0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/unique_copy.h
@@ -0,0 +1,192 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/unique_copy.h
+ * @brief Parallel implementations of std::unique_copy().
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Robert Geisberger and Robin Dapp.
+
+#ifndef _GLIBCXX_PARALLEL_UNIQUE_COPY_H
+#define _GLIBCXX_PARALLEL_UNIQUE_COPY_H 1
+
+#include <parallel/parallel.h>
+#include <parallel/multiseq_selection.h>
+
+namespace __gnu_parallel
+{
+
+/** @brief Parallel std::unique_copy(), w/o explicit equality predicate.
+ * @param first Begin iterator of input sequence.
+ * @param last End iterator of input sequence.
+ * @param result Begin iterator of result sequence.
+ * @param binary_pred Equality predicate.
+ * @return End iterator of result sequence. */
+template<typename InputIterator,
+ class OutputIterator,
+ class BinaryPredicate>
+ OutputIterator
+ parallel_unique_copy(InputIterator first, InputIterator last,
+ OutputIterator result, BinaryPredicate binary_pred)
+ {
+ _GLIBCXX_CALL(last - first)
+
+ typedef std::iterator_traits<InputIterator> traits_type;
+ typedef typename traits_type::value_type value_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ difference_type size = last - first;
+
+ if (size == 0)
+ return result;
+
+ // Let the first thread process two parts.
+ difference_type *counter;
+ difference_type *borders;
+
+ thread_index_t num_threads = get_max_threads();
+ // First part contains at least one element.
+# pragma omp parallel num_threads(num_threads)
+ {
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+ borders = new difference_type[num_threads + 2];
+ equally_split(size, num_threads + 1, borders);
+ counter = new difference_type[num_threads + 1];
+ }
+
+ thread_index_t iam = omp_get_thread_num();
+
+ difference_type begin, end;
+
+ // Check for length without duplicates
+ // Needed for position in output
+ difference_type i = 0;
+ OutputIterator out = result;
+
+ if (iam == 0)
+ {
+ begin = borders[0] + 1; // == 1
+ end = borders[iam + 1];
+
+ ++i;
+ *out++ = *first;
+
+ for (InputIterator iter = first + begin; iter < first + end; ++iter)
+ {
+ if (!binary_pred(*iter, *(iter-1)))
+ {
+ ++i;
+ *out++ = *iter;
+ }
+ }
+ }
+ else
+ {
+ begin = borders[iam]; //one part
+ end = borders[iam + 1];
+
+ for (InputIterator iter = first + begin; iter < first + end; ++iter)
+ {
+ if (!binary_pred(*iter, *(iter - 1)))
+ ++i;
+ }
+ }
+ counter[iam] = i;
+
+ // Last part still untouched.
+ difference_type begin_output;
+
+# pragma omp barrier
+
+ // Store result in output on calculated positions.
+ begin_output = 0;
+
+ if (iam == 0)
+ {
+ for (int t = 0; t < num_threads; ++t)
+ begin_output += counter[t];
+
+ i = 0;
+
+ OutputIterator iter_out = result + begin_output;
+
+ begin = borders[num_threads];
+ end = size;
+
+ for (InputIterator iter = first + begin; iter < first + end; ++iter)
+ {
+ if (iter == first || !binary_pred(*iter, *(iter - 1)))
+ {
+ ++i;
+ *iter_out++ = *iter;
+ }
+ }
+
+ counter[num_threads] = i;
+ }
+ else
+ {
+ for (int t = 0; t < iam; t++)
+ begin_output += counter[t];
+
+ OutputIterator iter_out = result + begin_output;
+ for (InputIterator iter = first + begin; iter < first + end; ++iter)
+ {
+ if (!binary_pred(*iter, *(iter-1)))
+ *iter_out++ = *iter;
+ }
+ }
+ }
+
+ difference_type end_output = 0;
+ for (int t = 0; t < num_threads + 1; t++)
+ end_output += counter[t];
+
+ delete[] borders;
+
+ return result + end_output;
+ }
+
+/** @brief Parallel std::unique_copy(), without explicit equality predicate
+ * @param first Begin iterator of input sequence.
+ * @param last End iterator of input sequence.
+ * @param result Begin iterator of result sequence.
+ * @return End iterator of result sequence. */
+template<typename InputIterator, class OutputIterator>
+ inline OutputIterator
+ parallel_unique_copy(InputIterator first, InputIterator last,
+ OutputIterator result)
+ {
+ typedef typename std::iterator_traits<InputIterator>::value_type
+ value_type;
+ return parallel_unique_copy(first, last, result,
+ std::equal_to<value_type>());
+ }
+
+}//namespace __gnu_parallel
+
+#endif /* _GLIBCXX_PARALLEL_UNIQUE_COPY_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/workstealing.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/workstealing.h
new file mode 100644
index 0000000..b82fe7c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/parallel/workstealing.h
@@ -0,0 +1,306 @@
+// -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License as published by the Free Software
+// Foundation; either version 3, or (at your option) any later
+// version.
+
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file parallel/workstealing.h
+ * @brief Parallelization of embarrassingly parallel execution by
+ * means of work-stealing.
+ *
+ * Work stealing is described in
+ *
+ * R. D. Blumofe and C. E. Leiserson.
+ * Scheduling multithreaded computations by work stealing.
+ * Journal of the ACM, 46(5):720–748, 1999.
+ *
+ * This file is a GNU parallel extension to the Standard C++ Library.
+ */
+
+// Written by Felix Putze.
+
+#ifndef _GLIBCXX_PARALLEL_WORKSTEALING_H
+#define _GLIBCXX_PARALLEL_WORKSTEALING_H 1
+
+#include <parallel/parallel.h>
+#include <parallel/random_number.h>
+#include <parallel/compatibility.h>
+
+namespace __gnu_parallel
+{
+
+#define _GLIBCXX_JOB_VOLATILE volatile
+
+/** @brief One job for a certain thread. */
+template<typename _DifferenceTp>
+ struct Job
+ {
+ typedef _DifferenceTp difference_type;
+
+ /** @brief First element.
+ *
+ * Changed by owning and stealing thread. By stealing thread,
+ * always incremented. */
+ _GLIBCXX_JOB_VOLATILE difference_type first;
+
+ /** @brief Last element.
+ *
+ * Changed by owning thread only. */
+ _GLIBCXX_JOB_VOLATILE difference_type last;
+
+ /** @brief Number of elements, i. e. @c last-first+1.
+ *
+ * Changed by owning thread only. */
+ _GLIBCXX_JOB_VOLATILE difference_type load;
+ };
+
+/** @brief Work stealing algorithm for random access iterators.
+ *
+ * Uses O(1) additional memory. Synchronization at job lists is
+ * done with atomic operations.
+ * @param begin Begin iterator of element sequence.
+ * @param end End iterator of element sequence.
+ * @param op User-supplied functor (comparator, predicate, adding
+ * functor, ...).
+ * @param f Functor to "process" an element with op (depends on
+ * desired functionality, e. g. for std::for_each(), ...).
+ * @param r Functor to "add" a single result to the already
+ * processed elements (depends on functionality).
+ * @param base Base value for reduction.
+ * @param output Pointer to position where final result is written to
+ * @param bound Maximum number of elements processed (e. g. for
+ * std::count_n()).
+ * @return User-supplied functor (that may contain a part of the result).
+ */
+template<typename RandomAccessIterator,
+ typename Op,
+ typename Fu,
+ typename Red,
+ typename Result>
+ Op
+ for_each_template_random_access_workstealing(RandomAccessIterator begin,
+ RandomAccessIterator end,
+ Op op, Fu& f, Red r,
+ Result base, Result& output,
+ typename std::iterator_traits
+ <RandomAccessIterator>::
+ difference_type bound)
+ {
+ _GLIBCXX_CALL(end - begin)
+
+ typedef std::iterator_traits<RandomAccessIterator> traits_type;
+ typedef typename traits_type::difference_type difference_type;
+
+ const _Settings& __s = _Settings::get();
+
+ difference_type chunk_size = static_cast<difference_type>(__s.workstealing_chunk_size);
+
+ // How many jobs?
+ difference_type length = (bound < 0) ? (end - begin) : bound;
+
+ // To avoid false sharing in a cache line.
+ const int stride = __s.cache_line_size * 10 / sizeof(Job<difference_type>) + 1;
+
+ // Total number of threads currently working.
+ thread_index_t busy = 0;
+
+ Job<difference_type> *job;
+
+ omp_lock_t output_lock;
+ omp_init_lock(&output_lock);
+
+ // Write base value to output.
+ output = base;
+
+ // No more threads than jobs, at least one thread.
+ thread_index_t num_threads =
+ __gnu_parallel::max<thread_index_t>(1,
+ __gnu_parallel::min<difference_type>(length, get_max_threads()));
+
+# pragma omp parallel shared(busy) num_threads(num_threads)
+ {
+
+# pragma omp single
+ {
+ num_threads = omp_get_num_threads();
+
+ // Create job description array.
+ job = new Job<difference_type>[num_threads * stride];
+ }
+
+ // Initialization phase.
+
+ // Flags for every thread if it is doing productive work.
+ bool iam_working = false;
+
+ // Thread id.
+ thread_index_t iam = omp_get_thread_num();
+
+ // This job.
+ Job<difference_type>& my_job = job[iam * stride];
+
+ // Random number (for work stealing).
+ thread_index_t victim;
+
+ // Local value for reduction.
+ Result result = Result();
+
+ // Number of elements to steal in one attempt.
+ difference_type steal;
+
+ // Every thread has its own random number generator
+ // (modulo num_threads).
+ random_number rand_gen(iam, num_threads);
+
+ // This thread is currently working.
+# pragma omp atomic
+ ++busy;
+
+ iam_working = true;
+
+ // How many jobs per thread? last thread gets the rest.
+ my_job.first =
+ static_cast<difference_type>(iam * (length / num_threads));
+
+ my_job.last = (iam == (num_threads - 1)) ?
+ (length - 1) : ((iam + 1) * (length / num_threads) - 1);
+ my_job.load = my_job.last - my_job.first + 1;
+
+ // Init result with first value (to have a base value for reduction).
+ if (my_job.first <= my_job.last)
+ {
+ // Cannot use volatile variable directly.
+ difference_type my_first = my_job.first;
+ result = f(op, begin + my_first);
+ ++my_job.first;
+ --my_job.load;
+ }
+
+ RandomAccessIterator current;
+
+# pragma omp barrier
+
+ // Actual work phase
+ // Work on own or stolen start
+ while (busy > 0)
+ {
+ // Work until no productive thread left.
+# pragma omp flush(busy)
+
+ // Thread has own work to do
+ while (my_job.first <= my_job.last)
+ {
+ // fetch-and-add call
+ // Reserve current job block (size chunk_size) in my queue.
+ difference_type current_job =
+ fetch_and_add<difference_type>(&(my_job.first), chunk_size);
+
+ // Update load, to make the three values consistent,
+ // first might have been changed in the meantime
+ my_job.load = my_job.last - my_job.first + 1;
+ for (difference_type job_counter = 0;
+ job_counter < chunk_size && current_job <= my_job.last;
+ ++job_counter)
+ {
+ // Yes: process it!
+ current = begin + current_job;
+ ++current_job;
+
+ // Do actual work.
+ result = r(result, f(op, current));
+ }
+
+# pragma omp flush(busy)
+ }
+
+ // After reaching this point, a thread's job list is empty.
+ if (iam_working)
+ {
+ // This thread no longer has work.
+# pragma omp atomic
+ --busy;
+
+ iam_working = false;
+ }
+
+ difference_type supposed_first, supposed_last, supposed_load;
+ do
+ {
+ // Find random nonempty deque (not own), do consistency check.
+ yield();
+# pragma omp flush(busy)
+ victim = rand_gen();
+ supposed_first = job[victim * stride].first;
+ supposed_last = job[victim * stride].last;
+ supposed_load = job[victim * stride].load;
+ }
+ while (busy > 0
+ && ((supposed_load <= 0)
+ || ((supposed_first + supposed_load - 1) != supposed_last)));
+
+ if (busy == 0)
+ break;
+
+ if (supposed_load > 0)
+ {
+ // Has work and work to do.
+ // Number of elements to steal (at least one).
+ steal = (supposed_load < 2) ? 1 : supposed_load / 2;
+
+ // Push victim's start forward.
+ difference_type stolen_first =
+ fetch_and_add<difference_type>(
+ &(job[victim * stride].first), steal);
+ difference_type stolen_try =
+ stolen_first + steal - difference_type(1);
+
+ my_job.first = stolen_first;
+ my_job.last = __gnu_parallel::min(stolen_try, supposed_last);
+ my_job.load = my_job.last - my_job.first + 1;
+
+ // Has potential work again.
+# pragma omp atomic
+ ++busy;
+ iam_working = true;
+
+# pragma omp flush(busy)
+ }
+# pragma omp flush(busy)
+ } // end while busy > 0
+ // Add accumulated result to output.
+ omp_set_lock(&output_lock);
+ output = r(output, result);
+ omp_unset_lock(&output_lock);
+ }
+
+ delete[] job;
+
+ // Points to last element processed (needed as return value for
+ // some algorithms like transform)
+ f.finish_iterator = begin + length;
+
+ omp_destroy_lock(&output_lock);
+
+ return op;
+ }
+} // end namespace
+
+#endif /* _GLIBCXX_PARALLEL_WORKSTEALING_H */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/queue b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/queue
new file mode 100644
index 0000000..abf9842
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/queue
@@ -0,0 +1,67 @@
+// <queue> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/queue
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_QUEUE
+#define _GLIBCXX_QUEUE 1
+
+#pragma GCC system_header
+
+#include <deque>
+#include <vector>
+#include <bits/stl_heap.h>
+#include <bits/stl_function.h>
+#include <bits/stl_queue.h>
+
+#endif /* _GLIBCXX_QUEUE */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/random b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/random
new file mode 100644
index 0000000..1cb968c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/random
@@ -0,0 +1,70 @@
+// <random> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/random
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_RANDOM
+#define _GLIBCXX_RANDOM 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <cmath>
+#include <cstdio>
+#include <cstdlib>
+#include <string>
+#include <iosfwd>
+#include <limits>
+#include <ext/type_traits.h>
+#include <ext/numeric_traits.h>
+#include <bits/concept_check.h>
+#include <debug/debug.h>
+#include <type_traits>
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/random>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/random>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_RANDOM
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ratio b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ratio
new file mode 100644
index 0000000..f0e8831
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/ratio
@@ -0,0 +1,303 @@
+// ratio -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ratio
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_RATIO
+#define _GLIBCXX_RATIO 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#include <type_traits>
+#include <cstdint>
+
+#ifdef _GLIBCXX_USE_C99_STDINT_TR1
+
+namespace std
+{
+ /**
+ * @defgroup ratio Rational Arithmetic
+ * @ingroup utilities
+ *
+ * Compile time representation of fininte rational numbers.
+ * @{
+ */
+
+ template<intmax_t _Pn>
+ struct __static_sign
+ : integral_constant<intmax_t, (_Pn < 0) ? -1 : 1>
+ { };
+
+ template<intmax_t _Pn>
+ struct __static_abs
+ : integral_constant<intmax_t, _Pn * __static_sign<_Pn>::value>
+ { };
+
+ template<intmax_t _Pn, intmax_t _Qn>
+ struct __static_gcd;
+
+ template<intmax_t _Pn, intmax_t _Qn>
+ struct __static_gcd
+ : __static_gcd<_Qn, (_Pn % _Qn)>
+ { };
+
+ template<intmax_t _Pn>
+ struct __static_gcd<_Pn, 0>
+ : integral_constant<intmax_t, __static_abs<_Pn>::value>
+ { };
+
+ template<intmax_t _Qn>
+ struct __static_gcd<0, _Qn>
+ : integral_constant<intmax_t, __static_abs<_Qn>::value>
+ { };
+
+ // Let c = 2^(half # of bits in an intmax_t)
+ // then we find a1, a0, b1, b0 s.t. N = a1*c + a0, M = b1*c + b0
+ // The multiplication of N and M becomes,
+ // N * M = (a1 * b1)c^2 + (a0 * b1 + b0 * a1)c + a0 * b0
+ // Multiplication is safe if each term and the sum of the terms
+ // is representable by intmax_t.
+ template<intmax_t _Pn, intmax_t _Qn>
+ struct __safe_multiply
+ {
+ private:
+ static const uintmax_t __c = uintmax_t(1) << (sizeof(intmax_t) * 4);
+
+ static const uintmax_t __a0 = __static_abs<_Pn>::value % __c;
+ static const uintmax_t __a1 = __static_abs<_Pn>::value / __c;
+ static const uintmax_t __b0 = __static_abs<_Qn>::value % __c;
+ static const uintmax_t __b1 = __static_abs<_Qn>::value / __c;
+
+ static_assert(__a1 == 0 || __b1 == 0,
+ "overflow in multiplication");
+ static_assert(__a0 * __b1 + __b0 * __a1 < (__c >> 1),
+ "overflow in multiplication");
+ static_assert(__b0 * __a0 <= __INTMAX_MAX__,
+ "overflow in multiplication");
+ static_assert((__a0 * __b1 + __b0 * __a1) * __c <=
+ __INTMAX_MAX__ - __b0 * __a0, "overflow in multiplication");
+
+ public:
+ static const intmax_t value = _Pn * _Qn;
+ };
+
+ // Helpers for __safe_add
+ template<intmax_t _Pn, intmax_t _Qn, bool>
+ struct __add_overflow_check_impl
+ : integral_constant<bool, (_Pn <= __INTMAX_MAX__ - _Qn)>
+ { };
+
+ template<intmax_t _Pn, intmax_t _Qn>
+ struct __add_overflow_check_impl<_Pn, _Qn, false>
+ : integral_constant<bool, (_Pn >= -__INTMAX_MAX__ - _Qn)>
+ { };
+
+ template<intmax_t _Pn, intmax_t _Qn>
+ struct __add_overflow_check
+ : __add_overflow_check_impl<_Pn, _Qn, (_Qn >= 0)>
+ { };
+
+ template<intmax_t _Pn, intmax_t _Qn>
+ struct __safe_add
+ {
+ static_assert(__add_overflow_check<_Pn, _Qn>::value != 0,
+ "overflow in addition");
+
+ static const intmax_t value = _Pn + _Qn;
+ };
+
+ /**
+ * @brief Provides compile-time rational arithmetic.
+ *
+ * This class template represents any finite rational number with a
+ * numerator and denominator representable by compile-time constants of
+ * type intmax_t. The ratio is simplified when instantiated.
+ *
+ * For example:
+ * @code
+ * std::ratio<7,-21>::num == -1;
+ * std::ratio<7,-21>::den == 3;
+ * @endcode
+ *
+ */
+ template<intmax_t _Num, intmax_t _Den = 1>
+ struct ratio
+ {
+ static_assert(_Den != 0, "denominator cannot be zero");
+ static_assert(_Num >= -__INTMAX_MAX__ && _Den >= -__INTMAX_MAX__,
+ "out of range");
+
+ // Note: sign(N) * abs(N) == N
+ static const intmax_t num =
+ _Num * __static_sign<_Den>::value / __static_gcd<_Num, _Den>::value;
+
+ static const intmax_t den =
+ __static_abs<_Den>::value / __static_gcd<_Num, _Den>::value;
+ };
+
+ template<intmax_t _Num, intmax_t _Den>
+ const intmax_t ratio<_Num, _Den>::num;
+
+ template<intmax_t _Num, intmax_t _Den>
+ const intmax_t ratio<_Num, _Den>::den;
+
+ /// ratio_add
+ template<typename _R1, typename _R2>
+ struct ratio_add
+ {
+ private:
+ static const intmax_t __gcd =
+ __static_gcd<_R1::den, _R2::den>::value;
+
+ public:
+ typedef ratio<
+ __safe_add<
+ __safe_multiply<_R1::num, (_R2::den / __gcd)>::value,
+ __safe_multiply<_R2::num, (_R1::den / __gcd)>::value>::value,
+ __safe_multiply<_R1::den, (_R2::den / __gcd)>::value> type;
+ };
+
+ /// ratio_subtract
+ template<typename _R1, typename _R2>
+ struct ratio_subtract
+ {
+ typedef typename ratio_add<
+ _R1,
+ ratio<-_R2::num, _R2::den>>::type type;
+ };
+
+ /// ratio_multiply
+ template<typename _R1, typename _R2>
+ struct ratio_multiply
+ {
+ private:
+ static const intmax_t __gcd1 =
+ __static_gcd<_R1::num, _R2::den>::value;
+ static const intmax_t __gcd2 =
+ __static_gcd<_R2::num, _R1::den>::value;
+
+ public:
+ typedef ratio<
+ __safe_multiply<(_R1::num / __gcd1),
+ (_R2::num / __gcd2)>::value,
+ __safe_multiply<(_R1::den / __gcd2),
+ (_R2::den / __gcd1)>::value> type;
+ };
+
+ /// ratio_divide
+ template<typename _R1, typename _R2>
+ struct ratio_divide
+ {
+ static_assert(_R2::num != 0, "division by 0");
+
+ typedef typename ratio_multiply<
+ _R1,
+ ratio<_R2::den, _R2::num>>::type type;
+ };
+
+ /// ratio_equal
+ template<typename _R1, typename _R2>
+ struct ratio_equal
+ : integral_constant<bool, _R1::num == _R2::num && _R1::den == _R2::den>
+ { };
+
+ /// ratio_not_equal
+ template<typename _R1, typename _R2>
+ struct ratio_not_equal
+ : integral_constant<bool, !ratio_equal<_R1, _R2>::value>
+ { };
+
+ template<typename _R1, typename _R2>
+ struct __ratio_less_simple_impl
+ : integral_constant<bool,
+ (__safe_multiply<_R1::num, _R2::den>::value
+ < __safe_multiply<_R2::num, _R1::den>::value)>
+ { };
+
+ // If the denominators are equal or the signs differ, we can just compare
+ // numerators, otherwise fallback to the simple cross-multiply method.
+ template<typename _R1, typename _R2>
+ struct __ratio_less_impl
+ : conditional<(_R1::den == _R2::den
+ || (__static_sign<_R1::num>::value
+ != __static_sign<_R2::num>::value)),
+ integral_constant<bool, (_R1::num < _R2::num)>,
+ __ratio_less_simple_impl<_R1, _R2>>::type
+ { };
+
+ /// ratio_less
+ template<typename _R1, typename _R2>
+ struct ratio_less
+ : __ratio_less_impl<_R1, _R2>::type
+ { };
+
+ /// ratio_less_equal
+ template<typename _R1, typename _R2>
+ struct ratio_less_equal
+ : integral_constant<bool, !ratio_less<_R2, _R1>::value>
+ { };
+
+ /// ratio_greater
+ template<typename _R1, typename _R2>
+ struct ratio_greater
+ : integral_constant<bool, ratio_less<_R2, _R1>::value>
+ { };
+
+ /// ratio_greater_equal
+ template<typename _R1, typename _R2>
+ struct ratio_greater_equal
+ : integral_constant<bool, !ratio_less<_R1, _R2>::value>
+ { };
+
+ typedef ratio<1, 1000000000000000000> atto;
+ typedef ratio<1, 1000000000000000> femto;
+ typedef ratio<1, 1000000000000> pico;
+ typedef ratio<1, 1000000000> nano;
+ typedef ratio<1, 1000000> micro;
+ typedef ratio<1, 1000> milli;
+ typedef ratio<1, 100> centi;
+ typedef ratio<1, 10> deci;
+ typedef ratio< 10, 1> deca;
+ typedef ratio< 100, 1> hecto;
+ typedef ratio< 1000, 1> kilo;
+ typedef ratio< 1000000, 1> mega;
+ typedef ratio< 1000000000, 1> giga;
+ typedef ratio< 1000000000000, 1> tera;
+ typedef ratio< 1000000000000000, 1> peta;
+ typedef ratio< 1000000000000000000, 1> exa;
+
+ // @} group ratio
+}
+
+#endif //_GLIBCXX_USE_C99_STDINT_TR1
+
+#endif //__GXX_EXPERIMENTAL_CXX0X__
+
+#endif //_GLIBCXX_RATIO
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/regex b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/regex
new file mode 100644
index 0000000..3b25044
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/regex
@@ -0,0 +1,68 @@
+// <regex> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/regex
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_REGEX
+#define _GLIBCXX_REGEX 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <algorithm>
+#include <bitset>
+#include <iterator>
+#include <locale>
+#include <stdexcept>
+#include <string>
+#include <vector>
+#include <utility>
+#include <sstream>
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/regex>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/regex>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_REGEX
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/set b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/set
new file mode 100644
index 0000000..21e3f5a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/set
@@ -0,0 +1,68 @@
+// <set> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/set
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_SET
+#define _GLIBCXX_SET 1
+
+#pragma GCC system_header
+
+#include <bits/stl_tree.h>
+#include <bits/stl_set.h>
+#include <bits/stl_multiset.h>
+
+#ifdef _GLIBCXX_DEBUG
+# include <debug/set>
+#endif
+
+#endif /* _GLIBCXX_SET */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/sstream b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/sstream
new file mode 100644
index 0000000..f5e3191
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/sstream
@@ -0,0 +1,576 @@
+// String based streams -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file sstream
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 14882: 27.7 String-based streams
+//
+
+#ifndef _GLIBCXX_SSTREAM
+#define _GLIBCXX_SSTREAM 1
+
+#pragma GCC system_header
+
+#include <istream>
+#include <ostream>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ // [27.7.1] template class basic_stringbuf
+ /**
+ * @brief The actual work of input and output (for std::string).
+ * @ingroup io
+ *
+ * This class associates either or both of its input and output sequences
+ * with a sequence of characters, which can be initialized from, or made
+ * available as, a @c std::basic_string. (Paraphrased from [27.7.1]/1.)
+ *
+ * For this class, open modes (of type @c ios_base::openmode) have
+ * @c in set if the input sequence can be read, and @c out set if the
+ * output sequence can be written.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ class basic_stringbuf : public basic_streambuf<_CharT, _Traits>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 251. basic_stringbuf missing allocator_type
+ typedef _Alloc allocator_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+
+ typedef basic_streambuf<char_type, traits_type> __streambuf_type;
+ typedef basic_string<char_type, _Traits, _Alloc> __string_type;
+ typedef typename __string_type::size_type __size_type;
+
+ protected:
+ /// Place to stash in || out || in | out settings for current stringbuf.
+ ios_base::openmode _M_mode;
+
+ // Data Members:
+ __string_type _M_string;
+
+ public:
+ // Constructors:
+ /**
+ * @brief Starts with an empty string buffer.
+ * @param mode Whether the buffer can read, or write, or both.
+ *
+ * The default constructor initializes the parent class using its
+ * own default ctor.
+ */
+ explicit
+ basic_stringbuf(ios_base::openmode __mode = ios_base::in | ios_base::out)
+ : __streambuf_type(), _M_mode(__mode), _M_string()
+ { }
+
+ /**
+ * @brief Starts with an existing string buffer.
+ * @param str A string to copy as a starting buffer.
+ * @param mode Whether the buffer can read, or write, or both.
+ *
+ * This constructor initializes the parent class using its
+ * own default ctor.
+ */
+ explicit
+ basic_stringbuf(const __string_type& __str,
+ ios_base::openmode __mode = ios_base::in | ios_base::out)
+ : __streambuf_type(), _M_mode(), _M_string(__str.data(), __str.size())
+ { _M_stringbuf_init(__mode); }
+
+ // Get and set:
+ /**
+ * @brief Copying out the string buffer.
+ * @return A copy of one of the underlying sequences.
+ *
+ * "If the buffer is only created in input mode, the underlying
+ * character sequence is equal to the input sequence; otherwise, it
+ * is equal to the output sequence." [27.7.1.2]/1
+ */
+ __string_type
+ str() const
+ {
+ __string_type __ret;
+ if (this->pptr())
+ {
+ // The current egptr() may not be the actual string end.
+ if (this->pptr() > this->egptr())
+ __ret = __string_type(this->pbase(), this->pptr());
+ else
+ __ret = __string_type(this->pbase(), this->egptr());
+ }
+ else
+ __ret = _M_string;
+ return __ret;
+ }
+
+ /**
+ * @brief Setting a new buffer.
+ * @param s The string to use as a new sequence.
+ *
+ * Deallocates any previous stored sequence, then copies @a s to
+ * use as a new one.
+ */
+ void
+ str(const __string_type& __s)
+ {
+ // Cannot use _M_string = __s, since v3 strings are COW.
+ _M_string.assign(__s.data(), __s.size());
+ _M_stringbuf_init(_M_mode);
+ }
+
+ protected:
+ // Common initialization code goes here.
+ void
+ _M_stringbuf_init(ios_base::openmode __mode)
+ {
+ _M_mode = __mode;
+ __size_type __len = 0;
+ if (_M_mode & (ios_base::ate | ios_base::app))
+ __len = _M_string.size();
+ _M_sync(const_cast<char_type*>(_M_string.data()), 0, __len);
+ }
+
+ virtual streamsize
+ showmanyc()
+ {
+ streamsize __ret = -1;
+ if (_M_mode & ios_base::in)
+ {
+ _M_update_egptr();
+ __ret = this->egptr() - this->gptr();
+ }
+ return __ret;
+ }
+
+ virtual int_type
+ underflow();
+
+ virtual int_type
+ pbackfail(int_type __c = traits_type::eof());
+
+ virtual int_type
+ overflow(int_type __c = traits_type::eof());
+
+ /**
+ * @brief Manipulates the buffer.
+ * @param s Pointer to a buffer area.
+ * @param n Size of @a s.
+ * @return @c this
+ *
+ * If no buffer has already been created, and both @a s and @a n are
+ * non-zero, then @c s is used as a buffer; see
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch25s02.html
+ * for more.
+ */
+ virtual __streambuf_type*
+ setbuf(char_type* __s, streamsize __n)
+ {
+ if (__s && __n >= 0)
+ {
+ // This is implementation-defined behavior, and assumes
+ // that an external char_type array of length __n exists
+ // and has been pre-allocated. If this is not the case,
+ // things will quickly blow up.
+
+ // Step 1: Destroy the current internal array.
+ _M_string.clear();
+
+ // Step 2: Use the external array.
+ _M_sync(__s, __n, 0);
+ }
+ return this;
+ }
+
+ virtual pos_type
+ seekoff(off_type __off, ios_base::seekdir __way,
+ ios_base::openmode __mode = ios_base::in | ios_base::out);
+
+ virtual pos_type
+ seekpos(pos_type __sp,
+ ios_base::openmode __mode = ios_base::in | ios_base::out);
+
+ // Internal function for correctly updating the internal buffer
+ // for a particular _M_string, due to initialization or re-sizing
+ // of an existing _M_string.
+ void
+ _M_sync(char_type* __base, __size_type __i, __size_type __o);
+
+ // Internal function for correctly updating egptr() to the actual
+ // string end.
+ void
+ _M_update_egptr()
+ {
+ const bool __testin = _M_mode & ios_base::in;
+ if (this->pptr() && this->pptr() > this->egptr())
+ {
+ if (__testin)
+ this->setg(this->eback(), this->gptr(), this->pptr());
+ else
+ this->setg(this->pptr(), this->pptr(), this->pptr());
+ }
+ }
+ };
+
+
+ // [27.7.2] Template class basic_istringstream
+ /**
+ * @brief Controlling input for std::string.
+ * @ingroup io
+ *
+ * This class supports reading from objects of type std::basic_string,
+ * using the inherited functions from std::basic_istream. To control
+ * the associated sequence, an instance of std::basic_stringbuf is used,
+ * which this page refers to as @c sb.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ class basic_istringstream : public basic_istream<_CharT, _Traits>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 251. basic_stringbuf missing allocator_type
+ typedef _Alloc allocator_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+
+ // Non-standard types:
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+ typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
+ typedef basic_istream<char_type, traits_type> __istream_type;
+
+ private:
+ __stringbuf_type _M_stringbuf;
+
+ public:
+ // Constructors:
+ /**
+ * @brief Default constructor starts with an empty string buffer.
+ * @param mode Whether the buffer can read, or write, or both.
+ *
+ * @c ios_base::in is automatically included in @a mode.
+ *
+ * Initializes @c sb using @c mode|in, and passes @c &sb to the base
+ * class initializer. Does not allocate any buffer.
+ *
+ * That's a lie. We initialize the base class with NULL, because the
+ * string class does its own memory management.
+ */
+ explicit
+ basic_istringstream(ios_base::openmode __mode = ios_base::in)
+ : __istream_type(), _M_stringbuf(__mode | ios_base::in)
+ { this->init(&_M_stringbuf); }
+
+ /**
+ * @brief Starts with an existing string buffer.
+ * @param str A string to copy as a starting buffer.
+ * @param mode Whether the buffer can read, or write, or both.
+ *
+ * @c ios_base::in is automatically included in @a mode.
+ *
+ * Initializes @c sb using @a str and @c mode|in, and passes @c &sb
+ * to the base class initializer.
+ *
+ * That's a lie. We initialize the base class with NULL, because the
+ * string class does its own memory management.
+ */
+ explicit
+ basic_istringstream(const __string_type& __str,
+ ios_base::openmode __mode = ios_base::in)
+ : __istream_type(), _M_stringbuf(__str, __mode | ios_base::in)
+ { this->init(&_M_stringbuf); }
+
+ /**
+ * @brief The destructor does nothing.
+ *
+ * The buffer is deallocated by the stringbuf object, not the
+ * formatting stream.
+ */
+ ~basic_istringstream()
+ { }
+
+ // Members:
+ /**
+ * @brief Accessing the underlying buffer.
+ * @return The current basic_stringbuf buffer.
+ *
+ * This hides both signatures of std::basic_ios::rdbuf().
+ */
+ __stringbuf_type*
+ rdbuf() const
+ { return const_cast<__stringbuf_type*>(&_M_stringbuf); }
+
+ /**
+ * @brief Copying out the string buffer.
+ * @return @c rdbuf()->str()
+ */
+ __string_type
+ str() const
+ { return _M_stringbuf.str(); }
+
+ /**
+ * @brief Setting a new buffer.
+ * @param s The string to use as a new sequence.
+ *
+ * Calls @c rdbuf()->str(s).
+ */
+ void
+ str(const __string_type& __s)
+ { _M_stringbuf.str(__s); }
+ };
+
+
+ // [27.7.3] Template class basic_ostringstream
+ /**
+ * @brief Controlling output for std::string.
+ * @ingroup io
+ *
+ * This class supports writing to objects of type std::basic_string,
+ * using the inherited functions from std::basic_ostream. To control
+ * the associated sequence, an instance of std::basic_stringbuf is used,
+ * which this page refers to as @c sb.
+ */
+ template <typename _CharT, typename _Traits, typename _Alloc>
+ class basic_ostringstream : public basic_ostream<_CharT, _Traits>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 251. basic_stringbuf missing allocator_type
+ typedef _Alloc allocator_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+
+ // Non-standard types:
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+ typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
+ typedef basic_ostream<char_type, traits_type> __ostream_type;
+
+ private:
+ __stringbuf_type _M_stringbuf;
+
+ public:
+ // Constructors/destructor:
+ /**
+ * @brief Default constructor starts with an empty string buffer.
+ * @param mode Whether the buffer can read, or write, or both.
+ *
+ * @c ios_base::out is automatically included in @a mode.
+ *
+ * Initializes @c sb using @c mode|out, and passes @c &sb to the base
+ * class initializer. Does not allocate any buffer.
+ *
+ * That's a lie. We initialize the base class with NULL, because the
+ * string class does its own memory management.
+ */
+ explicit
+ basic_ostringstream(ios_base::openmode __mode = ios_base::out)
+ : __ostream_type(), _M_stringbuf(__mode | ios_base::out)
+ { this->init(&_M_stringbuf); }
+
+ /**
+ * @brief Starts with an existing string buffer.
+ * @param str A string to copy as a starting buffer.
+ * @param mode Whether the buffer can read, or write, or both.
+ *
+ * @c ios_base::out is automatically included in @a mode.
+ *
+ * Initializes @c sb using @a str and @c mode|out, and passes @c &sb
+ * to the base class initializer.
+ *
+ * That's a lie. We initialize the base class with NULL, because the
+ * string class does its own memory management.
+ */
+ explicit
+ basic_ostringstream(const __string_type& __str,
+ ios_base::openmode __mode = ios_base::out)
+ : __ostream_type(), _M_stringbuf(__str, __mode | ios_base::out)
+ { this->init(&_M_stringbuf); }
+
+ /**
+ * @brief The destructor does nothing.
+ *
+ * The buffer is deallocated by the stringbuf object, not the
+ * formatting stream.
+ */
+ ~basic_ostringstream()
+ { }
+
+ // Members:
+ /**
+ * @brief Accessing the underlying buffer.
+ * @return The current basic_stringbuf buffer.
+ *
+ * This hides both signatures of std::basic_ios::rdbuf().
+ */
+ __stringbuf_type*
+ rdbuf() const
+ { return const_cast<__stringbuf_type*>(&_M_stringbuf); }
+
+ /**
+ * @brief Copying out the string buffer.
+ * @return @c rdbuf()->str()
+ */
+ __string_type
+ str() const
+ { return _M_stringbuf.str(); }
+
+ /**
+ * @brief Setting a new buffer.
+ * @param s The string to use as a new sequence.
+ *
+ * Calls @c rdbuf()->str(s).
+ */
+ void
+ str(const __string_type& __s)
+ { _M_stringbuf.str(__s); }
+ };
+
+
+ // [27.7.4] Template class basic_stringstream
+ /**
+ * @brief Controlling input and output for std::string.
+ * @ingroup io
+ *
+ * This class supports reading from and writing to objects of type
+ * std::basic_string, using the inherited functions from
+ * std::basic_iostream. To control the associated sequence, an instance
+ * of std::basic_stringbuf is used, which this page refers to as @c sb.
+ */
+ template <typename _CharT, typename _Traits, typename _Alloc>
+ class basic_stringstream : public basic_iostream<_CharT, _Traits>
+ {
+ public:
+ // Types:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 251. basic_stringbuf missing allocator_type
+ typedef _Alloc allocator_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+
+ // Non-standard Types:
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+ typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
+ typedef basic_iostream<char_type, traits_type> __iostream_type;
+
+ private:
+ __stringbuf_type _M_stringbuf;
+
+ public:
+ // Constructors/destructors
+ /**
+ * @brief Default constructor starts with an empty string buffer.
+ * @param mode Whether the buffer can read, or write, or both.
+ *
+ * Initializes @c sb using @c mode, and passes @c &sb to the base
+ * class initializer. Does not allocate any buffer.
+ *
+ * That's a lie. We initialize the base class with NULL, because the
+ * string class does its own memory management.
+ */
+ explicit
+ basic_stringstream(ios_base::openmode __m = ios_base::out | ios_base::in)
+ : __iostream_type(), _M_stringbuf(__m)
+ { this->init(&_M_stringbuf); }
+
+ /**
+ * @brief Starts with an existing string buffer.
+ * @param str A string to copy as a starting buffer.
+ * @param mode Whether the buffer can read, or write, or both.
+ *
+ * Initializes @c sb using @a str and @c mode, and passes @c &sb
+ * to the base class initializer.
+ *
+ * That's a lie. We initialize the base class with NULL, because the
+ * string class does its own memory management.
+ */
+ explicit
+ basic_stringstream(const __string_type& __str,
+ ios_base::openmode __m = ios_base::out | ios_base::in)
+ : __iostream_type(), _M_stringbuf(__str, __m)
+ { this->init(&_M_stringbuf); }
+
+ /**
+ * @brief The destructor does nothing.
+ *
+ * The buffer is deallocated by the stringbuf object, not the
+ * formatting stream.
+ */
+ ~basic_stringstream()
+ { }
+
+ // Members:
+ /**
+ * @brief Accessing the underlying buffer.
+ * @return The current basic_stringbuf buffer.
+ *
+ * This hides both signatures of std::basic_ios::rdbuf().
+ */
+ __stringbuf_type*
+ rdbuf() const
+ { return const_cast<__stringbuf_type*>(&_M_stringbuf); }
+
+ /**
+ * @brief Copying out the string buffer.
+ * @return @c rdbuf()->str()
+ */
+ __string_type
+ str() const
+ { return _M_stringbuf.str(); }
+
+ /**
+ * @brief Setting a new buffer.
+ * @param s The string to use as a new sequence.
+ *
+ * Calls @c rdbuf()->str(s).
+ */
+ void
+ str(const __string_type& __s)
+ { _M_stringbuf.str(__s); }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/sstream.tcc>
+#endif
+
+#endif /* _GLIBCXX_SSTREAM */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/stack b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/stack
new file mode 100644
index 0000000..4ee2c72
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/stack
@@ -0,0 +1,64 @@
+// <stack> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/stack
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_STACK
+#define _GLIBCXX_STACK 1
+
+#pragma GCC system_header
+
+#include <deque>
+#include <bits/stl_stack.h>
+
+#endif /* _GLIBCXX_STACK */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/stdatomic.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/stdatomic.h
new file mode 100644
index 0000000..71ddb85
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/stdatomic.h
@@ -0,0 +1,218 @@
+// -*- C++ -*- compatibility header.
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file stdatomic.h
+ * This is a Standard C++ Library header.
+ */
+
+#include <bits/c++config.h>
+#include <stddef.h>
+#include <stdbool.h> // XXX need to define bool w/o stdbool.h in tr1/cstdbool
+
+#ifndef _GLIBCXX_STDATOMIC_H
+#define _GLIBCXX_STDATOMIC_H 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+_GLIBCXX_BEGIN_EXTERN_C
+
+ /**
+ * @defgroup atomics Atomics
+ *
+ * Components for performing atomic operations.
+ * @{
+ */
+
+ /// Enumeration for memory_order
+ typedef enum memory_order
+ {
+ memory_order_relaxed,
+ memory_order_consume,
+ memory_order_acquire,
+ memory_order_release,
+ memory_order_acq_rel,
+ memory_order_seq_cst
+ } memory_order;
+
+ // Base for atomic_flag.
+ typedef struct __atomic_flag_base
+ {
+ bool _M_i;
+ } __atomic_flag_base;
+
+#define ATOMIC_FLAG_INIT { false }
+
+ /// 29.2 Lock-free Property
+#if defined(_GLIBCXX_ATOMIC_BUILTINS_1) && defined(_GLIBCXX_ATOMIC_BUILTINS_2) \
+ && defined(_GLIBCXX_ATOMIC_BUILTINS_4) && defined(_GLIBCXX_ATOMIC_BUILTINS_8)
+# define _GLIBCXX_ATOMIC_PROPERTY 2
+# define _GLIBCXX_ATOMIC_NAMESPACE __atomic2
+#elif defined(_GLIBCXX_ATOMIC_BUILTINS_1)
+# define _GLIBCXX_ATOMIC_PROPERTY 1
+# define _GLIBCXX_ATOMIC_NAMESPACE __atomic1
+#else
+# define _GLIBCXX_ATOMIC_PROPERTY 0
+# define _GLIBCXX_ATOMIC_NAMESPACE __atomic0
+#endif
+
+#define ATOMIC_INTEGRAL_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
+#define ATOMIC_ADDRESS_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
+
+ // Switch atomic integral base types based on C or C++. In
+ // addition, for "C" only provide type-generic macros for atomic
+ // operations. (As C++ accomplishes the same thing with sets of
+ // overloaded functions.
+#ifdef __cplusplus
+ inline namespace _GLIBCXX_ATOMIC_NAMESPACE { }
+# include <bits/atomicfwd_cxx.h>
+#else
+# include <bits/atomicfwd_c.h>
+#endif
+
+ // Typedefs for other atomic integral types.
+ typedef atomic_schar atomic_int_least8_t;
+ typedef atomic_uchar atomic_uint_least8_t;
+ typedef atomic_short atomic_int_least16_t;
+ typedef atomic_ushort atomic_uint_least16_t;
+ typedef atomic_int atomic_int_least32_t;
+ typedef atomic_uint atomic_uint_least32_t;
+ typedef atomic_llong atomic_int_least64_t;
+ typedef atomic_ullong atomic_uint_least64_t;
+
+ typedef atomic_schar atomic_int_fast8_t;
+ typedef atomic_uchar atomic_uint_fast8_t;
+ typedef atomic_short atomic_int_fast16_t;
+ typedef atomic_ushort atomic_uint_fast16_t;
+ typedef atomic_int atomic_int_fast32_t;
+ typedef atomic_uint atomic_uint_fast32_t;
+ typedef atomic_llong atomic_int_fast64_t;
+ typedef atomic_ullong atomic_uint_fast64_t;
+
+ typedef atomic_long atomic_intptr_t;
+ typedef atomic_ulong atomic_uintptr_t;
+
+ typedef atomic_long atomic_ssize_t;
+ typedef atomic_ulong atomic_size_t;
+
+ typedef atomic_llong atomic_intmax_t;
+ typedef atomic_ullong atomic_uintmax_t;
+
+ typedef atomic_long atomic_ptrdiff_t;
+
+ // Accessor functions for base atomic_flag type.
+ bool
+ atomic_flag_test_and_set_explicit(volatile __atomic_flag_base*, memory_order);
+
+ inline bool
+ atomic_flag_test_and_set(volatile __atomic_flag_base* __a)
+ { return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); }
+
+ void
+ atomic_flag_clear_explicit(volatile __atomic_flag_base*, memory_order);
+
+ inline void
+ atomic_flag_clear(volatile __atomic_flag_base* __a)
+ { atomic_flag_clear_explicit(__a, memory_order_seq_cst); }
+
+ void
+ __atomic_flag_wait_explicit(volatile __atomic_flag_base*, memory_order);
+
+ volatile __atomic_flag_base*
+ __atomic_flag_for_address(const volatile void* __z) __attribute__((const));
+
+ // Implementation specific defines.
+#define _ATOMIC_LOAD_(__a, __x) \
+ ({ volatile __typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
+ volatile atomic_flag* __g = __atomic_flag_for_address(__p); \
+ __atomic_flag_wait_explicit(__g, __x); \
+ __typeof__ _ATOMIC_MEMBER_ __r = *__p; \
+ atomic_flag_clear_explicit(__g, __x); \
+ __r; })
+
+#define _ATOMIC_STORE_(__a, __m, __x) \
+ ({ volatile __typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
+ __typeof__(__m) __v = (__m); \
+ volatile atomic_flag* __g = __atomic_flag_for_address(__p); \
+ __atomic_flag_wait_explicit(__g, __x); \
+ *__p = __v; \
+ atomic_flag_clear_explicit(__g, __x); \
+ __v; })
+
+#define _ATOMIC_MODIFY_(__a, __o, __m, __x) \
+ ({ volatile __typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
+ __typeof__(__m) __v = (__m); \
+ volatile atomic_flag* __g = __atomic_flag_for_address(__p); \
+ __atomic_flag_wait_explicit(__g, __x); \
+ __typeof__ _ATOMIC_MEMBER_ __r = *__p; \
+ *__p __o __v; \
+ atomic_flag_clear_explicit(__g, __x); \
+ __r; })
+
+#define _ATOMIC_CMPEXCHNG_(__a, __e, __m, __x) \
+ ({ volatile __typeof__ _ATOMIC_MEMBER_* __p = &_ATOMIC_MEMBER_; \
+ __typeof__(__e) __q = (__e); \
+ __typeof__(__m) __v = (__m); \
+ bool __r; \
+ volatile atomic_flag* __g = __atomic_flag_for_address(__p); \
+ __atomic_flag_wait_explicit(__g, __x); \
+ __typeof__ _ATOMIC_MEMBER_ __t__ = *__p; \
+ if (__t__ == *__q) { *__p = __v; __r = true; } \
+ else { *__q = __t__; __r = false; } \
+ atomic_flag_clear_explicit(__g, __x); \
+ __r; })
+
+ // @} group atomics
+
+_GLIBCXX_END_EXTERN_C
+_GLIBCXX_END_NAMESPACE
+
+// Inject into global namespace. XXX
+#if defined(__cplusplus) && !defined(_GLIBCXX_STDATOMIC)
+using std::memory_order;
+using std::memory_order_relaxed;
+using std::memory_order_consume;
+using std::memory_order_acquire;
+using std::memory_order_release;
+using std::memory_order_acq_rel;
+using std::memory_order_seq_cst;
+using std::atomic_flag;
+using std::atomic_bool;
+using std::atomic_char;
+using std::atomic_schar;
+using std::atomic_uchar;
+using std::atomic_short;
+using std::atomic_ushort;
+using std::atomic_int;
+using std::atomic_uint;
+using std::atomic_long;
+using std::atomic_ulong;
+using std::atomic_llong;
+using std::atomic_ullong;
+using std::atomic_wchar_t;
+using std::atomic_char16_t;
+using std::atomic_char32_t;
+using std::atomic_address;
+using std::atomic;
+#endif
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/stdexcept b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/stdexcept
new file mode 100644
index 0000000..9f5c976
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/stdexcept
@@ -0,0 +1,150 @@
+// Standard exception classes -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2005, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file stdexcept
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 19.1 Exception classes
+//
+
+#ifndef _GLIBCXX_STDEXCEPT
+#define _GLIBCXX_STDEXCEPT 1
+
+#pragma GCC system_header
+
+#include <exception>
+#include <string>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @addtogroup exceptions
+ * @{
+ */
+
+ /** Logic errors represent problems in the internal logic of a program;
+ * in theory, these are preventable, and even detectable before the
+ * program runs (e.g., violations of class invariants).
+ * @brief One of two subclasses of exception.
+ */
+ class logic_error : public exception
+ {
+ string _M_msg;
+
+ public:
+ /** Takes a character string describing the error. */
+ explicit
+ logic_error(const string& __arg);
+
+ virtual
+ ~logic_error() throw();
+
+ /** Returns a C-style character string describing the general cause of
+ * the current error (the same string passed to the ctor). */
+ virtual const char*
+ what() const throw();
+ };
+
+ /** Thrown by the library, or by you, to report domain errors (domain in
+ * the mathematical sense). */
+ class domain_error : public logic_error
+ {
+ public:
+ explicit domain_error(const string& __arg);
+ };
+
+ /** Thrown to report invalid arguments to functions. */
+ class invalid_argument : public logic_error
+ {
+ public:
+ explicit invalid_argument(const string& __arg);
+ };
+
+ /** Thrown when an object is constructed that would exceed its maximum
+ * permitted size (e.g., a basic_string instance). */
+ class length_error : public logic_error
+ {
+ public:
+ explicit length_error(const string& __arg);
+ };
+
+ /** This represents an argument whose value is not within the expected
+ * range (e.g., boundary checks in basic_string). */
+ class out_of_range : public logic_error
+ {
+ public:
+ explicit out_of_range(const string& __arg);
+ };
+
+ /** Runtime errors represent problems outside the scope of a program;
+ * they cannot be easily predicted and can generally only be caught as
+ * the program executes.
+ * @brief One of two subclasses of exception.
+ */
+ class runtime_error : public exception
+ {
+ string _M_msg;
+
+ public:
+ /** Takes a character string describing the error. */
+ explicit
+ runtime_error(const string& __arg);
+
+ virtual
+ ~runtime_error() throw();
+
+ /** Returns a C-style character string describing the general cause of
+ * the current error (the same string passed to the ctor). */
+ virtual const char*
+ what() const throw();
+ };
+
+ /** Thrown to indicate range errors in internal computations. */
+ class range_error : public runtime_error
+ {
+ public:
+ explicit range_error(const string& __arg);
+ };
+
+ /** Thrown to indicate arithmetic overflow. */
+ class overflow_error : public runtime_error
+ {
+ public:
+ explicit overflow_error(const string& __arg);
+ };
+
+ /** Thrown to indicate arithmetic underflow. */
+ class underflow_error : public runtime_error
+ {
+ public:
+ explicit underflow_error(const string& __arg);
+ };
+
+ // @} group exceptions
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _GLIBCXX_STDEXCEPT */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/streambuf b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/streambuf
new file mode 100644
index 0000000..790be0e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/streambuf
@@ -0,0 +1,799 @@
+// Stream buffer classes -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file streambuf
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 14882: 27.5 Stream buffers
+//
+
+#ifndef _GLIBXX_STREAMBUF
+#define _GLIBXX_STREAMBUF 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <iosfwd>
+#include <bits/localefwd.h>
+#include <bits/ios_base.h>
+#include <bits/cpp_type_traits.h>
+#include <ext/type_traits.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<typename _CharT, typename _Traits>
+ streamsize
+ __copy_streambufs_eof(basic_streambuf<_CharT, _Traits>*,
+ basic_streambuf<_CharT, _Traits>*, bool&);
+
+ /**
+ * @brief The actual work of input and output (interface).
+ *
+ * This is a base class. Derived stream buffers each control a
+ * pair of character sequences: one for input, and one for output.
+ *
+ * Section [27.5.1] of the standard describes the requirements and
+ * behavior of stream buffer classes. That section (three paragraphs)
+ * is reproduced here, for simplicity and accuracy.
+ *
+ * -# Stream buffers can impose various constraints on the sequences
+ * they control. Some constraints are:
+ * - The controlled input sequence can be not readable.
+ * - The controlled output sequence can be not writable.
+ * - The controlled sequences can be associated with the contents of
+ * other representations for character sequences, such as external
+ * files.
+ * - The controlled sequences can support operations @e directly to or
+ * from associated sequences.
+ * - The controlled sequences can impose limitations on how the
+ * program can read characters from a sequence, write characters to
+ * a sequence, put characters back into an input sequence, or alter
+ * the stream position.
+ * .
+ * -# Each sequence is characterized by three pointers which, if non-null,
+ * all point into the same @c charT array object. The array object
+ * represents, at any moment, a (sub)sequence of characters from the
+ * sequence. Operations performed on a sequence alter the values
+ * stored in these pointers, perform reads and writes directly to or
+ * from associated sequences, and alter "the stream position" and
+ * conversion state as needed to maintain this subsequence relationship.
+ * The three pointers are:
+ * - the <em>beginning pointer</em>, or lowest element address in the
+ * array (called @e xbeg here);
+ * - the <em>next pointer</em>, or next element address that is a
+ * current candidate for reading or writing (called @e xnext here);
+ * - the <em>end pointer</em>, or first element address beyond the
+ * end of the array (called @e xend here).
+ * .
+ * -# The following semantic constraints shall always apply for any set
+ * of three pointers for a sequence, using the pointer names given
+ * immediately above:
+ * - If @e xnext is not a null pointer, then @e xbeg and @e xend shall
+ * also be non-null pointers into the same @c charT array, as
+ * described above; otherwise, @e xbeg and @e xend shall also be null.
+ * - If @e xnext is not a null pointer and @e xnext < @e xend for an
+ * output sequence, then a <em>write position</em> is available.
+ * In this case, @e *xnext shall be assignable as the next element
+ * to write (to put, or to store a character value, into the sequence).
+ * - If @e xnext is not a null pointer and @e xbeg < @e xnext for an
+ * input sequence, then a <em>putback position</em> is available.
+ * In this case, @e xnext[-1] shall have a defined value and is the
+ * next (preceding) element to store a character that is put back
+ * into the input sequence.
+ * - If @e xnext is not a null pointer and @e xnext< @e xend for an
+ * input sequence, then a <em>read position</em> is available.
+ * In this case, @e *xnext shall have a defined value and is the
+ * next element to read (to get, or to obtain a character value,
+ * from the sequence).
+ */
+ template<typename _CharT, typename _Traits>
+ class basic_streambuf
+ {
+ public:
+ //@{
+ /**
+ * These are standard types. They permit a standardized way of
+ * referring to names of (or names dependant on) the template
+ * parameters, which are specific to the implementation.
+ */
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
+ //@}
+
+ //@{
+ /// This is a non-standard type.
+ typedef basic_streambuf<char_type, traits_type> __streambuf_type;
+ //@}
+
+ friend class basic_ios<char_type, traits_type>;
+ friend class basic_istream<char_type, traits_type>;
+ friend class basic_ostream<char_type, traits_type>;
+ friend class istreambuf_iterator<char_type, traits_type>;
+ friend class ostreambuf_iterator<char_type, traits_type>;
+
+ friend streamsize
+ __copy_streambufs_eof<>(__streambuf_type*, __streambuf_type*, bool&);
+
+ template<bool _IsMove, typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+ _CharT2*>::__type
+ __copy_move_a2(istreambuf_iterator<_CharT2>,
+ istreambuf_iterator<_CharT2>, _CharT2*);
+
+ template<typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+ istreambuf_iterator<_CharT2> >::__type
+ find(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
+ const _CharT2&);
+
+ template<typename _CharT2, typename _Traits2>
+ friend basic_istream<_CharT2, _Traits2>&
+ operator>>(basic_istream<_CharT2, _Traits2>&, _CharT2*);
+
+ template<typename _CharT2, typename _Traits2, typename _Alloc>
+ friend basic_istream<_CharT2, _Traits2>&
+ operator>>(basic_istream<_CharT2, _Traits2>&,
+ basic_string<_CharT2, _Traits2, _Alloc>&);
+
+ template<typename _CharT2, typename _Traits2, typename _Alloc>
+ friend basic_istream<_CharT2, _Traits2>&
+ getline(basic_istream<_CharT2, _Traits2>&,
+ basic_string<_CharT2, _Traits2, _Alloc>&, _CharT2);
+
+ protected:
+ //@{
+ /**
+ * This is based on _IO_FILE, just reordered to be more consistent,
+ * and is intended to be the most minimal abstraction for an
+ * internal buffer.
+ * - get == input == read
+ * - put == output == write
+ */
+ char_type* _M_in_beg; // Start of get area.
+ char_type* _M_in_cur; // Current read area.
+ char_type* _M_in_end; // End of get area.
+ char_type* _M_out_beg; // Start of put area.
+ char_type* _M_out_cur; // Current put area.
+ char_type* _M_out_end; // End of put area.
+
+ /// Current locale setting.
+ locale _M_buf_locale;
+
+ public:
+ /// Destructor deallocates no buffer space.
+ virtual
+ ~basic_streambuf()
+ { }
+
+ // [27.5.2.2.1] locales
+ /**
+ * @brief Entry point for imbue().
+ * @param loc The new locale.
+ * @return The previous locale.
+ *
+ * Calls the derived imbue(loc).
+ */
+ locale
+ pubimbue(const locale &__loc)
+ {
+ locale __tmp(this->getloc());
+ this->imbue(__loc);
+ _M_buf_locale = __loc;
+ return __tmp;
+ }
+
+ /**
+ * @brief Locale access.
+ * @return The current locale in effect.
+ *
+ * If pubimbue(loc) has been called, then the most recent @c loc
+ * is returned. Otherwise the global locale in effect at the time
+ * of construction is returned.
+ */
+ locale
+ getloc() const
+ { return _M_buf_locale; }
+
+ // [27.5.2.2.2] buffer management and positioning
+ //@{
+ /**
+ * @brief Entry points for derived buffer functions.
+ *
+ * The public versions of @c pubfoo dispatch to the protected
+ * derived @c foo member functions, passing the arguments (if any)
+ * and returning the result unchanged.
+ */
+ __streambuf_type*
+ pubsetbuf(char_type* __s, streamsize __n)
+ { return this->setbuf(__s, __n); }
+
+ pos_type
+ pubseekoff(off_type __off, ios_base::seekdir __way,
+ ios_base::openmode __mode = ios_base::in | ios_base::out)
+ { return this->seekoff(__off, __way, __mode); }
+
+ pos_type
+ pubseekpos(pos_type __sp,
+ ios_base::openmode __mode = ios_base::in | ios_base::out)
+ { return this->seekpos(__sp, __mode); }
+
+ int
+ pubsync() { return this->sync(); }
+ //@}
+
+ // [27.5.2.2.3] get area
+ /**
+ * @brief Looking ahead into the stream.
+ * @return The number of characters available.
+ *
+ * If a read position is available, returns the number of characters
+ * available for reading before the buffer must be refilled.
+ * Otherwise returns the derived @c showmanyc().
+ */
+ streamsize
+ in_avail()
+ {
+ const streamsize __ret = this->egptr() - this->gptr();
+ return __ret ? __ret : this->showmanyc();
+ }
+
+ /**
+ * @brief Getting the next character.
+ * @return The next character, or eof.
+ *
+ * Calls @c sbumpc(), and if that function returns
+ * @c traits::eof(), so does this function. Otherwise, @c sgetc().
+ */
+ int_type
+ snextc()
+ {
+ int_type __ret = traits_type::eof();
+ if (__builtin_expect(!traits_type::eq_int_type(this->sbumpc(),
+ __ret), true))
+ __ret = this->sgetc();
+ return __ret;
+ }
+
+ /**
+ * @brief Getting the next character.
+ * @return The next character, or eof.
+ *
+ * If the input read position is available, returns that character
+ * and increments the read pointer, otherwise calls and returns
+ * @c uflow().
+ */
+ int_type
+ sbumpc()
+ {
+ int_type __ret;
+ if (__builtin_expect(this->gptr() < this->egptr(), true))
+ {
+ __ret = traits_type::to_int_type(*this->gptr());
+ this->gbump(1);
+ }
+ else
+ __ret = this->uflow();
+ return __ret;
+ }
+
+ /**
+ * @brief Getting the next character.
+ * @return The next character, or eof.
+ *
+ * If the input read position is available, returns that character,
+ * otherwise calls and returns @c underflow(). Does not move the
+ * read position after fetching the character.
+ */
+ int_type
+ sgetc()
+ {
+ int_type __ret;
+ if (__builtin_expect(this->gptr() < this->egptr(), true))
+ __ret = traits_type::to_int_type(*this->gptr());
+ else
+ __ret = this->underflow();
+ return __ret;
+ }
+
+ /**
+ * @brief Entry point for xsgetn.
+ * @param s A buffer area.
+ * @param n A count.
+ *
+ * Returns xsgetn(s,n). The effect is to fill @a s[0] through
+ * @a s[n-1] with characters from the input sequence, if possible.
+ */
+ streamsize
+ sgetn(char_type* __s, streamsize __n)
+ { return this->xsgetn(__s, __n); }
+
+ // [27.5.2.2.4] putback
+ /**
+ * @brief Pushing characters back into the input stream.
+ * @param c The character to push back.
+ * @return The previous character, if possible.
+ *
+ * Similar to sungetc(), but @a c is pushed onto the stream instead
+ * of "the previous character". If successful, the next character
+ * fetched from the input stream will be @a c.
+ */
+ int_type
+ sputbackc(char_type __c)
+ {
+ int_type __ret;
+ const bool __testpos = this->eback() < this->gptr();
+ if (__builtin_expect(!__testpos ||
+ !traits_type::eq(__c, this->gptr()[-1]), false))
+ __ret = this->pbackfail(traits_type::to_int_type(__c));
+ else
+ {
+ this->gbump(-1);
+ __ret = traits_type::to_int_type(*this->gptr());
+ }
+ return __ret;
+ }
+
+ /**
+ * @brief Moving backwards in the input stream.
+ * @return The previous character, if possible.
+ *
+ * If a putback position is available, this function decrements the
+ * input pointer and returns that character. Otherwise, calls and
+ * returns pbackfail(). The effect is to "unget" the last character
+ * "gotten".
+ */
+ int_type
+ sungetc()
+ {
+ int_type __ret;
+ if (__builtin_expect(this->eback() < this->gptr(), true))
+ {
+ this->gbump(-1);
+ __ret = traits_type::to_int_type(*this->gptr());
+ }
+ else
+ __ret = this->pbackfail();
+ return __ret;
+ }
+
+ // [27.5.2.2.5] put area
+ /**
+ * @brief Entry point for all single-character output functions.
+ * @param c A character to output.
+ * @return @a c, if possible.
+ *
+ * One of two public output functions.
+ *
+ * If a write position is available for the output sequence (i.e.,
+ * the buffer is not full), stores @a c in that position, increments
+ * the position, and returns @c traits::to_int_type(c). If a write
+ * position is not available, returns @c overflow(c).
+ */
+ int_type
+ sputc(char_type __c)
+ {
+ int_type __ret;
+ if (__builtin_expect(this->pptr() < this->epptr(), true))
+ {
+ *this->pptr() = __c;
+ this->pbump(1);
+ __ret = traits_type::to_int_type(__c);
+ }
+ else
+ __ret = this->overflow(traits_type::to_int_type(__c));
+ return __ret;
+ }
+
+ /**
+ * @brief Entry point for all single-character output functions.
+ * @param s A buffer read area.
+ * @param n A count.
+ *
+ * One of two public output functions.
+ *
+ *
+ * Returns xsputn(s,n). The effect is to write @a s[0] through
+ * @a s[n-1] to the output sequence, if possible.
+ */
+ streamsize
+ sputn(const char_type* __s, streamsize __n)
+ { return this->xsputn(__s, __n); }
+
+ protected:
+ /**
+ * @brief Base constructor.
+ *
+ * Only called from derived constructors, and sets up all the
+ * buffer data to zero, including the pointers described in the
+ * basic_streambuf class description. Note that, as a result,
+ * - the class starts with no read nor write positions available,
+ * - this is not an error
+ */
+ basic_streambuf()
+ : _M_in_beg(0), _M_in_cur(0), _M_in_end(0),
+ _M_out_beg(0), _M_out_cur(0), _M_out_end(0),
+ _M_buf_locale(locale())
+ { }
+
+ // [27.5.2.3.1] get area access
+ //@{
+ /**
+ * @brief Access to the get area.
+ *
+ * These functions are only available to other protected functions,
+ * including derived classes.
+ *
+ * - eback() returns the beginning pointer for the input sequence
+ * - gptr() returns the next pointer for the input sequence
+ * - egptr() returns the end pointer for the input sequence
+ */
+ char_type*
+ eback() const { return _M_in_beg; }
+
+ char_type*
+ gptr() const { return _M_in_cur; }
+
+ char_type*
+ egptr() const { return _M_in_end; }
+ //@}
+
+ /**
+ * @brief Moving the read position.
+ * @param n The delta by which to move.
+ *
+ * This just advances the read position without returning any data.
+ */
+ void
+ gbump(int __n) { _M_in_cur += __n; }
+
+ /**
+ * @brief Setting the three read area pointers.
+ * @param gbeg A pointer.
+ * @param gnext A pointer.
+ * @param gend A pointer.
+ * @post @a gbeg == @c eback(), @a gnext == @c gptr(), and
+ * @a gend == @c egptr()
+ */
+ void
+ setg(char_type* __gbeg, char_type* __gnext, char_type* __gend)
+ {
+ _M_in_beg = __gbeg;
+ _M_in_cur = __gnext;
+ _M_in_end = __gend;
+ }
+
+ // [27.5.2.3.2] put area access
+ //@{
+ /**
+ * @brief Access to the put area.
+ *
+ * These functions are only available to other protected functions,
+ * including derived classes.
+ *
+ * - pbase() returns the beginning pointer for the output sequence
+ * - pptr() returns the next pointer for the output sequence
+ * - epptr() returns the end pointer for the output sequence
+ */
+ char_type*
+ pbase() const { return _M_out_beg; }
+
+ char_type*
+ pptr() const { return _M_out_cur; }
+
+ char_type*
+ epptr() const { return _M_out_end; }
+ //@}
+
+ /**
+ * @brief Moving the write position.
+ * @param n The delta by which to move.
+ *
+ * This just advances the write position without returning any data.
+ */
+ void
+ pbump(int __n) { _M_out_cur += __n; }
+
+ /**
+ * @brief Setting the three write area pointers.
+ * @param pbeg A pointer.
+ * @param pend A pointer.
+ * @post @a pbeg == @c pbase(), @a pbeg == @c pptr(), and
+ * @a pend == @c epptr()
+ */
+ void
+ setp(char_type* __pbeg, char_type* __pend)
+ {
+ _M_out_beg = _M_out_cur = __pbeg;
+ _M_out_end = __pend;
+ }
+
+ // [27.5.2.4] virtual functions
+ // [27.5.2.4.1] locales
+ /**
+ * @brief Changes translations.
+ * @param loc A new locale.
+ *
+ * Translations done during I/O which depend on the current locale
+ * are changed by this call. The standard adds, "Between invocations
+ * of this function a class derived from streambuf can safely cache
+ * results of calls to locale functions and to members of facets
+ * so obtained."
+ *
+ * @note Base class version does nothing.
+ */
+ virtual void
+ imbue(const locale&)
+ { }
+
+ // [27.5.2.4.2] buffer management and positioning
+ /**
+ * @brief Manipulates the buffer.
+ *
+ * Each derived class provides its own appropriate behavior. See
+ * the next-to-last paragraph of
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch25s02.html
+ * for more on this function.
+ *
+ * @note Base class version does nothing, returns @c this.
+ */
+ virtual basic_streambuf<char_type,_Traits>*
+ setbuf(char_type*, streamsize)
+ { return this; }
+
+ /**
+ * @brief Alters the stream positions.
+ *
+ * Each derived class provides its own appropriate behavior.
+ * @note Base class version does nothing, returns a @c pos_type
+ * that represents an invalid stream position.
+ */
+ virtual pos_type
+ seekoff(off_type, ios_base::seekdir,
+ ios_base::openmode /*__mode*/ = ios_base::in | ios_base::out)
+ { return pos_type(off_type(-1)); }
+
+ /**
+ * @brief Alters the stream positions.
+ *
+ * Each derived class provides its own appropriate behavior.
+ * @note Base class version does nothing, returns a @c pos_type
+ * that represents an invalid stream position.
+ */
+ virtual pos_type
+ seekpos(pos_type,
+ ios_base::openmode /*__mode*/ = ios_base::in | ios_base::out)
+ { return pos_type(off_type(-1)); }
+
+ /**
+ * @brief Synchronizes the buffer arrays with the controlled sequences.
+ * @return -1 on failure.
+ *
+ * Each derived class provides its own appropriate behavior,
+ * including the definition of "failure".
+ * @note Base class version does nothing, returns zero.
+ */
+ virtual int
+ sync() { return 0; }
+
+ // [27.5.2.4.3] get area
+ /**
+ * @brief Investigating the data available.
+ * @return An estimate of the number of characters available in the
+ * input sequence, or -1.
+ *
+ * "If it returns a positive value, then successive calls to
+ * @c underflow() will not return @c traits::eof() until at least that
+ * number of characters have been supplied. If @c showmanyc()
+ * returns -1, then calls to @c underflow() or @c uflow() will fail."
+ * [27.5.2.4.3]/1
+ *
+ * @note Base class version does nothing, returns zero.
+ * @note The standard adds that "the intention is not only that the
+ * calls [to underflow or uflow] will not return @c eof() but
+ * that they will return "immediately".
+ * @note The standard adds that "the morphemes of @c showmanyc are
+ * "es-how-many-see", not "show-manic".
+ */
+ virtual streamsize
+ showmanyc() { return 0; }
+
+ /**
+ * @brief Multiple character extraction.
+ * @param s A buffer area.
+ * @param n Maximum number of characters to assign.
+ * @return The number of characters assigned.
+ *
+ * Fills @a s[0] through @a s[n-1] with characters from the input
+ * sequence, as if by @c sbumpc(). Stops when either @a n characters
+ * have been copied, or when @c traits::eof() would be copied.
+ *
+ * It is expected that derived classes provide a more efficient
+ * implementation by overriding this definition.
+ */
+ virtual streamsize
+ xsgetn(char_type* __s, streamsize __n);
+
+ /**
+ * @brief Fetches more data from the controlled sequence.
+ * @return The first character from the <em>pending sequence</em>.
+ *
+ * Informally, this function is called when the input buffer is
+ * exhausted (or does not exist, as buffering need not actually be
+ * done). If a buffer exists, it is "refilled". In either case, the
+ * next available character is returned, or @c traits::eof() to
+ * indicate a null pending sequence.
+ *
+ * For a formal definition of the pending sequence, see a good text
+ * such as Langer & Kreft, or [27.5.2.4.3]/7-14.
+ *
+ * A functioning input streambuf can be created by overriding only
+ * this function (no buffer area will be used). For an example, see
+ * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch25.html
+ *
+ * @note Base class version does nothing, returns eof().
+ */
+ virtual int_type
+ underflow()
+ { return traits_type::eof(); }
+
+ /**
+ * @brief Fetches more data from the controlled sequence.
+ * @return The first character from the <em>pending sequence</em>.
+ *
+ * Informally, this function does the same thing as @c underflow(),
+ * and in fact is required to call that function. It also returns
+ * the new character, like @c underflow() does. However, this
+ * function also moves the read position forward by one.
+ */
+ virtual int_type
+ uflow()
+ {
+ int_type __ret = traits_type::eof();
+ const bool __testeof = traits_type::eq_int_type(this->underflow(),
+ __ret);
+ if (!__testeof)
+ {
+ __ret = traits_type::to_int_type(*this->gptr());
+ this->gbump(1);
+ }
+ return __ret;
+ }
+
+ // [27.5.2.4.4] putback
+ /**
+ * @brief Tries to back up the input sequence.
+ * @param c The character to be inserted back into the sequence.
+ * @return eof() on failure, "some other value" on success
+ * @post The constraints of @c gptr(), @c eback(), and @c pptr()
+ * are the same as for @c underflow().
+ *
+ * @note Base class version does nothing, returns eof().
+ */
+ virtual int_type
+ pbackfail(int_type /* __c */ = traits_type::eof())
+ { return traits_type::eof(); }
+
+ // Put area:
+ /**
+ * @brief Multiple character insertion.
+ * @param s A buffer area.
+ * @param n Maximum number of characters to write.
+ * @return The number of characters written.
+ *
+ * Writes @a s[0] through @a s[n-1] to the output sequence, as if
+ * by @c sputc(). Stops when either @a n characters have been
+ * copied, or when @c sputc() would return @c traits::eof().
+ *
+ * It is expected that derived classes provide a more efficient
+ * implementation by overriding this definition.
+ */
+ virtual streamsize
+ xsputn(const char_type* __s, streamsize __n);
+
+ /**
+ * @brief Consumes data from the buffer; writes to the
+ * controlled sequence.
+ * @param c An additional character to consume.
+ * @return eof() to indicate failure, something else (usually
+ * @a c, or not_eof())
+ *
+ * Informally, this function is called when the output buffer is full
+ * (or does not exist, as buffering need not actually be done). If a
+ * buffer exists, it is "consumed", with "some effect" on the
+ * controlled sequence. (Typically, the buffer is written out to the
+ * sequence verbatim.) In either case, the character @a c is also
+ * written out, if @a c is not @c eof().
+ *
+ * For a formal definition of this function, see a good text
+ * such as Langer & Kreft, or [27.5.2.4.5]/3-7.
+ *
+ * A functioning output streambuf can be created by overriding only
+ * this function (no buffer area will be used).
+ *
+ * @note Base class version does nothing, returns eof().
+ */
+ virtual int_type
+ overflow(int_type /* __c */ = traits_type::eof())
+ { return traits_type::eof(); }
+
+#if _GLIBCXX_DEPRECATED
+ // Annex D.6
+ public:
+ /**
+ * @brief Tosses a character.
+ *
+ * Advances the read pointer, ignoring the character that would have
+ * been read.
+ *
+ * See http://gcc.gnu.org/ml/libstdc++/2002-05/msg00168.html
+ */
+ void
+ stossc()
+ {
+ if (this->gptr() < this->egptr())
+ this->gbump(1);
+ else
+ this->uflow();
+ }
+#endif
+
+ private:
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // Side effect of DR 50.
+ basic_streambuf(const __streambuf_type& __sb)
+ : _M_in_beg(__sb._M_in_beg), _M_in_cur(__sb._M_in_cur),
+ _M_in_end(__sb._M_in_end), _M_out_beg(__sb._M_out_beg),
+ _M_out_cur(__sb._M_out_cur), _M_out_end(__sb._M_out_cur),
+ _M_buf_locale(__sb._M_buf_locale)
+ { }
+
+ __streambuf_type&
+ operator=(const __streambuf_type&) { return *this; };
+ };
+
+ // Explicit specialization declarations, defined in src/streambuf.cc.
+ template<>
+ streamsize
+ __copy_streambufs_eof(basic_streambuf<char>* __sbin,
+ basic_streambuf<char>* __sbout, bool& __ineof);
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ streamsize
+ __copy_streambufs_eof(basic_streambuf<wchar_t>* __sbin,
+ basic_streambuf<wchar_t>* __sbout, bool& __ineof);
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/streambuf.tcc>
+#endif
+
+#endif /* _GLIBCXX_STREAMBUF */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/string b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/string
new file mode 100644
index 0000000..8c5949f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/string
@@ -0,0 +1,59 @@
+// Components for manipulating sequences of characters -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+// 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/string
+ * This is a Standard C++ Library header.
+ */
+
+//
+// ISO C++ 14882: 21 Strings library
+//
+
+#ifndef _GLIBCXX_STRING
+#define _GLIBCXX_STRING 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/stringfwd.h>
+#include <bits/char_traits.h> // NB: In turn includes stl_algobase.h
+#include <bits/allocator.h>
+#include <bits/cpp_type_traits.h>
+#include <bits/localefwd.h> // For operators >>, <<, and getline.
+#include <bits/ostream_insert.h>
+#include <bits/stl_iterator_base_types.h>
+#include <bits/stl_iterator_base_funcs.h>
+#include <bits/stl_iterator.h>
+#include <bits/stl_function.h> // For less
+#include <ext/numeric_traits.h>
+#include <bits/stl_algobase.h>
+#include <bits/basic_string.h>
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/basic_string.tcc>
+#endif
+
+#endif /* _GLIBCXX_STRING */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/system_error b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/system_error
new file mode 100644
index 0000000..02dd2df
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/system_error
@@ -0,0 +1,353 @@
+// <system_error> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file system_error
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_SYSTEM_ERROR
+#define _GLIBCXX_SYSTEM_ERROR 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#include <bits/c++config.h>
+#include <bits/error_constants.h>
+#include <iosfwd>
+#include <stdexcept>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ class error_code;
+ class error_condition;
+ class error_category;
+ class system_error;
+
+ /// is_error_code_enum
+ template<typename _Tp>
+ struct is_error_code_enum : public false_type { };
+
+ /// is_error_condition_enum
+ template<typename _Tp>
+ struct is_error_condition_enum : public false_type { };
+
+ template<>
+ struct is_error_condition_enum<errc>
+ : public true_type { };
+
+
+ /// error_category
+ class error_category
+ {
+ protected:
+ error_category() = default;
+
+ public:
+ virtual ~error_category() { }
+
+ error_category(const error_category&) = delete;
+ error_category& operator=(const error_category&) = delete;
+
+ virtual const char*
+ name() const = 0;
+
+ virtual string
+ message(int) const = 0;
+
+ virtual error_condition
+ default_error_condition(int __i) const;
+
+ virtual bool
+ equivalent(int __i, const error_condition& __cond) const;
+
+ virtual bool
+ equivalent(const error_code& __code, int __i) const;
+
+ bool
+ operator<(const error_category& __other) const
+ { return less<const error_category*>()(this, &__other); }
+
+ bool
+ operator==(const error_category& __other) const
+ { return this == &__other; }
+
+ bool
+ operator!=(const error_category& __other) const
+ { return this != &__other; }
+ };
+
+ // DR 890.
+ const error_category& system_category();
+ const error_category& generic_category();
+
+ error_code make_error_code(errc);
+
+ /// error_code
+ // Implementation-specific error identification
+ struct error_code
+ {
+ error_code()
+ : _M_value(0), _M_cat(&system_category()) { }
+
+ error_code(int __v, const error_category& __cat)
+ : _M_value(__v), _M_cat(&__cat) { }
+
+ template<typename _ErrorCodeEnum>
+ error_code(_ErrorCodeEnum __e,
+ typename enable_if<is_error_code_enum<_ErrorCodeEnum>::value>::type* = 0)
+ { *this = make_error_code(__e); }
+
+ void
+ assign(int __v, const error_category& __cat)
+ {
+ _M_value = __v;
+ _M_cat = &__cat;
+ }
+
+ void
+ clear()
+ { assign(0, system_category()); }
+
+ // DR 804.
+ template<typename _ErrorCodeEnum>
+ typename enable_if<is_error_code_enum<_ErrorCodeEnum>::value,
+ error_code&>::type
+ operator=(_ErrorCodeEnum __e)
+ { return *this = make_error_code(__e); }
+
+ int
+ value() const { return _M_value; }
+
+ const error_category&
+ category() const { return *_M_cat; }
+
+ error_condition
+ default_error_condition() const;
+
+ string
+ message() const
+ { return category().message(value()); }
+
+ // Safe bool idiom.
+ // explicit operator bool() const throw()
+ // { return _M_value != 0; }
+ typedef void (*__bool_type)();
+
+ static void __not_bool_type() { }
+
+ operator __bool_type() const
+ { return _M_value != 0 ? &__not_bool_type : false; }
+
+ // DR 804.
+ private:
+ int _M_value;
+ const error_category* _M_cat;
+ };
+
+ // 19.4.2.6 non-member functions
+ inline error_code
+ make_error_code(errc __e)
+ { return error_code(static_cast<int>(__e), generic_category()); }
+
+ inline bool
+ operator<(const error_code& __lhs, const error_code& __rhs)
+ {
+ return (__lhs.category() < __rhs.category()
+ || (__lhs.category() == __rhs.category()
+ && __lhs.value() < __rhs.value()));
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
+ { return (__os << __e.category().name() << ':' << __e.value()); }
+
+ error_condition make_error_condition(errc);
+
+ /// error_condition
+ // Portable error identification
+ struct error_condition
+ {
+ error_condition()
+ : _M_value(0), _M_cat(&generic_category()) { }
+
+ error_condition(int __v, const error_category& __cat)
+ : _M_value(__v), _M_cat(&__cat) { }
+
+ template<typename _ErrorConditionEnum>
+ error_condition(_ErrorConditionEnum __e,
+ typename enable_if<is_error_condition_enum
+ <_ErrorConditionEnum>::value>::type* = 0)
+ { *this = make_error_condition(__e); }
+
+ void
+ assign(int __v, const error_category& __cat)
+ {
+ _M_value = __v;
+ _M_cat = &__cat;
+ }
+
+ // DR 804.
+ template<typename _ErrorConditionEnum>
+ typename enable_if<is_error_condition_enum
+ <_ErrorConditionEnum>::value, error_condition&>::type
+ operator=(_ErrorConditionEnum __e)
+ { return *this = make_error_condition(__e); }
+
+ void
+ clear()
+ { assign(0, generic_category()); }
+
+ // 19.4.3.4 observers
+ int
+ value() const { return _M_value; }
+
+ const error_category&
+ category() const { return *_M_cat; }
+
+ string
+ message() const
+ { return category().message(value()); }
+
+ // Safe bool idiom.
+ // explicit operator bool() const throw()
+ // { return _M_value != 0; }
+ typedef void (*__bool_type)();
+
+ static void __not_bool_type() { }
+
+ operator __bool_type() const
+ { return _M_value != 0 ? &__not_bool_type : false; }
+
+ // DR 804.
+ private:
+ int _M_value;
+ const error_category* _M_cat;
+ };
+
+ // 19.4.3.6 non-member functions
+ inline error_condition
+ make_error_condition(errc __e)
+ { return error_condition(static_cast<int>(__e), generic_category()); }
+
+ inline bool
+ operator<(const error_condition& __lhs, const error_condition& __rhs)
+ {
+ return (__lhs.category() < __rhs.category()
+ || (__lhs.category() == __rhs.category()
+ && __lhs.value() < __rhs.value()));
+ }
+
+ // 19.4.4 Comparison operators
+ inline bool
+ operator==(const error_code& __lhs, const error_code& __rhs)
+ { return (__lhs.category() == __rhs.category()
+ && __lhs.value() == __rhs.value()); }
+
+ inline bool
+ operator==(const error_code& __lhs, const error_condition& __rhs)
+ {
+ return (__lhs.category().equivalent(__lhs.value(), __rhs)
+ || __rhs.category().equivalent(__lhs, __rhs.value()));
+ }
+
+ inline bool
+ operator==(const error_condition& __lhs, const error_code& __rhs)
+ {
+ return (__rhs.category().equivalent(__rhs.value(), __lhs)
+ || __lhs.category().equivalent(__rhs, __lhs.value()));
+ }
+
+ inline bool
+ operator==(const error_condition& __lhs, const error_condition& __rhs)
+ {
+ return (__lhs.category() == __rhs.category()
+ && __lhs.value() == __rhs.value());
+ }
+
+ inline bool
+ operator!=(const error_code& __lhs, const error_code& __rhs)
+ { return !(__lhs == __rhs); }
+
+ inline bool
+ operator!=(const error_code& __lhs, const error_condition& __rhs)
+ { return !(__lhs == __rhs); }
+
+ inline bool
+ operator!=(const error_condition& __lhs, const error_code& __rhs)
+ { return !(__lhs == __rhs); }
+
+ inline bool
+ operator!=(const error_condition& __lhs, const error_condition& __rhs)
+ { return !(__lhs == __rhs); }
+
+
+ /**
+ * @brief Thrown to indicate error code of underlying system.
+ *
+ * @ingroup exceptions
+ */
+ class system_error : public std::runtime_error
+ {
+ private:
+ error_code _M_code;
+
+ public:
+ system_error(error_code __ec = error_code())
+ : runtime_error(""), _M_code(__ec) { }
+
+ system_error(error_code __ec, const string& __what)
+ : runtime_error(__what), _M_code(__ec) { }
+
+ /*
+ * TODO: Add const char* ctors to all exceptions.
+ *
+ * system_error(error_code __ec, const char* __what)
+ * : runtime_error(__what), _M_code(__ec) { }
+ *
+ * system_error(int __v, const error_category& __ecat, const char* __what)
+ * : runtime_error(__what), _M_code(error_code(__v, __ecat)) { }
+ */
+
+ system_error(int __v, const error_category& __ecat)
+ : runtime_error(""), _M_code(error_code(__v, __ecat)) { }
+
+ system_error(int __v, const error_category& __ecat, const string& __what)
+ : runtime_error(__what), _M_code(error_code(__v, __ecat)) { }
+
+ virtual ~system_error() throw();
+
+ const error_code&
+ code() const throw() { return _M_code; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_SYSTEM_ERROR
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tgmath.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tgmath.h
new file mode 100644
index 0000000..3d84d37
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tgmath.h
@@ -0,0 +1,42 @@
+// -*- C++ -*- compatibility header.
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tgmath.h
+ * This is a Standard C++ Library header.
+ */
+
+#include <bits/c++config.h>
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# include <ctgmath>
+#else
+# if _GLIBCXX_HAVE_TGMATH_H
+# include_next <tgmath.h>
+# endif
+#endif
+
+#ifndef _GLIBCXX_TGMATH_H
+#define _GLIBCXX_TGMATH_H 1
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/thread b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/thread
new file mode 100644
index 0000000..6f735a0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/thread
@@ -0,0 +1,284 @@
+// <thread> -*- C++ -*-
+
+// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file thread
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_THREAD
+#define _GLIBCXX_THREAD 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#include <chrono>
+#include <functional>
+#include <memory>
+#include <mutex>
+#include <condition_variable>
+#include <cstddef>
+#include <bits/functexcept.h>
+#include <bits/gthr.h>
+
+#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
+
+namespace std
+{
+ /**
+ * @defgroup threads Threads
+ * @ingroup concurrency
+ *
+ * Classes for thread support.
+ * @{
+ */
+
+ /// thread
+ class thread
+ {
+ public:
+ typedef __gthread_t native_handle_type;
+ struct _Impl_base;
+ typedef shared_ptr<_Impl_base> __shared_base_type;
+
+ /// thread::id
+ class id
+ {
+ native_handle_type _M_thread;
+
+ public:
+ id() : _M_thread() { }
+
+ explicit
+ id(native_handle_type __id) : _M_thread(__id) { }
+
+ private:
+ friend class thread;
+
+ friend bool
+ operator==(thread::id __x, thread::id __y)
+ { return __gthread_equal(__x._M_thread, __y._M_thread); }
+
+ friend bool
+ operator<(thread::id __x, thread::id __y)
+ { return __x._M_thread < __y._M_thread; }
+
+ template<class _CharT, class _Traits>
+ friend basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>&& __out, thread::id __id);
+ };
+
+ // Simple base type that the templatized, derived class containing
+ // an arbitrary functor can be converted to and called.
+ struct _Impl_base
+ {
+ __shared_base_type _M_this_ptr;
+
+ virtual ~_Impl_base() = default;
+
+ virtual void _M_run() = 0;
+ };
+
+ template<typename _Callable>
+ struct _Impl : public _Impl_base
+ {
+ _Callable _M_func;
+
+ _Impl(_Callable&& __f) : _M_func(std::forward<_Callable>(__f))
+ { }
+
+ void
+ _M_run() { _M_func(); }
+ };
+
+ private:
+ id _M_id;
+
+ public:
+ thread() = default;
+ thread(const thread&) = delete;
+
+ thread(thread&& __t)
+ { swap(__t); }
+
+ template<typename _Callable>
+ explicit thread(_Callable __f)
+ { _M_start_thread(_M_make_routine<_Callable>(__f)); }
+
+ template<typename _Callable, typename... _Args>
+ thread(_Callable&& __f, _Args&&... __args)
+ { _M_start_thread(_M_make_routine(std::bind(__f, __args...))); }
+
+ ~thread()
+ {
+ if (joinable())
+ std::terminate();
+ }
+
+ thread& operator=(const thread&) = delete;
+
+ thread& operator=(thread&& __t)
+ {
+ if (joinable())
+ std::terminate();
+ swap(__t);
+ return *this;
+ }
+
+ void
+ swap(thread&& __t)
+ { std::swap(_M_id, __t._M_id); }
+
+ bool
+ joinable() const
+ { return !(_M_id == id()); }
+
+ void
+ join();
+
+ void
+ detach();
+
+ thread::id
+ get_id() const
+ { return _M_id; }
+
+ /** @pre thread is joinable
+ */
+ native_handle_type
+ native_handle()
+ { return _M_id._M_thread; }
+
+ // Returns a value that hints at the number of hardware thread contexts.
+ static unsigned int
+ hardware_concurrency()
+ { return 0; }
+
+ private:
+ void
+ _M_start_thread(__shared_base_type);
+
+ template<typename _Callable>
+ shared_ptr<_Impl<_Callable>>
+ _M_make_routine(_Callable&& __f)
+ {
+ // Create and allocate full data structure, not base.
+ return make_shared<_Impl<_Callable>>(std::forward<_Callable>(__f));
+ }
+ };
+
+ inline void
+ swap(thread& __x, thread& __y)
+ { __x.swap(__y); }
+
+ inline void
+ swap(thread&& __x, thread& __y)
+ { __x.swap(__y); }
+
+ inline void
+ swap(thread& __x, thread&& __y)
+ { __x.swap(__y); }
+
+ inline bool
+ operator!=(thread::id __x, thread::id __y)
+ { return !(__x == __y); }
+
+ inline bool
+ operator<=(thread::id __x, thread::id __y)
+ { return !(__y < __x); }
+
+ inline bool
+ operator>(thread::id __x, thread::id __y)
+ { return __y < __x; }
+
+ inline bool
+ operator>=(thread::id __x, thread::id __y)
+ { return !(__x < __y); }
+
+ template<class _CharT, class _Traits>
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>&& __out, thread::id __id)
+ {
+ if (__id == thread::id())
+ return __out << "thread::id of a non-executing thread";
+ else
+ return __out << __id._M_thread;
+ }
+
+ /** @namespace std::this_thread
+ * @brief ISO C++ 0x entities sub namespace for thread.
+ * 30.2.2 Namespace this_thread.
+ */
+ namespace this_thread
+ {
+ /// get_id
+ inline thread::id
+ get_id() { return thread::id(__gthread_self()); }
+
+#ifdef _GLIBCXX_USE_SCHED_YIELD
+ /// yield
+ inline void
+ yield()
+ { __gthread_yield(); }
+#endif
+
+#ifdef _GLIBCXX_USE_NANOSLEEP
+ /// sleep_until
+ template<typename _Clock, typename _Duration>
+ inline void
+ sleep_until(const chrono::time_point<_Clock, _Duration>& __atime)
+ { sleep_for(__atime - _Clock::now()); }
+
+ /// sleep_for
+ template<typename _Rep, typename _Period>
+ inline void
+ sleep_for(const chrono::duration<_Rep, _Period>& __rtime)
+ {
+ chrono::seconds __s =
+ chrono::duration_cast<chrono::seconds>(__rtime);
+
+ chrono::nanoseconds __ns =
+ chrono::duration_cast<chrono::nanoseconds>(__rtime - __s);
+
+ __gthread_time_t __ts =
+ {
+ static_cast<std::time_t>(__s.count()),
+ static_cast<long>(__ns.count())
+ };
+
+ ::nanosleep(&__ts, 0);
+ }
+#endif
+ }
+
+ // @} group threads
+}
+
+#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_THREAD
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/array b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/array
new file mode 100644
index 0000000..17cf5d2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/array
@@ -0,0 +1,54 @@
+// class template array -*- C++ -*-
+
+// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/array
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_ARRAY
+#define _GLIBCXX_TR1_ARRAY 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <bits/stl_algobase.h>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/array>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/array>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_ARRAY
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/bessel_function.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/bessel_function.tcc
new file mode 100644
index 0000000..2510215
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/bessel_function.tcc
@@ -0,0 +1,627 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/bessel_function.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland.
+//
+// References:
+// (1) Handbook of Mathematical Functions,
+// ed. Milton Abramowitz and Irene A. Stegun,
+// Dover Publications,
+// Section 9, pp. 355-434, Section 10 pp. 435-478
+// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
+// (3) Numerical Recipes in C, by W. H. Press, S. A. Teukolsky,
+// W. T. Vetterling, B. P. Flannery, Cambridge University Press (1992),
+// 2nd ed, pp. 240-245
+
+#ifndef _GLIBCXX_TR1_BESSEL_FUNCTION_TCC
+#define _GLIBCXX_TR1_BESSEL_FUNCTION_TCC 1
+
+#include "special_function_util.h"
+
+namespace std
+{
+namespace tr1
+{
+
+ // [5.2] Special functions
+
+ // Implementation-space details.
+ namespace __detail
+ {
+
+ /**
+ * @brief Compute the gamma functions required by the Temme series
+ * expansions of @f$ N_\nu(x) @f$ and @f$ K_\nu(x) @f$.
+ * @f[
+ * \Gamma_1 = \frac{1}{2\mu}
+ * [\frac{1}{\Gamma(1 - \mu)} - \frac{1}{\Gamma(1 + \mu)}]
+ * @f]
+ * and
+ * @f[
+ * \Gamma_2 = \frac{1}{2}
+ * [\frac{1}{\Gamma(1 - \mu)} + \frac{1}{\Gamma(1 + \mu)}]
+ * @f]
+ * where @f$ -1/2 <= \mu <= 1/2 @f$ is @f$ \mu = \nu - N @f$ and @f$ N @f$.
+ * is the nearest integer to @f$ \nu @f$.
+ * The values of \f$ \Gamma(1 + \mu) \f$ and \f$ \Gamma(1 - \mu) \f$
+ * are returned as well.
+ *
+ * The accuracy requirements on this are exquisite.
+ *
+ * @param __mu The input parameter of the gamma functions.
+ * @param __gam1 The output function \f$ \Gamma_1(\mu) \f$
+ * @param __gam2 The output function \f$ \Gamma_2(\mu) \f$
+ * @param __gampl The output function \f$ \Gamma(1 + \mu) \f$
+ * @param __gammi The output function \f$ \Gamma(1 - \mu) \f$
+ */
+ template <typename _Tp>
+ void
+ __gamma_temme(const _Tp __mu,
+ _Tp & __gam1, _Tp & __gam2, _Tp & __gampl, _Tp & __gammi)
+ {
+#if _GLIBCXX_USE_C99_MATH_TR1
+ __gampl = _Tp(1) / std::tr1::tgamma(_Tp(1) + __mu);
+ __gammi = _Tp(1) / std::tr1::tgamma(_Tp(1) - __mu);
+#else
+ __gampl = _Tp(1) / __gamma(_Tp(1) + __mu);
+ __gammi = _Tp(1) / __gamma(_Tp(1) - __mu);
+#endif
+
+ if (std::abs(__mu) < std::numeric_limits<_Tp>::epsilon())
+ __gam1 = -_Tp(__numeric_constants<_Tp>::__gamma_e());
+ else
+ __gam1 = (__gammi - __gampl) / (_Tp(2) * __mu);
+
+ __gam2 = (__gammi + __gampl) / (_Tp(2));
+
+ return;
+ }
+
+
+ /**
+ * @brief Compute the Bessel @f$ J_\nu(x) @f$ and Neumann
+ * @f$ N_\nu(x) @f$ functions and their first derivatives
+ * @f$ J'_\nu(x) @f$ and @f$ N'_\nu(x) @f$ respectively.
+ * These four functions are computed together for numerical
+ * stability.
+ *
+ * @param __nu The order of the Bessel functions.
+ * @param __x The argument of the Bessel functions.
+ * @param __Jnu The output Bessel function of the first kind.
+ * @param __Nnu The output Neumann function (Bessel function of the second kind).
+ * @param __Jpnu The output derivative of the Bessel function of the first kind.
+ * @param __Npnu The output derivative of the Neumann function.
+ */
+ template <typename _Tp>
+ void
+ __bessel_jn(const _Tp __nu, const _Tp __x,
+ _Tp & __Jnu, _Tp & __Nnu, _Tp & __Jpnu, _Tp & __Npnu)
+ {
+ if (__x == _Tp(0))
+ {
+ if (__nu == _Tp(0))
+ {
+ __Jnu = _Tp(1);
+ __Jpnu = _Tp(0);
+ }
+ else if (__nu == _Tp(1))
+ {
+ __Jnu = _Tp(0);
+ __Jpnu = _Tp(0.5L);
+ }
+ else
+ {
+ __Jnu = _Tp(0);
+ __Jpnu = _Tp(0);
+ }
+ __Nnu = -std::numeric_limits<_Tp>::infinity();
+ __Npnu = std::numeric_limits<_Tp>::infinity();
+ return;
+ }
+
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ // When the multiplier is N i.e.
+ // fp_min = N * min()
+ // Then J_0 and N_0 tank at x = 8 * N (J_0 = 0 and N_0 = nan)!
+ //const _Tp __fp_min = _Tp(20) * std::numeric_limits<_Tp>::min();
+ const _Tp __fp_min = std::sqrt(std::numeric_limits<_Tp>::min());
+ const int __max_iter = 15000;
+ const _Tp __x_min = _Tp(2);
+
+ const int __nl = (__x < __x_min
+ ? static_cast<int>(__nu + _Tp(0.5L))
+ : std::max(0, static_cast<int>(__nu - __x + _Tp(1.5L))));
+
+ const _Tp __mu = __nu - __nl;
+ const _Tp __mu2 = __mu * __mu;
+ const _Tp __xi = _Tp(1) / __x;
+ const _Tp __xi2 = _Tp(2) * __xi;
+ _Tp __w = __xi2 / __numeric_constants<_Tp>::__pi();
+ int __isign = 1;
+ _Tp __h = __nu * __xi;
+ if (__h < __fp_min)
+ __h = __fp_min;
+ _Tp __b = __xi2 * __nu;
+ _Tp __d = _Tp(0);
+ _Tp __c = __h;
+ int __i;
+ for (__i = 1; __i <= __max_iter; ++__i)
+ {
+ __b += __xi2;
+ __d = __b - __d;
+ if (std::abs(__d) < __fp_min)
+ __d = __fp_min;
+ __c = __b - _Tp(1) / __c;
+ if (std::abs(__c) < __fp_min)
+ __c = __fp_min;
+ __d = _Tp(1) / __d;
+ const _Tp __del = __c * __d;
+ __h *= __del;
+ if (__d < _Tp(0))
+ __isign = -__isign;
+ if (std::abs(__del - _Tp(1)) < __eps)
+ break;
+ }
+ if (__i > __max_iter)
+ std::__throw_runtime_error(__N("Argument x too large in __bessel_jn; "
+ "try asymptotic expansion."));
+ _Tp __Jnul = __isign * __fp_min;
+ _Tp __Jpnul = __h * __Jnul;
+ _Tp __Jnul1 = __Jnul;
+ _Tp __Jpnu1 = __Jpnul;
+ _Tp __fact = __nu * __xi;
+ for ( int __l = __nl; __l >= 1; --__l )
+ {
+ const _Tp __Jnutemp = __fact * __Jnul + __Jpnul;
+ __fact -= __xi;
+ __Jpnul = __fact * __Jnutemp - __Jnul;
+ __Jnul = __Jnutemp;
+ }
+ if (__Jnul == _Tp(0))
+ __Jnul = __eps;
+ _Tp __f= __Jpnul / __Jnul;
+ _Tp __Nmu, __Nnu1, __Npmu, __Jmu;
+ if (__x < __x_min)
+ {
+ const _Tp __x2 = __x / _Tp(2);
+ const _Tp __pimu = __numeric_constants<_Tp>::__pi() * __mu;
+ _Tp __fact = (std::abs(__pimu) < __eps
+ ? _Tp(1) : __pimu / std::sin(__pimu));
+ _Tp __d = -std::log(__x2);
+ _Tp __e = __mu * __d;
+ _Tp __fact2 = (std::abs(__e) < __eps
+ ? _Tp(1) : std::sinh(__e) / __e);
+ _Tp __gam1, __gam2, __gampl, __gammi;
+ __gamma_temme(__mu, __gam1, __gam2, __gampl, __gammi);
+ _Tp __ff = (_Tp(2) / __numeric_constants<_Tp>::__pi())
+ * __fact * (__gam1 * std::cosh(__e) + __gam2 * __fact2 * __d);
+ __e = std::exp(__e);
+ _Tp __p = __e / (__numeric_constants<_Tp>::__pi() * __gampl);
+ _Tp __q = _Tp(1) / (__e * __numeric_constants<_Tp>::__pi() * __gammi);
+ const _Tp __pimu2 = __pimu / _Tp(2);
+ _Tp __fact3 = (std::abs(__pimu2) < __eps
+ ? _Tp(1) : std::sin(__pimu2) / __pimu2 );
+ _Tp __r = __numeric_constants<_Tp>::__pi() * __pimu2 * __fact3 * __fact3;
+ _Tp __c = _Tp(1);
+ __d = -__x2 * __x2;
+ _Tp __sum = __ff + __r * __q;
+ _Tp __sum1 = __p;
+ for (__i = 1; __i <= __max_iter; ++__i)
+ {
+ __ff = (__i * __ff + __p + __q) / (__i * __i - __mu2);
+ __c *= __d / _Tp(__i);
+ __p /= _Tp(__i) - __mu;
+ __q /= _Tp(__i) + __mu;
+ const _Tp __del = __c * (__ff + __r * __q);
+ __sum += __del;
+ const _Tp __del1 = __c * __p - __i * __del;
+ __sum1 += __del1;
+ if ( std::abs(__del) < __eps * (_Tp(1) + std::abs(__sum)) )
+ break;
+ }
+ if ( __i > __max_iter )
+ std::__throw_runtime_error(__N("Bessel y series failed to converge "
+ "in __bessel_jn."));
+ __Nmu = -__sum;
+ __Nnu1 = -__sum1 * __xi2;
+ __Npmu = __mu * __xi * __Nmu - __Nnu1;
+ __Jmu = __w / (__Npmu - __f * __Nmu);
+ }
+ else
+ {
+ _Tp __a = _Tp(0.25L) - __mu2;
+ _Tp __q = _Tp(1);
+ _Tp __p = -__xi / _Tp(2);
+ _Tp __br = _Tp(2) * __x;
+ _Tp __bi = _Tp(2);
+ _Tp __fact = __a * __xi / (__p * __p + __q * __q);
+ _Tp __cr = __br + __q * __fact;
+ _Tp __ci = __bi + __p * __fact;
+ _Tp __den = __br * __br + __bi * __bi;
+ _Tp __dr = __br / __den;
+ _Tp __di = -__bi / __den;
+ _Tp __dlr = __cr * __dr - __ci * __di;
+ _Tp __dli = __cr * __di + __ci * __dr;
+ _Tp __temp = __p * __dlr - __q * __dli;
+ __q = __p * __dli + __q * __dlr;
+ __p = __temp;
+ int __i;
+ for (__i = 2; __i <= __max_iter; ++__i)
+ {
+ __a += _Tp(2 * (__i - 1));
+ __bi += _Tp(2);
+ __dr = __a * __dr + __br;
+ __di = __a * __di + __bi;
+ if (std::abs(__dr) + std::abs(__di) < __fp_min)
+ __dr = __fp_min;
+ __fact = __a / (__cr * __cr + __ci * __ci);
+ __cr = __br + __cr * __fact;
+ __ci = __bi - __ci * __fact;
+ if (std::abs(__cr) + std::abs(__ci) < __fp_min)
+ __cr = __fp_min;
+ __den = __dr * __dr + __di * __di;
+ __dr /= __den;
+ __di /= -__den;
+ __dlr = __cr * __dr - __ci * __di;
+ __dli = __cr * __di + __ci * __dr;
+ __temp = __p * __dlr - __q * __dli;
+ __q = __p * __dli + __q * __dlr;
+ __p = __temp;
+ if (std::abs(__dlr - _Tp(1)) + std::abs(__dli) < __eps)
+ break;
+ }
+ if (__i > __max_iter)
+ std::__throw_runtime_error(__N("Lentz's method failed "
+ "in __bessel_jn."));
+ const _Tp __gam = (__p - __f) / __q;
+ __Jmu = std::sqrt(__w / ((__p - __f) * __gam + __q));
+#if _GLIBCXX_USE_C99_MATH_TR1
+ __Jmu = std::tr1::copysign(__Jmu, __Jnul);
+#else
+ if (__Jmu * __Jnul < _Tp(0))
+ __Jmu = -__Jmu;
+#endif
+ __Nmu = __gam * __Jmu;
+ __Npmu = (__p + __q / __gam) * __Nmu;
+ __Nnu1 = __mu * __xi * __Nmu - __Npmu;
+ }
+ __fact = __Jmu / __Jnul;
+ __Jnu = __fact * __Jnul1;
+ __Jpnu = __fact * __Jpnu1;
+ for (__i = 1; __i <= __nl; ++__i)
+ {
+ const _Tp __Nnutemp = (__mu + __i) * __xi2 * __Nnu1 - __Nmu;
+ __Nmu = __Nnu1;
+ __Nnu1 = __Nnutemp;
+ }
+ __Nnu = __Nmu;
+ __Npnu = __nu * __xi * __Nmu - __Nnu1;
+
+ return;
+ }
+
+
+ /**
+ * @brief This routine computes the asymptotic cylindrical Bessel
+ * and Neumann functions of order nu: \f$ J_{\nu} \f$,
+ * \f$ N_{\nu} \f$.
+ *
+ * References:
+ * (1) Handbook of Mathematical Functions,
+ * ed. Milton Abramowitz and Irene A. Stegun,
+ * Dover Publications,
+ * Section 9 p. 364, Equations 9.2.5-9.2.10
+ *
+ * @param __nu The order of the Bessel functions.
+ * @param __x The argument of the Bessel functions.
+ * @param __Jnu The output Bessel function of the first kind.
+ * @param __Nnu The output Neumann function (Bessel function of the second kind).
+ */
+ template <typename _Tp>
+ void
+ __cyl_bessel_jn_asymp(const _Tp __nu, const _Tp __x,
+ _Tp & __Jnu, _Tp & __Nnu)
+ {
+ const _Tp __coef = std::sqrt(_Tp(2)
+ / (__numeric_constants<_Tp>::__pi() * __x));
+ const _Tp __mu = _Tp(4) * __nu * __nu;
+ const _Tp __mum1 = __mu - _Tp(1);
+ const _Tp __mum9 = __mu - _Tp(9);
+ const _Tp __mum25 = __mu - _Tp(25);
+ const _Tp __mum49 = __mu - _Tp(49);
+ const _Tp __xx = _Tp(64) * __x * __x;
+ const _Tp __P = _Tp(1) - __mum1 * __mum9 / (_Tp(2) * __xx)
+ * (_Tp(1) - __mum25 * __mum49 / (_Tp(12) * __xx));
+ const _Tp __Q = __mum1 / (_Tp(8) * __x)
+ * (_Tp(1) - __mum9 * __mum25 / (_Tp(6) * __xx));
+
+ const _Tp __chi = __x - (__nu + _Tp(0.5L))
+ * __numeric_constants<_Tp>::__pi_2();
+ const _Tp __c = std::cos(__chi);
+ const _Tp __s = std::sin(__chi);
+
+ __Jnu = __coef * (__c * __P - __s * __Q);
+ __Nnu = __coef * (__s * __P + __c * __Q);
+
+ return;
+ }
+
+
+ /**
+ * @brief This routine returns the cylindrical Bessel functions
+ * of order \f$ \nu \f$: \f$ J_{\nu} \f$ or \f$ I_{\nu} \f$
+ * by series expansion.
+ *
+ * The modified cylindrical Bessel function is:
+ * @f[
+ * Z_{\nu}(x) = \sum_{k=0}^{\infty}
+ * \frac{\sigma^k (x/2)^{\nu + 2k}}{k!\Gamma(\nu+k+1)}
+ * @f]
+ * where \f$ \sigma = +1 \f$ or\f$ -1 \f$ for
+ * \f$ Z = I \f$ or \f$ J \f$ respectively.
+ *
+ * See Abramowitz & Stegun, 9.1.10
+ * Abramowitz & Stegun, 9.6.7
+ * (1) Handbook of Mathematical Functions,
+ * ed. Milton Abramowitz and Irene A. Stegun,
+ * Dover Publications,
+ * Equation 9.1.10 p. 360 and Equation 9.6.10 p. 375
+ *
+ * @param __nu The order of the Bessel function.
+ * @param __x The argument of the Bessel function.
+ * @param __sgn The sign of the alternate terms
+ * -1 for the Bessel function of the first kind.
+ * +1 for the modified Bessel function of the first kind.
+ * @return The output Bessel function.
+ */
+ template <typename _Tp>
+ _Tp
+ __cyl_bessel_ij_series(const _Tp __nu, const _Tp __x, const _Tp __sgn,
+ const unsigned int __max_iter)
+ {
+
+ const _Tp __x2 = __x / _Tp(2);
+ _Tp __fact = __nu * std::log(__x2);
+#if _GLIBCXX_USE_C99_MATH_TR1
+ __fact -= std::tr1::lgamma(__nu + _Tp(1));
+#else
+ __fact -= __log_gamma(__nu + _Tp(1));
+#endif
+ __fact = std::exp(__fact);
+ const _Tp __xx4 = __sgn * __x2 * __x2;
+ _Tp __Jn = _Tp(1);
+ _Tp __term = _Tp(1);
+
+ for (unsigned int __i = 1; __i < __max_iter; ++__i)
+ {
+ __term *= __xx4 / (_Tp(__i) * (__nu + _Tp(__i)));
+ __Jn += __term;
+ if (std::abs(__term / __Jn) < std::numeric_limits<_Tp>::epsilon())
+ break;
+ }
+
+ return __fact * __Jn;
+ }
+
+
+ /**
+ * @brief Return the Bessel function of order \f$ \nu \f$:
+ * \f$ J_{\nu}(x) \f$.
+ *
+ * The cylindrical Bessel function is:
+ * @f[
+ * J_{\nu}(x) = \sum_{k=0}^{\infty}
+ * \frac{(-1)^k (x/2)^{\nu + 2k}}{k!\Gamma(\nu+k+1)}
+ * @f]
+ *
+ * @param __nu The order of the Bessel function.
+ * @param __x The argument of the Bessel function.
+ * @return The output Bessel function.
+ */
+ template<typename _Tp>
+ _Tp
+ __cyl_bessel_j(const _Tp __nu, const _Tp __x)
+ {
+ if (__nu < _Tp(0) || __x < _Tp(0))
+ std::__throw_domain_error(__N("Bad argument "
+ "in __cyl_bessel_j."));
+ else if (__isnan(__nu) || __isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__x * __x < _Tp(10) * (__nu + _Tp(1)))
+ return __cyl_bessel_ij_series(__nu, __x, -_Tp(1), 200);
+ else if (__x > _Tp(1000))
+ {
+ _Tp __J_nu, __N_nu;
+ __cyl_bessel_jn_asymp(__nu, __x, __J_nu, __N_nu);
+ return __J_nu;
+ }
+ else
+ {
+ _Tp __J_nu, __N_nu, __Jp_nu, __Np_nu;
+ __bessel_jn(__nu, __x, __J_nu, __N_nu, __Jp_nu, __Np_nu);
+ return __J_nu;
+ }
+ }
+
+
+ /**
+ * @brief Return the Neumann function of order \f$ \nu \f$:
+ * \f$ N_{\nu}(x) \f$.
+ *
+ * The Neumann function is defined by:
+ * @f[
+ * N_{\nu}(x) = \frac{J_{\nu}(x) \cos \nu\pi - J_{-\nu}(x)}
+ * {\sin \nu\pi}
+ * @f]
+ * where for integral \f$ \nu = n \f$ a limit is taken:
+ * \f$ lim_{\nu \to n} \f$.
+ *
+ * @param __nu The order of the Neumann function.
+ * @param __x The argument of the Neumann function.
+ * @return The output Neumann function.
+ */
+ template<typename _Tp>
+ _Tp
+ __cyl_neumann_n(const _Tp __nu, const _Tp __x)
+ {
+ if (__nu < _Tp(0) || __x < _Tp(0))
+ std::__throw_domain_error(__N("Bad argument "
+ "in __cyl_neumann_n."));
+ else if (__isnan(__nu) || __isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__x > _Tp(1000))
+ {
+ _Tp __J_nu, __N_nu;
+ __cyl_bessel_jn_asymp(__nu, __x, __J_nu, __N_nu);
+ return __N_nu;
+ }
+ else
+ {
+ _Tp __J_nu, __N_nu, __Jp_nu, __Np_nu;
+ __bessel_jn(__nu, __x, __J_nu, __N_nu, __Jp_nu, __Np_nu);
+ return __N_nu;
+ }
+ }
+
+
+ /**
+ * @brief Compute the spherical Bessel @f$ j_n(x) @f$
+ * and Neumann @f$ n_n(x) @f$ functions and their first
+ * derivatives @f$ j'_n(x) @f$ and @f$ n'_n(x) @f$
+ * respectively.
+ *
+ * @param __n The order of the spherical Bessel function.
+ * @param __x The argument of the spherical Bessel function.
+ * @param __j_n The output spherical Bessel function.
+ * @param __n_n The output spherical Neumann function.
+ * @param __jp_n The output derivative of the spherical Bessel function.
+ * @param __np_n The output derivative of the spherical Neumann function.
+ */
+ template <typename _Tp>
+ void
+ __sph_bessel_jn(const unsigned int __n, const _Tp __x,
+ _Tp & __j_n, _Tp & __n_n, _Tp & __jp_n, _Tp & __np_n)
+ {
+ const _Tp __nu = _Tp(__n) + _Tp(0.5L);
+
+ _Tp __J_nu, __N_nu, __Jp_nu, __Np_nu;
+ __bessel_jn(__nu, __x, __J_nu, __N_nu, __Jp_nu, __Np_nu);
+
+ const _Tp __factor = __numeric_constants<_Tp>::__sqrtpio2()
+ / std::sqrt(__x);
+
+ __j_n = __factor * __J_nu;
+ __n_n = __factor * __N_nu;
+ __jp_n = __factor * __Jp_nu - __j_n / (_Tp(2) * __x);
+ __np_n = __factor * __Np_nu - __n_n / (_Tp(2) * __x);
+
+ return;
+ }
+
+
+ /**
+ * @brief Return the spherical Bessel function
+ * @f$ j_n(x) @f$ of order n.
+ *
+ * The spherical Bessel function is defined by:
+ * @f[
+ * j_n(x) = \left( \frac{\pi}{2x} \right) ^{1/2} J_{n+1/2}(x)
+ * @f]
+ *
+ * @param __n The order of the spherical Bessel function.
+ * @param __x The argument of the spherical Bessel function.
+ * @return The output spherical Bessel function.
+ */
+ template <typename _Tp>
+ _Tp
+ __sph_bessel(const unsigned int __n, const _Tp __x)
+ {
+ if (__x < _Tp(0))
+ std::__throw_domain_error(__N("Bad argument "
+ "in __sph_bessel."));
+ else if (__isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__x == _Tp(0))
+ {
+ if (__n == 0)
+ return _Tp(1);
+ else
+ return _Tp(0);
+ }
+ else
+ {
+ _Tp __j_n, __n_n, __jp_n, __np_n;
+ __sph_bessel_jn(__n, __x, __j_n, __n_n, __jp_n, __np_n);
+ return __j_n;
+ }
+ }
+
+
+ /**
+ * @brief Return the spherical Neumann function
+ * @f$ n_n(x) @f$.
+ *
+ * The spherical Neumann function is defined by:
+ * @f[
+ * n_n(x) = \left( \frac{\pi}{2x} \right) ^{1/2} N_{n+1/2}(x)
+ * @f]
+ *
+ * @param __n The order of the spherical Neumann function.
+ * @param __x The argument of the spherical Neumann function.
+ * @return The output spherical Neumann function.
+ */
+ template <typename _Tp>
+ _Tp
+ __sph_neumann(const unsigned int __n, const _Tp __x)
+ {
+ if (__x < _Tp(0))
+ std::__throw_domain_error(__N("Bad argument "
+ "in __sph_neumann."));
+ else if (__isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__x == _Tp(0))
+ return -std::numeric_limits<_Tp>::infinity();
+ else
+ {
+ _Tp __j_n, __n_n, __jp_n, __np_n;
+ __sph_bessel_jn(__n, __x, __j_n, __n_n, __jp_n, __np_n);
+ return __n_n;
+ }
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // _GLIBCXX_TR1_BESSEL_FUNCTION_TCC
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/beta_function.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/beta_function.tcc
new file mode 100644
index 0000000..f9d1860
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/beta_function.tcc
@@ -0,0 +1,197 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/beta_function.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland based on:
+// (1) Handbook of Mathematical Functions,
+// ed. Milton Abramowitz and Irene A. Stegun,
+// Dover Publications,
+// Section 6, pp. 253-266
+// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
+// (3) Numerical Recipes in C, by W. H. Press, S. A. Teukolsky,
+// W. T. Vetterling, B. P. Flannery, Cambridge University Press (1992),
+// 2nd ed, pp. 213-216
+// (4) Gamma, Exploring Euler's Constant, Julian Havil,
+// Princeton, 2003.
+
+#ifndef _GLIBCXX_TR1_BETA_FUNCTION_TCC
+#define _GLIBCXX_TR1_BETA_FUNCTION_TCC 1
+
+namespace std
+{
+namespace tr1
+{
+
+ // [5.2] Special functions
+
+ // Implementation-space details.
+ namespace __detail
+ {
+
+ /**
+ * @brief Return the beta function: \f$B(x,y)\f$.
+ *
+ * The beta function is defined by
+ * @f[
+ * B(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}
+ * @f]
+ *
+ * @param __x The first argument of the beta function.
+ * @param __y The second argument of the beta function.
+ * @return The beta function.
+ */
+ template<typename _Tp>
+ _Tp
+ __beta_gamma(_Tp __x, _Tp __y)
+ {
+
+ _Tp __bet;
+#if _GLIBCXX_USE_C99_MATH_TR1
+ if (__x > __y)
+ {
+ __bet = std::tr1::tgamma(__x)
+ / std::tr1::tgamma(__x + __y);
+ __bet *= std::tr1::tgamma(__y);
+ }
+ else
+ {
+ __bet = std::tr1::tgamma(__y)
+ / std::tr1::tgamma(__x + __y);
+ __bet *= std::tr1::tgamma(__x);
+ }
+#else
+ if (__x > __y)
+ {
+ __bet = __gamma(__x) / __gamma(__x + __y);
+ __bet *= __gamma(__y);
+ }
+ else
+ {
+ __bet = __gamma(__y) / __gamma(__x + __y);
+ __bet *= __gamma(__x);
+ }
+#endif
+
+ return __bet;
+ }
+
+ /**
+ * @brief Return the beta function \f$B(x,y)\f$ using
+ * the log gamma functions.
+ *
+ * The beta function is defined by
+ * @f[
+ * B(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}
+ * @f]
+ *
+ * @param __x The first argument of the beta function.
+ * @param __y The second argument of the beta function.
+ * @return The beta function.
+ */
+ template<typename _Tp>
+ _Tp
+ __beta_lgamma(_Tp __x, _Tp __y)
+ {
+#if _GLIBCXX_USE_C99_MATH_TR1
+ _Tp __bet = std::tr1::lgamma(__x)
+ + std::tr1::lgamma(__y)
+ - std::tr1::lgamma(__x + __y);
+#else
+ _Tp __bet = __log_gamma(__x)
+ + __log_gamma(__y)
+ - __log_gamma(__x + __y);
+#endif
+ __bet = std::exp(__bet);
+ return __bet;
+ }
+
+
+ /**
+ * @brief Return the beta function \f$B(x,y)\f$ using
+ * the product form.
+ *
+ * The beta function is defined by
+ * @f[
+ * B(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}
+ * @f]
+ *
+ * @param __x The first argument of the beta function.
+ * @param __y The second argument of the beta function.
+ * @return The beta function.
+ */
+ template<typename _Tp>
+ _Tp
+ __beta_product(_Tp __x, _Tp __y)
+ {
+
+ _Tp __bet = (__x + __y) / (__x * __y);
+
+ unsigned int __max_iter = 1000000;
+ for (unsigned int __k = 1; __k < __max_iter; ++__k)
+ {
+ _Tp __term = (_Tp(1) + (__x + __y) / __k)
+ / ((_Tp(1) + __x / __k) * (_Tp(1) + __y / __k));
+ __bet *= __term;
+ }
+
+ return __bet;
+ }
+
+
+ /**
+ * @brief Return the beta function \f$ B(x,y) \f$.
+ *
+ * The beta function is defined by
+ * @f[
+ * B(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}
+ * @f]
+ *
+ * @param __x The first argument of the beta function.
+ * @param __y The second argument of the beta function.
+ * @return The beta function.
+ */
+ template<typename _Tp>
+ inline _Tp
+ __beta(_Tp __x, _Tp __y)
+ {
+ if (__isnan(__x) || __isnan(__y))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else
+ return __beta_lgamma(__x, __y);
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // __GLIBCXX_TR1_BETA_FUNCTION_TCC
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/ccomplex b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/ccomplex
new file mode 100644
index 0000000..a0ae33e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/ccomplex
@@ -0,0 +1,34 @@
+// TR1 ccomplex -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/ccomplex
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CCOMPLEX
+#define _GLIBCXX_TR1_CCOMPLEX 1
+
+#include <tr1/complex>
+
+#endif // _GLIBCXX_TR1_CCOMPLEX
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cctype b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cctype
new file mode 100644
index 0000000..93e864e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cctype
@@ -0,0 +1,49 @@
+// TR1 cctype -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cctype
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CCTYPE
+#define _GLIBCXX_TR1_CCTYPE 1
+
+#include <bits/c++config.h>
+#include <cctype>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/cctype>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/cctype>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_CCTYPE
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cfenv b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cfenv
new file mode 100644
index 0000000..e4c4fac
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cfenv
@@ -0,0 +1,53 @@
+// TR1 cfenv -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cfenv
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CFENV
+#define _GLIBCXX_TR1_CFENV 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#if _GLIBCXX_HAVE_FENV_H
+# include <fenv.h>
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/cfenv>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/cfenv>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_CFENV
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cfloat b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cfloat
new file mode 100644
index 0000000..801cfc3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cfloat
@@ -0,0 +1,42 @@
+// TR1 cfloat -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cfloat
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CFLOAT
+#define _GLIBCXX_TR1_CFLOAT 1
+
+#include <cfloat>
+
+#ifndef DECIMAL_DIG
+#define DECIMAL_DIG __DECIMAL_DIG__
+#endif
+
+#ifndef FLT_EVAL_METHOD
+#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
+#endif
+
+#endif //_GLIBCXX_TR1_CFLOAT
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cinttypes b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cinttypes
new file mode 100644
index 0000000..71fd545
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cinttypes
@@ -0,0 +1,63 @@
+// TR1 cinttypes -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cinttypes
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CINTTYPES
+#define _GLIBCXX_TR1_CINTTYPES 1
+
+#pragma GCC system_header
+
+#include <tr1/cstdint>
+
+// For 8.11.1/1 (see C99, Note 184)
+#if _GLIBCXX_HAVE_INTTYPES_H
+# ifndef __STDC_FORMAT_MACROS
+# define _UNDEF__STDC_FORMAT_MACROS
+# define __STDC_FORMAT_MACROS
+# endif
+# include <inttypes.h>
+# ifdef _UNDEF__STDC_FORMAT_MACROS
+# undef __STDC_FORMAT_MACROS
+# undef _UNDEF__STDC_FORMAT_MACROS
+# endif
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/cinttypes>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/cinttypes>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_CINTTYPES
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/climits b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/climits
new file mode 100644
index 0000000..91af96b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/climits
@@ -0,0 +1,46 @@
+// TR1 climits -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/climits
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CLIMITS
+#define _GLIBCXX_TR1_CLIMITS 1
+
+#include <climits>
+
+#ifndef LLONG_MIN
+#define LLONG_MIN (-__LONG_LONG_MAX__ - 1)
+#endif
+
+#ifndef LLONG_MAX
+#define LLONG_MAX __LONG_LONG_MAX__
+#endif
+
+#ifndef ULLONG_MAX
+#define ULLONG_MAX (__LONG_LONG_MAX__ * 2ULL + 1)
+#endif
+
+#endif // _GLIBCXX_TR1_CLIMITS
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cmath b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cmath
new file mode 100644
index 0000000..a9fbf2b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cmath
@@ -0,0 +1,507 @@
+// TR1 cmath -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cmath
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CMATH
+#define _GLIBCXX_TR1_CMATH 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <cmath>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/cmath>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/cmath>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+namespace std
+{
+namespace tr1
+{
+ // DR 550. What should the return type of pow(float,int) be?
+ // NB: C++0x and TR1 != C++03.
+ inline double
+ pow(double __x, double __y)
+ { return std::pow(__x, __y); }
+
+ inline float
+ pow(float __x, float __y)
+ { return std::pow(__x, __y); }
+
+ inline long double
+ pow(long double __x, long double __y)
+ { return std::pow(__x, __y); }
+
+ template<typename _Tp, typename _Up>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+ pow(_Tp __x, _Up __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return std::pow(__type(__x), __type(__y));
+ }
+}
+}
+
+#include <bits/stl_algobase.h>
+#include <limits>
+#include <tr1/type_traits>
+
+#include <tr1/gamma.tcc>
+#include <tr1/bessel_function.tcc>
+#include <tr1/beta_function.tcc>
+#include <tr1/ell_integral.tcc>
+#include <tr1/exp_integral.tcc>
+#include <tr1/hypergeometric.tcc>
+#include <tr1/legendre_function.tcc>
+#include <tr1/modified_bessel_func.tcc>
+#include <tr1/poly_hermite.tcc>
+#include <tr1/poly_laguerre.tcc>
+#include <tr1/riemann_zeta.tcc>
+
+namespace std
+{
+namespace tr1
+{
+ /**
+ * @defgroup tr1_math_spec_func Mathematical Special Functions
+ * @ingroup numerics
+ *
+ * A collection of advanced mathematical special functions.
+ * @{
+ */
+
+ inline float
+ assoc_laguerref(unsigned int __n, unsigned int __m, float __x)
+ { return __detail::__assoc_laguerre<float>(__n, __m, __x); }
+
+ inline long double
+ assoc_laguerrel(unsigned int __n, unsigned int __m, long double __x)
+ {
+ return __detail::__assoc_laguerre<long double>(__n, __m, __x);
+ }
+
+ /// 5.2.1.1 Associated Laguerre polynomials.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ assoc_laguerre(unsigned int __n, unsigned int __m, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__assoc_laguerre<__type>(__n, __m, __x);
+ }
+
+ inline float
+ assoc_legendref(unsigned int __l, unsigned int __m, float __x)
+ { return __detail::__assoc_legendre_p<float>(__l, __m, __x); }
+
+ inline long double
+ assoc_legendrel(unsigned int __l, unsigned int __m, long double __x)
+ { return __detail::__assoc_legendre_p<long double>(__l, __m, __x); }
+
+ /// 5.2.1.2 Associated Legendre functions.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ assoc_legendre(unsigned int __l, unsigned int __m, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__assoc_legendre_p<__type>(__l, __m, __x);
+ }
+
+ inline float
+ betaf(float __x, float __y)
+ { return __detail::__beta<float>(__x, __y); }
+
+ inline long double
+ betal(long double __x, long double __y)
+ { return __detail::__beta<long double>(__x, __y); }
+
+ /// 5.2.1.3 Beta functions.
+ template<typename _Tpx, typename _Tpy>
+ inline typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type
+ beta(_Tpx __x, _Tpy __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type __type;
+ return __detail::__beta<__type>(__x, __y);
+ }
+
+ inline float
+ comp_ellint_1f(float __k)
+ { return __detail::__comp_ellint_1<float>(__k); }
+
+ inline long double
+ comp_ellint_1l(long double __k)
+ { return __detail::__comp_ellint_1<long double>(__k); }
+
+ /// 5.2.1.4 Complete elliptic integrals of the first kind.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ comp_ellint_1(_Tp __k)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__comp_ellint_1<__type>(__k);
+ }
+
+ inline float
+ comp_ellint_2f(float __k)
+ { return __detail::__comp_ellint_2<float>(__k); }
+
+ inline long double
+ comp_ellint_2l(long double __k)
+ { return __detail::__comp_ellint_2<long double>(__k); }
+
+ /// 5.2.1.5 Complete elliptic integrals of the second kind.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ comp_ellint_2(_Tp __k)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__comp_ellint_2<__type>(__k);
+ }
+
+ inline float
+ comp_ellint_3f(float __k, float __nu)
+ { return __detail::__comp_ellint_3<float>(__k, __nu); }
+
+ inline long double
+ comp_ellint_3l(long double __k, long double __nu)
+ { return __detail::__comp_ellint_3<long double>(__k, __nu); }
+
+ /// 5.2.1.6 Complete elliptic integrals of the third kind.
+ template<typename _Tp, typename _Tpn>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type
+ comp_ellint_3(_Tp __k, _Tpn __nu)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type __type;
+ return __detail::__comp_ellint_3<__type>(__k, __nu);
+ }
+
+ inline float
+ conf_hypergf(float __a, float __c, float __x)
+ { return __detail::__conf_hyperg<float>(__a, __c, __x); }
+
+ inline long double
+ conf_hypergl(long double __a, long double __c, long double __x)
+ { return __detail::__conf_hyperg<long double>(__a, __c, __x); }
+
+ /// 5.2.1.7 Confluent hypergeometric functions.
+ template<typename _Tpa, typename _Tpc, typename _Tp>
+ inline typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type
+ conf_hyperg(_Tpa __a, _Tpc __c, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type __type;
+ return __detail::__conf_hyperg<__type>(__a, __c, __x);
+ }
+
+ inline float
+ cyl_bessel_if(float __nu, float __x)
+ { return __detail::__cyl_bessel_i<float>(__nu, __x); }
+
+ inline long double
+ cyl_bessel_il(long double __nu, long double __x)
+ { return __detail::__cyl_bessel_i<long double>(__nu, __x); }
+
+ /// 5.2.1.8 Regular modified cylindrical Bessel functions.
+ template<typename _Tpnu, typename _Tp>
+ inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
+ cyl_bessel_i(_Tpnu __nu, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
+ return __detail::__cyl_bessel_i<__type>(__nu, __x);
+ }
+
+ inline float
+ cyl_bessel_jf(float __nu, float __x)
+ { return __detail::__cyl_bessel_j<float>(__nu, __x); }
+
+ inline long double
+ cyl_bessel_jl(long double __nu, long double __x)
+ { return __detail::__cyl_bessel_j<long double>(__nu, __x); }
+
+ /// 5.2.1.9 Cylindrical Bessel functions (of the first kind).
+ template<typename _Tpnu, typename _Tp>
+ inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
+ cyl_bessel_j(_Tpnu __nu, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
+ return __detail::__cyl_bessel_j<__type>(__nu, __x);
+ }
+
+ inline float
+ cyl_bessel_kf(float __nu, float __x)
+ { return __detail::__cyl_bessel_k<float>(__nu, __x); }
+
+ inline long double
+ cyl_bessel_kl(long double __nu, long double __x)
+ { return __detail::__cyl_bessel_k<long double>(__nu, __x); }
+
+ /// 5.2.1.10 Irregular modified cylindrical Bessel functions.
+ template<typename _Tpnu, typename _Tp>
+ inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
+ cyl_bessel_k(_Tpnu __nu, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
+ return __detail::__cyl_bessel_k<__type>(__nu, __x);
+ }
+
+ inline float
+ cyl_neumannf(float __nu, float __x)
+ { return __detail::__cyl_neumann_n<float>(__nu, __x); }
+
+ inline long double
+ cyl_neumannl(long double __nu, long double __x)
+ { return __detail::__cyl_neumann_n<long double>(__nu, __x); }
+
+ /// 5.2.1.11 Cylindrical Neumann functions.
+ template<typename _Tpnu, typename _Tp>
+ inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
+ cyl_neumann(_Tpnu __nu, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
+ return __detail::__cyl_neumann_n<__type>(__nu, __x);
+ }
+
+ inline float
+ ellint_1f(float __k, float __phi)
+ { return __detail::__ellint_1<float>(__k, __phi); }
+
+ inline long double
+ ellint_1l(long double __k, long double __phi)
+ { return __detail::__ellint_1<long double>(__k, __phi); }
+
+ /// 5.2.1.12 Incomplete elliptic integrals of the first kind.
+ template<typename _Tp, typename _Tpp>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type
+ ellint_1(_Tp __k, _Tpp __phi)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type;
+ return __detail::__ellint_1<__type>(__k, __phi);
+ }
+
+ inline float
+ ellint_2f(float __k, float __phi)
+ { return __detail::__ellint_2<float>(__k, __phi); }
+
+ inline long double
+ ellint_2l(long double __k, long double __phi)
+ { return __detail::__ellint_2<long double>(__k, __phi); }
+
+ /// 5.2.1.13 Incomplete elliptic integrals of the second kind.
+ template<typename _Tp, typename _Tpp>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type
+ ellint_2(_Tp __k, _Tpp __phi)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type;
+ return __detail::__ellint_2<__type>(__k, __phi);
+ }
+
+ inline float
+ ellint_3f(float __k, float __nu, float __phi)
+ { return __detail::__ellint_3<float>(__k, __nu, __phi); }
+
+ inline long double
+ ellint_3l(long double __k, long double __nu, long double __phi)
+ { return __detail::__ellint_3<long double>(__k, __nu, __phi); }
+
+ /// 5.2.1.14 Incomplete elliptic integrals of the third kind.
+ template<typename _Tp, typename _Tpn, typename _Tpp>
+ inline typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type
+ ellint_3(_Tp __k, _Tpn __nu, _Tpp __phi)
+ {
+ typedef typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type __type;
+ return __detail::__ellint_3<__type>(__k, __nu, __phi);
+ }
+
+ inline float
+ expintf(float __x)
+ { return __detail::__expint<float>(__x); }
+
+ inline long double
+ expintl(long double __x)
+ { return __detail::__expint<long double>(__x); }
+
+ /// 5.2.1.15 Exponential integrals.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ expint(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__expint<__type>(__x);
+ }
+
+ inline float
+ hermitef(unsigned int __n, float __x)
+ { return __detail::__poly_hermite<float>(__n, __x); }
+
+ inline long double
+ hermitel(unsigned int __n, long double __x)
+ { return __detail::__poly_hermite<long double>(__n, __x); }
+
+ /// 5.2.1.16 Hermite polynomials.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ hermite(unsigned int __n, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__poly_hermite<__type>(__n, __x);
+ }
+
+ inline float
+ hypergf(float __a, float __b, float __c, float __x)
+ { return __detail::__hyperg<float>(__a, __b, __c, __x); }
+
+ inline long double
+ hypergl(long double __a, long double __b, long double __c, long double __x)
+ { return __detail::__hyperg<long double>(__a, __b, __c, __x); }
+
+ /// 5.2.1.17 Hypergeometric functions.
+ template<typename _Tpa, typename _Tpb, typename _Tpc, typename _Tp>
+ inline typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type
+ hyperg(_Tpa __a, _Tpb __b, _Tpc __c, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type __type;
+ return __detail::__hyperg<__type>(__a, __b, __c, __x);
+ }
+
+ inline float
+ laguerref(unsigned int __n, float __x)
+ { return __detail::__laguerre<float>(__n, __x); }
+
+ inline long double
+ laguerrel(unsigned int __n, long double __x)
+ { return __detail::__laguerre<long double>(__n, __x); }
+
+ /// 5.2.1.18 Laguerre polynomials.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ laguerre(unsigned int __n, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__laguerre<__type>(__n, __x);
+ }
+
+ inline float
+ legendref(unsigned int __n, float __x)
+ { return __detail::__poly_legendre_p<float>(__n, __x); }
+
+ inline long double
+ legendrel(unsigned int __n, long double __x)
+ { return __detail::__poly_legendre_p<long double>(__n, __x); }
+
+ /// 5.2.1.19 Legendre polynomials.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ legendre(unsigned int __n, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__poly_legendre_p<__type>(__n, __x);
+ }
+
+ inline float
+ riemann_zetaf(float __x)
+ { return __detail::__riemann_zeta<float>(__x); }
+
+ inline long double
+ riemann_zetal(long double __x)
+ { return __detail::__riemann_zeta<long double>(__x); }
+
+ /// 5.2.1.20 Riemann zeta function.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ riemann_zeta(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__riemann_zeta<__type>(__x);
+ }
+
+ inline float
+ sph_besself(unsigned int __n, float __x)
+ { return __detail::__sph_bessel<float>(__n, __x); }
+
+ inline long double
+ sph_bessell(unsigned int __n, long double __x)
+ { return __detail::__sph_bessel<long double>(__n, __x); }
+
+ /// 5.2.1.21 Spherical Bessel functions.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ sph_bessel(unsigned int __n, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__sph_bessel<__type>(__n, __x);
+ }
+
+ inline float
+ sph_legendref(unsigned int __l, unsigned int __m, float __theta)
+ { return __detail::__sph_legendre<float>(__l, __m, __theta); }
+
+ inline long double
+ sph_legendrel(unsigned int __l, unsigned int __m, long double __theta)
+ { return __detail::__sph_legendre<long double>(__l, __m, __theta); }
+
+ /// 5.2.1.22 Spherical associated Legendre functions.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ sph_legendre(unsigned int __l, unsigned int __m, _Tp __theta)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__sph_legendre<__type>(__l, __m, __theta);
+ }
+
+ inline float
+ sph_neumannf(unsigned int __n, float __x)
+ { return __detail::__sph_neumann<float>(__n, __x); }
+
+ inline long double
+ sph_neumannl(unsigned int __n, long double __x)
+ { return __detail::__sph_neumann<long double>(__n, __x); }
+
+ /// 5.2.1.23 Spherical Neumann functions.
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ sph_neumann(unsigned int __n, _Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __detail::__sph_neumann<__type>(__n, __x);
+ }
+
+ /* @} */ // tr1_math_spec_func
+}
+}
+
+#endif // _GLIBCXX_TR1_CMATH
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/complex b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/complex
new file mode 100644
index 0000000..3ed1eb9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/complex
@@ -0,0 +1,91 @@
+// TR1 complex -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/complex
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_COMPLEX
+#define _GLIBCXX_TR1_COMPLEX 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <complex>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/complex>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/complex>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+namespace std
+{
+namespace tr1
+{
+ using std::arg;
+ using std::conj;
+ using std::imag;
+ using std::norm;
+ using std::polar;
+
+ template<typename _Tp, typename _Up>
+ inline std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type>
+ polar(const _Tp& __rho, const _Up& __theta)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return std::polar(__type(__rho), __type(__theta));
+ }
+
+ using std::real;
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ pow(const std::complex<_Tp>& __x, const _Tp& __y)
+ { return std::pow(__x, __y); }
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ pow(const _Tp& __x, const std::complex<_Tp>& __y)
+ { return std::pow(__x, __y); }
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ pow(const std::complex<_Tp>& __x, const std::complex<_Tp>& __y)
+ { return std::pow(__x, __y); }
+}
+}
+
+#endif // _GLIBCXX_TR1_COMPLEX
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/complex.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/complex.h
new file mode 100644
index 0000000..0f28810
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/complex.h
@@ -0,0 +1,34 @@
+// TR1 complex.h -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/complex.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_COMPLEX_H
+#define _GLIBCXX_TR1_COMPLEX_H 1
+
+#include <tr1/ccomplex>
+
+#endif // _GLIBCXX_TR1_COMPLEX_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cstdarg b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cstdarg
new file mode 100644
index 0000000..bc2e881
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cstdarg
@@ -0,0 +1,34 @@
+// TR1 cstdarg -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cstdarg
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CSTDARG
+#define _GLIBCXX_TR1_CSTDARG 1
+
+#include <cstdarg>
+
+#endif // _GLIBCXX_TR1_CSTDARG
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cstdbool b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cstdbool
new file mode 100644
index 0000000..d68e4b8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cstdbool
@@ -0,0 +1,40 @@
+// TR1 cstdbool -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cstdbool
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CSTDBOOL
+#define _GLIBCXX_TR1_CSTDBOOL 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+
+#if _GLIBCXX_HAVE_STDBOOL_H
+#include <stdbool.h>
+#endif
+
+#endif // _GLIBCXX_TR1_CSTDBOOL
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cstdint b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cstdint
new file mode 100644
index 0000000..1e6cc37
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cstdint
@@ -0,0 +1,76 @@
+// TR1 cstdint -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cstdint
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CSTDINT
+#define _GLIBCXX_TR1_CSTDINT 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <bits/c++config.h>
+
+// For 8.22.1/1 (see C99, Notes 219, 220, 222)
+# if _GLIBCXX_HAVE_STDINT_H
+# ifndef __STDC_LIMIT_MACROS
+# define _UNDEF__STDC_LIMIT_MACROS
+# define __STDC_LIMIT_MACROS
+# endif
+# ifndef __STDC_CONSTANT_MACROS
+# define _UNDEF__STDC_CONSTANT_MACROS
+# define __STDC_CONSTANT_MACROS
+# endif
+# include <stdint.h>
+# ifdef _UNDEF__STDC_LIMIT_MACROS
+# undef __STDC_LIMIT_MACROS
+# undef _UNDEF__STDC_LIMIT_MACROS
+# endif
+# ifdef _UNDEF__STDC_CONSTANT_MACROS
+# undef __STDC_CONSTANT_MACROS
+# undef _UNDEF__STDC_CONSTANT_MACROS
+# endif
+# endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/cstdint>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/cstdint>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_CSTDINT
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cstdio b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cstdio
new file mode 100644
index 0000000..cfcf31a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cstdio
@@ -0,0 +1,54 @@
+// TR1 cstdio -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cstdio
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CSTDIO
+#define _GLIBCXX_TR1_CSTDIO 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <cstdio>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/cstdio>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/cstdio>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_CSTDIO
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cstdlib b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cstdlib
new file mode 100644
index 0000000..c9fab20
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cstdlib
@@ -0,0 +1,54 @@
+// TR1 cstdlib -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cstdlib
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CSTDLIB
+#define _GLIBCXX_TR1_CSTDLIB 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <cstdlib>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/cstdlib>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/cstdlib>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_CSTDLIB
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/ctgmath b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/ctgmath
new file mode 100644
index 0000000..e82a9a1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/ctgmath
@@ -0,0 +1,34 @@
+// TR1 ctgmath -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/ctgmath
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CTGMATH
+#define _GLIBCXX_TR1_CTGMATH 1
+
+#include <tr1/cmath>
+
+#endif // _GLIBCXX_TR1_CTGMATH
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/ctime b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/ctime
new file mode 100644
index 0000000..bf76337
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/ctime
@@ -0,0 +1,34 @@
+// TR1 ctime -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/ctime
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CTIME
+#define _GLIBCXX_TR1_CTIME 1
+
+#include <ctime>
+
+#endif // _GLIBCXX_TR1_CTIME
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/ctype.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/ctype.h
new file mode 100644
index 0000000..712bedb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/ctype.h
@@ -0,0 +1,34 @@
+// TR1 ctype.h -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/ctype.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _TR1_CTYPE_H
+#define _TR1_CTYPE_H 1
+
+#include <tr1/cctype>
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cwchar b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cwchar
new file mode 100644
index 0000000..a27ebc3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cwchar
@@ -0,0 +1,54 @@
+// TR1 cwchar -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cwchar
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CWCHAR
+#define _GLIBCXX_TR1_CWCHAR 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <cwchar>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/cwchar>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/cwchar>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_CWCHAR
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cwctype b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cwctype
new file mode 100644
index 0000000..77cbb14
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/cwctype
@@ -0,0 +1,54 @@
+// TR1 cwctype -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/cwctype
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_CWCTYPE
+#define _GLIBCXX_TR1_CWCTYPE 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <cwctype>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/cwctype>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/cwctype>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_CWCTYPE
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/ell_integral.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/ell_integral.tcc
new file mode 100644
index 0000000..09bda9a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/ell_integral.tcc
@@ -0,0 +1,750 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/ell_integral.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland based on:
+// (1) B. C. Carlson Numer. Math. 33, 1 (1979)
+// (2) B. C. Carlson, Special Functions of Applied Mathematics (1977)
+// (3) The Gnu Scientific Library, http://www.gnu.org/software/gsl
+// (4) Numerical Recipes in C, 2nd ed, by W. H. Press, S. A. Teukolsky,
+// W. T. Vetterling, B. P. Flannery, Cambridge University Press
+// (1992), pp. 261-269
+
+#ifndef _GLIBCXX_TR1_ELL_INTEGRAL_TCC
+#define _GLIBCXX_TR1_ELL_INTEGRAL_TCC 1
+
+namespace std
+{
+namespace tr1
+{
+
+ // [5.2] Special functions
+
+ // Implementation-space details.
+ namespace __detail
+ {
+
+ /**
+ * @brief Return the Carlson elliptic function @f$ R_F(x,y,z) @f$
+ * of the first kind.
+ *
+ * The Carlson elliptic function of the first kind is defined by:
+ * @f[
+ * R_F(x,y,z) = \frac{1}{2} \int_0^\infty
+ * \frac{dt}{(t + x)^{1/2}(t + y)^{1/2}(t + z)^{1/2}}
+ * @f]
+ *
+ * @param __x The first of three symmetric arguments.
+ * @param __y The second of three symmetric arguments.
+ * @param __z The third of three symmetric arguments.
+ * @return The Carlson elliptic function of the first kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __ellint_rf(const _Tp __x, const _Tp __y, const _Tp __z)
+ {
+ const _Tp __min = std::numeric_limits<_Tp>::min();
+ const _Tp __max = std::numeric_limits<_Tp>::max();
+ const _Tp __lolim = _Tp(5) * __min;
+ const _Tp __uplim = __max / _Tp(5);
+
+ if (__x < _Tp(0) || __y < _Tp(0) || __z < _Tp(0))
+ std::__throw_domain_error(__N("Argument less than zero "
+ "in __ellint_rf."));
+ else if (__x + __y < __lolim || __x + __z < __lolim
+ || __y + __z < __lolim)
+ std::__throw_domain_error(__N("Argument too small in __ellint_rf"));
+ else
+ {
+ const _Tp __c0 = _Tp(1) / _Tp(4);
+ const _Tp __c1 = _Tp(1) / _Tp(24);
+ const _Tp __c2 = _Tp(1) / _Tp(10);
+ const _Tp __c3 = _Tp(3) / _Tp(44);
+ const _Tp __c4 = _Tp(1) / _Tp(14);
+
+ _Tp __xn = __x;
+ _Tp __yn = __y;
+ _Tp __zn = __z;
+
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ const _Tp __errtol = std::pow(__eps, _Tp(1) / _Tp(6));
+ _Tp __mu;
+ _Tp __xndev, __yndev, __zndev;
+
+ const unsigned int __max_iter = 100;
+ for (unsigned int __iter = 0; __iter < __max_iter; ++__iter)
+ {
+ __mu = (__xn + __yn + __zn) / _Tp(3);
+ __xndev = 2 - (__mu + __xn) / __mu;
+ __yndev = 2 - (__mu + __yn) / __mu;
+ __zndev = 2 - (__mu + __zn) / __mu;
+ _Tp __epsilon = std::max(std::abs(__xndev), std::abs(__yndev));
+ __epsilon = std::max(__epsilon, std::abs(__zndev));
+ if (__epsilon < __errtol)
+ break;
+ const _Tp __xnroot = std::sqrt(__xn);
+ const _Tp __ynroot = std::sqrt(__yn);
+ const _Tp __znroot = std::sqrt(__zn);
+ const _Tp __lambda = __xnroot * (__ynroot + __znroot)
+ + __ynroot * __znroot;
+ __xn = __c0 * (__xn + __lambda);
+ __yn = __c0 * (__yn + __lambda);
+ __zn = __c0 * (__zn + __lambda);
+ }
+
+ const _Tp __e2 = __xndev * __yndev - __zndev * __zndev;
+ const _Tp __e3 = __xndev * __yndev * __zndev;
+ const _Tp __s = _Tp(1) + (__c1 * __e2 - __c2 - __c3 * __e3) * __e2
+ + __c4 * __e3;
+
+ return __s / std::sqrt(__mu);
+ }
+ }
+
+
+ /**
+ * @brief Return the complete elliptic integral of the first kind
+ * @f$ K(k) @f$ by series expansion.
+ *
+ * The complete elliptic integral of the first kind is defined as
+ * @f[
+ * K(k) = F(k,\pi/2) = \int_0^{\pi/2}\frac{d\theta}
+ * {\sqrt{1 - k^2sin^2\theta}}
+ * @f]
+ *
+ * This routine is not bad as long as |k| is somewhat smaller than 1
+ * but is not is good as the Carlson elliptic integral formulation.
+ *
+ * @param __k The argument of the complete elliptic function.
+ * @return The complete elliptic function of the first kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __comp_ellint_1_series(const _Tp __k)
+ {
+
+ const _Tp __kk = __k * __k;
+
+ _Tp __term = __kk / _Tp(4);
+ _Tp __sum = _Tp(1) + __term;
+
+ const unsigned int __max_iter = 1000;
+ for (unsigned int __i = 2; __i < __max_iter; ++__i)
+ {
+ __term *= (2 * __i - 1) * __kk / (2 * __i);
+ if (__term < std::numeric_limits<_Tp>::epsilon())
+ break;
+ __sum += __term;
+ }
+
+ return __numeric_constants<_Tp>::__pi_2() * __sum;
+ }
+
+
+ /**
+ * @brief Return the complete elliptic integral of the first kind
+ * @f$ K(k) @f$ using the Carlson formulation.
+ *
+ * The complete elliptic integral of the first kind is defined as
+ * @f[
+ * K(k) = F(k,\pi/2) = \int_0^{\pi/2}\frac{d\theta}
+ * {\sqrt{1 - k^2 sin^2\theta}}
+ * @f]
+ * where @f$ F(k,\phi) @f$ is the incomplete elliptic integral of the
+ * first kind.
+ *
+ * @param __k The argument of the complete elliptic function.
+ * @return The complete elliptic function of the first kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __comp_ellint_1(const _Tp __k)
+ {
+
+ if (__isnan(__k))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (std::abs(__k) >= _Tp(1))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else
+ return __ellint_rf(_Tp(0), _Tp(1) - __k * __k, _Tp(1));
+ }
+
+
+ /**
+ * @brief Return the incomplete elliptic integral of the first kind
+ * @f$ F(k,\phi) @f$ using the Carlson formulation.
+ *
+ * The incomplete elliptic integral of the first kind is defined as
+ * @f[
+ * F(k,\phi) = \int_0^{\phi}\frac{d\theta}
+ * {\sqrt{1 - k^2 sin^2\theta}}
+ * @f]
+ *
+ * @param __k The argument of the elliptic function.
+ * @param __phi The integral limit argument of the elliptic function.
+ * @return The elliptic function of the first kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __ellint_1(const _Tp __k, const _Tp __phi)
+ {
+
+ if (__isnan(__k) || __isnan(__phi))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (std::abs(__k) > _Tp(1))
+ std::__throw_domain_error(__N("Bad argument in __ellint_1."));
+ else
+ {
+ // Reduce phi to -pi/2 < phi < +pi/2.
+ const int __n = std::floor(__phi / __numeric_constants<_Tp>::__pi()
+ + _Tp(0.5L));
+ const _Tp __phi_red = __phi
+ - __n * __numeric_constants<_Tp>::__pi();
+
+ const _Tp __s = std::sin(__phi_red);
+ const _Tp __c = std::cos(__phi_red);
+
+ const _Tp __F = __s
+ * __ellint_rf(__c * __c,
+ _Tp(1) - __k * __k * __s * __s, _Tp(1));
+
+ if (__n == 0)
+ return __F;
+ else
+ return __F + _Tp(2) * __n * __comp_ellint_1(__k);
+ }
+ }
+
+
+ /**
+ * @brief Return the complete elliptic integral of the second kind
+ * @f$ E(k) @f$ by series expansion.
+ *
+ * The complete elliptic integral of the second kind is defined as
+ * @f[
+ * E(k,\pi/2) = \int_0^{\pi/2}\sqrt{1 - k^2 sin^2\theta}
+ * @f]
+ *
+ * This routine is not bad as long as |k| is somewhat smaller than 1
+ * but is not is good as the Carlson elliptic integral formulation.
+ *
+ * @param __k The argument of the complete elliptic function.
+ * @return The complete elliptic function of the second kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __comp_ellint_2_series(const _Tp __k)
+ {
+
+ const _Tp __kk = __k * __k;
+
+ _Tp __term = __kk;
+ _Tp __sum = __term;
+
+ const unsigned int __max_iter = 1000;
+ for (unsigned int __i = 2; __i < __max_iter; ++__i)
+ {
+ const _Tp __i2m = 2 * __i - 1;
+ const _Tp __i2 = 2 * __i;
+ __term *= __i2m * __i2m * __kk / (__i2 * __i2);
+ if (__term < std::numeric_limits<_Tp>::epsilon())
+ break;
+ __sum += __term / __i2m;
+ }
+
+ return __numeric_constants<_Tp>::__pi_2() * (_Tp(1) - __sum);
+ }
+
+
+ /**
+ * @brief Return the Carlson elliptic function of the second kind
+ * @f$ R_D(x,y,z) = R_J(x,y,z,z) @f$ where
+ * @f$ R_J(x,y,z,p) @f$ is the Carlson elliptic function
+ * of the third kind.
+ *
+ * The Carlson elliptic function of the second kind is defined by:
+ * @f[
+ * R_D(x,y,z) = \frac{3}{2} \int_0^\infty
+ * \frac{dt}{(t + x)^{1/2}(t + y)^{1/2}(t + z)^{3/2}}
+ * @f]
+ *
+ * Based on Carlson's algorithms:
+ * - B. C. Carlson Numer. Math. 33, 1 (1979)
+ * - B. C. Carlson, Special Functions of Applied Mathematics (1977)
+ * - Numerical Recipes in C, 2nd ed, pp. 261-269,
+ * by Press, Teukolsky, Vetterling, Flannery (1992)
+ *
+ * @param __x The first of two symmetric arguments.
+ * @param __y The second of two symmetric arguments.
+ * @param __z The third argument.
+ * @return The Carlson elliptic function of the second kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __ellint_rd(const _Tp __x, const _Tp __y, const _Tp __z)
+ {
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ const _Tp __errtol = std::pow(__eps / _Tp(8), _Tp(1) / _Tp(6));
+ const _Tp __min = std::numeric_limits<_Tp>::min();
+ const _Tp __max = std::numeric_limits<_Tp>::max();
+ const _Tp __lolim = _Tp(2) / std::pow(__max, _Tp(2) / _Tp(3));
+ const _Tp __uplim = std::pow(_Tp(0.1L) * __errtol / __min, _Tp(2) / _Tp(3));
+
+ if (__x < _Tp(0) || __y < _Tp(0))
+ std::__throw_domain_error(__N("Argument less than zero "
+ "in __ellint_rd."));
+ else if (__x + __y < __lolim || __z < __lolim)
+ std::__throw_domain_error(__N("Argument too small "
+ "in __ellint_rd."));
+ else
+ {
+ const _Tp __c0 = _Tp(1) / _Tp(4);
+ const _Tp __c1 = _Tp(3) / _Tp(14);
+ const _Tp __c2 = _Tp(1) / _Tp(6);
+ const _Tp __c3 = _Tp(9) / _Tp(22);
+ const _Tp __c4 = _Tp(3) / _Tp(26);
+
+ _Tp __xn = __x;
+ _Tp __yn = __y;
+ _Tp __zn = __z;
+ _Tp __sigma = _Tp(0);
+ _Tp __power4 = _Tp(1);
+
+ _Tp __mu;
+ _Tp __xndev, __yndev, __zndev;
+
+ const unsigned int __max_iter = 100;
+ for (unsigned int __iter = 0; __iter < __max_iter; ++__iter)
+ {
+ __mu = (__xn + __yn + _Tp(3) * __zn) / _Tp(5);
+ __xndev = (__mu - __xn) / __mu;
+ __yndev = (__mu - __yn) / __mu;
+ __zndev = (__mu - __zn) / __mu;
+ _Tp __epsilon = std::max(std::abs(__xndev), std::abs(__yndev));
+ __epsilon = std::max(__epsilon, std::abs(__zndev));
+ if (__epsilon < __errtol)
+ break;
+ _Tp __xnroot = std::sqrt(__xn);
+ _Tp __ynroot = std::sqrt(__yn);
+ _Tp __znroot = std::sqrt(__zn);
+ _Tp __lambda = __xnroot * (__ynroot + __znroot)
+ + __ynroot * __znroot;
+ __sigma += __power4 / (__znroot * (__zn + __lambda));
+ __power4 *= __c0;
+ __xn = __c0 * (__xn + __lambda);
+ __yn = __c0 * (__yn + __lambda);
+ __zn = __c0 * (__zn + __lambda);
+ }
+
+ // Note: __ea is an SPU badname.
+ _Tp __eaa = __xndev * __yndev;
+ _Tp __eb = __zndev * __zndev;
+ _Tp __ec = __eaa - __eb;
+ _Tp __ed = __eaa - _Tp(6) * __eb;
+ _Tp __ef = __ed + __ec + __ec;
+ _Tp __s1 = __ed * (-__c1 + __c3 * __ed
+ / _Tp(3) - _Tp(3) * __c4 * __zndev * __ef
+ / _Tp(2));
+ _Tp __s2 = __zndev
+ * (__c2 * __ef
+ + __zndev * (-__c3 * __ec - __zndev * __c4 - __eaa));
+
+ return _Tp(3) * __sigma + __power4 * (_Tp(1) + __s1 + __s2)
+ / (__mu * std::sqrt(__mu));
+ }
+ }
+
+
+ /**
+ * @brief Return the complete elliptic integral of the second kind
+ * @f$ E(k) @f$ using the Carlson formulation.
+ *
+ * The complete elliptic integral of the second kind is defined as
+ * @f[
+ * E(k,\pi/2) = \int_0^{\pi/2}\sqrt{1 - k^2 sin^2\theta}
+ * @f]
+ *
+ * @param __k The argument of the complete elliptic function.
+ * @return The complete elliptic function of the second kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __comp_ellint_2(const _Tp __k)
+ {
+
+ if (__isnan(__k))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (std::abs(__k) == 1)
+ return _Tp(1);
+ else if (std::abs(__k) > _Tp(1))
+ std::__throw_domain_error(__N("Bad argument in __comp_ellint_2."));
+ else
+ {
+ const _Tp __kk = __k * __k;
+
+ return __ellint_rf(_Tp(0), _Tp(1) - __kk, _Tp(1))
+ - __kk * __ellint_rd(_Tp(0), _Tp(1) - __kk, _Tp(1)) / _Tp(3);
+ }
+ }
+
+
+ /**
+ * @brief Return the incomplete elliptic integral of the second kind
+ * @f$ E(k,\phi) @f$ using the Carlson formulation.
+ *
+ * The incomplete elliptic integral of the second kind is defined as
+ * @f[
+ * E(k,\phi) = \int_0^{\phi} \sqrt{1 - k^2 sin^2\theta}
+ * @f]
+ *
+ * @param __k The argument of the elliptic function.
+ * @param __phi The integral limit argument of the elliptic function.
+ * @return The elliptic function of the second kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __ellint_2(const _Tp __k, const _Tp __phi)
+ {
+
+ if (__isnan(__k) || __isnan(__phi))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (std::abs(__k) > _Tp(1))
+ std::__throw_domain_error(__N("Bad argument in __ellint_2."));
+ else
+ {
+ // Reduce phi to -pi/2 < phi < +pi/2.
+ const int __n = std::floor(__phi / __numeric_constants<_Tp>::__pi()
+ + _Tp(0.5L));
+ const _Tp __phi_red = __phi
+ - __n * __numeric_constants<_Tp>::__pi();
+
+ const _Tp __kk = __k * __k;
+ const _Tp __s = std::sin(__phi_red);
+ const _Tp __ss = __s * __s;
+ const _Tp __sss = __ss * __s;
+ const _Tp __c = std::cos(__phi_red);
+ const _Tp __cc = __c * __c;
+
+ const _Tp __E = __s
+ * __ellint_rf(__cc, _Tp(1) - __kk * __ss, _Tp(1))
+ - __kk * __sss
+ * __ellint_rd(__cc, _Tp(1) - __kk * __ss, _Tp(1))
+ / _Tp(3);
+
+ if (__n == 0)
+ return __E;
+ else
+ return __E + _Tp(2) * __n * __comp_ellint_2(__k);
+ }
+ }
+
+
+ /**
+ * @brief Return the Carlson elliptic function
+ * @f$ R_C(x,y) = R_F(x,y,y) @f$ where @f$ R_F(x,y,z) @f$
+ * is the Carlson elliptic function of the first kind.
+ *
+ * The Carlson elliptic function is defined by:
+ * @f[
+ * R_C(x,y) = \frac{1}{2} \int_0^\infty
+ * \frac{dt}{(t + x)^{1/2}(t + y)}
+ * @f]
+ *
+ * Based on Carlson's algorithms:
+ * - B. C. Carlson Numer. Math. 33, 1 (1979)
+ * - B. C. Carlson, Special Functions of Applied Mathematics (1977)
+ * - Numerical Recipes in C, 2nd ed, pp. 261-269,
+ * by Press, Teukolsky, Vetterling, Flannery (1992)
+ *
+ * @param __x The first argument.
+ * @param __y The second argument.
+ * @return The Carlson elliptic function.
+ */
+ template<typename _Tp>
+ _Tp
+ __ellint_rc(const _Tp __x, const _Tp __y)
+ {
+ const _Tp __min = std::numeric_limits<_Tp>::min();
+ const _Tp __max = std::numeric_limits<_Tp>::max();
+ const _Tp __lolim = _Tp(5) * __min;
+ const _Tp __uplim = __max / _Tp(5);
+
+ if (__x < _Tp(0) || __y < _Tp(0) || __x + __y < __lolim)
+ std::__throw_domain_error(__N("Argument less than zero "
+ "in __ellint_rc."));
+ else
+ {
+ const _Tp __c0 = _Tp(1) / _Tp(4);
+ const _Tp __c1 = _Tp(1) / _Tp(7);
+ const _Tp __c2 = _Tp(9) / _Tp(22);
+ const _Tp __c3 = _Tp(3) / _Tp(10);
+ const _Tp __c4 = _Tp(3) / _Tp(8);
+
+ _Tp __xn = __x;
+ _Tp __yn = __y;
+
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ const _Tp __errtol = std::pow(__eps / _Tp(30), _Tp(1) / _Tp(6));
+ _Tp __mu;
+ _Tp __sn;
+
+ const unsigned int __max_iter = 100;
+ for (unsigned int __iter = 0; __iter < __max_iter; ++__iter)
+ {
+ __mu = (__xn + _Tp(2) * __yn) / _Tp(3);
+ __sn = (__yn + __mu) / __mu - _Tp(2);
+ if (std::abs(__sn) < __errtol)
+ break;
+ const _Tp __lambda = _Tp(2) * std::sqrt(__xn) * std::sqrt(__yn)
+ + __yn;
+ __xn = __c0 * (__xn + __lambda);
+ __yn = __c0 * (__yn + __lambda);
+ }
+
+ _Tp __s = __sn * __sn
+ * (__c3 + __sn*(__c1 + __sn * (__c4 + __sn * __c2)));
+
+ return (_Tp(1) + __s) / std::sqrt(__mu);
+ }
+ }
+
+
+ /**
+ * @brief Return the Carlson elliptic function @f$ R_J(x,y,z,p) @f$
+ * of the third kind.
+ *
+ * The Carlson elliptic function of the third kind is defined by:
+ * @f[
+ * R_J(x,y,z,p) = \frac{3}{2} \int_0^\infty
+ * \frac{dt}{(t + x)^{1/2}(t + y)^{1/2}(t + z)^{1/2}(t + p)}
+ * @f]
+ *
+ * Based on Carlson's algorithms:
+ * - B. C. Carlson Numer. Math. 33, 1 (1979)
+ * - B. C. Carlson, Special Functions of Applied Mathematics (1977)
+ * - Numerical Recipes in C, 2nd ed, pp. 261-269,
+ * by Press, Teukolsky, Vetterling, Flannery (1992)
+ *
+ * @param __x The first of three symmetric arguments.
+ * @param __y The second of three symmetric arguments.
+ * @param __z The third of three symmetric arguments.
+ * @param __p The fourth argument.
+ * @return The Carlson elliptic function of the fourth kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __ellint_rj(const _Tp __x, const _Tp __y, const _Tp __z, const _Tp __p)
+ {
+ const _Tp __min = std::numeric_limits<_Tp>::min();
+ const _Tp __max = std::numeric_limits<_Tp>::max();
+ const _Tp __lolim = std::pow(_Tp(5) * __min, _Tp(1)/_Tp(3));
+ const _Tp __uplim = _Tp(0.3L)
+ * std::pow(_Tp(0.2L) * __max, _Tp(1)/_Tp(3));
+
+ if (__x < _Tp(0) || __y < _Tp(0) || __z < _Tp(0))
+ std::__throw_domain_error(__N("Argument less than zero "
+ "in __ellint_rj."));
+ else if (__x + __y < __lolim || __x + __z < __lolim
+ || __y + __z < __lolim || __p < __lolim)
+ std::__throw_domain_error(__N("Argument too small "
+ "in __ellint_rj"));
+ else
+ {
+ const _Tp __c0 = _Tp(1) / _Tp(4);
+ const _Tp __c1 = _Tp(3) / _Tp(14);
+ const _Tp __c2 = _Tp(1) / _Tp(3);
+ const _Tp __c3 = _Tp(3) / _Tp(22);
+ const _Tp __c4 = _Tp(3) / _Tp(26);
+
+ _Tp __xn = __x;
+ _Tp __yn = __y;
+ _Tp __zn = __z;
+ _Tp __pn = __p;
+ _Tp __sigma = _Tp(0);
+ _Tp __power4 = _Tp(1);
+
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ const _Tp __errtol = std::pow(__eps / _Tp(8), _Tp(1) / _Tp(6));
+
+ _Tp __lambda, __mu;
+ _Tp __xndev, __yndev, __zndev, __pndev;
+
+ const unsigned int __max_iter = 100;
+ for (unsigned int __iter = 0; __iter < __max_iter; ++__iter)
+ {
+ __mu = (__xn + __yn + __zn + _Tp(2) * __pn) / _Tp(5);
+ __xndev = (__mu - __xn) / __mu;
+ __yndev = (__mu - __yn) / __mu;
+ __zndev = (__mu - __zn) / __mu;
+ __pndev = (__mu - __pn) / __mu;
+ _Tp __epsilon = std::max(std::abs(__xndev), std::abs(__yndev));
+ __epsilon = std::max(__epsilon, std::abs(__zndev));
+ __epsilon = std::max(__epsilon, std::abs(__pndev));
+ if (__epsilon < __errtol)
+ break;
+ const _Tp __xnroot = std::sqrt(__xn);
+ const _Tp __ynroot = std::sqrt(__yn);
+ const _Tp __znroot = std::sqrt(__zn);
+ const _Tp __lambda = __xnroot * (__ynroot + __znroot)
+ + __ynroot * __znroot;
+ const _Tp __alpha1 = __pn * (__xnroot + __ynroot + __znroot)
+ + __xnroot * __ynroot * __znroot;
+ const _Tp __alpha2 = __alpha1 * __alpha1;
+ const _Tp __beta = __pn * (__pn + __lambda)
+ * (__pn + __lambda);
+ __sigma += __power4 * __ellint_rc(__alpha2, __beta);
+ __power4 *= __c0;
+ __xn = __c0 * (__xn + __lambda);
+ __yn = __c0 * (__yn + __lambda);
+ __zn = __c0 * (__zn + __lambda);
+ __pn = __c0 * (__pn + __lambda);
+ }
+
+ // Note: __ea is an SPU badname.
+ _Tp __eaa = __xndev * (__yndev + __zndev) + __yndev * __zndev;
+ _Tp __eb = __xndev * __yndev * __zndev;
+ _Tp __ec = __pndev * __pndev;
+ _Tp __e2 = __eaa - _Tp(3) * __ec;
+ _Tp __e3 = __eb + _Tp(2) * __pndev * (__eaa - __ec);
+ _Tp __s1 = _Tp(1) + __e2 * (-__c1 + _Tp(3) * __c3 * __e2 / _Tp(4)
+ - _Tp(3) * __c4 * __e3 / _Tp(2));
+ _Tp __s2 = __eb * (__c2 / _Tp(2)
+ + __pndev * (-__c3 - __c3 + __pndev * __c4));
+ _Tp __s3 = __pndev * __eaa * (__c2 - __pndev * __c3)
+ - __c2 * __pndev * __ec;
+
+ return _Tp(3) * __sigma + __power4 * (__s1 + __s2 + __s3)
+ / (__mu * std::sqrt(__mu));
+ }
+ }
+
+
+ /**
+ * @brief Return the complete elliptic integral of the third kind
+ * @f$ \Pi(k,\nu) = \Pi(k,\nu,\pi/2) @f$ using the
+ * Carlson formulation.
+ *
+ * The complete elliptic integral of the third kind is defined as
+ * @f[
+ * \Pi(k,\nu) = \int_0^{\pi/2}
+ * \frac{d\theta}
+ * {(1 - \nu \sin^2\theta)\sqrt{1 - k^2 \sin^2\theta}}
+ * @f]
+ *
+ * @param __k The argument of the elliptic function.
+ * @param __nu The second argument of the elliptic function.
+ * @return The complete elliptic function of the third kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __comp_ellint_3(const _Tp __k, const _Tp __nu)
+ {
+
+ if (__isnan(__k) || __isnan(__nu))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__nu == _Tp(1))
+ return std::numeric_limits<_Tp>::infinity();
+ else if (std::abs(__k) > _Tp(1))
+ std::__throw_domain_error(__N("Bad argument in __comp_ellint_3."));
+ else
+ {
+ const _Tp __kk = __k * __k;
+
+ return __ellint_rf(_Tp(0), _Tp(1) - __kk, _Tp(1))
+ - __nu
+ * __ellint_rj(_Tp(0), _Tp(1) - __kk, _Tp(1), _Tp(1) + __nu)
+ / _Tp(3);
+ }
+ }
+
+
+ /**
+ * @brief Return the incomplete elliptic integral of the third kind
+ * @f$ \Pi(k,\nu,\phi) @f$ using the Carlson formulation.
+ *
+ * The incomplete elliptic integral of the third kind is defined as
+ * @f[
+ * \Pi(k,\nu,\phi) = \int_0^{\phi}
+ * \frac{d\theta}
+ * {(1 - \nu \sin^2\theta)
+ * \sqrt{1 - k^2 \sin^2\theta}}
+ * @f]
+ *
+ * @param __k The argument of the elliptic function.
+ * @param __nu The second argument of the elliptic function.
+ * @param __phi The integral limit argument of the elliptic function.
+ * @return The elliptic function of the third kind.
+ */
+ template<typename _Tp>
+ _Tp
+ __ellint_3(const _Tp __k, const _Tp __nu, const _Tp __phi)
+ {
+
+ if (__isnan(__k) || __isnan(__nu) || __isnan(__phi))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (std::abs(__k) > _Tp(1))
+ std::__throw_domain_error(__N("Bad argument in __ellint_3."));
+ else
+ {
+ // Reduce phi to -pi/2 < phi < +pi/2.
+ const int __n = std::floor(__phi / __numeric_constants<_Tp>::__pi()
+ + _Tp(0.5L));
+ const _Tp __phi_red = __phi
+ - __n * __numeric_constants<_Tp>::__pi();
+
+ const _Tp __kk = __k * __k;
+ const _Tp __s = std::sin(__phi_red);
+ const _Tp __ss = __s * __s;
+ const _Tp __sss = __ss * __s;
+ const _Tp __c = std::cos(__phi_red);
+ const _Tp __cc = __c * __c;
+
+ const _Tp __Pi = __s
+ * __ellint_rf(__cc, _Tp(1) - __kk * __ss, _Tp(1))
+ - __nu * __sss
+ * __ellint_rj(__cc, _Tp(1) - __kk * __ss, _Tp(1),
+ _Tp(1) + __nu * __ss) / _Tp(3);
+
+ if (__n == 0)
+ return __Pi;
+ else
+ return __Pi + _Tp(2) * __n * __comp_ellint_3(__k, __nu);
+ }
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // _GLIBCXX_TR1_ELL_INTEGRAL_TCC
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/exp_integral.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/exp_integral.tcc
new file mode 100644
index 0000000..5b3af5d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/exp_integral.tcc
@@ -0,0 +1,524 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/exp_integral.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland based on:
+//
+// (1) Handbook of Mathematical Functions,
+// Ed. by Milton Abramowitz and Irene A. Stegun,
+// Dover Publications, New-York, Section 5, pp. 228-251.
+// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
+// (3) Numerical Recipes in C, by W. H. Press, S. A. Teukolsky,
+// W. T. Vetterling, B. P. Flannery, Cambridge University Press (1992),
+// 2nd ed, pp. 222-225.
+//
+
+#ifndef _GLIBCXX_TR1_EXP_INTEGRAL_TCC
+#define _GLIBCXX_TR1_EXP_INTEGRAL_TCC 1
+
+#include "special_function_util.h"
+
+namespace std
+{
+namespace tr1
+{
+
+ // [5.2] Special functions
+
+ // Implementation-space details.
+ namespace __detail
+ {
+
+ /**
+ * @brief Return the exponential integral @f$ E_1(x) @f$
+ * by series summation. This should be good
+ * for @f$ x < 1 @f$.
+ *
+ * The exponential integral is given by
+ * \f[
+ * E_1(x) = \int_{1}^{\infty} \frac{e^{-xt}}{t} dt
+ * \f]
+ *
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_E1_series(const _Tp __x)
+ {
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ _Tp __term = _Tp(1);
+ _Tp __esum = _Tp(0);
+ _Tp __osum = _Tp(0);
+ const unsigned int __max_iter = 100;
+ for (unsigned int __i = 1; __i < __max_iter; ++__i)
+ {
+ __term *= - __x / __i;
+ if (std::abs(__term) < __eps)
+ break;
+ if (__term >= _Tp(0))
+ __esum += __term / __i;
+ else
+ __osum += __term / __i;
+ }
+
+ return - __esum - __osum
+ - __numeric_constants<_Tp>::__gamma_e() - std::log(__x);
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ E_1(x) @f$
+ * by asymptotic expansion.
+ *
+ * The exponential integral is given by
+ * \f[
+ * E_1(x) = \int_{1}^\infty \frac{e^{-xt}}{t} dt
+ * \f]
+ *
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_E1_asymp(const _Tp __x)
+ {
+ _Tp __term = _Tp(1);
+ _Tp __esum = _Tp(1);
+ _Tp __osum = _Tp(0);
+ const unsigned int __max_iter = 1000;
+ for (unsigned int __i = 1; __i < __max_iter; ++__i)
+ {
+ _Tp __prev = __term;
+ __term *= - __i / __x;
+ if (std::abs(__term) > std::abs(__prev))
+ break;
+ if (__term >= _Tp(0))
+ __esum += __term;
+ else
+ __osum += __term;
+ }
+
+ return std::exp(- __x) * (__esum + __osum) / __x;
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ E_n(x) @f$
+ * by series summation.
+ *
+ * The exponential integral is given by
+ * \f[
+ * E_n(x) = \int_{1}^\infty \frac{e^{-xt}}{t^n} dt
+ * \f]
+ *
+ * @param __n The order of the exponential integral function.
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_En_series(const unsigned int __n, const _Tp __x)
+ {
+ const unsigned int __max_iter = 100;
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ const int __nm1 = __n - 1;
+ _Tp __ans = (__nm1 != 0
+ ? _Tp(1) / __nm1 : -std::log(__x)
+ - __numeric_constants<_Tp>::__gamma_e());
+ _Tp __fact = _Tp(1);
+ for (int __i = 1; __i <= __max_iter; ++__i)
+ {
+ __fact *= -__x / _Tp(__i);
+ _Tp __del;
+ if ( __i != __nm1 )
+ __del = -__fact / _Tp(__i - __nm1);
+ else
+ {
+ _Tp __psi = -_TR1_GAMMA_TCC;
+ for (int __ii = 1; __ii <= __nm1; ++__ii)
+ __psi += _Tp(1) / _Tp(__ii);
+ __del = __fact * (__psi - std::log(__x));
+ }
+ __ans += __del;
+ if (std::abs(__del) < __eps * std::abs(__ans))
+ return __ans;
+ }
+ std::__throw_runtime_error(__N("Series summation failed "
+ "in __expint_En_series."));
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ E_n(x) @f$
+ * by continued fractions.
+ *
+ * The exponential integral is given by
+ * \f[
+ * E_n(x) = \int_{1}^\infty \frac{e^{-xt}}{t^n} dt
+ * \f]
+ *
+ * @param __n The order of the exponential integral function.
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_En_cont_frac(const unsigned int __n, const _Tp __x)
+ {
+ const unsigned int __max_iter = 100;
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ const _Tp __fp_min = std::numeric_limits<_Tp>::min();
+ const int __nm1 = __n - 1;
+ _Tp __b = __x + _Tp(__n);
+ _Tp __c = _Tp(1) / __fp_min;
+ _Tp __d = _Tp(1) / __b;
+ _Tp __h = __d;
+ for ( unsigned int __i = 1; __i <= __max_iter; ++__i )
+ {
+ _Tp __a = -_Tp(__i * (__nm1 + __i));
+ __b += _Tp(2);
+ __d = _Tp(1) / (__a * __d + __b);
+ __c = __b + __a / __c;
+ const _Tp __del = __c * __d;
+ __h *= __del;
+ if (std::abs(__del - _Tp(1)) < __eps)
+ {
+ const _Tp __ans = __h * std::exp(-__x);
+ return __ans;
+ }
+ }
+ std::__throw_runtime_error(__N("Continued fraction failed "
+ "in __expint_En_cont_frac."));
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ E_n(x) @f$
+ * by recursion. Use upward recursion for @f$ x < n @f$
+ * and downward recursion (Miller's algorithm) otherwise.
+ *
+ * The exponential integral is given by
+ * \f[
+ * E_n(x) = \int_{1}^\infty \frac{e^{-xt}}{t^n} dt
+ * \f]
+ *
+ * @param __n The order of the exponential integral function.
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_En_recursion(const unsigned int __n, const _Tp __x)
+ {
+ _Tp __En;
+ _Tp __E1 = __expint_E1(__x);
+ if (__x < _Tp(__n))
+ {
+ // Forward recursion is stable only for n < x.
+ __En = __E1;
+ for (unsigned int __j = 2; __j < __n; ++__j)
+ __En = (std::exp(-__x) - __x * __En) / _Tp(__j - 1);
+ }
+ else
+ {
+ // Backward recursion is stable only for n >= x.
+ __En = _Tp(1);
+ const int __N = __n + 20; // TODO: Check this starting number.
+ _Tp __save = _Tp(0);
+ for (int __j = __N; __j > 0; --__j)
+ {
+ __En = (std::exp(-__x) - __j * __En) / __x;
+ if (__j == __n)
+ __save = __En;
+ }
+ _Tp __norm = __En / __E1;
+ __En /= __norm;
+ }
+
+ return __En;
+ }
+
+ /**
+ * @brief Return the exponential integral @f$ Ei(x) @f$
+ * by series summation.
+ *
+ * The exponential integral is given by
+ * \f[
+ * Ei(x) = -\int_{-x}^\infty \frac{e^t}{t} dt
+ * \f]
+ *
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_Ei_series(const _Tp __x)
+ {
+ _Tp __term = _Tp(1);
+ _Tp __sum = _Tp(0);
+ const unsigned int __max_iter = 1000;
+ for (unsigned int __i = 1; __i < __max_iter; ++__i)
+ {
+ __term *= __x / __i;
+ __sum += __term / __i;
+ if (__term < std::numeric_limits<_Tp>::epsilon() * __sum)
+ break;
+ }
+
+ return __numeric_constants<_Tp>::__gamma_e() + __sum + std::log(__x);
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ Ei(x) @f$
+ * by asymptotic expansion.
+ *
+ * The exponential integral is given by
+ * \f[
+ * Ei(x) = -\int_{-x}^\infty \frac{e^t}{t} dt
+ * \f]
+ *
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_Ei_asymp(const _Tp __x)
+ {
+ _Tp __term = _Tp(1);
+ _Tp __sum = _Tp(1);
+ const unsigned int __max_iter = 1000;
+ for (unsigned int __i = 1; __i < __max_iter; ++__i)
+ {
+ _Tp __prev = __term;
+ __term *= __i / __x;
+ if (__term < std::numeric_limits<_Tp>::epsilon())
+ break;
+ if (__term >= __prev)
+ break;
+ __sum += __term;
+ }
+
+ return std::exp(__x) * __sum / __x;
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ Ei(x) @f$.
+ *
+ * The exponential integral is given by
+ * \f[
+ * Ei(x) = -\int_{-x}^\infty \frac{e^t}{t} dt
+ * \f]
+ *
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_Ei(const _Tp __x)
+ {
+ if (__x < _Tp(0))
+ return -__expint_E1(-__x);
+ else if (__x < -std::log(std::numeric_limits<_Tp>::epsilon()))
+ return __expint_Ei_series(__x);
+ else
+ return __expint_Ei_asymp(__x);
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ E_1(x) @f$.
+ *
+ * The exponential integral is given by
+ * \f[
+ * E_1(x) = \int_{1}^\infty \frac{e^{-xt}}{t} dt
+ * \f]
+ *
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_E1(const _Tp __x)
+ {
+ if (__x < _Tp(0))
+ return -__expint_Ei(-__x);
+ else if (__x < _Tp(1))
+ return __expint_E1_series(__x);
+ else if (__x < _Tp(100)) // TODO: Find a good asymptotic switch point.
+ return __expint_En_cont_frac(1, __x);
+ else
+ return __expint_E1_asymp(__x);
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ E_n(x) @f$
+ * for large argument.
+ *
+ * The exponential integral is given by
+ * \f[
+ * E_n(x) = \int_{1}^\infty \frac{e^{-xt}}{t^n} dt
+ * \f]
+ *
+ * This is something of an extension.
+ *
+ * @param __n The order of the exponential integral function.
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_asymp(const unsigned int __n, const _Tp __x)
+ {
+ _Tp __term = _Tp(1);
+ _Tp __sum = _Tp(1);
+ for (unsigned int __i = 1; __i <= __n; ++__i)
+ {
+ _Tp __prev = __term;
+ __term *= -(__n - __i + 1) / __x;
+ if (std::abs(__term) > std::abs(__prev))
+ break;
+ __sum += __term;
+ }
+
+ return std::exp(-__x) * __sum / __x;
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ E_n(x) @f$
+ * for large order.
+ *
+ * The exponential integral is given by
+ * \f[
+ * E_n(x) = \int_{1}^\infty \frac{e^{-xt}}{t^n} dt
+ * \f]
+ *
+ * This is something of an extension.
+ *
+ * @param __n The order of the exponential integral function.
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint_large_n(const unsigned int __n, const _Tp __x)
+ {
+ const _Tp __xpn = __x + __n;
+ const _Tp __xpn2 = __xpn * __xpn;
+ _Tp __term = _Tp(1);
+ _Tp __sum = _Tp(1);
+ for (unsigned int __i = 1; __i <= __n; ++__i)
+ {
+ _Tp __prev = __term;
+ __term *= (__n - 2 * (__i - 1) * __x) / __xpn2;
+ if (std::abs(__term) < std::numeric_limits<_Tp>::epsilon())
+ break;
+ __sum += __term;
+ }
+
+ return std::exp(-__x) * __sum / __xpn;
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ E_n(x) @f$.
+ *
+ * The exponential integral is given by
+ * \f[
+ * E_n(x) = \int_{1}^\infty \frac{e^{-xt}}{t^n} dt
+ * \f]
+ * This is something of an extension.
+ *
+ * @param __n The order of the exponential integral function.
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ _Tp
+ __expint(const unsigned int __n, const _Tp __x)
+ {
+ // Return NaN on NaN input.
+ if (__isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__n <= 1 && __x == _Tp(0))
+ return std::numeric_limits<_Tp>::infinity();
+ else
+ {
+ _Tp __E0 = std::exp(__x) / __x;
+ if (__n == 0)
+ return __E0;
+
+ _Tp __E1 = __expint_E1(__x);
+ if (__n == 1)
+ return __E1;
+
+ if (__x == _Tp(0))
+ return _Tp(1) / static_cast<_Tp>(__n - 1);
+
+ _Tp __En = __expint_En_recursion(__n, __x);
+
+ return __En;
+ }
+ }
+
+
+ /**
+ * @brief Return the exponential integral @f$ Ei(x) @f$.
+ *
+ * The exponential integral is given by
+ * \f[
+ * Ei(x) = -\int_{-x}^\infty \frac{e^t}{t} dt
+ * \f]
+ *
+ * @param __x The argument of the exponential integral function.
+ * @return The exponential integral.
+ */
+ template<typename _Tp>
+ inline _Tp
+ __expint(const _Tp __x)
+ {
+ if (__isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else
+ return __expint_Ei(__x);
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // _GLIBCXX_TR1_EXP_INTEGRAL_TCC
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/fenv.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/fenv.h
new file mode 100644
index 0000000..118630e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/fenv.h
@@ -0,0 +1,34 @@
+// TR1 fenv.h -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/fenv.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _TR1_FENV_H
+#define _TR1_FENV_H 1
+
+#include <tr1/cfenv>
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/float.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/float.h
new file mode 100644
index 0000000..bbeff6e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/float.h
@@ -0,0 +1,34 @@
+// TR1 float.h -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/float.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _TR1_FLOAT_H
+#define _TR1_FLOAT_H 1
+
+#include <tr1/cfloat>
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/functional b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/functional
new file mode 100644
index 0000000..3deaa5e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/functional
@@ -0,0 +1,63 @@
+// TR1 functional header -*- C++ -*-
+
+// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/functional
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_FUNCTIONAL
+#define _GLIBCXX_TR1_FUNCTIONAL 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <bits/c++config.h>
+#include <bits/stl_function.h>
+
+#include <typeinfo>
+#include <new>
+#include <tr1/tuple>
+#include <tr1/type_traits>
+#include <bits/stringfwd.h>
+#include <tr1/functional_hash.h>
+#include <ext/type_traits.h>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/functional>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/functional>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_FUNCTIONAL
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/functional_hash.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/functional_hash.h
new file mode 100644
index 0000000..933ded9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/functional_hash.h
@@ -0,0 +1,53 @@
+// TR1 functional_hash.h header -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/functional_hash.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_TR1_FUNCTIONAL_HASH_H
+#define _GLIBCXX_TR1_FUNCTIONAL_HASH_H 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/functional_hash.h>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/functional_hash.h>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_FUNCTIONAL_HASH_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/gamma.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/gamma.tcc
new file mode 100644
index 0000000..f456da3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/gamma.tcc
@@ -0,0 +1,471 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/gamma.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland based on:
+// (1) Handbook of Mathematical Functions,
+// ed. Milton Abramowitz and Irene A. Stegun,
+// Dover Publications,
+// Section 6, pp. 253-266
+// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
+// (3) Numerical Recipes in C, by W. H. Press, S. A. Teukolsky,
+// W. T. Vetterling, B. P. Flannery, Cambridge University Press (1992),
+// 2nd ed, pp. 213-216
+// (4) Gamma, Exploring Euler's Constant, Julian Havil,
+// Princeton, 2003.
+
+#ifndef _TR1_GAMMA_TCC
+#define _TR1_GAMMA_TCC 1
+
+#include "special_function_util.h"
+
+namespace std
+{
+namespace tr1
+{
+ // Implementation-space details.
+ namespace __detail
+ {
+
+ /**
+ * @brief This returns Bernoulli numbers from a table or by summation
+ * for larger values.
+ *
+ * Recursion is unstable.
+ *
+ * @param __n the order n of the Bernoulli number.
+ * @return The Bernoulli number of order n.
+ */
+ template <typename _Tp>
+ _Tp __bernoulli_series(unsigned int __n)
+ {
+
+ static const _Tp __num[28] = {
+ _Tp(1UL), -_Tp(1UL) / _Tp(2UL),
+ _Tp(1UL) / _Tp(6UL), _Tp(0UL),
+ -_Tp(1UL) / _Tp(30UL), _Tp(0UL),
+ _Tp(1UL) / _Tp(42UL), _Tp(0UL),
+ -_Tp(1UL) / _Tp(30UL), _Tp(0UL),
+ _Tp(5UL) / _Tp(66UL), _Tp(0UL),
+ -_Tp(691UL) / _Tp(2730UL), _Tp(0UL),
+ _Tp(7UL) / _Tp(6UL), _Tp(0UL),
+ -_Tp(3617UL) / _Tp(510UL), _Tp(0UL),
+ _Tp(43867UL) / _Tp(798UL), _Tp(0UL),
+ -_Tp(174611) / _Tp(330UL), _Tp(0UL),
+ _Tp(854513UL) / _Tp(138UL), _Tp(0UL),
+ -_Tp(236364091UL) / _Tp(2730UL), _Tp(0UL),
+ _Tp(8553103UL) / _Tp(6UL), _Tp(0UL)
+ };
+
+ if (__n == 0)
+ return _Tp(1);
+
+ if (__n == 1)
+ return -_Tp(1) / _Tp(2);
+
+ // Take care of the rest of the odd ones.
+ if (__n % 2 == 1)
+ return _Tp(0);
+
+ // Take care of some small evens that are painful for the series.
+ if (__n < 28)
+ return __num[__n];
+
+
+ _Tp __fact = _Tp(1);
+ if ((__n / 2) % 2 == 0)
+ __fact *= _Tp(-1);
+ for (unsigned int __k = 1; __k <= __n; ++__k)
+ __fact *= __k / (_Tp(2) * __numeric_constants<_Tp>::__pi());
+ __fact *= _Tp(2);
+
+ _Tp __sum = _Tp(0);
+ for (unsigned int __i = 1; __i < 1000; ++__i)
+ {
+ _Tp __term = std::pow(_Tp(__i), -_Tp(__n));
+ if (__term < std::numeric_limits<_Tp>::epsilon())
+ break;
+ __sum += __term;
+ }
+
+ return __fact * __sum;
+ }
+
+
+ /**
+ * @brief This returns Bernoulli number \f$B_n\f$.
+ *
+ * @param __n the order n of the Bernoulli number.
+ * @return The Bernoulli number of order n.
+ */
+ template<typename _Tp>
+ inline _Tp
+ __bernoulli(const int __n)
+ {
+ return __bernoulli_series<_Tp>(__n);
+ }
+
+
+ /**
+ * @brief Return \f$log(\Gamma(x))\f$ by asymptotic expansion
+ * with Bernoulli number coefficients. This is like
+ * Sterling's approximation.
+ *
+ * @param __x The argument of the log of the gamma function.
+ * @return The logarithm of the gamma function.
+ */
+ template<typename _Tp>
+ _Tp
+ __log_gamma_bernoulli(const _Tp __x)
+ {
+ _Tp __lg = (__x - _Tp(0.5L)) * std::log(__x) - __x
+ + _Tp(0.5L) * std::log(_Tp(2)
+ * __numeric_constants<_Tp>::__pi());
+
+ const _Tp __xx = __x * __x;
+ _Tp __help = _Tp(1) / __x;
+ for ( unsigned int __i = 1; __i < 20; ++__i )
+ {
+ const _Tp __2i = _Tp(2 * __i);
+ __help /= __2i * (__2i - _Tp(1)) * __xx;
+ __lg += __bernoulli<_Tp>(2 * __i) * __help;
+ }
+
+ return __lg;
+ }
+
+
+ /**
+ * @brief Return \f$log(\Gamma(x))\f$ by the Lanczos method.
+ * This method dominates all others on the positive axis I think.
+ *
+ * @param __x The argument of the log of the gamma function.
+ * @return The logarithm of the gamma function.
+ */
+ template<typename _Tp>
+ _Tp
+ __log_gamma_lanczos(const _Tp __x)
+ {
+ const _Tp __xm1 = __x - _Tp(1);
+
+ static const _Tp __lanczos_cheb_7[9] = {
+ _Tp( 0.99999999999980993227684700473478L),
+ _Tp( 676.520368121885098567009190444019L),
+ _Tp(-1259.13921672240287047156078755283L),
+ _Tp( 771.3234287776530788486528258894L),
+ _Tp(-176.61502916214059906584551354L),
+ _Tp( 12.507343278686904814458936853L),
+ _Tp(-0.13857109526572011689554707L),
+ _Tp( 9.984369578019570859563e-6L),
+ _Tp( 1.50563273514931155834e-7L)
+ };
+
+ static const _Tp __LOGROOT2PI
+ = _Tp(0.9189385332046727417803297364056176L);
+
+ _Tp __sum = __lanczos_cheb_7[0];
+ for(unsigned int __k = 1; __k < 9; ++__k)
+ __sum += __lanczos_cheb_7[__k] / (__xm1 + __k);
+
+ const _Tp __term1 = (__xm1 + _Tp(0.5L))
+ * std::log((__xm1 + _Tp(7.5L))
+ / __numeric_constants<_Tp>::__euler());
+ const _Tp __term2 = __LOGROOT2PI + std::log(__sum);
+ const _Tp __result = __term1 + (__term2 - _Tp(7));
+
+ return __result;
+ }
+
+
+ /**
+ * @brief Return \f$ log(|\Gamma(x)|) \f$.
+ * This will return values even for \f$ x < 0 \f$.
+ * To recover the sign of \f$ \Gamma(x) \f$ for
+ * any argument use @a __log_gamma_sign.
+ *
+ * @param __x The argument of the log of the gamma function.
+ * @return The logarithm of the gamma function.
+ */
+ template<typename _Tp>
+ _Tp
+ __log_gamma(const _Tp __x)
+ {
+ if (__x > _Tp(0.5L))
+ return __log_gamma_lanczos(__x);
+ else
+ {
+ const _Tp __sin_fact
+ = std::abs(std::sin(__numeric_constants<_Tp>::__pi() * __x));
+ if (__sin_fact == _Tp(0))
+ std::__throw_domain_error(__N("Argument is nonpositive integer "
+ "in __log_gamma"));
+ return __numeric_constants<_Tp>::__lnpi()
+ - std::log(__sin_fact)
+ - __log_gamma_lanczos(_Tp(1) - __x);
+ }
+ }
+
+
+ /**
+ * @brief Return the sign of \f$ \Gamma(x) \f$.
+ * At nonpositive integers zero is returned.
+ *
+ * @param __x The argument of the gamma function.
+ * @return The sign of the gamma function.
+ */
+ template<typename _Tp>
+ _Tp
+ __log_gamma_sign(const _Tp __x)
+ {
+ if (__x > _Tp(0))
+ return _Tp(1);
+ else
+ {
+ const _Tp __sin_fact
+ = std::sin(__numeric_constants<_Tp>::__pi() * __x);
+ if (__sin_fact > _Tp(0))
+ return (1);
+ else if (__sin_fact < _Tp(0))
+ return -_Tp(1);
+ else
+ return _Tp(0);
+ }
+ }
+
+
+ /**
+ * @brief Return the logarithm of the binomial coefficient.
+ * The binomial coefficient is given by:
+ * @f[
+ * \left( \right) = \frac{n!}{(n-k)! k!}
+ * @f]
+ *
+ * @param __n The first argument of the binomial coefficient.
+ * @param __k The second argument of the binomial coefficient.
+ * @return The binomial coefficient.
+ */
+ template<typename _Tp>
+ _Tp
+ __log_bincoef(const unsigned int __n, const unsigned int __k)
+ {
+ // Max e exponent before overflow.
+ static const _Tp __max_bincoeff
+ = std::numeric_limits<_Tp>::max_exponent10
+ * std::log(_Tp(10)) - _Tp(1);
+#if _GLIBCXX_USE_C99_MATH_TR1
+ _Tp __coeff = std::tr1::lgamma(_Tp(1 + __n))
+ - std::tr1::lgamma(_Tp(1 + __k))
+ - std::tr1::lgamma(_Tp(1 + __n - __k));
+#else
+ _Tp __coeff = __log_gamma(_Tp(1 + __n))
+ - __log_gamma(_Tp(1 + __k))
+ - __log_gamma(_Tp(1 + __n - __k));
+#endif
+ }
+
+
+ /**
+ * @brief Return the binomial coefficient.
+ * The binomial coefficient is given by:
+ * @f[
+ * \left( \right) = \frac{n!}{(n-k)! k!}
+ * @f]
+ *
+ * @param __n The first argument of the binomial coefficient.
+ * @param __k The second argument of the binomial coefficient.
+ * @return The binomial coefficient.
+ */
+ template<typename _Tp>
+ _Tp
+ __bincoef(const unsigned int __n, const unsigned int __k)
+ {
+ // Max e exponent before overflow.
+ static const _Tp __max_bincoeff
+ = std::numeric_limits<_Tp>::max_exponent10
+ * std::log(_Tp(10)) - _Tp(1);
+
+ const _Tp __log_coeff = __log_bincoef<_Tp>(__n, __k);
+ if (__log_coeff > __max_bincoeff)
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else
+ return std::exp(__log_coeff);
+ }
+
+
+ /**
+ * @brief Return \f$ \Gamma(x) \f$.
+ *
+ * @param __x The argument of the gamma function.
+ * @return The gamma function.
+ */
+ template<typename _Tp>
+ inline _Tp
+ __gamma(const _Tp __x)
+ {
+ return std::exp(__log_gamma(__x));
+ }
+
+
+ /**
+ * @brief Return the digamma function by series expansion.
+ * The digamma or @f$ \psi(x) @f$ function is defined by
+ * @f[
+ * \psi(x) = \frac{\Gamma'(x)}{\Gamma(x)}
+ * @f]
+ *
+ * The series is given by:
+ * @f[
+ * \psi(x) = -\gamma_E - \frac{1}{x}
+ * \sum_{k=1}^{\infty} \frac{x}{k(x + k)}
+ * @f]
+ */
+ template<typename _Tp>
+ _Tp
+ __psi_series(const _Tp __x)
+ {
+ _Tp __sum = -__numeric_constants<_Tp>::__gamma_e() - _Tp(1) / __x;
+ const unsigned int __max_iter = 100000;
+ for (unsigned int __k = 1; __k < __max_iter; ++__k)
+ {
+ const _Tp __term = __x / (__k * (__k + __x));
+ __sum += __term;
+ if (std::abs(__term / __sum) < std::numeric_limits<_Tp>::epsilon())
+ break;
+ }
+ return __sum;
+ }
+
+
+ /**
+ * @brief Return the digamma function for large argument.
+ * The digamma or @f$ \psi(x) @f$ function is defined by
+ * @f[
+ * \psi(x) = \frac{\Gamma'(x)}{\Gamma(x)}
+ * @f]
+ *
+ * The asymptotic series is given by:
+ * @f[
+ * \psi(x) = \ln(x) - \frac{1}{2x}
+ * - \sum_{n=1}^{\infty} \frac{B_{2n}}{2 n x^{2n}}
+ * @f]
+ */
+ template<typename _Tp>
+ _Tp
+ __psi_asymp(const _Tp __x)
+ {
+ _Tp __sum = std::log(__x) - _Tp(0.5L) / __x;
+ const _Tp __xx = __x * __x;
+ _Tp __xp = __xx;
+ const unsigned int __max_iter = 100;
+ for (unsigned int __k = 1; __k < __max_iter; ++__k)
+ {
+ const _Tp __term = __bernoulli<_Tp>(2 * __k) / (2 * __k * __xp);
+ __sum -= __term;
+ if (std::abs(__term / __sum) < std::numeric_limits<_Tp>::epsilon())
+ break;
+ __xp *= __xx;
+ }
+ return __sum;
+ }
+
+
+ /**
+ * @brief Return the digamma function.
+ * The digamma or @f$ \psi(x) @f$ function is defined by
+ * @f[
+ * \psi(x) = \frac{\Gamma'(x)}{\Gamma(x)}
+ * @f]
+ * For negative argument the reflection formula is used:
+ * @f[
+ * \psi(x) = \psi(1-x) - \pi \cot(\pi x)
+ * @f]
+ */
+ template<typename _Tp>
+ _Tp
+ __psi(const _Tp __x)
+ {
+ const int __n = static_cast<int>(__x + 0.5L);
+ const _Tp __eps = _Tp(4) * std::numeric_limits<_Tp>::epsilon();
+ if (__n <= 0 && std::abs(__x - _Tp(__n)) < __eps)
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__x < _Tp(0))
+ {
+ const _Tp __pi = __numeric_constants<_Tp>::__pi();
+ return __psi(_Tp(1) - __x)
+ - __pi * std::cos(__pi * __x) / std::sin(__pi * __x);
+ }
+ else if (__x > _Tp(100))
+ return __psi_asymp(__x);
+ else
+ return __psi_series(__x);
+ }
+
+
+ /**
+ * @brief Return the polygamma function @f$ \psi^{(n)}(x) @f$.
+ *
+ * The polygamma function is related to the Hurwitz zeta function:
+ * @f[
+ * \psi^{(n)}(x) = (-1)^{n+1} m! \zeta(m+1,x)
+ * @f]
+ */
+ template<typename _Tp>
+ _Tp
+ __psi(const unsigned int __n, const _Tp __x)
+ {
+ if (__x <= _Tp(0))
+ std::__throw_domain_error(__N("Argument out of range "
+ "in __psi"));
+ else if (__n == 0)
+ return __psi(__x);
+ else
+ {
+ const _Tp __hzeta = __hurwitz_zeta(_Tp(__n + 1), __x);
+#if _GLIBCXX_USE_C99_MATH_TR1
+ const _Tp __ln_nfact = std::tr1::lgamma(_Tp(__n + 1));
+#else
+ const _Tp __ln_nfact = __log_gamma(_Tp(__n + 1));
+#endif
+ _Tp __result = std::exp(__ln_nfact) * __hzeta;
+ if (__n % 2 == 1)
+ __result = -__result;
+ return __result;
+ }
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // _TR1_GAMMA_TCC
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/hashtable.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/hashtable.h
new file mode 100644
index 0000000..22fdbff
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/hashtable.h
@@ -0,0 +1,53 @@
+// TR1 hashtable.h header -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/hashtable.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_TR1_HASHTABLE_H
+#define _GLIBCXX_TR1_HASHTABLE_H 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/hashtable>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/hashtable>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_HASHTABLE_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/hypergeometric.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/hypergeometric.tcc
new file mode 100644
index 0000000..c975afa
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/hypergeometric.tcc
@@ -0,0 +1,774 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/hypergeometric.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland based:
+// (1) Handbook of Mathematical Functions,
+// ed. Milton Abramowitz and Irene A. Stegun,
+// Dover Publications,
+// Section 6, pp. 555-566
+// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
+
+#ifndef _GLIBCXX_TR1_HYPERGEOMETRIC_TCC
+#define _GLIBCXX_TR1_HYPERGEOMETRIC_TCC 1
+
+namespace std
+{
+namespace tr1
+{
+
+ // [5.2] Special functions
+
+ // Implementation-space details.
+ namespace __detail
+ {
+
+ /**
+ * @brief This routine returns the confluent hypergeometric function
+ * by series expansion.
+ *
+ * @f[
+ * _1F_1(a;c;x) = \frac{\Gamma(c)}{\Gamma(a)}
+ * \sum_{n=0}^{\infty}
+ * \frac{\Gamma(a+n)}{\Gamma(c+n)}
+ * \frac{x^n}{n!}
+ * @f]
+ *
+ * If a and b are integers and a < 0 and either b > 0 or b < a then the
+ * series is a polynomial with a finite number of terms. If b is an integer
+ * and b <= 0 the confluent hypergeometric function is undefined.
+ *
+ * @param __a The "numerator" parameter.
+ * @param __c The "denominator" parameter.
+ * @param __x The argument of the confluent hypergeometric function.
+ * @return The confluent hypergeometric function.
+ */
+ template<typename _Tp>
+ _Tp
+ __conf_hyperg_series(const _Tp __a, const _Tp __c, const _Tp __x)
+ {
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+
+ _Tp __term = _Tp(1);
+ _Tp __Fac = _Tp(1);
+ const unsigned int __max_iter = 100000;
+ unsigned int __i;
+ for (__i = 0; __i < __max_iter; ++__i)
+ {
+ __term *= (__a + _Tp(__i)) * __x
+ / ((__c + _Tp(__i)) * _Tp(1 + __i));
+ if (std::abs(__term) < __eps)
+ {
+ break;
+ }
+ __Fac += __term;
+ }
+ if (__i == __max_iter)
+ std::__throw_runtime_error(__N("Series failed to converge "
+ "in __conf_hyperg_series."));
+
+ return __Fac;
+ }
+
+
+ /**
+ * @brief Return the hypogeometric function @f$ _2F_1(a,b;c;x) @f$
+ * by an iterative procedure described in
+ * Luke, Algorithms for the Computation of Mathematical Functions.
+ *
+ * Like the case of the 2F1 rational approximations, these are
+ * probably guaranteed to converge for x < 0, barring gross
+ * numerical instability in the pre-asymptotic regime.
+ */
+ template<typename _Tp>
+ _Tp
+ __conf_hyperg_luke(const _Tp __a, const _Tp __c, const _Tp __xin)
+ {
+ const _Tp __big = std::pow(std::numeric_limits<_Tp>::max(), _Tp(0.16L));
+ const int __nmax = 20000;
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ const _Tp __x = -__xin;
+ const _Tp __x3 = __x * __x * __x;
+ const _Tp __t0 = __a / __c;
+ const _Tp __t1 = (__a + _Tp(1)) / (_Tp(2) * __c);
+ const _Tp __t2 = (__a + _Tp(2)) / (_Tp(2) * (__c + _Tp(1)));
+ _Tp __F = _Tp(1);
+ _Tp __prec;
+
+ _Tp __Bnm3 = _Tp(1);
+ _Tp __Bnm2 = _Tp(1) + __t1 * __x;
+ _Tp __Bnm1 = _Tp(1) + __t2 * __x * (_Tp(1) + __t1 / _Tp(3) * __x);
+
+ _Tp __Anm3 = _Tp(1);
+ _Tp __Anm2 = __Bnm2 - __t0 * __x;
+ _Tp __Anm1 = __Bnm1 - __t0 * (_Tp(1) + __t2 * __x) * __x
+ + __t0 * __t1 * (__c / (__c + _Tp(1))) * __x * __x;
+
+ int __n = 3;
+ while(1)
+ {
+ _Tp __npam1 = _Tp(__n - 1) + __a;
+ _Tp __npcm1 = _Tp(__n - 1) + __c;
+ _Tp __npam2 = _Tp(__n - 2) + __a;
+ _Tp __npcm2 = _Tp(__n - 2) + __c;
+ _Tp __tnm1 = _Tp(2 * __n - 1);
+ _Tp __tnm3 = _Tp(2 * __n - 3);
+ _Tp __tnm5 = _Tp(2 * __n - 5);
+ _Tp __F1 = (_Tp(__n - 2) - __a) / (_Tp(2) * __tnm3 * __npcm1);
+ _Tp __F2 = (_Tp(__n) + __a) * __npam1
+ / (_Tp(4) * __tnm1 * __tnm3 * __npcm2 * __npcm1);
+ _Tp __F3 = -__npam2 * __npam1 * (_Tp(__n - 2) - __a)
+ / (_Tp(8) * __tnm3 * __tnm3 * __tnm5
+ * (_Tp(__n - 3) + __c) * __npcm2 * __npcm1);
+ _Tp __E = -__npam1 * (_Tp(__n - 1) - __c)
+ / (_Tp(2) * __tnm3 * __npcm2 * __npcm1);
+
+ _Tp __An = (_Tp(1) + __F1 * __x) * __Anm1
+ + (__E + __F2 * __x) * __x * __Anm2 + __F3 * __x3 * __Anm3;
+ _Tp __Bn = (_Tp(1) + __F1 * __x) * __Bnm1
+ + (__E + __F2 * __x) * __x * __Bnm2 + __F3 * __x3 * __Bnm3;
+ _Tp __r = __An / __Bn;
+
+ __prec = std::abs((__F - __r) / __F);
+ __F = __r;
+
+ if (__prec < __eps || __n > __nmax)
+ break;
+
+ if (std::abs(__An) > __big || std::abs(__Bn) > __big)
+ {
+ __An /= __big;
+ __Bn /= __big;
+ __Anm1 /= __big;
+ __Bnm1 /= __big;
+ __Anm2 /= __big;
+ __Bnm2 /= __big;
+ __Anm3 /= __big;
+ __Bnm3 /= __big;
+ }
+ else if (std::abs(__An) < _Tp(1) / __big
+ || std::abs(__Bn) < _Tp(1) / __big)
+ {
+ __An *= __big;
+ __Bn *= __big;
+ __Anm1 *= __big;
+ __Bnm1 *= __big;
+ __Anm2 *= __big;
+ __Bnm2 *= __big;
+ __Anm3 *= __big;
+ __Bnm3 *= __big;
+ }
+
+ ++__n;
+ __Bnm3 = __Bnm2;
+ __Bnm2 = __Bnm1;
+ __Bnm1 = __Bn;
+ __Anm3 = __Anm2;
+ __Anm2 = __Anm1;
+ __Anm1 = __An;
+ }
+
+ if (__n >= __nmax)
+ std::__throw_runtime_error(__N("Iteration failed to converge "
+ "in __conf_hyperg_luke."));
+
+ return __F;
+ }
+
+
+ /**
+ * @brief Return the confluent hypogeometric function
+ * @f$ _1F_1(a;c;x) @f$.
+ *
+ * @todo Handle b == nonpositive integer blowup - return NaN.
+ *
+ * @param __a The "numerator" parameter.
+ * @param __c The "denominator" parameter.
+ * @param __x The argument of the confluent hypergeometric function.
+ * @return The confluent hypergeometric function.
+ */
+ template<typename _Tp>
+ inline _Tp
+ __conf_hyperg(const _Tp __a, const _Tp __c, const _Tp __x)
+ {
+#if _GLIBCXX_USE_C99_MATH_TR1
+ const _Tp __c_nint = std::tr1::nearbyint(__c);
+#else
+ const _Tp __c_nint = static_cast<int>(__c + _Tp(0.5L));
+#endif
+ if (__isnan(__a) || __isnan(__c) || __isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__c_nint == __c && __c_nint <= 0)
+ return std::numeric_limits<_Tp>::infinity();
+ else if (__a == _Tp(0))
+ return _Tp(1);
+ else if (__c == __a)
+ return std::exp(__x);
+ else if (__x < _Tp(0))
+ return __conf_hyperg_luke(__a, __c, __x);
+ else
+ return __conf_hyperg_series(__a, __c, __x);
+ }
+
+
+ /**
+ * @brief Return the hypogeometric function @f$ _2F_1(a,b;c;x) @f$
+ * by series expansion.
+ *
+ * The hypogeometric function is defined by
+ * @f[
+ * _2F_1(a,b;c;x) = \frac{\Gamma(c)}{\Gamma(a)\Gamma(b)}
+ * \sum_{n=0}^{\infty}
+ * \frac{\Gamma(a+n)\Gamma(b+n)}{\Gamma(c+n)}
+ * \frac{x^n}{n!}
+ * @f]
+ *
+ * This works and it's pretty fast.
+ *
+ * @param __a The first "numerator" parameter.
+ * @param __a The second "numerator" parameter.
+ * @param __c The "denominator" parameter.
+ * @param __x The argument of the confluent hypergeometric function.
+ * @return The confluent hypergeometric function.
+ */
+ template<typename _Tp>
+ _Tp
+ __hyperg_series(const _Tp __a, const _Tp __b,
+ const _Tp __c, const _Tp __x)
+ {
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+
+ _Tp __term = _Tp(1);
+ _Tp __Fabc = _Tp(1);
+ const unsigned int __max_iter = 100000;
+ unsigned int __i;
+ for (__i = 0; __i < __max_iter; ++__i)
+ {
+ __term *= (__a + _Tp(__i)) * (__b + _Tp(__i)) * __x
+ / ((__c + _Tp(__i)) * _Tp(1 + __i));
+ if (std::abs(__term) < __eps)
+ {
+ break;
+ }
+ __Fabc += __term;
+ }
+ if (__i == __max_iter)
+ std::__throw_runtime_error(__N("Series failed to converge "
+ "in __hyperg_series."));
+
+ return __Fabc;
+ }
+
+
+ /**
+ * @brief Return the hypogeometric function @f$ _2F_1(a,b;c;x) @f$
+ * by an iterative procedure described in
+ * Luke, Algorithms for the Computation of Mathematical Functions.
+ */
+ template<typename _Tp>
+ _Tp
+ __hyperg_luke(const _Tp __a, const _Tp __b, const _Tp __c,
+ const _Tp __xin)
+ {
+ const _Tp __big = std::pow(std::numeric_limits<_Tp>::max(), _Tp(0.16L));
+ const int __nmax = 20000;
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ const _Tp __x = -__xin;
+ const _Tp __x3 = __x * __x * __x;
+ const _Tp __t0 = __a * __b / __c;
+ const _Tp __t1 = (__a + _Tp(1)) * (__b + _Tp(1)) / (_Tp(2) * __c);
+ const _Tp __t2 = (__a + _Tp(2)) * (__b + _Tp(2))
+ / (_Tp(2) * (__c + _Tp(1)));
+
+ _Tp __F = _Tp(1);
+
+ _Tp __Bnm3 = _Tp(1);
+ _Tp __Bnm2 = _Tp(1) + __t1 * __x;
+ _Tp __Bnm1 = _Tp(1) + __t2 * __x * (_Tp(1) + __t1 / _Tp(3) * __x);
+
+ _Tp __Anm3 = _Tp(1);
+ _Tp __Anm2 = __Bnm2 - __t0 * __x;
+ _Tp __Anm1 = __Bnm1 - __t0 * (_Tp(1) + __t2 * __x) * __x
+ + __t0 * __t1 * (__c / (__c + _Tp(1))) * __x * __x;
+
+ int __n = 3;
+ while (1)
+ {
+ const _Tp __npam1 = _Tp(__n - 1) + __a;
+ const _Tp __npbm1 = _Tp(__n - 1) + __b;
+ const _Tp __npcm1 = _Tp(__n - 1) + __c;
+ const _Tp __npam2 = _Tp(__n - 2) + __a;
+ const _Tp __npbm2 = _Tp(__n - 2) + __b;
+ const _Tp __npcm2 = _Tp(__n - 2) + __c;
+ const _Tp __tnm1 = _Tp(2 * __n - 1);
+ const _Tp __tnm3 = _Tp(2 * __n - 3);
+ const _Tp __tnm5 = _Tp(2 * __n - 5);
+ const _Tp __n2 = __n * __n;
+ const _Tp __F1 = (_Tp(3) * __n2 + (__a + __b - _Tp(6)) * __n
+ + _Tp(2) - __a * __b - _Tp(2) * (__a + __b))
+ / (_Tp(2) * __tnm3 * __npcm1);
+ const _Tp __F2 = -(_Tp(3) * __n2 - (__a + __b + _Tp(6)) * __n
+ + _Tp(2) - __a * __b) * __npam1 * __npbm1
+ / (_Tp(4) * __tnm1 * __tnm3 * __npcm2 * __npcm1);
+ const _Tp __F3 = (__npam2 * __npam1 * __npbm2 * __npbm1
+ * (_Tp(__n - 2) - __a) * (_Tp(__n - 2) - __b))
+ / (_Tp(8) * __tnm3 * __tnm3 * __tnm5
+ * (_Tp(__n - 3) + __c) * __npcm2 * __npcm1);
+ const _Tp __E = -__npam1 * __npbm1 * (_Tp(__n - 1) - __c)
+ / (_Tp(2) * __tnm3 * __npcm2 * __npcm1);
+
+ _Tp __An = (_Tp(1) + __F1 * __x) * __Anm1
+ + (__E + __F2 * __x) * __x * __Anm2 + __F3 * __x3 * __Anm3;
+ _Tp __Bn = (_Tp(1) + __F1 * __x) * __Bnm1
+ + (__E + __F2 * __x) * __x * __Bnm2 + __F3 * __x3 * __Bnm3;
+ const _Tp __r = __An / __Bn;
+
+ const _Tp __prec = std::abs((__F - __r) / __F);
+ __F = __r;
+
+ if (__prec < __eps || __n > __nmax)
+ break;
+
+ if (std::abs(__An) > __big || std::abs(__Bn) > __big)
+ {
+ __An /= __big;
+ __Bn /= __big;
+ __Anm1 /= __big;
+ __Bnm1 /= __big;
+ __Anm2 /= __big;
+ __Bnm2 /= __big;
+ __Anm3 /= __big;
+ __Bnm3 /= __big;
+ }
+ else if (std::abs(__An) < _Tp(1) / __big
+ || std::abs(__Bn) < _Tp(1) / __big)
+ {
+ __An *= __big;
+ __Bn *= __big;
+ __Anm1 *= __big;
+ __Bnm1 *= __big;
+ __Anm2 *= __big;
+ __Bnm2 *= __big;
+ __Anm3 *= __big;
+ __Bnm3 *= __big;
+ }
+
+ ++__n;
+ __Bnm3 = __Bnm2;
+ __Bnm2 = __Bnm1;
+ __Bnm1 = __Bn;
+ __Anm3 = __Anm2;
+ __Anm2 = __Anm1;
+ __Anm1 = __An;
+ }
+
+ if (__n >= __nmax)
+ std::__throw_runtime_error(__N("Iteration failed to converge "
+ "in __hyperg_luke."));
+
+ return __F;
+ }
+
+
+ /**
+ * @brief Return the hypogeometric function @f$ _2F_1(a,b;c;x) @f$ by the reflection
+ * formulae in Abramowitz & Stegun formula 15.3.6 for d = c - a - b not integral
+ * and formula 15.3.11 for d = c - a - b integral.
+ * This assumes a, b, c != negative integer.
+ *
+ * The hypogeometric function is defined by
+ * @f[
+ * _2F_1(a,b;c;x) = \frac{\Gamma(c)}{\Gamma(a)\Gamma(b)}
+ * \sum_{n=0}^{\infty}
+ * \frac{\Gamma(a+n)\Gamma(b+n)}{\Gamma(c+n)}
+ * \frac{x^n}{n!}
+ * @f]
+ *
+ * The reflection formula for nonintegral @f$ d = c - a - b @f$ is:
+ * @f[
+ * _2F_1(a,b;c;x) = \frac{\Gamma(c)\Gamma(d)}{\Gamma(c-a)\Gamma(c-b)}
+ * _2F_1(a,b;1-d;1-x)
+ * + \frac{\Gamma(c)\Gamma(-d)}{\Gamma(a)\Gamma(b)}
+ * _2F_1(c-a,c-b;1+d;1-x)
+ * @f]
+ *
+ * The reflection formula for integral @f$ m = c - a - b @f$ is:
+ * @f[
+ * _2F_1(a,b;a+b+m;x) = \frac{\Gamma(m)\Gamma(a+b+m)}{\Gamma(a+m)\Gamma(b+m)}
+ * \sum_{k=0}^{m-1} \frac{(m+a)_k(m+b)_k}{k!(1-m)_k}
+ * -
+ * @f]
+ */
+ template<typename _Tp>
+ _Tp
+ __hyperg_reflect(const _Tp __a, const _Tp __b, const _Tp __c,
+ const _Tp __x)
+ {
+ const _Tp __d = __c - __a - __b;
+ const int __intd = std::floor(__d + _Tp(0.5L));
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ const _Tp __toler = _Tp(1000) * __eps;
+ const _Tp __log_max = std::log(std::numeric_limits<_Tp>::max());
+ const bool __d_integer = (std::abs(__d - __intd) < __toler);
+
+ if (__d_integer)
+ {
+ const _Tp __ln_omx = std::log(_Tp(1) - __x);
+ const _Tp __ad = std::abs(__d);
+ _Tp __F1, __F2;
+
+ _Tp __d1, __d2;
+ if (__d >= _Tp(0))
+ {
+ __d1 = __d;
+ __d2 = _Tp(0);
+ }
+ else
+ {
+ __d1 = _Tp(0);
+ __d2 = __d;
+ }
+
+ const _Tp __lng_c = __log_gamma(__c);
+
+ // Evaluate F1.
+ if (__ad < __eps)
+ {
+ // d = c - a - b = 0.
+ __F1 = _Tp(0);
+ }
+ else
+ {
+
+ bool __ok_d1 = true;
+ _Tp __lng_ad, __lng_ad1, __lng_bd1;
+ __try
+ {
+ __lng_ad = __log_gamma(__ad);
+ __lng_ad1 = __log_gamma(__a + __d1);
+ __lng_bd1 = __log_gamma(__b + __d1);
+ }
+ __catch(...)
+ {
+ __ok_d1 = false;
+ }
+
+ if (__ok_d1)
+ {
+ /* Gamma functions in the denominator are ok.
+ * Proceed with evaluation.
+ */
+ _Tp __sum1 = _Tp(1);
+ _Tp __term = _Tp(1);
+ _Tp __ln_pre1 = __lng_ad + __lng_c + __d2 * __ln_omx
+ - __lng_ad1 - __lng_bd1;
+
+ /* Do F1 sum.
+ */
+ for (int __i = 1; __i < __ad; ++__i)
+ {
+ const int __j = __i - 1;
+ __term *= (__a + __d2 + __j) * (__b + __d2 + __j)
+ / (_Tp(1) + __d2 + __j) / __i * (_Tp(1) - __x);
+ __sum1 += __term;
+ }
+
+ if (__ln_pre1 > __log_max)
+ std::__throw_runtime_error(__N("Overflow of gamma functions "
+ "in __hyperg_luke."));
+ else
+ __F1 = std::exp(__ln_pre1) * __sum1;
+ }
+ else
+ {
+ // Gamma functions in the denominator were not ok.
+ // So the F1 term is zero.
+ __F1 = _Tp(0);
+ }
+ } // end F1 evaluation
+
+ // Evaluate F2.
+ bool __ok_d2 = true;
+ _Tp __lng_ad2, __lng_bd2;
+ __try
+ {
+ __lng_ad2 = __log_gamma(__a + __d2);
+ __lng_bd2 = __log_gamma(__b + __d2);
+ }
+ __catch(...)
+ {
+ __ok_d2 = false;
+ }
+
+ if (__ok_d2)
+ {
+ // Gamma functions in the denominator are ok.
+ // Proceed with evaluation.
+ const int __maxiter = 2000;
+ const _Tp __psi_1 = -__numeric_constants<_Tp>::__gamma_e();
+ const _Tp __psi_1pd = __psi(_Tp(1) + __ad);
+ const _Tp __psi_apd1 = __psi(__a + __d1);
+ const _Tp __psi_bpd1 = __psi(__b + __d1);
+
+ _Tp __psi_term = __psi_1 + __psi_1pd - __psi_apd1
+ - __psi_bpd1 - __ln_omx;
+ _Tp __fact = _Tp(1);
+ _Tp __sum2 = __psi_term;
+ _Tp __ln_pre2 = __lng_c + __d1 * __ln_omx
+ - __lng_ad2 - __lng_bd2;
+
+ // Do F2 sum.
+ int __j;
+ for (__j = 1; __j < __maxiter; ++__j)
+ {
+ // Values for psi functions use recurrence; Abramowitz & Stegun 6.3.5
+ const _Tp __term1 = _Tp(1) / _Tp(__j)
+ + _Tp(1) / (__ad + __j);
+ const _Tp __term2 = _Tp(1) / (__a + __d1 + _Tp(__j - 1))
+ + _Tp(1) / (__b + __d1 + _Tp(__j - 1));
+ __psi_term += __term1 - __term2;
+ __fact *= (__a + __d1 + _Tp(__j - 1))
+ * (__b + __d1 + _Tp(__j - 1))
+ / ((__ad + __j) * __j) * (_Tp(1) - __x);
+ const _Tp __delta = __fact * __psi_term;
+ __sum2 += __delta;
+ if (std::abs(__delta) < __eps * std::abs(__sum2))
+ break;
+ }
+ if (__j == __maxiter)
+ std::__throw_runtime_error(__N("Sum F2 failed to converge "
+ "in __hyperg_reflect"));
+
+ if (__sum2 == _Tp(0))
+ __F2 = _Tp(0);
+ else
+ __F2 = std::exp(__ln_pre2) * __sum2;
+ }
+ else
+ {
+ // Gamma functions in the denominator not ok.
+ // So the F2 term is zero.
+ __F2 = _Tp(0);
+ } // end F2 evaluation
+
+ const _Tp __sgn_2 = (__intd % 2 == 1 ? -_Tp(1) : _Tp(1));
+ const _Tp __F = __F1 + __sgn_2 * __F2;
+
+ return __F;
+ }
+ else
+ {
+ // d = c - a - b not an integer.
+
+ // These gamma functions appear in the denominator, so we
+ // catch their harmless domain errors and set the terms to zero.
+ bool __ok1 = true;
+ _Tp __sgn_g1ca = _Tp(0), __ln_g1ca = _Tp(0);
+ _Tp __sgn_g1cb = _Tp(0), __ln_g1cb = _Tp(0);
+ __try
+ {
+ __sgn_g1ca = __log_gamma_sign(__c - __a);
+ __ln_g1ca = __log_gamma(__c - __a);
+ __sgn_g1cb = __log_gamma_sign(__c - __b);
+ __ln_g1cb = __log_gamma(__c - __b);
+ }
+ __catch(...)
+ {
+ __ok1 = false;
+ }
+
+ bool __ok2 = true;
+ _Tp __sgn_g2a = _Tp(0), __ln_g2a = _Tp(0);
+ _Tp __sgn_g2b = _Tp(0), __ln_g2b = _Tp(0);
+ __try
+ {
+ __sgn_g2a = __log_gamma_sign(__a);
+ __ln_g2a = __log_gamma(__a);
+ __sgn_g2b = __log_gamma_sign(__b);
+ __ln_g2b = __log_gamma(__b);
+ }
+ __catch(...)
+ {
+ __ok2 = false;
+ }
+
+ const _Tp __sgn_gc = __log_gamma_sign(__c);
+ const _Tp __ln_gc = __log_gamma(__c);
+ const _Tp __sgn_gd = __log_gamma_sign(__d);
+ const _Tp __ln_gd = __log_gamma(__d);
+ const _Tp __sgn_gmd = __log_gamma_sign(-__d);
+ const _Tp __ln_gmd = __log_gamma(-__d);
+
+ const _Tp __sgn1 = __sgn_gc * __sgn_gd * __sgn_g1ca * __sgn_g1cb;
+ const _Tp __sgn2 = __sgn_gc * __sgn_gmd * __sgn_g2a * __sgn_g2b;
+
+ _Tp __pre1, __pre2;
+ if (__ok1 && __ok2)
+ {
+ _Tp __ln_pre1 = __ln_gc + __ln_gd - __ln_g1ca - __ln_g1cb;
+ _Tp __ln_pre2 = __ln_gc + __ln_gmd - __ln_g2a - __ln_g2b
+ + __d * std::log(_Tp(1) - __x);
+ if (__ln_pre1 < __log_max && __ln_pre2 < __log_max)
+ {
+ __pre1 = std::exp(__ln_pre1);
+ __pre2 = std::exp(__ln_pre2);
+ __pre1 *= __sgn1;
+ __pre2 *= __sgn2;
+ }
+ else
+ {
+ std::__throw_runtime_error(__N("Overflow of gamma functions "
+ "in __hyperg_reflect"));
+ }
+ }
+ else if (__ok1 && !__ok2)
+ {
+ _Tp __ln_pre1 = __ln_gc + __ln_gd - __ln_g1ca - __ln_g1cb;
+ if (__ln_pre1 < __log_max)
+ {
+ __pre1 = std::exp(__ln_pre1);
+ __pre1 *= __sgn1;
+ __pre2 = _Tp(0);
+ }
+ else
+ {
+ std::__throw_runtime_error(__N("Overflow of gamma functions "
+ "in __hyperg_reflect"));
+ }
+ }
+ else if (!__ok1 && __ok2)
+ {
+ _Tp __ln_pre2 = __ln_gc + __ln_gmd - __ln_g2a - __ln_g2b
+ + __d * std::log(_Tp(1) - __x);
+ if (__ln_pre2 < __log_max)
+ {
+ __pre1 = _Tp(0);
+ __pre2 = std::exp(__ln_pre2);
+ __pre2 *= __sgn2;
+ }
+ else
+ {
+ std::__throw_runtime_error(__N("Overflow of gamma functions "
+ "in __hyperg_reflect"));
+ }
+ }
+ else
+ {
+ __pre1 = _Tp(0);
+ __pre2 = _Tp(0);
+ std::__throw_runtime_error(__N("Underflow of gamma functions "
+ "in __hyperg_reflect"));
+ }
+
+ const _Tp __F1 = __hyperg_series(__a, __b, _Tp(1) - __d,
+ _Tp(1) - __x);
+ const _Tp __F2 = __hyperg_series(__c - __a, __c - __b, _Tp(1) + __d,
+ _Tp(1) - __x);
+
+ const _Tp __F = __pre1 * __F1 + __pre2 * __F2;
+
+ return __F;
+ }
+ }
+
+
+ /**
+ * @brief Return the hypogeometric function @f$ _2F_1(a,b;c;x) @f$.
+ *
+ * The hypogeometric function is defined by
+ * @f[
+ * _2F_1(a,b;c;x) = \frac{\Gamma(c)}{\Gamma(a)\Gamma(b)}
+ * \sum_{n=0}^{\infty}
+ * \frac{\Gamma(a+n)\Gamma(b+n)}{\Gamma(c+n)}
+ * \frac{x^n}{n!}
+ * @f]
+ *
+ * @param __a The first "numerator" parameter.
+ * @param __a The second "numerator" parameter.
+ * @param __c The "denominator" parameter.
+ * @param __x The argument of the confluent hypergeometric function.
+ * @return The confluent hypergeometric function.
+ */
+ template<typename _Tp>
+ inline _Tp
+ __hyperg(const _Tp __a, const _Tp __b, const _Tp __c, const _Tp __x)
+ {
+#if _GLIBCXX_USE_C99_MATH_TR1
+ const _Tp __a_nint = std::tr1::nearbyint(__a);
+ const _Tp __b_nint = std::tr1::nearbyint(__b);
+ const _Tp __c_nint = std::tr1::nearbyint(__c);
+#else
+ const _Tp __a_nint = static_cast<int>(__a + _Tp(0.5L));
+ const _Tp __b_nint = static_cast<int>(__b + _Tp(0.5L));
+ const _Tp __c_nint = static_cast<int>(__c + _Tp(0.5L));
+#endif
+ const _Tp __toler = _Tp(1000) * std::numeric_limits<_Tp>::epsilon();
+ if (std::abs(__x) >= _Tp(1))
+ std::__throw_domain_error(__N("Argument outside unit circle "
+ "in __hyperg."));
+ else if (__isnan(__a) || __isnan(__b)
+ || __isnan(__c) || __isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__c_nint == __c && __c_nint <= _Tp(0))
+ return std::numeric_limits<_Tp>::infinity();
+ else if (std::abs(__c - __b) < __toler || std::abs(__c - __a) < __toler)
+ return std::pow(_Tp(1) - __x, __c - __a - __b);
+ else if (__a >= _Tp(0) && __b >= _Tp(0) && __c >= _Tp(0)
+ && __x >= _Tp(0) && __x < _Tp(0.995L))
+ return __hyperg_series(__a, __b, __c, __x);
+ else if (std::abs(__a) < _Tp(10) && std::abs(__b) < _Tp(10))
+ {
+ // For integer a and b the hypergeometric function is a finite polynomial.
+ if (__a < _Tp(0) && std::abs(__a - __a_nint) < __toler)
+ return __hyperg_series(__a_nint, __b, __c, __x);
+ else if (__b < _Tp(0) && std::abs(__b - __b_nint) < __toler)
+ return __hyperg_series(__a, __b_nint, __c, __x);
+ else if (__x < -_Tp(0.25L))
+ return __hyperg_luke(__a, __b, __c, __x);
+ else if (__x < _Tp(0.5L))
+ return __hyperg_series(__a, __b, __c, __x);
+ else
+ if (std::abs(__c) > _Tp(10))
+ return __hyperg_series(__a, __b, __c, __x);
+ else
+ return __hyperg_reflect(__a, __b, __c, __x);
+ }
+ else
+ return __hyperg_luke(__a, __b, __c, __x);
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // _GLIBCXX_TR1_HYPERGEOMETRIC_TCC
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/inttypes.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/inttypes.h
new file mode 100644
index 0000000..4c8fd45
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/inttypes.h
@@ -0,0 +1,34 @@
+// TR1 inttypes.h -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/inttypes.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_INTTYPES_H
+#define _GLIBCXX_TR1_INTTYPES_H 1
+
+#include <tr1/cinttypes>
+
+#endif // _GLIBCXX_TR1_INTTYPES_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/legendre_function.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/legendre_function.tcc
new file mode 100644
index 0000000..8b59814
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/legendre_function.tcc
@@ -0,0 +1,305 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/legendre_function.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland based on:
+// (1) Handbook of Mathematical Functions,
+// ed. Milton Abramowitz and Irene A. Stegun,
+// Dover Publications,
+// Section 8, pp. 331-341
+// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
+// (3) Numerical Recipes in C, by W. H. Press, S. A. Teukolsky,
+// W. T. Vetterling, B. P. Flannery, Cambridge University Press (1992),
+// 2nd ed, pp. 252-254
+
+#ifndef _GLIBCXX_TR1_LEGENDRE_FUNCTION_TCC
+#define _GLIBCXX_TR1_LEGENDRE_FUNCTION_TCC 1
+
+#include "special_function_util.h"
+
+namespace std
+{
+namespace tr1
+{
+
+ // [5.2] Special functions
+
+ // Implementation-space details.
+ namespace __detail
+ {
+
+ /**
+ * @brief Return the Legendre polynomial by recursion on order
+ * @f$ l @f$.
+ *
+ * The Legendre function of @f$ l @f$ and @f$ x @f$,
+ * @f$ P_l(x) @f$, is defined by:
+ * @f[
+ * P_l(x) = \frac{1}{2^l l!}\frac{d^l}{dx^l}(x^2 - 1)^{l}
+ * @f]
+ *
+ * @param l The order of the Legendre polynomial. @f$l >= 0@f$.
+ * @param x The argument of the Legendre polynomial. @f$|x| <= 1@f$.
+ */
+ template<typename _Tp>
+ _Tp
+ __poly_legendre_p(const unsigned int __l, const _Tp __x)
+ {
+
+ if ((__x < _Tp(-1)) || (__x > _Tp(+1)))
+ std::__throw_domain_error(__N("Argument out of range"
+ " in __poly_legendre_p."));
+ else if (__isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__x == +_Tp(1))
+ return +_Tp(1);
+ else if (__x == -_Tp(1))
+ return (__l % 2 == 1 ? -_Tp(1) : +_Tp(1));
+ else
+ {
+ _Tp __p_lm2 = _Tp(1);
+ if (__l == 0)
+ return __p_lm2;
+
+ _Tp __p_lm1 = __x;
+ if (__l == 1)
+ return __p_lm1;
+
+ _Tp __p_l = 0;
+ for (unsigned int __ll = 2; __ll <= __l; ++__ll)
+ {
+ // This arrangement is supposed to be better for roundoff
+ // protection, Arfken, 2nd Ed, Eq 12.17a.
+ __p_l = _Tp(2) * __x * __p_lm1 - __p_lm2
+ - (__x * __p_lm1 - __p_lm2) / _Tp(__ll);
+ __p_lm2 = __p_lm1;
+ __p_lm1 = __p_l;
+ }
+
+ return __p_l;
+ }
+ }
+
+
+ /**
+ * @brief Return the associated Legendre function by recursion
+ * on @f$ l @f$.
+ *
+ * The associated Legendre function is derived from the Legendre function
+ * @f$ P_l(x) @f$ by the Rodrigues formula:
+ * @f[
+ * P_l^m(x) = (1 - x^2)^{m/2}\frac{d^m}{dx^m}P_l(x)
+ * @f]
+ *
+ * @param l The order of the associated Legendre function.
+ * @f$ l >= 0 @f$.
+ * @param m The order of the associated Legendre function.
+ * @f$ m <= l @f$.
+ * @param x The argument of the associated Legendre function.
+ * @f$ |x| <= 1 @f$.
+ */
+ template<typename _Tp>
+ _Tp
+ __assoc_legendre_p(const unsigned int __l, const unsigned int __m,
+ const _Tp __x)
+ {
+
+ if (__x < _Tp(-1) || __x > _Tp(+1))
+ std::__throw_domain_error(__N("Argument out of range"
+ " in __assoc_legendre_p."));
+ else if (__m > __l)
+ std::__throw_domain_error(__N("Degree out of range"
+ " in __assoc_legendre_p."));
+ else if (__isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__m == 0)
+ return __poly_legendre_p(__l, __x);
+ else
+ {
+ _Tp __p_mm = _Tp(1);
+ if (__m > 0)
+ {
+ // Two square roots seem more accurate more of the time
+ // than just one.
+ _Tp __root = std::sqrt(_Tp(1) - __x) * std::sqrt(_Tp(1) + __x);
+ _Tp __fact = _Tp(1);
+ for (unsigned int __i = 1; __i <= __m; ++__i)
+ {
+ __p_mm *= -__fact * __root;
+ __fact += _Tp(2);
+ }
+ }
+ if (__l == __m)
+ return __p_mm;
+
+ _Tp __p_mp1m = _Tp(2 * __m + 1) * __x * __p_mm;
+ if (__l == __m + 1)
+ return __p_mp1m;
+
+ _Tp __p_lm2m = __p_mm;
+ _Tp __P_lm1m = __p_mp1m;
+ _Tp __p_lm = _Tp(0);
+ for (unsigned int __j = __m + 2; __j <= __l; ++__j)
+ {
+ __p_lm = (_Tp(2 * __j - 1) * __x * __P_lm1m
+ - _Tp(__j + __m - 1) * __p_lm2m) / _Tp(__j - __m);
+ __p_lm2m = __P_lm1m;
+ __P_lm1m = __p_lm;
+ }
+
+ return __p_lm;
+ }
+ }
+
+
+ /**
+ * @brief Return the spherical associated Legendre function.
+ *
+ * The spherical associated Legendre function of @f$ l @f$, @f$ m @f$,
+ * and @f$ \theta @f$ is defined as @f$ Y_l^m(\theta,0) @f$ where
+ * @f[
+ * Y_l^m(\theta,\phi) = (-1)^m[\frac{(2l+1)}{4\pi}
+ * \frac{(l-m)!}{(l+m)!}]
+ * P_l^m(\cos\theta) \exp^{im\phi}
+ * @f]
+ * is the spherical harmonic function and @f$ P_l^m(x) @f$ is the
+ * associated Legendre function.
+ *
+ * This function differs from the associated Legendre function by
+ * argument (@f$x = \cos(\theta)@f$) and by a normalization factor
+ * but this factor is rather large for large @f$ l @f$ and @f$ m @f$
+ * and so this function is stable for larger differences of @f$ l @f$
+ * and @f$ m @f$.
+ *
+ * @param l The order of the spherical associated Legendre function.
+ * @f$ l >= 0 @f$.
+ * @param m The order of the spherical associated Legendre function.
+ * @f$ m <= l @f$.
+ * @param theta The radian angle argument of the spherical associated
+ * Legendre function.
+ */
+ template <typename _Tp>
+ _Tp
+ __sph_legendre(const unsigned int __l, const unsigned int __m,
+ const _Tp __theta)
+ {
+ if (__isnan(__theta))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+
+ const _Tp __x = std::cos(__theta);
+
+ if (__l < __m)
+ {
+ std::__throw_domain_error(__N("Bad argument "
+ "in __sph_legendre."));
+ }
+ else if (__m == 0)
+ {
+ _Tp __P = __poly_legendre_p(__l, __x);
+ _Tp __fact = std::sqrt(_Tp(2 * __l + 1)
+ / (_Tp(4) * __numeric_constants<_Tp>::__pi()));
+ __P *= __fact;
+ return __P;
+ }
+ else if (__x == _Tp(1) || __x == -_Tp(1))
+ {
+ // m > 0 here
+ return _Tp(0);
+ }
+ else
+ {
+ // m > 0 and |x| < 1 here
+
+ // Starting value for recursion.
+ // Y_m^m(x) = sqrt( (2m+1)/(4pi m) gamma(m+1/2)/gamma(m) )
+ // (-1)^m (1-x^2)^(m/2) / pi^(1/4)
+ const _Tp __sgn = ( __m % 2 == 1 ? -_Tp(1) : _Tp(1));
+ const _Tp __y_mp1m_factor = __x * std::sqrt(_Tp(2 * __m + 3));
+#if _GLIBCXX_USE_C99_MATH_TR1
+ const _Tp __lncirc = std::tr1::log1p(-__x * __x);
+#else
+ const _Tp __lncirc = std::log(_Tp(1) - __x * __x);
+#endif
+ // Gamma(m+1/2) / Gamma(m)
+#if _GLIBCXX_USE_C99_MATH_TR1
+ const _Tp __lnpoch = std::tr1::lgamma(_Tp(__m + _Tp(0.5L)))
+ - std::tr1::lgamma(_Tp(__m));
+#else
+ const _Tp __lnpoch = __log_gamma(_Tp(__m + _Tp(0.5L)))
+ - __log_gamma(_Tp(__m));
+#endif
+ const _Tp __lnpre_val =
+ -_Tp(0.25L) * __numeric_constants<_Tp>::__lnpi()
+ + _Tp(0.5L) * (__lnpoch + __m * __lncirc);
+ _Tp __sr = std::sqrt((_Tp(2) + _Tp(1) / __m)
+ / (_Tp(4) * __numeric_constants<_Tp>::__pi()));
+ _Tp __y_mm = __sgn * __sr * std::exp(__lnpre_val);
+ _Tp __y_mp1m = __y_mp1m_factor * __y_mm;
+
+ if (__l == __m)
+ {
+ return __y_mm;
+ }
+ else if (__l == __m + 1)
+ {
+ return __y_mp1m;
+ }
+ else
+ {
+ _Tp __y_lm = _Tp(0);
+
+ // Compute Y_l^m, l > m+1, upward recursion on l.
+ for ( int __ll = __m + 2; __ll <= __l; ++__ll)
+ {
+ const _Tp __rat1 = _Tp(__ll - __m) / _Tp(__ll + __m);
+ const _Tp __rat2 = _Tp(__ll - __m - 1) / _Tp(__ll + __m - 1);
+ const _Tp __fact1 = std::sqrt(__rat1 * _Tp(2 * __ll + 1)
+ * _Tp(2 * __ll - 1));
+ const _Tp __fact2 = std::sqrt(__rat1 * __rat2 * _Tp(2 * __ll + 1)
+ / _Tp(2 * __ll - 3));
+ __y_lm = (__x * __y_mp1m * __fact1
+ - (__ll + __m - 1) * __y_mm * __fact2) / _Tp(__ll - __m);
+ __y_mm = __y_mp1m;
+ __y_mp1m = __y_lm;
+ }
+
+ return __y_lm;
+ }
+ }
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // _GLIBCXX_TR1_LEGENDRE_FUNCTION_TCC
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/limits.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/limits.h
new file mode 100644
index 0000000..d95d360
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/limits.h
@@ -0,0 +1,34 @@
+// TR1 limits.h -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/limits.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _TR1_LIMITS_H
+#define _TR1_LIMITS_H 1
+
+#include <tr1/climits>
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/math.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/math.h
new file mode 100644
index 0000000..15d6d64
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/math.h
@@ -0,0 +1,186 @@
+// TR1 math.h -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/math.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_MATH_H
+#define _GLIBCXX_TR1_MATH_H 1
+
+#include <tr1/cmath>
+
+#if _GLIBCXX_USE_C99_MATH_TR1
+
+using std::tr1::acos;
+using std::tr1::acosh;
+using std::tr1::asin;
+using std::tr1::asinh;
+using std::tr1::atan;
+using std::tr1::atan2;
+using std::tr1::atanh;
+using std::tr1::cbrt;
+using std::tr1::ceil;
+using std::tr1::copysign;
+using std::tr1::cos;
+using std::tr1::cosh;
+using std::tr1::erf;
+using std::tr1::erfc;
+using std::tr1::exp;
+using std::tr1::exp2;
+using std::tr1::expm1;
+using std::tr1::fabs;
+using std::tr1::fdim;
+using std::tr1::floor;
+using std::tr1::fma;
+using std::tr1::fmax;
+using std::tr1::fmin;
+using std::tr1::fmod;
+using std::tr1::frexp;
+using std::tr1::hypot;
+using std::tr1::ilogb;
+using std::tr1::ldexp;
+using std::tr1::lgamma;
+using std::tr1::llrint;
+using std::tr1::llround;
+using std::tr1::log;
+using std::tr1::log10;
+using std::tr1::log1p;
+using std::tr1::log2;
+using std::tr1::logb;
+using std::tr1::lrint;
+using std::tr1::lround;
+using std::tr1::nearbyint;
+using std::tr1::nextafter;
+using std::tr1::nexttoward;
+using std::tr1::pow;
+using std::tr1::remainder;
+using std::tr1::remquo;
+using std::tr1::rint;
+using std::tr1::round;
+using std::tr1::scalbln;
+using std::tr1::scalbn;
+using std::tr1::sin;
+using std::tr1::sinh;
+using std::tr1::sqrt;
+using std::tr1::tan;
+using std::tr1::tanh;
+using std::tr1::tgamma;
+using std::tr1::trunc;
+
+#endif
+
+using std::tr1::assoc_laguerref;
+using std::tr1::assoc_laguerre;
+using std::tr1::assoc_laguerrel;
+
+using std::tr1::assoc_legendref;
+using std::tr1::assoc_legendre;
+using std::tr1::assoc_legendrel;
+
+using std::tr1::betaf;
+using std::tr1::beta;
+using std::tr1::betal;
+
+using std::tr1::comp_ellint_1f;
+using std::tr1::comp_ellint_1;
+using std::tr1::comp_ellint_1l;
+
+using std::tr1::comp_ellint_2f;
+using std::tr1::comp_ellint_2;
+using std::tr1::comp_ellint_2l;
+
+using std::tr1::comp_ellint_3f;
+using std::tr1::comp_ellint_3;
+using std::tr1::comp_ellint_3l;
+
+using std::tr1::conf_hypergf;
+using std::tr1::conf_hyperg;
+using std::tr1::conf_hypergl;
+
+using std::tr1::cyl_bessel_if;
+using std::tr1::cyl_bessel_i;
+using std::tr1::cyl_bessel_il;
+
+using std::tr1::cyl_bessel_jf;
+using std::tr1::cyl_bessel_j;
+using std::tr1::cyl_bessel_jl;
+
+using std::tr1::cyl_bessel_kf;
+using std::tr1::cyl_bessel_k;
+using std::tr1::cyl_bessel_kl;
+
+using std::tr1::cyl_neumannf;
+using std::tr1::cyl_neumann;
+using std::tr1::cyl_neumannl;
+
+using std::tr1::ellint_1f;
+using std::tr1::ellint_1;
+using std::tr1::ellint_1l;
+
+using std::tr1::ellint_2f;
+using std::tr1::ellint_2;
+using std::tr1::ellint_2l;
+
+using std::tr1::ellint_3f;
+using std::tr1::ellint_3;
+using std::tr1::ellint_3l;
+
+using std::tr1::expintf;
+using std::tr1::expint;
+using std::tr1::expintl;
+
+using std::tr1::hermitef;
+using std::tr1::hermite;
+using std::tr1::hermitel;
+
+using std::tr1::hypergf;
+using std::tr1::hyperg;
+using std::tr1::hypergl;
+
+using std::tr1::laguerref;
+using std::tr1::laguerre;
+using std::tr1::laguerrel;
+
+using std::tr1::legendref;
+using std::tr1::legendre;
+using std::tr1::legendrel;
+
+using std::tr1::riemann_zetaf;
+using std::tr1::riemann_zeta;
+using std::tr1::riemann_zetal;
+
+using std::tr1::sph_besself;
+using std::tr1::sph_bessel;
+using std::tr1::sph_bessell;
+
+using std::tr1::sph_legendref;
+using std::tr1::sph_legendre;
+using std::tr1::sph_legendrel;
+
+using std::tr1::sph_neumannf;
+using std::tr1::sph_neumann;
+using std::tr1::sph_neumannl;
+
+#endif // _GLIBCXX_TR1_MATH_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/memory b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/memory
new file mode 100644
index 0000000..8b021a1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/memory
@@ -0,0 +1,67 @@
+// <tr1/memory> -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/**
+ * @file tr1/memory
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_MEMORY
+#define _GLIBCXX_TR1_MEMORY 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <memory>
+#include <exception> // std::exception
+#include <typeinfo> // std::type_info in get_deleter
+#include <bits/stl_algobase.h> // std::swap
+#include <iosfwd> // std::basic_ostream
+#include <ext/atomicity.h>
+#include <ext/concurrence.h>
+#include <bits/functexcept.h>
+#include <bits/stl_function.h> // std::less
+#include <debug/debug.h>
+#include <tr1/type_traits>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/boost_sp_counted_base.h>
+# include <tr1/shared_ptr.h>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/boost_sp_counted_base.h>
+# include <tr1/shared_ptr.h>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_MEMORY
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/modified_bessel_func.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/modified_bessel_func.tcc
new file mode 100644
index 0000000..7b8aebc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/modified_bessel_func.tcc
@@ -0,0 +1,436 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/modified_bessel_func.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland.
+//
+// References:
+// (1) Handbook of Mathematical Functions,
+// Ed. Milton Abramowitz and Irene A. Stegun,
+// Dover Publications,
+// Section 9, pp. 355-434, Section 10 pp. 435-478
+// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
+// (3) Numerical Recipes in C, by W. H. Press, S. A. Teukolsky,
+// W. T. Vetterling, B. P. Flannery, Cambridge University Press (1992),
+// 2nd ed, pp. 246-249.
+
+#ifndef _GLIBCXX_TR1_MODIFIED_BESSEL_FUNC_TCC
+#define _GLIBCXX_TR1_MODIFIED_BESSEL_FUNC_TCC 1
+
+#include "special_function_util.h"
+
+namespace std
+{
+namespace tr1
+{
+
+ // [5.2] Special functions
+
+ // Implementation-space details.
+ namespace __detail
+ {
+
+ /**
+ * @brief Compute the modified Bessel functions @f$ I_\nu(x) @f$ and
+ * @f$ K_\nu(x) @f$ and their first derivatives
+ * @f$ I'_\nu(x) @f$ and @f$ K'_\nu(x) @f$ respectively.
+ * These four functions are computed together for numerical
+ * stability.
+ *
+ * @param __nu The order of the Bessel functions.
+ * @param __x The argument of the Bessel functions.
+ * @param __Inu The output regular modified Bessel function.
+ * @param __Knu The output irregular modified Bessel function.
+ * @param __Ipnu The output derivative of the regular
+ * modified Bessel function.
+ * @param __Kpnu The output derivative of the irregular
+ * modified Bessel function.
+ */
+ template <typename _Tp>
+ void
+ __bessel_ik(const _Tp __nu, const _Tp __x,
+ _Tp & __Inu, _Tp & __Knu, _Tp & __Ipnu, _Tp & __Kpnu)
+ {
+ if (__x == _Tp(0))
+ {
+ if (__nu == _Tp(0))
+ {
+ __Inu = _Tp(1);
+ __Ipnu = _Tp(0);
+ }
+ else if (__nu == _Tp(1))
+ {
+ __Inu = _Tp(0);
+ __Ipnu = _Tp(0.5L);
+ }
+ else
+ {
+ __Inu = _Tp(0);
+ __Ipnu = _Tp(0);
+ }
+ __Knu = std::numeric_limits<_Tp>::infinity();
+ __Kpnu = -std::numeric_limits<_Tp>::infinity();
+ return;
+ }
+
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ const _Tp __fp_min = _Tp(10) * std::numeric_limits<_Tp>::epsilon();
+ const int __max_iter = 15000;
+ const _Tp __x_min = _Tp(2);
+
+ const int __nl = static_cast<int>(__nu + _Tp(0.5L));
+
+ const _Tp __mu = __nu - __nl;
+ const _Tp __mu2 = __mu * __mu;
+ const _Tp __xi = _Tp(1) / __x;
+ const _Tp __xi2 = _Tp(2) * __xi;
+ _Tp __h = __nu * __xi;
+ if ( __h < __fp_min )
+ __h = __fp_min;
+ _Tp __b = __xi2 * __nu;
+ _Tp __d = _Tp(0);
+ _Tp __c = __h;
+ int __i;
+ for ( __i = 1; __i <= __max_iter; ++__i )
+ {
+ __b += __xi2;
+ __d = _Tp(1) / (__b + __d);
+ __c = __b + _Tp(1) / __c;
+ const _Tp __del = __c * __d;
+ __h *= __del;
+ if (std::abs(__del - _Tp(1)) < __eps)
+ break;
+ }
+ if (__i > __max_iter)
+ std::__throw_runtime_error(__N("Argument x too large "
+ "in __bessel_jn; "
+ "try asymptotic expansion."));
+ _Tp __Inul = __fp_min;
+ _Tp __Ipnul = __h * __Inul;
+ _Tp __Inul1 = __Inul;
+ _Tp __Ipnu1 = __Ipnul;
+ _Tp __fact = __nu * __xi;
+ for (int __l = __nl; __l >= 1; --__l)
+ {
+ const _Tp __Inutemp = __fact * __Inul + __Ipnul;
+ __fact -= __xi;
+ __Ipnul = __fact * __Inutemp + __Inul;
+ __Inul = __Inutemp;
+ }
+ _Tp __f = __Ipnul / __Inul;
+ _Tp __Kmu, __Knu1;
+ if (__x < __x_min)
+ {
+ const _Tp __x2 = __x / _Tp(2);
+ const _Tp __pimu = __numeric_constants<_Tp>::__pi() * __mu;
+ const _Tp __fact = (std::abs(__pimu) < __eps
+ ? _Tp(1) : __pimu / std::sin(__pimu));
+ _Tp __d = -std::log(__x2);
+ _Tp __e = __mu * __d;
+ const _Tp __fact2 = (std::abs(__e) < __eps
+ ? _Tp(1) : std::sinh(__e) / __e);
+ _Tp __gam1, __gam2, __gampl, __gammi;
+ __gamma_temme(__mu, __gam1, __gam2, __gampl, __gammi);
+ _Tp __ff = __fact
+ * (__gam1 * std::cosh(__e) + __gam2 * __fact2 * __d);
+ _Tp __sum = __ff;
+ __e = std::exp(__e);
+ _Tp __p = __e / (_Tp(2) * __gampl);
+ _Tp __q = _Tp(1) / (_Tp(2) * __e * __gammi);
+ _Tp __c = _Tp(1);
+ __d = __x2 * __x2;
+ _Tp __sum1 = __p;
+ int __i;
+ for (__i = 1; __i <= __max_iter; ++__i)
+ {
+ __ff = (__i * __ff + __p + __q) / (__i * __i - __mu2);
+ __c *= __d / __i;
+ __p /= __i - __mu;
+ __q /= __i + __mu;
+ const _Tp __del = __c * __ff;
+ __sum += __del;
+ const _Tp __del1 = __c * (__p - __i * __ff);
+ __sum1 += __del1;
+ if (std::abs(__del) < __eps * std::abs(__sum))
+ break;
+ }
+ if (__i > __max_iter)
+ std::__throw_runtime_error(__N("Bessel k series failed to converge "
+ "in __bessel_jn."));
+ __Kmu = __sum;
+ __Knu1 = __sum1 * __xi2;
+ }
+ else
+ {
+ _Tp __b = _Tp(2) * (_Tp(1) + __x);
+ _Tp __d = _Tp(1) / __b;
+ _Tp __delh = __d;
+ _Tp __h = __delh;
+ _Tp __q1 = _Tp(0);
+ _Tp __q2 = _Tp(1);
+ _Tp __a1 = _Tp(0.25L) - __mu2;
+ _Tp __q = __c = __a1;
+ _Tp __a = -__a1;
+ _Tp __s = _Tp(1) + __q * __delh;
+ int __i;
+ for (__i = 2; __i <= __max_iter; ++__i)
+ {
+ __a -= 2 * (__i - 1);
+ __c = -__a * __c / __i;
+ const _Tp __qnew = (__q1 - __b * __q2) / __a;
+ __q1 = __q2;
+ __q2 = __qnew;
+ __q += __c * __qnew;
+ __b += _Tp(2);
+ __d = _Tp(1) / (__b + __a * __d);
+ __delh = (__b * __d - _Tp(1)) * __delh;
+ __h += __delh;
+ const _Tp __dels = __q * __delh;
+ __s += __dels;
+ if ( std::abs(__dels / __s) < __eps )
+ break;
+ }
+ if (__i > __max_iter)
+ std::__throw_runtime_error(__N("Steed's method failed "
+ "in __bessel_jn."));
+ __h = __a1 * __h;
+ __Kmu = std::sqrt(__numeric_constants<_Tp>::__pi() / (_Tp(2) * __x))
+ * std::exp(-__x) / __s;
+ __Knu1 = __Kmu * (__mu + __x + _Tp(0.5L) - __h) * __xi;
+ }
+
+ _Tp __Kpmu = __mu * __xi * __Kmu - __Knu1;
+ _Tp __Inumu = __xi / (__f * __Kmu - __Kpmu);
+ __Inu = __Inumu * __Inul1 / __Inul;
+ __Ipnu = __Inumu * __Ipnu1 / __Inul;
+ for ( __i = 1; __i <= __nl; ++__i )
+ {
+ const _Tp __Knutemp = (__mu + __i) * __xi2 * __Knu1 + __Kmu;
+ __Kmu = __Knu1;
+ __Knu1 = __Knutemp;
+ }
+ __Knu = __Kmu;
+ __Kpnu = __nu * __xi * __Kmu - __Knu1;
+
+ return;
+ }
+
+
+ /**
+ * @brief Return the regular modified Bessel function of order
+ * \f$ \nu \f$: \f$ I_{\nu}(x) \f$.
+ *
+ * The regular modified cylindrical Bessel function is:
+ * @f[
+ * I_{\nu}(x) = \sum_{k=0}^{\infty}
+ * \frac{(x/2)^{\nu + 2k}}{k!\Gamma(\nu+k+1)}
+ * @f]
+ *
+ * @param __nu The order of the regular modified Bessel function.
+ * @param __x The argument of the regular modified Bessel function.
+ * @return The output regular modified Bessel function.
+ */
+ template<typename _Tp>
+ _Tp
+ __cyl_bessel_i(const _Tp __nu, const _Tp __x)
+ {
+ if (__nu < _Tp(0) || __x < _Tp(0))
+ std::__throw_domain_error(__N("Bad argument "
+ "in __cyl_bessel_i."));
+ else if (__isnan(__nu) || __isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__x * __x < _Tp(10) * (__nu + _Tp(1)))
+ return __cyl_bessel_ij_series(__nu, __x, +_Tp(1), 200);
+ else
+ {
+ _Tp __I_nu, __K_nu, __Ip_nu, __Kp_nu;
+ __bessel_ik(__nu, __x, __I_nu, __K_nu, __Ip_nu, __Kp_nu);
+ return __I_nu;
+ }
+ }
+
+
+ /**
+ * @brief Return the irregular modified Bessel function
+ * \f$ K_{\nu}(x) \f$ of order \f$ \nu \f$.
+ *
+ * The irregular modified Bessel function is defined by:
+ * @f[
+ * K_{\nu}(x) = \frac{\pi}{2}
+ * \frac{I_{-\nu}(x) - I_{\nu}(x)}{\sin \nu\pi}
+ * @f]
+ * where for integral \f$ \nu = n \f$ a limit is taken:
+ * \f$ lim_{\nu \to n} \f$.
+ *
+ * @param __nu The order of the irregular modified Bessel function.
+ * @param __x The argument of the irregular modified Bessel function.
+ * @return The output irregular modified Bessel function.
+ */
+ template<typename _Tp>
+ _Tp
+ __cyl_bessel_k(const _Tp __nu, const _Tp __x)
+ {
+ if (__nu < _Tp(0) || __x < _Tp(0))
+ std::__throw_domain_error(__N("Bad argument "
+ "in __cyl_bessel_k."));
+ else if (__isnan(__nu) || __isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else
+ {
+ _Tp __I_nu, __K_nu, __Ip_nu, __Kp_nu;
+ __bessel_ik(__nu, __x, __I_nu, __K_nu, __Ip_nu, __Kp_nu);
+ return __K_nu;
+ }
+ }
+
+
+ /**
+ * @brief Compute the spherical modified Bessel functions
+ * @f$ i_n(x) @f$ and @f$ k_n(x) @f$ and their first
+ * derivatives @f$ i'_n(x) @f$ and @f$ k'_n(x) @f$
+ * respectively.
+ *
+ * @param __n The order of the modified spherical Bessel function.
+ * @param __x The argument of the modified spherical Bessel function.
+ * @param __i_n The output regular modified spherical Bessel function.
+ * @param __k_n The output irregular modified spherical
+ * Bessel function.
+ * @param __ip_n The output derivative of the regular modified
+ * spherical Bessel function.
+ * @param __kp_n The output derivative of the irregular modified
+ * spherical Bessel function.
+ */
+ template <typename _Tp>
+ void
+ __sph_bessel_ik(const unsigned int __n, const _Tp __x,
+ _Tp & __i_n, _Tp & __k_n, _Tp & __ip_n, _Tp & __kp_n)
+ {
+ const _Tp __nu = _Tp(__n) + _Tp(0.5L);
+
+ _Tp __I_nu, __Ip_nu, __K_nu, __Kp_nu;
+ __bessel_ik(__nu, __x, __I_nu, __K_nu, __Ip_nu, __Kp_nu);
+
+ const _Tp __factor = __numeric_constants<_Tp>::__sqrtpio2()
+ / std::sqrt(__x);
+
+ __i_n = __factor * __I_nu;
+ __k_n = __factor * __K_nu;
+ __ip_n = __factor * __Ip_nu - __i_n / (_Tp(2) * __x);
+ __kp_n = __factor * __Kp_nu - __k_n / (_Tp(2) * __x);
+
+ return;
+ }
+
+
+ /**
+ * @brief Compute the Airy functions
+ * @f$ Ai(x) @f$ and @f$ Bi(x) @f$ and their first
+ * derivatives @f$ Ai'(x) @f$ and @f$ Bi(x) @f$
+ * respectively.
+ *
+ * @param __n The order of the Airy functions.
+ * @param __x The argument of the Airy functions.
+ * @param __i_n The output Airy function.
+ * @param __k_n The output Airy function.
+ * @param __ip_n The output derivative of the Airy function.
+ * @param __kp_n The output derivative of the Airy function.
+ */
+ template <typename _Tp>
+ void
+ __airy(const _Tp __x,
+ _Tp & __Ai, _Tp & __Bi, _Tp & __Aip, _Tp & __Bip)
+ {
+ const _Tp __absx = std::abs(__x);
+ const _Tp __rootx = std::sqrt(__absx);
+ const _Tp __z = _Tp(2) * __absx * __rootx / _Tp(3);
+
+ if (__isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__x > _Tp(0))
+ {
+ _Tp __I_nu, __Ip_nu, __K_nu, __Kp_nu;
+
+ __bessel_ik(_Tp(1) / _Tp(3), __z, __I_nu, __K_nu, __Ip_nu, __Kp_nu);
+ __Ai = __rootx * __K_nu
+ / (__numeric_constants<_Tp>::__sqrt3()
+ * __numeric_constants<_Tp>::__pi());
+ __Bi = __rootx * (__K_nu / __numeric_constants<_Tp>::__pi()
+ + _Tp(2) * __I_nu / __numeric_constants<_Tp>::__sqrt3());
+
+ __bessel_ik(_Tp(2) / _Tp(3), __z, __I_nu, __K_nu, __Ip_nu, __Kp_nu);
+ __Aip = -__x * __K_nu
+ / (__numeric_constants<_Tp>::__sqrt3()
+ * __numeric_constants<_Tp>::__pi());
+ __Bip = __x * (__K_nu / __numeric_constants<_Tp>::__pi()
+ + _Tp(2) * __I_nu
+ / __numeric_constants<_Tp>::__sqrt3());
+ }
+ else if (__x < _Tp(0))
+ {
+ _Tp __J_nu, __Jp_nu, __N_nu, __Np_nu;
+
+ __bessel_jn(_Tp(1) / _Tp(3), __z, __J_nu, __N_nu, __Jp_nu, __Np_nu);
+ __Ai = __rootx * (__J_nu
+ - __N_nu / __numeric_constants<_Tp>::__sqrt3()) / _Tp(2);
+ __Bi = -__rootx * (__N_nu
+ + __J_nu / __numeric_constants<_Tp>::__sqrt3()) / _Tp(2);
+
+ __bessel_jn(_Tp(2) / _Tp(3), __z, __J_nu, __N_nu, __Jp_nu, __Np_nu);
+ __Aip = __absx * (__N_nu / __numeric_constants<_Tp>::__sqrt3()
+ + __J_nu) / _Tp(2);
+ __Bip = __absx * (__J_nu / __numeric_constants<_Tp>::__sqrt3()
+ - __N_nu) / _Tp(2);
+ }
+ else
+ {
+ // Reference:
+ // Abramowitz & Stegun, page 446 section 10.4.4 on Airy functions.
+ // The number is Ai(0) = 3^{-2/3}/\Gamma(2/3).
+ __Ai = _Tp(0.35502805388781723926L);
+ __Bi = __Ai * __numeric_constants<_Tp>::__sqrt3();
+
+ // Reference:
+ // Abramowitz & Stegun, page 446 section 10.4.5 on Airy functions.
+ // The number is Ai'(0) = -3^{-1/3}/\Gamma(1/3).
+ __Aip = -_Tp(0.25881940379280679840L);
+ __Bip = -__Aip * __numeric_constants<_Tp>::__sqrt3();
+ }
+
+ return;
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // _GLIBCXX_TR1_MODIFIED_BESSEL_FUNC_TCC
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/poly_hermite.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/poly_hermite.tcc
new file mode 100644
index 0000000..d4825a3
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/poly_hermite.tcc
@@ -0,0 +1,124 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/poly_hermite.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland based on:
+// (1) Handbook of Mathematical Functions,
+// Ed. Milton Abramowitz and Irene A. Stegun,
+// Dover Publications, Section 22 pp. 773-802
+
+#ifndef _GLIBCXX_TR1_POLY_HERMITE_TCC
+#define _GLIBCXX_TR1_POLY_HERMITE_TCC 1
+
+namespace std
+{
+namespace tr1
+{
+
+ // [5.2] Special functions
+
+ // Implementation-space details.
+ namespace __detail
+ {
+
+ /**
+ * @brief This routine returns the Hermite polynomial
+ * of order n: \f$ H_n(x) \f$ by recursion on n.
+ *
+ * The Hermite polynomial is defined by:
+ * @f[
+ * H_n(x) = (-1)^n e^{x^2} \frac{d^n}{dx^n} e^{-x^2}
+ * @f]
+ *
+ * @param __n The order of the Hermite polynomial.
+ * @param __x The argument of the Hermite polynomial.
+ * @return The value of the Hermite polynomial of order n
+ * and argument x.
+ */
+ template<typename _Tp>
+ _Tp
+ __poly_hermite_recursion(const unsigned int __n, const _Tp __x)
+ {
+ // Compute H_0.
+ _Tp __H_0 = 1;
+ if (__n == 0)
+ return __H_0;
+
+ // Compute H_1.
+ _Tp __H_1 = 2 * __x;
+ if (__n == 1)
+ return __H_1;
+
+ // Compute H_n.
+ _Tp __H_n, __H_nm1, __H_nm2;
+ unsigned int __i;
+ for (__H_nm2 = __H_0, __H_nm1 = __H_1, __i = 2; __i <= __n; ++__i)
+ {
+ __H_n = 2 * (__x * __H_nm1 + (__i - 1) * __H_nm2);
+ __H_nm2 = __H_nm1;
+ __H_nm1 = __H_n;
+ }
+
+ return __H_n;
+ }
+
+
+ /**
+ * @brief This routine returns the Hermite polynomial
+ * of order n: \f$ H_n(x) \f$.
+ *
+ * The Hermite polynomial is defined by:
+ * @f[
+ * H_n(x) = (-1)^n e^{x^2} \frac{d^n}{dx^n} e^{-x^2}
+ * @f]
+ *
+ * @param __n The order of the Hermite polynomial.
+ * @param __x The argument of the Hermite polynomial.
+ * @return The value of the Hermite polynomial of order n
+ * and argument x.
+ */
+ template<typename _Tp>
+ inline _Tp
+ __poly_hermite(const unsigned int __n, const _Tp __x)
+ {
+ if (__isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else
+ return __poly_hermite_recursion(__n, __x);
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // _GLIBCXX_TR1_POLY_HERMITE_TCC
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/poly_laguerre.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/poly_laguerre.tcc
new file mode 100644
index 0000000..9c999db
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/poly_laguerre.tcc
@@ -0,0 +1,329 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/poly_laguerre.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland based on:
+// (1) Handbook of Mathematical Functions,
+// Ed. Milton Abramowitz and Irene A. Stegun,
+// Dover Publications,
+// Section 13, pp. 509-510, Section 22 pp. 773-802
+// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
+
+#ifndef _GLIBCXX_TR1_POLY_LAGUERRE_TCC
+#define _GLIBCXX_TR1_POLY_LAGUERRE_TCC 1
+
+namespace std
+{
+namespace tr1
+{
+
+ // [5.2] Special functions
+
+ // Implementation-space details.
+ namespace __detail
+ {
+
+
+ /**
+ * @brief This routine returns the associated Laguerre polynomial
+ * of order @f$ n @f$, degree @f$ \alpha @f$ for large n.
+ * Abramowitz & Stegun, 13.5.21
+ *
+ * @param __n The order of the Laguerre function.
+ * @param __alpha The degree of the Laguerre function.
+ * @param __x The argument of the Laguerre function.
+ * @return The value of the Laguerre function of order n,
+ * degree @f$ \alpha @f$, and argument x.
+ *
+ * This is from the GNU Scientific Library.
+ */
+ template<typename _Tpa, typename _Tp>
+ _Tp
+ __poly_laguerre_large_n(const unsigned __n, const _Tpa __alpha1,
+ const _Tp __x)
+ {
+ const _Tp __a = -_Tp(__n);
+ const _Tp __b = _Tp(__alpha1) + _Tp(1);
+ const _Tp __eta = _Tp(2) * __b - _Tp(4) * __a;
+ const _Tp __cos2th = __x / __eta;
+ const _Tp __sin2th = _Tp(1) - __cos2th;
+ const _Tp __th = std::acos(std::sqrt(__cos2th));
+ const _Tp __pre_h = __numeric_constants<_Tp>::__pi_2()
+ * __numeric_constants<_Tp>::__pi_2()
+ * __eta * __eta * __cos2th * __sin2th;
+
+#if _GLIBCXX_USE_C99_MATH_TR1
+ const _Tp __lg_b = std::tr1::lgamma(_Tp(__n) + __b);
+ const _Tp __lnfact = std::tr1::lgamma(_Tp(__n + 1));
+#else
+ const _Tp __lg_b = __log_gamma(_Tp(__n) + __b);
+ const _Tp __lnfact = __log_gamma(_Tp(__n + 1));
+#endif
+
+ _Tp __pre_term1 = _Tp(0.5L) * (_Tp(1) - __b)
+ * std::log(_Tp(0.25L) * __x * __eta);
+ _Tp __pre_term2 = _Tp(0.25L) * std::log(__pre_h);
+ _Tp __lnpre = __lg_b - __lnfact + _Tp(0.5L) * __x
+ + __pre_term1 - __pre_term2;
+ _Tp __ser_term1 = std::sin(__a * __numeric_constants<_Tp>::__pi());
+ _Tp __ser_term2 = std::sin(_Tp(0.25L) * __eta
+ * (_Tp(2) * __th
+ - std::sin(_Tp(2) * __th))
+ + __numeric_constants<_Tp>::__pi_4());
+ _Tp __ser = __ser_term1 + __ser_term2;
+
+ return std::exp(__lnpre) * __ser;
+ }
+
+
+ /**
+ * @brief Evaluate the polynomial based on the confluent hypergeometric
+ * function in a safe way, with no restriction on the arguments.
+ *
+ * The associated Laguerre function is defined by
+ * @f[
+ * L_n^\alpha(x) = \frac{(\alpha + 1)_n}{n!}
+ * _1F_1(-n; \alpha + 1; x)
+ * @f]
+ * where @f$ (\alpha)_n @f$ is the Pochhammer symbol and
+ * @f$ _1F_1(a; c; x) @f$ is the confluent hypergeometric function.
+ *
+ * This function assumes x != 0.
+ *
+ * This is from the GNU Scientific Library.
+ */
+ template<typename _Tpa, typename _Tp>
+ _Tp
+ __poly_laguerre_hyperg(const unsigned int __n, const _Tpa __alpha1,
+ const _Tp __x)
+ {
+ const _Tp __b = _Tp(__alpha1) + _Tp(1);
+ const _Tp __mx = -__x;
+ const _Tp __tc_sgn = (__x < _Tp(0) ? _Tp(1)
+ : ((__n % 2 == 1) ? -_Tp(1) : _Tp(1)));
+ // Get |x|^n/n!
+ _Tp __tc = _Tp(1);
+ const _Tp __ax = std::abs(__x);
+ for (unsigned int __k = 1; __k <= __n; ++__k)
+ __tc *= (__ax / __k);
+
+ _Tp __term = __tc * __tc_sgn;
+ _Tp __sum = __term;
+ for (int __k = int(__n) - 1; __k >= 0; --__k)
+ {
+ __term *= ((__b + _Tp(__k)) / _Tp(int(__n) - __k))
+ * _Tp(__k + 1) / __mx;
+ __sum += __term;
+ }
+
+ return __sum;
+ }
+
+
+ /**
+ * @brief This routine returns the associated Laguerre polynomial
+ * of order @f$ n @f$, degree @f$ \alpha @f$: @f$ L_n^\alpha(x) @f$
+ * by recursion.
+ *
+ * The associated Laguerre function is defined by
+ * @f[
+ * L_n^\alpha(x) = \frac{(\alpha + 1)_n}{n!}
+ * _1F_1(-n; \alpha + 1; x)
+ * @f]
+ * where @f$ (\alpha)_n @f$ is the Pochhammer symbol and
+ * @f$ _1F_1(a; c; x) @f$ is the confluent hypergeometric function.
+ *
+ * The associated Laguerre polynomial is defined for integral
+ * @f$ \alpha = m @f$ by:
+ * @f[
+ * L_n^m(x) = (-1)^m \frac{d^m}{dx^m} L_{n + m}(x)
+ * @f]
+ * where the Laguerre polynomial is defined by:
+ * @f[
+ * L_n(x) = \frac{e^x}{n!} \frac{d^n}{dx^n} (x^ne^{-x})
+ * @f]
+ *
+ * @param __n The order of the Laguerre function.
+ * @param __alpha The degree of the Laguerre function.
+ * @param __x The argument of the Laguerre function.
+ * @return The value of the Laguerre function of order n,
+ * degree @f$ \alpha @f$, and argument x.
+ */
+ template<typename _Tpa, typename _Tp>
+ _Tp
+ __poly_laguerre_recursion(const unsigned int __n,
+ const _Tpa __alpha1, const _Tp __x)
+ {
+ // Compute l_0.
+ _Tp __l_0 = _Tp(1);
+ if (__n == 0)
+ return __l_0;
+
+ // Compute l_1^alpha.
+ _Tp __l_1 = -__x + _Tp(1) + _Tp(__alpha1);
+ if (__n == 1)
+ return __l_1;
+
+ // Compute l_n^alpha by recursion on n.
+ _Tp __l_n2 = __l_0;
+ _Tp __l_n1 = __l_1;
+ _Tp __l_n = _Tp(0);
+ for (unsigned int __nn = 2; __nn <= __n; ++__nn)
+ {
+ __l_n = (_Tp(2 * __nn - 1) + _Tp(__alpha1) - __x)
+ * __l_n1 / _Tp(__nn)
+ - (_Tp(__nn - 1) + _Tp(__alpha1)) * __l_n2 / _Tp(__nn);
+ __l_n2 = __l_n1;
+ __l_n1 = __l_n;
+ }
+
+ return __l_n;
+ }
+
+
+ /**
+ * @brief This routine returns the associated Laguerre polynomial
+ * of order n, degree @f$ \alpha @f$: @f$ L_n^alpha(x) @f$.
+ *
+ * The associated Laguerre function is defined by
+ * @f[
+ * L_n^\alpha(x) = \frac{(\alpha + 1)_n}{n!}
+ * _1F_1(-n; \alpha + 1; x)
+ * @f]
+ * where @f$ (\alpha)_n @f$ is the Pochhammer symbol and
+ * @f$ _1F_1(a; c; x) @f$ is the confluent hypergeometric function.
+ *
+ * The associated Laguerre polynomial is defined for integral
+ * @f$ \alpha = m @f$ by:
+ * @f[
+ * L_n^m(x) = (-1)^m \frac{d^m}{dx^m} L_{n + m}(x)
+ * @f]
+ * where the Laguerre polynomial is defined by:
+ * @f[
+ * L_n(x) = \frac{e^x}{n!} \frac{d^n}{dx^n} (x^ne^{-x})
+ * @f]
+ *
+ * @param __n The order of the Laguerre function.
+ * @param __alpha The degree of the Laguerre function.
+ * @param __x The argument of the Laguerre function.
+ * @return The value of the Laguerre function of order n,
+ * degree @f$ \alpha @f$, and argument x.
+ */
+ template<typename _Tpa, typename _Tp>
+ inline _Tp
+ __poly_laguerre(const unsigned int __n, const _Tpa __alpha1,
+ const _Tp __x)
+ {
+ if (__x < _Tp(0))
+ std::__throw_domain_error(__N("Negative argument "
+ "in __poly_laguerre."));
+ // Return NaN on NaN input.
+ else if (__isnan(__x))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__n == 0)
+ return _Tp(1);
+ else if (__n == 1)
+ return _Tp(1) + _Tp(__alpha1) - __x;
+ else if (__x == _Tp(0))
+ {
+ _Tp __prod = _Tp(__alpha1) + _Tp(1);
+ for (unsigned int __k = 2; __k <= __n; ++__k)
+ __prod *= (_Tp(__alpha1) + _Tp(__k)) / _Tp(__k);
+ return __prod;
+ }
+ else if (__n > 10000000 && _Tp(__alpha1) > -_Tp(1)
+ && __x < _Tp(2) * (_Tp(__alpha1) + _Tp(1)) + _Tp(4 * __n))
+ return __poly_laguerre_large_n(__n, __alpha1, __x);
+ else if (_Tp(__alpha1) >= _Tp(0)
+ || (__x > _Tp(0) && _Tp(__alpha1) < -_Tp(__n + 1)))
+ return __poly_laguerre_recursion(__n, __alpha1, __x);
+ else
+ return __poly_laguerre_hyperg(__n, __alpha1, __x);
+ }
+
+
+ /**
+ * @brief This routine returns the associated Laguerre polynomial
+ * of order n, degree m: @f$ L_n^m(x) @f$.
+ *
+ * The associated Laguerre polynomial is defined for integral
+ * @f$ \alpha = m @f$ by:
+ * @f[
+ * L_n^m(x) = (-1)^m \frac{d^m}{dx^m} L_{n + m}(x)
+ * @f]
+ * where the Laguerre polynomial is defined by:
+ * @f[
+ * L_n(x) = \frac{e^x}{n!} \frac{d^n}{dx^n} (x^ne^{-x})
+ * @f]
+ *
+ * @param __n The order of the Laguerre polynomial.
+ * @param __m The degree of the Laguerre polynomial.
+ * @param __x The argument of the Laguerre polynomial.
+ * @return The value of the associated Laguerre polynomial of order n,
+ * degree m, and argument x.
+ */
+ template<typename _Tp>
+ inline _Tp
+ __assoc_laguerre(const unsigned int __n, const unsigned int __m,
+ const _Tp __x)
+ {
+ return __poly_laguerre<unsigned int, _Tp>(__n, __m, __x);
+ }
+
+
+ /**
+ * @brief This routine returns the Laguerre polynomial
+ * of order n: @f$ L_n(x) @f$.
+ *
+ * The Laguerre polynomial is defined by:
+ * @f[
+ * L_n(x) = \frac{e^x}{n!} \frac{d^n}{dx^n} (x^ne^{-x})
+ * @f]
+ *
+ * @param __n The order of the Laguerre polynomial.
+ * @param __x The argument of the Laguerre polynomial.
+ * @return The value of the Laguerre polynomial of order n
+ * and argument x.
+ */
+ template<typename _Tp>
+ inline _Tp
+ __laguerre(const unsigned int __n, const _Tp __x)
+ {
+ return __poly_laguerre<unsigned int, _Tp>(__n, 0, __x);
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // _GLIBCXX_TR1_POLY_LAGUERRE_TCC
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/random b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/random
new file mode 100644
index 0000000..a23519c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/random
@@ -0,0 +1,66 @@
+// random number generation -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/**
+ * @file tr1/random
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_RANDOM
+#define _GLIBCXX_TR1_RANDOM 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <cmath>
+#include <cstdio>
+#include <cstdlib>
+#include <string>
+#include <iosfwd>
+#include <limits>
+#include <ext/type_traits.h>
+#include <ext/numeric_traits.h>
+#include <bits/concept_check.h>
+#include <debug/debug.h>
+#include <tr1/type_traits>
+#include <tr1/cmath>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/random>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/random>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_RANDOM
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/regex b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/regex
new file mode 100644
index 0000000..b7e2cdf
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/regex
@@ -0,0 +1,64 @@
+// class template regex -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/**
+ * @file tr1/regex
+ * @author Stephen M. Webb <stephen.webb@bregmasoft.ca>
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_REGEX
+#define _GLIBCXX_TR1_REGEX 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <algorithm>
+#include <bitset>
+#include <iterator>
+#include <locale>
+#include <stdexcept>
+#include <string>
+#include <vector>
+#include <utility>
+#include <sstream>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/regex>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/regex>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_REGEX
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/riemann_zeta.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/riemann_zeta.tcc
new file mode 100644
index 0000000..c646c2e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/riemann_zeta.tcc
@@ -0,0 +1,435 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/riemann_zeta.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland based on:
+// (1) Handbook of Mathematical Functions,
+// Ed. by Milton Abramowitz and Irene A. Stegun,
+// Dover Publications, New-York, Section 5, pp. 807-808.
+// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
+// (3) Gamma, Exploring Euler's Constant, Julian Havil,
+// Princeton, 2003.
+
+#ifndef _GLIBCXX_TR1_RIEMANN_ZETA_TCC
+#define _GLIBCXX_TR1_RIEMANN_ZETA_TCC 1
+
+#include "special_function_util.h"
+
+namespace std
+{
+namespace tr1
+{
+
+ // [5.2] Special functions
+
+ // Implementation-space details.
+ namespace __detail
+ {
+
+ /**
+ * @brief Compute the Riemann zeta function @f$ \zeta(s) @f$
+ * by summation for s > 1.
+ *
+ * The Riemann zeta function is defined by:
+ * \f[
+ * \zeta(s) = \sum_{k=1}^{\infty} \frac{1}{k^{s}} for s > 1
+ * \f]
+ * For s < 1 use the reflection formula:
+ * \f[
+ * \zeta(s) = 2^s \pi^{s-1} \Gamma(1-s) \zeta(1-s)
+ * \f]
+ */
+ template<typename _Tp>
+ _Tp
+ __riemann_zeta_sum(const _Tp __s)
+ {
+ // A user shouldn't get to this.
+ if (__s < _Tp(1))
+ std::__throw_domain_error(__N("Bad argument in zeta sum."));
+
+ const unsigned int max_iter = 10000;
+ _Tp __zeta = _Tp(0);
+ for (unsigned int __k = 1; __k < max_iter; ++__k)
+ {
+ _Tp __term = std::pow(static_cast<_Tp>(__k), -__s);
+ if (__term < std::numeric_limits<_Tp>::epsilon())
+ {
+ break;
+ }
+ __zeta += __term;
+ }
+
+ return __zeta;
+ }
+
+
+ /**
+ * @brief Evaluate the Riemann zeta function @f$ \zeta(s) @f$
+ * by an alternate series for s > 0.
+ *
+ * The Riemann zeta function is defined by:
+ * \f[
+ * \zeta(s) = \sum_{k=1}^{\infty} \frac{1}{k^{s}} for s > 1
+ * \f]
+ * For s < 1 use the reflection formula:
+ * \f[
+ * \zeta(s) = 2^s \pi^{s-1} \Gamma(1-s) \zeta(1-s)
+ * \f]
+ */
+ template<typename _Tp>
+ _Tp
+ __riemann_zeta_alt(const _Tp __s)
+ {
+ _Tp __sgn = _Tp(1);
+ _Tp __zeta = _Tp(0);
+ for (unsigned int __i = 1; __i < 10000000; ++__i)
+ {
+ _Tp __term = __sgn / std::pow(__i, __s);
+ if (std::abs(__term) < std::numeric_limits<_Tp>::epsilon())
+ break;
+ __zeta += __term;
+ __sgn *= _Tp(-1);
+ }
+ __zeta /= _Tp(1) - std::pow(_Tp(2), _Tp(1) - __s);
+
+ return __zeta;
+ }
+
+
+ /**
+ * @brief Evaluate the Riemann zeta function by series for all s != 1.
+ * Convergence is great until largish negative numbers.
+ * Then the convergence of the > 0 sum gets better.
+ *
+ * The series is:
+ * \f[
+ * \zeta(s) = \frac{1}{1-2^{1-s}}
+ * \sum_{n=0}^{\infty} \frac{1}{2^{n+1}}
+ * \sum_{k=0}^{n} (-1)^k \frac{n!}{(n-k)!k!} (k+1)^{-s}
+ * \f]
+ * Havil 2003, p. 206.
+ *
+ * The Riemann zeta function is defined by:
+ * \f[
+ * \zeta(s) = \sum_{k=1}^{\infty} \frac{1}{k^{s}} for s > 1
+ * \f]
+ * For s < 1 use the reflection formula:
+ * \f[
+ * \zeta(s) = 2^s \pi^{s-1} \Gamma(1-s) \zeta(1-s)
+ * \f]
+ */
+ template<typename _Tp>
+ _Tp
+ __riemann_zeta_glob(const _Tp __s)
+ {
+ _Tp __zeta = _Tp(0);
+
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ // Max e exponent before overflow.
+ const _Tp __max_bincoeff = std::numeric_limits<_Tp>::max_exponent10
+ * std::log(_Tp(10)) - _Tp(1);
+
+ // This series works until the binomial coefficient blows up
+ // so use reflection.
+ if (__s < _Tp(0))
+ {
+#if _GLIBCXX_USE_C99_MATH_TR1
+ if (std::tr1::fmod(__s,_Tp(2)) == _Tp(0))
+ return _Tp(0);
+ else
+#endif
+ {
+ _Tp __zeta = __riemann_zeta_glob(_Tp(1) - __s);
+ __zeta *= std::pow(_Tp(2)
+ * __numeric_constants<_Tp>::__pi(), __s)
+ * std::sin(__numeric_constants<_Tp>::__pi_2() * __s)
+#if _GLIBCXX_USE_C99_MATH_TR1
+ * std::exp(std::tr1::lgamma(_Tp(1) - __s))
+#else
+ * std::exp(__log_gamma(_Tp(1) - __s))
+#endif
+ / __numeric_constants<_Tp>::__pi();
+ return __zeta;
+ }
+ }
+
+ _Tp __num = _Tp(0.5L);
+ const unsigned int __maxit = 10000;
+ for (unsigned int __i = 0; __i < __maxit; ++__i)
+ {
+ bool __punt = false;
+ _Tp __sgn = _Tp(1);
+ _Tp __term = _Tp(0);
+ for (unsigned int __j = 0; __j <= __i; ++__j)
+ {
+#if _GLIBCXX_USE_C99_MATH_TR1
+ _Tp __bincoeff = std::tr1::lgamma(_Tp(1 + __i))
+ - std::tr1::lgamma(_Tp(1 + __j))
+ - std::tr1::lgamma(_Tp(1 + __i - __j));
+#else
+ _Tp __bincoeff = __log_gamma(_Tp(1 + __i))
+ - __log_gamma(_Tp(1 + __j))
+ - __log_gamma(_Tp(1 + __i - __j));
+#endif
+ if (__bincoeff > __max_bincoeff)
+ {
+ // This only gets hit for x << 0.
+ __punt = true;
+ break;
+ }
+ __bincoeff = std::exp(__bincoeff);
+ __term += __sgn * __bincoeff * std::pow(_Tp(1 + __j), -__s);
+ __sgn *= _Tp(-1);
+ }
+ if (__punt)
+ break;
+ __term *= __num;
+ __zeta += __term;
+ if (std::abs(__term/__zeta) < __eps)
+ break;
+ __num *= _Tp(0.5L);
+ }
+
+ __zeta /= _Tp(1) - std::pow(_Tp(2), _Tp(1) - __s);
+
+ return __zeta;
+ }
+
+
+ /**
+ * @brief Compute the Riemann zeta function @f$ \zeta(s) @f$
+ * using the product over prime factors.
+ * \f[
+ * \zeta(s) = \Pi_{i=1}^\infty \frac{1}{1 - p_i^{-s}}
+ * \f]
+ * where @f$ {p_i} @f$ are the prime numbers.
+ *
+ * The Riemann zeta function is defined by:
+ * \f[
+ * \zeta(s) = \sum_{k=1}^{\infty} \frac{1}{k^{s}} for s > 1
+ * \f]
+ * For s < 1 use the reflection formula:
+ * \f[
+ * \zeta(s) = 2^s \pi^{s-1} \Gamma(1-s) \zeta(1-s)
+ * \f]
+ */
+ template<typename _Tp>
+ _Tp
+ __riemann_zeta_product(const _Tp __s)
+ {
+ static const _Tp __prime[] = {
+ _Tp(2), _Tp(3), _Tp(5), _Tp(7), _Tp(11), _Tp(13), _Tp(17), _Tp(19),
+ _Tp(23), _Tp(29), _Tp(31), _Tp(37), _Tp(41), _Tp(43), _Tp(47),
+ _Tp(53), _Tp(59), _Tp(61), _Tp(67), _Tp(71), _Tp(73), _Tp(79),
+ _Tp(83), _Tp(89), _Tp(97), _Tp(101), _Tp(103), _Tp(107), _Tp(109)
+ };
+ static const unsigned int __num_primes = sizeof(__prime) / sizeof(_Tp);
+
+ _Tp __zeta = _Tp(1);
+ for (unsigned int __i = 0; __i < __num_primes; ++__i)
+ {
+ const _Tp __fact = _Tp(1) - std::pow(__prime[__i], -__s);
+ __zeta *= __fact;
+ if (_Tp(1) - __fact < std::numeric_limits<_Tp>::epsilon())
+ break;
+ }
+
+ __zeta = _Tp(1) / __zeta;
+
+ return __zeta;
+ }
+
+
+ /**
+ * @brief Return the Riemann zeta function @f$ \zeta(s) @f$.
+ *
+ * The Riemann zeta function is defined by:
+ * \f[
+ * \zeta(s) = \sum_{k=1}^{\infty} k^{-s} for s > 1
+ * \frac{(2\pi)^s}{pi} sin(\frac{\pi s}{2})
+ * \Gamma (1 - s) \zeta (1 - s) for s < 1
+ * \f]
+ * For s < 1 use the reflection formula:
+ * \f[
+ * \zeta(s) = 2^s \pi^{s-1} \Gamma(1-s) \zeta(1-s)
+ * \f]
+ */
+ template<typename _Tp>
+ _Tp
+ __riemann_zeta(const _Tp __s)
+ {
+ if (__isnan(__s))
+ return std::numeric_limits<_Tp>::quiet_NaN();
+ else if (__s == _Tp(1))
+ return std::numeric_limits<_Tp>::infinity();
+ else if (__s < -_Tp(19))
+ {
+ _Tp __zeta = __riemann_zeta_product(_Tp(1) - __s);
+ __zeta *= std::pow(_Tp(2) * __numeric_constants<_Tp>::__pi(), __s)
+ * std::sin(__numeric_constants<_Tp>::__pi_2() * __s)
+#if _GLIBCXX_USE_C99_MATH_TR1
+ * std::exp(std::tr1::lgamma(_Tp(1) - __s))
+#else
+ * std::exp(__log_gamma(_Tp(1) - __s))
+#endif
+ / __numeric_constants<_Tp>::__pi();
+ return __zeta;
+ }
+ else if (__s < _Tp(20))
+ {
+ // Global double sum or McLaurin?
+ bool __glob = true;
+ if (__glob)
+ return __riemann_zeta_glob(__s);
+ else
+ {
+ if (__s > _Tp(1))
+ return __riemann_zeta_sum(__s);
+ else
+ {
+ _Tp __zeta = std::pow(_Tp(2)
+ * __numeric_constants<_Tp>::__pi(), __s)
+ * std::sin(__numeric_constants<_Tp>::__pi_2() * __s)
+#if _GLIBCXX_USE_C99_MATH_TR1
+ * std::tr1::tgamma(_Tp(1) - __s)
+#else
+ * std::exp(__log_gamma(_Tp(1) - __s))
+#endif
+ * __riemann_zeta_sum(_Tp(1) - __s);
+ return __zeta;
+ }
+ }
+ }
+ else
+ return __riemann_zeta_product(__s);
+ }
+
+
+ /**
+ * @brief Return the Hurwitz zeta function @f$ \zeta(x,s) @f$
+ * for all s != 1 and x > -1.
+ *
+ * The Hurwitz zeta function is defined by:
+ * @f[
+ * \zeta(x,s) = \sum_{n=0}^{\infty} \frac{1}{(n + x)^s}
+ * @f]
+ * The Riemann zeta function is a special case:
+ * @f[
+ * \zeta(s) = \zeta(1,s)
+ * @f]
+ *
+ * This functions uses the double sum that converges for s != 1
+ * and x > -1:
+ * @f[
+ * \zeta(x,s) = \frac{1}{s-1}
+ * \sum_{n=0}^{\infty} \frac{1}{n + 1}
+ * \sum_{k=0}^{n} (-1)^k \frac{n!}{(n-k)!k!} (x+k)^{-s}
+ * @f]
+ */
+ template<typename _Tp>
+ _Tp
+ __hurwitz_zeta_glob(const _Tp __a, const _Tp __s)
+ {
+ _Tp __zeta = _Tp(0);
+
+ const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
+ // Max e exponent before overflow.
+ const _Tp __max_bincoeff = std::numeric_limits<_Tp>::max_exponent10
+ * std::log(_Tp(10)) - _Tp(1);
+
+ const unsigned int __maxit = 10000;
+ for (unsigned int __i = 0; __i < __maxit; ++__i)
+ {
+ bool __punt = false;
+ _Tp __sgn = _Tp(1);
+ _Tp __term = _Tp(0);
+ for (unsigned int __j = 0; __j <= __i; ++__j)
+ {
+#if _GLIBCXX_USE_C99_MATH_TR1
+ _Tp __bincoeff = std::tr1::lgamma(_Tp(1 + __i))
+ - std::tr1::lgamma(_Tp(1 + __j))
+ - std::tr1::lgamma(_Tp(1 + __i - __j));
+#else
+ _Tp __bincoeff = __log_gamma(_Tp(1 + __i))
+ - __log_gamma(_Tp(1 + __j))
+ - __log_gamma(_Tp(1 + __i - __j));
+#endif
+ if (__bincoeff > __max_bincoeff)
+ {
+ // This only gets hit for x << 0.
+ __punt = true;
+ break;
+ }
+ __bincoeff = std::exp(__bincoeff);
+ __term += __sgn * __bincoeff * std::pow(_Tp(__a + __j), -__s);
+ __sgn *= _Tp(-1);
+ }
+ if (__punt)
+ break;
+ __term /= _Tp(__i + 1);
+ if (std::abs(__term / __zeta) < __eps)
+ break;
+ __zeta += __term;
+ }
+
+ __zeta /= __s - _Tp(1);
+
+ return __zeta;
+ }
+
+
+ /**
+ * @brief Return the Hurwitz zeta function @f$ \zeta(x,s) @f$
+ * for all s != 1 and x > -1.
+ *
+ * The Hurwitz zeta function is defined by:
+ * @f[
+ * \zeta(x,s) = \sum_{n=0}^{\infty} \frac{1}{(n + x)^s}
+ * @f]
+ * The Riemann zeta function is a special case:
+ * @f[
+ * \zeta(s) = \zeta(1,s)
+ * @f]
+ */
+ template<typename _Tp>
+ inline _Tp
+ __hurwitz_zeta(const _Tp __a, const _Tp __s)
+ {
+ return __hurwitz_zeta_glob(__a, __s);
+ }
+
+ } // namespace std::tr1::__detail
+}
+}
+
+#endif // _GLIBCXX_TR1_RIEMANN_ZETA_TCC
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/shared_ptr.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/shared_ptr.h
new file mode 100644
index 0000000..0afce01
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/shared_ptr.h
@@ -0,0 +1,1020 @@
+// <tr1/shared_ptr.h> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// shared_count.hpp
+// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
+
+// shared_ptr.hpp
+// Copyright (C) 1998, 1999 Greg Colvin and Beman Dawes.
+// Copyright (C) 2001, 2002, 2003 Peter Dimov
+
+// weak_ptr.hpp
+// Copyright (C) 2001, 2002, 2003 Peter Dimov
+
+// enable_shared_from_this.hpp
+// Copyright (C) 2002 Peter Dimov
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// GCC Note: based on version 1.32.0 of the Boost library.
+
+/** @file tr1/shared_ptr.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _TR1_SHARED_PTR_H
+#define _TR1_SHARED_PTR_H 1
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+namespace std
+{
+namespace tr1
+{
+
+ template<typename _Ptr, typename _Deleter, _Lock_policy _Lp>
+ class _Sp_counted_base_impl
+ : public _Sp_counted_base<_Lp>
+ {
+ public:
+ /**
+ * @brief
+ * @pre __d(__p) must not throw.
+ */
+ _Sp_counted_base_impl(_Ptr __p, _Deleter __d)
+ : _M_ptr(__p), _M_del(__d) { }
+
+ virtual void
+ _M_dispose() // nothrow
+ { _M_del(_M_ptr); }
+
+ virtual void*
+ _M_get_deleter(const std::type_info& __ti)
+ { return __ti == typeid(_Deleter) ? &_M_del : 0; }
+
+ private:
+ _Sp_counted_base_impl(const _Sp_counted_base_impl&);
+ _Sp_counted_base_impl& operator=(const _Sp_counted_base_impl&);
+
+ _Ptr _M_ptr; // copy constructor must not throw
+ _Deleter _M_del; // copy constructor must not throw
+ };
+
+ template<_Lock_policy _Lp = __default_lock_policy>
+ class __weak_count;
+
+ template<typename _Tp>
+ struct _Sp_deleter
+ {
+ typedef void result_type;
+ typedef _Tp* argument_type;
+ void operator()(_Tp* __p) const { delete __p; }
+ };
+
+ template<_Lock_policy _Lp = __default_lock_policy>
+ class __shared_count
+ {
+ public:
+ __shared_count()
+ : _M_pi(0) // nothrow
+ { }
+
+ template<typename _Ptr>
+ __shared_count(_Ptr __p) : _M_pi(0)
+ {
+ __try
+ {
+ typedef typename std::tr1::remove_pointer<_Ptr>::type _Tp;
+ _M_pi = new _Sp_counted_base_impl<_Ptr, _Sp_deleter<_Tp>, _Lp>(
+ __p, _Sp_deleter<_Tp>());
+ }
+ __catch(...)
+ {
+ delete __p;
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _Ptr, typename _Deleter>
+ __shared_count(_Ptr __p, _Deleter __d) : _M_pi(0)
+ {
+ __try
+ {
+ _M_pi = new _Sp_counted_base_impl<_Ptr, _Deleter, _Lp>(__p, __d);
+ }
+ __catch(...)
+ {
+ __d(__p); // Call _Deleter on __p.
+ __throw_exception_again;
+ }
+ }
+
+ // Special case for auto_ptr<_Tp> to provide the strong guarantee.
+ template<typename _Tp>
+ explicit
+ __shared_count(std::auto_ptr<_Tp>& __r)
+ : _M_pi(new _Sp_counted_base_impl<_Tp*,
+ _Sp_deleter<_Tp>, _Lp >(__r.get(), _Sp_deleter<_Tp>()))
+ { __r.release(); }
+
+ // Throw bad_weak_ptr when __r._M_get_use_count() == 0.
+ explicit
+ __shared_count(const __weak_count<_Lp>& __r);
+
+ ~__shared_count() // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_release();
+ }
+
+ __shared_count(const __shared_count& __r)
+ : _M_pi(__r._M_pi) // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_add_ref_copy();
+ }
+
+ __shared_count&
+ operator=(const __shared_count& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ if (__tmp != _M_pi)
+ {
+ if (__tmp != 0)
+ __tmp->_M_add_ref_copy();
+ if (_M_pi != 0)
+ _M_pi->_M_release();
+ _M_pi = __tmp;
+ }
+ return *this;
+ }
+
+ void
+ _M_swap(__shared_count& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ __r._M_pi = _M_pi;
+ _M_pi = __tmp;
+ }
+
+ long
+ _M_get_use_count() const // nothrow
+ { return _M_pi != 0 ? _M_pi->_M_get_use_count() : 0; }
+
+ bool
+ _M_unique() const // nothrow
+ { return this->_M_get_use_count() == 1; }
+
+ friend inline bool
+ operator==(const __shared_count& __a, const __shared_count& __b)
+ { return __a._M_pi == __b._M_pi; }
+
+ friend inline bool
+ operator<(const __shared_count& __a, const __shared_count& __b)
+ { return std::less<_Sp_counted_base<_Lp>*>()(__a._M_pi, __b._M_pi); }
+
+ void*
+ _M_get_deleter(const std::type_info& __ti) const
+ { return _M_pi ? _M_pi->_M_get_deleter(__ti) : 0; }
+
+ private:
+ friend class __weak_count<_Lp>;
+
+ _Sp_counted_base<_Lp>* _M_pi;
+ };
+
+
+ template<_Lock_policy _Lp>
+ class __weak_count
+ {
+ public:
+ __weak_count()
+ : _M_pi(0) // nothrow
+ { }
+
+ __weak_count(const __shared_count<_Lp>& __r)
+ : _M_pi(__r._M_pi) // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_weak_add_ref();
+ }
+
+ __weak_count(const __weak_count<_Lp>& __r)
+ : _M_pi(__r._M_pi) // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_weak_add_ref();
+ }
+
+ ~__weak_count() // nothrow
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_weak_release();
+ }
+
+ __weak_count<_Lp>&
+ operator=(const __shared_count<_Lp>& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ if (__tmp != 0)
+ __tmp->_M_weak_add_ref();
+ if (_M_pi != 0)
+ _M_pi->_M_weak_release();
+ _M_pi = __tmp;
+ return *this;
+ }
+
+ __weak_count<_Lp>&
+ operator=(const __weak_count<_Lp>& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ if (__tmp != 0)
+ __tmp->_M_weak_add_ref();
+ if (_M_pi != 0)
+ _M_pi->_M_weak_release();
+ _M_pi = __tmp;
+ return *this;
+ }
+
+ void
+ _M_swap(__weak_count<_Lp>& __r) // nothrow
+ {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ __r._M_pi = _M_pi;
+ _M_pi = __tmp;
+ }
+
+ long
+ _M_get_use_count() const // nothrow
+ { return _M_pi != 0 ? _M_pi->_M_get_use_count() : 0; }
+
+ friend inline bool
+ operator==(const __weak_count<_Lp>& __a, const __weak_count<_Lp>& __b)
+ { return __a._M_pi == __b._M_pi; }
+
+ friend inline bool
+ operator<(const __weak_count<_Lp>& __a, const __weak_count<_Lp>& __b)
+ { return std::less<_Sp_counted_base<_Lp>*>()(__a._M_pi, __b._M_pi); }
+
+ private:
+ friend class __shared_count<_Lp>;
+
+ _Sp_counted_base<_Lp>* _M_pi;
+ };
+
+ // now that __weak_count is defined we can define this constructor:
+ template<_Lock_policy _Lp>
+ inline
+ __shared_count<_Lp>::
+ __shared_count(const __weak_count<_Lp>& __r)
+ : _M_pi(__r._M_pi)
+ {
+ if (_M_pi != 0)
+ _M_pi->_M_add_ref_lock();
+ else
+ __throw_bad_weak_ptr();
+ }
+
+ // Forward declarations.
+ template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
+ class __shared_ptr;
+
+ template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
+ class __weak_ptr;
+
+ template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
+ class __enable_shared_from_this;
+
+ template<typename _Tp>
+ class shared_ptr;
+
+ template<typename _Tp>
+ class weak_ptr;
+
+ template<typename _Tp>
+ class enable_shared_from_this;
+
+ // Support for enable_shared_from_this.
+
+ // Friend of __enable_shared_from_this.
+ template<_Lock_policy _Lp, typename _Tp1, typename _Tp2>
+ void
+ __enable_shared_from_this_helper(const __shared_count<_Lp>&,
+ const __enable_shared_from_this<_Tp1,
+ _Lp>*, const _Tp2*);
+
+ // Friend of enable_shared_from_this.
+ template<typename _Tp1, typename _Tp2>
+ void
+ __enable_shared_from_this_helper(const __shared_count<>&,
+ const enable_shared_from_this<_Tp1>*,
+ const _Tp2*);
+
+ template<_Lock_policy _Lp>
+ inline void
+ __enable_shared_from_this_helper(const __shared_count<_Lp>&, ...)
+ { }
+
+
+ struct __static_cast_tag { };
+ struct __const_cast_tag { };
+ struct __dynamic_cast_tag { };
+
+ /**
+ * @class __shared_ptr
+ *
+ * A smart pointer with reference-counted copy semantics.
+ * The object pointed to is deleted when the last shared_ptr pointing to
+ * it is destroyed or reset.
+ */
+ template<typename _Tp, _Lock_policy _Lp>
+ class __shared_ptr
+ {
+ public:
+ typedef _Tp element_type;
+
+ /** @brief Construct an empty %__shared_ptr.
+ * @post use_count()==0 && get()==0
+ */
+ __shared_ptr()
+ : _M_ptr(0), _M_refcount() // never throws
+ { }
+
+ /** @brief Construct a %__shared_ptr that owns the pointer @a __p.
+ * @param __p A pointer that is convertible to element_type*.
+ * @post use_count() == 1 && get() == __p
+ * @throw std::bad_alloc, in which case @c delete @a __p is called.
+ */
+ template<typename _Tp1>
+ explicit
+ __shared_ptr(_Tp1* __p)
+ : _M_ptr(__p), _M_refcount(__p)
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // __glibcxx_function_requires(_CompleteConcept<_Tp1*>)
+ __enable_shared_from_this_helper(_M_refcount, __p, __p);
+ }
+
+ //
+ // Requirements: _Deleter's copy constructor and destructor must
+ // not throw
+ //
+ // __shared_ptr will release __p by calling __d(__p)
+ //
+ /** @brief Construct a %__shared_ptr that owns the pointer @a __p
+ * and the deleter @a __d.
+ * @param __p A pointer.
+ * @param __d A deleter.
+ * @post use_count() == 1 && get() == __p
+ * @throw std::bad_alloc, in which case @a __d(__p) is called.
+ */
+ template<typename _Tp1, typename _Deleter>
+ __shared_ptr(_Tp1* __p, _Deleter __d)
+ : _M_ptr(__p), _M_refcount(__p, __d)
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // TODO requires _Deleter CopyConstructible and __d(__p) well-formed
+ __enable_shared_from_this_helper(_M_refcount, __p, __p);
+ }
+
+ // generated copy constructor, assignment, destructor are fine.
+
+ /** @brief If @a __r is empty, constructs an empty %__shared_ptr;
+ * otherwise construct a %__shared_ptr that shares ownership
+ * with @a __r.
+ * @param __r A %__shared_ptr.
+ * @post get() == __r.get() && use_count() == __r.use_count()
+ */
+ template<typename _Tp1>
+ __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r)
+ : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
+ { __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) }
+
+ /** @brief Constructs a %__shared_ptr that shares ownership with @a __r
+ * and stores a copy of the pointer stored in @a __r.
+ * @param __r A weak_ptr.
+ * @post use_count() == __r.use_count()
+ * @throw bad_weak_ptr when __r.expired(),
+ * in which case the constructor has no effect.
+ */
+ template<typename _Tp1>
+ explicit
+ __shared_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
+ : _M_refcount(__r._M_refcount) // may throw
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // It is now safe to copy __r._M_ptr, as _M_refcount(__r._M_refcount)
+ // did not throw.
+ _M_ptr = __r._M_ptr;
+ }
+
+#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || _GLIBCXX_DEPRECATED
+ /**
+ * @post use_count() == 1 and __r.get() == 0
+ */
+ template<typename _Tp1>
+ explicit
+ __shared_ptr(std::auto_ptr<_Tp1>& __r)
+ : _M_ptr(__r.get()), _M_refcount()
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ // TODO requires _Tp1 is complete, delete __r.release() well-formed
+ _Tp1* __tmp = __r.get();
+ _M_refcount = __shared_count<_Lp>(__r);
+ __enable_shared_from_this_helper(_M_refcount, __tmp, __tmp);
+ }
+
+#endif
+
+ template<typename _Tp1>
+ __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r, __static_cast_tag)
+ : _M_ptr(static_cast<element_type*>(__r._M_ptr)),
+ _M_refcount(__r._M_refcount)
+ { }
+
+ template<typename _Tp1>
+ __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r, __const_cast_tag)
+ : _M_ptr(const_cast<element_type*>(__r._M_ptr)),
+ _M_refcount(__r._M_refcount)
+ { }
+
+ template<typename _Tp1>
+ __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r, __dynamic_cast_tag)
+ : _M_ptr(dynamic_cast<element_type*>(__r._M_ptr)),
+ _M_refcount(__r._M_refcount)
+ {
+ if (_M_ptr == 0) // need to allocate new counter -- the cast failed
+ _M_refcount = __shared_count<_Lp>();
+ }
+
+ template<typename _Tp1>
+ __shared_ptr&
+ operator=(const __shared_ptr<_Tp1, _Lp>& __r) // never throws
+ {
+ _M_ptr = __r._M_ptr;
+ _M_refcount = __r._M_refcount; // __shared_count::op= doesn't throw
+ return *this;
+ }
+
+#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || _GLIBCXX_DEPRECATED
+ template<typename _Tp1>
+ __shared_ptr&
+ operator=(std::auto_ptr<_Tp1>& __r)
+ {
+ __shared_ptr(__r).swap(*this);
+ return *this;
+ }
+#endif
+
+ void
+ reset() // never throws
+ { __shared_ptr().swap(*this); }
+
+ template<typename _Tp1>
+ void
+ reset(_Tp1* __p) // _Tp1 must be complete.
+ {
+ // Catch self-reset errors.
+ _GLIBCXX_DEBUG_ASSERT(__p == 0 || __p != _M_ptr);
+ __shared_ptr(__p).swap(*this);
+ }
+
+ template<typename _Tp1, typename _Deleter>
+ void
+ reset(_Tp1* __p, _Deleter __d)
+ { __shared_ptr(__p, __d).swap(*this); }
+
+ // Allow class instantiation when _Tp is [cv-qual] void.
+ typename std::tr1::add_reference<_Tp>::type
+ operator*() const // never throws
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
+ return *_M_ptr;
+ }
+
+ _Tp*
+ operator->() const // never throws
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
+ return _M_ptr;
+ }
+
+ _Tp*
+ get() const // never throws
+ { return _M_ptr; }
+
+ // Implicit conversion to "bool"
+ private:
+ typedef _Tp* __shared_ptr::*__unspecified_bool_type;
+
+ public:
+ operator __unspecified_bool_type() const // never throws
+ { return _M_ptr == 0 ? 0 : &__shared_ptr::_M_ptr; }
+
+ bool
+ unique() const // never throws
+ { return _M_refcount._M_unique(); }
+
+ long
+ use_count() const // never throws
+ { return _M_refcount._M_get_use_count(); }
+
+ void
+ swap(__shared_ptr<_Tp, _Lp>& __other) // never throws
+ {
+ std::swap(_M_ptr, __other._M_ptr);
+ _M_refcount._M_swap(__other._M_refcount);
+ }
+
+ private:
+ void*
+ _M_get_deleter(const std::type_info& __ti) const
+ { return _M_refcount._M_get_deleter(__ti); }
+
+ template<typename _Tp1, _Lock_policy _Lp1>
+ bool
+ _M_less(const __shared_ptr<_Tp1, _Lp1>& __rhs) const
+ { return _M_refcount < __rhs._M_refcount; }
+
+ template<typename _Tp1, _Lock_policy _Lp1> friend class __shared_ptr;
+ template<typename _Tp1, _Lock_policy _Lp1> friend class __weak_ptr;
+
+ template<typename _Del, typename _Tp1, _Lock_policy _Lp1>
+ friend _Del* get_deleter(const __shared_ptr<_Tp1, _Lp1>&);
+
+ // Friends injected into enclosing namespace and found by ADL:
+ template<typename _Tp1>
+ friend inline bool
+ operator==(const __shared_ptr& __a, const __shared_ptr<_Tp1, _Lp>& __b)
+ { return __a.get() == __b.get(); }
+
+ template<typename _Tp1>
+ friend inline bool
+ operator!=(const __shared_ptr& __a, const __shared_ptr<_Tp1, _Lp>& __b)
+ { return __a.get() != __b.get(); }
+
+ template<typename _Tp1>
+ friend inline bool
+ operator<(const __shared_ptr& __a, const __shared_ptr<_Tp1, _Lp>& __b)
+ { return __a._M_less(__b); }
+
+ _Tp* _M_ptr; // Contained pointer.
+ __shared_count<_Lp> _M_refcount; // Reference counter.
+ };
+
+ // 2.2.3.8 shared_ptr specialized algorithms.
+ template<typename _Tp, _Lock_policy _Lp>
+ inline void
+ swap(__shared_ptr<_Tp, _Lp>& __a, __shared_ptr<_Tp, _Lp>& __b)
+ { __a.swap(__b); }
+
+ // 2.2.3.9 shared_ptr casts
+ /** @warning The seemingly equivalent
+ * <code>shared_ptr<_Tp, _Lp>(static_cast<_Tp*>(__r.get()))</code>
+ * will eventually result in undefined behaviour,
+ * attempting to delete the same object twice.
+ */
+ template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
+ inline __shared_ptr<_Tp, _Lp>
+ static_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
+ { return __shared_ptr<_Tp, _Lp>(__r, __static_cast_tag()); }
+
+ /** @warning The seemingly equivalent
+ * <code>shared_ptr<_Tp, _Lp>(const_cast<_Tp*>(__r.get()))</code>
+ * will eventually result in undefined behaviour,
+ * attempting to delete the same object twice.
+ */
+ template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
+ inline __shared_ptr<_Tp, _Lp>
+ const_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
+ { return __shared_ptr<_Tp, _Lp>(__r, __const_cast_tag()); }
+
+ /** @warning The seemingly equivalent
+ * <code>shared_ptr<_Tp, _Lp>(dynamic_cast<_Tp*>(__r.get()))</code>
+ * will eventually result in undefined behaviour,
+ * attempting to delete the same object twice.
+ */
+ template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
+ inline __shared_ptr<_Tp, _Lp>
+ dynamic_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
+ { return __shared_ptr<_Tp, _Lp>(__r, __dynamic_cast_tag()); }
+
+ // 2.2.3.7 shared_ptr I/O
+ template<typename _Ch, typename _Tr, typename _Tp, _Lock_policy _Lp>
+ std::basic_ostream<_Ch, _Tr>&
+ operator<<(std::basic_ostream<_Ch, _Tr>& __os,
+ const __shared_ptr<_Tp, _Lp>& __p)
+ {
+ __os << __p.get();
+ return __os;
+ }
+
+ // 2.2.3.10 shared_ptr get_deleter (experimental)
+ template<typename _Del, typename _Tp, _Lock_policy _Lp>
+ inline _Del*
+ get_deleter(const __shared_ptr<_Tp, _Lp>& __p)
+ { return static_cast<_Del*>(__p._M_get_deleter(typeid(_Del))); }
+
+
+ template<typename _Tp, _Lock_policy _Lp>
+ class __weak_ptr
+ {
+ public:
+ typedef _Tp element_type;
+
+ __weak_ptr()
+ : _M_ptr(0), _M_refcount() // never throws
+ { }
+
+ // Generated copy constructor, assignment, destructor are fine.
+
+ // The "obvious" converting constructor implementation:
+ //
+ // template<typename _Tp1>
+ // __weak_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
+ // : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
+ // { }
+ //
+ // has a serious problem.
+ //
+ // __r._M_ptr may already have been invalidated. The _M_ptr(__r._M_ptr)
+ // conversion may require access to *__r._M_ptr (virtual inheritance).
+ //
+ // It is not possible to avoid spurious access violations since
+ // in multithreaded programs __r._M_ptr may be invalidated at any point.
+ template<typename _Tp1>
+ __weak_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
+ : _M_refcount(__r._M_refcount) // never throws
+ {
+ __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
+ _M_ptr = __r.lock().get();
+ }
+
+ template<typename _Tp1>
+ __weak_ptr(const __shared_ptr<_Tp1, _Lp>& __r)
+ : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
+ { __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) }
+
+ template<typename _Tp1>
+ __weak_ptr&
+ operator=(const __weak_ptr<_Tp1, _Lp>& __r) // never throws
+ {
+ _M_ptr = __r.lock().get();
+ _M_refcount = __r._M_refcount;
+ return *this;
+ }
+
+ template<typename _Tp1>
+ __weak_ptr&
+ operator=(const __shared_ptr<_Tp1, _Lp>& __r) // never throws
+ {
+ _M_ptr = __r._M_ptr;
+ _M_refcount = __r._M_refcount;
+ return *this;
+ }
+
+ __shared_ptr<_Tp, _Lp>
+ lock() const // never throws
+ {
+#ifdef __GTHREADS
+ // Optimization: avoid throw overhead.
+ if (expired())
+ return __shared_ptr<element_type, _Lp>();
+
+ __try
+ {
+ return __shared_ptr<element_type, _Lp>(*this);
+ }
+ __catch(const bad_weak_ptr&)
+ {
+ // Q: How can we get here?
+ // A: Another thread may have invalidated r after the
+ // use_count test above.
+ return __shared_ptr<element_type, _Lp>();
+ }
+
+#else
+ // Optimization: avoid try/catch overhead when single threaded.
+ return expired() ? __shared_ptr<element_type, _Lp>()
+ : __shared_ptr<element_type, _Lp>(*this);
+
+#endif
+ } // XXX MT
+
+ long
+ use_count() const // never throws
+ { return _M_refcount._M_get_use_count(); }
+
+ bool
+ expired() const // never throws
+ { return _M_refcount._M_get_use_count() == 0; }
+
+ void
+ reset() // never throws
+ { __weak_ptr().swap(*this); }
+
+ void
+ swap(__weak_ptr& __s) // never throws
+ {
+ std::swap(_M_ptr, __s._M_ptr);
+ _M_refcount._M_swap(__s._M_refcount);
+ }
+
+ private:
+ // Used by __enable_shared_from_this.
+ void
+ _M_assign(_Tp* __ptr, const __shared_count<_Lp>& __refcount)
+ {
+ _M_ptr = __ptr;
+ _M_refcount = __refcount;
+ }
+
+ template<typename _Tp1>
+ bool
+ _M_less(const __weak_ptr<_Tp1, _Lp>& __rhs) const
+ { return _M_refcount < __rhs._M_refcount; }
+
+ template<typename _Tp1, _Lock_policy _Lp1> friend class __shared_ptr;
+ template<typename _Tp1, _Lock_policy _Lp1> friend class __weak_ptr;
+ friend class __enable_shared_from_this<_Tp, _Lp>;
+ friend class enable_shared_from_this<_Tp>;
+
+ // Friend injected into namespace and found by ADL.
+ template<typename _Tp1>
+ friend inline bool
+ operator<(const __weak_ptr& __lhs, const __weak_ptr<_Tp1, _Lp>& __rhs)
+ { return __lhs._M_less(__rhs); }
+
+ _Tp* _M_ptr; // Contained pointer.
+ __weak_count<_Lp> _M_refcount; // Reference counter.
+ };
+
+ // 2.2.4.7 weak_ptr specialized algorithms.
+ template<typename _Tp, _Lock_policy _Lp>
+ inline void
+ swap(__weak_ptr<_Tp, _Lp>& __a, __weak_ptr<_Tp, _Lp>& __b)
+ { __a.swap(__b); }
+
+
+ template<typename _Tp, _Lock_policy _Lp>
+ class __enable_shared_from_this
+ {
+ protected:
+ __enable_shared_from_this() { }
+
+ __enable_shared_from_this(const __enable_shared_from_this&) { }
+
+ __enable_shared_from_this&
+ operator=(const __enable_shared_from_this&)
+ { return *this; }
+
+ ~__enable_shared_from_this() { }
+
+ public:
+ __shared_ptr<_Tp, _Lp>
+ shared_from_this()
+ { return __shared_ptr<_Tp, _Lp>(this->_M_weak_this); }
+
+ __shared_ptr<const _Tp, _Lp>
+ shared_from_this() const
+ { return __shared_ptr<const _Tp, _Lp>(this->_M_weak_this); }
+
+ private:
+ template<typename _Tp1>
+ void
+ _M_weak_assign(_Tp1* __p, const __shared_count<_Lp>& __n) const
+ { _M_weak_this._M_assign(__p, __n); }
+
+ template<typename _Tp1>
+ friend void
+ __enable_shared_from_this_helper(const __shared_count<_Lp>& __pn,
+ const __enable_shared_from_this* __pe,
+ const _Tp1* __px)
+ {
+ if (__pe != 0)
+ __pe->_M_weak_assign(const_cast<_Tp1*>(__px), __pn);
+ }
+
+ mutable __weak_ptr<_Tp, _Lp> _M_weak_this;
+ };
+
+
+ /// shared_ptr
+ // The actual shared_ptr, with forwarding constructors and
+ // assignment operators.
+ template<typename _Tp>
+ class shared_ptr
+ : public __shared_ptr<_Tp>
+ {
+ public:
+ shared_ptr()
+ : __shared_ptr<_Tp>() { }
+
+ template<typename _Tp1>
+ explicit
+ shared_ptr(_Tp1* __p)
+ : __shared_ptr<_Tp>(__p) { }
+
+ template<typename _Tp1, typename _Deleter>
+ shared_ptr(_Tp1* __p, _Deleter __d)
+ : __shared_ptr<_Tp>(__p, __d) { }
+
+ template<typename _Tp1>
+ shared_ptr(const shared_ptr<_Tp1>& __r)
+ : __shared_ptr<_Tp>(__r) { }
+
+ template<typename _Tp1>
+ explicit
+ shared_ptr(const weak_ptr<_Tp1>& __r)
+ : __shared_ptr<_Tp>(__r) { }
+
+#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || _GLIBCXX_DEPRECATED
+ template<typename _Tp1>
+ explicit
+ shared_ptr(std::auto_ptr<_Tp1>& __r)
+ : __shared_ptr<_Tp>(__r) { }
+#endif
+
+ template<typename _Tp1>
+ shared_ptr(const shared_ptr<_Tp1>& __r, __static_cast_tag)
+ : __shared_ptr<_Tp>(__r, __static_cast_tag()) { }
+
+ template<typename _Tp1>
+ shared_ptr(const shared_ptr<_Tp1>& __r, __const_cast_tag)
+ : __shared_ptr<_Tp>(__r, __const_cast_tag()) { }
+
+ template<typename _Tp1>
+ shared_ptr(const shared_ptr<_Tp1>& __r, __dynamic_cast_tag)
+ : __shared_ptr<_Tp>(__r, __dynamic_cast_tag()) { }
+
+ template<typename _Tp1>
+ shared_ptr&
+ operator=(const shared_ptr<_Tp1>& __r) // never throws
+ {
+ this->__shared_ptr<_Tp>::operator=(__r);
+ return *this;
+ }
+
+#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || _GLIBCXX_DEPRECATED
+ template<typename _Tp1>
+ shared_ptr&
+ operator=(std::auto_ptr<_Tp1>& __r)
+ {
+ this->__shared_ptr<_Tp>::operator=(__r);
+ return *this;
+ }
+#endif
+ };
+
+ // 2.2.3.8 shared_ptr specialized algorithms.
+ template<typename _Tp>
+ inline void
+ swap(__shared_ptr<_Tp>& __a, __shared_ptr<_Tp>& __b)
+ { __a.swap(__b); }
+
+ template<typename _Tp, typename _Tp1>
+ inline shared_ptr<_Tp>
+ static_pointer_cast(const shared_ptr<_Tp1>& __r)
+ { return shared_ptr<_Tp>(__r, __static_cast_tag()); }
+
+ template<typename _Tp, typename _Tp1>
+ inline shared_ptr<_Tp>
+ const_pointer_cast(const shared_ptr<_Tp1>& __r)
+ { return shared_ptr<_Tp>(__r, __const_cast_tag()); }
+
+ template<typename _Tp, typename _Tp1>
+ inline shared_ptr<_Tp>
+ dynamic_pointer_cast(const shared_ptr<_Tp1>& __r)
+ { return shared_ptr<_Tp>(__r, __dynamic_cast_tag()); }
+
+
+ /// weak_ptr
+ // The actual weak_ptr, with forwarding constructors and
+ // assignment operators.
+ template<typename _Tp>
+ class weak_ptr
+ : public __weak_ptr<_Tp>
+ {
+ public:
+ weak_ptr()
+ : __weak_ptr<_Tp>() { }
+
+ template<typename _Tp1>
+ weak_ptr(const weak_ptr<_Tp1>& __r)
+ : __weak_ptr<_Tp>(__r) { }
+
+ template<typename _Tp1>
+ weak_ptr(const shared_ptr<_Tp1>& __r)
+ : __weak_ptr<_Tp>(__r) { }
+
+ template<typename _Tp1>
+ weak_ptr&
+ operator=(const weak_ptr<_Tp1>& __r) // never throws
+ {
+ this->__weak_ptr<_Tp>::operator=(__r);
+ return *this;
+ }
+
+ template<typename _Tp1>
+ weak_ptr&
+ operator=(const shared_ptr<_Tp1>& __r) // never throws
+ {
+ this->__weak_ptr<_Tp>::operator=(__r);
+ return *this;
+ }
+
+ shared_ptr<_Tp>
+ lock() const // never throws
+ {
+#ifdef __GTHREADS
+ if (this->expired())
+ return shared_ptr<_Tp>();
+
+ __try
+ {
+ return shared_ptr<_Tp>(*this);
+ }
+ __catch(const bad_weak_ptr&)
+ {
+ return shared_ptr<_Tp>();
+ }
+#else
+ return this->expired() ? shared_ptr<_Tp>()
+ : shared_ptr<_Tp>(*this);
+#endif
+ }
+ };
+
+ /// enable_shared_from_this
+ template<typename _Tp>
+ class enable_shared_from_this
+ {
+ protected:
+ enable_shared_from_this() { }
+
+ enable_shared_from_this(const enable_shared_from_this&) { }
+
+ enable_shared_from_this&
+ operator=(const enable_shared_from_this&)
+ { return *this; }
+
+ ~enable_shared_from_this() { }
+
+ public:
+ shared_ptr<_Tp>
+ shared_from_this()
+ { return shared_ptr<_Tp>(this->_M_weak_this); }
+
+ shared_ptr<const _Tp>
+ shared_from_this() const
+ { return shared_ptr<const _Tp>(this->_M_weak_this); }
+
+ private:
+ template<typename _Tp1>
+ void
+ _M_weak_assign(_Tp1* __p, const __shared_count<>& __n) const
+ { _M_weak_this._M_assign(__p, __n); }
+
+ template<typename _Tp1>
+ friend void
+ __enable_shared_from_this_helper(const __shared_count<>& __pn,
+ const enable_shared_from_this* __pe,
+ const _Tp1* __px)
+ {
+ if (__pe != 0)
+ __pe->_M_weak_assign(const_cast<_Tp1*>(__px), __pn);
+ }
+
+ mutable weak_ptr<_Tp> _M_weak_this;
+ };
+
+}
+}
+
+#endif // _TR1_SHARED_PTR_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/special_function_util.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/special_function_util.h
new file mode 100644
index 0000000..d2699bd
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/special_function_util.h
@@ -0,0 +1,144 @@
+// Special functions -*- C++ -*-
+
+// Copyright (C) 2006, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/special_function_util.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+//
+// ISO C++ 14882 TR1: 5.2 Special functions
+//
+
+// Written by Edward Smith-Rowland based on numerous mathematics books.
+
+#ifndef _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H
+#define _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H 1
+
+namespace std
+{
+namespace tr1
+{
+
+ namespace __detail
+ {
+
+ /// A class to encapsulate type dependent floating point
+ /// constants. Not everything will be able to be expressed as
+ /// type logic.
+ template<typename _Tp>
+ struct __floating_point_constant
+ {
+ static const _Tp __value;
+ };
+
+
+ /// A structure for numeric constants.
+ template<typename _Tp>
+ struct __numeric_constants
+ {
+ /// Constant @f$ \pi @f$.
+ static _Tp __pi() throw()
+ { return static_cast<_Tp>(3.1415926535897932384626433832795029L); }
+ /// Constant @f$ \pi / 2 @f$.
+ static _Tp __pi_2() throw()
+ { return static_cast<_Tp>(1.5707963267948966192313216916397514L); }
+ /// Constant @f$ \pi / 3 @f$.
+ static _Tp __pi_3() throw()
+ { return static_cast<_Tp>(1.0471975511965977461542144610931676L); }
+ /// Constant @f$ \pi / 4 @f$.
+ static _Tp __pi_4() throw()
+ { return static_cast<_Tp>(0.7853981633974483096156608458198757L); }
+ /// Constant @f$ 1 / \pi @f$.
+ static _Tp __1_pi() throw()
+ { return static_cast<_Tp>(0.3183098861837906715377675267450287L); }
+ /// Constant @f$ 2 / \sqrt(\pi) @f$.
+ static _Tp __2_sqrtpi() throw()
+ { return static_cast<_Tp>(1.1283791670955125738961589031215452L); }
+ /// Constant @f$ \sqrt(2) @f$.
+ static _Tp __sqrt2() throw()
+ { return static_cast<_Tp>(1.4142135623730950488016887242096981L); }
+ /// Constant @f$ \sqrt(3) @f$.
+ static _Tp __sqrt3() throw()
+ { return static_cast<_Tp>(1.7320508075688772935274463415058723L); }
+ /// Constant @f$ \sqrt(\pi/2) @f$.
+ static _Tp __sqrtpio2() throw()
+ { return static_cast<_Tp>(1.2533141373155002512078826424055226L); }
+ /// Constant @f$ 1 / sqrt(2) @f$.
+ static _Tp __sqrt1_2() throw()
+ { return static_cast<_Tp>(0.7071067811865475244008443621048490L); }
+ /// Constant @f$ \log(\pi) @f$.
+ static _Tp __lnpi() throw()
+ { return static_cast<_Tp>(1.1447298858494001741434273513530587L); }
+ /// Constant Euler's constant @f$ \gamma_E @f$.
+ static _Tp __gamma_e() throw()
+ { return static_cast<_Tp>(0.5772156649015328606065120900824024L); }
+ /// Constant Euler-Mascheroni @f$ e @f$
+ static _Tp __euler() throw()
+ { return static_cast<_Tp>(2.7182818284590452353602874713526625L); }
+ };
+
+
+#if _GLIBCXX_USE_C99_MATH && !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
+
+ /// This is a wrapper for the isnan function. Otherwise, for NaN,
+ /// all comparisons result in false. If/when we build a std::isnan
+ /// out of intrinsics, this will disappear completely in favor of
+ /// std::isnan.
+ template<typename _Tp>
+ inline bool __isnan(const _Tp __x)
+ {
+ return std::isnan(__x);
+ }
+
+#else
+
+ template<typename _Tp>
+ inline bool __isnan(const _Tp __x)
+ {
+ return __builtin_isnan(__x);
+ }
+
+ template<>
+ inline bool __isnan<float>(const float __x)
+ {
+ return __builtin_isnanf(__x);
+ }
+
+ template<>
+ inline bool __isnan<long double>(const long double __x)
+ {
+ return __builtin_isnanl(__x);
+ }
+
+#endif
+
+ } // namespace __detail
+
+}
+}
+
+#endif // _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/stdarg.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/stdarg.h
new file mode 100644
index 0000000..41173e8
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/stdarg.h
@@ -0,0 +1,34 @@
+// TR1 stdarg.h -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/stdarg.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _TR1_STDARG_H
+#define _TR1_STDARG_H 1
+
+#include <tr1/cstdarg>
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/stdbool.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/stdbool.h
new file mode 100644
index 0000000..3861e44
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/stdbool.h
@@ -0,0 +1,34 @@
+// TR1 stdbool.h -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/stdbool.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _TR1_STDBOOL_H
+#define _TR1_STDBOOL_H 1
+
+#include <tr1/cstdbool>
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/stdint.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/stdint.h
new file mode 100644
index 0000000..8113fa5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/stdint.h
@@ -0,0 +1,34 @@
+// TR1 stdint.h -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/stdint.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _TR1_STDINT_H
+#define _TR1_STDINT_H 1
+
+#include <tr1/cstdint>
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/stdio.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/stdio.h
new file mode 100644
index 0000000..f1edf83
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/stdio.h
@@ -0,0 +1,34 @@
+// TR1 stdio.h -*- C++ -*-
+
+// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/stdio.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _TR1_STDIO_H
+#define _TR1_STDIO_H 1
+
+#include <tr1/cstdio>
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/stdlib.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/stdlib.h
new file mode 100644
index 0000000..5e57aec
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/stdlib.h
@@ -0,0 +1,52 @@
+// TR1 stdlib.h -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/stdlib.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_STDLIB_H
+#define _GLIBCXX_TR1_STDLIB_H 1
+
+#include <tr1/cstdlib>
+
+#if _GLIBCXX_HOSTED
+
+#if _GLIBCXX_USE_C99
+
+using std::tr1::atoll;
+using std::tr1::strtoll;
+using std::tr1::strtoull;
+
+using std::tr1::abs;
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+using std::tr1::div;
+#endif
+
+#endif
+
+#endif
+
+#endif // _GLIBCXX_TR1_STDLIB_H
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/tgmath.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/tgmath.h
new file mode 100644
index 0000000..c807031
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/tgmath.h
@@ -0,0 +1,34 @@
+// TR1 tgmath.h -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/tgmath.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_TGMATH_H
+#define _GLIBCXX_TR1_TGMATH_H 1
+
+#include <tr1/ctgmath>
+
+#endif // _GLIBCXX_TR1_TGMATH_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/tuple b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/tuple
new file mode 100644
index 0000000..ff9f220
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/tuple
@@ -0,0 +1,422 @@
+// class template tuple -*- C++ -*-
+
+// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/tuple
+* This is a TR1 C++ Library header.
+*/
+
+// Chris Jefferson <chris@bubblescope.net>
+// Variadic Templates support by Douglas Gregor <doug.gregor@gmail.com>
+
+#ifndef _GLIBCXX_TR1_TUPLE
+#define _GLIBCXX_TR1_TUPLE 1
+
+#pragma GCC system_header
+
+#include <utility>
+
+namespace std
+{
+namespace tr1
+{
+ // Adds a const reference to a non-reference type.
+ template<typename _Tp>
+ struct __add_c_ref
+ { typedef const _Tp& type; };
+
+ template<typename _Tp>
+ struct __add_c_ref<_Tp&>
+ { typedef _Tp& type; };
+
+ // Adds a reference to a non-reference type.
+ template<typename _Tp>
+ struct __add_ref
+ { typedef _Tp& type; };
+
+ template<typename _Tp>
+ struct __add_ref<_Tp&>
+ { typedef _Tp& type; };
+
+ /**
+ * Contains the actual implementation of the @c tuple template, stored
+ * as a recursive inheritance hierarchy from the first element (most
+ * derived class) to the last (least derived class). The @c Idx
+ * parameter gives the 0-based index of the element stored at this
+ * point in the hierarchy; we use it to implement a constant-time
+ * get() operation.
+ */
+ template<int _Idx, typename... _Elements>
+ struct _Tuple_impl;
+
+ /**
+ * Zero-element tuple implementation. This is the basis case for the
+ * inheritance recursion.
+ */
+ template<int _Idx>
+ struct _Tuple_impl<_Idx> { };
+
+ /**
+ * Recursive tuple implementation. Here we store the @c Head element
+ * and derive from a @c Tuple_impl containing the remaining elements
+ * (which contains the @c Tail).
+ */
+ template<int _Idx, typename _Head, typename... _Tail>
+ struct _Tuple_impl<_Idx, _Head, _Tail...>
+ : public _Tuple_impl<_Idx + 1, _Tail...>
+ {
+ typedef _Tuple_impl<_Idx + 1, _Tail...> _Inherited;
+
+ _Head _M_head;
+
+ _Inherited& _M_tail() { return *this; }
+ const _Inherited& _M_tail() const { return *this; }
+
+ _Tuple_impl() : _Inherited(), _M_head() { }
+
+ explicit
+ _Tuple_impl(typename __add_c_ref<_Head>::type __head,
+ typename __add_c_ref<_Tail>::type... __tail)
+ : _Inherited(__tail...), _M_head(__head) { }
+
+ template<typename... _UElements>
+ _Tuple_impl(const _Tuple_impl<_Idx, _UElements...>& __in)
+ : _Inherited(__in._M_tail()), _M_head(__in._M_head) { }
+
+ _Tuple_impl(const _Tuple_impl& __in)
+ : _Inherited(__in._M_tail()), _M_head(__in._M_head) { }
+
+ template<typename... _UElements>
+ _Tuple_impl&
+ operator=(const _Tuple_impl<_Idx, _UElements...>& __in)
+ {
+ _M_head = __in._M_head;
+ _M_tail() = __in._M_tail();
+ return *this;
+ }
+
+ _Tuple_impl&
+ operator=(const _Tuple_impl& __in)
+ {
+ _M_head = __in._M_head;
+ _M_tail() = __in._M_tail();
+ return *this;
+ }
+ };
+
+ template<typename... _Elements>
+ class tuple : public _Tuple_impl<0, _Elements...>
+ {
+ typedef _Tuple_impl<0, _Elements...> _Inherited;
+
+ public:
+ tuple() : _Inherited() { }
+
+ explicit
+ tuple(typename __add_c_ref<_Elements>::type... __elements)
+ : _Inherited(__elements...) { }
+
+ template<typename... _UElements>
+ tuple(const tuple<_UElements...>& __in)
+ : _Inherited(__in) { }
+
+ tuple(const tuple& __in)
+ : _Inherited(__in) { }
+
+ template<typename... _UElements>
+ tuple&
+ operator=(const tuple<_UElements...>& __in)
+ {
+ static_cast<_Inherited&>(*this) = __in;
+ return *this;
+ }
+
+ tuple&
+ operator=(const tuple& __in)
+ {
+ static_cast<_Inherited&>(*this) = __in;
+ return *this;
+ }
+ };
+
+ template<> class tuple<> { };
+
+ // 2-element tuple, with construction and assignment from a pair.
+ template<typename _T1, typename _T2>
+ class tuple<_T1, _T2> : public _Tuple_impl<0, _T1, _T2>
+ {
+ typedef _Tuple_impl<0, _T1, _T2> _Inherited;
+
+ public:
+ tuple() : _Inherited() { }
+
+ explicit
+ tuple(typename __add_c_ref<_T1>::type __a1,
+ typename __add_c_ref<_T2>::type __a2)
+ : _Inherited(__a1, __a2) { }
+
+ template<typename _U1, typename _U2>
+ tuple(const tuple<_U1, _U2>& __in)
+ : _Inherited(__in) { }
+
+ tuple(const tuple& __in)
+ : _Inherited(__in) { }
+
+ template<typename _U1, typename _U2>
+ tuple(const pair<_U1, _U2>& __in)
+ : _Inherited(_Tuple_impl<0,
+ typename __add_c_ref<_U1>::type,
+ typename __add_c_ref<_U2>::type>(__in.first,
+ __in.second))
+ { }
+
+ template<typename _U1, typename _U2>
+ tuple&
+ operator=(const tuple<_U1, _U2>& __in)
+ {
+ static_cast<_Inherited&>(*this) = __in;
+ return *this;
+ }
+
+ tuple&
+ operator=(const tuple& __in)
+ {
+ static_cast<_Inherited&>(*this) = __in;
+ return *this;
+ }
+
+ template<typename _U1, typename _U2>
+ tuple&
+ operator=(const pair<_U1, _U2>& __in)
+ {
+ this->_M_head = __in.first;
+ this->_M_tail()._M_head = __in.second;
+ return *this;
+ }
+ };
+
+
+ /// Gives the type of the ith element of a given tuple type.
+ template<int __i, typename _Tp>
+ struct tuple_element;
+
+ /**
+ * Recursive case for tuple_element: strip off the first element in
+ * the tuple and retrieve the (i-1)th element of the remaining tuple.
+ */
+ template<int __i, typename _Head, typename... _Tail>
+ struct tuple_element<__i, tuple<_Head, _Tail...> >
+ : tuple_element<__i - 1, tuple<_Tail...> > { };
+
+ /**
+ * Basis case for tuple_element: The first element is the one we're seeking.
+ */
+ template<typename _Head, typename... _Tail>
+ struct tuple_element<0, tuple<_Head, _Tail...> >
+ {
+ typedef _Head type;
+ };
+
+ /// Finds the size of a given tuple type.
+ template<typename _Tp>
+ struct tuple_size;
+
+ /// class tuple_size
+ template<typename... _Elements>
+ struct tuple_size<tuple<_Elements...> >
+ {
+ static const int value = sizeof...(_Elements);
+ };
+
+ template<typename... _Elements>
+ const int tuple_size<tuple<_Elements...> >::value;
+
+ template<int __i, typename _Head, typename... _Tail>
+ inline typename __add_ref<_Head>::type
+ __get_helper(_Tuple_impl<__i, _Head, _Tail...>& __t)
+ {
+ return __t._M_head;
+ }
+
+ template<int __i, typename _Head, typename... _Tail>
+ inline typename __add_c_ref<_Head>::type
+ __get_helper(const _Tuple_impl<__i, _Head, _Tail...>& __t)
+ {
+ return __t._M_head;
+ }
+
+ // Return a reference (const reference) to the ith element of a tuple.
+ // Any const or non-const ref elements are returned with their original type.
+ template<int __i, typename... _Elements>
+ inline typename __add_ref<
+ typename tuple_element<__i, tuple<_Elements...> >::type
+ >::type
+ get(tuple<_Elements...>& __t)
+ {
+ return __get_helper<__i>(__t);
+ }
+
+ template<int __i, typename... _Elements>
+ inline typename __add_c_ref<
+ typename tuple_element<__i, tuple<_Elements...> >::type
+ >::type
+ get(const tuple<_Elements...>& __t)
+ {
+ return __get_helper<__i>(__t);
+ }
+
+ // This class helps construct the various comparison operations on tuples
+ template<int __check_equal_size, int __i, int __j,
+ typename _Tp, typename _Up>
+ struct __tuple_compare;
+
+ template<int __i, int __j, typename _Tp, typename _Up>
+ struct __tuple_compare<0, __i, __j, _Tp, _Up>
+ {
+ static bool __eq(const _Tp& __t, const _Up& __u)
+ {
+ return (get<__i>(__t) == get<__i>(__u) &&
+ __tuple_compare<0, __i+1, __j, _Tp, _Up>::__eq(__t, __u));
+ }
+
+ static bool __less(const _Tp& __t, const _Up& __u)
+ {
+ return ((get<__i>(__t) < get<__i>(__u))
+ || !(get<__i>(__u) < get<__i>(__t)) &&
+ __tuple_compare<0, __i+1, __j, _Tp, _Up>::__less(__t, __u));
+ }
+ };
+
+ template<int __i, typename _Tp, typename _Up>
+ struct __tuple_compare<0, __i, __i, _Tp, _Up>
+ {
+ static bool __eq(const _Tp&, const _Up&)
+ { return true; }
+
+ static bool __less(const _Tp&, const _Up&)
+ { return false; }
+ };
+
+ template<typename... _TElements, typename... _UElements>
+ bool
+ operator==(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ {
+ typedef tuple<_TElements...> _Tp;
+ typedef tuple<_UElements...> _Up;
+ return (__tuple_compare<tuple_size<_Tp>::value - tuple_size<_Up>::value,
+ 0, tuple_size<_Tp>::value, _Tp, _Up>::__eq(__t, __u));
+ }
+
+ template<typename... _TElements, typename... _UElements>
+ bool
+ operator<(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ {
+ typedef tuple<_TElements...> _Tp;
+ typedef tuple<_UElements...> _Up;
+ return (__tuple_compare<tuple_size<_Tp>::value - tuple_size<_Up>::value,
+ 0, tuple_size<_Tp>::value, _Tp, _Up>::__less(__t, __u));
+ }
+
+ template<typename... _TElements, typename... _UElements>
+ inline bool
+ operator!=(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ { return !(__t == __u); }
+
+ template<typename... _TElements, typename... _UElements>
+ inline bool
+ operator>(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ { return __u < __t; }
+
+ template<typename... _TElements, typename... _UElements>
+ inline bool
+ operator<=(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ { return !(__u < __t); }
+
+ template<typename... _TElements, typename... _UElements>
+ inline bool
+ operator>=(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ { return !(__t < __u); }
+
+ template<typename _Tp>
+ class reference_wrapper;
+
+ // Helper which adds a reference to a type when given a reference_wrapper
+ template<typename _Tp>
+ struct __strip_reference_wrapper
+ {
+ typedef _Tp __type;
+ };
+
+ template<typename _Tp>
+ struct __strip_reference_wrapper<reference_wrapper<_Tp> >
+ {
+ typedef _Tp& __type;
+ };
+
+ template<typename _Tp>
+ struct __strip_reference_wrapper<const reference_wrapper<_Tp> >
+ {
+ typedef _Tp& __type;
+ };
+
+ template<typename... _Elements>
+ inline tuple<typename __strip_reference_wrapper<_Elements>::__type...>
+ make_tuple(_Elements... __args)
+ {
+ typedef tuple<typename __strip_reference_wrapper<_Elements>::__type...>
+ __result_type;
+ return __result_type(__args...);
+ }
+
+ template<typename... _Elements>
+ inline tuple<_Elements&...>
+ tie(_Elements&... __args)
+ {
+ return tuple<_Elements&...>(__args...);
+ }
+
+ // A class (and instance) which can be used in 'tie' when an element
+ // of a tuple is not required
+ struct _Swallow_assign
+ {
+ template<class _Tp>
+ _Swallow_assign&
+ operator=(const _Tp&)
+ { return *this; }
+ };
+
+ // TODO: Put this in some kind of shared file.
+ namespace
+ {
+ _Swallow_assign ignore;
+ }; // anonymous namespace
+}
+}
+
+#endif // _GLIBCXX_TR1_TUPLE
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/type_traits b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/type_traits
new file mode 100644
index 0000000..fe28f84
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/type_traits
@@ -0,0 +1,249 @@
+// TR1 type_traits -*- C++ -*-
+
+// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/type_traits
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_TYPE_TRAITS
+#define _GLIBCXX_TR1_TYPE_TRAITS 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <cstddef>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/type_traits>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/type_traits>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+namespace std
+{
+namespace tr1
+{
+#define _DEFINE_SPEC(_Trait, _Type) \
+ template<> \
+ struct _Trait<_Type> \
+ : public true_type { };
+
+ template<typename>
+ struct is_reference
+ : public false_type { };
+
+ template<typename _Tp>
+ struct is_reference<_Tp&>
+ : public true_type { };
+
+ template<typename _Tp>
+ struct is_pod
+ : public integral_constant<bool, __is_pod(_Tp) || is_void<_Tp>::value>
+ { };
+
+ template<typename _Tp>
+ struct has_trivial_constructor
+ : public integral_constant<bool, is_pod<_Tp>::value>
+ { };
+
+ template<typename _Tp>
+ struct has_trivial_copy
+ : public integral_constant<bool, is_pod<_Tp>::value>
+ { };
+
+ template<typename _Tp>
+ struct has_trivial_assign
+ : public integral_constant<bool, is_pod<_Tp>::value>
+ { };
+
+ template<typename _Tp>
+ struct has_trivial_destructor
+ : public integral_constant<bool, is_pod<_Tp>::value>
+ { };
+
+ template<typename _Tp>
+ struct has_nothrow_constructor
+ : public integral_constant<bool, is_pod<_Tp>::value>
+ { };
+
+ template<typename _Tp>
+ struct has_nothrow_copy
+ : public integral_constant<bool, is_pod<_Tp>::value>
+ { };
+
+ template<typename _Tp>
+ struct has_nothrow_assign
+ : public integral_constant<bool, is_pod<_Tp>::value>
+ { };
+
+ template<typename>
+ struct __is_signed_helper
+ : public false_type { };
+ _DEFINE_SPEC(__is_signed_helper, signed char)
+ _DEFINE_SPEC(__is_signed_helper, short)
+ _DEFINE_SPEC(__is_signed_helper, int)
+ _DEFINE_SPEC(__is_signed_helper, long)
+ _DEFINE_SPEC(__is_signed_helper, long long)
+
+ template<typename _Tp>
+ struct is_signed
+ : public integral_constant<bool, (__is_signed_helper<typename
+ remove_cv<_Tp>::type>::value)>
+ { };
+
+ template<typename>
+ struct __is_unsigned_helper
+ : public false_type { };
+ _DEFINE_SPEC(__is_unsigned_helper, unsigned char)
+ _DEFINE_SPEC(__is_unsigned_helper, unsigned short)
+ _DEFINE_SPEC(__is_unsigned_helper, unsigned int)
+ _DEFINE_SPEC(__is_unsigned_helper, unsigned long)
+ _DEFINE_SPEC(__is_unsigned_helper, unsigned long long)
+
+ template<typename _Tp>
+ struct is_unsigned
+ : public integral_constant<bool, (__is_unsigned_helper<typename
+ remove_cv<_Tp>::type>::value)>
+ { };
+
+ template<typename _Base, typename _Derived>
+ struct __is_base_of_helper
+ {
+ typedef typename remove_cv<_Base>::type _NoCv_Base;
+ typedef typename remove_cv<_Derived>::type _NoCv_Derived;
+ static const bool __value = (is_same<_Base, _Derived>::value
+ || (__is_base_of(_Base, _Derived)
+ && !is_same<_NoCv_Base,
+ _NoCv_Derived>::value));
+ };
+
+ template<typename _Base, typename _Derived>
+ struct is_base_of
+ : public integral_constant<bool,
+ __is_base_of_helper<_Base, _Derived>::__value>
+ { };
+
+ template<typename _From, typename _To>
+ struct __is_convertible_simple
+ : public __sfinae_types
+ {
+ private:
+ static __one __test(_To);
+ static __two __test(...);
+ static _From __makeFrom();
+
+ public:
+ static const bool __value = sizeof(__test(__makeFrom())) == 1;
+ };
+
+ template<typename _Tp>
+ struct add_reference;
+
+ template<typename _Tp>
+ struct __is_int_or_cref
+ {
+ typedef typename remove_reference<_Tp>::type __rr_Tp;
+ static const bool __value = (is_integral<_Tp>::value
+ || (is_integral<__rr_Tp>::value
+ && is_const<__rr_Tp>::value
+ && !is_volatile<__rr_Tp>::value));
+ };
+
+ template<typename _From, typename _To,
+ bool = (is_void<_From>::value || is_void<_To>::value
+ || is_function<_To>::value || is_array<_To>::value
+ // This special case is here only to avoid warnings.
+ || (is_floating_point<typename
+ remove_reference<_From>::type>::value
+ && __is_int_or_cref<_To>::__value))>
+ struct __is_convertible_helper
+ {
+ // "An imaginary lvalue of type From...".
+ static const bool __value = (__is_convertible_simple<typename
+ add_reference<_From>::type, _To>::__value);
+ };
+
+ template<typename _From, typename _To>
+ struct __is_convertible_helper<_From, _To, true>
+ { static const bool __value = (is_void<_To>::value
+ || (__is_int_or_cref<_To>::__value
+ && !is_void<_From>::value)); };
+
+ template<typename _From, typename _To>
+ struct is_convertible
+ : public integral_constant<bool,
+ __is_convertible_helper<_From, _To>::__value>
+ { };
+
+ // reference modifications [4.7.2].
+ template<typename _Tp>
+ struct remove_reference
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct remove_reference<_Tp&>
+ { typedef _Tp type; };
+
+ // NB: Careful with reference to void.
+ template<typename _Tp, bool = (is_void<_Tp>::value
+ || is_reference<_Tp>::value)>
+ struct __add_reference_helper
+ { typedef _Tp& type; };
+
+ template<typename _Tp>
+ struct __add_reference_helper<_Tp, true>
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct add_reference
+ : public __add_reference_helper<_Tp>
+ { };
+
+ // other transformations [4.8].
+ template<std::size_t _Len, std::size_t _Align>
+ struct aligned_storage
+ {
+ union type
+ {
+ unsigned char __data[_Len];
+ struct __attribute__((__aligned__((_Align)))) { } __align;
+ };
+ };
+
+#undef _DEFINE_SPEC
+}
+}
+
+#endif // _GLIBCXX_TR1_TYPE_TRAITS
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/unordered_map b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/unordered_map
new file mode 100644
index 0000000..316630f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/unordered_map
@@ -0,0 +1,61 @@
+// TR1 unordered_map -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/unordered_map
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_UNORDERED_MAP
+#define _GLIBCXX_TR1_UNORDERED_MAP 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <utility>
+#include <bits/stl_algobase.h>
+#include <bits/allocator.h>
+#include <bits/stl_function.h> // equal_to, _Identity, _Select1st
+#include <bits/stringfwd.h>
+#include <tr1/type_traits>
+#include <tr1/functional_hash.h>
+#include <tr1/hashtable.h>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/unordered_map>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/unordered_map>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_UNORDERED_MAP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/unordered_set b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/unordered_set
new file mode 100644
index 0000000..3bd0944
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/unordered_set
@@ -0,0 +1,61 @@
+// TR1 unordered_set -*- C++ -*-
+
+// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/unordered_set
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_UNORDERED_SET
+#define _GLIBCXX_TR1_UNORDERED_SET 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <utility>
+#include <bits/stl_algobase.h>
+#include <bits/allocator.h>
+#include <bits/stl_function.h> // equal_to, _Identity, _Select1st
+#include <bits/stringfwd.h>
+#include <tr1/type_traits>
+#include <tr1/functional_hash.h>
+#include <tr1/hashtable.h>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/unordered_set>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/unordered_set>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_UNORDERED_SET
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/utility b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/utility
new file mode 100644
index 0000000..0aac2b2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/utility
@@ -0,0 +1,56 @@
+// TR1 utility -*- C++ -*-
+
+// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/utility
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_UTILITY
+#define _GLIBCXX_TR1_UTILITY 1
+
+#pragma GCC system_header
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# error TR1 header cannot be included from C++0x header
+#endif
+
+#include <bits/c++config.h>
+#include <bits/stl_relops.h>
+#include <bits/stl_pair.h>
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# include <tr1_impl/utility>
+#else
+# define _GLIBCXX_INCLUDE_AS_TR1
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 tr1::
+# include <tr1_impl/utility>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_TR1
+#endif
+
+#endif // _GLIBCXX_TR1_UTILITY
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/wchar.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/wchar.h
new file mode 100644
index 0000000..5996048
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/wchar.h
@@ -0,0 +1,34 @@
+// TR1 wchar.h -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/wchar.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_WCHAR_H
+#define _GLIBCXX_TR1_WCHAR_H 1
+
+#include <tr1/cwchar>
+
+#endif // _GLIBCXX_TR1_WCHAR_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/wctype.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/wctype.h
new file mode 100644
index 0000000..604948a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1/wctype.h
@@ -0,0 +1,34 @@
+// TR1 wctype.h -*- C++ -*-
+
+// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1/wctype.h
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TR1_WCTYPE_H
+#define _GLIBCXX_TR1_WCTYPE_H 1
+
+#include <tr1/cwctype>
+
+#endif // _GLIBCXX_TR1_WCTYPE_H
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/array b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/array
new file mode 100644
index 0000000..c0bd240
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/array
@@ -0,0 +1,287 @@
+// class template array -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/array
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ /**
+ * @brief A standard container for storing a fixed size sequence of elements.
+ *
+ * @ingroup sequences
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, a
+ * <a href="tables.html#66">reversible container</a>, and a
+ * <a href="tables.html#67">sequence</a>.
+ *
+ * Sets support random access iterators.
+ *
+ * @param Tp Type of element. Required to be a complete type.
+ * @param N Number of elements.
+ */
+ template<typename _Tp, std::size_t _Nm>
+ struct array
+ {
+ typedef _Tp value_type;
+ typedef value_type& reference;
+ typedef const value_type& const_reference;
+ typedef value_type* iterator;
+ typedef const value_type* const_iterator;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ // Support for zero-sized arrays mandatory.
+ value_type _M_instance[_Nm ? _Nm : 1];
+
+ // No explicit construct/copy/destroy for aggregate type.
+
+ void
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ // DR 776.
+ fill(const value_type& __u)
+#else
+ assign(const value_type& __u)
+#endif
+ { std::fill_n(begin(), size(), __u); }
+
+ void
+ swap(array& __other)
+ { std::swap_ranges(begin(), end(), __other.begin()); }
+
+ // Iterators.
+ iterator
+ begin()
+ { return iterator(&_M_instance[0]); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(&_M_instance[0]); }
+
+ iterator
+ end()
+ { return iterator(&_M_instance[_Nm]); }
+
+ const_iterator
+ end() const
+ { return const_iterator(&_M_instance[_Nm]); }
+
+ reverse_iterator
+ rbegin()
+ { return reverse_iterator(end()); }
+
+ const_reverse_iterator
+ rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ reverse_iterator
+ rend()
+ { return reverse_iterator(begin()); }
+
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ const_iterator
+ cbegin() const
+ { return const_iterator(&_M_instance[0]); }
+
+ const_iterator
+ cend() const
+ { return const_iterator(&_M_instance[_Nm]); }
+
+ const_reverse_iterator
+ crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ const_reverse_iterator
+ crend() const
+ { return const_reverse_iterator(begin()); }
+#endif
+
+ // Capacity.
+ size_type
+ size() const { return _Nm; }
+
+ size_type
+ max_size() const { return _Nm; }
+
+ bool
+ empty() const { return size() == 0; }
+
+ // Element access.
+ reference
+ operator[](size_type __n)
+ { return _M_instance[__n]; }
+
+ const_reference
+ operator[](size_type __n) const
+ { return _M_instance[__n]; }
+
+ reference
+ at(size_type __n)
+ {
+ if (__builtin_expect(__n >= _Nm, false))
+ std::__throw_out_of_range(__N("array::at"));
+ return _M_instance[__n];
+ }
+
+ const_reference
+ at(size_type __n) const
+ {
+ if (__builtin_expect(__n >= _Nm, false))
+ std::__throw_out_of_range(__N("array::at"));
+ return _M_instance[__n];
+ }
+
+ reference
+ front()
+ { return *begin(); }
+
+ const_reference
+ front() const
+ { return *begin(); }
+
+ reference
+ back()
+ { return _Nm ? *(end() - 1) : *end(); }
+
+ const_reference
+ back() const
+ { return _Nm ? *(end() - 1) : *end(); }
+
+ _Tp*
+ data()
+ { return &_M_instance[0]; }
+
+ const _Tp*
+ data() const
+ { return &_M_instance[0]; }
+ };
+
+ // Array comparisons.
+ template<typename _Tp, std::size_t _Nm>
+ inline bool
+ operator==(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
+ { return std::equal(__one.begin(), __one.end(), __two.begin()); }
+
+ template<typename _Tp, std::size_t _Nm>
+ inline bool
+ operator!=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
+ { return !(__one == __two); }
+
+ template<typename _Tp, std::size_t _Nm>
+ inline bool
+ operator<(const array<_Tp, _Nm>& __a, const array<_Tp, _Nm>& __b)
+ {
+ return std::lexicographical_compare(__a.begin(), __a.end(),
+ __b.begin(), __b.end());
+ }
+
+ template<typename _Tp, std::size_t _Nm>
+ inline bool
+ operator>(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
+ { return __two < __one; }
+
+ template<typename _Tp, std::size_t _Nm>
+ inline bool
+ operator<=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
+ { return !(__one > __two); }
+
+ template<typename _Tp, std::size_t _Nm>
+ inline bool
+ operator>=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
+ { return !(__one < __two); }
+
+ // Specialized algorithms [6.2.2.2].
+ template<typename _Tp, std::size_t _Nm>
+ inline void
+ swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
+ { std::swap_ranges(__one.begin(), __one.end(), __two.begin()); }
+
+ // Tuple interface to class template array [6.2.2.5].
+
+ /// tuple_size
+ template<typename _Tp>
+ class tuple_size;
+
+ /// tuple_element
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<std::size_t _Int, typename _Tp>
+#else
+ template<int _Int, typename _Tp>
+#endif
+ class tuple_element;
+
+ template<typename _Tp, std::size_t _Nm>
+ struct tuple_size<array<_Tp, _Nm> >
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ { static const std::size_t value = _Nm; };
+#else
+ { static const int value = _Nm; };
+#endif
+
+ template<typename _Tp, std::size_t _Nm>
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ const std::size_t
+#else
+ const int
+#endif
+ tuple_size<array<_Tp, _Nm> >::value;
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<std::size_t _Int, typename _Tp, std::size_t _Nm>
+#else
+ template<int _Int, typename _Tp, std::size_t _Nm>
+#endif
+ struct tuple_element<_Int, array<_Tp, _Nm> >
+ { typedef _Tp type; };
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<std::size_t _Int, typename _Tp, std::size_t _Nm>
+#else
+ template<int _Int, typename _Tp, std::size_t _Nm>
+#endif
+ inline _Tp&
+ get(array<_Tp, _Nm>& __arr)
+ { return __arr[_Int]; }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<std::size_t _Int, typename _Tp, std::size_t _Nm>
+#else
+ template<int _Int, typename _Tp, std::size_t _Nm>
+#endif
+ inline const _Tp&
+ get(const array<_Tp, _Nm>& __arr)
+ { return __arr[_Int]; }
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/boost_sp_counted_base.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/boost_sp_counted_base.h
new file mode 100644
index 0000000..48e601f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/boost_sp_counted_base.h
@@ -0,0 +1,239 @@
+// <tr1_impl/boost_sp_counted_base.h> -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// shared_count.hpp
+// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
+
+// shared_ptr.hpp
+// Copyright (C) 1998, 1999 Greg Colvin and Beman Dawes.
+// Copyright (C) 2001, 2002, 2003 Peter Dimov
+
+// weak_ptr.hpp
+// Copyright (C) 2001, 2002, 2003 Peter Dimov
+
+// enable_shared_from_this.hpp
+// Copyright (C) 2002 Peter Dimov
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// GCC Note: based on version 1.32.0 of the Boost library.
+
+/** @file tr1_impl/boost_sp_counted_base.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ class bad_weak_ptr : public std::exception
+ {
+ public:
+ virtual char const*
+ what() const throw()
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ { return "std::bad_weak_ptr"; }
+#else
+ { return "tr1::bad_weak_ptr"; }
+#endif
+ };
+
+ // Substitute for bad_weak_ptr object in the case of -fno-exceptions.
+ inline void
+ __throw_bad_weak_ptr()
+ {
+#if __EXCEPTIONS
+ throw bad_weak_ptr();
+#else
+ __builtin_abort();
+#endif
+ }
+
+ using __gnu_cxx::_Lock_policy;
+ using __gnu_cxx::__default_lock_policy;
+ using __gnu_cxx::_S_single;
+ using __gnu_cxx::_S_mutex;
+ using __gnu_cxx::_S_atomic;
+
+ // Empty helper class except when the template argument is _S_mutex.
+ template<_Lock_policy _Lp>
+ class _Mutex_base
+ {
+ protected:
+ // The atomic policy uses fully-fenced builtins, single doesn't care.
+ enum { _S_need_barriers = 0 };
+ };
+
+ template<>
+ class _Mutex_base<_S_mutex>
+ : public __gnu_cxx::__mutex
+ {
+ protected:
+ // This policy is used when atomic builtins are not available.
+ // The replacement atomic operations might not have the necessary
+ // memory barriers.
+ enum { _S_need_barriers = 1 };
+ };
+
+ template<_Lock_policy _Lp = __default_lock_policy>
+ class _Sp_counted_base
+ : public _Mutex_base<_Lp>
+ {
+ public:
+ _Sp_counted_base()
+ : _M_use_count(1), _M_weak_count(1) { }
+
+ virtual
+ ~_Sp_counted_base() // nothrow
+ { }
+
+ // Called when _M_use_count drops to zero, to release the resources
+ // managed by *this.
+ virtual void
+ _M_dispose() = 0; // nothrow
+
+ // Called when _M_weak_count drops to zero.
+ virtual void
+ _M_destroy() // nothrow
+ { delete this; }
+
+ virtual void*
+ _M_get_deleter(const std::type_info&) = 0;
+
+ void
+ _M_add_ref_copy()
+ { __gnu_cxx::__atomic_add_dispatch(&_M_use_count, 1); }
+
+ void
+ _M_add_ref_lock();
+
+ void
+ _M_release() // nothrow
+ {
+ if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, -1) == 1)
+ {
+ _M_dispose();
+ // There must be a memory barrier between dispose() and destroy()
+ // to ensure that the effects of dispose() are observed in the
+ // thread that runs destroy().
+ // See http://gcc.gnu.org/ml/libstdc++/2005-11/msg00136.html
+ if (_Mutex_base<_Lp>::_S_need_barriers)
+ {
+ _GLIBCXX_READ_MEM_BARRIER;
+ _GLIBCXX_WRITE_MEM_BARRIER;
+ }
+
+ if (__gnu_cxx::__exchange_and_add_dispatch(&_M_weak_count,
+ -1) == 1)
+ _M_destroy();
+ }
+ }
+
+ void
+ _M_weak_add_ref() // nothrow
+ { __gnu_cxx::__atomic_add_dispatch(&_M_weak_count, 1); }
+
+ void
+ _M_weak_release() // nothrow
+ {
+ if (__gnu_cxx::__exchange_and_add_dispatch(&_M_weak_count, -1) == 1)
+ {
+ if (_Mutex_base<_Lp>::_S_need_barriers)
+ {
+ // See _M_release(),
+ // destroy() must observe results of dispose()
+ _GLIBCXX_READ_MEM_BARRIER;
+ _GLIBCXX_WRITE_MEM_BARRIER;
+ }
+ _M_destroy();
+ }
+ }
+
+ long
+ _M_get_use_count() const // nothrow
+ {
+ // No memory barrier is used here so there is no synchronization
+ // with other threads.
+ return const_cast<const volatile _Atomic_word&>(_M_use_count);
+ }
+
+ private:
+ _Sp_counted_base(_Sp_counted_base const&);
+ _Sp_counted_base& operator=(_Sp_counted_base const&);
+
+ _Atomic_word _M_use_count; // #shared
+ _Atomic_word _M_weak_count; // #weak + (#shared != 0)
+ };
+
+ template<>
+ inline void
+ _Sp_counted_base<_S_single>::
+ _M_add_ref_lock()
+ {
+ if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, 1) == 0)
+ {
+ _M_use_count = 0;
+ __throw_bad_weak_ptr();
+ }
+ }
+
+ template<>
+ inline void
+ _Sp_counted_base<_S_mutex>::
+ _M_add_ref_lock()
+ {
+ __gnu_cxx::__scoped_lock sentry(*this);
+ if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, 1) == 0)
+ {
+ _M_use_count = 0;
+ __throw_bad_weak_ptr();
+ }
+ }
+
+ template<>
+ inline void
+ _Sp_counted_base<_S_atomic>::
+ _M_add_ref_lock()
+ {
+ // Perform lock-free add-if-not-zero operation.
+ _Atomic_word __count;
+ do
+ {
+ __count = _M_use_count;
+ if (__count == 0)
+ __throw_bad_weak_ptr();
+
+ // Replace the current counter value with the old value + 1, as
+ // long as it's not changed meanwhile.
+ }
+ while (!__sync_bool_compare_and_swap(&_M_use_count, __count,
+ __count + 1));
+ }
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cctype b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cctype
new file mode 100644
index 0000000..c76d38c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cctype
@@ -0,0 +1,43 @@
+// TR1 cctype -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/cctype
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#if _GLIBCXX_USE_C99_CTYPE_TR1
+
+#undef isblank
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ using ::isblank;
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cfenv b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cfenv
new file mode 100644
index 0000000..3078c7d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cfenv
@@ -0,0 +1,70 @@
+// TR1 cfenv -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/cfenv
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#if _GLIBCXX_USE_C99_FENV_TR1
+
+#undef feclearexcept
+#undef fegetexceptflag
+#undef feraiseexcept
+#undef fesetexceptflag
+#undef fetestexcept
+#undef fegetround
+#undef fesetround
+#undef fegetenv
+#undef feholdexcept
+#undef fesetenv
+#undef feupdateenv
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ // types
+ using ::fenv_t;
+ using ::fexcept_t;
+
+ // functions
+ using ::feclearexcept;
+ using ::fegetexceptflag;
+ using ::feraiseexcept;
+ using ::fesetexceptflag;
+ using ::fetestexcept;
+
+ using ::fegetround;
+ using ::fesetround;
+
+ using ::fegetenv;
+ using ::feholdexcept;
+ using ::fesetenv;
+ using ::feupdateenv;
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cinttypes b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cinttypes
new file mode 100644
index 0000000..4a0f9f1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cinttypes
@@ -0,0 +1,64 @@
+// TR1 cinttypes -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/cinttypes
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#if _GLIBCXX_USE_C99_INTTYPES_TR1
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ // types
+ using ::imaxdiv_t;
+
+ // functions
+ using ::imaxabs;
+
+ // May collide with _Longlong abs(_Longlong), and is not described
+ // anywhere outside the synopsis. Likely, a defect.
+ //
+ // intmax_t abs(intmax_t)
+
+ using ::imaxdiv;
+
+ // Likewise, with lldiv_t div(_Longlong, _Longlong).
+ //
+ // imaxdiv_t div(intmax_t, intmax_t)
+
+ using ::strtoimax;
+ using ::strtoumax;
+
+#if defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1
+ using ::wcstoimax;
+ using ::wcstoumax;
+#endif
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cmath b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cmath
new file mode 100644
index 0000000..5807380
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cmath
@@ -0,0 +1,902 @@
+// TR1 cmath -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/cmath
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#if _GLIBCXX_USE_C99_MATH_TR1
+
+#undef acosh
+#undef acoshf
+#undef acoshl
+#undef asinh
+#undef asinhf
+#undef asinhl
+#undef atanh
+#undef atanhf
+#undef atanhl
+#undef cbrt
+#undef cbrtf
+#undef cbrtl
+#undef copysign
+#undef copysignf
+#undef copysignl
+#undef erf
+#undef erff
+#undef erfl
+#undef erfc
+#undef erfcf
+#undef erfcl
+#undef exp2
+#undef exp2f
+#undef exp2l
+#undef expm1
+#undef expm1f
+#undef expm1l
+#undef fdim
+#undef fdimf
+#undef fdiml
+#undef fma
+#undef fmaf
+#undef fmal
+#undef fmax
+#undef fmaxf
+#undef fmaxl
+#undef fmin
+#undef fminf
+#undef fminl
+#undef hypot
+#undef hypotf
+#undef hypotl
+#undef ilogb
+#undef ilogbf
+#undef ilogbl
+#undef lgamma
+#undef lgammaf
+#undef lgammal
+#undef llrint
+#undef llrintf
+#undef llrintl
+#undef llround
+#undef llroundf
+#undef llroundl
+#undef log1p
+#undef log1pf
+#undef log1pl
+#undef log2
+#undef log2f
+#undef log2l
+#undef logb
+#undef logbf
+#undef logbl
+#undef lrint
+#undef lrintf
+#undef lrintl
+#undef lround
+#undef lroundf
+#undef lroundl
+#undef nan
+#undef nanf
+#undef nanl
+#undef nearbyint
+#undef nearbyintf
+#undef nearbyintl
+#undef nextafter
+#undef nextafterf
+#undef nextafterl
+#undef nexttoward
+#undef nexttowardf
+#undef nexttowardl
+#undef remainder
+#undef remainderf
+#undef remainderl
+#undef remquo
+#undef remquof
+#undef remquol
+#undef rint
+#undef rintf
+#undef rintl
+#undef round
+#undef roundf
+#undef roundl
+#undef scalbln
+#undef scalblnf
+#undef scalblnl
+#undef scalbn
+#undef scalbnf
+#undef scalbnl
+#undef tgamma
+#undef tgammaf
+#undef tgammal
+#undef trunc
+#undef truncf
+#undef truncl
+
+#endif
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+#if _GLIBCXX_USE_C99_MATH_TR1
+
+ // types
+ using ::double_t;
+ using ::float_t;
+
+ // functions
+ using ::acosh;
+ using ::acoshf;
+ using ::acoshl;
+
+ using ::asinh;
+ using ::asinhf;
+ using ::asinhl;
+
+ using ::atanh;
+ using ::atanhf;
+ using ::atanhl;
+
+ using ::cbrt;
+ using ::cbrtf;
+ using ::cbrtl;
+
+ using ::copysign;
+ using ::copysignf;
+ using ::copysignl;
+
+ using ::erf;
+ using ::erff;
+ using ::erfl;
+
+ using ::erfc;
+ using ::erfcf;
+ using ::erfcl;
+
+ using ::exp2;
+ using ::exp2f;
+ using ::exp2l;
+
+ using ::expm1;
+ using ::expm1f;
+ using ::expm1l;
+
+ using ::fdim;
+ using ::fdimf;
+ using ::fdiml;
+
+ using ::fma;
+ using ::fmaf;
+ using ::fmal;
+
+ using ::fmax;
+ using ::fmaxf;
+ using ::fmaxl;
+
+ using ::fmin;
+ using ::fminf;
+ using ::fminl;
+
+ using ::hypot;
+ using ::hypotf;
+ using ::hypotl;
+
+ using ::ilogb;
+ using ::ilogbf;
+ using ::ilogbl;
+
+ using ::lgamma;
+ using ::lgammaf;
+ using ::lgammal;
+
+ using ::llrint;
+ using ::llrintf;
+ using ::llrintl;
+
+ using ::llround;
+ using ::llroundf;
+ using ::llroundl;
+
+ using ::log1p;
+ using ::log1pf;
+ using ::log1pl;
+
+ using ::log2;
+ using ::log2f;
+ using ::log2l;
+
+ using ::logb;
+ using ::logbf;
+ using ::logbl;
+
+ using ::lrint;
+ using ::lrintf;
+ using ::lrintl;
+
+ using ::lround;
+ using ::lroundf;
+ using ::lroundl;
+
+ using ::nan;
+ using ::nanf;
+ using ::nanl;
+
+ using ::nearbyint;
+ using ::nearbyintf;
+ using ::nearbyintl;
+
+ using ::nextafter;
+ using ::nextafterf;
+ using ::nextafterl;
+
+ using ::nexttoward;
+ using ::nexttowardf;
+ using ::nexttowardl;
+
+ using ::remainder;
+ using ::remainderf;
+ using ::remainderl;
+
+ using ::remquo;
+ using ::remquof;
+ using ::remquol;
+
+ using ::rint;
+ using ::rintf;
+ using ::rintl;
+
+ using ::round;
+ using ::roundf;
+ using ::roundl;
+
+ using ::scalbln;
+ using ::scalblnf;
+ using ::scalblnl;
+
+ using ::scalbn;
+ using ::scalbnf;
+ using ::scalbnl;
+
+ using ::tgamma;
+ using ::tgammaf;
+ using ::tgammal;
+
+ using ::trunc;
+ using ::truncf;
+ using ::truncl;
+
+#endif
+
+#if _GLIBCXX_USE_C99_MATH
+#if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
+
+ /// Function template definitions [8.16.3].
+ using std::signbit;
+
+ using std::fpclassify;
+
+ using std::isfinite;
+ using std::isinf;
+ using std::isnan;
+ using std::isnormal;
+
+ using std::isgreater;
+ using std::isgreaterequal;
+ using std::isless;
+ using std::islessequal;
+ using std::islessgreater;
+ using std::isunordered;
+#endif
+#endif
+
+#if _GLIBCXX_USE_C99_MATH_TR1
+
+ /// Additional overloads [8.16.4].
+ using std::acos;
+
+ inline float
+ acosh(float __x)
+ { return __builtin_acoshf(__x); }
+
+ inline long double
+ acosh(long double __x)
+ { return __builtin_acoshl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ acosh(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return acosh(__type(__x));
+ }
+
+ using std::asin;
+
+ inline float
+ asinh(float __x)
+ { return __builtin_asinhf(__x); }
+
+ inline long double
+ asinh(long double __x)
+ { return __builtin_asinhl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ asinh(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return asinh(__type(__x));
+ }
+
+ using std::atan;
+ using std::atan2;
+
+ inline float
+ atanh(float __x)
+ { return __builtin_atanhf(__x); }
+
+ inline long double
+ atanh(long double __x)
+ { return __builtin_atanhl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ atanh(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return atanh(__type(__x));
+ }
+
+ inline float
+ cbrt(float __x)
+ { return __builtin_cbrtf(__x); }
+
+ inline long double
+ cbrt(long double __x)
+ { return __builtin_cbrtl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ cbrt(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return cbrt(__type(__x));
+ }
+
+ using std::ceil;
+
+ inline float
+ copysign(float __x, float __y)
+ { return __builtin_copysignf(__x, __y); }
+
+ inline long double
+ copysign(long double __x, long double __y)
+ { return __builtin_copysignl(__x, __y); }
+
+ template<typename _Tp, typename _Up>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+ copysign(_Tp __x, _Up __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return copysign(__type(__x), __type(__y));
+ }
+
+ using std::cos;
+ using std::cosh;
+
+ inline float
+ erf(float __x)
+ { return __builtin_erff(__x); }
+
+ inline long double
+ erf(long double __x)
+ { return __builtin_erfl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ erf(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return erf(__type(__x));
+ }
+
+ inline float
+ erfc(float __x)
+ { return __builtin_erfcf(__x); }
+
+ inline long double
+ erfc(long double __x)
+ { return __builtin_erfcl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ erfc(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return erfc(__type(__x));
+ }
+
+ using std::exp;
+
+ inline float
+ exp2(float __x)
+ { return __builtin_exp2f(__x); }
+
+ inline long double
+ exp2(long double __x)
+ { return __builtin_exp2l(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ exp2(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return exp2(__type(__x));
+ }
+
+ inline float
+ expm1(float __x)
+ { return __builtin_expm1f(__x); }
+
+ inline long double
+ expm1(long double __x)
+ { return __builtin_expm1l(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ expm1(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return expm1(__type(__x));
+ }
+
+ using std::fabs;
+
+ inline float
+ fdim(float __x, float __y)
+ { return __builtin_fdimf(__x, __y); }
+
+ inline long double
+ fdim(long double __x, long double __y)
+ { return __builtin_fdiml(__x, __y); }
+
+ template<typename _Tp, typename _Up>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+ fdim(_Tp __x, _Up __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return fdim(__type(__x), __type(__y));
+ }
+
+ using std::floor;
+
+ inline float
+ fma(float __x, float __y, float __z)
+ { return __builtin_fmaf(__x, __y, __z); }
+
+ inline long double
+ fma(long double __x, long double __y, long double __z)
+ { return __builtin_fmal(__x, __y, __z); }
+
+ template<typename _Tp, typename _Up, typename _Vp>
+ inline typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
+ fma(_Tp __x, _Up __y, _Vp __z)
+ {
+ typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
+ return fma(__type(__x), __type(__y), __type(__z));
+ }
+
+ inline float
+ fmax(float __x, float __y)
+ { return __builtin_fmaxf(__x, __y); }
+
+ inline long double
+ fmax(long double __x, long double __y)
+ { return __builtin_fmaxl(__x, __y); }
+
+ template<typename _Tp, typename _Up>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+ fmax(_Tp __x, _Up __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return fmax(__type(__x), __type(__y));
+ }
+
+ inline float
+ fmin(float __x, float __y)
+ { return __builtin_fminf(__x, __y); }
+
+ inline long double
+ fmin(long double __x, long double __y)
+ { return __builtin_fminl(__x, __y); }
+
+ template<typename _Tp, typename _Up>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+ fmin(_Tp __x, _Up __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return fmin(__type(__x), __type(__y));
+ }
+
+ using std::fmod;
+ using std::frexp;
+
+ inline float
+ hypot(float __x, float __y)
+ { return __builtin_hypotf(__x, __y); }
+
+ inline long double
+ hypot(long double __x, long double __y)
+ { return __builtin_hypotl(__x, __y); }
+
+ template<typename _Tp, typename _Up>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+ hypot(_Tp __x, _Up __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return hypot(__type(__x), __type(__y));
+ }
+
+ inline int
+ ilogb(float __x)
+ { return __builtin_ilogbf(__x); }
+
+ inline int
+ ilogb(long double __x)
+ { return __builtin_ilogbl(__x); }
+
+ template<typename _Tp>
+ inline int
+ ilogb(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return ilogb(__type(__x));
+ }
+
+ using std::ldexp;
+
+ inline float
+ lgamma(float __x)
+ { return __builtin_lgammaf(__x); }
+
+ inline long double
+ lgamma(long double __x)
+ { return __builtin_lgammal(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ lgamma(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return lgamma(__type(__x));
+ }
+
+ inline long long
+ llrint(float __x)
+ { return __builtin_llrintf(__x); }
+
+ inline long long
+ llrint(long double __x)
+ { return __builtin_llrintl(__x); }
+
+ template<typename _Tp>
+ inline long long
+ llrint(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return llrint(__type(__x));
+ }
+
+ inline long long
+ llround(float __x)
+ { return __builtin_llroundf(__x); }
+
+ inline long long
+ llround(long double __x)
+ { return __builtin_llroundl(__x); }
+
+ template<typename _Tp>
+ inline long long
+ llround(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return llround(__type(__x));
+ }
+
+ using std::log;
+ using std::log10;
+
+ inline float
+ log1p(float __x)
+ { return __builtin_log1pf(__x); }
+
+ inline long double
+ log1p(long double __x)
+ { return __builtin_log1pl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ log1p(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return log1p(__type(__x));
+ }
+
+ // DR 568.
+ inline float
+ log2(float __x)
+ { return __builtin_log2f(__x); }
+
+ inline long double
+ log2(long double __x)
+ { return __builtin_log2l(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ log2(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return log2(__type(__x));
+ }
+
+ inline float
+ logb(float __x)
+ { return __builtin_logbf(__x); }
+
+ inline long double
+ logb(long double __x)
+ { return __builtin_logbl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ logb(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return logb(__type(__x));
+ }
+
+ inline long
+ lrint(float __x)
+ { return __builtin_lrintf(__x); }
+
+ inline long
+ lrint(long double __x)
+ { return __builtin_lrintl(__x); }
+
+ template<typename _Tp>
+ inline long
+ lrint(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return lrint(__type(__x));
+ }
+
+ inline long
+ lround(float __x)
+ { return __builtin_lroundf(__x); }
+
+ inline long
+ lround(long double __x)
+ { return __builtin_lroundl(__x); }
+
+ template<typename _Tp>
+ inline long
+ lround(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return lround(__type(__x));
+ }
+
+ inline float
+ nearbyint(float __x)
+ { return __builtin_nearbyintf(__x); }
+
+ inline long double
+ nearbyint(long double __x)
+ { return __builtin_nearbyintl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ nearbyint(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return nearbyint(__type(__x));
+ }
+
+ inline float
+ nextafter(float __x, float __y)
+ { return __builtin_nextafterf(__x, __y); }
+
+ inline long double
+ nextafter(long double __x, long double __y)
+ { return __builtin_nextafterl(__x, __y); }
+
+ template<typename _Tp, typename _Up>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+ nextafter(_Tp __x, _Up __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return nextafter(__type(__x), __type(__y));
+ }
+
+ inline float
+ nexttoward(float __x, long double __y)
+ { return __builtin_nexttowardf(__x, __y); }
+
+ inline long double
+ nexttoward(long double __x, long double __y)
+ { return __builtin_nexttowardl(__x, __y); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ nexttoward(_Tp __x, long double __y)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return nexttoward(__type(__x), __y);
+ }
+
+ // DR 550. What should the return type of pow(float,int) be?
+ // NB: C++0x and TR1 != C++03.
+ // using std::pow;
+
+ inline float
+ remainder(float __x, float __y)
+ { return __builtin_remainderf(__x, __y); }
+
+ inline long double
+ remainder(long double __x, long double __y)
+ { return __builtin_remainderl(__x, __y); }
+
+ template<typename _Tp, typename _Up>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+ remainder(_Tp __x, _Up __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return remainder(__type(__x), __type(__y));
+ }
+
+ inline float
+ remquo(float __x, float __y, int* __pquo)
+ { return __builtin_remquof(__x, __y, __pquo); }
+
+ inline long double
+ remquo(long double __x, long double __y, int* __pquo)
+ { return __builtin_remquol(__x, __y, __pquo); }
+
+ template<typename _Tp, typename _Up>
+ inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+ remquo(_Tp __x, _Up __y, int* __pquo)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return remquo(__type(__x), __type(__y), __pquo);
+ }
+
+ inline float
+ rint(float __x)
+ { return __builtin_rintf(__x); }
+
+ inline long double
+ rint(long double __x)
+ { return __builtin_rintl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ rint(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return rint(__type(__x));
+ }
+
+ inline float
+ round(float __x)
+ { return __builtin_roundf(__x); }
+
+ inline long double
+ round(long double __x)
+ { return __builtin_roundl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ round(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return round(__type(__x));
+ }
+
+ inline float
+ scalbln(float __x, long __ex)
+ { return __builtin_scalblnf(__x, __ex); }
+
+ inline long double
+ scalbln(long double __x, long __ex)
+ { return __builtin_scalblnl(__x, __ex); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ scalbln(_Tp __x, long __ex)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return scalbln(__type(__x), __ex);
+ }
+
+ inline float
+ scalbn(float __x, int __ex)
+ { return __builtin_scalbnf(__x, __ex); }
+
+ inline long double
+ scalbn(long double __x, int __ex)
+ { return __builtin_scalbnl(__x, __ex); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ scalbn(_Tp __x, int __ex)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return scalbn(__type(__x), __ex);
+ }
+
+ using std::sin;
+ using std::sinh;
+ using std::sqrt;
+ using std::tan;
+ using std::tanh;
+
+ inline float
+ tgamma(float __x)
+ { return __builtin_tgammaf(__x); }
+
+ inline long double
+ tgamma(long double __x)
+ { return __builtin_tgammal(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ tgamma(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return tgamma(__type(__x));
+ }
+
+ inline float
+ trunc(float __x)
+ { return __builtin_truncf(__x); }
+
+ inline long double
+ trunc(long double __x)
+ { return __builtin_truncl(__x); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ trunc(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return trunc(__type(__x));
+ }
+
+#endif
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/complex b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/complex
new file mode 100644
index 0000000..615fe18
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/complex
@@ -0,0 +1,370 @@
+// TR1 complex -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/complex
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ /**
+ * @addtogroup complex_numbers
+ * @{
+ */
+
+ // Forward declarations.
+ template<typename _Tp> std::complex<_Tp> acos(const std::complex<_Tp>&);
+ template<typename _Tp> std::complex<_Tp> asin(const std::complex<_Tp>&);
+ template<typename _Tp> std::complex<_Tp> atan(const std::complex<_Tp>&);
+
+ template<typename _Tp> std::complex<_Tp> acosh(const std::complex<_Tp>&);
+ template<typename _Tp> std::complex<_Tp> asinh(const std::complex<_Tp>&);
+ template<typename _Tp> std::complex<_Tp> atanh(const std::complex<_Tp>&);
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ // DR 595.
+ template<typename _Tp> _Tp fabs(const std::complex<_Tp>&);
+#else
+ template<typename _Tp> std::complex<_Tp> fabs(const std::complex<_Tp>&);
+#endif
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ __complex_acos(const std::complex<_Tp>& __z)
+ {
+ const std::complex<_Tp> __t = std::_GLIBCXX_TR1 asin(__z);
+ const _Tp __pi_2 = 1.5707963267948966192313216916397514L;
+ return std::complex<_Tp>(__pi_2 - __t.real(), -__t.imag());
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX_TR1
+ inline __complex__ float
+ __complex_acos(__complex__ float __z)
+ { return __builtin_cacosf(__z); }
+
+ inline __complex__ double
+ __complex_acos(__complex__ double __z)
+ { return __builtin_cacos(__z); }
+
+ inline __complex__ long double
+ __complex_acos(const __complex__ long double& __z)
+ { return __builtin_cacosl(__z); }
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ acos(const std::complex<_Tp>& __z)
+ { return __complex_acos(__z.__rep()); }
+#else
+ /// acos(__z) [8.1.2].
+ // Effects: Behaves the same as C99 function cacos, defined
+ // in subclause 7.3.5.1.
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ acos(const std::complex<_Tp>& __z)
+ { return __complex_acos(__z); }
+#endif
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ __complex_asin(const std::complex<_Tp>& __z)
+ {
+ std::complex<_Tp> __t(-__z.imag(), __z.real());
+ __t = std::_GLIBCXX_TR1 asinh(__t);
+ return std::complex<_Tp>(__t.imag(), -__t.real());
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX_TR1
+ inline __complex__ float
+ __complex_asin(__complex__ float __z)
+ { return __builtin_casinf(__z); }
+
+ inline __complex__ double
+ __complex_asin(__complex__ double __z)
+ { return __builtin_casin(__z); }
+
+ inline __complex__ long double
+ __complex_asin(const __complex__ long double& __z)
+ { return __builtin_casinl(__z); }
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ asin(const std::complex<_Tp>& __z)
+ { return __complex_asin(__z.__rep()); }
+#else
+ /// asin(__z) [8.1.3].
+ // Effects: Behaves the same as C99 function casin, defined
+ // in subclause 7.3.5.2.
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ asin(const std::complex<_Tp>& __z)
+ { return __complex_asin(__z); }
+#endif
+
+ template<typename _Tp>
+ std::complex<_Tp>
+ __complex_atan(const std::complex<_Tp>& __z)
+ {
+ const _Tp __r2 = __z.real() * __z.real();
+ const _Tp __x = _Tp(1.0) - __r2 - __z.imag() * __z.imag();
+
+ _Tp __num = __z.imag() + _Tp(1.0);
+ _Tp __den = __z.imag() - _Tp(1.0);
+
+ __num = __r2 + __num * __num;
+ __den = __r2 + __den * __den;
+
+ return std::complex<_Tp>(_Tp(0.5) * atan2(_Tp(2.0) * __z.real(), __x),
+ _Tp(0.25) * log(__num / __den));
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX_TR1
+ inline __complex__ float
+ __complex_atan(__complex__ float __z)
+ { return __builtin_catanf(__z); }
+
+ inline __complex__ double
+ __complex_atan(__complex__ double __z)
+ { return __builtin_catan(__z); }
+
+ inline __complex__ long double
+ __complex_atan(const __complex__ long double& __z)
+ { return __builtin_catanl(__z); }
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ atan(const std::complex<_Tp>& __z)
+ { return __complex_atan(__z.__rep()); }
+#else
+ /// atan(__z) [8.1.4].
+ // Effects: Behaves the same as C99 function catan, defined
+ // in subclause 7.3.5.3.
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ atan(const std::complex<_Tp>& __z)
+ { return __complex_atan(__z); }
+#endif
+
+ template<typename _Tp>
+ std::complex<_Tp>
+ __complex_acosh(const std::complex<_Tp>& __z)
+ {
+ std::complex<_Tp> __t((__z.real() - __z.imag())
+ * (__z.real() + __z.imag()) - _Tp(1.0),
+ _Tp(2.0) * __z.real() * __z.imag());
+ __t = std::sqrt(__t);
+
+ return std::log(__t + __z);
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX_TR1
+ inline __complex__ float
+ __complex_acosh(__complex__ float __z)
+ { return __builtin_cacoshf(__z); }
+
+ inline __complex__ double
+ __complex_acosh(__complex__ double __z)
+ { return __builtin_cacosh(__z); }
+
+ inline __complex__ long double
+ __complex_acosh(const __complex__ long double& __z)
+ { return __builtin_cacoshl(__z); }
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ acosh(const std::complex<_Tp>& __z)
+ { return __complex_acosh(__z.__rep()); }
+#else
+ /// acosh(__z) [8.1.5].
+ // Effects: Behaves the same as C99 function cacosh, defined
+ // in subclause 7.3.6.1.
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ acosh(const std::complex<_Tp>& __z)
+ { return __complex_acosh(__z); }
+#endif
+
+ template<typename _Tp>
+ std::complex<_Tp>
+ __complex_asinh(const std::complex<_Tp>& __z)
+ {
+ std::complex<_Tp> __t((__z.real() - __z.imag())
+ * (__z.real() + __z.imag()) + _Tp(1.0),
+ _Tp(2.0) * __z.real() * __z.imag());
+ __t = std::sqrt(__t);
+
+ return std::log(__t + __z);
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX_TR1
+ inline __complex__ float
+ __complex_asinh(__complex__ float __z)
+ { return __builtin_casinhf(__z); }
+
+ inline __complex__ double
+ __complex_asinh(__complex__ double __z)
+ { return __builtin_casinh(__z); }
+
+ inline __complex__ long double
+ __complex_asinh(const __complex__ long double& __z)
+ { return __builtin_casinhl(__z); }
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ asinh(const std::complex<_Tp>& __z)
+ { return __complex_asinh(__z.__rep()); }
+#else
+ /// asinh(__z) [8.1.6].
+ // Effects: Behaves the same as C99 function casin, defined
+ // in subclause 7.3.6.2.
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ asinh(const std::complex<_Tp>& __z)
+ { return __complex_asinh(__z); }
+#endif
+
+ template<typename _Tp>
+ std::complex<_Tp>
+ __complex_atanh(const std::complex<_Tp>& __z)
+ {
+ const _Tp __i2 = __z.imag() * __z.imag();
+ const _Tp __x = _Tp(1.0) - __i2 - __z.real() * __z.real();
+
+ _Tp __num = _Tp(1.0) + __z.real();
+ _Tp __den = _Tp(1.0) - __z.real();
+
+ __num = __i2 + __num * __num;
+ __den = __i2 + __den * __den;
+
+ return std::complex<_Tp>(_Tp(0.25) * (log(__num) - log(__den)),
+ _Tp(0.5) * atan2(_Tp(2.0) * __z.imag(), __x));
+ }
+
+#if _GLIBCXX_USE_C99_COMPLEX_TR1
+ inline __complex__ float
+ __complex_atanh(__complex__ float __z)
+ { return __builtin_catanhf(__z); }
+
+ inline __complex__ double
+ __complex_atanh(__complex__ double __z)
+ { return __builtin_catanh(__z); }
+
+ inline __complex__ long double
+ __complex_atanh(const __complex__ long double& __z)
+ { return __builtin_catanhl(__z); }
+
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ atanh(const std::complex<_Tp>& __z)
+ { return __complex_atanh(__z.__rep()); }
+#else
+ /// atanh(__z) [8.1.7].
+ // Effects: Behaves the same as C99 function catanh, defined
+ // in subclause 7.3.6.3.
+ template<typename _Tp>
+ inline std::complex<_Tp>
+ atanh(const std::complex<_Tp>& __z)
+ { return __complex_atanh(__z); }
+#endif
+
+ template<typename _Tp>
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ inline _Tp
+#else
+ inline std::complex<_Tp>
+#endif
+ /// fabs(__z) [8.1.8].
+ // Effects: Behaves the same as C99 function cabs, defined
+ // in subclause 7.3.8.1.
+ fabs(const std::complex<_Tp>& __z)
+ { return std::abs(__z); }
+
+ /// Additional overloads [8.1.9].
+#if (defined(_GLIBCXX_INCLUDE_AS_CXX0X) \
+ || (defined(_GLIBCXX_INCLUDE_AS_TR1) \
+ && !defined(__GXX_EXPERIMENTAL_CXX0X__)))
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ arg(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return std::arg(std::complex<__type>(__x));
+ }
+
+ template<typename _Tp>
+ inline std::complex<typename __gnu_cxx::__promote<_Tp>::__type>
+ conj(_Tp __x)
+ { return __x; }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ imag(_Tp)
+ { return _Tp(); }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ norm(_Tp __x)
+ {
+ typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
+ return __type(__x) * __type(__x);
+ }
+
+ template<typename _Tp>
+ inline typename __gnu_cxx::__promote<_Tp>::__type
+ real(_Tp __x)
+ { return __x; }
+
+#endif
+
+ template<typename _Tp, typename _Up>
+ inline std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type>
+ pow(const std::complex<_Tp>& __x, const _Up& __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return std::pow(std::complex<__type>(__x), __type(__y));
+ }
+
+ template<typename _Tp, typename _Up>
+ inline std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type>
+ pow(const _Tp& __x, const std::complex<_Up>& __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return std::pow(__type(__x), std::complex<__type>(__y));
+ }
+
+ template<typename _Tp, typename _Up>
+ inline std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type>
+ pow(const std::complex<_Tp>& __x, const std::complex<_Up>& __y)
+ {
+ typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+ return std::pow(std::complex<__type>(__x),
+ std::complex<__type>(__y));
+ }
+
+ // @} group complex_numbers
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cstdint b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cstdint
new file mode 100644
index 0000000..d140388
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cstdint
@@ -0,0 +1,75 @@
+// TR1 cstdint -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/cstdint
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#if _GLIBCXX_USE_C99_STDINT_TR1
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ using ::int8_t;
+ using ::int16_t;
+ using ::int32_t;
+ using ::int64_t;
+
+ using ::int_fast8_t;
+ using ::int_fast16_t;
+ using ::int_fast32_t;
+ using ::int_fast64_t;
+
+ using ::int_least8_t;
+ using ::int_least16_t;
+ using ::int_least32_t;
+ using ::int_least64_t;
+
+ using ::intmax_t;
+ using ::intptr_t;
+
+ using ::uint8_t;
+ using ::uint16_t;
+ using ::uint32_t;
+ using ::uint64_t;
+
+ using ::uint_fast8_t;
+ using ::uint_fast16_t;
+ using ::uint_fast32_t;
+ using ::uint_fast64_t;
+
+ using ::uint_least8_t;
+ using ::uint_least16_t;
+ using ::uint_least32_t;
+ using ::uint_least64_t;
+
+ using ::uintmax_t;
+ using ::uintptr_t;
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cstdio b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cstdio
new file mode 100644
index 0000000..8b100cc
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cstdio
@@ -0,0 +1,44 @@
+// TR1 cstdio -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/cstdio
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+#if _GLIBCXX_USE_C99
+ using std::snprintf;
+ using std::vsnprintf;
+
+ using std::vfscanf;
+ using std::vscanf;
+ using std::vsscanf;
+#endif
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cstdlib b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cstdlib
new file mode 100644
index 0000000..e9a590f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cstdlib
@@ -0,0 +1,65 @@
+// TR1 cstdlib -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/cstdlib
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#if _GLIBCXX_HOSTED
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+#if _GLIBCXX_USE_C99
+
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+ // types
+ using std::lldiv_t;
+
+ // functions
+ using std::llabs;
+ using std::lldiv;
+#endif
+
+ using std::atoll;
+ using std::strtoll;
+ using std::strtoull;
+
+ using std::strtof;
+ using std::strtold;
+
+ // overloads
+ using std::abs;
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+ using std::div;
+#endif
+
+#endif
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cwchar b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cwchar
new file mode 100644
index 0000000..2a9004d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cwchar
@@ -0,0 +1,58 @@
+// TR1 cwchar -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/cwchar
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#if _GLIBCXX_USE_WCHAR_T
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+#if _GLIBCXX_HAVE_WCSTOF
+ using std::wcstof;
+#endif
+#if _GLIBCXX_HAVE_VFWSCANF
+ using std::vfwscanf;
+#endif
+#if _GLIBCXX_HAVE_VSWSCANF
+ using std::vswscanf;
+#endif
+#if _GLIBCXX_HAVE_VWSCANF
+ using std::vwscanf;
+#endif
+
+#if _GLIBCXX_USE_C99
+ using std::wcstold;
+ using std::wcstoll;
+ using std::wcstoull;
+#endif
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cwctype b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cwctype
new file mode 100644
index 0000000..3135d36
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/cwctype
@@ -0,0 +1,43 @@
+// TR1 cwctype -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/cwctype
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#if _GLIBCXX_USE_WCHAR_T
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+#if _GLIBCXX_HAVE_ISWBLANK
+ using std::iswblank;
+#endif
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
+
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/functional b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/functional
new file mode 100644
index 0000000..7e6eaeb
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/functional
@@ -0,0 +1,2130 @@
+// TR1 functional header -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/functional
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ template<typename _MemberPointer>
+ class _Mem_fn;
+
+ /**
+ * Actual implementation of _Has_result_type, which uses SFINAE to
+ * determine if the type _Tp has a publicly-accessible member type
+ * result_type.
+ */
+ template<typename _Tp>
+ class _Has_result_type_helper : __sfinae_types
+ {
+ template<typename _Up>
+ struct _Wrap_type
+ { };
+
+ template<typename _Up>
+ static __one __test(_Wrap_type<typename _Up::result_type>*);
+
+ template<typename _Up>
+ static __two __test(...);
+
+ public:
+ static const bool value = sizeof(__test<_Tp>(0)) == 1;
+ };
+
+ template<typename _Tp>
+ struct _Has_result_type
+ : integral_constant<bool,
+ _Has_result_type_helper<typename remove_cv<_Tp>::type>::value>
+ { };
+
+ /**
+ *
+ */
+ /// If we have found a result_type, extract it.
+ template<bool _Has_result_type, typename _Functor>
+ struct _Maybe_get_result_type
+ { };
+
+ template<typename _Functor>
+ struct _Maybe_get_result_type<true, _Functor>
+ {
+ typedef typename _Functor::result_type result_type;
+ };
+
+ /**
+ * Base class for any function object that has a weak result type, as
+ * defined in 3.3/3 of TR1.
+ */
+ template<typename _Functor>
+ struct _Weak_result_type_impl
+ : _Maybe_get_result_type<_Has_result_type<_Functor>::value, _Functor>
+ {
+ };
+
+ /// Retrieve the result type for a function type.
+ template<typename _Res, typename... _ArgTypes>
+ struct _Weak_result_type_impl<_Res(_ArgTypes...)>
+ {
+ typedef _Res result_type;
+ };
+
+ /// Retrieve the result type for a function reference.
+ template<typename _Res, typename... _ArgTypes>
+ struct _Weak_result_type_impl<_Res(&)(_ArgTypes...)>
+ {
+ typedef _Res result_type;
+ };
+
+ /// Retrieve the result type for a function pointer.
+ template<typename _Res, typename... _ArgTypes>
+ struct _Weak_result_type_impl<_Res(*)(_ArgTypes...)>
+ {
+ typedef _Res result_type;
+ };
+
+ /// Retrieve result type for a member function pointer.
+ template<typename _Res, typename _Class, typename... _ArgTypes>
+ struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...)>
+ {
+ typedef _Res result_type;
+ };
+
+ /// Retrieve result type for a const member function pointer.
+ template<typename _Res, typename _Class, typename... _ArgTypes>
+ struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...) const>
+ {
+ typedef _Res result_type;
+ };
+
+ /// Retrieve result type for a volatile member function pointer.
+ template<typename _Res, typename _Class, typename... _ArgTypes>
+ struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...) volatile>
+ {
+ typedef _Res result_type;
+ };
+
+ /// Retrieve result type for a const volatile member function pointer.
+ template<typename _Res, typename _Class, typename... _ArgTypes>
+ struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...)const volatile>
+ {
+ typedef _Res result_type;
+ };
+
+ /**
+ * Strip top-level cv-qualifiers from the function object and let
+ * _Weak_result_type_impl perform the real work.
+ */
+ template<typename _Functor>
+ struct _Weak_result_type
+ : _Weak_result_type_impl<typename remove_cv<_Functor>::type>
+ {
+ };
+
+ template<typename _Signature>
+ class result_of;
+
+ /**
+ * Actual implementation of result_of. When _Has_result_type is
+ * true, gets its result from _Weak_result_type. Otherwise, uses
+ * the function object's member template result to extract the
+ * result type.
+ */
+ template<bool _Has_result_type, typename _Signature>
+ struct _Result_of_impl;
+
+ // Handle member data pointers using _Mem_fn's logic
+ template<typename _Res, typename _Class, typename _T1>
+ struct _Result_of_impl<false, _Res _Class::*(_T1)>
+ {
+ typedef typename _Mem_fn<_Res _Class::*>
+ ::template _Result_type<_T1>::type type;
+ };
+
+ /**
+ * Determine whether we can determine a result type from @c Functor
+ * alone.
+ */
+ template<typename _Functor, typename... _ArgTypes>
+ class result_of<_Functor(_ArgTypes...)>
+ : public _Result_of_impl<
+ _Has_result_type<_Weak_result_type<_Functor> >::value,
+ _Functor(_ArgTypes...)>
+ {
+ };
+
+ /// We already know the result type for @c Functor; use it.
+ template<typename _Functor, typename... _ArgTypes>
+ struct _Result_of_impl<true, _Functor(_ArgTypes...)>
+ {
+ typedef typename _Weak_result_type<_Functor>::result_type type;
+ };
+
+ /**
+ * We need to compute the result type for this invocation the hard
+ * way.
+ */
+ template<typename _Functor, typename... _ArgTypes>
+ struct _Result_of_impl<false, _Functor(_ArgTypes...)>
+ {
+ typedef typename _Functor
+ ::template result<_Functor(_ArgTypes...)>::type type;
+ };
+
+ /**
+ * It is unsafe to access ::result when there are zero arguments, so we
+ * return @c void instead.
+ */
+ template<typename _Functor>
+ struct _Result_of_impl<false, _Functor()>
+ {
+ typedef void type;
+ };
+
+ /// Determines if the type _Tp derives from unary_function.
+ template<typename _Tp>
+ struct _Derives_from_unary_function : __sfinae_types
+ {
+ private:
+ template<typename _T1, typename _Res>
+ static __one __test(const volatile unary_function<_T1, _Res>*);
+
+ // It's tempting to change "..." to const volatile void*, but
+ // that fails when _Tp is a function type.
+ static __two __test(...);
+
+ public:
+ static const bool value = sizeof(__test((_Tp*)0)) == 1;
+ };
+
+ /// Determines if the type _Tp derives from binary_function.
+ template<typename _Tp>
+ struct _Derives_from_binary_function : __sfinae_types
+ {
+ private:
+ template<typename _T1, typename _T2, typename _Res>
+ static __one __test(const volatile binary_function<_T1, _T2, _Res>*);
+
+ // It's tempting to change "..." to const volatile void*, but
+ // that fails when _Tp is a function type.
+ static __two __test(...);
+
+ public:
+ static const bool value = sizeof(__test((_Tp*)0)) == 1;
+ };
+
+ /// Turns a function type into a function pointer type
+ template<typename _Tp, bool _IsFunctionType = is_function<_Tp>::value>
+ struct _Function_to_function_pointer
+ {
+ typedef _Tp type;
+ };
+
+ template<typename _Tp>
+ struct _Function_to_function_pointer<_Tp, true>
+ {
+ typedef _Tp* type;
+ };
+
+ /**
+ * Invoke a function object, which may be either a member pointer or a
+ * function object. The first parameter will tell which.
+ */
+ template<typename _Functor, typename... _Args>
+ inline
+ typename __gnu_cxx::__enable_if<
+ (!is_member_pointer<_Functor>::value
+ && !is_function<_Functor>::value
+ && !is_function<typename remove_pointer<_Functor>::type>::value),
+ typename result_of<_Functor(_Args...)>::type
+ >::__type
+ __invoke(_Functor& __f, _Args&... __args)
+ {
+ return __f(__args...);
+ }
+
+ template<typename _Functor, typename... _Args>
+ inline
+ typename __gnu_cxx::__enable_if<
+ (is_member_pointer<_Functor>::value
+ && !is_function<_Functor>::value
+ && !is_function<typename remove_pointer<_Functor>::type>::value),
+ typename result_of<_Functor(_Args...)>::type
+ >::__type
+ __invoke(_Functor& __f, _Args&... __args)
+ {
+ return mem_fn(__f)(__args...);
+ }
+
+ // To pick up function references (that will become function pointers)
+ template<typename _Functor, typename... _Args>
+ inline
+ typename __gnu_cxx::__enable_if<
+ (is_pointer<_Functor>::value
+ && is_function<typename remove_pointer<_Functor>::type>::value),
+ typename result_of<_Functor(_Args...)>::type
+ >::__type
+ __invoke(_Functor __f, _Args&... __args)
+ {
+ return __f(__args...);
+ }
+
+ /**
+ * Knowing which of unary_function and binary_function _Tp derives
+ * from, derives from the same and ensures that reference_wrapper
+ * will have a weak result type. See cases below.
+ */
+ template<bool _Unary, bool _Binary, typename _Tp>
+ struct _Reference_wrapper_base_impl;
+
+ // Not a unary_function or binary_function, so try a weak result type.
+ template<typename _Tp>
+ struct _Reference_wrapper_base_impl<false, false, _Tp>
+ : _Weak_result_type<_Tp>
+ { };
+
+ // unary_function but not binary_function
+ template<typename _Tp>
+ struct _Reference_wrapper_base_impl<true, false, _Tp>
+ : unary_function<typename _Tp::argument_type,
+ typename _Tp::result_type>
+ { };
+
+ // binary_function but not unary_function
+ template<typename _Tp>
+ struct _Reference_wrapper_base_impl<false, true, _Tp>
+ : binary_function<typename _Tp::first_argument_type,
+ typename _Tp::second_argument_type,
+ typename _Tp::result_type>
+ { };
+
+ // Both unary_function and binary_function. Import result_type to
+ // avoid conflicts.
+ template<typename _Tp>
+ struct _Reference_wrapper_base_impl<true, true, _Tp>
+ : unary_function<typename _Tp::argument_type,
+ typename _Tp::result_type>,
+ binary_function<typename _Tp::first_argument_type,
+ typename _Tp::second_argument_type,
+ typename _Tp::result_type>
+ {
+ typedef typename _Tp::result_type result_type;
+ };
+
+ /**
+ * Derives from unary_function or binary_function when it
+ * can. Specializations handle all of the easy cases. The primary
+ * template determines what to do with a class type, which may
+ * derive from both unary_function and binary_function.
+ */
+ template<typename _Tp>
+ struct _Reference_wrapper_base
+ : _Reference_wrapper_base_impl<
+ _Derives_from_unary_function<_Tp>::value,
+ _Derives_from_binary_function<_Tp>::value,
+ _Tp>
+ { };
+
+ // - a function type (unary)
+ template<typename _Res, typename _T1>
+ struct _Reference_wrapper_base<_Res(_T1)>
+ : unary_function<_T1, _Res>
+ { };
+
+ // - a function type (binary)
+ template<typename _Res, typename _T1, typename _T2>
+ struct _Reference_wrapper_base<_Res(_T1, _T2)>
+ : binary_function<_T1, _T2, _Res>
+ { };
+
+ // - a function pointer type (unary)
+ template<typename _Res, typename _T1>
+ struct _Reference_wrapper_base<_Res(*)(_T1)>
+ : unary_function<_T1, _Res>
+ { };
+
+ // - a function pointer type (binary)
+ template<typename _Res, typename _T1, typename _T2>
+ struct _Reference_wrapper_base<_Res(*)(_T1, _T2)>
+ : binary_function<_T1, _T2, _Res>
+ { };
+
+ // - a pointer to member function type (unary, no qualifiers)
+ template<typename _Res, typename _T1>
+ struct _Reference_wrapper_base<_Res (_T1::*)()>
+ : unary_function<_T1*, _Res>
+ { };
+
+ // - a pointer to member function type (binary, no qualifiers)
+ template<typename _Res, typename _T1, typename _T2>
+ struct _Reference_wrapper_base<_Res (_T1::*)(_T2)>
+ : binary_function<_T1*, _T2, _Res>
+ { };
+
+ // - a pointer to member function type (unary, const)
+ template<typename _Res, typename _T1>
+ struct _Reference_wrapper_base<_Res (_T1::*)() const>
+ : unary_function<const _T1*, _Res>
+ { };
+
+ // - a pointer to member function type (binary, const)
+ template<typename _Res, typename _T1, typename _T2>
+ struct _Reference_wrapper_base<_Res (_T1::*)(_T2) const>
+ : binary_function<const _T1*, _T2, _Res>
+ { };
+
+ // - a pointer to member function type (unary, volatile)
+ template<typename _Res, typename _T1>
+ struct _Reference_wrapper_base<_Res (_T1::*)() volatile>
+ : unary_function<volatile _T1*, _Res>
+ { };
+
+ // - a pointer to member function type (binary, volatile)
+ template<typename _Res, typename _T1, typename _T2>
+ struct _Reference_wrapper_base<_Res (_T1::*)(_T2) volatile>
+ : binary_function<volatile _T1*, _T2, _Res>
+ { };
+
+ // - a pointer to member function type (unary, const volatile)
+ template<typename _Res, typename _T1>
+ struct _Reference_wrapper_base<_Res (_T1::*)() const volatile>
+ : unary_function<const volatile _T1*, _Res>
+ { };
+
+ // - a pointer to member function type (binary, const volatile)
+ template<typename _Res, typename _T1, typename _T2>
+ struct _Reference_wrapper_base<_Res (_T1::*)(_T2) const volatile>
+ : binary_function<const volatile _T1*, _T2, _Res>
+ { };
+
+ /// reference_wrapper
+ template<typename _Tp>
+ class reference_wrapper
+ : public _Reference_wrapper_base<typename remove_cv<_Tp>::type>
+ {
+ // If _Tp is a function type, we can't form result_of<_Tp(...)>,
+ // so turn it into a function pointer type.
+ typedef typename _Function_to_function_pointer<_Tp>::type
+ _M_func_type;
+
+ _Tp* _M_data;
+ public:
+ typedef _Tp type;
+
+ explicit
+ reference_wrapper(_Tp& __indata): _M_data(&__indata)
+ { }
+
+ reference_wrapper(const reference_wrapper<_Tp>& __inref):
+ _M_data(__inref._M_data)
+ { }
+
+ reference_wrapper&
+ operator=(const reference_wrapper<_Tp>& __inref)
+ {
+ _M_data = __inref._M_data;
+ return *this;
+ }
+
+ operator _Tp&() const
+ { return this->get(); }
+
+ _Tp&
+ get() const
+ { return *_M_data; }
+
+ template<typename... _Args>
+ typename result_of<_M_func_type(_Args...)>::type
+ operator()(_Args&... __args) const
+ {
+ return __invoke(get(), __args...);
+ }
+ };
+
+
+ // Denotes a reference should be taken to a variable.
+ template<typename _Tp>
+ inline reference_wrapper<_Tp>
+ ref(_Tp& __t)
+ { return reference_wrapper<_Tp>(__t); }
+
+ // Denotes a const reference should be taken to a variable.
+ template<typename _Tp>
+ inline reference_wrapper<const _Tp>
+ cref(const _Tp& __t)
+ { return reference_wrapper<const _Tp>(__t); }
+
+ template<typename _Tp>
+ inline reference_wrapper<_Tp>
+ ref(reference_wrapper<_Tp> __t)
+ { return ref(__t.get()); }
+
+ template<typename _Tp>
+ inline reference_wrapper<const _Tp>
+ cref(reference_wrapper<_Tp> __t)
+ { return cref(__t.get()); }
+
+ template<typename _Tp, bool>
+ struct _Mem_fn_const_or_non
+ {
+ typedef const _Tp& type;
+ };
+
+ template<typename _Tp>
+ struct _Mem_fn_const_or_non<_Tp, false>
+ {
+ typedef _Tp& type;
+ };
+
+ /**
+ * Derives from @c unary_function or @c binary_function, or perhaps
+ * nothing, depending on the number of arguments provided. The
+ * primary template is the basis case, which derives nothing.
+ */
+ template<typename _Res, typename... _ArgTypes>
+ struct _Maybe_unary_or_binary_function { };
+
+ /// Derives from @c unary_function, as appropriate.
+ template<typename _Res, typename _T1>
+ struct _Maybe_unary_or_binary_function<_Res, _T1>
+ : std::unary_function<_T1, _Res> { };
+
+ /// Derives from @c binary_function, as appropriate.
+ template<typename _Res, typename _T1, typename _T2>
+ struct _Maybe_unary_or_binary_function<_Res, _T1, _T2>
+ : std::binary_function<_T1, _T2, _Res> { };
+
+ /// Implementation of @c mem_fn for member function pointers.
+ template<typename _Res, typename _Class, typename... _ArgTypes>
+ class _Mem_fn<_Res (_Class::*)(_ArgTypes...)>
+ : public _Maybe_unary_or_binary_function<_Res, _Class*, _ArgTypes...>
+ {
+ typedef _Res (_Class::*_Functor)(_ArgTypes...);
+
+ template<typename _Tp>
+ _Res
+ _M_call(_Tp& __object, const volatile _Class *,
+ _ArgTypes... __args) const
+ { return (__object.*__pmf)(__args...); }
+
+ template<typename _Tp>
+ _Res
+ _M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const
+ { return ((*__ptr).*__pmf)(__args...); }
+
+ public:
+ typedef _Res result_type;
+
+ explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { }
+
+ // Handle objects
+ _Res
+ operator()(_Class& __object, _ArgTypes... __args) const
+ { return (__object.*__pmf)(__args...); }
+
+ // Handle pointers
+ _Res
+ operator()(_Class* __object, _ArgTypes... __args) const
+ { return (__object->*__pmf)(__args...); }
+
+ // Handle smart pointers, references and pointers to derived
+ template<typename _Tp>
+ _Res
+ operator()(_Tp& __object, _ArgTypes... __args) const
+ { return _M_call(__object, &__object, __args...); }
+
+ private:
+ _Functor __pmf;
+ };
+
+ /// Implementation of @c mem_fn for const member function pointers.
+ template<typename _Res, typename _Class, typename... _ArgTypes>
+ class _Mem_fn<_Res (_Class::*)(_ArgTypes...) const>
+ : public _Maybe_unary_or_binary_function<_Res, const _Class*,
+ _ArgTypes...>
+ {
+ typedef _Res (_Class::*_Functor)(_ArgTypes...) const;
+
+ template<typename _Tp>
+ _Res
+ _M_call(_Tp& __object, const volatile _Class *,
+ _ArgTypes... __args) const
+ { return (__object.*__pmf)(__args...); }
+
+ template<typename _Tp>
+ _Res
+ _M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const
+ { return ((*__ptr).*__pmf)(__args...); }
+
+ public:
+ typedef _Res result_type;
+
+ explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { }
+
+ // Handle objects
+ _Res
+ operator()(const _Class& __object, _ArgTypes... __args) const
+ { return (__object.*__pmf)(__args...); }
+
+ // Handle pointers
+ _Res
+ operator()(const _Class* __object, _ArgTypes... __args) const
+ { return (__object->*__pmf)(__args...); }
+
+ // Handle smart pointers, references and pointers to derived
+ template<typename _Tp>
+ _Res operator()(_Tp& __object, _ArgTypes... __args) const
+ { return _M_call(__object, &__object, __args...); }
+
+ private:
+ _Functor __pmf;
+ };
+
+ /// Implementation of @c mem_fn for volatile member function pointers.
+ template<typename _Res, typename _Class, typename... _ArgTypes>
+ class _Mem_fn<_Res (_Class::*)(_ArgTypes...) volatile>
+ : public _Maybe_unary_or_binary_function<_Res, volatile _Class*,
+ _ArgTypes...>
+ {
+ typedef _Res (_Class::*_Functor)(_ArgTypes...) volatile;
+
+ template<typename _Tp>
+ _Res
+ _M_call(_Tp& __object, const volatile _Class *,
+ _ArgTypes... __args) const
+ { return (__object.*__pmf)(__args...); }
+
+ template<typename _Tp>
+ _Res
+ _M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const
+ { return ((*__ptr).*__pmf)(__args...); }
+
+ public:
+ typedef _Res result_type;
+
+ explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { }
+
+ // Handle objects
+ _Res
+ operator()(volatile _Class& __object, _ArgTypes... __args) const
+ { return (__object.*__pmf)(__args...); }
+
+ // Handle pointers
+ _Res
+ operator()(volatile _Class* __object, _ArgTypes... __args) const
+ { return (__object->*__pmf)(__args...); }
+
+ // Handle smart pointers, references and pointers to derived
+ template<typename _Tp>
+ _Res
+ operator()(_Tp& __object, _ArgTypes... __args) const
+ { return _M_call(__object, &__object, __args...); }
+
+ private:
+ _Functor __pmf;
+ };
+
+ /// Implementation of @c mem_fn for const volatile member function pointers.
+ template<typename _Res, typename _Class, typename... _ArgTypes>
+ class _Mem_fn<_Res (_Class::*)(_ArgTypes...) const volatile>
+ : public _Maybe_unary_or_binary_function<_Res, const volatile _Class*,
+ _ArgTypes...>
+ {
+ typedef _Res (_Class::*_Functor)(_ArgTypes...) const volatile;
+
+ template<typename _Tp>
+ _Res
+ _M_call(_Tp& __object, const volatile _Class *,
+ _ArgTypes... __args) const
+ { return (__object.*__pmf)(__args...); }
+
+ template<typename _Tp>
+ _Res
+ _M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const
+ { return ((*__ptr).*__pmf)(__args...); }
+
+ public:
+ typedef _Res result_type;
+
+ explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { }
+
+ // Handle objects
+ _Res
+ operator()(const volatile _Class& __object, _ArgTypes... __args) const
+ { return (__object.*__pmf)(__args...); }
+
+ // Handle pointers
+ _Res
+ operator()(const volatile _Class* __object, _ArgTypes... __args) const
+ { return (__object->*__pmf)(__args...); }
+
+ // Handle smart pointers, references and pointers to derived
+ template<typename _Tp>
+ _Res operator()(_Tp& __object, _ArgTypes... __args) const
+ { return _M_call(__object, &__object, __args...); }
+
+ private:
+ _Functor __pmf;
+ };
+
+
+ template<typename _Res, typename _Class>
+ class _Mem_fn<_Res _Class::*>
+ {
+ // This bit of genius is due to Peter Dimov, improved slightly by
+ // Douglas Gregor.
+ template<typename _Tp>
+ _Res&
+ _M_call(_Tp& __object, _Class *) const
+ { return __object.*__pm; }
+
+ template<typename _Tp, typename _Up>
+ _Res&
+ _M_call(_Tp& __object, _Up * const *) const
+ { return (*__object).*__pm; }
+
+ template<typename _Tp, typename _Up>
+ const _Res&
+ _M_call(_Tp& __object, const _Up * const *) const
+ { return (*__object).*__pm; }
+
+ template<typename _Tp>
+ const _Res&
+ _M_call(_Tp& __object, const _Class *) const
+ { return __object.*__pm; }
+
+ template<typename _Tp>
+ const _Res&
+ _M_call(_Tp& __ptr, const volatile void*) const
+ { return (*__ptr).*__pm; }
+
+ template<typename _Tp> static _Tp& __get_ref();
+
+ template<typename _Tp>
+ static __sfinae_types::__one __check_const(_Tp&, _Class*);
+ template<typename _Tp, typename _Up>
+ static __sfinae_types::__one __check_const(_Tp&, _Up * const *);
+ template<typename _Tp, typename _Up>
+ static __sfinae_types::__two __check_const(_Tp&, const _Up * const *);
+ template<typename _Tp>
+ static __sfinae_types::__two __check_const(_Tp&, const _Class*);
+ template<typename _Tp>
+ static __sfinae_types::__two __check_const(_Tp&, const volatile void*);
+
+ public:
+ template<typename _Tp>
+ struct _Result_type
+ : _Mem_fn_const_or_non<_Res,
+ (sizeof(__sfinae_types::__two)
+ == sizeof(__check_const<_Tp>(__get_ref<_Tp>(), (_Tp*)0)))>
+ { };
+
+ template<typename _Signature>
+ struct result;
+
+ template<typename _CVMem, typename _Tp>
+ struct result<_CVMem(_Tp)>
+ : public _Result_type<_Tp> { };
+
+ template<typename _CVMem, typename _Tp>
+ struct result<_CVMem(_Tp&)>
+ : public _Result_type<_Tp> { };
+
+ explicit
+ _Mem_fn(_Res _Class::*__pm) : __pm(__pm) { }
+
+ // Handle objects
+ _Res&
+ operator()(_Class& __object) const
+ { return __object.*__pm; }
+
+ const _Res&
+ operator()(const _Class& __object) const
+ { return __object.*__pm; }
+
+ // Handle pointers
+ _Res&
+ operator()(_Class* __object) const
+ { return __object->*__pm; }
+
+ const _Res&
+ operator()(const _Class* __object) const
+ { return __object->*__pm; }
+
+ // Handle smart pointers and derived
+ template<typename _Tp>
+ typename _Result_type<_Tp>::type
+ operator()(_Tp& __unknown) const
+ { return _M_call(__unknown, &__unknown); }
+
+ private:
+ _Res _Class::*__pm;
+ };
+
+ /**
+ * @brief Returns a function object that forwards to the member
+ * pointer @a pm.
+ */
+ template<typename _Tp, typename _Class>
+ inline _Mem_fn<_Tp _Class::*>
+ mem_fn(_Tp _Class::* __pm)
+ {
+ return _Mem_fn<_Tp _Class::*>(__pm);
+ }
+
+ /**
+ * @brief Determines if the given type _Tp is a function object
+ * should be treated as a subexpression when evaluating calls to
+ * function objects returned by bind(). [TR1 3.6.1]
+ */
+ template<typename _Tp>
+ struct is_bind_expression
+ { static const bool value = false; };
+
+ template<typename _Tp>
+ const bool is_bind_expression<_Tp>::value;
+
+ /**
+ * @brief Determines if the given type _Tp is a placeholder in a
+ * bind() expression and, if so, which placeholder it is. [TR1 3.6.2]
+ */
+ template<typename _Tp>
+ struct is_placeholder
+ { static const int value = 0; };
+
+ template<typename _Tp>
+ const int is_placeholder<_Tp>::value;
+
+ /// The type of placeholder objects defined by libstdc++.
+ template<int _Num> struct _Placeholder { };
+
+ /** @namespace std::placeholders
+ * @brief ISO C++ 0x entities sub namespace for functional.
+ *
+ * Define a large number of placeholders. There is no way to
+ * simplify this with variadic templates, because we're introducing
+ * unique names for each.
+ */
+ namespace placeholders
+ {
+ namespace
+ {
+ _Placeholder<1> _1;
+ _Placeholder<2> _2;
+ _Placeholder<3> _3;
+ _Placeholder<4> _4;
+ _Placeholder<5> _5;
+ _Placeholder<6> _6;
+ _Placeholder<7> _7;
+ _Placeholder<8> _8;
+ _Placeholder<9> _9;
+ _Placeholder<10> _10;
+ _Placeholder<11> _11;
+ _Placeholder<12> _12;
+ _Placeholder<13> _13;
+ _Placeholder<14> _14;
+ _Placeholder<15> _15;
+ _Placeholder<16> _16;
+ _Placeholder<17> _17;
+ _Placeholder<18> _18;
+ _Placeholder<19> _19;
+ _Placeholder<20> _20;
+ _Placeholder<21> _21;
+ _Placeholder<22> _22;
+ _Placeholder<23> _23;
+ _Placeholder<24> _24;
+ _Placeholder<25> _25;
+ _Placeholder<26> _26;
+ _Placeholder<27> _27;
+ _Placeholder<28> _28;
+ _Placeholder<29> _29;
+ }
+ }
+
+ /**
+ * Partial specialization of is_placeholder that provides the placeholder
+ * number for the placeholder objects defined by libstdc++.
+ */
+ template<int _Num>
+ struct is_placeholder<_Placeholder<_Num> >
+ { static const int value = _Num; };
+
+ template<int _Num>
+ const int is_placeholder<_Placeholder<_Num> >::value;
+
+ /**
+ * Stores a tuple of indices. Used by bind() to extract the elements
+ * in a tuple.
+ */
+ template<int... _Indexes>
+ struct _Index_tuple { };
+
+ /// Builds an _Index_tuple<0, 1, 2, ..., _Num-1>.
+ template<std::size_t _Num, typename _Tuple = _Index_tuple<> >
+ struct _Build_index_tuple;
+
+ template<std::size_t _Num, int... _Indexes>
+ struct _Build_index_tuple<_Num, _Index_tuple<_Indexes...> >
+ : _Build_index_tuple<_Num - 1,
+ _Index_tuple<_Indexes..., sizeof...(_Indexes)> >
+ {
+ };
+
+ template<int... _Indexes>
+ struct _Build_index_tuple<0, _Index_tuple<_Indexes...> >
+ {
+ typedef _Index_tuple<_Indexes...> __type;
+ };
+
+ /**
+ * Used by _Safe_tuple_element to indicate that there is no tuple
+ * element at this position.
+ */
+ struct _No_tuple_element;
+
+ /**
+ * Implementation helper for _Safe_tuple_element. This primary
+ * template handles the case where it is safe to use @c
+ * tuple_element.
+ */
+ template<int __i, typename _Tuple, bool _IsSafe>
+ struct _Safe_tuple_element_impl
+ : tuple_element<__i, _Tuple> { };
+
+ /**
+ * Implementation helper for _Safe_tuple_element. This partial
+ * specialization handles the case where it is not safe to use @c
+ * tuple_element. We just return @c _No_tuple_element.
+ */
+ template<int __i, typename _Tuple>
+ struct _Safe_tuple_element_impl<__i, _Tuple, false>
+ {
+ typedef _No_tuple_element type;
+ };
+
+ /**
+ * Like tuple_element, but returns @c _No_tuple_element when
+ * tuple_element would return an error.
+ */
+ template<int __i, typename _Tuple>
+ struct _Safe_tuple_element
+ : _Safe_tuple_element_impl<__i, _Tuple,
+ (__i >= 0 && __i < tuple_size<_Tuple>::value)>
+ {
+ };
+
+ /**
+ * Maps an argument to bind() into an actual argument to the bound
+ * function object [TR1 3.6.3/5]. Only the first parameter should
+ * be specified: the rest are used to determine among the various
+ * implementations. Note that, although this class is a function
+ * object, it isn't entirely normal because it takes only two
+ * parameters regardless of the number of parameters passed to the
+ * bind expression. The first parameter is the bound argument and
+ * the second parameter is a tuple containing references to the
+ * rest of the arguments.
+ */
+ template<typename _Arg,
+ bool _IsBindExp = is_bind_expression<_Arg>::value,
+ bool _IsPlaceholder = (is_placeholder<_Arg>::value > 0)>
+ class _Mu;
+
+ /**
+ * If the argument is reference_wrapper<_Tp>, returns the
+ * underlying reference. [TR1 3.6.3/5 bullet 1]
+ */
+ template<typename _Tp>
+ class _Mu<reference_wrapper<_Tp>, false, false>
+ {
+ public:
+ typedef _Tp& result_type;
+
+ /* Note: This won't actually work for const volatile
+ * reference_wrappers, because reference_wrapper::get() is const
+ * but not volatile-qualified. This might be a defect in the TR.
+ */
+ template<typename _CVRef, typename _Tuple>
+ result_type
+ operator()(_CVRef& __arg, const _Tuple&) const volatile
+ { return __arg.get(); }
+ };
+
+ /**
+ * If the argument is a bind expression, we invoke the underlying
+ * function object with the same cv-qualifiers as we are given and
+ * pass along all of our arguments (unwrapped). [TR1 3.6.3/5 bullet 2]
+ */
+ template<typename _Arg>
+ class _Mu<_Arg, true, false>
+ {
+ public:
+ template<typename _Signature> class result;
+
+ // Determine the result type when we pass the arguments along. This
+ // involves passing along the cv-qualifiers placed on _Mu and
+ // unwrapping the argument bundle.
+ template<typename _CVMu, typename _CVArg, typename... _Args>
+ class result<_CVMu(_CVArg, tuple<_Args...>)>
+ : public result_of<_CVArg(_Args...)> { };
+
+ template<typename _CVArg, typename... _Args>
+ typename result_of<_CVArg(_Args...)>::type
+ operator()(_CVArg& __arg,
+ const tuple<_Args...>& __tuple) const volatile
+ {
+ // Construct an index tuple and forward to __call
+ typedef typename _Build_index_tuple<sizeof...(_Args)>::__type
+ _Indexes;
+ return this->__call(__arg, __tuple, _Indexes());
+ }
+
+ private:
+ // Invokes the underlying function object __arg by unpacking all
+ // of the arguments in the tuple.
+ template<typename _CVArg, typename... _Args, int... _Indexes>
+ typename result_of<_CVArg(_Args...)>::type
+ __call(_CVArg& __arg, const tuple<_Args...>& __tuple,
+ const _Index_tuple<_Indexes...>&) const volatile
+ {
+ return __arg(_GLIBCXX_TR1 get<_Indexes>(__tuple)...);
+ }
+ };
+
+ /**
+ * If the argument is a placeholder for the Nth argument, returns
+ * a reference to the Nth argument to the bind function object.
+ * [TR1 3.6.3/5 bullet 3]
+ */
+ template<typename _Arg>
+ class _Mu<_Arg, false, true>
+ {
+ public:
+ template<typename _Signature> class result;
+
+ template<typename _CVMu, typename _CVArg, typename _Tuple>
+ class result<_CVMu(_CVArg, _Tuple)>
+ {
+ // Add a reference, if it hasn't already been done for us.
+ // This allows us to be a little bit sloppy in constructing
+ // the tuple that we pass to result_of<...>.
+ typedef typename _Safe_tuple_element<(is_placeholder<_Arg>::value
+ - 1), _Tuple>::type
+ __base_type;
+
+ public:
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ typedef typename add_lvalue_reference<__base_type>::type type;
+#else
+ typedef typename add_reference<__base_type>::type type;
+#endif
+ };
+
+ template<typename _Tuple>
+ typename result<_Mu(_Arg, _Tuple)>::type
+ operator()(const volatile _Arg&, const _Tuple& __tuple) const volatile
+ {
+ return ::std::_GLIBCXX_TR1 get<(is_placeholder<_Arg>::value
+ - 1)>(__tuple);
+ }
+ };
+
+ /**
+ * If the argument is just a value, returns a reference to that
+ * value. The cv-qualifiers on the reference are the same as the
+ * cv-qualifiers on the _Mu object. [TR1 3.6.3/5 bullet 4]
+ */
+ template<typename _Arg>
+ class _Mu<_Arg, false, false>
+ {
+ public:
+ template<typename _Signature> struct result;
+
+ template<typename _CVMu, typename _CVArg, typename _Tuple>
+ struct result<_CVMu(_CVArg, _Tuple)>
+ {
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ typedef typename add_lvalue_reference<_CVArg>::type type;
+#else
+ typedef typename add_reference<_CVArg>::type type;
+#endif
+ };
+
+ // Pick up the cv-qualifiers of the argument
+ template<typename _CVArg, typename _Tuple>
+ _CVArg&
+ operator()(_CVArg& __arg, const _Tuple&) const volatile
+ { return __arg; }
+ };
+
+ /**
+ * Maps member pointers into instances of _Mem_fn but leaves all
+ * other function objects untouched. Used by tr1::bind(). The
+ * primary template handles the non--member-pointer case.
+ */
+ template<typename _Tp>
+ struct _Maybe_wrap_member_pointer
+ {
+ typedef _Tp type;
+
+ static const _Tp&
+ __do_wrap(const _Tp& __x)
+ { return __x; }
+ };
+
+ /**
+ * Maps member pointers into instances of _Mem_fn but leaves all
+ * other function objects untouched. Used by tr1::bind(). This
+ * partial specialization handles the member pointer case.
+ */
+ template<typename _Tp, typename _Class>
+ struct _Maybe_wrap_member_pointer<_Tp _Class::*>
+ {
+ typedef _Mem_fn<_Tp _Class::*> type;
+
+ static type
+ __do_wrap(_Tp _Class::* __pm)
+ { return type(__pm); }
+ };
+
+ /// Type of the function object returned from bind().
+ template<typename _Signature>
+ struct _Bind;
+
+ template<typename _Functor, typename... _Bound_args>
+ class _Bind<_Functor(_Bound_args...)>
+ : public _Weak_result_type<_Functor>
+ {
+ typedef _Bind __self_type;
+ typedef typename _Build_index_tuple<sizeof...(_Bound_args)>::__type
+ _Bound_indexes;
+
+ _Functor _M_f;
+ tuple<_Bound_args...> _M_bound_args;
+
+ // Call unqualified
+ template<typename... _Args, int... _Indexes>
+ typename result_of<
+ _Functor(typename result_of<_Mu<_Bound_args>
+ (_Bound_args, tuple<_Args...>)>::type...)
+ >::type
+ __call(const tuple<_Args...>& __args, _Index_tuple<_Indexes...>)
+ {
+ return _M_f(_Mu<_Bound_args>()
+ (_GLIBCXX_TR1 get<_Indexes>(_M_bound_args), __args)...);
+ }
+
+ // Call as const
+ template<typename... _Args, int... _Indexes>
+ typename result_of<
+ const _Functor(typename result_of<_Mu<_Bound_args>
+ (const _Bound_args, tuple<_Args...>)
+ >::type...)>::type
+ __call(const tuple<_Args...>& __args, _Index_tuple<_Indexes...>) const
+ {
+ return _M_f(_Mu<_Bound_args>()
+ (_GLIBCXX_TR1 get<_Indexes>(_M_bound_args), __args)...);
+ }
+
+ // Call as volatile
+ template<typename... _Args, int... _Indexes>
+ typename result_of<
+ volatile _Functor(typename result_of<_Mu<_Bound_args>
+ (volatile _Bound_args, tuple<_Args...>)
+ >::type...)>::type
+ __call(const tuple<_Args...>& __args,
+ _Index_tuple<_Indexes...>) volatile
+ {
+ return _M_f(_Mu<_Bound_args>()
+ (_GLIBCXX_TR1 get<_Indexes>(_M_bound_args), __args)...);
+ }
+
+ // Call as const volatile
+ template<typename... _Args, int... _Indexes>
+ typename result_of<
+ const volatile _Functor(typename result_of<_Mu<_Bound_args>
+ (const volatile _Bound_args,
+ tuple<_Args...>)
+ >::type...)>::type
+ __call(const tuple<_Args...>& __args,
+ _Index_tuple<_Indexes...>) const volatile
+ {
+ return _M_f(_Mu<_Bound_args>()
+ (_GLIBCXX_TR1 get<_Indexes>(_M_bound_args), __args)...);
+ }
+
+ public:
+ explicit _Bind(_Functor __f, _Bound_args... __bound_args)
+ : _M_f(__f), _M_bound_args(__bound_args...) { }
+
+ // Call unqualified
+ template<typename... _Args>
+ typename result_of<
+ _Functor(typename result_of<_Mu<_Bound_args>
+ (_Bound_args, tuple<_Args...>)>::type...)
+ >::type
+ operator()(_Args&... __args)
+ {
+ return this->__call(_GLIBCXX_TR1 tie(__args...), _Bound_indexes());
+ }
+
+ // Call as const
+ template<typename... _Args>
+ typename result_of<
+ const _Functor(typename result_of<_Mu<_Bound_args>
+ (const _Bound_args, tuple<_Args...>)>::type...)
+ >::type
+ operator()(_Args&... __args) const
+ {
+ return this->__call(_GLIBCXX_TR1 tie(__args...), _Bound_indexes());
+ }
+
+
+ // Call as volatile
+ template<typename... _Args>
+ typename result_of<
+ volatile _Functor(typename result_of<_Mu<_Bound_args>
+ (volatile _Bound_args, tuple<_Args...>)>::type...)
+ >::type
+ operator()(_Args&... __args) volatile
+ {
+ return this->__call(_GLIBCXX_TR1 tie(__args...), _Bound_indexes());
+ }
+
+
+ // Call as const volatile
+ template<typename... _Args>
+ typename result_of<
+ const volatile _Functor(typename result_of<_Mu<_Bound_args>
+ (const volatile _Bound_args,
+ tuple<_Args...>)>::type...)
+ >::type
+ operator()(_Args&... __args) const volatile
+ {
+ return this->__call(_GLIBCXX_TR1 tie(__args...), _Bound_indexes());
+ }
+ };
+
+ /// Type of the function object returned from bind<R>().
+ template<typename _Result, typename _Signature>
+ struct _Bind_result;
+
+ template<typename _Result, typename _Functor, typename... _Bound_args>
+ class _Bind_result<_Result, _Functor(_Bound_args...)>
+ {
+ typedef _Bind_result __self_type;
+ typedef typename _Build_index_tuple<sizeof...(_Bound_args)>::__type
+ _Bound_indexes;
+
+ _Functor _M_f;
+ tuple<_Bound_args...> _M_bound_args;
+
+ // Call unqualified
+ template<typename... _Args, int... _Indexes>
+ _Result
+ __call(const tuple<_Args...>& __args, _Index_tuple<_Indexes...>)
+ {
+ return _M_f(_Mu<_Bound_args>()
+ (_GLIBCXX_TR1 get<_Indexes>(_M_bound_args), __args)...);
+ }
+
+ // Call as const
+ template<typename... _Args, int... _Indexes>
+ _Result
+ __call(const tuple<_Args...>& __args, _Index_tuple<_Indexes...>) const
+ {
+ return _M_f(_Mu<_Bound_args>()
+ (_GLIBCXX_TR1 get<_Indexes>(_M_bound_args), __args)...);
+ }
+
+ // Call as volatile
+ template<typename... _Args, int... _Indexes>
+ _Result
+ __call(const tuple<_Args...>& __args,
+ _Index_tuple<_Indexes...>) volatile
+ {
+ return _M_f(_Mu<_Bound_args>()
+ (_GLIBCXX_TR1 get<_Indexes>(_M_bound_args), __args)...);
+ }
+
+ // Call as const volatile
+ template<typename... _Args, int... _Indexes>
+ _Result
+ __call(const tuple<_Args...>& __args,
+ _Index_tuple<_Indexes...>) const volatile
+ {
+ return _M_f(_Mu<_Bound_args>()
+ (_GLIBCXX_TR1 get<_Indexes>(_M_bound_args), __args)...);
+ }
+
+ public:
+ typedef _Result result_type;
+
+ explicit
+ _Bind_result(_Functor __f, _Bound_args... __bound_args)
+ : _M_f(__f), _M_bound_args(__bound_args...) { }
+
+ // Call unqualified
+ template<typename... _Args>
+ result_type
+ operator()(_Args&... __args)
+ {
+ return this->__call(_GLIBCXX_TR1 tie(__args...), _Bound_indexes());
+ }
+
+ // Call as const
+ template<typename... _Args>
+ result_type
+ operator()(_Args&... __args) const
+ {
+ return this->__call(_GLIBCXX_TR1 tie(__args...), _Bound_indexes());
+ }
+
+ // Call as volatile
+ template<typename... _Args>
+ result_type
+ operator()(_Args&... __args) volatile
+ {
+ return this->__call(_GLIBCXX_TR1 tie(__args...), _Bound_indexes());
+ }
+
+ // Call as const volatile
+ template<typename... _Args>
+ result_type
+ operator()(_Args&... __args) const volatile
+ {
+ return this->__call(_GLIBCXX_TR1 tie(__args...), _Bound_indexes());
+ }
+ };
+
+ /// Class template _Bind is always a bind expression.
+ template<typename _Signature>
+ struct is_bind_expression<_Bind<_Signature> >
+ { static const bool value = true; };
+
+ template<typename _Signature>
+ const bool is_bind_expression<_Bind<_Signature> >::value;
+
+ /// Class template _Bind_result is always a bind expression.
+ template<typename _Result, typename _Signature>
+ struct is_bind_expression<_Bind_result<_Result, _Signature> >
+ { static const bool value = true; };
+
+ template<typename _Result, typename _Signature>
+ const bool is_bind_expression<_Bind_result<_Result, _Signature> >::value;
+
+ /// bind
+ template<typename _Functor, typename... _ArgTypes>
+ inline
+ _Bind<typename _Maybe_wrap_member_pointer<_Functor>::type(_ArgTypes...)>
+ bind(_Functor __f, _ArgTypes... __args)
+ {
+ typedef _Maybe_wrap_member_pointer<_Functor> __maybe_type;
+ typedef typename __maybe_type::type __functor_type;
+ typedef _Bind<__functor_type(_ArgTypes...)> __result_type;
+ return __result_type(__maybe_type::__do_wrap(__f), __args...);
+ }
+
+ template<typename _Result, typename _Functor, typename... _ArgTypes>
+ inline
+ _Bind_result<_Result,
+ typename _Maybe_wrap_member_pointer<_Functor>::type
+ (_ArgTypes...)>
+ bind(_Functor __f, _ArgTypes... __args)
+ {
+ typedef _Maybe_wrap_member_pointer<_Functor> __maybe_type;
+ typedef typename __maybe_type::type __functor_type;
+ typedef _Bind_result<_Result, __functor_type(_ArgTypes...)>
+ __result_type;
+ return __result_type(__maybe_type::__do_wrap(__f), __args...);
+ }
+
+ /**
+ * @brief Exception class thrown when class template function's
+ * operator() is called with an empty target.
+ *
+ */
+ class bad_function_call : public std::exception { };
+
+ /**
+ * The integral constant expression 0 can be converted into a
+ * pointer to this type. It is used by the function template to
+ * accept NULL pointers.
+ */
+ struct _M_clear_type;
+
+ /**
+ * Trait identifying "location-invariant" types, meaning that the
+ * address of the object (or any of its members) will not escape.
+ * Also implies a trivial copy constructor and assignment operator.
+ */
+ template<typename _Tp>
+ struct __is_location_invariant
+ : integral_constant<bool,
+ (is_pointer<_Tp>::value
+ || is_member_pointer<_Tp>::value)>
+ {
+ };
+
+ class _Undefined_class;
+
+ union _Nocopy_types
+ {
+ void* _M_object;
+ const void* _M_const_object;
+ void (*_M_function_pointer)();
+ void (_Undefined_class::*_M_member_pointer)();
+ };
+
+ union _Any_data
+ {
+ void* _M_access() { return &_M_pod_data[0]; }
+ const void* _M_access() const { return &_M_pod_data[0]; }
+
+ template<typename _Tp>
+ _Tp&
+ _M_access()
+ { return *static_cast<_Tp*>(_M_access()); }
+
+ template<typename _Tp>
+ const _Tp&
+ _M_access() const
+ { return *static_cast<const _Tp*>(_M_access()); }
+
+ _Nocopy_types _M_unused;
+ char _M_pod_data[sizeof(_Nocopy_types)];
+ };
+
+ enum _Manager_operation
+ {
+ __get_type_info,
+ __get_functor_ptr,
+ __clone_functor,
+ __destroy_functor
+ };
+
+ // Simple type wrapper that helps avoid annoying const problems
+ // when casting between void pointers and pointers-to-pointers.
+ template<typename _Tp>
+ struct _Simple_type_wrapper
+ {
+ _Simple_type_wrapper(_Tp __value) : __value(__value) { }
+
+ _Tp __value;
+ };
+
+ template<typename _Tp>
+ struct __is_location_invariant<_Simple_type_wrapper<_Tp> >
+ : __is_location_invariant<_Tp>
+ {
+ };
+
+ // Converts a reference to a function object into a callable
+ // function object.
+ template<typename _Functor>
+ inline _Functor&
+ __callable_functor(_Functor& __f)
+ { return __f; }
+
+ template<typename _Member, typename _Class>
+ inline _Mem_fn<_Member _Class::*>
+ __callable_functor(_Member _Class::* &__p)
+ { return mem_fn(__p); }
+
+ template<typename _Member, typename _Class>
+ inline _Mem_fn<_Member _Class::*>
+ __callable_functor(_Member _Class::* const &__p)
+ { return mem_fn(__p); }
+
+ template<typename _Signature>
+ class function;
+
+ /// Base class of all polymorphic function object wrappers.
+ class _Function_base
+ {
+ public:
+ static const std::size_t _M_max_size = sizeof(_Nocopy_types);
+ static const std::size_t _M_max_align = __alignof__(_Nocopy_types);
+
+ template<typename _Functor>
+ class _Base_manager
+ {
+ protected:
+ static const bool __stored_locally =
+ (__is_location_invariant<_Functor>::value
+ && sizeof(_Functor) <= _M_max_size
+ && __alignof__(_Functor) <= _M_max_align
+ && (_M_max_align % __alignof__(_Functor) == 0));
+
+ typedef integral_constant<bool, __stored_locally> _Local_storage;
+
+ // Retrieve a pointer to the function object
+ static _Functor*
+ _M_get_pointer(const _Any_data& __source)
+ {
+ const _Functor* __ptr =
+ __stored_locally? &__source._M_access<_Functor>()
+ /* have stored a pointer */ : __source._M_access<_Functor*>();
+ return const_cast<_Functor*>(__ptr);
+ }
+
+ // Clone a location-invariant function object that fits within
+ // an _Any_data structure.
+ static void
+ _M_clone(_Any_data& __dest, const _Any_data& __source, true_type)
+ {
+ new (__dest._M_access()) _Functor(__source._M_access<_Functor>());
+ }
+
+ // Clone a function object that is not location-invariant or
+ // that cannot fit into an _Any_data structure.
+ static void
+ _M_clone(_Any_data& __dest, const _Any_data& __source, false_type)
+ {
+ __dest._M_access<_Functor*>() =
+ new _Functor(*__source._M_access<_Functor*>());
+ }
+
+ // Destroying a location-invariant object may still require
+ // destruction.
+ static void
+ _M_destroy(_Any_data& __victim, true_type)
+ {
+ __victim._M_access<_Functor>().~_Functor();
+ }
+
+ // Destroying an object located on the heap.
+ static void
+ _M_destroy(_Any_data& __victim, false_type)
+ {
+ delete __victim._M_access<_Functor*>();
+ }
+
+ public:
+ static bool
+ _M_manager(_Any_data& __dest, const _Any_data& __source,
+ _Manager_operation __op)
+ {
+ switch (__op)
+ {
+#ifdef __GXX_RTTI
+ case __get_type_info:
+ __dest._M_access<const type_info*>() = &typeid(_Functor);
+ break;
+#endif
+ case __get_functor_ptr:
+ __dest._M_access<_Functor*>() = _M_get_pointer(__source);
+ break;
+
+ case __clone_functor:
+ _M_clone(__dest, __source, _Local_storage());
+ break;
+
+ case __destroy_functor:
+ _M_destroy(__dest, _Local_storage());
+ break;
+ }
+ return false;
+ }
+
+ static void
+ _M_init_functor(_Any_data& __functor, const _Functor& __f)
+ { _M_init_functor(__functor, __f, _Local_storage()); }
+
+ template<typename _Signature>
+ static bool
+ _M_not_empty_function(const function<_Signature>& __f)
+ { return __f; }
+
+ template<typename _Tp>
+ static bool
+ _M_not_empty_function(const _Tp*& __fp)
+ { return __fp; }
+
+ template<typename _Class, typename _Tp>
+ static bool
+ _M_not_empty_function(_Tp _Class::* const& __mp)
+ { return __mp; }
+
+ template<typename _Tp>
+ static bool
+ _M_not_empty_function(const _Tp&)
+ { return true; }
+
+ private:
+ static void
+ _M_init_functor(_Any_data& __functor, const _Functor& __f, true_type)
+ { new (__functor._M_access()) _Functor(__f); }
+
+ static void
+ _M_init_functor(_Any_data& __functor, const _Functor& __f, false_type)
+ { __functor._M_access<_Functor*>() = new _Functor(__f); }
+ };
+
+ template<typename _Functor>
+ class _Ref_manager : public _Base_manager<_Functor*>
+ {
+ typedef _Function_base::_Base_manager<_Functor*> _Base;
+
+ public:
+ static bool
+ _M_manager(_Any_data& __dest, const _Any_data& __source,
+ _Manager_operation __op)
+ {
+ switch (__op)
+ {
+#ifdef __GXX_RTTI
+ case __get_type_info:
+ __dest._M_access<const type_info*>() = &typeid(_Functor);
+ break;
+#endif
+ case __get_functor_ptr:
+ __dest._M_access<_Functor*>() = *_Base::_M_get_pointer(__source);
+ return is_const<_Functor>::value;
+ break;
+
+ default:
+ _Base::_M_manager(__dest, __source, __op);
+ }
+ return false;
+ }
+
+ static void
+ _M_init_functor(_Any_data& __functor, reference_wrapper<_Functor> __f)
+ {
+ // TBD: Use address_of function instead.
+ _Base::_M_init_functor(__functor, &__f.get());
+ }
+ };
+
+ _Function_base() : _M_manager(0) { }
+
+ ~_Function_base()
+ {
+ if (_M_manager)
+ _M_manager(_M_functor, _M_functor, __destroy_functor);
+ }
+
+
+ bool _M_empty() const { return !_M_manager; }
+
+ typedef bool (*_Manager_type)(_Any_data&, const _Any_data&,
+ _Manager_operation);
+
+ _Any_data _M_functor;
+ _Manager_type _M_manager;
+ };
+
+ template<typename _Signature, typename _Functor>
+ class _Function_handler;
+
+ template<typename _Res, typename _Functor, typename... _ArgTypes>
+ class _Function_handler<_Res(_ArgTypes...), _Functor>
+ : public _Function_base::_Base_manager<_Functor>
+ {
+ typedef _Function_base::_Base_manager<_Functor> _Base;
+
+ public:
+ static _Res
+ _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
+ {
+ return (*_Base::_M_get_pointer(__functor))(__args...);
+ }
+ };
+
+ template<typename _Functor, typename... _ArgTypes>
+ class _Function_handler<void(_ArgTypes...), _Functor>
+ : public _Function_base::_Base_manager<_Functor>
+ {
+ typedef _Function_base::_Base_manager<_Functor> _Base;
+
+ public:
+ static void
+ _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
+ {
+ (*_Base::_M_get_pointer(__functor))(__args...);
+ }
+ };
+
+ template<typename _Res, typename _Functor, typename... _ArgTypes>
+ class _Function_handler<_Res(_ArgTypes...), reference_wrapper<_Functor> >
+ : public _Function_base::_Ref_manager<_Functor>
+ {
+ typedef _Function_base::_Ref_manager<_Functor> _Base;
+
+ public:
+ static _Res
+ _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
+ {
+ return
+ __callable_functor(**_Base::_M_get_pointer(__functor))(__args...);
+ }
+ };
+
+ template<typename _Functor, typename... _ArgTypes>
+ class _Function_handler<void(_ArgTypes...), reference_wrapper<_Functor> >
+ : public _Function_base::_Ref_manager<_Functor>
+ {
+ typedef _Function_base::_Ref_manager<_Functor> _Base;
+
+ public:
+ static void
+ _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
+ {
+ __callable_functor(**_Base::_M_get_pointer(__functor))(__args...);
+ }
+ };
+
+ template<typename _Class, typename _Member, typename _Res,
+ typename... _ArgTypes>
+ class _Function_handler<_Res(_ArgTypes...), _Member _Class::*>
+ : public _Function_handler<void(_ArgTypes...), _Member _Class::*>
+ {
+ typedef _Function_handler<void(_ArgTypes...), _Member _Class::*>
+ _Base;
+
+ public:
+ static _Res
+ _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
+ {
+ return _GLIBCXX_TR1
+ mem_fn(_Base::_M_get_pointer(__functor)->__value)(__args...);
+ }
+ };
+
+ template<typename _Class, typename _Member, typename... _ArgTypes>
+ class _Function_handler<void(_ArgTypes...), _Member _Class::*>
+ : public _Function_base::_Base_manager<
+ _Simple_type_wrapper< _Member _Class::* > >
+ {
+ typedef _Member _Class::* _Functor;
+ typedef _Simple_type_wrapper<_Functor> _Wrapper;
+ typedef _Function_base::_Base_manager<_Wrapper> _Base;
+
+ public:
+ static bool
+ _M_manager(_Any_data& __dest, const _Any_data& __source,
+ _Manager_operation __op)
+ {
+ switch (__op)
+ {
+#ifdef __GXX_RTTI
+ case __get_type_info:
+ __dest._M_access<const type_info*>() = &typeid(_Functor);
+ break;
+#endif
+ case __get_functor_ptr:
+ __dest._M_access<_Functor*>() =
+ &_Base::_M_get_pointer(__source)->__value;
+ break;
+
+ default:
+ _Base::_M_manager(__dest, __source, __op);
+ }
+ return false;
+ }
+
+ static void
+ _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
+ {
+ _GLIBCXX_TR1
+ mem_fn(_Base::_M_get_pointer(__functor)->__value)(__args...);
+ }
+ };
+
+ /// class function
+ template<typename _Res, typename... _ArgTypes>
+ class function<_Res(_ArgTypes...)>
+ : public _Maybe_unary_or_binary_function<_Res, _ArgTypes...>,
+ private _Function_base
+ {
+ /// This class is used to implement the safe_bool idiom.
+ struct _Hidden_type
+ {
+ _Hidden_type* _M_bool;
+ };
+
+ /// This typedef is used to implement the safe_bool idiom.
+ typedef _Hidden_type* _Hidden_type::* _Safe_bool;
+
+ typedef _Res _Signature_type(_ArgTypes...);
+
+ struct _Useless { };
+
+ public:
+ typedef _Res result_type;
+
+ // [3.7.2.1] construct/copy/destroy
+
+ /**
+ * @brief Default construct creates an empty function call wrapper.
+ * @post @c !(bool)*this
+ */
+ function() : _Function_base() { }
+
+ /**
+ * @brief Default construct creates an empty function call wrapper.
+ * @post @c !(bool)*this
+ */
+ function(_M_clear_type*) : _Function_base() { }
+
+ /**
+ * @brief %Function copy constructor.
+ * @param x A %function object with identical call signature.
+ * @pre @c (bool)*this == (bool)x
+ *
+ * The newly-created %function contains a copy of the target of @a
+ * x (if it has one).
+ */
+ function(const function& __x);
+
+ /**
+ * @brief Builds a %function that targets a copy of the incoming
+ * function object.
+ * @param f A %function object that is callable with parameters of
+ * type @c T1, @c T2, ..., @c TN and returns a value convertible
+ * to @c Res.
+ *
+ * The newly-created %function object will target a copy of @a
+ * f. If @a f is @c reference_wrapper<F>, then this function
+ * object will contain a reference to the function object @c
+ * f.get(). If @a f is a NULL function pointer or NULL
+ * pointer-to-member, the newly-created object will be empty.
+ *
+ * If @a f is a non-NULL function pointer or an object of type @c
+ * reference_wrapper<F>, this function will not throw.
+ */
+ template<typename _Functor>
+ function(_Functor __f,
+ typename __gnu_cxx::__enable_if<
+ !is_integral<_Functor>::value, _Useless>::__type
+ = _Useless());
+
+ /**
+ * @brief %Function assignment operator.
+ * @param x A %function with identical call signature.
+ * @post @c (bool)*this == (bool)x
+ * @returns @c *this
+ *
+ * The target of @a x is copied to @c *this. If @a x has no
+ * target, then @c *this will be empty.
+ *
+ * If @a x targets a function pointer or a reference to a function
+ * object, then this operation will not throw an exception.
+ */
+ function&
+ operator=(const function& __x)
+ {
+ function(__x).swap(*this);
+ return *this;
+ }
+
+ /**
+ * @brief %Function assignment to zero.
+ * @post @c !(bool)*this
+ * @returns @c *this
+ *
+ * The target of @a *this is deallocated, leaving it empty.
+ */
+ function&
+ operator=(_M_clear_type*)
+ {
+ if (_M_manager)
+ {
+ _M_manager(_M_functor, _M_functor, __destroy_functor);
+ _M_manager = 0;
+ _M_invoker = 0;
+ }
+ return *this;
+ }
+
+ /**
+ * @brief %Function assignment to a new target.
+ * @param f A %function object that is callable with parameters of
+ * type @c T1, @c T2, ..., @c TN and returns a value convertible
+ * to @c Res.
+ * @return @c *this
+ *
+ * This %function object wrapper will target a copy of @a
+ * f. If @a f is @c reference_wrapper<F>, then this function
+ * object will contain a reference to the function object @c
+ * f.get(). If @a f is a NULL function pointer or NULL
+ * pointer-to-member, @c this object will be empty.
+ *
+ * If @a f is a non-NULL function pointer or an object of type @c
+ * reference_wrapper<F>, this function will not throw.
+ */
+ template<typename _Functor>
+ typename __gnu_cxx::__enable_if<!is_integral<_Functor>::value,
+ function&>::__type
+ operator=(_Functor __f)
+ {
+ function(__f).swap(*this);
+ return *this;
+ }
+
+ // [3.7.2.2] function modifiers
+
+ /**
+ * @brief Swap the targets of two %function objects.
+ * @param f A %function with identical call signature.
+ *
+ * Swap the targets of @c this function object and @a f. This
+ * function will not throw an exception.
+ */
+ void swap(function& __x)
+ {
+ _Any_data __old_functor = _M_functor;
+ _M_functor = __x._M_functor;
+ __x._M_functor = __old_functor;
+ _Manager_type __old_manager = _M_manager;
+ _M_manager = __x._M_manager;
+ __x._M_manager = __old_manager;
+ _Invoker_type __old_invoker = _M_invoker;
+ _M_invoker = __x._M_invoker;
+ __x._M_invoker = __old_invoker;
+ }
+
+ // [3.7.2.3] function capacity
+
+ /**
+ * @brief Determine if the %function wrapper has a target.
+ *
+ * @return @c true when this %function object contains a target,
+ * or @c false when it is empty.
+ *
+ * This function will not throw an exception.
+ */
+ operator _Safe_bool() const
+ {
+ if (_M_empty())
+ return 0;
+ else
+ return &_Hidden_type::_M_bool;
+ }
+
+ // [3.7.2.4] function invocation
+
+ /**
+ * @brief Invokes the function targeted by @c *this.
+ * @returns the result of the target.
+ * @throws bad_function_call when @c !(bool)*this
+ *
+ * The function call operator invokes the target function object
+ * stored by @c this.
+ */
+ _Res operator()(_ArgTypes... __args) const;
+
+#ifdef __GXX_RTTI
+ // [3.7.2.5] function target access
+ /**
+ * @brief Determine the type of the target of this function object
+ * wrapper.
+ *
+ * @returns the type identifier of the target function object, or
+ * @c typeid(void) if @c !(bool)*this.
+ *
+ * This function will not throw an exception.
+ */
+ const type_info& target_type() const;
+
+ /**
+ * @brief Access the stored target function object.
+ *
+ * @return Returns a pointer to the stored target function object,
+ * if @c typeid(Functor).equals(target_type()); otherwise, a NULL
+ * pointer.
+ *
+ * This function will not throw an exception.
+ */
+ template<typename _Functor> _Functor* target();
+
+ /// @overload
+ template<typename _Functor> const _Functor* target() const;
+#endif
+
+ private:
+ // [3.7.2.6] undefined operators
+ template<typename _Function>
+ void operator==(const function<_Function>&) const;
+ template<typename _Function>
+ void operator!=(const function<_Function>&) const;
+
+ typedef _Res (*_Invoker_type)(const _Any_data&, _ArgTypes...);
+ _Invoker_type _M_invoker;
+ };
+
+ template<typename _Res, typename... _ArgTypes>
+ function<_Res(_ArgTypes...)>::
+ function(const function& __x)
+ : _Function_base()
+ {
+ if (__x)
+ {
+ _M_invoker = __x._M_invoker;
+ _M_manager = __x._M_manager;
+ __x._M_manager(_M_functor, __x._M_functor, __clone_functor);
+ }
+ }
+
+ template<typename _Res, typename... _ArgTypes>
+ template<typename _Functor>
+ function<_Res(_ArgTypes...)>::
+ function(_Functor __f,
+ typename __gnu_cxx::__enable_if<
+ !is_integral<_Functor>::value, _Useless>::__type)
+ : _Function_base()
+ {
+ typedef _Function_handler<_Signature_type, _Functor> _My_handler;
+
+ if (_My_handler::_M_not_empty_function(__f))
+ {
+ _M_invoker = &_My_handler::_M_invoke;
+ _M_manager = &_My_handler::_M_manager;
+ _My_handler::_M_init_functor(_M_functor, __f);
+ }
+ }
+
+ template<typename _Res, typename... _ArgTypes>
+ _Res
+ function<_Res(_ArgTypes...)>::
+ operator()(_ArgTypes... __args) const
+ {
+ if (_M_empty())
+ {
+#if __EXCEPTIONS
+ throw bad_function_call();
+#else
+ __builtin_abort();
+#endif
+ }
+ return _M_invoker(_M_functor, __args...);
+ }
+
+#ifdef __GXX_RTTI
+ template<typename _Res, typename... _ArgTypes>
+ const type_info&
+ function<_Res(_ArgTypes...)>::
+ target_type() const
+ {
+ if (_M_manager)
+ {
+ _Any_data __typeinfo_result;
+ _M_manager(__typeinfo_result, _M_functor, __get_type_info);
+ return *__typeinfo_result._M_access<const type_info*>();
+ }
+ else
+ return typeid(void);
+ }
+
+ template<typename _Res, typename... _ArgTypes>
+ template<typename _Functor>
+ _Functor*
+ function<_Res(_ArgTypes...)>::
+ target()
+ {
+ if (typeid(_Functor) == target_type() && _M_manager)
+ {
+ _Any_data __ptr;
+ if (_M_manager(__ptr, _M_functor, __get_functor_ptr)
+ && !is_const<_Functor>::value)
+ return 0;
+ else
+ return __ptr._M_access<_Functor*>();
+ }
+ else
+ return 0;
+ }
+
+ template<typename _Res, typename... _ArgTypes>
+ template<typename _Functor>
+ const _Functor*
+ function<_Res(_ArgTypes...)>::
+ target() const
+ {
+ if (typeid(_Functor) == target_type() && _M_manager)
+ {
+ _Any_data __ptr;
+ _M_manager(__ptr, _M_functor, __get_functor_ptr);
+ return __ptr._M_access<const _Functor*>();
+ }
+ else
+ return 0;
+ }
+#endif
+
+ // [3.7.2.7] null pointer comparisons
+
+ /**
+ * @brief Compares a polymorphic function object wrapper against 0
+ * (the NULL pointer).
+ * @returns @c true if the wrapper has no target, @c false otherwise
+ *
+ * This function will not throw an exception.
+ */
+ template<typename _Signature>
+ inline bool
+ operator==(const function<_Signature>& __f, _M_clear_type*)
+ { return !__f; }
+
+ /// @overload
+ template<typename _Signature>
+ inline bool
+ operator==(_M_clear_type*, const function<_Signature>& __f)
+ { return !__f; }
+
+ /**
+ * @brief Compares a polymorphic function object wrapper against 0
+ * (the NULL pointer).
+ * @returns @c false if the wrapper has no target, @c true otherwise
+ *
+ * This function will not throw an exception.
+ */
+ template<typename _Signature>
+ inline bool
+ operator!=(const function<_Signature>& __f, _M_clear_type*)
+ { return __f; }
+
+ /// @overload
+ template<typename _Signature>
+ inline bool
+ operator!=(_M_clear_type*, const function<_Signature>& __f)
+ { return __f; }
+
+ // [3.7.2.8] specialized algorithms
+
+ /**
+ * @brief Swap the targets of two polymorphic function object wrappers.
+ *
+ * This function will not throw an exception.
+ */
+ template<typename _Signature>
+ inline void
+ swap(function<_Signature>& __x, function<_Signature>& __y)
+ { __x.swap(__y); }
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/functional_hash.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/functional_hash.h
new file mode 100644
index 0000000..665168c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/functional_hash.h
@@ -0,0 +1,183 @@
+// TR1 functional -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/functional_hash.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ /// Class template hash.
+ // Declaration of default hash functor std::tr1::hash. The types for
+ // which std::tr1::hash<T> is well-defined is in clause 6.3.3. of the PDTR.
+ template<typename _Tp>
+ struct hash : public std::unary_function<_Tp, size_t>
+ {
+ size_t
+ operator()(_Tp __val) const;
+ };
+
+ /// Partial specializations for pointer types.
+ template<typename _Tp>
+ struct hash<_Tp*> : public std::unary_function<_Tp*, size_t>
+ {
+ size_t
+ operator()(_Tp* __p) const
+ { return reinterpret_cast<size_t>(__p); }
+ };
+
+ /// Explicit specializations for integer types.
+#define _TR1_hashtable_define_trivial_hash(_Tp) \
+ template<> \
+ inline size_t \
+ hash<_Tp>::operator()(_Tp __val) const \
+ { return static_cast<size_t>(__val); }
+
+ _TR1_hashtable_define_trivial_hash(bool);
+ _TR1_hashtable_define_trivial_hash(char);
+ _TR1_hashtable_define_trivial_hash(signed char);
+ _TR1_hashtable_define_trivial_hash(unsigned char);
+ _TR1_hashtable_define_trivial_hash(wchar_t);
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ _TR1_hashtable_define_trivial_hash(char16_t);
+ _TR1_hashtable_define_trivial_hash(char32_t);
+#endif
+ _TR1_hashtable_define_trivial_hash(short);
+ _TR1_hashtable_define_trivial_hash(int);
+ _TR1_hashtable_define_trivial_hash(long);
+ _TR1_hashtable_define_trivial_hash(long long);
+ _TR1_hashtable_define_trivial_hash(unsigned short);
+ _TR1_hashtable_define_trivial_hash(unsigned int);
+ _TR1_hashtable_define_trivial_hash(unsigned long);
+ _TR1_hashtable_define_trivial_hash(unsigned long long);
+
+#undef _TR1_hashtable_define_trivial_hash
+
+ // Fowler / Noll / Vo (FNV) Hash (type FNV-1a)
+ // (Used by the next specializations of std::tr1::hash.)
+
+ /// Dummy generic implementation (for sizeof(size_t) != 4, 8).
+ template<size_t = sizeof(size_t)>
+ struct _Fnv_hash
+ {
+ static size_t
+ hash(const char* __first, size_t __length)
+ {
+ size_t __result = 0;
+ for (; __length > 0; --__length)
+ __result = (__result * 131) + *__first++;
+ return __result;
+ }
+ };
+
+ template<>
+ struct _Fnv_hash<4>
+ {
+ static size_t
+ hash(const char* __first, size_t __length)
+ {
+ size_t __result = static_cast<size_t>(2166136261UL);
+ for (; __length > 0; --__length)
+ {
+ __result ^= static_cast<size_t>(*__first++);
+ __result *= static_cast<size_t>(16777619UL);
+ }
+ return __result;
+ }
+ };
+
+ template<>
+ struct _Fnv_hash<8>
+ {
+ static size_t
+ hash(const char* __first, size_t __length)
+ {
+ size_t __result =
+ static_cast<size_t>(14695981039346656037ULL);
+ for (; __length > 0; --__length)
+ {
+ __result ^= static_cast<size_t>(*__first++);
+ __result *= static_cast<size_t>(1099511628211ULL);
+ }
+ return __result;
+ }
+ };
+
+ /// Explicit specializations for float.
+ template<>
+ inline size_t
+ hash<float>::operator()(float __val) const
+ {
+ size_t __result = 0;
+
+ // 0 and -0 both hash to zero.
+ if (__val != 0.0f)
+ __result = _Fnv_hash<>::hash(reinterpret_cast<const char*>(&__val),
+ sizeof(__val));
+ return __result;
+ };
+
+ /// Explicit specializations for double.
+ template<>
+ inline size_t
+ hash<double>::operator()(double __val) const
+ {
+ size_t __result = 0;
+
+ // 0 and -0 both hash to zero.
+ if (__val != 0.0)
+ __result = _Fnv_hash<>::hash(reinterpret_cast<const char*>(&__val),
+ sizeof(__val));
+ return __result;
+ };
+
+ /// Explicit specializations for long double.
+ template<>
+ size_t
+ hash<long double>::operator()(long double __val) const;
+
+ /// Explicit specialization of member operator for non-builtin types.
+ template<>
+ size_t
+ hash<string>::operator()(string) const;
+
+ template<>
+ size_t
+ hash<const string&>::operator()(const string&) const;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template<>
+ size_t
+ hash<wstring>::operator()(wstring) const;
+
+ template<>
+ size_t
+ hash<const wstring&>::operator()(const wstring&) const;
+#endif
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/hashtable b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/hashtable
new file mode 100644
index 0000000..7c90983
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/hashtable
@@ -0,0 +1,1266 @@
+// Internal header for TR1 unordered_set and unordered_map -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/hashtable
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+// This header file defines std::tr1::hashtable, which is used to
+// implement std::tr1::unordered_set, std::tr1::unordered_map,
+// std::tr1::unordered_multiset, and std::tr1::unordered_multimap.
+// hashtable has many template parameters, partly to accommodate
+// the differences between those four classes and partly to
+// accommodate policy choices that go beyond TR1 specifications.
+
+// Class template hashtable attempts to encapsulate all reasonable
+// variation among hash tables that use chaining. It does not handle
+// open addressing.
+
+// References:
+// M. Austern, "A Proposal to Add Hash Tables to the Standard
+// Library (revision 4)," WG21 Document N1456=03-0039, 2003.
+// D. E. Knuth, The Art of Computer Programming, v. 3, Sorting and Searching.
+// A. Tavori and V. Dreizin, "Policy-Based Data Structures", 2004.
+// http://gcc.gnu.org/onlinedocs/libstdc++/ext/pb_ds/index.html
+
+#include <tr1_impl/hashtable_policy.h>
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ // Class template _Hashtable, class definition.
+
+ // Meaning of class template _Hashtable's template parameters
+
+ // _Key and _Value: arbitrary CopyConstructible types.
+
+ // _Allocator: an allocator type ([lib.allocator.requirements]) whose
+ // value type is Value. As a conforming extension, we allow for
+ // value type != Value.
+
+ // _ExtractKey: function object that takes a object of type Value
+ // and returns a value of type _Key.
+
+ // _Equal: function object that takes two objects of type k and returns
+ // a bool-like value that is true if the two objects are considered equal.
+
+ // _H1: the hash function. A unary function object with argument type
+ // Key and result type size_t. Return values should be distributed
+ // over the entire range [0, numeric_limits<size_t>:::max()].
+
+ // _H2: the range-hashing function (in the terminology of Tavori and
+ // Dreizin). A binary function object whose argument types and result
+ // type are all size_t. Given arguments r and N, the return value is
+ // in the range [0, N).
+
+ // _Hash: the ranged hash function (Tavori and Dreizin). A binary function
+ // whose argument types are _Key and size_t and whose result type is
+ // size_t. Given arguments k and N, the return value is in the range
+ // [0, N). Default: hash(k, N) = h2(h1(k), N). If _Hash is anything other
+ // than the default, _H1 and _H2 are ignored.
+
+ // _RehashPolicy: Policy class with three members, all of which govern
+ // the bucket count. _M_next_bkt(n) returns a bucket count no smaller
+ // than n. _M_bkt_for_elements(n) returns a bucket count appropriate
+ // for an element count of n. _M_need_rehash(n_bkt, n_elt, n_ins)
+ // determines whether, if the current bucket count is n_bkt and the
+ // current element count is n_elt, we need to increase the bucket
+ // count. If so, returns make_pair(true, n), where n is the new
+ // bucket count. If not, returns make_pair(false, <anything>).
+
+ // ??? Right now it is hard-wired that the number of buckets never
+ // shrinks. Should we allow _RehashPolicy to change that?
+
+ // __cache_hash_code: bool. true if we store the value of the hash
+ // function along with the value. This is a time-space tradeoff.
+ // Storing it may improve lookup speed by reducing the number of times
+ // we need to call the Equal function.
+
+ // __constant_iterators: bool. true if iterator and const_iterator are
+ // both constant iterator types. This is true for unordered_set and
+ // unordered_multiset, false for unordered_map and unordered_multimap.
+
+ // __unique_keys: bool. true if the return value of _Hashtable::count(k)
+ // is always at most one, false if it may be an arbitrary number. This
+ // true for unordered_set and unordered_map, false for unordered_multiset
+ // and unordered_multimap.
+
+ template<typename _Key, typename _Value, typename _Allocator,
+ typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash,
+ typename _RehashPolicy,
+ bool __cache_hash_code,
+ bool __constant_iterators,
+ bool __unique_keys>
+ class _Hashtable
+ : public __detail::_Rehash_base<_RehashPolicy,
+ _Hashtable<_Key, _Value, _Allocator,
+ _ExtractKey,
+ _Equal, _H1, _H2, _Hash,
+ _RehashPolicy,
+ __cache_hash_code,
+ __constant_iterators,
+ __unique_keys> >,
+ public __detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, __cache_hash_code>,
+ public __detail::_Map_base<_Key, _Value, _ExtractKey, __unique_keys,
+ _Hashtable<_Key, _Value, _Allocator,
+ _ExtractKey,
+ _Equal, _H1, _H2, _Hash,
+ _RehashPolicy,
+ __cache_hash_code,
+ __constant_iterators,
+ __unique_keys> >
+ {
+ public:
+ typedef _Allocator allocator_type;
+ typedef _Value value_type;
+ typedef _Key key_type;
+ typedef _Equal key_equal;
+ // mapped_type, if present, comes from _Map_base.
+ // hasher, if present, comes from _Hash_code_base.
+ typedef typename _Allocator::difference_type difference_type;
+ typedef typename _Allocator::size_type size_type;
+ typedef typename _Allocator::pointer pointer;
+ typedef typename _Allocator::const_pointer const_pointer;
+ typedef typename _Allocator::reference reference;
+ typedef typename _Allocator::const_reference const_reference;
+
+ typedef __detail::_Node_iterator<value_type, __constant_iterators,
+ __cache_hash_code>
+ local_iterator;
+ typedef __detail::_Node_const_iterator<value_type,
+ __constant_iterators,
+ __cache_hash_code>
+ const_local_iterator;
+
+ typedef __detail::_Hashtable_iterator<value_type, __constant_iterators,
+ __cache_hash_code>
+ iterator;
+ typedef __detail::_Hashtable_const_iterator<value_type,
+ __constant_iterators,
+ __cache_hash_code>
+ const_iterator;
+
+ template<typename _Key2, typename _Value2, typename _Ex2, bool __unique2,
+ typename _Hashtable2>
+ friend struct __detail::_Map_base;
+
+ private:
+ typedef __detail::_Hash_node<_Value, __cache_hash_code> _Node;
+ typedef typename _Allocator::template rebind<_Node>::other
+ _Node_allocator_type;
+ typedef typename _Allocator::template rebind<_Node*>::other
+ _Bucket_allocator_type;
+
+ typedef typename _Allocator::template rebind<_Value>::other
+ _Value_allocator_type;
+
+ _Node_allocator_type _M_node_allocator;
+ _Node** _M_buckets;
+ size_type _M_bucket_count;
+ size_type _M_element_count;
+ _RehashPolicy _M_rehash_policy;
+
+ _Node*
+ _M_allocate_node(const value_type& __v);
+
+ void
+ _M_deallocate_node(_Node* __n);
+
+ void
+ _M_deallocate_nodes(_Node**, size_type);
+
+ _Node**
+ _M_allocate_buckets(size_type __n);
+
+ void
+ _M_deallocate_buckets(_Node**, size_type __n);
+
+ public:
+ // Constructor, destructor, assignment, swap
+ _Hashtable(size_type __bucket_hint,
+ const _H1&, const _H2&, const _Hash&,
+ const _Equal&, const _ExtractKey&,
+ const allocator_type&);
+
+ template<typename _InputIterator>
+ _Hashtable(_InputIterator __first, _InputIterator __last,
+ size_type __bucket_hint,
+ const _H1&, const _H2&, const _Hash&,
+ const _Equal&, const _ExtractKey&,
+ const allocator_type&);
+
+ _Hashtable(const _Hashtable&);
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ _Hashtable(_Hashtable&&);
+#endif
+
+ _Hashtable&
+ operator=(const _Hashtable&);
+
+ ~_Hashtable();
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ void swap(_Hashtable&&);
+#else
+ void swap(_Hashtable&);
+#endif
+
+ // Basic container operations
+ iterator
+ begin()
+ {
+ iterator __i(_M_buckets);
+ if (!__i._M_cur_node)
+ __i._M_incr_bucket();
+ return __i;
+ }
+
+ const_iterator
+ begin() const
+ {
+ const_iterator __i(_M_buckets);
+ if (!__i._M_cur_node)
+ __i._M_incr_bucket();
+ return __i;
+ }
+
+ iterator
+ end()
+ { return iterator(_M_buckets + _M_bucket_count); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_M_buckets + _M_bucket_count); }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ const_iterator
+ cbegin() const
+ {
+ const_iterator __i(_M_buckets);
+ if (!__i._M_cur_node)
+ __i._M_incr_bucket();
+ return __i;
+ }
+
+ const_iterator
+ cend() const
+ { return const_iterator(_M_buckets + _M_bucket_count); }
+#endif
+
+ size_type
+ size() const
+ { return _M_element_count; }
+
+ bool
+ empty() const
+ { return size() == 0; }
+
+ allocator_type
+ get_allocator() const
+ { return allocator_type(_M_node_allocator); }
+
+ _Value_allocator_type
+ _M_get_Value_allocator() const
+ { return _Value_allocator_type(_M_node_allocator); }
+
+ size_type
+ max_size() const
+ { return _M_node_allocator.max_size(); }
+
+ // Observers
+ key_equal
+ key_eq() const
+ { return this->_M_eq; }
+
+ // hash_function, if present, comes from _Hash_code_base.
+
+ // Bucket operations
+ size_type
+ bucket_count() const
+ { return _M_bucket_count; }
+
+ size_type
+ max_bucket_count() const
+ { return max_size(); }
+
+ size_type
+ bucket_size(size_type __n) const
+ { return std::distance(begin(__n), end(__n)); }
+
+ size_type
+ bucket(const key_type& __k) const
+ {
+ return this->_M_bucket_index(__k, this->_M_hash_code(__k),
+ bucket_count());
+ }
+
+ local_iterator
+ begin(size_type __n)
+ { return local_iterator(_M_buckets[__n]); }
+
+ local_iterator
+ end(size_type)
+ { return local_iterator(0); }
+
+ const_local_iterator
+ begin(size_type __n) const
+ { return const_local_iterator(_M_buckets[__n]); }
+
+ const_local_iterator
+ end(size_type) const
+ { return const_local_iterator(0); }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ // DR 691.
+ const_local_iterator
+ cbegin(size_type __n) const
+ { return const_local_iterator(_M_buckets[__n]); }
+
+ const_local_iterator
+ cend(size_type) const
+ { return const_local_iterator(0); }
+#endif
+
+ float
+ load_factor() const
+ {
+ return static_cast<float>(size()) / static_cast<float>(bucket_count());
+ }
+
+ // max_load_factor, if present, comes from _Rehash_base.
+
+ // Generalization of max_load_factor. Extension, not found in TR1. Only
+ // useful if _RehashPolicy is something other than the default.
+ const _RehashPolicy&
+ __rehash_policy() const
+ { return _M_rehash_policy; }
+
+ void
+ __rehash_policy(const _RehashPolicy&);
+
+ // Lookup.
+ iterator
+ find(const key_type& __k);
+
+ const_iterator
+ find(const key_type& __k) const;
+
+ size_type
+ count(const key_type& __k) const;
+
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __k);
+
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __k) const;
+
+ private: // Find, insert and erase helper functions
+ // ??? This dispatching is a workaround for the fact that we don't
+ // have partial specialization of member templates; it would be
+ // better to just specialize insert on __unique_keys. There may be a
+ // cleaner workaround.
+ typedef typename __gnu_cxx::__conditional_type<__unique_keys,
+ std::pair<iterator, bool>, iterator>::__type
+ _Insert_Return_Type;
+
+ typedef typename __gnu_cxx::__conditional_type<__unique_keys,
+ std::_Select1st<_Insert_Return_Type>,
+ std::_Identity<_Insert_Return_Type>
+ >::__type
+ _Insert_Conv_Type;
+
+ _Node*
+ _M_find_node(_Node*, const key_type&,
+ typename _Hashtable::_Hash_code_type) const;
+
+ iterator
+ _M_insert_bucket(const value_type&, size_type,
+ typename _Hashtable::_Hash_code_type);
+
+ std::pair<iterator, bool>
+ _M_insert(const value_type&, std::_GLIBCXX_TR1 true_type);
+
+ iterator
+ _M_insert(const value_type&, std::_GLIBCXX_TR1 false_type);
+
+ void
+ _M_erase_node(_Node*, _Node**);
+
+ public:
+ // Insert and erase
+ _Insert_Return_Type
+ insert(const value_type& __v)
+ { return _M_insert(__v, std::_GLIBCXX_TR1 integral_constant<bool,
+ __unique_keys>()); }
+
+ iterator
+ insert(iterator, const value_type& __v)
+ { return iterator(_Insert_Conv_Type()(this->insert(__v))); }
+
+ const_iterator
+ insert(const_iterator, const value_type& __v)
+ { return const_iterator(_Insert_Conv_Type()(this->insert(__v))); }
+
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last);
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ void
+ insert(initializer_list<value_type> __l)
+ { this->insert(__l.begin(), __l.end()); }
+#endif
+
+ iterator
+ erase(iterator);
+
+ const_iterator
+ erase(const_iterator);
+
+ size_type
+ erase(const key_type&);
+
+ iterator
+ erase(iterator, iterator);
+
+ const_iterator
+ erase(const_iterator, const_iterator);
+
+ void
+ clear();
+
+ // Set number of buckets to be appropriate for container of n element.
+ void rehash(size_type __n);
+
+ private:
+ // Unconditionally change size of bucket array to n.
+ void _M_rehash(size_type __n);
+ };
+
+
+ // Definitions of class template _Hashtable's out-of-line member functions.
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::_Node*
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_allocate_node(const value_type& __v)
+ {
+ _Node* __n = _M_node_allocator.allocate(1);
+ __try
+ {
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ _M_node_allocator.construct(__n, __v);
+#else
+ _M_get_Value_allocator().construct(&__n->_M_v, __v);
+#endif
+ __n->_M_next = 0;
+ return __n;
+ }
+ __catch(...)
+ {
+ _M_node_allocator.deallocate(__n, 1);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ void
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_deallocate_node(_Node* __n)
+ {
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ _M_node_allocator.destroy(__n);
+#else
+ _M_get_Value_allocator().destroy(&__n->_M_v);
+#endif
+ _M_node_allocator.deallocate(__n, 1);
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ void
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_deallocate_nodes(_Node** __array, size_type __n)
+ {
+ for (size_type __i = 0; __i < __n; ++__i)
+ {
+ _Node* __p = __array[__i];
+ while (__p)
+ {
+ _Node* __tmp = __p;
+ __p = __p->_M_next;
+ _M_deallocate_node(__tmp);
+ }
+ __array[__i] = 0;
+ }
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::_Node**
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_allocate_buckets(size_type __n)
+ {
+ _Bucket_allocator_type __alloc(_M_node_allocator);
+
+ // We allocate one extra bucket to hold a sentinel, an arbitrary
+ // non-null pointer. Iterator increment relies on this.
+ _Node** __p = __alloc.allocate(__n + 1);
+ std::fill(__p, __p + __n, (_Node*) 0);
+ __p[__n] = reinterpret_cast<_Node*>(0x1000);
+ return __p;
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ void
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_deallocate_buckets(_Node** __p, size_type __n)
+ {
+ _Bucket_allocator_type __alloc(_M_node_allocator);
+ __alloc.deallocate(__p, __n + 1);
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _Hashtable(size_type __bucket_hint,
+ const _H1& __h1, const _H2& __h2, const _Hash& __h,
+ const _Equal& __eq, const _ExtractKey& __exk,
+ const allocator_type& __a)
+ : __detail::_Rehash_base<_RehashPolicy, _Hashtable>(),
+ __detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, __chc>(__exk, __eq,
+ __h1, __h2, __h),
+ __detail::_Map_base<_Key, _Value, _ExtractKey, __uk, _Hashtable>(),
+ _M_node_allocator(__a),
+ _M_bucket_count(0),
+ _M_element_count(0),
+ _M_rehash_policy()
+ {
+ _M_bucket_count = _M_rehash_policy._M_next_bkt(__bucket_hint);
+ _M_buckets = _M_allocate_buckets(_M_bucket_count);
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ template<typename _InputIterator>
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _Hashtable(_InputIterator __f, _InputIterator __l,
+ size_type __bucket_hint,
+ const _H1& __h1, const _H2& __h2, const _Hash& __h,
+ const _Equal& __eq, const _ExtractKey& __exk,
+ const allocator_type& __a)
+ : __detail::_Rehash_base<_RehashPolicy, _Hashtable>(),
+ __detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, __chc>(__exk, __eq,
+ __h1, __h2, __h),
+ __detail::_Map_base<_Key, _Value, _ExtractKey, __uk, _Hashtable>(),
+ _M_node_allocator(__a),
+ _M_bucket_count(0),
+ _M_element_count(0),
+ _M_rehash_policy()
+ {
+ _M_bucket_count = std::max(_M_rehash_policy._M_next_bkt(__bucket_hint),
+ _M_rehash_policy.
+ _M_bkt_for_elements(__detail::
+ __distance_fw(__f,
+ __l)));
+ _M_buckets = _M_allocate_buckets(_M_bucket_count);
+ __try
+ {
+ for (; __f != __l; ++__f)
+ this->insert(*__f);
+ }
+ __catch(...)
+ {
+ clear();
+ _M_deallocate_buckets(_M_buckets, _M_bucket_count);
+ __throw_exception_again;
+ }
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _Hashtable(const _Hashtable& __ht)
+ : __detail::_Rehash_base<_RehashPolicy, _Hashtable>(__ht),
+ __detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, __chc>(__ht),
+ __detail::_Map_base<_Key, _Value, _ExtractKey, __uk, _Hashtable>(__ht),
+ _M_node_allocator(__ht._M_node_allocator),
+ _M_bucket_count(__ht._M_bucket_count),
+ _M_element_count(__ht._M_element_count),
+ _M_rehash_policy(__ht._M_rehash_policy)
+ {
+ _M_buckets = _M_allocate_buckets(_M_bucket_count);
+ __try
+ {
+ for (size_type __i = 0; __i < __ht._M_bucket_count; ++__i)
+ {
+ _Node* __n = __ht._M_buckets[__i];
+ _Node** __tail = _M_buckets + __i;
+ while (__n)
+ {
+ *__tail = _M_allocate_node(__n->_M_v);
+ this->_M_copy_code(*__tail, __n);
+ __tail = &((*__tail)->_M_next);
+ __n = __n->_M_next;
+ }
+ }
+ }
+ __catch(...)
+ {
+ clear();
+ _M_deallocate_buckets(_M_buckets, _M_bucket_count);
+ __throw_exception_again;
+ }
+ }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _Hashtable(_Hashtable&& __ht)
+ : __detail::_Rehash_base<_RehashPolicy, _Hashtable>(__ht),
+ __detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, __chc>(__ht),
+ __detail::_Map_base<_Key, _Value, _ExtractKey, __uk, _Hashtable>(__ht),
+ _M_node_allocator(__ht._M_node_allocator),
+ _M_bucket_count(__ht._M_bucket_count),
+ _M_element_count(__ht._M_element_count),
+ _M_rehash_policy(__ht._M_rehash_policy),
+ _M_buckets(__ht._M_buckets)
+ {
+ size_type __n_bkt = __ht._M_rehash_policy._M_next_bkt(0);
+ __ht._M_buckets = __ht._M_allocate_buckets(__n_bkt);
+ __ht._M_bucket_count = __n_bkt;
+ __ht._M_element_count = 0;
+ __ht._M_rehash_policy = _RehashPolicy();
+ }
+#endif
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>&
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ operator=(const _Hashtable& __ht)
+ {
+ _Hashtable __tmp(__ht);
+ this->swap(__tmp);
+ return *this;
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ ~_Hashtable()
+ {
+ clear();
+ _M_deallocate_buckets(_M_buckets, _M_bucket_count);
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ void
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ swap(_Hashtable&& __x)
+#else
+ swap(_Hashtable& __x)
+#endif
+ {
+ // The only base class with member variables is hash_code_base. We
+ // define _Hash_code_base::_M_swap because different specializations
+ // have different members.
+ __detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, __chc>::_M_swap(__x);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 431. Swapping containers with unequal allocators.
+ std::__alloc_swap<_Node_allocator_type>::_S_do_it(_M_node_allocator,
+ __x._M_node_allocator);
+
+ std::swap(_M_rehash_policy, __x._M_rehash_policy);
+ std::swap(_M_buckets, __x._M_buckets);
+ std::swap(_M_bucket_count, __x._M_bucket_count);
+ std::swap(_M_element_count, __x._M_element_count);
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ void
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ __rehash_policy(const _RehashPolicy& __pol)
+ {
+ _M_rehash_policy = __pol;
+ size_type __n_bkt = __pol._M_bkt_for_elements(_M_element_count);
+ if (__n_bkt > _M_bucket_count)
+ _M_rehash(__n_bkt);
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::iterator
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ find(const key_type& __k)
+ {
+ typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k);
+ std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count);
+ _Node* __p = _M_find_node(_M_buckets[__n], __k, __code);
+ return __p ? iterator(__p, _M_buckets + __n) : this->end();
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::const_iterator
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ find(const key_type& __k) const
+ {
+ typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k);
+ std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count);
+ _Node* __p = _M_find_node(_M_buckets[__n], __k, __code);
+ return __p ? const_iterator(__p, _M_buckets + __n) : this->end();
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::size_type
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ count(const key_type& __k) const
+ {
+ typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k);
+ std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count);
+ std::size_t __result = 0;
+ for (_Node* __p = _M_buckets[__n]; __p; __p = __p->_M_next)
+ if (this->_M_compare(__k, __code, __p))
+ ++__result;
+ return __result;
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ std::pair<typename _Hashtable<_Key, _Value, _Allocator,
+ _ExtractKey, _Equal, _H1,
+ _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::iterator,
+ typename _Hashtable<_Key, _Value, _Allocator,
+ _ExtractKey, _Equal, _H1,
+ _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::iterator>
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ equal_range(const key_type& __k)
+ {
+ typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k);
+ std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count);
+ _Node** __head = _M_buckets + __n;
+ _Node* __p = _M_find_node(*__head, __k, __code);
+
+ if (__p)
+ {
+ _Node* __p1 = __p->_M_next;
+ for (; __p1; __p1 = __p1->_M_next)
+ if (!this->_M_compare(__k, __code, __p1))
+ break;
+
+ iterator __first(__p, __head);
+ iterator __last(__p1, __head);
+ if (!__p1)
+ __last._M_incr_bucket();
+ return std::make_pair(__first, __last);
+ }
+ else
+ return std::make_pair(this->end(), this->end());
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ std::pair<typename _Hashtable<_Key, _Value, _Allocator,
+ _ExtractKey, _Equal, _H1,
+ _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::const_iterator,
+ typename _Hashtable<_Key, _Value, _Allocator,
+ _ExtractKey, _Equal, _H1,
+ _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::const_iterator>
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ equal_range(const key_type& __k) const
+ {
+ typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k);
+ std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count);
+ _Node** __head = _M_buckets + __n;
+ _Node* __p = _M_find_node(*__head, __k, __code);
+
+ if (__p)
+ {
+ _Node* __p1 = __p->_M_next;
+ for (; __p1; __p1 = __p1->_M_next)
+ if (!this->_M_compare(__k, __code, __p1))
+ break;
+
+ const_iterator __first(__p, __head);
+ const_iterator __last(__p1, __head);
+ if (!__p1)
+ __last._M_incr_bucket();
+ return std::make_pair(__first, __last);
+ }
+ else
+ return std::make_pair(this->end(), this->end());
+ }
+
+ // Find the node whose key compares equal to k, beginning the search
+ // at p (usually the head of a bucket). Return nil if no node is found.
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey,
+ _Equal, _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::_Node*
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_find_node(_Node* __p, const key_type& __k,
+ typename _Hashtable::_Hash_code_type __code) const
+ {
+ for (; __p; __p = __p->_M_next)
+ if (this->_M_compare(__k, __code, __p))
+ return __p;
+ return false;
+ }
+
+ // Insert v in bucket n (assumes no element with its key already present).
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::iterator
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_insert_bucket(const value_type& __v, size_type __n,
+ typename _Hashtable::_Hash_code_type __code)
+ {
+ std::pair<bool, std::size_t> __do_rehash
+ = _M_rehash_policy._M_need_rehash(_M_bucket_count,
+ _M_element_count, 1);
+
+ // Allocate the new node before doing the rehash so that we don't
+ // do a rehash if the allocation throws.
+ _Node* __new_node = _M_allocate_node(__v);
+
+ __try
+ {
+ if (__do_rehash.first)
+ {
+ const key_type& __k = this->_M_extract(__v);
+ __n = this->_M_bucket_index(__k, __code, __do_rehash.second);
+ _M_rehash(__do_rehash.second);
+ }
+
+ __new_node->_M_next = _M_buckets[__n];
+ this->_M_store_code(__new_node, __code);
+ _M_buckets[__n] = __new_node;
+ ++_M_element_count;
+ return iterator(__new_node, _M_buckets + __n);
+ }
+ __catch(...)
+ {
+ _M_deallocate_node(__new_node);
+ __throw_exception_again;
+ }
+ }
+
+ // Insert v if no element with its key is already present.
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ std::pair<typename _Hashtable<_Key, _Value, _Allocator,
+ _ExtractKey, _Equal, _H1,
+ _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::iterator, bool>
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_insert(const value_type& __v, std::_GLIBCXX_TR1 true_type)
+ {
+ const key_type& __k = this->_M_extract(__v);
+ typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k);
+ size_type __n = this->_M_bucket_index(__k, __code, _M_bucket_count);
+
+ if (_Node* __p = _M_find_node(_M_buckets[__n], __k, __code))
+ return std::make_pair(iterator(__p, _M_buckets + __n), false);
+ return std::make_pair(_M_insert_bucket(__v, __n, __code), true);
+ }
+
+ // Insert v unconditionally.
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::iterator
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_insert(const value_type& __v, std::_GLIBCXX_TR1 false_type)
+ {
+ std::pair<bool, std::size_t> __do_rehash
+ = _M_rehash_policy._M_need_rehash(_M_bucket_count,
+ _M_element_count, 1);
+ if (__do_rehash.first)
+ _M_rehash(__do_rehash.second);
+
+ const key_type& __k = this->_M_extract(__v);
+ typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k);
+ size_type __n = this->_M_bucket_index(__k, __code, _M_bucket_count);
+
+ // First find the node, avoid leaking new_node if compare throws.
+ _Node* __prev = _M_find_node(_M_buckets[__n], __k, __code);
+ _Node* __new_node = _M_allocate_node(__v);
+
+ if (__prev)
+ {
+ __new_node->_M_next = __prev->_M_next;
+ __prev->_M_next = __new_node;
+ }
+ else
+ {
+ __new_node->_M_next = _M_buckets[__n];
+ _M_buckets[__n] = __new_node;
+ }
+ this->_M_store_code(__new_node, __code);
+
+ ++_M_element_count;
+ return iterator(__new_node, _M_buckets + __n);
+ }
+
+ // For erase(iterator) and erase(const_iterator).
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ void
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_erase_node(_Node* __p, _Node** __b)
+ {
+ _Node* __cur = *__b;
+ if (__cur == __p)
+ *__b = __cur->_M_next;
+ else
+ {
+ _Node* __next = __cur->_M_next;
+ while (__next != __p)
+ {
+ __cur = __next;
+ __next = __cur->_M_next;
+ }
+ __cur->_M_next = __next->_M_next;
+ }
+
+ _M_deallocate_node(__p);
+ --_M_element_count;
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ template<typename _InputIterator>
+ void
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ size_type __n_elt = __detail::__distance_fw(__first, __last);
+ std::pair<bool, std::size_t> __do_rehash
+ = _M_rehash_policy._M_need_rehash(_M_bucket_count,
+ _M_element_count, __n_elt);
+ if (__do_rehash.first)
+ _M_rehash(__do_rehash.second);
+
+ for (; __first != __last; ++__first)
+ this->insert(*__first);
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::iterator
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ erase(iterator __it)
+ {
+ iterator __result = __it;
+ ++__result;
+ _M_erase_node(__it._M_cur_node, __it._M_cur_bucket);
+ return __result;
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::const_iterator
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ erase(const_iterator __it)
+ {
+ const_iterator __result = __it;
+ ++__result;
+ _M_erase_node(__it._M_cur_node, __it._M_cur_bucket);
+ return __result;
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::size_type
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ erase(const key_type& __k)
+ {
+ typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k);
+ std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count);
+ size_type __result = 0;
+
+ _Node** __slot = _M_buckets + __n;
+ while (*__slot && !this->_M_compare(__k, __code, *__slot))
+ __slot = &((*__slot)->_M_next);
+
+ _Node** __saved_slot = 0;
+ while (*__slot && this->_M_compare(__k, __code, *__slot))
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 526. Is it undefined if a function in the standard changes
+ // in parameters?
+ if (&this->_M_extract((*__slot)->_M_v) != &__k)
+ {
+ _Node* __p = *__slot;
+ *__slot = __p->_M_next;
+ _M_deallocate_node(__p);
+ --_M_element_count;
+ ++__result;
+ }
+ else
+ {
+ __saved_slot = __slot;
+ __slot = &((*__slot)->_M_next);
+ }
+ }
+
+ if (__saved_slot)
+ {
+ _Node* __p = *__saved_slot;
+ *__saved_slot = __p->_M_next;
+ _M_deallocate_node(__p);
+ --_M_element_count;
+ ++__result;
+ }
+
+ return __result;
+ }
+
+ // ??? This could be optimized by taking advantage of the bucket
+ // structure, but it's not clear that it's worth doing. It probably
+ // wouldn't even be an optimization unless the load factor is large.
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::iterator
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ erase(iterator __first, iterator __last)
+ {
+ while (__first != __last)
+ __first = this->erase(__first);
+ return __last;
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ __chc, __cit, __uk>::const_iterator
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ erase(const_iterator __first, const_iterator __last)
+ {
+ while (__first != __last)
+ __first = this->erase(__first);
+ return __last;
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ void
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ clear()
+ {
+ _M_deallocate_nodes(_M_buckets, _M_bucket_count);
+ _M_element_count = 0;
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ void
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ rehash(size_type __n)
+ {
+ _M_rehash(std::max(_M_rehash_policy._M_next_bkt(__n),
+ _M_rehash_policy._M_bkt_for_elements(_M_element_count
+ + 1)));
+ }
+
+ template<typename _Key, typename _Value,
+ typename _Allocator, typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
+ bool __chc, bool __cit, bool __uk>
+ void
+ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
+ _M_rehash(size_type __n)
+ {
+ _Node** __new_array = _M_allocate_buckets(__n);
+ __try
+ {
+ for (size_type __i = 0; __i < _M_bucket_count; ++__i)
+ while (_Node* __p = _M_buckets[__i])
+ {
+ std::size_t __new_index = this->_M_bucket_index(__p, __n);
+ _M_buckets[__i] = __p->_M_next;
+ __p->_M_next = __new_array[__new_index];
+ __new_array[__new_index] = __p;
+ }
+ _M_deallocate_buckets(_M_buckets, _M_bucket_count);
+ _M_bucket_count = __n;
+ _M_buckets = __new_array;
+ }
+ __catch(...)
+ {
+ // A failure here means that a hash function threw an exception.
+ // We can't restore the previous state without calling the hash
+ // function again, so the only sensible recovery is to delete
+ // everything.
+ _M_deallocate_nodes(__new_array, __n);
+ _M_deallocate_buckets(__new_array, __n);
+ _M_deallocate_nodes(_M_buckets, _M_bucket_count);
+ _M_element_count = 0;
+ __throw_exception_again;
+ }
+ }
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/hashtable_policy.h b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/hashtable_policy.h
new file mode 100644
index 0000000..8996d04
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/hashtable_policy.h
@@ -0,0 +1,865 @@
+// Internal policy header for TR1 unordered_set and unordered_map -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/hashtable_policy.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+namespace __detail
+{
+ // Helper function: return distance(first, last) for forward
+ // iterators, or 0 for input iterators.
+ template<class _Iterator>
+ inline typename std::iterator_traits<_Iterator>::difference_type
+ __distance_fw(_Iterator __first, _Iterator __last,
+ std::input_iterator_tag)
+ { return 0; }
+
+ template<class _Iterator>
+ inline typename std::iterator_traits<_Iterator>::difference_type
+ __distance_fw(_Iterator __first, _Iterator __last,
+ std::forward_iterator_tag)
+ { return std::distance(__first, __last); }
+
+ template<class _Iterator>
+ inline typename std::iterator_traits<_Iterator>::difference_type
+ __distance_fw(_Iterator __first, _Iterator __last)
+ {
+ typedef typename std::iterator_traits<_Iterator>::iterator_category _Tag;
+ return __distance_fw(__first, __last, _Tag());
+ }
+
+ template<typename _RAIter, typename _Tp>
+ _RAIter
+ __lower_bound(_RAIter __first, _RAIter __last, const _Tp& __val)
+ {
+ typedef typename std::iterator_traits<_RAIter>::difference_type _DType;
+
+ _DType __len = __last - __first;
+ while (__len > 0)
+ {
+ _DType __half = __len >> 1;
+ _RAIter __middle = __first + __half;
+ if (*__middle < __val)
+ {
+ __first = __middle;
+ ++__first;
+ __len = __len - __half - 1;
+ }
+ else
+ __len = __half;
+ }
+ return __first;
+ }
+
+ // Auxiliary types used for all instantiations of _Hashtable: nodes
+ // and iterators.
+
+ // Nodes, used to wrap elements stored in the hash table. A policy
+ // template parameter of class template _Hashtable controls whether
+ // nodes also store a hash code. In some cases (e.g. strings) this
+ // may be a performance win.
+ template<typename _Value, bool __cache_hash_code>
+ struct _Hash_node;
+
+ template<typename _Value>
+ struct _Hash_node<_Value, true>
+ {
+ _Value _M_v;
+ std::size_t _M_hash_code;
+ _Hash_node* _M_next;
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<typename... _Args>
+ _Hash_node(_Args&&... __args)
+ : _M_v(std::forward<_Args>(__args)...),
+ _M_hash_code(), _M_next() { }
+#endif
+ };
+
+ template<typename _Value>
+ struct _Hash_node<_Value, false>
+ {
+ _Value _M_v;
+ _Hash_node* _M_next;
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<typename... _Args>
+ _Hash_node(_Args&&... __args)
+ : _M_v(std::forward<_Args>(__args)...),
+ _M_next() { }
+#endif
+ };
+
+ // Local iterators, used to iterate within a bucket but not between
+ // buckets.
+ template<typename _Value, bool __cache>
+ struct _Node_iterator_base
+ {
+ _Node_iterator_base(_Hash_node<_Value, __cache>* __p)
+ : _M_cur(__p) { }
+
+ void
+ _M_incr()
+ { _M_cur = _M_cur->_M_next; }
+
+ _Hash_node<_Value, __cache>* _M_cur;
+ };
+
+ template<typename _Value, bool __cache>
+ inline bool
+ operator==(const _Node_iterator_base<_Value, __cache>& __x,
+ const _Node_iterator_base<_Value, __cache>& __y)
+ { return __x._M_cur == __y._M_cur; }
+
+ template<typename _Value, bool __cache>
+ inline bool
+ operator!=(const _Node_iterator_base<_Value, __cache>& __x,
+ const _Node_iterator_base<_Value, __cache>& __y)
+ { return __x._M_cur != __y._M_cur; }
+
+ template<typename _Value, bool __constant_iterators, bool __cache>
+ struct _Node_iterator
+ : public _Node_iterator_base<_Value, __cache>
+ {
+ typedef _Value value_type;
+ typedef typename
+ __gnu_cxx::__conditional_type<__constant_iterators,
+ const _Value*, _Value*>::__type
+ pointer;
+ typedef typename
+ __gnu_cxx::__conditional_type<__constant_iterators,
+ const _Value&, _Value&>::__type
+ reference;
+ typedef std::ptrdiff_t difference_type;
+ typedef std::forward_iterator_tag iterator_category;
+
+ _Node_iterator()
+ : _Node_iterator_base<_Value, __cache>(0) { }
+
+ explicit
+ _Node_iterator(_Hash_node<_Value, __cache>* __p)
+ : _Node_iterator_base<_Value, __cache>(__p) { }
+
+ reference
+ operator*() const
+ { return this->_M_cur->_M_v; }
+
+ pointer
+ operator->() const
+ { return &this->_M_cur->_M_v; }
+
+ _Node_iterator&
+ operator++()
+ {
+ this->_M_incr();
+ return *this;
+ }
+
+ _Node_iterator
+ operator++(int)
+ {
+ _Node_iterator __tmp(*this);
+ this->_M_incr();
+ return __tmp;
+ }
+ };
+
+ template<typename _Value, bool __constant_iterators, bool __cache>
+ struct _Node_const_iterator
+ : public _Node_iterator_base<_Value, __cache>
+ {
+ typedef _Value value_type;
+ typedef const _Value* pointer;
+ typedef const _Value& reference;
+ typedef std::ptrdiff_t difference_type;
+ typedef std::forward_iterator_tag iterator_category;
+
+ _Node_const_iterator()
+ : _Node_iterator_base<_Value, __cache>(0) { }
+
+ explicit
+ _Node_const_iterator(_Hash_node<_Value, __cache>* __p)
+ : _Node_iterator_base<_Value, __cache>(__p) { }
+
+ _Node_const_iterator(const _Node_iterator<_Value, __constant_iterators,
+ __cache>& __x)
+ : _Node_iterator_base<_Value, __cache>(__x._M_cur) { }
+
+ reference
+ operator*() const
+ { return this->_M_cur->_M_v; }
+
+ pointer
+ operator->() const
+ { return &this->_M_cur->_M_v; }
+
+ _Node_const_iterator&
+ operator++()
+ {
+ this->_M_incr();
+ return *this;
+ }
+
+ _Node_const_iterator
+ operator++(int)
+ {
+ _Node_const_iterator __tmp(*this);
+ this->_M_incr();
+ return __tmp;
+ }
+ };
+
+ template<typename _Value, bool __cache>
+ struct _Hashtable_iterator_base
+ {
+ _Hashtable_iterator_base(_Hash_node<_Value, __cache>* __node,
+ _Hash_node<_Value, __cache>** __bucket)
+ : _M_cur_node(__node), _M_cur_bucket(__bucket) { }
+
+ void
+ _M_incr()
+ {
+ _M_cur_node = _M_cur_node->_M_next;
+ if (!_M_cur_node)
+ _M_incr_bucket();
+ }
+
+ void
+ _M_incr_bucket();
+
+ _Hash_node<_Value, __cache>* _M_cur_node;
+ _Hash_node<_Value, __cache>** _M_cur_bucket;
+ };
+
+ // Global iterators, used for arbitrary iteration within a hash
+ // table. Larger and more expensive than local iterators.
+ template<typename _Value, bool __cache>
+ void
+ _Hashtable_iterator_base<_Value, __cache>::
+ _M_incr_bucket()
+ {
+ ++_M_cur_bucket;
+
+ // This loop requires the bucket array to have a non-null sentinel.
+ while (!*_M_cur_bucket)
+ ++_M_cur_bucket;
+ _M_cur_node = *_M_cur_bucket;
+ }
+
+ template<typename _Value, bool __cache>
+ inline bool
+ operator==(const _Hashtable_iterator_base<_Value, __cache>& __x,
+ const _Hashtable_iterator_base<_Value, __cache>& __y)
+ { return __x._M_cur_node == __y._M_cur_node; }
+
+ template<typename _Value, bool __cache>
+ inline bool
+ operator!=(const _Hashtable_iterator_base<_Value, __cache>& __x,
+ const _Hashtable_iterator_base<_Value, __cache>& __y)
+ { return __x._M_cur_node != __y._M_cur_node; }
+
+ template<typename _Value, bool __constant_iterators, bool __cache>
+ struct _Hashtable_iterator
+ : public _Hashtable_iterator_base<_Value, __cache>
+ {
+ typedef _Value value_type;
+ typedef typename
+ __gnu_cxx::__conditional_type<__constant_iterators,
+ const _Value*, _Value*>::__type
+ pointer;
+ typedef typename
+ __gnu_cxx::__conditional_type<__constant_iterators,
+ const _Value&, _Value&>::__type
+ reference;
+ typedef std::ptrdiff_t difference_type;
+ typedef std::forward_iterator_tag iterator_category;
+
+ _Hashtable_iterator()
+ : _Hashtable_iterator_base<_Value, __cache>(0, 0) { }
+
+ _Hashtable_iterator(_Hash_node<_Value, __cache>* __p,
+ _Hash_node<_Value, __cache>** __b)
+ : _Hashtable_iterator_base<_Value, __cache>(__p, __b) { }
+
+ explicit
+ _Hashtable_iterator(_Hash_node<_Value, __cache>** __b)
+ : _Hashtable_iterator_base<_Value, __cache>(*__b, __b) { }
+
+ reference
+ operator*() const
+ { return this->_M_cur_node->_M_v; }
+
+ pointer
+ operator->() const
+ { return &this->_M_cur_node->_M_v; }
+
+ _Hashtable_iterator&
+ operator++()
+ {
+ this->_M_incr();
+ return *this;
+ }
+
+ _Hashtable_iterator
+ operator++(int)
+ {
+ _Hashtable_iterator __tmp(*this);
+ this->_M_incr();
+ return __tmp;
+ }
+ };
+
+ template<typename _Value, bool __constant_iterators, bool __cache>
+ struct _Hashtable_const_iterator
+ : public _Hashtable_iterator_base<_Value, __cache>
+ {
+ typedef _Value value_type;
+ typedef const _Value* pointer;
+ typedef const _Value& reference;
+ typedef std::ptrdiff_t difference_type;
+ typedef std::forward_iterator_tag iterator_category;
+
+ _Hashtable_const_iterator()
+ : _Hashtable_iterator_base<_Value, __cache>(0, 0) { }
+
+ _Hashtable_const_iterator(_Hash_node<_Value, __cache>* __p,
+ _Hash_node<_Value, __cache>** __b)
+ : _Hashtable_iterator_base<_Value, __cache>(__p, __b) { }
+
+ explicit
+ _Hashtable_const_iterator(_Hash_node<_Value, __cache>** __b)
+ : _Hashtable_iterator_base<_Value, __cache>(*__b, __b) { }
+
+ _Hashtable_const_iterator(const _Hashtable_iterator<_Value,
+ __constant_iterators, __cache>& __x)
+ : _Hashtable_iterator_base<_Value, __cache>(__x._M_cur_node,
+ __x._M_cur_bucket) { }
+
+ reference
+ operator*() const
+ { return this->_M_cur_node->_M_v; }
+
+ pointer
+ operator->() const
+ { return &this->_M_cur_node->_M_v; }
+
+ _Hashtable_const_iterator&
+ operator++()
+ {
+ this->_M_incr();
+ return *this;
+ }
+
+ _Hashtable_const_iterator
+ operator++(int)
+ {
+ _Hashtable_const_iterator __tmp(*this);
+ this->_M_incr();
+ return __tmp;
+ }
+ };
+
+
+ // Many of class template _Hashtable's template parameters are policy
+ // classes. These are defaults for the policies.
+
+ // Default range hashing function: use division to fold a large number
+ // into the range [0, N).
+ struct _Mod_range_hashing
+ {
+ typedef std::size_t first_argument_type;
+ typedef std::size_t second_argument_type;
+ typedef std::size_t result_type;
+
+ result_type
+ operator()(first_argument_type __num, second_argument_type __den) const
+ { return __num % __den; }
+ };
+
+ // Default ranged hash function H. In principle it should be a
+ // function object composed from objects of type H1 and H2 such that
+ // h(k, N) = h2(h1(k), N), but that would mean making extra copies of
+ // h1 and h2. So instead we'll just use a tag to tell class template
+ // hashtable to do that composition.
+ struct _Default_ranged_hash { };
+
+ // Default value for rehash policy. Bucket size is (usually) the
+ // smallest prime that keeps the load factor small enough.
+ struct _Prime_rehash_policy
+ {
+ _Prime_rehash_policy(float __z = 1.0)
+ : _M_max_load_factor(__z), _M_growth_factor(2.f), _M_next_resize(0) { }
+
+ float
+ max_load_factor() const
+ { return _M_max_load_factor; }
+
+ // Return a bucket size no smaller than n.
+ std::size_t
+ _M_next_bkt(std::size_t __n) const;
+
+ // Return a bucket count appropriate for n elements
+ std::size_t
+ _M_bkt_for_elements(std::size_t __n) const;
+
+ // __n_bkt is current bucket count, __n_elt is current element count,
+ // and __n_ins is number of elements to be inserted. Do we need to
+ // increase bucket count? If so, return make_pair(true, n), where n
+ // is the new bucket count. If not, return make_pair(false, 0).
+ std::pair<bool, std::size_t>
+ _M_need_rehash(std::size_t __n_bkt, std::size_t __n_elt,
+ std::size_t __n_ins) const;
+
+ enum { _S_n_primes = sizeof(unsigned long) != 8 ? 256 : 256 + 48 };
+
+ float _M_max_load_factor;
+ float _M_growth_factor;
+ mutable std::size_t _M_next_resize;
+ };
+
+ extern const unsigned long __prime_list[];
+
+ // XXX This is a hack. There's no good reason for any of
+ // _Prime_rehash_policy's member functions to be inline.
+
+ // Return a prime no smaller than n.
+ inline std::size_t
+ _Prime_rehash_policy::
+ _M_next_bkt(std::size_t __n) const
+ {
+ const unsigned long* __p = __lower_bound(__prime_list, __prime_list
+ + _S_n_primes, __n);
+ _M_next_resize =
+ static_cast<std::size_t>(__builtin_ceil(*__p * _M_max_load_factor));
+ return *__p;
+ }
+
+ // Return the smallest prime p such that alpha p >= n, where alpha
+ // is the load factor.
+ inline std::size_t
+ _Prime_rehash_policy::
+ _M_bkt_for_elements(std::size_t __n) const
+ {
+ const float __min_bkts = __n / _M_max_load_factor;
+ const unsigned long* __p = __lower_bound(__prime_list, __prime_list
+ + _S_n_primes, __min_bkts);
+ _M_next_resize =
+ static_cast<std::size_t>(__builtin_ceil(*__p * _M_max_load_factor));
+ return *__p;
+ }
+
+ // Finds the smallest prime p such that alpha p > __n_elt + __n_ins.
+ // If p > __n_bkt, return make_pair(true, p); otherwise return
+ // make_pair(false, 0). In principle this isn't very different from
+ // _M_bkt_for_elements.
+
+ // The only tricky part is that we're caching the element count at
+ // which we need to rehash, so we don't have to do a floating-point
+ // multiply for every insertion.
+
+ inline std::pair<bool, std::size_t>
+ _Prime_rehash_policy::
+ _M_need_rehash(std::size_t __n_bkt, std::size_t __n_elt,
+ std::size_t __n_ins) const
+ {
+ if (__n_elt + __n_ins > _M_next_resize)
+ {
+ float __min_bkts = ((float(__n_ins) + float(__n_elt))
+ / _M_max_load_factor);
+ if (__min_bkts > __n_bkt)
+ {
+ __min_bkts = std::max(__min_bkts, _M_growth_factor * __n_bkt);
+ const unsigned long* __p =
+ __lower_bound(__prime_list, __prime_list + _S_n_primes,
+ __min_bkts);
+ _M_next_resize = static_cast<std::size_t>
+ (__builtin_ceil(*__p * _M_max_load_factor));
+ return std::make_pair(true, *__p);
+ }
+ else
+ {
+ _M_next_resize = static_cast<std::size_t>
+ (__builtin_ceil(__n_bkt * _M_max_load_factor));
+ return std::make_pair(false, 0);
+ }
+ }
+ else
+ return std::make_pair(false, 0);
+ }
+
+ // Base classes for std::tr1::_Hashtable. We define these base
+ // classes because in some cases we want to do different things
+ // depending on the value of a policy class. In some cases the
+ // policy class affects which member functions and nested typedefs
+ // are defined; we handle that by specializing base class templates.
+ // Several of the base class templates need to access other members
+ // of class template _Hashtable, so we use the "curiously recurring
+ // template pattern" for them.
+
+ // class template _Map_base. If the hashtable has a value type of the
+ // form pair<T1, T2> and a key extraction policy that returns the
+ // first part of the pair, the hashtable gets a mapped_type typedef.
+ // If it satisfies those criteria and also has unique keys, then it
+ // also gets an operator[].
+ template<typename _Key, typename _Value, typename _Ex, bool __unique,
+ typename _Hashtable>
+ struct _Map_base { };
+
+ template<typename _Key, typename _Pair, typename _Hashtable>
+ struct _Map_base<_Key, _Pair, std::_Select1st<_Pair>, false, _Hashtable>
+ {
+ typedef typename _Pair::second_type mapped_type;
+ };
+
+ template<typename _Key, typename _Pair, typename _Hashtable>
+ struct _Map_base<_Key, _Pair, std::_Select1st<_Pair>, true, _Hashtable>
+ {
+ typedef typename _Pair::second_type mapped_type;
+
+ mapped_type&
+ operator[](const _Key& __k);
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 761. unordered_map needs an at() member function.
+ mapped_type&
+ at(const _Key& __k);
+
+ const mapped_type&
+ at(const _Key& __k) const;
+#endif
+ };
+
+ template<typename _Key, typename _Pair, typename _Hashtable>
+ typename _Map_base<_Key, _Pair, std::_Select1st<_Pair>,
+ true, _Hashtable>::mapped_type&
+ _Map_base<_Key, _Pair, std::_Select1st<_Pair>, true, _Hashtable>::
+ operator[](const _Key& __k)
+ {
+ _Hashtable* __h = static_cast<_Hashtable*>(this);
+ typename _Hashtable::_Hash_code_type __code = __h->_M_hash_code(__k);
+ std::size_t __n = __h->_M_bucket_index(__k, __code,
+ __h->_M_bucket_count);
+
+ typename _Hashtable::_Node* __p =
+ __h->_M_find_node(__h->_M_buckets[__n], __k, __code);
+ if (!__p)
+ return __h->_M_insert_bucket(std::make_pair(__k, mapped_type()),
+ __n, __code)->second;
+ return (__p->_M_v).second;
+ }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<typename _Key, typename _Pair, typename _Hashtable>
+ typename _Map_base<_Key, _Pair, std::_Select1st<_Pair>,
+ true, _Hashtable>::mapped_type&
+ _Map_base<_Key, _Pair, std::_Select1st<_Pair>, true, _Hashtable>::
+ at(const _Key& __k)
+ {
+ _Hashtable* __h = static_cast<_Hashtable*>(this);
+ typename _Hashtable::_Hash_code_type __code = __h->_M_hash_code(__k);
+ std::size_t __n = __h->_M_bucket_index(__k, __code,
+ __h->_M_bucket_count);
+
+ typename _Hashtable::_Node* __p =
+ __h->_M_find_node(__h->_M_buckets[__n], __k, __code);
+ if (!__p)
+ __throw_out_of_range(__N("_Map_base::at"));
+ return (__p->_M_v).second;
+ }
+
+ template<typename _Key, typename _Pair, typename _Hashtable>
+ const typename _Map_base<_Key, _Pair, std::_Select1st<_Pair>,
+ true, _Hashtable>::mapped_type&
+ _Map_base<_Key, _Pair, std::_Select1st<_Pair>, true, _Hashtable>::
+ at(const _Key& __k) const
+ {
+ const _Hashtable* __h = static_cast<const _Hashtable*>(this);
+ typename _Hashtable::_Hash_code_type __code = __h->_M_hash_code(__k);
+ std::size_t __n = __h->_M_bucket_index(__k, __code,
+ __h->_M_bucket_count);
+
+ typename _Hashtable::_Node* __p =
+ __h->_M_find_node(__h->_M_buckets[__n], __k, __code);
+ if (!__p)
+ __throw_out_of_range(__N("_Map_base::at"));
+ return (__p->_M_v).second;
+ }
+#endif
+
+ // class template _Rehash_base. Give hashtable the max_load_factor
+ // functions iff the rehash policy is _Prime_rehash_policy.
+ template<typename _RehashPolicy, typename _Hashtable>
+ struct _Rehash_base { };
+
+ template<typename _Hashtable>
+ struct _Rehash_base<_Prime_rehash_policy, _Hashtable>
+ {
+ float
+ max_load_factor() const
+ {
+ const _Hashtable* __this = static_cast<const _Hashtable*>(this);
+ return __this->__rehash_policy().max_load_factor();
+ }
+
+ void
+ max_load_factor(float __z)
+ {
+ _Hashtable* __this = static_cast<_Hashtable*>(this);
+ __this->__rehash_policy(_Prime_rehash_policy(__z));
+ }
+ };
+
+ // Class template _Hash_code_base. Encapsulates two policy issues that
+ // aren't quite orthogonal.
+ // (1) the difference between using a ranged hash function and using
+ // the combination of a hash function and a range-hashing function.
+ // In the former case we don't have such things as hash codes, so
+ // we have a dummy type as placeholder.
+ // (2) Whether or not we cache hash codes. Caching hash codes is
+ // meaningless if we have a ranged hash function.
+ // We also put the key extraction and equality comparison function
+ // objects here, for convenience.
+
+ // Primary template: unused except as a hook for specializations.
+ template<typename _Key, typename _Value,
+ typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash,
+ bool __cache_hash_code>
+ struct _Hash_code_base;
+
+ // Specialization: ranged hash function, no caching hash codes. H1
+ // and H2 are provided but ignored. We define a dummy hash code type.
+ template<typename _Key, typename _Value,
+ typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash>
+ struct _Hash_code_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2,
+ _Hash, false>
+ {
+ protected:
+ _Hash_code_base(const _ExtractKey& __ex, const _Equal& __eq,
+ const _H1&, const _H2&, const _Hash& __h)
+ : _M_extract(__ex), _M_eq(__eq), _M_ranged_hash(__h) { }
+
+ typedef void* _Hash_code_type;
+
+ _Hash_code_type
+ _M_hash_code(const _Key& __key) const
+ { return 0; }
+
+ std::size_t
+ _M_bucket_index(const _Key& __k, _Hash_code_type,
+ std::size_t __n) const
+ { return _M_ranged_hash(__k, __n); }
+
+ std::size_t
+ _M_bucket_index(const _Hash_node<_Value, false>* __p,
+ std::size_t __n) const
+ { return _M_ranged_hash(_M_extract(__p->_M_v), __n); }
+
+ bool
+ _M_compare(const _Key& __k, _Hash_code_type,
+ _Hash_node<_Value, false>* __n) const
+ { return _M_eq(__k, _M_extract(__n->_M_v)); }
+
+ void
+ _M_store_code(_Hash_node<_Value, false>*, _Hash_code_type) const
+ { }
+
+ void
+ _M_copy_code(_Hash_node<_Value, false>*,
+ const _Hash_node<_Value, false>*) const
+ { }
+
+ void
+ _M_swap(_Hash_code_base& __x)
+ {
+ std::swap(_M_extract, __x._M_extract);
+ std::swap(_M_eq, __x._M_eq);
+ std::swap(_M_ranged_hash, __x._M_ranged_hash);
+ }
+
+ protected:
+ _ExtractKey _M_extract;
+ _Equal _M_eq;
+ _Hash _M_ranged_hash;
+ };
+
+
+ // No specialization for ranged hash function while caching hash codes.
+ // That combination is meaningless, and trying to do it is an error.
+
+
+ // Specialization: ranged hash function, cache hash codes. This
+ // combination is meaningless, so we provide only a declaration
+ // and no definition.
+ template<typename _Key, typename _Value,
+ typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2, typename _Hash>
+ struct _Hash_code_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2,
+ _Hash, true>;
+
+ // Specialization: hash function and range-hashing function, no
+ // caching of hash codes. H is provided but ignored. Provides
+ // typedef and accessor required by TR1.
+ template<typename _Key, typename _Value,
+ typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2>
+ struct _Hash_code_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2,
+ _Default_ranged_hash, false>
+ {
+ typedef _H1 hasher;
+
+ hasher
+ hash_function() const
+ { return _M_h1; }
+
+ protected:
+ _Hash_code_base(const _ExtractKey& __ex, const _Equal& __eq,
+ const _H1& __h1, const _H2& __h2,
+ const _Default_ranged_hash&)
+ : _M_extract(__ex), _M_eq(__eq), _M_h1(__h1), _M_h2(__h2) { }
+
+ typedef std::size_t _Hash_code_type;
+
+ _Hash_code_type
+ _M_hash_code(const _Key& __k) const
+ { return _M_h1(__k); }
+
+ std::size_t
+ _M_bucket_index(const _Key&, _Hash_code_type __c,
+ std::size_t __n) const
+ { return _M_h2(__c, __n); }
+
+ std::size_t
+ _M_bucket_index(const _Hash_node<_Value, false>* __p,
+ std::size_t __n) const
+ { return _M_h2(_M_h1(_M_extract(__p->_M_v)), __n); }
+
+ bool
+ _M_compare(const _Key& __k, _Hash_code_type,
+ _Hash_node<_Value, false>* __n) const
+ { return _M_eq(__k, _M_extract(__n->_M_v)); }
+
+ void
+ _M_store_code(_Hash_node<_Value, false>*, _Hash_code_type) const
+ { }
+
+ void
+ _M_copy_code(_Hash_node<_Value, false>*,
+ const _Hash_node<_Value, false>*) const
+ { }
+
+ void
+ _M_swap(_Hash_code_base& __x)
+ {
+ std::swap(_M_extract, __x._M_extract);
+ std::swap(_M_eq, __x._M_eq);
+ std::swap(_M_h1, __x._M_h1);
+ std::swap(_M_h2, __x._M_h2);
+ }
+
+ protected:
+ _ExtractKey _M_extract;
+ _Equal _M_eq;
+ _H1 _M_h1;
+ _H2 _M_h2;
+ };
+
+ // Specialization: hash function and range-hashing function,
+ // caching hash codes. H is provided but ignored. Provides
+ // typedef and accessor required by TR1.
+ template<typename _Key, typename _Value,
+ typename _ExtractKey, typename _Equal,
+ typename _H1, typename _H2>
+ struct _Hash_code_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2,
+ _Default_ranged_hash, true>
+ {
+ typedef _H1 hasher;
+
+ hasher
+ hash_function() const
+ { return _M_h1; }
+
+ protected:
+ _Hash_code_base(const _ExtractKey& __ex, const _Equal& __eq,
+ const _H1& __h1, const _H2& __h2,
+ const _Default_ranged_hash&)
+ : _M_extract(__ex), _M_eq(__eq), _M_h1(__h1), _M_h2(__h2) { }
+
+ typedef std::size_t _Hash_code_type;
+
+ _Hash_code_type
+ _M_hash_code(const _Key& __k) const
+ { return _M_h1(__k); }
+
+ std::size_t
+ _M_bucket_index(const _Key&, _Hash_code_type __c,
+ std::size_t __n) const
+ { return _M_h2(__c, __n); }
+
+ std::size_t
+ _M_bucket_index(const _Hash_node<_Value, true>* __p,
+ std::size_t __n) const
+ { return _M_h2(__p->_M_hash_code, __n); }
+
+ bool
+ _M_compare(const _Key& __k, _Hash_code_type __c,
+ _Hash_node<_Value, true>* __n) const
+ { return __c == __n->_M_hash_code && _M_eq(__k, _M_extract(__n->_M_v)); }
+
+ void
+ _M_store_code(_Hash_node<_Value, true>* __n, _Hash_code_type __c) const
+ { __n->_M_hash_code = __c; }
+
+ void
+ _M_copy_code(_Hash_node<_Value, true>* __to,
+ const _Hash_node<_Value, true>* __from) const
+ { __to->_M_hash_code = __from->_M_hash_code; }
+
+ void
+ _M_swap(_Hash_code_base& __x)
+ {
+ std::swap(_M_extract, __x._M_extract);
+ std::swap(_M_eq, __x._M_eq);
+ std::swap(_M_h1, __x._M_h1);
+ std::swap(_M_h2, __x._M_h2);
+ }
+
+ protected:
+ _ExtractKey _M_extract;
+ _Equal _M_eq;
+ _H1 _M_h1;
+ _H2 _M_h2;
+ };
+} // namespace __detail
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/random b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/random
new file mode 100644
index 0000000..0cf4dc4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/random
@@ -0,0 +1,2407 @@
+// random number generation -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/**
+ * @file tr1_impl/random
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ // [5.1] Random number generation
+
+ /**
+ * @defgroup tr1_random Random Number Generation
+ * @ingroup numerics
+ * A facility for generating random numbers on selected distributions.
+ * @{
+ */
+
+ /*
+ * Implementation-space details.
+ */
+ namespace __detail
+ {
+ template<typename _UIntType, int __w,
+ bool = __w < std::numeric_limits<_UIntType>::digits>
+ struct _Shift
+ { static const _UIntType __value = 0; };
+
+ template<typename _UIntType, int __w>
+ struct _Shift<_UIntType, __w, true>
+ { static const _UIntType __value = _UIntType(1) << __w; };
+
+ template<typename _Tp, _Tp __a, _Tp __c, _Tp __m, bool>
+ struct _Mod;
+
+ // Dispatch based on modulus value to prevent divide-by-zero compile-time
+ // errors when m == 0.
+ template<typename _Tp, _Tp __a, _Tp __c, _Tp __m>
+ inline _Tp
+ __mod(_Tp __x)
+ { return _Mod<_Tp, __a, __c, __m, __m == 0>::__calc(__x); }
+
+ typedef __gnu_cxx::__conditional_type<(sizeof(unsigned) == 4),
+ unsigned, unsigned long>::__type _UInt32Type;
+
+ /*
+ * An adaptor class for converting the output of any Generator into
+ * the input for a specific Distribution.
+ */
+ template<typename _Engine, typename _Distribution>
+ struct _Adaptor
+ {
+ typedef typename remove_reference<_Engine>::type _BEngine;
+ typedef typename _BEngine::result_type _Engine_result_type;
+ typedef typename _Distribution::input_type result_type;
+
+ public:
+ _Adaptor(const _Engine& __g)
+ : _M_g(__g) { }
+
+ result_type
+ min() const
+ {
+ result_type __return_value;
+ if (is_integral<_Engine_result_type>::value
+ && is_integral<result_type>::value)
+ __return_value = _M_g.min();
+ else
+ __return_value = result_type(0);
+ return __return_value;
+ }
+
+ result_type
+ max() const
+ {
+ result_type __return_value;
+ if (is_integral<_Engine_result_type>::value
+ && is_integral<result_type>::value)
+ __return_value = _M_g.max();
+ else if (!is_integral<result_type>::value)
+ __return_value = result_type(1);
+ else
+ __return_value = std::numeric_limits<result_type>::max() - 1;
+ return __return_value;
+ }
+
+ /*
+ * Converts a value generated by the adapted random number generator
+ * into a value in the input domain for the dependent random number
+ * distribution.
+ *
+ * Because the type traits are compile time constants only the
+ * appropriate clause of the if statements will actually be emitted
+ * by the compiler.
+ */
+ result_type
+ operator()()
+ {
+ result_type __return_value;
+ if (is_integral<_Engine_result_type>::value
+ && is_integral<result_type>::value)
+ __return_value = _M_g();
+ else if (!is_integral<_Engine_result_type>::value
+ && !is_integral<result_type>::value)
+ __return_value = result_type(_M_g() - _M_g.min())
+ / result_type(_M_g.max() - _M_g.min());
+ else if (is_integral<_Engine_result_type>::value
+ && !is_integral<result_type>::value)
+ __return_value = result_type(_M_g() - _M_g.min())
+ / result_type(_M_g.max() - _M_g.min() + result_type(1));
+ else
+ __return_value = (((_M_g() - _M_g.min())
+ / (_M_g.max() - _M_g.min()))
+ * std::numeric_limits<result_type>::max());
+ return __return_value;
+ }
+
+ private:
+ _Engine _M_g;
+ };
+
+ // Specialization for _Engine*.
+ template<typename _Engine, typename _Distribution>
+ struct _Adaptor<_Engine*, _Distribution>
+ {
+ typedef typename _Engine::result_type _Engine_result_type;
+ typedef typename _Distribution::input_type result_type;
+
+ public:
+ _Adaptor(_Engine* __g)
+ : _M_g(__g) { }
+
+ result_type
+ min() const
+ {
+ result_type __return_value;
+ if (is_integral<_Engine_result_type>::value
+ && is_integral<result_type>::value)
+ __return_value = _M_g->min();
+ else
+ __return_value = result_type(0);
+ return __return_value;
+ }
+
+ result_type
+ max() const
+ {
+ result_type __return_value;
+ if (is_integral<_Engine_result_type>::value
+ && is_integral<result_type>::value)
+ __return_value = _M_g->max();
+ else if (!is_integral<result_type>::value)
+ __return_value = result_type(1);
+ else
+ __return_value = std::numeric_limits<result_type>::max() - 1;
+ return __return_value;
+ }
+
+ result_type
+ operator()()
+ {
+ result_type __return_value;
+ if (is_integral<_Engine_result_type>::value
+ && is_integral<result_type>::value)
+ __return_value = (*_M_g)();
+ else if (!is_integral<_Engine_result_type>::value
+ && !is_integral<result_type>::value)
+ __return_value = result_type((*_M_g)() - _M_g->min())
+ / result_type(_M_g->max() - _M_g->min());
+ else if (is_integral<_Engine_result_type>::value
+ && !is_integral<result_type>::value)
+ __return_value = result_type((*_M_g)() - _M_g->min())
+ / result_type(_M_g->max() - _M_g->min() + result_type(1));
+ else
+ __return_value = ((((*_M_g)() - _M_g->min())
+ / (_M_g->max() - _M_g->min()))
+ * std::numeric_limits<result_type>::max());
+ return __return_value;
+ }
+
+ private:
+ _Engine* _M_g;
+ };
+ } // namespace __detail
+
+ /**
+ * Produces random numbers on a given distribution function using a
+ * non-uniform random number generation engine.
+ *
+ * @todo the engine_value_type needs to be studied more carefully.
+ */
+ template<typename _Engine, typename _Dist>
+ class variate_generator
+ {
+ // Concept requirements.
+ __glibcxx_class_requires(_Engine, _CopyConstructibleConcept)
+ // __glibcxx_class_requires(_Engine, _EngineConcept)
+ // __glibcxx_class_requires(_Dist, _EngineConcept)
+
+ public:
+ typedef _Engine engine_type;
+ typedef __detail::_Adaptor<_Engine, _Dist> engine_value_type;
+ typedef _Dist distribution_type;
+ typedef typename _Dist::result_type result_type;
+
+ // tr1:5.1.1 table 5.1 requirement
+ typedef typename __gnu_cxx::__enable_if<
+ is_arithmetic<result_type>::value, result_type>::__type _IsValidType;
+
+ /**
+ * Constructs a variate generator with the uniform random number
+ * generator @p __eng for the random distribution @p __dist.
+ *
+ * @throws Any exceptions which may thrown by the copy constructors of
+ * the @p _Engine or @p _Dist objects.
+ */
+ variate_generator(engine_type __eng, distribution_type __dist)
+ : _M_engine(__eng), _M_dist(__dist) { }
+
+ /**
+ * Gets the next generated value on the distribution.
+ */
+ result_type
+ operator()()
+ { return _M_dist(_M_engine); }
+
+ /**
+ * WTF?
+ */
+ template<typename _Tp>
+ result_type
+ operator()(_Tp __value)
+ { return _M_dist(_M_engine, __value); }
+
+ /**
+ * Gets a reference to the underlying uniform random number generator
+ * object.
+ */
+ engine_value_type&
+ engine()
+ { return _M_engine; }
+
+ /**
+ * Gets a const reference to the underlying uniform random number
+ * generator object.
+ */
+ const engine_value_type&
+ engine() const
+ { return _M_engine; }
+
+ /**
+ * Gets a reference to the underlying random distribution.
+ */
+ distribution_type&
+ distribution()
+ { return _M_dist; }
+
+ /**
+ * Gets a const reference to the underlying random distribution.
+ */
+ const distribution_type&
+ distribution() const
+ { return _M_dist; }
+
+ /**
+ * Gets the closed lower bound of the distribution interval.
+ */
+ result_type
+ min() const
+ { return this->distribution().min(); }
+
+ /**
+ * Gets the closed upper bound of the distribution interval.
+ */
+ result_type
+ max() const
+ { return this->distribution().max(); }
+
+ private:
+ engine_value_type _M_engine;
+ distribution_type _M_dist;
+ };
+
+
+ /**
+ * @defgroup tr1_random_generators Random Number Generators
+ * @ingroup tr1_random
+ *
+ * These classes define objects which provide random or pseudorandom
+ * numbers, either from a discrete or a continuous interval. The
+ * random number generator supplied as a part of this library are
+ * all uniform random number generators which provide a sequence of
+ * random number uniformly distributed over their range.
+ *
+ * A number generator is a function object with an operator() that
+ * takes zero arguments and returns a number.
+ *
+ * A compliant random number generator must satisfy the following
+ * requirements. <table border=1 cellpadding=10 cellspacing=0>
+ * <caption align=top>Random Number Generator Requirements</caption>
+ * <tr><td>To be documented.</td></tr> </table>
+ *
+ * @{
+ */
+
+ /**
+ * @brief A model of a linear congruential random number generator.
+ *
+ * A random number generator that produces pseudorandom numbers using the
+ * linear function @f$x_{i+1}\leftarrow(ax_{i} + c) \bmod m @f$.
+ *
+ * The template parameter @p _UIntType must be an unsigned integral type
+ * large enough to store values up to (__m-1). If the template parameter
+ * @p __m is 0, the modulus @p __m used is
+ * std::numeric_limits<_UIntType>::max() plus 1. Otherwise, the template
+ * parameters @p __a and @p __c must be less than @p __m.
+ *
+ * The size of the state is @f$ 1 @f$.
+ */
+ template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
+ class linear_congruential
+ {
+ __glibcxx_class_requires(_UIntType, _UnsignedIntegerConcept)
+ // __glibcpp_class_requires(__a < __m && __c < __m)
+
+ public:
+ /** The type of the generated random value. */
+ typedef _UIntType result_type;
+
+ /** The multiplier. */
+ static const _UIntType multiplier = __a;
+ /** An increment. */
+ static const _UIntType increment = __c;
+ /** The modulus. */
+ static const _UIntType modulus = __m;
+
+ /**
+ * Constructs a %linear_congruential random number generator engine with
+ * seed @p __s. The default seed value is 1.
+ *
+ * @param __s The initial seed value.
+ */
+ explicit
+ linear_congruential(unsigned long __x0 = 1)
+ { this->seed(__x0); }
+
+ /**
+ * Constructs a %linear_congruential random number generator engine
+ * seeded from the generator function @p __g.
+ *
+ * @param __g The seed generator function.
+ */
+ template<class _Gen>
+ linear_congruential(_Gen& __g)
+ { this->seed(__g); }
+
+ /**
+ * Reseeds the %linear_congruential random number generator engine
+ * sequence to the seed @g __s.
+ *
+ * @param __s The new seed.
+ */
+ void
+ seed(unsigned long __s = 1);
+
+ /**
+ * Reseeds the %linear_congruential random number generator engine
+ * sequence using values from the generator function @p __g.
+ *
+ * @param __g the seed generator function.
+ */
+ template<class _Gen>
+ void
+ seed(_Gen& __g)
+ { seed(__g, typename is_fundamental<_Gen>::type()); }
+
+ /**
+ * Gets the smallest possible value in the output range.
+ *
+ * The minimum depends on the @p __c parameter: if it is zero, the
+ * minimum generated must be > 0, otherwise 0 is allowed.
+ */
+ result_type
+ min() const
+ { return (__detail::__mod<_UIntType, 1, 0, __m>(__c) == 0) ? 1 : 0; }
+
+ /**
+ * Gets the largest possible value in the output range.
+ */
+ result_type
+ max() const
+ { return __m - 1; }
+
+ /**
+ * Gets the next random number in the sequence.
+ */
+ result_type
+ operator()();
+
+ /**
+ * Compares two linear congruential random number generator
+ * objects of the same type for equality.
+ *
+ * @param __lhs A linear congruential random number generator object.
+ * @param __rhs Another linear congruential random number generator obj.
+ *
+ * @returns true if the two objects are equal, false otherwise.
+ */
+ friend bool
+ operator==(const linear_congruential& __lhs,
+ const linear_congruential& __rhs)
+ { return __lhs._M_x == __rhs._M_x; }
+
+ /**
+ * Compares two linear congruential random number generator
+ * objects of the same type for inequality.
+ *
+ * @param __lhs A linear congruential random number generator object.
+ * @param __rhs Another linear congruential random number generator obj.
+ *
+ * @returns true if the two objects are not equal, false otherwise.
+ */
+ friend bool
+ operator!=(const linear_congruential& __lhs,
+ const linear_congruential& __rhs)
+ { return !(__lhs == __rhs); }
+
+ /**
+ * Writes the textual representation of the state x(i) of x to @p __os.
+ *
+ * @param __os The output stream.
+ * @param __lcr A % linear_congruential random number generator.
+ * @returns __os.
+ */
+ template<class _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
+ _UIntType1 __m1,
+ typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const linear_congruential<_UIntType1, __a1, __c1,
+ __m1>& __lcr);
+
+ /**
+ * Sets the state of the engine by reading its textual
+ * representation from @p __is.
+ *
+ * The textual representation must have been previously written using an
+ * output stream whose imbued locale and whose type's template
+ * specialization arguments _CharT and _Traits were the same as those of
+ * @p __is.
+ *
+ * @param __is The input stream.
+ * @param __lcr A % linear_congruential random number generator.
+ * @returns __is.
+ */
+ template<class _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
+ _UIntType1 __m1,
+ typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ linear_congruential<_UIntType1, __a1, __c1, __m1>& __lcr);
+
+ private:
+ template<class _Gen>
+ void
+ seed(_Gen& __g, true_type)
+ { return seed(static_cast<unsigned long>(__g)); }
+
+ template<class _Gen>
+ void
+ seed(_Gen& __g, false_type);
+
+ _UIntType _M_x;
+ };
+
+ /**
+ * The classic Minimum Standard rand0 of Lewis, Goodman, and Miller.
+ */
+ typedef linear_congruential<unsigned long, 16807, 0, 2147483647> minstd_rand0;
+
+ /**
+ * An alternative LCR (Lehmer Generator function) .
+ */
+ typedef linear_congruential<unsigned long, 48271, 0, 2147483647> minstd_rand;
+
+
+ /**
+ * A generalized feedback shift register discrete random number generator.
+ *
+ * This algorithm avoids multiplication and division and is designed to be
+ * friendly to a pipelined architecture. If the parameters are chosen
+ * correctly, this generator will produce numbers with a very long period and
+ * fairly good apparent entropy, although still not cryptographically strong.
+ *
+ * The best way to use this generator is with the predefined mt19937 class.
+ *
+ * This algorithm was originally invented by Makoto Matsumoto and
+ * Takuji Nishimura.
+ *
+ * @var word_size The number of bits in each element of the state vector.
+ * @var state_size The degree of recursion.
+ * @var shift_size The period parameter.
+ * @var mask_bits The separation point bit index.
+ * @var parameter_a The last row of the twist matrix.
+ * @var output_u The first right-shift tempering matrix parameter.
+ * @var output_s The first left-shift tempering matrix parameter.
+ * @var output_b The first left-shift tempering matrix mask.
+ * @var output_t The second left-shift tempering matrix parameter.
+ * @var output_c The second left-shift tempering matrix mask.
+ * @var output_l The second right-shift tempering matrix parameter.
+ */
+ template<class _UIntType, int __w, int __n, int __m, int __r,
+ _UIntType __a, int __u, int __s, _UIntType __b, int __t,
+ _UIntType __c, int __l>
+ class mersenne_twister
+ {
+ __glibcxx_class_requires(_UIntType, _UnsignedIntegerConcept)
+
+ public:
+ // types
+ typedef _UIntType result_type;
+
+ // parameter values
+ static const int word_size = __w;
+ static const int state_size = __n;
+ static const int shift_size = __m;
+ static const int mask_bits = __r;
+ static const _UIntType parameter_a = __a;
+ static const int output_u = __u;
+ static const int output_s = __s;
+ static const _UIntType output_b = __b;
+ static const int output_t = __t;
+ static const _UIntType output_c = __c;
+ static const int output_l = __l;
+
+ // constructors and member function
+ mersenne_twister()
+ { seed(); }
+
+ explicit
+ mersenne_twister(unsigned long __value)
+ { seed(__value); }
+
+ template<class _Gen>
+ mersenne_twister(_Gen& __g)
+ { seed(__g); }
+
+ void
+ seed()
+ { seed(5489UL); }
+
+ void
+ seed(unsigned long __value);
+
+ template<class _Gen>
+ void
+ seed(_Gen& __g)
+ { seed(__g, typename is_fundamental<_Gen>::type()); }
+
+ result_type
+ min() const
+ { return 0; };
+
+ result_type
+ max() const
+ { return __detail::_Shift<_UIntType, __w>::__value - 1; }
+
+ result_type
+ operator()();
+
+ /**
+ * Compares two % mersenne_twister random number generator objects of
+ * the same type for equality.
+ *
+ * @param __lhs A % mersenne_twister random number generator object.
+ * @param __rhs Another % mersenne_twister random number generator
+ * object.
+ *
+ * @returns true if the two objects are equal, false otherwise.
+ */
+ friend bool
+ operator==(const mersenne_twister& __lhs,
+ const mersenne_twister& __rhs)
+ { return std::equal(__lhs._M_x, __lhs._M_x + state_size, __rhs._M_x); }
+
+ /**
+ * Compares two % mersenne_twister random number generator objects of
+ * the same type for inequality.
+ *
+ * @param __lhs A % mersenne_twister random number generator object.
+ * @param __rhs Another % mersenne_twister random number generator
+ * object.
+ *
+ * @returns true if the two objects are not equal, false otherwise.
+ */
+ friend bool
+ operator!=(const mersenne_twister& __lhs,
+ const mersenne_twister& __rhs)
+ { return !(__lhs == __rhs); }
+
+ /**
+ * Inserts the current state of a % mersenne_twister random number
+ * generator engine @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A % mersenne_twister random number generator engine.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<class _UIntType1, int __w1, int __n1, int __m1, int __r1,
+ _UIntType1 __a1, int __u1, int __s1, _UIntType1 __b1, int __t1,
+ _UIntType1 __c1, int __l1,
+ typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const mersenne_twister<_UIntType1, __w1, __n1, __m1, __r1,
+ __a1, __u1, __s1, __b1, __t1, __c1, __l1>& __x);
+
+ /**
+ * Extracts the current state of a % mersenne_twister random number
+ * generator engine @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A % mersenne_twister random number generator engine.
+ *
+ * @returns The input stream with the state of @p __x extracted or in
+ * an error state.
+ */
+ template<class _UIntType1, int __w1, int __n1, int __m1, int __r1,
+ _UIntType1 __a1, int __u1, int __s1, _UIntType1 __b1, int __t1,
+ _UIntType1 __c1, int __l1,
+ typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ mersenne_twister<_UIntType1, __w1, __n1, __m1, __r1,
+ __a1, __u1, __s1, __b1, __t1, __c1, __l1>& __x);
+
+ private:
+ template<class _Gen>
+ void
+ seed(_Gen& __g, true_type)
+ { return seed(static_cast<unsigned long>(__g)); }
+
+ template<class _Gen>
+ void
+ seed(_Gen& __g, false_type);
+
+ _UIntType _M_x[state_size];
+ int _M_p;
+ };
+
+ /**
+ * The classic Mersenne Twister.
+ *
+ * Reference:
+ * M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-Dimensionally
+ * Equidistributed Uniform Pseudo-Random Number Generator", ACM Transactions
+ * on Modeling and Computer Simulation, Vol. 8, No. 1, January 1998, pp 3-30.
+ */
+ typedef mersenne_twister<
+ unsigned long, 32, 624, 397, 31,
+ 0x9908b0dful, 11, 7,
+ 0x9d2c5680ul, 15,
+ 0xefc60000ul, 18
+ > mt19937;
+
+
+ /**
+ * @brief The Marsaglia-Zaman generator.
+ *
+ * This is a model of a Generalized Fibonacci discrete random number
+ * generator, sometimes referred to as the SWC generator.
+ *
+ * A discrete random number generator that produces pseudorandom
+ * numbers using @f$x_{i}\leftarrow(x_{i - s} - x_{i - r} -
+ * carry_{i-1}) \bmod m @f$.
+ *
+ * The size of the state is @f$ r @f$
+ * and the maximum period of the generator is @f$ m^r - m^s -1 @f$.
+ *
+ * N1688[4.13] says "the template parameter _IntType shall denote an integral
+ * type large enough to store values up to m."
+ *
+ * @var _M_x The state of the generator. This is a ring buffer.
+ * @var _M_carry The carry.
+ * @var _M_p Current index of x(i - r).
+ */
+ template<typename _IntType, _IntType __m, int __s, int __r>
+ class subtract_with_carry
+ {
+ __glibcxx_class_requires(_IntType, _IntegerConcept)
+
+ public:
+ /** The type of the generated random value. */
+ typedef _IntType result_type;
+
+ // parameter values
+ static const _IntType modulus = __m;
+ static const int long_lag = __r;
+ static const int short_lag = __s;
+
+ /**
+ * Constructs a default-initialized % subtract_with_carry random number
+ * generator.
+ */
+ subtract_with_carry()
+ { this->seed(); }
+
+ /**
+ * Constructs an explicitly seeded % subtract_with_carry random number
+ * generator.
+ */
+ explicit
+ subtract_with_carry(unsigned long __value)
+ { this->seed(__value); }
+
+ /**
+ * Constructs a %subtract_with_carry random number generator engine
+ * seeded from the generator function @p __g.
+ *
+ * @param __g The seed generator function.
+ */
+ template<class _Gen>
+ subtract_with_carry(_Gen& __g)
+ { this->seed(__g); }
+
+ /**
+ * Seeds the initial state @f$ x_0 @f$ of the random number generator.
+ *
+ * N1688[4.19] modifies this as follows. If @p __value == 0,
+ * sets value to 19780503. In any case, with a linear
+ * congruential generator lcg(i) having parameters @f$ m_{lcg} =
+ * 2147483563, a_{lcg} = 40014, c_{lcg} = 0, and lcg(0) = value
+ * @f$, sets @f$ x_{-r} \dots x_{-1} @f$ to @f$ lcg(1) \bmod m
+ * \dots lcg(r) \bmod m @f$ respectively. If @f$ x_{-1} = 0 @f$
+ * set carry to 1, otherwise sets carry to 0.
+ */
+ void
+ seed(unsigned long __value = 19780503);
+
+ /**
+ * Seeds the initial state @f$ x_0 @f$ of the % subtract_with_carry
+ * random number generator.
+ */
+ template<class _Gen>
+ void
+ seed(_Gen& __g)
+ { seed(__g, typename is_fundamental<_Gen>::type()); }
+
+ /**
+ * Gets the inclusive minimum value of the range of random integers
+ * returned by this generator.
+ */
+ result_type
+ min() const
+ { return 0; }
+
+ /**
+ * Gets the inclusive maximum value of the range of random integers
+ * returned by this generator.
+ */
+ result_type
+ max() const
+ { return this->modulus - 1; }
+
+ /**
+ * Gets the next random number in the sequence.
+ */
+ result_type
+ operator()();
+
+ /**
+ * Compares two % subtract_with_carry random number generator objects of
+ * the same type for equality.
+ *
+ * @param __lhs A % subtract_with_carry random number generator object.
+ * @param __rhs Another % subtract_with_carry random number generator
+ * object.
+ *
+ * @returns true if the two objects are equal, false otherwise.
+ */
+ friend bool
+ operator==(const subtract_with_carry& __lhs,
+ const subtract_with_carry& __rhs)
+ { return std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x); }
+
+ /**
+ * Compares two % subtract_with_carry random number generator objects of
+ * the same type for inequality.
+ *
+ * @param __lhs A % subtract_with_carry random number generator object.
+ * @param __rhs Another % subtract_with_carry random number generator
+ * object.
+ *
+ * @returns true if the two objects are not equal, false otherwise.
+ */
+ friend bool
+ operator!=(const subtract_with_carry& __lhs,
+ const subtract_with_carry& __rhs)
+ { return !(__lhs == __rhs); }
+
+ /**
+ * Inserts the current state of a % subtract_with_carry random number
+ * generator engine @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A % subtract_with_carry random number generator engine.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _IntType1, _IntType1 __m1, int __s1, int __r1,
+ typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const subtract_with_carry<_IntType1, __m1, __s1,
+ __r1>& __x);
+
+ /**
+ * Extracts the current state of a % subtract_with_carry random number
+ * generator engine @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A % subtract_with_carry random number generator engine.
+ *
+ * @returns The input stream with the state of @p __x extracted or in
+ * an error state.
+ */
+ template<typename _IntType1, _IntType1 __m1, int __s1, int __r1,
+ typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ subtract_with_carry<_IntType1, __m1, __s1, __r1>& __x);
+
+ private:
+ template<class _Gen>
+ void
+ seed(_Gen& __g, true_type)
+ { return seed(static_cast<unsigned long>(__g)); }
+
+ template<class _Gen>
+ void
+ seed(_Gen& __g, false_type);
+
+ typedef typename __gnu_cxx::__add_unsigned<_IntType>::__type _UIntType;
+
+ _UIntType _M_x[long_lag];
+ _UIntType _M_carry;
+ int _M_p;
+ };
+
+
+ /**
+ * @brief The Marsaglia-Zaman generator (floats version).
+ *
+ * @var _M_x The state of the generator. This is a ring buffer.
+ * @var _M_carry The carry.
+ * @var _M_p Current index of x(i - r).
+ * @var _M_npows Precomputed negative powers of 2.
+ */
+ template<typename _RealType, int __w, int __s, int __r>
+ class subtract_with_carry_01
+ {
+ public:
+ /** The type of the generated random value. */
+ typedef _RealType result_type;
+
+ // parameter values
+ static const int word_size = __w;
+ static const int long_lag = __r;
+ static const int short_lag = __s;
+
+ /**
+ * Constructs a default-initialized % subtract_with_carry_01 random
+ * number generator.
+ */
+ subtract_with_carry_01()
+ {
+ this->seed();
+ _M_initialize_npows();
+ }
+
+ /**
+ * Constructs an explicitly seeded % subtract_with_carry_01 random number
+ * generator.
+ */
+ explicit
+ subtract_with_carry_01(unsigned long __value)
+ {
+ this->seed(__value);
+ _M_initialize_npows();
+ }
+
+ /**
+ * Constructs a % subtract_with_carry_01 random number generator engine
+ * seeded from the generator function @p __g.
+ *
+ * @param __g The seed generator function.
+ */
+ template<class _Gen>
+ subtract_with_carry_01(_Gen& __g)
+ {
+ this->seed(__g);
+ _M_initialize_npows();
+ }
+
+ /**
+ * Seeds the initial state @f$ x_0 @f$ of the random number generator.
+ */
+ void
+ seed(unsigned long __value = 19780503);
+
+ /**
+ * Seeds the initial state @f$ x_0 @f$ of the % subtract_with_carry_01
+ * random number generator.
+ */
+ template<class _Gen>
+ void
+ seed(_Gen& __g)
+ { seed(__g, typename is_fundamental<_Gen>::type()); }
+
+ /**
+ * Gets the minimum value of the range of random floats
+ * returned by this generator.
+ */
+ result_type
+ min() const
+ { return 0.0; }
+
+ /**
+ * Gets the maximum value of the range of random floats
+ * returned by this generator.
+ */
+ result_type
+ max() const
+ { return 1.0; }
+
+ /**
+ * Gets the next random number in the sequence.
+ */
+ result_type
+ operator()();
+
+ /**
+ * Compares two % subtract_with_carry_01 random number generator objects
+ * of the same type for equality.
+ *
+ * @param __lhs A % subtract_with_carry_01 random number
+ * generator object.
+ * @param __rhs Another % subtract_with_carry_01 random number generator
+ * object.
+ *
+ * @returns true if the two objects are equal, false otherwise.
+ */
+ friend bool
+ operator==(const subtract_with_carry_01& __lhs,
+ const subtract_with_carry_01& __rhs)
+ {
+ for (int __i = 0; __i < long_lag; ++__i)
+ if (!std::equal(__lhs._M_x[__i], __lhs._M_x[__i] + __n,
+ __rhs._M_x[__i]))
+ return false;
+ return true;
+ }
+
+ /**
+ * Compares two % subtract_with_carry_01 random number generator objects
+ * of the same type for inequality.
+ *
+ * @param __lhs A % subtract_with_carry_01 random number
+ * generator object.
+ *
+ * @param __rhs Another % subtract_with_carry_01 random number generator
+ * object.
+ *
+ * @returns true if the two objects are not equal, false otherwise.
+ */
+ friend bool
+ operator!=(const subtract_with_carry_01& __lhs,
+ const subtract_with_carry_01& __rhs)
+ { return !(__lhs == __rhs); }
+
+ /**
+ * Inserts the current state of a % subtract_with_carry_01 random number
+ * generator engine @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A % subtract_with_carry_01 random number generator engine.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _RealType1, int __w1, int __s1, int __r1,
+ typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const subtract_with_carry_01<_RealType1, __w1, __s1,
+ __r1>& __x);
+
+ /**
+ * Extracts the current state of a % subtract_with_carry_01 random number
+ * generator engine @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A % subtract_with_carry_01 random number generator engine.
+ *
+ * @returns The input stream with the state of @p __x extracted or in
+ * an error state.
+ */
+ template<typename _RealType1, int __w1, int __s1, int __r1,
+ typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ subtract_with_carry_01<_RealType1, __w1, __s1, __r1>& __x);
+
+ private:
+ template<class _Gen>
+ void
+ seed(_Gen& __g, true_type)
+ { return seed(static_cast<unsigned long>(__g)); }
+
+ template<class _Gen>
+ void
+ seed(_Gen& __g, false_type);
+
+ void
+ _M_initialize_npows();
+
+ static const int __n = (__w + 31) / 32;
+
+ typedef __detail::_UInt32Type _UInt32Type;
+ _UInt32Type _M_x[long_lag][__n];
+ _RealType _M_npows[__n];
+ _UInt32Type _M_carry;
+ int _M_p;
+ };
+
+ typedef subtract_with_carry_01<float, 24, 10, 24> ranlux_base_01;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 508. Bad parameters for ranlux64_base_01.
+ typedef subtract_with_carry_01<double, 48, 5, 12> ranlux64_base_01;
+
+
+ /**
+ * Produces random numbers from some base engine by discarding blocks of
+ * data.
+ *
+ * 0 <= @p __r <= @p __p
+ */
+ template<class _UniformRandomNumberGenerator, int __p, int __r>
+ class discard_block
+ {
+ // __glibcxx_class_requires(typename base_type::result_type,
+ // ArithmeticTypeConcept)
+
+ public:
+ /** The type of the underlying generator engine. */
+ typedef _UniformRandomNumberGenerator base_type;
+ /** The type of the generated random value. */
+ typedef typename base_type::result_type result_type;
+
+ // parameter values
+ static const int block_size = __p;
+ static const int used_block = __r;
+
+ /**
+ * Constructs a default %discard_block engine.
+ *
+ * The underlying engine is default constructed as well.
+ */
+ discard_block()
+ : _M_n(0) { }
+
+ /**
+ * Copy constructs a %discard_block engine.
+ *
+ * Copies an existing base class random number generator.
+ * @param rng An existing (base class) engine object.
+ */
+ explicit
+ discard_block(const base_type& __rng)
+ : _M_b(__rng), _M_n(0) { }
+
+ /**
+ * Seed constructs a %discard_block engine.
+ *
+ * Constructs the underlying generator engine seeded with @p __s.
+ * @param __s A seed value for the base class engine.
+ */
+ explicit
+ discard_block(unsigned long __s)
+ : _M_b(__s), _M_n(0) { }
+
+ /**
+ * Generator construct a %discard_block engine.
+ *
+ * @param __g A seed generator function.
+ */
+ template<class _Gen>
+ discard_block(_Gen& __g)
+ : _M_b(__g), _M_n(0) { }
+
+ /**
+ * Reseeds the %discard_block object with the default seed for the
+ * underlying base class generator engine.
+ */
+ void seed()
+ {
+ _M_b.seed();
+ _M_n = 0;
+ }
+
+ /**
+ * Reseeds the %discard_block object with the given seed generator
+ * function.
+ * @param __g A seed generator function.
+ */
+ template<class _Gen>
+ void seed(_Gen& __g)
+ {
+ _M_b.seed(__g);
+ _M_n = 0;
+ }
+
+ /**
+ * Gets a const reference to the underlying generator engine object.
+ */
+ const base_type&
+ base() const
+ { return _M_b; }
+
+ /**
+ * Gets the minimum value in the generated random number range.
+ */
+ result_type
+ min() const
+ { return _M_b.min(); }
+
+ /**
+ * Gets the maximum value in the generated random number range.
+ */
+ result_type
+ max() const
+ { return _M_b.max(); }
+
+ /**
+ * Gets the next value in the generated random number sequence.
+ */
+ result_type
+ operator()();
+
+ /**
+ * Compares two %discard_block random number generator objects of
+ * the same type for equality.
+ *
+ * @param __lhs A %discard_block random number generator object.
+ * @param __rhs Another %discard_block random number generator
+ * object.
+ *
+ * @returns true if the two objects are equal, false otherwise.
+ */
+ friend bool
+ operator==(const discard_block& __lhs, const discard_block& __rhs)
+ { return (__lhs._M_b == __rhs._M_b) && (__lhs._M_n == __rhs._M_n); }
+
+ /**
+ * Compares two %discard_block random number generator objects of
+ * the same type for inequality.
+ *
+ * @param __lhs A %discard_block random number generator object.
+ * @param __rhs Another %discard_block random number generator
+ * object.
+ *
+ * @returns true if the two objects are not equal, false otherwise.
+ */
+ friend bool
+ operator!=(const discard_block& __lhs, const discard_block& __rhs)
+ { return !(__lhs == __rhs); }
+
+ /**
+ * Inserts the current state of a %discard_block random number
+ * generator engine @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A %discard_block random number generator engine.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<class _UniformRandomNumberGenerator1, int __p1, int __r1,
+ typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const discard_block<_UniformRandomNumberGenerator1,
+ __p1, __r1>& __x);
+
+ /**
+ * Extracts the current state of a % subtract_with_carry random number
+ * generator engine @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %discard_block random number generator engine.
+ *
+ * @returns The input stream with the state of @p __x extracted or in
+ * an error state.
+ */
+ template<class _UniformRandomNumberGenerator1, int __p1, int __r1,
+ typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ discard_block<_UniformRandomNumberGenerator1,
+ __p1, __r1>& __x);
+
+ private:
+ base_type _M_b;
+ int _M_n;
+ };
+
+
+ /**
+ * James's luxury-level-3 integer adaptation of Luescher's generator.
+ */
+ typedef discard_block<
+ subtract_with_carry<unsigned long, (1UL << 24), 10, 24>,
+ 223,
+ 24
+ > ranlux3;
+
+ /**
+ * James's luxury-level-4 integer adaptation of Luescher's generator.
+ */
+ typedef discard_block<
+ subtract_with_carry<unsigned long, (1UL << 24), 10, 24>,
+ 389,
+ 24
+ > ranlux4;
+
+ typedef discard_block<
+ subtract_with_carry_01<float, 24, 10, 24>,
+ 223,
+ 24
+ > ranlux3_01;
+
+ typedef discard_block<
+ subtract_with_carry_01<float, 24, 10, 24>,
+ 389,
+ 24
+ > ranlux4_01;
+
+
+ /**
+ * A random number generator adaptor class that combines two random number
+ * generator engines into a single output sequence.
+ */
+ template<class _UniformRandomNumberGenerator1, int __s1,
+ class _UniformRandomNumberGenerator2, int __s2>
+ class xor_combine
+ {
+ // __glibcxx_class_requires(typename _UniformRandomNumberGenerator1::
+ // result_type, ArithmeticTypeConcept)
+ // __glibcxx_class_requires(typename _UniformRandomNumberGenerator2::
+ // result_type, ArithmeticTypeConcept)
+
+ public:
+ /** The type of the first underlying generator engine. */
+ typedef _UniformRandomNumberGenerator1 base1_type;
+ /** The type of the second underlying generator engine. */
+ typedef _UniformRandomNumberGenerator2 base2_type;
+
+ private:
+ typedef typename base1_type::result_type _Result_type1;
+ typedef typename base2_type::result_type _Result_type2;
+
+ public:
+ /** The type of the generated random value. */
+ typedef typename __gnu_cxx::__conditional_type<(sizeof(_Result_type1)
+ > sizeof(_Result_type2)),
+ _Result_type1, _Result_type2>::__type result_type;
+
+ // parameter values
+ static const int shift1 = __s1;
+ static const int shift2 = __s2;
+
+ // constructors and member function
+ xor_combine()
+ : _M_b1(), _M_b2()
+ { _M_initialize_max(); }
+
+ xor_combine(const base1_type& __rng1, const base2_type& __rng2)
+ : _M_b1(__rng1), _M_b2(__rng2)
+ { _M_initialize_max(); }
+
+ xor_combine(unsigned long __s)
+ : _M_b1(__s), _M_b2(__s + 1)
+ { _M_initialize_max(); }
+
+ template<class _Gen>
+ xor_combine(_Gen& __g)
+ : _M_b1(__g), _M_b2(__g)
+ { _M_initialize_max(); }
+
+ void
+ seed()
+ {
+ _M_b1.seed();
+ _M_b2.seed();
+ }
+
+ template<class _Gen>
+ void
+ seed(_Gen& __g)
+ {
+ _M_b1.seed(__g);
+ _M_b2.seed(__g);
+ }
+
+ const base1_type&
+ base1() const
+ { return _M_b1; }
+
+ const base2_type&
+ base2() const
+ { return _M_b2; }
+
+ result_type
+ min() const
+ { return 0; }
+
+ result_type
+ max() const
+ { return _M_max; }
+
+ /**
+ * Gets the next random number in the sequence.
+ */
+ // NB: Not exactly the TR1 formula, per N2079 instead.
+ result_type
+ operator()()
+ {
+ return ((result_type(_M_b1() - _M_b1.min()) << shift1)
+ ^ (result_type(_M_b2() - _M_b2.min()) << shift2));
+ }
+
+ /**
+ * Compares two %xor_combine random number generator objects of
+ * the same type for equality.
+ *
+ * @param __lhs A %xor_combine random number generator object.
+ * @param __rhs Another %xor_combine random number generator
+ * object.
+ *
+ * @returns true if the two objects are equal, false otherwise.
+ */
+ friend bool
+ operator==(const xor_combine& __lhs, const xor_combine& __rhs)
+ {
+ return (__lhs.base1() == __rhs.base1())
+ && (__lhs.base2() == __rhs.base2());
+ }
+
+ /**
+ * Compares two %xor_combine random number generator objects of
+ * the same type for inequality.
+ *
+ * @param __lhs A %xor_combine random number generator object.
+ * @param __rhs Another %xor_combine random number generator
+ * object.
+ *
+ * @returns true if the two objects are not equal, false otherwise.
+ */
+ friend bool
+ operator!=(const xor_combine& __lhs, const xor_combine& __rhs)
+ { return !(__lhs == __rhs); }
+
+ /**
+ * Inserts the current state of a %xor_combine random number
+ * generator engine @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A %xor_combine random number generator engine.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<class _UniformRandomNumberGenerator11, int __s11,
+ class _UniformRandomNumberGenerator21, int __s21,
+ typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const xor_combine<_UniformRandomNumberGenerator11, __s11,
+ _UniformRandomNumberGenerator21, __s21>& __x);
+
+ /**
+ * Extracts the current state of a %xor_combine random number
+ * generator engine @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %xor_combine random number generator engine.
+ *
+ * @returns The input stream with the state of @p __x extracted or in
+ * an error state.
+ */
+ template<class _UniformRandomNumberGenerator11, int __s11,
+ class _UniformRandomNumberGenerator21, int __s21,
+ typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ xor_combine<_UniformRandomNumberGenerator11, __s11,
+ _UniformRandomNumberGenerator21, __s21>& __x);
+
+ private:
+ void
+ _M_initialize_max();
+
+ result_type
+ _M_initialize_max_aux(result_type, result_type, int);
+
+ base1_type _M_b1;
+ base2_type _M_b2;
+ result_type _M_max;
+ };
+
+
+ /**
+ * A standard interface to a platform-specific non-deterministic
+ * random number generator (if any are available).
+ */
+ class random_device
+ {
+ public:
+ // types
+ typedef unsigned int result_type;
+
+ // constructors, destructors and member functions
+
+#ifdef _GLIBCXX_USE_RANDOM_TR1
+
+ explicit
+ random_device(const std::string& __token = "/dev/urandom")
+ {
+ if ((__token != "/dev/urandom" && __token != "/dev/random")
+ || !(_M_file = std::fopen(__token.c_str(), "rb")))
+ std::__throw_runtime_error(__N("random_device::"
+ "random_device(const std::string&)"));
+ }
+
+ ~random_device()
+ { std::fclose(_M_file); }
+
+#else
+
+ explicit
+ random_device(const std::string& __token = "mt19937")
+ : _M_mt(_M_strtoul(__token)) { }
+
+ private:
+ static unsigned long
+ _M_strtoul(const std::string& __str)
+ {
+ unsigned long __ret = 5489UL;
+ if (__str != "mt19937")
+ {
+ const char* __nptr = __str.c_str();
+ char* __endptr;
+ __ret = std::strtoul(__nptr, &__endptr, 0);
+ if (*__nptr == '\0' || *__endptr != '\0')
+ std::__throw_runtime_error(__N("random_device::_M_strtoul"
+ "(const std::string&)"));
+ }
+ return __ret;
+ }
+
+ public:
+
+#endif
+
+ result_type
+ min() const
+ { return std::numeric_limits<result_type>::min(); }
+
+ result_type
+ max() const
+ { return std::numeric_limits<result_type>::max(); }
+
+ double
+ entropy() const
+ { return 0.0; }
+
+ result_type
+ operator()()
+ {
+#ifdef _GLIBCXX_USE_RANDOM_TR1
+ result_type __ret;
+ std::fread(reinterpret_cast<void*>(&__ret), sizeof(result_type),
+ 1, _M_file);
+ return __ret;
+#else
+ return _M_mt();
+#endif
+ }
+
+ private:
+ random_device(const random_device&);
+ void operator=(const random_device&);
+
+#ifdef _GLIBCXX_USE_RANDOM_TR1
+ FILE* _M_file;
+#else
+ mt19937 _M_mt;
+#endif
+ };
+
+ /* @} */ // group tr1_random_generators
+
+ /**
+ * @defgroup tr1_random_distributions Random Number Distributions
+ * @ingroup tr1_random
+ * @{
+ */
+
+ /**
+ * @defgroup tr1_random_distributions_discrete Discrete Distributions
+ * @ingroup tr1_random_distributions
+ * @{
+ */
+
+ /**
+ * @brief Uniform discrete distribution for random numbers.
+ * A discrete random distribution on the range @f$[min, max]@f$ with equal
+ * probability throughout the range.
+ */
+ template<typename _IntType = int>
+ class uniform_int
+ {
+ __glibcxx_class_requires(_IntType, _IntegerConcept)
+
+ public:
+ /** The type of the parameters of the distribution. */
+ typedef _IntType input_type;
+ /** The type of the range of the distribution. */
+ typedef _IntType result_type;
+
+ public:
+ /**
+ * Constructs a uniform distribution object.
+ */
+ explicit
+ uniform_int(_IntType __min = 0, _IntType __max = 9)
+ : _M_min(__min), _M_max(__max)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_min <= _M_max);
+ }
+
+ /**
+ * Gets the inclusive lower bound of the distribution range.
+ */
+ result_type
+ min() const
+ { return _M_min; }
+
+ /**
+ * Gets the inclusive upper bound of the distribution range.
+ */
+ result_type
+ max() const
+ { return _M_max; }
+
+ /**
+ * Resets the distribution state.
+ *
+ * Does nothing for the uniform integer distribution.
+ */
+ void
+ reset() { }
+
+ /**
+ * Gets a uniformly distributed random number in the range
+ * @f$(min, max)@f$.
+ */
+ template<typename _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng)
+ {
+ typedef typename _UniformRandomNumberGenerator::result_type
+ _UResult_type;
+ return _M_call(__urng, _M_min, _M_max,
+ typename is_integral<_UResult_type>::type());
+ }
+
+ /**
+ * Gets a uniform random number in the range @f$[0, n)@f$.
+ *
+ * This function is aimed at use with std::random_shuffle.
+ */
+ template<typename _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng, result_type __n)
+ {
+ typedef typename _UniformRandomNumberGenerator::result_type
+ _UResult_type;
+ return _M_call(__urng, 0, __n - 1,
+ typename is_integral<_UResult_type>::type());
+ }
+
+ /**
+ * Inserts a %uniform_int random number distribution @p __x into the
+ * output stream @p os.
+ *
+ * @param __os An output stream.
+ * @param __x A %uniform_int random number distribution.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _IntType1, typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const uniform_int<_IntType1>& __x);
+
+ /**
+ * Extracts a %uniform_int random number distribution
+ * @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %uniform_int random number generator engine.
+ *
+ * @returns The input stream with @p __x extracted or in an error state.
+ */
+ template<typename _IntType1, typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ uniform_int<_IntType1>& __x);
+
+ private:
+ template<typename _UniformRandomNumberGenerator>
+ result_type
+ _M_call(_UniformRandomNumberGenerator& __urng,
+ result_type __min, result_type __max, true_type);
+
+ template<typename _UniformRandomNumberGenerator>
+ result_type
+ _M_call(_UniformRandomNumberGenerator& __urng,
+ result_type __min, result_type __max, false_type)
+ {
+ return result_type((__urng() - __urng.min())
+ / (__urng.max() - __urng.min())
+ * (__max - __min + 1)) + __min;
+ }
+
+ _IntType _M_min;
+ _IntType _M_max;
+ };
+
+
+ /**
+ * @brief A Bernoulli random number distribution.
+ *
+ * Generates a sequence of true and false values with likelihood @f$ p @f$
+ * that true will come up and @f$ (1 - p) @f$ that false will appear.
+ */
+ class bernoulli_distribution
+ {
+ public:
+ typedef int input_type;
+ typedef bool result_type;
+
+ public:
+ /**
+ * Constructs a Bernoulli distribution with likelihood @p p.
+ *
+ * @param __p [IN] The likelihood of a true result being returned. Must
+ * be in the interval @f$ [0, 1] @f$.
+ */
+ explicit
+ bernoulli_distribution(double __p = 0.5)
+ : _M_p(__p)
+ {
+ _GLIBCXX_DEBUG_ASSERT((_M_p >= 0.0) && (_M_p <= 1.0));
+ }
+
+ /**
+ * Gets the @p p parameter of the distribution.
+ */
+ double
+ p() const
+ { return _M_p; }
+
+ /**
+ * Resets the distribution state.
+ *
+ * Does nothing for a Bernoulli distribution.
+ */
+ void
+ reset() { }
+
+ /**
+ * Gets the next value in the Bernoullian sequence.
+ */
+ template<class _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng)
+ {
+ if ((__urng() - __urng.min()) < _M_p * (__urng.max() - __urng.min()))
+ return true;
+ return false;
+ }
+
+ /**
+ * Inserts a %bernoulli_distribution random number distribution
+ * @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A %bernoulli_distribution random number distribution.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const bernoulli_distribution& __x);
+
+ /**
+ * Extracts a %bernoulli_distribution random number distribution
+ * @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %bernoulli_distribution random number generator engine.
+ *
+ * @returns The input stream with @p __x extracted or in an error state.
+ */
+ template<typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ bernoulli_distribution& __x)
+ { return __is >> __x._M_p; }
+
+ private:
+ double _M_p;
+ };
+
+
+ /**
+ * @brief A discrete geometric random number distribution.
+ *
+ * The formula for the geometric probability mass function is
+ * @f$ p(i) = (1 - p)p^{i-1} @f$ where @f$ p @f$ is the parameter of the
+ * distribution.
+ */
+ template<typename _IntType = int, typename _RealType = double>
+ class geometric_distribution
+ {
+ public:
+ // types
+ typedef _RealType input_type;
+ typedef _IntType result_type;
+
+ // constructors and member function
+ explicit
+ geometric_distribution(const _RealType& __p = _RealType(0.5))
+ : _M_p(__p)
+ {
+ _GLIBCXX_DEBUG_ASSERT((_M_p > 0.0) && (_M_p < 1.0));
+ _M_initialize();
+ }
+
+ /**
+ * Gets the distribution parameter @p p.
+ */
+ _RealType
+ p() const
+ { return _M_p; }
+
+ void
+ reset() { }
+
+ template<class _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng);
+
+ /**
+ * Inserts a %geometric_distribution random number distribution
+ * @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A %geometric_distribution random number distribution.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _IntType1, typename _RealType1,
+ typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const geometric_distribution<_IntType1, _RealType1>& __x);
+
+ /**
+ * Extracts a %geometric_distribution random number distribution
+ * @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %geometric_distribution random number generator engine.
+ *
+ * @returns The input stream with @p __x extracted or in an error state.
+ */
+ template<typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ geometric_distribution& __x)
+ {
+ __is >> __x._M_p;
+ __x._M_initialize();
+ return __is;
+ }
+
+ private:
+ void
+ _M_initialize()
+ { _M_log_p = std::log(_M_p); }
+
+ _RealType _M_p;
+ _RealType _M_log_p;
+ };
+
+
+ template<typename _RealType>
+ class normal_distribution;
+
+ /**
+ * @brief A discrete Poisson random number distribution.
+ *
+ * The formula for the Poisson probability mass function is
+ * @f$ p(i) = \frac{mean^i}{i!} e^{-mean} @f$ where @f$ mean @f$ is the
+ * parameter of the distribution.
+ */
+ template<typename _IntType = int, typename _RealType = double>
+ class poisson_distribution
+ {
+ public:
+ // types
+ typedef _RealType input_type;
+ typedef _IntType result_type;
+
+ // constructors and member function
+ explicit
+ poisson_distribution(const _RealType& __mean = _RealType(1))
+ : _M_mean(__mean), _M_nd()
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_mean > 0.0);
+ _M_initialize();
+ }
+
+ /**
+ * Gets the distribution parameter @p mean.
+ */
+ _RealType
+ mean() const
+ { return _M_mean; }
+
+ void
+ reset()
+ { _M_nd.reset(); }
+
+ template<class _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng);
+
+ /**
+ * Inserts a %poisson_distribution random number distribution
+ * @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A %poisson_distribution random number distribution.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _IntType1, typename _RealType1,
+ typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const poisson_distribution<_IntType1, _RealType1>& __x);
+
+ /**
+ * Extracts a %poisson_distribution random number distribution
+ * @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %poisson_distribution random number generator engine.
+ *
+ * @returns The input stream with @p __x extracted or in an error state.
+ */
+ template<typename _IntType1, typename _RealType1,
+ typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ poisson_distribution<_IntType1, _RealType1>& __x);
+
+ private:
+ void
+ _M_initialize();
+
+ // NB: Unused when _GLIBCXX_USE_C99_MATH_TR1 is undefined.
+ normal_distribution<_RealType> _M_nd;
+
+ _RealType _M_mean;
+
+ // Hosts either log(mean) or the threshold of the simple method.
+ _RealType _M_lm_thr;
+#if _GLIBCXX_USE_C99_MATH_TR1
+ _RealType _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
+#endif
+ };
+
+
+ /**
+ * @brief A discrete binomial random number distribution.
+ *
+ * The formula for the binomial probability mass function is
+ * @f$ p(i) = \binom{n}{i} p^i (1 - p)^{t - i} @f$ where @f$ t @f$
+ * and @f$ p @f$ are the parameters of the distribution.
+ */
+ template<typename _IntType = int, typename _RealType = double>
+ class binomial_distribution
+ {
+ public:
+ // types
+ typedef _RealType input_type;
+ typedef _IntType result_type;
+
+ // constructors and member function
+ explicit
+ binomial_distribution(_IntType __t = 1,
+ const _RealType& __p = _RealType(0.5))
+ : _M_t(__t), _M_p(__p), _M_nd()
+ {
+ _GLIBCXX_DEBUG_ASSERT((_M_t >= 0) && (_M_p >= 0.0) && (_M_p <= 1.0));
+ _M_initialize();
+ }
+
+ /**
+ * Gets the distribution @p t parameter.
+ */
+ _IntType
+ t() const
+ { return _M_t; }
+
+ /**
+ * Gets the distribution @p p parameter.
+ */
+ _RealType
+ p() const
+ { return _M_p; }
+
+ void
+ reset()
+ { _M_nd.reset(); }
+
+ template<class _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng);
+
+ /**
+ * Inserts a %binomial_distribution random number distribution
+ * @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A %binomial_distribution random number distribution.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _IntType1, typename _RealType1,
+ typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const binomial_distribution<_IntType1, _RealType1>& __x);
+
+ /**
+ * Extracts a %binomial_distribution random number distribution
+ * @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %binomial_distribution random number generator engine.
+ *
+ * @returns The input stream with @p __x extracted or in an error state.
+ */
+ template<typename _IntType1, typename _RealType1,
+ typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ binomial_distribution<_IntType1, _RealType1>& __x);
+
+ private:
+ void
+ _M_initialize();
+
+ template<class _UniformRandomNumberGenerator>
+ result_type
+ _M_waiting(_UniformRandomNumberGenerator& __urng, _IntType __t);
+
+ // NB: Unused when _GLIBCXX_USE_C99_MATH_TR1 is undefined.
+ normal_distribution<_RealType> _M_nd;
+
+ _RealType _M_q;
+#if _GLIBCXX_USE_C99_MATH_TR1
+ _RealType _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
+ _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
+#endif
+ _RealType _M_p;
+ _IntType _M_t;
+
+ bool _M_easy;
+ };
+
+ /* @} */ // group tr1_random_distributions_discrete
+
+ /**
+ * @defgroup tr1_random_distributions_continuous Continuous Distributions
+ * @ingroup tr1_random_distributions
+ * @{
+ */
+
+ /**
+ * @brief Uniform continuous distribution for random numbers.
+ *
+ * A continuous random distribution on the range [min, max) with equal
+ * probability throughout the range. The URNG should be real-valued and
+ * deliver number in the range [0, 1).
+ */
+ template<typename _RealType = double>
+ class uniform_real
+ {
+ public:
+ // types
+ typedef _RealType input_type;
+ typedef _RealType result_type;
+
+ public:
+ /**
+ * Constructs a uniform_real object.
+ *
+ * @param __min [IN] The lower bound of the distribution.
+ * @param __max [IN] The upper bound of the distribution.
+ */
+ explicit
+ uniform_real(_RealType __min = _RealType(0),
+ _RealType __max = _RealType(1))
+ : _M_min(__min), _M_max(__max)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_min <= _M_max);
+ }
+
+ result_type
+ min() const
+ { return _M_min; }
+
+ result_type
+ max() const
+ { return _M_max; }
+
+ void
+ reset() { }
+
+ template<class _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng)
+ { return (__urng() * (_M_max - _M_min)) + _M_min; }
+
+ /**
+ * Inserts a %uniform_real random number distribution @p __x into the
+ * output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A %uniform_real random number distribution.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _RealType1, typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const uniform_real<_RealType1>& __x);
+
+ /**
+ * Extracts a %uniform_real random number distribution
+ * @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %uniform_real random number generator engine.
+ *
+ * @returns The input stream with @p __x extracted or in an error state.
+ */
+ template<typename _RealType1, typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ uniform_real<_RealType1>& __x);
+
+ private:
+ _RealType _M_min;
+ _RealType _M_max;
+ };
+
+
+ /**
+ * @brief An exponential continuous distribution for random numbers.
+ *
+ * The formula for the exponential probability mass function is
+ * @f$ p(x) = \lambda e^{-\lambda x} @f$.
+ *
+ * <table border=1 cellpadding=10 cellspacing=0>
+ * <caption align=top>Distribution Statistics</caption>
+ * <tr><td>Mean</td><td>@f$ \frac{1}{\lambda} @f$</td></tr>
+ * <tr><td>Median</td><td>@f$ \frac{\ln 2}{\lambda} @f$</td></tr>
+ * <tr><td>Mode</td><td>@f$ zero @f$</td></tr>
+ * <tr><td>Range</td><td>@f$[0, \infty]@f$</td></tr>
+ * <tr><td>Standard Deviation</td><td>@f$ \frac{1}{\lambda} @f$</td></tr>
+ * </table>
+ */
+ template<typename _RealType = double>
+ class exponential_distribution
+ {
+ public:
+ // types
+ typedef _RealType input_type;
+ typedef _RealType result_type;
+
+ public:
+ /**
+ * Constructs an exponential distribution with inverse scale parameter
+ * @f$ \lambda @f$.
+ */
+ explicit
+ exponential_distribution(const result_type& __lambda = result_type(1))
+ : _M_lambda(__lambda)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_lambda > 0);
+ }
+
+ /**
+ * Gets the inverse scale parameter of the distribution.
+ */
+ _RealType
+ lambda() const
+ { return _M_lambda; }
+
+ /**
+ * Resets the distribution.
+ *
+ * Has no effect on exponential distributions.
+ */
+ void
+ reset() { }
+
+ template<class _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng)
+ { return -std::log(__urng()) / _M_lambda; }
+
+ /**
+ * Inserts a %exponential_distribution random number distribution
+ * @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A %exponential_distribution random number distribution.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _RealType1, typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const exponential_distribution<_RealType1>& __x);
+
+ /**
+ * Extracts a %exponential_distribution random number distribution
+ * @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %exponential_distribution random number
+ * generator engine.
+ *
+ * @returns The input stream with @p __x extracted or in an error state.
+ */
+ template<typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ exponential_distribution& __x)
+ { return __is >> __x._M_lambda; }
+
+ private:
+ result_type _M_lambda;
+ };
+
+
+ /**
+ * @brief A normal continuous distribution for random numbers.
+ *
+ * The formula for the normal probability mass function is
+ * @f$ p(x) = \frac{1}{\sigma \sqrt{2 \pi}}
+ * e^{- \frac{{x - mean}^ {2}}{2 \sigma ^ {2}} } @f$.
+ */
+ template<typename _RealType = double>
+ class normal_distribution
+ {
+ public:
+ // types
+ typedef _RealType input_type;
+ typedef _RealType result_type;
+
+ public:
+ /**
+ * Constructs a normal distribution with parameters @f$ mean @f$ and
+ * @f$ \sigma @f$.
+ */
+ explicit
+ normal_distribution(const result_type& __mean = result_type(0),
+ const result_type& __sigma = result_type(1))
+ : _M_mean(__mean), _M_sigma(__sigma), _M_saved_available(false)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_sigma > 0);
+ }
+
+ /**
+ * Gets the mean of the distribution.
+ */
+ _RealType
+ mean() const
+ { return _M_mean; }
+
+ /**
+ * Gets the @f$ \sigma @f$ of the distribution.
+ */
+ _RealType
+ sigma() const
+ { return _M_sigma; }
+
+ /**
+ * Resets the distribution.
+ */
+ void
+ reset()
+ { _M_saved_available = false; }
+
+ template<class _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng);
+
+ /**
+ * Inserts a %normal_distribution random number distribution
+ * @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A %normal_distribution random number distribution.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _RealType1, typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const normal_distribution<_RealType1>& __x);
+
+ /**
+ * Extracts a %normal_distribution random number distribution
+ * @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %normal_distribution random number generator engine.
+ *
+ * @returns The input stream with @p __x extracted or in an error state.
+ */
+ template<typename _RealType1, typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ normal_distribution<_RealType1>& __x);
+
+ private:
+ result_type _M_mean;
+ result_type _M_sigma;
+ result_type _M_saved;
+ bool _M_saved_available;
+ };
+
+
+ /**
+ * @brief A gamma continuous distribution for random numbers.
+ *
+ * The formula for the gamma probability mass function is
+ * @f$ p(x) = \frac{1}{\Gamma(\alpha)} x^{\alpha - 1} e^{-x} @f$.
+ */
+ template<typename _RealType = double>
+ class gamma_distribution
+ {
+ public:
+ // types
+ typedef _RealType input_type;
+ typedef _RealType result_type;
+
+ public:
+ /**
+ * Constructs a gamma distribution with parameters @f$ \alpha @f$.
+ */
+ explicit
+ gamma_distribution(const result_type& __alpha_val = result_type(1))
+ : _M_alpha(__alpha_val)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_alpha > 0);
+ _M_initialize();
+ }
+
+ /**
+ * Gets the @f$ \alpha @f$ of the distribution.
+ */
+ _RealType
+ alpha() const
+ { return _M_alpha; }
+
+ /**
+ * Resets the distribution.
+ */
+ void
+ reset() { }
+
+ template<class _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng);
+
+ /**
+ * Inserts a %gamma_distribution random number distribution
+ * @p __x into the output stream @p __os.
+ *
+ * @param __os An output stream.
+ * @param __x A %gamma_distribution random number distribution.
+ *
+ * @returns The output stream with the state of @p __x inserted or in
+ * an error state.
+ */
+ template<typename _RealType1, typename _CharT, typename _Traits>
+ friend std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const gamma_distribution<_RealType1>& __x);
+
+ /**
+ * Extracts a %gamma_distribution random number distribution
+ * @p __x from the input stream @p __is.
+ *
+ * @param __is An input stream.
+ * @param __x A %gamma_distribution random number generator engine.
+ *
+ * @returns The input stream with @p __x extracted or in an error state.
+ */
+ template<typename _CharT, typename _Traits>
+ friend std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ gamma_distribution& __x)
+ {
+ __is >> __x._M_alpha;
+ __x._M_initialize();
+ return __is;
+ }
+
+ private:
+ void
+ _M_initialize();
+
+ result_type _M_alpha;
+
+ // Hosts either lambda of GB or d of modified Vaduva's.
+ result_type _M_l_d;
+ };
+
+ /* @} */ // group tr1_random_distributions_continuous
+ /* @} */ // group tr1_random_distributions
+ /* @} */ // group tr1_random
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
+
+#include <tr1_impl/random.tcc>
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/random.tcc b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/random.tcc
new file mode 100644
index 0000000..4c78ce6
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/random.tcc
@@ -0,0 +1,1577 @@
+// random number generation (out of line) -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/random.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ /*
+ * (Further) implementation-space details.
+ */
+ namespace __detail
+ {
+ // General case for x = (ax + c) mod m -- use Schrage's algorithm to avoid
+ // integer overflow.
+ //
+ // Because a and c are compile-time integral constants the compiler kindly
+ // elides any unreachable paths.
+ //
+ // Preconditions: a > 0, m > 0.
+ //
+ template<typename _Tp, _Tp __a, _Tp __c, _Tp __m, bool>
+ struct _Mod
+ {
+ static _Tp
+ __calc(_Tp __x)
+ {
+ if (__a == 1)
+ __x %= __m;
+ else
+ {
+ static const _Tp __q = __m / __a;
+ static const _Tp __r = __m % __a;
+
+ _Tp __t1 = __a * (__x % __q);
+ _Tp __t2 = __r * (__x / __q);
+ if (__t1 >= __t2)
+ __x = __t1 - __t2;
+ else
+ __x = __m - __t2 + __t1;
+ }
+
+ if (__c != 0)
+ {
+ const _Tp __d = __m - __x;
+ if (__d > __c)
+ __x += __c;
+ else
+ __x = __c - __d;
+ }
+ return __x;
+ }
+ };
+
+ // Special case for m == 0 -- use unsigned integer overflow as modulo
+ // operator.
+ template<typename _Tp, _Tp __a, _Tp __c, _Tp __m>
+ struct _Mod<_Tp, __a, __c, __m, true>
+ {
+ static _Tp
+ __calc(_Tp __x)
+ { return __a * __x + __c; }
+ };
+ } // namespace __detail
+
+ /**
+ * Seeds the LCR with integral value @p __x0, adjusted so that the
+ * ring identity is never a member of the convergence set.
+ */
+ template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
+ void
+ linear_congruential<_UIntType, __a, __c, __m>::
+ seed(unsigned long __x0)
+ {
+ if ((__detail::__mod<_UIntType, 1, 0, __m>(__c) == 0)
+ && (__detail::__mod<_UIntType, 1, 0, __m>(__x0) == 0))
+ _M_x = __detail::__mod<_UIntType, 1, 0, __m>(1);
+ else
+ _M_x = __detail::__mod<_UIntType, 1, 0, __m>(__x0);
+ }
+
+ /**
+ * Seeds the LCR engine with a value generated by @p __g.
+ */
+ template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
+ template<class _Gen>
+ void
+ linear_congruential<_UIntType, __a, __c, __m>::
+ seed(_Gen& __g, false_type)
+ {
+ _UIntType __x0 = __g();
+ if ((__detail::__mod<_UIntType, 1, 0, __m>(__c) == 0)
+ && (__detail::__mod<_UIntType, 1, 0, __m>(__x0) == 0))
+ _M_x = __detail::__mod<_UIntType, 1, 0, __m>(1);
+ else
+ _M_x = __detail::__mod<_UIntType, 1, 0, __m>(__x0);
+ }
+
+ /**
+ * Gets the next generated value in sequence.
+ */
+ template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
+ typename linear_congruential<_UIntType, __a, __c, __m>::result_type
+ linear_congruential<_UIntType, __a, __c, __m>::
+ operator()()
+ {
+ _M_x = __detail::__mod<_UIntType, __a, __c, __m>(_M_x);
+ return _M_x;
+ }
+
+ template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m,
+ typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const linear_congruential<_UIntType, __a, __c, __m>& __lcr)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ __os.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left);
+ __os.fill(__os.widen(' '));
+
+ __os << __lcr._M_x;
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ return __os;
+ }
+
+ template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m,
+ typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ linear_congruential<_UIntType, __a, __c, __m>& __lcr)
+ {
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::dec);
+
+ __is >> __lcr._M_x;
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<class _UIntType, int __w, int __n, int __m, int __r,
+ _UIntType __a, int __u, int __s,
+ _UIntType __b, int __t, _UIntType __c, int __l>
+ void
+ mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
+ __b, __t, __c, __l>::
+ seed(unsigned long __value)
+ {
+ _M_x[0] = __detail::__mod<_UIntType, 1, 0,
+ __detail::_Shift<_UIntType, __w>::__value>(__value);
+
+ for (int __i = 1; __i < state_size; ++__i)
+ {
+ _UIntType __x = _M_x[__i - 1];
+ __x ^= __x >> (__w - 2);
+ __x *= 1812433253ul;
+ __x += __i;
+ _M_x[__i] = __detail::__mod<_UIntType, 1, 0,
+ __detail::_Shift<_UIntType, __w>::__value>(__x);
+ }
+ _M_p = state_size;
+ }
+
+ template<class _UIntType, int __w, int __n, int __m, int __r,
+ _UIntType __a, int __u, int __s,
+ _UIntType __b, int __t, _UIntType __c, int __l>
+ template<class _Gen>
+ void
+ mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
+ __b, __t, __c, __l>::
+ seed(_Gen& __gen, false_type)
+ {
+ for (int __i = 0; __i < state_size; ++__i)
+ _M_x[__i] = __detail::__mod<_UIntType, 1, 0,
+ __detail::_Shift<_UIntType, __w>::__value>(__gen());
+ _M_p = state_size;
+ }
+
+ template<class _UIntType, int __w, int __n, int __m, int __r,
+ _UIntType __a, int __u, int __s,
+ _UIntType __b, int __t, _UIntType __c, int __l>
+ typename
+ mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
+ __b, __t, __c, __l>::result_type
+ mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
+ __b, __t, __c, __l>::
+ operator()()
+ {
+ // Reload the vector - cost is O(n) amortized over n calls.
+ if (_M_p >= state_size)
+ {
+ const _UIntType __upper_mask = (~_UIntType()) << __r;
+ const _UIntType __lower_mask = ~__upper_mask;
+
+ for (int __k = 0; __k < (__n - __m); ++__k)
+ {
+ _UIntType __y = ((_M_x[__k] & __upper_mask)
+ | (_M_x[__k + 1] & __lower_mask));
+ _M_x[__k] = (_M_x[__k + __m] ^ (__y >> 1)
+ ^ ((__y & 0x01) ? __a : 0));
+ }
+
+ for (int __k = (__n - __m); __k < (__n - 1); ++__k)
+ {
+ _UIntType __y = ((_M_x[__k] & __upper_mask)
+ | (_M_x[__k + 1] & __lower_mask));
+ _M_x[__k] = (_M_x[__k + (__m - __n)] ^ (__y >> 1)
+ ^ ((__y & 0x01) ? __a : 0));
+ }
+
+ _UIntType __y = ((_M_x[__n - 1] & __upper_mask)
+ | (_M_x[0] & __lower_mask));
+ _M_x[__n - 1] = (_M_x[__m - 1] ^ (__y >> 1)
+ ^ ((__y & 0x01) ? __a : 0));
+ _M_p = 0;
+ }
+
+ // Calculate o(x(i)).
+ result_type __z = _M_x[_M_p++];
+ __z ^= (__z >> __u);
+ __z ^= (__z << __s) & __b;
+ __z ^= (__z << __t) & __c;
+ __z ^= (__z >> __l);
+
+ return __z;
+ }
+
+ template<class _UIntType, int __w, int __n, int __m, int __r,
+ _UIntType __a, int __u, int __s, _UIntType __b, int __t,
+ _UIntType __c, int __l,
+ typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const mersenne_twister<_UIntType, __w, __n, __m,
+ __r, __a, __u, __s, __b, __t, __c, __l>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const _CharT __space = __os.widen(' ');
+ __os.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left);
+ __os.fill(__space);
+
+ for (int __i = 0; __i < __n - 1; ++__i)
+ __os << __x._M_x[__i] << __space;
+ __os << __x._M_x[__n - 1];
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ return __os;
+ }
+
+ template<class _UIntType, int __w, int __n, int __m, int __r,
+ _UIntType __a, int __u, int __s, _UIntType __b, int __t,
+ _UIntType __c, int __l,
+ typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ mersenne_twister<_UIntType, __w, __n, __m,
+ __r, __a, __u, __s, __b, __t, __c, __l>& __x)
+ {
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::dec | __ios_base::skipws);
+
+ for (int __i = 0; __i < __n; ++__i)
+ __is >> __x._M_x[__i];
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<typename _IntType, _IntType __m, int __s, int __r>
+ void
+ subtract_with_carry<_IntType, __m, __s, __r>::
+ seed(unsigned long __value)
+ {
+ if (__value == 0)
+ __value = 19780503;
+
+ std::_GLIBCXX_TR1 linear_congruential<unsigned long, 40014, 0, 2147483563>
+ __lcg(__value);
+
+ for (int __i = 0; __i < long_lag; ++__i)
+ _M_x[__i] = __detail::__mod<_UIntType, 1, 0, modulus>(__lcg());
+
+ _M_carry = (_M_x[long_lag - 1] == 0) ? 1 : 0;
+ _M_p = 0;
+ }
+
+ template<typename _IntType, _IntType __m, int __s, int __r>
+ template<class _Gen>
+ void
+ subtract_with_carry<_IntType, __m, __s, __r>::
+ seed(_Gen& __gen, false_type)
+ {
+ const int __n = (std::numeric_limits<_UIntType>::digits + 31) / 32;
+
+ for (int __i = 0; __i < long_lag; ++__i)
+ {
+ _UIntType __tmp = 0;
+ _UIntType __factor = 1;
+ for (int __j = 0; __j < __n; ++__j)
+ {
+ __tmp += __detail::__mod<__detail::_UInt32Type, 1, 0, 0>
+ (__gen()) * __factor;
+ __factor *= __detail::_Shift<_UIntType, 32>::__value;
+ }
+ _M_x[__i] = __detail::__mod<_UIntType, 1, 0, modulus>(__tmp);
+ }
+ _M_carry = (_M_x[long_lag - 1] == 0) ? 1 : 0;
+ _M_p = 0;
+ }
+
+ template<typename _IntType, _IntType __m, int __s, int __r>
+ typename subtract_with_carry<_IntType, __m, __s, __r>::result_type
+ subtract_with_carry<_IntType, __m, __s, __r>::
+ operator()()
+ {
+ // Derive short lag index from current index.
+ int __ps = _M_p - short_lag;
+ if (__ps < 0)
+ __ps += long_lag;
+
+ // Calculate new x(i) without overflow or division.
+ // NB: Thanks to the requirements for _IntType, _M_x[_M_p] + _M_carry
+ // cannot overflow.
+ _UIntType __xi;
+ if (_M_x[__ps] >= _M_x[_M_p] + _M_carry)
+ {
+ __xi = _M_x[__ps] - _M_x[_M_p] - _M_carry;
+ _M_carry = 0;
+ }
+ else
+ {
+ __xi = modulus - _M_x[_M_p] - _M_carry + _M_x[__ps];
+ _M_carry = 1;
+ }
+ _M_x[_M_p] = __xi;
+
+ // Adjust current index to loop around in ring buffer.
+ if (++_M_p >= long_lag)
+ _M_p = 0;
+
+ return __xi;
+ }
+
+ template<typename _IntType, _IntType __m, int __s, int __r,
+ typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const subtract_with_carry<_IntType, __m, __s, __r>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const _CharT __space = __os.widen(' ');
+ __os.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left);
+ __os.fill(__space);
+
+ for (int __i = 0; __i < __r; ++__i)
+ __os << __x._M_x[__i] << __space;
+ __os << __x._M_carry;
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ return __os;
+ }
+
+ template<typename _IntType, _IntType __m, int __s, int __r,
+ typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ subtract_with_carry<_IntType, __m, __s, __r>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::dec | __ios_base::skipws);
+
+ for (int __i = 0; __i < __r; ++__i)
+ __is >> __x._M_x[__i];
+ __is >> __x._M_carry;
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<typename _RealType, int __w, int __s, int __r>
+ void
+ subtract_with_carry_01<_RealType, __w, __s, __r>::
+ _M_initialize_npows()
+ {
+ for (int __j = 0; __j < __n; ++__j)
+#if _GLIBCXX_USE_C99_MATH_TR1
+ _M_npows[__j] = std::_GLIBCXX_TR1 ldexp(_RealType(1), -__w + __j * 32);
+#else
+ _M_npows[__j] = std::pow(_RealType(2), -__w + __j * 32);
+#endif
+ }
+
+ template<typename _RealType, int __w, int __s, int __r>
+ void
+ subtract_with_carry_01<_RealType, __w, __s, __r>::
+ seed(unsigned long __value)
+ {
+ if (__value == 0)
+ __value = 19780503;
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 512. Seeding subtract_with_carry_01 from a single unsigned long.
+ std::_GLIBCXX_TR1 linear_congruential<unsigned long, 40014, 0, 2147483563>
+ __lcg(__value);
+
+ this->seed(__lcg);
+ }
+
+ template<typename _RealType, int __w, int __s, int __r>
+ template<class _Gen>
+ void
+ subtract_with_carry_01<_RealType, __w, __s, __r>::
+ seed(_Gen& __gen, false_type)
+ {
+ for (int __i = 0; __i < long_lag; ++__i)
+ {
+ for (int __j = 0; __j < __n - 1; ++__j)
+ _M_x[__i][__j] = __detail::__mod<_UInt32Type, 1, 0, 0>(__gen());
+ _M_x[__i][__n - 1] = __detail::__mod<_UInt32Type, 1, 0,
+ __detail::_Shift<_UInt32Type, __w % 32>::__value>(__gen());
+ }
+
+ _M_carry = 1;
+ for (int __j = 0; __j < __n; ++__j)
+ if (_M_x[long_lag - 1][__j] != 0)
+ {
+ _M_carry = 0;
+ break;
+ }
+
+ _M_p = 0;
+ }
+
+ template<typename _RealType, int __w, int __s, int __r>
+ typename subtract_with_carry_01<_RealType, __w, __s, __r>::result_type
+ subtract_with_carry_01<_RealType, __w, __s, __r>::
+ operator()()
+ {
+ // Derive short lag index from current index.
+ int __ps = _M_p - short_lag;
+ if (__ps < 0)
+ __ps += long_lag;
+
+ _UInt32Type __new_carry;
+ for (int __j = 0; __j < __n - 1; ++__j)
+ {
+ if (_M_x[__ps][__j] > _M_x[_M_p][__j]
+ || (_M_x[__ps][__j] == _M_x[_M_p][__j] && _M_carry == 0))
+ __new_carry = 0;
+ else
+ __new_carry = 1;
+
+ _M_x[_M_p][__j] = _M_x[__ps][__j] - _M_x[_M_p][__j] - _M_carry;
+ _M_carry = __new_carry;
+ }
+
+ if (_M_x[__ps][__n - 1] > _M_x[_M_p][__n - 1]
+ || (_M_x[__ps][__n - 1] == _M_x[_M_p][__n - 1] && _M_carry == 0))
+ __new_carry = 0;
+ else
+ __new_carry = 1;
+
+ _M_x[_M_p][__n - 1] = __detail::__mod<_UInt32Type, 1, 0,
+ __detail::_Shift<_UInt32Type, __w % 32>::__value>
+ (_M_x[__ps][__n - 1] - _M_x[_M_p][__n - 1] - _M_carry);
+ _M_carry = __new_carry;
+
+ result_type __ret = 0.0;
+ for (int __j = 0; __j < __n; ++__j)
+ __ret += _M_x[_M_p][__j] * _M_npows[__j];
+
+ // Adjust current index to loop around in ring buffer.
+ if (++_M_p >= long_lag)
+ _M_p = 0;
+
+ return __ret;
+ }
+
+ template<typename _RealType, int __w, int __s, int __r,
+ typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const subtract_with_carry_01<_RealType, __w, __s, __r>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const _CharT __space = __os.widen(' ');
+ __os.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left);
+ __os.fill(__space);
+
+ for (int __i = 0; __i < __r; ++__i)
+ for (int __j = 0; __j < __x.__n; ++__j)
+ __os << __x._M_x[__i][__j] << __space;
+ __os << __x._M_carry;
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ return __os;
+ }
+
+ template<typename _RealType, int __w, int __s, int __r,
+ typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ subtract_with_carry_01<_RealType, __w, __s, __r>& __x)
+ {
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::dec | __ios_base::skipws);
+
+ for (int __i = 0; __i < __r; ++__i)
+ for (int __j = 0; __j < __x.__n; ++__j)
+ __is >> __x._M_x[__i][__j];
+ __is >> __x._M_carry;
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<class _UniformRandomNumberGenerator, int __p, int __r>
+ typename discard_block<_UniformRandomNumberGenerator,
+ __p, __r>::result_type
+ discard_block<_UniformRandomNumberGenerator, __p, __r>::
+ operator()()
+ {
+ if (_M_n >= used_block)
+ {
+ while (_M_n < block_size)
+ {
+ _M_b();
+ ++_M_n;
+ }
+ _M_n = 0;
+ }
+ ++_M_n;
+ return _M_b();
+ }
+
+ template<class _UniformRandomNumberGenerator, int __p, int __r,
+ typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const discard_block<_UniformRandomNumberGenerator,
+ __p, __r>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const _CharT __space = __os.widen(' ');
+ __os.flags(__ios_base::dec | __ios_base::fixed
+ | __ios_base::left);
+ __os.fill(__space);
+
+ __os << __x._M_b << __space << __x._M_n;
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ return __os;
+ }
+
+ template<class _UniformRandomNumberGenerator, int __p, int __r,
+ typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ discard_block<_UniformRandomNumberGenerator, __p, __r>& __x)
+ {
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::dec | __ios_base::skipws);
+
+ __is >> __x._M_b >> __x._M_n;
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<class _UniformRandomNumberGenerator1, int __s1,
+ class _UniformRandomNumberGenerator2, int __s2>
+ void
+ xor_combine<_UniformRandomNumberGenerator1, __s1,
+ _UniformRandomNumberGenerator2, __s2>::
+ _M_initialize_max()
+ {
+ const int __w = std::numeric_limits<result_type>::digits;
+
+ const result_type __m1 =
+ std::min(result_type(_M_b1.max() - _M_b1.min()),
+ __detail::_Shift<result_type, __w - __s1>::__value - 1);
+
+ const result_type __m2 =
+ std::min(result_type(_M_b2.max() - _M_b2.min()),
+ __detail::_Shift<result_type, __w - __s2>::__value - 1);
+
+ // NB: In TR1 s1 is not required to be >= s2.
+ if (__s1 < __s2)
+ _M_max = _M_initialize_max_aux(__m2, __m1, __s2 - __s1) << __s1;
+ else
+ _M_max = _M_initialize_max_aux(__m1, __m2, __s1 - __s2) << __s2;
+ }
+
+ template<class _UniformRandomNumberGenerator1, int __s1,
+ class _UniformRandomNumberGenerator2, int __s2>
+ typename xor_combine<_UniformRandomNumberGenerator1, __s1,
+ _UniformRandomNumberGenerator2, __s2>::result_type
+ xor_combine<_UniformRandomNumberGenerator1, __s1,
+ _UniformRandomNumberGenerator2, __s2>::
+ _M_initialize_max_aux(result_type __a, result_type __b, int __d)
+ {
+ const result_type __two2d = result_type(1) << __d;
+ const result_type __c = __a * __two2d;
+
+ if (__a == 0 || __b < __two2d)
+ return __c + __b;
+
+ const result_type __t = std::max(__c, __b);
+ const result_type __u = std::min(__c, __b);
+
+ result_type __ub = __u;
+ result_type __p;
+ for (__p = 0; __ub != 1; __ub >>= 1)
+ ++__p;
+
+ const result_type __two2p = result_type(1) << __p;
+ const result_type __k = __t / __two2p;
+
+ if (__k & 1)
+ return (__k + 1) * __two2p - 1;
+
+ if (__c >= __b)
+ return (__k + 1) * __two2p + _M_initialize_max_aux((__t % __two2p)
+ / __two2d,
+ __u % __two2p, __d);
+ else
+ return (__k + 1) * __two2p + _M_initialize_max_aux((__u % __two2p)
+ / __two2d,
+ __t % __two2p, __d);
+ }
+
+ template<class _UniformRandomNumberGenerator1, int __s1,
+ class _UniformRandomNumberGenerator2, int __s2,
+ typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const xor_combine<_UniformRandomNumberGenerator1, __s1,
+ _UniformRandomNumberGenerator2, __s2>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const _CharT __space = __os.widen(' ');
+ __os.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left);
+ __os.fill(__space);
+
+ __os << __x.base1() << __space << __x.base2();
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ return __os;
+ }
+
+ template<class _UniformRandomNumberGenerator1, int __s1,
+ class _UniformRandomNumberGenerator2, int __s2,
+ typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ xor_combine<_UniformRandomNumberGenerator1, __s1,
+ _UniformRandomNumberGenerator2, __s2>& __x)
+ {
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::skipws);
+
+ __is >> __x._M_b1 >> __x._M_b2;
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<typename _IntType>
+ template<typename _UniformRandomNumberGenerator>
+ typename uniform_int<_IntType>::result_type
+ uniform_int<_IntType>::
+ _M_call(_UniformRandomNumberGenerator& __urng,
+ result_type __min, result_type __max, true_type)
+ {
+ // XXX Must be fixed to work well for *arbitrary* __urng.max(),
+ // __urng.min(), __max, __min. Currently works fine only in the
+ // most common case __urng.max() - __urng.min() >= __max - __min,
+ // with __urng.max() > __urng.min() >= 0.
+ typedef typename __gnu_cxx::__add_unsigned<typename
+ _UniformRandomNumberGenerator::result_type>::__type __urntype;
+ typedef typename __gnu_cxx::__add_unsigned<result_type>::__type
+ __utype;
+ typedef typename __gnu_cxx::__conditional_type<(sizeof(__urntype)
+ > sizeof(__utype)),
+ __urntype, __utype>::__type __uctype;
+
+ result_type __ret;
+
+ const __urntype __urnmin = __urng.min();
+ const __urntype __urnmax = __urng.max();
+ const __urntype __urnrange = __urnmax - __urnmin;
+ const __uctype __urange = __max - __min;
+ const __uctype __udenom = (__urnrange <= __urange
+ ? 1 : __urnrange / (__urange + 1));
+ do
+ __ret = (__urntype(__urng()) - __urnmin) / __udenom;
+ while (__ret > __max - __min);
+
+ return __ret + __min;
+ }
+
+ template<typename _IntType, typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const uniform_int<_IntType>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const _CharT __space = __os.widen(' ');
+ __os.flags(__ios_base::scientific | __ios_base::left);
+ __os.fill(__space);
+
+ __os << __x.min() << __space << __x.max();
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ return __os;
+ }
+
+ template<typename _IntType, typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ uniform_int<_IntType>& __x)
+ {
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::dec | __ios_base::skipws);
+
+ __is >> __x._M_min >> __x._M_max;
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const bernoulli_distribution& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const std::streamsize __precision = __os.precision();
+ __os.flags(__ios_base::scientific | __ios_base::left);
+ __os.fill(__os.widen(' '));
+ __os.precision(__gnu_cxx::__numeric_traits<double>::__max_digits10);
+
+ __os << __x.p();
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ __os.precision(__precision);
+ return __os;
+ }
+
+
+ template<typename _IntType, typename _RealType>
+ template<class _UniformRandomNumberGenerator>
+ typename geometric_distribution<_IntType, _RealType>::result_type
+ geometric_distribution<_IntType, _RealType>::
+ operator()(_UniformRandomNumberGenerator& __urng)
+ {
+ // About the epsilon thing see this thread:
+ // http://gcc.gnu.org/ml/gcc-patches/2006-10/msg00971.html
+ const _RealType __naf =
+ (1 - std::numeric_limits<_RealType>::epsilon()) / 2;
+ // The largest _RealType convertible to _IntType.
+ const _RealType __thr =
+ std::numeric_limits<_IntType>::max() + __naf;
+
+ _RealType __cand;
+ do
+ __cand = std::ceil(std::log(__urng()) / _M_log_p);
+ while (__cand >= __thr);
+
+ return result_type(__cand + __naf);
+ }
+
+ template<typename _IntType, typename _RealType,
+ typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const geometric_distribution<_IntType, _RealType>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const std::streamsize __precision = __os.precision();
+ __os.flags(__ios_base::scientific | __ios_base::left);
+ __os.fill(__os.widen(' '));
+ __os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
+
+ __os << __x.p();
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ __os.precision(__precision);
+ return __os;
+ }
+
+
+ template<typename _IntType, typename _RealType>
+ void
+ poisson_distribution<_IntType, _RealType>::
+ _M_initialize()
+ {
+#if _GLIBCXX_USE_C99_MATH_TR1
+ if (_M_mean >= 12)
+ {
+ const _RealType __m = std::floor(_M_mean);
+ _M_lm_thr = std::log(_M_mean);
+ _M_lfm = std::_GLIBCXX_TR1 lgamma(__m + 1);
+ _M_sm = std::sqrt(__m);
+
+ const _RealType __pi_4 = 0.7853981633974483096156608458198757L;
+ const _RealType __dx = std::sqrt(2 * __m * std::log(32 * __m
+ / __pi_4));
+ _M_d = std::_GLIBCXX_TR1 round(std::max(_RealType(6),
+ std::min(__m, __dx)));
+ const _RealType __cx = 2 * __m + _M_d;
+ _M_scx = std::sqrt(__cx / 2);
+ _M_1cx = 1 / __cx;
+
+ _M_c2b = std::sqrt(__pi_4 * __cx) * std::exp(_M_1cx);
+ _M_cb = 2 * __cx * std::exp(-_M_d * _M_1cx * (1 + _M_d / 2)) / _M_d;
+ }
+ else
+#endif
+ _M_lm_thr = std::exp(-_M_mean);
+ }
+
+ /**
+ * A rejection algorithm when mean >= 12 and a simple method based
+ * upon the multiplication of uniform random variates otherwise.
+ * NB: The former is available only if _GLIBCXX_USE_C99_MATH_TR1
+ * is defined.
+ *
+ * Reference:
+ * Devroye, L. "Non-Uniform Random Variates Generation." Springer-Verlag,
+ * New York, 1986, Ch. X, Sects. 3.3 & 3.4 (+ Errata!).
+ */
+ template<typename _IntType, typename _RealType>
+ template<class _UniformRandomNumberGenerator>
+ typename poisson_distribution<_IntType, _RealType>::result_type
+ poisson_distribution<_IntType, _RealType>::
+ operator()(_UniformRandomNumberGenerator& __urng)
+ {
+#if _GLIBCXX_USE_C99_MATH_TR1
+ if (_M_mean >= 12)
+ {
+ _RealType __x;
+
+ // See comments above...
+ const _RealType __naf =
+ (1 - std::numeric_limits<_RealType>::epsilon()) / 2;
+ const _RealType __thr =
+ std::numeric_limits<_IntType>::max() + __naf;
+
+ const _RealType __m = std::floor(_M_mean);
+ // sqrt(pi / 2)
+ const _RealType __spi_2 = 1.2533141373155002512078826424055226L;
+ const _RealType __c1 = _M_sm * __spi_2;
+ const _RealType __c2 = _M_c2b + __c1;
+ const _RealType __c3 = __c2 + 1;
+ const _RealType __c4 = __c3 + 1;
+ // e^(1 / 78)
+ const _RealType __e178 = 1.0129030479320018583185514777512983L;
+ const _RealType __c5 = __c4 + __e178;
+ const _RealType __c = _M_cb + __c5;
+ const _RealType __2cx = 2 * (2 * __m + _M_d);
+
+ bool __reject = true;
+ do
+ {
+ const _RealType __u = __c * __urng();
+ const _RealType __e = -std::log(__urng());
+
+ _RealType __w = 0.0;
+
+ if (__u <= __c1)
+ {
+ const _RealType __n = _M_nd(__urng);
+ const _RealType __y = -std::abs(__n) * _M_sm - 1;
+ __x = std::floor(__y);
+ __w = -__n * __n / 2;
+ if (__x < -__m)
+ continue;
+ }
+ else if (__u <= __c2)
+ {
+ const _RealType __n = _M_nd(__urng);
+ const _RealType __y = 1 + std::abs(__n) * _M_scx;
+ __x = std::ceil(__y);
+ __w = __y * (2 - __y) * _M_1cx;
+ if (__x > _M_d)
+ continue;
+ }
+ else if (__u <= __c3)
+ // NB: This case not in the book, nor in the Errata,
+ // but should be ok...
+ __x = -1;
+ else if (__u <= __c4)
+ __x = 0;
+ else if (__u <= __c5)
+ __x = 1;
+ else
+ {
+ const _RealType __v = -std::log(__urng());
+ const _RealType __y = _M_d + __v * __2cx / _M_d;
+ __x = std::ceil(__y);
+ __w = -_M_d * _M_1cx * (1 + __y / 2);
+ }
+
+ __reject = (__w - __e - __x * _M_lm_thr
+ > _M_lfm - std::_GLIBCXX_TR1 lgamma(__x + __m + 1));
+
+ __reject |= __x + __m >= __thr;
+
+ } while (__reject);
+
+ return result_type(__x + __m + __naf);
+ }
+ else
+#endif
+ {
+ _IntType __x = 0;
+ _RealType __prod = 1.0;
+
+ do
+ {
+ __prod *= __urng();
+ __x += 1;
+ }
+ while (__prod > _M_lm_thr);
+
+ return __x - 1;
+ }
+ }
+
+ template<typename _IntType, typename _RealType,
+ typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const poisson_distribution<_IntType, _RealType>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const std::streamsize __precision = __os.precision();
+ const _CharT __space = __os.widen(' ');
+ __os.flags(__ios_base::scientific | __ios_base::left);
+ __os.fill(__space);
+ __os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
+
+ __os << __x.mean() << __space << __x._M_nd;
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ __os.precision(__precision);
+ return __os;
+ }
+
+ template<typename _IntType, typename _RealType,
+ typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ poisson_distribution<_IntType, _RealType>& __x)
+ {
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::skipws);
+
+ __is >> __x._M_mean >> __x._M_nd;
+ __x._M_initialize();
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<typename _IntType, typename _RealType>
+ void
+ binomial_distribution<_IntType, _RealType>::
+ _M_initialize()
+ {
+ const _RealType __p12 = _M_p <= 0.5 ? _M_p : 1.0 - _M_p;
+
+ _M_easy = true;
+
+#if _GLIBCXX_USE_C99_MATH_TR1
+ if (_M_t * __p12 >= 8)
+ {
+ _M_easy = false;
+ const _RealType __np = std::floor(_M_t * __p12);
+ const _RealType __pa = __np / _M_t;
+ const _RealType __1p = 1 - __pa;
+
+ const _RealType __pi_4 = 0.7853981633974483096156608458198757L;
+ const _RealType __d1x =
+ std::sqrt(__np * __1p * std::log(32 * __np
+ / (81 * __pi_4 * __1p)));
+ _M_d1 = std::_GLIBCXX_TR1 round(std::max(_RealType(1), __d1x));
+ const _RealType __d2x =
+ std::sqrt(__np * __1p * std::log(32 * _M_t * __1p
+ / (__pi_4 * __pa)));
+ _M_d2 = std::_GLIBCXX_TR1 round(std::max(_RealType(1), __d2x));
+
+ // sqrt(pi / 2)
+ const _RealType __spi_2 = 1.2533141373155002512078826424055226L;
+ _M_s1 = std::sqrt(__np * __1p) * (1 + _M_d1 / (4 * __np));
+ _M_s2 = std::sqrt(__np * __1p) * (1 + _M_d2 / (4 * _M_t * __1p));
+ _M_c = 2 * _M_d1 / __np;
+ _M_a1 = std::exp(_M_c) * _M_s1 * __spi_2;
+ const _RealType __a12 = _M_a1 + _M_s2 * __spi_2;
+ const _RealType __s1s = _M_s1 * _M_s1;
+ _M_a123 = __a12 + (std::exp(_M_d1 / (_M_t * __1p))
+ * 2 * __s1s / _M_d1
+ * std::exp(-_M_d1 * _M_d1 / (2 * __s1s)));
+ const _RealType __s2s = _M_s2 * _M_s2;
+ _M_s = (_M_a123 + 2 * __s2s / _M_d2
+ * std::exp(-_M_d2 * _M_d2 / (2 * __s2s)));
+ _M_lf = (std::_GLIBCXX_TR1 lgamma(__np + 1)
+ + std::_GLIBCXX_TR1 lgamma(_M_t - __np + 1));
+ _M_lp1p = std::log(__pa / __1p);
+
+ _M_q = -std::log(1 - (__p12 - __pa) / __1p);
+ }
+ else
+#endif
+ _M_q = -std::log(1 - __p12);
+ }
+
+ template<typename _IntType, typename _RealType>
+ template<class _UniformRandomNumberGenerator>
+ typename binomial_distribution<_IntType, _RealType>::result_type
+ binomial_distribution<_IntType, _RealType>::
+ _M_waiting(_UniformRandomNumberGenerator& __urng, _IntType __t)
+ {
+ _IntType __x = 0;
+ _RealType __sum = 0;
+
+ do
+ {
+ const _RealType __e = -std::log(__urng());
+ __sum += __e / (__t - __x);
+ __x += 1;
+ }
+ while (__sum <= _M_q);
+
+ return __x - 1;
+ }
+
+ /**
+ * A rejection algorithm when t * p >= 8 and a simple waiting time
+ * method - the second in the referenced book - otherwise.
+ * NB: The former is available only if _GLIBCXX_USE_C99_MATH_TR1
+ * is defined.
+ *
+ * Reference:
+ * Devroye, L. "Non-Uniform Random Variates Generation." Springer-Verlag,
+ * New York, 1986, Ch. X, Sect. 4 (+ Errata!).
+ */
+ template<typename _IntType, typename _RealType>
+ template<class _UniformRandomNumberGenerator>
+ typename binomial_distribution<_IntType, _RealType>::result_type
+ binomial_distribution<_IntType, _RealType>::
+ operator()(_UniformRandomNumberGenerator& __urng)
+ {
+ result_type __ret;
+ const _RealType __p12 = _M_p <= 0.5 ? _M_p : 1.0 - _M_p;
+
+#if _GLIBCXX_USE_C99_MATH_TR1
+ if (!_M_easy)
+ {
+ _RealType __x;
+
+ // See comments above...
+ const _RealType __naf =
+ (1 - std::numeric_limits<_RealType>::epsilon()) / 2;
+ const _RealType __thr =
+ std::numeric_limits<_IntType>::max() + __naf;
+
+ const _RealType __np = std::floor(_M_t * __p12);
+ const _RealType __pa = __np / _M_t;
+
+ // sqrt(pi / 2)
+ const _RealType __spi_2 = 1.2533141373155002512078826424055226L;
+ const _RealType __a1 = _M_a1;
+ const _RealType __a12 = __a1 + _M_s2 * __spi_2;
+ const _RealType __a123 = _M_a123;
+ const _RealType __s1s = _M_s1 * _M_s1;
+ const _RealType __s2s = _M_s2 * _M_s2;
+
+ bool __reject;
+ do
+ {
+ const _RealType __u = _M_s * __urng();
+
+ _RealType __v;
+
+ if (__u <= __a1)
+ {
+ const _RealType __n = _M_nd(__urng);
+ const _RealType __y = _M_s1 * std::abs(__n);
+ __reject = __y >= _M_d1;
+ if (!__reject)
+ {
+ const _RealType __e = -std::log(__urng());
+ __x = std::floor(__y);
+ __v = -__e - __n * __n / 2 + _M_c;
+ }
+ }
+ else if (__u <= __a12)
+ {
+ const _RealType __n = _M_nd(__urng);
+ const _RealType __y = _M_s2 * std::abs(__n);
+ __reject = __y >= _M_d2;
+ if (!__reject)
+ {
+ const _RealType __e = -std::log(__urng());
+ __x = std::floor(-__y);
+ __v = -__e - __n * __n / 2;
+ }
+ }
+ else if (__u <= __a123)
+ {
+ const _RealType __e1 = -std::log(__urng());
+ const _RealType __e2 = -std::log(__urng());
+
+ const _RealType __y = _M_d1 + 2 * __s1s * __e1 / _M_d1;
+ __x = std::floor(__y);
+ __v = (-__e2 + _M_d1 * (1 / (_M_t - __np)
+ -__y / (2 * __s1s)));
+ __reject = false;
+ }
+ else
+ {
+ const _RealType __e1 = -std::log(__urng());
+ const _RealType __e2 = -std::log(__urng());
+
+ const _RealType __y = _M_d2 + 2 * __s2s * __e1 / _M_d2;
+ __x = std::floor(-__y);
+ __v = -__e2 - _M_d2 * __y / (2 * __s2s);
+ __reject = false;
+ }
+
+ __reject = __reject || __x < -__np || __x > _M_t - __np;
+ if (!__reject)
+ {
+ const _RealType __lfx =
+ std::_GLIBCXX_TR1 lgamma(__np + __x + 1)
+ + std::_GLIBCXX_TR1 lgamma(_M_t - (__np + __x) + 1);
+ __reject = __v > _M_lf - __lfx + __x * _M_lp1p;
+ }
+
+ __reject |= __x + __np >= __thr;
+ }
+ while (__reject);
+
+ __x += __np + __naf;
+
+ const _IntType __z = _M_waiting(__urng, _M_t - _IntType(__x));
+ __ret = _IntType(__x) + __z;
+ }
+ else
+#endif
+ __ret = _M_waiting(__urng, _M_t);
+
+ if (__p12 != _M_p)
+ __ret = _M_t - __ret;
+ return __ret;
+ }
+
+ template<typename _IntType, typename _RealType,
+ typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const binomial_distribution<_IntType, _RealType>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const std::streamsize __precision = __os.precision();
+ const _CharT __space = __os.widen(' ');
+ __os.flags(__ios_base::scientific | __ios_base::left);
+ __os.fill(__space);
+ __os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
+
+ __os << __x.t() << __space << __x.p()
+ << __space << __x._M_nd;
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ __os.precision(__precision);
+ return __os;
+ }
+
+ template<typename _IntType, typename _RealType,
+ typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ binomial_distribution<_IntType, _RealType>& __x)
+ {
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::dec | __ios_base::skipws);
+
+ __is >> __x._M_t >> __x._M_p >> __x._M_nd;
+ __x._M_initialize();
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<typename _RealType, typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const uniform_real<_RealType>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const std::streamsize __precision = __os.precision();
+ const _CharT __space = __os.widen(' ');
+ __os.flags(__ios_base::scientific | __ios_base::left);
+ __os.fill(__space);
+ __os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
+
+ __os << __x.min() << __space << __x.max();
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ __os.precision(__precision);
+ return __os;
+ }
+
+ template<typename _RealType, typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ uniform_real<_RealType>& __x)
+ {
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::skipws);
+
+ __is >> __x._M_min >> __x._M_max;
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<typename _RealType, typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const exponential_distribution<_RealType>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const std::streamsize __precision = __os.precision();
+ __os.flags(__ios_base::scientific | __ios_base::left);
+ __os.fill(__os.widen(' '));
+ __os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
+
+ __os << __x.lambda();
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ __os.precision(__precision);
+ return __os;
+ }
+
+
+ /**
+ * Polar method due to Marsaglia.
+ *
+ * Devroye, L. "Non-Uniform Random Variates Generation." Springer-Verlag,
+ * New York, 1986, Ch. V, Sect. 4.4.
+ */
+ template<typename _RealType>
+ template<class _UniformRandomNumberGenerator>
+ typename normal_distribution<_RealType>::result_type
+ normal_distribution<_RealType>::
+ operator()(_UniformRandomNumberGenerator& __urng)
+ {
+ result_type __ret;
+
+ if (_M_saved_available)
+ {
+ _M_saved_available = false;
+ __ret = _M_saved;
+ }
+ else
+ {
+ result_type __x, __y, __r2;
+ do
+ {
+ __x = result_type(2.0) * __urng() - 1.0;
+ __y = result_type(2.0) * __urng() - 1.0;
+ __r2 = __x * __x + __y * __y;
+ }
+ while (__r2 > 1.0 || __r2 == 0.0);
+
+ const result_type __mult = std::sqrt(-2 * std::log(__r2) / __r2);
+ _M_saved = __x * __mult;
+ _M_saved_available = true;
+ __ret = __y * __mult;
+ }
+
+ __ret = __ret * _M_sigma + _M_mean;
+ return __ret;
+ }
+
+ template<typename _RealType, typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const normal_distribution<_RealType>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const std::streamsize __precision = __os.precision();
+ const _CharT __space = __os.widen(' ');
+ __os.flags(__ios_base::scientific | __ios_base::left);
+ __os.fill(__space);
+ __os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
+
+ __os << __x._M_saved_available << __space
+ << __x.mean() << __space
+ << __x.sigma();
+ if (__x._M_saved_available)
+ __os << __space << __x._M_saved;
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ __os.precision(__precision);
+ return __os;
+ }
+
+ template<typename _RealType, typename _CharT, typename _Traits>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ normal_distribution<_RealType>& __x)
+ {
+ typedef std::basic_istream<_CharT, _Traits> __istream_type;
+ typedef typename __istream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __is.flags();
+ __is.flags(__ios_base::dec | __ios_base::skipws);
+
+ __is >> __x._M_saved_available >> __x._M_mean
+ >> __x._M_sigma;
+ if (__x._M_saved_available)
+ __is >> __x._M_saved;
+
+ __is.flags(__flags);
+ return __is;
+ }
+
+
+ template<typename _RealType>
+ void
+ gamma_distribution<_RealType>::
+ _M_initialize()
+ {
+ if (_M_alpha >= 1)
+ _M_l_d = std::sqrt(2 * _M_alpha - 1);
+ else
+ _M_l_d = (std::pow(_M_alpha, _M_alpha / (1 - _M_alpha))
+ * (1 - _M_alpha));
+ }
+
+ /**
+ * Cheng's rejection algorithm GB for alpha >= 1 and a modification
+ * of Vaduva's rejection from Weibull algorithm due to Devroye for
+ * alpha < 1.
+ *
+ * References:
+ * Cheng, R. C. "The Generation of Gamma Random Variables with Non-integral
+ * Shape Parameter." Applied Statistics, 26, 71-75, 1977.
+ *
+ * Vaduva, I. "Computer Generation of Gamma Gandom Variables by Rejection
+ * and Composition Procedures." Math. Operationsforschung and Statistik,
+ * Series in Statistics, 8, 545-576, 1977.
+ *
+ * Devroye, L. "Non-Uniform Random Variates Generation." Springer-Verlag,
+ * New York, 1986, Ch. IX, Sect. 3.4 (+ Errata!).
+ */
+ template<typename _RealType>
+ template<class _UniformRandomNumberGenerator>
+ typename gamma_distribution<_RealType>::result_type
+ gamma_distribution<_RealType>::
+ operator()(_UniformRandomNumberGenerator& __urng)
+ {
+ result_type __x;
+
+ bool __reject;
+ if (_M_alpha >= 1)
+ {
+ // alpha - log(4)
+ const result_type __b = _M_alpha
+ - result_type(1.3862943611198906188344642429163531L);
+ const result_type __c = _M_alpha + _M_l_d;
+ const result_type __1l = 1 / _M_l_d;
+
+ // 1 + log(9 / 2)
+ const result_type __k = 2.5040773967762740733732583523868748L;
+
+ do
+ {
+ const result_type __u = __urng();
+ const result_type __v = __urng();
+
+ const result_type __y = __1l * std::log(__v / (1 - __v));
+ __x = _M_alpha * std::exp(__y);
+
+ const result_type __z = __u * __v * __v;
+ const result_type __r = __b + __c * __y - __x;
+
+ __reject = __r < result_type(4.5) * __z - __k;
+ if (__reject)
+ __reject = __r < std::log(__z);
+ }
+ while (__reject);
+ }
+ else
+ {
+ const result_type __c = 1 / _M_alpha;
+
+ do
+ {
+ const result_type __z = -std::log(__urng());
+ const result_type __e = -std::log(__urng());
+
+ __x = std::pow(__z, __c);
+
+ __reject = __z + __e < _M_l_d + __x;
+ }
+ while (__reject);
+ }
+
+ return __x;
+ }
+
+ template<typename _RealType, typename _CharT, typename _Traits>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const gamma_distribution<_RealType>& __x)
+ {
+ typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
+ typedef typename __ostream_type::ios_base __ios_base;
+
+ const typename __ios_base::fmtflags __flags = __os.flags();
+ const _CharT __fill = __os.fill();
+ const std::streamsize __precision = __os.precision();
+ __os.flags(__ios_base::scientific | __ios_base::left);
+ __os.fill(__os.widen(' '));
+ __os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
+
+ __os << __x.alpha();
+
+ __os.flags(__flags);
+ __os.fill(__fill);
+ __os.precision(__precision);
+ return __os;
+ }
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/regex b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/regex
new file mode 100644
index 0000000..9352bc1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/regex
@@ -0,0 +1,2708 @@
+// class template regex -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/**
+ * @file tr1_impl/regex
+ * @brief The common implementation file for tr1 and std regular expressions.
+ *
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+/**
+ * @defgroup tr1_regex Regular Expressions
+ * A facility for performing regular expression pattern matching.
+ */
+ //@{
+
+/** @namespace std::regex_constants
+ * @brief ISO C++ 0x entities sub namespace for regex.
+ */
+namespace regex_constants
+{
+ /**
+ * @name 5.1 Regular Expression Syntax Options
+ */
+ //@{
+ enum __syntax_option
+ {
+ _S_icase,
+ _S_nosubs,
+ _S_optimize,
+ _S_collate,
+ _S_ECMAScript,
+ _S_basic,
+ _S_extended,
+ _S_awk,
+ _S_grep,
+ _S_egrep,
+ _S_syntax_last
+ };
+
+ /**
+ * @brief This is a bitmask type indicating how to interpret the regex.
+ *
+ * The @c syntax_option_type is implementation defined but it is valid to
+ * perform bitwise operations on these values and expect the right thing to
+ * happen.
+ *
+ * A valid value of type syntax_option_type shall have exactly one of the
+ * elements @c ECMAScript, @c basic, @c extended, @c awk, @c grep, @c egrep
+ * %set.
+ */
+ typedef unsigned int syntax_option_type;
+
+ /**
+ * Specifies that the matching of regular expressions against a character
+ * sequence shall be performed without regard to case.
+ */
+ static const syntax_option_type icase = 1 << _S_icase;
+
+ /**
+ * Specifies that when a regular expression is matched against a character
+ * container sequence, no sub-expression matches are to be stored in the
+ * supplied match_results structure.
+ */
+ static const syntax_option_type nosubs = 1 << _S_nosubs;
+
+ /**
+ * Specifies that the regular expression engine should pay more attention to
+ * the speed with which regular expressions are matched, and less to the
+ * speed with which regular expression objects are constructed. Otherwise
+ * it has no detectable effect on the program output.
+ */
+ static const syntax_option_type optimize = 1 << _S_optimize;
+
+ /**
+ * Specifies that character ranges of the form [a-b] should be locale
+ * sensitive.
+ */
+ static const syntax_option_type collate = 1 << _S_collate;
+
+ /**
+ * Specifies that the grammar recognized by the regular expression engine is
+ * that used by ECMAScript in ECMA-262 [Ecma International, ECMAScript
+ * Language Specification, Standard Ecma-262, third edition, 1999], as
+ * modified in tr1 section [7.13]. This grammar is similar to that defined
+ * in the PERL scripting language but extended with elements found in the
+ * POSIX regular expression grammar.
+ */
+ static const syntax_option_type ECMAScript = 1 << _S_ECMAScript;
+
+ /**
+ * Specifies that the grammar recognized by the regular expression engine is
+ * that used by POSIX basic regular expressions in IEEE Std 1003.1-2001,
+ * Portable Operating System Interface (POSIX), Base Definitions and
+ * Headers, Section 9, Regular Expressions [IEEE, Information Technology --
+ * Portable Operating System Interface (POSIX), IEEE Standard 1003.1-2001].
+ */
+ static const syntax_option_type basic = 1 << _S_basic;
+
+ /**
+ * Specifies that the grammar recognized by the regular expression engine is
+ * that used by POSIX extended regular expressions in IEEE Std 1003.1-2001,
+ * Portable Operating System Interface (POSIX), Base Definitions and Headers,
+ * Section 9, Regular Expressions.
+ */
+ static const syntax_option_type extended = 1 << _S_extended;
+
+ /**
+ * Specifies that the grammar recognized by the regular expression engine is
+ * that used by POSIX utility awk in IEEE Std 1003.1-2001. This option is
+ * identical to syntax_option_type extended, except that C-style escape
+ * sequences are supported. These sequences are, explicitly, "\\", "\a",
+ * "\b", "\f", "\n", "\r", "\t" , "\v", "\"", "'",
+ * and "\ddd" (where ddd is one, two, or three octal digits).
+ */
+ static const syntax_option_type awk = 1 << _S_awk;
+
+ /**
+ * Specifies that the grammar recognized by the regular expression engine is
+ * that used by POSIX utility grep in IEEE Std 1003.1-2001. This option is
+ * identical to syntax_option_type basic, except that newlines are treated
+ * as whitespace.
+ */
+ static const syntax_option_type grep = 1 << _S_grep;
+
+ /**
+ * Specifies that the grammar recognized by the regular expression engine is
+ * that used by POSIX utility grep when given the -E option in
+ * IEEE Std 1003.1-2001. This option is identical to syntax_option_type
+ * extended, except that newlines are treated as whitespace.
+ */
+ static const syntax_option_type egrep = 1 << _S_egrep;
+
+ //@}
+
+ /**
+ * @name 5.2 Matching Rules
+ *
+ * Matching a regular expression against a sequence of characters [first,
+ * last) proceeds according to the rules of the grammar specified for the
+ * regular expression object, modified according to the effects listed
+ * below for any bitmask elements set.
+ *
+ */
+ //@{
+
+ enum __match_flag
+ {
+ _S_not_bol,
+ _S_not_eol,
+ _S_not_bow,
+ _S_not_eow,
+ _S_any,
+ _S_not_null,
+ _S_continuous,
+ _S_prev_avail,
+ _S_sed,
+ _S_no_copy,
+ _S_first_only,
+ _S_match_flag_last
+ };
+
+ /**
+ * @brief This is a bitmask type indicating regex matching rules.
+ *
+ * The @c match_flag_type is implementation defined but it is valid to
+ * perform bitwise operations on these values and expect the right thing to
+ * happen.
+ */
+ typedef std::bitset<_S_match_flag_last> match_flag_type;
+
+ /**
+ * The default matching rules.
+ */
+ static const match_flag_type match_default = 0;
+
+ /**
+ * The first character in the sequence [first, last) is treated as though it
+ * is not at the beginning of a line, so the character "^" in the regular
+ * expression shall not match [first, first).
+ */
+ static const match_flag_type match_not_bol = 1 << _S_not_bol;
+
+ /**
+ * The last character in the sequence [first, last) is treated as though it
+ * is not at the end of a line, so the character "$" in the regular
+ * expression shall not match [last, last).
+ */
+ static const match_flag_type match_not_eol = 1 << _S_not_eol;
+
+ /**
+ * The expression "\b" is not matched against the sub-sequence
+ * [first,first).
+ */
+ static const match_flag_type match_not_bow = 1 << _S_not_bow;
+
+ /**
+ * The expression "\b" should not be matched against the sub-sequence
+ * [last,last).
+ */
+ static const match_flag_type match_not_eow = 1 << _S_not_eow;
+
+ /**
+ * If more than one match is possible then any match is an acceptable
+ * result.
+ */
+ static const match_flag_type match_any = 1 << _S_any;
+
+ /**
+ * The expression does not match an empty sequence.
+ */
+ static const match_flag_type match_not_null = 1 << _S_not_null;
+
+ /**
+ * The expression only matches a sub-sequence that begins at first .
+ */
+ static const match_flag_type match_continuous = 1 << _S_continuous;
+
+ /**
+ * --first is a valid iterator position. When this flag is set then the
+ * flags match_not_bol and match_not_bow are ignored by the regular
+ * expression algorithms 7.11 and iterators 7.12.
+ */
+ static const match_flag_type match_prev_avail = 1 << _S_prev_avail;
+
+ /**
+ * When a regular expression match is to be replaced by a new string, the
+ * new string is constructed using the rules used by the ECMAScript replace
+ * function in ECMA- 262 [Ecma International, ECMAScript Language
+ * Specification, Standard Ecma-262, third edition, 1999], part 15.5.4.11
+ * String.prototype.replace. In addition, during search and replace
+ * operations all non-overlapping occurrences of the regular expression
+ * are located and replaced, and sections of the input that did not match
+ * the expression are copied unchanged to the output string.
+ *
+ * Format strings (from ECMA-262 [15.5.4.11]):
+ * @li $$ The dollar-sign itself ($)
+ * @li $& The matched substring.
+ * @li $` The portion of <em>string</em> that precedes the matched substring.
+ * This would be match_results::prefix().
+ * @li $' The portion of <em>string</em> that follows the matched substring.
+ * This would be match_results::suffix().
+ * @li $n The nth capture, where n is in [1,9] and $n is not followed by a
+ * decimal digit. If n <= match_results::size() and the nth capture
+ * is undefined, use the empty string instead. If n >
+ * match_results::size(), the result is implementation-defined.
+ * @li $nn The nnth capture, where nn is a two-digit decimal number on
+ * [01, 99]. If nn <= match_results::size() and the nth capture is
+ * undefined, use the empty string instead. If
+ * nn > match_results::size(), the result is implementation-defined.
+ */
+ static const match_flag_type format_default = 0;
+
+ /**
+ * When a regular expression match is to be replaced by a new string, the
+ * new string is constructed using the rules used by the POSIX sed utility
+ * in IEEE Std 1003.1- 2001 [IEEE, Information Technology -- Portable
+ * Operating System Interface (POSIX), IEEE Standard 1003.1-2001].
+ */
+ static const match_flag_type format_sed = 1 << _S_sed;
+
+ /**
+ * During a search and replace operation, sections of the character
+ * container sequence being searched that do not match the regular
+ * expression shall not be copied to the output string.
+ */
+ static const match_flag_type format_no_copy = 1 << _S_no_copy;
+
+ /**
+ * When specified during a search and replace operation, only the first
+ * occurrence of the regular expression shall be replaced.
+ */
+ static const match_flag_type format_first_only = 1 << _S_first_only;
+
+ //@}
+
+ /**
+ * @name 5.3 Error Types
+ */
+ //@{
+
+ enum error_type
+ {
+ _S_error_collate,
+ _S_error_ctype,
+ _S_error_escape,
+ _S_error_backref,
+ _S_error_brack,
+ _S_error_paren,
+ _S_error_brace,
+ _S_error_badbrace,
+ _S_error_range,
+ _S_error_space,
+ _S_error_badrepeat,
+ _S_error_complexity,
+ _S_error_stack,
+ _S_error_last
+ };
+
+ /** The expression contained an invalid collating element name. */
+ static const error_type error_collate(_S_error_collate);
+
+ /** The expression contained an invalid character class name. */
+ static const error_type error_ctype(_S_error_ctype);
+
+ /**
+ * The expression contained an invalid escaped character, or a trailing
+ * escape.
+ */
+ static const error_type error_escape(_S_error_escape);
+
+ /** The expression contained an invalid back reference. */
+ static const error_type error_backref(_S_error_backref);
+
+ /** The expression contained mismatched [ and ]. */
+ static const error_type error_brack(_S_error_brack);
+
+ /** The expression contained mismatched ( and ). */
+ static const error_type error_paren(_S_error_paren);
+
+ /** The expression contained mismatched { and } */
+ static const error_type error_brace(_S_error_brace);
+
+ /** The expression contained an invalid range in a {} expression. */
+ static const error_type error_badbrace(_S_error_badbrace);
+
+ /**
+ * The expression contained an invalid character range,
+ * such as [b-a] in most encodings.
+ */
+ static const error_type error_range(_S_error_range);
+
+ /**
+ * There was insufficient memory to convert the expression into a
+ * finite state machine.
+ */
+ static const error_type error_space(_S_error_space);
+
+ /**
+ * One of "*?+{" was not preceded by a valid regular expression.
+ */
+ static const error_type error_badrepeat(_S_error_badrepeat);
+
+ /**
+ * The complexity of an attempted match against a regular expression
+ * exceeded a pre-set level.
+ */
+ static const error_type error_complexity(_S_error_complexity);
+
+ /**
+ * There was insufficient memory to determine whether the
+ * regular expression could match the specified character sequence.
+ */
+ static const error_type error_stack(_S_error_stack);
+
+ //@}
+}
+
+
+ // [7.8] Class regex_error
+ /**
+ * @brief A regular expression exception class.
+ * @ingroup exceptions
+ *
+ * The regular expression library throws objects of this class on error.
+ */
+ class regex_error
+ : public std::runtime_error
+ {
+ public:
+ /**
+ * @brief Constructs a regex_error object.
+ *
+ * @param ecode the regex error code.
+ */
+ explicit
+ regex_error(regex_constants::error_type __ecode)
+ : std::runtime_error("regex_error"), _M_code(__ecode)
+ { }
+
+ /**
+ * @brief Gets the regex error code.
+ *
+ * @returns the regex error code.
+ */
+ regex_constants::error_type
+ code() const
+ { return _M_code; }
+
+ protected:
+ regex_constants::error_type _M_code;
+ };
+
+ // [7.7] Class regex_traits
+ /**
+ * @brief Describes aspects of a regular expression.
+ *
+ * A regular expression traits class that satisfies the requirements of tr1
+ * section [7.2].
+ *
+ * The class %regex is parameterized around a set of related types and
+ * functions used to complete the definition of its semantics. This class
+ * satisfies the requirements of such a traits class.
+ */
+ template<typename _Ch_type>
+ struct regex_traits
+ {
+ public:
+ typedef _Ch_type char_type;
+ typedef std::basic_string<char_type> string_type;
+ typedef std::locale locale_type;
+ typedef std::ctype_base::mask char_class_type;
+
+ public:
+ /**
+ * @brief Constructs a default traits object.
+ */
+ regex_traits()
+ { }
+
+ /**
+ * @brief Gives the length of a C-style string starting at @p __p.
+ *
+ * @param __p a pointer to the start of a character sequence.
+ *
+ * @returns the number of characters between @p *__p and the first
+ * default-initialized value of type @p char_type. In other words, uses
+ * the C-string algorithm for determining the length of a sequence of
+ * characters.
+ */
+ static std::size_t
+ length(const char_type* __p)
+ { return string_type::traits_type::length(__p); }
+
+ /**
+ * @brief Performs the identity translation.
+ *
+ * @param c A character to the locale-specific character set.
+ *
+ * @returns c.
+ */
+ char_type
+ translate(char_type __c) const
+ { return __c; }
+
+ /**
+ * @brief Translates a character into a case-insensitive equivalent.
+ *
+ * @param c A character to the locale-specific character set.
+ *
+ * @returns the locale-specific lower-case equivalent of c.
+ * @throws std::bad_cast if the imbued locale does not support the ctype
+ * facet.
+ */
+ char_type
+ translate_nocase(char_type __c) const
+ {
+ using std::ctype;
+ using std::use_facet;
+ return use_facet<ctype<char_type> >(_M_locale).tolower(__c);
+ }
+
+ /**
+ * @brief Gets a sort key for a character sequence.
+ *
+ * @param first beginning of the character sequence.
+ * @param last one-past-the-end of the character sequence.
+ *
+ * Returns a sort key for the character sequence designated by the
+ * iterator range [F1, F2) such that if the character sequence [G1, G2)
+ * sorts before the character sequence [H1, H2) then
+ * v.transform(G1, G2) < v.transform(H1, H2).
+ *
+ * What this really does is provide a more efficient way to compare a
+ * string to multiple other strings in locales with fancy collation
+ * rules and equivalence classes.
+ *
+ * @returns a locale-specific sort key equivalent to the input range.
+ *
+ * @throws std::bad_cast if the current locale does not have a collate
+ * facet.
+ */
+ template<typename _Fwd_iter>
+ string_type
+ transform(_Fwd_iter __first, _Fwd_iter __last) const
+ {
+ using std::collate;
+ using std::use_facet;
+ const collate<_Ch_type>& __c(use_facet<
+ collate<_Ch_type> >(_M_locale));
+ string_type __s(__first, __last);
+ return __c.transform(__s.data(), __s.data() + __s.size());
+ }
+
+ /**
+ * @brief Dunno.
+ *
+ * @param first beginning of the character sequence.
+ * @param last one-past-the-end of the character sequence.
+ *
+ * Effects: if typeid(use_facet<collate<_Ch_type> >) ==
+ * typeid(collate_byname<_Ch_type>) and the form of the sort key
+ * returned by collate_byname<_Ch_type>::transform(first, last) is known
+ * and can be converted into a primary sort key then returns that key,
+ * otherwise returns an empty string. WTF??
+ *
+ * @todo Implement this function.
+ */
+ template<typename _Fwd_iter>
+ string_type
+ transform_primary(_Fwd_iter __first, _Fwd_iter __last) const;
+
+ /**
+ * @brief Gets a collation element by name.
+ *
+ * @param first beginning of the collation element name.
+ * @param last one-past-the-end of the collation element name.
+ *
+ * @returns a sequence of one or more characters that represents the
+ * collating element consisting of the character sequence designated by
+ * the iterator range [first, last). Returns an empty string if the
+ * character sequence is not a valid collating element.
+ *
+ * @todo Implement this function.
+ */
+ template<typename _Fwd_iter>
+ string_type
+ lookup_collatename(_Fwd_iter __first, _Fwd_iter __last) const;
+
+ /**
+ * @brief Maps one or more characters to a named character
+ * classification.
+ *
+ * @param first beginning of the character sequence.
+ * @param last one-past-the-end of the character sequence.
+ *
+ * @returns an unspecified value that represents the character
+ * classification named by the character sequence designated by the
+ * iterator range [first, last). The value returned shall be independent
+ * of the case of the characters in the character sequence. If the name
+ * is not recognized then returns a value that compares equal to 0.
+ *
+ * At least the following names (or their wide-character equivalent) are
+ * supported.
+ * - d
+ * - w
+ * - s
+ * - alnum
+ * - alpha
+ * - blank
+ * - cntrl
+ * - digit
+ * - graph
+ * - lower
+ * - print
+ * - punct
+ * - space
+ * - upper
+ * - xdigit
+ *
+ * @todo Implement this function.
+ */
+ template<typename _Fwd_iter>
+ char_class_type
+ lookup_classname(_Fwd_iter __first, _Fwd_iter __last) const;
+
+ /**
+ * @brief Determines if @p c is a member of an identified class.
+ *
+ * @param c a character.
+ * @param f a class type (as returned from lookup_classname).
+ *
+ * @returns true if the character @p c is a member of the classification
+ * represented by @p f, false otherwise.
+ *
+ * @throws std::bad_cast if the current locale does not have a ctype
+ * facet.
+ */
+ bool
+ isctype(_Ch_type __c, char_class_type __f) const;
+
+ /**
+ * @brief Converts a digit to an int.
+ *
+ * @param ch a character representing a digit.
+ * @param radix the radix if the numeric conversion (limited to 8, 10,
+ * or 16).
+ *
+ * @returns the value represented by the digit ch in base radix if the
+ * character ch is a valid digit in base radix; otherwise returns -1.
+ */
+ int
+ value(_Ch_type __ch, int __radix) const;
+
+ /**
+ * @brief Imbues the regex_traits object with a copy of a new locale.
+ *
+ * @param loc A locale.
+ *
+ * @returns a copy of the previous locale in use by the regex_traits
+ * object.
+ *
+ * @note Calling imbue with a different locale than the one currently in
+ * use invalidates all cached data held by *this.
+ */
+ locale_type
+ imbue(locale_type __loc)
+ {
+ std::swap(_M_locale, __loc);
+ return __loc;
+ }
+
+ /**
+ * @brief Gets a copy of the current locale in use by the regex_traits
+ * object.
+ */
+ locale_type
+ getloc() const
+ { return _M_locale; }
+
+ protected:
+ locale_type _M_locale;
+ };
+
+ template<typename _Ch_type>
+ bool regex_traits<_Ch_type>::
+ isctype(_Ch_type __c, char_class_type __f) const
+ {
+ using std::ctype;
+ using std::use_facet;
+ const ctype<_Ch_type>& __ctype(use_facet<
+ ctype<_Ch_type> >(_M_locale));
+
+ if (__ctype.is(__c, __f))
+ return true;
+
+ // special case of underscore in [[:w:]]
+ if (__c == __ctype.widen('_'))
+ {
+ const char* const __wb[] = "w";
+ char_class_type __wt = this->lookup_classname(__wb,
+ __wb + sizeof(__wb));
+ if (__f | __wt)
+ return true;
+ }
+
+ // special case of [[:space:]] in [[:blank:]]
+ if (__c == __ctype.isspace(__c))
+ {
+ const char* const __bb[] = "blank";
+ char_class_type __bt = this->lookup_classname(__bb,
+ __bb + sizeof(__bb));
+ if (__f | __bt)
+ return true;
+ }
+
+ return false;
+ }
+
+ template<typename _Ch_type>
+ int regex_traits<_Ch_type>::
+ value(_Ch_type __ch, int __radix) const
+ {
+ std::basic_istringstream<_Ch_type> __is(string_type(1, __ch));
+ int __v = -1;
+ if (__radix == 8)
+ __is >> std::oct;
+ else if (__radix == 16)
+ __is >> std::hex;
+ __is >> __v;
+ return __v;
+ }
+
+ // [7.8] Class basic_regex
+ /**
+ * Objects of specializations of this class represent regular expressions
+ * constructed from sequences of character type @p _Ch_type.
+ *
+ * Storage for the regular expression is allocated and deallocated as
+ * necessary by the member functions of this class.
+ */
+ template<typename _Ch_type, typename _Rx_traits = regex_traits<_Ch_type> >
+ class basic_regex
+ {
+ public:
+ // types:
+ typedef _Ch_type value_type;
+ typedef regex_constants::syntax_option_type flag_type;
+ typedef typename _Rx_traits::locale_type locale_type;
+ typedef typename _Rx_traits::string_type string_type;
+
+ /**
+ * @name Constants
+ * tr1 [7.8.1] std [28.8.1]
+ */
+ //@{
+ static const regex_constants::syntax_option_type icase
+ = regex_constants::icase;
+ static const regex_constants::syntax_option_type nosubs
+ = regex_constants::nosubs;
+ static const regex_constants::syntax_option_type optimize
+ = regex_constants::optimize;
+ static const regex_constants::syntax_option_type collate
+ = regex_constants::collate;
+ static const regex_constants::syntax_option_type ECMAScript
+ = regex_constants::ECMAScript;
+ static const regex_constants::syntax_option_type basic
+ = regex_constants::basic;
+ static const regex_constants::syntax_option_type extended
+ = regex_constants::extended;
+ static const regex_constants::syntax_option_type awk
+ = regex_constants::awk;
+ static const regex_constants::syntax_option_type grep
+ = regex_constants::grep;
+ static const regex_constants::syntax_option_type egrep
+ = regex_constants::egrep;
+ //@}
+
+ // [7.8.2] construct/copy/destroy
+ /**
+ * Constructs a basic regular expression that does not match any
+ * character sequence.
+ */
+ basic_regex()
+ : _M_flags(regex_constants::ECMAScript), _M_pattern(), _M_mark_count(0)
+ { _M_compile(); }
+
+ /**
+ * @brief Constructs a basic regular expression from the sequence
+ * [p, p + char_traits<_Ch_type>::length(p)) interpreted according to the
+ * flags in @p f.
+ *
+ * @param p A pointer to the start of a C-style null-terminated string
+ * containing a regular expression.
+ * @param f Flags indicating the syntax rules and options.
+ *
+ * @throws regex_error if @p p is not a valid regular expression.
+ */
+ explicit
+ basic_regex(const _Ch_type* __p,
+ flag_type __f = regex_constants::ECMAScript)
+ : _M_flags(__f), _M_pattern(__p), _M_mark_count(0)
+ { _M_compile(); }
+
+ /**
+ * @brief Constructs a basic regular expression from the sequence
+ * [p, p + len) interpreted according to the flags in @p f.
+ *
+ * @param p A pointer to the start of a string containing a regular
+ * expression.
+ * @param len The length of the string containing the regular expression.
+ * @param f Flags indicating the syntax rules and options.
+ *
+ * @throws regex_error if @p p is not a valid regular expression.
+ */
+ basic_regex(const _Ch_type* __p, std::size_t __len, flag_type __f)
+ : _M_flags(__f) , _M_pattern(__p, __len), _M_mark_count(0)
+ { _M_compile(); }
+
+ /**
+ * @brief Copy-constructs a basic regular expression.
+ *
+ * @param rhs A @p regex object.
+ */
+ basic_regex(const basic_regex& __rhs)
+ : _M_flags(__rhs._M_flags), _M_pattern(__rhs._M_pattern),
+ _M_mark_count(__rhs._M_mark_count)
+ { _M_compile(); }
+
+ /**
+ * @brief Constructs a basic regular expression from the string
+ * @p s interpreted according to the flags in @p f.
+ *
+ * @param s A string containing a regular expression.
+ * @param f Flags indicating the syntax rules and options.
+ *
+ * @throws regex_error if @p s is not a valid regular expression.
+ */
+ template<typename _Ch_traits, typename _Ch_alloc>
+ explicit
+ basic_regex(const basic_string<_Ch_type, _Ch_traits, _Ch_alloc>& __s,
+ flag_type __f = regex_constants::ECMAScript)
+ : _M_flags(__f), _M_pattern(__s.begin(), __s.end()), _M_mark_count(0)
+ { _M_compile(); }
+
+ /**
+ * @brief Constructs a basic regular expression from the range
+ * [first, last) interpreted according to the flags in @p f.
+ *
+ * @param first The start of a range containing a valid regular
+ * expression.
+ * @param last The end of a range containing a valid regular
+ * expression.
+ * @param f The format flags of the regular expression.
+ *
+ * @throws regex_error if @p [first, last) is not a valid regular
+ * expression.
+ */
+ template<typename _InputIterator>
+ basic_regex(_InputIterator __first, _InputIterator __last,
+ flag_type __f = regex_constants::ECMAScript)
+ : _M_flags(__f), _M_pattern(__first, __last), _M_mark_count(0)
+ { _M_compile(); }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ /**
+ * @brief Constructs a basic regular expression from an initializer list.
+ *
+ * @param l The initializer list.
+ * @param f The format flags of the regular expression.
+ *
+ * @throws regex_error if @p l is not a valid regular expression.
+ */
+ basic_regex(initializer_list<_Ch_type> __l,
+ flag_type __f = regex_constants::ECMAScript)
+ : _M_flags(__f), _M_pattern(__l.begin(), __l.end()), _M_mark_count(0)
+ { _M_compile(); }
+#endif
+
+ /**
+ * @brief Destroys a basic regular expression.
+ */
+ ~basic_regex()
+ { }
+
+ /**
+ * @brief Assigns one regular expression to another.
+ */
+ basic_regex&
+ operator=(const basic_regex& __rhs)
+ { return this->assign(__rhs); }
+
+ /**
+ * @brief Replaces a regular expression with a new one constructed from
+ * a C-style null-terminated string.
+ *
+ * @param A pointer to the start of a null-terminated C-style string
+ * containing a regular expression.
+ */
+ basic_regex&
+ operator=(const _Ch_type* __p)
+ { return this->assign(__p, flags()); }
+
+ /**
+ * @brief Replaces a regular expression with a new one constructed from
+ * a string.
+ *
+ * @param A pointer to a string containing a regular expression.
+ */
+ template<typename _Ch_typeraits, typename _Allocator>
+ basic_regex&
+ operator=(const basic_string<_Ch_type, _Ch_typeraits, _Allocator>& __s)
+ { return this->assign(__s, flags()); }
+
+ // [7.8.3] assign
+ /**
+ * @brief the real assignment operator.
+ *
+ * @param that Another regular expression object.
+ */
+ basic_regex&
+ assign(const basic_regex& __that)
+ {
+ basic_regex __tmp(__that);
+ this->swap(__tmp);
+ return *this;
+ }
+
+ /**
+ * @brief Assigns a new regular expression to a regex object from a
+ * C-style null-terminated string containing a regular expression
+ * pattern.
+ *
+ * @param p A pointer to a C-style null-terminated string containing
+ * a regular expression pattern.
+ * @param flags Syntax option flags.
+ *
+ * @throws regex_error if p does not contain a valid regular expression
+ * pattern interpreted according to @p flags. If regex_error is thrown,
+ * *this remains unchanged.
+ */
+ basic_regex&
+ assign(const _Ch_type* __p,
+ flag_type __flags = regex_constants::ECMAScript)
+ { return this->assign(string_type(__p), __flags); }
+
+ /**
+ * @brief Assigns a new regular expression to a regex object from a
+ * C-style string containing a regular expression pattern.
+ *
+ * @param p A pointer to a C-style string containing a
+ * regular expression pattern.
+ * @param len The length of the regular expression pattern string.
+ * @param flags Syntax option flags.
+ *
+ * @throws regex_error if p does not contain a valid regular expression
+ * pattern interpreted according to @p flags. If regex_error is thrown,
+ * *this remains unchanged.
+ */
+ basic_regex&
+ assign(const _Ch_type* __p, std::size_t __len, flag_type __flags)
+ { return this->assign(string_type(__p, __len), __flags); }
+
+ /**
+ * @brief Assigns a new regular expression to a regex object from a
+ * string containing a regular expression pattern.
+ *
+ * @param s A string containing a regular expression pattern.
+ * @param flags Syntax option flags.
+ *
+ * @throws regex_error if p does not contain a valid regular expression
+ * pattern interpreted according to @p flags. If regex_error is thrown,
+ * *this remains unchanged.
+ */
+ template<typename _Ch_typeraits, typename _Allocator>
+ basic_regex&
+ assign(const basic_string<_Ch_type, _Ch_typeraits, _Allocator>& __s,
+ flag_type __f = regex_constants::ECMAScript)
+ {
+ basic_regex __tmp(__s, __f);
+ this->swap(__tmp);
+ return *this;
+ }
+
+ /**
+ * @brief Assigns a new regular expression to a regex object.
+ *
+ * @param first The start of a range containing a valid regular
+ * expression.
+ * @param last The end of a range containing a valid regular
+ * expression.
+ * @param flags Syntax option flags.
+ *
+ * @throws regex_error if p does not contain a valid regular expression
+ * pattern interpreted according to @p flags. If regex_error is thrown,
+ * the object remains unchanged.
+ */
+ template<typename _InputIterator>
+ basic_regex&
+ assign(_InputIterator __first, _InputIterator __last,
+ flag_type __flags = regex_constants::ECMAScript)
+ { return this->assign(string_type(__first, __last), __flags); }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ /**
+ * @brief Assigns a new regular expression to a regex object.
+ *
+ * @param l An initializer list representing a regular expression.
+ * @param flags Syntax option flags.
+ *
+ * @throws regex_error if @p l does not contain a valid regular
+ * expression pattern interpreted according to @p flags. If regex_error
+ * is thrown, the object remains unchanged.
+ */
+ basic_regex&
+ assign(initializer_list<_Ch_type> __l,
+ flag_type __f = regex_constants::ECMAScript)
+ { return this->assign(__l.begin(), __l.end(), __f); }
+#endif
+
+ // [7.8.4] const operations
+ /**
+ * @brief Gets the number of marked subexpressions within the regular
+ * expression.
+ */
+ unsigned int
+ mark_count() const
+ { return _M_mark_count; }
+
+ /**
+ * @brief Gets the flags used to construct the regular expression
+ * or in the last call to assign().
+ */
+ flag_type
+ flags() const
+ { return _M_flags; }
+
+ // [7.8.5] locale
+ /**
+ * @brief Imbues the regular expression object with the given locale.
+ *
+ * @param loc A locale.
+ */
+ locale_type
+ imbue(locale_type __loc)
+ { return _M_traits.imbue(__loc); }
+
+ /**
+ * @brief Gets the locale currently imbued in the regular expression
+ * object.
+ */
+ locale_type
+ getloc() const
+ { return _M_traits.getloc(); }
+
+ // [7.8.6] swap
+ /**
+ * @brief Swaps the contents of two regular expression objects.
+ *
+ * @param rhs Another regular expression object.
+ */
+ void
+ swap(basic_regex& __rhs)
+ {
+ std::swap(_M_flags, __rhs._M_flags);
+ std::swap(_M_pattern, __rhs._M_pattern);
+ std::swap(_M_mark_count, __rhs._M_mark_count);
+ std::swap(_M_traits, __rhs._M_traits);
+ }
+
+ private:
+ /**
+ * @brief Compiles a regular expression pattern into a NFA.
+ * @todo Implement this function.
+ */
+ void _M_compile();
+
+ protected:
+ flag_type _M_flags;
+ string_type _M_pattern;
+ unsigned int _M_mark_count;
+ _Rx_traits _M_traits;
+ };
+
+ /** @brief Standard regular expressions. */
+ typedef basic_regex<char> regex;
+#ifdef _GLIBCXX_USE_WCHAR_T
+ /** @brief Standard wide-character regular expressions. */
+ typedef basic_regex<wchar_t> wregex;
+#endif
+
+
+ // [7.8.6] basic_regex swap
+ /**
+ * @brief Swaps the contents of two regular expression objects.
+ * @param lhs First regular expression.
+ * @param rhs Second regular expression.
+ */
+ template<typename _Ch_type, typename _Rx_traits>
+ inline void
+ swap(basic_regex<_Ch_type, _Rx_traits>& __lhs,
+ basic_regex<_Ch_type, _Rx_traits>& __rhs)
+ { __lhs.swap(__rhs); }
+
+
+ // [7.9] Class template sub_match
+ /**
+ * A sequence of characters matched by a particular marked sub-expression.
+ *
+ * An object of this class is essentially a pair of iterators marking a
+ * matched subexpression within a regular expression pattern match. Such
+ * objects can be converted to and compared with std::basic_string objects
+ * of a similar base character type as the pattern matched by the regular
+ * expression.
+ *
+ * The iterators that make up the pair are the usual half-open interval
+ * referencing the actual original pattern matched.
+ */
+ template<typename _BiIter>
+ class sub_match : public std::pair<_BiIter, _BiIter>
+ {
+ public:
+ typedef typename iterator_traits<_BiIter>::value_type value_type;
+ typedef typename iterator_traits<_BiIter>::difference_type
+ difference_type;
+ typedef _BiIter iterator;
+
+ public:
+ bool matched;
+
+ /**
+ * Gets the length of the matching sequence.
+ */
+ difference_type
+ length() const
+ { return this->matched ? std::distance(this->first, this->second) : 0; }
+
+ /**
+ * @brief Gets the matching sequence as a string.
+ *
+ * @returns the matching sequence as a string.
+ *
+ * This is the implicit conversion operator. It is identical to the
+ * str() member function except that it will want to pop up in
+ * unexpected places and cause a great deal of confusion and cursing
+ * from the unwary.
+ */
+ operator basic_string<value_type>() const
+ {
+ return this->matched
+ ? std::basic_string<value_type>(this->first, this->second)
+ : std::basic_string<value_type>();
+ }
+
+ /**
+ * @brief Gets the matching sequence as a string.
+ *
+ * @returns the matching sequence as a string.
+ */
+ basic_string<value_type>
+ str() const
+ {
+ return this->matched
+ ? std::basic_string<value_type>(this->first, this->second)
+ : std::basic_string<value_type>();
+ }
+
+ /**
+ * @brief Compares this and another matched sequence.
+ *
+ * @param s Another matched sequence to compare to this one.
+ *
+ * @retval <0 this matched sequence will collate before @p s.
+ * @retval =0 this matched sequence is equivalent to @p s.
+ * @retval <0 this matched sequence will collate after @p s.
+ */
+ int
+ compare(const sub_match& __s) const
+ { return this->str().compare(__s.str()); }
+
+ /**
+ * @brief Compares this sub_match to a string.
+ *
+ * @param s A string to compare to this sub_match.
+ *
+ * @retval <0 this matched sequence will collate before @p s.
+ * @retval =0 this matched sequence is equivalent to @p s.
+ * @retval <0 this matched sequence will collate after @p s.
+ */
+ int
+ compare(const basic_string<value_type>& __s) const
+ { return this->str().compare(__s); }
+
+ /**
+ * @brief Compares this sub_match to a C-style string.
+ *
+ * @param s A C-style string to compare to this sub_match.
+ *
+ * @retval <0 this matched sequence will collate before @p s.
+ * @retval =0 this matched sequence is equivalent to @p s.
+ * @retval <0 this matched sequence will collate after @p s.
+ */
+ int
+ compare(const value_type* __s) const
+ { return this->str().compare(__s); }
+ };
+
+
+ /** @brief Standard regex submatch over a C-style null-terminated string. */
+ typedef sub_match<const char*> csub_match;
+ /** @brief Standard regex submatch over a standard string. */
+ typedef sub_match<string::const_iterator> ssub_match;
+#ifdef _GLIBCXX_USE_WCHAR_T
+ /** @brief Regex submatch over a C-style null-terminated wide string. */
+ typedef sub_match<const wchar_t*> wcsub_match;
+ /** @brief Regex submatch over a standard wide string. */
+ typedef sub_match<wstring::const_iterator> wssub_match;
+#endif
+
+ // [7.9.2] sub_match non-member operators
+
+ /**
+ * @brief Tests the equivalence of two regular expression submatches.
+ * @param lhs First regular expression submatch.
+ * @param rhs Second regular expression submatch.
+ * @returns true if @a lhs is equivalent to @a rhs, false otherwise.
+ */
+ template<typename _BiIter>
+ inline bool
+ operator==(const sub_match<_BiIter>& __lhs,
+ const sub_match<_BiIter>& __rhs)
+ { return __lhs.compare(__rhs) == 0; }
+
+ /**
+ * @brief Tests the inequivalence of two regular expression submatches.
+ * @param lhs First regular expression submatch.
+ * @param rhs Second regular expression submatch.
+ * @returns true if @a lhs is not equivalent to @a rhs, false otherwise.
+ */
+ template<typename _BiIter>
+ inline bool
+ operator!=(const sub_match<_BiIter>& __lhs,
+ const sub_match<_BiIter>& __rhs)
+ { return __lhs.compare(__rhs) != 0; }
+
+ /**
+ * @brief Tests the ordering of two regular expression submatches.
+ * @param lhs First regular expression submatch.
+ * @param rhs Second regular expression submatch.
+ * @returns true if @a lhs precedes @a rhs, false otherwise.
+ */
+ template<typename _BiIter>
+ inline bool
+ operator<(const sub_match<_BiIter>& __lhs,
+ const sub_match<_BiIter>& __rhs)
+ { return __lhs.compare(__rhs) < 0; }
+
+ /**
+ * @brief Tests the ordering of two regular expression submatches.
+ * @param lhs First regular expression submatch.
+ * @param rhs Second regular expression submatch.
+ * @returns true if @a lhs does not succeed @a rhs, false otherwise.
+ */
+ template<typename _BiIter>
+ inline bool
+ operator<=(const sub_match<_BiIter>& __lhs,
+ const sub_match<_BiIter>& __rhs)
+ { return __lhs.compare(__rhs) <= 0; }
+
+ /**
+ * @brief Tests the ordering of two regular expression submatches.
+ * @param lhs First regular expression submatch.
+ * @param rhs Second regular expression submatch.
+ * @returns true if @a lhs does not precede @a rhs, false otherwise.
+ */
+ template<typename _BiIter>
+ inline bool
+ operator>=(const sub_match<_BiIter>& __lhs,
+ const sub_match<_BiIter>& __rhs)
+ { return __lhs.compare(__rhs) >= 0; }
+
+ /**
+ * @brief Tests the ordering of two regular expression submatches.
+ * @param lhs First regular expression submatch.
+ * @param rhs Second regular expression submatch.
+ * @returns true if @a lhs succeeds @a rhs, false otherwise.
+ */
+ template<typename _BiIter>
+ inline bool
+ operator>(const sub_match<_BiIter>& __lhs,
+ const sub_match<_BiIter>& __rhs)
+ { return __lhs.compare(__rhs) > 0; }
+
+ /**
+ * @brief Tests the equivalence of a string and a regular expression
+ * submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs is equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, typename _Ch_traits, typename _Ch_alloc>
+ inline bool
+ operator==(const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs == __rhs.str(); }
+
+ /**
+ * @brief Tests the inequivalence of a string and a regular expression
+ * submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs is not equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, typename _Ch_traits, typename _Ch_alloc>
+ inline bool
+ operator!=(const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __lhs, const sub_match<_Bi_iter>& __rhs)
+ { return __lhs != __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs precedes @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, typename _Ch_traits, typename _Ch_alloc>
+ inline bool
+ operator<(const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __lhs, const sub_match<_Bi_iter>& __rhs)
+ { return __lhs < __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs succeeds @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, typename _Ch_traits, typename _Ch_alloc>
+ inline bool
+ operator>(const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __lhs, const sub_match<_Bi_iter>& __rhs)
+ { return __lhs > __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs does not precede @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, typename _Ch_traits, typename _Ch_alloc>
+ inline bool
+ operator>=(const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __lhs, const sub_match<_Bi_iter>& __rhs)
+ { return __lhs >= __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs does not succeed @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, typename _Ch_traits, typename _Ch_alloc>
+ inline bool
+ operator<=(const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __lhs, const sub_match<_Bi_iter>& __rhs)
+ { return __lhs <= __rhs.str(); }
+
+ /**
+ * @brief Tests the equivalence of a regular expression submatch and a
+ * string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs is equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, typename _Ch_traits, typename _Ch_alloc>
+ inline bool
+ operator==(const sub_match<_Bi_iter>& __lhs,
+ const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __rhs)
+ { return __lhs.str() == __rhs; }
+
+ /**
+ * @brief Tests the inequivalence of a regular expression submatch and a
+ * string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs is not equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, typename _Ch_traits, typename _Ch_alloc>
+ inline bool
+ operator!=(const sub_match<_Bi_iter>& __lhs,
+ const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __rhs)
+ { return __lhs.str() != __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs precedes @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, class _Ch_traits, class _Ch_alloc>
+ inline bool
+ operator<(const sub_match<_Bi_iter>& __lhs,
+ const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __rhs)
+ { return __lhs.str() < __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs succeeds @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, class _Ch_traits, class _Ch_alloc>
+ inline bool
+ operator>(const sub_match<_Bi_iter>& __lhs,
+ const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __rhs)
+ { return __lhs.str() > __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs does not precede @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, class _Ch_traits, class _Ch_alloc>
+ inline bool
+ operator>=(const sub_match<_Bi_iter>& __lhs,
+ const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __rhs)
+ { return __lhs.str() >= __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs does not succeed @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter, class _Ch_traits, class _Ch_alloc>
+ inline bool
+ operator<=(const sub_match<_Bi_iter>& __lhs,
+ const basic_string<
+ typename iterator_traits<_Bi_iter>::value_type,
+ _Ch_traits, _Ch_alloc>& __rhs)
+ { return __lhs.str() <= __rhs; }
+
+ /**
+ * @brief Tests the equivalence of a C string and a regular expression
+ * submatch.
+ * @param lhs A C string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs is equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs == __rhs.str(); }
+
+ /**
+ * @brief Tests the inequivalence of an iterator value and a regular
+ * expression submatch.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs is not equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator!=(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs != __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs precedes @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs < __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs succeeds @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator>(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs > __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs does not precede @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator>=(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs >= __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs does not succeed @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator<=(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs <= __rhs.str(); }
+
+ /**
+ * @brief Tests the equivalence of a regular expression submatch and a
+ * string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A pointer to a string?
+ * @returns true if @a lhs is equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator==(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const* __rhs)
+ { return __lhs.str() == __rhs; }
+
+ /**
+ * @brief Tests the inequivalence of a regular expression submatch and a
+ * string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A pointer to a string.
+ * @returns true if @a lhs is not equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator!=(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const* __rhs)
+ { return __lhs.str() != __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs precedes @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator<(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const* __rhs)
+ { return __lhs.str() < __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs succeeds @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator>(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const* __rhs)
+ { return __lhs.str() > __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs does not precede @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator>=(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const* __rhs)
+ { return __lhs.str() >= __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A string.
+ * @returns true if @a lhs does not succeed @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator<=(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const* __rhs)
+ { return __lhs.str() <= __rhs; }
+
+ /**
+ * @brief Tests the equivalence of a string and a regular expression
+ * submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs is equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs == __rhs.str(); }
+
+ /**
+ * @brief Tests the inequivalence of a string and a regular expression
+ * submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs is not equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator!=(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs != __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs precedes @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs < __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs succeeds @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator>(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs > __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs does not precede @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator>=(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs >= __rhs.str(); }
+
+ /**
+ * @brief Tests the ordering of a string and a regular expression submatch.
+ * @param lhs A string.
+ * @param rhs A regular expression submatch.
+ * @returns true if @a lhs does not succeed @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator<=(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
+ const sub_match<_Bi_iter>& __rhs)
+ { return __lhs <= __rhs.str(); }
+
+ /**
+ * @brief Tests the equivalence of a regular expression submatch and a
+ * string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A const string reference.
+ * @returns true if @a lhs is equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator==(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const& __rhs)
+ { return __lhs.str() == __rhs; }
+
+ /**
+ * @brief Tests the inequivalence of a regular expression submatch and a
+ * string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A const string reference.
+ * @returns true if @a lhs is not equivalent to @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator!=(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const& __rhs)
+ { return __lhs.str() != __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A const string reference.
+ * @returns true if @a lhs precedes @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator<(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const& __rhs)
+ { return __lhs.str() < __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A const string reference.
+ * @returns true if @a lhs succeeds @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator>(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const& __rhs)
+ { return __lhs.str() > __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A const string reference.
+ * @returns true if @a lhs does not precede @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator>=(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const& __rhs)
+ { return __lhs.str() >= __rhs; }
+
+ /**
+ * @brief Tests the ordering of a regular expression submatch and a string.
+ * @param lhs A regular expression submatch.
+ * @param rhs A const string reference.
+ * @returns true if @a lhs does not succeed @a rhs, false otherwise.
+ */
+ template<typename _Bi_iter>
+ inline bool
+ operator<=(const sub_match<_Bi_iter>& __lhs,
+ typename iterator_traits<_Bi_iter>::value_type const& __rhs)
+ { return __lhs.str() <= __rhs; }
+
+ /**
+ * @brief Inserts a matched string into an output stream.
+ *
+ * @param os The output stream.
+ * @param m A submatch string.
+ *
+ * @returns the output stream with the submatch string inserted.
+ */
+ template<typename _Ch_type, typename _Ch_traits, typename _Bi_iter>
+ inline
+ basic_ostream<_Ch_type, _Ch_traits>&
+ operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os,
+ const sub_match<_Bi_iter>& __m)
+ { return __os << __m.str(); }
+
+ // [7.10] Class template match_results
+ /**
+ * @brief The results of a match or search operation.
+ *
+ * A collection of character sequences representing the result of a regular
+ * expression match. Storage for the collection is allocated and freed as
+ * necessary by the member functions of class template match_results.
+ *
+ * This class satisfies the Sequence requirements, with the exception that
+ * only the operations defined for a const-qualified Sequence are supported.
+ *
+ * The sub_match object stored at index 0 represents sub-expression 0, i.e.
+ * the whole match. In this case the sub_match member matched is always true.
+ * The sub_match object stored at index n denotes what matched the marked
+ * sub-expression n within the matched expression. If the sub-expression n
+ * participated in a regular expression match then the sub_match member
+ * matched evaluates to true, and members first and second denote the range
+ * of characters [first, second) which formed that match. Otherwise matched
+ * is false, and members first and second point to the end of the sequence
+ * that was searched.
+ *
+ * @nosubgrouping
+ */
+ template<typename _Bi_iter,
+ typename _Allocator = allocator<sub_match<_Bi_iter> > >
+ class match_results
+ : private std::vector<std::_GLIBCXX_TR1 sub_match<_Bi_iter>, _Allocator>
+ {
+ private:
+ typedef std::vector<std::_GLIBCXX_TR1 sub_match<_Bi_iter>, _Allocator>
+ _Base_type;
+
+ public:
+ /**
+ * @name 10.? Public Types
+ */
+ //@{
+ typedef sub_match<_Bi_iter> value_type;
+ typedef typename _Allocator::const_reference const_reference;
+ typedef const_reference reference;
+ typedef typename _Base_type::const_iterator const_iterator;
+ typedef const_iterator iterator;
+ typedef typename iterator_traits<_Bi_iter>::difference_type
+ difference_type;
+ typedef typename _Allocator::size_type size_type;
+ typedef _Allocator allocator_type;
+ typedef typename iterator_traits<_Bi_iter>::value_type char_type;
+ typedef basic_string<char_type> string_type;
+ //@}
+
+ public:
+ /**
+ * @name 10.1 Construction, Copying, and Destruction
+ */
+ //@{
+
+ /**
+ * @brief Constructs a default %match_results container.
+ * @post size() returns 0 and str() returns an empty string.
+ */
+ explicit
+ match_results(const _Allocator& __a = _Allocator())
+ : _Base_type(__a), _M_matched(false)
+ { }
+
+ /**
+ * @brief Copy constructs a %match_results.
+ */
+ match_results(const match_results& __rhs)
+ : _Base_type(__rhs), _M_matched(__rhs._M_matched),
+ _M_prefix(__rhs._M_prefix), _M_suffix(__rhs._M_suffix)
+ { }
+
+ /**
+ * @brief Assigns rhs to *this.
+ */
+ match_results&
+ operator=(const match_results& __rhs)
+ {
+ match_results __tmp(__rhs);
+ this->swap(__tmp);
+ return *this;
+ }
+
+ /**
+ * @brief Destroys a %match_results object.
+ */
+ ~match_results()
+ { }
+
+ //@}
+
+ /**
+ * @name 10.2 Size
+ */
+ //@{
+
+ /**
+ * @brief Gets the number of matches and submatches.
+ *
+ * The number of matches for a given regular expression will be either 0
+ * if there was no match or mark_count() + 1 if a match was successful.
+ * Some matches may be empty.
+ *
+ * @returns the number of matches found.
+ */
+ size_type
+ size() const
+ { return _M_matched ? _Base_type::size() + 1 : 0; }
+
+ //size_type
+ //max_size() const;
+ using _Base_type::max_size;
+
+ /**
+ * @brief Indicates if the %match_results contains no results.
+ * @retval true The %match_results object is empty.
+ * @retval false The %match_results object is not empty.
+ */
+ bool
+ empty() const
+ { return size() == 0; }
+
+ //@}
+
+ /**
+ * @name 10.3 Element Access
+ */
+ //@{
+
+ /**
+ * @brief Gets the length of the indicated submatch.
+ * @param sub indicates the submatch.
+ *
+ * This function returns the length of the indicated submatch, or the
+ * length of the entire match if @p sub is zero (the default).
+ */
+ difference_type
+ length(size_type __sub = 0) const
+ { return _M_matched ? this->str(__sub).length() : 0; }
+
+ /**
+ * @brief Gets the offset of the beginning of the indicated submatch.
+ * @param sub indicates the submatch.
+ *
+ * This function returns the offset from the beginning of the target
+ * sequence to the beginning of the submatch, unless the value of @p sub
+ * is zero (the default), in which case this function returns the offset
+ * from the beginning of the target sequence to the beginning of the
+ * match.
+ */
+ difference_type
+ position(size_type __sub = 0) const
+ {
+ return _M_matched ? std::distance(this->prefix().first,
+ (*this)[__sub].first) : 0;
+ }
+
+ /**
+ * @brief Gets the match or submatch converted to a string type.
+ * @param sub indicates the submatch.
+ *
+ * This function gets the submatch (or match, if @p sub is zero) extracted
+ * from the target range and converted to the associated string type.
+ */
+ string_type
+ str(size_type __sub = 0) const
+ { return _M_matched ? (*this)[__sub].str() : string_type(); }
+
+ /**
+ * @brief Gets a %sub_match reference for the match or submatch.
+ * @param sub indicates the submatch.
+ *
+ * This function gets a reference to the indicated submatch, or the entire
+ * match if @p sub is zero.
+ *
+ * If @p sub >= size() then this function returns a %sub_match with a
+ * special value indicating no submatch.
+ */
+ const_reference
+ operator[](size_type __sub) const
+ { return _Base_type::operator[](__sub); }
+
+ /**
+ * @brief Gets a %sub_match representing the match prefix.
+ *
+ * This function gets a reference to a %sub_match object representing the
+ * part of the target range between the start of the target range and the
+ * start of the match.
+ */
+ const_reference
+ prefix() const
+ { return _M_prefix; }
+
+ /**
+ * @brief Gets a %sub_match representing the match suffix.
+ *
+ * This function gets a reference to a %sub_match object representing the
+ * part of the target range between the end of the match and the end of
+ * the target range.
+ */
+ const_reference
+ suffix() const
+ { return _M_suffix; }
+
+ /**
+ * @brief Gets an iterator to the start of the %sub_match collection.
+ */
+ const_iterator
+ begin() const
+ { return _Base_type::begin(); }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ /**
+ * @brief Gets an iterator to the start of the %sub_match collection.
+ */
+ const_iterator
+ cbegin() const
+ { return _Base_type::begin(); }
+#endif
+
+ /**
+ * @brief Gets an iterator to one-past-the-end of the collection.
+ */
+ const_iterator
+ end() const
+ { return _Base_type::end(); }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ /**
+ * @brief Gets an iterator to one-past-the-end of the collection.
+ */
+ const_iterator
+ cend() const
+ { return _Base_type::end(); }
+#endif
+
+ //@}
+
+ /**
+ * @name 10.4 Formatting
+ *
+ * These functions perform formatted substitution of the matched character
+ * sequences into their target. The format specifiers and escape sequences
+ * accepted by these functions are determined by their @p flags parameter
+ * as documented above.
+ */
+ //@{
+
+ /**
+ * @todo Implement this function.
+ */
+ template<typename _Out_iter>
+ _Out_iter
+ format(_Out_iter __out, const string_type& __fmt,
+ regex_constants::match_flag_type __flags
+ = regex_constants::format_default) const;
+
+ /**
+ * @todo Implement this function.
+ */
+ string_type
+ format(const string_type& __fmt,
+ regex_constants::match_flag_type __flags
+ = regex_constants::format_default) const;
+
+ //@}
+
+ /**
+ * @name 10.5 Allocator
+ */
+ //@{
+
+ /**
+ * @brief Gets a copy of the allocator.
+ */
+ //allocator_type
+ //get_allocator() const;
+ using _Base_type::get_allocator;
+
+ //@}
+
+ /**
+ * @name 10.6 Swap
+ */
+ //@{
+
+ /**
+ * @brief Swaps the contents of two match_results.
+ */
+ void
+ swap(match_results& __that)
+ {
+ _Base_type::swap(__that);
+ std::swap(_M_matched, __that._M_matched);
+ std::swap(_M_prefix, __that._M_prefix);
+ std::swap(_M_suffix, __that._M_suffix);
+ }
+ //@}
+
+ private:
+ bool _M_matched;
+ value_type _M_prefix;
+ value_type _M_suffix;
+ };
+
+ typedef match_results<const char*> cmatch;
+ typedef match_results<string::const_iterator> smatch;
+#ifdef _GLIBCXX_USE_WCHAR_T
+ typedef match_results<const wchar_t*> wcmatch;
+ typedef match_results<wstring::const_iterator> wsmatch;
+#endif
+
+ // match_results comparisons
+ /**
+ * @brief Compares two match_results for equality.
+ * @returns true if the two objects refer to the same match,
+ * false otherwise.
+ * @todo Implement this function.
+ */
+ template<typename _Bi_iter, typename _Allocator>
+ inline bool
+ operator==(const match_results<_Bi_iter, _Allocator>& __m1,
+ const match_results<_Bi_iter, _Allocator>& __m2);
+
+ /**
+ * @brief Compares two match_results for inequality.
+ * @returns true if the two objects do not refer to the same match,
+ * false otherwise.
+ */
+ template<typename _Bi_iter, class _Allocator>
+ inline bool
+ operator!=(const match_results<_Bi_iter, _Allocator>& __m1,
+ const match_results<_Bi_iter, _Allocator>& __m2)
+ { return !(__m1 == __m2); }
+
+ // [7.10.6] match_results swap
+ /**
+ * @brief Swaps two match results.
+ * @param lhs A match result.
+ * @param rhs A match result.
+ *
+ * The contents of the two match_results objects are swapped.
+ */
+ template<typename _Bi_iter, typename _Allocator>
+ inline void
+ swap(match_results<_Bi_iter, _Allocator>& __lhs,
+ match_results<_Bi_iter, _Allocator>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ // [7.11.2] Function template regex_match
+ /**
+ * @name Matching, Searching, and Replacing
+ */
+ //@{
+
+ /**
+ * @brief Determines if there is a match between the regular expression @p e
+ * and all of the character sequence [first, last).
+ *
+ * @param first Beginning of the character sequence to match.
+ * @param last One-past-the-end of the character sequence to match.
+ * @param m The match results.
+ * @param re The regular expression.
+ * @param flags Controls how the regular expression is matched.
+ *
+ * @retval true A match exists.
+ * @retval false Otherwise.
+ *
+ * @throws an exception of type regex_error.
+ *
+ * @todo Implement this function.
+ */
+ template<typename _Bi_iter, typename _Allocator,
+ typename _Ch_type, typename _Rx_traits>
+ bool
+ regex_match(_Bi_iter __first, _Bi_iter __last,
+ match_results<_Bi_iter, _Allocator>& __m,
+ const basic_regex<_Ch_type, _Rx_traits>& __re,
+ regex_constants::match_flag_type __flags
+ = regex_constants::match_default);
+
+ /**
+ * @brief Indicates if there is a match between the regular expression @p e
+ * and all of the character sequence [first, last).
+ *
+ * @param first Beginning of the character sequence to match.
+ * @param last One-past-the-end of the character sequence to match.
+ * @param re The regular expression.
+ * @param flags Controls how the regular expression is matched.
+ *
+ * @retval true A match exists.
+ * @retval false Otherwise.
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Bi_iter, typename _Ch_type, typename _Rx_traits>
+ bool
+ regex_match(_Bi_iter __first, _Bi_iter __last,
+ const basic_regex<_Ch_type, _Rx_traits>& __re,
+ regex_constants::match_flag_type __flags
+ = regex_constants::match_default)
+ {
+ match_results<_Bi_iter> __what;
+ return regex_match(__first, __last, __what, __re, __flags);
+ }
+
+ /**
+ * @brief Determines if there is a match between the regular expression @p e
+ * and a C-style null-terminated string.
+ *
+ * @param s The C-style null-terminated string to match.
+ * @param m The match results.
+ * @param re The regular expression.
+ * @param f Controls how the regular expression is matched.
+ *
+ * @retval true A match exists.
+ * @retval false Otherwise.
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Ch_type, typename _Allocator, typename _Rx_traits>
+ inline bool
+ regex_match(const _Ch_type* __s,
+ match_results<const _Ch_type*, _Allocator>& __m,
+ const basic_regex<_Ch_type, _Rx_traits>& __re,
+ regex_constants::match_flag_type __f
+ = regex_constants::match_default)
+ { return regex_match(__s, __s + _Rx_traits::length(__s), __m, __re, __f); }
+
+ /**
+ * @brief Determines if there is a match between the regular expression @p e
+ * and a string.
+ *
+ * @param s The string to match.
+ * @param m The match results.
+ * @param re The regular expression.
+ * @param flags Controls how the regular expression is matched.
+ *
+ * @retval true A match exists.
+ * @retval false Otherwise.
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Ch_traits, typename _Ch_alloc,
+ typename _Allocator, typename _Ch_type, typename _Rx_traits>
+ inline bool
+ regex_match(const basic_string<_Ch_type, _Ch_traits, _Ch_alloc>& __s,
+ match_results<typename basic_string<_Ch_type,
+ _Ch_traits, _Ch_alloc>::const_iterator, _Allocator>& __m,
+ const basic_regex<_Ch_type, _Rx_traits>& __re,
+ regex_constants::match_flag_type __flags
+ = regex_constants::match_default)
+ { return regex_match(__s.begin(), __s.end(), __m, __re, __flags); }
+
+ /**
+ * @brief Indicates if there is a match between the regular expression @p e
+ * and a C-style null-terminated string.
+ *
+ * @param s The C-style null-terminated string to match.
+ * @param re The regular expression.
+ * @param f Controls how the regular expression is matched.
+ *
+ * @retval true A match exists.
+ * @retval false Otherwise.
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Ch_type, class _Rx_traits>
+ inline bool
+ regex_match(const _Ch_type* __s,
+ const basic_regex<_Ch_type, _Rx_traits>& __re,
+ regex_constants::match_flag_type __f
+ = regex_constants::match_default)
+ { return regex_match(__s, __s + _Rx_traits::length(__s), __re, __f); }
+
+ /**
+ * @brief Indicates if there is a match between the regular expression @p e
+ * and a string.
+ *
+ * @param s [IN] The string to match.
+ * @param re [IN] The regular expression.
+ * @param flags [IN] Controls how the regular expression is matched.
+ *
+ * @retval true A match exists.
+ * @retval false Otherwise.
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Ch_traits, typename _Str_allocator,
+ typename _Ch_type, typename _Rx_traits>
+ inline bool
+ regex_match(const basic_string<_Ch_type, _Ch_traits, _Str_allocator>& __s,
+ const basic_regex<_Ch_type, _Rx_traits>& __re,
+ regex_constants::match_flag_type __flags
+ = regex_constants::match_default)
+ { return regex_match(__s.begin(), __s.end(), __re, __flags); }
+
+ // [7.11.3] Function template regex_search
+ /**
+ * Searches for a regular expression within a range.
+ * @param first [IN] The start of the string to search.
+ * @param last [IN] One-past-the-end of the string to search.
+ * @param m [OUT] The match results.
+ * @param re [IN] The regular expression to search for.
+ * @param flags [IN] Search policy flags.
+ * @retval true A match was found within the string.
+ * @retval false No match was found within the string, the content of %m is
+ * undefined.
+ *
+ * @throws an exception of type regex_error.
+ *
+ * @todo Implement this function.
+ */
+ template<typename _Bi_iter, typename _Allocator,
+ typename _Ch_type, typename _Rx_traits>
+ inline bool
+ regex_search(_Bi_iter __first, _Bi_iter __last,
+ match_results<_Bi_iter, _Allocator>& __m,
+ const basic_regex<_Ch_type, _Rx_traits>& __re,
+ regex_constants::match_flag_type __flags
+ = regex_constants::match_default);
+
+ /**
+ * Searches for a regular expression within a range.
+ * @param first [IN] The start of the string to search.
+ * @param last [IN] One-past-the-end of the string to search.
+ * @param re [IN] The regular expression to search for.
+ * @param flags [IN] Search policy flags.
+ * @retval true A match was found within the string.
+ * @retval false No match was found within the string.
+ * @doctodo
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Bi_iter, typename _Ch_type, typename _Rx_traits>
+ inline bool
+ regex_search(_Bi_iter __first, _Bi_iter __last,
+ const basic_regex<_Ch_type, _Rx_traits>& __re,
+ regex_constants::match_flag_type __flags
+ = regex_constants::match_default)
+ {
+ match_results<_Bi_iter> __what;
+ return regex_search(__first, __last, __what, __re, __flags);
+ }
+
+ /**
+ * @brief Searches for a regular expression within a C-string.
+ * @param s [IN] A C-string to search for the regex.
+ * @param m [OUT] The set of regex matches.
+ * @param e [IN] The regex to search for in @p s.
+ * @param f [IN] The search flags.
+ * @retval true A match was found within the string.
+ * @retval false No match was found within the string, the content of %m is
+ * undefined.
+ * @doctodo
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Ch_type, class _Allocator, class _Rx_traits>
+ inline bool
+ regex_search(const _Ch_type* __s,
+ match_results<const _Ch_type*, _Allocator>& __m,
+ const basic_regex<_Ch_type, _Rx_traits>& __e,
+ regex_constants::match_flag_type __f
+ = regex_constants::match_default)
+ { return regex_search(__s, __s + _Rx_traits::length(__s), __m, __e, __f); }
+
+ /**
+ * @brief Searches for a regular expression within a C-string.
+ * @param s [IN] The C-string to search.
+ * @param e [IN] The regular expression to search for.
+ * @param f [IN] Search policy flags.
+ * @retval true A match was found within the string.
+ * @retval false No match was found within the string.
+ * @doctodo
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Ch_type, typename _Rx_traits>
+ inline bool
+ regex_search(const _Ch_type* __s,
+ const basic_regex<_Ch_type, _Rx_traits>& __e,
+ regex_constants::match_flag_type __f
+ = regex_constants::match_default)
+ { return regex_search(__s, __s + _Rx_traits::length(__s), __e, __f); }
+
+ /**
+ * @brief Searches for a regular expression within a string.
+ * @param s [IN] The string to search.
+ * @param e [IN] The regular expression to search for.
+ * @param flags [IN] Search policy flags.
+ * @retval true A match was found within the string.
+ * @retval false No match was found within the string.
+ * @doctodo
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Ch_traits, typename _String_allocator,
+ typename _Ch_type, typename _Rx_traits>
+ inline bool
+ regex_search(const basic_string<_Ch_type, _Ch_traits,
+ _String_allocator>& __s,
+ const basic_regex<_Ch_type, _Rx_traits>& __e,
+ regex_constants::match_flag_type __flags
+ = regex_constants::match_default)
+ { return regex_search(__s.begin(), __s.end(), __e, __flags); }
+
+ /**
+ * @brief Searches for a regular expression within a string.
+ * @param s [IN] A C++ string to search for the regex.
+ * @param m [OUT] The set of regex matches.
+ * @param e [IN] The regex to search for in @p s.
+ * @param f [IN] The search flags.
+ * @retval true A match was found within the string.
+ * @retval false No match was found within the string, the content of %m is
+ * undefined.
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Ch_traits, typename _Ch_alloc,
+ typename _Allocator, typename _Ch_type,
+ typename _Rx_traits>
+ inline bool
+ regex_search(const basic_string<_Ch_type, _Ch_traits, _Ch_alloc>& __s,
+ match_results<typename basic_string<_Ch_type,
+ _Ch_traits, _Ch_alloc>::const_iterator, _Allocator>& __m,
+ const basic_regex<_Ch_type, _Rx_traits>& __e,
+ regex_constants::match_flag_type __f
+ = regex_constants::match_default)
+ { return regex_search(__s.begin(), __s.end(), __m, __e, __f); }
+
+ // tr1 [7.11.4] std [28.11.4] Function template regex_replace
+ /**
+ * @doctodo
+ * @param out
+ * @param first
+ * @param last
+ * @param e
+ * @param fmt
+ * @param flags
+ *
+ * @returns out
+ * @throws an exception of type regex_error.
+ *
+ * @todo Implement this function.
+ */
+ template<typename _Out_iter, typename _Bi_iter,
+ typename _Rx_traits, typename _Ch_type>
+ inline _Out_iter
+ regex_replace(_Out_iter __out, _Bi_iter __first, _Bi_iter __last,
+ const basic_regex<_Ch_type, _Rx_traits>& __e,
+ const basic_string<_Ch_type>& __fmt,
+ regex_constants::match_flag_type __flags
+ = regex_constants::match_default);
+
+ /**
+ * @doctodo
+ * @param s
+ * @param e
+ * @param fmt
+ * @param flags
+ *
+ * @returns a copy of string @p s with replacements.
+ *
+ * @throws an exception of type regex_error.
+ */
+ template<typename _Rx_traits, typename _Ch_type>
+ inline basic_string<_Ch_type>
+ regex_replace(const basic_string<_Ch_type>& __s,
+ const basic_regex<_Ch_type, _Rx_traits>& __e,
+ const basic_string<_Ch_type>& __fmt,
+ regex_constants::match_flag_type __flags
+ = regex_constants::match_default)
+ {
+ std::string __result;
+ regex_replace(std::back_inserter(__result),
+ __s.begin(), __s.end(), __e, __fmt, __flags);
+ return __result;
+ }
+
+ //@}
+
+ // tr1 [7.12.1] std [28.12] Class template regex_iterator
+ /**
+ * An iterator adaptor that will provide repeated calls of regex_search over
+ * a range until no more matches remain.
+ */
+ template<typename _Bi_iter,
+ typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type,
+ typename _Rx_traits = regex_traits<_Ch_type> >
+ class regex_iterator
+ {
+ public:
+ typedef basic_regex<_Ch_type, _Rx_traits> regex_type;
+ typedef match_results<_Bi_iter> value_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef const value_type* pointer;
+ typedef const value_type& reference;
+ typedef std::forward_iterator_tag iterator_category;
+
+ public:
+ /**
+ * @brief Provides a singular iterator, useful for indicating
+ * one-past-the-end of a range.
+ * @todo Implement this function.
+ * @doctodo
+ */
+ regex_iterator();
+
+ /**
+ * Constructs a %regex_iterator...
+ * @param a [IN] The start of a text range to search.
+ * @param b [IN] One-past-the-end of the text range to search.
+ * @param re [IN] The regular expression to match.
+ * @param m [IN] Policy flags for match rules.
+ * @todo Implement this function.
+ * @doctodo
+ */
+ regex_iterator(_Bi_iter __a, _Bi_iter __b, const regex_type& __re,
+ regex_constants::match_flag_type __m
+ = regex_constants::match_default);
+
+ /**
+ * Copy constructs a %regex_iterator.
+ * @todo Implement this function.
+ * @doctodo
+ */
+ regex_iterator(const regex_iterator& __rhs);
+
+ /**
+ * @todo Implement this function.
+ * @doctodo
+ */
+ regex_iterator&
+ operator=(const regex_iterator& __rhs);
+
+ /**
+ * @todo Implement this function.
+ * @doctodo
+ */
+ bool
+ operator==(const regex_iterator& __rhs);
+
+ /**
+ * @todo Implement this function.
+ * @doctodo
+ */
+ bool
+ operator!=(const regex_iterator& __rhs);
+
+ /**
+ * @todo Implement this function.
+ * @doctodo
+ */
+ const value_type&
+ operator*();
+
+ /**
+ * @todo Implement this function.
+ * @doctodo
+ */
+ const value_type*
+ operator->();
+
+ /**
+ * @todo Implement this function.
+ * @doctodo
+ */
+ regex_iterator&
+ operator++();
+
+ /**
+ * @todo Implement this function.
+ * @doctodo
+ */
+ regex_iterator
+ operator++(int);
+
+ private:
+ // these members are shown for exposition only:
+ _Bi_iter begin;
+ _Bi_iter end;
+ const regex_type* pregex;
+ regex_constants::match_flag_type flags;
+ match_results<_Bi_iter> match;
+ };
+
+ typedef regex_iterator<const char*> cregex_iterator;
+ typedef regex_iterator<string::const_iterator> sregex_iterator;
+#ifdef _GLIBCXX_USE_WCHAR_T
+ typedef regex_iterator<const wchar_t*> wcregex_iterator;
+ typedef regex_iterator<wstring::const_iterator> wsregex_iterator;
+#endif
+
+ // [7.12.2] Class template regex_token_iterator
+ /**
+ * Iterates over submatches in a range (or "splits" a text string).
+ *
+ * The purpose of this iterator is to enumerate all, or all specified,
+ * matches of a regular expression within a text range. The dereferenced
+ * value of an iterator of this class is a std::tr1::sub_match object.
+ */
+ template<typename _Bi_iter,
+ typename _Ch_type = typename iterator_traits<_Bi_iter>::value_type,
+ typename _Rx_traits = regex_traits<_Ch_type> >
+ class regex_token_iterator
+ {
+ public:
+ typedef basic_regex<_Ch_type, _Rx_traits> regex_type;
+ typedef sub_match<_Bi_iter> value_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef const value_type* pointer;
+ typedef const value_type& reference;
+ typedef std::forward_iterator_tag iterator_category;
+
+ public:
+ /**
+ * @brief Default constructs a %regex_token_iterator.
+ * @todo Implement this function.
+ *
+ * A default-constructed %regex_token_iterator is a singular iterator
+ * that will compare equal to the one-past-the-end value for any
+ * iterator of the same type.
+ */
+ regex_token_iterator();
+
+ /**
+ * Constructs a %regex_token_iterator...
+ * @param a [IN] The start of the text to search.
+ * @param b [IN] One-past-the-end of the text to search.
+ * @param re [IN] The regular expression to search for.
+ * @param submatch [IN] Which submatch to return. There are some
+ * special values for this parameter:
+ * - -1 each enumerated subexpression does NOT
+ * match the regular expression (aka field
+ * splitting)
+ * - 0 the entire string matching the
+ * subexpression is returned for each match
+ * within the text.
+ * - >0 enumerates only the indicated
+ * subexpression from a match within the text.
+ * @param m [IN] Policy flags for match rules.
+ *
+ * @todo Implement this function.
+ * @doctodo
+ */
+ regex_token_iterator(_Bi_iter __a, _Bi_iter __b, const regex_type& __re,
+ int __submatch = 0,
+ regex_constants::match_flag_type __m
+ = regex_constants::match_default);
+
+ /**
+ * Constructs a %regex_token_iterator...
+ * @param a [IN] The start of the text to search.
+ * @param b [IN] One-past-the-end of the text to search.
+ * @param re [IN] The regular expression to search for.
+ * @param submatches [IN] A list of subexpressions to return for each
+ * regular expression match within the text.
+ * @param m [IN] Policy flags for match rules.
+ *
+ * @todo Implement this function.
+ * @doctodo
+ */
+ regex_token_iterator(_Bi_iter __a, _Bi_iter __b,
+ const regex_type& __re,
+ const std::vector<int>& __submatches,
+ regex_constants::match_flag_type __m
+ = regex_constants::match_default);
+
+ /**
+ * Constructs a %regex_token_iterator...
+ * @param a [IN] The start of the text to search.
+ * @param b [IN] One-past-the-end of the text to search.
+ * @param re [IN] The regular expression to search for.
+ * @param submatches [IN] A list of subexpressions to return for each
+ * regular expression match within the text.
+ * @param m [IN] Policy flags for match rules.
+
+ * @todo Implement this function.
+ * @doctodo
+ */
+ template<std::size_t _Nm>
+ regex_token_iterator(_Bi_iter __a, _Bi_iter __b,
+ const regex_type& __re,
+ const int (&__submatches)[_Nm],
+ regex_constants::match_flag_type __m
+ = regex_constants::match_default);
+
+ /**
+ * @brief Copy constructs a %regex_token_iterator.
+ * @param rhs [IN] A %regex_token_iterator to copy.
+ * @todo Implement this function.
+ */
+ regex_token_iterator(const regex_token_iterator& __rhs);
+
+ /**
+ * @brief Assigns a %regex_token_iterator to another.
+ * @param rhs [IN] A %regex_token_iterator to copy.
+ * @todo Implement this function.
+ */
+ regex_token_iterator&
+ operator=(const regex_token_iterator& __rhs);
+
+ /**
+ * @brief Compares a %regex_token_iterator to another for equality.
+ * @todo Implement this function.
+ */
+ bool
+ operator==(const regex_token_iterator& __rhs);
+
+ /**
+ * @brief Compares a %regex_token_iterator to another for inequality.
+ * @todo Implement this function.
+ */
+ bool
+ operator!=(const regex_token_iterator& __rhs);
+
+ /**
+ * @brief Dereferences a %regex_token_iterator.
+ * @todo Implement this function.
+ */
+ const value_type&
+ operator*();
+
+ /**
+ * @brief Selects a %regex_token_iterator member.
+ * @todo Implement this function.
+ */
+ const value_type*
+ operator->();
+
+ /**
+ * @brief Increments a %regex_token_iterator.
+ * @todo Implement this function.
+ */
+ regex_token_iterator&
+ operator++();
+
+ /**
+ * @brief Postincrements a %regex_token_iterator.
+ * @todo Implement this function.
+ */
+ regex_token_iterator
+ operator++(int);
+
+ private: // data members for exposition only:
+ typedef regex_iterator<_Bi_iter, _Ch_type, _Rx_traits> position_iterator;
+
+ position_iterator __position;
+ const value_type* __result;
+ value_type __suffix;
+ std::size_t __n;
+ std::vector<int> __subs;
+ };
+
+ /** @brief Token iterator for C-style NULL-terminated strings. */
+ typedef regex_token_iterator<const char*> cregex_token_iterator;
+ /** @brief Token iterator for standard strings. */
+ typedef regex_token_iterator<string::const_iterator> sregex_token_iterator;
+#ifdef _GLIBCXX_USE_WCHAR_T
+ /** @brief Token iterator for C-style NULL-terminated wide strings. */
+ typedef regex_token_iterator<const wchar_t*> wcregex_token_iterator;
+ /** @brief Token iterator for standard wide-character strings. */
+ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
+#endif
+
+ //@}
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/type_traits b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/type_traits
new file mode 100644
index 0000000..75b85ea
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/type_traits
@@ -0,0 +1,501 @@
+// TR1 type_traits -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/type_traits
+* This is an internal header file, included by other library headers.
+* You should not attempt to use it directly.
+*/
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ /**
+ * @defgroup metaprogramming Type Traits
+ * @ingroup utilities
+ *
+ * Compile time type transformation and information.
+ * @{
+ */
+
+ // For use in __is_convertible_simple.
+ struct __sfinae_types
+ {
+ typedef char __one;
+ typedef struct { char __arr[2]; } __two;
+ };
+
+#define _DEFINE_SPEC_0_HELPER \
+ template<>
+
+#define _DEFINE_SPEC_1_HELPER \
+ template<typename _Tp>
+
+#define _DEFINE_SPEC_2_HELPER \
+ template<typename _Tp, typename _Cp>
+
+#define _DEFINE_SPEC(_Order, _Trait, _Type, _Value) \
+ _DEFINE_SPEC_##_Order##_HELPER \
+ struct _Trait<_Type> \
+ : public integral_constant<bool, _Value> { };
+
+ // helper classes [4.3].
+
+ /// integral_constant
+ template<typename _Tp, _Tp __v>
+ struct integral_constant
+ {
+ static const _Tp value = __v;
+ typedef _Tp value_type;
+ typedef integral_constant<_Tp, __v> type;
+ };
+
+ /// typedef for true_type
+ typedef integral_constant<bool, true> true_type;
+
+ /// typedef for false_type
+ typedef integral_constant<bool, false> false_type;
+
+ template<typename _Tp, _Tp __v>
+ const _Tp integral_constant<_Tp, __v>::value;
+
+ /// remove_cv
+ template<typename>
+ struct remove_cv;
+
+ template<typename>
+ struct __is_void_helper
+ : public false_type { };
+ _DEFINE_SPEC(0, __is_void_helper, void, true)
+
+ // primary type categories [4.5.1].
+
+ /// is_void
+ template<typename _Tp>
+ struct is_void
+ : public integral_constant<bool, (__is_void_helper<typename
+ remove_cv<_Tp>::type>::value)>
+ { };
+
+ template<typename>
+ struct __is_integral_helper
+ : public false_type { };
+ _DEFINE_SPEC(0, __is_integral_helper, bool, true)
+ _DEFINE_SPEC(0, __is_integral_helper, char, true)
+ _DEFINE_SPEC(0, __is_integral_helper, signed char, true)
+ _DEFINE_SPEC(0, __is_integral_helper, unsigned char, true)
+#ifdef _GLIBCXX_USE_WCHAR_T
+ _DEFINE_SPEC(0, __is_integral_helper, wchar_t, true)
+#endif
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ _DEFINE_SPEC(0, __is_integral_helper, char16_t, true)
+ _DEFINE_SPEC(0, __is_integral_helper, char32_t, true)
+#endif
+ _DEFINE_SPEC(0, __is_integral_helper, short, true)
+ _DEFINE_SPEC(0, __is_integral_helper, unsigned short, true)
+ _DEFINE_SPEC(0, __is_integral_helper, int, true)
+ _DEFINE_SPEC(0, __is_integral_helper, unsigned int, true)
+ _DEFINE_SPEC(0, __is_integral_helper, long, true)
+ _DEFINE_SPEC(0, __is_integral_helper, unsigned long, true)
+ _DEFINE_SPEC(0, __is_integral_helper, long long, true)
+ _DEFINE_SPEC(0, __is_integral_helper, unsigned long long, true)
+
+ /// is_integral
+ template<typename _Tp>
+ struct is_integral
+ : public integral_constant<bool, (__is_integral_helper<typename
+ remove_cv<_Tp>::type>::value)>
+ { };
+
+ template<typename>
+ struct __is_floating_point_helper
+ : public false_type { };
+ _DEFINE_SPEC(0, __is_floating_point_helper, float, true)
+ _DEFINE_SPEC(0, __is_floating_point_helper, double, true)
+ _DEFINE_SPEC(0, __is_floating_point_helper, long double, true)
+
+ /// is_floating_point
+ template<typename _Tp>
+ struct is_floating_point
+ : public integral_constant<bool, (__is_floating_point_helper<typename
+ remove_cv<_Tp>::type>::value)>
+ { };
+
+ /// is_array
+ template<typename>
+ struct is_array
+ : public false_type { };
+
+ template<typename _Tp, std::size_t _Size>
+ struct is_array<_Tp[_Size]>
+ : public true_type { };
+
+ template<typename _Tp>
+ struct is_array<_Tp[]>
+ : public true_type { };
+
+ template<typename>
+ struct __is_pointer_helper
+ : public false_type { };
+ _DEFINE_SPEC(1, __is_pointer_helper, _Tp*, true)
+
+ /// is_pointer
+ template<typename _Tp>
+ struct is_pointer
+ : public integral_constant<bool, (__is_pointer_helper<typename
+ remove_cv<_Tp>::type>::value)>
+ { };
+
+ /// is_reference
+ template<typename _Tp>
+ struct is_reference;
+
+ /// is_function
+ template<typename _Tp>
+ struct is_function;
+
+ template<typename>
+ struct __is_member_object_pointer_helper
+ : public false_type { };
+ _DEFINE_SPEC(2, __is_member_object_pointer_helper, _Tp _Cp::*,
+ !is_function<_Tp>::value)
+
+ /// is_member_object_pointer
+ template<typename _Tp>
+ struct is_member_object_pointer
+ : public integral_constant<bool, (__is_member_object_pointer_helper<
+ typename remove_cv<_Tp>::type>::value)>
+ { };
+
+ template<typename>
+ struct __is_member_function_pointer_helper
+ : public false_type { };
+ _DEFINE_SPEC(2, __is_member_function_pointer_helper, _Tp _Cp::*,
+ is_function<_Tp>::value)
+
+ /// is_member_function_pointer
+ template<typename _Tp>
+ struct is_member_function_pointer
+ : public integral_constant<bool, (__is_member_function_pointer_helper<
+ typename remove_cv<_Tp>::type>::value)>
+ { };
+
+ /// is_enum
+ template<typename _Tp>
+ struct is_enum
+ : public integral_constant<bool, __is_enum(_Tp)>
+ { };
+
+ /// is_union
+ template<typename _Tp>
+ struct is_union
+ : public integral_constant<bool, __is_union(_Tp)>
+ { };
+
+ /// is_class
+ template<typename _Tp>
+ struct is_class
+ : public integral_constant<bool, __is_class(_Tp)>
+ { };
+
+ /// is_function
+ template<typename>
+ struct is_function
+ : public false_type { };
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes...)>
+ : public true_type { };
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes......)>
+ : public true_type { };
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes...) const>
+ : public true_type { };
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes......) const>
+ : public true_type { };
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes...) volatile>
+ : public true_type { };
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes......) volatile>
+ : public true_type { };
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes...) const volatile>
+ : public true_type { };
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes......) const volatile>
+ : public true_type { };
+
+ // composite type traits [4.5.2].
+
+ /// is_arithmetic
+ template<typename _Tp>
+ struct is_arithmetic
+ : public integral_constant<bool, (is_integral<_Tp>::value
+ || is_floating_point<_Tp>::value)>
+ { };
+
+ /// is_fundamental
+ template<typename _Tp>
+ struct is_fundamental
+ : public integral_constant<bool, (is_arithmetic<_Tp>::value
+ || is_void<_Tp>::value)>
+ { };
+
+ /// is_object
+ template<typename _Tp>
+ struct is_object
+ : public integral_constant<bool, !(is_function<_Tp>::value
+ || is_reference<_Tp>::value
+ || is_void<_Tp>::value)>
+ { };
+
+ /// is_member_pointer
+ template<typename _Tp>
+ struct is_member_pointer;
+
+ /// is_scalar
+ template<typename _Tp>
+ struct is_scalar
+ : public integral_constant<bool, (is_arithmetic<_Tp>::value
+ || is_enum<_Tp>::value
+ || is_pointer<_Tp>::value
+ || is_member_pointer<_Tp>::value)>
+ { };
+
+ /// is_compound
+ template<typename _Tp>
+ struct is_compound
+ : public integral_constant<bool, !is_fundamental<_Tp>::value> { };
+
+ /// is_member_pointer
+ template<typename _Tp>
+ struct __is_member_pointer_helper
+ : public false_type { };
+ _DEFINE_SPEC(2, __is_member_pointer_helper, _Tp _Cp::*, true)
+
+ template<typename _Tp>
+ struct is_member_pointer
+ : public integral_constant<bool, (__is_member_pointer_helper<
+ typename remove_cv<_Tp>::type>::value)>
+ { };
+
+ // type properties [4.5.3].
+ /// is_const
+ template<typename>
+ struct is_const
+ : public false_type { };
+
+ template<typename _Tp>
+ struct is_const<_Tp const>
+ : public true_type { };
+
+ /// is_volatile
+ template<typename>
+ struct is_volatile
+ : public false_type { };
+
+ template<typename _Tp>
+ struct is_volatile<_Tp volatile>
+ : public true_type { };
+
+ /// is_empty
+ template<typename _Tp>
+ struct is_empty
+ : public integral_constant<bool, __is_empty(_Tp)>
+ { };
+
+ /// is_polymorphic
+ template<typename _Tp>
+ struct is_polymorphic
+ : public integral_constant<bool, __is_polymorphic(_Tp)>
+ { };
+
+ /// is_abstract
+ template<typename _Tp>
+ struct is_abstract
+ : public integral_constant<bool, __is_abstract(_Tp)>
+ { };
+
+ /// has_virtual_destructor
+ template<typename _Tp>
+ struct has_virtual_destructor
+ : public integral_constant<bool, __has_virtual_destructor(_Tp)>
+ { };
+
+ /// alignment_of
+ template<typename _Tp>
+ struct alignment_of
+ : public integral_constant<std::size_t, __alignof__(_Tp)> { };
+
+ /// rank
+ template<typename>
+ struct rank
+ : public integral_constant<std::size_t, 0> { };
+
+ template<typename _Tp, std::size_t _Size>
+ struct rank<_Tp[_Size]>
+ : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
+
+ template<typename _Tp>
+ struct rank<_Tp[]>
+ : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
+
+ /// extent
+ template<typename, unsigned _Uint = 0>
+ struct extent
+ : public integral_constant<std::size_t, 0> { };
+
+ template<typename _Tp, unsigned _Uint, std::size_t _Size>
+ struct extent<_Tp[_Size], _Uint>
+ : public integral_constant<std::size_t,
+ _Uint == 0 ? _Size : extent<_Tp,
+ _Uint - 1>::value>
+ { };
+
+ template<typename _Tp, unsigned _Uint>
+ struct extent<_Tp[], _Uint>
+ : public integral_constant<std::size_t,
+ _Uint == 0 ? 0 : extent<_Tp,
+ _Uint - 1>::value>
+ { };
+
+ // relationships between types [4.6].
+
+ /// is_same
+ template<typename, typename>
+ struct is_same
+ : public false_type { };
+
+ template<typename _Tp>
+ struct is_same<_Tp, _Tp>
+ : public true_type { };
+
+ // const-volatile modifications [4.7.1].
+
+ /// remove_const
+ template<typename _Tp>
+ struct remove_const
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct remove_const<_Tp const>
+ { typedef _Tp type; };
+
+ /// remove_volatile
+ template<typename _Tp>
+ struct remove_volatile
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct remove_volatile<_Tp volatile>
+ { typedef _Tp type; };
+
+ /// remove_cv
+ template<typename _Tp>
+ struct remove_cv
+ {
+ typedef typename
+ remove_const<typename remove_volatile<_Tp>::type>::type type;
+ };
+
+ /// add_const
+ template<typename _Tp>
+ struct add_const
+ { typedef _Tp const type; };
+
+ /// add_volatile
+ template<typename _Tp>
+ struct add_volatile
+ { typedef _Tp volatile type; };
+
+ /// add_cv
+ template<typename _Tp>
+ struct add_cv
+ {
+ typedef typename
+ add_const<typename add_volatile<_Tp>::type>::type type;
+ };
+
+ // array modifications [4.7.3].
+
+ /// remove_extent
+ template<typename _Tp>
+ struct remove_extent
+ { typedef _Tp type; };
+
+ template<typename _Tp, std::size_t _Size>
+ struct remove_extent<_Tp[_Size]>
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct remove_extent<_Tp[]>
+ { typedef _Tp type; };
+
+ /// remove_all_extents
+ template<typename _Tp>
+ struct remove_all_extents
+ { typedef _Tp type; };
+
+ template<typename _Tp, std::size_t _Size>
+ struct remove_all_extents<_Tp[_Size]>
+ { typedef typename remove_all_extents<_Tp>::type type; };
+
+ template<typename _Tp>
+ struct remove_all_extents<_Tp[]>
+ { typedef typename remove_all_extents<_Tp>::type type; };
+
+ // pointer modifications [4.7.4].
+
+ template<typename _Tp, typename>
+ struct __remove_pointer_helper
+ { typedef _Tp type; };
+
+ template<typename _Tp, typename _Up>
+ struct __remove_pointer_helper<_Tp, _Up*>
+ { typedef _Up type; };
+
+ /// remove_pointer
+ template<typename _Tp>
+ struct remove_pointer
+ : public __remove_pointer_helper<_Tp, typename remove_cv<_Tp>::type>
+ { };
+
+ template<typename>
+ struct remove_reference;
+
+ /// add_pointer
+ template<typename _Tp>
+ struct add_pointer
+ { typedef typename remove_reference<_Tp>::type* type; };
+
+#undef _DEFINE_SPEC_0_HELPER
+#undef _DEFINE_SPEC_1_HELPER
+#undef _DEFINE_SPEC_2_HELPER
+#undef _DEFINE_SPEC
+
+ // @} group metaprogramming
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/unordered_map b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/unordered_map
new file mode 100644
index 0000000..cef6490
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/unordered_map
@@ -0,0 +1,370 @@
+// TR1 unordered_map -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/unordered_map
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ // XXX When we get typedef templates these class definitions
+ // will be unnecessary.
+ template<class _Key, class _Tp,
+ class _Hash = hash<_Key>,
+ class _Pred = std::equal_to<_Key>,
+ class _Alloc = std::allocator<std::pair<const _Key, _Tp> >,
+ bool __cache_hash_code = false>
+ class __unordered_map
+ : public _Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc,
+ std::_Select1st<std::pair<const _Key, _Tp> >, _Pred,
+ _Hash, __detail::_Mod_range_hashing,
+ __detail::_Default_ranged_hash,
+ __detail::_Prime_rehash_policy,
+ __cache_hash_code, false, true>
+ {
+ typedef _Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc,
+ std::_Select1st<std::pair<const _Key, _Tp> >, _Pred,
+ _Hash, __detail::_Mod_range_hashing,
+ __detail::_Default_ranged_hash,
+ __detail::_Prime_rehash_policy,
+ __cache_hash_code, false, true>
+ _Base;
+
+ public:
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ explicit
+ __unordered_map(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __detail::_Mod_range_hashing(),
+ __detail::_Default_ranged_hash(),
+ __eql, std::_Select1st<std::pair<const _Key, _Tp> >(), __a)
+ { }
+
+ template<typename _InputIterator>
+ __unordered_map(_InputIterator __f, _InputIterator __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__f, __l, __n, __hf, __detail::_Mod_range_hashing(),
+ __detail::_Default_ranged_hash(),
+ __eql, std::_Select1st<std::pair<const _Key, _Tp> >(), __a)
+ { }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ __unordered_map(__unordered_map&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+#endif
+ };
+
+ template<class _Key, class _Tp,
+ class _Hash = hash<_Key>,
+ class _Pred = std::equal_to<_Key>,
+ class _Alloc = std::allocator<std::pair<const _Key, _Tp> >,
+ bool __cache_hash_code = false>
+ class __unordered_multimap
+ : public _Hashtable<_Key, std::pair<const _Key, _Tp>,
+ _Alloc,
+ std::_Select1st<std::pair<const _Key, _Tp> >, _Pred,
+ _Hash, __detail::_Mod_range_hashing,
+ __detail::_Default_ranged_hash,
+ __detail::_Prime_rehash_policy,
+ __cache_hash_code, false, false>
+ {
+ typedef _Hashtable<_Key, std::pair<const _Key, _Tp>,
+ _Alloc,
+ std::_Select1st<std::pair<const _Key, _Tp> >, _Pred,
+ _Hash, __detail::_Mod_range_hashing,
+ __detail::_Default_ranged_hash,
+ __detail::_Prime_rehash_policy,
+ __cache_hash_code, false, false>
+ _Base;
+
+ public:
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ explicit
+ __unordered_multimap(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __detail::_Mod_range_hashing(),
+ __detail::_Default_ranged_hash(),
+ __eql, std::_Select1st<std::pair<const _Key, _Tp> >(), __a)
+ { }
+
+
+ template<typename _InputIterator>
+ __unordered_multimap(_InputIterator __f, _InputIterator __l,
+ typename _Base::size_type __n = 0,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__f, __l, __n, __hf, __detail::_Mod_range_hashing(),
+ __detail::_Default_ranged_hash(),
+ __eql, std::_Select1st<std::pair<const _Key, _Tp> >(), __a)
+ { }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ __unordered_multimap(__unordered_multimap&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+#endif
+ };
+
+ template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc,
+ bool __cache_hash_code>
+ inline void
+ swap(__unordered_map<_Key, _Tp, _Hash, _Pred,
+ _Alloc, __cache_hash_code>& __x,
+ __unordered_map<_Key, _Tp, _Hash, _Pred,
+ _Alloc, __cache_hash_code>& __y)
+ { __x.swap(__y); }
+
+ template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc,
+ bool __cache_hash_code>
+ inline void
+ swap(__unordered_multimap<_Key, _Tp, _Hash, _Pred,
+ _Alloc, __cache_hash_code>& __x,
+ __unordered_multimap<_Key, _Tp, _Hash, _Pred,
+ _Alloc, __cache_hash_code>& __y)
+ { __x.swap(__y); }
+
+
+ /**
+ * @brief A standard container composed of unique keys (containing
+ * at most one of each key value) that associates values of another type
+ * with the keys.
+ *
+ * @ingroup unordered_associative_containers
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, and
+ * <a href="tables.html#xx">unordered associative container</a>
+ *
+ * @param Key Type of key objects.
+ * @param Tp Type of mapped objects.
+ * @param Hash Hashing function object type, defaults to hash<Value>.
+ * @param Pred Predicate function object type, defaults to equal_to<Value>.
+ * @param Alloc Allocator type, defaults to allocator<Key>.
+ *
+ * The resulting value type of the container is std::pair<const Key, Tp>.
+ */
+ template<class _Key, class _Tp,
+ class _Hash = hash<_Key>,
+ class _Pred = std::equal_to<_Key>,
+ class _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
+ class unordered_map
+ : public __unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>
+ {
+ typedef __unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc> _Base;
+
+ public:
+ typedef typename _Base::value_type value_type;
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ explicit
+ unordered_map(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __eql, __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_map(_InputIterator __f, _InputIterator __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__f, __l, __n, __hf, __eql, __a)
+ { }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ unordered_map(unordered_map&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+
+ unordered_map(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a)
+ { }
+
+ unordered_map&
+ operator=(unordered_map&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ unordered_map&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+ };
+
+ /**
+ * @brief A standard container composed of equivalent keys
+ * (possibly containing multiple of each key value) that associates
+ * values of another type with the keys.
+ *
+ * @ingroup unordered_associative_containers
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, and
+ * <a href="tables.html#xx">unordered associative container</a>
+ *
+ * @param Key Type of key objects.
+ * @param Tp Type of mapped objects.
+ * @param Hash Hashing function object type, defaults to hash<Value>.
+ * @param Pred Predicate function object type, defaults to equal_to<Value>.
+ * @param Alloc Allocator type, defaults to allocator<Key>.
+ *
+ * The resulting value type of the container is std::pair<const Key, Tp>.
+ */
+ template<class _Key, class _Tp,
+ class _Hash = hash<_Key>,
+ class _Pred = std::equal_to<_Key>,
+ class _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
+ class unordered_multimap
+ : public __unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>
+ {
+ typedef __unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc> _Base;
+
+ public:
+ typedef typename _Base::value_type value_type;
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ explicit
+ unordered_multimap(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __eql, __a)
+ { }
+
+
+ template<typename _InputIterator>
+ unordered_multimap(_InputIterator __f, _InputIterator __l,
+ typename _Base::size_type __n = 0,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__f, __l, __n, __hf, __eql, __a)
+ { }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ unordered_multimap(unordered_multimap&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+
+ unordered_multimap(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a)
+ { }
+
+ unordered_multimap&
+ operator=(unordered_multimap&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ unordered_multimap&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+ };
+
+ template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
+ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
+ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&& __x,
+ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
+ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&& __y)
+ { __x.swap(__y); }
+
+ template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&& __x,
+ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
+ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/unordered_set b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/unordered_set
new file mode 100644
index 0000000..fc2ce2b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/unordered_set
@@ -0,0 +1,360 @@
+// TR1 unordered_set -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/unordered_set
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ // XXX When we get typedef templates these class definitions
+ // will be unnecessary.
+ template<class _Value,
+ class _Hash = hash<_Value>,
+ class _Pred = std::equal_to<_Value>,
+ class _Alloc = std::allocator<_Value>,
+ bool __cache_hash_code = false>
+ class __unordered_set
+ : public _Hashtable<_Value, _Value, _Alloc,
+ std::_Identity<_Value>, _Pred,
+ _Hash, __detail::_Mod_range_hashing,
+ __detail::_Default_ranged_hash,
+ __detail::_Prime_rehash_policy,
+ __cache_hash_code, true, true>
+ {
+ typedef _Hashtable<_Value, _Value, _Alloc,
+ std::_Identity<_Value>, _Pred,
+ _Hash, __detail::_Mod_range_hashing,
+ __detail::_Default_ranged_hash,
+ __detail::_Prime_rehash_policy,
+ __cache_hash_code, true, true>
+ _Base;
+
+ public:
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ explicit
+ __unordered_set(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __detail::_Mod_range_hashing(),
+ __detail::_Default_ranged_hash(), __eql,
+ std::_Identity<_Value>(), __a)
+ { }
+
+ template<typename _InputIterator>
+ __unordered_set(_InputIterator __f, _InputIterator __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__f, __l, __n, __hf, __detail::_Mod_range_hashing(),
+ __detail::_Default_ranged_hash(), __eql,
+ std::_Identity<_Value>(), __a)
+ { }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ __unordered_set(__unordered_set&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+#endif
+ };
+
+ template<class _Value,
+ class _Hash = hash<_Value>,
+ class _Pred = std::equal_to<_Value>,
+ class _Alloc = std::allocator<_Value>,
+ bool __cache_hash_code = false>
+ class __unordered_multiset
+ : public _Hashtable<_Value, _Value, _Alloc,
+ std::_Identity<_Value>, _Pred,
+ _Hash, __detail::_Mod_range_hashing,
+ __detail::_Default_ranged_hash,
+ __detail::_Prime_rehash_policy,
+ __cache_hash_code, true, false>
+ {
+ typedef _Hashtable<_Value, _Value, _Alloc,
+ std::_Identity<_Value>, _Pred,
+ _Hash, __detail::_Mod_range_hashing,
+ __detail::_Default_ranged_hash,
+ __detail::_Prime_rehash_policy,
+ __cache_hash_code, true, false>
+ _Base;
+
+ public:
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ explicit
+ __unordered_multiset(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __detail::_Mod_range_hashing(),
+ __detail::_Default_ranged_hash(), __eql,
+ std::_Identity<_Value>(), __a)
+ { }
+
+
+ template<typename _InputIterator>
+ __unordered_multiset(_InputIterator __f, _InputIterator __l,
+ typename _Base::size_type __n = 0,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__f, __l, __n, __hf, __detail::_Mod_range_hashing(),
+ __detail::_Default_ranged_hash(), __eql,
+ std::_Identity<_Value>(), __a)
+ { }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ __unordered_multiset(__unordered_multiset&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+#endif
+ };
+
+ template<class _Value, class _Hash, class _Pred, class _Alloc,
+ bool __cache_hash_code>
+ inline void
+ swap(__unordered_set<_Value, _Hash, _Pred, _Alloc, __cache_hash_code>& __x,
+ __unordered_set<_Value, _Hash, _Pred, _Alloc, __cache_hash_code>& __y)
+ { __x.swap(__y); }
+
+ template<class _Value, class _Hash, class _Pred, class _Alloc,
+ bool __cache_hash_code>
+ inline void
+ swap(__unordered_multiset<_Value, _Hash, _Pred,
+ _Alloc, __cache_hash_code>& __x,
+ __unordered_multiset<_Value, _Hash, _Pred,
+ _Alloc, __cache_hash_code>& __y)
+ { __x.swap(__y); }
+
+
+ /**
+ * @brief A standard container composed of unique keys (containing
+ * at most one of each key value) in which the elements' keys are
+ * the elements themselves.
+ *
+ * @ingroup unordered_associative_containers
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, and
+ * <a href="tables.html#xx">unordered associative container</a>
+ *
+ * @param Value Type of key objects.
+ * @param Hash Hashing function object type, defaults to hash<Value>.
+ * @param Pred Predicate function object type, defaults to equal_to<Value>.
+ * @param Alloc Allocator type, defaults to allocator<Key>.
+ */
+ template<class _Value,
+ class _Hash = hash<_Value>,
+ class _Pred = std::equal_to<_Value>,
+ class _Alloc = std::allocator<_Value> >
+ class unordered_set
+ : public __unordered_set<_Value, _Hash, _Pred, _Alloc>
+ {
+ typedef __unordered_set<_Value, _Hash, _Pred, _Alloc> _Base;
+
+ public:
+ typedef typename _Base::value_type value_type;
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ explicit
+ unordered_set(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __eql, __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_set(_InputIterator __f, _InputIterator __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__f, __l, __n, __hf, __eql, __a)
+ { }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ unordered_set(unordered_set&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+
+ unordered_set(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a)
+ { }
+
+ unordered_set&
+ operator=(unordered_set&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ unordered_set&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+ };
+
+ /**
+ * @brief A standard container composed of equivalent keys
+ * (possibly containing multiple of each key value) in which the
+ * elements' keys are the elements themselves.
+ *
+ * @ingroup unordered_associative_containers
+ *
+ * Meets the requirements of a <a href="tables.html#65">container</a>, and
+ * <a href="tables.html#xx">unordered associative container</a>
+ *
+ * @param Value Type of key objects.
+ * @param Hash Hashing function object type, defaults to hash<Value>.
+ * @param Pred Predicate function object type, defaults to equal_to<Value>.
+ * @param Alloc Allocator type, defaults to allocator<Key>.
+ */
+ template<class _Value,
+ class _Hash = hash<_Value>,
+ class _Pred = std::equal_to<_Value>,
+ class _Alloc = std::allocator<_Value> >
+ class unordered_multiset
+ : public __unordered_multiset<_Value, _Hash, _Pred, _Alloc>
+ {
+ typedef __unordered_multiset<_Value, _Hash, _Pred, _Alloc> _Base;
+
+ public:
+ typedef typename _Base::value_type value_type;
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::allocator_type allocator_type;
+
+ explicit
+ unordered_multiset(size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __eql, __a)
+ { }
+
+
+ template<typename _InputIterator>
+ unordered_multiset(_InputIterator __f, _InputIterator __l,
+ typename _Base::size_type __n = 0,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__f, __l, __n, __hf, __eql, __a)
+ { }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ unordered_multiset(unordered_multiset&& __x)
+ : _Base(std::forward<_Base>(__x)) { }
+
+ unordered_multiset(initializer_list<value_type> __l,
+ size_type __n = 10,
+ const hasher& __hf = hasher(),
+ const key_equal& __eql = key_equal(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a)
+ { }
+
+ unordered_multiset&
+ operator=(unordered_multiset&& __x)
+ {
+ // NB: DR 675.
+ this->clear();
+ this->swap(__x);
+ return *this;
+ }
+
+ unordered_multiset&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
+#endif
+ };
+
+ template<class _Value, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
+ unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<class _Value, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
+ unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<class _Value, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_set<_Value, _Hash, _Pred, _Alloc>&& __x,
+ unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<class _Value, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
+ unordered_set<_Value, _Hash, _Pred, _Alloc>&& __y)
+ { __x.swap(__y); }
+
+ template<class _Value, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>&& __x,
+ unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
+ { __x.swap(__y); }
+
+ template<class _Value, class _Hash, class _Pred, class _Alloc>
+ inline void
+ swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
+ unordered_multiset<_Value, _Hash, _Pred, _Alloc>&& __y)
+ { __x.swap(__y); }
+#endif
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/utility b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/utility
new file mode 100644
index 0000000..a31c4da
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tr1_impl/utility
@@ -0,0 +1,120 @@
+// TR1 utility -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file tr1_impl/utility
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE_TR1
+
+ template<class _Tp>
+ class tuple_size;
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<std::size_t _Int, class _Tp>
+#else
+ template<int _Int, class _Tp>
+#endif
+ class tuple_element;
+
+ // Various functions which give std::pair a tuple-like interface.
+ template<class _Tp1, class _Tp2>
+ struct tuple_size<std::pair<_Tp1, _Tp2> >
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ { static const std::size_t value = 2; };
+#else
+ { static const int value = 2; };
+#endif
+
+ template<class _Tp1, class _Tp2>
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ const std::size_t
+#else
+ const int
+#endif
+ tuple_size<std::pair<_Tp1, _Tp2> >::value;
+
+ template<class _Tp1, class _Tp2>
+ struct tuple_element<0, std::pair<_Tp1, _Tp2> >
+ { typedef _Tp1 type; };
+
+ template<class _Tp1, class _Tp2>
+ struct tuple_element<1, std::pair<_Tp1, _Tp2> >
+ { typedef _Tp2 type; };
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<std::size_t _Int>
+#else
+ template<int _Int>
+#endif
+ struct __pair_get;
+
+ template<>
+ struct __pair_get<0>
+ {
+ template<typename _Tp1, typename _Tp2>
+ static _Tp1& __get(std::pair<_Tp1, _Tp2>& __pair)
+ { return __pair.first; }
+
+ template<typename _Tp1, typename _Tp2>
+ static const _Tp1& __const_get(const std::pair<_Tp1, _Tp2>& __pair)
+ { return __pair.first; }
+ };
+
+ template<>
+ struct __pair_get<1>
+ {
+ template<typename _Tp1, typename _Tp2>
+ static _Tp2& __get(std::pair<_Tp1, _Tp2>& __pair)
+ { return __pair.second; }
+
+ template<typename _Tp1, typename _Tp2>
+ static const _Tp2& __const_get(const std::pair<_Tp1, _Tp2>& __pair)
+ { return __pair.second; }
+ };
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<std::size_t _Int, class _Tp1, class _Tp2>
+#else
+ template<int _Int, class _Tp1, class _Tp2>
+#endif
+ inline typename tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&
+ get(std::pair<_Tp1, _Tp2>& __in)
+ { return __pair_get<_Int>::__get(__in); }
+
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ template<std::size_t _Int, class _Tp1, class _Tp2>
+#else
+ template<int _Int, class _Tp1, class _Tp2>
+#endif
+ inline const typename tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&
+ get(const std::pair<_Tp1, _Tp2>& __in)
+ { return __pair_get<_Int>::__const_get(__in); }
+
+_GLIBCXX_END_NAMESPACE_TR1
+}
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tuple b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tuple
new file mode 100644
index 0000000..c5dbe6b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/tuple
@@ -0,0 +1,697 @@
+// <tuple> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/tuple
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TUPLE
+#define _GLIBCXX_TUPLE 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#include <utility>
+
+namespace std
+{
+ // Adds a const reference to a non-reference type.
+ template<typename _Tp>
+ struct __add_c_ref
+ { typedef const _Tp& type; };
+
+ template<typename _Tp>
+ struct __add_c_ref<_Tp&>
+ { typedef _Tp& type; };
+
+ // Adds a reference to a non-reference type.
+ template<typename _Tp>
+ struct __add_ref
+ { typedef _Tp& type; };
+
+ template<typename _Tp>
+ struct __add_ref<_Tp&>
+ { typedef _Tp& type; };
+
+ template<std::size_t _Idx, typename _Head, bool _IsEmpty>
+ struct _Head_base;
+
+ template<std::size_t _Idx, typename _Head>
+ struct _Head_base<_Idx, _Head, true>
+ : public _Head
+ {
+ _Head_base()
+ : _Head() { }
+
+ _Head_base(const _Head& __h)
+ : _Head(__h) { }
+
+ template<typename _UHead>
+ _Head_base(_UHead&& __h)
+ : _Head(std::forward<_UHead>(__h)) { }
+
+ _Head& _M_head() { return *this; }
+ const _Head& _M_head() const { return *this; }
+
+ void _M_swap_impl(_Head&&) { /* no-op */ }
+ };
+
+ template<std::size_t _Idx, typename _Head>
+ struct _Head_base<_Idx, _Head, false>
+ {
+ _Head_base()
+ : _M_head_impl() { }
+
+ _Head_base(const _Head& __h)
+ : _M_head_impl(__h) { }
+
+ template<typename _UHead>
+ _Head_base(_UHead&& __h)
+ : _M_head_impl(std::forward<_UHead>(__h)) { }
+
+ _Head& _M_head() { return _M_head_impl; }
+ const _Head& _M_head() const { return _M_head_impl; }
+
+ void
+ _M_swap_impl(_Head&& __h)
+ {
+ using std::swap;
+ swap(__h, _M_head_impl);
+ }
+
+ _Head _M_head_impl;
+ };
+
+ /**
+ * Contains the actual implementation of the @c tuple template, stored
+ * as a recursive inheritance hierarchy from the first element (most
+ * derived class) to the last (least derived class). The @c Idx
+ * parameter gives the 0-based index of the element stored at this
+ * point in the hierarchy; we use it to implement a constant-time
+ * get() operation.
+ */
+ template<std::size_t _Idx, typename... _Elements>
+ struct _Tuple_impl;
+
+ /**
+ * Zero-element tuple implementation. This is the basis case for the
+ * inheritance recursion.
+ */
+ template<std::size_t _Idx>
+ struct _Tuple_impl<_Idx>
+ {
+ protected:
+ void _M_swap_impl(_Tuple_impl&&) { /* no-op */ }
+ };
+
+ /**
+ * Recursive tuple implementation. Here we store the @c Head element
+ * and derive from a @c Tuple_impl containing the remaining elements
+ * (which contains the @c Tail).
+ */
+ template<std::size_t _Idx, typename _Head, typename... _Tail>
+ struct _Tuple_impl<_Idx, _Head, _Tail...>
+ : public _Tuple_impl<_Idx + 1, _Tail...>,
+ private _Head_base<_Idx, _Head, std::is_empty<_Head>::value>
+ {
+ typedef _Tuple_impl<_Idx + 1, _Tail...> _Inherited;
+ typedef _Head_base<_Idx, _Head, std::is_empty<_Head>::value> _Base;
+
+ _Head& _M_head() { return _Base::_M_head(); }
+ const _Head& _M_head() const { return _Base::_M_head(); }
+
+ _Inherited& _M_tail() { return *this; }
+ const _Inherited& _M_tail() const { return *this; }
+
+ _Tuple_impl()
+ : _Inherited(), _Base() { }
+
+ explicit
+ _Tuple_impl(const _Head& __head, const _Tail&... __tail)
+ : _Inherited(__tail...), _Base(__head) { }
+
+ template<typename _UHead, typename... _UTail>
+ explicit
+ _Tuple_impl(_UHead&& __head, _UTail&&... __tail)
+ : _Inherited(std::forward<_UTail>(__tail)...),
+ _Base(std::forward<_UHead>(__head)) { }
+
+ _Tuple_impl(const _Tuple_impl& __in)
+ : _Inherited(__in._M_tail()), _Base(__in._M_head()) { }
+
+ _Tuple_impl(_Tuple_impl&& __in)
+ : _Inherited(std::move<_Inherited&&>(__in._M_tail())),
+ _Base(std::forward<_Head>(__in._M_head())) { }
+
+ template<typename... _UElements>
+ _Tuple_impl(const _Tuple_impl<_Idx, _UElements...>& __in)
+ : _Inherited(__in._M_tail()), _Base(__in._M_head()) { }
+
+ template<typename... _UElements>
+ _Tuple_impl(_Tuple_impl<_Idx, _UElements...>&& __in)
+ : _Inherited(std::move<typename _Tuple_impl<_Idx, _UElements...>::
+ _Inherited&&>(__in._M_tail())),
+ _Base(std::forward<typename _Tuple_impl<_Idx, _UElements...>::
+ _Base>(__in._M_head())) { }
+
+ _Tuple_impl&
+ operator=(const _Tuple_impl& __in)
+ {
+ _M_head() = __in._M_head();
+ _M_tail() = __in._M_tail();
+ return *this;
+ }
+
+ _Tuple_impl&
+ operator=(_Tuple_impl&& __in)
+ {
+ _M_head() = std::move(__in._M_head());
+ _M_tail() = std::move(__in._M_tail());
+ return *this;
+ }
+
+ template<typename... _UElements>
+ _Tuple_impl&
+ operator=(const _Tuple_impl<_Idx, _UElements...>& __in)
+ {
+ _M_head() = __in._M_head();
+ _M_tail() = __in._M_tail();
+ return *this;
+ }
+
+ template<typename... _UElements>
+ _Tuple_impl&
+ operator=(_Tuple_impl<_Idx, _UElements...>&& __in)
+ {
+ _M_head() = std::move(__in._M_head());
+ _M_tail() = std::move(__in._M_tail());
+ return *this;
+ }
+
+ protected:
+ void
+ _M_swap_impl(_Tuple_impl&& __in)
+ {
+ _Base::_M_swap_impl(__in._M_head());
+ _Inherited::_M_swap_impl(__in._M_tail());
+ }
+ };
+
+ /// tuple
+ template<typename... _Elements>
+ class tuple : public _Tuple_impl<0, _Elements...>
+ {
+ typedef _Tuple_impl<0, _Elements...> _Inherited;
+
+ public:
+ tuple()
+ : _Inherited() { }
+
+ explicit
+ tuple(const _Elements&... __elements)
+ : _Inherited(__elements...) { }
+
+ template<typename... _UElements>
+ explicit
+ tuple(_UElements&&... __elements)
+ : _Inherited(std::forward<_UElements>(__elements)...) { }
+
+ tuple(const tuple& __in)
+ : _Inherited(static_cast<const _Inherited&>(__in)) { }
+
+ tuple(tuple&& __in)
+ : _Inherited(std::move<_Inherited>(__in)) { }
+
+ template<typename... _UElements>
+ tuple(const tuple<_UElements...>& __in)
+ : _Inherited(static_cast<const _Tuple_impl<0, _UElements...>&>(__in))
+ { }
+
+ template<typename... _UElements>
+ tuple(tuple<_UElements...>&& __in)
+ : _Inherited(std::move<_Tuple_impl<0, _UElements...> >(__in)) { }
+
+ // XXX http://gcc.gnu.org/ml/libstdc++/2008-02/msg00047.html
+ template<typename... _UElements>
+ tuple(tuple<_UElements...>& __in)
+ : _Inherited(static_cast<const _Tuple_impl<0, _UElements...>&>(__in))
+ { }
+
+ tuple&
+ operator=(const tuple& __in)
+ {
+ static_cast<_Inherited&>(*this) = __in;
+ return *this;
+ }
+
+ tuple&
+ operator=(tuple&& __in)
+ {
+ static_cast<_Inherited&>(*this) = std::move(__in);
+ return *this;
+ }
+
+ template<typename... _UElements>
+ tuple&
+ operator=(const tuple<_UElements...>& __in)
+ {
+ static_cast<_Inherited&>(*this) = __in;
+ return *this;
+ }
+
+ template<typename... _UElements>
+ tuple&
+ operator=(tuple<_UElements...>&& __in)
+ {
+ static_cast<_Inherited&>(*this) = std::move(__in);
+ return *this;
+ }
+
+ void
+ swap(tuple&& __in)
+ { _Inherited::_M_swap_impl(__in); }
+ };
+
+
+ template<>
+ class tuple<>
+ {
+ public:
+ void swap(tuple&&) { /* no-op */ }
+ };
+
+ /// tuple (2-element), with construction and assignment from a pair.
+ template<typename _T1, typename _T2>
+ class tuple<_T1, _T2> : public _Tuple_impl<0, _T1, _T2>
+ {
+ typedef _Tuple_impl<0, _T1, _T2> _Inherited;
+
+ public:
+ tuple()
+ : _Inherited() { }
+
+ explicit
+ tuple(const _T1& __a1, const _T2& __a2)
+ : _Inherited(__a1, __a2) { }
+
+ template<typename _U1, typename _U2>
+ explicit
+ tuple(_U1&& __a1, _U2&& __a2)
+ : _Inherited(std::forward<_U1>(__a1), std::forward<_U2>(__a2)) { }
+
+ tuple(const tuple& __in)
+ : _Inherited(static_cast<const _Inherited&>(__in)) { }
+
+ tuple(tuple&& __in)
+ : _Inherited(std::move<_Inherited>(__in)) { }
+
+ template<typename _U1, typename _U2>
+ tuple(const tuple<_U1, _U2>& __in)
+ : _Inherited(static_cast<const _Tuple_impl<0, _U1, _U2>&>(__in)) { }
+
+ template<typename _U1, typename _U2>
+ tuple(tuple<_U1, _U2>&& __in)
+ : _Inherited(std::move<_Tuple_impl<0, _U1, _U2> >(__in)) { }
+
+ template<typename _U1, typename _U2>
+ tuple(const pair<_U1, _U2>& __in)
+ : _Inherited(__in.first, __in.second) { }
+
+ template<typename _U1, typename _U2>
+ tuple(pair<_U1, _U2>&& __in)
+ : _Inherited(std::move(__in.first), std::move(__in.second)) { }
+
+ tuple&
+ operator=(const tuple& __in)
+ {
+ static_cast<_Inherited&>(*this) = __in;
+ return *this;
+ }
+
+ tuple&
+ operator=(tuple&& __in)
+ {
+ static_cast<_Inherited&>(*this) = std::move(__in);
+ return *this;
+ }
+
+ template<typename _U1, typename _U2>
+ tuple&
+ operator=(const tuple<_U1, _U2>& __in)
+ {
+ static_cast<_Inherited&>(*this) = __in;
+ return *this;
+ }
+
+ template<typename _U1, typename _U2>
+ tuple&
+ operator=(tuple<_U1, _U2>&& __in)
+ {
+ static_cast<_Inherited&>(*this) = std::move(__in);
+ return *this;
+ }
+
+ template<typename _U1, typename _U2>
+ tuple&
+ operator=(const pair<_U1, _U2>& __in)
+ {
+ this->_M_head() = __in.first;
+ this->_M_tail()._M_head() = __in.second;
+ return *this;
+ }
+
+ template<typename _U1, typename _U2>
+ tuple&
+ operator=(pair<_U1, _U2>&& __in)
+ {
+ this->_M_head() = std::move(__in.first);
+ this->_M_tail()._M_head() = std::move(__in.second);
+ return *this;
+ }
+
+ void
+ swap(tuple&& __in)
+ {
+ using std::swap;
+ swap(this->_M_head(), __in._M_head());
+ swap(this->_M_tail()._M_head(), __in._M_tail()._M_head());
+ }
+ };
+
+
+ /// Gives the type of the ith element of a given tuple type.
+ template<std::size_t __i, typename _Tp>
+ struct tuple_element;
+
+ /**
+ * Recursive case for tuple_element: strip off the first element in
+ * the tuple and retrieve the (i-1)th element of the remaining tuple.
+ */
+ template<std::size_t __i, typename _Head, typename... _Tail>
+ struct tuple_element<__i, tuple<_Head, _Tail...> >
+ : tuple_element<__i - 1, tuple<_Tail...> > { };
+
+ /**
+ * Basis case for tuple_element: The first element is the one we're seeking.
+ */
+ template<typename _Head, typename... _Tail>
+ struct tuple_element<0, tuple<_Head, _Tail...> >
+ {
+ typedef _Head type;
+ };
+
+ /// Finds the size of a given tuple type.
+ template<typename _Tp>
+ struct tuple_size;
+
+ /// class tuple_size
+ template<typename... _Elements>
+ struct tuple_size<tuple<_Elements...> >
+ {
+ static const std::size_t value = sizeof...(_Elements);
+ };
+
+ template<typename... _Elements>
+ const std::size_t tuple_size<tuple<_Elements...> >::value;
+
+ template<std::size_t __i, typename _Head, typename... _Tail>
+ inline typename __add_ref<_Head>::type
+ __get_helper(_Tuple_impl<__i, _Head, _Tail...>& __t)
+ { return __t._M_head(); }
+
+ template<std::size_t __i, typename _Head, typename... _Tail>
+ inline typename __add_c_ref<_Head>::type
+ __get_helper(const _Tuple_impl<__i, _Head, _Tail...>& __t)
+ { return __t._M_head(); }
+
+ // Return a reference (const reference) to the ith element of a tuple.
+ // Any const or non-const ref elements are returned with their original type.
+ template<std::size_t __i, typename... _Elements>
+ inline typename __add_ref<
+ typename tuple_element<__i, tuple<_Elements...> >::type
+ >::type
+ get(tuple<_Elements...>& __t)
+ { return __get_helper<__i>(__t); }
+
+ template<std::size_t __i, typename... _Elements>
+ inline typename __add_c_ref<
+ typename tuple_element<__i, tuple<_Elements...> >::type
+ >::type
+ get(const tuple<_Elements...>& __t)
+ { return __get_helper<__i>(__t); }
+
+ // This class helps construct the various comparison operations on tuples
+ template<std::size_t __check_equal_size, std::size_t __i, std::size_t __j,
+ typename _Tp, typename _Up>
+ struct __tuple_compare;
+
+ template<std::size_t __i, std::size_t __j, typename _Tp, typename _Up>
+ struct __tuple_compare<0, __i, __j, _Tp, _Up>
+ {
+ static bool __eq(const _Tp& __t, const _Up& __u)
+ {
+ return (get<__i>(__t) == get<__i>(__u) &&
+ __tuple_compare<0, __i + 1, __j, _Tp, _Up>::__eq(__t, __u));
+ }
+
+ static bool __less(const _Tp& __t, const _Up& __u)
+ {
+ return ((get<__i>(__t) < get<__i>(__u))
+ || !(get<__i>(__u) < get<__i>(__t)) &&
+ __tuple_compare<0, __i + 1, __j, _Tp, _Up>::__less(__t, __u));
+ }
+ };
+
+ template<std::size_t __i, typename _Tp, typename _Up>
+ struct __tuple_compare<0, __i, __i, _Tp, _Up>
+ {
+ static bool __eq(const _Tp&, const _Up&)
+ { return true; }
+
+ static bool __less(const _Tp&, const _Up&)
+ { return false; }
+ };
+
+ template<typename... _TElements, typename... _UElements>
+ bool
+ operator==(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ {
+ typedef tuple<_TElements...> _Tp;
+ typedef tuple<_UElements...> _Up;
+ return (__tuple_compare<tuple_size<_Tp>::value - tuple_size<_Up>::value,
+ 0, tuple_size<_Tp>::value, _Tp, _Up>::__eq(__t, __u));
+ }
+
+ template<typename... _TElements, typename... _UElements>
+ bool
+ operator<(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ {
+ typedef tuple<_TElements...> _Tp;
+ typedef tuple<_UElements...> _Up;
+ return (__tuple_compare<tuple_size<_Tp>::value - tuple_size<_Up>::value,
+ 0, tuple_size<_Tp>::value, _Tp, _Up>::__less(__t, __u));
+ }
+
+ template<typename... _TElements, typename... _UElements>
+ inline bool
+ operator!=(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ { return !(__t == __u); }
+
+ template<typename... _TElements, typename... _UElements>
+ inline bool
+ operator>(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ { return __u < __t; }
+
+ template<typename... _TElements, typename... _UElements>
+ inline bool
+ operator<=(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ { return !(__u < __t); }
+
+ template<typename... _TElements, typename... _UElements>
+ inline bool
+ operator>=(const tuple<_TElements...>& __t,
+ const tuple<_UElements...>& __u)
+ { return !(__t < __u); }
+
+ // NB: DR 705.
+ template<typename... _Elements>
+ inline tuple<typename __decay_and_strip<_Elements>::__type...>
+ make_tuple(_Elements&&... __args)
+ {
+ typedef tuple<typename __decay_and_strip<_Elements>::__type...>
+ __result_type;
+ return __result_type(std::forward<_Elements>(__args)...);
+ }
+
+ template<std::size_t...> struct __index_holder { };
+
+ template<std::size_t __i, typename _IdxHolder, typename... _Elements>
+ struct __index_holder_impl;
+
+ template<std::size_t __i, std::size_t... _Indexes, typename _IdxHolder,
+ typename... _Elements>
+ struct __index_holder_impl<__i, __index_holder<_Indexes...>,
+ _IdxHolder, _Elements...>
+ {
+ typedef typename __index_holder_impl<__i + 1,
+ __index_holder<_Indexes..., __i>,
+ _Elements...>::type type;
+ };
+
+ template<std::size_t __i, std::size_t... _Indexes>
+ struct __index_holder_impl<__i, __index_holder<_Indexes...> >
+ { typedef __index_holder<_Indexes...> type; };
+
+ template<typename... _Elements>
+ struct __make_index_holder
+ : __index_holder_impl<0, __index_holder<>, _Elements...> { };
+
+ template<typename... _TElements, std::size_t... _TIdx,
+ typename... _UElements, std::size_t... _UIdx>
+ inline tuple<_TElements..., _UElements...>
+ __tuple_cat_helper(const tuple<_TElements...>& __t,
+ const __index_holder<_TIdx...>&,
+ const tuple<_UElements...>& __u,
+ const __index_holder<_UIdx...>&)
+ { return tuple<_TElements..., _UElements...>(get<_TIdx>(__t)...,
+ get<_UIdx>(__u)...); }
+
+ template<typename... _TElements, std::size_t... _TIdx,
+ typename... _UElements, std::size_t... _UIdx>
+ inline tuple<_TElements..., _UElements...>
+ __tuple_cat_helper(tuple<_TElements...>&& __t,
+ const __index_holder<_TIdx...>&,
+ const tuple<_UElements...>& __u,
+ const __index_holder<_UIdx...>&)
+ { return tuple<_TElements..., _UElements...>
+ (std::move(get<_TIdx>(__t))..., get<_UIdx>(__u)...); }
+
+ template<typename... _TElements, std::size_t... _TIdx,
+ typename... _UElements, std::size_t... _UIdx>
+ inline tuple<_TElements..., _UElements...>
+ __tuple_cat_helper(const tuple<_TElements...>& __t,
+ const __index_holder<_TIdx...>&,
+ tuple<_UElements...>&& __u,
+ const __index_holder<_UIdx...>&)
+ { return tuple<_TElements..., _UElements...>
+ (get<_TIdx>(__t)..., std::move(get<_UIdx>(__u))...); }
+
+ template<typename... _TElements, std::size_t... _TIdx,
+ typename... _UElements, std::size_t... _UIdx>
+ inline tuple<_TElements..., _UElements...>
+ __tuple_cat_helper(tuple<_TElements...>&& __t,
+ const __index_holder<_TIdx...>&,
+ tuple<_UElements...>&& __u,
+ const __index_holder<_UIdx...>&)
+ { return tuple<_TElements..., _UElements...>
+ (std::move(get<_TIdx>(__t))..., std::move(get<_UIdx>(__u))...); }
+
+ template<typename... _TElements, typename... _UElements>
+ inline tuple<_TElements..., _UElements...>
+ tuple_cat(const tuple<_TElements...>& __t, const tuple<_UElements...>& __u)
+ {
+ return __tuple_cat_helper(__t, typename
+ __make_index_holder<_TElements...>::type(),
+ __u, typename
+ __make_index_holder<_UElements...>::type());
+ }
+
+ template<typename... _TElements, typename... _UElements>
+ inline tuple<_TElements..., _UElements...>
+ tuple_cat(tuple<_TElements...>&& __t, const tuple<_UElements...>& __u)
+ {
+ return __tuple_cat_helper(std::move(__t), typename
+ __make_index_holder<_TElements...>::type(),
+ __u, typename
+ __make_index_holder<_UElements...>::type());
+ }
+
+ template<typename... _TElements, typename... _UElements>
+ inline tuple<_TElements..., _UElements...>
+ tuple_cat(const tuple<_TElements...>& __t, tuple<_UElements...>&& __u)
+ {
+ return __tuple_cat_helper(__t, typename
+ __make_index_holder<_TElements...>::type(),
+ std::move(__u), typename
+ __make_index_holder<_UElements...>::type());
+ }
+
+ template<typename... _TElements, typename... _UElements>
+ inline tuple<_TElements..., _UElements...>
+ tuple_cat(tuple<_TElements...>&& __t, tuple<_UElements...>&& __u)
+ {
+ return __tuple_cat_helper(std::move(__t), typename
+ __make_index_holder<_TElements...>::type(),
+ std::move(__u), typename
+ __make_index_holder<_UElements...>::type());
+ }
+
+ template<typename... _Elements>
+ inline tuple<_Elements&...>
+ tie(_Elements&... __args)
+ { return tuple<_Elements&...>(__args...); }
+
+ template<typename... _Elements>
+ inline void
+ swap(tuple<_Elements...>& __x, tuple<_Elements...>& __y)
+ { __x.swap(__y); }
+
+ template<typename... _Elements>
+ inline void
+ swap(tuple<_Elements...>&& __x, tuple<_Elements...>& __y)
+ { __x.swap(__y); }
+
+ template<typename... _Elements>
+ inline void
+ swap(tuple<_Elements...>& __x, tuple<_Elements...>&& __y)
+ { __x.swap(__y); }
+
+ // A class (and instance) which can be used in 'tie' when an element
+ // of a tuple is not required
+ struct _Swallow_assign
+ {
+ template<class _Tp>
+ _Swallow_assign&
+ operator=(const _Tp&)
+ { return *this; }
+ };
+
+ // TODO: Put this in some kind of shared file.
+ namespace
+ {
+ _Swallow_assign ignore;
+ }; // anonymous namespace
+}
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_TUPLE
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/type_traits b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/type_traits
new file mode 100644
index 0000000..ce9ee1b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/type_traits
@@ -0,0 +1,605 @@
+// C++0x type_traits -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/type_traits
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_TYPE_TRAITS
+#define _GLIBCXX_TYPE_TRAITS 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <cstddef>
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/type_traits>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/type_traits>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+namespace std
+{
+ /** @addtogroup metaprogramming
+ * @{
+ */
+
+ // Primary classification traits.
+
+ /// is_lvalue_reference
+ template<typename>
+ struct is_lvalue_reference
+ : public false_type { };
+
+ template<typename _Tp>
+ struct is_lvalue_reference<_Tp&>
+ : public true_type { };
+
+ /// is_rvalue_reference
+ template<typename>
+ struct is_rvalue_reference
+ : public false_type { };
+
+ template<typename _Tp>
+ struct is_rvalue_reference<_Tp&&>
+ : public true_type { };
+
+ // Secondary classification traits.
+
+ /// is_reference
+ template<typename _Tp>
+ struct is_reference
+ : public integral_constant<bool, (is_lvalue_reference<_Tp>::value
+ || is_rvalue_reference<_Tp>::value)>
+ { };
+
+ // Reference transformations.
+
+ /// remove_reference
+ template<typename _Tp>
+ struct remove_reference
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct remove_reference<_Tp&>
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct remove_reference<_Tp&&>
+ { typedef _Tp type; };
+
+ template<typename _Tp,
+ bool = !is_reference<_Tp>::value && !is_void<_Tp>::value,
+ bool = is_rvalue_reference<_Tp>::value>
+ struct __add_lvalue_reference_helper
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct __add_lvalue_reference_helper<_Tp, true, false>
+ { typedef _Tp& type; };
+
+ template<typename _Tp>
+ struct __add_lvalue_reference_helper<_Tp, false, true>
+ { typedef typename remove_reference<_Tp>::type& type; };
+
+ /// add_lvalue_reference
+ template<typename _Tp>
+ struct add_lvalue_reference
+ : public __add_lvalue_reference_helper<_Tp>
+ { };
+
+ template<typename _Tp,
+ bool = !is_reference<_Tp>::value && !is_void<_Tp>::value>
+ struct __add_rvalue_reference_helper
+ { typedef _Tp type; };
+
+ template<typename _Tp>
+ struct __add_rvalue_reference_helper<_Tp, true>
+ { typedef _Tp&& type; };
+
+ /// add_rvalue_reference
+ template<typename _Tp>
+ struct add_rvalue_reference
+ : public __add_rvalue_reference_helper<_Tp>
+ { };
+
+ // Scalar properties and transformations.
+
+ template<typename _Tp,
+ bool = is_integral<_Tp>::value,
+ bool = is_floating_point<_Tp>::value>
+ struct __is_signed_helper
+ : public false_type { };
+
+ template<typename _Tp>
+ struct __is_signed_helper<_Tp, false, true>
+ : public true_type { };
+
+ template<typename _Tp>
+ struct __is_signed_helper<_Tp, true, false>
+ : public integral_constant<bool, _Tp(-1) < _Tp(0)>
+ { };
+
+ /// is_signed
+ template<typename _Tp>
+ struct is_signed
+ : public integral_constant<bool, __is_signed_helper<_Tp>::value>
+ { };
+
+ /// is_unsigned
+ template<typename _Tp>
+ struct is_unsigned
+ : public integral_constant<bool, (is_arithmetic<_Tp>::value
+ && !is_signed<_Tp>::value)>
+ { };
+
+ // Member introspection.
+
+ /// is_pod
+ template<typename _Tp>
+ struct is_pod
+ : public integral_constant<bool, __is_pod(_Tp)>
+ { };
+
+ /// has_trivial_default_constructor
+ template<typename _Tp>
+ struct has_trivial_default_constructor
+ : public integral_constant<bool, __has_trivial_constructor(_Tp)>
+ { };
+
+ /// has_trivial_copy_constructor
+ template<typename _Tp>
+ struct has_trivial_copy_constructor
+ : public integral_constant<bool, __has_trivial_copy(_Tp)>
+ { };
+
+ /// has_trivial_assign
+ template<typename _Tp>
+ struct has_trivial_assign
+ : public integral_constant<bool, __has_trivial_assign(_Tp)>
+ { };
+
+ /// has_trivial_destructor
+ template<typename _Tp>
+ struct has_trivial_destructor
+ : public integral_constant<bool, __has_trivial_destructor(_Tp)>
+ { };
+
+ /// has_nothrow_default_constructor
+ template<typename _Tp>
+ struct has_nothrow_default_constructor
+ : public integral_constant<bool, __has_nothrow_constructor(_Tp)>
+ { };
+
+ /// has_nothrow_copy_constructor
+ template<typename _Tp>
+ struct has_nothrow_copy_constructor
+ : public integral_constant<bool, __has_nothrow_copy(_Tp)>
+ { };
+
+ /// has_nothrow_assign
+ template<typename _Tp>
+ struct has_nothrow_assign
+ : public integral_constant<bool, __has_nothrow_assign(_Tp)>
+ { };
+
+ /// is_base_of
+ template<typename _Base, typename _Derived>
+ struct is_base_of
+ : public integral_constant<bool, __is_base_of(_Base, _Derived)>
+ { };
+
+ // Relationships between types.
+ template<typename _From, typename _To>
+ struct __is_convertible_simple
+ : public __sfinae_types
+ {
+ private:
+ static __one __test(_To);
+ static __two __test(...);
+ static _From __makeFrom();
+
+ public:
+ static const bool __value = sizeof(__test(__makeFrom())) == 1;
+ };
+
+ template<typename _Tp>
+ struct __is_int_or_cref
+ {
+ typedef typename remove_reference<_Tp>::type __rr_Tp;
+ static const bool __value = (is_integral<_Tp>::value
+ || (is_integral<__rr_Tp>::value
+ && is_const<__rr_Tp>::value
+ && !is_volatile<__rr_Tp>::value));
+ };
+
+ template<typename _From, typename _To,
+ bool = (is_void<_From>::value || is_void<_To>::value
+ || is_function<_To>::value || is_array<_To>::value
+ // This special case is here only to avoid warnings.
+ || (is_floating_point<typename
+ remove_reference<_From>::type>::value
+ && __is_int_or_cref<_To>::__value))>
+ struct __is_convertible_helper
+ {
+ // "An imaginary lvalue of type From...".
+ static const bool __value = (__is_convertible_simple<typename
+ add_lvalue_reference<_From>::type,
+ _To>::__value);
+ };
+
+ template<typename _From, typename _To>
+ struct __is_convertible_helper<_From, _To, true>
+ { static const bool __value = (is_void<_To>::value
+ || (__is_int_or_cref<_To>::__value
+ && !is_void<_From>::value)); };
+
+ // XXX FIXME
+ // The C++0x specifications are different, see N2255.
+ /// is_convertible
+ template<typename _From, typename _To>
+ struct is_convertible
+ : public integral_constant<bool,
+ __is_convertible_helper<_From, _To>::__value>
+ { };
+
+ template<std::size_t _Len>
+ struct __aligned_storage_msa
+ {
+ union __type
+ {
+ unsigned char __data[_Len];
+ struct __attribute__((__aligned__)) { } __align;
+ };
+ };
+
+ /**
+ * @brief Alignment type.
+ *
+ * The value of _Align is a default-alignment which shall be the
+ * most stringent alignment requirement for any C++ object type
+ * whose size is no greater than _Len (3.9). The member typedef
+ * type shall be a POD type suitable for use as uninitialized
+ * storage for any object whose size is at most _Len and whose
+ * alignment is a divisor of _Align.
+ */
+ template<std::size_t _Len, std::size_t _Align =
+ __alignof__(typename __aligned_storage_msa<_Len>::__type)>
+ struct aligned_storage
+ {
+ union type
+ {
+ unsigned char __data[_Len];
+ struct __attribute__((__aligned__((_Align)))) { } __align;
+ };
+ };
+
+
+ // Define a nested type if some predicate holds.
+ // Primary template.
+ /// enable_if
+ template<bool, typename _Tp = void>
+ struct enable_if
+ { };
+
+ // Partial specialization for true.
+ template<typename _Tp>
+ struct enable_if<true, _Tp>
+ { typedef _Tp type; };
+
+
+ // A conditional expression, but for types. If true, first, if false, second.
+ // Primary template.
+ /// conditional
+ template<bool _Cond, typename _Iftrue, typename _Iffalse>
+ struct conditional
+ { typedef _Iftrue type; };
+
+ // Partial specialization for false.
+ template<typename _Iftrue, typename _Iffalse>
+ struct conditional<false, _Iftrue, _Iffalse>
+ { typedef _Iffalse type; };
+
+
+ // Decay trait for arrays and functions, used for perfect forwarding
+ // in make_pair, make_tuple, etc.
+ template<typename _Up,
+ bool _IsArray = is_array<_Up>::value,
+ bool _IsFunction = is_function<_Up>::value>
+ struct __decay_selector;
+
+ // NB: DR 705.
+ template<typename _Up>
+ struct __decay_selector<_Up, false, false>
+ { typedef typename remove_cv<_Up>::type __type; };
+
+ template<typename _Up>
+ struct __decay_selector<_Up, true, false>
+ { typedef typename remove_extent<_Up>::type* __type; };
+
+ template<typename _Up>
+ struct __decay_selector<_Up, false, true>
+ { typedef typename add_pointer<_Up>::type __type; };
+
+ /// decay
+ template<typename _Tp>
+ struct decay
+ {
+ private:
+ typedef typename remove_reference<_Tp>::type __remove_type;
+
+ public:
+ typedef typename __decay_selector<__remove_type>::__type type;
+ };
+
+
+ // Utility for constructing identically cv-qualified types.
+ template<typename _Unqualified, bool _IsConst, bool _IsVol>
+ struct __cv_selector;
+
+ template<typename _Unqualified>
+ struct __cv_selector<_Unqualified, false, false>
+ { typedef _Unqualified __type; };
+
+ template<typename _Unqualified>
+ struct __cv_selector<_Unqualified, false, true>
+ { typedef volatile _Unqualified __type; };
+
+ template<typename _Unqualified>
+ struct __cv_selector<_Unqualified, true, false>
+ { typedef const _Unqualified __type; };
+
+ template<typename _Unqualified>
+ struct __cv_selector<_Unqualified, true, true>
+ { typedef const volatile _Unqualified __type; };
+
+ template<typename _Qualified, typename _Unqualified,
+ bool _IsConst = is_const<_Qualified>::value,
+ bool _IsVol = is_volatile<_Qualified>::value>
+ struct __match_cv_qualifiers
+ {
+ private:
+ typedef __cv_selector<_Unqualified, _IsConst, _IsVol> __match;
+
+ public:
+ typedef typename __match::__type __type;
+ };
+
+
+ // Utility for finding the unsigned versions of signed integral types.
+ template<typename _Tp>
+ struct __make_unsigned
+ { typedef _Tp __type; };
+
+ template<>
+ struct __make_unsigned<char>
+ { typedef unsigned char __type; };
+
+ template<>
+ struct __make_unsigned<signed char>
+ { typedef unsigned char __type; };
+
+ template<>
+ struct __make_unsigned<short>
+ { typedef unsigned short __type; };
+
+ template<>
+ struct __make_unsigned<int>
+ { typedef unsigned int __type; };
+
+ template<>
+ struct __make_unsigned<long>
+ { typedef unsigned long __type; };
+
+ template<>
+ struct __make_unsigned<long long>
+ { typedef unsigned long long __type; };
+
+
+ // Select between integral and enum: not possible to be both.
+ template<typename _Tp,
+ bool _IsInt = is_integral<_Tp>::value,
+ bool _IsEnum = is_enum<_Tp>::value>
+ struct __make_unsigned_selector;
+
+ template<typename _Tp>
+ struct __make_unsigned_selector<_Tp, true, false>
+ {
+ private:
+ typedef __make_unsigned<typename remove_cv<_Tp>::type> __unsignedt;
+ typedef typename __unsignedt::__type __unsigned_type;
+ typedef __match_cv_qualifiers<_Tp, __unsigned_type> __cv_unsigned;
+
+ public:
+ typedef typename __cv_unsigned::__type __type;
+ };
+
+ template<typename _Tp>
+ struct __make_unsigned_selector<_Tp, false, true>
+ {
+ private:
+ // With -fshort-enums, an enum may be as small as a char.
+ typedef unsigned char __smallest;
+ static const bool __b0 = sizeof(_Tp) <= sizeof(__smallest);
+ static const bool __b1 = sizeof(_Tp) <= sizeof(unsigned short);
+ static const bool __b2 = sizeof(_Tp) <= sizeof(unsigned int);
+ typedef conditional<__b2, unsigned int, unsigned long> __cond2;
+ typedef typename __cond2::type __cond2_type;
+ typedef conditional<__b1, unsigned short, __cond2_type> __cond1;
+ typedef typename __cond1::type __cond1_type;
+
+ public:
+ typedef typename conditional<__b0, __smallest, __cond1_type>::type __type;
+ };
+
+ // Given an integral/enum type, return the corresponding unsigned
+ // integer type.
+ // Primary template.
+ /// make_unsigned
+ template<typename _Tp>
+ struct make_unsigned
+ { typedef typename __make_unsigned_selector<_Tp>::__type type; };
+
+ // Integral, but don't define.
+ template<>
+ struct make_unsigned<bool>;
+
+
+ // Utility for finding the signed versions of unsigned integral types.
+ template<typename _Tp>
+ struct __make_signed
+ { typedef _Tp __type; };
+
+ template<>
+ struct __make_signed<char>
+ { typedef signed char __type; };
+
+ template<>
+ struct __make_signed<unsigned char>
+ { typedef signed char __type; };
+
+ template<>
+ struct __make_signed<unsigned short>
+ { typedef signed short __type; };
+
+ template<>
+ struct __make_signed<unsigned int>
+ { typedef signed int __type; };
+
+ template<>
+ struct __make_signed<unsigned long>
+ { typedef signed long __type; };
+
+ template<>
+ struct __make_signed<unsigned long long>
+ { typedef signed long long __type; };
+
+
+ // Select between integral and enum: not possible to be both.
+ template<typename _Tp,
+ bool _IsInt = is_integral<_Tp>::value,
+ bool _IsEnum = is_enum<_Tp>::value>
+ struct __make_signed_selector;
+
+ template<typename _Tp>
+ struct __make_signed_selector<_Tp, true, false>
+ {
+ private:
+ typedef __make_signed<typename remove_cv<_Tp>::type> __signedt;
+ typedef typename __signedt::__type __signed_type;
+ typedef __match_cv_qualifiers<_Tp, __signed_type> __cv_signed;
+
+ public:
+ typedef typename __cv_signed::__type __type;
+ };
+
+ template<typename _Tp>
+ struct __make_signed_selector<_Tp, false, true>
+ {
+ private:
+ // With -fshort-enums, an enum may be as small as a char.
+ typedef signed char __smallest;
+ static const bool __b0 = sizeof(_Tp) <= sizeof(__smallest);
+ static const bool __b1 = sizeof(_Tp) <= sizeof(signed short);
+ static const bool __b2 = sizeof(_Tp) <= sizeof(signed int);
+ typedef conditional<__b2, signed int, signed long> __cond2;
+ typedef typename __cond2::type __cond2_type;
+ typedef conditional<__b1, signed short, __cond2_type> __cond1;
+ typedef typename __cond1::type __cond1_type;
+
+ public:
+ typedef typename conditional<__b0, __smallest, __cond1_type>::type __type;
+ };
+
+ // Given an integral/enum type, return the corresponding signed
+ // integer type.
+ // Primary template.
+ /// make_signed
+ template<typename _Tp>
+ struct make_signed
+ { typedef typename __make_signed_selector<_Tp>::__type type; };
+
+ // Integral, but don't define.
+ template<>
+ struct make_signed<bool>;
+
+ /// common_type
+ template<typename... _Tp>
+ struct common_type;
+
+ template<typename _Tp>
+ struct common_type<_Tp>
+ {
+ static_assert(sizeof(_Tp) > 0, "must be complete type");
+ typedef _Tp type;
+ };
+
+ template<typename _Tp, typename _Up>
+ class common_type<_Tp, _Up>
+ {
+ static_assert(sizeof(_Tp) > 0, "must be complete type");
+ static_assert(sizeof(_Up) > 0, "must be complete type");
+
+ static _Tp&& __t();
+ static _Up&& __u();
+
+ // HACK: Prevents optimization of ?: in the decltype
+ // expression when the condition is the literal, "true".
+ // See, PR36628.
+ static bool __true_or_false();
+
+ public:
+ typedef decltype(__true_or_false() ? __t() : __u()) type;
+ };
+
+ template<typename _Tp, typename _Up, typename... _Vp>
+ struct common_type<_Tp, _Up, _Vp...>
+ {
+ typedef typename
+ common_type<typename common_type<_Tp, _Up>::type, _Vp...>::type type;
+ };
+
+ // @} group metaprogramming
+}
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_TYPE_TRAITS
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/typeinfo b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/typeinfo
new file mode 100644
index 0000000..eea38e7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/typeinfo
@@ -0,0 +1,196 @@
+// RTTI support for -*- C++ -*-
+// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+// 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation
+//
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// GCC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file typeinfo
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _TYPEINFO
+#define _TYPEINFO
+
+#include <exception>
+
+#pragma GCC visibility push(default)
+
+extern "C++" {
+
+namespace __cxxabiv1
+{
+ class __class_type_info;
+} // namespace __cxxabiv1
+
+// Determine whether typeinfo names for the same type are merged (in which
+// case comparison can just compare pointers) or not (in which case
+// strings must be compared and g++.dg/abi/local1.C will fail), and
+// whether comparison is to be implemented inline or not. By default we
+// use inline pointer comparison if weak symbols are available, and
+// out-of-line strcmp if not. Out-of-line pointer comparison is used
+// where the object files are to be portable to multiple systems, some of
+// which may not be able to use pointer comparison, but the particular
+// system for which libstdc++ is being built can use pointer comparison;
+// in particular for most ARM EABI systems, where the ABI specifies
+// out-of-line comparison. Inline strcmp is not currently supported. The
+// compiler's target configuration can override the defaults by defining
+// __GXX_TYPEINFO_EQUALITY_INLINE to 1 or 0 to indicate whether or not
+// comparison is inline, and __GXX_MERGED_TYPEINFO_NAMES to 1 or 0 to
+// indicate whether or not pointer comparison can be used.
+
+#ifndef __GXX_MERGED_TYPEINFO_NAMES
+ #if !__GXX_WEAK__
+ // If weak symbols are not supported, typeinfo names are not merged.
+ #define __GXX_MERGED_TYPEINFO_NAMES 0
+ #else
+ // On platforms that support weak symbols, typeinfo names are merged.
+ #define __GXX_MERGED_TYPEINFO_NAMES 1
+ #endif
+#endif
+
+// By default follow the same rules as for __GXX_MERGED_TYPEINFO_NAMES.
+#ifndef __GXX_TYPEINFO_EQUALITY_INLINE
+ #if !__GXX_WEAK__
+ #define __GXX_TYPEINFO_EQUALITY_INLINE 0
+ #else
+ #define __GXX_TYPEINFO_EQUALITY_INLINE 1
+ #endif
+#endif
+
+namespace std
+{
+ /**
+ * @brief Part of RTTI.
+ *
+ * The @c type_info class describes type information generated by
+ * an implementation.
+ */
+ class type_info
+ {
+ public:
+ /** Destructor first. Being the first non-inline virtual function, this
+ * controls in which translation unit the vtable is emitted. The
+ * compiler makes use of that information to know where to emit
+ * the runtime-mandated type_info structures in the new-abi. */
+ virtual ~type_info();
+
+ /** Returns an @e implementation-defined byte string; this is not
+ * portable between compilers! */
+ const char* name() const
+ { return __name; }
+
+#if !__GXX_TYPEINFO_EQUALITY_INLINE
+ bool before(const type_info& __arg) const;
+
+ // In old abi, or when weak symbols are not supported, there can
+ // be multiple instances of a type_info object for one
+ // type. Uniqueness must use the _name value, not object address.
+ bool operator==(const type_info& __arg) const;
+#else
+ #if !__GXX_MERGED_TYPEINFO_NAMES
+ #error "Inline implementation of type_info comparision requires merging of type_info objects"
+ #endif
+ /** Returns true if @c *this precedes @c __arg in the implementation's
+ * collation order. */
+ // In new abi we can rely on type_info's NTBS being unique,
+ // and therefore address comparisons are sufficient.
+ bool before(const type_info& __arg) const
+ { return __name < __arg.__name; }
+
+ bool operator==(const type_info& __arg) const
+ { return __name == __arg.__name; }
+#endif
+ bool operator!=(const type_info& __arg) const
+ { return !operator==(__arg); }
+
+ // Return true if this is a pointer type of some kind
+ virtual bool __is_pointer_p() const;
+
+ // Return true if this is a function type
+ virtual bool __is_function_p() const;
+
+ // Try and catch a thrown type. Store an adjusted pointer to the
+ // caught type in THR_OBJ. If THR_TYPE is not a pointer type, then
+ // THR_OBJ points to the thrown object. If THR_TYPE is a pointer
+ // type, then THR_OBJ is the pointer itself. OUTER indicates the
+ // number of outer pointers, and whether they were const
+ // qualified.
+ virtual bool __do_catch(const type_info *__thr_type, void **__thr_obj,
+ unsigned __outer) const;
+
+ // Internally used during catch matching
+ virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target,
+ void **__obj_ptr) const;
+
+ protected:
+ const char *__name;
+
+ explicit type_info(const char *__n): __name(__n) { }
+
+ private:
+ /// Assigning type_info is not supported.
+ type_info& operator=(const type_info&);
+ type_info(const type_info&);
+ };
+
+ /**
+ * @brief Thrown during incorrect typecasting.
+ * @ingroup exceptions
+ *
+ * If you attempt an invalid @c dynamic_cast expression, an instance of
+ * this class (or something derived from this class) is thrown. */
+ class bad_cast : public exception
+ {
+ public:
+ bad_cast() throw() { }
+
+ // This declaration is not useless:
+ // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
+ virtual ~bad_cast() throw();
+
+ // See comment in eh_exception.cc.
+ virtual const char* what() const throw();
+ };
+
+ /**
+ * @brief Thrown when a NULL pointer in a @c typeid expression is used.
+ * @ingroup exceptions
+ */
+ class bad_typeid : public exception
+ {
+ public:
+ bad_typeid () throw() { }
+
+ // This declaration is not useless:
+ // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
+ virtual ~bad_typeid() throw();
+
+ // See comment in eh_exception.cc.
+ virtual const char* what() const throw();
+ };
+} // namespace std
+
+#pragma GCC visibility pop
+
+} // extern "C++"
+#endif
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/unordered_map b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/unordered_map
new file mode 100644
index 0000000..56906d2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/unordered_map
@@ -0,0 +1,78 @@
+// <unordered_map> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/unordered_map
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_UNORDERED_MAP
+#define _GLIBCXX_UNORDERED_MAP 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <utility>
+#include <type_traits>
+#include <initializer_list>
+#include <bits/stl_algobase.h>
+#include <bits/allocator.h>
+#include <bits/stl_function.h> // equal_to, _Identity, _Select1st
+#include <bits/stringfwd.h>
+#include <bits/functional_hash.h>
+#include <bits/hashtable.h>
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/unordered_map>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+#if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL)
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace _GLIBCXX_STD_D {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 _GLIBCXX_STD_D
+#else
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+#endif
+# include <tr1_impl/unordered_map>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+#ifdef _GLIBCXX_DEBUG
+# include <debug/unordered_map>
+#endif
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_UNORDERED_MAP
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/unordered_set b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/unordered_set
new file mode 100644
index 0000000..880f3be
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/unordered_set
@@ -0,0 +1,78 @@
+// <unordered_set> -*- C++ -*-
+
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/unordered_set
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_UNORDERED_SET
+#define _GLIBCXX_UNORDERED_SET 1
+
+#pragma GCC system_header
+
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# include <c++0x_warning.h>
+#else
+
+#if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+#endif
+
+#include <utility>
+#include <type_traits>
+#include <initializer_list>
+#include <bits/stl_algobase.h>
+#include <bits/allocator.h>
+#include <bits/stl_function.h> // equal_to, _Identity, _Select1st
+#include <bits/stringfwd.h>
+#include <bits/functional_hash.h>
+#include <bits/hashtable.h>
+
+#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/unordered_set>
+#else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+#if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL)
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace _GLIBCXX_STD_D {
+# define _GLIBCXX_END_NAMESPACE_TR1 }
+# define _GLIBCXX_TR1 _GLIBCXX_STD_D
+#else
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+#endif
+# include <tr1_impl/unordered_set>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+#endif
+
+#ifdef _GLIBCXX_DEBUG
+# include <debug/unordered_set>
+#endif
+
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
+#endif // _GLIBCXX_UNORDERED_SET
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/utility b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/utility
new file mode 100644
index 0000000..1a6d0b1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/utility
@@ -0,0 +1,94 @@
+// <utility> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/utility
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_UTILITY
+#define _GLIBCXX_UTILITY 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <bits/stl_relops.h>
+#include <bits/stl_pair.h>
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# if defined(_GLIBCXX_INCLUDE_AS_TR1)
+# error C++0x header cannot be included from TR1 header
+# endif
+# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
+# include <tr1_impl/utility>
+# else
+# define _GLIBCXX_INCLUDE_AS_CXX0X
+# define _GLIBCXX_BEGIN_NAMESPACE_TR1
+# define _GLIBCXX_END_NAMESPACE_TR1
+# define _GLIBCXX_TR1
+# include <tr1_impl/utility>
+# undef _GLIBCXX_TR1
+# undef _GLIBCXX_END_NAMESPACE_TR1
+# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
+# undef _GLIBCXX_INCLUDE_AS_CXX0X
+# endif
+# include <bits/move.h>
+# include <initializer_list>
+#endif
+
+/**
+ * @defgroup utilities Utilities
+ *
+ * Components deemed generally useful. Includes pair, tuple,
+ * forward/move helpers, ratio, function object, metaprogramming and
+ * type traits, time, date, and memory functions.
+ */
+
+#endif /* _GLIBCXX_UTILITY */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/valarray b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/valarray
new file mode 100644
index 0000000..43e8d20
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/valarray
@@ -0,0 +1,1087 @@
+// The template and inlines for the -*- C++ -*- valarray class.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file valarray
+ * This is a Standard C++ Library header.
+ */
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
+
+#ifndef _GLIBCXX_VALARRAY
+#define _GLIBCXX_VALARRAY 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+#include <cstddef>
+#include <cmath>
+#include <algorithm>
+#include <debug/debug.h>
+#include <initializer_list>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<class _Clos, typename _Tp>
+ class _Expr;
+
+ template<typename _Tp1, typename _Tp2>
+ class _ValArray;
+
+ template<class _Oper, template<class, class> class _Meta, class _Dom>
+ struct _UnClos;
+
+ template<class _Oper,
+ template<class, class> class _Meta1,
+ template<class, class> class _Meta2,
+ class _Dom1, class _Dom2>
+ class _BinClos;
+
+ template<template<class, class> class _Meta, class _Dom>
+ class _SClos;
+
+ template<template<class, class> class _Meta, class _Dom>
+ class _GClos;
+
+ template<template<class, class> class _Meta, class _Dom>
+ class _IClos;
+
+ template<template<class, class> class _Meta, class _Dom>
+ class _ValFunClos;
+
+ template<template<class, class> class _Meta, class _Dom>
+ class _RefFunClos;
+
+ template<class _Tp> class valarray; // An array of type _Tp
+ class slice; // BLAS-like slice out of an array
+ template<class _Tp> class slice_array;
+ class gslice; // generalized slice out of an array
+ template<class _Tp> class gslice_array;
+ template<class _Tp> class mask_array; // masked array
+ template<class _Tp> class indirect_array; // indirected array
+
+_GLIBCXX_END_NAMESPACE
+
+#include <bits/valarray_array.h>
+#include <bits/valarray_before.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @defgroup numeric_arrays Numeric Arrays
+ * @ingroup numerics
+ *
+ * Classes and functions for representing and manipulating arrays of elements.
+ * @{
+ */
+
+ /**
+ * @brief Smart array designed to support numeric processing.
+ *
+ * A valarray is an array that provides constraints intended to allow for
+ * effective optimization of numeric array processing by reducing the
+ * aliasing that can result from pointer representations. It represents a
+ * one-dimensional array from which different multidimensional subsets can
+ * be accessed and modified.
+ *
+ * @param Tp Type of object in the array.
+ */
+ template<class _Tp>
+ class valarray
+ {
+ template<class _Op>
+ struct _UnaryOp
+ {
+ typedef typename __fun<_Op, _Tp>::result_type __rt;
+ typedef _Expr<_UnClos<_Op, _ValArray, _Tp>, __rt> _Rt;
+ };
+ public:
+ typedef _Tp value_type;
+
+ // _lib.valarray.cons_ construct/destroy:
+ /// Construct an empty array.
+ valarray();
+
+ /// Construct an array with @a n elements.
+ explicit valarray(size_t);
+
+ /// Construct an array with @a n elements initialized to @a t.
+ valarray(const _Tp&, size_t);
+
+ /// Construct an array initialized to the first @a n elements of @a t.
+ valarray(const _Tp* __restrict__, size_t);
+
+ /// Copy constructor.
+ valarray(const valarray&);
+
+ /// Construct an array with the same size and values in @a sa.
+ valarray(const slice_array<_Tp>&);
+
+ /// Construct an array with the same size and values in @a ga.
+ valarray(const gslice_array<_Tp>&);
+
+ /// Construct an array with the same size and values in @a ma.
+ valarray(const mask_array<_Tp>&);
+
+ /// Construct an array with the same size and values in @a ia.
+ valarray(const indirect_array<_Tp>&);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /// Construct an array with an initializer_list of values.
+ valarray(initializer_list<_Tp>);
+#endif
+
+ template<class _Dom>
+ valarray(const _Expr<_Dom, _Tp>& __e);
+
+ ~valarray();
+
+ // _lib.valarray.assign_ assignment:
+ /**
+ * @brief Assign elements to an array.
+ *
+ * Assign elements of array to values in @a v. Results are undefined
+ * if @a v does not have the same size as this array.
+ *
+ * @param v Valarray to get values from.
+ */
+ valarray<_Tp>& operator=(const valarray<_Tp>&);
+
+ /**
+ * @brief Assign elements to a value.
+ *
+ * Assign all elements of array to @a t.
+ *
+ * @param t Value for elements.
+ */
+ valarray<_Tp>& operator=(const _Tp&);
+
+ /**
+ * @brief Assign elements to an array subset.
+ *
+ * Assign elements of array to values in @a sa. Results are undefined
+ * if @a sa does not have the same size as this array.
+ *
+ * @param sa Array slice to get values from.
+ */
+ valarray<_Tp>& operator=(const slice_array<_Tp>&);
+
+ /**
+ * @brief Assign elements to an array subset.
+ *
+ * Assign elements of array to values in @a ga. Results are undefined
+ * if @a ga does not have the same size as this array.
+ *
+ * @param ga Array slice to get values from.
+ */
+ valarray<_Tp>& operator=(const gslice_array<_Tp>&);
+
+ /**
+ * @brief Assign elements to an array subset.
+ *
+ * Assign elements of array to values in @a ma. Results are undefined
+ * if @a ma does not have the same size as this array.
+ *
+ * @param ma Array slice to get values from.
+ */
+ valarray<_Tp>& operator=(const mask_array<_Tp>&);
+
+ /**
+ * @brief Assign elements to an array subset.
+ *
+ * Assign elements of array to values in @a ia. Results are undefined
+ * if @a ia does not have the same size as this array.
+ *
+ * @param ia Array slice to get values from.
+ */
+ valarray<_Tp>& operator=(const indirect_array<_Tp>&);
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Assign elements to an initializer_list.
+ *
+ * Assign elements of array to values in @a l. Results are undefined
+ * if @a l does not have the same size as this array.
+ *
+ * @param l initializer_list to get values from.
+ */
+ valarray& operator=(initializer_list<_Tp>);
+#endif
+
+ template<class _Dom> valarray<_Tp>&
+ operator= (const _Expr<_Dom, _Tp>&);
+
+ // _lib.valarray.access_ element access:
+ /**
+ * Return a reference to the i'th array element.
+ *
+ * @param i Index of element to return.
+ * @return Reference to the i'th element.
+ */
+ _Tp& operator[](size_t);
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 389. Const overload of valarray::operator[] returns by value.
+ const _Tp& operator[](size_t) const;
+
+ // _lib.valarray.sub_ subset operations:
+ /**
+ * @brief Return an array subset.
+ *
+ * Returns a new valarray containing the elements of the array
+ * indicated by the slice argument. The new valarray has the same size
+ * as the input slice. @see slice.
+ *
+ * @param s The source slice.
+ * @return New valarray containing elements in @a s.
+ */
+ _Expr<_SClos<_ValArray, _Tp>, _Tp> operator[](slice) const;
+
+ /**
+ * @brief Return a reference to an array subset.
+ *
+ * Returns a new valarray containing the elements of the array
+ * indicated by the slice argument. The new valarray has the same size
+ * as the input slice. @see slice.
+ *
+ * @param s The source slice.
+ * @return New valarray containing elements in @a s.
+ */
+ slice_array<_Tp> operator[](slice);
+
+ /**
+ * @brief Return an array subset.
+ *
+ * Returns a slice_array referencing the elements of the array
+ * indicated by the slice argument. @see gslice.
+ *
+ * @param s The source slice.
+ * @return Slice_array referencing elements indicated by @a s.
+ */
+ _Expr<_GClos<_ValArray, _Tp>, _Tp> operator[](const gslice&) const;
+
+ /**
+ * @brief Return a reference to an array subset.
+ *
+ * Returns a new valarray containing the elements of the array
+ * indicated by the gslice argument. The new valarray has
+ * the same size as the input gslice. @see gslice.
+ *
+ * @param s The source gslice.
+ * @return New valarray containing elements in @a s.
+ */
+ gslice_array<_Tp> operator[](const gslice&);
+
+ /**
+ * @brief Return an array subset.
+ *
+ * Returns a new valarray containing the elements of the array
+ * indicated by the argument. The input is a valarray of bool which
+ * represents a bitmask indicating which elements should be copied into
+ * the new valarray. Each element of the array is added to the return
+ * valarray if the corresponding element of the argument is true.
+ *
+ * @param m The valarray bitmask.
+ * @return New valarray containing elements indicated by @a m.
+ */
+ valarray<_Tp> operator[](const valarray<bool>&) const;
+
+ /**
+ * @brief Return a reference to an array subset.
+ *
+ * Returns a new mask_array referencing the elements of the array
+ * indicated by the argument. The input is a valarray of bool which
+ * represents a bitmask indicating which elements are part of the
+ * subset. Elements of the array are part of the subset if the
+ * corresponding element of the argument is true.
+ *
+ * @param m The valarray bitmask.
+ * @return New valarray containing elements indicated by @a m.
+ */
+ mask_array<_Tp> operator[](const valarray<bool>&);
+
+ /**
+ * @brief Return an array subset.
+ *
+ * Returns a new valarray containing the elements of the array
+ * indicated by the argument. The elements in the argument are
+ * interpreted as the indices of elements of this valarray to copy to
+ * the return valarray.
+ *
+ * @param i The valarray element index list.
+ * @return New valarray containing elements in @a s.
+ */
+ _Expr<_IClos<_ValArray, _Tp>, _Tp>
+ operator[](const valarray<size_t>&) const;
+
+ /**
+ * @brief Return a reference to an array subset.
+ *
+ * Returns an indirect_array referencing the elements of the array
+ * indicated by the argument. The elements in the argument are
+ * interpreted as the indices of elements of this valarray to include
+ * in the subset. The returned indirect_array refers to these
+ * elements.
+ *
+ * @param i The valarray element index list.
+ * @return Indirect_array referencing elements in @a i.
+ */
+ indirect_array<_Tp> operator[](const valarray<size_t>&);
+
+ // _lib.valarray.unary_ unary operators:
+ /// Return a new valarray by applying unary + to each element.
+ typename _UnaryOp<__unary_plus>::_Rt operator+() const;
+
+ /// Return a new valarray by applying unary - to each element.
+ typename _UnaryOp<__negate>::_Rt operator-() const;
+
+ /// Return a new valarray by applying unary ~ to each element.
+ typename _UnaryOp<__bitwise_not>::_Rt operator~() const;
+
+ /// Return a new valarray by applying unary ! to each element.
+ typename _UnaryOp<__logical_not>::_Rt operator!() const;
+
+ // _lib.valarray.cassign_ computed assignment:
+ /// Multiply each element of array by @a t.
+ valarray<_Tp>& operator*=(const _Tp&);
+
+ /// Divide each element of array by @a t.
+ valarray<_Tp>& operator/=(const _Tp&);
+
+ /// Set each element e of array to e % @a t.
+ valarray<_Tp>& operator%=(const _Tp&);
+
+ /// Add @a t to each element of array.
+ valarray<_Tp>& operator+=(const _Tp&);
+
+ /// Subtract @a t to each element of array.
+ valarray<_Tp>& operator-=(const _Tp&);
+
+ /// Set each element e of array to e ^ @a t.
+ valarray<_Tp>& operator^=(const _Tp&);
+
+ /// Set each element e of array to e & @a t.
+ valarray<_Tp>& operator&=(const _Tp&);
+
+ /// Set each element e of array to e | @a t.
+ valarray<_Tp>& operator|=(const _Tp&);
+
+ /// Left shift each element e of array by @a t bits.
+ valarray<_Tp>& operator<<=(const _Tp&);
+
+ /// Right shift each element e of array by @a t bits.
+ valarray<_Tp>& operator>>=(const _Tp&);
+
+ /// Multiply elements of array by corresponding elements of @a v.
+ valarray<_Tp>& operator*=(const valarray<_Tp>&);
+
+ /// Divide elements of array by corresponding elements of @a v.
+ valarray<_Tp>& operator/=(const valarray<_Tp>&);
+
+ /// Modulo elements of array by corresponding elements of @a v.
+ valarray<_Tp>& operator%=(const valarray<_Tp>&);
+
+ /// Add corresponding elements of @a v to elements of array.
+ valarray<_Tp>& operator+=(const valarray<_Tp>&);
+
+ /// Subtract corresponding elements of @a v from elements of array.
+ valarray<_Tp>& operator-=(const valarray<_Tp>&);
+
+ /// Logical xor corresponding elements of @a v with elements of array.
+ valarray<_Tp>& operator^=(const valarray<_Tp>&);
+
+ /// Logical or corresponding elements of @a v with elements of array.
+ valarray<_Tp>& operator|=(const valarray<_Tp>&);
+
+ /// Logical and corresponding elements of @a v with elements of array.
+ valarray<_Tp>& operator&=(const valarray<_Tp>&);
+
+ /// Left shift elements of array by corresponding elements of @a v.
+ valarray<_Tp>& operator<<=(const valarray<_Tp>&);
+
+ /// Right shift elements of array by corresponding elements of @a v.
+ valarray<_Tp>& operator>>=(const valarray<_Tp>&);
+
+ template<class _Dom>
+ valarray<_Tp>& operator*=(const _Expr<_Dom, _Tp>&);
+ template<class _Dom>
+ valarray<_Tp>& operator/=(const _Expr<_Dom, _Tp>&);
+ template<class _Dom>
+ valarray<_Tp>& operator%=(const _Expr<_Dom, _Tp>&);
+ template<class _Dom>
+ valarray<_Tp>& operator+=(const _Expr<_Dom, _Tp>&);
+ template<class _Dom>
+ valarray<_Tp>& operator-=(const _Expr<_Dom, _Tp>&);
+ template<class _Dom>
+ valarray<_Tp>& operator^=(const _Expr<_Dom, _Tp>&);
+ template<class _Dom>
+ valarray<_Tp>& operator|=(const _Expr<_Dom, _Tp>&);
+ template<class _Dom>
+ valarray<_Tp>& operator&=(const _Expr<_Dom, _Tp>&);
+ template<class _Dom>
+ valarray<_Tp>& operator<<=(const _Expr<_Dom, _Tp>&);
+ template<class _Dom>
+ valarray<_Tp>& operator>>=(const _Expr<_Dom, _Tp>&);
+
+ // _lib.valarray.members_ member functions:
+ /// Return the number of elements in array.
+ size_t size() const;
+
+ /**
+ * @brief Return the sum of all elements in the array.
+ *
+ * Accumulates the sum of all elements into a Tp using +=. The order
+ * of adding the elements is unspecified.
+ */
+ _Tp sum() const;
+
+ /// Return the minimum element using operator<().
+ _Tp min() const;
+
+ /// Return the maximum element using operator<().
+ _Tp max() const;
+
+ /**
+ * @brief Return a shifted array.
+ *
+ * A new valarray is constructed as a copy of this array with elements
+ * in shifted positions. For an element with index i, the new position
+ * is i - n. The new valarray has the same size as the current one.
+ * New elements without a value are set to 0. Elements whose new
+ * position is outside the bounds of the array are discarded.
+ *
+ * Positive arguments shift toward index 0, discarding elements [0, n).
+ * Negative arguments discard elements from the top of the array.
+ *
+ * @param n Number of element positions to shift.
+ * @return New valarray with elements in shifted positions.
+ */
+ valarray<_Tp> shift (int) const;
+
+ /**
+ * @brief Return a rotated array.
+ *
+ * A new valarray is constructed as a copy of this array with elements
+ * in shifted positions. For an element with index i, the new position
+ * is (i - n) % size(). The new valarray has the same size as the
+ * current one. Elements that are shifted beyond the array bounds are
+ * shifted into the other end of the array. No elements are lost.
+ *
+ * Positive arguments shift toward index 0, wrapping around the top.
+ * Negative arguments shift towards the top, wrapping around to 0.
+ *
+ * @param n Number of element positions to rotate.
+ * @return New valarray with elements in shifted positions.
+ */
+ valarray<_Tp> cshift(int) const;
+
+ /**
+ * @brief Apply a function to the array.
+ *
+ * Returns a new valarray with elements assigned to the result of
+ * applying func to the corresponding element of this array. The new
+ * array has the same size as this one.
+ *
+ * @param func Function of Tp returning Tp to apply.
+ * @return New valarray with transformed elements.
+ */
+ _Expr<_ValFunClos<_ValArray, _Tp>, _Tp> apply(_Tp func(_Tp)) const;
+
+ /**
+ * @brief Apply a function to the array.
+ *
+ * Returns a new valarray with elements assigned to the result of
+ * applying func to the corresponding element of this array. The new
+ * array has the same size as this one.
+ *
+ * @param func Function of const Tp& returning Tp to apply.
+ * @return New valarray with transformed elements.
+ */
+ _Expr<_RefFunClos<_ValArray, _Tp>, _Tp> apply(_Tp func(const _Tp&)) const;
+
+ /**
+ * @brief Resize array.
+ *
+ * Resize this array to @a size and set all elements to @a c. All
+ * references and iterators are invalidated.
+ *
+ * @param size New array size.
+ * @param c New value for all elements.
+ */
+ void resize(size_t __size, _Tp __c = _Tp());
+
+ private:
+ size_t _M_size;
+ _Tp* __restrict__ _M_data;
+
+ friend class _Array<_Tp>;
+ };
+
+ template<typename _Tp>
+ inline const _Tp&
+ valarray<_Tp>::operator[](size_t __i) const
+ {
+ __glibcxx_requires_subscript(__i);
+ return _M_data[__i];
+ }
+
+ template<typename _Tp>
+ inline _Tp&
+ valarray<_Tp>::operator[](size_t __i)
+ {
+ __glibcxx_requires_subscript(__i);
+ return _M_data[__i];
+ }
+
+ // @} group numeric_arrays
+
+_GLIBCXX_END_NAMESPACE
+
+#include <bits/valarray_after.h>
+#include <bits/slice_array.h>
+#include <bits/gslice.h>
+#include <bits/gslice_array.h>
+#include <bits/mask_array.h>
+#include <bits/indirect_array.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ /**
+ * @addtogroup numeric_arrays
+ * @{
+ */
+
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray() : _M_size(0), _M_data(0) {}
+
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray(size_t __n)
+ : _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n))
+ { std::__valarray_default_construct(_M_data, _M_data + __n); }
+
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray(const _Tp& __t, size_t __n)
+ : _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n))
+ { std::__valarray_fill_construct(_M_data, _M_data + __n, __t); }
+
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray(const _Tp* __restrict__ __p, size_t __n)
+ : _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n))
+ {
+ _GLIBCXX_DEBUG_ASSERT(__p != 0 || __n == 0);
+ std::__valarray_copy_construct(__p, __p + __n, _M_data);
+ }
+
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray(const valarray<_Tp>& __v)
+ : _M_size(__v._M_size), _M_data(__valarray_get_storage<_Tp>(__v._M_size))
+ { std::__valarray_copy_construct(__v._M_data, __v._M_data + _M_size,
+ _M_data); }
+
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray(const slice_array<_Tp>& __sa)
+ : _M_size(__sa._M_sz), _M_data(__valarray_get_storage<_Tp>(__sa._M_sz))
+ {
+ std::__valarray_copy_construct
+ (__sa._M_array, __sa._M_sz, __sa._M_stride, _Array<_Tp>(_M_data));
+ }
+
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray(const gslice_array<_Tp>& __ga)
+ : _M_size(__ga._M_index.size()),
+ _M_data(__valarray_get_storage<_Tp>(_M_size))
+ {
+ std::__valarray_copy_construct
+ (__ga._M_array, _Array<size_t>(__ga._M_index),
+ _Array<_Tp>(_M_data), _M_size);
+ }
+
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray(const mask_array<_Tp>& __ma)
+ : _M_size(__ma._M_sz), _M_data(__valarray_get_storage<_Tp>(__ma._M_sz))
+ {
+ std::__valarray_copy_construct
+ (__ma._M_array, __ma._M_mask, _Array<_Tp>(_M_data), _M_size);
+ }
+
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray(const indirect_array<_Tp>& __ia)
+ : _M_size(__ia._M_sz), _M_data(__valarray_get_storage<_Tp>(__ia._M_sz))
+ {
+ std::__valarray_copy_construct
+ (__ia._M_array, __ia._M_index, _Array<_Tp>(_M_data), _M_size);
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray(initializer_list<_Tp> __l)
+ : _M_size(__l.size()), _M_data(__valarray_get_storage<_Tp>(__l.size()))
+ { std::__valarray_copy_construct (__l.begin(), __l.end(), _M_data); }
+#endif
+
+ template<typename _Tp> template<class _Dom>
+ inline
+ valarray<_Tp>::valarray(const _Expr<_Dom, _Tp>& __e)
+ : _M_size(__e.size()), _M_data(__valarray_get_storage<_Tp>(_M_size))
+ { std::__valarray_copy_construct(__e, _M_size, _Array<_Tp>(_M_data)); }
+
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::~valarray()
+ {
+ std::__valarray_destroy_elements(_M_data, _M_data + _M_size);
+ std::__valarray_release_memory(_M_data);
+ }
+
+ template<typename _Tp>
+ inline valarray<_Tp>&
+ valarray<_Tp>::operator=(const valarray<_Tp>& __v)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __v._M_size);
+ std::__valarray_copy(__v._M_data, _M_size, _M_data);
+ return *this;
+ }
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp>
+ inline valarray<_Tp>&
+ valarray<_Tp>::operator=(initializer_list<_Tp> __l)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __l.size());
+ std::__valarray_copy(__l.begin(), __l.size(), _M_data);
+ return *this;
+ }
+#endif
+
+ template<typename _Tp>
+ inline valarray<_Tp>&
+ valarray<_Tp>::operator=(const _Tp& __t)
+ {
+ std::__valarray_fill(_M_data, _M_size, __t);
+ return *this;
+ }
+
+ template<typename _Tp>
+ inline valarray<_Tp>&
+ valarray<_Tp>::operator=(const slice_array<_Tp>& __sa)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __sa._M_sz);
+ std::__valarray_copy(__sa._M_array, __sa._M_sz,
+ __sa._M_stride, _Array<_Tp>(_M_data));
+ return *this;
+ }
+
+ template<typename _Tp>
+ inline valarray<_Tp>&
+ valarray<_Tp>::operator=(const gslice_array<_Tp>& __ga)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __ga._M_index.size());
+ std::__valarray_copy(__ga._M_array, _Array<size_t>(__ga._M_index),
+ _Array<_Tp>(_M_data), _M_size);
+ return *this;
+ }
+
+ template<typename _Tp>
+ inline valarray<_Tp>&
+ valarray<_Tp>::operator=(const mask_array<_Tp>& __ma)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __ma._M_sz);
+ std::__valarray_copy(__ma._M_array, __ma._M_mask,
+ _Array<_Tp>(_M_data), _M_size);
+ return *this;
+ }
+
+ template<typename _Tp>
+ inline valarray<_Tp>&
+ valarray<_Tp>::operator=(const indirect_array<_Tp>& __ia)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __ia._M_sz);
+ std::__valarray_copy(__ia._M_array, __ia._M_index,
+ _Array<_Tp>(_M_data), _M_size);
+ return *this;
+ }
+
+ template<typename _Tp> template<class _Dom>
+ inline valarray<_Tp>&
+ valarray<_Tp>::operator=(const _Expr<_Dom, _Tp>& __e)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __e.size());
+ std::__valarray_copy(__e, _M_size, _Array<_Tp>(_M_data));
+ return *this;
+ }
+
+ template<typename _Tp>
+ inline _Expr<_SClos<_ValArray,_Tp>, _Tp>
+ valarray<_Tp>::operator[](slice __s) const
+ {
+ typedef _SClos<_ValArray,_Tp> _Closure;
+ return _Expr<_Closure, _Tp>(_Closure (_Array<_Tp>(_M_data), __s));
+ }
+
+ template<typename _Tp>
+ inline slice_array<_Tp>
+ valarray<_Tp>::operator[](slice __s)
+ { return slice_array<_Tp>(_Array<_Tp>(_M_data), __s); }
+
+ template<typename _Tp>
+ inline _Expr<_GClos<_ValArray,_Tp>, _Tp>
+ valarray<_Tp>::operator[](const gslice& __gs) const
+ {
+ typedef _GClos<_ValArray,_Tp> _Closure;
+ return _Expr<_Closure, _Tp>
+ (_Closure(_Array<_Tp>(_M_data), __gs._M_index->_M_index));
+ }
+
+ template<typename _Tp>
+ inline gslice_array<_Tp>
+ valarray<_Tp>::operator[](const gslice& __gs)
+ {
+ return gslice_array<_Tp>
+ (_Array<_Tp>(_M_data), __gs._M_index->_M_index);
+ }
+
+ template<typename _Tp>
+ inline valarray<_Tp>
+ valarray<_Tp>::operator[](const valarray<bool>& __m) const
+ {
+ size_t __s = 0;
+ size_t __e = __m.size();
+ for (size_t __i=0; __i<__e; ++__i)
+ if (__m[__i]) ++__s;
+ return valarray<_Tp>(mask_array<_Tp>(_Array<_Tp>(_M_data), __s,
+ _Array<bool> (__m)));
+ }
+
+ template<typename _Tp>
+ inline mask_array<_Tp>
+ valarray<_Tp>::operator[](const valarray<bool>& __m)
+ {
+ size_t __s = 0;
+ size_t __e = __m.size();
+ for (size_t __i=0; __i<__e; ++__i)
+ if (__m[__i]) ++__s;
+ return mask_array<_Tp>(_Array<_Tp>(_M_data), __s, _Array<bool>(__m));
+ }
+
+ template<typename _Tp>
+ inline _Expr<_IClos<_ValArray,_Tp>, _Tp>
+ valarray<_Tp>::operator[](const valarray<size_t>& __i) const
+ {
+ typedef _IClos<_ValArray,_Tp> _Closure;
+ return _Expr<_Closure, _Tp>(_Closure(*this, __i));
+ }
+
+ template<typename _Tp>
+ inline indirect_array<_Tp>
+ valarray<_Tp>::operator[](const valarray<size_t>& __i)
+ {
+ return indirect_array<_Tp>(_Array<_Tp>(_M_data), __i.size(),
+ _Array<size_t>(__i));
+ }
+
+ template<class _Tp>
+ inline size_t
+ valarray<_Tp>::size() const
+ { return _M_size; }
+
+ template<class _Tp>
+ inline _Tp
+ valarray<_Tp>::sum() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size > 0);
+ return std::__valarray_sum(_M_data, _M_data + _M_size);
+ }
+
+ template<class _Tp>
+ inline valarray<_Tp>
+ valarray<_Tp>::shift(int __n) const
+ {
+ valarray<_Tp> __ret;
+
+ if (_M_size == 0)
+ return __ret;
+
+ _Tp* __restrict__ __tmp_M_data =
+ std::__valarray_get_storage<_Tp>(_M_size);
+
+ if (__n == 0)
+ std::__valarray_copy_construct(_M_data,
+ _M_data + _M_size, __tmp_M_data);
+ else if (__n > 0) // shift left
+ {
+ if (size_t(__n) > _M_size)
+ __n = int(_M_size);
+
+ std::__valarray_copy_construct(_M_data + __n,
+ _M_data + _M_size, __tmp_M_data);
+ std::__valarray_default_construct(__tmp_M_data + _M_size - __n,
+ __tmp_M_data + _M_size);
+ }
+ else // shift right
+ {
+ if (-size_t(__n) > _M_size)
+ __n = -int(_M_size);
+
+ std::__valarray_copy_construct(_M_data, _M_data + _M_size + __n,
+ __tmp_M_data - __n);
+ std::__valarray_default_construct(__tmp_M_data,
+ __tmp_M_data - __n);
+ }
+
+ __ret._M_size = _M_size;
+ __ret._M_data = __tmp_M_data;
+ return __ret;
+ }
+
+ template<class _Tp>
+ inline valarray<_Tp>
+ valarray<_Tp>::cshift(int __n) const
+ {
+ valarray<_Tp> __ret;
+
+ if (_M_size == 0)
+ return __ret;
+
+ _Tp* __restrict__ __tmp_M_data =
+ std::__valarray_get_storage<_Tp>(_M_size);
+
+ if (__n == 0)
+ std::__valarray_copy_construct(_M_data,
+ _M_data + _M_size, __tmp_M_data);
+ else if (__n > 0) // cshift left
+ {
+ if (size_t(__n) > _M_size)
+ __n = int(__n % _M_size);
+
+ std::__valarray_copy_construct(_M_data, _M_data + __n,
+ __tmp_M_data + _M_size - __n);
+ std::__valarray_copy_construct(_M_data + __n, _M_data + _M_size,
+ __tmp_M_data);
+ }
+ else // cshift right
+ {
+ if (-size_t(__n) > _M_size)
+ __n = -int(-size_t(__n) % _M_size);
+
+ std::__valarray_copy_construct(_M_data + _M_size + __n,
+ _M_data + _M_size, __tmp_M_data);
+ std::__valarray_copy_construct(_M_data, _M_data + _M_size + __n,
+ __tmp_M_data - __n);
+ }
+
+ __ret._M_size = _M_size;
+ __ret._M_data = __tmp_M_data;
+ return __ret;
+ }
+
+ template<class _Tp>
+ inline void
+ valarray<_Tp>::resize(size_t __n, _Tp __c)
+ {
+ // This complication is so to make valarray<valarray<T> > work
+ // even though it is not required by the standard. Nobody should
+ // be saying valarray<valarray<T> > anyway. See the specs.
+ std::__valarray_destroy_elements(_M_data, _M_data + _M_size);
+ if (_M_size != __n)
+ {
+ std::__valarray_release_memory(_M_data);
+ _M_size = __n;
+ _M_data = __valarray_get_storage<_Tp>(__n);
+ }
+ std::__valarray_fill_construct(_M_data, _M_data + __n, __c);
+ }
+
+ template<typename _Tp>
+ inline _Tp
+ valarray<_Tp>::min() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size > 0);
+ return *std::min_element(_M_data, _M_data + _M_size);
+ }
+
+ template<typename _Tp>
+ inline _Tp
+ valarray<_Tp>::max() const
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size > 0);
+ return *std::max_element(_M_data, _M_data + _M_size);
+ }
+
+ template<class _Tp>
+ inline _Expr<_ValFunClos<_ValArray, _Tp>, _Tp>
+ valarray<_Tp>::apply(_Tp func(_Tp)) const
+ {
+ typedef _ValFunClos<_ValArray, _Tp> _Closure;
+ return _Expr<_Closure, _Tp>(_Closure(*this, func));
+ }
+
+ template<class _Tp>
+ inline _Expr<_RefFunClos<_ValArray, _Tp>, _Tp>
+ valarray<_Tp>::apply(_Tp func(const _Tp &)) const
+ {
+ typedef _RefFunClos<_ValArray, _Tp> _Closure;
+ return _Expr<_Closure, _Tp>(_Closure(*this, func));
+ }
+
+#define _DEFINE_VALARRAY_UNARY_OPERATOR(_Op, _Name) \
+ template<typename _Tp> \
+ inline typename valarray<_Tp>::template _UnaryOp<_Name>::_Rt \
+ valarray<_Tp>::operator _Op() const \
+ { \
+ typedef _UnClos<_Name, _ValArray, _Tp> _Closure; \
+ typedef typename __fun<_Name, _Tp>::result_type _Rt; \
+ return _Expr<_Closure, _Rt>(_Closure(*this)); \
+ }
+
+ _DEFINE_VALARRAY_UNARY_OPERATOR(+, __unary_plus)
+ _DEFINE_VALARRAY_UNARY_OPERATOR(-, __negate)
+ _DEFINE_VALARRAY_UNARY_OPERATOR(~, __bitwise_not)
+ _DEFINE_VALARRAY_UNARY_OPERATOR (!, __logical_not)
+
+#undef _DEFINE_VALARRAY_UNARY_OPERATOR
+
+#define _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(_Op, _Name) \
+ template<class _Tp> \
+ inline valarray<_Tp>& \
+ valarray<_Tp>::operator _Op##=(const _Tp &__t) \
+ { \
+ _Array_augmented_##_Name(_Array<_Tp>(_M_data), _M_size, __t); \
+ return *this; \
+ } \
+ \
+ template<class _Tp> \
+ inline valarray<_Tp>& \
+ valarray<_Tp>::operator _Op##=(const valarray<_Tp> &__v) \
+ { \
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __v._M_size); \
+ _Array_augmented_##_Name(_Array<_Tp>(_M_data), _M_size, \
+ _Array<_Tp>(__v._M_data)); \
+ return *this; \
+ }
+
+_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(+, __plus)
+_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(-, __minus)
+_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(*, __multiplies)
+_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(/, __divides)
+_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(%, __modulus)
+_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(^, __bitwise_xor)
+_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(&, __bitwise_and)
+_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(|, __bitwise_or)
+_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(<<, __shift_left)
+_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(>>, __shift_right)
+
+#undef _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT
+
+#define _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(_Op, _Name) \
+ template<class _Tp> template<class _Dom> \
+ inline valarray<_Tp>& \
+ valarray<_Tp>::operator _Op##=(const _Expr<_Dom, _Tp>& __e) \
+ { \
+ _Array_augmented_##_Name(_Array<_Tp>(_M_data), __e, _M_size); \
+ return *this; \
+ }
+
+_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(+, __plus)
+_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(-, __minus)
+_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(*, __multiplies)
+_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(/, __divides)
+_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(%, __modulus)
+_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(^, __bitwise_xor)
+_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(&, __bitwise_and)
+_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(|, __bitwise_or)
+_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(<<, __shift_left)
+_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(>>, __shift_right)
+
+#undef _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT
+
+
+#define _DEFINE_BINARY_OPERATOR(_Op, _Name) \
+ template<typename _Tp> \
+ inline _Expr<_BinClos<_Name, _ValArray, _ValArray, _Tp, _Tp>, \
+ typename __fun<_Name, _Tp>::result_type> \
+ operator _Op(const valarray<_Tp>& __v, const valarray<_Tp>& __w) \
+ { \
+ _GLIBCXX_DEBUG_ASSERT(__v.size() == __w.size()); \
+ typedef _BinClos<_Name, _ValArray, _ValArray, _Tp, _Tp> _Closure; \
+ typedef typename __fun<_Name, _Tp>::result_type _Rt; \
+ return _Expr<_Closure, _Rt>(_Closure(__v, __w)); \
+ } \
+ \
+ template<typename _Tp> \
+ inline _Expr<_BinClos<_Name, _ValArray,_Constant, _Tp, _Tp>, \
+ typename __fun<_Name, _Tp>::result_type> \
+ operator _Op(const valarray<_Tp>& __v, const _Tp& __t) \
+ { \
+ typedef _BinClos<_Name, _ValArray, _Constant, _Tp, _Tp> _Closure; \
+ typedef typename __fun<_Name, _Tp>::result_type _Rt; \
+ return _Expr<_Closure, _Rt>(_Closure(__v, __t)); \
+ } \
+ \
+ template<typename _Tp> \
+ inline _Expr<_BinClos<_Name, _Constant, _ValArray, _Tp, _Tp>, \
+ typename __fun<_Name, _Tp>::result_type> \
+ operator _Op(const _Tp& __t, const valarray<_Tp>& __v) \
+ { \
+ typedef _BinClos<_Name, _Constant, _ValArray, _Tp, _Tp> _Closure; \
+ typedef typename __fun<_Name, _Tp>::result_type _Rt; \
+ return _Expr<_Closure, _Rt>(_Closure(__t, __v)); \
+ }
+
+_DEFINE_BINARY_OPERATOR(+, __plus)
+_DEFINE_BINARY_OPERATOR(-, __minus)
+_DEFINE_BINARY_OPERATOR(*, __multiplies)
+_DEFINE_BINARY_OPERATOR(/, __divides)
+_DEFINE_BINARY_OPERATOR(%, __modulus)
+_DEFINE_BINARY_OPERATOR(^, __bitwise_xor)
+_DEFINE_BINARY_OPERATOR(&, __bitwise_and)
+_DEFINE_BINARY_OPERATOR(|, __bitwise_or)
+_DEFINE_BINARY_OPERATOR(<<, __shift_left)
+_DEFINE_BINARY_OPERATOR(>>, __shift_right)
+_DEFINE_BINARY_OPERATOR(&&, __logical_and)
+_DEFINE_BINARY_OPERATOR(||, __logical_or)
+_DEFINE_BINARY_OPERATOR(==, __equal_to)
+_DEFINE_BINARY_OPERATOR(!=, __not_equal_to)
+_DEFINE_BINARY_OPERATOR(<, __less)
+_DEFINE_BINARY_OPERATOR(>, __greater)
+_DEFINE_BINARY_OPERATOR(<=, __less_equal)
+_DEFINE_BINARY_OPERATOR(>=, __greater_equal)
+
+#undef _DEFINE_BINARY_OPERATOR
+
+ // @} group numeric_arrays
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _GLIBCXX_VALARRAY */
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/vector b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/vector
new file mode 100644
index 0000000..114665b
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/include/c++/4.4.2/vector
@@ -0,0 +1,77 @@
+// <vector> -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/** @file include/vector
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_VECTOR
+#define _GLIBCXX_VECTOR 1
+
+#pragma GCC system_header
+
+#include <bits/stl_algobase.h>
+#include <bits/allocator.h>
+#include <bits/stl_construct.h>
+#include <bits/stl_uninitialized.h>
+#include <bits/stl_vector.h>
+#include <bits/stl_bvector.h>
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <bits/vector.tcc>
+#endif
+
+#ifdef _GLIBCXX_DEBUG
+# include <debug/vector>
+#endif
+
+#endif /* _GLIBCXX_VECTOR */
+
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgcc_s.so b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgcc_s.so
new file mode 120000
index 0000000..83033f7
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgcc_s.so
@@ -0,0 +1 @@
+libgcc_s.so.1 \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgcc_s.so.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgcc_s.so.1
new file mode 100644
index 0000000..b951c7a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgcc_s.so.1
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.a b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.a
new file mode 100644
index 0000000..c8c8a01
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.a
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.la b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.la
new file mode 100755
index 0000000..226a0d2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.la
@@ -0,0 +1,41 @@
+# libgomp.la - a libtool library file
+# Generated by ltmain.sh (GNU libtool) 2.2.6
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='libgomp.so.1'
+
+# Names of this library.
+library_names='libgomp.so.1.0.0 libgomp.so.1 libgomp.so'
+
+# The name of the static archive.
+old_library='libgomp.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=''
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libgomp.
+current=1
+age=0
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/usr/mips-linux-uclibc/lib'
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.so b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.so
new file mode 120000
index 0000000..c5be39e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.so
@@ -0,0 +1 @@
+libgomp.so.1.0.0 \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.so.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.so.1
new file mode 120000
index 0000000..c5be39e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.so.1
@@ -0,0 +1 @@
+libgomp.so.1.0.0 \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.so.1.0.0 b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.so.1.0.0
new file mode 100755
index 0000000..fa58c48
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.so.1.0.0
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.spec b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.spec
new file mode 100644
index 0000000..7102255
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libgomp.spec
@@ -0,0 +1,3 @@
+# This spec file is read by gcc when linking. It is used to specify the
+# standard libraries we need in order to link with -fopenmp.
+*link_gomp: -lgomp %{static: }
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libiberty.a b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libiberty.a
new file mode 100644
index 0000000..2e6ef2e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libiberty.a
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflap.a b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflap.a
new file mode 100644
index 0000000..cb86636
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflap.a
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflap.la b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflap.la
new file mode 100755
index 0000000..f55e2b0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflap.la
@@ -0,0 +1,41 @@
+# libmudflap.la - a libtool library file
+# Generated by ltmain.sh (GNU libtool) 2.2.6
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='libmudflap.so.0'
+
+# Names of this library.
+library_names='libmudflap.so.0.0.0 libmudflap.so.0 libmudflap.so'
+
+# The name of the static archive.
+old_library='libmudflap.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=' -ldl'
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libmudflap.
+current=0
+age=0
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/usr/mips-linux-uclibc/lib'
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflap.so b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflap.so
new file mode 120000
index 0000000..7e6932a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflap.so
@@ -0,0 +1 @@
+libmudflap.so.0.0.0 \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflap.so.0 b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflap.so.0
new file mode 120000
index 0000000..7e6932a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflap.so.0
@@ -0,0 +1 @@
+libmudflap.so.0.0.0 \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflap.so.0.0.0 b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflap.so.0.0.0
new file mode 100755
index 0000000..b6d3003
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflap.so.0.0.0
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflapth.a b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflapth.a
new file mode 100644
index 0000000..257aa71
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflapth.a
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflapth.la b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflapth.la
new file mode 100755
index 0000000..44c931e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflapth.la
@@ -0,0 +1,41 @@
+# libmudflapth.la - a libtool library file
+# Generated by ltmain.sh (GNU libtool) 2.2.6
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='libmudflapth.so.0'
+
+# Names of this library.
+library_names='libmudflapth.so.0.0.0 libmudflapth.so.0 libmudflapth.so'
+
+# The name of the static archive.
+old_library='libmudflapth.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=' -ldl'
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libmudflapth.
+current=0
+age=0
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/usr/mips-linux-uclibc/lib'
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflapth.so b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflapth.so
new file mode 120000
index 0000000..2857f7e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflapth.so
@@ -0,0 +1 @@
+libmudflapth.so.0.0.0 \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflapth.so.0 b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflapth.so.0
new file mode 120000
index 0000000..2857f7e
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflapth.so.0
@@ -0,0 +1 @@
+libmudflapth.so.0.0.0 \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflapth.so.0.0.0 b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflapth.so.0.0.0
new file mode 100755
index 0000000..c7aa058
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libmudflapth.so.0.0.0
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libstdc++.a b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libstdc++.a
new file mode 100644
index 0000000..666a7aa
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libstdc++.a
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libstdc++.la b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libstdc++.la
new file mode 100755
index 0000000..8915e81
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libstdc++.la
@@ -0,0 +1,41 @@
+# libstdc++.la - a libtool library file
+# Generated by ltmain.sh (GNU libtool) 2.2.6
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='libstdc++.so.6'
+
+# Names of this library.
+library_names='libstdc++.so.6.0.13 libstdc++.so.6 libstdc++.so'
+
+# The name of the static archive.
+old_library='libstdc++.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=' -lm'
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libstdc++.
+current=6
+age=0
+revision=13
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/usr/mips-linux-uclibc/lib'
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libstdc++.so b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libstdc++.so
new file mode 120000
index 0000000..a9430f1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libstdc++.so
@@ -0,0 +1 @@
+libstdc++.so.6.0.13 \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libstdc++.so.6 b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libstdc++.so.6
new file mode 120000
index 0000000..a9430f1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libstdc++.so.6
@@ -0,0 +1 @@
+libstdc++.so.6.0.13 \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libstdc++.so.6.0.13 b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libstdc++.so.6.0.13
new file mode 100755
index 0000000..f164d62
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libstdc++.so.6.0.13
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libsupc++.a b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libsupc++.a
new file mode 100644
index 0000000..630ff0f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libsupc++.a
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libsupc++.la b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libsupc++.la
new file mode 100755
index 0000000..6443db9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/lib/libsupc++.la
@@ -0,0 +1,41 @@
+# libsupc++.la - a libtool library file
+# Generated by ltmain.sh (GNU libtool) 2.2.6
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname=''
+
+# Names of this library.
+library_names=''
+
+# The name of the static archive.
+old_library='libsupc++.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=''
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libsupc++.
+current=0
+age=0
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/usr/mips-linux-uclibc/lib'
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/sys-include b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/sys-include
new file mode 120000
index 0000000..3a1af68
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/sys-include
@@ -0,0 +1 @@
+../include/ \ No newline at end of file
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/target_utils/gdbserver b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/target_utils/gdbserver
new file mode 100755
index 0000000..ec6604c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/target_utils/gdbserver
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/target_utils/ldd b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/target_utils/ldd
new file mode 100755
index 0000000..77b6628
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/mips-linux-uclibc/target_utils/ldd
Binary files differ
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/as.info b/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/as.info
new file mode 100644
index 0000000..a8d3810
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/as.info
@@ -0,0 +1,22073 @@
+This is as.info, produced by makeinfo version 4.8 from as.texinfo.
+
+START-INFO-DIR-ENTRY
+* As: (as). The GNU assembler.
+* Gas: (as). The GNU assembler.
+END-INFO-DIR-ENTRY
+
+ This file documents the GNU Assembler "as".
+
+ Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002,
+2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.3 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+Texts. A copy of the license is included in the section entitled "GNU
+Free Documentation License".
+
+
+File: as.info, Node: Top, Next: Overview, Up: (dir)
+
+Using as
+********
+
+This file is a user guide to the GNU assembler `as' (GNU Binutils)
+version 2.20.
+
+ This document is distributed under the terms of the GNU Free
+Documentation License. A copy of the license is included in the
+section entitled "GNU Free Documentation License".
+
+* Menu:
+
+* Overview:: Overview
+* Invoking:: Command-Line Options
+* Syntax:: Syntax
+* Sections:: Sections and Relocation
+* Symbols:: Symbols
+* Expressions:: Expressions
+* Pseudo Ops:: Assembler Directives
+
+* Object Attributes:: Object Attributes
+* Machine Dependencies:: Machine Dependent Features
+* Reporting Bugs:: Reporting Bugs
+* Acknowledgements:: Who Did What
+* GNU Free Documentation License:: GNU Free Documentation License
+* AS Index:: AS Index
+
+
+File: as.info, Node: Overview, Next: Invoking, Prev: Top, Up: Top
+
+1 Overview
+**********
+
+Here is a brief summary of how to invoke `as'. For details, see *Note
+Command-Line Options: Invoking.
+
+ as [-a[cdghlns][=FILE]] [-alternate] [-D]
+ [-debug-prefix-map OLD=NEW]
+ [-defsym SYM=VAL] [-f] [-g] [-gstabs]
+ [-gstabs+] [-gdwarf-2] [-help] [-I DIR] [-J]
+ [-K] [-L] [-listing-lhs-width=NUM]
+ [-listing-lhs-width2=NUM] [-listing-rhs-width=NUM]
+ [-listing-cont-lines=NUM] [-keep-locals] [-o
+ OBJFILE] [-R] [-reduce-memory-overheads] [-statistics]
+ [-v] [-version] [-version] [-W] [-warn]
+ [-fatal-warnings] [-w] [-x] [-Z] [@FILE]
+ [-target-help] [TARGET-OPTIONS]
+ [-|FILES ...]
+
+ _Target Alpha options:_
+ [-mCPU]
+ [-mdebug | -no-mdebug]
+ [-replace | -noreplace]
+ [-relax] [-g] [-GSIZE]
+ [-F] [-32addr]
+
+ _Target ARC options:_
+ [-marc[5|6|7|8]]
+ [-EB|-EL]
+
+ _Target ARM options:_
+ [-mcpu=PROCESSOR[+EXTENSION...]]
+ [-march=ARCHITECTURE[+EXTENSION...]]
+ [-mfpu=FLOATING-POINT-FORMAT]
+ [-mfloat-abi=ABI]
+ [-meabi=VER]
+ [-mthumb]
+ [-EB|-EL]
+ [-mapcs-32|-mapcs-26|-mapcs-float|
+ -mapcs-reentrant]
+ [-mthumb-interwork] [-k]
+
+ _Target CRIS options:_
+ [-underscore | -no-underscore]
+ [-pic] [-N]
+ [-emulation=criself | -emulation=crisaout]
+ [-march=v0_v10 | -march=v10 | -march=v32 | -march=common_v10_v32]
+
+ _Target D10V options:_
+ [-O]
+
+ _Target D30V options:_
+ [-O|-n|-N]
+
+ _Target H8/300 options:_
+ [-h-tick-hex]
+
+ _Target i386 options:_
+ [-32|-64] [-n]
+ [-march=CPU[+EXTENSION...]] [-mtune=CPU]
+
+ _Target i960 options:_
+ [-ACA|-ACA_A|-ACB|-ACC|-AKA|-AKB|
+ -AKC|-AMC]
+ [-b] [-no-relax]
+
+ _Target IA-64 options:_
+ [-mconstant-gp|-mauto-pic]
+ [-milp32|-milp64|-mlp64|-mp64]
+ [-mle|mbe]
+ [-mtune=itanium1|-mtune=itanium2]
+ [-munwind-check=warning|-munwind-check=error]
+ [-mhint.b=ok|-mhint.b=warning|-mhint.b=error]
+ [-x|-xexplicit] [-xauto] [-xdebug]
+
+ _Target IP2K options:_
+ [-mip2022|-mip2022ext]
+
+ _Target M32C options:_
+ [-m32c|-m16c] [-relax] [-h-tick-hex]
+
+ _Target M32R options:_
+ [-m32rx|-[no-]warn-explicit-parallel-conflicts|
+ -W[n]p]
+
+ _Target M680X0 options:_
+ [-l] [-m68000|-m68010|-m68020|...]
+
+ _Target M68HC11 options:_
+ [-m68hc11|-m68hc12|-m68hcs12]
+ [-mshort|-mlong]
+ [-mshort-double|-mlong-double]
+ [-force-long-branches] [-short-branches]
+ [-strict-direct-mode] [-print-insn-syntax]
+ [-print-opcodes] [-generate-example]
+
+ _Target MCORE options:_
+ [-jsri2bsr] [-sifilter] [-relax]
+ [-mcpu=[210|340]]
+ _Target MICROBLAZE options:_
+
+ _Target MIPS options:_
+ [-nocpp] [-EL] [-EB] [-O[OPTIMIZATION LEVEL]]
+ [-g[DEBUG LEVEL]] [-G NUM] [-KPIC] [-call_shared]
+ [-non_shared] [-xgot [-mvxworks-pic]
+ [-mabi=ABI] [-32] [-n32] [-64] [-mfp32] [-mgp32]
+ [-march=CPU] [-mtune=CPU] [-mips1] [-mips2]
+ [-mips3] [-mips4] [-mips5] [-mips32] [-mips32r2]
+ [-mips64] [-mips64r2]
+ [-construct-floats] [-no-construct-floats]
+ [-trap] [-no-break] [-break] [-no-trap]
+ [-mfix7000] [-mno-fix7000]
+ [-mips16] [-no-mips16]
+ [-msmartmips] [-mno-smartmips]
+ [-mips3d] [-no-mips3d]
+ [-mdmx] [-no-mdmx]
+ [-mdsp] [-mno-dsp]
+ [-mdspr2] [-mno-dspr2]
+ [-mmt] [-mno-mt]
+ [-mdebug] [-no-mdebug]
+ [-mpdr] [-mno-pdr]
+
+ _Target MMIX options:_
+ [-fixed-special-register-names] [-globalize-symbols]
+ [-gnu-syntax] [-relax] [-no-predefined-symbols]
+ [-no-expand] [-no-merge-gregs] [-x]
+ [-linker-allocated-gregs]
+
+ _Target PDP11 options:_
+ [-mpic|-mno-pic] [-mall] [-mno-extensions]
+ [-mEXTENSION|-mno-EXTENSION]
+ [-mCPU] [-mMACHINE]
+
+ _Target picoJava options:_
+ [-mb|-me]
+
+ _Target PowerPC options:_
+ [-mpwrx|-mpwr2|-mpwr|-m601|-mppc|-mppc32|-m603|-m604|
+ -m403|-m405|-mppc64|-m620|-mppc64bridge|-mbooke]
+ [-mcom|-many|-maltivec|-mvsx] [-memb]
+ [-mregnames|-mno-regnames]
+ [-mrelocatable|-mrelocatable-lib]
+ [-mlittle|-mlittle-endian|-mbig|-mbig-endian]
+ [-msolaris|-mno-solaris]
+
+ _Target s390 options:_
+ [-m31|-m64] [-mesa|-mzarch] [-march=CPU]
+ [-mregnames|-mno-regnames]
+ [-mwarn-areg-zero]
+
+ _Target SCORE options:_
+ [-EB][-EL][-FIXDD][-NWARN]
+ [-SCORE5][-SCORE5U][-SCORE7][-SCORE3]
+ [-march=score7][-march=score3]
+ [-USE_R1][-KPIC][-O0][-G NUM][-V]
+
+ _Target SPARC options:_
+ [-Av6|-Av7|-Av8|-Asparclet|-Asparclite
+ -Av8plus|-Av8plusa|-Av9|-Av9a]
+ [-xarch=v8plus|-xarch=v8plusa] [-bump]
+ [-32|-64]
+
+ _Target TIC54X options:_
+ [-mcpu=54[123589]|-mcpu=54[56]lp] [-mfar-mode|-mf]
+ [-merrors-to-file <FILENAME>|-me <FILENAME>]
+
+
+ _Target Z80 options:_
+ [-z80] [-r800]
+ [ -ignore-undocumented-instructions] [-Wnud]
+ [ -ignore-unportable-instructions] [-Wnup]
+ [ -warn-undocumented-instructions] [-Wud]
+ [ -warn-unportable-instructions] [-Wup]
+ [ -forbid-undocumented-instructions] [-Fud]
+ [ -forbid-unportable-instructions] [-Fup]
+
+
+ _Target Xtensa options:_
+ [-[no-]text-section-literals] [-[no-]absolute-literals]
+ [-[no-]target-align] [-[no-]longcalls]
+ [-[no-]transform]
+ [-rename-section OLDNAME=NEWNAME]
+
+`@FILE'
+ Read command-line options from FILE. The options read are
+ inserted in place of the original @FILE option. If FILE does not
+ exist, or cannot be read, then the option will be treated
+ literally, and not removed.
+
+ Options in FILE are separated by whitespace. A whitespace
+ character may be included in an option by surrounding the entire
+ option in either single or double quotes. Any character
+ (including a backslash) may be included by prefixing the character
+ to be included with a backslash. The FILE may itself contain
+ additional @FILE options; any such options will be processed
+ recursively.
+
+`-a[cdghlmns]'
+ Turn on listings, in any of a variety of ways:
+
+ `-ac'
+ omit false conditionals
+
+ `-ad'
+ omit debugging directives
+
+ `-ag'
+ include general information, like as version and options
+ passed
+
+ `-ah'
+ include high-level source
+
+ `-al'
+ include assembly
+
+ `-am'
+ include macro expansions
+
+ `-an'
+ omit forms processing
+
+ `-as'
+ include symbols
+
+ `=file'
+ set the name of the listing file
+
+ You may combine these options; for example, use `-aln' for assembly
+ listing without forms processing. The `=file' option, if used,
+ must be the last one. By itself, `-a' defaults to `-ahls'.
+
+`--alternate'
+ Begin in alternate macro mode. *Note `.altmacro': Altmacro.
+
+`-D'
+ Ignored. This option is accepted for script compatibility with
+ calls to other assemblers.
+
+`--debug-prefix-map OLD=NEW'
+ When assembling files in directory `OLD', record debugging
+ information describing them as in `NEW' instead.
+
+`--defsym SYM=VALUE'
+ Define the symbol SYM to be VALUE before assembling the input file.
+ VALUE must be an integer constant. As in C, a leading `0x'
+ indicates a hexadecimal value, and a leading `0' indicates an octal
+ value. The value of the symbol can be overridden inside a source
+ file via the use of a `.set' pseudo-op.
+
+`-f'
+ "fast"--skip whitespace and comment preprocessing (assume source is
+ compiler output).
+
+`-g'
+`--gen-debug'
+ Generate debugging information for each assembler source line
+ using whichever debug format is preferred by the target. This
+ currently means either STABS, ECOFF or DWARF2.
+
+`--gstabs'
+ Generate stabs debugging information for each assembler line. This
+ may help debugging assembler code, if the debugger can handle it.
+
+`--gstabs+'
+ Generate stabs debugging information for each assembler line, with
+ GNU extensions that probably only gdb can handle, and that could
+ make other debuggers crash or refuse to read your program. This
+ may help debugging assembler code. Currently the only GNU
+ extension is the location of the current working directory at
+ assembling time.
+
+`--gdwarf-2'
+ Generate DWARF2 debugging information for each assembler line.
+ This may help debugging assembler code, if the debugger can handle
+ it. Note--this option is only supported by some targets, not all
+ of them.
+
+`--help'
+ Print a summary of the command line options and exit.
+
+`--target-help'
+ Print a summary of all target specific options and exit.
+
+`-I DIR'
+ Add directory DIR to the search list for `.include' directives.
+
+`-J'
+ Don't warn about signed overflow.
+
+`-K'
+ Issue warnings when difference tables altered for long
+ displacements.
+
+`-L'
+`--keep-locals'
+ Keep (in the symbol table) local symbols. These symbols start with
+ system-specific local label prefixes, typically `.L' for ELF
+ systems or `L' for traditional a.out systems. *Note Symbol
+ Names::.
+
+`--listing-lhs-width=NUMBER'
+ Set the maximum width, in words, of the output data column for an
+ assembler listing to NUMBER.
+
+`--listing-lhs-width2=NUMBER'
+ Set the maximum width, in words, of the output data column for
+ continuation lines in an assembler listing to NUMBER.
+
+`--listing-rhs-width=NUMBER'
+ Set the maximum width of an input source line, as displayed in a
+ listing, to NUMBER bytes.
+
+`--listing-cont-lines=NUMBER'
+ Set the maximum number of lines printed in a listing for a single
+ line of input to NUMBER + 1.
+
+`-o OBJFILE'
+ Name the object-file output from `as' OBJFILE.
+
+`-R'
+ Fold the data section into the text section.
+
+ Set the default size of GAS's hash tables to a prime number close
+ to NUMBER. Increasing this value can reduce the length of time it
+ takes the assembler to perform its tasks, at the expense of
+ increasing the assembler's memory requirements. Similarly
+ reducing this value can reduce the memory requirements at the
+ expense of speed.
+
+`--reduce-memory-overheads'
+ This option reduces GAS's memory requirements, at the expense of
+ making the assembly processes slower. Currently this switch is a
+ synonym for `--hash-size=4051', but in the future it may have
+ other effects as well.
+
+`--statistics'
+ Print the maximum space (in bytes) and total time (in seconds)
+ used by assembly.
+
+`--strip-local-absolute'
+ Remove local absolute symbols from the outgoing symbol table.
+
+`-v'
+`-version'
+ Print the `as' version.
+
+`--version'
+ Print the `as' version and exit.
+
+`-W'
+`--no-warn'
+ Suppress warning messages.
+
+`--fatal-warnings'
+ Treat warnings as errors.
+
+`--warn'
+ Don't suppress warning messages or treat them as errors.
+
+`-w'
+ Ignored.
+
+`-x'
+ Ignored.
+
+`-Z'
+ Generate an object file even after errors.
+
+`-- | FILES ...'
+ Standard input, or source files to assemble.
+
+
+ The following options are available when as is configured for an ARC
+processor.
+
+`-marc[5|6|7|8]'
+ This option selects the core processor variant.
+
+`-EB | -EL'
+ Select either big-endian (-EB) or little-endian (-EL) output.
+
+ The following options are available when as is configured for the ARM
+processor family.
+
+`-mcpu=PROCESSOR[+EXTENSION...]'
+ Specify which ARM processor variant is the target.
+
+`-march=ARCHITECTURE[+EXTENSION...]'
+ Specify which ARM architecture variant is used by the target.
+
+`-mfpu=FLOATING-POINT-FORMAT'
+ Select which Floating Point architecture is the target.
+
+`-mfloat-abi=ABI'
+ Select which floating point ABI is in use.
+
+`-mthumb'
+ Enable Thumb only instruction decoding.
+
+`-mapcs-32 | -mapcs-26 | -mapcs-float | -mapcs-reentrant'
+ Select which procedure calling convention is in use.
+
+`-EB | -EL'
+ Select either big-endian (-EB) or little-endian (-EL) output.
+
+`-mthumb-interwork'
+ Specify that the code has been generated with interworking between
+ Thumb and ARM code in mind.
+
+`-k'
+ Specify that PIC code has been generated.
+
+ See the info pages for documentation of the CRIS-specific options.
+
+ The following options are available when as is configured for a D10V
+processor.
+`-O'
+ Optimize output by parallelizing instructions.
+
+ The following options are available when as is configured for a D30V
+processor.
+`-O'
+ Optimize output by parallelizing instructions.
+
+`-n'
+ Warn when nops are generated.
+
+`-N'
+ Warn when a nop after a 32-bit multiply instruction is generated.
+
+ The following options are available when as is configured for the
+Intel 80960 processor.
+
+`-ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC'
+ Specify which variant of the 960 architecture is the target.
+
+`-b'
+ Add code to collect statistics about branches taken.
+
+`-no-relax'
+ Do not alter compare-and-branch instructions for long
+ displacements; error if necessary.
+
+
+ The following options are available when as is configured for the
+Ubicom IP2K series.
+
+`-mip2022ext'
+ Specifies that the extended IP2022 instructions are allowed.
+
+`-mip2022'
+ Restores the default behaviour, which restricts the permitted
+ instructions to just the basic IP2022 ones.
+
+
+ The following options are available when as is configured for the
+Renesas M32C and M16C processors.
+
+`-m32c'
+ Assemble M32C instructions.
+
+`-m16c'
+ Assemble M16C instructions (the default).
+
+`-relax'
+ Enable support for link-time relaxations.
+
+`-h-tick-hex'
+ Support H'00 style hex constants in addition to 0x00 style.
+
+
+ The following options are available when as is configured for the
+Renesas M32R (formerly Mitsubishi M32R) series.
+
+`--m32rx'
+ Specify which processor in the M32R family is the target. The
+ default is normally the M32R, but this option changes it to the
+ M32RX.
+
+`--warn-explicit-parallel-conflicts or --Wp'
+ Produce warning messages when questionable parallel constructs are
+ encountered.
+
+`--no-warn-explicit-parallel-conflicts or --Wnp'
+ Do not produce warning messages when questionable parallel
+ constructs are encountered.
+
+
+ The following options are available when as is configured for the
+Motorola 68000 series.
+
+`-l'
+ Shorten references to undefined symbols, to one word instead of
+ two.
+
+`-m68000 | -m68008 | -m68010 | -m68020 | -m68030'
+`| -m68040 | -m68060 | -m68302 | -m68331 | -m68332'
+`| -m68333 | -m68340 | -mcpu32 | -m5200'
+ Specify what processor in the 68000 family is the target. The
+ default is normally the 68020, but this can be changed at
+ configuration time.
+
+`-m68881 | -m68882 | -mno-68881 | -mno-68882'
+ The target machine does (or does not) have a floating-point
+ coprocessor. The default is to assume a coprocessor for 68020,
+ 68030, and cpu32. Although the basic 68000 is not compatible with
+ the 68881, a combination of the two can be specified, since it's
+ possible to do emulation of the coprocessor instructions with the
+ main processor.
+
+`-m68851 | -mno-68851'
+ The target machine does (or does not) have a memory-management
+ unit coprocessor. The default is to assume an MMU for 68020 and
+ up.
+
+
+ For details about the PDP-11 machine dependent features options, see
+*Note PDP-11-Options::.
+
+`-mpic | -mno-pic'
+ Generate position-independent (or position-dependent) code. The
+ default is `-mpic'.
+
+`-mall'
+`-mall-extensions'
+ Enable all instruction set extensions. This is the default.
+
+`-mno-extensions'
+ Disable all instruction set extensions.
+
+`-mEXTENSION | -mno-EXTENSION'
+ Enable (or disable) a particular instruction set extension.
+
+`-mCPU'
+ Enable the instruction set extensions supported by a particular
+ CPU, and disable all other extensions.
+
+`-mMACHINE'
+ Enable the instruction set extensions supported by a particular
+ machine model, and disable all other extensions.
+
+ The following options are available when as is configured for a
+picoJava processor.
+
+`-mb'
+ Generate "big endian" format output.
+
+`-ml'
+ Generate "little endian" format output.
+
+
+ The following options are available when as is configured for the
+Motorola 68HC11 or 68HC12 series.
+
+`-m68hc11 | -m68hc12 | -m68hcs12'
+ Specify what processor is the target. The default is defined by
+ the configuration option when building the assembler.
+
+`-mshort'
+ Specify to use the 16-bit integer ABI.
+
+`-mlong'
+ Specify to use the 32-bit integer ABI.
+
+`-mshort-double'
+ Specify to use the 32-bit double ABI.
+
+`-mlong-double'
+ Specify to use the 64-bit double ABI.
+
+`--force-long-branches'
+ Relative branches are turned into absolute ones. This concerns
+ conditional branches, unconditional branches and branches to a sub
+ routine.
+
+`-S | --short-branches'
+ Do not turn relative branches into absolute ones when the offset
+ is out of range.
+
+`--strict-direct-mode'
+ Do not turn the direct addressing mode into extended addressing
+ mode when the instruction does not support direct addressing mode.
+
+`--print-insn-syntax'
+ Print the syntax of instruction in case of error.
+
+`--print-opcodes'
+ print the list of instructions with syntax and then exit.
+
+`--generate-example'
+ print an example of instruction for each possible instruction and
+ then exit. This option is only useful for testing `as'.
+
+
+ The following options are available when `as' is configured for the
+SPARC architecture:
+
+`-Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite'
+`-Av8plus | -Av8plusa | -Av9 | -Av9a'
+ Explicitly select a variant of the SPARC architecture.
+
+ `-Av8plus' and `-Av8plusa' select a 32 bit environment. `-Av9'
+ and `-Av9a' select a 64 bit environment.
+
+ `-Av8plusa' and `-Av9a' enable the SPARC V9 instruction set with
+ UltraSPARC extensions.
+
+`-xarch=v8plus | -xarch=v8plusa'
+ For compatibility with the Solaris v9 assembler. These options are
+ equivalent to -Av8plus and -Av8plusa, respectively.
+
+`-bump'
+ Warn when the assembler switches to another architecture.
+
+ The following options are available when as is configured for the
+'c54x architecture.
+
+`-mfar-mode'
+ Enable extended addressing mode. All addresses and relocations
+ will assume extended addressing (usually 23 bits).
+
+`-mcpu=CPU_VERSION'
+ Sets the CPU version being compiled for.
+
+`-merrors-to-file FILENAME'
+ Redirect error output to a file, for broken systems which don't
+ support such behaviour in the shell.
+
+ The following options are available when as is configured for a MIPS
+processor.
+
+`-G NUM'
+ This option sets the largest size of an object that can be
+ referenced implicitly with the `gp' register. It is only accepted
+ for targets that use ECOFF format, such as a DECstation running
+ Ultrix. The default value is 8.
+
+`-EB'
+ Generate "big endian" format output.
+
+`-EL'
+ Generate "little endian" format output.
+
+`-mips1'
+`-mips2'
+`-mips3'
+`-mips4'
+`-mips5'
+`-mips32'
+`-mips32r2'
+`-mips64'
+`-mips64r2'
+ Generate code for a particular MIPS Instruction Set Architecture
+ level. `-mips1' is an alias for `-march=r3000', `-mips2' is an
+ alias for `-march=r6000', `-mips3' is an alias for `-march=r4000'
+ and `-mips4' is an alias for `-march=r8000'. `-mips5', `-mips32',
+ `-mips32r2', `-mips64', and `-mips64r2' correspond to generic
+ `MIPS V', `MIPS32', `MIPS32 Release 2', `MIPS64', and `MIPS64
+ Release 2' ISA processors, respectively.
+
+`-march=CPU'
+ Generate code for a particular MIPS cpu.
+
+`-mtune=CPU'
+ Schedule and tune for a particular MIPS cpu.
+
+`-mfix7000'
+`-mno-fix7000'
+ Cause nops to be inserted if the read of the destination register
+ of an mfhi or mflo instruction occurs in the following two
+ instructions.
+
+`-mdebug'
+`-no-mdebug'
+ Cause stabs-style debugging output to go into an ECOFF-style
+ .mdebug section instead of the standard ELF .stabs sections.
+
+`-mpdr'
+`-mno-pdr'
+ Control generation of `.pdr' sections.
+
+`-mgp32'
+`-mfp32'
+ The register sizes are normally inferred from the ISA and ABI, but
+ these flags force a certain group of registers to be treated as 32
+ bits wide at all times. `-mgp32' controls the size of
+ general-purpose registers and `-mfp32' controls the size of
+ floating-point registers.
+
+`-mips16'
+`-no-mips16'
+ Generate code for the MIPS 16 processor. This is equivalent to
+ putting `.set mips16' at the start of the assembly file.
+ `-no-mips16' turns off this option.
+
+`-msmartmips'
+`-mno-smartmips'
+ Enables the SmartMIPS extension to the MIPS32 instruction set.
+ This is equivalent to putting `.set smartmips' at the start of the
+ assembly file. `-mno-smartmips' turns off this option.
+
+`-mips3d'
+`-no-mips3d'
+ Generate code for the MIPS-3D Application Specific Extension.
+ This tells the assembler to accept MIPS-3D instructions.
+ `-no-mips3d' turns off this option.
+
+`-mdmx'
+`-no-mdmx'
+ Generate code for the MDMX Application Specific Extension. This
+ tells the assembler to accept MDMX instructions. `-no-mdmx' turns
+ off this option.
+
+`-mdsp'
+`-mno-dsp'
+ Generate code for the DSP Release 1 Application Specific Extension.
+ This tells the assembler to accept DSP Release 1 instructions.
+ `-mno-dsp' turns off this option.
+
+`-mdspr2'
+`-mno-dspr2'
+ Generate code for the DSP Release 2 Application Specific Extension.
+ This option implies -mdsp. This tells the assembler to accept DSP
+ Release 2 instructions. `-mno-dspr2' turns off this option.
+
+`-mmt'
+`-mno-mt'
+ Generate code for the MT Application Specific Extension. This
+ tells the assembler to accept MT instructions. `-mno-mt' turns
+ off this option.
+
+`--construct-floats'
+`--no-construct-floats'
+ The `--no-construct-floats' option disables the construction of
+ double width floating point constants by loading the two halves of
+ the value into the two single width floating point registers that
+ make up the double width register. By default
+ `--construct-floats' is selected, allowing construction of these
+ floating point constants.
+
+`--emulation=NAME'
+ This option causes `as' to emulate `as' configured for some other
+ target, in all respects, including output format (choosing between
+ ELF and ECOFF only), handling of pseudo-opcodes which may generate
+ debugging information or store symbol table information, and
+ default endianness. The available configuration names are:
+ `mipsecoff', `mipself', `mipslecoff', `mipsbecoff', `mipslelf',
+ `mipsbelf'. The first two do not alter the default endianness
+ from that of the primary target for which the assembler was
+ configured; the others change the default to little- or big-endian
+ as indicated by the `b' or `l' in the name. Using `-EB' or `-EL'
+ will override the endianness selection in any case.
+
+ This option is currently supported only when the primary target
+ `as' is configured for is a MIPS ELF or ECOFF target.
+ Furthermore, the primary target or others specified with
+ `--enable-targets=...' at configuration time must include support
+ for the other format, if both are to be available. For example,
+ the Irix 5 configuration includes support for both.
+
+ Eventually, this option will support more configurations, with more
+ fine-grained control over the assembler's behavior, and will be
+ supported for more processors.
+
+`-nocpp'
+ `as' ignores this option. It is accepted for compatibility with
+ the native tools.
+
+`--trap'
+`--no-trap'
+`--break'
+`--no-break'
+ Control how to deal with multiplication overflow and division by
+ zero. `--trap' or `--no-break' (which are synonyms) take a trap
+ exception (and only work for Instruction Set Architecture level 2
+ and higher); `--break' or `--no-trap' (also synonyms, and the
+ default) take a break exception.
+
+`-n'
+ When this option is used, `as' will issue a warning every time it
+ generates a nop instruction from a macro.
+
+ The following options are available when as is configured for an
+MCore processor.
+
+`-jsri2bsr'
+`-nojsri2bsr'
+ Enable or disable the JSRI to BSR transformation. By default this
+ is enabled. The command line option `-nojsri2bsr' can be used to
+ disable it.
+
+`-sifilter'
+`-nosifilter'
+ Enable or disable the silicon filter behaviour. By default this
+ is disabled. The default can be overridden by the `-sifilter'
+ command line option.
+
+`-relax'
+ Alter jump instructions for long displacements.
+
+`-mcpu=[210|340]'
+ Select the cpu type on the target hardware. This controls which
+ instructions can be assembled.
+
+`-EB'
+ Assemble for a big endian target.
+
+`-EL'
+ Assemble for a little endian target.
+
+
+ See the info pages for documentation of the MMIX-specific options.
+
+ The following options are available when as is configured for the
+s390 processor family.
+
+`-m31'
+`-m64'
+ Select the word size, either 31/32 bits or 64 bits.
+
+`-mesa'
+
+`-mzarch'
+ Select the architecture mode, either the Enterprise System
+ Architecture (esa) or the z/Architecture mode (zarch).
+
+`-march=PROCESSOR'
+ Specify which s390 processor variant is the target, `g6', `g6',
+ `z900', `z990', `z9-109', `z9-ec', or `z10'.
+
+`-mregnames'
+`-mno-regnames'
+ Allow or disallow symbolic names for registers.
+
+`-mwarn-areg-zero'
+ Warn whenever the operand for a base or index register has been
+ specified but evaluates to zero.
+
+ The following options are available when as is configured for an
+Xtensa processor.
+
+`--text-section-literals | --no-text-section-literals'
+ With `--text-section-literals', literal pools are interspersed in
+ the text section. The default is `--no-text-section-literals',
+ which places literals in a separate section in the output file.
+ These options only affect literals referenced via PC-relative
+ `L32R' instructions; literals for absolute mode `L32R'
+ instructions are handled separately.
+
+`--absolute-literals | --no-absolute-literals'
+ Indicate to the assembler whether `L32R' instructions use absolute
+ or PC-relative addressing. The default is to assume absolute
+ addressing if the Xtensa processor includes the absolute `L32R'
+ addressing option. Otherwise, only the PC-relative `L32R' mode
+ can be used.
+
+`--target-align | --no-target-align'
+ Enable or disable automatic alignment to reduce branch penalties
+ at the expense of some code density. The default is
+ `--target-align'.
+
+`--longcalls | --no-longcalls'
+ Enable or disable transformation of call instructions to allow
+ calls across a greater range of addresses. The default is
+ `--no-longcalls'.
+
+`--transform | --no-transform'
+ Enable or disable all assembler transformations of Xtensa
+ instructions. The default is `--transform'; `--no-transform'
+ should be used only in the rare cases when the instructions must
+ be exactly as specified in the assembly source.
+
+`--rename-section OLDNAME=NEWNAME'
+ When generating output sections, rename the OLDNAME section to
+ NEWNAME.
+
+ The following options are available when as is configured for a Z80
+family processor.
+`-z80'
+ Assemble for Z80 processor.
+
+`-r800'
+ Assemble for R800 processor.
+
+`-ignore-undocumented-instructions'
+`-Wnud'
+ Assemble undocumented Z80 instructions that also work on R800
+ without warning.
+
+`-ignore-unportable-instructions'
+`-Wnup'
+ Assemble all undocumented Z80 instructions without warning.
+
+`-warn-undocumented-instructions'
+`-Wud'
+ Issue a warning for undocumented Z80 instructions that also work
+ on R800.
+
+`-warn-unportable-instructions'
+`-Wup'
+ Issue a warning for undocumented Z80 instructions that do not work
+ on R800.
+
+`-forbid-undocumented-instructions'
+`-Fud'
+ Treat all undocumented instructions as errors.
+
+`-forbid-unportable-instructions'
+`-Fup'
+ Treat undocumented Z80 instructions that do not work on R800 as
+ errors.
+
+* Menu:
+
+* Manual:: Structure of this Manual
+* GNU Assembler:: The GNU Assembler
+* Object Formats:: Object File Formats
+* Command Line:: Command Line
+* Input Files:: Input Files
+* Object:: Output (Object) File
+* Errors:: Error and Warning Messages
+
+
+File: as.info, Node: Manual, Next: GNU Assembler, Up: Overview
+
+1.1 Structure of this Manual
+============================
+
+This manual is intended to describe what you need to know to use GNU
+`as'. We cover the syntax expected in source files, including notation
+for symbols, constants, and expressions; the directives that `as'
+understands; and of course how to invoke `as'.
+
+ This manual also describes some of the machine-dependent features of
+various flavors of the assembler.
+
+ On the other hand, this manual is _not_ intended as an introduction
+to programming in assembly language--let alone programming in general!
+In a similar vein, we make no attempt to introduce the machine
+architecture; we do _not_ describe the instruction set, standard
+mnemonics, registers or addressing modes that are standard to a
+particular architecture. You may want to consult the manufacturer's
+machine architecture manual for this information.
+
+
+File: as.info, Node: GNU Assembler, Next: Object Formats, Prev: Manual, Up: Overview
+
+1.2 The GNU Assembler
+=====================
+
+GNU `as' is really a family of assemblers. If you use (or have used)
+the GNU assembler on one architecture, you should find a fairly similar
+environment when you use it on another architecture. Each version has
+much in common with the others, including object file formats, most
+assembler directives (often called "pseudo-ops") and assembler syntax.
+
+ `as' is primarily intended to assemble the output of the GNU C
+compiler `gcc' for use by the linker `ld'. Nevertheless, we've tried
+to make `as' assemble correctly everything that other assemblers for
+the same machine would assemble. Any exceptions are documented
+explicitly (*note Machine Dependencies::). This doesn't mean `as'
+always uses the same syntax as another assembler for the same
+architecture; for example, we know of several incompatible versions of
+680x0 assembly language syntax.
+
+ Unlike older assemblers, `as' is designed to assemble a source
+program in one pass of the source file. This has a subtle impact on the
+`.org' directive (*note `.org': Org.).
+
+
+File: as.info, Node: Object Formats, Next: Command Line, Prev: GNU Assembler, Up: Overview
+
+1.3 Object File Formats
+=======================
+
+The GNU assembler can be configured to produce several alternative
+object file formats. For the most part, this does not affect how you
+write assembly language programs; but directives for debugging symbols
+are typically different in different file formats. *Note Symbol
+Attributes: Symbol Attributes.
+
+
+File: as.info, Node: Command Line, Next: Input Files, Prev: Object Formats, Up: Overview
+
+1.4 Command Line
+================
+
+After the program name `as', the command line may contain options and
+file names. Options may appear in any order, and may be before, after,
+or between file names. The order of file names is significant.
+
+ `--' (two hyphens) by itself names the standard input file
+explicitly, as one of the files for `as' to assemble.
+
+ Except for `--' any command line argument that begins with a hyphen
+(`-') is an option. Each option changes the behavior of `as'. No
+option changes the way another option works. An option is a `-'
+followed by one or more letters; the case of the letter is important.
+All options are optional.
+
+ Some options expect exactly one file name to follow them. The file
+name may either immediately follow the option's letter (compatible with
+older assemblers) or it may be the next command argument (GNU
+standard). These two command lines are equivalent:
+
+ as -o my-object-file.o mumble.s
+ as -omy-object-file.o mumble.s
+
+
+File: as.info, Node: Input Files, Next: Object, Prev: Command Line, Up: Overview
+
+1.5 Input Files
+===============
+
+We use the phrase "source program", abbreviated "source", to describe
+the program input to one run of `as'. The program may be in one or
+more files; how the source is partitioned into files doesn't change the
+meaning of the source.
+
+ The source program is a concatenation of the text in all the files,
+in the order specified.
+
+ Each time you run `as' it assembles exactly one source program. The
+source program is made up of one or more files. (The standard input is
+also a file.)
+
+ You give `as' a command line that has zero or more input file names.
+The input files are read (from left file name to right). A command
+line argument (in any position) that has no special meaning is taken to
+be an input file name.
+
+ If you give `as' no file names it attempts to read one input file
+from the `as' standard input, which is normally your terminal. You may
+have to type <ctl-D> to tell `as' there is no more program to assemble.
+
+ Use `--' if you need to explicitly name the standard input file in
+your command line.
+
+ If the source is empty, `as' produces a small, empty object file.
+
+Filenames and Line-numbers
+--------------------------
+
+There are two ways of locating a line in the input file (or files) and
+either may be used in reporting error messages. One way refers to a
+line number in a physical file; the other refers to a line number in a
+"logical" file. *Note Error and Warning Messages: Errors.
+
+ "Physical files" are those files named in the command line given to
+`as'.
+
+ "Logical files" are simply names declared explicitly by assembler
+directives; they bear no relation to physical files. Logical file
+names help error messages reflect the original source file, when `as'
+source is itself synthesized from other files. `as' understands the
+`#' directives emitted by the `gcc' preprocessor. See also *Note
+`.file': File.
+
+
+File: as.info, Node: Object, Next: Errors, Prev: Input Files, Up: Overview
+
+1.6 Output (Object) File
+========================
+
+Every time you run `as' it produces an output file, which is your
+assembly language program translated into numbers. This file is the
+object file. Its default name is `a.out'. You can give it another
+name by using the `-o' option. Conventionally, object file names end
+with `.o'. The default name is used for historical reasons: older
+assemblers were capable of assembling self-contained programs directly
+into a runnable program. (For some formats, this isn't currently
+possible, but it can be done for the `a.out' format.)
+
+ The object file is meant for input to the linker `ld'. It contains
+assembled program code, information to help `ld' integrate the
+assembled program into a runnable file, and (optionally) symbolic
+information for the debugger.
+
+
+File: as.info, Node: Errors, Prev: Object, Up: Overview
+
+1.7 Error and Warning Messages
+==============================
+
+`as' may write warnings and error messages to the standard error file
+(usually your terminal). This should not happen when a compiler runs
+`as' automatically. Warnings report an assumption made so that `as'
+could keep assembling a flawed program; errors report a grave problem
+that stops the assembly.
+
+ Warning messages have the format
+
+ file_name:NNN:Warning Message Text
+
+(where NNN is a line number). If a logical file name has been given
+(*note `.file': File.) it is used for the filename, otherwise the name
+of the current input file is used. If a logical line number was given
+(*note `.line': Line.) then it is used to calculate the number printed,
+otherwise the actual line in the current source file is printed. The
+message text is intended to be self explanatory (in the grand Unix
+tradition).
+
+ Error messages have the format
+ file_name:NNN:FATAL:Error Message Text
+ The file name and line number are derived as for warning messages.
+The actual message text may be rather less explanatory because many of
+them aren't supposed to happen.
+
+
+File: as.info, Node: Invoking, Next: Syntax, Prev: Overview, Up: Top
+
+2 Command-Line Options
+**********************
+
+This chapter describes command-line options available in _all_ versions
+of the GNU assembler; see *Note Machine Dependencies::, for options
+specific to particular machine architectures.
+
+ If you are invoking `as' via the GNU C compiler, you can use the
+`-Wa' option to pass arguments through to the assembler. The assembler
+arguments must be separated from each other (and the `-Wa') by commas.
+For example:
+
+ gcc -c -g -O -Wa,-alh,-L file.c
+
+This passes two options to the assembler: `-alh' (emit a listing to
+standard output with high-level and assembly source) and `-L' (retain
+local symbols in the symbol table).
+
+ Usually you do not need to use this `-Wa' mechanism, since many
+compiler command-line options are automatically passed to the assembler
+by the compiler. (You can call the GNU compiler driver with the `-v'
+option to see precisely what options it passes to each compilation
+pass, including the assembler.)
+
+* Menu:
+
+* a:: -a[cdghlns] enable listings
+* alternate:: --alternate enable alternate macro syntax
+* D:: -D for compatibility
+* f:: -f to work faster
+* I:: -I for .include search path
+
+* K:: -K for difference tables
+
+* L:: -L to retain local symbols
+* listing:: --listing-XXX to configure listing output
+* M:: -M or --mri to assemble in MRI compatibility mode
+* MD:: --MD for dependency tracking
+* o:: -o to name the object file
+* R:: -R to join data and text sections
+* statistics:: --statistics to see statistics about assembly
+* traditional-format:: --traditional-format for compatible output
+* v:: -v to announce version
+* W:: -W, --no-warn, --warn, --fatal-warnings to control warnings
+* Z:: -Z to make object file even after errors
+
+
+File: as.info, Node: a, Next: alternate, Up: Invoking
+
+2.1 Enable Listings: `-a[cdghlns]'
+==================================
+
+These options enable listing output from the assembler. By itself,
+`-a' requests high-level, assembly, and symbols listing. You can use
+other letters to select specific options for the list: `-ah' requests a
+high-level language listing, `-al' requests an output-program assembly
+listing, and `-as' requests a symbol table listing. High-level
+listings require that a compiler debugging option like `-g' be used,
+and that assembly listings (`-al') be requested also.
+
+ Use the `-ag' option to print a first section with general assembly
+information, like as version, switches passed, or time stamp.
+
+ Use the `-ac' option to omit false conditionals from a listing. Any
+lines which are not assembled because of a false `.if' (or `.ifdef', or
+any other conditional), or a true `.if' followed by an `.else', will be
+omitted from the listing.
+
+ Use the `-ad' option to omit debugging directives from the listing.
+
+ Once you have specified one of these options, you can further control
+listing output and its appearance using the directives `.list',
+`.nolist', `.psize', `.eject', `.title', and `.sbttl'. The `-an'
+option turns off all forms processing. If you do not request listing
+output with one of the `-a' options, the listing-control directives
+have no effect.
+
+ The letters after `-a' may be combined into one option, _e.g._,
+`-aln'.
+
+ Note if the assembler source is coming from the standard input (e.g.,
+because it is being created by `gcc' and the `-pipe' command line switch
+is being used) then the listing will not contain any comments or
+preprocessor directives. This is because the listing code buffers
+input source lines from stdin only after they have been preprocessed by
+the assembler. This reduces memory usage and makes the code more
+efficient.
+
+
+File: as.info, Node: alternate, Next: D, Prev: a, Up: Invoking
+
+2.2 `--alternate'
+=================
+
+Begin in alternate macro mode, see *Note `.altmacro': Altmacro.
+
+
+File: as.info, Node: D, Next: f, Prev: alternate, Up: Invoking
+
+2.3 `-D'
+========
+
+This option has no effect whatsoever, but it is accepted to make it more
+likely that scripts written for other assemblers also work with `as'.
+
+
+File: as.info, Node: f, Next: I, Prev: D, Up: Invoking
+
+2.4 Work Faster: `-f'
+=====================
+
+`-f' should only be used when assembling programs written by a
+(trusted) compiler. `-f' stops the assembler from doing whitespace and
+comment preprocessing on the input file(s) before assembling them.
+*Note Preprocessing: Preprocessing.
+
+ _Warning:_ if you use `-f' when the files actually need to be
+ preprocessed (if they contain comments, for example), `as' does
+ not work correctly.
+
+
+File: as.info, Node: I, Next: K, Prev: f, Up: Invoking
+
+2.5 `.include' Search Path: `-I' PATH
+=====================================
+
+Use this option to add a PATH to the list of directories `as' searches
+for files specified in `.include' directives (*note `.include':
+Include.). You may use `-I' as many times as necessary to include a
+variety of paths. The current working directory is always searched
+first; after that, `as' searches any `-I' directories in the same order
+as they were specified (left to right) on the command line.
+
+
+File: as.info, Node: K, Next: L, Prev: I, Up: Invoking
+
+2.6 Difference Tables: `-K'
+===========================
+
+`as' sometimes alters the code emitted for directives of the form
+`.word SYM1-SYM2'. *Note `.word': Word. You can use the `-K' option
+if you want a warning issued when this is done.
+
+
+File: as.info, Node: L, Next: listing, Prev: K, Up: Invoking
+
+2.7 Include Local Symbols: `-L'
+===============================
+
+Symbols beginning with system-specific local label prefixes, typically
+`.L' for ELF systems or `L' for traditional a.out systems, are called
+"local symbols". *Note Symbol Names::. Normally you do not see such
+symbols when debugging, because they are intended for the use of
+programs (like compilers) that compose assembler programs, not for your
+notice. Normally both `as' and `ld' discard such symbols, so you do
+not normally debug with them.
+
+ This option tells `as' to retain those local symbols in the object
+file. Usually if you do this you also tell the linker `ld' to preserve
+those symbols.
+
+
+File: as.info, Node: listing, Next: M, Prev: L, Up: Invoking
+
+2.8 Configuring listing output: `--listing'
+===========================================
+
+The listing feature of the assembler can be enabled via the command
+line switch `-a' (*note a::). This feature combines the input source
+file(s) with a hex dump of the corresponding locations in the output
+object file, and displays them as a listing file. The format of this
+listing can be controlled by directives inside the assembler source
+(i.e., `.list' (*note List::), `.title' (*note Title::), `.sbttl'
+(*note Sbttl::), `.psize' (*note Psize::), and `.eject' (*note Eject::)
+and also by the following switches:
+
+`--listing-lhs-width=`number''
+ Sets the maximum width, in words, of the first line of the hex
+ byte dump. This dump appears on the left hand side of the listing
+ output.
+
+`--listing-lhs-width2=`number''
+ Sets the maximum width, in words, of any further lines of the hex
+ byte dump for a given input source line. If this value is not
+ specified, it defaults to being the same as the value specified
+ for `--listing-lhs-width'. If neither switch is used the default
+ is to one.
+
+`--listing-rhs-width=`number''
+ Sets the maximum width, in characters, of the source line that is
+ displayed alongside the hex dump. The default value for this
+ parameter is 100. The source line is displayed on the right hand
+ side of the listing output.
+
+`--listing-cont-lines=`number''
+ Sets the maximum number of continuation lines of hex dump that
+ will be displayed for a given single line of source input. The
+ default value is 4.
+
+
+File: as.info, Node: M, Next: MD, Prev: listing, Up: Invoking
+
+2.9 Assemble in MRI Compatibility Mode: `-M'
+============================================
+
+The `-M' or `--mri' option selects MRI compatibility mode. This
+changes the syntax and pseudo-op handling of `as' to make it compatible
+with the `ASM68K' or the `ASM960' (depending upon the configured
+target) assembler from Microtec Research. The exact nature of the MRI
+syntax will not be documented here; see the MRI manuals for more
+information. Note in particular that the handling of macros and macro
+arguments is somewhat different. The purpose of this option is to
+permit assembling existing MRI assembler code using `as'.
+
+ The MRI compatibility is not complete. Certain operations of the
+MRI assembler depend upon its object file format, and can not be
+supported using other object file formats. Supporting these would
+require enhancing each object file format individually. These are:
+
+ * global symbols in common section
+
+ The m68k MRI assembler supports common sections which are merged
+ by the linker. Other object file formats do not support this.
+ `as' handles common sections by treating them as a single common
+ symbol. It permits local symbols to be defined within a common
+ section, but it can not support global symbols, since it has no
+ way to describe them.
+
+ * complex relocations
+
+ The MRI assemblers support relocations against a negated section
+ address, and relocations which combine the start addresses of two
+ or more sections. These are not support by other object file
+ formats.
+
+ * `END' pseudo-op specifying start address
+
+ The MRI `END' pseudo-op permits the specification of a start
+ address. This is not supported by other object file formats. The
+ start address may instead be specified using the `-e' option to
+ the linker, or in a linker script.
+
+ * `IDNT', `.ident' and `NAME' pseudo-ops
+
+ The MRI `IDNT', `.ident' and `NAME' pseudo-ops assign a module
+ name to the output file. This is not supported by other object
+ file formats.
+
+ * `ORG' pseudo-op
+
+ The m68k MRI `ORG' pseudo-op begins an absolute section at a given
+ address. This differs from the usual `as' `.org' pseudo-op, which
+ changes the location within the current section. Absolute
+ sections are not supported by other object file formats. The
+ address of a section may be assigned within a linker script.
+
+ There are some other features of the MRI assembler which are not
+supported by `as', typically either because they are difficult or
+because they seem of little consequence. Some of these may be
+supported in future releases.
+
+ * EBCDIC strings
+
+ EBCDIC strings are not supported.
+
+ * packed binary coded decimal
+
+ Packed binary coded decimal is not supported. This means that the
+ `DC.P' and `DCB.P' pseudo-ops are not supported.
+
+ * `FEQU' pseudo-op
+
+ The m68k `FEQU' pseudo-op is not supported.
+
+ * `NOOBJ' pseudo-op
+
+ The m68k `NOOBJ' pseudo-op is not supported.
+
+ * `OPT' branch control options
+
+ The m68k `OPT' branch control options--`B', `BRS', `BRB', `BRL',
+ and `BRW'--are ignored. `as' automatically relaxes all branches,
+ whether forward or backward, to an appropriate size, so these
+ options serve no purpose.
+
+ * `OPT' list control options
+
+ The following m68k `OPT' list control options are ignored: `C',
+ `CEX', `CL', `CRE', `E', `G', `I', `M', `MEX', `MC', `MD', `X'.
+
+ * other `OPT' options
+
+ The following m68k `OPT' options are ignored: `NEST', `O', `OLD',
+ `OP', `P', `PCO', `PCR', `PCS', `R'.
+
+ * `OPT' `D' option is default
+
+ The m68k `OPT' `D' option is the default, unlike the MRI assembler.
+ `OPT NOD' may be used to turn it off.
+
+ * `XREF' pseudo-op.
+
+ The m68k `XREF' pseudo-op is ignored.
+
+ * `.debug' pseudo-op
+
+ The i960 `.debug' pseudo-op is not supported.
+
+ * `.extended' pseudo-op
+
+ The i960 `.extended' pseudo-op is not supported.
+
+ * `.list' pseudo-op.
+
+ The various options of the i960 `.list' pseudo-op are not
+ supported.
+
+ * `.optimize' pseudo-op
+
+ The i960 `.optimize' pseudo-op is not supported.
+
+ * `.output' pseudo-op
+
+ The i960 `.output' pseudo-op is not supported.
+
+ * `.setreal' pseudo-op
+
+ The i960 `.setreal' pseudo-op is not supported.
+
+
+
+File: as.info, Node: MD, Next: o, Prev: M, Up: Invoking
+
+2.10 Dependency Tracking: `--MD'
+================================
+
+`as' can generate a dependency file for the file it creates. This file
+consists of a single rule suitable for `make' describing the
+dependencies of the main source file.
+
+ The rule is written to the file named in its argument.
+
+ This feature is used in the automatic updating of makefiles.
+
+
+File: as.info, Node: o, Next: R, Prev: MD, Up: Invoking
+
+2.11 Name the Object File: `-o'
+===============================
+
+There is always one object file output when you run `as'. By default
+it has the name `a.out' (or `b.out', for Intel 960 targets only). You
+use this option (which takes exactly one filename) to give the object
+file a different name.
+
+ Whatever the object file is called, `as' overwrites any existing
+file of the same name.
+
+
+File: as.info, Node: R, Next: statistics, Prev: o, Up: Invoking
+
+2.12 Join Data and Text Sections: `-R'
+======================================
+
+`-R' tells `as' to write the object file as if all data-section data
+lives in the text section. This is only done at the very last moment:
+your binary data are the same, but data section parts are relocated
+differently. The data section part of your object file is zero bytes
+long because all its bytes are appended to the text section. (*Note
+Sections and Relocation: Sections.)
+
+ When you specify `-R' it would be possible to generate shorter
+address displacements (because we do not have to cross between text and
+data section). We refrain from doing this simply for compatibility with
+older versions of `as'. In future, `-R' may work this way.
+
+ When `as' is configured for COFF or ELF output, this option is only
+useful if you use sections named `.text' and `.data'.
+
+ `-R' is not supported for any of the HPPA targets. Using `-R'
+generates a warning from `as'.
+
+
+File: as.info, Node: statistics, Next: traditional-format, Prev: R, Up: Invoking
+
+2.13 Display Assembly Statistics: `--statistics'
+================================================
+
+Use `--statistics' to display two statistics about the resources used by
+`as': the maximum amount of space allocated during the assembly (in
+bytes), and the total execution time taken for the assembly (in CPU
+seconds).
+
+
+File: as.info, Node: traditional-format, Next: v, Prev: statistics, Up: Invoking
+
+2.14 Compatible Output: `--traditional-format'
+==============================================
+
+For some targets, the output of `as' is different in some ways from the
+output of some existing assembler. This switch requests `as' to use
+the traditional format instead.
+
+ For example, it disables the exception frame optimizations which
+`as' normally does by default on `gcc' output.
+
+
+File: as.info, Node: v, Next: W, Prev: traditional-format, Up: Invoking
+
+2.15 Announce Version: `-v'
+===========================
+
+You can find out what version of as is running by including the option
+`-v' (which you can also spell as `-version') on the command line.
+
+
+File: as.info, Node: W, Next: Z, Prev: v, Up: Invoking
+
+2.16 Control Warnings: `-W', `--warn', `--no-warn', `--fatal-warnings'
+======================================================================
+
+`as' should never give a warning or error message when assembling
+compiler output. But programs written by people often cause `as' to
+give a warning that a particular assumption was made. All such
+warnings are directed to the standard error file.
+
+ If you use the `-W' and `--no-warn' options, no warnings are issued.
+This only affects the warning messages: it does not change any
+particular of how `as' assembles your file. Errors, which stop the
+assembly, are still reported.
+
+ If you use the `--fatal-warnings' option, `as' considers files that
+generate warnings to be in error.
+
+ You can switch these options off again by specifying `--warn', which
+causes warnings to be output as usual.
+
+
+File: as.info, Node: Z, Prev: W, Up: Invoking
+
+2.17 Generate Object File in Spite of Errors: `-Z'
+==================================================
+
+After an error message, `as' normally produces no output. If for some
+reason you are interested in object file output even after `as' gives
+an error message on your program, use the `-Z' option. If there are
+any errors, `as' continues anyways, and writes an object file after a
+final warning message of the form `N errors, M warnings, generating bad
+object file.'
+
+
+File: as.info, Node: Syntax, Next: Sections, Prev: Invoking, Up: Top
+
+3 Syntax
+********
+
+This chapter describes the machine-independent syntax allowed in a
+source file. `as' syntax is similar to what many other assemblers use;
+it is inspired by the BSD 4.2 assembler, except that `as' does not
+assemble Vax bit-fields.
+
+* Menu:
+
+* Preprocessing:: Preprocessing
+* Whitespace:: Whitespace
+* Comments:: Comments
+* Symbol Intro:: Symbols
+* Statements:: Statements
+* Constants:: Constants
+
+
+File: as.info, Node: Preprocessing, Next: Whitespace, Up: Syntax
+
+3.1 Preprocessing
+=================
+
+The `as' internal preprocessor:
+ * adjusts and removes extra whitespace. It leaves one space or tab
+ before the keywords on a line, and turns any other whitespace on
+ the line into a single space.
+
+ * removes all comments, replacing them with a single space, or an
+ appropriate number of newlines.
+
+ * converts character constants into the appropriate numeric values.
+
+ It does not do macro processing, include file handling, or anything
+else you may get from your C compiler's preprocessor. You can do
+include file processing with the `.include' directive (*note
+`.include': Include.). You can use the GNU C compiler driver to get
+other "CPP" style preprocessing by giving the input file a `.S' suffix.
+*Note Options Controlling the Kind of Output: (gcc.info)Overall
+Options.
+
+ Excess whitespace, comments, and character constants cannot be used
+in the portions of the input text that are not preprocessed.
+
+ If the first line of an input file is `#NO_APP' or if you use the
+`-f' option, whitespace and comments are not removed from the input
+file. Within an input file, you can ask for whitespace and comment
+removal in specific portions of the by putting a line that says `#APP'
+before the text that may contain whitespace or comments, and putting a
+line that says `#NO_APP' after this text. This feature is mainly
+intend to support `asm' statements in compilers whose output is
+otherwise free of comments and whitespace.
+
+
+File: as.info, Node: Whitespace, Next: Comments, Prev: Preprocessing, Up: Syntax
+
+3.2 Whitespace
+==============
+
+"Whitespace" is one or more blanks or tabs, in any order. Whitespace
+is used to separate symbols, and to make programs neater for people to
+read. Unless within character constants (*note Character Constants:
+Characters.), any whitespace means the same as exactly one space.
+
+
+File: as.info, Node: Comments, Next: Symbol Intro, Prev: Whitespace, Up: Syntax
+
+3.3 Comments
+============
+
+There are two ways of rendering comments to `as'. In both cases the
+comment is equivalent to one space.
+
+ Anything from `/*' through the next `*/' is a comment. This means
+you may not nest these comments.
+
+ /*
+ The only way to include a newline ('\n') in a comment
+ is to use this sort of comment.
+ */
+
+ /* This sort of comment does not nest. */
+
+ Anything from the "line comment" character to the next newline is
+considered a comment and is ignored. The line comment character is `;'
+on the ARC; `@' on the ARM; `;' for the H8/300 family; `;' for the HPPA;
+`#' on the i386 and x86-64; `#' on the i960; `;' for the PDP-11; `;'
+for picoJava; `#' for Motorola PowerPC; `#' for IBM S/390; `#' for the
+Sunplus SCORE; `!' for the Renesas / SuperH SH; `!' on the SPARC; `#'
+on the ip2k; `#' on the m32c; `#' on the m32r; `|' on the 680x0; `#' on
+the 68HC11 and 68HC12; `#' on the Vax; `;' for the Z80; `!' for the
+Z8000; `#' on the V850; `#' for Xtensa systems; see *Note Machine
+Dependencies::.
+
+ On some machines there are two different line comment characters.
+One character only begins a comment if it is the first non-whitespace
+character on a line, while the other always begins a comment.
+
+ The V850 assembler also supports a double dash as starting a comment
+that extends to the end of the line.
+
+ `--';
+
+ To be compatible with past assemblers, lines that begin with `#'
+have a special interpretation. Following the `#' should be an absolute
+expression (*note Expressions::): the logical line number of the _next_
+line. Then a string (*note Strings: Strings.) is allowed: if present
+it is a new logical file name. The rest of the line, if any, should be
+whitespace.
+
+ If the first non-whitespace characters on the line are not numeric,
+the line is ignored. (Just like a comment.)
+
+ # This is an ordinary comment.
+ # 42-6 "new_file_name" # New logical file name
+ # This is logical line # 36.
+ This feature is deprecated, and may disappear from future versions
+of `as'.
+
+
+File: as.info, Node: Symbol Intro, Next: Statements, Prev: Comments, Up: Syntax
+
+3.4 Symbols
+===========
+
+A "symbol" is one or more characters chosen from the set of all letters
+(both upper and lower case), digits and the three characters `_.$'. On
+most machines, you can also use `$' in symbol names; exceptions are
+noted in *Note Machine Dependencies::. No symbol may begin with a
+digit. Case is significant. There is no length limit: all characters
+are significant. Symbols are delimited by characters not in that set,
+or by the beginning of a file (since the source program must end with a
+newline, the end of a file is not a possible symbol delimiter). *Note
+Symbols::.
+
+
+File: as.info, Node: Statements, Next: Constants, Prev: Symbol Intro, Up: Syntax
+
+3.5 Statements
+==============
+
+A "statement" ends at a newline character (`\n') or line separator
+character. (The line separator is usually `;', unless this conflicts
+with the comment character; see *Note Machine Dependencies::.) The
+newline or separator character is considered part of the preceding
+statement. Newlines and separators within character constants are an
+exception: they do not end statements.
+
+It is an error to end any statement with end-of-file: the last
+character of any input file should be a newline.
+
+ An empty statement is allowed, and may include whitespace. It is
+ignored.
+
+ A statement begins with zero or more labels, optionally followed by a
+key symbol which determines what kind of statement it is. The key
+symbol determines the syntax of the rest of the statement. If the
+symbol begins with a dot `.' then the statement is an assembler
+directive: typically valid for any computer. If the symbol begins with
+a letter the statement is an assembly language "instruction": it
+assembles into a machine language instruction. Different versions of
+`as' for different computers recognize different instructions. In
+fact, the same symbol may represent a different instruction in a
+different computer's assembly language.
+
+ A label is a symbol immediately followed by a colon (`:').
+Whitespace before a label or after a colon is permitted, but you may not
+have whitespace between a label's symbol and its colon. *Note Labels::.
+
+ For HPPA targets, labels need not be immediately followed by a
+colon, but the definition of a label must begin in column zero. This
+also implies that only one label may be defined on each line.
+
+ label: .directive followed by something
+ another_label: # This is an empty statement.
+ instruction operand_1, operand_2, ...
+
+
+File: as.info, Node: Constants, Prev: Statements, Up: Syntax
+
+3.6 Constants
+=============
+
+A constant is a number, written so that its value is known by
+inspection, without knowing any context. Like this:
+ .byte 74, 0112, 092, 0x4A, 0X4a, 'J, '\J # All the same value.
+ .ascii "Ring the bell\7" # A string constant.
+ .octa 0x123456789abcdef0123456789ABCDEF0 # A bignum.
+ .float 0f-314159265358979323846264338327\
+ 95028841971.693993751E-40 # - pi, a flonum.
+
+* Menu:
+
+* Characters:: Character Constants
+* Numbers:: Number Constants
+
+
+File: as.info, Node: Characters, Next: Numbers, Up: Constants
+
+3.6.1 Character Constants
+-------------------------
+
+There are two kinds of character constants. A "character" stands for
+one character in one byte and its value may be used in numeric
+expressions. String constants (properly called string _literals_) are
+potentially many bytes and their values may not be used in arithmetic
+expressions.
+
+* Menu:
+
+* Strings:: Strings
+* Chars:: Characters
+
+
+File: as.info, Node: Strings, Next: Chars, Up: Characters
+
+3.6.1.1 Strings
+...............
+
+A "string" is written between double-quotes. It may contain
+double-quotes or null characters. The way to get special characters
+into a string is to "escape" these characters: precede them with a
+backslash `\' character. For example `\\' represents one backslash:
+the first `\' is an escape which tells `as' to interpret the second
+character literally as a backslash (which prevents `as' from
+recognizing the second `\' as an escape character). The complete list
+of escapes follows.
+
+`\b'
+ Mnemonic for backspace; for ASCII this is octal code 010.
+
+`\f'
+ Mnemonic for FormFeed; for ASCII this is octal code 014.
+
+`\n'
+ Mnemonic for newline; for ASCII this is octal code 012.
+
+`\r'
+ Mnemonic for carriage-Return; for ASCII this is octal code 015.
+
+`\t'
+ Mnemonic for horizontal Tab; for ASCII this is octal code 011.
+
+`\ DIGIT DIGIT DIGIT'
+ An octal character code. The numeric code is 3 octal digits. For
+ compatibility with other Unix systems, 8 and 9 are accepted as
+ digits: for example, `\008' has the value 010, and `\009' the
+ value 011.
+
+`\`x' HEX-DIGITS...'
+ A hex character code. All trailing hex digits are combined.
+ Either upper or lower case `x' works.
+
+`\\'
+ Represents one `\' character.
+
+`\"'
+ Represents one `"' character. Needed in strings to represent this
+ character, because an unescaped `"' would end the string.
+
+`\ ANYTHING-ELSE'
+ Any other character when escaped by `\' gives a warning, but
+ assembles as if the `\' was not present. The idea is that if you
+ used an escape sequence you clearly didn't want the literal
+ interpretation of the following character. However `as' has no
+ other interpretation, so `as' knows it is giving you the wrong
+ code and warns you of the fact.
+
+ Which characters are escapable, and what those escapes represent,
+varies widely among assemblers. The current set is what we think the
+BSD 4.2 assembler recognizes, and is a subset of what most C compilers
+recognize. If you are in doubt, do not use an escape sequence.
+
+
+File: as.info, Node: Chars, Prev: Strings, Up: Characters
+
+3.6.1.2 Characters
+..................
+
+A single character may be written as a single quote immediately
+followed by that character. The same escapes apply to characters as to
+strings. So if you want to write the character backslash, you must
+write `'\\' where the first `\' escapes the second `\'. As you can
+see, the quote is an acute accent, not a grave accent. A newline
+immediately following an acute accent is taken as a literal character
+and does not count as the end of a statement. The value of a character
+constant in a numeric expression is the machine's byte-wide code for
+that character. `as' assumes your character code is ASCII: `'A' means
+65, `'B' means 66, and so on.
+
+
+File: as.info, Node: Numbers, Prev: Characters, Up: Constants
+
+3.6.2 Number Constants
+----------------------
+
+`as' distinguishes three kinds of numbers according to how they are
+stored in the target machine. _Integers_ are numbers that would fit
+into an `int' in the C language. _Bignums_ are integers, but they are
+stored in more than 32 bits. _Flonums_ are floating point numbers,
+described below.
+
+* Menu:
+
+* Integers:: Integers
+* Bignums:: Bignums
+* Flonums:: Flonums
+
+
+File: as.info, Node: Integers, Next: Bignums, Up: Numbers
+
+3.6.2.1 Integers
+................
+
+A binary integer is `0b' or `0B' followed by zero or more of the binary
+digits `01'.
+
+ An octal integer is `0' followed by zero or more of the octal digits
+(`01234567').
+
+ A decimal integer starts with a non-zero digit followed by zero or
+more digits (`0123456789').
+
+ A hexadecimal integer is `0x' or `0X' followed by one or more
+hexadecimal digits chosen from `0123456789abcdefABCDEF'.
+
+ Integers have the usual values. To denote a negative integer, use
+the prefix operator `-' discussed under expressions (*note Prefix
+Operators: Prefix Ops.).
+
+
+File: as.info, Node: Bignums, Next: Flonums, Prev: Integers, Up: Numbers
+
+3.6.2.2 Bignums
+...............
+
+A "bignum" has the same syntax and semantics as an integer except that
+the number (or its negative) takes more than 32 bits to represent in
+binary. The distinction is made because in some places integers are
+permitted while bignums are not.
+
+
+File: as.info, Node: Flonums, Prev: Bignums, Up: Numbers
+
+3.6.2.3 Flonums
+...............
+
+A "flonum" represents a floating point number. The translation is
+indirect: a decimal floating point number from the text is converted by
+`as' to a generic binary floating point number of more than sufficient
+precision. This generic floating point number is converted to a
+particular computer's floating point format (or formats) by a portion
+of `as' specialized to that computer.
+
+ A flonum is written by writing (in order)
+ * The digit `0'. (`0' is optional on the HPPA.)
+
+ * A letter, to tell `as' the rest of the number is a flonum. `e' is
+ recommended. Case is not important.
+
+ On the H8/300, Renesas / SuperH SH, and AMD 29K architectures, the
+ letter must be one of the letters `DFPRSX' (in upper or lower
+ case).
+
+ On the ARC, the letter must be one of the letters `DFRS' (in upper
+ or lower case).
+
+ On the Intel 960 architecture, the letter must be one of the
+ letters `DFT' (in upper or lower case).
+
+ On the HPPA architecture, the letter must be `E' (upper case only).
+
+ * An optional sign: either `+' or `-'.
+
+ * An optional "integer part": zero or more decimal digits.
+
+ * An optional "fractional part": `.' followed by zero or more
+ decimal digits.
+
+ * An optional exponent, consisting of:
+
+ * An `E' or `e'.
+
+ * Optional sign: either `+' or `-'.
+
+ * One or more decimal digits.
+
+
+ At least one of the integer part or the fractional part must be
+present. The floating point number has the usual base-10 value.
+
+ `as' does all processing using integers. Flonums are computed
+independently of any floating point hardware in the computer running
+`as'.
+
+
+File: as.info, Node: Sections, Next: Symbols, Prev: Syntax, Up: Top
+
+4 Sections and Relocation
+*************************
+
+* Menu:
+
+* Secs Background:: Background
+* Ld Sections:: Linker Sections
+* As Sections:: Assembler Internal Sections
+* Sub-Sections:: Sub-Sections
+* bss:: bss Section
+
+
+File: as.info, Node: Secs Background, Next: Ld Sections, Up: Sections
+
+4.1 Background
+==============
+
+Roughly, a section is a range of addresses, with no gaps; all data "in"
+those addresses is treated the same for some particular purpose. For
+example there may be a "read only" section.
+
+ The linker `ld' reads many object files (partial programs) and
+combines their contents to form a runnable program. When `as' emits an
+object file, the partial program is assumed to start at address 0.
+`ld' assigns the final addresses for the partial program, so that
+different partial programs do not overlap. This is actually an
+oversimplification, but it suffices to explain how `as' uses sections.
+
+ `ld' moves blocks of bytes of your program to their run-time
+addresses. These blocks slide to their run-time addresses as rigid
+units; their length does not change and neither does the order of bytes
+within them. Such a rigid unit is called a _section_. Assigning
+run-time addresses to sections is called "relocation". It includes the
+task of adjusting mentions of object-file addresses so they refer to
+the proper run-time addresses. For the H8/300, and for the Renesas /
+SuperH SH, `as' pads sections if needed to ensure they end on a word
+(sixteen bit) boundary.
+
+ An object file written by `as' has at least three sections, any of
+which may be empty. These are named "text", "data" and "bss" sections.
+
+ When it generates COFF or ELF output, `as' can also generate
+whatever other named sections you specify using the `.section'
+directive (*note `.section': Section.). If you do not use any
+directives that place output in the `.text' or `.data' sections, these
+sections still exist, but are empty.
+
+ When `as' generates SOM or ELF output for the HPPA, `as' can also
+generate whatever other named sections you specify using the `.space'
+and `.subspace' directives. See `HP9000 Series 800 Assembly Language
+Reference Manual' (HP 92432-90001) for details on the `.space' and
+`.subspace' assembler directives.
+
+ Additionally, `as' uses different names for the standard text, data,
+and bss sections when generating SOM output. Program text is placed
+into the `$CODE$' section, data into `$DATA$', and BSS into `$BSS$'.
+
+ Within the object file, the text section starts at address `0', the
+data section follows, and the bss section follows the data section.
+
+ When generating either SOM or ELF output files on the HPPA, the text
+section starts at address `0', the data section at address `0x4000000',
+and the bss section follows the data section.
+
+ To let `ld' know which data changes when the sections are relocated,
+and how to change that data, `as' also writes to the object file
+details of the relocation needed. To perform relocation `ld' must
+know, each time an address in the object file is mentioned:
+ * Where in the object file is the beginning of this reference to an
+ address?
+
+ * How long (in bytes) is this reference?
+
+ * Which section does the address refer to? What is the numeric
+ value of
+ (ADDRESS) - (START-ADDRESS OF SECTION)?
+
+ * Is the reference to an address "Program-Counter relative"?
+
+ In fact, every address `as' ever uses is expressed as
+ (SECTION) + (OFFSET INTO SECTION)
+ Further, most expressions `as' computes have this section-relative
+nature. (For some object formats, such as SOM for the HPPA, some
+expressions are symbol-relative instead.)
+
+ In this manual we use the notation {SECNAME N} to mean "offset N
+into section SECNAME."
+
+ Apart from text, data and bss sections you need to know about the
+"absolute" section. When `ld' mixes partial programs, addresses in the
+absolute section remain unchanged. For example, address `{absolute 0}'
+is "relocated" to run-time address 0 by `ld'. Although the linker
+never arranges two partial programs' data sections with overlapping
+addresses after linking, _by definition_ their absolute sections must
+overlap. Address `{absolute 239}' in one part of a program is always
+the same address when the program is running as address `{absolute
+239}' in any other part of the program.
+
+ The idea of sections is extended to the "undefined" section. Any
+address whose section is unknown at assembly time is by definition
+rendered {undefined U}--where U is filled in later. Since numbers are
+always defined, the only way to generate an undefined address is to
+mention an undefined symbol. A reference to a named common block would
+be such a symbol: its value is unknown at assembly time so it has
+section _undefined_.
+
+ By analogy the word _section_ is used to describe groups of sections
+in the linked program. `ld' puts all partial programs' text sections
+in contiguous addresses in the linked program. It is customary to
+refer to the _text section_ of a program, meaning all the addresses of
+all partial programs' text sections. Likewise for data and bss
+sections.
+
+ Some sections are manipulated by `ld'; others are invented for use
+of `as' and have no meaning except during assembly.
+
+
+File: as.info, Node: Ld Sections, Next: As Sections, Prev: Secs Background, Up: Sections
+
+4.2 Linker Sections
+===================
+
+`ld' deals with just four kinds of sections, summarized below.
+
+*named sections*
+*text section*
+*data section*
+ These sections hold your program. `as' and `ld' treat them as
+ separate but equal sections. Anything you can say of one section
+ is true of another. When the program is running, however, it is
+ customary for the text section to be unalterable. The text
+ section is often shared among processes: it contains instructions,
+ constants and the like. The data section of a running program is
+ usually alterable: for example, C variables would be stored in the
+ data section.
+
+*bss section*
+ This section contains zeroed bytes when your program begins
+ running. It is used to hold uninitialized variables or common
+ storage. The length of each partial program's bss section is
+ important, but because it starts out containing zeroed bytes there
+ is no need to store explicit zero bytes in the object file. The
+ bss section was invented to eliminate those explicit zeros from
+ object files.
+
+*absolute section*
+ Address 0 of this section is always "relocated" to runtime address
+ 0. This is useful if you want to refer to an address that `ld'
+ must not change when relocating. In this sense we speak of
+ absolute addresses being "unrelocatable": they do not change
+ during relocation.
+
+*undefined section*
+ This "section" is a catch-all for address references to objects
+ not in the preceding sections.
+
+ An idealized example of three relocatable sections follows. The
+example uses the traditional section names `.text' and `.data'. Memory
+addresses are on the horizontal axis.
+
+ +-----+----+--+
+ partial program # 1: |ttttt|dddd|00|
+ +-----+----+--+
+
+ text data bss
+ seg. seg. seg.
+
+ +---+---+---+
+ partial program # 2: |TTT|DDD|000|
+ +---+---+---+
+
+ +--+---+-----+--+----+---+-----+~~
+ linked program: | |TTT|ttttt| |dddd|DDD|00000|
+ +--+---+-----+--+----+---+-----+~~
+
+ addresses: 0 ...
+
+
+File: as.info, Node: As Sections, Next: Sub-Sections, Prev: Ld Sections, Up: Sections
+
+4.3 Assembler Internal Sections
+===============================
+
+These sections are meant only for the internal use of `as'. They have
+no meaning at run-time. You do not really need to know about these
+sections for most purposes; but they can be mentioned in `as' warning
+messages, so it might be helpful to have an idea of their meanings to
+`as'. These sections are used to permit the value of every expression
+in your assembly language program to be a section-relative address.
+
+ASSEMBLER-INTERNAL-LOGIC-ERROR!
+ An internal assembler logic error has been found. This means
+ there is a bug in the assembler.
+
+expr section
+ The assembler stores complex expression internally as combinations
+ of symbols. When it needs to represent an expression as a symbol,
+ it puts it in the expr section.
+
+
+File: as.info, Node: Sub-Sections, Next: bss, Prev: As Sections, Up: Sections
+
+4.4 Sub-Sections
+================
+
+Assembled bytes conventionally fall into two sections: text and data.
+You may have separate groups of data in named sections that you want to
+end up near to each other in the object file, even though they are not
+contiguous in the assembler source. `as' allows you to use
+"subsections" for this purpose. Within each section, there can be
+numbered subsections with values from 0 to 8192. Objects assembled
+into the same subsection go into the object file together with other
+objects in the same subsection. For example, a compiler might want to
+store constants in the text section, but might not want to have them
+interspersed with the program being assembled. In this case, the
+compiler could issue a `.text 0' before each section of code being
+output, and a `.text 1' before each group of constants being output.
+
+Subsections are optional. If you do not use subsections, everything
+goes in subsection number zero.
+
+ Each subsection is zero-padded up to a multiple of four bytes.
+(Subsections may be padded a different amount on different flavors of
+`as'.)
+
+ Subsections appear in your object file in numeric order, lowest
+numbered to highest. (All this to be compatible with other people's
+assemblers.) The object file contains no representation of
+subsections; `ld' and other programs that manipulate object files see
+no trace of them. They just see all your text subsections as a text
+section, and all your data subsections as a data section.
+
+ To specify which subsection you want subsequent statements assembled
+into, use a numeric argument to specify it, in a `.text EXPRESSION' or
+a `.data EXPRESSION' statement. When generating COFF output, you can
+also use an extra subsection argument with arbitrary named sections:
+`.section NAME, EXPRESSION'. When generating ELF output, you can also
+use the `.subsection' directive (*note SubSection::) to specify a
+subsection: `.subsection EXPRESSION'. EXPRESSION should be an absolute
+expression (*note Expressions::). If you just say `.text' then `.text
+0' is assumed. Likewise `.data' means `.data 0'. Assembly begins in
+`text 0'. For instance:
+ .text 0 # The default subsection is text 0 anyway.
+ .ascii "This lives in the first text subsection. *"
+ .text 1
+ .ascii "But this lives in the second text subsection."
+ .data 0
+ .ascii "This lives in the data section,"
+ .ascii "in the first data subsection."
+ .text 0
+ .ascii "This lives in the first text section,"
+ .ascii "immediately following the asterisk (*)."
+
+ Each section has a "location counter" incremented by one for every
+byte assembled into that section. Because subsections are merely a
+convenience restricted to `as' there is no concept of a subsection
+location counter. There is no way to directly manipulate a location
+counter--but the `.align' directive changes it, and any label
+definition captures its current value. The location counter of the
+section where statements are being assembled is said to be the "active"
+location counter.
+
+
+File: as.info, Node: bss, Prev: Sub-Sections, Up: Sections
+
+4.5 bss Section
+===============
+
+The bss section is used for local common variable storage. You may
+allocate address space in the bss section, but you may not dictate data
+to load into it before your program executes. When your program starts
+running, all the contents of the bss section are zeroed bytes.
+
+ The `.lcomm' pseudo-op defines a symbol in the bss section; see
+*Note `.lcomm': Lcomm.
+
+ The `.comm' pseudo-op may be used to declare a common symbol, which
+is another form of uninitialized symbol; see *Note `.comm': Comm.
+
+ When assembling for a target which supports multiple sections, such
+as ELF or COFF, you may switch into the `.bss' section and define
+symbols as usual; see *Note `.section': Section. You may only assemble
+zero values into the section. Typically the section will only contain
+symbol definitions and `.skip' directives (*note `.skip': Skip.).
+
+
+File: as.info, Node: Symbols, Next: Expressions, Prev: Sections, Up: Top
+
+5 Symbols
+*********
+
+Symbols are a central concept: the programmer uses symbols to name
+things, the linker uses symbols to link, and the debugger uses symbols
+to debug.
+
+ _Warning:_ `as' does not place symbols in the object file in the
+ same order they were declared. This may break some debuggers.
+
+* Menu:
+
+* Labels:: Labels
+* Setting Symbols:: Giving Symbols Other Values
+* Symbol Names:: Symbol Names
+* Dot:: The Special Dot Symbol
+* Symbol Attributes:: Symbol Attributes
+
+
+File: as.info, Node: Labels, Next: Setting Symbols, Up: Symbols
+
+5.1 Labels
+==========
+
+A "label" is written as a symbol immediately followed by a colon `:'.
+The symbol then represents the current value of the active location
+counter, and is, for example, a suitable instruction operand. You are
+warned if you use the same symbol to represent two different locations:
+the first definition overrides any other definitions.
+
+ On the HPPA, the usual form for a label need not be immediately
+followed by a colon, but instead must start in column zero. Only one
+label may be defined on a single line. To work around this, the HPPA
+version of `as' also provides a special directive `.label' for defining
+labels more flexibly.
+
+
+File: as.info, Node: Setting Symbols, Next: Symbol Names, Prev: Labels, Up: Symbols
+
+5.2 Giving Symbols Other Values
+===============================
+
+A symbol can be given an arbitrary value by writing a symbol, followed
+by an equals sign `=', followed by an expression (*note Expressions::).
+This is equivalent to using the `.set' directive. *Note `.set': Set.
+In the same way, using a double equals sign `='`=' here represents an
+equivalent of the `.eqv' directive. *Note `.eqv': Eqv.
+
+ Blackfin does not support symbol assignment with `='.
+
+
+File: as.info, Node: Symbol Names, Next: Dot, Prev: Setting Symbols, Up: Symbols
+
+5.3 Symbol Names
+================
+
+Symbol names begin with a letter or with one of `._'. On most
+machines, you can also use `$' in symbol names; exceptions are noted in
+*Note Machine Dependencies::. That character may be followed by any
+string of digits, letters, dollar signs (unless otherwise noted for a
+particular target machine), and underscores.
+
+Case of letters is significant: `foo' is a different symbol name than
+`Foo'.
+
+ Each symbol has exactly one name. Each name in an assembly language
+program refers to exactly one symbol. You may use that symbol name any
+number of times in a program.
+
+Local Symbol Names
+------------------
+
+A local symbol is any symbol beginning with certain local label
+prefixes. By default, the local label prefix is `.L' for ELF systems or
+`L' for traditional a.out systems, but each target may have its own set
+of local label prefixes. On the HPPA local symbols begin with `L$'.
+
+ Local symbols are defined and used within the assembler, but they are
+normally not saved in object files. Thus, they are not visible when
+debugging. You may use the `-L' option (*note Include Local Symbols:
+`-L': L.) to retain the local symbols in the object files.
+
+Local Labels
+------------
+
+Local labels help compilers and programmers use names temporarily.
+They create symbols which are guaranteed to be unique over the entire
+scope of the input source code and which can be referred to by a simple
+notation. To define a local label, write a label of the form `N:'
+(where N represents any positive integer). To refer to the most recent
+previous definition of that label write `Nb', using the same number as
+when you defined the label. To refer to the next definition of a local
+label, write `Nf'--the `b' stands for "backwards" and the `f' stands
+for "forwards".
+
+ There is no restriction on how you can use these labels, and you can
+reuse them too. So that it is possible to repeatedly define the same
+local label (using the same number `N'), although you can only refer to
+the most recently defined local label of that number (for a backwards
+reference) or the next definition of a specific local label for a
+forward reference. It is also worth noting that the first 10 local
+labels (`0:'...`9:') are implemented in a slightly more efficient
+manner than the others.
+
+ Here is an example:
+
+ 1: branch 1f
+ 2: branch 1b
+ 1: branch 2f
+ 2: branch 1b
+
+ Which is the equivalent of:
+
+ label_1: branch label_3
+ label_2: branch label_1
+ label_3: branch label_4
+ label_4: branch label_3
+
+ Local label names are only a notational device. They are immediately
+transformed into more conventional symbol names before the assembler
+uses them. The symbol names are stored in the symbol table, appear in
+error messages, and are optionally emitted to the object file. The
+names are constructed using these parts:
+
+`_local label prefix_'
+ All local symbols begin with the system-specific local label
+ prefix. Normally both `as' and `ld' forget symbols that start
+ with the local label prefix. These labels are used for symbols
+ you are never intended to see. If you use the `-L' option then
+ `as' retains these symbols in the object file. If you also
+ instruct `ld' to retain these symbols, you may use them in
+ debugging.
+
+`NUMBER'
+ This is the number that was used in the local label definition.
+ So if the label is written `55:' then the number is `55'.
+
+`C-B'
+ This unusual character is included so you do not accidentally
+ invent a symbol of the same name. The character has ASCII value
+ of `\002' (control-B).
+
+`_ordinal number_'
+ This is a serial number to keep the labels distinct. The first
+ definition of `0:' gets the number `1'. The 15th definition of
+ `0:' gets the number `15', and so on. Likewise the first
+ definition of `1:' gets the number `1' and its 15th definition
+ gets `15' as well.
+
+ So for example, the first `1:' may be named `.L1C-B1', and the 44th
+`3:' may be named `.L3C-B44'.
+
+Dollar Local Labels
+-------------------
+
+`as' also supports an even more local form of local labels called
+dollar labels. These labels go out of scope (i.e., they become
+undefined) as soon as a non-local label is defined. Thus they remain
+valid for only a small region of the input source code. Normal local
+labels, by contrast, remain in scope for the entire file, or until they
+are redefined by another occurrence of the same local label.
+
+ Dollar labels are defined in exactly the same way as ordinary local
+labels, except that they have a dollar sign suffix to their numeric
+value, e.g., `55$:'.
+
+ They can also be distinguished from ordinary local labels by their
+transformed names which use ASCII character `\001' (control-A) as the
+magic character to distinguish them from ordinary labels. For example,
+the fifth definition of `6$' may be named `.L6C-A5'.
+
+
+File: as.info, Node: Dot, Next: Symbol Attributes, Prev: Symbol Names, Up: Symbols
+
+5.4 The Special Dot Symbol
+==========================
+
+The special symbol `.' refers to the current address that `as' is
+assembling into. Thus, the expression `melvin: .long .' defines
+`melvin' to contain its own address. Assigning a value to `.' is
+treated the same as a `.org' directive. Thus, the expression `.=.+4'
+is the same as saying `.space 4'.
+
+
+File: as.info, Node: Symbol Attributes, Prev: Dot, Up: Symbols
+
+5.5 Symbol Attributes
+=====================
+
+Every symbol has, as well as its name, the attributes "Value" and
+"Type". Depending on output format, symbols can also have auxiliary
+attributes.
+
+ If you use a symbol without defining it, `as' assumes zero for all
+these attributes, and probably won't warn you. This makes the symbol
+an externally defined symbol, which is generally what you would want.
+
+* Menu:
+
+* Symbol Value:: Value
+* Symbol Type:: Type
+
+
+* a.out Symbols:: Symbol Attributes: `a.out'
+
+* COFF Symbols:: Symbol Attributes for COFF
+
+* SOM Symbols:: Symbol Attributes for SOM
+
+
+File: as.info, Node: Symbol Value, Next: Symbol Type, Up: Symbol Attributes
+
+5.5.1 Value
+-----------
+
+The value of a symbol is (usually) 32 bits. For a symbol which labels a
+location in the text, data, bss or absolute sections the value is the
+number of addresses from the start of that section to the label.
+Naturally for text, data and bss sections the value of a symbol changes
+as `ld' changes section base addresses during linking. Absolute
+symbols' values do not change during linking: that is why they are
+called absolute.
+
+ The value of an undefined symbol is treated in a special way. If it
+is 0 then the symbol is not defined in this assembler source file, and
+`ld' tries to determine its value from other files linked into the same
+program. You make this kind of symbol simply by mentioning a symbol
+name without defining it. A non-zero value represents a `.comm' common
+declaration. The value is how much common storage to reserve, in bytes
+(addresses). The symbol refers to the first address of the allocated
+storage.
+
+
+File: as.info, Node: Symbol Type, Next: a.out Symbols, Prev: Symbol Value, Up: Symbol Attributes
+
+5.5.2 Type
+----------
+
+The type attribute of a symbol contains relocation (section)
+information, any flag settings indicating that a symbol is external, and
+(optionally), other information for linkers and debuggers. The exact
+format depends on the object-code output format in use.
+
+
+File: as.info, Node: a.out Symbols, Next: COFF Symbols, Prev: Symbol Type, Up: Symbol Attributes
+
+5.5.3 Symbol Attributes: `a.out'
+--------------------------------
+
+* Menu:
+
+* Symbol Desc:: Descriptor
+* Symbol Other:: Other
+
+
+File: as.info, Node: Symbol Desc, Next: Symbol Other, Up: a.out Symbols
+
+5.5.3.1 Descriptor
+..................
+
+This is an arbitrary 16-bit value. You may establish a symbol's
+descriptor value by using a `.desc' statement (*note `.desc': Desc.).
+A descriptor value means nothing to `as'.
+
+
+File: as.info, Node: Symbol Other, Prev: Symbol Desc, Up: a.out Symbols
+
+5.5.3.2 Other
+.............
+
+This is an arbitrary 8-bit value. It means nothing to `as'.
+
+
+File: as.info, Node: COFF Symbols, Next: SOM Symbols, Prev: a.out Symbols, Up: Symbol Attributes
+
+5.5.4 Symbol Attributes for COFF
+--------------------------------
+
+The COFF format supports a multitude of auxiliary symbol attributes;
+like the primary symbol attributes, they are set between `.def' and
+`.endef' directives.
+
+5.5.4.1 Primary Attributes
+..........................
+
+The symbol name is set with `.def'; the value and type, respectively,
+with `.val' and `.type'.
+
+5.5.4.2 Auxiliary Attributes
+............................
+
+The `as' directives `.dim', `.line', `.scl', `.size', `.tag', and
+`.weak' can generate auxiliary symbol table information for COFF.
+
+
+File: as.info, Node: SOM Symbols, Prev: COFF Symbols, Up: Symbol Attributes
+
+5.5.5 Symbol Attributes for SOM
+-------------------------------
+
+The SOM format for the HPPA supports a multitude of symbol attributes
+set with the `.EXPORT' and `.IMPORT' directives.
+
+ The attributes are described in `HP9000 Series 800 Assembly Language
+Reference Manual' (HP 92432-90001) under the `IMPORT' and `EXPORT'
+assembler directive documentation.
+
+
+File: as.info, Node: Expressions, Next: Pseudo Ops, Prev: Symbols, Up: Top
+
+6 Expressions
+*************
+
+An "expression" specifies an address or numeric value. Whitespace may
+precede and/or follow an expression.
+
+ The result of an expression must be an absolute number, or else an
+offset into a particular section. If an expression is not absolute,
+and there is not enough information when `as' sees the expression to
+know its section, a second pass over the source program might be
+necessary to interpret the expression--but the second pass is currently
+not implemented. `as' aborts with an error message in this situation.
+
+* Menu:
+
+* Empty Exprs:: Empty Expressions
+* Integer Exprs:: Integer Expressions
+
+
+File: as.info, Node: Empty Exprs, Next: Integer Exprs, Up: Expressions
+
+6.1 Empty Expressions
+=====================
+
+An empty expression has no value: it is just whitespace or null.
+Wherever an absolute expression is required, you may omit the
+expression, and `as' assumes a value of (absolute) 0. This is
+compatible with other assemblers.
+
+
+File: as.info, Node: Integer Exprs, Prev: Empty Exprs, Up: Expressions
+
+6.2 Integer Expressions
+=======================
+
+An "integer expression" is one or more _arguments_ delimited by
+_operators_.
+
+* Menu:
+
+* Arguments:: Arguments
+* Operators:: Operators
+* Prefix Ops:: Prefix Operators
+* Infix Ops:: Infix Operators
+
+
+File: as.info, Node: Arguments, Next: Operators, Up: Integer Exprs
+
+6.2.1 Arguments
+---------------
+
+"Arguments" are symbols, numbers or subexpressions. In other contexts
+arguments are sometimes called "arithmetic operands". In this manual,
+to avoid confusing them with the "instruction operands" of the machine
+language, we use the term "argument" to refer to parts of expressions
+only, reserving the word "operand" to refer only to machine instruction
+operands.
+
+ Symbols are evaluated to yield {SECTION NNN} where SECTION is one of
+text, data, bss, absolute, or undefined. NNN is a signed, 2's
+complement 32 bit integer.
+
+ Numbers are usually integers.
+
+ A number can be a flonum or bignum. In this case, you are warned
+that only the low order 32 bits are used, and `as' pretends these 32
+bits are an integer. You may write integer-manipulating instructions
+that act on exotic constants, compatible with other assemblers.
+
+ Subexpressions are a left parenthesis `(' followed by an integer
+expression, followed by a right parenthesis `)'; or a prefix operator
+followed by an argument.
+
+
+File: as.info, Node: Operators, Next: Prefix Ops, Prev: Arguments, Up: Integer Exprs
+
+6.2.2 Operators
+---------------
+
+"Operators" are arithmetic functions, like `+' or `%'. Prefix
+operators are followed by an argument. Infix operators appear between
+their arguments. Operators may be preceded and/or followed by
+whitespace.
+
+
+File: as.info, Node: Prefix Ops, Next: Infix Ops, Prev: Operators, Up: Integer Exprs
+
+6.2.3 Prefix Operator
+---------------------
+
+`as' has the following "prefix operators". They each take one
+argument, which must be absolute.
+
+`-'
+ "Negation". Two's complement negation.
+
+`~'
+ "Complementation". Bitwise not.
+
+
+File: as.info, Node: Infix Ops, Prev: Prefix Ops, Up: Integer Exprs
+
+6.2.4 Infix Operators
+---------------------
+
+"Infix operators" take two arguments, one on either side. Operators
+have precedence, but operations with equal precedence are performed left
+to right. Apart from `+' or `-', both arguments must be absolute, and
+the result is absolute.
+
+ 1. Highest Precedence
+
+ `*'
+ "Multiplication".
+
+ `/'
+ "Division". Truncation is the same as the C operator `/'
+
+ `%'
+ "Remainder".
+
+ `<<'
+ "Shift Left". Same as the C operator `<<'.
+
+ `>>'
+ "Shift Right". Same as the C operator `>>'.
+
+ 2. Intermediate precedence
+
+ `|'
+ "Bitwise Inclusive Or".
+
+ `&'
+ "Bitwise And".
+
+ `^'
+ "Bitwise Exclusive Or".
+
+ `!'
+ "Bitwise Or Not".
+
+ 3. Low Precedence
+
+ `+'
+ "Addition". If either argument is absolute, the result has
+ the section of the other argument. You may not add together
+ arguments from different sections.
+
+ `-'
+ "Subtraction". If the right argument is absolute, the result
+ has the section of the left argument. If both arguments are
+ in the same section, the result is absolute. You may not
+ subtract arguments from different sections.
+
+ `=='
+ "Is Equal To"
+
+ `<>'
+ `!='
+ "Is Not Equal To"
+
+ `<'
+ "Is Less Than"
+
+ `>'
+ "Is Greater Than"
+
+ `>='
+ "Is Greater Than Or Equal To"
+
+ `<='
+ "Is Less Than Or Equal To"
+
+ The comparison operators can be used as infix operators. A
+ true results has a value of -1 whereas a false result has a
+ value of 0. Note, these operators perform signed
+ comparisons.
+
+ 4. Lowest Precedence
+
+ `&&'
+ "Logical And".
+
+ `||'
+ "Logical Or".
+
+ These two logical operations can be used to combine the
+ results of sub expressions. Note, unlike the comparison
+ operators a true result returns a value of 1 but a false
+ results does still return 0. Also note that the logical or
+ operator has a slightly lower precedence than logical and.
+
+
+ In short, it's only meaningful to add or subtract the _offsets_ in an
+address; you can only have a defined section in one of the two
+arguments.
+
+
+File: as.info, Node: Pseudo Ops, Next: Object Attributes, Prev: Expressions, Up: Top
+
+7 Assembler Directives
+**********************
+
+All assembler directives have names that begin with a period (`.').
+The rest of the name is letters, usually in lower case.
+
+ This chapter discusses directives that are available regardless of
+the target machine configuration for the GNU assembler. Some machine
+configurations provide additional directives. *Note Machine
+Dependencies::.
+
+* Menu:
+
+* Abort:: `.abort'
+
+* ABORT (COFF):: `.ABORT'
+
+* Align:: `.align ABS-EXPR , ABS-EXPR'
+* Altmacro:: `.altmacro'
+* Ascii:: `.ascii "STRING"'...
+* Asciz:: `.asciz "STRING"'...
+* Balign:: `.balign ABS-EXPR , ABS-EXPR'
+* Byte:: `.byte EXPRESSIONS'
+* CFI directives:: `.cfi_startproc [simple]', `.cfi_endproc', etc.
+* Comm:: `.comm SYMBOL , LENGTH '
+* Data:: `.data SUBSECTION'
+
+* Def:: `.def NAME'
+
+* Desc:: `.desc SYMBOL, ABS-EXPRESSION'
+
+* Dim:: `.dim'
+
+* Double:: `.double FLONUMS'
+* Eject:: `.eject'
+* Else:: `.else'
+* Elseif:: `.elseif'
+* End:: `.end'
+
+* Endef:: `.endef'
+
+* Endfunc:: `.endfunc'
+* Endif:: `.endif'
+* Equ:: `.equ SYMBOL, EXPRESSION'
+* Equiv:: `.equiv SYMBOL, EXPRESSION'
+* Eqv:: `.eqv SYMBOL, EXPRESSION'
+* Err:: `.err'
+* Error:: `.error STRING'
+* Exitm:: `.exitm'
+* Extern:: `.extern'
+* Fail:: `.fail'
+* File:: `.file'
+* Fill:: `.fill REPEAT , SIZE , VALUE'
+* Float:: `.float FLONUMS'
+* Func:: `.func'
+* Global:: `.global SYMBOL', `.globl SYMBOL'
+
+* Gnu_attribute:: `.gnu_attribute TAG,VALUE'
+* Hidden:: `.hidden NAMES'
+
+* hword:: `.hword EXPRESSIONS'
+* Ident:: `.ident'
+* If:: `.if ABSOLUTE EXPRESSION'
+* Incbin:: `.incbin "FILE"[,SKIP[,COUNT]]'
+* Include:: `.include "FILE"'
+* Int:: `.int EXPRESSIONS'
+
+* Internal:: `.internal NAMES'
+
+* Irp:: `.irp SYMBOL,VALUES'...
+* Irpc:: `.irpc SYMBOL,VALUES'...
+* Lcomm:: `.lcomm SYMBOL , LENGTH'
+* Lflags:: `.lflags'
+
+* Line:: `.line LINE-NUMBER'
+
+* Linkonce:: `.linkonce [TYPE]'
+* List:: `.list'
+* Ln:: `.ln LINE-NUMBER'
+* Loc:: `.loc FILENO LINENO'
+* Loc_mark_labels:: `.loc_mark_labels ENABLE'
+
+* Local:: `.local NAMES'
+
+* Long:: `.long EXPRESSIONS'
+
+* Macro:: `.macro NAME ARGS'...
+* MRI:: `.mri VAL'
+* Noaltmacro:: `.noaltmacro'
+* Nolist:: `.nolist'
+* Octa:: `.octa BIGNUMS'
+* Org:: `.org NEW-LC, FILL'
+* P2align:: `.p2align ABS-EXPR, ABS-EXPR, ABS-EXPR'
+
+* PopSection:: `.popsection'
+* Previous:: `.previous'
+
+* Print:: `.print STRING'
+
+* Protected:: `.protected NAMES'
+
+* Psize:: `.psize LINES, COLUMNS'
+* Purgem:: `.purgem NAME'
+
+* PushSection:: `.pushsection NAME'
+
+* Quad:: `.quad BIGNUMS'
+* Reloc:: `.reloc OFFSET, RELOC_NAME[, EXPRESSION]'
+* Rept:: `.rept COUNT'
+* Sbttl:: `.sbttl "SUBHEADING"'
+
+* Scl:: `.scl CLASS'
+
+* Section:: `.section NAME[, FLAGS]'
+
+* Set:: `.set SYMBOL, EXPRESSION'
+* Short:: `.short EXPRESSIONS'
+* Single:: `.single FLONUMS'
+
+* Size:: `.size [NAME , EXPRESSION]'
+
+* Skip:: `.skip SIZE , FILL'
+
+* Sleb128:: `.sleb128 EXPRESSIONS'
+
+* Space:: `.space SIZE , FILL'
+
+* Stab:: `.stabd, .stabn, .stabs'
+
+* String:: `.string "STR"', `.string8 "STR"', `.string16 "STR"', `.string32 "STR"', `.string64 "STR"'
+* Struct:: `.struct EXPRESSION'
+
+* SubSection:: `.subsection'
+* Symver:: `.symver NAME,NAME2@NODENAME'
+
+
+* Tag:: `.tag STRUCTNAME'
+
+* Text:: `.text SUBSECTION'
+* Title:: `.title "HEADING"'
+
+* Type:: `.type <INT | NAME , TYPE DESCRIPTION>'
+
+* Uleb128:: `.uleb128 EXPRESSIONS'
+
+* Val:: `.val ADDR'
+
+
+* Version:: `.version "STRING"'
+* VTableEntry:: `.vtable_entry TABLE, OFFSET'
+* VTableInherit:: `.vtable_inherit CHILD, PARENT'
+
+* Warning:: `.warning STRING'
+* Weak:: `.weak NAMES'
+* Weakref:: `.weakref ALIAS, SYMBOL'
+* Word:: `.word EXPRESSIONS'
+* Deprecated:: Deprecated Directives
+
+
+File: as.info, Node: Abort, Next: ABORT (COFF), Up: Pseudo Ops
+
+7.1 `.abort'
+============
+
+This directive stops the assembly immediately. It is for compatibility
+with other assemblers. The original idea was that the assembly
+language source would be piped into the assembler. If the sender of
+the source quit, it could use this directive tells `as' to quit also.
+One day `.abort' will not be supported.
+
+
+File: as.info, Node: ABORT (COFF), Next: Align, Prev: Abort, Up: Pseudo Ops
+
+7.2 `.ABORT' (COFF)
+===================
+
+When producing COFF output, `as' accepts this directive as a synonym
+for `.abort'.
+
+
+File: as.info, Node: Align, Next: Altmacro, Prev: ABORT (COFF), Up: Pseudo Ops
+
+7.3 `.align ABS-EXPR, ABS-EXPR, ABS-EXPR'
+=========================================
+
+Pad the location counter (in the current subsection) to a particular
+storage boundary. The first expression (which must be absolute) is the
+alignment required, as described below.
+
+ The second expression (also absolute) gives the fill value to be
+stored in the padding bytes. It (and the comma) may be omitted. If it
+is omitted, the padding bytes are normally zero. However, on some
+systems, if the section is marked as containing code and the fill value
+is omitted, the space is filled with no-op instructions.
+
+ The third expression is also absolute, and is also optional. If it
+is present, it is the maximum number of bytes that should be skipped by
+this alignment directive. If doing the alignment would require
+skipping more bytes than the specified maximum, then the alignment is
+not done at all. You can omit the fill value (the second argument)
+entirely by simply using two commas after the required alignment; this
+can be useful if you want the alignment to be filled with no-op
+instructions when appropriate.
+
+ The way the required alignment is specified varies from system to
+system. For the arc, hppa, i386 using ELF, i860, iq2000, m68k, or32,
+s390, sparc, tic4x, tic80 and xtensa, the first expression is the
+alignment request in bytes. For example `.align 8' advances the
+location counter until it is a multiple of 8. If the location counter
+is already a multiple of 8, no change is needed. For the tic54x, the
+first expression is the alignment request in words.
+
+ For other systems, including ppc, i386 using a.out format, arm and
+strongarm, it is the number of low-order zero bits the location counter
+must have after advancement. For example `.align 3' advances the
+location counter until it a multiple of 8. If the location counter is
+already a multiple of 8, no change is needed.
+
+ This inconsistency is due to the different behaviors of the various
+native assemblers for these systems which GAS must emulate. GAS also
+provides `.balign' and `.p2align' directives, described later, which
+have a consistent behavior across all architectures (but are specific
+to GAS).
+
+
+File: as.info, Node: Altmacro, Next: Ascii, Prev: Align, Up: Pseudo Ops
+
+7.4 `.altmacro'
+===============
+
+Enable alternate macro mode, enabling:
+
+`LOCAL NAME [ , ... ]'
+ One additional directive, `LOCAL', is available. It is used to
+ generate a string replacement for each of the NAME arguments, and
+ replace any instances of NAME in each macro expansion. The
+ replacement string is unique in the assembly, and different for
+ each separate macro expansion. `LOCAL' allows you to write macros
+ that define symbols, without fear of conflict between separate
+ macro expansions.
+
+`String delimiters'
+ You can write strings delimited in these other ways besides
+ `"STRING"':
+
+ `'STRING''
+ You can delimit strings with single-quote characters.
+
+ `<STRING>'
+ You can delimit strings with matching angle brackets.
+
+`single-character string escape'
+ To include any single character literally in a string (even if the
+ character would otherwise have some special meaning), you can
+ prefix the character with `!' (an exclamation mark). For example,
+ you can write `<4.3 !> 5.4!!>' to get the literal text `4.3 >
+ 5.4!'.
+
+`Expression results as strings'
+ You can write `%EXPR' to evaluate the expression EXPR and use the
+ result as a string.
+
+
+File: as.info, Node: Ascii, Next: Asciz, Prev: Altmacro, Up: Pseudo Ops
+
+7.5 `.ascii "STRING"'...
+========================
+
+`.ascii' expects zero or more string literals (*note Strings::)
+separated by commas. It assembles each string (with no automatic
+trailing zero byte) into consecutive addresses.
+
+
+File: as.info, Node: Asciz, Next: Balign, Prev: Ascii, Up: Pseudo Ops
+
+7.6 `.asciz "STRING"'...
+========================
+
+`.asciz' is just like `.ascii', but each string is followed by a zero
+byte. The "z" in `.asciz' stands for "zero".
+
+
+File: as.info, Node: Balign, Next: Byte, Prev: Asciz, Up: Pseudo Ops
+
+7.7 `.balign[wl] ABS-EXPR, ABS-EXPR, ABS-EXPR'
+==============================================
+
+Pad the location counter (in the current subsection) to a particular
+storage boundary. The first expression (which must be absolute) is the
+alignment request in bytes. For example `.balign 8' advances the
+location counter until it is a multiple of 8. If the location counter
+is already a multiple of 8, no change is needed.
+
+ The second expression (also absolute) gives the fill value to be
+stored in the padding bytes. It (and the comma) may be omitted. If it
+is omitted, the padding bytes are normally zero. However, on some
+systems, if the section is marked as containing code and the fill value
+is omitted, the space is filled with no-op instructions.
+
+ The third expression is also absolute, and is also optional. If it
+is present, it is the maximum number of bytes that should be skipped by
+this alignment directive. If doing the alignment would require
+skipping more bytes than the specified maximum, then the alignment is
+not done at all. You can omit the fill value (the second argument)
+entirely by simply using two commas after the required alignment; this
+can be useful if you want the alignment to be filled with no-op
+instructions when appropriate.
+
+ The `.balignw' and `.balignl' directives are variants of the
+`.balign' directive. The `.balignw' directive treats the fill pattern
+as a two byte word value. The `.balignl' directives treats the fill
+pattern as a four byte longword value. For example, `.balignw
+4,0x368d' will align to a multiple of 4. If it skips two bytes, they
+will be filled in with the value 0x368d (the exact placement of the
+bytes depends upon the endianness of the processor). If it skips 1 or
+3 bytes, the fill value is undefined.
+
+
+File: as.info, Node: Byte, Next: CFI directives, Prev: Balign, Up: Pseudo Ops
+
+7.8 `.byte EXPRESSIONS'
+=======================
+
+`.byte' expects zero or more expressions, separated by commas. Each
+expression is assembled into the next byte.
+
+
+File: as.info, Node: CFI directives, Next: Comm, Prev: Byte, Up: Pseudo Ops
+
+7.9 `.cfi_startproc [simple]'
+=============================
+
+`.cfi_startproc' is used at the beginning of each function that should
+have an entry in `.eh_frame'. It initializes some internal data
+structures. Don't forget to close the function by `.cfi_endproc'.
+
+7.10 `.cfi_sections SECTION_LIST'
+=================================
+
+`.cfi_sections' may be used to specify whether CFI directives should
+emit `.eh_frame' section and/or `.debug_frame' section. If
+SECTION_LIST is `.eh_frame', `.eh_frame' is emitted, if SECTION_LIST is
+`.debug_frame', `.debug_frame' is emitted. To emit both use
+`.eh_frame, .debug_frame'. The default if this directive is not used
+is `.cfi_sections .eh_frame'.
+
+ Unless `.cfi_startproc' is used along with parameter `simple' it
+also emits some architecture dependent initial CFI instructions.
+
+7.11 `.cfi_endproc'
+===================
+
+`.cfi_endproc' is used at the end of a function where it closes its
+unwind entry previously opened by `.cfi_startproc', and emits it to
+`.eh_frame'.
+
+7.12 `.cfi_personality ENCODING [, EXP]'
+========================================
+
+`.cfi_personality' defines personality routine and its encoding.
+ENCODING must be a constant determining how the personality should be
+encoded. If it is 255 (`DW_EH_PE_omit'), second argument is not
+present, otherwise second argument should be a constant or a symbol
+name. When using indirect encodings, the symbol provided should be the
+location where personality can be loaded from, not the personality
+routine itself. The default after `.cfi_startproc' is
+`.cfi_personality 0xff', no personality routine.
+
+7.13 `.cfi_lsda ENCODING [, EXP]'
+=================================
+
+`.cfi_lsda' defines LSDA and its encoding. ENCODING must be a constant
+determining how the LSDA should be encoded. If it is 255
+(`DW_EH_PE_omit'), second argument is not present, otherwise second
+argument should be a constant or a symbol name. The default after
+`.cfi_startproc' is `.cfi_lsda 0xff', no LSDA.
+
+7.14 `.cfi_def_cfa REGISTER, OFFSET'
+====================================
+
+`.cfi_def_cfa' defines a rule for computing CFA as: take address from
+REGISTER and add OFFSET to it.
+
+7.15 `.cfi_def_cfa_register REGISTER'
+=====================================
+
+`.cfi_def_cfa_register' modifies a rule for computing CFA. From now on
+REGISTER will be used instead of the old one. Offset remains the same.
+
+7.16 `.cfi_def_cfa_offset OFFSET'
+=================================
+
+`.cfi_def_cfa_offset' modifies a rule for computing CFA. Register
+remains the same, but OFFSET is new. Note that it is the absolute
+offset that will be added to a defined register to compute CFA address.
+
+7.17 `.cfi_adjust_cfa_offset OFFSET'
+====================================
+
+Same as `.cfi_def_cfa_offset' but OFFSET is a relative value that is
+added/substracted from the previous offset.
+
+7.18 `.cfi_offset REGISTER, OFFSET'
+===================================
+
+Previous value of REGISTER is saved at offset OFFSET from CFA.
+
+7.19 `.cfi_rel_offset REGISTER, OFFSET'
+=======================================
+
+Previous value of REGISTER is saved at offset OFFSET from the current
+CFA register. This is transformed to `.cfi_offset' using the known
+displacement of the CFA register from the CFA. This is often easier to
+use, because the number will match the code it's annotating.
+
+7.20 `.cfi_register REGISTER1, REGISTER2'
+=========================================
+
+Previous value of REGISTER1 is saved in register REGISTER2.
+
+7.21 `.cfi_restore REGISTER'
+============================
+
+`.cfi_restore' says that the rule for REGISTER is now the same as it
+was at the beginning of the function, after all initial instruction
+added by `.cfi_startproc' were executed.
+
+7.22 `.cfi_undefined REGISTER'
+==============================
+
+From now on the previous value of REGISTER can't be restored anymore.
+
+7.23 `.cfi_same_value REGISTER'
+===============================
+
+Current value of REGISTER is the same like in the previous frame, i.e.
+no restoration needed.
+
+7.24 `.cfi_remember_state',
+===========================
+
+First save all current rules for all registers by `.cfi_remember_state',
+then totally screw them up by subsequent `.cfi_*' directives and when
+everything is hopelessly bad, use `.cfi_restore_state' to restore the
+previous saved state.
+
+7.25 `.cfi_return_column REGISTER'
+==================================
+
+Change return column REGISTER, i.e. the return address is either
+directly in REGISTER or can be accessed by rules for REGISTER.
+
+7.26 `.cfi_signal_frame'
+========================
+
+Mark current function as signal trampoline.
+
+7.27 `.cfi_window_save'
+=======================
+
+SPARC register window has been saved.
+
+7.28 `.cfi_escape' EXPRESSION[, ...]
+====================================
+
+Allows the user to add arbitrary bytes to the unwind info. One might
+use this to add OS-specific CFI opcodes, or generic CFI opcodes that
+GAS does not yet support.
+
+7.29 `.cfi_val_encoded_addr REGISTER, ENCODING, LABEL'
+======================================================
+
+The current value of REGISTER is LABEL. The value of LABEL will be
+encoded in the output file according to ENCODING; see the description
+of `.cfi_personality' for details on this encoding.
+
+ The usefulness of equating a register to a fixed label is probably
+limited to the return address register. Here, it can be useful to mark
+a code segment that has only one return address which is reached by a
+direct branch and no copy of the return address exists in memory or
+another register.
+
+
+File: as.info, Node: Comm, Next: Data, Prev: CFI directives, Up: Pseudo Ops
+
+7.30 `.comm SYMBOL , LENGTH '
+=============================
+
+`.comm' declares a common symbol named SYMBOL. When linking, a common
+symbol in one object file may be merged with a defined or common symbol
+of the same name in another object file. If `ld' does not see a
+definition for the symbol-just one or more common symbols-then it will
+allocate LENGTH bytes of uninitialized memory. LENGTH must be an
+absolute expression. If `ld' sees multiple common symbols with the
+same name, and they do not all have the same size, it will allocate
+space using the largest size.
+
+ When using ELF or (as a GNU extension) PE, the `.comm' directive
+takes an optional third argument. This is the desired alignment of the
+symbol, specified for ELF as a byte boundary (for example, an alignment
+of 16 means that the least significant 4 bits of the address should be
+zero), and for PE as a power of two (for example, an alignment of 5
+means aligned to a 32-byte boundary). The alignment must be an
+absolute expression, and it must be a power of two. If `ld' allocates
+uninitialized memory for the common symbol, it will use the alignment
+when placing the symbol. If no alignment is specified, `as' will set
+the alignment to the largest power of two less than or equal to the
+size of the symbol, up to a maximum of 16 on ELF, or the default
+section alignment of 4 on PE(1).
+
+ The syntax for `.comm' differs slightly on the HPPA. The syntax is
+`SYMBOL .comm, LENGTH'; SYMBOL is optional.
+
+ ---------- Footnotes ----------
+
+ (1) This is not the same as the executable image file alignment
+controlled by `ld''s `--section-alignment' option; image file sections
+in PE are aligned to multiples of 4096, which is far too large an
+alignment for ordinary variables. It is rather the default alignment
+for (non-debug) sections within object (`*.o') files, which are less
+strictly aligned.
+
+
+File: as.info, Node: Data, Next: Def, Prev: Comm, Up: Pseudo Ops
+
+7.31 `.data SUBSECTION'
+=======================
+
+`.data' tells `as' to assemble the following statements onto the end of
+the data subsection numbered SUBSECTION (which is an absolute
+expression). If SUBSECTION is omitted, it defaults to zero.
+
+
+File: as.info, Node: Def, Next: Desc, Prev: Data, Up: Pseudo Ops
+
+7.32 `.def NAME'
+================
+
+Begin defining debugging information for a symbol NAME; the definition
+extends until the `.endef' directive is encountered.
+
+
+File: as.info, Node: Desc, Next: Dim, Prev: Def, Up: Pseudo Ops
+
+7.33 `.desc SYMBOL, ABS-EXPRESSION'
+===================================
+
+This directive sets the descriptor of the symbol (*note Symbol
+Attributes::) to the low 16 bits of an absolute expression.
+
+ The `.desc' directive is not available when `as' is configured for
+COFF output; it is only for `a.out' or `b.out' object format. For the
+sake of compatibility, `as' accepts it, but produces no output, when
+configured for COFF.
+
+
+File: as.info, Node: Dim, Next: Double, Prev: Desc, Up: Pseudo Ops
+
+7.34 `.dim'
+===========
+
+This directive is generated by compilers to include auxiliary debugging
+information in the symbol table. It is only permitted inside
+`.def'/`.endef' pairs.
+
+
+File: as.info, Node: Double, Next: Eject, Prev: Dim, Up: Pseudo Ops
+
+7.35 `.double FLONUMS'
+======================
+
+`.double' expects zero or more flonums, separated by commas. It
+assembles floating point numbers. The exact kind of floating point
+numbers emitted depends on how `as' is configured. *Note Machine
+Dependencies::.
+
+
+File: as.info, Node: Eject, Next: Else, Prev: Double, Up: Pseudo Ops
+
+7.36 `.eject'
+=============
+
+Force a page break at this point, when generating assembly listings.
+
+
+File: as.info, Node: Else, Next: Elseif, Prev: Eject, Up: Pseudo Ops
+
+7.37 `.else'
+============
+
+`.else' is part of the `as' support for conditional assembly; see *Note
+`.if': If. It marks the beginning of a section of code to be assembled
+if the condition for the preceding `.if' was false.
+
+
+File: as.info, Node: Elseif, Next: End, Prev: Else, Up: Pseudo Ops
+
+7.38 `.elseif'
+==============
+
+`.elseif' is part of the `as' support for conditional assembly; see
+*Note `.if': If. It is shorthand for beginning a new `.if' block that
+would otherwise fill the entire `.else' section.
+
+
+File: as.info, Node: End, Next: Endef, Prev: Elseif, Up: Pseudo Ops
+
+7.39 `.end'
+===========
+
+`.end' marks the end of the assembly file. `as' does not process
+anything in the file past the `.end' directive.
+
+
+File: as.info, Node: Endef, Next: Endfunc, Prev: End, Up: Pseudo Ops
+
+7.40 `.endef'
+=============
+
+This directive flags the end of a symbol definition begun with `.def'.
+
+
+File: as.info, Node: Endfunc, Next: Endif, Prev: Endef, Up: Pseudo Ops
+
+7.41 `.endfunc'
+===============
+
+`.endfunc' marks the end of a function specified with `.func'.
+
+
+File: as.info, Node: Endif, Next: Equ, Prev: Endfunc, Up: Pseudo Ops
+
+7.42 `.endif'
+=============
+
+`.endif' is part of the `as' support for conditional assembly; it marks
+the end of a block of code that is only assembled conditionally. *Note
+`.if': If.
+
+
+File: as.info, Node: Equ, Next: Equiv, Prev: Endif, Up: Pseudo Ops
+
+7.43 `.equ SYMBOL, EXPRESSION'
+==============================
+
+This directive sets the value of SYMBOL to EXPRESSION. It is
+synonymous with `.set'; see *Note `.set': Set.
+
+ The syntax for `equ' on the HPPA is `SYMBOL .equ EXPRESSION'.
+
+ The syntax for `equ' on the Z80 is `SYMBOL equ EXPRESSION'. On the
+Z80 it is an eror if SYMBOL is already defined, but the symbol is not
+protected from later redefinition. Compare *Note Equiv::.
+
+
+File: as.info, Node: Equiv, Next: Eqv, Prev: Equ, Up: Pseudo Ops
+
+7.44 `.equiv SYMBOL, EXPRESSION'
+================================
+
+The `.equiv' directive is like `.equ' and `.set', except that the
+assembler will signal an error if SYMBOL is already defined. Note a
+symbol which has been referenced but not actually defined is considered
+to be undefined.
+
+ Except for the contents of the error message, this is roughly
+equivalent to
+ .ifdef SYM
+ .err
+ .endif
+ .equ SYM,VAL
+ plus it protects the symbol from later redefinition.
+
+
+File: as.info, Node: Eqv, Next: Err, Prev: Equiv, Up: Pseudo Ops
+
+7.45 `.eqv SYMBOL, EXPRESSION'
+==============================
+
+The `.eqv' directive is like `.equiv', but no attempt is made to
+evaluate the expression or any part of it immediately. Instead each
+time the resulting symbol is used in an expression, a snapshot of its
+current value is taken.
+
+
+File: as.info, Node: Err, Next: Error, Prev: Eqv, Up: Pseudo Ops
+
+7.46 `.err'
+===========
+
+If `as' assembles a `.err' directive, it will print an error message
+and, unless the `-Z' option was used, it will not generate an object
+file. This can be used to signal an error in conditionally compiled
+code.
+
+
+File: as.info, Node: Error, Next: Exitm, Prev: Err, Up: Pseudo Ops
+
+7.47 `.error "STRING"'
+======================
+
+Similarly to `.err', this directive emits an error, but you can specify
+a string that will be emitted as the error message. If you don't
+specify the message, it defaults to `".error directive invoked in
+source file"'. *Note Error and Warning Messages: Errors.
+
+ .error "This code has not been assembled and tested."
+
+
+File: as.info, Node: Exitm, Next: Extern, Prev: Error, Up: Pseudo Ops
+
+7.48 `.exitm'
+=============
+
+Exit early from the current macro definition. *Note Macro::.
+
+
+File: as.info, Node: Extern, Next: Fail, Prev: Exitm, Up: Pseudo Ops
+
+7.49 `.extern'
+==============
+
+`.extern' is accepted in the source program--for compatibility with
+other assemblers--but it is ignored. `as' treats all undefined symbols
+as external.
+
+
+File: as.info, Node: Fail, Next: File, Prev: Extern, Up: Pseudo Ops
+
+7.50 `.fail EXPRESSION'
+=======================
+
+Generates an error or a warning. If the value of the EXPRESSION is 500
+or more, `as' will print a warning message. If the value is less than
+500, `as' will print an error message. The message will include the
+value of EXPRESSION. This can occasionally be useful inside complex
+nested macros or conditional assembly.
+
+
+File: as.info, Node: File, Next: Fill, Prev: Fail, Up: Pseudo Ops
+
+7.51 `.file'
+============
+
+There are two different versions of the `.file' directive. Targets
+that support DWARF2 line number information use the DWARF2 version of
+`.file'. Other targets use the default version.
+
+Default Version
+---------------
+
+This version of the `.file' directive tells `as' that we are about to
+start a new logical file. The syntax is:
+
+ .file STRING
+
+ STRING is the new file name. In general, the filename is recognized
+whether or not it is surrounded by quotes `"'; but if you wish to
+specify an empty file name, you must give the quotes-`""'. This
+statement may go away in future: it is only recognized to be compatible
+with old `as' programs.
+
+DWARF2 Version
+--------------
+
+When emitting DWARF2 line number information, `.file' assigns filenames
+to the `.debug_line' file name table. The syntax is:
+
+ .file FILENO FILENAME
+
+ The FILENO operand should be a unique positive integer to use as the
+index of the entry in the table. The FILENAME operand is a C string
+literal.
+
+ The detail of filename indices is exposed to the user because the
+filename table is shared with the `.debug_info' section of the DWARF2
+debugging information, and thus the user must know the exact indices
+that table entries will have.
+
+
+File: as.info, Node: Fill, Next: Float, Prev: File, Up: Pseudo Ops
+
+7.52 `.fill REPEAT , SIZE , VALUE'
+==================================
+
+REPEAT, SIZE and VALUE are absolute expressions. This emits REPEAT
+copies of SIZE bytes. REPEAT may be zero or more. SIZE may be zero or
+more, but if it is more than 8, then it is deemed to have the value 8,
+compatible with other people's assemblers. The contents of each REPEAT
+bytes is taken from an 8-byte number. The highest order 4 bytes are
+zero. The lowest order 4 bytes are VALUE rendered in the byte-order of
+an integer on the computer `as' is assembling for. Each SIZE bytes in
+a repetition is taken from the lowest order SIZE bytes of this number.
+Again, this bizarre behavior is compatible with other people's
+assemblers.
+
+ SIZE and VALUE are optional. If the second comma and VALUE are
+absent, VALUE is assumed zero. If the first comma and following tokens
+are absent, SIZE is assumed to be 1.
+
+
+File: as.info, Node: Float, Next: Func, Prev: Fill, Up: Pseudo Ops
+
+7.53 `.float FLONUMS'
+=====================
+
+This directive assembles zero or more flonums, separated by commas. It
+has the same effect as `.single'. The exact kind of floating point
+numbers emitted depends on how `as' is configured. *Note Machine
+Dependencies::.
+
+
+File: as.info, Node: Func, Next: Global, Prev: Float, Up: Pseudo Ops
+
+7.54 `.func NAME[,LABEL]'
+=========================
+
+`.func' emits debugging information to denote function NAME, and is
+ignored unless the file is assembled with debugging enabled. Only
+`--gstabs[+]' is currently supported. LABEL is the entry point of the
+function and if omitted NAME prepended with the `leading char' is used.
+`leading char' is usually `_' or nothing, depending on the target. All
+functions are currently defined to have `void' return type. The
+function must be terminated with `.endfunc'.
+
+
+File: as.info, Node: Global, Next: Gnu_attribute, Prev: Func, Up: Pseudo Ops
+
+7.55 `.global SYMBOL', `.globl SYMBOL'
+======================================
+
+`.global' makes the symbol visible to `ld'. If you define SYMBOL in
+your partial program, its value is made available to other partial
+programs that are linked with it. Otherwise, SYMBOL takes its
+attributes from a symbol of the same name from another file linked into
+the same program.
+
+ Both spellings (`.globl' and `.global') are accepted, for
+compatibility with other assemblers.
+
+ On the HPPA, `.global' is not always enough to make it accessible to
+other partial programs. You may need the HPPA-only `.EXPORT' directive
+as well. *Note HPPA Assembler Directives: HPPA Directives.
+
+
+File: as.info, Node: Gnu_attribute, Next: Hidden, Prev: Global, Up: Pseudo Ops
+
+7.56 `.gnu_attribute TAG,VALUE'
+===============================
+
+Record a GNU object attribute for this file. *Note Object Attributes::.
+
+
+File: as.info, Node: Hidden, Next: hword, Prev: Gnu_attribute, Up: Pseudo Ops
+
+7.57 `.hidden NAMES'
+====================
+
+This is one of the ELF visibility directives. The other two are
+`.internal' (*note `.internal': Internal.) and `.protected' (*note
+`.protected': Protected.).
+
+ This directive overrides the named symbols default visibility (which
+is set by their binding: local, global or weak). The directive sets
+the visibility to `hidden' which means that the symbols are not visible
+to other components. Such symbols are always considered to be
+`protected' as well.
+
+
+File: as.info, Node: hword, Next: Ident, Prev: Hidden, Up: Pseudo Ops
+
+7.58 `.hword EXPRESSIONS'
+=========================
+
+This expects zero or more EXPRESSIONS, and emits a 16 bit number for
+each.
+
+ This directive is a synonym for `.short'; depending on the target
+architecture, it may also be a synonym for `.word'.
+
+
+File: as.info, Node: Ident, Next: If, Prev: hword, Up: Pseudo Ops
+
+7.59 `.ident'
+=============
+
+This directive is used by some assemblers to place tags in object
+files. The behavior of this directive varies depending on the target.
+When using the a.out object file format, `as' simply accepts the
+directive for source-file compatibility with existing assemblers, but
+does not emit anything for it. When using COFF, comments are emitted
+to the `.comment' or `.rdata' section, depending on the target. When
+using ELF, comments are emitted to the `.comment' section.
+
+
+File: as.info, Node: If, Next: Incbin, Prev: Ident, Up: Pseudo Ops
+
+7.60 `.if ABSOLUTE EXPRESSION'
+==============================
+
+`.if' marks the beginning of a section of code which is only considered
+part of the source program being assembled if the argument (which must
+be an ABSOLUTE EXPRESSION) is non-zero. The end of the conditional
+section of code must be marked by `.endif' (*note `.endif': Endif.);
+optionally, you may include code for the alternative condition, flagged
+by `.else' (*note `.else': Else.). If you have several conditions to
+check, `.elseif' may be used to avoid nesting blocks if/else within
+each subsequent `.else' block.
+
+ The following variants of `.if' are also supported:
+`.ifdef SYMBOL'
+ Assembles the following section of code if the specified SYMBOL
+ has been defined. Note a symbol which has been referenced but not
+ yet defined is considered to be undefined.
+
+`.ifb TEXT'
+ Assembles the following section of code if the operand is blank
+ (empty).
+
+`.ifc STRING1,STRING2'
+ Assembles the following section of code if the two strings are the
+ same. The strings may be optionally quoted with single quotes.
+ If they are not quoted, the first string stops at the first comma,
+ and the second string stops at the end of the line. Strings which
+ contain whitespace should be quoted. The string comparison is
+ case sensitive.
+
+`.ifeq ABSOLUTE EXPRESSION'
+ Assembles the following section of code if the argument is zero.
+
+`.ifeqs STRING1,STRING2'
+ Another form of `.ifc'. The strings must be quoted using double
+ quotes.
+
+`.ifge ABSOLUTE EXPRESSION'
+ Assembles the following section of code if the argument is greater
+ than or equal to zero.
+
+`.ifgt ABSOLUTE EXPRESSION'
+ Assembles the following section of code if the argument is greater
+ than zero.
+
+`.ifle ABSOLUTE EXPRESSION'
+ Assembles the following section of code if the argument is less
+ than or equal to zero.
+
+`.iflt ABSOLUTE EXPRESSION'
+ Assembles the following section of code if the argument is less
+ than zero.
+
+`.ifnb TEXT'
+ Like `.ifb', but the sense of the test is reversed: this assembles
+ the following section of code if the operand is non-blank
+ (non-empty).
+
+`.ifnc STRING1,STRING2.'
+ Like `.ifc', but the sense of the test is reversed: this assembles
+ the following section of code if the two strings are not the same.
+
+`.ifndef SYMBOL'
+`.ifnotdef SYMBOL'
+ Assembles the following section of code if the specified SYMBOL
+ has not been defined. Both spelling variants are equivalent.
+ Note a symbol which has been referenced but not yet defined is
+ considered to be undefined.
+
+`.ifne ABSOLUTE EXPRESSION'
+ Assembles the following section of code if the argument is not
+ equal to zero (in other words, this is equivalent to `.if').
+
+`.ifnes STRING1,STRING2'
+ Like `.ifeqs', but the sense of the test is reversed: this
+ assembles the following section of code if the two strings are not
+ the same.
+
+
+File: as.info, Node: Incbin, Next: Include, Prev: If, Up: Pseudo Ops
+
+7.61 `.incbin "FILE"[,SKIP[,COUNT]]'
+====================================
+
+The `incbin' directive includes FILE verbatim at the current location.
+You can control the search paths used with the `-I' command-line option
+(*note Command-Line Options: Invoking.). Quotation marks are required
+around FILE.
+
+ The SKIP argument skips a number of bytes from the start of the
+FILE. The COUNT argument indicates the maximum number of bytes to
+read. Note that the data is not aligned in any way, so it is the user's
+responsibility to make sure that proper alignment is provided both
+before and after the `incbin' directive.
+
+
+File: as.info, Node: Include, Next: Int, Prev: Incbin, Up: Pseudo Ops
+
+7.62 `.include "FILE"'
+======================
+
+This directive provides a way to include supporting files at specified
+points in your source program. The code from FILE is assembled as if
+it followed the point of the `.include'; when the end of the included
+file is reached, assembly of the original file continues. You can
+control the search paths used with the `-I' command-line option (*note
+Command-Line Options: Invoking.). Quotation marks are required around
+FILE.
+
+
+File: as.info, Node: Int, Next: Internal, Prev: Include, Up: Pseudo Ops
+
+7.63 `.int EXPRESSIONS'
+=======================
+
+Expect zero or more EXPRESSIONS, of any section, separated by commas.
+For each expression, emit a number that, at run time, is the value of
+that expression. The byte order and bit size of the number depends on
+what kind of target the assembly is for.
+
+
+File: as.info, Node: Internal, Next: Irp, Prev: Int, Up: Pseudo Ops
+
+7.64 `.internal NAMES'
+======================
+
+This is one of the ELF visibility directives. The other two are
+`.hidden' (*note `.hidden': Hidden.) and `.protected' (*note
+`.protected': Protected.).
+
+ This directive overrides the named symbols default visibility (which
+is set by their binding: local, global or weak). The directive sets
+the visibility to `internal' which means that the symbols are
+considered to be `hidden' (i.e., not visible to other components), and
+that some extra, processor specific processing must also be performed
+upon the symbols as well.
+
+
+File: as.info, Node: Irp, Next: Irpc, Prev: Internal, Up: Pseudo Ops
+
+7.65 `.irp SYMBOL,VALUES'...
+============================
+
+Evaluate a sequence of statements assigning different values to SYMBOL.
+The sequence of statements starts at the `.irp' directive, and is
+terminated by an `.endr' directive. For each VALUE, SYMBOL is set to
+VALUE, and the sequence of statements is assembled. If no VALUE is
+listed, the sequence of statements is assembled once, with SYMBOL set
+to the null string. To refer to SYMBOL within the sequence of
+statements, use \SYMBOL.
+
+ For example, assembling
+
+ .irp param,1,2,3
+ move d\param,sp@-
+ .endr
+
+ is equivalent to assembling
+
+ move d1,sp@-
+ move d2,sp@-
+ move d3,sp@-
+
+ For some caveats with the spelling of SYMBOL, see also *Note Macro::.
+
+
+File: as.info, Node: Irpc, Next: Lcomm, Prev: Irp, Up: Pseudo Ops
+
+7.66 `.irpc SYMBOL,VALUES'...
+=============================
+
+Evaluate a sequence of statements assigning different values to SYMBOL.
+The sequence of statements starts at the `.irpc' directive, and is
+terminated by an `.endr' directive. For each character in VALUE,
+SYMBOL is set to the character, and the sequence of statements is
+assembled. If no VALUE is listed, the sequence of statements is
+assembled once, with SYMBOL set to the null string. To refer to SYMBOL
+within the sequence of statements, use \SYMBOL.
+
+ For example, assembling
+
+ .irpc param,123
+ move d\param,sp@-
+ .endr
+
+ is equivalent to assembling
+
+ move d1,sp@-
+ move d2,sp@-
+ move d3,sp@-
+
+ For some caveats with the spelling of SYMBOL, see also the discussion
+at *Note Macro::.
+
+
+File: as.info, Node: Lcomm, Next: Lflags, Prev: Irpc, Up: Pseudo Ops
+
+7.67 `.lcomm SYMBOL , LENGTH'
+=============================
+
+Reserve LENGTH (an absolute expression) bytes for a local common
+denoted by SYMBOL. The section and value of SYMBOL are those of the
+new local common. The addresses are allocated in the bss section, so
+that at run-time the bytes start off zeroed. SYMBOL is not declared
+global (*note `.global': Global.), so is normally not visible to `ld'.
+
+ Some targets permit a third argument to be used with `.lcomm'. This
+argument specifies the desired alignment of the symbol in the bss
+section.
+
+ The syntax for `.lcomm' differs slightly on the HPPA. The syntax is
+`SYMBOL .lcomm, LENGTH'; SYMBOL is optional.
+
+
+File: as.info, Node: Lflags, Next: Line, Prev: Lcomm, Up: Pseudo Ops
+
+7.68 `.lflags'
+==============
+
+`as' accepts this directive, for compatibility with other assemblers,
+but ignores it.
+
+
+File: as.info, Node: Line, Next: Linkonce, Prev: Lflags, Up: Pseudo Ops
+
+7.69 `.line LINE-NUMBER'
+========================
+
+Change the logical line number. LINE-NUMBER must be an absolute
+expression. The next line has that logical line number. Therefore any
+other statements on the current line (after a statement separator
+character) are reported as on logical line number LINE-NUMBER - 1. One
+day `as' will no longer support this directive: it is recognized only
+for compatibility with existing assembler programs.
+
+Even though this is a directive associated with the `a.out' or `b.out'
+object-code formats, `as' still recognizes it when producing COFF
+output, and treats `.line' as though it were the COFF `.ln' _if_ it is
+found outside a `.def'/`.endef' pair.
+
+ Inside a `.def', `.line' is, instead, one of the directives used by
+compilers to generate auxiliary symbol information for debugging.
+
+
+File: as.info, Node: Linkonce, Next: List, Prev: Line, Up: Pseudo Ops
+
+7.70 `.linkonce [TYPE]'
+=======================
+
+Mark the current section so that the linker only includes a single copy
+of it. This may be used to include the same section in several
+different object files, but ensure that the linker will only include it
+once in the final output file. The `.linkonce' pseudo-op must be used
+for each instance of the section. Duplicate sections are detected
+based on the section name, so it should be unique.
+
+ This directive is only supported by a few object file formats; as of
+this writing, the only object file format which supports it is the
+Portable Executable format used on Windows NT.
+
+ The TYPE argument is optional. If specified, it must be one of the
+following strings. For example:
+ .linkonce same_size
+ Not all types may be supported on all object file formats.
+
+`discard'
+ Silently discard duplicate sections. This is the default.
+
+`one_only'
+ Warn if there are duplicate sections, but still keep only one copy.
+
+`same_size'
+ Warn if any of the duplicates have different sizes.
+
+`same_contents'
+ Warn if any of the duplicates do not have exactly the same
+ contents.
+
+
+File: as.info, Node: List, Next: Ln, Prev: Linkonce, Up: Pseudo Ops
+
+7.71 `.list'
+============
+
+Control (in conjunction with the `.nolist' directive) whether or not
+assembly listings are generated. These two directives maintain an
+internal counter (which is zero initially). `.list' increments the
+counter, and `.nolist' decrements it. Assembly listings are generated
+whenever the counter is greater than zero.
+
+ By default, listings are disabled. When you enable them (with the
+`-a' command line option; *note Command-Line Options: Invoking.), the
+initial value of the listing counter is one.
+
+
+File: as.info, Node: Ln, Next: Loc, Prev: List, Up: Pseudo Ops
+
+7.72 `.ln LINE-NUMBER'
+======================
+
+`.ln' is a synonym for `.line'.
+
+
+File: as.info, Node: Loc, Next: Loc_mark_labels, Prev: Ln, Up: Pseudo Ops
+
+7.73 `.loc FILENO LINENO [COLUMN] [OPTIONS]'
+============================================
+
+When emitting DWARF2 line number information, the `.loc' directive will
+add a row to the `.debug_line' line number matrix corresponding to the
+immediately following assembly instruction. The FILENO, LINENO, and
+optional COLUMN arguments will be applied to the `.debug_line' state
+machine before the row is added.
+
+ The OPTIONS are a sequence of the following tokens in any order:
+
+`basic_block'
+ This option will set the `basic_block' register in the
+ `.debug_line' state machine to `true'.
+
+`prologue_end'
+ This option will set the `prologue_end' register in the
+ `.debug_line' state machine to `true'.
+
+`epilogue_begin'
+ This option will set the `epilogue_begin' register in the
+ `.debug_line' state machine to `true'.
+
+`is_stmt VALUE'
+ This option will set the `is_stmt' register in the `.debug_line'
+ state machine to `value', which must be either 0 or 1.
+
+`isa VALUE'
+ This directive will set the `isa' register in the `.debug_line'
+ state machine to VALUE, which must be an unsigned integer.
+
+`discriminator VALUE'
+ This directive will set the `discriminator' register in the
+ `.debug_line' state machine to VALUE, which must be an unsigned
+ integer.
+
+
+
+File: as.info, Node: Loc_mark_labels, Next: Local, Prev: Loc, Up: Pseudo Ops
+
+7.74 `.loc_mark_labels ENABLE'
+==============================
+
+When emitting DWARF2 line number information, the `.loc_mark_labels'
+directive makes the assembler emit an entry to the `.debug_line' line
+number matrix with the `basic_block' register in the state machine set
+whenever a code label is seen. The ENABLE argument should be either 1
+or 0, to enable or disable this function respectively.
+
+
+File: as.info, Node: Local, Next: Long, Prev: Loc_mark_labels, Up: Pseudo Ops
+
+7.75 `.local NAMES'
+===================
+
+This directive, which is available for ELF targets, marks each symbol in
+the comma-separated list of `names' as a local symbol so that it will
+not be externally visible. If the symbols do not already exist, they
+will be created.
+
+ For targets where the `.lcomm' directive (*note Lcomm::) does not
+accept an alignment argument, which is the case for most ELF targets,
+the `.local' directive can be used in combination with `.comm' (*note
+Comm::) to define aligned local common data.
+
+
+File: as.info, Node: Long, Next: Macro, Prev: Local, Up: Pseudo Ops
+
+7.76 `.long EXPRESSIONS'
+========================
+
+`.long' is the same as `.int'. *Note `.int': Int.
+
+
+File: as.info, Node: Macro, Next: MRI, Prev: Long, Up: Pseudo Ops
+
+7.77 `.macro'
+=============
+
+The commands `.macro' and `.endm' allow you to define macros that
+generate assembly output. For example, this definition specifies a
+macro `sum' that puts a sequence of numbers into memory:
+
+ .macro sum from=0, to=5
+ .long \from
+ .if \to-\from
+ sum "(\from+1)",\to
+ .endif
+ .endm
+
+With that definition, `SUM 0,5' is equivalent to this assembly input:
+
+ .long 0
+ .long 1
+ .long 2
+ .long 3
+ .long 4
+ .long 5
+
+`.macro MACNAME'
+`.macro MACNAME MACARGS ...'
+ Begin the definition of a macro called MACNAME. If your macro
+ definition requires arguments, specify their names after the macro
+ name, separated by commas or spaces. You can qualify the macro
+ argument to indicate whether all invocations must specify a
+ non-blank value (through `:`req''), or whether it takes all of the
+ remaining arguments (through `:`vararg''). You can supply a
+ default value for any macro argument by following the name with
+ `=DEFLT'. You cannot define two macros with the same MACNAME
+ unless it has been subject to the `.purgem' directive (*note
+ Purgem::) between the two definitions. For example, these are all
+ valid `.macro' statements:
+
+ `.macro comm'
+ Begin the definition of a macro called `comm', which takes no
+ arguments.
+
+ `.macro plus1 p, p1'
+ `.macro plus1 p p1'
+ Either statement begins the definition of a macro called
+ `plus1', which takes two arguments; within the macro
+ definition, write `\p' or `\p1' to evaluate the arguments.
+
+ `.macro reserve_str p1=0 p2'
+ Begin the definition of a macro called `reserve_str', with two
+ arguments. The first argument has a default value, but not
+ the second. After the definition is complete, you can call
+ the macro either as `reserve_str A,B' (with `\p1' evaluating
+ to A and `\p2' evaluating to B), or as `reserve_str ,B' (with
+ `\p1' evaluating as the default, in this case `0', and `\p2'
+ evaluating to B).
+
+ `.macro m p1:req, p2=0, p3:vararg'
+ Begin the definition of a macro called `m', with at least
+ three arguments. The first argument must always have a value
+ specified, but not the second, which instead has a default
+ value. The third formal will get assigned all remaining
+ arguments specified at invocation time.
+
+ When you call a macro, you can specify the argument values
+ either by position, or by keyword. For example, `sum 9,17'
+ is equivalent to `sum to=17, from=9'.
+
+
+ Note that since each of the MACARGS can be an identifier exactly
+ as any other one permitted by the target architecture, there may be
+ occasional problems if the target hand-crafts special meanings to
+ certain characters when they occur in a special position. For
+ example, if the colon (`:') is generally permitted to be part of a
+ symbol name, but the architecture specific code special-cases it
+ when occurring as the final character of a symbol (to denote a
+ label), then the macro parameter replacement code will have no way
+ of knowing that and consider the whole construct (including the
+ colon) an identifier, and check only this identifier for being the
+ subject to parameter substitution. So for example this macro
+ definition:
+
+ .macro label l
+ \l:
+ .endm
+
+ might not work as expected. Invoking `label foo' might not create
+ a label called `foo' but instead just insert the text `\l:' into
+ the assembler source, probably generating an error about an
+ unrecognised identifier.
+
+ Similarly problems might occur with the period character (`.')
+ which is often allowed inside opcode names (and hence identifier
+ names). So for example constructing a macro to build an opcode
+ from a base name and a length specifier like this:
+
+ .macro opcode base length
+ \base.\length
+ .endm
+
+ and invoking it as `opcode store l' will not create a `store.l'
+ instruction but instead generate some kind of error as the
+ assembler tries to interpret the text `\base.\length'.
+
+ There are several possible ways around this problem:
+
+ `Insert white space'
+ If it is possible to use white space characters then this is
+ the simplest solution. eg:
+
+ .macro label l
+ \l :
+ .endm
+
+ `Use `\()''
+ The string `\()' can be used to separate the end of a macro
+ argument from the following text. eg:
+
+ .macro opcode base length
+ \base\().\length
+ .endm
+
+ `Use the alternate macro syntax mode'
+ In the alternative macro syntax mode the ampersand character
+ (`&') can be used as a separator. eg:
+
+ .altmacro
+ .macro label l
+ l&:
+ .endm
+
+ Note: this problem of correctly identifying string parameters to
+ pseudo ops also applies to the identifiers used in `.irp' (*note
+ Irp::) and `.irpc' (*note Irpc::) as well.
+
+`.endm'
+ Mark the end of a macro definition.
+
+`.exitm'
+ Exit early from the current macro definition.
+
+`\@'
+ `as' maintains a counter of how many macros it has executed in
+ this pseudo-variable; you can copy that number to your output with
+ `\@', but _only within a macro definition_.
+
+`LOCAL NAME [ , ... ]'
+ _Warning: `LOCAL' is only available if you select "alternate macro
+ syntax" with `--alternate' or `.altmacro'._ *Note `.altmacro':
+ Altmacro.
+
+
+File: as.info, Node: MRI, Next: Noaltmacro, Prev: Macro, Up: Pseudo Ops
+
+7.78 `.mri VAL'
+===============
+
+If VAL is non-zero, this tells `as' to enter MRI mode. If VAL is zero,
+this tells `as' to exit MRI mode. This change affects code assembled
+until the next `.mri' directive, or until the end of the file. *Note
+MRI mode: M.
+
+
+File: as.info, Node: Noaltmacro, Next: Nolist, Prev: MRI, Up: Pseudo Ops
+
+7.79 `.noaltmacro'
+==================
+
+Disable alternate macro mode. *Note Altmacro::.
+
+
+File: as.info, Node: Nolist, Next: Octa, Prev: Noaltmacro, Up: Pseudo Ops
+
+7.80 `.nolist'
+==============
+
+Control (in conjunction with the `.list' directive) whether or not
+assembly listings are generated. These two directives maintain an
+internal counter (which is zero initially). `.list' increments the
+counter, and `.nolist' decrements it. Assembly listings are generated
+whenever the counter is greater than zero.
+
+
+File: as.info, Node: Octa, Next: Org, Prev: Nolist, Up: Pseudo Ops
+
+7.81 `.octa BIGNUMS'
+====================
+
+This directive expects zero or more bignums, separated by commas. For
+each bignum, it emits a 16-byte integer.
+
+ The term "octa" comes from contexts in which a "word" is two bytes;
+hence _octa_-word for 16 bytes.
+
+
+File: as.info, Node: Org, Next: P2align, Prev: Octa, Up: Pseudo Ops
+
+7.82 `.org NEW-LC , FILL'
+=========================
+
+Advance the location counter of the current section to NEW-LC. NEW-LC
+is either an absolute expression or an expression with the same section
+as the current subsection. That is, you can't use `.org' to cross
+sections: if NEW-LC has the wrong section, the `.org' directive is
+ignored. To be compatible with former assemblers, if the section of
+NEW-LC is absolute, `as' issues a warning, then pretends the section of
+NEW-LC is the same as the current subsection.
+
+ `.org' may only increase the location counter, or leave it
+unchanged; you cannot use `.org' to move the location counter backwards.
+
+ Because `as' tries to assemble programs in one pass, NEW-LC may not
+be undefined. If you really detest this restriction we eagerly await a
+chance to share your improved assembler.
+
+ Beware that the origin is relative to the start of the section, not
+to the start of the subsection. This is compatible with other people's
+assemblers.
+
+ When the location counter (of the current subsection) is advanced,
+the intervening bytes are filled with FILL which should be an absolute
+expression. If the comma and FILL are omitted, FILL defaults to zero.
+
+
+File: as.info, Node: P2align, Next: PopSection, Prev: Org, Up: Pseudo Ops
+
+7.83 `.p2align[wl] ABS-EXPR, ABS-EXPR, ABS-EXPR'
+================================================
+
+Pad the location counter (in the current subsection) to a particular
+storage boundary. The first expression (which must be absolute) is the
+number of low-order zero bits the location counter must have after
+advancement. For example `.p2align 3' advances the location counter
+until it a multiple of 8. If the location counter is already a
+multiple of 8, no change is needed.
+
+ The second expression (also absolute) gives the fill value to be
+stored in the padding bytes. It (and the comma) may be omitted. If it
+is omitted, the padding bytes are normally zero. However, on some
+systems, if the section is marked as containing code and the fill value
+is omitted, the space is filled with no-op instructions.
+
+ The third expression is also absolute, and is also optional. If it
+is present, it is the maximum number of bytes that should be skipped by
+this alignment directive. If doing the alignment would require
+skipping more bytes than the specified maximum, then the alignment is
+not done at all. You can omit the fill value (the second argument)
+entirely by simply using two commas after the required alignment; this
+can be useful if you want the alignment to be filled with no-op
+instructions when appropriate.
+
+ The `.p2alignw' and `.p2alignl' directives are variants of the
+`.p2align' directive. The `.p2alignw' directive treats the fill
+pattern as a two byte word value. The `.p2alignl' directives treats the
+fill pattern as a four byte longword value. For example, `.p2alignw
+2,0x368d' will align to a multiple of 4. If it skips two bytes, they
+will be filled in with the value 0x368d (the exact placement of the
+bytes depends upon the endianness of the processor). If it skips 1 or
+3 bytes, the fill value is undefined.
+
+
+File: as.info, Node: PopSection, Next: Previous, Prev: P2align, Up: Pseudo Ops
+
+7.84 `.popsection'
+==================
+
+This is one of the ELF section stack manipulation directives. The
+others are `.section' (*note Section::), `.subsection' (*note
+SubSection::), `.pushsection' (*note PushSection::), and `.previous'
+(*note Previous::).
+
+ This directive replaces the current section (and subsection) with
+the top section (and subsection) on the section stack. This section is
+popped off the stack.
+
+
+File: as.info, Node: Previous, Next: Print, Prev: PopSection, Up: Pseudo Ops
+
+7.85 `.previous'
+================
+
+This is one of the ELF section stack manipulation directives. The
+others are `.section' (*note Section::), `.subsection' (*note
+SubSection::), `.pushsection' (*note PushSection::), and `.popsection'
+(*note PopSection::).
+
+ This directive swaps the current section (and subsection) with most
+recently referenced section/subsection pair prior to this one. Multiple
+`.previous' directives in a row will flip between two sections (and
+their subsections). For example:
+
+ .section A
+ .subsection 1
+ .word 0x1234
+ .subsection 2
+ .word 0x5678
+ .previous
+ .word 0x9abc
+
+ Will place 0x1234 and 0x9abc into subsection 1 and 0x5678 into
+subsection 2 of section A. Whilst:
+
+ .section A
+ .subsection 1
+ # Now in section A subsection 1
+ .word 0x1234
+ .section B
+ .subsection 0
+ # Now in section B subsection 0
+ .word 0x5678
+ .subsection 1
+ # Now in section B subsection 1
+ .word 0x9abc
+ .previous
+ # Now in section B subsection 0
+ .word 0xdef0
+
+ Will place 0x1234 into section A, 0x5678 and 0xdef0 into subsection
+0 of section B and 0x9abc into subsection 1 of section B.
+
+ In terms of the section stack, this directive swaps the current
+section with the top section on the section stack.
+
+
+File: as.info, Node: Print, Next: Protected, Prev: Previous, Up: Pseudo Ops
+
+7.86 `.print STRING'
+====================
+
+`as' will print STRING on the standard output during assembly. You
+must put STRING in double quotes.
+
+
+File: as.info, Node: Protected, Next: Psize, Prev: Print, Up: Pseudo Ops
+
+7.87 `.protected NAMES'
+=======================
+
+This is one of the ELF visibility directives. The other two are
+`.hidden' (*note Hidden::) and `.internal' (*note Internal::).
+
+ This directive overrides the named symbols default visibility (which
+is set by their binding: local, global or weak). The directive sets
+the visibility to `protected' which means that any references to the
+symbols from within the components that defines them must be resolved
+to the definition in that component, even if a definition in another
+component would normally preempt this.
+
+
+File: as.info, Node: Psize, Next: Purgem, Prev: Protected, Up: Pseudo Ops
+
+7.88 `.psize LINES , COLUMNS'
+=============================
+
+Use this directive to declare the number of lines--and, optionally, the
+number of columns--to use for each page, when generating listings.
+
+ If you do not use `.psize', listings use a default line-count of 60.
+You may omit the comma and COLUMNS specification; the default width is
+200 columns.
+
+ `as' generates formfeeds whenever the specified number of lines is
+exceeded (or whenever you explicitly request one, using `.eject').
+
+ If you specify LINES as `0', no formfeeds are generated save those
+explicitly specified with `.eject'.
+
+
+File: as.info, Node: Purgem, Next: PushSection, Prev: Psize, Up: Pseudo Ops
+
+7.89 `.purgem NAME'
+===================
+
+Undefine the macro NAME, so that later uses of the string will not be
+expanded. *Note Macro::.
+
+
+File: as.info, Node: PushSection, Next: Quad, Prev: Purgem, Up: Pseudo Ops
+
+7.90 `.pushsection NAME [, SUBSECTION] [, "FLAGS"[, @TYPE[,ARGUMENTS]]]'
+========================================================================
+
+This is one of the ELF section stack manipulation directives. The
+others are `.section' (*note Section::), `.subsection' (*note
+SubSection::), `.popsection' (*note PopSection::), and `.previous'
+(*note Previous::).
+
+ This directive pushes the current section (and subsection) onto the
+top of the section stack, and then replaces the current section and
+subsection with `name' and `subsection'. The optional `flags', `type'
+and `arguments' are treated the same as in the `.section' (*note
+Section::) directive.
+
+
+File: as.info, Node: Quad, Next: Reloc, Prev: PushSection, Up: Pseudo Ops
+
+7.91 `.quad BIGNUMS'
+====================
+
+`.quad' expects zero or more bignums, separated by commas. For each
+bignum, it emits an 8-byte integer. If the bignum won't fit in 8
+bytes, it prints a warning message; and just takes the lowest order 8
+bytes of the bignum.
+
+ The term "quad" comes from contexts in which a "word" is two bytes;
+hence _quad_-word for 8 bytes.
+
+
+File: as.info, Node: Reloc, Next: Rept, Prev: Quad, Up: Pseudo Ops
+
+7.92 `.reloc OFFSET, RELOC_NAME[, EXPRESSION]'
+==============================================
+
+Generate a relocation at OFFSET of type RELOC_NAME with value
+EXPRESSION. If OFFSET is a number, the relocation is generated in the
+current section. If OFFSET is an expression that resolves to a symbol
+plus offset, the relocation is generated in the given symbol's section.
+EXPRESSION, if present, must resolve to a symbol plus addend or to an
+absolute value, but note that not all targets support an addend. e.g.
+ELF REL targets such as i386 store an addend in the section contents
+rather than in the relocation. This low level interface does not
+support addends stored in the section.
+
+
+File: as.info, Node: Rept, Next: Sbttl, Prev: Reloc, Up: Pseudo Ops
+
+7.93 `.rept COUNT'
+==================
+
+Repeat the sequence of lines between the `.rept' directive and the next
+`.endr' directive COUNT times.
+
+ For example, assembling
+
+ .rept 3
+ .long 0
+ .endr
+
+ is equivalent to assembling
+
+ .long 0
+ .long 0
+ .long 0
+
+
+File: as.info, Node: Sbttl, Next: Scl, Prev: Rept, Up: Pseudo Ops
+
+7.94 `.sbttl "SUBHEADING"'
+==========================
+
+Use SUBHEADING as the title (third line, immediately after the title
+line) when generating assembly listings.
+
+ This directive affects subsequent pages, as well as the current page
+if it appears within ten lines of the top of a page.
+
+
+File: as.info, Node: Scl, Next: Section, Prev: Sbttl, Up: Pseudo Ops
+
+7.95 `.scl CLASS'
+=================
+
+Set the storage-class value for a symbol. This directive may only be
+used inside a `.def'/`.endef' pair. Storage class may flag whether a
+symbol is static or external, or it may record further symbolic
+debugging information.
+
+
+File: as.info, Node: Section, Next: Set, Prev: Scl, Up: Pseudo Ops
+
+7.96 `.section NAME'
+====================
+
+Use the `.section' directive to assemble the following code into a
+section named NAME.
+
+ This directive is only supported for targets that actually support
+arbitrarily named sections; on `a.out' targets, for example, it is not
+accepted, even with a standard `a.out' section name.
+
+COFF Version
+------------
+
+ For COFF targets, the `.section' directive is used in one of the
+following ways:
+
+ .section NAME[, "FLAGS"]
+ .section NAME[, SUBSECTION]
+
+ If the optional argument is quoted, it is taken as flags to use for
+the section. Each flag is a single character. The following flags are
+recognized:
+`b'
+ bss section (uninitialized data)
+
+`n'
+ section is not loaded
+
+`w'
+ writable section
+
+`d'
+ data section
+
+`r'
+ read-only section
+
+`x'
+ executable section
+
+`s'
+ shared section (meaningful for PE targets)
+
+`a'
+ ignored. (For compatibility with the ELF version)
+
+`y'
+ section is not readable (meaningful for PE targets)
+
+ If no flags are specified, the default flags depend upon the section
+name. If the section name is not recognized, the default will be for
+the section to be loaded and writable. Note the `n' and `w' flags
+remove attributes from the section, rather than adding them, so if they
+are used on their own it will be as if no flags had been specified at
+all.
+
+ If the optional argument to the `.section' directive is not quoted,
+it is taken as a subsection number (*note Sub-Sections::).
+
+ELF Version
+-----------
+
+ This is one of the ELF section stack manipulation directives. The
+others are `.subsection' (*note SubSection::), `.pushsection' (*note
+PushSection::), `.popsection' (*note PopSection::), and `.previous'
+(*note Previous::).
+
+ For ELF targets, the `.section' directive is used like this:
+
+ .section NAME [, "FLAGS"[, @TYPE[,FLAG_SPECIFIC_ARGUMENTS]]]
+
+ The optional FLAGS argument is a quoted string which may contain any
+combination of the following characters:
+`a'
+ section is allocatable
+
+`w'
+ section is writable
+
+`x'
+ section is executable
+
+`M'
+ section is mergeable
+
+`S'
+ section contains zero terminated strings
+
+`G'
+ section is a member of a section group
+
+`T'
+ section is used for thread-local-storage
+
+ The optional TYPE argument may contain one of the following
+constants:
+`@progbits'
+ section contains data
+
+`@nobits'
+ section does not contain data (i.e., section only occupies space)
+
+`@note'
+ section contains data which is used by things other than the
+ program
+
+`@init_array'
+ section contains an array of pointers to init functions
+
+`@fini_array'
+ section contains an array of pointers to finish functions
+
+`@preinit_array'
+ section contains an array of pointers to pre-init functions
+
+ Many targets only support the first three section types.
+
+ Note on targets where the `@' character is the start of a comment (eg
+ARM) then another character is used instead. For example the ARM port
+uses the `%' character.
+
+ If FLAGS contains the `M' symbol then the TYPE argument must be
+specified as well as an extra argument--ENTSIZE--like this:
+
+ .section NAME , "FLAGS"M, @TYPE, ENTSIZE
+
+ Sections with the `M' flag but not `S' flag must contain fixed size
+constants, each ENTSIZE octets long. Sections with both `M' and `S'
+must contain zero terminated strings where each character is ENTSIZE
+bytes long. The linker may remove duplicates within sections with the
+same name, same entity size and same flags. ENTSIZE must be an
+absolute expression. For sections with both `M' and `S', a string
+which is a suffix of a larger string is considered a duplicate. Thus
+`"def"' will be merged with `"abcdef"'; A reference to the first
+`"def"' will be changed to a reference to `"abcdef"+3'.
+
+ If FLAGS contains the `G' symbol then the TYPE argument must be
+present along with an additional field like this:
+
+ .section NAME , "FLAGS"G, @TYPE, GROUPNAME[, LINKAGE]
+
+ The GROUPNAME field specifies the name of the section group to which
+this particular section belongs. The optional linkage field can
+contain:
+`comdat'
+ indicates that only one copy of this section should be retained
+
+`.gnu.linkonce'
+ an alias for comdat
+
+ Note: if both the M and G flags are present then the fields for the
+Merge flag should come first, like this:
+
+ .section NAME , "FLAGS"MG, @TYPE, ENTSIZE, GROUPNAME[, LINKAGE]
+
+ If no flags are specified, the default flags depend upon the section
+name. If the section name is not recognized, the default will be for
+the section to have none of the above flags: it will not be allocated
+in memory, nor writable, nor executable. The section will contain data.
+
+ For ELF targets, the assembler supports another type of `.section'
+directive for compatibility with the Solaris assembler:
+
+ .section "NAME"[, FLAGS...]
+
+ Note that the section name is quoted. There may be a sequence of
+comma separated flags:
+`#alloc'
+ section is allocatable
+
+`#write'
+ section is writable
+
+`#execinstr'
+ section is executable
+
+`#tls'
+ section is used for thread local storage
+
+ This directive replaces the current section and subsection. See the
+contents of the gas testsuite directory `gas/testsuite/gas/elf' for
+some examples of how this directive and the other section stack
+directives work.
+
+
+File: as.info, Node: Set, Next: Short, Prev: Section, Up: Pseudo Ops
+
+7.97 `.set SYMBOL, EXPRESSION'
+==============================
+
+Set the value of SYMBOL to EXPRESSION. This changes SYMBOL's value and
+type to conform to EXPRESSION. If SYMBOL was flagged as external, it
+remains flagged (*note Symbol Attributes::).
+
+ You may `.set' a symbol many times in the same assembly.
+
+ If you `.set' a global symbol, the value stored in the object file
+is the last value stored into it.
+
+ The syntax for `set' on the HPPA is `SYMBOL .set EXPRESSION'.
+
+ On Z80 `set' is a real instruction, use `SYMBOL defl EXPRESSION'
+instead.
+
+
+File: as.info, Node: Short, Next: Single, Prev: Set, Up: Pseudo Ops
+
+7.98 `.short EXPRESSIONS'
+=========================
+
+`.short' is normally the same as `.word'. *Note `.word': Word.
+
+ In some configurations, however, `.short' and `.word' generate
+numbers of different lengths. *Note Machine Dependencies::.
+
+
+File: as.info, Node: Single, Next: Size, Prev: Short, Up: Pseudo Ops
+
+7.99 `.single FLONUMS'
+======================
+
+This directive assembles zero or more flonums, separated by commas. It
+has the same effect as `.float'. The exact kind of floating point
+numbers emitted depends on how `as' is configured. *Note Machine
+Dependencies::.
+
+
+File: as.info, Node: Size, Next: Skip, Prev: Single, Up: Pseudo Ops
+
+7.100 `.size'
+=============
+
+This directive is used to set the size associated with a symbol.
+
+COFF Version
+------------
+
+ For COFF targets, the `.size' directive is only permitted inside
+`.def'/`.endef' pairs. It is used like this:
+
+ .size EXPRESSION
+
+ELF Version
+-----------
+
+ For ELF targets, the `.size' directive is used like this:
+
+ .size NAME , EXPRESSION
+
+ This directive sets the size associated with a symbol NAME. The
+size in bytes is computed from EXPRESSION which can make use of label
+arithmetic. This directive is typically used to set the size of
+function symbols.
+
+
+File: as.info, Node: Skip, Next: Sleb128, Prev: Size, Up: Pseudo Ops
+
+7.101 `.skip SIZE , FILL'
+=========================
+
+This directive emits SIZE bytes, each of value FILL. Both SIZE and
+FILL are absolute expressions. If the comma and FILL are omitted, FILL
+is assumed to be zero. This is the same as `.space'.
+
+
+File: as.info, Node: Sleb128, Next: Space, Prev: Skip, Up: Pseudo Ops
+
+7.102 `.sleb128 EXPRESSIONS'
+============================
+
+SLEB128 stands for "signed little endian base 128." This is a compact,
+variable length representation of numbers used by the DWARF symbolic
+debugging format. *Note `.uleb128': Uleb128.
+
+
+File: as.info, Node: Space, Next: Stab, Prev: Sleb128, Up: Pseudo Ops
+
+7.103 `.space SIZE , FILL'
+==========================
+
+This directive emits SIZE bytes, each of value FILL. Both SIZE and
+FILL are absolute expressions. If the comma and FILL are omitted, FILL
+is assumed to be zero. This is the same as `.skip'.
+
+ _Warning:_ `.space' has a completely different meaning for HPPA
+ targets; use `.block' as a substitute. See `HP9000 Series 800
+ Assembly Language Reference Manual' (HP 92432-90001) for the
+ meaning of the `.space' directive. *Note HPPA Assembler
+ Directives: HPPA Directives, for a summary.
+
+
+File: as.info, Node: Stab, Next: String, Prev: Space, Up: Pseudo Ops
+
+7.104 `.stabd, .stabn, .stabs'
+==============================
+
+There are three directives that begin `.stab'. All emit symbols (*note
+Symbols::), for use by symbolic debuggers. The symbols are not entered
+in the `as' hash table: they cannot be referenced elsewhere in the
+source file. Up to five fields are required:
+
+STRING
+ This is the symbol's name. It may contain any character except
+ `\000', so is more general than ordinary symbol names. Some
+ debuggers used to code arbitrarily complex structures into symbol
+ names using this field.
+
+TYPE
+ An absolute expression. The symbol's type is set to the low 8
+ bits of this expression. Any bit pattern is permitted, but `ld'
+ and debuggers choke on silly bit patterns.
+
+OTHER
+ An absolute expression. The symbol's "other" attribute is set to
+ the low 8 bits of this expression.
+
+DESC
+ An absolute expression. The symbol's descriptor is set to the low
+ 16 bits of this expression.
+
+VALUE
+ An absolute expression which becomes the symbol's value.
+
+ If a warning is detected while reading a `.stabd', `.stabn', or
+`.stabs' statement, the symbol has probably already been created; you
+get a half-formed symbol in your object file. This is compatible with
+earlier assemblers!
+
+`.stabd TYPE , OTHER , DESC'
+ The "name" of the symbol generated is not even an empty string.
+ It is a null pointer, for compatibility. Older assemblers used a
+ null pointer so they didn't waste space in object files with empty
+ strings.
+
+ The symbol's value is set to the location counter, relocatably.
+ When your program is linked, the value of this symbol is the
+ address of the location counter when the `.stabd' was assembled.
+
+`.stabn TYPE , OTHER , DESC , VALUE'
+ The name of the symbol is set to the empty string `""'.
+
+`.stabs STRING , TYPE , OTHER , DESC , VALUE'
+ All five fields are specified.
+
+
+File: as.info, Node: String, Next: Struct, Prev: Stab, Up: Pseudo Ops
+
+7.105 `.string' "STR", `.string8' "STR", `.string16'
+====================================================
+
+"STR", `.string32' "STR", `.string64' "STR"
+
+ Copy the characters in STR to the object file. You may specify more
+than one string to copy, separated by commas. Unless otherwise
+specified for a particular machine, the assembler marks the end of each
+string with a 0 byte. You can use any of the escape sequences
+described in *Note Strings: Strings.
+
+ The variants `string16', `string32' and `string64' differ from the
+`string' pseudo opcode in that each 8-bit character from STR is copied
+and expanded to 16, 32 or 64 bits respectively. The expanded characters
+are stored in target endianness byte order.
+
+ Example:
+ .string32 "BYE"
+ expands to:
+ .string "B\0\0\0Y\0\0\0E\0\0\0" /* On little endian targets. */
+ .string "\0\0\0B\0\0\0Y\0\0\0E" /* On big endian targets. */
+
+
+File: as.info, Node: Struct, Next: SubSection, Prev: String, Up: Pseudo Ops
+
+7.106 `.struct EXPRESSION'
+==========================
+
+Switch to the absolute section, and set the section offset to
+EXPRESSION, which must be an absolute expression. You might use this
+as follows:
+ .struct 0
+ field1:
+ .struct field1 + 4
+ field2:
+ .struct field2 + 4
+ field3:
+ This would define the symbol `field1' to have the value 0, the symbol
+`field2' to have the value 4, and the symbol `field3' to have the value
+8. Assembly would be left in the absolute section, and you would need
+to use a `.section' directive of some sort to change to some other
+section before further assembly.
+
+
+File: as.info, Node: SubSection, Next: Symver, Prev: Struct, Up: Pseudo Ops
+
+7.107 `.subsection NAME'
+========================
+
+This is one of the ELF section stack manipulation directives. The
+others are `.section' (*note Section::), `.pushsection' (*note
+PushSection::), `.popsection' (*note PopSection::), and `.previous'
+(*note Previous::).
+
+ This directive replaces the current subsection with `name'. The
+current section is not changed. The replaced subsection is put onto
+the section stack in place of the then current top of stack subsection.
+
+
+File: as.info, Node: Symver, Next: Tag, Prev: SubSection, Up: Pseudo Ops
+
+7.108 `.symver'
+===============
+
+Use the `.symver' directive to bind symbols to specific version nodes
+within a source file. This is only supported on ELF platforms, and is
+typically used when assembling files to be linked into a shared library.
+There are cases where it may make sense to use this in objects to be
+bound into an application itself so as to override a versioned symbol
+from a shared library.
+
+ For ELF targets, the `.symver' directive can be used like this:
+ .symver NAME, NAME2@NODENAME
+ If the symbol NAME is defined within the file being assembled, the
+`.symver' directive effectively creates a symbol alias with the name
+NAME2@NODENAME, and in fact the main reason that we just don't try and
+create a regular alias is that the @ character isn't permitted in
+symbol names. The NAME2 part of the name is the actual name of the
+symbol by which it will be externally referenced. The name NAME itself
+is merely a name of convenience that is used so that it is possible to
+have definitions for multiple versions of a function within a single
+source file, and so that the compiler can unambiguously know which
+version of a function is being mentioned. The NODENAME portion of the
+alias should be the name of a node specified in the version script
+supplied to the linker when building a shared library. If you are
+attempting to override a versioned symbol from a shared library, then
+NODENAME should correspond to the nodename of the symbol you are trying
+to override.
+
+ If the symbol NAME is not defined within the file being assembled,
+all references to NAME will be changed to NAME2@NODENAME. If no
+reference to NAME is made, NAME2@NODENAME will be removed from the
+symbol table.
+
+ Another usage of the `.symver' directive is:
+ .symver NAME, NAME2@@NODENAME
+ In this case, the symbol NAME must exist and be defined within the
+file being assembled. It is similar to NAME2@NODENAME. The difference
+is NAME2@@NODENAME will also be used to resolve references to NAME2 by
+the linker.
+
+ The third usage of the `.symver' directive is:
+ .symver NAME, NAME2@@@NODENAME
+ When NAME is not defined within the file being assembled, it is
+treated as NAME2@NODENAME. When NAME is defined within the file being
+assembled, the symbol name, NAME, will be changed to NAME2@@NODENAME.
+
+
+File: as.info, Node: Tag, Next: Text, Prev: Symver, Up: Pseudo Ops
+
+7.109 `.tag STRUCTNAME'
+=======================
+
+This directive is generated by compilers to include auxiliary debugging
+information in the symbol table. It is only permitted inside
+`.def'/`.endef' pairs. Tags are used to link structure definitions in
+the symbol table with instances of those structures.
+
+
+File: as.info, Node: Text, Next: Title, Prev: Tag, Up: Pseudo Ops
+
+7.110 `.text SUBSECTION'
+========================
+
+Tells `as' to assemble the following statements onto the end of the
+text subsection numbered SUBSECTION, which is an absolute expression.
+If SUBSECTION is omitted, subsection number zero is used.
+
+
+File: as.info, Node: Title, Next: Type, Prev: Text, Up: Pseudo Ops
+
+7.111 `.title "HEADING"'
+========================
+
+Use HEADING as the title (second line, immediately after the source
+file name and pagenumber) when generating assembly listings.
+
+ This directive affects subsequent pages, as well as the current page
+if it appears within ten lines of the top of a page.
+
+
+File: as.info, Node: Type, Next: Uleb128, Prev: Title, Up: Pseudo Ops
+
+7.112 `.type'
+=============
+
+This directive is used to set the type of a symbol.
+
+COFF Version
+------------
+
+ For COFF targets, this directive is permitted only within
+`.def'/`.endef' pairs. It is used like this:
+
+ .type INT
+
+ This records the integer INT as the type attribute of a symbol table
+entry.
+
+ELF Version
+-----------
+
+ For ELF targets, the `.type' directive is used like this:
+
+ .type NAME , TYPE DESCRIPTION
+
+ This sets the type of symbol NAME to be either a function symbol or
+an object symbol. There are five different syntaxes supported for the
+TYPE DESCRIPTION field, in order to provide compatibility with various
+other assemblers.
+
+ Because some of the characters used in these syntaxes (such as `@'
+and `#') are comment characters for some architectures, some of the
+syntaxes below do not work on all architectures. The first variant
+will be accepted by the GNU assembler on all architectures so that
+variant should be used for maximum portability, if you do not need to
+assemble your code with other assemblers.
+
+ The syntaxes supported are:
+
+ .type <name> STT_<TYPE_IN_UPPER_CASE>
+ .type <name>,#<type>
+ .type <name>,@<type>
+ .type <name>,%<type>
+ .type <name>,"<type>"
+
+ The types supported are:
+
+`STT_FUNC'
+`function'
+ Mark the symbol as being a function name.
+
+`STT_GNU_IFUNC'
+`gnu_indirect_function'
+ Mark the symbol as an indirect function when evaluated during reloc
+ processing. (This is only supported on Linux targeted assemblers).
+
+`STT_OBJECT'
+`object'
+ Mark the symbol as being a data object.
+
+`STT_TLS'
+`tls_object'
+ Mark the symbol as being a thead-local data object.
+
+`STT_COMMON'
+`common'
+ Mark the symbol as being a common data object.
+
+`STT_NOTYPE'
+`notype'
+ Does not mark the symbol in any way. It is supported just for
+ completeness.
+
+`gnu_unique_object'
+ Marks the symbol as being a globally unique data object. The
+ dynamic linker will make sure that in the entire process there is
+ just one symbol with this name and type in use. (This is only
+ supported on Linux targeted assemblers).
+
+
+ Note: Some targets support extra types in addition to those listed
+above.
+
+
+File: as.info, Node: Uleb128, Next: Val, Prev: Type, Up: Pseudo Ops
+
+7.113 `.uleb128 EXPRESSIONS'
+============================
+
+ULEB128 stands for "unsigned little endian base 128." This is a
+compact, variable length representation of numbers used by the DWARF
+symbolic debugging format. *Note `.sleb128': Sleb128.
+
+
+File: as.info, Node: Val, Next: Version, Prev: Uleb128, Up: Pseudo Ops
+
+7.114 `.val ADDR'
+=================
+
+This directive, permitted only within `.def'/`.endef' pairs, records
+the address ADDR as the value attribute of a symbol table entry.
+
+
+File: as.info, Node: Version, Next: VTableEntry, Prev: Val, Up: Pseudo Ops
+
+7.115 `.version "STRING"'
+=========================
+
+This directive creates a `.note' section and places into it an ELF
+formatted note of type NT_VERSION. The note's name is set to `string'.
+
+
+File: as.info, Node: VTableEntry, Next: VTableInherit, Prev: Version, Up: Pseudo Ops
+
+7.116 `.vtable_entry TABLE, OFFSET'
+===================================
+
+This directive finds or creates a symbol `table' and creates a
+`VTABLE_ENTRY' relocation for it with an addend of `offset'.
+
+
+File: as.info, Node: VTableInherit, Next: Warning, Prev: VTableEntry, Up: Pseudo Ops
+
+7.117 `.vtable_inherit CHILD, PARENT'
+=====================================
+
+This directive finds the symbol `child' and finds or creates the symbol
+`parent' and then creates a `VTABLE_INHERIT' relocation for the parent
+whose addend is the value of the child symbol. As a special case the
+parent name of `0' is treated as referring to the `*ABS*' section.
+
+
+File: as.info, Node: Warning, Next: Weak, Prev: VTableInherit, Up: Pseudo Ops
+
+7.118 `.warning "STRING"'
+=========================
+
+Similar to the directive `.error' (*note `.error "STRING"': Error.),
+but just emits a warning.
+
+
+File: as.info, Node: Weak, Next: Weakref, Prev: Warning, Up: Pseudo Ops
+
+7.119 `.weak NAMES'
+===================
+
+This directive sets the weak attribute on the comma separated list of
+symbol `names'. If the symbols do not already exist, they will be
+created.
+
+ On COFF targets other than PE, weak symbols are a GNU extension.
+This directive sets the weak attribute on the comma separated list of
+symbol `names'. If the symbols do not already exist, they will be
+created.
+
+ On the PE target, weak symbols are supported natively as weak
+aliases. When a weak symbol is created that is not an alias, GAS
+creates an alternate symbol to hold the default value.
+
+
+File: as.info, Node: Weakref, Next: Word, Prev: Weak, Up: Pseudo Ops
+
+7.120 `.weakref ALIAS, TARGET'
+==============================
+
+This directive creates an alias to the target symbol that enables the
+symbol to be referenced with weak-symbol semantics, but without
+actually making it weak. If direct references or definitions of the
+symbol are present, then the symbol will not be weak, but if all
+references to it are through weak references, the symbol will be marked
+as weak in the symbol table.
+
+ The effect is equivalent to moving all references to the alias to a
+separate assembly source file, renaming the alias to the symbol in it,
+declaring the symbol as weak there, and running a reloadable link to
+merge the object files resulting from the assembly of the new source
+file and the old source file that had the references to the alias
+removed.
+
+ The alias itself never makes to the symbol table, and is entirely
+handled within the assembler.
+
+
+File: as.info, Node: Word, Next: Deprecated, Prev: Weakref, Up: Pseudo Ops
+
+7.121 `.word EXPRESSIONS'
+=========================
+
+This directive expects zero or more EXPRESSIONS, of any section,
+separated by commas.
+
+ The size of the number emitted, and its byte order, depend on what
+target computer the assembly is for.
+
+ _Warning: Special Treatment to support Compilers_
+
+ Machines with a 32-bit address space, but that do less than 32-bit
+addressing, require the following special treatment. If the machine of
+interest to you does 32-bit addressing (or doesn't require it; *note
+Machine Dependencies::), you can ignore this issue.
+
+ In order to assemble compiler output into something that works, `as'
+occasionally does strange things to `.word' directives. Directives of
+the form `.word sym1-sym2' are often emitted by compilers as part of
+jump tables. Therefore, when `as' assembles a directive of the form
+`.word sym1-sym2', and the difference between `sym1' and `sym2' does
+not fit in 16 bits, `as' creates a "secondary jump table", immediately
+before the next label. This secondary jump table is preceded by a
+short-jump to the first byte after the secondary table. This
+short-jump prevents the flow of control from accidentally falling into
+the new table. Inside the table is a long-jump to `sym2'. The
+original `.word' contains `sym1' minus the address of the long-jump to
+`sym2'.
+
+ If there were several occurrences of `.word sym1-sym2' before the
+secondary jump table, all of them are adjusted. If there was a `.word
+sym3-sym4', that also did not fit in sixteen bits, a long-jump to
+`sym4' is included in the secondary jump table, and the `.word'
+directives are adjusted to contain `sym3' minus the address of the
+long-jump to `sym4'; and so on, for as many entries in the original
+jump table as necessary.
+
+
+File: as.info, Node: Deprecated, Prev: Word, Up: Pseudo Ops
+
+7.122 Deprecated Directives
+===========================
+
+One day these directives won't work. They are included for
+compatibility with older assemblers.
+.abort
+
+.line
+
+
+File: as.info, Node: Object Attributes, Next: Machine Dependencies, Prev: Pseudo Ops, Up: Top
+
+8 Object Attributes
+*******************
+
+`as' assembles source files written for a specific architecture into
+object files for that architecture. But not all object files are alike.
+Many architectures support incompatible variations. For instance,
+floating point arguments might be passed in floating point registers if
+the object file requires hardware floating point support--or floating
+point arguments might be passed in integer registers if the object file
+supports processors with no hardware floating point unit. Or, if two
+objects are built for different generations of the same architecture,
+the combination may require the newer generation at run-time.
+
+ This information is useful during and after linking. At link time,
+`ld' can warn about incompatible object files. After link time, tools
+like `gdb' can use it to process the linked file correctly.
+
+ Compatibility information is recorded as a series of object
+attributes. Each attribute has a "vendor", "tag", and "value". The
+vendor is a string, and indicates who sets the meaning of the tag. The
+tag is an integer, and indicates what property the attribute describes.
+The value may be a string or an integer, and indicates how the
+property affects this object. Missing attributes are the same as
+attributes with a zero value or empty string value.
+
+ Object attributes were developed as part of the ABI for the ARM
+Architecture. The file format is documented in `ELF for the ARM
+Architecture'.
+
+* Menu:
+
+* GNU Object Attributes:: GNU Object Attributes
+* Defining New Object Attributes:: Defining New Object Attributes
+
+
+File: as.info, Node: GNU Object Attributes, Next: Defining New Object Attributes, Up: Object Attributes
+
+8.1 GNU Object Attributes
+=========================
+
+The `.gnu_attribute' directive records an object attribute with vendor
+`gnu'.
+
+ Except for `Tag_compatibility', which has both an integer and a
+string for its value, GNU attributes have a string value if the tag
+number is odd and an integer value if the tag number is even. The
+second bit (`TAG & 2' is set for architecture-independent attributes
+and clear for architecture-dependent ones.
+
+8.1.1 Common GNU attributes
+---------------------------
+
+These attributes are valid on all architectures.
+
+Tag_compatibility (32)
+ The compatibility attribute takes an integer flag value and a
+ vendor name. If the flag value is 0, the file is compatible with
+ other toolchains. If it is 1, then the file is only compatible
+ with the named toolchain. If it is greater than 1, the file can
+ only be processed by other toolchains under some private
+ arrangement indicated by the flag value and the vendor name.
+
+8.1.2 MIPS Attributes
+---------------------
+
+Tag_GNU_MIPS_ABI_FP (4)
+ The floating-point ABI used by this object file. The value will
+ be:
+
+ * 0 for files not affected by the floating-point ABI.
+
+ * 1 for files using the hardware floating-point with a standard
+ double-precision FPU.
+
+ * 2 for files using the hardware floating-point ABI with a
+ single-precision FPU.
+
+ * 3 for files using the software floating-point ABI.
+
+ * 4 for files using the hardware floating-point ABI with 64-bit
+ wide double-precision floating-point registers and 32-bit
+ wide general purpose registers.
+
+8.1.3 PowerPC Attributes
+------------------------
+
+Tag_GNU_Power_ABI_FP (4)
+ The floating-point ABI used by this object file. The value will
+ be:
+
+ * 0 for files not affected by the floating-point ABI.
+
+ * 1 for files using double-precision hardware floating-point
+ ABI.
+
+ * 2 for files using the software floating-point ABI.
+
+ * 3 for files using single-precision hardware floating-point
+ ABI.
+
+Tag_GNU_Power_ABI_Vector (8)
+ The vector ABI used by this object file. The value will be:
+
+ * 0 for files not affected by the vector ABI.
+
+ * 1 for files using general purpose registers to pass vectors.
+
+ * 2 for files using AltiVec registers to pass vectors.
+
+ * 3 for files using SPE registers to pass vectors.
+
+
+File: as.info, Node: Defining New Object Attributes, Prev: GNU Object Attributes, Up: Object Attributes
+
+8.2 Defining New Object Attributes
+==================================
+
+If you want to define a new GNU object attribute, here are the places
+you will need to modify. New attributes should be discussed on the
+`binutils' mailing list.
+
+ * This manual, which is the official register of attributes.
+
+ * The header for your architecture `include/elf', to define the tag.
+
+ * The `bfd' support file for your architecture, to merge the
+ attribute and issue any appropriate link warnings.
+
+ * Test cases in `ld/testsuite' for merging and link warnings.
+
+ * `binutils/readelf.c' to display your attribute.
+
+ * GCC, if you want the compiler to mark the attribute automatically.
+
+
+File: as.info, Node: Machine Dependencies, Next: Reporting Bugs, Prev: Object Attributes, Up: Top
+
+9 Machine Dependent Features
+****************************
+
+The machine instruction sets are (almost by definition) different on
+each machine where `as' runs. Floating point representations vary as
+well, and `as' often supports a few additional directives or
+command-line options for compatibility with other assemblers on a
+particular platform. Finally, some versions of `as' support special
+pseudo-instructions for branch optimization.
+
+ This chapter discusses most of these differences, though it does not
+include details on any machine's instruction set. For details on that
+subject, see the hardware manufacturer's manual.
+
+* Menu:
+
+
+* Alpha-Dependent:: Alpha Dependent Features
+
+* ARC-Dependent:: ARC Dependent Features
+
+* ARM-Dependent:: ARM Dependent Features
+
+* AVR-Dependent:: AVR Dependent Features
+
+* Blackfin-Dependent:: Blackfin Dependent Features
+
+* CR16-Dependent:: CR16 Dependent Features
+
+* CRIS-Dependent:: CRIS Dependent Features
+
+* D10V-Dependent:: D10V Dependent Features
+
+* D30V-Dependent:: D30V Dependent Features
+
+* H8/300-Dependent:: Renesas H8/300 Dependent Features
+
+* HPPA-Dependent:: HPPA Dependent Features
+
+* ESA/390-Dependent:: IBM ESA/390 Dependent Features
+
+* i386-Dependent:: Intel 80386 and AMD x86-64 Dependent Features
+
+* i860-Dependent:: Intel 80860 Dependent Features
+
+* i960-Dependent:: Intel 80960 Dependent Features
+
+* IA-64-Dependent:: Intel IA-64 Dependent Features
+
+* IP2K-Dependent:: IP2K Dependent Features
+
+* LM32-Dependent:: LM32 Dependent Features
+
+* M32C-Dependent:: M32C Dependent Features
+
+* M32R-Dependent:: M32R Dependent Features
+
+* M68K-Dependent:: M680x0 Dependent Features
+
+* M68HC11-Dependent:: M68HC11 and 68HC12 Dependent Features
+
+* MicroBlaze-Dependent:: MICROBLAZE Dependent Features
+
+* MIPS-Dependent:: MIPS Dependent Features
+
+* MMIX-Dependent:: MMIX Dependent Features
+
+* MSP430-Dependent:: MSP430 Dependent Features
+
+* SH-Dependent:: Renesas / SuperH SH Dependent Features
+* SH64-Dependent:: SuperH SH64 Dependent Features
+
+* PDP-11-Dependent:: PDP-11 Dependent Features
+
+* PJ-Dependent:: picoJava Dependent Features
+
+* PPC-Dependent:: PowerPC Dependent Features
+
+* S/390-Dependent:: IBM S/390 Dependent Features
+
+* SCORE-Dependent:: SCORE Dependent Features
+
+* Sparc-Dependent:: SPARC Dependent Features
+
+* TIC54X-Dependent:: TI TMS320C54x Dependent Features
+
+* V850-Dependent:: V850 Dependent Features
+
+* Xtensa-Dependent:: Xtensa Dependent Features
+
+* Z80-Dependent:: Z80 Dependent Features
+
+* Z8000-Dependent:: Z8000 Dependent Features
+
+* Vax-Dependent:: VAX Dependent Features
+
+
+File: as.info, Node: Alpha-Dependent, Next: ARC-Dependent, Up: Machine Dependencies
+
+9.1 Alpha Dependent Features
+============================
+
+* Menu:
+
+* Alpha Notes:: Notes
+* Alpha Options:: Options
+* Alpha Syntax:: Syntax
+* Alpha Floating Point:: Floating Point
+* Alpha Directives:: Alpha Machine Directives
+* Alpha Opcodes:: Opcodes
+
+
+File: as.info, Node: Alpha Notes, Next: Alpha Options, Up: Alpha-Dependent
+
+9.1.1 Notes
+-----------
+
+The documentation here is primarily for the ELF object format. `as'
+also supports the ECOFF and EVAX formats, but features specific to
+these formats are not yet documented.
+
+
+File: as.info, Node: Alpha Options, Next: Alpha Syntax, Prev: Alpha Notes, Up: Alpha-Dependent
+
+9.1.2 Options
+-------------
+
+`-mCPU'
+ This option specifies the target processor. If an attempt is made
+ to assemble an instruction which will not execute on the target
+ processor, the assembler may either expand the instruction as a
+ macro or issue an error message. This option is equivalent to the
+ `.arch' directive.
+
+ The following processor names are recognized: `21064', `21064a',
+ `21066', `21068', `21164', `21164a', `21164pc', `21264', `21264a',
+ `21264b', `ev4', `ev5', `lca45', `ev5', `ev56', `pca56', `ev6',
+ `ev67', `ev68'. The special name `all' may be used to allow the
+ assembler to accept instructions valid for any Alpha processor.
+
+ In order to support existing practice in OSF/1 with respect to
+ `.arch', and existing practice within `MILO' (the Linux ARC
+ bootloader), the numbered processor names (e.g. 21064) enable the
+ processor-specific PALcode instructions, while the
+ "electro-vlasic" names (e.g. `ev4') do not.
+
+`-mdebug'
+`-no-mdebug'
+ Enables or disables the generation of `.mdebug' encapsulation for
+ stabs directives and procedure descriptors. The default is to
+ automatically enable `.mdebug' when the first stabs directive is
+ seen.
+
+`-relax'
+ This option forces all relocations to be put into the object file,
+ instead of saving space and resolving some relocations at assembly
+ time. Note that this option does not propagate all symbol
+ arithmetic into the object file, because not all symbol arithmetic
+ can be represented. However, the option can still be useful in
+ specific applications.
+
+`-replace'
+
+`-noreplace'
+ Enables or disables the optimization of procedure calls, both at
+ assemblage and at link time. These options are only available for
+ VMS targets and `-replace' is the default. See section 1.4.1 of
+ the OpenVMS Linker Utility Manual.
+
+`-g'
+ This option is used when the compiler generates debug information.
+ When `gcc' is using `mips-tfile' to generate debug information
+ for ECOFF, local labels must be passed through to the object file.
+ Otherwise this option has no effect.
+
+`-GSIZE'
+ A local common symbol larger than SIZE is placed in `.bss', while
+ smaller symbols are placed in `.sbss'.
+
+`-F'
+`-32addr'
+ These options are ignored for backward compatibility.
+
+
+File: as.info, Node: Alpha Syntax, Next: Alpha Floating Point, Prev: Alpha Options, Up: Alpha-Dependent
+
+9.1.3 Syntax
+------------
+
+The assembler syntax closely follow the Alpha Reference Manual;
+assembler directives and general syntax closely follow the OSF/1 and
+OpenVMS syntax, with a few differences for ELF.
+
+* Menu:
+
+* Alpha-Chars:: Special Characters
+* Alpha-Regs:: Register Names
+* Alpha-Relocs:: Relocations
+
+
+File: as.info, Node: Alpha-Chars, Next: Alpha-Regs, Up: Alpha Syntax
+
+9.1.3.1 Special Characters
+..........................
+
+`#' is the line comment character.
+
+ `;' can be used instead of a newline to separate statements.
+
+
+File: as.info, Node: Alpha-Regs, Next: Alpha-Relocs, Prev: Alpha-Chars, Up: Alpha Syntax
+
+9.1.3.2 Register Names
+......................
+
+The 32 integer registers are referred to as `$N' or `$rN'. In
+addition, registers 15, 28, 29, and 30 may be referred to by the
+symbols `$fp', `$at', `$gp', and `$sp' respectively.
+
+ The 32 floating-point registers are referred to as `$fN'.
+
+
+File: as.info, Node: Alpha-Relocs, Prev: Alpha-Regs, Up: Alpha Syntax
+
+9.1.3.3 Relocations
+...................
+
+Some of these relocations are available for ECOFF, but mostly only for
+ELF. They are modeled after the relocation format introduced in
+Digital Unix 4.0, but there are additions.
+
+ The format is `!TAG' or `!TAG!NUMBER' where TAG is the name of the
+relocation. In some cases NUMBER is used to relate specific
+instructions.
+
+ The relocation is placed at the end of the instruction like so:
+
+ ldah $0,a($29) !gprelhigh
+ lda $0,a($0) !gprellow
+ ldq $1,b($29) !literal!100
+ ldl $2,0($1) !lituse_base!100
+
+`!literal'
+`!literal!N'
+ Used with an `ldq' instruction to load the address of a symbol
+ from the GOT.
+
+ A sequence number N is optional, and if present is used to pair
+ `lituse' relocations with this `literal' relocation. The `lituse'
+ relocations are used by the linker to optimize the code based on
+ the final location of the symbol.
+
+ Note that these optimizations are dependent on the data flow of the
+ program. Therefore, if _any_ `lituse' is paired with a `literal'
+ relocation, then _all_ uses of the register set by the `literal'
+ instruction must also be marked with `lituse' relocations. This
+ is because the original `literal' instruction may be deleted or
+ transformed into another instruction.
+
+ Also note that there may be a one-to-many relationship between
+ `literal' and `lituse', but not a many-to-one. That is, if there
+ are two code paths that load up the same address and feed the
+ value to a single use, then the use may not use a `lituse'
+ relocation.
+
+`!lituse_base!N'
+ Used with any memory format instruction (e.g. `ldl') to indicate
+ that the literal is used for an address load. The offset field of
+ the instruction must be zero. During relaxation, the code may be
+ altered to use a gp-relative load.
+
+`!lituse_jsr!N'
+ Used with a register branch format instruction (e.g. `jsr') to
+ indicate that the literal is used for a call. During relaxation,
+ the code may be altered to use a direct branch (e.g. `bsr').
+
+`!lituse_jsrdirect!N'
+ Similar to `lituse_jsr', but also that this call cannot be vectored
+ through a PLT entry. This is useful for functions with special
+ calling conventions which do not allow the normal call-clobbered
+ registers to be clobbered.
+
+`!lituse_bytoff!N'
+ Used with a byte mask instruction (e.g. `extbl') to indicate that
+ only the low 3 bits of the address are relevant. During
+ relaxation, the code may be altered to use an immediate instead of
+ a register shift.
+
+`!lituse_addr!N'
+ Used with any other instruction to indicate that the original
+ address is in fact used, and the original `ldq' instruction may
+ not be altered or deleted. This is useful in conjunction with
+ `lituse_jsr' to test whether a weak symbol is defined.
+
+ ldq $27,foo($29) !literal!1
+ beq $27,is_undef !lituse_addr!1
+ jsr $26,($27),foo !lituse_jsr!1
+
+`!lituse_tlsgd!N'
+ Used with a register branch format instruction to indicate that the
+ literal is the call to `__tls_get_addr' used to compute the
+ address of the thread-local storage variable whose descriptor was
+ loaded with `!tlsgd!N'.
+
+`!lituse_tlsldm!N'
+ Used with a register branch format instruction to indicate that the
+ literal is the call to `__tls_get_addr' used to compute the
+ address of the base of the thread-local storage block for the
+ current module. The descriptor for the module must have been
+ loaded with `!tlsldm!N'.
+
+`!gpdisp!N'
+ Used with `ldah' and `lda' to load the GP from the current
+ address, a-la the `ldgp' macro. The source register for the
+ `ldah' instruction must contain the address of the `ldah'
+ instruction. There must be exactly one `lda' instruction paired
+ with the `ldah' instruction, though it may appear anywhere in the
+ instruction stream. The immediate operands must be zero.
+
+ bsr $26,foo
+ ldah $29,0($26) !gpdisp!1
+ lda $29,0($29) !gpdisp!1
+
+`!gprelhigh'
+ Used with an `ldah' instruction to add the high 16 bits of a
+ 32-bit displacement from the GP.
+
+`!gprellow'
+ Used with any memory format instruction to add the low 16 bits of a
+ 32-bit displacement from the GP.
+
+`!gprel'
+ Used with any memory format instruction to add a 16-bit
+ displacement from the GP.
+
+`!samegp'
+ Used with any branch format instruction to skip the GP load at the
+ target address. The referenced symbol must have the same GP as the
+ source object file, and it must be declared to either not use `$27'
+ or perform a standard GP load in the first two instructions via the
+ `.prologue' directive.
+
+`!tlsgd'
+`!tlsgd!N'
+ Used with an `lda' instruction to load the address of a TLS
+ descriptor for a symbol in the GOT.
+
+ The sequence number N is optional, and if present it used to pair
+ the descriptor load with both the `literal' loading the address of
+ the `__tls_get_addr' function and the `lituse_tlsgd' marking the
+ call to that function.
+
+ For proper relaxation, both the `tlsgd', `literal' and `lituse'
+ relocations must be in the same extended basic block. That is,
+ the relocation with the lowest address must be executed first at
+ runtime.
+
+`!tlsldm'
+`!tlsldm!N'
+ Used with an `lda' instruction to load the address of a TLS
+ descriptor for the current module in the GOT.
+
+ Similar in other respects to `tlsgd'.
+
+`!gotdtprel'
+ Used with an `ldq' instruction to load the offset of the TLS
+ symbol within its module's thread-local storage block. Also known
+ as the dynamic thread pointer offset or dtp-relative offset.
+
+`!dtprelhi'
+`!dtprello'
+`!dtprel'
+ Like `gprel' relocations except they compute dtp-relative offsets.
+
+`!gottprel'
+ Used with an `ldq' instruction to load the offset of the TLS
+ symbol from the thread pointer. Also known as the tp-relative
+ offset.
+
+`!tprelhi'
+`!tprello'
+`!tprel'
+ Like `gprel' relocations except they compute tp-relative offsets.
+
+
+File: as.info, Node: Alpha Floating Point, Next: Alpha Directives, Prev: Alpha Syntax, Up: Alpha-Dependent
+
+9.1.4 Floating Point
+--------------------
+
+The Alpha family uses both IEEE and VAX floating-point numbers.
+
+
+File: as.info, Node: Alpha Directives, Next: Alpha Opcodes, Prev: Alpha Floating Point, Up: Alpha-Dependent
+
+9.1.5 Alpha Assembler Directives
+--------------------------------
+
+`as' for the Alpha supports many additional directives for
+compatibility with the native assembler. This section describes them
+only briefly.
+
+ These are the additional directives in `as' for the Alpha:
+
+`.arch CPU'
+ Specifies the target processor. This is equivalent to the `-mCPU'
+ command-line option. *Note Options: Alpha Options, for a list of
+ values for CPU.
+
+`.ent FUNCTION[, N]'
+ Mark the beginning of FUNCTION. An optional number may follow for
+ compatibility with the OSF/1 assembler, but is ignored. When
+ generating `.mdebug' information, this will create a procedure
+ descriptor for the function. In ELF, it will mark the symbol as a
+ function a-la the generic `.type' directive.
+
+`.end FUNCTION'
+ Mark the end of FUNCTION. In ELF, it will set the size of the
+ symbol a-la the generic `.size' directive.
+
+`.mask MASK, OFFSET'
+ Indicate which of the integer registers are saved in the current
+ function's stack frame. MASK is interpreted a bit mask in which
+ bit N set indicates that register N is saved. The registers are
+ saved in a block located OFFSET bytes from the "canonical frame
+ address" (CFA) which is the value of the stack pointer on entry to
+ the function. The registers are saved sequentially, except that
+ the return address register (normally `$26') is saved first.
+
+ This and the other directives that describe the stack frame are
+ currently only used when generating `.mdebug' information. They
+ may in the future be used to generate DWARF2 `.debug_frame' unwind
+ information for hand written assembly.
+
+`.fmask MASK, OFFSET'
+ Indicate which of the floating-point registers are saved in the
+ current stack frame. The MASK and OFFSET parameters are
+ interpreted as with `.mask'.
+
+`.frame FRAMEREG, FRAMEOFFSET, RETREG[, ARGOFFSET]'
+ Describes the shape of the stack frame. The frame pointer in use
+ is FRAMEREG; normally this is either `$fp' or `$sp'. The frame
+ pointer is FRAMEOFFSET bytes below the CFA. The return address is
+ initially located in RETREG until it is saved as indicated in
+ `.mask'. For compatibility with OSF/1 an optional ARGOFFSET
+ parameter is accepted and ignored. It is believed to indicate the
+ offset from the CFA to the saved argument registers.
+
+`.prologue N'
+ Indicate that the stack frame is set up and all registers have been
+ spilled. The argument N indicates whether and how the function
+ uses the incoming "procedure vector" (the address of the called
+ function) in `$27'. 0 indicates that `$27' is not used; 1
+ indicates that the first two instructions of the function use `$27'
+ to perform a load of the GP register; 2 indicates that `$27' is
+ used in some non-standard way and so the linker cannot elide the
+ load of the procedure vector during relaxation.
+
+`.usepv FUNCTION, WHICH'
+ Used to indicate the use of the `$27' register, similar to
+ `.prologue', but without the other semantics of needing to be
+ inside an open `.ent'/`.end' block.
+
+ The WHICH argument should be either `no', indicating that `$27' is
+ not used, or `std', indicating that the first two instructions of
+ the function perform a GP load.
+
+ One might use this directive instead of `.prologue' if you are
+ also using dwarf2 CFI directives.
+
+`.gprel32 EXPRESSION'
+ Computes the difference between the address in EXPRESSION and the
+ GP for the current object file, and stores it in 4 bytes. In
+ addition to being smaller than a full 8 byte address, this also
+ does not require a dynamic relocation when used in a shared
+ library.
+
+`.t_floating EXPRESSION'
+ Stores EXPRESSION as an IEEE double precision value.
+
+`.s_floating EXPRESSION'
+ Stores EXPRESSION as an IEEE single precision value.
+
+`.f_floating EXPRESSION'
+ Stores EXPRESSION as a VAX F format value.
+
+`.g_floating EXPRESSION'
+ Stores EXPRESSION as a VAX G format value.
+
+`.d_floating EXPRESSION'
+ Stores EXPRESSION as a VAX D format value.
+
+`.set FEATURE'
+ Enables or disables various assembler features. Using the positive
+ name of the feature enables while using `noFEATURE' disables.
+
+ `at'
+ Indicates that macro expansions may clobber the "assembler
+ temporary" (`$at' or `$28') register. Some macros may not be
+ expanded without this and will generate an error message if
+ `noat' is in effect. When `at' is in effect, a warning will
+ be generated if `$at' is used by the programmer.
+
+ `macro'
+ Enables the expansion of macro instructions. Note that
+ variants of real instructions, such as `br label' vs `br
+ $31,label' are considered alternate forms and not macros.
+
+ `move'
+ `reorder'
+ `volatile'
+ These control whether and how the assembler may re-order
+ instructions. Accepted for compatibility with the OSF/1
+ assembler, but `as' does not do instruction scheduling, so
+ these features are ignored.
+
+ The following directives are recognized for compatibility with the
+OSF/1 assembler but are ignored.
+
+ .proc .aproc
+ .reguse .livereg
+ .option .aent
+ .ugen .eflag
+ .alias .noalias
+
+
+File: as.info, Node: Alpha Opcodes, Prev: Alpha Directives, Up: Alpha-Dependent
+
+9.1.6 Opcodes
+-------------
+
+For detailed information on the Alpha machine instruction set, see the
+Alpha Architecture Handbook
+(ftp://ftp.digital.com/pub/Digital/info/semiconductor/literature/alphaahb.pdf).
+
+
+File: as.info, Node: ARC-Dependent, Next: ARM-Dependent, Prev: Alpha-Dependent, Up: Machine Dependencies
+
+9.2 ARC Dependent Features
+==========================
+
+* Menu:
+
+* ARC Options:: Options
+* ARC Syntax:: Syntax
+* ARC Floating Point:: Floating Point
+* ARC Directives:: ARC Machine Directives
+* ARC Opcodes:: Opcodes
+
+
+File: as.info, Node: ARC Options, Next: ARC Syntax, Up: ARC-Dependent
+
+9.2.1 Options
+-------------
+
+`-marc[5|6|7|8]'
+ This option selects the core processor variant. Using `-marc' is
+ the same as `-marc6', which is also the default.
+
+ `arc5'
+ Base instruction set.
+
+ `arc6'
+ Jump-and-link (jl) instruction. No requirement of an
+ instruction between setting flags and conditional jump. For
+ example:
+
+ mov.f r0,r1
+ beq foo
+
+ `arc7'
+ Break (brk) and sleep (sleep) instructions.
+
+ `arc8'
+ Software interrupt (swi) instruction.
+
+
+ Note: the `.option' directive can to be used to select a core
+ variant from within assembly code.
+
+`-EB'
+ This option specifies that the output generated by the assembler
+ should be marked as being encoded for a big-endian processor.
+
+`-EL'
+ This option specifies that the output generated by the assembler
+ should be marked as being encoded for a little-endian processor -
+ this is the default.
+
+
+
+File: as.info, Node: ARC Syntax, Next: ARC Floating Point, Prev: ARC Options, Up: ARC-Dependent
+
+9.2.2 Syntax
+------------
+
+* Menu:
+
+* ARC-Chars:: Special Characters
+* ARC-Regs:: Register Names
+
+
+File: as.info, Node: ARC-Chars, Next: ARC-Regs, Up: ARC Syntax
+
+9.2.2.1 Special Characters
+..........................
+
+*TODO*
+
+
+File: as.info, Node: ARC-Regs, Prev: ARC-Chars, Up: ARC Syntax
+
+9.2.2.2 Register Names
+......................
+
+*TODO*
+
+
+File: as.info, Node: ARC Floating Point, Next: ARC Directives, Prev: ARC Syntax, Up: ARC-Dependent
+
+9.2.3 Floating Point
+--------------------
+
+The ARC core does not currently have hardware floating point support.
+Software floating point support is provided by `GCC' and uses IEEE
+floating-point numbers.
+
+
+File: as.info, Node: ARC Directives, Next: ARC Opcodes, Prev: ARC Floating Point, Up: ARC-Dependent
+
+9.2.4 ARC Machine Directives
+----------------------------
+
+The ARC version of `as' supports the following additional machine
+directives:
+
+`.2byte EXPRESSIONS'
+ *TODO*
+
+`.3byte EXPRESSIONS'
+ *TODO*
+
+`.4byte EXPRESSIONS'
+ *TODO*
+
+`.extAuxRegister NAME,ADDRESS,MODE'
+ The ARCtangent A4 has extensible auxiliary register space. The
+ auxiliary registers can be defined in the assembler source code by
+ using this directive. The first parameter is the NAME of the new
+ auxiallry register. The second parameter is the ADDRESS of the
+ register in the auxiliary register memory map for the variant of
+ the ARC. The third parameter specifies the MODE in which the
+ register can be operated is and it can be one of:
+
+ `r (readonly)'
+
+ `w (write only)'
+
+ `r|w (read or write)'
+
+ For example:
+
+ .extAuxRegister mulhi,0x12,w
+
+ This specifies an extension auxiliary register called _mulhi_
+ which is at address 0x12 in the memory space and which is only
+ writable.
+
+`.extCondCode SUFFIX,VALUE'
+ The condition codes on the ARCtangent A4 are extensible and can be
+ specified by means of this assembler directive. They are specified
+ by the suffix and the value for the condition code. They can be
+ used to specify extra condition codes with any values. For
+ example:
+
+ .extCondCode is_busy,0x14
+
+ add.is_busy r1,r2,r3
+ bis_busy _main
+
+`.extCoreRegister NAME,REGNUM,MODE,SHORTCUT'
+ Specifies an extension core register NAME for the application.
+ This allows a register NAME with a valid REGNUM between 0 and 60,
+ with the following as valid values for MODE
+
+ `_r_ (readonly)'
+
+ `_w_ (write only)'
+
+ `_r|w_ (read or write)'
+
+ The other parameter gives a description of the register having a
+ SHORTCUT in the pipeline. The valid values are:
+
+ `can_shortcut'
+
+ `cannot_shortcut'
+
+ For example:
+
+ .extCoreRegister mlo,57,r,can_shortcut
+
+ This defines an extension core register mlo with the value 57 which
+ can shortcut the pipeline.
+
+`.extInstruction NAME,OPCODE,SUBOPCODE,SUFFIXCLASS,SYNTAXCLASS'
+ The ARCtangent A4 allows the user to specify extension
+ instructions. The extension instructions are not macros. The
+ assembler creates encodings for use of these instructions
+ according to the specification by the user. The parameters are:
+
+ *NAME
+ Name of the extension instruction
+
+ *OPCODE
+ Opcode to be used. (Bits 27:31 in the encoding). Valid values
+ 0x10-0x1f or 0x03
+
+ *SUBOPCODE
+ Subopcode to be used. Valid values are from 0x09-0x3f.
+ However the correct value also depends on SYNTAXCLASS
+
+ *SUFFIXCLASS
+ Determines the kinds of suffixes to be allowed. Valid values
+ are `SUFFIX_NONE', `SUFFIX_COND', `SUFFIX_FLAG' which
+ indicates the absence or presence of conditional suffixes and
+ flag setting by the extension instruction. It is also
+ possible to specify that an instruction sets the flags and is
+ conditional by using `SUFFIX_CODE' | `SUFFIX_FLAG'.
+
+ *SYNTAXCLASS
+ Determines the syntax class for the instruction. It can have
+ the following values:
+
+ ``SYNTAX_2OP':'
+ 2 Operand Instruction
+
+ ``SYNTAX_3OP':'
+ 3 Operand Instruction
+
+ In addition there could be modifiers for the syntax class as
+ described below:
+
+ Syntax Class Modifiers are:
+
+ - `OP1_MUST_BE_IMM': Modifies syntax class SYNTAX_3OP,
+ specifying that the first operand of a three-operand
+ instruction must be an immediate (i.e., the result is
+ discarded). OP1_MUST_BE_IMM is used by bitwise ORing it
+ with SYNTAX_3OP as given in the example below. This
+ could usually be used to set the flags using specific
+ instructions and not retain results.
+
+ - `OP1_IMM_IMPLIED': Modifies syntax class SYNTAX_20P, it
+ specifies that there is an implied immediate destination
+ operand which does not appear in the syntax. For
+ example, if the source code contains an instruction like:
+
+ inst r1,r2
+
+ it really means that the first argument is an implied
+ immediate (that is, the result is discarded). This is
+ the same as though the source code were: inst 0,r1,r2.
+ You use OP1_IMM_IMPLIED by bitwise ORing it with
+ SYNTAX_20P.
+
+
+ For example, defining 64-bit multiplier with immediate operands:
+
+ .extInstruction mp64,0x14,0x0,SUFFIX_COND | SUFFIX_FLAG ,
+ SYNTAX_3OP|OP1_MUST_BE_IMM
+
+ The above specifies an extension instruction called mp64 which has
+ 3 operands, sets the flags, can be used with a condition code, for
+ which the first operand is an immediate. (Equivalent to
+ discarding the result of the operation).
+
+ .extInstruction mul64,0x14,0x00,SUFFIX_COND, SYNTAX_2OP|OP1_IMM_IMPLIED
+
+ This describes a 2 operand instruction with an implicit first
+ immediate operand. The result of this operation would be
+ discarded.
+
+`.half EXPRESSIONS'
+ *TODO*
+
+`.long EXPRESSIONS'
+ *TODO*
+
+`.option ARC|ARC5|ARC6|ARC7|ARC8'
+ The `.option' directive must be followed by the desired core
+ version. Again `arc' is an alias for `arc6'.
+
+ Note: the `.option' directive overrides the command line option
+ `-marc'; a warning is emitted when the version is not consistent
+ between the two - even for the implicit default core version
+ (arc6).
+
+`.short EXPRESSIONS'
+ *TODO*
+
+`.word EXPRESSIONS'
+ *TODO*
+
+
+
+File: as.info, Node: ARC Opcodes, Prev: ARC Directives, Up: ARC-Dependent
+
+9.2.5 Opcodes
+-------------
+
+For information on the ARC instruction set, see `ARC Programmers
+Reference Manual', ARC International (www.arc.com)
+
+
+File: as.info, Node: ARM-Dependent, Next: AVR-Dependent, Prev: ARC-Dependent, Up: Machine Dependencies
+
+9.3 ARM Dependent Features
+==========================
+
+* Menu:
+
+* ARM Options:: Options
+* ARM Syntax:: Syntax
+* ARM Floating Point:: Floating Point
+* ARM Directives:: ARM Machine Directives
+* ARM Opcodes:: Opcodes
+* ARM Mapping Symbols:: Mapping Symbols
+* ARM Unwinding Tutorial:: Unwinding
+
+
+File: as.info, Node: ARM Options, Next: ARM Syntax, Up: ARM-Dependent
+
+9.3.1 Options
+-------------
+
+`-mcpu=PROCESSOR[+EXTENSION...]'
+ This option specifies the target processor. The assembler will
+ issue an error message if an attempt is made to assemble an
+ instruction which will not execute on the target processor. The
+ following processor names are recognized: `arm1', `arm2', `arm250',
+ `arm3', `arm6', `arm60', `arm600', `arm610', `arm620', `arm7',
+ `arm7m', `arm7d', `arm7dm', `arm7di', `arm7dmi', `arm70', `arm700',
+ `arm700i', `arm710', `arm710t', `arm720', `arm720t', `arm740t',
+ `arm710c', `arm7100', `arm7500', `arm7500fe', `arm7t', `arm7tdmi',
+ `arm7tdmi-s', `arm8', `arm810', `strongarm', `strongarm1',
+ `strongarm110', `strongarm1100', `strongarm1110', `arm9', `arm920',
+ `arm920t', `arm922t', `arm940t', `arm9tdmi', `fa526' (Faraday
+ FA526 processor), `fa626' (Faraday FA626 processor), `arm9e',
+ `arm926e', `arm926ej-s', `arm946e-r0', `arm946e', `arm946e-s',
+ `arm966e-r0', `arm966e', `arm966e-s', `arm968e-s', `arm10t',
+ `arm10tdmi', `arm10e', `arm1020', `arm1020t', `arm1020e',
+ `arm1022e', `arm1026ej-s', `fa626te' (Faraday FA626TE processor),
+ `fa726te' (Faraday FA726TE processor), `arm1136j-s', `arm1136jf-s',
+ `arm1156t2-s', `arm1156t2f-s', `arm1176jz-s', `arm1176jzf-s',
+ `mpcore', `mpcorenovfp', `cortex-a8', `cortex-a9', `cortex-r4',
+ `cortex-m3', `cortex-m1', `cortex-m0', `ep9312' (ARM920 with
+ Cirrus Maverick coprocessor), `i80200' (Intel XScale processor)
+ `iwmmxt' (Intel(r) XScale processor with Wireless MMX(tm)
+ technology coprocessor) and `xscale'. The special name `all' may
+ be used to allow the assembler to accept instructions valid for
+ any ARM processor.
+
+ In addition to the basic instruction set, the assembler can be
+ told to accept various extension mnemonics that extend the
+ processor using the co-processor instruction space. For example,
+ `-mcpu=arm920+maverick' is equivalent to specifying
+ `-mcpu=ep9312'. The following extensions are currently supported:
+ `+maverick' `+iwmmxt' and `+xscale'.
+
+`-march=ARCHITECTURE[+EXTENSION...]'
+ This option specifies the target architecture. The assembler will
+ issue an error message if an attempt is made to assemble an
+ instruction which will not execute on the target architecture.
+ The following architecture names are recognized: `armv1', `armv2',
+ `armv2a', `armv2s', `armv3', `armv3m', `armv4', `armv4xm',
+ `armv4t', `armv4txm', `armv5', `armv5t', `armv5txm', `armv5te',
+ `armv5texp', `armv6', `armv6j', `armv6k', `armv6z', `armv6zk',
+ `armv7', `armv7-a', `armv7-r', `armv7-m', `iwmmxt' and `xscale'.
+ If both `-mcpu' and `-march' are specified, the assembler will use
+ the setting for `-mcpu'.
+
+ The architecture option can be extended with the same instruction
+ set extension options as the `-mcpu' option.
+
+`-mfpu=FLOATING-POINT-FORMAT'
+ This option specifies the floating point format to assemble for.
+ The assembler will issue an error message if an attempt is made to
+ assemble an instruction which will not execute on the target
+ floating point unit. The following format options are recognized:
+ `softfpa', `fpe', `fpe2', `fpe3', `fpa', `fpa10', `fpa11',
+ `arm7500fe', `softvfp', `softvfp+vfp', `vfp', `vfp10', `vfp10-r0',
+ `vfp9', `vfpxd', `vfpv2' `vfpv3' `vfpv3-d16' `arm1020t',
+ `arm1020e', `arm1136jf-s', `maverick' and `neon'.
+
+ In addition to determining which instructions are assembled, this
+ option also affects the way in which the `.double' assembler
+ directive behaves when assembling little-endian code.
+
+ The default is dependent on the processor selected. For
+ Architecture 5 or later, the default is to assembler for VFP
+ instructions; for earlier architectures the default is to assemble
+ for FPA instructions.
+
+`-mthumb'
+ This option specifies that the assembler should start assembling
+ Thumb instructions; that is, it should behave as though the file
+ starts with a `.code 16' directive.
+
+`-mthumb-interwork'
+ This option specifies that the output generated by the assembler
+ should be marked as supporting interworking.
+
+`-mimplicit-it=never'
+`-mimplicit-it=always'
+`-mimplicit-it=arm'
+`-mimplicit-it=thumb'
+ The `-mimplicit-it' option controls the behavior of the assembler
+ when conditional instructions are not enclosed in IT blocks.
+ There are four possible behaviors. If `never' is specified, such
+ constructs cause a warning in ARM code and an error in Thumb-2
+ code. If `always' is specified, such constructs are accepted in
+ both ARM and Thumb-2 code, where the IT instruction is added
+ implicitly. If `arm' is specified, such constructs are accepted
+ in ARM code and cause an error in Thumb-2 code. If `thumb' is
+ specified, such constructs cause a warning in ARM code and are
+ accepted in Thumb-2 code. If you omit this option, the behavior
+ is equivalent to `-mimplicit-it=arm'.
+
+`-mapcs `[26|32]''
+ This option specifies that the output generated by the assembler
+ should be marked as supporting the indicated version of the Arm
+ Procedure. Calling Standard.
+
+`-matpcs'
+ This option specifies that the output generated by the assembler
+ should be marked as supporting the Arm/Thumb Procedure Calling
+ Standard. If enabled this option will cause the assembler to
+ create an empty debugging section in the object file called
+ .arm.atpcs. Debuggers can use this to determine the ABI being
+ used by.
+
+`-mapcs-float'
+ This indicates the floating point variant of the APCS should be
+ used. In this variant floating point arguments are passed in FP
+ registers rather than integer registers.
+
+`-mapcs-reentrant'
+ This indicates that the reentrant variant of the APCS should be
+ used. This variant supports position independent code.
+
+`-mfloat-abi=ABI'
+ This option specifies that the output generated by the assembler
+ should be marked as using specified floating point ABI. The
+ following values are recognized: `soft', `softfp' and `hard'.
+
+`-meabi=VER'
+ This option specifies which EABI version the produced object files
+ should conform to. The following values are recognized: `gnu', `4'
+ and `5'.
+
+`-EB'
+ This option specifies that the output generated by the assembler
+ should be marked as being encoded for a big-endian processor.
+
+`-EL'
+ This option specifies that the output generated by the assembler
+ should be marked as being encoded for a little-endian processor.
+
+`-k'
+ This option specifies that the output of the assembler should be
+ marked as position-independent code (PIC).
+
+`--fix-v4bx'
+ Allow `BX' instructions in ARMv4 code. This is intended for use
+ with the linker option of the same name.
+
+`-mwarn-deprecated'
+`-mno-warn-deprecated'
+ Enable or disable warnings about using deprecated options or
+ features. The default is to warn.
+
+
+
+File: as.info, Node: ARM Syntax, Next: ARM Floating Point, Prev: ARM Options, Up: ARM-Dependent
+
+9.3.2 Syntax
+------------
+
+* Menu:
+
+* ARM-Instruction-Set:: Instruction Set
+* ARM-Chars:: Special Characters
+* ARM-Regs:: Register Names
+* ARM-Relocations:: Relocations
+
+
+File: as.info, Node: ARM-Instruction-Set, Next: ARM-Chars, Up: ARM Syntax
+
+9.3.2.1 Instruction Set Syntax
+..............................
+
+Two slightly different syntaxes are support for ARM and THUMB
+instructions. The default, `divided', uses the old style where ARM and
+THUMB instructions had their own, separate syntaxes. The new,
+`unified' syntax, which can be selected via the `.syntax' directive,
+and has the following main features:
+
+*
+ Immediate operands do not require a `#' prefix.
+
+*
+ The `IT' instruction may appear, and if it does it is validated
+ against subsequent conditional affixes. In ARM mode it does not
+ generate machine code, in THUMB mode it does.
+
+*
+ For ARM instructions the conditional affixes always appear at the
+ end of the instruction. For THUMB instructions conditional
+ affixes can be used, but only inside the scope of an `IT'
+ instruction.
+
+*
+ All of the instructions new to the V6T2 architecture (and later)
+ are available. (Only a few such instructions can be written in the
+ `divided' syntax).
+
+*
+ The `.N' and `.W' suffixes are recognized and honored.
+
+*
+ All instructions set the flags if and only if they have an `s'
+ affix.
+
+
+File: as.info, Node: ARM-Chars, Next: ARM-Regs, Prev: ARM-Instruction-Set, Up: ARM Syntax
+
+9.3.2.2 Special Characters
+..........................
+
+The presence of a `@' on a line indicates the start of a comment that
+extends to the end of the current line. If a `#' appears as the first
+character of a line, the whole line is treated as a comment.
+
+ The `;' character can be used instead of a newline to separate
+statements.
+
+ Either `#' or `$' can be used to indicate immediate operands.
+
+ *TODO* Explain about /data modifier on symbols.
+
+
+File: as.info, Node: ARM-Regs, Next: ARM-Relocations, Prev: ARM-Chars, Up: ARM Syntax
+
+9.3.2.3 Register Names
+......................
+
+*TODO* Explain about ARM register naming, and the predefined names.
+
+
+File: as.info, Node: ARM Floating Point, Next: ARM Directives, Prev: ARM Syntax, Up: ARM-Dependent
+
+9.3.3 Floating Point
+--------------------
+
+The ARM family uses IEEE floating-point numbers.
+
+
+File: as.info, Node: ARM-Relocations, Prev: ARM-Regs, Up: ARM Syntax
+
+9.3.3.1 ARM relocation generation
+.................................
+
+Specific data relocations can be generated by putting the relocation
+name in parentheses after the symbol name. For example:
+
+ .word foo(TARGET1)
+
+ This will generate an `R_ARM_TARGET1' relocation against the symbol
+FOO. The following relocations are supported: `GOT', `GOTOFF',
+`TARGET1', `TARGET2', `SBREL', `TLSGD', `TLSLDM', `TLSLDO', `GOTTPOFF'
+and `TPOFF'.
+
+ For compatibility with older toolchains the assembler also accepts
+`(PLT)' after branch targets. This will generate the deprecated
+`R_ARM_PLT32' relocation.
+
+ Relocations for `MOVW' and `MOVT' instructions can be generated by
+prefixing the value with `#:lower16:' and `#:upper16' respectively.
+For example to load the 32-bit address of foo into r0:
+
+ MOVW r0, #:lower16:foo
+ MOVT r0, #:upper16:foo
+
+
+File: as.info, Node: ARM Directives, Next: ARM Opcodes, Prev: ARM Floating Point, Up: ARM-Dependent
+
+9.3.4 ARM Machine Directives
+----------------------------
+
+`.2byte EXPRESSION [, EXPRESSION]*'
+`.4byte EXPRESSION [, EXPRESSION]*'
+`.8byte EXPRESSION [, EXPRESSION]*'
+ These directives write 2, 4 or 8 byte values to the output section.
+
+`.align EXPRESSION [, EXPRESSION]'
+ This is the generic .ALIGN directive. For the ARM however if the
+ first argument is zero (ie no alignment is needed) the assembler
+ will behave as if the argument had been 2 (ie pad to the next four
+ byte boundary). This is for compatibility with ARM's own
+ assembler.
+
+`.arch NAME'
+ Select the target architecture. Valid values for NAME are the
+ same as for the `-march' commandline option.
+
+`.arm'
+ This performs the same action as .CODE 32.
+
+`.pad #COUNT'
+ Generate unwinder annotations for a stack adjustment of COUNT
+ bytes. A positive value indicates the function prologue allocated
+ stack space by decrementing the stack pointer.
+
+`.bss'
+ This directive switches to the `.bss' section.
+
+`.cantunwind'
+ Prevents unwinding through the current function. No personality
+ routine or exception table data is required or permitted.
+
+`.code `[16|32]''
+ This directive selects the instruction set being generated. The
+ value 16 selects Thumb, with the value 32 selecting ARM.
+
+`.cpu NAME'
+ Select the target processor. Valid values for NAME are the same as
+ for the `-mcpu' commandline option.
+
+`NAME .dn REGISTER NAME [.TYPE] [[INDEX]]'
+
+`NAME .qn REGISTER NAME [.TYPE] [[INDEX]]'
+ The `dn' and `qn' directives are used to create typed and/or
+ indexed register aliases for use in Advanced SIMD Extension (Neon)
+ instructions. The former should be used to create aliases of
+ double-precision registers, and the latter to create aliases of
+ quad-precision registers.
+
+ If these directives are used to create typed aliases, those
+ aliases can be used in Neon instructions instead of writing types
+ after the mnemonic or after each operand. For example:
+
+ x .dn d2.f32
+ y .dn d3.f32
+ z .dn d4.f32[1]
+ vmul x,y,z
+
+ This is equivalent to writing the following:
+
+ vmul.f32 d2,d3,d4[1]
+
+ Aliases created using `dn' or `qn' can be destroyed using `unreq'.
+
+`.eabi_attribute TAG, VALUE'
+ Set the EABI object attribute TAG to VALUE.
+
+ The TAG is either an attribute number, or one of the following:
+ `Tag_CPU_raw_name', `Tag_CPU_name', `Tag_CPU_arch',
+ `Tag_CPU_arch_profile', `Tag_ARM_ISA_use', `Tag_THUMB_ISA_use',
+ `Tag_VFP_arch', `Tag_WMMX_arch', `Tag_Advanced_SIMD_arch',
+ `Tag_PCS_config', `Tag_ABI_PCS_R9_use', `Tag_ABI_PCS_RW_data',
+ `Tag_ABI_PCS_RO_data', `Tag_ABI_PCS_GOT_use',
+ `Tag_ABI_PCS_wchar_t', `Tag_ABI_FP_rounding',
+ `Tag_ABI_FP_denormal', `Tag_ABI_FP_exceptions',
+ `Tag_ABI_FP_user_exceptions', `Tag_ABI_FP_number_model',
+ `Tag_ABI_align8_needed', `Tag_ABI_align8_preserved',
+ `Tag_ABI_enum_size', `Tag_ABI_HardFP_use', `Tag_ABI_VFP_args',
+ `Tag_ABI_WMMX_args', `Tag_ABI_optimization_goals',
+ `Tag_ABI_FP_optimization_goals', `Tag_compatibility',
+ `Tag_CPU_unaligned_access', `Tag_VFP_HP_extension',
+ `Tag_ABI_FP_16bit_format', `Tag_nodefaults',
+ `Tag_also_compatible_with', `Tag_conformance', `Tag_T2EE_use',
+ `Tag_Virtualization_use', `Tag_MPextension_use'
+
+ The VALUE is either a `number', `"string"', or `number, "string"'
+ depending on the tag.
+
+`.even'
+ This directive aligns to an even-numbered address.
+
+`.extend EXPRESSION [, EXPRESSION]*'
+`.ldouble EXPRESSION [, EXPRESSION]*'
+ These directives write 12byte long double floating-point values to
+ the output section. These are not compatible with current ARM
+ processors or ABIs.
+
+`.fnend'
+ Marks the end of a function with an unwind table entry. The
+ unwind index table entry is created when this directive is
+ processed.
+
+ If no personality routine has been specified then standard
+ personality routine 0 or 1 will be used, depending on the number
+ of unwind opcodes required.
+
+`.fnstart'
+ Marks the start of a function with an unwind table entry.
+
+`.force_thumb'
+ This directive forces the selection of Thumb instructions, even if
+ the target processor does not support those instructions
+
+`.fpu NAME'
+ Select the floating-point unit to assemble for. Valid values for
+ NAME are the same as for the `-mfpu' commandline option.
+
+`.handlerdata'
+ Marks the end of the current function, and the start of the
+ exception table entry for that function. Anything between this
+ directive and the `.fnend' directive will be added to the
+ exception table entry.
+
+ Must be preceded by a `.personality' or `.personalityindex'
+ directive.
+
+`.inst OPCODE [ , ... ]'
+
+`.inst.n OPCODE [ , ... ]'
+
+`.inst.w OPCODE [ , ... ]'
+ Generates the instruction corresponding to the numerical value
+ OPCODE. `.inst.n' and `.inst.w' allow the Thumb instruction size
+ to be specified explicitly, overriding the normal encoding rules.
+
+`.ldouble EXPRESSION [, EXPRESSION]*'
+ See `.extend'.
+
+`.ltorg'
+ This directive causes the current contents of the literal pool to
+ be dumped into the current section (which is assumed to be the
+ .text section) at the current location (aligned to a word
+ boundary). `GAS' maintains a separate literal pool for each
+ section and each sub-section. The `.ltorg' directive will only
+ affect the literal pool of the current section and sub-section.
+ At the end of assembly all remaining, un-empty literal pools will
+ automatically be dumped.
+
+ Note - older versions of `GAS' would dump the current literal pool
+ any time a section change occurred. This is no longer done, since
+ it prevents accurate control of the placement of literal pools.
+
+`.movsp REG [, #OFFSET]'
+ Tell the unwinder that REG contains an offset from the current
+ stack pointer. If OFFSET is not specified then it is assumed to be
+ zero.
+
+`.object_arch NAME'
+ Override the architecture recorded in the EABI object attribute
+ section. Valid values for NAME are the same as for the `.arch'
+ directive. Typically this is useful when code uses runtime
+ detection of CPU features.
+
+`.packed EXPRESSION [, EXPRESSION]*'
+ This directive writes 12-byte packed floating-point values to the
+ output section. These are not compatible with current ARM
+ processors or ABIs.
+
+`.pad #COUNT'
+ Generate unwinder annotations for a stack adjustment of COUNT
+ bytes. A positive value indicates the function prologue allocated
+ stack space by decrementing the stack pointer.
+
+`.personality NAME'
+ Sets the personality routine for the current function to NAME.
+
+`.personalityindex INDEX'
+ Sets the personality routine for the current function to the EABI
+ standard routine number INDEX
+
+`.pool'
+ This is a synonym for .ltorg.
+
+`NAME .req REGISTER NAME'
+ This creates an alias for REGISTER NAME called NAME. For example:
+
+ foo .req r0
+
+`.save REGLIST'
+ Generate unwinder annotations to restore the registers in REGLIST.
+ The format of REGLIST is the same as the corresponding
+ store-multiple instruction.
+
+ _core registers_
+ .save {r4, r5, r6, lr}
+ stmfd sp!, {r4, r5, r6, lr}
+ _FPA registers_
+ .save f4, 2
+ sfmfd f4, 2, [sp]!
+ _VFP registers_
+ .save {d8, d9, d10}
+ fstmdx sp!, {d8, d9, d10}
+ _iWMMXt registers_
+ .save {wr10, wr11}
+ wstrd wr11, [sp, #-8]!
+ wstrd wr10, [sp, #-8]!
+ or
+ .save wr11
+ wstrd wr11, [sp, #-8]!
+ .save wr10
+ wstrd wr10, [sp, #-8]!
+
+`.setfp FPREG, SPREG [, #OFFSET]'
+ Make all unwinder annotations relative to a frame pointer.
+ Without this the unwinder will use offsets from the stack pointer.
+
+ The syntax of this directive is the same as the `sub' or `mov'
+ instruction used to set the frame pointer. SPREG must be either
+ `sp' or mentioned in a previous `.movsp' directive.
+
+ .movsp ip
+ mov ip, sp
+ ...
+ .setfp fp, ip, #4
+ sub fp, ip, #4
+
+`.secrel32 EXPRESSION [, EXPRESSION]*'
+ This directive emits relocations that evaluate to the
+ section-relative offset of each expression's symbol. This
+ directive is only supported for PE targets.
+
+`.syntax [`unified' | `divided']'
+ This directive sets the Instruction Set Syntax as described in the
+ *Note ARM-Instruction-Set:: section.
+
+`.thumb'
+ This performs the same action as .CODE 16.
+
+`.thumb_func'
+ This directive specifies that the following symbol is the name of a
+ Thumb encoded function. This information is necessary in order to
+ allow the assembler and linker to generate correct code for
+ interworking between Arm and Thumb instructions and should be used
+ even if interworking is not going to be performed. The presence
+ of this directive also implies `.thumb'
+
+ This directive is not neccessary when generating EABI objects. On
+ these targets the encoding is implicit when generating Thumb code.
+
+`.thumb_set'
+ This performs the equivalent of a `.set' directive in that it
+ creates a symbol which is an alias for another symbol (possibly
+ not yet defined). This directive also has the added property in
+ that it marks the aliased symbol as being a thumb function entry
+ point, in the same way that the `.thumb_func' directive does.
+
+`.unreq ALIAS-NAME'
+ This undefines a register alias which was previously defined using
+ the `req', `dn' or `qn' directives. For example:
+
+ foo .req r0
+ .unreq foo
+
+ An error occurs if the name is undefined. Note - this pseudo op
+ can be used to delete builtin in register name aliases (eg 'r0').
+ This should only be done if it is really necessary.
+
+`.unwind_raw OFFSET, BYTE1, ...'
+ Insert one of more arbitary unwind opcode bytes, which are known
+ to adjust the stack pointer by OFFSET bytes.
+
+ For example `.unwind_raw 4, 0xb1, 0x01' is equivalent to `.save
+ {r0}'
+
+`.vsave VFP-REGLIST'
+ Generate unwinder annotations to restore the VFP registers in
+ VFP-REGLIST using FLDMD. Also works for VFPv3 registers that are
+ to be restored using VLDM. The format of VFP-REGLIST is the same
+ as the corresponding store-multiple instruction.
+
+ _VFP registers_
+ .vsave {d8, d9, d10}
+ fstmdd sp!, {d8, d9, d10}
+ _VFPv3 registers_
+ .vsave {d15, d16, d17}
+ vstm sp!, {d15, d16, d17}
+
+ Since FLDMX and FSTMX are now deprecated, this directive should be
+ used in favour of `.save' for saving VFP registers for ARMv6 and
+ above.
+
+
+
+File: as.info, Node: ARM Opcodes, Next: ARM Mapping Symbols, Prev: ARM Directives, Up: ARM-Dependent
+
+9.3.5 Opcodes
+-------------
+
+`as' implements all the standard ARM opcodes. It also implements
+several pseudo opcodes, including several synthetic load instructions.
+
+`NOP'
+ nop
+
+ This pseudo op will always evaluate to a legal ARM instruction
+ that does nothing. Currently it will evaluate to MOV r0, r0.
+
+`LDR'
+ ldr <register> , = <expression>
+
+ If expression evaluates to a numeric constant then a MOV or MVN
+ instruction will be used in place of the LDR instruction, if the
+ constant can be generated by either of these instructions.
+ Otherwise the constant will be placed into the nearest literal
+ pool (if it not already there) and a PC relative LDR instruction
+ will be generated.
+
+`ADR'
+ adr <register> <label>
+
+ This instruction will load the address of LABEL into the indicated
+ register. The instruction will evaluate to a PC relative ADD or
+ SUB instruction depending upon where the label is located. If the
+ label is out of range, or if it is not defined in the same file
+ (and section) as the ADR instruction, then an error will be
+ generated. This instruction will not make use of the literal pool.
+
+`ADRL'
+ adrl <register> <label>
+
+ This instruction will load the address of LABEL into the indicated
+ register. The instruction will evaluate to one or two PC relative
+ ADD or SUB instructions depending upon where the label is located.
+ If a second instruction is not needed a NOP instruction will be
+ generated in its place, so that this instruction is always 8 bytes
+ long.
+
+ If the label is out of range, or if it is not defined in the same
+ file (and section) as the ADRL instruction, then an error will be
+ generated. This instruction will not make use of the literal pool.
+
+
+ For information on the ARM or Thumb instruction sets, see `ARM
+Software Development Toolkit Reference Manual', Advanced RISC Machines
+Ltd.
+
+
+File: as.info, Node: ARM Mapping Symbols, Next: ARM Unwinding Tutorial, Prev: ARM Opcodes, Up: ARM-Dependent
+
+9.3.6 Mapping Symbols
+---------------------
+
+The ARM ELF specification requires that special symbols be inserted
+into object files to mark certain features:
+
+`$a'
+ At the start of a region of code containing ARM instructions.
+
+`$t'
+ At the start of a region of code containing THUMB instructions.
+
+`$d'
+ At the start of a region of data.
+
+
+ The assembler will automatically insert these symbols for you - there
+is no need to code them yourself. Support for tagging symbols ($b, $f,
+$p and $m) which is also mentioned in the current ARM ELF specification
+is not implemented. This is because they have been dropped from the
+new EABI and so tools cannot rely upon their presence.
+
+
+File: as.info, Node: ARM Unwinding Tutorial, Prev: ARM Mapping Symbols, Up: ARM-Dependent
+
+9.3.7 Unwinding
+---------------
+
+The ABI for the ARM Architecture specifies a standard format for
+exception unwind information. This information is used when an
+exception is thrown to determine where control should be transferred.
+In particular, the unwind information is used to determine which
+function called the function that threw the exception, and which
+function called that one, and so forth. This information is also used
+to restore the values of callee-saved registers in the function
+catching the exception.
+
+ If you are writing functions in assembly code, and those functions
+call other functions that throw exceptions, you must use assembly
+pseudo ops to ensure that appropriate exception unwind information is
+generated. Otherwise, if one of the functions called by your assembly
+code throws an exception, the run-time library will be unable to unwind
+the stack through your assembly code and your program will not behave
+correctly.
+
+ To illustrate the use of these pseudo ops, we will examine the code
+that G++ generates for the following C++ input:
+
+
+void callee (int *);
+
+int
+caller ()
+{
+ int i;
+ callee (&i);
+ return i;
+}
+
+ This example does not show how to throw or catch an exception from
+assembly code. That is a much more complex operation and should always
+be done in a high-level language, such as C++, that directly supports
+exceptions.
+
+ The code generated by one particular version of G++ when compiling
+the example above is:
+
+
+_Z6callerv:
+ .fnstart
+.LFB2:
+ @ Function supports interworking.
+ @ args = 0, pretend = 0, frame = 8
+ @ frame_needed = 1, uses_anonymous_args = 0
+ stmfd sp!, {fp, lr}
+ .save {fp, lr}
+.LCFI0:
+ .setfp fp, sp, #4
+ add fp, sp, #4
+.LCFI1:
+ .pad #8
+ sub sp, sp, #8
+.LCFI2:
+ sub r3, fp, #8
+ mov r0, r3
+ bl _Z6calleePi
+ ldr r3, [fp, #-8]
+ mov r0, r3
+ sub sp, fp, #4
+ ldmfd sp!, {fp, lr}
+ bx lr
+.LFE2:
+ .fnend
+
+ Of course, the sequence of instructions varies based on the options
+you pass to GCC and on the version of GCC in use. The exact
+instructions are not important since we are focusing on the pseudo ops
+that are used to generate unwind information.
+
+ An important assumption made by the unwinder is that the stack frame
+does not change during the body of the function. In particular, since
+we assume that the assembly code does not itself throw an exception,
+the only point where an exception can be thrown is from a call, such as
+the `bl' instruction above. At each call site, the same saved
+registers (including `lr', which indicates the return address) must be
+located in the same locations relative to the frame pointer.
+
+ The `.fnstart' (*note .fnstart pseudo op: arm_fnstart.) pseudo op
+appears immediately before the first instruction of the function while
+the `.fnend' (*note .fnend pseudo op: arm_fnend.) pseudo op appears
+immediately after the last instruction of the function. These pseudo
+ops specify the range of the function.
+
+ Only the order of the other pseudos ops (e.g., `.setfp' or `.pad')
+matters; their exact locations are irrelevant. In the example above,
+the compiler emits the pseudo ops with particular instructions. That
+makes it easier to understand the code, but it is not required for
+correctness. It would work just as well to emit all of the pseudo ops
+other than `.fnend' in the same order, but immediately after `.fnstart'.
+
+ The `.save' (*note .save pseudo op: arm_save.) pseudo op indicates
+registers that have been saved to the stack so that they can be
+restored before the function returns. The argument to the `.save'
+pseudo op is a list of registers to save. If a register is
+"callee-saved" (as specified by the ABI) and is modified by the
+function you are writing, then your code must save the value before it
+is modified and restore the original value before the function returns.
+If an exception is thrown, the run-time library restores the values of
+these registers from their locations on the stack before returning
+control to the exception handler. (Of course, if an exception is not
+thrown, the function that contains the `.save' pseudo op restores these
+registers in the function epilogue, as is done with the `ldmfd'
+instruction above.)
+
+ You do not have to save callee-saved registers at the very beginning
+of the function and you do not need to use the `.save' pseudo op
+immediately following the point at which the registers are saved.
+However, if you modify a callee-saved register, you must save it on the
+stack before modifying it and before calling any functions which might
+throw an exception. And, you must use the `.save' pseudo op to
+indicate that you have done so.
+
+ The `.pad' (*note .pad: arm_pad.) pseudo op indicates a modification
+of the stack pointer that does not save any registers. The argument is
+the number of bytes (in decimal) that are subtracted from the stack
+pointer. (On ARM CPUs, the stack grows downwards, so subtracting from
+the stack pointer increases the size of the stack.)
+
+ The `.setfp' (*note .setfp pseudo op: arm_setfp.) pseudo op
+indicates the register that contains the frame pointer. The first
+argument is the register that is set, which is typically `fp'. The
+second argument indicates the register from which the frame pointer
+takes its value. The third argument, if present, is the value (in
+decimal) added to the register specified by the second argument to
+compute the value of the frame pointer. You should not modify the
+frame pointer in the body of the function.
+
+ If you do not use a frame pointer, then you should not use the
+`.setfp' pseudo op. If you do not use a frame pointer, then you should
+avoid modifying the stack pointer outside of the function prologue.
+Otherwise, the run-time library will be unable to find saved registers
+when it is unwinding the stack.
+
+ The pseudo ops described above are sufficient for writing assembly
+code that calls functions which may throw exceptions. If you need to
+know more about the object-file format used to represent unwind
+information, you may consult the `Exception Handling ABI for the ARM
+Architecture' available from `http://infocenter.arm.com'.
+
+
+File: as.info, Node: AVR-Dependent, Next: Blackfin-Dependent, Prev: ARM-Dependent, Up: Machine Dependencies
+
+9.4 AVR Dependent Features
+==========================
+
+* Menu:
+
+* AVR Options:: Options
+* AVR Syntax:: Syntax
+* AVR Opcodes:: Opcodes
+
+
+File: as.info, Node: AVR Options, Next: AVR Syntax, Up: AVR-Dependent
+
+9.4.1 Options
+-------------
+
+`-mmcu=MCU'
+ Specify ATMEL AVR instruction set or MCU type.
+
+ Instruction set avr1 is for the minimal AVR core, not supported by
+ the C compiler, only for assembler programs (MCU types: at90s1200,
+ attiny11, attiny12, attiny15, attiny28).
+
+ Instruction set avr2 (default) is for the classic AVR core with up
+ to 8K program memory space (MCU types: at90s2313, at90s2323,
+ at90s2333, at90s2343, attiny22, attiny26, at90s4414, at90s4433,
+ at90s4434, at90s8515, at90c8534, at90s8535).
+
+ Instruction set avr25 is for the classic AVR core with up to 8K
+ program memory space plus the MOVW instruction (MCU types:
+ attiny13, attiny13a, attiny2313, attiny2313a, attiny24, attiny24a,
+ attiny4313, attiny44, attiny44a, attiny84, attiny25, attiny45,
+ attiny85, attiny261, attiny261a, attiny461, attiny861, attiny861a,
+ attiny87, attiny43u, attiny48, attiny88, at86rf401, ata6289).
+
+ Instruction set avr3 is for the classic AVR core with up to 128K
+ program memory space (MCU types: at43usb355, at76c711).
+
+ Instruction set avr31 is for the classic AVR core with exactly
+ 128K program memory space (MCU types: atmega103, at43usb320).
+
+ Instruction set avr35 is for classic AVR core plus MOVW, CALL, and
+ JMP instructions (MCU types: attiny167, attiny327, at90usb82,
+ at90usb162, atmega8u2, atmega16u2, atmega32u2).
+
+ Instruction set avr4 is for the enhanced AVR core with up to 8K
+ program memory space (MCU types: atmega48, atmega48p,atmega8,
+ atmega88, atmega88p, atmega8515, atmega8535, atmega8hva,
+ atmega4hvd, atmega8hvd, at90pwm1, at90pwm2, at90pwm2b, at90pwm3,
+ at90pwm3b, at90pwm81, atmega8m1, atmega8c1).
+
+ Instruction set avr5 is for the enhanced AVR core with up to 128K
+ program memory space (MCU types: atmega16, atmega161, atmega162,
+ atmega163, atmega164p, atmega165, atmega165p, atmega168,
+ atmega168p, atmega169, atmega169p, atmega16c1, atmega32,
+ atmega323, atmega324p, atmega325, atmega325p, atmega3250,
+ atmega3250p, atmega328p, atmega329, atmega329p, atmega3290,
+ atmega3290p, atmega406, atmega64, atmega640, atmega644,
+ atmega644p, atmega644pa, atmega645, atmega6450, atmega649,
+ atmega6490, atmega16hva, atmega16hvb, atmega32hvb, at90can32,
+ at90can64, at90pwm216, at90pwm316, atmega32c1, atmega64c1,
+ atmega16m1, atmega32m1, atmega64m1, atmega16u4, atmega32u4,
+ atmega32u6, at90usb646, at90usb647, at94k, at90scr100).
+
+ Instruction set avr51 is for the enhanced AVR core with exactly
+ 128K program memory space (MCU types: atmega128, atmega1280,
+ atmega1281, atmega1284p, atmega128rfa1, at90can128, at90usb1286,
+ at90usb1287, m3000f, m3000s, m3001b).
+
+ Instruction set avr6 is for the enhanced AVR core with a 3-byte PC
+ (MCU types: atmega2560, atmega2561).
+
+`-mall-opcodes'
+ Accept all AVR opcodes, even if not supported by `-mmcu'.
+
+`-mno-skip-bug'
+ This option disable warnings for skipping two-word instructions.
+
+`-mno-wrap'
+ This option reject `rjmp/rcall' instructions with 8K wrap-around.
+
+
+
+File: as.info, Node: AVR Syntax, Next: AVR Opcodes, Prev: AVR Options, Up: AVR-Dependent
+
+9.4.2 Syntax
+------------
+
+* Menu:
+
+* AVR-Chars:: Special Characters
+* AVR-Regs:: Register Names
+* AVR-Modifiers:: Relocatable Expression Modifiers
+
+
+File: as.info, Node: AVR-Chars, Next: AVR-Regs, Up: AVR Syntax
+
+9.4.2.1 Special Characters
+..........................
+
+The presence of a `;' on a line indicates the start of a comment that
+extends to the end of the current line. If a `#' appears as the first
+character of a line, the whole line is treated as a comment.
+
+ The `$' character can be used instead of a newline to separate
+statements.
+
+
+File: as.info, Node: AVR-Regs, Next: AVR-Modifiers, Prev: AVR-Chars, Up: AVR Syntax
+
+9.4.2.2 Register Names
+......................
+
+The AVR has 32 x 8-bit general purpose working registers `r0', `r1',
+... `r31'. Six of the 32 registers can be used as three 16-bit
+indirect address register pointers for Data Space addressing. One of
+the these address pointers can also be used as an address pointer for
+look up tables in Flash program memory. These added function registers
+are the 16-bit `X', `Y' and `Z' - registers.
+
+ X = r26:r27
+ Y = r28:r29
+ Z = r30:r31
+
+
+File: as.info, Node: AVR-Modifiers, Prev: AVR-Regs, Up: AVR Syntax
+
+9.4.2.3 Relocatable Expression Modifiers
+........................................
+
+The assembler supports several modifiers when using relocatable
+addresses in AVR instruction operands. The general syntax is the
+following:
+
+ modifier(relocatable-expression)
+
+`lo8'
+ This modifier allows you to use bits 0 through 7 of an address
+ expression as 8 bit relocatable expression.
+
+`hi8'
+ This modifier allows you to use bits 7 through 15 of an address
+ expression as 8 bit relocatable expression. This is useful with,
+ for example, the AVR `ldi' instruction and `lo8' modifier.
+
+ For example
+
+ ldi r26, lo8(sym+10)
+ ldi r27, hi8(sym+10)
+
+`hh8'
+ This modifier allows you to use bits 16 through 23 of an address
+ expression as 8 bit relocatable expression. Also, can be useful
+ for loading 32 bit constants.
+
+`hlo8'
+ Synonym of `hh8'.
+
+`hhi8'
+ This modifier allows you to use bits 24 through 31 of an
+ expression as 8 bit expression. This is useful with, for example,
+ the AVR `ldi' instruction and `lo8', `hi8', `hlo8', `hhi8',
+ modifier.
+
+ For example
+
+ ldi r26, lo8(285774925)
+ ldi r27, hi8(285774925)
+ ldi r28, hlo8(285774925)
+ ldi r29, hhi8(285774925)
+ ; r29,r28,r27,r26 = 285774925
+
+`pm_lo8'
+ This modifier allows you to use bits 0 through 7 of an address
+ expression as 8 bit relocatable expression. This modifier useful
+ for addressing data or code from Flash/Program memory. The using
+ of `pm_lo8' similar to `lo8'.
+
+`pm_hi8'
+ This modifier allows you to use bits 8 through 15 of an address
+ expression as 8 bit relocatable expression. This modifier useful
+ for addressing data or code from Flash/Program memory.
+
+`pm_hh8'
+ This modifier allows you to use bits 15 through 23 of an address
+ expression as 8 bit relocatable expression. This modifier useful
+ for addressing data or code from Flash/Program memory.
+
+
+
+File: as.info, Node: AVR Opcodes, Prev: AVR Syntax, Up: AVR-Dependent
+
+9.4.3 Opcodes
+-------------
+
+For detailed information on the AVR machine instruction set, see
+`www.atmel.com/products/AVR'.
+
+ `as' implements all the standard AVR opcodes. The following table
+summarizes the AVR opcodes, and their arguments.
+
+ Legend:
+ r any register
+ d `ldi' register (r16-r31)
+ v `movw' even register (r0, r2, ..., r28, r30)
+ a `fmul' register (r16-r23)
+ w `adiw' register (r24,r26,r28,r30)
+ e pointer registers (X,Y,Z)
+ b base pointer register and displacement ([YZ]+disp)
+ z Z pointer register (for [e]lpm Rd,Z[+])
+ M immediate value from 0 to 255
+ n immediate value from 0 to 255 ( n = ~M ). Relocation impossible
+ s immediate value from 0 to 7
+ P Port address value from 0 to 63. (in, out)
+ p Port address value from 0 to 31. (cbi, sbi, sbic, sbis)
+ K immediate value from 0 to 63 (used in `adiw', `sbiw')
+ i immediate value
+ l signed pc relative offset from -64 to 63
+ L signed pc relative offset from -2048 to 2047
+ h absolute code address (call, jmp)
+ S immediate value from 0 to 7 (S = s << 4)
+ ? use this opcode entry if no parameters, else use next opcode entry
+
+ 1001010010001000 clc
+ 1001010011011000 clh
+ 1001010011111000 cli
+ 1001010010101000 cln
+ 1001010011001000 cls
+ 1001010011101000 clt
+ 1001010010111000 clv
+ 1001010010011000 clz
+ 1001010000001000 sec
+ 1001010001011000 seh
+ 1001010001111000 sei
+ 1001010000101000 sen
+ 1001010001001000 ses
+ 1001010001101000 set
+ 1001010000111000 sev
+ 1001010000011000 sez
+ 100101001SSS1000 bclr S
+ 100101000SSS1000 bset S
+ 1001010100001001 icall
+ 1001010000001001 ijmp
+ 1001010111001000 lpm ?
+ 1001000ddddd010+ lpm r,z
+ 1001010111011000 elpm ?
+ 1001000ddddd011+ elpm r,z
+ 0000000000000000 nop
+ 1001010100001000 ret
+ 1001010100011000 reti
+ 1001010110001000 sleep
+ 1001010110011000 break
+ 1001010110101000 wdr
+ 1001010111101000 spm
+ 000111rdddddrrrr adc r,r
+ 000011rdddddrrrr add r,r
+ 001000rdddddrrrr and r,r
+ 000101rdddddrrrr cp r,r
+ 000001rdddddrrrr cpc r,r
+ 000100rdddddrrrr cpse r,r
+ 001001rdddddrrrr eor r,r
+ 001011rdddddrrrr mov r,r
+ 100111rdddddrrrr mul r,r
+ 001010rdddddrrrr or r,r
+ 000010rdddddrrrr sbc r,r
+ 000110rdddddrrrr sub r,r
+ 001001rdddddrrrr clr r
+ 000011rdddddrrrr lsl r
+ 000111rdddddrrrr rol r
+ 001000rdddddrrrr tst r
+ 0111KKKKddddKKKK andi d,M
+ 0111KKKKddddKKKK cbr d,n
+ 1110KKKKddddKKKK ldi d,M
+ 11101111dddd1111 ser d
+ 0110KKKKddddKKKK ori d,M
+ 0110KKKKddddKKKK sbr d,M
+ 0011KKKKddddKKKK cpi d,M
+ 0100KKKKddddKKKK sbci d,M
+ 0101KKKKddddKKKK subi d,M
+ 1111110rrrrr0sss sbrc r,s
+ 1111111rrrrr0sss sbrs r,s
+ 1111100ddddd0sss bld r,s
+ 1111101ddddd0sss bst r,s
+ 10110PPdddddPPPP in r,P
+ 10111PPrrrrrPPPP out P,r
+ 10010110KKddKKKK adiw w,K
+ 10010111KKddKKKK sbiw w,K
+ 10011000pppppsss cbi p,s
+ 10011010pppppsss sbi p,s
+ 10011001pppppsss sbic p,s
+ 10011011pppppsss sbis p,s
+ 111101lllllll000 brcc l
+ 111100lllllll000 brcs l
+ 111100lllllll001 breq l
+ 111101lllllll100 brge l
+ 111101lllllll101 brhc l
+ 111100lllllll101 brhs l
+ 111101lllllll111 brid l
+ 111100lllllll111 brie l
+ 111100lllllll000 brlo l
+ 111100lllllll100 brlt l
+ 111100lllllll010 brmi l
+ 111101lllllll001 brne l
+ 111101lllllll010 brpl l
+ 111101lllllll000 brsh l
+ 111101lllllll110 brtc l
+ 111100lllllll110 brts l
+ 111101lllllll011 brvc l
+ 111100lllllll011 brvs l
+ 111101lllllllsss brbc s,l
+ 111100lllllllsss brbs s,l
+ 1101LLLLLLLLLLLL rcall L
+ 1100LLLLLLLLLLLL rjmp L
+ 1001010hhhhh111h call h
+ 1001010hhhhh110h jmp h
+ 1001010rrrrr0101 asr r
+ 1001010rrrrr0000 com r
+ 1001010rrrrr1010 dec r
+ 1001010rrrrr0011 inc r
+ 1001010rrrrr0110 lsr r
+ 1001010rrrrr0001 neg r
+ 1001000rrrrr1111 pop r
+ 1001001rrrrr1111 push r
+ 1001010rrrrr0111 ror r
+ 1001010rrrrr0010 swap r
+ 00000001ddddrrrr movw v,v
+ 00000010ddddrrrr muls d,d
+ 000000110ddd0rrr mulsu a,a
+ 000000110ddd1rrr fmul a,a
+ 000000111ddd0rrr fmuls a,a
+ 000000111ddd1rrr fmulsu a,a
+ 1001001ddddd0000 sts i,r
+ 1001000ddddd0000 lds r,i
+ 10o0oo0dddddbooo ldd r,b
+ 100!000dddddee-+ ld r,e
+ 10o0oo1rrrrrbooo std b,r
+ 100!001rrrrree-+ st e,r
+ 1001010100011001 eicall
+ 1001010000011001 eijmp
+
+
+File: as.info, Node: Blackfin-Dependent, Next: CR16-Dependent, Prev: AVR-Dependent, Up: Machine Dependencies
+
+9.5 Blackfin Dependent Features
+===============================
+
+* Menu:
+
+* Blackfin Options:: Blackfin Options
+* Blackfin Syntax:: Blackfin Syntax
+* Blackfin Directives:: Blackfin Directives
+
+
+File: as.info, Node: Blackfin Options, Next: Blackfin Syntax, Up: Blackfin-Dependent
+
+9.5.1 Options
+-------------
+
+`-mcpu=PROCESSOR[-SIREVISION]'
+ This option specifies the target processor. The optional
+ SIREVISION is not used in assembler. It's here such that GCC can
+ easily pass down its `-mcpu=' option. The assembler will issue an
+ error message if an attempt is made to assemble an instruction
+ which will not execute on the target processor. The following
+ processor names are recognized: `bf512', `bf514', `bf516', `bf518',
+ `bf522', `bf523', `bf524', `bf525', `bf526', `bf527', `bf531',
+ `bf532', `bf533', `bf534', `bf535' (not implemented yet), `bf536',
+ `bf537', `bf538', `bf539', `bf542', `bf542m', `bf544', `bf544m',
+ `bf547', `bf547m', `bf548', `bf548m', `bf549', `bf549m', and
+ `bf561'.
+
+
+
+File: as.info, Node: Blackfin Syntax, Next: Blackfin Directives, Prev: Blackfin Options, Up: Blackfin-Dependent
+
+9.5.2 Syntax
+------------
+
+`Special Characters'
+ Assembler input is free format and may appear anywhere on the line.
+ One instruction may extend across multiple lines or more than one
+ instruction may appear on the same line. White space (space, tab,
+ comments or newline) may appear anywhere between tokens. A token
+ must not have embedded spaces. Tokens include numbers, register
+ names, keywords, user identifiers, and also some multicharacter
+ special symbols like "+=", "/*" or "||".
+
+`Instruction Delimiting'
+ A semicolon must terminate every instruction. Sometimes a complete
+ instruction will consist of more than one operation. There are two
+ cases where this occurs. The first is when two general operations
+ are combined. Normally a comma separates the different parts, as
+ in
+
+ a0= r3.h * r2.l, a1 = r3.l * r2.h ;
+
+ The second case occurs when a general instruction is combined with
+ one or two memory references for joint issue. The latter portions
+ are set off by a "||" token.
+
+ a0 = r3.h * r2.l || r1 = [p3++] || r4 = [i2++];
+
+`Register Names'
+ The assembler treats register names and instruction keywords in a
+ case insensitive manner. User identifiers are case sensitive.
+ Thus, R3.l, R3.L, r3.l and r3.L are all equivalent input to the
+ assembler.
+
+ Register names are reserved and may not be used as program
+ identifiers.
+
+ Some operations (such as "Move Register") require a register pair.
+ Register pairs are always data registers and are denoted using a
+ colon, eg., R3:2. The larger number must be written firsts. Note
+ that the hardware only supports odd-even pairs, eg., R7:6, R5:4,
+ R3:2, and R1:0.
+
+ Some instructions (such as -SP (Push Multiple)) require a group of
+ adjacent registers. Adjacent registers are denoted in the syntax
+ by the range enclosed in parentheses and separated by a colon,
+ eg., (R7:3). Again, the larger number appears first.
+
+ Portions of a particular register may be individually specified.
+ This is written with a dot (".") following the register name and
+ then a letter denoting the desired portion. For 32-bit registers,
+ ".H" denotes the most significant ("High") portion. ".L" denotes
+ the least-significant portion. The subdivisions of the 40-bit
+ registers are described later.
+
+`Accumulators'
+ The set of 40-bit registers A1 and A0 that normally contain data
+ that is being manipulated. Each accumulator can be accessed in
+ four ways.
+
+ `one 40-bit register'
+ The register will be referred to as A1 or A0.
+
+ `one 32-bit register'
+ The registers are designated as A1.W or A0.W.
+
+ `two 16-bit registers'
+ The registers are designated as A1.H, A1.L, A0.H or A0.L.
+
+ `one 8-bit register'
+ The registers are designated as A1.X or A0.X for the bits that
+ extend beyond bit 31.
+
+`Data Registers'
+ The set of 32-bit registers (R0, R1, R2, R3, R4, R5, R6 and R7)
+ that normally contain data for manipulation. These are
+ abbreviated as D-register or Dreg. Data registers can be accessed
+ as 32-bit registers or as two independent 16-bit registers. The
+ least significant 16 bits of each register is called the "low"
+ half and is designated with ".L" following the register name. The
+ most significant 16 bits are called the "high" half and is
+ designated with ".H" following the name.
+
+ R7.L, r2.h, r4.L, R0.H
+
+`Pointer Registers'
+ The set of 32-bit registers (P0, P1, P2, P3, P4, P5, SP and FP)
+ that normally contain byte addresses of data structures. These are
+ abbreviated as P-register or Preg.
+
+ p2, p5, fp, sp
+
+`Stack Pointer SP'
+ The stack pointer contains the 32-bit address of the last occupied
+ byte location in the stack. The stack grows by decrementing the
+ stack pointer.
+
+`Frame Pointer FP'
+ The frame pointer contains the 32-bit address of the previous frame
+ pointer in the stack. It is located at the top of a frame.
+
+`Loop Top'
+ LT0 and LT1. These registers contain the 32-bit address of the
+ top of a zero overhead loop.
+
+`Loop Count'
+ LC0 and LC1. These registers contain the 32-bit counter of the
+ zero overhead loop executions.
+
+`Loop Bottom'
+ LB0 and LB1. These registers contain the 32-bit address of the
+ bottom of a zero overhead loop.
+
+`Index Registers'
+ The set of 32-bit registers (I0, I1, I2, I3) that normally contain
+ byte addresses of data structures. Abbreviated I-register or Ireg.
+
+`Modify Registers'
+ The set of 32-bit registers (M0, M1, M2, M3) that normally contain
+ offset values that are added and subracted to one of the index
+ registers. Abbreviated as Mreg.
+
+`Length Registers'
+ The set of 32-bit registers (L0, L1, L2, L3) that normally contain
+ the length in bytes of the circular buffer. Abbreviated as Lreg.
+ Clear the Lreg to disable circular addressing for the
+ corresponding Ireg.
+
+`Base Registers'
+ The set of 32-bit registers (B0, B1, B2, B3) that normally contain
+ the base address in bytes of the circular buffer. Abbreviated as
+ Breg.
+
+`Floating Point'
+ The Blackfin family has no hardware floating point but the .float
+ directive generates ieee floating point numbers for use with
+ software floating point libraries.
+
+`Blackfin Opcodes'
+ For detailed information on the Blackfin machine instruction set,
+ see the Blackfin(r) Processor Instruction Set Reference.
+
+
+
+File: as.info, Node: Blackfin Directives, Prev: Blackfin Syntax, Up: Blackfin-Dependent
+
+9.5.3 Directives
+----------------
+
+The following directives are provided for compatibility with the VDSP
+assembler.
+
+`.byte2'
+ Initializes a four byte data object.
+
+`.byte4'
+ Initializes a two byte data object.
+
+`.db'
+ TBD
+
+`.dd'
+ TBD
+
+`.dw'
+ TBD
+
+`.var'
+ Define and initialize a 32 bit data object.
+
+
+File: as.info, Node: CR16-Dependent, Next: CRIS-Dependent, Prev: Blackfin-Dependent, Up: Machine Dependencies
+
+9.6 CR16 Dependent Features
+===========================
+
+* Menu:
+
+* CR16 Operand Qualifiers:: CR16 Machine Operand Qualifiers
+
+
+File: as.info, Node: CR16 Operand Qualifiers, Up: CR16-Dependent
+
+9.6.1 CR16 Operand Qualifiers
+-----------------------------
+
+The National Semiconductor CR16 target of `as' has a few machine
+dependent operand qualifiers.
+
+ Operand expression type qualifier is an optional field in the
+instruction operand, to determines the type of the expression field of
+an operand. The `@' is required. CR16 architecture uses one of the
+following expression qualifiers:
+
+`s'
+ - `Specifies expression operand type as small'
+
+`m'
+ - `Specifies expression operand type as medium'
+
+`l'
+ - `Specifies expression operand type as large'
+
+`c'
+ - `Specifies the CR16 Assembler generates a relocation entry for
+ the operand, where pc has implied bit, the expression is adjusted
+ accordingly. The linker uses the relocation entry to update the
+ operand address at link time.'
+
+`got/GOT'
+ - `Specifies the CR16 Assembler generates a relocation entry for
+ the operand, offset from Global Offset Table. The linker uses this
+ relocation entry to update the operand address at link time'
+
+`cgot/cGOT'
+ - `Specifies the CompactRISC Assembler generates a relocation
+ entry for the operand, where pc has implied bit, the expression is
+ adjusted accordingly. The linker uses the relocation entry to
+ update the operand address at link time.'
+
+ CR16 target operand qualifiers and its size (in bits):
+
+`Immediate Operand'
+ - s --- 4 bits
+
+`'
+ - m --- 16 bits, for movb and movw instructions.
+
+`'
+ - m --- 20 bits, movd instructions.
+
+`'
+ - l --- 32 bits
+
+`Absolute Operand'
+ - s --- Illegal specifier for this operand.
+
+`'
+ - m --- 20 bits, movd instructions.
+
+`Displacement Operand'
+ - s --- 8 bits
+
+`'
+ - m --- 16 bits
+
+`'
+ - l --- 24 bits
+
+ For example:
+ 1 `movw $_myfun@c,r1'
+
+ This loads the address of _myfun, shifted right by 1, into r1.
+
+ 2 `movd $_myfun@c,(r2,r1)'
+
+ This loads the address of _myfun, shifted right by 1, into register-pair r2-r1.
+
+ 3 `_myfun_ptr:'
+ `.long _myfun@c'
+ `loadd _myfun_ptr, (r1,r0)'
+ `jal (r1,r0)'
+
+ This .long directive, the address of _myfunc, shifted right by 1 at link time.
+
+ 4 `loadd _data1@GOT(r12), (r1,r0)'
+
+ This loads the address of _data1, into global offset table (ie GOT) and its offset value from GOT loads into register-pair r2-r1.
+
+ 5 `loadd _myfunc@cGOT(r12), (r1,r0)'
+
+ This loads the address of _myfun, shifted right by 1, into global offset table (ie GOT) and its offset value from GOT loads into register-pair r1-r0.
+
+
+File: as.info, Node: CRIS-Dependent, Next: D10V-Dependent, Prev: CR16-Dependent, Up: Machine Dependencies
+
+9.7 CRIS Dependent Features
+===========================
+
+* Menu:
+
+* CRIS-Opts:: Command-line Options
+* CRIS-Expand:: Instruction expansion
+* CRIS-Symbols:: Symbols
+* CRIS-Syntax:: Syntax
+
+
+File: as.info, Node: CRIS-Opts, Next: CRIS-Expand, Up: CRIS-Dependent
+
+9.7.1 Command-line Options
+--------------------------
+
+The CRIS version of `as' has these machine-dependent command-line
+options.
+
+ The format of the generated object files can be either ELF or a.out,
+specified by the command-line options `--emulation=crisaout' and
+`--emulation=criself'. The default is ELF (criself), unless `as' has
+been configured specifically for a.out by using the configuration name
+`cris-axis-aout'.
+
+ There are two different link-incompatible ELF object file variants
+for CRIS, for use in environments where symbols are expected to be
+prefixed by a leading `_' character and for environments without such a
+symbol prefix. The variant used for GNU/Linux port has no symbol
+prefix. Which variant to produce is specified by either of the options
+`--underscore' and `--no-underscore'. The default is `--underscore'.
+Since symbols in CRIS a.out objects are expected to have a `_' prefix,
+specifying `--no-underscore' when generating a.out objects is an error.
+Besides the object format difference, the effect of this option is to
+parse register names differently (*note crisnous::). The
+`--no-underscore' option makes a `$' register prefix mandatory.
+
+ The option `--pic' must be passed to `as' in order to recognize the
+symbol syntax used for ELF (SVR4 PIC) position-independent-code (*note
+crispic::). This will also affect expansion of instructions. The
+expansion with `--pic' will use PC-relative rather than (slightly
+faster) absolute addresses in those expansions.
+
+ The option `--march=ARCHITECTURE' specifies the recognized
+instruction set and recognized register names. It also controls the
+architecture type of the object file. Valid values for ARCHITECTURE
+are:
+`v0_v10'
+ All instructions and register names for any architecture variant
+ in the set v0...v10 are recognized. This is the default if the
+ target is configured as cris-*.
+
+`v10'
+ Only instructions and register names for CRIS v10 (as found in
+ ETRAX 100 LX) are recognized. This is the default if the target
+ is configured as crisv10-*.
+
+`v32'
+ Only instructions and register names for CRIS v32 (code name
+ Guinness) are recognized. This is the default if the target is
+ configured as crisv32-*. This value implies `--no-mul-bug-abort'.
+ (A subsequent `--mul-bug-abort' will turn it back on.)
+
+`common_v10_v32'
+ Only instructions with register names and addressing modes with
+ opcodes common to the v10 and v32 are recognized.
+
+ When `-N' is specified, `as' will emit a warning when a 16-bit
+branch instruction is expanded into a 32-bit multiple-instruction
+construct (*note CRIS-Expand::).
+
+ Some versions of the CRIS v10, for example in the Etrax 100 LX,
+contain a bug that causes destabilizing memory accesses when a multiply
+instruction is executed with certain values in the first operand just
+before a cache-miss. When the `--mul-bug-abort' command line option is
+active (the default value), `as' will refuse to assemble a file
+containing a multiply instruction at a dangerous offset, one that could
+be the last on a cache-line, or is in a section with insufficient
+alignment. This placement checking does not catch any case where the
+multiply instruction is dangerously placed because it is located in a
+delay-slot. The `--mul-bug-abort' command line option turns off the
+checking.
+
+
+File: as.info, Node: CRIS-Expand, Next: CRIS-Symbols, Prev: CRIS-Opts, Up: CRIS-Dependent
+
+9.7.2 Instruction expansion
+---------------------------
+
+`as' will silently choose an instruction that fits the operand size for
+`[register+constant]' operands. For example, the offset `127' in
+`move.d [r3+127],r4' fits in an instruction using a signed-byte offset.
+Similarly, `move.d [r2+32767],r1' will generate an instruction using a
+16-bit offset. For symbolic expressions and constants that do not fit
+in 16 bits including the sign bit, a 32-bit offset is generated.
+
+ For branches, `as' will expand from a 16-bit branch instruction into
+a sequence of instructions that can reach a full 32-bit address. Since
+this does not correspond to a single instruction, such expansions can
+optionally be warned about. *Note CRIS-Opts::.
+
+ If the operand is found to fit the range, a `lapc' mnemonic will
+translate to a `lapcq' instruction. Use `lapc.d' to force the 32-bit
+`lapc' instruction.
+
+ Similarly, the `addo' mnemonic will translate to the shortest
+fitting instruction of `addoq', `addo.w' and `addo.d', when used with a
+operand that is a constant known at assembly time.
+
+
+File: as.info, Node: CRIS-Symbols, Next: CRIS-Syntax, Prev: CRIS-Expand, Up: CRIS-Dependent
+
+9.7.3 Symbols
+-------------
+
+Some symbols are defined by the assembler. They're intended to be used
+in conditional assembly, for example:
+ .if ..asm.arch.cris.v32
+ CODE FOR CRIS V32
+ .elseif ..asm.arch.cris.common_v10_v32
+ CODE COMMON TO CRIS V32 AND CRIS V10
+ .elseif ..asm.arch.cris.v10 | ..asm.arch.cris.any_v0_v10
+ CODE FOR V10
+ .else
+ .error "Code needs to be added here."
+ .endif
+
+ These symbols are defined in the assembler, reflecting command-line
+options, either when specified or the default. They are always
+defined, to 0 or 1.
+`..asm.arch.cris.any_v0_v10'
+ This symbol is non-zero when `--march=v0_v10' is specified or the
+ default.
+
+`..asm.arch.cris.common_v10_v32'
+ Set according to the option `--march=common_v10_v32'.
+
+`..asm.arch.cris.v10'
+ Reflects the option `--march=v10'.
+
+`..asm.arch.cris.v32'
+ Corresponds to `--march=v10'.
+
+ Speaking of symbols, when a symbol is used in code, it can have a
+suffix modifying its value for use in position-independent code. *Note
+CRIS-Pic::.
+
+
+File: as.info, Node: CRIS-Syntax, Prev: CRIS-Symbols, Up: CRIS-Dependent
+
+9.7.4 Syntax
+------------
+
+There are different aspects of the CRIS assembly syntax.
+
+* Menu:
+
+* CRIS-Chars:: Special Characters
+* CRIS-Pic:: Position-Independent Code Symbols
+* CRIS-Regs:: Register Names
+* CRIS-Pseudos:: Assembler Directives
+
+
+File: as.info, Node: CRIS-Chars, Next: CRIS-Pic, Up: CRIS-Syntax
+
+9.7.4.1 Special Characters
+..........................
+
+The character `#' is a line comment character. It starts a comment if
+and only if it is placed at the beginning of a line.
+
+ A `;' character starts a comment anywhere on the line, causing all
+characters up to the end of the line to be ignored.
+
+ A `@' character is handled as a line separator equivalent to a
+logical new-line character (except in a comment), so separate
+instructions can be specified on a single line.
+
+
+File: as.info, Node: CRIS-Pic, Next: CRIS-Regs, Prev: CRIS-Chars, Up: CRIS-Syntax
+
+9.7.4.2 Symbols in position-independent code
+............................................
+
+When generating position-independent code (SVR4 PIC) for use in
+cris-axis-linux-gnu or crisv32-axis-linux-gnu shared libraries, symbol
+suffixes are used to specify what kind of run-time symbol lookup will
+be used, expressed in the object as different _relocation types_.
+Usually, all absolute symbol values must be located in a table, the
+_global offset table_, leaving the code position-independent;
+independent of values of global symbols and independent of the address
+of the code. The suffix modifies the value of the symbol, into for
+example an index into the global offset table where the real symbol
+value is entered, or a PC-relative value, or a value relative to the
+start of the global offset table. All symbol suffixes start with the
+character `:' (omitted in the list below). Every symbol use in code or
+a read-only section must therefore have a PIC suffix to enable a useful
+shared library to be created. Usually, these constructs must not be
+used with an additive constant offset as is usually allowed, i.e. no 4
+as in `symbol + 4' is allowed. This restriction is checked at
+link-time, not at assembly-time.
+
+`GOT'
+ Attaching this suffix to a symbol in an instruction causes the
+ symbol to be entered into the global offset table. The value is a
+ 32-bit index for that symbol into the global offset table. The
+ name of the corresponding relocation is `R_CRIS_32_GOT'. Example:
+ `move.d [$r0+extsym:GOT],$r9'
+
+`GOT16'
+ Same as for `GOT', but the value is a 16-bit index into the global
+ offset table. The corresponding relocation is `R_CRIS_16_GOT'.
+ Example: `move.d [$r0+asymbol:GOT16],$r10'
+
+`PLT'
+ This suffix is used for function symbols. It causes a _procedure
+ linkage table_, an array of code stubs, to be created at the time
+ the shared object is created or linked against, together with a
+ global offset table entry. The value is a pc-relative offset to
+ the corresponding stub code in the procedure linkage table. This
+ arrangement causes the run-time symbol resolver to be called to
+ look up and set the value of the symbol the first time the
+ function is called (at latest; depending environment variables).
+ It is only safe to leave the symbol unresolved this way if all
+ references are function calls. The name of the relocation is
+ `R_CRIS_32_PLT_PCREL'. Example: `add.d fnname:PLT,$pc'
+
+`PLTG'
+ Like PLT, but the value is relative to the beginning of the global
+ offset table. The relocation is `R_CRIS_32_PLT_GOTREL'. Example:
+ `move.d fnname:PLTG,$r3'
+
+`GOTPLT'
+ Similar to `PLT', but the value of the symbol is a 32-bit index
+ into the global offset table. This is somewhat of a mix between
+ the effect of the `GOT' and the `PLT' suffix; the difference to
+ `GOT' is that there will be a procedure linkage table entry
+ created, and that the symbol is assumed to be a function entry and
+ will be resolved by the run-time resolver as with `PLT'. The
+ relocation is `R_CRIS_32_GOTPLT'. Example: `jsr
+ [$r0+fnname:GOTPLT]'
+
+`GOTPLT16'
+ A variant of `GOTPLT' giving a 16-bit value. Its relocation name
+ is `R_CRIS_16_GOTPLT'. Example: `jsr [$r0+fnname:GOTPLT16]'
+
+`GOTOFF'
+ This suffix must only be attached to a local symbol, but may be
+ used in an expression adding an offset. The value is the address
+ of the symbol relative to the start of the global offset table.
+ The relocation name is `R_CRIS_32_GOTREL'. Example: `move.d
+ [$r0+localsym:GOTOFF],r3'
+
+
+File: as.info, Node: CRIS-Regs, Next: CRIS-Pseudos, Prev: CRIS-Pic, Up: CRIS-Syntax
+
+9.7.4.3 Register names
+......................
+
+A `$' character may always prefix a general or special register name in
+an instruction operand but is mandatory when the option
+`--no-underscore' is specified or when the `.syntax register_prefix'
+directive is in effect (*note crisnous::). Register names are
+case-insensitive.
+
+
+File: as.info, Node: CRIS-Pseudos, Prev: CRIS-Regs, Up: CRIS-Syntax
+
+9.7.4.4 Assembler Directives
+............................
+
+There are a few CRIS-specific pseudo-directives in addition to the
+generic ones. *Note Pseudo Ops::. Constants emitted by
+pseudo-directives are in little-endian order for CRIS. There is no
+support for floating-point-specific directives for CRIS.
+
+`.dword EXPRESSIONS'
+ The `.dword' directive is a synonym for `.int', expecting zero or
+ more EXPRESSIONS, separated by commas. For each expression, a
+ 32-bit little-endian constant is emitted.
+
+`.syntax ARGUMENT'
+ The `.syntax' directive takes as ARGUMENT one of the following
+ case-sensitive choices.
+
+ `no_register_prefix'
+ The `.syntax no_register_prefix' directive makes a `$'
+ character prefix on all registers optional. It overrides a
+ previous setting, including the corresponding effect of the
+ option `--no-underscore'. If this directive is used when
+ ordinary symbols do not have a `_' character prefix, care
+ must be taken to avoid ambiguities whether an operand is a
+ register or a symbol; using symbols with names the same as
+ general or special registers then invoke undefined behavior.
+
+ `register_prefix'
+ This directive makes a `$' character prefix on all registers
+ mandatory. It overrides a previous setting, including the
+ corresponding effect of the option `--underscore'.
+
+ `leading_underscore'
+ This is an assertion directive, emitting an error if the
+ `--no-underscore' option is in effect.
+
+ `no_leading_underscore'
+ This is the opposite of the `.syntax leading_underscore'
+ directive and emits an error if the option `--underscore' is
+ in effect.
+
+`.arch ARGUMENT'
+ This is an assertion directive, giving an error if the specified
+ ARGUMENT is not the same as the specified or default value for the
+ `--march=ARCHITECTURE' option (*note march-option::).
+
+
+
+File: as.info, Node: D10V-Dependent, Next: D30V-Dependent, Prev: CRIS-Dependent, Up: Machine Dependencies
+
+9.8 D10V Dependent Features
+===========================
+
+* Menu:
+
+* D10V-Opts:: D10V Options
+* D10V-Syntax:: Syntax
+* D10V-Float:: Floating Point
+* D10V-Opcodes:: Opcodes
+
+
+File: as.info, Node: D10V-Opts, Next: D10V-Syntax, Up: D10V-Dependent
+
+9.8.1 D10V Options
+------------------
+
+The Mitsubishi D10V version of `as' has a few machine dependent options.
+
+`-O'
+ The D10V can often execute two sub-instructions in parallel. When
+ this option is used, `as' will attempt to optimize its output by
+ detecting when instructions can be executed in parallel.
+
+`--nowarnswap'
+ To optimize execution performance, `as' will sometimes swap the
+ order of instructions. Normally this generates a warning. When
+ this option is used, no warning will be generated when
+ instructions are swapped.
+
+`--gstabs-packing'
+
+`--no-gstabs-packing'
+ `as' packs adjacent short instructions into a single packed
+ instruction. `--no-gstabs-packing' turns instruction packing off if
+ `--gstabs' is specified as well; `--gstabs-packing' (the default)
+ turns instruction packing on even when `--gstabs' is specified.
+
+
+File: as.info, Node: D10V-Syntax, Next: D10V-Float, Prev: D10V-Opts, Up: D10V-Dependent
+
+9.8.2 Syntax
+------------
+
+The D10V syntax is based on the syntax in Mitsubishi's D10V
+architecture manual. The differences are detailed below.
+
+* Menu:
+
+* D10V-Size:: Size Modifiers
+* D10V-Subs:: Sub-Instructions
+* D10V-Chars:: Special Characters
+* D10V-Regs:: Register Names
+* D10V-Addressing:: Addressing Modes
+* D10V-Word:: @WORD Modifier
+
+
+File: as.info, Node: D10V-Size, Next: D10V-Subs, Up: D10V-Syntax
+
+9.8.2.1 Size Modifiers
+......................
+
+The D10V version of `as' uses the instruction names in the D10V
+Architecture Manual. However, the names in the manual are sometimes
+ambiguous. There are instruction names that can assemble to a short or
+long form opcode. How does the assembler pick the correct form? `as'
+will always pick the smallest form if it can. When dealing with a
+symbol that is not defined yet when a line is being assembled, it will
+always use the long form. If you need to force the assembler to use
+either the short or long form of the instruction, you can append either
+`.s' (short) or `.l' (long) to it. For example, if you are writing an
+assembly program and you want to do a branch to a symbol that is
+defined later in your program, you can write `bra.s foo'. Objdump
+and GDB will always append `.s' or `.l' to instructions which have both
+short and long forms.
+
+
+File: as.info, Node: D10V-Subs, Next: D10V-Chars, Prev: D10V-Size, Up: D10V-Syntax
+
+9.8.2.2 Sub-Instructions
+........................
+
+The D10V assembler takes as input a series of instructions, either
+one-per-line, or in the special two-per-line format described in the
+next section. Some of these instructions will be short-form or
+sub-instructions. These sub-instructions can be packed into a single
+instruction. The assembler will do this automatically. It will also
+detect when it should not pack instructions. For example, when a label
+is defined, the next instruction will never be packaged with the
+previous one. Whenever a branch and link instruction is called, it
+will not be packaged with the next instruction so the return address
+will be valid. Nops are automatically inserted when necessary.
+
+ If you do not want the assembler automatically making these
+decisions, you can control the packaging and execution type (parallel
+or sequential) with the special execution symbols described in the next
+section.
+
+
+File: as.info, Node: D10V-Chars, Next: D10V-Regs, Prev: D10V-Subs, Up: D10V-Syntax
+
+9.8.2.3 Special Characters
+..........................
+
+`;' and `#' are the line comment characters. Sub-instructions may be
+executed in order, in reverse-order, or in parallel. Instructions
+listed in the standard one-per-line format will be executed
+sequentially. To specify the executing order, use the following
+symbols:
+`->'
+ Sequential with instruction on the left first.
+
+`<-'
+ Sequential with instruction on the right first.
+
+`||'
+ Parallel
+ The D10V syntax allows either one instruction per line, one
+instruction per line with the execution symbol, or two instructions per
+line. For example
+`abs a1 -> abs r0'
+ Execute these sequentially. The instruction on the right is in
+ the right container and is executed second.
+
+`abs r0 <- abs a1'
+ Execute these reverse-sequentially. The instruction on the right
+ is in the right container, and is executed first.
+
+`ld2w r2,@r8+ || mac a0,r0,r7'
+ Execute these in parallel.
+
+`ld2w r2,@r8+ ||'
+`mac a0,r0,r7'
+ Two-line format. Execute these in parallel.
+
+`ld2w r2,@r8+'
+`mac a0,r0,r7'
+ Two-line format. Execute these sequentially. Assembler will put
+ them in the proper containers.
+
+`ld2w r2,@r8+ ->'
+`mac a0,r0,r7'
+ Two-line format. Execute these sequentially. Same as above but
+ second instruction will always go into right container.
+ Since `$' has no special meaning, you may use it in symbol names.
+
+
+File: as.info, Node: D10V-Regs, Next: D10V-Addressing, Prev: D10V-Chars, Up: D10V-Syntax
+
+9.8.2.4 Register Names
+......................
+
+You can use the predefined symbols `r0' through `r15' to refer to the
+D10V registers. You can also use `sp' as an alias for `r15'. The
+accumulators are `a0' and `a1'. There are special register-pair names
+that may optionally be used in opcodes that require even-numbered
+registers. Register names are not case sensitive.
+
+ Register Pairs
+`r0-r1'
+
+`r2-r3'
+
+`r4-r5'
+
+`r6-r7'
+
+`r8-r9'
+
+`r10-r11'
+
+`r12-r13'
+
+`r14-r15'
+
+ The D10V also has predefined symbols for these control registers and
+status bits:
+`psw'
+ Processor Status Word
+
+`bpsw'
+ Backup Processor Status Word
+
+`pc'
+ Program Counter
+
+`bpc'
+ Backup Program Counter
+
+`rpt_c'
+ Repeat Count
+
+`rpt_s'
+ Repeat Start address
+
+`rpt_e'
+ Repeat End address
+
+`mod_s'
+ Modulo Start address
+
+`mod_e'
+ Modulo End address
+
+`iba'
+ Instruction Break Address
+
+`f0'
+ Flag 0
+
+`f1'
+ Flag 1
+
+`c'
+ Carry flag
+
+
+File: as.info, Node: D10V-Addressing, Next: D10V-Word, Prev: D10V-Regs, Up: D10V-Syntax
+
+9.8.2.5 Addressing Modes
+........................
+
+`as' understands the following addressing modes for the D10V. `RN' in
+the following refers to any of the numbered registers, but _not_ the
+control registers.
+`RN'
+ Register direct
+
+`@RN'
+ Register indirect
+
+`@RN+'
+ Register indirect with post-increment
+
+`@RN-'
+ Register indirect with post-decrement
+
+`@-SP'
+ Register indirect with pre-decrement
+
+`@(DISP, RN)'
+ Register indirect with displacement
+
+`ADDR'
+ PC relative address (for branch or rep).
+
+`#IMM'
+ Immediate data (the `#' is optional and ignored)
+
+
+File: as.info, Node: D10V-Word, Prev: D10V-Addressing, Up: D10V-Syntax
+
+9.8.2.6 @WORD Modifier
+......................
+
+Any symbol followed by `@word' will be replaced by the symbol's value
+shifted right by 2. This is used in situations such as loading a
+register with the address of a function (or any other code fragment).
+For example, if you want to load a register with the location of the
+function `main' then jump to that function, you could do it as follows:
+ ldi r2, main@word
+ jmp r2
+
+
+File: as.info, Node: D10V-Float, Next: D10V-Opcodes, Prev: D10V-Syntax, Up: D10V-Dependent
+
+9.8.3 Floating Point
+--------------------
+
+The D10V has no hardware floating point, but the `.float' and `.double'
+directives generates IEEE floating-point numbers for compatibility with
+other development tools.
+
+
+File: as.info, Node: D10V-Opcodes, Prev: D10V-Float, Up: D10V-Dependent
+
+9.8.4 Opcodes
+-------------
+
+For detailed information on the D10V machine instruction set, see `D10V
+Architecture: A VLIW Microprocessor for Multimedia Applications'
+(Mitsubishi Electric Corp.). `as' implements all the standard D10V
+opcodes. The only changes are those described in the section on size
+modifiers
+
+
+File: as.info, Node: D30V-Dependent, Next: H8/300-Dependent, Prev: D10V-Dependent, Up: Machine Dependencies
+
+9.9 D30V Dependent Features
+===========================
+
+* Menu:
+
+* D30V-Opts:: D30V Options
+* D30V-Syntax:: Syntax
+* D30V-Float:: Floating Point
+* D30V-Opcodes:: Opcodes
+
+
+File: as.info, Node: D30V-Opts, Next: D30V-Syntax, Up: D30V-Dependent
+
+9.9.1 D30V Options
+------------------
+
+The Mitsubishi D30V version of `as' has a few machine dependent options.
+
+`-O'
+ The D30V can often execute two sub-instructions in parallel. When
+ this option is used, `as' will attempt to optimize its output by
+ detecting when instructions can be executed in parallel.
+
+`-n'
+ When this option is used, `as' will issue a warning every time it
+ adds a nop instruction.
+
+`-N'
+ When this option is used, `as' will issue a warning if it needs to
+ insert a nop after a 32-bit multiply before a load or 16-bit
+ multiply instruction.
+
+
+File: as.info, Node: D30V-Syntax, Next: D30V-Float, Prev: D30V-Opts, Up: D30V-Dependent
+
+9.9.2 Syntax
+------------
+
+The D30V syntax is based on the syntax in Mitsubishi's D30V
+architecture manual. The differences are detailed below.
+
+* Menu:
+
+* D30V-Size:: Size Modifiers
+* D30V-Subs:: Sub-Instructions
+* D30V-Chars:: Special Characters
+* D30V-Guarded:: Guarded Execution
+* D30V-Regs:: Register Names
+* D30V-Addressing:: Addressing Modes
+
+
+File: as.info, Node: D30V-Size, Next: D30V-Subs, Up: D30V-Syntax
+
+9.9.2.1 Size Modifiers
+......................
+
+The D30V version of `as' uses the instruction names in the D30V
+Architecture Manual. However, the names in the manual are sometimes
+ambiguous. There are instruction names that can assemble to a short or
+long form opcode. How does the assembler pick the correct form? `as'
+will always pick the smallest form if it can. When dealing with a
+symbol that is not defined yet when a line is being assembled, it will
+always use the long form. If you need to force the assembler to use
+either the short or long form of the instruction, you can append either
+`.s' (short) or `.l' (long) to it. For example, if you are writing an
+assembly program and you want to do a branch to a symbol that is
+defined later in your program, you can write `bra.s foo'. Objdump and
+GDB will always append `.s' or `.l' to instructions which have both
+short and long forms.
+
+
+File: as.info, Node: D30V-Subs, Next: D30V-Chars, Prev: D30V-Size, Up: D30V-Syntax
+
+9.9.2.2 Sub-Instructions
+........................
+
+The D30V assembler takes as input a series of instructions, either
+one-per-line, or in the special two-per-line format described in the
+next section. Some of these instructions will be short-form or
+sub-instructions. These sub-instructions can be packed into a single
+instruction. The assembler will do this automatically. It will also
+detect when it should not pack instructions. For example, when a label
+is defined, the next instruction will never be packaged with the
+previous one. Whenever a branch and link instruction is called, it
+will not be packaged with the next instruction so the return address
+will be valid. Nops are automatically inserted when necessary.
+
+ If you do not want the assembler automatically making these
+decisions, you can control the packaging and execution type (parallel
+or sequential) with the special execution symbols described in the next
+section.
+
+
+File: as.info, Node: D30V-Chars, Next: D30V-Guarded, Prev: D30V-Subs, Up: D30V-Syntax
+
+9.9.2.3 Special Characters
+..........................
+
+`;' and `#' are the line comment characters. Sub-instructions may be
+executed in order, in reverse-order, or in parallel. Instructions
+listed in the standard one-per-line format will be executed
+sequentially unless you use the `-O' option.
+
+ To specify the executing order, use the following symbols:
+`->'
+ Sequential with instruction on the left first.
+
+`<-'
+ Sequential with instruction on the right first.
+
+`||'
+ Parallel
+
+ The D30V syntax allows either one instruction per line, one
+instruction per line with the execution symbol, or two instructions per
+line. For example
+`abs r2,r3 -> abs r4,r5'
+ Execute these sequentially. The instruction on the right is in
+ the right container and is executed second.
+
+`abs r2,r3 <- abs r4,r5'
+ Execute these reverse-sequentially. The instruction on the right
+ is in the right container, and is executed first.
+
+`abs r2,r3 || abs r4,r5'
+ Execute these in parallel.
+
+`ldw r2,@(r3,r4) ||'
+`mulx r6,r8,r9'
+ Two-line format. Execute these in parallel.
+
+`mulx a0,r8,r9'
+`stw r2,@(r3,r4)'
+ Two-line format. Execute these sequentially unless `-O' option is
+ used. If the `-O' option is used, the assembler will determine if
+ the instructions could be done in parallel (the above two
+ instructions can be done in parallel), and if so, emit them as
+ parallel instructions. The assembler will put them in the proper
+ containers. In the above example, the assembler will put the
+ `stw' instruction in left container and the `mulx' instruction in
+ the right container.
+
+`stw r2,@(r3,r4) ->'
+`mulx a0,r8,r9'
+ Two-line format. Execute the `stw' instruction followed by the
+ `mulx' instruction sequentially. The first instruction goes in the
+ left container and the second instruction goes into right
+ container. The assembler will give an error if the machine
+ ordering constraints are violated.
+
+`stw r2,@(r3,r4) <-'
+`mulx a0,r8,r9'
+ Same as previous example, except that the `mulx' instruction is
+ executed before the `stw' instruction.
+
+ Since `$' has no special meaning, you may use it in symbol names.
+
+
+File: as.info, Node: D30V-Guarded, Next: D30V-Regs, Prev: D30V-Chars, Up: D30V-Syntax
+
+9.9.2.4 Guarded Execution
+.........................
+
+`as' supports the full range of guarded execution directives for each
+instruction. Just append the directive after the instruction proper.
+The directives are:
+
+`/tx'
+ Execute the instruction if flag f0 is true.
+
+`/fx'
+ Execute the instruction if flag f0 is false.
+
+`/xt'
+ Execute the instruction if flag f1 is true.
+
+`/xf'
+ Execute the instruction if flag f1 is false.
+
+`/tt'
+ Execute the instruction if both flags f0 and f1 are true.
+
+`/tf'
+ Execute the instruction if flag f0 is true and flag f1 is false.
+
+
+File: as.info, Node: D30V-Regs, Next: D30V-Addressing, Prev: D30V-Guarded, Up: D30V-Syntax
+
+9.9.2.5 Register Names
+......................
+
+You can use the predefined symbols `r0' through `r63' to refer to the
+D30V registers. You can also use `sp' as an alias for `r63' and `link'
+as an alias for `r62'. The accumulators are `a0' and `a1'.
+
+ The D30V also has predefined symbols for these control registers and
+status bits:
+`psw'
+ Processor Status Word
+
+`bpsw'
+ Backup Processor Status Word
+
+`pc'
+ Program Counter
+
+`bpc'
+ Backup Program Counter
+
+`rpt_c'
+ Repeat Count
+
+`rpt_s'
+ Repeat Start address
+
+`rpt_e'
+ Repeat End address
+
+`mod_s'
+ Modulo Start address
+
+`mod_e'
+ Modulo End address
+
+`iba'
+ Instruction Break Address
+
+`f0'
+ Flag 0
+
+`f1'
+ Flag 1
+
+`f2'
+ Flag 2
+
+`f3'
+ Flag 3
+
+`f4'
+ Flag 4
+
+`f5'
+ Flag 5
+
+`f6'
+ Flag 6
+
+`f7'
+ Flag 7
+
+`s'
+ Same as flag 4 (saturation flag)
+
+`v'
+ Same as flag 5 (overflow flag)
+
+`va'
+ Same as flag 6 (sticky overflow flag)
+
+`c'
+ Same as flag 7 (carry/borrow flag)
+
+`b'
+ Same as flag 7 (carry/borrow flag)
+
+
+File: as.info, Node: D30V-Addressing, Prev: D30V-Regs, Up: D30V-Syntax
+
+9.9.2.6 Addressing Modes
+........................
+
+`as' understands the following addressing modes for the D30V. `RN' in
+the following refers to any of the numbered registers, but _not_ the
+control registers.
+`RN'
+ Register direct
+
+`@RN'
+ Register indirect
+
+`@RN+'
+ Register indirect with post-increment
+
+`@RN-'
+ Register indirect with post-decrement
+
+`@-SP'
+ Register indirect with pre-decrement
+
+`@(DISP, RN)'
+ Register indirect with displacement
+
+`ADDR'
+ PC relative address (for branch or rep).
+
+`#IMM'
+ Immediate data (the `#' is optional and ignored)
+
+
+File: as.info, Node: D30V-Float, Next: D30V-Opcodes, Prev: D30V-Syntax, Up: D30V-Dependent
+
+9.9.3 Floating Point
+--------------------
+
+The D30V has no hardware floating point, but the `.float' and `.double'
+directives generates IEEE floating-point numbers for compatibility with
+other development tools.
+
+
+File: as.info, Node: D30V-Opcodes, Prev: D30V-Float, Up: D30V-Dependent
+
+9.9.4 Opcodes
+-------------
+
+For detailed information on the D30V machine instruction set, see `D30V
+Architecture: A VLIW Microprocessor for Multimedia Applications'
+(Mitsubishi Electric Corp.). `as' implements all the standard D30V
+opcodes. The only changes are those described in the section on size
+modifiers
+
+
+File: as.info, Node: H8/300-Dependent, Next: HPPA-Dependent, Prev: D30V-Dependent, Up: Machine Dependencies
+
+9.10 H8/300 Dependent Features
+==============================
+
+* Menu:
+
+* H8/300 Options:: Options
+* H8/300 Syntax:: Syntax
+* H8/300 Floating Point:: Floating Point
+* H8/300 Directives:: H8/300 Machine Directives
+* H8/300 Opcodes:: Opcodes
+
+
+File: as.info, Node: H8/300 Options, Next: H8/300 Syntax, Up: H8/300-Dependent
+
+9.10.1 Options
+--------------
+
+The Renesas H8/300 version of `as' has one machine-dependent option:
+
+`-h-tick-hex'
+ Support H'00 style hex constants in addition to 0x00 style.
+
+
+
+File: as.info, Node: H8/300 Syntax, Next: H8/300 Floating Point, Prev: H8/300 Options, Up: H8/300-Dependent
+
+9.10.2 Syntax
+-------------
+
+* Menu:
+
+* H8/300-Chars:: Special Characters
+* H8/300-Regs:: Register Names
+* H8/300-Addressing:: Addressing Modes
+
+
+File: as.info, Node: H8/300-Chars, Next: H8/300-Regs, Up: H8/300 Syntax
+
+9.10.2.1 Special Characters
+...........................
+
+`;' is the line comment character.
+
+ `$' can be used instead of a newline to separate statements.
+Therefore _you may not use `$' in symbol names_ on the H8/300.
+
+
+File: as.info, Node: H8/300-Regs, Next: H8/300-Addressing, Prev: H8/300-Chars, Up: H8/300 Syntax
+
+9.10.2.2 Register Names
+.......................
+
+You can use predefined symbols of the form `rNh' and `rNl' to refer to
+the H8/300 registers as sixteen 8-bit general-purpose registers. N is
+a digit from `0' to `7'); for instance, both `r0h' and `r7l' are valid
+register names.
+
+ You can also use the eight predefined symbols `rN' to refer to the
+H8/300 registers as 16-bit registers (you must use this form for
+addressing).
+
+ On the H8/300H, you can also use the eight predefined symbols `erN'
+(`er0' ... `er7') to refer to the 32-bit general purpose registers.
+
+ The two control registers are called `pc' (program counter; a 16-bit
+register, except on the H8/300H where it is 24 bits) and `ccr'
+(condition code register; an 8-bit register). `r7' is used as the
+stack pointer, and can also be called `sp'.
+
+
+File: as.info, Node: H8/300-Addressing, Prev: H8/300-Regs, Up: H8/300 Syntax
+
+9.10.2.3 Addressing Modes
+.........................
+
+as understands the following addressing modes for the H8/300:
+`rN'
+ Register direct
+
+`@rN'
+ Register indirect
+
+`@(D, rN)'
+`@(D:16, rN)'
+`@(D:24, rN)'
+ Register indirect: 16-bit or 24-bit displacement D from register
+ N. (24-bit displacements are only meaningful on the H8/300H.)
+
+`@rN+'
+ Register indirect with post-increment
+
+`@-rN'
+ Register indirect with pre-decrement
+
+``@'AA'
+``@'AA:8'
+``@'AA:16'
+``@'AA:24'
+ Absolute address `aa'. (The address size `:24' only makes sense
+ on the H8/300H.)
+
+`#XX'
+`#XX:8'
+`#XX:16'
+`#XX:32'
+ Immediate data XX. You may specify the `:8', `:16', or `:32' for
+ clarity, if you wish; but `as' neither requires this nor uses
+ it--the data size required is taken from context.
+
+``@'`@'AA'
+``@'`@'AA:8'
+ Memory indirect. You may specify the `:8' for clarity, if you
+ wish; but `as' neither requires this nor uses it.
+
+
+File: as.info, Node: H8/300 Floating Point, Next: H8/300 Directives, Prev: H8/300 Syntax, Up: H8/300-Dependent
+
+9.10.3 Floating Point
+---------------------
+
+The H8/300 family has no hardware floating point, but the `.float'
+directive generates IEEE floating-point numbers for compatibility with
+other development tools.
+
+
+File: as.info, Node: H8/300 Directives, Next: H8/300 Opcodes, Prev: H8/300 Floating Point, Up: H8/300-Dependent
+
+9.10.4 H8/300 Machine Directives
+--------------------------------
+
+`as' has the following machine-dependent directives for the H8/300:
+
+`.h8300h'
+ Recognize and emit additional instructions for the H8/300H
+ variant, and also make `.int' emit 32-bit numbers rather than the
+ usual (16-bit) for the H8/300 family.
+
+`.h8300s'
+ Recognize and emit additional instructions for the H8S variant, and
+ also make `.int' emit 32-bit numbers rather than the usual (16-bit)
+ for the H8/300 family.
+
+`.h8300hn'
+ Recognize and emit additional instructions for the H8/300H variant
+ in normal mode, and also make `.int' emit 32-bit numbers rather
+ than the usual (16-bit) for the H8/300 family.
+
+`.h8300sn'
+ Recognize and emit additional instructions for the H8S variant in
+ normal mode, and also make `.int' emit 32-bit numbers rather than
+ the usual (16-bit) for the H8/300 family.
+
+ On the H8/300 family (including the H8/300H) `.word' directives
+generate 16-bit numbers.
+
+
+File: as.info, Node: H8/300 Opcodes, Prev: H8/300 Directives, Up: H8/300-Dependent
+
+9.10.5 Opcodes
+--------------
+
+For detailed information on the H8/300 machine instruction set, see
+`H8/300 Series Programming Manual'. For information specific to the
+H8/300H, see `H8/300H Series Programming Manual' (Renesas).
+
+ `as' implements all the standard H8/300 opcodes. No additional
+pseudo-instructions are needed on this family.
+
+ The following table summarizes the H8/300 opcodes, and their
+arguments. Entries marked `*' are opcodes used only on the H8/300H.
+
+ Legend:
+ Rs source register
+ Rd destination register
+ abs absolute address
+ imm immediate data
+ disp:N N-bit displacement from a register
+ pcrel:N N-bit displacement relative to program counter
+
+ add.b #imm,rd * andc #imm,ccr
+ add.b rs,rd band #imm,rd
+ add.w rs,rd band #imm,@rd
+ * add.w #imm,rd band #imm,@abs:8
+ * add.l rs,rd bra pcrel:8
+ * add.l #imm,rd * bra pcrel:16
+ adds #imm,rd bt pcrel:8
+ addx #imm,rd * bt pcrel:16
+ addx rs,rd brn pcrel:8
+ and.b #imm,rd * brn pcrel:16
+ and.b rs,rd bf pcrel:8
+ * and.w rs,rd * bf pcrel:16
+ * and.w #imm,rd bhi pcrel:8
+ * and.l #imm,rd * bhi pcrel:16
+ * and.l rs,rd bls pcrel:8
+
+ * bls pcrel:16 bld #imm,rd
+ bcc pcrel:8 bld #imm,@rd
+ * bcc pcrel:16 bld #imm,@abs:8
+ bhs pcrel:8 bnot #imm,rd
+ * bhs pcrel:16 bnot #imm,@rd
+ bcs pcrel:8 bnot #imm,@abs:8
+ * bcs pcrel:16 bnot rs,rd
+ blo pcrel:8 bnot rs,@rd
+ * blo pcrel:16 bnot rs,@abs:8
+ bne pcrel:8 bor #imm,rd
+ * bne pcrel:16 bor #imm,@rd
+ beq pcrel:8 bor #imm,@abs:8
+ * beq pcrel:16 bset #imm,rd
+ bvc pcrel:8 bset #imm,@rd
+ * bvc pcrel:16 bset #imm,@abs:8
+ bvs pcrel:8 bset rs,rd
+ * bvs pcrel:16 bset rs,@rd
+ bpl pcrel:8 bset rs,@abs:8
+ * bpl pcrel:16 bsr pcrel:8
+ bmi pcrel:8 bsr pcrel:16
+ * bmi pcrel:16 bst #imm,rd
+ bge pcrel:8 bst #imm,@rd
+ * bge pcrel:16 bst #imm,@abs:8
+ blt pcrel:8 btst #imm,rd
+ * blt pcrel:16 btst #imm,@rd
+ bgt pcrel:8 btst #imm,@abs:8
+ * bgt pcrel:16 btst rs,rd
+ ble pcrel:8 btst rs,@rd
+ * ble pcrel:16 btst rs,@abs:8
+ bclr #imm,rd bxor #imm,rd
+ bclr #imm,@rd bxor #imm,@rd
+ bclr #imm,@abs:8 bxor #imm,@abs:8
+ bclr rs,rd cmp.b #imm,rd
+ bclr rs,@rd cmp.b rs,rd
+ bclr rs,@abs:8 cmp.w rs,rd
+ biand #imm,rd cmp.w rs,rd
+ biand #imm,@rd * cmp.w #imm,rd
+ biand #imm,@abs:8 * cmp.l #imm,rd
+ bild #imm,rd * cmp.l rs,rd
+ bild #imm,@rd daa rs
+ bild #imm,@abs:8 das rs
+ bior #imm,rd dec.b rs
+ bior #imm,@rd * dec.w #imm,rd
+ bior #imm,@abs:8 * dec.l #imm,rd
+ bist #imm,rd divxu.b rs,rd
+ bist #imm,@rd * divxu.w rs,rd
+ bist #imm,@abs:8 * divxs.b rs,rd
+ bixor #imm,rd * divxs.w rs,rd
+ bixor #imm,@rd eepmov
+ bixor #imm,@abs:8 * eepmovw
+
+ * exts.w rd mov.w rs,@abs:16
+ * exts.l rd * mov.l #imm,rd
+ * extu.w rd * mov.l rs,rd
+ * extu.l rd * mov.l @rs,rd
+ inc rs * mov.l @(disp:16,rs),rd
+ * inc.w #imm,rd * mov.l @(disp:24,rs),rd
+ * inc.l #imm,rd * mov.l @rs+,rd
+ jmp @rs * mov.l @abs:16,rd
+ jmp abs * mov.l @abs:24,rd
+ jmp @@abs:8 * mov.l rs,@rd
+ jsr @rs * mov.l rs,@(disp:16,rd)
+ jsr abs * mov.l rs,@(disp:24,rd)
+ jsr @@abs:8 * mov.l rs,@-rd
+ ldc #imm,ccr * mov.l rs,@abs:16
+ ldc rs,ccr * mov.l rs,@abs:24
+ * ldc @abs:16,ccr movfpe @abs:16,rd
+ * ldc @abs:24,ccr movtpe rs,@abs:16
+ * ldc @(disp:16,rs),ccr mulxu.b rs,rd
+ * ldc @(disp:24,rs),ccr * mulxu.w rs,rd
+ * ldc @rs+,ccr * mulxs.b rs,rd
+ * ldc @rs,ccr * mulxs.w rs,rd
+ * mov.b @(disp:24,rs),rd neg.b rs
+ * mov.b rs,@(disp:24,rd) * neg.w rs
+ mov.b @abs:16,rd * neg.l rs
+ mov.b rs,rd nop
+ mov.b @abs:8,rd not.b rs
+ mov.b rs,@abs:8 * not.w rs
+ mov.b rs,rd * not.l rs
+ mov.b #imm,rd or.b #imm,rd
+ mov.b @rs,rd or.b rs,rd
+ mov.b @(disp:16,rs),rd * or.w #imm,rd
+ mov.b @rs+,rd * or.w rs,rd
+ mov.b @abs:8,rd * or.l #imm,rd
+ mov.b rs,@rd * or.l rs,rd
+ mov.b rs,@(disp:16,rd) orc #imm,ccr
+ mov.b rs,@-rd pop.w rs
+ mov.b rs,@abs:8 * pop.l rs
+ mov.w rs,@rd push.w rs
+ * mov.w @(disp:24,rs),rd * push.l rs
+ * mov.w rs,@(disp:24,rd) rotl.b rs
+ * mov.w @abs:24,rd * rotl.w rs
+ * mov.w rs,@abs:24 * rotl.l rs
+ mov.w rs,rd rotr.b rs
+ mov.w #imm,rd * rotr.w rs
+ mov.w @rs,rd * rotr.l rs
+ mov.w @(disp:16,rs),rd rotxl.b rs
+ mov.w @rs+,rd * rotxl.w rs
+ mov.w @abs:16,rd * rotxl.l rs
+ mov.w rs,@(disp:16,rd) rotxr.b rs
+ mov.w rs,@-rd * rotxr.w rs
+
+ * rotxr.l rs * stc ccr,@(disp:24,rd)
+ bpt * stc ccr,@-rd
+ rte * stc ccr,@abs:16
+ rts * stc ccr,@abs:24
+ shal.b rs sub.b rs,rd
+ * shal.w rs sub.w rs,rd
+ * shal.l rs * sub.w #imm,rd
+ shar.b rs * sub.l rs,rd
+ * shar.w rs * sub.l #imm,rd
+ * shar.l rs subs #imm,rd
+ shll.b rs subx #imm,rd
+ * shll.w rs subx rs,rd
+ * shll.l rs * trapa #imm
+ shlr.b rs xor #imm,rd
+ * shlr.w rs xor rs,rd
+ * shlr.l rs * xor.w #imm,rd
+ sleep * xor.w rs,rd
+ stc ccr,rd * xor.l #imm,rd
+ * stc ccr,@rs * xor.l rs,rd
+ * stc ccr,@(disp:16,rd) xorc #imm,ccr
+
+ Four H8/300 instructions (`add', `cmp', `mov', `sub') are defined
+with variants using the suffixes `.b', `.w', and `.l' to specify the
+size of a memory operand. `as' supports these suffixes, but does not
+require them; since one of the operands is always a register, `as' can
+deduce the correct size.
+
+ For example, since `r0' refers to a 16-bit register,
+ mov r0,@foo
+is equivalent to
+ mov.w r0,@foo
+
+ If you use the size suffixes, `as' issues a warning when the suffix
+and the register size do not match.
+
+
+File: as.info, Node: HPPA-Dependent, Next: ESA/390-Dependent, Prev: H8/300-Dependent, Up: Machine Dependencies
+
+9.11 HPPA Dependent Features
+============================
+
+* Menu:
+
+* HPPA Notes:: Notes
+* HPPA Options:: Options
+* HPPA Syntax:: Syntax
+* HPPA Floating Point:: Floating Point
+* HPPA Directives:: HPPA Machine Directives
+* HPPA Opcodes:: Opcodes
+
+
+File: as.info, Node: HPPA Notes, Next: HPPA Options, Up: HPPA-Dependent
+
+9.11.1 Notes
+------------
+
+As a back end for GNU CC `as' has been throughly tested and should work
+extremely well. We have tested it only minimally on hand written
+assembly code and no one has tested it much on the assembly output from
+the HP compilers.
+
+ The format of the debugging sections has changed since the original
+`as' port (version 1.3X) was released; therefore, you must rebuild all
+HPPA objects and libraries with the new assembler so that you can debug
+the final executable.
+
+ The HPPA `as' port generates a small subset of the relocations
+available in the SOM and ELF object file formats. Additional relocation
+support will be added as it becomes necessary.
+
+
+File: as.info, Node: HPPA Options, Next: HPPA Syntax, Prev: HPPA Notes, Up: HPPA-Dependent
+
+9.11.2 Options
+--------------
+
+`as' has no machine-dependent command-line options for the HPPA.
+
+
+File: as.info, Node: HPPA Syntax, Next: HPPA Floating Point, Prev: HPPA Options, Up: HPPA-Dependent
+
+9.11.3 Syntax
+-------------
+
+The assembler syntax closely follows the HPPA instruction set reference
+manual; assembler directives and general syntax closely follow the HPPA
+assembly language reference manual, with a few noteworthy differences.
+
+ First, a colon may immediately follow a label definition. This is
+simply for compatibility with how most assembly language programmers
+write code.
+
+ Some obscure expression parsing problems may affect hand written
+code which uses the `spop' instructions, or code which makes significant
+use of the `!' line separator.
+
+ `as' is much less forgiving about missing arguments and other
+similar oversights than the HP assembler. `as' notifies you of missing
+arguments as syntax errors; this is regarded as a feature, not a bug.
+
+ Finally, `as' allows you to use an external symbol without
+explicitly importing the symbol. _Warning:_ in the future this will be
+an error for HPPA targets.
+
+ Special characters for HPPA targets include:
+
+ `;' is the line comment character.
+
+ `!' can be used instead of a newline to separate statements.
+
+ Since `$' has no special meaning, you may use it in symbol names.
+
+
+File: as.info, Node: HPPA Floating Point, Next: HPPA Directives, Prev: HPPA Syntax, Up: HPPA-Dependent
+
+9.11.4 Floating Point
+---------------------
+
+The HPPA family uses IEEE floating-point numbers.
+
+
+File: as.info, Node: HPPA Directives, Next: HPPA Opcodes, Prev: HPPA Floating Point, Up: HPPA-Dependent
+
+9.11.5 HPPA Assembler Directives
+--------------------------------
+
+`as' for the HPPA supports many additional directives for compatibility
+with the native assembler. This section describes them only briefly.
+For detailed information on HPPA-specific assembler directives, see
+`HP9000 Series 800 Assembly Language Reference Manual' (HP 92432-90001).
+
+ `as' does _not_ support the following assembler directives described
+in the HP manual:
+
+ .endm .liston
+ .enter .locct
+ .leave .macro
+ .listoff
+
+ Beyond those implemented for compatibility, `as' supports one
+additional assembler directive for the HPPA: `.param'. It conveys
+register argument locations for static functions. Its syntax closely
+follows the `.export' directive.
+
+ These are the additional directives in `as' for the HPPA:
+
+`.block N'
+`.blockz N'
+ Reserve N bytes of storage, and initialize them to zero.
+
+`.call'
+ Mark the beginning of a procedure call. Only the special case
+ with _no arguments_ is allowed.
+
+`.callinfo [ PARAM=VALUE, ... ] [ FLAG, ... ]'
+ Specify a number of parameters and flags that define the
+ environment for a procedure.
+
+ PARAM may be any of `frame' (frame size), `entry_gr' (end of
+ general register range), `entry_fr' (end of float register range),
+ `entry_sr' (end of space register range).
+
+ The values for FLAG are `calls' or `caller' (proc has
+ subroutines), `no_calls' (proc does not call subroutines),
+ `save_rp' (preserve return pointer), `save_sp' (proc preserves
+ stack pointer), `no_unwind' (do not unwind this proc), `hpux_int'
+ (proc is interrupt routine).
+
+`.code'
+ Assemble into the standard section called `$TEXT$', subsection
+ `$CODE$'.
+
+`.copyright "STRING"'
+ In the SOM object format, insert STRING into the object code,
+ marked as a copyright string.
+
+`.copyright "STRING"'
+ In the ELF object format, insert STRING into the object code,
+ marked as a version string.
+
+`.enter'
+ Not yet supported; the assembler rejects programs containing this
+ directive.
+
+`.entry'
+ Mark the beginning of a procedure.
+
+`.exit'
+ Mark the end of a procedure.
+
+`.export NAME [ ,TYP ] [ ,PARAM=R ]'
+ Make a procedure NAME available to callers. TYP, if present, must
+ be one of `absolute', `code' (ELF only, not SOM), `data', `entry',
+ `data', `entry', `millicode', `plabel', `pri_prog', or `sec_prog'.
+
+ PARAM, if present, provides either relocation information for the
+ procedure arguments and result, or a privilege level. PARAM may be
+ `argwN' (where N ranges from `0' to `3', and indicates one of four
+ one-word arguments); `rtnval' (the procedure's result); or
+ `priv_lev' (privilege level). For arguments or the result, R
+ specifies how to relocate, and must be one of `no' (not
+ relocatable), `gr' (argument is in general register), `fr' (in
+ floating point register), or `fu' (upper half of float register).
+ For `priv_lev', R is an integer.
+
+`.half N'
+ Define a two-byte integer constant N; synonym for the portable
+ `as' directive `.short'.
+
+`.import NAME [ ,TYP ]'
+ Converse of `.export'; make a procedure available to call. The
+ arguments use the same conventions as the first two arguments for
+ `.export'.
+
+`.label NAME'
+ Define NAME as a label for the current assembly location.
+
+`.leave'
+ Not yet supported; the assembler rejects programs containing this
+ directive.
+
+`.origin LC'
+ Advance location counter to LC. Synonym for the `as' portable
+ directive `.org'.
+
+`.param NAME [ ,TYP ] [ ,PARAM=R ]'
+ Similar to `.export', but used for static procedures.
+
+`.proc'
+ Use preceding the first statement of a procedure.
+
+`.procend'
+ Use following the last statement of a procedure.
+
+`LABEL .reg EXPR'
+ Synonym for `.equ'; define LABEL with the absolute expression EXPR
+ as its value.
+
+`.space SECNAME [ ,PARAMS ]'
+ Switch to section SECNAME, creating a new section by that name if
+ necessary. You may only use PARAMS when creating a new section,
+ not when switching to an existing one. SECNAME may identify a
+ section by number rather than by name.
+
+ If specified, the list PARAMS declares attributes of the section,
+ identified by keywords. The keywords recognized are `spnum=EXP'
+ (identify this section by the number EXP, an absolute expression),
+ `sort=EXP' (order sections according to this sort key when linking;
+ EXP is an absolute expression), `unloadable' (section contains no
+ loadable data), `notdefined' (this section defined elsewhere), and
+ `private' (data in this section not available to other programs).
+
+`.spnum SECNAM'
+ Allocate four bytes of storage, and initialize them with the
+ section number of the section named SECNAM. (You can define the
+ section number with the HPPA `.space' directive.)
+
+`.string "STR"'
+ Copy the characters in the string STR to the object file. *Note
+ Strings: Strings, for information on escape sequences you can use
+ in `as' strings.
+
+ _Warning!_ The HPPA version of `.string' differs from the usual
+ `as' definition: it does _not_ write a zero byte after copying STR.
+
+`.stringz "STR"'
+ Like `.string', but appends a zero byte after copying STR to object
+ file.
+
+`.subspa NAME [ ,PARAMS ]'
+`.nsubspa NAME [ ,PARAMS ]'
+ Similar to `.space', but selects a subsection NAME within the
+ current section. You may only specify PARAMS when you create a
+ subsection (in the first instance of `.subspa' for this NAME).
+
+ If specified, the list PARAMS declares attributes of the
+ subsection, identified by keywords. The keywords recognized are
+ `quad=EXPR' ("quadrant" for this subsection), `align=EXPR'
+ (alignment for beginning of this subsection; a power of two),
+ `access=EXPR' (value for "access rights" field), `sort=EXPR'
+ (sorting order for this subspace in link), `code_only' (subsection
+ contains only code), `unloadable' (subsection cannot be loaded
+ into memory), `comdat' (subsection is comdat), `common'
+ (subsection is common block), `dup_comm' (subsection may have
+ duplicate names), or `zero' (subsection is all zeros, do not write
+ in object file).
+
+ `.nsubspa' always creates a new subspace with the given name, even
+ if one with the same name already exists.
+
+ `comdat', `common' and `dup_comm' can be used to implement various
+ flavors of one-only support when using the SOM linker. The SOM
+ linker only supports specific combinations of these flags. The
+ details are not documented. A brief description is provided here.
+
+ `comdat' provides a form of linkonce support. It is useful for
+ both code and data subspaces. A `comdat' subspace has a key symbol
+ marked by the `is_comdat' flag or `ST_COMDAT'. Only the first
+ subspace for any given key is selected. The key symbol becomes
+ universal in shared links. This is similar to the behavior of
+ `secondary_def' symbols.
+
+ `common' provides Fortran named common support. It is only useful
+ for data subspaces. Symbols with the flag `is_common' retain this
+ flag in shared links. Referencing a `is_common' symbol in a shared
+ library from outside the library doesn't work. Thus, `is_common'
+ symbols must be output whenever they are needed.
+
+ `common' and `dup_comm' together provide Cobol common support.
+ The subspaces in this case must all be the same length.
+ Otherwise, this support is similar to the Fortran common support.
+
+ `dup_comm' by itself provides a type of one-only support for code.
+ Only the first `dup_comm' subspace is selected. There is a rather
+ complex algorithm to compare subspaces. Code symbols marked with
+ the `dup_common' flag are hidden. This support was intended for
+ "C++ duplicate inlines".
+
+ A simplified technique is used to mark the flags of symbols based
+ on the flags of their subspace. A symbol with the scope
+ SS_UNIVERSAL and type ST_ENTRY, ST_CODE or ST_DATA is marked with
+ the corresponding settings of `comdat', `common' and `dup_comm'
+ from the subspace, respectively. This avoids having to introduce
+ additional directives to mark these symbols. The HP assembler
+ sets `is_common' from `common'. However, it doesn't set the
+ `dup_common' from `dup_comm'. It doesn't have `comdat' support.
+
+`.version "STR"'
+ Write STR as version identifier in object code.
+
+
+File: as.info, Node: HPPA Opcodes, Prev: HPPA Directives, Up: HPPA-Dependent
+
+9.11.6 Opcodes
+--------------
+
+For detailed information on the HPPA machine instruction set, see
+`PA-RISC Architecture and Instruction Set Reference Manual' (HP
+09740-90039).
+
+
+File: as.info, Node: ESA/390-Dependent, Next: i386-Dependent, Prev: HPPA-Dependent, Up: Machine Dependencies
+
+9.12 ESA/390 Dependent Features
+===============================
+
+* Menu:
+
+* ESA/390 Notes:: Notes
+* ESA/390 Options:: Options
+* ESA/390 Syntax:: Syntax
+* ESA/390 Floating Point:: Floating Point
+* ESA/390 Directives:: ESA/390 Machine Directives
+* ESA/390 Opcodes:: Opcodes
+
+
+File: as.info, Node: ESA/390 Notes, Next: ESA/390 Options, Up: ESA/390-Dependent
+
+9.12.1 Notes
+------------
+
+The ESA/390 `as' port is currently intended to be a back-end for the
+GNU CC compiler. It is not HLASM compatible, although it does support
+a subset of some of the HLASM directives. The only supported binary
+file format is ELF; none of the usual MVS/VM/OE/USS object file
+formats, such as ESD or XSD, are supported.
+
+ When used with the GNU CC compiler, the ESA/390 `as' will produce
+correct, fully relocated, functional binaries, and has been used to
+compile and execute large projects. However, many aspects should still
+be considered experimental; these include shared library support,
+dynamically loadable objects, and any relocation other than the 31-bit
+relocation.
+
+
+File: as.info, Node: ESA/390 Options, Next: ESA/390 Syntax, Prev: ESA/390 Notes, Up: ESA/390-Dependent
+
+9.12.2 Options
+--------------
+
+`as' has no machine-dependent command-line options for the ESA/390.
+
+
+File: as.info, Node: ESA/390 Syntax, Next: ESA/390 Floating Point, Prev: ESA/390 Options, Up: ESA/390-Dependent
+
+9.12.3 Syntax
+-------------
+
+The opcode/operand syntax follows the ESA/390 Principles of Operation
+manual; assembler directives and general syntax are loosely based on the
+prevailing AT&T/SVR4/ELF/Solaris style notation. HLASM-style directives
+are _not_ supported for the most part, with the exception of those
+described herein.
+
+ A leading dot in front of directives is optional, and the case of
+directives is ignored; thus for example, .using and USING have the same
+effect.
+
+ A colon may immediately follow a label definition. This is simply
+for compatibility with how most assembly language programmers write
+code.
+
+ `#' is the line comment character.
+
+ `;' can be used instead of a newline to separate statements.
+
+ Since `$' has no special meaning, you may use it in symbol names.
+
+ Registers can be given the symbolic names r0..r15, fp0, fp2, fp4,
+fp6. By using thesse symbolic names, `as' can detect simple syntax
+errors. The name rarg or r.arg is a synonym for r11, rtca or r.tca for
+r12, sp, r.sp, dsa r.dsa for r13, lr or r.lr for r14, rbase or r.base
+for r3 and rpgt or r.pgt for r4.
+
+ `*' is the current location counter. Unlike `.' it is always
+relative to the last USING directive. Note that this means that
+expressions cannot use multiplication, as any occurrence of `*' will be
+interpreted as a location counter.
+
+ All labels are relative to the last USING. Thus, branches to a label
+always imply the use of base+displacement.
+
+ Many of the usual forms of address constants / address literals are
+supported. Thus,
+ .using *,r3
+ L r15,=A(some_routine)
+ LM r6,r7,=V(some_longlong_extern)
+ A r1,=F'12'
+ AH r0,=H'42'
+ ME r6,=E'3.1416'
+ MD r6,=D'3.14159265358979'
+ O r6,=XL4'cacad0d0'
+ .ltorg
+ should all behave as expected: that is, an entry in the literal pool
+will be created (or reused if it already exists), and the instruction
+operands will be the displacement into the literal pool using the
+current base register (as last declared with the `.using' directive).
+
+
+File: as.info, Node: ESA/390 Floating Point, Next: ESA/390 Directives, Prev: ESA/390 Syntax, Up: ESA/390-Dependent
+
+9.12.4 Floating Point
+---------------------
+
+The assembler generates only IEEE floating-point numbers. The older
+floating point formats are not supported.
+
+
+File: as.info, Node: ESA/390 Directives, Next: ESA/390 Opcodes, Prev: ESA/390 Floating Point, Up: ESA/390-Dependent
+
+9.12.5 ESA/390 Assembler Directives
+-----------------------------------
+
+`as' for the ESA/390 supports all of the standard ELF/SVR4 assembler
+directives that are documented in the main part of this documentation.
+Several additional directives are supported in order to implement the
+ESA/390 addressing model. The most important of these are `.using' and
+`.ltorg'
+
+ These are the additional directives in `as' for the ESA/390:
+
+`.dc'
+ A small subset of the usual DC directive is supported.
+
+`.drop REGNO'
+ Stop using REGNO as the base register. The REGNO must have been
+ previously declared with a `.using' directive in the same section
+ as the current section.
+
+`.ebcdic STRING'
+ Emit the EBCDIC equivalent of the indicated string. The emitted
+ string will be null terminated. Note that the directives
+ `.string' etc. emit ascii strings by default.
+
+`EQU'
+ The standard HLASM-style EQU directive is not supported; however,
+ the standard `as' directive .equ can be used to the same effect.
+
+`.ltorg'
+ Dump the literal pool accumulated so far; begin a new literal pool.
+ The literal pool will be written in the current section; in order
+ to generate correct assembly, a `.using' must have been previously
+ specified in the same section.
+
+`.using EXPR,REGNO'
+ Use REGNO as the base register for all subsequent RX, RS, and SS
+ form instructions. The EXPR will be evaluated to obtain the base
+ address; usually, EXPR will merely be `*'.
+
+ This assembler allows two `.using' directives to be simultaneously
+ outstanding, one in the `.text' section, and one in another section
+ (typically, the `.data' section). This feature allows dynamically
+ loaded objects to be implemented in a relatively straightforward
+ way. A `.using' directive must always be specified in the `.text'
+ section; this will specify the base register that will be used for
+ branches in the `.text' section. A second `.using' may be
+ specified in another section; this will specify the base register
+ that is used for non-label address literals. When a second
+ `.using' is specified, then the subsequent `.ltorg' must be put in
+ the same section; otherwise an error will result.
+
+ Thus, for example, the following code uses `r3' to address branch
+ targets and `r4' to address the literal pool, which has been
+ written to the `.data' section. The is, the constants
+ `=A(some_routine)', `=H'42'' and `=E'3.1416'' will all appear in
+ the `.data' section.
+
+ .data
+ .using LITPOOL,r4
+ .text
+ BASR r3,0
+ .using *,r3
+ B START
+ .long LITPOOL
+ START:
+ L r4,4(,r3)
+ L r15,=A(some_routine)
+ LTR r15,r15
+ BNE LABEL
+ AH r0,=H'42'
+ LABEL:
+ ME r6,=E'3.1416'
+ .data
+ LITPOOL:
+ .ltorg
+
+ Note that this dual-`.using' directive semantics extends and is
+ not compatible with HLASM semantics. Note that this assembler
+ directive does not support the full range of HLASM semantics.
+
+
+
+File: as.info, Node: ESA/390 Opcodes, Prev: ESA/390 Directives, Up: ESA/390-Dependent
+
+9.12.6 Opcodes
+--------------
+
+For detailed information on the ESA/390 machine instruction set, see
+`ESA/390 Principles of Operation' (IBM Publication Number DZ9AR004).
+
+
+File: as.info, Node: i386-Dependent, Next: i860-Dependent, Prev: ESA/390-Dependent, Up: Machine Dependencies
+
+9.13 80386 Dependent Features
+=============================
+
+ The i386 version `as' supports both the original Intel 386
+architecture in both 16 and 32-bit mode as well as AMD x86-64
+architecture extending the Intel architecture to 64-bits.
+
+* Menu:
+
+* i386-Options:: Options
+* i386-Directives:: X86 specific directives
+* i386-Syntax:: AT&T Syntax versus Intel Syntax
+* i386-Mnemonics:: Instruction Naming
+* i386-Regs:: Register Naming
+* i386-Prefixes:: Instruction Prefixes
+* i386-Memory:: Memory References
+* i386-Jumps:: Handling of Jump Instructions
+* i386-Float:: Floating Point
+* i386-SIMD:: Intel's MMX and AMD's 3DNow! SIMD Operations
+* i386-16bit:: Writing 16-bit Code
+* i386-Arch:: Specifying an x86 CPU architecture
+* i386-Bugs:: AT&T Syntax bugs
+* i386-Notes:: Notes
+
+
+File: as.info, Node: i386-Options, Next: i386-Directives, Up: i386-Dependent
+
+9.13.1 Options
+--------------
+
+The i386 version of `as' has a few machine dependent options:
+
+`--32 | --64'
+ Select the word size, either 32 bits or 64 bits. Selecting 32-bit
+ implies Intel i386 architecture, while 64-bit implies AMD x86-64
+ architecture.
+
+ These options are only available with the ELF object file format,
+ and require that the necessary BFD support has been included (on a
+ 32-bit platform you have to add -enable-64-bit-bfd to configure
+ enable 64-bit usage and use x86-64 as target platform).
+
+`-n'
+ By default, x86 GAS replaces multiple nop instructions used for
+ alignment within code sections with multi-byte nop instructions
+ such as leal 0(%esi,1),%esi. This switch disables the
+ optimization.
+
+`--divide'
+ On SVR4-derived platforms, the character `/' is treated as a
+ comment character, which means that it cannot be used in
+ expressions. The `--divide' option turns `/' into a normal
+ character. This does not disable `/' at the beginning of a line
+ starting a comment, or affect using `#' for starting a comment.
+
+`-march=CPU[+EXTENSION...]'
+ This option specifies the target processor. The assembler will
+ issue an error message if an attempt is made to assemble an
+ instruction which will not execute on the target processor. The
+ following processor names are recognized: `i8086', `i186', `i286',
+ `i386', `i486', `i586', `i686', `pentium', `pentiumpro',
+ `pentiumii', `pentiumiii', `pentium4', `prescott', `nocona',
+ `core', `core2', `corei7', `l1om', `k6', `k6_2', `athlon',
+ `opteron', `k8', `amdfam10', `generic32' and `generic64'.
+
+ In addition to the basic instruction set, the assembler can be
+ told to accept various extension mnemonics. For example,
+ `-march=i686+sse4+vmx' extends I686 with SSE4 and VMX. The
+ following extensions are currently supported: `8087', `287', `387',
+ `no87', `mmx', `nommx', `sse', `sse2', `sse3', `ssse3', `sse4.1',
+ `sse4.2', `sse4', `nosse', `avx', `noavx', `vmx', `smx', `xsave',
+ `aes', `pclmul', `fma', `movbe', `ept', `clflush', `syscall',
+ `rdtscp', `3dnow', `3dnowa', `sse4a', `sse5', `svme', `abm' and
+ `padlock'. Note that rather than extending a basic instruction
+ set, the extension mnemonics starting with `no' revoke the
+ respective functionality.
+
+ When the `.arch' directive is used with `-march', the `.arch'
+ directive will take precedent.
+
+`-mtune=CPU'
+ This option specifies a processor to optimize for. When used in
+ conjunction with the `-march' option, only instructions of the
+ processor specified by the `-march' option will be generated.
+
+ Valid CPU values are identical to the processor list of
+ `-march=CPU'.
+
+`-msse2avx'
+ This option specifies that the assembler should encode SSE
+ instructions with VEX prefix.
+
+`-msse-check=NONE'
+
+`-msse-check=WARNING'
+
+`-msse-check=ERROR'
+ These options control if the assembler should check SSE
+ intructions. `-msse-check=NONE' will make the assembler not to
+ check SSE instructions, which is the default.
+ `-msse-check=WARNING' will make the assembler issue a warning for
+ any SSE intruction. `-msse-check=ERROR' will make the assembler
+ issue an error for any SSE intruction.
+
+`-mmnemonic=ATT'
+
+`-mmnemonic=INTEL'
+ This option specifies instruction mnemonic for matching
+ instructions. The `.att_mnemonic' and `.intel_mnemonic'
+ directives will take precedent.
+
+`-msyntax=ATT'
+
+`-msyntax=INTEL'
+ This option specifies instruction syntax when processing
+ instructions. The `.att_syntax' and `.intel_syntax' directives
+ will take precedent.
+
+`-mnaked-reg'
+ This opetion specifies that registers don't require a `%' prefix.
+ The `.att_syntax' and `.intel_syntax' directives will take
+ precedent.
+
+
+
+File: as.info, Node: i386-Directives, Next: i386-Syntax, Prev: i386-Options, Up: i386-Dependent
+
+9.13.2 x86 specific Directives
+------------------------------
+
+`.lcomm SYMBOL , LENGTH[, ALIGNMENT]'
+ Reserve LENGTH (an absolute expression) bytes for a local common
+ denoted by SYMBOL. The section and value of SYMBOL are those of
+ the new local common. The addresses are allocated in the bss
+ section, so that at run-time the bytes start off zeroed. Since
+ SYMBOL is not declared global, it is normally not visible to `ld'.
+ The optional third parameter, ALIGNMENT, specifies the desired
+ alignment of the symbol in the bss section.
+
+ This directive is only available for COFF based x86 targets.
+
+
+
+File: as.info, Node: i386-Syntax, Next: i386-Mnemonics, Prev: i386-Directives, Up: i386-Dependent
+
+9.13.3 AT&T Syntax versus Intel Syntax
+--------------------------------------
+
+`as' now supports assembly using Intel assembler syntax.
+`.intel_syntax' selects Intel mode, and `.att_syntax' switches back to
+the usual AT&T mode for compatibility with the output of `gcc'. Either
+of these directives may have an optional argument, `prefix', or
+`noprefix' specifying whether registers require a `%' prefix. AT&T
+System V/386 assembler syntax is quite different from Intel syntax. We
+mention these differences because almost all 80386 documents use Intel
+syntax. Notable differences between the two syntaxes are:
+
+ * AT&T immediate operands are preceded by `$'; Intel immediate
+ operands are undelimited (Intel `push 4' is AT&T `pushl $4').
+ AT&T register operands are preceded by `%'; Intel register operands
+ are undelimited. AT&T absolute (as opposed to PC relative)
+ jump/call operands are prefixed by `*'; they are undelimited in
+ Intel syntax.
+
+ * AT&T and Intel syntax use the opposite order for source and
+ destination operands. Intel `add eax, 4' is `addl $4, %eax'. The
+ `source, dest' convention is maintained for compatibility with
+ previous Unix assemblers. Note that `bound', `invlpga', and
+ instructions with 2 immediate operands, such as the `enter'
+ instruction, do _not_ have reversed order. *Note i386-Bugs::.
+
+ * In AT&T syntax the size of memory operands is determined from the
+ last character of the instruction mnemonic. Mnemonic suffixes of
+ `b', `w', `l' and `q' specify byte (8-bit), word (16-bit), long
+ (32-bit) and quadruple word (64-bit) memory references. Intel
+ syntax accomplishes this by prefixing memory operands (_not_ the
+ instruction mnemonics) with `byte ptr', `word ptr', `dword ptr'
+ and `qword ptr'. Thus, Intel `mov al, byte ptr FOO' is `movb FOO,
+ %al' in AT&T syntax.
+
+ * Immediate form long jumps and calls are `lcall/ljmp $SECTION,
+ $OFFSET' in AT&T syntax; the Intel syntax is `call/jmp far
+ SECTION:OFFSET'. Also, the far return instruction is `lret
+ $STACK-ADJUST' in AT&T syntax; Intel syntax is `ret far
+ STACK-ADJUST'.
+
+ * The AT&T assembler does not provide support for multiple section
+ programs. Unix style systems expect all programs to be single
+ sections.
+
+
+File: as.info, Node: i386-Mnemonics, Next: i386-Regs, Prev: i386-Syntax, Up: i386-Dependent
+
+9.13.4 Instruction Naming
+-------------------------
+
+Instruction mnemonics are suffixed with one character modifiers which
+specify the size of operands. The letters `b', `w', `l' and `q'
+specify byte, word, long and quadruple word operands. If no suffix is
+specified by an instruction then `as' tries to fill in the missing
+suffix based on the destination register operand (the last one by
+convention). Thus, `mov %ax, %bx' is equivalent to `movw %ax, %bx';
+also, `mov $1, %bx' is equivalent to `movw $1, bx'. Note that this is
+incompatible with the AT&T Unix assembler which assumes that a missing
+mnemonic suffix implies long operand size. (This incompatibility does
+not affect compiler output since compilers always explicitly specify
+the mnemonic suffix.)
+
+ Almost all instructions have the same names in AT&T and Intel format.
+There are a few exceptions. The sign extend and zero extend
+instructions need two sizes to specify them. They need a size to
+sign/zero extend _from_ and a size to zero extend _to_. This is
+accomplished by using two instruction mnemonic suffixes in AT&T syntax.
+Base names for sign extend and zero extend are `movs...' and `movz...'
+in AT&T syntax (`movsx' and `movzx' in Intel syntax). The instruction
+mnemonic suffixes are tacked on to this base name, the _from_ suffix
+before the _to_ suffix. Thus, `movsbl %al, %edx' is AT&T syntax for
+"move sign extend _from_ %al _to_ %edx." Possible suffixes, thus, are
+`bl' (from byte to long), `bw' (from byte to word), `wl' (from word to
+long), `bq' (from byte to quadruple word), `wq' (from word to quadruple
+word), and `lq' (from long to quadruple word).
+
+ Different encoding options can be specified via optional mnemonic
+suffix. `.s' suffix swaps 2 register operands in encoding when moving
+from one register to another.
+
+ The Intel-syntax conversion instructions
+
+ * `cbw' -- sign-extend byte in `%al' to word in `%ax',
+
+ * `cwde' -- sign-extend word in `%ax' to long in `%eax',
+
+ * `cwd' -- sign-extend word in `%ax' to long in `%dx:%ax',
+
+ * `cdq' -- sign-extend dword in `%eax' to quad in `%edx:%eax',
+
+ * `cdqe' -- sign-extend dword in `%eax' to quad in `%rax' (x86-64
+ only),
+
+ * `cqo' -- sign-extend quad in `%rax' to octuple in `%rdx:%rax'
+ (x86-64 only),
+
+are called `cbtw', `cwtl', `cwtd', `cltd', `cltq', and `cqto' in AT&T
+naming. `as' accepts either naming for these instructions.
+
+ Far call/jump instructions are `lcall' and `ljmp' in AT&T syntax,
+but are `call far' and `jump far' in Intel convention.
+
+9.13.5 AT&T Mnemonic versus Intel Mnemonic
+------------------------------------------
+
+`as' supports assembly using Intel mnemonic. `.intel_mnemonic' selects
+Intel mnemonic with Intel syntax, and `.att_mnemonic' switches back to
+the usual AT&T mnemonic with AT&T syntax for compatibility with the
+output of `gcc'. Several x87 instructions, `fadd', `fdiv', `fdivp',
+`fdivr', `fdivrp', `fmul', `fsub', `fsubp', `fsubr' and `fsubrp', are
+implemented in AT&T System V/386 assembler with different mnemonics
+from those in Intel IA32 specification. `gcc' generates those
+instructions with AT&T mnemonic.
+
+
+File: as.info, Node: i386-Regs, Next: i386-Prefixes, Prev: i386-Mnemonics, Up: i386-Dependent
+
+9.13.6 Register Naming
+----------------------
+
+Register operands are always prefixed with `%'. The 80386 registers
+consist of
+
+ * the 8 32-bit registers `%eax' (the accumulator), `%ebx', `%ecx',
+ `%edx', `%edi', `%esi', `%ebp' (the frame pointer), and `%esp'
+ (the stack pointer).
+
+ * the 8 16-bit low-ends of these: `%ax', `%bx', `%cx', `%dx', `%di',
+ `%si', `%bp', and `%sp'.
+
+ * the 8 8-bit registers: `%ah', `%al', `%bh', `%bl', `%ch', `%cl',
+ `%dh', and `%dl' (These are the high-bytes and low-bytes of `%ax',
+ `%bx', `%cx', and `%dx')
+
+ * the 6 section registers `%cs' (code section), `%ds' (data
+ section), `%ss' (stack section), `%es', `%fs', and `%gs'.
+
+ * the 3 processor control registers `%cr0', `%cr2', and `%cr3'.
+
+ * the 6 debug registers `%db0', `%db1', `%db2', `%db3', `%db6', and
+ `%db7'.
+
+ * the 2 test registers `%tr6' and `%tr7'.
+
+ * the 8 floating point register stack `%st' or equivalently
+ `%st(0)', `%st(1)', `%st(2)', `%st(3)', `%st(4)', `%st(5)',
+ `%st(6)', and `%st(7)'. These registers are overloaded by 8 MMX
+ registers `%mm0', `%mm1', `%mm2', `%mm3', `%mm4', `%mm5', `%mm6'
+ and `%mm7'.
+
+ * the 8 SSE registers registers `%xmm0', `%xmm1', `%xmm2', `%xmm3',
+ `%xmm4', `%xmm5', `%xmm6' and `%xmm7'.
+
+ The AMD x86-64 architecture extends the register set by:
+
+ * enhancing the 8 32-bit registers to 64-bit: `%rax' (the
+ accumulator), `%rbx', `%rcx', `%rdx', `%rdi', `%rsi', `%rbp' (the
+ frame pointer), `%rsp' (the stack pointer)
+
+ * the 8 extended registers `%r8'-`%r15'.
+
+ * the 8 32-bit low ends of the extended registers: `%r8d'-`%r15d'
+
+ * the 8 16-bit low ends of the extended registers: `%r8w'-`%r15w'
+
+ * the 8 8-bit low ends of the extended registers: `%r8b'-`%r15b'
+
+ * the 4 8-bit registers: `%sil', `%dil', `%bpl', `%spl'.
+
+ * the 8 debug registers: `%db8'-`%db15'.
+
+ * the 8 SSE registers: `%xmm8'-`%xmm15'.
+
+
+File: as.info, Node: i386-Prefixes, Next: i386-Memory, Prev: i386-Regs, Up: i386-Dependent
+
+9.13.7 Instruction Prefixes
+---------------------------
+
+Instruction prefixes are used to modify the following instruction. They
+are used to repeat string instructions, to provide section overrides, to
+perform bus lock operations, and to change operand and address sizes.
+(Most instructions that normally operate on 32-bit operands will use
+16-bit operands if the instruction has an "operand size" prefix.)
+Instruction prefixes are best written on the same line as the
+instruction they act upon. For example, the `scas' (scan string)
+instruction is repeated with:
+
+ repne scas %es:(%edi),%al
+
+ You may also place prefixes on the lines immediately preceding the
+instruction, but this circumvents checks that `as' does with prefixes,
+and will not work with all prefixes.
+
+ Here is a list of instruction prefixes:
+
+ * Section override prefixes `cs', `ds', `ss', `es', `fs', `gs'.
+ These are automatically added by specifying using the
+ SECTION:MEMORY-OPERAND form for memory references.
+
+ * Operand/Address size prefixes `data16' and `addr16' change 32-bit
+ operands/addresses into 16-bit operands/addresses, while `data32'
+ and `addr32' change 16-bit ones (in a `.code16' section) into
+ 32-bit operands/addresses. These prefixes _must_ appear on the
+ same line of code as the instruction they modify. For example, in
+ a 16-bit `.code16' section, you might write:
+
+ addr32 jmpl *(%ebx)
+
+ * The bus lock prefix `lock' inhibits interrupts during execution of
+ the instruction it precedes. (This is only valid with certain
+ instructions; see a 80386 manual for details).
+
+ * The wait for coprocessor prefix `wait' waits for the coprocessor to
+ complete the current instruction. This should never be needed for
+ the 80386/80387 combination.
+
+ * The `rep', `repe', and `repne' prefixes are added to string
+ instructions to make them repeat `%ecx' times (`%cx' times if the
+ current address size is 16-bits).
+
+ * The `rex' family of prefixes is used by x86-64 to encode
+ extensions to i386 instruction set. The `rex' prefix has four
+ bits -- an operand size overwrite (`64') used to change operand
+ size from 32-bit to 64-bit and X, Y and Z extensions bits used to
+ extend the register set.
+
+ You may write the `rex' prefixes directly. The `rex64xyz'
+ instruction emits `rex' prefix with all the bits set. By omitting
+ the `64', `x', `y' or `z' you may write other prefixes as well.
+ Normally, there is no need to write the prefixes explicitly, since
+ gas will automatically generate them based on the instruction
+ operands.
+
+
+File: as.info, Node: i386-Memory, Next: i386-Jumps, Prev: i386-Prefixes, Up: i386-Dependent
+
+9.13.8 Memory References
+------------------------
+
+An Intel syntax indirect memory reference of the form
+
+ SECTION:[BASE + INDEX*SCALE + DISP]
+
+is translated into the AT&T syntax
+
+ SECTION:DISP(BASE, INDEX, SCALE)
+
+where BASE and INDEX are the optional 32-bit base and index registers,
+DISP is the optional displacement, and SCALE, taking the values 1, 2,
+4, and 8, multiplies INDEX to calculate the address of the operand. If
+no SCALE is specified, SCALE is taken to be 1. SECTION specifies the
+optional section register for the memory operand, and may override the
+default section register (see a 80386 manual for section register
+defaults). Note that section overrides in AT&T syntax _must_ be
+preceded by a `%'. If you specify a section override which coincides
+with the default section register, `as' does _not_ output any section
+register override prefixes to assemble the given instruction. Thus,
+section overrides can be specified to emphasize which section register
+is used for a given memory operand.
+
+ Here are some examples of Intel and AT&T style memory references:
+
+AT&T: `-4(%ebp)', Intel: `[ebp - 4]'
+ BASE is `%ebp'; DISP is `-4'. SECTION is missing, and the default
+ section is used (`%ss' for addressing with `%ebp' as the base
+ register). INDEX, SCALE are both missing.
+
+AT&T: `foo(,%eax,4)', Intel: `[foo + eax*4]'
+ INDEX is `%eax' (scaled by a SCALE 4); DISP is `foo'. All other
+ fields are missing. The section register here defaults to `%ds'.
+
+AT&T: `foo(,1)'; Intel `[foo]'
+ This uses the value pointed to by `foo' as a memory operand. Note
+ that BASE and INDEX are both missing, but there is only _one_ `,'.
+ This is a syntactic exception.
+
+AT&T: `%gs:foo'; Intel `gs:foo'
+ This selects the contents of the variable `foo' with section
+ register SECTION being `%gs'.
+
+ Absolute (as opposed to PC relative) call and jump operands must be
+prefixed with `*'. If no `*' is specified, `as' always chooses PC
+relative addressing for jump/call labels.
+
+ Any instruction that has a memory operand, but no register operand,
+_must_ specify its size (byte, word, long, or quadruple) with an
+instruction mnemonic suffix (`b', `w', `l' or `q', respectively).
+
+ The x86-64 architecture adds an RIP (instruction pointer relative)
+addressing. This addressing mode is specified by using `rip' as a base
+register. Only constant offsets are valid. For example:
+
+AT&T: `1234(%rip)', Intel: `[rip + 1234]'
+ Points to the address 1234 bytes past the end of the current
+ instruction.
+
+AT&T: `symbol(%rip)', Intel: `[rip + symbol]'
+ Points to the `symbol' in RIP relative way, this is shorter than
+ the default absolute addressing.
+
+ Other addressing modes remain unchanged in x86-64 architecture,
+except registers used are 64-bit instead of 32-bit.
+
+
+File: as.info, Node: i386-Jumps, Next: i386-Float, Prev: i386-Memory, Up: i386-Dependent
+
+9.13.9 Handling of Jump Instructions
+------------------------------------
+
+Jump instructions are always optimized to use the smallest possible
+displacements. This is accomplished by using byte (8-bit) displacement
+jumps whenever the target is sufficiently close. If a byte displacement
+is insufficient a long displacement is used. We do not support word
+(16-bit) displacement jumps in 32-bit mode (i.e. prefixing the jump
+instruction with the `data16' instruction prefix), since the 80386
+insists upon masking `%eip' to 16 bits after the word displacement is
+added. (See also *note i386-Arch::)
+
+ Note that the `jcxz', `jecxz', `loop', `loopz', `loope', `loopnz'
+and `loopne' instructions only come in byte displacements, so that if
+you use these instructions (`gcc' does not use them) you may get an
+error message (and incorrect code). The AT&T 80386 assembler tries to
+get around this problem by expanding `jcxz foo' to
+
+ jcxz cx_zero
+ jmp cx_nonzero
+ cx_zero: jmp foo
+ cx_nonzero:
+
+
+File: as.info, Node: i386-Float, Next: i386-SIMD, Prev: i386-Jumps, Up: i386-Dependent
+
+9.13.10 Floating Point
+----------------------
+
+All 80387 floating point types except packed BCD are supported. (BCD
+support may be added without much difficulty). These data types are
+16-, 32-, and 64- bit integers, and single (32-bit), double (64-bit),
+and extended (80-bit) precision floating point. Each supported type
+has an instruction mnemonic suffix and a constructor associated with
+it. Instruction mnemonic suffixes specify the operand's data type.
+Constructors build these data types into memory.
+
+ * Floating point constructors are `.float' or `.single', `.double',
+ and `.tfloat' for 32-, 64-, and 80-bit formats. These correspond
+ to instruction mnemonic suffixes `s', `l', and `t'. `t' stands for
+ 80-bit (ten byte) real. The 80387 only supports this format via
+ the `fldt' (load 80-bit real to stack top) and `fstpt' (store
+ 80-bit real and pop stack) instructions.
+
+ * Integer constructors are `.word', `.long' or `.int', and `.quad'
+ for the 16-, 32-, and 64-bit integer formats. The corresponding
+ instruction mnemonic suffixes are `s' (single), `l' (long), and
+ `q' (quad). As with the 80-bit real format, the 64-bit `q' format
+ is only present in the `fildq' (load quad integer to stack top)
+ and `fistpq' (store quad integer and pop stack) instructions.
+
+ Register to register operations should not use instruction mnemonic
+suffixes. `fstl %st, %st(1)' will give a warning, and be assembled as
+if you wrote `fst %st, %st(1)', since all register to register
+operations use 80-bit floating point operands. (Contrast this with
+`fstl %st, mem', which converts `%st' from 80-bit to 64-bit floating
+point format, then stores the result in the 4 byte location `mem')
+
+
+File: as.info, Node: i386-SIMD, Next: i386-16bit, Prev: i386-Float, Up: i386-Dependent
+
+9.13.11 Intel's MMX and AMD's 3DNow! SIMD Operations
+----------------------------------------------------
+
+`as' supports Intel's MMX instruction set (SIMD instructions for
+integer data), available on Intel's Pentium MMX processors and Pentium
+II processors, AMD's K6 and K6-2 processors, Cyrix' M2 processor, and
+probably others. It also supports AMD's 3DNow! instruction set (SIMD
+instructions for 32-bit floating point data) available on AMD's K6-2
+processor and possibly others in the future.
+
+ Currently, `as' does not support Intel's floating point SIMD, Katmai
+(KNI).
+
+ The eight 64-bit MMX operands, also used by 3DNow!, are called
+`%mm0', `%mm1', ... `%mm7'. They contain eight 8-bit integers, four
+16-bit integers, two 32-bit integers, one 64-bit integer, or two 32-bit
+floating point values. The MMX registers cannot be used at the same
+time as the floating point stack.
+
+ See Intel and AMD documentation, keeping in mind that the operand
+order in instructions is reversed from the Intel syntax.
+
+
+File: as.info, Node: i386-16bit, Next: i386-Arch, Prev: i386-SIMD, Up: i386-Dependent
+
+9.13.12 Writing 16-bit Code
+---------------------------
+
+While `as' normally writes only "pure" 32-bit i386 code or 64-bit
+x86-64 code depending on the default configuration, it also supports
+writing code to run in real mode or in 16-bit protected mode code
+segments. To do this, put a `.code16' or `.code16gcc' directive before
+the assembly language instructions to be run in 16-bit mode. You can
+switch `as' back to writing normal 32-bit code with the `.code32'
+directive.
+
+ `.code16gcc' provides experimental support for generating 16-bit
+code from gcc, and differs from `.code16' in that `call', `ret',
+`enter', `leave', `push', `pop', `pusha', `popa', `pushf', and `popf'
+instructions default to 32-bit size. This is so that the stack pointer
+is manipulated in the same way over function calls, allowing access to
+function parameters at the same stack offsets as in 32-bit mode.
+`.code16gcc' also automatically adds address size prefixes where
+necessary to use the 32-bit addressing modes that gcc generates.
+
+ The code which `as' generates in 16-bit mode will not necessarily
+run on a 16-bit pre-80386 processor. To write code that runs on such a
+processor, you must refrain from using _any_ 32-bit constructs which
+require `as' to output address or operand size prefixes.
+
+ Note that writing 16-bit code instructions by explicitly specifying a
+prefix or an instruction mnemonic suffix within a 32-bit code section
+generates different machine instructions than those generated for a
+16-bit code segment. In a 32-bit code section, the following code
+generates the machine opcode bytes `66 6a 04', which pushes the value
+`4' onto the stack, decrementing `%esp' by 2.
+
+ pushw $4
+
+ The same code in a 16-bit code section would generate the machine
+opcode bytes `6a 04' (i.e., without the operand size prefix), which is
+correct since the processor default operand size is assumed to be 16
+bits in a 16-bit code section.
+
+
+File: as.info, Node: i386-Bugs, Next: i386-Notes, Prev: i386-Arch, Up: i386-Dependent
+
+9.13.13 AT&T Syntax bugs
+------------------------
+
+The UnixWare assembler, and probably other AT&T derived ix86 Unix
+assemblers, generate floating point instructions with reversed source
+and destination registers in certain cases. Unfortunately, gcc and
+possibly many other programs use this reversed syntax, so we're stuck
+with it.
+
+ For example
+
+ fsub %st,%st(3)
+ results in `%st(3)' being updated to `%st - %st(3)' rather than the
+expected `%st(3) - %st'. This happens with all the non-commutative
+arithmetic floating point operations with two register operands where
+the source register is `%st' and the destination register is `%st(i)'.
+
+
+File: as.info, Node: i386-Arch, Next: i386-Bugs, Prev: i386-16bit, Up: i386-Dependent
+
+9.13.14 Specifying CPU Architecture
+-----------------------------------
+
+`as' may be told to assemble for a particular CPU (sub-)architecture
+with the `.arch CPU_TYPE' directive. This directive enables a warning
+when gas detects an instruction that is not supported on the CPU
+specified. The choices for CPU_TYPE are:
+
+`i8086' `i186' `i286' `i386'
+`i486' `i586' `i686' `pentium'
+`pentiumpro' `pentiumii' `pentiumiii' `pentium4'
+`prescott' `nocona' `core' `core2'
+`corei7' `l1om'
+`k6' `k6_2' `athlon' `k8'
+`amdfam10'
+`generic32' `generic64'
+`.mmx' `.sse' `.sse2' `.sse3'
+`.ssse3' `.sse4.1' `.sse4.2' `.sse4'
+`.avx' `.vmx' `.smx' `.xsave'
+`.aes' `.pclmul' `.fma' `.movbe'
+`.ept' `.clflush'
+`.3dnow' `.3dnowa' `.sse4a' `.sse5'
+`.syscall' `.rdtscp' `.svme' `.abm'
+`.padlock'
+
+ Apart from the warning, there are only two other effects on `as'
+operation; Firstly, if you specify a CPU other than `i486', then shift
+by one instructions such as `sarl $1, %eax' will automatically use a
+two byte opcode sequence. The larger three byte opcode sequence is
+used on the 486 (and when no architecture is specified) because it
+executes faster on the 486. Note that you can explicitly request the
+two byte opcode by writing `sarl %eax'. Secondly, if you specify
+`i8086', `i186', or `i286', _and_ `.code16' or `.code16gcc' then byte
+offset conditional jumps will be promoted when necessary to a two
+instruction sequence consisting of a conditional jump of the opposite
+sense around an unconditional jump to the target.
+
+ Following the CPU architecture (but not a sub-architecture, which
+are those starting with a dot), you may specify `jumps' or `nojumps' to
+control automatic promotion of conditional jumps. `jumps' is the
+default, and enables jump promotion; All external jumps will be of the
+long variety, and file-local jumps will be promoted as necessary.
+(*note i386-Jumps::) `nojumps' leaves external conditional jumps as
+byte offset jumps, and warns about file-local conditional jumps that
+`as' promotes. Unconditional jumps are treated as for `jumps'.
+
+ For example
+
+ .arch i8086,nojumps
+
+
+File: as.info, Node: i386-Notes, Prev: i386-Bugs, Up: i386-Dependent
+
+9.13.15 Notes
+-------------
+
+There is some trickery concerning the `mul' and `imul' instructions
+that deserves mention. The 16-, 32-, 64- and 128-bit expanding
+multiplies (base opcode `0xf6'; extension 4 for `mul' and 5 for `imul')
+can be output only in the one operand form. Thus, `imul %ebx, %eax'
+does _not_ select the expanding multiply; the expanding multiply would
+clobber the `%edx' register, and this would confuse `gcc' output. Use
+`imul %ebx' to get the 64-bit product in `%edx:%eax'.
+
+ We have added a two operand form of `imul' when the first operand is
+an immediate mode expression and the second operand is a register.
+This is just a shorthand, so that, multiplying `%eax' by 69, for
+example, can be done with `imul $69, %eax' rather than `imul $69, %eax,
+%eax'.
+
+
+File: as.info, Node: i860-Dependent, Next: i960-Dependent, Prev: i386-Dependent, Up: Machine Dependencies
+
+9.14 Intel i860 Dependent Features
+==================================
+
+* Menu:
+
+* Notes-i860:: i860 Notes
+* Options-i860:: i860 Command-line Options
+* Directives-i860:: i860 Machine Directives
+* Opcodes for i860:: i860 Opcodes
+
+
+File: as.info, Node: Notes-i860, Next: Options-i860, Up: i860-Dependent
+
+9.14.1 i860 Notes
+-----------------
+
+This is a fairly complete i860 assembler which is compatible with the
+UNIX System V/860 Release 4 assembler. However, it does not currently
+support SVR4 PIC (i.e., `@GOT, @GOTOFF, @PLT').
+
+ Like the SVR4/860 assembler, the output object format is ELF32.
+Currently, this is the only supported object format. If there is
+sufficient interest, other formats such as COFF may be implemented.
+
+ Both the Intel and AT&T/SVR4 syntaxes are supported, with the latter
+being the default. One difference is that AT&T syntax requires the '%'
+prefix on register names while Intel syntax does not. Another
+difference is in the specification of relocatable expressions. The
+Intel syntax is `ha%expression' whereas the SVR4 syntax is
+`[expression]@ha' (and similarly for the "l" and "h" selectors).
+
+
+File: as.info, Node: Options-i860, Next: Directives-i860, Prev: Notes-i860, Up: i860-Dependent
+
+9.14.2 i860 Command-line Options
+--------------------------------
+
+9.14.2.1 SVR4 compatibility options
+...................................
+
+`-V'
+ Print assembler version.
+
+`-Qy'
+ Ignored.
+
+`-Qn'
+ Ignored.
+
+9.14.2.2 Other options
+......................
+
+`-EL'
+ Select little endian output (this is the default).
+
+`-EB'
+ Select big endian output. Note that the i860 always reads
+ instructions as little endian data, so this option only effects
+ data and not instructions.
+
+`-mwarn-expand'
+ Emit a warning message if any pseudo-instruction expansions
+ occurred. For example, a `or' instruction with an immediate
+ larger than 16-bits will be expanded into two instructions. This
+ is a very undesirable feature to rely on, so this flag can help
+ detect any code where it happens. One use of it, for instance, has
+ been to find and eliminate any place where `gcc' may emit these
+ pseudo-instructions.
+
+`-mxp'
+ Enable support for the i860XP instructions and control registers.
+ By default, this option is disabled so that only the base
+ instruction set (i.e., i860XR) is supported.
+
+`-mintel-syntax'
+ The i860 assembler defaults to AT&T/SVR4 syntax. This option
+ enables the Intel syntax.
+
+
+File: as.info, Node: Directives-i860, Next: Opcodes for i860, Prev: Options-i860, Up: i860-Dependent
+
+9.14.3 i860 Machine Directives
+------------------------------
+
+`.dual'
+ Enter dual instruction mode. While this directive is supported, the
+ preferred way to use dual instruction mode is to explicitly code
+ the dual bit with the `d.' prefix.
+
+`.enddual'
+ Exit dual instruction mode. While this directive is supported, the
+ preferred way to use dual instruction mode is to explicitly code
+ the dual bit with the `d.' prefix.
+
+`.atmp'
+ Change the temporary register used when expanding pseudo
+ operations. The default register is `r31'.
+
+ The `.dual', `.enddual', and `.atmp' directives are available only
+in the Intel syntax mode.
+
+ Both syntaxes allow for the standard `.align' directive. However,
+the Intel syntax additionally allows keywords for the alignment
+parameter: "`.align type'", where `type' is one of `.short', `.long',
+`.quad', `.single', `.double' representing alignments of 2, 4, 16, 4,
+and 8, respectively.
+
+
+File: as.info, Node: Opcodes for i860, Prev: Directives-i860, Up: i860-Dependent
+
+9.14.4 i860 Opcodes
+-------------------
+
+All of the Intel i860XR and i860XP machine instructions are supported.
+Please see either _i860 Microprocessor Programmer's Reference Manual_
+or _i860 Microprocessor Architecture_ for more information.
+
+9.14.4.1 Other instruction support (pseudo-instructions)
+........................................................
+
+For compatibility with some other i860 assemblers, a number of
+pseudo-instructions are supported. While these are supported, they are
+a very undesirable feature that should be avoided - in particular, when
+they result in an expansion to multiple actual i860 instructions. Below
+are the pseudo-instructions that result in expansions.
+ * Load large immediate into general register:
+
+ The pseudo-instruction `mov imm,%rn' (where the immediate does not
+ fit within a signed 16-bit field) will be expanded into:
+ orh large_imm@h,%r0,%rn
+ or large_imm@l,%rn,%rn
+
+ * Load/store with relocatable address expression:
+
+ For example, the pseudo-instruction `ld.b addr_exp(%rx),%rn' will
+ be expanded into:
+ orh addr_exp@ha,%rx,%r31
+ ld.l addr_exp@l(%r31),%rn
+
+ The analogous expansions apply to `ld.x, st.x, fld.x, pfld.x,
+ fst.x', and `pst.x' as well.
+
+ * Signed large immediate with add/subtract:
+
+ If any of the arithmetic operations `adds, addu, subs, subu' are
+ used with an immediate larger than 16-bits (signed), then they
+ will be expanded. For instance, the pseudo-instruction `adds
+ large_imm,%rx,%rn' expands to:
+ orh large_imm@h,%r0,%r31
+ or large_imm@l,%r31,%r31
+ adds %r31,%rx,%rn
+
+ * Unsigned large immediate with logical operations:
+
+ Logical operations (`or, andnot, or, xor') also result in
+ expansions. The pseudo-instruction `or large_imm,%rx,%rn' results
+ in:
+ orh large_imm@h,%rx,%r31
+ or large_imm@l,%r31,%rn
+
+ Similarly for the others, except for `and' which expands to:
+ andnot (-1 - large_imm)@h,%rx,%r31
+ andnot (-1 - large_imm)@l,%r31,%rn
+
+
+File: as.info, Node: i960-Dependent, Next: IA-64-Dependent, Prev: i860-Dependent, Up: Machine Dependencies
+
+9.15 Intel 80960 Dependent Features
+===================================
+
+* Menu:
+
+* Options-i960:: i960 Command-line Options
+* Floating Point-i960:: Floating Point
+* Directives-i960:: i960 Machine Directives
+* Opcodes for i960:: i960 Opcodes
+
+
+File: as.info, Node: Options-i960, Next: Floating Point-i960, Up: i960-Dependent
+
+9.15.1 i960 Command-line Options
+--------------------------------
+
+`-ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC'
+ Select the 80960 architecture. Instructions or features not
+ supported by the selected architecture cause fatal errors.
+
+ `-ACA' is equivalent to `-ACA_A'; `-AKC' is equivalent to `-AMC'.
+ Synonyms are provided for compatibility with other tools.
+
+ If you do not specify any of these options, `as' generates code
+ for any instruction or feature that is supported by _some_ version
+ of the 960 (even if this means mixing architectures!). In
+ principle, `as' attempts to deduce the minimal sufficient
+ processor type if none is specified; depending on the object code
+ format, the processor type may be recorded in the object file. If
+ it is critical that the `as' output match a specific architecture,
+ specify that architecture explicitly.
+
+`-b'
+ Add code to collect information about conditional branches taken,
+ for later optimization using branch prediction bits. (The
+ conditional branch instructions have branch prediction bits in the
+ CA, CB, and CC architectures.) If BR represents a conditional
+ branch instruction, the following represents the code generated by
+ the assembler when `-b' is specified:
+
+ call INCREMENT ROUTINE
+ .word 0 # pre-counter
+ Label: BR
+ call INCREMENT ROUTINE
+ .word 0 # post-counter
+
+ The counter following a branch records the number of times that
+ branch was _not_ taken; the difference between the two counters is
+ the number of times the branch _was_ taken.
+
+ A table of every such `Label' is also generated, so that the
+ external postprocessor `gbr960' (supplied by Intel) can locate all
+ the counters. This table is always labeled `__BRANCH_TABLE__';
+ this is a local symbol to permit collecting statistics for many
+ separate object files. The table is word aligned, and begins with
+ a two-word header. The first word, initialized to 0, is used in
+ maintaining linked lists of branch tables. The second word is a
+ count of the number of entries in the table, which follow
+ immediately: each is a word, pointing to one of the labels
+ illustrated above.
+
+ +------------+------------+------------+ ... +------------+
+ | | | | | |
+ | *NEXT | COUNT: N | *BRLAB 1 | | *BRLAB N |
+ | | | | | |
+ +------------+------------+------------+ ... +------------+
+
+ __BRANCH_TABLE__ layout
+
+ The first word of the header is used to locate multiple branch
+ tables, since each object file may contain one. Normally the links
+ are maintained with a call to an initialization routine, placed at
+ the beginning of each function in the file. The GNU C compiler
+ generates these calls automatically when you give it a `-b' option.
+ For further details, see the documentation of `gbr960'.
+
+`-no-relax'
+ Normally, Compare-and-Branch instructions with targets that require
+ displacements greater than 13 bits (or that have external targets)
+ are replaced with the corresponding compare (or `chkbit') and
+ branch instructions. You can use the `-no-relax' option to
+ specify that `as' should generate errors instead, if the target
+ displacement is larger than 13 bits.
+
+ This option does not affect the Compare-and-Jump instructions; the
+ code emitted for them is _always_ adjusted when necessary
+ (depending on displacement size), regardless of whether you use
+ `-no-relax'.
+
+
+File: as.info, Node: Floating Point-i960, Next: Directives-i960, Prev: Options-i960, Up: i960-Dependent
+
+9.15.2 Floating Point
+---------------------
+
+`as' generates IEEE floating-point numbers for the directives `.float',
+`.double', `.extended', and `.single'.
+
+
+File: as.info, Node: Directives-i960, Next: Opcodes for i960, Prev: Floating Point-i960, Up: i960-Dependent
+
+9.15.3 i960 Machine Directives
+------------------------------
+
+`.bss SYMBOL, LENGTH, ALIGN'
+ Reserve LENGTH bytes in the bss section for a local SYMBOL,
+ aligned to the power of two specified by ALIGN. LENGTH and ALIGN
+ must be positive absolute expressions. This directive differs
+ from `.lcomm' only in that it permits you to specify an alignment.
+ *Note `.lcomm': Lcomm.
+
+`.extended FLONUMS'
+ `.extended' expects zero or more flonums, separated by commas; for
+ each flonum, `.extended' emits an IEEE extended-format (80-bit)
+ floating-point number.
+
+`.leafproc CALL-LAB, BAL-LAB'
+ You can use the `.leafproc' directive in conjunction with the
+ optimized `callj' instruction to enable faster calls of leaf
+ procedures. If a procedure is known to call no other procedures,
+ you may define an entry point that skips procedure prolog code
+ (and that does not depend on system-supplied saved context), and
+ declare it as the BAL-LAB using `.leafproc'. If the procedure
+ also has an entry point that goes through the normal prolog, you
+ can specify that entry point as CALL-LAB.
+
+ A `.leafproc' declaration is meant for use in conjunction with the
+ optimized call instruction `callj'; the directive records the data
+ needed later to choose between converting the `callj' into a `bal'
+ or a `call'.
+
+ CALL-LAB is optional; if only one argument is present, or if the
+ two arguments are identical, the single argument is assumed to be
+ the `bal' entry point.
+
+`.sysproc NAME, INDEX'
+ The `.sysproc' directive defines a name for a system procedure.
+ After you define it using `.sysproc', you can use NAME to refer to
+ the system procedure identified by INDEX when calling procedures
+ with the optimized call instruction `callj'.
+
+ Both arguments are required; INDEX must be between 0 and 31
+ (inclusive).
+
+
+File: as.info, Node: Opcodes for i960, Prev: Directives-i960, Up: i960-Dependent
+
+9.15.4 i960 Opcodes
+-------------------
+
+All Intel 960 machine instructions are supported; *note i960
+Command-line Options: Options-i960. for a discussion of selecting the
+instruction subset for a particular 960 architecture.
+
+ Some opcodes are processed beyond simply emitting a single
+corresponding instruction: `callj', and Compare-and-Branch or
+Compare-and-Jump instructions with target displacements larger than 13
+bits.
+
+* Menu:
+
+* callj-i960:: `callj'
+* Compare-and-branch-i960:: Compare-and-Branch
+
+
+File: as.info, Node: callj-i960, Next: Compare-and-branch-i960, Up: Opcodes for i960
+
+9.15.4.1 `callj'
+................
+
+You can write `callj' to have the assembler or the linker determine the
+most appropriate form of subroutine call: `call', `bal', or `calls'.
+If the assembly source contains enough information--a `.leafproc' or
+`.sysproc' directive defining the operand--then `as' translates the
+`callj'; if not, it simply emits the `callj', leaving it for the linker
+to resolve.
+
+
+File: as.info, Node: Compare-and-branch-i960, Prev: callj-i960, Up: Opcodes for i960
+
+9.15.4.2 Compare-and-Branch
+...........................
+
+The 960 architectures provide combined Compare-and-Branch instructions
+that permit you to store the branch target in the lower 13 bits of the
+instruction word itself. However, if you specify a branch target far
+enough away that its address won't fit in 13 bits, the assembler can
+either issue an error, or convert your Compare-and-Branch instruction
+into separate instructions to do the compare and the branch.
+
+ Whether `as' gives an error or expands the instruction depends on
+two choices you can make: whether you use the `-no-relax' option, and
+whether you use a "Compare and Branch" instruction or a "Compare and
+Jump" instruction. The "Jump" instructions are _always_ expanded if
+necessary; the "Branch" instructions are expanded when necessary
+_unless_ you specify `-no-relax'--in which case `as' gives an error
+instead.
+
+ These are the Compare-and-Branch instructions, their "Jump" variants,
+and the instruction pairs they may expand into:
+
+ Compare and
+ Branch Jump Expanded to
+ ------ ------ ------------
+ bbc chkbit; bno
+ bbs chkbit; bo
+ cmpibe cmpije cmpi; be
+ cmpibg cmpijg cmpi; bg
+ cmpibge cmpijge cmpi; bge
+ cmpibl cmpijl cmpi; bl
+ cmpible cmpijle cmpi; ble
+ cmpibno cmpijno cmpi; bno
+ cmpibne cmpijne cmpi; bne
+ cmpibo cmpijo cmpi; bo
+ cmpobe cmpoje cmpo; be
+ cmpobg cmpojg cmpo; bg
+ cmpobge cmpojge cmpo; bge
+ cmpobl cmpojl cmpo; bl
+ cmpoble cmpojle cmpo; ble
+ cmpobne cmpojne cmpo; bne
+
+
+File: as.info, Node: IA-64-Dependent, Next: IP2K-Dependent, Prev: i960-Dependent, Up: Machine Dependencies
+
+9.16 IA-64 Dependent Features
+=============================
+
+* Menu:
+
+* IA-64 Options:: Options
+* IA-64 Syntax:: Syntax
+* IA-64 Opcodes:: Opcodes
+
+
+File: as.info, Node: IA-64 Options, Next: IA-64 Syntax, Up: IA-64-Dependent
+
+9.16.1 Options
+--------------
+
+`-mconstant-gp'
+ This option instructs the assembler to mark the resulting object
+ file as using the "constant GP" model. With this model, it is
+ assumed that the entire program uses a single global pointer (GP)
+ value. Note that this option does not in any fashion affect the
+ machine code emitted by the assembler. All it does is turn on the
+ EF_IA_64_CONS_GP flag in the ELF file header.
+
+`-mauto-pic'
+ This option instructs the assembler to mark the resulting object
+ file as using the "constant GP without function descriptor" data
+ model. This model is like the "constant GP" model, except that it
+ additionally does away with function descriptors. What this means
+ is that the address of a function refers directly to the
+ function's code entry-point. Normally, such an address would
+ refer to a function descriptor, which contains both the code
+ entry-point and the GP-value needed by the function. Note that
+ this option does not in any fashion affect the machine code
+ emitted by the assembler. All it does is turn on the
+ EF_IA_64_NOFUNCDESC_CONS_GP flag in the ELF file header.
+
+`-milp32'
+
+`-milp64'
+
+`-mlp64'
+
+`-mp64'
+ These options select the data model. The assembler defaults to
+ `-mlp64' (LP64 data model).
+
+`-mle'
+
+`-mbe'
+ These options select the byte order. The `-mle' option selects
+ little-endian byte order (default) and `-mbe' selects big-endian
+ byte order. Note that IA-64 machine code always uses
+ little-endian byte order.
+
+`-mtune=itanium1'
+
+`-mtune=itanium2'
+ Tune for a particular IA-64 CPU, ITANIUM1 or ITANIUM2. The default
+ is ITANIUM2.
+
+`-munwind-check=warning'
+
+`-munwind-check=error'
+ These options control what the assembler will do when performing
+ consistency checks on unwind directives. `-munwind-check=warning'
+ will make the assembler issue a warning when an unwind directive
+ check fails. This is the default. `-munwind-check=error' will
+ make the assembler issue an error when an unwind directive check
+ fails.
+
+`-mhint.b=ok'
+
+`-mhint.b=warning'
+
+`-mhint.b=error'
+ These options control what the assembler will do when the `hint.b'
+ instruction is used. `-mhint.b=ok' will make the assembler accept
+ `hint.b'. `-mint.b=warning' will make the assembler issue a
+ warning when `hint.b' is used. `-mhint.b=error' will make the
+ assembler treat `hint.b' as an error, which is the default.
+
+`-x'
+
+`-xexplicit'
+ These options turn on dependency violation checking.
+
+`-xauto'
+ This option instructs the assembler to automatically insert stop
+ bits where necessary to remove dependency violations. This is the
+ default mode.
+
+`-xnone'
+ This option turns off dependency violation checking.
+
+`-xdebug'
+ This turns on debug output intended to help tracking down bugs in
+ the dependency violation checker.
+
+`-xdebugn'
+ This is a shortcut for -xnone -xdebug.
+
+`-xdebugx'
+ This is a shortcut for -xexplicit -xdebug.
+
+
+
+File: as.info, Node: IA-64 Syntax, Next: IA-64 Opcodes, Prev: IA-64 Options, Up: IA-64-Dependent
+
+9.16.2 Syntax
+-------------
+
+The assembler syntax closely follows the IA-64 Assembly Language
+Reference Guide.
+
+* Menu:
+
+* IA-64-Chars:: Special Characters
+* IA-64-Regs:: Register Names
+* IA-64-Bits:: Bit Names
+
+
+File: as.info, Node: IA-64-Chars, Next: IA-64-Regs, Up: IA-64 Syntax
+
+9.16.2.1 Special Characters
+...........................
+
+`//' is the line comment token.
+
+ `;' can be used instead of a newline to separate statements.
+
+
+File: as.info, Node: IA-64-Regs, Next: IA-64-Bits, Prev: IA-64-Chars, Up: IA-64 Syntax
+
+9.16.2.2 Register Names
+.......................
+
+The 128 integer registers are referred to as `rN'. The 128
+floating-point registers are referred to as `fN'. The 128 application
+registers are referred to as `arN'. The 128 control registers are
+referred to as `crN'. The 64 one-bit predicate registers are referred
+to as `pN'. The 8 branch registers are referred to as `bN'. In
+addition, the assembler defines a number of aliases: `gp' (`r1'), `sp'
+(`r12'), `rp' (`b0'), `ret0' (`r8'), `ret1' (`r9'), `ret2' (`r10'),
+`ret3' (`r9'), `fargN' (`f8+N'), and `fretN' (`f8+N').
+
+ For convenience, the assembler also defines aliases for all named
+application and control registers. For example, `ar.bsp' refers to the
+register backing store pointer (`ar17'). Similarly, `cr.eoi' refers to
+the end-of-interrupt register (`cr67').
+
+
+File: as.info, Node: IA-64-Bits, Prev: IA-64-Regs, Up: IA-64 Syntax
+
+9.16.2.3 IA-64 Processor-Status-Register (PSR) Bit Names
+........................................................
+
+The assembler defines bit masks for each of the bits in the IA-64
+processor status register. For example, `psr.ic' corresponds to a
+value of 0x2000. These masks are primarily intended for use with the
+`ssm'/`sum' and `rsm'/`rum' instructions, but they can be used anywhere
+else where an integer constant is expected.
+
+
+File: as.info, Node: IA-64 Opcodes, Prev: IA-64 Syntax, Up: IA-64-Dependent
+
+9.16.3 Opcodes
+--------------
+
+For detailed information on the IA-64 machine instruction set, see the
+IA-64 Architecture Handbook
+(http://developer.intel.com/design/itanium/arch_spec.htm).
+
+
+File: as.info, Node: IP2K-Dependent, Next: LM32-Dependent, Prev: IA-64-Dependent, Up: Machine Dependencies
+
+9.17 IP2K Dependent Features
+============================
+
+* Menu:
+
+* IP2K-Opts:: IP2K Options
+
+
+File: as.info, Node: IP2K-Opts, Up: IP2K-Dependent
+
+9.17.1 IP2K Options
+-------------------
+
+The Ubicom IP2K version of `as' has a few machine dependent options:
+
+`-mip2022ext'
+ `as' can assemble the extended IP2022 instructions, but it will
+ only do so if this is specifically allowed via this command line
+ option.
+
+`-mip2022'
+ This option restores the assembler's default behaviour of not
+ permitting the extended IP2022 instructions to be assembled.
+
+
+
+File: as.info, Node: LM32-Dependent, Next: M32C-Dependent, Prev: IP2K-Dependent, Up: Machine Dependencies
+
+9.18 LM32 Dependent Features
+============================
+
+* Menu:
+
+* LM32 Options:: Options
+* LM32 Syntax:: Syntax
+* LM32 Opcodes:: Opcodes
+
+
+File: as.info, Node: LM32 Options, Next: LM32 Syntax, Up: LM32-Dependent
+
+9.18.1 Options
+--------------
+
+`-mmultiply-enabled'
+ Enable multiply instructions.
+
+`-mdivide-enabled'
+ Enable divide instructions.
+
+`-mbarrel-shift-enabled'
+ Enable barrel-shift instructions.
+
+`-msign-extend-enabled'
+ Enable sign extend instructions.
+
+`-muser-enabled'
+ Enable user defined instructions.
+
+`-micache-enabled'
+ Enable instruction cache related CSRs.
+
+`-mdcache-enabled'
+ Enable data cache related CSRs.
+
+`-mbreak-enabled'
+ Enable break instructions.
+
+`-mall-enabled'
+ Enable all instructions and CSRs.
+
+
+
+File: as.info, Node: LM32 Syntax, Next: LM32 Opcodes, Prev: LM32 Options, Up: LM32-Dependent
+
+9.18.2 Syntax
+-------------
+
+* Menu:
+
+* LM32-Regs:: Register Names
+* LM32-Modifiers:: Relocatable Expression Modifiers
+
+
+File: as.info, Node: LM32-Regs, Next: LM32-Modifiers, Up: LM32 Syntax
+
+9.18.2.1 Register Names
+.......................
+
+LM32 has 32 x 32-bit general purpose registers `r0', `r1', ... `r31'.
+
+ The following aliases are defined: `gp' - `r26', `fp' - `r27', `sp'
+- `r28', `ra' - `r29', `ea' - `r30', `ba' - `r31'.
+
+ LM32 has the following Control and Status Registers (CSRs).
+
+`IE'
+ Interrupt enable.
+
+`IM'
+ Interrupt mask.
+
+`IP'
+ Interrupt pending.
+
+`ICC'
+ Instruction cache control.
+
+`DCC'
+ Data cache control.
+
+`CC'
+ Cycle counter.
+
+`CFG'
+ Configuration.
+
+`EBA'
+ Exception base address.
+
+`DC'
+ Debug control.
+
+`DEBA'
+ Debug exception base address.
+
+`JTX'
+ JTAG transmit.
+
+`JRX'
+ JTAG receive.
+
+`BP0'
+ Breakpoint 0.
+
+`BP1'
+ Breakpoint 1.
+
+`BP2'
+ Breakpoint 2.
+
+`BP3'
+ Breakpoint 3.
+
+`WP0'
+ Watchpoint 0.
+
+`WP1'
+ Watchpoint 1.
+
+`WP2'
+ Watchpoint 2.
+
+`WP3'
+ Watchpoint 3.
+
+
+File: as.info, Node: LM32-Modifiers, Prev: LM32-Regs, Up: LM32 Syntax
+
+9.18.2.2 Relocatable Expression Modifiers
+.........................................
+
+The assembler supports several modifiers when using relocatable
+addresses in LM32 instruction operands. The general syntax is the
+following:
+
+ modifier(relocatable-expression)
+
+`lo'
+ This modifier allows you to use bits 0 through 15 of an address
+ expression as 16 bit relocatable expression.
+
+`hi'
+ This modifier allows you to use bits 16 through 23 of an address
+ expression as 16 bit relocatable expression.
+
+ For example
+
+ ori r4, r4, lo(sym+10)
+ orhi r4, r4, hi(sym+10)
+
+`gp'
+ This modified creates a 16-bit relocatable expression that is the
+ offset of the symbol from the global pointer.
+
+ mva r4, gp(sym)
+
+`got'
+ This modifier places a symbol in the GOT and creates a 16-bit
+ relocatable expression that is the offset into the GOT of this
+ symbol.
+
+ lw r4, (gp+got(sym))
+
+`gotofflo16'
+ This modifier allows you to use the bits 0 through 15 of an
+ address which is an offset from the GOT.
+
+`gotoffhi16'
+ This modifier allows you to use the bits 16 through 31 of an
+ address which is an offset from the GOT.
+
+ orhi r4, r4, gotoffhi16(lsym)
+ addi r4, r4, gotofflo16(lsym)
+
+
+
+File: as.info, Node: LM32 Opcodes, Prev: LM32 Syntax, Up: LM32-Dependent
+
+9.18.3 Opcodes
+--------------
+
+For detailed information on the LM32 machine instruction set, see
+`http://www.latticesemi.com/products/intellectualproperty/ipcores/mico32/'.
+
+ `as' implements all the standard LM32 opcodes.
+
+
+File: as.info, Node: M32C-Dependent, Next: M32R-Dependent, Prev: LM32-Dependent, Up: Machine Dependencies
+
+9.19 M32C Dependent Features
+============================
+
+ `as' can assemble code for several different members of the Renesas
+M32C family. Normally the default is to assemble code for the M16C
+microprocessor. The `-m32c' option may be used to change the default
+to the M32C microprocessor.
+
+* Menu:
+
+* M32C-Opts:: M32C Options
+* M32C-Modifiers:: Symbolic Operand Modifiers
+
+
+File: as.info, Node: M32C-Opts, Next: M32C-Modifiers, Up: M32C-Dependent
+
+9.19.1 M32C Options
+-------------------
+
+The Renesas M32C version of `as' has these machine-dependent options:
+
+`-m32c'
+ Assemble M32C instructions.
+
+`-m16c'
+ Assemble M16C instructions (default).
+
+`-relax'
+ Enable support for link-time relaxations.
+
+`-h-tick-hex'
+ Support H'00 style hex constants in addition to 0x00 style.
+
+
+
+File: as.info, Node: M32C-Modifiers, Prev: M32C-Opts, Up: M32C-Dependent
+
+9.19.2 Symbolic Operand Modifiers
+---------------------------------
+
+The assembler supports several modifiers when using symbol addresses in
+M32C instruction operands. The general syntax is the following:
+
+ %modifier(symbol)
+
+`%dsp8'
+`%dsp16'
+ These modifiers override the assembler's assumptions about how big
+ a symbol's address is. Normally, when it sees an operand like
+ `sym[a0]' it assumes `sym' may require the widest displacement
+ field (16 bits for `-m16c', 24 bits for `-m32c'). These modifiers
+ tell it to assume the address will fit in an 8 or 16 bit
+ (respectively) unsigned displacement. Note that, of course, if it
+ doesn't actually fit you will get linker errors. Example:
+
+ mov.w %dsp8(sym)[a0],r1
+ mov.b #0,%dsp8(sym)[a0]
+
+`%hi8'
+ This modifier allows you to load bits 16 through 23 of a 24 bit
+ address into an 8 bit register. This is useful with, for example,
+ the M16C `smovf' instruction, which expects a 20 bit address in
+ `r1h' and `a0'. Example:
+
+ mov.b #%hi8(sym),r1h
+ mov.w #%lo16(sym),a0
+ smovf.b
+
+`%lo16'
+ Likewise, this modifier allows you to load bits 0 through 15 of a
+ 24 bit address into a 16 bit register.
+
+`%hi16'
+ This modifier allows you to load bits 16 through 31 of a 32 bit
+ address into a 16 bit register. While the M32C family only has 24
+ bits of address space, it does support addresses in pairs of 16 bit
+ registers (like `a1a0' for the `lde' instruction). This modifier
+ is for loading the upper half in such cases. Example:
+
+ mov.w #%hi16(sym),a1
+ mov.w #%lo16(sym),a0
+ ...
+ lde.w [a1a0],r1
+
+
+
+File: as.info, Node: M32R-Dependent, Next: M68K-Dependent, Prev: M32C-Dependent, Up: Machine Dependencies
+
+9.20 M32R Dependent Features
+============================
+
+* Menu:
+
+* M32R-Opts:: M32R Options
+* M32R-Directives:: M32R Directives
+* M32R-Warnings:: M32R Warnings
+
+
+File: as.info, Node: M32R-Opts, Next: M32R-Directives, Up: M32R-Dependent
+
+9.20.1 M32R Options
+-------------------
+
+The Renease M32R version of `as' has a few machine dependent options:
+
+`-m32rx'
+ `as' can assemble code for several different members of the
+ Renesas M32R family. Normally the default is to assemble code for
+ the M32R microprocessor. This option may be used to change the
+ default to the M32RX microprocessor, which adds some more
+ instructions to the basic M32R instruction set, and some
+ additional parameters to some of the original instructions.
+
+`-m32r2'
+ This option changes the target processor to the the M32R2
+ microprocessor.
+
+`-m32r'
+ This option can be used to restore the assembler's default
+ behaviour of assembling for the M32R microprocessor. This can be
+ useful if the default has been changed by a previous command line
+ option.
+
+`-little'
+ This option tells the assembler to produce little-endian code and
+ data. The default is dependent upon how the toolchain was
+ configured.
+
+`-EL'
+ This is a synonym for _-little_.
+
+`-big'
+ This option tells the assembler to produce big-endian code and
+ data.
+
+`-EB'
+ This is a synonum for _-big_.
+
+`-KPIC'
+ This option specifies that the output of the assembler should be
+ marked as position-independent code (PIC).
+
+`-parallel'
+ This option tells the assembler to attempts to combine two
+ sequential instructions into a single, parallel instruction, where
+ it is legal to do so.
+
+`-no-parallel'
+ This option disables a previously enabled _-parallel_ option.
+
+`-no-bitinst'
+ This option disables the support for the extended bit-field
+ instructions provided by the M32R2. If this support needs to be
+ re-enabled the _-bitinst_ switch can be used to restore it.
+
+`-O'
+ This option tells the assembler to attempt to optimize the
+ instructions that it produces. This includes filling delay slots
+ and converting sequential instructions into parallel ones. This
+ option implies _-parallel_.
+
+`-warn-explicit-parallel-conflicts'
+ Instructs `as' to produce warning messages when questionable
+ parallel instructions are encountered. This option is enabled by
+ default, but `gcc' disables it when it invokes `as' directly.
+ Questionable instructions are those whose behaviour would be
+ different if they were executed sequentially. For example the
+ code fragment `mv r1, r2 || mv r3, r1' produces a different result
+ from `mv r1, r2 \n mv r3, r1' since the former moves r1 into r3
+ and then r2 into r1, whereas the later moves r2 into r1 and r3.
+
+`-Wp'
+ This is a shorter synonym for the
+ _-warn-explicit-parallel-conflicts_ option.
+
+`-no-warn-explicit-parallel-conflicts'
+ Instructs `as' not to produce warning messages when questionable
+ parallel instructions are encountered.
+
+`-Wnp'
+ This is a shorter synonym for the
+ _-no-warn-explicit-parallel-conflicts_ option.
+
+`-ignore-parallel-conflicts'
+ This option tells the assembler's to stop checking parallel
+ instructions for constraint violations. This ability is provided
+ for hardware vendors testing chip designs and should not be used
+ under normal circumstances.
+
+`-no-ignore-parallel-conflicts'
+ This option restores the assembler's default behaviour of checking
+ parallel instructions to detect constraint violations.
+
+`-Ip'
+ This is a shorter synonym for the _-ignore-parallel-conflicts_
+ option.
+
+`-nIp'
+ This is a shorter synonym for the _-no-ignore-parallel-conflicts_
+ option.
+
+`-warn-unmatched-high'
+ This option tells the assembler to produce a warning message if a
+ `.high' pseudo op is encountered without a matching `.low' pseudo
+ op. The presence of such an unmatched pseudo op usually indicates
+ a programming error.
+
+`-no-warn-unmatched-high'
+ Disables a previously enabled _-warn-unmatched-high_ option.
+
+`-Wuh'
+ This is a shorter synonym for the _-warn-unmatched-high_ option.
+
+`-Wnuh'
+ This is a shorter synonym for the _-no-warn-unmatched-high_ option.
+
+
+
+File: as.info, Node: M32R-Directives, Next: M32R-Warnings, Prev: M32R-Opts, Up: M32R-Dependent
+
+9.20.2 M32R Directives
+----------------------
+
+The Renease M32R version of `as' has a few architecture specific
+directives:
+
+`low EXPRESSION'
+ The `low' directive computes the value of its expression and
+ places the lower 16-bits of the result into the immediate-field of
+ the instruction. For example:
+
+ or3 r0, r0, #low(0x12345678) ; compute r0 = r0 | 0x5678
+ add3, r0, r0, #low(fred) ; compute r0 = r0 + low 16-bits of address of fred
+
+`high EXPRESSION'
+ The `high' directive computes the value of its expression and
+ places the upper 16-bits of the result into the immediate-field of
+ the instruction. For example:
+
+ seth r0, #high(0x12345678) ; compute r0 = 0x12340000
+ seth, r0, #high(fred) ; compute r0 = upper 16-bits of address of fred
+
+`shigh EXPRESSION'
+ The `shigh' directive is very similar to the `high' directive. It
+ also computes the value of its expression and places the upper
+ 16-bits of the result into the immediate-field of the instruction.
+ The difference is that `shigh' also checks to see if the lower
+ 16-bits could be interpreted as a signed number, and if so it
+ assumes that a borrow will occur from the upper-16 bits. To
+ compensate for this the `shigh' directive pre-biases the upper 16
+ bit value by adding one to it. For example:
+
+ For example:
+
+ seth r0, #shigh(0x12345678) ; compute r0 = 0x12340000
+ seth r0, #shigh(0x00008000) ; compute r0 = 0x00010000
+
+ In the second example the lower 16-bits are 0x8000. If these are
+ treated as a signed value and sign extended to 32-bits then the
+ value becomes 0xffff8000. If this value is then added to
+ 0x00010000 then the result is 0x00008000.
+
+ This behaviour is to allow for the different semantics of the
+ `or3' and `add3' instructions. The `or3' instruction treats its
+ 16-bit immediate argument as unsigned whereas the `add3' treats
+ its 16-bit immediate as a signed value. So for example:
+
+ seth r0, #shigh(0x00008000)
+ add3 r0, r0, #low(0x00008000)
+
+ Produces the correct result in r0, whereas:
+
+ seth r0, #shigh(0x00008000)
+ or3 r0, r0, #low(0x00008000)
+
+ Stores 0xffff8000 into r0.
+
+ Note - the `shigh' directive does not know where in the assembly
+ source code the lower 16-bits of the value are going set, so it
+ cannot check to make sure that an `or3' instruction is being used
+ rather than an `add3' instruction. It is up to the programmer to
+ make sure that correct directives are used.
+
+`.m32r'
+ The directive performs a similar thing as the _-m32r_ command line
+ option. It tells the assembler to only accept M32R instructions
+ from now on. An instructions from later M32R architectures are
+ refused.
+
+`.m32rx'
+ The directive performs a similar thing as the _-m32rx_ command
+ line option. It tells the assembler to start accepting the extra
+ instructions in the M32RX ISA as well as the ordinary M32R ISA.
+
+`.m32r2'
+ The directive performs a similar thing as the _-m32r2_ command
+ line option. It tells the assembler to start accepting the extra
+ instructions in the M32R2 ISA as well as the ordinary M32R ISA.
+
+`.little'
+ The directive performs a similar thing as the _-little_ command
+ line option. It tells the assembler to start producing
+ little-endian code and data. This option should be used with care
+ as producing mixed-endian binary files is fraught with danger.
+
+`.big'
+ The directive performs a similar thing as the _-big_ command line
+ option. It tells the assembler to start producing big-endian code
+ and data. This option should be used with care as producing
+ mixed-endian binary files is fraught with danger.
+
+
+
+File: as.info, Node: M32R-Warnings, Prev: M32R-Directives, Up: M32R-Dependent
+
+9.20.3 M32R Warnings
+--------------------
+
+There are several warning and error messages that can be produced by
+`as' which are specific to the M32R:
+
+`output of 1st instruction is the same as an input to 2nd instruction - is this intentional ?'
+ This message is only produced if warnings for explicit parallel
+ conflicts have been enabled. It indicates that the assembler has
+ encountered a parallel instruction in which the destination
+ register of the left hand instruction is used as an input register
+ in the right hand instruction. For example in this code fragment
+ `mv r1, r2 || neg r3, r1' register r1 is the destination of the
+ move instruction and the input to the neg instruction.
+
+`output of 2nd instruction is the same as an input to 1st instruction - is this intentional ?'
+ This message is only produced if warnings for explicit parallel
+ conflicts have been enabled. It indicates that the assembler has
+ encountered a parallel instruction in which the destination
+ register of the right hand instruction is used as an input
+ register in the left hand instruction. For example in this code
+ fragment `mv r1, r2 || neg r2, r3' register r2 is the destination
+ of the neg instruction and the input to the move instruction.
+
+`instruction `...' is for the M32RX only'
+ This message is produced when the assembler encounters an
+ instruction which is only supported by the M32Rx processor, and
+ the `-m32rx' command line flag has not been specified to allow
+ assembly of such instructions.
+
+`unknown instruction `...''
+ This message is produced when the assembler encounters an
+ instruction which it does not recognize.
+
+`only the NOP instruction can be issued in parallel on the m32r'
+ This message is produced when the assembler encounters a parallel
+ instruction which does not involve a NOP instruction and the
+ `-m32rx' command line flag has not been specified. Only the M32Rx
+ processor is able to execute two instructions in parallel.
+
+`instruction `...' cannot be executed in parallel.'
+ This message is produced when the assembler encounters a parallel
+ instruction which is made up of one or two instructions which
+ cannot be executed in parallel.
+
+`Instructions share the same execution pipeline'
+ This message is produced when the assembler encounters a parallel
+ instruction whoes components both use the same execution pipeline.
+
+`Instructions write to the same destination register.'
+ This message is produced when the assembler encounters a parallel
+ instruction where both components attempt to modify the same
+ register. For example these code fragments will produce this
+ message: `mv r1, r2 || neg r1, r3' `jl r0 || mv r14, r1' `st r2,
+ @-r1 || mv r1, r3' `mv r1, r2 || ld r0, @r1+' `cmp r1, r2 || addx
+ r3, r4' (Both write to the condition bit)
+
+
+
+File: as.info, Node: M68K-Dependent, Next: M68HC11-Dependent, Prev: M32R-Dependent, Up: Machine Dependencies
+
+9.21 M680x0 Dependent Features
+==============================
+
+* Menu:
+
+* M68K-Opts:: M680x0 Options
+* M68K-Syntax:: Syntax
+* M68K-Moto-Syntax:: Motorola Syntax
+* M68K-Float:: Floating Point
+* M68K-Directives:: 680x0 Machine Directives
+* M68K-opcodes:: Opcodes
+
+
+File: as.info, Node: M68K-Opts, Next: M68K-Syntax, Up: M68K-Dependent
+
+9.21.1 M680x0 Options
+---------------------
+
+The Motorola 680x0 version of `as' has a few machine dependent options:
+
+`-march=ARCHITECTURE'
+ This option specifies a target architecture. The following
+ architectures are recognized: `68000', `68010', `68020', `68030',
+ `68040', `68060', `cpu32', `isaa', `isaaplus', `isab', `isac' and
+ `cfv4e'.
+
+`-mcpu=CPU'
+ This option specifies a target cpu. When used in conjunction with
+ the `-march' option, the cpu must be within the specified
+ architecture. Also, the generic features of the architecture are
+ used for instruction generation, rather than those of the specific
+ chip.
+
+`-m[no-]68851'
+
+`-m[no-]68881'
+
+`-m[no-]div'
+
+`-m[no-]usp'
+
+`-m[no-]float'
+
+`-m[no-]mac'
+
+`-m[no-]emac'
+ Enable or disable various architecture specific features. If a
+ chip or architecture by default supports an option (for instance
+ `-march=isaaplus' includes the `-mdiv' option), explicitly
+ disabling the option will override the default.
+
+`-l'
+ You can use the `-l' option to shorten the size of references to
+ undefined symbols. If you do not use the `-l' option, references
+ to undefined symbols are wide enough for a full `long' (32 bits).
+ (Since `as' cannot know where these symbols end up, `as' can only
+ allocate space for the linker to fill in later. Since `as' does
+ not know how far away these symbols are, it allocates as much
+ space as it can.) If you use this option, the references are only
+ one word wide (16 bits). This may be useful if you want the
+ object file to be as small as possible, and you know that the
+ relevant symbols are always less than 17 bits away.
+
+`--register-prefix-optional'
+ For some configurations, especially those where the compiler
+ normally does not prepend an underscore to the names of user
+ variables, the assembler requires a `%' before any use of a
+ register name. This is intended to let the assembler distinguish
+ between C variables and functions named `a0' through `a7', and so
+ on. The `%' is always accepted, but is not required for certain
+ configurations, notably `sun3'. The `--register-prefix-optional'
+ option may be used to permit omitting the `%' even for
+ configurations for which it is normally required. If this is
+ done, it will generally be impossible to refer to C variables and
+ functions with the same names as register names.
+
+`--bitwise-or'
+ Normally the character `|' is treated as a comment character, which
+ means that it can not be used in expressions. The `--bitwise-or'
+ option turns `|' into a normal character. In this mode, you must
+ either use C style comments, or start comments with a `#' character
+ at the beginning of a line.
+
+`--base-size-default-16 --base-size-default-32'
+ If you use an addressing mode with a base register without
+ specifying the size, `as' will normally use the full 32 bit value.
+ For example, the addressing mode `%a0@(%d0)' is equivalent to
+ `%a0@(%d0:l)'. You may use the `--base-size-default-16' option to
+ tell `as' to default to using the 16 bit value. In this case,
+ `%a0@(%d0)' is equivalent to `%a0@(%d0:w)'. You may use the
+ `--base-size-default-32' option to restore the default behaviour.
+
+`--disp-size-default-16 --disp-size-default-32'
+ If you use an addressing mode with a displacement, and the value
+ of the displacement is not known, `as' will normally assume that
+ the value is 32 bits. For example, if the symbol `disp' has not
+ been defined, `as' will assemble the addressing mode
+ `%a0@(disp,%d0)' as though `disp' is a 32 bit value. You may use
+ the `--disp-size-default-16' option to tell `as' to instead assume
+ that the displacement is 16 bits. In this case, `as' will
+ assemble `%a0@(disp,%d0)' as though `disp' is a 16 bit value. You
+ may use the `--disp-size-default-32' option to restore the default
+ behaviour.
+
+`--pcrel'
+ Always keep branches PC-relative. In the M680x0 architecture all
+ branches are defined as PC-relative. However, on some processors
+ they are limited to word displacements maximum. When `as' needs a
+ long branch that is not available, it normally emits an absolute
+ jump instead. This option disables this substitution. When this
+ option is given and no long branches are available, only word
+ branches will be emitted. An error message will be generated if a
+ word branch cannot reach its target. This option has no effect on
+ 68020 and other processors that have long branches. *note Branch
+ Improvement: M68K-Branch.
+
+`-m68000'
+ `as' can assemble code for several different members of the
+ Motorola 680x0 family. The default depends upon how `as' was
+ configured when it was built; normally, the default is to assemble
+ code for the 68020 microprocessor. The following options may be
+ used to change the default. These options control which
+ instructions and addressing modes are permitted. The members of
+ the 680x0 family are very similar. For detailed information about
+ the differences, see the Motorola manuals.
+
+ `-m68000'
+ `-m68ec000'
+ `-m68hc000'
+ `-m68hc001'
+ `-m68008'
+ `-m68302'
+ `-m68306'
+ `-m68307'
+ `-m68322'
+ `-m68356'
+ Assemble for the 68000. `-m68008', `-m68302', and so on are
+ synonyms for `-m68000', since the chips are the same from the
+ point of view of the assembler.
+
+ `-m68010'
+ Assemble for the 68010.
+
+ `-m68020'
+ `-m68ec020'
+ Assemble for the 68020. This is normally the default.
+
+ `-m68030'
+ `-m68ec030'
+ Assemble for the 68030.
+
+ `-m68040'
+ `-m68ec040'
+ Assemble for the 68040.
+
+ `-m68060'
+ `-m68ec060'
+ Assemble for the 68060.
+
+ `-mcpu32'
+ `-m68330'
+ `-m68331'
+ `-m68332'
+ `-m68333'
+ `-m68334'
+ `-m68336'
+ `-m68340'
+ `-m68341'
+ `-m68349'
+ `-m68360'
+ Assemble for the CPU32 family of chips.
+
+ `-m5200'
+
+ `-m5202'
+
+ `-m5204'
+
+ `-m5206'
+
+ `-m5206e'
+
+ `-m521x'
+
+ `-m5249'
+
+ `-m528x'
+
+ `-m5307'
+
+ `-m5407'
+
+ `-m547x'
+
+ `-m548x'
+
+ `-mcfv4'
+
+ `-mcfv4e'
+ Assemble for the ColdFire family of chips.
+
+ `-m68881'
+ `-m68882'
+ Assemble 68881 floating point instructions. This is the
+ default for the 68020, 68030, and the CPU32. The 68040 and
+ 68060 always support floating point instructions.
+
+ `-mno-68881'
+ Do not assemble 68881 floating point instructions. This is
+ the default for 68000 and the 68010. The 68040 and 68060
+ always support floating point instructions, even if this
+ option is used.
+
+ `-m68851'
+ Assemble 68851 MMU instructions. This is the default for the
+ 68020, 68030, and 68060. The 68040 accepts a somewhat
+ different set of MMU instructions; `-m68851' and `-m68040'
+ should not be used together.
+
+ `-mno-68851'
+ Do not assemble 68851 MMU instructions. This is the default
+ for the 68000, 68010, and the CPU32. The 68040 accepts a
+ somewhat different set of MMU instructions.
+
+
+File: as.info, Node: M68K-Syntax, Next: M68K-Moto-Syntax, Prev: M68K-Opts, Up: M68K-Dependent
+
+9.21.2 Syntax
+-------------
+
+This syntax for the Motorola 680x0 was developed at MIT.
+
+ The 680x0 version of `as' uses instructions names and syntax
+compatible with the Sun assembler. Intervening periods are ignored;
+for example, `movl' is equivalent to `mov.l'.
+
+ In the following table APC stands for any of the address registers
+(`%a0' through `%a7'), the program counter (`%pc'), the zero-address
+relative to the program counter (`%zpc'), a suppressed address register
+(`%za0' through `%za7'), or it may be omitted entirely. The use of
+SIZE means one of `w' or `l', and it may be omitted, along with the
+leading colon, unless a scale is also specified. The use of SCALE
+means one of `1', `2', `4', or `8', and it may always be omitted along
+with the leading colon.
+
+ The following addressing modes are understood:
+"Immediate"
+ `#NUMBER'
+
+"Data Register"
+ `%d0' through `%d7'
+
+"Address Register"
+ `%a0' through `%a7'
+ `%a7' is also known as `%sp', i.e., the Stack Pointer. `%a6' is
+ also known as `%fp', the Frame Pointer.
+
+"Address Register Indirect"
+ `%a0@' through `%a7@'
+
+"Address Register Postincrement"
+ `%a0@+' through `%a7@+'
+
+"Address Register Predecrement"
+ `%a0@-' through `%a7@-'
+
+"Indirect Plus Offset"
+ `APC@(NUMBER)'
+
+"Index"
+ `APC@(NUMBER,REGISTER:SIZE:SCALE)'
+
+ The NUMBER may be omitted.
+
+"Postindex"
+ `APC@(NUMBER)@(ONUMBER,REGISTER:SIZE:SCALE)'
+
+ The ONUMBER or the REGISTER, but not both, may be omitted.
+
+"Preindex"
+ `APC@(NUMBER,REGISTER:SIZE:SCALE)@(ONUMBER)'
+
+ The NUMBER may be omitted. Omitting the REGISTER produces the
+ Postindex addressing mode.
+
+"Absolute"
+ `SYMBOL', or `DIGITS', optionally followed by `:b', `:w', or `:l'.
+
+
+File: as.info, Node: M68K-Moto-Syntax, Next: M68K-Float, Prev: M68K-Syntax, Up: M68K-Dependent
+
+9.21.3 Motorola Syntax
+----------------------
+
+The standard Motorola syntax for this chip differs from the syntax
+already discussed (*note Syntax: M68K-Syntax.). `as' can accept
+Motorola syntax for operands, even if MIT syntax is used for other
+operands in the same instruction. The two kinds of syntax are fully
+compatible.
+
+ In the following table APC stands for any of the address registers
+(`%a0' through `%a7'), the program counter (`%pc'), the zero-address
+relative to the program counter (`%zpc'), or a suppressed address
+register (`%za0' through `%za7'). The use of SIZE means one of `w' or
+`l', and it may always be omitted along with the leading dot. The use
+of SCALE means one of `1', `2', `4', or `8', and it may always be
+omitted along with the leading asterisk.
+
+ The following additional addressing modes are understood:
+
+"Address Register Indirect"
+ `(%a0)' through `(%a7)'
+ `%a7' is also known as `%sp', i.e., the Stack Pointer. `%a6' is
+ also known as `%fp', the Frame Pointer.
+
+"Address Register Postincrement"
+ `(%a0)+' through `(%a7)+'
+
+"Address Register Predecrement"
+ `-(%a0)' through `-(%a7)'
+
+"Indirect Plus Offset"
+ `NUMBER(%A0)' through `NUMBER(%A7)', or `NUMBER(%PC)'.
+
+ The NUMBER may also appear within the parentheses, as in
+ `(NUMBER,%A0)'. When used with the PC, the NUMBER may be omitted
+ (with an address register, omitting the NUMBER produces Address
+ Register Indirect mode).
+
+"Index"
+ `NUMBER(APC,REGISTER.SIZE*SCALE)'
+
+ The NUMBER may be omitted, or it may appear within the
+ parentheses. The APC may be omitted. The REGISTER and the APC
+ may appear in either order. If both APC and REGISTER are address
+ registers, and the SIZE and SCALE are omitted, then the first
+ register is taken as the base register, and the second as the
+ index register.
+
+"Postindex"
+ `([NUMBER,APC],REGISTER.SIZE*SCALE,ONUMBER)'
+
+ The ONUMBER, or the REGISTER, or both, may be omitted. Either the
+ NUMBER or the APC may be omitted, but not both.
+
+"Preindex"
+ `([NUMBER,APC,REGISTER.SIZE*SCALE],ONUMBER)'
+
+ The NUMBER, or the APC, or the REGISTER, or any two of them, may
+ be omitted. The ONUMBER may be omitted. The REGISTER and the APC
+ may appear in either order. If both APC and REGISTER are address
+ registers, and the SIZE and SCALE are omitted, then the first
+ register is taken as the base register, and the second as the
+ index register.
+
+
+File: as.info, Node: M68K-Float, Next: M68K-Directives, Prev: M68K-Moto-Syntax, Up: M68K-Dependent
+
+9.21.4 Floating Point
+---------------------
+
+Packed decimal (P) format floating literals are not supported. Feel
+free to add the code!
+
+ The floating point formats generated by directives are these.
+
+`.float'
+ `Single' precision floating point constants.
+
+`.double'
+ `Double' precision floating point constants.
+
+`.extend'
+`.ldouble'
+ `Extended' precision (`long double') floating point constants.
+
+
+File: as.info, Node: M68K-Directives, Next: M68K-opcodes, Prev: M68K-Float, Up: M68K-Dependent
+
+9.21.5 680x0 Machine Directives
+-------------------------------
+
+In order to be compatible with the Sun assembler the 680x0 assembler
+understands the following directives.
+
+`.data1'
+ This directive is identical to a `.data 1' directive.
+
+`.data2'
+ This directive is identical to a `.data 2' directive.
+
+`.even'
+ This directive is a special case of the `.align' directive; it
+ aligns the output to an even byte boundary.
+
+`.skip'
+ This directive is identical to a `.space' directive.
+
+`.arch NAME'
+ Select the target architecture and extension features. Valid
+ values for NAME are the same as for the `-march' command line
+ option. This directive cannot be specified after any instructions
+ have been assembled. If it is given multiple times, or in
+ conjunction with the `-march' option, all uses must be for the
+ same architecture and extension set.
+
+`.cpu NAME'
+ Select the target cpu. Valid valuse for NAME are the same as for
+ the `-mcpu' command line option. This directive cannot be
+ specified after any instructions have been assembled. If it is
+ given multiple times, or in conjunction with the `-mopt' option,
+ all uses must be for the same cpu.
+
+
+
+File: as.info, Node: M68K-opcodes, Prev: M68K-Directives, Up: M68K-Dependent
+
+9.21.6 Opcodes
+--------------
+
+* Menu:
+
+* M68K-Branch:: Branch Improvement
+* M68K-Chars:: Special Characters
+
+
+File: as.info, Node: M68K-Branch, Next: M68K-Chars, Up: M68K-opcodes
+
+9.21.6.1 Branch Improvement
+...........................
+
+Certain pseudo opcodes are permitted for branch instructions. They
+expand to the shortest branch instruction that reach the target.
+Generally these mnemonics are made by substituting `j' for `b' at the
+start of a Motorola mnemonic.
+
+ The following table summarizes the pseudo-operations. A `*' flags
+cases that are more fully described after the table:
+
+ Displacement
+ +------------------------------------------------------------
+ | 68020 68000/10, not PC-relative OK
+ Pseudo-Op |BYTE WORD LONG ABSOLUTE LONG JUMP **
+ +------------------------------------------------------------
+ jbsr |bsrs bsrw bsrl jsr
+ jra |bras braw bral jmp
+ * jXX |bXXs bXXw bXXl bNXs;jmp
+ * dbXX | N/A dbXXw dbXX;bras;bral dbXX;bras;jmp
+ fjXX | N/A fbXXw fbXXl N/A
+
+ XX: condition
+ NX: negative of condition XX
+ `*'--see full description below
+ `**'--this expansion mode is disallowed by `--pcrel'
+
+`jbsr'
+`jra'
+ These are the simplest jump pseudo-operations; they always map to
+ one particular machine instruction, depending on the displacement
+ to the branch target. This instruction will be a byte or word
+ branch is that is sufficient. Otherwise, a long branch will be
+ emitted if available. If no long branches are available and the
+ `--pcrel' option is not given, an absolute long jump will be
+ emitted instead. If no long branches are available, the `--pcrel'
+ option is given, and a word branch cannot reach the target, an
+ error message is generated.
+
+ In addition to standard branch operands, `as' allows these
+ pseudo-operations to have all operands that are allowed for jsr
+ and jmp, substituting these instructions if the operand given is
+ not valid for a branch instruction.
+
+`jXX'
+ Here, `jXX' stands for an entire family of pseudo-operations,
+ where XX is a conditional branch or condition-code test. The full
+ list of pseudo-ops in this family is:
+ jhi jls jcc jcs jne jeq jvc
+ jvs jpl jmi jge jlt jgt jle
+
+ Usually, each of these pseudo-operations expands to a single branch
+ instruction. However, if a word branch is not sufficient, no long
+ branches are available, and the `--pcrel' option is not given, `as'
+ issues a longer code fragment in terms of NX, the opposite
+ condition to XX. For example, under these conditions:
+ jXX foo
+ gives
+ bNXs oof
+ jmp foo
+ oof:
+
+`dbXX'
+ The full family of pseudo-operations covered here is
+ dbhi dbls dbcc dbcs dbne dbeq dbvc
+ dbvs dbpl dbmi dbge dblt dbgt dble
+ dbf dbra dbt
+
+ Motorola `dbXX' instructions allow word displacements only. When
+ a word displacement is sufficient, each of these pseudo-operations
+ expands to the corresponding Motorola instruction. When a word
+ displacement is not sufficient and long branches are available,
+ when the source reads `dbXX foo', `as' emits
+ dbXX oo1
+ bras oo2
+ oo1:bral foo
+ oo2:
+
+ If, however, long branches are not available and the `--pcrel'
+ option is not given, `as' emits
+ dbXX oo1
+ bras oo2
+ oo1:jmp foo
+ oo2:
+
+`fjXX'
+ This family includes
+ fjne fjeq fjge fjlt fjgt fjle fjf
+ fjt fjgl fjgle fjnge fjngl fjngle fjngt
+ fjnle fjnlt fjoge fjogl fjogt fjole fjolt
+ fjor fjseq fjsf fjsne fjst fjueq fjuge
+ fjugt fjule fjult fjun
+
+ Each of these pseudo-operations always expands to a single Motorola
+ coprocessor branch instruction, word or long. All Motorola
+ coprocessor branch instructions allow both word and long
+ displacements.
+
+
+
+File: as.info, Node: M68K-Chars, Prev: M68K-Branch, Up: M68K-opcodes
+
+9.21.6.2 Special Characters
+...........................
+
+The immediate character is `#' for Sun compatibility. The line-comment
+character is `|' (unless the `--bitwise-or' option is used). If a `#'
+appears at the beginning of a line, it is treated as a comment unless
+it looks like `# line file', in which case it is treated normally.
+
+
+File: as.info, Node: M68HC11-Dependent, Next: MicroBlaze-Dependent, Prev: M68K-Dependent, Up: Machine Dependencies
+
+9.22 M68HC11 and M68HC12 Dependent Features
+===========================================
+
+* Menu:
+
+* M68HC11-Opts:: M68HC11 and M68HC12 Options
+* M68HC11-Syntax:: Syntax
+* M68HC11-Modifiers:: Symbolic Operand Modifiers
+* M68HC11-Directives:: Assembler Directives
+* M68HC11-Float:: Floating Point
+* M68HC11-opcodes:: Opcodes
+
+
+File: as.info, Node: M68HC11-Opts, Next: M68HC11-Syntax, Up: M68HC11-Dependent
+
+9.22.1 M68HC11 and M68HC12 Options
+----------------------------------
+
+The Motorola 68HC11 and 68HC12 version of `as' have a few machine
+dependent options.
+
+`-m68hc11'
+ This option switches the assembler in the M68HC11 mode. In this
+ mode, the assembler only accepts 68HC11 operands and mnemonics. It
+ produces code for the 68HC11.
+
+`-m68hc12'
+ This option switches the assembler in the M68HC12 mode. In this
+ mode, the assembler also accepts 68HC12 operands and mnemonics. It
+ produces code for the 68HC12. A few 68HC11 instructions are
+ replaced by some 68HC12 instructions as recommended by Motorola
+ specifications.
+
+`-m68hcs12'
+ This option switches the assembler in the M68HCS12 mode. This
+ mode is similar to `-m68hc12' but specifies to assemble for the
+ 68HCS12 series. The only difference is on the assembling of the
+ `movb' and `movw' instruction when a PC-relative operand is used.
+
+`-mshort'
+ This option controls the ABI and indicates to use a 16-bit integer
+ ABI. It has no effect on the assembled instructions. This is the
+ default.
+
+`-mlong'
+ This option controls the ABI and indicates to use a 32-bit integer
+ ABI.
+
+`-mshort-double'
+ This option controls the ABI and indicates to use a 32-bit float
+ ABI. This is the default.
+
+`-mlong-double'
+ This option controls the ABI and indicates to use a 64-bit float
+ ABI.
+
+`--strict-direct-mode'
+ You can use the `--strict-direct-mode' option to disable the
+ automatic translation of direct page mode addressing into extended
+ mode when the instruction does not support direct mode. For
+ example, the `clr' instruction does not support direct page mode
+ addressing. When it is used with the direct page mode, `as' will
+ ignore it and generate an absolute addressing. This option
+ prevents `as' from doing this, and the wrong usage of the direct
+ page mode will raise an error.
+
+`--short-branches'
+ The `--short-branches' option turns off the translation of
+ relative branches into absolute branches when the branch offset is
+ out of range. By default `as' transforms the relative branch
+ (`bsr', `bgt', `bge', `beq', `bne', `ble', `blt', `bhi', `bcc',
+ `bls', `bcs', `bmi', `bvs', `bvs', `bra') into an absolute branch
+ when the offset is out of the -128 .. 127 range. In that case,
+ the `bsr' instruction is translated into a `jsr', the `bra'
+ instruction is translated into a `jmp' and the conditional
+ branches instructions are inverted and followed by a `jmp'. This
+ option disables these translations and `as' will generate an error
+ if a relative branch is out of range. This option does not affect
+ the optimization associated to the `jbra', `jbsr' and `jbXX'
+ pseudo opcodes.
+
+`--force-long-branches'
+ The `--force-long-branches' option forces the translation of
+ relative branches into absolute branches. This option does not
+ affect the optimization associated to the `jbra', `jbsr' and
+ `jbXX' pseudo opcodes.
+
+`--print-insn-syntax'
+ You can use the `--print-insn-syntax' option to obtain the syntax
+ description of the instruction when an error is detected.
+
+`--print-opcodes'
+ The `--print-opcodes' option prints the list of all the
+ instructions with their syntax. The first item of each line
+ represents the instruction name and the rest of the line indicates
+ the possible operands for that instruction. The list is printed in
+ alphabetical order. Once the list is printed `as' exits.
+
+`--generate-example'
+ The `--generate-example' option is similar to `--print-opcodes'
+ but it generates an example for each instruction instead.
+
+
+File: as.info, Node: M68HC11-Syntax, Next: M68HC11-Modifiers, Prev: M68HC11-Opts, Up: M68HC11-Dependent
+
+9.22.2 Syntax
+-------------
+
+In the M68HC11 syntax, the instruction name comes first and it may be
+followed by one or several operands (up to three). Operands are
+separated by comma (`,'). In the normal mode, `as' will complain if too
+many operands are specified for a given instruction. In the MRI mode
+(turned on with `-M' option), it will treat them as comments. Example:
+
+ inx
+ lda #23
+ bset 2,x #4
+ brclr *bot #8 foo
+
+ The following addressing modes are understood for 68HC11 and 68HC12:
+"Immediate"
+ `#NUMBER'
+
+"Address Register"
+ `NUMBER,X', `NUMBER,Y'
+
+ The NUMBER may be omitted in which case 0 is assumed.
+
+"Direct Addressing mode"
+ `*SYMBOL', or `*DIGITS'
+
+"Absolute"
+ `SYMBOL', or `DIGITS'
+
+ The M68HC12 has other more complex addressing modes. All of them are
+supported and they are represented below:
+
+"Constant Offset Indexed Addressing Mode"
+ `NUMBER,REG'
+
+ The NUMBER may be omitted in which case 0 is assumed. The
+ register can be either `X', `Y', `SP' or `PC'. The assembler will
+ use the smaller post-byte definition according to the constant
+ value (5-bit constant offset, 9-bit constant offset or 16-bit
+ constant offset). If the constant is not known by the assembler
+ it will use the 16-bit constant offset post-byte and the value
+ will be resolved at link time.
+
+"Offset Indexed Indirect"
+ `[NUMBER,REG]'
+
+ The register can be either `X', `Y', `SP' or `PC'.
+
+"Auto Pre-Increment/Pre-Decrement/Post-Increment/Post-Decrement"
+ `NUMBER,-REG' `NUMBER,+REG' `NUMBER,REG-' `NUMBER,REG+'
+
+ The number must be in the range `-8'..`+8' and must not be 0. The
+ register can be either `X', `Y', `SP' or `PC'.
+
+"Accumulator Offset"
+ `ACC,REG'
+
+ The accumulator register can be either `A', `B' or `D'. The
+ register can be either `X', `Y', `SP' or `PC'.
+
+"Accumulator D offset indexed-indirect"
+ `[D,REG]'
+
+ The register can be either `X', `Y', `SP' or `PC'.
+
+
+ For example:
+
+ ldab 1024,sp
+ ldd [10,x]
+ orab 3,+x
+ stab -2,y-
+ ldx a,pc
+ sty [d,sp]
+
+
+File: as.info, Node: M68HC11-Modifiers, Next: M68HC11-Directives, Prev: M68HC11-Syntax, Up: M68HC11-Dependent
+
+9.22.3 Symbolic Operand Modifiers
+---------------------------------
+
+The assembler supports several modifiers when using symbol addresses in
+68HC11 and 68HC12 instruction operands. The general syntax is the
+following:
+
+ %modifier(symbol)
+
+`%addr'
+ This modifier indicates to the assembler and linker to use the
+ 16-bit physical address corresponding to the symbol. This is
+ intended to be used on memory window systems to map a symbol in
+ the memory bank window. If the symbol is in a memory expansion
+ part, the physical address corresponds to the symbol address
+ within the memory bank window. If the symbol is not in a memory
+ expansion part, this is the symbol address (using or not using the
+ %addr modifier has no effect in that case).
+
+`%page'
+ This modifier indicates to use the memory page number corresponding
+ to the symbol. If the symbol is in a memory expansion part, its
+ page number is computed by the linker as a number used to map the
+ page containing the symbol in the memory bank window. If the
+ symbol is not in a memory expansion part, the page number is 0.
+
+`%hi'
+ This modifier indicates to use the 8-bit high part of the physical
+ address of the symbol.
+
+`%lo'
+ This modifier indicates to use the 8-bit low part of the physical
+ address of the symbol.
+
+
+ For example a 68HC12 call to a function `foo_example' stored in
+memory expansion part could be written as follows:
+
+ call %addr(foo_example),%page(foo_example)
+
+ and this is equivalent to
+
+ call foo_example
+
+ And for 68HC11 it could be written as follows:
+
+ ldab #%page(foo_example)
+ stab _page_switch
+ jsr %addr(foo_example)
+
+
+File: as.info, Node: M68HC11-Directives, Next: M68HC11-Float, Prev: M68HC11-Modifiers, Up: M68HC11-Dependent
+
+9.22.4 Assembler Directives
+---------------------------
+
+The 68HC11 and 68HC12 version of `as' have the following specific
+assembler directives:
+
+`.relax'
+ The relax directive is used by the `GNU Compiler' to emit a
+ specific relocation to mark a group of instructions for linker
+ relaxation. The sequence of instructions within the group must be
+ known to the linker so that relaxation can be performed.
+
+`.mode [mshort|mlong|mshort-double|mlong-double]'
+ This directive specifies the ABI. It overrides the `-mshort',
+ `-mlong', `-mshort-double' and `-mlong-double' options.
+
+`.far SYMBOL'
+ This directive marks the symbol as a `far' symbol meaning that it
+ uses a `call/rtc' calling convention as opposed to `jsr/rts'.
+ During a final link, the linker will identify references to the
+ `far' symbol and will verify the proper calling convention.
+
+`.interrupt SYMBOL'
+ This directive marks the symbol as an interrupt entry point. This
+ information is then used by the debugger to correctly unwind the
+ frame across interrupts.
+
+`.xrefb SYMBOL'
+ This directive is defined for compatibility with the
+ `Specification for Motorola 8 and 16-Bit Assembly Language Input
+ Standard' and is ignored.
+
+
+
+File: as.info, Node: M68HC11-Float, Next: M68HC11-opcodes, Prev: M68HC11-Directives, Up: M68HC11-Dependent
+
+9.22.5 Floating Point
+---------------------
+
+Packed decimal (P) format floating literals are not supported. Feel
+free to add the code!
+
+ The floating point formats generated by directives are these.
+
+`.float'
+ `Single' precision floating point constants.
+
+`.double'
+ `Double' precision floating point constants.
+
+`.extend'
+`.ldouble'
+ `Extended' precision (`long double') floating point constants.
+
+
+File: as.info, Node: M68HC11-opcodes, Prev: M68HC11-Float, Up: M68HC11-Dependent
+
+9.22.6 Opcodes
+--------------
+
+* Menu:
+
+* M68HC11-Branch:: Branch Improvement
+
+
+File: as.info, Node: M68HC11-Branch, Up: M68HC11-opcodes
+
+9.22.6.1 Branch Improvement
+...........................
+
+Certain pseudo opcodes are permitted for branch instructions. They
+expand to the shortest branch instruction that reach the target.
+Generally these mnemonics are made by prepending `j' to the start of
+Motorola mnemonic. These pseudo opcodes are not affected by the
+`--short-branches' or `--force-long-branches' options.
+
+ The following table summarizes the pseudo-operations.
+
+ Displacement Width
+ +-------------------------------------------------------------+
+ | Options |
+ | --short-branches --force-long-branches |
+ +--------------------------+----------------------------------+
+ Op |BYTE WORD | BYTE WORD |
+ +--------------------------+----------------------------------+
+ bsr | bsr <pc-rel> <error> | jsr <abs> |
+ bra | bra <pc-rel> <error> | jmp <abs> |
+ jbsr | bsr <pc-rel> jsr <abs> | bsr <pc-rel> jsr <abs> |
+ jbra | bra <pc-rel> jmp <abs> | bra <pc-rel> jmp <abs> |
+ bXX | bXX <pc-rel> <error> | bNX +3; jmp <abs> |
+ jbXX | bXX <pc-rel> bNX +3; | bXX <pc-rel> bNX +3; jmp <abs> |
+ | jmp <abs> | |
+ +--------------------------+----------------------------------+
+ XX: condition
+ NX: negative of condition XX
+
+`jbsr'
+`jbra'
+ These are the simplest jump pseudo-operations; they always map to
+ one particular machine instruction, depending on the displacement
+ to the branch target.
+
+`jbXX'
+ Here, `jbXX' stands for an entire family of pseudo-operations,
+ where XX is a conditional branch or condition-code test. The full
+ list of pseudo-ops in this family is:
+ jbcc jbeq jbge jbgt jbhi jbvs jbpl jblo
+ jbcs jbne jblt jble jbls jbvc jbmi
+
+ For the cases of non-PC relative displacements and long
+ displacements, `as' issues a longer code fragment in terms of NX,
+ the opposite condition to XX. For example, for the non-PC
+ relative case:
+ jbXX foo
+ gives
+ bNXs oof
+ jmp foo
+ oof:
+
+
+
+File: as.info, Node: MicroBlaze-Dependent, Next: MIPS-Dependent, Prev: M68HC11-Dependent, Up: Machine Dependencies
+
+9.23 MicroBlaze Dependent Features
+==================================
+
+ The Xilinx MicroBlaze processor family includes several variants,
+all using the same core instruction set. This chapter covers features
+of the GNU assembler that are specific to the MicroBlaze architecture.
+For details about the MicroBlaze instruction set, please see the
+`MicroBlaze Processor Reference Guide (UG081)' available at
+www.xilinx.com.
+
+* Menu:
+
+* MicroBlaze Directives:: Directives for MicroBlaze Processors.
+
+
+File: as.info, Node: MicroBlaze Directives, Up: MicroBlaze-Dependent
+
+9.23.1 Directives
+-----------------
+
+A number of assembler directives are available for MicroBlaze.
+
+`.data8 EXPRESSION,...'
+ This directive is an alias for `.byte'. Each expression is
+ assembled into an eight-bit value.
+
+`.data16 EXPRESSION,...'
+ This directive is an alias for `.hword'. Each expression is
+ assembled into an 16-bit value.
+
+`.data32 EXPRESSION,...'
+ This directive is an alias for `.word'. Each expression is
+ assembled into an 32-bit value.
+
+`.ent NAME[,LABEL]'
+ This directive is an alias for `.func' denoting the start of
+ function NAME at (optional) LABEL.
+
+`.end NAME[,LABEL]'
+ This directive is an alias for `.endfunc' denoting the end of
+ function NAME.
+
+`.gpword LABEL,...'
+ This directive is an alias for `.rva'. The resolved address of
+ LABEL is stored in the data section.
+
+`.weakext LABEL'
+ Declare that LABEL is a weak external symbol.
+
+`.rodata'
+ Switch to .rodata section. Equivalent to `.section .rodata'
+
+`.sdata2'
+ Switch to .sdata2 section. Equivalent to `.section .sdata2'
+
+`.sdata'
+ Switch to .sdata section. Equivalent to `.section .sdata'
+
+`.bss'
+ Switch to .bss section. Equivalent to `.section .bss'
+
+`.sbss'
+ Switch to .sbss section. Equivalent to `.section .sbss'
+
+
+File: as.info, Node: MIPS-Dependent, Next: MMIX-Dependent, Prev: MicroBlaze-Dependent, Up: Machine Dependencies
+
+9.24 MIPS Dependent Features
+============================
+
+ GNU `as' for MIPS architectures supports several different MIPS
+processors, and MIPS ISA levels I through V, MIPS32, and MIPS64. For
+information about the MIPS instruction set, see `MIPS RISC
+Architecture', by Kane and Heindrich (Prentice-Hall). For an overview
+of MIPS assembly conventions, see "Appendix D: Assembly Language
+Programming" in the same work.
+
+* Menu:
+
+* MIPS Opts:: Assembler options
+* MIPS Object:: ECOFF object code
+* MIPS Stabs:: Directives for debugging information
+* MIPS ISA:: Directives to override the ISA level
+* MIPS symbol sizes:: Directives to override the size of symbols
+* MIPS autoextend:: Directives for extending MIPS 16 bit instructions
+* MIPS insn:: Directive to mark data as an instruction
+* MIPS option stack:: Directives to save and restore options
+* MIPS ASE instruction generation overrides:: Directives to control
+ generation of MIPS ASE instructions
+* MIPS floating-point:: Directives to override floating-point options
+
+
+File: as.info, Node: MIPS Opts, Next: MIPS Object, Up: MIPS-Dependent
+
+9.24.1 Assembler options
+------------------------
+
+The MIPS configurations of GNU `as' support these special options:
+
+`-G NUM'
+ This option sets the largest size of an object that can be
+ referenced implicitly with the `gp' register. It is only accepted
+ for targets that use ECOFF format. The default value is 8.
+
+`-EB'
+`-EL'
+ Any MIPS configuration of `as' can select big-endian or
+ little-endian output at run time (unlike the other GNU development
+ tools, which must be configured for one or the other). Use `-EB'
+ to select big-endian output, and `-EL' for little-endian.
+
+`-KPIC'
+ Generate SVR4-style PIC. This option tells the assembler to
+ generate SVR4-style position-independent macro expansions. It
+ also tells the assembler to mark the output file as PIC.
+
+`-mvxworks-pic'
+ Generate VxWorks PIC. This option tells the assembler to generate
+ VxWorks-style position-independent macro expansions.
+
+`-mips1'
+`-mips2'
+`-mips3'
+`-mips4'
+`-mips5'
+`-mips32'
+`-mips32r2'
+`-mips64'
+`-mips64r2'
+ Generate code for a particular MIPS Instruction Set Architecture
+ level. `-mips1' corresponds to the R2000 and R3000 processors,
+ `-mips2' to the R6000 processor, `-mips3' to the R4000 processor,
+ and `-mips4' to the R8000 and R10000 processors. `-mips5',
+ `-mips32', `-mips32r2', `-mips64', and `-mips64r2' correspond to
+ generic MIPS V, MIPS32, MIPS32 RELEASE 2, MIPS64, and MIPS64
+ RELEASE 2 ISA processors, respectively. You can also switch
+ instruction sets during the assembly; see *Note Directives to
+ override the ISA level: MIPS ISA.
+
+`-mgp32'
+`-mfp32'
+ Some macros have different expansions for 32-bit and 64-bit
+ registers. The register sizes are normally inferred from the ISA
+ and ABI, but these flags force a certain group of registers to be
+ treated as 32 bits wide at all times. `-mgp32' controls the size
+ of general-purpose registers and `-mfp32' controls the size of
+ floating-point registers.
+
+ The `.set gp=32' and `.set fp=32' directives allow the size of
+ registers to be changed for parts of an object. The default value
+ is restored by `.set gp=default' and `.set fp=default'.
+
+ On some MIPS variants there is a 32-bit mode flag; when this flag
+ is set, 64-bit instructions generate a trap. Also, some 32-bit
+ OSes only save the 32-bit registers on a context switch, so it is
+ essential never to use the 64-bit registers.
+
+`-mgp64'
+`-mfp64'
+ Assume that 64-bit registers are available. This is provided in
+ the interests of symmetry with `-mgp32' and `-mfp32'.
+
+ The `.set gp=64' and `.set fp=64' directives allow the size of
+ registers to be changed for parts of an object. The default value
+ is restored by `.set gp=default' and `.set fp=default'.
+
+`-mips16'
+`-no-mips16'
+ Generate code for the MIPS 16 processor. This is equivalent to
+ putting `.set mips16' at the start of the assembly file.
+ `-no-mips16' turns off this option.
+
+`-msmartmips'
+`-mno-smartmips'
+ Enables the SmartMIPS extensions to the MIPS32 instruction set,
+ which provides a number of new instructions which target smartcard
+ and cryptographic applications. This is equivalent to putting
+ `.set smartmips' at the start of the assembly file.
+ `-mno-smartmips' turns off this option.
+
+`-mips3d'
+`-no-mips3d'
+ Generate code for the MIPS-3D Application Specific Extension.
+ This tells the assembler to accept MIPS-3D instructions.
+ `-no-mips3d' turns off this option.
+
+`-mdmx'
+`-no-mdmx'
+ Generate code for the MDMX Application Specific Extension. This
+ tells the assembler to accept MDMX instructions. `-no-mdmx' turns
+ off this option.
+
+`-mdsp'
+`-mno-dsp'
+ Generate code for the DSP Release 1 Application Specific Extension.
+ This tells the assembler to accept DSP Release 1 instructions.
+ `-mno-dsp' turns off this option.
+
+`-mdspr2'
+`-mno-dspr2'
+ Generate code for the DSP Release 2 Application Specific Extension.
+ This option implies -mdsp. This tells the assembler to accept DSP
+ Release 2 instructions. `-mno-dspr2' turns off this option.
+
+`-mmt'
+`-mno-mt'
+ Generate code for the MT Application Specific Extension. This
+ tells the assembler to accept MT instructions. `-mno-mt' turns
+ off this option.
+
+`-mfix7000'
+`-mno-fix7000'
+ Cause nops to be inserted if the read of the destination register
+ of an mfhi or mflo instruction occurs in the following two
+ instructions.
+
+`-mfix-vr4120'
+`-no-mfix-vr4120'
+ Insert nops to work around certain VR4120 errata. This option is
+ intended to be used on GCC-generated code: it is not designed to
+ catch all problems in hand-written assembler code.
+
+`-mfix-vr4130'
+`-no-mfix-vr4130'
+ Insert nops to work around the VR4130 `mflo'/`mfhi' errata.
+
+`-mfix-24k'
+`-no-mfix-24k'
+ Insert nops to work around the 24K `eret'/`deret' errata.
+
+`-m4010'
+`-no-m4010'
+ Generate code for the LSI R4010 chip. This tells the assembler to
+ accept the R4010 specific instructions (`addciu', `ffc', etc.),
+ and to not schedule `nop' instructions around accesses to the `HI'
+ and `LO' registers. `-no-m4010' turns off this option.
+
+`-m4650'
+`-no-m4650'
+ Generate code for the MIPS R4650 chip. This tells the assembler
+ to accept the `mad' and `madu' instruction, and to not schedule
+ `nop' instructions around accesses to the `HI' and `LO' registers.
+ `-no-m4650' turns off this option.
+
+`-m3900'
+`-no-m3900'
+`-m4100'
+`-no-m4100'
+ For each option `-mNNNN', generate code for the MIPS RNNNN chip.
+ This tells the assembler to accept instructions specific to that
+ chip, and to schedule for that chip's hazards.
+
+`-march=CPU'
+ Generate code for a particular MIPS cpu. It is exactly equivalent
+ to `-mCPU', except that there are more value of CPU understood.
+ Valid CPU value are:
+
+ 2000, 3000, 3900, 4000, 4010, 4100, 4111, vr4120, vr4130,
+ vr4181, 4300, 4400, 4600, 4650, 5000, rm5200, rm5230, rm5231,
+ rm5261, rm5721, vr5400, vr5500, 6000, rm7000, 8000, rm9000,
+ 10000, 12000, 14000, 16000, 4kc, 4km, 4kp, 4ksc, 4kec, 4kem,
+ 4kep, 4ksd, m4k, m4kp, 24kc, 24kf2_1, 24kf, 24kf1_1, 24kec,
+ 24kef2_1, 24kef, 24kef1_1, 34kc, 34kf2_1, 34kf, 34kf1_1, 74kc,
+ 74kf2_1, 74kf, 74kf1_1, 74kf3_2, 1004kc, 1004kf2_1, 1004kf,
+ 1004kf1_1, 5kc, 5kf, 20kc, 25kf, sb1, sb1a, loongson2e,
+ loongson2f, octeon, xlr
+
+ For compatibility reasons, `Nx' and `Bfx' are accepted as synonyms
+ for `Nf1_1'. These values are deprecated.
+
+`-mtune=CPU'
+ Schedule and tune for a particular MIPS cpu. Valid CPU values are
+ identical to `-march=CPU'.
+
+`-mabi=ABI'
+ Record which ABI the source code uses. The recognized arguments
+ are: `32', `n32', `o64', `64' and `eabi'.
+
+`-msym32'
+`-mno-sym32'
+ Equivalent to adding `.set sym32' or `.set nosym32' to the
+ beginning of the assembler input. *Note MIPS symbol sizes::.
+
+`-nocpp'
+ This option is ignored. It is accepted for command-line
+ compatibility with other assemblers, which use it to turn off C
+ style preprocessing. With GNU `as', there is no need for
+ `-nocpp', because the GNU assembler itself never runs the C
+ preprocessor.
+
+`-msoft-float'
+`-mhard-float'
+ Disable or enable floating-point instructions. Note that by
+ default floating-point instructions are always allowed even with
+ CPU targets that don't have support for these instructions.
+
+`-msingle-float'
+`-mdouble-float'
+ Disable or enable double-precision floating-point operations. Note
+ that by default double-precision floating-point operations are
+ always allowed even with CPU targets that don't have support for
+ these operations.
+
+`--construct-floats'
+`--no-construct-floats'
+ The `--no-construct-floats' option disables the construction of
+ double width floating point constants by loading the two halves of
+ the value into the two single width floating point registers that
+ make up the double width register. This feature is useful if the
+ processor support the FR bit in its status register, and this bit
+ is known (by the programmer) to be set. This bit prevents the
+ aliasing of the double width register by the single width
+ registers.
+
+ By default `--construct-floats' is selected, allowing construction
+ of these floating point constants.
+
+`--trap'
+`--no-break'
+ `as' automatically macro expands certain division and
+ multiplication instructions to check for overflow and division by
+ zero. This option causes `as' to generate code to take a trap
+ exception rather than a break exception when an error is detected.
+ The trap instructions are only supported at Instruction Set
+ Architecture level 2 and higher.
+
+`--break'
+`--no-trap'
+ Generate code to take a break exception rather than a trap
+ exception when an error is detected. This is the default.
+
+`-mpdr'
+`-mno-pdr'
+ Control generation of `.pdr' sections. Off by default on IRIX, on
+ elsewhere.
+
+`-mshared'
+`-mno-shared'
+ When generating code using the Unix calling conventions (selected
+ by `-KPIC' or `-mcall_shared'), gas will normally generate code
+ which can go into a shared library. The `-mno-shared' option
+ tells gas to generate code which uses the calling convention, but
+ can not go into a shared library. The resulting code is slightly
+ more efficient. This option only affects the handling of the
+ `.cpload' and `.cpsetup' pseudo-ops.
+
+
+File: as.info, Node: MIPS Object, Next: MIPS Stabs, Prev: MIPS Opts, Up: MIPS-Dependent
+
+9.24.2 MIPS ECOFF object code
+-----------------------------
+
+Assembling for a MIPS ECOFF target supports some additional sections
+besides the usual `.text', `.data' and `.bss'. The additional sections
+are `.rdata', used for read-only data, `.sdata', used for small data,
+and `.sbss', used for small common objects.
+
+ When assembling for ECOFF, the assembler uses the `$gp' (`$28')
+register to form the address of a "small object". Any object in the
+`.sdata' or `.sbss' sections is considered "small" in this sense. For
+external objects, or for objects in the `.bss' section, you can use the
+`gcc' `-G' option to control the size of objects addressed via `$gp';
+the default value is 8, meaning that a reference to any object eight
+bytes or smaller uses `$gp'. Passing `-G 0' to `as' prevents it from
+using the `$gp' register on the basis of object size (but the assembler
+uses `$gp' for objects in `.sdata' or `sbss' in any case). The size of
+an object in the `.bss' section is set by the `.comm' or `.lcomm'
+directive that defines it. The size of an external object may be set
+with the `.extern' directive. For example, `.extern sym,4' declares
+that the object at `sym' is 4 bytes in length, whie leaving `sym'
+otherwise undefined.
+
+ Using small ECOFF objects requires linker support, and assumes that
+the `$gp' register is correctly initialized (normally done
+automatically by the startup code). MIPS ECOFF assembly code must not
+modify the `$gp' register.
+
+
+File: as.info, Node: MIPS Stabs, Next: MIPS ISA, Prev: MIPS Object, Up: MIPS-Dependent
+
+9.24.3 Directives for debugging information
+-------------------------------------------
+
+MIPS ECOFF `as' supports several directives used for generating
+debugging information which are not support by traditional MIPS
+assemblers. These are `.def', `.endef', `.dim', `.file', `.scl',
+`.size', `.tag', `.type', `.val', `.stabd', `.stabn', and `.stabs'.
+The debugging information generated by the three `.stab' directives can
+only be read by GDB, not by traditional MIPS debuggers (this
+enhancement is required to fully support C++ debugging). These
+directives are primarily used by compilers, not assembly language
+programmers!
+
+
+File: as.info, Node: MIPS symbol sizes, Next: MIPS autoextend, Prev: MIPS ISA, Up: MIPS-Dependent
+
+9.24.4 Directives to override the size of symbols
+-------------------------------------------------
+
+The n64 ABI allows symbols to have any 64-bit value. Although this
+provides a great deal of flexibility, it means that some macros have
+much longer expansions than their 32-bit counterparts. For example,
+the non-PIC expansion of `dla $4,sym' is usually:
+
+ lui $4,%highest(sym)
+ lui $1,%hi(sym)
+ daddiu $4,$4,%higher(sym)
+ daddiu $1,$1,%lo(sym)
+ dsll32 $4,$4,0
+ daddu $4,$4,$1
+
+ whereas the 32-bit expansion is simply:
+
+ lui $4,%hi(sym)
+ daddiu $4,$4,%lo(sym)
+
+ n64 code is sometimes constructed in such a way that all symbolic
+constants are known to have 32-bit values, and in such cases, it's
+preferable to use the 32-bit expansion instead of the 64-bit expansion.
+
+ You can use the `.set sym32' directive to tell the assembler that,
+from this point on, all expressions of the form `SYMBOL' or `SYMBOL +
+OFFSET' have 32-bit values. For example:
+
+ .set sym32
+ dla $4,sym
+ lw $4,sym+16
+ sw $4,sym+0x8000($4)
+
+ will cause the assembler to treat `sym', `sym+16' and `sym+0x8000'
+as 32-bit values. The handling of non-symbolic addresses is not
+affected.
+
+ The directive `.set nosym32' ends a `.set sym32' block and reverts
+to the normal behavior. It is also possible to change the symbol size
+using the command-line options `-msym32' and `-mno-sym32'.
+
+ These options and directives are always accepted, but at present,
+they have no effect for anything other than n64.
+
+
+File: as.info, Node: MIPS ISA, Next: MIPS symbol sizes, Prev: MIPS Stabs, Up: MIPS-Dependent
+
+9.24.5 Directives to override the ISA level
+-------------------------------------------
+
+GNU `as' supports an additional directive to change the MIPS
+Instruction Set Architecture level on the fly: `.set mipsN'. N should
+be a number from 0 to 5, or 32, 32r2, 64 or 64r2. The values other
+than 0 make the assembler accept instructions for the corresponding ISA
+level, from that point on in the assembly. `.set mipsN' affects not
+only which instructions are permitted, but also how certain macros are
+expanded. `.set mips0' restores the ISA level to its original level:
+either the level you selected with command line options, or the default
+for your configuration. You can use this feature to permit specific
+MIPS3 instructions while assembling in 32 bit mode. Use this directive
+with care!
+
+ The `.set arch=CPU' directive provides even finer control. It
+changes the effective CPU target and allows the assembler to use
+instructions specific to a particular CPU. All CPUs supported by the
+`-march' command line option are also selectable by this directive.
+The original value is restored by `.set arch=default'.
+
+ The directive `.set mips16' puts the assembler into MIPS 16 mode, in
+which it will assemble instructions for the MIPS 16 processor. Use
+`.set nomips16' to return to normal 32 bit mode.
+
+ Traditional MIPS assemblers do not support this directive.
+
+
+File: as.info, Node: MIPS autoextend, Next: MIPS insn, Prev: MIPS symbol sizes, Up: MIPS-Dependent
+
+9.24.6 Directives for extending MIPS 16 bit instructions
+--------------------------------------------------------
+
+By default, MIPS 16 instructions are automatically extended to 32 bits
+when necessary. The directive `.set noautoextend' will turn this off.
+When `.set noautoextend' is in effect, any 32 bit instruction must be
+explicitly extended with the `.e' modifier (e.g., `li.e $4,1000'). The
+directive `.set autoextend' may be used to once again automatically
+extend instructions when necessary.
+
+ This directive is only meaningful when in MIPS 16 mode. Traditional
+MIPS assemblers do not support this directive.
+
+
+File: as.info, Node: MIPS insn, Next: MIPS option stack, Prev: MIPS autoextend, Up: MIPS-Dependent
+
+9.24.7 Directive to mark data as an instruction
+-----------------------------------------------
+
+The `.insn' directive tells `as' that the following data is actually
+instructions. This makes a difference in MIPS 16 mode: when loading
+the address of a label which precedes instructions, `as' automatically
+adds 1 to the value, so that jumping to the loaded address will do the
+right thing.
+
+ The `.global' and `.globl' directives supported by `as' will by
+default mark the symbol as pointing to a region of data not code. This
+means that, for example, any instructions following such a symbol will
+not be disassembled by `objdump' as it will regard them as data. To
+change this behaviour an optional section name can be placed after the
+symbol name in the `.global' directive. If this section exists and is
+known to be a code section, then the symbol will be marked as poiting at
+code not data. Ie the syntax for the directive is:
+
+ `.global SYMBOL[ SECTION][, SYMBOL[ SECTION]] ...',
+
+ Here is a short example:
+
+ .global foo .text, bar, baz .data
+ foo:
+ nop
+ bar:
+ .word 0x0
+ baz:
+ .word 0x1
+
+
+File: as.info, Node: MIPS option stack, Next: MIPS ASE instruction generation overrides, Prev: MIPS insn, Up: MIPS-Dependent
+
+9.24.8 Directives to save and restore options
+---------------------------------------------
+
+The directives `.set push' and `.set pop' may be used to save and
+restore the current settings for all the options which are controlled
+by `.set'. The `.set push' directive saves the current settings on a
+stack. The `.set pop' directive pops the stack and restores the
+settings.
+
+ These directives can be useful inside an macro which must change an
+option such as the ISA level or instruction reordering but does not want
+to change the state of the code which invoked the macro.
+
+ Traditional MIPS assemblers do not support these directives.
+
+
+File: as.info, Node: MIPS ASE instruction generation overrides, Next: MIPS floating-point, Prev: MIPS option stack, Up: MIPS-Dependent
+
+9.24.9 Directives to control generation of MIPS ASE instructions
+----------------------------------------------------------------
+
+The directive `.set mips3d' makes the assembler accept instructions
+from the MIPS-3D Application Specific Extension from that point on in
+the assembly. The `.set nomips3d' directive prevents MIPS-3D
+instructions from being accepted.
+
+ The directive `.set smartmips' makes the assembler accept
+instructions from the SmartMIPS Application Specific Extension to the
+MIPS32 ISA from that point on in the assembly. The `.set nosmartmips'
+directive prevents SmartMIPS instructions from being accepted.
+
+ The directive `.set mdmx' makes the assembler accept instructions
+from the MDMX Application Specific Extension from that point on in the
+assembly. The `.set nomdmx' directive prevents MDMX instructions from
+being accepted.
+
+ The directive `.set dsp' makes the assembler accept instructions
+from the DSP Release 1 Application Specific Extension from that point
+on in the assembly. The `.set nodsp' directive prevents DSP Release 1
+instructions from being accepted.
+
+ The directive `.set dspr2' makes the assembler accept instructions
+from the DSP Release 2 Application Specific Extension from that point
+on in the assembly. This dirctive implies `.set dsp'. The `.set
+nodspr2' directive prevents DSP Release 2 instructions from being
+accepted.
+
+ The directive `.set mt' makes the assembler accept instructions from
+the MT Application Specific Extension from that point on in the
+assembly. The `.set nomt' directive prevents MT instructions from
+being accepted.
+
+ Traditional MIPS assemblers do not support these directives.
+
+
+File: as.info, Node: MIPS floating-point, Prev: MIPS ASE instruction generation overrides, Up: MIPS-Dependent
+
+9.24.10 Directives to override floating-point options
+-----------------------------------------------------
+
+The directives `.set softfloat' and `.set hardfloat' provide finer
+control of disabling and enabling float-point instructions. These
+directives always override the default (that hard-float instructions
+are accepted) or the command-line options (`-msoft-float' and
+`-mhard-float').
+
+ The directives `.set singlefloat' and `.set doublefloat' provide
+finer control of disabling and enabling double-precision float-point
+operations. These directives always override the default (that
+double-precision operations are accepted) or the command-line options
+(`-msingle-float' and `-mdouble-float').
+
+ Traditional MIPS assemblers do not support these directives.
+
+
+File: as.info, Node: MMIX-Dependent, Next: MSP430-Dependent, Prev: MIPS-Dependent, Up: Machine Dependencies
+
+9.25 MMIX Dependent Features
+============================
+
+* Menu:
+
+* MMIX-Opts:: Command-line Options
+* MMIX-Expand:: Instruction expansion
+* MMIX-Syntax:: Syntax
+* MMIX-mmixal:: Differences to `mmixal' syntax and semantics
+
+
+File: as.info, Node: MMIX-Opts, Next: MMIX-Expand, Up: MMIX-Dependent
+
+9.25.1 Command-line Options
+---------------------------
+
+The MMIX version of `as' has some machine-dependent options.
+
+ When `--fixed-special-register-names' is specified, only the register
+names specified in *Note MMIX-Regs:: are recognized in the instructions
+`PUT' and `GET'.
+
+ You can use the `--globalize-symbols' to make all symbols global.
+This option is useful when splitting up a `mmixal' program into several
+files.
+
+ The `--gnu-syntax' turns off most syntax compatibility with
+`mmixal'. Its usability is currently doubtful.
+
+ The `--relax' option is not fully supported, but will eventually make
+the object file prepared for linker relaxation.
+
+ If you want to avoid inadvertently calling a predefined symbol and
+would rather get an error, for example when using `as' with a compiler
+or other machine-generated code, specify `--no-predefined-syms'. This
+turns off built-in predefined definitions of all such symbols,
+including rounding-mode symbols, segment symbols, `BIT' symbols, and
+`TRAP' symbols used in `mmix' "system calls". It also turns off
+predefined special-register names, except when used in `PUT' and `GET'
+instructions.
+
+ By default, some instructions are expanded to fit the size of the
+operand or an external symbol (*note MMIX-Expand::). By passing
+`--no-expand', no such expansion will be done, instead causing errors
+at link time if the operand does not fit.
+
+ The `mmixal' documentation (*note mmixsite::) specifies that global
+registers allocated with the `GREG' directive (*note MMIX-greg::) and
+initialized to the same non-zero value, will refer to the same global
+register. This isn't strictly enforceable in `as' since the final
+addresses aren't known until link-time, but it will do an effort unless
+the `--no-merge-gregs' option is specified. (Register merging isn't
+yet implemented in `ld'.)
+
+ `as' will warn every time it expands an instruction to fit an
+operand unless the option `-x' is specified. It is believed that this
+behaviour is more useful than just mimicking `mmixal''s behaviour, in
+which instructions are only expanded if the `-x' option is specified,
+and assembly fails otherwise, when an instruction needs to be expanded.
+It needs to be kept in mind that `mmixal' is both an assembler and
+linker, while `as' will expand instructions that at link stage can be
+contracted. (Though linker relaxation isn't yet implemented in `ld'.)
+The option `-x' also imples `--linker-allocated-gregs'.
+
+ If instruction expansion is enabled, `as' can expand a `PUSHJ'
+instruction into a series of instructions. The shortest expansion is
+to not expand it, but just mark the call as redirectable to a stub,
+which `ld' creates at link-time, but only if the original `PUSHJ'
+instruction is found not to reach the target. The stub consists of the
+necessary instructions to form a jump to the target. This happens if
+`as' can assert that the `PUSHJ' instruction can reach such a stub.
+The option `--no-pushj-stubs' disables this shorter expansion, and the
+longer series of instructions is then created at assembly-time. The
+option `--no-stubs' is a synonym, intended for compatibility with
+future releases, where generation of stubs for other instructions may
+be implemented.
+
+ Usually a two-operand-expression (*note GREG-base::) without a
+matching `GREG' directive is treated as an error by `as'. When the
+option `--linker-allocated-gregs' is in effect, they are instead passed
+through to the linker, which will allocate as many global registers as
+is needed.
+
+
+File: as.info, Node: MMIX-Expand, Next: MMIX-Syntax, Prev: MMIX-Opts, Up: MMIX-Dependent
+
+9.25.2 Instruction expansion
+----------------------------
+
+When `as' encounters an instruction with an operand that is either not
+known or does not fit the operand size of the instruction, `as' (and
+`ld') will expand the instruction into a sequence of instructions
+semantically equivalent to the operand fitting the instruction.
+Expansion will take place for the following instructions:
+
+`GETA'
+ Expands to a sequence of four instructions: `SETL', `INCML',
+ `INCMH' and `INCH'. The operand must be a multiple of four.
+
+Conditional branches
+ A branch instruction is turned into a branch with the complemented
+ condition and prediction bit over five instructions; four
+ instructions setting `$255' to the operand value, which like with
+ `GETA' must be a multiple of four, and a final `GO $255,$255,0'.
+
+`PUSHJ'
+ Similar to expansion for conditional branches; four instructions
+ set `$255' to the operand value, followed by a `PUSHGO
+ $255,$255,0'.
+
+`JMP'
+ Similar to conditional branches and `PUSHJ'. The final instruction
+ is `GO $255,$255,0'.
+
+ The linker `ld' is expected to shrink these expansions for code
+assembled with `--relax' (though not currently implemented).
+
+
+File: as.info, Node: MMIX-Syntax, Next: MMIX-mmixal, Prev: MMIX-Expand, Up: MMIX-Dependent
+
+9.25.3 Syntax
+-------------
+
+The assembly syntax is supposed to be upward compatible with that
+described in Sections 1.3 and 1.4 of `The Art of Computer Programming,
+Volume 1'. Draft versions of those chapters as well as other MMIX
+information is located at
+`http://www-cs-faculty.stanford.edu/~knuth/mmix-news.html'. Most code
+examples from the mmixal package located there should work unmodified
+when assembled and linked as single files, with a few noteworthy
+exceptions (*note MMIX-mmixal::).
+
+ Before an instruction is emitted, the current location is aligned to
+the next four-byte boundary. If a label is defined at the beginning of
+the line, its value will be the aligned value.
+
+ In addition to the traditional hex-prefix `0x', a hexadecimal number
+can also be specified by the prefix character `#'.
+
+ After all operands to an MMIX instruction or directive have been
+specified, the rest of the line is ignored, treated as a comment.
+
+* Menu:
+
+* MMIX-Chars:: Special Characters
+* MMIX-Symbols:: Symbols
+* MMIX-Regs:: Register Names
+* MMIX-Pseudos:: Assembler Directives
+
+
+File: as.info, Node: MMIX-Chars, Next: MMIX-Symbols, Up: MMIX-Syntax
+
+9.25.3.1 Special Characters
+...........................
+
+The characters `*' and `#' are line comment characters; each start a
+comment at the beginning of a line, but only at the beginning of a
+line. A `#' prefixes a hexadecimal number if found elsewhere on a line.
+
+ Two other characters, `%' and `!', each start a comment anywhere on
+the line. Thus you can't use the `modulus' and `not' operators in
+expressions normally associated with these two characters.
+
+ A `;' is a line separator, treated as a new-line, so separate
+instructions can be specified on a single line.
+
+
+File: as.info, Node: MMIX-Symbols, Next: MMIX-Regs, Prev: MMIX-Chars, Up: MMIX-Syntax
+
+9.25.3.2 Symbols
+................
+
+The character `:' is permitted in identifiers. There are two
+exceptions to it being treated as any other symbol character: if a
+symbol begins with `:', it means that the symbol is in the global
+namespace and that the current prefix should not be prepended to that
+symbol (*note MMIX-prefix::). The `:' is then not considered part of
+the symbol. For a symbol in the label position (first on a line), a `:'
+at the end of a symbol is silently stripped off. A label is permitted,
+but not required, to be followed by a `:', as with many other assembly
+formats.
+
+ The character `@' in an expression, is a synonym for `.', the
+current location.
+
+ In addition to the common forward and backward local symbol formats
+(*note Symbol Names::), they can be specified with upper-case `B' and
+`F', as in `8B' and `9F'. A local label defined for the current
+position is written with a `H' appended to the number:
+ 3H LDB $0,$1,2
+ This and traditional local-label formats cannot be mixed: a label
+must be defined and referred to using the same format.
+
+ There's a minor caveat: just as for the ordinary local symbols, the
+local symbols are translated into ordinary symbols using control
+characters are to hide the ordinal number of the symbol.
+Unfortunately, these symbols are not translated back in error messages.
+Thus you may see confusing error messages when local symbols are used.
+Control characters `\003' (control-C) and `\004' (control-D) are used
+for the MMIX-specific local-symbol syntax.
+
+ The symbol `Main' is handled specially; it is always global.
+
+ By defining the symbols `__.MMIX.start..text' and
+`__.MMIX.start..data', the address of respectively the `.text' and
+`.data' segments of the final program can be defined, though when
+linking more than one object file, the code or data in the object file
+containing the symbol is not guaranteed to be start at that position;
+just the final executable. *Note MMIX-loc::.
+
+
+File: as.info, Node: MMIX-Regs, Next: MMIX-Pseudos, Prev: MMIX-Symbols, Up: MMIX-Syntax
+
+9.25.3.3 Register names
+.......................
+
+Local and global registers are specified as `$0' to `$255'. The
+recognized special register names are `rJ', `rA', `rB', `rC', `rD',
+`rE', `rF', `rG', `rH', `rI', `rK', `rL', `rM', `rN', `rO', `rP', `rQ',
+`rR', `rS', `rT', `rU', `rV', `rW', `rX', `rY', `rZ', `rBB', `rTT',
+`rWW', `rXX', `rYY' and `rZZ'. A leading `:' is optional for special
+register names.
+
+ Local and global symbols can be equated to register names and used in
+place of ordinary registers.
+
+ Similarly for special registers, local and global symbols can be
+used. Also, symbols equated from numbers and constant expressions are
+allowed in place of a special register, except when either of the
+options `--no-predefined-syms' and `--fixed-special-register-names' are
+specified. Then only the special register names above are allowed for
+the instructions having a special register operand; `GET' and `PUT'.
+
+
+File: as.info, Node: MMIX-Pseudos, Prev: MMIX-Regs, Up: MMIX-Syntax
+
+9.25.3.4 Assembler Directives
+.............................
+
+`LOC'
+ The `LOC' directive sets the current location to the value of the
+ operand field, which may include changing sections. If the
+ operand is a constant, the section is set to either `.data' if the
+ value is `0x2000000000000000' or larger, else it is set to `.text'.
+ Within a section, the current location may only be changed to
+ monotonically higher addresses. A LOC expression must be a
+ previously defined symbol or a "pure" constant.
+
+ An example, which sets the label PREV to the current location, and
+ updates the current location to eight bytes forward:
+ prev LOC @+8
+
+ When a LOC has a constant as its operand, a symbol
+ `__.MMIX.start..text' or `__.MMIX.start..data' is defined
+ depending on the address as mentioned above. Each such symbol is
+ interpreted as special by the linker, locating the section at that
+ address. Note that if multiple files are linked, the first object
+ file with that section will be mapped to that address (not
+ necessarily the file with the LOC definition).
+
+`LOCAL'
+ Example:
+ LOCAL external_symbol
+ LOCAL 42
+ .local asymbol
+
+ This directive-operation generates a link-time assertion that the
+ operand does not correspond to a global register. The operand is
+ an expression that at link-time resolves to a register symbol or a
+ number. A number is treated as the register having that number.
+ There is one restriction on the use of this directive: the
+ pseudo-directive must be placed in a section with contents, code
+ or data.
+
+`IS'
+ The `IS' directive:
+ asymbol IS an_expression
+ sets the symbol `asymbol' to `an_expression'. A symbol may not be
+ set more than once using this directive. Local labels may be set
+ using this directive, for example:
+ 5H IS @+4
+
+`GREG'
+ This directive reserves a global register, gives it an initial
+ value and optionally gives it a symbolic name. Some examples:
+
+ areg GREG
+ breg GREG data_value
+ GREG data_buffer
+ .greg creg, another_data_value
+
+ The symbolic register name can be used in place of a (non-special)
+ register. If a value isn't provided, it defaults to zero. Unless
+ the option `--no-merge-gregs' is specified, non-zero registers
+ allocated with this directive may be eliminated by `as'; another
+ register with the same value used in its place. Any of the
+ instructions `CSWAP', `GO', `LDA', `LDBU', `LDB', `LDHT', `LDOU',
+ `LDO', `LDSF', `LDTU', `LDT', `LDUNC', `LDVTS', `LDWU', `LDW',
+ `PREGO', `PRELD', `PREST', `PUSHGO', `STBU', `STB', `STCO', `STHT',
+ `STOU', `STSF', `STTU', `STT', `STUNC', `SYNCD', `SYNCID', can
+ have a value nearby an initial value in place of its second and
+ third operands. Here, "nearby" is defined as within the range
+ 0...255 from the initial value of such an allocated register.
+
+ buffer1 BYTE 0,0,0,0,0
+ buffer2 BYTE 0,0,0,0,0
+ ...
+ GREG buffer1
+ LDOU $42,buffer2
+ In the example above, the `Y' field of the `LDOUI' instruction
+ (LDOU with a constant Z) will be replaced with the global register
+ allocated for `buffer1', and the `Z' field will have the value 5,
+ the offset from `buffer1' to `buffer2'. The result is equivalent
+ to this code:
+ buffer1 BYTE 0,0,0,0,0
+ buffer2 BYTE 0,0,0,0,0
+ ...
+ tmpreg GREG buffer1
+ LDOU $42,tmpreg,(buffer2-buffer1)
+
+ Global registers allocated with this directive are allocated in
+ order higher-to-lower within a file. Other than that, the exact
+ order of register allocation and elimination is undefined. For
+ example, the order is undefined when more than one file with such
+ directives are linked together. With the options `-x' and
+ `--linker-allocated-gregs', `GREG' directives for two-operand
+ cases like the one mentioned above can be omitted. Sufficient
+ global registers will then be allocated by the linker.
+
+`BYTE'
+ The `BYTE' directive takes a series of operands separated by a
+ comma. If an operand is a string (*note Strings::), each
+ character of that string is emitted as a byte. Other operands
+ must be constant expressions without forward references, in the
+ range 0...255. If you need operands having expressions with
+ forward references, use `.byte' (*note Byte::). An operand can be
+ omitted, defaulting to a zero value.
+
+`WYDE'
+`TETRA'
+`OCTA'
+ The directives `WYDE', `TETRA' and `OCTA' emit constants of two,
+ four and eight bytes size respectively. Before anything else
+ happens for the directive, the current location is aligned to the
+ respective constant-size boundary. If a label is defined at the
+ beginning of the line, its value will be that after the alignment.
+ A single operand can be omitted, defaulting to a zero value
+ emitted for the directive. Operands can be expressed as strings
+ (*note Strings::), in which case each character in the string is
+ emitted as a separate constant of the size indicated by the
+ directive.
+
+`PREFIX'
+ The `PREFIX' directive sets a symbol name prefix to be prepended to
+ all symbols (except local symbols, *note MMIX-Symbols::), that are
+ not prefixed with `:', until the next `PREFIX' directive. Such
+ prefixes accumulate. For example,
+ PREFIX a
+ PREFIX b
+ c IS 0
+ defines a symbol `abc' with the value 0.
+
+`BSPEC'
+`ESPEC'
+ A pair of `BSPEC' and `ESPEC' directives delimit a section of
+ special contents (without specified semantics). Example:
+ BSPEC 42
+ TETRA 1,2,3
+ ESPEC
+ The single operand to `BSPEC' must be number in the range 0...255.
+ The `BSPEC' number 80 is used by the GNU binutils implementation.
+
+
+File: as.info, Node: MMIX-mmixal, Prev: MMIX-Syntax, Up: MMIX-Dependent
+
+9.25.4 Differences to `mmixal'
+------------------------------
+
+The binutils `as' and `ld' combination has a few differences in
+function compared to `mmixal' (*note mmixsite::).
+
+ The replacement of a symbol with a GREG-allocated register (*note
+GREG-base::) is not handled the exactly same way in `as' as in
+`mmixal'. This is apparent in the `mmixal' example file `inout.mms',
+where different registers with different offsets, eventually yielding
+the same address, are used in the first instruction. This type of
+difference should however not affect the function of any program unless
+it has specific assumptions about the allocated register number.
+
+ Line numbers (in the `mmo' object format) are currently not
+supported.
+
+ Expression operator precedence is not that of mmixal: operator
+precedence is that of the C programming language. It's recommended to
+use parentheses to explicitly specify wanted operator precedence
+whenever more than one type of operators are used.
+
+ The serialize unary operator `&', the fractional division operator
+`//', the logical not operator `!' and the modulus operator `%' are not
+available.
+
+ Symbols are not global by default, unless the option
+`--globalize-symbols' is passed. Use the `.global' directive to
+globalize symbols (*note Global::).
+
+ Operand syntax is a bit stricter with `as' than `mmixal'. For
+example, you can't say `addu 1,2,3', instead you must write `addu
+$1,$2,3'.
+
+ You can't LOC to a lower address than those already visited (i.e.,
+"backwards").
+
+ A LOC directive must come before any emitted code.
+
+ Predefined symbols are visible as file-local symbols after use. (In
+the ELF file, that is--the linked mmo file has no notion of a file-local
+symbol.)
+
+ Some mapping of constant expressions to sections in LOC expressions
+is attempted, but that functionality is easily confused and should be
+avoided unless compatibility with `mmixal' is required. A LOC
+expression to `0x2000000000000000' or higher, maps to the `.data'
+section and lower addresses map to the `.text' section (*note
+MMIX-loc::).
+
+ The code and data areas are each contiguous. Sparse programs with
+far-away LOC directives will take up the same amount of space as a
+contiguous program with zeros filled in the gaps between the LOC
+directives. If you need sparse programs, you might try and get the
+wanted effect with a linker script and splitting up the code parts into
+sections (*note Section::). Assembly code for this, to be compatible
+with `mmixal', would look something like:
+ .if 0
+ LOC away_expression
+ .else
+ .section away,"ax"
+ .fi
+ `as' will not execute the LOC directive and `mmixal' ignores the
+lines with `.'. This construct can be used generally to help
+compatibility.
+
+ Symbols can't be defined twice-not even to the same value.
+
+ Instruction mnemonics are recognized case-insensitive, though the
+`IS' and `GREG' pseudo-operations must be specified in upper-case
+characters.
+
+ There's no unicode support.
+
+ The following is a list of programs in `mmix.tar.gz', available at
+`http://www-cs-faculty.stanford.edu/~knuth/mmix-news.html', last
+checked with the version dated 2001-08-25 (md5sum
+c393470cfc86fac040487d22d2bf0172) that assemble with `mmixal' but do
+not assemble with `as':
+
+`silly.mms'
+ LOC to a previous address.
+
+`sim.mms'
+ Redefines symbol `Done'.
+
+`test.mms'
+ Uses the serial operator `&'.
+
+
+File: as.info, Node: MSP430-Dependent, Next: SH-Dependent, Prev: MMIX-Dependent, Up: Machine Dependencies
+
+9.26 MSP 430 Dependent Features
+===============================
+
+* Menu:
+
+* MSP430 Options:: Options
+* MSP430 Syntax:: Syntax
+* MSP430 Floating Point:: Floating Point
+* MSP430 Directives:: MSP 430 Machine Directives
+* MSP430 Opcodes:: Opcodes
+* MSP430 Profiling Capability:: Profiling Capability
+
+
+File: as.info, Node: MSP430 Options, Next: MSP430 Syntax, Up: MSP430-Dependent
+
+9.26.1 Options
+--------------
+
+`-m'
+ select the mpu arch. Currently has no effect.
+
+`-mP'
+ enables polymorph instructions handler.
+
+`-mQ'
+ enables relaxation at assembly time. DANGEROUS!
+
+
+
+File: as.info, Node: MSP430 Syntax, Next: MSP430 Floating Point, Prev: MSP430 Options, Up: MSP430-Dependent
+
+9.26.2 Syntax
+-------------
+
+* Menu:
+
+* MSP430-Macros:: Macros
+* MSP430-Chars:: Special Characters
+* MSP430-Regs:: Register Names
+* MSP430-Ext:: Assembler Extensions
+
+
+File: as.info, Node: MSP430-Macros, Next: MSP430-Chars, Up: MSP430 Syntax
+
+9.26.2.1 Macros
+...............
+
+The macro syntax used on the MSP 430 is like that described in the MSP
+430 Family Assembler Specification. Normal `as' macros should still
+work.
+
+ Additional built-in macros are:
+
+`llo(exp)'
+ Extracts least significant word from 32-bit expression 'exp'.
+
+`lhi(exp)'
+ Extracts most significant word from 32-bit expression 'exp'.
+
+`hlo(exp)'
+ Extracts 3rd word from 64-bit expression 'exp'.
+
+`hhi(exp)'
+ Extracts 4rd word from 64-bit expression 'exp'.
+
+
+ They normally being used as an immediate source operand.
+ mov #llo(1), r10 ; == mov #1, r10
+ mov #lhi(1), r10 ; == mov #0, r10
+
+
+File: as.info, Node: MSP430-Chars, Next: MSP430-Regs, Prev: MSP430-Macros, Up: MSP430 Syntax
+
+9.26.2.2 Special Characters
+...........................
+
+`;' is the line comment character.
+
+ The character `$' in jump instructions indicates current location and
+implemented only for TI syntax compatibility.
+
+
+File: as.info, Node: MSP430-Regs, Next: MSP430-Ext, Prev: MSP430-Chars, Up: MSP430 Syntax
+
+9.26.2.3 Register Names
+.......................
+
+General-purpose registers are represented by predefined symbols of the
+form `rN' (for global registers), where N represents a number between
+`0' and `15'. The leading letters may be in either upper or lower
+case; for example, `r13' and `R7' are both valid register names.
+
+ Register names `PC', `SP' and `SR' cannot be used as register names
+and will be treated as variables. Use `r0', `r1', and `r2' instead.
+
+
+File: as.info, Node: MSP430-Ext, Prev: MSP430-Regs, Up: MSP430 Syntax
+
+9.26.2.4 Assembler Extensions
+.............................
+
+`@rN'
+ As destination operand being treated as `0(rn)'
+
+`0(rN)'
+ As source operand being treated as `@rn'
+
+`jCOND +N'
+ Skips next N bytes followed by jump instruction and equivalent to
+ `jCOND $+N+2'
+
+
+ Also, there are some instructions, which cannot be found in other
+assemblers. These are branch instructions, which has different opcodes
+upon jump distance. They all got PC relative addressing mode.
+
+`beq label'
+ A polymorph instruction which is `jeq label' in case if jump
+ distance within allowed range for cpu's jump instruction. If not,
+ this unrolls into a sequence of
+ jne $+6
+ br label
+
+`bne label'
+ A polymorph instruction which is `jne label' or `jeq +4; br label'
+
+`blt label'
+ A polymorph instruction which is `jl label' or `jge +4; br label'
+
+`bltn label'
+ A polymorph instruction which is `jn label' or `jn +2; jmp +4; br
+ label'
+
+`bltu label'
+ A polymorph instruction which is `jlo label' or `jhs +2; br label'
+
+`bge label'
+ A polymorph instruction which is `jge label' or `jl +4; br label'
+
+`bgeu label'
+ A polymorph instruction which is `jhs label' or `jlo +4; br label'
+
+`bgt label'
+ A polymorph instruction which is `jeq +2; jge label' or `jeq +6;
+ jl +4; br label'
+
+`bgtu label'
+ A polymorph instruction which is `jeq +2; jhs label' or `jeq +6;
+ jlo +4; br label'
+
+`bleu label'
+ A polymorph instruction which is `jeq label; jlo label' or `jeq
+ +2; jhs +4; br label'
+
+`ble label'
+ A polymorph instruction which is `jeq label; jl label' or `jeq
+ +2; jge +4; br label'
+
+`jump label'
+ A polymorph instruction which is `jmp label' or `br label'
+
+
+File: as.info, Node: MSP430 Floating Point, Next: MSP430 Directives, Prev: MSP430 Syntax, Up: MSP430-Dependent
+
+9.26.3 Floating Point
+---------------------
+
+The MSP 430 family uses IEEE 32-bit floating-point numbers.
+
+
+File: as.info, Node: MSP430 Directives, Next: MSP430 Opcodes, Prev: MSP430 Floating Point, Up: MSP430-Dependent
+
+9.26.4 MSP 430 Machine Directives
+---------------------------------
+
+`.file'
+ This directive is ignored; it is accepted for compatibility with
+ other MSP 430 assemblers.
+
+ _Warning:_ in other versions of the GNU assembler, `.file' is
+ used for the directive called `.app-file' in the MSP 430
+ support.
+
+`.line'
+ This directive is ignored; it is accepted for compatibility with
+ other MSP 430 assemblers.
+
+`.arch'
+ Currently this directive is ignored; it is accepted for
+ compatibility with other MSP 430 assemblers.
+
+`.profiler'
+ This directive instructs assembler to add new profile entry to the
+ object file.
+
+
+
+File: as.info, Node: MSP430 Opcodes, Next: MSP430 Profiling Capability, Prev: MSP430 Directives, Up: MSP430-Dependent
+
+9.26.5 Opcodes
+--------------
+
+`as' implements all the standard MSP 430 opcodes. No additional
+pseudo-instructions are needed on this family.
+
+ For information on the 430 machine instruction set, see `MSP430
+User's Manual, document slau049d', Texas Instrument, Inc.
+
+
+File: as.info, Node: MSP430 Profiling Capability, Prev: MSP430 Opcodes, Up: MSP430-Dependent
+
+9.26.6 Profiling Capability
+---------------------------
+
+It is a performance hit to use gcc's profiling approach for this tiny
+target. Even more - jtag hardware facility does not perform any
+profiling functions. However we've got gdb's built-in simulator where
+we can do anything.
+
+ We define new section `.profiler' which holds all profiling
+information. We define new pseudo operation `.profiler' which will
+instruct assembler to add new profile entry to the object file. Profile
+should take place at the present address.
+
+ Pseudo operation format:
+
+ `.profiler flags,function_to_profile [, cycle_corrector, extra]'
+
+ where:
+
+ `flags' is a combination of the following characters:
+
+ `s'
+ function entry
+
+ `x'
+ function exit
+
+ `i'
+ function is in init section
+
+ `f'
+ function is in fini section
+
+ `l'
+ library call
+
+ `c'
+ libc standard call
+
+ `d'
+ stack value demand
+
+ `I'
+ interrupt service routine
+
+ `P'
+ prologue start
+
+ `p'
+ prologue end
+
+ `E'
+ epilogue start
+
+ `e'
+ epilogue end
+
+ `j'
+ long jump / sjlj unwind
+
+ `a'
+ an arbitrary code fragment
+
+ `t'
+ extra parameter saved (a constant value like frame size)
+
+`function_to_profile'
+ a function address
+
+`cycle_corrector'
+ a value which should be added to the cycle counter, zero if
+ omitted.
+
+`extra'
+ any extra parameter, zero if omitted.
+
+
+ For example:
+ .global fxx
+ .type fxx,@function
+ fxx:
+ .LFrameOffset_fxx=0x08
+ .profiler "scdP", fxx ; function entry.
+ ; we also demand stack value to be saved
+ push r11
+ push r10
+ push r9
+ push r8
+ .profiler "cdpt",fxx,0, .LFrameOffset_fxx ; check stack value at this point
+ ; (this is a prologue end)
+ ; note, that spare var filled with
+ ; the farme size
+ mov r15,r8
+ ...
+ .profiler cdE,fxx ; check stack
+ pop r8
+ pop r9
+ pop r10
+ pop r11
+ .profiler xcde,fxx,3 ; exit adds 3 to the cycle counter
+ ret ; cause 'ret' insn takes 3 cycles
+
+
+File: as.info, Node: PDP-11-Dependent, Next: PJ-Dependent, Prev: SH64-Dependent, Up: Machine Dependencies
+
+9.27 PDP-11 Dependent Features
+==============================
+
+* Menu:
+
+* PDP-11-Options:: Options
+* PDP-11-Pseudos:: Assembler Directives
+* PDP-11-Syntax:: DEC Syntax versus BSD Syntax
+* PDP-11-Mnemonics:: Instruction Naming
+* PDP-11-Synthetic:: Synthetic Instructions
+
+
+File: as.info, Node: PDP-11-Options, Next: PDP-11-Pseudos, Up: PDP-11-Dependent
+
+9.27.1 Options
+--------------
+
+The PDP-11 version of `as' has a rich set of machine dependent options.
+
+9.27.1.1 Code Generation Options
+................................
+
+`-mpic | -mno-pic'
+ Generate position-independent (or position-dependent) code.
+
+ The default is to generate position-independent code.
+
+9.27.1.2 Instruction Set Extension Options
+..........................................
+
+These options enables or disables the use of extensions over the base
+line instruction set as introduced by the first PDP-11 CPU: the KA11.
+Most options come in two variants: a `-m'EXTENSION that enables
+EXTENSION, and a `-mno-'EXTENSION that disables EXTENSION.
+
+ The default is to enable all extensions.
+
+`-mall | -mall-extensions'
+ Enable all instruction set extensions.
+
+`-mno-extensions'
+ Disable all instruction set extensions.
+
+`-mcis | -mno-cis'
+ Enable (or disable) the use of the commercial instruction set,
+ which consists of these instructions: `ADDNI', `ADDN', `ADDPI',
+ `ADDP', `ASHNI', `ASHN', `ASHPI', `ASHP', `CMPCI', `CMPC',
+ `CMPNI', `CMPN', `CMPPI', `CMPP', `CVTLNI', `CVTLN', `CVTLPI',
+ `CVTLP', `CVTNLI', `CVTNL', `CVTNPI', `CVTNP', `CVTPLI', `CVTPL',
+ `CVTPNI', `CVTPN', `DIVPI', `DIVP', `L2DR', `L3DR', `LOCCI',
+ `LOCC', `MATCI', `MATC', `MOVCI', `MOVC', `MOVRCI', `MOVRC',
+ `MOVTCI', `MOVTC', `MULPI', `MULP', `SCANCI', `SCANC', `SKPCI',
+ `SKPC', `SPANCI', `SPANC', `SUBNI', `SUBN', `SUBPI', and `SUBP'.
+
+`-mcsm | -mno-csm'
+ Enable (or disable) the use of the `CSM' instruction.
+
+`-meis | -mno-eis'
+ Enable (or disable) the use of the extended instruction set, which
+ consists of these instructions: `ASHC', `ASH', `DIV', `MARK',
+ `MUL', `RTT', `SOB' `SXT', and `XOR'.
+
+`-mfis | -mkev11'
+`-mno-fis | -mno-kev11'
+ Enable (or disable) the use of the KEV11 floating-point
+ instructions: `FADD', `FDIV', `FMUL', and `FSUB'.
+
+`-mfpp | -mfpu | -mfp-11'
+`-mno-fpp | -mno-fpu | -mno-fp-11'
+ Enable (or disable) the use of FP-11 floating-point instructions:
+ `ABSF', `ADDF', `CFCC', `CLRF', `CMPF', `DIVF', `LDCFF', `LDCIF',
+ `LDEXP', `LDF', `LDFPS', `MODF', `MULF', `NEGF', `SETD', `SETF',
+ `SETI', `SETL', `STCFF', `STCFI', `STEXP', `STF', `STFPS', `STST',
+ `SUBF', and `TSTF'.
+
+`-mlimited-eis | -mno-limited-eis'
+ Enable (or disable) the use of the limited extended instruction
+ set: `MARK', `RTT', `SOB', `SXT', and `XOR'.
+
+ The -mno-limited-eis options also implies -mno-eis.
+
+`-mmfpt | -mno-mfpt'
+ Enable (or disable) the use of the `MFPT' instruction.
+
+`-mmultiproc | -mno-multiproc'
+ Enable (or disable) the use of multiprocessor instructions:
+ `TSTSET' and `WRTLCK'.
+
+`-mmxps | -mno-mxps'
+ Enable (or disable) the use of the `MFPS' and `MTPS' instructions.
+
+`-mspl | -mno-spl'
+ Enable (or disable) the use of the `SPL' instruction.
+
+ Enable (or disable) the use of the microcode instructions: `LDUB',
+ `MED', and `XFC'.
+
+9.27.1.3 CPU Model Options
+..........................
+
+These options enable the instruction set extensions supported by a
+particular CPU, and disables all other extensions.
+
+`-mka11'
+ KA11 CPU. Base line instruction set only.
+
+`-mkb11'
+ KB11 CPU. Enable extended instruction set and `SPL'.
+
+`-mkd11a'
+ KD11-A CPU. Enable limited extended instruction set.
+
+`-mkd11b'
+ KD11-B CPU. Base line instruction set only.
+
+`-mkd11d'
+ KD11-D CPU. Base line instruction set only.
+
+`-mkd11e'
+ KD11-E CPU. Enable extended instruction set, `MFPS', and `MTPS'.
+
+`-mkd11f | -mkd11h | -mkd11q'
+ KD11-F, KD11-H, or KD11-Q CPU. Enable limited extended
+ instruction set, `MFPS', and `MTPS'.
+
+`-mkd11k'
+ KD11-K CPU. Enable extended instruction set, `LDUB', `MED',
+ `MFPS', `MFPT', `MTPS', and `XFC'.
+
+`-mkd11z'
+ KD11-Z CPU. Enable extended instruction set, `CSM', `MFPS',
+ `MFPT', `MTPS', and `SPL'.
+
+`-mf11'
+ F11 CPU. Enable extended instruction set, `MFPS', `MFPT', and
+ `MTPS'.
+
+`-mj11'
+ J11 CPU. Enable extended instruction set, `CSM', `MFPS', `MFPT',
+ `MTPS', `SPL', `TSTSET', and `WRTLCK'.
+
+`-mt11'
+ T11 CPU. Enable limited extended instruction set, `MFPS', and
+ `MTPS'.
+
+9.27.1.4 Machine Model Options
+..............................
+
+These options enable the instruction set extensions supported by a
+particular machine model, and disables all other extensions.
+
+`-m11/03'
+ Same as `-mkd11f'.
+
+`-m11/04'
+ Same as `-mkd11d'.
+
+`-m11/05 | -m11/10'
+ Same as `-mkd11b'.
+
+`-m11/15 | -m11/20'
+ Same as `-mka11'.
+
+`-m11/21'
+ Same as `-mt11'.
+
+`-m11/23 | -m11/24'
+ Same as `-mf11'.
+
+`-m11/34'
+ Same as `-mkd11e'.
+
+`-m11/34a'
+ Ame as `-mkd11e' `-mfpp'.
+
+`-m11/35 | -m11/40'
+ Same as `-mkd11a'.
+
+`-m11/44'
+ Same as `-mkd11z'.
+
+`-m11/45 | -m11/50 | -m11/55 | -m11/70'
+ Same as `-mkb11'.
+
+`-m11/53 | -m11/73 | -m11/83 | -m11/84 | -m11/93 | -m11/94'
+ Same as `-mj11'.
+
+`-m11/60'
+ Same as `-mkd11k'.
+
+
+File: as.info, Node: PDP-11-Pseudos, Next: PDP-11-Syntax, Prev: PDP-11-Options, Up: PDP-11-Dependent
+
+9.27.2 Assembler Directives
+---------------------------
+
+The PDP-11 version of `as' has a few machine dependent assembler
+directives.
+
+`.bss'
+ Switch to the `bss' section.
+
+`.even'
+ Align the location counter to an even number.
+
+
+File: as.info, Node: PDP-11-Syntax, Next: PDP-11-Mnemonics, Prev: PDP-11-Pseudos, Up: PDP-11-Dependent
+
+9.27.3 PDP-11 Assembly Language Syntax
+--------------------------------------
+
+`as' supports both DEC syntax and BSD syntax. The only difference is
+that in DEC syntax, a `#' character is used to denote an immediate
+constants, while in BSD syntax the character for this purpose is `$'.
+
+ general-purpose registers are named `r0' through `r7'. Mnemonic
+alternatives for `r6' and `r7' are `sp' and `pc', respectively.
+
+ Floating-point registers are named `ac0' through `ac3', or
+alternatively `fr0' through `fr3'.
+
+ Comments are started with a `#' or a `/' character, and extend to
+the end of the line. (FIXME: clash with immediates?)
+
+
+File: as.info, Node: PDP-11-Mnemonics, Next: PDP-11-Synthetic, Prev: PDP-11-Syntax, Up: PDP-11-Dependent
+
+9.27.4 Instruction Naming
+-------------------------
+
+Some instructions have alternative names.
+
+`BCC'
+ `BHIS'
+
+`BCS'
+ `BLO'
+
+`L2DR'
+ `L2D'
+
+`L3DR'
+ `L3D'
+
+`SYS'
+ `TRAP'
+
+
+File: as.info, Node: PDP-11-Synthetic, Prev: PDP-11-Mnemonics, Up: PDP-11-Dependent
+
+9.27.5 Synthetic Instructions
+-----------------------------
+
+The `JBR' and `J'CC synthetic instructions are not supported yet.
+
+
+File: as.info, Node: PJ-Dependent, Next: PPC-Dependent, Prev: PDP-11-Dependent, Up: Machine Dependencies
+
+9.28 picoJava Dependent Features
+================================
+
+* Menu:
+
+* PJ Options:: Options
+
+
+File: as.info, Node: PJ Options, Up: PJ-Dependent
+
+9.28.1 Options
+--------------
+
+`as' has two additional command-line options for the picoJava
+architecture.
+`-ml'
+ This option selects little endian data output.
+
+`-mb'
+ This option selects big endian data output.
+
+
+File: as.info, Node: PPC-Dependent, Next: S/390-Dependent, Prev: PJ-Dependent, Up: Machine Dependencies
+
+9.29 PowerPC Dependent Features
+===============================
+
+* Menu:
+
+* PowerPC-Opts:: Options
+* PowerPC-Pseudo:: PowerPC Assembler Directives
+
+
+File: as.info, Node: PowerPC-Opts, Next: PowerPC-Pseudo, Up: PPC-Dependent
+
+9.29.1 Options
+--------------
+
+The PowerPC chip family includes several successive levels, using the
+same core instruction set, but including a few additional instructions
+at each level. There are exceptions to this however. For details on
+what instructions each variant supports, please see the chip's
+architecture reference manual.
+
+ The following table lists all available PowerPC options.
+
+`-mpwrx | -mpwr2'
+ Generate code for POWER/2 (RIOS2).
+
+`-mpwr'
+ Generate code for POWER (RIOS1)
+
+`-m601'
+ Generate code for PowerPC 601.
+
+`-mppc, -mppc32, -m603, -m604'
+ Generate code for PowerPC 603/604.
+
+`-m403, -m405'
+ Generate code for PowerPC 403/405.
+
+`-m440'
+ Generate code for PowerPC 440. BookE and some 405 instructions.
+
+`-m476'
+ Generate code for PowerPC 476.
+
+`-m7400, -m7410, -m7450, -m7455'
+ Generate code for PowerPC 7400/7410/7450/7455.
+
+`-m750cl'
+ Generate code for PowerPC 750CL.
+
+`-mppc64, -m620'
+ Generate code for PowerPC 620/625/630.
+
+`-me500, -me500x2'
+ Generate code for Motorola e500 core complex.
+
+`-mspe'
+ Generate code for Motorola SPE instructions.
+
+`-mppc64bridge'
+ Generate code for PowerPC 64, including bridge insns.
+
+`-mbooke'
+ Generate code for 32-bit BookE.
+
+`-ma2'
+ Generate code for A2 architecture.
+
+`-me300'
+ Generate code for PowerPC e300 family.
+
+`-maltivec'
+ Generate code for processors with AltiVec instructions.
+
+`-mvsx'
+ Generate code for processors with Vector-Scalar (VSX) instructions.
+
+`-mpower4'
+ Generate code for Power4 architecture.
+
+`-mpower5'
+ Generate code for Power5 architecture.
+
+`-mpower6'
+ Generate code for Power6 architecture.
+
+`-mpower7'
+ Generate code for Power7 architecture.
+
+`-mcell'
+ Generate code for Cell Broadband Engine architecture.
+
+`-mcom'
+ Generate code Power/PowerPC common instructions.
+
+`-many'
+ Generate code for any architecture (PWR/PWRX/PPC).
+
+`-mregnames'
+ Allow symbolic names for registers.
+
+`-mno-regnames'
+ Do not allow symbolic names for registers.
+
+`-mrelocatable'
+ Support for GCC's -mrelocatable option.
+
+`-mrelocatable-lib'
+ Support for GCC's -mrelocatable-lib option.
+
+`-memb'
+ Set PPC_EMB bit in ELF flags.
+
+`-mlittle, -mlittle-endian'
+ Generate code for a little endian machine.
+
+`-mbig, -mbig-endian'
+ Generate code for a big endian machine.
+
+`-msolaris'
+ Generate code for Solaris.
+
+`-mno-solaris'
+ Do not generate code for Solaris.
+
+
+File: as.info, Node: PowerPC-Pseudo, Prev: PowerPC-Opts, Up: PPC-Dependent
+
+9.29.2 PowerPC Assembler Directives
+-----------------------------------
+
+A number of assembler directives are available for PowerPC. The
+following table is far from complete.
+
+`.machine "string"'
+ This directive allows you to change the machine for which code is
+ generated. `"string"' may be any of the -m cpu selection options
+ (without the -m) enclosed in double quotes, `"push"', or `"pop"'.
+ `.machine "push"' saves the currently selected cpu, which may be
+ restored with `.machine "pop"'.
+
+
+File: as.info, Node: S/390-Dependent, Next: SCORE-Dependent, Prev: PPC-Dependent, Up: Machine Dependencies
+
+9.30 IBM S/390 Dependent Features
+=================================
+
+ The s390 version of `as' supports two architectures modes and seven
+chip levels. The architecture modes are the Enterprise System
+Architecture (ESA) and the newer z/Architecture mode. The chip levels
+are g5, g6, z900, z990, z9-109, z9-ec and z10.
+
+* Menu:
+
+* s390 Options:: Command-line Options.
+* s390 Characters:: Special Characters.
+* s390 Syntax:: Assembler Instruction syntax.
+* s390 Directives:: Assembler Directives.
+* s390 Floating Point:: Floating Point.
+
+
+File: as.info, Node: s390 Options, Next: s390 Characters, Up: S/390-Dependent
+
+9.30.1 Options
+--------------
+
+The following table lists all available s390 specific options:
+
+`-m31 | -m64'
+ Select 31- or 64-bit ABI implying a word size of 32- or 64-bit.
+
+ These options are only available with the ELF object file format,
+ and require that the necessary BFD support has been included (on a
+ 31-bit platform you must add -enable-64-bit-bfd on the call to the
+ configure script to enable 64-bit usage and use s390x as target
+ platform).
+
+`-mesa | -mzarch'
+ Select the architecture mode, either the Enterprise System
+ Architecture (esa) mode or the z/Architecture mode (zarch).
+
+ The 64-bit instructions are only available with the z/Architecture
+ mode. The combination of `-m64' and `-mesa' results in a warning
+ message.
+
+`-march=CPU'
+ This option specifies the target processor. The following
+ processor names are recognized: `g5', `g6', `z900', `z990',
+ `z9-109', `z9-ec' and `z10'. Assembling an instruction that is
+ not supported on the target processor results in an error message.
+ Do not specify `g5' or `g6' with `-mzarch'.
+
+`-mregnames'
+ Allow symbolic names for registers.
+
+`-mno-regnames'
+ Do not allow symbolic names for registers.
+
+`-mwarn-areg-zero'
+ Warn whenever the operand for a base or index register has been
+ specified but evaluates to zero. This can indicate the misuse of
+ general purpose register 0 as an address register.
+
+
+
+File: as.info, Node: s390 Characters, Next: s390 Syntax, Prev: s390 Options, Up: S/390-Dependent
+
+9.30.2 Special Characters
+-------------------------
+
+`#' is the line comment character.
+
+
+File: as.info, Node: s390 Syntax, Next: s390 Directives, Prev: s390 Characters, Up: S/390-Dependent
+
+9.30.3 Instruction syntax
+-------------------------
+
+The assembler syntax closely follows the syntax outlined in Enterprise
+Systems Architecture/390 Principles of Operation (SA22-7201) and the
+z/Architecture Principles of Operation (SA22-7832).
+
+ Each instruction has two major parts, the instruction mnemonic and
+the instruction operands. The instruction format varies.
+
+* Menu:
+
+* s390 Register:: Register Naming
+* s390 Mnemonics:: Instruction Mnemonics
+* s390 Operands:: Instruction Operands
+* s390 Formats:: Instruction Formats
+* s390 Aliases:: Instruction Aliases
+* s390 Operand Modifier:: Instruction Operand Modifier
+* s390 Instruction Marker:: Instruction Marker
+* s390 Literal Pool Entries:: Literal Pool Entries
+
+
+File: as.info, Node: s390 Register, Next: s390 Mnemonics, Up: s390 Syntax
+
+9.30.3.1 Register naming
+........................
+
+The `as' recognizes a number of predefined symbols for the various
+processor registers. A register specification in one of the instruction
+formats is an unsigned integer between 0 and 15. The specific
+instruction and the position of the register in the instruction format
+denotes the type of the register. The register symbols are prefixed with
+`%':
+
+ %rN the 16 general purpose registers, 0 <= N <= 15
+ %fN the 16 floating point registers, 0 <= N <= 15
+ %aN the 16 access registers, 0 <= N <= 15
+ %cN the 16 control registers, 0 <= N <= 15
+ %lit an alias for the general purpose register %r13
+ %sp an alias for the general purpose register %r15
+
+
+File: as.info, Node: s390 Mnemonics, Next: s390 Operands, Prev: s390 Register, Up: s390 Syntax
+
+9.30.3.2 Instruction Mnemonics
+..............................
+
+All instructions documented in the Principles of Operation are supported
+with the mnemonic and order of operands as described. The instruction
+mnemonic identifies the instruction format (*Note s390 Formats::) and
+the specific operation code for the instruction. For example, the `lr'
+mnemonic denotes the instruction format `RR' with the operation code
+`0x18'.
+
+ The definition of the various mnemonics follows a scheme, where the
+first character usually hint at the type of the instruction:
+
+ a add instruction, for example `al' for add logical 32-bit
+ b branch instruction, for example `bc' for branch on condition
+ c compare or convert instruction, for example `cr' for compare
+ register 32-bit
+ d divide instruction, for example `dlr' devide logical register
+ 64-bit to 32-bit
+ i insert instruction, for example `ic' insert character
+ l load instruction, for example `ltr' load and test register
+ mv move instruction, for example `mvc' move character
+ m multiply instruction, for example `mh' multiply halfword
+ n and instruction, for example `ni' and immediate
+ o or instruction, for example `oc' or character
+ sla, sll shift left single instruction
+ sra, srl shift right single instruction
+ st store instruction, for example `stm' store multiple
+ s subtract instruction, for example `slr' subtract
+ logical 32-bit
+ t test or translate instruction, of example `tm' test under mask
+ x exclusive or instruction, for example `xc' exclusive or
+ character
+
+ Certain characters at the end of the mnemonic may describe a property
+of the instruction:
+
+ c the instruction uses a 8-bit character operand
+ f the instruction extends a 32-bit operand to 64 bit
+ g the operands are treated as 64-bit values
+ h the operand uses a 16-bit halfword operand
+ i the instruction uses an immediate operand
+ l the instruction uses unsigned, logical operands
+ m the instruction uses a mask or operates on multiple values
+ r if r is the last character, the instruction operates on registers
+ y the instruction uses 20-bit displacements
+
+ There are many exceptions to the scheme outlined in the above lists,
+in particular for the priviledged instructions. For non-priviledged
+instruction it works quite well, for example the instruction `clgfr' c:
+compare instruction, l: unsigned operands, g: 64-bit operands, f: 32-
+to 64-bit extension, r: register operands. The instruction compares an
+64-bit value in a register with the zero extended 32-bit value from a
+second register. For a complete list of all mnemonics see appendix B
+in the Principles of Operation.
+
+
+File: as.info, Node: s390 Operands, Next: s390 Formats, Prev: s390 Mnemonics, Up: s390 Syntax
+
+9.30.3.3 Instruction Operands
+.............................
+
+Instruction operands can be grouped into three classes, operands located
+in registers, immediate operands, and operands in storage.
+
+ A register operand can be located in general, floating-point, access,
+or control register. The register is identified by a four-bit field.
+The field containing the register operand is called the R field.
+
+ Immediate operands are contained within the instruction and can have
+8, 16 or 32 bits. The field containing the immediate operand is called
+the I field. Dependent on the instruction the I field is either signed
+or unsigned.
+
+ A storage operand consists of an address and a length. The address
+of a storage operands can be specified in any of these ways:
+
+ * The content of a single general R
+
+ * The sum of the content of a general register called the base
+ register B plus the content of a displacement field D
+
+ * The sum of the contents of two general registers called the index
+ register X and the base register B plus the content of a
+ displacement field
+
+ * The sum of the current instruction address and a 32-bit signed
+ immediate field multiplied by two.
+
+ The length of a storage operand can be:
+
+ * Implied by the instruction
+
+ * Specified by a bitmask
+
+ * Specified by a four-bit or eight-bit length field L
+
+ * Specified by the content of a general register
+
+ The notation for storage operand addresses formed from multiple
+fields is as follows:
+
+`Dn(Bn)'
+ the address for operand number n is formed from the content of
+ general register Bn called the base register and the displacement
+ field Dn.
+
+`Dn(Xn,Bn)'
+ the address for operand number n is formed from the content of
+ general register Xn called the index register, general register Bn
+ called the base register and the displacement field Dn.
+
+`Dn(Ln,Bn)'
+ the address for operand number n is formed from the content of
+ general regiser Bn called the base register and the displacement
+ field Dn. The length of the operand n is specified by the field
+ Ln.
+
+ The base registers Bn and the index registers Xn of a storage
+operand can be skipped. If Bn and Xn are skipped, a zero will be stored
+to the operand field. The notation changes as follows:
+
+ full notation short notation
+ ------------------------------------------
+ Dn(0,Bn) Dn(Bn)
+ Dn(0,0) Dn
+ Dn(0) Dn
+ Dn(Ln,0) Dn(Ln)
+
+
+File: as.info, Node: s390 Formats, Next: s390 Aliases, Prev: s390 Operands, Up: s390 Syntax
+
+9.30.3.4 Instruction Formats
+............................
+
+The Principles of Operation manuals lists 26 instruction formats where
+some of the formats have multiple variants. For the `.insn' pseudo
+directive the assembler recognizes some of the formats. Typically, the
+most general variant of the instruction format is used by the `.insn'
+directive.
+
+ The following table lists the abbreviations used in the table of
+instruction formats:
+
+ OpCode / OpCd Part of the op code.
+ Bx Base register number for operand x.
+ Dx Displacement for operand x.
+ DLx Displacement lower 12 bits for operand x.
+ DHx Displacement higher 8-bits for operand x.
+ Rx Register number for operand x.
+ Xx Index register number for operand x.
+ Ix Signed immediate for operand x.
+ Ux Unsigned immediate for operand x.
+
+ An instruction is two, four, or six bytes in length and must be
+aligned on a 2 byte boundary. The first two bits of the instruction
+specify the length of the instruction, 00 indicates a two byte
+instruction, 01 and 10 indicates a four byte instruction, and 11
+indicates a six byte instruction.
+
+ The following table lists the s390 instruction formats that are
+available with the `.insn' pseudo directive:
+
+`E format'
+
+ +-------------+
+ | OpCode |
+ +-------------+
+ 0 15
+
+`RI format: <insn> R1,I2'
+
+ +--------+----+----+------------------+
+ | OpCode | R1 |OpCd| I2 |
+ +--------+----+----+------------------+
+ 0 8 12 16 31
+
+`RIE format: <insn> R1,R3,I2'
+
+ +--------+----+----+------------------+--------+--------+
+ | OpCode | R1 | R3 | I2 |////////| OpCode |
+ +--------+----+----+------------------+--------+--------+
+ 0 8 12 16 32 40 47
+
+`RIL format: <insn> R1,I2'
+
+ +--------+----+----+------------------------------------+
+ | OpCode | R1 |OpCd| I2 |
+ +--------+----+----+------------------------------------+
+ 0 8 12 16 47
+
+`RILU format: <insn> R1,U2'
+
+ +--------+----+----+------------------------------------+
+ | OpCode | R1 |OpCd| U2 |
+ +--------+----+----+------------------------------------+
+ 0 8 12 16 47
+
+`RIS format: <insn> R1,I2,M3,D4(B4)'
+
+ +--------+----+----+----+-------------+--------+--------+
+ | OpCode | R1 | M3 | B4 | D4 | I2 | Opcode |
+ +--------+----+----+----+-------------+--------+--------+
+ 0 8 12 16 20 32 36 47
+
+`RR format: <insn> R1,R2'
+
+ +--------+----+----+
+ | OpCode | R1 | R2 |
+ +--------+----+----+
+ 0 8 12 15
+
+`RRE format: <insn> R1,R2'
+
+ +------------------+--------+----+----+
+ | OpCode |////////| R1 | R2 |
+ +------------------+--------+----+----+
+ 0 16 24 28 31
+
+`RRF format: <insn> R1,R2,R3,M4'
+
+ +------------------+----+----+----+----+
+ | OpCode | R3 | M4 | R1 | R2 |
+ +------------------+----+----+----+----+
+ 0 16 20 24 28 31
+
+`RRS format: <insn> R1,R2,M3,D4(B4)'
+
+ +--------+----+----+----+-------------+----+----+--------+
+ | OpCode | R1 | R3 | B4 | D4 | M3 |////| OpCode |
+ +--------+----+----+----+-------------+----+----+--------+
+ 0 8 12 16 20 32 36 40 47
+
+`RS format: <insn> R1,R3,D2(B2)'
+
+ +--------+----+----+----+-------------+
+ | OpCode | R1 | R3 | B2 | D2 |
+ +--------+----+----+----+-------------+
+ 0 8 12 16 20 31
+
+`RSE format: <insn> R1,R3,D2(B2)'
+
+ +--------+----+----+----+-------------+--------+--------+
+ | OpCode | R1 | R3 | B2 | D2 |////////| OpCode |
+ +--------+----+----+----+-------------+--------+--------+
+ 0 8 12 16 20 32 40 47
+
+`RSI format: <insn> R1,R3,I2'
+
+ +--------+----+----+------------------------------------+
+ | OpCode | R1 | R3 | I2 |
+ +--------+----+----+------------------------------------+
+ 0 8 12 16 47
+
+`RSY format: <insn> R1,R3,D2(B2)'
+
+ +--------+----+----+----+-------------+--------+--------+
+ | OpCode | R1 | R3 | B2 | DL2 | DH2 | OpCode |
+ +--------+----+----+----+-------------+--------+--------+
+ 0 8 12 16 20 32 40 47
+
+`RX format: <insn> R1,D2(X2,B2)'
+
+ +--------+----+----+----+-------------+
+ | OpCode | R1 | X2 | B2 | D2 |
+ +--------+----+----+----+-------------+
+ 0 8 12 16 20 31
+
+`RXE format: <insn> R1,D2(X2,B2)'
+
+ +--------+----+----+----+-------------+--------+--------+
+ | OpCode | R1 | X2 | B2 | D2 |////////| OpCode |
+ +--------+----+----+----+-------------+--------+--------+
+ 0 8 12 16 20 32 40 47
+
+`RXF format: <insn> R1,R3,D2(X2,B2)'
+
+ +--------+----+----+----+-------------+----+---+--------+
+ | OpCode | R3 | X2 | B2 | D2 | R1 |///| OpCode |
+ +--------+----+----+----+-------------+----+---+--------+
+ 0 8 12 16 20 32 36 40 47
+
+`RXY format: <insn> R1,D2(X2,B2)'
+
+ +--------+----+----+----+-------------+--------+--------+
+ | OpCode | R1 | X2 | B2 | DL2 | DH2 | OpCode |
+ +--------+----+----+----+-------------+--------+--------+
+ 0 8 12 16 20 32 36 40 47
+
+`S format: <insn> D2(B2)'
+
+ +------------------+----+-------------+
+ | OpCode | B2 | D2 |
+ +------------------+----+-------------+
+ 0 16 20 31
+
+`SI format: <insn> D1(B1),I2'
+
+ +--------+---------+----+-------------+
+ | OpCode | I2 | B1 | D1 |
+ +--------+---------+----+-------------+
+ 0 8 16 20 31
+
+`SIY format: <insn> D1(B1),U2'
+
+ +--------+---------+----+-------------+--------+--------+
+ | OpCode | I2 | B1 | DL1 | DH1 | OpCode |
+ +--------+---------+----+-------------+--------+--------+
+ 0 8 16 20 32 36 40 47
+
+`SIL format: <insn> D1(B1),I2'
+
+ +------------------+----+-------------+-----------------+
+ | OpCode | B1 | D1 | I2 |
+ +------------------+----+-------------+-----------------+
+ 0 16 20 32 47
+
+`SS format: <insn> D1(R1,B1),D2(B3),R3'
+
+ +--------+----+----+----+-------------+----+------------+
+ | OpCode | R1 | R3 | B1 | D1 | B2 | D2 |
+ +--------+----+----+----+-------------+----+------------+
+ 0 8 12 16 20 32 36 47
+
+`SSE format: <insn> D1(B1),D2(B2)'
+
+ +------------------+----+-------------+----+------------+
+ | OpCode | B1 | D1 | B2 | D2 |
+ +------------------+----+-------------+----+------------+
+ 0 8 12 16 20 32 36 47
+
+`SSF format: <insn> D1(B1),D2(B2),R3'
+
+ +--------+----+----+----+-------------+----+------------+
+ | OpCode | R3 |OpCd| B1 | D1 | B2 | D2 |
+ +--------+----+----+----+-------------+----+------------+
+ 0 8 12 16 20 32 36 47
+
+
+ For the complete list of all instruction format variants see the
+Principles of Operation manuals.
+
+
+File: as.info, Node: s390 Aliases, Next: s390 Operand Modifier, Prev: s390 Formats, Up: s390 Syntax
+
+9.30.3.5 Instruction Aliases
+............................
+
+A specific bit pattern can have multiple mnemonics, for example the bit
+pattern `0xa7000000' has the mnemonics `tmh' and `tmlh'. In addition,
+there are a number of mnemonics recognized by `as' that are not present
+in the Principles of Operation. These are the short forms of the
+branch instructions, where the condition code mask operand is encoded
+in the mnemonic. This is relevant for the branch instructions, the
+compare and branch instructions, and the compare and trap instructions.
+
+ For the branch instructions there are 20 condition code strings that
+can be used as part of the mnemonic in place of a mask operand in the
+instruction format:
+
+ instruction short form
+ ------------------------------------------
+ bcr M1,R2 b<m>r R2
+ bc M1,D2(X2,B2) b<m> D2(X2,B2)
+ brc M1,I2 j<m> I2
+ brcl M1,I2 jg<m> I2
+
+ In the mnemonic for a branch instruction the condition code string
+<m> can be any of the following:
+
+ o jump on overflow / if ones
+ h jump on A high
+ p jump on plus
+ nle jump on not low or equal
+ l jump on A low
+ m jump on minus
+ nhe jump on not high or equal
+ lh jump on low or high
+ ne jump on A not equal B
+ nz jump on not zero / if not zeros
+ e jump on A equal B
+ z jump on zero / if zeroes
+ nlh jump on not low or high
+ he jump on high or equal
+ nl jump on A not low
+ nm jump on not minus / if not mixed
+ le jump on low or equal
+ nh jump on A not high
+ np jump on not plus
+ no jump on not overflow / if not ones
+
+ For the compare and branch, and compare and trap instructions there
+are 12 condition code strings that can be used as part of the mnemonic
+in place of a mask operand in the instruction format:
+
+ instruction short form
+ --------------------------------------------------------
+ crb R1,R2,M3,D4(B4) crb<m> R1,R2,D4(B4)
+ cgrb R1,R2,M3,D4(B4) cgrb<m> R1,R2,D4(B4)
+ crj R1,R2,M3,I4 crj<m> R1,R2,I4
+ cgrj R1,R2,M3,I4 cgrj<m> R1,R2,I4
+ cib R1,I2,M3,D4(B4) cib<m> R1,I2,D4(B4)
+ cgib R1,I2,M3,D4(B4) cgib<m> R1,I2,D4(B4)
+ cij R1,I2,M3,I4 cij<m> R1,I2,I4
+ cgij R1,I2,M3,I4 cgij<m> R1,I2,I4
+ crt R1,R2,M3 crt<m> R1,R2
+ cgrt R1,R2,M3 cgrt<m> R1,R2
+ cit R1,I2,M3 cit<m> R1,I2
+ cgit R1,I2,M3 cgit<m> R1,I2
+ clrb R1,R2,M3,D4(B4) clrb<m> R1,R2,D4(B4)
+ clgrb R1,R2,M3,D4(B4) clgrb<m> R1,R2,D4(B4)
+ clrj R1,R2,M3,I4 clrj<m> R1,R2,I4
+ clgrj R1,R2,M3,I4 clgrj<m> R1,R2,I4
+ clib R1,I2,M3,D4(B4) clib<m> R1,I2,D4(B4)
+ clgib R1,I2,M3,D4(B4) clgib<m> R1,I2,D4(B4)
+ clij R1,I2,M3,I4 clij<m> R1,I2,I4
+ clgij R1,I2,M3,I4 clgij<m> R1,I2,I4
+ clrt R1,R2,M3 clrt<m> R1,R2
+ clgrt R1,R2,M3 clgrt<m> R1,R2
+ clfit R1,I2,M3 clfit<m> R1,I2
+ clgit R1,I2,M3 clgit<m> R1,I2
+
+ In the mnemonic for a compare and branch and compare and trap
+instruction the condition code string <m> can be any of the following:
+
+ h jump on A high
+ nle jump on not low or equal
+ l jump on A low
+ nhe jump on not high or equal
+ ne jump on A not equal B
+ lh jump on low or high
+ e jump on A equal B
+ nlh jump on not low or high
+ nl jump on A not low
+ he jump on high or equal
+ nh jump on A not high
+ le jump on low or equal
+
+
+File: as.info, Node: s390 Operand Modifier, Next: s390 Instruction Marker, Prev: s390 Aliases, Up: s390 Syntax
+
+9.30.3.6 Instruction Operand Modifier
+.....................................
+
+If a symbol modifier is attached to a symbol in an expression for an
+instruction operand field, the symbol term is replaced with a reference
+to an object in the global offset table (GOT) or the procedure linkage
+table (PLT). The following expressions are allowed: `symbol@modifier +
+constant', `symbol@modifier + label + constant', and `symbol@modifier -
+label + constant'. The term `symbol' is the symbol that will be
+entered into the GOT or PLT, `label' is a local label, and `constant'
+is an arbitrary expression that the assembler can evaluate to a
+constant value.
+
+ The term `(symbol + constant1)@modifier +/- label + constant2' is
+also accepted but a warning message is printed and the term is
+converted to `symbol@modifier +/- label + constant1 + constant2'.
+
+`@got'
+`@got12'
+ The @got modifier can be used for displacement fields, 16-bit
+ immediate fields and 32-bit pc-relative immediate fields. The
+ @got12 modifier is synonym to @got. The symbol is added to the
+ GOT. For displacement fields and 16-bit immediate fields the
+ symbol term is replaced with the offset from the start of the GOT
+ to the GOT slot for the symbol. For a 32-bit pc-relative field
+ the pc-relative offset to the GOT slot from the current
+ instruction address is used.
+
+`@gotent'
+ The @gotent modifier can be used for 32-bit pc-relative immediate
+ fields. The symbol is added to the GOT and the symbol term is
+ replaced with the pc-relative offset from the current instruction
+ to the GOT slot for the symbol.
+
+`@gotoff'
+ The @gotoff modifier can be used for 16-bit immediate fields. The
+ symbol term is replaced with the offset from the start of the GOT
+ to the address of the symbol.
+
+`@gotplt'
+ The @gotplt modifier can be used for displacement fields, 16-bit
+ immediate fields, and 32-bit pc-relative immediate fields. A
+ procedure linkage table entry is generated for the symbol and a
+ jump slot for the symbol is added to the GOT. For displacement
+ fields and 16-bit immediate fields the symbol term is replaced
+ with the offset from the start of the GOT to the jump slot for the
+ symbol. For a 32-bit pc-relative field the pc-relative offset to
+ the jump slot from the current instruction address is used.
+
+`@plt'
+ The @plt modifier can be used for 16-bit and 32-bit pc-relative
+ immediate fields. A procedure linkage table entry is generated for
+ the symbol. The symbol term is replaced with the relative offset
+ from the current instruction to the PLT entry for the symbol.
+
+`@pltoff'
+ The @pltoff modifier can be used for 16-bit immediate fields. The
+ symbol term is replaced with the offset from the start of the PLT
+ to the address of the symbol.
+
+`@gotntpoff'
+ The @gotntpoff modifier can be used for displacement fields. The
+ symbol is added to the static TLS block and the negated offset to
+ the symbol in the static TLS block is added to the GOT. The symbol
+ term is replaced with the offset to the GOT slot from the start of
+ the GOT.
+
+`@indntpoff'
+ The @indntpoff modifier can be used for 32-bit pc-relative
+ immediate fields. The symbol is added to the static TLS block and
+ the negated offset to the symbol in the static TLS block is added
+ to the GOT. The symbol term is replaced with the pc-relative
+ offset to the GOT slot from the current instruction address.
+
+ For more information about the thread local storage modifiers
+`gotntpoff' and `indntpoff' see the ELF extension documentation `ELF
+Handling For Thread-Local Storage'.
+
+
+File: as.info, Node: s390 Instruction Marker, Next: s390 Literal Pool Entries, Prev: s390 Operand Modifier, Up: s390 Syntax
+
+9.30.3.7 Instruction Marker
+...........................
+
+The thread local storage instruction markers are used by the linker to
+perform code optimization.
+
+`:tls_load'
+ The :tls_load marker is used to flag the load instruction in the
+ initial exec TLS model that retrieves the offset from the thread
+ pointer to a thread local storage variable from the GOT.
+
+`:tls_gdcall'
+ The :tls_gdcall marker is used to flag the branch-and-save
+ instruction to the __tls_get_offset function in the global dynamic
+ TLS model.
+
+`:tls_ldcall'
+ The :tls_ldcall marker is used to flag the branch-and-save
+ instruction to the __tls_get_offset function in the local dynamic
+ TLS model.
+
+ For more information about the thread local storage instruction
+marker and the linker optimizations see the ELF extension documentation
+`ELF Handling For Thread-Local Storage'.
+
+
+File: as.info, Node: s390 Literal Pool Entries, Prev: s390 Instruction Marker, Up: s390 Syntax
+
+9.30.3.8 Literal Pool Entries
+.............................
+
+A literal pool is a collection of values. To access the values a pointer
+to the literal pool is loaded to a register, the literal pool register.
+Usually, register %r13 is used as the literal pool register (*Note s390
+Register::). Literal pool entries are created by adding the suffix
+:lit1, :lit2, :lit4, or :lit8 to the end of an expression for an
+instruction operand. The expression is added to the literal pool and the
+operand is replaced with the offset to the literal in the literal pool.
+
+`:lit1'
+ The literal pool entry is created as an 8-bit value. An operand
+ modifier must not be used for the original expression.
+
+`:lit2'
+ The literal pool entry is created as a 16 bit value. The operand
+ modifier @got may be used in the original expression. The term
+ `x@got:lit2' will put the got offset for the global symbol x to
+ the literal pool as 16 bit value.
+
+`:lit4'
+ The literal pool entry is created as a 32-bit value. The operand
+ modifier @got and @plt may be used in the original expression. The
+ term `x@got:lit4' will put the got offset for the global symbol x
+ to the literal pool as a 32-bit value. The term `x@plt:lit4' will
+ put the plt offset for the global symbol x to the literal pool as
+ a 32-bit value.
+
+`:lit8'
+ The literal pool entry is created as a 64-bit value. The operand
+ modifier @got and @plt may be used in the original expression. The
+ term `x@got:lit8' will put the got offset for the global symbol x
+ to the literal pool as a 64-bit value. The term `x@plt:lit8' will
+ put the plt offset for the global symbol x to the literal pool as
+ a 64-bit value.
+
+ The assembler directive `.ltorg' is used to emit all literal pool
+entries to the current position.
+
+
+File: as.info, Node: s390 Directives, Next: s390 Floating Point, Prev: s390 Syntax, Up: S/390-Dependent
+
+9.30.4 Assembler Directives
+---------------------------
+
+`as' for s390 supports all of the standard ELF assembler directives as
+outlined in the main part of this document. Some directives have been
+extended and there are some additional directives, which are only
+available for the s390 `as'.
+
+`.insn'
+ This directive permits the numeric representation of an
+ instructions and makes the assembler insert the operands according
+ to one of the instructions formats for `.insn' (*Note s390
+ Formats::). For example, the instruction `l %r1,24(%r15)' could
+ be written as `.insn rx,0x58000000,%r1,24(%r15)'.
+
+`.short'
+`.long'
+`.quad'
+ This directive places one or more 16-bit (.short), 32-bit (.long),
+ or 64-bit (.quad) values into the current section. If an ELF or
+ TLS modifier is used only the following expressions are allowed:
+ `symbol@modifier + constant', `symbol@modifier + label +
+ constant', and `symbol@modifier - label + constant'. The
+ following modifiers are available:
+ `@got'
+ `@got12'
+ The @got modifier can be used for .short, .long and .quad.
+ The @got12 modifier is synonym to @got. The symbol is added
+ to the GOT. The symbol term is replaced with offset from the
+ start of the GOT to the GOT slot for the symbol.
+
+ `@gotoff'
+ The @gotoff modifier can be used for .short, .long and .quad.
+ The symbol term is replaced with the offset from the start of
+ the GOT to the address of the symbol.
+
+ `@gotplt'
+ The @gotplt modifier can be used for .long and .quad. A
+ procedure linkage table entry is generated for the symbol and
+ a jump slot for the symbol is added to the GOT. The symbol
+ term is replaced with the offset from the start of the GOT to
+ the jump slot for the symbol.
+
+ `@plt'
+ The @plt modifier can be used for .long and .quad. A
+ procedure linkage table entry us generated for the symbol.
+ The symbol term is replaced with the address of the PLT entry
+ for the symbol.
+
+ `@pltoff'
+ The @pltoff modifier can be used for .short, .long and .quad.
+ The symbol term is replaced with the offset from the start of
+ the PLT to the address of the symbol.
+
+ `@tlsgd'
+ `@tlsldm'
+ The @tlsgd and @tlsldm modifier can be used for .long and
+ .quad. A tls_index structure for the symbol is added to the
+ GOT. The symbol term is replaced with the offset from the
+ start of the GOT to the tls_index structure.
+
+ `@gotntpoff'
+ `@indntpoff'
+ The @gotntpoff and @indntpoff modifier can be used for .long
+ and .quad. The symbol is added to the static TLS block and
+ the negated offset to the symbol in the static TLS block is
+ added to the GOT. For @gotntpoff the symbol term is replaced
+ with the offset from the start of the GOT to the GOT slot,
+ for @indntpoff the symbol term is replaced with the address
+ of the GOT slot.
+
+ `@dtpoff'
+ The @dtpoff modifier can be used for .long and .quad. The
+ symbol term is replaced with the offset of the symbol
+ relative to the start of the TLS block it is contained in.
+
+ `@ntpoff'
+ The @ntpoff modifier can be used for .long and .quad. The
+ symbol term is replaced with the offset of the symbol
+ relative to the TCB pointer.
+
+ For more information about the thread local storage modifiers see
+ the ELF extension documentation `ELF Handling For Thread-Local
+ Storage'.
+
+`.ltorg'
+ This directive causes the current contents of the literal pool to
+ be dumped to the current location (*Note s390 Literal Pool
+ Entries::).
+
+
+File: as.info, Node: s390 Floating Point, Prev: s390 Directives, Up: S/390-Dependent
+
+9.30.5 Floating Point
+---------------------
+
+The assembler recognizes both the IEEE floating-point instruction and
+the hexadecimal floating-point instructions. The floating-point
+constructors `.float', `.single', and `.double' always emit the IEEE
+format. To assemble hexadecimal floating-point constants the `.long'
+and `.quad' directives must be used.
+
+
+File: as.info, Node: SCORE-Dependent, Next: Sparc-Dependent, Prev: S/390-Dependent, Up: Machine Dependencies
+
+9.31 SCORE Dependent Features
+=============================
+
+* Menu:
+
+* SCORE-Opts:: Assembler options
+* SCORE-Pseudo:: SCORE Assembler Directives
+
+
+File: as.info, Node: SCORE-Opts, Next: SCORE-Pseudo, Up: SCORE-Dependent
+
+9.31.1 Options
+--------------
+
+The following table lists all available SCORE options.
+
+`-G NUM'
+ This option sets the largest size of an object that can be
+ referenced implicitly with the `gp' register. The default value is
+ 8.
+
+`-EB'
+ Assemble code for a big-endian cpu
+
+`-EL'
+ Assemble code for a little-endian cpu
+
+`-FIXDD'
+ Assemble code for fix data dependency
+
+`-NWARN'
+ Assemble code for no warning message for fix data dependency
+
+`-SCORE5'
+ Assemble code for target is SCORE5
+
+`-SCORE5U'
+ Assemble code for target is SCORE5U
+
+`-SCORE7'
+ Assemble code for target is SCORE7, this is default setting
+
+`-SCORE3'
+ Assemble code for target is SCORE3
+
+`-march=score7'
+ Assemble code for target is SCORE7, this is default setting
+
+`-march=score3'
+ Assemble code for target is SCORE3
+
+`-USE_R1'
+ Assemble code for no warning message when using temp register r1
+
+`-KPIC'
+ Generate code for PIC. This option tells the assembler to generate
+ score position-independent macro expansions. It also tells the
+ assembler to mark the output file as PIC.
+
+`-O0'
+ Assembler will not perform any optimizations
+
+`-V'
+ Sunplus release version
+
+
+
+File: as.info, Node: SCORE-Pseudo, Prev: SCORE-Opts, Up: SCORE-Dependent
+
+9.31.2 SCORE Assembler Directives
+---------------------------------
+
+A number of assembler directives are available for SCORE. The
+following table is far from complete.
+
+`.set nwarn'
+ Let the assembler not to generate warnings if the source machine
+ language instructions happen data dependency.
+
+`.set fixdd'
+ Let the assembler to insert bubbles (32 bit nop instruction / 16
+ bit nop! Instruction) if the source machine language instructions
+ happen data dependency.
+
+`.set nofixdd'
+ Let the assembler to generate warnings if the source machine
+ language instructions happen data dependency. (Default)
+
+`.set r1'
+ Let the assembler not to generate warnings if the source program
+ uses r1. allow user to use r1
+
+`set nor1'
+ Let the assembler to generate warnings if the source program uses
+ r1. (Default)
+
+`.sdata'
+ Tell the assembler to add subsequent data into the sdata section
+
+`.rdata'
+ Tell the assembler to add subsequent data into the rdata section
+
+`.frame "frame-register", "offset", "return-pc-register"'
+ Describe a stack frame. "frame-register" is the frame register,
+ "offset" is the distance from the frame register to the virtual
+ frame pointer, "return-pc-register" is the return program register.
+ You must use ".ent" before ".frame" and only one ".frame" can be
+ used per ".ent".
+
+`.mask "bitmask", "frameoffset"'
+ Indicate which of the integer registers are saved in the current
+ function's stack frame, this is for the debugger to explain the
+ frame chain.
+
+`.ent "proc-name"'
+ Set the beginning of the procedure "proc_name". Use this directive
+ when you want to generate information for the debugger.
+
+`.end proc-name'
+ Set the end of a procedure. Use this directive to generate
+ information for the debugger.
+
+`.bss'
+ Switch the destination of following statements into the bss
+ section, which is used for data that is uninitialized anywhere.
+
+
+
+File: as.info, Node: SH-Dependent, Next: SH64-Dependent, Prev: MSP430-Dependent, Up: Machine Dependencies
+
+9.32 Renesas / SuperH SH Dependent Features
+===========================================
+
+* Menu:
+
+* SH Options:: Options
+* SH Syntax:: Syntax
+* SH Floating Point:: Floating Point
+* SH Directives:: SH Machine Directives
+* SH Opcodes:: Opcodes
+
+
+File: as.info, Node: SH Options, Next: SH Syntax, Up: SH-Dependent
+
+9.32.1 Options
+--------------
+
+`as' has following command-line options for the Renesas (formerly
+Hitachi) / SuperH SH family.
+
+`--little'
+ Generate little endian code.
+
+`--big'
+ Generate big endian code.
+
+`--relax'
+ Alter jump instructions for long displacements.
+
+`--small'
+ Align sections to 4 byte boundaries, not 16.
+
+`--dsp'
+ Enable sh-dsp insns, and disable sh3e / sh4 insns.
+
+`--renesas'
+ Disable optimization with section symbol for compatibility with
+ Renesas assembler.
+
+`--allow-reg-prefix'
+ Allow '$' as a register name prefix.
+
+`--isa=sh4 | sh4a'
+ Specify the sh4 or sh4a instruction set.
+
+`--isa=dsp'
+ Enable sh-dsp insns, and disable sh3e / sh4 insns.
+
+`--isa=fp'
+ Enable sh2e, sh3e, sh4, and sh4a insn sets.
+
+`--isa=all'
+ Enable sh1, sh2, sh2e, sh3, sh3e, sh4, sh4a, and sh-dsp insn sets.
+
+`-h-tick-hex'
+ Support H'00 style hex constants in addition to 0x00 style.
+
+
+
+File: as.info, Node: SH Syntax, Next: SH Floating Point, Prev: SH Options, Up: SH-Dependent
+
+9.32.2 Syntax
+-------------
+
+* Menu:
+
+* SH-Chars:: Special Characters
+* SH-Regs:: Register Names
+* SH-Addressing:: Addressing Modes
+
+
+File: as.info, Node: SH-Chars, Next: SH-Regs, Up: SH Syntax
+
+9.32.2.1 Special Characters
+...........................
+
+`!' is the line comment character.
+
+ You can use `;' instead of a newline to separate statements.
+
+ Since `$' has no special meaning, you may use it in symbol names.
+
+
+File: as.info, Node: SH-Regs, Next: SH-Addressing, Prev: SH-Chars, Up: SH Syntax
+
+9.32.2.2 Register Names
+.......................
+
+You can use the predefined symbols `r0', `r1', `r2', `r3', `r4', `r5',
+`r6', `r7', `r8', `r9', `r10', `r11', `r12', `r13', `r14', and `r15' to
+refer to the SH registers.
+
+ The SH also has these control registers:
+
+`pr'
+ procedure register (holds return address)
+
+`pc'
+ program counter
+
+`mach'
+`macl'
+ high and low multiply accumulator registers
+
+`sr'
+ status register
+
+`gbr'
+ global base register
+
+`vbr'
+ vector base register (for interrupt vectors)
+
+
+File: as.info, Node: SH-Addressing, Prev: SH-Regs, Up: SH Syntax
+
+9.32.2.3 Addressing Modes
+.........................
+
+`as' understands the following addressing modes for the SH. `RN' in
+the following refers to any of the numbered registers, but _not_ the
+control registers.
+
+`RN'
+ Register direct
+
+`@RN'
+ Register indirect
+
+`@-RN'
+ Register indirect with pre-decrement
+
+`@RN+'
+ Register indirect with post-increment
+
+`@(DISP, RN)'
+ Register indirect with displacement
+
+`@(R0, RN)'
+ Register indexed
+
+`@(DISP, GBR)'
+ `GBR' offset
+
+`@(R0, GBR)'
+ GBR indexed
+
+`ADDR'
+`@(DISP, PC)'
+ PC relative address (for branch or for addressing memory). The
+ `as' implementation allows you to use the simpler form ADDR
+ anywhere a PC relative address is called for; the alternate form
+ is supported for compatibility with other assemblers.
+
+`#IMM'
+ Immediate data
+
+
+File: as.info, Node: SH Floating Point, Next: SH Directives, Prev: SH Syntax, Up: SH-Dependent
+
+9.32.3 Floating Point
+---------------------
+
+SH2E, SH3E and SH4 groups have on-chip floating-point unit (FPU). Other
+SH groups can use `.float' directive to generate IEEE floating-point
+numbers.
+
+ SH2E and SH3E support single-precision floating point calculations as
+well as entirely PCAPI compatible emulation of double-precision
+floating point calculations. SH2E and SH3E instructions are a subset of
+the floating point calculations conforming to the IEEE754 standard.
+
+ In addition to single-precision and double-precision floating-point
+operation capability, the on-chip FPU of SH4 has a 128-bit graphic
+engine that enables 32-bit floating-point data to be processed 128 bits
+at a time. It also supports 4 * 4 array operations and inner product
+operations. Also, a superscalar architecture is employed that enables
+simultaneous execution of two instructions (including FPU
+instructions), providing performance of up to twice that of
+conventional architectures at the same frequency.
+
+
+File: as.info, Node: SH Directives, Next: SH Opcodes, Prev: SH Floating Point, Up: SH-Dependent
+
+9.32.4 SH Machine Directives
+----------------------------
+
+`uaword'
+`ualong'
+ `as' will issue a warning when a misaligned `.word' or `.long'
+ directive is used. You may use `.uaword' or `.ualong' to indicate
+ that the value is intentionally misaligned.
+
+
+File: as.info, Node: SH Opcodes, Prev: SH Directives, Up: SH-Dependent
+
+9.32.5 Opcodes
+--------------
+
+For detailed information on the SH machine instruction set, see
+`SH-Microcomputer User's Manual' (Renesas) or `SH-4 32-bit CPU Core
+Architecture' (SuperH) and `SuperH (SH) 64-Bit RISC Series' (SuperH).
+
+ `as' implements all the standard SH opcodes. No additional
+pseudo-instructions are needed on this family. Note, however, that
+because `as' supports a simpler form of PC-relative addressing, you may
+simply write (for example)
+
+ mov.l bar,r0
+
+where other assemblers might require an explicit displacement to `bar'
+from the program counter:
+
+ mov.l @(DISP, PC)
+
+ Here is a summary of SH opcodes:
+
+ Legend:
+ Rn a numbered register
+ Rm another numbered register
+ #imm immediate data
+ disp displacement
+ disp8 8-bit displacement
+ disp12 12-bit displacement
+
+ add #imm,Rn lds.l @Rn+,PR
+ add Rm,Rn mac.w @Rm+,@Rn+
+ addc Rm,Rn mov #imm,Rn
+ addv Rm,Rn mov Rm,Rn
+ and #imm,R0 mov.b Rm,@(R0,Rn)
+ and Rm,Rn mov.b Rm,@-Rn
+ and.b #imm,@(R0,GBR) mov.b Rm,@Rn
+ bf disp8 mov.b @(disp,Rm),R0
+ bra disp12 mov.b @(disp,GBR),R0
+ bsr disp12 mov.b @(R0,Rm),Rn
+ bt disp8 mov.b @Rm+,Rn
+ clrmac mov.b @Rm,Rn
+ clrt mov.b R0,@(disp,Rm)
+ cmp/eq #imm,R0 mov.b R0,@(disp,GBR)
+ cmp/eq Rm,Rn mov.l Rm,@(disp,Rn)
+ cmp/ge Rm,Rn mov.l Rm,@(R0,Rn)
+ cmp/gt Rm,Rn mov.l Rm,@-Rn
+ cmp/hi Rm,Rn mov.l Rm,@Rn
+ cmp/hs Rm,Rn mov.l @(disp,Rn),Rm
+ cmp/pl Rn mov.l @(disp,GBR),R0
+ cmp/pz Rn mov.l @(disp,PC),Rn
+ cmp/str Rm,Rn mov.l @(R0,Rm),Rn
+ div0s Rm,Rn mov.l @Rm+,Rn
+ div0u mov.l @Rm,Rn
+ div1 Rm,Rn mov.l R0,@(disp,GBR)
+ exts.b Rm,Rn mov.w Rm,@(R0,Rn)
+ exts.w Rm,Rn mov.w Rm,@-Rn
+ extu.b Rm,Rn mov.w Rm,@Rn
+ extu.w Rm,Rn mov.w @(disp,Rm),R0
+ jmp @Rn mov.w @(disp,GBR),R0
+ jsr @Rn mov.w @(disp,PC),Rn
+ ldc Rn,GBR mov.w @(R0,Rm),Rn
+ ldc Rn,SR mov.w @Rm+,Rn
+ ldc Rn,VBR mov.w @Rm,Rn
+ ldc.l @Rn+,GBR mov.w R0,@(disp,Rm)
+ ldc.l @Rn+,SR mov.w R0,@(disp,GBR)
+ ldc.l @Rn+,VBR mova @(disp,PC),R0
+ lds Rn,MACH movt Rn
+ lds Rn,MACL muls Rm,Rn
+ lds Rn,PR mulu Rm,Rn
+ lds.l @Rn+,MACH neg Rm,Rn
+ lds.l @Rn+,MACL negc Rm,Rn
+
+ nop stc VBR,Rn
+ not Rm,Rn stc.l GBR,@-Rn
+ or #imm,R0 stc.l SR,@-Rn
+ or Rm,Rn stc.l VBR,@-Rn
+ or.b #imm,@(R0,GBR) sts MACH,Rn
+ rotcl Rn sts MACL,Rn
+ rotcr Rn sts PR,Rn
+ rotl Rn sts.l MACH,@-Rn
+ rotr Rn sts.l MACL,@-Rn
+ rte sts.l PR,@-Rn
+ rts sub Rm,Rn
+ sett subc Rm,Rn
+ shal Rn subv Rm,Rn
+ shar Rn swap.b Rm,Rn
+ shll Rn swap.w Rm,Rn
+ shll16 Rn tas.b @Rn
+ shll2 Rn trapa #imm
+ shll8 Rn tst #imm,R0
+ shlr Rn tst Rm,Rn
+ shlr16 Rn tst.b #imm,@(R0,GBR)
+ shlr2 Rn xor #imm,R0
+ shlr8 Rn xor Rm,Rn
+ sleep xor.b #imm,@(R0,GBR)
+ stc GBR,Rn xtrct Rm,Rn
+ stc SR,Rn
+
+
+File: as.info, Node: SH64-Dependent, Next: PDP-11-Dependent, Prev: SH-Dependent, Up: Machine Dependencies
+
+9.33 SuperH SH64 Dependent Features
+===================================
+
+* Menu:
+
+* SH64 Options:: Options
+* SH64 Syntax:: Syntax
+* SH64 Directives:: SH64 Machine Directives
+* SH64 Opcodes:: Opcodes
+
+
+File: as.info, Node: SH64 Options, Next: SH64 Syntax, Up: SH64-Dependent
+
+9.33.1 Options
+--------------
+
+`-isa=sh4 | sh4a'
+ Specify the sh4 or sh4a instruction set.
+
+`-isa=dsp'
+ Enable sh-dsp insns, and disable sh3e / sh4 insns.
+
+`-isa=fp'
+ Enable sh2e, sh3e, sh4, and sh4a insn sets.
+
+`-isa=all'
+ Enable sh1, sh2, sh2e, sh3, sh3e, sh4, sh4a, and sh-dsp insn sets.
+
+`-isa=shmedia | -isa=shcompact'
+ Specify the default instruction set. `SHmedia' specifies the
+ 32-bit opcodes, and `SHcompact' specifies the 16-bit opcodes
+ compatible with previous SH families. The default depends on the
+ ABI selected; the default for the 64-bit ABI is SHmedia, and the
+ default for the 32-bit ABI is SHcompact. If neither the ABI nor
+ the ISA is specified, the default is 32-bit SHcompact.
+
+ Note that the `.mode' pseudo-op is not permitted if the ISA is not
+ specified on the command line.
+
+`-abi=32 | -abi=64'
+ Specify the default ABI. If the ISA is specified and the ABI is
+ not, the default ABI depends on the ISA, with SHmedia defaulting
+ to 64-bit and SHcompact defaulting to 32-bit.
+
+ Note that the `.abi' pseudo-op is not permitted if the ABI is not
+ specified on the command line. When the ABI is specified on the
+ command line, any `.abi' pseudo-ops in the source must match it.
+
+`-shcompact-const-crange'
+ Emit code-range descriptors for constants in SHcompact code
+ sections.
+
+`-no-mix'
+ Disallow SHmedia code in the same section as constants and
+ SHcompact code.
+
+`-no-expand'
+ Do not expand MOVI, PT, PTA or PTB instructions.
+
+`-expand-pt32'
+ With -abi=64, expand PT, PTA and PTB instructions to 32 bits only.
+
+`-h-tick-hex'
+ Support H'00 style hex constants in addition to 0x00 style.
+
+
+
+File: as.info, Node: SH64 Syntax, Next: SH64 Directives, Prev: SH64 Options, Up: SH64-Dependent
+
+9.33.2 Syntax
+-------------
+
+* Menu:
+
+* SH64-Chars:: Special Characters
+* SH64-Regs:: Register Names
+* SH64-Addressing:: Addressing Modes
+
+
+File: as.info, Node: SH64-Chars, Next: SH64-Regs, Up: SH64 Syntax
+
+9.33.2.1 Special Characters
+...........................
+
+`!' is the line comment character.
+
+ You can use `;' instead of a newline to separate statements.
+
+ Since `$' has no special meaning, you may use it in symbol names.
+
+
+File: as.info, Node: SH64-Regs, Next: SH64-Addressing, Prev: SH64-Chars, Up: SH64 Syntax
+
+9.33.2.2 Register Names
+.......................
+
+You can use the predefined symbols `r0' through `r63' to refer to the
+SH64 general registers, `cr0' through `cr63' for control registers,
+`tr0' through `tr7' for target address registers, `fr0' through `fr63'
+for single-precision floating point registers, `dr0' through `dr62'
+(even numbered registers only) for double-precision floating point
+registers, `fv0' through `fv60' (multiples of four only) for
+single-precision floating point vectors, `fp0' through `fp62' (even
+numbered registers only) for single-precision floating point pairs,
+`mtrx0' through `mtrx48' (multiples of 16 only) for 4x4 matrices of
+single-precision floating point registers, `pc' for the program
+counter, and `fpscr' for the floating point status and control register.
+
+ You can also refer to the control registers by the mnemonics `sr',
+`ssr', `pssr', `intevt', `expevt', `pexpevt', `tra', `spc', `pspc',
+`resvec', `vbr', `tea', `dcr', `kcr0', `kcr1', `ctc', and `usr'.
+
+
+File: as.info, Node: SH64-Addressing, Prev: SH64-Regs, Up: SH64 Syntax
+
+9.33.2.3 Addressing Modes
+.........................
+
+SH64 operands consist of either a register or immediate value. The
+immediate value can be a constant or label reference (or portion of a
+label reference), as in this example:
+
+ movi 4,r2
+ pt function, tr4
+ movi (function >> 16) & 65535,r0
+ shori function & 65535, r0
+ ld.l r0,4,r0
+
+ Instruction label references can reference labels in either SHmedia
+or SHcompact. To differentiate between the two, labels in SHmedia
+sections will always have the least significant bit set (i.e. they will
+be odd), which SHcompact labels will have the least significant bit
+reset (i.e. they will be even). If you need to reference the actual
+address of a label, you can use the `datalabel' modifier, as in this
+example:
+
+ .long function
+ .long datalabel function
+
+ In that example, the first longword may or may not have the least
+significant bit set depending on whether the label is an SHmedia label
+or an SHcompact label. The second longword will be the actual address
+of the label, regardless of what type of label it is.
+
+
+File: as.info, Node: SH64 Directives, Next: SH64 Opcodes, Prev: SH64 Syntax, Up: SH64-Dependent
+
+9.33.3 SH64 Machine Directives
+------------------------------
+
+In addition to the SH directives, the SH64 provides the following
+directives:
+
+`.mode [shmedia|shcompact]'
+`.isa [shmedia|shcompact]'
+ Specify the ISA for the following instructions (the two directives
+ are equivalent). Note that programs such as `objdump' rely on
+ symbolic labels to determine when such mode switches occur (by
+ checking the least significant bit of the label's address), so
+ such mode/isa changes should always be followed by a label (in
+ practice, this is true anyway). Note that you cannot use these
+ directives if you didn't specify an ISA on the command line.
+
+`.abi [32|64]'
+ Specify the ABI for the following instructions. Note that you
+ cannot use this directive unless you specified an ABI on the
+ command line, and the ABIs specified must match.
+
+`.uaquad'
+ Like .uaword and .ualong, this allows you to specify an
+ intentionally unaligned quadword (64 bit word).
+
+
+
+File: as.info, Node: SH64 Opcodes, Prev: SH64 Directives, Up: SH64-Dependent
+
+9.33.4 Opcodes
+--------------
+
+For detailed information on the SH64 machine instruction set, see
+`SuperH 64 bit RISC Series Architecture Manual' (SuperH, Inc.).
+
+ `as' implements all the standard SH64 opcodes. In addition, the
+following pseudo-opcodes may be expanded into one or more alternate
+opcodes:
+
+`movi'
+ If the value doesn't fit into a standard `movi' opcode, `as' will
+ replace the `movi' with a sequence of `movi' and `shori' opcodes.
+
+`pt'
+ This expands to a sequence of `movi' and `shori' opcode, followed
+ by a `ptrel' opcode, or to a `pta' or `ptb' opcode, depending on
+ the label referenced.
+
+
+
+File: as.info, Node: Sparc-Dependent, Next: TIC54X-Dependent, Prev: SCORE-Dependent, Up: Machine Dependencies
+
+9.34 SPARC Dependent Features
+=============================
+
+* Menu:
+
+* Sparc-Opts:: Options
+* Sparc-Aligned-Data:: Option to enforce aligned data
+* Sparc-Syntax:: Syntax
+* Sparc-Float:: Floating Point
+* Sparc-Directives:: Sparc Machine Directives
+
+
+File: as.info, Node: Sparc-Opts, Next: Sparc-Aligned-Data, Up: Sparc-Dependent
+
+9.34.1 Options
+--------------
+
+The SPARC chip family includes several successive versions, using the
+same core instruction set, but including a few additional instructions
+at each version. There are exceptions to this however. For details on
+what instructions each variant supports, please see the chip's
+architecture reference manual.
+
+ By default, `as' assumes the core instruction set (SPARC v6), but
+"bumps" the architecture level as needed: it switches to successively
+higher architectures as it encounters instructions that only exist in
+the higher levels.
+
+ If not configured for SPARC v9 (`sparc64-*-*') GAS will not bump
+past sparclite by default, an option must be passed to enable the v9
+instructions.
+
+ GAS treats sparclite as being compatible with v8, unless an
+architecture is explicitly requested. SPARC v9 is always incompatible
+with sparclite.
+
+`-Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite'
+`-Av8plus | -Av8plusa | -Av9 | -Av9a'
+ Use one of the `-A' options to select one of the SPARC
+ architectures explicitly. If you select an architecture
+ explicitly, `as' reports a fatal error if it encounters an
+ instruction or feature requiring an incompatible or higher level.
+
+ `-Av8plus' and `-Av8plusa' select a 32 bit environment.
+
+ `-Av9' and `-Av9a' select a 64 bit environment and are not
+ available unless GAS is explicitly configured with 64 bit
+ environment support.
+
+ `-Av8plusa' and `-Av9a' enable the SPARC V9 instruction set with
+ UltraSPARC extensions.
+
+`-xarch=v8plus | -xarch=v8plusa'
+ For compatibility with the SunOS v9 assembler. These options are
+ equivalent to -Av8plus and -Av8plusa, respectively.
+
+`-bump'
+ Warn whenever it is necessary to switch to another level. If an
+ architecture level is explicitly requested, GAS will not issue
+ warnings until that level is reached, and will then bump the level
+ as required (except between incompatible levels).
+
+`-32 | -64'
+ Select the word size, either 32 bits or 64 bits. These options
+ are only available with the ELF object file format, and require
+ that the necessary BFD support has been included.
+
+
+File: as.info, Node: Sparc-Aligned-Data, Next: Sparc-Syntax, Prev: Sparc-Opts, Up: Sparc-Dependent
+
+9.34.2 Enforcing aligned data
+-----------------------------
+
+SPARC GAS normally permits data to be misaligned. For example, it
+permits the `.long' pseudo-op to be used on a byte boundary. However,
+the native SunOS assemblers issue an error when they see misaligned
+data.
+
+ You can use the `--enforce-aligned-data' option to make SPARC GAS
+also issue an error about misaligned data, just as the SunOS assemblers
+do.
+
+ The `--enforce-aligned-data' option is not the default because gcc
+issues misaligned data pseudo-ops when it initializes certain packed
+data structures (structures defined using the `packed' attribute). You
+may have to assemble with GAS in order to initialize packed data
+structures in your own code.
+
+
+File: as.info, Node: Sparc-Syntax, Next: Sparc-Float, Prev: Sparc-Aligned-Data, Up: Sparc-Dependent
+
+9.34.3 Sparc Syntax
+-------------------
+
+The assembler syntax closely follows The Sparc Architecture Manual,
+versions 8 and 9, as well as most extensions defined by Sun for their
+UltraSPARC and Niagara line of processors.
+
+* Menu:
+
+* Sparc-Chars:: Special Characters
+* Sparc-Regs:: Register Names
+* Sparc-Constants:: Constant Names
+* Sparc-Relocs:: Relocations
+* Sparc-Size-Translations:: Size Translations
+
+
+File: as.info, Node: Sparc-Chars, Next: Sparc-Regs, Up: Sparc-Syntax
+
+9.34.3.1 Special Characters
+...........................
+
+`#' is the line comment character.
+
+ `;' can be used instead of a newline to separate statements.
+
+
+File: as.info, Node: Sparc-Regs, Next: Sparc-Constants, Prev: Sparc-Chars, Up: Sparc-Syntax
+
+9.34.3.2 Register Names
+.......................
+
+The Sparc integer register file is broken down into global, outgoing,
+local, and incoming.
+
+ * The 8 global registers are referred to as `%gN'.
+
+ * The 8 outgoing registers are referred to as `%oN'.
+
+ * The 8 local registers are referred to as `%lN'.
+
+ * The 8 incoming registers are referred to as `%iN'.
+
+ * The frame pointer register `%i6' can be referenced using the alias
+ `%fp'.
+
+ * The stack pointer register `%o6' can be referenced using the alias
+ `%sp'.
+
+ Floating point registers are simply referred to as `%fN'. When
+assembling for pre-V9, only 32 floating point registers are available.
+For V9 and later there are 64, but there are restrictions when
+referencing the upper 32 registers. They can only be accessed as
+double or quad, and thus only even or quad numbered accesses are
+allowed. For example, `%f34' is a legal floating point register, but
+`%f35' is not.
+
+ Certain V9 instructions allow access to ancillary state registers.
+Most simply they can be referred to as `%asrN' where N can be from 16
+to 31. However, there are some aliases defined to reference ASR
+registers defined for various UltraSPARC processors:
+
+ * The tick compare register is referred to as `%tick_cmpr'.
+
+ * The system tick register is referred to as `%stick'. An alias,
+ `%sys_tick', exists but is deprecated and should not be used by
+ new software.
+
+ * The system tick compare register is referred to as `%stick_cmpr'.
+ An alias, `%sys_tick_cmpr', exists but is deprecated and should
+ not be used by new software.
+
+ * The software interrupt register is referred to as `%softint'.
+
+ * The set software interrupt register is referred to as
+ `%set_softint'. The mnemonic `%softint_set' is provided as an
+ alias.
+
+ * The clear software interrupt register is referred to as
+ `%clear_softint'. The mnemonic `%softint_clear' is provided as an
+ alias.
+
+ * The performance instrumentation counters register is referred to as
+ `%pic'.
+
+ * The performance control register is referred to as `%pcr'.
+
+ * The graphics status register is referred to as `%gsr'.
+
+ * The V9 dispatch control register is referred to as `%dcr'.
+
+ Various V9 branch and conditional move instructions allow
+specification of which set of integer condition codes to test. These
+are referred to as `%xcc' and `%icc'.
+
+ In V9, there are 4 sets of floating point condition codes which are
+referred to as `%fccN'.
+
+ Several special privileged and non-privileged registers exist:
+
+ * The V9 address space identifier register is referred to as `%asi'.
+
+ * The V9 restorable windows register is referred to as `%canrestore'.
+
+ * The V9 savable windows register is referred to as `%cansave'.
+
+ * The V9 clean windows register is referred to as `%cleanwin'.
+
+ * The V9 current window pointer register is referred to as `%cwp'.
+
+ * The floating-point queue register is referred to as `%fq'.
+
+ * The V8 co-processor queue register is referred to as `%cq'.
+
+ * The floating point status register is referred to as `%fsr'.
+
+ * The other windows register is referred to as `%otherwin'.
+
+ * The V9 program counter register is referred to as `%pc'.
+
+ * The V9 next program counter register is referred to as `%npc'.
+
+ * The V9 processor interrupt level register is referred to as `%pil'.
+
+ * The V9 processor state register is referred to as `%pstate'.
+
+ * The trap base address register is referred to as `%tba'.
+
+ * The V9 tick register is referred to as `%tick'.
+
+ * The V9 trap level is referred to as `%tl'.
+
+ * The V9 trap program counter is referred to as `%tpc'.
+
+ * The V9 trap next program counter is referred to as `%tnpc'.
+
+ * The V9 trap state is referred to as `%tstate'.
+
+ * The V9 trap type is referred to as `%tt'.
+
+ * The V9 condition codes is referred to as `%ccr'.
+
+ * The V9 floating-point registers state is referred to as `%fprs'.
+
+ * The V9 version register is referred to as `%ver'.
+
+ * The V9 window state register is referred to as `%wstate'.
+
+ * The Y register is referred to as `%y'.
+
+ * The V8 window invalid mask register is referred to as `%wim'.
+
+ * The V8 processor state register is referred to as `%psr'.
+
+ * The V9 global register level register is referred to as `%gl'.
+
+ Several special register names exist for hypervisor mode code:
+
+ * The hyperprivileged processor state register is referred to as
+ `%hpstate'.
+
+ * The hyperprivileged trap state register is referred to as
+ `%htstate'.
+
+ * The hyperprivileged interrupt pending register is referred to as
+ `%hintp'.
+
+ * The hyperprivileged trap base address register is referred to as
+ `%htba'.
+
+ * The hyperprivileged implementation version register is referred to
+ as `%hver'.
+
+ * The hyperprivileged system tick compare register is referred to as
+ `%hstick_cmpr'. Note that there is no `%hstick' register, the
+ normal `%stick' is used.
+
+
+File: as.info, Node: Sparc-Constants, Next: Sparc-Relocs, Prev: Sparc-Regs, Up: Sparc-Syntax
+
+9.34.3.3 Constants
+..................
+
+Several Sparc instructions take an immediate operand field for which
+mnemonic names exist. Two such examples are `membar' and `prefetch'.
+Another example are the set of V9 memory access instruction that allow
+specification of an address space identifier.
+
+ The `membar' instruction specifies a memory barrier that is the
+defined by the operand which is a bitmask. The supported mask
+mnemonics are:
+
+ * `#Sync' requests that all operations (including nonmemory
+ reference operations) appearing prior to the `membar' must have
+ been performed and the effects of any exceptions become visible
+ before any instructions after the `membar' may be initiated. This
+ corresponds to `membar' cmask field bit 2.
+
+ * `#MemIssue' requests that all memory reference operations
+ appearing prior to the `membar' must have been performed before
+ any memory operation after the `membar' may be initiated. This
+ corresponds to `membar' cmask field bit 1.
+
+ * `#Lookaside' requests that a store appearing prior to the `membar'
+ must complete before any load following the `membar' referencing
+ the same address can be initiated. This corresponds to `membar'
+ cmask field bit 0.
+
+ * `#StoreStore' defines that the effects of all stores appearing
+ prior to the `membar' instruction must be visible to all
+ processors before the effect of any stores following the `membar'.
+ Equivalent to the deprecated `stbar' instruction. This
+ corresponds to `membar' mmask field bit 3.
+
+ * `#LoadStore' defines all loads appearing prior to the `membar'
+ instruction must have been performed before the effect of any
+ stores following the `membar' is visible to any other processor.
+ This corresponds to `membar' mmask field bit 2.
+
+ * `#StoreLoad' defines that the effects of all stores appearing
+ prior to the `membar' instruction must be visible to all
+ processors before loads following the `membar' may be performed.
+ This corresponds to `membar' mmask field bit 1.
+
+ * `#LoadLoad' defines that all loads appearing prior to the `membar'
+ instruction must have been performed before any loads following
+ the `membar' may be performed. This corresponds to `membar' mmask
+ field bit 0.
+
+
+ These values can be ored together, for example:
+
+ membar #Sync
+ membar #StoreLoad | #LoadLoad
+ membar #StoreLoad | #StoreStore
+
+ The `prefetch' and `prefetcha' instructions take a prefetch function
+code. The following prefetch function code constant mnemonics are
+available:
+
+ * `#n_reads' requests a prefetch for several reads, and corresponds
+ to a prefetch function code of 0.
+
+ `#one_read' requests a prefetch for one read, and corresponds to a
+ prefetch function code of 1.
+
+ `#n_writes' requests a prefetch for several writes (and possibly
+ reads), and corresponds to a prefetch function code of 2.
+
+ `#one_write' requests a prefetch for one write, and corresponds to
+ a prefetch function code of 3.
+
+ `#page' requests a prefetch page, and corresponds to a prefetch
+ function code of 4.
+
+ `#invalidate' requests a prefetch invalidate, and corresponds to a
+ prefetch function code of 16.
+
+ `#unified' requests a prefetch to the nearest unified cache, and
+ corresponds to a prefetch function code of 17.
+
+ `#n_reads_strong' requests a strong prefetch for several reads,
+ and corresponds to a prefetch function code of 20.
+
+ `#one_read_strong' requests a strong prefetch for one read, and
+ corresponds to a prefetch function code of 21.
+
+ `#n_writes_strong' requests a strong prefetch for several writes,
+ and corresponds to a prefetch function code of 22.
+
+ `#one_write_strong' requests a strong prefetch for one write, and
+ corresponds to a prefetch function code of 23.
+
+ Onle one prefetch code may be specified. Here are some examples:
+
+ prefetch [%l0 + %l2], #one_read
+ prefetch [%g2 + 8], #n_writes
+ prefetcha [%g1] 0x8, #unified
+ prefetcha [%o0 + 0x10] %asi, #n_reads
+
+ The actual behavior of a given prefetch function code is processor
+ specific. If a processor does not implement a given prefetch
+ function code, it will treat the prefetch instruction as a nop.
+
+ For instructions that accept an immediate address space identifier,
+ `as' provides many mnemonics corresponding to V9 defined as well
+ as UltraSPARC and Niagara extended values. For example, `#ASI_P'
+ and `#ASI_BLK_INIT_QUAD_LDD_AIUS'. See the V9 and processor
+ specific manuals for details.
+
+
+
+File: as.info, Node: Sparc-Relocs, Next: Sparc-Size-Translations, Prev: Sparc-Constants, Up: Sparc-Syntax
+
+9.34.3.4 Relocations
+....................
+
+ELF relocations are available as defined in the 32-bit and 64-bit Sparc
+ELF specifications.
+
+ `R_SPARC_HI22' is obtained using `%hi' and `R_SPARC_LO10' is
+obtained using `%lo'. Likewise `R_SPARC_HIX22' is obtained from `%hix'
+and `R_SPARC_LOX10' is obtained using `%lox'. For example:
+
+ sethi %hi(symbol), %g1
+ or %g1, %lo(symbol), %g1
+
+ sethi %hix(symbol), %g1
+ xor %g1, %lox(symbol), %g1
+
+ These "high" mnemonics extract bits 31:10 of their operand, and the
+"low" mnemonics extract bits 9:0 of their operand.
+
+ V9 code model relocations can be requested as follows:
+
+ * `R_SPARC_HH22' is requested using `%hh'. It can also be generated
+ using `%uhi'.
+
+ * `R_SPARC_HM10' is requested using `%hm'. It can also be generated
+ using `%ulo'.
+
+ * `R_SPARC_LM22' is requested using `%lm'.
+
+ * `R_SPARC_H44' is requested using `%h44'.
+
+ * `R_SPARC_M44' is requested using `%m44'.
+
+ * `R_SPARC_L44' is requested using `%l44'.
+
+ The PC relative relocation `R_SPARC_PC22' can be obtained by
+enclosing an operand inside of `%pc22'. Likewise, the `R_SPARC_PC10'
+relocation can be obtained using `%pc10'. These are mostly used when
+assembling PIC code. For example, the standard PIC sequence on Sparc
+to get the base of the global offset table, PC relative, into a
+register, can be performed as:
+
+ sethi %pc22(_GLOBAL_OFFSET_TABLE_-4), %l7
+ add %l7, %pc10(_GLOBAL_OFFSET_TABLE_+4), %l7
+
+ Several relocations exist to allow the link editor to potentially
+optimize GOT data references. The `R_SPARC_GOTDATA_OP_HIX22'
+relocation can obtained by enclosing an operand inside of
+`%gdop_hix22'. The `R_SPARC_GOTDATA_OP_LOX10' relocation can obtained
+by enclosing an operand inside of `%gdop_lox10'. Likewise,
+`R_SPARC_GOTDATA_OP' can be obtained by enclosing an operand inside of
+`%gdop'. For example, assuming the GOT base is in register `%l7':
+
+ sethi %gdop_hix22(symbol), %l1
+ xor %l1, %gdop_lox10(symbol), %l1
+ ld [%l7 + %l1], %l2, %gdop(symbol)
+
+ There are many relocations that can be requested for access to
+thread local storage variables. All of the Sparc TLS mnemonics are
+supported:
+
+ * `R_SPARC_TLS_GD_HI22' is requested using `%tgd_hi22'.
+
+ * `R_SPARC_TLS_GD_LO10' is requested using `%tgd_lo10'.
+
+ * `R_SPARC_TLS_GD_ADD' is requested using `%tgd_add'.
+
+ * `R_SPARC_TLS_GD_CALL' is requested using `%tgd_call'.
+
+ * `R_SPARC_TLS_LDM_HI22' is requested using `%tldm_hi22'.
+
+ * `R_SPARC_TLS_LDM_LO10' is requested using `%tldm_lo10'.
+
+ * `R_SPARC_TLS_LDM_ADD' is requested using `%tldm_add'.
+
+ * `R_SPARC_TLS_LDM_CALL' is requested using `%tldm_call'.
+
+ * `R_SPARC_TLS_LDO_HIX22' is requested using `%tldo_hix22'.
+
+ * `R_SPARC_TLS_LDO_LOX10' is requested using `%tldo_lox10'.
+
+ * `R_SPARC_TLS_LDO_ADD' is requested using `%tldo_add'.
+
+ * `R_SPARC_TLS_IE_HI22' is requested using `%tie_hi22'.
+
+ * `R_SPARC_TLS_IE_LO10' is requested using `%tie_lo10'.
+
+ * `R_SPARC_TLS_IE_LD' is requested using `%tie_ld'.
+
+ * `R_SPARC_TLS_IE_LDX' is requested using `%tie_ldx'.
+
+ * `R_SPARC_TLS_IE_ADD' is requested using `%tie_add'.
+
+ * `R_SPARC_TLS_LE_HIX22' is requested using `%tle_hix22'.
+
+ * `R_SPARC_TLS_LE_LOX10' is requested using `%tle_lox10'.
+
+ Here are some example TLS model sequences.
+
+ First, General Dynamic:
+
+ sethi %tgd_hi22(symbol), %l1
+ add %l1, %tgd_lo10(symbol), %l1
+ add %l7, %l1, %o0, %tgd_add(symbol)
+ call __tls_get_addr, %tgd_call(symbol)
+ nop
+
+ Local Dynamic:
+
+ sethi %tldm_hi22(symbol), %l1
+ add %l1, %tldm_lo10(symbol), %l1
+ add %l7, %l1, %o0, %tldm_add(symbol)
+ call __tls_get_addr, %tldm_call(symbol)
+ nop
+
+ sethi %tldo_hix22(symbol), %l1
+ xor %l1, %tldo_lox10(symbol), %l1
+ add %o0, %l1, %l1, %tldo_add(symbol)
+
+ Initial Exec:
+
+ sethi %tie_hi22(symbol), %l1
+ add %l1, %tie_lo10(symbol), %l1
+ ld [%l7 + %l1], %o0, %tie_ld(symbol)
+ add %g7, %o0, %o0, %tie_add(symbol)
+
+ sethi %tie_hi22(symbol), %l1
+ add %l1, %tie_lo10(symbol), %l1
+ ldx [%l7 + %l1], %o0, %tie_ldx(symbol)
+ add %g7, %o0, %o0, %tie_add(symbol)
+
+ And finally, Local Exec:
+
+ sethi %tle_hix22(symbol), %l1
+ add %l1, %tle_lox10(symbol), %l1
+ add %g7, %l1, %l1
+
+ When assembling for 64-bit, and a secondary constant addend is
+specified in an address expression that would normally generate an
+`R_SPARC_LO10' relocation, the assembler will emit an `R_SPARC_OLO10'
+instead.
+
+
+File: as.info, Node: Sparc-Size-Translations, Prev: Sparc-Relocs, Up: Sparc-Syntax
+
+9.34.3.5 Size Translations
+..........................
+
+Often it is desirable to write code in an operand size agnostic manner.
+`as' provides support for this via operand size opcode translations.
+Translations are supported for loads, stores, shifts, compare-and-swap
+atomics, and the `clr' synthetic instruction.
+
+ If generating 32-bit code, `as' will generate the 32-bit opcode.
+Whereas if 64-bit code is being generated, the 64-bit opcode will be
+emitted. For example `ldn' will be transformed into `ld' for 32-bit
+code and `ldx' for 64-bit code.
+
+ Here is an example meant to demonstrate all the supported opcode
+translations:
+
+ ldn [%o0], %o1
+ ldna [%o0] %asi, %o2
+ stn %o1, [%o0]
+ stna %o2, [%o0] %asi
+ slln %o3, 3, %o3
+ srln %o4, 8, %o4
+ sran %o5, 12, %o5
+ casn [%o0], %o1, %o2
+ casna [%o0] %asi, %o1, %o2
+ clrn %g1
+
+ In 32-bit mode `as' will emit:
+
+ ld [%o0], %o1
+ lda [%o0] %asi, %o2
+ st %o1, [%o0]
+ sta %o2, [%o0] %asi
+ sll %o3, 3, %o3
+ srl %o4, 8, %o4
+ sra %o5, 12, %o5
+ cas [%o0], %o1, %o2
+ casa [%o0] %asi, %o1, %o2
+ clr %g1
+
+ And in 64-bit mode `as' will emit:
+
+ ldx [%o0], %o1
+ ldxa [%o0] %asi, %o2
+ stx %o1, [%o0]
+ stxa %o2, [%o0] %asi
+ sllx %o3, 3, %o3
+ srlx %o4, 8, %o4
+ srax %o5, 12, %o5
+ casx [%o0], %o1, %o2
+ casxa [%o0] %asi, %o1, %o2
+ clrx %g1
+
+ Finally, the `.nword' translating directive is supported as well.
+It is documented in the section on Sparc machine directives.
+
+
+File: as.info, Node: Sparc-Float, Next: Sparc-Directives, Prev: Sparc-Syntax, Up: Sparc-Dependent
+
+9.34.4 Floating Point
+---------------------
+
+The Sparc uses IEEE floating-point numbers.
+
+
+File: as.info, Node: Sparc-Directives, Prev: Sparc-Float, Up: Sparc-Dependent
+
+9.34.5 Sparc Machine Directives
+-------------------------------
+
+The Sparc version of `as' supports the following additional machine
+directives:
+
+`.align'
+ This must be followed by the desired alignment in bytes.
+
+`.common'
+ This must be followed by a symbol name, a positive number, and
+ `"bss"'. This behaves somewhat like `.comm', but the syntax is
+ different.
+
+`.half'
+ This is functionally identical to `.short'.
+
+`.nword'
+ On the Sparc, the `.nword' directive produces native word sized
+ value, ie. if assembling with -32 it is equivalent to `.word', if
+ assembling with -64 it is equivalent to `.xword'.
+
+`.proc'
+ This directive is ignored. Any text following it on the same line
+ is also ignored.
+
+`.register'
+ This directive declares use of a global application or system
+ register. It must be followed by a register name %g2, %g3, %g6 or
+ %g7, comma and the symbol name for that register. If symbol name
+ is `#scratch', it is a scratch register, if it is `#ignore', it
+ just suppresses any errors about using undeclared global register,
+ but does not emit any information about it into the object file.
+ This can be useful e.g. if you save the register before use and
+ restore it after.
+
+`.reserve'
+ This must be followed by a symbol name, a positive number, and
+ `"bss"'. This behaves somewhat like `.lcomm', but the syntax is
+ different.
+
+`.seg'
+ This must be followed by `"text"', `"data"', or `"data1"'. It
+ behaves like `.text', `.data', or `.data 1'.
+
+`.skip'
+ This is functionally identical to the `.space' directive.
+
+`.word'
+ On the Sparc, the `.word' directive produces 32 bit values,
+ instead of the 16 bit values it produces on many other machines.
+
+`.xword'
+ On the Sparc V9 processor, the `.xword' directive produces 64 bit
+ values.
+
+
+File: as.info, Node: TIC54X-Dependent, Next: V850-Dependent, Prev: Sparc-Dependent, Up: Machine Dependencies
+
+9.35 TIC54X Dependent Features
+==============================
+
+* Menu:
+
+* TIC54X-Opts:: Command-line Options
+* TIC54X-Block:: Blocking
+* TIC54X-Env:: Environment Settings
+* TIC54X-Constants:: Constants Syntax
+* TIC54X-Subsyms:: String Substitution
+* TIC54X-Locals:: Local Label Syntax
+* TIC54X-Builtins:: Builtin Assembler Math Functions
+* TIC54X-Ext:: Extended Addressing Support
+* TIC54X-Directives:: Directives
+* TIC54X-Macros:: Macro Features
+* TIC54X-MMRegs:: Memory-mapped Registers
+
+
+File: as.info, Node: TIC54X-Opts, Next: TIC54X-Block, Up: TIC54X-Dependent
+
+9.35.1 Options
+--------------
+
+The TMS320C54X version of `as' has a few machine-dependent options.
+
+ You can use the `-mfar-mode' option to enable extended addressing
+mode. All addresses will be assumed to be > 16 bits, and the
+appropriate relocation types will be used. This option is equivalent
+to using the `.far_mode' directive in the assembly code. If you do not
+use the `-mfar-mode' option, all references will be assumed to be 16
+bits. This option may be abbreviated to `-mf'.
+
+ You can use the `-mcpu' option to specify a particular CPU. This
+option is equivalent to using the `.version' directive in the assembly
+code. For recognized CPU codes, see *Note `.version':
+TIC54X-Directives. The default CPU version is `542'.
+
+ You can use the `-merrors-to-file' option to redirect error output
+to a file (this provided for those deficient environments which don't
+provide adequate output redirection). This option may be abbreviated to
+`-me'.
+
+
+File: as.info, Node: TIC54X-Block, Next: TIC54X-Env, Prev: TIC54X-Opts, Up: TIC54X-Dependent
+
+9.35.2 Blocking
+---------------
+
+A blocked section or memory block is guaranteed not to cross the
+blocking boundary (usually a page, or 128 words) if it is smaller than
+the blocking size, or to start on a page boundary if it is larger than
+the blocking size.
+
+
+File: as.info, Node: TIC54X-Env, Next: TIC54X-Constants, Prev: TIC54X-Block, Up: TIC54X-Dependent
+
+9.35.3 Environment Settings
+---------------------------
+
+`C54XDSP_DIR' and `A_DIR' are semicolon-separated paths which are added
+to the list of directories normally searched for source and include
+files. `C54XDSP_DIR' will override `A_DIR'.
+
+
+File: as.info, Node: TIC54X-Constants, Next: TIC54X-Subsyms, Prev: TIC54X-Env, Up: TIC54X-Dependent
+
+9.35.4 Constants Syntax
+-----------------------
+
+The TIC54X version of `as' allows the following additional constant
+formats, using a suffix to indicate the radix:
+
+ Binary `000000B, 011000b'
+ Octal `10Q, 224q'
+ Hexadecimal `45h, 0FH'
+
+
+File: as.info, Node: TIC54X-Subsyms, Next: TIC54X-Locals, Prev: TIC54X-Constants, Up: TIC54X-Dependent
+
+9.35.5 String Substitution
+--------------------------
+
+A subset of allowable symbols (which we'll call subsyms) may be assigned
+arbitrary string values. This is roughly equivalent to C preprocessor
+#define macros. When `as' encounters one of these symbols, the symbol
+is replaced in the input stream by its string value. Subsym names
+*must* begin with a letter.
+
+ Subsyms may be defined using the `.asg' and `.eval' directives
+(*Note `.asg': TIC54X-Directives, *Note `.eval': TIC54X-Directives.
+
+ Expansion is recursive until a previously encountered symbol is
+seen, at which point substitution stops.
+
+ In this example, x is replaced with SYM2; SYM2 is replaced with
+SYM1, and SYM1 is replaced with x. At this point, x has already been
+encountered and the substitution stops.
+
+ .asg "x",SYM1
+ .asg "SYM1",SYM2
+ .asg "SYM2",x
+ add x,a ; final code assembled is "add x, a"
+
+ Macro parameters are converted to subsyms; a side effect of this is
+the normal `as' '\ARG' dereferencing syntax is unnecessary. Subsyms
+defined within a macro will have global scope, unless the `.var'
+directive is used to identify the subsym as a local macro variable
+*note `.var': TIC54X-Directives.
+
+ Substitution may be forced in situations where replacement might be
+ambiguous by placing colons on either side of the subsym. The following
+code:
+
+ .eval "10",x
+ LAB:X: add #x, a
+
+ When assembled becomes:
+
+ LAB10 add #10, a
+
+ Smaller parts of the string assigned to a subsym may be accessed with
+the following syntax:
+
+``:SYMBOL(CHAR_INDEX):''
+ Evaluates to a single-character string, the character at
+ CHAR_INDEX.
+
+``:SYMBOL(START,LENGTH):''
+ Evaluates to a substring of SYMBOL beginning at START with length
+ LENGTH.
+
+
+File: as.info, Node: TIC54X-Locals, Next: TIC54X-Builtins, Prev: TIC54X-Subsyms, Up: TIC54X-Dependent
+
+9.35.6 Local Labels
+-------------------
+
+Local labels may be defined in two ways:
+
+ * $N, where N is a decimal number between 0 and 9
+
+ * LABEL?, where LABEL is any legal symbol name.
+
+ Local labels thus defined may be redefined or automatically
+generated. The scope of a local label is based on when it may be
+undefined or reset. This happens when one of the following situations
+is encountered:
+
+ * .newblock directive *note `.newblock': TIC54X-Directives.
+
+ * The current section is changed (.sect, .text, or .data)
+
+ * Entering or leaving an included file
+
+ * The macro scope where the label was defined is exited
+
+
+File: as.info, Node: TIC54X-Builtins, Next: TIC54X-Ext, Prev: TIC54X-Locals, Up: TIC54X-Dependent
+
+9.35.7 Math Builtins
+--------------------
+
+The following built-in functions may be used to generate a
+floating-point value. All return a floating-point value except `$cvi',
+`$int', and `$sgn', which return an integer value.
+
+``$acos(EXPR)''
+ Returns the floating point arccosine of EXPR.
+
+``$asin(EXPR)''
+ Returns the floating point arcsine of EXPR.
+
+``$atan(EXPR)''
+ Returns the floating point arctangent of EXPR.
+
+``$atan2(EXPR1,EXPR2)''
+ Returns the floating point arctangent of EXPR1 / EXPR2.
+
+``$ceil(EXPR)''
+ Returns the smallest integer not less than EXPR as floating point.
+
+``$cosh(EXPR)''
+ Returns the floating point hyperbolic cosine of EXPR.
+
+``$cos(EXPR)''
+ Returns the floating point cosine of EXPR.
+
+``$cvf(EXPR)''
+ Returns the integer value EXPR converted to floating-point.
+
+``$cvi(EXPR)''
+ Returns the floating point value EXPR converted to integer.
+
+``$exp(EXPR)''
+ Returns the floating point value e ^ EXPR.
+
+``$fabs(EXPR)''
+ Returns the floating point absolute value of EXPR.
+
+``$floor(EXPR)''
+ Returns the largest integer that is not greater than EXPR as
+ floating point.
+
+``$fmod(EXPR1,EXPR2)''
+ Returns the floating point remainder of EXPR1 / EXPR2.
+
+``$int(EXPR)''
+ Returns 1 if EXPR evaluates to an integer, zero otherwise.
+
+``$ldexp(EXPR1,EXPR2)''
+ Returns the floating point value EXPR1 * 2 ^ EXPR2.
+
+``$log10(EXPR)''
+ Returns the base 10 logarithm of EXPR.
+
+``$log(EXPR)''
+ Returns the natural logarithm of EXPR.
+
+``$max(EXPR1,EXPR2)''
+ Returns the floating point maximum of EXPR1 and EXPR2.
+
+``$min(EXPR1,EXPR2)''
+ Returns the floating point minimum of EXPR1 and EXPR2.
+
+``$pow(EXPR1,EXPR2)''
+ Returns the floating point value EXPR1 ^ EXPR2.
+
+``$round(EXPR)''
+ Returns the nearest integer to EXPR as a floating point number.
+
+``$sgn(EXPR)''
+ Returns -1, 0, or 1 based on the sign of EXPR.
+
+``$sin(EXPR)''
+ Returns the floating point sine of EXPR.
+
+``$sinh(EXPR)''
+ Returns the floating point hyperbolic sine of EXPR.
+
+``$sqrt(EXPR)''
+ Returns the floating point square root of EXPR.
+
+``$tan(EXPR)''
+ Returns the floating point tangent of EXPR.
+
+``$tanh(EXPR)''
+ Returns the floating point hyperbolic tangent of EXPR.
+
+``$trunc(EXPR)''
+ Returns the integer value of EXPR truncated towards zero as
+ floating point.
+
+
+
+File: as.info, Node: TIC54X-Ext, Next: TIC54X-Directives, Prev: TIC54X-Builtins, Up: TIC54X-Dependent
+
+9.35.8 Extended Addressing
+--------------------------
+
+The `LDX' pseudo-op is provided for loading the extended addressing bits
+of a label or address. For example, if an address `_label' resides in
+extended program memory, the value of `_label' may be loaded as follows:
+ ldx #_label,16,a ; loads extended bits of _label
+ or #_label,a ; loads lower 16 bits of _label
+ bacc a ; full address is in accumulator A
+
+
+File: as.info, Node: TIC54X-Directives, Next: TIC54X-Macros, Prev: TIC54X-Ext, Up: TIC54X-Dependent
+
+9.35.9 Directives
+-----------------
+
+`.align [SIZE]'
+`.even'
+ Align the section program counter on the next boundary, based on
+ SIZE. SIZE may be any power of 2. `.even' is equivalent to
+ `.align' with a SIZE of 2.
+ `1'
+ Align SPC to word boundary
+
+ `2'
+ Align SPC to longword boundary (same as .even)
+
+ `128'
+ Align SPC to page boundary
+
+`.asg STRING, NAME'
+ Assign NAME the string STRING. String replacement is performed on
+ STRING before assignment.
+
+`.eval STRING, NAME'
+ Evaluate the contents of string STRING and assign the result as a
+ string to the subsym NAME. String replacement is performed on
+ STRING before assignment.
+
+`.bss SYMBOL, SIZE [, [BLOCKING_FLAG] [,ALIGNMENT_FLAG]]'
+ Reserve space for SYMBOL in the .bss section. SIZE is in words.
+ If present, BLOCKING_FLAG indicates the allocated space should be
+ aligned on a page boundary if it would otherwise cross a page
+ boundary. If present, ALIGNMENT_FLAG causes the assembler to
+ allocate SIZE on a long word boundary.
+
+`.byte VALUE [,...,VALUE_N]'
+`.ubyte VALUE [,...,VALUE_N]'
+`.char VALUE [,...,VALUE_N]'
+`.uchar VALUE [,...,VALUE_N]'
+ Place one or more bytes into consecutive words of the current
+ section. The upper 8 bits of each word is zero-filled. If a
+ label is used, it points to the word allocated for the first byte
+ encountered.
+
+`.clink ["SECTION_NAME"]'
+ Set STYP_CLINK flag for this section, which indicates to the
+ linker that if no symbols from this section are referenced, the
+ section should not be included in the link. If SECTION_NAME is
+ omitted, the current section is used.
+
+`.c_mode'
+ TBD.
+
+`.copy "FILENAME" | FILENAME'
+`.include "FILENAME" | FILENAME'
+ Read source statements from FILENAME. The normal include search
+ path is used. Normally .copy will cause statements from the
+ included file to be printed in the assembly listing and .include
+ will not, but this distinction is not currently implemented.
+
+`.data'
+ Begin assembling code into the .data section.
+
+`.double VALUE [,...,VALUE_N]'
+`.ldouble VALUE [,...,VALUE_N]'
+`.float VALUE [,...,VALUE_N]'
+`.xfloat VALUE [,...,VALUE_N]'
+ Place an IEEE single-precision floating-point representation of
+ one or more floating-point values into the current section. All
+ but `.xfloat' align the result on a longword boundary. Values are
+ stored most-significant word first.
+
+`.drlist'
+`.drnolist'
+ Control printing of directives to the listing file. Ignored.
+
+`.emsg STRING'
+`.mmsg STRING'
+`.wmsg STRING'
+ Emit a user-defined error, message, or warning, respectively.
+
+`.far_mode'
+ Use extended addressing when assembling statements. This should
+ appear only once per file, and is equivalent to the -mfar-mode
+ option *note `-mfar-mode': TIC54X-Opts.
+
+`.fclist'
+`.fcnolist'
+ Control printing of false conditional blocks to the listing file.
+
+`.field VALUE [,SIZE]'
+ Initialize a bitfield of SIZE bits in the current section. If
+ VALUE is relocatable, then SIZE must be 16. SIZE defaults to 16
+ bits. If VALUE does not fit into SIZE bits, the value will be
+ truncated. Successive `.field' directives will pack starting at
+ the current word, filling the most significant bits first, and
+ aligning to the start of the next word if the field size does not
+ fit into the space remaining in the current word. A `.align'
+ directive with an operand of 1 will force the next `.field'
+ directive to begin packing into a new word. If a label is used, it
+ points to the word that contains the specified field.
+
+`.global SYMBOL [,...,SYMBOL_N]'
+`.def SYMBOL [,...,SYMBOL_N]'
+`.ref SYMBOL [,...,SYMBOL_N]'
+ `.def' nominally identifies a symbol defined in the current file
+ and available to other files. `.ref' identifies a symbol used in
+ the current file but defined elsewhere. Both map to the standard
+ `.global' directive.
+
+`.half VALUE [,...,VALUE_N]'
+`.uhalf VALUE [,...,VALUE_N]'
+`.short VALUE [,...,VALUE_N]'
+`.ushort VALUE [,...,VALUE_N]'
+`.int VALUE [,...,VALUE_N]'
+`.uint VALUE [,...,VALUE_N]'
+`.word VALUE [,...,VALUE_N]'
+`.uword VALUE [,...,VALUE_N]'
+ Place one or more values into consecutive words of the current
+ section. If a label is used, it points to the word allocated for
+ the first value encountered.
+
+`.label SYMBOL'
+ Define a special SYMBOL to refer to the load time address of the
+ current section program counter.
+
+`.length'
+`.width'
+ Set the page length and width of the output listing file. Ignored.
+
+`.list'
+`.nolist'
+ Control whether the source listing is printed. Ignored.
+
+`.long VALUE [,...,VALUE_N]'
+`.ulong VALUE [,...,VALUE_N]'
+`.xlong VALUE [,...,VALUE_N]'
+ Place one or more 32-bit values into consecutive words in the
+ current section. The most significant word is stored first.
+ `.long' and `.ulong' align the result on a longword boundary;
+ `xlong' does not.
+
+`.loop [COUNT]'
+`.break [CONDITION]'
+`.endloop'
+ Repeatedly assemble a block of code. `.loop' begins the block, and
+ `.endloop' marks its termination. COUNT defaults to 1024, and
+ indicates the number of times the block should be repeated.
+ `.break' terminates the loop so that assembly begins after the
+ `.endloop' directive. The optional CONDITION will cause the loop
+ to terminate only if it evaluates to zero.
+
+`MACRO_NAME .macro [PARAM1][,...PARAM_N]'
+`[.mexit]'
+`.endm'
+ See the section on macros for more explanation (*Note
+ TIC54X-Macros::.
+
+`.mlib "FILENAME" | FILENAME'
+ Load the macro library FILENAME. FILENAME must be an archived
+ library (BFD ar-compatible) of text files, expected to contain
+ only macro definitions. The standard include search path is used.
+
+`.mlist'
+
+`.mnolist'
+ Control whether to include macro and loop block expansions in the
+ listing output. Ignored.
+
+`.mmregs'
+ Define global symbolic names for the 'c54x registers. Supposedly
+ equivalent to executing `.set' directives for each register with
+ its memory-mapped value, but in reality is provided only for
+ compatibility and does nothing.
+
+`.newblock'
+ This directive resets any TIC54X local labels currently defined.
+ Normal `as' local labels are unaffected.
+
+`.option OPTION_LIST'
+ Set listing options. Ignored.
+
+`.sblock "SECTION_NAME" | SECTION_NAME [,"NAME_N" | NAME_N]'
+ Designate SECTION_NAME for blocking. Blocking guarantees that a
+ section will start on a page boundary (128 words) if it would
+ otherwise cross a page boundary. Only initialized sections may be
+ designated with this directive. See also *Note TIC54X-Block::.
+
+`.sect "SECTION_NAME"'
+ Define a named initialized section and make it the current section.
+
+`SYMBOL .set "VALUE"'
+`SYMBOL .equ "VALUE"'
+ Equate a constant VALUE to a SYMBOL, which is placed in the symbol
+ table. SYMBOL may not be previously defined.
+
+`.space SIZE_IN_BITS'
+`.bes SIZE_IN_BITS'
+ Reserve the given number of bits in the current section and
+ zero-fill them. If a label is used with `.space', it points to the
+ *first* word reserved. With `.bes', the label points to the
+ *last* word reserved.
+
+`.sslist'
+`.ssnolist'
+ Controls the inclusion of subsym replacement in the listing
+ output. Ignored.
+
+`.string "STRING" [,...,"STRING_N"]'
+`.pstring "STRING" [,...,"STRING_N"]'
+ Place 8-bit characters from STRING into the current section.
+ `.string' zero-fills the upper 8 bits of each word, while
+ `.pstring' puts two characters into each word, filling the
+ most-significant bits first. Unused space is zero-filled. If a
+ label is used, it points to the first word initialized.
+
+`[STAG] .struct [OFFSET]'
+`[NAME_1] element [COUNT_1]'
+`[NAME_2] element [COUNT_2]'
+`[TNAME] .tag STAGX [TCOUNT]'
+`...'
+`[NAME_N] element [COUNT_N]'
+`[SSIZE] .endstruct'
+`LABEL .tag [STAG]'
+ Assign symbolic offsets to the elements of a structure. STAG
+ defines a symbol to use to reference the structure. OFFSET
+ indicates a starting value to use for the first element
+ encountered; otherwise it defaults to zero. Each element can have
+ a named offset, NAME, which is a symbol assigned the value of the
+ element's offset into the structure. If STAG is missing, these
+ become global symbols. COUNT adjusts the offset that many times,
+ as if `element' were an array. `element' may be one of `.byte',
+ `.word', `.long', `.float', or any equivalent of those, and the
+ structure offset is adjusted accordingly. `.field' and `.string'
+ are also allowed; the size of `.field' is one bit, and `.string'
+ is considered to be one word in size. Only element descriptors,
+ structure/union tags, `.align' and conditional assembly directives
+ are allowed within `.struct'/`.endstruct'. `.align' aligns member
+ offsets to word boundaries only. SSIZE, if provided, will always
+ be assigned the size of the structure.
+
+ The `.tag' directive, in addition to being used to define a
+ structure/union element within a structure, may be used to apply a
+ structure to a symbol. Once applied to LABEL, the individual
+ structure elements may be applied to LABEL to produce the desired
+ offsets using LABEL as the structure base.
+
+`.tab'
+ Set the tab size in the output listing. Ignored.
+
+`[UTAG] .union'
+`[NAME_1] element [COUNT_1]'
+`[NAME_2] element [COUNT_2]'
+`[TNAME] .tag UTAGX[,TCOUNT]'
+`...'
+`[NAME_N] element [COUNT_N]'
+`[USIZE] .endstruct'
+`LABEL .tag [UTAG]'
+ Similar to `.struct', but the offset after each element is reset to
+ zero, and the USIZE is set to the maximum of all defined elements.
+ Starting offset for the union is always zero.
+
+`[SYMBOL] .usect "SECTION_NAME", SIZE, [,[BLOCKING_FLAG] [,ALIGNMENT_FLAG]]'
+ Reserve space for variables in a named, uninitialized section
+ (similar to .bss). `.usect' allows definitions sections
+ independent of .bss. SYMBOL points to the first location reserved
+ by this allocation. The symbol may be used as a variable name.
+ SIZE is the allocated size in words. BLOCKING_FLAG indicates
+ whether to block this section on a page boundary (128 words)
+ (*note TIC54X-Block::). ALIGNMENT FLAG indicates whether the
+ section should be longword-aligned.
+
+`.var SYM[,..., SYM_N]'
+ Define a subsym to be a local variable within a macro. See *Note
+ TIC54X-Macros::.
+
+`.version VERSION'
+ Set which processor to build instructions for. Though the
+ following values are accepted, the op is ignored.
+ `541'
+ `542'
+ `543'
+ `545'
+ `545LP'
+ `546LP'
+ `548'
+ `549'
+
+
+File: as.info, Node: TIC54X-Macros, Next: TIC54X-MMRegs, Prev: TIC54X-Directives, Up: TIC54X-Dependent
+
+9.35.10 Macros
+--------------
+
+Macros do not require explicit dereferencing of arguments (i.e., \ARG).
+
+ During macro expansion, the macro parameters are converted to
+subsyms. If the number of arguments passed the macro invocation
+exceeds the number of parameters defined, the last parameter is
+assigned the string equivalent of all remaining arguments. If fewer
+arguments are given than parameters, the missing parameters are
+assigned empty strings. To include a comma in an argument, you must
+enclose the argument in quotes.
+
+ The following built-in subsym functions allow examination of the
+string value of subsyms (or ordinary strings). The arguments are
+strings unless otherwise indicated (subsyms passed as args will be
+replaced by the strings they represent).
+``$symlen(STR)''
+ Returns the length of STR.
+
+``$symcmp(STR1,STR2)''
+ Returns 0 if STR1 == STR2, non-zero otherwise.
+
+``$firstch(STR,CH)''
+ Returns index of the first occurrence of character constant CH in
+ STR.
+
+``$lastch(STR,CH)''
+ Returns index of the last occurrence of character constant CH in
+ STR.
+
+``$isdefed(SYMBOL)''
+ Returns zero if the symbol SYMBOL is not in the symbol table,
+ non-zero otherwise.
+
+``$ismember(SYMBOL,LIST)''
+ Assign the first member of comma-separated string LIST to SYMBOL;
+ LIST is reassigned the remainder of the list. Returns zero if
+ LIST is a null string. Both arguments must be subsyms.
+
+``$iscons(EXPR)''
+ Returns 1 if string EXPR is binary, 2 if octal, 3 if hexadecimal,
+ 4 if a character, 5 if decimal, and zero if not an integer.
+
+``$isname(NAME)''
+ Returns 1 if NAME is a valid symbol name, zero otherwise.
+
+``$isreg(REG)''
+ Returns 1 if REG is a valid predefined register name (AR0-AR7
+ only).
+
+``$structsz(STAG)''
+ Returns the size of the structure or union represented by STAG.
+
+``$structacc(STAG)''
+ Returns the reference point of the structure or union represented
+ by STAG. Always returns zero.
+
+
+
+File: as.info, Node: TIC54X-MMRegs, Prev: TIC54X-Macros, Up: TIC54X-Dependent
+
+9.35.11 Memory-mapped Registers
+-------------------------------
+
+The following symbols are recognized as memory-mapped registers:
+
+
+
+File: as.info, Node: Z80-Dependent, Next: Z8000-Dependent, Prev: Xtensa-Dependent, Up: Machine Dependencies
+
+9.36 Z80 Dependent Features
+===========================
+
+* Menu:
+
+* Z80 Options:: Options
+* Z80 Syntax:: Syntax
+* Z80 Floating Point:: Floating Point
+* Z80 Directives:: Z80 Machine Directives
+* Z80 Opcodes:: Opcodes
+
+
+File: as.info, Node: Z80 Options, Next: Z80 Syntax, Up: Z80-Dependent
+
+9.36.1 Options
+--------------
+
+The Zilog Z80 and Ascii R800 version of `as' have a few machine
+dependent options.
+`-z80'
+ Produce code for the Z80 processor. There are additional options to
+ request warnings and error messages for undocumented instructions.
+
+`-ignore-undocumented-instructions'
+`-Wnud'
+ Silently assemble undocumented Z80-instructions that have been
+ adopted as documented R800-instructions.
+
+`-ignore-unportable-instructions'
+`-Wnup'
+ Silently assemble all undocumented Z80-instructions.
+
+`-warn-undocumented-instructions'
+`-Wud'
+ Issue warnings for undocumented Z80-instructions that work on
+ R800, do not assemble other undocumented instructions without
+ warning.
+
+`-warn-unportable-instructions'
+`-Wup'
+ Issue warnings for other undocumented Z80-instructions, do not
+ treat any undocumented instructions as errors.
+
+`-forbid-undocumented-instructions'
+`-Fud'
+ Treat all undocumented z80-instructions as errors.
+
+`-forbid-unportable-instructions'
+`-Fup'
+ Treat undocumented z80-instructions that do not work on R800 as
+ errors.
+
+`-r800'
+ Produce code for the R800 processor. The assembler does not support
+ undocumented instructions for the R800. In line with common
+ practice, `as' uses Z80 instruction names for the R800 processor,
+ as far as they exist.
+
+
+File: as.info, Node: Z80 Syntax, Next: Z80 Floating Point, Prev: Z80 Options, Up: Z80-Dependent
+
+9.36.2 Syntax
+-------------
+
+The assembler syntax closely follows the 'Z80 family CPU User Manual' by
+Zilog. In expressions a single `=' may be used as "is equal to"
+comparison operator.
+
+ Suffices can be used to indicate the radix of integer constants; `H'
+or `h' for hexadecimal, `D' or `d' for decimal, `Q', `O', `q' or `o'
+for octal, and `B' for binary.
+
+ The suffix `b' denotes a backreference to local label.
+
+* Menu:
+
+* Z80-Chars:: Special Characters
+* Z80-Regs:: Register Names
+* Z80-Case:: Case Sensitivity
+
+
+File: as.info, Node: Z80-Chars, Next: Z80-Regs, Up: Z80 Syntax
+
+9.36.2.1 Special Characters
+...........................
+
+The semicolon `;' is the line comment character;
+
+ The dollar sign `$' can be used as a prefix for hexadecimal numbers
+and as a symbol denoting the current location counter.
+
+ A backslash `\' is an ordinary character for the Z80 assembler.
+
+ The single quote `'' must be followed by a closing quote. If there
+is one character in between, it is a character constant, otherwise it is
+a string constant.
+
+
+File: as.info, Node: Z80-Regs, Next: Z80-Case, Prev: Z80-Chars, Up: Z80 Syntax
+
+9.36.2.2 Register Names
+.......................
+
+The registers are referred to with the letters assigned to them by
+Zilog. In addition `as' recognizes `ixl' and `ixh' as the least and
+most significant octet in `ix', and similarly `iyl' and `iyh' as parts
+of `iy'.
+
+
+File: as.info, Node: Z80-Case, Prev: Z80-Regs, Up: Z80 Syntax
+
+9.36.2.3 Case Sensitivity
+.........................
+
+Upper and lower case are equivalent in register names, opcodes,
+condition codes and assembler directives. The case of letters is
+significant in labels and symbol names. The case is also important to
+distinguish the suffix `b' for a backward reference to a local label
+from the suffix `B' for a number in binary notation.
+
+
+File: as.info, Node: Z80 Floating Point, Next: Z80 Directives, Prev: Z80 Syntax, Up: Z80-Dependent
+
+9.36.3 Floating Point
+---------------------
+
+Floating-point numbers are not supported.
+
+
+File: as.info, Node: Z80 Directives, Next: Z80 Opcodes, Prev: Z80 Floating Point, Up: Z80-Dependent
+
+9.36.4 Z80 Assembler Directives
+-------------------------------
+
+`as' for the Z80 supports some additional directives for compatibility
+with other assemblers.
+
+ These are the additional directives in `as' for the Z80:
+
+`db EXPRESSION|STRING[,EXPRESSION|STRING...]'
+`defb EXPRESSION|STRING[,EXPRESSION|STRING...]'
+ For each STRING the characters are copied to the object file, for
+ each other EXPRESSION the value is stored in one byte. A warning
+ is issued in case of an overflow.
+
+`dw EXPRESSION[,EXPRESSION...]'
+`defw EXPRESSION[,EXPRESSION...]'
+ For each EXPRESSION the value is stored in two bytes, ignoring
+ overflow.
+
+`d24 EXPRESSION[,EXPRESSION...]'
+`def24 EXPRESSION[,EXPRESSION...]'
+ For each EXPRESSION the value is stored in three bytes, ignoring
+ overflow.
+
+`d32 EXPRESSION[,EXPRESSION...]'
+`def32 EXPRESSION[,EXPRESSION...]'
+ For each EXPRESSION the value is stored in four bytes, ignoring
+ overflow.
+
+`ds COUNT[, VALUE]'
+`defs COUNT[, VALUE]'
+ Fill COUNT bytes in the object file with VALUE, if VALUE is
+ omitted it defaults to zero.
+
+`SYMBOL equ EXPRESSION'
+`SYMBOL defl EXPRESSION'
+ These directives set the value of SYMBOL to EXPRESSION. If `equ'
+ is used, it is an error if SYMBOL is already defined. Symbols
+ defined with `equ' are not protected from redefinition.
+
+`set'
+ This is a normal instruction on Z80, and not an assembler
+ directive.
+
+`psect NAME'
+ A synonym for *Note Section::, no second argument should be given.
+
+
+
+File: as.info, Node: Z80 Opcodes, Prev: Z80 Directives, Up: Z80-Dependent
+
+9.36.5 Opcodes
+--------------
+
+In line with common practice, Z80 mnemonics are used for both the Z80
+and the R800.
+
+ In many instructions it is possible to use one of the half index
+registers (`ixl',`ixh',`iyl',`iyh') in stead of an 8-bit general
+purpose register. This yields instructions that are documented on the
+R800 and undocumented on the Z80. Similarly `in f,(c)' is documented
+on the R800 and undocumented on the Z80.
+
+ The assembler also supports the following undocumented
+Z80-instructions, that have not been adopted in the R800 instruction
+set:
+`out (c),0'
+ Sends zero to the port pointed to by register c.
+
+`sli M'
+ Equivalent to `M = (M<<1)+1', the operand M can be any operand
+ that is valid for `sla'. One can use `sll' as a synonym for `sli'.
+
+`OP (ix+D), R'
+ This is equivalent to
+
+ ld R, (ix+D)
+ OPC R
+ ld (ix+D), R
+
+ The operation `OPC' may be any of `res B,', `set B,', `rl', `rlc',
+ `rr', `rrc', `sla', `sli', `sra' and `srl', and the register `R'
+ may be any of `a', `b', `c', `d', `e', `h' and `l'.
+
+`OPC (iy+D), R'
+ As above, but with `iy' instead of `ix'.
+
+ The web site at `http://www.z80.info' is a good starting place to
+find more information on programming the Z80.
+
+
+File: as.info, Node: Z8000-Dependent, Next: Vax-Dependent, Prev: Z80-Dependent, Up: Machine Dependencies
+
+9.37 Z8000 Dependent Features
+=============================
+
+ The Z8000 as supports both members of the Z8000 family: the
+unsegmented Z8002, with 16 bit addresses, and the segmented Z8001 with
+24 bit addresses.
+
+ When the assembler is in unsegmented mode (specified with the
+`unsegm' directive), an address takes up one word (16 bit) sized
+register. When the assembler is in segmented mode (specified with the
+`segm' directive), a 24-bit address takes up a long (32 bit) register.
+*Note Assembler Directives for the Z8000: Z8000 Directives, for a list
+of other Z8000 specific assembler directives.
+
+* Menu:
+
+* Z8000 Options:: Command-line options for the Z8000
+* Z8000 Syntax:: Assembler syntax for the Z8000
+* Z8000 Directives:: Special directives for the Z8000
+* Z8000 Opcodes:: Opcodes
+
+
+File: as.info, Node: Z8000 Options, Next: Z8000 Syntax, Up: Z8000-Dependent
+
+9.37.1 Options
+--------------
+
+`-z8001'
+ Generate segmented code by default.
+
+`-z8002'
+ Generate unsegmented code by default.
+
+
+File: as.info, Node: Z8000 Syntax, Next: Z8000 Directives, Prev: Z8000 Options, Up: Z8000-Dependent
+
+9.37.2 Syntax
+-------------
+
+* Menu:
+
+* Z8000-Chars:: Special Characters
+* Z8000-Regs:: Register Names
+* Z8000-Addressing:: Addressing Modes
+
+
+File: as.info, Node: Z8000-Chars, Next: Z8000-Regs, Up: Z8000 Syntax
+
+9.37.2.1 Special Characters
+...........................
+
+`!' is the line comment character.
+
+ You can use `;' instead of a newline to separate statements.
+
+
+File: as.info, Node: Z8000-Regs, Next: Z8000-Addressing, Prev: Z8000-Chars, Up: Z8000 Syntax
+
+9.37.2.2 Register Names
+.......................
+
+The Z8000 has sixteen 16 bit registers, numbered 0 to 15. You can refer
+to different sized groups of registers by register number, with the
+prefix `r' for 16 bit registers, `rr' for 32 bit registers and `rq' for
+64 bit registers. You can also refer to the contents of the first
+eight (of the sixteen 16 bit registers) by bytes. They are named `rlN'
+and `rhN'.
+
+_byte registers_
+ rl0 rh0 rl1 rh1 rl2 rh2 rl3 rh3
+ rl4 rh4 rl5 rh5 rl6 rh6 rl7 rh7
+
+_word registers_
+ r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15
+
+_long word registers_
+ rr0 rr2 rr4 rr6 rr8 rr10 rr12 rr14
+
+_quad word registers_
+ rq0 rq4 rq8 rq12
+
+
+File: as.info, Node: Z8000-Addressing, Prev: Z8000-Regs, Up: Z8000 Syntax
+
+9.37.2.3 Addressing Modes
+.........................
+
+as understands the following addressing modes for the Z8000:
+
+`rlN'
+`rhN'
+`rN'
+`rrN'
+`rqN'
+ Register direct: 8bit, 16bit, 32bit, and 64bit registers.
+
+`@rN'
+`@rrN'
+ Indirect register: @rrN in segmented mode, @rN in unsegmented
+ mode.
+
+`ADDR'
+ Direct: the 16 bit or 24 bit address (depending on whether the
+ assembler is in segmented or unsegmented mode) of the operand is
+ in the instruction.
+
+`address(rN)'
+ Indexed: the 16 or 24 bit address is added to the 16 bit register
+ to produce the final address in memory of the operand.
+
+`rN(#IMM)'
+`rrN(#IMM)'
+ Base Address: the 16 or 24 bit register is added to the 16 bit sign
+ extended immediate displacement to produce the final address in
+ memory of the operand.
+
+`rN(rM)'
+`rrN(rM)'
+ Base Index: the 16 or 24 bit register rN or rrN is added to the
+ sign extended 16 bit index register rM to produce the final
+ address in memory of the operand.
+
+`#XX'
+ Immediate data XX.
+
+
+File: as.info, Node: Z8000 Directives, Next: Z8000 Opcodes, Prev: Z8000 Syntax, Up: Z8000-Dependent
+
+9.37.3 Assembler Directives for the Z8000
+-----------------------------------------
+
+The Z8000 port of as includes additional assembler directives, for
+compatibility with other Z8000 assemblers. These do not begin with `.'
+(unlike the ordinary as directives).
+
+`segm'
+`.z8001'
+ Generate code for the segmented Z8001.
+
+`unsegm'
+`.z8002'
+ Generate code for the unsegmented Z8002.
+
+`name'
+ Synonym for `.file'
+
+`global'
+ Synonym for `.global'
+
+`wval'
+ Synonym for `.word'
+
+`lval'
+ Synonym for `.long'
+
+`bval'
+ Synonym for `.byte'
+
+`sval'
+ Assemble a string. `sval' expects one string literal, delimited by
+ single quotes. It assembles each byte of the string into
+ consecutive addresses. You can use the escape sequence `%XX'
+ (where XX represents a two-digit hexadecimal number) to represent
+ the character whose ASCII value is XX. Use this feature to
+ describe single quote and other characters that may not appear in
+ string literals as themselves. For example, the C statement
+ `char *a = "he said \"it's 50% off\"";' is represented in Z8000
+ assembly language (shown with the assembler output in hex at the
+ left) as
+
+ 68652073 sval 'he said %22it%27s 50%25 off%22%00'
+ 61696420
+ 22697427
+ 73203530
+ 25206F66
+ 662200
+
+`rsect'
+ synonym for `.section'
+
+`block'
+ synonym for `.space'
+
+`even'
+ special case of `.align'; aligns output to even byte boundary.
+
+
+File: as.info, Node: Z8000 Opcodes, Prev: Z8000 Directives, Up: Z8000-Dependent
+
+9.37.4 Opcodes
+--------------
+
+For detailed information on the Z8000 machine instruction set, see
+`Z8000 Technical Manual'.
+
+ The following table summarizes the opcodes and their arguments:
+
+ rs 16 bit source register
+ rd 16 bit destination register
+ rbs 8 bit source register
+ rbd 8 bit destination register
+ rrs 32 bit source register
+ rrd 32 bit destination register
+ rqs 64 bit source register
+ rqd 64 bit destination register
+ addr 16/24 bit address
+ imm immediate data
+
+ adc rd,rs clrb addr cpsir @rd,@rs,rr,cc
+ adcb rbd,rbs clrb addr(rd) cpsirb @rd,@rs,rr,cc
+ add rd,@rs clrb rbd dab rbd
+ add rd,addr com @rd dbjnz rbd,disp7
+ add rd,addr(rs) com addr dec @rd,imm4m1
+ add rd,imm16 com addr(rd) dec addr(rd),imm4m1
+ add rd,rs com rd dec addr,imm4m1
+ addb rbd,@rs comb @rd dec rd,imm4m1
+ addb rbd,addr comb addr decb @rd,imm4m1
+ addb rbd,addr(rs) comb addr(rd) decb addr(rd),imm4m1
+ addb rbd,imm8 comb rbd decb addr,imm4m1
+ addb rbd,rbs comflg flags decb rbd,imm4m1
+ addl rrd,@rs cp @rd,imm16 di i2
+ addl rrd,addr cp addr(rd),imm16 div rrd,@rs
+ addl rrd,addr(rs) cp addr,imm16 div rrd,addr
+ addl rrd,imm32 cp rd,@rs div rrd,addr(rs)
+ addl rrd,rrs cp rd,addr div rrd,imm16
+ and rd,@rs cp rd,addr(rs) div rrd,rs
+ and rd,addr cp rd,imm16 divl rqd,@rs
+ and rd,addr(rs) cp rd,rs divl rqd,addr
+ and rd,imm16 cpb @rd,imm8 divl rqd,addr(rs)
+ and rd,rs cpb addr(rd),imm8 divl rqd,imm32
+ andb rbd,@rs cpb addr,imm8 divl rqd,rrs
+ andb rbd,addr cpb rbd,@rs djnz rd,disp7
+ andb rbd,addr(rs) cpb rbd,addr ei i2
+ andb rbd,imm8 cpb rbd,addr(rs) ex rd,@rs
+ andb rbd,rbs cpb rbd,imm8 ex rd,addr
+ bit @rd,imm4 cpb rbd,rbs ex rd,addr(rs)
+ bit addr(rd),imm4 cpd rd,@rs,rr,cc ex rd,rs
+ bit addr,imm4 cpdb rbd,@rs,rr,cc exb rbd,@rs
+ bit rd,imm4 cpdr rd,@rs,rr,cc exb rbd,addr
+ bit rd,rs cpdrb rbd,@rs,rr,cc exb rbd,addr(rs)
+ bitb @rd,imm4 cpi rd,@rs,rr,cc exb rbd,rbs
+ bitb addr(rd),imm4 cpib rbd,@rs,rr,cc ext0e imm8
+ bitb addr,imm4 cpir rd,@rs,rr,cc ext0f imm8
+ bitb rbd,imm4 cpirb rbd,@rs,rr,cc ext8e imm8
+ bitb rbd,rs cpl rrd,@rs ext8f imm8
+ bpt cpl rrd,addr exts rrd
+ call @rd cpl rrd,addr(rs) extsb rd
+ call addr cpl rrd,imm32 extsl rqd
+ call addr(rd) cpl rrd,rrs halt
+ calr disp12 cpsd @rd,@rs,rr,cc in rd,@rs
+ clr @rd cpsdb @rd,@rs,rr,cc in rd,imm16
+ clr addr cpsdr @rd,@rs,rr,cc inb rbd,@rs
+ clr addr(rd) cpsdrb @rd,@rs,rr,cc inb rbd,imm16
+ clr rd cpsi @rd,@rs,rr,cc inc @rd,imm4m1
+ clrb @rd cpsib @rd,@rs,rr,cc inc addr(rd),imm4m1
+ inc addr,imm4m1 ldb rbd,rs(rx) mult rrd,addr(rs)
+ inc rd,imm4m1 ldb rd(imm16),rbs mult rrd,imm16
+ incb @rd,imm4m1 ldb rd(rx),rbs mult rrd,rs
+ incb addr(rd),imm4m1 ldctl ctrl,rs multl rqd,@rs
+ incb addr,imm4m1 ldctl rd,ctrl multl rqd,addr
+ incb rbd,imm4m1 ldd @rs,@rd,rr multl rqd,addr(rs)
+ ind @rd,@rs,ra lddb @rs,@rd,rr multl rqd,imm32
+ indb @rd,@rs,rba lddr @rs,@rd,rr multl rqd,rrs
+ inib @rd,@rs,ra lddrb @rs,@rd,rr neg @rd
+ inibr @rd,@rs,ra ldi @rd,@rs,rr neg addr
+ iret ldib @rd,@rs,rr neg addr(rd)
+ jp cc,@rd ldir @rd,@rs,rr neg rd
+ jp cc,addr ldirb @rd,@rs,rr negb @rd
+ jp cc,addr(rd) ldk rd,imm4 negb addr
+ jr cc,disp8 ldl @rd,rrs negb addr(rd)
+ ld @rd,imm16 ldl addr(rd),rrs negb rbd
+ ld @rd,rs ldl addr,rrs nop
+ ld addr(rd),imm16 ldl rd(imm16),rrs or rd,@rs
+ ld addr(rd),rs ldl rd(rx),rrs or rd,addr
+ ld addr,imm16 ldl rrd,@rs or rd,addr(rs)
+ ld addr,rs ldl rrd,addr or rd,imm16
+ ld rd(imm16),rs ldl rrd,addr(rs) or rd,rs
+ ld rd(rx),rs ldl rrd,imm32 orb rbd,@rs
+ ld rd,@rs ldl rrd,rrs orb rbd,addr
+ ld rd,addr ldl rrd,rs(imm16) orb rbd,addr(rs)
+ ld rd,addr(rs) ldl rrd,rs(rx) orb rbd,imm8
+ ld rd,imm16 ldm @rd,rs,n orb rbd,rbs
+ ld rd,rs ldm addr(rd),rs,n out @rd,rs
+ ld rd,rs(imm16) ldm addr,rs,n out imm16,rs
+ ld rd,rs(rx) ldm rd,@rs,n outb @rd,rbs
+ lda rd,addr ldm rd,addr(rs),n outb imm16,rbs
+ lda rd,addr(rs) ldm rd,addr,n outd @rd,@rs,ra
+ lda rd,rs(imm16) ldps @rs outdb @rd,@rs,rba
+ lda rd,rs(rx) ldps addr outib @rd,@rs,ra
+ ldar rd,disp16 ldps addr(rs) outibr @rd,@rs,ra
+ ldb @rd,imm8 ldr disp16,rs pop @rd,@rs
+ ldb @rd,rbs ldr rd,disp16 pop addr(rd),@rs
+ ldb addr(rd),imm8 ldrb disp16,rbs pop addr,@rs
+ ldb addr(rd),rbs ldrb rbd,disp16 pop rd,@rs
+ ldb addr,imm8 ldrl disp16,rrs popl @rd,@rs
+ ldb addr,rbs ldrl rrd,disp16 popl addr(rd),@rs
+ ldb rbd,@rs mbit popl addr,@rs
+ ldb rbd,addr mreq rd popl rrd,@rs
+ ldb rbd,addr(rs) mres push @rd,@rs
+ ldb rbd,imm8 mset push @rd,addr
+ ldb rbd,rbs mult rrd,@rs push @rd,addr(rs)
+ ldb rbd,rs(imm16) mult rrd,addr push @rd,imm16
+ push @rd,rs set addr,imm4 subl rrd,imm32
+ pushl @rd,@rs set rd,imm4 subl rrd,rrs
+ pushl @rd,addr set rd,rs tcc cc,rd
+ pushl @rd,addr(rs) setb @rd,imm4 tccb cc,rbd
+ pushl @rd,rrs setb addr(rd),imm4 test @rd
+ res @rd,imm4 setb addr,imm4 test addr
+ res addr(rd),imm4 setb rbd,imm4 test addr(rd)
+ res addr,imm4 setb rbd,rs test rd
+ res rd,imm4 setflg imm4 testb @rd
+ res rd,rs sinb rbd,imm16 testb addr
+ resb @rd,imm4 sinb rd,imm16 testb addr(rd)
+ resb addr(rd),imm4 sind @rd,@rs,ra testb rbd
+ resb addr,imm4 sindb @rd,@rs,rba testl @rd
+ resb rbd,imm4 sinib @rd,@rs,ra testl addr
+ resb rbd,rs sinibr @rd,@rs,ra testl addr(rd)
+ resflg imm4 sla rd,imm8 testl rrd
+ ret cc slab rbd,imm8 trdb @rd,@rs,rba
+ rl rd,imm1or2 slal rrd,imm8 trdrb @rd,@rs,rba
+ rlb rbd,imm1or2 sll rd,imm8 trib @rd,@rs,rbr
+ rlc rd,imm1or2 sllb rbd,imm8 trirb @rd,@rs,rbr
+ rlcb rbd,imm1or2 slll rrd,imm8 trtdrb @ra,@rb,rbr
+ rldb rbb,rba sout imm16,rs trtib @ra,@rb,rr
+ rr rd,imm1or2 soutb imm16,rbs trtirb @ra,@rb,rbr
+ rrb rbd,imm1or2 soutd @rd,@rs,ra trtrb @ra,@rb,rbr
+ rrc rd,imm1or2 soutdb @rd,@rs,rba tset @rd
+ rrcb rbd,imm1or2 soutib @rd,@rs,ra tset addr
+ rrdb rbb,rba soutibr @rd,@rs,ra tset addr(rd)
+ rsvd36 sra rd,imm8 tset rd
+ rsvd38 srab rbd,imm8 tsetb @rd
+ rsvd78 sral rrd,imm8 tsetb addr
+ rsvd7e srl rd,imm8 tsetb addr(rd)
+ rsvd9d srlb rbd,imm8 tsetb rbd
+ rsvd9f srll rrd,imm8 xor rd,@rs
+ rsvdb9 sub rd,@rs xor rd,addr
+ rsvdbf sub rd,addr xor rd,addr(rs)
+ sbc rd,rs sub rd,addr(rs) xor rd,imm16
+ sbcb rbd,rbs sub rd,imm16 xor rd,rs
+ sc imm8 sub rd,rs xorb rbd,@rs
+ sda rd,rs subb rbd,@rs xorb rbd,addr
+ sdab rbd,rs subb rbd,addr xorb rbd,addr(rs)
+ sdal rrd,rs subb rbd,addr(rs) xorb rbd,imm8
+ sdl rd,rs subb rbd,imm8 xorb rbd,rbs
+ sdlb rbd,rs subb rbd,rbs xorb rbd,rbs
+ sdll rrd,rs subl rrd,@rs
+ set @rd,imm4 subl rrd,addr
+ set addr(rd),imm4 subl rrd,addr(rs)
+
+
+File: as.info, Node: Vax-Dependent, Prev: Z8000-Dependent, Up: Machine Dependencies
+
+9.38 VAX Dependent Features
+===========================
+
+* Menu:
+
+* VAX-Opts:: VAX Command-Line Options
+* VAX-float:: VAX Floating Point
+* VAX-directives:: Vax Machine Directives
+* VAX-opcodes:: VAX Opcodes
+* VAX-branch:: VAX Branch Improvement
+* VAX-operands:: VAX Operands
+* VAX-no:: Not Supported on VAX
+
+
+File: as.info, Node: VAX-Opts, Next: VAX-float, Up: Vax-Dependent
+
+9.38.1 VAX Command-Line Options
+-------------------------------
+
+The Vax version of `as' accepts any of the following options, gives a
+warning message that the option was ignored and proceeds. These
+options are for compatibility with scripts designed for other people's
+assemblers.
+
+``-D' (Debug)'
+``-S' (Symbol Table)'
+``-T' (Token Trace)'
+ These are obsolete options used to debug old assemblers.
+
+``-d' (Displacement size for JUMPs)'
+ This option expects a number following the `-d'. Like options
+ that expect filenames, the number may immediately follow the `-d'
+ (old standard) or constitute the whole of the command line
+ argument that follows `-d' (GNU standard).
+
+``-V' (Virtualize Interpass Temporary File)'
+ Some other assemblers use a temporary file. This option commanded
+ them to keep the information in active memory rather than in a
+ disk file. `as' always does this, so this option is redundant.
+
+``-J' (JUMPify Longer Branches)'
+ Many 32-bit computers permit a variety of branch instructions to
+ do the same job. Some of these instructions are short (and fast)
+ but have a limited range; others are long (and slow) but can
+ branch anywhere in virtual memory. Often there are 3 flavors of
+ branch: short, medium and long. Some other assemblers would emit
+ short and medium branches, unless told by this option to emit
+ short and long branches.
+
+``-t' (Temporary File Directory)'
+ Some other assemblers may use a temporary file, and this option
+ takes a filename being the directory to site the temporary file.
+ Since `as' does not use a temporary disk file, this option makes
+ no difference. `-t' needs exactly one filename.
+
+ The Vax version of the assembler accepts additional options when
+compiled for VMS:
+
+`-h N'
+ External symbol or section (used for global variables) names are
+ not case sensitive on VAX/VMS and always mapped to upper case.
+ This is contrary to the C language definition which explicitly
+ distinguishes upper and lower case. To implement a standard
+ conforming C compiler, names must be changed (mapped) to preserve
+ the case information. The default mapping is to convert all lower
+ case characters to uppercase and adding an underscore followed by
+ a 6 digit hex value, representing a 24 digit binary value. The
+ one digits in the binary value represent which characters are
+ uppercase in the original symbol name.
+
+ The `-h N' option determines how we map names. This takes several
+ values. No `-h' switch at all allows case hacking as described
+ above. A value of zero (`-h0') implies names should be upper
+ case, and inhibits the case hack. A value of 2 (`-h2') implies
+ names should be all lower case, with no case hack. A value of 3
+ (`-h3') implies that case should be preserved. The value 1 is
+ unused. The `-H' option directs `as' to display every mapped
+ symbol during assembly.
+
+ Symbols whose names include a dollar sign `$' are exceptions to the
+ general name mapping. These symbols are normally only used to
+ reference VMS library names. Such symbols are always mapped to
+ upper case.
+
+`-+'
+ The `-+' option causes `as' to truncate any symbol name larger
+ than 31 characters. The `-+' option also prevents some code
+ following the `_main' symbol normally added to make the object
+ file compatible with Vax-11 "C".
+
+`-1'
+ This option is ignored for backward compatibility with `as'
+ version 1.x.
+
+`-H'
+ The `-H' option causes `as' to print every symbol which was
+ changed by case mapping.
+
+
+File: as.info, Node: VAX-float, Next: VAX-directives, Prev: VAX-Opts, Up: Vax-Dependent
+
+9.38.2 VAX Floating Point
+-------------------------
+
+Conversion of flonums to floating point is correct, and compatible with
+previous assemblers. Rounding is towards zero if the remainder is
+exactly half the least significant bit.
+
+ `D', `F', `G' and `H' floating point formats are understood.
+
+ Immediate floating literals (_e.g._ `S`$6.9') are rendered
+correctly. Again, rounding is towards zero in the boundary case.
+
+ The `.float' directive produces `f' format numbers. The `.double'
+directive produces `d' format numbers.
+
+
+File: as.info, Node: VAX-directives, Next: VAX-opcodes, Prev: VAX-float, Up: Vax-Dependent
+
+9.38.3 Vax Machine Directives
+-----------------------------
+
+The Vax version of the assembler supports four directives for
+generating Vax floating point constants. They are described in the
+table below.
+
+`.dfloat'
+ This expects zero or more flonums, separated by commas, and
+ assembles Vax `d' format 64-bit floating point constants.
+
+`.ffloat'
+ This expects zero or more flonums, separated by commas, and
+ assembles Vax `f' format 32-bit floating point constants.
+
+`.gfloat'
+ This expects zero or more flonums, separated by commas, and
+ assembles Vax `g' format 64-bit floating point constants.
+
+`.hfloat'
+ This expects zero or more flonums, separated by commas, and
+ assembles Vax `h' format 128-bit floating point constants.
+
+
+
+File: as.info, Node: VAX-opcodes, Next: VAX-branch, Prev: VAX-directives, Up: Vax-Dependent
+
+9.38.4 VAX Opcodes
+------------------
+
+All DEC mnemonics are supported. Beware that `case...' instructions
+have exactly 3 operands. The dispatch table that follows the `case...'
+instruction should be made with `.word' statements. This is compatible
+with all unix assemblers we know of.
+
+
+File: as.info, Node: VAX-branch, Next: VAX-operands, Prev: VAX-opcodes, Up: Vax-Dependent
+
+9.38.5 VAX Branch Improvement
+-----------------------------
+
+Certain pseudo opcodes are permitted. They are for branch
+instructions. They expand to the shortest branch instruction that
+reaches the target. Generally these mnemonics are made by substituting
+`j' for `b' at the start of a DEC mnemonic. This feature is included
+both for compatibility and to help compilers. If you do not need this
+feature, avoid these opcodes. Here are the mnemonics, and the code
+they can expand into.
+
+`jbsb'
+ `Jsb' is already an instruction mnemonic, so we chose `jbsb'.
+ (byte displacement)
+ `bsbb ...'
+
+ (word displacement)
+ `bsbw ...'
+
+ (long displacement)
+ `jsb ...'
+
+`jbr'
+`jr'
+ Unconditional branch.
+ (byte displacement)
+ `brb ...'
+
+ (word displacement)
+ `brw ...'
+
+ (long displacement)
+ `jmp ...'
+
+`jCOND'
+ COND may be any one of the conditional branches `neq', `nequ',
+ `eql', `eqlu', `gtr', `geq', `lss', `gtru', `lequ', `vc', `vs',
+ `gequ', `cc', `lssu', `cs'. COND may also be one of the bit tests
+ `bs', `bc', `bss', `bcs', `bsc', `bcc', `bssi', `bcci', `lbs',
+ `lbc'. NOTCOND is the opposite condition to COND.
+ (byte displacement)
+ `bCOND ...'
+
+ (word displacement)
+ `bNOTCOND foo ; brw ... ; foo:'
+
+ (long displacement)
+ `bNOTCOND foo ; jmp ... ; foo:'
+
+`jacbX'
+ X may be one of `b d f g h l w'.
+ (word displacement)
+ `OPCODE ...'
+
+ (long displacement)
+ OPCODE ..., foo ;
+ brb bar ;
+ foo: jmp ... ;
+ bar:
+
+`jaobYYY'
+ YYY may be one of `lss leq'.
+
+`jsobZZZ'
+ ZZZ may be one of `geq gtr'.
+ (byte displacement)
+ `OPCODE ...'
+
+ (word displacement)
+ OPCODE ..., foo ;
+ brb bar ;
+ foo: brw DESTINATION ;
+ bar:
+
+ (long displacement)
+ OPCODE ..., foo ;
+ brb bar ;
+ foo: jmp DESTINATION ;
+ bar:
+
+`aobleq'
+`aoblss'
+`sobgeq'
+`sobgtr'
+
+ (byte displacement)
+ `OPCODE ...'
+
+ (word displacement)
+ OPCODE ..., foo ;
+ brb bar ;
+ foo: brw DESTINATION ;
+ bar:
+
+ (long displacement)
+ OPCODE ..., foo ;
+ brb bar ;
+ foo: jmp DESTINATION ;
+ bar:
+
+
+File: as.info, Node: VAX-operands, Next: VAX-no, Prev: VAX-branch, Up: Vax-Dependent
+
+9.38.6 VAX Operands
+-------------------
+
+The immediate character is `$' for Unix compatibility, not `#' as DEC
+writes it.
+
+ The indirect character is `*' for Unix compatibility, not `@' as DEC
+writes it.
+
+ The displacement sizing character is ``' (an accent grave) for Unix
+compatibility, not `^' as DEC writes it. The letter preceding ``' may
+have either case. `G' is not understood, but all other letters (`b i l
+s w') are understood.
+
+ Register names understood are `r0 r1 r2 ... r15 ap fp sp pc'. Upper
+and lower case letters are equivalent.
+
+ For instance
+ tstb *w`$4(r5)
+
+ Any expression is permitted in an operand. Operands are comma
+separated.
+
+
+File: as.info, Node: VAX-no, Prev: VAX-operands, Up: Vax-Dependent
+
+9.38.7 Not Supported on VAX
+---------------------------
+
+Vax bit fields can not be assembled with `as'. Someone can add the
+required code if they really need it.
+
+
+File: as.info, Node: V850-Dependent, Next: Xtensa-Dependent, Prev: TIC54X-Dependent, Up: Machine Dependencies
+
+9.39 v850 Dependent Features
+============================
+
+* Menu:
+
+* V850 Options:: Options
+* V850 Syntax:: Syntax
+* V850 Floating Point:: Floating Point
+* V850 Directives:: V850 Machine Directives
+* V850 Opcodes:: Opcodes
+
+
+File: as.info, Node: V850 Options, Next: V850 Syntax, Up: V850-Dependent
+
+9.39.1 Options
+--------------
+
+`as' supports the following additional command-line options for the
+V850 processor family:
+
+`-wsigned_overflow'
+ Causes warnings to be produced when signed immediate values
+ overflow the space available for then within their opcodes. By
+ default this option is disabled as it is possible to receive
+ spurious warnings due to using exact bit patterns as immediate
+ constants.
+
+`-wunsigned_overflow'
+ Causes warnings to be produced when unsigned immediate values
+ overflow the space available for then within their opcodes. By
+ default this option is disabled as it is possible to receive
+ spurious warnings due to using exact bit patterns as immediate
+ constants.
+
+`-mv850'
+ Specifies that the assembled code should be marked as being
+ targeted at the V850 processor. This allows the linker to detect
+ attempts to link such code with code assembled for other
+ processors.
+
+`-mv850e'
+ Specifies that the assembled code should be marked as being
+ targeted at the V850E processor. This allows the linker to detect
+ attempts to link such code with code assembled for other
+ processors.
+
+`-mv850e1'
+ Specifies that the assembled code should be marked as being
+ targeted at the V850E1 processor. This allows the linker to
+ detect attempts to link such code with code assembled for other
+ processors.
+
+`-mv850any'
+ Specifies that the assembled code should be marked as being
+ targeted at the V850 processor but support instructions that are
+ specific to the extended variants of the process. This allows the
+ production of binaries that contain target specific code, but
+ which are also intended to be used in a generic fashion. For
+ example libgcc.a contains generic routines used by the code
+ produced by GCC for all versions of the v850 architecture,
+ together with support routines only used by the V850E architecture.
+
+`-mrelax'
+ Enables relaxation. This allows the .longcall and .longjump pseudo
+ ops to be used in the assembler source code. These ops label
+ sections of code which are either a long function call or a long
+ branch. The assembler will then flag these sections of code and
+ the linker will attempt to relax them.
+
+
+
+File: as.info, Node: V850 Syntax, Next: V850 Floating Point, Prev: V850 Options, Up: V850-Dependent
+
+9.39.2 Syntax
+-------------
+
+* Menu:
+
+* V850-Chars:: Special Characters
+* V850-Regs:: Register Names
+
+
+File: as.info, Node: V850-Chars, Next: V850-Regs, Up: V850 Syntax
+
+9.39.2.1 Special Characters
+...........................
+
+`#' is the line comment character.
+
+
+File: as.info, Node: V850-Regs, Prev: V850-Chars, Up: V850 Syntax
+
+9.39.2.2 Register Names
+.......................
+
+`as' supports the following names for registers:
+`general register 0'
+ r0, zero
+
+`general register 1'
+ r1
+
+`general register 2'
+ r2, hp
+
+`general register 3'
+ r3, sp
+
+`general register 4'
+ r4, gp
+
+`general register 5'
+ r5, tp
+
+`general register 6'
+ r6
+
+`general register 7'
+ r7
+
+`general register 8'
+ r8
+
+`general register 9'
+ r9
+
+`general register 10'
+ r10
+
+`general register 11'
+ r11
+
+`general register 12'
+ r12
+
+`general register 13'
+ r13
+
+`general register 14'
+ r14
+
+`general register 15'
+ r15
+
+`general register 16'
+ r16
+
+`general register 17'
+ r17
+
+`general register 18'
+ r18
+
+`general register 19'
+ r19
+
+`general register 20'
+ r20
+
+`general register 21'
+ r21
+
+`general register 22'
+ r22
+
+`general register 23'
+ r23
+
+`general register 24'
+ r24
+
+`general register 25'
+ r25
+
+`general register 26'
+ r26
+
+`general register 27'
+ r27
+
+`general register 28'
+ r28
+
+`general register 29'
+ r29
+
+`general register 30'
+ r30, ep
+
+`general register 31'
+ r31, lp
+
+`system register 0'
+ eipc
+
+`system register 1'
+ eipsw
+
+`system register 2'
+ fepc
+
+`system register 3'
+ fepsw
+
+`system register 4'
+ ecr
+
+`system register 5'
+ psw
+
+`system register 16'
+ ctpc
+
+`system register 17'
+ ctpsw
+
+`system register 18'
+ dbpc
+
+`system register 19'
+ dbpsw
+
+`system register 20'
+ ctbp
+
+
+File: as.info, Node: V850 Floating Point, Next: V850 Directives, Prev: V850 Syntax, Up: V850-Dependent
+
+9.39.3 Floating Point
+---------------------
+
+The V850 family uses IEEE floating-point numbers.
+
+
+File: as.info, Node: V850 Directives, Next: V850 Opcodes, Prev: V850 Floating Point, Up: V850-Dependent
+
+9.39.4 V850 Machine Directives
+------------------------------
+
+`.offset <EXPRESSION>'
+ Moves the offset into the current section to the specified amount.
+
+`.section "name", <type>'
+ This is an extension to the standard .section directive. It sets
+ the current section to be <type> and creates an alias for this
+ section called "name".
+
+`.v850'
+ Specifies that the assembled code should be marked as being
+ targeted at the V850 processor. This allows the linker to detect
+ attempts to link such code with code assembled for other
+ processors.
+
+`.v850e'
+ Specifies that the assembled code should be marked as being
+ targeted at the V850E processor. This allows the linker to detect
+ attempts to link such code with code assembled for other
+ processors.
+
+`.v850e1'
+ Specifies that the assembled code should be marked as being
+ targeted at the V850E1 processor. This allows the linker to
+ detect attempts to link such code with code assembled for other
+ processors.
+
+
+
+File: as.info, Node: V850 Opcodes, Prev: V850 Directives, Up: V850-Dependent
+
+9.39.5 Opcodes
+--------------
+
+`as' implements all the standard V850 opcodes.
+
+ `as' also implements the following pseudo ops:
+
+`hi0()'
+ Computes the higher 16 bits of the given expression and stores it
+ into the immediate operand field of the given instruction. For
+ example:
+
+ `mulhi hi0(here - there), r5, r6'
+
+ computes the difference between the address of labels 'here' and
+ 'there', takes the upper 16 bits of this difference, shifts it
+ down 16 bits and then multiplies it by the lower 16 bits in
+ register 5, putting the result into register 6.
+
+`lo()'
+ Computes the lower 16 bits of the given expression and stores it
+ into the immediate operand field of the given instruction. For
+ example:
+
+ `addi lo(here - there), r5, r6'
+
+ computes the difference between the address of labels 'here' and
+ 'there', takes the lower 16 bits of this difference and adds it to
+ register 5, putting the result into register 6.
+
+`hi()'
+ Computes the higher 16 bits of the given expression and then adds
+ the value of the most significant bit of the lower 16 bits of the
+ expression and stores the result into the immediate operand field
+ of the given instruction. For example the following code can be
+ used to compute the address of the label 'here' and store it into
+ register 6:
+
+ `movhi hi(here), r0, r6' `movea lo(here), r6, r6'
+
+ The reason for this special behaviour is that movea performs a sign
+ extension on its immediate operand. So for example if the address
+ of 'here' was 0xFFFFFFFF then without the special behaviour of the
+ hi() pseudo-op the movhi instruction would put 0xFFFF0000 into r6,
+ then the movea instruction would takes its immediate operand,
+ 0xFFFF, sign extend it to 32 bits, 0xFFFFFFFF, and then add it
+ into r6 giving 0xFFFEFFFF which is wrong (the fifth nibble is E).
+ With the hi() pseudo op adding in the top bit of the lo() pseudo
+ op, the movhi instruction actually stores 0 into r6 (0xFFFF + 1 =
+ 0x0000), so that the movea instruction stores 0xFFFFFFFF into r6 -
+ the right value.
+
+`hilo()'
+ Computes the 32 bit value of the given expression and stores it
+ into the immediate operand field of the given instruction (which
+ must be a mov instruction). For example:
+
+ `mov hilo(here), r6'
+
+ computes the absolute address of label 'here' and puts the result
+ into register 6.
+
+`sdaoff()'
+ Computes the offset of the named variable from the start of the
+ Small Data Area (whoes address is held in register 4, the GP
+ register) and stores the result as a 16 bit signed value in the
+ immediate operand field of the given instruction. For example:
+
+ `ld.w sdaoff(_a_variable)[gp],r6'
+
+ loads the contents of the location pointed to by the label
+ '_a_variable' into register 6, provided that the label is located
+ somewhere within +/- 32K of the address held in the GP register.
+ [Note the linker assumes that the GP register contains a fixed
+ address set to the address of the label called '__gp'. This can
+ either be set up automatically by the linker, or specifically set
+ by using the `--defsym __gp=<value>' command line option].
+
+`tdaoff()'
+ Computes the offset of the named variable from the start of the
+ Tiny Data Area (whoes address is held in register 30, the EP
+ register) and stores the result as a 4,5, 7 or 8 bit unsigned
+ value in the immediate operand field of the given instruction.
+ For example:
+
+ `sld.w tdaoff(_a_variable)[ep],r6'
+
+ loads the contents of the location pointed to by the label
+ '_a_variable' into register 6, provided that the label is located
+ somewhere within +256 bytes of the address held in the EP
+ register. [Note the linker assumes that the EP register contains
+ a fixed address set to the address of the label called '__ep'.
+ This can either be set up automatically by the linker, or
+ specifically set by using the `--defsym __ep=<value>' command line
+ option].
+
+`zdaoff()'
+ Computes the offset of the named variable from address 0 and
+ stores the result as a 16 bit signed value in the immediate
+ operand field of the given instruction. For example:
+
+ `movea zdaoff(_a_variable),zero,r6'
+
+ puts the address of the label '_a_variable' into register 6,
+ assuming that the label is somewhere within the first 32K of
+ memory. (Strictly speaking it also possible to access the last
+ 32K of memory as well, as the offsets are signed).
+
+`ctoff()'
+ Computes the offset of the named variable from the start of the
+ Call Table Area (whoes address is helg in system register 20, the
+ CTBP register) and stores the result a 6 or 16 bit unsigned value
+ in the immediate field of then given instruction or piece of data.
+ For example:
+
+ `callt ctoff(table_func1)'
+
+ will put the call the function whoes address is held in the call
+ table at the location labeled 'table_func1'.
+
+`.longcall `name''
+ Indicates that the following sequence of instructions is a long
+ call to function `name'. The linker will attempt to shorten this
+ call sequence if `name' is within a 22bit offset of the call. Only
+ valid if the `-mrelax' command line switch has been enabled.
+
+`.longjump `name''
+ Indicates that the following sequence of instructions is a long
+ jump to label `name'. The linker will attempt to shorten this code
+ sequence if `name' is within a 22bit offset of the jump. Only
+ valid if the `-mrelax' command line switch has been enabled.
+
+
+ For information on the V850 instruction set, see `V850 Family
+32-/16-Bit single-Chip Microcontroller Architecture Manual' from NEC.
+Ltd.
+
+
+File: as.info, Node: Xtensa-Dependent, Next: Z80-Dependent, Prev: V850-Dependent, Up: Machine Dependencies
+
+9.40 Xtensa Dependent Features
+==============================
+
+ This chapter covers features of the GNU assembler that are specific
+to the Xtensa architecture. For details about the Xtensa instruction
+set, please consult the `Xtensa Instruction Set Architecture (ISA)
+Reference Manual'.
+
+* Menu:
+
+* Xtensa Options:: Command-line Options.
+* Xtensa Syntax:: Assembler Syntax for Xtensa Processors.
+* Xtensa Optimizations:: Assembler Optimizations.
+* Xtensa Relaxation:: Other Automatic Transformations.
+* Xtensa Directives:: Directives for Xtensa Processors.
+
+
+File: as.info, Node: Xtensa Options, Next: Xtensa Syntax, Up: Xtensa-Dependent
+
+9.40.1 Command Line Options
+---------------------------
+
+The Xtensa version of the GNU assembler supports these special options:
+
+`--text-section-literals | --no-text-section-literals'
+ Control the treatment of literal pools. The default is
+ `--no-text-section-literals', which places literals in separate
+ sections in the output file. This allows the literal pool to be
+ placed in a data RAM/ROM. With `--text-section-literals', the
+ literals are interspersed in the text section in order to keep
+ them as close as possible to their references. This may be
+ necessary for large assembly files, where the literals would
+ otherwise be out of range of the `L32R' instructions in the text
+ section. These options only affect literals referenced via
+ PC-relative `L32R' instructions; literals for absolute mode `L32R'
+ instructions are handled separately. *Note literal: Literal
+ Directive.
+
+`--absolute-literals | --no-absolute-literals'
+ Indicate to the assembler whether `L32R' instructions use absolute
+ or PC-relative addressing. If the processor includes the absolute
+ addressing option, the default is to use absolute `L32R'
+ relocations. Otherwise, only the PC-relative `L32R' relocations
+ can be used.
+
+`--target-align | --no-target-align'
+ Enable or disable automatic alignment to reduce branch penalties
+ at some expense in code size. *Note Automatic Instruction
+ Alignment: Xtensa Automatic Alignment. This optimization is
+ enabled by default. Note that the assembler will always align
+ instructions like `LOOP' that have fixed alignment requirements.
+
+`--longcalls | --no-longcalls'
+ Enable or disable transformation of call instructions to allow
+ calls across a greater range of addresses. *Note Function Call
+ Relaxation: Xtensa Call Relaxation. This option should be used
+ when call targets can potentially be out of range. It may degrade
+ both code size and performance, but the linker can generally
+ optimize away the unnecessary overhead when a call ends up within
+ range. The default is `--no-longcalls'.
+
+`--transform | --no-transform'
+ Enable or disable all assembler transformations of Xtensa
+ instructions, including both relaxation and optimization. The
+ default is `--transform'; `--no-transform' should only be used in
+ the rare cases when the instructions must be exactly as specified
+ in the assembly source. Using `--no-transform' causes out of range
+ instruction operands to be errors.
+
+`--rename-section OLDNAME=NEWNAME'
+ Rename the OLDNAME section to NEWNAME. This option can be used
+ multiple times to rename multiple sections.
+
+
+File: as.info, Node: Xtensa Syntax, Next: Xtensa Optimizations, Prev: Xtensa Options, Up: Xtensa-Dependent
+
+9.40.2 Assembler Syntax
+-----------------------
+
+Block comments are delimited by `/*' and `*/'. End of line comments
+may be introduced with either `#' or `//'.
+
+ Instructions consist of a leading opcode or macro name followed by
+whitespace and an optional comma-separated list of operands:
+
+ OPCODE [OPERAND, ...]
+
+ Instructions must be separated by a newline or semicolon.
+
+ FLIX instructions, which bundle multiple opcodes together in a single
+instruction, are specified by enclosing the bundled opcodes inside
+braces:
+
+ {
+ [FORMAT]
+ OPCODE0 [OPERANDS]
+ OPCODE1 [OPERANDS]
+ OPCODE2 [OPERANDS]
+ ...
+ }
+
+ The opcodes in a FLIX instruction are listed in the same order as the
+corresponding instruction slots in the TIE format declaration.
+Directives and labels are not allowed inside the braces of a FLIX
+instruction. A particular TIE format name can optionally be specified
+immediately after the opening brace, but this is usually unnecessary.
+The assembler will automatically search for a format that can encode the
+specified opcodes, so the format name need only be specified in rare
+cases where there is more than one applicable format and where it
+matters which of those formats is used. A FLIX instruction can also be
+specified on a single line by separating the opcodes with semicolons:
+
+ { [FORMAT;] OPCODE0 [OPERANDS]; OPCODE1 [OPERANDS]; OPCODE2 [OPERANDS]; ... }
+
+ If an opcode can only be encoded in a FLIX instruction but is not
+specified as part of a FLIX bundle, the assembler will choose the
+smallest format where the opcode can be encoded and will fill unused
+instruction slots with no-ops.
+
+* Menu:
+
+* Xtensa Opcodes:: Opcode Naming Conventions.
+* Xtensa Registers:: Register Naming.
+
+
+File: as.info, Node: Xtensa Opcodes, Next: Xtensa Registers, Up: Xtensa Syntax
+
+9.40.2.1 Opcode Names
+.....................
+
+See the `Xtensa Instruction Set Architecture (ISA) Reference Manual'
+for a complete list of opcodes and descriptions of their semantics.
+
+ If an opcode name is prefixed with an underscore character (`_'),
+`as' will not transform that instruction in any way. The underscore
+prefix disables both optimization (*note Xtensa Optimizations: Xtensa
+Optimizations.) and relaxation (*note Xtensa Relaxation: Xtensa
+Relaxation.) for that particular instruction. Only use the underscore
+prefix when it is essential to select the exact opcode produced by the
+assembler. Using this feature unnecessarily makes the code less
+efficient by disabling assembler optimization and less flexible by
+disabling relaxation.
+
+ Note that this special handling of underscore prefixes only applies
+to Xtensa opcodes, not to either built-in macros or user-defined macros.
+When an underscore prefix is used with a macro (e.g., `_MOV'), it
+refers to a different macro. The assembler generally provides built-in
+macros both with and without the underscore prefix, where the underscore
+versions behave as if the underscore carries through to the instructions
+in the macros. For example, `_MOV' may expand to `_MOV.N'.
+
+ The underscore prefix only applies to individual instructions, not to
+series of instructions. For example, if a series of instructions have
+underscore prefixes, the assembler will not transform the individual
+instructions, but it may insert other instructions between them (e.g.,
+to align a `LOOP' instruction). To prevent the assembler from
+modifying a series of instructions as a whole, use the `no-transform'
+directive. *Note transform: Transform Directive.
+
+
+File: as.info, Node: Xtensa Registers, Prev: Xtensa Opcodes, Up: Xtensa Syntax
+
+9.40.2.2 Register Names
+.......................
+
+The assembly syntax for a register file entry is the "short" name for a
+TIE register file followed by the index into that register file. For
+example, the general-purpose `AR' register file has a short name of
+`a', so these registers are named `a0'...`a15'. As a special feature,
+`sp' is also supported as a synonym for `a1'. Additional registers may
+be added by processor configuration options and by designer-defined TIE
+extensions. An initial `$' character is optional in all register names.
+
+
+File: as.info, Node: Xtensa Optimizations, Next: Xtensa Relaxation, Prev: Xtensa Syntax, Up: Xtensa-Dependent
+
+9.40.3 Xtensa Optimizations
+---------------------------
+
+The optimizations currently supported by `as' are generation of density
+instructions where appropriate and automatic branch target alignment.
+
+* Menu:
+
+* Density Instructions:: Using Density Instructions.
+* Xtensa Automatic Alignment:: Automatic Instruction Alignment.
+
+
+File: as.info, Node: Density Instructions, Next: Xtensa Automatic Alignment, Up: Xtensa Optimizations
+
+9.40.3.1 Using Density Instructions
+...................................
+
+The Xtensa instruction set has a code density option that provides
+16-bit versions of some of the most commonly used opcodes. Use of these
+opcodes can significantly reduce code size. When possible, the
+assembler automatically translates instructions from the core Xtensa
+instruction set into equivalent instructions from the Xtensa code
+density option. This translation can be disabled by using underscore
+prefixes (*note Opcode Names: Xtensa Opcodes.), by using the
+`--no-transform' command-line option (*note Command Line Options:
+Xtensa Options.), or by using the `no-transform' directive (*note
+transform: Transform Directive.).
+
+ It is a good idea _not_ to use the density instructions directly.
+The assembler will automatically select dense instructions where
+possible. If you later need to use an Xtensa processor without the code
+density option, the same assembly code will then work without
+modification.
+
+
+File: as.info, Node: Xtensa Automatic Alignment, Prev: Density Instructions, Up: Xtensa Optimizations
+
+9.40.3.2 Automatic Instruction Alignment
+........................................
+
+The Xtensa assembler will automatically align certain instructions, both
+to optimize performance and to satisfy architectural requirements.
+
+ As an optimization to improve performance, the assembler attempts to
+align branch targets so they do not cross instruction fetch boundaries.
+(Xtensa processors can be configured with either 32-bit or 64-bit
+instruction fetch widths.) An instruction immediately following a call
+is treated as a branch target in this context, because it will be the
+target of a return from the call. This alignment has the potential to
+reduce branch penalties at some expense in code size. This
+optimization is enabled by default. You can disable it with the
+`--no-target-align' command-line option (*note Command Line Options:
+Xtensa Options.).
+
+ The target alignment optimization is done without adding instructions
+that could increase the execution time of the program. If there are
+density instructions in the code preceding a target, the assembler can
+change the target alignment by widening some of those instructions to
+the equivalent 24-bit instructions. Extra bytes of padding can be
+inserted immediately following unconditional jump and return
+instructions. This approach is usually successful in aligning many,
+but not all, branch targets.
+
+ The `LOOP' family of instructions must be aligned such that the
+first instruction in the loop body does not cross an instruction fetch
+boundary (e.g., with a 32-bit fetch width, a `LOOP' instruction must be
+on either a 1 or 2 mod 4 byte boundary). The assembler knows about
+this restriction and inserts the minimal number of 2 or 3 byte no-op
+instructions to satisfy it. When no-op instructions are added, any
+label immediately preceding the original loop will be moved in order to
+refer to the loop instruction, not the newly generated no-op
+instruction. To preserve binary compatibility across processors with
+different fetch widths, the assembler conservatively assumes a 32-bit
+fetch width when aligning `LOOP' instructions (except if the first
+instruction in the loop is a 64-bit instruction).
+
+ Previous versions of the assembler automatically aligned `ENTRY'
+instructions to 4-byte boundaries, but that alignment is now the
+programmer's responsibility.
+
+
+File: as.info, Node: Xtensa Relaxation, Next: Xtensa Directives, Prev: Xtensa Optimizations, Up: Xtensa-Dependent
+
+9.40.4 Xtensa Relaxation
+------------------------
+
+When an instruction operand is outside the range allowed for that
+particular instruction field, `as' can transform the code to use a
+functionally-equivalent instruction or sequence of instructions. This
+process is known as "relaxation". This is typically done for branch
+instructions because the distance of the branch targets is not known
+until assembly-time. The Xtensa assembler offers branch relaxation and
+also extends this concept to function calls, `MOVI' instructions and
+other instructions with immediate fields.
+
+* Menu:
+
+* Xtensa Branch Relaxation:: Relaxation of Branches.
+* Xtensa Call Relaxation:: Relaxation of Function Calls.
+* Xtensa Immediate Relaxation:: Relaxation of other Immediate Fields.
+
+
+File: as.info, Node: Xtensa Branch Relaxation, Next: Xtensa Call Relaxation, Up: Xtensa Relaxation
+
+9.40.4.1 Conditional Branch Relaxation
+......................................
+
+When the target of a branch is too far away from the branch itself,
+i.e., when the offset from the branch to the target is too large to fit
+in the immediate field of the branch instruction, it may be necessary to
+replace the branch with a branch around a jump. For example,
+
+ beqz a2, L
+
+ may result in:
+
+ bnez.n a2, M
+ j L
+ M:
+
+ (The `BNEZ.N' instruction would be used in this example only if the
+density option is available. Otherwise, `BNEZ' would be used.)
+
+ This relaxation works well because the unconditional jump instruction
+has a much larger offset range than the various conditional branches.
+However, an error will occur if a branch target is beyond the range of a
+jump instruction. `as' cannot relax unconditional jumps. Similarly,
+an error will occur if the original input contains an unconditional
+jump to a target that is out of range.
+
+ Branch relaxation is enabled by default. It can be disabled by using
+underscore prefixes (*note Opcode Names: Xtensa Opcodes.), the
+`--no-transform' command-line option (*note Command Line Options:
+Xtensa Options.), or the `no-transform' directive (*note transform:
+Transform Directive.).
+
+
+File: as.info, Node: Xtensa Call Relaxation, Next: Xtensa Immediate Relaxation, Prev: Xtensa Branch Relaxation, Up: Xtensa Relaxation
+
+9.40.4.2 Function Call Relaxation
+.................................
+
+Function calls may require relaxation because the Xtensa immediate call
+instructions (`CALL0', `CALL4', `CALL8' and `CALL12') provide a
+PC-relative offset of only 512 Kbytes in either direction. For larger
+programs, it may be necessary to use indirect calls (`CALLX0',
+`CALLX4', `CALLX8' and `CALLX12') where the target address is specified
+in a register. The Xtensa assembler can automatically relax immediate
+call instructions into indirect call instructions. This relaxation is
+done by loading the address of the called function into the callee's
+return address register and then using a `CALLX' instruction. So, for
+example:
+
+ call8 func
+
+ might be relaxed to:
+
+ .literal .L1, func
+ l32r a8, .L1
+ callx8 a8
+
+ Because the addresses of targets of function calls are not generally
+known until link-time, the assembler must assume the worst and relax all
+the calls to functions in other source files, not just those that really
+will be out of range. The linker can recognize calls that were
+unnecessarily relaxed, and it will remove the overhead introduced by the
+assembler for those cases where direct calls are sufficient.
+
+ Call relaxation is disabled by default because it can have a negative
+effect on both code size and performance, although the linker can
+usually eliminate the unnecessary overhead. If a program is too large
+and some of the calls are out of range, function call relaxation can be
+enabled using the `--longcalls' command-line option or the `longcalls'
+directive (*note longcalls: Longcalls Directive.).
+
+
+File: as.info, Node: Xtensa Immediate Relaxation, Prev: Xtensa Call Relaxation, Up: Xtensa Relaxation
+
+9.40.4.3 Other Immediate Field Relaxation
+.........................................
+
+The assembler normally performs the following other relaxations. They
+can be disabled by using underscore prefixes (*note Opcode Names:
+Xtensa Opcodes.), the `--no-transform' command-line option (*note
+Command Line Options: Xtensa Options.), or the `no-transform' directive
+(*note transform: Transform Directive.).
+
+ The `MOVI' machine instruction can only materialize values in the
+range from -2048 to 2047. Values outside this range are best
+materialized with `L32R' instructions. Thus:
+
+ movi a0, 100000
+
+ is assembled into the following machine code:
+
+ .literal .L1, 100000
+ l32r a0, .L1
+
+ The `L8UI' machine instruction can only be used with immediate
+offsets in the range from 0 to 255. The `L16SI' and `L16UI' machine
+instructions can only be used with offsets from 0 to 510. The `L32I'
+machine instruction can only be used with offsets from 0 to 1020. A
+load offset outside these ranges can be materialized with an `L32R'
+instruction if the destination register of the load is different than
+the source address register. For example:
+
+ l32i a1, a0, 2040
+
+ is translated to:
+
+ .literal .L1, 2040
+ l32r a1, .L1
+ add a1, a0, a1
+ l32i a1, a1, 0
+
+If the load destination and source address register are the same, an
+out-of-range offset causes an error.
+
+ The Xtensa `ADDI' instruction only allows immediate operands in the
+range from -128 to 127. There are a number of alternate instruction
+sequences for the `ADDI' operation. First, if the immediate is 0, the
+`ADDI' will be turned into a `MOV.N' instruction (or the equivalent
+`OR' instruction if the code density option is not available). If the
+`ADDI' immediate is outside of the range -128 to 127, but inside the
+range -32896 to 32639, an `ADDMI' instruction or `ADDMI'/`ADDI'
+sequence will be used. Finally, if the immediate is outside of this
+range and a free register is available, an `L32R'/`ADD' sequence will
+be used with a literal allocated from the literal pool.
+
+ For example:
+
+ addi a5, a6, 0
+ addi a5, a6, 512
+ addi a5, a6, 513
+ addi a5, a6, 50000
+
+ is assembled into the following:
+
+ .literal .L1, 50000
+ mov.n a5, a6
+ addmi a5, a6, 0x200
+ addmi a5, a6, 0x200
+ addi a5, a5, 1
+ l32r a5, .L1
+ add a5, a6, a5
+
+
+File: as.info, Node: Xtensa Directives, Prev: Xtensa Relaxation, Up: Xtensa-Dependent
+
+9.40.5 Directives
+-----------------
+
+The Xtensa assembler supports a region-based directive syntax:
+
+ .begin DIRECTIVE [OPTIONS]
+ ...
+ .end DIRECTIVE
+
+ All the Xtensa-specific directives that apply to a region of code use
+this syntax.
+
+ The directive applies to code between the `.begin' and the `.end'.
+The state of the option after the `.end' reverts to what it was before
+the `.begin'. A nested `.begin'/`.end' region can further change the
+state of the directive without having to be aware of its outer state.
+For example, consider:
+
+ .begin no-transform
+ L: add a0, a1, a2
+ .begin transform
+ M: add a0, a1, a2
+ .end transform
+ N: add a0, a1, a2
+ .end no-transform
+
+ The `ADD' opcodes at `L' and `N' in the outer `no-transform' region
+both result in `ADD' machine instructions, but the assembler selects an
+`ADD.N' instruction for the `ADD' at `M' in the inner `transform'
+region.
+
+ The advantage of this style is that it works well inside macros
+which can preserve the context of their callers.
+
+ The following directives are available:
+
+* Menu:
+
+* Schedule Directive:: Enable instruction scheduling.
+* Longcalls Directive:: Use Indirect Calls for Greater Range.
+* Transform Directive:: Disable All Assembler Transformations.
+* Literal Directive:: Intermix Literals with Instructions.
+* Literal Position Directive:: Specify Inline Literal Pool Locations.
+* Literal Prefix Directive:: Specify Literal Section Name Prefix.
+* Absolute Literals Directive:: Control PC-Relative vs. Absolute Literals.
+
+
+File: as.info, Node: Schedule Directive, Next: Longcalls Directive, Up: Xtensa Directives
+
+9.40.5.1 schedule
+.................
+
+The `schedule' directive is recognized only for compatibility with
+Tensilica's assembler.
+
+ .begin [no-]schedule
+ .end [no-]schedule
+
+ This directive is ignored and has no effect on `as'.
+
+
+File: as.info, Node: Longcalls Directive, Next: Transform Directive, Prev: Schedule Directive, Up: Xtensa Directives
+
+9.40.5.2 longcalls
+..................
+
+The `longcalls' directive enables or disables function call relaxation.
+*Note Function Call Relaxation: Xtensa Call Relaxation.
+
+ .begin [no-]longcalls
+ .end [no-]longcalls
+
+ Call relaxation is disabled by default unless the `--longcalls'
+command-line option is specified. The `longcalls' directive overrides
+the default determined by the command-line options.
+
+
+File: as.info, Node: Transform Directive, Next: Literal Directive, Prev: Longcalls Directive, Up: Xtensa Directives
+
+9.40.5.3 transform
+..................
+
+This directive enables or disables all assembler transformation,
+including relaxation (*note Xtensa Relaxation: Xtensa Relaxation.) and
+optimization (*note Xtensa Optimizations: Xtensa Optimizations.).
+
+ .begin [no-]transform
+ .end [no-]transform
+
+ Transformations are enabled by default unless the `--no-transform'
+option is used. The `transform' directive overrides the default
+determined by the command-line options. An underscore opcode prefix,
+disabling transformation of that opcode, always takes precedence over
+both directives and command-line flags.
+
+
+File: as.info, Node: Literal Directive, Next: Literal Position Directive, Prev: Transform Directive, Up: Xtensa Directives
+
+9.40.5.4 literal
+................
+
+The `.literal' directive is used to define literal pool data, i.e.,
+read-only 32-bit data accessed via `L32R' instructions.
+
+ .literal LABEL, VALUE[, VALUE...]
+
+ This directive is similar to the standard `.word' directive, except
+that the actual location of the literal data is determined by the
+assembler and linker, not by the position of the `.literal' directive.
+Using this directive gives the assembler freedom to locate the literal
+data in the most appropriate place and possibly to combine identical
+literals. For example, the code:
+
+ entry sp, 40
+ .literal .L1, sym
+ l32r a4, .L1
+
+ can be used to load a pointer to the symbol `sym' into register
+`a4'. The value of `sym' will not be placed between the `ENTRY' and
+`L32R' instructions; instead, the assembler puts the data in a literal
+pool.
+
+ Literal pools are placed by default in separate literal sections;
+however, when using the `--text-section-literals' option (*note Command
+Line Options: Xtensa Options.), the literal pools for PC-relative mode
+`L32R' instructions are placed in the current section.(1) These text
+section literal pools are created automatically before `ENTRY'
+instructions and manually after `.literal_position' directives (*note
+literal_position: Literal Position Directive.). If there are no
+preceding `ENTRY' instructions, explicit `.literal_position' directives
+must be used to place the text section literal pools; otherwise, `as'
+will report an error.
+
+ When literals are placed in separate sections, the literal section
+names are derived from the names of the sections where the literals are
+defined. The base literal section names are `.literal' for PC-relative
+mode `L32R' instructions and `.lit4' for absolute mode `L32R'
+instructions (*note absolute-literals: Absolute Literals Directive.).
+These base names are used for literals defined in the default `.text'
+section. For literals defined in other sections or within the scope of
+a `literal_prefix' directive (*note literal_prefix: Literal Prefix
+Directive.), the following rules determine the literal section name:
+
+ 1. If the current section is a member of a section group, the literal
+ section name includes the group name as a suffix to the base
+ `.literal' or `.lit4' name, with a period to separate the base
+ name and group name. The literal section is also made a member of
+ the group.
+
+ 2. If the current section name (or `literal_prefix' value) begins with
+ "`.gnu.linkonce.KIND.'", the literal section name is formed by
+ replacing "`.KIND'" with the base `.literal' or `.lit4' name. For
+ example, for literals defined in a section named
+ `.gnu.linkonce.t.func', the literal section will be
+ `.gnu.linkonce.literal.func' or `.gnu.linkonce.lit4.func'.
+
+ 3. If the current section name (or `literal_prefix' value) ends with
+ `.text', the literal section name is formed by replacing that
+ suffix with the base `.literal' or `.lit4' name. For example, for
+ literals defined in a section named `.iram0.text', the literal
+ section will be `.iram0.literal' or `.iram0.lit4'.
+
+ 4. If none of the preceding conditions apply, the literal section
+ name is formed by adding the base `.literal' or `.lit4' name as a
+ suffix to the current section name (or `literal_prefix' value).
+
+ ---------- Footnotes ----------
+
+ (1) Literals for the `.init' and `.fini' sections are always placed
+in separate sections, even when `--text-section-literals' is enabled.
+
+
+File: as.info, Node: Literal Position Directive, Next: Literal Prefix Directive, Prev: Literal Directive, Up: Xtensa Directives
+
+9.40.5.5 literal_position
+.........................
+
+When using `--text-section-literals' to place literals inline in the
+section being assembled, the `.literal_position' directive can be used
+to mark a potential location for a literal pool.
+
+ .literal_position
+
+ The `.literal_position' directive is ignored when the
+`--text-section-literals' option is not used or when `L32R'
+instructions use the absolute addressing mode.
+
+ The assembler will automatically place text section literal pools
+before `ENTRY' instructions, so the `.literal_position' directive is
+only needed to specify some other location for a literal pool. You may
+need to add an explicit jump instruction to skip over an inline literal
+pool.
+
+ For example, an interrupt vector does not begin with an `ENTRY'
+instruction so the assembler will be unable to automatically find a good
+place to put a literal pool. Moreover, the code for the interrupt
+vector must be at a specific starting address, so the literal pool
+cannot come before the start of the code. The literal pool for the
+vector must be explicitly positioned in the middle of the vector (before
+any uses of the literals, due to the negative offsets used by
+PC-relative `L32R' instructions). The `.literal_position' directive
+can be used to do this. In the following code, the literal for `M'
+will automatically be aligned correctly and is placed after the
+unconditional jump.
+
+ .global M
+ code_start:
+ j continue
+ .literal_position
+ .align 4
+ continue:
+ movi a4, M
+
+
+File: as.info, Node: Literal Prefix Directive, Next: Absolute Literals Directive, Prev: Literal Position Directive, Up: Xtensa Directives
+
+9.40.5.6 literal_prefix
+.......................
+
+The `literal_prefix' directive allows you to override the default
+literal section names, which are derived from the names of the sections
+where the literals are defined.
+
+ .begin literal_prefix [NAME]
+ .end literal_prefix
+
+ For literals defined within the delimited region, the literal section
+names are derived from the NAME argument instead of the name of the
+current section. The rules used to derive the literal section names do
+not change. *Note literal: Literal Directive. If the NAME argument is
+omitted, the literal sections revert to the defaults. This directive
+has no effect when using the `--text-section-literals' option (*note
+Command Line Options: Xtensa Options.).
+
+
+File: as.info, Node: Absolute Literals Directive, Prev: Literal Prefix Directive, Up: Xtensa Directives
+
+9.40.5.7 absolute-literals
+..........................
+
+The `absolute-literals' and `no-absolute-literals' directives control
+the absolute vs. PC-relative mode for `L32R' instructions. These are
+relevant only for Xtensa configurations that include the absolute
+addressing option for `L32R' instructions.
+
+ .begin [no-]absolute-literals
+ .end [no-]absolute-literals
+
+ These directives do not change the `L32R' mode--they only cause the
+assembler to emit the appropriate kind of relocation for `L32R'
+instructions and to place the literal values in the appropriate section.
+To change the `L32R' mode, the program must write the `LITBASE' special
+register. It is the programmer's responsibility to keep track of the
+mode and indicate to the assembler which mode is used in each region of
+code.
+
+ If the Xtensa configuration includes the absolute `L32R' addressing
+option, the default is to assume absolute `L32R' addressing unless the
+`--no-absolute-literals' command-line option is specified. Otherwise,
+the default is to assume PC-relative `L32R' addressing. The
+`absolute-literals' directive can then be used to override the default
+determined by the command-line options.
+
+
+File: as.info, Node: Reporting Bugs, Next: Acknowledgements, Prev: Machine Dependencies, Up: Top
+
+10 Reporting Bugs
+*****************
+
+Your bug reports play an essential role in making `as' reliable.
+
+ Reporting a bug may help you by bringing a solution to your problem,
+or it may not. But in any case the principal function of a bug report
+is to help the entire community by making the next version of `as' work
+better. Bug reports are your contribution to the maintenance of `as'.
+
+ In order for a bug report to serve its purpose, you must include the
+information that enables us to fix the bug.
+
+* Menu:
+
+* Bug Criteria:: Have you found a bug?
+* Bug Reporting:: How to report bugs
+
+
+File: as.info, Node: Bug Criteria, Next: Bug Reporting, Up: Reporting Bugs
+
+10.1 Have You Found a Bug?
+==========================
+
+If you are not sure whether you have found a bug, here are some
+guidelines:
+
+ * If the assembler gets a fatal signal, for any input whatever, that
+ is a `as' bug. Reliable assemblers never crash.
+
+ * If `as' produces an error message for valid input, that is a bug.
+
+ * If `as' does not produce an error message for invalid input, that
+ is a bug. However, you should note that your idea of "invalid
+ input" might be our idea of "an extension" or "support for
+ traditional practice".
+
+ * If you are an experienced user of assemblers, your suggestions for
+ improvement of `as' are welcome in any case.
+
+
+File: as.info, Node: Bug Reporting, Prev: Bug Criteria, Up: Reporting Bugs
+
+10.2 How to Report Bugs
+=======================
+
+A number of companies and individuals offer support for GNU products.
+If you obtained `as' from a support organization, we recommend you
+contact that organization first.
+
+ You can find contact information for many support companies and
+individuals in the file `etc/SERVICE' in the GNU Emacs distribution.
+
+ In any event, we also recommend that you send bug reports for `as'
+to `http://www.sourceware.org/bugzilla/'.
+
+ The fundamental principle of reporting bugs usefully is this:
+*report all the facts*. If you are not sure whether to state a fact or
+leave it out, state it!
+
+ Often people omit facts because they think they know what causes the
+problem and assume that some details do not matter. Thus, you might
+assume that the name of a symbol you use in an example does not matter.
+Well, probably it does not, but one cannot be sure. Perhaps the bug
+is a stray memory reference which happens to fetch from the location
+where that name is stored in memory; perhaps, if the name were
+different, the contents of that location would fool the assembler into
+doing the right thing despite the bug. Play it safe and give a
+specific, complete example. That is the easiest thing for you to do,
+and the most helpful.
+
+ Keep in mind that the purpose of a bug report is to enable us to fix
+the bug if it is new to us. Therefore, always write your bug reports
+on the assumption that the bug has not been reported previously.
+
+ Sometimes people give a few sketchy facts and ask, "Does this ring a
+bell?" This cannot help us fix a bug, so it is basically useless. We
+respond by asking for enough details to enable us to investigate. You
+might as well expedite matters by sending them to begin with.
+
+ To enable us to fix the bug, you should include all these things:
+
+ * The version of `as'. `as' announces it if you start it with the
+ `--version' argument.
+
+ Without this, we will not know whether there is any point in
+ looking for the bug in the current version of `as'.
+
+ * Any patches you may have applied to the `as' source.
+
+ * The type of machine you are using, and the operating system name
+ and version number.
+
+ * What compiler (and its version) was used to compile `as'--e.g.
+ "`gcc-2.7'".
+
+ * The command arguments you gave the assembler to assemble your
+ example and observe the bug. To guarantee you will not omit
+ something important, list them all. A copy of the Makefile (or
+ the output from make) is sufficient.
+
+ If we were to try to guess the arguments, we would probably guess
+ wrong and then we might not encounter the bug.
+
+ * A complete input file that will reproduce the bug. If the bug is
+ observed when the assembler is invoked via a compiler, send the
+ assembler source, not the high level language source. Most
+ compilers will produce the assembler source when run with the `-S'
+ option. If you are using `gcc', use the options `-v
+ --save-temps'; this will save the assembler source in a file with
+ an extension of `.s', and also show you exactly how `as' is being
+ run.
+
+ * A description of what behavior you observe that you believe is
+ incorrect. For example, "It gets a fatal signal."
+
+ Of course, if the bug is that `as' gets a fatal signal, then we
+ will certainly notice it. But if the bug is incorrect output, we
+ might not notice unless it is glaringly wrong. You might as well
+ not give us a chance to make a mistake.
+
+ Even if the problem you experience is a fatal signal, you should
+ still say so explicitly. Suppose something strange is going on,
+ such as, your copy of `as' is out of sync, or you have encountered
+ a bug in the C library on your system. (This has happened!) Your
+ copy might crash and ours would not. If you told us to expect a
+ crash, then when ours fails to crash, we would know that the bug
+ was not happening for us. If you had not told us to expect a
+ crash, then we would not be able to draw any conclusion from our
+ observations.
+
+ * If you wish to suggest changes to the `as' source, send us context
+ diffs, as generated by `diff' with the `-u', `-c', or `-p' option.
+ Always send diffs from the old file to the new file. If you even
+ discuss something in the `as' source, refer to it by context, not
+ by line number.
+
+ The line numbers in our development sources will not match those
+ in your sources. Your line numbers would convey no useful
+ information to us.
+
+ Here are some things that are not necessary:
+
+ * A description of the envelope of the bug.
+
+ Often people who encounter a bug spend a lot of time investigating
+ which changes to the input file will make the bug go away and which
+ changes will not affect it.
+
+ This is often time consuming and not very useful, because the way
+ we will find the bug is by running a single example under the
+ debugger with breakpoints, not by pure deduction from a series of
+ examples. We recommend that you save your time for something else.
+
+ Of course, if you can find a simpler example to report _instead_
+ of the original one, that is a convenience for us. Errors in the
+ output will be easier to spot, running under the debugger will take
+ less time, and so on.
+
+ However, simplification is not vital; if you do not want to do
+ this, report the bug anyway and send us the entire test case you
+ used.
+
+ * A patch for the bug.
+
+ A patch for the bug does help us if it is a good one. But do not
+ omit the necessary information, such as the test case, on the
+ assumption that a patch is all we need. We might see problems
+ with your patch and decide to fix the problem another way, or we
+ might not understand it at all.
+
+ Sometimes with a program as complicated as `as' it is very hard to
+ construct an example that will make the program follow a certain
+ path through the code. If you do not send us the example, we will
+ not be able to construct one, so we will not be able to verify
+ that the bug is fixed.
+
+ And if we cannot understand what bug you are trying to fix, or why
+ your patch should be an improvement, we will not install it. A
+ test case will help us to understand.
+
+ * A guess about what the bug is or what it depends on.
+
+ Such guesses are usually wrong. Even we cannot guess right about
+ such things without first using the debugger to find the facts.
+
+
+File: as.info, Node: Acknowledgements, Next: GNU Free Documentation License, Prev: Reporting Bugs, Up: Top
+
+11 Acknowledgements
+*******************
+
+If you have contributed to GAS and your name isn't listed here, it is
+not meant as a slight. We just don't know about it. Send mail to the
+maintainer, and we'll correct the situation. Currently the maintainer
+is Ken Raeburn (email address `raeburn@cygnus.com').
+
+ Dean Elsner wrote the original GNU assembler for the VAX.(1)
+
+ Jay Fenlason maintained GAS for a while, adding support for
+GDB-specific debug information and the 68k series machines, most of the
+preprocessing pass, and extensive changes in `messages.c',
+`input-file.c', `write.c'.
+
+ K. Richard Pixley maintained GAS for a while, adding various
+enhancements and many bug fixes, including merging support for several
+processors, breaking GAS up to handle multiple object file format back
+ends (including heavy rewrite, testing, an integration of the coff and
+b.out back ends), adding configuration including heavy testing and
+verification of cross assemblers and file splits and renaming,
+converted GAS to strictly ANSI C including full prototypes, added
+support for m680[34]0 and cpu32, did considerable work on i960
+including a COFF port (including considerable amounts of reverse
+engineering), a SPARC opcode file rewrite, DECstation, rs6000, and
+hp300hpux host ports, updated "know" assertions and made them work,
+much other reorganization, cleanup, and lint.
+
+ Ken Raeburn wrote the high-level BFD interface code to replace most
+of the code in format-specific I/O modules.
+
+ The original VMS support was contributed by David L. Kashtan. Eric
+Youngdale has done much work with it since.
+
+ The Intel 80386 machine description was written by Eliot Dresselhaus.
+
+ Minh Tran-Le at IntelliCorp contributed some AIX 386 support.
+
+ The Motorola 88k machine description was contributed by Devon Bowen
+of Buffalo University and Torbjorn Granlund of the Swedish Institute of
+Computer Science.
+
+ Keith Knowles at the Open Software Foundation wrote the original
+MIPS back end (`tc-mips.c', `tc-mips.h'), and contributed Rose format
+support (which hasn't been merged in yet). Ralph Campbell worked with
+the MIPS code to support a.out format.
+
+ Support for the Zilog Z8k and Renesas H8/300 processors (tc-z8k,
+tc-h8300), and IEEE 695 object file format (obj-ieee), was written by
+Steve Chamberlain of Cygnus Support. Steve also modified the COFF back
+end to use BFD for some low-level operations, for use with the H8/300
+and AMD 29k targets.
+
+ John Gilmore built the AMD 29000 support, added `.include' support,
+and simplified the configuration of which versions accept which
+directives. He updated the 68k machine description so that Motorola's
+opcodes always produced fixed-size instructions (e.g., `jsr'), while
+synthetic instructions remained shrinkable (`jbsr'). John fixed many
+bugs, including true tested cross-compilation support, and one bug in
+relaxation that took a week and required the proverbial one-bit fix.
+
+ Ian Lance Taylor of Cygnus Support merged the Motorola and MIT
+syntax for the 68k, completed support for some COFF targets (68k, i386
+SVR3, and SCO Unix), added support for MIPS ECOFF and ELF targets,
+wrote the initial RS/6000 and PowerPC assembler, and made a few other
+minor patches.
+
+ Steve Chamberlain made GAS able to generate listings.
+
+ Hewlett-Packard contributed support for the HP9000/300.
+
+ Jeff Law wrote GAS and BFD support for the native HPPA object format
+(SOM) along with a fairly extensive HPPA testsuite (for both SOM and
+ELF object formats). This work was supported by both the Center for
+Software Science at the University of Utah and Cygnus Support.
+
+ Support for ELF format files has been worked on by Mark Eichin of
+Cygnus Support (original, incomplete implementation for SPARC), Pete
+Hoogenboom and Jeff Law at the University of Utah (HPPA mainly),
+Michael Meissner of the Open Software Foundation (i386 mainly), and Ken
+Raeburn of Cygnus Support (sparc, and some initial 64-bit support).
+
+ Linas Vepstas added GAS support for the ESA/390 "IBM 370"
+architecture.
+
+ Richard Henderson rewrote the Alpha assembler. Klaus Kaempf wrote
+GAS and BFD support for openVMS/Alpha.
+
+ Timothy Wall, Michael Hayes, and Greg Smart contributed to the
+various tic* flavors.
+
+ David Heine, Sterling Augustine, Bob Wilson and John Ruttenberg from
+Tensilica, Inc. added support for Xtensa processors.
+
+ Several engineers at Cygnus Support have also provided many small
+bug fixes and configuration enhancements.
+
+ Jon Beniston added support for the Lattice Mico32 architecture.
+
+ Many others have contributed large or small bugfixes and
+enhancements. If you have contributed significant work and are not
+mentioned on this list, and want to be, let us know. Some of the
+history has been lost; we are not intentionally leaving anyone out.
+
+ ---------- Footnotes ----------
+
+ (1) Any more details?
+
+
+File: as.info, Node: GNU Free Documentation License, Next: AS Index, Prev: Acknowledgements, Up: Top
+
+Appendix A GNU Free Documentation License
+*****************************************
+
+ Version 1.3, 3 November 2008
+
+ Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+ `http://fsf.org/'
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ 0. PREAMBLE
+
+ The purpose of this License is to make a manual, textbook, or other
+ functional and useful document "free" in the sense of freedom: to
+ assure everyone the effective freedom to copy and redistribute it,
+ with or without modifying it, either commercially or
+ noncommercially. Secondarily, this License preserves for the
+ author and publisher a way to get credit for their work, while not
+ being considered responsible for modifications made by others.
+
+ This License is a kind of "copyleft", which means that derivative
+ works of the document must themselves be free in the same sense.
+ It complements the GNU General Public License, which is a copyleft
+ license designed for free software.
+
+ We have designed this License in order to use it for manuals for
+ free software, because free software needs free documentation: a
+ free program should come with manuals providing the same freedoms
+ that the software does. But this License is not limited to
+ software manuals; it can be used for any textual work, regardless
+ of subject matter or whether it is published as a printed book.
+ We recommend this License principally for works whose purpose is
+ instruction or reference.
+
+ 1. APPLICABILITY AND DEFINITIONS
+
+ This License applies to any manual or other work, in any medium,
+ that contains a notice placed by the copyright holder saying it
+ can be distributed under the terms of this License. Such a notice
+ grants a world-wide, royalty-free license, unlimited in duration,
+ to use that work under the conditions stated herein. The
+ "Document", below, refers to any such manual or work. Any member
+ of the public is a licensee, and is addressed as "you". You
+ accept the license if you copy, modify or distribute the work in a
+ way requiring permission under copyright law.
+
+ A "Modified Version" of the Document means any work containing the
+ Document or a portion of it, either copied verbatim, or with
+ modifications and/or translated into another language.
+
+ A "Secondary Section" is a named appendix or a front-matter section
+ of the Document that deals exclusively with the relationship of the
+ publishers or authors of the Document to the Document's overall
+ subject (or to related matters) and contains nothing that could
+ fall directly within that overall subject. (Thus, if the Document
+ is in part a textbook of mathematics, a Secondary Section may not
+ explain any mathematics.) The relationship could be a matter of
+ historical connection with the subject or with related matters, or
+ of legal, commercial, philosophical, ethical or political position
+ regarding them.
+
+ The "Invariant Sections" are certain Secondary Sections whose
+ titles are designated, as being those of Invariant Sections, in
+ the notice that says that the Document is released under this
+ License. If a section does not fit the above definition of
+ Secondary then it is not allowed to be designated as Invariant.
+ The Document may contain zero Invariant Sections. If the Document
+ does not identify any Invariant Sections then there are none.
+
+ The "Cover Texts" are certain short passages of text that are
+ listed, as Front-Cover Texts or Back-Cover Texts, in the notice
+ that says that the Document is released under this License. A
+ Front-Cover Text may be at most 5 words, and a Back-Cover Text may
+ be at most 25 words.
+
+ A "Transparent" copy of the Document means a machine-readable copy,
+ represented in a format whose specification is available to the
+ general public, that is suitable for revising the document
+ straightforwardly with generic text editors or (for images
+ composed of pixels) generic paint programs or (for drawings) some
+ widely available drawing editor, and that is suitable for input to
+ text formatters or for automatic translation to a variety of
+ formats suitable for input to text formatters. A copy made in an
+ otherwise Transparent file format whose markup, or absence of
+ markup, has been arranged to thwart or discourage subsequent
+ modification by readers is not Transparent. An image format is
+ not Transparent if used for any substantial amount of text. A
+ copy that is not "Transparent" is called "Opaque".
+
+ Examples of suitable formats for Transparent copies include plain
+ ASCII without markup, Texinfo input format, LaTeX input format,
+ SGML or XML using a publicly available DTD, and
+ standard-conforming simple HTML, PostScript or PDF designed for
+ human modification. Examples of transparent image formats include
+ PNG, XCF and JPG. Opaque formats include proprietary formats that
+ can be read and edited only by proprietary word processors, SGML or
+ XML for which the DTD and/or processing tools are not generally
+ available, and the machine-generated HTML, PostScript or PDF
+ produced by some word processors for output purposes only.
+
+ The "Title Page" means, for a printed book, the title page itself,
+ plus such following pages as are needed to hold, legibly, the
+ material this License requires to appear in the title page. For
+ works in formats which do not have any title page as such, "Title
+ Page" means the text near the most prominent appearance of the
+ work's title, preceding the beginning of the body of the text.
+
+ The "publisher" means any person or entity that distributes copies
+ of the Document to the public.
+
+ A section "Entitled XYZ" means a named subunit of the Document
+ whose title either is precisely XYZ or contains XYZ in parentheses
+ following text that translates XYZ in another language. (Here XYZ
+ stands for a specific section name mentioned below, such as
+ "Acknowledgements", "Dedications", "Endorsements", or "History".)
+ To "Preserve the Title" of such a section when you modify the
+ Document means that it remains a section "Entitled XYZ" according
+ to this definition.
+
+ The Document may include Warranty Disclaimers next to the notice
+ which states that this License applies to the Document. These
+ Warranty Disclaimers are considered to be included by reference in
+ this License, but only as regards disclaiming warranties: any other
+ implication that these Warranty Disclaimers may have is void and
+ has no effect on the meaning of this License.
+
+ 2. VERBATIM COPYING
+
+ You may copy and distribute the Document in any medium, either
+ commercially or noncommercially, provided that this License, the
+ copyright notices, and the license notice saying this License
+ applies to the Document are reproduced in all copies, and that you
+ add no other conditions whatsoever to those of this License. You
+ may not use technical measures to obstruct or control the reading
+ or further copying of the copies you make or distribute. However,
+ you may accept compensation in exchange for copies. If you
+ distribute a large enough number of copies you must also follow
+ the conditions in section 3.
+
+ You may also lend copies, under the same conditions stated above,
+ and you may publicly display copies.
+
+ 3. COPYING IN QUANTITY
+
+ If you publish printed copies (or copies in media that commonly
+ have printed covers) of the Document, numbering more than 100, and
+ the Document's license notice requires Cover Texts, you must
+ enclose the copies in covers that carry, clearly and legibly, all
+ these Cover Texts: Front-Cover Texts on the front cover, and
+ Back-Cover Texts on the back cover. Both covers must also clearly
+ and legibly identify you as the publisher of these copies. The
+ front cover must present the full title with all words of the
+ title equally prominent and visible. You may add other material
+ on the covers in addition. Copying with changes limited to the
+ covers, as long as they preserve the title of the Document and
+ satisfy these conditions, can be treated as verbatim copying in
+ other respects.
+
+ If the required texts for either cover are too voluminous to fit
+ legibly, you should put the first ones listed (as many as fit
+ reasonably) on the actual cover, and continue the rest onto
+ adjacent pages.
+
+ If you publish or distribute Opaque copies of the Document
+ numbering more than 100, you must either include a
+ machine-readable Transparent copy along with each Opaque copy, or
+ state in or with each Opaque copy a computer-network location from
+ which the general network-using public has access to download
+ using public-standard network protocols a complete Transparent
+ copy of the Document, free of added material. If you use the
+ latter option, you must take reasonably prudent steps, when you
+ begin distribution of Opaque copies in quantity, to ensure that
+ this Transparent copy will remain thus accessible at the stated
+ location until at least one year after the last time you
+ distribute an Opaque copy (directly or through your agents or
+ retailers) of that edition to the public.
+
+ It is requested, but not required, that you contact the authors of
+ the Document well before redistributing any large number of
+ copies, to give them a chance to provide you with an updated
+ version of the Document.
+
+ 4. MODIFICATIONS
+
+ You may copy and distribute a Modified Version of the Document
+ under the conditions of sections 2 and 3 above, provided that you
+ release the Modified Version under precisely this License, with
+ the Modified Version filling the role of the Document, thus
+ licensing distribution and modification of the Modified Version to
+ whoever possesses a copy of it. In addition, you must do these
+ things in the Modified Version:
+
+ A. Use in the Title Page (and on the covers, if any) a title
+ distinct from that of the Document, and from those of
+ previous versions (which should, if there were any, be listed
+ in the History section of the Document). You may use the
+ same title as a previous version if the original publisher of
+ that version gives permission.
+
+ B. List on the Title Page, as authors, one or more persons or
+ entities responsible for authorship of the modifications in
+ the Modified Version, together with at least five of the
+ principal authors of the Document (all of its principal
+ authors, if it has fewer than five), unless they release you
+ from this requirement.
+
+ C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+
+ D. Preserve all the copyright notices of the Document.
+
+ E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+
+ F. Include, immediately after the copyright notices, a license
+ notice giving the public permission to use the Modified
+ Version under the terms of this License, in the form shown in
+ the Addendum below.
+
+ G. Preserve in that license notice the full lists of Invariant
+ Sections and required Cover Texts given in the Document's
+ license notice.
+
+ H. Include an unaltered copy of this License.
+
+ I. Preserve the section Entitled "History", Preserve its Title,
+ and add to it an item stating at least the title, year, new
+ authors, and publisher of the Modified Version as given on
+ the Title Page. If there is no section Entitled "History" in
+ the Document, create one stating the title, year, authors,
+ and publisher of the Document as given on its Title Page,
+ then add an item describing the Modified Version as stated in
+ the previous sentence.
+
+ J. Preserve the network location, if any, given in the Document
+ for public access to a Transparent copy of the Document, and
+ likewise the network locations given in the Document for
+ previous versions it was based on. These may be placed in
+ the "History" section. You may omit a network location for a
+ work that was published at least four years before the
+ Document itself, or if the original publisher of the version
+ it refers to gives permission.
+
+ K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the
+ section all the substance and tone of each of the contributor
+ acknowledgements and/or dedications given therein.
+
+ L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section
+ titles.
+
+ M. Delete any section Entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+
+ N. Do not retitle any existing section to be Entitled
+ "Endorsements" or to conflict in title with any Invariant
+ Section.
+
+ O. Preserve any Warranty Disclaimers.
+
+ If the Modified Version includes new front-matter sections or
+ appendices that qualify as Secondary Sections and contain no
+ material copied from the Document, you may at your option
+ designate some or all of these sections as invariant. To do this,
+ add their titles to the list of Invariant Sections in the Modified
+ Version's license notice. These titles must be distinct from any
+ other section titles.
+
+ You may add a section Entitled "Endorsements", provided it contains
+ nothing but endorsements of your Modified Version by various
+ parties--for example, statements of peer review or that the text
+ has been approved by an organization as the authoritative
+ definition of a standard.
+
+ You may add a passage of up to five words as a Front-Cover Text,
+ and a passage of up to 25 words as a Back-Cover Text, to the end
+ of the list of Cover Texts in the Modified Version. Only one
+ passage of Front-Cover Text and one of Back-Cover Text may be
+ added by (or through arrangements made by) any one entity. If the
+ Document already includes a cover text for the same cover,
+ previously added by you or by arrangement made by the same entity
+ you are acting on behalf of, you may not add another; but you may
+ replace the old one, on explicit permission from the previous
+ publisher that added the old one.
+
+ The author(s) and publisher(s) of the Document do not by this
+ License give permission to use their names for publicity for or to
+ assert or imply endorsement of any Modified Version.
+
+ 5. COMBINING DOCUMENTS
+
+ You may combine the Document with other documents released under
+ this License, under the terms defined in section 4 above for
+ modified versions, provided that you include in the combination
+ all of the Invariant Sections of all of the original documents,
+ unmodified, and list them all as Invariant Sections of your
+ combined work in its license notice, and that you preserve all
+ their Warranty Disclaimers.
+
+ The combined work need only contain one copy of this License, and
+ multiple identical Invariant Sections may be replaced with a single
+ copy. If there are multiple Invariant Sections with the same name
+ but different contents, make the title of each such section unique
+ by adding at the end of it, in parentheses, the name of the
+ original author or publisher of that section if known, or else a
+ unique number. Make the same adjustment to the section titles in
+ the list of Invariant Sections in the license notice of the
+ combined work.
+
+ In the combination, you must combine any sections Entitled
+ "History" in the various original documents, forming one section
+ Entitled "History"; likewise combine any sections Entitled
+ "Acknowledgements", and any sections Entitled "Dedications". You
+ must delete all sections Entitled "Endorsements."
+
+ 6. COLLECTIONS OF DOCUMENTS
+
+ You may make a collection consisting of the Document and other
+ documents released under this License, and replace the individual
+ copies of this License in the various documents with a single copy
+ that is included in the collection, provided that you follow the
+ rules of this License for verbatim copying of each of the
+ documents in all other respects.
+
+ You may extract a single document from such a collection, and
+ distribute it individually under this License, provided you insert
+ a copy of this License into the extracted document, and follow
+ this License in all other respects regarding verbatim copying of
+ that document.
+
+ 7. AGGREGATION WITH INDEPENDENT WORKS
+
+ A compilation of the Document or its derivatives with other
+ separate and independent documents or works, in or on a volume of
+ a storage or distribution medium, is called an "aggregate" if the
+ copyright resulting from the compilation is not used to limit the
+ legal rights of the compilation's users beyond what the individual
+ works permit. When the Document is included in an aggregate, this
+ License does not apply to the other works in the aggregate which
+ are not themselves derivative works of the Document.
+
+ If the Cover Text requirement of section 3 is applicable to these
+ copies of the Document, then if the Document is less than one half
+ of the entire aggregate, the Document's Cover Texts may be placed
+ on covers that bracket the Document within the aggregate, or the
+ electronic equivalent of covers if the Document is in electronic
+ form. Otherwise they must appear on printed covers that bracket
+ the whole aggregate.
+
+ 8. TRANSLATION
+
+ Translation is considered a kind of modification, so you may
+ distribute translations of the Document under the terms of section
+ 4. Replacing Invariant Sections with translations requires special
+ permission from their copyright holders, but you may include
+ translations of some or all Invariant Sections in addition to the
+ original versions of these Invariant Sections. You may include a
+ translation of this License, and all the license notices in the
+ Document, and any Warranty Disclaimers, provided that you also
+ include the original English version of this License and the
+ original versions of those notices and disclaimers. In case of a
+ disagreement between the translation and the original version of
+ this License or a notice or disclaimer, the original version will
+ prevail.
+
+ If a section in the Document is Entitled "Acknowledgements",
+ "Dedications", or "History", the requirement (section 4) to
+ Preserve its Title (section 1) will typically require changing the
+ actual title.
+
+ 9. TERMINATION
+
+ You may not copy, modify, sublicense, or distribute the Document
+ except as expressly provided under this License. Any attempt
+ otherwise to copy, modify, sublicense, or distribute it is void,
+ and will automatically terminate your rights under this License.
+
+ However, if you cease all violation of this License, then your
+ license from a particular copyright holder is reinstated (a)
+ provisionally, unless and until the copyright holder explicitly
+ and finally terminates your license, and (b) permanently, if the
+ copyright holder fails to notify you of the violation by some
+ reasonable means prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+ reinstated permanently if the copyright holder notifies you of the
+ violation by some reasonable means, this is the first time you have
+ received notice of violation of this License (for any work) from
+ that copyright holder, and you cure the violation prior to 30 days
+ after your receipt of the notice.
+
+ Termination of your rights under this section does not terminate
+ the licenses of parties who have received copies or rights from
+ you under this License. If your rights have been terminated and
+ not permanently reinstated, receipt of a copy of some or all of
+ the same material does not give you any rights to use it.
+
+ 10. FUTURE REVISIONS OF THIS LICENSE
+
+ The Free Software Foundation may publish new, revised versions of
+ the GNU Free Documentation License from time to time. Such new
+ versions will be similar in spirit to the present version, but may
+ differ in detail to address new problems or concerns. See
+ `http://www.gnu.org/copyleft/'.
+
+ Each version of the License is given a distinguishing version
+ number. If the Document specifies that a particular numbered
+ version of this License "or any later version" applies to it, you
+ have the option of following the terms and conditions either of
+ that specified version or of any later version that has been
+ published (not as a draft) by the Free Software Foundation. If
+ the Document does not specify a version number of this License,
+ you may choose any version ever published (not as a draft) by the
+ Free Software Foundation. If the Document specifies that a proxy
+ can decide which future versions of this License can be used, that
+ proxy's public statement of acceptance of a version permanently
+ authorizes you to choose that version for the Document.
+
+ 11. RELICENSING
+
+ "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
+ World Wide Web server that publishes copyrightable works and also
+ provides prominent facilities for anybody to edit those works. A
+ public wiki that anybody can edit is an example of such a server.
+ A "Massive Multiauthor Collaboration" (or "MMC") contained in the
+ site means any set of copyrightable works thus published on the MMC
+ site.
+
+ "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
+ license published by Creative Commons Corporation, a not-for-profit
+ corporation with a principal place of business in San Francisco,
+ California, as well as future copyleft versions of that license
+ published by that same organization.
+
+ "Incorporate" means to publish or republish a Document, in whole or
+ in part, as part of another Document.
+
+ An MMC is "eligible for relicensing" if it is licensed under this
+ License, and if all works that were first published under this
+ License somewhere other than this MMC, and subsequently
+ incorporated in whole or in part into the MMC, (1) had no cover
+ texts or invariant sections, and (2) were thus incorporated prior
+ to November 1, 2008.
+
+ The operator of an MMC Site may republish an MMC contained in the
+ site under CC-BY-SA on the same site at any time before August 1,
+ 2009, provided the MMC is eligible for relicensing.
+
+
+ADDENDUM: How to use this License for your documents
+====================================================
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and license
+notices just after the title page:
+
+ Copyright (C) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.3
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+ Texts. A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
+
+ If you have Invariant Sections, Front-Cover Texts and Back-Cover
+Texts, replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with
+ the Front-Cover Texts being LIST, and with the Back-Cover Texts
+ being LIST.
+
+ If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+ If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License, to
+permit their use in free software.
+
+
+File: as.info, Node: AS Index, Prev: GNU Free Documentation License, Up: Top
+
+AS Index
+********
+
+
+* Menu:
+
+* #: Comments. (line 39)
+* #APP: Preprocessing. (line 27)
+* #NO_APP: Preprocessing. (line 27)
+* $ in symbol names <1>: D30V-Chars. (line 63)
+* $ in symbol names <2>: SH64-Chars. (line 10)
+* $ in symbol names <3>: D10V-Chars. (line 46)
+* $ in symbol names: SH-Chars. (line 10)
+* $a: ARM Mapping Symbols. (line 9)
+* $acos math builtin, TIC54X: TIC54X-Builtins. (line 10)
+* $asin math builtin, TIC54X: TIC54X-Builtins. (line 13)
+* $atan math builtin, TIC54X: TIC54X-Builtins. (line 16)
+* $atan2 math builtin, TIC54X: TIC54X-Builtins. (line 19)
+* $ceil math builtin, TIC54X: TIC54X-Builtins. (line 22)
+* $cos math builtin, TIC54X: TIC54X-Builtins. (line 28)
+* $cosh math builtin, TIC54X: TIC54X-Builtins. (line 25)
+* $cvf math builtin, TIC54X: TIC54X-Builtins. (line 31)
+* $cvi math builtin, TIC54X: TIC54X-Builtins. (line 34)
+* $d: ARM Mapping Symbols. (line 15)
+* $exp math builtin, TIC54X: TIC54X-Builtins. (line 37)
+* $fabs math builtin, TIC54X: TIC54X-Builtins. (line 40)
+* $firstch subsym builtin, TIC54X: TIC54X-Macros. (line 26)
+* $floor math builtin, TIC54X: TIC54X-Builtins. (line 43)
+* $fmod math builtin, TIC54X: TIC54X-Builtins. (line 47)
+* $int math builtin, TIC54X: TIC54X-Builtins. (line 50)
+* $iscons subsym builtin, TIC54X: TIC54X-Macros. (line 43)
+* $isdefed subsym builtin, TIC54X: TIC54X-Macros. (line 34)
+* $ismember subsym builtin, TIC54X: TIC54X-Macros. (line 38)
+* $isname subsym builtin, TIC54X: TIC54X-Macros. (line 47)
+* $isreg subsym builtin, TIC54X: TIC54X-Macros. (line 50)
+* $lastch subsym builtin, TIC54X: TIC54X-Macros. (line 30)
+* $ldexp math builtin, TIC54X: TIC54X-Builtins. (line 53)
+* $log math builtin, TIC54X: TIC54X-Builtins. (line 59)
+* $log10 math builtin, TIC54X: TIC54X-Builtins. (line 56)
+* $max math builtin, TIC54X: TIC54X-Builtins. (line 62)
+* $min math builtin, TIC54X: TIC54X-Builtins. (line 65)
+* $pow math builtin, TIC54X: TIC54X-Builtins. (line 68)
+* $round math builtin, TIC54X: TIC54X-Builtins. (line 71)
+* $sgn math builtin, TIC54X: TIC54X-Builtins. (line 74)
+* $sin math builtin, TIC54X: TIC54X-Builtins. (line 77)
+* $sinh math builtin, TIC54X: TIC54X-Builtins. (line 80)
+* $sqrt math builtin, TIC54X: TIC54X-Builtins. (line 83)
+* $structacc subsym builtin, TIC54X: TIC54X-Macros. (line 57)
+* $structsz subsym builtin, TIC54X: TIC54X-Macros. (line 54)
+* $symcmp subsym builtin, TIC54X: TIC54X-Macros. (line 23)
+* $symlen subsym builtin, TIC54X: TIC54X-Macros. (line 20)
+* $t: ARM Mapping Symbols. (line 12)
+* $tan math builtin, TIC54X: TIC54X-Builtins. (line 86)
+* $tanh math builtin, TIC54X: TIC54X-Builtins. (line 89)
+* $trunc math builtin, TIC54X: TIC54X-Builtins. (line 92)
+* -+ option, VAX/VMS: VAX-Opts. (line 71)
+* --: Command Line. (line 10)
+* --32 option, i386: i386-Options. (line 8)
+* --32 option, x86-64: i386-Options. (line 8)
+* --64 option, i386: i386-Options. (line 8)
+* --64 option, x86-64: i386-Options. (line 8)
+* --absolute-literals: Xtensa Options. (line 23)
+* --allow-reg-prefix: SH Options. (line 9)
+* --alternate: alternate. (line 6)
+* --base-size-default-16: M68K-Opts. (line 71)
+* --base-size-default-32: M68K-Opts. (line 71)
+* --big: SH Options. (line 9)
+* --bitwise-or option, M680x0: M68K-Opts. (line 64)
+* --disp-size-default-16: M68K-Opts. (line 80)
+* --disp-size-default-32: M68K-Opts. (line 80)
+* --divide option, i386: i386-Options. (line 24)
+* --dsp: SH Options. (line 9)
+* --emulation=crisaout command line option, CRIS: CRIS-Opts. (line 9)
+* --emulation=criself command line option, CRIS: CRIS-Opts. (line 9)
+* --enforce-aligned-data: Sparc-Aligned-Data. (line 11)
+* --fatal-warnings: W. (line 16)
+* --fix-v4bx command line option, ARM: ARM Options. (line 143)
+* --fixed-special-register-names command line option, MMIX: MMIX-Opts.
+ (line 8)
+* --force-long-branches: M68HC11-Opts. (line 69)
+* --generate-example: M68HC11-Opts. (line 86)
+* --globalize-symbols command line option, MMIX: MMIX-Opts. (line 12)
+* --gnu-syntax command line option, MMIX: MMIX-Opts. (line 16)
+* --hash-size=NUMBER: Overview. (line 326)
+* --linker-allocated-gregs command line option, MMIX: MMIX-Opts.
+ (line 67)
+* --listing-cont-lines: listing. (line 34)
+* --listing-lhs-width: listing. (line 16)
+* --listing-lhs-width2: listing. (line 21)
+* --listing-rhs-width: listing. (line 28)
+* --little: SH Options. (line 9)
+* --longcalls: Xtensa Options. (line 37)
+* --march=ARCHITECTURE command line option, CRIS: CRIS-Opts. (line 33)
+* --MD: MD. (line 6)
+* --mul-bug-abort command line option, CRIS: CRIS-Opts. (line 61)
+* --no-absolute-literals: Xtensa Options. (line 23)
+* --no-expand command line option, MMIX: MMIX-Opts. (line 31)
+* --no-longcalls: Xtensa Options. (line 37)
+* --no-merge-gregs command line option, MMIX: MMIX-Opts. (line 36)
+* --no-mul-bug-abort command line option, CRIS: CRIS-Opts. (line 61)
+* --no-predefined-syms command line option, MMIX: MMIX-Opts. (line 22)
+* --no-pushj-stubs command line option, MMIX: MMIX-Opts. (line 54)
+* --no-stubs command line option, MMIX: MMIX-Opts. (line 54)
+* --no-target-align: Xtensa Options. (line 30)
+* --no-text-section-literals: Xtensa Options. (line 9)
+* --no-transform: Xtensa Options. (line 46)
+* --no-underscore command line option, CRIS: CRIS-Opts. (line 15)
+* --no-warn: W. (line 11)
+* --pcrel: M68K-Opts. (line 92)
+* --pic command line option, CRIS: CRIS-Opts. (line 27)
+* --print-insn-syntax: M68HC11-Opts. (line 75)
+* --print-opcodes: M68HC11-Opts. (line 79)
+* --register-prefix-optional option, M680x0: M68K-Opts. (line 51)
+* --relax: SH Options. (line 9)
+* --relax command line option, MMIX: MMIX-Opts. (line 19)
+* --rename-section: Xtensa Options. (line 54)
+* --renesas: SH Options. (line 9)
+* --short-branches: M68HC11-Opts. (line 54)
+* --small: SH Options. (line 9)
+* --statistics: statistics. (line 6)
+* --strict-direct-mode: M68HC11-Opts. (line 44)
+* --target-align: Xtensa Options. (line 30)
+* --text-section-literals: Xtensa Options. (line 9)
+* --traditional-format: traditional-format. (line 6)
+* --transform: Xtensa Options. (line 46)
+* --underscore command line option, CRIS: CRIS-Opts. (line 15)
+* --warn: W. (line 19)
+* -1 option, VAX/VMS: VAX-Opts. (line 77)
+* -32addr command line option, Alpha: Alpha Options. (line 58)
+* -a: a. (line 6)
+* -A options, i960: Options-i960. (line 6)
+* -ac: a. (line 6)
+* -ad: a. (line 6)
+* -ag: a. (line 6)
+* -ah: a. (line 6)
+* -al: a. (line 6)
+* -an: a. (line 6)
+* -as: a. (line 6)
+* -Asparclet: Sparc-Opts. (line 25)
+* -Asparclite: Sparc-Opts. (line 25)
+* -Av6: Sparc-Opts. (line 25)
+* -Av8: Sparc-Opts. (line 25)
+* -Av9: Sparc-Opts. (line 25)
+* -Av9a: Sparc-Opts. (line 25)
+* -b option, i960: Options-i960. (line 22)
+* -big option, M32R: M32R-Opts. (line 35)
+* -D: D. (line 6)
+* -D, ignored on VAX: VAX-Opts. (line 11)
+* -d, VAX option: VAX-Opts. (line 16)
+* -eabi= command line option, ARM: ARM Options. (line 126)
+* -EB command line option, ARC: ARC Options. (line 31)
+* -EB command line option, ARM: ARM Options. (line 131)
+* -EB option (MIPS): MIPS Opts. (line 13)
+* -EB option, M32R: M32R-Opts. (line 39)
+* -EL command line option, ARC: ARC Options. (line 35)
+* -EL command line option, ARM: ARM Options. (line 135)
+* -EL option (MIPS): MIPS Opts. (line 13)
+* -EL option, M32R: M32R-Opts. (line 32)
+* -f: f. (line 6)
+* -F command line option, Alpha: Alpha Options. (line 58)
+* -G command line option, Alpha: Alpha Options. (line 54)
+* -g command line option, Alpha: Alpha Options. (line 48)
+* -G option (MIPS): MIPS Opts. (line 8)
+* -H option, VAX/VMS: VAX-Opts. (line 81)
+* -h option, VAX/VMS: VAX-Opts. (line 45)
+* -I PATH: I. (line 6)
+* -ignore-parallel-conflicts option, M32RX: M32R-Opts. (line 87)
+* -Ip option, M32RX: M32R-Opts. (line 97)
+* -J, ignored on VAX: VAX-Opts. (line 27)
+* -K: K. (line 6)
+* -k command line option, ARM: ARM Options. (line 139)
+* -KPIC option, M32R: M32R-Opts. (line 42)
+* -KPIC option, MIPS: MIPS Opts. (line 21)
+* -L: L. (line 6)
+* -l option, M680x0: M68K-Opts. (line 39)
+* -little option, M32R: M32R-Opts. (line 27)
+* -M: M. (line 6)
+* -m11/03: PDP-11-Options. (line 140)
+* -m11/04: PDP-11-Options. (line 143)
+* -m11/05: PDP-11-Options. (line 146)
+* -m11/10: PDP-11-Options. (line 146)
+* -m11/15: PDP-11-Options. (line 149)
+* -m11/20: PDP-11-Options. (line 149)
+* -m11/21: PDP-11-Options. (line 152)
+* -m11/23: PDP-11-Options. (line 155)
+* -m11/24: PDP-11-Options. (line 155)
+* -m11/34: PDP-11-Options. (line 158)
+* -m11/34a: PDP-11-Options. (line 161)
+* -m11/35: PDP-11-Options. (line 164)
+* -m11/40: PDP-11-Options. (line 164)
+* -m11/44: PDP-11-Options. (line 167)
+* -m11/45: PDP-11-Options. (line 170)
+* -m11/50: PDP-11-Options. (line 170)
+* -m11/53: PDP-11-Options. (line 173)
+* -m11/55: PDP-11-Options. (line 170)
+* -m11/60: PDP-11-Options. (line 176)
+* -m11/70: PDP-11-Options. (line 170)
+* -m11/73: PDP-11-Options. (line 173)
+* -m11/83: PDP-11-Options. (line 173)
+* -m11/84: PDP-11-Options. (line 173)
+* -m11/93: PDP-11-Options. (line 173)
+* -m11/94: PDP-11-Options. (line 173)
+* -m16c option, M16C: M32C-Opts. (line 12)
+* -m31 option, s390: s390 Options. (line 8)
+* -m32c option, M32C: M32C-Opts. (line 9)
+* -m32r option, M32R: M32R-Opts. (line 21)
+* -m32rx option, M32R2: M32R-Opts. (line 17)
+* -m32rx option, M32RX: M32R-Opts. (line 9)
+* -m64 option, s390: s390 Options. (line 8)
+* -m68000 and related options: M68K-Opts. (line 104)
+* -m68hc11: M68HC11-Opts. (line 9)
+* -m68hc12: M68HC11-Opts. (line 14)
+* -m68hcs12: M68HC11-Opts. (line 21)
+* -m[no-]68851 command line option, M680x0: M68K-Opts. (line 21)
+* -m[no-]68881 command line option, M680x0: M68K-Opts. (line 21)
+* -m[no-]div command line option, M680x0: M68K-Opts. (line 21)
+* -m[no-]emac command line option, M680x0: M68K-Opts. (line 21)
+* -m[no-]float command line option, M680x0: M68K-Opts. (line 21)
+* -m[no-]mac command line option, M680x0: M68K-Opts. (line 21)
+* -m[no-]usp command line option, M680x0: M68K-Opts. (line 21)
+* -mall: PDP-11-Options. (line 26)
+* -mall-enabled command line option, LM32: LM32 Options. (line 30)
+* -mall-extensions: PDP-11-Options. (line 26)
+* -mall-opcodes command line option, AVR: AVR Options. (line 62)
+* -mapcs command line option, ARM: ARM Options. (line 99)
+* -mapcs-float command line option, ARM: ARM Options. (line 112)
+* -mapcs-reentrant command line option, ARM: ARM Options. (line 117)
+* -marc[5|6|7|8] command line option, ARC: ARC Options. (line 6)
+* -march= command line option, ARM: ARM Options. (line 40)
+* -march= command line option, M680x0: M68K-Opts. (line 8)
+* -march= option, i386: i386-Options. (line 31)
+* -march= option, s390: s390 Options. (line 25)
+* -march= option, x86-64: i386-Options. (line 31)
+* -matpcs command line option, ARM: ARM Options. (line 104)
+* -mbarrel-shift-enabled command line option, LM32: LM32 Options.
+ (line 12)
+* -mbreak-enabled command line option, LM32: LM32 Options. (line 27)
+* -mcis: PDP-11-Options. (line 32)
+* -mconstant-gp command line option, IA-64: IA-64 Options. (line 6)
+* -mCPU command line option, Alpha: Alpha Options. (line 6)
+* -mcpu option, cpu: TIC54X-Opts. (line 15)
+* -mcpu= command line option, ARM: ARM Options. (line 6)
+* -mcpu= command line option, Blackfin: Blackfin Options. (line 6)
+* -mcpu= command line option, M680x0: M68K-Opts. (line 14)
+* -mcsm: PDP-11-Options. (line 43)
+* -mdcache-enabled command line option, LM32: LM32 Options. (line 24)
+* -mdebug command line option, Alpha: Alpha Options. (line 25)
+* -mdivide-enabled command line option, LM32: LM32 Options. (line 9)
+* -me option, stderr redirect: TIC54X-Opts. (line 20)
+* -meis: PDP-11-Options. (line 46)
+* -merrors-to-file option, stderr redirect: TIC54X-Opts. (line 20)
+* -mesa option, s390: s390 Options. (line 17)
+* -mf option, far-mode: TIC54X-Opts. (line 8)
+* -mf11: PDP-11-Options. (line 122)
+* -mfar-mode option, far-mode: TIC54X-Opts. (line 8)
+* -mfis: PDP-11-Options. (line 51)
+* -mfloat-abi= command line option, ARM: ARM Options. (line 121)
+* -mfp-11: PDP-11-Options. (line 56)
+* -mfpp: PDP-11-Options. (line 56)
+* -mfpu: PDP-11-Options. (line 56)
+* -mfpu= command line option, ARM: ARM Options. (line 55)
+* -micache-enabled command line option, LM32: LM32 Options. (line 21)
+* -mimplicit-it command line option, ARM: ARM Options. (line 83)
+* -mip2022 option, IP2K: IP2K-Opts. (line 14)
+* -mip2022ext option, IP2022: IP2K-Opts. (line 9)
+* -mj11: PDP-11-Options. (line 126)
+* -mka11: PDP-11-Options. (line 92)
+* -mkb11: PDP-11-Options. (line 95)
+* -mkd11a: PDP-11-Options. (line 98)
+* -mkd11b: PDP-11-Options. (line 101)
+* -mkd11d: PDP-11-Options. (line 104)
+* -mkd11e: PDP-11-Options. (line 107)
+* -mkd11f: PDP-11-Options. (line 110)
+* -mkd11h: PDP-11-Options. (line 110)
+* -mkd11k: PDP-11-Options. (line 114)
+* -mkd11q: PDP-11-Options. (line 110)
+* -mkd11z: PDP-11-Options. (line 118)
+* -mkev11: PDP-11-Options. (line 51)
+* -mlimited-eis: PDP-11-Options. (line 64)
+* -mlong: M68HC11-Opts. (line 32)
+* -mlong-double: M68HC11-Opts. (line 40)
+* -mmcu= command line option, AVR: AVR Options. (line 6)
+* -mmfpt: PDP-11-Options. (line 70)
+* -mmicrocode: PDP-11-Options. (line 83)
+* -mmnemonic= option, i386: i386-Options. (line 80)
+* -mmnemonic= option, x86-64: i386-Options. (line 80)
+* -mmultiply-enabled command line option, LM32: LM32 Options. (line 6)
+* -mmutiproc: PDP-11-Options. (line 73)
+* -mmxps: PDP-11-Options. (line 77)
+* -mnaked-reg option, i386: i386-Options. (line 94)
+* -mnaked-reg option, x86-64: i386-Options. (line 94)
+* -mno-cis: PDP-11-Options. (line 32)
+* -mno-csm: PDP-11-Options. (line 43)
+* -mno-eis: PDP-11-Options. (line 46)
+* -mno-extensions: PDP-11-Options. (line 29)
+* -mno-fis: PDP-11-Options. (line 51)
+* -mno-fp-11: PDP-11-Options. (line 56)
+* -mno-fpp: PDP-11-Options. (line 56)
+* -mno-fpu: PDP-11-Options. (line 56)
+* -mno-kev11: PDP-11-Options. (line 51)
+* -mno-limited-eis: PDP-11-Options. (line 64)
+* -mno-mfpt: PDP-11-Options. (line 70)
+* -mno-microcode: PDP-11-Options. (line 83)
+* -mno-mutiproc: PDP-11-Options. (line 73)
+* -mno-mxps: PDP-11-Options. (line 77)
+* -mno-pic: PDP-11-Options. (line 11)
+* -mno-regnames option, s390: s390 Options. (line 35)
+* -mno-skip-bug command line option, AVR: AVR Options. (line 65)
+* -mno-spl: PDP-11-Options. (line 80)
+* -mno-sym32: MIPS Opts. (line 189)
+* -mno-wrap command line option, AVR: AVR Options. (line 68)
+* -mpic: PDP-11-Options. (line 11)
+* -mregnames option, s390: s390 Options. (line 32)
+* -mrelax command line option, V850: V850 Options. (line 51)
+* -mshort: M68HC11-Opts. (line 27)
+* -mshort-double: M68HC11-Opts. (line 36)
+* -msign-extend-enabled command line option, LM32: LM32 Options.
+ (line 15)
+* -mspl: PDP-11-Options. (line 80)
+* -msse-check= option, i386: i386-Options. (line 68)
+* -msse-check= option, x86-64: i386-Options. (line 68)
+* -msse2avx option, i386: i386-Options. (line 64)
+* -msse2avx option, x86-64: i386-Options. (line 64)
+* -msym32: MIPS Opts. (line 189)
+* -msyntax= option, i386: i386-Options. (line 87)
+* -msyntax= option, x86-64: i386-Options. (line 87)
+* -mt11: PDP-11-Options. (line 130)
+* -mthumb command line option, ARM: ARM Options. (line 74)
+* -mthumb-interwork command line option, ARM: ARM Options. (line 79)
+* -mtune= option, i386: i386-Options. (line 56)
+* -mtune= option, x86-64: i386-Options. (line 56)
+* -muser-enabled command line option, LM32: LM32 Options. (line 18)
+* -mv850 command line option, V850: V850 Options. (line 23)
+* -mv850any command line option, V850: V850 Options. (line 41)
+* -mv850e command line option, V850: V850 Options. (line 29)
+* -mv850e1 command line option, V850: V850 Options. (line 35)
+* -mvxworks-pic option, MIPS: MIPS Opts. (line 26)
+* -mwarn-areg-zero option, s390: s390 Options. (line 38)
+* -mwarn-deprecated command line option, ARM: ARM Options. (line 147)
+* -mzarch option, s390: s390 Options. (line 17)
+* -N command line option, CRIS: CRIS-Opts. (line 57)
+* -nIp option, M32RX: M32R-Opts. (line 101)
+* -no-bitinst, M32R2: M32R-Opts. (line 54)
+* -no-ignore-parallel-conflicts option, M32RX: M32R-Opts. (line 93)
+* -no-mdebug command line option, Alpha: Alpha Options. (line 25)
+* -no-parallel option, M32RX: M32R-Opts. (line 51)
+* -no-relax option, i960: Options-i960. (line 66)
+* -no-warn-explicit-parallel-conflicts option, M32RX: M32R-Opts.
+ (line 79)
+* -no-warn-unmatched-high option, M32R: M32R-Opts. (line 111)
+* -nocpp ignored (MIPS): MIPS Opts. (line 192)
+* -noreplace command line option, Alpha: Alpha Options. (line 40)
+* -o: o. (line 6)
+* -O option, M32RX: M32R-Opts. (line 59)
+* -parallel option, M32RX: M32R-Opts. (line 46)
+* -R: R. (line 6)
+* -r800 command line option, Z80: Z80 Options. (line 41)
+* -relax command line option, Alpha: Alpha Options. (line 32)
+* -replace command line option, Alpha: Alpha Options. (line 40)
+* -S, ignored on VAX: VAX-Opts. (line 11)
+* -t, ignored on VAX: VAX-Opts. (line 36)
+* -T, ignored on VAX: VAX-Opts. (line 11)
+* -v: v. (line 6)
+* -V, redundant on VAX: VAX-Opts. (line 22)
+* -version: v. (line 6)
+* -W: W. (line 11)
+* -warn-explicit-parallel-conflicts option, M32RX: M32R-Opts. (line 65)
+* -warn-unmatched-high option, M32R: M32R-Opts. (line 105)
+* -Wnp option, M32RX: M32R-Opts. (line 83)
+* -Wnuh option, M32RX: M32R-Opts. (line 117)
+* -Wp option, M32RX: M32R-Opts. (line 75)
+* -wsigned_overflow command line option, V850: V850 Options. (line 9)
+* -Wuh option, M32RX: M32R-Opts. (line 114)
+* -wunsigned_overflow command line option, V850: V850 Options.
+ (line 16)
+* -x command line option, MMIX: MMIX-Opts. (line 44)
+* -z80 command line option, Z80: Z80 Options. (line 8)
+* -z8001 command line option, Z8000: Z8000 Options. (line 6)
+* -z8002 command line option, Z8000: Z8000 Options. (line 9)
+* . (symbol): Dot. (line 6)
+* .2byte directive, ARM: ARM Directives. (line 6)
+* .4byte directive, ARM: ARM Directives. (line 6)
+* .8byte directive, ARM: ARM Directives. (line 6)
+* .align directive, ARM: ARM Directives. (line 11)
+* .arch directive, ARM: ARM Directives. (line 18)
+* .arm directive, ARM: ARM Directives. (line 22)
+* .big directive, M32RX: M32R-Directives. (line 88)
+* .bss directive, ARM: ARM Directives. (line 30)
+* .cantunwind directive, ARM: ARM Directives. (line 33)
+* .code directive, ARM: ARM Directives. (line 37)
+* .cpu directive, ARM: ARM Directives. (line 41)
+* .dn and .qn directives, ARM: ARM Directives. (line 45)
+* .eabi_attribute directive, ARM: ARM Directives. (line 69)
+* .even directive, ARM: ARM Directives. (line 93)
+* .extend directive, ARM: ARM Directives. (line 96)
+* .fnend directive, ARM: ARM Directives. (line 102)
+* .fnstart directive, ARM: ARM Directives. (line 111)
+* .force_thumb directive, ARM: ARM Directives. (line 114)
+* .fpu directive, ARM: ARM Directives. (line 118)
+* .global: MIPS insn. (line 12)
+* .handlerdata directive, ARM: ARM Directives. (line 122)
+* .insn: MIPS insn. (line 6)
+* .insn directive, s390: s390 Directives. (line 11)
+* .inst directive, ARM: ARM Directives. (line 131)
+* .ldouble directive, ARM: ARM Directives. (line 96)
+* .little directive, M32RX: M32R-Directives. (line 82)
+* .long directive, s390: s390 Directives. (line 16)
+* .ltorg directive, ARM: ARM Directives. (line 143)
+* .ltorg directive, s390: s390 Directives. (line 88)
+* .m32r directive, M32R: M32R-Directives. (line 66)
+* .m32r2 directive, M32R2: M32R-Directives. (line 77)
+* .m32rx directive, M32RX: M32R-Directives. (line 72)
+* .movsp directive, ARM: ARM Directives. (line 157)
+* .o: Object. (line 6)
+* .object_arch directive, ARM: ARM Directives. (line 162)
+* .packed directive, ARM: ARM Directives. (line 168)
+* .pad directive, ARM: ARM Directives. (line 25)
+* .param on HPPA: HPPA Directives. (line 19)
+* .personality directive, ARM: ARM Directives. (line 178)
+* .personalityindex directive, ARM: ARM Directives. (line 181)
+* .pool directive, ARM: ARM Directives. (line 185)
+* .quad directive, s390: s390 Directives. (line 16)
+* .req directive, ARM: ARM Directives. (line 188)
+* .save directive, ARM: ARM Directives. (line 193)
+* .secrel32 directive, ARM: ARM Directives. (line 231)
+* .set arch=CPU: MIPS ISA. (line 18)
+* .set autoextend: MIPS autoextend. (line 6)
+* .set doublefloat: MIPS floating-point. (line 12)
+* .set dsp: MIPS ASE instruction generation overrides.
+ (line 21)
+* .set dspr2: MIPS ASE instruction generation overrides.
+ (line 26)
+* .set hardfloat: MIPS floating-point. (line 6)
+* .set mdmx: MIPS ASE instruction generation overrides.
+ (line 16)
+* .set mips3d: MIPS ASE instruction generation overrides.
+ (line 6)
+* .set mipsN: MIPS ISA. (line 6)
+* .set mt: MIPS ASE instruction generation overrides.
+ (line 32)
+* .set noautoextend: MIPS autoextend. (line 6)
+* .set nodsp: MIPS ASE instruction generation overrides.
+ (line 21)
+* .set nodspr2: MIPS ASE instruction generation overrides.
+ (line 26)
+* .set nomdmx: MIPS ASE instruction generation overrides.
+ (line 16)
+* .set nomips3d: MIPS ASE instruction generation overrides.
+ (line 6)
+* .set nomt: MIPS ASE instruction generation overrides.
+ (line 32)
+* .set nosmartmips: MIPS ASE instruction generation overrides.
+ (line 11)
+* .set nosym32: MIPS symbol sizes. (line 6)
+* .set pop: MIPS option stack. (line 6)
+* .set push: MIPS option stack. (line 6)
+* .set singlefloat: MIPS floating-point. (line 12)
+* .set smartmips: MIPS ASE instruction generation overrides.
+ (line 11)
+* .set softfloat: MIPS floating-point. (line 6)
+* .set sym32: MIPS symbol sizes. (line 6)
+* .setfp directive, ARM: ARM Directives. (line 217)
+* .short directive, s390: s390 Directives. (line 16)
+* .syntax directive, ARM: ARM Directives. (line 236)
+* .thumb directive, ARM: ARM Directives. (line 240)
+* .thumb_func directive, ARM: ARM Directives. (line 243)
+* .thumb_set directive, ARM: ARM Directives. (line 254)
+* .unreq directive, ARM: ARM Directives. (line 261)
+* .unwind_raw directive, ARM: ARM Directives. (line 272)
+* .v850 directive, V850: V850 Directives. (line 14)
+* .v850e directive, V850: V850 Directives. (line 20)
+* .v850e1 directive, V850: V850 Directives. (line 26)
+* .vsave directive, ARM: ARM Directives. (line 279)
+* .z8001: Z8000 Directives. (line 11)
+* .z8002: Z8000 Directives. (line 15)
+* 16-bit code, i386: i386-16bit. (line 6)
+* 2byte directive, ARC: ARC Directives. (line 9)
+* 3byte directive, ARC: ARC Directives. (line 12)
+* 3DNow!, i386: i386-SIMD. (line 6)
+* 3DNow!, x86-64: i386-SIMD. (line 6)
+* 430 support: MSP430-Dependent. (line 6)
+* 4byte directive, ARC: ARC Directives. (line 15)
+* : (label): Statements. (line 30)
+* @word modifier, D10V: D10V-Word. (line 6)
+* \" (doublequote character): Strings. (line 43)
+* \\ (\ character): Strings. (line 40)
+* \b (backspace character): Strings. (line 15)
+* \DDD (octal character code): Strings. (line 30)
+* \f (formfeed character): Strings. (line 18)
+* \n (newline character): Strings. (line 21)
+* \r (carriage return character): Strings. (line 24)
+* \t (tab): Strings. (line 27)
+* \XD... (hex character code): Strings. (line 36)
+* _ opcode prefix: Xtensa Opcodes. (line 9)
+* a.out: Object. (line 6)
+* a.out symbol attributes: a.out Symbols. (line 6)
+* A_DIR environment variable, TIC54X: TIC54X-Env. (line 6)
+* ABI options, SH64: SH64 Options. (line 29)
+* abort directive: Abort. (line 6)
+* ABORT directive: ABORT (COFF). (line 6)
+* absolute section: Ld Sections. (line 29)
+* absolute-literals directive: Absolute Literals Directive.
+ (line 6)
+* ADDI instructions, relaxation: Xtensa Immediate Relaxation.
+ (line 43)
+* addition, permitted arguments: Infix Ops. (line 44)
+* addresses: Expressions. (line 6)
+* addresses, format of: Secs Background. (line 68)
+* addressing modes, D10V: D10V-Addressing. (line 6)
+* addressing modes, D30V: D30V-Addressing. (line 6)
+* addressing modes, H8/300: H8/300-Addressing. (line 6)
+* addressing modes, M680x0: M68K-Syntax. (line 21)
+* addressing modes, M68HC11: M68HC11-Syntax. (line 17)
+* addressing modes, SH: SH-Addressing. (line 6)
+* addressing modes, SH64: SH64-Addressing. (line 6)
+* addressing modes, Z8000: Z8000-Addressing. (line 6)
+* ADR reg,<label> pseudo op, ARM: ARM Opcodes. (line 25)
+* ADRL reg,<label> pseudo op, ARM: ARM Opcodes. (line 35)
+* advancing location counter: Org. (line 6)
+* align directive: Align. (line 6)
+* align directive, SPARC: Sparc-Directives. (line 9)
+* align directive, TIC54X: TIC54X-Directives. (line 6)
+* alignment of branch targets: Xtensa Automatic Alignment.
+ (line 6)
+* alignment of LOOP instructions: Xtensa Automatic Alignment.
+ (line 6)
+* Alpha floating point (IEEE): Alpha Floating Point.
+ (line 6)
+* Alpha line comment character: Alpha-Chars. (line 6)
+* Alpha line separator: Alpha-Chars. (line 8)
+* Alpha notes: Alpha Notes. (line 6)
+* Alpha options: Alpha Options. (line 6)
+* Alpha registers: Alpha-Regs. (line 6)
+* Alpha relocations: Alpha-Relocs. (line 6)
+* Alpha support: Alpha-Dependent. (line 6)
+* Alpha Syntax: Alpha Options. (line 62)
+* Alpha-only directives: Alpha Directives. (line 10)
+* altered difference tables: Word. (line 12)
+* alternate syntax for the 680x0: M68K-Moto-Syntax. (line 6)
+* ARC floating point (IEEE): ARC Floating Point. (line 6)
+* ARC machine directives: ARC Directives. (line 6)
+* ARC opcodes: ARC Opcodes. (line 6)
+* ARC options (none): ARC Options. (line 6)
+* ARC register names: ARC-Regs. (line 6)
+* ARC special characters: ARC-Chars. (line 6)
+* ARC support: ARC-Dependent. (line 6)
+* arc5 arc5, ARC: ARC Options. (line 10)
+* arc6 arc6, ARC: ARC Options. (line 13)
+* arc7 arc7, ARC: ARC Options. (line 21)
+* arc8 arc8, ARC: ARC Options. (line 24)
+* arch directive, i386: i386-Arch. (line 6)
+* arch directive, M680x0: M68K-Directives. (line 22)
+* arch directive, x86-64: i386-Arch. (line 6)
+* architecture options, i960: Options-i960. (line 6)
+* architecture options, IP2022: IP2K-Opts. (line 9)
+* architecture options, IP2K: IP2K-Opts. (line 14)
+* architecture options, M16C: M32C-Opts. (line 12)
+* architecture options, M32C: M32C-Opts. (line 9)
+* architecture options, M32R: M32R-Opts. (line 21)
+* architecture options, M32R2: M32R-Opts. (line 17)
+* architecture options, M32RX: M32R-Opts. (line 9)
+* architecture options, M680x0: M68K-Opts. (line 104)
+* Architecture variant option, CRIS: CRIS-Opts. (line 33)
+* architectures, PowerPC: PowerPC-Opts. (line 6)
+* architectures, SCORE: SCORE-Opts. (line 6)
+* architectures, SPARC: Sparc-Opts. (line 6)
+* arguments for addition: Infix Ops. (line 44)
+* arguments for subtraction: Infix Ops. (line 49)
+* arguments in expressions: Arguments. (line 6)
+* arithmetic functions: Operators. (line 6)
+* arithmetic operands: Arguments. (line 6)
+* ARM data relocations: ARM-Relocations. (line 6)
+* ARM floating point (IEEE): ARM Floating Point. (line 6)
+* ARM identifiers: ARM-Chars. (line 15)
+* ARM immediate character: ARM-Chars. (line 13)
+* ARM line comment character: ARM-Chars. (line 6)
+* ARM line separator: ARM-Chars. (line 10)
+* ARM machine directives: ARM Directives. (line 6)
+* ARM opcodes: ARM Opcodes. (line 6)
+* ARM options (none): ARM Options. (line 6)
+* ARM register names: ARM-Regs. (line 6)
+* ARM support: ARM-Dependent. (line 6)
+* ascii directive: Ascii. (line 6)
+* asciz directive: Asciz. (line 6)
+* asg directive, TIC54X: TIC54X-Directives. (line 20)
+* assembler bugs, reporting: Bug Reporting. (line 6)
+* assembler crash: Bug Criteria. (line 9)
+* assembler directive .arch, CRIS: CRIS-Pseudos. (line 45)
+* assembler directive .dword, CRIS: CRIS-Pseudos. (line 12)
+* assembler directive .far, M68HC11: M68HC11-Directives. (line 20)
+* assembler directive .interrupt, M68HC11: M68HC11-Directives.
+ (line 26)
+* assembler directive .mode, M68HC11: M68HC11-Directives. (line 16)
+* assembler directive .relax, M68HC11: M68HC11-Directives. (line 10)
+* assembler directive .syntax, CRIS: CRIS-Pseudos. (line 17)
+* assembler directive .xrefb, M68HC11: M68HC11-Directives. (line 31)
+* assembler directive BSPEC, MMIX: MMIX-Pseudos. (line 131)
+* assembler directive BYTE, MMIX: MMIX-Pseudos. (line 97)
+* assembler directive ESPEC, MMIX: MMIX-Pseudos. (line 131)
+* assembler directive GREG, MMIX: MMIX-Pseudos. (line 50)
+* assembler directive IS, MMIX: MMIX-Pseudos. (line 42)
+* assembler directive LOC, MMIX: MMIX-Pseudos. (line 7)
+* assembler directive LOCAL, MMIX: MMIX-Pseudos. (line 28)
+* assembler directive OCTA, MMIX: MMIX-Pseudos. (line 108)
+* assembler directive PREFIX, MMIX: MMIX-Pseudos. (line 120)
+* assembler directive TETRA, MMIX: MMIX-Pseudos. (line 108)
+* assembler directive WYDE, MMIX: MMIX-Pseudos. (line 108)
+* assembler directives, CRIS: CRIS-Pseudos. (line 6)
+* assembler directives, M68HC11: M68HC11-Directives. (line 6)
+* assembler directives, M68HC12: M68HC11-Directives. (line 6)
+* assembler directives, MMIX: MMIX-Pseudos. (line 6)
+* assembler internal logic error: As Sections. (line 13)
+* assembler version: v. (line 6)
+* assembler, and linker: Secs Background. (line 10)
+* assembly listings, enabling: a. (line 6)
+* assigning values to symbols <1>: Setting Symbols. (line 6)
+* assigning values to symbols: Equ. (line 6)
+* atmp directive, i860: Directives-i860. (line 16)
+* att_syntax pseudo op, i386: i386-Syntax. (line 6)
+* att_syntax pseudo op, x86-64: i386-Syntax. (line 6)
+* attributes, symbol: Symbol Attributes. (line 6)
+* auxiliary attributes, COFF symbols: COFF Symbols. (line 19)
+* auxiliary symbol information, COFF: Dim. (line 6)
+* Av7: Sparc-Opts. (line 25)
+* AVR line comment character: AVR-Chars. (line 6)
+* AVR line separator: AVR-Chars. (line 10)
+* AVR modifiers: AVR-Modifiers. (line 6)
+* AVR opcode summary: AVR Opcodes. (line 6)
+* AVR options (none): AVR Options. (line 6)
+* AVR register names: AVR-Regs. (line 6)
+* AVR support: AVR-Dependent. (line 6)
+* backslash (\\): Strings. (line 40)
+* backspace (\b): Strings. (line 15)
+* balign directive: Balign. (line 6)
+* balignl directive: Balign. (line 27)
+* balignw directive: Balign. (line 27)
+* bes directive, TIC54X: TIC54X-Directives. (line 197)
+* big endian output, MIPS: Overview. (line 641)
+* big endian output, PJ: Overview. (line 548)
+* big-endian output, MIPS: MIPS Opts. (line 13)
+* bignums: Bignums. (line 6)
+* binary constants, TIC54X: TIC54X-Constants. (line 8)
+* binary files, including: Incbin. (line 6)
+* binary integers: Integers. (line 6)
+* bit names, IA-64: IA-64-Bits. (line 6)
+* bitfields, not supported on VAX: VAX-no. (line 6)
+* Blackfin directives: Blackfin Directives. (line 6)
+* Blackfin options (none): Blackfin Options. (line 6)
+* Blackfin support: Blackfin-Dependent. (line 6)
+* Blackfin syntax: Blackfin Syntax. (line 6)
+* block: Z8000 Directives. (line 55)
+* branch improvement, M680x0: M68K-Branch. (line 6)
+* branch improvement, M68HC11: M68HC11-Branch. (line 6)
+* branch improvement, VAX: VAX-branch. (line 6)
+* branch instructions, relaxation: Xtensa Branch Relaxation.
+ (line 6)
+* branch recording, i960: Options-i960. (line 22)
+* branch statistics table, i960: Options-i960. (line 40)
+* branch target alignment: Xtensa Automatic Alignment.
+ (line 6)
+* break directive, TIC54X: TIC54X-Directives. (line 143)
+* BSD syntax: PDP-11-Syntax. (line 6)
+* bss directive, i960: Directives-i960. (line 6)
+* bss directive, TIC54X: TIC54X-Directives. (line 29)
+* bss section <1>: bss. (line 6)
+* bss section: Ld Sections. (line 20)
+* bug criteria: Bug Criteria. (line 6)
+* bug reports: Bug Reporting. (line 6)
+* bugs in assembler: Reporting Bugs. (line 6)
+* Built-in symbols, CRIS: CRIS-Symbols. (line 6)
+* builtin math functions, TIC54X: TIC54X-Builtins. (line 6)
+* builtin subsym functions, TIC54X: TIC54X-Macros. (line 16)
+* bus lock prefixes, i386: i386-Prefixes. (line 36)
+* bval: Z8000 Directives. (line 30)
+* byte directive: Byte. (line 6)
+* byte directive, TIC54X: TIC54X-Directives. (line 36)
+* C54XDSP_DIR environment variable, TIC54X: TIC54X-Env. (line 6)
+* c_mode directive, TIC54X: TIC54X-Directives. (line 51)
+* call instructions, i386: i386-Mnemonics. (line 55)
+* call instructions, relaxation: Xtensa Call Relaxation.
+ (line 6)
+* call instructions, x86-64: i386-Mnemonics. (line 55)
+* callj, i960 pseudo-opcode: callj-i960. (line 6)
+* carriage return (\r): Strings. (line 24)
+* case sensitivity, Z80: Z80-Case. (line 6)
+* cfi_endproc directive: CFI directives. (line 26)
+* cfi_sections directive: CFI directives. (line 13)
+* cfi_startproc directive: CFI directives. (line 6)
+* char directive, TIC54X: TIC54X-Directives. (line 36)
+* character constant, Z80: Z80-Chars. (line 13)
+* character constants: Characters. (line 6)
+* character escape codes: Strings. (line 15)
+* character escapes, Z80: Z80-Chars. (line 11)
+* character, single: Chars. (line 6)
+* characters used in symbols: Symbol Intro. (line 6)
+* clink directive, TIC54X: TIC54X-Directives. (line 45)
+* code16 directive, i386: i386-16bit. (line 6)
+* code16gcc directive, i386: i386-16bit. (line 6)
+* code32 directive, i386: i386-16bit. (line 6)
+* code64 directive, i386: i386-16bit. (line 6)
+* code64 directive, x86-64: i386-16bit. (line 6)
+* COFF auxiliary symbol information: Dim. (line 6)
+* COFF structure debugging: Tag. (line 6)
+* COFF symbol attributes: COFF Symbols. (line 6)
+* COFF symbol descriptor: Desc. (line 6)
+* COFF symbol storage class: Scl. (line 6)
+* COFF symbol type: Type. (line 11)
+* COFF symbols, debugging: Def. (line 6)
+* COFF value attribute: Val. (line 6)
+* COMDAT: Linkonce. (line 6)
+* comm directive: Comm. (line 6)
+* command line conventions: Command Line. (line 6)
+* command line options, V850: V850 Options. (line 9)
+* command-line options ignored, VAX: VAX-Opts. (line 6)
+* comments: Comments. (line 6)
+* comments, M680x0: M68K-Chars. (line 6)
+* comments, removed by preprocessor: Preprocessing. (line 11)
+* common directive, SPARC: Sparc-Directives. (line 12)
+* common sections: Linkonce. (line 6)
+* common variable storage: bss. (line 6)
+* compare and jump expansions, i960: Compare-and-branch-i960.
+ (line 13)
+* compare/branch instructions, i960: Compare-and-branch-i960.
+ (line 6)
+* comparison expressions: Infix Ops. (line 55)
+* conditional assembly: If. (line 6)
+* constant, single character: Chars. (line 6)
+* constants: Constants. (line 6)
+* constants, bignum: Bignums. (line 6)
+* constants, character: Characters. (line 6)
+* constants, converted by preprocessor: Preprocessing. (line 14)
+* constants, floating point: Flonums. (line 6)
+* constants, integer: Integers. (line 6)
+* constants, number: Numbers. (line 6)
+* constants, Sparc: Sparc-Constants. (line 6)
+* constants, string: Strings. (line 6)
+* constants, TIC54X: TIC54X-Constants. (line 6)
+* conversion instructions, i386: i386-Mnemonics. (line 36)
+* conversion instructions, x86-64: i386-Mnemonics. (line 36)
+* coprocessor wait, i386: i386-Prefixes. (line 40)
+* copy directive, TIC54X: TIC54X-Directives. (line 54)
+* cpu directive, M680x0: M68K-Directives. (line 30)
+* CR16 Operand Qualifiers: CR16 Operand Qualifiers.
+ (line 6)
+* CR16 support: CR16-Dependent. (line 6)
+* crash of assembler: Bug Criteria. (line 9)
+* CRIS --emulation=crisaout command line option: CRIS-Opts. (line 9)
+* CRIS --emulation=criself command line option: CRIS-Opts. (line 9)
+* CRIS --march=ARCHITECTURE command line option: CRIS-Opts. (line 33)
+* CRIS --mul-bug-abort command line option: CRIS-Opts. (line 61)
+* CRIS --no-mul-bug-abort command line option: CRIS-Opts. (line 61)
+* CRIS --no-underscore command line option: CRIS-Opts. (line 15)
+* CRIS --pic command line option: CRIS-Opts. (line 27)
+* CRIS --underscore command line option: CRIS-Opts. (line 15)
+* CRIS -N command line option: CRIS-Opts. (line 57)
+* CRIS architecture variant option: CRIS-Opts. (line 33)
+* CRIS assembler directive .arch: CRIS-Pseudos. (line 45)
+* CRIS assembler directive .dword: CRIS-Pseudos. (line 12)
+* CRIS assembler directive .syntax: CRIS-Pseudos. (line 17)
+* CRIS assembler directives: CRIS-Pseudos. (line 6)
+* CRIS built-in symbols: CRIS-Symbols. (line 6)
+* CRIS instruction expansion: CRIS-Expand. (line 6)
+* CRIS line comment characters: CRIS-Chars. (line 6)
+* CRIS options: CRIS-Opts. (line 6)
+* CRIS position-independent code: CRIS-Opts. (line 27)
+* CRIS pseudo-op .arch: CRIS-Pseudos. (line 45)
+* CRIS pseudo-op .dword: CRIS-Pseudos. (line 12)
+* CRIS pseudo-op .syntax: CRIS-Pseudos. (line 17)
+* CRIS pseudo-ops: CRIS-Pseudos. (line 6)
+* CRIS register names: CRIS-Regs. (line 6)
+* CRIS support: CRIS-Dependent. (line 6)
+* CRIS symbols in position-independent code: CRIS-Pic. (line 6)
+* ctbp register, V850: V850-Regs. (line 131)
+* ctoff pseudo-op, V850: V850 Opcodes. (line 111)
+* ctpc register, V850: V850-Regs. (line 119)
+* ctpsw register, V850: V850-Regs. (line 122)
+* current address: Dot. (line 6)
+* current address, advancing: Org. (line 6)
+* D10V @word modifier: D10V-Word. (line 6)
+* D10V addressing modes: D10V-Addressing. (line 6)
+* D10V floating point: D10V-Float. (line 6)
+* D10V line comment character: D10V-Chars. (line 6)
+* D10V opcode summary: D10V-Opcodes. (line 6)
+* D10V optimization: Overview. (line 420)
+* D10V options: D10V-Opts. (line 6)
+* D10V registers: D10V-Regs. (line 6)
+* D10V size modifiers: D10V-Size. (line 6)
+* D10V sub-instruction ordering: D10V-Chars. (line 6)
+* D10V sub-instructions: D10V-Subs. (line 6)
+* D10V support: D10V-Dependent. (line 6)
+* D10V syntax: D10V-Syntax. (line 6)
+* D30V addressing modes: D30V-Addressing. (line 6)
+* D30V floating point: D30V-Float. (line 6)
+* D30V Guarded Execution: D30V-Guarded. (line 6)
+* D30V line comment character: D30V-Chars. (line 6)
+* D30V nops: Overview. (line 428)
+* D30V nops after 32-bit multiply: Overview. (line 431)
+* D30V opcode summary: D30V-Opcodes. (line 6)
+* D30V optimization: Overview. (line 425)
+* D30V options: D30V-Opts. (line 6)
+* D30V registers: D30V-Regs. (line 6)
+* D30V size modifiers: D30V-Size. (line 6)
+* D30V sub-instruction ordering: D30V-Chars. (line 6)
+* D30V sub-instructions: D30V-Subs. (line 6)
+* D30V support: D30V-Dependent. (line 6)
+* D30V syntax: D30V-Syntax. (line 6)
+* data alignment on SPARC: Sparc-Aligned-Data. (line 6)
+* data and text sections, joining: R. (line 6)
+* data directive: Data. (line 6)
+* data directive, TIC54X: TIC54X-Directives. (line 61)
+* data relocations, ARM: ARM-Relocations. (line 6)
+* data section: Ld Sections. (line 9)
+* data1 directive, M680x0: M68K-Directives. (line 9)
+* data2 directive, M680x0: M68K-Directives. (line 12)
+* datalabel, SH64: SH64-Addressing. (line 16)
+* dbpc register, V850: V850-Regs. (line 125)
+* dbpsw register, V850: V850-Regs. (line 128)
+* debuggers, and symbol order: Symbols. (line 10)
+* debugging COFF symbols: Def. (line 6)
+* DEC syntax: PDP-11-Syntax. (line 6)
+* decimal integers: Integers. (line 12)
+* def directive: Def. (line 6)
+* def directive, TIC54X: TIC54X-Directives. (line 103)
+* density instructions: Density Instructions.
+ (line 6)
+* dependency tracking: MD. (line 6)
+* deprecated directives: Deprecated. (line 6)
+* desc directive: Desc. (line 6)
+* descriptor, of a.out symbol: Symbol Desc. (line 6)
+* dfloat directive, VAX: VAX-directives. (line 10)
+* difference tables altered: Word. (line 12)
+* difference tables, warning: K. (line 6)
+* differences, mmixal: MMIX-mmixal. (line 6)
+* dim directive: Dim. (line 6)
+* directives and instructions: Statements. (line 19)
+* directives for PowerPC: PowerPC-Pseudo. (line 6)
+* directives for SCORE: SCORE-Pseudo. (line 6)
+* directives, Blackfin: Blackfin Directives. (line 6)
+* directives, M32R: M32R-Directives. (line 6)
+* directives, M680x0: M68K-Directives. (line 6)
+* directives, machine independent: Pseudo Ops. (line 6)
+* directives, Xtensa: Xtensa Directives. (line 6)
+* directives, Z8000: Z8000 Directives. (line 6)
+* Disable floating-point instructions: MIPS floating-point. (line 6)
+* Disable single-precision floating-point operations: MIPS floating-point.
+ (line 12)
+* displacement sizing character, VAX: VAX-operands. (line 12)
+* dollar local symbols: Symbol Names. (line 105)
+* dot (symbol): Dot. (line 6)
+* double directive: Double. (line 6)
+* double directive, i386: i386-Float. (line 14)
+* double directive, M680x0: M68K-Float. (line 14)
+* double directive, M68HC11: M68HC11-Float. (line 14)
+* double directive, TIC54X: TIC54X-Directives. (line 64)
+* double directive, VAX: VAX-float. (line 15)
+* double directive, x86-64: i386-Float. (line 14)
+* doublequote (\"): Strings. (line 43)
+* drlist directive, TIC54X: TIC54X-Directives. (line 73)
+* drnolist directive, TIC54X: TIC54X-Directives. (line 73)
+* dual directive, i860: Directives-i860. (line 6)
+* ECOFF sections: MIPS Object. (line 6)
+* ecr register, V850: V850-Regs. (line 113)
+* eight-byte integer: Quad. (line 9)
+* eipc register, V850: V850-Regs. (line 101)
+* eipsw register, V850: V850-Regs. (line 104)
+* eject directive: Eject. (line 6)
+* ELF symbol type: Type. (line 22)
+* else directive: Else. (line 6)
+* elseif directive: Elseif. (line 6)
+* empty expressions: Empty Exprs. (line 6)
+* emsg directive, TIC54X: TIC54X-Directives. (line 77)
+* emulation: Overview. (line 744)
+* encoding options, i386: i386-Mnemonics. (line 32)
+* encoding options, x86-64: i386-Mnemonics. (line 32)
+* end directive: End. (line 6)
+* enddual directive, i860: Directives-i860. (line 11)
+* endef directive: Endef. (line 6)
+* endfunc directive: Endfunc. (line 6)
+* endianness, MIPS: Overview. (line 641)
+* endianness, PJ: Overview. (line 548)
+* endif directive: Endif. (line 6)
+* endloop directive, TIC54X: TIC54X-Directives. (line 143)
+* endm directive: Macro. (line 138)
+* endm directive, TIC54X: TIC54X-Directives. (line 153)
+* endstruct directive, TIC54X: TIC54X-Directives. (line 217)
+* endunion directive, TIC54X: TIC54X-Directives. (line 251)
+* environment settings, TIC54X: TIC54X-Env. (line 6)
+* EOF, newline must precede: Statements. (line 13)
+* ep register, V850: V850-Regs. (line 95)
+* equ directive: Equ. (line 6)
+* equ directive, TIC54X: TIC54X-Directives. (line 192)
+* equiv directive: Equiv. (line 6)
+* eqv directive: Eqv. (line 6)
+* err directive: Err. (line 6)
+* error directive: Error. (line 6)
+* error messages: Errors. (line 6)
+* error on valid input: Bug Criteria. (line 12)
+* errors, caused by warnings: W. (line 16)
+* errors, continuing after: Z. (line 6)
+* ESA/390 floating point (IEEE): ESA/390 Floating Point.
+ (line 6)
+* ESA/390 support: ESA/390-Dependent. (line 6)
+* ESA/390 Syntax: ESA/390 Options. (line 8)
+* ESA/390-only directives: ESA/390 Directives. (line 12)
+* escape codes, character: Strings. (line 15)
+* eval directive, TIC54X: TIC54X-Directives. (line 24)
+* even: Z8000 Directives. (line 58)
+* even directive, M680x0: M68K-Directives. (line 15)
+* even directive, TIC54X: TIC54X-Directives. (line 6)
+* exitm directive: Macro. (line 141)
+* expr (internal section): As Sections. (line 17)
+* expression arguments: Arguments. (line 6)
+* expressions: Expressions. (line 6)
+* expressions, comparison: Infix Ops. (line 55)
+* expressions, empty: Empty Exprs. (line 6)
+* expressions, integer: Integer Exprs. (line 6)
+* extAuxRegister directive, ARC: ARC Directives. (line 18)
+* extCondCode directive, ARC: ARC Directives. (line 41)
+* extCoreRegister directive, ARC: ARC Directives. (line 53)
+* extend directive M680x0: M68K-Float. (line 17)
+* extend directive M68HC11: M68HC11-Float. (line 17)
+* extended directive, i960: Directives-i960. (line 13)
+* extern directive: Extern. (line 6)
+* extInstruction directive, ARC: ARC Directives. (line 78)
+* fail directive: Fail. (line 6)
+* far_mode directive, TIC54X: TIC54X-Directives. (line 82)
+* faster processing (-f): f. (line 6)
+* fatal signal: Bug Criteria. (line 9)
+* fclist directive, TIC54X: TIC54X-Directives. (line 87)
+* fcnolist directive, TIC54X: TIC54X-Directives. (line 87)
+* fepc register, V850: V850-Regs. (line 107)
+* fepsw register, V850: V850-Regs. (line 110)
+* ffloat directive, VAX: VAX-directives. (line 14)
+* field directive, TIC54X: TIC54X-Directives. (line 91)
+* file directive: File. (line 6)
+* file directive, MSP 430: MSP430 Directives. (line 6)
+* file name, logical: File. (line 13)
+* files, including: Include. (line 6)
+* files, input: Input Files. (line 6)
+* fill directive: Fill. (line 6)
+* filling memory <1>: Skip. (line 6)
+* filling memory: Space. (line 6)
+* FLIX syntax: Xtensa Syntax. (line 6)
+* float directive: Float. (line 6)
+* float directive, i386: i386-Float. (line 14)
+* float directive, M680x0: M68K-Float. (line 11)
+* float directive, M68HC11: M68HC11-Float. (line 11)
+* float directive, TIC54X: TIC54X-Directives. (line 64)
+* float directive, VAX: VAX-float. (line 15)
+* float directive, x86-64: i386-Float. (line 14)
+* floating point numbers: Flonums. (line 6)
+* floating point numbers (double): Double. (line 6)
+* floating point numbers (single) <1>: Float. (line 6)
+* floating point numbers (single): Single. (line 6)
+* floating point, Alpha (IEEE): Alpha Floating Point.
+ (line 6)
+* floating point, ARC (IEEE): ARC Floating Point. (line 6)
+* floating point, ARM (IEEE): ARM Floating Point. (line 6)
+* floating point, D10V: D10V-Float. (line 6)
+* floating point, D30V: D30V-Float. (line 6)
+* floating point, ESA/390 (IEEE): ESA/390 Floating Point.
+ (line 6)
+* floating point, H8/300 (IEEE): H8/300 Floating Point.
+ (line 6)
+* floating point, HPPA (IEEE): HPPA Floating Point. (line 6)
+* floating point, i386: i386-Float. (line 6)
+* floating point, i960 (IEEE): Floating Point-i960. (line 6)
+* floating point, M680x0: M68K-Float. (line 6)
+* floating point, M68HC11: M68HC11-Float. (line 6)
+* floating point, MSP 430 (IEEE): MSP430 Floating Point.
+ (line 6)
+* floating point, s390: s390 Floating Point. (line 6)
+* floating point, SH (IEEE): SH Floating Point. (line 6)
+* floating point, SPARC (IEEE): Sparc-Float. (line 6)
+* floating point, V850 (IEEE): V850 Floating Point. (line 6)
+* floating point, VAX: VAX-float. (line 6)
+* floating point, x86-64: i386-Float. (line 6)
+* floating point, Z80: Z80 Floating Point. (line 6)
+* flonums: Flonums. (line 6)
+* format of error messages: Errors. (line 24)
+* format of warning messages: Errors. (line 12)
+* formfeed (\f): Strings. (line 18)
+* func directive: Func. (line 6)
+* functions, in expressions: Operators. (line 6)
+* gbr960, i960 postprocessor: Options-i960. (line 40)
+* gfloat directive, VAX: VAX-directives. (line 18)
+* global: Z8000 Directives. (line 21)
+* global directive: Global. (line 6)
+* global directive, TIC54X: TIC54X-Directives. (line 103)
+* gp register, MIPS: MIPS Object. (line 11)
+* gp register, V850: V850-Regs. (line 17)
+* grouping data: Sub-Sections. (line 6)
+* H8/300 addressing modes: H8/300-Addressing. (line 6)
+* H8/300 floating point (IEEE): H8/300 Floating Point.
+ (line 6)
+* H8/300 line comment character: H8/300-Chars. (line 6)
+* H8/300 line separator: H8/300-Chars. (line 8)
+* H8/300 machine directives (none): H8/300 Directives. (line 6)
+* H8/300 opcode summary: H8/300 Opcodes. (line 6)
+* H8/300 options: H8/300 Options. (line 6)
+* H8/300 registers: H8/300-Regs. (line 6)
+* H8/300 size suffixes: H8/300 Opcodes. (line 163)
+* H8/300 support: H8/300-Dependent. (line 6)
+* H8/300H, assembling for: H8/300 Directives. (line 8)
+* half directive, ARC: ARC Directives. (line 156)
+* half directive, SPARC: Sparc-Directives. (line 17)
+* half directive, TIC54X: TIC54X-Directives. (line 111)
+* hex character code (\XD...): Strings. (line 36)
+* hexadecimal integers: Integers. (line 15)
+* hexadecimal prefix, Z80: Z80-Chars. (line 8)
+* hfloat directive, VAX: VAX-directives. (line 22)
+* hi pseudo-op, V850: V850 Opcodes. (line 33)
+* hi0 pseudo-op, V850: V850 Opcodes. (line 10)
+* hidden directive: Hidden. (line 6)
+* high directive, M32R: M32R-Directives. (line 18)
+* hilo pseudo-op, V850: V850 Opcodes. (line 55)
+* HPPA directives not supported: HPPA Directives. (line 11)
+* HPPA floating point (IEEE): HPPA Floating Point. (line 6)
+* HPPA Syntax: HPPA Options. (line 8)
+* HPPA-only directives: HPPA Directives. (line 24)
+* hword directive: hword. (line 6)
+* i370 support: ESA/390-Dependent. (line 6)
+* i386 16-bit code: i386-16bit. (line 6)
+* i386 arch directive: i386-Arch. (line 6)
+* i386 att_syntax pseudo op: i386-Syntax. (line 6)
+* i386 conversion instructions: i386-Mnemonics. (line 36)
+* i386 floating point: i386-Float. (line 6)
+* i386 immediate operands: i386-Syntax. (line 15)
+* i386 instruction naming: i386-Mnemonics. (line 6)
+* i386 instruction prefixes: i386-Prefixes. (line 6)
+* i386 intel_syntax pseudo op: i386-Syntax. (line 6)
+* i386 jump optimization: i386-Jumps. (line 6)
+* i386 jump, call, return: i386-Syntax. (line 38)
+* i386 jump/call operands: i386-Syntax. (line 15)
+* i386 memory references: i386-Memory. (line 6)
+* i386 mnemonic compatibility: i386-Mnemonics. (line 61)
+* i386 mul, imul instructions: i386-Notes. (line 6)
+* i386 options: i386-Options. (line 6)
+* i386 register operands: i386-Syntax. (line 15)
+* i386 registers: i386-Regs. (line 6)
+* i386 sections: i386-Syntax. (line 44)
+* i386 size suffixes: i386-Syntax. (line 29)
+* i386 source, destination operands: i386-Syntax. (line 22)
+* i386 support: i386-Dependent. (line 6)
+* i386 syntax compatibility: i386-Syntax. (line 6)
+* i80386 support: i386-Dependent. (line 6)
+* i860 machine directives: Directives-i860. (line 6)
+* i860 opcodes: Opcodes for i860. (line 6)
+* i860 support: i860-Dependent. (line 6)
+* i960 architecture options: Options-i960. (line 6)
+* i960 branch recording: Options-i960. (line 22)
+* i960 callj pseudo-opcode: callj-i960. (line 6)
+* i960 compare and jump expansions: Compare-and-branch-i960.
+ (line 13)
+* i960 compare/branch instructions: Compare-and-branch-i960.
+ (line 6)
+* i960 floating point (IEEE): Floating Point-i960. (line 6)
+* i960 machine directives: Directives-i960. (line 6)
+* i960 opcodes: Opcodes for i960. (line 6)
+* i960 options: Options-i960. (line 6)
+* i960 support: i960-Dependent. (line 6)
+* IA-64 line comment character: IA-64-Chars. (line 6)
+* IA-64 line separator: IA-64-Chars. (line 8)
+* IA-64 options: IA-64 Options. (line 6)
+* IA-64 Processor-status-Register bit names: IA-64-Bits. (line 6)
+* IA-64 registers: IA-64-Regs. (line 6)
+* IA-64 support: IA-64-Dependent. (line 6)
+* IA-64 Syntax: IA-64 Options. (line 96)
+* ident directive: Ident. (line 6)
+* identifiers, ARM: ARM-Chars. (line 15)
+* identifiers, MSP 430: MSP430-Chars. (line 8)
+* if directive: If. (line 6)
+* ifb directive: If. (line 21)
+* ifc directive: If. (line 25)
+* ifdef directive: If. (line 16)
+* ifeq directive: If. (line 33)
+* ifeqs directive: If. (line 36)
+* ifge directive: If. (line 40)
+* ifgt directive: If. (line 44)
+* ifle directive: If. (line 48)
+* iflt directive: If. (line 52)
+* ifnb directive: If. (line 56)
+* ifnc directive: If. (line 61)
+* ifndef directive: If. (line 65)
+* ifne directive: If. (line 72)
+* ifnes directive: If. (line 76)
+* ifnotdef directive: If. (line 65)
+* immediate character, ARM: ARM-Chars. (line 13)
+* immediate character, M680x0: M68K-Chars. (line 6)
+* immediate character, VAX: VAX-operands. (line 6)
+* immediate fields, relaxation: Xtensa Immediate Relaxation.
+ (line 6)
+* immediate operands, i386: i386-Syntax. (line 15)
+* immediate operands, x86-64: i386-Syntax. (line 15)
+* imul instruction, i386: i386-Notes. (line 6)
+* imul instruction, x86-64: i386-Notes. (line 6)
+* incbin directive: Incbin. (line 6)
+* include directive: Include. (line 6)
+* include directive search path: I. (line 6)
+* indirect character, VAX: VAX-operands. (line 9)
+* infix operators: Infix Ops. (line 6)
+* inhibiting interrupts, i386: i386-Prefixes. (line 36)
+* input: Input Files. (line 6)
+* input file linenumbers: Input Files. (line 35)
+* instruction aliases, s390: s390 Aliases. (line 6)
+* instruction expansion, CRIS: CRIS-Expand. (line 6)
+* instruction expansion, MMIX: MMIX-Expand. (line 6)
+* instruction formats, s390: s390 Formats. (line 6)
+* instruction marker, s390: s390 Instruction Marker.
+ (line 6)
+* instruction mnemonics, s390: s390 Mnemonics. (line 6)
+* instruction naming, i386: i386-Mnemonics. (line 6)
+* instruction naming, x86-64: i386-Mnemonics. (line 6)
+* instruction operand modifier, s390: s390 Operand Modifier.
+ (line 6)
+* instruction operands, s390: s390 Operands. (line 6)
+* instruction prefixes, i386: i386-Prefixes. (line 6)
+* instruction set, M680x0: M68K-opcodes. (line 6)
+* instruction set, M68HC11: M68HC11-opcodes. (line 6)
+* instruction summary, AVR: AVR Opcodes. (line 6)
+* instruction summary, D10V: D10V-Opcodes. (line 6)
+* instruction summary, D30V: D30V-Opcodes. (line 6)
+* instruction summary, H8/300: H8/300 Opcodes. (line 6)
+* instruction summary, LM32: LM32 Opcodes. (line 6)
+* instruction summary, SH: SH Opcodes. (line 6)
+* instruction summary, SH64: SH64 Opcodes. (line 6)
+* instruction summary, Z8000: Z8000 Opcodes. (line 6)
+* instruction syntax, s390: s390 Syntax. (line 6)
+* instructions and directives: Statements. (line 19)
+* int directive: Int. (line 6)
+* int directive, H8/300: H8/300 Directives. (line 6)
+* int directive, i386: i386-Float. (line 21)
+* int directive, TIC54X: TIC54X-Directives. (line 111)
+* int directive, x86-64: i386-Float. (line 21)
+* integer expressions: Integer Exprs. (line 6)
+* integer, 16-byte: Octa. (line 6)
+* integer, 8-byte: Quad. (line 9)
+* integers: Integers. (line 6)
+* integers, 16-bit: hword. (line 6)
+* integers, 32-bit: Int. (line 6)
+* integers, binary: Integers. (line 6)
+* integers, decimal: Integers. (line 12)
+* integers, hexadecimal: Integers. (line 15)
+* integers, octal: Integers. (line 9)
+* integers, one byte: Byte. (line 6)
+* intel_syntax pseudo op, i386: i386-Syntax. (line 6)
+* intel_syntax pseudo op, x86-64: i386-Syntax. (line 6)
+* internal assembler sections: As Sections. (line 6)
+* internal directive: Internal. (line 6)
+* invalid input: Bug Criteria. (line 14)
+* invocation summary: Overview. (line 6)
+* IP2K architecture options: IP2K-Opts. (line 14)
+* IP2K options: IP2K-Opts. (line 6)
+* IP2K support: IP2K-Dependent. (line 6)
+* irp directive: Irp. (line 6)
+* irpc directive: Irpc. (line 6)
+* ISA options, SH64: SH64 Options. (line 6)
+* joining text and data sections: R. (line 6)
+* jump instructions, i386: i386-Mnemonics. (line 55)
+* jump instructions, x86-64: i386-Mnemonics. (line 55)
+* jump optimization, i386: i386-Jumps. (line 6)
+* jump optimization, x86-64: i386-Jumps. (line 6)
+* jump/call operands, i386: i386-Syntax. (line 15)
+* jump/call operands, x86-64: i386-Syntax. (line 15)
+* L16SI instructions, relaxation: Xtensa Immediate Relaxation.
+ (line 23)
+* L16UI instructions, relaxation: Xtensa Immediate Relaxation.
+ (line 23)
+* L32I instructions, relaxation: Xtensa Immediate Relaxation.
+ (line 23)
+* L8UI instructions, relaxation: Xtensa Immediate Relaxation.
+ (line 23)
+* label (:): Statements. (line 30)
+* label directive, TIC54X: TIC54X-Directives. (line 123)
+* labels: Labels. (line 6)
+* lcomm directive: Lcomm. (line 6)
+* lcomm directive, COFF: i386-Directives. (line 6)
+* ld: Object. (line 15)
+* ldouble directive M680x0: M68K-Float. (line 17)
+* ldouble directive M68HC11: M68HC11-Float. (line 17)
+* ldouble directive, TIC54X: TIC54X-Directives. (line 64)
+* LDR reg,=<label> pseudo op, ARM: ARM Opcodes. (line 15)
+* leafproc directive, i960: Directives-i960. (line 18)
+* length directive, TIC54X: TIC54X-Directives. (line 127)
+* length of symbols: Symbol Intro. (line 14)
+* lflags directive (ignored): Lflags. (line 6)
+* line comment character: Comments. (line 19)
+* line comment character, Alpha: Alpha-Chars. (line 6)
+* line comment character, ARM: ARM-Chars. (line 6)
+* line comment character, AVR: AVR-Chars. (line 6)
+* line comment character, D10V: D10V-Chars. (line 6)
+* line comment character, D30V: D30V-Chars. (line 6)
+* line comment character, H8/300: H8/300-Chars. (line 6)
+* line comment character, IA-64: IA-64-Chars. (line 6)
+* line comment character, M680x0: M68K-Chars. (line 6)
+* line comment character, MSP 430: MSP430-Chars. (line 6)
+* line comment character, s390: s390 Characters. (line 6)
+* line comment character, SH: SH-Chars. (line 6)
+* line comment character, SH64: SH64-Chars. (line 6)
+* line comment character, Sparc: Sparc-Chars. (line 6)
+* line comment character, V850: V850-Chars. (line 6)
+* line comment character, Z80: Z80-Chars. (line 6)
+* line comment character, Z8000: Z8000-Chars. (line 6)
+* line comment characters, CRIS: CRIS-Chars. (line 6)
+* line comment characters, MMIX: MMIX-Chars. (line 6)
+* line directive: Line. (line 6)
+* line directive, MSP 430: MSP430 Directives. (line 14)
+* line numbers, in input files: Input Files. (line 35)
+* line numbers, in warnings/errors: Errors. (line 16)
+* line separator character: Statements. (line 6)
+* line separator, Alpha: Alpha-Chars. (line 8)
+* line separator, ARM: ARM-Chars. (line 10)
+* line separator, AVR: AVR-Chars. (line 10)
+* line separator, H8/300: H8/300-Chars. (line 8)
+* line separator, IA-64: IA-64-Chars. (line 8)
+* line separator, SH: SH-Chars. (line 8)
+* line separator, SH64: SH64-Chars. (line 8)
+* line separator, Sparc: Sparc-Chars. (line 8)
+* line separator, Z8000: Z8000-Chars. (line 8)
+* lines starting with #: Comments. (line 39)
+* linker: Object. (line 15)
+* linker, and assembler: Secs Background. (line 10)
+* linkonce directive: Linkonce. (line 6)
+* list directive: List. (line 6)
+* list directive, TIC54X: TIC54X-Directives. (line 131)
+* listing control, turning off: Nolist. (line 6)
+* listing control, turning on: List. (line 6)
+* listing control: new page: Eject. (line 6)
+* listing control: paper size: Psize. (line 6)
+* listing control: subtitle: Sbttl. (line 6)
+* listing control: title line: Title. (line 6)
+* listings, enabling: a. (line 6)
+* literal directive: Literal Directive. (line 6)
+* literal pool entries, s390: s390 Literal Pool Entries.
+ (line 6)
+* literal_position directive: Literal Position Directive.
+ (line 6)
+* literal_prefix directive: Literal Prefix Directive.
+ (line 6)
+* little endian output, MIPS: Overview. (line 644)
+* little endian output, PJ: Overview. (line 551)
+* little-endian output, MIPS: MIPS Opts. (line 13)
+* LM32 modifiers: LM32-Modifiers. (line 6)
+* LM32 opcode summary: LM32 Opcodes. (line 6)
+* LM32 options (none): LM32 Options. (line 6)
+* LM32 register names: LM32-Regs. (line 6)
+* LM32 support: LM32-Dependent. (line 6)
+* ln directive: Ln. (line 6)
+* lo pseudo-op, V850: V850 Opcodes. (line 22)
+* loc directive: Loc. (line 6)
+* loc_mark_labels directive: Loc_mark_labels. (line 6)
+* local common symbols: Lcomm. (line 6)
+* local directive: Local. (line 6)
+* local labels: Symbol Names. (line 35)
+* local symbol names: Symbol Names. (line 22)
+* local symbols, retaining in output: L. (line 6)
+* location counter: Dot. (line 6)
+* location counter, advancing: Org. (line 6)
+* location counter, Z80: Z80-Chars. (line 8)
+* logical file name: File. (line 13)
+* logical line number: Line. (line 6)
+* logical line numbers: Comments. (line 39)
+* long directive: Long. (line 6)
+* long directive, ARC: ARC Directives. (line 159)
+* long directive, i386: i386-Float. (line 21)
+* long directive, TIC54X: TIC54X-Directives. (line 135)
+* long directive, x86-64: i386-Float. (line 21)
+* longcall pseudo-op, V850: V850 Opcodes. (line 123)
+* longcalls directive: Longcalls Directive. (line 6)
+* longjump pseudo-op, V850: V850 Opcodes. (line 129)
+* loop directive, TIC54X: TIC54X-Directives. (line 143)
+* LOOP instructions, alignment: Xtensa Automatic Alignment.
+ (line 6)
+* low directive, M32R: M32R-Directives. (line 9)
+* lp register, V850: V850-Regs. (line 98)
+* lval: Z8000 Directives. (line 27)
+* M16C architecture option: M32C-Opts. (line 12)
+* M32C architecture option: M32C-Opts. (line 9)
+* M32C modifiers: M32C-Modifiers. (line 6)
+* M32C options: M32C-Opts. (line 6)
+* M32C support: M32C-Dependent. (line 6)
+* M32R architecture options: M32R-Opts. (line 9)
+* M32R directives: M32R-Directives. (line 6)
+* M32R options: M32R-Opts. (line 6)
+* M32R support: M32R-Dependent. (line 6)
+* M32R warnings: M32R-Warnings. (line 6)
+* M680x0 addressing modes: M68K-Syntax. (line 21)
+* M680x0 architecture options: M68K-Opts. (line 104)
+* M680x0 branch improvement: M68K-Branch. (line 6)
+* M680x0 directives: M68K-Directives. (line 6)
+* M680x0 floating point: M68K-Float. (line 6)
+* M680x0 immediate character: M68K-Chars. (line 6)
+* M680x0 line comment character: M68K-Chars. (line 6)
+* M680x0 opcodes: M68K-opcodes. (line 6)
+* M680x0 options: M68K-Opts. (line 6)
+* M680x0 pseudo-opcodes: M68K-Branch. (line 6)
+* M680x0 size modifiers: M68K-Syntax. (line 8)
+* M680x0 support: M68K-Dependent. (line 6)
+* M680x0 syntax: M68K-Syntax. (line 8)
+* M68HC11 addressing modes: M68HC11-Syntax. (line 17)
+* M68HC11 and M68HC12 support: M68HC11-Dependent. (line 6)
+* M68HC11 assembler directive .far: M68HC11-Directives. (line 20)
+* M68HC11 assembler directive .interrupt: M68HC11-Directives. (line 26)
+* M68HC11 assembler directive .mode: M68HC11-Directives. (line 16)
+* M68HC11 assembler directive .relax: M68HC11-Directives. (line 10)
+* M68HC11 assembler directive .xrefb: M68HC11-Directives. (line 31)
+* M68HC11 assembler directives: M68HC11-Directives. (line 6)
+* M68HC11 branch improvement: M68HC11-Branch. (line 6)
+* M68HC11 floating point: M68HC11-Float. (line 6)
+* M68HC11 modifiers: M68HC11-Modifiers. (line 6)
+* M68HC11 opcodes: M68HC11-opcodes. (line 6)
+* M68HC11 options: M68HC11-Opts. (line 6)
+* M68HC11 pseudo-opcodes: M68HC11-Branch. (line 6)
+* M68HC11 syntax: M68HC11-Syntax. (line 6)
+* M68HC12 assembler directives: M68HC11-Directives. (line 6)
+* machine dependencies: Machine Dependencies.
+ (line 6)
+* machine directives, ARC: ARC Directives. (line 6)
+* machine directives, ARM: ARM Directives. (line 6)
+* machine directives, H8/300 (none): H8/300 Directives. (line 6)
+* machine directives, i860: Directives-i860. (line 6)
+* machine directives, i960: Directives-i960. (line 6)
+* machine directives, MSP 430: MSP430 Directives. (line 6)
+* machine directives, SH: SH Directives. (line 6)
+* machine directives, SH64: SH64 Directives. (line 9)
+* machine directives, SPARC: Sparc-Directives. (line 6)
+* machine directives, TIC54X: TIC54X-Directives. (line 6)
+* machine directives, V850: V850 Directives. (line 6)
+* machine directives, VAX: VAX-directives. (line 6)
+* machine directives, x86: i386-Directives. (line 6)
+* machine independent directives: Pseudo Ops. (line 6)
+* machine instructions (not covered): Manual. (line 14)
+* machine-independent syntax: Syntax. (line 6)
+* macro directive: Macro. (line 28)
+* macro directive, TIC54X: TIC54X-Directives. (line 153)
+* macros: Macro. (line 6)
+* macros, count executed: Macro. (line 143)
+* Macros, MSP 430: MSP430-Macros. (line 6)
+* macros, TIC54X: TIC54X-Macros. (line 6)
+* make rules: MD. (line 6)
+* manual, structure and purpose: Manual. (line 6)
+* math builtins, TIC54X: TIC54X-Builtins. (line 6)
+* Maximum number of continuation lines: listing. (line 34)
+* memory references, i386: i386-Memory. (line 6)
+* memory references, x86-64: i386-Memory. (line 6)
+* memory-mapped registers, TIC54X: TIC54X-MMRegs. (line 6)
+* merging text and data sections: R. (line 6)
+* messages from assembler: Errors. (line 6)
+* MicroBlaze architectures: MicroBlaze-Dependent.
+ (line 6)
+* MicroBlaze directives: MicroBlaze Directives.
+ (line 6)
+* MicroBlaze support: MicroBlaze-Dependent.
+ (line 13)
+* minus, permitted arguments: Infix Ops. (line 49)
+* MIPS architecture options: MIPS Opts. (line 29)
+* MIPS big-endian output: MIPS Opts. (line 13)
+* MIPS CPU override: MIPS ISA. (line 18)
+* MIPS debugging directives: MIPS Stabs. (line 6)
+* MIPS DSP Release 1 instruction generation override: MIPS ASE instruction generation overrides.
+ (line 21)
+* MIPS DSP Release 2 instruction generation override: MIPS ASE instruction generation overrides.
+ (line 26)
+* MIPS ECOFF sections: MIPS Object. (line 6)
+* MIPS endianness: Overview. (line 641)
+* MIPS ISA: Overview. (line 647)
+* MIPS ISA override: MIPS ISA. (line 6)
+* MIPS little-endian output: MIPS Opts. (line 13)
+* MIPS MDMX instruction generation override: MIPS ASE instruction generation overrides.
+ (line 16)
+* MIPS MIPS-3D instruction generation override: MIPS ASE instruction generation overrides.
+ (line 6)
+* MIPS MT instruction generation override: MIPS ASE instruction generation overrides.
+ (line 32)
+* MIPS option stack: MIPS option stack. (line 6)
+* MIPS processor: MIPS-Dependent. (line 6)
+* MIT: M68K-Syntax. (line 6)
+* mlib directive, TIC54X: TIC54X-Directives. (line 159)
+* mlist directive, TIC54X: TIC54X-Directives. (line 164)
+* MMIX assembler directive BSPEC: MMIX-Pseudos. (line 131)
+* MMIX assembler directive BYTE: MMIX-Pseudos. (line 97)
+* MMIX assembler directive ESPEC: MMIX-Pseudos. (line 131)
+* MMIX assembler directive GREG: MMIX-Pseudos. (line 50)
+* MMIX assembler directive IS: MMIX-Pseudos. (line 42)
+* MMIX assembler directive LOC: MMIX-Pseudos. (line 7)
+* MMIX assembler directive LOCAL: MMIX-Pseudos. (line 28)
+* MMIX assembler directive OCTA: MMIX-Pseudos. (line 108)
+* MMIX assembler directive PREFIX: MMIX-Pseudos. (line 120)
+* MMIX assembler directive TETRA: MMIX-Pseudos. (line 108)
+* MMIX assembler directive WYDE: MMIX-Pseudos. (line 108)
+* MMIX assembler directives: MMIX-Pseudos. (line 6)
+* MMIX line comment characters: MMIX-Chars. (line 6)
+* MMIX options: MMIX-Opts. (line 6)
+* MMIX pseudo-op BSPEC: MMIX-Pseudos. (line 131)
+* MMIX pseudo-op BYTE: MMIX-Pseudos. (line 97)
+* MMIX pseudo-op ESPEC: MMIX-Pseudos. (line 131)
+* MMIX pseudo-op GREG: MMIX-Pseudos. (line 50)
+* MMIX pseudo-op IS: MMIX-Pseudos. (line 42)
+* MMIX pseudo-op LOC: MMIX-Pseudos. (line 7)
+* MMIX pseudo-op LOCAL: MMIX-Pseudos. (line 28)
+* MMIX pseudo-op OCTA: MMIX-Pseudos. (line 108)
+* MMIX pseudo-op PREFIX: MMIX-Pseudos. (line 120)
+* MMIX pseudo-op TETRA: MMIX-Pseudos. (line 108)
+* MMIX pseudo-op WYDE: MMIX-Pseudos. (line 108)
+* MMIX pseudo-ops: MMIX-Pseudos. (line 6)
+* MMIX register names: MMIX-Regs. (line 6)
+* MMIX support: MMIX-Dependent. (line 6)
+* mmixal differences: MMIX-mmixal. (line 6)
+* mmregs directive, TIC54X: TIC54X-Directives. (line 170)
+* mmsg directive, TIC54X: TIC54X-Directives. (line 77)
+* MMX, i386: i386-SIMD. (line 6)
+* MMX, x86-64: i386-SIMD. (line 6)
+* mnemonic compatibility, i386: i386-Mnemonics. (line 61)
+* mnemonic suffixes, i386: i386-Syntax. (line 29)
+* mnemonic suffixes, x86-64: i386-Syntax. (line 29)
+* mnemonics for opcodes, VAX: VAX-opcodes. (line 6)
+* mnemonics, AVR: AVR Opcodes. (line 6)
+* mnemonics, D10V: D10V-Opcodes. (line 6)
+* mnemonics, D30V: D30V-Opcodes. (line 6)
+* mnemonics, H8/300: H8/300 Opcodes. (line 6)
+* mnemonics, LM32: LM32 Opcodes. (line 6)
+* mnemonics, SH: SH Opcodes. (line 6)
+* mnemonics, SH64: SH64 Opcodes. (line 6)
+* mnemonics, Z8000: Z8000 Opcodes. (line 6)
+* mnolist directive, TIC54X: TIC54X-Directives. (line 164)
+* Motorola syntax for the 680x0: M68K-Moto-Syntax. (line 6)
+* MOVI instructions, relaxation: Xtensa Immediate Relaxation.
+ (line 12)
+* MOVW and MOVT relocations, ARM: ARM-Relocations. (line 20)
+* MRI compatibility mode: M. (line 6)
+* mri directive: MRI. (line 6)
+* MRI mode, temporarily: MRI. (line 6)
+* MSP 430 floating point (IEEE): MSP430 Floating Point.
+ (line 6)
+* MSP 430 identifiers: MSP430-Chars. (line 8)
+* MSP 430 line comment character: MSP430-Chars. (line 6)
+* MSP 430 machine directives: MSP430 Directives. (line 6)
+* MSP 430 macros: MSP430-Macros. (line 6)
+* MSP 430 opcodes: MSP430 Opcodes. (line 6)
+* MSP 430 options (none): MSP430 Options. (line 6)
+* MSP 430 profiling capability: MSP430 Profiling Capability.
+ (line 6)
+* MSP 430 register names: MSP430-Regs. (line 6)
+* MSP 430 support: MSP430-Dependent. (line 6)
+* MSP430 Assembler Extensions: MSP430-Ext. (line 6)
+* mul instruction, i386: i386-Notes. (line 6)
+* mul instruction, x86-64: i386-Notes. (line 6)
+* name: Z8000 Directives. (line 18)
+* named section: Section. (line 6)
+* named sections: Ld Sections. (line 8)
+* names, symbol: Symbol Names. (line 6)
+* naming object file: o. (line 6)
+* new page, in listings: Eject. (line 6)
+* newblock directive, TIC54X: TIC54X-Directives. (line 176)
+* newline (\n): Strings. (line 21)
+* newline, required at file end: Statements. (line 13)
+* no-absolute-literals directive: Absolute Literals Directive.
+ (line 6)
+* no-longcalls directive: Longcalls Directive. (line 6)
+* no-schedule directive: Schedule Directive. (line 6)
+* no-transform directive: Transform Directive. (line 6)
+* nolist directive: Nolist. (line 6)
+* nolist directive, TIC54X: TIC54X-Directives. (line 131)
+* NOP pseudo op, ARM: ARM Opcodes. (line 9)
+* notes for Alpha: Alpha Notes. (line 6)
+* null-terminated strings: Asciz. (line 6)
+* number constants: Numbers. (line 6)
+* number of macros executed: Macro. (line 143)
+* numbered subsections: Sub-Sections. (line 6)
+* numbers, 16-bit: hword. (line 6)
+* numeric values: Expressions. (line 6)
+* nword directive, SPARC: Sparc-Directives. (line 20)
+* object attributes: Object Attributes. (line 6)
+* object file: Object. (line 6)
+* object file format: Object Formats. (line 6)
+* object file name: o. (line 6)
+* object file, after errors: Z. (line 6)
+* obsolescent directives: Deprecated. (line 6)
+* octa directive: Octa. (line 6)
+* octal character code (\DDD): Strings. (line 30)
+* octal integers: Integers. (line 9)
+* offset directive, V850: V850 Directives. (line 6)
+* opcode mnemonics, VAX: VAX-opcodes. (line 6)
+* opcode names, Xtensa: Xtensa Opcodes. (line 6)
+* opcode summary, AVR: AVR Opcodes. (line 6)
+* opcode summary, D10V: D10V-Opcodes. (line 6)
+* opcode summary, D30V: D30V-Opcodes. (line 6)
+* opcode summary, H8/300: H8/300 Opcodes. (line 6)
+* opcode summary, LM32: LM32 Opcodes. (line 6)
+* opcode summary, SH: SH Opcodes. (line 6)
+* opcode summary, SH64: SH64 Opcodes. (line 6)
+* opcode summary, Z8000: Z8000 Opcodes. (line 6)
+* opcodes for ARC: ARC Opcodes. (line 6)
+* opcodes for ARM: ARM Opcodes. (line 6)
+* opcodes for MSP 430: MSP430 Opcodes. (line 6)
+* opcodes for V850: V850 Opcodes. (line 6)
+* opcodes, i860: Opcodes for i860. (line 6)
+* opcodes, i960: Opcodes for i960. (line 6)
+* opcodes, M680x0: M68K-opcodes. (line 6)
+* opcodes, M68HC11: M68HC11-opcodes. (line 6)
+* operand delimiters, i386: i386-Syntax. (line 15)
+* operand delimiters, x86-64: i386-Syntax. (line 15)
+* operand notation, VAX: VAX-operands. (line 6)
+* operands in expressions: Arguments. (line 6)
+* operator precedence: Infix Ops. (line 11)
+* operators, in expressions: Operators. (line 6)
+* operators, permitted arguments: Infix Ops. (line 6)
+* optimization, D10V: Overview. (line 420)
+* optimization, D30V: Overview. (line 425)
+* optimizations: Xtensa Optimizations.
+ (line 6)
+* option directive, ARC: ARC Directives. (line 162)
+* option directive, TIC54X: TIC54X-Directives. (line 180)
+* option summary: Overview. (line 6)
+* options for Alpha: Alpha Options. (line 6)
+* options for ARC (none): ARC Options. (line 6)
+* options for ARM (none): ARM Options. (line 6)
+* options for AVR (none): AVR Options. (line 6)
+* options for Blackfin (none): Blackfin Options. (line 6)
+* options for i386: i386-Options. (line 6)
+* options for IA-64: IA-64 Options. (line 6)
+* options for LM32 (none): LM32 Options. (line 6)
+* options for MSP430 (none): MSP430 Options. (line 6)
+* options for PDP-11: PDP-11-Options. (line 6)
+* options for PowerPC: PowerPC-Opts. (line 6)
+* options for s390: s390 Options. (line 6)
+* options for SCORE: SCORE-Opts. (line 6)
+* options for SPARC: Sparc-Opts. (line 6)
+* options for V850 (none): V850 Options. (line 6)
+* options for VAX/VMS: VAX-Opts. (line 42)
+* options for x86-64: i386-Options. (line 6)
+* options for Z80: Z80 Options. (line 6)
+* options, all versions of assembler: Invoking. (line 6)
+* options, command line: Command Line. (line 13)
+* options, CRIS: CRIS-Opts. (line 6)
+* options, D10V: D10V-Opts. (line 6)
+* options, D30V: D30V-Opts. (line 6)
+* options, H8/300: H8/300 Options. (line 6)
+* options, i960: Options-i960. (line 6)
+* options, IP2K: IP2K-Opts. (line 6)
+* options, M32C: M32C-Opts. (line 6)
+* options, M32R: M32R-Opts. (line 6)
+* options, M680x0: M68K-Opts. (line 6)
+* options, M68HC11: M68HC11-Opts. (line 6)
+* options, MMIX: MMIX-Opts. (line 6)
+* options, PJ: PJ Options. (line 6)
+* options, SH: SH Options. (line 6)
+* options, SH64: SH64 Options. (line 6)
+* options, TIC54X: TIC54X-Opts. (line 6)
+* options, Z8000: Z8000 Options. (line 6)
+* org directive: Org. (line 6)
+* other attribute, of a.out symbol: Symbol Other. (line 6)
+* output file: Object. (line 6)
+* p2align directive: P2align. (line 6)
+* p2alignl directive: P2align. (line 28)
+* p2alignw directive: P2align. (line 28)
+* padding the location counter: Align. (line 6)
+* padding the location counter given a power of two: P2align. (line 6)
+* padding the location counter given number of bytes: Balign. (line 6)
+* page, in listings: Eject. (line 6)
+* paper size, for listings: Psize. (line 6)
+* paths for .include: I. (line 6)
+* patterns, writing in memory: Fill. (line 6)
+* PDP-11 comments: PDP-11-Syntax. (line 16)
+* PDP-11 floating-point register syntax: PDP-11-Syntax. (line 13)
+* PDP-11 general-purpose register syntax: PDP-11-Syntax. (line 10)
+* PDP-11 instruction naming: PDP-11-Mnemonics. (line 6)
+* PDP-11 support: PDP-11-Dependent. (line 6)
+* PDP-11 syntax: PDP-11-Syntax. (line 6)
+* PIC code generation for ARM: ARM Options. (line 139)
+* PIC code generation for M32R: M32R-Opts. (line 42)
+* PIC selection, MIPS: MIPS Opts. (line 21)
+* PJ endianness: Overview. (line 548)
+* PJ options: PJ Options. (line 6)
+* PJ support: PJ-Dependent. (line 6)
+* plus, permitted arguments: Infix Ops. (line 44)
+* popsection directive: PopSection. (line 6)
+* Position-independent code, CRIS: CRIS-Opts. (line 27)
+* Position-independent code, symbols in, CRIS: CRIS-Pic. (line 6)
+* PowerPC architectures: PowerPC-Opts. (line 6)
+* PowerPC directives: PowerPC-Pseudo. (line 6)
+* PowerPC options: PowerPC-Opts. (line 6)
+* PowerPC support: PPC-Dependent. (line 6)
+* precedence of operators: Infix Ops. (line 11)
+* precision, floating point: Flonums. (line 6)
+* prefix operators: Prefix Ops. (line 6)
+* prefixes, i386: i386-Prefixes. (line 6)
+* preprocessing: Preprocessing. (line 6)
+* preprocessing, turning on and off: Preprocessing. (line 27)
+* previous directive: Previous. (line 6)
+* primary attributes, COFF symbols: COFF Symbols. (line 13)
+* print directive: Print. (line 6)
+* proc directive, SPARC: Sparc-Directives. (line 25)
+* profiler directive, MSP 430: MSP430 Directives. (line 22)
+* profiling capability for MSP 430: MSP430 Profiling Capability.
+ (line 6)
+* protected directive: Protected. (line 6)
+* pseudo-op .arch, CRIS: CRIS-Pseudos. (line 45)
+* pseudo-op .dword, CRIS: CRIS-Pseudos. (line 12)
+* pseudo-op .syntax, CRIS: CRIS-Pseudos. (line 17)
+* pseudo-op BSPEC, MMIX: MMIX-Pseudos. (line 131)
+* pseudo-op BYTE, MMIX: MMIX-Pseudos. (line 97)
+* pseudo-op ESPEC, MMIX: MMIX-Pseudos. (line 131)
+* pseudo-op GREG, MMIX: MMIX-Pseudos. (line 50)
+* pseudo-op IS, MMIX: MMIX-Pseudos. (line 42)
+* pseudo-op LOC, MMIX: MMIX-Pseudos. (line 7)
+* pseudo-op LOCAL, MMIX: MMIX-Pseudos. (line 28)
+* pseudo-op OCTA, MMIX: MMIX-Pseudos. (line 108)
+* pseudo-op PREFIX, MMIX: MMIX-Pseudos. (line 120)
+* pseudo-op TETRA, MMIX: MMIX-Pseudos. (line 108)
+* pseudo-op WYDE, MMIX: MMIX-Pseudos. (line 108)
+* pseudo-opcodes, M680x0: M68K-Branch. (line 6)
+* pseudo-opcodes, M68HC11: M68HC11-Branch. (line 6)
+* pseudo-ops for branch, VAX: VAX-branch. (line 6)
+* pseudo-ops, CRIS: CRIS-Pseudos. (line 6)
+* pseudo-ops, machine independent: Pseudo Ops. (line 6)
+* pseudo-ops, MMIX: MMIX-Pseudos. (line 6)
+* psize directive: Psize. (line 6)
+* PSR bits: IA-64-Bits. (line 6)
+* pstring directive, TIC54X: TIC54X-Directives. (line 209)
+* psw register, V850: V850-Regs. (line 116)
+* purgem directive: Purgem. (line 6)
+* purpose of GNU assembler: GNU Assembler. (line 12)
+* pushsection directive: PushSection. (line 6)
+* quad directive: Quad. (line 6)
+* quad directive, i386: i386-Float. (line 21)
+* quad directive, x86-64: i386-Float. (line 21)
+* real-mode code, i386: i386-16bit. (line 6)
+* ref directive, TIC54X: TIC54X-Directives. (line 103)
+* register directive, SPARC: Sparc-Directives. (line 29)
+* register names, Alpha: Alpha-Regs. (line 6)
+* register names, ARC: ARC-Regs. (line 6)
+* register names, ARM: ARM-Regs. (line 6)
+* register names, AVR: AVR-Regs. (line 6)
+* register names, CRIS: CRIS-Regs. (line 6)
+* register names, H8/300: H8/300-Regs. (line 6)
+* register names, IA-64: IA-64-Regs. (line 6)
+* register names, LM32: LM32-Regs. (line 6)
+* register names, MMIX: MMIX-Regs. (line 6)
+* register names, MSP 430: MSP430-Regs. (line 6)
+* register names, Sparc: Sparc-Regs. (line 6)
+* register names, V850: V850-Regs. (line 6)
+* register names, VAX: VAX-operands. (line 17)
+* register names, Xtensa: Xtensa Registers. (line 6)
+* register names, Z80: Z80-Regs. (line 6)
+* register naming, s390: s390 Register. (line 6)
+* register operands, i386: i386-Syntax. (line 15)
+* register operands, x86-64: i386-Syntax. (line 15)
+* registers, D10V: D10V-Regs. (line 6)
+* registers, D30V: D30V-Regs. (line 6)
+* registers, i386: i386-Regs. (line 6)
+* registers, SH: SH-Regs. (line 6)
+* registers, SH64: SH64-Regs. (line 6)
+* registers, TIC54X memory-mapped: TIC54X-MMRegs. (line 6)
+* registers, x86-64: i386-Regs. (line 6)
+* registers, Z8000: Z8000-Regs. (line 6)
+* relaxation: Xtensa Relaxation. (line 6)
+* relaxation of ADDI instructions: Xtensa Immediate Relaxation.
+ (line 43)
+* relaxation of branch instructions: Xtensa Branch Relaxation.
+ (line 6)
+* relaxation of call instructions: Xtensa Call Relaxation.
+ (line 6)
+* relaxation of immediate fields: Xtensa Immediate Relaxation.
+ (line 6)
+* relaxation of L16SI instructions: Xtensa Immediate Relaxation.
+ (line 23)
+* relaxation of L16UI instructions: Xtensa Immediate Relaxation.
+ (line 23)
+* relaxation of L32I instructions: Xtensa Immediate Relaxation.
+ (line 23)
+* relaxation of L8UI instructions: Xtensa Immediate Relaxation.
+ (line 23)
+* relaxation of MOVI instructions: Xtensa Immediate Relaxation.
+ (line 12)
+* reloc directive: Reloc. (line 6)
+* relocation: Sections. (line 6)
+* relocation example: Ld Sections. (line 40)
+* relocations, Alpha: Alpha-Relocs. (line 6)
+* relocations, Sparc: Sparc-Relocs. (line 6)
+* repeat prefixes, i386: i386-Prefixes. (line 44)
+* reporting bugs in assembler: Reporting Bugs. (line 6)
+* rept directive: Rept. (line 6)
+* reserve directive, SPARC: Sparc-Directives. (line 39)
+* return instructions, i386: i386-Syntax. (line 38)
+* return instructions, x86-64: i386-Syntax. (line 38)
+* REX prefixes, i386: i386-Prefixes. (line 46)
+* rsect: Z8000 Directives. (line 52)
+* s390 floating point: s390 Floating Point. (line 6)
+* s390 instruction aliases: s390 Aliases. (line 6)
+* s390 instruction formats: s390 Formats. (line 6)
+* s390 instruction marker: s390 Instruction Marker.
+ (line 6)
+* s390 instruction mnemonics: s390 Mnemonics. (line 6)
+* s390 instruction operand modifier: s390 Operand Modifier.
+ (line 6)
+* s390 instruction operands: s390 Operands. (line 6)
+* s390 instruction syntax: s390 Syntax. (line 6)
+* s390 line comment character: s390 Characters. (line 6)
+* s390 literal pool entries: s390 Literal Pool Entries.
+ (line 6)
+* s390 options: s390 Options. (line 6)
+* s390 register naming: s390 Register. (line 6)
+* s390 support: S/390-Dependent. (line 6)
+* sblock directive, TIC54X: TIC54X-Directives. (line 183)
+* sbttl directive: Sbttl. (line 6)
+* schedule directive: Schedule Directive. (line 6)
+* scl directive: Scl. (line 6)
+* SCORE architectures: SCORE-Opts. (line 6)
+* SCORE directives: SCORE-Pseudo. (line 6)
+* SCORE options: SCORE-Opts. (line 6)
+* SCORE processor: SCORE-Dependent. (line 6)
+* sdaoff pseudo-op, V850: V850 Opcodes. (line 65)
+* search path for .include: I. (line 6)
+* sect directive, MSP 430: MSP430 Directives. (line 18)
+* sect directive, TIC54X: TIC54X-Directives. (line 189)
+* section directive (COFF version): Section. (line 16)
+* section directive (ELF version): Section. (line 70)
+* section directive, V850: V850 Directives. (line 9)
+* section override prefixes, i386: i386-Prefixes. (line 23)
+* Section Stack <1>: Section. (line 65)
+* Section Stack <2>: SubSection. (line 6)
+* Section Stack <3>: PopSection. (line 6)
+* Section Stack <4>: PushSection. (line 6)
+* Section Stack: Previous. (line 6)
+* section-relative addressing: Secs Background. (line 68)
+* sections: Sections. (line 6)
+* sections in messages, internal: As Sections. (line 6)
+* sections, i386: i386-Syntax. (line 44)
+* sections, named: Ld Sections. (line 8)
+* sections, x86-64: i386-Syntax. (line 44)
+* seg directive, SPARC: Sparc-Directives. (line 44)
+* segm: Z8000 Directives. (line 10)
+* set directive: Set. (line 6)
+* set directive, TIC54X: TIC54X-Directives. (line 192)
+* SH addressing modes: SH-Addressing. (line 6)
+* SH floating point (IEEE): SH Floating Point. (line 6)
+* SH line comment character: SH-Chars. (line 6)
+* SH line separator: SH-Chars. (line 8)
+* SH machine directives: SH Directives. (line 6)
+* SH opcode summary: SH Opcodes. (line 6)
+* SH options: SH Options. (line 6)
+* SH registers: SH-Regs. (line 6)
+* SH support: SH-Dependent. (line 6)
+* SH64 ABI options: SH64 Options. (line 29)
+* SH64 addressing modes: SH64-Addressing. (line 6)
+* SH64 ISA options: SH64 Options. (line 6)
+* SH64 line comment character: SH64-Chars. (line 6)
+* SH64 line separator: SH64-Chars. (line 8)
+* SH64 machine directives: SH64 Directives. (line 9)
+* SH64 opcode summary: SH64 Opcodes. (line 6)
+* SH64 options: SH64 Options. (line 6)
+* SH64 registers: SH64-Regs. (line 6)
+* SH64 support: SH64-Dependent. (line 6)
+* shigh directive, M32R: M32R-Directives. (line 26)
+* short directive: Short. (line 6)
+* short directive, ARC: ARC Directives. (line 171)
+* short directive, TIC54X: TIC54X-Directives. (line 111)
+* SIMD, i386: i386-SIMD. (line 6)
+* SIMD, x86-64: i386-SIMD. (line 6)
+* single character constant: Chars. (line 6)
+* single directive: Single. (line 6)
+* single directive, i386: i386-Float. (line 14)
+* single directive, x86-64: i386-Float. (line 14)
+* single quote, Z80: Z80-Chars. (line 13)
+* sixteen bit integers: hword. (line 6)
+* sixteen byte integer: Octa. (line 6)
+* size directive (COFF version): Size. (line 11)
+* size directive (ELF version): Size. (line 19)
+* size modifiers, D10V: D10V-Size. (line 6)
+* size modifiers, D30V: D30V-Size. (line 6)
+* size modifiers, M680x0: M68K-Syntax. (line 8)
+* size prefixes, i386: i386-Prefixes. (line 27)
+* size suffixes, H8/300: H8/300 Opcodes. (line 163)
+* size, translations, Sparc: Sparc-Size-Translations.
+ (line 6)
+* sizes operands, i386: i386-Syntax. (line 29)
+* sizes operands, x86-64: i386-Syntax. (line 29)
+* skip directive: Skip. (line 6)
+* skip directive, M680x0: M68K-Directives. (line 19)
+* skip directive, SPARC: Sparc-Directives. (line 48)
+* sleb128 directive: Sleb128. (line 6)
+* small objects, MIPS ECOFF: MIPS Object. (line 11)
+* SmartMIPS instruction generation override: MIPS ASE instruction generation overrides.
+ (line 11)
+* SOM symbol attributes: SOM Symbols. (line 6)
+* source program: Input Files. (line 6)
+* source, destination operands; i386: i386-Syntax. (line 22)
+* source, destination operands; x86-64: i386-Syntax. (line 22)
+* sp register: Xtensa Registers. (line 6)
+* sp register, V850: V850-Regs. (line 14)
+* space directive: Space. (line 6)
+* space directive, TIC54X: TIC54X-Directives. (line 197)
+* space used, maximum for assembly: statistics. (line 6)
+* SPARC architectures: Sparc-Opts. (line 6)
+* Sparc constants: Sparc-Constants. (line 6)
+* SPARC data alignment: Sparc-Aligned-Data. (line 6)
+* SPARC floating point (IEEE): Sparc-Float. (line 6)
+* Sparc line comment character: Sparc-Chars. (line 6)
+* Sparc line separator: Sparc-Chars. (line 8)
+* SPARC machine directives: Sparc-Directives. (line 6)
+* SPARC options: Sparc-Opts. (line 6)
+* Sparc registers: Sparc-Regs. (line 6)
+* Sparc relocations: Sparc-Relocs. (line 6)
+* Sparc size translations: Sparc-Size-Translations.
+ (line 6)
+* SPARC support: Sparc-Dependent. (line 6)
+* SPARC syntax: Sparc-Aligned-Data. (line 21)
+* special characters, ARC: ARC-Chars. (line 6)
+* special characters, M680x0: M68K-Chars. (line 6)
+* special purpose registers, MSP 430: MSP430-Regs. (line 11)
+* sslist directive, TIC54X: TIC54X-Directives. (line 204)
+* ssnolist directive, TIC54X: TIC54X-Directives. (line 204)
+* stabd directive: Stab. (line 38)
+* stabn directive: Stab. (line 48)
+* stabs directive: Stab. (line 51)
+* stabX directives: Stab. (line 6)
+* standard assembler sections: Secs Background. (line 27)
+* standard input, as input file: Command Line. (line 10)
+* statement separator character: Statements. (line 6)
+* statement separator, Alpha: Alpha-Chars. (line 8)
+* statement separator, ARM: ARM-Chars. (line 10)
+* statement separator, AVR: AVR-Chars. (line 10)
+* statement separator, H8/300: H8/300-Chars. (line 8)
+* statement separator, IA-64: IA-64-Chars. (line 8)
+* statement separator, SH: SH-Chars. (line 8)
+* statement separator, SH64: SH64-Chars. (line 8)
+* statement separator, Sparc: Sparc-Chars. (line 8)
+* statement separator, Z8000: Z8000-Chars. (line 8)
+* statements, structure of: Statements. (line 6)
+* statistics, about assembly: statistics. (line 6)
+* stopping the assembly: Abort. (line 6)
+* string constants: Strings. (line 6)
+* string directive: String. (line 8)
+* string directive on HPPA: HPPA Directives. (line 137)
+* string directive, TIC54X: TIC54X-Directives. (line 209)
+* string literals: Ascii. (line 6)
+* string, copying to object file: String. (line 8)
+* string16 directive: String. (line 8)
+* string16, copying to object file: String. (line 8)
+* string32 directive: String. (line 8)
+* string32, copying to object file: String. (line 8)
+* string64 directive: String. (line 8)
+* string64, copying to object file: String. (line 8)
+* string8 directive: String. (line 8)
+* string8, copying to object file: String. (line 8)
+* struct directive: Struct. (line 6)
+* struct directive, TIC54X: TIC54X-Directives. (line 217)
+* structure debugging, COFF: Tag. (line 6)
+* sub-instruction ordering, D10V: D10V-Chars. (line 6)
+* sub-instruction ordering, D30V: D30V-Chars. (line 6)
+* sub-instructions, D10V: D10V-Subs. (line 6)
+* sub-instructions, D30V: D30V-Subs. (line 6)
+* subexpressions: Arguments. (line 24)
+* subsection directive: SubSection. (line 6)
+* subsym builtins, TIC54X: TIC54X-Macros. (line 16)
+* subtitles for listings: Sbttl. (line 6)
+* subtraction, permitted arguments: Infix Ops. (line 49)
+* summary of options: Overview. (line 6)
+* support: HPPA-Dependent. (line 6)
+* supporting files, including: Include. (line 6)
+* suppressing warnings: W. (line 11)
+* sval: Z8000 Directives. (line 33)
+* symbol attributes: Symbol Attributes. (line 6)
+* symbol attributes, a.out: a.out Symbols. (line 6)
+* symbol attributes, COFF: COFF Symbols. (line 6)
+* symbol attributes, SOM: SOM Symbols. (line 6)
+* symbol descriptor, COFF: Desc. (line 6)
+* symbol modifiers <1>: AVR-Modifiers. (line 12)
+* symbol modifiers <2>: LM32-Modifiers. (line 12)
+* symbol modifiers <3>: M32C-Modifiers. (line 11)
+* symbol modifiers: M68HC11-Modifiers. (line 12)
+* symbol names: Symbol Names. (line 6)
+* symbol names, $ in <1>: SH-Chars. (line 10)
+* symbol names, $ in <2>: SH64-Chars. (line 10)
+* symbol names, $ in <3>: D30V-Chars. (line 63)
+* symbol names, $ in: D10V-Chars. (line 46)
+* symbol names, local: Symbol Names. (line 22)
+* symbol names, temporary: Symbol Names. (line 35)
+* symbol storage class (COFF): Scl. (line 6)
+* symbol type: Symbol Type. (line 6)
+* symbol type, COFF: Type. (line 11)
+* symbol type, ELF: Type. (line 22)
+* symbol value: Symbol Value. (line 6)
+* symbol value, setting: Set. (line 6)
+* symbol values, assigning: Setting Symbols. (line 6)
+* symbol versioning: Symver. (line 6)
+* symbol, common: Comm. (line 6)
+* symbol, making visible to linker: Global. (line 6)
+* symbolic debuggers, information for: Stab. (line 6)
+* symbols: Symbols. (line 6)
+* Symbols in position-independent code, CRIS: CRIS-Pic. (line 6)
+* symbols with uppercase, VAX/VMS: VAX-Opts. (line 42)
+* symbols, assigning values to: Equ. (line 6)
+* Symbols, built-in, CRIS: CRIS-Symbols. (line 6)
+* Symbols, CRIS, built-in: CRIS-Symbols. (line 6)
+* symbols, local common: Lcomm. (line 6)
+* symver directive: Symver. (line 6)
+* syntax compatibility, i386: i386-Syntax. (line 6)
+* syntax compatibility, x86-64: i386-Syntax. (line 6)
+* syntax, AVR: AVR-Modifiers. (line 6)
+* syntax, Blackfin: Blackfin Syntax. (line 6)
+* syntax, D10V: D10V-Syntax. (line 6)
+* syntax, D30V: D30V-Syntax. (line 6)
+* syntax, LM32: LM32-Modifiers. (line 6)
+* syntax, M32C: M32C-Modifiers. (line 6)
+* syntax, M680x0: M68K-Syntax. (line 8)
+* syntax, M68HC11 <1>: M68HC11-Modifiers. (line 6)
+* syntax, M68HC11: M68HC11-Syntax. (line 6)
+* syntax, machine-independent: Syntax. (line 6)
+* syntax, SPARC: Sparc-Aligned-Data. (line 21)
+* syntax, Xtensa assembler: Xtensa Syntax. (line 6)
+* sysproc directive, i960: Directives-i960. (line 37)
+* tab (\t): Strings. (line 27)
+* tab directive, TIC54X: TIC54X-Directives. (line 248)
+* tag directive: Tag. (line 6)
+* tag directive, TIC54X: TIC54X-Directives. (line 251)
+* tdaoff pseudo-op, V850: V850 Opcodes. (line 81)
+* temporary symbol names: Symbol Names. (line 35)
+* text and data sections, joining: R. (line 6)
+* text directive: Text. (line 6)
+* text section: Ld Sections. (line 9)
+* tfloat directive, i386: i386-Float. (line 14)
+* tfloat directive, x86-64: i386-Float. (line 14)
+* Thumb support: ARM-Dependent. (line 6)
+* TIC54X builtin math functions: TIC54X-Builtins. (line 6)
+* TIC54X machine directives: TIC54X-Directives. (line 6)
+* TIC54X memory-mapped registers: TIC54X-MMRegs. (line 6)
+* TIC54X options: TIC54X-Opts. (line 6)
+* TIC54X subsym builtins: TIC54X-Macros. (line 16)
+* TIC54X support: TIC54X-Dependent. (line 6)
+* TIC54X-specific macros: TIC54X-Macros. (line 6)
+* time, total for assembly: statistics. (line 6)
+* title directive: Title. (line 6)
+* tp register, V850: V850-Regs. (line 20)
+* transform directive: Transform Directive. (line 6)
+* trusted compiler: f. (line 6)
+* turning preprocessing on and off: Preprocessing. (line 27)
+* type directive (COFF version): Type. (line 11)
+* type directive (ELF version): Type. (line 22)
+* type of a symbol: Symbol Type. (line 6)
+* ualong directive, SH: SH Directives. (line 6)
+* uaword directive, SH: SH Directives. (line 6)
+* ubyte directive, TIC54X: TIC54X-Directives. (line 36)
+* uchar directive, TIC54X: TIC54X-Directives. (line 36)
+* uhalf directive, TIC54X: TIC54X-Directives. (line 111)
+* uint directive, TIC54X: TIC54X-Directives. (line 111)
+* uleb128 directive: Uleb128. (line 6)
+* ulong directive, TIC54X: TIC54X-Directives. (line 135)
+* undefined section: Ld Sections. (line 36)
+* union directive, TIC54X: TIC54X-Directives. (line 251)
+* unsegm: Z8000 Directives. (line 14)
+* usect directive, TIC54X: TIC54X-Directives. (line 263)
+* ushort directive, TIC54X: TIC54X-Directives. (line 111)
+* uword directive, TIC54X: TIC54X-Directives. (line 111)
+* V850 command line options: V850 Options. (line 9)
+* V850 floating point (IEEE): V850 Floating Point. (line 6)
+* V850 line comment character: V850-Chars. (line 6)
+* V850 machine directives: V850 Directives. (line 6)
+* V850 opcodes: V850 Opcodes. (line 6)
+* V850 options (none): V850 Options. (line 6)
+* V850 register names: V850-Regs. (line 6)
+* V850 support: V850-Dependent. (line 6)
+* val directive: Val. (line 6)
+* value attribute, COFF: Val. (line 6)
+* value of a symbol: Symbol Value. (line 6)
+* var directive, TIC54X: TIC54X-Directives. (line 273)
+* VAX bitfields not supported: VAX-no. (line 6)
+* VAX branch improvement: VAX-branch. (line 6)
+* VAX command-line options ignored: VAX-Opts. (line 6)
+* VAX displacement sizing character: VAX-operands. (line 12)
+* VAX floating point: VAX-float. (line 6)
+* VAX immediate character: VAX-operands. (line 6)
+* VAX indirect character: VAX-operands. (line 9)
+* VAX machine directives: VAX-directives. (line 6)
+* VAX opcode mnemonics: VAX-opcodes. (line 6)
+* VAX operand notation: VAX-operands. (line 6)
+* VAX register names: VAX-operands. (line 17)
+* VAX support: Vax-Dependent. (line 6)
+* Vax-11 C compatibility: VAX-Opts. (line 42)
+* VAX/VMS options: VAX-Opts. (line 42)
+* version directive: Version. (line 6)
+* version directive, TIC54X: TIC54X-Directives. (line 277)
+* version of assembler: v. (line 6)
+* versions of symbols: Symver. (line 6)
+* visibility <1>: Internal. (line 6)
+* visibility <2>: Protected. (line 6)
+* visibility: Hidden. (line 6)
+* VMS (VAX) options: VAX-Opts. (line 42)
+* vtable_entry directive: VTableEntry. (line 6)
+* vtable_inherit directive: VTableInherit. (line 6)
+* warning directive: Warning. (line 6)
+* warning for altered difference tables: K. (line 6)
+* warning messages: Errors. (line 6)
+* warnings, causing error: W. (line 16)
+* warnings, M32R: M32R-Warnings. (line 6)
+* warnings, suppressing: W. (line 11)
+* warnings, switching on: W. (line 19)
+* weak directive: Weak. (line 6)
+* weakref directive: Weakref. (line 6)
+* whitespace: Whitespace. (line 6)
+* whitespace, removed by preprocessor: Preprocessing. (line 7)
+* wide floating point directives, VAX: VAX-directives. (line 10)
+* width directive, TIC54X: TIC54X-Directives. (line 127)
+* Width of continuation lines of disassembly output: listing. (line 21)
+* Width of first line disassembly output: listing. (line 16)
+* Width of source line output: listing. (line 28)
+* wmsg directive, TIC54X: TIC54X-Directives. (line 77)
+* word directive: Word. (line 6)
+* word directive, ARC: ARC Directives. (line 174)
+* word directive, H8/300: H8/300 Directives. (line 6)
+* word directive, i386: i386-Float. (line 21)
+* word directive, SPARC: Sparc-Directives. (line 51)
+* word directive, TIC54X: TIC54X-Directives. (line 111)
+* word directive, x86-64: i386-Float. (line 21)
+* writing patterns in memory: Fill. (line 6)
+* wval: Z8000 Directives. (line 24)
+* x86 machine directives: i386-Directives. (line 6)
+* x86-64 arch directive: i386-Arch. (line 6)
+* x86-64 att_syntax pseudo op: i386-Syntax. (line 6)
+* x86-64 conversion instructions: i386-Mnemonics. (line 36)
+* x86-64 floating point: i386-Float. (line 6)
+* x86-64 immediate operands: i386-Syntax. (line 15)
+* x86-64 instruction naming: i386-Mnemonics. (line 6)
+* x86-64 intel_syntax pseudo op: i386-Syntax. (line 6)
+* x86-64 jump optimization: i386-Jumps. (line 6)
+* x86-64 jump, call, return: i386-Syntax. (line 38)
+* x86-64 jump/call operands: i386-Syntax. (line 15)
+* x86-64 memory references: i386-Memory. (line 6)
+* x86-64 options: i386-Options. (line 6)
+* x86-64 register operands: i386-Syntax. (line 15)
+* x86-64 registers: i386-Regs. (line 6)
+* x86-64 sections: i386-Syntax. (line 44)
+* x86-64 size suffixes: i386-Syntax. (line 29)
+* x86-64 source, destination operands: i386-Syntax. (line 22)
+* x86-64 support: i386-Dependent. (line 6)
+* x86-64 syntax compatibility: i386-Syntax. (line 6)
+* xfloat directive, TIC54X: TIC54X-Directives. (line 64)
+* xlong directive, TIC54X: TIC54X-Directives. (line 135)
+* Xtensa architecture: Xtensa-Dependent. (line 6)
+* Xtensa assembler syntax: Xtensa Syntax. (line 6)
+* Xtensa directives: Xtensa Directives. (line 6)
+* Xtensa opcode names: Xtensa Opcodes. (line 6)
+* Xtensa register names: Xtensa Registers. (line 6)
+* xword directive, SPARC: Sparc-Directives. (line 55)
+* Z80 $: Z80-Chars. (line 8)
+* Z80 ': Z80-Chars. (line 13)
+* Z80 floating point: Z80 Floating Point. (line 6)
+* Z80 line comment character: Z80-Chars. (line 6)
+* Z80 options: Z80 Options. (line 6)
+* Z80 registers: Z80-Regs. (line 6)
+* Z80 support: Z80-Dependent. (line 6)
+* Z80 Syntax: Z80 Options. (line 47)
+* Z80, \: Z80-Chars. (line 11)
+* Z80, case sensitivity: Z80-Case. (line 6)
+* Z80-only directives: Z80 Directives. (line 9)
+* Z800 addressing modes: Z8000-Addressing. (line 6)
+* Z8000 directives: Z8000 Directives. (line 6)
+* Z8000 line comment character: Z8000-Chars. (line 6)
+* Z8000 line separator: Z8000-Chars. (line 8)
+* Z8000 opcode summary: Z8000 Opcodes. (line 6)
+* Z8000 options: Z8000 Options. (line 6)
+* Z8000 registers: Z8000-Regs. (line 6)
+* Z8000 support: Z8000-Dependent. (line 6)
+* zdaoff pseudo-op, V850: V850 Opcodes. (line 99)
+* zero register, V850: V850-Regs. (line 7)
+* zero-terminated strings: Asciz. (line 6)
+
+
+
+Tag Table:
+Node: Top770
+Node: Overview1756
+Node: Manual30673
+Node: GNU Assembler31617
+Node: Object Formats32788
+Node: Command Line33240
+Node: Input Files34327
+Node: Object36308
+Node: Errors37204
+Node: Invoking38399
+Node: a40354
+Node: alternate42265
+Node: D42437
+Node: f42670
+Node: I43178
+Node: K43722
+Node: L44026
+Node: listing44765
+Node: M46424
+Node: MD50825
+Node: o51251
+Node: R51706
+Node: statistics52736
+Node: traditional-format53143
+Node: v53616
+Node: W53891
+Node: Z54798
+Node: Syntax55320
+Node: Preprocessing55911
+Node: Whitespace57474
+Node: Comments57870
+Node: Symbol Intro60069
+Node: Statements60759
+Node: Constants62680
+Node: Characters63311
+Node: Strings63813
+Node: Chars65979
+Node: Numbers66733
+Node: Integers67273
+Node: Bignums67929
+Node: Flonums68285
+Node: Sections70032
+Node: Secs Background70410
+Node: Ld Sections75449
+Node: As Sections77833
+Node: Sub-Sections78743
+Node: bss81888
+Node: Symbols82838
+Node: Labels83486
+Node: Setting Symbols84217
+Node: Symbol Names84771
+Node: Dot89812
+Node: Symbol Attributes90259
+Node: Symbol Value90996
+Node: Symbol Type92041
+Node: a.out Symbols92429
+Node: Symbol Desc92691
+Node: Symbol Other92986
+Node: COFF Symbols93155
+Node: SOM Symbols93828
+Node: Expressions94270
+Node: Empty Exprs95019
+Node: Integer Exprs95366
+Node: Arguments95761
+Node: Operators96867
+Node: Prefix Ops97202
+Node: Infix Ops97530
+Node: Pseudo Ops99920
+Node: Abort105421
+Node: ABORT (COFF)105833
+Node: Align106041
+Node: Altmacro108323
+Node: Ascii109652
+Node: Asciz109961
+Node: Balign110206
+Node: Byte112069
+Node: CFI directives112317
+Node: Comm117944
+Ref: Comm-Footnote-1119545
+Node: Data119907
+Node: Def120224
+Node: Desc120456
+Node: Dim120956
+Node: Double121213
+Node: Eject121551
+Node: Else121726
+Node: Elseif122026
+Node: End122320
+Node: Endef122535
+Node: Endfunc122712
+Node: Endif122887
+Node: Equ123148
+Node: Equiv123662
+Node: Eqv124218
+Node: Err124582
+Node: Error124893
+Node: Exitm125338
+Node: Extern125507
+Node: Fail125768
+Node: File126213
+Node: Fill127542
+Node: Float128506
+Node: Func128848
+Node: Global129438
+Node: Gnu_attribute130195
+Node: Hidden130420
+Node: hword131006
+Node: Ident131334
+Node: If131908
+Node: Incbin134967
+Node: Include135662
+Node: Int136213
+Node: Internal136594
+Node: Irp137242
+Node: Irpc138121
+Node: Lcomm139038
+Node: Lflags139786
+Node: Line139980
+Node: Linkonce140893
+Node: List142122
+Node: Ln142730
+Node: Loc142880
+Node: Loc_mark_labels144266
+Node: Local144750
+Node: Long145362
+Node: Macro145540
+Node: MRI151462
+Node: Noaltmacro151800
+Node: Nolist151969
+Node: Octa152399
+Node: Org152733
+Node: P2align154016
+Node: PopSection155944
+Node: Previous156452
+Node: Print157865
+Node: Protected158094
+Node: Psize158741
+Node: Purgem159425
+Node: PushSection159646
+Node: Quad160389
+Node: Reloc160845
+Node: Rept161606
+Node: Sbttl162020
+Node: Scl162385
+Node: Section162726
+Node: Set168163
+Node: Short168800
+Node: Single169121
+Node: Size169466
+Node: Skip170140
+Node: Sleb128170464
+Node: Space170788
+Node: Stab171429
+Node: String173433
+Node: Struct174427
+Node: SubSection175152
+Node: Symver175715
+Node: Tag178108
+Node: Text178490
+Node: Title178811
+Node: Type179192
+Node: Uleb128181486
+Node: Val181810
+Node: Version182060
+Node: VTableEntry182335
+Node: VTableInherit182625
+Node: Warning183075
+Node: Weak183309
+Node: Weakref183978
+Node: Word184943
+Node: Deprecated186789
+Node: Object Attributes187024
+Node: GNU Object Attributes188744
+Node: Defining New Object Attributes191297
+Node: Machine Dependencies192094
+Node: Alpha-Dependent195219
+Node: Alpha Notes195633
+Node: Alpha Options195914
+Node: Alpha Syntax198390
+Node: Alpha-Chars198859
+Node: Alpha-Regs199090
+Node: Alpha-Relocs199477
+Node: Alpha Floating Point205735
+Node: Alpha Directives205957
+Node: Alpha Opcodes211480
+Node: ARC-Dependent211775
+Node: ARC Options212158
+Node: ARC Syntax213227
+Node: ARC-Chars213459
+Node: ARC-Regs213591
+Node: ARC Floating Point213715
+Node: ARC Directives214026
+Node: ARC Opcodes219998
+Node: ARM-Dependent220224
+Node: ARM Options220689
+Node: ARM Syntax227822
+Node: ARM-Instruction-Set228136
+Node: ARM-Chars229368
+Node: ARM-Regs229920
+Node: ARM Floating Point230129
+Node: ARM-Relocations230328
+Node: ARM Directives231281
+Ref: arm_pad232145
+Ref: arm_fnend235217
+Ref: arm_fnstart235541
+Ref: arm_save238553
+Ref: arm_setfp239254
+Node: ARM Opcodes242335
+Node: ARM Mapping Symbols244423
+Node: ARM Unwinding Tutorial245233
+Node: AVR-Dependent251435
+Node: AVR Options251725
+Node: AVR Syntax254929
+Node: AVR-Chars255216
+Node: AVR-Regs255622
+Node: AVR-Modifiers256201
+Node: AVR Opcodes258261
+Node: Blackfin-Dependent263507
+Node: Blackfin Options263819
+Node: Blackfin Syntax264677
+Node: Blackfin Directives270410
+Node: CR16-Dependent270829
+Node: CR16 Operand Qualifiers271077
+Node: CRIS-Dependent273718
+Node: CRIS-Opts274064
+Ref: march-option275682
+Node: CRIS-Expand277499
+Node: CRIS-Symbols278682
+Node: CRIS-Syntax279851
+Node: CRIS-Chars280187
+Node: CRIS-Pic280738
+Ref: crispic280934
+Node: CRIS-Regs284474
+Node: CRIS-Pseudos284891
+Ref: crisnous285667
+Node: D10V-Dependent286949
+Node: D10V-Opts287300
+Node: D10V-Syntax288263
+Node: D10V-Size288792
+Node: D10V-Subs289765
+Node: D10V-Chars290800
+Node: D10V-Regs292404
+Node: D10V-Addressing293449
+Node: D10V-Word294135
+Node: D10V-Float294650
+Node: D10V-Opcodes294961
+Node: D30V-Dependent295354
+Node: D30V-Opts295707
+Node: D30V-Syntax296382
+Node: D30V-Size296914
+Node: D30V-Subs297885
+Node: D30V-Chars298920
+Node: D30V-Guarded301218
+Node: D30V-Regs301898
+Node: D30V-Addressing303037
+Node: D30V-Float303705
+Node: D30V-Opcodes304016
+Node: H8/300-Dependent304409
+Node: H8/300 Options304821
+Node: H8/300 Syntax305088
+Node: H8/300-Chars305389
+Node: H8/300-Regs305688
+Node: H8/300-Addressing306607
+Node: H8/300 Floating Point307648
+Node: H8/300 Directives307975
+Node: H8/300 Opcodes309103
+Node: HPPA-Dependent317425
+Node: HPPA Notes317860
+Node: HPPA Options318618
+Node: HPPA Syntax318813
+Node: HPPA Floating Point320083
+Node: HPPA Directives320289
+Node: HPPA Opcodes328975
+Node: ESA/390-Dependent329234
+Node: ESA/390 Notes329694
+Node: ESA/390 Options330485
+Node: ESA/390 Syntax330695
+Node: ESA/390 Floating Point332868
+Node: ESA/390 Directives333147
+Node: ESA/390 Opcodes336436
+Node: i386-Dependent336698
+Node: i386-Options337822
+Node: i386-Directives341789
+Node: i386-Syntax342527
+Node: i386-Mnemonics344960
+Node: i386-Regs348199
+Node: i386-Prefixes350244
+Node: i386-Memory353004
+Node: i386-Jumps355941
+Node: i386-Float357062
+Node: i386-SIMD358893
+Node: i386-16bit360004
+Node: i386-Bugs362044
+Node: i386-Arch362798
+Node: i386-Notes365355
+Node: i860-Dependent366213
+Node: Notes-i860366609
+Node: Options-i860367514
+Node: Directives-i860368877
+Node: Opcodes for i860369946
+Node: i960-Dependent372113
+Node: Options-i960372516
+Node: Floating Point-i960376401
+Node: Directives-i960376669
+Node: Opcodes for i960378703
+Node: callj-i960379320
+Node: Compare-and-branch-i960379809
+Node: IA-64-Dependent381713
+Node: IA-64 Options382014
+Node: IA-64 Syntax385174
+Node: IA-64-Chars385537
+Node: IA-64-Regs385767
+Node: IA-64-Bits386693
+Node: IA-64 Opcodes387202
+Node: IP2K-Dependent387474
+Node: IP2K-Opts387702
+Node: LM32-Dependent388182
+Node: LM32 Options388477
+Node: LM32 Syntax389111
+Node: LM32-Regs389358
+Node: LM32-Modifiers390317
+Node: LM32 Opcodes391673
+Node: M32C-Dependent391977
+Node: M32C-Opts392501
+Node: M32C-Modifiers392924
+Node: M32R-Dependent394711
+Node: M32R-Opts395032
+Node: M32R-Directives399199
+Node: M32R-Warnings403174
+Node: M68K-Dependent406180
+Node: M68K-Opts406647
+Node: M68K-Syntax414039
+Node: M68K-Moto-Syntax415879
+Node: M68K-Float418469
+Node: M68K-Directives418989
+Node: M68K-opcodes420317
+Node: M68K-Branch420543
+Node: M68K-Chars424741
+Node: M68HC11-Dependent425154
+Node: M68HC11-Opts425691
+Node: M68HC11-Syntax429512
+Node: M68HC11-Modifiers431726
+Node: M68HC11-Directives433554
+Node: M68HC11-Float434930
+Node: M68HC11-opcodes435458
+Node: M68HC11-Branch435640
+Node: MicroBlaze-Dependent438089
+Node: MicroBlaze Directives438719
+Node: MIPS-Dependent440076
+Node: MIPS Opts441239
+Node: MIPS Object450983
+Node: MIPS Stabs452549
+Node: MIPS symbol sizes453271
+Node: MIPS ISA454940
+Node: MIPS autoextend456414
+Node: MIPS insn457144
+Node: MIPS option stack458414
+Node: MIPS ASE instruction generation overrides459188
+Node: MIPS floating-point461002
+Node: MMIX-Dependent461888
+Node: MMIX-Opts462268
+Node: MMIX-Expand465872
+Node: MMIX-Syntax467187
+Ref: mmixsite467544
+Node: MMIX-Chars468385
+Node: MMIX-Symbols469039
+Node: MMIX-Regs471107
+Node: MMIX-Pseudos472132
+Ref: MMIX-loc472273
+Ref: MMIX-local473353
+Ref: MMIX-is473885
+Ref: MMIX-greg474156
+Ref: GREG-base475075
+Ref: MMIX-byte476392
+Ref: MMIX-constants476863
+Ref: MMIX-prefix477509
+Ref: MMIX-spec477883
+Node: MMIX-mmixal478217
+Node: MSP430-Dependent481715
+Node: MSP430 Options482181
+Node: MSP430 Syntax482467
+Node: MSP430-Macros482783
+Node: MSP430-Chars483514
+Node: MSP430-Regs483827
+Node: MSP430-Ext484387
+Node: MSP430 Floating Point486208
+Node: MSP430 Directives486432
+Node: MSP430 Opcodes487223
+Node: MSP430 Profiling Capability487618
+Node: PDP-11-Dependent489947
+Node: PDP-11-Options490336
+Node: PDP-11-Pseudos495407
+Node: PDP-11-Syntax495752
+Node: PDP-11-Mnemonics496504
+Node: PDP-11-Synthetic496806
+Node: PJ-Dependent497024
+Node: PJ Options497249
+Node: PPC-Dependent497526
+Node: PowerPC-Opts497813
+Node: PowerPC-Pseudo500365
+Node: S/390-Dependent500964
+Node: s390 Options501667
+Node: s390 Characters503205
+Node: s390 Syntax503398
+Node: s390 Register504299
+Node: s390 Mnemonics505112
+Node: s390 Operands508132
+Node: s390 Formats510751
+Node: s390 Aliases518622
+Node: s390 Operand Modifier522519
+Node: s390 Instruction Marker526320
+Node: s390 Literal Pool Entries527336
+Node: s390 Directives529259
+Node: s390 Floating Point533174
+Node: SCORE-Dependent533620
+Node: SCORE-Opts533894
+Node: SCORE-Pseudo535182
+Node: SH-Dependent537238
+Node: SH Options537650
+Node: SH Syntax538658
+Node: SH-Chars538931
+Node: SH-Regs539225
+Node: SH-Addressing539839
+Node: SH Floating Point540748
+Node: SH Directives541842
+Node: SH Opcodes542212
+Node: SH64-Dependent546534
+Node: SH64 Options546897
+Node: SH64 Syntax548694
+Node: SH64-Chars548977
+Node: SH64-Regs549277
+Node: SH64-Addressing550373
+Node: SH64 Directives551556
+Node: SH64 Opcodes552666
+Node: Sparc-Dependent553382
+Node: Sparc-Opts553794
+Node: Sparc-Aligned-Data556051
+Node: Sparc-Syntax556883
+Node: Sparc-Chars557457
+Node: Sparc-Regs557690
+Node: Sparc-Constants562801
+Node: Sparc-Relocs567561
+Node: Sparc-Size-Translations572241
+Node: Sparc-Float573890
+Node: Sparc-Directives574085
+Node: TIC54X-Dependent576045
+Node: TIC54X-Opts576771
+Node: TIC54X-Block577814
+Node: TIC54X-Env578174
+Node: TIC54X-Constants578522
+Node: TIC54X-Subsyms578924
+Node: TIC54X-Locals580833
+Node: TIC54X-Builtins581577
+Node: TIC54X-Ext584048
+Node: TIC54X-Directives584619
+Node: TIC54X-Macros595521
+Node: TIC54X-MMRegs597632
+Node: Z80-Dependent597848
+Node: Z80 Options598236
+Node: Z80 Syntax599659
+Node: Z80-Chars600331
+Node: Z80-Regs600865
+Node: Z80-Case601217
+Node: Z80 Floating Point601662
+Node: Z80 Directives601856
+Node: Z80 Opcodes603481
+Node: Z8000-Dependent604825
+Node: Z8000 Options605786
+Node: Z8000 Syntax606003
+Node: Z8000-Chars606293
+Node: Z8000-Regs606526
+Node: Z8000-Addressing607316
+Node: Z8000 Directives608433
+Node: Z8000 Opcodes610042
+Node: Vax-Dependent619984
+Node: VAX-Opts620501
+Node: VAX-float624236
+Node: VAX-directives624868
+Node: VAX-opcodes625729
+Node: VAX-branch626118
+Node: VAX-operands628625
+Node: VAX-no629388
+Node: V850-Dependent629625
+Node: V850 Options630023
+Node: V850 Syntax632412
+Node: V850-Chars632652
+Node: V850-Regs632817
+Node: V850 Floating Point634385
+Node: V850 Directives634591
+Node: V850 Opcodes635734
+Node: Xtensa-Dependent641626
+Node: Xtensa Options642355
+Node: Xtensa Syntax645165
+Node: Xtensa Opcodes647054
+Node: Xtensa Registers648848
+Node: Xtensa Optimizations649481
+Node: Density Instructions649933
+Node: Xtensa Automatic Alignment651035
+Node: Xtensa Relaxation653482
+Node: Xtensa Branch Relaxation654390
+Node: Xtensa Call Relaxation655762
+Node: Xtensa Immediate Relaxation657548
+Node: Xtensa Directives660122
+Node: Schedule Directive661831
+Node: Longcalls Directive662171
+Node: Transform Directive662715
+Node: Literal Directive663457
+Ref: Literal Directive-Footnote-1666996
+Node: Literal Position Directive667138
+Node: Literal Prefix Directive668837
+Node: Absolute Literals Directive669735
+Node: Reporting Bugs671042
+Node: Bug Criteria671768
+Node: Bug Reporting672535
+Node: Acknowledgements679184
+Ref: Acknowledgements-Footnote-1684150
+Node: GNU Free Documentation License684176
+Node: AS Index709345
+
+End Tag Table
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/bfd.info b/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/bfd.info
new file mode 100644
index 0000000..576f2c5
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/bfd.info
@@ -0,0 +1,11288 @@
+This is bfd.info, produced by makeinfo version 4.8 from bfd.texinfo.
+
+START-INFO-DIR-ENTRY
+* Bfd: (bfd). The Binary File Descriptor library.
+END-INFO-DIR-ENTRY
+
+ This file documents the BFD library.
+
+ Copyright (C) 1991, 2000, 2001, 2003, 2006, 2007, 2008 Free Software
+Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.3 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being "GNU General Public License" and "Funding Free
+Software", the Front-Cover texts being (a) (see below), and with the
+Back-Cover Texts being (b) (see below). A copy of the license is
+included in the section entitled "GNU Free Documentation License".
+
+ (a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+ (b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+software. Copies published by the Free Software Foundation raise
+funds for GNU development.
+
+
+File: bfd.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir)
+
+ This file documents the binary file descriptor library libbfd.
+
+* Menu:
+
+* Overview:: Overview of BFD
+* BFD front end:: BFD front end
+* BFD back ends:: BFD back ends
+* GNU Free Documentation License:: GNU Free Documentation License
+* BFD Index:: BFD Index
+
+
+File: bfd.info, Node: Overview, Next: BFD front end, Prev: Top, Up: Top
+
+1 Introduction
+**************
+
+BFD is a package which allows applications to use the same routines to
+operate on object files whatever the object file format. A new object
+file format can be supported simply by creating a new BFD back end and
+adding it to the library.
+
+ BFD is split into two parts: the front end, and the back ends (one
+for each object file format).
+ * The front end of BFD provides the interface to the user. It manages
+ memory and various canonical data structures. The front end also
+ decides which back end to use and when to call back end routines.
+
+ * The back ends provide BFD its view of the real world. Each back
+ end provides a set of calls which the BFD front end can use to
+ maintain its canonical form. The back ends also may keep around
+ information for their own use, for greater efficiency.
+
+* Menu:
+
+* History:: History
+* How It Works:: How It Works
+* What BFD Version 2 Can Do:: What BFD Version 2 Can Do
+
+
+File: bfd.info, Node: History, Next: How It Works, Prev: Overview, Up: Overview
+
+1.1 History
+===========
+
+One spur behind BFD was the desire, on the part of the GNU 960 team at
+Intel Oregon, for interoperability of applications on their COFF and
+b.out file formats. Cygnus was providing GNU support for the team, and
+was contracted to provide the required functionality.
+
+ The name came from a conversation David Wallace was having with
+Richard Stallman about the library: RMS said that it would be quite
+hard--David said "BFD". Stallman was right, but the name stuck.
+
+ At the same time, Ready Systems wanted much the same thing, but for
+different object file formats: IEEE-695, Oasys, Srecords, a.out and 68k
+coff.
+
+ BFD was first implemented by members of Cygnus Support; Steve
+Chamberlain (`sac@cygnus.com'), John Gilmore (`gnu@cygnus.com'), K.
+Richard Pixley (`rich@cygnus.com') and David Henkel-Wallace
+(`gumby@cygnus.com').
+
+
+File: bfd.info, Node: How It Works, Next: What BFD Version 2 Can Do, Prev: History, Up: Overview
+
+1.2 How To Use BFD
+==================
+
+To use the library, include `bfd.h' and link with `libbfd.a'.
+
+ BFD provides a common interface to the parts of an object file for a
+calling application.
+
+ When an application successfully opens a target file (object,
+archive, or whatever), a pointer to an internal structure is returned.
+This pointer points to a structure called `bfd', described in `bfd.h'.
+Our convention is to call this pointer a BFD, and instances of it
+within code `abfd'. All operations on the target object file are
+applied as methods to the BFD. The mapping is defined within `bfd.h'
+in a set of macros, all beginning with `bfd_' to reduce namespace
+pollution.
+
+ For example, this sequence does what you would probably expect:
+return the number of sections in an object file attached to a BFD
+`abfd'.
+
+ #include "bfd.h"
+
+ unsigned int number_of_sections (abfd)
+ bfd *abfd;
+ {
+ return bfd_count_sections (abfd);
+ }
+
+ The abstraction used within BFD is that an object file has:
+
+ * a header,
+
+ * a number of sections containing raw data (*note Sections::),
+
+ * a set of relocations (*note Relocations::), and
+
+ * some symbol information (*note Symbols::).
+ Also, BFDs opened for archives have the additional attribute of an
+index and contain subordinate BFDs. This approach is fine for a.out and
+coff, but loses efficiency when applied to formats such as S-records and
+IEEE-695.
+
+
+File: bfd.info, Node: What BFD Version 2 Can Do, Prev: How It Works, Up: Overview
+
+1.3 What BFD Version 2 Can Do
+=============================
+
+When an object file is opened, BFD subroutines automatically determine
+the format of the input object file. They then build a descriptor in
+memory with pointers to routines that will be used to access elements of
+the object file's data structures.
+
+ As different information from the object files is required, BFD
+reads from different sections of the file and processes them. For
+example, a very common operation for the linker is processing symbol
+tables. Each BFD back end provides a routine for converting between
+the object file's representation of symbols and an internal canonical
+format. When the linker asks for the symbol table of an object file, it
+calls through a memory pointer to the routine from the relevant BFD
+back end which reads and converts the table into a canonical form. The
+linker then operates upon the canonical form. When the link is finished
+and the linker writes the output file's symbol table, another BFD back
+end routine is called to take the newly created symbol table and
+convert it into the chosen output format.
+
+* Menu:
+
+* BFD information loss:: Information Loss
+* Canonical format:: The BFD canonical object-file format
+
+
+File: bfd.info, Node: BFD information loss, Next: Canonical format, Up: What BFD Version 2 Can Do
+
+1.3.1 Information Loss
+----------------------
+
+_Information can be lost during output._ The output formats supported
+by BFD do not provide identical facilities, and information which can
+be described in one form has nowhere to go in another format. One
+example of this is alignment information in `b.out'. There is nowhere
+in an `a.out' format file to store alignment information on the
+contained data, so when a file is linked from `b.out' and an `a.out'
+image is produced, alignment information will not propagate to the
+output file. (The linker will still use the alignment information
+internally, so the link is performed correctly).
+
+ Another example is COFF section names. COFF files may contain an
+unlimited number of sections, each one with a textual section name. If
+the target of the link is a format which does not have many sections
+(e.g., `a.out') or has sections without names (e.g., the Oasys format),
+the link cannot be done simply. You can circumvent this problem by
+describing the desired input-to-output section mapping with the linker
+command language.
+
+ _Information can be lost during canonicalization._ The BFD internal
+canonical form of the external formats is not exhaustive; there are
+structures in input formats for which there is no direct representation
+internally. This means that the BFD back ends cannot maintain all
+possible data richness through the transformation between external to
+internal and back to external formats.
+
+ This limitation is only a problem when an application reads one
+format and writes another. Each BFD back end is responsible for
+maintaining as much data as possible, and the internal BFD canonical
+form has structures which are opaque to the BFD core, and exported only
+to the back ends. When a file is read in one format, the canonical form
+is generated for BFD and the application. At the same time, the back
+end saves away any information which may otherwise be lost. If the data
+is then written back in the same format, the back end routine will be
+able to use the canonical form provided by the BFD core as well as the
+information it prepared earlier. Since there is a great deal of
+commonality between back ends, there is no information lost when
+linking or copying big endian COFF to little endian COFF, or `a.out' to
+`b.out'. When a mixture of formats is linked, the information is only
+lost from the files whose format differs from the destination.
+
+
+File: bfd.info, Node: Canonical format, Prev: BFD information loss, Up: What BFD Version 2 Can Do
+
+1.3.2 The BFD canonical object-file format
+------------------------------------------
+
+The greatest potential for loss of information occurs when there is the
+least overlap between the information provided by the source format,
+that stored by the canonical format, and that needed by the destination
+format. A brief description of the canonical form may help you
+understand which kinds of data you can count on preserving across
+conversions.
+
+_files_
+ Information stored on a per-file basis includes target machine
+ architecture, particular implementation format type, a demand
+ pageable bit, and a write protected bit. Information like Unix
+ magic numbers is not stored here--only the magic numbers' meaning,
+ so a `ZMAGIC' file would have both the demand pageable bit and the
+ write protected text bit set. The byte order of the target is
+ stored on a per-file basis, so that big- and little-endian object
+ files may be used with one another.
+
+_sections_
+ Each section in the input file contains the name of the section,
+ the section's original address in the object file, size and
+ alignment information, various flags, and pointers into other BFD
+ data structures.
+
+_symbols_
+ Each symbol contains a pointer to the information for the object
+ file which originally defined it, its name, its value, and various
+ flag bits. When a BFD back end reads in a symbol table, it
+ relocates all symbols to make them relative to the base of the
+ section where they were defined. Doing this ensures that each
+ symbol points to its containing section. Each symbol also has a
+ varying amount of hidden private data for the BFD back end. Since
+ the symbol points to the original file, the private data format
+ for that symbol is accessible. `ld' can operate on a collection
+ of symbols of wildly different formats without problems.
+
+ Normal global and simple local symbols are maintained on output,
+ so an output file (no matter its format) will retain symbols
+ pointing to functions and to global, static, and common variables.
+ Some symbol information is not worth retaining; in `a.out', type
+ information is stored in the symbol table as long symbol names.
+ This information would be useless to most COFF debuggers; the
+ linker has command line switches to allow users to throw it away.
+
+ There is one word of type information within the symbol, so if the
+ format supports symbol type information within symbols (for
+ example, COFF, IEEE, Oasys) and the type is simple enough to fit
+ within one word (nearly everything but aggregates), the
+ information will be preserved.
+
+_relocation level_
+ Each canonical BFD relocation record contains a pointer to the
+ symbol to relocate to, the offset of the data to relocate, the
+ section the data is in, and a pointer to a relocation type
+ descriptor. Relocation is performed by passing messages through
+ the relocation type descriptor and the symbol pointer. Therefore,
+ relocations can be performed on output data using a relocation
+ method that is only available in one of the input formats. For
+ instance, Oasys provides a byte relocation format. A relocation
+ record requesting this relocation type would point indirectly to a
+ routine to perform this, so the relocation may be performed on a
+ byte being written to a 68k COFF file, even though 68k COFF has no
+ such relocation type.
+
+_line numbers_
+ Object formats can contain, for debugging purposes, some form of
+ mapping between symbols, source line numbers, and addresses in the
+ output file. These addresses have to be relocated along with the
+ symbol information. Each symbol with an associated list of line
+ number records points to the first record of the list. The head
+ of a line number list consists of a pointer to the symbol, which
+ allows finding out the address of the function whose line number
+ is being described. The rest of the list is made up of pairs:
+ offsets into the section and line numbers. Any format which can
+ simply derive this information can pass it successfully between
+ formats (COFF, IEEE and Oasys).
+
+
+File: bfd.info, Node: BFD front end, Next: BFD back ends, Prev: Overview, Up: Top
+
+2 BFD Front End
+***************
+
+2.1 `typedef bfd'
+=================
+
+A BFD has type `bfd'; objects of this type are the cornerstone of any
+application using BFD. Using BFD consists of making references though
+the BFD and to data in the BFD.
+
+ Here is the structure that defines the type `bfd'. It contains the
+major data about the file and pointers to the rest of the data.
+
+
+ enum bfd_direction
+ {
+ no_direction = 0,
+ read_direction = 1,
+ write_direction = 2,
+ both_direction = 3
+ };
+
+ struct bfd
+ {
+ /* A unique identifier of the BFD */
+ unsigned int id;
+
+ /* The filename the application opened the BFD with. */
+ const char *filename;
+
+ /* A pointer to the target jump table. */
+ const struct bfd_target *xvec;
+
+ /* The IOSTREAM, and corresponding IO vector that provide access
+ to the file backing the BFD. */
+ void *iostream;
+ const struct bfd_iovec *iovec;
+
+ /* The caching routines use these to maintain a
+ least-recently-used list of BFDs. */
+ struct bfd *lru_prev, *lru_next;
+
+ /* When a file is closed by the caching routines, BFD retains
+ state information on the file here... */
+ ufile_ptr where;
+
+ /* File modified time, if mtime_set is TRUE. */
+ long mtime;
+
+ /* Reserved for an unimplemented file locking extension. */
+ int ifd;
+
+ /* The format which belongs to the BFD. (object, core, etc.) */
+ bfd_format format;
+
+ /* The direction with which the BFD was opened. */
+ enum bfd_direction direction;
+
+ /* Format_specific flags. */
+ flagword flags;
+
+ /* Values that may appear in the flags field of a BFD. These also
+ appear in the object_flags field of the bfd_target structure, where
+ they indicate the set of flags used by that backend (not all flags
+ are meaningful for all object file formats) (FIXME: at the moment,
+ the object_flags values have mostly just been copied from backend
+ to another, and are not necessarily correct). */
+
+ #define BFD_NO_FLAGS 0x00
+
+ /* BFD contains relocation entries. */
+ #define HAS_RELOC 0x01
+
+ /* BFD is directly executable. */
+ #define EXEC_P 0x02
+
+ /* BFD has line number information (basically used for F_LNNO in a
+ COFF header). */
+ #define HAS_LINENO 0x04
+
+ /* BFD has debugging information. */
+ #define HAS_DEBUG 0x08
+
+ /* BFD has symbols. */
+ #define HAS_SYMS 0x10
+
+ /* BFD has local symbols (basically used for F_LSYMS in a COFF
+ header). */
+ #define HAS_LOCALS 0x20
+
+ /* BFD is a dynamic object. */
+ #define DYNAMIC 0x40
+
+ /* Text section is write protected (if D_PAGED is not set, this is
+ like an a.out NMAGIC file) (the linker sets this by default, but
+ clears it for -r or -N). */
+ #define WP_TEXT 0x80
+
+ /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
+ linker sets this by default, but clears it for -r or -n or -N). */
+ #define D_PAGED 0x100
+
+ /* BFD is relaxable (this means that bfd_relax_section may be able to
+ do something) (sometimes bfd_relax_section can do something even if
+ this is not set). */
+ #define BFD_IS_RELAXABLE 0x200
+
+ /* This may be set before writing out a BFD to request using a
+ traditional format. For example, this is used to request that when
+ writing out an a.out object the symbols not be hashed to eliminate
+ duplicates. */
+ #define BFD_TRADITIONAL_FORMAT 0x400
+
+ /* This flag indicates that the BFD contents are actually cached
+ in memory. If this is set, iostream points to a bfd_in_memory
+ struct. */
+ #define BFD_IN_MEMORY 0x800
+
+ /* The sections in this BFD specify a memory page. */
+ #define HAS_LOAD_PAGE 0x1000
+
+ /* This BFD has been created by the linker and doesn't correspond
+ to any input file. */
+ #define BFD_LINKER_CREATED 0x2000
+
+ /* This may be set before writing out a BFD to request that it
+ be written using values for UIDs, GIDs, timestamps, etc. that
+ will be consistent from run to run. */
+ #define BFD_DETERMINISTIC_OUTPUT 0x4000
+
+ /* Currently my_archive is tested before adding origin to
+ anything. I believe that this can become always an add of
+ origin, with origin set to 0 for non archive files. */
+ ufile_ptr origin;
+
+ /* The origin in the archive of the proxy entry. This will
+ normally be the same as origin, except for thin archives,
+ when it will contain the current offset of the proxy in the
+ thin archive rather than the offset of the bfd in its actual
+ container. */
+ ufile_ptr proxy_origin;
+
+ /* A hash table for section names. */
+ struct bfd_hash_table section_htab;
+
+ /* Pointer to linked list of sections. */
+ struct bfd_section *sections;
+
+ /* The last section on the section list. */
+ struct bfd_section *section_last;
+
+ /* The number of sections. */
+ unsigned int section_count;
+
+ /* Stuff only useful for object files:
+ The start address. */
+ bfd_vma start_address;
+
+ /* Used for input and output. */
+ unsigned int symcount;
+
+ /* Symbol table for output BFD (with symcount entries).
+ Also used by the linker to cache input BFD symbols. */
+ struct bfd_symbol **outsymbols;
+
+ /* Used for slurped dynamic symbol tables. */
+ unsigned int dynsymcount;
+
+ /* Pointer to structure which contains architecture information. */
+ const struct bfd_arch_info *arch_info;
+
+ /* Stuff only useful for archives. */
+ void *arelt_data;
+ struct bfd *my_archive; /* The containing archive BFD. */
+ struct bfd *archive_next; /* The next BFD in the archive. */
+ struct bfd *archive_head; /* The first BFD in the archive. */
+ struct bfd *nested_archives; /* List of nested archive in a flattened
+ thin archive. */
+
+ /* A chain of BFD structures involved in a link. */
+ struct bfd *link_next;
+
+ /* A field used by _bfd_generic_link_add_archive_symbols. This will
+ be used only for archive elements. */
+ int archive_pass;
+
+ /* Used by the back end to hold private data. */
+ union
+ {
+ struct aout_data_struct *aout_data;
+ struct artdata *aout_ar_data;
+ struct _oasys_data *oasys_obj_data;
+ struct _oasys_ar_data *oasys_ar_data;
+ struct coff_tdata *coff_obj_data;
+ struct pe_tdata *pe_obj_data;
+ struct xcoff_tdata *xcoff_obj_data;
+ struct ecoff_tdata *ecoff_obj_data;
+ struct ieee_data_struct *ieee_data;
+ struct ieee_ar_data_struct *ieee_ar_data;
+ struct srec_data_struct *srec_data;
+ struct verilog_data_struct *verilog_data;
+ struct ihex_data_struct *ihex_data;
+ struct tekhex_data_struct *tekhex_data;
+ struct elf_obj_tdata *elf_obj_data;
+ struct nlm_obj_tdata *nlm_obj_data;
+ struct bout_data_struct *bout_data;
+ struct mmo_data_struct *mmo_data;
+ struct sun_core_struct *sun_core_data;
+ struct sco5_core_struct *sco5_core_data;
+ struct trad_core_struct *trad_core_data;
+ struct som_data_struct *som_data;
+ struct hpux_core_struct *hpux_core_data;
+ struct hppabsd_core_struct *hppabsd_core_data;
+ struct sgi_core_struct *sgi_core_data;
+ struct lynx_core_struct *lynx_core_data;
+ struct osf_core_struct *osf_core_data;
+ struct cisco_core_struct *cisco_core_data;
+ struct versados_data_struct *versados_data;
+ struct netbsd_core_struct *netbsd_core_data;
+ struct mach_o_data_struct *mach_o_data;
+ struct mach_o_fat_data_struct *mach_o_fat_data;
+ struct plugin_data_struct *plugin_data;
+ struct bfd_pef_data_struct *pef_data;
+ struct bfd_pef_xlib_data_struct *pef_xlib_data;
+ struct bfd_sym_data_struct *sym_data;
+ void *any;
+ }
+ tdata;
+
+ /* Used by the application to hold private data. */
+ void *usrdata;
+
+ /* Where all the allocated stuff under this BFD goes. This is a
+ struct objalloc *, but we use void * to avoid requiring the inclusion
+ of objalloc.h. */
+ void *memory;
+
+ /* Is the file descriptor being cached? That is, can it be closed as
+ needed, and re-opened when accessed later? */
+ unsigned int cacheable : 1;
+
+ /* Marks whether there was a default target specified when the
+ BFD was opened. This is used to select which matching algorithm
+ to use to choose the back end. */
+ unsigned int target_defaulted : 1;
+
+ /* ... and here: (``once'' means at least once). */
+ unsigned int opened_once : 1;
+
+ /* Set if we have a locally maintained mtime value, rather than
+ getting it from the file each time. */
+ unsigned int mtime_set : 1;
+
+ /* Flag set if symbols from this BFD should not be exported. */
+ unsigned int no_export : 1;
+
+ /* Remember when output has begun, to stop strange things
+ from happening. */
+ unsigned int output_has_begun : 1;
+
+ /* Have archive map. */
+ unsigned int has_armap : 1;
+
+ /* Set if this is a thin archive. */
+ unsigned int is_thin_archive : 1;
+ };
+
+2.2 Error reporting
+===================
+
+Most BFD functions return nonzero on success (check their individual
+documentation for precise semantics). On an error, they call
+`bfd_set_error' to set an error condition that callers can check by
+calling `bfd_get_error'. If that returns `bfd_error_system_call', then
+check `errno'.
+
+ The easiest way to report a BFD error to the user is to use
+`bfd_perror'.
+
+2.2.1 Type `bfd_error_type'
+---------------------------
+
+The values returned by `bfd_get_error' are defined by the enumerated
+type `bfd_error_type'.
+
+
+ typedef enum bfd_error
+ {
+ bfd_error_no_error = 0,
+ bfd_error_system_call,
+ bfd_error_invalid_target,
+ bfd_error_wrong_format,
+ bfd_error_wrong_object_format,
+ bfd_error_invalid_operation,
+ bfd_error_no_memory,
+ bfd_error_no_symbols,
+ bfd_error_no_armap,
+ bfd_error_no_more_archived_files,
+ bfd_error_malformed_archive,
+ bfd_error_file_not_recognized,
+ bfd_error_file_ambiguously_recognized,
+ bfd_error_no_contents,
+ bfd_error_nonrepresentable_section,
+ bfd_error_no_debug_section,
+ bfd_error_bad_value,
+ bfd_error_file_truncated,
+ bfd_error_file_too_big,
+ bfd_error_on_input,
+ bfd_error_invalid_error_code
+ }
+ bfd_error_type;
+
+2.2.1.1 `bfd_get_error'
+.......................
+
+*Synopsis*
+ bfd_error_type bfd_get_error (void);
+ *Description*
+Return the current BFD error condition.
+
+2.2.1.2 `bfd_set_error'
+.......................
+
+*Synopsis*
+ void bfd_set_error (bfd_error_type error_tag, ...);
+ *Description*
+Set the BFD error condition to be ERROR_TAG. If ERROR_TAG is
+bfd_error_on_input, then this function takes two more parameters, the
+input bfd where the error occurred, and the bfd_error_type error.
+
+2.2.1.3 `bfd_errmsg'
+....................
+
+*Synopsis*
+ const char *bfd_errmsg (bfd_error_type error_tag);
+ *Description*
+Return a string describing the error ERROR_TAG, or the system error if
+ERROR_TAG is `bfd_error_system_call'.
+
+2.2.1.4 `bfd_perror'
+....................
+
+*Synopsis*
+ void bfd_perror (const char *message);
+ *Description*
+Print to the standard error stream a string describing the last BFD
+error that occurred, or the last system error if the last BFD error was
+a system call failure. If MESSAGE is non-NULL and non-empty, the error
+string printed is preceded by MESSAGE, a colon, and a space. It is
+followed by a newline.
+
+2.2.2 BFD error handler
+-----------------------
+
+Some BFD functions want to print messages describing the problem. They
+call a BFD error handler function. This function may be overridden by
+the program.
+
+ The BFD error handler acts like printf.
+
+
+ typedef void (*bfd_error_handler_type) (const char *, ...);
+
+2.2.2.1 `bfd_set_error_handler'
+...............................
+
+*Synopsis*
+ bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
+ *Description*
+Set the BFD error handler function. Returns the previous function.
+
+2.2.2.2 `bfd_set_error_program_name'
+....................................
+
+*Synopsis*
+ void bfd_set_error_program_name (const char *);
+ *Description*
+Set the program name to use when printing a BFD error. This is printed
+before the error message followed by a colon and space. The string
+must not be changed after it is passed to this function.
+
+2.2.2.3 `bfd_get_error_handler'
+...............................
+
+*Synopsis*
+ bfd_error_handler_type bfd_get_error_handler (void);
+ *Description*
+Return the BFD error handler function.
+
+2.3 Miscellaneous
+=================
+
+2.3.1 Miscellaneous functions
+-----------------------------
+
+2.3.1.1 `bfd_get_reloc_upper_bound'
+...................................
+
+*Synopsis*
+ long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
+ *Description*
+Return the number of bytes required to store the relocation information
+associated with section SECT attached to bfd ABFD. If an error occurs,
+return -1.
+
+2.3.1.2 `bfd_canonicalize_reloc'
+................................
+
+*Synopsis*
+ long bfd_canonicalize_reloc
+ (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
+ *Description*
+Call the back end associated with the open BFD ABFD and translate the
+external form of the relocation information attached to SEC into the
+internal canonical form. Place the table into memory at LOC, which has
+been preallocated, usually by a call to `bfd_get_reloc_upper_bound'.
+Returns the number of relocs, or -1 on error.
+
+ The SYMS table is also needed for horrible internal magic reasons.
+
+2.3.1.3 `bfd_set_reloc'
+.......................
+
+*Synopsis*
+ void bfd_set_reloc
+ (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
+ *Description*
+Set the relocation pointer and count within section SEC to the values
+REL and COUNT. The argument ABFD is ignored.
+
+2.3.1.4 `bfd_set_file_flags'
+............................
+
+*Synopsis*
+ bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
+ *Description*
+Set the flag word in the BFD ABFD to the value FLAGS.
+
+ Possible errors are:
+ * `bfd_error_wrong_format' - The target bfd was not of object format.
+
+ * `bfd_error_invalid_operation' - The target bfd was open for
+ reading.
+
+ * `bfd_error_invalid_operation' - The flag word contained a bit
+ which was not applicable to the type of file. E.g., an attempt
+ was made to set the `D_PAGED' bit on a BFD format which does not
+ support demand paging.
+
+2.3.1.5 `bfd_get_arch_size'
+...........................
+
+*Synopsis*
+ int bfd_get_arch_size (bfd *abfd);
+ *Description*
+Returns the architecture address size, in bits, as determined by the
+object file's format. For ELF, this information is included in the
+header.
+
+ *Returns*
+Returns the arch size in bits if known, `-1' otherwise.
+
+2.3.1.6 `bfd_get_sign_extend_vma'
+.................................
+
+*Synopsis*
+ int bfd_get_sign_extend_vma (bfd *abfd);
+ *Description*
+Indicates if the target architecture "naturally" sign extends an
+address. Some architectures implicitly sign extend address values when
+they are converted to types larger than the size of an address. For
+instance, bfd_get_start_address() will return an address sign extended
+to fill a bfd_vma when this is the case.
+
+ *Returns*
+Returns `1' if the target architecture is known to sign extend
+addresses, `0' if the target architecture is known to not sign extend
+addresses, and `-1' otherwise.
+
+2.3.1.7 `bfd_set_start_address'
+...............................
+
+*Synopsis*
+ bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
+ *Description*
+Make VMA the entry point of output BFD ABFD.
+
+ *Returns*
+Returns `TRUE' on success, `FALSE' otherwise.
+
+2.3.1.8 `bfd_get_gp_size'
+.........................
+
+*Synopsis*
+ unsigned int bfd_get_gp_size (bfd *abfd);
+ *Description*
+Return the maximum size of objects to be optimized using the GP
+register under MIPS ECOFF. This is typically set by the `-G' argument
+to the compiler, assembler or linker.
+
+2.3.1.9 `bfd_set_gp_size'
+.........................
+
+*Synopsis*
+ void bfd_set_gp_size (bfd *abfd, unsigned int i);
+ *Description*
+Set the maximum size of objects to be optimized using the GP register
+under ECOFF or MIPS ELF. This is typically set by the `-G' argument to
+the compiler, assembler or linker.
+
+2.3.1.10 `bfd_scan_vma'
+.......................
+
+*Synopsis*
+ bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
+ *Description*
+Convert, like `strtoul', a numerical expression STRING into a `bfd_vma'
+integer, and return that integer. (Though without as many bells and
+whistles as `strtoul'.) The expression is assumed to be unsigned
+(i.e., positive). If given a BASE, it is used as the base for
+conversion. A base of 0 causes the function to interpret the string in
+hex if a leading "0x" or "0X" is found, otherwise in octal if a leading
+zero is found, otherwise in decimal.
+
+ If the value would overflow, the maximum `bfd_vma' value is returned.
+
+2.3.1.11 `bfd_copy_private_header_data'
+.......................................
+
+*Synopsis*
+ bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
+ *Description*
+Copy private BFD header information from the BFD IBFD to the the BFD
+OBFD. This copies information that may require sections to exist, but
+does not require symbol tables. Return `true' on success, `false' on
+error. Possible error returns are:
+
+ * `bfd_error_no_memory' - Not enough memory exists to create private
+ data for OBFD.
+
+ #define bfd_copy_private_header_data(ibfd, obfd) \
+ BFD_SEND (obfd, _bfd_copy_private_header_data, \
+ (ibfd, obfd))
+
+2.3.1.12 `bfd_copy_private_bfd_data'
+....................................
+
+*Synopsis*
+ bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
+ *Description*
+Copy private BFD information from the BFD IBFD to the the BFD OBFD.
+Return `TRUE' on success, `FALSE' on error. Possible error returns are:
+
+ * `bfd_error_no_memory' - Not enough memory exists to create private
+ data for OBFD.
+
+ #define bfd_copy_private_bfd_data(ibfd, obfd) \
+ BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
+ (ibfd, obfd))
+
+2.3.1.13 `bfd_merge_private_bfd_data'
+.....................................
+
+*Synopsis*
+ bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd);
+ *Description*
+Merge private BFD information from the BFD IBFD to the the output file
+BFD OBFD when linking. Return `TRUE' on success, `FALSE' on error.
+Possible error returns are:
+
+ * `bfd_error_no_memory' - Not enough memory exists to create private
+ data for OBFD.
+
+ #define bfd_merge_private_bfd_data(ibfd, obfd) \
+ BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
+ (ibfd, obfd))
+
+2.3.1.14 `bfd_set_private_flags'
+................................
+
+*Synopsis*
+ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
+ *Description*
+Set private BFD flag information in the BFD ABFD. Return `TRUE' on
+success, `FALSE' on error. Possible error returns are:
+
+ * `bfd_error_no_memory' - Not enough memory exists to create private
+ data for OBFD.
+
+ #define bfd_set_private_flags(abfd, flags) \
+ BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
+
+2.3.1.15 `Other functions'
+..........................
+
+*Description*
+The following functions exist but have not yet been documented.
+ #define bfd_sizeof_headers(abfd, info) \
+ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
+
+ #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
+ BFD_SEND (abfd, _bfd_find_nearest_line, \
+ (abfd, sec, syms, off, file, func, line))
+
+ #define bfd_find_line(abfd, syms, sym, file, line) \
+ BFD_SEND (abfd, _bfd_find_line, \
+ (abfd, syms, sym, file, line))
+
+ #define bfd_find_inliner_info(abfd, file, func, line) \
+ BFD_SEND (abfd, _bfd_find_inliner_info, \
+ (abfd, file, func, line))
+
+ #define bfd_debug_info_start(abfd) \
+ BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
+
+ #define bfd_debug_info_end(abfd) \
+ BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
+
+ #define bfd_debug_info_accumulate(abfd, section) \
+ BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
+
+ #define bfd_stat_arch_elt(abfd, stat) \
+ BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
+
+ #define bfd_update_armap_timestamp(abfd) \
+ BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
+
+ #define bfd_set_arch_mach(abfd, arch, mach)\
+ BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
+
+ #define bfd_relax_section(abfd, section, link_info, again) \
+ BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
+
+ #define bfd_gc_sections(abfd, link_info) \
+ BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
+
+ #define bfd_merge_sections(abfd, link_info) \
+ BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
+
+ #define bfd_is_group_section(abfd, sec) \
+ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
+
+ #define bfd_discard_group(abfd, sec) \
+ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
+
+ #define bfd_link_hash_table_create(abfd) \
+ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
+
+ #define bfd_link_hash_table_free(abfd, hash) \
+ BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))
+
+ #define bfd_link_add_symbols(abfd, info) \
+ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
+
+ #define bfd_link_just_syms(abfd, sec, info) \
+ BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
+
+ #define bfd_final_link(abfd, info) \
+ BFD_SEND (abfd, _bfd_final_link, (abfd, info))
+
+ #define bfd_free_cached_info(abfd) \
+ BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
+
+ #define bfd_get_dynamic_symtab_upper_bound(abfd) \
+ BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
+
+ #define bfd_print_private_bfd_data(abfd, file)\
+ BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
+
+ #define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
+ BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
+
+ #define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
+ BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
+ dyncount, dynsyms, ret))
+
+ #define bfd_get_dynamic_reloc_upper_bound(abfd) \
+ BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
+
+ #define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
+ BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
+
+ extern bfd_byte *bfd_get_relocated_section_contents
+ (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
+ bfd_boolean, asymbol **);
+
+2.3.1.16 `bfd_alt_mach_code'
+............................
+
+*Synopsis*
+ bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
+ *Description*
+When more than one machine code number is available for the same
+machine type, this function can be used to switch between the preferred
+one (alternative == 0) and any others. Currently, only ELF supports
+this feature, with up to two alternate machine codes.
+
+ struct bfd_preserve
+ {
+ void *marker;
+ void *tdata;
+ flagword flags;
+ const struct bfd_arch_info *arch_info;
+ struct bfd_section *sections;
+ struct bfd_section *section_last;
+ unsigned int section_count;
+ struct bfd_hash_table section_htab;
+ };
+
+2.3.1.17 `bfd_preserve_save'
+............................
+
+*Synopsis*
+ bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *);
+ *Description*
+When testing an object for compatibility with a particular target
+back-end, the back-end object_p function needs to set up certain fields
+in the bfd on successfully recognizing the object. This typically
+happens in a piecemeal fashion, with failures possible at many points.
+On failure, the bfd is supposed to be restored to its initial state,
+which is virtually impossible. However, restoring a subset of the bfd
+state works in practice. This function stores the subset and
+reinitializes the bfd.
+
+2.3.1.18 `bfd_preserve_restore'
+...............................
+
+*Synopsis*
+ void bfd_preserve_restore (bfd *, struct bfd_preserve *);
+ *Description*
+This function restores bfd state saved by bfd_preserve_save. If MARKER
+is non-NULL in struct bfd_preserve then that block and all subsequently
+bfd_alloc'd memory is freed.
+
+2.3.1.19 `bfd_preserve_finish'
+..............................
+
+*Synopsis*
+ void bfd_preserve_finish (bfd *, struct bfd_preserve *);
+ *Description*
+This function should be called when the bfd state saved by
+bfd_preserve_save is no longer needed. ie. when the back-end object_p
+function returns with success.
+
+2.3.1.20 `bfd_emul_get_maxpagesize'
+...................................
+
+*Synopsis*
+ bfd_vma bfd_emul_get_maxpagesize (const char *);
+ *Description*
+Returns the maximum page size, in bytes, as determined by emulation.
+
+ *Returns*
+Returns the maximum page size in bytes for ELF, 0 otherwise.
+
+2.3.1.21 `bfd_emul_set_maxpagesize'
+...................................
+
+*Synopsis*
+ void bfd_emul_set_maxpagesize (const char *, bfd_vma);
+ *Description*
+For ELF, set the maximum page size for the emulation. It is a no-op
+for other formats.
+
+2.3.1.22 `bfd_emul_get_commonpagesize'
+......................................
+
+*Synopsis*
+ bfd_vma bfd_emul_get_commonpagesize (const char *);
+ *Description*
+Returns the common page size, in bytes, as determined by emulation.
+
+ *Returns*
+Returns the common page size in bytes for ELF, 0 otherwise.
+
+2.3.1.23 `bfd_emul_set_commonpagesize'
+......................................
+
+*Synopsis*
+ void bfd_emul_set_commonpagesize (const char *, bfd_vma);
+ *Description*
+For ELF, set the common page size for the emulation. It is a no-op for
+other formats.
+
+2.3.1.24 `bfd_demangle'
+.......................
+
+*Synopsis*
+ char *bfd_demangle (bfd *, const char *, int);
+ *Description*
+Wrapper around cplus_demangle. Strips leading underscores and other
+such chars that would otherwise confuse the demangler. If passed a g++
+v3 ABI mangled name, returns a buffer allocated with malloc holding the
+demangled name. Returns NULL otherwise and on memory alloc failure.
+
+2.3.1.25 `struct bfd_iovec'
+...........................
+
+*Description*
+The `struct bfd_iovec' contains the internal file I/O class. Each
+`BFD' has an instance of this class and all file I/O is routed through
+it (it is assumed that the instance implements all methods listed
+below).
+ struct bfd_iovec
+ {
+ /* To avoid problems with macros, a "b" rather than "f"
+ prefix is prepended to each method name. */
+ /* Attempt to read/write NBYTES on ABFD's IOSTREAM storing/fetching
+ bytes starting at PTR. Return the number of bytes actually
+ transfered (a read past end-of-file returns less than NBYTES),
+ or -1 (setting `bfd_error') if an error occurs. */
+ file_ptr (*bread) (struct bfd *abfd, void *ptr, file_ptr nbytes);
+ file_ptr (*bwrite) (struct bfd *abfd, const void *ptr,
+ file_ptr nbytes);
+ /* Return the current IOSTREAM file offset, or -1 (setting `bfd_error'
+ if an error occurs. */
+ file_ptr (*btell) (struct bfd *abfd);
+ /* For the following, on successful completion a value of 0 is returned.
+ Otherwise, a value of -1 is returned (and `bfd_error' is set). */
+ int (*bseek) (struct bfd *abfd, file_ptr offset, int whence);
+ int (*bclose) (struct bfd *abfd);
+ int (*bflush) (struct bfd *abfd);
+ int (*bstat) (struct bfd *abfd, struct stat *sb);
+ /* Just like mmap: (void*)-1 on failure, mmapped address on success. */
+ void *(*bmmap) (struct bfd *abfd, void *addr, bfd_size_type len,
+ int prot, int flags, file_ptr offset);
+ };
+
+2.3.1.26 `bfd_get_mtime'
+........................
+
+*Synopsis*
+ long bfd_get_mtime (bfd *abfd);
+ *Description*
+Return the file modification time (as read from the file system, or
+from the archive header for archive members).
+
+2.3.1.27 `bfd_get_size'
+.......................
+
+*Synopsis*
+ file_ptr bfd_get_size (bfd *abfd);
+ *Description*
+Return the file size (as read from file system) for the file associated
+with BFD ABFD.
+
+ The initial motivation for, and use of, this routine is not so we
+can get the exact size of the object the BFD applies to, since that
+might not be generally possible (archive members for example). It
+would be ideal if someone could eventually modify it so that such
+results were guaranteed.
+
+ Instead, we want to ask questions like "is this NNN byte sized
+object I'm about to try read from file offset YYY reasonable?" As as
+example of where we might do this, some object formats use string
+tables for which the first `sizeof (long)' bytes of the table contain
+the size of the table itself, including the size bytes. If an
+application tries to read what it thinks is one of these string tables,
+without some way to validate the size, and for some reason the size is
+wrong (byte swapping error, wrong location for the string table, etc.),
+the only clue is likely to be a read error when it tries to read the
+table, or a "virtual memory exhausted" error when it tries to allocate
+15 bazillon bytes of space for the 15 bazillon byte table it is about
+to read. This function at least allows us to answer the question, "is
+the size reasonable?".
+
+2.3.1.28 `bfd_mmap'
+...................
+
+*Synopsis*
+ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
+ int prot, int flags, file_ptr offset);
+ *Description*
+Return mmap()ed region of the file, if possible and implemented.
+
+* Menu:
+
+* Memory Usage::
+* Initialization::
+* Sections::
+* Symbols::
+* Archives::
+* Formats::
+* Relocations::
+* Core Files::
+* Targets::
+* Architectures::
+* Opening and Closing::
+* Internal::
+* File Caching::
+* Linker Functions::
+* Hash Tables::
+
+
+File: bfd.info, Node: Memory Usage, Next: Initialization, Prev: BFD front end, Up: BFD front end
+
+2.4 Memory Usage
+================
+
+BFD keeps all of its internal structures in obstacks. There is one
+obstack per open BFD file, into which the current state is stored. When
+a BFD is closed, the obstack is deleted, and so everything which has
+been allocated by BFD for the closing file is thrown away.
+
+ BFD does not free anything created by an application, but pointers
+into `bfd' structures become invalid on a `bfd_close'; for example,
+after a `bfd_close' the vector passed to `bfd_canonicalize_symtab' is
+still around, since it has been allocated by the application, but the
+data that it pointed to are lost.
+
+ The general rule is to not close a BFD until all operations dependent
+upon data from the BFD have been completed, or all the data from within
+the file has been copied. To help with the management of memory, there
+is a function (`bfd_alloc_size') which returns the number of bytes in
+obstacks associated with the supplied BFD. This could be used to select
+the greediest open BFD, close it to reclaim the memory, perform some
+operation and reopen the BFD again, to get a fresh copy of the data
+structures.
+
+
+File: bfd.info, Node: Initialization, Next: Sections, Prev: Memory Usage, Up: BFD front end
+
+2.5 Initialization
+==================
+
+2.5.1 Initialization functions
+------------------------------
+
+These are the functions that handle initializing a BFD.
+
+2.5.1.1 `bfd_init'
+..................
+
+*Synopsis*
+ void bfd_init (void);
+ *Description*
+This routine must be called before any other BFD function to initialize
+magical internal data structures.
+
+
+File: bfd.info, Node: Sections, Next: Symbols, Prev: Initialization, Up: BFD front end
+
+2.6 Sections
+============
+
+The raw data contained within a BFD is maintained through the section
+abstraction. A single BFD may have any number of sections. It keeps
+hold of them by pointing to the first; each one points to the next in
+the list.
+
+ Sections are supported in BFD in `section.c'.
+
+* Menu:
+
+* Section Input::
+* Section Output::
+* typedef asection::
+* section prototypes::
+
+
+File: bfd.info, Node: Section Input, Next: Section Output, Prev: Sections, Up: Sections
+
+2.6.1 Section input
+-------------------
+
+When a BFD is opened for reading, the section structures are created
+and attached to the BFD.
+
+ Each section has a name which describes the section in the outside
+world--for example, `a.out' would contain at least three sections,
+called `.text', `.data' and `.bss'.
+
+ Names need not be unique; for example a COFF file may have several
+sections named `.data'.
+
+ Sometimes a BFD will contain more than the "natural" number of
+sections. A back end may attach other sections containing constructor
+data, or an application may add a section (using `bfd_make_section') to
+the sections attached to an already open BFD. For example, the linker
+creates an extra section `COMMON' for each input file's BFD to hold
+information about common storage.
+
+ The raw data is not necessarily read in when the section descriptor
+is created. Some targets may leave the data in place until a
+`bfd_get_section_contents' call is made. Other back ends may read in
+all the data at once. For example, an S-record file has to be read
+once to determine the size of the data. An IEEE-695 file doesn't
+contain raw data in sections, but data and relocation expressions
+intermixed, so the data area has to be parsed to get out the data and
+relocations.
+
+
+File: bfd.info, Node: Section Output, Next: typedef asection, Prev: Section Input, Up: Sections
+
+2.6.2 Section output
+--------------------
+
+To write a new object style BFD, the various sections to be written
+have to be created. They are attached to the BFD in the same way as
+input sections; data is written to the sections using
+`bfd_set_section_contents'.
+
+ Any program that creates or combines sections (e.g., the assembler
+and linker) must use the `asection' fields `output_section' and
+`output_offset' to indicate the file sections to which each section
+must be written. (If the section is being created from scratch,
+`output_section' should probably point to the section itself and
+`output_offset' should probably be zero.)
+
+ The data to be written comes from input sections attached (via
+`output_section' pointers) to the output sections. The output section
+structure can be considered a filter for the input section: the output
+section determines the vma of the output data and the name, but the
+input section determines the offset into the output section of the data
+to be written.
+
+ E.g., to create a section "O", starting at 0x100, 0x123 long,
+containing two subsections, "A" at offset 0x0 (i.e., at vma 0x100) and
+"B" at offset 0x20 (i.e., at vma 0x120) the `asection' structures would
+look like:
+
+ section name "A"
+ output_offset 0x00
+ size 0x20
+ output_section -----------> section name "O"
+ | vma 0x100
+ section name "B" | size 0x123
+ output_offset 0x20 |
+ size 0x103 |
+ output_section --------|
+
+2.6.3 Link orders
+-----------------
+
+The data within a section is stored in a "link_order". These are much
+like the fixups in `gas'. The link_order abstraction allows a section
+to grow and shrink within itself.
+
+ A link_order knows how big it is, and which is the next link_order
+and where the raw data for it is; it also points to a list of
+relocations which apply to it.
+
+ The link_order is used by the linker to perform relaxing on final
+code. The compiler creates code which is as big as necessary to make
+it work without relaxing, and the user can select whether to relax.
+Sometimes relaxing takes a lot of time. The linker runs around the
+relocations to see if any are attached to data which can be shrunk, if
+so it does it on a link_order by link_order basis.
+
+
+File: bfd.info, Node: typedef asection, Next: section prototypes, Prev: Section Output, Up: Sections
+
+2.6.4 typedef asection
+----------------------
+
+Here is the section structure:
+
+
+ typedef struct bfd_section
+ {
+ /* The name of the section; the name isn't a copy, the pointer is
+ the same as that passed to bfd_make_section. */
+ const char *name;
+
+ /* A unique sequence number. */
+ int id;
+
+ /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */
+ int index;
+
+ /* The next section in the list belonging to the BFD, or NULL. */
+ struct bfd_section *next;
+
+ /* The previous section in the list belonging to the BFD, or NULL. */
+ struct bfd_section *prev;
+
+ /* The field flags contains attributes of the section. Some
+ flags are read in from the object file, and some are
+ synthesized from other information. */
+ flagword flags;
+
+ #define SEC_NO_FLAGS 0x000
+
+ /* Tells the OS to allocate space for this section when loading.
+ This is clear for a section containing debug information only. */
+ #define SEC_ALLOC 0x001
+
+ /* Tells the OS to load the section from the file when loading.
+ This is clear for a .bss section. */
+ #define SEC_LOAD 0x002
+
+ /* The section contains data still to be relocated, so there is
+ some relocation information too. */
+ #define SEC_RELOC 0x004
+
+ /* A signal to the OS that the section contains read only data. */
+ #define SEC_READONLY 0x008
+
+ /* The section contains code only. */
+ #define SEC_CODE 0x010
+
+ /* The section contains data only. */
+ #define SEC_DATA 0x020
+
+ /* The section will reside in ROM. */
+ #define SEC_ROM 0x040
+
+ /* The section contains constructor information. This section
+ type is used by the linker to create lists of constructors and
+ destructors used by `g++'. When a back end sees a symbol
+ which should be used in a constructor list, it creates a new
+ section for the type of name (e.g., `__CTOR_LIST__'), attaches
+ the symbol to it, and builds a relocation. To build the lists
+ of constructors, all the linker has to do is catenate all the
+ sections called `__CTOR_LIST__' and relocate the data
+ contained within - exactly the operations it would peform on
+ standard data. */
+ #define SEC_CONSTRUCTOR 0x080
+
+ /* The section has contents - a data section could be
+ `SEC_ALLOC' | `SEC_HAS_CONTENTS'; a debug section could be
+ `SEC_HAS_CONTENTS' */
+ #define SEC_HAS_CONTENTS 0x100
+
+ /* An instruction to the linker to not output the section
+ even if it has information which would normally be written. */
+ #define SEC_NEVER_LOAD 0x200
+
+ /* The section contains thread local data. */
+ #define SEC_THREAD_LOCAL 0x400
+
+ /* The section has GOT references. This flag is only for the
+ linker, and is currently only used by the elf32-hppa back end.
+ It will be set if global offset table references were detected
+ in this section, which indicate to the linker that the section
+ contains PIC code, and must be handled specially when doing a
+ static link. */
+ #define SEC_HAS_GOT_REF 0x800
+
+ /* The section contains common symbols (symbols may be defined
+ multiple times, the value of a symbol is the amount of
+ space it requires, and the largest symbol value is the one
+ used). Most targets have exactly one of these (which we
+ translate to bfd_com_section_ptr), but ECOFF has two. */
+ #define SEC_IS_COMMON 0x1000
+
+ /* The section contains only debugging information. For
+ example, this is set for ELF .debug and .stab sections.
+ strip tests this flag to see if a section can be
+ discarded. */
+ #define SEC_DEBUGGING 0x2000
+
+ /* The contents of this section are held in memory pointed to
+ by the contents field. This is checked by bfd_get_section_contents,
+ and the data is retrieved from memory if appropriate. */
+ #define SEC_IN_MEMORY 0x4000
+
+ /* The contents of this section are to be excluded by the
+ linker for executable and shared objects unless those
+ objects are to be further relocated. */
+ #define SEC_EXCLUDE 0x8000
+
+ /* The contents of this section are to be sorted based on the sum of
+ the symbol and addend values specified by the associated relocation
+ entries. Entries without associated relocation entries will be
+ appended to the end of the section in an unspecified order. */
+ #define SEC_SORT_ENTRIES 0x10000
+
+ /* When linking, duplicate sections of the same name should be
+ discarded, rather than being combined into a single section as
+ is usually done. This is similar to how common symbols are
+ handled. See SEC_LINK_DUPLICATES below. */
+ #define SEC_LINK_ONCE 0x20000
+
+ /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
+ should handle duplicate sections. */
+ #define SEC_LINK_DUPLICATES 0xc0000
+
+ /* This value for SEC_LINK_DUPLICATES means that duplicate
+ sections with the same name should simply be discarded. */
+ #define SEC_LINK_DUPLICATES_DISCARD 0x0
+
+ /* This value for SEC_LINK_DUPLICATES means that the linker
+ should warn if there are any duplicate sections, although
+ it should still only link one copy. */
+ #define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000
+
+ /* This value for SEC_LINK_DUPLICATES means that the linker
+ should warn if any duplicate sections are a different size. */
+ #define SEC_LINK_DUPLICATES_SAME_SIZE 0x80000
+
+ /* This value for SEC_LINK_DUPLICATES means that the linker
+ should warn if any duplicate sections contain different
+ contents. */
+ #define SEC_LINK_DUPLICATES_SAME_CONTENTS \
+ (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
+
+ /* This section was created by the linker as part of dynamic
+ relocation or other arcane processing. It is skipped when
+ going through the first-pass output, trusting that someone
+ else up the line will take care of it later. */
+ #define SEC_LINKER_CREATED 0x100000
+
+ /* This section should not be subject to garbage collection.
+ Also set to inform the linker that this section should not be
+ listed in the link map as discarded. */
+ #define SEC_KEEP 0x200000
+
+ /* This section contains "short" data, and should be placed
+ "near" the GP. */
+ #define SEC_SMALL_DATA 0x400000
+
+ /* Attempt to merge identical entities in the section.
+ Entity size is given in the entsize field. */
+ #define SEC_MERGE 0x800000
+
+ /* If given with SEC_MERGE, entities to merge are zero terminated
+ strings where entsize specifies character size instead of fixed
+ size entries. */
+ #define SEC_STRINGS 0x1000000
+
+ /* This section contains data about section groups. */
+ #define SEC_GROUP 0x2000000
+
+ /* The section is a COFF shared library section. This flag is
+ only for the linker. If this type of section appears in
+ the input file, the linker must copy it to the output file
+ without changing the vma or size. FIXME: Although this
+ was originally intended to be general, it really is COFF
+ specific (and the flag was renamed to indicate this). It
+ might be cleaner to have some more general mechanism to
+ allow the back end to control what the linker does with
+ sections. */
+ #define SEC_COFF_SHARED_LIBRARY 0x4000000
+
+ /* This section contains data which may be shared with other
+ executables or shared objects. This is for COFF only. */
+ #define SEC_COFF_SHARED 0x8000000
+
+ /* When a section with this flag is being linked, then if the size of
+ the input section is less than a page, it should not cross a page
+ boundary. If the size of the input section is one page or more,
+ it should be aligned on a page boundary. This is for TI
+ TMS320C54X only. */
+ #define SEC_TIC54X_BLOCK 0x10000000
+
+ /* Conditionally link this section; do not link if there are no
+ references found to any symbol in the section. This is for TI
+ TMS320C54X only. */
+ #define SEC_TIC54X_CLINK 0x20000000
+
+ /* Indicate that section has the no read flag set. This happens
+ when memory read flag isn't set. */
+ #define SEC_COFF_NOREAD 0x40000000
+
+ /* End of section flags. */
+
+ /* Some internal packed boolean fields. */
+
+ /* See the vma field. */
+ unsigned int user_set_vma : 1;
+
+ /* A mark flag used by some of the linker backends. */
+ unsigned int linker_mark : 1;
+
+ /* Another mark flag used by some of the linker backends. Set for
+ output sections that have an input section. */
+ unsigned int linker_has_input : 1;
+
+ /* Mark flag used by some linker backends for garbage collection. */
+ unsigned int gc_mark : 1;
+
+ /* The following flags are used by the ELF linker. */
+
+ /* Mark sections which have been allocated to segments. */
+ unsigned int segment_mark : 1;
+
+ /* Type of sec_info information. */
+ unsigned int sec_info_type:3;
+ #define ELF_INFO_TYPE_NONE 0
+ #define ELF_INFO_TYPE_STABS 1
+ #define ELF_INFO_TYPE_MERGE 2
+ #define ELF_INFO_TYPE_EH_FRAME 3
+ #define ELF_INFO_TYPE_JUST_SYMS 4
+
+ /* Nonzero if this section uses RELA relocations, rather than REL. */
+ unsigned int use_rela_p:1;
+
+ /* Bits used by various backends. The generic code doesn't touch
+ these fields. */
+
+ /* Nonzero if this section has TLS related relocations. */
+ unsigned int has_tls_reloc:1;
+
+ /* Nonzero if this section has a call to __tls_get_addr. */
+ unsigned int has_tls_get_addr_call:1;
+
+ /* Nonzero if this section has a gp reloc. */
+ unsigned int has_gp_reloc:1;
+
+ /* Nonzero if this section needs the relax finalize pass. */
+ unsigned int need_finalize_relax:1;
+
+ /* Whether relocations have been processed. */
+ unsigned int reloc_done : 1;
+
+ /* End of internal packed boolean fields. */
+
+ /* The virtual memory address of the section - where it will be
+ at run time. The symbols are relocated against this. The
+ user_set_vma flag is maintained by bfd; if it's not set, the
+ backend can assign addresses (for example, in `a.out', where
+ the default address for `.data' is dependent on the specific
+ target and various flags). */
+ bfd_vma vma;
+
+ /* The load address of the section - where it would be in a
+ rom image; really only used for writing section header
+ information. */
+ bfd_vma lma;
+
+ /* The size of the section in octets, as it will be output.
+ Contains a value even if the section has no contents (e.g., the
+ size of `.bss'). */
+ bfd_size_type size;
+
+ /* For input sections, the original size on disk of the section, in
+ octets. This field should be set for any section whose size is
+ changed by linker relaxation. It is required for sections where
+ the linker relaxation scheme doesn't cache altered section and
+ reloc contents (stabs, eh_frame, SEC_MERGE, some coff relaxing
+ targets), and thus the original size needs to be kept to read the
+ section multiple times. For output sections, rawsize holds the
+ section size calculated on a previous linker relaxation pass. */
+ bfd_size_type rawsize;
+
+ /* Relaxation table. */
+ struct relax_table *relax;
+
+ /* Count of used relaxation table entries. */
+ int relax_count;
+
+
+ /* If this section is going to be output, then this value is the
+ offset in *bytes* into the output section of the first byte in the
+ input section (byte ==> smallest addressable unit on the
+ target). In most cases, if this was going to start at the
+ 100th octet (8-bit quantity) in the output section, this value
+ would be 100. However, if the target byte size is 16 bits
+ (bfd_octets_per_byte is "2"), this value would be 50. */
+ bfd_vma output_offset;
+
+ /* The output section through which to map on output. */
+ struct bfd_section *output_section;
+
+ /* The alignment requirement of the section, as an exponent of 2 -
+ e.g., 3 aligns to 2^3 (or 8). */
+ unsigned int alignment_power;
+
+ /* If an input section, a pointer to a vector of relocation
+ records for the data in this section. */
+ struct reloc_cache_entry *relocation;
+
+ /* If an output section, a pointer to a vector of pointers to
+ relocation records for the data in this section. */
+ struct reloc_cache_entry **orelocation;
+
+ /* The number of relocation records in one of the above. */
+ unsigned reloc_count;
+
+ /* Information below is back end specific - and not always used
+ or updated. */
+
+ /* File position of section data. */
+ file_ptr filepos;
+
+ /* File position of relocation info. */
+ file_ptr rel_filepos;
+
+ /* File position of line data. */
+ file_ptr line_filepos;
+
+ /* Pointer to data for applications. */
+ void *userdata;
+
+ /* If the SEC_IN_MEMORY flag is set, this points to the actual
+ contents. */
+ unsigned char *contents;
+
+ /* Attached line number information. */
+ alent *lineno;
+
+ /* Number of line number records. */
+ unsigned int lineno_count;
+
+ /* Entity size for merging purposes. */
+ unsigned int entsize;
+
+ /* Points to the kept section if this section is a link-once section,
+ and is discarded. */
+ struct bfd_section *kept_section;
+
+ /* When a section is being output, this value changes as more
+ linenumbers are written out. */
+ file_ptr moving_line_filepos;
+
+ /* What the section number is in the target world. */
+ int target_index;
+
+ void *used_by_bfd;
+
+ /* If this is a constructor section then here is a list of the
+ relocations created to relocate items within it. */
+ struct relent_chain *constructor_chain;
+
+ /* The BFD which owns the section. */
+ bfd *owner;
+
+ /* A symbol which points at this section only. */
+ struct bfd_symbol *symbol;
+ struct bfd_symbol **symbol_ptr_ptr;
+
+ /* Early in the link process, map_head and map_tail are used to build
+ a list of input sections attached to an output section. Later,
+ output sections use these fields for a list of bfd_link_order
+ structs. */
+ union {
+ struct bfd_link_order *link_order;
+ struct bfd_section *s;
+ } map_head, map_tail;
+ } asection;
+
+ /* Relax table contains information about instructions which can
+ be removed by relaxation -- replacing a long address with a
+ short address. */
+ struct relax_table {
+ /* Address where bytes may be deleted. */
+ bfd_vma addr;
+
+ /* Number of bytes to be deleted. */
+ int size;
+ };
+
+ /* These sections are global, and are managed by BFD. The application
+ and target back end are not permitted to change the values in
+ these sections. New code should use the section_ptr macros rather
+ than referring directly to the const sections. The const sections
+ may eventually vanish. */
+ #define BFD_ABS_SECTION_NAME "*ABS*"
+ #define BFD_UND_SECTION_NAME "*UND*"
+ #define BFD_COM_SECTION_NAME "*COM*"
+ #define BFD_IND_SECTION_NAME "*IND*"
+
+ /* The absolute section. */
+ extern asection bfd_abs_section;
+ #define bfd_abs_section_ptr ((asection *) &bfd_abs_section)
+ #define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
+ /* Pointer to the undefined section. */
+ extern asection bfd_und_section;
+ #define bfd_und_section_ptr ((asection *) &bfd_und_section)
+ #define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
+ /* Pointer to the common section. */
+ extern asection bfd_com_section;
+ #define bfd_com_section_ptr ((asection *) &bfd_com_section)
+ /* Pointer to the indirect section. */
+ extern asection bfd_ind_section;
+ #define bfd_ind_section_ptr ((asection *) &bfd_ind_section)
+ #define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
+
+ #define bfd_is_const_section(SEC) \
+ ( ((SEC) == bfd_abs_section_ptr) \
+ || ((SEC) == bfd_und_section_ptr) \
+ || ((SEC) == bfd_com_section_ptr) \
+ || ((SEC) == bfd_ind_section_ptr))
+
+ /* Macros to handle insertion and deletion of a bfd's sections. These
+ only handle the list pointers, ie. do not adjust section_count,
+ target_index etc. */
+ #define bfd_section_list_remove(ABFD, S) \
+ do \
+ { \
+ asection *_s = S; \
+ asection *_next = _s->next; \
+ asection *_prev = _s->prev; \
+ if (_prev) \
+ _prev->next = _next; \
+ else \
+ (ABFD)->sections = _next; \
+ if (_next) \
+ _next->prev = _prev; \
+ else \
+ (ABFD)->section_last = _prev; \
+ } \
+ while (0)
+ #define bfd_section_list_append(ABFD, S) \
+ do \
+ { \
+ asection *_s = S; \
+ bfd *_abfd = ABFD; \
+ _s->next = NULL; \
+ if (_abfd->section_last) \
+ { \
+ _s->prev = _abfd->section_last; \
+ _abfd->section_last->next = _s; \
+ } \
+ else \
+ { \
+ _s->prev = NULL; \
+ _abfd->sections = _s; \
+ } \
+ _abfd->section_last = _s; \
+ } \
+ while (0)
+ #define bfd_section_list_prepend(ABFD, S) \
+ do \
+ { \
+ asection *_s = S; \
+ bfd *_abfd = ABFD; \
+ _s->prev = NULL; \
+ if (_abfd->sections) \
+ { \
+ _s->next = _abfd->sections; \
+ _abfd->sections->prev = _s; \
+ } \
+ else \
+ { \
+ _s->next = NULL; \
+ _abfd->section_last = _s; \
+ } \
+ _abfd->sections = _s; \
+ } \
+ while (0)
+ #define bfd_section_list_insert_after(ABFD, A, S) \
+ do \
+ { \
+ asection *_a = A; \
+ asection *_s = S; \
+ asection *_next = _a->next; \
+ _s->next = _next; \
+ _s->prev = _a; \
+ _a->next = _s; \
+ if (_next) \
+ _next->prev = _s; \
+ else \
+ (ABFD)->section_last = _s; \
+ } \
+ while (0)
+ #define bfd_section_list_insert_before(ABFD, B, S) \
+ do \
+ { \
+ asection *_b = B; \
+ asection *_s = S; \
+ asection *_prev = _b->prev; \
+ _s->prev = _prev; \
+ _s->next = _b; \
+ _b->prev = _s; \
+ if (_prev) \
+ _prev->next = _s; \
+ else \
+ (ABFD)->sections = _s; \
+ } \
+ while (0)
+ #define bfd_section_removed_from_list(ABFD, S) \
+ ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
+
+ #define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \
+ /* name, id, index, next, prev, flags, user_set_vma, */ \
+ { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \
+ \
+ /* linker_mark, linker_has_input, gc_mark, */ \
+ 0, 0, 1, \
+ \
+ /* segment_mark, sec_info_type, use_rela_p, has_tls_reloc, */ \
+ 0, 0, 0, 0, \
+ \
+ /* has_tls_get_addr_call, has_gp_reloc, need_finalize_relax, */ \
+ 0, 0, 0, \
+ \
+ /* reloc_done, vma, lma, size, rawsize, relax, relax_count, */ \
+ 0, 0, 0, 0, 0, 0, 0, \
+ \
+ /* output_offset, output_section, alignment_power, */ \
+ 0, (struct bfd_section *) &SEC, 0, \
+ \
+ /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \
+ NULL, NULL, 0, 0, 0, \
+ \
+ /* line_filepos, userdata, contents, lineno, lineno_count, */ \
+ 0, NULL, NULL, NULL, 0, \
+ \
+ /* entsize, kept_section, moving_line_filepos, */ \
+ 0, NULL, 0, \
+ \
+ /* target_index, used_by_bfd, constructor_chain, owner, */ \
+ 0, NULL, NULL, NULL, \
+ \
+ /* symbol, symbol_ptr_ptr, */ \
+ (struct bfd_symbol *) SYM, &SEC.symbol, \
+ \
+ /* map_head, map_tail */ \
+ { NULL }, { NULL } \
+ }
+
+
+File: bfd.info, Node: section prototypes, Prev: typedef asection, Up: Sections
+
+2.6.5 Section prototypes
+------------------------
+
+These are the functions exported by the section handling part of BFD.
+
+2.6.5.1 `bfd_section_list_clear'
+................................
+
+*Synopsis*
+ void bfd_section_list_clear (bfd *);
+ *Description*
+Clears the section list, and also resets the section count and hash
+table entries.
+
+2.6.5.2 `bfd_get_section_by_name'
+.................................
+
+*Synopsis*
+ asection *bfd_get_section_by_name (bfd *abfd, const char *name);
+ *Description*
+Run through ABFD and return the one of the `asection's whose name
+matches NAME, otherwise `NULL'. *Note Sections::, for more information.
+
+ This should only be used in special cases; the normal way to process
+all sections of a given name is to use `bfd_map_over_sections' and
+`strcmp' on the name (or better yet, base it on the section flags or
+something else) for each section.
+
+2.6.5.3 `bfd_get_section_by_name_if'
+....................................
+
+*Synopsis*
+ asection *bfd_get_section_by_name_if
+ (bfd *abfd,
+ const char *name,
+ bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
+ void *obj);
+ *Description*
+Call the provided function FUNC for each section attached to the BFD
+ABFD whose name matches NAME, passing OBJ as an argument. The function
+will be called as if by
+
+ func (abfd, the_section, obj);
+
+ It returns the first section for which FUNC returns true, otherwise
+`NULL'.
+
+2.6.5.4 `bfd_get_unique_section_name'
+.....................................
+
+*Synopsis*
+ char *bfd_get_unique_section_name
+ (bfd *abfd, const char *templat, int *count);
+ *Description*
+Invent a section name that is unique in ABFD by tacking a dot and a
+digit suffix onto the original TEMPLAT. If COUNT is non-NULL, then it
+specifies the first number tried as a suffix to generate a unique name.
+The value pointed to by COUNT will be incremented in this case.
+
+2.6.5.5 `bfd_make_section_old_way'
+..................................
+
+*Synopsis*
+ asection *bfd_make_section_old_way (bfd *abfd, const char *name);
+ *Description*
+Create a new empty section called NAME and attach it to the end of the
+chain of sections for the BFD ABFD. An attempt to create a section with
+a name which is already in use returns its pointer without changing the
+section chain.
+
+ It has the funny name since this is the way it used to be before it
+was rewritten....
+
+ Possible errors are:
+ * `bfd_error_invalid_operation' - If output has already started for
+ this BFD.
+
+ * `bfd_error_no_memory' - If memory allocation fails.
+
+2.6.5.6 `bfd_make_section_anyway_with_flags'
+............................................
+
+*Synopsis*
+ asection *bfd_make_section_anyway_with_flags
+ (bfd *abfd, const char *name, flagword flags);
+ *Description*
+Create a new empty section called NAME and attach it to the end of the
+chain of sections for ABFD. Create a new section even if there is
+already a section with that name. Also set the attributes of the new
+section to the value FLAGS.
+
+ Return `NULL' and set `bfd_error' on error; possible errors are:
+ * `bfd_error_invalid_operation' - If output has already started for
+ ABFD.
+
+ * `bfd_error_no_memory' - If memory allocation fails.
+
+2.6.5.7 `bfd_make_section_anyway'
+.................................
+
+*Synopsis*
+ asection *bfd_make_section_anyway (bfd *abfd, const char *name);
+ *Description*
+Create a new empty section called NAME and attach it to the end of the
+chain of sections for ABFD. Create a new section even if there is
+already a section with that name.
+
+ Return `NULL' and set `bfd_error' on error; possible errors are:
+ * `bfd_error_invalid_operation' - If output has already started for
+ ABFD.
+
+ * `bfd_error_no_memory' - If memory allocation fails.
+
+2.6.5.8 `bfd_make_section_with_flags'
+.....................................
+
+*Synopsis*
+ asection *bfd_make_section_with_flags
+ (bfd *, const char *name, flagword flags);
+ *Description*
+Like `bfd_make_section_anyway', but return `NULL' (without calling
+bfd_set_error ()) without changing the section chain if there is
+already a section named NAME. Also set the attributes of the new
+section to the value FLAGS. If there is an error, return `NULL' and set
+`bfd_error'.
+
+2.6.5.9 `bfd_make_section'
+..........................
+
+*Synopsis*
+ asection *bfd_make_section (bfd *, const char *name);
+ *Description*
+Like `bfd_make_section_anyway', but return `NULL' (without calling
+bfd_set_error ()) without changing the section chain if there is
+already a section named NAME. If there is an error, return `NULL' and
+set `bfd_error'.
+
+2.6.5.10 `bfd_set_section_flags'
+................................
+
+*Synopsis*
+ bfd_boolean bfd_set_section_flags
+ (bfd *abfd, asection *sec, flagword flags);
+ *Description*
+Set the attributes of the section SEC in the BFD ABFD to the value
+FLAGS. Return `TRUE' on success, `FALSE' on error. Possible error
+returns are:
+
+ * `bfd_error_invalid_operation' - The section cannot have one or
+ more of the attributes requested. For example, a .bss section in
+ `a.out' may not have the `SEC_HAS_CONTENTS' field set.
+
+2.6.5.11 `bfd_map_over_sections'
+................................
+
+*Synopsis*
+ void bfd_map_over_sections
+ (bfd *abfd,
+ void (*func) (bfd *abfd, asection *sect, void *obj),
+ void *obj);
+ *Description*
+Call the provided function FUNC for each section attached to the BFD
+ABFD, passing OBJ as an argument. The function will be called as if by
+
+ func (abfd, the_section, obj);
+
+ This is the preferred method for iterating over sections; an
+alternative would be to use a loop:
+
+ section *p;
+ for (p = abfd->sections; p != NULL; p = p->next)
+ func (abfd, p, ...)
+
+2.6.5.12 `bfd_sections_find_if'
+...............................
+
+*Synopsis*
+ asection *bfd_sections_find_if
+ (bfd *abfd,
+ bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
+ void *obj);
+ *Description*
+Call the provided function OPERATION for each section attached to the
+BFD ABFD, passing OBJ as an argument. The function will be called as if
+by
+
+ operation (abfd, the_section, obj);
+
+ It returns the first section for which OPERATION returns true.
+
+2.6.5.13 `bfd_set_section_size'
+...............................
+
+*Synopsis*
+ bfd_boolean bfd_set_section_size
+ (bfd *abfd, asection *sec, bfd_size_type val);
+ *Description*
+Set SEC to the size VAL. If the operation is ok, then `TRUE' is
+returned, else `FALSE'.
+
+ Possible error returns:
+ * `bfd_error_invalid_operation' - Writing has started to the BFD, so
+ setting the size is invalid.
+
+2.6.5.14 `bfd_set_section_contents'
+...................................
+
+*Synopsis*
+ bfd_boolean bfd_set_section_contents
+ (bfd *abfd, asection *section, const void *data,
+ file_ptr offset, bfd_size_type count);
+ *Description*
+Sets the contents of the section SECTION in BFD ABFD to the data
+starting in memory at DATA. The data is written to the output section
+starting at offset OFFSET for COUNT octets.
+
+ Normally `TRUE' is returned, else `FALSE'. Possible error returns
+are:
+ * `bfd_error_no_contents' - The output section does not have the
+ `SEC_HAS_CONTENTS' attribute, so nothing can be written to it.
+
+ * and some more too
+ This routine is front end to the back end function
+`_bfd_set_section_contents'.
+
+2.6.5.15 `bfd_get_section_contents'
+...................................
+
+*Synopsis*
+ bfd_boolean bfd_get_section_contents
+ (bfd *abfd, asection *section, void *location, file_ptr offset,
+ bfd_size_type count);
+ *Description*
+Read data from SECTION in BFD ABFD into memory starting at LOCATION.
+The data is read at an offset of OFFSET from the start of the input
+section, and is read for COUNT bytes.
+
+ If the contents of a constructor with the `SEC_CONSTRUCTOR' flag set
+are requested or if the section does not have the `SEC_HAS_CONTENTS'
+flag set, then the LOCATION is filled with zeroes. If no errors occur,
+`TRUE' is returned, else `FALSE'.
+
+2.6.5.16 `bfd_malloc_and_get_section'
+.....................................
+
+*Synopsis*
+ bfd_boolean bfd_malloc_and_get_section
+ (bfd *abfd, asection *section, bfd_byte **buf);
+ *Description*
+Read all data from SECTION in BFD ABFD into a buffer, *BUF, malloc'd by
+this function.
+
+2.6.5.17 `bfd_copy_private_section_data'
+........................................
+
+*Synopsis*
+ bfd_boolean bfd_copy_private_section_data
+ (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
+ *Description*
+Copy private section information from ISEC in the BFD IBFD to the
+section OSEC in the BFD OBFD. Return `TRUE' on success, `FALSE' on
+error. Possible error returns are:
+
+ * `bfd_error_no_memory' - Not enough memory exists to create private
+ data for OSEC.
+
+ #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
+ BFD_SEND (obfd, _bfd_copy_private_section_data, \
+ (ibfd, isection, obfd, osection))
+
+2.6.5.18 `bfd_generic_is_group_section'
+.......................................
+
+*Synopsis*
+ bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
+ *Description*
+Returns TRUE if SEC is a member of a group.
+
+2.6.5.19 `bfd_generic_discard_group'
+....................................
+
+*Synopsis*
+ bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
+ *Description*
+Remove all members of GROUP from the output.
+
+
+File: bfd.info, Node: Symbols, Next: Archives, Prev: Sections, Up: BFD front end
+
+2.7 Symbols
+===========
+
+BFD tries to maintain as much symbol information as it can when it
+moves information from file to file. BFD passes information to
+applications though the `asymbol' structure. When the application
+requests the symbol table, BFD reads the table in the native form and
+translates parts of it into the internal format. To maintain more than
+the information passed to applications, some targets keep some
+information "behind the scenes" in a structure only the particular back
+end knows about. For example, the coff back end keeps the original
+symbol table structure as well as the canonical structure when a BFD is
+read in. On output, the coff back end can reconstruct the output symbol
+table so that no information is lost, even information unique to coff
+which BFD doesn't know or understand. If a coff symbol table were read,
+but were written through an a.out back end, all the coff specific
+information would be lost. The symbol table of a BFD is not necessarily
+read in until a canonicalize request is made. Then the BFD back end
+fills in a table provided by the application with pointers to the
+canonical information. To output symbols, the application provides BFD
+with a table of pointers to pointers to `asymbol's. This allows
+applications like the linker to output a symbol as it was read, since
+the "behind the scenes" information will be still available.
+
+* Menu:
+
+* Reading Symbols::
+* Writing Symbols::
+* Mini Symbols::
+* typedef asymbol::
+* symbol handling functions::
+
+
+File: bfd.info, Node: Reading Symbols, Next: Writing Symbols, Prev: Symbols, Up: Symbols
+
+2.7.1 Reading symbols
+---------------------
+
+There are two stages to reading a symbol table from a BFD: allocating
+storage, and the actual reading process. This is an excerpt from an
+application which reads the symbol table:
+
+ long storage_needed;
+ asymbol **symbol_table;
+ long number_of_symbols;
+ long i;
+
+ storage_needed = bfd_get_symtab_upper_bound (abfd);
+
+ if (storage_needed < 0)
+ FAIL
+
+ if (storage_needed == 0)
+ return;
+
+ symbol_table = xmalloc (storage_needed);
+ ...
+ number_of_symbols =
+ bfd_canonicalize_symtab (abfd, symbol_table);
+
+ if (number_of_symbols < 0)
+ FAIL
+
+ for (i = 0; i < number_of_symbols; i++)
+ process_symbol (symbol_table[i]);
+
+ All storage for the symbols themselves is in an objalloc connected
+to the BFD; it is freed when the BFD is closed.
+
+
+File: bfd.info, Node: Writing Symbols, Next: Mini Symbols, Prev: Reading Symbols, Up: Symbols
+
+2.7.2 Writing symbols
+---------------------
+
+Writing of a symbol table is automatic when a BFD open for writing is
+closed. The application attaches a vector of pointers to pointers to
+symbols to the BFD being written, and fills in the symbol count. The
+close and cleanup code reads through the table provided and performs
+all the necessary operations. The BFD output code must always be
+provided with an "owned" symbol: one which has come from another BFD,
+or one which has been created using `bfd_make_empty_symbol'. Here is an
+example showing the creation of a symbol table with only one element:
+
+ #include "bfd.h"
+ int main (void)
+ {
+ bfd *abfd;
+ asymbol *ptrs[2];
+ asymbol *new;
+
+ abfd = bfd_openw ("foo","a.out-sunos-big");
+ bfd_set_format (abfd, bfd_object);
+ new = bfd_make_empty_symbol (abfd);
+ new->name = "dummy_symbol";
+ new->section = bfd_make_section_old_way (abfd, ".text");
+ new->flags = BSF_GLOBAL;
+ new->value = 0x12345;
+
+ ptrs[0] = new;
+ ptrs[1] = 0;
+
+ bfd_set_symtab (abfd, ptrs, 1);
+ bfd_close (abfd);
+ return 0;
+ }
+
+ ./makesym
+ nm foo
+ 00012345 A dummy_symbol
+
+ Many formats cannot represent arbitrary symbol information; for
+instance, the `a.out' object format does not allow an arbitrary number
+of sections. A symbol pointing to a section which is not one of
+`.text', `.data' or `.bss' cannot be described.
+
+
+File: bfd.info, Node: Mini Symbols, Next: typedef asymbol, Prev: Writing Symbols, Up: Symbols
+
+2.7.3 Mini Symbols
+------------------
+
+Mini symbols provide read-only access to the symbol table. They use
+less memory space, but require more time to access. They can be useful
+for tools like nm or objdump, which may have to handle symbol tables of
+extremely large executables.
+
+ The `bfd_read_minisymbols' function will read the symbols into
+memory in an internal form. It will return a `void *' pointer to a
+block of memory, a symbol count, and the size of each symbol. The
+pointer is allocated using `malloc', and should be freed by the caller
+when it is no longer needed.
+
+ The function `bfd_minisymbol_to_symbol' will take a pointer to a
+minisymbol, and a pointer to a structure returned by
+`bfd_make_empty_symbol', and return a `asymbol' structure. The return
+value may or may not be the same as the value from
+`bfd_make_empty_symbol' which was passed in.
+
+
+File: bfd.info, Node: typedef asymbol, Next: symbol handling functions, Prev: Mini Symbols, Up: Symbols
+
+2.7.4 typedef asymbol
+---------------------
+
+An `asymbol' has the form:
+
+
+ typedef struct bfd_symbol
+ {
+ /* A pointer to the BFD which owns the symbol. This information
+ is necessary so that a back end can work out what additional
+ information (invisible to the application writer) is carried
+ with the symbol.
+
+ This field is *almost* redundant, since you can use section->owner
+ instead, except that some symbols point to the global sections
+ bfd_{abs,com,und}_section. This could be fixed by making
+ these globals be per-bfd (or per-target-flavor). FIXME. */
+ struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
+
+ /* The text of the symbol. The name is left alone, and not copied; the
+ application may not alter it. */
+ const char *name;
+
+ /* The value of the symbol. This really should be a union of a
+ numeric value with a pointer, since some flags indicate that
+ a pointer to another symbol is stored here. */
+ symvalue value;
+
+ /* Attributes of a symbol. */
+ #define BSF_NO_FLAGS 0x00
+
+ /* The symbol has local scope; `static' in `C'. The value
+ is the offset into the section of the data. */
+ #define BSF_LOCAL (1 << 0)
+
+ /* The symbol has global scope; initialized data in `C'. The
+ value is the offset into the section of the data. */
+ #define BSF_GLOBAL (1 << 1)
+
+ /* The symbol has global scope and is exported. The value is
+ the offset into the section of the data. */
+ #define BSF_EXPORT BSF_GLOBAL /* No real difference. */
+
+ /* A normal C symbol would be one of:
+ `BSF_LOCAL', `BSF_COMMON', `BSF_UNDEFINED' or
+ `BSF_GLOBAL'. */
+
+ /* The symbol is a debugging record. The value has an arbitrary
+ meaning, unless BSF_DEBUGGING_RELOC is also set. */
+ #define BSF_DEBUGGING (1 << 2)
+
+ /* The symbol denotes a function entry point. Used in ELF,
+ perhaps others someday. */
+ #define BSF_FUNCTION (1 << 3)
+
+ /* Used by the linker. */
+ #define BSF_KEEP (1 << 5)
+ #define BSF_KEEP_G (1 << 6)
+
+ /* A weak global symbol, overridable without warnings by
+ a regular global symbol of the same name. */
+ #define BSF_WEAK (1 << 7)
+
+ /* This symbol was created to point to a section, e.g. ELF's
+ STT_SECTION symbols. */
+ #define BSF_SECTION_SYM (1 << 8)
+
+ /* The symbol used to be a common symbol, but now it is
+ allocated. */
+ #define BSF_OLD_COMMON (1 << 9)
+
+ /* In some files the type of a symbol sometimes alters its
+ location in an output file - ie in coff a `ISFCN' symbol
+ which is also `C_EXT' symbol appears where it was
+ declared and not at the end of a section. This bit is set
+ by the target BFD part to convey this information. */
+ #define BSF_NOT_AT_END (1 << 10)
+
+ /* Signal that the symbol is the label of constructor section. */
+ #define BSF_CONSTRUCTOR (1 << 11)
+
+ /* Signal that the symbol is a warning symbol. The name is a
+ warning. The name of the next symbol is the one to warn about;
+ if a reference is made to a symbol with the same name as the next
+ symbol, a warning is issued by the linker. */
+ #define BSF_WARNING (1 << 12)
+
+ /* Signal that the symbol is indirect. This symbol is an indirect
+ pointer to the symbol with the same name as the next symbol. */
+ #define BSF_INDIRECT (1 << 13)
+
+ /* BSF_FILE marks symbols that contain a file name. This is used
+ for ELF STT_FILE symbols. */
+ #define BSF_FILE (1 << 14)
+
+ /* Symbol is from dynamic linking information. */
+ #define BSF_DYNAMIC (1 << 15)
+
+ /* The symbol denotes a data object. Used in ELF, and perhaps
+ others someday. */
+ #define BSF_OBJECT (1 << 16)
+
+ /* This symbol is a debugging symbol. The value is the offset
+ into the section of the data. BSF_DEBUGGING should be set
+ as well. */
+ #define BSF_DEBUGGING_RELOC (1 << 17)
+
+ /* This symbol is thread local. Used in ELF. */
+ #define BSF_THREAD_LOCAL (1 << 18)
+
+ /* This symbol represents a complex relocation expression,
+ with the expression tree serialized in the symbol name. */
+ #define BSF_RELC (1 << 19)
+
+ /* This symbol represents a signed complex relocation expression,
+ with the expression tree serialized in the symbol name. */
+ #define BSF_SRELC (1 << 20)
+
+ /* This symbol was created by bfd_get_synthetic_symtab. */
+ #define BSF_SYNTHETIC (1 << 21)
+
+ /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT.
+ The dynamic linker will compute the value of this symbol by
+ calling the function that it points to. BSF_FUNCTION must
+ also be also set. */
+ #define BSF_GNU_INDIRECT_FUNCTION (1 << 22)
+ /* This symbol is a globally unique data object. The dynamic linker
+ will make sure that in the entire process there is just one symbol
+ with this name and type in use. BSF_OBJECT must also be set. */
+ #define BSF_GNU_UNIQUE (1 << 23)
+
+ flagword flags;
+
+ /* A pointer to the section to which this symbol is
+ relative. This will always be non NULL, there are special
+ sections for undefined and absolute symbols. */
+ struct bfd_section *section;
+
+ /* Back end special data. */
+ union
+ {
+ void *p;
+ bfd_vma i;
+ }
+ udata;
+ }
+ asymbol;
+
+
+File: bfd.info, Node: symbol handling functions, Prev: typedef asymbol, Up: Symbols
+
+2.7.5 Symbol handling functions
+-------------------------------
+
+2.7.5.1 `bfd_get_symtab_upper_bound'
+....................................
+
+*Description*
+Return the number of bytes required to store a vector of pointers to
+`asymbols' for all the symbols in the BFD ABFD, including a terminal
+NULL pointer. If there are no symbols in the BFD, then return 0. If an
+error occurs, return -1.
+ #define bfd_get_symtab_upper_bound(abfd) \
+ BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
+
+2.7.5.2 `bfd_is_local_label'
+............................
+
+*Synopsis*
+ bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
+ *Description*
+Return TRUE if the given symbol SYM in the BFD ABFD is a compiler
+generated local label, else return FALSE.
+
+2.7.5.3 `bfd_is_local_label_name'
+.................................
+
+*Synopsis*
+ bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
+ *Description*
+Return TRUE if a symbol with the name NAME in the BFD ABFD is a
+compiler generated local label, else return FALSE. This just checks
+whether the name has the form of a local label.
+ #define bfd_is_local_label_name(abfd, name) \
+ BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
+
+2.7.5.4 `bfd_is_target_special_symbol'
+......................................
+
+*Synopsis*
+ bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
+ *Description*
+Return TRUE iff a symbol SYM in the BFD ABFD is something special to
+the particular target represented by the BFD. Such symbols should
+normally not be mentioned to the user.
+ #define bfd_is_target_special_symbol(abfd, sym) \
+ BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
+
+2.7.5.5 `bfd_canonicalize_symtab'
+.................................
+
+*Description*
+Read the symbols from the BFD ABFD, and fills in the vector LOCATION
+with pointers to the symbols and a trailing NULL. Return the actual
+number of symbol pointers, not including the NULL.
+ #define bfd_canonicalize_symtab(abfd, location) \
+ BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
+
+2.7.5.6 `bfd_set_symtab'
+........................
+
+*Synopsis*
+ bfd_boolean bfd_set_symtab
+ (bfd *abfd, asymbol **location, unsigned int count);
+ *Description*
+Arrange that when the output BFD ABFD is closed, the table LOCATION of
+COUNT pointers to symbols will be written.
+
+2.7.5.7 `bfd_print_symbol_vandf'
+................................
+
+*Synopsis*
+ void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
+ *Description*
+Print the value and flags of the SYMBOL supplied to the stream FILE.
+
+2.7.5.8 `bfd_make_empty_symbol'
+...............................
+
+*Description*
+Create a new `asymbol' structure for the BFD ABFD and return a pointer
+to it.
+
+ This routine is necessary because each back end has private
+information surrounding the `asymbol'. Building your own `asymbol' and
+pointing to it will not create the private information, and will cause
+problems later on.
+ #define bfd_make_empty_symbol(abfd) \
+ BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
+
+2.7.5.9 `_bfd_generic_make_empty_symbol'
+........................................
+
+*Synopsis*
+ asymbol *_bfd_generic_make_empty_symbol (bfd *);
+ *Description*
+Create a new `asymbol' structure for the BFD ABFD and return a pointer
+to it. Used by core file routines, binary back-end and anywhere else
+where no private info is needed.
+
+2.7.5.10 `bfd_make_debug_symbol'
+................................
+
+*Description*
+Create a new `asymbol' structure for the BFD ABFD, to be used as a
+debugging symbol. Further details of its use have yet to be worked out.
+ #define bfd_make_debug_symbol(abfd,ptr,size) \
+ BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
+
+2.7.5.11 `bfd_decode_symclass'
+..............................
+
+*Description*
+Return a character corresponding to the symbol class of SYMBOL, or '?'
+for an unknown class.
+
+ *Synopsis*
+ int bfd_decode_symclass (asymbol *symbol);
+
+2.7.5.12 `bfd_is_undefined_symclass'
+....................................
+
+*Description*
+Returns non-zero if the class symbol returned by bfd_decode_symclass
+represents an undefined symbol. Returns zero otherwise.
+
+ *Synopsis*
+ bfd_boolean bfd_is_undefined_symclass (int symclass);
+
+2.7.5.13 `bfd_symbol_info'
+..........................
+
+*Description*
+Fill in the basic info about symbol that nm needs. Additional info may
+be added by the back-ends after calling this function.
+
+ *Synopsis*
+ void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
+
+2.7.5.14 `bfd_copy_private_symbol_data'
+.......................................
+
+*Synopsis*
+ bfd_boolean bfd_copy_private_symbol_data
+ (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
+ *Description*
+Copy private symbol information from ISYM in the BFD IBFD to the symbol
+OSYM in the BFD OBFD. Return `TRUE' on success, `FALSE' on error.
+Possible error returns are:
+
+ * `bfd_error_no_memory' - Not enough memory exists to create private
+ data for OSEC.
+
+ #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
+ BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
+ (ibfd, isymbol, obfd, osymbol))
+
+
+File: bfd.info, Node: Archives, Next: Formats, Prev: Symbols, Up: BFD front end
+
+2.8 Archives
+============
+
+*Description*
+An archive (or library) is just another BFD. It has a symbol table,
+although there's not much a user program will do with it.
+
+ The big difference between an archive BFD and an ordinary BFD is
+that the archive doesn't have sections. Instead it has a chain of BFDs
+that are considered its contents. These BFDs can be manipulated like
+any other. The BFDs contained in an archive opened for reading will
+all be opened for reading. You may put either input or output BFDs
+into an archive opened for output; they will be handled correctly when
+the archive is closed.
+
+ Use `bfd_openr_next_archived_file' to step through the contents of
+an archive opened for input. You don't have to read the entire archive
+if you don't want to! Read it until you find what you want.
+
+ Archive contents of output BFDs are chained through the `next'
+pointer in a BFD. The first one is findable through the `archive_head'
+slot of the archive. Set it with `bfd_set_archive_head' (q.v.). A
+given BFD may be in only one open output archive at a time.
+
+ As expected, the BFD archive code is more general than the archive
+code of any given environment. BFD archives may contain files of
+different formats (e.g., a.out and coff) and even different
+architectures. You may even place archives recursively into archives!
+
+ This can cause unexpected confusion, since some archive formats are
+more expressive than others. For instance, Intel COFF archives can
+preserve long filenames; SunOS a.out archives cannot. If you move a
+file from the first to the second format and back again, the filename
+may be truncated. Likewise, different a.out environments have different
+conventions as to how they truncate filenames, whether they preserve
+directory names in filenames, etc. When interoperating with native
+tools, be sure your files are homogeneous.
+
+ Beware: most of these formats do not react well to the presence of
+spaces in filenames. We do the best we can, but can't always handle
+this case due to restrictions in the format of archives. Many Unix
+utilities are braindead in regards to spaces and such in filenames
+anyway, so this shouldn't be much of a restriction.
+
+ Archives are supported in BFD in `archive.c'.
+
+2.8.1 Archive functions
+-----------------------
+
+2.8.1.1 `bfd_get_next_mapent'
+.............................
+
+*Synopsis*
+ symindex bfd_get_next_mapent
+ (bfd *abfd, symindex previous, carsym **sym);
+ *Description*
+Step through archive ABFD's symbol table (if it has one). Successively
+update SYM with the next symbol's information, returning that symbol's
+(internal) index into the symbol table.
+
+ Supply `BFD_NO_MORE_SYMBOLS' as the PREVIOUS entry to get the first
+one; returns `BFD_NO_MORE_SYMBOLS' when you've already got the last one.
+
+ A `carsym' is a canonical archive symbol. The only user-visible
+element is its name, a null-terminated string.
+
+2.8.1.2 `bfd_set_archive_head'
+..............................
+
+*Synopsis*
+ bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
+ *Description*
+Set the head of the chain of BFDs contained in the archive OUTPUT to
+NEW_HEAD.
+
+2.8.1.3 `bfd_openr_next_archived_file'
+......................................
+
+*Synopsis*
+ bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
+ *Description*
+Provided a BFD, ARCHIVE, containing an archive and NULL, open an input
+BFD on the first contained element and returns that. Subsequent calls
+should pass the archive and the previous return value to return a
+created BFD to the next contained element. NULL is returned when there
+are no more.
+
+
+File: bfd.info, Node: Formats, Next: Relocations, Prev: Archives, Up: BFD front end
+
+2.9 File formats
+================
+
+A format is a BFD concept of high level file contents type. The formats
+supported by BFD are:
+
+ * `bfd_object'
+ The BFD may contain data, symbols, relocations and debug info.
+
+ * `bfd_archive'
+ The BFD contains other BFDs and an optional index.
+
+ * `bfd_core'
+ The BFD contains the result of an executable core dump.
+
+2.9.1 File format functions
+---------------------------
+
+2.9.1.1 `bfd_check_format'
+..........................
+
+*Synopsis*
+ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
+ *Description*
+Verify if the file attached to the BFD ABFD is compatible with the
+format FORMAT (i.e., one of `bfd_object', `bfd_archive' or `bfd_core').
+
+ If the BFD has been set to a specific target before the call, only
+the named target and format combination is checked. If the target has
+not been set, or has been set to `default', then all the known target
+backends is interrogated to determine a match. If the default target
+matches, it is used. If not, exactly one target must recognize the
+file, or an error results.
+
+ The function returns `TRUE' on success, otherwise `FALSE' with one
+of the following error codes:
+
+ * `bfd_error_invalid_operation' - if `format' is not one of
+ `bfd_object', `bfd_archive' or `bfd_core'.
+
+ * `bfd_error_system_call' - if an error occured during a read - even
+ some file mismatches can cause bfd_error_system_calls.
+
+ * `file_not_recognised' - none of the backends recognised the file
+ format.
+
+ * `bfd_error_file_ambiguously_recognized' - more than one backend
+ recognised the file format.
+
+2.9.1.2 `bfd_check_format_matches'
+..................................
+
+*Synopsis*
+ bfd_boolean bfd_check_format_matches
+ (bfd *abfd, bfd_format format, char ***matching);
+ *Description*
+Like `bfd_check_format', except when it returns FALSE with `bfd_errno'
+set to `bfd_error_file_ambiguously_recognized'. In that case, if
+MATCHING is not NULL, it will be filled in with a NULL-terminated list
+of the names of the formats that matched, allocated with `malloc'.
+Then the user may choose a format and try again.
+
+ When done with the list that MATCHING points to, the caller should
+free it.
+
+2.9.1.3 `bfd_set_format'
+........................
+
+*Synopsis*
+ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
+ *Description*
+This function sets the file format of the BFD ABFD to the format
+FORMAT. If the target set in the BFD does not support the format
+requested, the format is invalid, or the BFD is not open for writing,
+then an error occurs.
+
+2.9.1.4 `bfd_format_string'
+...........................
+
+*Synopsis*
+ const char *bfd_format_string (bfd_format format);
+ *Description*
+Return a pointer to a const string `invalid', `object', `archive',
+`core', or `unknown', depending upon the value of FORMAT.
+
+
+File: bfd.info, Node: Relocations, Next: Core Files, Prev: Formats, Up: BFD front end
+
+2.10 Relocations
+================
+
+BFD maintains relocations in much the same way it maintains symbols:
+they are left alone until required, then read in en-masse and
+translated into an internal form. A common routine
+`bfd_perform_relocation' acts upon the canonical form to do the fixup.
+
+ Relocations are maintained on a per section basis, while symbols are
+maintained on a per BFD basis.
+
+ All that a back end has to do to fit the BFD interface is to create
+a `struct reloc_cache_entry' for each relocation in a particular
+section, and fill in the right bits of the structures.
+
+* Menu:
+
+* typedef arelent::
+* howto manager::
+
+
+File: bfd.info, Node: typedef arelent, Next: howto manager, Prev: Relocations, Up: Relocations
+
+2.10.1 typedef arelent
+----------------------
+
+This is the structure of a relocation entry:
+
+
+ typedef enum bfd_reloc_status
+ {
+ /* No errors detected. */
+ bfd_reloc_ok,
+
+ /* The relocation was performed, but there was an overflow. */
+ bfd_reloc_overflow,
+
+ /* The address to relocate was not within the section supplied. */
+ bfd_reloc_outofrange,
+
+ /* Used by special functions. */
+ bfd_reloc_continue,
+
+ /* Unsupported relocation size requested. */
+ bfd_reloc_notsupported,
+
+ /* Unused. */
+ bfd_reloc_other,
+
+ /* The symbol to relocate against was undefined. */
+ bfd_reloc_undefined,
+
+ /* The relocation was performed, but may not be ok - presently
+ generated only when linking i960 coff files with i960 b.out
+ symbols. If this type is returned, the error_message argument
+ to bfd_perform_relocation will be set. */
+ bfd_reloc_dangerous
+ }
+ bfd_reloc_status_type;
+
+
+ typedef struct reloc_cache_entry
+ {
+ /* A pointer into the canonical table of pointers. */
+ struct bfd_symbol **sym_ptr_ptr;
+
+ /* offset in section. */
+ bfd_size_type address;
+
+ /* addend for relocation value. */
+ bfd_vma addend;
+
+ /* Pointer to how to perform the required relocation. */
+ reloc_howto_type *howto;
+
+ }
+ arelent;
+ *Description*
+Here is a description of each of the fields within an `arelent':
+
+ * `sym_ptr_ptr'
+ The symbol table pointer points to a pointer to the symbol
+associated with the relocation request. It is the pointer into the
+table returned by the back end's `canonicalize_symtab' action. *Note
+Symbols::. The symbol is referenced through a pointer to a pointer so
+that tools like the linker can fix up all the symbols of the same name
+by modifying only one pointer. The relocation routine looks in the
+symbol and uses the base of the section the symbol is attached to and
+the value of the symbol as the initial relocation offset. If the symbol
+pointer is zero, then the section provided is looked up.
+
+ * `address'
+ The `address' field gives the offset in bytes from the base of the
+section data which owns the relocation record to the first byte of
+relocatable information. The actual data relocated will be relative to
+this point; for example, a relocation type which modifies the bottom
+two bytes of a four byte word would not touch the first byte pointed to
+in a big endian world.
+
+ * `addend'
+ The `addend' is a value provided by the back end to be added (!) to
+the relocation offset. Its interpretation is dependent upon the howto.
+For example, on the 68k the code:
+
+ char foo[];
+ main()
+ {
+ return foo[0x12345678];
+ }
+
+ Could be compiled into:
+
+ linkw fp,#-4
+ moveb @#12345678,d0
+ extbl d0
+ unlk fp
+ rts
+
+ This could create a reloc pointing to `foo', but leave the offset in
+the data, something like:
+
+ RELOCATION RECORDS FOR [.text]:
+ offset type value
+ 00000006 32 _foo
+
+ 00000000 4e56 fffc ; linkw fp,#-4
+ 00000004 1039 1234 5678 ; moveb @#12345678,d0
+ 0000000a 49c0 ; extbl d0
+ 0000000c 4e5e ; unlk fp
+ 0000000e 4e75 ; rts
+
+ Using coff and an 88k, some instructions don't have enough space in
+them to represent the full address range, and pointers have to be
+loaded in two parts. So you'd get something like:
+
+ or.u r13,r0,hi16(_foo+0x12345678)
+ ld.b r2,r13,lo16(_foo+0x12345678)
+ jmp r1
+
+ This should create two relocs, both pointing to `_foo', and with
+0x12340000 in their addend field. The data would consist of:
+
+ RELOCATION RECORDS FOR [.text]:
+ offset type value
+ 00000002 HVRT16 _foo+0x12340000
+ 00000006 LVRT16 _foo+0x12340000
+
+ 00000000 5da05678 ; or.u r13,r0,0x5678
+ 00000004 1c4d5678 ; ld.b r2,r13,0x5678
+ 00000008 f400c001 ; jmp r1
+
+ The relocation routine digs out the value from the data, adds it to
+the addend to get the original offset, and then adds the value of
+`_foo'. Note that all 32 bits have to be kept around somewhere, to cope
+with carry from bit 15 to bit 16.
+
+ One further example is the sparc and the a.out format. The sparc has
+a similar problem to the 88k, in that some instructions don't have room
+for an entire offset, but on the sparc the parts are created in odd
+sized lumps. The designers of the a.out format chose to not use the
+data within the section for storing part of the offset; all the offset
+is kept within the reloc. Anything in the data should be ignored.
+
+ save %sp,-112,%sp
+ sethi %hi(_foo+0x12345678),%g2
+ ldsb [%g2+%lo(_foo+0x12345678)],%i0
+ ret
+ restore
+
+ Both relocs contain a pointer to `foo', and the offsets contain junk.
+
+ RELOCATION RECORDS FOR [.text]:
+ offset type value
+ 00000004 HI22 _foo+0x12345678
+ 00000008 LO10 _foo+0x12345678
+
+ 00000000 9de3bf90 ; save %sp,-112,%sp
+ 00000004 05000000 ; sethi %hi(_foo+0),%g2
+ 00000008 f048a000 ; ldsb [%g2+%lo(_foo+0)],%i0
+ 0000000c 81c7e008 ; ret
+ 00000010 81e80000 ; restore
+
+ * `howto'
+ The `howto' field can be imagined as a relocation instruction. It is
+a pointer to a structure which contains information on what to do with
+all of the other information in the reloc record and data section. A
+back end would normally have a relocation instruction set and turn
+relocations into pointers to the correct structure on input - but it
+would be possible to create each howto field on demand.
+
+2.10.1.1 `enum complain_overflow'
+.................................
+
+Indicates what sort of overflow checking should be done when performing
+a relocation.
+
+
+ enum complain_overflow
+ {
+ /* Do not complain on overflow. */
+ complain_overflow_dont,
+
+ /* Complain if the value overflows when considered as a signed
+ number one bit larger than the field. ie. A bitfield of N bits
+ is allowed to represent -2**n to 2**n-1. */
+ complain_overflow_bitfield,
+
+ /* Complain if the value overflows when considered as a signed
+ number. */
+ complain_overflow_signed,
+
+ /* Complain if the value overflows when considered as an
+ unsigned number. */
+ complain_overflow_unsigned
+ };
+
+2.10.1.2 `reloc_howto_type'
+...........................
+
+The `reloc_howto_type' is a structure which contains all the
+information that libbfd needs to know to tie up a back end's data.
+
+ struct bfd_symbol; /* Forward declaration. */
+
+ struct reloc_howto_struct
+ {
+ /* The type field has mainly a documentary use - the back end can
+ do what it wants with it, though normally the back end's
+ external idea of what a reloc number is stored
+ in this field. For example, a PC relative word relocation
+ in a coff environment has the type 023 - because that's
+ what the outside world calls a R_PCRWORD reloc. */
+ unsigned int type;
+
+ /* The value the final relocation is shifted right by. This drops
+ unwanted data from the relocation. */
+ unsigned int rightshift;
+
+ /* The size of the item to be relocated. This is *not* a
+ power-of-two measure. To get the number of bytes operated
+ on by a type of relocation, use bfd_get_reloc_size. */
+ int size;
+
+ /* The number of bits in the item to be relocated. This is used
+ when doing overflow checking. */
+ unsigned int bitsize;
+
+ /* Notes that the relocation is relative to the location in the
+ data section of the addend. The relocation function will
+ subtract from the relocation value the address of the location
+ being relocated. */
+ bfd_boolean pc_relative;
+
+ /* The bit position of the reloc value in the destination.
+ The relocated value is left shifted by this amount. */
+ unsigned int bitpos;
+
+ /* What type of overflow error should be checked for when
+ relocating. */
+ enum complain_overflow complain_on_overflow;
+
+ /* If this field is non null, then the supplied function is
+ called rather than the normal function. This allows really
+ strange relocation methods to be accommodated (e.g., i960 callj
+ instructions). */
+ bfd_reloc_status_type (*special_function)
+ (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
+ bfd *, char **);
+
+ /* The textual name of the relocation type. */
+ char *name;
+
+ /* Some formats record a relocation addend in the section contents
+ rather than with the relocation. For ELF formats this is the
+ distinction between USE_REL and USE_RELA (though the code checks
+ for USE_REL == 1/0). The value of this field is TRUE if the
+ addend is recorded with the section contents; when performing a
+ partial link (ld -r) the section contents (the data) will be
+ modified. The value of this field is FALSE if addends are
+ recorded with the relocation (in arelent.addend); when performing
+ a partial link the relocation will be modified.
+ All relocations for all ELF USE_RELA targets should set this field
+ to FALSE (values of TRUE should be looked on with suspicion).
+ However, the converse is not true: not all relocations of all ELF
+ USE_REL targets set this field to TRUE. Why this is so is peculiar
+ to each particular target. For relocs that aren't used in partial
+ links (e.g. GOT stuff) it doesn't matter what this is set to. */
+ bfd_boolean partial_inplace;
+
+ /* src_mask selects the part of the instruction (or data) to be used
+ in the relocation sum. If the target relocations don't have an
+ addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
+ dst_mask to extract the addend from the section contents. If
+ relocations do have an addend in the reloc, eg. ELF USE_RELA, this
+ field should be zero. Non-zero values for ELF USE_RELA targets are
+ bogus as in those cases the value in the dst_mask part of the
+ section contents should be treated as garbage. */
+ bfd_vma src_mask;
+
+ /* dst_mask selects which parts of the instruction (or data) are
+ replaced with a relocated value. */
+ bfd_vma dst_mask;
+
+ /* When some formats create PC relative instructions, they leave
+ the value of the pc of the place being relocated in the offset
+ slot of the instruction, so that a PC relative relocation can
+ be made just by adding in an ordinary offset (e.g., sun3 a.out).
+ Some formats leave the displacement part of an instruction
+ empty (e.g., m88k bcs); this flag signals the fact. */
+ bfd_boolean pcrel_offset;
+ };
+
+2.10.1.3 `The HOWTO Macro'
+..........................
+
+*Description*
+The HOWTO define is horrible and will go away.
+ #define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
+ { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC }
+
+ *Description*
+And will be replaced with the totally magic way. But for the moment, we
+are compatible, so do it this way.
+ #define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \
+ HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \
+ NAME, FALSE, 0, 0, IN)
+
+ *Description*
+This is used to fill in an empty howto entry in an array.
+ #define EMPTY_HOWTO(C) \
+ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
+ NULL, FALSE, 0, 0, FALSE)
+
+ *Description*
+Helper routine to turn a symbol into a relocation value.
+ #define HOWTO_PREPARE(relocation, symbol) \
+ { \
+ if (symbol != NULL) \
+ { \
+ if (bfd_is_com_section (symbol->section)) \
+ { \
+ relocation = 0; \
+ } \
+ else \
+ { \
+ relocation = symbol->value; \
+ } \
+ } \
+ }
+
+2.10.1.4 `bfd_get_reloc_size'
+.............................
+
+*Synopsis*
+ unsigned int bfd_get_reloc_size (reloc_howto_type *);
+ *Description*
+For a reloc_howto_type that operates on a fixed number of bytes, this
+returns the number of bytes operated on.
+
+2.10.1.5 `arelent_chain'
+........................
+
+*Description*
+How relocs are tied together in an `asection':
+ typedef struct relent_chain
+ {
+ arelent relent;
+ struct relent_chain *next;
+ }
+ arelent_chain;
+
+2.10.1.6 `bfd_check_overflow'
+.............................
+
+*Synopsis*
+ bfd_reloc_status_type bfd_check_overflow
+ (enum complain_overflow how,
+ unsigned int bitsize,
+ unsigned int rightshift,
+ unsigned int addrsize,
+ bfd_vma relocation);
+ *Description*
+Perform overflow checking on RELOCATION which has BITSIZE significant
+bits and will be shifted right by RIGHTSHIFT bits, on a machine with
+addresses containing ADDRSIZE significant bits. The result is either of
+`bfd_reloc_ok' or `bfd_reloc_overflow'.
+
+2.10.1.7 `bfd_perform_relocation'
+.................................
+
+*Synopsis*
+ bfd_reloc_status_type bfd_perform_relocation
+ (bfd *abfd,
+ arelent *reloc_entry,
+ void *data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message);
+ *Description*
+If OUTPUT_BFD is supplied to this function, the generated image will be
+relocatable; the relocations are copied to the output file after they
+have been changed to reflect the new state of the world. There are two
+ways of reflecting the results of partial linkage in an output file: by
+modifying the output data in place, and by modifying the relocation
+record. Some native formats (e.g., basic a.out and basic coff) have no
+way of specifying an addend in the relocation type, so the addend has
+to go in the output data. This is no big deal since in these formats
+the output data slot will always be big enough for the addend. Complex
+reloc types with addends were invented to solve just this problem. The
+ERROR_MESSAGE argument is set to an error message if this return
+`bfd_reloc_dangerous'.
+
+2.10.1.8 `bfd_install_relocation'
+.................................
+
+*Synopsis*
+ bfd_reloc_status_type bfd_install_relocation
+ (bfd *abfd,
+ arelent *reloc_entry,
+ void *data, bfd_vma data_start,
+ asection *input_section,
+ char **error_message);
+ *Description*
+This looks remarkably like `bfd_perform_relocation', except it does not
+expect that the section contents have been filled in. I.e., it's
+suitable for use when creating, rather than applying a relocation.
+
+ For now, this function should be considered reserved for the
+assembler.
+
+
+File: bfd.info, Node: howto manager, Prev: typedef arelent, Up: Relocations
+
+2.10.2 The howto manager
+------------------------
+
+When an application wants to create a relocation, but doesn't know what
+the target machine might call it, it can find out by using this bit of
+code.
+
+2.10.2.1 `bfd_reloc_code_type'
+..............................
+
+*Description*
+The insides of a reloc code. The idea is that, eventually, there will
+be one enumerator for every type of relocation we ever do. Pass one of
+these values to `bfd_reloc_type_lookup', and it'll return a howto
+pointer.
+
+ This does mean that the application must determine the correct
+enumerator value; you can't get a howto pointer from a random set of
+attributes.
+
+ Here are the possible values for `enum bfd_reloc_code_real':
+
+ -- : BFD_RELOC_64
+ -- : BFD_RELOC_32
+ -- : BFD_RELOC_26
+ -- : BFD_RELOC_24
+ -- : BFD_RELOC_16
+ -- : BFD_RELOC_14
+ -- : BFD_RELOC_8
+ Basic absolute relocations of N bits.
+
+ -- : BFD_RELOC_64_PCREL
+ -- : BFD_RELOC_32_PCREL
+ -- : BFD_RELOC_24_PCREL
+ -- : BFD_RELOC_16_PCREL
+ -- : BFD_RELOC_12_PCREL
+ -- : BFD_RELOC_8_PCREL
+ PC-relative relocations. Sometimes these are relative to the
+ address of the relocation itself; sometimes they are relative to
+ the start of the section containing the relocation. It depends on
+ the specific target.
+
+ The 24-bit relocation is used in some Intel 960 configurations.
+
+ -- : BFD_RELOC_32_SECREL
+ Section relative relocations. Some targets need this for DWARF2.
+
+ -- : BFD_RELOC_32_GOT_PCREL
+ -- : BFD_RELOC_16_GOT_PCREL
+ -- : BFD_RELOC_8_GOT_PCREL
+ -- : BFD_RELOC_32_GOTOFF
+ -- : BFD_RELOC_16_GOTOFF
+ -- : BFD_RELOC_LO16_GOTOFF
+ -- : BFD_RELOC_HI16_GOTOFF
+ -- : BFD_RELOC_HI16_S_GOTOFF
+ -- : BFD_RELOC_8_GOTOFF
+ -- : BFD_RELOC_64_PLT_PCREL
+ -- : BFD_RELOC_32_PLT_PCREL
+ -- : BFD_RELOC_24_PLT_PCREL
+ -- : BFD_RELOC_16_PLT_PCREL
+ -- : BFD_RELOC_8_PLT_PCREL
+ -- : BFD_RELOC_64_PLTOFF
+ -- : BFD_RELOC_32_PLTOFF
+ -- : BFD_RELOC_16_PLTOFF
+ -- : BFD_RELOC_LO16_PLTOFF
+ -- : BFD_RELOC_HI16_PLTOFF
+ -- : BFD_RELOC_HI16_S_PLTOFF
+ -- : BFD_RELOC_8_PLTOFF
+ For ELF.
+
+ -- : BFD_RELOC_68K_GLOB_DAT
+ -- : BFD_RELOC_68K_JMP_SLOT
+ -- : BFD_RELOC_68K_RELATIVE
+ -- : BFD_RELOC_68K_TLS_GD32
+ -- : BFD_RELOC_68K_TLS_GD16
+ -- : BFD_RELOC_68K_TLS_GD8
+ -- : BFD_RELOC_68K_TLS_LDM32
+ -- : BFD_RELOC_68K_TLS_LDM16
+ -- : BFD_RELOC_68K_TLS_LDM8
+ -- : BFD_RELOC_68K_TLS_LDO32
+ -- : BFD_RELOC_68K_TLS_LDO16
+ -- : BFD_RELOC_68K_TLS_LDO8
+ -- : BFD_RELOC_68K_TLS_IE32
+ -- : BFD_RELOC_68K_TLS_IE16
+ -- : BFD_RELOC_68K_TLS_IE8
+ -- : BFD_RELOC_68K_TLS_LE32
+ -- : BFD_RELOC_68K_TLS_LE16
+ -- : BFD_RELOC_68K_TLS_LE8
+ Relocations used by 68K ELF.
+
+ -- : BFD_RELOC_32_BASEREL
+ -- : BFD_RELOC_16_BASEREL
+ -- : BFD_RELOC_LO16_BASEREL
+ -- : BFD_RELOC_HI16_BASEREL
+ -- : BFD_RELOC_HI16_S_BASEREL
+ -- : BFD_RELOC_8_BASEREL
+ -- : BFD_RELOC_RVA
+ Linkage-table relative.
+
+ -- : BFD_RELOC_8_FFnn
+ Absolute 8-bit relocation, but used to form an address like 0xFFnn.
+
+ -- : BFD_RELOC_32_PCREL_S2
+ -- : BFD_RELOC_16_PCREL_S2
+ -- : BFD_RELOC_23_PCREL_S2
+ These PC-relative relocations are stored as word displacements -
+ i.e., byte displacements shifted right two bits. The 30-bit word
+ displacement (<<32_PCREL_S2>> - 32 bits, shifted 2) is used on the
+ SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The
+ signed 16-bit displacement is used on the MIPS, and the 23-bit
+ displacement is used on the Alpha.
+
+ -- : BFD_RELOC_HI22
+ -- : BFD_RELOC_LO10
+ High 22 bits and low 10 bits of 32-bit value, placed into lower
+ bits of the target word. These are used on the SPARC.
+
+ -- : BFD_RELOC_GPREL16
+ -- : BFD_RELOC_GPREL32
+ For systems that allocate a Global Pointer register, these are
+ displacements off that register. These relocation types are
+ handled specially, because the value the register will have is
+ decided relatively late.
+
+ -- : BFD_RELOC_I960_CALLJ
+ Reloc types used for i960/b.out.
+
+ -- : BFD_RELOC_NONE
+ -- : BFD_RELOC_SPARC_WDISP22
+ -- : BFD_RELOC_SPARC22
+ -- : BFD_RELOC_SPARC13
+ -- : BFD_RELOC_SPARC_GOT10
+ -- : BFD_RELOC_SPARC_GOT13
+ -- : BFD_RELOC_SPARC_GOT22
+ -- : BFD_RELOC_SPARC_PC10
+ -- : BFD_RELOC_SPARC_PC22
+ -- : BFD_RELOC_SPARC_WPLT30
+ -- : BFD_RELOC_SPARC_COPY
+ -- : BFD_RELOC_SPARC_GLOB_DAT
+ -- : BFD_RELOC_SPARC_JMP_SLOT
+ -- : BFD_RELOC_SPARC_RELATIVE
+ -- : BFD_RELOC_SPARC_UA16
+ -- : BFD_RELOC_SPARC_UA32
+ -- : BFD_RELOC_SPARC_UA64
+ -- : BFD_RELOC_SPARC_GOTDATA_HIX22
+ -- : BFD_RELOC_SPARC_GOTDATA_LOX10
+ -- : BFD_RELOC_SPARC_GOTDATA_OP_HIX22
+ -- : BFD_RELOC_SPARC_GOTDATA_OP_LOX10
+ -- : BFD_RELOC_SPARC_GOTDATA_OP
+ SPARC ELF relocations. There is probably some overlap with other
+ relocation types already defined.
+
+ -- : BFD_RELOC_SPARC_BASE13
+ -- : BFD_RELOC_SPARC_BASE22
+ I think these are specific to SPARC a.out (e.g., Sun 4).
+
+ -- : BFD_RELOC_SPARC_64
+ -- : BFD_RELOC_SPARC_10
+ -- : BFD_RELOC_SPARC_11
+ -- : BFD_RELOC_SPARC_OLO10
+ -- : BFD_RELOC_SPARC_HH22
+ -- : BFD_RELOC_SPARC_HM10
+ -- : BFD_RELOC_SPARC_LM22
+ -- : BFD_RELOC_SPARC_PC_HH22
+ -- : BFD_RELOC_SPARC_PC_HM10
+ -- : BFD_RELOC_SPARC_PC_LM22
+ -- : BFD_RELOC_SPARC_WDISP16
+ -- : BFD_RELOC_SPARC_WDISP19
+ -- : BFD_RELOC_SPARC_7
+ -- : BFD_RELOC_SPARC_6
+ -- : BFD_RELOC_SPARC_5
+ -- : BFD_RELOC_SPARC_DISP64
+ -- : BFD_RELOC_SPARC_PLT32
+ -- : BFD_RELOC_SPARC_PLT64
+ -- : BFD_RELOC_SPARC_HIX22
+ -- : BFD_RELOC_SPARC_LOX10
+ -- : BFD_RELOC_SPARC_H44
+ -- : BFD_RELOC_SPARC_M44
+ -- : BFD_RELOC_SPARC_L44
+ -- : BFD_RELOC_SPARC_REGISTER
+ SPARC64 relocations
+
+ -- : BFD_RELOC_SPARC_REV32
+ SPARC little endian relocation
+
+ -- : BFD_RELOC_SPARC_TLS_GD_HI22
+ -- : BFD_RELOC_SPARC_TLS_GD_LO10
+ -- : BFD_RELOC_SPARC_TLS_GD_ADD
+ -- : BFD_RELOC_SPARC_TLS_GD_CALL
+ -- : BFD_RELOC_SPARC_TLS_LDM_HI22
+ -- : BFD_RELOC_SPARC_TLS_LDM_LO10
+ -- : BFD_RELOC_SPARC_TLS_LDM_ADD
+ -- : BFD_RELOC_SPARC_TLS_LDM_CALL
+ -- : BFD_RELOC_SPARC_TLS_LDO_HIX22
+ -- : BFD_RELOC_SPARC_TLS_LDO_LOX10
+ -- : BFD_RELOC_SPARC_TLS_LDO_ADD
+ -- : BFD_RELOC_SPARC_TLS_IE_HI22
+ -- : BFD_RELOC_SPARC_TLS_IE_LO10
+ -- : BFD_RELOC_SPARC_TLS_IE_LD
+ -- : BFD_RELOC_SPARC_TLS_IE_LDX
+ -- : BFD_RELOC_SPARC_TLS_IE_ADD
+ -- : BFD_RELOC_SPARC_TLS_LE_HIX22
+ -- : BFD_RELOC_SPARC_TLS_LE_LOX10
+ -- : BFD_RELOC_SPARC_TLS_DTPMOD32
+ -- : BFD_RELOC_SPARC_TLS_DTPMOD64
+ -- : BFD_RELOC_SPARC_TLS_DTPOFF32
+ -- : BFD_RELOC_SPARC_TLS_DTPOFF64
+ -- : BFD_RELOC_SPARC_TLS_TPOFF32
+ -- : BFD_RELOC_SPARC_TLS_TPOFF64
+ SPARC TLS relocations
+
+ -- : BFD_RELOC_SPU_IMM7
+ -- : BFD_RELOC_SPU_IMM8
+ -- : BFD_RELOC_SPU_IMM10
+ -- : BFD_RELOC_SPU_IMM10W
+ -- : BFD_RELOC_SPU_IMM16
+ -- : BFD_RELOC_SPU_IMM16W
+ -- : BFD_RELOC_SPU_IMM18
+ -- : BFD_RELOC_SPU_PCREL9a
+ -- : BFD_RELOC_SPU_PCREL9b
+ -- : BFD_RELOC_SPU_PCREL16
+ -- : BFD_RELOC_SPU_LO16
+ -- : BFD_RELOC_SPU_HI16
+ -- : BFD_RELOC_SPU_PPU32
+ -- : BFD_RELOC_SPU_PPU64
+ -- : BFD_RELOC_SPU_ADD_PIC
+ SPU Relocations.
+
+ -- : BFD_RELOC_ALPHA_GPDISP_HI16
+ Alpha ECOFF and ELF relocations. Some of these treat the symbol or
+ "addend" in some special way. For GPDISP_HI16 ("gpdisp")
+ relocations, the symbol is ignored when writing; when reading, it
+ will be the absolute section symbol. The addend is the
+ displacement in bytes of the "lda" instruction from the "ldah"
+ instruction (which is at the address of this reloc).
+
+ -- : BFD_RELOC_ALPHA_GPDISP_LO16
+ For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
+ with GPDISP_HI16 relocs. The addend is ignored when writing the
+ relocations out, and is filled in with the file's GP value on
+ reading, for convenience.
+
+ -- : BFD_RELOC_ALPHA_GPDISP
+ The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
+ relocation except that there is no accompanying GPDISP_LO16
+ relocation.
+
+ -- : BFD_RELOC_ALPHA_LITERAL
+ -- : BFD_RELOC_ALPHA_ELF_LITERAL
+ -- : BFD_RELOC_ALPHA_LITUSE
+ The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
+ the assembler turns it into a LDQ instruction to load the address
+ of the symbol, and then fills in a register in the real
+ instruction.
+
+ The LITERAL reloc, at the LDQ instruction, refers to the .lita
+ section symbol. The addend is ignored when writing, but is filled
+ in with the file's GP value on reading, for convenience, as with
+ the GPDISP_LO16 reloc.
+
+ The ELF_LITERAL reloc is somewhere between 16_GOTOFF and
+ GPDISP_LO16. It should refer to the symbol to be referenced, as
+ with 16_GOTOFF, but it generates output not based on the position
+ within the .got section, but relative to the GP value chosen for
+ the file during the final link stage.
+
+ The LITUSE reloc, on the instruction using the loaded address,
+ gives information to the linker that it might be able to use to
+ optimize away some literal section references. The symbol is
+ ignored (read as the absolute section symbol), and the "addend"
+ indicates the type of instruction using the register: 1 - "memory"
+ fmt insn 2 - byte-manipulation (byte offset reg) 3 - jsr (target
+ of branch)
+
+ -- : BFD_RELOC_ALPHA_HINT
+ The HINT relocation indicates a value that should be filled into
+ the "hint" field of a jmp/jsr/ret instruction, for possible branch-
+ prediction logic which may be provided on some processors.
+
+ -- : BFD_RELOC_ALPHA_LINKAGE
+ The LINKAGE relocation outputs a linkage pair in the object file,
+ which is filled by the linker.
+
+ -- : BFD_RELOC_ALPHA_CODEADDR
+ The CODEADDR relocation outputs a STO_CA in the object file, which
+ is filled by the linker.
+
+ -- : BFD_RELOC_ALPHA_GPREL_HI16
+ -- : BFD_RELOC_ALPHA_GPREL_LO16
+ The GPREL_HI/LO relocations together form a 32-bit offset from the
+ GP register.
+
+ -- : BFD_RELOC_ALPHA_BRSGP
+ Like BFD_RELOC_23_PCREL_S2, except that the source and target must
+ share a common GP, and the target address is adjusted for
+ STO_ALPHA_STD_GPLOAD.
+
+ -- : BFD_RELOC_ALPHA_NOP
+ The NOP relocation outputs a NOP if the longword displacement
+ between two procedure entry points is < 2^21.
+
+ -- : BFD_RELOC_ALPHA_BSR
+ The BSR relocation outputs a BSR if the longword displacement
+ between two procedure entry points is < 2^21.
+
+ -- : BFD_RELOC_ALPHA_LDA
+ The LDA relocation outputs a LDA if the longword displacement
+ between two procedure entry points is < 2^16.
+
+ -- : BFD_RELOC_ALPHA_BOH
+ The BOH relocation outputs a BSR if the longword displacement
+ between two procedure entry points is < 2^21, or else a hint.
+
+ -- : BFD_RELOC_ALPHA_TLSGD
+ -- : BFD_RELOC_ALPHA_TLSLDM
+ -- : BFD_RELOC_ALPHA_DTPMOD64
+ -- : BFD_RELOC_ALPHA_GOTDTPREL16
+ -- : BFD_RELOC_ALPHA_DTPREL64
+ -- : BFD_RELOC_ALPHA_DTPREL_HI16
+ -- : BFD_RELOC_ALPHA_DTPREL_LO16
+ -- : BFD_RELOC_ALPHA_DTPREL16
+ -- : BFD_RELOC_ALPHA_GOTTPREL16
+ -- : BFD_RELOC_ALPHA_TPREL64
+ -- : BFD_RELOC_ALPHA_TPREL_HI16
+ -- : BFD_RELOC_ALPHA_TPREL_LO16
+ -- : BFD_RELOC_ALPHA_TPREL16
+ Alpha thread-local storage relocations.
+
+ -- : BFD_RELOC_MIPS_JMP
+ Bits 27..2 of the relocation address shifted right 2 bits; simple
+ reloc otherwise.
+
+ -- : BFD_RELOC_MIPS16_JMP
+ The MIPS16 jump instruction.
+
+ -- : BFD_RELOC_MIPS16_GPREL
+ MIPS16 GP relative reloc.
+
+ -- : BFD_RELOC_HI16
+ High 16 bits of 32-bit value; simple reloc.
+
+ -- : BFD_RELOC_HI16_S
+ High 16 bits of 32-bit value but the low 16 bits will be sign
+ extended and added to form the final result. If the low 16 bits
+ form a negative number, we need to add one to the high value to
+ compensate for the borrow when the low bits are added.
+
+ -- : BFD_RELOC_LO16
+ Low 16 bits.
+
+ -- : BFD_RELOC_HI16_PCREL
+ High 16 bits of 32-bit pc-relative value
+
+ -- : BFD_RELOC_HI16_S_PCREL
+ High 16 bits of 32-bit pc-relative value, adjusted
+
+ -- : BFD_RELOC_LO16_PCREL
+ Low 16 bits of pc-relative value
+
+ -- : BFD_RELOC_MIPS16_GOT16
+ -- : BFD_RELOC_MIPS16_CALL16
+ Equivalent of BFD_RELOC_MIPS_*, but with the MIPS16 layout of
+ 16-bit immediate fields
+
+ -- : BFD_RELOC_MIPS16_HI16
+ MIPS16 high 16 bits of 32-bit value.
+
+ -- : BFD_RELOC_MIPS16_HI16_S
+ MIPS16 high 16 bits of 32-bit value but the low 16 bits will be
+ sign extended and added to form the final result. If the low 16
+ bits form a negative number, we need to add one to the high value
+ to compensate for the borrow when the low bits are added.
+
+ -- : BFD_RELOC_MIPS16_LO16
+ MIPS16 low 16 bits.
+
+ -- : BFD_RELOC_MIPS_LITERAL
+ Relocation against a MIPS literal section.
+
+ -- : BFD_RELOC_MIPS_GOT16
+ -- : BFD_RELOC_MIPS_CALL16
+ -- : BFD_RELOC_MIPS_GOT_HI16
+ -- : BFD_RELOC_MIPS_GOT_LO16
+ -- : BFD_RELOC_MIPS_CALL_HI16
+ -- : BFD_RELOC_MIPS_CALL_LO16
+ -- : BFD_RELOC_MIPS_SUB
+ -- : BFD_RELOC_MIPS_GOT_PAGE
+ -- : BFD_RELOC_MIPS_GOT_OFST
+ -- : BFD_RELOC_MIPS_GOT_DISP
+ -- : BFD_RELOC_MIPS_SHIFT5
+ -- : BFD_RELOC_MIPS_SHIFT6
+ -- : BFD_RELOC_MIPS_INSERT_A
+ -- : BFD_RELOC_MIPS_INSERT_B
+ -- : BFD_RELOC_MIPS_DELETE
+ -- : BFD_RELOC_MIPS_HIGHEST
+ -- : BFD_RELOC_MIPS_HIGHER
+ -- : BFD_RELOC_MIPS_SCN_DISP
+ -- : BFD_RELOC_MIPS_REL16
+ -- : BFD_RELOC_MIPS_RELGOT
+ -- : BFD_RELOC_MIPS_JALR
+ -- : BFD_RELOC_MIPS_TLS_DTPMOD32
+ -- : BFD_RELOC_MIPS_TLS_DTPREL32
+ -- : BFD_RELOC_MIPS_TLS_DTPMOD64
+ -- : BFD_RELOC_MIPS_TLS_DTPREL64
+ -- : BFD_RELOC_MIPS_TLS_GD
+ -- : BFD_RELOC_MIPS_TLS_LDM
+ -- : BFD_RELOC_MIPS_TLS_DTPREL_HI16
+ -- : BFD_RELOC_MIPS_TLS_DTPREL_LO16
+ -- : BFD_RELOC_MIPS_TLS_GOTTPREL
+ -- : BFD_RELOC_MIPS_TLS_TPREL32
+ -- : BFD_RELOC_MIPS_TLS_TPREL64
+ -- : BFD_RELOC_MIPS_TLS_TPREL_HI16
+ -- : BFD_RELOC_MIPS_TLS_TPREL_LO16
+ MIPS ELF relocations.
+
+ -- : BFD_RELOC_MIPS_COPY
+ -- : BFD_RELOC_MIPS_JUMP_SLOT
+ MIPS ELF relocations (VxWorks and PLT extensions).
+
+ -- : BFD_RELOC_MOXIE_10_PCREL
+ Moxie ELF relocations.
+
+ -- : BFD_RELOC_FRV_LABEL16
+ -- : BFD_RELOC_FRV_LABEL24
+ -- : BFD_RELOC_FRV_LO16
+ -- : BFD_RELOC_FRV_HI16
+ -- : BFD_RELOC_FRV_GPREL12
+ -- : BFD_RELOC_FRV_GPRELU12
+ -- : BFD_RELOC_FRV_GPREL32
+ -- : BFD_RELOC_FRV_GPRELHI
+ -- : BFD_RELOC_FRV_GPRELLO
+ -- : BFD_RELOC_FRV_GOT12
+ -- : BFD_RELOC_FRV_GOTHI
+ -- : BFD_RELOC_FRV_GOTLO
+ -- : BFD_RELOC_FRV_FUNCDESC
+ -- : BFD_RELOC_FRV_FUNCDESC_GOT12
+ -- : BFD_RELOC_FRV_FUNCDESC_GOTHI
+ -- : BFD_RELOC_FRV_FUNCDESC_GOTLO
+ -- : BFD_RELOC_FRV_FUNCDESC_VALUE
+ -- : BFD_RELOC_FRV_FUNCDESC_GOTOFF12
+ -- : BFD_RELOC_FRV_FUNCDESC_GOTOFFHI
+ -- : BFD_RELOC_FRV_FUNCDESC_GOTOFFLO
+ -- : BFD_RELOC_FRV_GOTOFF12
+ -- : BFD_RELOC_FRV_GOTOFFHI
+ -- : BFD_RELOC_FRV_GOTOFFLO
+ -- : BFD_RELOC_FRV_GETTLSOFF
+ -- : BFD_RELOC_FRV_TLSDESC_VALUE
+ -- : BFD_RELOC_FRV_GOTTLSDESC12
+ -- : BFD_RELOC_FRV_GOTTLSDESCHI
+ -- : BFD_RELOC_FRV_GOTTLSDESCLO
+ -- : BFD_RELOC_FRV_TLSMOFF12
+ -- : BFD_RELOC_FRV_TLSMOFFHI
+ -- : BFD_RELOC_FRV_TLSMOFFLO
+ -- : BFD_RELOC_FRV_GOTTLSOFF12
+ -- : BFD_RELOC_FRV_GOTTLSOFFHI
+ -- : BFD_RELOC_FRV_GOTTLSOFFLO
+ -- : BFD_RELOC_FRV_TLSOFF
+ -- : BFD_RELOC_FRV_TLSDESC_RELAX
+ -- : BFD_RELOC_FRV_GETTLSOFF_RELAX
+ -- : BFD_RELOC_FRV_TLSOFF_RELAX
+ -- : BFD_RELOC_FRV_TLSMOFF
+ Fujitsu Frv Relocations.
+
+ -- : BFD_RELOC_MN10300_GOTOFF24
+ This is a 24bit GOT-relative reloc for the mn10300.
+
+ -- : BFD_RELOC_MN10300_GOT32
+ This is a 32bit GOT-relative reloc for the mn10300, offset by two
+ bytes in the instruction.
+
+ -- : BFD_RELOC_MN10300_GOT24
+ This is a 24bit GOT-relative reloc for the mn10300, offset by two
+ bytes in the instruction.
+
+ -- : BFD_RELOC_MN10300_GOT16
+ This is a 16bit GOT-relative reloc for the mn10300, offset by two
+ bytes in the instruction.
+
+ -- : BFD_RELOC_MN10300_COPY
+ Copy symbol at runtime.
+
+ -- : BFD_RELOC_MN10300_GLOB_DAT
+ Create GOT entry.
+
+ -- : BFD_RELOC_MN10300_JMP_SLOT
+ Create PLT entry.
+
+ -- : BFD_RELOC_MN10300_RELATIVE
+ Adjust by program base.
+
+ -- : BFD_RELOC_MN10300_SYM_DIFF
+ Together with another reloc targeted at the same location, allows
+ for a value that is the difference of two symbols in the same
+ section.
+
+ -- : BFD_RELOC_MN10300_ALIGN
+ The addend of this reloc is an alignment power that must be
+ honoured at the offset's location, regardless of linker relaxation.
+
+ -- : BFD_RELOC_386_GOT32
+ -- : BFD_RELOC_386_PLT32
+ -- : BFD_RELOC_386_COPY
+ -- : BFD_RELOC_386_GLOB_DAT
+ -- : BFD_RELOC_386_JUMP_SLOT
+ -- : BFD_RELOC_386_RELATIVE
+ -- : BFD_RELOC_386_GOTOFF
+ -- : BFD_RELOC_386_GOTPC
+ -- : BFD_RELOC_386_TLS_TPOFF
+ -- : BFD_RELOC_386_TLS_IE
+ -- : BFD_RELOC_386_TLS_GOTIE
+ -- : BFD_RELOC_386_TLS_LE
+ -- : BFD_RELOC_386_TLS_GD
+ -- : BFD_RELOC_386_TLS_LDM
+ -- : BFD_RELOC_386_TLS_LDO_32
+ -- : BFD_RELOC_386_TLS_IE_32
+ -- : BFD_RELOC_386_TLS_LE_32
+ -- : BFD_RELOC_386_TLS_DTPMOD32
+ -- : BFD_RELOC_386_TLS_DTPOFF32
+ -- : BFD_RELOC_386_TLS_TPOFF32
+ -- : BFD_RELOC_386_TLS_GOTDESC
+ -- : BFD_RELOC_386_TLS_DESC_CALL
+ -- : BFD_RELOC_386_TLS_DESC
+ -- : BFD_RELOC_386_IRELATIVE
+ i386/elf relocations
+
+ -- : BFD_RELOC_X86_64_GOT32
+ -- : BFD_RELOC_X86_64_PLT32
+ -- : BFD_RELOC_X86_64_COPY
+ -- : BFD_RELOC_X86_64_GLOB_DAT
+ -- : BFD_RELOC_X86_64_JUMP_SLOT
+ -- : BFD_RELOC_X86_64_RELATIVE
+ -- : BFD_RELOC_X86_64_GOTPCREL
+ -- : BFD_RELOC_X86_64_32S
+ -- : BFD_RELOC_X86_64_DTPMOD64
+ -- : BFD_RELOC_X86_64_DTPOFF64
+ -- : BFD_RELOC_X86_64_TPOFF64
+ -- : BFD_RELOC_X86_64_TLSGD
+ -- : BFD_RELOC_X86_64_TLSLD
+ -- : BFD_RELOC_X86_64_DTPOFF32
+ -- : BFD_RELOC_X86_64_GOTTPOFF
+ -- : BFD_RELOC_X86_64_TPOFF32
+ -- : BFD_RELOC_X86_64_GOTOFF64
+ -- : BFD_RELOC_X86_64_GOTPC32
+ -- : BFD_RELOC_X86_64_GOT64
+ -- : BFD_RELOC_X86_64_GOTPCREL64
+ -- : BFD_RELOC_X86_64_GOTPC64
+ -- : BFD_RELOC_X86_64_GOTPLT64
+ -- : BFD_RELOC_X86_64_PLTOFF64
+ -- : BFD_RELOC_X86_64_GOTPC32_TLSDESC
+ -- : BFD_RELOC_X86_64_TLSDESC_CALL
+ -- : BFD_RELOC_X86_64_TLSDESC
+ -- : BFD_RELOC_X86_64_IRELATIVE
+ x86-64/elf relocations
+
+ -- : BFD_RELOC_NS32K_IMM_8
+ -- : BFD_RELOC_NS32K_IMM_16
+ -- : BFD_RELOC_NS32K_IMM_32
+ -- : BFD_RELOC_NS32K_IMM_8_PCREL
+ -- : BFD_RELOC_NS32K_IMM_16_PCREL
+ -- : BFD_RELOC_NS32K_IMM_32_PCREL
+ -- : BFD_RELOC_NS32K_DISP_8
+ -- : BFD_RELOC_NS32K_DISP_16
+ -- : BFD_RELOC_NS32K_DISP_32
+ -- : BFD_RELOC_NS32K_DISP_8_PCREL
+ -- : BFD_RELOC_NS32K_DISP_16_PCREL
+ -- : BFD_RELOC_NS32K_DISP_32_PCREL
+ ns32k relocations
+
+ -- : BFD_RELOC_PDP11_DISP_8_PCREL
+ -- : BFD_RELOC_PDP11_DISP_6_PCREL
+ PDP11 relocations
+
+ -- : BFD_RELOC_PJ_CODE_HI16
+ -- : BFD_RELOC_PJ_CODE_LO16
+ -- : BFD_RELOC_PJ_CODE_DIR16
+ -- : BFD_RELOC_PJ_CODE_DIR32
+ -- : BFD_RELOC_PJ_CODE_REL16
+ -- : BFD_RELOC_PJ_CODE_REL32
+ Picojava relocs. Not all of these appear in object files.
+
+ -- : BFD_RELOC_PPC_B26
+ -- : BFD_RELOC_PPC_BA26
+ -- : BFD_RELOC_PPC_TOC16
+ -- : BFD_RELOC_PPC_B16
+ -- : BFD_RELOC_PPC_B16_BRTAKEN
+ -- : BFD_RELOC_PPC_B16_BRNTAKEN
+ -- : BFD_RELOC_PPC_BA16
+ -- : BFD_RELOC_PPC_BA16_BRTAKEN
+ -- : BFD_RELOC_PPC_BA16_BRNTAKEN
+ -- : BFD_RELOC_PPC_COPY
+ -- : BFD_RELOC_PPC_GLOB_DAT
+ -- : BFD_RELOC_PPC_JMP_SLOT
+ -- : BFD_RELOC_PPC_RELATIVE
+ -- : BFD_RELOC_PPC_LOCAL24PC
+ -- : BFD_RELOC_PPC_EMB_NADDR32
+ -- : BFD_RELOC_PPC_EMB_NADDR16
+ -- : BFD_RELOC_PPC_EMB_NADDR16_LO
+ -- : BFD_RELOC_PPC_EMB_NADDR16_HI
+ -- : BFD_RELOC_PPC_EMB_NADDR16_HA
+ -- : BFD_RELOC_PPC_EMB_SDAI16
+ -- : BFD_RELOC_PPC_EMB_SDA2I16
+ -- : BFD_RELOC_PPC_EMB_SDA2REL
+ -- : BFD_RELOC_PPC_EMB_SDA21
+ -- : BFD_RELOC_PPC_EMB_MRKREF
+ -- : BFD_RELOC_PPC_EMB_RELSEC16
+ -- : BFD_RELOC_PPC_EMB_RELST_LO
+ -- : BFD_RELOC_PPC_EMB_RELST_HI
+ -- : BFD_RELOC_PPC_EMB_RELST_HA
+ -- : BFD_RELOC_PPC_EMB_BIT_FLD
+ -- : BFD_RELOC_PPC_EMB_RELSDA
+ -- : BFD_RELOC_PPC64_HIGHER
+ -- : BFD_RELOC_PPC64_HIGHER_S
+ -- : BFD_RELOC_PPC64_HIGHEST
+ -- : BFD_RELOC_PPC64_HIGHEST_S
+ -- : BFD_RELOC_PPC64_TOC16_LO
+ -- : BFD_RELOC_PPC64_TOC16_HI
+ -- : BFD_RELOC_PPC64_TOC16_HA
+ -- : BFD_RELOC_PPC64_TOC
+ -- : BFD_RELOC_PPC64_PLTGOT16
+ -- : BFD_RELOC_PPC64_PLTGOT16_LO
+ -- : BFD_RELOC_PPC64_PLTGOT16_HI
+ -- : BFD_RELOC_PPC64_PLTGOT16_HA
+ -- : BFD_RELOC_PPC64_ADDR16_DS
+ -- : BFD_RELOC_PPC64_ADDR16_LO_DS
+ -- : BFD_RELOC_PPC64_GOT16_DS
+ -- : BFD_RELOC_PPC64_GOT16_LO_DS
+ -- : BFD_RELOC_PPC64_PLT16_LO_DS
+ -- : BFD_RELOC_PPC64_SECTOFF_DS
+ -- : BFD_RELOC_PPC64_SECTOFF_LO_DS
+ -- : BFD_RELOC_PPC64_TOC16_DS
+ -- : BFD_RELOC_PPC64_TOC16_LO_DS
+ -- : BFD_RELOC_PPC64_PLTGOT16_DS
+ -- : BFD_RELOC_PPC64_PLTGOT16_LO_DS
+ Power(rs6000) and PowerPC relocations.
+
+ -- : BFD_RELOC_PPC_TLS
+ -- : BFD_RELOC_PPC_TLSGD
+ -- : BFD_RELOC_PPC_TLSLD
+ -- : BFD_RELOC_PPC_DTPMOD
+ -- : BFD_RELOC_PPC_TPREL16
+ -- : BFD_RELOC_PPC_TPREL16_LO
+ -- : BFD_RELOC_PPC_TPREL16_HI
+ -- : BFD_RELOC_PPC_TPREL16_HA
+ -- : BFD_RELOC_PPC_TPREL
+ -- : BFD_RELOC_PPC_DTPREL16
+ -- : BFD_RELOC_PPC_DTPREL16_LO
+ -- : BFD_RELOC_PPC_DTPREL16_HI
+ -- : BFD_RELOC_PPC_DTPREL16_HA
+ -- : BFD_RELOC_PPC_DTPREL
+ -- : BFD_RELOC_PPC_GOT_TLSGD16
+ -- : BFD_RELOC_PPC_GOT_TLSGD16_LO
+ -- : BFD_RELOC_PPC_GOT_TLSGD16_HI
+ -- : BFD_RELOC_PPC_GOT_TLSGD16_HA
+ -- : BFD_RELOC_PPC_GOT_TLSLD16
+ -- : BFD_RELOC_PPC_GOT_TLSLD16_LO
+ -- : BFD_RELOC_PPC_GOT_TLSLD16_HI
+ -- : BFD_RELOC_PPC_GOT_TLSLD16_HA
+ -- : BFD_RELOC_PPC_GOT_TPREL16
+ -- : BFD_RELOC_PPC_GOT_TPREL16_LO
+ -- : BFD_RELOC_PPC_GOT_TPREL16_HI
+ -- : BFD_RELOC_PPC_GOT_TPREL16_HA
+ -- : BFD_RELOC_PPC_GOT_DTPREL16
+ -- : BFD_RELOC_PPC_GOT_DTPREL16_LO
+ -- : BFD_RELOC_PPC_GOT_DTPREL16_HI
+ -- : BFD_RELOC_PPC_GOT_DTPREL16_HA
+ -- : BFD_RELOC_PPC64_TPREL16_DS
+ -- : BFD_RELOC_PPC64_TPREL16_LO_DS
+ -- : BFD_RELOC_PPC64_TPREL16_HIGHER
+ -- : BFD_RELOC_PPC64_TPREL16_HIGHERA
+ -- : BFD_RELOC_PPC64_TPREL16_HIGHEST
+ -- : BFD_RELOC_PPC64_TPREL16_HIGHESTA
+ -- : BFD_RELOC_PPC64_DTPREL16_DS
+ -- : BFD_RELOC_PPC64_DTPREL16_LO_DS
+ -- : BFD_RELOC_PPC64_DTPREL16_HIGHER
+ -- : BFD_RELOC_PPC64_DTPREL16_HIGHERA
+ -- : BFD_RELOC_PPC64_DTPREL16_HIGHEST
+ -- : BFD_RELOC_PPC64_DTPREL16_HIGHESTA
+ PowerPC and PowerPC64 thread-local storage relocations.
+
+ -- : BFD_RELOC_I370_D12
+ IBM 370/390 relocations
+
+ -- : BFD_RELOC_CTOR
+ The type of reloc used to build a constructor table - at the moment
+ probably a 32 bit wide absolute relocation, but the target can
+ choose. It generally does map to one of the other relocation
+ types.
+
+ -- : BFD_RELOC_ARM_PCREL_BRANCH
+ ARM 26 bit pc-relative branch. The lowest two bits must be zero
+ and are not stored in the instruction.
+
+ -- : BFD_RELOC_ARM_PCREL_BLX
+ ARM 26 bit pc-relative branch. The lowest bit must be zero and is
+ not stored in the instruction. The 2nd lowest bit comes from a 1
+ bit field in the instruction.
+
+ -- : BFD_RELOC_THUMB_PCREL_BLX
+ Thumb 22 bit pc-relative branch. The lowest bit must be zero and
+ is not stored in the instruction. The 2nd lowest bit comes from a
+ 1 bit field in the instruction.
+
+ -- : BFD_RELOC_ARM_PCREL_CALL
+ ARM 26-bit pc-relative branch for an unconditional BL or BLX
+ instruction.
+
+ -- : BFD_RELOC_ARM_PCREL_JUMP
+ ARM 26-bit pc-relative branch for B or conditional BL instruction.
+
+ -- : BFD_RELOC_THUMB_PCREL_BRANCH7
+ -- : BFD_RELOC_THUMB_PCREL_BRANCH9
+ -- : BFD_RELOC_THUMB_PCREL_BRANCH12
+ -- : BFD_RELOC_THUMB_PCREL_BRANCH20
+ -- : BFD_RELOC_THUMB_PCREL_BRANCH23
+ -- : BFD_RELOC_THUMB_PCREL_BRANCH25
+ Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The
+ lowest bit must be zero and is not stored in the instruction.
+ Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
+ "nn" one smaller in all cases. Note further that BRANCH23
+ corresponds to R_ARM_THM_CALL.
+
+ -- : BFD_RELOC_ARM_OFFSET_IMM
+ 12-bit immediate offset, used in ARM-format ldr and str
+ instructions.
+
+ -- : BFD_RELOC_ARM_THUMB_OFFSET
+ 5-bit immediate offset, used in Thumb-format ldr and str
+ instructions.
+
+ -- : BFD_RELOC_ARM_TARGET1
+ Pc-relative or absolute relocation depending on target. Used for
+ entries in .init_array sections.
+
+ -- : BFD_RELOC_ARM_ROSEGREL32
+ Read-only segment base relative address.
+
+ -- : BFD_RELOC_ARM_SBREL32
+ Data segment base relative address.
+
+ -- : BFD_RELOC_ARM_TARGET2
+ This reloc is used for references to RTTI data from exception
+ handling tables. The actual definition depends on the target. It
+ may be a pc-relative or some form of GOT-indirect relocation.
+
+ -- : BFD_RELOC_ARM_PREL31
+ 31-bit PC relative address.
+
+ -- : BFD_RELOC_ARM_MOVW
+ -- : BFD_RELOC_ARM_MOVT
+ -- : BFD_RELOC_ARM_MOVW_PCREL
+ -- : BFD_RELOC_ARM_MOVT_PCREL
+ -- : BFD_RELOC_ARM_THUMB_MOVW
+ -- : BFD_RELOC_ARM_THUMB_MOVT
+ -- : BFD_RELOC_ARM_THUMB_MOVW_PCREL
+ -- : BFD_RELOC_ARM_THUMB_MOVT_PCREL
+ Low and High halfword relocations for MOVW and MOVT instructions.
+
+ -- : BFD_RELOC_ARM_JUMP_SLOT
+ -- : BFD_RELOC_ARM_GLOB_DAT
+ -- : BFD_RELOC_ARM_GOT32
+ -- : BFD_RELOC_ARM_PLT32
+ -- : BFD_RELOC_ARM_RELATIVE
+ -- : BFD_RELOC_ARM_GOTOFF
+ -- : BFD_RELOC_ARM_GOTPC
+ Relocations for setting up GOTs and PLTs for shared libraries.
+
+ -- : BFD_RELOC_ARM_TLS_GD32
+ -- : BFD_RELOC_ARM_TLS_LDO32
+ -- : BFD_RELOC_ARM_TLS_LDM32
+ -- : BFD_RELOC_ARM_TLS_DTPOFF32
+ -- : BFD_RELOC_ARM_TLS_DTPMOD32
+ -- : BFD_RELOC_ARM_TLS_TPOFF32
+ -- : BFD_RELOC_ARM_TLS_IE32
+ -- : BFD_RELOC_ARM_TLS_LE32
+ ARM thread-local storage relocations.
+
+ -- : BFD_RELOC_ARM_ALU_PC_G0_NC
+ -- : BFD_RELOC_ARM_ALU_PC_G0
+ -- : BFD_RELOC_ARM_ALU_PC_G1_NC
+ -- : BFD_RELOC_ARM_ALU_PC_G1
+ -- : BFD_RELOC_ARM_ALU_PC_G2
+ -- : BFD_RELOC_ARM_LDR_PC_G0
+ -- : BFD_RELOC_ARM_LDR_PC_G1
+ -- : BFD_RELOC_ARM_LDR_PC_G2
+ -- : BFD_RELOC_ARM_LDRS_PC_G0
+ -- : BFD_RELOC_ARM_LDRS_PC_G1
+ -- : BFD_RELOC_ARM_LDRS_PC_G2
+ -- : BFD_RELOC_ARM_LDC_PC_G0
+ -- : BFD_RELOC_ARM_LDC_PC_G1
+ -- : BFD_RELOC_ARM_LDC_PC_G2
+ -- : BFD_RELOC_ARM_ALU_SB_G0_NC
+ -- : BFD_RELOC_ARM_ALU_SB_G0
+ -- : BFD_RELOC_ARM_ALU_SB_G1_NC
+ -- : BFD_RELOC_ARM_ALU_SB_G1
+ -- : BFD_RELOC_ARM_ALU_SB_G2
+ -- : BFD_RELOC_ARM_LDR_SB_G0
+ -- : BFD_RELOC_ARM_LDR_SB_G1
+ -- : BFD_RELOC_ARM_LDR_SB_G2
+ -- : BFD_RELOC_ARM_LDRS_SB_G0
+ -- : BFD_RELOC_ARM_LDRS_SB_G1
+ -- : BFD_RELOC_ARM_LDRS_SB_G2
+ -- : BFD_RELOC_ARM_LDC_SB_G0
+ -- : BFD_RELOC_ARM_LDC_SB_G1
+ -- : BFD_RELOC_ARM_LDC_SB_G2
+ ARM group relocations.
+
+ -- : BFD_RELOC_ARM_V4BX
+ Annotation of BX instructions.
+
+ -- : BFD_RELOC_ARM_IMMEDIATE
+ -- : BFD_RELOC_ARM_ADRL_IMMEDIATE
+ -- : BFD_RELOC_ARM_T32_IMMEDIATE
+ -- : BFD_RELOC_ARM_T32_ADD_IMM
+ -- : BFD_RELOC_ARM_T32_IMM12
+ -- : BFD_RELOC_ARM_T32_ADD_PC12
+ -- : BFD_RELOC_ARM_SHIFT_IMM
+ -- : BFD_RELOC_ARM_SMC
+ -- : BFD_RELOC_ARM_SWI
+ -- : BFD_RELOC_ARM_MULTI
+ -- : BFD_RELOC_ARM_CP_OFF_IMM
+ -- : BFD_RELOC_ARM_CP_OFF_IMM_S2
+ -- : BFD_RELOC_ARM_T32_CP_OFF_IMM
+ -- : BFD_RELOC_ARM_T32_CP_OFF_IMM_S2
+ -- : BFD_RELOC_ARM_ADR_IMM
+ -- : BFD_RELOC_ARM_LDR_IMM
+ -- : BFD_RELOC_ARM_LITERAL
+ -- : BFD_RELOC_ARM_IN_POOL
+ -- : BFD_RELOC_ARM_OFFSET_IMM8
+ -- : BFD_RELOC_ARM_T32_OFFSET_U8
+ -- : BFD_RELOC_ARM_T32_OFFSET_IMM
+ -- : BFD_RELOC_ARM_HWLITERAL
+ -- : BFD_RELOC_ARM_THUMB_ADD
+ -- : BFD_RELOC_ARM_THUMB_IMM
+ -- : BFD_RELOC_ARM_THUMB_SHIFT
+ These relocs are only used within the ARM assembler. They are not
+ (at present) written to any object files.
+
+ -- : BFD_RELOC_SH_PCDISP8BY2
+ -- : BFD_RELOC_SH_PCDISP12BY2
+ -- : BFD_RELOC_SH_IMM3
+ -- : BFD_RELOC_SH_IMM3U
+ -- : BFD_RELOC_SH_DISP12
+ -- : BFD_RELOC_SH_DISP12BY2
+ -- : BFD_RELOC_SH_DISP12BY4
+ -- : BFD_RELOC_SH_DISP12BY8
+ -- : BFD_RELOC_SH_DISP20
+ -- : BFD_RELOC_SH_DISP20BY8
+ -- : BFD_RELOC_SH_IMM4
+ -- : BFD_RELOC_SH_IMM4BY2
+ -- : BFD_RELOC_SH_IMM4BY4
+ -- : BFD_RELOC_SH_IMM8
+ -- : BFD_RELOC_SH_IMM8BY2
+ -- : BFD_RELOC_SH_IMM8BY4
+ -- : BFD_RELOC_SH_PCRELIMM8BY2
+ -- : BFD_RELOC_SH_PCRELIMM8BY4
+ -- : BFD_RELOC_SH_SWITCH16
+ -- : BFD_RELOC_SH_SWITCH32
+ -- : BFD_RELOC_SH_USES
+ -- : BFD_RELOC_SH_COUNT
+ -- : BFD_RELOC_SH_ALIGN
+ -- : BFD_RELOC_SH_CODE
+ -- : BFD_RELOC_SH_DATA
+ -- : BFD_RELOC_SH_LABEL
+ -- : BFD_RELOC_SH_LOOP_START
+ -- : BFD_RELOC_SH_LOOP_END
+ -- : BFD_RELOC_SH_COPY
+ -- : BFD_RELOC_SH_GLOB_DAT
+ -- : BFD_RELOC_SH_JMP_SLOT
+ -- : BFD_RELOC_SH_RELATIVE
+ -- : BFD_RELOC_SH_GOTPC
+ -- : BFD_RELOC_SH_GOT_LOW16
+ -- : BFD_RELOC_SH_GOT_MEDLOW16
+ -- : BFD_RELOC_SH_GOT_MEDHI16
+ -- : BFD_RELOC_SH_GOT_HI16
+ -- : BFD_RELOC_SH_GOTPLT_LOW16
+ -- : BFD_RELOC_SH_GOTPLT_MEDLOW16
+ -- : BFD_RELOC_SH_GOTPLT_MEDHI16
+ -- : BFD_RELOC_SH_GOTPLT_HI16
+ -- : BFD_RELOC_SH_PLT_LOW16
+ -- : BFD_RELOC_SH_PLT_MEDLOW16
+ -- : BFD_RELOC_SH_PLT_MEDHI16
+ -- : BFD_RELOC_SH_PLT_HI16
+ -- : BFD_RELOC_SH_GOTOFF_LOW16
+ -- : BFD_RELOC_SH_GOTOFF_MEDLOW16
+ -- : BFD_RELOC_SH_GOTOFF_MEDHI16
+ -- : BFD_RELOC_SH_GOTOFF_HI16
+ -- : BFD_RELOC_SH_GOTPC_LOW16
+ -- : BFD_RELOC_SH_GOTPC_MEDLOW16
+ -- : BFD_RELOC_SH_GOTPC_MEDHI16
+ -- : BFD_RELOC_SH_GOTPC_HI16
+ -- : BFD_RELOC_SH_COPY64
+ -- : BFD_RELOC_SH_GLOB_DAT64
+ -- : BFD_RELOC_SH_JMP_SLOT64
+ -- : BFD_RELOC_SH_RELATIVE64
+ -- : BFD_RELOC_SH_GOT10BY4
+ -- : BFD_RELOC_SH_GOT10BY8
+ -- : BFD_RELOC_SH_GOTPLT10BY4
+ -- : BFD_RELOC_SH_GOTPLT10BY8
+ -- : BFD_RELOC_SH_GOTPLT32
+ -- : BFD_RELOC_SH_SHMEDIA_CODE
+ -- : BFD_RELOC_SH_IMMU5
+ -- : BFD_RELOC_SH_IMMS6
+ -- : BFD_RELOC_SH_IMMS6BY32
+ -- : BFD_RELOC_SH_IMMU6
+ -- : BFD_RELOC_SH_IMMS10
+ -- : BFD_RELOC_SH_IMMS10BY2
+ -- : BFD_RELOC_SH_IMMS10BY4
+ -- : BFD_RELOC_SH_IMMS10BY8
+ -- : BFD_RELOC_SH_IMMS16
+ -- : BFD_RELOC_SH_IMMU16
+ -- : BFD_RELOC_SH_IMM_LOW16
+ -- : BFD_RELOC_SH_IMM_LOW16_PCREL
+ -- : BFD_RELOC_SH_IMM_MEDLOW16
+ -- : BFD_RELOC_SH_IMM_MEDLOW16_PCREL
+ -- : BFD_RELOC_SH_IMM_MEDHI16
+ -- : BFD_RELOC_SH_IMM_MEDHI16_PCREL
+ -- : BFD_RELOC_SH_IMM_HI16
+ -- : BFD_RELOC_SH_IMM_HI16_PCREL
+ -- : BFD_RELOC_SH_PT_16
+ -- : BFD_RELOC_SH_TLS_GD_32
+ -- : BFD_RELOC_SH_TLS_LD_32
+ -- : BFD_RELOC_SH_TLS_LDO_32
+ -- : BFD_RELOC_SH_TLS_IE_32
+ -- : BFD_RELOC_SH_TLS_LE_32
+ -- : BFD_RELOC_SH_TLS_DTPMOD32
+ -- : BFD_RELOC_SH_TLS_DTPOFF32
+ -- : BFD_RELOC_SH_TLS_TPOFF32
+ Renesas / SuperH SH relocs. Not all of these appear in object
+ files.
+
+ -- : BFD_RELOC_ARC_B22_PCREL
+ ARC Cores relocs. ARC 22 bit pc-relative branch. The lowest two
+ bits must be zero and are not stored in the instruction. The high
+ 20 bits are installed in bits 26 through 7 of the instruction.
+
+ -- : BFD_RELOC_ARC_B26
+ ARC 26 bit absolute branch. The lowest two bits must be zero and
+ are not stored in the instruction. The high 24 bits are installed
+ in bits 23 through 0.
+
+ -- : BFD_RELOC_BFIN_16_IMM
+ ADI Blackfin 16 bit immediate absolute reloc.
+
+ -- : BFD_RELOC_BFIN_16_HIGH
+ ADI Blackfin 16 bit immediate absolute reloc higher 16 bits.
+
+ -- : BFD_RELOC_BFIN_4_PCREL
+ ADI Blackfin 'a' part of LSETUP.
+
+ -- : BFD_RELOC_BFIN_5_PCREL
+ ADI Blackfin.
+
+ -- : BFD_RELOC_BFIN_16_LOW
+ ADI Blackfin 16 bit immediate absolute reloc lower 16 bits.
+
+ -- : BFD_RELOC_BFIN_10_PCREL
+ ADI Blackfin.
+
+ -- : BFD_RELOC_BFIN_11_PCREL
+ ADI Blackfin 'b' part of LSETUP.
+
+ -- : BFD_RELOC_BFIN_12_PCREL_JUMP
+ ADI Blackfin.
+
+ -- : BFD_RELOC_BFIN_12_PCREL_JUMP_S
+ ADI Blackfin Short jump, pcrel.
+
+ -- : BFD_RELOC_BFIN_24_PCREL_CALL_X
+ ADI Blackfin Call.x not implemented.
+
+ -- : BFD_RELOC_BFIN_24_PCREL_JUMP_L
+ ADI Blackfin Long Jump pcrel.
+
+ -- : BFD_RELOC_BFIN_GOT17M4
+ -- : BFD_RELOC_BFIN_GOTHI
+ -- : BFD_RELOC_BFIN_GOTLO
+ -- : BFD_RELOC_BFIN_FUNCDESC
+ -- : BFD_RELOC_BFIN_FUNCDESC_GOT17M4
+ -- : BFD_RELOC_BFIN_FUNCDESC_GOTHI
+ -- : BFD_RELOC_BFIN_FUNCDESC_GOTLO
+ -- : BFD_RELOC_BFIN_FUNCDESC_VALUE
+ -- : BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4
+ -- : BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI
+ -- : BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO
+ -- : BFD_RELOC_BFIN_GOTOFF17M4
+ -- : BFD_RELOC_BFIN_GOTOFFHI
+ -- : BFD_RELOC_BFIN_GOTOFFLO
+ ADI Blackfin FD-PIC relocations.
+
+ -- : BFD_RELOC_BFIN_GOT
+ ADI Blackfin GOT relocation.
+
+ -- : BFD_RELOC_BFIN_PLTPC
+ ADI Blackfin PLTPC relocation.
+
+ -- : BFD_ARELOC_BFIN_PUSH
+ ADI Blackfin arithmetic relocation.
+
+ -- : BFD_ARELOC_BFIN_CONST
+ ADI Blackfin arithmetic relocation.
+
+ -- : BFD_ARELOC_BFIN_ADD
+ ADI Blackfin arithmetic relocation.
+
+ -- : BFD_ARELOC_BFIN_SUB
+ ADI Blackfin arithmetic relocation.
+
+ -- : BFD_ARELOC_BFIN_MULT
+ ADI Blackfin arithmetic relocation.
+
+ -- : BFD_ARELOC_BFIN_DIV
+ ADI Blackfin arithmetic relocation.
+
+ -- : BFD_ARELOC_BFIN_MOD
+ ADI Blackfin arithmetic relocation.
+
+ -- : BFD_ARELOC_BFIN_LSHIFT
+ ADI Blackfin arithmetic relocation.
+
+ -- : BFD_ARELOC_BFIN_RSHIFT
+ ADI Blackfin arithmetic relocation.
+
+ -- : BFD_ARELOC_BFIN_AND
+ ADI Blackfin arithmetic relocation.
+
+ -- : BFD_ARELOC_BFIN_OR
+ ADI Blackfin arithmetic relocation.
+
+ -- : BFD_ARELOC_BFIN_XOR
+ ADI Blackfin arithmetic relocation.
+
+ -- : BFD_ARELOC_BFIN_LAND
+ ADI Blackfin arithmetic relocation.
+
+ -- : BFD_ARELOC_BFIN_LOR
+ ADI Blackfin arithmetic relocation.
+
+ -- : BFD_ARELOC_BFIN_LEN
+ ADI Blackfin arithmetic relocation.
+
+ -- : BFD_ARELOC_BFIN_NEG
+ ADI Blackfin arithmetic relocation.
+
+ -- : BFD_ARELOC_BFIN_COMP
+ ADI Blackfin arithmetic relocation.
+
+ -- : BFD_ARELOC_BFIN_PAGE
+ ADI Blackfin arithmetic relocation.
+
+ -- : BFD_ARELOC_BFIN_HWPAGE
+ ADI Blackfin arithmetic relocation.
+
+ -- : BFD_ARELOC_BFIN_ADDR
+ ADI Blackfin arithmetic relocation.
+
+ -- : BFD_RELOC_D10V_10_PCREL_R
+ Mitsubishi D10V relocs. This is a 10-bit reloc with the right 2
+ bits assumed to be 0.
+
+ -- : BFD_RELOC_D10V_10_PCREL_L
+ Mitsubishi D10V relocs. This is a 10-bit reloc with the right 2
+ bits assumed to be 0. This is the same as the previous reloc
+ except it is in the left container, i.e., shifted left 15 bits.
+
+ -- : BFD_RELOC_D10V_18
+ This is an 18-bit reloc with the right 2 bits assumed to be 0.
+
+ -- : BFD_RELOC_D10V_18_PCREL
+ This is an 18-bit reloc with the right 2 bits assumed to be 0.
+
+ -- : BFD_RELOC_D30V_6
+ Mitsubishi D30V relocs. This is a 6-bit absolute reloc.
+
+ -- : BFD_RELOC_D30V_9_PCREL
+ This is a 6-bit pc-relative reloc with the right 3 bits assumed to
+ be 0.
+
+ -- : BFD_RELOC_D30V_9_PCREL_R
+ This is a 6-bit pc-relative reloc with the right 3 bits assumed to
+ be 0. Same as the previous reloc but on the right side of the
+ container.
+
+ -- : BFD_RELOC_D30V_15
+ This is a 12-bit absolute reloc with the right 3 bitsassumed to be
+ 0.
+
+ -- : BFD_RELOC_D30V_15_PCREL
+ This is a 12-bit pc-relative reloc with the right 3 bits assumed
+ to be 0.
+
+ -- : BFD_RELOC_D30V_15_PCREL_R
+ This is a 12-bit pc-relative reloc with the right 3 bits assumed
+ to be 0. Same as the previous reloc but on the right side of the
+ container.
+
+ -- : BFD_RELOC_D30V_21
+ This is an 18-bit absolute reloc with the right 3 bits assumed to
+ be 0.
+
+ -- : BFD_RELOC_D30V_21_PCREL
+ This is an 18-bit pc-relative reloc with the right 3 bits assumed
+ to be 0.
+
+ -- : BFD_RELOC_D30V_21_PCREL_R
+ This is an 18-bit pc-relative reloc with the right 3 bits assumed
+ to be 0. Same as the previous reloc but on the right side of the
+ container.
+
+ -- : BFD_RELOC_D30V_32
+ This is a 32-bit absolute reloc.
+
+ -- : BFD_RELOC_D30V_32_PCREL
+ This is a 32-bit pc-relative reloc.
+
+ -- : BFD_RELOC_DLX_HI16_S
+ DLX relocs
+
+ -- : BFD_RELOC_DLX_LO16
+ DLX relocs
+
+ -- : BFD_RELOC_DLX_JMP26
+ DLX relocs
+
+ -- : BFD_RELOC_M32C_HI8
+ -- : BFD_RELOC_M32C_RL_JUMP
+ -- : BFD_RELOC_M32C_RL_1ADDR
+ -- : BFD_RELOC_M32C_RL_2ADDR
+ Renesas M16C/M32C Relocations.
+
+ -- : BFD_RELOC_M32R_24
+ Renesas M32R (formerly Mitsubishi M32R) relocs. This is a 24 bit
+ absolute address.
+
+ -- : BFD_RELOC_M32R_10_PCREL
+ This is a 10-bit pc-relative reloc with the right 2 bits assumed
+ to be 0.
+
+ -- : BFD_RELOC_M32R_18_PCREL
+ This is an 18-bit reloc with the right 2 bits assumed to be 0.
+
+ -- : BFD_RELOC_M32R_26_PCREL
+ This is a 26-bit reloc with the right 2 bits assumed to be 0.
+
+ -- : BFD_RELOC_M32R_HI16_ULO
+ This is a 16-bit reloc containing the high 16 bits of an address
+ used when the lower 16 bits are treated as unsigned.
+
+ -- : BFD_RELOC_M32R_HI16_SLO
+ This is a 16-bit reloc containing the high 16 bits of an address
+ used when the lower 16 bits are treated as signed.
+
+ -- : BFD_RELOC_M32R_LO16
+ This is a 16-bit reloc containing the lower 16 bits of an address.
+
+ -- : BFD_RELOC_M32R_SDA16
+ This is a 16-bit reloc containing the small data area offset for
+ use in add3, load, and store instructions.
+
+ -- : BFD_RELOC_M32R_GOT24
+ -- : BFD_RELOC_M32R_26_PLTREL
+ -- : BFD_RELOC_M32R_COPY
+ -- : BFD_RELOC_M32R_GLOB_DAT
+ -- : BFD_RELOC_M32R_JMP_SLOT
+ -- : BFD_RELOC_M32R_RELATIVE
+ -- : BFD_RELOC_M32R_GOTOFF
+ -- : BFD_RELOC_M32R_GOTOFF_HI_ULO
+ -- : BFD_RELOC_M32R_GOTOFF_HI_SLO
+ -- : BFD_RELOC_M32R_GOTOFF_LO
+ -- : BFD_RELOC_M32R_GOTPC24
+ -- : BFD_RELOC_M32R_GOT16_HI_ULO
+ -- : BFD_RELOC_M32R_GOT16_HI_SLO
+ -- : BFD_RELOC_M32R_GOT16_LO
+ -- : BFD_RELOC_M32R_GOTPC_HI_ULO
+ -- : BFD_RELOC_M32R_GOTPC_HI_SLO
+ -- : BFD_RELOC_M32R_GOTPC_LO
+ For PIC.
+
+ -- : BFD_RELOC_V850_9_PCREL
+ This is a 9-bit reloc
+
+ -- : BFD_RELOC_V850_22_PCREL
+ This is a 22-bit reloc
+
+ -- : BFD_RELOC_V850_SDA_16_16_OFFSET
+ This is a 16 bit offset from the short data area pointer.
+
+ -- : BFD_RELOC_V850_SDA_15_16_OFFSET
+ This is a 16 bit offset (of which only 15 bits are used) from the
+ short data area pointer.
+
+ -- : BFD_RELOC_V850_ZDA_16_16_OFFSET
+ This is a 16 bit offset from the zero data area pointer.
+
+ -- : BFD_RELOC_V850_ZDA_15_16_OFFSET
+ This is a 16 bit offset (of which only 15 bits are used) from the
+ zero data area pointer.
+
+ -- : BFD_RELOC_V850_TDA_6_8_OFFSET
+ This is an 8 bit offset (of which only 6 bits are used) from the
+ tiny data area pointer.
+
+ -- : BFD_RELOC_V850_TDA_7_8_OFFSET
+ This is an 8bit offset (of which only 7 bits are used) from the
+ tiny data area pointer.
+
+ -- : BFD_RELOC_V850_TDA_7_7_OFFSET
+ This is a 7 bit offset from the tiny data area pointer.
+
+ -- : BFD_RELOC_V850_TDA_16_16_OFFSET
+ This is a 16 bit offset from the tiny data area pointer.
+
+ -- : BFD_RELOC_V850_TDA_4_5_OFFSET
+ This is a 5 bit offset (of which only 4 bits are used) from the
+ tiny data area pointer.
+
+ -- : BFD_RELOC_V850_TDA_4_4_OFFSET
+ This is a 4 bit offset from the tiny data area pointer.
+
+ -- : BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET
+ This is a 16 bit offset from the short data area pointer, with the
+ bits placed non-contiguously in the instruction.
+
+ -- : BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET
+ This is a 16 bit offset from the zero data area pointer, with the
+ bits placed non-contiguously in the instruction.
+
+ -- : BFD_RELOC_V850_CALLT_6_7_OFFSET
+ This is a 6 bit offset from the call table base pointer.
+
+ -- : BFD_RELOC_V850_CALLT_16_16_OFFSET
+ This is a 16 bit offset from the call table base pointer.
+
+ -- : BFD_RELOC_V850_LONGCALL
+ Used for relaxing indirect function calls.
+
+ -- : BFD_RELOC_V850_LONGJUMP
+ Used for relaxing indirect jumps.
+
+ -- : BFD_RELOC_V850_ALIGN
+ Used to maintain alignment whilst relaxing.
+
+ -- : BFD_RELOC_V850_LO16_SPLIT_OFFSET
+ This is a variation of BFD_RELOC_LO16 that can be used in v850e
+ ld.bu instructions.
+
+ -- : BFD_RELOC_MN10300_32_PCREL
+ This is a 32bit pcrel reloc for the mn10300, offset by two bytes
+ in the instruction.
+
+ -- : BFD_RELOC_MN10300_16_PCREL
+ This is a 16bit pcrel reloc for the mn10300, offset by two bytes
+ in the instruction.
+
+ -- : BFD_RELOC_TIC30_LDP
+ This is a 8bit DP reloc for the tms320c30, where the most
+ significant 8 bits of a 24 bit word are placed into the least
+ significant 8 bits of the opcode.
+
+ -- : BFD_RELOC_TIC54X_PARTLS7
+ This is a 7bit reloc for the tms320c54x, where the least
+ significant 7 bits of a 16 bit word are placed into the least
+ significant 7 bits of the opcode.
+
+ -- : BFD_RELOC_TIC54X_PARTMS9
+ This is a 9bit DP reloc for the tms320c54x, where the most
+ significant 9 bits of a 16 bit word are placed into the least
+ significant 9 bits of the opcode.
+
+ -- : BFD_RELOC_TIC54X_23
+ This is an extended address 23-bit reloc for the tms320c54x.
+
+ -- : BFD_RELOC_TIC54X_16_OF_23
+ This is a 16-bit reloc for the tms320c54x, where the least
+ significant 16 bits of a 23-bit extended address are placed into
+ the opcode.
+
+ -- : BFD_RELOC_TIC54X_MS7_OF_23
+ This is a reloc for the tms320c54x, where the most significant 7
+ bits of a 23-bit extended address are placed into the opcode.
+
+ -- : BFD_RELOC_FR30_48
+ This is a 48 bit reloc for the FR30 that stores 32 bits.
+
+ -- : BFD_RELOC_FR30_20
+ This is a 32 bit reloc for the FR30 that stores 20 bits split up
+ into two sections.
+
+ -- : BFD_RELOC_FR30_6_IN_4
+ This is a 16 bit reloc for the FR30 that stores a 6 bit word
+ offset in 4 bits.
+
+ -- : BFD_RELOC_FR30_8_IN_8
+ This is a 16 bit reloc for the FR30 that stores an 8 bit byte
+ offset into 8 bits.
+
+ -- : BFD_RELOC_FR30_9_IN_8
+ This is a 16 bit reloc for the FR30 that stores a 9 bit short
+ offset into 8 bits.
+
+ -- : BFD_RELOC_FR30_10_IN_8
+ This is a 16 bit reloc for the FR30 that stores a 10 bit word
+ offset into 8 bits.
+
+ -- : BFD_RELOC_FR30_9_PCREL
+ This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
+ short offset into 8 bits.
+
+ -- : BFD_RELOC_FR30_12_PCREL
+ This is a 16 bit reloc for the FR30 that stores a 12 bit pc
+ relative short offset into 11 bits.
+
+ -- : BFD_RELOC_MCORE_PCREL_IMM8BY4
+ -- : BFD_RELOC_MCORE_PCREL_IMM11BY2
+ -- : BFD_RELOC_MCORE_PCREL_IMM4BY2
+ -- : BFD_RELOC_MCORE_PCREL_32
+ -- : BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2
+ -- : BFD_RELOC_MCORE_RVA
+ Motorola Mcore relocations.
+
+ -- : BFD_RELOC_MEP_8
+ -- : BFD_RELOC_MEP_16
+ -- : BFD_RELOC_MEP_32
+ -- : BFD_RELOC_MEP_PCREL8A2
+ -- : BFD_RELOC_MEP_PCREL12A2
+ -- : BFD_RELOC_MEP_PCREL17A2
+ -- : BFD_RELOC_MEP_PCREL24A2
+ -- : BFD_RELOC_MEP_PCABS24A2
+ -- : BFD_RELOC_MEP_LOW16
+ -- : BFD_RELOC_MEP_HI16U
+ -- : BFD_RELOC_MEP_HI16S
+ -- : BFD_RELOC_MEP_GPREL
+ -- : BFD_RELOC_MEP_TPREL
+ -- : BFD_RELOC_MEP_TPREL7
+ -- : BFD_RELOC_MEP_TPREL7A2
+ -- : BFD_RELOC_MEP_TPREL7A4
+ -- : BFD_RELOC_MEP_UIMM24
+ -- : BFD_RELOC_MEP_ADDR24A4
+ -- : BFD_RELOC_MEP_GNU_VTINHERIT
+ -- : BFD_RELOC_MEP_GNU_VTENTRY
+ Toshiba Media Processor Relocations.
+
+ -- : BFD_RELOC_MMIX_GETA
+ -- : BFD_RELOC_MMIX_GETA_1
+ -- : BFD_RELOC_MMIX_GETA_2
+ -- : BFD_RELOC_MMIX_GETA_3
+ These are relocations for the GETA instruction.
+
+ -- : BFD_RELOC_MMIX_CBRANCH
+ -- : BFD_RELOC_MMIX_CBRANCH_J
+ -- : BFD_RELOC_MMIX_CBRANCH_1
+ -- : BFD_RELOC_MMIX_CBRANCH_2
+ -- : BFD_RELOC_MMIX_CBRANCH_3
+ These are relocations for a conditional branch instruction.
+
+ -- : BFD_RELOC_MMIX_PUSHJ
+ -- : BFD_RELOC_MMIX_PUSHJ_1
+ -- : BFD_RELOC_MMIX_PUSHJ_2
+ -- : BFD_RELOC_MMIX_PUSHJ_3
+ -- : BFD_RELOC_MMIX_PUSHJ_STUBBABLE
+ These are relocations for the PUSHJ instruction.
+
+ -- : BFD_RELOC_MMIX_JMP
+ -- : BFD_RELOC_MMIX_JMP_1
+ -- : BFD_RELOC_MMIX_JMP_2
+ -- : BFD_RELOC_MMIX_JMP_3
+ These are relocations for the JMP instruction.
+
+ -- : BFD_RELOC_MMIX_ADDR19
+ This is a relocation for a relative address as in a GETA
+ instruction or a branch.
+
+ -- : BFD_RELOC_MMIX_ADDR27
+ This is a relocation for a relative address as in a JMP
+ instruction.
+
+ -- : BFD_RELOC_MMIX_REG_OR_BYTE
+ This is a relocation for an instruction field that may be a general
+ register or a value 0..255.
+
+ -- : BFD_RELOC_MMIX_REG
+ This is a relocation for an instruction field that may be a general
+ register.
+
+ -- : BFD_RELOC_MMIX_BASE_PLUS_OFFSET
+ This is a relocation for two instruction fields holding a register
+ and an offset, the equivalent of the relocation.
+
+ -- : BFD_RELOC_MMIX_LOCAL
+ This relocation is an assertion that the expression is not
+ allocated as a global register. It does not modify contents.
+
+ -- : BFD_RELOC_AVR_7_PCREL
+ This is a 16 bit reloc for the AVR that stores 8 bit pc relative
+ short offset into 7 bits.
+
+ -- : BFD_RELOC_AVR_13_PCREL
+ This is a 16 bit reloc for the AVR that stores 13 bit pc relative
+ short offset into 12 bits.
+
+ -- : BFD_RELOC_AVR_16_PM
+ This is a 16 bit reloc for the AVR that stores 17 bit value
+ (usually program memory address) into 16 bits.
+
+ -- : BFD_RELOC_AVR_LO8_LDI
+ This is a 16 bit reloc for the AVR that stores 8 bit value (usually
+ data memory address) into 8 bit immediate value of LDI insn.
+
+ -- : BFD_RELOC_AVR_HI8_LDI
+ This is a 16 bit reloc for the AVR that stores 8 bit value (high 8
+ bit of data memory address) into 8 bit immediate value of LDI insn.
+
+ -- : BFD_RELOC_AVR_HH8_LDI
+ This is a 16 bit reloc for the AVR that stores 8 bit value (most
+ high 8 bit of program memory address) into 8 bit immediate value
+ of LDI insn.
+
+ -- : BFD_RELOC_AVR_MS8_LDI
+ This is a 16 bit reloc for the AVR that stores 8 bit value (most
+ high 8 bit of 32 bit value) into 8 bit immediate value of LDI insn.
+
+ -- : BFD_RELOC_AVR_LO8_LDI_NEG
+ This is a 16 bit reloc for the AVR that stores negated 8 bit value
+ (usually data memory address) into 8 bit immediate value of SUBI
+ insn.
+
+ -- : BFD_RELOC_AVR_HI8_LDI_NEG
+ This is a 16 bit reloc for the AVR that stores negated 8 bit value
+ (high 8 bit of data memory address) into 8 bit immediate value of
+ SUBI insn.
+
+ -- : BFD_RELOC_AVR_HH8_LDI_NEG
+ This is a 16 bit reloc for the AVR that stores negated 8 bit value
+ (most high 8 bit of program memory address) into 8 bit immediate
+ value of LDI or SUBI insn.
+
+ -- : BFD_RELOC_AVR_MS8_LDI_NEG
+ This is a 16 bit reloc for the AVR that stores negated 8 bit value
+ (msb of 32 bit value) into 8 bit immediate value of LDI insn.
+
+ -- : BFD_RELOC_AVR_LO8_LDI_PM
+ This is a 16 bit reloc for the AVR that stores 8 bit value (usually
+ command address) into 8 bit immediate value of LDI insn.
+
+ -- : BFD_RELOC_AVR_LO8_LDI_GS
+ This is a 16 bit reloc for the AVR that stores 8 bit value
+ (command address) into 8 bit immediate value of LDI insn. If the
+ address is beyond the 128k boundary, the linker inserts a jump
+ stub for this reloc in the lower 128k.
+
+ -- : BFD_RELOC_AVR_HI8_LDI_PM
+ This is a 16 bit reloc for the AVR that stores 8 bit value (high 8
+ bit of command address) into 8 bit immediate value of LDI insn.
+
+ -- : BFD_RELOC_AVR_HI8_LDI_GS
+ This is a 16 bit reloc for the AVR that stores 8 bit value (high 8
+ bit of command address) into 8 bit immediate value of LDI insn.
+ If the address is beyond the 128k boundary, the linker inserts a
+ jump stub for this reloc below 128k.
+
+ -- : BFD_RELOC_AVR_HH8_LDI_PM
+ This is a 16 bit reloc for the AVR that stores 8 bit value (most
+ high 8 bit of command address) into 8 bit immediate value of LDI
+ insn.
+
+ -- : BFD_RELOC_AVR_LO8_LDI_PM_NEG
+ This is a 16 bit reloc for the AVR that stores negated 8 bit value
+ (usually command address) into 8 bit immediate value of SUBI insn.
+
+ -- : BFD_RELOC_AVR_HI8_LDI_PM_NEG
+ This is a 16 bit reloc for the AVR that stores negated 8 bit value
+ (high 8 bit of 16 bit command address) into 8 bit immediate value
+ of SUBI insn.
+
+ -- : BFD_RELOC_AVR_HH8_LDI_PM_NEG
+ This is a 16 bit reloc for the AVR that stores negated 8 bit value
+ (high 6 bit of 22 bit command address) into 8 bit immediate value
+ of SUBI insn.
+
+ -- : BFD_RELOC_AVR_CALL
+ This is a 32 bit reloc for the AVR that stores 23 bit value into
+ 22 bits.
+
+ -- : BFD_RELOC_AVR_LDI
+ This is a 16 bit reloc for the AVR that stores all needed bits for
+ absolute addressing with ldi with overflow check to linktime
+
+ -- : BFD_RELOC_AVR_6
+ This is a 6 bit reloc for the AVR that stores offset for ldd/std
+ instructions
+
+ -- : BFD_RELOC_AVR_6_ADIW
+ This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw
+ instructions
+
+ -- : BFD_RELOC_390_12
+ Direct 12 bit.
+
+ -- : BFD_RELOC_390_GOT12
+ 12 bit GOT offset.
+
+ -- : BFD_RELOC_390_PLT32
+ 32 bit PC relative PLT address.
+
+ -- : BFD_RELOC_390_COPY
+ Copy symbol at runtime.
+
+ -- : BFD_RELOC_390_GLOB_DAT
+ Create GOT entry.
+
+ -- : BFD_RELOC_390_JMP_SLOT
+ Create PLT entry.
+
+ -- : BFD_RELOC_390_RELATIVE
+ Adjust by program base.
+
+ -- : BFD_RELOC_390_GOTPC
+ 32 bit PC relative offset to GOT.
+
+ -- : BFD_RELOC_390_GOT16
+ 16 bit GOT offset.
+
+ -- : BFD_RELOC_390_PC16DBL
+ PC relative 16 bit shifted by 1.
+
+ -- : BFD_RELOC_390_PLT16DBL
+ 16 bit PC rel. PLT shifted by 1.
+
+ -- : BFD_RELOC_390_PC32DBL
+ PC relative 32 bit shifted by 1.
+
+ -- : BFD_RELOC_390_PLT32DBL
+ 32 bit PC rel. PLT shifted by 1.
+
+ -- : BFD_RELOC_390_GOTPCDBL
+ 32 bit PC rel. GOT shifted by 1.
+
+ -- : BFD_RELOC_390_GOT64
+ 64 bit GOT offset.
+
+ -- : BFD_RELOC_390_PLT64
+ 64 bit PC relative PLT address.
+
+ -- : BFD_RELOC_390_GOTENT
+ 32 bit rel. offset to GOT entry.
+
+ -- : BFD_RELOC_390_GOTOFF64
+ 64 bit offset to GOT.
+
+ -- : BFD_RELOC_390_GOTPLT12
+ 12-bit offset to symbol-entry within GOT, with PLT handling.
+
+ -- : BFD_RELOC_390_GOTPLT16
+ 16-bit offset to symbol-entry within GOT, with PLT handling.
+
+ -- : BFD_RELOC_390_GOTPLT32
+ 32-bit offset to symbol-entry within GOT, with PLT handling.
+
+ -- : BFD_RELOC_390_GOTPLT64
+ 64-bit offset to symbol-entry within GOT, with PLT handling.
+
+ -- : BFD_RELOC_390_GOTPLTENT
+ 32-bit rel. offset to symbol-entry within GOT, with PLT handling.
+
+ -- : BFD_RELOC_390_PLTOFF16
+ 16-bit rel. offset from the GOT to a PLT entry.
+
+ -- : BFD_RELOC_390_PLTOFF32
+ 32-bit rel. offset from the GOT to a PLT entry.
+
+ -- : BFD_RELOC_390_PLTOFF64
+ 64-bit rel. offset from the GOT to a PLT entry.
+
+ -- : BFD_RELOC_390_TLS_LOAD
+ -- : BFD_RELOC_390_TLS_GDCALL
+ -- : BFD_RELOC_390_TLS_LDCALL
+ -- : BFD_RELOC_390_TLS_GD32
+ -- : BFD_RELOC_390_TLS_GD64
+ -- : BFD_RELOC_390_TLS_GOTIE12
+ -- : BFD_RELOC_390_TLS_GOTIE32
+ -- : BFD_RELOC_390_TLS_GOTIE64
+ -- : BFD_RELOC_390_TLS_LDM32
+ -- : BFD_RELOC_390_TLS_LDM64
+ -- : BFD_RELOC_390_TLS_IE32
+ -- : BFD_RELOC_390_TLS_IE64
+ -- : BFD_RELOC_390_TLS_IEENT
+ -- : BFD_RELOC_390_TLS_LE32
+ -- : BFD_RELOC_390_TLS_LE64
+ -- : BFD_RELOC_390_TLS_LDO32
+ -- : BFD_RELOC_390_TLS_LDO64
+ -- : BFD_RELOC_390_TLS_DTPMOD
+ -- : BFD_RELOC_390_TLS_DTPOFF
+ -- : BFD_RELOC_390_TLS_TPOFF
+ s390 tls relocations.
+
+ -- : BFD_RELOC_390_20
+ -- : BFD_RELOC_390_GOT20
+ -- : BFD_RELOC_390_GOTPLT20
+ -- : BFD_RELOC_390_TLS_GOTIE20
+ Long displacement extension.
+
+ -- : BFD_RELOC_SCORE_GPREL15
+ Score relocations Low 16 bit for load/store
+
+ -- : BFD_RELOC_SCORE_DUMMY2
+ -- : BFD_RELOC_SCORE_JMP
+ This is a 24-bit reloc with the right 1 bit assumed to be 0
+
+ -- : BFD_RELOC_SCORE_BRANCH
+ This is a 19-bit reloc with the right 1 bit assumed to be 0
+
+ -- : BFD_RELOC_SCORE_IMM30
+ This is a 32-bit reloc for 48-bit instructions.
+
+ -- : BFD_RELOC_SCORE_IMM32
+ This is a 32-bit reloc for 48-bit instructions.
+
+ -- : BFD_RELOC_SCORE16_JMP
+ This is a 11-bit reloc with the right 1 bit assumed to be 0
+
+ -- : BFD_RELOC_SCORE16_BRANCH
+ This is a 8-bit reloc with the right 1 bit assumed to be 0
+
+ -- : BFD_RELOC_SCORE_BCMP
+ This is a 9-bit reloc with the right 1 bit assumed to be 0
+
+ -- : BFD_RELOC_SCORE_GOT15
+ -- : BFD_RELOC_SCORE_GOT_LO16
+ -- : BFD_RELOC_SCORE_CALL15
+ -- : BFD_RELOC_SCORE_DUMMY_HI16
+ Undocumented Score relocs
+
+ -- : BFD_RELOC_IP2K_FR9
+ Scenix IP2K - 9-bit register number / data address
+
+ -- : BFD_RELOC_IP2K_BANK
+ Scenix IP2K - 4-bit register/data bank number
+
+ -- : BFD_RELOC_IP2K_ADDR16CJP
+ Scenix IP2K - low 13 bits of instruction word address
+
+ -- : BFD_RELOC_IP2K_PAGE3
+ Scenix IP2K - high 3 bits of instruction word address
+
+ -- : BFD_RELOC_IP2K_LO8DATA
+ -- : BFD_RELOC_IP2K_HI8DATA
+ -- : BFD_RELOC_IP2K_EX8DATA
+ Scenix IP2K - ext/low/high 8 bits of data address
+
+ -- : BFD_RELOC_IP2K_LO8INSN
+ -- : BFD_RELOC_IP2K_HI8INSN
+ Scenix IP2K - low/high 8 bits of instruction word address
+
+ -- : BFD_RELOC_IP2K_PC_SKIP
+ Scenix IP2K - even/odd PC modifier to modify snb pcl.0
+
+ -- : BFD_RELOC_IP2K_TEXT
+ Scenix IP2K - 16 bit word address in text section.
+
+ -- : BFD_RELOC_IP2K_FR_OFFSET
+ Scenix IP2K - 7-bit sp or dp offset
+
+ -- : BFD_RELOC_VPE4KMATH_DATA
+ -- : BFD_RELOC_VPE4KMATH_INSN
+ Scenix VPE4K coprocessor - data/insn-space addressing
+
+ -- : BFD_RELOC_VTABLE_INHERIT
+ -- : BFD_RELOC_VTABLE_ENTRY
+ These two relocations are used by the linker to determine which of
+ the entries in a C++ virtual function table are actually used.
+ When the -gc-sections option is given, the linker will zero out
+ the entries that are not used, so that the code for those
+ functions need not be included in the output.
+
+ VTABLE_INHERIT is a zero-space relocation used to describe to the
+ linker the inheritance tree of a C++ virtual function table. The
+ relocation's symbol should be the parent class' vtable, and the
+ relocation should be located at the child vtable.
+
+ VTABLE_ENTRY is a zero-space relocation that describes the use of a
+ virtual function table entry. The reloc's symbol should refer to
+ the table of the class mentioned in the code. Off of that base,
+ an offset describes the entry that is being used. For Rela hosts,
+ this offset is stored in the reloc's addend. For Rel hosts, we
+ are forced to put this offset in the reloc's section offset.
+
+ -- : BFD_RELOC_IA64_IMM14
+ -- : BFD_RELOC_IA64_IMM22
+ -- : BFD_RELOC_IA64_IMM64
+ -- : BFD_RELOC_IA64_DIR32MSB
+ -- : BFD_RELOC_IA64_DIR32LSB
+ -- : BFD_RELOC_IA64_DIR64MSB
+ -- : BFD_RELOC_IA64_DIR64LSB
+ -- : BFD_RELOC_IA64_GPREL22
+ -- : BFD_RELOC_IA64_GPREL64I
+ -- : BFD_RELOC_IA64_GPREL32MSB
+ -- : BFD_RELOC_IA64_GPREL32LSB
+ -- : BFD_RELOC_IA64_GPREL64MSB
+ -- : BFD_RELOC_IA64_GPREL64LSB
+ -- : BFD_RELOC_IA64_LTOFF22
+ -- : BFD_RELOC_IA64_LTOFF64I
+ -- : BFD_RELOC_IA64_PLTOFF22
+ -- : BFD_RELOC_IA64_PLTOFF64I
+ -- : BFD_RELOC_IA64_PLTOFF64MSB
+ -- : BFD_RELOC_IA64_PLTOFF64LSB
+ -- : BFD_RELOC_IA64_FPTR64I
+ -- : BFD_RELOC_IA64_FPTR32MSB
+ -- : BFD_RELOC_IA64_FPTR32LSB
+ -- : BFD_RELOC_IA64_FPTR64MSB
+ -- : BFD_RELOC_IA64_FPTR64LSB
+ -- : BFD_RELOC_IA64_PCREL21B
+ -- : BFD_RELOC_IA64_PCREL21BI
+ -- : BFD_RELOC_IA64_PCREL21M
+ -- : BFD_RELOC_IA64_PCREL21F
+ -- : BFD_RELOC_IA64_PCREL22
+ -- : BFD_RELOC_IA64_PCREL60B
+ -- : BFD_RELOC_IA64_PCREL64I
+ -- : BFD_RELOC_IA64_PCREL32MSB
+ -- : BFD_RELOC_IA64_PCREL32LSB
+ -- : BFD_RELOC_IA64_PCREL64MSB
+ -- : BFD_RELOC_IA64_PCREL64LSB
+ -- : BFD_RELOC_IA64_LTOFF_FPTR22
+ -- : BFD_RELOC_IA64_LTOFF_FPTR64I
+ -- : BFD_RELOC_IA64_LTOFF_FPTR32MSB
+ -- : BFD_RELOC_IA64_LTOFF_FPTR32LSB
+ -- : BFD_RELOC_IA64_LTOFF_FPTR64MSB
+ -- : BFD_RELOC_IA64_LTOFF_FPTR64LSB
+ -- : BFD_RELOC_IA64_SEGREL32MSB
+ -- : BFD_RELOC_IA64_SEGREL32LSB
+ -- : BFD_RELOC_IA64_SEGREL64MSB
+ -- : BFD_RELOC_IA64_SEGREL64LSB
+ -- : BFD_RELOC_IA64_SECREL32MSB
+ -- : BFD_RELOC_IA64_SECREL32LSB
+ -- : BFD_RELOC_IA64_SECREL64MSB
+ -- : BFD_RELOC_IA64_SECREL64LSB
+ -- : BFD_RELOC_IA64_REL32MSB
+ -- : BFD_RELOC_IA64_REL32LSB
+ -- : BFD_RELOC_IA64_REL64MSB
+ -- : BFD_RELOC_IA64_REL64LSB
+ -- : BFD_RELOC_IA64_LTV32MSB
+ -- : BFD_RELOC_IA64_LTV32LSB
+ -- : BFD_RELOC_IA64_LTV64MSB
+ -- : BFD_RELOC_IA64_LTV64LSB
+ -- : BFD_RELOC_IA64_IPLTMSB
+ -- : BFD_RELOC_IA64_IPLTLSB
+ -- : BFD_RELOC_IA64_COPY
+ -- : BFD_RELOC_IA64_LTOFF22X
+ -- : BFD_RELOC_IA64_LDXMOV
+ -- : BFD_RELOC_IA64_TPREL14
+ -- : BFD_RELOC_IA64_TPREL22
+ -- : BFD_RELOC_IA64_TPREL64I
+ -- : BFD_RELOC_IA64_TPREL64MSB
+ -- : BFD_RELOC_IA64_TPREL64LSB
+ -- : BFD_RELOC_IA64_LTOFF_TPREL22
+ -- : BFD_RELOC_IA64_DTPMOD64MSB
+ -- : BFD_RELOC_IA64_DTPMOD64LSB
+ -- : BFD_RELOC_IA64_LTOFF_DTPMOD22
+ -- : BFD_RELOC_IA64_DTPREL14
+ -- : BFD_RELOC_IA64_DTPREL22
+ -- : BFD_RELOC_IA64_DTPREL64I
+ -- : BFD_RELOC_IA64_DTPREL32MSB
+ -- : BFD_RELOC_IA64_DTPREL32LSB
+ -- : BFD_RELOC_IA64_DTPREL64MSB
+ -- : BFD_RELOC_IA64_DTPREL64LSB
+ -- : BFD_RELOC_IA64_LTOFF_DTPREL22
+ Intel IA64 Relocations.
+
+ -- : BFD_RELOC_M68HC11_HI8
+ Motorola 68HC11 reloc. This is the 8 bit high part of an absolute
+ address.
+
+ -- : BFD_RELOC_M68HC11_LO8
+ Motorola 68HC11 reloc. This is the 8 bit low part of an absolute
+ address.
+
+ -- : BFD_RELOC_M68HC11_3B
+ Motorola 68HC11 reloc. This is the 3 bit of a value.
+
+ -- : BFD_RELOC_M68HC11_RL_JUMP
+ Motorola 68HC11 reloc. This reloc marks the beginning of a
+ jump/call instruction. It is used for linker relaxation to
+ correctly identify beginning of instruction and change some
+ branches to use PC-relative addressing mode.
+
+ -- : BFD_RELOC_M68HC11_RL_GROUP
+ Motorola 68HC11 reloc. This reloc marks a group of several
+ instructions that gcc generates and for which the linker
+ relaxation pass can modify and/or remove some of them.
+
+ -- : BFD_RELOC_M68HC11_LO16
+ Motorola 68HC11 reloc. This is the 16-bit lower part of an
+ address. It is used for 'call' instruction to specify the symbol
+ address without any special transformation (due to memory bank
+ window).
+
+ -- : BFD_RELOC_M68HC11_PAGE
+ Motorola 68HC11 reloc. This is a 8-bit reloc that specifies the
+ page number of an address. It is used by 'call' instruction to
+ specify the page number of the symbol.
+
+ -- : BFD_RELOC_M68HC11_24
+ Motorola 68HC11 reloc. This is a 24-bit reloc that represents the
+ address with a 16-bit value and a 8-bit page number. The symbol
+ address is transformed to follow the 16K memory bank of 68HC12
+ (seen as mapped in the window).
+
+ -- : BFD_RELOC_M68HC12_5B
+ Motorola 68HC12 reloc. This is the 5 bits of a value.
+
+ -- : BFD_RELOC_16C_NUM08
+ -- : BFD_RELOC_16C_NUM08_C
+ -- : BFD_RELOC_16C_NUM16
+ -- : BFD_RELOC_16C_NUM16_C
+ -- : BFD_RELOC_16C_NUM32
+ -- : BFD_RELOC_16C_NUM32_C
+ -- : BFD_RELOC_16C_DISP04
+ -- : BFD_RELOC_16C_DISP04_C
+ -- : BFD_RELOC_16C_DISP08
+ -- : BFD_RELOC_16C_DISP08_C
+ -- : BFD_RELOC_16C_DISP16
+ -- : BFD_RELOC_16C_DISP16_C
+ -- : BFD_RELOC_16C_DISP24
+ -- : BFD_RELOC_16C_DISP24_C
+ -- : BFD_RELOC_16C_DISP24a
+ -- : BFD_RELOC_16C_DISP24a_C
+ -- : BFD_RELOC_16C_REG04
+ -- : BFD_RELOC_16C_REG04_C
+ -- : BFD_RELOC_16C_REG04a
+ -- : BFD_RELOC_16C_REG04a_C
+ -- : BFD_RELOC_16C_REG14
+ -- : BFD_RELOC_16C_REG14_C
+ -- : BFD_RELOC_16C_REG16
+ -- : BFD_RELOC_16C_REG16_C
+ -- : BFD_RELOC_16C_REG20
+ -- : BFD_RELOC_16C_REG20_C
+ -- : BFD_RELOC_16C_ABS20
+ -- : BFD_RELOC_16C_ABS20_C
+ -- : BFD_RELOC_16C_ABS24
+ -- : BFD_RELOC_16C_ABS24_C
+ -- : BFD_RELOC_16C_IMM04
+ -- : BFD_RELOC_16C_IMM04_C
+ -- : BFD_RELOC_16C_IMM16
+ -- : BFD_RELOC_16C_IMM16_C
+ -- : BFD_RELOC_16C_IMM20
+ -- : BFD_RELOC_16C_IMM20_C
+ -- : BFD_RELOC_16C_IMM24
+ -- : BFD_RELOC_16C_IMM24_C
+ -- : BFD_RELOC_16C_IMM32
+ -- : BFD_RELOC_16C_IMM32_C
+ NS CR16C Relocations.
+
+ -- : BFD_RELOC_CR16_NUM8
+ -- : BFD_RELOC_CR16_NUM16
+ -- : BFD_RELOC_CR16_NUM32
+ -- : BFD_RELOC_CR16_NUM32a
+ -- : BFD_RELOC_CR16_REGREL0
+ -- : BFD_RELOC_CR16_REGREL4
+ -- : BFD_RELOC_CR16_REGREL4a
+ -- : BFD_RELOC_CR16_REGREL14
+ -- : BFD_RELOC_CR16_REGREL14a
+ -- : BFD_RELOC_CR16_REGREL16
+ -- : BFD_RELOC_CR16_REGREL20
+ -- : BFD_RELOC_CR16_REGREL20a
+ -- : BFD_RELOC_CR16_ABS20
+ -- : BFD_RELOC_CR16_ABS24
+ -- : BFD_RELOC_CR16_IMM4
+ -- : BFD_RELOC_CR16_IMM8
+ -- : BFD_RELOC_CR16_IMM16
+ -- : BFD_RELOC_CR16_IMM20
+ -- : BFD_RELOC_CR16_IMM24
+ -- : BFD_RELOC_CR16_IMM32
+ -- : BFD_RELOC_CR16_IMM32a
+ -- : BFD_RELOC_CR16_DISP4
+ -- : BFD_RELOC_CR16_DISP8
+ -- : BFD_RELOC_CR16_DISP16
+ -- : BFD_RELOC_CR16_DISP20
+ -- : BFD_RELOC_CR16_DISP24
+ -- : BFD_RELOC_CR16_DISP24a
+ -- : BFD_RELOC_CR16_SWITCH8
+ -- : BFD_RELOC_CR16_SWITCH16
+ -- : BFD_RELOC_CR16_SWITCH32
+ -- : BFD_RELOC_CR16_GOT_REGREL20
+ -- : BFD_RELOC_CR16_GOTC_REGREL20
+ -- : BFD_RELOC_CR16_GLOB_DAT
+ NS CR16 Relocations.
+
+ -- : BFD_RELOC_CRX_REL4
+ -- : BFD_RELOC_CRX_REL8
+ -- : BFD_RELOC_CRX_REL8_CMP
+ -- : BFD_RELOC_CRX_REL16
+ -- : BFD_RELOC_CRX_REL24
+ -- : BFD_RELOC_CRX_REL32
+ -- : BFD_RELOC_CRX_REGREL12
+ -- : BFD_RELOC_CRX_REGREL22
+ -- : BFD_RELOC_CRX_REGREL28
+ -- : BFD_RELOC_CRX_REGREL32
+ -- : BFD_RELOC_CRX_ABS16
+ -- : BFD_RELOC_CRX_ABS32
+ -- : BFD_RELOC_CRX_NUM8
+ -- : BFD_RELOC_CRX_NUM16
+ -- : BFD_RELOC_CRX_NUM32
+ -- : BFD_RELOC_CRX_IMM16
+ -- : BFD_RELOC_CRX_IMM32
+ -- : BFD_RELOC_CRX_SWITCH8
+ -- : BFD_RELOC_CRX_SWITCH16
+ -- : BFD_RELOC_CRX_SWITCH32
+ NS CRX Relocations.
+
+ -- : BFD_RELOC_CRIS_BDISP8
+ -- : BFD_RELOC_CRIS_UNSIGNED_5
+ -- : BFD_RELOC_CRIS_SIGNED_6
+ -- : BFD_RELOC_CRIS_UNSIGNED_6
+ -- : BFD_RELOC_CRIS_SIGNED_8
+ -- : BFD_RELOC_CRIS_UNSIGNED_8
+ -- : BFD_RELOC_CRIS_SIGNED_16
+ -- : BFD_RELOC_CRIS_UNSIGNED_16
+ -- : BFD_RELOC_CRIS_LAPCQ_OFFSET
+ -- : BFD_RELOC_CRIS_UNSIGNED_4
+ These relocs are only used within the CRIS assembler. They are not
+ (at present) written to any object files.
+
+ -- : BFD_RELOC_CRIS_COPY
+ -- : BFD_RELOC_CRIS_GLOB_DAT
+ -- : BFD_RELOC_CRIS_JUMP_SLOT
+ -- : BFD_RELOC_CRIS_RELATIVE
+ Relocs used in ELF shared libraries for CRIS.
+
+ -- : BFD_RELOC_CRIS_32_GOT
+ 32-bit offset to symbol-entry within GOT.
+
+ -- : BFD_RELOC_CRIS_16_GOT
+ 16-bit offset to symbol-entry within GOT.
+
+ -- : BFD_RELOC_CRIS_32_GOTPLT
+ 32-bit offset to symbol-entry within GOT, with PLT handling.
+
+ -- : BFD_RELOC_CRIS_16_GOTPLT
+ 16-bit offset to symbol-entry within GOT, with PLT handling.
+
+ -- : BFD_RELOC_CRIS_32_GOTREL
+ 32-bit offset to symbol, relative to GOT.
+
+ -- : BFD_RELOC_CRIS_32_PLT_GOTREL
+ 32-bit offset to symbol with PLT entry, relative to GOT.
+
+ -- : BFD_RELOC_CRIS_32_PLT_PCREL
+ 32-bit offset to symbol with PLT entry, relative to this
+ relocation.
+
+ -- : BFD_RELOC_CRIS_32_GOT_GD
+ -- : BFD_RELOC_CRIS_16_GOT_GD
+ -- : BFD_RELOC_CRIS_32_GD
+ -- : BFD_RELOC_CRIS_DTP
+ -- : BFD_RELOC_CRIS_32_DTPREL
+ -- : BFD_RELOC_CRIS_16_DTPREL
+ -- : BFD_RELOC_CRIS_32_GOT_TPREL
+ -- : BFD_RELOC_CRIS_16_GOT_TPREL
+ -- : BFD_RELOC_CRIS_32_TPREL
+ -- : BFD_RELOC_CRIS_16_TPREL
+ -- : BFD_RELOC_CRIS_DTPMOD
+ -- : BFD_RELOC_CRIS_32_IE
+ Relocs used in TLS code for CRIS.
+
+ -- : BFD_RELOC_860_COPY
+ -- : BFD_RELOC_860_GLOB_DAT
+ -- : BFD_RELOC_860_JUMP_SLOT
+ -- : BFD_RELOC_860_RELATIVE
+ -- : BFD_RELOC_860_PC26
+ -- : BFD_RELOC_860_PLT26
+ -- : BFD_RELOC_860_PC16
+ -- : BFD_RELOC_860_LOW0
+ -- : BFD_RELOC_860_SPLIT0
+ -- : BFD_RELOC_860_LOW1
+ -- : BFD_RELOC_860_SPLIT1
+ -- : BFD_RELOC_860_LOW2
+ -- : BFD_RELOC_860_SPLIT2
+ -- : BFD_RELOC_860_LOW3
+ -- : BFD_RELOC_860_LOGOT0
+ -- : BFD_RELOC_860_SPGOT0
+ -- : BFD_RELOC_860_LOGOT1
+ -- : BFD_RELOC_860_SPGOT1
+ -- : BFD_RELOC_860_LOGOTOFF0
+ -- : BFD_RELOC_860_SPGOTOFF0
+ -- : BFD_RELOC_860_LOGOTOFF1
+ -- : BFD_RELOC_860_SPGOTOFF1
+ -- : BFD_RELOC_860_LOGOTOFF2
+ -- : BFD_RELOC_860_LOGOTOFF3
+ -- : BFD_RELOC_860_LOPC
+ -- : BFD_RELOC_860_HIGHADJ
+ -- : BFD_RELOC_860_HAGOT
+ -- : BFD_RELOC_860_HAGOTOFF
+ -- : BFD_RELOC_860_HAPC
+ -- : BFD_RELOC_860_HIGH
+ -- : BFD_RELOC_860_HIGOT
+ -- : BFD_RELOC_860_HIGOTOFF
+ Intel i860 Relocations.
+
+ -- : BFD_RELOC_OPENRISC_ABS_26
+ -- : BFD_RELOC_OPENRISC_REL_26
+ OpenRISC Relocations.
+
+ -- : BFD_RELOC_H8_DIR16A8
+ -- : BFD_RELOC_H8_DIR16R8
+ -- : BFD_RELOC_H8_DIR24A8
+ -- : BFD_RELOC_H8_DIR24R8
+ -- : BFD_RELOC_H8_DIR32A16
+ H8 elf Relocations.
+
+ -- : BFD_RELOC_XSTORMY16_REL_12
+ -- : BFD_RELOC_XSTORMY16_12
+ -- : BFD_RELOC_XSTORMY16_24
+ -- : BFD_RELOC_XSTORMY16_FPTR16
+ Sony Xstormy16 Relocations.
+
+ -- : BFD_RELOC_RELC
+ Self-describing complex relocations.
+
+ -- : BFD_RELOC_XC16X_PAG
+ -- : BFD_RELOC_XC16X_POF
+ -- : BFD_RELOC_XC16X_SEG
+ -- : BFD_RELOC_XC16X_SOF
+ Infineon Relocations.
+
+ -- : BFD_RELOC_VAX_GLOB_DAT
+ -- : BFD_RELOC_VAX_JMP_SLOT
+ -- : BFD_RELOC_VAX_RELATIVE
+ Relocations used by VAX ELF.
+
+ -- : BFD_RELOC_MT_PC16
+ Morpho MT - 16 bit immediate relocation.
+
+ -- : BFD_RELOC_MT_HI16
+ Morpho MT - Hi 16 bits of an address.
+
+ -- : BFD_RELOC_MT_LO16
+ Morpho MT - Low 16 bits of an address.
+
+ -- : BFD_RELOC_MT_GNU_VTINHERIT
+ Morpho MT - Used to tell the linker which vtable entries are used.
+
+ -- : BFD_RELOC_MT_GNU_VTENTRY
+ Morpho MT - Used to tell the linker which vtable entries are used.
+
+ -- : BFD_RELOC_MT_PCINSN8
+ Morpho MT - 8 bit immediate relocation.
+
+ -- : BFD_RELOC_MSP430_10_PCREL
+ -- : BFD_RELOC_MSP430_16_PCREL
+ -- : BFD_RELOC_MSP430_16
+ -- : BFD_RELOC_MSP430_16_PCREL_BYTE
+ -- : BFD_RELOC_MSP430_16_BYTE
+ -- : BFD_RELOC_MSP430_2X_PCREL
+ -- : BFD_RELOC_MSP430_RL_PCREL
+ msp430 specific relocation codes
+
+ -- : BFD_RELOC_IQ2000_OFFSET_16
+ -- : BFD_RELOC_IQ2000_OFFSET_21
+ -- : BFD_RELOC_IQ2000_UHI16
+ IQ2000 Relocations.
+
+ -- : BFD_RELOC_XTENSA_RTLD
+ Special Xtensa relocation used only by PLT entries in ELF shared
+ objects to indicate that the runtime linker should set the value
+ to one of its own internal functions or data structures.
+
+ -- : BFD_RELOC_XTENSA_GLOB_DAT
+ -- : BFD_RELOC_XTENSA_JMP_SLOT
+ -- : BFD_RELOC_XTENSA_RELATIVE
+ Xtensa relocations for ELF shared objects.
+
+ -- : BFD_RELOC_XTENSA_PLT
+ Xtensa relocation used in ELF object files for symbols that may
+ require PLT entries. Otherwise, this is just a generic 32-bit
+ relocation.
+
+ -- : BFD_RELOC_XTENSA_DIFF8
+ -- : BFD_RELOC_XTENSA_DIFF16
+ -- : BFD_RELOC_XTENSA_DIFF32
+ Xtensa relocations to mark the difference of two local symbols.
+ These are only needed to support linker relaxation and can be
+ ignored when not relaxing. The field is set to the value of the
+ difference assuming no relaxation. The relocation encodes the
+ position of the first symbol so the linker can determine whether
+ to adjust the field value.
+
+ -- : BFD_RELOC_XTENSA_SLOT0_OP
+ -- : BFD_RELOC_XTENSA_SLOT1_OP
+ -- : BFD_RELOC_XTENSA_SLOT2_OP
+ -- : BFD_RELOC_XTENSA_SLOT3_OP
+ -- : BFD_RELOC_XTENSA_SLOT4_OP
+ -- : BFD_RELOC_XTENSA_SLOT5_OP
+ -- : BFD_RELOC_XTENSA_SLOT6_OP
+ -- : BFD_RELOC_XTENSA_SLOT7_OP
+ -- : BFD_RELOC_XTENSA_SLOT8_OP
+ -- : BFD_RELOC_XTENSA_SLOT9_OP
+ -- : BFD_RELOC_XTENSA_SLOT10_OP
+ -- : BFD_RELOC_XTENSA_SLOT11_OP
+ -- : BFD_RELOC_XTENSA_SLOT12_OP
+ -- : BFD_RELOC_XTENSA_SLOT13_OP
+ -- : BFD_RELOC_XTENSA_SLOT14_OP
+ Generic Xtensa relocations for instruction operands. Only the slot
+ number is encoded in the relocation. The relocation applies to the
+ last PC-relative immediate operand, or if there are no PC-relative
+ immediates, to the last immediate operand.
+
+ -- : BFD_RELOC_XTENSA_SLOT0_ALT
+ -- : BFD_RELOC_XTENSA_SLOT1_ALT
+ -- : BFD_RELOC_XTENSA_SLOT2_ALT
+ -- : BFD_RELOC_XTENSA_SLOT3_ALT
+ -- : BFD_RELOC_XTENSA_SLOT4_ALT
+ -- : BFD_RELOC_XTENSA_SLOT5_ALT
+ -- : BFD_RELOC_XTENSA_SLOT6_ALT
+ -- : BFD_RELOC_XTENSA_SLOT7_ALT
+ -- : BFD_RELOC_XTENSA_SLOT8_ALT
+ -- : BFD_RELOC_XTENSA_SLOT9_ALT
+ -- : BFD_RELOC_XTENSA_SLOT10_ALT
+ -- : BFD_RELOC_XTENSA_SLOT11_ALT
+ -- : BFD_RELOC_XTENSA_SLOT12_ALT
+ -- : BFD_RELOC_XTENSA_SLOT13_ALT
+ -- : BFD_RELOC_XTENSA_SLOT14_ALT
+ Alternate Xtensa relocations. Only the slot is encoded in the
+ relocation. The meaning of these relocations is opcode-specific.
+
+ -- : BFD_RELOC_XTENSA_OP0
+ -- : BFD_RELOC_XTENSA_OP1
+ -- : BFD_RELOC_XTENSA_OP2
+ Xtensa relocations for backward compatibility. These have all been
+ replaced by BFD_RELOC_XTENSA_SLOT0_OP.
+
+ -- : BFD_RELOC_XTENSA_ASM_EXPAND
+ Xtensa relocation to mark that the assembler expanded the
+ instructions from an original target. The expansion size is
+ encoded in the reloc size.
+
+ -- : BFD_RELOC_XTENSA_ASM_SIMPLIFY
+ Xtensa relocation to mark that the linker should simplify
+ assembler-expanded instructions. This is commonly used internally
+ by the linker after analysis of a BFD_RELOC_XTENSA_ASM_EXPAND.
+
+ -- : BFD_RELOC_XTENSA_TLSDESC_FN
+ -- : BFD_RELOC_XTENSA_TLSDESC_ARG
+ -- : BFD_RELOC_XTENSA_TLS_DTPOFF
+ -- : BFD_RELOC_XTENSA_TLS_TPOFF
+ -- : BFD_RELOC_XTENSA_TLS_FUNC
+ -- : BFD_RELOC_XTENSA_TLS_ARG
+ -- : BFD_RELOC_XTENSA_TLS_CALL
+ Xtensa TLS relocations.
+
+ -- : BFD_RELOC_Z80_DISP8
+ 8 bit signed offset in (ix+d) or (iy+d).
+
+ -- : BFD_RELOC_Z8K_DISP7
+ DJNZ offset.
+
+ -- : BFD_RELOC_Z8K_CALLR
+ CALR offset.
+
+ -- : BFD_RELOC_Z8K_IMM4L
+ 4 bit value.
+
+ -- : BFD_RELOC_LM32_CALL
+ -- : BFD_RELOC_LM32_BRANCH
+ -- : BFD_RELOC_LM32_16_GOT
+ -- : BFD_RELOC_LM32_GOTOFF_HI16
+ -- : BFD_RELOC_LM32_GOTOFF_LO16
+ -- : BFD_RELOC_LM32_COPY
+ -- : BFD_RELOC_LM32_GLOB_DAT
+ -- : BFD_RELOC_LM32_JMP_SLOT
+ -- : BFD_RELOC_LM32_RELATIVE
+ Lattice Mico32 relocations.
+
+ -- : BFD_RELOC_MACH_O_SECTDIFF
+ Difference between two section addreses. Must be followed by a
+ BFD_RELOC_MACH_O_PAIR.
+
+ -- : BFD_RELOC_MACH_O_PAIR
+ Mach-O generic relocations.
+
+ -- : BFD_RELOC_MICROBLAZE_32_LO
+ This is a 32 bit reloc for the microblaze that stores the low 16
+ bits of a value
+
+ -- : BFD_RELOC_MICROBLAZE_32_LO_PCREL
+ This is a 32 bit pc-relative reloc for the microblaze that stores
+ the low 16 bits of a value
+
+ -- : BFD_RELOC_MICROBLAZE_32_ROSDA
+ This is a 32 bit reloc for the microblaze that stores a value
+ relative to the read-only small data area anchor
+
+ -- : BFD_RELOC_MICROBLAZE_32_RWSDA
+ This is a 32 bit reloc for the microblaze that stores a value
+ relative to the read-write small data area anchor
+
+ -- : BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM
+ This is a 32 bit reloc for the microblaze to handle expressions of
+ the form "Symbol Op Symbol"
+
+ -- : BFD_RELOC_MICROBLAZE_64_NONE
+ This is a 64 bit reloc that stores the 32 bit pc relative value in
+ two words (with an imm instruction). No relocation is done here -
+ only used for relaxing
+
+ -- : BFD_RELOC_MICROBLAZE_64_GOTPC
+ This is a 64 bit reloc that stores the 32 bit pc relative value in
+ two words (with an imm instruction). The relocation is
+ PC-relative GOT offset
+
+ -- : BFD_RELOC_MICROBLAZE_64_GOT
+ This is a 64 bit reloc that stores the 32 bit pc relative value in
+ two words (with an imm instruction). The relocation is GOT offset
+
+ -- : BFD_RELOC_MICROBLAZE_64_PLT
+ This is a 64 bit reloc that stores the 32 bit pc relative value in
+ two words (with an imm instruction). The relocation is
+ PC-relative offset into PLT
+
+ -- : BFD_RELOC_MICROBLAZE_64_GOTOFF
+ This is a 64 bit reloc that stores the 32 bit GOT relative value
+ in two words (with an imm instruction). The relocation is
+ relative offset from _GLOBAL_OFFSET_TABLE_
+
+ -- : BFD_RELOC_MICROBLAZE_32_GOTOFF
+ This is a 32 bit reloc that stores the 32 bit GOT relative value
+ in a word. The relocation is relative offset from
+
+ -- : BFD_RELOC_MICROBLAZE_COPY
+ This is used to tell the dynamic linker to copy the value out of
+ the dynamic object into the runtime process image.
+
+
+ typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
+
+2.10.2.2 `bfd_reloc_type_lookup'
+................................
+
+*Synopsis*
+ reloc_howto_type *bfd_reloc_type_lookup
+ (bfd *abfd, bfd_reloc_code_real_type code);
+ reloc_howto_type *bfd_reloc_name_lookup
+ (bfd *abfd, const char *reloc_name);
+ *Description*
+Return a pointer to a howto structure which, when invoked, will perform
+the relocation CODE on data from the architecture noted.
+
+2.10.2.3 `bfd_default_reloc_type_lookup'
+........................................
+
+*Synopsis*
+ reloc_howto_type *bfd_default_reloc_type_lookup
+ (bfd *abfd, bfd_reloc_code_real_type code);
+ *Description*
+Provides a default relocation lookup routine for any architecture.
+
+2.10.2.4 `bfd_get_reloc_code_name'
+..................................
+
+*Synopsis*
+ const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
+ *Description*
+Provides a printable name for the supplied relocation code. Useful
+mainly for printing error messages.
+
+2.10.2.5 `bfd_generic_relax_section'
+....................................
+
+*Synopsis*
+ bfd_boolean bfd_generic_relax_section
+ (bfd *abfd,
+ asection *section,
+ struct bfd_link_info *,
+ bfd_boolean *);
+ *Description*
+Provides default handling for relaxing for back ends which don't do
+relaxing.
+
+2.10.2.6 `bfd_generic_gc_sections'
+..................................
+
+*Synopsis*
+ bfd_boolean bfd_generic_gc_sections
+ (bfd *, struct bfd_link_info *);
+ *Description*
+Provides default handling for relaxing for back ends which don't do
+section gc - i.e., does nothing.
+
+2.10.2.7 `bfd_generic_merge_sections'
+.....................................
+
+*Synopsis*
+ bfd_boolean bfd_generic_merge_sections
+ (bfd *, struct bfd_link_info *);
+ *Description*
+Provides default handling for SEC_MERGE section merging for back ends
+which don't have SEC_MERGE support - i.e., does nothing.
+
+2.10.2.8 `bfd_generic_get_relocated_section_contents'
+.....................................................
+
+*Synopsis*
+ bfd_byte *bfd_generic_get_relocated_section_contents
+ (bfd *abfd,
+ struct bfd_link_info *link_info,
+ struct bfd_link_order *link_order,
+ bfd_byte *data,
+ bfd_boolean relocatable,
+ asymbol **symbols);
+ *Description*
+Provides default handling of relocation effort for back ends which
+can't be bothered to do it efficiently.
+
+
+File: bfd.info, Node: Core Files, Next: Targets, Prev: Relocations, Up: BFD front end
+
+2.11 Core files
+===============
+
+2.11.1 Core file functions
+--------------------------
+
+*Description*
+These are functions pertaining to core files.
+
+2.11.1.1 `bfd_core_file_failing_command'
+........................................
+
+*Synopsis*
+ const char *bfd_core_file_failing_command (bfd *abfd);
+ *Description*
+Return a read-only string explaining which program was running when it
+failed and produced the core file ABFD.
+
+2.11.1.2 `bfd_core_file_failing_signal'
+.......................................
+
+*Synopsis*
+ int bfd_core_file_failing_signal (bfd *abfd);
+ *Description*
+Returns the signal number which caused the core dump which generated
+the file the BFD ABFD is attached to.
+
+2.11.1.3 `core_file_matches_executable_p'
+.........................................
+
+*Synopsis*
+ bfd_boolean core_file_matches_executable_p
+ (bfd *core_bfd, bfd *exec_bfd);
+ *Description*
+Return `TRUE' if the core file attached to CORE_BFD was generated by a
+run of the executable file attached to EXEC_BFD, `FALSE' otherwise.
+
+2.11.1.4 `generic_core_file_matches_executable_p'
+.................................................
+
+*Synopsis*
+ bfd_boolean generic_core_file_matches_executable_p
+ (bfd *core_bfd, bfd *exec_bfd);
+ *Description*
+Return TRUE if the core file attached to CORE_BFD was generated by a
+run of the executable file attached to EXEC_BFD. The match is based on
+executable basenames only.
+
+ Note: When not able to determine the core file failing command or
+the executable name, we still return TRUE even though we're not sure
+that core file and executable match. This is to avoid generating a
+false warning in situations where we really don't know whether they
+match or not.
+
+
+File: bfd.info, Node: Targets, Next: Architectures, Prev: Core Files, Up: BFD front end
+
+2.12 Targets
+============
+
+*Description*
+Each port of BFD to a different machine requires the creation of a
+target back end. All the back end provides to the root part of BFD is a
+structure containing pointers to functions which perform certain low
+level operations on files. BFD translates the applications's requests
+through a pointer into calls to the back end routines.
+
+ When a file is opened with `bfd_openr', its format and target are
+unknown. BFD uses various mechanisms to determine how to interpret the
+file. The operations performed are:
+
+ * Create a BFD by calling the internal routine `_bfd_new_bfd', then
+ call `bfd_find_target' with the target string supplied to
+ `bfd_openr' and the new BFD pointer.
+
+ * If a null target string was provided to `bfd_find_target', look up
+ the environment variable `GNUTARGET' and use that as the target
+ string.
+
+ * If the target string is still `NULL', or the target string is
+ `default', then use the first item in the target vector as the
+ target type, and set `target_defaulted' in the BFD to cause
+ `bfd_check_format' to loop through all the targets. *Note
+ bfd_target::. *Note Formats::.
+
+ * Otherwise, inspect the elements in the target vector one by one,
+ until a match on target name is found. When found, use it.
+
+ * Otherwise return the error `bfd_error_invalid_target' to
+ `bfd_openr'.
+
+ * `bfd_openr' attempts to open the file using `bfd_open_file', and
+ returns the BFD.
+ Once the BFD has been opened and the target selected, the file
+format may be determined. This is done by calling `bfd_check_format' on
+the BFD with a suggested format. If `target_defaulted' has been set,
+each possible target type is tried to see if it recognizes the
+specified format. `bfd_check_format' returns `TRUE' when the caller
+guesses right.
+
+* Menu:
+
+* bfd_target::
+
+
+File: bfd.info, Node: bfd_target, Prev: Targets, Up: Targets
+
+2.12.1 bfd_target
+-----------------
+
+*Description*
+This structure contains everything that BFD knows about a target. It
+includes things like its byte order, name, and which routines to call
+to do various operations.
+
+ Every BFD points to a target structure with its `xvec' member.
+
+ The macros below are used to dispatch to functions through the
+`bfd_target' vector. They are used in a number of macros further down
+in `bfd.h', and are also used when calling various routines by hand
+inside the BFD implementation. The ARGLIST argument must be
+parenthesized; it contains all the arguments to the called function.
+
+ They make the documentation (more) unpleasant to read, so if someone
+wants to fix this and not break the above, please do.
+ #define BFD_SEND(bfd, message, arglist) \
+ ((*((bfd)->xvec->message)) arglist)
+
+ #ifdef DEBUG_BFD_SEND
+ #undef BFD_SEND
+ #define BFD_SEND(bfd, message, arglist) \
+ (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
+ ((*((bfd)->xvec->message)) arglist) : \
+ (bfd_assert (__FILE__,__LINE__), NULL))
+ #endif
+ For operations which index on the BFD format:
+ #define BFD_SEND_FMT(bfd, message, arglist) \
+ (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
+
+ #ifdef DEBUG_BFD_SEND
+ #undef BFD_SEND_FMT
+ #define BFD_SEND_FMT(bfd, message, arglist) \
+ (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
+ (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
+ (bfd_assert (__FILE__,__LINE__), NULL))
+ #endif
+ This is the structure which defines the type of BFD this is. The
+`xvec' member of the struct `bfd' itself points here. Each module that
+implements access to a different target under BFD, defines one of these.
+
+ FIXME, these names should be rationalised with the names of the
+entry points which call them. Too bad we can't have one macro to define
+them both!
+ enum bfd_flavour
+ {
+ bfd_target_unknown_flavour,
+ bfd_target_aout_flavour,
+ bfd_target_coff_flavour,
+ bfd_target_ecoff_flavour,
+ bfd_target_xcoff_flavour,
+ bfd_target_elf_flavour,
+ bfd_target_ieee_flavour,
+ bfd_target_nlm_flavour,
+ bfd_target_oasys_flavour,
+ bfd_target_tekhex_flavour,
+ bfd_target_srec_flavour,
+ bfd_target_verilog_flavour,
+ bfd_target_ihex_flavour,
+ bfd_target_som_flavour,
+ bfd_target_os9k_flavour,
+ bfd_target_versados_flavour,
+ bfd_target_msdos_flavour,
+ bfd_target_ovax_flavour,
+ bfd_target_evax_flavour,
+ bfd_target_mmo_flavour,
+ bfd_target_mach_o_flavour,
+ bfd_target_pef_flavour,
+ bfd_target_pef_xlib_flavour,
+ bfd_target_sym_flavour
+ };
+
+ enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
+
+ /* Forward declaration. */
+ typedef struct bfd_link_info _bfd_link_info;
+
+ typedef struct bfd_target
+ {
+ /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */
+ char *name;
+
+ /* The "flavour" of a back end is a general indication about
+ the contents of a file. */
+ enum bfd_flavour flavour;
+
+ /* The order of bytes within the data area of a file. */
+ enum bfd_endian byteorder;
+
+ /* The order of bytes within the header parts of a file. */
+ enum bfd_endian header_byteorder;
+
+ /* A mask of all the flags which an executable may have set -
+ from the set `BFD_NO_FLAGS', `HAS_RELOC', ...`D_PAGED'. */
+ flagword object_flags;
+
+ /* A mask of all the flags which a section may have set - from
+ the set `SEC_NO_FLAGS', `SEC_ALLOC', ...`SET_NEVER_LOAD'. */
+ flagword section_flags;
+
+ /* The character normally found at the front of a symbol.
+ (if any), perhaps `_'. */
+ char symbol_leading_char;
+
+ /* The pad character for file names within an archive header. */
+ char ar_pad_char;
+
+ /* The maximum number of characters in an archive header. */
+ unsigned short ar_max_namelen;
+
+ /* Entries for byte swapping for data. These are different from the
+ other entry points, since they don't take a BFD as the first argument.
+ Certain other handlers could do the same. */
+ bfd_uint64_t (*bfd_getx64) (const void *);
+ bfd_int64_t (*bfd_getx_signed_64) (const void *);
+ void (*bfd_putx64) (bfd_uint64_t, void *);
+ bfd_vma (*bfd_getx32) (const void *);
+ bfd_signed_vma (*bfd_getx_signed_32) (const void *);
+ void (*bfd_putx32) (bfd_vma, void *);
+ bfd_vma (*bfd_getx16) (const void *);
+ bfd_signed_vma (*bfd_getx_signed_16) (const void *);
+ void (*bfd_putx16) (bfd_vma, void *);
+
+ /* Byte swapping for the headers. */
+ bfd_uint64_t (*bfd_h_getx64) (const void *);
+ bfd_int64_t (*bfd_h_getx_signed_64) (const void *);
+ void (*bfd_h_putx64) (bfd_uint64_t, void *);
+ bfd_vma (*bfd_h_getx32) (const void *);
+ bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
+ void (*bfd_h_putx32) (bfd_vma, void *);
+ bfd_vma (*bfd_h_getx16) (const void *);
+ bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
+ void (*bfd_h_putx16) (bfd_vma, void *);
+
+ /* Format dependent routines: these are vectors of entry points
+ within the target vector structure, one for each format to check. */
+
+ /* Check the format of a file being read. Return a `bfd_target *' or zero. */
+ const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *);
+
+ /* Set the format of a file being written. */
+ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
+
+ /* Write cached information into a file being written, at `bfd_close'. */
+ bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
+ The general target vector. These vectors are initialized using the
+BFD_JUMP_TABLE macros.
+
+ /* Generic entry points. */
+ #define BFD_JUMP_TABLE_GENERIC(NAME) \
+ NAME##_close_and_cleanup, \
+ NAME##_bfd_free_cached_info, \
+ NAME##_new_section_hook, \
+ NAME##_get_section_contents, \
+ NAME##_get_section_contents_in_window
+
+ /* Called when the BFD is being closed to do any necessary cleanup. */
+ bfd_boolean (*_close_and_cleanup) (bfd *);
+ /* Ask the BFD to free all cached information. */
+ bfd_boolean (*_bfd_free_cached_info) (bfd *);
+ /* Called when a new section is created. */
+ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
+ /* Read the contents of a section. */
+ bfd_boolean (*_bfd_get_section_contents)
+ (bfd *, sec_ptr, void *, file_ptr, bfd_size_type);
+ bfd_boolean (*_bfd_get_section_contents_in_window)
+ (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type);
+
+ /* Entry points to copy private data. */
+ #define BFD_JUMP_TABLE_COPY(NAME) \
+ NAME##_bfd_copy_private_bfd_data, \
+ NAME##_bfd_merge_private_bfd_data, \
+ _bfd_generic_init_private_section_data, \
+ NAME##_bfd_copy_private_section_data, \
+ NAME##_bfd_copy_private_symbol_data, \
+ NAME##_bfd_copy_private_header_data, \
+ NAME##_bfd_set_private_flags, \
+ NAME##_bfd_print_private_bfd_data
+
+ /* Called to copy BFD general private data from one object file
+ to another. */
+ bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
+ /* Called to merge BFD general private data from one object file
+ to a common output file when linking. */
+ bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *);
+ /* Called to initialize BFD private section data from one object file
+ to another. */
+ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
+ BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info))
+ bfd_boolean (*_bfd_init_private_section_data)
+ (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *);
+ /* Called to copy BFD private section data from one object file
+ to another. */
+ bfd_boolean (*_bfd_copy_private_section_data)
+ (bfd *, sec_ptr, bfd *, sec_ptr);
+ /* Called to copy BFD private symbol data from one symbol
+ to another. */
+ bfd_boolean (*_bfd_copy_private_symbol_data)
+ (bfd *, asymbol *, bfd *, asymbol *);
+ /* Called to copy BFD private header data from one object file
+ to another. */
+ bfd_boolean (*_bfd_copy_private_header_data)
+ (bfd *, bfd *);
+ /* Called to set private backend flags. */
+ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
+
+ /* Called to print private BFD data. */
+ bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
+
+ /* Core file entry points. */
+ #define BFD_JUMP_TABLE_CORE(NAME) \
+ NAME##_core_file_failing_command, \
+ NAME##_core_file_failing_signal, \
+ NAME##_core_file_matches_executable_p
+
+ char * (*_core_file_failing_command) (bfd *);
+ int (*_core_file_failing_signal) (bfd *);
+ bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
+
+ /* Archive entry points. */
+ #define BFD_JUMP_TABLE_ARCHIVE(NAME) \
+ NAME##_slurp_armap, \
+ NAME##_slurp_extended_name_table, \
+ NAME##_construct_extended_name_table, \
+ NAME##_truncate_arname, \
+ NAME##_write_armap, \
+ NAME##_read_ar_hdr, \
+ NAME##_openr_next_archived_file, \
+ NAME##_get_elt_at_index, \
+ NAME##_generic_stat_arch_elt, \
+ NAME##_update_armap_timestamp
+
+ bfd_boolean (*_bfd_slurp_armap) (bfd *);
+ bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
+ bfd_boolean (*_bfd_construct_extended_name_table)
+ (bfd *, char **, bfd_size_type *, const char **);
+ void (*_bfd_truncate_arname) (bfd *, const char *, char *);
+ bfd_boolean (*write_armap)
+ (bfd *, unsigned int, struct orl *, unsigned int, int);
+ void * (*_bfd_read_ar_hdr_fn) (bfd *);
+ bfd * (*openr_next_archived_file) (bfd *, bfd *);
+ #define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
+ bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);
+ int (*_bfd_stat_arch_elt) (bfd *, struct stat *);
+ bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
+
+ /* Entry points used for symbols. */
+ #define BFD_JUMP_TABLE_SYMBOLS(NAME) \
+ NAME##_get_symtab_upper_bound, \
+ NAME##_canonicalize_symtab, \
+ NAME##_make_empty_symbol, \
+ NAME##_print_symbol, \
+ NAME##_get_symbol_info, \
+ NAME##_bfd_is_local_label_name, \
+ NAME##_bfd_is_target_special_symbol, \
+ NAME##_get_lineno, \
+ NAME##_find_nearest_line, \
+ _bfd_generic_find_line, \
+ NAME##_find_inliner_info, \
+ NAME##_bfd_make_debug_symbol, \
+ NAME##_read_minisymbols, \
+ NAME##_minisymbol_to_symbol
+
+ long (*_bfd_get_symtab_upper_bound) (bfd *);
+ long (*_bfd_canonicalize_symtab)
+ (bfd *, struct bfd_symbol **);
+ struct bfd_symbol *
+ (*_bfd_make_empty_symbol) (bfd *);
+ void (*_bfd_print_symbol)
+ (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type);
+ #define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
+ void (*_bfd_get_symbol_info)
+ (bfd *, struct bfd_symbol *, symbol_info *);
+ #define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
+ bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
+ bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
+ alent * (*_get_lineno) (bfd *, struct bfd_symbol *);
+ bfd_boolean (*_bfd_find_nearest_line)
+ (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,
+ const char **, const char **, unsigned int *);
+ bfd_boolean (*_bfd_find_line)
+ (bfd *, struct bfd_symbol **, struct bfd_symbol *,
+ const char **, unsigned int *);
+ bfd_boolean (*_bfd_find_inliner_info)
+ (bfd *, const char **, const char **, unsigned int *);
+ /* Back-door to allow format-aware applications to create debug symbols
+ while using BFD for everything else. Currently used by the assembler
+ when creating COFF files. */
+ asymbol * (*_bfd_make_debug_symbol)
+ (bfd *, void *, unsigned long size);
+ #define bfd_read_minisymbols(b, d, m, s) \
+ BFD_SEND (b, _read_minisymbols, (b, d, m, s))
+ long (*_read_minisymbols)
+ (bfd *, bfd_boolean, void **, unsigned int *);
+ #define bfd_minisymbol_to_symbol(b, d, m, f) \
+ BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
+ asymbol * (*_minisymbol_to_symbol)
+ (bfd *, bfd_boolean, const void *, asymbol *);
+
+ /* Routines for relocs. */
+ #define BFD_JUMP_TABLE_RELOCS(NAME) \
+ NAME##_get_reloc_upper_bound, \
+ NAME##_canonicalize_reloc, \
+ NAME##_bfd_reloc_type_lookup, \
+ NAME##_bfd_reloc_name_lookup
+
+ long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
+ long (*_bfd_canonicalize_reloc)
+ (bfd *, sec_ptr, arelent **, struct bfd_symbol **);
+ /* See documentation on reloc types. */
+ reloc_howto_type *
+ (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
+ reloc_howto_type *
+ (*reloc_name_lookup) (bfd *, const char *);
+
+
+ /* Routines used when writing an object file. */
+ #define BFD_JUMP_TABLE_WRITE(NAME) \
+ NAME##_set_arch_mach, \
+ NAME##_set_section_contents
+
+ bfd_boolean (*_bfd_set_arch_mach)
+ (bfd *, enum bfd_architecture, unsigned long);
+ bfd_boolean (*_bfd_set_section_contents)
+ (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type);
+
+ /* Routines used by the linker. */
+ #define BFD_JUMP_TABLE_LINK(NAME) \
+ NAME##_sizeof_headers, \
+ NAME##_bfd_get_relocated_section_contents, \
+ NAME##_bfd_relax_section, \
+ NAME##_bfd_link_hash_table_create, \
+ NAME##_bfd_link_hash_table_free, \
+ NAME##_bfd_link_add_symbols, \
+ NAME##_bfd_link_just_syms, \
+ NAME##_bfd_final_link, \
+ NAME##_bfd_link_split_section, \
+ NAME##_bfd_gc_sections, \
+ NAME##_bfd_merge_sections, \
+ NAME##_bfd_is_group_section, \
+ NAME##_bfd_discard_group, \
+ NAME##_section_already_linked, \
+ NAME##_bfd_define_common_symbol
+
+ int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
+ bfd_byte * (*_bfd_get_relocated_section_contents)
+ (bfd *, struct bfd_link_info *, struct bfd_link_order *,
+ bfd_byte *, bfd_boolean, struct bfd_symbol **);
+
+ bfd_boolean (*_bfd_relax_section)
+ (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *);
+
+ /* Create a hash table for the linker. Different backends store
+ different information in this table. */
+ struct bfd_link_hash_table *
+ (*_bfd_link_hash_table_create) (bfd *);
+
+ /* Release the memory associated with the linker hash table. */
+ void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *);
+
+ /* Add symbols from this object file into the hash table. */
+ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
+
+ /* Indicate that we are only retrieving symbol values from this section. */
+ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
+
+ /* Do a link based on the link_order structures attached to each
+ section of the BFD. */
+ bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
+
+ /* Should this section be split up into smaller pieces during linking. */
+ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
+
+ /* Remove sections that are not referenced from the output. */
+ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
+
+ /* Attempt to merge SEC_MERGE sections. */
+ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
+
+ /* Is this section a member of a group? */
+ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
+
+ /* Discard members of a group. */
+ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
+
+ /* Check if SEC has been already linked during a reloceatable or
+ final link. */
+ void (*_section_already_linked) (bfd *, struct bfd_section *,
+ struct bfd_link_info *);
+
+ /* Define a common symbol. */
+ bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *,
+ struct bfd_link_hash_entry *);
+
+ /* Routines to handle dynamic symbols and relocs. */
+ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \
+ NAME##_get_dynamic_symtab_upper_bound, \
+ NAME##_canonicalize_dynamic_symtab, \
+ NAME##_get_synthetic_symtab, \
+ NAME##_get_dynamic_reloc_upper_bound, \
+ NAME##_canonicalize_dynamic_reloc
+
+ /* Get the amount of memory required to hold the dynamic symbols. */
+ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
+ /* Read in the dynamic symbols. */
+ long (*_bfd_canonicalize_dynamic_symtab)
+ (bfd *, struct bfd_symbol **);
+ /* Create synthetized symbols. */
+ long (*_bfd_get_synthetic_symtab)
+ (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **,
+ struct bfd_symbol **);
+ /* Get the amount of memory required to hold the dynamic relocs. */
+ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
+ /* Read in the dynamic relocs. */
+ long (*_bfd_canonicalize_dynamic_reloc)
+ (bfd *, arelent **, struct bfd_symbol **);
+ A pointer to an alternative bfd_target in case the current one is not
+satisfactory. This can happen when the target cpu supports both big
+and little endian code, and target chosen by the linker has the wrong
+endianness. The function open_output() in ld/ldlang.c uses this field
+to find an alternative output format that is suitable.
+ /* Opposite endian version of this target. */
+ const struct bfd_target * alternative_target;
+
+ /* Data for use by back-end routines, which isn't
+ generic enough to belong in this structure. */
+ const void *backend_data;
+
+ } bfd_target;
+
+2.12.1.1 `bfd_set_default_target'
+.................................
+
+*Synopsis*
+ bfd_boolean bfd_set_default_target (const char *name);
+ *Description*
+Set the default target vector to use when recognizing a BFD. This
+takes the name of the target, which may be a BFD target name or a
+configuration triplet.
+
+2.12.1.2 `bfd_find_target'
+..........................
+
+*Synopsis*
+ const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
+ *Description*
+Return a pointer to the transfer vector for the object target named
+TARGET_NAME. If TARGET_NAME is `NULL', choose the one in the
+environment variable `GNUTARGET'; if that is null or not defined, then
+choose the first entry in the target list. Passing in the string
+"default" or setting the environment variable to "default" will cause
+the first entry in the target list to be returned, and
+"target_defaulted" will be set in the BFD if ABFD isn't `NULL'. This
+causes `bfd_check_format' to loop over all the targets to find the one
+that matches the file being read.
+
+2.12.1.3 `bfd_target_list'
+..........................
+
+*Synopsis*
+ const char ** bfd_target_list (void);
+ *Description*
+Return a freshly malloced NULL-terminated vector of the names of all
+the valid BFD targets. Do not modify the names.
+
+2.12.1.4 `bfd_seach_for_target'
+...............................
+
+*Synopsis*
+ const bfd_target *bfd_search_for_target
+ (int (*search_func) (const bfd_target *, void *),
+ void *);
+ *Description*
+Return a pointer to the first transfer vector in the list of transfer
+vectors maintained by BFD that produces a non-zero result when passed
+to the function SEARCH_FUNC. The parameter DATA is passed, unexamined,
+to the search function.
+
+
+File: bfd.info, Node: Architectures, Next: Opening and Closing, Prev: Targets, Up: BFD front end
+
+2.13 Architectures
+==================
+
+BFD keeps one atom in a BFD describing the architecture of the data
+attached to the BFD: a pointer to a `bfd_arch_info_type'.
+
+ Pointers to structures can be requested independently of a BFD so
+that an architecture's information can be interrogated without access
+to an open BFD.
+
+ The architecture information is provided by each architecture
+package. The set of default architectures is selected by the macro
+`SELECT_ARCHITECTURES'. This is normally set up in the
+`config/TARGET.mt' file of your choice. If the name is not defined,
+then all the architectures supported are included.
+
+ When BFD starts up, all the architectures are called with an
+initialize method. It is up to the architecture back end to insert as
+many items into the list of architectures as it wants to; generally
+this would be one for each machine and one for the default case (an
+item with a machine field of 0).
+
+ BFD's idea of an architecture is implemented in `archures.c'.
+
+2.13.1 bfd_architecture
+-----------------------
+
+*Description*
+This enum gives the object file's CPU architecture, in a global
+sense--i.e., what processor family does it belong to? Another field
+indicates which processor within the family is in use. The machine
+gives a number which distinguishes different versions of the
+architecture, containing, for example, 2 and 3 for Intel i960 KA and
+i960 KB, and 68020 and 68030 for Motorola 68020 and 68030.
+ enum bfd_architecture
+ {
+ bfd_arch_unknown, /* File arch not known. */
+ bfd_arch_obscure, /* Arch known, not one of these. */
+ bfd_arch_m68k, /* Motorola 68xxx */
+ #define bfd_mach_m68000 1
+ #define bfd_mach_m68008 2
+ #define bfd_mach_m68010 3
+ #define bfd_mach_m68020 4
+ #define bfd_mach_m68030 5
+ #define bfd_mach_m68040 6
+ #define bfd_mach_m68060 7
+ #define bfd_mach_cpu32 8
+ #define bfd_mach_fido 9
+ #define bfd_mach_mcf_isa_a_nodiv 10
+ #define bfd_mach_mcf_isa_a 11
+ #define bfd_mach_mcf_isa_a_mac 12
+ #define bfd_mach_mcf_isa_a_emac 13
+ #define bfd_mach_mcf_isa_aplus 14
+ #define bfd_mach_mcf_isa_aplus_mac 15
+ #define bfd_mach_mcf_isa_aplus_emac 16
+ #define bfd_mach_mcf_isa_b_nousp 17
+ #define bfd_mach_mcf_isa_b_nousp_mac 18
+ #define bfd_mach_mcf_isa_b_nousp_emac 19
+ #define bfd_mach_mcf_isa_b 20
+ #define bfd_mach_mcf_isa_b_mac 21
+ #define bfd_mach_mcf_isa_b_emac 22
+ #define bfd_mach_mcf_isa_b_float 23
+ #define bfd_mach_mcf_isa_b_float_mac 24
+ #define bfd_mach_mcf_isa_b_float_emac 25
+ #define bfd_mach_mcf_isa_c 26
+ #define bfd_mach_mcf_isa_c_mac 27
+ #define bfd_mach_mcf_isa_c_emac 28
+ #define bfd_mach_mcf_isa_c_nodiv 29
+ #define bfd_mach_mcf_isa_c_nodiv_mac 30
+ #define bfd_mach_mcf_isa_c_nodiv_emac 31
+ bfd_arch_vax, /* DEC Vax */
+ bfd_arch_i960, /* Intel 960 */
+ /* The order of the following is important.
+ lower number indicates a machine type that
+ only accepts a subset of the instructions
+ available to machines with higher numbers.
+ The exception is the "ca", which is
+ incompatible with all other machines except
+ "core". */
+
+ #define bfd_mach_i960_core 1
+ #define bfd_mach_i960_ka_sa 2
+ #define bfd_mach_i960_kb_sb 3
+ #define bfd_mach_i960_mc 4
+ #define bfd_mach_i960_xa 5
+ #define bfd_mach_i960_ca 6
+ #define bfd_mach_i960_jx 7
+ #define bfd_mach_i960_hx 8
+
+ bfd_arch_or32, /* OpenRISC 32 */
+
+ bfd_arch_sparc, /* SPARC */
+ #define bfd_mach_sparc 1
+ /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
+ #define bfd_mach_sparc_sparclet 2
+ #define bfd_mach_sparc_sparclite 3
+ #define bfd_mach_sparc_v8plus 4
+ #define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */
+ #define bfd_mach_sparc_sparclite_le 6
+ #define bfd_mach_sparc_v9 7
+ #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */
+ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */
+ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */
+ /* Nonzero if MACH has the v9 instruction set. */
+ #define bfd_mach_sparc_v9_p(mach) \
+ ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
+ && (mach) != bfd_mach_sparc_sparclite_le)
+ /* Nonzero if MACH is a 64 bit sparc architecture. */
+ #define bfd_mach_sparc_64bit_p(mach) \
+ ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb)
+ bfd_arch_spu, /* PowerPC SPU */
+ #define bfd_mach_spu 256
+ bfd_arch_mips, /* MIPS Rxxxx */
+ #define bfd_mach_mips3000 3000
+ #define bfd_mach_mips3900 3900
+ #define bfd_mach_mips4000 4000
+ #define bfd_mach_mips4010 4010
+ #define bfd_mach_mips4100 4100
+ #define bfd_mach_mips4111 4111
+ #define bfd_mach_mips4120 4120
+ #define bfd_mach_mips4300 4300
+ #define bfd_mach_mips4400 4400
+ #define bfd_mach_mips4600 4600
+ #define bfd_mach_mips4650 4650
+ #define bfd_mach_mips5000 5000
+ #define bfd_mach_mips5400 5400
+ #define bfd_mach_mips5500 5500
+ #define bfd_mach_mips6000 6000
+ #define bfd_mach_mips7000 7000
+ #define bfd_mach_mips8000 8000
+ #define bfd_mach_mips9000 9000
+ #define bfd_mach_mips10000 10000
+ #define bfd_mach_mips12000 12000
+ #define bfd_mach_mips14000 14000
+ #define bfd_mach_mips16000 16000
+ #define bfd_mach_mips16 16
+ #define bfd_mach_mips5 5
+ #define bfd_mach_mips_loongson_2e 3001
+ #define bfd_mach_mips_loongson_2f 3002
+ #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */
+ #define bfd_mach_mips_octeon 6501
+ #define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */
+ #define bfd_mach_mipsisa32 32
+ #define bfd_mach_mipsisa32r2 33
+ #define bfd_mach_mipsisa64 64
+ #define bfd_mach_mipsisa64r2 65
+ bfd_arch_i386, /* Intel 386 */
+ #define bfd_mach_i386_i386 1
+ #define bfd_mach_i386_i8086 2
+ #define bfd_mach_i386_i386_intel_syntax 3
+ #define bfd_mach_x86_64 64
+ #define bfd_mach_x86_64_intel_syntax 65
+ bfd_arch_l1om, /* Intel L1OM */
+ #define bfd_mach_l1om 66
+ #define bfd_mach_l1om_intel_syntax 67
+ bfd_arch_we32k, /* AT&T WE32xxx */
+ bfd_arch_tahoe, /* CCI/Harris Tahoe */
+ bfd_arch_i860, /* Intel 860 */
+ bfd_arch_i370, /* IBM 360/370 Mainframes */
+ bfd_arch_romp, /* IBM ROMP PC/RT */
+ bfd_arch_convex, /* Convex */
+ bfd_arch_m88k, /* Motorola 88xxx */
+ bfd_arch_m98k, /* Motorola 98xxx */
+ bfd_arch_pyramid, /* Pyramid Technology */
+ bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */
+ #define bfd_mach_h8300 1
+ #define bfd_mach_h8300h 2
+ #define bfd_mach_h8300s 3
+ #define bfd_mach_h8300hn 4
+ #define bfd_mach_h8300sn 5
+ #define bfd_mach_h8300sx 6
+ #define bfd_mach_h8300sxn 7
+ bfd_arch_pdp11, /* DEC PDP-11 */
+ bfd_arch_plugin,
+ bfd_arch_powerpc, /* PowerPC */
+ #define bfd_mach_ppc 32
+ #define bfd_mach_ppc64 64
+ #define bfd_mach_ppc_403 403
+ #define bfd_mach_ppc_403gc 4030
+ #define bfd_mach_ppc_405 405
+ #define bfd_mach_ppc_505 505
+ #define bfd_mach_ppc_601 601
+ #define bfd_mach_ppc_602 602
+ #define bfd_mach_ppc_603 603
+ #define bfd_mach_ppc_ec603e 6031
+ #define bfd_mach_ppc_604 604
+ #define bfd_mach_ppc_620 620
+ #define bfd_mach_ppc_630 630
+ #define bfd_mach_ppc_750 750
+ #define bfd_mach_ppc_860 860
+ #define bfd_mach_ppc_a35 35
+ #define bfd_mach_ppc_rs64ii 642
+ #define bfd_mach_ppc_rs64iii 643
+ #define bfd_mach_ppc_7400 7400
+ #define bfd_mach_ppc_e500 500
+ #define bfd_mach_ppc_e500mc 5001
+ bfd_arch_rs6000, /* IBM RS/6000 */
+ #define bfd_mach_rs6k 6000
+ #define bfd_mach_rs6k_rs1 6001
+ #define bfd_mach_rs6k_rsc 6003
+ #define bfd_mach_rs6k_rs2 6002
+ bfd_arch_hppa, /* HP PA RISC */
+ #define bfd_mach_hppa10 10
+ #define bfd_mach_hppa11 11
+ #define bfd_mach_hppa20 20
+ #define bfd_mach_hppa20w 25
+ bfd_arch_d10v, /* Mitsubishi D10V */
+ #define bfd_mach_d10v 1
+ #define bfd_mach_d10v_ts2 2
+ #define bfd_mach_d10v_ts3 3
+ bfd_arch_d30v, /* Mitsubishi D30V */
+ bfd_arch_dlx, /* DLX */
+ bfd_arch_m68hc11, /* Motorola 68HC11 */
+ bfd_arch_m68hc12, /* Motorola 68HC12 */
+ #define bfd_mach_m6812_default 0
+ #define bfd_mach_m6812 1
+ #define bfd_mach_m6812s 2
+ bfd_arch_z8k, /* Zilog Z8000 */
+ #define bfd_mach_z8001 1
+ #define bfd_mach_z8002 2
+ bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */
+ bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */
+ #define bfd_mach_sh 1
+ #define bfd_mach_sh2 0x20
+ #define bfd_mach_sh_dsp 0x2d
+ #define bfd_mach_sh2a 0x2a
+ #define bfd_mach_sh2a_nofpu 0x2b
+ #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
+ #define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
+ #define bfd_mach_sh2a_or_sh4 0x2a3
+ #define bfd_mach_sh2a_or_sh3e 0x2a4
+ #define bfd_mach_sh2e 0x2e
+ #define bfd_mach_sh3 0x30
+ #define bfd_mach_sh3_nommu 0x31
+ #define bfd_mach_sh3_dsp 0x3d
+ #define bfd_mach_sh3e 0x3e
+ #define bfd_mach_sh4 0x40
+ #define bfd_mach_sh4_nofpu 0x41
+ #define bfd_mach_sh4_nommu_nofpu 0x42
+ #define bfd_mach_sh4a 0x4a
+ #define bfd_mach_sh4a_nofpu 0x4b
+ #define bfd_mach_sh4al_dsp 0x4d
+ #define bfd_mach_sh5 0x50
+ bfd_arch_alpha, /* Dec Alpha */
+ #define bfd_mach_alpha_ev4 0x10
+ #define bfd_mach_alpha_ev5 0x20
+ #define bfd_mach_alpha_ev6 0x30
+ bfd_arch_arm, /* Advanced Risc Machines ARM. */
+ #define bfd_mach_arm_unknown 0
+ #define bfd_mach_arm_2 1
+ #define bfd_mach_arm_2a 2
+ #define bfd_mach_arm_3 3
+ #define bfd_mach_arm_3M 4
+ #define bfd_mach_arm_4 5
+ #define bfd_mach_arm_4T 6
+ #define bfd_mach_arm_5 7
+ #define bfd_mach_arm_5T 8
+ #define bfd_mach_arm_5TE 9
+ #define bfd_mach_arm_XScale 10
+ #define bfd_mach_arm_ep9312 11
+ #define bfd_mach_arm_iWMMXt 12
+ #define bfd_mach_arm_iWMMXt2 13
+ bfd_arch_ns32k, /* National Semiconductors ns32000 */
+ bfd_arch_w65, /* WDC 65816 */
+ bfd_arch_tic30, /* Texas Instruments TMS320C30 */
+ bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */
+ #define bfd_mach_tic3x 30
+ #define bfd_mach_tic4x 40
+ bfd_arch_tic54x, /* Texas Instruments TMS320C54X */
+ bfd_arch_tic80, /* TI TMS320c80 (MVP) */
+ bfd_arch_v850, /* NEC V850 */
+ #define bfd_mach_v850 1
+ #define bfd_mach_v850e 'E'
+ #define bfd_mach_v850e1 '1'
+ bfd_arch_arc, /* ARC Cores */
+ #define bfd_mach_arc_5 5
+ #define bfd_mach_arc_6 6
+ #define bfd_mach_arc_7 7
+ #define bfd_mach_arc_8 8
+ bfd_arch_m32c, /* Renesas M16C/M32C. */
+ #define bfd_mach_m16c 0x75
+ #define bfd_mach_m32c 0x78
+ bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */
+ #define bfd_mach_m32r 1 /* For backwards compatibility. */
+ #define bfd_mach_m32rx 'x'
+ #define bfd_mach_m32r2 '2'
+ bfd_arch_mn10200, /* Matsushita MN10200 */
+ bfd_arch_mn10300, /* Matsushita MN10300 */
+ #define bfd_mach_mn10300 300
+ #define bfd_mach_am33 330
+ #define bfd_mach_am33_2 332
+ bfd_arch_fr30,
+ #define bfd_mach_fr30 0x46523330
+ bfd_arch_frv,
+ #define bfd_mach_frv 1
+ #define bfd_mach_frvsimple 2
+ #define bfd_mach_fr300 300
+ #define bfd_mach_fr400 400
+ #define bfd_mach_fr450 450
+ #define bfd_mach_frvtomcat 499 /* fr500 prototype */
+ #define bfd_mach_fr500 500
+ #define bfd_mach_fr550 550
+ bfd_arch_moxie, /* The moxie processor */
+ #define bfd_mach_moxie 1
+ bfd_arch_mcore,
+ bfd_arch_mep,
+ #define bfd_mach_mep 1
+ #define bfd_mach_mep_h1 0x6831
+ #define bfd_mach_mep_c5 0x6335
+ bfd_arch_ia64, /* HP/Intel ia64 */
+ #define bfd_mach_ia64_elf64 64
+ #define bfd_mach_ia64_elf32 32
+ bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */
+ #define bfd_mach_ip2022 1
+ #define bfd_mach_ip2022ext 2
+ bfd_arch_iq2000, /* Vitesse IQ2000. */
+ #define bfd_mach_iq2000 1
+ #define bfd_mach_iq10 2
+ bfd_arch_mt,
+ #define bfd_mach_ms1 1
+ #define bfd_mach_mrisc2 2
+ #define bfd_mach_ms2 3
+ bfd_arch_pj,
+ bfd_arch_avr, /* Atmel AVR microcontrollers. */
+ #define bfd_mach_avr1 1
+ #define bfd_mach_avr2 2
+ #define bfd_mach_avr25 25
+ #define bfd_mach_avr3 3
+ #define bfd_mach_avr31 31
+ #define bfd_mach_avr35 35
+ #define bfd_mach_avr4 4
+ #define bfd_mach_avr5 5
+ #define bfd_mach_avr51 51
+ #define bfd_mach_avr6 6
+ bfd_arch_bfin, /* ADI Blackfin */
+ #define bfd_mach_bfin 1
+ bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */
+ #define bfd_mach_cr16 1
+ bfd_arch_cr16c, /* National Semiconductor CompactRISC. */
+ #define bfd_mach_cr16c 1
+ bfd_arch_crx, /* National Semiconductor CRX. */
+ #define bfd_mach_crx 1
+ bfd_arch_cris, /* Axis CRIS */
+ #define bfd_mach_cris_v0_v10 255
+ #define bfd_mach_cris_v32 32
+ #define bfd_mach_cris_v10_v32 1032
+ bfd_arch_s390, /* IBM s390 */
+ #define bfd_mach_s390_31 31
+ #define bfd_mach_s390_64 64
+ bfd_arch_score, /* Sunplus score */
+ #define bfd_mach_score3 3
+ #define bfd_mach_score7 7
+ bfd_arch_openrisc, /* OpenRISC */
+ bfd_arch_mmix, /* Donald Knuth's educational processor. */
+ bfd_arch_xstormy16,
+ #define bfd_mach_xstormy16 1
+ bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */
+ #define bfd_mach_msp11 11
+ #define bfd_mach_msp110 110
+ #define bfd_mach_msp12 12
+ #define bfd_mach_msp13 13
+ #define bfd_mach_msp14 14
+ #define bfd_mach_msp15 15
+ #define bfd_mach_msp16 16
+ #define bfd_mach_msp21 21
+ #define bfd_mach_msp31 31
+ #define bfd_mach_msp32 32
+ #define bfd_mach_msp33 33
+ #define bfd_mach_msp41 41
+ #define bfd_mach_msp42 42
+ #define bfd_mach_msp43 43
+ #define bfd_mach_msp44 44
+ bfd_arch_xc16x, /* Infineon's XC16X Series. */
+ #define bfd_mach_xc16x 1
+ #define bfd_mach_xc16xl 2
+ #define bfd_mach_xc16xs 3
+ bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
+ #define bfd_mach_xtensa 1
+ bfd_arch_maxq, /* Dallas MAXQ 10/20 */
+ #define bfd_mach_maxq10 10
+ #define bfd_mach_maxq20 20
+ bfd_arch_z80,
+ #define bfd_mach_z80strict 1 /* No undocumented opcodes. */
+ #define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */
+ #define bfd_mach_z80full 7 /* All undocumented instructions. */
+ #define bfd_mach_r800 11 /* R800: successor with multiplication. */
+ bfd_arch_lm32, /* Lattice Mico32 */
+ #define bfd_mach_lm32 1
+ bfd_arch_microblaze,/* Xilinx MicroBlaze. */
+ bfd_arch_last
+ };
+
+2.13.2 bfd_arch_info
+--------------------
+
+*Description*
+This structure contains information on architectures for use within BFD.
+
+ typedef struct bfd_arch_info
+ {
+ int bits_per_word;
+ int bits_per_address;
+ int bits_per_byte;
+ enum bfd_architecture arch;
+ unsigned long mach;
+ const char *arch_name;
+ const char *printable_name;
+ unsigned int section_align_power;
+ /* TRUE if this is the default machine for the architecture.
+ The default arch should be the first entry for an arch so that
+ all the entries for that arch can be accessed via `next'. */
+ bfd_boolean the_default;
+ const struct bfd_arch_info * (*compatible)
+ (const struct bfd_arch_info *a, const struct bfd_arch_info *b);
+
+ bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
+
+ const struct bfd_arch_info *next;
+ }
+ bfd_arch_info_type;
+
+2.13.2.1 `bfd_printable_name'
+.............................
+
+*Synopsis*
+ const char *bfd_printable_name (bfd *abfd);
+ *Description*
+Return a printable string representing the architecture and machine
+from the pointer to the architecture info structure.
+
+2.13.2.2 `bfd_scan_arch'
+........................
+
+*Synopsis*
+ const bfd_arch_info_type *bfd_scan_arch (const char *string);
+ *Description*
+Figure out if BFD supports any cpu which could be described with the
+name STRING. Return a pointer to an `arch_info' structure if a machine
+is found, otherwise NULL.
+
+2.13.2.3 `bfd_arch_list'
+........................
+
+*Synopsis*
+ const char **bfd_arch_list (void);
+ *Description*
+Return a freshly malloced NULL-terminated vector of the names of all
+the valid BFD architectures. Do not modify the names.
+
+2.13.2.4 `bfd_arch_get_compatible'
+..................................
+
+*Synopsis*
+ const bfd_arch_info_type *bfd_arch_get_compatible
+ (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
+ *Description*
+Determine whether two BFDs' architectures and machine types are
+compatible. Calculates the lowest common denominator between the two
+architectures and machine types implied by the BFDs and returns a
+pointer to an `arch_info' structure describing the compatible machine.
+
+2.13.2.5 `bfd_default_arch_struct'
+..................................
+
+*Description*
+The `bfd_default_arch_struct' is an item of `bfd_arch_info_type' which
+has been initialized to a fairly generic state. A BFD starts life by
+pointing to this structure, until the correct back end has determined
+the real architecture of the file.
+ extern const bfd_arch_info_type bfd_default_arch_struct;
+
+2.13.2.6 `bfd_set_arch_info'
+............................
+
+*Synopsis*
+ void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
+ *Description*
+Set the architecture info of ABFD to ARG.
+
+2.13.2.7 `bfd_default_set_arch_mach'
+....................................
+
+*Synopsis*
+ bfd_boolean bfd_default_set_arch_mach
+ (bfd *abfd, enum bfd_architecture arch, unsigned long mach);
+ *Description*
+Set the architecture and machine type in BFD ABFD to ARCH and MACH.
+Find the correct pointer to a structure and insert it into the
+`arch_info' pointer.
+
+2.13.2.8 `bfd_get_arch'
+.......................
+
+*Synopsis*
+ enum bfd_architecture bfd_get_arch (bfd *abfd);
+ *Description*
+Return the enumerated type which describes the BFD ABFD's architecture.
+
+2.13.2.9 `bfd_get_mach'
+.......................
+
+*Synopsis*
+ unsigned long bfd_get_mach (bfd *abfd);
+ *Description*
+Return the long type which describes the BFD ABFD's machine.
+
+2.13.2.10 `bfd_arch_bits_per_byte'
+..................................
+
+*Synopsis*
+ unsigned int bfd_arch_bits_per_byte (bfd *abfd);
+ *Description*
+Return the number of bits in one of the BFD ABFD's architecture's bytes.
+
+2.13.2.11 `bfd_arch_bits_per_address'
+.....................................
+
+*Synopsis*
+ unsigned int bfd_arch_bits_per_address (bfd *abfd);
+ *Description*
+Return the number of bits in one of the BFD ABFD's architecture's
+addresses.
+
+2.13.2.12 `bfd_default_compatible'
+..................................
+
+*Synopsis*
+ const bfd_arch_info_type *bfd_default_compatible
+ (const bfd_arch_info_type *a, const bfd_arch_info_type *b);
+ *Description*
+The default function for testing for compatibility.
+
+2.13.2.13 `bfd_default_scan'
+............................
+
+*Synopsis*
+ bfd_boolean bfd_default_scan
+ (const struct bfd_arch_info *info, const char *string);
+ *Description*
+The default function for working out whether this is an architecture
+hit and a machine hit.
+
+2.13.2.14 `bfd_get_arch_info'
+.............................
+
+*Synopsis*
+ const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
+ *Description*
+Return the architecture info struct in ABFD.
+
+2.13.2.15 `bfd_lookup_arch'
+...........................
+
+*Synopsis*
+ const bfd_arch_info_type *bfd_lookup_arch
+ (enum bfd_architecture arch, unsigned long machine);
+ *Description*
+Look for the architecture info structure which matches the arguments
+ARCH and MACHINE. A machine of 0 matches the machine/architecture
+structure which marks itself as the default.
+
+2.13.2.16 `bfd_printable_arch_mach'
+...................................
+
+*Synopsis*
+ const char *bfd_printable_arch_mach
+ (enum bfd_architecture arch, unsigned long machine);
+ *Description*
+Return a printable string representing the architecture and machine
+type.
+
+ This routine is depreciated.
+
+2.13.2.17 `bfd_octets_per_byte'
+...............................
+
+*Synopsis*
+ unsigned int bfd_octets_per_byte (bfd *abfd);
+ *Description*
+Return the number of octets (8-bit quantities) per target byte (minimum
+addressable unit). In most cases, this will be one, but some DSP
+targets have 16, 32, or even 48 bits per byte.
+
+2.13.2.18 `bfd_arch_mach_octets_per_byte'
+.........................................
+
+*Synopsis*
+ unsigned int bfd_arch_mach_octets_per_byte
+ (enum bfd_architecture arch, unsigned long machine);
+ *Description*
+See bfd_octets_per_byte.
+
+ This routine is provided for those cases where a bfd * is not
+available
+
+
+File: bfd.info, Node: Opening and Closing, Next: Internal, Prev: Architectures, Up: BFD front end
+
+2.14 Opening and closing BFDs
+=============================
+
+2.14.1 Functions for opening and closing
+----------------------------------------
+
+2.14.1.1 `bfd_fopen'
+....................
+
+*Synopsis*
+ bfd *bfd_fopen (const char *filename, const char *target,
+ const char *mode, int fd);
+ *Description*
+Open the file FILENAME with the target TARGET. Return a pointer to the
+created BFD. If FD is not -1, then `fdopen' is used to open the file;
+otherwise, `fopen' is used. MODE is passed directly to `fopen' or
+`fdopen'.
+
+ Calls `bfd_find_target', so TARGET is interpreted as by that
+function.
+
+ The new BFD is marked as cacheable iff FD is -1.
+
+ If `NULL' is returned then an error has occured. Possible errors
+are `bfd_error_no_memory', `bfd_error_invalid_target' or `system_call'
+error.
+
+2.14.1.2 `bfd_openr'
+....................
+
+*Synopsis*
+ bfd *bfd_openr (const char *filename, const char *target);
+ *Description*
+Open the file FILENAME (using `fopen') with the target TARGET. Return
+a pointer to the created BFD.
+
+ Calls `bfd_find_target', so TARGET is interpreted as by that
+function.
+
+ If `NULL' is returned then an error has occured. Possible errors
+are `bfd_error_no_memory', `bfd_error_invalid_target' or `system_call'
+error.
+
+2.14.1.3 `bfd_fdopenr'
+......................
+
+*Synopsis*
+ bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
+ *Description*
+`bfd_fdopenr' is to `bfd_fopenr' much like `fdopen' is to `fopen'. It
+opens a BFD on a file already described by the FD supplied.
+
+ When the file is later `bfd_close'd, the file descriptor will be
+closed. If the caller desires that this file descriptor be cached by
+BFD (opened as needed, closed as needed to free descriptors for other
+opens), with the supplied FD used as an initial file descriptor (but
+subject to closure at any time), call bfd_set_cacheable(bfd, 1) on the
+returned BFD. The default is to assume no caching; the file descriptor
+will remain open until `bfd_close', and will not be affected by BFD
+operations on other files.
+
+ Possible errors are `bfd_error_no_memory',
+`bfd_error_invalid_target' and `bfd_error_system_call'.
+
+2.14.1.4 `bfd_openstreamr'
+..........................
+
+*Synopsis*
+ bfd *bfd_openstreamr (const char *, const char *, void *);
+ *Description*
+Open a BFD for read access on an existing stdio stream. When the BFD
+is passed to `bfd_close', the stream will be closed.
+
+2.14.1.5 `bfd_openr_iovec'
+..........................
+
+*Synopsis*
+ bfd *bfd_openr_iovec (const char *filename, const char *target,
+ void *(*open) (struct bfd *nbfd,
+ void *open_closure),
+ void *open_closure,
+ file_ptr (*pread) (struct bfd *nbfd,
+ void *stream,
+ void *buf,
+ file_ptr nbytes,
+ file_ptr offset),
+ int (*close) (struct bfd *nbfd,
+ void *stream),
+ int (*stat) (struct bfd *abfd,
+ void *stream,
+ struct stat *sb));
+ *Description*
+Create and return a BFD backed by a read-only STREAM. The STREAM is
+created using OPEN, accessed using PREAD and destroyed using CLOSE.
+
+ Calls `bfd_find_target', so TARGET is interpreted as by that
+function.
+
+ Calls OPEN (which can call `bfd_zalloc' and `bfd_get_filename') to
+obtain the read-only stream backing the BFD. OPEN either succeeds
+returning the non-`NULL' STREAM, or fails returning `NULL' (setting
+`bfd_error').
+
+ Calls PREAD to request NBYTES of data from STREAM starting at OFFSET
+(e.g., via a call to `bfd_read'). PREAD either succeeds returning the
+number of bytes read (which can be less than NBYTES when end-of-file),
+or fails returning -1 (setting `bfd_error').
+
+ Calls CLOSE when the BFD is later closed using `bfd_close'. CLOSE
+either succeeds returning 0, or fails returning -1 (setting
+`bfd_error').
+
+ Calls STAT to fill in a stat structure for bfd_stat, bfd_get_size,
+and bfd_get_mtime calls. STAT returns 0 on success, or returns -1 on
+failure (setting `bfd_error').
+
+ If `bfd_openr_iovec' returns `NULL' then an error has occurred.
+Possible errors are `bfd_error_no_memory', `bfd_error_invalid_target'
+and `bfd_error_system_call'.
+
+2.14.1.6 `bfd_openw'
+....................
+
+*Synopsis*
+ bfd *bfd_openw (const char *filename, const char *target);
+ *Description*
+Create a BFD, associated with file FILENAME, using the file format
+TARGET, and return a pointer to it.
+
+ Possible errors are `bfd_error_system_call', `bfd_error_no_memory',
+`bfd_error_invalid_target'.
+
+2.14.1.7 `bfd_close'
+....................
+
+*Synopsis*
+ bfd_boolean bfd_close (bfd *abfd);
+ *Description*
+Close a BFD. If the BFD was open for writing, then pending operations
+are completed and the file written out and closed. If the created file
+is executable, then `chmod' is called to mark it as such.
+
+ All memory attached to the BFD is released.
+
+ The file descriptor associated with the BFD is closed (even if it
+was passed in to BFD by `bfd_fdopenr').
+
+ *Returns*
+`TRUE' is returned if all is ok, otherwise `FALSE'.
+
+2.14.1.8 `bfd_close_all_done'
+.............................
+
+*Synopsis*
+ bfd_boolean bfd_close_all_done (bfd *);
+ *Description*
+Close a BFD. Differs from `bfd_close' since it does not complete any
+pending operations. This routine would be used if the application had
+just used BFD for swapping and didn't want to use any of the writing
+code.
+
+ If the created file is executable, then `chmod' is called to mark it
+as such.
+
+ All memory attached to the BFD is released.
+
+ *Returns*
+`TRUE' is returned if all is ok, otherwise `FALSE'.
+
+2.14.1.9 `bfd_create'
+.....................
+
+*Synopsis*
+ bfd *bfd_create (const char *filename, bfd *templ);
+ *Description*
+Create a new BFD in the manner of `bfd_openw', but without opening a
+file. The new BFD takes the target from the target used by TEMPLATE.
+The format is always set to `bfd_object'.
+
+2.14.1.10 `bfd_make_writable'
+.............................
+
+*Synopsis*
+ bfd_boolean bfd_make_writable (bfd *abfd);
+ *Description*
+Takes a BFD as created by `bfd_create' and converts it into one like as
+returned by `bfd_openw'. It does this by converting the BFD to
+BFD_IN_MEMORY. It's assumed that you will call `bfd_make_readable' on
+this bfd later.
+
+ *Returns*
+`TRUE' is returned if all is ok, otherwise `FALSE'.
+
+2.14.1.11 `bfd_make_readable'
+.............................
+
+*Synopsis*
+ bfd_boolean bfd_make_readable (bfd *abfd);
+ *Description*
+Takes a BFD as created by `bfd_create' and `bfd_make_writable' and
+converts it into one like as returned by `bfd_openr'. It does this by
+writing the contents out to the memory buffer, then reversing the
+direction.
+
+ *Returns*
+`TRUE' is returned if all is ok, otherwise `FALSE'.
+
+2.14.1.12 `bfd_alloc'
+.....................
+
+*Synopsis*
+ void *bfd_alloc (bfd *abfd, bfd_size_type wanted);
+ *Description*
+Allocate a block of WANTED bytes of memory attached to `abfd' and
+return a pointer to it.
+
+2.14.1.13 `bfd_alloc2'
+......................
+
+*Synopsis*
+ void *bfd_alloc2 (bfd *abfd, bfd_size_type nmemb, bfd_size_type size);
+ *Description*
+Allocate a block of NMEMB elements of SIZE bytes each of memory
+attached to `abfd' and return a pointer to it.
+
+2.14.1.14 `bfd_zalloc'
+......................
+
+*Synopsis*
+ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted);
+ *Description*
+Allocate a block of WANTED bytes of zeroed memory attached to `abfd'
+and return a pointer to it.
+
+2.14.1.15 `bfd_zalloc2'
+.......................
+
+*Synopsis*
+ void *bfd_zalloc2 (bfd *abfd, bfd_size_type nmemb, bfd_size_type size);
+ *Description*
+Allocate a block of NMEMB elements of SIZE bytes each of zeroed memory
+attached to `abfd' and return a pointer to it.
+
+2.14.1.16 `bfd_calc_gnu_debuglink_crc32'
+........................................
+
+*Synopsis*
+ unsigned long bfd_calc_gnu_debuglink_crc32
+ (unsigned long crc, const unsigned char *buf, bfd_size_type len);
+ *Description*
+Computes a CRC value as used in the .gnu_debuglink section. Advances
+the previously computed CRC value by computing and adding in the crc32
+for LEN bytes of BUF.
+
+ *Returns*
+Return the updated CRC32 value.
+
+2.14.1.17 `get_debug_link_info'
+...............................
+
+*Synopsis*
+ char *get_debug_link_info (bfd *abfd, unsigned long *crc32_out);
+ *Description*
+fetch the filename and CRC32 value for any separate debuginfo
+associated with ABFD. Return NULL if no such info found, otherwise
+return filename and update CRC32_OUT.
+
+2.14.1.18 `separate_debug_file_exists'
+......................................
+
+*Synopsis*
+ bfd_boolean separate_debug_file_exists
+ (char *name, unsigned long crc32);
+ *Description*
+Checks to see if NAME is a file and if its contents match CRC32.
+
+2.14.1.19 `find_separate_debug_file'
+....................................
+
+*Synopsis*
+ char *find_separate_debug_file (bfd *abfd);
+ *Description*
+Searches ABFD for a reference to separate debugging information, scans
+various locations in the filesystem, including the file tree rooted at
+DEBUG_FILE_DIRECTORY, and returns a filename of such debugging
+information if the file is found and has matching CRC32. Returns NULL
+if no reference to debugging file exists, or file cannot be found.
+
+2.14.1.20 `bfd_follow_gnu_debuglink'
+....................................
+
+*Synopsis*
+ char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
+ *Description*
+Takes a BFD and searches it for a .gnu_debuglink section. If this
+section is found, it examines the section for the name and checksum of
+a '.debug' file containing auxiliary debugging information. It then
+searches the filesystem for this .debug file in some standard
+locations, including the directory tree rooted at DIR, and if found
+returns the full filename.
+
+ If DIR is NULL, it will search a default path configured into libbfd
+at build time. [XXX this feature is not currently implemented].
+
+ *Returns*
+`NULL' on any errors or failure to locate the .debug file, otherwise a
+pointer to a heap-allocated string containing the filename. The caller
+is responsible for freeing this string.
+
+2.14.1.21 `bfd_create_gnu_debuglink_section'
+............................................
+
+*Synopsis*
+ struct bfd_section *bfd_create_gnu_debuglink_section
+ (bfd *abfd, const char *filename);
+ *Description*
+Takes a BFD and adds a .gnu_debuglink section to it. The section is
+sized to be big enough to contain a link to the specified FILENAME.
+
+ *Returns*
+A pointer to the new section is returned if all is ok. Otherwise
+`NULL' is returned and bfd_error is set.
+
+2.14.1.22 `bfd_fill_in_gnu_debuglink_section'
+.............................................
+
+*Synopsis*
+ bfd_boolean bfd_fill_in_gnu_debuglink_section
+ (bfd *abfd, struct bfd_section *sect, const char *filename);
+ *Description*
+Takes a BFD and containing a .gnu_debuglink section SECT and fills in
+the contents of the section to contain a link to the specified
+FILENAME. The filename should be relative to the current directory.
+
+ *Returns*
+`TRUE' is returned if all is ok. Otherwise `FALSE' is returned and
+bfd_error is set.
+
+
+File: bfd.info, Node: Internal, Next: File Caching, Prev: Opening and Closing, Up: BFD front end
+
+2.15 Implementation details
+===========================
+
+2.15.1 Internal functions
+-------------------------
+
+*Description*
+These routines are used within BFD. They are not intended for export,
+but are documented here for completeness.
+
+2.15.1.1 `bfd_write_bigendian_4byte_int'
+........................................
+
+*Synopsis*
+ bfd_boolean bfd_write_bigendian_4byte_int (bfd *, unsigned int);
+ *Description*
+Write a 4 byte integer I to the output BFD ABFD, in big endian order
+regardless of what else is going on. This is useful in archives.
+
+2.15.1.2 `bfd_put_size'
+.......................
+
+2.15.1.3 `bfd_get_size'
+.......................
+
+*Description*
+These macros as used for reading and writing raw data in sections; each
+access (except for bytes) is vectored through the target format of the
+BFD and mangled accordingly. The mangling performs any necessary endian
+translations and removes alignment restrictions. Note that types
+accepted and returned by these macros are identical so they can be
+swapped around in macros--for example, `libaout.h' defines `GET_WORD'
+to either `bfd_get_32' or `bfd_get_64'.
+
+ In the put routines, VAL must be a `bfd_vma'. If we are on a system
+without prototypes, the caller is responsible for making sure that is
+true, with a cast if necessary. We don't cast them in the macro
+definitions because that would prevent `lint' or `gcc -Wall' from
+detecting sins such as passing a pointer. To detect calling these with
+less than a `bfd_vma', use `gcc -Wconversion' on a host with 64 bit
+`bfd_vma''s.
+
+ /* Byte swapping macros for user section data. */
+
+ #define bfd_put_8(abfd, val, ptr) \
+ ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
+ #define bfd_put_signed_8 \
+ bfd_put_8
+ #define bfd_get_8(abfd, ptr) \
+ (*(unsigned char *) (ptr) & 0xff)
+ #define bfd_get_signed_8(abfd, ptr) \
+ (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
+
+ #define bfd_put_16(abfd, val, ptr) \
+ BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
+ #define bfd_put_signed_16 \
+ bfd_put_16
+ #define bfd_get_16(abfd, ptr) \
+ BFD_SEND (abfd, bfd_getx16, (ptr))
+ #define bfd_get_signed_16(abfd, ptr) \
+ BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
+
+ #define bfd_put_32(abfd, val, ptr) \
+ BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
+ #define bfd_put_signed_32 \
+ bfd_put_32
+ #define bfd_get_32(abfd, ptr) \
+ BFD_SEND (abfd, bfd_getx32, (ptr))
+ #define bfd_get_signed_32(abfd, ptr) \
+ BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
+
+ #define bfd_put_64(abfd, val, ptr) \
+ BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
+ #define bfd_put_signed_64 \
+ bfd_put_64
+ #define bfd_get_64(abfd, ptr) \
+ BFD_SEND (abfd, bfd_getx64, (ptr))
+ #define bfd_get_signed_64(abfd, ptr) \
+ BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
+
+ #define bfd_get(bits, abfd, ptr) \
+ ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \
+ : (bits) == 16 ? bfd_get_16 (abfd, ptr) \
+ : (bits) == 32 ? bfd_get_32 (abfd, ptr) \
+ : (bits) == 64 ? bfd_get_64 (abfd, ptr) \
+ : (abort (), (bfd_vma) - 1))
+
+ #define bfd_put(bits, abfd, val, ptr) \
+ ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
+ : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
+ : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
+ : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
+ : (abort (), (void) 0))
+
+2.15.1.4 `bfd_h_put_size'
+.........................
+
+*Description*
+These macros have the same function as their `bfd_get_x' brethren,
+except that they are used for removing information for the header
+records of object files. Believe it or not, some object files keep
+their header records in big endian order and their data in little
+endian order.
+
+ /* Byte swapping macros for file header data. */
+
+ #define bfd_h_put_8(abfd, val, ptr) \
+ bfd_put_8 (abfd, val, ptr)
+ #define bfd_h_put_signed_8(abfd, val, ptr) \
+ bfd_put_8 (abfd, val, ptr)
+ #define bfd_h_get_8(abfd, ptr) \
+ bfd_get_8 (abfd, ptr)
+ #define bfd_h_get_signed_8(abfd, ptr) \
+ bfd_get_signed_8 (abfd, ptr)
+
+ #define bfd_h_put_16(abfd, val, ptr) \
+ BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
+ #define bfd_h_put_signed_16 \
+ bfd_h_put_16
+ #define bfd_h_get_16(abfd, ptr) \
+ BFD_SEND (abfd, bfd_h_getx16, (ptr))
+ #define bfd_h_get_signed_16(abfd, ptr) \
+ BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
+
+ #define bfd_h_put_32(abfd, val, ptr) \
+ BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
+ #define bfd_h_put_signed_32 \
+ bfd_h_put_32
+ #define bfd_h_get_32(abfd, ptr) \
+ BFD_SEND (abfd, bfd_h_getx32, (ptr))
+ #define bfd_h_get_signed_32(abfd, ptr) \
+ BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
+
+ #define bfd_h_put_64(abfd, val, ptr) \
+ BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
+ #define bfd_h_put_signed_64 \
+ bfd_h_put_64
+ #define bfd_h_get_64(abfd, ptr) \
+ BFD_SEND (abfd, bfd_h_getx64, (ptr))
+ #define bfd_h_get_signed_64(abfd, ptr) \
+ BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
+
+ /* Aliases for the above, which should eventually go away. */
+
+ #define H_PUT_64 bfd_h_put_64
+ #define H_PUT_32 bfd_h_put_32
+ #define H_PUT_16 bfd_h_put_16
+ #define H_PUT_8 bfd_h_put_8
+ #define H_PUT_S64 bfd_h_put_signed_64
+ #define H_PUT_S32 bfd_h_put_signed_32
+ #define H_PUT_S16 bfd_h_put_signed_16
+ #define H_PUT_S8 bfd_h_put_signed_8
+ #define H_GET_64 bfd_h_get_64
+ #define H_GET_32 bfd_h_get_32
+ #define H_GET_16 bfd_h_get_16
+ #define H_GET_8 bfd_h_get_8
+ #define H_GET_S64 bfd_h_get_signed_64
+ #define H_GET_S32 bfd_h_get_signed_32
+ #define H_GET_S16 bfd_h_get_signed_16
+ #define H_GET_S8 bfd_h_get_signed_8
+
+2.15.1.5 `bfd_log2'
+...................
+
+*Synopsis*
+ unsigned int bfd_log2 (bfd_vma x);
+ *Description*
+Return the log base 2 of the value supplied, rounded up. E.g., an X of
+1025 returns 11. A X of 0 returns 0.
+
+
+File: bfd.info, Node: File Caching, Next: Linker Functions, Prev: Internal, Up: BFD front end
+
+2.16 File caching
+=================
+
+The file caching mechanism is embedded within BFD and allows the
+application to open as many BFDs as it wants without regard to the
+underlying operating system's file descriptor limit (often as low as 20
+open files). The module in `cache.c' maintains a least recently used
+list of `BFD_CACHE_MAX_OPEN' files, and exports the name
+`bfd_cache_lookup', which runs around and makes sure that the required
+BFD is open. If not, then it chooses a file to close, closes it and
+opens the one wanted, returning its file handle.
+
+2.16.1 Caching functions
+------------------------
+
+2.16.1.1 `bfd_cache_init'
+.........................
+
+*Synopsis*
+ bfd_boolean bfd_cache_init (bfd *abfd);
+ *Description*
+Add a newly opened BFD to the cache.
+
+2.16.1.2 `bfd_cache_close'
+..........................
+
+*Synopsis*
+ bfd_boolean bfd_cache_close (bfd *abfd);
+ *Description*
+Remove the BFD ABFD from the cache. If the attached file is open, then
+close it too.
+
+ *Returns*
+`FALSE' is returned if closing the file fails, `TRUE' is returned if
+all is well.
+
+2.16.1.3 `bfd_cache_close_all'
+..............................
+
+*Synopsis*
+ bfd_boolean bfd_cache_close_all (void);
+ *Description*
+Remove all BFDs from the cache. If the attached file is open, then
+close it too.
+
+ *Returns*
+`FALSE' is returned if closing one of the file fails, `TRUE' is
+returned if all is well.
+
+2.16.1.4 `bfd_open_file'
+........................
+
+*Synopsis*
+ FILE* bfd_open_file (bfd *abfd);
+ *Description*
+Call the OS to open a file for ABFD. Return the `FILE *' (possibly
+`NULL') that results from this operation. Set up the BFD so that
+future accesses know the file is open. If the `FILE *' returned is
+`NULL', then it won't have been put in the cache, so it won't have to
+be removed from it.
+
+
+File: bfd.info, Node: Linker Functions, Next: Hash Tables, Prev: File Caching, Up: BFD front end
+
+2.17 Linker Functions
+=====================
+
+The linker uses three special entry points in the BFD target vector.
+It is not necessary to write special routines for these entry points
+when creating a new BFD back end, since generic versions are provided.
+However, writing them can speed up linking and make it use
+significantly less runtime memory.
+
+ The first routine creates a hash table used by the other routines.
+The second routine adds the symbols from an object file to the hash
+table. The third routine takes all the object files and links them
+together to create the output file. These routines are designed so
+that the linker proper does not need to know anything about the symbols
+in the object files that it is linking. The linker merely arranges the
+sections as directed by the linker script and lets BFD handle the
+details of symbols and relocs.
+
+ The second routine and third routines are passed a pointer to a
+`struct bfd_link_info' structure (defined in `bfdlink.h') which holds
+information relevant to the link, including the linker hash table
+(which was created by the first routine) and a set of callback
+functions to the linker proper.
+
+ The generic linker routines are in `linker.c', and use the header
+file `genlink.h'. As of this writing, the only back ends which have
+implemented versions of these routines are a.out (in `aoutx.h') and
+ECOFF (in `ecoff.c'). The a.out routines are used as examples
+throughout this section.
+
+* Menu:
+
+* Creating a Linker Hash Table::
+* Adding Symbols to the Hash Table::
+* Performing the Final Link::
+
+
+File: bfd.info, Node: Creating a Linker Hash Table, Next: Adding Symbols to the Hash Table, Prev: Linker Functions, Up: Linker Functions
+
+2.17.1 Creating a linker hash table
+-----------------------------------
+
+The linker routines must create a hash table, which must be derived
+from `struct bfd_link_hash_table' described in `bfdlink.c'. *Note Hash
+Tables::, for information on how to create a derived hash table. This
+entry point is called using the target vector of the linker output file.
+
+ The `_bfd_link_hash_table_create' entry point must allocate and
+initialize an instance of the desired hash table. If the back end does
+not require any additional information to be stored with the entries in
+the hash table, the entry point may simply create a `struct
+bfd_link_hash_table'. Most likely, however, some additional
+information will be needed.
+
+ For example, with each entry in the hash table the a.out linker
+keeps the index the symbol has in the final output file (this index
+number is used so that when doing a relocatable link the symbol index
+used in the output file can be quickly filled in when copying over a
+reloc). The a.out linker code defines the required structures and
+functions for a hash table derived from `struct bfd_link_hash_table'.
+The a.out linker hash table is created by the function
+`NAME(aout,link_hash_table_create)'; it simply allocates space for the
+hash table, initializes it, and returns a pointer to it.
+
+ When writing the linker routines for a new back end, you will
+generally not know exactly which fields will be required until you have
+finished. You should simply create a new hash table which defines no
+additional fields, and then simply add fields as they become necessary.
+
+
+File: bfd.info, Node: Adding Symbols to the Hash Table, Next: Performing the Final Link, Prev: Creating a Linker Hash Table, Up: Linker Functions
+
+2.17.2 Adding symbols to the hash table
+---------------------------------------
+
+The linker proper will call the `_bfd_link_add_symbols' entry point for
+each object file or archive which is to be linked (typically these are
+the files named on the command line, but some may also come from the
+linker script). The entry point is responsible for examining the file.
+For an object file, BFD must add any relevant symbol information to
+the hash table. For an archive, BFD must determine which elements of
+the archive should be used and adding them to the link.
+
+ The a.out version of this entry point is
+`NAME(aout,link_add_symbols)'.
+
+* Menu:
+
+* Differing file formats::
+* Adding symbols from an object file::
+* Adding symbols from an archive::
+
+
+File: bfd.info, Node: Differing file formats, Next: Adding symbols from an object file, Prev: Adding Symbols to the Hash Table, Up: Adding Symbols to the Hash Table
+
+2.17.2.1 Differing file formats
+...............................
+
+Normally all the files involved in a link will be of the same format,
+but it is also possible to link together different format object files,
+and the back end must support that. The `_bfd_link_add_symbols' entry
+point is called via the target vector of the file to be added. This
+has an important consequence: the function may not assume that the hash
+table is the type created by the corresponding
+`_bfd_link_hash_table_create' vector. All the `_bfd_link_add_symbols'
+function can assume about the hash table is that it is derived from
+`struct bfd_link_hash_table'.
+
+ Sometimes the `_bfd_link_add_symbols' function must store some
+information in the hash table entry to be used by the `_bfd_final_link'
+function. In such a case the output bfd xvec must be checked to make
+sure that the hash table was created by an object file of the same
+format.
+
+ The `_bfd_final_link' routine must be prepared to handle a hash
+entry without any extra information added by the
+`_bfd_link_add_symbols' function. A hash entry without extra
+information will also occur when the linker script directs the linker
+to create a symbol. Note that, regardless of how a hash table entry is
+added, all the fields will be initialized to some sort of null value by
+the hash table entry initialization function.
+
+ See `ecoff_link_add_externals' for an example of how to check the
+output bfd before saving information (in this case, the ECOFF external
+symbol debugging information) in a hash table entry.
+
+
+File: bfd.info, Node: Adding symbols from an object file, Next: Adding symbols from an archive, Prev: Differing file formats, Up: Adding Symbols to the Hash Table
+
+2.17.2.2 Adding symbols from an object file
+...........................................
+
+When the `_bfd_link_add_symbols' routine is passed an object file, it
+must add all externally visible symbols in that object file to the hash
+table. The actual work of adding the symbol to the hash table is
+normally handled by the function `_bfd_generic_link_add_one_symbol'.
+The `_bfd_link_add_symbols' routine is responsible for reading all the
+symbols from the object file and passing the correct information to
+`_bfd_generic_link_add_one_symbol'.
+
+ The `_bfd_link_add_symbols' routine should not use
+`bfd_canonicalize_symtab' to read the symbols. The point of providing
+this routine is to avoid the overhead of converting the symbols into
+generic `asymbol' structures.
+
+ `_bfd_generic_link_add_one_symbol' handles the details of combining
+common symbols, warning about multiple definitions, and so forth. It
+takes arguments which describe the symbol to add, notably symbol flags,
+a section, and an offset. The symbol flags include such things as
+`BSF_WEAK' or `BSF_INDIRECT'. The section is a section in the object
+file, or something like `bfd_und_section_ptr' for an undefined symbol
+or `bfd_com_section_ptr' for a common symbol.
+
+ If the `_bfd_final_link' routine is also going to need to read the
+symbol information, the `_bfd_link_add_symbols' routine should save it
+somewhere attached to the object file BFD. However, the information
+should only be saved if the `keep_memory' field of the `info' argument
+is TRUE, so that the `-no-keep-memory' linker switch is effective.
+
+ The a.out function which adds symbols from an object file is
+`aout_link_add_object_symbols', and most of the interesting work is in
+`aout_link_add_symbols'. The latter saves pointers to the hash tables
+entries created by `_bfd_generic_link_add_one_symbol' indexed by symbol
+number, so that the `_bfd_final_link' routine does not have to call the
+hash table lookup routine to locate the entry.
+
+
+File: bfd.info, Node: Adding symbols from an archive, Prev: Adding symbols from an object file, Up: Adding Symbols to the Hash Table
+
+2.17.2.3 Adding symbols from an archive
+.......................................
+
+When the `_bfd_link_add_symbols' routine is passed an archive, it must
+look through the symbols defined by the archive and decide which
+elements of the archive should be included in the link. For each such
+element it must call the `add_archive_element' linker callback, and it
+must add the symbols from the object file to the linker hash table.
+
+ In most cases the work of looking through the symbols in the archive
+should be done by the `_bfd_generic_link_add_archive_symbols' function.
+This function builds a hash table from the archive symbol table and
+looks through the list of undefined symbols to see which elements
+should be included. `_bfd_generic_link_add_archive_symbols' is passed
+a function to call to make the final decision about adding an archive
+element to the link and to do the actual work of adding the symbols to
+the linker hash table.
+
+ The function passed to `_bfd_generic_link_add_archive_symbols' must
+read the symbols of the archive element and decide whether the archive
+element should be included in the link. If the element is to be
+included, the `add_archive_element' linker callback routine must be
+called with the element as an argument, and the elements symbols must
+be added to the linker hash table just as though the element had itself
+been passed to the `_bfd_link_add_symbols' function.
+
+ When the a.out `_bfd_link_add_symbols' function receives an archive,
+it calls `_bfd_generic_link_add_archive_symbols' passing
+`aout_link_check_archive_element' as the function argument.
+`aout_link_check_archive_element' calls `aout_link_check_ar_symbols'.
+If the latter decides to add the element (an element is only added if
+it provides a real, non-common, definition for a previously undefined
+or common symbol) it calls the `add_archive_element' callback and then
+`aout_link_check_archive_element' calls `aout_link_add_symbols' to
+actually add the symbols to the linker hash table.
+
+ The ECOFF back end is unusual in that it does not normally call
+`_bfd_generic_link_add_archive_symbols', because ECOFF archives already
+contain a hash table of symbols. The ECOFF back end searches the
+archive itself to avoid the overhead of creating a new hash table.
+
+
+File: bfd.info, Node: Performing the Final Link, Prev: Adding Symbols to the Hash Table, Up: Linker Functions
+
+2.17.3 Performing the final link
+--------------------------------
+
+When all the input files have been processed, the linker calls the
+`_bfd_final_link' entry point of the output BFD. This routine is
+responsible for producing the final output file, which has several
+aspects. It must relocate the contents of the input sections and copy
+the data into the output sections. It must build an output symbol
+table including any local symbols from the input files and the global
+symbols from the hash table. When producing relocatable output, it must
+modify the input relocs and write them into the output file. There may
+also be object format dependent work to be done.
+
+ The linker will also call the `write_object_contents' entry point
+when the BFD is closed. The two entry points must work together in
+order to produce the correct output file.
+
+ The details of how this works are inevitably dependent upon the
+specific object file format. The a.out `_bfd_final_link' routine is
+`NAME(aout,final_link)'.
+
+* Menu:
+
+* Information provided by the linker::
+* Relocating the section contents::
+* Writing the symbol table::
+
+
+File: bfd.info, Node: Information provided by the linker, Next: Relocating the section contents, Prev: Performing the Final Link, Up: Performing the Final Link
+
+2.17.3.1 Information provided by the linker
+...........................................
+
+Before the linker calls the `_bfd_final_link' entry point, it sets up
+some data structures for the function to use.
+
+ The `input_bfds' field of the `bfd_link_info' structure will point
+to a list of all the input files included in the link. These files are
+linked through the `link_next' field of the `bfd' structure.
+
+ Each section in the output file will have a list of `link_order'
+structures attached to the `map_head.link_order' field (the
+`link_order' structure is defined in `bfdlink.h'). These structures
+describe how to create the contents of the output section in terms of
+the contents of various input sections, fill constants, and,
+eventually, other types of information. They also describe relocs that
+must be created by the BFD backend, but do not correspond to any input
+file; this is used to support -Ur, which builds constructors while
+generating a relocatable object file.
+
+
+File: bfd.info, Node: Relocating the section contents, Next: Writing the symbol table, Prev: Information provided by the linker, Up: Performing the Final Link
+
+2.17.3.2 Relocating the section contents
+........................................
+
+The `_bfd_final_link' function should look through the `link_order'
+structures attached to each section of the output file. Each
+`link_order' structure should either be handled specially, or it should
+be passed to the function `_bfd_default_link_order' which will do the
+right thing (`_bfd_default_link_order' is defined in `linker.c').
+
+ For efficiency, a `link_order' of type `bfd_indirect_link_order'
+whose associated section belongs to a BFD of the same format as the
+output BFD must be handled specially. This type of `link_order'
+describes part of an output section in terms of a section belonging to
+one of the input files. The `_bfd_final_link' function should read the
+contents of the section and any associated relocs, apply the relocs to
+the section contents, and write out the modified section contents. If
+performing a relocatable link, the relocs themselves must also be
+modified and written out.
+
+ The functions `_bfd_relocate_contents' and
+`_bfd_final_link_relocate' provide some general support for performing
+the actual relocations, notably overflow checking. Their arguments
+include information about the symbol the relocation is against and a
+`reloc_howto_type' argument which describes the relocation to perform.
+These functions are defined in `reloc.c'.
+
+ The a.out function which handles reading, relocating, and writing
+section contents is `aout_link_input_section'. The actual relocation
+is done in `aout_link_input_section_std' and
+`aout_link_input_section_ext'.
+
+
+File: bfd.info, Node: Writing the symbol table, Prev: Relocating the section contents, Up: Performing the Final Link
+
+2.17.3.3 Writing the symbol table
+.................................
+
+The `_bfd_final_link' function must gather all the symbols in the input
+files and write them out. It must also write out all the symbols in
+the global hash table. This must be controlled by the `strip' and
+`discard' fields of the `bfd_link_info' structure.
+
+ The local symbols of the input files will not have been entered into
+the linker hash table. The `_bfd_final_link' routine must consider
+each input file and include the symbols in the output file. It may be
+convenient to do this when looking through the `link_order' structures,
+or it may be done by stepping through the `input_bfds' list.
+
+ The `_bfd_final_link' routine must also traverse the global hash
+table to gather all the externally visible symbols. It is possible
+that most of the externally visible symbols may be written out when
+considering the symbols of each input file, but it is still necessary
+to traverse the hash table since the linker script may have defined
+some symbols that are not in any of the input files.
+
+ The `strip' field of the `bfd_link_info' structure controls which
+symbols are written out. The possible values are listed in
+`bfdlink.h'. If the value is `strip_some', then the `keep_hash' field
+of the `bfd_link_info' structure is a hash table of symbols to keep;
+each symbol should be looked up in this hash table, and only symbols
+which are present should be included in the output file.
+
+ If the `strip' field of the `bfd_link_info' structure permits local
+symbols to be written out, the `discard' field is used to further
+controls which local symbols are included in the output file. If the
+value is `discard_l', then all local symbols which begin with a certain
+prefix are discarded; this is controlled by the
+`bfd_is_local_label_name' entry point.
+
+ The a.out backend handles symbols by calling
+`aout_link_write_symbols' on each input BFD and then traversing the
+global hash table with the function `aout_link_write_other_symbol'. It
+builds a string table while writing out the symbols, which is written
+to the output file at the end of `NAME(aout,final_link)'.
+
+2.17.3.4 `bfd_link_split_section'
+.................................
+
+*Synopsis*
+ bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
+ *Description*
+Return nonzero if SEC should be split during a reloceatable or final
+link.
+ #define bfd_link_split_section(abfd, sec) \
+ BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
+
+2.17.3.5 `bfd_section_already_linked'
+.....................................
+
+*Synopsis*
+ void bfd_section_already_linked (bfd *abfd, asection *sec,
+ struct bfd_link_info *info);
+ *Description*
+Check if SEC has been already linked during a reloceatable or final
+link.
+ #define bfd_section_already_linked(abfd, sec, info) \
+ BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
+
+2.17.3.6 `bfd_generic_define_common_symbol'
+...........................................
+
+*Synopsis*
+ bfd_boolean bfd_generic_define_common_symbol
+ (bfd *output_bfd, struct bfd_link_info *info,
+ struct bfd_link_hash_entry *h);
+ *Description*
+Convert common symbol H into a defined symbol. Return TRUE on success
+and FALSE on failure.
+ #define bfd_define_common_symbol(output_bfd, info, h) \
+ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h))
+
+2.17.3.7 `bfd_find_version_for_sym '
+....................................
+
+*Synopsis*
+ struct bfd_elf_version_tree * bfd_find_version_for_sym
+ (struct bfd_elf_version_tree *verdefs,
+ const char *sym_name, bfd_boolean *hide);
+ *Description*
+Search an elf version script tree for symbol versioning info and export
+/ don't-export status for a given symbol. Return non-NULL on success
+and NULL on failure; also sets the output `hide' boolean parameter.
+
+
+File: bfd.info, Node: Hash Tables, Prev: Linker Functions, Up: BFD front end
+
+2.18 Hash Tables
+================
+
+BFD provides a simple set of hash table functions. Routines are
+provided to initialize a hash table, to free a hash table, to look up a
+string in a hash table and optionally create an entry for it, and to
+traverse a hash table. There is currently no routine to delete an
+string from a hash table.
+
+ The basic hash table does not permit any data to be stored with a
+string. However, a hash table is designed to present a base class from
+which other types of hash tables may be derived. These derived types
+may store additional information with the string. Hash tables were
+implemented in this way, rather than simply providing a data pointer in
+a hash table entry, because they were designed for use by the linker
+back ends. The linker may create thousands of hash table entries, and
+the overhead of allocating private data and storing and following
+pointers becomes noticeable.
+
+ The basic hash table code is in `hash.c'.
+
+* Menu:
+
+* Creating and Freeing a Hash Table::
+* Looking Up or Entering a String::
+* Traversing a Hash Table::
+* Deriving a New Hash Table Type::
+
+
+File: bfd.info, Node: Creating and Freeing a Hash Table, Next: Looking Up or Entering a String, Prev: Hash Tables, Up: Hash Tables
+
+2.18.1 Creating and freeing a hash table
+----------------------------------------
+
+To create a hash table, create an instance of a `struct bfd_hash_table'
+(defined in `bfd.h') and call `bfd_hash_table_init' (if you know
+approximately how many entries you will need, the function
+`bfd_hash_table_init_n', which takes a SIZE argument, may be used).
+`bfd_hash_table_init' returns `FALSE' if some sort of error occurs.
+
+ The function `bfd_hash_table_init' take as an argument a function to
+use to create new entries. For a basic hash table, use the function
+`bfd_hash_newfunc'. *Note Deriving a New Hash Table Type::, for why
+you would want to use a different value for this argument.
+
+ `bfd_hash_table_init' will create an objalloc which will be used to
+allocate new entries. You may allocate memory on this objalloc using
+`bfd_hash_allocate'.
+
+ Use `bfd_hash_table_free' to free up all the memory that has been
+allocated for a hash table. This will not free up the `struct
+bfd_hash_table' itself, which you must provide.
+
+ Use `bfd_hash_set_default_size' to set the default size of hash
+table to use.
+
+
+File: bfd.info, Node: Looking Up or Entering a String, Next: Traversing a Hash Table, Prev: Creating and Freeing a Hash Table, Up: Hash Tables
+
+2.18.2 Looking up or entering a string
+--------------------------------------
+
+The function `bfd_hash_lookup' is used both to look up a string in the
+hash table and to create a new entry.
+
+ If the CREATE argument is `FALSE', `bfd_hash_lookup' will look up a
+string. If the string is found, it will returns a pointer to a `struct
+bfd_hash_entry'. If the string is not found in the table
+`bfd_hash_lookup' will return `NULL'. You should not modify any of the
+fields in the returns `struct bfd_hash_entry'.
+
+ If the CREATE argument is `TRUE', the string will be entered into
+the hash table if it is not already there. Either way a pointer to a
+`struct bfd_hash_entry' will be returned, either to the existing
+structure or to a newly created one. In this case, a `NULL' return
+means that an error occurred.
+
+ If the CREATE argument is `TRUE', and a new entry is created, the
+COPY argument is used to decide whether to copy the string onto the
+hash table objalloc or not. If COPY is passed as `FALSE', you must be
+careful not to deallocate or modify the string as long as the hash table
+exists.
+
+
+File: bfd.info, Node: Traversing a Hash Table, Next: Deriving a New Hash Table Type, Prev: Looking Up or Entering a String, Up: Hash Tables
+
+2.18.3 Traversing a hash table
+------------------------------
+
+The function `bfd_hash_traverse' may be used to traverse a hash table,
+calling a function on each element. The traversal is done in a random
+order.
+
+ `bfd_hash_traverse' takes as arguments a function and a generic
+`void *' pointer. The function is called with a hash table entry (a
+`struct bfd_hash_entry *') and the generic pointer passed to
+`bfd_hash_traverse'. The function must return a `boolean' value, which
+indicates whether to continue traversing the hash table. If the
+function returns `FALSE', `bfd_hash_traverse' will stop the traversal
+and return immediately.
+
+
+File: bfd.info, Node: Deriving a New Hash Table Type, Prev: Traversing a Hash Table, Up: Hash Tables
+
+2.18.4 Deriving a new hash table type
+-------------------------------------
+
+Many uses of hash tables want to store additional information which
+each entry in the hash table. Some also find it convenient to store
+additional information with the hash table itself. This may be done
+using a derived hash table.
+
+ Since C is not an object oriented language, creating a derived hash
+table requires sticking together some boilerplate routines with a few
+differences specific to the type of hash table you want to create.
+
+ An example of a derived hash table is the linker hash table. The
+structures for this are defined in `bfdlink.h'. The functions are in
+`linker.c'.
+
+ You may also derive a hash table from an already derived hash table.
+For example, the a.out linker backend code uses a hash table derived
+from the linker hash table.
+
+* Menu:
+
+* Define the Derived Structures::
+* Write the Derived Creation Routine::
+* Write Other Derived Routines::
+
+
+File: bfd.info, Node: Define the Derived Structures, Next: Write the Derived Creation Routine, Prev: Deriving a New Hash Table Type, Up: Deriving a New Hash Table Type
+
+2.18.4.1 Define the derived structures
+......................................
+
+You must define a structure for an entry in the hash table, and a
+structure for the hash table itself.
+
+ The first field in the structure for an entry in the hash table must
+be of the type used for an entry in the hash table you are deriving
+from. If you are deriving from a basic hash table this is `struct
+bfd_hash_entry', which is defined in `bfd.h'. The first field in the
+structure for the hash table itself must be of the type of the hash
+table you are deriving from itself. If you are deriving from a basic
+hash table, this is `struct bfd_hash_table'.
+
+ For example, the linker hash table defines `struct
+bfd_link_hash_entry' (in `bfdlink.h'). The first field, `root', is of
+type `struct bfd_hash_entry'. Similarly, the first field in `struct
+bfd_link_hash_table', `table', is of type `struct bfd_hash_table'.
+
+
+File: bfd.info, Node: Write the Derived Creation Routine, Next: Write Other Derived Routines, Prev: Define the Derived Structures, Up: Deriving a New Hash Table Type
+
+2.18.4.2 Write the derived creation routine
+...........................................
+
+You must write a routine which will create and initialize an entry in
+the hash table. This routine is passed as the function argument to
+`bfd_hash_table_init'.
+
+ In order to permit other hash tables to be derived from the hash
+table you are creating, this routine must be written in a standard way.
+
+ The first argument to the creation routine is a pointer to a hash
+table entry. This may be `NULL', in which case the routine should
+allocate the right amount of space. Otherwise the space has already
+been allocated by a hash table type derived from this one.
+
+ After allocating space, the creation routine must call the creation
+routine of the hash table type it is derived from, passing in a pointer
+to the space it just allocated. This will initialize any fields used
+by the base hash table.
+
+ Finally the creation routine must initialize any local fields for
+the new hash table type.
+
+ Here is a boilerplate example of a creation routine. FUNCTION_NAME
+is the name of the routine. ENTRY_TYPE is the type of an entry in the
+hash table you are creating. BASE_NEWFUNC is the name of the creation
+routine of the hash table type your hash table is derived from.
+
+ struct bfd_hash_entry *
+ FUNCTION_NAME (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *table,
+ const char *string)
+ {
+ struct ENTRY_TYPE *ret = (ENTRY_TYPE *) entry;
+
+ /* Allocate the structure if it has not already been allocated by a
+ derived class. */
+ if (ret == NULL)
+ {
+ ret = bfd_hash_allocate (table, sizeof (* ret));
+ if (ret == NULL)
+ return NULL;
+ }
+
+ /* Call the allocation method of the base class. */
+ ret = ((ENTRY_TYPE *)
+ BASE_NEWFUNC ((struct bfd_hash_entry *) ret, table, string));
+
+ /* Initialize the local fields here. */
+
+ return (struct bfd_hash_entry *) ret;
+ }
+ *Description*
+The creation routine for the linker hash table, which is in `linker.c',
+looks just like this example. FUNCTION_NAME is
+`_bfd_link_hash_newfunc'. ENTRY_TYPE is `struct bfd_link_hash_entry'.
+BASE_NEWFUNC is `bfd_hash_newfunc', the creation routine for a basic
+hash table.
+
+ `_bfd_link_hash_newfunc' also initializes the local fields in a
+linker hash table entry: `type', `written' and `next'.
+
+
+File: bfd.info, Node: Write Other Derived Routines, Prev: Write the Derived Creation Routine, Up: Deriving a New Hash Table Type
+
+2.18.4.3 Write other derived routines
+.....................................
+
+You will want to write other routines for your new hash table, as well.
+
+ You will want an initialization routine which calls the
+initialization routine of the hash table you are deriving from and
+initializes any other local fields. For the linker hash table, this is
+`_bfd_link_hash_table_init' in `linker.c'.
+
+ You will want a lookup routine which calls the lookup routine of the
+hash table you are deriving from and casts the result. The linker hash
+table uses `bfd_link_hash_lookup' in `linker.c' (this actually takes an
+additional argument which it uses to decide how to return the looked up
+value).
+
+ You may want a traversal routine. This should just call the
+traversal routine of the hash table you are deriving from with
+appropriate casts. The linker hash table uses `bfd_link_hash_traverse'
+in `linker.c'.
+
+ These routines may simply be defined as macros. For example, the
+a.out backend linker hash table, which is derived from the linker hash
+table, uses macros for the lookup and traversal routines. These are
+`aout_link_hash_lookup' and `aout_link_hash_traverse' in aoutx.h.
+
+
+File: bfd.info, Node: BFD back ends, Next: GNU Free Documentation License, Prev: BFD front end, Up: Top
+
+3 BFD back ends
+***************
+
+* Menu:
+
+* What to Put Where::
+* aout :: a.out backends
+* coff :: coff backends
+* elf :: elf backends
+* mmo :: mmo backend
+
+
+File: bfd.info, Node: What to Put Where, Next: aout, Prev: BFD back ends, Up: BFD back ends
+
+3.1 What to Put Where
+=====================
+
+All of BFD lives in one directory.
+
+
+File: bfd.info, Node: aout, Next: coff, Prev: What to Put Where, Up: BFD back ends
+
+3.2 a.out backends
+==================
+
+*Description*
+BFD supports a number of different flavours of a.out format, though the
+major differences are only the sizes of the structures on disk, and the
+shape of the relocation information.
+
+ The support is split into a basic support file `aoutx.h' and other
+files which derive functions from the base. One derivation file is
+`aoutf1.h' (for a.out flavour 1), and adds to the basic a.out functions
+support for sun3, sun4, 386 and 29k a.out files, to create a target
+jump vector for a specific target.
+
+ This information is further split out into more specific files for
+each machine, including `sunos.c' for sun3 and sun4, `newsos3.c' for
+the Sony NEWS, and `demo64.c' for a demonstration of a 64 bit a.out
+format.
+
+ The base file `aoutx.h' defines general mechanisms for reading and
+writing records to and from disk and various other methods which BFD
+requires. It is included by `aout32.c' and `aout64.c' to form the names
+`aout_32_swap_exec_header_in', `aout_64_swap_exec_header_in', etc.
+
+ As an example, this is what goes on to make the back end for a sun4,
+from `aout32.c':
+
+ #define ARCH_SIZE 32
+ #include "aoutx.h"
+
+ Which exports names:
+
+ ...
+ aout_32_canonicalize_reloc
+ aout_32_find_nearest_line
+ aout_32_get_lineno
+ aout_32_get_reloc_upper_bound
+ ...
+
+ from `sunos.c':
+
+ #define TARGET_NAME "a.out-sunos-big"
+ #define VECNAME sunos_big_vec
+ #include "aoutf1.h"
+
+ requires all the names from `aout32.c', and produces the jump vector
+
+ sunos_big_vec
+
+ The file `host-aout.c' is a special case. It is for a large set of
+hosts that use "more or less standard" a.out files, and for which
+cross-debugging is not interesting. It uses the standard 32-bit a.out
+support routines, but determines the file offsets and addresses of the
+text, data, and BSS sections, the machine architecture and machine
+type, and the entry point address, in a host-dependent manner. Once
+these values have been determined, generic code is used to handle the
+object file.
+
+ When porting it to run on a new system, you must supply:
+
+ HOST_PAGE_SIZE
+ HOST_SEGMENT_SIZE
+ HOST_MACHINE_ARCH (optional)
+ HOST_MACHINE_MACHINE (optional)
+ HOST_TEXT_START_ADDR
+ HOST_STACK_END_ADDR
+
+ in the file `../include/sys/h-XXX.h' (for your host). These values,
+plus the structures and macros defined in `a.out.h' on your host
+system, will produce a BFD target that will access ordinary a.out files
+on your host. To configure a new machine to use `host-aout.c', specify:
+
+ TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec
+ TDEPFILES= host-aout.o trad-core.o
+
+ in the `config/XXX.mt' file, and modify `configure.in' to use the
+`XXX.mt' file (by setting "`bfd_target=XXX'") when your configuration
+is selected.
+
+3.2.1 Relocations
+-----------------
+
+*Description*
+The file `aoutx.h' provides for both the _standard_ and _extended_
+forms of a.out relocation records.
+
+ The standard records contain only an address, a symbol index, and a
+type field. The extended records (used on 29ks and sparcs) also have a
+full integer for an addend.
+
+3.2.2 Internal entry points
+---------------------------
+
+*Description*
+`aoutx.h' exports several routines for accessing the contents of an
+a.out file, which are gathered and exported in turn by various format
+specific files (eg sunos.c).
+
+3.2.2.1 `aout_SIZE_swap_exec_header_in'
+.......................................
+
+*Synopsis*
+ void aout_SIZE_swap_exec_header_in,
+ (bfd *abfd,
+ struct external_exec *bytes,
+ struct internal_exec *execp);
+ *Description*
+Swap the information in an executable header RAW_BYTES taken from a raw
+byte stream memory image into the internal exec header structure EXECP.
+
+3.2.2.2 `aout_SIZE_swap_exec_header_out'
+........................................
+
+*Synopsis*
+ void aout_SIZE_swap_exec_header_out
+ (bfd *abfd,
+ struct internal_exec *execp,
+ struct external_exec *raw_bytes);
+ *Description*
+Swap the information in an internal exec header structure EXECP into
+the buffer RAW_BYTES ready for writing to disk.
+
+3.2.2.3 `aout_SIZE_some_aout_object_p'
+......................................
+
+*Synopsis*
+ const bfd_target *aout_SIZE_some_aout_object_p
+ (bfd *abfd,
+ struct internal_exec *execp,
+ const bfd_target *(*callback_to_real_object_p) (bfd *));
+ *Description*
+Some a.out variant thinks that the file open in ABFD checking is an
+a.out file. Do some more checking, and set up for access if it really
+is. Call back to the calling environment's "finish up" function just
+before returning, to handle any last-minute setup.
+
+3.2.2.4 `aout_SIZE_mkobject'
+............................
+
+*Synopsis*
+ bfd_boolean aout_SIZE_mkobject, (bfd *abfd);
+ *Description*
+Initialize BFD ABFD for use with a.out files.
+
+3.2.2.5 `aout_SIZE_machine_type'
+................................
+
+*Synopsis*
+ enum machine_type aout_SIZE_machine_type
+ (enum bfd_architecture arch,
+ unsigned long machine,
+ bfd_boolean *unknown);
+ *Description*
+Keep track of machine architecture and machine type for a.out's. Return
+the `machine_type' for a particular architecture and machine, or
+`M_UNKNOWN' if that exact architecture and machine can't be represented
+in a.out format.
+
+ If the architecture is understood, machine type 0 (default) is
+always understood.
+
+3.2.2.6 `aout_SIZE_set_arch_mach'
+.................................
+
+*Synopsis*
+ bfd_boolean aout_SIZE_set_arch_mach,
+ (bfd *,
+ enum bfd_architecture arch,
+ unsigned long machine);
+ *Description*
+Set the architecture and the machine of the BFD ABFD to the values ARCH
+and MACHINE. Verify that ABFD's format can support the architecture
+required.
+
+3.2.2.7 `aout_SIZE_new_section_hook'
+....................................
+
+*Synopsis*
+ bfd_boolean aout_SIZE_new_section_hook,
+ (bfd *abfd,
+ asection *newsect);
+ *Description*
+Called by the BFD in response to a `bfd_make_section' request.
+
+
+File: bfd.info, Node: coff, Next: elf, Prev: aout, Up: BFD back ends
+
+3.3 coff backends
+=================
+
+BFD supports a number of different flavours of coff format. The major
+differences between formats are the sizes and alignments of fields in
+structures on disk, and the occasional extra field.
+
+ Coff in all its varieties is implemented with a few common files and
+a number of implementation specific files. For example, The 88k bcs
+coff format is implemented in the file `coff-m88k.c'. This file
+`#include's `coff/m88k.h' which defines the external structure of the
+coff format for the 88k, and `coff/internal.h' which defines the
+internal structure. `coff-m88k.c' also defines the relocations used by
+the 88k format *Note Relocations::.
+
+ The Intel i960 processor version of coff is implemented in
+`coff-i960.c'. This file has the same structure as `coff-m88k.c',
+except that it includes `coff/i960.h' rather than `coff-m88k.h'.
+
+3.3.1 Porting to a new version of coff
+--------------------------------------
+
+The recommended method is to select from the existing implementations
+the version of coff which is most like the one you want to use. For
+example, we'll say that i386 coff is the one you select, and that your
+coff flavour is called foo. Copy `i386coff.c' to `foocoff.c', copy
+`../include/coff/i386.h' to `../include/coff/foo.h', and add the lines
+to `targets.c' and `Makefile.in' so that your new back end is used.
+Alter the shapes of the structures in `../include/coff/foo.h' so that
+they match what you need. You will probably also have to add `#ifdef's
+to the code in `coff/internal.h' and `coffcode.h' if your version of
+coff is too wild.
+
+ You can verify that your new BFD backend works quite simply by
+building `objdump' from the `binutils' directory, and making sure that
+its version of what's going on and your host system's idea (assuming it
+has the pretty standard coff dump utility, usually called `att-dump' or
+just `dump') are the same. Then clean up your code, and send what
+you've done to Cygnus. Then your stuff will be in the next release, and
+you won't have to keep integrating it.
+
+3.3.2 How the coff backend works
+--------------------------------
+
+3.3.2.1 File layout
+...................
+
+The Coff backend is split into generic routines that are applicable to
+any Coff target and routines that are specific to a particular target.
+The target-specific routines are further split into ones which are
+basically the same for all Coff targets except that they use the
+external symbol format or use different values for certain constants.
+
+ The generic routines are in `coffgen.c'. These routines work for
+any Coff target. They use some hooks into the target specific code;
+the hooks are in a `bfd_coff_backend_data' structure, one of which
+exists for each target.
+
+ The essentially similar target-specific routines are in
+`coffcode.h'. This header file includes executable C code. The
+various Coff targets first include the appropriate Coff header file,
+make any special defines that are needed, and then include `coffcode.h'.
+
+ Some of the Coff targets then also have additional routines in the
+target source file itself.
+
+ For example, `coff-i960.c' includes `coff/internal.h' and
+`coff/i960.h'. It then defines a few constants, such as `I960', and
+includes `coffcode.h'. Since the i960 has complex relocation types,
+`coff-i960.c' also includes some code to manipulate the i960 relocs.
+This code is not in `coffcode.h' because it would not be used by any
+other target.
+
+3.3.2.2 Coff long section names
+...............................
+
+In the standard Coff object format, section names are limited to the
+eight bytes available in the `s_name' field of the `SCNHDR' section
+header structure. The format requires the field to be NUL-padded, but
+not necessarily NUL-terminated, so the longest section names permitted
+are a full eight characters.
+
+ The Microsoft PE variants of the Coff object file format add an
+extension to support the use of long section names. This extension is
+defined in section 4 of the Microsoft PE/COFF specification (rev 8.1).
+If a section name is too long to fit into the section header's `s_name'
+field, it is instead placed into the string table, and the `s_name'
+field is filled with a slash ("/") followed by the ASCII decimal
+representation of the offset of the full name relative to the string
+table base.
+
+ Note that this implies that the extension can only be used in object
+files, as executables do not contain a string table. The standard
+specifies that long section names from objects emitted into executable
+images are to be truncated.
+
+ However, as a GNU extension, BFD can generate executable images that
+contain a string table and long section names. This would appear to be
+technically valid, as the standard only says that Coff debugging
+information is deprecated, not forbidden, and in practice it works,
+although some tools that parse PE files expecting the MS standard
+format may become confused; `PEview' is one known example.
+
+ The functionality is supported in BFD by code implemented under the
+control of the macro `COFF_LONG_SECTION_NAMES'. If not defined, the
+format does not support long section names in any way. If defined, it
+is used to initialise a flag, `_bfd_coff_long_section_names', and a
+hook function pointer, `_bfd_coff_set_long_section_names', in the Coff
+backend data structure. The flag controls the generation of long
+section names in output BFDs at runtime; if it is false, as it will be
+by default when generating an executable image, long section names are
+truncated; if true, the long section names extension is employed. The
+hook points to a function that allows the value of the flag to be
+altered at runtime, on formats that support long section names at all;
+on other formats it points to a stub that returns an error indication.
+With input BFDs, the flag is set according to whether any long section
+names are detected while reading the section headers. For a completely
+new BFD, the flag is set to the default for the target format. This
+information can be used by a client of the BFD library when deciding
+what output format to generate, and means that a BFD that is opened for
+read and subsequently converted to a writeable BFD and modified
+in-place will retain whatever format it had on input.
+
+ If `COFF_LONG_SECTION_NAMES' is simply defined (blank), or is
+defined to the value "1", then long section names are enabled by
+default; if it is defined to the value zero, they are disabled by
+default (but still accepted in input BFDs). The header `coffcode.h'
+defines a macro, `COFF_DEFAULT_LONG_SECTION_NAMES', which is used in
+the backends to initialise the backend data structure fields
+appropriately; see the comments for further detail.
+
+3.3.2.3 Bit twiddling
+.....................
+
+Each flavour of coff supported in BFD has its own header file
+describing the external layout of the structures. There is also an
+internal description of the coff layout, in `coff/internal.h'. A major
+function of the coff backend is swapping the bytes and twiddling the
+bits to translate the external form of the structures into the normal
+internal form. This is all performed in the `bfd_swap'_thing_direction
+routines. Some elements are different sizes between different versions
+of coff; it is the duty of the coff version specific include file to
+override the definitions of various packing routines in `coffcode.h'.
+E.g., the size of line number entry in coff is sometimes 16 bits, and
+sometimes 32 bits. `#define'ing `PUT_LNSZ_LNNO' and `GET_LNSZ_LNNO'
+will select the correct one. No doubt, some day someone will find a
+version of coff which has a varying field size not catered to at the
+moment. To port BFD, that person will have to add more `#defines'.
+Three of the bit twiddling routines are exported to `gdb';
+`coff_swap_aux_in', `coff_swap_sym_in' and `coff_swap_lineno_in'. `GDB'
+reads the symbol table on its own, but uses BFD to fix things up. More
+of the bit twiddlers are exported for `gas'; `coff_swap_aux_out',
+`coff_swap_sym_out', `coff_swap_lineno_out', `coff_swap_reloc_out',
+`coff_swap_filehdr_out', `coff_swap_aouthdr_out',
+`coff_swap_scnhdr_out'. `Gas' currently keeps track of all the symbol
+table and reloc drudgery itself, thereby saving the internal BFD
+overhead, but uses BFD to swap things on the way out, making cross
+ports much safer. Doing so also allows BFD (and thus the linker) to
+use the same header files as `gas', which makes one avenue to disaster
+disappear.
+
+3.3.2.4 Symbol reading
+......................
+
+The simple canonical form for symbols used by BFD is not rich enough to
+keep all the information available in a coff symbol table. The back end
+gets around this problem by keeping the original symbol table around,
+"behind the scenes".
+
+ When a symbol table is requested (through a call to
+`bfd_canonicalize_symtab'), a request gets through to
+`coff_get_normalized_symtab'. This reads the symbol table from the coff
+file and swaps all the structures inside into the internal form. It
+also fixes up all the pointers in the table (represented in the file by
+offsets from the first symbol in the table) into physical pointers to
+elements in the new internal table. This involves some work since the
+meanings of fields change depending upon context: a field that is a
+pointer to another structure in the symbol table at one moment may be
+the size in bytes of a structure at the next. Another pass is made
+over the table. All symbols which mark file names (`C_FILE' symbols)
+are modified so that the internal string points to the value in the
+auxent (the real filename) rather than the normal text associated with
+the symbol (`".file"').
+
+ At this time the symbol names are moved around. Coff stores all
+symbols less than nine characters long physically within the symbol
+table; longer strings are kept at the end of the file in the string
+table. This pass moves all strings into memory and replaces them with
+pointers to the strings.
+
+ The symbol table is massaged once again, this time to create the
+canonical table used by the BFD application. Each symbol is inspected
+in turn, and a decision made (using the `sclass' field) about the
+various flags to set in the `asymbol'. *Note Symbols::. The generated
+canonical table shares strings with the hidden internal symbol table.
+
+ Any linenumbers are read from the coff file too, and attached to the
+symbols which own the functions the linenumbers belong to.
+
+3.3.2.5 Symbol writing
+......................
+
+Writing a symbol to a coff file which didn't come from a coff file will
+lose any debugging information. The `asymbol' structure remembers the
+BFD from which the symbol was taken, and on output the back end makes
+sure that the same destination target as source target is present.
+
+ When the symbols have come from a coff file then all the debugging
+information is preserved.
+
+ Symbol tables are provided for writing to the back end in a vector
+of pointers to pointers. This allows applications like the linker to
+accumulate and output large symbol tables without having to do too much
+byte copying.
+
+ This function runs through the provided symbol table and patches
+each symbol marked as a file place holder (`C_FILE') to point to the
+next file place holder in the list. It also marks each `offset' field
+in the list with the offset from the first symbol of the current symbol.
+
+ Another function of this procedure is to turn the canonical value
+form of BFD into the form used by coff. Internally, BFD expects symbol
+values to be offsets from a section base; so a symbol physically at
+0x120, but in a section starting at 0x100, would have the value 0x20.
+Coff expects symbols to contain their final value, so symbols have
+their values changed at this point to reflect their sum with their
+owning section. This transformation uses the `output_section' field of
+the `asymbol''s `asection' *Note Sections::.
+
+ * `coff_mangle_symbols'
+ This routine runs though the provided symbol table and uses the
+offsets generated by the previous pass and the pointers generated when
+the symbol table was read in to create the structured hierarchy
+required by coff. It changes each pointer to a symbol into the index
+into the symbol table of the asymbol.
+
+ * `coff_write_symbols'
+ This routine runs through the symbol table and patches up the
+symbols from their internal form into the coff way, calls the bit
+twiddlers, and writes out the table to the file.
+
+3.3.2.6 `coff_symbol_type'
+..........................
+
+*Description*
+The hidden information for an `asymbol' is described in a
+`combined_entry_type':
+
+
+ typedef struct coff_ptr_struct
+ {
+ /* Remembers the offset from the first symbol in the file for
+ this symbol. Generated by coff_renumber_symbols. */
+ unsigned int offset;
+
+ /* Should the value of this symbol be renumbered. Used for
+ XCOFF C_BSTAT symbols. Set by coff_slurp_symbol_table. */
+ unsigned int fix_value : 1;
+
+ /* Should the tag field of this symbol be renumbered.
+ Created by coff_pointerize_aux. */
+ unsigned int fix_tag : 1;
+
+ /* Should the endidx field of this symbol be renumbered.
+ Created by coff_pointerize_aux. */
+ unsigned int fix_end : 1;
+
+ /* Should the x_csect.x_scnlen field be renumbered.
+ Created by coff_pointerize_aux. */
+ unsigned int fix_scnlen : 1;
+
+ /* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the
+ index into the line number entries. Set by coff_slurp_symbol_table. */
+ unsigned int fix_line : 1;
+
+ /* The container for the symbol structure as read and translated
+ from the file. */
+ union
+ {
+ union internal_auxent auxent;
+ struct internal_syment syment;
+ } u;
+ } combined_entry_type;
+
+
+ /* Each canonical asymbol really looks like this: */
+
+ typedef struct coff_symbol_struct
+ {
+ /* The actual symbol which the rest of BFD works with */
+ asymbol symbol;
+
+ /* A pointer to the hidden information for this symbol */
+ combined_entry_type *native;
+
+ /* A pointer to the linenumber information for this symbol */
+ struct lineno_cache_entry *lineno;
+
+ /* Have the line numbers been relocated yet ? */
+ bfd_boolean done_lineno;
+ } coff_symbol_type;
+
+3.3.2.7 `bfd_coff_backend_data'
+...............................
+
+ /* COFF symbol classifications. */
+
+ enum coff_symbol_classification
+ {
+ /* Global symbol. */
+ COFF_SYMBOL_GLOBAL,
+ /* Common symbol. */
+ COFF_SYMBOL_COMMON,
+ /* Undefined symbol. */
+ COFF_SYMBOL_UNDEFINED,
+ /* Local symbol. */
+ COFF_SYMBOL_LOCAL,
+ /* PE section symbol. */
+ COFF_SYMBOL_PE_SECTION
+ };
+Special entry points for gdb to swap in coff symbol table parts:
+ typedef struct
+ {
+ void (*_bfd_coff_swap_aux_in)
+ (bfd *, void *, int, int, int, int, void *);
+
+ void (*_bfd_coff_swap_sym_in)
+ (bfd *, void *, void *);
+
+ void (*_bfd_coff_swap_lineno_in)
+ (bfd *, void *, void *);
+
+ unsigned int (*_bfd_coff_swap_aux_out)
+ (bfd *, void *, int, int, int, int, void *);
+
+ unsigned int (*_bfd_coff_swap_sym_out)
+ (bfd *, void *, void *);
+
+ unsigned int (*_bfd_coff_swap_lineno_out)
+ (bfd *, void *, void *);
+
+ unsigned int (*_bfd_coff_swap_reloc_out)
+ (bfd *, void *, void *);
+
+ unsigned int (*_bfd_coff_swap_filehdr_out)
+ (bfd *, void *, void *);
+
+ unsigned int (*_bfd_coff_swap_aouthdr_out)
+ (bfd *, void *, void *);
+
+ unsigned int (*_bfd_coff_swap_scnhdr_out)
+ (bfd *, void *, void *);
+
+ unsigned int _bfd_filhsz;
+ unsigned int _bfd_aoutsz;
+ unsigned int _bfd_scnhsz;
+ unsigned int _bfd_symesz;
+ unsigned int _bfd_auxesz;
+ unsigned int _bfd_relsz;
+ unsigned int _bfd_linesz;
+ unsigned int _bfd_filnmlen;
+ bfd_boolean _bfd_coff_long_filenames;
+
+ bfd_boolean _bfd_coff_long_section_names;
+ bfd_boolean (*_bfd_coff_set_long_section_names)
+ (bfd *, int);
+
+ unsigned int _bfd_coff_default_section_alignment_power;
+ bfd_boolean _bfd_coff_force_symnames_in_strings;
+ unsigned int _bfd_coff_debug_string_prefix_length;
+
+ void (*_bfd_coff_swap_filehdr_in)
+ (bfd *, void *, void *);
+
+ void (*_bfd_coff_swap_aouthdr_in)
+ (bfd *, void *, void *);
+
+ void (*_bfd_coff_swap_scnhdr_in)
+ (bfd *, void *, void *);
+
+ void (*_bfd_coff_swap_reloc_in)
+ (bfd *abfd, void *, void *);
+
+ bfd_boolean (*_bfd_coff_bad_format_hook)
+ (bfd *, void *);
+
+ bfd_boolean (*_bfd_coff_set_arch_mach_hook)
+ (bfd *, void *);
+
+ void * (*_bfd_coff_mkobject_hook)
+ (bfd *, void *, void *);
+
+ bfd_boolean (*_bfd_styp_to_sec_flags_hook)
+ (bfd *, void *, const char *, asection *, flagword *);
+
+ void (*_bfd_set_alignment_hook)
+ (bfd *, asection *, void *);
+
+ bfd_boolean (*_bfd_coff_slurp_symbol_table)
+ (bfd *);
+
+ bfd_boolean (*_bfd_coff_symname_in_debug)
+ (bfd *, struct internal_syment *);
+
+ bfd_boolean (*_bfd_coff_pointerize_aux_hook)
+ (bfd *, combined_entry_type *, combined_entry_type *,
+ unsigned int, combined_entry_type *);
+
+ bfd_boolean (*_bfd_coff_print_aux)
+ (bfd *, FILE *, combined_entry_type *, combined_entry_type *,
+ combined_entry_type *, unsigned int);
+
+ void (*_bfd_coff_reloc16_extra_cases)
+ (bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *,
+ bfd_byte *, unsigned int *, unsigned int *);
+
+ int (*_bfd_coff_reloc16_estimate)
+ (bfd *, asection *, arelent *, unsigned int,
+ struct bfd_link_info *);
+
+ enum coff_symbol_classification (*_bfd_coff_classify_symbol)
+ (bfd *, struct internal_syment *);
+
+ bfd_boolean (*_bfd_coff_compute_section_file_positions)
+ (bfd *);
+
+ bfd_boolean (*_bfd_coff_start_final_link)
+ (bfd *, struct bfd_link_info *);
+
+ bfd_boolean (*_bfd_coff_relocate_section)
+ (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
+ struct internal_reloc *, struct internal_syment *, asection **);
+
+ reloc_howto_type *(*_bfd_coff_rtype_to_howto)
+ (bfd *, asection *, struct internal_reloc *,
+ struct coff_link_hash_entry *, struct internal_syment *,
+ bfd_vma *);
+
+ bfd_boolean (*_bfd_coff_adjust_symndx)
+ (bfd *, struct bfd_link_info *, bfd *, asection *,
+ struct internal_reloc *, bfd_boolean *);
+
+ bfd_boolean (*_bfd_coff_link_add_one_symbol)
+ (struct bfd_link_info *, bfd *, const char *, flagword,
+ asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean,
+ struct bfd_link_hash_entry **);
+
+ bfd_boolean (*_bfd_coff_link_output_has_begun)
+ (bfd *, struct coff_final_link_info *);
+
+ bfd_boolean (*_bfd_coff_final_link_postscript)
+ (bfd *, struct coff_final_link_info *);
+
+ bfd_boolean (*_bfd_coff_print_pdata)
+ (bfd *, void *);
+
+ } bfd_coff_backend_data;
+
+ #define coff_backend_info(abfd) \
+ ((bfd_coff_backend_data *) (abfd)->xvec->backend_data)
+
+ #define bfd_coff_swap_aux_in(a,e,t,c,ind,num,i) \
+ ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i))
+
+ #define bfd_coff_swap_sym_in(a,e,i) \
+ ((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i))
+
+ #define bfd_coff_swap_lineno_in(a,e,i) \
+ ((coff_backend_info ( a)->_bfd_coff_swap_lineno_in) (a,e,i))
+
+ #define bfd_coff_swap_reloc_out(abfd, i, o) \
+ ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_out) (abfd, i, o))
+
+ #define bfd_coff_swap_lineno_out(abfd, i, o) \
+ ((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o))
+
+ #define bfd_coff_swap_aux_out(a,i,t,c,ind,num,o) \
+ ((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o))
+
+ #define bfd_coff_swap_sym_out(abfd, i,o) \
+ ((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o))
+
+ #define bfd_coff_swap_scnhdr_out(abfd, i,o) \
+ ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_out) (abfd, i, o))
+
+ #define bfd_coff_swap_filehdr_out(abfd, i,o) \
+ ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_out) (abfd, i, o))
+
+ #define bfd_coff_swap_aouthdr_out(abfd, i,o) \
+ ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_out) (abfd, i, o))
+
+ #define bfd_coff_filhsz(abfd) (coff_backend_info (abfd)->_bfd_filhsz)
+ #define bfd_coff_aoutsz(abfd) (coff_backend_info (abfd)->_bfd_aoutsz)
+ #define bfd_coff_scnhsz(abfd) (coff_backend_info (abfd)->_bfd_scnhsz)
+ #define bfd_coff_symesz(abfd) (coff_backend_info (abfd)->_bfd_symesz)
+ #define bfd_coff_auxesz(abfd) (coff_backend_info (abfd)->_bfd_auxesz)
+ #define bfd_coff_relsz(abfd) (coff_backend_info (abfd)->_bfd_relsz)
+ #define bfd_coff_linesz(abfd) (coff_backend_info (abfd)->_bfd_linesz)
+ #define bfd_coff_filnmlen(abfd) (coff_backend_info (abfd)->_bfd_filnmlen)
+ #define bfd_coff_long_filenames(abfd) \
+ (coff_backend_info (abfd)->_bfd_coff_long_filenames)
+ #define bfd_coff_long_section_names(abfd) \
+ (coff_backend_info (abfd)->_bfd_coff_long_section_names)
+ #define bfd_coff_set_long_section_names(abfd, enable) \
+ ((coff_backend_info (abfd)->_bfd_coff_set_long_section_names) (abfd, enable))
+ #define bfd_coff_default_section_alignment_power(abfd) \
+ (coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power)
+ #define bfd_coff_swap_filehdr_in(abfd, i,o) \
+ ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o))
+
+ #define bfd_coff_swap_aouthdr_in(abfd, i,o) \
+ ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_in) (abfd, i, o))
+
+ #define bfd_coff_swap_scnhdr_in(abfd, i,o) \
+ ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_in) (abfd, i, o))
+
+ #define bfd_coff_swap_reloc_in(abfd, i, o) \
+ ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_in) (abfd, i, o))
+
+ #define bfd_coff_bad_format_hook(abfd, filehdr) \
+ ((coff_backend_info (abfd)->_bfd_coff_bad_format_hook) (abfd, filehdr))
+
+ #define bfd_coff_set_arch_mach_hook(abfd, filehdr)\
+ ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr))
+ #define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\
+ ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook)\
+ (abfd, filehdr, aouthdr))
+
+ #define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section, flags_ptr)\
+ ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\
+ (abfd, scnhdr, name, section, flags_ptr))
+
+ #define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\
+ ((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr))
+
+ #define bfd_coff_slurp_symbol_table(abfd)\
+ ((coff_backend_info (abfd)->_bfd_coff_slurp_symbol_table) (abfd))
+
+ #define bfd_coff_symname_in_debug(abfd, sym)\
+ ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym))
+
+ #define bfd_coff_force_symnames_in_strings(abfd)\
+ (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings)
+
+ #define bfd_coff_debug_string_prefix_length(abfd)\
+ (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length)
+
+ #define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\
+ ((coff_backend_info (abfd)->_bfd_coff_print_aux)\
+ (abfd, file, base, symbol, aux, indaux))
+
+ #define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order,\
+ reloc, data, src_ptr, dst_ptr)\
+ ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\
+ (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr))
+
+ #define bfd_coff_reloc16_estimate(abfd, section, reloc, shrink, link_info)\
+ ((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\
+ (abfd, section, reloc, shrink, link_info))
+
+ #define bfd_coff_classify_symbol(abfd, sym)\
+ ((coff_backend_info (abfd)->_bfd_coff_classify_symbol)\
+ (abfd, sym))
+
+ #define bfd_coff_compute_section_file_positions(abfd)\
+ ((coff_backend_info (abfd)->_bfd_coff_compute_section_file_positions)\
+ (abfd))
+
+ #define bfd_coff_start_final_link(obfd, info)\
+ ((coff_backend_info (obfd)->_bfd_coff_start_final_link)\
+ (obfd, info))
+ #define bfd_coff_relocate_section(obfd,info,ibfd,o,con,rel,isyms,secs)\
+ ((coff_backend_info (ibfd)->_bfd_coff_relocate_section)\
+ (obfd, info, ibfd, o, con, rel, isyms, secs))
+ #define bfd_coff_rtype_to_howto(abfd, sec, rel, h, sym, addendp)\
+ ((coff_backend_info (abfd)->_bfd_coff_rtype_to_howto)\
+ (abfd, sec, rel, h, sym, addendp))
+ #define bfd_coff_adjust_symndx(obfd, info, ibfd, sec, rel, adjustedp)\
+ ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\
+ (obfd, info, ibfd, sec, rel, adjustedp))
+ #define bfd_coff_link_add_one_symbol(info, abfd, name, flags, section,\
+ value, string, cp, coll, hashp)\
+ ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\
+ (info, abfd, name, flags, section, value, string, cp, coll, hashp))
+
+ #define bfd_coff_link_output_has_begun(a,p) \
+ ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a, p))
+ #define bfd_coff_final_link_postscript(a,p) \
+ ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a, p))
+
+ #define bfd_coff_have_print_pdata(a) \
+ (coff_backend_info (a)->_bfd_coff_print_pdata)
+ #define bfd_coff_print_pdata(a,p) \
+ ((coff_backend_info (a)->_bfd_coff_print_pdata) (a, p))
+
+ /* Macro: Returns true if the bfd is a PE executable as opposed to a
+ PE object file. */
+ #define bfd_pei_p(abfd) \
+ (CONST_STRNEQ ((abfd)->xvec->name, "pei-"))
+
+3.3.2.8 Writing relocations
+...........................
+
+To write relocations, the back end steps though the canonical
+relocation table and create an `internal_reloc'. The symbol index to
+use is removed from the `offset' field in the symbol table supplied.
+The address comes directly from the sum of the section base address and
+the relocation offset; the type is dug directly from the howto field.
+Then the `internal_reloc' is swapped into the shape of an
+`external_reloc' and written out to disk.
+
+3.3.2.9 Reading linenumbers
+...........................
+
+Creating the linenumber table is done by reading in the entire coff
+linenumber table, and creating another table for internal use.
+
+ A coff linenumber table is structured so that each function is
+marked as having a line number of 0. Each line within the function is
+an offset from the first line in the function. The base of the line
+number information for the table is stored in the symbol associated
+with the function.
+
+ Note: The PE format uses line number 0 for a flag indicating a new
+source file.
+
+ The information is copied from the external to the internal table,
+and each symbol which marks a function is marked by pointing its...
+
+ How does this work ?
+
+3.3.2.10 Reading relocations
+............................
+
+Coff relocations are easily transformed into the internal BFD form
+(`arelent').
+
+ Reading a coff relocation table is done in the following stages:
+
+ * Read the entire coff relocation table into memory.
+
+ * Process each relocation in turn; first swap it from the external
+ to the internal form.
+
+ * Turn the symbol referenced in the relocation's symbol index into a
+ pointer into the canonical symbol table. This table is the same
+ as the one returned by a call to `bfd_canonicalize_symtab'. The
+ back end will call that routine and save the result if a
+ canonicalization hasn't been done.
+
+ * The reloc index is turned into a pointer to a howto structure, in
+ a back end specific way. For instance, the 386 and 960 use the
+ `r_type' to directly produce an index into a howto table vector;
+ the 88k subtracts a number from the `r_type' field and creates an
+ addend field.
+
+
+File: bfd.info, Node: elf, Next: mmo, Prev: coff, Up: BFD back ends
+
+3.4 ELF backends
+================
+
+BFD support for ELF formats is being worked on. Currently, the best
+supported back ends are for sparc and i386 (running svr4 or Solaris 2).
+
+ Documentation of the internals of the support code still needs to be
+written. The code is changing quickly enough that we haven't bothered
+yet.
+
+
+File: bfd.info, Node: mmo, Prev: elf, Up: BFD back ends
+
+3.5 mmo backend
+===============
+
+The mmo object format is used exclusively together with Professor
+Donald E. Knuth's educational 64-bit processor MMIX. The simulator
+`mmix' which is available at
+`http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz'
+understands this format. That package also includes a combined
+assembler and linker called `mmixal'. The mmo format has no advantages
+feature-wise compared to e.g. ELF. It is a simple non-relocatable
+object format with no support for archives or debugging information,
+except for symbol value information and line numbers (which is not yet
+implemented in BFD). See
+`http://www-cs-faculty.stanford.edu/~knuth/mmix.html' for more
+information about MMIX. The ELF format is used for intermediate object
+files in the BFD implementation.
+
+* Menu:
+
+* File layout::
+* Symbol-table::
+* mmo section mapping::
+
+
+File: bfd.info, Node: File layout, Next: Symbol-table, Prev: mmo, Up: mmo
+
+3.5.1 File layout
+-----------------
+
+The mmo file contents is not partitioned into named sections as with
+e.g. ELF. Memory areas is formed by specifying the location of the
+data that follows. Only the memory area `0x0000...00' to `0x01ff...ff'
+is executable, so it is used for code (and constants) and the area
+`0x2000...00' to `0x20ff...ff' is used for writable data. *Note mmo
+section mapping::.
+
+ There is provision for specifying "special data" of 65536 different
+types. We use type 80 (decimal), arbitrarily chosen the same as the
+ELF `e_machine' number for MMIX, filling it with section information
+normally found in ELF objects. *Note mmo section mapping::.
+
+ Contents is entered as 32-bit words, xor:ed over previous contents,
+always zero-initialized. A word that starts with the byte `0x98' forms
+a command called a `lopcode', where the next byte distinguished between
+the thirteen lopcodes. The two remaining bytes, called the `Y' and `Z'
+fields, or the `YZ' field (a 16-bit big-endian number), are used for
+various purposes different for each lopcode. As documented in
+`http://www-cs-faculty.stanford.edu/~knuth/mmixal-intro.ps.gz', the
+lopcodes are:
+
+`lop_quote'
+ 0x98000001. The next word is contents, regardless of whether it
+ starts with 0x98 or not.
+
+`lop_loc'
+ 0x9801YYZZ, where `Z' is 1 or 2. This is a location directive,
+ setting the location for the next data to the next 32-bit word
+ (for Z = 1) or 64-bit word (for Z = 2), plus Y * 2^56. Normally
+ `Y' is 0 for the text segment and 2 for the data segment.
+
+`lop_skip'
+ 0x9802YYZZ. Increase the current location by `YZ' bytes.
+
+`lop_fixo'
+ 0x9803YYZZ, where `Z' is 1 or 2. Store the current location as 64
+ bits into the location pointed to by the next 32-bit (Z = 1) or
+ 64-bit (Z = 2) word, plus Y * 2^56.
+
+`lop_fixr'
+ 0x9804YYZZ. `YZ' is stored into the current location plus 2 - 4 *
+ YZ.
+
+`lop_fixrx'
+ 0x980500ZZ. `Z' is 16 or 24. A value `L' derived from the
+ following 32-bit word are used in a manner similar to `YZ' in
+ lop_fixr: it is xor:ed into the current location minus 4 * L. The
+ first byte of the word is 0 or 1. If it is 1, then L = (LOWEST 24
+ BITS OF WORD) - 2^Z, if 0, then L = (LOWEST 24 BITS OF WORD).
+
+`lop_file'
+ 0x9806YYZZ. `Y' is the file number, `Z' is count of 32-bit words.
+ Set the file number to `Y' and the line counter to 0. The next Z
+ * 4 bytes contain the file name, padded with zeros if the count is
+ not a multiple of four. The same `Y' may occur multiple times,
+ but `Z' must be 0 for all but the first occurrence.
+
+`lop_line'
+ 0x9807YYZZ. `YZ' is the line number. Together with lop_file, it
+ forms the source location for the next 32-bit word. Note that for
+ each non-lopcode 32-bit word, line numbers are assumed incremented
+ by one.
+
+`lop_spec'
+ 0x9808YYZZ. `YZ' is the type number. Data until the next lopcode
+ other than lop_quote forms special data of type `YZ'. *Note mmo
+ section mapping::.
+
+ Other types than 80, (or type 80 with a content that does not
+ parse) is stored in sections named `.MMIX.spec_data.N' where N is
+ the `YZ'-type. The flags for such a sections say not to allocate
+ or load the data. The vma is 0. Contents of multiple occurrences
+ of special data N is concatenated to the data of the previous
+ lop_spec Ns. The location in data or code at which the lop_spec
+ occurred is lost.
+
+`lop_pre'
+ 0x980901ZZ. The first lopcode in a file. The `Z' field forms the
+ length of header information in 32-bit words, where the first word
+ tells the time in seconds since `00:00:00 GMT Jan 1 1970'.
+
+`lop_post'
+ 0x980a00ZZ. Z > 32. This lopcode follows after all
+ content-generating lopcodes in a program. The `Z' field denotes
+ the value of `rG' at the beginning of the program. The following
+ 256 - Z big-endian 64-bit words are loaded into global registers
+ `$G' ... `$255'.
+
+`lop_stab'
+ 0x980b0000. The next-to-last lopcode in a program. Must follow
+ immediately after the lop_post lopcode and its data. After this
+ lopcode follows all symbols in a compressed format (*note
+ Symbol-table::).
+
+`lop_end'
+ 0x980cYYZZ. The last lopcode in a program. It must follow the
+ lop_stab lopcode and its data. The `YZ' field contains the number
+ of 32-bit words of symbol table information after the preceding
+ lop_stab lopcode.
+
+ Note that the lopcode "fixups"; `lop_fixr', `lop_fixrx' and
+`lop_fixo' are not generated by BFD, but are handled. They are
+generated by `mmixal'.
+
+ This trivial one-label, one-instruction file:
+
+ :Main TRAP 1,2,3
+
+ can be represented this way in mmo:
+
+ 0x98090101 - lop_pre, one 32-bit word with timestamp.
+ <timestamp>
+ 0x98010002 - lop_loc, text segment, using a 64-bit address.
+ Note that mmixal does not emit this for the file above.
+ 0x00000000 - Address, high 32 bits.
+ 0x00000000 - Address, low 32 bits.
+ 0x98060002 - lop_file, 2 32-bit words for file-name.
+ 0x74657374 - "test"
+ 0x2e730000 - ".s\0\0"
+ 0x98070001 - lop_line, line 1.
+ 0x00010203 - TRAP 1,2,3
+ 0x980a00ff - lop_post, setting $255 to 0.
+ 0x00000000
+ 0x00000000
+ 0x980b0000 - lop_stab for ":Main" = 0, serial 1.
+ 0x203a4040 *Note Symbol-table::.
+ 0x10404020
+ 0x4d206120
+ 0x69016e00
+ 0x81000000
+ 0x980c0005 - lop_end; symbol table contained five 32-bit words.
+
+
+File: bfd.info, Node: Symbol-table, Next: mmo section mapping, Prev: File layout, Up: mmo
+
+3.5.2 Symbol table format
+-------------------------
+
+From mmixal.w (or really, the generated mmixal.tex) in
+`http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz'):
+"Symbols are stored and retrieved by means of a `ternary search trie',
+following ideas of Bentley and Sedgewick. (See ACM-SIAM Symp. on
+Discrete Algorithms `8' (1997), 360-369; R.Sedgewick, `Algorithms in C'
+(Reading, Mass. Addison-Wesley, 1998), `15.4'.) Each trie node stores
+a character, and there are branches to subtries for the cases where a
+given character is less than, equal to, or greater than the character
+in the trie. There also is a pointer to a symbol table entry if a
+symbol ends at the current node."
+
+ So it's a tree encoded as a stream of bytes. The stream of bytes
+acts on a single virtual global symbol, adding and removing characters
+and signalling complete symbol points. Here, we read the stream and
+create symbols at the completion points.
+
+ First, there's a control byte `m'. If any of the listed bits in `m'
+is nonzero, we execute what stands at the right, in the listed order:
+
+ (MMO3_LEFT)
+ 0x40 - Traverse left trie.
+ (Read a new command byte and recurse.)
+
+ (MMO3_SYMBITS)
+ 0x2f - Read the next byte as a character and store it in the
+ current character position; increment character position.
+ Test the bits of `m':
+
+ (MMO3_WCHAR)
+ 0x80 - The character is 16-bit (so read another byte,
+ merge into current character.
+
+ (MMO3_TYPEBITS)
+ 0xf - We have a complete symbol; parse the type, value
+ and serial number and do what should be done
+ with a symbol. The type and length information
+ is in j = (m & 0xf).
+
+ (MMO3_REGQUAL_BITS)
+ j == 0xf: A register variable. The following
+ byte tells which register.
+ j <= 8: An absolute symbol. Read j bytes as the
+ big-endian number the symbol equals.
+ A j = 2 with two zero bytes denotes an
+ unknown symbol.
+ j > 8: As with j <= 8, but add (0x20 << 56)
+ to the value in the following j - 8
+ bytes.
+
+ Then comes the serial number, as a variant of
+ uleb128, but better named ubeb128:
+ Read bytes and shift the previous value left 7
+ (multiply by 128). Add in the new byte, repeat
+ until a byte has bit 7 set. The serial number
+ is the computed value minus 128.
+
+ (MMO3_MIDDLE)
+ 0x20 - Traverse middle trie. (Read a new command byte
+ and recurse.) Decrement character position.
+
+ (MMO3_RIGHT)
+ 0x10 - Traverse right trie. (Read a new command byte and
+ recurse.)
+
+ Let's look again at the `lop_stab' for the trivial file (*note File
+layout::).
+
+ 0x980b0000 - lop_stab for ":Main" = 0, serial 1.
+ 0x203a4040
+ 0x10404020
+ 0x4d206120
+ 0x69016e00
+ 0x81000000
+
+ This forms the trivial trie (note that the path between ":" and "M"
+is redundant):
+
+ 203a ":"
+ 40 /
+ 40 /
+ 10 \
+ 40 /
+ 40 /
+ 204d "M"
+ 2061 "a"
+ 2069 "i"
+ 016e "n" is the last character in a full symbol, and
+ with a value represented in one byte.
+ 00 The value is 0.
+ 81 The serial number is 1.
+
+
+File: bfd.info, Node: mmo section mapping, Prev: Symbol-table, Up: mmo
+
+3.5.3 mmo section mapping
+-------------------------
+
+The implementation in BFD uses special data type 80 (decimal) to
+encapsulate and describe named sections, containing e.g. debug
+information. If needed, any datum in the encapsulation will be quoted
+using lop_quote. First comes a 32-bit word holding the number of
+32-bit words containing the zero-terminated zero-padded segment name.
+After the name there's a 32-bit word holding flags describing the
+section type. Then comes a 64-bit big-endian word with the section
+length (in bytes), then another with the section start address.
+Depending on the type of section, the contents might follow,
+zero-padded to 32-bit boundary. For a loadable section (such as data
+or code), the contents might follow at some later point, not
+necessarily immediately, as a lop_loc with the same start address as in
+the section description, followed by the contents. This in effect
+forms a descriptor that must be emitted before the actual contents.
+Sections described this way must not overlap.
+
+ For areas that don't have such descriptors, synthetic sections are
+formed by BFD. Consecutive contents in the two memory areas
+`0x0000...00' to `0x01ff...ff' and `0x2000...00' to `0x20ff...ff' are
+entered in sections named `.text' and `.data' respectively. If an area
+is not otherwise described, but would together with a neighboring lower
+area be less than `0x40000000' bytes long, it is joined with the lower
+area and the gap is zero-filled. For other cases, a new section is
+formed, named `.MMIX.sec.N'. Here, N is a number, a running count
+through the mmo file, starting at 0.
+
+ A loadable section specified as:
+
+ .section secname,"ax"
+ TETRA 1,2,3,4,-1,-2009
+ BYTE 80
+
+ and linked to address `0x4', is represented by the sequence:
+
+ 0x98080050 - lop_spec 80
+ 0x00000002 - two 32-bit words for the section name
+ 0x7365636e - "secn"
+ 0x616d6500 - "ame\0"
+ 0x00000033 - flags CODE, READONLY, LOAD, ALLOC
+ 0x00000000 - high 32 bits of section length
+ 0x0000001c - section length is 28 bytes; 6 * 4 + 1 + alignment to 32 bits
+ 0x00000000 - high 32 bits of section address
+ 0x00000004 - section address is 4
+ 0x98010002 - 64 bits with address of following data
+ 0x00000000 - high 32 bits of address
+ 0x00000004 - low 32 bits: data starts at address 4
+ 0x00000001 - 1
+ 0x00000002 - 2
+ 0x00000003 - 3
+ 0x00000004 - 4
+ 0xffffffff - -1
+ 0xfffff827 - -2009
+ 0x50000000 - 80 as a byte, padded with zeros.
+
+ Note that the lop_spec wrapping does not include the section
+contents. Compare this to a non-loaded section specified as:
+
+ .section thirdsec
+ TETRA 200001,100002
+ BYTE 38,40
+
+ This, when linked to address `0x200000000000001c', is represented by:
+
+ 0x98080050 - lop_spec 80
+ 0x00000002 - two 32-bit words for the section name
+ 0x7365636e - "thir"
+ 0x616d6500 - "dsec"
+ 0x00000010 - flag READONLY
+ 0x00000000 - high 32 bits of section length
+ 0x0000000c - section length is 12 bytes; 2 * 4 + 2 + alignment to 32 bits
+ 0x20000000 - high 32 bits of address
+ 0x0000001c - low 32 bits of address 0x200000000000001c
+ 0x00030d41 - 200001
+ 0x000186a2 - 100002
+ 0x26280000 - 38, 40 as bytes, padded with zeros
+
+ For the latter example, the section contents must not be loaded in
+memory, and is therefore specified as part of the special data. The
+address is usually unimportant but might provide information for e.g.
+the DWARF 2 debugging format.
+
+
+File: bfd.info, Node: GNU Free Documentation License, Next: BFD Index, Prev: BFD back ends, Up: Top
+
+ Version 1.3, 3 November 2008
+
+ Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+ `http://fsf.org/'
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ 0. PREAMBLE
+
+ The purpose of this License is to make a manual, textbook, or other
+ functional and useful document "free" in the sense of freedom: to
+ assure everyone the effective freedom to copy and redistribute it,
+ with or without modifying it, either commercially or
+ noncommercially. Secondarily, this License preserves for the
+ author and publisher a way to get credit for their work, while not
+ being considered responsible for modifications made by others.
+
+ This License is a kind of "copyleft", which means that derivative
+ works of the document must themselves be free in the same sense.
+ It complements the GNU General Public License, which is a copyleft
+ license designed for free software.
+
+ We have designed this License in order to use it for manuals for
+ free software, because free software needs free documentation: a
+ free program should come with manuals providing the same freedoms
+ that the software does. But this License is not limited to
+ software manuals; it can be used for any textual work, regardless
+ of subject matter or whether it is published as a printed book.
+ We recommend this License principally for works whose purpose is
+ instruction or reference.
+
+ 1. APPLICABILITY AND DEFINITIONS
+
+ This License applies to any manual or other work, in any medium,
+ that contains a notice placed by the copyright holder saying it
+ can be distributed under the terms of this License. Such a notice
+ grants a world-wide, royalty-free license, unlimited in duration,
+ to use that work under the conditions stated herein. The
+ "Document", below, refers to any such manual or work. Any member
+ of the public is a licensee, and is addressed as "you". You
+ accept the license if you copy, modify or distribute the work in a
+ way requiring permission under copyright law.
+
+ A "Modified Version" of the Document means any work containing the
+ Document or a portion of it, either copied verbatim, or with
+ modifications and/or translated into another language.
+
+ A "Secondary Section" is a named appendix or a front-matter section
+ of the Document that deals exclusively with the relationship of the
+ publishers or authors of the Document to the Document's overall
+ subject (or to related matters) and contains nothing that could
+ fall directly within that overall subject. (Thus, if the Document
+ is in part a textbook of mathematics, a Secondary Section may not
+ explain any mathematics.) The relationship could be a matter of
+ historical connection with the subject or with related matters, or
+ of legal, commercial, philosophical, ethical or political position
+ regarding them.
+
+ The "Invariant Sections" are certain Secondary Sections whose
+ titles are designated, as being those of Invariant Sections, in
+ the notice that says that the Document is released under this
+ License. If a section does not fit the above definition of
+ Secondary then it is not allowed to be designated as Invariant.
+ The Document may contain zero Invariant Sections. If the Document
+ does not identify any Invariant Sections then there are none.
+
+ The "Cover Texts" are certain short passages of text that are
+ listed, as Front-Cover Texts or Back-Cover Texts, in the notice
+ that says that the Document is released under this License. A
+ Front-Cover Text may be at most 5 words, and a Back-Cover Text may
+ be at most 25 words.
+
+ A "Transparent" copy of the Document means a machine-readable copy,
+ represented in a format whose specification is available to the
+ general public, that is suitable for revising the document
+ straightforwardly with generic text editors or (for images
+ composed of pixels) generic paint programs or (for drawings) some
+ widely available drawing editor, and that is suitable for input to
+ text formatters or for automatic translation to a variety of
+ formats suitable for input to text formatters. A copy made in an
+ otherwise Transparent file format whose markup, or absence of
+ markup, has been arranged to thwart or discourage subsequent
+ modification by readers is not Transparent. An image format is
+ not Transparent if used for any substantial amount of text. A
+ copy that is not "Transparent" is called "Opaque".
+
+ Examples of suitable formats for Transparent copies include plain
+ ASCII without markup, Texinfo input format, LaTeX input format,
+ SGML or XML using a publicly available DTD, and
+ standard-conforming simple HTML, PostScript or PDF designed for
+ human modification. Examples of transparent image formats include
+ PNG, XCF and JPG. Opaque formats include proprietary formats that
+ can be read and edited only by proprietary word processors, SGML or
+ XML for which the DTD and/or processing tools are not generally
+ available, and the machine-generated HTML, PostScript or PDF
+ produced by some word processors for output purposes only.
+
+ The "Title Page" means, for a printed book, the title page itself,
+ plus such following pages as are needed to hold, legibly, the
+ material this License requires to appear in the title page. For
+ works in formats which do not have any title page as such, "Title
+ Page" means the text near the most prominent appearance of the
+ work's title, preceding the beginning of the body of the text.
+
+ The "publisher" means any person or entity that distributes copies
+ of the Document to the public.
+
+ A section "Entitled XYZ" means a named subunit of the Document
+ whose title either is precisely XYZ or contains XYZ in parentheses
+ following text that translates XYZ in another language. (Here XYZ
+ stands for a specific section name mentioned below, such as
+ "Acknowledgements", "Dedications", "Endorsements", or "History".)
+ To "Preserve the Title" of such a section when you modify the
+ Document means that it remains a section "Entitled XYZ" according
+ to this definition.
+
+ The Document may include Warranty Disclaimers next to the notice
+ which states that this License applies to the Document. These
+ Warranty Disclaimers are considered to be included by reference in
+ this License, but only as regards disclaiming warranties: any other
+ implication that these Warranty Disclaimers may have is void and
+ has no effect on the meaning of this License.
+
+ 2. VERBATIM COPYING
+
+ You may copy and distribute the Document in any medium, either
+ commercially or noncommercially, provided that this License, the
+ copyright notices, and the license notice saying this License
+ applies to the Document are reproduced in all copies, and that you
+ add no other conditions whatsoever to those of this License. You
+ may not use technical measures to obstruct or control the reading
+ or further copying of the copies you make or distribute. However,
+ you may accept compensation in exchange for copies. If you
+ distribute a large enough number of copies you must also follow
+ the conditions in section 3.
+
+ You may also lend copies, under the same conditions stated above,
+ and you may publicly display copies.
+
+ 3. COPYING IN QUANTITY
+
+ If you publish printed copies (or copies in media that commonly
+ have printed covers) of the Document, numbering more than 100, and
+ the Document's license notice requires Cover Texts, you must
+ enclose the copies in covers that carry, clearly and legibly, all
+ these Cover Texts: Front-Cover Texts on the front cover, and
+ Back-Cover Texts on the back cover. Both covers must also clearly
+ and legibly identify you as the publisher of these copies. The
+ front cover must present the full title with all words of the
+ title equally prominent and visible. You may add other material
+ on the covers in addition. Copying with changes limited to the
+ covers, as long as they preserve the title of the Document and
+ satisfy these conditions, can be treated as verbatim copying in
+ other respects.
+
+ If the required texts for either cover are too voluminous to fit
+ legibly, you should put the first ones listed (as many as fit
+ reasonably) on the actual cover, and continue the rest onto
+ adjacent pages.
+
+ If you publish or distribute Opaque copies of the Document
+ numbering more than 100, you must either include a
+ machine-readable Transparent copy along with each Opaque copy, or
+ state in or with each Opaque copy a computer-network location from
+ which the general network-using public has access to download
+ using public-standard network protocols a complete Transparent
+ copy of the Document, free of added material. If you use the
+ latter option, you must take reasonably prudent steps, when you
+ begin distribution of Opaque copies in quantity, to ensure that
+ this Transparent copy will remain thus accessible at the stated
+ location until at least one year after the last time you
+ distribute an Opaque copy (directly or through your agents or
+ retailers) of that edition to the public.
+
+ It is requested, but not required, that you contact the authors of
+ the Document well before redistributing any large number of
+ copies, to give them a chance to provide you with an updated
+ version of the Document.
+
+ 4. MODIFICATIONS
+
+ You may copy and distribute a Modified Version of the Document
+ under the conditions of sections 2 and 3 above, provided that you
+ release the Modified Version under precisely this License, with
+ the Modified Version filling the role of the Document, thus
+ licensing distribution and modification of the Modified Version to
+ whoever possesses a copy of it. In addition, you must do these
+ things in the Modified Version:
+
+ A. Use in the Title Page (and on the covers, if any) a title
+ distinct from that of the Document, and from those of
+ previous versions (which should, if there were any, be listed
+ in the History section of the Document). You may use the
+ same title as a previous version if the original publisher of
+ that version gives permission.
+
+ B. List on the Title Page, as authors, one or more persons or
+ entities responsible for authorship of the modifications in
+ the Modified Version, together with at least five of the
+ principal authors of the Document (all of its principal
+ authors, if it has fewer than five), unless they release you
+ from this requirement.
+
+ C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+
+ D. Preserve all the copyright notices of the Document.
+
+ E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+
+ F. Include, immediately after the copyright notices, a license
+ notice giving the public permission to use the Modified
+ Version under the terms of this License, in the form shown in
+ the Addendum below.
+
+ G. Preserve in that license notice the full lists of Invariant
+ Sections and required Cover Texts given in the Document's
+ license notice.
+
+ H. Include an unaltered copy of this License.
+
+ I. Preserve the section Entitled "History", Preserve its Title,
+ and add to it an item stating at least the title, year, new
+ authors, and publisher of the Modified Version as given on
+ the Title Page. If there is no section Entitled "History" in
+ the Document, create one stating the title, year, authors,
+ and publisher of the Document as given on its Title Page,
+ then add an item describing the Modified Version as stated in
+ the previous sentence.
+
+ J. Preserve the network location, if any, given in the Document
+ for public access to a Transparent copy of the Document, and
+ likewise the network locations given in the Document for
+ previous versions it was based on. These may be placed in
+ the "History" section. You may omit a network location for a
+ work that was published at least four years before the
+ Document itself, or if the original publisher of the version
+ it refers to gives permission.
+
+ K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the
+ section all the substance and tone of each of the contributor
+ acknowledgements and/or dedications given therein.
+
+ L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section
+ titles.
+
+ M. Delete any section Entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+
+ N. Do not retitle any existing section to be Entitled
+ "Endorsements" or to conflict in title with any Invariant
+ Section.
+
+ O. Preserve any Warranty Disclaimers.
+
+ If the Modified Version includes new front-matter sections or
+ appendices that qualify as Secondary Sections and contain no
+ material copied from the Document, you may at your option
+ designate some or all of these sections as invariant. To do this,
+ add their titles to the list of Invariant Sections in the Modified
+ Version's license notice. These titles must be distinct from any
+ other section titles.
+
+ You may add a section Entitled "Endorsements", provided it contains
+ nothing but endorsements of your Modified Version by various
+ parties--for example, statements of peer review or that the text
+ has been approved by an organization as the authoritative
+ definition of a standard.
+
+ You may add a passage of up to five words as a Front-Cover Text,
+ and a passage of up to 25 words as a Back-Cover Text, to the end
+ of the list of Cover Texts in the Modified Version. Only one
+ passage of Front-Cover Text and one of Back-Cover Text may be
+ added by (or through arrangements made by) any one entity. If the
+ Document already includes a cover text for the same cover,
+ previously added by you or by arrangement made by the same entity
+ you are acting on behalf of, you may not add another; but you may
+ replace the old one, on explicit permission from the previous
+ publisher that added the old one.
+
+ The author(s) and publisher(s) of the Document do not by this
+ License give permission to use their names for publicity for or to
+ assert or imply endorsement of any Modified Version.
+
+ 5. COMBINING DOCUMENTS
+
+ You may combine the Document with other documents released under
+ this License, under the terms defined in section 4 above for
+ modified versions, provided that you include in the combination
+ all of the Invariant Sections of all of the original documents,
+ unmodified, and list them all as Invariant Sections of your
+ combined work in its license notice, and that you preserve all
+ their Warranty Disclaimers.
+
+ The combined work need only contain one copy of this License, and
+ multiple identical Invariant Sections may be replaced with a single
+ copy. If there are multiple Invariant Sections with the same name
+ but different contents, make the title of each such section unique
+ by adding at the end of it, in parentheses, the name of the
+ original author or publisher of that section if known, or else a
+ unique number. Make the same adjustment to the section titles in
+ the list of Invariant Sections in the license notice of the
+ combined work.
+
+ In the combination, you must combine any sections Entitled
+ "History" in the various original documents, forming one section
+ Entitled "History"; likewise combine any sections Entitled
+ "Acknowledgements", and any sections Entitled "Dedications". You
+ must delete all sections Entitled "Endorsements."
+
+ 6. COLLECTIONS OF DOCUMENTS
+
+ You may make a collection consisting of the Document and other
+ documents released under this License, and replace the individual
+ copies of this License in the various documents with a single copy
+ that is included in the collection, provided that you follow the
+ rules of this License for verbatim copying of each of the
+ documents in all other respects.
+
+ You may extract a single document from such a collection, and
+ distribute it individually under this License, provided you insert
+ a copy of this License into the extracted document, and follow
+ this License in all other respects regarding verbatim copying of
+ that document.
+
+ 7. AGGREGATION WITH INDEPENDENT WORKS
+
+ A compilation of the Document or its derivatives with other
+ separate and independent documents or works, in or on a volume of
+ a storage or distribution medium, is called an "aggregate" if the
+ copyright resulting from the compilation is not used to limit the
+ legal rights of the compilation's users beyond what the individual
+ works permit. When the Document is included in an aggregate, this
+ License does not apply to the other works in the aggregate which
+ are not themselves derivative works of the Document.
+
+ If the Cover Text requirement of section 3 is applicable to these
+ copies of the Document, then if the Document is less than one half
+ of the entire aggregate, the Document's Cover Texts may be placed
+ on covers that bracket the Document within the aggregate, or the
+ electronic equivalent of covers if the Document is in electronic
+ form. Otherwise they must appear on printed covers that bracket
+ the whole aggregate.
+
+ 8. TRANSLATION
+
+ Translation is considered a kind of modification, so you may
+ distribute translations of the Document under the terms of section
+ 4. Replacing Invariant Sections with translations requires special
+ permission from their copyright holders, but you may include
+ translations of some or all Invariant Sections in addition to the
+ original versions of these Invariant Sections. You may include a
+ translation of this License, and all the license notices in the
+ Document, and any Warranty Disclaimers, provided that you also
+ include the original English version of this License and the
+ original versions of those notices and disclaimers. In case of a
+ disagreement between the translation and the original version of
+ this License or a notice or disclaimer, the original version will
+ prevail.
+
+ If a section in the Document is Entitled "Acknowledgements",
+ "Dedications", or "History", the requirement (section 4) to
+ Preserve its Title (section 1) will typically require changing the
+ actual title.
+
+ 9. TERMINATION
+
+ You may not copy, modify, sublicense, or distribute the Document
+ except as expressly provided under this License. Any attempt
+ otherwise to copy, modify, sublicense, or distribute it is void,
+ and will automatically terminate your rights under this License.
+
+ However, if you cease all violation of this License, then your
+ license from a particular copyright holder is reinstated (a)
+ provisionally, unless and until the copyright holder explicitly
+ and finally terminates your license, and (b) permanently, if the
+ copyright holder fails to notify you of the violation by some
+ reasonable means prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+ reinstated permanently if the copyright holder notifies you of the
+ violation by some reasonable means, this is the first time you have
+ received notice of violation of this License (for any work) from
+ that copyright holder, and you cure the violation prior to 30 days
+ after your receipt of the notice.
+
+ Termination of your rights under this section does not terminate
+ the licenses of parties who have received copies or rights from
+ you under this License. If your rights have been terminated and
+ not permanently reinstated, receipt of a copy of some or all of
+ the same material does not give you any rights to use it.
+
+ 10. FUTURE REVISIONS OF THIS LICENSE
+
+ The Free Software Foundation may publish new, revised versions of
+ the GNU Free Documentation License from time to time. Such new
+ versions will be similar in spirit to the present version, but may
+ differ in detail to address new problems or concerns. See
+ `http://www.gnu.org/copyleft/'.
+
+ Each version of the License is given a distinguishing version
+ number. If the Document specifies that a particular numbered
+ version of this License "or any later version" applies to it, you
+ have the option of following the terms and conditions either of
+ that specified version or of any later version that has been
+ published (not as a draft) by the Free Software Foundation. If
+ the Document does not specify a version number of this License,
+ you may choose any version ever published (not as a draft) by the
+ Free Software Foundation. If the Document specifies that a proxy
+ can decide which future versions of this License can be used, that
+ proxy's public statement of acceptance of a version permanently
+ authorizes you to choose that version for the Document.
+
+ 11. RELICENSING
+
+ "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
+ World Wide Web server that publishes copyrightable works and also
+ provides prominent facilities for anybody to edit those works. A
+ public wiki that anybody can edit is an example of such a server.
+ A "Massive Multiauthor Collaboration" (or "MMC") contained in the
+ site means any set of copyrightable works thus published on the MMC
+ site.
+
+ "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
+ license published by Creative Commons Corporation, a not-for-profit
+ corporation with a principal place of business in San Francisco,
+ California, as well as future copyleft versions of that license
+ published by that same organization.
+
+ "Incorporate" means to publish or republish a Document, in whole or
+ in part, as part of another Document.
+
+ An MMC is "eligible for relicensing" if it is licensed under this
+ License, and if all works that were first published under this
+ License somewhere other than this MMC, and subsequently
+ incorporated in whole or in part into the MMC, (1) had no cover
+ texts or invariant sections, and (2) were thus incorporated prior
+ to November 1, 2008.
+
+ The operator of an MMC Site may republish an MMC contained in the
+ site under CC-BY-SA on the same site at any time before August 1,
+ 2009, provided the MMC is eligible for relicensing.
+
+
+ADDENDUM: How to use this License for your documents
+====================================================
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and license
+notices just after the title page:
+
+ Copyright (C) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.3
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+ Texts. A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
+
+ If you have Invariant Sections, Front-Cover Texts and Back-Cover
+Texts, replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with
+ the Front-Cover Texts being LIST, and with the Back-Cover Texts
+ being LIST.
+
+ If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+ If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License, to
+permit their use in free software.
+
+
+File: bfd.info, Node: BFD Index, Prev: GNU Free Documentation License, Up: Top
+
+BFD Index
+*********
+
+
+* Menu:
+
+* _bfd_final_link_relocate: Relocating the section contents.
+ (line 22)
+* _bfd_generic_link_add_archive_symbols: Adding symbols from an archive.
+ (line 12)
+* _bfd_generic_link_add_one_symbol: Adding symbols from an object file.
+ (line 19)
+* _bfd_generic_make_empty_symbol: symbol handling functions.
+ (line 92)
+* _bfd_link_add_symbols in target vector: Adding Symbols to the Hash Table.
+ (line 6)
+* _bfd_link_final_link in target vector: Performing the Final Link.
+ (line 6)
+* _bfd_link_hash_table_create in target vector: Creating a Linker Hash Table.
+ (line 6)
+* _bfd_relocate_contents: Relocating the section contents.
+ (line 22)
+* aout_SIZE_machine_type: aout. (line 147)
+* aout_SIZE_mkobject: aout. (line 139)
+* aout_SIZE_new_section_hook: aout. (line 177)
+* aout_SIZE_set_arch_mach: aout. (line 164)
+* aout_SIZE_some_aout_object_p: aout. (line 125)
+* aout_SIZE_swap_exec_header_in: aout. (line 101)
+* aout_SIZE_swap_exec_header_out: aout. (line 113)
+* arelent_chain: typedef arelent. (line 339)
+* BFD: Overview. (line 6)
+* BFD canonical format: Canonical format. (line 11)
+* bfd_alloc: Opening and Closing.
+ (line 210)
+* bfd_alloc2: Opening and Closing.
+ (line 219)
+* bfd_alt_mach_code: BFD front end. (line 689)
+* bfd_arch_bits_per_address: Architectures. (line 517)
+* bfd_arch_bits_per_byte: Architectures. (line 509)
+* bfd_arch_get_compatible: Architectures. (line 452)
+* bfd_arch_list: Architectures. (line 443)
+* bfd_arch_mach_octets_per_byte: Architectures. (line 586)
+* BFD_ARELOC_BFIN_ADD: howto manager. (line 1005)
+* BFD_ARELOC_BFIN_ADDR: howto manager. (line 1056)
+* BFD_ARELOC_BFIN_AND: howto manager. (line 1026)
+* BFD_ARELOC_BFIN_COMP: howto manager. (line 1047)
+* BFD_ARELOC_BFIN_CONST: howto manager. (line 1002)
+* BFD_ARELOC_BFIN_DIV: howto manager. (line 1014)
+* BFD_ARELOC_BFIN_HWPAGE: howto manager. (line 1053)
+* BFD_ARELOC_BFIN_LAND: howto manager. (line 1035)
+* BFD_ARELOC_BFIN_LEN: howto manager. (line 1041)
+* BFD_ARELOC_BFIN_LOR: howto manager. (line 1038)
+* BFD_ARELOC_BFIN_LSHIFT: howto manager. (line 1020)
+* BFD_ARELOC_BFIN_MOD: howto manager. (line 1017)
+* BFD_ARELOC_BFIN_MULT: howto manager. (line 1011)
+* BFD_ARELOC_BFIN_NEG: howto manager. (line 1044)
+* BFD_ARELOC_BFIN_OR: howto manager. (line 1029)
+* BFD_ARELOC_BFIN_PAGE: howto manager. (line 1050)
+* BFD_ARELOC_BFIN_PUSH: howto manager. (line 999)
+* BFD_ARELOC_BFIN_RSHIFT: howto manager. (line 1023)
+* BFD_ARELOC_BFIN_SUB: howto manager. (line 1008)
+* BFD_ARELOC_BFIN_XOR: howto manager. (line 1032)
+* bfd_cache_close: File Caching. (line 26)
+* bfd_cache_close_all: File Caching. (line 39)
+* bfd_cache_init: File Caching. (line 18)
+* bfd_calc_gnu_debuglink_crc32: Opening and Closing.
+ (line 246)
+* bfd_canonicalize_reloc: BFD front end. (line 408)
+* bfd_canonicalize_symtab: symbol handling functions.
+ (line 50)
+* bfd_check_format: Formats. (line 21)
+* bfd_check_format_matches: Formats. (line 52)
+* bfd_check_overflow: typedef arelent. (line 351)
+* bfd_close: Opening and Closing.
+ (line 135)
+* bfd_close_all_done: Opening and Closing.
+ (line 153)
+* bfd_coff_backend_data: coff. (line 304)
+* bfd_copy_private_bfd_data: BFD front end. (line 547)
+* bfd_copy_private_header_data: BFD front end. (line 529)
+* bfd_copy_private_section_data: section prototypes. (line 255)
+* bfd_copy_private_symbol_data: symbol handling functions.
+ (line 140)
+* bfd_core_file_failing_command: Core Files. (line 12)
+* bfd_core_file_failing_signal: Core Files. (line 21)
+* bfd_create: Opening and Closing.
+ (line 172)
+* bfd_create_gnu_debuglink_section: Opening and Closing.
+ (line 312)
+* bfd_decode_symclass: symbol handling functions.
+ (line 111)
+* bfd_default_arch_struct: Architectures. (line 464)
+* bfd_default_compatible: Architectures. (line 526)
+* bfd_default_reloc_type_lookup: howto manager. (line 2247)
+* bfd_default_scan: Architectures. (line 535)
+* bfd_default_set_arch_mach: Architectures. (line 482)
+* bfd_demangle: BFD front end. (line 787)
+* bfd_emul_get_commonpagesize: BFD front end. (line 767)
+* bfd_emul_get_maxpagesize: BFD front end. (line 747)
+* bfd_emul_set_commonpagesize: BFD front end. (line 778)
+* bfd_emul_set_maxpagesize: BFD front end. (line 758)
+* bfd_errmsg: BFD front end. (line 333)
+* bfd_fdopenr: Opening and Closing.
+ (line 46)
+* bfd_fill_in_gnu_debuglink_section: Opening and Closing.
+ (line 326)
+* bfd_find_target: bfd_target. (line 445)
+* bfd_find_version_for_sym: Writing the symbol table.
+ (line 80)
+* bfd_follow_gnu_debuglink: Opening and Closing.
+ (line 291)
+* bfd_fopen: Opening and Closing.
+ (line 9)
+* bfd_format_string: Formats. (line 79)
+* bfd_generic_define_common_symbol: Writing the symbol table.
+ (line 67)
+* bfd_generic_discard_group: section prototypes. (line 281)
+* bfd_generic_gc_sections: howto manager. (line 2278)
+* bfd_generic_get_relocated_section_contents: howto manager. (line 2298)
+* bfd_generic_is_group_section: section prototypes. (line 273)
+* bfd_generic_merge_sections: howto manager. (line 2288)
+* bfd_generic_relax_section: howto manager. (line 2265)
+* bfd_get_arch: Architectures. (line 493)
+* bfd_get_arch_info: Architectures. (line 545)
+* bfd_get_arch_size: BFD front end. (line 452)
+* bfd_get_error: BFD front end. (line 314)
+* bfd_get_error_handler: BFD front end. (line 384)
+* bfd_get_gp_size: BFD front end. (line 493)
+* bfd_get_mach: Architectures. (line 501)
+* bfd_get_mtime: BFD front end. (line 831)
+* bfd_get_next_mapent: Archives. (line 52)
+* bfd_get_reloc_code_name: howto manager. (line 2256)
+* bfd_get_reloc_size: typedef arelent. (line 330)
+* bfd_get_reloc_upper_bound: BFD front end. (line 398)
+* bfd_get_section_by_name: section prototypes. (line 17)
+* bfd_get_section_by_name_if: section prototypes. (line 31)
+* bfd_get_section_contents: section prototypes. (line 228)
+* bfd_get_sign_extend_vma: BFD front end. (line 465)
+* bfd_get_size <1>: Internal. (line 25)
+* bfd_get_size: BFD front end. (line 840)
+* bfd_get_symtab_upper_bound: symbol handling functions.
+ (line 6)
+* bfd_get_unique_section_name: section prototypes. (line 50)
+* bfd_h_put_size: Internal. (line 97)
+* bfd_hash_allocate: Creating and Freeing a Hash Table.
+ (line 17)
+* bfd_hash_lookup: Looking Up or Entering a String.
+ (line 6)
+* bfd_hash_newfunc: Creating and Freeing a Hash Table.
+ (line 12)
+* bfd_hash_set_default_size: Creating and Freeing a Hash Table.
+ (line 25)
+* bfd_hash_table_free: Creating and Freeing a Hash Table.
+ (line 21)
+* bfd_hash_table_init: Creating and Freeing a Hash Table.
+ (line 6)
+* bfd_hash_table_init_n: Creating and Freeing a Hash Table.
+ (line 6)
+* bfd_hash_traverse: Traversing a Hash Table.
+ (line 6)
+* bfd_init: Initialization. (line 11)
+* bfd_install_relocation: typedef arelent. (line 392)
+* bfd_is_local_label: symbol handling functions.
+ (line 17)
+* bfd_is_local_label_name: symbol handling functions.
+ (line 26)
+* bfd_is_target_special_symbol: symbol handling functions.
+ (line 38)
+* bfd_is_undefined_symclass: symbol handling functions.
+ (line 120)
+* bfd_link_split_section: Writing the symbol table.
+ (line 44)
+* bfd_log2: Internal. (line 164)
+* bfd_lookup_arch: Architectures. (line 553)
+* bfd_make_debug_symbol: symbol handling functions.
+ (line 102)
+* bfd_make_empty_symbol: symbol handling functions.
+ (line 78)
+* bfd_make_readable: Opening and Closing.
+ (line 196)
+* bfd_make_section: section prototypes. (line 129)
+* bfd_make_section_anyway: section prototypes. (line 100)
+* bfd_make_section_anyway_with_flags: section prototypes. (line 82)
+* bfd_make_section_old_way: section prototypes. (line 62)
+* bfd_make_section_with_flags: section prototypes. (line 116)
+* bfd_make_writable: Opening and Closing.
+ (line 182)
+* bfd_malloc_and_get_section: section prototypes. (line 245)
+* bfd_map_over_sections: section prototypes. (line 155)
+* bfd_merge_private_bfd_data: BFD front end. (line 563)
+* bfd_mmap: BFD front end. (line 869)
+* bfd_octets_per_byte: Architectures. (line 576)
+* bfd_open_file: File Caching. (line 52)
+* bfd_openr: Opening and Closing.
+ (line 30)
+* bfd_openr_iovec: Opening and Closing.
+ (line 76)
+* bfd_openr_next_archived_file: Archives. (line 78)
+* bfd_openstreamr: Opening and Closing.
+ (line 67)
+* bfd_openw: Opening and Closing.
+ (line 123)
+* bfd_perform_relocation: typedef arelent. (line 367)
+* bfd_perror: BFD front end. (line 342)
+* bfd_preserve_finish: BFD front end. (line 737)
+* bfd_preserve_restore: BFD front end. (line 727)
+* bfd_preserve_save: BFD front end. (line 711)
+* bfd_print_symbol_vandf: symbol handling functions.
+ (line 70)
+* bfd_printable_arch_mach: Architectures. (line 564)
+* bfd_printable_name: Architectures. (line 424)
+* bfd_put_size: Internal. (line 22)
+* BFD_RELOC_12_PCREL: howto manager. (line 39)
+* BFD_RELOC_14: howto manager. (line 31)
+* BFD_RELOC_16: howto manager. (line 30)
+* BFD_RELOC_16_BASEREL: howto manager. (line 95)
+* BFD_RELOC_16_GOT_PCREL: howto manager. (line 52)
+* BFD_RELOC_16_GOTOFF: howto manager. (line 55)
+* BFD_RELOC_16_PCREL: howto manager. (line 38)
+* BFD_RELOC_16_PCREL_S2: howto manager. (line 107)
+* BFD_RELOC_16_PLT_PCREL: howto manager. (line 63)
+* BFD_RELOC_16_PLTOFF: howto manager. (line 67)
+* BFD_RELOC_16C_ABS20: howto manager. (line 1838)
+* BFD_RELOC_16C_ABS20_C: howto manager. (line 1839)
+* BFD_RELOC_16C_ABS24: howto manager. (line 1840)
+* BFD_RELOC_16C_ABS24_C: howto manager. (line 1841)
+* BFD_RELOC_16C_DISP04: howto manager. (line 1818)
+* BFD_RELOC_16C_DISP04_C: howto manager. (line 1819)
+* BFD_RELOC_16C_DISP08: howto manager. (line 1820)
+* BFD_RELOC_16C_DISP08_C: howto manager. (line 1821)
+* BFD_RELOC_16C_DISP16: howto manager. (line 1822)
+* BFD_RELOC_16C_DISP16_C: howto manager. (line 1823)
+* BFD_RELOC_16C_DISP24: howto manager. (line 1824)
+* BFD_RELOC_16C_DISP24_C: howto manager. (line 1825)
+* BFD_RELOC_16C_DISP24a: howto manager. (line 1826)
+* BFD_RELOC_16C_DISP24a_C: howto manager. (line 1827)
+* BFD_RELOC_16C_IMM04: howto manager. (line 1842)
+* BFD_RELOC_16C_IMM04_C: howto manager. (line 1843)
+* BFD_RELOC_16C_IMM16: howto manager. (line 1844)
+* BFD_RELOC_16C_IMM16_C: howto manager. (line 1845)
+* BFD_RELOC_16C_IMM20: howto manager. (line 1846)
+* BFD_RELOC_16C_IMM20_C: howto manager. (line 1847)
+* BFD_RELOC_16C_IMM24: howto manager. (line 1848)
+* BFD_RELOC_16C_IMM24_C: howto manager. (line 1849)
+* BFD_RELOC_16C_IMM32: howto manager. (line 1850)
+* BFD_RELOC_16C_IMM32_C: howto manager. (line 1851)
+* BFD_RELOC_16C_NUM08: howto manager. (line 1812)
+* BFD_RELOC_16C_NUM08_C: howto manager. (line 1813)
+* BFD_RELOC_16C_NUM16: howto manager. (line 1814)
+* BFD_RELOC_16C_NUM16_C: howto manager. (line 1815)
+* BFD_RELOC_16C_NUM32: howto manager. (line 1816)
+* BFD_RELOC_16C_NUM32_C: howto manager. (line 1817)
+* BFD_RELOC_16C_REG04: howto manager. (line 1828)
+* BFD_RELOC_16C_REG04_C: howto manager. (line 1829)
+* BFD_RELOC_16C_REG04a: howto manager. (line 1830)
+* BFD_RELOC_16C_REG04a_C: howto manager. (line 1831)
+* BFD_RELOC_16C_REG14: howto manager. (line 1832)
+* BFD_RELOC_16C_REG14_C: howto manager. (line 1833)
+* BFD_RELOC_16C_REG16: howto manager. (line 1834)
+* BFD_RELOC_16C_REG16_C: howto manager. (line 1835)
+* BFD_RELOC_16C_REG20: howto manager. (line 1836)
+* BFD_RELOC_16C_REG20_C: howto manager. (line 1837)
+* BFD_RELOC_23_PCREL_S2: howto manager. (line 108)
+* BFD_RELOC_24: howto manager. (line 29)
+* BFD_RELOC_24_PCREL: howto manager. (line 37)
+* BFD_RELOC_24_PLT_PCREL: howto manager. (line 62)
+* BFD_RELOC_26: howto manager. (line 28)
+* BFD_RELOC_32: howto manager. (line 27)
+* BFD_RELOC_32_BASEREL: howto manager. (line 94)
+* BFD_RELOC_32_GOT_PCREL: howto manager. (line 51)
+* BFD_RELOC_32_GOTOFF: howto manager. (line 54)
+* BFD_RELOC_32_PCREL: howto manager. (line 36)
+* BFD_RELOC_32_PCREL_S2: howto manager. (line 106)
+* BFD_RELOC_32_PLT_PCREL: howto manager. (line 61)
+* BFD_RELOC_32_PLTOFF: howto manager. (line 66)
+* BFD_RELOC_32_SECREL: howto manager. (line 48)
+* BFD_RELOC_386_COPY: howto manager. (line 505)
+* BFD_RELOC_386_GLOB_DAT: howto manager. (line 506)
+* BFD_RELOC_386_GOT32: howto manager. (line 503)
+* BFD_RELOC_386_GOTOFF: howto manager. (line 509)
+* BFD_RELOC_386_GOTPC: howto manager. (line 510)
+* BFD_RELOC_386_IRELATIVE: howto manager. (line 526)
+* BFD_RELOC_386_JUMP_SLOT: howto manager. (line 507)
+* BFD_RELOC_386_PLT32: howto manager. (line 504)
+* BFD_RELOC_386_RELATIVE: howto manager. (line 508)
+* BFD_RELOC_386_TLS_DESC: howto manager. (line 525)
+* BFD_RELOC_386_TLS_DESC_CALL: howto manager. (line 524)
+* BFD_RELOC_386_TLS_DTPMOD32: howto manager. (line 520)
+* BFD_RELOC_386_TLS_DTPOFF32: howto manager. (line 521)
+* BFD_RELOC_386_TLS_GD: howto manager. (line 515)
+* BFD_RELOC_386_TLS_GOTDESC: howto manager. (line 523)
+* BFD_RELOC_386_TLS_GOTIE: howto manager. (line 513)
+* BFD_RELOC_386_TLS_IE: howto manager. (line 512)
+* BFD_RELOC_386_TLS_IE_32: howto manager. (line 518)
+* BFD_RELOC_386_TLS_LDM: howto manager. (line 516)
+* BFD_RELOC_386_TLS_LDO_32: howto manager. (line 517)
+* BFD_RELOC_386_TLS_LE: howto manager. (line 514)
+* BFD_RELOC_386_TLS_LE_32: howto manager. (line 519)
+* BFD_RELOC_386_TLS_TPOFF: howto manager. (line 511)
+* BFD_RELOC_386_TLS_TPOFF32: howto manager. (line 522)
+* BFD_RELOC_390_12: howto manager. (line 1498)
+* BFD_RELOC_390_20: howto manager. (line 1598)
+* BFD_RELOC_390_COPY: howto manager. (line 1507)
+* BFD_RELOC_390_GLOB_DAT: howto manager. (line 1510)
+* BFD_RELOC_390_GOT12: howto manager. (line 1501)
+* BFD_RELOC_390_GOT16: howto manager. (line 1522)
+* BFD_RELOC_390_GOT20: howto manager. (line 1599)
+* BFD_RELOC_390_GOT64: howto manager. (line 1540)
+* BFD_RELOC_390_GOTENT: howto manager. (line 1546)
+* BFD_RELOC_390_GOTOFF64: howto manager. (line 1549)
+* BFD_RELOC_390_GOTPC: howto manager. (line 1519)
+* BFD_RELOC_390_GOTPCDBL: howto manager. (line 1537)
+* BFD_RELOC_390_GOTPLT12: howto manager. (line 1552)
+* BFD_RELOC_390_GOTPLT16: howto manager. (line 1555)
+* BFD_RELOC_390_GOTPLT20: howto manager. (line 1600)
+* BFD_RELOC_390_GOTPLT32: howto manager. (line 1558)
+* BFD_RELOC_390_GOTPLT64: howto manager. (line 1561)
+* BFD_RELOC_390_GOTPLTENT: howto manager. (line 1564)
+* BFD_RELOC_390_JMP_SLOT: howto manager. (line 1513)
+* BFD_RELOC_390_PC16DBL: howto manager. (line 1525)
+* BFD_RELOC_390_PC32DBL: howto manager. (line 1531)
+* BFD_RELOC_390_PLT16DBL: howto manager. (line 1528)
+* BFD_RELOC_390_PLT32: howto manager. (line 1504)
+* BFD_RELOC_390_PLT32DBL: howto manager. (line 1534)
+* BFD_RELOC_390_PLT64: howto manager. (line 1543)
+* BFD_RELOC_390_PLTOFF16: howto manager. (line 1567)
+* BFD_RELOC_390_PLTOFF32: howto manager. (line 1570)
+* BFD_RELOC_390_PLTOFF64: howto manager. (line 1573)
+* BFD_RELOC_390_RELATIVE: howto manager. (line 1516)
+* BFD_RELOC_390_TLS_DTPMOD: howto manager. (line 1593)
+* BFD_RELOC_390_TLS_DTPOFF: howto manager. (line 1594)
+* BFD_RELOC_390_TLS_GD32: howto manager. (line 1579)
+* BFD_RELOC_390_TLS_GD64: howto manager. (line 1580)
+* BFD_RELOC_390_TLS_GDCALL: howto manager. (line 1577)
+* BFD_RELOC_390_TLS_GOTIE12: howto manager. (line 1581)
+* BFD_RELOC_390_TLS_GOTIE20: howto manager. (line 1601)
+* BFD_RELOC_390_TLS_GOTIE32: howto manager. (line 1582)
+* BFD_RELOC_390_TLS_GOTIE64: howto manager. (line 1583)
+* BFD_RELOC_390_TLS_IE32: howto manager. (line 1586)
+* BFD_RELOC_390_TLS_IE64: howto manager. (line 1587)
+* BFD_RELOC_390_TLS_IEENT: howto manager. (line 1588)
+* BFD_RELOC_390_TLS_LDCALL: howto manager. (line 1578)
+* BFD_RELOC_390_TLS_LDM32: howto manager. (line 1584)
+* BFD_RELOC_390_TLS_LDM64: howto manager. (line 1585)
+* BFD_RELOC_390_TLS_LDO32: howto manager. (line 1591)
+* BFD_RELOC_390_TLS_LDO64: howto manager. (line 1592)
+* BFD_RELOC_390_TLS_LE32: howto manager. (line 1589)
+* BFD_RELOC_390_TLS_LE64: howto manager. (line 1590)
+* BFD_RELOC_390_TLS_LOAD: howto manager. (line 1576)
+* BFD_RELOC_390_TLS_TPOFF: howto manager. (line 1595)
+* BFD_RELOC_64: howto manager. (line 26)
+* BFD_RELOC_64_PCREL: howto manager. (line 35)
+* BFD_RELOC_64_PLT_PCREL: howto manager. (line 60)
+* BFD_RELOC_64_PLTOFF: howto manager. (line 65)
+* BFD_RELOC_68K_GLOB_DAT: howto manager. (line 74)
+* BFD_RELOC_68K_JMP_SLOT: howto manager. (line 75)
+* BFD_RELOC_68K_RELATIVE: howto manager. (line 76)
+* BFD_RELOC_68K_TLS_GD16: howto manager. (line 78)
+* BFD_RELOC_68K_TLS_GD32: howto manager. (line 77)
+* BFD_RELOC_68K_TLS_GD8: howto manager. (line 79)
+* BFD_RELOC_68K_TLS_IE16: howto manager. (line 87)
+* BFD_RELOC_68K_TLS_IE32: howto manager. (line 86)
+* BFD_RELOC_68K_TLS_IE8: howto manager. (line 88)
+* BFD_RELOC_68K_TLS_LDM16: howto manager. (line 81)
+* BFD_RELOC_68K_TLS_LDM32: howto manager. (line 80)
+* BFD_RELOC_68K_TLS_LDM8: howto manager. (line 82)
+* BFD_RELOC_68K_TLS_LDO16: howto manager. (line 84)
+* BFD_RELOC_68K_TLS_LDO32: howto manager. (line 83)
+* BFD_RELOC_68K_TLS_LDO8: howto manager. (line 85)
+* BFD_RELOC_68K_TLS_LE16: howto manager. (line 90)
+* BFD_RELOC_68K_TLS_LE32: howto manager. (line 89)
+* BFD_RELOC_68K_TLS_LE8: howto manager. (line 91)
+* BFD_RELOC_8: howto manager. (line 32)
+* BFD_RELOC_860_COPY: howto manager. (line 1966)
+* BFD_RELOC_860_GLOB_DAT: howto manager. (line 1967)
+* BFD_RELOC_860_HAGOT: howto manager. (line 1992)
+* BFD_RELOC_860_HAGOTOFF: howto manager. (line 1993)
+* BFD_RELOC_860_HAPC: howto manager. (line 1994)
+* BFD_RELOC_860_HIGH: howto manager. (line 1995)
+* BFD_RELOC_860_HIGHADJ: howto manager. (line 1991)
+* BFD_RELOC_860_HIGOT: howto manager. (line 1996)
+* BFD_RELOC_860_HIGOTOFF: howto manager. (line 1997)
+* BFD_RELOC_860_JUMP_SLOT: howto manager. (line 1968)
+* BFD_RELOC_860_LOGOT0: howto manager. (line 1980)
+* BFD_RELOC_860_LOGOT1: howto manager. (line 1982)
+* BFD_RELOC_860_LOGOTOFF0: howto manager. (line 1984)
+* BFD_RELOC_860_LOGOTOFF1: howto manager. (line 1986)
+* BFD_RELOC_860_LOGOTOFF2: howto manager. (line 1988)
+* BFD_RELOC_860_LOGOTOFF3: howto manager. (line 1989)
+* BFD_RELOC_860_LOPC: howto manager. (line 1990)
+* BFD_RELOC_860_LOW0: howto manager. (line 1973)
+* BFD_RELOC_860_LOW1: howto manager. (line 1975)
+* BFD_RELOC_860_LOW2: howto manager. (line 1977)
+* BFD_RELOC_860_LOW3: howto manager. (line 1979)
+* BFD_RELOC_860_PC16: howto manager. (line 1972)
+* BFD_RELOC_860_PC26: howto manager. (line 1970)
+* BFD_RELOC_860_PLT26: howto manager. (line 1971)
+* BFD_RELOC_860_RELATIVE: howto manager. (line 1969)
+* BFD_RELOC_860_SPGOT0: howto manager. (line 1981)
+* BFD_RELOC_860_SPGOT1: howto manager. (line 1983)
+* BFD_RELOC_860_SPGOTOFF0: howto manager. (line 1985)
+* BFD_RELOC_860_SPGOTOFF1: howto manager. (line 1987)
+* BFD_RELOC_860_SPLIT0: howto manager. (line 1974)
+* BFD_RELOC_860_SPLIT1: howto manager. (line 1976)
+* BFD_RELOC_860_SPLIT2: howto manager. (line 1978)
+* BFD_RELOC_8_BASEREL: howto manager. (line 99)
+* BFD_RELOC_8_FFnn: howto manager. (line 103)
+* BFD_RELOC_8_GOT_PCREL: howto manager. (line 53)
+* BFD_RELOC_8_GOTOFF: howto manager. (line 59)
+* BFD_RELOC_8_PCREL: howto manager. (line 40)
+* BFD_RELOC_8_PLT_PCREL: howto manager. (line 64)
+* BFD_RELOC_8_PLTOFF: howto manager. (line 71)
+* BFD_RELOC_ALPHA_BOH: howto manager. (line 313)
+* BFD_RELOC_ALPHA_BRSGP: howto manager. (line 296)
+* BFD_RELOC_ALPHA_BSR: howto manager. (line 305)
+* BFD_RELOC_ALPHA_CODEADDR: howto manager. (line 287)
+* BFD_RELOC_ALPHA_DTPMOD64: howto manager. (line 319)
+* BFD_RELOC_ALPHA_DTPREL16: howto manager. (line 324)
+* BFD_RELOC_ALPHA_DTPREL64: howto manager. (line 321)
+* BFD_RELOC_ALPHA_DTPREL_HI16: howto manager. (line 322)
+* BFD_RELOC_ALPHA_DTPREL_LO16: howto manager. (line 323)
+* BFD_RELOC_ALPHA_ELF_LITERAL: howto manager. (line 252)
+* BFD_RELOC_ALPHA_GOTDTPREL16: howto manager. (line 320)
+* BFD_RELOC_ALPHA_GOTTPREL16: howto manager. (line 325)
+* BFD_RELOC_ALPHA_GPDISP: howto manager. (line 246)
+* BFD_RELOC_ALPHA_GPDISP_HI16: howto manager. (line 232)
+* BFD_RELOC_ALPHA_GPDISP_LO16: howto manager. (line 240)
+* BFD_RELOC_ALPHA_GPREL_HI16: howto manager. (line 291)
+* BFD_RELOC_ALPHA_GPREL_LO16: howto manager. (line 292)
+* BFD_RELOC_ALPHA_HINT: howto manager. (line 278)
+* BFD_RELOC_ALPHA_LDA: howto manager. (line 309)
+* BFD_RELOC_ALPHA_LINKAGE: howto manager. (line 283)
+* BFD_RELOC_ALPHA_LITERAL: howto manager. (line 251)
+* BFD_RELOC_ALPHA_LITUSE: howto manager. (line 253)
+* BFD_RELOC_ALPHA_NOP: howto manager. (line 301)
+* BFD_RELOC_ALPHA_TLSGD: howto manager. (line 317)
+* BFD_RELOC_ALPHA_TLSLDM: howto manager. (line 318)
+* BFD_RELOC_ALPHA_TPREL16: howto manager. (line 329)
+* BFD_RELOC_ALPHA_TPREL64: howto manager. (line 326)
+* BFD_RELOC_ALPHA_TPREL_HI16: howto manager. (line 327)
+* BFD_RELOC_ALPHA_TPREL_LO16: howto manager. (line 328)
+* BFD_RELOC_ARC_B22_PCREL: howto manager. (line 934)
+* BFD_RELOC_ARC_B26: howto manager. (line 939)
+* BFD_RELOC_ARM_ADR_IMM: howto manager. (line 827)
+* BFD_RELOC_ARM_ADRL_IMMEDIATE: howto manager. (line 814)
+* BFD_RELOC_ARM_ALU_PC_G0: howto manager. (line 781)
+* BFD_RELOC_ARM_ALU_PC_G0_NC: howto manager. (line 780)
+* BFD_RELOC_ARM_ALU_PC_G1: howto manager. (line 783)
+* BFD_RELOC_ARM_ALU_PC_G1_NC: howto manager. (line 782)
+* BFD_RELOC_ARM_ALU_PC_G2: howto manager. (line 784)
+* BFD_RELOC_ARM_ALU_SB_G0: howto manager. (line 795)
+* BFD_RELOC_ARM_ALU_SB_G0_NC: howto manager. (line 794)
+* BFD_RELOC_ARM_ALU_SB_G1: howto manager. (line 797)
+* BFD_RELOC_ARM_ALU_SB_G1_NC: howto manager. (line 796)
+* BFD_RELOC_ARM_ALU_SB_G2: howto manager. (line 798)
+* BFD_RELOC_ARM_CP_OFF_IMM: howto manager. (line 823)
+* BFD_RELOC_ARM_CP_OFF_IMM_S2: howto manager. (line 824)
+* BFD_RELOC_ARM_GLOB_DAT: howto manager. (line 762)
+* BFD_RELOC_ARM_GOT32: howto manager. (line 763)
+* BFD_RELOC_ARM_GOTOFF: howto manager. (line 766)
+* BFD_RELOC_ARM_GOTPC: howto manager. (line 767)
+* BFD_RELOC_ARM_HWLITERAL: howto manager. (line 834)
+* BFD_RELOC_ARM_IMMEDIATE: howto manager. (line 813)
+* BFD_RELOC_ARM_IN_POOL: howto manager. (line 830)
+* BFD_RELOC_ARM_JUMP_SLOT: howto manager. (line 761)
+* BFD_RELOC_ARM_LDC_PC_G0: howto manager. (line 791)
+* BFD_RELOC_ARM_LDC_PC_G1: howto manager. (line 792)
+* BFD_RELOC_ARM_LDC_PC_G2: howto manager. (line 793)
+* BFD_RELOC_ARM_LDC_SB_G0: howto manager. (line 805)
+* BFD_RELOC_ARM_LDC_SB_G1: howto manager. (line 806)
+* BFD_RELOC_ARM_LDC_SB_G2: howto manager. (line 807)
+* BFD_RELOC_ARM_LDR_IMM: howto manager. (line 828)
+* BFD_RELOC_ARM_LDR_PC_G0: howto manager. (line 785)
+* BFD_RELOC_ARM_LDR_PC_G1: howto manager. (line 786)
+* BFD_RELOC_ARM_LDR_PC_G2: howto manager. (line 787)
+* BFD_RELOC_ARM_LDR_SB_G0: howto manager. (line 799)
+* BFD_RELOC_ARM_LDR_SB_G1: howto manager. (line 800)
+* BFD_RELOC_ARM_LDR_SB_G2: howto manager. (line 801)
+* BFD_RELOC_ARM_LDRS_PC_G0: howto manager. (line 788)
+* BFD_RELOC_ARM_LDRS_PC_G1: howto manager. (line 789)
+* BFD_RELOC_ARM_LDRS_PC_G2: howto manager. (line 790)
+* BFD_RELOC_ARM_LDRS_SB_G0: howto manager. (line 802)
+* BFD_RELOC_ARM_LDRS_SB_G1: howto manager. (line 803)
+* BFD_RELOC_ARM_LDRS_SB_G2: howto manager. (line 804)
+* BFD_RELOC_ARM_LITERAL: howto manager. (line 829)
+* BFD_RELOC_ARM_MOVT: howto manager. (line 752)
+* BFD_RELOC_ARM_MOVT_PCREL: howto manager. (line 754)
+* BFD_RELOC_ARM_MOVW: howto manager. (line 751)
+* BFD_RELOC_ARM_MOVW_PCREL: howto manager. (line 753)
+* BFD_RELOC_ARM_MULTI: howto manager. (line 822)
+* BFD_RELOC_ARM_OFFSET_IMM: howto manager. (line 725)
+* BFD_RELOC_ARM_OFFSET_IMM8: howto manager. (line 831)
+* BFD_RELOC_ARM_PCREL_BLX: howto manager. (line 696)
+* BFD_RELOC_ARM_PCREL_BRANCH: howto manager. (line 692)
+* BFD_RELOC_ARM_PCREL_CALL: howto manager. (line 706)
+* BFD_RELOC_ARM_PCREL_JUMP: howto manager. (line 710)
+* BFD_RELOC_ARM_PLT32: howto manager. (line 764)
+* BFD_RELOC_ARM_PREL31: howto manager. (line 748)
+* BFD_RELOC_ARM_RELATIVE: howto manager. (line 765)
+* BFD_RELOC_ARM_ROSEGREL32: howto manager. (line 737)
+* BFD_RELOC_ARM_SBREL32: howto manager. (line 740)
+* BFD_RELOC_ARM_SHIFT_IMM: howto manager. (line 819)
+* BFD_RELOC_ARM_SMC: howto manager. (line 820)
+* BFD_RELOC_ARM_SWI: howto manager. (line 821)
+* BFD_RELOC_ARM_T32_ADD_IMM: howto manager. (line 816)
+* BFD_RELOC_ARM_T32_ADD_PC12: howto manager. (line 818)
+* BFD_RELOC_ARM_T32_CP_OFF_IMM: howto manager. (line 825)
+* BFD_RELOC_ARM_T32_CP_OFF_IMM_S2: howto manager. (line 826)
+* BFD_RELOC_ARM_T32_IMM12: howto manager. (line 817)
+* BFD_RELOC_ARM_T32_IMMEDIATE: howto manager. (line 815)
+* BFD_RELOC_ARM_T32_OFFSET_IMM: howto manager. (line 833)
+* BFD_RELOC_ARM_T32_OFFSET_U8: howto manager. (line 832)
+* BFD_RELOC_ARM_TARGET1: howto manager. (line 733)
+* BFD_RELOC_ARM_TARGET2: howto manager. (line 743)
+* BFD_RELOC_ARM_THUMB_ADD: howto manager. (line 835)
+* BFD_RELOC_ARM_THUMB_IMM: howto manager. (line 836)
+* BFD_RELOC_ARM_THUMB_MOVT: howto manager. (line 756)
+* BFD_RELOC_ARM_THUMB_MOVT_PCREL: howto manager. (line 758)
+* BFD_RELOC_ARM_THUMB_MOVW: howto manager. (line 755)
+* BFD_RELOC_ARM_THUMB_MOVW_PCREL: howto manager. (line 757)
+* BFD_RELOC_ARM_THUMB_OFFSET: howto manager. (line 729)
+* BFD_RELOC_ARM_THUMB_SHIFT: howto manager. (line 837)
+* BFD_RELOC_ARM_TLS_DTPMOD32: howto manager. (line 774)
+* BFD_RELOC_ARM_TLS_DTPOFF32: howto manager. (line 773)
+* BFD_RELOC_ARM_TLS_GD32: howto manager. (line 770)
+* BFD_RELOC_ARM_TLS_IE32: howto manager. (line 776)
+* BFD_RELOC_ARM_TLS_LDM32: howto manager. (line 772)
+* BFD_RELOC_ARM_TLS_LDO32: howto manager. (line 771)
+* BFD_RELOC_ARM_TLS_LE32: howto manager. (line 777)
+* BFD_RELOC_ARM_TLS_TPOFF32: howto manager. (line 775)
+* BFD_RELOC_ARM_V4BX: howto manager. (line 810)
+* BFD_RELOC_AVR_13_PCREL: howto manager. (line 1399)
+* BFD_RELOC_AVR_16_PM: howto manager. (line 1403)
+* BFD_RELOC_AVR_6: howto manager. (line 1490)
+* BFD_RELOC_AVR_6_ADIW: howto manager. (line 1494)
+* BFD_RELOC_AVR_7_PCREL: howto manager. (line 1395)
+* BFD_RELOC_AVR_CALL: howto manager. (line 1482)
+* BFD_RELOC_AVR_HH8_LDI: howto manager. (line 1415)
+* BFD_RELOC_AVR_HH8_LDI_NEG: howto manager. (line 1434)
+* BFD_RELOC_AVR_HH8_LDI_PM: howto manager. (line 1463)
+* BFD_RELOC_AVR_HH8_LDI_PM_NEG: howto manager. (line 1477)
+* BFD_RELOC_AVR_HI8_LDI: howto manager. (line 1411)
+* BFD_RELOC_AVR_HI8_LDI_GS: howto manager. (line 1457)
+* BFD_RELOC_AVR_HI8_LDI_NEG: howto manager. (line 1429)
+* BFD_RELOC_AVR_HI8_LDI_PM: howto manager. (line 1453)
+* BFD_RELOC_AVR_HI8_LDI_PM_NEG: howto manager. (line 1472)
+* BFD_RELOC_AVR_LDI: howto manager. (line 1486)
+* BFD_RELOC_AVR_LO8_LDI: howto manager. (line 1407)
+* BFD_RELOC_AVR_LO8_LDI_GS: howto manager. (line 1447)
+* BFD_RELOC_AVR_LO8_LDI_NEG: howto manager. (line 1424)
+* BFD_RELOC_AVR_LO8_LDI_PM: howto manager. (line 1443)
+* BFD_RELOC_AVR_LO8_LDI_PM_NEG: howto manager. (line 1468)
+* BFD_RELOC_AVR_MS8_LDI: howto manager. (line 1420)
+* BFD_RELOC_AVR_MS8_LDI_NEG: howto manager. (line 1439)
+* BFD_RELOC_BFIN_10_PCREL: howto manager. (line 959)
+* BFD_RELOC_BFIN_11_PCREL: howto manager. (line 962)
+* BFD_RELOC_BFIN_12_PCREL_JUMP: howto manager. (line 965)
+* BFD_RELOC_BFIN_12_PCREL_JUMP_S: howto manager. (line 968)
+* BFD_RELOC_BFIN_16_HIGH: howto manager. (line 947)
+* BFD_RELOC_BFIN_16_IMM: howto manager. (line 944)
+* BFD_RELOC_BFIN_16_LOW: howto manager. (line 956)
+* BFD_RELOC_BFIN_24_PCREL_CALL_X: howto manager. (line 971)
+* BFD_RELOC_BFIN_24_PCREL_JUMP_L: howto manager. (line 974)
+* BFD_RELOC_BFIN_4_PCREL: howto manager. (line 950)
+* BFD_RELOC_BFIN_5_PCREL: howto manager. (line 953)
+* BFD_RELOC_BFIN_FUNCDESC: howto manager. (line 980)
+* BFD_RELOC_BFIN_FUNCDESC_GOT17M4: howto manager. (line 981)
+* BFD_RELOC_BFIN_FUNCDESC_GOTHI: howto manager. (line 982)
+* BFD_RELOC_BFIN_FUNCDESC_GOTLO: howto manager. (line 983)
+* BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4: howto manager. (line 985)
+* BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI: howto manager. (line 986)
+* BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO: howto manager. (line 987)
+* BFD_RELOC_BFIN_FUNCDESC_VALUE: howto manager. (line 984)
+* BFD_RELOC_BFIN_GOT: howto manager. (line 993)
+* BFD_RELOC_BFIN_GOT17M4: howto manager. (line 977)
+* BFD_RELOC_BFIN_GOTHI: howto manager. (line 978)
+* BFD_RELOC_BFIN_GOTLO: howto manager. (line 979)
+* BFD_RELOC_BFIN_GOTOFF17M4: howto manager. (line 988)
+* BFD_RELOC_BFIN_GOTOFFHI: howto manager. (line 989)
+* BFD_RELOC_BFIN_GOTOFFLO: howto manager. (line 990)
+* BFD_RELOC_BFIN_PLTPC: howto manager. (line 996)
+* bfd_reloc_code_type: howto manager. (line 10)
+* BFD_RELOC_CR16_ABS20: howto manager. (line 1866)
+* BFD_RELOC_CR16_ABS24: howto manager. (line 1867)
+* BFD_RELOC_CR16_DISP16: howto manager. (line 1877)
+* BFD_RELOC_CR16_DISP20: howto manager. (line 1878)
+* BFD_RELOC_CR16_DISP24: howto manager. (line 1879)
+* BFD_RELOC_CR16_DISP24a: howto manager. (line 1880)
+* BFD_RELOC_CR16_DISP4: howto manager. (line 1875)
+* BFD_RELOC_CR16_DISP8: howto manager. (line 1876)
+* BFD_RELOC_CR16_GLOB_DAT: howto manager. (line 1886)
+* BFD_RELOC_CR16_GOT_REGREL20: howto manager. (line 1884)
+* BFD_RELOC_CR16_GOTC_REGREL20: howto manager. (line 1885)
+* BFD_RELOC_CR16_IMM16: howto manager. (line 1870)
+* BFD_RELOC_CR16_IMM20: howto manager. (line 1871)
+* BFD_RELOC_CR16_IMM24: howto manager. (line 1872)
+* BFD_RELOC_CR16_IMM32: howto manager. (line 1873)
+* BFD_RELOC_CR16_IMM32a: howto manager. (line 1874)
+* BFD_RELOC_CR16_IMM4: howto manager. (line 1868)
+* BFD_RELOC_CR16_IMM8: howto manager. (line 1869)
+* BFD_RELOC_CR16_NUM16: howto manager. (line 1855)
+* BFD_RELOC_CR16_NUM32: howto manager. (line 1856)
+* BFD_RELOC_CR16_NUM32a: howto manager. (line 1857)
+* BFD_RELOC_CR16_NUM8: howto manager. (line 1854)
+* BFD_RELOC_CR16_REGREL0: howto manager. (line 1858)
+* BFD_RELOC_CR16_REGREL14: howto manager. (line 1861)
+* BFD_RELOC_CR16_REGREL14a: howto manager. (line 1862)
+* BFD_RELOC_CR16_REGREL16: howto manager. (line 1863)
+* BFD_RELOC_CR16_REGREL20: howto manager. (line 1864)
+* BFD_RELOC_CR16_REGREL20a: howto manager. (line 1865)
+* BFD_RELOC_CR16_REGREL4: howto manager. (line 1859)
+* BFD_RELOC_CR16_REGREL4a: howto manager. (line 1860)
+* BFD_RELOC_CR16_SWITCH16: howto manager. (line 1882)
+* BFD_RELOC_CR16_SWITCH32: howto manager. (line 1883)
+* BFD_RELOC_CR16_SWITCH8: howto manager. (line 1881)
+* BFD_RELOC_CRIS_16_DTPREL: howto manager. (line 1957)
+* BFD_RELOC_CRIS_16_GOT: howto manager. (line 1933)
+* BFD_RELOC_CRIS_16_GOT_GD: howto manager. (line 1953)
+* BFD_RELOC_CRIS_16_GOT_TPREL: howto manager. (line 1959)
+* BFD_RELOC_CRIS_16_GOTPLT: howto manager. (line 1939)
+* BFD_RELOC_CRIS_16_TPREL: howto manager. (line 1961)
+* BFD_RELOC_CRIS_32_DTPREL: howto manager. (line 1956)
+* BFD_RELOC_CRIS_32_GD: howto manager. (line 1954)
+* BFD_RELOC_CRIS_32_GOT: howto manager. (line 1930)
+* BFD_RELOC_CRIS_32_GOT_GD: howto manager. (line 1952)
+* BFD_RELOC_CRIS_32_GOT_TPREL: howto manager. (line 1958)
+* BFD_RELOC_CRIS_32_GOTPLT: howto manager. (line 1936)
+* BFD_RELOC_CRIS_32_GOTREL: howto manager. (line 1942)
+* BFD_RELOC_CRIS_32_IE: howto manager. (line 1963)
+* BFD_RELOC_CRIS_32_PLT_GOTREL: howto manager. (line 1945)
+* BFD_RELOC_CRIS_32_PLT_PCREL: howto manager. (line 1948)
+* BFD_RELOC_CRIS_32_TPREL: howto manager. (line 1960)
+* BFD_RELOC_CRIS_BDISP8: howto manager. (line 1911)
+* BFD_RELOC_CRIS_COPY: howto manager. (line 1924)
+* BFD_RELOC_CRIS_DTP: howto manager. (line 1955)
+* BFD_RELOC_CRIS_DTPMOD: howto manager. (line 1962)
+* BFD_RELOC_CRIS_GLOB_DAT: howto manager. (line 1925)
+* BFD_RELOC_CRIS_JUMP_SLOT: howto manager. (line 1926)
+* BFD_RELOC_CRIS_LAPCQ_OFFSET: howto manager. (line 1919)
+* BFD_RELOC_CRIS_RELATIVE: howto manager. (line 1927)
+* BFD_RELOC_CRIS_SIGNED_16: howto manager. (line 1917)
+* BFD_RELOC_CRIS_SIGNED_6: howto manager. (line 1913)
+* BFD_RELOC_CRIS_SIGNED_8: howto manager. (line 1915)
+* BFD_RELOC_CRIS_UNSIGNED_16: howto manager. (line 1918)
+* BFD_RELOC_CRIS_UNSIGNED_4: howto manager. (line 1920)
+* BFD_RELOC_CRIS_UNSIGNED_5: howto manager. (line 1912)
+* BFD_RELOC_CRIS_UNSIGNED_6: howto manager. (line 1914)
+* BFD_RELOC_CRIS_UNSIGNED_8: howto manager. (line 1916)
+* BFD_RELOC_CRX_ABS16: howto manager. (line 1899)
+* BFD_RELOC_CRX_ABS32: howto manager. (line 1900)
+* BFD_RELOC_CRX_IMM16: howto manager. (line 1904)
+* BFD_RELOC_CRX_IMM32: howto manager. (line 1905)
+* BFD_RELOC_CRX_NUM16: howto manager. (line 1902)
+* BFD_RELOC_CRX_NUM32: howto manager. (line 1903)
+* BFD_RELOC_CRX_NUM8: howto manager. (line 1901)
+* BFD_RELOC_CRX_REGREL12: howto manager. (line 1895)
+* BFD_RELOC_CRX_REGREL22: howto manager. (line 1896)
+* BFD_RELOC_CRX_REGREL28: howto manager. (line 1897)
+* BFD_RELOC_CRX_REGREL32: howto manager. (line 1898)
+* BFD_RELOC_CRX_REL16: howto manager. (line 1892)
+* BFD_RELOC_CRX_REL24: howto manager. (line 1893)
+* BFD_RELOC_CRX_REL32: howto manager. (line 1894)
+* BFD_RELOC_CRX_REL4: howto manager. (line 1889)
+* BFD_RELOC_CRX_REL8: howto manager. (line 1890)
+* BFD_RELOC_CRX_REL8_CMP: howto manager. (line 1891)
+* BFD_RELOC_CRX_SWITCH16: howto manager. (line 1907)
+* BFD_RELOC_CRX_SWITCH32: howto manager. (line 1908)
+* BFD_RELOC_CRX_SWITCH8: howto manager. (line 1906)
+* BFD_RELOC_CTOR: howto manager. (line 686)
+* BFD_RELOC_D10V_10_PCREL_L: howto manager. (line 1063)
+* BFD_RELOC_D10V_10_PCREL_R: howto manager. (line 1059)
+* BFD_RELOC_D10V_18: howto manager. (line 1068)
+* BFD_RELOC_D10V_18_PCREL: howto manager. (line 1071)
+* BFD_RELOC_D30V_15: howto manager. (line 1086)
+* BFD_RELOC_D30V_15_PCREL: howto manager. (line 1090)
+* BFD_RELOC_D30V_15_PCREL_R: howto manager. (line 1094)
+* BFD_RELOC_D30V_21: howto manager. (line 1099)
+* BFD_RELOC_D30V_21_PCREL: howto manager. (line 1103)
+* BFD_RELOC_D30V_21_PCREL_R: howto manager. (line 1107)
+* BFD_RELOC_D30V_32: howto manager. (line 1112)
+* BFD_RELOC_D30V_32_PCREL: howto manager. (line 1115)
+* BFD_RELOC_D30V_6: howto manager. (line 1074)
+* BFD_RELOC_D30V_9_PCREL: howto manager. (line 1077)
+* BFD_RELOC_D30V_9_PCREL_R: howto manager. (line 1081)
+* BFD_RELOC_DLX_HI16_S: howto manager. (line 1118)
+* BFD_RELOC_DLX_JMP26: howto manager. (line 1124)
+* BFD_RELOC_DLX_LO16: howto manager. (line 1121)
+* BFD_RELOC_FR30_10_IN_8: howto manager. (line 1303)
+* BFD_RELOC_FR30_12_PCREL: howto manager. (line 1311)
+* BFD_RELOC_FR30_20: howto manager. (line 1287)
+* BFD_RELOC_FR30_48: howto manager. (line 1284)
+* BFD_RELOC_FR30_6_IN_4: howto manager. (line 1291)
+* BFD_RELOC_FR30_8_IN_8: howto manager. (line 1295)
+* BFD_RELOC_FR30_9_IN_8: howto manager. (line 1299)
+* BFD_RELOC_FR30_9_PCREL: howto manager. (line 1307)
+* BFD_RELOC_FRV_FUNCDESC: howto manager. (line 438)
+* BFD_RELOC_FRV_FUNCDESC_GOT12: howto manager. (line 439)
+* BFD_RELOC_FRV_FUNCDESC_GOTHI: howto manager. (line 440)
+* BFD_RELOC_FRV_FUNCDESC_GOTLO: howto manager. (line 441)
+* BFD_RELOC_FRV_FUNCDESC_GOTOFF12: howto manager. (line 443)
+* BFD_RELOC_FRV_FUNCDESC_GOTOFFHI: howto manager. (line 444)
+* BFD_RELOC_FRV_FUNCDESC_GOTOFFLO: howto manager. (line 445)
+* BFD_RELOC_FRV_FUNCDESC_VALUE: howto manager. (line 442)
+* BFD_RELOC_FRV_GETTLSOFF: howto manager. (line 449)
+* BFD_RELOC_FRV_GETTLSOFF_RELAX: howto manager. (line 462)
+* BFD_RELOC_FRV_GOT12: howto manager. (line 435)
+* BFD_RELOC_FRV_GOTHI: howto manager. (line 436)
+* BFD_RELOC_FRV_GOTLO: howto manager. (line 437)
+* BFD_RELOC_FRV_GOTOFF12: howto manager. (line 446)
+* BFD_RELOC_FRV_GOTOFFHI: howto manager. (line 447)
+* BFD_RELOC_FRV_GOTOFFLO: howto manager. (line 448)
+* BFD_RELOC_FRV_GOTTLSDESC12: howto manager. (line 451)
+* BFD_RELOC_FRV_GOTTLSDESCHI: howto manager. (line 452)
+* BFD_RELOC_FRV_GOTTLSDESCLO: howto manager. (line 453)
+* BFD_RELOC_FRV_GOTTLSOFF12: howto manager. (line 457)
+* BFD_RELOC_FRV_GOTTLSOFFHI: howto manager. (line 458)
+* BFD_RELOC_FRV_GOTTLSOFFLO: howto manager. (line 459)
+* BFD_RELOC_FRV_GPREL12: howto manager. (line 430)
+* BFD_RELOC_FRV_GPREL32: howto manager. (line 432)
+* BFD_RELOC_FRV_GPRELHI: howto manager. (line 433)
+* BFD_RELOC_FRV_GPRELLO: howto manager. (line 434)
+* BFD_RELOC_FRV_GPRELU12: howto manager. (line 431)
+* BFD_RELOC_FRV_HI16: howto manager. (line 429)
+* BFD_RELOC_FRV_LABEL16: howto manager. (line 426)
+* BFD_RELOC_FRV_LABEL24: howto manager. (line 427)
+* BFD_RELOC_FRV_LO16: howto manager. (line 428)
+* BFD_RELOC_FRV_TLSDESC_RELAX: howto manager. (line 461)
+* BFD_RELOC_FRV_TLSDESC_VALUE: howto manager. (line 450)
+* BFD_RELOC_FRV_TLSMOFF: howto manager. (line 464)
+* BFD_RELOC_FRV_TLSMOFF12: howto manager. (line 454)
+* BFD_RELOC_FRV_TLSMOFFHI: howto manager. (line 455)
+* BFD_RELOC_FRV_TLSMOFFLO: howto manager. (line 456)
+* BFD_RELOC_FRV_TLSOFF: howto manager. (line 460)
+* BFD_RELOC_FRV_TLSOFF_RELAX: howto manager. (line 463)
+* BFD_RELOC_GPREL16: howto manager. (line 121)
+* BFD_RELOC_GPREL32: howto manager. (line 122)
+* BFD_RELOC_H8_DIR16A8: howto manager. (line 2004)
+* BFD_RELOC_H8_DIR16R8: howto manager. (line 2005)
+* BFD_RELOC_H8_DIR24A8: howto manager. (line 2006)
+* BFD_RELOC_H8_DIR24R8: howto manager. (line 2007)
+* BFD_RELOC_H8_DIR32A16: howto manager. (line 2008)
+* BFD_RELOC_HI16: howto manager. (line 342)
+* BFD_RELOC_HI16_BASEREL: howto manager. (line 97)
+* BFD_RELOC_HI16_GOTOFF: howto manager. (line 57)
+* BFD_RELOC_HI16_PCREL: howto manager. (line 354)
+* BFD_RELOC_HI16_PLTOFF: howto manager. (line 69)
+* BFD_RELOC_HI16_S: howto manager. (line 345)
+* BFD_RELOC_HI16_S_BASEREL: howto manager. (line 98)
+* BFD_RELOC_HI16_S_GOTOFF: howto manager. (line 58)
+* BFD_RELOC_HI16_S_PCREL: howto manager. (line 357)
+* BFD_RELOC_HI16_S_PLTOFF: howto manager. (line 70)
+* BFD_RELOC_HI22: howto manager. (line 116)
+* BFD_RELOC_I370_D12: howto manager. (line 683)
+* BFD_RELOC_I960_CALLJ: howto manager. (line 128)
+* BFD_RELOC_IA64_COPY: howto manager. (line 1748)
+* BFD_RELOC_IA64_DIR32LSB: howto manager. (line 1693)
+* BFD_RELOC_IA64_DIR32MSB: howto manager. (line 1692)
+* BFD_RELOC_IA64_DIR64LSB: howto manager. (line 1695)
+* BFD_RELOC_IA64_DIR64MSB: howto manager. (line 1694)
+* BFD_RELOC_IA64_DTPMOD64LSB: howto manager. (line 1758)
+* BFD_RELOC_IA64_DTPMOD64MSB: howto manager. (line 1757)
+* BFD_RELOC_IA64_DTPREL14: howto manager. (line 1760)
+* BFD_RELOC_IA64_DTPREL22: howto manager. (line 1761)
+* BFD_RELOC_IA64_DTPREL32LSB: howto manager. (line 1764)
+* BFD_RELOC_IA64_DTPREL32MSB: howto manager. (line 1763)
+* BFD_RELOC_IA64_DTPREL64I: howto manager. (line 1762)
+* BFD_RELOC_IA64_DTPREL64LSB: howto manager. (line 1766)
+* BFD_RELOC_IA64_DTPREL64MSB: howto manager. (line 1765)
+* BFD_RELOC_IA64_FPTR32LSB: howto manager. (line 1710)
+* BFD_RELOC_IA64_FPTR32MSB: howto manager. (line 1709)
+* BFD_RELOC_IA64_FPTR64I: howto manager. (line 1708)
+* BFD_RELOC_IA64_FPTR64LSB: howto manager. (line 1712)
+* BFD_RELOC_IA64_FPTR64MSB: howto manager. (line 1711)
+* BFD_RELOC_IA64_GPREL22: howto manager. (line 1696)
+* BFD_RELOC_IA64_GPREL32LSB: howto manager. (line 1699)
+* BFD_RELOC_IA64_GPREL32MSB: howto manager. (line 1698)
+* BFD_RELOC_IA64_GPREL64I: howto manager. (line 1697)
+* BFD_RELOC_IA64_GPREL64LSB: howto manager. (line 1701)
+* BFD_RELOC_IA64_GPREL64MSB: howto manager. (line 1700)
+* BFD_RELOC_IA64_IMM14: howto manager. (line 1689)
+* BFD_RELOC_IA64_IMM22: howto manager. (line 1690)
+* BFD_RELOC_IA64_IMM64: howto manager. (line 1691)
+* BFD_RELOC_IA64_IPLTLSB: howto manager. (line 1747)
+* BFD_RELOC_IA64_IPLTMSB: howto manager. (line 1746)
+* BFD_RELOC_IA64_LDXMOV: howto manager. (line 1750)
+* BFD_RELOC_IA64_LTOFF22: howto manager. (line 1702)
+* BFD_RELOC_IA64_LTOFF22X: howto manager. (line 1749)
+* BFD_RELOC_IA64_LTOFF64I: howto manager. (line 1703)
+* BFD_RELOC_IA64_LTOFF_DTPMOD22: howto manager. (line 1759)
+* BFD_RELOC_IA64_LTOFF_DTPREL22: howto manager. (line 1767)
+* BFD_RELOC_IA64_LTOFF_FPTR22: howto manager. (line 1724)
+* BFD_RELOC_IA64_LTOFF_FPTR32LSB: howto manager. (line 1727)
+* BFD_RELOC_IA64_LTOFF_FPTR32MSB: howto manager. (line 1726)
+* BFD_RELOC_IA64_LTOFF_FPTR64I: howto manager. (line 1725)
+* BFD_RELOC_IA64_LTOFF_FPTR64LSB: howto manager. (line 1729)
+* BFD_RELOC_IA64_LTOFF_FPTR64MSB: howto manager. (line 1728)
+* BFD_RELOC_IA64_LTOFF_TPREL22: howto manager. (line 1756)
+* BFD_RELOC_IA64_LTV32LSB: howto manager. (line 1743)
+* BFD_RELOC_IA64_LTV32MSB: howto manager. (line 1742)
+* BFD_RELOC_IA64_LTV64LSB: howto manager. (line 1745)
+* BFD_RELOC_IA64_LTV64MSB: howto manager. (line 1744)
+* BFD_RELOC_IA64_PCREL21B: howto manager. (line 1713)
+* BFD_RELOC_IA64_PCREL21BI: howto manager. (line 1714)
+* BFD_RELOC_IA64_PCREL21F: howto manager. (line 1716)
+* BFD_RELOC_IA64_PCREL21M: howto manager. (line 1715)
+* BFD_RELOC_IA64_PCREL22: howto manager. (line 1717)
+* BFD_RELOC_IA64_PCREL32LSB: howto manager. (line 1721)
+* BFD_RELOC_IA64_PCREL32MSB: howto manager. (line 1720)
+* BFD_RELOC_IA64_PCREL60B: howto manager. (line 1718)
+* BFD_RELOC_IA64_PCREL64I: howto manager. (line 1719)
+* BFD_RELOC_IA64_PCREL64LSB: howto manager. (line 1723)
+* BFD_RELOC_IA64_PCREL64MSB: howto manager. (line 1722)
+* BFD_RELOC_IA64_PLTOFF22: howto manager. (line 1704)
+* BFD_RELOC_IA64_PLTOFF64I: howto manager. (line 1705)
+* BFD_RELOC_IA64_PLTOFF64LSB: howto manager. (line 1707)
+* BFD_RELOC_IA64_PLTOFF64MSB: howto manager. (line 1706)
+* BFD_RELOC_IA64_REL32LSB: howto manager. (line 1739)
+* BFD_RELOC_IA64_REL32MSB: howto manager. (line 1738)
+* BFD_RELOC_IA64_REL64LSB: howto manager. (line 1741)
+* BFD_RELOC_IA64_REL64MSB: howto manager. (line 1740)
+* BFD_RELOC_IA64_SECREL32LSB: howto manager. (line 1735)
+* BFD_RELOC_IA64_SECREL32MSB: howto manager. (line 1734)
+* BFD_RELOC_IA64_SECREL64LSB: howto manager. (line 1737)
+* BFD_RELOC_IA64_SECREL64MSB: howto manager. (line 1736)
+* BFD_RELOC_IA64_SEGREL32LSB: howto manager. (line 1731)
+* BFD_RELOC_IA64_SEGREL32MSB: howto manager. (line 1730)
+* BFD_RELOC_IA64_SEGREL64LSB: howto manager. (line 1733)
+* BFD_RELOC_IA64_SEGREL64MSB: howto manager. (line 1732)
+* BFD_RELOC_IA64_TPREL14: howto manager. (line 1751)
+* BFD_RELOC_IA64_TPREL22: howto manager. (line 1752)
+* BFD_RELOC_IA64_TPREL64I: howto manager. (line 1753)
+* BFD_RELOC_IA64_TPREL64LSB: howto manager. (line 1755)
+* BFD_RELOC_IA64_TPREL64MSB: howto manager. (line 1754)
+* BFD_RELOC_IP2K_ADDR16CJP: howto manager. (line 1641)
+* BFD_RELOC_IP2K_BANK: howto manager. (line 1638)
+* BFD_RELOC_IP2K_EX8DATA: howto manager. (line 1649)
+* BFD_RELOC_IP2K_FR9: howto manager. (line 1635)
+* BFD_RELOC_IP2K_FR_OFFSET: howto manager. (line 1662)
+* BFD_RELOC_IP2K_HI8DATA: howto manager. (line 1648)
+* BFD_RELOC_IP2K_HI8INSN: howto manager. (line 1653)
+* BFD_RELOC_IP2K_LO8DATA: howto manager. (line 1647)
+* BFD_RELOC_IP2K_LO8INSN: howto manager. (line 1652)
+* BFD_RELOC_IP2K_PAGE3: howto manager. (line 1644)
+* BFD_RELOC_IP2K_PC_SKIP: howto manager. (line 1656)
+* BFD_RELOC_IP2K_TEXT: howto manager. (line 1659)
+* BFD_RELOC_IQ2000_OFFSET_16: howto manager. (line 2058)
+* BFD_RELOC_IQ2000_OFFSET_21: howto manager. (line 2059)
+* BFD_RELOC_IQ2000_UHI16: howto manager. (line 2060)
+* BFD_RELOC_LM32_16_GOT: howto manager. (line 2165)
+* BFD_RELOC_LM32_BRANCH: howto manager. (line 2164)
+* BFD_RELOC_LM32_CALL: howto manager. (line 2163)
+* BFD_RELOC_LM32_COPY: howto manager. (line 2168)
+* BFD_RELOC_LM32_GLOB_DAT: howto manager. (line 2169)
+* BFD_RELOC_LM32_GOTOFF_HI16: howto manager. (line 2166)
+* BFD_RELOC_LM32_GOTOFF_LO16: howto manager. (line 2167)
+* BFD_RELOC_LM32_JMP_SLOT: howto manager. (line 2170)
+* BFD_RELOC_LM32_RELATIVE: howto manager. (line 2171)
+* BFD_RELOC_LO10: howto manager. (line 117)
+* BFD_RELOC_LO16: howto manager. (line 351)
+* BFD_RELOC_LO16_BASEREL: howto manager. (line 96)
+* BFD_RELOC_LO16_GOTOFF: howto manager. (line 56)
+* BFD_RELOC_LO16_PCREL: howto manager. (line 360)
+* BFD_RELOC_LO16_PLTOFF: howto manager. (line 68)
+* BFD_RELOC_M32C_HI8: howto manager. (line 1127)
+* BFD_RELOC_M32C_RL_1ADDR: howto manager. (line 1129)
+* BFD_RELOC_M32C_RL_2ADDR: howto manager. (line 1130)
+* BFD_RELOC_M32C_RL_JUMP: howto manager. (line 1128)
+* BFD_RELOC_M32R_10_PCREL: howto manager. (line 1137)
+* BFD_RELOC_M32R_18_PCREL: howto manager. (line 1141)
+* BFD_RELOC_M32R_24: howto manager. (line 1133)
+* BFD_RELOC_M32R_26_PCREL: howto manager. (line 1144)
+* BFD_RELOC_M32R_26_PLTREL: howto manager. (line 1163)
+* BFD_RELOC_M32R_COPY: howto manager. (line 1164)
+* BFD_RELOC_M32R_GLOB_DAT: howto manager. (line 1165)
+* BFD_RELOC_M32R_GOT16_HI_SLO: howto manager. (line 1174)
+* BFD_RELOC_M32R_GOT16_HI_ULO: howto manager. (line 1173)
+* BFD_RELOC_M32R_GOT16_LO: howto manager. (line 1175)
+* BFD_RELOC_M32R_GOT24: howto manager. (line 1162)
+* BFD_RELOC_M32R_GOTOFF: howto manager. (line 1168)
+* BFD_RELOC_M32R_GOTOFF_HI_SLO: howto manager. (line 1170)
+* BFD_RELOC_M32R_GOTOFF_HI_ULO: howto manager. (line 1169)
+* BFD_RELOC_M32R_GOTOFF_LO: howto manager. (line 1171)
+* BFD_RELOC_M32R_GOTPC24: howto manager. (line 1172)
+* BFD_RELOC_M32R_GOTPC_HI_SLO: howto manager. (line 1177)
+* BFD_RELOC_M32R_GOTPC_HI_ULO: howto manager. (line 1176)
+* BFD_RELOC_M32R_GOTPC_LO: howto manager. (line 1178)
+* BFD_RELOC_M32R_HI16_SLO: howto manager. (line 1151)
+* BFD_RELOC_M32R_HI16_ULO: howto manager. (line 1147)
+* BFD_RELOC_M32R_JMP_SLOT: howto manager. (line 1166)
+* BFD_RELOC_M32R_LO16: howto manager. (line 1155)
+* BFD_RELOC_M32R_RELATIVE: howto manager. (line 1167)
+* BFD_RELOC_M32R_SDA16: howto manager. (line 1158)
+* BFD_RELOC_M68HC11_24: howto manager. (line 1803)
+* BFD_RELOC_M68HC11_3B: howto manager. (line 1778)
+* BFD_RELOC_M68HC11_HI8: howto manager. (line 1770)
+* BFD_RELOC_M68HC11_LO16: howto manager. (line 1792)
+* BFD_RELOC_M68HC11_LO8: howto manager. (line 1774)
+* BFD_RELOC_M68HC11_PAGE: howto manager. (line 1798)
+* BFD_RELOC_M68HC11_RL_GROUP: howto manager. (line 1787)
+* BFD_RELOC_M68HC11_RL_JUMP: howto manager. (line 1781)
+* BFD_RELOC_M68HC12_5B: howto manager. (line 1809)
+* BFD_RELOC_MACH_O_PAIR: howto manager. (line 2178)
+* BFD_RELOC_MACH_O_SECTDIFF: howto manager. (line 2174)
+* BFD_RELOC_MCORE_PCREL_32: howto manager. (line 1318)
+* BFD_RELOC_MCORE_PCREL_IMM11BY2: howto manager. (line 1316)
+* BFD_RELOC_MCORE_PCREL_IMM4BY2: howto manager. (line 1317)
+* BFD_RELOC_MCORE_PCREL_IMM8BY4: howto manager. (line 1315)
+* BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2: howto manager. (line 1319)
+* BFD_RELOC_MCORE_RVA: howto manager. (line 1320)
+* BFD_RELOC_MEP_16: howto manager. (line 1324)
+* BFD_RELOC_MEP_32: howto manager. (line 1325)
+* BFD_RELOC_MEP_8: howto manager. (line 1323)
+* BFD_RELOC_MEP_ADDR24A4: howto manager. (line 1340)
+* BFD_RELOC_MEP_GNU_VTENTRY: howto manager. (line 1342)
+* BFD_RELOC_MEP_GNU_VTINHERIT: howto manager. (line 1341)
+* BFD_RELOC_MEP_GPREL: howto manager. (line 1334)
+* BFD_RELOC_MEP_HI16S: howto manager. (line 1333)
+* BFD_RELOC_MEP_HI16U: howto manager. (line 1332)
+* BFD_RELOC_MEP_LOW16: howto manager. (line 1331)
+* BFD_RELOC_MEP_PCABS24A2: howto manager. (line 1330)
+* BFD_RELOC_MEP_PCREL12A2: howto manager. (line 1327)
+* BFD_RELOC_MEP_PCREL17A2: howto manager. (line 1328)
+* BFD_RELOC_MEP_PCREL24A2: howto manager. (line 1329)
+* BFD_RELOC_MEP_PCREL8A2: howto manager. (line 1326)
+* BFD_RELOC_MEP_TPREL: howto manager. (line 1335)
+* BFD_RELOC_MEP_TPREL7: howto manager. (line 1336)
+* BFD_RELOC_MEP_TPREL7A2: howto manager. (line 1337)
+* BFD_RELOC_MEP_TPREL7A4: howto manager. (line 1338)
+* BFD_RELOC_MEP_UIMM24: howto manager. (line 1339)
+* BFD_RELOC_MICROBLAZE_32_GOTOFF: howto manager. (line 2225)
+* BFD_RELOC_MICROBLAZE_32_LO: howto manager. (line 2181)
+* BFD_RELOC_MICROBLAZE_32_LO_PCREL: howto manager. (line 2185)
+* BFD_RELOC_MICROBLAZE_32_ROSDA: howto manager. (line 2189)
+* BFD_RELOC_MICROBLAZE_32_RWSDA: howto manager. (line 2193)
+* BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM: howto manager. (line 2197)
+* BFD_RELOC_MICROBLAZE_64_GOT: howto manager. (line 2211)
+* BFD_RELOC_MICROBLAZE_64_GOTOFF: howto manager. (line 2220)
+* BFD_RELOC_MICROBLAZE_64_GOTPC: howto manager. (line 2206)
+* BFD_RELOC_MICROBLAZE_64_NONE: howto manager. (line 2201)
+* BFD_RELOC_MICROBLAZE_64_PLT: howto manager. (line 2215)
+* BFD_RELOC_MICROBLAZE_COPY: howto manager. (line 2229)
+* BFD_RELOC_MIPS16_CALL16: howto manager. (line 364)
+* BFD_RELOC_MIPS16_GOT16: howto manager. (line 363)
+* BFD_RELOC_MIPS16_GPREL: howto manager. (line 339)
+* BFD_RELOC_MIPS16_HI16: howto manager. (line 368)
+* BFD_RELOC_MIPS16_HI16_S: howto manager. (line 371)
+* BFD_RELOC_MIPS16_JMP: howto manager. (line 336)
+* BFD_RELOC_MIPS16_LO16: howto manager. (line 377)
+* BFD_RELOC_MIPS_CALL16: howto manager. (line 384)
+* BFD_RELOC_MIPS_CALL_HI16: howto manager. (line 387)
+* BFD_RELOC_MIPS_CALL_LO16: howto manager. (line 388)
+* BFD_RELOC_MIPS_COPY: howto manager. (line 419)
+* BFD_RELOC_MIPS_DELETE: howto manager. (line 397)
+* BFD_RELOC_MIPS_GOT16: howto manager. (line 383)
+* BFD_RELOC_MIPS_GOT_DISP: howto manager. (line 392)
+* BFD_RELOC_MIPS_GOT_HI16: howto manager. (line 385)
+* BFD_RELOC_MIPS_GOT_LO16: howto manager. (line 386)
+* BFD_RELOC_MIPS_GOT_OFST: howto manager. (line 391)
+* BFD_RELOC_MIPS_GOT_PAGE: howto manager. (line 390)
+* BFD_RELOC_MIPS_HIGHER: howto manager. (line 399)
+* BFD_RELOC_MIPS_HIGHEST: howto manager. (line 398)
+* BFD_RELOC_MIPS_INSERT_A: howto manager. (line 395)
+* BFD_RELOC_MIPS_INSERT_B: howto manager. (line 396)
+* BFD_RELOC_MIPS_JALR: howto manager. (line 403)
+* BFD_RELOC_MIPS_JMP: howto manager. (line 332)
+* BFD_RELOC_MIPS_JUMP_SLOT: howto manager. (line 420)
+* BFD_RELOC_MIPS_LITERAL: howto manager. (line 380)
+* BFD_RELOC_MIPS_REL16: howto manager. (line 401)
+* BFD_RELOC_MIPS_RELGOT: howto manager. (line 402)
+* BFD_RELOC_MIPS_SCN_DISP: howto manager. (line 400)
+* BFD_RELOC_MIPS_SHIFT5: howto manager. (line 393)
+* BFD_RELOC_MIPS_SHIFT6: howto manager. (line 394)
+* BFD_RELOC_MIPS_SUB: howto manager. (line 389)
+* BFD_RELOC_MIPS_TLS_DTPMOD32: howto manager. (line 404)
+* BFD_RELOC_MIPS_TLS_DTPMOD64: howto manager. (line 406)
+* BFD_RELOC_MIPS_TLS_DTPREL32: howto manager. (line 405)
+* BFD_RELOC_MIPS_TLS_DTPREL64: howto manager. (line 407)
+* BFD_RELOC_MIPS_TLS_DTPREL_HI16: howto manager. (line 410)
+* BFD_RELOC_MIPS_TLS_DTPREL_LO16: howto manager. (line 411)
+* BFD_RELOC_MIPS_TLS_GD: howto manager. (line 408)
+* BFD_RELOC_MIPS_TLS_GOTTPREL: howto manager. (line 412)
+* BFD_RELOC_MIPS_TLS_LDM: howto manager. (line 409)
+* BFD_RELOC_MIPS_TLS_TPREL32: howto manager. (line 413)
+* BFD_RELOC_MIPS_TLS_TPREL64: howto manager. (line 414)
+* BFD_RELOC_MIPS_TLS_TPREL_HI16: howto manager. (line 415)
+* BFD_RELOC_MIPS_TLS_TPREL_LO16: howto manager. (line 416)
+* BFD_RELOC_MMIX_ADDR19: howto manager. (line 1371)
+* BFD_RELOC_MMIX_ADDR27: howto manager. (line 1375)
+* BFD_RELOC_MMIX_BASE_PLUS_OFFSET: howto manager. (line 1387)
+* BFD_RELOC_MMIX_CBRANCH: howto manager. (line 1351)
+* BFD_RELOC_MMIX_CBRANCH_1: howto manager. (line 1353)
+* BFD_RELOC_MMIX_CBRANCH_2: howto manager. (line 1354)
+* BFD_RELOC_MMIX_CBRANCH_3: howto manager. (line 1355)
+* BFD_RELOC_MMIX_CBRANCH_J: howto manager. (line 1352)
+* BFD_RELOC_MMIX_GETA: howto manager. (line 1345)
+* BFD_RELOC_MMIX_GETA_1: howto manager. (line 1346)
+* BFD_RELOC_MMIX_GETA_2: howto manager. (line 1347)
+* BFD_RELOC_MMIX_GETA_3: howto manager. (line 1348)
+* BFD_RELOC_MMIX_JMP: howto manager. (line 1365)
+* BFD_RELOC_MMIX_JMP_1: howto manager. (line 1366)
+* BFD_RELOC_MMIX_JMP_2: howto manager. (line 1367)
+* BFD_RELOC_MMIX_JMP_3: howto manager. (line 1368)
+* BFD_RELOC_MMIX_LOCAL: howto manager. (line 1391)
+* BFD_RELOC_MMIX_PUSHJ: howto manager. (line 1358)
+* BFD_RELOC_MMIX_PUSHJ_1: howto manager. (line 1359)
+* BFD_RELOC_MMIX_PUSHJ_2: howto manager. (line 1360)
+* BFD_RELOC_MMIX_PUSHJ_3: howto manager. (line 1361)
+* BFD_RELOC_MMIX_PUSHJ_STUBBABLE: howto manager. (line 1362)
+* BFD_RELOC_MMIX_REG: howto manager. (line 1383)
+* BFD_RELOC_MMIX_REG_OR_BYTE: howto manager. (line 1379)
+* BFD_RELOC_MN10300_16_PCREL: howto manager. (line 1253)
+* BFD_RELOC_MN10300_32_PCREL: howto manager. (line 1249)
+* BFD_RELOC_MN10300_ALIGN: howto manager. (line 499)
+* BFD_RELOC_MN10300_COPY: howto manager. (line 482)
+* BFD_RELOC_MN10300_GLOB_DAT: howto manager. (line 485)
+* BFD_RELOC_MN10300_GOT16: howto manager. (line 478)
+* BFD_RELOC_MN10300_GOT24: howto manager. (line 474)
+* BFD_RELOC_MN10300_GOT32: howto manager. (line 470)
+* BFD_RELOC_MN10300_GOTOFF24: howto manager. (line 467)
+* BFD_RELOC_MN10300_JMP_SLOT: howto manager. (line 488)
+* BFD_RELOC_MN10300_RELATIVE: howto manager. (line 491)
+* BFD_RELOC_MN10300_SYM_DIFF: howto manager. (line 494)
+* BFD_RELOC_MOXIE_10_PCREL: howto manager. (line 423)
+* BFD_RELOC_MSP430_10_PCREL: howto manager. (line 2049)
+* BFD_RELOC_MSP430_16: howto manager. (line 2051)
+* BFD_RELOC_MSP430_16_BYTE: howto manager. (line 2053)
+* BFD_RELOC_MSP430_16_PCREL: howto manager. (line 2050)
+* BFD_RELOC_MSP430_16_PCREL_BYTE: howto manager. (line 2052)
+* BFD_RELOC_MSP430_2X_PCREL: howto manager. (line 2054)
+* BFD_RELOC_MSP430_RL_PCREL: howto manager. (line 2055)
+* BFD_RELOC_MT_GNU_VTENTRY: howto manager. (line 2043)
+* BFD_RELOC_MT_GNU_VTINHERIT: howto manager. (line 2040)
+* BFD_RELOC_MT_HI16: howto manager. (line 2034)
+* BFD_RELOC_MT_LO16: howto manager. (line 2037)
+* BFD_RELOC_MT_PC16: howto manager. (line 2031)
+* BFD_RELOC_MT_PCINSN8: howto manager. (line 2046)
+* BFD_RELOC_NONE: howto manager. (line 131)
+* BFD_RELOC_NS32K_DISP_16: howto manager. (line 565)
+* BFD_RELOC_NS32K_DISP_16_PCREL: howto manager. (line 568)
+* BFD_RELOC_NS32K_DISP_32: howto manager. (line 566)
+* BFD_RELOC_NS32K_DISP_32_PCREL: howto manager. (line 569)
+* BFD_RELOC_NS32K_DISP_8: howto manager. (line 564)
+* BFD_RELOC_NS32K_DISP_8_PCREL: howto manager. (line 567)
+* BFD_RELOC_NS32K_IMM_16: howto manager. (line 559)
+* BFD_RELOC_NS32K_IMM_16_PCREL: howto manager. (line 562)
+* BFD_RELOC_NS32K_IMM_32: howto manager. (line 560)
+* BFD_RELOC_NS32K_IMM_32_PCREL: howto manager. (line 563)
+* BFD_RELOC_NS32K_IMM_8: howto manager. (line 558)
+* BFD_RELOC_NS32K_IMM_8_PCREL: howto manager. (line 561)
+* BFD_RELOC_OPENRISC_ABS_26: howto manager. (line 2000)
+* BFD_RELOC_OPENRISC_REL_26: howto manager. (line 2001)
+* BFD_RELOC_PDP11_DISP_6_PCREL: howto manager. (line 573)
+* BFD_RELOC_PDP11_DISP_8_PCREL: howto manager. (line 572)
+* BFD_RELOC_PJ_CODE_DIR16: howto manager. (line 578)
+* BFD_RELOC_PJ_CODE_DIR32: howto manager. (line 579)
+* BFD_RELOC_PJ_CODE_HI16: howto manager. (line 576)
+* BFD_RELOC_PJ_CODE_LO16: howto manager. (line 577)
+* BFD_RELOC_PJ_CODE_REL16: howto manager. (line 580)
+* BFD_RELOC_PJ_CODE_REL32: howto manager. (line 581)
+* BFD_RELOC_PPC64_ADDR16_DS: howto manager. (line 626)
+* BFD_RELOC_PPC64_ADDR16_LO_DS: howto manager. (line 627)
+* BFD_RELOC_PPC64_DTPREL16_DS: howto manager. (line 675)
+* BFD_RELOC_PPC64_DTPREL16_HIGHER: howto manager. (line 677)
+* BFD_RELOC_PPC64_DTPREL16_HIGHERA: howto manager. (line 678)
+* BFD_RELOC_PPC64_DTPREL16_HIGHEST: howto manager. (line 679)
+* BFD_RELOC_PPC64_DTPREL16_HIGHESTA: howto manager. (line 680)
+* BFD_RELOC_PPC64_DTPREL16_LO_DS: howto manager. (line 676)
+* BFD_RELOC_PPC64_GOT16_DS: howto manager. (line 628)
+* BFD_RELOC_PPC64_GOT16_LO_DS: howto manager. (line 629)
+* BFD_RELOC_PPC64_HIGHER: howto manager. (line 614)
+* BFD_RELOC_PPC64_HIGHER_S: howto manager. (line 615)
+* BFD_RELOC_PPC64_HIGHEST: howto manager. (line 616)
+* BFD_RELOC_PPC64_HIGHEST_S: howto manager. (line 617)
+* BFD_RELOC_PPC64_PLT16_LO_DS: howto manager. (line 630)
+* BFD_RELOC_PPC64_PLTGOT16: howto manager. (line 622)
+* BFD_RELOC_PPC64_PLTGOT16_DS: howto manager. (line 635)
+* BFD_RELOC_PPC64_PLTGOT16_HA: howto manager. (line 625)
+* BFD_RELOC_PPC64_PLTGOT16_HI: howto manager. (line 624)
+* BFD_RELOC_PPC64_PLTGOT16_LO: howto manager. (line 623)
+* BFD_RELOC_PPC64_PLTGOT16_LO_DS: howto manager. (line 636)
+* BFD_RELOC_PPC64_SECTOFF_DS: howto manager. (line 631)
+* BFD_RELOC_PPC64_SECTOFF_LO_DS: howto manager. (line 632)
+* BFD_RELOC_PPC64_TOC: howto manager. (line 621)
+* BFD_RELOC_PPC64_TOC16_DS: howto manager. (line 633)
+* BFD_RELOC_PPC64_TOC16_HA: howto manager. (line 620)
+* BFD_RELOC_PPC64_TOC16_HI: howto manager. (line 619)
+* BFD_RELOC_PPC64_TOC16_LO: howto manager. (line 618)
+* BFD_RELOC_PPC64_TOC16_LO_DS: howto manager. (line 634)
+* BFD_RELOC_PPC64_TPREL16_DS: howto manager. (line 669)
+* BFD_RELOC_PPC64_TPREL16_HIGHER: howto manager. (line 671)
+* BFD_RELOC_PPC64_TPREL16_HIGHERA: howto manager. (line 672)
+* BFD_RELOC_PPC64_TPREL16_HIGHEST: howto manager. (line 673)
+* BFD_RELOC_PPC64_TPREL16_HIGHESTA: howto manager. (line 674)
+* BFD_RELOC_PPC64_TPREL16_LO_DS: howto manager. (line 670)
+* BFD_RELOC_PPC_B16: howto manager. (line 587)
+* BFD_RELOC_PPC_B16_BRNTAKEN: howto manager. (line 589)
+* BFD_RELOC_PPC_B16_BRTAKEN: howto manager. (line 588)
+* BFD_RELOC_PPC_B26: howto manager. (line 584)
+* BFD_RELOC_PPC_BA16: howto manager. (line 590)
+* BFD_RELOC_PPC_BA16_BRNTAKEN: howto manager. (line 592)
+* BFD_RELOC_PPC_BA16_BRTAKEN: howto manager. (line 591)
+* BFD_RELOC_PPC_BA26: howto manager. (line 585)
+* BFD_RELOC_PPC_COPY: howto manager. (line 593)
+* BFD_RELOC_PPC_DTPMOD: howto manager. (line 642)
+* BFD_RELOC_PPC_DTPREL: howto manager. (line 652)
+* BFD_RELOC_PPC_DTPREL16: howto manager. (line 648)
+* BFD_RELOC_PPC_DTPREL16_HA: howto manager. (line 651)
+* BFD_RELOC_PPC_DTPREL16_HI: howto manager. (line 650)
+* BFD_RELOC_PPC_DTPREL16_LO: howto manager. (line 649)
+* BFD_RELOC_PPC_EMB_BIT_FLD: howto manager. (line 612)
+* BFD_RELOC_PPC_EMB_MRKREF: howto manager. (line 607)
+* BFD_RELOC_PPC_EMB_NADDR16: howto manager. (line 599)
+* BFD_RELOC_PPC_EMB_NADDR16_HA: howto manager. (line 602)
+* BFD_RELOC_PPC_EMB_NADDR16_HI: howto manager. (line 601)
+* BFD_RELOC_PPC_EMB_NADDR16_LO: howto manager. (line 600)
+* BFD_RELOC_PPC_EMB_NADDR32: howto manager. (line 598)
+* BFD_RELOC_PPC_EMB_RELSDA: howto manager. (line 613)
+* BFD_RELOC_PPC_EMB_RELSEC16: howto manager. (line 608)
+* BFD_RELOC_PPC_EMB_RELST_HA: howto manager. (line 611)
+* BFD_RELOC_PPC_EMB_RELST_HI: howto manager. (line 610)
+* BFD_RELOC_PPC_EMB_RELST_LO: howto manager. (line 609)
+* BFD_RELOC_PPC_EMB_SDA21: howto manager. (line 606)
+* BFD_RELOC_PPC_EMB_SDA2I16: howto manager. (line 604)
+* BFD_RELOC_PPC_EMB_SDA2REL: howto manager. (line 605)
+* BFD_RELOC_PPC_EMB_SDAI16: howto manager. (line 603)
+* BFD_RELOC_PPC_GLOB_DAT: howto manager. (line 594)
+* BFD_RELOC_PPC_GOT_DTPREL16: howto manager. (line 665)
+* BFD_RELOC_PPC_GOT_DTPREL16_HA: howto manager. (line 668)
+* BFD_RELOC_PPC_GOT_DTPREL16_HI: howto manager. (line 667)
+* BFD_RELOC_PPC_GOT_DTPREL16_LO: howto manager. (line 666)
+* BFD_RELOC_PPC_GOT_TLSGD16: howto manager. (line 653)
+* BFD_RELOC_PPC_GOT_TLSGD16_HA: howto manager. (line 656)
+* BFD_RELOC_PPC_GOT_TLSGD16_HI: howto manager. (line 655)
+* BFD_RELOC_PPC_GOT_TLSGD16_LO: howto manager. (line 654)
+* BFD_RELOC_PPC_GOT_TLSLD16: howto manager. (line 657)
+* BFD_RELOC_PPC_GOT_TLSLD16_HA: howto manager. (line 660)
+* BFD_RELOC_PPC_GOT_TLSLD16_HI: howto manager. (line 659)
+* BFD_RELOC_PPC_GOT_TLSLD16_LO: howto manager. (line 658)
+* BFD_RELOC_PPC_GOT_TPREL16: howto manager. (line 661)
+* BFD_RELOC_PPC_GOT_TPREL16_HA: howto manager. (line 664)
+* BFD_RELOC_PPC_GOT_TPREL16_HI: howto manager. (line 663)
+* BFD_RELOC_PPC_GOT_TPREL16_LO: howto manager. (line 662)
+* BFD_RELOC_PPC_JMP_SLOT: howto manager. (line 595)
+* BFD_RELOC_PPC_LOCAL24PC: howto manager. (line 597)
+* BFD_RELOC_PPC_RELATIVE: howto manager. (line 596)
+* BFD_RELOC_PPC_TLS: howto manager. (line 639)
+* BFD_RELOC_PPC_TLSGD: howto manager. (line 640)
+* BFD_RELOC_PPC_TLSLD: howto manager. (line 641)
+* BFD_RELOC_PPC_TOC16: howto manager. (line 586)
+* BFD_RELOC_PPC_TPREL: howto manager. (line 647)
+* BFD_RELOC_PPC_TPREL16: howto manager. (line 643)
+* BFD_RELOC_PPC_TPREL16_HA: howto manager. (line 646)
+* BFD_RELOC_PPC_TPREL16_HI: howto manager. (line 645)
+* BFD_RELOC_PPC_TPREL16_LO: howto manager. (line 644)
+* BFD_RELOC_RELC: howto manager. (line 2017)
+* BFD_RELOC_RVA: howto manager. (line 100)
+* BFD_RELOC_SCORE16_BRANCH: howto manager. (line 1623)
+* BFD_RELOC_SCORE16_JMP: howto manager. (line 1620)
+* BFD_RELOC_SCORE_BCMP: howto manager. (line 1626)
+* BFD_RELOC_SCORE_BRANCH: howto manager. (line 1611)
+* BFD_RELOC_SCORE_CALL15: howto manager. (line 1631)
+* BFD_RELOC_SCORE_DUMMY2: howto manager. (line 1607)
+* BFD_RELOC_SCORE_DUMMY_HI16: howto manager. (line 1632)
+* BFD_RELOC_SCORE_GOT15: howto manager. (line 1629)
+* BFD_RELOC_SCORE_GOT_LO16: howto manager. (line 1630)
+* BFD_RELOC_SCORE_GPREL15: howto manager. (line 1604)
+* BFD_RELOC_SCORE_IMM30: howto manager. (line 1614)
+* BFD_RELOC_SCORE_IMM32: howto manager. (line 1617)
+* BFD_RELOC_SCORE_JMP: howto manager. (line 1608)
+* BFD_RELOC_SH_ALIGN: howto manager. (line 863)
+* BFD_RELOC_SH_CODE: howto manager. (line 864)
+* BFD_RELOC_SH_COPY: howto manager. (line 869)
+* BFD_RELOC_SH_COPY64: howto manager. (line 894)
+* BFD_RELOC_SH_COUNT: howto manager. (line 862)
+* BFD_RELOC_SH_DATA: howto manager. (line 865)
+* BFD_RELOC_SH_DISP12: howto manager. (line 845)
+* BFD_RELOC_SH_DISP12BY2: howto manager. (line 846)
+* BFD_RELOC_SH_DISP12BY4: howto manager. (line 847)
+* BFD_RELOC_SH_DISP12BY8: howto manager. (line 848)
+* BFD_RELOC_SH_DISP20: howto manager. (line 849)
+* BFD_RELOC_SH_DISP20BY8: howto manager. (line 850)
+* BFD_RELOC_SH_GLOB_DAT: howto manager. (line 870)
+* BFD_RELOC_SH_GLOB_DAT64: howto manager. (line 895)
+* BFD_RELOC_SH_GOT10BY4: howto manager. (line 898)
+* BFD_RELOC_SH_GOT10BY8: howto manager. (line 899)
+* BFD_RELOC_SH_GOT_HI16: howto manager. (line 877)
+* BFD_RELOC_SH_GOT_LOW16: howto manager. (line 874)
+* BFD_RELOC_SH_GOT_MEDHI16: howto manager. (line 876)
+* BFD_RELOC_SH_GOT_MEDLOW16: howto manager. (line 875)
+* BFD_RELOC_SH_GOTOFF_HI16: howto manager. (line 889)
+* BFD_RELOC_SH_GOTOFF_LOW16: howto manager. (line 886)
+* BFD_RELOC_SH_GOTOFF_MEDHI16: howto manager. (line 888)
+* BFD_RELOC_SH_GOTOFF_MEDLOW16: howto manager. (line 887)
+* BFD_RELOC_SH_GOTPC: howto manager. (line 873)
+* BFD_RELOC_SH_GOTPC_HI16: howto manager. (line 893)
+* BFD_RELOC_SH_GOTPC_LOW16: howto manager. (line 890)
+* BFD_RELOC_SH_GOTPC_MEDHI16: howto manager. (line 892)
+* BFD_RELOC_SH_GOTPC_MEDLOW16: howto manager. (line 891)
+* BFD_RELOC_SH_GOTPLT10BY4: howto manager. (line 900)
+* BFD_RELOC_SH_GOTPLT10BY8: howto manager. (line 901)
+* BFD_RELOC_SH_GOTPLT32: howto manager. (line 902)
+* BFD_RELOC_SH_GOTPLT_HI16: howto manager. (line 881)
+* BFD_RELOC_SH_GOTPLT_LOW16: howto manager. (line 878)
+* BFD_RELOC_SH_GOTPLT_MEDHI16: howto manager. (line 880)
+* BFD_RELOC_SH_GOTPLT_MEDLOW16: howto manager. (line 879)
+* BFD_RELOC_SH_IMM3: howto manager. (line 843)
+* BFD_RELOC_SH_IMM3U: howto manager. (line 844)
+* BFD_RELOC_SH_IMM4: howto manager. (line 851)
+* BFD_RELOC_SH_IMM4BY2: howto manager. (line 852)
+* BFD_RELOC_SH_IMM4BY4: howto manager. (line 853)
+* BFD_RELOC_SH_IMM8: howto manager. (line 854)
+* BFD_RELOC_SH_IMM8BY2: howto manager. (line 855)
+* BFD_RELOC_SH_IMM8BY4: howto manager. (line 856)
+* BFD_RELOC_SH_IMM_HI16: howto manager. (line 920)
+* BFD_RELOC_SH_IMM_HI16_PCREL: howto manager. (line 921)
+* BFD_RELOC_SH_IMM_LOW16: howto manager. (line 914)
+* BFD_RELOC_SH_IMM_LOW16_PCREL: howto manager. (line 915)
+* BFD_RELOC_SH_IMM_MEDHI16: howto manager. (line 918)
+* BFD_RELOC_SH_IMM_MEDHI16_PCREL: howto manager. (line 919)
+* BFD_RELOC_SH_IMM_MEDLOW16: howto manager. (line 916)
+* BFD_RELOC_SH_IMM_MEDLOW16_PCREL: howto manager. (line 917)
+* BFD_RELOC_SH_IMMS10: howto manager. (line 908)
+* BFD_RELOC_SH_IMMS10BY2: howto manager. (line 909)
+* BFD_RELOC_SH_IMMS10BY4: howto manager. (line 910)
+* BFD_RELOC_SH_IMMS10BY8: howto manager. (line 911)
+* BFD_RELOC_SH_IMMS16: howto manager. (line 912)
+* BFD_RELOC_SH_IMMS6: howto manager. (line 905)
+* BFD_RELOC_SH_IMMS6BY32: howto manager. (line 906)
+* BFD_RELOC_SH_IMMU16: howto manager. (line 913)
+* BFD_RELOC_SH_IMMU5: howto manager. (line 904)
+* BFD_RELOC_SH_IMMU6: howto manager. (line 907)
+* BFD_RELOC_SH_JMP_SLOT: howto manager. (line 871)
+* BFD_RELOC_SH_JMP_SLOT64: howto manager. (line 896)
+* BFD_RELOC_SH_LABEL: howto manager. (line 866)
+* BFD_RELOC_SH_LOOP_END: howto manager. (line 868)
+* BFD_RELOC_SH_LOOP_START: howto manager. (line 867)
+* BFD_RELOC_SH_PCDISP12BY2: howto manager. (line 842)
+* BFD_RELOC_SH_PCDISP8BY2: howto manager. (line 841)
+* BFD_RELOC_SH_PCRELIMM8BY2: howto manager. (line 857)
+* BFD_RELOC_SH_PCRELIMM8BY4: howto manager. (line 858)
+* BFD_RELOC_SH_PLT_HI16: howto manager. (line 885)
+* BFD_RELOC_SH_PLT_LOW16: howto manager. (line 882)
+* BFD_RELOC_SH_PLT_MEDHI16: howto manager. (line 884)
+* BFD_RELOC_SH_PLT_MEDLOW16: howto manager. (line 883)
+* BFD_RELOC_SH_PT_16: howto manager. (line 922)
+* BFD_RELOC_SH_RELATIVE: howto manager. (line 872)
+* BFD_RELOC_SH_RELATIVE64: howto manager. (line 897)
+* BFD_RELOC_SH_SHMEDIA_CODE: howto manager. (line 903)
+* BFD_RELOC_SH_SWITCH16: howto manager. (line 859)
+* BFD_RELOC_SH_SWITCH32: howto manager. (line 860)
+* BFD_RELOC_SH_TLS_DTPMOD32: howto manager. (line 928)
+* BFD_RELOC_SH_TLS_DTPOFF32: howto manager. (line 929)
+* BFD_RELOC_SH_TLS_GD_32: howto manager. (line 923)
+* BFD_RELOC_SH_TLS_IE_32: howto manager. (line 926)
+* BFD_RELOC_SH_TLS_LD_32: howto manager. (line 924)
+* BFD_RELOC_SH_TLS_LDO_32: howto manager. (line 925)
+* BFD_RELOC_SH_TLS_LE_32: howto manager. (line 927)
+* BFD_RELOC_SH_TLS_TPOFF32: howto manager. (line 930)
+* BFD_RELOC_SH_USES: howto manager. (line 861)
+* BFD_RELOC_SPARC13: howto manager. (line 134)
+* BFD_RELOC_SPARC22: howto manager. (line 133)
+* BFD_RELOC_SPARC_10: howto manager. (line 161)
+* BFD_RELOC_SPARC_11: howto manager. (line 162)
+* BFD_RELOC_SPARC_5: howto manager. (line 174)
+* BFD_RELOC_SPARC_6: howto manager. (line 173)
+* BFD_RELOC_SPARC_64: howto manager. (line 160)
+* BFD_RELOC_SPARC_7: howto manager. (line 172)
+* BFD_RELOC_SPARC_BASE13: howto manager. (line 156)
+* BFD_RELOC_SPARC_BASE22: howto manager. (line 157)
+* BFD_RELOC_SPARC_COPY: howto manager. (line 141)
+* BFD_RELOC_SPARC_DISP64: howto manager. (line 175)
+* BFD_RELOC_SPARC_GLOB_DAT: howto manager. (line 142)
+* BFD_RELOC_SPARC_GOT10: howto manager. (line 135)
+* BFD_RELOC_SPARC_GOT13: howto manager. (line 136)
+* BFD_RELOC_SPARC_GOT22: howto manager. (line 137)
+* BFD_RELOC_SPARC_GOTDATA_HIX22: howto manager. (line 148)
+* BFD_RELOC_SPARC_GOTDATA_LOX10: howto manager. (line 149)
+* BFD_RELOC_SPARC_GOTDATA_OP: howto manager. (line 152)
+* BFD_RELOC_SPARC_GOTDATA_OP_HIX22: howto manager. (line 150)
+* BFD_RELOC_SPARC_GOTDATA_OP_LOX10: howto manager. (line 151)
+* BFD_RELOC_SPARC_H44: howto manager. (line 180)
+* BFD_RELOC_SPARC_HH22: howto manager. (line 164)
+* BFD_RELOC_SPARC_HIX22: howto manager. (line 178)
+* BFD_RELOC_SPARC_HM10: howto manager. (line 165)
+* BFD_RELOC_SPARC_JMP_SLOT: howto manager. (line 143)
+* BFD_RELOC_SPARC_L44: howto manager. (line 182)
+* BFD_RELOC_SPARC_LM22: howto manager. (line 166)
+* BFD_RELOC_SPARC_LOX10: howto manager. (line 179)
+* BFD_RELOC_SPARC_M44: howto manager. (line 181)
+* BFD_RELOC_SPARC_OLO10: howto manager. (line 163)
+* BFD_RELOC_SPARC_PC10: howto manager. (line 138)
+* BFD_RELOC_SPARC_PC22: howto manager. (line 139)
+* BFD_RELOC_SPARC_PC_HH22: howto manager. (line 167)
+* BFD_RELOC_SPARC_PC_HM10: howto manager. (line 168)
+* BFD_RELOC_SPARC_PC_LM22: howto manager. (line 169)
+* BFD_RELOC_SPARC_PLT32: howto manager. (line 176)
+* BFD_RELOC_SPARC_PLT64: howto manager. (line 177)
+* BFD_RELOC_SPARC_REGISTER: howto manager. (line 183)
+* BFD_RELOC_SPARC_RELATIVE: howto manager. (line 144)
+* BFD_RELOC_SPARC_REV32: howto manager. (line 186)
+* BFD_RELOC_SPARC_TLS_DTPMOD32: howto manager. (line 207)
+* BFD_RELOC_SPARC_TLS_DTPMOD64: howto manager. (line 208)
+* BFD_RELOC_SPARC_TLS_DTPOFF32: howto manager. (line 209)
+* BFD_RELOC_SPARC_TLS_DTPOFF64: howto manager. (line 210)
+* BFD_RELOC_SPARC_TLS_GD_ADD: howto manager. (line 191)
+* BFD_RELOC_SPARC_TLS_GD_CALL: howto manager. (line 192)
+* BFD_RELOC_SPARC_TLS_GD_HI22: howto manager. (line 189)
+* BFD_RELOC_SPARC_TLS_GD_LO10: howto manager. (line 190)
+* BFD_RELOC_SPARC_TLS_IE_ADD: howto manager. (line 204)
+* BFD_RELOC_SPARC_TLS_IE_HI22: howto manager. (line 200)
+* BFD_RELOC_SPARC_TLS_IE_LD: howto manager. (line 202)
+* BFD_RELOC_SPARC_TLS_IE_LDX: howto manager. (line 203)
+* BFD_RELOC_SPARC_TLS_IE_LO10: howto manager. (line 201)
+* BFD_RELOC_SPARC_TLS_LDM_ADD: howto manager. (line 195)
+* BFD_RELOC_SPARC_TLS_LDM_CALL: howto manager. (line 196)
+* BFD_RELOC_SPARC_TLS_LDM_HI22: howto manager. (line 193)
+* BFD_RELOC_SPARC_TLS_LDM_LO10: howto manager. (line 194)
+* BFD_RELOC_SPARC_TLS_LDO_ADD: howto manager. (line 199)
+* BFD_RELOC_SPARC_TLS_LDO_HIX22: howto manager. (line 197)
+* BFD_RELOC_SPARC_TLS_LDO_LOX10: howto manager. (line 198)
+* BFD_RELOC_SPARC_TLS_LE_HIX22: howto manager. (line 205)
+* BFD_RELOC_SPARC_TLS_LE_LOX10: howto manager. (line 206)
+* BFD_RELOC_SPARC_TLS_TPOFF32: howto manager. (line 211)
+* BFD_RELOC_SPARC_TLS_TPOFF64: howto manager. (line 212)
+* BFD_RELOC_SPARC_UA16: howto manager. (line 145)
+* BFD_RELOC_SPARC_UA32: howto manager. (line 146)
+* BFD_RELOC_SPARC_UA64: howto manager. (line 147)
+* BFD_RELOC_SPARC_WDISP16: howto manager. (line 170)
+* BFD_RELOC_SPARC_WDISP19: howto manager. (line 171)
+* BFD_RELOC_SPARC_WDISP22: howto manager. (line 132)
+* BFD_RELOC_SPARC_WPLT30: howto manager. (line 140)
+* BFD_RELOC_SPU_ADD_PIC: howto manager. (line 229)
+* BFD_RELOC_SPU_HI16: howto manager. (line 226)
+* BFD_RELOC_SPU_IMM10: howto manager. (line 217)
+* BFD_RELOC_SPU_IMM10W: howto manager. (line 218)
+* BFD_RELOC_SPU_IMM16: howto manager. (line 219)
+* BFD_RELOC_SPU_IMM16W: howto manager. (line 220)
+* BFD_RELOC_SPU_IMM18: howto manager. (line 221)
+* BFD_RELOC_SPU_IMM7: howto manager. (line 215)
+* BFD_RELOC_SPU_IMM8: howto manager. (line 216)
+* BFD_RELOC_SPU_LO16: howto manager. (line 225)
+* BFD_RELOC_SPU_PCREL16: howto manager. (line 224)
+* BFD_RELOC_SPU_PCREL9a: howto manager. (line 222)
+* BFD_RELOC_SPU_PCREL9b: howto manager. (line 223)
+* BFD_RELOC_SPU_PPU32: howto manager. (line 227)
+* BFD_RELOC_SPU_PPU64: howto manager. (line 228)
+* BFD_RELOC_THUMB_PCREL_BLX: howto manager. (line 701)
+* BFD_RELOC_THUMB_PCREL_BRANCH12: howto manager. (line 715)
+* BFD_RELOC_THUMB_PCREL_BRANCH20: howto manager. (line 716)
+* BFD_RELOC_THUMB_PCREL_BRANCH23: howto manager. (line 717)
+* BFD_RELOC_THUMB_PCREL_BRANCH25: howto manager. (line 718)
+* BFD_RELOC_THUMB_PCREL_BRANCH7: howto manager. (line 713)
+* BFD_RELOC_THUMB_PCREL_BRANCH9: howto manager. (line 714)
+* BFD_RELOC_TIC30_LDP: howto manager. (line 1257)
+* BFD_RELOC_TIC54X_16_OF_23: howto manager. (line 1275)
+* BFD_RELOC_TIC54X_23: howto manager. (line 1272)
+* BFD_RELOC_TIC54X_MS7_OF_23: howto manager. (line 1280)
+* BFD_RELOC_TIC54X_PARTLS7: howto manager. (line 1262)
+* BFD_RELOC_TIC54X_PARTMS9: howto manager. (line 1267)
+* bfd_reloc_type_lookup: howto manager. (line 2234)
+* BFD_RELOC_V850_22_PCREL: howto manager. (line 1184)
+* BFD_RELOC_V850_9_PCREL: howto manager. (line 1181)
+* BFD_RELOC_V850_ALIGN: howto manager. (line 1242)
+* BFD_RELOC_V850_CALLT_16_16_OFFSET: howto manager. (line 1233)
+* BFD_RELOC_V850_CALLT_6_7_OFFSET: howto manager. (line 1230)
+* BFD_RELOC_V850_LO16_SPLIT_OFFSET: howto manager. (line 1245)
+* BFD_RELOC_V850_LONGCALL: howto manager. (line 1236)
+* BFD_RELOC_V850_LONGJUMP: howto manager. (line 1239)
+* BFD_RELOC_V850_SDA_15_16_OFFSET: howto manager. (line 1190)
+* BFD_RELOC_V850_SDA_16_16_OFFSET: howto manager. (line 1187)
+* BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET: howto manager. (line 1222)
+* BFD_RELOC_V850_TDA_16_16_OFFSET: howto manager. (line 1212)
+* BFD_RELOC_V850_TDA_4_4_OFFSET: howto manager. (line 1219)
+* BFD_RELOC_V850_TDA_4_5_OFFSET: howto manager. (line 1215)
+* BFD_RELOC_V850_TDA_6_8_OFFSET: howto manager. (line 1201)
+* BFD_RELOC_V850_TDA_7_7_OFFSET: howto manager. (line 1209)
+* BFD_RELOC_V850_TDA_7_8_OFFSET: howto manager. (line 1205)
+* BFD_RELOC_V850_ZDA_15_16_OFFSET: howto manager. (line 1197)
+* BFD_RELOC_V850_ZDA_16_16_OFFSET: howto manager. (line 1194)
+* BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET: howto manager. (line 1226)
+* BFD_RELOC_VAX_GLOB_DAT: howto manager. (line 2026)
+* BFD_RELOC_VAX_JMP_SLOT: howto manager. (line 2027)
+* BFD_RELOC_VAX_RELATIVE: howto manager. (line 2028)
+* BFD_RELOC_VPE4KMATH_DATA: howto manager. (line 1665)
+* BFD_RELOC_VPE4KMATH_INSN: howto manager. (line 1666)
+* BFD_RELOC_VTABLE_ENTRY: howto manager. (line 1670)
+* BFD_RELOC_VTABLE_INHERIT: howto manager. (line 1669)
+* BFD_RELOC_X86_64_32S: howto manager. (line 536)
+* BFD_RELOC_X86_64_COPY: howto manager. (line 531)
+* BFD_RELOC_X86_64_DTPMOD64: howto manager. (line 537)
+* BFD_RELOC_X86_64_DTPOFF32: howto manager. (line 542)
+* BFD_RELOC_X86_64_DTPOFF64: howto manager. (line 538)
+* BFD_RELOC_X86_64_GLOB_DAT: howto manager. (line 532)
+* BFD_RELOC_X86_64_GOT32: howto manager. (line 529)
+* BFD_RELOC_X86_64_GOT64: howto manager. (line 547)
+* BFD_RELOC_X86_64_GOTOFF64: howto manager. (line 545)
+* BFD_RELOC_X86_64_GOTPC32: howto manager. (line 546)
+* BFD_RELOC_X86_64_GOTPC32_TLSDESC: howto manager. (line 552)
+* BFD_RELOC_X86_64_GOTPC64: howto manager. (line 549)
+* BFD_RELOC_X86_64_GOTPCREL: howto manager. (line 535)
+* BFD_RELOC_X86_64_GOTPCREL64: howto manager. (line 548)
+* BFD_RELOC_X86_64_GOTPLT64: howto manager. (line 550)
+* BFD_RELOC_X86_64_GOTTPOFF: howto manager. (line 543)
+* BFD_RELOC_X86_64_IRELATIVE: howto manager. (line 555)
+* BFD_RELOC_X86_64_JUMP_SLOT: howto manager. (line 533)
+* BFD_RELOC_X86_64_PLT32: howto manager. (line 530)
+* BFD_RELOC_X86_64_PLTOFF64: howto manager. (line 551)
+* BFD_RELOC_X86_64_RELATIVE: howto manager. (line 534)
+* BFD_RELOC_X86_64_TLSDESC: howto manager. (line 554)
+* BFD_RELOC_X86_64_TLSDESC_CALL: howto manager. (line 553)
+* BFD_RELOC_X86_64_TLSGD: howto manager. (line 540)
+* BFD_RELOC_X86_64_TLSLD: howto manager. (line 541)
+* BFD_RELOC_X86_64_TPOFF32: howto manager. (line 544)
+* BFD_RELOC_X86_64_TPOFF64: howto manager. (line 539)
+* BFD_RELOC_XC16X_PAG: howto manager. (line 2020)
+* BFD_RELOC_XC16X_POF: howto manager. (line 2021)
+* BFD_RELOC_XC16X_SEG: howto manager. (line 2022)
+* BFD_RELOC_XC16X_SOF: howto manager. (line 2023)
+* BFD_RELOC_XSTORMY16_12: howto manager. (line 2012)
+* BFD_RELOC_XSTORMY16_24: howto manager. (line 2013)
+* BFD_RELOC_XSTORMY16_FPTR16: howto manager. (line 2014)
+* BFD_RELOC_XSTORMY16_REL_12: howto manager. (line 2011)
+* BFD_RELOC_XTENSA_ASM_EXPAND: howto manager. (line 2132)
+* BFD_RELOC_XTENSA_ASM_SIMPLIFY: howto manager. (line 2137)
+* BFD_RELOC_XTENSA_DIFF16: howto manager. (line 2079)
+* BFD_RELOC_XTENSA_DIFF32: howto manager. (line 2080)
+* BFD_RELOC_XTENSA_DIFF8: howto manager. (line 2078)
+* BFD_RELOC_XTENSA_GLOB_DAT: howto manager. (line 2068)
+* BFD_RELOC_XTENSA_JMP_SLOT: howto manager. (line 2069)
+* BFD_RELOC_XTENSA_OP0: howto manager. (line 2126)
+* BFD_RELOC_XTENSA_OP1: howto manager. (line 2127)
+* BFD_RELOC_XTENSA_OP2: howto manager. (line 2128)
+* BFD_RELOC_XTENSA_PLT: howto manager. (line 2073)
+* BFD_RELOC_XTENSA_RELATIVE: howto manager. (line 2070)
+* BFD_RELOC_XTENSA_RTLD: howto manager. (line 2063)
+* BFD_RELOC_XTENSA_SLOT0_ALT: howto manager. (line 2108)
+* BFD_RELOC_XTENSA_SLOT0_OP: howto manager. (line 2088)
+* BFD_RELOC_XTENSA_SLOT10_ALT: howto manager. (line 2118)
+* BFD_RELOC_XTENSA_SLOT10_OP: howto manager. (line 2098)
+* BFD_RELOC_XTENSA_SLOT11_ALT: howto manager. (line 2119)
+* BFD_RELOC_XTENSA_SLOT11_OP: howto manager. (line 2099)
+* BFD_RELOC_XTENSA_SLOT12_ALT: howto manager. (line 2120)
+* BFD_RELOC_XTENSA_SLOT12_OP: howto manager. (line 2100)
+* BFD_RELOC_XTENSA_SLOT13_ALT: howto manager. (line 2121)
+* BFD_RELOC_XTENSA_SLOT13_OP: howto manager. (line 2101)
+* BFD_RELOC_XTENSA_SLOT14_ALT: howto manager. (line 2122)
+* BFD_RELOC_XTENSA_SLOT14_OP: howto manager. (line 2102)
+* BFD_RELOC_XTENSA_SLOT1_ALT: howto manager. (line 2109)
+* BFD_RELOC_XTENSA_SLOT1_OP: howto manager. (line 2089)
+* BFD_RELOC_XTENSA_SLOT2_ALT: howto manager. (line 2110)
+* BFD_RELOC_XTENSA_SLOT2_OP: howto manager. (line 2090)
+* BFD_RELOC_XTENSA_SLOT3_ALT: howto manager. (line 2111)
+* BFD_RELOC_XTENSA_SLOT3_OP: howto manager. (line 2091)
+* BFD_RELOC_XTENSA_SLOT4_ALT: howto manager. (line 2112)
+* BFD_RELOC_XTENSA_SLOT4_OP: howto manager. (line 2092)
+* BFD_RELOC_XTENSA_SLOT5_ALT: howto manager. (line 2113)
+* BFD_RELOC_XTENSA_SLOT5_OP: howto manager. (line 2093)
+* BFD_RELOC_XTENSA_SLOT6_ALT: howto manager. (line 2114)
+* BFD_RELOC_XTENSA_SLOT6_OP: howto manager. (line 2094)
+* BFD_RELOC_XTENSA_SLOT7_ALT: howto manager. (line 2115)
+* BFD_RELOC_XTENSA_SLOT7_OP: howto manager. (line 2095)
+* BFD_RELOC_XTENSA_SLOT8_ALT: howto manager. (line 2116)
+* BFD_RELOC_XTENSA_SLOT8_OP: howto manager. (line 2096)
+* BFD_RELOC_XTENSA_SLOT9_ALT: howto manager. (line 2117)
+* BFD_RELOC_XTENSA_SLOT9_OP: howto manager. (line 2097)
+* BFD_RELOC_XTENSA_TLS_ARG: howto manager. (line 2147)
+* BFD_RELOC_XTENSA_TLS_CALL: howto manager. (line 2148)
+* BFD_RELOC_XTENSA_TLS_DTPOFF: howto manager. (line 2144)
+* BFD_RELOC_XTENSA_TLS_FUNC: howto manager. (line 2146)
+* BFD_RELOC_XTENSA_TLS_TPOFF: howto manager. (line 2145)
+* BFD_RELOC_XTENSA_TLSDESC_ARG: howto manager. (line 2143)
+* BFD_RELOC_XTENSA_TLSDESC_FN: howto manager. (line 2142)
+* BFD_RELOC_Z80_DISP8: howto manager. (line 2151)
+* BFD_RELOC_Z8K_CALLR: howto manager. (line 2157)
+* BFD_RELOC_Z8K_DISP7: howto manager. (line 2154)
+* BFD_RELOC_Z8K_IMM4L: howto manager. (line 2160)
+* bfd_scan_arch: Architectures. (line 433)
+* bfd_scan_vma: BFD front end. (line 513)
+* bfd_seach_for_target: bfd_target. (line 470)
+* bfd_section_already_linked: Writing the symbol table.
+ (line 55)
+* bfd_section_list_clear: section prototypes. (line 8)
+* bfd_sections_find_if: section prototypes. (line 176)
+* bfd_set_arch_info: Architectures. (line 474)
+* bfd_set_archive_head: Archives. (line 69)
+* bfd_set_default_target: bfd_target. (line 435)
+* bfd_set_error: BFD front end. (line 323)
+* bfd_set_error_handler: BFD front end. (line 365)
+* bfd_set_error_program_name: BFD front end. (line 374)
+* bfd_set_file_flags: BFD front end. (line 433)
+* bfd_set_format: Formats. (line 68)
+* bfd_set_gp_size: BFD front end. (line 503)
+* bfd_set_private_flags: BFD front end. (line 580)
+* bfd_set_reloc: BFD front end. (line 423)
+* bfd_set_section_contents: section prototypes. (line 207)
+* bfd_set_section_flags: section prototypes. (line 140)
+* bfd_set_section_size: section prototypes. (line 193)
+* bfd_set_start_address: BFD front end. (line 482)
+* bfd_set_symtab: symbol handling functions.
+ (line 60)
+* bfd_symbol_info: symbol handling functions.
+ (line 130)
+* bfd_target_list: bfd_target. (line 461)
+* bfd_write_bigendian_4byte_int: Internal. (line 13)
+* bfd_zalloc: Opening and Closing.
+ (line 228)
+* bfd_zalloc2: Opening and Closing.
+ (line 237)
+* coff_symbol_type: coff. (line 244)
+* core_file_matches_executable_p: Core Files. (line 30)
+* find_separate_debug_file: Opening and Closing.
+ (line 279)
+* generic_core_file_matches_executable_p: Core Files. (line 40)
+* get_debug_link_info: Opening and Closing.
+ (line 260)
+* Hash tables: Hash Tables. (line 6)
+* internal object-file format: Canonical format. (line 11)
+* Linker: Linker Functions. (line 6)
+* Other functions: BFD front end. (line 595)
+* separate_debug_file_exists: Opening and Closing.
+ (line 270)
+* struct bfd_iovec: BFD front end. (line 798)
+* target vector (_bfd_final_link): Performing the Final Link.
+ (line 6)
+* target vector (_bfd_link_add_symbols): Adding Symbols to the Hash Table.
+ (line 6)
+* target vector (_bfd_link_hash_table_create): Creating a Linker Hash Table.
+ (line 6)
+* The HOWTO Macro: typedef arelent. (line 291)
+* what is it?: Overview. (line 6)
+
+
+
+Tag Table:
+Node: Top1051
+Node: Overview1390
+Node: History2441
+Node: How It Works3387
+Node: What BFD Version 2 Can Do4930
+Node: BFD information loss6245
+Node: Canonical format8777
+Node: BFD front end13149
+Node: Memory Usage44457
+Node: Initialization45685
+Node: Sections46144
+Node: Section Input46627
+Node: Section Output47992
+Node: typedef asection50478
+Node: section prototypes75809
+Node: Symbols85489
+Node: Reading Symbols87084
+Node: Writing Symbols88191
+Node: Mini Symbols89900
+Node: typedef asymbol90874
+Node: symbol handling functions96933
+Node: Archives102275
+Node: Formats106001
+Node: Relocations108949
+Node: typedef arelent109676
+Node: howto manager125487
+Node: Core Files197788
+Node: Targets199605
+Node: bfd_target201575
+Node: Architectures222154
+Node: Opening and Closing245337
+Node: Internal256601
+Node: File Caching262934
+Node: Linker Functions264848
+Node: Creating a Linker Hash Table266521
+Node: Adding Symbols to the Hash Table268259
+Node: Differing file formats269159
+Node: Adding symbols from an object file270884
+Node: Adding symbols from an archive273035
+Node: Performing the Final Link275449
+Node: Information provided by the linker276691
+Node: Relocating the section contents277845
+Node: Writing the symbol table279596
+Node: Hash Tables283611
+Node: Creating and Freeing a Hash Table284809
+Node: Looking Up or Entering a String286059
+Node: Traversing a Hash Table287312
+Node: Deriving a New Hash Table Type288101
+Node: Define the Derived Structures289167
+Node: Write the Derived Creation Routine290248
+Node: Write Other Derived Routines292872
+Node: BFD back ends294187
+Node: What to Put Where294457
+Node: aout294637
+Node: coff300955
+Node: elf329388
+Node: mmo329789
+Node: File layout330717
+Node: Symbol-table336364
+Node: mmo section mapping340133
+Node: GNU Free Documentation License343785
+Node: BFD Index368868
+
+End Tag Table
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/binutils.info b/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/binutils.info
new file mode 100644
index 0000000..bc00022
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/binutils.info
@@ -0,0 +1,4493 @@
+This is binutils.info, produced by makeinfo version 4.8 from
+binutils.texi.
+
+ Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free
+Software Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.3 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+Texts. A copy of the license is included in the section entitled "GNU
+Free Documentation License".
+
+INFO-DIR-SECTION Software development
+START-INFO-DIR-ENTRY
+* Binutils: (binutils). The GNU binary utilities.
+END-INFO-DIR-ENTRY
+
+INFO-DIR-SECTION Individual utilities
+START-INFO-DIR-ENTRY
+* addr2line: (binutils)addr2line. Convert addresses to file and line.
+* ar: (binutils)ar. Create, modify, and extract from archives.
+* c++filt: (binutils)c++filt. Filter to demangle encoded C++ symbols.
+* cxxfilt: (binutils)c++filt. MS-DOS name for c++filt.
+* dlltool: (binutils)dlltool. Create files needed to build and use DLLs.
+* nlmconv: (binutils)nlmconv. Converts object code into an NLM.
+* nm: (binutils)nm. List symbols from object files.
+* objcopy: (binutils)objcopy. Copy and translate object files.
+* objdump: (binutils)objdump. Display information from object files.
+* ranlib: (binutils)ranlib. Generate index to archive contents.
+* readelf: (binutils)readelf. Display the contents of ELF format files.
+* size: (binutils)size. List section sizes and total size.
+* strings: (binutils)strings. List printable strings from files.
+* strip: (binutils)strip. Discard symbols.
+* windmc: (binutils)windmc. Generator for Windows message resources.
+* windres: (binutils)windres. Manipulate Windows resources.
+END-INFO-DIR-ENTRY
+
+
+File: binutils.info, Node: Top, Next: ar, Up: (dir)
+
+Introduction
+************
+
+This brief manual contains documentation for the GNU binary utilities
+(GNU Binutils) version 2.20:
+
+ This document is distributed under the terms of the GNU Free
+Documentation License version 1.3. A copy of the license is included
+in the section entitled "GNU Free Documentation License".
+
+* Menu:
+
+* ar:: Create, modify, and extract from archives
+* nm:: List symbols from object files
+* objcopy:: Copy and translate object files
+* objdump:: Display information from object files
+* ranlib:: Generate index to archive contents
+* readelf:: Display the contents of ELF format files
+* size:: List section sizes and total size
+* strings:: List printable strings from files
+* strip:: Discard symbols
+* c++filt:: Filter to demangle encoded C++ symbols
+* cxxfilt: c++filt. MS-DOS name for c++filt
+* addr2line:: Convert addresses to file and line
+* nlmconv:: Converts object code into an NLM
+* windres:: Manipulate Windows resources
+* windmc:: Generator for Windows message resources
+* dlltool:: Create files needed to build and use DLLs
+* Common Options:: Command-line options for all utilities
+* Selecting the Target System:: How these utilities determine the target
+* Reporting Bugs:: Reporting Bugs
+* GNU Free Documentation License:: GNU Free Documentation License
+* Binutils Index:: Binutils Index
+
+
+File: binutils.info, Node: ar, Next: nm, Prev: Top, Up: Top
+
+1 ar
+****
+
+ ar [`--plugin' NAME] [-]P[MOD [RELPOS] [COUNT]] ARCHIVE [MEMBER...]
+ ar -M [ <mri-script ]
+
+ The GNU `ar' program creates, modifies, and extracts from archives.
+An "archive" is a single file holding a collection of other files in a
+structure that makes it possible to retrieve the original individual
+files (called "members" of the archive).
+
+ The original files' contents, mode (permissions), timestamp, owner,
+and group are preserved in the archive, and can be restored on
+extraction.
+
+ GNU `ar' can maintain archives whose members have names of any
+length; however, depending on how `ar' is configured on your system, a
+limit on member-name length may be imposed for compatibility with
+archive formats maintained with other tools. If it exists, the limit
+is often 15 characters (typical of formats related to a.out) or 16
+characters (typical of formats related to coff).
+
+ `ar' is considered a binary utility because archives of this sort
+are most often used as "libraries" holding commonly needed subroutines.
+
+ `ar' creates an index to the symbols defined in relocatable object
+modules in the archive when you specify the modifier `s'. Once
+created, this index is updated in the archive whenever `ar' makes a
+change to its contents (save for the `q' update operation). An archive
+with such an index speeds up linking to the library, and allows
+routines in the library to call each other without regard to their
+placement in the archive.
+
+ You may use `nm -s' or `nm --print-armap' to list this index table.
+If an archive lacks the table, another form of `ar' called `ranlib' can
+be used to add just the table.
+
+ GNU `ar' can optionally create a _thin_ archive, which contains a
+symbol index and references to the original copies of the member files
+of the archives. Such an archive is useful for building libraries for
+use within a local build, where the relocatable objects are expected to
+remain available, and copying the contents of each object would only
+waste time and space. Thin archives are also _flattened_, so that
+adding one or more archives to a thin archive will add the elements of
+the nested archive individually. The paths to the elements of the
+archive are stored relative to the archive itself.
+
+ GNU `ar' is designed to be compatible with two different facilities.
+You can control its activity using command-line options, like the
+different varieties of `ar' on Unix systems; or, if you specify the
+single command-line option `-M', you can control it with a script
+supplied via standard input, like the MRI "librarian" program.
+
+* Menu:
+
+* ar cmdline:: Controlling `ar' on the command line
+* ar scripts:: Controlling `ar' with a script
+
+
+File: binutils.info, Node: ar cmdline, Next: ar scripts, Up: ar
+
+1.1 Controlling `ar' on the Command Line
+========================================
+
+ ar [`--plugin' NAME] [`-X32_64'] [`-']P[MOD [RELPOS] [COUNT]] ARCHIVE [MEMBER...]
+
+ When you use `ar' in the Unix style, `ar' insists on at least two
+arguments to execute: one keyletter specifying the _operation_
+(optionally accompanied by other keyletters specifying _modifiers_),
+and the archive name to act on.
+
+ Most operations can also accept further MEMBER arguments, specifying
+particular files to operate on.
+
+ GNU `ar' allows you to mix the operation code P and modifier flags
+MOD in any order, within the first command-line argument.
+
+ If you wish, you may begin the first command-line argument with a
+dash.
+
+ The P keyletter specifies what operation to execute; it may be any
+of the following, but you must specify only one of them:
+
+`d'
+ _Delete_ modules from the archive. Specify the names of modules to
+ be deleted as MEMBER...; the archive is untouched if you specify
+ no files to delete.
+
+ If you specify the `v' modifier, `ar' lists each module as it is
+ deleted.
+
+`m'
+ Use this operation to _move_ members in an archive.
+
+ The ordering of members in an archive can make a difference in how
+ programs are linked using the library, if a symbol is defined in
+ more than one member.
+
+ If no modifiers are used with `m', any members you name in the
+ MEMBER arguments are moved to the _end_ of the archive; you can
+ use the `a', `b', or `i' modifiers to move them to a specified
+ place instead.
+
+`p'
+ _Print_ the specified members of the archive, to the standard
+ output file. If the `v' modifier is specified, show the member
+ name before copying its contents to standard output.
+
+ If you specify no MEMBER arguments, all the files in the archive
+ are printed.
+
+`q'
+ _Quick append_; Historically, add the files MEMBER... to the end of
+ ARCHIVE, without checking for replacement.
+
+ The modifiers `a', `b', and `i' do _not_ affect this operation;
+ new members are always placed at the end of the archive.
+
+ The modifier `v' makes `ar' list each file as it is appended.
+
+ Since the point of this operation is speed, the archive's symbol
+ table index is not updated, even if it already existed; you can
+ use `ar s' or `ranlib' explicitly to update the symbol table index.
+
+ However, too many different systems assume quick append rebuilds
+ the index, so GNU `ar' implements `q' as a synonym for `r'.
+
+`r'
+ Insert the files MEMBER... into ARCHIVE (with _replacement_). This
+ operation differs from `q' in that any previously existing members
+ are deleted if their names match those being added.
+
+ If one of the files named in MEMBER... does not exist, `ar'
+ displays an error message, and leaves undisturbed any existing
+ members of the archive matching that name.
+
+ By default, new members are added at the end of the file; but you
+ may use one of the modifiers `a', `b', or `i' to request placement
+ relative to some existing member.
+
+ The modifier `v' used with this operation elicits a line of output
+ for each file inserted, along with one of the letters `a' or `r'
+ to indicate whether the file was appended (no old member deleted)
+ or replaced.
+
+`t'
+ Display a _table_ listing the contents of ARCHIVE, or those of the
+ files listed in MEMBER... that are present in the archive.
+ Normally only the member name is shown; if you also want to see
+ the modes (permissions), timestamp, owner, group, and size, you can
+ request that by also specifying the `v' modifier.
+
+ If you do not specify a MEMBER, all files in the archive are
+ listed.
+
+ If there is more than one file with the same name (say, `fie') in
+ an archive (say `b.a'), `ar t b.a fie' lists only the first
+ instance; to see them all, you must ask for a complete listing--in
+ our example, `ar t b.a'.
+
+`x'
+ _Extract_ members (named MEMBER) from the archive. You can use
+ the `v' modifier with this operation, to request that `ar' list
+ each name as it extracts it.
+
+ If you do not specify a MEMBER, all files in the archive are
+ extracted.
+
+ Files cannot be extracted from a thin archive.
+
+
+ A number of modifiers (MOD) may immediately follow the P keyletter,
+to specify variations on an operation's behavior:
+
+`a'
+ Add new files _after_ an existing member of the archive. If you
+ use the modifier `a', the name of an existing archive member must
+ be present as the RELPOS argument, before the ARCHIVE
+ specification.
+
+`b'
+ Add new files _before_ an existing member of the archive. If you
+ use the modifier `b', the name of an existing archive member must
+ be present as the RELPOS argument, before the ARCHIVE
+ specification. (same as `i').
+
+`c'
+ _Create_ the archive. The specified ARCHIVE is always created if
+ it did not exist, when you request an update. But a warning is
+ issued unless you specify in advance that you expect to create it,
+ by using this modifier.
+
+`D'
+ Operate in _deterministic_ mode. When adding files and the archive
+ index use zero for UIDs, GIDs, timestamps, and use consistent file
+ modes for all files. When this option is used, if `ar' is used
+ with identical options and identical input files, multiple runs
+ will create identical output files regardless of the input files'
+ owners, groups, file modes, or modification times.
+
+`f'
+ Truncate names in the archive. GNU `ar' will normally permit file
+ names of any length. This will cause it to create archives which
+ are not compatible with the native `ar' program on some systems.
+ If this is a concern, the `f' modifier may be used to truncate file
+ names when putting them in the archive.
+
+`i'
+ Insert new files _before_ an existing member of the archive. If
+ you use the modifier `i', the name of an existing archive member
+ must be present as the RELPOS argument, before the ARCHIVE
+ specification. (same as `b').
+
+`l'
+ This modifier is accepted but not used.
+
+`N'
+ Uses the COUNT parameter. This is used if there are multiple
+ entries in the archive with the same name. Extract or delete
+ instance COUNT of the given name from the archive.
+
+`o'
+ Preserve the _original_ dates of members when extracting them. If
+ you do not specify this modifier, files extracted from the archive
+ are stamped with the time of extraction.
+
+`P'
+ Use the full path name when matching names in the archive. GNU
+ `ar' can not create an archive with a full path name (such archives
+ are not POSIX complaint), but other archive creators can. This
+ option will cause GNU `ar' to match file names using a complete
+ path name, which can be convenient when extracting a single file
+ from an archive created by another tool.
+
+`s'
+ Write an object-file index into the archive, or update an existing
+ one, even if no other change is made to the archive. You may use
+ this modifier flag either with any operation, or alone. Running
+ `ar s' on an archive is equivalent to running `ranlib' on it.
+
+`S'
+ Do not generate an archive symbol table. This can speed up
+ building a large library in several steps. The resulting archive
+ can not be used with the linker. In order to build a symbol
+ table, you must omit the `S' modifier on the last execution of
+ `ar', or you must run `ranlib' on the archive.
+
+`T'
+ Make the specified ARCHIVE a _thin_ archive. If it already exists
+ and is a regular archive, the existing members must be present in
+ the same directory as ARCHIVE.
+
+`u'
+ Normally, `ar r'... inserts all files listed into the archive. If
+ you would like to insert _only_ those of the files you list that
+ are newer than existing members of the same names, use this
+ modifier. The `u' modifier is allowed only for the operation `r'
+ (replace). In particular, the combination `qu' is not allowed,
+ since checking the timestamps would lose any speed advantage from
+ the operation `q'.
+
+`v'
+ This modifier requests the _verbose_ version of an operation. Many
+ operations display additional information, such as filenames
+ processed, when the modifier `v' is appended.
+
+`V'
+ This modifier shows the version number of `ar'.
+
+ `ar' ignores an initial option spelt `-X32_64', for compatibility
+with AIX. The behaviour produced by this option is the default for GNU
+`ar'. `ar' does not support any of the other `-X' options; in
+particular, it does not support `-X32' which is the default for AIX
+`ar'.
+
+ The optional command line switch `--plugin' NAME causes `ar' to load
+the plugin called NAME which adds support for more file formats. This
+option is only available if the toolchain has been built with plugin
+support enabled.
+
+
+File: binutils.info, Node: ar scripts, Prev: ar cmdline, Up: ar
+
+1.2 Controlling `ar' with a Script
+==================================
+
+ ar -M [ <SCRIPT ]
+
+ If you use the single command-line option `-M' with `ar', you can
+control its operation with a rudimentary command language. This form
+of `ar' operates interactively if standard input is coming directly
+from a terminal. During interactive use, `ar' prompts for input (the
+prompt is `AR >'), and continues executing even after errors. If you
+redirect standard input to a script file, no prompts are issued, and
+`ar' abandons execution (with a nonzero exit code) on any error.
+
+ The `ar' command language is _not_ designed to be equivalent to the
+command-line options; in fact, it provides somewhat less control over
+archives. The only purpose of the command language is to ease the
+transition to GNU `ar' for developers who already have scripts written
+for the MRI "librarian" program.
+
+ The syntax for the `ar' command language is straightforward:
+ * commands are recognized in upper or lower case; for example, `LIST'
+ is the same as `list'. In the following descriptions, commands are
+ shown in upper case for clarity.
+
+ * a single command may appear on each line; it is the first word on
+ the line.
+
+ * empty lines are allowed, and have no effect.
+
+ * comments are allowed; text after either of the characters `*' or
+ `;' is ignored.
+
+ * Whenever you use a list of names as part of the argument to an `ar'
+ command, you can separate the individual names with either commas
+ or blanks. Commas are shown in the explanations below, for
+ clarity.
+
+ * `+' is used as a line continuation character; if `+' appears at
+ the end of a line, the text on the following line is considered
+ part of the current command.
+
+ Here are the commands you can use in `ar' scripts, or when using
+`ar' interactively. Three of them have special significance:
+
+ `OPEN' or `CREATE' specify a "current archive", which is a temporary
+file required for most of the other commands.
+
+ `SAVE' commits the changes so far specified by the script. Prior to
+`SAVE', commands affect only the temporary copy of the current archive.
+
+`ADDLIB ARCHIVE'
+`ADDLIB ARCHIVE (MODULE, MODULE, ... MODULE)'
+ Add all the contents of ARCHIVE (or, if specified, each named
+ MODULE from ARCHIVE) to the current archive.
+
+ Requires prior use of `OPEN' or `CREATE'.
+
+`ADDMOD MEMBER, MEMBER, ... MEMBER'
+ Add each named MEMBER as a module in the current archive.
+
+ Requires prior use of `OPEN' or `CREATE'.
+
+`CLEAR'
+ Discard the contents of the current archive, canceling the effect
+ of any operations since the last `SAVE'. May be executed (with no
+ effect) even if no current archive is specified.
+
+`CREATE ARCHIVE'
+ Creates an archive, and makes it the current archive (required for
+ many other commands). The new archive is created with a temporary
+ name; it is not actually saved as ARCHIVE until you use `SAVE'.
+ You can overwrite existing archives; similarly, the contents of any
+ existing file named ARCHIVE will not be destroyed until `SAVE'.
+
+`DELETE MODULE, MODULE, ... MODULE'
+ Delete each listed MODULE from the current archive; equivalent to
+ `ar -d ARCHIVE MODULE ... MODULE'.
+
+ Requires prior use of `OPEN' or `CREATE'.
+
+`DIRECTORY ARCHIVE (MODULE, ... MODULE)'
+`DIRECTORY ARCHIVE (MODULE, ... MODULE) OUTPUTFILE'
+ List each named MODULE present in ARCHIVE. The separate command
+ `VERBOSE' specifies the form of the output: when verbose output is
+ off, output is like that of `ar -t ARCHIVE MODULE...'. When
+ verbose output is on, the listing is like `ar -tv ARCHIVE
+ MODULE...'.
+
+ Output normally goes to the standard output stream; however, if you
+ specify OUTPUTFILE as a final argument, `ar' directs the output to
+ that file.
+
+`END'
+ Exit from `ar', with a `0' exit code to indicate successful
+ completion. This command does not save the output file; if you
+ have changed the current archive since the last `SAVE' command,
+ those changes are lost.
+
+`EXTRACT MODULE, MODULE, ... MODULE'
+ Extract each named MODULE from the current archive, writing them
+ into the current directory as separate files. Equivalent to `ar -x
+ ARCHIVE MODULE...'.
+
+ Requires prior use of `OPEN' or `CREATE'.
+
+`LIST'
+ Display full contents of the current archive, in "verbose" style
+ regardless of the state of `VERBOSE'. The effect is like `ar tv
+ ARCHIVE'. (This single command is a GNU `ar' enhancement, rather
+ than present for MRI compatibility.)
+
+ Requires prior use of `OPEN' or `CREATE'.
+
+`OPEN ARCHIVE'
+ Opens an existing archive for use as the current archive (required
+ for many other commands). Any changes as the result of subsequent
+ commands will not actually affect ARCHIVE until you next use
+ `SAVE'.
+
+`REPLACE MODULE, MODULE, ... MODULE'
+ In the current archive, replace each existing MODULE (named in the
+ `REPLACE' arguments) from files in the current working directory.
+ To execute this command without errors, both the file, and the
+ module in the current archive, must exist.
+
+ Requires prior use of `OPEN' or `CREATE'.
+
+`VERBOSE'
+ Toggle an internal flag governing the output from `DIRECTORY'.
+ When the flag is on, `DIRECTORY' output matches output from `ar
+ -tv '....
+
+`SAVE'
+ Commit your changes to the current archive, and actually save it
+ as a file with the name specified in the last `CREATE' or `OPEN'
+ command.
+
+ Requires prior use of `OPEN' or `CREATE'.
+
+
+
+File: binutils.info, Node: nm, Next: objcopy, Prev: ar, Up: Top
+
+2 nm
+****
+
+ nm [`-a'|`--debug-syms']
+ [`-g'|`--extern-only'][`--plugin' NAME]
+ [`-B'] [`-C'|`--demangle'[=STYLE]] [`-D'|`--dynamic']
+ [`-S'|`--print-size'] [`-s'|`--print-armap']
+ [`-A'|`-o'|`--print-file-name'][`--special-syms']
+ [`-n'|`-v'|`--numeric-sort'] [`-p'|`--no-sort']
+ [`-r'|`--reverse-sort'] [`--size-sort'] [`-u'|`--undefined-only']
+ [`-t' RADIX|`--radix='RADIX] [`-P'|`--portability']
+ [`--target='BFDNAME] [`-f'FORMAT|`--format='FORMAT]
+ [`--defined-only'] [`-l'|`--line-numbers'] [`--no-demangle']
+ [`-V'|`--version'] [`-X 32_64'] [`--help'] [OBJFILE...]
+
+ GNU `nm' lists the symbols from object files OBJFILE.... If no
+object files are listed as arguments, `nm' assumes the file `a.out'.
+
+ For each symbol, `nm' shows:
+
+ * The symbol value, in the radix selected by options (see below), or
+ hexadecimal by default.
+
+ * The symbol type. At least the following types are used; others
+ are, as well, depending on the object file format. If lowercase,
+ the symbol is local; if uppercase, the symbol is global (external).
+
+ `A'
+ The symbol's value is absolute, and will not be changed by
+ further linking.
+
+ `B'
+ `b'
+ The symbol is in the uninitialized data section (known as
+ BSS).
+
+ `C'
+ The symbol is common. Common symbols are uninitialized data.
+ When linking, multiple common symbols may appear with the
+ same name. If the symbol is defined anywhere, the common
+ symbols are treated as undefined references. For more
+ details on common symbols, see the discussion of -warn-common
+ in *Note Linker options: (ld.info)Options.
+
+ `D'
+ `d'
+ The symbol is in the initialized data section.
+
+ `G'
+ `g'
+ The symbol is in an initialized data section for small
+ objects. Some object file formats permit more efficient
+ access to small data objects, such as a global int variable
+ as opposed to a large global array.
+
+ `i'
+ For PE format files this indicates that the symbol is in a
+ section specific to the implementation of DLLs. For ELF
+ format files this indicates that the symbol is an indirect
+ function. This is a GNU extension to the standard set of ELF
+ symbol types. It indicates a symbol which if referenced by a
+ relocation does not evaluate to its address, but instead must
+ be invoked at runtime. The runtime execution will then
+ return the value to be used in the relocation.
+
+ `N'
+ The symbol is a debugging symbol.
+
+ `p'
+ The symbols is in a stack unwind section.
+
+ `R'
+ `r'
+ The symbol is in a read only data section.
+
+ `S'
+ `s'
+ The symbol is in an uninitialized data section for small
+ objects.
+
+ `T'
+ `t'
+ The symbol is in the text (code) section.
+
+ `U'
+ The symbol is undefined.
+
+ `u'
+ The symbol is a unique global symbol. This is a GNU
+ extension to the standard set of ELF symbol bindings. For
+ such a symbol the dynamic linker will make sure that in the
+ entire process there is just one symbol with this name and
+ type in use.
+
+ `V'
+ `v'
+ The symbol is a weak object. When a weak defined symbol is
+ linked with a normal defined symbol, the normal defined
+ symbol is used with no error. When a weak undefined symbol
+ is linked and the symbol is not defined, the value of the
+ weak symbol becomes zero with no error. On some systems,
+ uppercase indicates that a default value has been specified.
+
+ `W'
+ `w'
+ The symbol is a weak symbol that has not been specifically
+ tagged as a weak object symbol. When a weak defined symbol
+ is linked with a normal defined symbol, the normal defined
+ symbol is used with no error. When a weak undefined symbol
+ is linked and the symbol is not defined, the value of the
+ symbol is determined in a system-specific manner without
+ error. On some systems, uppercase indicates that a default
+ value has been specified.
+
+ `-'
+ The symbol is a stabs symbol in an a.out object file. In
+ this case, the next values printed are the stabs other field,
+ the stabs desc field, and the stab type. Stabs symbols are
+ used to hold debugging information. For more information,
+ see *Note Stabs: (stabs.info)Top.
+
+ `?'
+ The symbol type is unknown, or object file format specific.
+
+ * The symbol name.
+
+ The long and short forms of options, shown here as alternatives, are
+equivalent.
+
+`-A'
+`-o'
+`--print-file-name'
+ Precede each symbol by the name of the input file (or archive
+ member) in which it was found, rather than identifying the input
+ file once only, before all of its symbols.
+
+`-a'
+`--debug-syms'
+ Display all symbols, even debugger-only symbols; normally these
+ are not listed.
+
+`-B'
+ The same as `--format=bsd' (for compatibility with the MIPS `nm').
+
+`-C'
+`--demangle[=STYLE]'
+ Decode ("demangle") low-level symbol names into user-level names.
+ Besides removing any initial underscore prepended by the system,
+ this makes C++ function names readable. Different compilers have
+ different mangling styles. The optional demangling style argument
+ can be used to choose an appropriate demangling style for your
+ compiler. *Note c++filt::, for more information on demangling.
+
+`--no-demangle'
+ Do not demangle low-level symbol names. This is the default.
+
+`-D'
+`--dynamic'
+ Display the dynamic symbols rather than the normal symbols. This
+ is only meaningful for dynamic objects, such as certain types of
+ shared libraries.
+
+`-f FORMAT'
+`--format=FORMAT'
+ Use the output format FORMAT, which can be `bsd', `sysv', or
+ `posix'. The default is `bsd'. Only the first character of
+ FORMAT is significant; it can be either upper or lower case.
+
+`-g'
+`--extern-only'
+ Display only external symbols.
+
+`--plugin NAME'
+ Load the plugin called NAME to add support for extra target types.
+ This option is only available if the toolchain has been built
+ with plugin support enabled.
+
+`-l'
+`--line-numbers'
+ For each symbol, use debugging information to try to find a
+ filename and line number. For a defined symbol, look for the line
+ number of the address of the symbol. For an undefined symbol,
+ look for the line number of a relocation entry which refers to the
+ symbol. If line number information can be found, print it after
+ the other symbol information.
+
+`-n'
+`-v'
+`--numeric-sort'
+ Sort symbols numerically by their addresses, rather than
+ alphabetically by their names.
+
+`-p'
+`--no-sort'
+ Do not bother to sort the symbols in any order; print them in the
+ order encountered.
+
+`-P'
+`--portability'
+ Use the POSIX.2 standard output format instead of the default
+ format. Equivalent to `-f posix'.
+
+`-S'
+`--print-size'
+ Print both value and size of defined symbols for the `bsd' output
+ style. This option has no effect for object formats that do not
+ record symbol sizes, unless `--size-sort' is also used in which
+ case a calculated size is displayed.
+
+`-s'
+`--print-armap'
+ When listing symbols from archive members, include the index: a
+ mapping (stored in the archive by `ar' or `ranlib') of which
+ modules contain definitions for which names.
+
+`-r'
+`--reverse-sort'
+ Reverse the order of the sort (whether numeric or alphabetic); let
+ the last come first.
+
+`--size-sort'
+ Sort symbols by size. The size is computed as the difference
+ between the value of the symbol and the value of the symbol with
+ the next higher value. If the `bsd' output format is used the
+ size of the symbol is printed, rather than the value, and `-S'
+ must be used in order both size and value to be printed.
+
+`--special-syms'
+ Display symbols which have a target-specific special meaning.
+ These symbols are usually used by the target for some special
+ processing and are not normally helpful when included included in
+ the normal symbol lists. For example for ARM targets this option
+ would skip the mapping symbols used to mark transitions between
+ ARM code, THUMB code and data.
+
+`-t RADIX'
+`--radix=RADIX'
+ Use RADIX as the radix for printing the symbol values. It must be
+ `d' for decimal, `o' for octal, or `x' for hexadecimal.
+
+`--target=BFDNAME'
+ Specify an object code format other than your system's default
+ format. *Note Target Selection::, for more information.
+
+`-u'
+`--undefined-only'
+ Display only undefined symbols (those external to each object
+ file).
+
+`--defined-only'
+ Display only defined symbols for each object file.
+
+`-V'
+`--version'
+ Show the version number of `nm' and exit.
+
+`-X'
+ This option is ignored for compatibility with the AIX version of
+ `nm'. It takes one parameter which must be the string `32_64'.
+ The default mode of AIX `nm' corresponds to `-X 32', which is not
+ supported by GNU `nm'.
+
+`--help'
+ Show a summary of the options to `nm' and exit.
+
+
+File: binutils.info, Node: objcopy, Next: objdump, Prev: nm, Up: Top
+
+3 objcopy
+*********
+
+ objcopy [`-F' BFDNAME|`--target='BFDNAME]
+ [`-I' BFDNAME|`--input-target='BFDNAME]
+ [`-O' BFDNAME|`--output-target='BFDNAME]
+ [`-B' BFDARCH|`--binary-architecture='BFDARCH]
+ [`-S'|`--strip-all']
+ [`-g'|`--strip-debug']
+ [`-K' SYMBOLNAME|`--keep-symbol='SYMBOLNAME]
+ [`-N' SYMBOLNAME|`--strip-symbol='SYMBOLNAME]
+ [`--strip-unneeded-symbol='SYMBOLNAME]
+ [`-G' SYMBOLNAME|`--keep-global-symbol='SYMBOLNAME]
+ [`--localize-hidden']
+ [`-L' SYMBOLNAME|`--localize-symbol='SYMBOLNAME]
+ [`--globalize-symbol='SYMBOLNAME]
+ [`-W' SYMBOLNAME|`--weaken-symbol='SYMBOLNAME]
+ [`-w'|`--wildcard']
+ [`-x'|`--discard-all']
+ [`-X'|`--discard-locals']
+ [`-b' BYTE|`--byte='BYTE]
+ [`-i' INTERLEAVE|`--interleave='INTERLEAVE]
+ [`-j' SECTIONNAME|`--only-section='SECTIONNAME]
+ [`-R' SECTIONNAME|`--remove-section='SECTIONNAME]
+ [`-p'|`--preserve-dates']
+ [`--debugging']
+ [`--gap-fill='VAL]
+ [`--pad-to='ADDRESS]
+ [`--set-start='VAL]
+ [`--adjust-start='INCR]
+ [`--change-addresses='INCR]
+ [`--change-section-address' SECTION{=,+,-}VAL]
+ [`--change-section-lma' SECTION{=,+,-}VAL]
+ [`--change-section-vma' SECTION{=,+,-}VAL]
+ [`--change-warnings'] [`--no-change-warnings']
+ [`--set-section-flags' SECTION=FLAGS]
+ [`--add-section' SECTIONNAME=FILENAME]
+ [`--rename-section' OLDNAME=NEWNAME[,FLAGS]]
+ [`--long-section-names' {enable,disable,keep}]
+ [`--change-leading-char'] [`--remove-leading-char']
+ [`--reverse-bytes='NUM]
+ [`--srec-len='IVAL] [`--srec-forceS3']
+ [`--redefine-sym' OLD=NEW]
+ [`--redefine-syms='FILENAME]
+ [`--weaken']
+ [`--keep-symbols='FILENAME]
+ [`--strip-symbols='FILENAME]
+ [`--strip-unneeded-symbols='FILENAME]
+ [`--keep-global-symbols='FILENAME]
+ [`--localize-symbols='FILENAME]
+ [`--globalize-symbols='FILENAME]
+ [`--weaken-symbols='FILENAME]
+ [`--alt-machine-code='INDEX]
+ [`--prefix-symbols='STRING]
+ [`--prefix-sections='STRING]
+ [`--prefix-alloc-sections='STRING]
+ [`--add-gnu-debuglink='PATH-TO-FILE]
+ [`--keep-file-symbols']
+ [`--only-keep-debug']
+ [`--extract-symbol']
+ [`--writable-text']
+ [`--readonly-text']
+ [`--pure']
+ [`--impure']
+ [`--file-alignment='NUM]
+ [`--heap='SIZE]
+ [`--image-base='ADDRESS]
+ [`--section-alignment='NUM]
+ [`--stack='SIZE]
+ [`--subsystem='WHICH:MAJOR.MINOR]
+ [`-v'|`--verbose']
+ [`-V'|`--version']
+ [`--help'] [`--info']
+ INFILE [OUTFILE]
+
+ The GNU `objcopy' utility copies the contents of an object file to
+another. `objcopy' uses the GNU BFD Library to read and write the
+object files. It can write the destination object file in a format
+different from that of the source object file. The exact behavior of
+`objcopy' is controlled by command-line options. Note that `objcopy'
+should be able to copy a fully linked file between any two formats.
+However, copying a relocatable object file between any two formats may
+not work as expected.
+
+ `objcopy' creates temporary files to do its translations and deletes
+them afterward. `objcopy' uses BFD to do all its translation work; it
+has access to all the formats described in BFD and thus is able to
+recognize most formats without being told explicitly. *Note BFD:
+(ld.info)BFD.
+
+ `objcopy' can be used to generate S-records by using an output
+target of `srec' (e.g., use `-O srec').
+
+ `objcopy' can be used to generate a raw binary file by using an
+output target of `binary' (e.g., use `-O binary'). When `objcopy'
+generates a raw binary file, it will essentially produce a memory dump
+of the contents of the input object file. All symbols and relocation
+information will be discarded. The memory dump will start at the load
+address of the lowest section copied into the output file.
+
+ When generating an S-record or a raw binary file, it may be helpful
+to use `-S' to remove sections containing debugging information. In
+some cases `-R' will be useful to remove sections which contain
+information that is not needed by the binary file.
+
+ Note--`objcopy' is not able to change the endianness of its input
+files. If the input format has an endianness (some formats do not),
+`objcopy' can only copy the inputs into file formats that have the same
+endianness or which have no endianness (e.g., `srec'). (However, see
+the `--reverse-bytes' option.)
+
+`INFILE'
+`OUTFILE'
+ The input and output files, respectively. If you do not specify
+ OUTFILE, `objcopy' creates a temporary file and destructively
+ renames the result with the name of INFILE.
+
+`-I BFDNAME'
+`--input-target=BFDNAME'
+ Consider the source file's object format to be BFDNAME, rather than
+ attempting to deduce it. *Note Target Selection::, for more
+ information.
+
+`-O BFDNAME'
+`--output-target=BFDNAME'
+ Write the output file using the object format BFDNAME. *Note
+ Target Selection::, for more information.
+
+`-F BFDNAME'
+`--target=BFDNAME'
+ Use BFDNAME as the object format for both the input and the output
+ file; i.e., simply transfer data from source to destination with no
+ translation. *Note Target Selection::, for more information.
+
+`-B BFDARCH'
+`--binary-architecture=BFDARCH'
+ Useful when transforming a raw binary input file into an object
+ file. In this case the output architecture can be set to BFDARCH.
+ This option will be ignored if the input file has a known BFDARCH.
+ You can access this binary data inside a program by referencing
+ the special symbols that are created by the conversion process.
+ These symbols are called _binary_OBJFILE_start,
+ _binary_OBJFILE_end and _binary_OBJFILE_size. e.g. you can
+ transform a picture file into an object file and then access it in
+ your code using these symbols.
+
+`-j SECTIONNAME'
+`--only-section=SECTIONNAME'
+ Copy only the named section from the input file to the output file.
+ This option may be given more than once. Note that using this
+ option inappropriately may make the output file unusable.
+
+`-R SECTIONNAME'
+`--remove-section=SECTIONNAME'
+ Remove any section named SECTIONNAME from the output file. This
+ option may be given more than once. Note that using this option
+ inappropriately may make the output file unusable.
+
+`-S'
+`--strip-all'
+ Do not copy relocation and symbol information from the source file.
+
+`-g'
+`--strip-debug'
+ Do not copy debugging symbols or sections from the source file.
+
+`--strip-unneeded'
+ Strip all symbols that are not needed for relocation processing.
+
+`-K SYMBOLNAME'
+`--keep-symbol=SYMBOLNAME'
+ When stripping symbols, keep symbol SYMBOLNAME even if it would
+ normally be stripped. This option may be given more than once.
+
+`-N SYMBOLNAME'
+`--strip-symbol=SYMBOLNAME'
+ Do not copy symbol SYMBOLNAME from the source file. This option
+ may be given more than once.
+
+`--strip-unneeded-symbol=SYMBOLNAME'
+ Do not copy symbol SYMBOLNAME from the source file unless it is
+ needed by a relocation. This option may be given more than once.
+
+`-G SYMBOLNAME'
+`--keep-global-symbol=SYMBOLNAME'
+ Keep only symbol SYMBOLNAME global. Make all other symbols local
+ to the file, so that they are not visible externally. This option
+ may be given more than once.
+
+`--localize-hidden'
+ In an ELF object, mark all symbols that have hidden or internal
+ visibility as local. This option applies on top of
+ symbol-specific localization options such as `-L'.
+
+`-L SYMBOLNAME'
+`--localize-symbol=SYMBOLNAME'
+ Make symbol SYMBOLNAME local to the file, so that it is not
+ visible externally. This option may be given more than once.
+
+`-W SYMBOLNAME'
+`--weaken-symbol=SYMBOLNAME'
+ Make symbol SYMBOLNAME weak. This option may be given more than
+ once.
+
+`--globalize-symbol=SYMBOLNAME'
+ Give symbol SYMBOLNAME global scoping so that it is visible
+ outside of the file in which it is defined. This option may be
+ given more than once.
+
+`-w'
+`--wildcard'
+ Permit regular expressions in SYMBOLNAMEs used in other command
+ line options. The question mark (?), asterisk (*), backslash (\)
+ and square brackets ([]) operators can be used anywhere in the
+ symbol name. If the first character of the symbol name is the
+ exclamation point (!) then the sense of the switch is reversed for
+ that symbol. For example:
+
+ -w -W !foo -W fo*
+
+ would cause objcopy to weaken all symbols that start with "fo"
+ except for the symbol "foo".
+
+`-x'
+`--discard-all'
+ Do not copy non-global symbols from the source file.
+
+`-X'
+`--discard-locals'
+ Do not copy compiler-generated local symbols. (These usually
+ start with `L' or `.'.)
+
+`-b BYTE'
+`--byte=BYTE'
+ Keep only every BYTEth byte of the input file (header data is not
+ affected). BYTE can be in the range from 0 to INTERLEAVE-1, where
+ INTERLEAVE is given by the `-i' or `--interleave' option, or the
+ default of 4. This option is useful for creating files to program
+ ROM. It is typically used with an `srec' output target.
+
+`-i INTERLEAVE'
+`--interleave=INTERLEAVE'
+ Only copy one out of every INTERLEAVE bytes. Select which byte to
+ copy with the `-b' or `--byte' option. The default is 4.
+ `objcopy' ignores this option if you do not specify either `-b' or
+ `--byte'.
+
+`-p'
+`--preserve-dates'
+ Set the access and modification dates of the output file to be the
+ same as those of the input file.
+
+`--debugging'
+ Convert debugging information, if possible. This is not the
+ default because only certain debugging formats are supported, and
+ the conversion process can be time consuming.
+
+`--gap-fill VAL'
+ Fill gaps between sections with VAL. This operation applies to
+ the _load address_ (LMA) of the sections. It is done by increasing
+ the size of the section with the lower address, and filling in the
+ extra space created with VAL.
+
+`--pad-to ADDRESS'
+ Pad the output file up to the load address ADDRESS. This is done
+ by increasing the size of the last section. The extra space is
+ filled in with the value specified by `--gap-fill' (default zero).
+
+`--set-start VAL'
+ Set the start address of the new file to VAL. Not all object file
+ formats support setting the start address.
+
+`--change-start INCR'
+`--adjust-start INCR'
+ Change the start address by adding INCR. Not all object file
+ formats support setting the start address.
+
+`--change-addresses INCR'
+`--adjust-vma INCR'
+ Change the VMA and LMA addresses of all sections, as well as the
+ start address, by adding INCR. Some object file formats do not
+ permit section addresses to be changed arbitrarily. Note that
+ this does not relocate the sections; if the program expects
+ sections to be loaded at a certain address, and this option is
+ used to change the sections such that they are loaded at a
+ different address, the program may fail.
+
+`--change-section-address SECTION{=,+,-}VAL'
+`--adjust-section-vma SECTION{=,+,-}VAL'
+ Set or change both the VMA address and the LMA address of the named
+ SECTION. If `=' is used, the section address is set to VAL.
+ Otherwise, VAL is added to or subtracted from the section address.
+ See the comments under `--change-addresses', above. If SECTION
+ does not exist in the input file, a warning will be issued, unless
+ `--no-change-warnings' is used.
+
+`--change-section-lma SECTION{=,+,-}VAL'
+ Set or change the LMA address of the named SECTION. The LMA
+ address is the address where the section will be loaded into
+ memory at program load time. Normally this is the same as the VMA
+ address, which is the address of the section at program run time,
+ but on some systems, especially those where a program is held in
+ ROM, the two can be different. If `=' is used, the section
+ address is set to VAL. Otherwise, VAL is added to or subtracted
+ from the section address. See the comments under
+ `--change-addresses', above. If SECTION does not exist in the
+ input file, a warning will be issued, unless
+ `--no-change-warnings' is used.
+
+`--change-section-vma SECTION{=,+,-}VAL'
+ Set or change the VMA address of the named SECTION. The VMA
+ address is the address where the section will be located once the
+ program has started executing. Normally this is the same as the
+ LMA address, which is the address where the section will be loaded
+ into memory, but on some systems, especially those where a program
+ is held in ROM, the two can be different. If `=' is used, the
+ section address is set to VAL. Otherwise, VAL is added to or
+ subtracted from the section address. See the comments under
+ `--change-addresses', above. If SECTION does not exist in the
+ input file, a warning will be issued, unless
+ `--no-change-warnings' is used.
+
+`--change-warnings'
+`--adjust-warnings'
+ If `--change-section-address' or `--change-section-lma' or
+ `--change-section-vma' is used, and the named section does not
+ exist, issue a warning. This is the default.
+
+`--no-change-warnings'
+`--no-adjust-warnings'
+ Do not issue a warning if `--change-section-address' or
+ `--adjust-section-lma' or `--adjust-section-vma' is used, even if
+ the named section does not exist.
+
+`--set-section-flags SECTION=FLAGS'
+ Set the flags for the named section. The FLAGS argument is a
+ comma separated string of flag names. The recognized names are
+ `alloc', `contents', `load', `noload', `readonly', `code', `data',
+ `rom', `share', and `debug'. You can set the `contents' flag for
+ a section which does not have contents, but it is not meaningful
+ to clear the `contents' flag of a section which does have
+ contents-just remove the section instead. Not all flags are
+ meaningful for all object file formats.
+
+`--add-section SECTIONNAME=FILENAME'
+ Add a new section named SECTIONNAME while copying the file. The
+ contents of the new section are taken from the file FILENAME. The
+ size of the section will be the size of the file. This option only
+ works on file formats which can support sections with arbitrary
+ names.
+
+`--rename-section OLDNAME=NEWNAME[,FLAGS]'
+ Rename a section from OLDNAME to NEWNAME, optionally changing the
+ section's flags to FLAGS in the process. This has the advantage
+ over usng a linker script to perform the rename in that the output
+ stays as an object file and does not become a linked executable.
+
+ This option is particularly helpful when the input format is
+ binary, since this will always create a section called .data. If
+ for example, you wanted instead to create a section called .rodata
+ containing binary data you could use the following command line to
+ achieve it:
+
+ objcopy -I binary -O <output_format> -B <architecture> \
+ --rename-section .data=.rodata,alloc,load,readonly,data,contents \
+ <input_binary_file> <output_object_file>
+
+`--long-section-names {enable,disable,keep}'
+ Controls the handling of long section names when processing `COFF'
+ and `PE-COFF' object formats. The default behaviour, `keep', is
+ to preserve long section names if any are present in the input
+ file. The `enable' and `disable' options forcibly enable or
+ disable the use of long section names in the output object; when
+ `disable' is in effect, any long section names in the input object
+ will be truncated. The `enable' option will only emit long
+ section names if any are present in the inputs; this is mostly the
+ same as `keep', but it is left undefined whether the `enable'
+ option might force the creation of an empty string table in the
+ output file.
+
+`--change-leading-char'
+ Some object file formats use special characters at the start of
+ symbols. The most common such character is underscore, which
+ compilers often add before every symbol. This option tells
+ `objcopy' to change the leading character of every symbol when it
+ converts between object file formats. If the object file formats
+ use the same leading character, this option has no effect.
+ Otherwise, it will add a character, or remove a character, or
+ change a character, as appropriate.
+
+`--remove-leading-char'
+ If the first character of a global symbol is a special symbol
+ leading character used by the object file format, remove the
+ character. The most common symbol leading character is
+ underscore. This option will remove a leading underscore from all
+ global symbols. This can be useful if you want to link together
+ objects of different file formats with different conventions for
+ symbol names. This is different from `--change-leading-char'
+ because it always changes the symbol name when appropriate,
+ regardless of the object file format of the output file.
+
+`--reverse-bytes=NUM'
+ Reverse the bytes in a section with output contents. A section
+ length must be evenly divisible by the value given in order for
+ the swap to be able to take place. Reversing takes place before
+ the interleaving is performed.
+
+ This option is used typically in generating ROM images for
+ problematic target systems. For example, on some target boards,
+ the 32-bit words fetched from 8-bit ROMs are re-assembled in
+ little-endian byte order regardless of the CPU byte order.
+ Depending on the programming model, the endianness of the ROM may
+ need to be modified.
+
+ Consider a simple file with a section containing the following
+ eight bytes: `12345678'.
+
+ Using `--reverse-bytes=2' for the above example, the bytes in the
+ output file would be ordered `21436587'.
+
+ Using `--reverse-bytes=4' for the above example, the bytes in the
+ output file would be ordered `43218765'.
+
+ By using `--reverse-bytes=2' for the above example, followed by
+ `--reverse-bytes=4' on the output file, the bytes in the second
+ output file would be ordered `34127856'.
+
+`--srec-len=IVAL'
+ Meaningful only for srec output. Set the maximum length of the
+ Srecords being produced to IVAL. This length covers both address,
+ data and crc fields.
+
+`--srec-forceS3'
+ Meaningful only for srec output. Avoid generation of S1/S2
+ records, creating S3-only record format.
+
+`--redefine-sym OLD=NEW'
+ Change the name of a symbol OLD, to NEW. This can be useful when
+ one is trying link two things together for which you have no
+ source, and there are name collisions.
+
+`--redefine-syms=FILENAME'
+ Apply `--redefine-sym' to each symbol pair "OLD NEW" listed in the
+ file FILENAME. FILENAME is simply a flat file, with one symbol
+ pair per line. Line comments may be introduced by the hash
+ character. This option may be given more than once.
+
+`--weaken'
+ Change all global symbols in the file to be weak. This can be
+ useful when building an object which will be linked against other
+ objects using the `-R' option to the linker. This option is only
+ effective when using an object file format which supports weak
+ symbols.
+
+`--keep-symbols=FILENAME'
+ Apply `--keep-symbol' option to each symbol listed in the file
+ FILENAME. FILENAME is simply a flat file, with one symbol name
+ per line. Line comments may be introduced by the hash character.
+ This option may be given more than once.
+
+`--strip-symbols=FILENAME'
+ Apply `--strip-symbol' option to each symbol listed in the file
+ FILENAME. FILENAME is simply a flat file, with one symbol name
+ per line. Line comments may be introduced by the hash character.
+ This option may be given more than once.
+
+`--strip-unneeded-symbols=FILENAME'
+ Apply `--strip-unneeded-symbol' option to each symbol listed in
+ the file FILENAME. FILENAME is simply a flat file, with one
+ symbol name per line. Line comments may be introduced by the hash
+ character. This option may be given more than once.
+
+`--keep-global-symbols=FILENAME'
+ Apply `--keep-global-symbol' option to each symbol listed in the
+ file FILENAME. FILENAME is simply a flat file, with one symbol
+ name per line. Line comments may be introduced by the hash
+ character. This option may be given more than once.
+
+`--localize-symbols=FILENAME'
+ Apply `--localize-symbol' option to each symbol listed in the file
+ FILENAME. FILENAME is simply a flat file, with one symbol name
+ per line. Line comments may be introduced by the hash character.
+ This option may be given more than once.
+
+`--globalize-symbols=FILENAME'
+ Apply `--globalize-symbol' option to each symbol listed in the file
+ FILENAME. FILENAME is simply a flat file, with one symbol name
+ per line. Line comments may be introduced by the hash character.
+ This option may be given more than once.
+
+`--weaken-symbols=FILENAME'
+ Apply `--weaken-symbol' option to each symbol listed in the file
+ FILENAME. FILENAME is simply a flat file, with one symbol name
+ per line. Line comments may be introduced by the hash character.
+ This option may be given more than once.
+
+`--alt-machine-code=INDEX'
+ If the output architecture has alternate machine codes, use the
+ INDEXth code instead of the default one. This is useful in case a
+ machine is assigned an official code and the tool-chain adopts the
+ new code, but other applications still depend on the original code
+ being used. For ELF based architectures if the INDEX alternative
+ does not exist then the value is treated as an absolute number to
+ be stored in the e_machine field of the ELF header.
+
+`--writable-text'
+ Mark the output text as writable. This option isn't meaningful
+ for all object file formats.
+
+`--readonly-text'
+ Make the output text write protected. This option isn't
+ meaningful for all object file formats.
+
+`--pure'
+ Mark the output file as demand paged. This option isn't
+ meaningful for all object file formats.
+
+`--impure'
+ Mark the output file as impure. This option isn't meaningful for
+ all object file formats.
+
+`--prefix-symbols=STRING'
+ Prefix all symbols in the output file with STRING.
+
+`--prefix-sections=STRING'
+ Prefix all section names in the output file with STRING.
+
+`--prefix-alloc-sections=STRING'
+ Prefix all the names of all allocated sections in the output file
+ with STRING.
+
+`--add-gnu-debuglink=PATH-TO-FILE'
+ Creates a .gnu_debuglink section which contains a reference to
+ PATH-TO-FILE and adds it to the output file.
+
+`--keep-file-symbols'
+ When stripping a file, perhaps with `--strip-debug' or
+ `--strip-unneeded', retain any symbols specifying source file
+ names, which would otherwise get stripped.
+
+`--only-keep-debug'
+ Strip a file, removing contents of any sections that would not be
+ stripped by `--strip-debug' and leaving the debugging sections
+ intact. In ELF files, this preserves all note sections in the
+ output.
+
+ The intention is that this option will be used in conjunction with
+ `--add-gnu-debuglink' to create a two part executable. One a
+ stripped binary which will occupy less space in RAM and in a
+ distribution and the second a debugging information file which is
+ only needed if debugging abilities are required. The suggested
+ procedure to create these files is as follows:
+
+ 1. Link the executable as normal. Assuming that is is called
+ `foo' then...
+
+ 2. Run `objcopy --only-keep-debug foo foo.dbg' to create a file
+ containing the debugging info.
+
+ 3. Run `objcopy --strip-debug foo' to create a stripped
+ executable.
+
+ 4. Run `objcopy --add-gnu-debuglink=foo.dbg foo' to add a link
+ to the debugging info into the stripped executable.
+
+ Note--the choice of `.dbg' as an extension for the debug info file
+ is arbitrary. Also the `--only-keep-debug' step is optional. You
+ could instead do this:
+
+ 1. Link the executable as normal.
+
+ 2. Copy `foo' to `foo.full'
+
+ 3. Run `objcopy --strip-debug foo'
+
+ 4. Run `objcopy --add-gnu-debuglink=foo.full foo'
+
+ i.e., the file pointed to by the `--add-gnu-debuglink' can be the
+ full executable. It does not have to be a file created by the
+ `--only-keep-debug' switch.
+
+ Note--this switch is only intended for use on fully linked files.
+ It does not make sense to use it on object files where the
+ debugging information may be incomplete. Besides the
+ gnu_debuglink feature currently only supports the presence of one
+ filename containing debugging information, not multiple filenames
+ on a one-per-object-file basis.
+
+`--file-alignment NUM'
+ Specify the file alignment. Sections in the file will always
+ begin at file offsets which are multiples of this number. This
+ defaults to 512. [This option is specific to PE targets.]
+
+`--heap RESERVE'
+`--heap RESERVE,COMMIT'
+ Specify the number of bytes of memory to reserve (and optionally
+ commit) to be used as heap for this program. [This option is
+ specific to PE targets.]
+
+`--image-base VALUE'
+ Use VALUE as the base address of your program or dll. This is the
+ lowest memory location that will be used when your program or dll
+ is loaded. To reduce the need to relocate and improve performance
+ of your dlls, each should have a unique base address and not
+ overlap any other dlls. The default is 0x400000 for executables,
+ and 0x10000000 for dlls. [This option is specific to PE targets.]
+
+`--section-alignment NUM'
+ Sets the section alignment. Sections in memory will always begin
+ at addresses which are a multiple of this number. Defaults to
+ 0x1000. [This option is specific to PE targets.]
+
+`--stack RESERVE'
+`--stack RESERVE,COMMIT'
+ Specify the number of bytes of memory to reserve (and optionally
+ commit) to be used as stack for this program. [This option is
+ specific to PE targets.]
+
+`--subsystem WHICH'
+`--subsystem WHICH:MAJOR'
+`--subsystem WHICH:MAJOR.MINOR'
+ Specifies the subsystem under which your program will execute. The
+ legal values for WHICH are `native', `windows', `console',
+ `posix', `efi-app', `efi-bsd', `efi-rtd', `sal-rtd', and `xbox'.
+ You may optionally set the subsystem version also. Numeric values
+ are also accepted for WHICH. [This option is specific to PE
+ targets.]
+
+`--extract-symbol'
+ Keep the file's section flags and symbols but remove all section
+ data. Specifically, the option:
+
+ * removes the contents of all sections;
+
+ * sets the size of every section to zero; and
+
+ * sets the file's start address to zero.
+
+ This option is used to build a `.sym' file for a VxWorks kernel.
+ It can also be a useful way of reducing the size of a
+ `--just-symbols' linker input file.
+
+`-V'
+`--version'
+ Show the version number of `objcopy'.
+
+`-v'
+`--verbose'
+ Verbose output: list all object files modified. In the case of
+ archives, `objcopy -V' lists all members of the archive.
+
+`--help'
+ Show a summary of the options to `objcopy'.
+
+`--info'
+ Display a list showing all architectures and object formats
+ available.
+
+
+File: binutils.info, Node: objdump, Next: ranlib, Prev: objcopy, Up: Top
+
+4 objdump
+*********
+
+ objdump [`-a'|`--archive-headers']
+ [`-b' BFDNAME|`--target=BFDNAME']
+ [`-C'|`--demangle'[=STYLE] ]
+ [`-d'|`--disassemble']
+ [`-D'|`--disassemble-all']
+ [`-z'|`--disassemble-zeroes']
+ [`-EB'|`-EL'|`--endian='{big | little }]
+ [`-f'|`--file-headers']
+ [`-F'|`--file-offsets']
+ [`--file-start-context']
+ [`-g'|`--debugging']
+ [`-e'|`--debugging-tags']
+ [`-h'|`--section-headers'|`--headers']
+ [`-i'|`--info']
+ [`-j' SECTION|`--section='SECTION]
+ [`-l'|`--line-numbers']
+ [`-S'|`--source']
+ [`-m' MACHINE|`--architecture='MACHINE]
+ [`-M' OPTIONS|`--disassembler-options='OPTIONS]
+ [`-p'|`--private-headers']
+ [`-r'|`--reloc']
+ [`-R'|`--dynamic-reloc']
+ [`-s'|`--full-contents']
+ [`-W[lLiaprmfFsoR]'|
+ `--dwarf'[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]]
+ [`-G'|`--stabs']
+ [`-t'|`--syms']
+ [`-T'|`--dynamic-syms']
+ [`-x'|`--all-headers']
+ [`-w'|`--wide']
+ [`--start-address='ADDRESS]
+ [`--stop-address='ADDRESS]
+ [`--prefix-addresses']
+ [`--[no-]show-raw-insn']
+ [`--adjust-vma='OFFSET]
+ [`--special-syms']
+ [`--prefix='PREFIX]
+ [`--prefix-strip='LEVEL]
+ [`--insn-width='WIDTH]
+ [`-V'|`--version']
+ [`-H'|`--help']
+ OBJFILE...
+
+ `objdump' displays information about one or more object files. The
+options control what particular information to display. This
+information is mostly useful to programmers who are working on the
+compilation tools, as opposed to programmers who just want their
+program to compile and work.
+
+ OBJFILE... are the object files to be examined. When you specify
+archives, `objdump' shows information on each of the member object
+files.
+
+ The long and short forms of options, shown here as alternatives, are
+equivalent. At least one option from the list
+`-a,-d,-D,-e,-f,-g,-G,-h,-H,-p,-r,-R,-s,-S,-t,-T,-V,-x' must be given.
+
+`-a'
+`--archive-header'
+ If any of the OBJFILE files are archives, display the archive
+ header information (in a format similar to `ls -l'). Besides the
+ information you could list with `ar tv', `objdump -a' shows the
+ object file format of each archive member.
+
+`--adjust-vma=OFFSET'
+ When dumping information, first add OFFSET to all the section
+ addresses. This is useful if the section addresses do not
+ correspond to the symbol table, which can happen when putting
+ sections at particular addresses when using a format which can not
+ represent section addresses, such as a.out.
+
+`-b BFDNAME'
+`--target=BFDNAME'
+ Specify that the object-code format for the object files is
+ BFDNAME. This option may not be necessary; OBJDUMP can
+ automatically recognize many formats.
+
+ For example,
+ objdump -b oasys -m vax -h fu.o
+ displays summary information from the section headers (`-h') of
+ `fu.o', which is explicitly identified (`-m') as a VAX object file
+ in the format produced by Oasys compilers. You can list the
+ formats available with the `-i' option. *Note Target Selection::,
+ for more information.
+
+`-C'
+`--demangle[=STYLE]'
+ Decode ("demangle") low-level symbol names into user-level names.
+ Besides removing any initial underscore prepended by the system,
+ this makes C++ function names readable. Different compilers have
+ different mangling styles. The optional demangling style argument
+ can be used to choose an appropriate demangling style for your
+ compiler. *Note c++filt::, for more information on demangling.
+
+`-g'
+`--debugging'
+ Display debugging information. This attempts to parse STABS and
+ IEEE debugging format information stored in the file and print it
+ out using a C like syntax. If neither of these formats are found
+ this option falls back on the `-W' option to print any DWARF
+ information in the file.
+
+`-e'
+`--debugging-tags'
+ Like `-g', but the information is generated in a format compatible
+ with ctags tool.
+
+`-d'
+`--disassemble'
+ Display the assembler mnemonics for the machine instructions from
+ OBJFILE. This option only disassembles those sections which are
+ expected to contain instructions.
+
+`-D'
+`--disassemble-all'
+ Like `-d', but disassemble the contents of all sections, not just
+ those expected to contain instructions.
+
+ If the target is an ARM architecture this switch also has the
+ effect of forcing the disassembler to decode pieces of data found
+ in code sections as if they were instructions.
+
+`--prefix-addresses'
+ When disassembling, print the complete address on each line. This
+ is the older disassembly format.
+
+`-EB'
+`-EL'
+`--endian={big|little}'
+ Specify the endianness of the object files. This only affects
+ disassembly. This can be useful when disassembling a file format
+ which does not describe endianness information, such as S-records.
+
+`-f'
+`--file-headers'
+ Display summary information from the overall header of each of the
+ OBJFILE files.
+
+`-F'
+`--file-offsets'
+ When disassembling sections, whenever a symbol is displayed, also
+ display the file offset of the region of data that is about to be
+ dumped. If zeroes are being skipped, then when disassembly
+ resumes, tell the user how many zeroes were skipped and the file
+ offset of the location from where the disassembly resumes. When
+ dumping sections, display the file offset of the location from
+ where the dump starts.
+
+`--file-start-context'
+ Specify that when displaying interlisted source code/disassembly
+ (assumes `-S') from a file that has not yet been displayed, extend
+ the context to the start of the file.
+
+`-h'
+`--section-headers'
+`--headers'
+ Display summary information from the section headers of the object
+ file.
+
+ File segments may be relocated to nonstandard addresses, for
+ example by using the `-Ttext', `-Tdata', or `-Tbss' options to
+ `ld'. However, some object file formats, such as a.out, do not
+ store the starting address of the file segments. In those
+ situations, although `ld' relocates the sections correctly, using
+ `objdump -h' to list the file section headers cannot show the
+ correct addresses. Instead, it shows the usual addresses, which
+ are implicit for the target.
+
+`-H'
+`--help'
+ Print a summary of the options to `objdump' and exit.
+
+`-i'
+`--info'
+ Display a list showing all architectures and object formats
+ available for specification with `-b' or `-m'.
+
+`-j NAME'
+`--section=NAME'
+ Display information only for section NAME.
+
+`-l'
+`--line-numbers'
+ Label the display (using debugging information) with the filename
+ and source line numbers corresponding to the object code or relocs
+ shown. Only useful with `-d', `-D', or `-r'.
+
+`-m MACHINE'
+`--architecture=MACHINE'
+ Specify the architecture to use when disassembling object files.
+ This can be useful when disassembling object files which do not
+ describe architecture information, such as S-records. You can
+ list the available architectures with the `-i' option.
+
+ If the target is an ARM architecture then this switch has an
+ additional effect. It restricts the disassembly to only those
+ instructions supported by the architecture specified by MACHINE.
+ If it is necessary to use this switch because the input file does
+ not contain any architecture information, but it is also desired to
+ disassemble all the instructions use `-marm'.
+
+`-M OPTIONS'
+`--disassembler-options=OPTIONS'
+ Pass target specific information to the disassembler. Only
+ supported on some targets. If it is necessary to specify more
+ than one disassembler option then multiple `-M' options can be
+ used or can be placed together into a comma separated list.
+
+ If the target is an ARM architecture then this switch can be used
+ to select which register name set is used during disassembler.
+ Specifying `-M reg-names-std' (the default) will select the
+ register names as used in ARM's instruction set documentation, but
+ with register 13 called 'sp', register 14 called 'lr' and register
+ 15 called 'pc'. Specifying `-M reg-names-apcs' will select the
+ name set used by the ARM Procedure Call Standard, whilst
+ specifying `-M reg-names-raw' will just use `r' followed by the
+ register number.
+
+ There are also two variants on the APCS register naming scheme
+ enabled by `-M reg-names-atpcs' and `-M reg-names-special-atpcs'
+ which use the ARM/Thumb Procedure Call Standard naming
+ conventions. (Either with the normal register names or the
+ special register names).
+
+ This option can also be used for ARM architectures to force the
+ disassembler to interpret all instructions as Thumb instructions by
+ using the switch `--disassembler-options=force-thumb'. This can be
+ useful when attempting to disassemble thumb code produced by other
+ compilers.
+
+ For the x86, some of the options duplicate functions of the `-m'
+ switch, but allow finer grained control. Multiple selections from
+ the following may be specified as a comma separated string.
+ `x86-64', `i386' and `i8086' select disassembly for the given
+ architecture. `intel' and `att' select between intel syntax mode
+ and AT&T syntax mode. `intel-mnemonic' and `att-mnemonic' select
+ between intel mnemonic mode and AT&T mnemonic mode.
+ `intel-mnemonic' implies `intel' and `att-mnemonic' implies `att'.
+ `addr64', `addr32', `addr16', `data32' and `data16' specify the
+ default address size and operand size. These four options will be
+ overridden if `x86-64', `i386' or `i8086' appear later in the
+ option string. Lastly, `suffix', when in AT&T mode, instructs the
+ disassembler to print a mnemonic suffix even when the suffix could
+ be inferred by the operands.
+
+ For PowerPC, `booke' controls the disassembly of BookE
+ instructions. `32' and `64' select PowerPC and PowerPC64
+ disassembly, respectively. `e300' selects disassembly for the
+ e300 family. `440' selects disassembly for the PowerPC 440.
+ `ppcps' selects disassembly for the paired single instructions of
+ the PPC750CL.
+
+ For MIPS, this option controls the printing of instruction mnemonic
+ names and register names in disassembled instructions. Multiple
+ selections from the following may be specified as a comma separated
+ string, and invalid options are ignored:
+
+ `no-aliases'
+ Print the 'raw' instruction mnemonic instead of some pseudo
+ instruction mnemonic. I.e., print 'daddu' or 'or' instead of
+ 'move', 'sll' instead of 'nop', etc.
+
+ `gpr-names=ABI'
+ Print GPR (general-purpose register) names as appropriate for
+ the specified ABI. By default, GPR names are selected
+ according to the ABI of the binary being disassembled.
+
+ `fpr-names=ABI'
+ Print FPR (floating-point register) names as appropriate for
+ the specified ABI. By default, FPR numbers are printed
+ rather than names.
+
+ `cp0-names=ARCH'
+ Print CP0 (system control coprocessor; coprocessor 0)
+ register names as appropriate for the CPU or architecture
+ specified by ARCH. By default, CP0 register names are
+ selected according to the architecture and CPU of the binary
+ being disassembled.
+
+ `hwr-names=ARCH'
+ Print HWR (hardware register, used by the `rdhwr'
+ instruction) names as appropriate for the CPU or architecture
+ specified by ARCH. By default, HWR names are selected
+ according to the architecture and CPU of the binary being
+ disassembled.
+
+ `reg-names=ABI'
+ Print GPR and FPR names as appropriate for the selected ABI.
+
+ `reg-names=ARCH'
+ Print CPU-specific register names (CP0 register and HWR names)
+ as appropriate for the selected CPU or architecture.
+
+ For any of the options listed above, ABI or ARCH may be specified
+ as `numeric' to have numbers printed rather than names, for the
+ selected types of registers. You can list the available values of
+ ABI and ARCH using the `--help' option.
+
+ For VAX, you can specify function entry addresses with `-M
+ entry:0xf00ba'. You can use this multiple times to properly
+ disassemble VAX binary files that don't contain symbol tables (like
+ ROM dumps). In these cases, the function entry mask would
+ otherwise be decoded as VAX instructions, which would probably
+ lead the rest of the function being wrongly disassembled.
+
+`-p'
+`--private-headers'
+ Print information that is specific to the object file format. The
+ exact information printed depends upon the object file format.
+ For some object file formats, no additional information is printed.
+
+`-r'
+`--reloc'
+ Print the relocation entries of the file. If used with `-d' or
+ `-D', the relocations are printed interspersed with the
+ disassembly.
+
+`-R'
+`--dynamic-reloc'
+ Print the dynamic relocation entries of the file. This is only
+ meaningful for dynamic objects, such as certain types of shared
+ libraries. As for `-r', if used with `-d' or `-D', the
+ relocations are printed interspersed with the disassembly.
+
+`-s'
+`--full-contents'
+ Display the full contents of any sections requested. By default
+ all non-empty sections are displayed.
+
+`-S'
+`--source'
+ Display source code intermixed with disassembly, if possible.
+ Implies `-d'.
+
+`--prefix=PREFIX'
+ Specify PREFIX to add to the absolute paths when used with `-S'.
+
+`--prefix-strip=LEVEL'
+ Indicate how many initial directory names to strip off the
+ hardwired absolute paths. It has no effect without
+ `--prefix='PREFIX.
+
+`--show-raw-insn'
+ When disassembling instructions, print the instruction in hex as
+ well as in symbolic form. This is the default except when
+ `--prefix-addresses' is used.
+
+`--no-show-raw-insn'
+ When disassembling instructions, do not print the instruction
+ bytes. This is the default when `--prefix-addresses' is used.
+
+`--insn-width=WIDTH'
+ Display WIDTH bytes on a single line when disassembling
+ instructions.
+
+`-W[lLiaprmfFsoR]'
+`--dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]'
+ Displays the contents of the debug sections in the file, if any are
+ present. If one of the optional letters or words follows the
+ switch then only data found in those specific sections will be
+ dumped.
+
+`-G'
+`--stabs'
+ Display the full contents of any sections requested. Display the
+ contents of the .stab and .stab.index and .stab.excl sections from
+ an ELF file. This is only useful on systems (such as Solaris 2.0)
+ in which `.stab' debugging symbol-table entries are carried in an
+ ELF section. In most other file formats, debugging symbol-table
+ entries are interleaved with linkage symbols, and are visible in
+ the `--syms' output. For more information on stabs symbols, see
+ *Note Stabs: (stabs.info)Top.
+
+`--start-address=ADDRESS'
+ Start displaying data at the specified address. This affects the
+ output of the `-d', `-r' and `-s' options.
+
+`--stop-address=ADDRESS'
+ Stop displaying data at the specified address. This affects the
+ output of the `-d', `-r' and `-s' options.
+
+`-t'
+`--syms'
+ Print the symbol table entries of the file. This is similar to
+ the information provided by the `nm' program, although the display
+ format is different. The format of the output depends upon the
+ format of the file being dumped, but there are two main types.
+ One looks like this:
+
+ [ 4](sec 3)(fl 0x00)(ty 0)(scl 3) (nx 1) 0x00000000 .bss
+ [ 6](sec 1)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 fred
+
+ where the number inside the square brackets is the number of the
+ entry in the symbol table, the SEC number is the section number,
+ the FL value are the symbol's flag bits, the TY number is the
+ symbol's type, the SCL number is the symbol's storage class and
+ the NX value is the number of auxilary entries associated with the
+ symbol. The last two fields are the symbol's value and its name.
+
+ The other common output format, usually seen with ELF based files,
+ looks like this:
+
+ 00000000 l d .bss 00000000 .bss
+ 00000000 g .text 00000000 fred
+
+ Here the first number is the symbol's value (sometimes refered to
+ as its address). The next field is actually a set of characters
+ and spaces indicating the flag bits that are set on the symbol.
+ These characters are described below. Next is the section with
+ which the symbol is associated or _*ABS*_ if the section is
+ absolute (ie not connected with any section), or _*UND*_ if the
+ section is referenced in the file being dumped, but not defined
+ there.
+
+ After the section name comes another field, a number, which for
+ common symbols is the alignment and for other symbol is the size.
+ Finally the symbol's name is displayed.
+
+ The flag characters are divided into 7 groups as follows:
+ `l'
+ `g'
+ `u'
+ `!'
+ The symbol is a local (l), global (g), unique global (u),
+ neither global nor local (a space) or both global and local
+ (!). A symbol can be neither local or global for a variety
+ of reasons, e.g., because it is used for debugging, but it is
+ probably an indication of a bug if it is ever both local and
+ global. Unique global symbols are a GNU extension to the
+ standard set of ELF symbol bindings. For such a symbol the
+ dynamic linker will make sure that in the entire process
+ there is just one symbol with this name and type in use.
+
+ `w'
+ The symbol is weak (w) or strong (a space).
+
+ `C'
+ The symbol denotes a constructor (C) or an ordinary symbol (a
+ space).
+
+ `W'
+ The symbol is a warning (W) or a normal symbol (a space). A
+ warning symbol's name is a message to be displayed if the
+ symbol following the warning symbol is ever referenced.
+
+ `I'
+
+ `i'
+ The symbol is an indirect reference to another symbol (I), a
+ function to be evaluated during reloc processing (i) or a
+ normal symbol (a space).
+
+ `d'
+ `D'
+ The symbol is a debugging symbol (d) or a dynamic symbol (D)
+ or a normal symbol (a space).
+
+ `F'
+
+ `f'
+
+ `O'
+ The symbol is the name of a function (F) or a file (f) or an
+ object (O) or just a normal symbol (a space).
+
+`-T'
+`--dynamic-syms'
+ Print the dynamic symbol table entries of the file. This is only
+ meaningful for dynamic objects, such as certain types of shared
+ libraries. This is similar to the information provided by the `nm'
+ program when given the `-D' (`--dynamic') option.
+
+`--special-syms'
+ When displaying symbols include those which the target considers
+ to be special in some way and which would not normally be of
+ interest to the user.
+
+`-V'
+`--version'
+ Print the version number of `objdump' and exit.
+
+`-x'
+`--all-headers'
+ Display all available header information, including the symbol
+ table and relocation entries. Using `-x' is equivalent to
+ specifying all of `-a -f -h -p -r -t'.
+
+`-w'
+`--wide'
+ Format some lines for output devices that have more than 80
+ columns. Also do not truncate symbol names when they are
+ displayed.
+
+`-z'
+`--disassemble-zeroes'
+ Normally the disassembly output will skip blocks of zeroes. This
+ option directs the disassembler to disassemble those blocks, just
+ like any other data.
+
+
+File: binutils.info, Node: ranlib, Next: readelf, Prev: objdump, Up: Top
+
+5 ranlib
+********
+
+ ranlib [`-vVt'] ARCHIVE
+
+ `ranlib' generates an index to the contents of an archive and stores
+it in the archive. The index lists each symbol defined by a member of
+an archive that is a relocatable object file.
+
+ You may use `nm -s' or `nm --print-armap' to list this index.
+
+ An archive with such an index speeds up linking to the library and
+allows routines in the library to call each other without regard to
+their placement in the archive.
+
+ The GNU `ranlib' program is another form of GNU `ar'; running
+`ranlib' is completely equivalent to executing `ar -s'. *Note ar::.
+
+`-v'
+`-V'
+`--version'
+ Show the version number of `ranlib'.
+
+`-t'
+ Update the timestamp of the symbol map of an archive.
+
+
+File: binutils.info, Node: size, Next: strings, Prev: readelf, Up: Top
+
+6 size
+******
+
+ size [`-A'|`-B'|`--format='COMPATIBILITY]
+ [`--help']
+ [`-d'|`-o'|`-x'|`--radix='NUMBER]
+ [`--common']
+ [`-t'|`--totals']
+ [`--target='BFDNAME] [`-V'|`--version']
+ [OBJFILE...]
+
+ The GNU `size' utility lists the section sizes--and the total
+size--for each of the object or archive files OBJFILE in its argument
+list. By default, one line of output is generated for each object file
+or each module in an archive.
+
+ OBJFILE... are the object files to be examined. If none are
+specified, the file `a.out' will be used.
+
+ The command line options have the following meanings:
+
+`-A'
+`-B'
+`--format=COMPATIBILITY'
+ Using one of these options, you can choose whether the output from
+ GNU `size' resembles output from System V `size' (using `-A', or
+ `--format=sysv'), or Berkeley `size' (using `-B', or
+ `--format=berkeley'). The default is the one-line format similar
+ to Berkeley's.
+
+ Here is an example of the Berkeley (default) format of output from
+ `size':
+ $ size --format=Berkeley ranlib size
+ text data bss dec hex filename
+ 294880 81920 11592 388392 5ed28 ranlib
+ 294880 81920 11888 388688 5ee50 size
+
+ This is the same data, but displayed closer to System V
+ conventions:
+
+ $ size --format=SysV ranlib size
+ ranlib :
+ section size addr
+ .text 294880 8192
+ .data 81920 303104
+ .bss 11592 385024
+ Total 388392
+
+
+ size :
+ section size addr
+ .text 294880 8192
+ .data 81920 303104
+ .bss 11888 385024
+ Total 388688
+
+`--help'
+ Show a summary of acceptable arguments and options.
+
+`-d'
+`-o'
+`-x'
+`--radix=NUMBER'
+ Using one of these options, you can control whether the size of
+ each section is given in decimal (`-d', or `--radix=10'); octal
+ (`-o', or `--radix=8'); or hexadecimal (`-x', or `--radix=16').
+ In `--radix=NUMBER', only the three values (8, 10, 16) are
+ supported. The total size is always given in two radices; decimal
+ and hexadecimal for `-d' or `-x' output, or octal and hexadecimal
+ if you're using `-o'.
+
+`--common'
+ Print total size of common symbols in each file. When using
+ Berkeley format these are included in the bss size.
+
+`-t'
+`--totals'
+ Show totals of all objects listed (Berkeley format listing mode
+ only).
+
+`--target=BFDNAME'
+ Specify that the object-code format for OBJFILE is BFDNAME. This
+ option may not be necessary; `size' can automatically recognize
+ many formats. *Note Target Selection::, for more information.
+
+`-V'
+`--version'
+ Display the version number of `size'.
+
+
+File: binutils.info, Node: strings, Next: strip, Prev: size, Up: Top
+
+7 strings
+*********
+
+ strings [`-afovV'] [`-'MIN-LEN]
+ [`-n' MIN-LEN] [`--bytes='MIN-LEN]
+ [`-t' RADIX] [`--radix='RADIX]
+ [`-e' ENCODING] [`--encoding='ENCODING]
+ [`-'] [`--all'] [`--print-file-name']
+ [`-T' BFDNAME] [`--target='BFDNAME]
+ [`--help'] [`--version'] FILE...
+
+ For each FILE given, GNU `strings' prints the printable character
+sequences that are at least 4 characters long (or the number given with
+the options below) and are followed by an unprintable character. By
+default, it only prints the strings from the initialized and loaded
+sections of object files; for other types of files, it prints the
+strings from the whole file.
+
+ `strings' is mainly useful for determining the contents of non-text
+files.
+
+`-a'
+`--all'
+`-'
+ Do not scan only the initialized and loaded sections of object
+ files; scan the whole files.
+
+`-f'
+`--print-file-name'
+ Print the name of the file before each string.
+
+`--help'
+ Print a summary of the program usage on the standard output and
+ exit.
+
+`-MIN-LEN'
+`-n MIN-LEN'
+`--bytes=MIN-LEN'
+ Print sequences of characters that are at least MIN-LEN characters
+ long, instead of the default 4.
+
+`-o'
+ Like `-t o'. Some other versions of `strings' have `-o' act like
+ `-t d' instead. Since we can not be compatible with both ways, we
+ simply chose one.
+
+`-t RADIX'
+`--radix=RADIX'
+ Print the offset within the file before each string. The single
+ character argument specifies the radix of the offset--`o' for
+ octal, `x' for hexadecimal, or `d' for decimal.
+
+`-e ENCODING'
+`--encoding=ENCODING'
+ Select the character encoding of the strings that are to be found.
+ Possible values for ENCODING are: `s' = single-7-bit-byte
+ characters (ASCII, ISO 8859, etc., default), `S' =
+ single-8-bit-byte characters, `b' = 16-bit bigendian, `l' = 16-bit
+ littleendian, `B' = 32-bit bigendian, `L' = 32-bit littleendian.
+ Useful for finding wide character strings. (`l' and `b' apply to,
+ for example, Unicode UTF-16/UCS-2 encodings).
+
+`-T BFDNAME'
+`--target=BFDNAME'
+ Specify an object code format other than your system's default
+ format. *Note Target Selection::, for more information.
+
+`-v'
+`-V'
+`--version'
+ Print the program version number on the standard output and exit.
+
+
+File: binutils.info, Node: strip, Next: c++filt, Prev: strings, Up: Top
+
+8 strip
+*******
+
+ strip [`-F' BFDNAME |`--target='BFDNAME]
+ [`-I' BFDNAME |`--input-target='BFDNAME]
+ [`-O' BFDNAME |`--output-target='BFDNAME]
+ [`-s'|`--strip-all']
+ [`-S'|`-g'|`-d'|`--strip-debug']
+ [`-K' SYMBOLNAME |`--keep-symbol='SYMBOLNAME]
+ [`-N' SYMBOLNAME |`--strip-symbol='SYMBOLNAME]
+ [`-w'|`--wildcard']
+ [`-x'|`--discard-all'] [`-X' |`--discard-locals']
+ [`-R' SECTIONNAME |`--remove-section='SECTIONNAME]
+ [`-o' FILE] [`-p'|`--preserve-dates']
+ [`--keep-file-symbols']
+ [`--only-keep-debug']
+ [`-v' |`--verbose'] [`-V'|`--version']
+ [`--help'] [`--info']
+ OBJFILE...
+
+ GNU `strip' discards all symbols from object files OBJFILE. The
+list of object files may include archives. At least one object file
+must be given.
+
+ `strip' modifies the files named in its argument, rather than
+writing modified copies under different names.
+
+`-F BFDNAME'
+`--target=BFDNAME'
+ Treat the original OBJFILE as a file with the object code format
+ BFDNAME, and rewrite it in the same format. *Note Target
+ Selection::, for more information.
+
+`--help'
+ Show a summary of the options to `strip' and exit.
+
+`--info'
+ Display a list showing all architectures and object formats
+ available.
+
+`-I BFDNAME'
+`--input-target=BFDNAME'
+ Treat the original OBJFILE as a file with the object code format
+ BFDNAME. *Note Target Selection::, for more information.
+
+`-O BFDNAME'
+`--output-target=BFDNAME'
+ Replace OBJFILE with a file in the output format BFDNAME. *Note
+ Target Selection::, for more information.
+
+`-R SECTIONNAME'
+`--remove-section=SECTIONNAME'
+ Remove any section named SECTIONNAME from the output file. This
+ option may be given more than once. Note that using this option
+ inappropriately may make the output file unusable.
+
+`-s'
+`--strip-all'
+ Remove all symbols.
+
+`-g'
+`-S'
+`-d'
+`--strip-debug'
+ Remove debugging symbols only.
+
+`--strip-unneeded'
+ Remove all symbols that are not needed for relocation processing.
+
+`-K SYMBOLNAME'
+`--keep-symbol=SYMBOLNAME'
+ When stripping symbols, keep symbol SYMBOLNAME even if it would
+ normally be stripped. This option may be given more than once.
+
+`-N SYMBOLNAME'
+`--strip-symbol=SYMBOLNAME'
+ Remove symbol SYMBOLNAME from the source file. This option may be
+ given more than once, and may be combined with strip options other
+ than `-K'.
+
+`-o FILE'
+ Put the stripped output in FILE, rather than replacing the
+ existing file. When this argument is used, only one OBJFILE
+ argument may be specified.
+
+`-p'
+`--preserve-dates'
+ Preserve the access and modification dates of the file.
+
+`-w'
+`--wildcard'
+ Permit regular expressions in SYMBOLNAMEs used in other command
+ line options. The question mark (?), asterisk (*), backslash (\)
+ and square brackets ([]) operators can be used anywhere in the
+ symbol name. If the first character of the symbol name is the
+ exclamation point (!) then the sense of the switch is reversed for
+ that symbol. For example:
+
+ -w -K !foo -K fo*
+
+ would cause strip to only keep symbols that start with the letters
+ "fo", but to discard the symbol "foo".
+
+`-x'
+`--discard-all'
+ Remove non-global symbols.
+
+`-X'
+`--discard-locals'
+ Remove compiler-generated local symbols. (These usually start
+ with `L' or `.'.)
+
+`--keep-file-symbols'
+ When stripping a file, perhaps with `--strip-debug' or
+ `--strip-unneeded', retain any symbols specifying source file
+ names, which would otherwise get stripped.
+
+`--only-keep-debug'
+ Strip a file, removing contents of any sections that would not be
+ stripped by `--strip-debug' and leaving the debugging sections
+ intact. In ELF files, this preserves all note sections in the
+ output.
+
+ The intention is that this option will be used in conjunction with
+ `--add-gnu-debuglink' to create a two part executable. One a
+ stripped binary which will occupy less space in RAM and in a
+ distribution and the second a debugging information file which is
+ only needed if debugging abilities are required. The suggested
+ procedure to create these files is as follows:
+
+ 1. Link the executable as normal. Assuming that is is called
+ `foo' then...
+
+ 2. Run `objcopy --only-keep-debug foo foo.dbg' to create a file
+ containing the debugging info.
+
+ 3. Run `objcopy --strip-debug foo' to create a stripped
+ executable.
+
+ 4. Run `objcopy --add-gnu-debuglink=foo.dbg foo' to add a link
+ to the debugging info into the stripped executable.
+
+ Note--the choice of `.dbg' as an extension for the debug info file
+ is arbitrary. Also the `--only-keep-debug' step is optional. You
+ could instead do this:
+
+ 1. Link the executable as normal.
+
+ 2. Copy `foo' to `foo.full'
+
+ 3. Run `strip --strip-debug foo'
+
+ 4. Run `objcopy --add-gnu-debuglink=foo.full foo'
+
+ i.e., the file pointed to by the `--add-gnu-debuglink' can be the
+ full executable. It does not have to be a file created by the
+ `--only-keep-debug' switch.
+
+ Note--this switch is only intended for use on fully linked files.
+ It does not make sense to use it on object files where the
+ debugging information may be incomplete. Besides the
+ gnu_debuglink feature currently only supports the presence of one
+ filename containing debugging information, not multiple filenames
+ on a one-per-object-file basis.
+
+`-V'
+`--version'
+ Show the version number for `strip'.
+
+`-v'
+`--verbose'
+ Verbose output: list all object files modified. In the case of
+ archives, `strip -v' lists all members of the archive.
+
+
+File: binutils.info, Node: c++filt, Next: addr2line, Prev: strip, Up: Top
+
+9 c++filt
+*********
+
+ c++filt [`-_'|`--strip-underscores']
+ [`-n'|`--no-strip-underscores']
+ [`-p'|`--no-params']
+ [`-t'|`--types']
+ [`-i'|`--no-verbose']
+ [`-s' FORMAT|`--format='FORMAT]
+ [`--help'] [`--version'] [SYMBOL...]
+
+ The C++ and Java languages provide function overloading, which means
+that you can write many functions with the same name, providing that
+each function takes parameters of different types. In order to be able
+to distinguish these similarly named functions C++ and Java encode them
+into a low-level assembler name which uniquely identifies each
+different version. This process is known as "mangling". The `c++filt'
+(1) program does the inverse mapping: it decodes ("demangles") low-level
+names into user-level names so that they can be read.
+
+ Every alphanumeric word (consisting of letters, digits, underscores,
+dollars, or periods) seen in the input is a potential mangled name. If
+the name decodes into a C++ name, the C++ name replaces the low-level
+name in the output, otherwise the original word is output. In this way
+you can pass an entire assembler source file, containing mangled names,
+through `c++filt' and see the same source file containing demangled
+names.
+
+ You can also use `c++filt' to decipher individual symbols by passing
+them on the command line:
+
+ c++filt SYMBOL
+
+ If no SYMBOL arguments are given, `c++filt' reads symbol names from
+the standard input instead. All the results are printed on the
+standard output. The difference between reading names from the command
+line versus reading names from the standard input is that command line
+arguments are expected to be just mangled names and no checking is
+performed to separate them from surrounding text. Thus for example:
+
+ c++filt -n _Z1fv
+
+ will work and demangle the name to "f()" whereas:
+
+ c++filt -n _Z1fv,
+
+ will not work. (Note the extra comma at the end of the mangled name
+which makes it invalid). This command however will work:
+
+ echo _Z1fv, | c++filt -n
+
+ and will display "f(),", i.e., the demangled name followed by a
+trailing comma. This behaviour is because when the names are read from
+the standard input it is expected that they might be part of an
+assembler source file where there might be extra, extraneous characters
+trailing after a mangled name. For example:
+
+ .type _Z1fv, @function
+
+`-_'
+`--strip-underscores'
+ On some systems, both the C and C++ compilers put an underscore in
+ front of every name. For example, the C name `foo' gets the
+ low-level name `_foo'. This option removes the initial
+ underscore. Whether `c++filt' removes the underscore by default
+ is target dependent.
+
+`-n'
+`--no-strip-underscores'
+ Do not remove the initial underscore.
+
+`-p'
+`--no-params'
+ When demangling the name of a function, do not display the types of
+ the function's parameters.
+
+`-t'
+`--types'
+ Attempt to demangle types as well as function names. This is
+ disabled by default since mangled types are normally only used
+ internally in the compiler, and they can be confused with
+ non-mangled names. For example, a function called "a" treated as
+ a mangled type name would be demangled to "signed char".
+
+`-i'
+`--no-verbose'
+ Do not include implementation details (if any) in the demangled
+ output.
+
+`-s FORMAT'
+`--format=FORMAT'
+ `c++filt' can decode various methods of mangling, used by
+ different compilers. The argument to this option selects which
+ method it uses:
+
+ `auto'
+ Automatic selection based on executable (the default method)
+
+ `gnu'
+ the one used by the GNU C++ compiler (g++)
+
+ `lucid'
+ the one used by the Lucid compiler (lcc)
+
+ `arm'
+ the one specified by the C++ Annotated Reference Manual
+
+ `hp'
+ the one used by the HP compiler (aCC)
+
+ `edg'
+ the one used by the EDG compiler
+
+ `gnu-v3'
+ the one used by the GNU C++ compiler (g++) with the V3 ABI.
+
+ `java'
+ the one used by the GNU Java compiler (gcj)
+
+ `gnat'
+ the one used by the GNU Ada compiler (GNAT).
+
+`--help'
+ Print a summary of the options to `c++filt' and exit.
+
+`--version'
+ Print the version number of `c++filt' and exit.
+
+ _Warning:_ `c++filt' is a new utility, and the details of its user
+ interface are subject to change in future releases. In particular,
+ a command-line option may be required in the future to decode a
+ name passed as an argument on the command line; in other words,
+
+ c++filt SYMBOL
+
+ may in a future release become
+
+ c++filt OPTION SYMBOL
+
+ ---------- Footnotes ----------
+
+ (1) MS-DOS does not allow `+' characters in file names, so on MS-DOS
+this program is named `CXXFILT'.
+
+
+File: binutils.info, Node: addr2line, Next: nlmconv, Prev: c++filt, Up: Top
+
+10 addr2line
+************
+
+ addr2line [`-b' BFDNAME|`--target='BFDNAME]
+ [`-C'|`--demangle'[=STYLE]]
+ [`-e' FILENAME|`--exe='FILENAME]
+ [`-f'|`--functions'] [`-s'|`--basename']
+ [`-i'|`--inlines']
+ [`-j'|`--section='NAME]
+ [`-H'|`--help'] [`-V'|`--version']
+ [addr addr ...]
+
+ `addr2line' translates addresses into file names and line numbers.
+Given an address in an executable or an offset in a section of a
+relocatable object, it uses the debugging information to figure out
+which file name and line number are associated with it.
+
+ The executable or relocatable object to use is specified with the
+`-e' option. The default is the file `a.out'. The section in the
+relocatable object to use is specified with the `-j' option.
+
+ `addr2line' has two modes of operation.
+
+ In the first, hexadecimal addresses are specified on the command
+line, and `addr2line' displays the file name and line number for each
+address.
+
+ In the second, `addr2line' reads hexadecimal addresses from standard
+input, and prints the file name and line number for each address on
+standard output. In this mode, `addr2line' may be used in a pipe to
+convert dynamically chosen addresses.
+
+ The format of the output is `FILENAME:LINENO'. The file name and
+line number for each address is printed on a separate line. If the
+`-f' option is used, then each `FILENAME:LINENO' line is preceded by a
+`FUNCTIONNAME' line which is the name of the function containing the
+address.
+
+ If the file name or function name can not be determined, `addr2line'
+will print two question marks in their place. If the line number can
+not be determined, `addr2line' will print 0.
+
+ The long and short forms of options, shown here as alternatives, are
+equivalent.
+
+`-b BFDNAME'
+`--target=BFDNAME'
+ Specify that the object-code format for the object files is
+ BFDNAME.
+
+`-C'
+`--demangle[=STYLE]'
+ Decode ("demangle") low-level symbol names into user-level names.
+ Besides removing any initial underscore prepended by the system,
+ this makes C++ function names readable. Different compilers have
+ different mangling styles. The optional demangling style argument
+ can be used to choose an appropriate demangling style for your
+ compiler. *Note c++filt::, for more information on demangling.
+
+`-e FILENAME'
+`--exe=FILENAME'
+ Specify the name of the executable for which addresses should be
+ translated. The default file is `a.out'.
+
+`-f'
+`--functions'
+ Display function names as well as file and line number information.
+
+`-s'
+`--basenames'
+ Display only the base of each file name.
+
+`-i'
+`--inlines'
+ If the address belongs to a function that was inlined, the source
+ information for all enclosing scopes back to the first non-inlined
+ function will also be printed. For example, if `main' inlines
+ `callee1' which inlines `callee2', and address is from `callee2',
+ the source information for `callee1' and `main' will also be
+ printed.
+
+`-j'
+`--section'
+ Read offsets relative to the specified section instead of absolute
+ addresses.
+
+
+File: binutils.info, Node: nlmconv, Next: windres, Prev: addr2line, Up: Top
+
+11 nlmconv
+**********
+
+`nlmconv' converts a relocatable object file into a NetWare Loadable
+Module.
+
+ _Warning:_ `nlmconv' is not always built as part of the binary
+ utilities, since it is only useful for NLM targets.
+
+ nlmconv [`-I' BFDNAME|`--input-target='BFDNAME]
+ [`-O' BFDNAME|`--output-target='BFDNAME]
+ [`-T' HEADERFILE|`--header-file='HEADERFILE]
+ [`-d'|`--debug'] [`-l' LINKER|`--linker='LINKER]
+ [`-h'|`--help'] [`-V'|`--version']
+ INFILE OUTFILE
+
+ `nlmconv' converts the relocatable `i386' object file INFILE into
+the NetWare Loadable Module OUTFILE, optionally reading HEADERFILE for
+NLM header information. For instructions on writing the NLM command
+file language used in header files, see the `linkers' section,
+`NLMLINK' in particular, of the `NLM Development and Tools Overview',
+which is part of the NLM Software Developer's Kit ("NLM SDK"),
+available from Novell, Inc. `nlmconv' uses the GNU Binary File
+Descriptor library to read INFILE; see *Note BFD: (ld.info)BFD, for
+more information.
+
+ `nlmconv' can perform a link step. In other words, you can list
+more than one object file for input if you list them in the definitions
+file (rather than simply specifying one input file on the command line).
+In this case, `nlmconv' calls the linker for you.
+
+`-I BFDNAME'
+`--input-target=BFDNAME'
+ Object format of the input file. `nlmconv' can usually determine
+ the format of a given file (so no default is necessary). *Note
+ Target Selection::, for more information.
+
+`-O BFDNAME'
+`--output-target=BFDNAME'
+ Object format of the output file. `nlmconv' infers the output
+ format based on the input format, e.g. for a `i386' input file the
+ output format is `nlm32-i386'. *Note Target Selection::, for more
+ information.
+
+`-T HEADERFILE'
+`--header-file=HEADERFILE'
+ Reads HEADERFILE for NLM header information. For instructions on
+ writing the NLM command file language used in header files, see
+ see the `linkers' section, of the `NLM Development and Tools
+ Overview', which is part of the NLM Software Developer's Kit,
+ available from Novell, Inc.
+
+`-d'
+`--debug'
+ Displays (on standard error) the linker command line used by
+ `nlmconv'.
+
+`-l LINKER'
+`--linker=LINKER'
+ Use LINKER for any linking. LINKER can be an absolute or a
+ relative pathname.
+
+`-h'
+`--help'
+ Prints a usage summary.
+
+`-V'
+`--version'
+ Prints the version number for `nlmconv'.
+
+
+File: binutils.info, Node: windmc, Next: dlltool, Prev: windres, Up: Top
+
+12 windmc
+*********
+
+`windmc' may be used to generator Windows message resources.
+
+ _Warning:_ `windmc' is not always built as part of the binary
+ utilities, since it is only useful for Windows targets.
+
+ windmc [options] input-file
+
+ `windmc' reads message definitions from an input file (.mc) and
+translate them into a set of output files. The output files may be of
+four kinds:
+
+`h'
+ A C header file containing the message definitions.
+
+`rc'
+ A resource file compilable by the `windres' tool.
+
+`bin'
+ One or more binary files containing the resource data for a
+ specific message language.
+
+`dbg'
+ A C include file that maps message id's to their symbolic name.
+
+ The exact description of these different formats is available in
+documentation from Microsoft.
+
+ When `windmc' converts from the `mc' format to the `bin' format,
+`rc', `h', and optional `dbg' it is acting like the Windows Message
+Compiler.
+
+`-a'
+`--ascii_in'
+ Specifies that the input file specified is ANSI. This is the
+ default behaviour.
+
+`-A'
+`--ascii_out'
+ Specifies that messages in the output `bin' files should be in ANSI
+ format.
+
+`-b'
+`--binprefix'
+ Specifies that `bin' filenames should have to be prefixed by the
+ basename of the source file.
+
+`-c'
+`--customflag'
+ Sets the customer bit in all message id's.
+
+`-C CODEPAGE'
+`--codepage_in CODEPAGE'
+ Sets the default codepage to be used to convert input file to
+ UTF16. The default is ocdepage 1252.
+
+`-d'
+`--decimal_values'
+ Outputs the constants in the header file in decimal. Default is
+ using hexadecimal output.
+
+`-e EXT'
+`--extension EXT'
+ The extension for the header file. The default is .h extension.
+
+`-F TARGET'
+`--target TARGET'
+ Specify the BFD format to use for a bin file as output. This is a
+ BFD target name; you can use the `--help' option to see a list of
+ supported targets. Normally `windmc' will use the default format,
+ which is the first one listed by the `--help' option. *Note
+ Target Selection::.
+
+`-h PATH'
+`--headerdir PATH'
+ The target directory of the generated header file. The default is
+ the current directory.
+
+`-H'
+`--help'
+ Displays a list of command line options and then exits.
+
+`-m CHARACTERS'
+`--maxlength CHARACTERS'
+ Instructs `windmc' to generate a warning if the length of any
+ message exceeds the number specified.
+
+`-n'
+`--nullterminate'
+ Terminate message text in `bin' files by zero. By default they are
+ terminated by CR/LF.
+
+`-o'
+`--hresult_use'
+ Not yet implemented. Instructs `windmc' to generate an OLE2 header
+ file, using HRESULT definitions. Status codes are used if the flag
+ is not specified.
+
+`-O CODEPAGE'
+`--codepage_out CODEPAGE'
+ Sets the default codepage to be used to output text files. The
+ default is ocdepage 1252.
+
+`-r PATH'
+`--rcdir PATH'
+ The target directory for the generated `rc' script and the
+ generated `bin' files that the resource compiler script includes.
+ The default is the current directory.
+
+`-u'
+`--unicode_in'
+ Specifies that the input file is UTF16.
+
+`-U'
+`--unicode_out'
+ Specifies that messages in the output `bin' file should be in UTF16
+ format. This is the default behaviour.
+
+`-v'
+
+`--verbose'
+ Enable verbose mode.
+
+`-V'
+
+`--version'
+ Prints the version number for `windmc'.
+
+`-x PATH'
+`--xdgb PATH'
+ The path of the `dbg' C include file that maps message id's to the
+ symbolic name. No such file is generated without specifying the
+ switch.
+
+
+File: binutils.info, Node: windres, Next: windmc, Prev: nlmconv, Up: Top
+
+13 windres
+**********
+
+`windres' may be used to manipulate Windows resources.
+
+ _Warning:_ `windres' is not always built as part of the binary
+ utilities, since it is only useful for Windows targets.
+
+ windres [options] [input-file] [output-file]
+
+ `windres' reads resources from an input file and copies them into an
+output file. Either file may be in one of three formats:
+
+`rc'
+ A text format read by the Resource Compiler.
+
+`res'
+ A binary format generated by the Resource Compiler.
+
+`coff'
+ A COFF object or executable.
+
+ The exact description of these different formats is available in
+documentation from Microsoft.
+
+ When `windres' converts from the `rc' format to the `res' format, it
+is acting like the Windows Resource Compiler. When `windres' converts
+from the `res' format to the `coff' format, it is acting like the
+Windows `CVTRES' program.
+
+ When `windres' generates an `rc' file, the output is similar but not
+identical to the format expected for the input. When an input `rc'
+file refers to an external filename, an output `rc' file will instead
+include the file contents.
+
+ If the input or output format is not specified, `windres' will guess
+based on the file name, or, for the input file, the file contents. A
+file with an extension of `.rc' will be treated as an `rc' file, a file
+with an extension of `.res' will be treated as a `res' file, and a file
+with an extension of `.o' or `.exe' will be treated as a `coff' file.
+
+ If no output file is specified, `windres' will print the resources
+in `rc' format to standard output.
+
+ The normal use is for you to write an `rc' file, use `windres' to
+convert it to a COFF object file, and then link the COFF file into your
+application. This will make the resources described in the `rc' file
+available to Windows.
+
+`-i FILENAME'
+`--input FILENAME'
+ The name of the input file. If this option is not used, then
+ `windres' will use the first non-option argument as the input file
+ name. If there are no non-option arguments, then `windres' will
+ read from standard input. `windres' can not read a COFF file from
+ standard input.
+
+`-o FILENAME'
+`--output FILENAME'
+ The name of the output file. If this option is not used, then
+ `windres' will use the first non-option argument, after any used
+ for the input file name, as the output file name. If there is no
+ non-option argument, then `windres' will write to standard output.
+ `windres' can not write a COFF file to standard output. Note, for
+ compatibility with `rc' the option `-fo' is also accepted, but its
+ use is not recommended.
+
+`-J FORMAT'
+`--input-format FORMAT'
+ The input format to read. FORMAT may be `res', `rc', or `coff'.
+ If no input format is specified, `windres' will guess, as
+ described above.
+
+`-O FORMAT'
+`--output-format FORMAT'
+ The output format to generate. FORMAT may be `res', `rc', or
+ `coff'. If no output format is specified, `windres' will guess,
+ as described above.
+
+`-F TARGET'
+`--target TARGET'
+ Specify the BFD format to use for a COFF file as input or output.
+ This is a BFD target name; you can use the `--help' option to see
+ a list of supported targets. Normally `windres' will use the
+ default format, which is the first one listed by the `--help'
+ option. *Note Target Selection::.
+
+`--preprocessor PROGRAM'
+ When `windres' reads an `rc' file, it runs it through the C
+ preprocessor first. This option may be used to specify the
+ preprocessor to use, including any leading arguments. The default
+ preprocessor argument is `gcc -E -xc-header -DRC_INVOKED'.
+
+`-I DIRECTORY'
+`--include-dir DIRECTORY'
+ Specify an include directory to use when reading an `rc' file.
+ `windres' will pass this to the preprocessor as an `-I' option.
+ `windres' will also search this directory when looking for files
+ named in the `rc' file. If the argument passed to this command
+ matches any of the supported FORMATS (as described in the `-J'
+ option), it will issue a deprecation warning, and behave just like
+ the `-J' option. New programs should not use this behaviour. If a
+ directory happens to match a FORMAT, simple prefix it with `./' to
+ disable the backward compatibility.
+
+`-D TARGET'
+`--define SYM[=VAL]'
+ Specify a `-D' option to pass to the preprocessor when reading an
+ `rc' file.
+
+`-U TARGET'
+`--undefine SYM'
+ Specify a `-U' option to pass to the preprocessor when reading an
+ `rc' file.
+
+`-r'
+ Ignored for compatibility with rc.
+
+`-v'
+ Enable verbose mode. This tells you what the preprocessor is if
+ you didn't specify one.
+
+`-c VAL'
+
+`--codepage VAL'
+ Specify the default codepage to use when reading an `rc' file.
+ VAL should be a hexadecimal prefixed by `0x' or decimal codepage
+ code. The valid range is from zero up to 0xffff, but the validity
+ of the codepage is host and configuration dependent.
+
+`-l VAL'
+
+`--language VAL'
+ Specify the default language to use when reading an `rc' file.
+ VAL should be a hexadecimal language code. The low eight bits are
+ the language, and the high eight bits are the sublanguage.
+
+`--use-temp-file'
+ Use a temporary file to instead of using popen to read the output
+ of the preprocessor. Use this option if the popen implementation
+ is buggy on the host (eg., certain non-English language versions
+ of Windows 95 and Windows 98 are known to have buggy popen where
+ the output will instead go the console).
+
+`--no-use-temp-file'
+ Use popen, not a temporary file, to read the output of the
+ preprocessor. This is the default behaviour.
+
+`-h'
+
+`--help'
+ Prints a usage summary.
+
+`-V'
+
+`--version'
+ Prints the version number for `windres'.
+
+`--yydebug'
+ If `windres' is compiled with `YYDEBUG' defined as `1', this will
+ turn on parser debugging.
+
+
+File: binutils.info, Node: dlltool, Next: Common Options, Prev: windmc, Up: Top
+
+14 dlltool
+**********
+
+`dlltool' is used to create the files needed to create dynamic link
+libraries (DLLs) on systems which understand PE format image files such
+as Windows. A DLL contains an export table which contains information
+that the runtime loader needs to resolve references from a referencing
+program.
+
+ The export table is generated by this program by reading in a `.def'
+file or scanning the `.a' and `.o' files which will be in the DLL. A
+`.o' file can contain information in special `.drectve' sections with
+export information.
+
+ _Note:_ `dlltool' is not always built as part of the binary
+ utilities, since it is only useful for those targets which support
+ DLLs.
+
+ dlltool [`-d'|`--input-def' DEF-FILE-NAME]
+ [`-b'|`--base-file' BASE-FILE-NAME]
+ [`-e'|`--output-exp' EXPORTS-FILE-NAME]
+ [`-z'|`--output-def' DEF-FILE-NAME]
+ [`-l'|`--output-lib' LIBRARY-FILE-NAME]
+ [`-y'|`--output-delaylib' LIBRARY-FILE-NAME]
+ [`--export-all-symbols'] [`--no-export-all-symbols']
+ [`--exclude-symbols' LIST]
+ [`--no-default-excludes']
+ [`-S'|`--as' PATH-TO-ASSEMBLER] [`-f'|`--as-flags' OPTIONS]
+ [`-D'|`--dllname' NAME] [`-m'|`--machine' MACHINE]
+ [`-a'|`--add-indirect']
+ [`-U'|`--add-underscore'] [`--add-stdcall-underscore']
+ [`-k'|`--kill-at'] [`-A'|`--add-stdcall-alias']
+ [`-p'|`--ext-prefix-alias' PREFIX]
+ [`-x'|`--no-idata4'] [`-c'|`--no-idata5']
+ [`--use-nul-prefixed-import-tables']
+ [`-I'|`--identify' LIBRARY-FILE-NAME] [`--identify-strict']
+ [`-i'|`--interwork']
+ [`-n'|`--nodelete'] [`-t'|`--temp-prefix' PREFIX]
+ [`-v'|`--verbose']
+ [`-h'|`--help'] [`-V'|`--version']
+ [object-file ...]
+
+ `dlltool' reads its inputs, which can come from the `-d' and `-b'
+options as well as object files specified on the command line. It then
+processes these inputs and if the `-e' option has been specified it
+creates a exports file. If the `-l' option has been specified it
+creates a library file and if the `-z' option has been specified it
+creates a def file. Any or all of the `-e', `-l' and `-z' options can
+be present in one invocation of dlltool.
+
+ When creating a DLL, along with the source for the DLL, it is
+necessary to have three other files. `dlltool' can help with the
+creation of these files.
+
+ The first file is a `.def' file which specifies which functions are
+exported from the DLL, which functions the DLL imports, and so on. This
+is a text file and can be created by hand, or `dlltool' can be used to
+create it using the `-z' option. In this case `dlltool' will scan the
+object files specified on its command line looking for those functions
+which have been specially marked as being exported and put entries for
+them in the `.def' file it creates.
+
+ In order to mark a function as being exported from a DLL, it needs to
+have an `-export:<name_of_function>' entry in the `.drectve' section of
+the object file. This can be done in C by using the asm() operator:
+
+ asm (".section .drectve");
+ asm (".ascii \"-export:my_func\"");
+
+ int my_func (void) { ... }
+
+ The second file needed for DLL creation is an exports file. This
+file is linked with the object files that make up the body of the DLL
+and it handles the interface between the DLL and the outside world.
+This is a binary file and it can be created by giving the `-e' option to
+`dlltool' when it is creating or reading in a `.def' file.
+
+ The third file needed for DLL creation is the library file that
+programs will link with in order to access the functions in the DLL (an
+`import library'). This file can be created by giving the `-l' option
+to dlltool when it is creating or reading in a `.def' file.
+
+ If the `-y' option is specified, dlltool generates a delay-import
+library that can be used instead of the normal import library to allow
+a program to link to the dll only as soon as an imported function is
+called for the first time. The resulting executable will need to be
+linked to the static delayimp library containing __delayLoadHelper2(),
+which in turn will import LoadLibraryA and GetProcAddress from kernel32.
+
+ `dlltool' builds the library file by hand, but it builds the exports
+file by creating temporary files containing assembler statements and
+then assembling these. The `-S' command line option can be used to
+specify the path to the assembler that dlltool will use, and the `-f'
+option can be used to pass specific flags to that assembler. The `-n'
+can be used to prevent dlltool from deleting these temporary assembler
+files when it is done, and if `-n' is specified twice then this will
+prevent dlltool from deleting the temporary object files it used to
+build the library.
+
+ Here is an example of creating a DLL from a source file `dll.c' and
+also creating a program (from an object file called `program.o') that
+uses that DLL:
+
+ gcc -c dll.c
+ dlltool -e exports.o -l dll.lib dll.o
+ gcc dll.o exports.o -o dll.dll
+ gcc program.o dll.lib -o program
+
+ `dlltool' may also be used to query an existing import library to
+determine the name of the DLL to which it is associated. See the
+description of the `-I' or `--identify' option.
+
+ The command line options have the following meanings:
+
+`-d FILENAME'
+`--input-def FILENAME'
+ Specifies the name of a `.def' file to be read in and processed.
+
+`-b FILENAME'
+`--base-file FILENAME'
+ Specifies the name of a base file to be read in and processed. The
+ contents of this file will be added to the relocation section in
+ the exports file generated by dlltool.
+
+`-e FILENAME'
+`--output-exp FILENAME'
+ Specifies the name of the export file to be created by dlltool.
+
+`-z FILENAME'
+`--output-def FILENAME'
+ Specifies the name of the `.def' file to be created by dlltool.
+
+`-l FILENAME'
+`--output-lib FILENAME'
+ Specifies the name of the library file to be created by dlltool.
+
+`-y FILENAME'
+`--output-delaylib FILENAME'
+ Specifies the name of the delay-import library file to be created
+ by dlltool.
+
+`--export-all-symbols'
+ Treat all global and weak defined symbols found in the input object
+ files as symbols to be exported. There is a small list of symbols
+ which are not exported by default; see the `--no-default-excludes'
+ option. You may add to the list of symbols to not export by using
+ the `--exclude-symbols' option.
+
+`--no-export-all-symbols'
+ Only export symbols explicitly listed in an input `.def' file or in
+ `.drectve' sections in the input object files. This is the default
+ behaviour. The `.drectve' sections are created by `dllexport'
+ attributes in the source code.
+
+`--exclude-symbols LIST'
+ Do not export the symbols in LIST. This is a list of symbol names
+ separated by comma or colon characters. The symbol names should
+ not contain a leading underscore. This is only meaningful when
+ `--export-all-symbols' is used.
+
+`--no-default-excludes'
+ When `--export-all-symbols' is used, it will by default avoid
+ exporting certain special symbols. The current list of symbols to
+ avoid exporting is `DllMain@12', `DllEntryPoint@0', `impure_ptr'.
+ You may use the `--no-default-excludes' option to go ahead and
+ export these special symbols. This is only meaningful when
+ `--export-all-symbols' is used.
+
+`-S PATH'
+`--as PATH'
+ Specifies the path, including the filename, of the assembler to be
+ used to create the exports file.
+
+`-f OPTIONS'
+`--as-flags OPTIONS'
+ Specifies any specific command line options to be passed to the
+ assembler when building the exports file. This option will work
+ even if the `-S' option is not used. This option only takes one
+ argument, and if it occurs more than once on the command line,
+ then later occurrences will override earlier occurrences. So if
+ it is necessary to pass multiple options to the assembler they
+ should be enclosed in double quotes.
+
+`-D NAME'
+`--dll-name NAME'
+ Specifies the name to be stored in the `.def' file as the name of
+ the DLL when the `-e' option is used. If this option is not
+ present, then the filename given to the `-e' option will be used
+ as the name of the DLL.
+
+`-m MACHINE'
+`-machine MACHINE'
+ Specifies the type of machine for which the library file should be
+ built. `dlltool' has a built in default type, depending upon how
+ it was created, but this option can be used to override that.
+ This is normally only useful when creating DLLs for an ARM
+ processor, when the contents of the DLL are actually encode using
+ Thumb instructions.
+
+`-a'
+`--add-indirect'
+ Specifies that when `dlltool' is creating the exports file it
+ should add a section which allows the exported functions to be
+ referenced without using the import library. Whatever the hell
+ that means!
+
+`-U'
+`--add-underscore'
+ Specifies that when `dlltool' is creating the exports file it
+ should prepend an underscore to the names of _all_ exported
+ symbols.
+
+`--add-stdcall-underscore'
+ Specifies that when `dlltool' is creating the exports file it
+ should prepend an underscore to the names of exported _stdcall_
+ functions. Variable names and non-stdcall function names are not
+ modified. This option is useful when creating GNU-compatible
+ import libs for third party DLLs that were built with MS-Windows
+ tools.
+
+`-k'
+`--kill-at'
+ Specifies that when `dlltool' is creating the exports file it
+ should not append the string `@ <number>'. These numbers are
+ called ordinal numbers and they represent another way of accessing
+ the function in a DLL, other than by name.
+
+`-A'
+`--add-stdcall-alias'
+ Specifies that when `dlltool' is creating the exports file it
+ should add aliases for stdcall symbols without `@ <number>' in
+ addition to the symbols with `@ <number>'.
+
+`-p'
+`--ext-prefix-alias PREFIX'
+ Causes `dlltool' to create external aliases for all DLL imports
+ with the specified prefix. The aliases are created for both
+ external and import symbols with no leading underscore.
+
+`-x'
+`--no-idata4'
+ Specifies that when `dlltool' is creating the exports and library
+ files it should omit the `.idata4' section. This is for
+ compatibility with certain operating systems.
+
+`--use-nul-prefixed-import-tables'
+ Specifies that when `dlltool' is creating the exports and library
+ files it should prefix the `.idata4' and `.idata5' by zero an
+ element. This emulates old gnu import library generation of
+ `dlltool'. By default this option is turned off.
+
+`-c'
+`--no-idata5'
+ Specifies that when `dlltool' is creating the exports and library
+ files it should omit the `.idata5' section. This is for
+ compatibility with certain operating systems.
+
+`-I FILENAME'
+`--identify FILENAME'
+ Specifies that `dlltool' should inspect the import library
+ indicated by FILENAME and report, on `stdout', the name(s) of the
+ associated DLL(s). This can be performed in addition to any other
+ operations indicated by the other options and arguments.
+ `dlltool' fails if the import library does not exist or is not
+ actually an import library. See also `--identify-strict'.
+
+`--identify-strict'
+ Modifies the behavior of the `--identify' option, such that an
+ error is reported if FILENAME is associated with more than one DLL.
+
+`-i'
+`--interwork'
+ Specifies that `dlltool' should mark the objects in the library
+ file and exports file that it produces as supporting interworking
+ between ARM and Thumb code.
+
+`-n'
+`--nodelete'
+ Makes `dlltool' preserve the temporary assembler files it used to
+ create the exports file. If this option is repeated then dlltool
+ will also preserve the temporary object files it uses to create
+ the library file.
+
+`-t PREFIX'
+`--temp-prefix PREFIX'
+ Makes `dlltool' use PREFIX when constructing the names of
+ temporary assembler and object files. By default, the temp file
+ prefix is generated from the pid.
+
+`-v'
+`--verbose'
+ Make dlltool describe what it is doing.
+
+`-h'
+`--help'
+ Displays a list of command line options and then exits.
+
+`-V'
+`--version'
+ Displays dlltool's version number and then exits.
+
+
+* Menu:
+
+* def file format:: The format of the dlltool `.def' file
+
+
+File: binutils.info, Node: def file format, Up: dlltool
+
+14.1 The format of the `dlltool' `.def' file
+============================================
+
+A `.def' file contains any number of the following commands:
+
+`NAME' NAME `[ ,' BASE `]'
+ The result is going to be named NAME`.exe'.
+
+`LIBRARY' NAME `[ ,' BASE `]'
+ The result is going to be named NAME`.dll'.
+
+`EXPORTS ( ( (' NAME1 `[ = ' NAME2 `] ) | ( ' NAME1 `=' MODULE-NAME `.' EXTERNAL-NAME `) )'
+
+`[' INTEGER `] [ NONAME ] [ CONSTANT ] [ DATA ] [ PRIVATE ] ) *'
+ Declares NAME1 as an exported symbol from the DLL, with optional
+ ordinal number INTEGER, or declares NAME1 as an alias (forward) of
+ the function EXTERNAL-NAME in the DLL MODULE-NAME.
+
+`IMPORTS ( (' INTERNAL-NAME `=' MODULE-NAME `.' INTEGER `) | [' INTERNAL-NAME `= ]' MODULE-NAME `.' EXTERNAL-NAME `) ) *'
+ Declares that EXTERNAL-NAME or the exported function whose ordinal
+ number is INTEGER is to be imported from the file MODULE-NAME. If
+ INTERNAL-NAME is specified then this is the name that the imported
+ function will be referred to in the body of the DLL.
+
+`DESCRIPTION' STRING
+ Puts STRING into the output `.exp' file in the `.rdata' section.
+
+`STACKSIZE' NUMBER-RESERVE `[, ' NUMBER-COMMIT `]'
+
+`HEAPSIZE' NUMBER-RESERVE `[, ' NUMBER-COMMIT `]'
+ Generates `--stack' or `--heap' NUMBER-RESERVE,NUMBER-COMMIT in
+ the output `.drectve' section. The linker will see this and act
+ upon it.
+
+`CODE' ATTR `+'
+
+`DATA' ATTR `+'
+
+`SECTIONS (' SECTION-NAME ATTR` + ) *'
+ Generates `--attr' SECTION-NAME ATTR in the output `.drectve'
+ section, where ATTR is one of `READ', `WRITE', `EXECUTE' or
+ `SHARED'. The linker will see this and act upon it.
+
+
+
+File: binutils.info, Node: readelf, Next: size, Prev: ranlib, Up: Top
+
+15 readelf
+**********
+
+ readelf [`-a'|`--all']
+ [`-h'|`--file-header']
+ [`-l'|`--program-headers'|`--segments']
+ [`-S'|`--section-headers'|`--sections']
+ [`-g'|`--section-groups']
+ [`-t'|`--section-details']
+ [`-e'|`--headers']
+ [`-s'|`--syms'|`--symbols']
+ [`-n'|`--notes']
+ [`-r'|`--relocs']
+ [`-u'|`--unwind']
+ [`-d'|`--dynamic']
+ [`-V'|`--version-info']
+ [`-A'|`--arch-specific']
+ [`-D'|`--use-dynamic']
+ [`-x' <number or name>|`--hex-dump='<number or name>]
+ [`-p' <number or name>|`--string-dump='<number or name>]
+ [`-R' <number or name>|`--relocated-dump='<number or name>]
+ [`-c'|`--archive-index']
+ [`-w[lLiaprmfFsoR]'|
+ `--debug-dump'[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]]
+ [`-I'|`-histogram']
+ [`-v'|`--version']
+ [`-W'|`--wide']
+ [`-H'|`--help']
+ ELFFILE...
+
+ `readelf' displays information about one or more ELF format object
+files. The options control what particular information to display.
+
+ ELFFILE... are the object files to be examined. 32-bit and 64-bit
+ELF files are supported, as are archives containing ELF files.
+
+ This program performs a similar function to `objdump' but it goes
+into more detail and it exists independently of the BFD library, so if
+there is a bug in BFD then readelf will not be affected.
+
+ The long and short forms of options, shown here as alternatives, are
+equivalent. At least one option besides `-v' or `-H' must be given.
+
+`-a'
+`--all'
+ Equivalent to specifying `--file-header', `--program-headers',
+ `--sections', `--symbols', `--relocs', `--dynamic', `--notes' and
+ `--version-info'.
+
+`-h'
+`--file-header'
+ Displays the information contained in the ELF header at the start
+ of the file.
+
+`-l'
+`--program-headers'
+`--segments'
+ Displays the information contained in the file's segment headers,
+ if it has any.
+
+`-S'
+`--sections'
+`--section-headers'
+ Displays the information contained in the file's section headers,
+ if it has any.
+
+`-g'
+`--section-groups'
+ Displays the information contained in the file's section groups,
+ if it has any.
+
+`-t'
+`--section-details'
+ Displays the detailed section information. Implies `-S'.
+
+`-s'
+`--symbols'
+`--syms'
+ Displays the entries in symbol table section of the file, if it
+ has one.
+
+`-e'
+`--headers'
+ Display all the headers in the file. Equivalent to `-h -l -S'.
+
+`-n'
+`--notes'
+ Displays the contents of the NOTE segments and/or sections, if any.
+
+`-r'
+`--relocs'
+ Displays the contents of the file's relocation section, if it has
+ one.
+
+`-u'
+`--unwind'
+ Displays the contents of the file's unwind section, if it has one.
+ Only the unwind sections for IA64 ELF files are currently
+ supported.
+
+`-d'
+`--dynamic'
+ Displays the contents of the file's dynamic section, if it has one.
+
+`-V'
+`--version-info'
+ Displays the contents of the version sections in the file, it they
+ exist.
+
+`-A'
+`--arch-specific'
+ Displays architecture-specific information in the file, if there
+ is any.
+
+`-D'
+`--use-dynamic'
+ When displaying symbols, this option makes `readelf' use the
+ symbol table in the file's dynamic section, rather than the one in
+ the symbols section.
+
+`-x <number or name>'
+`--hex-dump=<number or name>'
+ Displays the contents of the indicated section as a hexadecimal
+ bytes. A number identifies a particular section by index in the
+ section table; any other string identifies all sections with that
+ name in the object file.
+
+`-R <number or name>'
+`--relocated-dump=<number or name>'
+ Displays the contents of the indicated section as a hexadecimal
+ bytes. A number identifies a particular section by index in the
+ section table; any other string identifies all sections with that
+ name in the object file. The contents of the section will be
+ relocated before they are displayed.
+
+`-p <number or name>'
+`--string-dump=<number or name>'
+ Displays the contents of the indicated section as printable
+ strings. A number identifies a particular section by index in the
+ section table; any other string identifies all sections with that
+ name in the object file.
+
+`-c'
+`--archive-index'
+ Displays the file symbol index infomation contained in the header
+ part of binary archives. Performs the same function as the `t'
+ command to `ar', but without using the BFD library. *Note ar::.
+
+`-w[lLiaprmfFsoR]'
+`--debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]'
+ Displays the contents of the debug sections in the file, if any are
+ present. If one of the optional letters or words follows the
+ switch then only data found in those specific sections will be
+ dumped.
+
+ Note: the `=decodedline' option will display the interpreted
+ contents of a .debug_line section whereas the `=rawline' option
+ dumps the contents in a raw format.
+
+`-I'
+`--histogram'
+ Display a histogram of bucket list lengths when displaying the
+ contents of the symbol tables.
+
+`-v'
+`--version'
+ Display the version number of readelf.
+
+`-W'
+`--wide'
+ Don't break output lines to fit into 80 columns. By default
+ `readelf' breaks section header and segment listing lines for
+ 64-bit ELF files, so that they fit into 80 columns. This option
+ causes `readelf' to print each section header resp. each segment
+ one a single line, which is far more readable on terminals wider
+ than 80 columns.
+
+`-H'
+`--help'
+ Display the command line options understood by `readelf'.
+
+
+
+File: binutils.info, Node: Common Options, Next: Selecting the Target System, Prev: dlltool, Up: Top
+
+16 Common Options
+*****************
+
+The following command-line options are supported by all of the programs
+described in this manual.
+
+`@FILE'
+ Read command-line options from FILE. The options read are
+ inserted in place of the original @FILE option. If FILE does not
+ exist, or cannot be read, then the option will be treated
+ literally, and not removed.
+
+ Options in FILE are separated by whitespace. A whitespace
+ character may be included in an option by surrounding the entire
+ option in either single or double quotes. Any character
+ (including a backslash) may be included by prefixing the character
+ to be included with a backslash. The FILE may itself contain
+ additional @FILE options; any such options will be processed
+ recursively.
+
+`--help'
+ Display the command-line options supported by the program.
+
+`--version'
+ Display the version number of the program.
+
+
+
+File: binutils.info, Node: Selecting the Target System, Next: Reporting Bugs, Prev: Common Options, Up: Top
+
+17 Selecting the Target System
+******************************
+
+You can specify two aspects of the target system to the GNU binary file
+utilities, each in several ways:
+
+ * the target
+
+ * the architecture
+
+ In the following summaries, the lists of ways to specify values are
+in order of decreasing precedence. The ways listed first override those
+listed later.
+
+ The commands to list valid values only list the values for which the
+programs you are running were configured. If they were configured with
+`--enable-targets=all', the commands list most of the available values,
+but a few are left out; not all targets can be configured in at once
+because some of them can only be configured "native" (on hosts with the
+same type as the target system).
+
+* Menu:
+
+* Target Selection::
+* Architecture Selection::
+
+
+File: binutils.info, Node: Target Selection, Next: Architecture Selection, Up: Selecting the Target System
+
+17.1 Target Selection
+=====================
+
+A "target" is an object file format. A given target may be supported
+for multiple architectures (*note Architecture Selection::). A target
+selection may also have variations for different operating systems or
+architectures.
+
+ The command to list valid target values is `objdump -i' (the first
+column of output contains the relevant information).
+
+ Some sample values are: `a.out-hp300bsd', `ecoff-littlemips',
+`a.out-sunos-big'.
+
+ You can also specify a target using a configuration triplet. This is
+the same sort of name that is passed to `configure' to specify a
+target. When you use a configuration triplet as an argument, it must be
+fully canonicalized. You can see the canonical version of a triplet by
+running the shell script `config.sub' which is included with the
+sources.
+
+ Some sample configuration triplets are: `m68k-hp-bsd',
+`mips-dec-ultrix', `sparc-sun-sunos'.
+
+`objdump' Target
+----------------
+
+Ways to specify:
+
+ 1. command line option: `-b' or `--target'
+
+ 2. environment variable `GNUTARGET'
+
+ 3. deduced from the input file
+
+`objcopy' and `strip' Input Target
+----------------------------------
+
+Ways to specify:
+
+ 1. command line options: `-I' or `--input-target', or `-F' or
+ `--target'
+
+ 2. environment variable `GNUTARGET'
+
+ 3. deduced from the input file
+
+`objcopy' and `strip' Output Target
+-----------------------------------
+
+Ways to specify:
+
+ 1. command line options: `-O' or `--output-target', or `-F' or
+ `--target'
+
+ 2. the input target (see "`objcopy' and `strip' Input Target" above)
+
+ 3. environment variable `GNUTARGET'
+
+ 4. deduced from the input file
+
+`nm', `size', and `strings' Target
+----------------------------------
+
+Ways to specify:
+
+ 1. command line option: `--target'
+
+ 2. environment variable `GNUTARGET'
+
+ 3. deduced from the input file
+
+
+File: binutils.info, Node: Architecture Selection, Prev: Target Selection, Up: Selecting the Target System
+
+17.2 Architecture Selection
+===========================
+
+An "architecture" is a type of CPU on which an object file is to run.
+Its name may contain a colon, separating the name of the processor
+family from the name of the particular CPU.
+
+ The command to list valid architecture values is `objdump -i' (the
+second column contains the relevant information).
+
+ Sample values: `m68k:68020', `mips:3000', `sparc'.
+
+`objdump' Architecture
+----------------------
+
+Ways to specify:
+
+ 1. command line option: `-m' or `--architecture'
+
+ 2. deduced from the input file
+
+`objcopy', `nm', `size', `strings' Architecture
+-----------------------------------------------
+
+Ways to specify:
+
+ 1. deduced from the input file
+
+
+File: binutils.info, Node: Reporting Bugs, Next: GNU Free Documentation License, Prev: Selecting the Target System, Up: Top
+
+18 Reporting Bugs
+*****************
+
+Your bug reports play an essential role in making the binary utilities
+reliable.
+
+ Reporting a bug may help you by bringing a solution to your problem,
+or it may not. But in any case the principal function of a bug report
+is to help the entire community by making the next version of the binary
+utilities work better. Bug reports are your contribution to their
+maintenance.
+
+ In order for a bug report to serve its purpose, you must include the
+information that enables us to fix the bug.
+
+* Menu:
+
+* Bug Criteria:: Have you found a bug?
+* Bug Reporting:: How to report bugs
+
+
+File: binutils.info, Node: Bug Criteria, Next: Bug Reporting, Up: Reporting Bugs
+
+18.1 Have You Found a Bug?
+==========================
+
+If you are not sure whether you have found a bug, here are some
+guidelines:
+
+ * If a binary utility gets a fatal signal, for any input whatever,
+ that is a bug. Reliable utilities never crash.
+
+ * If a binary utility produces an error message for valid input,
+ that is a bug.
+
+ * If you are an experienced user of binary utilities, your
+ suggestions for improvement are welcome in any case.
+
+
+File: binutils.info, Node: Bug Reporting, Prev: Bug Criteria, Up: Reporting Bugs
+
+18.2 How to Report Bugs
+=======================
+
+A number of companies and individuals offer support for GNU products.
+If you obtained the binary utilities from a support organization, we
+recommend you contact that organization first.
+
+ You can find contact information for many support companies and
+individuals in the file `etc/SERVICE' in the GNU Emacs distribution.
+
+ In any event, we also recommend that you send bug reports for the
+binary utilities to `http://www.sourceware.org/bugzilla/'.
+
+ The fundamental principle of reporting bugs usefully is this:
+*report all the facts*. If you are not sure whether to state a fact or
+leave it out, state it!
+
+ Often people omit facts because they think they know what causes the
+problem and assume that some details do not matter. Thus, you might
+assume that the name of a file you use in an example does not matter.
+Well, probably it does not, but one cannot be sure. Perhaps the bug is
+a stray memory reference which happens to fetch from the location where
+that pathname is stored in memory; perhaps, if the pathname were
+different, the contents of that location would fool the utility into
+doing the right thing despite the bug. Play it safe and give a
+specific, complete example. That is the easiest thing for you to do,
+and the most helpful.
+
+ Keep in mind that the purpose of a bug report is to enable us to fix
+the bug if it is new to us. Therefore, always write your bug reports
+on the assumption that the bug has not been reported previously.
+
+ Sometimes people give a few sketchy facts and ask, "Does this ring a
+bell?" This cannot help us fix a bug, so it is basically useless. We
+respond by asking for enough details to enable us to investigate. You
+might as well expedite matters by sending them to begin with.
+
+ To enable us to fix the bug, you should include all these things:
+
+ * The version of the utility. Each utility announces it if you
+ start it with the `--version' argument.
+
+ Without this, we will not know whether there is any point in
+ looking for the bug in the current version of the binary utilities.
+
+ * Any patches you may have applied to the source, including any
+ patches made to the `BFD' library.
+
+ * The type of machine you are using, and the operating system name
+ and version number.
+
+ * What compiler (and its version) was used to compile the
+ utilities--e.g. "`gcc-2.7'".
+
+ * The command arguments you gave the utility to observe the bug. To
+ guarantee you will not omit something important, list them all. A
+ copy of the Makefile (or the output from make) is sufficient.
+
+ If we were to try to guess the arguments, we would probably guess
+ wrong and then we might not encounter the bug.
+
+ * A complete input file, or set of input files, that will reproduce
+ the bug. If the utility is reading an object file or files, then
+ it is generally most helpful to send the actual object files.
+
+ If the source files were produced exclusively using GNU programs
+ (e.g., `gcc', `gas', and/or the GNU `ld'), then it may be OK to
+ send the source files rather than the object files. In this case,
+ be sure to say exactly what version of `gcc', or whatever, was
+ used to produce the object files. Also say how `gcc', or
+ whatever, was configured.
+
+ * A description of what behavior you observe that you believe is
+ incorrect. For example, "It gets a fatal signal."
+
+ Of course, if the bug is that the utility gets a fatal signal,
+ then we will certainly notice it. But if the bug is incorrect
+ output, we might not notice unless it is glaringly wrong. You
+ might as well not give us a chance to make a mistake.
+
+ Even if the problem you experience is a fatal signal, you should
+ still say so explicitly. Suppose something strange is going on,
+ such as your copy of the utility is out of sync, or you have
+ encountered a bug in the C library on your system. (This has
+ happened!) Your copy might crash and ours would not. If you told
+ us to expect a crash, then when ours fails to crash, we would know
+ that the bug was not happening for us. If you had not told us to
+ expect a crash, then we would not be able to draw any conclusion
+ from our observations.
+
+ * If you wish to suggest changes to the source, send us context
+ diffs, as generated by `diff' with the `-u', `-c', or `-p' option.
+ Always send diffs from the old file to the new file. If you wish
+ to discuss something in the `ld' source, refer to it by context,
+ not by line number.
+
+ The line numbers in our development sources will not match those
+ in your sources. Your line numbers would convey no useful
+ information to us.
+
+ Here are some things that are not necessary:
+
+ * A description of the envelope of the bug.
+
+ Often people who encounter a bug spend a lot of time investigating
+ which changes to the input file will make the bug go away and which
+ changes will not affect it.
+
+ This is often time consuming and not very useful, because the way
+ we will find the bug is by running a single example under the
+ debugger with breakpoints, not by pure deduction from a series of
+ examples. We recommend that you save your time for something else.
+
+ Of course, if you can find a simpler example to report _instead_
+ of the original one, that is a convenience for us. Errors in the
+ output will be easier to spot, running under the debugger will take
+ less time, and so on.
+
+ However, simplification is not vital; if you do not want to do
+ this, report the bug anyway and send us the entire test case you
+ used.
+
+ * A patch for the bug.
+
+ A patch for the bug does help us if it is a good one. But do not
+ omit the necessary information, such as the test case, on the
+ assumption that a patch is all we need. We might see problems
+ with your patch and decide to fix the problem another way, or we
+ might not understand it at all.
+
+ Sometimes with programs as complicated as the binary utilities it
+ is very hard to construct an example that will make the program
+ follow a certain path through the code. If you do not send us the
+ example, we will not be able to construct one, so we will not be
+ able to verify that the bug is fixed.
+
+ And if we cannot understand what bug you are trying to fix, or why
+ your patch should be an improvement, we will not install it. A
+ test case will help us to understand.
+
+ * A guess about what the bug is or what it depends on.
+
+ Such guesses are usually wrong. Even we cannot guess right about
+ such things without first using the debugger to find the facts.
+
+
+File: binutils.info, Node: GNU Free Documentation License, Next: Binutils Index, Prev: Reporting Bugs, Up: Top
+
+Appendix A GNU Free Documentation License
+*****************************************
+
+ Version 1.3, 3 November 2008
+
+ Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+ `http://fsf.org/'
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ 0. PREAMBLE
+
+ The purpose of this License is to make a manual, textbook, or other
+ functional and useful document "free" in the sense of freedom: to
+ assure everyone the effective freedom to copy and redistribute it,
+ with or without modifying it, either commercially or
+ noncommercially. Secondarily, this License preserves for the
+ author and publisher a way to get credit for their work, while not
+ being considered responsible for modifications made by others.
+
+ This License is a kind of "copyleft", which means that derivative
+ works of the document must themselves be free in the same sense.
+ It complements the GNU General Public License, which is a copyleft
+ license designed for free software.
+
+ We have designed this License in order to use it for manuals for
+ free software, because free software needs free documentation: a
+ free program should come with manuals providing the same freedoms
+ that the software does. But this License is not limited to
+ software manuals; it can be used for any textual work, regardless
+ of subject matter or whether it is published as a printed book.
+ We recommend this License principally for works whose purpose is
+ instruction or reference.
+
+ 1. APPLICABILITY AND DEFINITIONS
+
+ This License applies to any manual or other work, in any medium,
+ that contains a notice placed by the copyright holder saying it
+ can be distributed under the terms of this License. Such a notice
+ grants a world-wide, royalty-free license, unlimited in duration,
+ to use that work under the conditions stated herein. The
+ "Document", below, refers to any such manual or work. Any member
+ of the public is a licensee, and is addressed as "you". You
+ accept the license if you copy, modify or distribute the work in a
+ way requiring permission under copyright law.
+
+ A "Modified Version" of the Document means any work containing the
+ Document or a portion of it, either copied verbatim, or with
+ modifications and/or translated into another language.
+
+ A "Secondary Section" is a named appendix or a front-matter section
+ of the Document that deals exclusively with the relationship of the
+ publishers or authors of the Document to the Document's overall
+ subject (or to related matters) and contains nothing that could
+ fall directly within that overall subject. (Thus, if the Document
+ is in part a textbook of mathematics, a Secondary Section may not
+ explain any mathematics.) The relationship could be a matter of
+ historical connection with the subject or with related matters, or
+ of legal, commercial, philosophical, ethical or political position
+ regarding them.
+
+ The "Invariant Sections" are certain Secondary Sections whose
+ titles are designated, as being those of Invariant Sections, in
+ the notice that says that the Document is released under this
+ License. If a section does not fit the above definition of
+ Secondary then it is not allowed to be designated as Invariant.
+ The Document may contain zero Invariant Sections. If the Document
+ does not identify any Invariant Sections then there are none.
+
+ The "Cover Texts" are certain short passages of text that are
+ listed, as Front-Cover Texts or Back-Cover Texts, in the notice
+ that says that the Document is released under this License. A
+ Front-Cover Text may be at most 5 words, and a Back-Cover Text may
+ be at most 25 words.
+
+ A "Transparent" copy of the Document means a machine-readable copy,
+ represented in a format whose specification is available to the
+ general public, that is suitable for revising the document
+ straightforwardly with generic text editors or (for images
+ composed of pixels) generic paint programs or (for drawings) some
+ widely available drawing editor, and that is suitable for input to
+ text formatters or for automatic translation to a variety of
+ formats suitable for input to text formatters. A copy made in an
+ otherwise Transparent file format whose markup, or absence of
+ markup, has been arranged to thwart or discourage subsequent
+ modification by readers is not Transparent. An image format is
+ not Transparent if used for any substantial amount of text. A
+ copy that is not "Transparent" is called "Opaque".
+
+ Examples of suitable formats for Transparent copies include plain
+ ASCII without markup, Texinfo input format, LaTeX input format,
+ SGML or XML using a publicly available DTD, and
+ standard-conforming simple HTML, PostScript or PDF designed for
+ human modification. Examples of transparent image formats include
+ PNG, XCF and JPG. Opaque formats include proprietary formats that
+ can be read and edited only by proprietary word processors, SGML or
+ XML for which the DTD and/or processing tools are not generally
+ available, and the machine-generated HTML, PostScript or PDF
+ produced by some word processors for output purposes only.
+
+ The "Title Page" means, for a printed book, the title page itself,
+ plus such following pages as are needed to hold, legibly, the
+ material this License requires to appear in the title page. For
+ works in formats which do not have any title page as such, "Title
+ Page" means the text near the most prominent appearance of the
+ work's title, preceding the beginning of the body of the text.
+
+ The "publisher" means any person or entity that distributes copies
+ of the Document to the public.
+
+ A section "Entitled XYZ" means a named subunit of the Document
+ whose title either is precisely XYZ or contains XYZ in parentheses
+ following text that translates XYZ in another language. (Here XYZ
+ stands for a specific section name mentioned below, such as
+ "Acknowledgements", "Dedications", "Endorsements", or "History".)
+ To "Preserve the Title" of such a section when you modify the
+ Document means that it remains a section "Entitled XYZ" according
+ to this definition.
+
+ The Document may include Warranty Disclaimers next to the notice
+ which states that this License applies to the Document. These
+ Warranty Disclaimers are considered to be included by reference in
+ this License, but only as regards disclaiming warranties: any other
+ implication that these Warranty Disclaimers may have is void and
+ has no effect on the meaning of this License.
+
+ 2. VERBATIM COPYING
+
+ You may copy and distribute the Document in any medium, either
+ commercially or noncommercially, provided that this License, the
+ copyright notices, and the license notice saying this License
+ applies to the Document are reproduced in all copies, and that you
+ add no other conditions whatsoever to those of this License. You
+ may not use technical measures to obstruct or control the reading
+ or further copying of the copies you make or distribute. However,
+ you may accept compensation in exchange for copies. If you
+ distribute a large enough number of copies you must also follow
+ the conditions in section 3.
+
+ You may also lend copies, under the same conditions stated above,
+ and you may publicly display copies.
+
+ 3. COPYING IN QUANTITY
+
+ If you publish printed copies (or copies in media that commonly
+ have printed covers) of the Document, numbering more than 100, and
+ the Document's license notice requires Cover Texts, you must
+ enclose the copies in covers that carry, clearly and legibly, all
+ these Cover Texts: Front-Cover Texts on the front cover, and
+ Back-Cover Texts on the back cover. Both covers must also clearly
+ and legibly identify you as the publisher of these copies. The
+ front cover must present the full title with all words of the
+ title equally prominent and visible. You may add other material
+ on the covers in addition. Copying with changes limited to the
+ covers, as long as they preserve the title of the Document and
+ satisfy these conditions, can be treated as verbatim copying in
+ other respects.
+
+ If the required texts for either cover are too voluminous to fit
+ legibly, you should put the first ones listed (as many as fit
+ reasonably) on the actual cover, and continue the rest onto
+ adjacent pages.
+
+ If you publish or distribute Opaque copies of the Document
+ numbering more than 100, you must either include a
+ machine-readable Transparent copy along with each Opaque copy, or
+ state in or with each Opaque copy a computer-network location from
+ which the general network-using public has access to download
+ using public-standard network protocols a complete Transparent
+ copy of the Document, free of added material. If you use the
+ latter option, you must take reasonably prudent steps, when you
+ begin distribution of Opaque copies in quantity, to ensure that
+ this Transparent copy will remain thus accessible at the stated
+ location until at least one year after the last time you
+ distribute an Opaque copy (directly or through your agents or
+ retailers) of that edition to the public.
+
+ It is requested, but not required, that you contact the authors of
+ the Document well before redistributing any large number of
+ copies, to give them a chance to provide you with an updated
+ version of the Document.
+
+ 4. MODIFICATIONS
+
+ You may copy and distribute a Modified Version of the Document
+ under the conditions of sections 2 and 3 above, provided that you
+ release the Modified Version under precisely this License, with
+ the Modified Version filling the role of the Document, thus
+ licensing distribution and modification of the Modified Version to
+ whoever possesses a copy of it. In addition, you must do these
+ things in the Modified Version:
+
+ A. Use in the Title Page (and on the covers, if any) a title
+ distinct from that of the Document, and from those of
+ previous versions (which should, if there were any, be listed
+ in the History section of the Document). You may use the
+ same title as a previous version if the original publisher of
+ that version gives permission.
+
+ B. List on the Title Page, as authors, one or more persons or
+ entities responsible for authorship of the modifications in
+ the Modified Version, together with at least five of the
+ principal authors of the Document (all of its principal
+ authors, if it has fewer than five), unless they release you
+ from this requirement.
+
+ C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+
+ D. Preserve all the copyright notices of the Document.
+
+ E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+
+ F. Include, immediately after the copyright notices, a license
+ notice giving the public permission to use the Modified
+ Version under the terms of this License, in the form shown in
+ the Addendum below.
+
+ G. Preserve in that license notice the full lists of Invariant
+ Sections and required Cover Texts given in the Document's
+ license notice.
+
+ H. Include an unaltered copy of this License.
+
+ I. Preserve the section Entitled "History", Preserve its Title,
+ and add to it an item stating at least the title, year, new
+ authors, and publisher of the Modified Version as given on
+ the Title Page. If there is no section Entitled "History" in
+ the Document, create one stating the title, year, authors,
+ and publisher of the Document as given on its Title Page,
+ then add an item describing the Modified Version as stated in
+ the previous sentence.
+
+ J. Preserve the network location, if any, given in the Document
+ for public access to a Transparent copy of the Document, and
+ likewise the network locations given in the Document for
+ previous versions it was based on. These may be placed in
+ the "History" section. You may omit a network location for a
+ work that was published at least four years before the
+ Document itself, or if the original publisher of the version
+ it refers to gives permission.
+
+ K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the
+ section all the substance and tone of each of the contributor
+ acknowledgements and/or dedications given therein.
+
+ L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section
+ titles.
+
+ M. Delete any section Entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+
+ N. Do not retitle any existing section to be Entitled
+ "Endorsements" or to conflict in title with any Invariant
+ Section.
+
+ O. Preserve any Warranty Disclaimers.
+
+ If the Modified Version includes new front-matter sections or
+ appendices that qualify as Secondary Sections and contain no
+ material copied from the Document, you may at your option
+ designate some or all of these sections as invariant. To do this,
+ add their titles to the list of Invariant Sections in the Modified
+ Version's license notice. These titles must be distinct from any
+ other section titles.
+
+ You may add a section Entitled "Endorsements", provided it contains
+ nothing but endorsements of your Modified Version by various
+ parties--for example, statements of peer review or that the text
+ has been approved by an organization as the authoritative
+ definition of a standard.
+
+ You may add a passage of up to five words as a Front-Cover Text,
+ and a passage of up to 25 words as a Back-Cover Text, to the end
+ of the list of Cover Texts in the Modified Version. Only one
+ passage of Front-Cover Text and one of Back-Cover Text may be
+ added by (or through arrangements made by) any one entity. If the
+ Document already includes a cover text for the same cover,
+ previously added by you or by arrangement made by the same entity
+ you are acting on behalf of, you may not add another; but you may
+ replace the old one, on explicit permission from the previous
+ publisher that added the old one.
+
+ The author(s) and publisher(s) of the Document do not by this
+ License give permission to use their names for publicity for or to
+ assert or imply endorsement of any Modified Version.
+
+ 5. COMBINING DOCUMENTS
+
+ You may combine the Document with other documents released under
+ this License, under the terms defined in section 4 above for
+ modified versions, provided that you include in the combination
+ all of the Invariant Sections of all of the original documents,
+ unmodified, and list them all as Invariant Sections of your
+ combined work in its license notice, and that you preserve all
+ their Warranty Disclaimers.
+
+ The combined work need only contain one copy of this License, and
+ multiple identical Invariant Sections may be replaced with a single
+ copy. If there are multiple Invariant Sections with the same name
+ but different contents, make the title of each such section unique
+ by adding at the end of it, in parentheses, the name of the
+ original author or publisher of that section if known, or else a
+ unique number. Make the same adjustment to the section titles in
+ the list of Invariant Sections in the license notice of the
+ combined work.
+
+ In the combination, you must combine any sections Entitled
+ "History" in the various original documents, forming one section
+ Entitled "History"; likewise combine any sections Entitled
+ "Acknowledgements", and any sections Entitled "Dedications". You
+ must delete all sections Entitled "Endorsements."
+
+ 6. COLLECTIONS OF DOCUMENTS
+
+ You may make a collection consisting of the Document and other
+ documents released under this License, and replace the individual
+ copies of this License in the various documents with a single copy
+ that is included in the collection, provided that you follow the
+ rules of this License for verbatim copying of each of the
+ documents in all other respects.
+
+ You may extract a single document from such a collection, and
+ distribute it individually under this License, provided you insert
+ a copy of this License into the extracted document, and follow
+ this License in all other respects regarding verbatim copying of
+ that document.
+
+ 7. AGGREGATION WITH INDEPENDENT WORKS
+
+ A compilation of the Document or its derivatives with other
+ separate and independent documents or works, in or on a volume of
+ a storage or distribution medium, is called an "aggregate" if the
+ copyright resulting from the compilation is not used to limit the
+ legal rights of the compilation's users beyond what the individual
+ works permit. When the Document is included in an aggregate, this
+ License does not apply to the other works in the aggregate which
+ are not themselves derivative works of the Document.
+
+ If the Cover Text requirement of section 3 is applicable to these
+ copies of the Document, then if the Document is less than one half
+ of the entire aggregate, the Document's Cover Texts may be placed
+ on covers that bracket the Document within the aggregate, or the
+ electronic equivalent of covers if the Document is in electronic
+ form. Otherwise they must appear on printed covers that bracket
+ the whole aggregate.
+
+ 8. TRANSLATION
+
+ Translation is considered a kind of modification, so you may
+ distribute translations of the Document under the terms of section
+ 4. Replacing Invariant Sections with translations requires special
+ permission from their copyright holders, but you may include
+ translations of some or all Invariant Sections in addition to the
+ original versions of these Invariant Sections. You may include a
+ translation of this License, and all the license notices in the
+ Document, and any Warranty Disclaimers, provided that you also
+ include the original English version of this License and the
+ original versions of those notices and disclaimers. In case of a
+ disagreement between the translation and the original version of
+ this License or a notice or disclaimer, the original version will
+ prevail.
+
+ If a section in the Document is Entitled "Acknowledgements",
+ "Dedications", or "History", the requirement (section 4) to
+ Preserve its Title (section 1) will typically require changing the
+ actual title.
+
+ 9. TERMINATION
+
+ You may not copy, modify, sublicense, or distribute the Document
+ except as expressly provided under this License. Any attempt
+ otherwise to copy, modify, sublicense, or distribute it is void,
+ and will automatically terminate your rights under this License.
+
+ However, if you cease all violation of this License, then your
+ license from a particular copyright holder is reinstated (a)
+ provisionally, unless and until the copyright holder explicitly
+ and finally terminates your license, and (b) permanently, if the
+ copyright holder fails to notify you of the violation by some
+ reasonable means prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+ reinstated permanently if the copyright holder notifies you of the
+ violation by some reasonable means, this is the first time you have
+ received notice of violation of this License (for any work) from
+ that copyright holder, and you cure the violation prior to 30 days
+ after your receipt of the notice.
+
+ Termination of your rights under this section does not terminate
+ the licenses of parties who have received copies or rights from
+ you under this License. If your rights have been terminated and
+ not permanently reinstated, receipt of a copy of some or all of
+ the same material does not give you any rights to use it.
+
+ 10. FUTURE REVISIONS OF THIS LICENSE
+
+ The Free Software Foundation may publish new, revised versions of
+ the GNU Free Documentation License from time to time. Such new
+ versions will be similar in spirit to the present version, but may
+ differ in detail to address new problems or concerns. See
+ `http://www.gnu.org/copyleft/'.
+
+ Each version of the License is given a distinguishing version
+ number. If the Document specifies that a particular numbered
+ version of this License "or any later version" applies to it, you
+ have the option of following the terms and conditions either of
+ that specified version or of any later version that has been
+ published (not as a draft) by the Free Software Foundation. If
+ the Document does not specify a version number of this License,
+ you may choose any version ever published (not as a draft) by the
+ Free Software Foundation. If the Document specifies that a proxy
+ can decide which future versions of this License can be used, that
+ proxy's public statement of acceptance of a version permanently
+ authorizes you to choose that version for the Document.
+
+ 11. RELICENSING
+
+ "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
+ World Wide Web server that publishes copyrightable works and also
+ provides prominent facilities for anybody to edit those works. A
+ public wiki that anybody can edit is an example of such a server.
+ A "Massive Multiauthor Collaboration" (or "MMC") contained in the
+ site means any set of copyrightable works thus published on the MMC
+ site.
+
+ "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
+ license published by Creative Commons Corporation, a not-for-profit
+ corporation with a principal place of business in San Francisco,
+ California, as well as future copyleft versions of that license
+ published by that same organization.
+
+ "Incorporate" means to publish or republish a Document, in whole or
+ in part, as part of another Document.
+
+ An MMC is "eligible for relicensing" if it is licensed under this
+ License, and if all works that were first published under this
+ License somewhere other than this MMC, and subsequently
+ incorporated in whole or in part into the MMC, (1) had no cover
+ texts or invariant sections, and (2) were thus incorporated prior
+ to November 1, 2008.
+
+ The operator of an MMC Site may republish an MMC contained in the
+ site under CC-BY-SA on the same site at any time before August 1,
+ 2009, provided the MMC is eligible for relicensing.
+
+
+ADDENDUM: How to use this License for your documents
+====================================================
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and license
+notices just after the title page:
+
+ Copyright (C) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.3
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+ Texts. A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
+
+ If you have Invariant Sections, Front-Cover Texts and Back-Cover
+Texts, replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with
+ the Front-Cover Texts being LIST, and with the Back-Cover Texts
+ being LIST.
+
+ If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+ If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License, to
+permit their use in free software.
+
+
+File: binutils.info, Node: Binutils Index, Prev: GNU Free Documentation License, Up: Top
+
+Binutils Index
+**************
+
+
+* Menu:
+
+* .stab: objdump. (line 370)
+* Add prefix to absolute paths: objdump. (line 341)
+* addr2line: addr2line. (line 6)
+* address to file name and line number: addr2line. (line 6)
+* all header information, object file: objdump. (line 489)
+* ar: ar. (line 6)
+* ar compatibility: ar. (line 50)
+* architecture: objdump. (line 195)
+* architectures available: objdump. (line 180)
+* archive contents: ranlib. (line 6)
+* Archive file symbol index information: readelf. (line 147)
+* archive headers: objdump. (line 65)
+* archives: ar. (line 6)
+* base files: dlltool. (line 123)
+* bug criteria: Bug Criteria. (line 6)
+* bug reports: Bug Reporting. (line 6)
+* bugs: Reporting Bugs. (line 6)
+* bugs, reporting: Bug Reporting. (line 6)
+* c++filt: c++filt. (line 6)
+* changing object addresses: objcopy. (line 282)
+* changing section address: objcopy. (line 292)
+* changing section LMA: objcopy. (line 300)
+* changing section VMA: objcopy. (line 313)
+* changing start address: objcopy. (line 277)
+* collections of files: ar. (line 6)
+* compatibility, ar: ar. (line 50)
+* contents of archive: ar cmdline. (line 88)
+* crash: Bug Criteria. (line 9)
+* creating archives: ar cmdline. (line 129)
+* creating thin archive: ar cmdline. (line 190)
+* cxxfilt: c++filt. (line 14)
+* dates in archive: ar cmdline. (line 164)
+* debug symbols: objdump. (line 370)
+* debugging symbols: nm. (line 141)
+* deleting from archive: ar cmdline. (line 26)
+* demangling C++ symbols: c++filt. (line 6)
+* demangling in nm: nm. (line 149)
+* demangling in objdump <1>: addr2line. (line 55)
+* demangling in objdump: objdump. (line 93)
+* deterministic archives: ar cmdline. (line 135)
+* disassembling object code: objdump. (line 115)
+* disassembly architecture: objdump. (line 195)
+* disassembly endianness: objdump. (line 135)
+* disassembly, with source: objdump. (line 337)
+* discarding symbols: strip. (line 6)
+* DLL: dlltool. (line 6)
+* dlltool: dlltool. (line 6)
+* DWARF: objdump. (line 363)
+* dynamic relocation entries, in object file: objdump. (line 325)
+* dynamic symbol table entries, printing: objdump. (line 473)
+* dynamic symbols: nm. (line 161)
+* ELF dynamic section information: readelf. (line 105)
+* ELF file header information: readelf. (line 54)
+* ELF file information: readelf. (line 6)
+* ELF notes: readelf. (line 90)
+* ELF object file format: objdump. (line 370)
+* ELF program header information: readelf. (line 60)
+* ELF reloc information: readelf. (line 94)
+* ELF section group information: readelf. (line 71)
+* ELF section information: readelf. (line 66)
+* ELF segment information: readelf. (line 60)
+* ELF symbol table information: readelf. (line 81)
+* ELF version sections informations: readelf. (line 109)
+* endianness: objdump. (line 135)
+* error on valid input: Bug Criteria. (line 12)
+* external symbols: nm. (line 253)
+* extract from archive: ar cmdline. (line 103)
+* fatal signal: Bug Criteria. (line 9)
+* file name: nm. (line 135)
+* header information, all: objdump. (line 489)
+* input .def file: dlltool. (line 119)
+* input file name: nm. (line 135)
+* Instruction width: objdump. (line 358)
+* libraries: ar. (line 25)
+* listings strings: strings. (line 6)
+* load plugin: nm. (line 176)
+* machine instructions: objdump. (line 115)
+* moving in archive: ar cmdline. (line 34)
+* MRI compatibility, ar: ar scripts. (line 8)
+* name duplication in archive: ar cmdline. (line 97)
+* name length: ar. (line 18)
+* nm: nm. (line 6)
+* nm compatibility: nm. (line 167)
+* nm format: nm. (line 145)
+* not writing archive index: ar cmdline. (line 183)
+* objdump: objdump. (line 6)
+* object code format <1>: addr2line. (line 50)
+* object code format <2>: strings. (line 67)
+* object code format <3>: objdump. (line 79)
+* object code format <4>: size. (line 84)
+* object code format: nm. (line 244)
+* object file header: objdump. (line 141)
+* object file information: objdump. (line 6)
+* object file offsets: objdump. (line 146)
+* object file sections: objdump. (line 332)
+* object formats available: objdump. (line 180)
+* operations on archive: ar cmdline. (line 22)
+* printing from archive: ar cmdline. (line 46)
+* printing strings: strings. (line 6)
+* quick append to archive: ar cmdline. (line 54)
+* radix for section sizes: size. (line 66)
+* ranlib: ranlib. (line 6)
+* readelf: readelf. (line 6)
+* relative placement in archive: ar cmdline. (line 117)
+* relocation entries, in object file: objdump. (line 319)
+* removing symbols: strip. (line 6)
+* repeated names in archive: ar cmdline. (line 97)
+* replacement in archive: ar cmdline. (line 70)
+* reporting bugs: Reporting Bugs. (line 6)
+* scripts, ar: ar scripts. (line 8)
+* section addresses in objdump: objdump. (line 71)
+* section headers: objdump. (line 162)
+* section information: objdump. (line 185)
+* section sizes: size. (line 6)
+* sections, full contents: objdump. (line 332)
+* size: size. (line 6)
+* size display format: size. (line 27)
+* size number format: size. (line 66)
+* sorting symbols: nm. (line 197)
+* source code context: objdump. (line 155)
+* source disassembly: objdump. (line 337)
+* source file name: nm. (line 135)
+* source filenames for object files: objdump. (line 189)
+* stab: objdump. (line 370)
+* start-address: objdump. (line 380)
+* stop-address: objdump. (line 384)
+* strings: strings. (line 6)
+* strings, printing: strings. (line 6)
+* strip: strip. (line 6)
+* Strip absolute paths: objdump. (line 344)
+* symbol index <1>: ranlib. (line 6)
+* symbol index: ar. (line 28)
+* symbol index, listing: nm. (line 214)
+* symbol line numbers: nm. (line 182)
+* symbol table entries, printing: objdump. (line 389)
+* symbols: nm. (line 6)
+* symbols, discarding: strip. (line 6)
+* thin archives: ar. (line 40)
+* undefined symbols: nm. (line 249)
+* Unix compatibility, ar: ar cmdline. (line 8)
+* unwind information: readelf. (line 99)
+* updating an archive: ar cmdline. (line 195)
+* version: Top. (line 6)
+* VMA in objdump: objdump. (line 71)
+* wide output, printing: objdump. (line 495)
+* writing archive index: ar cmdline. (line 177)
+
+
+
+Tag Table:
+Node: Top1929
+Node: ar3572
+Node: ar cmdline6377
+Node: ar scripts15420
+Node: nm21108
+Node: objcopy30582
+Node: objdump58823
+Node: ranlib79295
+Node: size80116
+Node: strings83121
+Node: strip85579
+Node: c++filt91530
+Ref: c++filt-Footnote-196375
+Node: addr2line96481
+Node: nlmconv99752
+Node: windmc102358
+Node: windres106005
+Node: dlltool112032
+Node: def file format124716
+Node: readelf126454
+Node: Common Options132460
+Node: Selecting the Target System133500
+Node: Target Selection134432
+Node: Architecture Selection136414
+Node: Reporting Bugs137242
+Node: Bug Criteria138021
+Node: Bug Reporting138574
+Node: GNU Free Documentation License145444
+Node: Binutils Index170623
+
+End Tag Table
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/configure.info b/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/configure.info
new file mode 100644
index 0000000..cee206a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/configure.info
@@ -0,0 +1,2773 @@
+This is configure.info, produced by makeinfo version 4.8 from
+./configure.texi.
+
+INFO-DIR-SECTION GNU admin
+START-INFO-DIR-ENTRY
+* configure: (configure). The GNU configure and build system
+END-INFO-DIR-ENTRY
+
+ This file documents the GNU configure and build system.
+
+ Copyright (C) 1998 Cygnus Solutions.
+
+ Permission is granted to make and distribute verbatim copies of this
+manual provided the copyright notice and this permission notice are
+preserved on all copies.
+
+ Permission is granted to copy and distribute modified versions of
+this manual under the conditions for verbatim copying, provided that
+the entire resulting derived work is distributed under the terms of a
+permission notice identical to this one.
+
+ Permission is granted to copy and distribute translations of this
+manual into another language, under the above conditions for modified
+versions, except that this permission notice may be stated in a
+translation approved by the Foundation.
+
+
+File: configure.info, Node: Top, Next: Introduction, Up: (dir)
+
+GNU configure and build system
+******************************
+
+The GNU configure and build system.
+
+* Menu:
+
+* Introduction:: Introduction.
+* Getting Started:: Getting Started.
+* Files:: Files.
+* Configuration Names:: Configuration Names.
+* Cross Compilation Tools:: Cross Compilation Tools.
+* Canadian Cross:: Canadian Cross.
+* Cygnus Configure:: Cygnus Configure.
+* Multilibs:: Multilibs.
+* FAQ:: Frequently Asked Questions.
+* Index:: Index.
+
+
+File: configure.info, Node: Introduction, Next: Getting Started, Prev: Top, Up: Top
+
+1 Introduction
+**************
+
+This document describes the GNU configure and build systems. It
+describes how autoconf, automake, libtool, and make fit together. It
+also includes a discussion of the older Cygnus configure system.
+
+ This document does not describe in detail how to use each of the
+tools; see the respective manuals for that. Instead, it describes
+which files the developer must write, which files are machine generated
+and how they are generated, and where certain common problems should be
+addressed.
+
+ This document draws on several sources, including the autoconf
+manual by David MacKenzie (*note autoconf overview: (autoconf)Top.),
+the automake manual by David MacKenzie and Tom Tromey (*note automake
+overview: (automake)Top.), the libtool manual by Gordon Matzigkeit
+(*note libtool overview: (libtool)Top.), and the Cygnus configure
+manual by K. Richard Pixley.
+
+* Menu:
+
+* Goals:: Goals.
+* Tools:: The tools.
+* History:: History.
+* Building:: Building.
+
+
+File: configure.info, Node: Goals, Next: Tools, Up: Introduction
+
+1.1 Goals
+=========
+
+The GNU configure and build system has two main goals.
+
+ The first is to simplify the development of portable programs. The
+system permits the developer to concentrate on writing the program,
+simplifying many details of portability across Unix and even Windows
+systems, and permitting the developer to describe how to build the
+program using simple rules rather than complex Makefiles.
+
+ The second is to simplify the building of programs distributed as
+source code. All programs are built using a simple, standardized, two
+step process. The program builder need not install any special tools in
+order to build the program.
+
+
+File: configure.info, Node: Tools, Next: History, Prev: Goals, Up: Introduction
+
+1.2 Tools
+=========
+
+The GNU configure and build system is comprised of several different
+tools. Program developers must build and install all of these tools.
+
+ People who just want to build programs from distributed sources
+normally do not need any special tools beyond a Unix shell, a make
+program, and a C compiler.
+
+autoconf
+ provides a general portability framework, based on testing the
+ features of the host system at build time.
+
+automake
+ a system for describing how to build a program, permitting the
+ developer to write a simplified `Makefile'.
+
+libtool
+ a standardized approach to building shared libraries.
+
+gettext
+ provides a framework for translation of text messages into other
+ languages; not really discussed in this document.
+
+m4
+ autoconf requires the GNU version of m4; the standard Unix m4 does
+ not suffice.
+
+perl
+ automake requires perl.
+
+
+File: configure.info, Node: History, Next: Building, Prev: Tools, Up: Introduction
+
+1.3 History
+===========
+
+This is a very brief and probably inaccurate history.
+
+ As the number of Unix variants increased during the 1980s, it became
+harder to write programs which could run on all variants. While it was
+often possible to use `#ifdef' to identify particular systems,
+developers frequently did not have access to every system, and the
+characteristics of some systems changed from version to version.
+
+ By 1992, at least three different approaches had been developed:
+ * The Metaconfig program, by Larry Wall, Harlan Stenn, and Raphael
+ Manfredi.
+
+ * The Cygnus configure script, by K. Richard Pixley, and the gcc
+ configure script, by Richard Stallman. These use essentially the
+ same approach, and the developers communicated regularly.
+
+ * The autoconf program, by David MacKenzie.
+
+ The Metaconfig program is still used for Perl and a few other
+programs. It is part of the Dist package. I do not know if it is
+being developed.
+
+ In 1994, David MacKenzie and others modified autoconf to incorporate
+all the features of Cygnus configure. Since then, there has been a
+slow but steady conversion of GNU programs from Cygnus configure to
+autoconf. gcc has been converted, eliminating the gcc configure script.
+
+ GNU autoconf was regularly maintained until late 1996. As of this
+writing in June, 1998, it has no public maintainer.
+
+ Most programs are built using the make program, which requires the
+developer to write Makefiles describing how to build the programs.
+Since most programs are built in pretty much the same way, this led to a
+lot of duplication.
+
+ The X Window system is built using the imake tool, which uses a
+database of rules to eliminate the duplication. However, building a
+tool which was developed using imake requires that the builder have
+imake installed, violating one of the goals of the GNU system.
+
+ The new BSD make provides a standard library of Makefile fragments,
+which permits developers to write very simple Makefiles. However, this
+requires that the builder install the new BSD make program.
+
+ In 1994, David MacKenzie wrote the first version of automake, which
+permitted writing a simple build description which was converted into a
+Makefile which could be used by the standard make program. In 1995, Tom
+Tromey completely rewrote automake in Perl, and he continues to enhance
+it.
+
+ Various free packages built libraries, and by around 1995 several
+included support to build shared libraries on various platforms.
+However, there was no consistent approach. In early 1996, Gordon
+Matzigkeit began working on libtool, which provided a standardized
+approach to building shared libraries. This was integrated into
+automake from the start.
+
+ The development of automake and libtool was driven by the GNITS
+project, a group of GNU maintainers who designed standardized tools to
+help meet the GNU coding standards.
+
+
+File: configure.info, Node: Building, Prev: History, Up: Introduction
+
+1.4 Building
+============
+
+Most readers of this document should already know how to build a tool by
+running `configure' and `make'. This section may serve as a quick
+introduction or reminder.
+
+ Building a tool is normally as simple as running `configure'
+followed by `make'. You should normally run `configure' from an empty
+directory, using some path to refer to the `configure' script in the
+source directory. The directory in which you run `configure' is called
+the "object directory".
+
+ In order to use a object directory which is different from the source
+directory, you must be using the GNU version of `make', which has the
+required `VPATH' support. Despite this restriction, using a different
+object directory is highly recommended:
+ * It keeps the files generated during the build from cluttering up
+ your sources.
+
+ * It permits you to remove the built files by simply removing the
+ entire build directory.
+
+ * It permits you to build from the same sources with several sets of
+ configure options simultaneously.
+
+ If you don't have GNU `make', you will have to run `configure' in
+the source directory. All GNU packages should support this; in
+particular, GNU packages should not assume the presence of GNU `make'.
+
+ After running `configure', you can build the tools by running `make'.
+
+ To install the tools, run `make install'. Installing the tools will
+copy the programs and any required support files to the "installation
+directory". The location of the installation directory is controlled
+by `configure' options, as described below.
+
+ In the Cygnus tree at present, the info files are built and
+installed as a separate step. To build them, run `make info'. To
+install them, run `make install-info'. The equivalent html files are
+also built and installed in a separate step. To build the html files,
+run `make html'. To install the html files run `make install-html'.
+
+ All `configure' scripts support a wide variety of options. The most
+interesting ones are `--with' and `--enable' options which are
+generally specific to particular tools. You can usually use the
+`--help' option to get a list of interesting options for a particular
+configure script.
+
+ The only generic options you are likely to use are the `--prefix'
+and `--exec-prefix' options. These options are used to specify the
+installation directory.
+
+ The directory named by the `--prefix' option will hold machine
+independent files such as info files.
+
+ The directory named by the `--exec-prefix' option, which is normally
+a subdirectory of the `--prefix' directory, will hold machine dependent
+files such as executables.
+
+ The default for `--prefix' is `/usr/local'. The default for
+`--exec-prefix' is the value used for `--prefix'.
+
+ The convention used in Cygnus releases is to use a `--prefix' option
+of `/usr/cygnus/RELEASE', where RELEASE is the name of the release, and
+to use a `--exec-prefix' option of `/usr/cygnus/RELEASE/H-HOST', where
+HOST is the configuration name of the host system (*note Configuration
+Names::).
+
+ Do not use either the source or the object directory as the
+installation directory. That will just lead to confusion.
+
+
+File: configure.info, Node: Getting Started, Next: Files, Prev: Introduction, Up: Top
+
+2 Getting Started
+*****************
+
+To start using the GNU configure and build system with your software
+package, you must write three files, and you must run some tools to
+manually generate additional files.
+
+* Menu:
+
+* Write configure.in:: Write configure.in.
+* Write Makefile.am:: Write Makefile.am.
+* Write acconfig.h:: Write acconfig.h.
+* Generate files:: Generate files.
+* Getting Started Example:: Example.
+
+
+File: configure.info, Node: Write configure.in, Next: Write Makefile.am, Up: Getting Started
+
+2.1 Write configure.in
+======================
+
+You must first write the file `configure.in'. This is an autoconf
+input file, and the autoconf manual describes in detail what this file
+should look like.
+
+ You will write tests in your `configure.in' file to check for
+conditions that may change from one system to another, such as the
+presence of particular header files or functions.
+
+ For example, not all systems support the `gettimeofday' function.
+If you want to use the `gettimeofday' function when it is available,
+and to use some other function when it is not, you would check for this
+by putting `AC_CHECK_FUNCS(gettimeofday)' in `configure.in'.
+
+ When the configure script is run at build time, this will arrange to
+define the preprocessor macro `HAVE_GETTIMEOFDAY' to the value 1 if the
+`gettimeofday' function is available, and to not define the macro at
+all if the function is not available. Your code can then use `#ifdef'
+to test whether it is safe to call `gettimeofday'.
+
+ If you have an existing body of code, the `autoscan' program may
+help identify potential portability problems, and hence configure tests
+that you will want to use. *Note Invoking autoscan: (autoconf)Invoking
+autoscan.
+
+ Another handy tool for an existing body of code is `ifnames'. This
+will show you all the preprocessor conditionals that the code already
+uses. *Note Invoking ifnames: (autoconf)Invoking ifnames.
+
+ Besides the portability tests which are specific to your particular
+package, every `configure.in' file should contain the following macros.
+
+`AC_INIT'
+ This macro takes a single argument, which is the name of a file in
+ your package. For example, `AC_INIT(foo.c)'.
+
+`AC_PREREQ(VERSION)'
+ This macro is optional. It may be used to indicate the version of
+ `autoconf' that you are using. This will prevent users from
+ running an earlier version of `autoconf' and perhaps getting an
+ invalid `configure' script. For example, `AC_PREREQ(2.12)'.
+
+`AM_INIT_AUTOMAKE'
+ This macro takes two arguments: the name of the package, and a
+ version number. For example, `AM_INIT_AUTOMAKE(foo, 1.0)'. (This
+ macro is not needed if you are not using automake).
+
+`AM_CONFIG_HEADER'
+ This macro names the header file which will hold the preprocessor
+ macro definitions at run time. Normally this should be
+ `config.h'. Your sources would then use `#include "config.h"' to
+ include it.
+
+ This macro may optionally name the input file for that header
+ file; by default, this is `config.h.in', but that file name works
+ poorly on DOS filesystems. Therefore, it is often better to name
+ it explicitly as `config.in'.
+
+ This is what you should normally put in `configure.in':
+ AM_CONFIG_HEADER(config.h:config.in)
+
+ (If you are not using automake, use `AC_CONFIG_HEADER' rather than
+ `AM_CONFIG_HEADER').
+
+`AM_MAINTAINER_MODE'
+ This macro always appears in Cygnus configure scripts. Other
+ programs may or may not use it.
+
+ If this macro is used, the `--enable-maintainer-mode' option is
+ required to enable automatic rebuilding of generated files used by
+ the configure system. This of course requires that developers be
+ aware of, and use, that option.
+
+ If this macro is not used, then the generated files will always be
+ rebuilt automatically. This will cause problems if the wrong
+ versions of autoconf, automake, or others are in the builder's
+ `PATH'.
+
+ (If you are not using automake, you do not need to use this macro).
+
+`AC_EXEEXT'
+ Either this macro or `AM_EXEEXT' always appears in Cygnus configure
+ files. Other programs may or may not use one of them.
+
+ This macro looks for the executable suffix used on the host
+ system. On Unix systems, this is the empty string. On Windows
+ systems, this is `.exe'. This macro directs automake to use the
+ executable suffix as appropriate when creating programs. This
+ macro does not take any arguments.
+
+ The `AC_EXEEXT' form is new, and is part of a Cygnus patch to
+ autoconf to support compiling with Visual C++. Older programs use
+ `AM_EXEEXT' instead.
+
+ (Programs which do not use automake use neither `AC_EXEEXT' nor
+ `AM_EXEEXT').
+
+`AC_PROG_CC'
+ If you are writing C code, you will normally want to use this
+ macro. It locates the C compiler to use. It does not take any
+ arguments.
+
+ However, if this `configure.in' file is for a library which is to
+ be compiled by a cross compiler which may not fully work, then you
+ will not want to use `AC_PROG_CC'. Instead, you will want to use a
+ variant which does not call the macro `AC_PROG_CC_WORKS'. Examples
+ can be found in various `configure.in' files for libraries that are
+ compiled with cross compilers, such as libiberty or libgloss.
+ This is essentially a bug in autoconf, and there will probably be
+ a better workaround at some point.
+
+`AC_PROG_CXX'
+ If you are writing C++ code, you will want to use this macro. It
+ locates the C++ compiler to use. It does not take any arguments.
+ The same cross compiler comments apply as for `AC_PROG_CC'.
+
+`AM_PROG_LIBTOOL'
+ If you want to build libraries, and you want to permit them to be
+ shared, or you want to link against libraries which were built
+ using libtool, then you will need this macro. This macro is
+ required in order to use libtool.
+
+ By default, this will cause all libraries to be built as shared
+ libraries. To prevent this-to change the default-use
+ `AM_DISABLE_SHARED' before `AM_PROG_LIBTOOL'. The configure
+ options `--enable-shared' and `--disable-shared' may be used to
+ override the default at build time.
+
+`AC_DEFINE(_GNU_SOURCE)'
+ GNU packages should normally include this line before any other
+ feature tests. This defines the macro `_GNU_SOURCE' when
+ compiling, which directs the libc header files to provide the
+ standard GNU system interfaces including all GNU extensions. If
+ this macro is not defined, certain GNU extensions may not be
+ available.
+
+`AC_OUTPUT'
+ This macro takes a list of file names which the configure process
+ should produce. This is normally a list of one or more `Makefile'
+ files in different directories. If your package lives entirely in
+ a single directory, you would use simply `AC_OUTPUT(Makefile)'.
+ If you also have, for example, a `lib' subdirectory, you would use
+ `AC_OUTPUT(Makefile lib/Makefile)'.
+
+ If you want to use locally defined macros in your `configure.in'
+file, then you will need to write a `acinclude.m4' file which defines
+them (if not using automake, this file is called `aclocal.m4').
+Alternatively, you can put separate macros in an `m4' subdirectory, and
+put `ACLOCAL_AMFLAGS = -I m4' in your `Makefile.am' file so that the
+`aclocal' program will be able to find them.
+
+ The different macro prefixes indicate which tool defines the macro.
+Macros which start with `AC_' are part of autoconf. Macros which start
+with `AM_' are provided by automake or libtool.
+
+
+File: configure.info, Node: Write Makefile.am, Next: Write acconfig.h, Prev: Write configure.in, Up: Getting Started
+
+2.2 Write Makefile.am
+=====================
+
+You must write the file `Makefile.am'. This is an automake input file,
+and the automake manual describes in detail what this file should look
+like.
+
+ The automake commands in `Makefile.am' mostly look like variable
+assignments in a `Makefile'. automake recognizes special variable
+names, and automatically add make rules to the output as needed.
+
+ There will be one `Makefile.am' file for each directory in your
+package. For each directory with subdirectories, the `Makefile.am'
+file should contain the line
+ SUBDIRS = DIR DIR ...
+ where each DIR is the name of a subdirectory.
+
+ For each `Makefile.am', there should be a corresponding `Makefile'
+in the `AC_OUTPUT' macro in `configure.in'.
+
+ Every `Makefile.am' written at Cygnus should contain the line
+ AUTOMAKE_OPTIONS = cygnus
+ This puts automake into Cygnus mode. See the automake manual for
+details.
+
+ You may to include the version number of `automake' that you are
+using on the `AUTOMAKE_OPTIONS' line. For example,
+ AUTOMAKE_OPTIONS = cygnus 1.3
+ This will prevent users from running an earlier version of
+`automake' and perhaps getting an invalid `Makefile.in'.
+
+ If your package builds a program, then in the directory where that
+program is built you will normally want a line like
+ bin_PROGRAMS = PROGRAM
+ where PROGRAM is the name of the program. You will then want a line
+like
+ PROGRAM_SOURCES = FILE FILE ...
+ where each FILE is the name of a source file to link into the
+program (e.g., `foo.c').
+
+ If your package builds a library, and you do not want the library to
+ever be built as a shared library, then in the directory where that
+library is built you will normally want a line like
+ lib_LIBRARIES = libNAME.a
+ where `libNAME.a' is the name of the library. You will then want a
+line like
+ libNAME_a_SOURCES = FILE FILE ...
+ where each FILE is the name of a source file to add to the library.
+
+ If your package builds a library, and you want to permit building the
+library as a shared library, then in the directory where that library is
+built you will normally want a line like
+ lib_LTLIBRARIES = libNAME.la
+ The use of `LTLIBRARIES', and the `.la' extension, indicate a
+library to be built using libtool. As usual, you will then want a line
+like
+ libNAME_la_SOURCES = FILE FILE ...
+
+ The strings `bin' and `lib' that appear above in `bin_PROGRAMS' and
+`lib_LIBRARIES' are not arbitrary. They refer to particular
+directories, which may be set by the `--bindir' and `--libdir' options
+to `configure'. If those options are not used, the default values are
+based on the `--prefix' or `--exec-prefix' options to `configure'. It
+is possible to use other names if the program or library should be
+installed in some other directory.
+
+ The `Makefile.am' file may also contain almost anything that may
+appear in a normal `Makefile'. automake also supports many other
+special variables, as well as conditionals.
+
+ See the automake manual for more information.
+
+
+File: configure.info, Node: Write acconfig.h, Next: Generate files, Prev: Write Makefile.am, Up: Getting Started
+
+2.3 Write acconfig.h
+====================
+
+If you are generating a portability header file, (i.e., you are using
+`AM_CONFIG_HEADER' in `configure.in'), then you will have to write a
+`acconfig.h' file. It will have to contain the following lines.
+
+ /* Name of package. */
+ #undef PACKAGE
+
+ /* Version of package. */
+ #undef VERSION
+
+ This requirement is really a bug in the system, and the requirement
+may be eliminated at some later date.
+
+ The `acconfig.h' file will also similar comment and `#undef' lines
+for any unusual macros in the `configure.in' file, including any macro
+which appears in a `AC_DEFINE' macro.
+
+ In particular, if you are writing a GNU package and therefore include
+`AC_DEFINE(_GNU_SOURCE)' in `configure.in' as suggested above, you will
+need lines like this in `acconfig.h':
+ /* Enable GNU extensions. */
+ #undef _GNU_SOURCE
+
+ Normally the `autoheader' program will inform you of any such
+requirements by printing an error message when it is run. However, if
+you do anything particular odd in your `configure.in' file, you will
+have to make sure that the right entries appear in `acconfig.h', since
+otherwise the results of the tests may not be available in the
+`config.h' file which your code will use.
+
+ (Thee `PACKAGE' and `VERSION' lines are not required if you are not
+using automake, and in that case you may not need a `acconfig.h' file
+at all).
+
+
+File: configure.info, Node: Generate files, Next: Getting Started Example, Prev: Write acconfig.h, Up: Getting Started
+
+2.4 Generate files
+==================
+
+Once you have written `configure.in', `Makefile.am', `acconfig.h', and
+possibly `acinclude.m4', you must use autoconf and automake programs to
+produce the first versions of the generated files. This is done by
+executing the following sequence of commands.
+
+ aclocal
+ autoconf
+ autoheader
+ automake
+
+ The `aclocal' and `automake' commands are part of the automake
+package, and the `autoconf' and `autoheader' commands are part of the
+autoconf package.
+
+ If you are using a `m4' subdirectory for your macros, you will need
+to use the `-I m4' option when you run `aclocal'.
+
+ If you are not using the Cygnus tree, use the `-a' option when
+running `automake' command in order to copy the required support files
+into your source directory.
+
+ If you are using libtool, you must build and install the libtool
+package with the same `--prefix' and `--exec-prefix' options as you
+used with the autoconf and automake packages. You must do this before
+running any of the above commands. If you are not using the Cygnus
+tree, you will need to run the `libtoolize' program to copy the libtool
+support files into your directory.
+
+ Once you have managed to run these commands without getting any
+errors, you should create a new empty directory, and run the `configure'
+script which will have been created by `autoconf' with the
+`--enable-maintainer-mode' option. This will give you a set of
+Makefiles which will include rules to automatically rebuild all the
+generated files.
+
+ After doing that, whenever you have changed some of the input files
+and want to regenerated the other files, go to your object directory
+and run `make'. Doing this is more reliable than trying to rebuild the
+files manually, because there are complex order dependencies and it is
+easy to forget something.
+
+
+File: configure.info, Node: Getting Started Example, Prev: Generate files, Up: Getting Started
+
+2.5 Example
+===========
+
+Let's consider a trivial example.
+
+ Suppose we want to write a simple version of `touch'. Our program,
+which we will call `poke', will take a single file name argument, and
+use the `utime' system call to set the modification and access times of
+the file to the current time. We want this program to be highly
+portable.
+
+ We'll first see what this looks like without using autoconf and
+automake, and then see what it looks like with them.
+
+* Menu:
+
+* Getting Started Example 1:: First Try.
+* Getting Started Example 2:: Second Try.
+* Getting Started Example 3:: Third Try.
+* Generate Files in Example:: Generate Files.
+
+
+File: configure.info, Node: Getting Started Example 1, Next: Getting Started Example 2, Up: Getting Started Example
+
+2.5.1 First Try
+---------------
+
+Here is our first try at `poke.c'. Note that we've written it without
+ANSI/ISO C prototypes, since we want it to be highly portable.
+
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <sys/types.h>
+ #include <utime.h>
+
+ int
+ main (argc, argv)
+ int argc;
+ char **argv;
+ {
+ if (argc != 2)
+ {
+ fprintf (stderr, "Usage: poke file\n");
+ exit (1);
+ }
+
+ if (utime (argv[1], NULL) < 0)
+ {
+ perror ("utime");
+ exit (1);
+ }
+
+ exit (0);
+ }
+
+ We also write a simple `Makefile'.
+
+ CC = gcc
+ CFLAGS = -g -O2
+
+ all: poke
+
+ poke: poke.o
+ $(CC) -o poke $(CFLAGS) $(LDFLAGS) poke.o
+
+ So far, so good.
+
+ Unfortunately, there are a few problems.
+
+ On older Unix systems derived from BSD 4.3, the `utime' system call
+does not accept a second argument of `NULL'. On those systems, we need
+to pass a pointer to `struct utimbuf' structure. Unfortunately, even
+older systems don't define that structure; on those systems, we need to
+pass an array of two `long' values.
+
+ The header file `stdlib.h' was invented by ANSI C, and older systems
+don't have a copy. We included it above to get a declaration of `exit'.
+
+ We can find some of these portability problems by running
+`autoscan', which will create a `configure.scan' file which we can use
+as a prototype for our `configure.in' file. I won't show the output,
+but it will notice the potential problems with `utime' and `stdlib.h'.
+
+ In our `Makefile', we don't provide any way to install the program.
+This doesn't matter much for such a simple example, but a real program
+will need an `install' target. For that matter, we will also want a
+`clean' target.
+
+
+File: configure.info, Node: Getting Started Example 2, Next: Getting Started Example 3, Prev: Getting Started Example 1, Up: Getting Started Example
+
+2.5.2 Second Try
+----------------
+
+Here is our second try at this program.
+
+ We modify `poke.c' to use preprocessor macros to control what
+features are available. (I've cheated a bit by using the same macro
+names which autoconf will use).
+
+ #include <stdio.h>
+
+ #ifdef STDC_HEADERS
+ #include <stdlib.h>
+ #endif
+
+ #include <sys/types.h>
+
+ #ifdef HAVE_UTIME_H
+ #include <utime.h>
+ #endif
+
+ #ifndef HAVE_UTIME_NULL
+
+ #include <time.h>
+
+ #ifndef HAVE_STRUCT_UTIMBUF
+
+ struct utimbuf
+ {
+ long actime;
+ long modtime;
+ };
+
+ #endif
+
+ static int
+ utime_now (file)
+ char *file;
+ {
+ struct utimbuf now;
+
+ now.actime = now.modtime = time (NULL);
+ return utime (file, &now);
+ }
+
+ #define utime(f, p) utime_now (f)
+
+ #endif /* HAVE_UTIME_NULL */
+
+ int
+ main (argc, argv)
+ int argc;
+ char **argv;
+ {
+ if (argc != 2)
+ {
+ fprintf (stderr, "Usage: poke file\n");
+ exit (1);
+ }
+
+ if (utime (argv[1], NULL) < 0)
+ {
+ perror ("utime");
+ exit (1);
+ }
+
+ exit (0);
+ }
+
+ Here is the associated `Makefile'. We've added support for the
+preprocessor flags we use. We've also added `install' and `clean'
+targets.
+
+ # Set this to your installation directory.
+ bindir = /usr/local/bin
+
+ # Uncomment this if you have the standard ANSI/ISO C header files.
+ # STDC_HDRS = -DSTDC_HEADERS
+
+ # Uncomment this if you have utime.h.
+ # UTIME_H = -DHAVE_UTIME_H
+
+ # Uncomment this if utime (FILE, NULL) works on your system.
+ # UTIME_NULL = -DHAVE_UTIME_NULL
+
+ # Uncomment this if struct utimbuf is defined in utime.h.
+ # UTIMBUF = -DHAVE_STRUCT_UTIMBUF
+
+ CC = gcc
+ CFLAGS = -g -O2
+
+ ALL_CFLAGS = $(STDC_HDRS) $(UTIME_H) $(UTIME_NULL) $(UTIMBUF) $(CFLAGS)
+
+ all: poke
+
+ poke: poke.o
+ $(CC) -o poke $(ALL_CFLAGS) $(LDFLAGS) poke.o
+
+ .c.o:
+ $(CC) -c $(ALL_CFLAGS) poke.c
+
+ install: poke
+ cp poke $(bindir)/poke
+
+ clean:
+ rm poke poke.o
+
+ Some problems with this approach should be clear.
+
+ Users who want to compile poke will have to know how `utime' works
+on their systems, so that they can uncomment the `Makefile' correctly.
+
+ The installation is done using `cp', but many systems have an
+`install' program which may be used, and which supports optional
+features such as stripping debugging information out of the installed
+binary.
+
+ The use of `Makefile' variables like `CC', `CFLAGS' and `LDFLAGS'
+follows the requirements of the GNU standards. This is convenient for
+all packages, since it reduces surprises for users. However, it is
+easy to get the details wrong, and wind up with a slightly nonstandard
+distribution.
+
+
+File: configure.info, Node: Getting Started Example 3, Next: Generate Files in Example, Prev: Getting Started Example 2, Up: Getting Started Example
+
+2.5.3 Third Try
+---------------
+
+For our third try at this program, we will write a `configure.in'
+script to discover the configuration features on the host system, rather
+than requiring the user to edit the `Makefile'. We will also write a
+`Makefile.am' rather than a `Makefile'.
+
+ The only change to `poke.c' is to add a line at the start of the
+file:
+ #include "config.h"
+
+ The new `configure.in' file is as follows.
+
+ AC_INIT(poke.c)
+ AM_INIT_AUTOMAKE(poke, 1.0)
+ AM_CONFIG_HEADER(config.h:config.in)
+ AC_PROG_CC
+ AC_HEADER_STDC
+ AC_CHECK_HEADERS(utime.h)
+ AC_EGREP_HEADER(utimbuf, utime.h, AC_DEFINE(HAVE_STRUCT_UTIMBUF))
+ AC_FUNC_UTIME_NULL
+ AC_OUTPUT(Makefile)
+
+ The first four macros in this file, and the last one, were described
+above; see *Note Write configure.in::. If we omit these macros, then
+when we run `automake' we will get a reminder that we need them.
+
+ The other macros are standard autoconf macros.
+
+`AC_HEADER_STDC'
+ Check for standard C headers.
+
+`AC_CHECK_HEADERS'
+ Check whether a particular header file exists.
+
+`AC_EGREP_HEADER'
+ Check for a particular string in a particular header file, in this
+ case checking for `utimbuf' in `utime.h'.
+
+`AC_FUNC_UTIME_NULL'
+ Check whether `utime' accepts a NULL second argument to set the
+ file change time to the current time.
+
+ See the autoconf manual for a more complete description.
+
+ The new `Makefile.am' file is as follows. Note how simple this is
+compared to our earlier `Makefile'.
+
+ bin_PROGRAMS = poke
+
+ poke_SOURCES = poke.c
+
+ This means that we should build a single program name `poke'. It
+should be installed in the binary directory, which we called `bindir'
+earlier. The program `poke' is built from the source file `poke.c'.
+
+ We must also write a `acconfig.h' file. Besides `PACKAGE' and
+`VERSION', which must be mentioned for all packages which use automake,
+we must include `HAVE_STRUCT_UTIMBUF', since we mentioned it in an
+`AC_DEFINE'.
+
+ /* Name of package. */
+ #undef PACKAGE
+
+ /* Version of package. */
+ #undef VERSION
+
+ /* Whether utime.h defines struct utimbuf. */
+ #undef HAVE_STRUCT_UTIMBUF
+
+
+File: configure.info, Node: Generate Files in Example, Prev: Getting Started Example 3, Up: Getting Started Example
+
+2.5.4 Generate Files
+--------------------
+
+We must now generate the other files, using the following commands.
+
+ aclocal
+ autoconf
+ autoheader
+ automake
+
+ When we run `autoheader', it will remind us of any macros we forgot
+to add to `acconfig.h'.
+
+ When we run `automake', it will want to add some files to our
+distribution. It will add them automatically if we use the
+`--add-missing' option.
+
+ By default, `automake' will run in GNU mode, which means that it
+will want us to create certain additional files; as of this writing, it
+will want `NEWS', `README', `AUTHORS', and `ChangeLog', all of which
+are files which should appear in a standard GNU distribution. We can
+either add those files, or run `automake' with the `--foreign' option.
+
+ Running these tools will generate the following files, all of which
+are described in the next chapter.
+
+ * `aclocal.m4'
+
+ * `configure'
+
+ * `config.in'
+
+ * `Makefile.in'
+
+ * `stamp-h.in'
+
+
+File: configure.info, Node: Files, Next: Configuration Names, Prev: Getting Started, Up: Top
+
+3 Files
+*******
+
+As was seen in the previous chapter, the GNU configure and build system
+uses a number of different files. The developer must write a few files.
+The others are generated by various tools.
+
+ The system is rather flexible, and can be used in many different
+ways. In describing the files that it uses, I will describe the common
+case, and mention some other cases that may arise.
+
+* Menu:
+
+* Developer Files:: Developer Files.
+* Build Files:: Build Files.
+* Support Files:: Support Files.
+
+
+File: configure.info, Node: Developer Files, Next: Build Files, Up: Files
+
+3.1 Developer Files
+===================
+
+This section describes the files written or generated by the developer
+of a package.
+
+* Menu:
+
+* Developer Files Picture:: Developer Files Picture.
+* Written Developer Files:: Written Developer Files.
+* Generated Developer Files:: Generated Developer Files.
+
+
+File: configure.info, Node: Developer Files Picture, Next: Written Developer Files, Up: Developer Files
+
+3.1.1 Developer Files Picture
+-----------------------------
+
+Here is a picture of the files which are written by the developer, the
+generated files which would be included with a complete source
+distribution, and the tools which create those files. The file names
+are plain text and the tool names are enclosed by `*' characters (e.g.,
+`autoheader' is the name of a tool, not the name of a file).
+
+ acconfig.h configure.in Makefile.am
+ | | |
+ | --------------+---------------------- |
+ | | | | |
+ v v | acinclude.m4 | |
+ *autoheader* | | v v
+ | | v --->*automake*
+ v |--->*aclocal* | |
+ config.in | | | v
+ | v | Makefile.in
+ | aclocal.m4---
+ | |
+ v v
+ *autoconf*
+ |
+ v
+ configure
+
+
+File: configure.info, Node: Written Developer Files, Next: Generated Developer Files, Prev: Developer Files Picture, Up: Developer Files
+
+3.1.2 Written Developer Files
+-----------------------------
+
+The following files would be written by the developer.
+
+`configure.in'
+ This is the configuration script. This script contains
+ invocations of autoconf macros. It may also contain ordinary
+ shell script code. This file will contain feature tests for
+ portability issues. The last thing in the file will normally be
+ an `AC_OUTPUT' macro listing which files to create when the
+ builder runs the configure script. This file is always required
+ when using the GNU configure system. *Note Write configure.in::.
+
+`Makefile.am'
+ This is the automake input file. It describes how the code should
+ be built. It consists of definitions of automake variables. It
+ may also contain ordinary Makefile targets. This file is only
+ needed when using automake (newer tools normally use automake, but
+ there are still older tools which have not been converted, in
+ which the developer writes `Makefile.in' directly). *Note Write
+ Makefile.am::.
+
+`acconfig.h'
+ When the configure script creates a portability header file, by
+ using `AM_CONFIG_HEADER' (or, if not using automake,
+ `AC_CONFIG_HEADER'), this file is used to describe macros which are
+ not recognized by the `autoheader' command. This is normally a
+ fairly uninteresting file, consisting of a collection of `#undef'
+ lines with comments. Normally any call to `AC_DEFINE' in
+ `configure.in' will require a line in this file. *Note Write
+ acconfig.h::.
+
+`acinclude.m4'
+ This file is not always required. It defines local autoconf
+ macros. These macros may then be used in `configure.in'. If you
+ don't need any local autoconf macros, then you don't need this
+ file at all. In fact, in general, you never need local autoconf
+ macros, since you can put everything in `configure.in', but
+ sometimes a local macro is convenient.
+
+ Newer tools may omit `acinclude.m4', and instead use a
+ subdirectory, typically named `m4', and define `ACLOCAL_AMFLAGS =
+ -I m4' in `Makefile.am' to force `aclocal' to look there for macro
+ definitions. The macro definitions are then placed in separate
+ files in that directory.
+
+ The `acinclude.m4' file is only used when using automake; in older
+ tools, the developer writes `aclocal.m4' directly, if it is needed.
+
+
+File: configure.info, Node: Generated Developer Files, Prev: Written Developer Files, Up: Developer Files
+
+3.1.3 Generated Developer Files
+-------------------------------
+
+The following files would be generated by the developer.
+
+ When using automake, these files are normally not generated manually
+after the first time. Instead, the generated `Makefile' contains rules
+to automatically rebuild the files as required. When
+`AM_MAINTAINER_MODE' is used in `configure.in' (the normal case in
+Cygnus code), the automatic rebuilding rules will only be defined if
+you configure using the `--enable-maintainer-mode' option.
+
+ When using automatic rebuilding, it is important to ensure that all
+the various tools have been built and installed on your `PATH'. Using
+automatic rebuilding is highly recommended, so much so that I'm not
+going to explain what you have to do if you don't use it.
+
+`configure'
+ This is the configure script which will be run when building the
+ package. This is generated by `autoconf' from `configure.in' and
+ `aclocal.m4'. This is a shell script.
+
+`Makefile.in'
+ This is the file which the configure script will turn into the
+ `Makefile' at build time. This file is generated by `automake'
+ from `Makefile.am'. If you aren't using automake, you must write
+ this file yourself. This file is pretty much a normal `Makefile',
+ with some configure substitutions for certain variables.
+
+`aclocal.m4'
+ This file is created by the `aclocal' program, based on the
+ contents of `configure.in' and `acinclude.m4' (or, as noted in the
+ description of `acinclude.m4' above, on the contents of an `m4'
+ subdirectory). This file contains definitions of autoconf macros
+ which `autoconf' will use when generating the file `configure'.
+ These autoconf macros may be defined by you in `acinclude.m4' or
+ they may be defined by other packages such as automake, libtool or
+ gettext. If you aren't using automake, you will normally write
+ this file yourself; in that case, if `configure.in' uses only
+ standard autoconf macros, this file will not be needed at all.
+
+`config.in'
+ This file is created by `autoheader' based on `acconfig.h' and
+ `configure.in'. At build time, the configure script will define
+ some of the macros in it to create `config.h', which may then be
+ included by your program. This permits your C code to use
+ preprocessor conditionals to change its behaviour based on the
+ characteristics of the host system. This file may also be called
+ `config.h.in'.
+
+`stamp.h-in'
+ This rather uninteresting file, which I omitted from the picture,
+ is generated by `automake'. It always contains the string
+ `timestamp'. It is used as a timestamp file indicating whether
+ `config.in' is up to date. Using a timestamp file means that
+ `config.in' can be marked as up to date without actually changing
+ its modification time. This is useful since `config.in' depends
+ upon `configure.in', but it is easy to change `configure.in' in a
+ way which does not affect `config.in'.
+
+
+File: configure.info, Node: Build Files, Next: Support Files, Prev: Developer Files, Up: Files
+
+3.2 Build Files
+===============
+
+This section describes the files which are created at configure and
+build time. These are the files which somebody who builds the package
+will see.
+
+ Of course, the developer will also build the package. The
+distinction between developer files and build files is not that the
+developer does not see the build files, but that somebody who only
+builds the package does not have to worry about the developer files.
+
+* Menu:
+
+* Build Files Picture:: Build Files Picture.
+* Build Files Description:: Build Files Description.
+
+
+File: configure.info, Node: Build Files Picture, Next: Build Files Description, Up: Build Files
+
+3.2.1 Build Files Picture
+-------------------------
+
+Here is a picture of the files which will be created at build time.
+`config.status' is both a created file and a shell script which is run
+to create other files, and the picture attempts to show that.
+
+ config.in *configure* Makefile.in
+ | | |
+ | v |
+ | config.status |
+ | | |
+ *config.status*<======+==========>*config.status*
+ | |
+ v v
+ config.h Makefile
+
+
+File: configure.info, Node: Build Files Description, Prev: Build Files Picture, Up: Build Files
+
+3.2.2 Build Files Description
+-----------------------------
+
+This is a description of the files which are created at build time.
+
+`config.status'
+ The first step in building a package is to run the `configure'
+ script. The `configure' script will create the file
+ `config.status', which is itself a shell script. When you first
+ run `configure', it will automatically run `config.status'. An
+ `Makefile' derived from an automake generated `Makefile.in' will
+ contain rules to automatically run `config.status' again when
+ necessary to recreate certain files if their inputs change.
+
+`Makefile'
+ This is the file which make will read to build the program. The
+ `config.status' script will transform `Makefile.in' into
+ `Makefile'.
+
+`config.h'
+ This file defines C preprocessor macros which C code can use to
+ adjust its behaviour on different systems. The `config.status'
+ script will transform `config.in' into `config.h'.
+
+`config.cache'
+ This file did not fit neatly into the picture, and I omitted it.
+ It is used by the `configure' script to cache results between
+ runs. This can be an important speedup. If you modify
+ `configure.in' in such a way that the results of old tests should
+ change (perhaps you have added a new library to `LDFLAGS'), then
+ you will have to remove `config.cache' to force the tests to be
+ rerun.
+
+ The autoconf manual explains how to set up a site specific cache
+ file. This can speed up running `configure' scripts on your
+ system.
+
+`stamp.h'
+ This file, which I omitted from the picture, is similar to
+ `stamp-h.in'. It is used as a timestamp file indicating whether
+ `config.h' is up to date. This is useful since `config.h' depends
+ upon `config.status', but it is easy for `config.status' to change
+ in a way which does not affect `config.h'.
+
+
+File: configure.info, Node: Support Files, Prev: Build Files, Up: Files
+
+3.3 Support Files
+=================
+
+The GNU configure and build system requires several support files to be
+included with your distribution. You do not normally need to concern
+yourself with these. If you are using the Cygnus tree, most are already
+present. Otherwise, they will be installed with your source by
+`automake' (with the `--add-missing' option) and `libtoolize'.
+
+ You don't have to put the support files in the top level directory.
+You can put them in a subdirectory, and use the `AC_CONFIG_AUX_DIR'
+macro in `configure.in' to tell `automake' and the `configure' script
+where they are.
+
+ In this section, I describe the support files, so that you can know
+what they are and why they are there.
+
+`ABOUT-NLS'
+ Added by automake if you are using gettext. This is a
+ documentation file about the gettext project.
+
+`ansi2knr.c'
+ Used by an automake generated `Makefile' if you put `ansi2knr' in
+ `AUTOMAKE_OPTIONS' in `Makefile.am'. This permits compiling ANSI
+ C code with a K&R C compiler.
+
+`ansi2knr.1'
+ The man page which goes with `ansi2knr.c'.
+
+`config.guess'
+ A shell script which determines the configuration name for the
+ system on which it is run.
+
+`config.sub'
+ A shell script which canonicalizes a configuration name entered by
+ a user.
+
+`elisp-comp'
+ Used to compile Emacs LISP files.
+
+`install-sh'
+ A shell script which installs a program. This is used if the
+ configure script can not find an install binary.
+
+`ltconfig'
+ Used by libtool. This is a shell script which configures libtool
+ for the particular system on which it is used.
+
+`ltmain.sh'
+ Used by libtool. This is the actual libtool script which is used,
+ after it is configured by `ltconfig' to build a library.
+
+`mdate-sh'
+ A shell script used by an automake generated `Makefile' to pretty
+ print the modification time of a file. This is used to maintain
+ version numbers for texinfo files.
+
+`missing'
+ A shell script used if some tool is missing entirely. This is
+ used by an automake generated `Makefile' to avoid certain sorts of
+ timestamp problems.
+
+`mkinstalldirs'
+ A shell script which creates a directory, including all parent
+ directories. This is used by an automake generated `Makefile'
+ during installation.
+
+`texinfo.tex'
+ Required if you have any texinfo files. This is used when
+ converting Texinfo files into DVI using `texi2dvi' and TeX.
+
+`ylwrap'
+ A shell script used by an automake generated `Makefile' to run
+ programs like `bison', `yacc', `flex', and `lex'. These programs
+ default to producing output files with a fixed name, and the
+ `ylwrap' script runs them in a subdirectory to avoid file name
+ conflicts when using a parallel make program.
+
+
+File: configure.info, Node: Configuration Names, Next: Cross Compilation Tools, Prev: Files, Up: Top
+
+4 Configuration Names
+*********************
+
+The GNU configure system names all systems using a "configuration
+name". All such names used to be triplets (they may now contain four
+parts in certain cases), and the term "configuration triplet" is still
+seen.
+
+* Menu:
+
+* Configuration Name Definition:: Configuration Name Definition.
+* Using Configuration Names:: Using Configuration Names.
+
+
+File: configure.info, Node: Configuration Name Definition, Next: Using Configuration Names, Up: Configuration Names
+
+4.1 Configuration Name Definition
+=================================
+
+This is a string of the form CPU-MANUFACTURER-OPERATING_SYSTEM. In
+some cases, this is extended to a four part form:
+CPU-MANUFACTURER-KERNEL-OPERATING_SYSTEM.
+
+ When using a configuration name in a configure option, it is normally
+not necessary to specify an entire name. In particular, the
+MANUFACTURER field is often omitted, leading to strings such as
+`i386-linux' or `sparc-sunos'. The shell script `config.sub' will
+translate these shortened strings into the canonical form. autoconf
+will arrange for `config.sub' to be run automatically when it is needed.
+
+ The fields of a configuration name are as follows:
+
+CPU
+ The type of processor. This is typically something like `i386' or
+ `sparc'. More specific variants are used as well, such as
+ `mipsel' to indicate a little endian MIPS processor.
+
+MANUFACTURER
+ A somewhat freeform field which indicates the manufacturer of the
+ system. This is often simply `unknown'. Other common strings are
+ `pc' for an IBM PC compatible system, or the name of a workstation
+ vendor, such as `sun'.
+
+OPERATING_SYSTEM
+ The name of the operating system which is run on the system. This
+ will be something like `solaris2.5' or `irix6.3'. There is no
+ particular restriction on the version number, and strings like
+ `aix4.1.4.0' are seen. For an embedded system, which has no
+ operating system, this field normally indicates the type of object
+ file format, such as `elf' or `coff'.
+
+KERNEL
+ This is used mainly for GNU/Linux. A typical GNU/Linux
+ configuration name is `i586-pc-linux-gnulibc1'. In this case the
+ kernel, `linux', is separated from the operating system,
+ `gnulibc1'.
+
+ The shell script `config.guess' will normally print the correct
+configuration name for the system on which it is run. It does by
+running `uname' and by examining other characteristics of the system.
+
+ Because `config.guess' can normally determine the configuration name
+for a machine, it is normally only necessary to specify a configuration
+name when building a cross-compiler or when building using a
+cross-compiler.
+
+
+File: configure.info, Node: Using Configuration Names, Prev: Configuration Name Definition, Up: Configuration Names
+
+4.2 Using Configuration Names
+=============================
+
+A configure script will sometimes have to make a decision based on a
+configuration name. You will need to do this if you have to compile
+code differently based on something which can not be tested using a
+standard autoconf feature test.
+
+ It is normally better to test for particular features, rather than to
+test for a particular system. This is because as Unix evolves,
+different systems copy features from one another. Even if you need to
+determine whether the feature is supported based on a configuration
+name, you should define a macro which describes the feature, rather than
+defining a macro which describes the particular system you are on.
+
+ Testing for a particular system is normally done using a case
+statement in `configure.in'. The case statement might look something
+like the following, assuming that `host' is a shell variable holding a
+canonical configuration name (which will be the case if `configure.in'
+uses the `AC_CANONICAL_HOST' or `AC_CANONICAL_SYSTEM' macro).
+
+ case "${host}" in
+ i[3-7]86-*-linux-gnu*) do something ;;
+ sparc*-sun-solaris2.[56789]*) do something ;;
+ sparc*-sun-solaris*) do something ;;
+ mips*-*-elf*) do something ;;
+ esac
+
+ It is particularly important to use `*' after the operating system
+field, in order to match the version number which will be generated by
+`config.guess'.
+
+ In most cases you must be careful to match a range of processor
+types. For most processor families, a trailing `*' suffices, as in
+`mips*' above. For the i386 family, something along the lines of
+`i[3-7]86' suffices at present. For the m68k family, you will need
+something like `m68*'. Of course, if you do not need to match on the
+processor, it is simpler to just replace the entire field by a `*', as
+in `*-*-irix*'.
+
+
+File: configure.info, Node: Cross Compilation Tools, Next: Canadian Cross, Prev: Configuration Names, Up: Top
+
+5 Cross Compilation Tools
+*************************
+
+The GNU configure and build system can be used to build "cross
+compilation" tools. A cross compilation tool is a tool which runs on
+one system and produces code which runs on another system.
+
+* Menu:
+
+* Cross Compilation Concepts:: Cross Compilation Concepts.
+* Host and Target:: Host and Target.
+* Using the Host Type:: Using the Host Type.
+* Specifying the Target:: Specifying the Target.
+* Using the Target Type:: Using the Target Type.
+* Cross Tools in the Cygnus Tree:: Cross Tools in the Cygnus Tree
+
+
+File: configure.info, Node: Cross Compilation Concepts, Next: Host and Target, Up: Cross Compilation Tools
+
+5.1 Cross Compilation Concepts
+==============================
+
+A compiler which produces programs which run on a different system is a
+cross compilation compiler, or simply a "cross compiler". Similarly,
+we speak of cross assemblers, cross linkers, etc.
+
+ In the normal case, a compiler produces code which runs on the same
+system as the one on which the compiler runs. When it is necessary to
+distinguish this case from the cross compilation case, such a compiler
+is called a "native compiler". Similarly, we speak of native
+assemblers, etc.
+
+ Although the debugger is not strictly speaking a compilation tool,
+it is nevertheless meaningful to speak of a cross debugger: a debugger
+which is used to debug code which runs on another system. Everything
+that is said below about configuring cross compilation tools applies to
+the debugger as well.
+
+
+File: configure.info, Node: Host and Target, Next: Using the Host Type, Prev: Cross Compilation Concepts, Up: Cross Compilation Tools
+
+5.2 Host and Target
+===================
+
+When building cross compilation tools, there are two different systems
+involved: the system on which the tools will run, and the system for
+which the tools generate code.
+
+ The system on which the tools will run is called the "host" system.
+
+ The system for which the tools generate code is called the "target"
+system.
+
+ For example, suppose you have a compiler which runs on a GNU/Linux
+system and generates ELF programs for a MIPS embedded system. In this
+case the GNU/Linux system is the host, and the MIPS ELF system is the
+target. Such a compiler could be called a GNU/Linux cross MIPS ELF
+compiler, or, equivalently, a `i386-linux-gnu' cross `mips-elf'
+compiler.
+
+ Naturally, most programs are not cross compilation tools. For those
+programs, it does not make sense to speak of a target. It only makes
+sense to speak of a target for tools like `gcc' or the `binutils' which
+actually produce running code. For example, it does not make sense to
+speak of the target of a tool like `bison' or `make'.
+
+ Most cross compilation tools can also serve as native tools. For a
+native compilation tool, it is still meaningful to speak of a target.
+For a native tool, the target is the same as the host. For example, for
+a GNU/Linux native compiler, the host is GNU/Linux, and the target is
+also GNU/Linux.
+
+
+File: configure.info, Node: Using the Host Type, Next: Specifying the Target, Prev: Host and Target, Up: Cross Compilation Tools
+
+5.3 Using the Host Type
+=======================
+
+In almost all cases the host system is the system on which you run the
+`configure' script, and on which you build the tools (for the case when
+they differ, *note Canadian Cross::).
+
+ If your configure script needs to know the configuration name of the
+host system, and the package is not a cross compilation tool and
+therefore does not have a target, put `AC_CANONICAL_HOST' in
+`configure.in'. This macro will arrange to define a few shell
+variables when the `configure' script is run.
+
+`host'
+ The canonical configuration name of the host. This will normally
+ be determined by running the `config.guess' shell script, although
+ the user is permitted to override this by using an explicit
+ `--host' option.
+
+`host_alias'
+ In the unusual case that the user used an explicit `--host' option,
+ this will be the argument to `--host'. In the normal case, this
+ will be the same as the `host' variable.
+
+`host_cpu'
+`host_vendor'
+`host_os'
+ The first three parts of the canonical configuration name.
+
+ The shell variables may be used by putting shell code in
+`configure.in'. For an example, see *Note Using Configuration Names::.
+
+
+File: configure.info, Node: Specifying the Target, Next: Using the Target Type, Prev: Using the Host Type, Up: Cross Compilation Tools
+
+5.4 Specifying the Target
+=========================
+
+By default, the `configure' script will assume that the target is the
+same as the host. This is the more common case; for example, it leads
+to a native compiler rather than a cross compiler.
+
+ If you want to build a cross compilation tool, you must specify the
+target explicitly by using the `--target' option when you run
+`configure'. The argument to `--target' is the configuration name of
+the system for which you wish to generate code. *Note Configuration
+Names::.
+
+ For example, to build tools which generate code for a MIPS ELF
+embedded system, you would use `--target mips-elf'.
+
+
+File: configure.info, Node: Using the Target Type, Next: Cross Tools in the Cygnus Tree, Prev: Specifying the Target, Up: Cross Compilation Tools
+
+5.5 Using the Target Type
+=========================
+
+When writing `configure.in' for a cross compilation tool, you will need
+to use information about the target. To do this, put
+`AC_CANONICAL_SYSTEM' in `configure.in'.
+
+ `AC_CANONICAL_SYSTEM' will look for a `--target' option and
+canonicalize it using the `config.sub' shell script. It will also run
+`AC_CANONICAL_HOST' (*note Using the Host Type::).
+
+ The target type will be recorded in the following shell variables.
+Note that the host versions of these variables will also be defined by
+`AC_CANONICAL_HOST'.
+
+`target'
+ The canonical configuration name of the target.
+
+`target_alias'
+ The argument to the `--target' option. If the user did not specify
+ a `--target' option, this will be the same as `host_alias'.
+
+`target_cpu'
+`target_vendor'
+`target_os'
+ The first three parts of the canonical target configuration name.
+
+ Note that if `host' and `target' are the same string, you can assume
+a native configuration. If they are different, you can assume a cross
+configuration.
+
+ It is arguably possible for `host' and `target' to represent the
+same system, but for the strings to not be identical. For example, if
+`config.guess' returns `sparc-sun-sunos4.1.4', and somebody configures
+with `--target sparc-sun-sunos4.1', then the slight differences between
+the two versions of SunOS may be unimportant for your tool. However,
+in the general case it can be quite difficult to determine whether the
+differences between two configuration names are significant or not.
+Therefore, by convention, if the user specifies a `--target' option
+without specifying a `--host' option, it is assumed that the user wants
+to configure a cross compilation tool.
+
+ The variables `target' and `target_alias' should be handled
+differently.
+
+ In general, whenever the user may actually see a string,
+`target_alias' should be used. This includes anything which may appear
+in the file system, such as a directory name or part of a tool name.
+It also includes any tool output, unless it is clearly labelled as the
+canonical target configuration name. This permits the user to use the
+`--target' option to specify how the tool will appear to the outside
+world.
+
+ On the other hand, when checking for characteristics of the target
+system, `target' should be used. This is because a wide variety of
+`--target' options may map into the same canonical configuration name.
+You should not attempt to duplicate the canonicalization done by
+`config.sub' in your own code.
+
+ By convention, cross tools are installed with a prefix of the
+argument used with the `--target' option, also known as `target_alias'
+(*note Using the Target Type::). If the user does not use the
+`--target' option, and thus is building a native tool, no prefix is
+used.
+
+ For example, if gcc is configured with `--target mips-elf', then the
+installed binary will be named `mips-elf-gcc'. If gcc is configured
+without a `--target' option, then the installed binary will be named
+`gcc'.
+
+ The autoconf macro `AC_ARG_PROGRAM' will handle this for you. If
+you are using automake, no more need be done; the programs will
+automatically be installed with the correct prefixes. Otherwise, see
+the autoconf documentation for `AC_ARG_PROGRAM'.
+
+
+File: configure.info, Node: Cross Tools in the Cygnus Tree, Prev: Using the Target Type, Up: Cross Compilation Tools
+
+5.6 Cross Tools in the Cygnus Tree
+==================================
+
+The Cygnus tree is used for various packages including gdb, the GNU
+binutils, and egcs. It is also, of course, used for Cygnus releases.
+
+ In the Cygnus tree, the top level `configure' script uses the old
+Cygnus configure system, not autoconf. The top level `Makefile.in' is
+written to build packages based on what is in the source tree, and
+supports building a large number of tools in a single
+`configure'/`make' step.
+
+ The Cygnus tree may be configured with a `--target' option. The
+`--target' option applies recursively to every subdirectory, and
+permits building an entire set of cross tools at once.
+
+* Menu:
+
+* Host and Target Libraries:: Host and Target Libraries.
+* Target Library Configure Scripts:: Target Library Configure Scripts.
+* Make Targets in Cygnus Tree:: Make Targets in Cygnus Tree.
+* Target libiberty:: Target libiberty
+
+
+File: configure.info, Node: Host and Target Libraries, Next: Target Library Configure Scripts, Up: Cross Tools in the Cygnus Tree
+
+5.6.1 Host and Target Libraries
+-------------------------------
+
+The Cygnus tree distinguishes host libraries from target libraries.
+
+ Host libraries are built with the compiler used to build the programs
+which run on the host, which is called the host compiler. This includes
+libraries such as `bfd' and `tcl'. These libraries are built with the
+host compiler, and are linked into programs like the binutils or gcc
+which run on the host.
+
+ Target libraries are built with the target compiler. If gcc is
+present in the source tree, then the target compiler is the gcc that is
+built using the host compiler. Target libraries are libraries such as
+`newlib' and `libstdc++'. These libraries are not linked into the host
+programs, but are instead made available for use with programs built
+with the target compiler.
+
+ For the rest of this section, assume that gcc is present in the
+source tree, so that it will be used to build the target libraries.
+
+ There is a complication here. The configure process needs to know
+which compiler you are going to use to build a tool; otherwise, the
+feature tests will not work correctly. The Cygnus tree handles this by
+not configuring the target libraries until the target compiler is
+built. In order to permit everything to build using a single
+`configure'/`make', the configuration of the target libraries is
+actually triggered during the make step.
+
+ When the target libraries are configured, the `--target' option is
+not used. Instead, the `--host' option is used with the argument of
+the `--target' option for the overall configuration. If no `--target'
+option was used for the overall configuration, the `--host' option will
+be passed with the output of the `config.guess' shell script. Any
+`--build' option is passed down unchanged.
+
+ This translation of configuration options is done because since the
+target libraries are compiled with the target compiler, they are being
+built in order to run on the target of the overall configuration. By
+the definition of host, this means that their host system is the same as
+the target system of the overall configuration.
+
+ The same process is used for both a native configuration and a cross
+configuration. Even when using a native configuration, the target
+libraries will be configured and built using the newly built compiler.
+This is particularly important for the C++ libraries, since there is no
+reason to assume that the C++ compiler used to build the host tools (if
+there even is one) uses the same ABI as the g++ compiler which will be
+used to build the target libraries.
+
+ There is one difference between a native configuration and a cross
+configuration. In a native configuration, the target libraries are
+normally configured and built as siblings of the host tools. In a cross
+configuration, the target libraries are normally built in a subdirectory
+whose name is the argument to `--target'. This is mainly for
+historical reasons.
+
+ To summarize, running `configure' in the Cygnus tree configures all
+the host libraries and tools, but does not configure any of the target
+libraries. Running `make' then does the following steps:
+
+ * Build the host libraries.
+
+ * Build the host programs, including gcc. Note that we call gcc
+ both a host program (since it runs on the host) and a target
+ compiler (since it generates code for the target).
+
+ * Using the newly built target compiler, configure the target
+ libraries.
+
+ * Build the target libraries.
+
+ The steps need not be done in precisely this order, since they are
+actually controlled by `Makefile' targets.
+
+
+File: configure.info, Node: Target Library Configure Scripts, Next: Make Targets in Cygnus Tree, Prev: Host and Target Libraries, Up: Cross Tools in the Cygnus Tree
+
+5.6.2 Target Library Configure Scripts
+--------------------------------------
+
+There are a few things you must know in order to write a configure
+script for a target library. This is just a quick sketch, and beginners
+shouldn't worry if they don't follow everything here.
+
+ The target libraries are configured and built using a newly built
+target compiler. There may not be any startup files or libraries for
+this target compiler. In fact, those files will probably be built as
+part of some target library, which naturally means that they will not
+exist when your target library is configured.
+
+ This means that the configure script for a target library may not use
+any test which requires doing a link. This unfortunately includes many
+useful autoconf macros, such as `AC_CHECK_FUNCS'. autoconf macros
+which do a compile but not a link, such as `AC_CHECK_HEADERS', may be
+used.
+
+ This is a severe restriction, but normally not a fatal one, as target
+libraries can often assume the presence of other target libraries, and
+thus know which functions will be available.
+
+ As of this writing, the autoconf macro `AC_PROG_CC' does a link to
+make sure that the compiler works. This may fail in a target library,
+so target libraries must use a different set of macros to locate the
+compiler. See the `configure.in' file in a directory like `libiberty'
+or `libgloss' for an example.
+
+ As noted in the previous section, target libraries are sometimes
+built in directories which are siblings to the host tools, and are
+sometimes built in a subdirectory. The `--with-target-subdir' configure
+option will be passed when the library is configured. Its value will be
+an empty string if the target library is a sibling. Its value will be
+the name of the subdirectory if the target library is in a subdirectory.
+
+ If the overall build is not a native build (i.e., the overall
+configure used the `--target' option), then the library will be
+configured with the `--with-cross-host' option. The value of this
+option will be the host system of the overall build. Recall that the
+host system of the library will be the target of the overall build. If
+the overall build is a native build, the `--with-cross-host' option
+will not be used.
+
+ A library which can be built both standalone and as a target library
+may want to install itself into different directories depending upon the
+case. When built standalone, or when built native, the library should
+be installed in `$(libdir)'. When built as a target library which is
+not native, the library should be installed in `$(tooldir)/lib'. The
+`--with-cross-host' option may be used to distinguish these cases.
+
+ This same test of `--with-cross-host' may be used to see whether it
+is OK to use link tests in the configure script. If the
+`--with-cross-host' option is not used, then the library is being built
+either standalone or native, and a link should work.
+
+
+File: configure.info, Node: Make Targets in Cygnus Tree, Next: Target libiberty, Prev: Target Library Configure Scripts, Up: Cross Tools in the Cygnus Tree
+
+5.6.3 Make Targets in Cygnus Tree
+---------------------------------
+
+The top level `Makefile' in the Cygnus tree defines targets for every
+known subdirectory.
+
+ For every subdirectory DIR which holds a host library or program,
+the `Makefile' target `all-DIR' will build that library or program.
+
+ There are dependencies among host tools. For example, building gcc
+requires first building gas, because the gcc build process invokes the
+target assembler. These dependencies are reflected in the top level
+`Makefile'.
+
+ For every subdirectory DIR which holds a target library, the
+`Makefile' target `configure-target-DIR' will configure that library.
+The `Makefile' target `all-target-DIR' will build that library.
+
+ Every `configure-target-DIR' target depends upon `all-gcc', since
+gcc, the target compiler, is required to configure the tool. Every
+`all-target-DIR' target depends upon the corresponding
+`configure-target-DIR' target.
+
+ There are several other targets which may be of interest for each
+directory: `install-DIR', `clean-DIR', and `check-DIR'. There are also
+corresponding `target' versions of these for the target libraries ,
+such as `install-target-DIR'.
+
+
+File: configure.info, Node: Target libiberty, Prev: Make Targets in Cygnus Tree, Up: Cross Tools in the Cygnus Tree
+
+5.6.4 Target libiberty
+----------------------
+
+The `libiberty' subdirectory is currently a special case, in that it is
+the only directory which is built both using the host compiler and
+using the target compiler.
+
+ This is because the files in `libiberty' are used when building the
+host tools, and they are also incorporated into the `libstdc++' target
+library as support code.
+
+ This duality does not pose any particular difficulties. It means
+that there are targets for both `all-libiberty' and
+`all-target-libiberty'.
+
+ In a native configuration, when target libraries are not built in a
+subdirectory, the same objects are normally used as both the host build
+and the target build. This is normally OK, since libiberty contains
+only C code, and in a native configuration the results of the host
+compiler and the target compiler are normally interoperable.
+
+ Irix 6 is again an exception here, since the SGI native compiler
+defaults to using the `O32' ABI, and gcc defaults to using the `N32'
+ABI. On Irix 6, the target libraries are built in a subdirectory even
+for a native configuration, avoiding this problem.
+
+ There are currently no other libraries built for both the host and
+the target, but there is no conceptual problem with adding more.
+
+
+File: configure.info, Node: Canadian Cross, Next: Cygnus Configure, Prev: Cross Compilation Tools, Up: Top
+
+6 Canadian Cross
+****************
+
+It is possible to use the GNU configure and build system to build a
+program which will run on a system which is different from the system on
+which the tools are built. In other words, it is possible to build
+programs using a cross compiler.
+
+ This is referred to as a "Canadian Cross".
+
+* Menu:
+
+* Canadian Cross Example:: Canadian Cross Example.
+* Canadian Cross Concepts:: Canadian Cross Concepts.
+* Build Cross Host Tools:: Build Cross Host Tools.
+* Build and Host Options:: Build and Host Options.
+* CCross not in Cygnus Tree:: Canadian Cross not in Cygnus Tree.
+* CCross in Cygnus Tree:: Canadian Cross in Cygnus Tree.
+* Supporting Canadian Cross:: Supporting Canadian Cross.
+
+
+File: configure.info, Node: Canadian Cross Example, Next: Canadian Cross Concepts, Up: Canadian Cross
+
+6.1 Canadian Cross Example
+==========================
+
+Here is an example of a Canadian Cross.
+
+ While running on a GNU/Linux, you can build a program which will run
+on a Solaris system. You would use a GNU/Linux cross Solaris compiler
+to build the program.
+
+ Of course, you could not run the resulting program on your GNU/Linux
+system. You would have to copy it over to a Solaris system before you
+would run it.
+
+ Of course, you could also simply build the programs on the Solaris
+system in the first place. However, perhaps the Solaris system is not
+available for some reason; perhaps you actually don't have one, but you
+want to build the tools for somebody else to use. Or perhaps your
+GNU/Linux system is much faster than your Solaris system.
+
+ A Canadian Cross build is most frequently used when building
+programs to run on a non-Unix system, such as DOS or Windows. It may
+be simpler to configure and build on a Unix system than to support the
+configuration machinery on a non-Unix system.
+
+
+File: configure.info, Node: Canadian Cross Concepts, Next: Build Cross Host Tools, Prev: Canadian Cross Example, Up: Canadian Cross
+
+6.2 Canadian Cross Concepts
+===========================
+
+When building a Canadian Cross, there are at least two different systems
+involved: the system on which the tools are being built, and the system
+on which the tools will run.
+
+ The system on which the tools are being built is called the "build"
+system.
+
+ The system on which the tools will run is called the host system.
+
+ For example, if you are building a Solaris program on a GNU/Linux
+system, as in the previous section, the build system would be GNU/Linux,
+and the host system would be Solaris.
+
+ It is, of course, possible to build a cross compiler using a Canadian
+Cross (i.e., build a cross compiler using a cross compiler). In this
+case, the system for which the resulting cross compiler generates code
+is called the target system. (For a more complete discussion of host
+and target systems, *note Host and Target::).
+
+ An example of building a cross compiler using a Canadian Cross would
+be building a Windows cross MIPS ELF compiler on a GNU/Linux system. In
+this case the build system would be GNU/Linux, the host system would be
+Windows, and the target system would be MIPS ELF.
+
+ The name Canadian Cross comes from the case when the build, host, and
+target systems are all different. At the time that these issues were
+all being hashed out, Canada had three national political parties.
+
+
+File: configure.info, Node: Build Cross Host Tools, Next: Build and Host Options, Prev: Canadian Cross Concepts, Up: Canadian Cross
+
+6.3 Build Cross Host Tools
+==========================
+
+In order to configure a program for a Canadian Cross build, you must
+first build and install the set of cross tools you will use to build the
+program.
+
+ These tools will be build cross host tools. That is, they will run
+on the build system, and will produce code that runs on the host system.
+
+ It is easy to confuse the meaning of build and host here. Always
+remember that the build system is where you are doing the build, and the
+host system is where the resulting program will run. Therefore, you
+need a build cross host compiler.
+
+ In general, you must have a complete cross environment in order to do
+the build. This normally means a cross compiler, cross assembler, and
+so forth, as well as libraries and include files for the host system.
+
+
+File: configure.info, Node: Build and Host Options, Next: CCross not in Cygnus Tree, Prev: Build Cross Host Tools, Up: Canadian Cross
+
+6.4 Build and Host Options
+==========================
+
+When you run `configure', you must use both the `--build' and `--host'
+options.
+
+ The `--build' option is used to specify the configuration name of
+the build system. This can normally be the result of running the
+`config.guess' shell script, and it is reasonable to use
+`--build=`config.guess`'.
+
+ The `--host' option is used to specify the configuration name of the
+host system.
+
+ As we explained earlier, `config.guess' is used to set the default
+value for the `--host' option (*note Using the Host Type::). We can
+now see that since `config.guess' returns the type of system on which
+it is run, it really identifies the build system. Since the host
+system is normally the same as the build system (i.e., people do not
+normally build using a cross compiler), it is reasonable to use the
+result of `config.guess' as the default for the host system when the
+`--host' option is not used.
+
+ It might seem that if the `--host' option were used without the
+`--build' option that the configure script could run `config.guess' to
+determine the build system, and presume a Canadian Cross if the result
+of `config.guess' differed from the `--host' option. However, for
+historical reasons, some configure scripts are routinely run using an
+explicit `--host' option, rather than using the default from
+`config.guess'. As noted earlier, it is difficult or impossible to
+reliably compare configuration names (*note Using the Target Type::).
+Therefore, by convention, if the `--host' option is used, but the
+`--build' option is not used, then the build system defaults to the
+host system.
+
+
+File: configure.info, Node: CCross not in Cygnus Tree, Next: CCross in Cygnus Tree, Prev: Build and Host Options, Up: Canadian Cross
+
+6.5 Canadian Cross not in Cygnus Tree.
+======================================
+
+If you are not using the Cygnus tree, you must explicitly specify the
+cross tools which you want to use to build the program. This is done by
+setting environment variables before running the `configure' script.
+
+ You must normally set at least the environment variables `CC', `AR',
+and `RANLIB' to the cross tools which you want to use to build.
+
+ For some programs, you must set additional cross tools as well, such
+as `AS', `LD', or `NM'.
+
+ You would set these environment variables to the build cross tools
+which you are going to use.
+
+ For example, if you are building a Solaris program on a GNU/Linux
+system, and your GNU/Linux cross Solaris compiler were named
+`solaris-gcc', then you would set the environment variable `CC' to
+`solaris-gcc'.
+
+
+File: configure.info, Node: CCross in Cygnus Tree, Next: Supporting Canadian Cross, Prev: CCross not in Cygnus Tree, Up: Canadian Cross
+
+6.6 Canadian Cross in Cygnus Tree
+=================================
+
+This section describes configuring and building a Canadian Cross when
+using the Cygnus tree.
+
+* Menu:
+
+* Standard Cygnus CCross:: Building a Normal Program.
+* Cross Cygnus CCross:: Building a Cross Program.
+
+
+File: configure.info, Node: Standard Cygnus CCross, Next: Cross Cygnus CCross, Up: CCross in Cygnus Tree
+
+6.6.1 Building a Normal Program
+-------------------------------
+
+When configuring a Canadian Cross in the Cygnus tree, all the
+appropriate environment variables are automatically set to `HOST-TOOL',
+where HOST is the value used for the `--host' option, and TOOL is the
+name of the tool (e.g., `gcc', `as', etc.). These tools must be on
+your `PATH'.
+
+ Adding a prefix of HOST will give the usual name for the build cross
+host tools. To see this, consider that when these cross tools were
+built, they were configured to run on the build system and to produce
+code for the host system. That is, they were configured with a
+`--target' option that is the same as the system which we are now
+calling the host. Recall that the default name for installed cross
+tools uses the target system as a prefix (*note Using the Target
+Type::). Since that is the system which we are now calling the host,
+HOST is the right prefix to use.
+
+ For example, if you configure with `--build=i386-linux-gnu' and
+`--host=solaris', then the Cygnus tree will automatically default to
+using the compiler `solaris-gcc'. You must have previously built and
+installed this compiler, probably by doing a build with no `--host'
+option and with a `--target' option of `solaris'.
+
+
+File: configure.info, Node: Cross Cygnus CCross, Prev: Standard Cygnus CCross, Up: CCross in Cygnus Tree
+
+6.6.2 Building a Cross Program
+------------------------------
+
+There are additional considerations if you want to build a cross
+compiler, rather than a native compiler, in the Cygnus tree using a
+Canadian Cross.
+
+ When you build a cross compiler using the Cygnus tree, then the
+target libraries will normally be built with the newly built target
+compiler (*note Host and Target Libraries::). However, this will not
+work when building with a Canadian Cross. This is because the newly
+built target compiler will be a program which runs on the host system,
+and therefore will not be able to run on the build system.
+
+ Therefore, when building a cross compiler with the Cygnus tree, you
+must first install a set of build cross target tools. These tools will
+be used when building the target libraries.
+
+ Note that this is not a requirement of a Canadian Cross in general.
+For example, it would be possible to build just the host cross target
+tools on the build system, to copy the tools to the host system, and to
+build the target libraries on the host system. The requirement for
+build cross target tools is imposed by the Cygnus tree, which expects
+to be able to build both host programs and target libraries in a single
+`configure'/`make' step. Because it builds these in a single step, it
+expects to be able to build the target libraries on the build system,
+which means that it must use a build cross target toolchain.
+
+ For example, suppose you want to build a Windows cross MIPS ELF
+compiler on a GNU/Linux system. You must have previously installed
+both a GNU/Linux cross Windows compiler and a GNU/Linux cross MIPS ELF
+compiler.
+
+ In order to build the Windows (configuration name `i386-cygwin32')
+cross MIPS ELF (configure name `mips-elf') compiler, you might execute
+the following commands (long command lines are broken across lines with
+a trailing backslash as a continuation character).
+
+ mkdir linux-x-cygwin32
+ cd linux-x-cygwin32
+ SRCDIR/configure --target i386-cygwin32 --prefix=INSTALLDIR \
+ --exec-prefix=INSTALLDIR/H-i386-linux
+ make
+ make install
+ cd ..
+ mkdir linux-x-mips-elf
+ cd linux-x-mips-elf
+ SRCDIR/configure --target mips-elf --prefix=INSTALLDIR \
+ --exec-prefix=INSTALLDIR/H-i386-linux
+ make
+ make install
+ cd ..
+ mkdir cygwin32-x-mips-elf
+ cd cygwin32-x-mips-elf
+ SRCDIR/configure --build=i386-linux-gnu --host=i386-cygwin32 \
+ --target=mips-elf --prefix=WININSTALLDIR \
+ --exec-prefix=WININSTALLDIR/H-i386-cygwin32
+ make
+ make install
+
+ You would then copy the contents of WININSTALLDIR over to the
+Windows machine, and run the resulting programs.
+
+
+File: configure.info, Node: Supporting Canadian Cross, Prev: CCross in Cygnus Tree, Up: Canadian Cross
+
+6.7 Supporting Canadian Cross
+=============================
+
+If you want to make it possible to build a program you are developing
+using a Canadian Cross, you must take some care when writing your
+configure and make rules. Simple cases will normally work correctly.
+However, it is not hard to write configure and make tests which will
+fail in a Canadian Cross.
+
+* Menu:
+
+* CCross in Configure:: Supporting Canadian Cross in Configure Scripts.
+* CCross in Make:: Supporting Canadian Cross in Makefiles.
+
+
+File: configure.info, Node: CCross in Configure, Next: CCross in Make, Up: Supporting Canadian Cross
+
+6.7.1 Supporting Canadian Cross in Configure Scripts
+----------------------------------------------------
+
+In a `configure.in' file, after calling `AC_PROG_CC', you can find out
+whether this is a Canadian Cross configure by examining the shell
+variable `cross_compiling'. In a Canadian Cross, which means that the
+compiler is a cross compiler, `cross_compiling' will be `yes'. In a
+normal configuration, `cross_compiling' will be `no'.
+
+ You ordinarily do not need to know the type of the build system in a
+configure script. However, if you do need that information, you can get
+it by using the macro `AC_CANONICAL_SYSTEM', the same macro that is
+used to determine the target system. This macro will set the variables
+`build', `build_alias', `build_cpu', `build_vendor', and `build_os',
+which correspond to the similar `target' and `host' variables, except
+that they describe the build system.
+
+ When writing tests in `configure.in', you must remember that you
+want to test the host environment, not the build environment.
+
+ Macros like `AC_CHECK_FUNCS' which use the compiler will test the
+host environment. That is because the tests will be done by running the
+compiler, which is actually a build cross host compiler. If the
+compiler can find the function, that means that the function is present
+in the host environment.
+
+ Tests like `test -f /dev/ptyp0', on the other hand, will test the
+build environment. Remember that the configure script is running on the
+build system, not the host system. If your configure scripts examines
+files, those files will be on the build system. Whatever you determine
+based on those files may or may not be the case on the host system.
+
+ Most autoconf macros will work correctly for a Canadian Cross. The
+main exception is `AC_TRY_RUN'. This macro tries to compile and run a
+test program. This will fail in a Canadian Cross, because the program
+will be compiled for the host system, which means that it will not run
+on the build system.
+
+ The `AC_TRY_RUN' macro provides an optional argument to tell the
+configure script what to do in a Canadian Cross. If that argument is
+not present, you will get a warning when you run `autoconf':
+ warning: AC_TRY_RUN called without default to allow cross compiling
+ This tells you that the resulting `configure' script will not work
+with a Canadian Cross.
+
+ In some cases while it may better to perform a test at configure
+time, it is also possible to perform the test at run time. In such a
+case you can use the cross compiling argument to `AC_TRY_RUN' to tell
+your program that the test could not be performed at configure time.
+
+ There are a few other autoconf macros which will not work correctly
+with a Canadian Cross: a partial list is `AC_FUNC_GETPGRP',
+`AC_FUNC_SETPGRP', `AC_FUNC_SETVBUF_REVERSED', and
+`AC_SYS_RESTARTABLE_SYSCALLS'. The `AC_CHECK_SIZEOF' macro is
+generally not very useful with a Canadian Cross; it permits an optional
+argument indicating the default size, but there is no way to know what
+the correct default should be.
+
+
+File: configure.info, Node: CCross in Make, Prev: CCross in Configure, Up: Supporting Canadian Cross
+
+6.7.2 Supporting Canadian Cross in Makefiles.
+---------------------------------------------
+
+The main Canadian Cross issue in a `Makefile' arises when you want to
+use a subsidiary program to generate code or data which you will then
+include in your real program.
+
+ If you compile this subsidiary program using `$(CC)' in the usual
+way, you will not be able to run it. This is because `$(CC)' will
+build a program for the host system, but the program is being built on
+the build system.
+
+ You must instead use a compiler for the build system, rather than the
+host system. In the Cygnus tree, this make variable `$(CC_FOR_BUILD)'
+will hold a compiler for the build system.
+
+ Note that you should not include `config.h' in a file you are
+compiling with `$(CC_FOR_BUILD)'. The `configure' script will build
+`config.h' with information for the host system. However, you are
+compiling the file using a compiler for the build system (a native
+compiler). Subsidiary programs are normally simple filters which do no
+user interaction, and it is normally possible to write them in a highly
+portable fashion so that the absence of `config.h' is not crucial.
+
+ The gcc `Makefile.in' shows a complex situation in which certain
+files, such as `rtl.c', must be compiled into both subsidiary programs
+run on the build system and into the final program. This approach may
+be of interest for advanced build system hackers. Note that the build
+system compiler is rather confusingly called `HOST_CC'.
+
+
+File: configure.info, Node: Cygnus Configure, Next: Multilibs, Prev: Canadian Cross, Up: Top
+
+7 Cygnus Configure
+******************
+
+The Cygnus configure script predates autoconf. All of its interesting
+features have been incorporated into autoconf. No new programs should
+be written to use the Cygnus configure script.
+
+ However, the Cygnus configure script is still used in a few places:
+at the top of the Cygnus tree and in a few target libraries in the
+Cygnus tree. Until those uses have been replaced with autoconf, some
+brief notes are appropriate here. This is not complete documentation,
+but it should be possible to use this as a guide while examining the
+scripts themselves.
+
+* Menu:
+
+* Cygnus Configure Basics:: Cygnus Configure Basics.
+* Cygnus Configure in C++ Libraries:: Cygnus Configure in C++ Libraries.
+
+
+File: configure.info, Node: Cygnus Configure Basics, Next: Cygnus Configure in C++ Libraries, Up: Cygnus Configure
+
+7.1 Cygnus Configure Basics
+===========================
+
+Cygnus configure does not use any generated files; there is no program
+corresponding to `autoconf'. Instead, there is a single shell script
+named `configure' which may be found at the top of the Cygnus tree.
+This shell script was written by hand; it was not generated by
+autoconf, and it is incorrect, and indeed harmful, to run `autoconf' in
+the top level of a Cygnus tree.
+
+ Cygnus configure works in a particular directory by examining the
+file `configure.in' in that directory. That file is broken into four
+separate shell scripts.
+
+ The first is the contents of `configure.in' up to a line that starts
+with `# per-host:'. This is the common part.
+
+ The second is the rest of `configure.in' up to a line that starts
+with `# per-target:'. This is the per host part.
+
+ The third is the rest of `configure.in' up to a line that starts
+with `# post-target:'. This is the per target part.
+
+ The fourth is the remainder of `configure.in'. This is the post
+target part.
+
+ If any of these comment lines are missing, the corresponding shell
+script is empty.
+
+ Cygnus configure will first execute the common part. This must set
+the shell variable `srctrigger' to the name of a source file, to
+confirm that Cygnus configure is looking at the right directory. This
+may set the shell variables `package_makefile_frag' and
+`package_makefile_rules_frag'.
+
+ Cygnus configure will next set the `build' and `host' shell
+variables, and execute the per host part. This may set the shell
+variable `host_makefile_frag'.
+
+ Cygnus configure will next set the `target' variable, and execute
+the per target part. This may set the shell variable
+`target_makefile_frag'.
+
+ Any of these scripts may set the `subdirs' shell variable. This
+variable is a list of subdirectories where a `Makefile.in' file may be
+found. Cygnus configure will automatically look for a `Makefile.in'
+file in the current directory. The `subdirs' shell variable is not
+normally used, and I believe that the only directory which uses it at
+present is `newlib'.
+
+ For each `Makefile.in', Cygnus configure will automatically create a
+`Makefile' by adding definitions for `make' variables such as `host'
+and `target', and automatically editing the values of `make' variables
+such as `prefix' if they are present.
+
+ Also, if any of the `makefile_frag' shell variables are set, Cygnus
+configure will interpret them as file names relative to either the
+working directory or the source directory, and will read the contents of
+the file into the generated `Makefile'. The file contents will be read
+in after the first line in `Makefile.in' which starts with `####'.
+
+ These `Makefile' fragments are used to customize behaviour for a
+particular host or target. They serve to select particular files to
+compile, and to define particular preprocessor macros by providing
+values for `make' variables which are then used during compilation.
+Cygnus configure, unlike autoconf, normally does not do feature tests,
+and normally requires support to be added manually for each new host.
+
+ The `Makefile' fragment support is similar to the autoconf
+`AC_SUBST_FILE' macro.
+
+ After creating each `Makefile', the post target script will be run
+(i.e., it may be run several times). This script may further customize
+the `Makefile'. When it is run, the shell variable `Makefile' will
+hold the name of the `Makefile', including the appropriate directory
+component.
+
+ Like an autoconf generated `configure' script, Cygnus configure will
+create a file named `config.status' which, when run, will automatically
+recreate the configuration. The `config.status' file will simply
+execute the Cygnus configure script again with the appropriate
+arguments.
+
+ Any of the parts of `configure.in' may set the shell variables
+`files' and `links'. Cygnus configure will set up symlinks from the
+names in `links' to the files named in `files'. This is similar to the
+autoconf `AC_LINK_FILES' macro.
+
+ Finally, any of the parts of `configure.in' may set the shell
+variable `configdirs' to a set of subdirectories. If it is set, Cygnus
+configure will recursively run the configure process in each
+subdirectory. If the subdirectory uses Cygnus configure, it will
+contain a `configure.in' file but no `configure' file, in which case
+Cygnus configure will invoke itself recursively. If the subdirectory
+has a `configure' file, Cygnus configure assumes that it is an autoconf
+generated `configure' script, and simply invokes it directly.
+
+
+File: configure.info, Node: Cygnus Configure in C++ Libraries, Prev: Cygnus Configure Basics, Up: Cygnus Configure
+
+7.2 Cygnus Configure in C++ Libraries
+=====================================
+
+The C++ library configure system, written by Per Bothner, deserves
+special mention. It uses Cygnus configure, but it does feature testing
+like that done by autoconf generated `configure' scripts. This
+approach is used in the libraries `libio', `libstdc++', and `libg++'.
+
+ Most of the `Makefile' information is written out by the shell
+script `libio/config.shared'. Each `configure.in' file sets certain
+shell variables, and then invokes `config.shared' to create two package
+`Makefile' fragments. These fragments are then incorporated into the
+resulting `Makefile' by the Cygnus configure script.
+
+ The file `_G_config.h' is created in the `libio' object directory by
+running the shell script `libio/gen-params'. This shell script uses
+feature tests to define macros and typedefs in `_G_config.h'.
+
+
+File: configure.info, Node: Multilibs, Next: FAQ, Prev: Cygnus Configure, Up: Top
+
+8 Multilibs
+***********
+
+For some targets gcc may have different processor requirements depending
+upon command line options. An obvious example is the `-msoft-float'
+option supported on several processors. This option means that the
+floating point registers are not available, which means that floating
+point operations must be done by calling an emulation subroutine rather
+than by using machine instructions.
+
+ For such options, gcc is often configured to compile target libraries
+twice: once with `-msoft-float' and once without. When gcc compiles
+target libraries more than once, the resulting libraries are called
+"multilibs".
+
+ Multilibs are not really part of the GNU configure and build system,
+but we discuss them here since they require support in the `configure'
+scripts and `Makefile's used for target libraries.
+
+* Menu:
+
+* Multilibs in gcc:: Multilibs in gcc.
+* Multilibs in Target Libraries:: Multilibs in Target Libraries.
+
+
+File: configure.info, Node: Multilibs in gcc, Next: Multilibs in Target Libraries, Up: Multilibs
+
+8.1 Multilibs in gcc
+====================
+
+In gcc, multilibs are defined by setting the variable
+`MULTILIB_OPTIONS' in the target `Makefile' fragment. Several other
+`MULTILIB' variables may also be defined there. *Note The Target
+Makefile Fragment: (gcc)Target Fragment.
+
+ If you have built gcc, you can see what multilibs it uses by running
+it with the `-print-multi-lib' option. The output `.;' means that no
+multilibs are used. In general, the output is a sequence of lines, one
+per multilib. The first part of each line, up to the `;', is the name
+of the multilib directory. The second part is a list of compiler
+options separated by `@' characters.
+
+ Multilibs are built in a tree of directories. The top of the tree,
+represented by `.' in the list of multilib directories, is the default
+library to use when no special compiler options are used. The
+subdirectories of the tree hold versions of the library to use when
+particular compiler options are used.
+
+
+File: configure.info, Node: Multilibs in Target Libraries, Prev: Multilibs in gcc, Up: Multilibs
+
+8.2 Multilibs in Target Libraries
+=================================
+
+The target libraries in the Cygnus tree are automatically built with
+multilibs. That means that each library is built multiple times.
+
+ This default is set in the top level `configure.in' file, by adding
+`--enable-multilib' to the list of arguments passed to configure when
+it is run for the target libraries (*note Host and Target Libraries::).
+
+ Each target library uses the shell script `config-ml.in', written by
+Doug Evans, to prepare to build target libraries. This shell script is
+invoked after the `Makefile' has been created by the `configure'
+script. If multilibs are not enabled, it does nothing, otherwise it
+modifies the `Makefile' to support multilibs.
+
+ The `config-ml.in' script makes one copy of the `Makefile' for each
+multilib in the appropriate subdirectory. When configuring in the
+source directory (which is not recommended), it will build a symlink
+tree of the sources in each subdirectory.
+
+ The `config-ml.in' script sets several variables in the various
+`Makefile's. The `Makefile.in' must have definitions for these
+variables already; `config-ml.in' simply changes the existing values.
+The `Makefile' should use default values for these variables which will
+do the right thing in the subdirectories.
+
+`MULTISRCTOP'
+ `config-ml.in' will set this to a sequence of `../' strings, where
+ the number of strings is the number of multilib levels in the
+ source tree. The default value should be the empty string.
+
+`MULTIBUILDTOP'
+ `config-ml.in' will set this to a sequence of `../' strings, where
+ the number of strings is number of multilib levels in the object
+ directory. The default value should be the empty string. This
+ will differ from `MULTISRCTOP' when configuring in the source tree
+ (which is not recommended).
+
+`MULTIDIRS'
+ In the top level `Makefile' only, `config-ml.in' will set this to
+ the list of multilib subdirectories. The default value should be
+ the empty string.
+
+`MULTISUBDIR'
+ `config-ml.in' will set this to the installed subdirectory name to
+ use for this subdirectory, with a leading `/'. The default value
+ shold be the empty string.
+
+`MULTIDO'
+`MULTICLEAN'
+ In the top level `Makefile' only, `config-ml.in' will set these
+ variables to commands to use when doing a recursive make. These
+ variables should both default to the string `true', so that by
+ default nothing happens.
+
+ All references to the parent of the source directory should use the
+variable `MULTISRCTOP'. Instead of writing `$(srcdir)/..', you must
+write `$(srcdir)/$(MULTISRCTOP)..'.
+
+ Similarly, references to the parent of the object directory should
+use the variable `MULTIBUILDTOP'.
+
+ In the installation target, the libraries should be installed in the
+subdirectory `MULTISUBDIR'. Instead of installing
+`$(libdir)/libfoo.a', install `$(libdir)$(MULTISUBDIR)/libfoo.a'.
+
+ The `config-ml.in' script also modifies the top level `Makefile' to
+add `multi-do' and `multi-clean' targets which are used when building
+multilibs.
+
+ The default target of the `Makefile' should include the following
+command:
+ @$(MULTIDO) $(FLAGS_TO_PASS) DO=all multi-do
+ This assumes that `$(FLAGS_TO_PASS)' is defined as a set of
+variables to pass to a recursive invocation of `make'. This will build
+all the multilibs. Note that the default value of `MULTIDO' is `true',
+so by default this command will do nothing. It will only do something
+in the top level `Makefile' if multilibs were enabled.
+
+ The `install' target of the `Makefile' should include the following
+command:
+ @$(MULTIDO) $(FLAGS_TO_PASS) DO=install multi-do
+
+ In general, any operation, other than clean, which should be
+performed on all the multilibs should use a `$(MULTIDO)' line, setting
+the variable `DO' to the target of each recursive call to `make'.
+
+ The `clean' targets (`clean', `mostlyclean', etc.) should use
+`$(MULTICLEAN)'. For example, the `clean' target should do this:
+ @$(MULTICLEAN) DO=clean multi-clean
+
+
+File: configure.info, Node: FAQ, Next: Index, Prev: Multilibs, Up: Top
+
+9 Frequently Asked Questions
+****************************
+
+Which do I run first, `autoconf' or `automake'?
+ Except when you first add autoconf or automake support to a
+ package, you shouldn't run either by hand. Instead, configure
+ with the `--enable-maintainer-mode' option, and let `make' take
+ care of it.
+
+`autoconf' says something about undefined macros.
+ This means that you have macros in your `configure.in' which are
+ not defined by `autoconf'. You may be using an old version of
+ `autoconf'; try building and installing a newer one. Make sure the
+ newly installled `autoconf' is first on your `PATH'. Also, see
+ the next question.
+
+My `configure' script has stuff like `CY_GNU_GETTEXT' in it.
+ This means that you have macros in your `configure.in' which should
+ be defined in your `aclocal.m4' file, but aren't. This usually
+ means that `aclocal' was not able to appropriate definitions of the
+ macros. Make sure that you have installed all the packages you
+ need. In particular, make sure that you have installed libtool
+ (this is where `AM_PROG_LIBTOOL' is defined) and gettext (this is
+ where `CY_GNU_GETTEXT' is defined, at least in the Cygnus version
+ of gettext).
+
+My `Makefile' has `@' characters in it.
+ This may mean that you tried to use an autoconf substitution in
+ your `Makefile.in' without adding the appropriate `AC_SUBST' call
+ to your `configure' script. Or it may just mean that you need to
+ rebuild `Makefile' in your build directory. To rebuild `Makefile'
+ from `Makefile.in', run the shell script `config.status' with no
+ arguments. If you need to force `configure' to run again, first
+ run `config.status --recheck'. These runs are normally done
+ automatically by `Makefile' targets, but if your `Makefile' has
+ gotten messed up you'll need to help them along.
+
+Why do I have to run both `config.status --recheck' and `config.status'?
+ Normally, you don't; they will be run automatically by `Makefile'
+ targets. If you do need to run them, use `config.status --recheck'
+ to run the `configure' script again with the same arguments as the
+ first time you ran it. Use `config.status' (with no arguments) to
+ regenerate all files (`Makefile', `config.h', etc.) based on the
+ results of the configure script. The two cases are separate
+ because it isn't always necessary to regenerate all the files
+ after running `config.status --recheck'. The `Makefile' targets
+ generated by automake will use the environment variables
+ `CONFIG_FILES' and `CONFIG_HEADERS' to only regenerate files as
+ they are needed.
+
+What is the Cygnus tree?
+ The Cygnus tree is used for various packages including gdb, the GNU
+ binutils, and egcs. It is also, of course, used for Cygnus
+ releases. It is the build system which was developed at Cygnus,
+ using the Cygnus configure script. It permits building many
+ different packages with a single configure and make. The
+ configure scripts in the tree are being converted to autoconf, but
+ the general build structure remains intact.
+
+Why do I have to keep rebuilding and reinstalling the tools?
+ I know, it's a pain. Unfortunately, there are bugs in the tools
+ themselves which need to be fixed, and each time that happens
+ everybody who uses the tools need to reinstall new versions of
+ them. I don't know if there is going to be a clever fix until the
+ tools stabilize.
+
+Why not just have a Cygnus tree `make' target to update the tools?
+ The tools unfortunately need to be installed before they can be
+ used. That means that they must be built using an appropriate
+ prefix, and it seems unwise to assume that every configuration
+ uses an appropriate prefix. It might be possible to make them
+ work in place, or it might be possible to install them in some
+ subdirectory; so far these approaches have not been implemented.
+
+
+File: configure.info, Node: Index, Prev: FAQ, Up: Top
+
+Index
+*****
+
+
+* Menu:
+
+* --build option: Build and Host Options.
+ (line 9)
+* --host option: Build and Host Options.
+ (line 14)
+* --target option: Specifying the Target.
+ (line 10)
+* _GNU_SOURCE: Write configure.in. (line 134)
+* AC_CANONICAL_HOST: Using the Host Type. (line 10)
+* AC_CANONICAL_SYSTEM: Using the Target Type.
+ (line 6)
+* AC_CONFIG_HEADER: Write configure.in. (line 66)
+* AC_EXEEXT: Write configure.in. (line 86)
+* AC_INIT: Write configure.in. (line 38)
+* AC_OUTPUT: Write configure.in. (line 142)
+* AC_PREREQ: Write configure.in. (line 42)
+* AC_PROG_CC: Write configure.in. (line 103)
+* AC_PROG_CXX: Write configure.in. (line 117)
+* acconfig.h: Written Developer Files.
+ (line 27)
+* acconfig.h, writing: Write acconfig.h. (line 6)
+* acinclude.m4: Written Developer Files.
+ (line 37)
+* aclocal.m4: Generated Developer Files.
+ (line 33)
+* AM_CONFIG_HEADER: Write configure.in. (line 53)
+* AM_DISABLE_SHARED: Write configure.in. (line 127)
+* AM_EXEEXT: Write configure.in. (line 86)
+* AM_INIT_AUTOMAKE: Write configure.in. (line 48)
+* AM_MAINTAINER_MODE: Write configure.in. (line 70)
+* AM_PROG_LIBTOOL: Write configure.in. (line 122)
+* AM_PROG_LIBTOOL in configure: FAQ. (line 19)
+* build option: Build and Host Options.
+ (line 9)
+* building with a cross compiler: Canadian Cross. (line 6)
+* canadian cross: Canadian Cross. (line 6)
+* canadian cross in configure: CCross in Configure. (line 6)
+* canadian cross in cygnus tree: CCross in Cygnus Tree.
+ (line 6)
+* canadian cross in makefile: CCross in Make. (line 6)
+* canadian cross, configuring: Build and Host Options.
+ (line 6)
+* canonical system names: Configuration Names. (line 6)
+* config.cache: Build Files Description.
+ (line 28)
+* config.h: Build Files Description.
+ (line 23)
+* config.h.in: Generated Developer Files.
+ (line 45)
+* config.in: Generated Developer Files.
+ (line 45)
+* config.status: Build Files Description.
+ (line 9)
+* config.status --recheck: FAQ. (line 40)
+* configuration names: Configuration Names. (line 6)
+* configuration triplets: Configuration Names. (line 6)
+* configure: Generated Developer Files.
+ (line 21)
+* configure build system: Build and Host Options.
+ (line 9)
+* configure host: Build and Host Options.
+ (line 14)
+* configure target: Specifying the Target.
+ (line 10)
+* configure.in: Written Developer Files.
+ (line 9)
+* configure.in, writing: Write configure.in. (line 6)
+* configuring a canadian cross: Build and Host Options.
+ (line 6)
+* cross compiler: Cross Compilation Concepts.
+ (line 6)
+* cross compiler, building with: Canadian Cross. (line 6)
+* cross tools: Cross Compilation Tools.
+ (line 6)
+* CY_GNU_GETTEXT in configure: FAQ. (line 19)
+* cygnus configure: Cygnus Configure. (line 6)
+* goals: Goals. (line 6)
+* history: History. (line 6)
+* host names: Configuration Names. (line 6)
+* host option: Build and Host Options.
+ (line 14)
+* host system: Host and Target. (line 6)
+* host triplets: Configuration Names. (line 6)
+* HOST_CC: CCross in Make. (line 27)
+* libg++ configure: Cygnus Configure in C++ Libraries.
+ (line 6)
+* libio configure: Cygnus Configure in C++ Libraries.
+ (line 6)
+* libstdc++ configure: Cygnus Configure in C++ Libraries.
+ (line 6)
+* Makefile: Build Files Description.
+ (line 18)
+* Makefile, garbage characters: FAQ. (line 29)
+* Makefile.am: Written Developer Files.
+ (line 18)
+* Makefile.am, writing: Write Makefile.am. (line 6)
+* Makefile.in: Generated Developer Files.
+ (line 26)
+* multilibs: Multilibs. (line 6)
+* stamp-h: Build Files Description.
+ (line 41)
+* stamp-h.in: Generated Developer Files.
+ (line 54)
+* system names: Configuration Names. (line 6)
+* system types: Configuration Names. (line 6)
+* target option: Specifying the Target.
+ (line 10)
+* target system: Host and Target. (line 6)
+* triplets: Configuration Names. (line 6)
+* undefined macros: FAQ. (line 12)
+
+
+
+Tag Table:
+Node: Top971
+Node: Introduction1499
+Node: Goals2581
+Node: Tools3305
+Node: History4299
+Node: Building7297
+Node: Getting Started10560
+Node: Write configure.in11073
+Node: Write Makefile.am18324
+Node: Write acconfig.h21501
+Node: Generate files23038
+Node: Getting Started Example25004
+Node: Getting Started Example 125759
+Node: Getting Started Example 227680
+Node: Getting Started Example 330675
+Node: Generate Files in Example33039
+Node: Files34129
+Node: Developer Files34740
+Node: Developer Files Picture35120
+Node: Written Developer Files36408
+Node: Generated Developer Files38960
+Node: Build Files42104
+Node: Build Files Picture42765
+Node: Build Files Description43529
+Node: Support Files45535
+Node: Configuration Names48417
+Node: Configuration Name Definition48917
+Node: Using Configuration Names51240
+Node: Cross Compilation Tools53210
+Node: Cross Compilation Concepts53901
+Node: Host and Target54869
+Node: Using the Host Type56370
+Node: Specifying the Target57719
+Node: Using the Target Type58508
+Node: Cross Tools in the Cygnus Tree61939
+Node: Host and Target Libraries62996
+Node: Target Library Configure Scripts66745
+Node: Make Targets in Cygnus Tree69837
+Node: Target libiberty71185
+Node: Canadian Cross72572
+Node: Canadian Cross Example73413
+Node: Canadian Cross Concepts74532
+Node: Build Cross Host Tools76044
+Node: Build and Host Options76996
+Node: CCross not in Cygnus Tree78782
+Node: CCross in Cygnus Tree79760
+Node: Standard Cygnus CCross80181
+Node: Cross Cygnus CCross81545
+Node: Supporting Canadian Cross84345
+Node: CCross in Configure84960
+Node: CCross in Make88128
+Node: Cygnus Configure89731
+Node: Cygnus Configure Basics90566
+Node: Cygnus Configure in C++ Libraries95244
+Node: Multilibs96251
+Node: Multilibs in gcc97296
+Node: Multilibs in Target Libraries98374
+Node: FAQ102565
+Node: Index106665
+
+End Tag Table
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/dir b/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/dir
new file mode 100644
index 0000000..13c3722
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/dir
@@ -0,0 +1,43 @@
+This is the file .../info/dir, which contains the
+topmost node of the Info hierarchy, called (dir)Top.
+The first time you invoke Info you start off looking at this node.
+
+File: dir, Node: Top This is the top of the INFO tree
+
+ This (the Directory node) gives a menu of major topics.
+ Typing "q" exits, "?" lists all Info commands, "d" returns here,
+ "h" gives a primer for first-timers,
+ "mEmacs<Return>" visits the Emacs manual, etc.
+
+ In Emacs, you can click mouse button 2 on a menu item or cross reference
+ to select it.
+
+* Menu:
+
+Miscellaneous
+* As: (as). The GNU assembler.
+* Bfd: (bfd). The Binary File Descriptor library.
+* Gas: (as). The GNU assembler.
+* Ld: (ld). The GNU linker.
+* gprof: (gprof). Profiling your program's execution
+
+Individual utilities
+* addr2line: (binutils)addr2line. Convert addresses to file and line.
+* ar: (binutils)ar. Create, modify, and extract from archives.
+* c++filt: (binutils)c++filt. Filter to demangle encoded C++ symbols.
+* cxxfilt: (binutils)c++filt. MS-DOS name for c++filt.
+* dlltool: (binutils)dlltool. Create files needed to build and use DLLs.
+* nlmconv: (binutils)nlmconv. Converts object code into an NLM.
+* nm: (binutils)nm. List symbols from object files.
+* objcopy: (binutils)objcopy. Copy and translate object files.
+* objdump: (binutils)objdump. Display information from object files.
+* ranlib: (binutils)ranlib. Generate index to archive contents.
+* readelf: (binutils)readelf. Display the contents of ELF format files.
+* size: (binutils)size. List section sizes and total size.
+* strings: (binutils)strings. List printable strings from files.
+* strip: (binutils)strip. Discard symbols.
+* windmc: (binutils)windmc. Generator for Windows message resources.
+* windres: (binutils)windres. Manipulate Windows resources.
+
+Software development
+* Binutils: (binutils). The GNU binary utilities.
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/gprof.info b/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/gprof.info
new file mode 100644
index 0000000..eb9943a
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/gprof.info
@@ -0,0 +1,2469 @@
+This is gprof.info, produced by makeinfo version 4.8 from gprof.texi.
+
+START-INFO-DIR-ENTRY
+* gprof: (gprof). Profiling your program's execution
+END-INFO-DIR-ENTRY
+
+ This file documents the gprof profiler of the GNU system.
+
+ Copyright (C) 1988, 92, 97, 98, 99, 2000, 2001, 2003, 2007, 2008,
+2009 Free Software Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.3 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+Texts. A copy of the license is included in the section entitled "GNU
+Free Documentation License".
+
+
+File: gprof.info, Node: Top, Next: Introduction, Up: (dir)
+
+Profiling a Program: Where Does It Spend Its Time?
+**************************************************
+
+This manual describes the GNU profiler, `gprof', and how you can use it
+to determine which parts of a program are taking most of the execution
+time. We assume that you know how to write, compile, and execute
+programs. GNU `gprof' was written by Jay Fenlason.
+
+ This manual is for `gprof' (GNU Binutils) version 2.20.
+
+ This document is distributed under the terms of the GNU Free
+Documentation License version 1.3. A copy of the license is included
+in the section entitled "GNU Free Documentation License".
+
+* Menu:
+
+* Introduction:: What profiling means, and why it is useful.
+
+* Compiling:: How to compile your program for profiling.
+* Executing:: Executing your program to generate profile data
+* Invoking:: How to run `gprof', and its options
+
+* Output:: Interpreting `gprof''s output
+
+* Inaccuracy:: Potential problems you should be aware of
+* How do I?:: Answers to common questions
+* Incompatibilities:: (between GNU `gprof' and Unix `gprof'.)
+* Details:: Details of how profiling is done
+* GNU Free Documentation License:: GNU Free Documentation License
+
+
+File: gprof.info, Node: Introduction, Next: Compiling, Prev: Top, Up: Top
+
+1 Introduction to Profiling
+***************************
+
+Profiling allows you to learn where your program spent its time and
+which functions called which other functions while it was executing.
+This information can show you which pieces of your program are slower
+than you expected, and might be candidates for rewriting to make your
+program execute faster. It can also tell you which functions are being
+called more or less often than you expected. This may help you spot
+bugs that had otherwise been unnoticed.
+
+ Since the profiler uses information collected during the actual
+execution of your program, it can be used on programs that are too
+large or too complex to analyze by reading the source. However, how
+your program is run will affect the information that shows up in the
+profile data. If you don't use some feature of your program while it
+is being profiled, no profile information will be generated for that
+feature.
+
+ Profiling has several steps:
+
+ * You must compile and link your program with profiling enabled.
+ *Note Compiling a Program for Profiling: Compiling.
+
+ * You must execute your program to generate a profile data file.
+ *Note Executing the Program: Executing.
+
+ * You must run `gprof' to analyze the profile data. *Note `gprof'
+ Command Summary: Invoking.
+
+ The next three chapters explain these steps in greater detail.
+
+ Several forms of output are available from the analysis.
+
+ The "flat profile" shows how much time your program spent in each
+function, and how many times that function was called. If you simply
+want to know which functions burn most of the cycles, it is stated
+concisely here. *Note The Flat Profile: Flat Profile.
+
+ The "call graph" shows, for each function, which functions called
+it, which other functions it called, and how many times. There is also
+an estimate of how much time was spent in the subroutines of each
+function. This can suggest places where you might try to eliminate
+function calls that use a lot of time. *Note The Call Graph: Call
+Graph.
+
+ The "annotated source" listing is a copy of the program's source
+code, labeled with the number of times each line of the program was
+executed. *Note The Annotated Source Listing: Annotated Source.
+
+ To better understand how profiling works, you may wish to read a
+description of its implementation. *Note Implementation of Profiling:
+Implementation.
+
+
+File: gprof.info, Node: Compiling, Next: Executing, Prev: Introduction, Up: Top
+
+2 Compiling a Program for Profiling
+***********************************
+
+The first step in generating profile information for your program is to
+compile and link it with profiling enabled.
+
+ To compile a source file for profiling, specify the `-pg' option when
+you run the compiler. (This is in addition to the options you normally
+use.)
+
+ To link the program for profiling, if you use a compiler such as `cc'
+to do the linking, simply specify `-pg' in addition to your usual
+options. The same option, `-pg', alters either compilation or linking
+to do what is necessary for profiling. Here are examples:
+
+ cc -g -c myprog.c utils.c -pg
+ cc -o myprog myprog.o utils.o -pg
+
+ The `-pg' option also works with a command that both compiles and
+links:
+
+ cc -o myprog myprog.c utils.c -g -pg
+
+ Note: The `-pg' option must be part of your compilation options as
+well as your link options. If it is not then no call-graph data will
+be gathered and when you run `gprof' you will get an error message like
+this:
+
+ gprof: gmon.out file is missing call-graph data
+
+ If you add the `-Q' switch to suppress the printing of the call
+graph data you will still be able to see the time samples:
+
+ Flat profile:
+
+ Each sample counts as 0.01 seconds.
+ % cumulative self self total
+ time seconds seconds calls Ts/call Ts/call name
+ 44.12 0.07 0.07 zazLoop
+ 35.29 0.14 0.06 main
+ 20.59 0.17 0.04 bazMillion
+
+ If you run the linker `ld' directly instead of through a compiler
+such as `cc', you may have to specify a profiling startup file
+`gcrt0.o' as the first input file instead of the usual startup file
+`crt0.o'. In addition, you would probably want to specify the
+profiling C library, `libc_p.a', by writing `-lc_p' instead of the
+usual `-lc'. This is not absolutely necessary, but doing this gives
+you number-of-calls information for standard library functions such as
+`read' and `open'. For example:
+
+ ld -o myprog /lib/gcrt0.o myprog.o utils.o -lc_p
+
+ If you are running the program on a system which supports shared
+libraries you may run into problems with the profiling support code in
+a shared library being called before that library has been fully
+initialised. This is usually detected by the program encountering a
+segmentation fault as soon as it is run. The solution is to link
+against a static version of the library containing the profiling
+support code, which for `gcc' users can be done via the `-static' or
+`-static-libgcc' command line option. For example:
+
+ gcc -g -pg -static-libgcc myprog.c utils.c -o myprog
+
+ If you compile only some of the modules of the program with `-pg',
+you can still profile the program, but you won't get complete
+information about the modules that were compiled without `-pg'. The
+only information you get for the functions in those modules is the
+total time spent in them; there is no record of how many times they
+were called, or from where. This will not affect the flat profile
+(except that the `calls' field for the functions will be blank), but
+will greatly reduce the usefulness of the call graph.
+
+ If you wish to perform line-by-line profiling you should use the
+`gcov' tool instead of `gprof'. See that tool's manual or info pages
+for more details of how to do this.
+
+ Note, older versions of `gcc' produce line-by-line profiling
+information that works with `gprof' rather than `gcov' so there is
+still support for displaying this kind of information in `gprof'. *Note
+Line-by-line Profiling: Line-by-line.
+
+ It also worth noting that `gcc' implements a
+`-finstrument-functions' command line option which will insert calls to
+special user supplied instrumentation routines at the entry and exit of
+every function in their program. This can be used to implement an
+alternative profiling scheme.
+
+
+File: gprof.info, Node: Executing, Next: Invoking, Prev: Compiling, Up: Top
+
+3 Executing the Program
+***********************
+
+Once the program is compiled for profiling, you must run it in order to
+generate the information that `gprof' needs. Simply run the program as
+usual, using the normal arguments, file names, etc. The program should
+run normally, producing the same output as usual. It will, however, run
+somewhat slower than normal because of the time spent collecting and
+writing the profile data.
+
+ The way you run the program--the arguments and input that you give
+it--may have a dramatic effect on what the profile information shows.
+The profile data will describe the parts of the program that were
+activated for the particular input you use. For example, if the first
+command you give to your program is to quit, the profile data will show
+the time used in initialization and in cleanup, but not much else.
+
+ Your program will write the profile data into a file called
+`gmon.out' just before exiting. If there is already a file called
+`gmon.out', its contents are overwritten. There is currently no way to
+tell the program to write the profile data under a different name, but
+you can rename the file afterwards if you are concerned that it may be
+overwritten.
+
+ In order to write the `gmon.out' file properly, your program must
+exit normally: by returning from `main' or by calling `exit'. Calling
+the low-level function `_exit' does not write the profile data, and
+neither does abnormal termination due to an unhandled signal.
+
+ The `gmon.out' file is written in the program's _current working
+directory_ at the time it exits. This means that if your program calls
+`chdir', the `gmon.out' file will be left in the last directory your
+program `chdir''d to. If you don't have permission to write in this
+directory, the file is not written, and you will get an error message.
+
+ Older versions of the GNU profiling library may also write a file
+called `bb.out'. This file, if present, contains an human-readable
+listing of the basic-block execution counts. Unfortunately, the
+appearance of a human-readable `bb.out' means the basic-block counts
+didn't get written into `gmon.out'. The Perl script `bbconv.pl',
+included with the `gprof' source distribution, will convert a `bb.out'
+file into a format readable by `gprof'. Invoke it like this:
+
+ bbconv.pl < bb.out > BH-DATA
+
+ This translates the information in `bb.out' into a form that `gprof'
+can understand. But you still need to tell `gprof' about the existence
+of this translated information. To do that, include BB-DATA on the
+`gprof' command line, _along with `gmon.out'_, like this:
+
+ gprof OPTIONS EXECUTABLE-FILE gmon.out BB-DATA [YET-MORE-PROFILE-DATA-FILES...] [> OUTFILE]
+
+
+File: gprof.info, Node: Invoking, Next: Output, Prev: Executing, Up: Top
+
+4 `gprof' Command Summary
+*************************
+
+After you have a profile data file `gmon.out', you can run `gprof' to
+interpret the information in it. The `gprof' program prints a flat
+profile and a call graph on standard output. Typically you would
+redirect the output of `gprof' into a file with `>'.
+
+ You run `gprof' like this:
+
+ gprof OPTIONS [EXECUTABLE-FILE [PROFILE-DATA-FILES...]] [> OUTFILE]
+
+Here square-brackets indicate optional arguments.
+
+ If you omit the executable file name, the file `a.out' is used. If
+you give no profile data file name, the file `gmon.out' is used. If
+any file is not in the proper format, or if the profile data file does
+not appear to belong to the executable file, an error message is
+printed.
+
+ You can give more than one profile data file by entering all their
+names after the executable file name; then the statistics in all the
+data files are summed together.
+
+ The order of these options does not matter.
+
+* Menu:
+
+* Output Options:: Controlling `gprof''s output style
+* Analysis Options:: Controlling how `gprof' analyzes its data
+* Miscellaneous Options::
+* Deprecated Options:: Options you no longer need to use, but which
+ have been retained for compatibility
+* Symspecs:: Specifying functions to include or exclude
+
+
+File: gprof.info, Node: Output Options, Next: Analysis Options, Up: Invoking
+
+4.1 Output Options
+==================
+
+These options specify which of several output formats `gprof' should
+produce.
+
+ Many of these options take an optional "symspec" to specify
+functions to be included or excluded. These options can be specified
+multiple times, with different symspecs, to include or exclude sets of
+symbols. *Note Symspecs: Symspecs.
+
+ Specifying any of these options overrides the default (`-p -q'),
+which prints a flat profile and call graph analysis for all functions.
+
+`-A[SYMSPEC]'
+`--annotated-source[=SYMSPEC]'
+ The `-A' option causes `gprof' to print annotated source code. If
+ SYMSPEC is specified, print output only for matching symbols.
+ *Note The Annotated Source Listing: Annotated Source.
+
+`-b'
+`--brief'
+ If the `-b' option is given, `gprof' doesn't print the verbose
+ blurbs that try to explain the meaning of all of the fields in the
+ tables. This is useful if you intend to print out the output, or
+ are tired of seeing the blurbs.
+
+`-C[SYMSPEC]'
+`--exec-counts[=SYMSPEC]'
+ The `-C' option causes `gprof' to print a tally of functions and
+ the number of times each was called. If SYMSPEC is specified,
+ print tally only for matching symbols.
+
+ If the profile data file contains basic-block count records,
+ specifying the `-l' option, along with `-C', will cause basic-block
+ execution counts to be tallied and displayed.
+
+`-i'
+`--file-info'
+ The `-i' option causes `gprof' to display summary information
+ about the profile data file(s) and then exit. The number of
+ histogram, call graph, and basic-block count records is displayed.
+
+`-I DIRS'
+`--directory-path=DIRS'
+ The `-I' option specifies a list of search directories in which to
+ find source files. Environment variable GPROF_PATH can also be
+ used to convey this information. Used mostly for annotated source
+ output.
+
+`-J[SYMSPEC]'
+`--no-annotated-source[=SYMSPEC]'
+ The `-J' option causes `gprof' not to print annotated source code.
+ If SYMSPEC is specified, `gprof' prints annotated source, but
+ excludes matching symbols.
+
+`-L'
+`--print-path'
+ Normally, source filenames are printed with the path component
+ suppressed. The `-L' option causes `gprof' to print the full
+ pathname of source filenames, which is determined from symbolic
+ debugging information in the image file and is relative to the
+ directory in which the compiler was invoked.
+
+`-p[SYMSPEC]'
+`--flat-profile[=SYMSPEC]'
+ The `-p' option causes `gprof' to print a flat profile. If
+ SYMSPEC is specified, print flat profile only for matching symbols.
+ *Note The Flat Profile: Flat Profile.
+
+`-P[SYMSPEC]'
+`--no-flat-profile[=SYMSPEC]'
+ The `-P' option causes `gprof' to suppress printing a flat profile.
+ If SYMSPEC is specified, `gprof' prints a flat profile, but
+ excludes matching symbols.
+
+`-q[SYMSPEC]'
+`--graph[=SYMSPEC]'
+ The `-q' option causes `gprof' to print the call graph analysis.
+ If SYMSPEC is specified, print call graph only for matching symbols
+ and their children. *Note The Call Graph: Call Graph.
+
+`-Q[SYMSPEC]'
+`--no-graph[=SYMSPEC]'
+ The `-Q' option causes `gprof' to suppress printing the call graph.
+ If SYMSPEC is specified, `gprof' prints a call graph, but excludes
+ matching symbols.
+
+`-t'
+`--table-length=NUM'
+ The `-t' option causes the NUM most active source lines in each
+ source file to be listed when source annotation is enabled. The
+ default is 10.
+
+`-y'
+`--separate-files'
+ This option affects annotated source output only. Normally,
+ `gprof' prints annotated source files to standard-output. If this
+ option is specified, annotated source for a file named
+ `path/FILENAME' is generated in the file `FILENAME-ann'. If the
+ underlying file system would truncate `FILENAME-ann' so that it
+ overwrites the original `FILENAME', `gprof' generates annotated
+ source in the file `FILENAME.ann' instead (if the original file
+ name has an extension, that extension is _replaced_ with `.ann').
+
+`-Z[SYMSPEC]'
+`--no-exec-counts[=SYMSPEC]'
+ The `-Z' option causes `gprof' not to print a tally of functions
+ and the number of times each was called. If SYMSPEC is specified,
+ print tally, but exclude matching symbols.
+
+`-r'
+`--function-ordering'
+ The `--function-ordering' option causes `gprof' to print a
+ suggested function ordering for the program based on profiling
+ data. This option suggests an ordering which may improve paging,
+ tlb and cache behavior for the program on systems which support
+ arbitrary ordering of functions in an executable.
+
+ The exact details of how to force the linker to place functions in
+ a particular order is system dependent and out of the scope of this
+ manual.
+
+`-R MAP_FILE'
+`--file-ordering MAP_FILE'
+ The `--file-ordering' option causes `gprof' to print a suggested
+ .o link line ordering for the program based on profiling data.
+ This option suggests an ordering which may improve paging, tlb and
+ cache behavior for the program on systems which do not support
+ arbitrary ordering of functions in an executable.
+
+ Use of the `-a' argument is highly recommended with this option.
+
+ The MAP_FILE argument is a pathname to a file which provides
+ function name to object file mappings. The format of the file is
+ similar to the output of the program `nm'.
+
+ c-parse.o:00000000 T yyparse
+ c-parse.o:00000004 C yyerrflag
+ c-lang.o:00000000 T maybe_objc_method_name
+ c-lang.o:00000000 T print_lang_statistics
+ c-lang.o:00000000 T recognize_objc_keyword
+ c-decl.o:00000000 T print_lang_identifier
+ c-decl.o:00000000 T print_lang_type
+ ...
+
+ To create a MAP_FILE with GNU `nm', type a command like `nm
+ --extern-only --defined-only -v --print-file-name program-name'.
+
+`-T'
+`--traditional'
+ The `-T' option causes `gprof' to print its output in
+ "traditional" BSD style.
+
+`-w WIDTH'
+`--width=WIDTH'
+ Sets width of output lines to WIDTH. Currently only used when
+ printing the function index at the bottom of the call graph.
+
+`-x'
+`--all-lines'
+ This option affects annotated source output only. By default,
+ only the lines at the beginning of a basic-block are annotated.
+ If this option is specified, every line in a basic-block is
+ annotated by repeating the annotation for the first line. This
+ behavior is similar to `tcov''s `-a'.
+
+`--demangle[=STYLE]'
+`--no-demangle'
+ These options control whether C++ symbol names should be demangled
+ when printing output. The default is to demangle symbols. The
+ `--no-demangle' option may be used to turn off demangling.
+ Different compilers have different mangling styles. The optional
+ demangling style argument can be used to choose an appropriate
+ demangling style for your compiler.
+
+
+File: gprof.info, Node: Analysis Options, Next: Miscellaneous Options, Prev: Output Options, Up: Invoking
+
+4.2 Analysis Options
+====================
+
+`-a'
+`--no-static'
+ The `-a' option causes `gprof' to suppress the printing of
+ statically declared (private) functions. (These are functions
+ whose names are not listed as global, and which are not visible
+ outside the file/function/block where they were defined.) Time
+ spent in these functions, calls to/from them, etc., will all be
+ attributed to the function that was loaded directly before it in
+ the executable file. This option affects both the flat profile
+ and the call graph.
+
+`-c'
+`--static-call-graph'
+ The `-c' option causes the call graph of the program to be
+ augmented by a heuristic which examines the text space of the
+ object file and identifies function calls in the binary machine
+ code. Since normal call graph records are only generated when
+ functions are entered, this option identifies children that could
+ have been called, but never were. Calls to functions that were
+ not compiled with profiling enabled are also identified, but only
+ if symbol table entries are present for them. Calls to dynamic
+ library routines are typically _not_ found by this option.
+ Parents or children identified via this heuristic are indicated in
+ the call graph with call counts of `0'.
+
+`-D'
+`--ignore-non-functions'
+ The `-D' option causes `gprof' to ignore symbols which are not
+ known to be functions. This option will give more accurate
+ profile data on systems where it is supported (Solaris and HPUX for
+ example).
+
+`-k FROM/TO'
+ The `-k' option allows you to delete from the call graph any arcs
+ from symbols matching symspec FROM to those matching symspec TO.
+
+`-l'
+`--line'
+ The `-l' option enables line-by-line profiling, which causes
+ histogram hits to be charged to individual source code lines,
+ instead of functions. This feature only works with programs
+ compiled by older versions of the `gcc' compiler. Newer versions
+ of `gcc' are designed to work with the `gcov' tool instead.
+
+ If the program was compiled with basic-block counting enabled,
+ this option will also identify how many times each line of code
+ was executed. While line-by-line profiling can help isolate where
+ in a large function a program is spending its time, it also
+ significantly increases the running time of `gprof', and magnifies
+ statistical inaccuracies. *Note Statistical Sampling Error:
+ Sampling Error.
+
+`-m NUM'
+`--min-count=NUM'
+ This option affects execution count output only. Symbols that are
+ executed less than NUM times are suppressed.
+
+`-nSYMSPEC'
+`--time=SYMSPEC'
+ The `-n' option causes `gprof', in its call graph analysis, to
+ only propagate times for symbols matching SYMSPEC.
+
+`-NSYMSPEC'
+`--no-time=SYMSPEC'
+ The `-n' option causes `gprof', in its call graph analysis, not to
+ propagate times for symbols matching SYMSPEC.
+
+`-SFILENAME'
+`--external-symbol-table=FILENAME'
+ The `-S' option causes `gprof' to read an external symbol table
+ file, such as `/proc/kallsyms', rather than read the symbol table
+ from the given object file (the default is `a.out'). This is useful
+ for profiling kernel modules.
+
+`-z'
+`--display-unused-functions'
+ If you give the `-z' option, `gprof' will mention all functions in
+ the flat profile, even those that were never called, and that had
+ no time spent in them. This is useful in conjunction with the
+ `-c' option for discovering which routines were never called.
+
+
+
+File: gprof.info, Node: Miscellaneous Options, Next: Deprecated Options, Prev: Analysis Options, Up: Invoking
+
+4.3 Miscellaneous Options
+=========================
+
+`-d[NUM]'
+`--debug[=NUM]'
+ The `-d NUM' option specifies debugging options. If NUM is not
+ specified, enable all debugging. *Note Debugging `gprof':
+ Debugging.
+
+`-h'
+`--help'
+ The `-h' option prints command line usage.
+
+`-ONAME'
+`--file-format=NAME'
+ Selects the format of the profile data files. Recognized formats
+ are `auto' (the default), `bsd', `4.4bsd', `magic', and `prof'
+ (not yet supported).
+
+`-s'
+`--sum'
+ The `-s' option causes `gprof' to summarize the information in the
+ profile data files it read in, and write out a profile data file
+ called `gmon.sum', which contains all the information from the
+ profile data files that `gprof' read in. The file `gmon.sum' may
+ be one of the specified input files; the effect of this is to
+ merge the data in the other input files into `gmon.sum'.
+
+ Eventually you can run `gprof' again without `-s' to analyze the
+ cumulative data in the file `gmon.sum'.
+
+`-v'
+`--version'
+ The `-v' flag causes `gprof' to print the current version number,
+ and then exit.
+
+
+
+File: gprof.info, Node: Deprecated Options, Next: Symspecs, Prev: Miscellaneous Options, Up: Invoking
+
+4.4 Deprecated Options
+======================
+
+ These options have been replaced with newer versions that use
+ symspecs.
+
+`-e FUNCTION_NAME'
+ The `-e FUNCTION' option tells `gprof' to not print information
+ about the function FUNCTION_NAME (and its children...) in the call
+ graph. The function will still be listed as a child of any
+ functions that call it, but its index number will be shown as
+ `[not printed]'. More than one `-e' option may be given; only one
+ FUNCTION_NAME may be indicated with each `-e' option.
+
+`-E FUNCTION_NAME'
+ The `-E FUNCTION' option works like the `-e' option, but time
+ spent in the function (and children who were not called from
+ anywhere else), will not be used to compute the
+ percentages-of-time for the call graph. More than one `-E' option
+ may be given; only one FUNCTION_NAME may be indicated with each
+ `-E' option.
+
+`-f FUNCTION_NAME'
+ The `-f FUNCTION' option causes `gprof' to limit the call graph to
+ the function FUNCTION_NAME and its children (and their
+ children...). More than one `-f' option may be given; only one
+ FUNCTION_NAME may be indicated with each `-f' option.
+
+`-F FUNCTION_NAME'
+ The `-F FUNCTION' option works like the `-f' option, but only time
+ spent in the function and its children (and their children...)
+ will be used to determine total-time and percentages-of-time for
+ the call graph. More than one `-F' option may be given; only one
+ FUNCTION_NAME may be indicated with each `-F' option. The `-F'
+ option overrides the `-E' option.
+
+
+ Note that only one function can be specified with each `-e', `-E',
+`-f' or `-F' option. To specify more than one function, use multiple
+options. For example, this command:
+
+ gprof -e boring -f foo -f bar myprogram > gprof.output
+
+lists in the call graph all functions that were reached from either
+`foo' or `bar' and were not reachable from `boring'.
+
+
+File: gprof.info, Node: Symspecs, Prev: Deprecated Options, Up: Invoking
+
+4.5 Symspecs
+============
+
+Many of the output options allow functions to be included or excluded
+using "symspecs" (symbol specifications), which observe the following
+syntax:
+
+ filename_containing_a_dot
+ | funcname_not_containing_a_dot
+ | linenumber
+ | ( [ any_filename ] `:' ( any_funcname | linenumber ) )
+
+ Here are some sample symspecs:
+
+`main.c'
+ Selects everything in file `main.c'--the dot in the string tells
+ `gprof' to interpret the string as a filename, rather than as a
+ function name. To select a file whose name does not contain a
+ dot, a trailing colon should be specified. For example, `odd:' is
+ interpreted as the file named `odd'.
+
+`main'
+ Selects all functions named `main'.
+
+ Note that there may be multiple instances of the same function name
+ because some of the definitions may be local (i.e., static).
+ Unless a function name is unique in a program, you must use the
+ colon notation explained below to specify a function from a
+ specific source file.
+
+ Sometimes, function names contain dots. In such cases, it is
+ necessary to add a leading colon to the name. For example,
+ `:.mul' selects function `.mul'.
+
+ In some object file formats, symbols have a leading underscore.
+ `gprof' will normally not print these underscores. When you name a
+ symbol in a symspec, you should type it exactly as `gprof' prints
+ it in its output. For example, if the compiler produces a symbol
+ `_main' from your `main' function, `gprof' still prints it as
+ `main' in its output, so you should use `main' in symspecs.
+
+`main.c:main'
+ Selects function `main' in file `main.c'.
+
+`main.c:134'
+ Selects line 134 in file `main.c'.
+
+
+File: gprof.info, Node: Output, Next: Inaccuracy, Prev: Invoking, Up: Top
+
+5 Interpreting `gprof''s Output
+*******************************
+
+`gprof' can produce several different output styles, the most important
+of which are described below. The simplest output styles (file
+information, execution count, and function and file ordering) are not
+described here, but are documented with the respective options that
+trigger them. *Note Output Options: Output Options.
+
+* Menu:
+
+* Flat Profile:: The flat profile shows how much time was spent
+ executing directly in each function.
+* Call Graph:: The call graph shows which functions called which
+ others, and how much time each function used
+ when its subroutine calls are included.
+* Line-by-line:: `gprof' can analyze individual source code lines
+* Annotated Source:: The annotated source listing displays source code
+ labeled with execution counts
+
+
+File: gprof.info, Node: Flat Profile, Next: Call Graph, Up: Output
+
+5.1 The Flat Profile
+====================
+
+The "flat profile" shows the total amount of time your program spent
+executing each function. Unless the `-z' option is given, functions
+with no apparent time spent in them, and no apparent calls to them, are
+not mentioned. Note that if a function was not compiled for profiling,
+and didn't run long enough to show up on the program counter histogram,
+it will be indistinguishable from a function that was never called.
+
+ This is part of a flat profile for a small program:
+
+ Flat profile:
+
+ Each sample counts as 0.01 seconds.
+ % cumulative self self total
+ time seconds seconds calls ms/call ms/call name
+ 33.34 0.02 0.02 7208 0.00 0.00 open
+ 16.67 0.03 0.01 244 0.04 0.12 offtime
+ 16.67 0.04 0.01 8 1.25 1.25 memccpy
+ 16.67 0.05 0.01 7 1.43 1.43 write
+ 16.67 0.06 0.01 mcount
+ 0.00 0.06 0.00 236 0.00 0.00 tzset
+ 0.00 0.06 0.00 192 0.00 0.00 tolower
+ 0.00 0.06 0.00 47 0.00 0.00 strlen
+ 0.00 0.06 0.00 45 0.00 0.00 strchr
+ 0.00 0.06 0.00 1 0.00 50.00 main
+ 0.00 0.06 0.00 1 0.00 0.00 memcpy
+ 0.00 0.06 0.00 1 0.00 10.11 print
+ 0.00 0.06 0.00 1 0.00 0.00 profil
+ 0.00 0.06 0.00 1 0.00 50.00 report
+ ...
+
+The functions are sorted first by decreasing run-time spent in them,
+then by decreasing number of calls, then alphabetically by name. The
+functions `mcount' and `profil' are part of the profiling apparatus and
+appear in every flat profile; their time gives a measure of the amount
+of overhead due to profiling.
+
+ Just before the column headers, a statement appears indicating how
+much time each sample counted as. This "sampling period" estimates the
+margin of error in each of the time figures. A time figure that is not
+much larger than this is not reliable. In this example, each sample
+counted as 0.01 seconds, suggesting a 100 Hz sampling rate. The
+program's total execution time was 0.06 seconds, as indicated by the
+`cumulative seconds' field. Since each sample counted for 0.01
+seconds, this means only six samples were taken during the run. Two of
+the samples occurred while the program was in the `open' function, as
+indicated by the `self seconds' field. Each of the other four samples
+occurred one each in `offtime', `memccpy', `write', and `mcount'.
+Since only six samples were taken, none of these values can be regarded
+as particularly reliable. In another run, the `self seconds' field for
+`mcount' might well be `0.00' or `0.02'. *Note Statistical Sampling
+Error: Sampling Error, for a complete discussion.
+
+ The remaining functions in the listing (those whose `self seconds'
+field is `0.00') didn't appear in the histogram samples at all.
+However, the call graph indicated that they were called, so therefore
+they are listed, sorted in decreasing order by the `calls' field.
+Clearly some time was spent executing these functions, but the paucity
+of histogram samples prevents any determination of how much time each
+took.
+
+ Here is what the fields in each line mean:
+
+`% time'
+ This is the percentage of the total execution time your program
+ spent in this function. These should all add up to 100%.
+
+`cumulative seconds'
+ This is the cumulative total number of seconds the computer spent
+ executing this functions, plus the time spent in all the functions
+ above this one in this table.
+
+`self seconds'
+ This is the number of seconds accounted for by this function alone.
+ The flat profile listing is sorted first by this number.
+
+`calls'
+ This is the total number of times the function was called. If the
+ function was never called, or the number of times it was called
+ cannot be determined (probably because the function was not
+ compiled with profiling enabled), the "calls" field is blank.
+
+`self ms/call'
+ This represents the average number of milliseconds spent in this
+ function per call, if this function is profiled. Otherwise, this
+ field is blank for this function.
+
+`total ms/call'
+ This represents the average number of milliseconds spent in this
+ function and its descendants per call, if this function is
+ profiled. Otherwise, this field is blank for this function. This
+ is the only field in the flat profile that uses call graph
+ analysis.
+
+`name'
+ This is the name of the function. The flat profile is sorted by
+ this field alphabetically after the "self seconds" and "calls"
+ fields are sorted.
+
+
+File: gprof.info, Node: Call Graph, Next: Line-by-line, Prev: Flat Profile, Up: Output
+
+5.2 The Call Graph
+==================
+
+The "call graph" shows how much time was spent in each function and its
+children. From this information, you can find functions that, while
+they themselves may not have used much time, called other functions
+that did use unusual amounts of time.
+
+ Here is a sample call from a small program. This call came from the
+same `gprof' run as the flat profile example in the previous section.
+
+ granularity: each sample hit covers 2 byte(s) for 20.00% of 0.05 seconds
+
+ index % time self children called name
+ <spontaneous>
+ [1] 100.0 0.00 0.05 start [1]
+ 0.00 0.05 1/1 main [2]
+ 0.00 0.00 1/2 on_exit [28]
+ 0.00 0.00 1/1 exit [59]
+ -----------------------------------------------
+ 0.00 0.05 1/1 start [1]
+ [2] 100.0 0.00 0.05 1 main [2]
+ 0.00 0.05 1/1 report [3]
+ -----------------------------------------------
+ 0.00 0.05 1/1 main [2]
+ [3] 100.0 0.00 0.05 1 report [3]
+ 0.00 0.03 8/8 timelocal [6]
+ 0.00 0.01 1/1 print [9]
+ 0.00 0.01 9/9 fgets [12]
+ 0.00 0.00 12/34 strncmp <cycle 1> [40]
+ 0.00 0.00 8/8 lookup [20]
+ 0.00 0.00 1/1 fopen [21]
+ 0.00 0.00 8/8 chewtime [24]
+ 0.00 0.00 8/16 skipspace [44]
+ -----------------------------------------------
+ [4] 59.8 0.01 0.02 8+472 <cycle 2 as a whole> [4]
+ 0.01 0.02 244+260 offtime <cycle 2> [7]
+ 0.00 0.00 236+1 tzset <cycle 2> [26]
+ -----------------------------------------------
+
+ The lines full of dashes divide this table into "entries", one for
+each function. Each entry has one or more lines.
+
+ In each entry, the primary line is the one that starts with an index
+number in square brackets. The end of this line says which function
+the entry is for. The preceding lines in the entry describe the
+callers of this function and the following lines describe its
+subroutines (also called "children" when we speak of the call graph).
+
+ The entries are sorted by time spent in the function and its
+subroutines.
+
+ The internal profiling function `mcount' (*note The Flat Profile:
+Flat Profile.) is never mentioned in the call graph.
+
+* Menu:
+
+* Primary:: Details of the primary line's contents.
+* Callers:: Details of caller-lines' contents.
+* Subroutines:: Details of subroutine-lines' contents.
+* Cycles:: When there are cycles of recursion,
+ such as `a' calls `b' calls `a'...
+
+
+File: gprof.info, Node: Primary, Next: Callers, Up: Call Graph
+
+5.2.1 The Primary Line
+----------------------
+
+The "primary line" in a call graph entry is the line that describes the
+function which the entry is about and gives the overall statistics for
+this function.
+
+ For reference, we repeat the primary line from the entry for function
+`report' in our main example, together with the heading line that shows
+the names of the fields:
+
+ index % time self children called name
+ ...
+ [3] 100.0 0.00 0.05 1 report [3]
+
+ Here is what the fields in the primary line mean:
+
+`index'
+ Entries are numbered with consecutive integers. Each function
+ therefore has an index number, which appears at the beginning of
+ its primary line.
+
+ Each cross-reference to a function, as a caller or subroutine of
+ another, gives its index number as well as its name. The index
+ number guides you if you wish to look for the entry for that
+ function.
+
+`% time'
+ This is the percentage of the total time that was spent in this
+ function, including time spent in subroutines called from this
+ function.
+
+ The time spent in this function is counted again for the callers of
+ this function. Therefore, adding up these percentages is
+ meaningless.
+
+`self'
+ This is the total amount of time spent in this function. This
+ should be identical to the number printed in the `seconds' field
+ for this function in the flat profile.
+
+`children'
+ This is the total amount of time spent in the subroutine calls
+ made by this function. This should be equal to the sum of all the
+ `self' and `children' entries of the children listed directly
+ below this function.
+
+`called'
+ This is the number of times the function was called.
+
+ If the function called itself recursively, there are two numbers,
+ separated by a `+'. The first number counts non-recursive calls,
+ and the second counts recursive calls.
+
+ In the example above, the function `report' was called once from
+ `main'.
+
+`name'
+ This is the name of the current function. The index number is
+ repeated after it.
+
+ If the function is part of a cycle of recursion, the cycle number
+ is printed between the function's name and the index number (*note
+ How Mutually Recursive Functions Are Described: Cycles.). For
+ example, if function `gnurr' is part of cycle number one, and has
+ index number twelve, its primary line would be end like this:
+
+ gnurr <cycle 1> [12]
+
+
+File: gprof.info, Node: Callers, Next: Subroutines, Prev: Primary, Up: Call Graph
+
+5.2.2 Lines for a Function's Callers
+------------------------------------
+
+A function's entry has a line for each function it was called by.
+These lines' fields correspond to the fields of the primary line, but
+their meanings are different because of the difference in context.
+
+ For reference, we repeat two lines from the entry for the function
+`report', the primary line and one caller-line preceding it, together
+with the heading line that shows the names of the fields:
+
+ index % time self children called name
+ ...
+ 0.00 0.05 1/1 main [2]
+ [3] 100.0 0.00 0.05 1 report [3]
+
+ Here are the meanings of the fields in the caller-line for `report'
+called from `main':
+
+`self'
+ An estimate of the amount of time spent in `report' itself when it
+ was called from `main'.
+
+`children'
+ An estimate of the amount of time spent in subroutines of `report'
+ when `report' was called from `main'.
+
+ The sum of the `self' and `children' fields is an estimate of the
+ amount of time spent within calls to `report' from `main'.
+
+`called'
+ Two numbers: the number of times `report' was called from `main',
+ followed by the total number of non-recursive calls to `report'
+ from all its callers.
+
+`name and index number'
+ The name of the caller of `report' to which this line applies,
+ followed by the caller's index number.
+
+ Not all functions have entries in the call graph; some options to
+ `gprof' request the omission of certain functions. When a caller
+ has no entry of its own, it still has caller-lines in the entries
+ of the functions it calls.
+
+ If the caller is part of a recursion cycle, the cycle number is
+ printed between the name and the index number.
+
+ If the identity of the callers of a function cannot be determined, a
+dummy caller-line is printed which has `<spontaneous>' as the "caller's
+name" and all other fields blank. This can happen for signal handlers.
+
+
+File: gprof.info, Node: Subroutines, Next: Cycles, Prev: Callers, Up: Call Graph
+
+5.2.3 Lines for a Function's Subroutines
+----------------------------------------
+
+A function's entry has a line for each of its subroutines--in other
+words, a line for each other function that it called. These lines'
+fields correspond to the fields of the primary line, but their meanings
+are different because of the difference in context.
+
+ For reference, we repeat two lines from the entry for the function
+`main', the primary line and a line for a subroutine, together with the
+heading line that shows the names of the fields:
+
+ index % time self children called name
+ ...
+ [2] 100.0 0.00 0.05 1 main [2]
+ 0.00 0.05 1/1 report [3]
+
+ Here are the meanings of the fields in the subroutine-line for `main'
+calling `report':
+
+`self'
+ An estimate of the amount of time spent directly within `report'
+ when `report' was called from `main'.
+
+`children'
+ An estimate of the amount of time spent in subroutines of `report'
+ when `report' was called from `main'.
+
+ The sum of the `self' and `children' fields is an estimate of the
+ total time spent in calls to `report' from `main'.
+
+`called'
+ Two numbers, the number of calls to `report' from `main' followed
+ by the total number of non-recursive calls to `report'. This
+ ratio is used to determine how much of `report''s `self' and
+ `children' time gets credited to `main'. *Note Estimating
+ `children' Times: Assumptions.
+
+`name'
+ The name of the subroutine of `main' to which this line applies,
+ followed by the subroutine's index number.
+
+ If the caller is part of a recursion cycle, the cycle number is
+ printed between the name and the index number.
+
+
+File: gprof.info, Node: Cycles, Prev: Subroutines, Up: Call Graph
+
+5.2.4 How Mutually Recursive Functions Are Described
+----------------------------------------------------
+
+The graph may be complicated by the presence of "cycles of recursion"
+in the call graph. A cycle exists if a function calls another function
+that (directly or indirectly) calls (or appears to call) the original
+function. For example: if `a' calls `b', and `b' calls `a', then `a'
+and `b' form a cycle.
+
+ Whenever there are call paths both ways between a pair of functions,
+they belong to the same cycle. If `a' and `b' call each other and `b'
+and `c' call each other, all three make one cycle. Note that even if
+`b' only calls `a' if it was not called from `a', `gprof' cannot
+determine this, so `a' and `b' are still considered a cycle.
+
+ The cycles are numbered with consecutive integers. When a function
+belongs to a cycle, each time the function name appears in the call
+graph it is followed by `<cycle NUMBER>'.
+
+ The reason cycles matter is that they make the time values in the
+call graph paradoxical. The "time spent in children" of `a' should
+include the time spent in its subroutine `b' and in `b''s
+subroutines--but one of `b''s subroutines is `a'! How much of `a''s
+time should be included in the children of `a', when `a' is indirectly
+recursive?
+
+ The way `gprof' resolves this paradox is by creating a single entry
+for the cycle as a whole. The primary line of this entry describes the
+total time spent directly in the functions of the cycle. The
+"subroutines" of the cycle are the individual functions of the cycle,
+and all other functions that were called directly by them. The
+"callers" of the cycle are the functions, outside the cycle, that
+called functions in the cycle.
+
+ Here is an example portion of a call graph which shows a cycle
+containing functions `a' and `b'. The cycle was entered by a call to
+`a' from `main'; both `a' and `b' called `c'.
+
+ index % time self children called name
+ ----------------------------------------
+ 1.77 0 1/1 main [2]
+ [3] 91.71 1.77 0 1+5 <cycle 1 as a whole> [3]
+ 1.02 0 3 b <cycle 1> [4]
+ 0.75 0 2 a <cycle 1> [5]
+ ----------------------------------------
+ 3 a <cycle 1> [5]
+ [4] 52.85 1.02 0 0 b <cycle 1> [4]
+ 2 a <cycle 1> [5]
+ 0 0 3/6 c [6]
+ ----------------------------------------
+ 1.77 0 1/1 main [2]
+ 2 b <cycle 1> [4]
+ [5] 38.86 0.75 0 1 a <cycle 1> [5]
+ 3 b <cycle 1> [4]
+ 0 0 3/6 c [6]
+ ----------------------------------------
+
+(The entire call graph for this program contains in addition an entry
+for `main', which calls `a', and an entry for `c', with callers `a' and
+`b'.)
+
+ index % time self children called name
+ <spontaneous>
+ [1] 100.00 0 1.93 0 start [1]
+ 0.16 1.77 1/1 main [2]
+ ----------------------------------------
+ 0.16 1.77 1/1 start [1]
+ [2] 100.00 0.16 1.77 1 main [2]
+ 1.77 0 1/1 a <cycle 1> [5]
+ ----------------------------------------
+ 1.77 0 1/1 main [2]
+ [3] 91.71 1.77 0 1+5 <cycle 1 as a whole> [3]
+ 1.02 0 3 b <cycle 1> [4]
+ 0.75 0 2 a <cycle 1> [5]
+ 0 0 6/6 c [6]
+ ----------------------------------------
+ 3 a <cycle 1> [5]
+ [4] 52.85 1.02 0 0 b <cycle 1> [4]
+ 2 a <cycle 1> [5]
+ 0 0 3/6 c [6]
+ ----------------------------------------
+ 1.77 0 1/1 main [2]
+ 2 b <cycle 1> [4]
+ [5] 38.86 0.75 0 1 a <cycle 1> [5]
+ 3 b <cycle 1> [4]
+ 0 0 3/6 c [6]
+ ----------------------------------------
+ 0 0 3/6 b <cycle 1> [4]
+ 0 0 3/6 a <cycle 1> [5]
+ [6] 0.00 0 0 6 c [6]
+ ----------------------------------------
+
+ The `self' field of the cycle's primary line is the total time spent
+in all the functions of the cycle. It equals the sum of the `self'
+fields for the individual functions in the cycle, found in the entry in
+the subroutine lines for these functions.
+
+ The `children' fields of the cycle's primary line and subroutine
+lines count only subroutines outside the cycle. Even though `a' calls
+`b', the time spent in those calls to `b' is not counted in `a''s
+`children' time. Thus, we do not encounter the problem of what to do
+when the time in those calls to `b' includes indirect recursive calls
+back to `a'.
+
+ The `children' field of a caller-line in the cycle's entry estimates
+the amount of time spent _in the whole cycle_, and its other
+subroutines, on the times when that caller called a function in the
+cycle.
+
+ The `called' field in the primary line for the cycle has two numbers:
+first, the number of times functions in the cycle were called by
+functions outside the cycle; second, the number of times they were
+called by functions in the cycle (including times when a function in
+the cycle calls itself). This is a generalization of the usual split
+into non-recursive and recursive calls.
+
+ The `called' field of a subroutine-line for a cycle member in the
+cycle's entry says how many time that function was called from
+functions in the cycle. The total of all these is the second number in
+the primary line's `called' field.
+
+ In the individual entry for a function in a cycle, the other
+functions in the same cycle can appear as subroutines and as callers.
+These lines show how many times each function in the cycle called or
+was called from each other function in the cycle. The `self' and
+`children' fields in these lines are blank because of the difficulty of
+defining meanings for them when recursion is going on.
+
+
+File: gprof.info, Node: Line-by-line, Next: Annotated Source, Prev: Call Graph, Up: Output
+
+5.3 Line-by-line Profiling
+==========================
+
+`gprof''s `-l' option causes the program to perform "line-by-line"
+profiling. In this mode, histogram samples are assigned not to
+functions, but to individual lines of source code. This only works
+with programs compiled with older versions of the `gcc' compiler.
+Newer versions of `gcc' use a different program - `gcov' - to display
+line-by-line profiling information.
+
+ With the older versions of `gcc' the program usually has to be
+compiled with a `-g' option, in addition to `-pg', in order to generate
+debugging symbols for tracking source code lines. Note, in much older
+versions of `gcc' the program had to be compiled with the `-a' command
+line option as well.
+
+ The flat profile is the most useful output table in line-by-line
+mode. The call graph isn't as useful as normal, since the current
+version of `gprof' does not propagate call graph arcs from source code
+lines to the enclosing function. The call graph does, however, show
+each line of code that called each function, along with a count.
+
+ Here is a section of `gprof''s output, without line-by-line
+profiling. Note that `ct_init' accounted for four histogram hits, and
+13327 calls to `init_block'.
+
+ Flat profile:
+
+ Each sample counts as 0.01 seconds.
+ % cumulative self self total
+ time seconds seconds calls us/call us/call name
+ 30.77 0.13 0.04 6335 6.31 6.31 ct_init
+
+
+ Call graph (explanation follows)
+
+
+ granularity: each sample hit covers 4 byte(s) for 7.69% of 0.13 seconds
+
+ index % time self children called name
+
+ 0.00 0.00 1/13496 name_too_long
+ 0.00 0.00 40/13496 deflate
+ 0.00 0.00 128/13496 deflate_fast
+ 0.00 0.00 13327/13496 ct_init
+ [7] 0.0 0.00 0.00 13496 init_block
+
+ Now let's look at some of `gprof''s output from the same program run,
+this time with line-by-line profiling enabled. Note that `ct_init''s
+four histogram hits are broken down into four lines of source code--one
+hit occurred on each of lines 349, 351, 382 and 385. In the call graph,
+note how `ct_init''s 13327 calls to `init_block' are broken down into
+one call from line 396, 3071 calls from line 384, 3730 calls from line
+385, and 6525 calls from 387.
+
+ Flat profile:
+
+ Each sample counts as 0.01 seconds.
+ % cumulative self
+ time seconds seconds calls name
+ 7.69 0.10 0.01 ct_init (trees.c:349)
+ 7.69 0.11 0.01 ct_init (trees.c:351)
+ 7.69 0.12 0.01 ct_init (trees.c:382)
+ 7.69 0.13 0.01 ct_init (trees.c:385)
+
+
+ Call graph (explanation follows)
+
+
+ granularity: each sample hit covers 4 byte(s) for 7.69% of 0.13 seconds
+
+ % time self children called name
+
+ 0.00 0.00 1/13496 name_too_long (gzip.c:1440)
+ 0.00 0.00 1/13496 deflate (deflate.c:763)
+ 0.00 0.00 1/13496 ct_init (trees.c:396)
+ 0.00 0.00 2/13496 deflate (deflate.c:727)
+ 0.00 0.00 4/13496 deflate (deflate.c:686)
+ 0.00 0.00 5/13496 deflate (deflate.c:675)
+ 0.00 0.00 12/13496 deflate (deflate.c:679)
+ 0.00 0.00 16/13496 deflate (deflate.c:730)
+ 0.00 0.00 128/13496 deflate_fast (deflate.c:654)
+ 0.00 0.00 3071/13496 ct_init (trees.c:384)
+ 0.00 0.00 3730/13496 ct_init (trees.c:385)
+ 0.00 0.00 6525/13496 ct_init (trees.c:387)
+ [6] 0.0 0.00 0.00 13496 init_block (trees.c:408)
+
+
+File: gprof.info, Node: Annotated Source, Prev: Line-by-line, Up: Output
+
+5.4 The Annotated Source Listing
+================================
+
+`gprof''s `-A' option triggers an annotated source listing, which lists
+the program's source code, each function labeled with the number of
+times it was called. You may also need to specify the `-I' option, if
+`gprof' can't find the source code files.
+
+ With older versions of `gcc' compiling with `gcc ... -g -pg -a'
+augments your program with basic-block counting code, in addition to
+function counting code. This enables `gprof' to determine how many
+times each line of code was executed. With newer versions of `gcc'
+support for displaying basic-block counts is provided by the `gcov'
+program.
+
+ For example, consider the following function, taken from gzip, with
+line numbers added:
+
+ 1 ulg updcrc(s, n)
+ 2 uch *s;
+ 3 unsigned n;
+ 4 {
+ 5 register ulg c;
+ 6
+ 7 static ulg crc = (ulg)0xffffffffL;
+ 8
+ 9 if (s == NULL) {
+ 10 c = 0xffffffffL;
+ 11 } else {
+ 12 c = crc;
+ 13 if (n) do {
+ 14 c = crc_32_tab[...];
+ 15 } while (--n);
+ 16 }
+ 17 crc = c;
+ 18 return c ^ 0xffffffffL;
+ 19 }
+
+ `updcrc' has at least five basic-blocks. One is the function
+itself. The `if' statement on line 9 generates two more basic-blocks,
+one for each branch of the `if'. A fourth basic-block results from the
+`if' on line 13, and the contents of the `do' loop form the fifth
+basic-block. The compiler may also generate additional basic-blocks to
+handle various special cases.
+
+ A program augmented for basic-block counting can be analyzed with
+`gprof -l -A'. The `-x' option is also helpful, to ensure that each
+line of code is labeled at least once. Here is `updcrc''s annotated
+source listing for a sample `gzip' run:
+
+ ulg updcrc(s, n)
+ uch *s;
+ unsigned n;
+ 2 ->{
+ register ulg c;
+
+ static ulg crc = (ulg)0xffffffffL;
+
+ 2 -> if (s == NULL) {
+ 1 -> c = 0xffffffffL;
+ 1 -> } else {
+ 1 -> c = crc;
+ 1 -> if (n) do {
+ 26312 -> c = crc_32_tab[...];
+ 26312,1,26311 -> } while (--n);
+ }
+ 2 -> crc = c;
+ 2 -> return c ^ 0xffffffffL;
+ 2 ->}
+
+ In this example, the function was called twice, passing once through
+each branch of the `if' statement. The body of the `do' loop was
+executed a total of 26312 times. Note how the `while' statement is
+annotated. It began execution 26312 times, once for each iteration
+through the loop. One of those times (the last time) it exited, while
+it branched back to the beginning of the loop 26311 times.
+
+
+File: gprof.info, Node: Inaccuracy, Next: How do I?, Prev: Output, Up: Top
+
+6 Inaccuracy of `gprof' Output
+******************************
+
+* Menu:
+
+* Sampling Error:: Statistical margins of error
+* Assumptions:: Estimating children times
+
+
+File: gprof.info, Node: Sampling Error, Next: Assumptions, Up: Inaccuracy
+
+6.1 Statistical Sampling Error
+==============================
+
+The run-time figures that `gprof' gives you are based on a sampling
+process, so they are subject to statistical inaccuracy. If a function
+runs only a small amount of time, so that on the average the sampling
+process ought to catch that function in the act only once, there is a
+pretty good chance it will actually find that function zero times, or
+twice.
+
+ By contrast, the number-of-calls and basic-block figures are derived
+by counting, not sampling. They are completely accurate and will not
+vary from run to run if your program is deterministic.
+
+ The "sampling period" that is printed at the beginning of the flat
+profile says how often samples are taken. The rule of thumb is that a
+run-time figure is accurate if it is considerably bigger than the
+sampling period.
+
+ The actual amount of error can be predicted. For N samples, the
+_expected_ error is the square-root of N. For example, if the sampling
+period is 0.01 seconds and `foo''s run-time is 1 second, N is 100
+samples (1 second/0.01 seconds), sqrt(N) is 10 samples, so the expected
+error in `foo''s run-time is 0.1 seconds (10*0.01 seconds), or ten
+percent of the observed value. Again, if the sampling period is 0.01
+seconds and `bar''s run-time is 100 seconds, N is 10000 samples,
+sqrt(N) is 100 samples, so the expected error in `bar''s run-time is 1
+second, or one percent of the observed value. It is likely to vary
+this much _on the average_ from one profiling run to the next.
+(_Sometimes_ it will vary more.)
+
+ This does not mean that a small run-time figure is devoid of
+information. If the program's _total_ run-time is large, a small
+run-time for one function does tell you that that function used an
+insignificant fraction of the whole program's time. Usually this means
+it is not worth optimizing.
+
+ One way to get more accuracy is to give your program more (but
+similar) input data so it will take longer. Another way is to combine
+the data from several runs, using the `-s' option of `gprof'. Here is
+how:
+
+ 1. Run your program once.
+
+ 2. Issue the command `mv gmon.out gmon.sum'.
+
+ 3. Run your program again, the same as before.
+
+ 4. Merge the new data in `gmon.out' into `gmon.sum' with this command:
+
+ gprof -s EXECUTABLE-FILE gmon.out gmon.sum
+
+ 5. Repeat the last two steps as often as you wish.
+
+ 6. Analyze the cumulative data using this command:
+
+ gprof EXECUTABLE-FILE gmon.sum > OUTPUT-FILE
+
+
+File: gprof.info, Node: Assumptions, Prev: Sampling Error, Up: Inaccuracy
+
+6.2 Estimating `children' Times
+===============================
+
+Some of the figures in the call graph are estimates--for example, the
+`children' time values and all the time figures in caller and
+subroutine lines.
+
+ There is no direct information about these measurements in the
+profile data itself. Instead, `gprof' estimates them by making an
+assumption about your program that might or might not be true.
+
+ The assumption made is that the average time spent in each call to
+any function `foo' is not correlated with who called `foo'. If `foo'
+used 5 seconds in all, and 2/5 of the calls to `foo' came from `a',
+then `foo' contributes 2 seconds to `a''s `children' time, by
+assumption.
+
+ This assumption is usually true enough, but for some programs it is
+far from true. Suppose that `foo' returns very quickly when its
+argument is zero; suppose that `a' always passes zero as an argument,
+while other callers of `foo' pass other arguments. In this program,
+all the time spent in `foo' is in the calls from callers other than `a'.
+But `gprof' has no way of knowing this; it will blindly and incorrectly
+charge 2 seconds of time in `foo' to the children of `a'.
+
+ We hope some day to put more complete data into `gmon.out', so that
+this assumption is no longer needed, if we can figure out how. For the
+novice, the estimated figures are usually more useful than misleading.
+
+
+File: gprof.info, Node: How do I?, Next: Incompatibilities, Prev: Inaccuracy, Up: Top
+
+7 Answers to Common Questions
+*****************************
+
+How can I get more exact information about hot spots in my program?
+ Looking at the per-line call counts only tells part of the story.
+ Because `gprof' can only report call times and counts by function,
+ the best way to get finer-grained information on where the program
+ is spending its time is to re-factor large functions into sequences
+ of calls to smaller ones. Beware however that this can introduce
+ artificial hot spots since compiling with `-pg' adds a significant
+ overhead to function calls. An alternative solution is to use a
+ non-intrusive profiler, e.g. oprofile.
+
+How do I find which lines in my program were executed the most times?
+ Use the `gcov' program.
+
+How do I find which lines in my program called a particular function?
+ Use `gprof -l' and lookup the function in the call graph. The
+ callers will be broken down by function and line number.
+
+How do I analyze a program that runs for less than a second?
+ Try using a shell script like this one:
+
+ for i in `seq 1 100`; do
+ fastprog
+ mv gmon.out gmon.out.$i
+ done
+
+ gprof -s fastprog gmon.out.*
+
+ gprof fastprog gmon.sum
+
+ If your program is completely deterministic, all the call counts
+ will be simple multiples of 100 (i.e., a function called once in
+ each run will appear with a call count of 100).
+
+
+
+File: gprof.info, Node: Incompatibilities, Next: Details, Prev: How do I?, Up: Top
+
+8 Incompatibilities with Unix `gprof'
+*************************************
+
+GNU `gprof' and Berkeley Unix `gprof' use the same data file
+`gmon.out', and provide essentially the same information. But there
+are a few differences.
+
+ * GNU `gprof' uses a new, generalized file format with support for
+ basic-block execution counts and non-realtime histograms. A magic
+ cookie and version number allows `gprof' to easily identify new
+ style files. Old BSD-style files can still be read. *Note
+ Profiling Data File Format: File Format.
+
+ * For a recursive function, Unix `gprof' lists the function as a
+ parent and as a child, with a `calls' field that lists the number
+ of recursive calls. GNU `gprof' omits these lines and puts the
+ number of recursive calls in the primary line.
+
+ * When a function is suppressed from the call graph with `-e', GNU
+ `gprof' still lists it as a subroutine of functions that call it.
+
+ * GNU `gprof' accepts the `-k' with its argument in the form
+ `from/to', instead of `from to'.
+
+ * In the annotated source listing, if there are multiple basic
+ blocks on the same line, GNU `gprof' prints all of their counts,
+ separated by commas.
+
+ * The blurbs, field widths, and output formats are different. GNU
+ `gprof' prints blurbs after the tables, so that you can see the
+ tables without skipping the blurbs.
+
+
+File: gprof.info, Node: Details, Next: GNU Free Documentation License, Prev: Incompatibilities, Up: Top
+
+9 Details of Profiling
+**********************
+
+* Menu:
+
+* Implementation:: How a program collects profiling information
+* File Format:: Format of `gmon.out' files
+* Internals:: `gprof''s internal operation
+* Debugging:: Using `gprof''s `-d' option
+
+
+File: gprof.info, Node: Implementation, Next: File Format, Up: Details
+
+9.1 Implementation of Profiling
+===============================
+
+Profiling works by changing how every function in your program is
+compiled so that when it is called, it will stash away some information
+about where it was called from. From this, the profiler can figure out
+what function called it, and can count how many times it was called.
+This change is made by the compiler when your program is compiled with
+the `-pg' option, which causes every function to call `mcount' (or
+`_mcount', or `__mcount', depending on the OS and compiler) as one of
+its first operations.
+
+ The `mcount' routine, included in the profiling library, is
+responsible for recording in an in-memory call graph table both its
+parent routine (the child) and its parent's parent. This is typically
+done by examining the stack frame to find both the address of the
+child, and the return address in the original parent. Since this is a
+very machine-dependent operation, `mcount' itself is typically a short
+assembly-language stub routine that extracts the required information,
+and then calls `__mcount_internal' (a normal C function) with two
+arguments--`frompc' and `selfpc'. `__mcount_internal' is responsible
+for maintaining the in-memory call graph, which records `frompc',
+`selfpc', and the number of times each of these call arcs was traversed.
+
+ GCC Version 2 provides a magical function
+(`__builtin_return_address'), which allows a generic `mcount' function
+to extract the required information from the stack frame. However, on
+some architectures, most notably the SPARC, using this builtin can be
+very computationally expensive, and an assembly language version of
+`mcount' is used for performance reasons.
+
+ Number-of-calls information for library routines is collected by
+using a special version of the C library. The programs in it are the
+same as in the usual C library, but they were compiled with `-pg'. If
+you link your program with `gcc ... -pg', it automatically uses the
+profiling version of the library.
+
+ Profiling also involves watching your program as it runs, and
+keeping a histogram of where the program counter happens to be every
+now and then. Typically the program counter is looked at around 100
+times per second of run time, but the exact frequency may vary from
+system to system.
+
+ This is done is one of two ways. Most UNIX-like operating systems
+provide a `profil()' system call, which registers a memory array with
+the kernel, along with a scale factor that determines how the program's
+address space maps into the array. Typical scaling values cause every
+2 to 8 bytes of address space to map into a single array slot. On
+every tick of the system clock (assuming the profiled program is
+running), the value of the program counter is examined and the
+corresponding slot in the memory array is incremented. Since this is
+done in the kernel, which had to interrupt the process anyway to handle
+the clock interrupt, very little additional system overhead is required.
+
+ However, some operating systems, most notably Linux 2.0 (and
+earlier), do not provide a `profil()' system call. On such a system,
+arrangements are made for the kernel to periodically deliver a signal
+to the process (typically via `setitimer()'), which then performs the
+same operation of examining the program counter and incrementing a slot
+in the memory array. Since this method requires a signal to be
+delivered to user space every time a sample is taken, it uses
+considerably more overhead than kernel-based profiling. Also, due to
+the added delay required to deliver the signal, this method is less
+accurate as well.
+
+ A special startup routine allocates memory for the histogram and
+either calls `profil()' or sets up a clock signal handler. This
+routine (`monstartup') can be invoked in several ways. On Linux
+systems, a special profiling startup file `gcrt0.o', which invokes
+`monstartup' before `main', is used instead of the default `crt0.o'.
+Use of this special startup file is one of the effects of using `gcc
+... -pg' to link. On SPARC systems, no special startup files are used.
+Rather, the `mcount' routine, when it is invoked for the first time
+(typically when `main' is called), calls `monstartup'.
+
+ If the compiler's `-a' option was used, basic-block counting is also
+enabled. Each object file is then compiled with a static array of
+counts, initially zero. In the executable code, every time a new
+basic-block begins (i.e., when an `if' statement appears), an extra
+instruction is inserted to increment the corresponding count in the
+array. At compile time, a paired array was constructed that recorded
+the starting address of each basic-block. Taken together, the two
+arrays record the starting address of every basic-block, along with the
+number of times it was executed.
+
+ The profiling library also includes a function (`mcleanup') which is
+typically registered using `atexit()' to be called as the program
+exits, and is responsible for writing the file `gmon.out'. Profiling
+is turned off, various headers are output, and the histogram is
+written, followed by the call-graph arcs and the basic-block counts.
+
+ The output from `gprof' gives no indication of parts of your program
+that are limited by I/O or swapping bandwidth. This is because samples
+of the program counter are taken at fixed intervals of the program's
+run time. Therefore, the time measurements in `gprof' output say
+nothing about time that your program was not running. For example, a
+part of the program that creates so much data that it cannot all fit in
+physical memory at once may run very slowly due to thrashing, but
+`gprof' will say it uses little time. On the other hand, sampling by
+run time has the advantage that the amount of load due to other users
+won't directly affect the output you get.
+
+
+File: gprof.info, Node: File Format, Next: Internals, Prev: Implementation, Up: Details
+
+9.2 Profiling Data File Format
+==============================
+
+The old BSD-derived file format used for profile data does not contain a
+magic cookie that allows to check whether a data file really is a
+`gprof' file. Furthermore, it does not provide a version number, thus
+rendering changes to the file format almost impossible. GNU `gprof'
+uses a new file format that provides these features. For backward
+compatibility, GNU `gprof' continues to support the old BSD-derived
+format, but not all features are supported with it. For example,
+basic-block execution counts cannot be accommodated by the old file
+format.
+
+ The new file format is defined in header file `gmon_out.h'. It
+consists of a header containing the magic cookie and a version number,
+as well as some spare bytes available for future extensions. All data
+in a profile data file is in the native format of the target for which
+the profile was collected. GNU `gprof' adapts automatically to the
+byte-order in use.
+
+ In the new file format, the header is followed by a sequence of
+records. Currently, there are three different record types: histogram
+records, call-graph arc records, and basic-block execution count
+records. Each file can contain any number of each record type. When
+reading a file, GNU `gprof' will ensure records of the same type are
+compatible with each other and compute the union of all records. For
+example, for basic-block execution counts, the union is simply the sum
+of all execution counts for each basic-block.
+
+9.2.1 Histogram Records
+-----------------------
+
+Histogram records consist of a header that is followed by an array of
+bins. The header contains the text-segment range that the histogram
+spans, the size of the histogram in bytes (unlike in the old BSD
+format, this does not include the size of the header), the rate of the
+profiling clock, and the physical dimension that the bin counts
+represent after being scaled by the profiling clock rate. The physical
+dimension is specified in two parts: a long name of up to 15 characters
+and a single character abbreviation. For example, a histogram
+representing real-time would specify the long name as "seconds" and the
+abbreviation as "s". This feature is useful for architectures that
+support performance monitor hardware (which, fortunately, is becoming
+increasingly common). For example, under DEC OSF/1, the "uprofile"
+command can be used to produce a histogram of, say, instruction cache
+misses. In this case, the dimension in the histogram header could be
+set to "i-cache misses" and the abbreviation could be set to "1"
+(because it is simply a count, not a physical dimension). Also, the
+profiling rate would have to be set to 1 in this case.
+
+ Histogram bins are 16-bit numbers and each bin represent an equal
+amount of text-space. For example, if the text-segment is one thousand
+bytes long and if there are ten bins in the histogram, each bin
+represents one hundred bytes.
+
+9.2.2 Call-Graph Records
+------------------------
+
+Call-graph records have a format that is identical to the one used in
+the BSD-derived file format. It consists of an arc in the call graph
+and a count indicating the number of times the arc was traversed during
+program execution. Arcs are specified by a pair of addresses: the
+first must be within caller's function and the second must be within
+the callee's function. When performing profiling at the function
+level, these addresses can point anywhere within the respective
+function. However, when profiling at the line-level, it is better if
+the addresses are as close to the call-site/entry-point as possible.
+This will ensure that the line-level call-graph is able to identify
+exactly which line of source code performed calls to a function.
+
+9.2.3 Basic-Block Execution Count Records
+-----------------------------------------
+
+Basic-block execution count records consist of a header followed by a
+sequence of address/count pairs. The header simply specifies the
+length of the sequence. In an address/count pair, the address
+identifies a basic-block and the count specifies the number of times
+that basic-block was executed. Any address within the basic-address can
+be used.
+
+
+File: gprof.info, Node: Internals, Next: Debugging, Prev: File Format, Up: Details
+
+9.3 `gprof''s Internal Operation
+================================
+
+Like most programs, `gprof' begins by processing its options. During
+this stage, it may building its symspec list (`sym_ids.c:sym_id_add'),
+if options are specified which use symspecs. `gprof' maintains a
+single linked list of symspecs, which will eventually get turned into
+12 symbol tables, organized into six include/exclude pairs--one pair
+each for the flat profile (INCL_FLAT/EXCL_FLAT), the call graph arcs
+(INCL_ARCS/EXCL_ARCS), printing in the call graph
+(INCL_GRAPH/EXCL_GRAPH), timing propagation in the call graph
+(INCL_TIME/EXCL_TIME), the annotated source listing
+(INCL_ANNO/EXCL_ANNO), and the execution count listing
+(INCL_EXEC/EXCL_EXEC).
+
+ After option processing, `gprof' finishes building the symspec list
+by adding all the symspecs in `default_excluded_list' to the exclude
+lists EXCL_TIME and EXCL_GRAPH, and if line-by-line profiling is
+specified, EXCL_FLAT as well. These default excludes are not added to
+EXCL_ANNO, EXCL_ARCS, and EXCL_EXEC.
+
+ Next, the BFD library is called to open the object file, verify that
+it is an object file, and read its symbol table (`core.c:core_init'),
+using `bfd_canonicalize_symtab' after mallocing an appropriately sized
+array of symbols. At this point, function mappings are read (if the
+`--file-ordering' option has been specified), and the core text space
+is read into memory (if the `-c' option was given).
+
+ `gprof''s own symbol table, an array of Sym structures, is now built.
+This is done in one of two ways, by one of two routines, depending on
+whether line-by-line profiling (`-l' option) has been enabled. For
+normal profiling, the BFD canonical symbol table is scanned. For
+line-by-line profiling, every text space address is examined, and a new
+symbol table entry gets created every time the line number changes. In
+either case, two passes are made through the symbol table--one to count
+the size of the symbol table required, and the other to actually read
+the symbols. In between the two passes, a single array of type `Sym'
+is created of the appropriate length. Finally,
+`symtab.c:symtab_finalize' is called to sort the symbol table and
+remove duplicate entries (entries with the same memory address).
+
+ The symbol table must be a contiguous array for two reasons. First,
+the `qsort' library function (which sorts an array) will be used to
+sort the symbol table. Also, the symbol lookup routine
+(`symtab.c:sym_lookup'), which finds symbols based on memory address,
+uses a binary search algorithm which requires the symbol table to be a
+sorted array. Function symbols are indicated with an `is_func' flag.
+Line number symbols have no special flags set. Additionally, a symbol
+can have an `is_static' flag to indicate that it is a local symbol.
+
+ With the symbol table read, the symspecs can now be translated into
+Syms (`sym_ids.c:sym_id_parse'). Remember that a single symspec can
+match multiple symbols. An array of symbol tables (`syms') is created,
+each entry of which is a symbol table of Syms to be included or
+excluded from a particular listing. The master symbol table and the
+symspecs are examined by nested loops, and every symbol that matches a
+symspec is inserted into the appropriate syms table. This is done
+twice, once to count the size of each required symbol table, and again
+to build the tables, which have been malloced between passes. From now
+on, to determine whether a symbol is on an include or exclude symspec
+list, `gprof' simply uses its standard symbol lookup routine on the
+appropriate table in the `syms' array.
+
+ Now the profile data file(s) themselves are read
+(`gmon_io.c:gmon_out_read'), first by checking for a new-style
+`gmon.out' header, then assuming this is an old-style BSD `gmon.out' if
+the magic number test failed.
+
+ New-style histogram records are read by `hist.c:hist_read_rec'. For
+the first histogram record, allocate a memory array to hold all the
+bins, and read them in. When multiple profile data files (or files
+with multiple histogram records) are read, the memory ranges of each
+pair of histogram records must be either equal, or non-overlapping.
+For each pair of histogram records, the resolution (memory region size
+divided by the number of bins) must be the same. The time unit must be
+the same for all histogram records. If the above containts are met, all
+histograms for the same memory range are merged.
+
+ As each call graph record is read (`call_graph.c:cg_read_rec'), the
+parent and child addresses are matched to symbol table entries, and a
+call graph arc is created by `cg_arcs.c:arc_add', unless the arc fails
+a symspec check against INCL_ARCS/EXCL_ARCS. As each arc is added, a
+linked list is maintained of the parent's child arcs, and of the child's
+parent arcs. Both the child's call count and the arc's call count are
+incremented by the record's call count.
+
+ Basic-block records are read (`basic_blocks.c:bb_read_rec'), but
+only if line-by-line profiling has been selected. Each basic-block
+address is matched to a corresponding line symbol in the symbol table,
+and an entry made in the symbol's bb_addr and bb_calls arrays. Again,
+if multiple basic-block records are present for the same address, the
+call counts are cumulative.
+
+ A gmon.sum file is dumped, if requested (`gmon_io.c:gmon_out_write').
+
+ If histograms were present in the data files, assign them to symbols
+(`hist.c:hist_assign_samples') by iterating over all the sample bins
+and assigning them to symbols. Since the symbol table is sorted in
+order of ascending memory addresses, we can simple follow along in the
+symbol table as we make our pass over the sample bins. This step
+includes a symspec check against INCL_FLAT/EXCL_FLAT. Depending on the
+histogram scale factor, a sample bin may span multiple symbols, in
+which case a fraction of the sample count is allocated to each symbol,
+proportional to the degree of overlap. This effect is rare for normal
+profiling, but overlaps are more common during line-by-line profiling,
+and can cause each of two adjacent lines to be credited with half a
+hit, for example.
+
+ If call graph data is present, `cg_arcs.c:cg_assemble' is called.
+First, if `-c' was specified, a machine-dependent routine (`find_call')
+scans through each symbol's machine code, looking for subroutine call
+instructions, and adding them to the call graph with a zero call count.
+A topological sort is performed by depth-first numbering all the
+symbols (`cg_dfn.c:cg_dfn'), so that children are always numbered less
+than their parents, then making a array of pointers into the symbol
+table and sorting it into numerical order, which is reverse topological
+order (children appear before parents). Cycles are also detected at
+this point, all members of which are assigned the same topological
+number. Two passes are now made through this sorted array of symbol
+pointers. The first pass, from end to beginning (parents to children),
+computes the fraction of child time to propagate to each parent and a
+print flag. The print flag reflects symspec handling of
+INCL_GRAPH/EXCL_GRAPH, with a parent's include or exclude (print or no
+print) property being propagated to its children, unless they
+themselves explicitly appear in INCL_GRAPH or EXCL_GRAPH. A second
+pass, from beginning to end (children to parents) actually propagates
+the timings along the call graph, subject to a check against
+INCL_TIME/EXCL_TIME. With the print flag, fractions, and timings now
+stored in the symbol structures, the topological sort array is now
+discarded, and a new array of pointers is assembled, this time sorted
+by propagated time.
+
+ Finally, print the various outputs the user requested, which is now
+fairly straightforward. The call graph (`cg_print.c:cg_print') and
+flat profile (`hist.c:hist_print') are regurgitations of values already
+computed. The annotated source listing
+(`basic_blocks.c:print_annotated_source') uses basic-block information,
+if present, to label each line of code with call counts, otherwise only
+the function call counts are presented.
+
+ The function ordering code is marginally well documented in the
+source code itself (`cg_print.c'). Basically, the functions with the
+most use and the most parents are placed first, followed by other
+functions with the most use, followed by lower use functions, followed
+by unused functions at the end.
+
+
+File: gprof.info, Node: Debugging, Prev: Internals, Up: Details
+
+9.4 Debugging `gprof'
+=====================
+
+If `gprof' was compiled with debugging enabled, the `-d' option
+triggers debugging output (to stdout) which can be helpful in
+understanding its operation. The debugging number specified is
+interpreted as a sum of the following options:
+
+2 - Topological sort
+ Monitor depth-first numbering of symbols during call graph analysis
+
+4 - Cycles
+ Shows symbols as they are identified as cycle heads
+
+16 - Tallying
+ As the call graph arcs are read, show each arc and how the total
+ calls to each function are tallied
+
+32 - Call graph arc sorting
+ Details sorting individual parents/children within each call graph
+ entry
+
+64 - Reading histogram and call graph records
+ Shows address ranges of histograms as they are read, and each call
+ graph arc
+
+128 - Symbol table
+ Reading, classifying, and sorting the symbol table from the object
+ file. For line-by-line profiling (`-l' option), also shows line
+ numbers being assigned to memory addresses.
+
+256 - Static call graph
+ Trace operation of `-c' option
+
+512 - Symbol table and arc table lookups
+ Detail operation of lookup routines
+
+1024 - Call graph propagation
+ Shows how function times are propagated along the call graph
+
+2048 - Basic-blocks
+ Shows basic-block records as they are read from profile data (only
+ meaningful with `-l' option)
+
+4096 - Symspecs
+ Shows symspec-to-symbol pattern matching operation
+
+8192 - Annotate source
+ Tracks operation of `-A' option
+
+
+File: gprof.info, Node: GNU Free Documentation License, Prev: Details, Up: Top
+
+Appendix A GNU Free Documentation License
+*****************************************
+
+ Version 1.3, 3 November 2008
+
+ Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+ `http://fsf.org/'
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ 0. PREAMBLE
+
+ The purpose of this License is to make a manual, textbook, or other
+ functional and useful document "free" in the sense of freedom: to
+ assure everyone the effective freedom to copy and redistribute it,
+ with or without modifying it, either commercially or
+ noncommercially. Secondarily, this License preserves for the
+ author and publisher a way to get credit for their work, while not
+ being considered responsible for modifications made by others.
+
+ This License is a kind of "copyleft", which means that derivative
+ works of the document must themselves be free in the same sense.
+ It complements the GNU General Public License, which is a copyleft
+ license designed for free software.
+
+ We have designed this License in order to use it for manuals for
+ free software, because free software needs free documentation: a
+ free program should come with manuals providing the same freedoms
+ that the software does. But this License is not limited to
+ software manuals; it can be used for any textual work, regardless
+ of subject matter or whether it is published as a printed book.
+ We recommend this License principally for works whose purpose is
+ instruction or reference.
+
+ 1. APPLICABILITY AND DEFINITIONS
+
+ This License applies to any manual or other work, in any medium,
+ that contains a notice placed by the copyright holder saying it
+ can be distributed under the terms of this License. Such a notice
+ grants a world-wide, royalty-free license, unlimited in duration,
+ to use that work under the conditions stated herein. The
+ "Document", below, refers to any such manual or work. Any member
+ of the public is a licensee, and is addressed as "you". You
+ accept the license if you copy, modify or distribute the work in a
+ way requiring permission under copyright law.
+
+ A "Modified Version" of the Document means any work containing the
+ Document or a portion of it, either copied verbatim, or with
+ modifications and/or translated into another language.
+
+ A "Secondary Section" is a named appendix or a front-matter section
+ of the Document that deals exclusively with the relationship of the
+ publishers or authors of the Document to the Document's overall
+ subject (or to related matters) and contains nothing that could
+ fall directly within that overall subject. (Thus, if the Document
+ is in part a textbook of mathematics, a Secondary Section may not
+ explain any mathematics.) The relationship could be a matter of
+ historical connection with the subject or with related matters, or
+ of legal, commercial, philosophical, ethical or political position
+ regarding them.
+
+ The "Invariant Sections" are certain Secondary Sections whose
+ titles are designated, as being those of Invariant Sections, in
+ the notice that says that the Document is released under this
+ License. If a section does not fit the above definition of
+ Secondary then it is not allowed to be designated as Invariant.
+ The Document may contain zero Invariant Sections. If the Document
+ does not identify any Invariant Sections then there are none.
+
+ The "Cover Texts" are certain short passages of text that are
+ listed, as Front-Cover Texts or Back-Cover Texts, in the notice
+ that says that the Document is released under this License. A
+ Front-Cover Text may be at most 5 words, and a Back-Cover Text may
+ be at most 25 words.
+
+ A "Transparent" copy of the Document means a machine-readable copy,
+ represented in a format whose specification is available to the
+ general public, that is suitable for revising the document
+ straightforwardly with generic text editors or (for images
+ composed of pixels) generic paint programs or (for drawings) some
+ widely available drawing editor, and that is suitable for input to
+ text formatters or for automatic translation to a variety of
+ formats suitable for input to text formatters. A copy made in an
+ otherwise Transparent file format whose markup, or absence of
+ markup, has been arranged to thwart or discourage subsequent
+ modification by readers is not Transparent. An image format is
+ not Transparent if used for any substantial amount of text. A
+ copy that is not "Transparent" is called "Opaque".
+
+ Examples of suitable formats for Transparent copies include plain
+ ASCII without markup, Texinfo input format, LaTeX input format,
+ SGML or XML using a publicly available DTD, and
+ standard-conforming simple HTML, PostScript or PDF designed for
+ human modification. Examples of transparent image formats include
+ PNG, XCF and JPG. Opaque formats include proprietary formats that
+ can be read and edited only by proprietary word processors, SGML or
+ XML for which the DTD and/or processing tools are not generally
+ available, and the machine-generated HTML, PostScript or PDF
+ produced by some word processors for output purposes only.
+
+ The "Title Page" means, for a printed book, the title page itself,
+ plus such following pages as are needed to hold, legibly, the
+ material this License requires to appear in the title page. For
+ works in formats which do not have any title page as such, "Title
+ Page" means the text near the most prominent appearance of the
+ work's title, preceding the beginning of the body of the text.
+
+ The "publisher" means any person or entity that distributes copies
+ of the Document to the public.
+
+ A section "Entitled XYZ" means a named subunit of the Document
+ whose title either is precisely XYZ or contains XYZ in parentheses
+ following text that translates XYZ in another language. (Here XYZ
+ stands for a specific section name mentioned below, such as
+ "Acknowledgements", "Dedications", "Endorsements", or "History".)
+ To "Preserve the Title" of such a section when you modify the
+ Document means that it remains a section "Entitled XYZ" according
+ to this definition.
+
+ The Document may include Warranty Disclaimers next to the notice
+ which states that this License applies to the Document. These
+ Warranty Disclaimers are considered to be included by reference in
+ this License, but only as regards disclaiming warranties: any other
+ implication that these Warranty Disclaimers may have is void and
+ has no effect on the meaning of this License.
+
+ 2. VERBATIM COPYING
+
+ You may copy and distribute the Document in any medium, either
+ commercially or noncommercially, provided that this License, the
+ copyright notices, and the license notice saying this License
+ applies to the Document are reproduced in all copies, and that you
+ add no other conditions whatsoever to those of this License. You
+ may not use technical measures to obstruct or control the reading
+ or further copying of the copies you make or distribute. However,
+ you may accept compensation in exchange for copies. If you
+ distribute a large enough number of copies you must also follow
+ the conditions in section 3.
+
+ You may also lend copies, under the same conditions stated above,
+ and you may publicly display copies.
+
+ 3. COPYING IN QUANTITY
+
+ If you publish printed copies (or copies in media that commonly
+ have printed covers) of the Document, numbering more than 100, and
+ the Document's license notice requires Cover Texts, you must
+ enclose the copies in covers that carry, clearly and legibly, all
+ these Cover Texts: Front-Cover Texts on the front cover, and
+ Back-Cover Texts on the back cover. Both covers must also clearly
+ and legibly identify you as the publisher of these copies. The
+ front cover must present the full title with all words of the
+ title equally prominent and visible. You may add other material
+ on the covers in addition. Copying with changes limited to the
+ covers, as long as they preserve the title of the Document and
+ satisfy these conditions, can be treated as verbatim copying in
+ other respects.
+
+ If the required texts for either cover are too voluminous to fit
+ legibly, you should put the first ones listed (as many as fit
+ reasonably) on the actual cover, and continue the rest onto
+ adjacent pages.
+
+ If you publish or distribute Opaque copies of the Document
+ numbering more than 100, you must either include a
+ machine-readable Transparent copy along with each Opaque copy, or
+ state in or with each Opaque copy a computer-network location from
+ which the general network-using public has access to download
+ using public-standard network protocols a complete Transparent
+ copy of the Document, free of added material. If you use the
+ latter option, you must take reasonably prudent steps, when you
+ begin distribution of Opaque copies in quantity, to ensure that
+ this Transparent copy will remain thus accessible at the stated
+ location until at least one year after the last time you
+ distribute an Opaque copy (directly or through your agents or
+ retailers) of that edition to the public.
+
+ It is requested, but not required, that you contact the authors of
+ the Document well before redistributing any large number of
+ copies, to give them a chance to provide you with an updated
+ version of the Document.
+
+ 4. MODIFICATIONS
+
+ You may copy and distribute a Modified Version of the Document
+ under the conditions of sections 2 and 3 above, provided that you
+ release the Modified Version under precisely this License, with
+ the Modified Version filling the role of the Document, thus
+ licensing distribution and modification of the Modified Version to
+ whoever possesses a copy of it. In addition, you must do these
+ things in the Modified Version:
+
+ A. Use in the Title Page (and on the covers, if any) a title
+ distinct from that of the Document, and from those of
+ previous versions (which should, if there were any, be listed
+ in the History section of the Document). You may use the
+ same title as a previous version if the original publisher of
+ that version gives permission.
+
+ B. List on the Title Page, as authors, one or more persons or
+ entities responsible for authorship of the modifications in
+ the Modified Version, together with at least five of the
+ principal authors of the Document (all of its principal
+ authors, if it has fewer than five), unless they release you
+ from this requirement.
+
+ C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+
+ D. Preserve all the copyright notices of the Document.
+
+ E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+
+ F. Include, immediately after the copyright notices, a license
+ notice giving the public permission to use the Modified
+ Version under the terms of this License, in the form shown in
+ the Addendum below.
+
+ G. Preserve in that license notice the full lists of Invariant
+ Sections and required Cover Texts given in the Document's
+ license notice.
+
+ H. Include an unaltered copy of this License.
+
+ I. Preserve the section Entitled "History", Preserve its Title,
+ and add to it an item stating at least the title, year, new
+ authors, and publisher of the Modified Version as given on
+ the Title Page. If there is no section Entitled "History" in
+ the Document, create one stating the title, year, authors,
+ and publisher of the Document as given on its Title Page,
+ then add an item describing the Modified Version as stated in
+ the previous sentence.
+
+ J. Preserve the network location, if any, given in the Document
+ for public access to a Transparent copy of the Document, and
+ likewise the network locations given in the Document for
+ previous versions it was based on. These may be placed in
+ the "History" section. You may omit a network location for a
+ work that was published at least four years before the
+ Document itself, or if the original publisher of the version
+ it refers to gives permission.
+
+ K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the
+ section all the substance and tone of each of the contributor
+ acknowledgements and/or dedications given therein.
+
+ L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section
+ titles.
+
+ M. Delete any section Entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+
+ N. Do not retitle any existing section to be Entitled
+ "Endorsements" or to conflict in title with any Invariant
+ Section.
+
+ O. Preserve any Warranty Disclaimers.
+
+ If the Modified Version includes new front-matter sections or
+ appendices that qualify as Secondary Sections and contain no
+ material copied from the Document, you may at your option
+ designate some or all of these sections as invariant. To do this,
+ add their titles to the list of Invariant Sections in the Modified
+ Version's license notice. These titles must be distinct from any
+ other section titles.
+
+ You may add a section Entitled "Endorsements", provided it contains
+ nothing but endorsements of your Modified Version by various
+ parties--for example, statements of peer review or that the text
+ has been approved by an organization as the authoritative
+ definition of a standard.
+
+ You may add a passage of up to five words as a Front-Cover Text,
+ and a passage of up to 25 words as a Back-Cover Text, to the end
+ of the list of Cover Texts in the Modified Version. Only one
+ passage of Front-Cover Text and one of Back-Cover Text may be
+ added by (or through arrangements made by) any one entity. If the
+ Document already includes a cover text for the same cover,
+ previously added by you or by arrangement made by the same entity
+ you are acting on behalf of, you may not add another; but you may
+ replace the old one, on explicit permission from the previous
+ publisher that added the old one.
+
+ The author(s) and publisher(s) of the Document do not by this
+ License give permission to use their names for publicity for or to
+ assert or imply endorsement of any Modified Version.
+
+ 5. COMBINING DOCUMENTS
+
+ You may combine the Document with other documents released under
+ this License, under the terms defined in section 4 above for
+ modified versions, provided that you include in the combination
+ all of the Invariant Sections of all of the original documents,
+ unmodified, and list them all as Invariant Sections of your
+ combined work in its license notice, and that you preserve all
+ their Warranty Disclaimers.
+
+ The combined work need only contain one copy of this License, and
+ multiple identical Invariant Sections may be replaced with a single
+ copy. If there are multiple Invariant Sections with the same name
+ but different contents, make the title of each such section unique
+ by adding at the end of it, in parentheses, the name of the
+ original author or publisher of that section if known, or else a
+ unique number. Make the same adjustment to the section titles in
+ the list of Invariant Sections in the license notice of the
+ combined work.
+
+ In the combination, you must combine any sections Entitled
+ "History" in the various original documents, forming one section
+ Entitled "History"; likewise combine any sections Entitled
+ "Acknowledgements", and any sections Entitled "Dedications". You
+ must delete all sections Entitled "Endorsements."
+
+ 6. COLLECTIONS OF DOCUMENTS
+
+ You may make a collection consisting of the Document and other
+ documents released under this License, and replace the individual
+ copies of this License in the various documents with a single copy
+ that is included in the collection, provided that you follow the
+ rules of this License for verbatim copying of each of the
+ documents in all other respects.
+
+ You may extract a single document from such a collection, and
+ distribute it individually under this License, provided you insert
+ a copy of this License into the extracted document, and follow
+ this License in all other respects regarding verbatim copying of
+ that document.
+
+ 7. AGGREGATION WITH INDEPENDENT WORKS
+
+ A compilation of the Document or its derivatives with other
+ separate and independent documents or works, in or on a volume of
+ a storage or distribution medium, is called an "aggregate" if the
+ copyright resulting from the compilation is not used to limit the
+ legal rights of the compilation's users beyond what the individual
+ works permit. When the Document is included in an aggregate, this
+ License does not apply to the other works in the aggregate which
+ are not themselves derivative works of the Document.
+
+ If the Cover Text requirement of section 3 is applicable to these
+ copies of the Document, then if the Document is less than one half
+ of the entire aggregate, the Document's Cover Texts may be placed
+ on covers that bracket the Document within the aggregate, or the
+ electronic equivalent of covers if the Document is in electronic
+ form. Otherwise they must appear on printed covers that bracket
+ the whole aggregate.
+
+ 8. TRANSLATION
+
+ Translation is considered a kind of modification, so you may
+ distribute translations of the Document under the terms of section
+ 4. Replacing Invariant Sections with translations requires special
+ permission from their copyright holders, but you may include
+ translations of some or all Invariant Sections in addition to the
+ original versions of these Invariant Sections. You may include a
+ translation of this License, and all the license notices in the
+ Document, and any Warranty Disclaimers, provided that you also
+ include the original English version of this License and the
+ original versions of those notices and disclaimers. In case of a
+ disagreement between the translation and the original version of
+ this License or a notice or disclaimer, the original version will
+ prevail.
+
+ If a section in the Document is Entitled "Acknowledgements",
+ "Dedications", or "History", the requirement (section 4) to
+ Preserve its Title (section 1) will typically require changing the
+ actual title.
+
+ 9. TERMINATION
+
+ You may not copy, modify, sublicense, or distribute the Document
+ except as expressly provided under this License. Any attempt
+ otherwise to copy, modify, sublicense, or distribute it is void,
+ and will automatically terminate your rights under this License.
+
+ However, if you cease all violation of this License, then your
+ license from a particular copyright holder is reinstated (a)
+ provisionally, unless and until the copyright holder explicitly
+ and finally terminates your license, and (b) permanently, if the
+ copyright holder fails to notify you of the violation by some
+ reasonable means prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+ reinstated permanently if the copyright holder notifies you of the
+ violation by some reasonable means, this is the first time you have
+ received notice of violation of this License (for any work) from
+ that copyright holder, and you cure the violation prior to 30 days
+ after your receipt of the notice.
+
+ Termination of your rights under this section does not terminate
+ the licenses of parties who have received copies or rights from
+ you under this License. If your rights have been terminated and
+ not permanently reinstated, receipt of a copy of some or all of
+ the same material does not give you any rights to use it.
+
+ 10. FUTURE REVISIONS OF THIS LICENSE
+
+ The Free Software Foundation may publish new, revised versions of
+ the GNU Free Documentation License from time to time. Such new
+ versions will be similar in spirit to the present version, but may
+ differ in detail to address new problems or concerns. See
+ `http://www.gnu.org/copyleft/'.
+
+ Each version of the License is given a distinguishing version
+ number. If the Document specifies that a particular numbered
+ version of this License "or any later version" applies to it, you
+ have the option of following the terms and conditions either of
+ that specified version or of any later version that has been
+ published (not as a draft) by the Free Software Foundation. If
+ the Document does not specify a version number of this License,
+ you may choose any version ever published (not as a draft) by the
+ Free Software Foundation. If the Document specifies that a proxy
+ can decide which future versions of this License can be used, that
+ proxy's public statement of acceptance of a version permanently
+ authorizes you to choose that version for the Document.
+
+ 11. RELICENSING
+
+ "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
+ World Wide Web server that publishes copyrightable works and also
+ provides prominent facilities for anybody to edit those works. A
+ public wiki that anybody can edit is an example of such a server.
+ A "Massive Multiauthor Collaboration" (or "MMC") contained in the
+ site means any set of copyrightable works thus published on the MMC
+ site.
+
+ "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
+ license published by Creative Commons Corporation, a not-for-profit
+ corporation with a principal place of business in San Francisco,
+ California, as well as future copyleft versions of that license
+ published by that same organization.
+
+ "Incorporate" means to publish or republish a Document, in whole or
+ in part, as part of another Document.
+
+ An MMC is "eligible for relicensing" if it is licensed under this
+ License, and if all works that were first published under this
+ License somewhere other than this MMC, and subsequently
+ incorporated in whole or in part into the MMC, (1) had no cover
+ texts or invariant sections, and (2) were thus incorporated prior
+ to November 1, 2008.
+
+ The operator of an MMC Site may republish an MMC contained in the
+ site under CC-BY-SA on the same site at any time before August 1,
+ 2009, provided the MMC is eligible for relicensing.
+
+
+ADDENDUM: How to use this License for your documents
+====================================================
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and license
+notices just after the title page:
+
+ Copyright (C) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.3
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+ Texts. A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
+
+ If you have Invariant Sections, Front-Cover Texts and Back-Cover
+Texts, replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with
+ the Front-Cover Texts being LIST, and with the Back-Cover Texts
+ being LIST.
+
+ If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+ If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License, to
+permit their use in free software.
+
+
+
+Tag Table:
+Node: Top731
+Node: Introduction2054
+Node: Compiling4546
+Node: Executing8602
+Node: Invoking11390
+Node: Output Options12805
+Node: Analysis Options19894
+Node: Miscellaneous Options23592
+Node: Deprecated Options24847
+Node: Symspecs26926
+Node: Output28752
+Node: Flat Profile29792
+Node: Call Graph34745
+Node: Primary37977
+Node: Callers40565
+Node: Subroutines42682
+Node: Cycles44523
+Node: Line-by-line51300
+Node: Annotated Source55373
+Node: Inaccuracy58372
+Node: Sampling Error58630
+Node: Assumptions61200
+Node: How do I?62670
+Node: Incompatibilities64224
+Node: Details65718
+Node: Implementation66111
+Node: File Format72008
+Node: Internals76298
+Node: Debugging84793
+Node: GNU Free Documentation License86394
+
+End Tag Table
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/ld.info b/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/ld.info
new file mode 100644
index 0000000..6022958
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/ld.info
@@ -0,0 +1,7611 @@
+This is ld.info, produced by makeinfo version 4.8 from ld.texinfo.
+
+START-INFO-DIR-ENTRY
+* Ld: (ld). The GNU linker.
+END-INFO-DIR-ENTRY
+
+ This file documents the GNU linker LD (GNU Binutils) version 2.20.
+
+ Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
+Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.3 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+Texts. A copy of the license is included in the section entitled "GNU
+Free Documentation License".
+
+
+File: ld.info, Node: Top, Next: Overview, Up: (dir)
+
+LD
+**
+
+This file documents the GNU linker ld (GNU Binutils) version 2.20.
+
+ This document is distributed under the terms of the GNU Free
+Documentation License version 1.3. A copy of the license is included
+in the section entitled "GNU Free Documentation License".
+
+* Menu:
+
+* Overview:: Overview
+* Invocation:: Invocation
+* Scripts:: Linker Scripts
+
+* Machine Dependent:: Machine Dependent Features
+
+* BFD:: BFD
+
+* Reporting Bugs:: Reporting Bugs
+* MRI:: MRI Compatible Script Files
+* GNU Free Documentation License:: GNU Free Documentation License
+* LD Index:: LD Index
+
+
+File: ld.info, Node: Overview, Next: Invocation, Prev: Top, Up: Top
+
+1 Overview
+**********
+
+`ld' combines a number of object and archive files, relocates their
+data and ties up symbol references. Usually the last step in compiling
+a program is to run `ld'.
+
+ `ld' accepts Linker Command Language files written in a superset of
+AT&T's Link Editor Command Language syntax, to provide explicit and
+total control over the linking process.
+
+ This version of `ld' uses the general purpose BFD libraries to
+operate on object files. This allows `ld' to read, combine, and write
+object files in many different formats--for example, COFF or `a.out'.
+Different formats may be linked together to produce any available kind
+of object file. *Note BFD::, for more information.
+
+ Aside from its flexibility, the GNU linker is more helpful than other
+linkers in providing diagnostic information. Many linkers abandon
+execution immediately upon encountering an error; whenever possible,
+`ld' continues executing, allowing you to identify other errors (or, in
+some cases, to get an output file in spite of the error).
+
+
+File: ld.info, Node: Invocation, Next: Scripts, Prev: Overview, Up: Top
+
+2 Invocation
+************
+
+The GNU linker `ld' is meant to cover a broad range of situations, and
+to be as compatible as possible with other linkers. As a result, you
+have many choices to control its behavior.
+
+* Menu:
+
+* Options:: Command Line Options
+* Environment:: Environment Variables
+
+
+File: ld.info, Node: Options, Next: Environment, Up: Invocation
+
+2.1 Command Line Options
+========================
+
+ The linker supports a plethora of command-line options, but in actual
+practice few of them are used in any particular context. For instance,
+a frequent use of `ld' is to link standard Unix object files on a
+standard, supported Unix system. On such a system, to link a file
+`hello.o':
+
+ ld -o OUTPUT /lib/crt0.o hello.o -lc
+
+ This tells `ld' to produce a file called OUTPUT as the result of
+linking the file `/lib/crt0.o' with `hello.o' and the library `libc.a',
+which will come from the standard search directories. (See the
+discussion of the `-l' option below.)
+
+ Some of the command-line options to `ld' may be specified at any
+point in the command line. However, options which refer to files, such
+as `-l' or `-T', cause the file to be read at the point at which the
+option appears in the command line, relative to the object files and
+other file options. Repeating non-file options with a different
+argument will either have no further effect, or override prior
+occurrences (those further to the left on the command line) of that
+option. Options which may be meaningfully specified more than once are
+noted in the descriptions below.
+
+ Non-option arguments are object files or archives which are to be
+linked together. They may follow, precede, or be mixed in with
+command-line options, except that an object file argument may not be
+placed between an option and its argument.
+
+ Usually the linker is invoked with at least one object file, but you
+can specify other forms of binary input files using `-l', `-R', and the
+script command language. If _no_ binary input files at all are
+specified, the linker does not produce any output, and issues the
+message `No input files'.
+
+ If the linker cannot recognize the format of an object file, it will
+assume that it is a linker script. A script specified in this way
+augments the main linker script used for the link (either the default
+linker script or the one specified by using `-T'). This feature
+permits the linker to link against a file which appears to be an object
+or an archive, but actually merely defines some symbol values, or uses
+`INPUT' or `GROUP' to load other objects. Specifying a script in this
+way merely augments the main linker script, with the extra commands
+placed after the main script; use the `-T' option to replace the
+default linker script entirely, but note the effect of the `INSERT'
+command. *Note Scripts::.
+
+ For options whose names are a single letter, option arguments must
+either follow the option letter without intervening whitespace, or be
+given as separate arguments immediately following the option that
+requires them.
+
+ For options whose names are multiple letters, either one dash or two
+can precede the option name; for example, `-trace-symbol' and
+`--trace-symbol' are equivalent. Note--there is one exception to this
+rule. Multiple letter options that start with a lower case 'o' can
+only be preceded by two dashes. This is to reduce confusion with the
+`-o' option. So for example `-omagic' sets the output file name to
+`magic' whereas `--omagic' sets the NMAGIC flag on the output.
+
+ Arguments to multiple-letter options must either be separated from
+the option name by an equals sign, or be given as separate arguments
+immediately following the option that requires them. For example,
+`--trace-symbol foo' and `--trace-symbol=foo' are equivalent. Unique
+abbreviations of the names of multiple-letter options are accepted.
+
+ Note--if the linker is being invoked indirectly, via a compiler
+driver (e.g. `gcc') then all the linker command line options should be
+prefixed by `-Wl,' (or whatever is appropriate for the particular
+compiler driver) like this:
+
+ gcc -Wl,--start-group foo.o bar.o -Wl,--end-group
+
+ This is important, because otherwise the compiler driver program may
+silently drop the linker options, resulting in a bad link. Confusion
+may also arise when passing options that require values through a
+driver, as the use of a space between option and argument acts as a
+separator, and causes the driver to pass only the option to the linker
+and the argument to the compiler. In this case, it is simplest to use
+the joined forms of both single- and multiple-letter options, such as:
+
+ gcc foo.o bar.o -Wl,-eENTRY -Wl,-Map=a.map
+
+ Here is a table of the generic command line switches accepted by the
+GNU linker:
+
+`@FILE'
+ Read command-line options from FILE. The options read are
+ inserted in place of the original @FILE option. If FILE does not
+ exist, or cannot be read, then the option will be treated
+ literally, and not removed.
+
+ Options in FILE are separated by whitespace. A whitespace
+ character may be included in an option by surrounding the entire
+ option in either single or double quotes. Any character
+ (including a backslash) may be included by prefixing the character
+ to be included with a backslash. The FILE may itself contain
+ additional @FILE options; any such options will be processed
+ recursively.
+
+`-a KEYWORD'
+ This option is supported for HP/UX compatibility. The KEYWORD
+ argument must be one of the strings `archive', `shared', or
+ `default'. `-aarchive' is functionally equivalent to `-Bstatic',
+ and the other two keywords are functionally equivalent to
+ `-Bdynamic'. This option may be used any number of times.
+
+`-A ARCHITECTURE'
+`--architecture=ARCHITECTURE'
+ In the current release of `ld', this option is useful only for the
+ Intel 960 family of architectures. In that `ld' configuration, the
+ ARCHITECTURE argument identifies the particular architecture in
+ the 960 family, enabling some safeguards and modifying the
+ archive-library search path. *Note `ld' and the Intel 960 family:
+ i960, for details.
+
+ Future releases of `ld' may support similar functionality for
+ other architecture families.
+
+`-b INPUT-FORMAT'
+`--format=INPUT-FORMAT'
+ `ld' may be configured to support more than one kind of object
+ file. If your `ld' is configured this way, you can use the `-b'
+ option to specify the binary format for input object files that
+ follow this option on the command line. Even when `ld' is
+ configured to support alternative object formats, you don't
+ usually need to specify this, as `ld' should be configured to
+ expect as a default input format the most usual format on each
+ machine. INPUT-FORMAT is a text string, the name of a particular
+ format supported by the BFD libraries. (You can list the
+ available binary formats with `objdump -i'.) *Note BFD::.
+
+ You may want to use this option if you are linking files with an
+ unusual binary format. You can also use `-b' to switch formats
+ explicitly (when linking object files of different formats), by
+ including `-b INPUT-FORMAT' before each group of object files in a
+ particular format.
+
+ The default format is taken from the environment variable
+ `GNUTARGET'. *Note Environment::. You can also define the input
+ format from a script, using the command `TARGET'; see *Note Format
+ Commands::.
+
+`-c MRI-COMMANDFILE'
+`--mri-script=MRI-COMMANDFILE'
+ For compatibility with linkers produced by MRI, `ld' accepts script
+ files written in an alternate, restricted command language,
+ described in *Note MRI Compatible Script Files: MRI. Introduce
+ MRI script files with the option `-c'; use the `-T' option to run
+ linker scripts written in the general-purpose `ld' scripting
+ language. If MRI-CMDFILE does not exist, `ld' looks for it in the
+ directories specified by any `-L' options.
+
+`-d'
+`-dc'
+`-dp'
+ These three options are equivalent; multiple forms are supported
+ for compatibility with other linkers. They assign space to common
+ symbols even if a relocatable output file is specified (with
+ `-r'). The script command `FORCE_COMMON_ALLOCATION' has the same
+ effect. *Note Miscellaneous Commands::.
+
+`-e ENTRY'
+`--entry=ENTRY'
+ Use ENTRY as the explicit symbol for beginning execution of your
+ program, rather than the default entry point. If there is no
+ symbol named ENTRY, the linker will try to parse ENTRY as a number,
+ and use that as the entry address (the number will be interpreted
+ in base 10; you may use a leading `0x' for base 16, or a leading
+ `0' for base 8). *Note Entry Point::, for a discussion of defaults
+ and other ways of specifying the entry point.
+
+`--exclude-libs LIB,LIB,...'
+ Specifies a list of archive libraries from which symbols should
+ not be automatically exported. The library names may be delimited
+ by commas or colons. Specifying `--exclude-libs ALL' excludes
+ symbols in all archive libraries from automatic export. This
+ option is available only for the i386 PE targeted port of the
+ linker and for ELF targeted ports. For i386 PE, symbols
+ explicitly listed in a .def file are still exported, regardless of
+ this option. For ELF targeted ports, symbols affected by this
+ option will be treated as hidden.
+
+`--exclude-modules-for-implib MODULE,MODULE,...'
+ Specifies a list of object files or archive members, from which
+ symbols should not be automatically exported, but which should be
+ copied wholesale into the import library being generated during
+ the link. The module names may be delimited by commas or colons,
+ and must match exactly the filenames used by `ld' to open the
+ files; for archive members, this is simply the member name, but
+ for object files the name listed must include and match precisely
+ any path used to specify the input file on the linker's
+ command-line. This option is available only for the i386 PE
+ targeted port of the linker. Symbols explicitly listed in a .def
+ file are still exported, regardless of this option.
+
+`-E'
+`--export-dynamic'
+`--no-export-dynamic'
+ When creating a dynamically linked executable, using the `-E'
+ option or the `--export-dynamic' option causes the linker to add
+ all symbols to the dynamic symbol table. The dynamic symbol table
+ is the set of symbols which are visible from dynamic objects at
+ run time.
+
+ If you do not use either of these options (or use the
+ `--no-export-dynamic' option to restore the default behavior), the
+ dynamic symbol table will normally contain only those symbols
+ which are referenced by some dynamic object mentioned in the link.
+
+ If you use `dlopen' to load a dynamic object which needs to refer
+ back to the symbols defined by the program, rather than some other
+ dynamic object, then you will probably need to use this option when
+ linking the program itself.
+
+ You can also use the dynamic list to control what symbols should
+ be added to the dynamic symbol table if the output format supports
+ it. See the description of `--dynamic-list'.
+
+ Note that this option is specific to ELF targeted ports. PE
+ targets support a similar function to export all symbols from a
+ DLL or EXE; see the description of `--export-all-symbols' below.
+
+`-EB'
+ Link big-endian objects. This affects the default output format.
+
+`-EL'
+ Link little-endian objects. This affects the default output
+ format.
+
+`-f NAME'
+`--auxiliary=NAME'
+ When creating an ELF shared object, set the internal DT_AUXILIARY
+ field to the specified name. This tells the dynamic linker that
+ the symbol table of the shared object should be used as an
+ auxiliary filter on the symbol table of the shared object NAME.
+
+ If you later link a program against this filter object, then, when
+ you run the program, the dynamic linker will see the DT_AUXILIARY
+ field. If the dynamic linker resolves any symbols from the filter
+ object, it will first check whether there is a definition in the
+ shared object NAME. If there is one, it will be used instead of
+ the definition in the filter object. The shared object NAME need
+ not exist. Thus the shared object NAME may be used to provide an
+ alternative implementation of certain functions, perhaps for
+ debugging or for machine specific performance.
+
+ This option may be specified more than once. The DT_AUXILIARY
+ entries will be created in the order in which they appear on the
+ command line.
+
+`-F NAME'
+`--filter=NAME'
+ When creating an ELF shared object, set the internal DT_FILTER
+ field to the specified name. This tells the dynamic linker that
+ the symbol table of the shared object which is being created
+ should be used as a filter on the symbol table of the shared
+ object NAME.
+
+ If you later link a program against this filter object, then, when
+ you run the program, the dynamic linker will see the DT_FILTER
+ field. The dynamic linker will resolve symbols according to the
+ symbol table of the filter object as usual, but it will actually
+ link to the definitions found in the shared object NAME. Thus the
+ filter object can be used to select a subset of the symbols
+ provided by the object NAME.
+
+ Some older linkers used the `-F' option throughout a compilation
+ toolchain for specifying object-file format for both input and
+ output object files. The GNU linker uses other mechanisms for
+ this purpose: the `-b', `--format', `--oformat' options, the
+ `TARGET' command in linker scripts, and the `GNUTARGET'
+ environment variable. The GNU linker will ignore the `-F' option
+ when not creating an ELF shared object.
+
+`-fini=NAME'
+ When creating an ELF executable or shared object, call NAME when
+ the executable or shared object is unloaded, by setting DT_FINI to
+ the address of the function. By default, the linker uses `_fini'
+ as the function to call.
+
+`-g'
+ Ignored. Provided for compatibility with other tools.
+
+`-G VALUE'
+`--gpsize=VALUE'
+ Set the maximum size of objects to be optimized using the GP
+ register to SIZE. This is only meaningful for object file formats
+ such as MIPS ECOFF which supports putting large and small objects
+ into different sections. This is ignored for other object file
+ formats.
+
+`-h NAME'
+`-soname=NAME'
+ When creating an ELF shared object, set the internal DT_SONAME
+ field to the specified name. When an executable is linked with a
+ shared object which has a DT_SONAME field, then when the
+ executable is run the dynamic linker will attempt to load the
+ shared object specified by the DT_SONAME field rather than the
+ using the file name given to the linker.
+
+`-i'
+ Perform an incremental link (same as option `-r').
+
+`-init=NAME'
+ When creating an ELF executable or shared object, call NAME when
+ the executable or shared object is loaded, by setting DT_INIT to
+ the address of the function. By default, the linker uses `_init'
+ as the function to call.
+
+`-l NAMESPEC'
+`--library=NAMESPEC'
+ Add the archive or object file specified by NAMESPEC to the list
+ of files to link. This option may be used any number of times.
+ If NAMESPEC is of the form `:FILENAME', `ld' will search the
+ library path for a file called FILENAME, otherwise it will search
+ the library path for a file called `libNAMESPEC.a'.
+
+ On systems which support shared libraries, `ld' may also search for
+ files other than `libNAMESPEC.a'. Specifically, on ELF and SunOS
+ systems, `ld' will search a directory for a library called
+ `libNAMESPEC.so' before searching for one called `libNAMESPEC.a'.
+ (By convention, a `.so' extension indicates a shared library.)
+ Note that this behavior does not apply to `:FILENAME', which
+ always specifies a file called FILENAME.
+
+ The linker will search an archive only once, at the location where
+ it is specified on the command line. If the archive defines a
+ symbol which was undefined in some object which appeared before
+ the archive on the command line, the linker will include the
+ appropriate file(s) from the archive. However, an undefined
+ symbol in an object appearing later on the command line will not
+ cause the linker to search the archive again.
+
+ See the `-(' option for a way to force the linker to search
+ archives multiple times.
+
+ You may list the same archive multiple times on the command line.
+
+ This type of archive searching is standard for Unix linkers.
+ However, if you are using `ld' on AIX, note that it is different
+ from the behaviour of the AIX linker.
+
+`-L SEARCHDIR'
+`--library-path=SEARCHDIR'
+ Add path SEARCHDIR to the list of paths that `ld' will search for
+ archive libraries and `ld' control scripts. You may use this
+ option any number of times. The directories are searched in the
+ order in which they are specified on the command line.
+ Directories specified on the command line are searched before the
+ default directories. All `-L' options apply to all `-l' options,
+ regardless of the order in which the options appear. `-L' options
+ do not affect how `ld' searches for a linker script unless `-T'
+ option is specified.
+
+ If SEARCHDIR begins with `=', then the `=' will be replaced by the
+ "sysroot prefix", a path specified when the linker is configured.
+
+ The default set of paths searched (without being specified with
+ `-L') depends on which emulation mode `ld' is using, and in some
+ cases also on how it was configured. *Note Environment::.
+
+ The paths can also be specified in a link script with the
+ `SEARCH_DIR' command. Directories specified this way are searched
+ at the point in which the linker script appears in the command
+ line.
+
+`-m EMULATION'
+ Emulate the EMULATION linker. You can list the available
+ emulations with the `--verbose' or `-V' options.
+
+ If the `-m' option is not used, the emulation is taken from the
+ `LDEMULATION' environment variable, if that is defined.
+
+ Otherwise, the default emulation depends upon how the linker was
+ configured.
+
+`-M'
+`--print-map'
+ Print a link map to the standard output. A link map provides
+ information about the link, including the following:
+
+ * Where object files are mapped into memory.
+
+ * How common symbols are allocated.
+
+ * All archive members included in the link, with a mention of
+ the symbol which caused the archive member to be brought in.
+
+ * The values assigned to symbols.
+
+ Note - symbols whose values are computed by an expression
+ which involves a reference to a previous value of the same
+ symbol may not have correct result displayed in the link map.
+ This is because the linker discards intermediate results and
+ only retains the final value of an expression. Under such
+ circumstances the linker will display the final value
+ enclosed by square brackets. Thus for example a linker
+ script containing:
+
+ foo = 1
+ foo = foo * 4
+ foo = foo + 8
+
+ will produce the following output in the link map if the `-M'
+ option is used:
+
+ 0x00000001 foo = 0x1
+ [0x0000000c] foo = (foo * 0x4)
+ [0x0000000c] foo = (foo + 0x8)
+
+ See *Note Expressions:: for more information about
+ expressions in linker scripts.
+
+`-n'
+`--nmagic'
+ Turn off page alignment of sections, and mark the output as
+ `NMAGIC' if possible.
+
+`-N'
+`--omagic'
+ Set the text and data sections to be readable and writable. Also,
+ do not page-align the data segment, and disable linking against
+ shared libraries. If the output format supports Unix style magic
+ numbers, mark the output as `OMAGIC'. Note: Although a writable
+ text section is allowed for PE-COFF targets, it does not conform
+ to the format specification published by Microsoft.
+
+`--no-omagic'
+ This option negates most of the effects of the `-N' option. It
+ sets the text section to be read-only, and forces the data segment
+ to be page-aligned. Note - this option does not enable linking
+ against shared libraries. Use `-Bdynamic' for this.
+
+`-o OUTPUT'
+`--output=OUTPUT'
+ Use OUTPUT as the name for the program produced by `ld'; if this
+ option is not specified, the name `a.out' is used by default. The
+ script command `OUTPUT' can also specify the output file name.
+
+`-O LEVEL'
+ If LEVEL is a numeric values greater than zero `ld' optimizes the
+ output. This might take significantly longer and therefore
+ probably should only be enabled for the final binary. At the
+ moment this option only affects ELF shared library generation.
+ Future releases of the linker may make more use of this option.
+ Also currently there is no difference in the linker's behaviour
+ for different non-zero values of this option. Again this may
+ change with future releases.
+
+`-q'
+`--emit-relocs'
+ Leave relocation sections and contents in fully linked executables.
+ Post link analysis and optimization tools may need this
+ information in order to perform correct modifications of
+ executables. This results in larger executables.
+
+ This option is currently only supported on ELF platforms.
+
+`--force-dynamic'
+ Force the output file to have dynamic sections. This option is
+ specific to VxWorks targets.
+
+`-r'
+`--relocatable'
+ Generate relocatable output--i.e., generate an output file that
+ can in turn serve as input to `ld'. This is often called "partial
+ linking". As a side effect, in environments that support standard
+ Unix magic numbers, this option also sets the output file's magic
+ number to `OMAGIC'. If this option is not specified, an absolute
+ file is produced. When linking C++ programs, this option _will
+ not_ resolve references to constructors; to do that, use `-Ur'.
+
+ When an input file does not have the same format as the output
+ file, partial linking is only supported if that input file does
+ not contain any relocations. Different output formats can have
+ further restrictions; for example some `a.out'-based formats do
+ not support partial linking with input files in other formats at
+ all.
+
+ This option does the same thing as `-i'.
+
+`-R FILENAME'
+`--just-symbols=FILENAME'
+ Read symbol names and their addresses from FILENAME, but do not
+ relocate it or include it in the output. This allows your output
+ file to refer symbolically to absolute locations of memory defined
+ in other programs. You may use this option more than once.
+
+ For compatibility with other ELF linkers, if the `-R' option is
+ followed by a directory name, rather than a file name, it is
+ treated as the `-rpath' option.
+
+`-s'
+`--strip-all'
+ Omit all symbol information from the output file.
+
+`-S'
+`--strip-debug'
+ Omit debugger symbol information (but not all symbols) from the
+ output file.
+
+`-t'
+`--trace'
+ Print the names of the input files as `ld' processes them.
+
+`-T SCRIPTFILE'
+`--script=SCRIPTFILE'
+ Use SCRIPTFILE as the linker script. This script replaces `ld''s
+ default linker script (rather than adding to it), so COMMANDFILE
+ must specify everything necessary to describe the output file.
+ *Note Scripts::. If SCRIPTFILE does not exist in the current
+ directory, `ld' looks for it in the directories specified by any
+ preceding `-L' options. Multiple `-T' options accumulate.
+
+`-dT SCRIPTFILE'
+`--default-script=SCRIPTFILE'
+ Use SCRIPTFILE as the default linker script. *Note Scripts::.
+
+ This option is similar to the `--script' option except that
+ processing of the script is delayed until after the rest of the
+ command line has been processed. This allows options placed after
+ the `--default-script' option on the command line to affect the
+ behaviour of the linker script, which can be important when the
+ linker command line cannot be directly controlled by the user.
+ (eg because the command line is being constructed by another tool,
+ such as `gcc').
+
+`-u SYMBOL'
+`--undefined=SYMBOL'
+ Force SYMBOL to be entered in the output file as an undefined
+ symbol. Doing this may, for example, trigger linking of additional
+ modules from standard libraries. `-u' may be repeated with
+ different option arguments to enter additional undefined symbols.
+ This option is equivalent to the `EXTERN' linker script command.
+
+`-Ur'
+ For anything other than C++ programs, this option is equivalent to
+ `-r': it generates relocatable output--i.e., an output file that
+ can in turn serve as input to `ld'. When linking C++ programs,
+ `-Ur' _does_ resolve references to constructors, unlike `-r'. It
+ does not work to use `-Ur' on files that were themselves linked
+ with `-Ur'; once the constructor table has been built, it cannot
+ be added to. Use `-Ur' only for the last partial link, and `-r'
+ for the others.
+
+`--unique[=SECTION]'
+ Creates a separate output section for every input section matching
+ SECTION, or if the optional wildcard SECTION argument is missing,
+ for every orphan input section. An orphan section is one not
+ specifically mentioned in a linker script. You may use this option
+ multiple times on the command line; It prevents the normal
+ merging of input sections with the same name, overriding output
+ section assignments in a linker script.
+
+`-v'
+`--version'
+`-V'
+ Display the version number for `ld'. The `-V' option also lists
+ the supported emulations.
+
+`-x'
+`--discard-all'
+ Delete all local symbols.
+
+`-X'
+`--discard-locals'
+ Delete all temporary local symbols. (These symbols start with
+ system-specific local label prefixes, typically `.L' for ELF
+ systems or `L' for traditional a.out systems.)
+
+`-y SYMBOL'
+`--trace-symbol=SYMBOL'
+ Print the name of each linked file in which SYMBOL appears. This
+ option may be given any number of times. On many systems it is
+ necessary to prepend an underscore.
+
+ This option is useful when you have an undefined symbol in your
+ link but don't know where the reference is coming from.
+
+`-Y PATH'
+ Add PATH to the default library search path. This option exists
+ for Solaris compatibility.
+
+`-z KEYWORD'
+ The recognized keywords are:
+ `combreloc'
+ Combines multiple reloc sections and sorts them to make
+ dynamic symbol lookup caching possible.
+
+ `defs'
+ Disallows undefined symbols in object files. Undefined
+ symbols in shared libraries are still allowed.
+
+ `execstack'
+ Marks the object as requiring executable stack.
+
+ `initfirst'
+ This option is only meaningful when building a shared object.
+ It marks the object so that its runtime initialization will
+ occur before the runtime initialization of any other objects
+ brought into the process at the same time. Similarly the
+ runtime finalization of the object will occur after the
+ runtime finalization of any other objects.
+
+ `interpose'
+ Marks the object that its symbol table interposes before all
+ symbols but the primary executable.
+
+ `lazy'
+ When generating an executable or shared library, mark it to
+ tell the dynamic linker to defer function call resolution to
+ the point when the function is called (lazy binding), rather
+ than at load time. Lazy binding is the default.
+
+ `loadfltr'
+ Marks the object that its filters be processed immediately at
+ runtime.
+
+ `muldefs'
+ Allows multiple definitions.
+
+ `nocombreloc'
+ Disables multiple reloc sections combining.
+
+ `nocopyreloc'
+ Disables production of copy relocs.
+
+ `nodefaultlib'
+ Marks the object that the search for dependencies of this
+ object will ignore any default library search paths.
+
+ `nodelete'
+ Marks the object shouldn't be unloaded at runtime.
+
+ `nodlopen'
+ Marks the object not available to `dlopen'.
+
+ `nodump'
+ Marks the object can not be dumped by `dldump'.
+
+ `noexecstack'
+ Marks the object as not requiring executable stack.
+
+ `norelro'
+ Don't create an ELF `PT_GNU_RELRO' segment header in the
+ object.
+
+ `now'
+ When generating an executable or shared library, mark it to
+ tell the dynamic linker to resolve all symbols when the
+ program is started, or when the shared library is linked to
+ using dlopen, instead of deferring function call resolution
+ to the point when the function is first called.
+
+ `origin'
+ Marks the object may contain $ORIGIN.
+
+ `relro'
+ Create an ELF `PT_GNU_RELRO' segment header in the object.
+
+ `max-page-size=VALUE'
+ Set the emulation maximum page size to VALUE.
+
+ `common-page-size=VALUE'
+ Set the emulation common page size to VALUE.
+
+
+ Other keywords are ignored for Solaris compatibility.
+
+`-( ARCHIVES -)'
+`--start-group ARCHIVES --end-group'
+ The ARCHIVES should be a list of archive files. They may be
+ either explicit file names, or `-l' options.
+
+ The specified archives are searched repeatedly until no new
+ undefined references are created. Normally, an archive is
+ searched only once in the order that it is specified on the
+ command line. If a symbol in that archive is needed to resolve an
+ undefined symbol referred to by an object in an archive that
+ appears later on the command line, the linker would not be able to
+ resolve that reference. By grouping the archives, they all be
+ searched repeatedly until all possible references are resolved.
+
+ Using this option has a significant performance cost. It is best
+ to use it only when there are unavoidable circular references
+ between two or more archives.
+
+`--accept-unknown-input-arch'
+`--no-accept-unknown-input-arch'
+ Tells the linker to accept input files whose architecture cannot be
+ recognised. The assumption is that the user knows what they are
+ doing and deliberately wants to link in these unknown input files.
+ This was the default behaviour of the linker, before release
+ 2.14. The default behaviour from release 2.14 onwards is to
+ reject such input files, and so the `--accept-unknown-input-arch'
+ option has been added to restore the old behaviour.
+
+`--as-needed'
+`--no-as-needed'
+ This option affects ELF DT_NEEDED tags for dynamic libraries
+ mentioned on the command line after the `--as-needed' option.
+ Normally, the linker will add a DT_NEEDED tag for each dynamic
+ library mentioned on the command line, regardless of whether the
+ library is actually needed. `--as-needed' causes a DT_NEEDED tag
+ to only be emitted for a library that satisfies a symbol reference
+ from regular objects which is undefined at the point that the
+ library was linked, or, if the library is not found in the
+ DT_NEEDED lists of other libraries linked up to that point, a
+ reference from another dynamic library. `--no-as-needed' restores
+ the default behaviour.
+
+`--add-needed'
+`--no-add-needed'
+ This option affects the treatment of dynamic libraries from ELF
+ DT_NEEDED tags in dynamic libraries mentioned on the command line
+ after the `--no-add-needed' option. Normally, the linker will add
+ a DT_NEEDED tag for each dynamic library from DT_NEEDED tags.
+ `--no-add-needed' causes DT_NEEDED tags will never be emitted for
+ those libraries from DT_NEEDED tags. `--add-needed' restores the
+ default behaviour.
+
+`-assert KEYWORD'
+ This option is ignored for SunOS compatibility.
+
+`-Bdynamic'
+`-dy'
+`-call_shared'
+ Link against dynamic libraries. This is only meaningful on
+ platforms for which shared libraries are supported. This option
+ is normally the default on such platforms. The different variants
+ of this option are for compatibility with various systems. You
+ may use this option multiple times on the command line: it affects
+ library searching for `-l' options which follow it.
+
+`-Bgroup'
+ Set the `DF_1_GROUP' flag in the `DT_FLAGS_1' entry in the dynamic
+ section. This causes the runtime linker to handle lookups in this
+ object and its dependencies to be performed only inside the group.
+ `--unresolved-symbols=report-all' is implied. This option is only
+ meaningful on ELF platforms which support shared libraries.
+
+`-Bstatic'
+`-dn'
+`-non_shared'
+`-static'
+ Do not link against shared libraries. This is only meaningful on
+ platforms for which shared libraries are supported. The different
+ variants of this option are for compatibility with various
+ systems. You may use this option multiple times on the command
+ line: it affects library searching for `-l' options which follow
+ it. This option also implies `--unresolved-symbols=report-all'.
+ This option can be used with `-shared'. Doing so means that a
+ shared library is being created but that all of the library's
+ external references must be resolved by pulling in entries from
+ static libraries.
+
+`-Bsymbolic'
+ When creating a shared library, bind references to global symbols
+ to the definition within the shared library, if any. Normally, it
+ is possible for a program linked against a shared library to
+ override the definition within the shared library. This option is
+ only meaningful on ELF platforms which support shared libraries.
+
+`-Bsymbolic-functions'
+ When creating a shared library, bind references to global function
+ symbols to the definition within the shared library, if any. This
+ option is only meaningful on ELF platforms which support shared
+ libraries.
+
+`--dynamic-list=DYNAMIC-LIST-FILE'
+ Specify the name of a dynamic list file to the linker. This is
+ typically used when creating shared libraries to specify a list of
+ global symbols whose references shouldn't be bound to the
+ definition within the shared library, or creating dynamically
+ linked executables to specify a list of symbols which should be
+ added to the symbol table in the executable. This option is only
+ meaningful on ELF platforms which support shared libraries.
+
+ The format of the dynamic list is the same as the version node
+ without scope and node name. See *Note VERSION:: for more
+ information.
+
+`--dynamic-list-data'
+ Include all global data symbols to the dynamic list.
+
+`--dynamic-list-cpp-new'
+ Provide the builtin dynamic list for C++ operator new and delete.
+ It is mainly useful for building shared libstdc++.
+
+`--dynamic-list-cpp-typeinfo'
+ Provide the builtin dynamic list for C++ runtime type
+ identification.
+
+`--check-sections'
+`--no-check-sections'
+ Asks the linker _not_ to check section addresses after they have
+ been assigned to see if there are any overlaps. Normally the
+ linker will perform this check, and if it finds any overlaps it
+ will produce suitable error messages. The linker does know about,
+ and does make allowances for sections in overlays. The default
+ behaviour can be restored by using the command line switch
+ `--check-sections'. Section overlap is not usually checked for
+ relocatable links. You can force checking in that case by using
+ the `--check-sections' option.
+
+`--cref'
+ Output a cross reference table. If a linker map file is being
+ generated, the cross reference table is printed to the map file.
+ Otherwise, it is printed on the standard output.
+
+ The format of the table is intentionally simple, so that it may be
+ easily processed by a script if necessary. The symbols are
+ printed out, sorted by name. For each symbol, a list of file
+ names is given. If the symbol is defined, the first file listed
+ is the location of the definition. The remaining files contain
+ references to the symbol.
+
+`--no-define-common'
+ This option inhibits the assignment of addresses to common symbols.
+ The script command `INHIBIT_COMMON_ALLOCATION' has the same effect.
+ *Note Miscellaneous Commands::.
+
+ The `--no-define-common' option allows decoupling the decision to
+ assign addresses to Common symbols from the choice of the output
+ file type; otherwise a non-Relocatable output type forces
+ assigning addresses to Common symbols. Using `--no-define-common'
+ allows Common symbols that are referenced from a shared library to
+ be assigned addresses only in the main program. This eliminates
+ the unused duplicate space in the shared library, and also
+ prevents any possible confusion over resolving to the wrong
+ duplicate when there are many dynamic modules with specialized
+ search paths for runtime symbol resolution.
+
+`--defsym=SYMBOL=EXPRESSION'
+ Create a global symbol in the output file, containing the absolute
+ address given by EXPRESSION. You may use this option as many
+ times as necessary to define multiple symbols in the command line.
+ A limited form of arithmetic is supported for the EXPRESSION in
+ this context: you may give a hexadecimal constant or the name of
+ an existing symbol, or use `+' and `-' to add or subtract
+ hexadecimal constants or symbols. If you need more elaborate
+ expressions, consider using the linker command language from a
+ script (*note Assignment: Symbol Definitions: Assignments.).
+ _Note:_ there should be no white space between SYMBOL, the equals
+ sign ("<=>"), and EXPRESSION.
+
+`--demangle[=STYLE]'
+`--no-demangle'
+ These options control whether to demangle symbol names in error
+ messages and other output. When the linker is told to demangle,
+ it tries to present symbol names in a readable fashion: it strips
+ leading underscores if they are used by the object file format,
+ and converts C++ mangled symbol names into user readable names.
+ Different compilers have different mangling styles. The optional
+ demangling style argument can be used to choose an appropriate
+ demangling style for your compiler. The linker will demangle by
+ default unless the environment variable `COLLECT_NO_DEMANGLE' is
+ set. These options may be used to override the default.
+
+`-IFILE'
+`--dynamic-linker=FILE'
+ Set the name of the dynamic linker. This is only meaningful when
+ generating dynamically linked ELF executables. The default dynamic
+ linker is normally correct; don't use this unless you know what
+ you are doing.
+
+`--fatal-warnings'
+`--no-fatal-warnings'
+ Treat all warnings as errors. The default behaviour can be
+ restored with the option `--no-fatal-warnings'.
+
+`--force-exe-suffix'
+ Make sure that an output file has a .exe suffix.
+
+ If a successfully built fully linked output file does not have a
+ `.exe' or `.dll' suffix, this option forces the linker to copy the
+ output file to one of the same name with a `.exe' suffix. This
+ option is useful when using unmodified Unix makefiles on a
+ Microsoft Windows host, since some versions of Windows won't run
+ an image unless it ends in a `.exe' suffix.
+
+`--gc-sections'
+`--no-gc-sections'
+ Enable garbage collection of unused input sections. It is ignored
+ on targets that do not support this option. The default behaviour
+ (of not performing this garbage collection) can be restored by
+ specifying `--no-gc-sections' on the command line.
+
+ `--gc-sections' decides which input sections are used by examining
+ symbols and relocations. The section containing the entry symbol
+ and all sections containing symbols undefined on the command-line
+ will be kept, as will sections containing symbols referenced by
+ dynamic objects. Note that when building shared libraries, the
+ linker must assume that any visible symbol is referenced. Once
+ this initial set of sections has been determined, the linker
+ recursively marks as used any section referenced by their
+ relocations. See `--entry' and `--undefined'.
+
+ This option can be set when doing a partial link (enabled with
+ option `-r'). In this case the root of symbols kept must be
+ explicitely specified either by an `--entry' or `--undefined'
+ option or by a `ENTRY' command in the linker script.
+
+`--print-gc-sections'
+`--no-print-gc-sections'
+ List all sections removed by garbage collection. The listing is
+ printed on stderr. This option is only effective if garbage
+ collection has been enabled via the `--gc-sections') option. The
+ default behaviour (of not listing the sections that are removed)
+ can be restored by specifying `--no-print-gc-sections' on the
+ command line.
+
+`--help'
+ Print a summary of the command-line options on the standard output
+ and exit.
+
+`--target-help'
+ Print a summary of all target specific options on the standard
+ output and exit.
+
+`-Map=MAPFILE'
+ Print a link map to the file MAPFILE. See the description of the
+ `-M' option, above.
+
+`--no-keep-memory'
+ `ld' normally optimizes for speed over memory usage by caching the
+ symbol tables of input files in memory. This option tells `ld' to
+ instead optimize for memory usage, by rereading the symbol tables
+ as necessary. This may be required if `ld' runs out of memory
+ space while linking a large executable.
+
+`--no-undefined'
+`-z defs'
+ Report unresolved symbol references from regular object files.
+ This is done even if the linker is creating a non-symbolic shared
+ library. The switch `--[no-]allow-shlib-undefined' controls the
+ behaviour for reporting unresolved references found in shared
+ libraries being linked in.
+
+`--allow-multiple-definition'
+`-z muldefs'
+ Normally when a symbol is defined multiple times, the linker will
+ report a fatal error. These options allow multiple definitions and
+ the first definition will be used.
+
+`--allow-shlib-undefined'
+`--no-allow-shlib-undefined'
+ Allows or disallows undefined symbols in shared libraries. This
+ switch is similar to `--no-undefined' except that it determines
+ the behaviour when the undefined symbols are in a shared library
+ rather than a regular object file. It does not affect how
+ undefined symbols in regular object files are handled.
+
+ The default behaviour is to report errors for any undefined symbols
+ referenced in shared libraries if the linker is being used to
+ create an executable, but to allow them if the linker is being
+ used to create a shared library.
+
+ The reasons for allowing undefined symbol references in shared
+ libraries specified at link time are that:
+
+ * A shared library specified at link time may not be the same
+ as the one that is available at load time, so the symbol
+ might actually be resolvable at load time.
+
+ * There are some operating systems, eg BeOS and HPPA, where
+ undefined symbols in shared libraries are normal.
+
+ The BeOS kernel for example patches shared libraries at load
+ time to select whichever function is most appropriate for the
+ current architecture. This is used, for example, to
+ dynamically select an appropriate memset function.
+
+`--no-undefined-version'
+ Normally when a symbol has an undefined version, the linker will
+ ignore it. This option disallows symbols with undefined version
+ and a fatal error will be issued instead.
+
+`--default-symver'
+ Create and use a default symbol version (the soname) for
+ unversioned exported symbols.
+
+`--default-imported-symver'
+ Create and use a default symbol version (the soname) for
+ unversioned imported symbols.
+
+`--no-warn-mismatch'
+ Normally `ld' will give an error if you try to link together input
+ files that are mismatched for some reason, perhaps because they
+ have been compiled for different processors or for different
+ endiannesses. This option tells `ld' that it should silently
+ permit such possible errors. This option should only be used with
+ care, in cases when you have taken some special action that
+ ensures that the linker errors are inappropriate.
+
+`--no-warn-search-mismatch'
+ Normally `ld' will give a warning if it finds an incompatible
+ library during a library search. This option silences the warning.
+
+`--no-whole-archive'
+ Turn off the effect of the `--whole-archive' option for subsequent
+ archive files.
+
+`--noinhibit-exec'
+ Retain the executable output file whenever it is still usable.
+ Normally, the linker will not produce an output file if it
+ encounters errors during the link process; it exits without
+ writing an output file when it issues any error whatsoever.
+
+`-nostdlib'
+ Only search library directories explicitly specified on the
+ command line. Library directories specified in linker scripts
+ (including linker scripts specified on the command line) are
+ ignored.
+
+`--oformat=OUTPUT-FORMAT'
+ `ld' may be configured to support more than one kind of object
+ file. If your `ld' is configured this way, you can use the
+ `--oformat' option to specify the binary format for the output
+ object file. Even when `ld' is configured to support alternative
+ object formats, you don't usually need to specify this, as `ld'
+ should be configured to produce as a default output format the most
+ usual format on each machine. OUTPUT-FORMAT is a text string, the
+ name of a particular format supported by the BFD libraries. (You
+ can list the available binary formats with `objdump -i'.) The
+ script command `OUTPUT_FORMAT' can also specify the output format,
+ but this option overrides it. *Note BFD::.
+
+`-pie'
+`--pic-executable'
+ Create a position independent executable. This is currently only
+ supported on ELF platforms. Position independent executables are
+ similar to shared libraries in that they are relocated by the
+ dynamic linker to the virtual address the OS chooses for them
+ (which can vary between invocations). Like normal dynamically
+ linked executables they can be executed and symbols defined in the
+ executable cannot be overridden by shared libraries.
+
+`-qmagic'
+ This option is ignored for Linux compatibility.
+
+`-Qy'
+ This option is ignored for SVR4 compatibility.
+
+`--relax'
+ An option with machine dependent effects. This option is only
+ supported on a few targets. *Note `ld' and the H8/300: H8/300.
+ *Note `ld' and the Intel 960 family: i960. *Note `ld' and Xtensa
+ Processors: Xtensa. *Note `ld' and the 68HC11 and 68HC12:
+ M68HC11/68HC12. *Note `ld' and PowerPC 32-bit ELF Support:
+ PowerPC ELF32.
+
+ On some platforms, the `--relax' option performs global
+ optimizations that become possible when the linker resolves
+ addressing in the program, such as relaxing address modes and
+ synthesizing new instructions in the output object file.
+
+ On some platforms these link time global optimizations may make
+ symbolic debugging of the resulting executable impossible. This
+ is known to be the case for the Matsushita MN10200 and MN10300
+ family of processors.
+
+ On platforms where this is not supported, `--relax' is accepted,
+ but ignored.
+
+`--retain-symbols-file=FILENAME'
+ Retain _only_ the symbols listed in the file FILENAME, discarding
+ all others. FILENAME is simply a flat file, with one symbol name
+ per line. This option is especially useful in environments (such
+ as VxWorks) where a large global symbol table is accumulated
+ gradually, to conserve run-time memory.
+
+ `--retain-symbols-file' does _not_ discard undefined symbols, or
+ symbols needed for relocations.
+
+ You may only specify `--retain-symbols-file' once in the command
+ line. It overrides `-s' and `-S'.
+
+`-rpath=DIR'
+ Add a directory to the runtime library search path. This is used
+ when linking an ELF executable with shared objects. All `-rpath'
+ arguments are concatenated and passed to the runtime linker, which
+ uses them to locate shared objects at runtime. The `-rpath'
+ option is also used when locating shared objects which are needed
+ by shared objects explicitly included in the link; see the
+ description of the `-rpath-link' option. If `-rpath' is not used
+ when linking an ELF executable, the contents of the environment
+ variable `LD_RUN_PATH' will be used if it is defined.
+
+ The `-rpath' option may also be used on SunOS. By default, on
+ SunOS, the linker will form a runtime search patch out of all the
+ `-L' options it is given. If a `-rpath' option is used, the
+ runtime search path will be formed exclusively using the `-rpath'
+ options, ignoring the `-L' options. This can be useful when using
+ gcc, which adds many `-L' options which may be on NFS mounted file
+ systems.
+
+ For compatibility with other ELF linkers, if the `-R' option is
+ followed by a directory name, rather than a file name, it is
+ treated as the `-rpath' option.
+
+`-rpath-link=DIR'
+ When using ELF or SunOS, one shared library may require another.
+ This happens when an `ld -shared' link includes a shared library
+ as one of the input files.
+
+ When the linker encounters such a dependency when doing a
+ non-shared, non-relocatable link, it will automatically try to
+ locate the required shared library and include it in the link, if
+ it is not included explicitly. In such a case, the `-rpath-link'
+ option specifies the first set of directories to search. The
+ `-rpath-link' option may specify a sequence of directory names
+ either by specifying a list of names separated by colons, or by
+ appearing multiple times.
+
+ This option should be used with caution as it overrides the search
+ path that may have been hard compiled into a shared library. In
+ such a case it is possible to use unintentionally a different
+ search path than the runtime linker would do.
+
+ The linker uses the following search paths to locate required
+ shared libraries:
+ 1. Any directories specified by `-rpath-link' options.
+
+ 2. Any directories specified by `-rpath' options. The difference
+ between `-rpath' and `-rpath-link' is that directories
+ specified by `-rpath' options are included in the executable
+ and used at runtime, whereas the `-rpath-link' option is only
+ effective at link time. Searching `-rpath' in this way is
+ only supported by native linkers and cross linkers which have
+ been configured with the `--with-sysroot' option.
+
+ 3. On an ELF system, for native linkers, if the `-rpath' and
+ `-rpath-link' options were not used, search the contents of
+ the environment variable `LD_RUN_PATH'.
+
+ 4. On SunOS, if the `-rpath' option was not used, search any
+ directories specified using `-L' options.
+
+ 5. For a native linker, the search the contents of the
+ environment variable `LD_LIBRARY_PATH'.
+
+ 6. For a native ELF linker, the directories in `DT_RUNPATH' or
+ `DT_RPATH' of a shared library are searched for shared
+ libraries needed by it. The `DT_RPATH' entries are ignored if
+ `DT_RUNPATH' entries exist.
+
+ 7. The default directories, normally `/lib' and `/usr/lib'.
+
+ 8. For a native linker on an ELF system, if the file
+ `/etc/ld.so.conf' exists, the list of directories found in
+ that file.
+
+ If the required shared library is not found, the linker will issue
+ a warning and continue with the link.
+
+`-shared'
+`-Bshareable'
+ Create a shared library. This is currently only supported on ELF,
+ XCOFF and SunOS platforms. On SunOS, the linker will
+ automatically create a shared library if the `-e' option is not
+ used and there are undefined symbols in the link.
+
+`--sort-common'
+`--sort-common=ascending'
+`--sort-common=descending'
+ This option tells `ld' to sort the common symbols by alignment in
+ ascending or descending order when it places them in the
+ appropriate output sections. The symbol alignments considered are
+ sixteen-byte or larger, eight-byte, four-byte, two-byte, and
+ one-byte. This is to prevent gaps between symbols due to alignment
+ constraints. If no sorting order is specified, then descending
+ order is assumed.
+
+`--sort-section=name'
+ This option will apply `SORT_BY_NAME' to all wildcard section
+ patterns in the linker script.
+
+`--sort-section=alignment'
+ This option will apply `SORT_BY_ALIGNMENT' to all wildcard section
+ patterns in the linker script.
+
+`--split-by-file[=SIZE]'
+ Similar to `--split-by-reloc' but creates a new output section for
+ each input file when SIZE is reached. SIZE defaults to a size of
+ 1 if not given.
+
+`--split-by-reloc[=COUNT]'
+ Tries to creates extra sections in the output file so that no
+ single output section in the file contains more than COUNT
+ relocations. This is useful when generating huge relocatable
+ files for downloading into certain real time kernels with the COFF
+ object file format; since COFF cannot represent more than 65535
+ relocations in a single section. Note that this will fail to work
+ with object file formats which do not support arbitrary sections.
+ The linker will not split up individual input sections for
+ redistribution, so if a single input section contains more than
+ COUNT relocations one output section will contain that many
+ relocations. COUNT defaults to a value of 32768.
+
+`--stats'
+ Compute and display statistics about the operation of the linker,
+ such as execution time and memory usage.
+
+`--sysroot=DIRECTORY'
+ Use DIRECTORY as the location of the sysroot, overriding the
+ configure-time default. This option is only supported by linkers
+ that were configured using `--with-sysroot'.
+
+`--traditional-format'
+ For some targets, the output of `ld' is different in some ways from
+ the output of some existing linker. This switch requests `ld' to
+ use the traditional format instead.
+
+ For example, on SunOS, `ld' combines duplicate entries in the
+ symbol string table. This can reduce the size of an output file
+ with full debugging information by over 30 percent.
+ Unfortunately, the SunOS `dbx' program can not read the resulting
+ program (`gdb' has no trouble). The `--traditional-format' switch
+ tells `ld' to not combine duplicate entries.
+
+`--section-start=SECTIONNAME=ORG'
+ Locate a section in the output file at the absolute address given
+ by ORG. You may use this option as many times as necessary to
+ locate multiple sections in the command line. ORG must be a
+ single hexadecimal integer; for compatibility with other linkers,
+ you may omit the leading `0x' usually associated with hexadecimal
+ values. _Note:_ there should be no white space between
+ SECTIONNAME, the equals sign ("<=>"), and ORG.
+
+`-Tbss=ORG'
+`-Tdata=ORG'
+`-Ttext=ORG'
+ Same as `--section-start', with `.bss', `.data' or `.text' as the
+ SECTIONNAME.
+
+`-Ttext-segment=ORG'
+ When creating an ELF executable or shared object, it will set the
+ address of the first byte of the text segment.
+
+`--unresolved-symbols=METHOD'
+ Determine how to handle unresolved symbols. There are four
+ possible values for `method':
+
+ `ignore-all'
+ Do not report any unresolved symbols.
+
+ `report-all'
+ Report all unresolved symbols. This is the default.
+
+ `ignore-in-object-files'
+ Report unresolved symbols that are contained in shared
+ libraries, but ignore them if they come from regular object
+ files.
+
+ `ignore-in-shared-libs'
+ Report unresolved symbols that come from regular object
+ files, but ignore them if they come from shared libraries.
+ This can be useful when creating a dynamic binary and it is
+ known that all the shared libraries that it should be
+ referencing are included on the linker's command line.
+
+ The behaviour for shared libraries on their own can also be
+ controlled by the `--[no-]allow-shlib-undefined' option.
+
+ Normally the linker will generate an error message for each
+ reported unresolved symbol but the option
+ `--warn-unresolved-symbols' can change this to a warning.
+
+`--dll-verbose'
+`--verbose'
+ Display the version number for `ld' and list the linker emulations
+ supported. Display which input files can and cannot be opened.
+ Display the linker script being used by the linker.
+
+`--version-script=VERSION-SCRIPTFILE'
+ Specify the name of a version script to the linker. This is
+ typically used when creating shared libraries to specify
+ additional information about the version hierarchy for the library
+ being created. This option is only fully supported on ELF
+ platforms which support shared libraries; see *Note VERSION::. It
+ is partially supported on PE platforms, which can use version
+ scripts to filter symbol visibility in auto-export mode: any
+ symbols marked `local' in the version script will not be exported.
+ *Note WIN32::.
+
+`--warn-common'
+ Warn when a common symbol is combined with another common symbol
+ or with a symbol definition. Unix linkers allow this somewhat
+ sloppy practise, but linkers on some other operating systems do
+ not. This option allows you to find potential problems from
+ combining global symbols. Unfortunately, some C libraries use
+ this practise, so you may get some warnings about symbols in the
+ libraries as well as in your programs.
+
+ There are three kinds of global symbols, illustrated here by C
+ examples:
+
+ `int i = 1;'
+ A definition, which goes in the initialized data section of
+ the output file.
+
+ `extern int i;'
+ An undefined reference, which does not allocate space. There
+ must be either a definition or a common symbol for the
+ variable somewhere.
+
+ `int i;'
+ A common symbol. If there are only (one or more) common
+ symbols for a variable, it goes in the uninitialized data
+ area of the output file. The linker merges multiple common
+ symbols for the same variable into a single symbol. If they
+ are of different sizes, it picks the largest size. The
+ linker turns a common symbol into a declaration, if there is
+ a definition of the same variable.
+
+ The `--warn-common' option can produce five kinds of warnings.
+ Each warning consists of a pair of lines: the first describes the
+ symbol just encountered, and the second describes the previous
+ symbol encountered with the same name. One or both of the two
+ symbols will be a common symbol.
+
+ 1. Turning a common symbol into a reference, because there is
+ already a definition for the symbol.
+ FILE(SECTION): warning: common of `SYMBOL'
+ overridden by definition
+ FILE(SECTION): warning: defined here
+
+ 2. Turning a common symbol into a reference, because a later
+ definition for the symbol is encountered. This is the same
+ as the previous case, except that the symbols are encountered
+ in a different order.
+ FILE(SECTION): warning: definition of `SYMBOL'
+ overriding common
+ FILE(SECTION): warning: common is here
+
+ 3. Merging a common symbol with a previous same-sized common
+ symbol.
+ FILE(SECTION): warning: multiple common
+ of `SYMBOL'
+ FILE(SECTION): warning: previous common is here
+
+ 4. Merging a common symbol with a previous larger common symbol.
+ FILE(SECTION): warning: common of `SYMBOL'
+ overridden by larger common
+ FILE(SECTION): warning: larger common is here
+
+ 5. Merging a common symbol with a previous smaller common
+ symbol. This is the same as the previous case, except that
+ the symbols are encountered in a different order.
+ FILE(SECTION): warning: common of `SYMBOL'
+ overriding smaller common
+ FILE(SECTION): warning: smaller common is here
+
+`--warn-constructors'
+ Warn if any global constructors are used. This is only useful for
+ a few object file formats. For formats like COFF or ELF, the
+ linker can not detect the use of global constructors.
+
+`--warn-multiple-gp'
+ Warn if multiple global pointer values are required in the output
+ file. This is only meaningful for certain processors, such as the
+ Alpha. Specifically, some processors put large-valued constants
+ in a special section. A special register (the global pointer)
+ points into the middle of this section, so that constants can be
+ loaded efficiently via a base-register relative addressing mode.
+ Since the offset in base-register relative mode is fixed and
+ relatively small (e.g., 16 bits), this limits the maximum size of
+ the constant pool. Thus, in large programs, it is often necessary
+ to use multiple global pointer values in order to be able to
+ address all possible constants. This option causes a warning to
+ be issued whenever this case occurs.
+
+`--warn-once'
+ Only warn once for each undefined symbol, rather than once per
+ module which refers to it.
+
+`--warn-section-align'
+ Warn if the address of an output section is changed because of
+ alignment. Typically, the alignment will be set by an input
+ section. The address will only be changed if it not explicitly
+ specified; that is, if the `SECTIONS' command does not specify a
+ start address for the section (*note SECTIONS::).
+
+`--warn-shared-textrel'
+ Warn if the linker adds a DT_TEXTREL to a shared object.
+
+`--warn-alternate-em'
+ Warn if an object has alternate ELF machine code.
+
+`--warn-unresolved-symbols'
+ If the linker is going to report an unresolved symbol (see the
+ option `--unresolved-symbols') it will normally generate an error.
+ This option makes it generate a warning instead.
+
+`--error-unresolved-symbols'
+ This restores the linker's default behaviour of generating errors
+ when it is reporting unresolved symbols.
+
+`--whole-archive'
+ For each archive mentioned on the command line after the
+ `--whole-archive' option, include every object file in the archive
+ in the link, rather than searching the archive for the required
+ object files. This is normally used to turn an archive file into
+ a shared library, forcing every object to be included in the
+ resulting shared library. This option may be used more than once.
+
+ Two notes when using this option from gcc: First, gcc doesn't know
+ about this option, so you have to use `-Wl,-whole-archive'.
+ Second, don't forget to use `-Wl,-no-whole-archive' after your
+ list of archives, because gcc will add its own list of archives to
+ your link and you may not want this flag to affect those as well.
+
+`--wrap=SYMBOL'
+ Use a wrapper function for SYMBOL. Any undefined reference to
+ SYMBOL will be resolved to `__wrap_SYMBOL'. Any undefined
+ reference to `__real_SYMBOL' will be resolved to SYMBOL.
+
+ This can be used to provide a wrapper for a system function. The
+ wrapper function should be called `__wrap_SYMBOL'. If it wishes
+ to call the system function, it should call `__real_SYMBOL'.
+
+ Here is a trivial example:
+
+ void *
+ __wrap_malloc (size_t c)
+ {
+ printf ("malloc called with %zu\n", c);
+ return __real_malloc (c);
+ }
+
+ If you link other code with this file using `--wrap malloc', then
+ all calls to `malloc' will call the function `__wrap_malloc'
+ instead. The call to `__real_malloc' in `__wrap_malloc' will call
+ the real `malloc' function.
+
+ You may wish to provide a `__real_malloc' function as well, so that
+ links without the `--wrap' option will succeed. If you do this,
+ you should not put the definition of `__real_malloc' in the same
+ file as `__wrap_malloc'; if you do, the assembler may resolve the
+ call before the linker has a chance to wrap it to `malloc'.
+
+`--eh-frame-hdr'
+ Request creation of `.eh_frame_hdr' section and ELF
+ `PT_GNU_EH_FRAME' segment header.
+
+`--enable-new-dtags'
+`--disable-new-dtags'
+ This linker can create the new dynamic tags in ELF. But the older
+ ELF systems may not understand them. If you specify
+ `--enable-new-dtags', the dynamic tags will be created as needed.
+ If you specify `--disable-new-dtags', no new dynamic tags will be
+ created. By default, the new dynamic tags are not created. Note
+ that those options are only available for ELF systems.
+
+`--hash-size=NUMBER'
+ Set the default size of the linker's hash tables to a prime number
+ close to NUMBER. Increasing this value can reduce the length of
+ time it takes the linker to perform its tasks, at the expense of
+ increasing the linker's memory requirements. Similarly reducing
+ this value can reduce the memory requirements at the expense of
+ speed.
+
+`--hash-style=STYLE'
+ Set the type of linker's hash table(s). STYLE can be either
+ `sysv' for classic ELF `.hash' section, `gnu' for new style GNU
+ `.gnu.hash' section or `both' for both the classic ELF `.hash' and
+ new style GNU `.gnu.hash' hash tables. The default is `sysv'.
+
+`--reduce-memory-overheads'
+ This option reduces memory requirements at ld runtime, at the
+ expense of linking speed. This was introduced to select the old
+ O(n^2) algorithm for link map file generation, rather than the new
+ O(n) algorithm which uses about 40% more memory for symbol storage.
+
+ Another effect of the switch is to set the default hash table size
+ to 1021, which again saves memory at the cost of lengthening the
+ linker's run time. This is not done however if the `--hash-size'
+ switch has been used.
+
+ The `--reduce-memory-overheads' switch may be also be used to
+ enable other tradeoffs in future versions of the linker.
+
+`--build-id'
+`--build-id=STYLE'
+ Request creation of `.note.gnu.build-id' ELF note section. The
+ contents of the note are unique bits identifying this linked file.
+ STYLE can be `uuid' to use 128 random bits, `sha1' to use a
+ 160-bit SHA1 hash on the normative parts of the output contents,
+ `md5' to use a 128-bit MD5 hash on the normative parts of the
+ output contents, or `0xHEXSTRING' to use a chosen bit string
+ specified as an even number of hexadecimal digits (`-' and `:'
+ characters between digit pairs are ignored). If STYLE is omitted,
+ `sha1' is used.
+
+ The `md5' and `sha1' styles produces an identifier that is always
+ the same in an identical output file, but will be unique among all
+ nonidentical output files. It is not intended to be compared as a
+ checksum for the file's contents. A linked file may be changed
+ later by other tools, but the build ID bit string identifying the
+ original linked file does not change.
+
+ Passing `none' for STYLE disables the setting from any
+ `--build-id' options earlier on the command line.
+
+2.1.1 Options Specific to i386 PE Targets
+-----------------------------------------
+
+The i386 PE linker supports the `-shared' option, which causes the
+output to be a dynamically linked library (DLL) instead of a normal
+executable. You should name the output `*.dll' when you use this
+option. In addition, the linker fully supports the standard `*.def'
+files, which may be specified on the linker command line like an object
+file (in fact, it should precede archives it exports symbols from, to
+ensure that they get linked in, just like a normal object file).
+
+ In addition to the options common to all targets, the i386 PE linker
+support additional command line options that are specific to the i386
+PE target. Options that take values may be separated from their values
+by either a space or an equals sign.
+
+`--add-stdcall-alias'
+ If given, symbols with a stdcall suffix (@NN) will be exported
+ as-is and also with the suffix stripped. [This option is specific
+ to the i386 PE targeted port of the linker]
+
+`--base-file FILE'
+ Use FILE as the name of a file in which to save the base addresses
+ of all the relocations needed for generating DLLs with `dlltool'.
+ [This is an i386 PE specific option]
+
+`--dll'
+ Create a DLL instead of a regular executable. You may also use
+ `-shared' or specify a `LIBRARY' in a given `.def' file. [This
+ option is specific to the i386 PE targeted port of the linker]
+
+`--enable-long-section-names'
+`--disable-long-section-names'
+ The PE variants of the Coff object format add an extension that
+ permits the use of section names longer than eight characters, the
+ normal limit for Coff. By default, these names are only allowed
+ in object files, as fully-linked executable images do not carry
+ the Coff string table required to support the longer names. As a
+ GNU extension, it is possible to allow their use in executable
+ images as well, or to (probably pointlessly!) disallow it in
+ object files, by using these two options. Executable images
+ generated with these long section names are slightly non-standard,
+ carrying as they do a string table, and may generate confusing
+ output when examined with non-GNU PE-aware tools, such as file
+ viewers and dumpers. However, GDB relies on the use of PE long
+ section names to find Dwarf-2 debug information sections in an
+ executable image at runtime, and so if neither option is specified
+ on the command-line, `ld' will enable long section names,
+ overriding the default and technically correct behaviour, when it
+ finds the presence of debug information while linking an executable
+ image and not stripping symbols. [This option is valid for all PE
+ targeted ports of the linker]
+
+`--enable-stdcall-fixup'
+`--disable-stdcall-fixup'
+ If the link finds a symbol that it cannot resolve, it will attempt
+ to do "fuzzy linking" by looking for another defined symbol that
+ differs only in the format of the symbol name (cdecl vs stdcall)
+ and will resolve that symbol by linking to the match. For
+ example, the undefined symbol `_foo' might be linked to the
+ function `_foo@12', or the undefined symbol `_bar@16' might be
+ linked to the function `_bar'. When the linker does this, it
+ prints a warning, since it normally should have failed to link,
+ but sometimes import libraries generated from third-party dlls may
+ need this feature to be usable. If you specify
+ `--enable-stdcall-fixup', this feature is fully enabled and
+ warnings are not printed. If you specify
+ `--disable-stdcall-fixup', this feature is disabled and such
+ mismatches are considered to be errors. [This option is specific
+ to the i386 PE targeted port of the linker]
+
+`--export-all-symbols'
+ If given, all global symbols in the objects used to build a DLL
+ will be exported by the DLL. Note that this is the default if
+ there otherwise wouldn't be any exported symbols. When symbols are
+ explicitly exported via DEF files or implicitly exported via
+ function attributes, the default is to not export anything else
+ unless this option is given. Note that the symbols `DllMain@12',
+ `DllEntryPoint@0', `DllMainCRTStartup@12', and `impure_ptr' will
+ not be automatically exported. Also, symbols imported from other
+ DLLs will not be re-exported, nor will symbols specifying the
+ DLL's internal layout such as those beginning with `_head_' or
+ ending with `_iname'. In addition, no symbols from `libgcc',
+ `libstd++', `libmingw32', or `crtX.o' will be exported. Symbols
+ whose names begin with `__rtti_' or `__builtin_' will not be
+ exported, to help with C++ DLLs. Finally, there is an extensive
+ list of cygwin-private symbols that are not exported (obviously,
+ this applies on when building DLLs for cygwin targets). These
+ cygwin-excludes are: `_cygwin_dll_entry@12',
+ `_cygwin_crt0_common@8', `_cygwin_noncygwin_dll_entry@12',
+ `_fmode', `_impure_ptr', `cygwin_attach_dll', `cygwin_premain0',
+ `cygwin_premain1', `cygwin_premain2', `cygwin_premain3', and
+ `environ'. [This option is specific to the i386 PE targeted port
+ of the linker]
+
+`--exclude-symbols SYMBOL,SYMBOL,...'
+ Specifies a list of symbols which should not be automatically
+ exported. The symbol names may be delimited by commas or colons.
+ [This option is specific to the i386 PE targeted port of the
+ linker]
+
+`--file-alignment'
+ Specify the file alignment. Sections in the file will always
+ begin at file offsets which are multiples of this number. This
+ defaults to 512. [This option is specific to the i386 PE targeted
+ port of the linker]
+
+`--heap RESERVE'
+`--heap RESERVE,COMMIT'
+ Specify the number of bytes of memory to reserve (and optionally
+ commit) to be used as heap for this program. The default is 1Mb
+ reserved, 4K committed. [This option is specific to the i386 PE
+ targeted port of the linker]
+
+`--image-base VALUE'
+ Use VALUE as the base address of your program or dll. This is the
+ lowest memory location that will be used when your program or dll
+ is loaded. To reduce the need to relocate and improve performance
+ of your dlls, each should have a unique base address and not
+ overlap any other dlls. The default is 0x400000 for executables,
+ and 0x10000000 for dlls. [This option is specific to the i386 PE
+ targeted port of the linker]
+
+`--kill-at'
+ If given, the stdcall suffixes (@NN) will be stripped from symbols
+ before they are exported. [This option is specific to the i386 PE
+ targeted port of the linker]
+
+`--large-address-aware'
+ If given, the appropriate bit in the "Characteristics" field of
+ the COFF header is set to indicate that this executable supports
+ virtual addresses greater than 2 gigabytes. This should be used
+ in conjunction with the /3GB or /USERVA=VALUE megabytes switch in
+ the "[operating systems]" section of the BOOT.INI. Otherwise,
+ this bit has no effect. [This option is specific to PE targeted
+ ports of the linker]
+
+`--major-image-version VALUE'
+ Sets the major number of the "image version". Defaults to 1.
+ [This option is specific to the i386 PE targeted port of the
+ linker]
+
+`--major-os-version VALUE'
+ Sets the major number of the "os version". Defaults to 4. [This
+ option is specific to the i386 PE targeted port of the linker]
+
+`--major-subsystem-version VALUE'
+ Sets the major number of the "subsystem version". Defaults to 4.
+ [This option is specific to the i386 PE targeted port of the
+ linker]
+
+`--minor-image-version VALUE'
+ Sets the minor number of the "image version". Defaults to 0.
+ [This option is specific to the i386 PE targeted port of the
+ linker]
+
+`--minor-os-version VALUE'
+ Sets the minor number of the "os version". Defaults to 0. [This
+ option is specific to the i386 PE targeted port of the linker]
+
+`--minor-subsystem-version VALUE'
+ Sets the minor number of the "subsystem version". Defaults to 0.
+ [This option is specific to the i386 PE targeted port of the
+ linker]
+
+`--output-def FILE'
+ The linker will create the file FILE which will contain a DEF file
+ corresponding to the DLL the linker is generating. This DEF file
+ (which should be called `*.def') may be used to create an import
+ library with `dlltool' or may be used as a reference to
+ automatically or implicitly exported symbols. [This option is
+ specific to the i386 PE targeted port of the linker]
+
+`--out-implib FILE'
+ The linker will create the file FILE which will contain an import
+ lib corresponding to the DLL the linker is generating. This import
+ lib (which should be called `*.dll.a' or `*.a' may be used to link
+ clients against the generated DLL; this behaviour makes it
+ possible to skip a separate `dlltool' import library creation step.
+ [This option is specific to the i386 PE targeted port of the
+ linker]
+
+`--enable-auto-image-base'
+ Automatically choose the image base for DLLs, unless one is
+ specified using the `--image-base' argument. By using a hash
+ generated from the dllname to create unique image bases for each
+ DLL, in-memory collisions and relocations which can delay program
+ execution are avoided. [This option is specific to the i386 PE
+ targeted port of the linker]
+
+`--disable-auto-image-base'
+ Do not automatically generate a unique image base. If there is no
+ user-specified image base (`--image-base') then use the platform
+ default. [This option is specific to the i386 PE targeted port of
+ the linker]
+
+`--dll-search-prefix STRING'
+ When linking dynamically to a dll without an import library,
+ search for `<string><basename>.dll' in preference to
+ `lib<basename>.dll'. This behaviour allows easy distinction
+ between DLLs built for the various "subplatforms": native, cygwin,
+ uwin, pw, etc. For instance, cygwin DLLs typically use
+ `--dll-search-prefix=cyg'. [This option is specific to the i386
+ PE targeted port of the linker]
+
+`--enable-auto-import'
+ Do sophisticated linking of `_symbol' to `__imp__symbol' for DATA
+ imports from DLLs, and create the necessary thunking symbols when
+ building the import libraries with those DATA exports. Note: Use
+ of the 'auto-import' extension will cause the text section of the
+ image file to be made writable. This does not conform to the
+ PE-COFF format specification published by Microsoft.
+
+ Note - use of the 'auto-import' extension will also cause read only
+ data which would normally be placed into the .rdata section to be
+ placed into the .data section instead. This is in order to work
+ around a problem with consts that is described here:
+ http://www.cygwin.com/ml/cygwin/2004-09/msg01101.html
+
+ Using 'auto-import' generally will 'just work' - but sometimes you
+ may see this message:
+
+ "variable '<var>' can't be auto-imported. Please read the
+ documentation for ld's `--enable-auto-import' for details."
+
+ This message occurs when some (sub)expression accesses an address
+ ultimately given by the sum of two constants (Win32 import tables
+ only allow one). Instances where this may occur include accesses
+ to member fields of struct variables imported from a DLL, as well
+ as using a constant index into an array variable imported from a
+ DLL. Any multiword variable (arrays, structs, long long, etc) may
+ trigger this error condition. However, regardless of the exact
+ data type of the offending exported variable, ld will always
+ detect it, issue the warning, and exit.
+
+ There are several ways to address this difficulty, regardless of
+ the data type of the exported variable:
+
+ One way is to use -enable-runtime-pseudo-reloc switch. This leaves
+ the task of adjusting references in your client code for runtime
+ environment, so this method works only when runtime environment
+ supports this feature.
+
+ A second solution is to force one of the 'constants' to be a
+ variable - that is, unknown and un-optimizable at compile time.
+ For arrays, there are two possibilities: a) make the indexee (the
+ array's address) a variable, or b) make the 'constant' index a
+ variable. Thus:
+
+ extern type extern_array[];
+ extern_array[1] -->
+ { volatile type *t=extern_array; t[1] }
+
+ or
+
+ extern type extern_array[];
+ extern_array[1] -->
+ { volatile int t=1; extern_array[t] }
+
+ For structs (and most other multiword data types) the only option
+ is to make the struct itself (or the long long, or the ...)
+ variable:
+
+ extern struct s extern_struct;
+ extern_struct.field -->
+ { volatile struct s *t=&extern_struct; t->field }
+
+ or
+
+ extern long long extern_ll;
+ extern_ll -->
+ { volatile long long * local_ll=&extern_ll; *local_ll }
+
+ A third method of dealing with this difficulty is to abandon
+ 'auto-import' for the offending symbol and mark it with
+ `__declspec(dllimport)'. However, in practise that requires using
+ compile-time #defines to indicate whether you are building a DLL,
+ building client code that will link to the DLL, or merely
+ building/linking to a static library. In making the choice
+ between the various methods of resolving the 'direct address with
+ constant offset' problem, you should consider typical real-world
+ usage:
+
+ Original:
+ --foo.h
+ extern int arr[];
+ --foo.c
+ #include "foo.h"
+ void main(int argc, char **argv){
+ printf("%d\n",arr[1]);
+ }
+
+ Solution 1:
+ --foo.h
+ extern int arr[];
+ --foo.c
+ #include "foo.h"
+ void main(int argc, char **argv){
+ /* This workaround is for win32 and cygwin; do not "optimize" */
+ volatile int *parr = arr;
+ printf("%d\n",parr[1]);
+ }
+
+ Solution 2:
+ --foo.h
+ /* Note: auto-export is assumed (no __declspec(dllexport)) */
+ #if (defined(_WIN32) || defined(__CYGWIN__)) && \
+ !(defined(FOO_BUILD_DLL) || defined(FOO_STATIC))
+ #define FOO_IMPORT __declspec(dllimport)
+ #else
+ #define FOO_IMPORT
+ #endif
+ extern FOO_IMPORT int arr[];
+ --foo.c
+ #include "foo.h"
+ void main(int argc, char **argv){
+ printf("%d\n",arr[1]);
+ }
+
+ A fourth way to avoid this problem is to re-code your library to
+ use a functional interface rather than a data interface for the
+ offending variables (e.g. set_foo() and get_foo() accessor
+ functions). [This option is specific to the i386 PE targeted port
+ of the linker]
+
+`--disable-auto-import'
+ Do not attempt to do sophisticated linking of `_symbol' to
+ `__imp__symbol' for DATA imports from DLLs. [This option is
+ specific to the i386 PE targeted port of the linker]
+
+`--enable-runtime-pseudo-reloc'
+ If your code contains expressions described in -enable-auto-import
+ section, that is, DATA imports from DLL with non-zero offset, this
+ switch will create a vector of 'runtime pseudo relocations' which
+ can be used by runtime environment to adjust references to such
+ data in your client code. [This option is specific to the i386 PE
+ targeted port of the linker]
+
+`--disable-runtime-pseudo-reloc'
+ Do not create pseudo relocations for non-zero offset DATA imports
+ from DLLs. This is the default. [This option is specific to the
+ i386 PE targeted port of the linker]
+
+`--enable-extra-pe-debug'
+ Show additional debug info related to auto-import symbol thunking.
+ [This option is specific to the i386 PE targeted port of the
+ linker]
+
+`--section-alignment'
+ Sets the section alignment. Sections in memory will always begin
+ at addresses which are a multiple of this number. Defaults to
+ 0x1000. [This option is specific to the i386 PE targeted port of
+ the linker]
+
+`--stack RESERVE'
+`--stack RESERVE,COMMIT'
+ Specify the number of bytes of memory to reserve (and optionally
+ commit) to be used as stack for this program. The default is 2Mb
+ reserved, 4K committed. [This option is specific to the i386 PE
+ targeted port of the linker]
+
+`--subsystem WHICH'
+`--subsystem WHICH:MAJOR'
+`--subsystem WHICH:MAJOR.MINOR'
+ Specifies the subsystem under which your program will execute. The
+ legal values for WHICH are `native', `windows', `console',
+ `posix', and `xbox'. You may optionally set the subsystem version
+ also. Numeric values are also accepted for WHICH. [This option
+ is specific to the i386 PE targeted port of the linker]
+
+ The following options set flags in the `DllCharacteristics' field
+ of the PE file header: [These options are specific to PE targeted
+ ports of the linker]
+
+`--dynamicbase'
+ The image base address may be relocated using address space layout
+ randomization (ASLR). This feature was introduced with MS Windows
+ Vista for i386 PE targets.
+
+`--forceinteg'
+ Code integrity checks are enforced.
+
+`--nxcompat'
+ The image is compatible with the Data Execution Prevention. This
+ feature was introduced with MS Windows XP SP2 for i386 PE targets.
+
+`--no-isolation'
+ Although the image understands isolation, do not isolate the image.
+
+`--no-seh'
+ The image does not use SEH. No SE handler may be called from this
+ image.
+
+`--no-bind'
+ Do not bind this image.
+
+`--wdmdriver'
+ The driver uses the MS Windows Driver Model.
+
+`--tsaware'
+ The image is Terminal Server aware.
+
+
+2.1.2 Options specific to Motorola 68HC11 and 68HC12 targets
+------------------------------------------------------------
+
+The 68HC11 and 68HC12 linkers support specific options to control the
+memory bank switching mapping and trampoline code generation.
+
+`--no-trampoline'
+ This option disables the generation of trampoline. By default a
+ trampoline is generated for each far function which is called
+ using a `jsr' instruction (this happens when a pointer to a far
+ function is taken).
+
+`--bank-window NAME'
+ This option indicates to the linker the name of the memory region
+ in the `MEMORY' specification that describes the memory bank
+ window. The definition of such region is then used by the linker
+ to compute paging and addresses within the memory window.
+
+
+2.1.3 Options specific to Motorola 68K target
+---------------------------------------------
+
+The following options are supported to control handling of GOT
+generation when linking for 68K targets.
+
+`--got=TYPE'
+ This option tells the linker which GOT generation scheme to use.
+ TYPE should be one of `single', `negative', `multigot' or
+ `target'. For more information refer to the Info entry for `ld'.
+
+
+
+File: ld.info, Node: Environment, Prev: Options, Up: Invocation
+
+2.2 Environment Variables
+=========================
+
+You can change the behaviour of `ld' with the environment variables
+`GNUTARGET', `LDEMULATION' and `COLLECT_NO_DEMANGLE'.
+
+ `GNUTARGET' determines the input-file object format if you don't use
+`-b' (or its synonym `--format'). Its value should be one of the BFD
+names for an input format (*note BFD::). If there is no `GNUTARGET' in
+the environment, `ld' uses the natural format of the target. If
+`GNUTARGET' is set to `default' then BFD attempts to discover the input
+format by examining binary input files; this method often succeeds, but
+there are potential ambiguities, since there is no method of ensuring
+that the magic number used to specify object-file formats is unique.
+However, the configuration procedure for BFD on each system places the
+conventional format for that system first in the search-list, so
+ambiguities are resolved in favor of convention.
+
+ `LDEMULATION' determines the default emulation if you don't use the
+`-m' option. The emulation can affect various aspects of linker
+behaviour, particularly the default linker script. You can list the
+available emulations with the `--verbose' or `-V' options. If the `-m'
+option is not used, and the `LDEMULATION' environment variable is not
+defined, the default emulation depends upon how the linker was
+configured.
+
+ Normally, the linker will default to demangling symbols. However, if
+`COLLECT_NO_DEMANGLE' is set in the environment, then it will default
+to not demangling symbols. This environment variable is used in a
+similar fashion by the `gcc' linker wrapper program. The default may
+be overridden by the `--demangle' and `--no-demangle' options.
+
+
+File: ld.info, Node: Scripts, Next: Machine Dependent, Prev: Invocation, Up: Top
+
+3 Linker Scripts
+****************
+
+Every link is controlled by a "linker script". This script is written
+in the linker command language.
+
+ The main purpose of the linker script is to describe how the
+sections in the input files should be mapped into the output file, and
+to control the memory layout of the output file. Most linker scripts
+do nothing more than this. However, when necessary, the linker script
+can also direct the linker to perform many other operations, using the
+commands described below.
+
+ The linker always uses a linker script. If you do not supply one
+yourself, the linker will use a default script that is compiled into the
+linker executable. You can use the `--verbose' command line option to
+display the default linker script. Certain command line options, such
+as `-r' or `-N', will affect the default linker script.
+
+ You may supply your own linker script by using the `-T' command line
+option. When you do this, your linker script will replace the default
+linker script.
+
+ You may also use linker scripts implicitly by naming them as input
+files to the linker, as though they were files to be linked. *Note
+Implicit Linker Scripts::.
+
+* Menu:
+
+* Basic Script Concepts:: Basic Linker Script Concepts
+* Script Format:: Linker Script Format
+* Simple Example:: Simple Linker Script Example
+* Simple Commands:: Simple Linker Script Commands
+* Assignments:: Assigning Values to Symbols
+* SECTIONS:: SECTIONS Command
+* MEMORY:: MEMORY Command
+* PHDRS:: PHDRS Command
+* VERSION:: VERSION Command
+* Expressions:: Expressions in Linker Scripts
+* Implicit Linker Scripts:: Implicit Linker Scripts
+
+
+File: ld.info, Node: Basic Script Concepts, Next: Script Format, Up: Scripts
+
+3.1 Basic Linker Script Concepts
+================================
+
+We need to define some basic concepts and vocabulary in order to
+describe the linker script language.
+
+ The linker combines input files into a single output file. The
+output file and each input file are in a special data format known as an
+"object file format". Each file is called an "object file". The
+output file is often called an "executable", but for our purposes we
+will also call it an object file. Each object file has, among other
+things, a list of "sections". We sometimes refer to a section in an
+input file as an "input section"; similarly, a section in the output
+file is an "output section".
+
+ Each section in an object file has a name and a size. Most sections
+also have an associated block of data, known as the "section contents".
+A section may be marked as "loadable", which mean that the contents
+should be loaded into memory when the output file is run. A section
+with no contents may be "allocatable", which means that an area in
+memory should be set aside, but nothing in particular should be loaded
+there (in some cases this memory must be zeroed out). A section which
+is neither loadable nor allocatable typically contains some sort of
+debugging information.
+
+ Every loadable or allocatable output section has two addresses. The
+first is the "VMA", or virtual memory address. This is the address the
+section will have when the output file is run. The second is the
+"LMA", or load memory address. This is the address at which the
+section will be loaded. In most cases the two addresses will be the
+same. An example of when they might be different is when a data section
+is loaded into ROM, and then copied into RAM when the program starts up
+(this technique is often used to initialize global variables in a ROM
+based system). In this case the ROM address would be the LMA, and the
+RAM address would be the VMA.
+
+ You can see the sections in an object file by using the `objdump'
+program with the `-h' option.
+
+ Every object file also has a list of "symbols", known as the "symbol
+table". A symbol may be defined or undefined. Each symbol has a name,
+and each defined symbol has an address, among other information. If
+you compile a C or C++ program into an object file, you will get a
+defined symbol for every defined function and global or static
+variable. Every undefined function or global variable which is
+referenced in the input file will become an undefined symbol.
+
+ You can see the symbols in an object file by using the `nm' program,
+or by using the `objdump' program with the `-t' option.
+
+
+File: ld.info, Node: Script Format, Next: Simple Example, Prev: Basic Script Concepts, Up: Scripts
+
+3.2 Linker Script Format
+========================
+
+Linker scripts are text files.
+
+ You write a linker script as a series of commands. Each command is
+either a keyword, possibly followed by arguments, or an assignment to a
+symbol. You may separate commands using semicolons. Whitespace is
+generally ignored.
+
+ Strings such as file or format names can normally be entered
+directly. If the file name contains a character such as a comma which
+would otherwise serve to separate file names, you may put the file name
+in double quotes. There is no way to use a double quote character in a
+file name.
+
+ You may include comments in linker scripts just as in C, delimited by
+`/*' and `*/'. As in C, comments are syntactically equivalent to
+whitespace.
+
+
+File: ld.info, Node: Simple Example, Next: Simple Commands, Prev: Script Format, Up: Scripts
+
+3.3 Simple Linker Script Example
+================================
+
+Many linker scripts are fairly simple.
+
+ The simplest possible linker script has just one command:
+`SECTIONS'. You use the `SECTIONS' command to describe the memory
+layout of the output file.
+
+ The `SECTIONS' command is a powerful command. Here we will describe
+a simple use of it. Let's assume your program consists only of code,
+initialized data, and uninitialized data. These will be in the
+`.text', `.data', and `.bss' sections, respectively. Let's assume
+further that these are the only sections which appear in your input
+files.
+
+ For this example, let's say that the code should be loaded at address
+0x10000, and that the data should start at address 0x8000000. Here is a
+linker script which will do that:
+ SECTIONS
+ {
+ . = 0x10000;
+ .text : { *(.text) }
+ . = 0x8000000;
+ .data : { *(.data) }
+ .bss : { *(.bss) }
+ }
+
+ You write the `SECTIONS' command as the keyword `SECTIONS', followed
+by a series of symbol assignments and output section descriptions
+enclosed in curly braces.
+
+ The first line inside the `SECTIONS' command of the above example
+sets the value of the special symbol `.', which is the location
+counter. If you do not specify the address of an output section in some
+other way (other ways are described later), the address is set from the
+current value of the location counter. The location counter is then
+incremented by the size of the output section. At the start of the
+`SECTIONS' command, the location counter has the value `0'.
+
+ The second line defines an output section, `.text'. The colon is
+required syntax which may be ignored for now. Within the curly braces
+after the output section name, you list the names of the input sections
+which should be placed into this output section. The `*' is a wildcard
+which matches any file name. The expression `*(.text)' means all
+`.text' input sections in all input files.
+
+ Since the location counter is `0x10000' when the output section
+`.text' is defined, the linker will set the address of the `.text'
+section in the output file to be `0x10000'.
+
+ The remaining lines define the `.data' and `.bss' sections in the
+output file. The linker will place the `.data' output section at
+address `0x8000000'. After the linker places the `.data' output
+section, the value of the location counter will be `0x8000000' plus the
+size of the `.data' output section. The effect is that the linker will
+place the `.bss' output section immediately after the `.data' output
+section in memory.
+
+ The linker will ensure that each output section has the required
+alignment, by increasing the location counter if necessary. In this
+example, the specified addresses for the `.text' and `.data' sections
+will probably satisfy any alignment constraints, but the linker may
+have to create a small gap between the `.data' and `.bss' sections.
+
+ That's it! That's a simple and complete linker script.
+
+
+File: ld.info, Node: Simple Commands, Next: Assignments, Prev: Simple Example, Up: Scripts
+
+3.4 Simple Linker Script Commands
+=================================
+
+In this section we describe the simple linker script commands.
+
+* Menu:
+
+* Entry Point:: Setting the entry point
+* File Commands:: Commands dealing with files
+
+* Format Commands:: Commands dealing with object file formats
+
+* REGION_ALIAS:: Assign alias names to memory regions
+* Miscellaneous Commands:: Other linker script commands
+
+
+File: ld.info, Node: Entry Point, Next: File Commands, Up: Simple Commands
+
+3.4.1 Setting the Entry Point
+-----------------------------
+
+The first instruction to execute in a program is called the "entry
+point". You can use the `ENTRY' linker script command to set the entry
+point. The argument is a symbol name:
+ ENTRY(SYMBOL)
+
+ There are several ways to set the entry point. The linker will set
+the entry point by trying each of the following methods in order, and
+stopping when one of them succeeds:
+ * the `-e' ENTRY command-line option;
+
+ * the `ENTRY(SYMBOL)' command in a linker script;
+
+ * the value of the symbol `start', if defined;
+
+ * the address of the first byte of the `.text' section, if present;
+
+ * The address `0'.
+
+
+File: ld.info, Node: File Commands, Next: Format Commands, Prev: Entry Point, Up: Simple Commands
+
+3.4.2 Commands Dealing with Files
+---------------------------------
+
+Several linker script commands deal with files.
+
+`INCLUDE FILENAME'
+ Include the linker script FILENAME at this point. The file will
+ be searched for in the current directory, and in any directory
+ specified with the `-L' option. You can nest calls to `INCLUDE'
+ up to 10 levels deep.
+
+ You can place `INCLUDE' directives at the top level, in `MEMORY' or
+ `SECTIONS' commands, or in output section descriptions.
+
+`INPUT(FILE, FILE, ...)'
+`INPUT(FILE FILE ...)'
+ The `INPUT' command directs the linker to include the named files
+ in the link, as though they were named on the command line.
+
+ For example, if you always want to include `subr.o' any time you do
+ a link, but you can't be bothered to put it on every link command
+ line, then you can put `INPUT (subr.o)' in your linker script.
+
+ In fact, if you like, you can list all of your input files in the
+ linker script, and then invoke the linker with nothing but a `-T'
+ option.
+
+ In case a "sysroot prefix" is configured, and the filename starts
+ with the `/' character, and the script being processed was located
+ inside the "sysroot prefix", the filename will be looked for in
+ the "sysroot prefix". Otherwise, the linker will try to open the
+ file in the current directory. If it is not found, the linker
+ will search through the archive library search path. See the
+ description of `-L' in *Note Command Line Options: Options.
+
+ If you use `INPUT (-lFILE)', `ld' will transform the name to
+ `libFILE.a', as with the command line argument `-l'.
+
+ When you use the `INPUT' command in an implicit linker script, the
+ files will be included in the link at the point at which the linker
+ script file is included. This can affect archive searching.
+
+`GROUP(FILE, FILE, ...)'
+`GROUP(FILE FILE ...)'
+ The `GROUP' command is like `INPUT', except that the named files
+ should all be archives, and they are searched repeatedly until no
+ new undefined references are created. See the description of `-('
+ in *Note Command Line Options: Options.
+
+`AS_NEEDED(FILE, FILE, ...)'
+`AS_NEEDED(FILE FILE ...)'
+ This construct can appear only inside of the `INPUT' or `GROUP'
+ commands, among other filenames. The files listed will be handled
+ as if they appear directly in the `INPUT' or `GROUP' commands,
+ with the exception of ELF shared libraries, that will be added only
+ when they are actually needed. This construct essentially enables
+ `--as-needed' option for all the files listed inside of it and
+ restores previous `--as-needed' resp. `--no-as-needed' setting
+ afterwards.
+
+`OUTPUT(FILENAME)'
+ The `OUTPUT' command names the output file. Using
+ `OUTPUT(FILENAME)' in the linker script is exactly like using `-o
+ FILENAME' on the command line (*note Command Line Options:
+ Options.). If both are used, the command line option takes
+ precedence.
+
+ You can use the `OUTPUT' command to define a default name for the
+ output file other than the usual default of `a.out'.
+
+`SEARCH_DIR(PATH)'
+ The `SEARCH_DIR' command adds PATH to the list of paths where `ld'
+ looks for archive libraries. Using `SEARCH_DIR(PATH)' is exactly
+ like using `-L PATH' on the command line (*note Command Line
+ Options: Options.). If both are used, then the linker will search
+ both paths. Paths specified using the command line option are
+ searched first.
+
+`STARTUP(FILENAME)'
+ The `STARTUP' command is just like the `INPUT' command, except
+ that FILENAME will become the first input file to be linked, as
+ though it were specified first on the command line. This may be
+ useful when using a system in which the entry point is always the
+ start of the first file.
+
+
+File: ld.info, Node: Format Commands, Next: REGION_ALIAS, Prev: File Commands, Up: Simple Commands
+
+3.4.3 Commands Dealing with Object File Formats
+-----------------------------------------------
+
+A couple of linker script commands deal with object file formats.
+
+`OUTPUT_FORMAT(BFDNAME)'
+`OUTPUT_FORMAT(DEFAULT, BIG, LITTLE)'
+ The `OUTPUT_FORMAT' command names the BFD format to use for the
+ output file (*note BFD::). Using `OUTPUT_FORMAT(BFDNAME)' is
+ exactly like using `--oformat BFDNAME' on the command line (*note
+ Command Line Options: Options.). If both are used, the command
+ line option takes precedence.
+
+ You can use `OUTPUT_FORMAT' with three arguments to use different
+ formats based on the `-EB' and `-EL' command line options. This
+ permits the linker script to set the output format based on the
+ desired endianness.
+
+ If neither `-EB' nor `-EL' are used, then the output format will
+ be the first argument, DEFAULT. If `-EB' is used, the output
+ format will be the second argument, BIG. If `-EL' is used, the
+ output format will be the third argument, LITTLE.
+
+ For example, the default linker script for the MIPS ELF target
+ uses this command:
+ OUTPUT_FORMAT(elf32-bigmips, elf32-bigmips, elf32-littlemips)
+ This says that the default format for the output file is
+ `elf32-bigmips', but if the user uses the `-EL' command line
+ option, the output file will be created in the `elf32-littlemips'
+ format.
+
+`TARGET(BFDNAME)'
+ The `TARGET' command names the BFD format to use when reading input
+ files. It affects subsequent `INPUT' and `GROUP' commands. This
+ command is like using `-b BFDNAME' on the command line (*note
+ Command Line Options: Options.). If the `TARGET' command is used
+ but `OUTPUT_FORMAT' is not, then the last `TARGET' command is also
+ used to set the format for the output file. *Note BFD::.
+
+
+File: ld.info, Node: REGION_ALIAS, Next: Miscellaneous Commands, Prev: Format Commands, Up: Simple Commands
+
+3.4.4 Assign alias names to memory regions
+------------------------------------------
+
+Alias names can be added to existing memory regions created with the
+*Note MEMORY:: command. Each name corresponds to at most one memory
+region.
+
+ REGION_ALIAS(ALIAS, REGION)
+
+ The `REGION_ALIAS' function creates an alias name ALIAS for the
+memory region REGION. This allows a flexible mapping of output sections
+to memory regions. An example follows.
+
+ Suppose we have an application for embedded systems which come with
+various memory storage devices. All have a general purpose, volatile
+memory `RAM' that allows code execution or data storage. Some may have
+a read-only, non-volatile memory `ROM' that allows code execution and
+read-only data access. The last variant is a read-only, non-volatile
+memory `ROM2' with read-only data access and no code execution
+capability. We have four output sections:
+
+ * `.text' program code;
+
+ * `.rodata' read-only data;
+
+ * `.data' read-write initialized data;
+
+ * `.bss' read-write zero initialized data.
+
+ The goal is to provide a linker command file that contains a system
+independent part defining the output sections and a system dependent
+part mapping the output sections to the memory regions available on the
+system. Our embedded systems come with three different memory setups
+`A', `B' and `C':
+Section Variant A Variant B Variant C
+.text RAM ROM ROM
+.rodata RAM ROM ROM2
+.data RAM RAM/ROM RAM/ROM2
+.bss RAM RAM RAM
+ The notation `RAM/ROM' or `RAM/ROM2' means that this section is
+loaded into region `ROM' or `ROM2' respectively. Please note that the
+load address of the `.data' section starts in all three variants at the
+end of the `.rodata' section.
+
+ The base linker script that deals with the output sections follows.
+It includes the system dependent `linkcmds.memory' file that describes
+the memory layout:
+ INCLUDE linkcmds.memory
+
+ SECTIONS
+ {
+ .text :
+ {
+ *(.text)
+ } > REGION_TEXT
+ .rodata :
+ {
+ *(.rodata)
+ rodata_end = .;
+ } > REGION_RODATA
+ .data : AT (rodata_end)
+ {
+ data_start = .;
+ *(.data)
+ } > REGION_DATA
+ data_size = SIZEOF(.data);
+ data_load_start = LOADADDR(.data);
+ .bss :
+ {
+ *(.bss)
+ } > REGION_BSS
+ }
+
+ Now we need three different `linkcmds.memory' files to define memory
+regions and alias names. The content of `linkcmds.memory' for the three
+variants `A', `B' and `C':
+`A'
+ Here everything goes into the `RAM'.
+ MEMORY
+ {
+ RAM : ORIGIN = 0, LENGTH = 4M
+ }
+
+ REGION_ALIAS("REGION_TEXT", RAM);
+ REGION_ALIAS("REGION_RODATA", RAM);
+ REGION_ALIAS("REGION_DATA", RAM);
+ REGION_ALIAS("REGION_BSS", RAM);
+
+`B'
+ Program code and read-only data go into the `ROM'. Read-write
+ data goes into the `RAM'. An image of the initialized data is
+ loaded into the `ROM' and will be copied during system start into
+ the `RAM'.
+ MEMORY
+ {
+ ROM : ORIGIN = 0, LENGTH = 3M
+ RAM : ORIGIN = 0x10000000, LENGTH = 1M
+ }
+
+ REGION_ALIAS("REGION_TEXT", ROM);
+ REGION_ALIAS("REGION_RODATA", ROM);
+ REGION_ALIAS("REGION_DATA", RAM);
+ REGION_ALIAS("REGION_BSS", RAM);
+
+`C'
+ Program code goes into the `ROM'. Read-only data goes into the
+ `ROM2'. Read-write data goes into the `RAM'. An image of the
+ initialized data is loaded into the `ROM2' and will be copied
+ during system start into the `RAM'.
+ MEMORY
+ {
+ ROM : ORIGIN = 0, LENGTH = 2M
+ ROM2 : ORIGIN = 0x10000000, LENGTH = 1M
+ RAM : ORIGIN = 0x20000000, LENGTH = 1M
+ }
+
+ REGION_ALIAS("REGION_TEXT", ROM);
+ REGION_ALIAS("REGION_RODATA", ROM2);
+ REGION_ALIAS("REGION_DATA", RAM);
+ REGION_ALIAS("REGION_BSS", RAM);
+
+ It is possible to write a common system initialization routine to
+copy the `.data' section from `ROM' or `ROM2' into the `RAM' if
+necessary:
+ #include <string.h>
+
+ extern char data_start [];
+ extern char data_size [];
+ extern char data_load_start [];
+
+ void copy_data(void)
+ {
+ if (data_start != data_load_start)
+ {
+ memcpy(data_start, data_load_start, (size_t) data_size);
+ }
+ }
+
+
+File: ld.info, Node: Miscellaneous Commands, Prev: REGION_ALIAS, Up: Simple Commands
+
+3.4.5 Other Linker Script Commands
+----------------------------------
+
+There are a few other linker scripts commands.
+
+`ASSERT(EXP, MESSAGE)'
+ Ensure that EXP is non-zero. If it is zero, then exit the linker
+ with an error code, and print MESSAGE.
+
+`EXTERN(SYMBOL SYMBOL ...)'
+ Force SYMBOL to be entered in the output file as an undefined
+ symbol. Doing this may, for example, trigger linking of additional
+ modules from standard libraries. You may list several SYMBOLs for
+ each `EXTERN', and you may use `EXTERN' multiple times. This
+ command has the same effect as the `-u' command-line option.
+
+`FORCE_COMMON_ALLOCATION'
+ This command has the same effect as the `-d' command-line option:
+ to make `ld' assign space to common symbols even if a relocatable
+ output file is specified (`-r').
+
+`INHIBIT_COMMON_ALLOCATION'
+ This command has the same effect as the `--no-define-common'
+ command-line option: to make `ld' omit the assignment of addresses
+ to common symbols even for a non-relocatable output file.
+
+`INSERT [ AFTER | BEFORE ] OUTPUT_SECTION'
+ This command is typically used in a script specified by `-T' to
+ augment the default `SECTIONS' with, for example, overlays. It
+ inserts all prior linker script statements after (or before)
+ OUTPUT_SECTION, and also causes `-T' to not override the default
+ linker script. The exact insertion point is as for orphan
+ sections. *Note Location Counter::. The insertion happens after
+ the linker has mapped input sections to output sections. Prior to
+ the insertion, since `-T' scripts are parsed before the default
+ linker script, statements in the `-T' script occur before the
+ default linker script statements in the internal linker
+ representation of the script. In particular, input section
+ assignments will be made to `-T' output sections before those in
+ the default script. Here is an example of how a `-T' script using
+ `INSERT' might look:
+
+ SECTIONS
+ {
+ OVERLAY :
+ {
+ .ov1 { ov1*(.text) }
+ .ov2 { ov2*(.text) }
+ }
+ }
+ INSERT AFTER .text;
+
+`NOCROSSREFS(SECTION SECTION ...)'
+ This command may be used to tell `ld' to issue an error about any
+ references among certain output sections.
+
+ In certain types of programs, particularly on embedded systems when
+ using overlays, when one section is loaded into memory, another
+ section will not be. Any direct references between the two
+ sections would be errors. For example, it would be an error if
+ code in one section called a function defined in the other section.
+
+ The `NOCROSSREFS' command takes a list of output section names. If
+ `ld' detects any cross references between the sections, it reports
+ an error and returns a non-zero exit status. Note that the
+ `NOCROSSREFS' command uses output section names, not input section
+ names.
+
+`OUTPUT_ARCH(BFDARCH)'
+ Specify a particular output machine architecture. The argument is
+ one of the names used by the BFD library (*note BFD::). You can
+ see the architecture of an object file by using the `objdump'
+ program with the `-f' option.
+
+
+File: ld.info, Node: Assignments, Next: SECTIONS, Prev: Simple Commands, Up: Scripts
+
+3.5 Assigning Values to Symbols
+===============================
+
+You may assign a value to a symbol in a linker script. This will define
+the symbol and place it into the symbol table with a global scope.
+
+* Menu:
+
+* Simple Assignments:: Simple Assignments
+* PROVIDE:: PROVIDE
+* PROVIDE_HIDDEN:: PROVIDE_HIDDEN
+* Source Code Reference:: How to use a linker script defined symbol in source code
+
+
+File: ld.info, Node: Simple Assignments, Next: PROVIDE, Up: Assignments
+
+3.5.1 Simple Assignments
+------------------------
+
+You may assign to a symbol using any of the C assignment operators:
+
+`SYMBOL = EXPRESSION ;'
+`SYMBOL += EXPRESSION ;'
+`SYMBOL -= EXPRESSION ;'
+`SYMBOL *= EXPRESSION ;'
+`SYMBOL /= EXPRESSION ;'
+`SYMBOL <<= EXPRESSION ;'
+`SYMBOL >>= EXPRESSION ;'
+`SYMBOL &= EXPRESSION ;'
+`SYMBOL |= EXPRESSION ;'
+
+ The first case will define SYMBOL to the value of EXPRESSION. In
+the other cases, SYMBOL must already be defined, and the value will be
+adjusted accordingly.
+
+ The special symbol name `.' indicates the location counter. You may
+only use this within a `SECTIONS' command. *Note Location Counter::.
+
+ The semicolon after EXPRESSION is required.
+
+ Expressions are defined below; see *Note Expressions::.
+
+ You may write symbol assignments as commands in their own right, or
+as statements within a `SECTIONS' command, or as part of an output
+section description in a `SECTIONS' command.
+
+ The section of the symbol will be set from the section of the
+expression; for more information, see *Note Expression Section::.
+
+ Here is an example showing the three different places that symbol
+assignments may be used:
+
+ floating_point = 0;
+ SECTIONS
+ {
+ .text :
+ {
+ *(.text)
+ _etext = .;
+ }
+ _bdata = (. + 3) & ~ 3;
+ .data : { *(.data) }
+ }
+ In this example, the symbol `floating_point' will be defined as
+zero. The symbol `_etext' will be defined as the address following the
+last `.text' input section. The symbol `_bdata' will be defined as the
+address following the `.text' output section aligned upward to a 4 byte
+boundary.
+
+
+File: ld.info, Node: PROVIDE, Next: PROVIDE_HIDDEN, Prev: Simple Assignments, Up: Assignments
+
+3.5.2 PROVIDE
+-------------
+
+In some cases, it is desirable for a linker script to define a symbol
+only if it is referenced and is not defined by any object included in
+the link. For example, traditional linkers defined the symbol `etext'.
+However, ANSI C requires that the user be able to use `etext' as a
+function name without encountering an error. The `PROVIDE' keyword may
+be used to define a symbol, such as `etext', only if it is referenced
+but not defined. The syntax is `PROVIDE(SYMBOL = EXPRESSION)'.
+
+ Here is an example of using `PROVIDE' to define `etext':
+ SECTIONS
+ {
+ .text :
+ {
+ *(.text)
+ _etext = .;
+ PROVIDE(etext = .);
+ }
+ }
+
+ In this example, if the program defines `_etext' (with a leading
+underscore), the linker will give a multiple definition error. If, on
+the other hand, the program defines `etext' (with no leading
+underscore), the linker will silently use the definition in the program.
+If the program references `etext' but does not define it, the linker
+will use the definition in the linker script.
+
+
+File: ld.info, Node: PROVIDE_HIDDEN, Next: Source Code Reference, Prev: PROVIDE, Up: Assignments
+
+3.5.3 PROVIDE_HIDDEN
+--------------------
+
+Similar to `PROVIDE'. For ELF targeted ports, the symbol will be
+hidden and won't be exported.
+
+
+File: ld.info, Node: Source Code Reference, Prev: PROVIDE_HIDDEN, Up: Assignments
+
+3.5.4 Source Code Reference
+---------------------------
+
+Accessing a linker script defined variable from source code is not
+intuitive. In particular a linker script symbol is not equivalent to a
+variable declaration in a high level language, it is instead a symbol
+that does not have a value.
+
+ Before going further, it is important to note that compilers often
+transform names in the source code into different names when they are
+stored in the symbol table. For example, Fortran compilers commonly
+prepend or append an underscore, and C++ performs extensive `name
+mangling'. Therefore there might be a discrepancy between the name of
+a variable as it is used in source code and the name of the same
+variable as it is defined in a linker script. For example in C a
+linker script variable might be referred to as:
+
+ extern int foo;
+
+ But in the linker script it might be defined as:
+
+ _foo = 1000;
+
+ In the remaining examples however it is assumed that no name
+transformation has taken place.
+
+ When a symbol is declared in a high level language such as C, two
+things happen. The first is that the compiler reserves enough space in
+the program's memory to hold the _value_ of the symbol. The second is
+that the compiler creates an entry in the program's symbol table which
+holds the symbol's _address_. ie the symbol table contains the address
+of the block of memory holding the symbol's value. So for example the
+following C declaration, at file scope:
+
+ int foo = 1000;
+
+ creates a entry called `foo' in the symbol table. This entry holds
+the address of an `int' sized block of memory where the number 1000 is
+initially stored.
+
+ When a program references a symbol the compiler generates code that
+first accesses the symbol table to find the address of the symbol's
+memory block and then code to read the value from that memory block.
+So:
+
+ foo = 1;
+
+ looks up the symbol `foo' in the symbol table, gets the address
+associated with this symbol and then writes the value 1 into that
+address. Whereas:
+
+ int * a = & foo;
+
+ looks up the symbol `foo' in the symbol table, gets it address and
+then copies this address into the block of memory associated with the
+variable `a'.
+
+ Linker scripts symbol declarations, by contrast, create an entry in
+the symbol table but do not assign any memory to them. Thus they are
+an address without a value. So for example the linker script
+definition:
+
+ foo = 1000;
+
+ creates an entry in the symbol table called `foo' which holds the
+address of memory location 1000, but nothing special is stored at
+address 1000. This means that you cannot access the _value_ of a
+linker script defined symbol - it has no value - all you can do is
+access the _address_ of a linker script defined symbol.
+
+ Hence when you are using a linker script defined symbol in source
+code you should always take the address of the symbol, and never
+attempt to use its value. For example suppose you want to copy the
+contents of a section of memory called .ROM into a section called
+.FLASH and the linker script contains these declarations:
+
+ start_of_ROM = .ROM;
+ end_of_ROM = .ROM + sizeof (.ROM) - 1;
+ start_of_FLASH = .FLASH;
+
+ Then the C source code to perform the copy would be:
+
+ extern char start_of_ROM, end_of_ROM, start_of_FLASH;
+
+ memcpy (& start_of_FLASH, & start_of_ROM, & end_of_ROM - & start_of_ROM);
+
+ Note the use of the `&' operators. These are correct.
+
+
+File: ld.info, Node: SECTIONS, Next: MEMORY, Prev: Assignments, Up: Scripts
+
+3.6 SECTIONS Command
+====================
+
+The `SECTIONS' command tells the linker how to map input sections into
+output sections, and how to place the output sections in memory.
+
+ The format of the `SECTIONS' command is:
+ SECTIONS
+ {
+ SECTIONS-COMMAND
+ SECTIONS-COMMAND
+ ...
+ }
+
+ Each SECTIONS-COMMAND may of be one of the following:
+
+ * an `ENTRY' command (*note Entry command: Entry Point.)
+
+ * a symbol assignment (*note Assignments::)
+
+ * an output section description
+
+ * an overlay description
+
+ The `ENTRY' command and symbol assignments are permitted inside the
+`SECTIONS' command for convenience in using the location counter in
+those commands. This can also make the linker script easier to
+understand because you can use those commands at meaningful points in
+the layout of the output file.
+
+ Output section descriptions and overlay descriptions are described
+below.
+
+ If you do not use a `SECTIONS' command in your linker script, the
+linker will place each input section into an identically named output
+section in the order that the sections are first encountered in the
+input files. If all input sections are present in the first file, for
+example, the order of sections in the output file will match the order
+in the first input file. The first section will be at address zero.
+
+* Menu:
+
+* Output Section Description:: Output section description
+* Output Section Name:: Output section name
+* Output Section Address:: Output section address
+* Input Section:: Input section description
+* Output Section Data:: Output section data
+* Output Section Keywords:: Output section keywords
+* Output Section Discarding:: Output section discarding
+* Output Section Attributes:: Output section attributes
+* Overlay Description:: Overlay description
+
+
+File: ld.info, Node: Output Section Description, Next: Output Section Name, Up: SECTIONS
+
+3.6.1 Output Section Description
+--------------------------------
+
+The full description of an output section looks like this:
+ SECTION [ADDRESS] [(TYPE)] :
+ [AT(LMA)]
+ [ALIGN(SECTION_ALIGN)]
+ [SUBALIGN(SUBSECTION_ALIGN)]
+ [CONSTRAINT]
+ {
+ OUTPUT-SECTION-COMMAND
+ OUTPUT-SECTION-COMMAND
+ ...
+ } [>REGION] [AT>LMA_REGION] [:PHDR :PHDR ...] [=FILLEXP]
+
+ Most output sections do not use most of the optional section
+attributes.
+
+ The whitespace around SECTION is required, so that the section name
+is unambiguous. The colon and the curly braces are also required. The
+line breaks and other white space are optional.
+
+ Each OUTPUT-SECTION-COMMAND may be one of the following:
+
+ * a symbol assignment (*note Assignments::)
+
+ * an input section description (*note Input Section::)
+
+ * data values to include directly (*note Output Section Data::)
+
+ * a special output section keyword (*note Output Section Keywords::)
+
+
+File: ld.info, Node: Output Section Name, Next: Output Section Address, Prev: Output Section Description, Up: SECTIONS
+
+3.6.2 Output Section Name
+-------------------------
+
+The name of the output section is SECTION. SECTION must meet the
+constraints of your output format. In formats which only support a
+limited number of sections, such as `a.out', the name must be one of
+the names supported by the format (`a.out', for example, allows only
+`.text', `.data' or `.bss'). If the output format supports any number
+of sections, but with numbers and not names (as is the case for Oasys),
+the name should be supplied as a quoted numeric string. A section name
+may consist of any sequence of characters, but a name which contains
+any unusual characters such as commas must be quoted.
+
+ The output section name `/DISCARD/' is special; *Note Output Section
+Discarding::.
+
+
+File: ld.info, Node: Output Section Address, Next: Input Section, Prev: Output Section Name, Up: SECTIONS
+
+3.6.3 Output Section Address
+----------------------------
+
+The ADDRESS is an expression for the VMA (the virtual memory address)
+of the output section. If you do not provide ADDRESS, the linker will
+set it based on REGION if present, or otherwise based on the current
+value of the location counter.
+
+ If you provide ADDRESS, the address of the output section will be
+set to precisely that. If you provide neither ADDRESS nor REGION, then
+the address of the output section will be set to the current value of
+the location counter aligned to the alignment requirements of the
+output section. The alignment requirement of the output section is the
+strictest alignment of any input section contained within the output
+section.
+
+ For example,
+ .text . : { *(.text) }
+ and
+ .text : { *(.text) }
+ are subtly different. The first will set the address of the `.text'
+output section to the current value of the location counter. The
+second will set it to the current value of the location counter aligned
+to the strictest alignment of a `.text' input section.
+
+ The ADDRESS may be an arbitrary expression; *Note Expressions::.
+For example, if you want to align the section on a 0x10 byte boundary,
+so that the lowest four bits of the section address are zero, you could
+do something like this:
+ .text ALIGN(0x10) : { *(.text) }
+ This works because `ALIGN' returns the current location counter
+aligned upward to the specified value.
+
+ Specifying ADDRESS for a section will change the value of the
+location counter, provided that the section is non-empty. (Empty
+sections are ignored).
+
+
+File: ld.info, Node: Input Section, Next: Output Section Data, Prev: Output Section Address, Up: SECTIONS
+
+3.6.4 Input Section Description
+-------------------------------
+
+The most common output section command is an input section description.
+
+ The input section description is the most basic linker script
+operation. You use output sections to tell the linker how to lay out
+your program in memory. You use input section descriptions to tell the
+linker how to map the input files into your memory layout.
+
+* Menu:
+
+* Input Section Basics:: Input section basics
+* Input Section Wildcards:: Input section wildcard patterns
+* Input Section Common:: Input section for common symbols
+* Input Section Keep:: Input section and garbage collection
+* Input Section Example:: Input section example
+
+
+File: ld.info, Node: Input Section Basics, Next: Input Section Wildcards, Up: Input Section
+
+3.6.4.1 Input Section Basics
+............................
+
+An input section description consists of a file name optionally followed
+by a list of section names in parentheses.
+
+ The file name and the section name may be wildcard patterns, which we
+describe further below (*note Input Section Wildcards::).
+
+ The most common input section description is to include all input
+sections with a particular name in the output section. For example, to
+include all input `.text' sections, you would write:
+ *(.text)
+ Here the `*' is a wildcard which matches any file name. To exclude
+a list of files from matching the file name wildcard, EXCLUDE_FILE may
+be used to match all files except the ones specified in the
+EXCLUDE_FILE list. For example:
+ *(EXCLUDE_FILE (*crtend.o *otherfile.o) .ctors)
+ will cause all .ctors sections from all files except `crtend.o' and
+`otherfile.o' to be included.
+
+ There are two ways to include more than one section:
+ *(.text .rdata)
+ *(.text) *(.rdata)
+ The difference between these is the order in which the `.text' and
+`.rdata' input sections will appear in the output section. In the
+first example, they will be intermingled, appearing in the same order as
+they are found in the linker input. In the second example, all `.text'
+input sections will appear first, followed by all `.rdata' input
+sections.
+
+ You can specify a file name to include sections from a particular
+file. You would do this if one or more of your files contain special
+data that needs to be at a particular location in memory. For example:
+ data.o(.data)
+
+ You can also specify files within archives by writing a pattern
+matching the archive, a colon, then the pattern matching the file, with
+no whitespace around the colon.
+
+`archive:file'
+ matches file within archive
+
+`archive:'
+ matches the whole archive
+
+`:file'
+ matches file but not one in an archive
+
+ Either one or both of `archive' and `file' can contain shell
+wildcards. On DOS based file systems, the linker will assume that a
+single letter followed by a colon is a drive specifier, so `c:myfile.o'
+is a simple file specification, not `myfile.o' within an archive called
+`c'. `archive:file' filespecs may also be used within an
+`EXCLUDE_FILE' list, but may not appear in other linker script
+contexts. For instance, you cannot extract a file from an archive by
+using `archive:file' in an `INPUT' command.
+
+ If you use a file name without a list of sections, then all sections
+in the input file will be included in the output section. This is not
+commonly done, but it may by useful on occasion. For example:
+ data.o
+
+ When you use a file name which is not an `archive:file' specifier
+and does not contain any wild card characters, the linker will first
+see if you also specified the file name on the linker command line or
+in an `INPUT' command. If you did not, the linker will attempt to open
+the file as an input file, as though it appeared on the command line.
+Note that this differs from an `INPUT' command, because the linker will
+not search for the file in the archive search path.
+
+
+File: ld.info, Node: Input Section Wildcards, Next: Input Section Common, Prev: Input Section Basics, Up: Input Section
+
+3.6.4.2 Input Section Wildcard Patterns
+.......................................
+
+In an input section description, either the file name or the section
+name or both may be wildcard patterns.
+
+ The file name of `*' seen in many examples is a simple wildcard
+pattern for the file name.
+
+ The wildcard patterns are like those used by the Unix shell.
+
+`*'
+ matches any number of characters
+
+`?'
+ matches any single character
+
+`[CHARS]'
+ matches a single instance of any of the CHARS; the `-' character
+ may be used to specify a range of characters, as in `[a-z]' to
+ match any lower case letter
+
+`\'
+ quotes the following character
+
+ When a file name is matched with a wildcard, the wildcard characters
+will not match a `/' character (used to separate directory names on
+Unix). A pattern consisting of a single `*' character is an exception;
+it will always match any file name, whether it contains a `/' or not.
+In a section name, the wildcard characters will match a `/' character.
+
+ File name wildcard patterns only match files which are explicitly
+specified on the command line or in an `INPUT' command. The linker
+does not search directories to expand wildcards.
+
+ If a file name matches more than one wildcard pattern, or if a file
+name appears explicitly and is also matched by a wildcard pattern, the
+linker will use the first match in the linker script. For example, this
+sequence of input section descriptions is probably in error, because the
+`data.o' rule will not be used:
+ .data : { *(.data) }
+ .data1 : { data.o(.data) }
+
+ Normally, the linker will place files and sections matched by
+wildcards in the order in which they are seen during the link. You can
+change this by using the `SORT_BY_NAME' keyword, which appears before a
+wildcard pattern in parentheses (e.g., `SORT_BY_NAME(.text*)'). When
+the `SORT_BY_NAME' keyword is used, the linker will sort the files or
+sections into ascending order by name before placing them in the output
+file.
+
+ `SORT_BY_ALIGNMENT' is very similar to `SORT_BY_NAME'. The
+difference is `SORT_BY_ALIGNMENT' will sort sections into ascending
+order by alignment before placing them in the output file.
+
+ `SORT' is an alias for `SORT_BY_NAME'.
+
+ When there are nested section sorting commands in linker script,
+there can be at most 1 level of nesting for section sorting commands.
+
+ 1. `SORT_BY_NAME' (`SORT_BY_ALIGNMENT' (wildcard section pattern)).
+ It will sort the input sections by name first, then by alignment
+ if 2 sections have the same name.
+
+ 2. `SORT_BY_ALIGNMENT' (`SORT_BY_NAME' (wildcard section pattern)).
+ It will sort the input sections by alignment first, then by name
+ if 2 sections have the same alignment.
+
+ 3. `SORT_BY_NAME' (`SORT_BY_NAME' (wildcard section pattern)) is
+ treated the same as `SORT_BY_NAME' (wildcard section pattern).
+
+ 4. `SORT_BY_ALIGNMENT' (`SORT_BY_ALIGNMENT' (wildcard section
+ pattern)) is treated the same as `SORT_BY_ALIGNMENT' (wildcard
+ section pattern).
+
+ 5. All other nested section sorting commands are invalid.
+
+ When both command line section sorting option and linker script
+section sorting command are used, section sorting command always takes
+precedence over the command line option.
+
+ If the section sorting command in linker script isn't nested, the
+command line option will make the section sorting command to be treated
+as nested sorting command.
+
+ 1. `SORT_BY_NAME' (wildcard section pattern ) with `--sort-sections
+ alignment' is equivalent to `SORT_BY_NAME' (`SORT_BY_ALIGNMENT'
+ (wildcard section pattern)).
+
+ 2. `SORT_BY_ALIGNMENT' (wildcard section pattern) with
+ `--sort-section name' is equivalent to `SORT_BY_ALIGNMENT'
+ (`SORT_BY_NAME' (wildcard section pattern)).
+
+ If the section sorting command in linker script is nested, the
+command line option will be ignored.
+
+ If you ever get confused about where input sections are going, use
+the `-M' linker option to generate a map file. The map file shows
+precisely how input sections are mapped to output sections.
+
+ This example shows how wildcard patterns might be used to partition
+files. This linker script directs the linker to place all `.text'
+sections in `.text' and all `.bss' sections in `.bss'. The linker will
+place the `.data' section from all files beginning with an upper case
+character in `.DATA'; for all other files, the linker will place the
+`.data' section in `.data'.
+ SECTIONS {
+ .text : { *(.text) }
+ .DATA : { [A-Z]*(.data) }
+ .data : { *(.data) }
+ .bss : { *(.bss) }
+ }
+
+
+File: ld.info, Node: Input Section Common, Next: Input Section Keep, Prev: Input Section Wildcards, Up: Input Section
+
+3.6.4.3 Input Section for Common Symbols
+........................................
+
+A special notation is needed for common symbols, because in many object
+file formats common symbols do not have a particular input section. The
+linker treats common symbols as though they are in an input section
+named `COMMON'.
+
+ You may use file names with the `COMMON' section just as with any
+other input sections. You can use this to place common symbols from a
+particular input file in one section while common symbols from other
+input files are placed in another section.
+
+ In most cases, common symbols in input files will be placed in the
+`.bss' section in the output file. For example:
+ .bss { *(.bss) *(COMMON) }
+
+ Some object file formats have more than one type of common symbol.
+For example, the MIPS ELF object file format distinguishes standard
+common symbols and small common symbols. In this case, the linker will
+use a different special section name for other types of common symbols.
+In the case of MIPS ELF, the linker uses `COMMON' for standard common
+symbols and `.scommon' for small common symbols. This permits you to
+map the different types of common symbols into memory at different
+locations.
+
+ You will sometimes see `[COMMON]' in old linker scripts. This
+notation is now considered obsolete. It is equivalent to `*(COMMON)'.
+
+
+File: ld.info, Node: Input Section Keep, Next: Input Section Example, Prev: Input Section Common, Up: Input Section
+
+3.6.4.4 Input Section and Garbage Collection
+............................................
+
+When link-time garbage collection is in use (`--gc-sections'), it is
+often useful to mark sections that should not be eliminated. This is
+accomplished by surrounding an input section's wildcard entry with
+`KEEP()', as in `KEEP(*(.init))' or `KEEP(SORT_BY_NAME(*)(.ctors))'.
+
+
+File: ld.info, Node: Input Section Example, Prev: Input Section Keep, Up: Input Section
+
+3.6.4.5 Input Section Example
+.............................
+
+The following example is a complete linker script. It tells the linker
+to read all of the sections from file `all.o' and place them at the
+start of output section `outputa' which starts at location `0x10000'.
+All of section `.input1' from file `foo.o' follows immediately, in the
+same output section. All of section `.input2' from `foo.o' goes into
+output section `outputb', followed by section `.input1' from `foo1.o'.
+All of the remaining `.input1' and `.input2' sections from any files
+are written to output section `outputc'.
+
+ SECTIONS {
+ outputa 0x10000 :
+ {
+ all.o
+ foo.o (.input1)
+ }
+ outputb :
+ {
+ foo.o (.input2)
+ foo1.o (.input1)
+ }
+ outputc :
+ {
+ *(.input1)
+ *(.input2)
+ }
+ }
+
+
+File: ld.info, Node: Output Section Data, Next: Output Section Keywords, Prev: Input Section, Up: SECTIONS
+
+3.6.5 Output Section Data
+-------------------------
+
+You can include explicit bytes of data in an output section by using
+`BYTE', `SHORT', `LONG', `QUAD', or `SQUAD' as an output section
+command. Each keyword is followed by an expression in parentheses
+providing the value to store (*note Expressions::). The value of the
+expression is stored at the current value of the location counter.
+
+ The `BYTE', `SHORT', `LONG', and `QUAD' commands store one, two,
+four, and eight bytes (respectively). After storing the bytes, the
+location counter is incremented by the number of bytes stored.
+
+ For example, this will store the byte 1 followed by the four byte
+value of the symbol `addr':
+ BYTE(1)
+ LONG(addr)
+
+ When using a 64 bit host or target, `QUAD' and `SQUAD' are the same;
+they both store an 8 byte, or 64 bit, value. When both host and target
+are 32 bits, an expression is computed as 32 bits. In this case `QUAD'
+stores a 32 bit value zero extended to 64 bits, and `SQUAD' stores a 32
+bit value sign extended to 64 bits.
+
+ If the object file format of the output file has an explicit
+endianness, which is the normal case, the value will be stored in that
+endianness. When the object file format does not have an explicit
+endianness, as is true of, for example, S-records, the value will be
+stored in the endianness of the first input object file.
+
+ Note--these commands only work inside a section description and not
+between them, so the following will produce an error from the linker:
+ SECTIONS { .text : { *(.text) } LONG(1) .data : { *(.data) } }
+ whereas this will work:
+ SECTIONS { .text : { *(.text) ; LONG(1) } .data : { *(.data) } }
+
+ You may use the `FILL' command to set the fill pattern for the
+current section. It is followed by an expression in parentheses. Any
+otherwise unspecified regions of memory within the section (for example,
+gaps left due to the required alignment of input sections) are filled
+with the value of the expression, repeated as necessary. A `FILL'
+statement covers memory locations after the point at which it occurs in
+the section definition; by including more than one `FILL' statement,
+you can have different fill patterns in different parts of an output
+section.
+
+ This example shows how to fill unspecified regions of memory with the
+value `0x90':
+ FILL(0x90909090)
+
+ The `FILL' command is similar to the `=FILLEXP' output section
+attribute, but it only affects the part of the section following the
+`FILL' command, rather than the entire section. If both are used, the
+`FILL' command takes precedence. *Note Output Section Fill::, for
+details on the fill expression.
+
+
+File: ld.info, Node: Output Section Keywords, Next: Output Section Discarding, Prev: Output Section Data, Up: SECTIONS
+
+3.6.6 Output Section Keywords
+-----------------------------
+
+There are a couple of keywords which can appear as output section
+commands.
+
+`CREATE_OBJECT_SYMBOLS'
+ The command tells the linker to create a symbol for each input
+ file. The name of each symbol will be the name of the
+ corresponding input file. The section of each symbol will be the
+ output section in which the `CREATE_OBJECT_SYMBOLS' command
+ appears.
+
+ This is conventional for the a.out object file format. It is not
+ normally used for any other object file format.
+
+`CONSTRUCTORS'
+ When linking using the a.out object file format, the linker uses an
+ unusual set construct to support C++ global constructors and
+ destructors. When linking object file formats which do not support
+ arbitrary sections, such as ECOFF and XCOFF, the linker will
+ automatically recognize C++ global constructors and destructors by
+ name. For these object file formats, the `CONSTRUCTORS' command
+ tells the linker to place constructor information in the output
+ section where the `CONSTRUCTORS' command appears. The
+ `CONSTRUCTORS' command is ignored for other object file formats.
+
+ The symbol `__CTOR_LIST__' marks the start of the global
+ constructors, and the symbol `__CTOR_END__' marks the end.
+ Similarly, `__DTOR_LIST__' and `__DTOR_END__' mark the start and
+ end of the global destructors. The first word in the list is the
+ number of entries, followed by the address of each constructor or
+ destructor, followed by a zero word. The compiler must arrange to
+ actually run the code. For these object file formats GNU C++
+ normally calls constructors from a subroutine `__main'; a call to
+ `__main' is automatically inserted into the startup code for
+ `main'. GNU C++ normally runs destructors either by using
+ `atexit', or directly from the function `exit'.
+
+ For object file formats such as `COFF' or `ELF' which support
+ arbitrary section names, GNU C++ will normally arrange to put the
+ addresses of global constructors and destructors into the `.ctors'
+ and `.dtors' sections. Placing the following sequence into your
+ linker script will build the sort of table which the GNU C++
+ runtime code expects to see.
+
+ __CTOR_LIST__ = .;
+ LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
+ *(.ctors)
+ LONG(0)
+ __CTOR_END__ = .;
+ __DTOR_LIST__ = .;
+ LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
+ *(.dtors)
+ LONG(0)
+ __DTOR_END__ = .;
+
+ If you are using the GNU C++ support for initialization priority,
+ which provides some control over the order in which global
+ constructors are run, you must sort the constructors at link time
+ to ensure that they are executed in the correct order. When using
+ the `CONSTRUCTORS' command, use `SORT_BY_NAME(CONSTRUCTORS)'
+ instead. When using the `.ctors' and `.dtors' sections, use
+ `*(SORT_BY_NAME(.ctors))' and `*(SORT_BY_NAME(.dtors))' instead of
+ just `*(.ctors)' and `*(.dtors)'.
+
+ Normally the compiler and linker will handle these issues
+ automatically, and you will not need to concern yourself with
+ them. However, you may need to consider this if you are using C++
+ and writing your own linker scripts.
+
+
+
+File: ld.info, Node: Output Section Discarding, Next: Output Section Attributes, Prev: Output Section Keywords, Up: SECTIONS
+
+3.6.7 Output Section Discarding
+-------------------------------
+
+The linker will not create output sections with no contents. This is
+for convenience when referring to input sections that may or may not be
+present in any of the input files. For example:
+ .foo : { *(.foo) }
+ will only create a `.foo' section in the output file if there is a
+`.foo' section in at least one input file, and if the input sections
+are not all empty. Other link script directives that allocate space in
+an output section will also create the output section.
+
+ The linker will ignore address assignments (*note Output Section
+Address::) on discarded output sections, except when the linker script
+defines symbols in the output section. In that case the linker will
+obey the address assignments, possibly advancing dot even though the
+section is discarded.
+
+ The special output section name `/DISCARD/' may be used to discard
+input sections. Any input sections which are assigned to an output
+section named `/DISCARD/' are not included in the output file.
+
+
+File: ld.info, Node: Output Section Attributes, Next: Overlay Description, Prev: Output Section Discarding, Up: SECTIONS
+
+3.6.8 Output Section Attributes
+-------------------------------
+
+We showed above that the full description of an output section looked
+like this:
+
+ SECTION [ADDRESS] [(TYPE)] :
+ [AT(LMA)]
+ [ALIGN(SECTION_ALIGN)]
+ [SUBALIGN(SUBSECTION_ALIGN)]
+ [CONSTRAINT]
+ {
+ OUTPUT-SECTION-COMMAND
+ OUTPUT-SECTION-COMMAND
+ ...
+ } [>REGION] [AT>LMA_REGION] [:PHDR :PHDR ...] [=FILLEXP]
+
+ We've already described SECTION, ADDRESS, and
+OUTPUT-SECTION-COMMAND. In this section we will describe the remaining
+section attributes.
+
+* Menu:
+
+* Output Section Type:: Output section type
+* Output Section LMA:: Output section LMA
+* Forced Output Alignment:: Forced Output Alignment
+* Forced Input Alignment:: Forced Input Alignment
+* Output Section Constraint:: Output section constraint
+* Output Section Region:: Output section region
+* Output Section Phdr:: Output section phdr
+* Output Section Fill:: Output section fill
+
+
+File: ld.info, Node: Output Section Type, Next: Output Section LMA, Up: Output Section Attributes
+
+3.6.8.1 Output Section Type
+...........................
+
+Each output section may have a type. The type is a keyword in
+parentheses. The following types are defined:
+
+`NOLOAD'
+ The section should be marked as not loadable, so that it will not
+ be loaded into memory when the program is run.
+
+`DSECT'
+`COPY'
+`INFO'
+`OVERLAY'
+ These type names are supported for backward compatibility, and are
+ rarely used. They all have the same effect: the section should be
+ marked as not allocatable, so that no memory is allocated for the
+ section when the program is run.
+
+ The linker normally sets the attributes of an output section based on
+the input sections which map into it. You can override this by using
+the section type. For example, in the script sample below, the `ROM'
+section is addressed at memory location `0' and does not need to be
+loaded when the program is run. The contents of the `ROM' section will
+appear in the linker output file as usual.
+ SECTIONS {
+ ROM 0 (NOLOAD) : { ... }
+ ...
+ }
+
+
+File: ld.info, Node: Output Section LMA, Next: Forced Output Alignment, Prev: Output Section Type, Up: Output Section Attributes
+
+3.6.8.2 Output Section LMA
+..........................
+
+Every section has a virtual address (VMA) and a load address (LMA); see
+*Note Basic Script Concepts::. The address expression which may appear
+in an output section description sets the VMA (*note Output Section
+Address::).
+
+ The expression LMA that follows the `AT' keyword specifies the load
+address of the section.
+
+ Alternatively, with `AT>LMA_REGION' expression, you may specify a
+memory region for the section's load address. *Note MEMORY::. Note
+that if the section has not had a VMA assigned to it then the linker
+will use the LMA_REGION as the VMA region as well.
+
+ If neither `AT' nor `AT>' is specified for an allocatable section,
+the linker will set the LMA such that the difference between VMA and
+LMA for the section is the same as the preceding output section in the
+same region. If there is no preceding output section or the section is
+not allocatable, the linker will set the LMA equal to the VMA. *Note
+Output Section Region::.
+
+ This feature is designed to make it easy to build a ROM image. For
+example, the following linker script creates three output sections: one
+called `.text', which starts at `0x1000', one called `.mdata', which is
+loaded at the end of the `.text' section even though its VMA is
+`0x2000', and one called `.bss' to hold uninitialized data at address
+`0x3000'. The symbol `_data' is defined with the value `0x2000', which
+shows that the location counter holds the VMA value, not the LMA value.
+
+ SECTIONS
+ {
+ .text 0x1000 : { *(.text) _etext = . ; }
+ .mdata 0x2000 :
+ AT ( ADDR (.text) + SIZEOF (.text) )
+ { _data = . ; *(.data); _edata = . ; }
+ .bss 0x3000 :
+ { _bstart = . ; *(.bss) *(COMMON) ; _bend = . ;}
+ }
+
+ The run-time initialization code for use with a program generated
+with this linker script would include something like the following, to
+copy the initialized data from the ROM image to its runtime address.
+Notice how this code takes advantage of the symbols defined by the
+linker script.
+
+ extern char _etext, _data, _edata, _bstart, _bend;
+ char *src = &_etext;
+ char *dst = &_data;
+
+ /* ROM has data at end of text; copy it. */
+ while (dst < &_edata) {
+ *dst++ = *src++;
+ }
+
+ /* Zero bss */
+ for (dst = &_bstart; dst< &_bend; dst++)
+ *dst = 0;
+
+
+File: ld.info, Node: Forced Output Alignment, Next: Forced Input Alignment, Prev: Output Section LMA, Up: Output Section Attributes
+
+3.6.8.3 Forced Output Alignment
+...............................
+
+You can increase an output section's alignment by using ALIGN.
+
+
+File: ld.info, Node: Forced Input Alignment, Next: Output Section Constraint, Prev: Forced Output Alignment, Up: Output Section Attributes
+
+3.6.8.4 Forced Input Alignment
+..............................
+
+You can force input section alignment within an output section by using
+SUBALIGN. The value specified overrides any alignment given by input
+sections, whether larger or smaller.
+
+
+File: ld.info, Node: Output Section Constraint, Next: Output Section Region, Prev: Forced Input Alignment, Up: Output Section Attributes
+
+3.6.8.5 Output Section Constraint
+.................................
+
+You can specify that an output section should only be created if all of
+its input sections are read-only or all of its input sections are
+read-write by using the keyword `ONLY_IF_RO' and `ONLY_IF_RW'
+respectively.
+
+
+File: ld.info, Node: Output Section Region, Next: Output Section Phdr, Prev: Output Section Constraint, Up: Output Section Attributes
+
+3.6.8.6 Output Section Region
+.............................
+
+You can assign a section to a previously defined region of memory by
+using `>REGION'. *Note MEMORY::.
+
+ Here is a simple example:
+ MEMORY { rom : ORIGIN = 0x1000, LENGTH = 0x1000 }
+ SECTIONS { ROM : { *(.text) } >rom }
+
+
+File: ld.info, Node: Output Section Phdr, Next: Output Section Fill, Prev: Output Section Region, Up: Output Section Attributes
+
+3.6.8.7 Output Section Phdr
+...........................
+
+You can assign a section to a previously defined program segment by
+using `:PHDR'. *Note PHDRS::. If a section is assigned to one or more
+segments, then all subsequent allocated sections will be assigned to
+those segments as well, unless they use an explicitly `:PHDR' modifier.
+You can use `:NONE' to tell the linker to not put the section in any
+segment at all.
+
+ Here is a simple example:
+ PHDRS { text PT_LOAD ; }
+ SECTIONS { .text : { *(.text) } :text }
+
+
+File: ld.info, Node: Output Section Fill, Prev: Output Section Phdr, Up: Output Section Attributes
+
+3.6.8.8 Output Section Fill
+...........................
+
+You can set the fill pattern for an entire section by using `=FILLEXP'.
+FILLEXP is an expression (*note Expressions::). Any otherwise
+unspecified regions of memory within the output section (for example,
+gaps left due to the required alignment of input sections) will be
+filled with the value, repeated as necessary. If the fill expression
+is a simple hex number, ie. a string of hex digit starting with `0x'
+and without a trailing `k' or `M', then an arbitrarily long sequence of
+hex digits can be used to specify the fill pattern; Leading zeros
+become part of the pattern too. For all other cases, including extra
+parentheses or a unary `+', the fill pattern is the four least
+significant bytes of the value of the expression. In all cases, the
+number is big-endian.
+
+ You can also change the fill value with a `FILL' command in the
+output section commands; (*note Output Section Data::).
+
+ Here is a simple example:
+ SECTIONS { .text : { *(.text) } =0x90909090 }
+
+
+File: ld.info, Node: Overlay Description, Prev: Output Section Attributes, Up: SECTIONS
+
+3.6.9 Overlay Description
+-------------------------
+
+An overlay description provides an easy way to describe sections which
+are to be loaded as part of a single memory image but are to be run at
+the same memory address. At run time, some sort of overlay manager will
+copy the overlaid sections in and out of the runtime memory address as
+required, perhaps by simply manipulating addressing bits. This approach
+can be useful, for example, when a certain region of memory is faster
+than another.
+
+ Overlays are described using the `OVERLAY' command. The `OVERLAY'
+command is used within a `SECTIONS' command, like an output section
+description. The full syntax of the `OVERLAY' command is as follows:
+ OVERLAY [START] : [NOCROSSREFS] [AT ( LDADDR )]
+ {
+ SECNAME1
+ {
+ OUTPUT-SECTION-COMMAND
+ OUTPUT-SECTION-COMMAND
+ ...
+ } [:PHDR...] [=FILL]
+ SECNAME2
+ {
+ OUTPUT-SECTION-COMMAND
+ OUTPUT-SECTION-COMMAND
+ ...
+ } [:PHDR...] [=FILL]
+ ...
+ } [>REGION] [:PHDR...] [=FILL]
+
+ Everything is optional except `OVERLAY' (a keyword), and each
+section must have a name (SECNAME1 and SECNAME2 above). The section
+definitions within the `OVERLAY' construct are identical to those
+within the general `SECTIONS' contruct (*note SECTIONS::), except that
+no addresses and no memory regions may be defined for sections within
+an `OVERLAY'.
+
+ The sections are all defined with the same starting address. The
+load addresses of the sections are arranged such that they are
+consecutive in memory starting at the load address used for the
+`OVERLAY' as a whole (as with normal section definitions, the load
+address is optional, and defaults to the start address; the start
+address is also optional, and defaults to the current value of the
+location counter).
+
+ If the `NOCROSSREFS' keyword is used, and there any references among
+the sections, the linker will report an error. Since the sections all
+run at the same address, it normally does not make sense for one
+section to refer directly to another. *Note NOCROSSREFS: Miscellaneous
+Commands.
+
+ For each section within the `OVERLAY', the linker automatically
+provides two symbols. The symbol `__load_start_SECNAME' is defined as
+the starting load address of the section. The symbol
+`__load_stop_SECNAME' is defined as the final load address of the
+section. Any characters within SECNAME which are not legal within C
+identifiers are removed. C (or assembler) code may use these symbols
+to move the overlaid sections around as necessary.
+
+ At the end of the overlay, the value of the location counter is set
+to the start address of the overlay plus the size of the largest
+section.
+
+ Here is an example. Remember that this would appear inside a
+`SECTIONS' construct.
+ OVERLAY 0x1000 : AT (0x4000)
+ {
+ .text0 { o1/*.o(.text) }
+ .text1 { o2/*.o(.text) }
+ }
+This will define both `.text0' and `.text1' to start at address
+0x1000. `.text0' will be loaded at address 0x4000, and `.text1' will
+be loaded immediately after `.text0'. The following symbols will be
+defined if referenced: `__load_start_text0', `__load_stop_text0',
+`__load_start_text1', `__load_stop_text1'.
+
+ C code to copy overlay `.text1' into the overlay area might look
+like the following.
+
+ extern char __load_start_text1, __load_stop_text1;
+ memcpy ((char *) 0x1000, &__load_start_text1,
+ &__load_stop_text1 - &__load_start_text1);
+
+ Note that the `OVERLAY' command is just syntactic sugar, since
+everything it does can be done using the more basic commands. The above
+example could have been written identically as follows.
+
+ .text0 0x1000 : AT (0x4000) { o1/*.o(.text) }
+ PROVIDE (__load_start_text0 = LOADADDR (.text0));
+ PROVIDE (__load_stop_text0 = LOADADDR (.text0) + SIZEOF (.text0));
+ .text1 0x1000 : AT (0x4000 + SIZEOF (.text0)) { o2/*.o(.text) }
+ PROVIDE (__load_start_text1 = LOADADDR (.text1));
+ PROVIDE (__load_stop_text1 = LOADADDR (.text1) + SIZEOF (.text1));
+ . = 0x1000 + MAX (SIZEOF (.text0), SIZEOF (.text1));
+
+
+File: ld.info, Node: MEMORY, Next: PHDRS, Prev: SECTIONS, Up: Scripts
+
+3.7 MEMORY Command
+==================
+
+The linker's default configuration permits allocation of all available
+memory. You can override this by using the `MEMORY' command.
+
+ The `MEMORY' command describes the location and size of blocks of
+memory in the target. You can use it to describe which memory regions
+may be used by the linker, and which memory regions it must avoid. You
+can then assign sections to particular memory regions. The linker will
+set section addresses based on the memory regions, and will warn about
+regions that become too full. The linker will not shuffle sections
+around to fit into the available regions.
+
+ A linker script may contain at most one use of the `MEMORY' command.
+However, you can define as many blocks of memory within it as you
+wish. The syntax is:
+ MEMORY
+ {
+ NAME [(ATTR)] : ORIGIN = ORIGIN, LENGTH = LEN
+ ...
+ }
+
+ The NAME is a name used in the linker script to refer to the region.
+The region name has no meaning outside of the linker script. Region
+names are stored in a separate name space, and will not conflict with
+symbol names, file names, or section names. Each memory region must
+have a distinct name within the `MEMORY' command. However you can add
+later alias names to existing memory regions with the *Note
+REGION_ALIAS:: command.
+
+ The ATTR string is an optional list of attributes that specify
+whether to use a particular memory region for an input section which is
+not explicitly mapped in the linker script. As described in *Note
+SECTIONS::, if you do not specify an output section for some input
+section, the linker will create an output section with the same name as
+the input section. If you define region attributes, the linker will use
+them to select the memory region for the output section that it creates.
+
+ The ATTR string must consist only of the following characters:
+`R'
+ Read-only section
+
+`W'
+ Read/write section
+
+`X'
+ Executable section
+
+`A'
+ Allocatable section
+
+`I'
+ Initialized section
+
+`L'
+ Same as `I'
+
+`!'
+ Invert the sense of any of the preceding attributes
+
+ If a unmapped section matches any of the listed attributes other than
+`!', it will be placed in the memory region. The `!' attribute
+reverses this test, so that an unmapped section will be placed in the
+memory region only if it does not match any of the listed attributes.
+
+ The ORIGIN is an numerical expression for the start address of the
+memory region. The expression must evaluate to a constant and it
+cannot involve any symbols. The keyword `ORIGIN' may be abbreviated to
+`org' or `o' (but not, for example, `ORG').
+
+ The LEN is an expression for the size in bytes of the memory region.
+As with the ORIGIN expression, the expression must be numerical only
+and must evaluate to a constant. The keyword `LENGTH' may be
+abbreviated to `len' or `l'.
+
+ In the following example, we specify that there are two memory
+regions available for allocation: one starting at `0' for 256 kilobytes,
+and the other starting at `0x40000000' for four megabytes. The linker
+will place into the `rom' memory region every section which is not
+explicitly mapped into a memory region, and is either read-only or
+executable. The linker will place other sections which are not
+explicitly mapped into a memory region into the `ram' memory region.
+
+ MEMORY
+ {
+ rom (rx) : ORIGIN = 0, LENGTH = 256K
+ ram (!rx) : org = 0x40000000, l = 4M
+ }
+
+ Once you define a memory region, you can direct the linker to place
+specific output sections into that memory region by using the `>REGION'
+output section attribute. For example, if you have a memory region
+named `mem', you would use `>mem' in the output section definition.
+*Note Output Section Region::. If no address was specified for the
+output section, the linker will set the address to the next available
+address within the memory region. If the combined output sections
+directed to a memory region are too large for the region, the linker
+will issue an error message.
+
+ It is possible to access the origin and length of a memory in an
+expression via the `ORIGIN(MEMORY)' and `LENGTH(MEMORY)' functions:
+
+ _fstack = ORIGIN(ram) + LENGTH(ram) - 4;
+
+
+File: ld.info, Node: PHDRS, Next: VERSION, Prev: MEMORY, Up: Scripts
+
+3.8 PHDRS Command
+=================
+
+The ELF object file format uses "program headers", also knows as
+"segments". The program headers describe how the program should be
+loaded into memory. You can print them out by using the `objdump'
+program with the `-p' option.
+
+ When you run an ELF program on a native ELF system, the system loader
+reads the program headers in order to figure out how to load the
+program. This will only work if the program headers are set correctly.
+This manual does not describe the details of how the system loader
+interprets program headers; for more information, see the ELF ABI.
+
+ The linker will create reasonable program headers by default.
+However, in some cases, you may need to specify the program headers more
+precisely. You may use the `PHDRS' command for this purpose. When the
+linker sees the `PHDRS' command in the linker script, it will not
+create any program headers other than the ones specified.
+
+ The linker only pays attention to the `PHDRS' command when
+generating an ELF output file. In other cases, the linker will simply
+ignore `PHDRS'.
+
+ This is the syntax of the `PHDRS' command. The words `PHDRS',
+`FILEHDR', `AT', and `FLAGS' are keywords.
+
+ PHDRS
+ {
+ NAME TYPE [ FILEHDR ] [ PHDRS ] [ AT ( ADDRESS ) ]
+ [ FLAGS ( FLAGS ) ] ;
+ }
+
+ The NAME is used only for reference in the `SECTIONS' command of the
+linker script. It is not put into the output file. Program header
+names are stored in a separate name space, and will not conflict with
+symbol names, file names, or section names. Each program header must
+have a distinct name.
+
+ Certain program header types describe segments of memory which the
+system loader will load from the file. In the linker script, you
+specify the contents of these segments by placing allocatable output
+sections in the segments. You use the `:PHDR' output section attribute
+to place a section in a particular segment. *Note Output Section
+Phdr::.
+
+ It is normal to put certain sections in more than one segment. This
+merely implies that one segment of memory contains another. You may
+repeat `:PHDR', using it once for each segment which should contain the
+section.
+
+ If you place a section in one or more segments using `:PHDR', then
+the linker will place all subsequent allocatable sections which do not
+specify `:PHDR' in the same segments. This is for convenience, since
+generally a whole set of contiguous sections will be placed in a single
+segment. You can use `:NONE' to override the default segment and tell
+the linker to not put the section in any segment at all.
+
+ You may use the `FILEHDR' and `PHDRS' keywords appear after the
+program header type to further describe the contents of the segment.
+The `FILEHDR' keyword means that the segment should include the ELF
+file header. The `PHDRS' keyword means that the segment should include
+the ELF program headers themselves.
+
+ The TYPE may be one of the following. The numbers indicate the
+value of the keyword.
+
+`PT_NULL' (0)
+ Indicates an unused program header.
+
+`PT_LOAD' (1)
+ Indicates that this program header describes a segment to be
+ loaded from the file.
+
+`PT_DYNAMIC' (2)
+ Indicates a segment where dynamic linking information can be found.
+
+`PT_INTERP' (3)
+ Indicates a segment where the name of the program interpreter may
+ be found.
+
+`PT_NOTE' (4)
+ Indicates a segment holding note information.
+
+`PT_SHLIB' (5)
+ A reserved program header type, defined but not specified by the
+ ELF ABI.
+
+`PT_PHDR' (6)
+ Indicates a segment where the program headers may be found.
+
+EXPRESSION
+ An expression giving the numeric type of the program header. This
+ may be used for types not defined above.
+
+ You can specify that a segment should be loaded at a particular
+address in memory by using an `AT' expression. This is identical to the
+`AT' command used as an output section attribute (*note Output Section
+LMA::). The `AT' command for a program header overrides the output
+section attribute.
+
+ The linker will normally set the segment flags based on the sections
+which comprise the segment. You may use the `FLAGS' keyword to
+explicitly specify the segment flags. The value of FLAGS must be an
+integer. It is used to set the `p_flags' field of the program header.
+
+ Here is an example of `PHDRS'. This shows a typical set of program
+headers used on a native ELF system.
+
+ PHDRS
+ {
+ headers PT_PHDR PHDRS ;
+ interp PT_INTERP ;
+ text PT_LOAD FILEHDR PHDRS ;
+ data PT_LOAD ;
+ dynamic PT_DYNAMIC ;
+ }
+
+ SECTIONS
+ {
+ . = SIZEOF_HEADERS;
+ .interp : { *(.interp) } :text :interp
+ .text : { *(.text) } :text
+ .rodata : { *(.rodata) } /* defaults to :text */
+ ...
+ . = . + 0x1000; /* move to a new page in memory */
+ .data : { *(.data) } :data
+ .dynamic : { *(.dynamic) } :data :dynamic
+ ...
+ }
+
+
+File: ld.info, Node: VERSION, Next: Expressions, Prev: PHDRS, Up: Scripts
+
+3.9 VERSION Command
+===================
+
+The linker supports symbol versions when using ELF. Symbol versions are
+only useful when using shared libraries. The dynamic linker can use
+symbol versions to select a specific version of a function when it runs
+a program that may have been linked against an earlier version of the
+shared library.
+
+ You can include a version script directly in the main linker script,
+or you can supply the version script as an implicit linker script. You
+can also use the `--version-script' linker option.
+
+ The syntax of the `VERSION' command is simply
+ VERSION { version-script-commands }
+
+ The format of the version script commands is identical to that used
+by Sun's linker in Solaris 2.5. The version script defines a tree of
+version nodes. You specify the node names and interdependencies in the
+version script. You can specify which symbols are bound to which
+version nodes, and you can reduce a specified set of symbols to local
+scope so that they are not globally visible outside of the shared
+library.
+
+ The easiest way to demonstrate the version script language is with a
+few examples.
+
+ VERS_1.1 {
+ global:
+ foo1;
+ local:
+ old*;
+ original*;
+ new*;
+ };
+
+ VERS_1.2 {
+ foo2;
+ } VERS_1.1;
+
+ VERS_2.0 {
+ bar1; bar2;
+ extern "C++" {
+ ns::*;
+ "int f(int, double)";
+ }
+ } VERS_1.2;
+
+ This example version script defines three version nodes. The first
+version node defined is `VERS_1.1'; it has no other dependencies. The
+script binds the symbol `foo1' to `VERS_1.1'. It reduces a number of
+symbols to local scope so that they are not visible outside of the
+shared library; this is done using wildcard patterns, so that any
+symbol whose name begins with `old', `original', or `new' is matched.
+The wildcard patterns available are the same as those used in the shell
+when matching filenames (also known as "globbing"). However, if you
+specify the symbol name inside double quotes, then the name is treated
+as literal, rather than as a glob pattern.
+
+ Next, the version script defines node `VERS_1.2'. This node depends
+upon `VERS_1.1'. The script binds the symbol `foo2' to the version
+node `VERS_1.2'.
+
+ Finally, the version script defines node `VERS_2.0'. This node
+depends upon `VERS_1.2'. The scripts binds the symbols `bar1' and
+`bar2' are bound to the version node `VERS_2.0'.
+
+ When the linker finds a symbol defined in a library which is not
+specifically bound to a version node, it will effectively bind it to an
+unspecified base version of the library. You can bind all otherwise
+unspecified symbols to a given version node by using `global: *;'
+somewhere in the version script. Note that it's slightly crazy to use
+wildcards in a global spec except on the last version node. Global
+wildcards elsewhere run the risk of accidentally adding symbols to the
+set exported for an old version. That's wrong since older versions
+ought to have a fixed set of symbols.
+
+ The names of the version nodes have no specific meaning other than
+what they might suggest to the person reading them. The `2.0' version
+could just as well have appeared in between `1.1' and `1.2'. However,
+this would be a confusing way to write a version script.
+
+ Node name can be omitted, provided it is the only version node in
+the version script. Such version script doesn't assign any versions to
+symbols, only selects which symbols will be globally visible out and
+which won't.
+
+ { global: foo; bar; local: *; };
+
+ When you link an application against a shared library that has
+versioned symbols, the application itself knows which version of each
+symbol it requires, and it also knows which version nodes it needs from
+each shared library it is linked against. Thus at runtime, the dynamic
+loader can make a quick check to make sure that the libraries you have
+linked against do in fact supply all of the version nodes that the
+application will need to resolve all of the dynamic symbols. In this
+way it is possible for the dynamic linker to know with certainty that
+all external symbols that it needs will be resolvable without having to
+search for each symbol reference.
+
+ The symbol versioning is in effect a much more sophisticated way of
+doing minor version checking that SunOS does. The fundamental problem
+that is being addressed here is that typically references to external
+functions are bound on an as-needed basis, and are not all bound when
+the application starts up. If a shared library is out of date, a
+required interface may be missing; when the application tries to use
+that interface, it may suddenly and unexpectedly fail. With symbol
+versioning, the user will get a warning when they start their program if
+the libraries being used with the application are too old.
+
+ There are several GNU extensions to Sun's versioning approach. The
+first of these is the ability to bind a symbol to a version node in the
+source file where the symbol is defined instead of in the versioning
+script. This was done mainly to reduce the burden on the library
+maintainer. You can do this by putting something like:
+ __asm__(".symver original_foo,foo@VERS_1.1");
+ in the C source file. This renames the function `original_foo' to
+be an alias for `foo' bound to the version node `VERS_1.1'. The
+`local:' directive can be used to prevent the symbol `original_foo'
+from being exported. A `.symver' directive takes precedence over a
+version script.
+
+ The second GNU extension is to allow multiple versions of the same
+function to appear in a given shared library. In this way you can make
+an incompatible change to an interface without increasing the major
+version number of the shared library, while still allowing applications
+linked against the old interface to continue to function.
+
+ To do this, you must use multiple `.symver' directives in the source
+file. Here is an example:
+
+ __asm__(".symver original_foo,foo@");
+ __asm__(".symver old_foo,foo@VERS_1.1");
+ __asm__(".symver old_foo1,foo@VERS_1.2");
+ __asm__(".symver new_foo,foo@@VERS_2.0");
+
+ In this example, `foo@' represents the symbol `foo' bound to the
+unspecified base version of the symbol. The source file that contains
+this example would define 4 C functions: `original_foo', `old_foo',
+`old_foo1', and `new_foo'.
+
+ When you have multiple definitions of a given symbol, there needs to
+be some way to specify a default version to which external references to
+this symbol will be bound. You can do this with the `foo@@VERS_2.0'
+type of `.symver' directive. You can only declare one version of a
+symbol as the default in this manner; otherwise you would effectively
+have multiple definitions of the same symbol.
+
+ If you wish to bind a reference to a specific version of the symbol
+within the shared library, you can use the aliases of convenience
+(i.e., `old_foo'), or you can use the `.symver' directive to
+specifically bind to an external version of the function in question.
+
+ You can also specify the language in the version script:
+
+ VERSION extern "lang" { version-script-commands }
+
+ The supported `lang's are `C', `C++', and `Java'. The linker will
+iterate over the list of symbols at the link time and demangle them
+according to `lang' before matching them to the patterns specified in
+`version-script-commands'.
+
+ Demangled names may contains spaces and other special characters. As
+described above, you can use a glob pattern to match demangled names,
+or you can use a double-quoted string to match the string exactly. In
+the latter case, be aware that minor differences (such as differing
+whitespace) between the version script and the demangler output will
+cause a mismatch. As the exact string generated by the demangler might
+change in the future, even if the mangled name does not, you should
+check that all of your version directives are behaving as you expect
+when you upgrade.
+
+
+File: ld.info, Node: Expressions, Next: Implicit Linker Scripts, Prev: VERSION, Up: Scripts
+
+3.10 Expressions in Linker Scripts
+==================================
+
+The syntax for expressions in the linker script language is identical to
+that of C expressions. All expressions are evaluated as integers. All
+expressions are evaluated in the same size, which is 32 bits if both the
+host and target are 32 bits, and is otherwise 64 bits.
+
+ You can use and set symbol values in expressions.
+
+ The linker defines several special purpose builtin functions for use
+in expressions.
+
+* Menu:
+
+* Constants:: Constants
+* Symbolic Constants:: Symbolic constants
+* Symbols:: Symbol Names
+* Orphan Sections:: Orphan Sections
+* Location Counter:: The Location Counter
+* Operators:: Operators
+* Evaluation:: Evaluation
+* Expression Section:: The Section of an Expression
+* Builtin Functions:: Builtin Functions
+
+
+File: ld.info, Node: Constants, Next: Symbolic Constants, Up: Expressions
+
+3.10.1 Constants
+----------------
+
+All constants are integers.
+
+ As in C, the linker considers an integer beginning with `0' to be
+octal, and an integer beginning with `0x' or `0X' to be hexadecimal.
+Alternatively the linker accepts suffixes of `h' or `H' for
+hexadeciaml, `o' or `O' for octal, `b' or `B' for binary and `d' or `D'
+for decimal. Any integer value without a prefix or a suffix is
+considered to be decimal.
+
+ In addition, you can use the suffixes `K' and `M' to scale a
+constant by `1024' or `1024*1024' respectively. For example, the
+following all refer to the same quantity:
+
+ _fourk_1 = 4K;
+ _fourk_2 = 4096;
+ _fourk_3 = 0x1000;
+ _fourk_4 = 10000o;
+
+ Note - the `K' and `M' suffixes cannot be used in conjunction with
+the base suffixes mentioned above.
+
+
+File: ld.info, Node: Symbolic Constants, Next: Symbols, Prev: Constants, Up: Expressions
+
+3.10.2 Symbolic Constants
+-------------------------
+
+It is possible to refer to target specific constants via the use of the
+`CONSTANT(NAME)' operator, where NAME is one of:
+
+`MAXPAGESIZE'
+ The target's maximum page size.
+
+`COMMONPAGESIZE'
+ The target's default page size.
+
+ So for example:
+
+ .text ALIGN (CONSTANT (MAXPAGESIZE)) : { *(.text) }
+
+ will create a text section aligned to the largest page boundary
+supported by the target.
+
+
+File: ld.info, Node: Symbols, Next: Orphan Sections, Prev: Symbolic Constants, Up: Expressions
+
+3.10.3 Symbol Names
+-------------------
+
+Unless quoted, symbol names start with a letter, underscore, or period
+and may include letters, digits, underscores, periods, and hyphens.
+Unquoted symbol names must not conflict with any keywords. You can
+specify a symbol which contains odd characters or has the same name as a
+keyword by surrounding the symbol name in double quotes:
+ "SECTION" = 9;
+ "with a space" = "also with a space" + 10;
+
+ Since symbols can contain many non-alphabetic characters, it is
+safest to delimit symbols with spaces. For example, `A-B' is one
+symbol, whereas `A - B' is an expression involving subtraction.
+
+
+File: ld.info, Node: Orphan Sections, Next: Location Counter, Prev: Symbols, Up: Expressions
+
+3.10.4 Orphan Sections
+----------------------
+
+Orphan sections are sections present in the input files which are not
+explicitly placed into the output file by the linker script. The
+linker will still copy these sections into the output file, but it has
+to guess as to where they should be placed. The linker uses a simple
+heuristic to do this. It attempts to place orphan sections after
+non-orphan sections of the same attribute, such as code vs data,
+loadable vs non-loadable, etc. If there is not enough room to do this
+then it places at the end of the file.
+
+ For ELF targets, the attribute of the section includes section type
+as well as section flag.
+
+ If an orphaned section's name is representable as a C identifier then
+the linker will automatically *note PROVIDE:: two symbols:
+__start_SECNAME and __end_SECNAME, where SECNAME is the name of the
+section. These indicate the start address and end address of the
+orphaned section respectively. Note: most section names are not
+representable as C identifiers because they contain a `.' character.
+
+
+File: ld.info, Node: Location Counter, Next: Operators, Prev: Orphan Sections, Up: Expressions
+
+3.10.5 The Location Counter
+---------------------------
+
+The special linker variable "dot" `.' always contains the current
+output location counter. Since the `.' always refers to a location in
+an output section, it may only appear in an expression within a
+`SECTIONS' command. The `.' symbol may appear anywhere that an
+ordinary symbol is allowed in an expression.
+
+ Assigning a value to `.' will cause the location counter to be
+moved. This may be used to create holes in the output section. The
+location counter may not be moved backwards inside an output section,
+and may not be moved backwards outside of an output section if so doing
+creates areas with overlapping LMAs.
+
+ SECTIONS
+ {
+ output :
+ {
+ file1(.text)
+ . = . + 1000;
+ file2(.text)
+ . += 1000;
+ file3(.text)
+ } = 0x12345678;
+ }
+ In the previous example, the `.text' section from `file1' is located
+at the beginning of the output section `output'. It is followed by a
+1000 byte gap. Then the `.text' section from `file2' appears, also
+with a 1000 byte gap following before the `.text' section from `file3'.
+The notation `= 0x12345678' specifies what data to write in the gaps
+(*note Output Section Fill::).
+
+ Note: `.' actually refers to the byte offset from the start of the
+current containing object. Normally this is the `SECTIONS' statement,
+whose start address is 0, hence `.' can be used as an absolute address.
+If `.' is used inside a section description however, it refers to the
+byte offset from the start of that section, not an absolute address.
+Thus in a script like this:
+
+ SECTIONS
+ {
+ . = 0x100
+ .text: {
+ *(.text)
+ . = 0x200
+ }
+ . = 0x500
+ .data: {
+ *(.data)
+ . += 0x600
+ }
+ }
+
+ The `.text' section will be assigned a starting address of 0x100 and
+a size of exactly 0x200 bytes, even if there is not enough data in the
+`.text' input sections to fill this area. (If there is too much data,
+an error will be produced because this would be an attempt to move `.'
+backwards). The `.data' section will start at 0x500 and it will have
+an extra 0x600 bytes worth of space after the end of the values from
+the `.data' input sections and before the end of the `.data' output
+section itself.
+
+ Setting symbols to the value of the location counter outside of an
+output section statement can result in unexpected values if the linker
+needs to place orphan sections. For example, given the following:
+
+ SECTIONS
+ {
+ start_of_text = . ;
+ .text: { *(.text) }
+ end_of_text = . ;
+
+ start_of_data = . ;
+ .data: { *(.data) }
+ end_of_data = . ;
+ }
+
+ If the linker needs to place some input section, e.g. `.rodata', not
+mentioned in the script, it might choose to place that section between
+`.text' and `.data'. You might think the linker should place `.rodata'
+on the blank line in the above script, but blank lines are of no
+particular significance to the linker. As well, the linker doesn't
+associate the above symbol names with their sections. Instead, it
+assumes that all assignments or other statements belong to the previous
+output section, except for the special case of an assignment to `.'.
+I.e., the linker will place the orphan `.rodata' section as if the
+script was written as follows:
+
+ SECTIONS
+ {
+ start_of_text = . ;
+ .text: { *(.text) }
+ end_of_text = . ;
+
+ start_of_data = . ;
+ .rodata: { *(.rodata) }
+ .data: { *(.data) }
+ end_of_data = . ;
+ }
+
+ This may or may not be the script author's intention for the value of
+`start_of_data'. One way to influence the orphan section placement is
+to assign the location counter to itself, as the linker assumes that an
+assignment to `.' is setting the start address of a following output
+section and thus should be grouped with that section. So you could
+write:
+
+ SECTIONS
+ {
+ start_of_text = . ;
+ .text: { *(.text) }
+ end_of_text = . ;
+
+ . = . ;
+ start_of_data = . ;
+ .data: { *(.data) }
+ end_of_data = . ;
+ }
+
+ Now, the orphan `.rodata' section will be placed between
+`end_of_text' and `start_of_data'.
+
+
+File: ld.info, Node: Operators, Next: Evaluation, Prev: Location Counter, Up: Expressions
+
+3.10.6 Operators
+----------------
+
+The linker recognizes the standard C set of arithmetic operators, with
+the standard bindings and precedence levels:
+ precedence associativity Operators Notes
+ (highest)
+ 1 left ! - ~ (1)
+ 2 left * / %
+ 3 left + -
+ 4 left >> <<
+ 5 left == != > < <= >=
+ 6 left &
+ 7 left |
+ 8 left &&
+ 9 left ||
+ 10 right ? :
+ 11 right &= += -= *= /= (2)
+ (lowest)
+ Notes: (1) Prefix operators (2) *Note Assignments::.
+
+
+File: ld.info, Node: Evaluation, Next: Expression Section, Prev: Operators, Up: Expressions
+
+3.10.7 Evaluation
+-----------------
+
+The linker evaluates expressions lazily. It only computes the value of
+an expression when absolutely necessary.
+
+ The linker needs some information, such as the value of the start
+address of the first section, and the origins and lengths of memory
+regions, in order to do any linking at all. These values are computed
+as soon as possible when the linker reads in the linker script.
+
+ However, other values (such as symbol values) are not known or needed
+until after storage allocation. Such values are evaluated later, when
+other information (such as the sizes of output sections) is available
+for use in the symbol assignment expression.
+
+ The sizes of sections cannot be known until after allocation, so
+assignments dependent upon these are not performed until after
+allocation.
+
+ Some expressions, such as those depending upon the location counter
+`.', must be evaluated during section allocation.
+
+ If the result of an expression is required, but the value is not
+available, then an error results. For example, a script like the
+following
+ SECTIONS
+ {
+ .text 9+this_isnt_constant :
+ { *(.text) }
+ }
+will cause the error message `non constant expression for initial
+address'.
+
+
+File: ld.info, Node: Expression Section, Next: Builtin Functions, Prev: Evaluation, Up: Expressions
+
+3.10.8 The Section of an Expression
+-----------------------------------
+
+When the linker evaluates an expression, the result is either absolute
+or relative to some section. A relative expression is expressed as a
+fixed offset from the base of a section.
+
+ The position of the expression within the linker script determines
+whether it is absolute or relative. An expression which appears within
+an output section definition is relative to the base of the output
+section. An expression which appears elsewhere will be absolute.
+
+ A symbol set to a relative expression will be relocatable if you
+request relocatable output using the `-r' option. That means that a
+further link operation may change the value of the symbol. The symbol's
+section will be the section of the relative expression.
+
+ A symbol set to an absolute expression will retain the same value
+through any further link operation. The symbol will be absolute, and
+will not have any particular associated section.
+
+ You can use the builtin function `ABSOLUTE' to force an expression
+to be absolute when it would otherwise be relative. For example, to
+create an absolute symbol set to the address of the end of the output
+section `.data':
+ SECTIONS
+ {
+ .data : { *(.data) _edata = ABSOLUTE(.); }
+ }
+ If `ABSOLUTE' were not used, `_edata' would be relative to the
+`.data' section.
+
+
+File: ld.info, Node: Builtin Functions, Prev: Expression Section, Up: Expressions
+
+3.10.9 Builtin Functions
+------------------------
+
+The linker script language includes a number of builtin functions for
+use in linker script expressions.
+
+`ABSOLUTE(EXP)'
+ Return the absolute (non-relocatable, as opposed to non-negative)
+ value of the expression EXP. Primarily useful to assign an
+ absolute value to a symbol within a section definition, where
+ symbol values are normally section relative. *Note Expression
+ Section::.
+
+`ADDR(SECTION)'
+ Return the absolute address (the VMA) of the named SECTION. Your
+ script must previously have defined the location of that section.
+ In the following example, `symbol_1' and `symbol_2' are assigned
+ identical values:
+ SECTIONS { ...
+ .output1 :
+ {
+ start_of_output_1 = ABSOLUTE(.);
+ ...
+ }
+ .output :
+ {
+ symbol_1 = ADDR(.output1);
+ symbol_2 = start_of_output_1;
+ }
+ ... }
+
+`ALIGN(ALIGN)'
+`ALIGN(EXP,ALIGN)'
+ Return the location counter (`.') or arbitrary expression aligned
+ to the next ALIGN boundary. The single operand `ALIGN' doesn't
+ change the value of the location counter--it just does arithmetic
+ on it. The two operand `ALIGN' allows an arbitrary expression to
+ be aligned upwards (`ALIGN(ALIGN)' is equivalent to `ALIGN(.,
+ ALIGN)').
+
+ Here is an example which aligns the output `.data' section to the
+ next `0x2000' byte boundary after the preceding section and sets a
+ variable within the section to the next `0x8000' boundary after the
+ input sections:
+ SECTIONS { ...
+ .data ALIGN(0x2000): {
+ *(.data)
+ variable = ALIGN(0x8000);
+ }
+ ... }
+ The first use of `ALIGN' in this example specifies the
+ location of a section because it is used as the optional ADDRESS
+ attribute of a section definition (*note Output Section
+ Address::). The second use of `ALIGN' is used to defines the
+ value of a symbol.
+
+ The builtin function `NEXT' is closely related to `ALIGN'.
+
+`ALIGNOF(SECTION)'
+ Return the alignment in bytes of the named SECTION, if that
+ section has been allocated. If the section has not been allocated
+ when this is evaluated, the linker will report an error. In the
+ following example, the alignment of the `.output' section is
+ stored as the first value in that section.
+ SECTIONS{ ...
+ .output {
+ LONG (ALIGNOF (.output))
+ ...
+ }
+ ... }
+
+`BLOCK(EXP)'
+ This is a synonym for `ALIGN', for compatibility with older linker
+ scripts. It is most often seen when setting the address of an
+ output section.
+
+`DATA_SEGMENT_ALIGN(MAXPAGESIZE, COMMONPAGESIZE)'
+ This is equivalent to either
+ (ALIGN(MAXPAGESIZE) + (. & (MAXPAGESIZE - 1)))
+ or
+ (ALIGN(MAXPAGESIZE) + (. & (MAXPAGESIZE - COMMONPAGESIZE)))
+ depending on whether the latter uses fewer COMMONPAGESIZE sized
+ pages for the data segment (area between the result of this
+ expression and `DATA_SEGMENT_END') than the former or not. If the
+ latter form is used, it means COMMONPAGESIZE bytes of runtime
+ memory will be saved at the expense of up to COMMONPAGESIZE wasted
+ bytes in the on-disk file.
+
+ This expression can only be used directly in `SECTIONS' commands,
+ not in any output section descriptions and only once in the linker
+ script. COMMONPAGESIZE should be less or equal to MAXPAGESIZE and
+ should be the system page size the object wants to be optimized
+ for (while still working on system page sizes up to MAXPAGESIZE).
+
+ Example:
+ . = DATA_SEGMENT_ALIGN(0x10000, 0x2000);
+
+`DATA_SEGMENT_END(EXP)'
+ This defines the end of data segment for `DATA_SEGMENT_ALIGN'
+ evaluation purposes.
+
+ . = DATA_SEGMENT_END(.);
+
+`DATA_SEGMENT_RELRO_END(OFFSET, EXP)'
+ This defines the end of the `PT_GNU_RELRO' segment when `-z relro'
+ option is used. Second argument is returned. When `-z relro'
+ option is not present, `DATA_SEGMENT_RELRO_END' does nothing,
+ otherwise `DATA_SEGMENT_ALIGN' is padded so that EXP + OFFSET is
+ aligned to the most commonly used page boundary for particular
+ target. If present in the linker script, it must always come in
+ between `DATA_SEGMENT_ALIGN' and `DATA_SEGMENT_END'.
+
+ . = DATA_SEGMENT_RELRO_END(24, .);
+
+`DEFINED(SYMBOL)'
+ Return 1 if SYMBOL is in the linker global symbol table and is
+ defined before the statement using DEFINED in the script, otherwise
+ return 0. You can use this function to provide default values for
+ symbols. For example, the following script fragment shows how to
+ set a global symbol `begin' to the first location in the `.text'
+ section--but if a symbol called `begin' already existed, its value
+ is preserved:
+
+ SECTIONS { ...
+ .text : {
+ begin = DEFINED(begin) ? begin : . ;
+ ...
+ }
+ ...
+ }
+
+`LENGTH(MEMORY)'
+ Return the length of the memory region named MEMORY.
+
+`LOADADDR(SECTION)'
+ Return the absolute LMA of the named SECTION. This is normally
+ the same as `ADDR', but it may be different if the `AT' attribute
+ is used in the output section definition (*note Output Section
+ LMA::).
+
+`MAX(EXP1, EXP2)'
+ Returns the maximum of EXP1 and EXP2.
+
+`MIN(EXP1, EXP2)'
+ Returns the minimum of EXP1 and EXP2.
+
+`NEXT(EXP)'
+ Return the next unallocated address that is a multiple of EXP.
+ This function is closely related to `ALIGN(EXP)'; unless you use
+ the `MEMORY' command to define discontinuous memory for the output
+ file, the two functions are equivalent.
+
+`ORIGIN(MEMORY)'
+ Return the origin of the memory region named MEMORY.
+
+`SEGMENT_START(SEGMENT, DEFAULT)'
+ Return the base address of the named SEGMENT. If an explicit
+ value has been given for this segment (with a command-line `-T'
+ option) that value will be returned; otherwise the value will be
+ DEFAULT. At present, the `-T' command-line option can only be
+ used to set the base address for the "text", "data", and "bss"
+ sections, but you use `SEGMENT_START' with any segment name.
+
+`SIZEOF(SECTION)'
+ Return the size in bytes of the named SECTION, if that section has
+ been allocated. If the section has not been allocated when this is
+ evaluated, the linker will report an error. In the following
+ example, `symbol_1' and `symbol_2' are assigned identical values:
+ SECTIONS{ ...
+ .output {
+ .start = . ;
+ ...
+ .end = . ;
+ }
+ symbol_1 = .end - .start ;
+ symbol_2 = SIZEOF(.output);
+ ... }
+
+`SIZEOF_HEADERS'
+`sizeof_headers'
+ Return the size in bytes of the output file's headers. This is
+ information which appears at the start of the output file. You
+ can use this number when setting the start address of the first
+ section, if you choose, to facilitate paging.
+
+ When producing an ELF output file, if the linker script uses the
+ `SIZEOF_HEADERS' builtin function, the linker must compute the
+ number of program headers before it has determined all the section
+ addresses and sizes. If the linker later discovers that it needs
+ additional program headers, it will report an error `not enough
+ room for program headers'. To avoid this error, you must avoid
+ using the `SIZEOF_HEADERS' function, or you must rework your linker
+ script to avoid forcing the linker to use additional program
+ headers, or you must define the program headers yourself using the
+ `PHDRS' command (*note PHDRS::).
+
+
+File: ld.info, Node: Implicit Linker Scripts, Prev: Expressions, Up: Scripts
+
+3.11 Implicit Linker Scripts
+============================
+
+If you specify a linker input file which the linker can not recognize as
+an object file or an archive file, it will try to read the file as a
+linker script. If the file can not be parsed as a linker script, the
+linker will report an error.
+
+ An implicit linker script will not replace the default linker script.
+
+ Typically an implicit linker script would contain only symbol
+assignments, or the `INPUT', `GROUP', or `VERSION' commands.
+
+ Any input files read because of an implicit linker script will be
+read at the position in the command line where the implicit linker
+script was read. This can affect archive searching.
+
+
+File: ld.info, Node: Machine Dependent, Next: BFD, Prev: Scripts, Up: Top
+
+4 Machine Dependent Features
+****************************
+
+`ld' has additional features on some platforms; the following sections
+describe them. Machines where `ld' has no additional functionality are
+not listed.
+
+* Menu:
+
+
+* H8/300:: `ld' and the H8/300
+
+* i960:: `ld' and the Intel 960 family
+
+* ARM:: `ld' and the ARM family
+
+* HPPA ELF32:: `ld' and HPPA 32-bit ELF
+
+* M68K:: `ld' and the Motorola 68K family
+
+* MMIX:: `ld' and MMIX
+
+* MSP430:: `ld' and MSP430
+
+* M68HC11/68HC12:: `ld' and the Motorola 68HC11 and 68HC12 families
+
+* PowerPC ELF32:: `ld' and PowerPC 32-bit ELF Support
+
+* PowerPC64 ELF64:: `ld' and PowerPC64 64-bit ELF Support
+
+* SPU ELF:: `ld' and SPU ELF Support
+
+* TI COFF:: `ld' and TI COFF
+
+* WIN32:: `ld' and WIN32 (cygwin/mingw)
+
+* Xtensa:: `ld' and Xtensa Processors
+
+
+File: ld.info, Node: H8/300, Next: i960, Up: Machine Dependent
+
+4.1 `ld' and the H8/300
+=======================
+
+For the H8/300, `ld' can perform these global optimizations when you
+specify the `--relax' command-line option.
+
+_relaxing address modes_
+ `ld' finds all `jsr' and `jmp' instructions whose targets are
+ within eight bits, and turns them into eight-bit program-counter
+ relative `bsr' and `bra' instructions, respectively.
+
+_synthesizing instructions_
+ `ld' finds all `mov.b' instructions which use the sixteen-bit
+ absolute address form, but refer to the top page of memory, and
+ changes them to use the eight-bit address form. (That is: the
+ linker turns `mov.b `@'AA:16' into `mov.b `@'AA:8' whenever the
+ address AA is in the top page of memory).
+
+_bit manipulation instructions_
+ `ld' finds all bit manipulation instructions like `band, bclr,
+ biand, bild, bior, bist, bixor, bld, bnot, bor, bset, bst, btst,
+ bxor' which use 32 bit and 16 bit absolute address form, but refer
+ to the top page of memory, and changes them to use the 8 bit
+ address form. (That is: the linker turns `bset #xx:3,`@'AA:32'
+ into `bset #xx:3,`@'AA:8' whenever the address AA is in the top
+ page of memory).
+
+_system control instructions_
+ `ld' finds all `ldc.w, stc.w' instructions which use the 32 bit
+ absolute address form, but refer to the top page of memory, and
+ changes them to use 16 bit address form. (That is: the linker
+ turns `ldc.w `@'AA:32,ccr' into `ldc.w `@'AA:16,ccr' whenever the
+ address AA is in the top page of memory).
+
+
+File: ld.info, Node: i960, Next: ARM, Prev: H8/300, Up: Machine Dependent
+
+4.2 `ld' and the Intel 960 Family
+=================================
+
+You can use the `-AARCHITECTURE' command line option to specify one of
+the two-letter names identifying members of the 960 family; the option
+specifies the desired output target, and warns of any incompatible
+instructions in the input files. It also modifies the linker's search
+strategy for archive libraries, to support the use of libraries
+specific to each particular architecture, by including in the search
+loop names suffixed with the string identifying the architecture.
+
+ For example, if your `ld' command line included `-ACA' as well as
+`-ltry', the linker would look (in its built-in search paths, and in
+any paths you specify with `-L') for a library with the names
+
+ try
+ libtry.a
+ tryca
+ libtryca.a
+
+The first two possibilities would be considered in any event; the last
+two are due to the use of `-ACA'.
+
+ You can meaningfully use `-A' more than once on a command line, since
+the 960 architecture family allows combination of target architectures;
+each use will add another pair of name variants to search for when `-l'
+specifies a library.
+
+ `ld' supports the `--relax' option for the i960 family. If you
+specify `--relax', `ld' finds all `balx' and `calx' instructions whose
+targets are within 24 bits, and turns them into 24-bit program-counter
+relative `bal' and `cal' instructions, respectively. `ld' also turns
+`cal' instructions into `bal' instructions when it determines that the
+target subroutine is a leaf routine (that is, the target subroutine does
+not itself call any subroutines).
+
+ The `--fix-cortex-a8' switch enables a link-time workaround for an
+erratum in certain Cortex-A8 processors. The workaround is enabled by
+default if you are targeting the ARM v7-A architecture profile. It can
+be enabled otherwise by specifying `--fix-cortex-a8', or disabled
+unconditionally by specifying `--no-fix-cortex-a8'.
+
+ The erratum only affects Thumb-2 code. Please contact ARM for
+further details.
+
+
+File: ld.info, Node: M68HC11/68HC12, Next: PowerPC ELF32, Prev: MSP430, Up: Machine Dependent
+
+4.3 `ld' and the Motorola 68HC11 and 68HC12 families
+====================================================
+
+4.3.1 Linker Relaxation
+-----------------------
+
+For the Motorola 68HC11, `ld' can perform these global optimizations
+when you specify the `--relax' command-line option.
+
+_relaxing address modes_
+ `ld' finds all `jsr' and `jmp' instructions whose targets are
+ within eight bits, and turns them into eight-bit program-counter
+ relative `bsr' and `bra' instructions, respectively.
+
+ `ld' also looks at all 16-bit extended addressing modes and
+ transforms them in a direct addressing mode when the address is in
+ page 0 (between 0 and 0x0ff).
+
+_relaxing gcc instruction group_
+ When `gcc' is called with `-mrelax', it can emit group of
+ instructions that the linker can optimize to use a 68HC11 direct
+ addressing mode. These instructions consists of `bclr' or `bset'
+ instructions.
+
+
+4.3.2 Trampoline Generation
+---------------------------
+
+For 68HC11 and 68HC12, `ld' can generate trampoline code to call a far
+function using a normal `jsr' instruction. The linker will also change
+the relocation to some far function to use the trampoline address
+instead of the function address. This is typically the case when a
+pointer to a function is taken. The pointer will in fact point to the
+function trampoline.
+
+
+File: ld.info, Node: ARM, Next: HPPA ELF32, Prev: i960, Up: Machine Dependent
+
+4.4 `ld' and the ARM family
+===========================
+
+For the ARM, `ld' will generate code stubs to allow functions calls
+between ARM and Thumb code. These stubs only work with code that has
+been compiled and assembled with the `-mthumb-interwork' command line
+option. If it is necessary to link with old ARM object files or
+libraries, which have not been compiled with the -mthumb-interwork
+option then the `--support-old-code' command line switch should be
+given to the linker. This will make it generate larger stub functions
+which will work with non-interworking aware ARM code. Note, however,
+the linker does not support generating stubs for function calls to
+non-interworking aware Thumb code.
+
+ The `--thumb-entry' switch is a duplicate of the generic `--entry'
+switch, in that it sets the program's starting address. But it also
+sets the bottom bit of the address, so that it can be branched to using
+a BX instruction, and the program will start executing in Thumb mode
+straight away.
+
+ The `--use-nul-prefixed-import-tables' switch is specifying, that
+the import tables idata4 and idata5 have to be generated with a zero
+elememt prefix for import libraries. This is the old style to generate
+import tables. By default this option is turned off.
+
+ The `--be8' switch instructs `ld' to generate BE8 format
+executables. This option is only valid when linking big-endian objects.
+The resulting image will contain big-endian data and little-endian code.
+
+ The `R_ARM_TARGET1' relocation is typically used for entries in the
+`.init_array' section. It is interpreted as either `R_ARM_REL32' or
+`R_ARM_ABS32', depending on the target. The `--target1-rel' and
+`--target1-abs' switches override the default.
+
+ The `--target2=type' switch overrides the default definition of the
+`R_ARM_TARGET2' relocation. Valid values for `type', their meanings,
+and target defaults are as follows:
+`rel'
+ `R_ARM_REL32' (arm*-*-elf, arm*-*-eabi)
+
+`abs'
+ `R_ARM_ABS32' (arm*-*-symbianelf)
+
+`got-rel'
+ `R_ARM_GOT_PREL' (arm*-*-linux, arm*-*-*bsd)
+
+ The `R_ARM_V4BX' relocation (defined by the ARM AAELF specification)
+enables objects compiled for the ARMv4 architecture to be
+interworking-safe when linked with other objects compiled for ARMv4t,
+but also allows pure ARMv4 binaries to be built from the same ARMv4
+objects.
+
+ In the latter case, the switch `--fix-v4bx' must be passed to the
+linker, which causes v4t `BX rM' instructions to be rewritten as `MOV
+PC,rM', since v4 processors do not have a `BX' instruction.
+
+ In the former case, the switch should not be used, and `R_ARM_V4BX'
+relocations are ignored.
+
+ Replace `BX rM' instructions identified by `R_ARM_V4BX' relocations
+with a branch to the following veneer:
+
+ TST rM, #1
+ MOVEQ PC, rM
+ BX Rn
+
+ This allows generation of libraries/applications that work on ARMv4
+cores and are still interworking safe. Note that the above veneer
+clobbers the condition flags, so may cause incorrect progrm behavior in
+rare cases.
+
+ The `--use-blx' switch enables the linker to use ARM/Thumb BLX
+instructions (available on ARMv5t and above) in various situations.
+Currently it is used to perform calls via the PLT from Thumb code using
+BLX rather than using BX and a mode-switching stub before each PLT
+entry. This should lead to such calls executing slightly faster.
+
+ This option is enabled implicitly for SymbianOS, so there is no need
+to specify it if you are using that target.
+
+ The `--vfp11-denorm-fix' switch enables a link-time workaround for a
+bug in certain VFP11 coprocessor hardware, which sometimes allows
+instructions with denorm operands (which must be handled by support
+code) to have those operands overwritten by subsequent instructions
+before the support code can read the intended values.
+
+ The bug may be avoided in scalar mode if you allow at least one
+intervening instruction between a VFP11 instruction which uses a
+register and another instruction which writes to the same register, or
+at least two intervening instructions if vector mode is in use. The bug
+only affects full-compliance floating-point mode: you do not need this
+workaround if you are using "runfast" mode. Please contact ARM for
+further details.
+
+ If you know you are using buggy VFP11 hardware, you can enable this
+workaround by specifying the linker option `--vfp-denorm-fix=scalar' if
+you are using the VFP11 scalar mode only, or `--vfp-denorm-fix=vector'
+if you are using vector mode (the latter also works for scalar code).
+The default is `--vfp-denorm-fix=none'.
+
+ If the workaround is enabled, instructions are scanned for
+potentially-troublesome sequences, and a veneer is created for each
+such sequence which may trigger the erratum. The veneer consists of the
+first instruction of the sequence and a branch back to the subsequent
+instruction. The original instruction is then replaced with a branch to
+the veneer. The extra cycles required to call and return from the veneer
+are sufficient to avoid the erratum in both the scalar and vector cases.
+
+ The `--no-enum-size-warning' switch prevents the linker from warning
+when linking object files that specify incompatible EABI enumeration
+size attributes. For example, with this switch enabled, linking of an
+object file using 32-bit enumeration values with another using
+enumeration values fitted into the smallest possible space will not be
+diagnosed.
+
+ The `--no-wchar-size-warning' switch prevents the linker from
+warning when linking object files that specify incompatible EABI
+`wchar_t' size attributes. For example, with this switch enabled,
+linking of an object file using 32-bit `wchar_t' values with another
+using 16-bit `wchar_t' values will not be diagnosed.
+
+ The `--pic-veneer' switch makes the linker use PIC sequences for
+ARM/Thumb interworking veneers, even if the rest of the binary is not
+PIC. This avoids problems on uClinux targets where `--emit-relocs' is
+used to generate relocatable binaries.
+
+ The linker will automatically generate and insert small sequences of
+code into a linked ARM ELF executable whenever an attempt is made to
+perform a function call to a symbol that is too far away. The
+placement of these sequences of instructions - called stubs - is
+controlled by the command line option `--stub-group-size=N'. The
+placement is important because a poor choice can create a need for
+duplicate stubs, increasing the code sizw. The linker will try to
+group stubs together in order to reduce interruptions to the flow of
+code, but it needs guidance as to how big these groups should be and
+where they should be placed.
+
+ The value of `N', the parameter to the `--stub-group-size=' option
+controls where the stub groups are placed. If it is negative then all
+stubs are placed after the first branch that needs them. If it is
+positive then the stubs can be placed either before or after the
+branches that need them. If the value of `N' is 1 (either +1 or -1)
+then the linker will choose exactly where to place groups of stubs,
+using its built in heuristics. A value of `N' greater than 1 (or
+smaller than -1) tells the linker that a single group of stubs can
+service at most `N' bytes from the input sections.
+
+ The default, if `--stub-group-size=' is not specified, is `N = +1'.
+
+ Farcalls stubs insertion is fully supported for the ARM-EABI target
+only, because it relies on object files properties not present
+otherwise.
+
+
+File: ld.info, Node: HPPA ELF32, Next: M68K, Prev: ARM, Up: Machine Dependent
+
+4.5 `ld' and HPPA 32-bit ELF Support
+====================================
+
+When generating a shared library, `ld' will by default generate import
+stubs suitable for use with a single sub-space application. The
+`--multi-subspace' switch causes `ld' to generate export stubs, and
+different (larger) import stubs suitable for use with multiple
+sub-spaces.
+
+ Long branch stubs and import/export stubs are placed by `ld' in stub
+sections located between groups of input sections. `--stub-group-size'
+specifies the maximum size of a group of input sections handled by one
+stub section. Since branch offsets are signed, a stub section may
+serve two groups of input sections, one group before the stub section,
+and one group after it. However, when using conditional branches that
+require stubs, it may be better (for branch prediction) that stub
+sections only serve one group of input sections. A negative value for
+`N' chooses this scheme, ensuring that branches to stubs always use a
+negative offset. Two special values of `N' are recognized, `1' and
+`-1'. These both instruct `ld' to automatically size input section
+groups for the branch types detected, with the same behaviour regarding
+stub placement as other positive or negative values of `N' respectively.
+
+ Note that `--stub-group-size' does not split input sections. A
+single input section larger than the group size specified will of course
+create a larger group (of one section). If input sections are too
+large, it may not be possible for a branch to reach its stub.
+
+
+File: ld.info, Node: M68K, Next: MMIX, Prev: HPPA ELF32, Up: Machine Dependent
+
+4.6 `ld' and the Motorola 68K family
+====================================
+
+The `--got=TYPE' option lets you choose the GOT generation scheme. The
+choices are `single', `negative', `multigot' and `target'. When
+`target' is selected the linker chooses the default GOT generation
+scheme for the current target. `single' tells the linker to generate a
+single GOT with entries only at non-negative offsets. `negative'
+instructs the linker to generate a single GOT with entries at both
+negative and positive offsets. Not all environments support such GOTs.
+`multigot' allows the linker to generate several GOTs in the output
+file. All GOT references from a single input object file access the
+same GOT, but references from different input object files might access
+different GOTs. Not all environments support such GOTs.
+
+
+File: ld.info, Node: MMIX, Next: MSP430, Prev: M68K, Up: Machine Dependent
+
+4.7 `ld' and MMIX
+=================
+
+For MMIX, there is a choice of generating `ELF' object files or `mmo'
+object files when linking. The simulator `mmix' understands the `mmo'
+format. The binutils `objcopy' utility can translate between the two
+formats.
+
+ There is one special section, the `.MMIX.reg_contents' section.
+Contents in this section is assumed to correspond to that of global
+registers, and symbols referring to it are translated to special
+symbols, equal to registers. In a final link, the start address of the
+`.MMIX.reg_contents' section corresponds to the first allocated global
+register multiplied by 8. Register `$255' is not included in this
+section; it is always set to the program entry, which is at the symbol
+`Main' for `mmo' files.
+
+ Global symbols with the prefix `__.MMIX.start.', for example
+`__.MMIX.start..text' and `__.MMIX.start..data' are special. The
+default linker script uses these to set the default start address of a
+section.
+
+ Initial and trailing multiples of zero-valued 32-bit words in a
+section, are left out from an mmo file.
+
+
+File: ld.info, Node: MSP430, Next: M68HC11/68HC12, Prev: MMIX, Up: Machine Dependent
+
+4.8 `ld' and MSP430
+===================
+
+For the MSP430 it is possible to select the MPU architecture. The flag
+`-m [mpu type]' will select an appropriate linker script for selected
+MPU type. (To get a list of known MPUs just pass `-m help' option to
+the linker).
+
+ The linker will recognize some extra sections which are MSP430
+specific:
+
+``.vectors''
+ Defines a portion of ROM where interrupt vectors located.
+
+``.bootloader''
+ Defines the bootloader portion of the ROM (if applicable). Any
+ code in this section will be uploaded to the MPU.
+
+``.infomem''
+ Defines an information memory section (if applicable). Any code in
+ this section will be uploaded to the MPU.
+
+``.infomemnobits''
+ This is the same as the `.infomem' section except that any code in
+ this section will not be uploaded to the MPU.
+
+``.noinit''
+ Denotes a portion of RAM located above `.bss' section.
+
+ The last two sections are used by gcc.
+
+
+File: ld.info, Node: PowerPC ELF32, Next: PowerPC64 ELF64, Prev: M68HC11/68HC12, Up: Machine Dependent
+
+4.9 `ld' and PowerPC 32-bit ELF Support
+=======================================
+
+Branches on PowerPC processors are limited to a signed 26-bit
+displacement, which may result in `ld' giving `relocation truncated to
+fit' errors with very large programs. `--relax' enables the generation
+of trampolines that can access the entire 32-bit address space. These
+trampolines are inserted at section boundaries, so may not themselves
+be reachable if an input section exceeds 33M in size. You may combine
+`-r' and `--relax' to add trampolines in a partial link. In that case
+both branches to undefined symbols and inter-section branches are also
+considered potentially out of range, and trampolines inserted.
+
+`--bss-plt'
+ Current PowerPC GCC accepts a `-msecure-plt' option that generates
+ code capable of using a newer PLT and GOT layout that has the
+ security advantage of no executable section ever needing to be
+ writable and no writable section ever being executable. PowerPC
+ `ld' will generate this layout, including stubs to access the PLT,
+ if all input files (including startup and static libraries) were
+ compiled with `-msecure-plt'. `--bss-plt' forces the old BSS PLT
+ (and GOT layout) which can give slightly better performance.
+
+`--secure-plt'
+ `ld' will use the new PLT and GOT layout if it is linking new
+ `-fpic' or `-fPIC' code, but does not do so automatically when
+ linking non-PIC code. This option requests the new PLT and GOT
+ layout. A warning will be given if some object file requires the
+ old style BSS PLT.
+
+`--sdata-got'
+ The new secure PLT and GOT are placed differently relative to other
+ sections compared to older BSS PLT and GOT placement. The
+ location of `.plt' must change because the new secure PLT is an
+ initialized section while the old PLT is uninitialized. The
+ reason for the `.got' change is more subtle: The new placement
+ allows `.got' to be read-only in applications linked with `-z
+ relro -z now'. However, this placement means that `.sdata' cannot
+ always be used in shared libraries, because the PowerPC ABI
+ accesses `.sdata' in shared libraries from the GOT pointer.
+ `--sdata-got' forces the old GOT placement. PowerPC GCC doesn't
+ use `.sdata' in shared libraries, so this option is really only
+ useful for other compilers that may do so.
+
+`--emit-stub-syms'
+ This option causes `ld' to label linker stubs with a local symbol
+ that encodes the stub type and destination.
+
+`--no-tls-optimize'
+ PowerPC `ld' normally performs some optimization of code sequences
+ used to access Thread-Local Storage. Use this option to disable
+ the optimization.
+
+
+File: ld.info, Node: PowerPC64 ELF64, Next: SPU ELF, Prev: PowerPC ELF32, Up: Machine Dependent
+
+4.10 `ld' and PowerPC64 64-bit ELF Support
+==========================================
+
+`--stub-group-size'
+ Long branch stubs, PLT call stubs and TOC adjusting stubs are
+ placed by `ld' in stub sections located between groups of input
+ sections. `--stub-group-size' specifies the maximum size of a
+ group of input sections handled by one stub section. Since branch
+ offsets are signed, a stub section may serve two groups of input
+ sections, one group before the stub section, and one group after
+ it. However, when using conditional branches that require stubs,
+ it may be better (for branch prediction) that stub sections only
+ serve one group of input sections. A negative value for `N'
+ chooses this scheme, ensuring that branches to stubs always use a
+ negative offset. Two special values of `N' are recognized, `1'
+ and `-1'. These both instruct `ld' to automatically size input
+ section groups for the branch types detected, with the same
+ behaviour regarding stub placement as other positive or negative
+ values of `N' respectively.
+
+ Note that `--stub-group-size' does not split input sections. A
+ single input section larger than the group size specified will of
+ course create a larger group (of one section). If input sections
+ are too large, it may not be possible for a branch to reach its
+ stub.
+
+`--emit-stub-syms'
+ This option causes `ld' to label linker stubs with a local symbol
+ that encodes the stub type and destination.
+
+`--dotsyms, --no-dotsyms'
+ These two options control how `ld' interprets version patterns in
+ a version script. Older PowerPC64 compilers emitted both a
+ function descriptor symbol with the same name as the function, and
+ a code entry symbol with the name prefixed by a dot (`.'). To
+ properly version a function `foo', the version script thus needs
+ to control both `foo' and `.foo'. The option `--dotsyms', on by
+ default, automatically adds the required dot-prefixed patterns.
+ Use `--no-dotsyms' to disable this feature.
+
+`--no-tls-optimize'
+ PowerPC64 `ld' normally performs some optimization of code
+ sequences used to access Thread-Local Storage. Use this option to
+ disable the optimization.
+
+`--no-opd-optimize'
+ PowerPC64 `ld' normally removes `.opd' section entries
+ corresponding to deleted link-once functions, or functions removed
+ by the action of `--gc-sections' or linker script `/DISCARD/'.
+ Use this option to disable `.opd' optimization.
+
+`--non-overlapping-opd'
+ Some PowerPC64 compilers have an option to generate compressed
+ `.opd' entries spaced 16 bytes apart, overlapping the third word,
+ the static chain pointer (unused in C) with the first word of the
+ next entry. This option expands such entries to the full 24 bytes.
+
+`--no-toc-optimize'
+ PowerPC64 `ld' normally removes unused `.toc' section entries.
+ Such entries are detected by examining relocations that reference
+ the TOC in code sections. A reloc in a deleted code section marks
+ a TOC word as unneeded, while a reloc in a kept code section marks
+ a TOC word as needed. Since the TOC may reference itself, TOC
+ relocs are also examined. TOC words marked as both needed and
+ unneeded will of course be kept. TOC words without any referencing
+ reloc are assumed to be part of a multi-word entry, and are kept or
+ discarded as per the nearest marked preceding word. This works
+ reliably for compiler generated code, but may be incorrect if
+ assembly code is used to insert TOC entries. Use this option to
+ disable the optimization.
+
+`--no-multi-toc'
+ By default, PowerPC64 GCC generates code for a TOC model where TOC
+ entries are accessed with a 16-bit offset from r2. This limits the
+ total TOC size to 64K. PowerPC64 `ld' extends this limit by
+ grouping code sections such that each group uses less than 64K for
+ its TOC entries, then inserts r2 adjusting stubs between
+ inter-group calls. `ld' does not split apart input sections, so
+ cannot help if a single input file has a `.toc' section that
+ exceeds 64K, most likely from linking multiple files with `ld -r'.
+ Use this option to turn off this feature.
+
+
+File: ld.info, Node: SPU ELF, Next: TI COFF, Prev: PowerPC64 ELF64, Up: Machine Dependent
+
+4.11 `ld' and SPU ELF Support
+=============================
+
+`--plugin'
+ This option marks an executable as a PIC plugin module.
+
+`--no-overlays'
+ Normally, `ld' recognizes calls to functions within overlay
+ regions, and redirects such calls to an overlay manager via a stub.
+ `ld' also provides a built-in overlay manager. This option turns
+ off all this special overlay handling.
+
+`--emit-stub-syms'
+ This option causes `ld' to label overlay stubs with a local symbol
+ that encodes the stub type and destination.
+
+`--extra-overlay-stubs'
+ This option causes `ld' to add overlay call stubs on all function
+ calls out of overlay regions. Normally stubs are not added on
+ calls to non-overlay regions.
+
+`--local-store=lo:hi'
+ `ld' usually checks that a final executable for SPU fits in the
+ address range 0 to 256k. This option may be used to change the
+ range. Disable the check entirely with `--local-store=0:0'.
+
+`--stack-analysis'
+ SPU local store space is limited. Over-allocation of stack space
+ unnecessarily limits space available for code and data, while
+ under-allocation results in runtime failures. If given this
+ option, `ld' will provide an estimate of maximum stack usage.
+ `ld' does this by examining symbols in code sections to determine
+ the extents of functions, and looking at function prologues for
+ stack adjusting instructions. A call-graph is created by looking
+ for relocations on branch instructions. The graph is then searched
+ for the maximum stack usage path. Note that this analysis does not
+ find calls made via function pointers, and does not handle
+ recursion and other cycles in the call graph. Stack usage may be
+ under-estimated if your code makes such calls. Also, stack usage
+ for dynamic allocation, e.g. alloca, will not be detected. If a
+ link map is requested, detailed information about each function's
+ stack usage and calls will be given.
+
+`--emit-stack-syms'
+ This option, if given along with `--stack-analysis' will result in
+ `ld' emitting stack sizing symbols for each function. These take
+ the form `__stack_<function_name>' for global functions, and
+ `__stack_<number>_<function_name>' for static functions.
+ `<number>' is the section id in hex. The value of such symbols is
+ the stack requirement for the corresponding function. The symbol
+ size will be zero, type `STT_NOTYPE', binding `STB_LOCAL', and
+ section `SHN_ABS'.
+
+
+File: ld.info, Node: TI COFF, Next: WIN32, Prev: SPU ELF, Up: Machine Dependent
+
+4.12 `ld''s Support for Various TI COFF Versions
+================================================
+
+The `--format' switch allows selection of one of the various TI COFF
+versions. The latest of this writing is 2; versions 0 and 1 are also
+supported. The TI COFF versions also vary in header byte-order format;
+`ld' will read any version or byte order, but the output header format
+depends on the default specified by the specific target.
+
+
+File: ld.info, Node: WIN32, Next: Xtensa, Prev: TI COFF, Up: Machine Dependent
+
+4.13 `ld' and WIN32 (cygwin/mingw)
+==================================
+
+This section describes some of the win32 specific `ld' issues. See
+*Note Command Line Options: Options. for detailed description of the
+command line options mentioned here.
+
+_import libraries_
+ The standard Windows linker creates and uses so-called import
+ libraries, which contains information for linking to dll's. They
+ are regular static archives and are handled as any other static
+ archive. The cygwin and mingw ports of `ld' have specific support
+ for creating such libraries provided with the `--out-implib'
+ command line option.
+
+_exporting DLL symbols_
+ The cygwin/mingw `ld' has several ways to export symbols for dll's.
+
+ _using auto-export functionality_
+ By default `ld' exports symbols with the auto-export
+ functionality, which is controlled by the following command
+ line options:
+
+ * -export-all-symbols [This is the default]
+
+ * -exclude-symbols
+
+ * -exclude-libs
+
+ * -exclude-modules-for-implib
+
+ * -version-script
+
+ When auto-export is in operation, `ld' will export all the
+ non-local (global and common) symbols it finds in a DLL, with
+ the exception of a few symbols known to belong to the
+ system's runtime and libraries. As it will often not be
+ desirable to export all of a DLL's symbols, which may include
+ private functions that are not part of any public interface,
+ the command-line options listed above may be used to filter
+ symbols out from the list for exporting. The `--output-def'
+ option can be used in order to see the final list of exported
+ symbols with all exclusions taken into effect.
+
+ If `--export-all-symbols' is not given explicitly on the
+ command line, then the default auto-export behavior will be
+ _disabled_ if either of the following are true:
+
+ * A DEF file is used.
+
+ * Any symbol in any object file was marked with the
+ __declspec(dllexport) attribute.
+
+ _using a DEF file_
+ Another way of exporting symbols is using a DEF file. A DEF
+ file is an ASCII file containing definitions of symbols which
+ should be exported when a dll is created. Usually it is
+ named `<dll name>.def' and is added as any other object file
+ to the linker's command line. The file's name must end in
+ `.def' or `.DEF'.
+
+ gcc -o <output> <objectfiles> <dll name>.def
+
+ Using a DEF file turns off the normal auto-export behavior,
+ unless the `--export-all-symbols' option is also used.
+
+ Here is an example of a DEF file for a shared library called
+ `xyz.dll':
+
+ LIBRARY "xyz.dll" BASE=0x20000000
+
+ EXPORTS
+ foo
+ bar
+ _bar = bar
+ another_foo = abc.dll.afoo
+ var1 DATA
+
+ This example defines a DLL with a non-default base address
+ and five symbols in the export table. The third exported
+ symbol `_bar' is an alias for the second. The fourth symbol,
+ `another_foo' is resolved by "forwarding" to another module
+ and treating it as an alias for `afoo' exported from the DLL
+ `abc.dll'. The final symbol `var1' is declared to be a data
+ object.
+
+ The optional `LIBRARY <name>' command indicates the _internal_
+ name of the output DLL. If `<name>' does not include a suffix,
+ the default library suffix, `.DLL' is appended.
+
+ When the .DEF file is used to build an application, rather
+ than a library, the `NAME <name>' command should be used
+ instead of `LIBRARY'. If `<name>' does not include a suffix,
+ the default executable suffix, `.EXE' is appended.
+
+ With either `LIBRARY <name>' or `NAME <name>' the optional
+ specification `BASE = <number>' may be used to specify a
+ non-default base address for the image.
+
+ If neither `LIBRARY <name>' nor `NAME <name>' is specified,
+ or they specify an empty string, the internal name is the
+ same as the filename specified on the command line.
+
+ The complete specification of an export symbol is:
+
+ EXPORTS
+ ( ( ( <name1> [ = <name2> ] )
+ | ( <name1> = <module-name> . <external-name>))
+ [ @ <integer> ] [NONAME] [DATA] [CONSTANT] [PRIVATE] ) *
+
+ Declares `<name1>' as an exported symbol from the DLL, or
+ declares `<name1>' as an exported alias for `<name2>'; or
+ declares `<name1>' as a "forward" alias for the symbol
+ `<external-name>' in the DLL `<module-name>'. Optionally,
+ the symbol may be exported by the specified ordinal
+ `<integer>' alias.
+
+ The optional keywords that follow the declaration indicate:
+
+ `NONAME': Do not put the symbol name in the DLL's export
+ table. It will still be exported by its ordinal alias
+ (either the value specified by the .def specification or,
+ otherwise, the value assigned by the linker). The symbol
+ name, however, does remain visible in the import library (if
+ any), unless `PRIVATE' is also specified.
+
+ `DATA': The symbol is a variable or object, rather than a
+ function. The import lib will export only an indirect
+ reference to `foo' as the symbol `_imp__foo' (ie, `foo' must
+ be resolved as `*_imp__foo').
+
+ `CONSTANT': Like `DATA', but put the undecorated `foo' as
+ well as `_imp__foo' into the import library. Both refer to the
+ read-only import address table's pointer to the variable, not
+ to the variable itself. This can be dangerous. If the user
+ code fails to add the `dllimport' attribute and also fails to
+ explicitly add the extra indirection that the use of the
+ attribute enforces, the application will behave unexpectedly.
+
+ `PRIVATE': Put the symbol in the DLL's export table, but do
+ not put it into the static import library used to resolve
+ imports at link time. The symbol can still be imported using
+ the `LoadLibrary/GetProcAddress' API at runtime or by by
+ using the GNU ld extension of linking directly to the DLL
+ without an import library.
+
+ See ld/deffilep.y in the binutils sources for the full
+ specification of other DEF file statements
+
+ While linking a shared dll, `ld' is able to create a DEF file
+ with the `--output-def <file>' command line option.
+
+ _Using decorations_
+ Another way of marking symbols for export is to modify the
+ source code itself, so that when building the DLL each symbol
+ to be exported is declared as:
+
+ __declspec(dllexport) int a_variable
+ __declspec(dllexport) void a_function(int with_args)
+
+ All such symbols will be exported from the DLL. If, however,
+ any of the object files in the DLL contain symbols decorated
+ in this way, then the normal auto-export behavior is
+ disabled, unless the `--export-all-symbols' option is also
+ used.
+
+ Note that object files that wish to access these symbols must
+ _not_ decorate them with dllexport. Instead, they should use
+ dllimport, instead:
+
+ __declspec(dllimport) int a_variable
+ __declspec(dllimport) void a_function(int with_args)
+
+ This complicates the structure of library header files,
+ because when included by the library itself the header must
+ declare the variables and functions as dllexport, but when
+ included by client code the header must declare them as
+ dllimport. There are a number of idioms that are typically
+ used to do this; often client code can omit the __declspec()
+ declaration completely. See `--enable-auto-import' and
+ `automatic data imports' for more information.
+
+_automatic data imports_
+ The standard Windows dll format supports data imports from dlls
+ only by adding special decorations (dllimport/dllexport), which
+ let the compiler produce specific assembler instructions to deal
+ with this issue. This increases the effort necessary to port
+ existing Un*x code to these platforms, especially for large c++
+ libraries and applications. The auto-import feature, which was
+ initially provided by Paul Sokolovsky, allows one to omit the
+ decorations to achieve a behavior that conforms to that on
+ POSIX/Un*x platforms. This feature is enabled with the
+ `--enable-auto-import' command-line option, although it is enabled
+ by default on cygwin/mingw. The `--enable-auto-import' option
+ itself now serves mainly to suppress any warnings that are
+ ordinarily emitted when linked objects trigger the feature's use.
+
+ auto-import of variables does not always work flawlessly without
+ additional assistance. Sometimes, you will see this message
+
+ "variable '<var>' can't be auto-imported. Please read the
+ documentation for ld's `--enable-auto-import' for details."
+
+ The `--enable-auto-import' documentation explains why this error
+ occurs, and several methods that can be used to overcome this
+ difficulty. One of these methods is the _runtime pseudo-relocs_
+ feature, described below.
+
+ For complex variables imported from DLLs (such as structs or
+ classes), object files typically contain a base address for the
+ variable and an offset (_addend_) within the variable-to specify a
+ particular field or public member, for instance. Unfortunately,
+ the runtime loader used in win32 environments is incapable of
+ fixing these references at runtime without the additional
+ information supplied by dllimport/dllexport decorations. The
+ standard auto-import feature described above is unable to resolve
+ these references.
+
+ The `--enable-runtime-pseudo-relocs' switch allows these
+ references to be resolved without error, while leaving the task of
+ adjusting the references themselves (with their non-zero addends)
+ to specialized code provided by the runtime environment. Recent
+ versions of the cygwin and mingw environments and compilers
+ provide this runtime support; older versions do not. However, the
+ support is only necessary on the developer's platform; the
+ compiled result will run without error on an older system.
+
+ `--enable-runtime-pseudo-relocs' is not the default; it must be
+ explicitly enabled as needed.
+
+_direct linking to a dll_
+ The cygwin/mingw ports of `ld' support the direct linking,
+ including data symbols, to a dll without the usage of any import
+ libraries. This is much faster and uses much less memory than
+ does the traditional import library method, especially when
+ linking large libraries or applications. When `ld' creates an
+ import lib, each function or variable exported from the dll is
+ stored in its own bfd, even though a single bfd could contain many
+ exports. The overhead involved in storing, loading, and
+ processing so many bfd's is quite large, and explains the
+ tremendous time, memory, and storage needed to link against
+ particularly large or complex libraries when using import libs.
+
+ Linking directly to a dll uses no extra command-line switches
+ other than `-L' and `-l', because `ld' already searches for a
+ number of names to match each library. All that is needed from
+ the developer's perspective is an understanding of this search, in
+ order to force ld to select the dll instead of an import library.
+
+ For instance, when ld is called with the argument `-lxxx' it will
+ attempt to find, in the first directory of its search path,
+
+ libxxx.dll.a
+ xxx.dll.a
+ libxxx.a
+ xxx.lib
+ cygxxx.dll (*)
+ libxxx.dll
+ xxx.dll
+
+ before moving on to the next directory in the search path.
+
+ (*) Actually, this is not `cygxxx.dll' but in fact is
+ `<prefix>xxx.dll', where `<prefix>' is set by the `ld' option
+ `--dll-search-prefix=<prefix>'. In the case of cygwin, the
+ standard gcc spec file includes `--dll-search-prefix=cyg', so in
+ effect we actually search for `cygxxx.dll'.
+
+ Other win32-based unix environments, such as mingw or pw32, may
+ use other `<prefix>'es, although at present only cygwin makes use
+ of this feature. It was originally intended to help avoid name
+ conflicts among dll's built for the various win32/un*x
+ environments, so that (for example) two versions of a zlib dll
+ could coexist on the same machine.
+
+ The generic cygwin/mingw path layout uses a `bin' directory for
+ applications and dll's and a `lib' directory for the import
+ libraries (using cygwin nomenclature):
+
+ bin/
+ cygxxx.dll
+ lib/
+ libxxx.dll.a (in case of dll's)
+ libxxx.a (in case of static archive)
+
+ Linking directly to a dll without using the import library can be
+ done two ways:
+
+ 1. Use the dll directly by adding the `bin' path to the link line
+ gcc -Wl,-verbose -o a.exe -L../bin/ -lxxx
+
+ However, as the dll's often have version numbers appended to their
+ names (`cygncurses-5.dll') this will often fail, unless one
+ specifies `-L../bin -lncurses-5' to include the version. Import
+ libs are generally not versioned, and do not have this difficulty.
+
+ 2. Create a symbolic link from the dll to a file in the `lib'
+ directory according to the above mentioned search pattern. This
+ should be used to avoid unwanted changes in the tools needed for
+ making the app/dll.
+
+ ln -s bin/cygxxx.dll lib/[cyg|lib|]xxx.dll[.a]
+
+ Then you can link without any make environment changes.
+
+ gcc -Wl,-verbose -o a.exe -L../lib/ -lxxx
+
+ This technique also avoids the version number problems, because
+ the following is perfectly legal
+
+ bin/
+ cygxxx-5.dll
+ lib/
+ libxxx.dll.a -> ../bin/cygxxx-5.dll
+
+ Linking directly to a dll without using an import lib will work
+ even when auto-import features are exercised, and even when
+ `--enable-runtime-pseudo-relocs' is used.
+
+ Given the improvements in speed and memory usage, one might
+ justifiably wonder why import libraries are used at all. There
+ are three reasons:
+
+ 1. Until recently, the link-directly-to-dll functionality did _not_
+ work with auto-imported data.
+
+ 2. Sometimes it is necessary to include pure static objects within
+ the import library (which otherwise contains only bfd's for
+ indirection symbols that point to the exports of a dll). Again,
+ the import lib for the cygwin kernel makes use of this ability,
+ and it is not possible to do this without an import lib.
+
+ 3. Symbol aliases can only be resolved using an import lib. This
+ is critical when linking against OS-supplied dll's (eg, the win32
+ API) in which symbols are usually exported as undecorated aliases
+ of their stdcall-decorated assembly names.
+
+ So, import libs are not going away. But the ability to replace
+ true import libs with a simple symbolic link to (or a copy of) a
+ dll, in many cases, is a useful addition to the suite of tools
+ binutils makes available to the win32 developer. Given the
+ massive improvements in memory requirements during linking, storage
+ requirements, and linking speed, we expect that many developers
+ will soon begin to use this feature whenever possible.
+
+_symbol aliasing_
+
+ _adding additional names_
+ Sometimes, it is useful to export symbols with additional
+ names. A symbol `foo' will be exported as `foo', but it can
+ also be exported as `_foo' by using special directives in the
+ DEF file when creating the dll. This will affect also the
+ optional created import library. Consider the following DEF
+ file:
+
+ LIBRARY "xyz.dll" BASE=0x61000000
+
+ EXPORTS
+ foo
+ _foo = foo
+
+ The line `_foo = foo' maps the symbol `foo' to `_foo'.
+
+ Another method for creating a symbol alias is to create it in
+ the source code using the "weak" attribute:
+
+ void foo () { /* Do something. */; }
+ void _foo () __attribute__ ((weak, alias ("foo")));
+
+ See the gcc manual for more information about attributes and
+ weak symbols.
+
+ _renaming symbols_
+ Sometimes it is useful to rename exports. For instance, the
+ cygwin kernel does this regularly. A symbol `_foo' can be
+ exported as `foo' but not as `_foo' by using special
+ directives in the DEF file. (This will also affect the import
+ library, if it is created). In the following example:
+
+ LIBRARY "xyz.dll" BASE=0x61000000
+
+ EXPORTS
+ _foo = foo
+
+ The line `_foo = foo' maps the exported symbol `foo' to
+ `_foo'.
+
+ Note: using a DEF file disables the default auto-export behavior,
+ unless the `--export-all-symbols' command line option is used.
+ If, however, you are trying to rename symbols, then you should list
+ _all_ desired exports in the DEF file, including the symbols that
+ are not being renamed, and do _not_ use the `--export-all-symbols'
+ option. If you list only the renamed symbols in the DEF file, and
+ use `--export-all-symbols' to handle the other symbols, then the
+ both the new names _and_ the original names for the renamed
+ symbols will be exported. In effect, you'd be aliasing those
+ symbols, not renaming them, which is probably not what you wanted.
+
+_weak externals_
+ The Windows object format, PE, specifies a form of weak symbols
+ called weak externals. When a weak symbol is linked and the
+ symbol is not defined, the weak symbol becomes an alias for some
+ other symbol. There are three variants of weak externals:
+ * Definition is searched for in objects and libraries,
+ historically called lazy externals.
+
+ * Definition is searched for only in other objects, not in
+ libraries. This form is not presently implemented.
+
+ * No search; the symbol is an alias. This form is not presently
+ implemented.
+ As a GNU extension, weak symbols that do not specify an alternate
+ symbol are supported. If the symbol is undefined when linking,
+ the symbol uses a default value.
+
+_aligned common symbols_
+ As a GNU extension to the PE file format, it is possible to
+ specify the desired alignment for a common symbol. This
+ information is conveyed from the assembler or compiler to the
+ linker by means of GNU-specific commands carried in the object
+ file's `.drectve' section, which are recognized by `ld' and
+ respected when laying out the common symbols. Native tools will
+ be able to process object files employing this GNU extension, but
+ will fail to respect the alignment instructions, and may issue
+ noisy warnings about unknown linker directives.
+
+
+File: ld.info, Node: Xtensa, Prev: WIN32, Up: Machine Dependent
+
+4.14 `ld' and Xtensa Processors
+===============================
+
+The default `ld' behavior for Xtensa processors is to interpret
+`SECTIONS' commands so that lists of explicitly named sections in a
+specification with a wildcard file will be interleaved when necessary to
+keep literal pools within the range of PC-relative load offsets. For
+example, with the command:
+
+ SECTIONS
+ {
+ .text : {
+ *(.literal .text)
+ }
+ }
+
+`ld' may interleave some of the `.literal' and `.text' sections from
+different object files to ensure that the literal pools are within the
+range of PC-relative load offsets. A valid interleaving might place
+the `.literal' sections from an initial group of files followed by the
+`.text' sections of that group of files. Then, the `.literal' sections
+from the rest of the files and the `.text' sections from the rest of
+the files would follow.
+
+ Relaxation is enabled by default for the Xtensa version of `ld' and
+provides two important link-time optimizations. The first optimization
+is to combine identical literal values to reduce code size. A redundant
+literal will be removed and all the `L32R' instructions that use it
+will be changed to reference an identical literal, as long as the
+location of the replacement literal is within the offset range of all
+the `L32R' instructions. The second optimization is to remove
+unnecessary overhead from assembler-generated "longcall" sequences of
+`L32R'/`CALLXN' when the target functions are within range of direct
+`CALLN' instructions.
+
+ For each of these cases where an indirect call sequence can be
+optimized to a direct call, the linker will change the `CALLXN'
+instruction to a `CALLN' instruction, remove the `L32R' instruction,
+and remove the literal referenced by the `L32R' instruction if it is
+not used for anything else. Removing the `L32R' instruction always
+reduces code size but can potentially hurt performance by changing the
+alignment of subsequent branch targets. By default, the linker will
+always preserve alignments, either by switching some instructions
+between 24-bit encodings and the equivalent density instructions or by
+inserting a no-op in place of the `L32R' instruction that was removed.
+If code size is more important than performance, the `--size-opt'
+option can be used to prevent the linker from widening density
+instructions or inserting no-ops, except in a few cases where no-ops
+are required for correctness.
+
+ The following Xtensa-specific command-line options can be used to
+control the linker:
+
+`--no-relax'
+ Since the Xtensa version of `ld' enables the `--relax' option by
+ default, the `--no-relax' option is provided to disable relaxation.
+
+`--size-opt'
+ When optimizing indirect calls to direct calls, optimize for code
+ size more than performance. With this option, the linker will not
+ insert no-ops or widen density instructions to preserve branch
+ target alignment. There may still be some cases where no-ops are
+ required to preserve the correctness of the code.
+
+
+File: ld.info, Node: BFD, Next: Reporting Bugs, Prev: Machine Dependent, Up: Top
+
+5 BFD
+*****
+
+The linker accesses object and archive files using the BFD libraries.
+These libraries allow the linker to use the same routines to operate on
+object files whatever the object file format. A different object file
+format can be supported simply by creating a new BFD back end and adding
+it to the library. To conserve runtime memory, however, the linker and
+associated tools are usually configured to support only a subset of the
+object file formats available. You can use `objdump -i' (*note
+objdump: (binutils.info)objdump.) to list all the formats available for
+your configuration.
+
+ As with most implementations, BFD is a compromise between several
+conflicting requirements. The major factor influencing BFD design was
+efficiency: any time used converting between formats is time which
+would not have been spent had BFD not been involved. This is partly
+offset by abstraction payback; since BFD simplifies applications and
+back ends, more time and care may be spent optimizing algorithms for a
+greater speed.
+
+ One minor artifact of the BFD solution which you should bear in mind
+is the potential for information loss. There are two places where
+useful information can be lost using the BFD mechanism: during
+conversion and during output. *Note BFD information loss::.
+
+* Menu:
+
+* BFD outline:: How it works: an outline of BFD
+
+
+File: ld.info, Node: BFD outline, Up: BFD
+
+5.1 How It Works: An Outline of BFD
+===================================
+
+When an object file is opened, BFD subroutines automatically determine
+the format of the input object file. They then build a descriptor in
+memory with pointers to routines that will be used to access elements of
+the object file's data structures.
+
+ As different information from the object files is required, BFD
+reads from different sections of the file and processes them. For
+example, a very common operation for the linker is processing symbol
+tables. Each BFD back end provides a routine for converting between
+the object file's representation of symbols and an internal canonical
+format. When the linker asks for the symbol table of an object file, it
+calls through a memory pointer to the routine from the relevant BFD
+back end which reads and converts the table into a canonical form. The
+linker then operates upon the canonical form. When the link is finished
+and the linker writes the output file's symbol table, another BFD back
+end routine is called to take the newly created symbol table and
+convert it into the chosen output format.
+
+* Menu:
+
+* BFD information loss:: Information Loss
+* Canonical format:: The BFD canonical object-file format
+
+
+File: ld.info, Node: BFD information loss, Next: Canonical format, Up: BFD outline
+
+5.1.1 Information Loss
+----------------------
+
+_Information can be lost during output._ The output formats supported
+by BFD do not provide identical facilities, and information which can
+be described in one form has nowhere to go in another format. One
+example of this is alignment information in `b.out'. There is nowhere
+in an `a.out' format file to store alignment information on the
+contained data, so when a file is linked from `b.out' and an `a.out'
+image is produced, alignment information will not propagate to the
+output file. (The linker will still use the alignment information
+internally, so the link is performed correctly).
+
+ Another example is COFF section names. COFF files may contain an
+unlimited number of sections, each one with a textual section name. If
+the target of the link is a format which does not have many sections
+(e.g., `a.out') or has sections without names (e.g., the Oasys format),
+the link cannot be done simply. You can circumvent this problem by
+describing the desired input-to-output section mapping with the linker
+command language.
+
+ _Information can be lost during canonicalization._ The BFD internal
+canonical form of the external formats is not exhaustive; there are
+structures in input formats for which there is no direct representation
+internally. This means that the BFD back ends cannot maintain all
+possible data richness through the transformation between external to
+internal and back to external formats.
+
+ This limitation is only a problem when an application reads one
+format and writes another. Each BFD back end is responsible for
+maintaining as much data as possible, and the internal BFD canonical
+form has structures which are opaque to the BFD core, and exported only
+to the back ends. When a file is read in one format, the canonical form
+is generated for BFD and the application. At the same time, the back
+end saves away any information which may otherwise be lost. If the data
+is then written back in the same format, the back end routine will be
+able to use the canonical form provided by the BFD core as well as the
+information it prepared earlier. Since there is a great deal of
+commonality between back ends, there is no information lost when
+linking or copying big endian COFF to little endian COFF, or `a.out' to
+`b.out'. When a mixture of formats is linked, the information is only
+lost from the files whose format differs from the destination.
+
+
+File: ld.info, Node: Canonical format, Prev: BFD information loss, Up: BFD outline
+
+5.1.2 The BFD canonical object-file format
+------------------------------------------
+
+The greatest potential for loss of information occurs when there is the
+least overlap between the information provided by the source format,
+that stored by the canonical format, and that needed by the destination
+format. A brief description of the canonical form may help you
+understand which kinds of data you can count on preserving across
+conversions.
+
+_files_
+ Information stored on a per-file basis includes target machine
+ architecture, particular implementation format type, a demand
+ pageable bit, and a write protected bit. Information like Unix
+ magic numbers is not stored here--only the magic numbers' meaning,
+ so a `ZMAGIC' file would have both the demand pageable bit and the
+ write protected text bit set. The byte order of the target is
+ stored on a per-file basis, so that big- and little-endian object
+ files may be used with one another.
+
+_sections_
+ Each section in the input file contains the name of the section,
+ the section's original address in the object file, size and
+ alignment information, various flags, and pointers into other BFD
+ data structures.
+
+_symbols_
+ Each symbol contains a pointer to the information for the object
+ file which originally defined it, its name, its value, and various
+ flag bits. When a BFD back end reads in a symbol table, it
+ relocates all symbols to make them relative to the base of the
+ section where they were defined. Doing this ensures that each
+ symbol points to its containing section. Each symbol also has a
+ varying amount of hidden private data for the BFD back end. Since
+ the symbol points to the original file, the private data format
+ for that symbol is accessible. `ld' can operate on a collection
+ of symbols of wildly different formats without problems.
+
+ Normal global and simple local symbols are maintained on output,
+ so an output file (no matter its format) will retain symbols
+ pointing to functions and to global, static, and common variables.
+ Some symbol information is not worth retaining; in `a.out', type
+ information is stored in the symbol table as long symbol names.
+ This information would be useless to most COFF debuggers; the
+ linker has command line switches to allow users to throw it away.
+
+ There is one word of type information within the symbol, so if the
+ format supports symbol type information within symbols (for
+ example, COFF, IEEE, Oasys) and the type is simple enough to fit
+ within one word (nearly everything but aggregates), the
+ information will be preserved.
+
+_relocation level_
+ Each canonical BFD relocation record contains a pointer to the
+ symbol to relocate to, the offset of the data to relocate, the
+ section the data is in, and a pointer to a relocation type
+ descriptor. Relocation is performed by passing messages through
+ the relocation type descriptor and the symbol pointer. Therefore,
+ relocations can be performed on output data using a relocation
+ method that is only available in one of the input formats. For
+ instance, Oasys provides a byte relocation format. A relocation
+ record requesting this relocation type would point indirectly to a
+ routine to perform this, so the relocation may be performed on a
+ byte being written to a 68k COFF file, even though 68k COFF has no
+ such relocation type.
+
+_line numbers_
+ Object formats can contain, for debugging purposes, some form of
+ mapping between symbols, source line numbers, and addresses in the
+ output file. These addresses have to be relocated along with the
+ symbol information. Each symbol with an associated list of line
+ number records points to the first record of the list. The head
+ of a line number list consists of a pointer to the symbol, which
+ allows finding out the address of the function whose line number
+ is being described. The rest of the list is made up of pairs:
+ offsets into the section and line numbers. Any format which can
+ simply derive this information can pass it successfully between
+ formats (COFF, IEEE and Oasys).
+
+
+File: ld.info, Node: Reporting Bugs, Next: MRI, Prev: BFD, Up: Top
+
+6 Reporting Bugs
+****************
+
+Your bug reports play an essential role in making `ld' reliable.
+
+ Reporting a bug may help you by bringing a solution to your problem,
+or it may not. But in any case the principal function of a bug report
+is to help the entire community by making the next version of `ld' work
+better. Bug reports are your contribution to the maintenance of `ld'.
+
+ In order for a bug report to serve its purpose, you must include the
+information that enables us to fix the bug.
+
+* Menu:
+
+* Bug Criteria:: Have you found a bug?
+* Bug Reporting:: How to report bugs
+
+
+File: ld.info, Node: Bug Criteria, Next: Bug Reporting, Up: Reporting Bugs
+
+6.1 Have You Found a Bug?
+=========================
+
+If you are not sure whether you have found a bug, here are some
+guidelines:
+
+ * If the linker gets a fatal signal, for any input whatever, that is
+ a `ld' bug. Reliable linkers never crash.
+
+ * If `ld' produces an error message for valid input, that is a bug.
+
+ * If `ld' does not produce an error message for invalid input, that
+ may be a bug. In the general case, the linker can not verify that
+ object files are correct.
+
+ * If you are an experienced user of linkers, your suggestions for
+ improvement of `ld' are welcome in any case.
+
+
+File: ld.info, Node: Bug Reporting, Prev: Bug Criteria, Up: Reporting Bugs
+
+6.2 How to Report Bugs
+======================
+
+A number of companies and individuals offer support for GNU products.
+If you obtained `ld' from a support organization, we recommend you
+contact that organization first.
+
+ You can find contact information for many support companies and
+individuals in the file `etc/SERVICE' in the GNU Emacs distribution.
+
+ Otherwise, send bug reports for `ld' to
+`http://www.sourceware.org/bugzilla/'.
+
+ The fundamental principle of reporting bugs usefully is this:
+*report all the facts*. If you are not sure whether to state a fact or
+leave it out, state it!
+
+ Often people omit facts because they think they know what causes the
+problem and assume that some details do not matter. Thus, you might
+assume that the name of a symbol you use in an example does not matter.
+Well, probably it does not, but one cannot be sure. Perhaps the bug
+is a stray memory reference which happens to fetch from the location
+where that name is stored in memory; perhaps, if the name were
+different, the contents of that location would fool the linker into
+doing the right thing despite the bug. Play it safe and give a
+specific, complete example. That is the easiest thing for you to do,
+and the most helpful.
+
+ Keep in mind that the purpose of a bug report is to enable us to fix
+the bug if it is new to us. Therefore, always write your bug reports
+on the assumption that the bug has not been reported previously.
+
+ Sometimes people give a few sketchy facts and ask, "Does this ring a
+bell?" This cannot help us fix a bug, so it is basically useless. We
+respond by asking for enough details to enable us to investigate. You
+might as well expedite matters by sending them to begin with.
+
+ To enable us to fix the bug, you should include all these things:
+
+ * The version of `ld'. `ld' announces it if you start it with the
+ `--version' argument.
+
+ Without this, we will not know whether there is any point in
+ looking for the bug in the current version of `ld'.
+
+ * Any patches you may have applied to the `ld' source, including any
+ patches made to the `BFD' library.
+
+ * The type of machine you are using, and the operating system name
+ and version number.
+
+ * What compiler (and its version) was used to compile `ld'--e.g.
+ "`gcc-2.7'".
+
+ * The command arguments you gave the linker to link your example and
+ observe the bug. To guarantee you will not omit something
+ important, list them all. A copy of the Makefile (or the output
+ from make) is sufficient.
+
+ If we were to try to guess the arguments, we would probably guess
+ wrong and then we might not encounter the bug.
+
+ * A complete input file, or set of input files, that will reproduce
+ the bug. It is generally most helpful to send the actual object
+ files provided that they are reasonably small. Say no more than
+ 10K. For bigger files you can either make them available by FTP
+ or HTTP or else state that you are willing to send the object
+ file(s) to whomever requests them. (Note - your email will be
+ going to a mailing list, so we do not want to clog it up with
+ large attachments). But small attachments are best.
+
+ If the source files were assembled using `gas' or compiled using
+ `gcc', then it may be OK to send the source files rather than the
+ object files. In this case, be sure to say exactly what version of
+ `gas' or `gcc' was used to produce the object files. Also say how
+ `gas' or `gcc' were configured.
+
+ * A description of what behavior you observe that you believe is
+ incorrect. For example, "It gets a fatal signal."
+
+ Of course, if the bug is that `ld' gets a fatal signal, then we
+ will certainly notice it. But if the bug is incorrect output, we
+ might not notice unless it is glaringly wrong. You might as well
+ not give us a chance to make a mistake.
+
+ Even if the problem you experience is a fatal signal, you should
+ still say so explicitly. Suppose something strange is going on,
+ such as, your copy of `ld' is out of sync, or you have encountered
+ a bug in the C library on your system. (This has happened!) Your
+ copy might crash and ours would not. If you told us to expect a
+ crash, then when ours fails to crash, we would know that the bug
+ was not happening for us. If you had not told us to expect a
+ crash, then we would not be able to draw any conclusion from our
+ observations.
+
+ * If you wish to suggest changes to the `ld' source, send us context
+ diffs, as generated by `diff' with the `-u', `-c', or `-p' option.
+ Always send diffs from the old file to the new file. If you even
+ discuss something in the `ld' source, refer to it by context, not
+ by line number.
+
+ The line numbers in our development sources will not match those
+ in your sources. Your line numbers would convey no useful
+ information to us.
+
+ Here are some things that are not necessary:
+
+ * A description of the envelope of the bug.
+
+ Often people who encounter a bug spend a lot of time investigating
+ which changes to the input file will make the bug go away and which
+ changes will not affect it.
+
+ This is often time consuming and not very useful, because the way
+ we will find the bug is by running a single example under the
+ debugger with breakpoints, not by pure deduction from a series of
+ examples. We recommend that you save your time for something else.
+
+ Of course, if you can find a simpler example to report _instead_
+ of the original one, that is a convenience for us. Errors in the
+ output will be easier to spot, running under the debugger will take
+ less time, and so on.
+
+ However, simplification is not vital; if you do not want to do
+ this, report the bug anyway and send us the entire test case you
+ used.
+
+ * A patch for the bug.
+
+ A patch for the bug does help us if it is a good one. But do not
+ omit the necessary information, such as the test case, on the
+ assumption that a patch is all we need. We might see problems
+ with your patch and decide to fix the problem another way, or we
+ might not understand it at all.
+
+ Sometimes with a program as complicated as `ld' it is very hard to
+ construct an example that will make the program follow a certain
+ path through the code. If you do not send us the example, we will
+ not be able to construct one, so we will not be able to verify
+ that the bug is fixed.
+
+ And if we cannot understand what bug you are trying to fix, or why
+ your patch should be an improvement, we will not install it. A
+ test case will help us to understand.
+
+ * A guess about what the bug is or what it depends on.
+
+ Such guesses are usually wrong. Even we cannot guess right about
+ such things without first using the debugger to find the facts.
+
+
+File: ld.info, Node: MRI, Next: GNU Free Documentation License, Prev: Reporting Bugs, Up: Top
+
+Appendix A MRI Compatible Script Files
+**************************************
+
+To aid users making the transition to GNU `ld' from the MRI linker,
+`ld' can use MRI compatible linker scripts as an alternative to the
+more general-purpose linker scripting language described in *Note
+Scripts::. MRI compatible linker scripts have a much simpler command
+set than the scripting language otherwise used with `ld'. GNU `ld'
+supports the most commonly used MRI linker commands; these commands are
+described here.
+
+ In general, MRI scripts aren't of much use with the `a.out' object
+file format, since it only has three sections and MRI scripts lack some
+features to make use of them.
+
+ You can specify a file containing an MRI-compatible script using the
+`-c' command-line option.
+
+ Each command in an MRI-compatible script occupies its own line; each
+command line starts with the keyword that identifies the command (though
+blank lines are also allowed for punctuation). If a line of an
+MRI-compatible script begins with an unrecognized keyword, `ld' issues
+a warning message, but continues processing the script.
+
+ Lines beginning with `*' are comments.
+
+ You can write these commands using all upper-case letters, or all
+lower case; for example, `chip' is the same as `CHIP'. The following
+list shows only the upper-case form of each command.
+
+`ABSOLUTE SECNAME'
+`ABSOLUTE SECNAME, SECNAME, ... SECNAME'
+ Normally, `ld' includes in the output file all sections from all
+ the input files. However, in an MRI-compatible script, you can
+ use the `ABSOLUTE' command to restrict the sections that will be
+ present in your output program. If the `ABSOLUTE' command is used
+ at all in a script, then only the sections named explicitly in
+ `ABSOLUTE' commands will appear in the linker output. You can
+ still use other input sections (whatever you select on the command
+ line, or using `LOAD') to resolve addresses in the output file.
+
+`ALIAS OUT-SECNAME, IN-SECNAME'
+ Use this command to place the data from input section IN-SECNAME
+ in a section called OUT-SECNAME in the linker output file.
+
+ IN-SECNAME may be an integer.
+
+`ALIGN SECNAME = EXPRESSION'
+ Align the section called SECNAME to EXPRESSION. The EXPRESSION
+ should be a power of two.
+
+`BASE EXPRESSION'
+ Use the value of EXPRESSION as the lowest address (other than
+ absolute addresses) in the output file.
+
+`CHIP EXPRESSION'
+`CHIP EXPRESSION, EXPRESSION'
+ This command does nothing; it is accepted only for compatibility.
+
+`END'
+ This command does nothing whatever; it's only accepted for
+ compatibility.
+
+`FORMAT OUTPUT-FORMAT'
+ Similar to the `OUTPUT_FORMAT' command in the more general linker
+ language, but restricted to one of these output formats:
+
+ 1. S-records, if OUTPUT-FORMAT is `S'
+
+ 2. IEEE, if OUTPUT-FORMAT is `IEEE'
+
+ 3. COFF (the `coff-m68k' variant in BFD), if OUTPUT-FORMAT is
+ `COFF'
+
+`LIST ANYTHING...'
+ Print (to the standard output file) a link map, as produced by the
+ `ld' command-line option `-M'.
+
+ The keyword `LIST' may be followed by anything on the same line,
+ with no change in its effect.
+
+`LOAD FILENAME'
+`LOAD FILENAME, FILENAME, ... FILENAME'
+ Include one or more object file FILENAME in the link; this has the
+ same effect as specifying FILENAME directly on the `ld' command
+ line.
+
+`NAME OUTPUT-NAME'
+ OUTPUT-NAME is the name for the program produced by `ld'; the
+ MRI-compatible command `NAME' is equivalent to the command-line
+ option `-o' or the general script language command `OUTPUT'.
+
+`ORDER SECNAME, SECNAME, ... SECNAME'
+`ORDER SECNAME SECNAME SECNAME'
+ Normally, `ld' orders the sections in its output file in the order
+ in which they first appear in the input files. In an
+ MRI-compatible script, you can override this ordering with the
+ `ORDER' command. The sections you list with `ORDER' will appear
+ first in your output file, in the order specified.
+
+`PUBLIC NAME=EXPRESSION'
+`PUBLIC NAME,EXPRESSION'
+`PUBLIC NAME EXPRESSION'
+ Supply a value (EXPRESSION) for external symbol NAME used in the
+ linker input files.
+
+`SECT SECNAME, EXPRESSION'
+`SECT SECNAME=EXPRESSION'
+`SECT SECNAME EXPRESSION'
+ You can use any of these three forms of the `SECT' command to
+ specify the start address (EXPRESSION) for section SECNAME. If
+ you have more than one `SECT' statement for the same SECNAME, only
+ the _first_ sets the start address.
+
+
+File: ld.info, Node: GNU Free Documentation License, Next: LD Index, Prev: MRI, Up: Top
+
+Appendix B GNU Free Documentation License
+*****************************************
+
+ Version 1.1, March 2000
+
+ Copyright (C) 2000, 2003 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ 0. PREAMBLE
+
+ The purpose of this License is to make a manual, textbook, or other
+ written document "free" in the sense of freedom: to assure everyone
+ the effective freedom to copy and redistribute it, with or without
+ modifying it, either commercially or noncommercially. Secondarily,
+ this License preserves for the author and publisher a way to get
+ credit for their work, while not being considered responsible for
+ modifications made by others.
+
+ This License is a kind of "copyleft", which means that derivative
+ works of the document must themselves be free in the same sense.
+ It complements the GNU General Public License, which is a copyleft
+ license designed for free software.
+
+ We have designed this License in order to use it for manuals for
+ free software, because free software needs free documentation: a
+ free program should come with manuals providing the same freedoms
+ that the software does. But this License is not limited to
+ software manuals; it can be used for any textual work, regardless
+ of subject matter or whether it is published as a printed book.
+ We recommend this License principally for works whose purpose is
+ instruction or reference.
+
+
+ 1. APPLICABILITY AND DEFINITIONS
+
+ This License applies to any manual or other work that contains a
+ notice placed by the copyright holder saying it can be distributed
+ under the terms of this License. The "Document", below, refers to
+ any such manual or work. Any member of the public is a licensee,
+ and is addressed as "you."
+
+ A "Modified Version" of the Document means any work containing the
+ Document or a portion of it, either copied verbatim, or with
+ modifications and/or translated into another language.
+
+ A "Secondary Section" is a named appendix or a front-matter
+ section of the Document that deals exclusively with the
+ relationship of the publishers or authors of the Document to the
+ Document's overall subject (or to related matters) and contains
+ nothing that could fall directly within that overall subject.
+ (For example, if the Document is in part a textbook of
+ mathematics, a Secondary Section may not explain any mathematics.)
+ The relationship could be a matter of historical connection with
+ the subject or with related matters, or of legal, commercial,
+ philosophical, ethical or political position regarding them.
+
+ The "Invariant Sections" are certain Secondary Sections whose
+ titles are designated, as being those of Invariant Sections, in
+ the notice that says that the Document is released under this
+ License.
+
+ The "Cover Texts" are certain short passages of text that are
+ listed, as Front-Cover Texts or Back-Cover Texts, in the notice
+ that says that the Document is released under this License.
+
+ A "Transparent" copy of the Document means a machine-readable copy,
+ represented in a format whose specification is available to the
+ general public, whose contents can be viewed and edited directly
+ and straightforwardly with generic text editors or (for images
+ composed of pixels) generic paint programs or (for drawings) some
+ widely available drawing editor, and that is suitable for input to
+ text formatters or for automatic translation to a variety of
+ formats suitable for input to text formatters. A copy made in an
+ otherwise Transparent file format whose markup has been designed
+ to thwart or discourage subsequent modification by readers is not
+ Transparent. A copy that is not "Transparent" is called "Opaque."
+
+ Examples of suitable formats for Transparent copies include plain
+ ASCII without markup, Texinfo input format, LaTeX input format,
+ SGML or XML using a publicly available DTD, and
+ standard-conforming simple HTML designed for human modification.
+ Opaque formats include PostScript, PDF, proprietary formats that
+ can be read and edited only by proprietary word processors, SGML
+ or XML for which the DTD and/or processing tools are not generally
+ available, and the machine-generated HTML produced by some word
+ processors for output purposes only.
+
+ The "Title Page" means, for a printed book, the title page itself,
+ plus such following pages as are needed to hold, legibly, the
+ material this License requires to appear in the title page. For
+ works in formats which do not have any title page as such, "Title
+ Page" means the text near the most prominent appearance of the
+ work's title, preceding the beginning of the body of the text.
+
+ 2. VERBATIM COPYING
+
+ You may copy and distribute the Document in any medium, either
+ commercially or noncommercially, provided that this License, the
+ copyright notices, and the license notice saying this License
+ applies to the Document are reproduced in all copies, and that you
+ add no other conditions whatsoever to those of this License. You
+ may not use technical measures to obstruct or control the reading
+ or further copying of the copies you make or distribute. However,
+ you may accept compensation in exchange for copies. If you
+ distribute a large enough number of copies you must also follow
+ the conditions in section 3.
+
+ You may also lend copies, under the same conditions stated above,
+ and you may publicly display copies.
+
+ 3. COPYING IN QUANTITY
+
+ If you publish printed copies of the Document numbering more than
+ 100, and the Document's license notice requires Cover Texts, you
+ must enclose the copies in covers that carry, clearly and legibly,
+ all these Cover Texts: Front-Cover Texts on the front cover, and
+ Back-Cover Texts on the back cover. Both covers must also clearly
+ and legibly identify you as the publisher of these copies. The
+ front cover must present the full title with all words of the
+ title equally prominent and visible. You may add other material
+ on the covers in addition. Copying with changes limited to the
+ covers, as long as they preserve the title of the Document and
+ satisfy these conditions, can be treated as verbatim copying in
+ other respects.
+
+ If the required texts for either cover are too voluminous to fit
+ legibly, you should put the first ones listed (as many as fit
+ reasonably) on the actual cover, and continue the rest onto
+ adjacent pages.
+
+ If you publish or distribute Opaque copies of the Document
+ numbering more than 100, you must either include a
+ machine-readable Transparent copy along with each Opaque copy, or
+ state in or with each Opaque copy a publicly-accessible
+ computer-network location containing a complete Transparent copy
+ of the Document, free of added material, which the general
+ network-using public has access to download anonymously at no
+ charge using public-standard network protocols. If you use the
+ latter option, you must take reasonably prudent steps, when you
+ begin distribution of Opaque copies in quantity, to ensure that
+ this Transparent copy will remain thus accessible at the stated
+ location until at least one year after the last time you
+ distribute an Opaque copy (directly or through your agents or
+ retailers) of that edition to the public.
+
+ It is requested, but not required, that you contact the authors of
+ the Document well before redistributing any large number of
+ copies, to give them a chance to provide you with an updated
+ version of the Document.
+
+ 4. MODIFICATIONS
+
+ You may copy and distribute a Modified Version of the Document
+ under the conditions of sections 2 and 3 above, provided that you
+ release the Modified Version under precisely this License, with
+ the Modified Version filling the role of the Document, thus
+ licensing distribution and modification of the Modified Version to
+ whoever possesses a copy of it. In addition, you must do these
+ things in the Modified Version:
+
+ A. Use in the Title Page (and on the covers, if any) a title
+ distinct from that of the Document, and from those of previous
+ versions (which should, if there were any, be listed in the
+ History section of the Document). You may use the same title
+ as a previous version if the original publisher of that version
+ gives permission.
+ B. List on the Title Page, as authors, one or more persons or
+ entities responsible for authorship of the modifications in the
+ Modified Version, together with at least five of the principal
+ authors of the Document (all of its principal authors, if it
+ has less than five).
+ C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+ D. Preserve all the copyright notices of the Document.
+ E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+ F. Include, immediately after the copyright notices, a license
+ notice giving the public permission to use the Modified Version
+ under the terms of this License, in the form shown in the
+ Addendum below.
+ G. Preserve in that license notice the full lists of Invariant
+ Sections and required Cover Texts given in the Document's
+ license notice.
+ H. Include an unaltered copy of this License.
+ I. Preserve the section entitled "History", and its title, and add
+ to it an item stating at least the title, year, new authors, and
+ publisher of the Modified Version as given on the Title Page.
+ If there is no section entitled "History" in the Document,
+ create one stating the title, year, authors, and publisher of
+ the Document as given on its Title Page, then add an item
+ describing the Modified Version as stated in the previous
+ sentence.
+ J. Preserve the network location, if any, given in the Document for
+ public access to a Transparent copy of the Document, and
+ likewise the network locations given in the Document for
+ previous versions it was based on. These may be placed in the
+ "History" section. You may omit a network location for a work
+ that was published at least four years before the Document
+ itself, or if the original publisher of the version it refers
+ to gives permission.
+ K. In any section entitled "Acknowledgements" or "Dedications",
+ preserve the section's title, and preserve in the section all the
+ substance and tone of each of the contributor acknowledgements
+ and/or dedications given therein.
+ L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section titles.
+ M. Delete any section entitled "Endorsements." Such a section
+ may not be included in the Modified Version.
+ N. Do not retitle any existing section as "Endorsements" or to
+ conflict in title with any Invariant Section.
+
+ If the Modified Version includes new front-matter sections or
+ appendices that qualify as Secondary Sections and contain no
+ material copied from the Document, you may at your option
+ designate some or all of these sections as invariant. To do this,
+ add their titles to the list of Invariant Sections in the Modified
+ Version's license notice. These titles must be distinct from any
+ other section titles.
+
+ You may add a section entitled "Endorsements", provided it contains
+ nothing but endorsements of your Modified Version by various
+ parties-for example, statements of peer review or that the text has
+ been approved by an organization as the authoritative definition
+ of a standard.
+
+ You may add a passage of up to five words as a Front-Cover Text,
+ and a passage of up to 25 words as a Back-Cover Text, to the end
+ of the list of Cover Texts in the Modified Version. Only one
+ passage of Front-Cover Text and one of Back-Cover Text may be
+ added by (or through arrangements made by) any one entity. If the
+ Document already includes a cover text for the same cover,
+ previously added by you or by arrangement made by the same entity
+ you are acting on behalf of, you may not add another; but you may
+ replace the old one, on explicit permission from the previous
+ publisher that added the old one.
+
+ The author(s) and publisher(s) of the Document do not by this
+ License give permission to use their names for publicity for or to
+ assert or imply endorsement of any Modified Version.
+
+ 5. COMBINING DOCUMENTS
+
+ You may combine the Document with other documents released under
+ this License, under the terms defined in section 4 above for
+ modified versions, provided that you include in the combination
+ all of the Invariant Sections of all of the original documents,
+ unmodified, and list them all as Invariant Sections of your
+ combined work in its license notice.
+
+ The combined work need only contain one copy of this License, and
+ multiple identical Invariant Sections may be replaced with a single
+ copy. If there are multiple Invariant Sections with the same name
+ but different contents, make the title of each such section unique
+ by adding at the end of it, in parentheses, the name of the
+ original author or publisher of that section if known, or else a
+ unique number. Make the same adjustment to the section titles in
+ the list of Invariant Sections in the license notice of the
+ combined work.
+
+ In the combination, you must combine any sections entitled
+ "History" in the various original documents, forming one section
+ entitled "History"; likewise combine any sections entitled
+ "Acknowledgements", and any sections entitled "Dedications." You
+ must delete all sections entitled "Endorsements."
+
+ 6. COLLECTIONS OF DOCUMENTS
+
+ You may make a collection consisting of the Document and other
+ documents released under this License, and replace the individual
+ copies of this License in the various documents with a single copy
+ that is included in the collection, provided that you follow the
+ rules of this License for verbatim copying of each of the
+ documents in all other respects.
+
+ You may extract a single document from such a collection, and
+ distribute it individually under this License, provided you insert
+ a copy of this License into the extracted document, and follow
+ this License in all other respects regarding verbatim copying of
+ that document.
+
+ 7. AGGREGATION WITH INDEPENDENT WORKS
+
+ A compilation of the Document or its derivatives with other
+ separate and independent documents or works, in or on a volume of
+ a storage or distribution medium, does not as a whole count as a
+ Modified Version of the Document, provided no compilation
+ copyright is claimed for the compilation. Such a compilation is
+ called an "aggregate", and this License does not apply to the
+ other self-contained works thus compiled with the Document, on
+ account of their being thus compiled, if they are not themselves
+ derivative works of the Document.
+
+ If the Cover Text requirement of section 3 is applicable to these
+ copies of the Document, then if the Document is less than one
+ quarter of the entire aggregate, the Document's Cover Texts may be
+ placed on covers that surround only the Document within the
+ aggregate. Otherwise they must appear on covers around the whole
+ aggregate.
+
+ 8. TRANSLATION
+
+ Translation is considered a kind of modification, so you may
+ distribute translations of the Document under the terms of section
+ 4. Replacing Invariant Sections with translations requires special
+ permission from their copyright holders, but you may include
+ translations of some or all Invariant Sections in addition to the
+ original versions of these Invariant Sections. You may include a
+ translation of this License provided that you also include the
+ original English version of this License. In case of a
+ disagreement between the translation and the original English
+ version of this License, the original English version will prevail.
+
+ 9. TERMINATION
+
+ You may not copy, modify, sublicense, or distribute the Document
+ except as expressly provided for under this License. Any other
+ attempt to copy, modify, sublicense or distribute the Document is
+ void, and will automatically terminate your rights under this
+ License. However, parties who have received copies, or rights,
+ from you under this License will not have their licenses
+ terminated so long as such parties remain in full compliance.
+
+ 10. FUTURE REVISIONS OF THIS LICENSE
+
+ The Free Software Foundation may publish new, revised versions of
+ the GNU Free Documentation License from time to time. Such new
+ versions will be similar in spirit to the present version, but may
+ differ in detail to address new problems or concerns. See
+ http://www.gnu.org/copyleft/.
+
+ Each version of the License is given a distinguishing version
+ number. If the Document specifies that a particular numbered
+ version of this License "or any later version" applies to it, you
+ have the option of following the terms and conditions either of
+ that specified version or of any later version that has been
+ published (not as a draft) by the Free Software Foundation. If
+ the Document does not specify a version number of this License,
+ you may choose any version ever published (not as a draft) by the
+ Free Software Foundation.
+
+
+ADDENDUM: How to use this License for your documents
+====================================================
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and license
+notices just after the title page:
+
+ Copyright (C) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.1
+ or any later version published by the Free Software Foundation;
+ with the Invariant Sections being LIST THEIR TITLES, with the
+ Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+ A copy of the license is included in the section entitled "GNU
+ Free Documentation License."
+
+ If you have no Invariant Sections, write "with no Invariant Sections"
+instead of saying which ones are invariant. If you have no Front-Cover
+Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being
+LIST"; likewise for Back-Cover Texts.
+
+ If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License, to
+permit their use in free software.
+
+
+File: ld.info, Node: LD Index, Prev: GNU Free Documentation License, Up: Top
+
+LD Index
+********
+
+
+* Menu:
+
+* ": Symbols. (line 6)
+* -(: Options. (line 675)
+* --accept-unknown-input-arch: Options. (line 693)
+* --add-needed: Options. (line 717)
+* --add-stdcall-alias: Options. (line 1527)
+* --allow-multiple-definition: Options. (line 945)
+* --allow-shlib-undefined: Options. (line 951)
+* --architecture=ARCH: Options. (line 113)
+* --as-needed: Options. (line 703)
+* --auxiliary=NAME: Options. (line 235)
+* --bank-window: Options. (line 1926)
+* --base-file: Options. (line 1532)
+* --be8: ARM. (line 28)
+* --bss-plt: PowerPC ELF32. (line 16)
+* --build-id: Options. (line 1489)
+* --build-id=STYLE: Options. (line 1489)
+* --check-sections: Options. (line 799)
+* --cref: Options. (line 811)
+* --default-imported-symver: Options. (line 988)
+* --default-script=SCRIPT: Options. (line 520)
+* --default-symver: Options. (line 984)
+* --defsym=SYMBOL=EXP: Options. (line 839)
+* --demangle[=STYLE]: Options. (line 852)
+* --disable-auto-image-base: Options. (line 1701)
+* --disable-auto-import: Options. (line 1836)
+* --disable-long-section-names: Options. (line 1542)
+* --disable-new-dtags: Options. (line 1452)
+* --disable-runtime-pseudo-reloc: Options. (line 1849)
+* --disable-stdcall-fixup: Options. (line 1564)
+* --discard-all: Options. (line 566)
+* --discard-locals: Options. (line 570)
+* --dll: Options. (line 1537)
+* --dll-search-prefix: Options. (line 1707)
+* --dotsyms: PowerPC64 ELF64. (line 33)
+* --dynamic-linker=FILE: Options. (line 865)
+* --dynamic-list-cpp-new: Options. (line 791)
+* --dynamic-list-cpp-typeinfo: Options. (line 795)
+* --dynamic-list-data: Options. (line 788)
+* --dynamic-list=DYNAMIC-LIST-FILE: Options. (line 775)
+* --dynamicbase: Options. (line 1885)
+* --eh-frame-hdr: Options. (line 1448)
+* --emit-relocs: Options. (line 455)
+* --emit-stack-syms: SPU ELF. (line 46)
+* --emit-stub-syms <1>: PowerPC ELF32. (line 47)
+* --emit-stub-syms <2>: SPU ELF. (line 15)
+* --emit-stub-syms: PowerPC64 ELF64. (line 29)
+* --enable-auto-image-base: Options. (line 1693)
+* --enable-auto-import: Options. (line 1716)
+* --enable-extra-pe-debug: Options. (line 1854)
+* --enable-long-section-names: Options. (line 1542)
+* --enable-new-dtags: Options. (line 1452)
+* --enable-runtime-pseudo-reloc: Options. (line 1841)
+* --enable-stdcall-fixup: Options. (line 1564)
+* --entry=ENTRY: Options. (line 167)
+* --error-unresolved-symbols: Options. (line 1401)
+* --exclude-libs: Options. (line 177)
+* --exclude-modules-for-implib: Options. (line 188)
+* --exclude-symbols: Options. (line 1606)
+* --export-all-symbols: Options. (line 1582)
+* --export-dynamic: Options. (line 201)
+* --extra-overlay-stubs: SPU ELF. (line 19)
+* --fatal-warnings: Options. (line 872)
+* --file-alignment: Options. (line 1612)
+* --filter=NAME: Options. (line 256)
+* --fix-cortex-a8: i960. (line 39)
+* --fix-v4bx: ARM. (line 49)
+* --fix-v4bx-interworking: ARM. (line 62)
+* --force-dynamic: Options. (line 464)
+* --force-exe-suffix: Options. (line 877)
+* --forceinteg: Options. (line 1890)
+* --format=FORMAT: Options. (line 124)
+* --format=VERSION: TI COFF. (line 6)
+* --gc-sections: Options. (line 887)
+* --got: Options. (line 1939)
+* --got=TYPE: M68K. (line 6)
+* --gpsize=VALUE: Options. (line 289)
+* --hash-size=NUMBER: Options. (line 1461)
+* --hash-style=STYLE: Options. (line 1469)
+* --heap: Options. (line 1618)
+* --help: Options. (line 918)
+* --image-base: Options. (line 1625)
+* --just-symbols=FILE: Options. (line 487)
+* --kill-at: Options. (line 1634)
+* --large-address-aware: Options. (line 1639)
+* --library-path=DIR: Options. (line 348)
+* --library=NAMESPEC: Options. (line 315)
+* --local-store=lo:hi: SPU ELF. (line 24)
+* --major-image-version: Options. (line 1648)
+* --major-os-version: Options. (line 1653)
+* --major-subsystem-version: Options. (line 1657)
+* --minor-image-version: Options. (line 1662)
+* --minor-os-version: Options. (line 1667)
+* --minor-subsystem-version: Options. (line 1671)
+* --mri-script=MRI-CMDFILE: Options. (line 148)
+* --multi-subspace: HPPA ELF32. (line 6)
+* --nmagic: Options. (line 419)
+* --no-accept-unknown-input-arch: Options. (line 693)
+* --no-add-needed: Options. (line 717)
+* --no-allow-shlib-undefined: Options. (line 951)
+* --no-as-needed: Options. (line 703)
+* --no-bind: Options. (line 1904)
+* --no-check-sections: Options. (line 799)
+* --no-define-common: Options. (line 823)
+* --no-demangle: Options. (line 852)
+* --no-dotsyms: PowerPC64 ELF64. (line 33)
+* --no-enum-size-warning: ARM. (line 111)
+* --no-export-dynamic: Options. (line 201)
+* --no-fatal-warnings: Options. (line 872)
+* --no-fix-cortex-a8: i960. (line 39)
+* --no-gc-sections: Options. (line 887)
+* --no-isolation: Options. (line 1897)
+* --no-keep-memory: Options. (line 930)
+* --no-multi-toc: PowerPC64 ELF64. (line 74)
+* --no-omagic: Options. (line 433)
+* --no-opd-optimize: PowerPC64 ELF64. (line 48)
+* --no-overlays: SPU ELF. (line 9)
+* --no-print-gc-sections: Options. (line 909)
+* --no-relax: Xtensa. (line 56)
+* --no-seh: Options. (line 1900)
+* --no-tls-optimize <1>: PowerPC ELF32. (line 51)
+* --no-tls-optimize: PowerPC64 ELF64. (line 43)
+* --no-toc-optimize: PowerPC64 ELF64. (line 60)
+* --no-trampoline: Options. (line 1920)
+* --no-undefined: Options. (line 937)
+* --no-undefined-version: Options. (line 979)
+* --no-warn-mismatch: Options. (line 992)
+* --no-warn-search-mismatch: Options. (line 1001)
+* --no-wchar-size-warning: ARM. (line 118)
+* --no-whole-archive: Options. (line 1005)
+* --noinhibit-exec: Options. (line 1009)
+* --non-overlapping-opd: PowerPC64 ELF64. (line 54)
+* --nxcompat: Options. (line 1893)
+* --oformat=OUTPUT-FORMAT: Options. (line 1021)
+* --omagic: Options. (line 424)
+* --out-implib: Options. (line 1684)
+* --output-def: Options. (line 1676)
+* --output=OUTPUT: Options. (line 439)
+* --pic-executable: Options. (line 1034)
+* --pic-veneer: ARM. (line 124)
+* --plugin: SPU ELF. (line 6)
+* --print-gc-sections: Options. (line 909)
+* --print-map: Options. (line 382)
+* --reduce-memory-overheads: Options. (line 1475)
+* --relax: Options. (line 1050)
+* --relax on i960: i960. (line 31)
+* --relax on PowerPC: PowerPC ELF32. (line 6)
+* --relax on Xtensa: Xtensa. (line 27)
+* --relocatable: Options. (line 468)
+* --retain-symbols-file=FILENAME: Options. (line 1071)
+* --script=SCRIPT: Options. (line 511)
+* --sdata-got: PowerPC ELF32. (line 33)
+* --section-alignment: Options. (line 1859)
+* --section-start=SECTIONNAME=ORG: Options. (line 1227)
+* --secure-plt: PowerPC ELF32. (line 26)
+* --sort-common: Options. (line 1169)
+* --sort-section=alignment: Options. (line 1184)
+* --sort-section=name: Options. (line 1180)
+* --split-by-file: Options. (line 1188)
+* --split-by-reloc: Options. (line 1193)
+* --stack: Options. (line 1865)
+* --stack-analysis: SPU ELF. (line 29)
+* --stats: Options. (line 1206)
+* --strip-all: Options. (line 498)
+* --strip-debug: Options. (line 502)
+* --stub-group-size: PowerPC64 ELF64. (line 6)
+* --stub-group-size=N <1>: ARM. (line 129)
+* --stub-group-size=N: HPPA ELF32. (line 12)
+* --subsystem: Options. (line 1872)
+* --support-old-code: ARM. (line 6)
+* --sysroot=DIRECTORY: Options. (line 1210)
+* --target-help: Options. (line 922)
+* --target1-abs: ARM. (line 32)
+* --target1-rel: ARM. (line 32)
+* --target2=TYPE: ARM. (line 37)
+* --thumb-entry=ENTRY: ARM. (line 17)
+* --trace: Options. (line 507)
+* --trace-symbol=SYMBOL: Options. (line 576)
+* --traditional-format: Options. (line 1215)
+* --tsaware: Options. (line 1910)
+* --undefined=SYMBOL: Options. (line 533)
+* --unique[=SECTION]: Options. (line 551)
+* --unresolved-symbols: Options. (line 1246)
+* --use-blx: ARM. (line 74)
+* --use-nul-prefixed-import-tables: ARM. (line 23)
+* --verbose: Options. (line 1275)
+* --version: Options. (line 560)
+* --version-script=VERSION-SCRIPTFILE: Options. (line 1281)
+* --vfp11-denorm-fix: ARM. (line 83)
+* --warn-alternate-em: Options. (line 1393)
+* --warn-common: Options. (line 1292)
+* --warn-constructors: Options. (line 1360)
+* --warn-multiple-gp: Options. (line 1365)
+* --warn-once: Options. (line 1379)
+* --warn-section-align: Options. (line 1383)
+* --warn-shared-textrel: Options. (line 1390)
+* --warn-unresolved-symbols: Options. (line 1396)
+* --wdmdriver: Options. (line 1907)
+* --whole-archive: Options. (line 1405)
+* --wrap=SYMBOL: Options. (line 1419)
+* -A ARCH: Options. (line 112)
+* -a KEYWORD: Options. (line 105)
+* -assert KEYWORD: Options. (line 727)
+* -b FORMAT: Options. (line 124)
+* -Bdynamic: Options. (line 730)
+* -Bgroup: Options. (line 740)
+* -Bshareable: Options. (line 1162)
+* -Bstatic: Options. (line 747)
+* -Bsymbolic: Options. (line 762)
+* -Bsymbolic-functions: Options. (line 769)
+* -c MRI-CMDFILE: Options. (line 148)
+* -call_shared: Options. (line 730)
+* -d: Options. (line 158)
+* -dc: Options. (line 158)
+* -dn: Options. (line 747)
+* -dp: Options. (line 158)
+* -dT SCRIPT: Options. (line 520)
+* -dy: Options. (line 730)
+* -E: Options. (line 201)
+* -e ENTRY: Options. (line 167)
+* -EB: Options. (line 228)
+* -EL: Options. (line 231)
+* -F NAME: Options. (line 256)
+* -f NAME: Options. (line 235)
+* -fini=NAME: Options. (line 280)
+* -g: Options. (line 286)
+* -G VALUE: Options. (line 289)
+* -h NAME: Options. (line 297)
+* -i: Options. (line 306)
+* -IFILE: Options. (line 865)
+* -init=NAME: Options. (line 309)
+* -L DIR: Options. (line 348)
+* -l NAMESPEC: Options. (line 315)
+* -M: Options. (line 382)
+* -m EMULATION: Options. (line 372)
+* -Map=MAPFILE: Options. (line 926)
+* -N: Options. (line 424)
+* -n: Options. (line 419)
+* -non_shared: Options. (line 747)
+* -nostdlib: Options. (line 1015)
+* -O LEVEL: Options. (line 445)
+* -o OUTPUT: Options. (line 439)
+* -pie: Options. (line 1034)
+* -q: Options. (line 455)
+* -qmagic: Options. (line 1044)
+* -Qy: Options. (line 1047)
+* -r: Options. (line 468)
+* -R FILE: Options. (line 487)
+* -rpath-link=DIR: Options. (line 1107)
+* -rpath=DIR: Options. (line 1085)
+* -s: Options. (line 498)
+* -S: Options. (line 502)
+* -shared: Options. (line 1162)
+* -soname=NAME: Options. (line 297)
+* -static: Options. (line 747)
+* -t: Options. (line 507)
+* -T SCRIPT: Options. (line 511)
+* -Tbss=ORG: Options. (line 1236)
+* -Tdata=ORG: Options. (line 1236)
+* -Ttext-segment=ORG: Options. (line 1242)
+* -Ttext=ORG: Options. (line 1236)
+* -u SYMBOL: Options. (line 533)
+* -Ur: Options. (line 541)
+* -V: Options. (line 560)
+* -v: Options. (line 560)
+* -X: Options. (line 570)
+* -x: Options. (line 566)
+* -Y PATH: Options. (line 585)
+* -y SYMBOL: Options. (line 576)
+* -z defs: Options. (line 937)
+* -z KEYWORD: Options. (line 589)
+* -z muldefs: Options. (line 945)
+* .: Location Counter. (line 6)
+* /DISCARD/: Output Section Discarding.
+ (line 21)
+* :PHDR: Output Section Phdr.
+ (line 6)
+* =FILLEXP: Output Section Fill.
+ (line 6)
+* >REGION: Output Section Region.
+ (line 6)
+* [COMMON]: Input Section Common.
+ (line 29)
+* ABSOLUTE (MRI): MRI. (line 33)
+* absolute and relocatable symbols: Expression Section. (line 6)
+* absolute expressions: Expression Section. (line 6)
+* ABSOLUTE(EXP): Builtin Functions. (line 10)
+* ADDR(SECTION): Builtin Functions. (line 17)
+* address, section: Output Section Address.
+ (line 6)
+* ALIAS (MRI): MRI. (line 44)
+* ALIGN (MRI): MRI. (line 50)
+* align expression: Builtin Functions. (line 36)
+* align location counter: Builtin Functions. (line 36)
+* ALIGN(ALIGN): Builtin Functions. (line 36)
+* ALIGN(EXP,ALIGN): Builtin Functions. (line 36)
+* ALIGN(SECTION_ALIGN): Forced Output Alignment.
+ (line 6)
+* aligned common symbols: WIN32. (line 418)
+* ALIGNOF(SECTION): Builtin Functions. (line 62)
+* allocating memory: MEMORY. (line 6)
+* architecture: Miscellaneous Commands.
+ (line 72)
+* architectures: Options. (line 112)
+* archive files, from cmd line: Options. (line 315)
+* archive search path in linker script: File Commands. (line 74)
+* arithmetic: Expressions. (line 6)
+* arithmetic operators: Operators. (line 6)
+* ARM interworking support: ARM. (line 6)
+* AS_NEEDED(FILES): File Commands. (line 54)
+* ASSERT: Miscellaneous Commands.
+ (line 9)
+* assertion in linker script: Miscellaneous Commands.
+ (line 9)
+* assignment in scripts: Assignments. (line 6)
+* AT(LMA): Output Section LMA. (line 6)
+* AT>LMA_REGION: Output Section LMA. (line 6)
+* automatic data imports: WIN32. (line 185)
+* back end: BFD. (line 6)
+* BASE (MRI): MRI. (line 54)
+* BE8: ARM. (line 28)
+* BFD canonical format: Canonical format. (line 11)
+* BFD requirements: BFD. (line 16)
+* big-endian objects: Options. (line 228)
+* binary input format: Options. (line 124)
+* BLOCK(EXP): Builtin Functions. (line 75)
+* bug criteria: Bug Criteria. (line 6)
+* bug reports: Bug Reporting. (line 6)
+* bugs in ld: Reporting Bugs. (line 6)
+* BYTE(EXPRESSION): Output Section Data.
+ (line 6)
+* C++ constructors, arranging in link: Output Section Keywords.
+ (line 19)
+* CHIP (MRI): MRI. (line 58)
+* COLLECT_NO_DEMANGLE: Environment. (line 29)
+* combining symbols, warnings on: Options. (line 1292)
+* command files: Scripts. (line 6)
+* command line: Options. (line 6)
+* common allocation: Options. (line 158)
+* common allocation in linker script: Miscellaneous Commands.
+ (line 20)
+* common symbol placement: Input Section Common.
+ (line 6)
+* COMMONPAGESIZE: Symbolic Constants. (line 13)
+* compatibility, MRI: Options. (line 148)
+* CONSTANT: Symbolic Constants. (line 6)
+* constants in linker scripts: Constants. (line 6)
+* constraints on output sections: Output Section Constraint.
+ (line 6)
+* CONSTRUCTORS: Output Section Keywords.
+ (line 19)
+* constructors: Options. (line 541)
+* constructors, arranging in link: Output Section Keywords.
+ (line 19)
+* Cortex-A8 erratum workaround: i960. (line 39)
+* crash of linker: Bug Criteria. (line 9)
+* CREATE_OBJECT_SYMBOLS: Output Section Keywords.
+ (line 9)
+* creating a DEF file: WIN32. (line 152)
+* cross reference table: Options. (line 811)
+* cross references: Miscellaneous Commands.
+ (line 56)
+* current output location: Location Counter. (line 6)
+* data: Output Section Data.
+ (line 6)
+* DATA_SEGMENT_ALIGN(MAXPAGESIZE, COMMONPAGESIZE): Builtin Functions.
+ (line 80)
+* DATA_SEGMENT_END(EXP): Builtin Functions. (line 101)
+* DATA_SEGMENT_RELRO_END(OFFSET, EXP): Builtin Functions. (line 107)
+* dbx: Options. (line 1220)
+* DEF files, creating: Options. (line 1676)
+* default emulation: Environment. (line 21)
+* default input format: Environment. (line 9)
+* DEFINED(SYMBOL): Builtin Functions. (line 118)
+* deleting local symbols: Options. (line 566)
+* demangling, default: Environment. (line 29)
+* demangling, from command line: Options. (line 852)
+* direct linking to a dll: WIN32. (line 233)
+* discarding sections: Output Section Discarding.
+ (line 6)
+* discontinuous memory: MEMORY. (line 6)
+* DLLs, creating: Options. (line 1676)
+* DLLs, linking to: Options. (line 1707)
+* dot: Location Counter. (line 6)
+* dot inside sections: Location Counter. (line 36)
+* dot outside sections: Location Counter. (line 66)
+* dynamic linker, from command line: Options. (line 865)
+* dynamic symbol table: Options. (line 201)
+* ELF program headers: PHDRS. (line 6)
+* emulation: Options. (line 372)
+* emulation, default: Environment. (line 21)
+* END (MRI): MRI. (line 62)
+* endianness: Options. (line 228)
+* entry point: Entry Point. (line 6)
+* entry point, from command line: Options. (line 167)
+* entry point, thumb: ARM. (line 17)
+* ENTRY(SYMBOL): Entry Point. (line 6)
+* error on valid input: Bug Criteria. (line 12)
+* example of linker script: Simple Example. (line 6)
+* exporting DLL symbols: WIN32. (line 19)
+* expression evaluation order: Evaluation. (line 6)
+* expression sections: Expression Section. (line 6)
+* expression, absolute: Builtin Functions. (line 10)
+* expressions: Expressions. (line 6)
+* EXTERN: Miscellaneous Commands.
+ (line 13)
+* fatal signal: Bug Criteria. (line 9)
+* file name wildcard patterns: Input Section Wildcards.
+ (line 6)
+* FILEHDR: PHDRS. (line 61)
+* filename symbols: Output Section Keywords.
+ (line 9)
+* fill pattern, entire section: Output Section Fill.
+ (line 6)
+* FILL(EXPRESSION): Output Section Data.
+ (line 39)
+* finalization function: Options. (line 280)
+* first input file: File Commands. (line 82)
+* first instruction: Entry Point. (line 6)
+* FIX_V4BX: ARM. (line 49)
+* FIX_V4BX_INTERWORKING: ARM. (line 62)
+* FORCE_COMMON_ALLOCATION: Miscellaneous Commands.
+ (line 20)
+* forcing input section alignment: Forced Input Alignment.
+ (line 6)
+* forcing output section alignment: Forced Output Alignment.
+ (line 6)
+* forcing the creation of dynamic sections: Options. (line 464)
+* FORMAT (MRI): MRI. (line 66)
+* functions in expressions: Builtin Functions. (line 6)
+* garbage collection <1>: Options. (line 909)
+* garbage collection <2>: Input Section Keep. (line 6)
+* garbage collection: Options. (line 887)
+* generating optimized output: Options. (line 445)
+* GNU linker: Overview. (line 6)
+* GNUTARGET: Environment. (line 9)
+* GROUP(FILES): File Commands. (line 47)
+* grouping input files: File Commands. (line 47)
+* groups of archives: Options. (line 675)
+* H8/300 support: H8/300. (line 6)
+* header size: Builtin Functions. (line 183)
+* heap size: Options. (line 1618)
+* help: Options. (line 918)
+* holes: Location Counter. (line 12)
+* holes, filling: Output Section Data.
+ (line 39)
+* HPPA multiple sub-space stubs: HPPA ELF32. (line 6)
+* HPPA stub grouping: HPPA ELF32. (line 12)
+* i960 support: i960. (line 6)
+* image base: Options. (line 1625)
+* implicit linker scripts: Implicit Linker Scripts.
+ (line 6)
+* import libraries: WIN32. (line 10)
+* INCLUDE FILENAME: File Commands. (line 9)
+* including a linker script: File Commands. (line 9)
+* including an entire archive: Options. (line 1405)
+* incremental link: Options. (line 306)
+* INHIBIT_COMMON_ALLOCATION: Miscellaneous Commands.
+ (line 25)
+* initialization function: Options. (line 309)
+* initialized data in ROM: Output Section LMA. (line 26)
+* input file format in linker script: Format Commands. (line 35)
+* input filename symbols: Output Section Keywords.
+ (line 9)
+* input files in linker scripts: File Commands. (line 19)
+* input files, displaying: Options. (line 507)
+* input format: Options. (line 124)
+* input object files in linker scripts: File Commands. (line 19)
+* input section alignment: Forced Input Alignment.
+ (line 6)
+* input section basics: Input Section Basics.
+ (line 6)
+* input section wildcards: Input Section Wildcards.
+ (line 6)
+* input sections: Input Section. (line 6)
+* INPUT(FILES): File Commands. (line 19)
+* INSERT: Miscellaneous Commands.
+ (line 30)
+* insert user script into default script: Miscellaneous Commands.
+ (line 30)
+* integer notation: Constants. (line 6)
+* integer suffixes: Constants. (line 15)
+* internal object-file format: Canonical format. (line 11)
+* invalid input: Bug Criteria. (line 14)
+* K and M integer suffixes: Constants. (line 15)
+* KEEP: Input Section Keep. (line 6)
+* l =: MEMORY. (line 74)
+* lazy evaluation: Evaluation. (line 6)
+* ld bugs, reporting: Bug Reporting. (line 6)
+* LDEMULATION: Environment. (line 21)
+* len =: MEMORY. (line 74)
+* LENGTH =: MEMORY. (line 74)
+* LENGTH(MEMORY): Builtin Functions. (line 135)
+* library search path in linker script: File Commands. (line 74)
+* link map: Options. (line 382)
+* link-time runtime library search path: Options. (line 1107)
+* linker crash: Bug Criteria. (line 9)
+* linker script concepts: Basic Script Concepts.
+ (line 6)
+* linker script example: Simple Example. (line 6)
+* linker script file commands: File Commands. (line 6)
+* linker script format: Script Format. (line 6)
+* linker script input object files: File Commands. (line 19)
+* linker script simple commands: Simple Commands. (line 6)
+* linker scripts: Scripts. (line 6)
+* LIST (MRI): MRI. (line 77)
+* little-endian objects: Options. (line 231)
+* LOAD (MRI): MRI. (line 84)
+* load address: Output Section LMA. (line 6)
+* LOADADDR(SECTION): Builtin Functions. (line 138)
+* loading, preventing: Output Section Type.
+ (line 22)
+* local symbols, deleting: Options. (line 570)
+* location counter: Location Counter. (line 6)
+* LONG(EXPRESSION): Output Section Data.
+ (line 6)
+* M and K integer suffixes: Constants. (line 15)
+* M68HC11 and 68HC12 support: M68HC11/68HC12. (line 6)
+* machine architecture: Miscellaneous Commands.
+ (line 72)
+* machine dependencies: Machine Dependent. (line 6)
+* mapping input sections to output sections: Input Section. (line 6)
+* MAX: Builtin Functions. (line 143)
+* MAXPAGESIZE: Symbolic Constants. (line 10)
+* MEMORY: MEMORY. (line 6)
+* memory region attributes: MEMORY. (line 34)
+* memory regions: MEMORY. (line 6)
+* memory regions and sections: Output Section Region.
+ (line 6)
+* memory usage: Options. (line 930)
+* MIN: Builtin Functions. (line 146)
+* Motorola 68K GOT generation: M68K. (line 6)
+* MRI compatibility: MRI. (line 6)
+* MSP430 extra sections: MSP430. (line 11)
+* NAME (MRI): MRI. (line 90)
+* name, section: Output Section Name.
+ (line 6)
+* names: Symbols. (line 6)
+* naming the output file: Options. (line 439)
+* NEXT(EXP): Builtin Functions. (line 150)
+* NMAGIC: Options. (line 419)
+* NO_ENUM_SIZE_WARNING: ARM. (line 111)
+* NO_WCHAR_SIZE_WARNING: ARM. (line 118)
+* NOCROSSREFS(SECTIONS): Miscellaneous Commands.
+ (line 56)
+* NOLOAD: Output Section Type.
+ (line 22)
+* not enough room for program headers: Builtin Functions. (line 188)
+* o =: MEMORY. (line 69)
+* objdump -i: BFD. (line 6)
+* object file management: BFD. (line 6)
+* object files: Options. (line 29)
+* object formats available: BFD. (line 6)
+* object size: Options. (line 289)
+* OMAGIC: Options. (line 424)
+* ONLY_IF_RO: Output Section Constraint.
+ (line 6)
+* ONLY_IF_RW: Output Section Constraint.
+ (line 6)
+* opening object files: BFD outline. (line 6)
+* operators for arithmetic: Operators. (line 6)
+* options: Options. (line 6)
+* ORDER (MRI): MRI. (line 95)
+* org =: MEMORY. (line 69)
+* ORIGIN =: MEMORY. (line 69)
+* ORIGIN(MEMORY): Builtin Functions. (line 156)
+* orphan: Orphan Sections. (line 6)
+* output file after errors: Options. (line 1009)
+* output file format in linker script: Format Commands. (line 10)
+* output file name in linker script: File Commands. (line 64)
+* output section alignment: Forced Output Alignment.
+ (line 6)
+* output section attributes: Output Section Attributes.
+ (line 6)
+* output section data: Output Section Data.
+ (line 6)
+* OUTPUT(FILENAME): File Commands. (line 64)
+* OUTPUT_ARCH(BFDARCH): Miscellaneous Commands.
+ (line 72)
+* OUTPUT_FORMAT(BFDNAME): Format Commands. (line 10)
+* OVERLAY: Overlay Description.
+ (line 6)
+* overlays: Overlay Description.
+ (line 6)
+* partial link: Options. (line 468)
+* PE import table prefixing: ARM. (line 23)
+* PHDRS: PHDRS. (line 61)
+* PIC_VENEER: ARM. (line 124)
+* position independent executables: Options. (line 1036)
+* PowerPC ELF32 options: PowerPC ELF32. (line 16)
+* PowerPC GOT: PowerPC ELF32. (line 33)
+* PowerPC long branches: PowerPC ELF32. (line 6)
+* PowerPC PLT: PowerPC ELF32. (line 16)
+* PowerPC stub symbols: PowerPC ELF32. (line 47)
+* PowerPC TLS optimization: PowerPC ELF32. (line 51)
+* PowerPC64 dot symbols: PowerPC64 ELF64. (line 33)
+* PowerPC64 ELF64 options: PowerPC64 ELF64. (line 6)
+* PowerPC64 multi-TOC: PowerPC64 ELF64. (line 74)
+* PowerPC64 OPD optimization: PowerPC64 ELF64. (line 48)
+* PowerPC64 OPD spacing: PowerPC64 ELF64. (line 54)
+* PowerPC64 stub grouping: PowerPC64 ELF64. (line 6)
+* PowerPC64 stub symbols: PowerPC64 ELF64. (line 29)
+* PowerPC64 TLS optimization: PowerPC64 ELF64. (line 43)
+* PowerPC64 TOC optimization: PowerPC64 ELF64. (line 60)
+* precedence in expressions: Operators. (line 6)
+* prevent unnecessary loading: Output Section Type.
+ (line 22)
+* program headers: PHDRS. (line 6)
+* program headers and sections: Output Section Phdr.
+ (line 6)
+* program headers, not enough room: Builtin Functions. (line 188)
+* program segments: PHDRS. (line 6)
+* PROVIDE: PROVIDE. (line 6)
+* PROVIDE_HIDDEN: PROVIDE_HIDDEN. (line 6)
+* PUBLIC (MRI): MRI. (line 103)
+* QUAD(EXPRESSION): Output Section Data.
+ (line 6)
+* quoted symbol names: Symbols. (line 6)
+* read-only text: Options. (line 419)
+* read/write from cmd line: Options. (line 424)
+* region alias: REGION_ALIAS. (line 6)
+* region names: REGION_ALIAS. (line 6)
+* REGION_ALIAS(ALIAS, REGION): REGION_ALIAS. (line 6)
+* regions of memory: MEMORY. (line 6)
+* relative expressions: Expression Section. (line 6)
+* relaxing addressing modes: Options. (line 1050)
+* relaxing on H8/300: H8/300. (line 9)
+* relaxing on i960: i960. (line 31)
+* relaxing on M68HC11: M68HC11/68HC12. (line 12)
+* relaxing on Xtensa: Xtensa. (line 27)
+* relocatable and absolute symbols: Expression Section. (line 6)
+* relocatable output: Options. (line 468)
+* removing sections: Output Section Discarding.
+ (line 6)
+* reporting bugs in ld: Reporting Bugs. (line 6)
+* requirements for BFD: BFD. (line 16)
+* retain relocations in final executable: Options. (line 455)
+* retaining specified symbols: Options. (line 1071)
+* ROM initialized data: Output Section LMA. (line 26)
+* round up expression: Builtin Functions. (line 36)
+* round up location counter: Builtin Functions. (line 36)
+* runtime library name: Options. (line 297)
+* runtime library search path: Options. (line 1085)
+* runtime pseudo-relocation: WIN32. (line 211)
+* scaled integers: Constants. (line 15)
+* scommon section: Input Section Common.
+ (line 20)
+* script files: Options. (line 520)
+* scripts: Scripts. (line 6)
+* search directory, from cmd line: Options. (line 348)
+* search path in linker script: File Commands. (line 74)
+* SEARCH_DIR(PATH): File Commands. (line 74)
+* SECT (MRI): MRI. (line 109)
+* section address: Output Section Address.
+ (line 6)
+* section address in expression: Builtin Functions. (line 17)
+* section alignment: Builtin Functions. (line 62)
+* section alignment, warnings on: Options. (line 1383)
+* section data: Output Section Data.
+ (line 6)
+* section fill pattern: Output Section Fill.
+ (line 6)
+* section load address: Output Section LMA. (line 6)
+* section load address in expression: Builtin Functions. (line 138)
+* section name: Output Section Name.
+ (line 6)
+* section name wildcard patterns: Input Section Wildcards.
+ (line 6)
+* section size: Builtin Functions. (line 167)
+* section, assigning to memory region: Output Section Region.
+ (line 6)
+* section, assigning to program header: Output Section Phdr.
+ (line 6)
+* SECTIONS: SECTIONS. (line 6)
+* sections, discarding: Output Section Discarding.
+ (line 6)
+* segment origins, cmd line: Options. (line 1236)
+* SEGMENT_START(SEGMENT, DEFAULT): Builtin Functions. (line 159)
+* segments, ELF: PHDRS. (line 6)
+* shared libraries: Options. (line 1164)
+* SHORT(EXPRESSION): Output Section Data.
+ (line 6)
+* SIZEOF(SECTION): Builtin Functions. (line 167)
+* SIZEOF_HEADERS: Builtin Functions. (line 183)
+* small common symbols: Input Section Common.
+ (line 20)
+* SORT: Input Section Wildcards.
+ (line 58)
+* SORT_BY_ALIGNMENT: Input Section Wildcards.
+ (line 54)
+* SORT_BY_NAME: Input Section Wildcards.
+ (line 46)
+* SPU: SPU ELF. (line 29)
+* SPU ELF options: SPU ELF. (line 6)
+* SPU extra overlay stubs: SPU ELF. (line 19)
+* SPU local store size: SPU ELF. (line 24)
+* SPU overlay stub symbols: SPU ELF. (line 15)
+* SPU overlays: SPU ELF. (line 9)
+* SPU plugins: SPU ELF. (line 6)
+* SQUAD(EXPRESSION): Output Section Data.
+ (line 6)
+* stack size: Options. (line 1865)
+* standard Unix system: Options. (line 7)
+* start of execution: Entry Point. (line 6)
+* STARTUP(FILENAME): File Commands. (line 82)
+* strip all symbols: Options. (line 498)
+* strip debugger symbols: Options. (line 502)
+* stripping all but some symbols: Options. (line 1071)
+* STUB_GROUP_SIZE: ARM. (line 129)
+* SUBALIGN(SUBSECTION_ALIGN): Forced Input Alignment.
+ (line 6)
+* suffixes for integers: Constants. (line 15)
+* symbol defaults: Builtin Functions. (line 118)
+* symbol definition, scripts: Assignments. (line 6)
+* symbol names: Symbols. (line 6)
+* symbol tracing: Options. (line 576)
+* symbol versions: VERSION. (line 6)
+* symbol-only input: Options. (line 487)
+* symbolic constants: Symbolic Constants. (line 6)
+* symbols, from command line: Options. (line 839)
+* symbols, relocatable and absolute: Expression Section. (line 6)
+* symbols, retaining selectively: Options. (line 1071)
+* synthesizing linker: Options. (line 1050)
+* synthesizing on H8/300: H8/300. (line 14)
+* TARGET(BFDNAME): Format Commands. (line 35)
+* TARGET1: ARM. (line 32)
+* TARGET2: ARM. (line 37)
+* text segment origin, cmd line: Options. (line 1243)
+* thumb entry point: ARM. (line 17)
+* TI COFF versions: TI COFF. (line 6)
+* traditional format: Options. (line 1215)
+* trampoline generation on M68HC11: M68HC11/68HC12. (line 31)
+* trampoline generation on M68HC12: M68HC11/68HC12. (line 31)
+* unallocated address, next: Builtin Functions. (line 150)
+* undefined symbol: Options. (line 533)
+* undefined symbol in linker script: Miscellaneous Commands.
+ (line 13)
+* undefined symbols, warnings on: Options. (line 1379)
+* uninitialized data placement: Input Section Common.
+ (line 6)
+* unspecified memory: Output Section Data.
+ (line 39)
+* usage: Options. (line 918)
+* USE_BLX: ARM. (line 74)
+* using a DEF file: WIN32. (line 57)
+* using auto-export functionality: WIN32. (line 22)
+* Using decorations: WIN32. (line 156)
+* variables, defining: Assignments. (line 6)
+* verbose: Options. (line 1275)
+* version: Options. (line 560)
+* version script: VERSION. (line 6)
+* version script, symbol versions: Options. (line 1281)
+* VERSION {script text}: VERSION. (line 6)
+* versions of symbols: VERSION. (line 6)
+* VFP11_DENORM_FIX: ARM. (line 83)
+* warnings, on combining symbols: Options. (line 1292)
+* warnings, on section alignment: Options. (line 1383)
+* warnings, on undefined symbols: Options. (line 1379)
+* weak externals: WIN32. (line 401)
+* what is this?: Overview. (line 6)
+* wildcard file name patterns: Input Section Wildcards.
+ (line 6)
+* Xtensa options: Xtensa. (line 56)
+* Xtensa processors: Xtensa. (line 6)
+
+
+
+Tag Table:
+Node: Top759
+Node: Overview1542
+Node: Invocation2656
+Node: Options3064
+Node: Environment90607
+Node: Scripts92367
+Node: Basic Script Concepts94101
+Node: Script Format96808
+Node: Simple Example97671
+Node: Simple Commands100767
+Node: Entry Point101273
+Node: File Commands102032
+Node: Format Commands106033
+Node: REGION_ALIAS107989
+Node: Miscellaneous Commands112821
+Node: Assignments116197
+Node: Simple Assignments116688
+Node: PROVIDE118424
+Node: PROVIDE_HIDDEN119629
+Node: Source Code Reference119873
+Node: SECTIONS123453
+Node: Output Section Description125344
+Node: Output Section Name126431
+Node: Output Section Address127307
+Node: Input Section129027
+Node: Input Section Basics129828
+Node: Input Section Wildcards133046
+Node: Input Section Common137779
+Node: Input Section Keep139261
+Node: Input Section Example139751
+Node: Output Section Data140719
+Node: Output Section Keywords143496
+Node: Output Section Discarding147065
+Node: Output Section Attributes148246
+Node: Output Section Type149347
+Node: Output Section LMA150501
+Node: Forced Output Alignment153014
+Node: Forced Input Alignment153282
+Node: Output Section Constraint153671
+Node: Output Section Region154099
+Node: Output Section Phdr154532
+Node: Output Section Fill155196
+Node: Overlay Description156338
+Node: MEMORY160641
+Node: PHDRS164974
+Node: VERSION170013
+Node: Expressions178088
+Node: Constants179017
+Node: Symbolic Constants179892
+Node: Symbols180443
+Node: Orphan Sections181190
+Node: Location Counter182354
+Node: Operators186790
+Node: Evaluation187712
+Node: Expression Section189076
+Node: Builtin Functions190565
+Node: Implicit Linker Scripts198532
+Node: Machine Dependent199307
+Node: H8/300200323
+Node: i960201948
+Node: M68HC11/68HC12204049
+Node: ARM205503
+Node: HPPA ELF32213015
+Node: M68K214638
+Node: MMIX215547
+Node: MSP430216712
+Node: PowerPC ELF32217761
+Node: PowerPC64 ELF64220597
+Node: SPU ELF225013
+Node: TI COFF227645
+Node: WIN32228171
+Node: Xtensa247895
+Node: BFD251017
+Node: BFD outline252472
+Node: BFD information loss253758
+Node: Canonical format256275
+Node: Reporting Bugs260632
+Node: Bug Criteria261326
+Node: Bug Reporting262025
+Node: MRI269064
+Node: GNU Free Documentation License273707
+Node: LD Index293424
+
+End Tag Table
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/standards.info b/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/standards.info
new file mode 100644
index 0000000..69b594f
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/info/standards.info
@@ -0,0 +1,5576 @@
+This is standards.info, produced by makeinfo version 4.8 from
+./standards.texi.
+
+INFO-DIR-SECTION GNU organization
+START-INFO-DIR-ENTRY
+* Standards: (standards). GNU coding standards.
+END-INFO-DIR-ENTRY
+
+ The GNU coding standards, last updated July 22, 2007.
+
+ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+Texts. A copy of the license is included in the section entitled "GNU
+Free Documentation License".
+
+
+File: standards.info, Node: Top, Next: Preface, Prev: (dir), Up: (dir)
+
+Version
+*******
+
+The GNU coding standards, last updated July 22, 2007.
+
+ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+Texts. A copy of the license is included in the section entitled "GNU
+Free Documentation License".
+
+* Menu:
+
+* Preface:: About the GNU Coding Standards.
+* Legal Issues:: Keeping free software free.
+* Design Advice:: General program design.
+* Program Behavior:: Program behavior for all programs
+* Writing C:: Making the best use of C.
+* Documentation:: Documenting programs.
+* Managing Releases:: The release process.
+* References:: Mentioning non-free software or documentation.
+* GNU Free Documentation License:: Copying and sharing this manual.
+* Index::
+
+
+File: standards.info, Node: Preface, Next: Legal Issues, Prev: Top, Up: Top
+
+1 About the GNU Coding Standards
+********************************
+
+The GNU Coding Standards were written by Richard Stallman and other GNU
+Project volunteers. Their purpose is to make the GNU system clean,
+consistent, and easy to install. This document can also be read as a
+guide to writing portable, robust and reliable programs. It focuses on
+programs written in C, but many of the rules and principles are useful
+even if you write in another programming language. The rules often
+state reasons for writing in a certain way.
+
+ This release of the GNU Coding Standards was last updated July 22,
+2007.
+
+ If you did not obtain this file directly from the GNU project and
+recently, please check for a newer version. You can get the GNU Coding
+Standards from the GNU web server in many different formats, including
+the Texinfo source, PDF, HTML, DVI, plain text, and more, at:
+`http://www.gnu.org/prep/standards/'.
+
+ Corrections or suggestions for this document should be sent to
+<bug-standards@gnu.org>. If you make a suggestion, please include a
+suggested new wording for it; our time is limited. We prefer a context
+diff to the `standards.texi' or `make-stds.texi' files, but if you
+don't have those files, please mail your suggestion anyway.
+
+ These standards cover the minimum of what is important when writing a
+GNU package. Likely, the need for additional standards will come up.
+Sometimes, you might suggest that such standards be added to this
+document. If you think your standards would be generally useful, please
+do suggest them.
+
+ You should also set standards for your package on many questions not
+addressed or not firmly specified here. The most important point is to
+be self-consistent--try to stick to the conventions you pick, and try
+to document them as much as possible. That way, your program will be
+more maintainable by others.
+
+ The GNU Hello program serves as an example of how to follow the GNU
+coding standards for a trivial program.
+`http://www.gnu.org/software/hello/hello.html'.
+
+
+File: standards.info, Node: Legal Issues, Next: Design Advice, Prev: Preface, Up: Top
+
+2 Keeping Free Software Free
+****************************
+
+This chapter discusses how you can make sure that GNU software avoids
+legal difficulties, and other related issues.
+
+* Menu:
+
+* Reading Non-Free Code:: Referring to proprietary programs.
+* Contributions:: Accepting contributions.
+* Trademarks:: How we deal with trademark issues.
+
+
+File: standards.info, Node: Reading Non-Free Code, Next: Contributions, Up: Legal Issues
+
+2.1 Referring to Proprietary Programs
+=====================================
+
+Don't in any circumstances refer to Unix source code for or during your
+work on GNU! (Or to any other proprietary programs.)
+
+ If you have a vague recollection of the internals of a Unix program,
+this does not absolutely mean you can't write an imitation of it, but
+do try to organize the imitation internally along different lines,
+because this is likely to make the details of the Unix version
+irrelevant and dissimilar to your results.
+
+ For example, Unix utilities were generally optimized to minimize
+memory use; if you go for speed instead, your program will be very
+different. You could keep the entire input file in memory and scan it
+there instead of using stdio. Use a smarter algorithm discovered more
+recently than the Unix program. Eliminate use of temporary files. Do
+it in one pass instead of two (we did this in the assembler).
+
+ Or, on the contrary, emphasize simplicity instead of speed. For some
+applications, the speed of today's computers makes simpler algorithms
+adequate.
+
+ Or go for generality. For example, Unix programs often have static
+tables or fixed-size strings, which make for arbitrary limits; use
+dynamic allocation instead. Make sure your program handles NULs and
+other funny characters in the input files. Add a programming language
+for extensibility and write part of the program in that language.
+
+ Or turn some parts of the program into independently usable
+libraries. Or use a simple garbage collector instead of tracking
+precisely when to free memory, or use a new GNU facility such as
+obstacks.
+
+
+File: standards.info, Node: Contributions, Next: Trademarks, Prev: Reading Non-Free Code, Up: Legal Issues
+
+2.2 Accepting Contributions
+===========================
+
+If the program you are working on is copyrighted by the Free Software
+Foundation, then when someone else sends you a piece of code to add to
+the program, we need legal papers to use it--just as we asked you to
+sign papers initially. _Each_ person who makes a nontrivial
+contribution to a program must sign some sort of legal papers in order
+for us to have clear title to the program; the main author alone is not
+enough.
+
+ So, before adding in any contributions from other people, please tell
+us, so we can arrange to get the papers. Then wait until we tell you
+that we have received the signed papers, before you actually use the
+contribution.
+
+ This applies both before you release the program and afterward. If
+you receive diffs to fix a bug, and they make significant changes, we
+need legal papers for that change.
+
+ This also applies to comments and documentation files. For copyright
+law, comments and code are just text. Copyright applies to all kinds of
+text, so we need legal papers for all kinds.
+
+ We know it is frustrating to ask for legal papers; it's frustrating
+for us as well. But if you don't wait, you are going out on a limb--for
+example, what if the contributor's employer won't sign a disclaimer?
+You might have to take that code out again!
+
+ You don't need papers for changes of a few lines here or there, since
+they are not significant for copyright purposes. Also, you don't need
+papers if all you get from the suggestion is some ideas, not actual code
+which you use. For example, if someone sent you one implementation, but
+you write a different implementation of the same idea, you don't need to
+get papers.
+
+ The very worst thing is if you forget to tell us about the other
+contributor. We could be very embarrassed in court some day as a
+result.
+
+ We have more detailed advice for maintainers of programs; if you have
+reached the stage of actually maintaining a program for GNU (whether
+released or not), please ask us for a copy. It is also available
+online for your perusal: `http://www.gnu.org/prep/maintain/'.
+
+
+File: standards.info, Node: Trademarks, Prev: Contributions, Up: Legal Issues
+
+2.3 Trademarks
+==============
+
+Please do not include any trademark acknowledgements in GNU software
+packages or documentation.
+
+ Trademark acknowledgements are the statements that such-and-such is a
+trademark of so-and-so. The GNU Project has no objection to the basic
+idea of trademarks, but these acknowledgements feel like kowtowing, and
+there is no legal requirement for them, so we don't use them.
+
+ What is legally required, as regards other people's trademarks, is to
+avoid using them in ways which a reader might reasonably understand as
+naming or labeling our own programs or activities. For example, since
+"Objective C" is (or at least was) a trademark, we made sure to say
+that we provide a "compiler for the Objective C language" rather than
+an "Objective C compiler". The latter would have been meant as a
+shorter way of saying the former, but it does not explicitly state the
+relationship, so it could be misinterpreted as using "Objective C" as a
+label for the compiler rather than for the language.
+
+ Please don't use "win" as an abbreviation for Microsoft Windows in
+GNU software or documentation. In hacker terminology, calling
+something a "win" is a form of praise. If you wish to praise Microsoft
+Windows when speaking on your own, by all means do so, but not in GNU
+software. Usually we write the name "Windows" in full, but when
+brevity is very important (as in file names and sometimes symbol
+names), we abbreviate it to "w". For instance, the files and functions
+in Emacs that deal with Windows start with `w32'.
+
+
+File: standards.info, Node: Design Advice, Next: Program Behavior, Prev: Legal Issues, Up: Top
+
+3 General Program Design
+************************
+
+This chapter discusses some of the issues you should take into account
+when designing your program.
+
+* Menu:
+
+* Source Language:: Which languages to use.
+* Compatibility:: Compatibility with other implementations.
+* Using Extensions:: Using non-standard features.
+* Standard C:: Using standard C features.
+* Conditional Compilation:: Compiling code only if a conditional is true.
+
+
+File: standards.info, Node: Source Language, Next: Compatibility, Up: Design Advice
+
+3.1 Which Languages to Use
+==========================
+
+When you want to use a language that gets compiled and runs at high
+speed, the best language to use is C. Using another language is like
+using a non-standard feature: it will cause trouble for users. Even if
+GCC supports the other language, users may find it inconvenient to have
+to install the compiler for that other language in order to build your
+program. For example, if you write your program in C++, people will
+have to install the GNU C++ compiler in order to compile your program.
+
+ C has one other advantage over C++ and other compiled languages: more
+people know C, so more people will find it easy to read and modify the
+program if it is written in C.
+
+ So in general it is much better to use C, rather than the comparable
+alternatives.
+
+ But there are two exceptions to that conclusion:
+
+ * It is no problem to use another language to write a tool
+ specifically intended for use with that language. That is because
+ the only people who want to build the tool will be those who have
+ installed the other language anyway.
+
+ * If an application is of interest only to a narrow part of the
+ community, then the question of which language it is written in
+ has less effect on other people, so you may as well please
+ yourself.
+
+ Many programs are designed to be extensible: they include an
+interpreter for a language that is higher level than C. Often much of
+the program is written in that language, too. The Emacs editor
+pioneered this technique.
+
+ The standard extensibility interpreter for GNU software is GUILE
+(`http://www.gnu.org/software/guile/'), which implements the language
+Scheme (an especially clean and simple dialect of Lisp). We don't
+reject programs written in other "scripting languages" such as Perl and
+Python, but using GUILE is very important for the overall consistency
+of the GNU system.
+
+
+File: standards.info, Node: Compatibility, Next: Using Extensions, Prev: Source Language, Up: Design Advice
+
+3.2 Compatibility with Other Implementations
+============================================
+
+With occasional exceptions, utility programs and libraries for GNU
+should be upward compatible with those in Berkeley Unix, and upward
+compatible with Standard C if Standard C specifies their behavior, and
+upward compatible with POSIX if POSIX specifies their behavior.
+
+ When these standards conflict, it is useful to offer compatibility
+modes for each of them.
+
+ Standard C and POSIX prohibit many kinds of extensions. Feel free
+to make the extensions anyway, and include a `--ansi', `--posix', or
+`--compatible' option to turn them off. However, if the extension has
+a significant chance of breaking any real programs or scripts, then it
+is not really upward compatible. So you should try to redesign its
+interface to make it upward compatible.
+
+ Many GNU programs suppress extensions that conflict with POSIX if the
+environment variable `POSIXLY_CORRECT' is defined (even if it is
+defined with a null value). Please make your program recognize this
+variable if appropriate.
+
+ When a feature is used only by users (not by programs or command
+files), and it is done poorly in Unix, feel free to replace it
+completely with something totally different and better. (For example,
+`vi' is replaced with Emacs.) But it is nice to offer a compatible
+feature as well. (There is a free `vi' clone, so we offer it.)
+
+ Additional useful features are welcome regardless of whether there
+is any precedent for them.
+
+
+File: standards.info, Node: Using Extensions, Next: Standard C, Prev: Compatibility, Up: Design Advice
+
+3.3 Using Non-standard Features
+===============================
+
+Many GNU facilities that already exist support a number of convenient
+extensions over the comparable Unix facilities. Whether to use these
+extensions in implementing your program is a difficult question.
+
+ On the one hand, using the extensions can make a cleaner program.
+On the other hand, people will not be able to build the program unless
+the other GNU tools are available. This might cause the program to
+work on fewer kinds of machines.
+
+ With some extensions, it might be easy to provide both alternatives.
+For example, you can define functions with a "keyword" `INLINE' and
+define that as a macro to expand into either `inline' or nothing,
+depending on the compiler.
+
+ In general, perhaps it is best not to use the extensions if you can
+straightforwardly do without them, but to use the extensions if they
+are a big improvement.
+
+ An exception to this rule are the large, established programs (such
+as Emacs) which run on a great variety of systems. Using GNU
+extensions in such programs would make many users unhappy, so we don't
+do that.
+
+ Another exception is for programs that are used as part of
+compilation: anything that must be compiled with other compilers in
+order to bootstrap the GNU compilation facilities. If these require
+the GNU compiler, then no one can compile them without having them
+installed already. That would be extremely troublesome in certain
+cases.
+
+
+File: standards.info, Node: Standard C, Next: Conditional Compilation, Prev: Using Extensions, Up: Design Advice
+
+3.4 Standard C and Pre-Standard C
+=================================
+
+1989 Standard C is widespread enough now that it is ok to use its
+features in new programs. There is one exception: do not ever use the
+"trigraph" feature of Standard C.
+
+ 1999 Standard C is not widespread yet, so please do not require its
+features in programs. It is ok to use its features if they are present.
+
+ However, it is easy to support pre-standard compilers in most
+programs, so if you know how to do that, feel free. If a program you
+are maintaining has such support, you should try to keep it working.
+
+ To support pre-standard C, instead of writing function definitions in
+standard prototype form,
+
+ int
+ foo (int x, int y)
+ ...
+
+write the definition in pre-standard style like this,
+
+ int
+ foo (x, y)
+ int x, y;
+ ...
+
+and use a separate declaration to specify the argument prototype:
+
+ int foo (int, int);
+
+ You need such a declaration anyway, in a header file, to get the
+benefit of prototypes in all the files where the function is called.
+And once you have the declaration, you normally lose nothing by writing
+the function definition in the pre-standard style.
+
+ This technique does not work for integer types narrower than `int'.
+If you think of an argument as being of a type narrower than `int',
+declare it as `int' instead.
+
+ There are a few special cases where this technique is hard to use.
+For example, if a function argument needs to hold the system type
+`dev_t', you run into trouble, because `dev_t' is shorter than `int' on
+some machines; but you cannot use `int' instead, because `dev_t' is
+wider than `int' on some machines. There is no type you can safely use
+on all machines in a non-standard definition. The only way to support
+non-standard C and pass such an argument is to check the width of
+`dev_t' using Autoconf and choose the argument type accordingly. This
+may not be worth the trouble.
+
+ In order to support pre-standard compilers that do not recognize
+prototypes, you may want to use a preprocessor macro like this:
+
+ /* Declare the prototype for a general external function. */
+ #if defined (__STDC__) || defined (WINDOWSNT)
+ #define P_(proto) proto
+ #else
+ #define P_(proto) ()
+ #endif
+
+
+File: standards.info, Node: Conditional Compilation, Prev: Standard C, Up: Design Advice
+
+3.5 Conditional Compilation
+===========================
+
+When supporting configuration options already known when building your
+program we prefer using `if (... )' over conditional compilation, as in
+the former case the compiler is able to perform more extensive checking
+of all possible code paths.
+
+ For example, please write
+
+ if (HAS_FOO)
+ ...
+ else
+ ...
+
+instead of:
+
+ #ifdef HAS_FOO
+ ...
+ #else
+ ...
+ #endif
+
+ A modern compiler such as GCC will generate exactly the same code in
+both cases, and we have been using similar techniques with good success
+in several projects. Of course, the former method assumes that
+`HAS_FOO' is defined as either 0 or 1.
+
+ While this is not a silver bullet solving all portability problems,
+and is not always appropriate, following this policy would have saved
+GCC developers many hours, or even days, per year.
+
+ In the case of function-like macros like `REVERSIBLE_CC_MODE' in GCC
+which cannot be simply used in `if( ...)' statements, there is an easy
+workaround. Simply introduce another macro `HAS_REVERSIBLE_CC_MODE' as
+in the following example:
+
+ #ifdef REVERSIBLE_CC_MODE
+ #define HAS_REVERSIBLE_CC_MODE 1
+ #else
+ #define HAS_REVERSIBLE_CC_MODE 0
+ #endif
+
+
+File: standards.info, Node: Program Behavior, Next: Writing C, Prev: Design Advice, Up: Top
+
+4 Program Behavior for All Programs
+***********************************
+
+This chapter describes conventions for writing robust software. It
+also describes general standards for error messages, the command line
+interface, and how libraries should behave.
+
+* Menu:
+
+* Non-GNU Standards:: We consider standards such as POSIX;
+ we don't "obey" them.
+* Semantics:: Writing robust programs.
+* Libraries:: Library behavior.
+* Errors:: Formatting error messages.
+* User Interfaces:: Standards about interfaces generally.
+* Graphical Interfaces:: Standards for graphical interfaces.
+* Command-Line Interfaces:: Standards for command line interfaces.
+* Option Table:: Table of long options.
+* Memory Usage:: When and how to care about memory needs.
+* File Usage:: Which files to use, and where.
+
+
+File: standards.info, Node: Non-GNU Standards, Next: Semantics, Up: Program Behavior
+
+4.1 Non-GNU Standards
+=====================
+
+The GNU Project regards standards published by other organizations as
+suggestions, not orders. We consider those standards, but we do not
+"obey" them. In developing a GNU program, you should implement an
+outside standard's specifications when that makes the GNU system better
+overall in an objective sense. When it doesn't, you shouldn't.
+
+ In most cases, following published standards is convenient for
+users--it means that their programs or scripts will work more portably.
+For instance, GCC implements nearly all the features of Standard C as
+specified by that standard. C program developers would be unhappy if
+it did not. And GNU utilities mostly follow specifications of POSIX.2;
+shell script writers and users would be unhappy if our programs were
+incompatible.
+
+ But we do not follow either of these specifications rigidly, and
+there are specific points on which we decided not to follow them, so as
+to make the GNU system better for users.
+
+ For instance, Standard C says that nearly all extensions to C are
+prohibited. How silly! GCC implements many extensions, some of which
+were later adopted as part of the standard. If you want these
+constructs to give an error message as "required" by the standard, you
+must specify `--pedantic', which was implemented only so that we can
+say "GCC is a 100% implementation of the standard," not because there
+is any reason to actually use it.
+
+ POSIX.2 specifies that `df' and `du' must output sizes by default in
+units of 512 bytes. What users want is units of 1k, so that is what we
+do by default. If you want the ridiculous behavior "required" by
+POSIX, you must set the environment variable `POSIXLY_CORRECT' (which
+was originally going to be named `POSIX_ME_HARDER').
+
+ GNU utilities also depart from the letter of the POSIX.2
+specification when they support long-named command-line options, and
+intermixing options with ordinary arguments. This minor
+incompatibility with POSIX is never a problem in practice, and it is
+very useful.
+
+ In particular, don't reject a new feature, or remove an old one,
+merely because a standard says it is "forbidden" or "deprecated."
+
+
+File: standards.info, Node: Semantics, Next: Libraries, Prev: Non-GNU Standards, Up: Program Behavior
+
+4.2 Writing Robust Programs
+===========================
+
+Avoid arbitrary limits on the length or number of _any_ data structure,
+including file names, lines, files, and symbols, by allocating all data
+structures dynamically. In most Unix utilities, "long lines are
+silently truncated". This is not acceptable in a GNU utility.
+
+ Utilities reading files should not drop NUL characters, or any other
+nonprinting characters _including those with codes above 0177_. The
+only sensible exceptions would be utilities specifically intended for
+interface to certain types of terminals or printers that can't handle
+those characters. Whenever possible, try to make programs work
+properly with sequences of bytes that represent multibyte characters,
+using encodings such as UTF-8 and others.
+
+ Check every system call for an error return, unless you know you
+wish to ignore errors. Include the system error text (from `perror' or
+equivalent) in _every_ error message resulting from a failing system
+call, as well as the name of the file if any and the name of the
+utility. Just "cannot open foo.c" or "stat failed" is not sufficient.
+
+ Check every call to `malloc' or `realloc' to see if it returned
+zero. Check `realloc' even if you are making the block smaller; in a
+system that rounds block sizes to a power of 2, `realloc' may get a
+different block if you ask for less space.
+
+ In Unix, `realloc' can destroy the storage block if it returns zero.
+GNU `realloc' does not have this bug: if it fails, the original block
+is unchanged. Feel free to assume the bug is fixed. If you wish to
+run your program on Unix, and wish to avoid lossage in this case, you
+can use the GNU `malloc'.
+
+ You must expect `free' to alter the contents of the block that was
+freed. Anything you want to fetch from the block, you must fetch before
+calling `free'.
+
+ If `malloc' fails in a noninteractive program, make that a fatal
+error. In an interactive program (one that reads commands from the
+user), it is better to abort the command and return to the command
+reader loop. This allows the user to kill other processes to free up
+virtual memory, and then try the command again.
+
+ Use `getopt_long' to decode arguments, unless the argument syntax
+makes this unreasonable.
+
+ When static storage is to be written in during program execution, use
+explicit C code to initialize it. Reserve C initialized declarations
+for data that will not be changed.
+
+ Try to avoid low-level interfaces to obscure Unix data structures
+(such as file directories, utmp, or the layout of kernel memory), since
+these are less likely to work compatibly. If you need to find all the
+files in a directory, use `readdir' or some other high-level interface.
+These are supported compatibly by GNU.
+
+ The preferred signal handling facilities are the BSD variant of
+`signal', and the POSIX `sigaction' function; the alternative USG
+`signal' interface is an inferior design.
+
+ Nowadays, using the POSIX signal functions may be the easiest way to
+make a program portable. If you use `signal', then on GNU/Linux
+systems running GNU libc version 1, you should include `bsd/signal.h'
+instead of `signal.h', so as to get BSD behavior. It is up to you
+whether to support systems where `signal' has only the USG behavior, or
+give up on them.
+
+ In error checks that detect "impossible" conditions, just abort.
+There is usually no point in printing any message. These checks
+indicate the existence of bugs. Whoever wants to fix the bugs will have
+to read the source code and run a debugger. So explain the problem with
+comments in the source. The relevant data will be in variables, which
+are easy to examine with the debugger, so there is no point moving them
+elsewhere.
+
+ Do not use a count of errors as the exit status for a program.
+_That does not work_, because exit status values are limited to 8 bits
+(0 through 255). A single run of the program might have 256 errors; if
+you try to return 256 as the exit status, the parent process will see 0
+as the status, and it will appear that the program succeeded.
+
+ If you make temporary files, check the `TMPDIR' environment
+variable; if that variable is defined, use the specified directory
+instead of `/tmp'.
+
+ In addition, be aware that there is a possible security problem when
+creating temporary files in world-writable directories. In C, you can
+avoid this problem by creating temporary files in this manner:
+
+ fd = open(filename, O_WRONLY | O_CREAT | O_EXCL, 0600);
+
+or by using the `mkstemps' function from libiberty.
+
+ In bash, use `set -C' to avoid this problem.
+
+
+File: standards.info, Node: Libraries, Next: Errors, Prev: Semantics, Up: Program Behavior
+
+4.3 Library Behavior
+====================
+
+Try to make library functions reentrant. If they need to do dynamic
+storage allocation, at least try to avoid any nonreentrancy aside from
+that of `malloc' itself.
+
+ Here are certain name conventions for libraries, to avoid name
+conflicts.
+
+ Choose a name prefix for the library, more than two characters long.
+All external function and variable names should start with this prefix.
+In addition, there should only be one of these in any given library
+member. This usually means putting each one in a separate source file.
+
+ An exception can be made when two external symbols are always used
+together, so that no reasonable program could use one without the
+other; then they can both go in the same file.
+
+ External symbols that are not documented entry points for the user
+should have names beginning with `_'. The `_' should be followed by
+the chosen name prefix for the library, to prevent collisions with
+other libraries. These can go in the same files with user entry points
+if you like.
+
+ Static functions and variables can be used as you like and need not
+fit any naming convention.
+
+
+File: standards.info, Node: Errors, Next: User Interfaces, Prev: Libraries, Up: Program Behavior
+
+4.4 Formatting Error Messages
+=============================
+
+Error messages from compilers should look like this:
+
+ SOURCE-FILE-NAME:LINENO: MESSAGE
+
+If you want to mention the column number, use one of these formats:
+
+ SOURCE-FILE-NAME:LINENO:COLUMN: MESSAGE
+ SOURCE-FILE-NAME:LINENO.COLUMN: MESSAGE
+
+Line numbers should start from 1 at the beginning of the file, and
+column numbers should start from 1 at the beginning of the line. (Both
+of these conventions are chosen for compatibility.) Calculate column
+numbers assuming that space and all ASCII printing characters have
+equal width, and assuming tab stops every 8 columns.
+
+ The error message can also give both the starting and ending
+positions of the erroneous text. There are several formats so that you
+can avoid redundant information such as a duplicate line number. Here
+are the possible formats:
+
+ SOURCE-FILE-NAME:LINENO-1.COLUMN-1-LINENO-2.COLUMN-2: MESSAGE
+ SOURCE-FILE-NAME:LINENO-1.COLUMN-1-COLUMN-2: MESSAGE
+ SOURCE-FILE-NAME:LINENO-1-LINENO-2: MESSAGE
+
+When an error is spread over several files, you can use this format:
+
+ FILE-1:LINENO-1.COLUMN-1-FILE-2:LINENO-2.COLUMN-2: MESSAGE
+
+ Error messages from other noninteractive programs should look like
+this:
+
+ PROGRAM:SOURCE-FILE-NAME:LINENO: MESSAGE
+
+when there is an appropriate source file, or like this:
+
+ PROGRAM: MESSAGE
+
+when there is no relevant source file.
+
+ If you want to mention the column number, use this format:
+
+ PROGRAM:SOURCE-FILE-NAME:LINENO:COLUMN: MESSAGE
+
+ In an interactive program (one that is reading commands from a
+terminal), it is better not to include the program name in an error
+message. The place to indicate which program is running is in the
+prompt or with the screen layout. (When the same program runs with
+input from a source other than a terminal, it is not interactive and
+would do best to print error messages using the noninteractive style.)
+
+ The string MESSAGE should not begin with a capital letter when it
+follows a program name and/or file name, because that isn't the
+beginning of a sentence. (The sentence conceptually starts at the
+beginning of the line.) Also, it should not end with a period.
+
+ Error messages from interactive programs, and other messages such as
+usage messages, should start with a capital letter. But they should not
+end with a period.
+
+
+File: standards.info, Node: User Interfaces, Next: Graphical Interfaces, Prev: Errors, Up: Program Behavior
+
+4.5 Standards for Interfaces Generally
+======================================
+
+Please don't make the behavior of a utility depend on the name used to
+invoke it. It is useful sometimes to make a link to a utility with a
+different name, and that should not change what it does.
+
+ Instead, use a run time option or a compilation switch or both to
+select among the alternate behaviors.
+
+ Likewise, please don't make the behavior of the program depend on the
+type of output device it is used with. Device independence is an
+important principle of the system's design; do not compromise it merely
+to save someone from typing an option now and then. (Variation in error
+message syntax when using a terminal is ok, because that is a side issue
+that people do not depend on.)
+
+ If you think one behavior is most useful when the output is to a
+terminal, and another is most useful when the output is a file or a
+pipe, then it is usually best to make the default behavior the one that
+is useful with output to a terminal, and have an option for the other
+behavior.
+
+ Compatibility requires certain programs to depend on the type of
+output device. It would be disastrous if `ls' or `sh' did not do so in
+the way all users expect. In some of these cases, we supplement the
+program with a preferred alternate version that does not depend on the
+output device type. For example, we provide a `dir' program much like
+`ls' except that its default output format is always multi-column
+format.
+
+
+File: standards.info, Node: Graphical Interfaces, Next: Command-Line Interfaces, Prev: User Interfaces, Up: Program Behavior
+
+4.6 Standards for Graphical Interfaces
+======================================
+
+When you write a program that provides a graphical user interface,
+please make it work with X Windows and the GTK+ toolkit unless the
+functionality specifically requires some alternative (for example,
+"displaying jpeg images while in console mode").
+
+ In addition, please provide a command-line interface to control the
+functionality. (In many cases, the graphical user interface can be a
+separate program which invokes the command-line program.) This is so
+that the same jobs can be done from scripts.
+
+ Please also consider providing a CORBA interface (for use from
+GNOME), a library interface (for use from C), and perhaps a
+keyboard-driven console interface (for use by users from console mode).
+Once you are doing the work to provide the functionality and the
+graphical interface, these won't be much extra work.
+
+
+File: standards.info, Node: Command-Line Interfaces, Next: Option Table, Prev: Graphical Interfaces, Up: Program Behavior
+
+4.7 Standards for Command Line Interfaces
+=========================================
+
+It is a good idea to follow the POSIX guidelines for the command-line
+options of a program. The easiest way to do this is to use `getopt' to
+parse them. Note that the GNU version of `getopt' will normally permit
+options anywhere among the arguments unless the special argument `--'
+is used. This is not what POSIX specifies; it is a GNU extension.
+
+ Please define long-named options that are equivalent to the
+single-letter Unix-style options. We hope to make GNU more user
+friendly this way. This is easy to do with the GNU function
+`getopt_long'.
+
+ One of the advantages of long-named options is that they can be
+consistent from program to program. For example, users should be able
+to expect the "verbose" option of any GNU program which has one, to be
+spelled precisely `--verbose'. To achieve this uniformity, look at the
+table of common long-option names when you choose the option names for
+your program (*note Option Table::).
+
+ It is usually a good idea for file names given as ordinary arguments
+to be input files only; any output files would be specified using
+options (preferably `-o' or `--output'). Even if you allow an output
+file name as an ordinary argument for compatibility, try to provide an
+option as another way to specify it. This will lead to more consistency
+among GNU utilities, and fewer idiosyncrasies for users to remember.
+
+ All programs should support two standard options: `--version' and
+`--help'. CGI programs should accept these as command-line options,
+and also if given as the `PATH_INFO'; for instance, visiting
+`http://example.org/p.cgi/--help' in a browser should output the same
+information as invoking `p.cgi --help' from the command line.
+
+* Menu:
+
+* --version:: The standard output for --version.
+* --help:: The standard output for --help.
+
+
+File: standards.info, Node: --version, Next: --help, Up: Command-Line Interfaces
+
+4.7.1 `--version'
+-----------------
+
+The standard `--version' option should direct the program to print
+information about its name, version, origin and legal status, all on
+standard output, and then exit successfully. Other options and
+arguments should be ignored once this is seen, and the program should
+not perform its normal function.
+
+ The first line is meant to be easy for a program to parse; the
+version number proper starts after the last space. In addition, it
+contains the canonical name for this program, in this format:
+
+ GNU Emacs 19.30
+
+The program's name should be a constant string; _don't_ compute it from
+`argv[0]'. The idea is to state the standard or canonical name for the
+program, not its file name. There are other ways to find out the
+precise file name where a command is found in `PATH'.
+
+ If the program is a subsidiary part of a larger package, mention the
+package name in parentheses, like this:
+
+ emacsserver (GNU Emacs) 19.30
+
+If the package has a version number which is different from this
+program's version number, you can mention the package version number
+just before the close-parenthesis.
+
+ If you _need_ to mention the version numbers of libraries which are
+distributed separately from the package which contains this program,
+you can do so by printing an additional line of version info for each
+library you want to mention. Use the same format for these lines as for
+the first line.
+
+ Please do not mention all of the libraries that the program uses
+"just for completeness"--that would produce a lot of unhelpful clutter.
+Please mention library version numbers only if you find in practice that
+they are very important to you in debugging.
+
+ The following line, after the version number line or lines, should
+be a copyright notice. If more than one copyright notice is called
+for, put each on a separate line.
+
+ Next should follow a line stating the license, preferably using one
+of abbrevations below, and a brief statement that the program is free
+software, and that users are free to copy and change it. Also mention
+that there is no warranty, to the extent permitted by law. See
+recommended wording below.
+
+ It is ok to finish the output with a list of the major authors of the
+program, as a way of giving credit.
+
+ Here's an example of output that follows these rules:
+
+ GNU hello 2.3
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+ This is free software: you are free to change and redistribute it.
+ There is NO WARRANTY, to the extent permitted by law.
+
+ You should adapt this to your program, of course, filling in the
+proper year, copyright holder, name of program, and the references to
+distribution terms, and changing the rest of the wording as necessary.
+
+ This copyright notice only needs to mention the most recent year in
+which changes were made--there's no need to list the years for previous
+versions' changes. You don't have to mention the name of the program in
+these notices, if that is inconvenient, since it appeared in the first
+line. (The rules are different for copyright notices in source files;
+*note Copyright Notices: (maintain)Copyright Notices.)
+
+ Translations of the above lines must preserve the validity of the
+copyright notices (*note Internationalization::). If the translation's
+character set supports it, the `(C)' should be replaced with the
+copyright symbol, as follows:
+
+ (the official copyright symbol, which is the letter C in a circle);
+
+ Write the word "Copyright" exactly like that, in English. Do not
+translate it into another language. International treaties recognize
+the English word "Copyright"; translations into other languages do not
+have legal significance.
+
+ Finally, here is the table of our suggested license abbreviations.
+Any abbreviation can be followed by `vVERSION[+]', meaning that
+particular version, or later versions with the `+', as shown above.
+
+ In the case of exceptions for extra permissions with the GPL, we use
+`/' for a separator; the version number can follow the license
+abbreviation as usual, as in the examples below.
+
+GPL
+ GNU General Public License, `http://www.gnu.org/licenses/gpl.html'.
+
+LGPL
+ GNU Lesser General Public License,
+ `http://www.gnu.org/licenses/lgpl.html'.
+
+GPL/Guile
+ GNU GPL with the exception for Guile; for example, GPLv3+/Guile
+ means the GNU GPL version 3 or later, with the extra exception for
+ Guile.
+
+ GNU GPL with the exception for Ada.
+
+Apache
+ The Apache Software Foundation license,
+ `http://www.apache.org/licenses'.
+
+Artistic
+ The Artistic license used for Perl,
+ `http://www.perlfoundation.org/legal'.
+
+Expat
+ The Expat license, `http://www.jclark.com/xml/copying.txt'.
+
+MPL
+ The Mozilla Public License, `http://www.mozilla.org/MPL/'.
+
+OBSD
+ The original (4-clause) BSD license, incompatible with the GNU GPL
+ `http://www.xfree86.org/3.3.6/COPYRIGHT2.html#6'.
+
+PHP
+ The license used for PHP, `http://www.php.net/license/'.
+
+public domain
+ The non-license that is being in the public domain,
+ `http://www.gnu.org/licenses/license-list.html#PublicDomain'.
+
+Python
+ The license for Python, `http://www.python.org/2.0.1/license.html'.
+
+RBSD
+ The revised (3-clause) BSD, compatible with the GNU GPL,
+ `http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5'.
+
+X11
+ The simple non-copyleft license used for most versions of the X
+ Window system, `http://www.xfree86.org/3.3.6/COPYRIGHT2.html#3'.
+
+Zlib
+ The license for Zlib, `http://www.gzip.org/zlib/zlib_license.html'.
+
+
+ More information about these licenses and many more are on the GNU
+licensing web pages, `http://www.gnu.org/licenses/license-list.html'.
+
+
+File: standards.info, Node: --help, Prev: --version, Up: Command-Line Interfaces
+
+4.7.2 `--help'
+--------------
+
+The standard `--help' option should output brief documentation for how
+to invoke the program, on standard output, then exit successfully.
+Other options and arguments should be ignored once this is seen, and
+the program should not perform its normal function.
+
+ Near the end of the `--help' option's output there should be a line
+that says where to mail bug reports. It should have this format:
+
+ Report bugs to MAILING-ADDRESS.
+
+
+File: standards.info, Node: Option Table, Next: Memory Usage, Prev: Command-Line Interfaces, Up: Program Behavior
+
+4.8 Table of Long Options
+=========================
+
+Here is a table of long options used by GNU programs. It is surely
+incomplete, but we aim to list all the options that a new program might
+want to be compatible with. If you use names not already in the table,
+please send <bug-standards@gnu.org> a list of them, with their
+meanings, so we can update the table.
+
+`after-date'
+ `-N' in `tar'.
+
+`all'
+ `-a' in `du', `ls', `nm', `stty', `uname', and `unexpand'.
+
+`all-text'
+ `-a' in `diff'.
+
+`almost-all'
+ `-A' in `ls'.
+
+`append'
+ `-a' in `etags', `tee', `time'; `-r' in `tar'.
+
+`archive'
+ `-a' in `cp'.
+
+`archive-name'
+ `-n' in `shar'.
+
+`arglength'
+ `-l' in `m4'.
+
+`ascii'
+ `-a' in `diff'.
+
+`assign'
+ `-v' in `gawk'.
+
+`assume-new'
+ `-W' in Make.
+
+`assume-old'
+ `-o' in Make.
+
+`auto-check'
+ `-a' in `recode'.
+
+`auto-pager'
+ `-a' in `wdiff'.
+
+`auto-reference'
+ `-A' in `ptx'.
+
+`avoid-wraps'
+ `-n' in `wdiff'.
+
+`background'
+ For server programs, run in the background.
+
+`backward-search'
+ `-B' in `ctags'.
+
+`basename'
+ `-f' in `shar'.
+
+`batch'
+ Used in GDB.
+
+`baud'
+ Used in GDB.
+
+`before'
+ `-b' in `tac'.
+
+`binary'
+ `-b' in `cpio' and `diff'.
+
+`bits-per-code'
+ `-b' in `shar'.
+
+`block-size'
+ Used in `cpio' and `tar'.
+
+`blocks'
+ `-b' in `head' and `tail'.
+
+`break-file'
+ `-b' in `ptx'.
+
+`brief'
+ Used in various programs to make output shorter.
+
+`bytes'
+ `-c' in `head', `split', and `tail'.
+
+`c++'
+ `-C' in `etags'.
+
+`catenate'
+ `-A' in `tar'.
+
+`cd'
+ Used in various programs to specify the directory to use.
+
+`changes'
+ `-c' in `chgrp' and `chown'.
+
+`classify'
+ `-F' in `ls'.
+
+`colons'
+ `-c' in `recode'.
+
+`command'
+ `-c' in `su'; `-x' in GDB.
+
+`compare'
+ `-d' in `tar'.
+
+`compat'
+ Used in `gawk'.
+
+`compress'
+ `-Z' in `tar' and `shar'.
+
+`concatenate'
+ `-A' in `tar'.
+
+`confirmation'
+ `-w' in `tar'.
+
+`context'
+ Used in `diff'.
+
+`copyleft'
+ `-W copyleft' in `gawk'.
+
+`copyright'
+ `-C' in `ptx', `recode', and `wdiff'; `-W copyright' in `gawk'.
+
+`core'
+ Used in GDB.
+
+`count'
+ `-q' in `who'.
+
+`count-links'
+ `-l' in `du'.
+
+`create'
+ Used in `tar' and `cpio'.
+
+`cut-mark'
+ `-c' in `shar'.
+
+`cxref'
+ `-x' in `ctags'.
+
+`date'
+ `-d' in `touch'.
+
+`debug'
+ `-d' in Make and `m4'; `-t' in Bison.
+
+`define'
+ `-D' in `m4'.
+
+`defines'
+ `-d' in Bison and `ctags'.
+
+`delete'
+ `-D' in `tar'.
+
+`dereference'
+ `-L' in `chgrp', `chown', `cpio', `du', `ls', and `tar'.
+
+`dereference-args'
+ `-D' in `du'.
+
+`device'
+ Specify an I/O device (special file name).
+
+`diacritics'
+ `-d' in `recode'.
+
+`dictionary-order'
+ `-d' in `look'.
+
+`diff'
+ `-d' in `tar'.
+
+`digits'
+ `-n' in `csplit'.
+
+`directory'
+ Specify the directory to use, in various programs. In `ls', it
+ means to show directories themselves rather than their contents.
+ In `rm' and `ln', it means to not treat links to directories
+ specially.
+
+`discard-all'
+ `-x' in `strip'.
+
+`discard-locals'
+ `-X' in `strip'.
+
+`dry-run'
+ `-n' in Make.
+
+`ed'
+ `-e' in `diff'.
+
+`elide-empty-files'
+ `-z' in `csplit'.
+
+`end-delete'
+ `-x' in `wdiff'.
+
+`end-insert'
+ `-z' in `wdiff'.
+
+`entire-new-file'
+ `-N' in `diff'.
+
+`environment-overrides'
+ `-e' in Make.
+
+`eof'
+ `-e' in `xargs'.
+
+`epoch'
+ Used in GDB.
+
+`error-limit'
+ Used in `makeinfo'.
+
+`error-output'
+ `-o' in `m4'.
+
+`escape'
+ `-b' in `ls'.
+
+`exclude-from'
+ `-X' in `tar'.
+
+`exec'
+ Used in GDB.
+
+`exit'
+ `-x' in `xargs'.
+
+`exit-0'
+ `-e' in `unshar'.
+
+`expand-tabs'
+ `-t' in `diff'.
+
+`expression'
+ `-e' in `sed'.
+
+`extern-only'
+ `-g' in `nm'.
+
+`extract'
+ `-i' in `cpio'; `-x' in `tar'.
+
+`faces'
+ `-f' in `finger'.
+
+`fast'
+ `-f' in `su'.
+
+`fatal-warnings'
+ `-E' in `m4'.
+
+`file'
+ `-f' in `info', `gawk', Make, `mt', and `tar'; `-n' in `sed'; `-r'
+ in `touch'.
+
+`field-separator'
+ `-F' in `gawk'.
+
+`file-prefix'
+ `-b' in Bison.
+
+`file-type'
+ `-F' in `ls'.
+
+`files-from'
+ `-T' in `tar'.
+
+`fill-column'
+ Used in `makeinfo'.
+
+`flag-truncation'
+ `-F' in `ptx'.
+
+`fixed-output-files'
+ `-y' in Bison.
+
+`follow'
+ `-f' in `tail'.
+
+`footnote-style'
+ Used in `makeinfo'.
+
+`force'
+ `-f' in `cp', `ln', `mv', and `rm'.
+
+`force-prefix'
+ `-F' in `shar'.
+
+`foreground'
+ For server programs, run in the foreground; in other words, don't
+ do anything special to run the server in the background.
+
+`format'
+ Used in `ls', `time', and `ptx'.
+
+`freeze-state'
+ `-F' in `m4'.
+
+`fullname'
+ Used in GDB.
+
+`gap-size'
+ `-g' in `ptx'.
+
+`get'
+ `-x' in `tar'.
+
+`graphic'
+ `-i' in `ul'.
+
+`graphics'
+ `-g' in `recode'.
+
+`group'
+ `-g' in `install'.
+
+`gzip'
+ `-z' in `tar' and `shar'.
+
+`hashsize'
+ `-H' in `m4'.
+
+`header'
+ `-h' in `objdump' and `recode'
+
+`heading'
+ `-H' in `who'.
+
+`help'
+ Used to ask for brief usage information.
+
+`here-delimiter'
+ `-d' in `shar'.
+
+`hide-control-chars'
+ `-q' in `ls'.
+
+`html'
+ In `makeinfo', output HTML.
+
+`idle'
+ `-u' in `who'.
+
+`ifdef'
+ `-D' in `diff'.
+
+`ignore'
+ `-I' in `ls'; `-x' in `recode'.
+
+`ignore-all-space'
+ `-w' in `diff'.
+
+`ignore-backups'
+ `-B' in `ls'.
+
+`ignore-blank-lines'
+ `-B' in `diff'.
+
+`ignore-case'
+ `-f' in `look' and `ptx'; `-i' in `diff' and `wdiff'.
+
+`ignore-errors'
+ `-i' in Make.
+
+`ignore-file'
+ `-i' in `ptx'.
+
+`ignore-indentation'
+ `-I' in `etags'.
+
+`ignore-init-file'
+ `-f' in Oleo.
+
+`ignore-interrupts'
+ `-i' in `tee'.
+
+`ignore-matching-lines'
+ `-I' in `diff'.
+
+`ignore-space-change'
+ `-b' in `diff'.
+
+`ignore-zeros'
+ `-i' in `tar'.
+
+`include'
+ `-i' in `etags'; `-I' in `m4'.
+
+`include-dir'
+ `-I' in Make.
+
+`incremental'
+ `-G' in `tar'.
+
+`info'
+ `-i', `-l', and `-m' in Finger.
+
+`init-file'
+ In some programs, specify the name of the file to read as the
+ user's init file.
+
+`initial'
+ `-i' in `expand'.
+
+`initial-tab'
+ `-T' in `diff'.
+
+`inode'
+ `-i' in `ls'.
+
+`interactive'
+ `-i' in `cp', `ln', `mv', `rm'; `-e' in `m4'; `-p' in `xargs';
+ `-w' in `tar'.
+
+`intermix-type'
+ `-p' in `shar'.
+
+`iso-8601'
+ Used in `date'
+
+`jobs'
+ `-j' in Make.
+
+`just-print'
+ `-n' in Make.
+
+`keep-going'
+ `-k' in Make.
+
+`keep-files'
+ `-k' in `csplit'.
+
+`kilobytes'
+ `-k' in `du' and `ls'.
+
+`language'
+ `-l' in `etags'.
+
+`less-mode'
+ `-l' in `wdiff'.
+
+`level-for-gzip'
+ `-g' in `shar'.
+
+`line-bytes'
+ `-C' in `split'.
+
+`lines'
+ Used in `split', `head', and `tail'.
+
+`link'
+ `-l' in `cpio'.
+
+`lint'
+`lint-old'
+ Used in `gawk'.
+
+`list'
+ `-t' in `cpio'; `-l' in `recode'.
+
+`list'
+ `-t' in `tar'.
+
+`literal'
+ `-N' in `ls'.
+
+`load-average'
+ `-l' in Make.
+
+`login'
+ Used in `su'.
+
+`machine'
+ Used in `uname'.
+
+`macro-name'
+ `-M' in `ptx'.
+
+`mail'
+ `-m' in `hello' and `uname'.
+
+`make-directories'
+ `-d' in `cpio'.
+
+`makefile'
+ `-f' in Make.
+
+`mapped'
+ Used in GDB.
+
+`max-args'
+ `-n' in `xargs'.
+
+`max-chars'
+ `-n' in `xargs'.
+
+`max-lines'
+ `-l' in `xargs'.
+
+`max-load'
+ `-l' in Make.
+
+`max-procs'
+ `-P' in `xargs'.
+
+`mesg'
+ `-T' in `who'.
+
+`message'
+ `-T' in `who'.
+
+`minimal'
+ `-d' in `diff'.
+
+`mixed-uuencode'
+ `-M' in `shar'.
+
+`mode'
+ `-m' in `install', `mkdir', and `mkfifo'.
+
+`modification-time'
+ `-m' in `tar'.
+
+`multi-volume'
+ `-M' in `tar'.
+
+`name-prefix'
+ `-a' in Bison.
+
+`nesting-limit'
+ `-L' in `m4'.
+
+`net-headers'
+ `-a' in `shar'.
+
+`new-file'
+ `-W' in Make.
+
+`no-builtin-rules'
+ `-r' in Make.
+
+`no-character-count'
+ `-w' in `shar'.
+
+`no-check-existing'
+ `-x' in `shar'.
+
+`no-common'
+ `-3' in `wdiff'.
+
+`no-create'
+ `-c' in `touch'.
+
+`no-defines'
+ `-D' in `etags'.
+
+`no-deleted'
+ `-1' in `wdiff'.
+
+`no-dereference'
+ `-d' in `cp'.
+
+`no-inserted'
+ `-2' in `wdiff'.
+
+`no-keep-going'
+ `-S' in Make.
+
+`no-lines'
+ `-l' in Bison.
+
+`no-piping'
+ `-P' in `shar'.
+
+`no-prof'
+ `-e' in `gprof'.
+
+`no-regex'
+ `-R' in `etags'.
+
+`no-sort'
+ `-p' in `nm'.
+
+`no-splash'
+ Don't print a startup splash screen.
+
+`no-split'
+ Used in `makeinfo'.
+
+`no-static'
+ `-a' in `gprof'.
+
+`no-time'
+ `-E' in `gprof'.
+
+`no-timestamp'
+ `-m' in `shar'.
+
+`no-validate'
+ Used in `makeinfo'.
+
+`no-wait'
+ Used in `emacsclient'.
+
+`no-warn'
+ Used in various programs to inhibit warnings.
+
+`node'
+ `-n' in `info'.
+
+`nodename'
+ `-n' in `uname'.
+
+`nonmatching'
+ `-f' in `cpio'.
+
+`nstuff'
+ `-n' in `objdump'.
+
+`null'
+ `-0' in `xargs'.
+
+`number'
+ `-n' in `cat'.
+
+`number-nonblank'
+ `-b' in `cat'.
+
+`numeric-sort'
+ `-n' in `nm'.
+
+`numeric-uid-gid'
+ `-n' in `cpio' and `ls'.
+
+`nx'
+ Used in GDB.
+
+`old-archive'
+ `-o' in `tar'.
+
+`old-file'
+ `-o' in Make.
+
+`one-file-system'
+ `-l' in `tar', `cp', and `du'.
+
+`only-file'
+ `-o' in `ptx'.
+
+`only-prof'
+ `-f' in `gprof'.
+
+`only-time'
+ `-F' in `gprof'.
+
+`options'
+ `-o' in `getopt', `fdlist', `fdmount', `fdmountd', and `fdumount'.
+
+`output'
+ In various programs, specify the output file name.
+
+`output-prefix'
+ `-o' in `shar'.
+
+`override'
+ `-o' in `rm'.
+
+`overwrite'
+ `-c' in `unshar'.
+
+`owner'
+ `-o' in `install'.
+
+`paginate'
+ `-l' in `diff'.
+
+`paragraph-indent'
+ Used in `makeinfo'.
+
+`parents'
+ `-p' in `mkdir' and `rmdir'.
+
+`pass-all'
+ `-p' in `ul'.
+
+`pass-through'
+ `-p' in `cpio'.
+
+`port'
+ `-P' in `finger'.
+
+`portability'
+ `-c' in `cpio' and `tar'.
+
+`posix'
+ Used in `gawk'.
+
+`prefix-builtins'
+ `-P' in `m4'.
+
+`prefix'
+ `-f' in `csplit'.
+
+`preserve'
+ Used in `tar' and `cp'.
+
+`preserve-environment'
+ `-p' in `su'.
+
+`preserve-modification-time'
+ `-m' in `cpio'.
+
+`preserve-order'
+ `-s' in `tar'.
+
+`preserve-permissions'
+ `-p' in `tar'.
+
+`print'
+ `-l' in `diff'.
+
+`print-chars'
+ `-L' in `cmp'.
+
+`print-data-base'
+ `-p' in Make.
+
+`print-directory'
+ `-w' in Make.
+
+`print-file-name'
+ `-o' in `nm'.
+
+`print-symdefs'
+ `-s' in `nm'.
+
+`printer'
+ `-p' in `wdiff'.
+
+`prompt'
+ `-p' in `ed'.
+
+`proxy'
+ Specify an HTTP proxy.
+
+`query-user'
+ `-X' in `shar'.
+
+`question'
+ `-q' in Make.
+
+`quiet'
+ Used in many programs to inhibit the usual output. Every program
+ accepting `--quiet' should accept `--silent' as a synonym.
+
+`quiet-unshar'
+ `-Q' in `shar'
+
+`quote-name'
+ `-Q' in `ls'.
+
+`rcs'
+ `-n' in `diff'.
+
+`re-interval'
+ Used in `gawk'.
+
+`read-full-blocks'
+ `-B' in `tar'.
+
+`readnow'
+ Used in GDB.
+
+`recon'
+ `-n' in Make.
+
+`record-number'
+ `-R' in `tar'.
+
+`recursive'
+ Used in `chgrp', `chown', `cp', `ls', `diff', and `rm'.
+
+`reference-limit'
+ Used in `makeinfo'.
+
+`references'
+ `-r' in `ptx'.
+
+`regex'
+ `-r' in `tac' and `etags'.
+
+`release'
+ `-r' in `uname'.
+
+`reload-state'
+ `-R' in `m4'.
+
+`relocation'
+ `-r' in `objdump'.
+
+`rename'
+ `-r' in `cpio'.
+
+`replace'
+ `-i' in `xargs'.
+
+`report-identical-files'
+ `-s' in `diff'.
+
+`reset-access-time'
+ `-a' in `cpio'.
+
+`reverse'
+ `-r' in `ls' and `nm'.
+
+`reversed-ed'
+ `-f' in `diff'.
+
+`right-side-defs'
+ `-R' in `ptx'.
+
+`same-order'
+ `-s' in `tar'.
+
+`same-permissions'
+ `-p' in `tar'.
+
+`save'
+ `-g' in `stty'.
+
+`se'
+ Used in GDB.
+
+`sentence-regexp'
+ `-S' in `ptx'.
+
+`separate-dirs'
+ `-S' in `du'.
+
+`separator'
+ `-s' in `tac'.
+
+`sequence'
+ Used by `recode' to chose files or pipes for sequencing passes.
+
+`shell'
+ `-s' in `su'.
+
+`show-all'
+ `-A' in `cat'.
+
+`show-c-function'
+ `-p' in `diff'.
+
+`show-ends'
+ `-E' in `cat'.
+
+`show-function-line'
+ `-F' in `diff'.
+
+`show-tabs'
+ `-T' in `cat'.
+
+`silent'
+ Used in many programs to inhibit the usual output. Every program
+ accepting `--silent' should accept `--quiet' as a synonym.
+
+`size'
+ `-s' in `ls'.
+
+`socket'
+ Specify a file descriptor for a network server to use for its
+ socket, instead of opening and binding a new socket. This
+ provides a way to run, in a non-privileged process, a server that
+ normally needs a reserved port number.
+
+`sort'
+ Used in `ls'.
+
+`source'
+ `-W source' in `gawk'.
+
+`sparse'
+ `-S' in `tar'.
+
+`speed-large-files'
+ `-H' in `diff'.
+
+`split-at'
+ `-E' in `unshar'.
+
+`split-size-limit'
+ `-L' in `shar'.
+
+`squeeze-blank'
+ `-s' in `cat'.
+
+`start-delete'
+ `-w' in `wdiff'.
+
+`start-insert'
+ `-y' in `wdiff'.
+
+`starting-file'
+ Used in `tar' and `diff' to specify which file within a directory
+ to start processing with.
+
+`statistics'
+ `-s' in `wdiff'.
+
+`stdin-file-list'
+ `-S' in `shar'.
+
+`stop'
+ `-S' in Make.
+
+`strict'
+ `-s' in `recode'.
+
+`strip'
+ `-s' in `install'.
+
+`strip-all'
+ `-s' in `strip'.
+
+`strip-debug'
+ `-S' in `strip'.
+
+`submitter'
+ `-s' in `shar'.
+
+`suffix'
+ `-S' in `cp', `ln', `mv'.
+
+`suffix-format'
+ `-b' in `csplit'.
+
+`sum'
+ `-s' in `gprof'.
+
+`summarize'
+ `-s' in `du'.
+
+`symbolic'
+ `-s' in `ln'.
+
+`symbols'
+ Used in GDB and `objdump'.
+
+`synclines'
+ `-s' in `m4'.
+
+`sysname'
+ `-s' in `uname'.
+
+`tabs'
+ `-t' in `expand' and `unexpand'.
+
+`tabsize'
+ `-T' in `ls'.
+
+`terminal'
+ `-T' in `tput' and `ul'. `-t' in `wdiff'.
+
+`text'
+ `-a' in `diff'.
+
+`text-files'
+ `-T' in `shar'.
+
+`time'
+ Used in `ls' and `touch'.
+
+`timeout'
+ Specify how long to wait before giving up on some operation.
+
+`to-stdout'
+ `-O' in `tar'.
+
+`total'
+ `-c' in `du'.
+
+`touch'
+ `-t' in Make, `ranlib', and `recode'.
+
+`trace'
+ `-t' in `m4'.
+
+`traditional'
+ `-t' in `hello'; `-W traditional' in `gawk'; `-G' in `ed', `m4',
+ and `ptx'.
+
+`tty'
+ Used in GDB.
+
+`typedefs'
+ `-t' in `ctags'.
+
+`typedefs-and-c++'
+ `-T' in `ctags'.
+
+`typeset-mode'
+ `-t' in `ptx'.
+
+`uncompress'
+ `-z' in `tar'.
+
+`unconditional'
+ `-u' in `cpio'.
+
+`undefine'
+ `-U' in `m4'.
+
+`undefined-only'
+ `-u' in `nm'.
+
+`update'
+ `-u' in `cp', `ctags', `mv', `tar'.
+
+`usage'
+ Used in `gawk'; same as `--help'.
+
+`uuencode'
+ `-B' in `shar'.
+
+`vanilla-operation'
+ `-V' in `shar'.
+
+`verbose'
+ Print more information about progress. Many programs support this.
+
+`verify'
+ `-W' in `tar'.
+
+`version'
+ Print the version number.
+
+`version-control'
+ `-V' in `cp', `ln', `mv'.
+
+`vgrind'
+ `-v' in `ctags'.
+
+`volume'
+ `-V' in `tar'.
+
+`what-if'
+ `-W' in Make.
+
+`whole-size-limit'
+ `-l' in `shar'.
+
+`width'
+ `-w' in `ls' and `ptx'.
+
+`word-regexp'
+ `-W' in `ptx'.
+
+`writable'
+ `-T' in `who'.
+
+`zeros'
+ `-z' in `gprof'.
+
+
+File: standards.info, Node: Memory Usage, Next: File Usage, Prev: Option Table, Up: Program Behavior
+
+4.9 Memory Usage
+================
+
+If a program typically uses just a few meg of memory, don't bother
+making any effort to reduce memory usage. For example, if it is
+impractical for other reasons to operate on files more than a few meg
+long, it is reasonable to read entire input files into memory to
+operate on them.
+
+ However, for programs such as `cat' or `tail', that can usefully
+operate on very large files, it is important to avoid using a technique
+that would artificially limit the size of files it can handle. If a
+program works by lines and could be applied to arbitrary user-supplied
+input files, it should keep only a line in memory, because this is not
+very hard and users will want to be able to operate on input files that
+are bigger than will fit in memory all at once.
+
+ If your program creates complicated data structures, just make them
+in memory and give a fatal error if `malloc' returns zero.
+
+
+File: standards.info, Node: File Usage, Prev: Memory Usage, Up: Program Behavior
+
+4.10 File Usage
+===============
+
+Programs should be prepared to operate when `/usr' and `/etc' are
+read-only file systems. Thus, if the program manages log files, lock
+files, backup files, score files, or any other files which are modified
+for internal purposes, these files should not be stored in `/usr' or
+`/etc'.
+
+ There are two exceptions. `/etc' is used to store system
+configuration information; it is reasonable for a program to modify
+files in `/etc' when its job is to update the system configuration.
+Also, if the user explicitly asks to modify one file in a directory, it
+is reasonable for the program to store other files in the same
+directory.
+
+
+File: standards.info, Node: Writing C, Next: Documentation, Prev: Program Behavior, Up: Top
+
+5 Making The Best Use of C
+**************************
+
+This chapter provides advice on how best to use the C language when
+writing GNU software.
+
+* Menu:
+
+* Formatting:: Formatting your source code.
+* Comments:: Commenting your work.
+* Syntactic Conventions:: Clean use of C constructs.
+* Names:: Naming variables, functions, and files.
+* System Portability:: Portability among different operating systems.
+* CPU Portability:: Supporting the range of CPU types.
+* System Functions:: Portability and ``standard'' library functions.
+* Internationalization:: Techniques for internationalization.
+* Character Set:: Use ASCII by default.
+* Quote Characters:: Use `...' in the C locale.
+* Mmap:: How you can safely use `mmap'.
+
+
+File: standards.info, Node: Formatting, Next: Comments, Up: Writing C
+
+5.1 Formatting Your Source Code
+===============================
+
+It is important to put the open-brace that starts the body of a C
+function in column one, so that they will start a defun. Several tools
+look for open-braces in column one to find the beginnings of C
+functions. These tools will not work on code not formatted that way.
+
+ Avoid putting open-brace, open-parenthesis or open-bracket in column
+one when they are inside a function, so that they won't start a defun.
+The open-brace that starts a `struct' body can go in column one if you
+find it useful to treat that definition as a defun.
+
+ It is also important for function definitions to start the name of
+the function in column one. This helps people to search for function
+definitions, and may also help certain tools recognize them. Thus,
+using Standard C syntax, the format is this:
+
+ static char *
+ concat (char *s1, char *s2)
+ {
+ ...
+ }
+
+or, if you want to use traditional C syntax, format the definition like
+this:
+
+ static char *
+ concat (s1, s2) /* Name starts in column one here */
+ char *s1, *s2;
+ { /* Open brace in column one here */
+ ...
+ }
+
+ In Standard C, if the arguments don't fit nicely on one line, split
+it like this:
+
+ int
+ lots_of_args (int an_integer, long a_long, short a_short,
+ double a_double, float a_float)
+ ...
+
+ The rest of this section gives our recommendations for other aspects
+of C formatting style, which is also the default style of the `indent'
+program in version 1.2 and newer. It corresponds to the options
+
+ -nbad -bap -nbc -bbo -bl -bli2 -bls -ncdb -nce -cp1 -cs -di2
+ -ndj -nfc1 -nfca -hnl -i2 -ip5 -lp -pcs -psl -nsc -nsob
+
+ We don't think of these recommendations as requirements, because it
+causes no problems for users if two different programs have different
+formatting styles.
+
+ But whatever style you use, please use it consistently, since a
+mixture of styles within one program tends to look ugly. If you are
+contributing changes to an existing program, please follow the style of
+that program.
+
+ For the body of the function, our recommended style looks like this:
+
+ if (x < foo (y, z))
+ haha = bar[4] + 5;
+ else
+ {
+ while (z)
+ {
+ haha += foo (z, z);
+ z--;
+ }
+ return ++x + bar ();
+ }
+
+ We find it easier to read a program when it has spaces before the
+open-parentheses and after the commas. Especially after the commas.
+
+ When you split an expression into multiple lines, split it before an
+operator, not after one. Here is the right way:
+
+ if (foo_this_is_long && bar > win (x, y, z)
+ && remaining_condition)
+
+ Try to avoid having two operators of different precedence at the same
+level of indentation. For example, don't write this:
+
+ mode = (inmode[j] == VOIDmode
+ || GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j])
+ ? outmode[j] : inmode[j]);
+
+ Instead, use extra parentheses so that the indentation shows the
+nesting:
+
+ mode = ((inmode[j] == VOIDmode
+ || (GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j])))
+ ? outmode[j] : inmode[j]);
+
+ Insert extra parentheses so that Emacs will indent the code properly.
+For example, the following indentation looks nice if you do it by hand,
+
+ v = rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000
+ + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000;
+
+but Emacs would alter it. Adding a set of parentheses produces
+something that looks equally nice, and which Emacs will preserve:
+
+ v = (rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000
+ + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000);
+
+ Format do-while statements like this:
+
+ do
+ {
+ a = foo (a);
+ }
+ while (a > 0);
+
+ Please use formfeed characters (control-L) to divide the program into
+pages at logical places (but not within a function). It does not matter
+just how long the pages are, since they do not have to fit on a printed
+page. The formfeeds should appear alone on lines by themselves.
+
+
+File: standards.info, Node: Comments, Next: Syntactic Conventions, Prev: Formatting, Up: Writing C
+
+5.2 Commenting Your Work
+========================
+
+Every program should start with a comment saying briefly what it is for.
+Example: `fmt - filter for simple filling of text'. This comment
+should be at the top of the source file containing the `main' function
+of the program.
+
+ Also, please write a brief comment at the start of each source file,
+with the file name and a line or two about the overall purpose of the
+file.
+
+ Please write the comments in a GNU program in English, because
+English is the one language that nearly all programmers in all
+countries can read. If you do not write English well, please write
+comments in English as well as you can, then ask other people to help
+rewrite them. If you can't write comments in English, please find
+someone to work with you and translate your comments into English.
+
+ Please put a comment on each function saying what the function does,
+what sorts of arguments it gets, and what the possible values of
+arguments mean and are used for. It is not necessary to duplicate in
+words the meaning of the C argument declarations, if a C type is being
+used in its customary fashion. If there is anything nonstandard about
+its use (such as an argument of type `char *' which is really the
+address of the second character of a string, not the first), or any
+possible values that would not work the way one would expect (such as,
+that strings containing newlines are not guaranteed to work), be sure
+to say so.
+
+ Also explain the significance of the return value, if there is one.
+
+ Please put two spaces after the end of a sentence in your comments,
+so that the Emacs sentence commands will work. Also, please write
+complete sentences and capitalize the first word. If a lower-case
+identifier comes at the beginning of a sentence, don't capitalize it!
+Changing the spelling makes it a different identifier. If you don't
+like starting a sentence with a lower case letter, write the sentence
+differently (e.g., "The identifier lower-case is ...").
+
+ The comment on a function is much clearer if you use the argument
+names to speak about the argument values. The variable name itself
+should be lower case, but write it in upper case when you are speaking
+about the value rather than the variable itself. Thus, "the inode
+number NODE_NUM" rather than "an inode".
+
+ There is usually no purpose in restating the name of the function in
+the comment before it, because the reader can see that for himself.
+There might be an exception when the comment is so long that the
+function itself would be off the bottom of the screen.
+
+ There should be a comment on each static variable as well, like this:
+
+ /* Nonzero means truncate lines in the display;
+ zero means continue them. */
+ int truncate_lines;
+
+ Every `#endif' should have a comment, except in the case of short
+conditionals (just a few lines) that are not nested. The comment should
+state the condition of the conditional that is ending, _including its
+sense_. `#else' should have a comment describing the condition _and
+sense_ of the code that follows. For example:
+
+ #ifdef foo
+ ...
+ #else /* not foo */
+ ...
+ #endif /* not foo */
+ #ifdef foo
+ ...
+ #endif /* foo */
+
+but, by contrast, write the comments this way for a `#ifndef':
+
+ #ifndef foo
+ ...
+ #else /* foo */
+ ...
+ #endif /* foo */
+ #ifndef foo
+ ...
+ #endif /* not foo */
+
+
+File: standards.info, Node: Syntactic Conventions, Next: Names, Prev: Comments, Up: Writing C
+
+5.3 Clean Use of C Constructs
+=============================
+
+Please explicitly declare the types of all objects. For example, you
+should explicitly declare all arguments to functions, and you should
+declare functions to return `int' rather than omitting the `int'.
+
+ Some programmers like to use the GCC `-Wall' option, and change the
+code whenever it issues a warning. If you want to do this, then do.
+Other programmers prefer not to use `-Wall', because it gives warnings
+for valid and legitimate code which they do not want to change. If you
+want to do this, then do. The compiler should be your servant, not
+your master.
+
+ Declarations of external functions and functions to appear later in
+the source file should all go in one place near the beginning of the
+file (somewhere before the first function definition in the file), or
+else should go in a header file. Don't put `extern' declarations inside
+functions.
+
+ It used to be common practice to use the same local variables (with
+names like `tem') over and over for different values within one
+function. Instead of doing this, it is better to declare a separate
+local variable for each distinct purpose, and give it a name which is
+meaningful. This not only makes programs easier to understand, it also
+facilitates optimization by good compilers. You can also move the
+declaration of each local variable into the smallest scope that includes
+all its uses. This makes the program even cleaner.
+
+ Don't use local variables or parameters that shadow global
+identifiers.
+
+ Don't declare multiple variables in one declaration that spans lines.
+Start a new declaration on each line, instead. For example, instead of
+this:
+
+ int foo,
+ bar;
+
+write either this:
+
+ int foo, bar;
+
+or this:
+
+ int foo;
+ int bar;
+
+(If they are global variables, each should have a comment preceding it
+anyway.)
+
+ When you have an `if'-`else' statement nested in another `if'
+statement, always put braces around the `if'-`else'. Thus, never write
+like this:
+
+ if (foo)
+ if (bar)
+ win ();
+ else
+ lose ();
+
+always like this:
+
+ if (foo)
+ {
+ if (bar)
+ win ();
+ else
+ lose ();
+ }
+
+ If you have an `if' statement nested inside of an `else' statement,
+either write `else if' on one line, like this,
+
+ if (foo)
+ ...
+ else if (bar)
+ ...
+
+with its `then'-part indented like the preceding `then'-part, or write
+the nested `if' within braces like this:
+
+ if (foo)
+ ...
+ else
+ {
+ if (bar)
+ ...
+ }
+
+ Don't declare both a structure tag and variables or typedefs in the
+same declaration. Instead, declare the structure tag separately and
+then use it to declare the variables or typedefs.
+
+ Try to avoid assignments inside `if'-conditions (assignments inside
+`while'-conditions are ok). For example, don't write this:
+
+ if ((foo = (char *) malloc (sizeof *foo)) == 0)
+ fatal ("virtual memory exhausted");
+
+instead, write this:
+
+ foo = (char *) malloc (sizeof *foo);
+ if (foo == 0)
+ fatal ("virtual memory exhausted");
+
+ Don't make the program ugly to placate `lint'. Please don't insert
+any casts to `void'. Zero without a cast is perfectly fine as a null
+pointer constant, except when calling a varargs function.
+
+
+File: standards.info, Node: Names, Next: System Portability, Prev: Syntactic Conventions, Up: Writing C
+
+5.4 Naming Variables, Functions, and Files
+==========================================
+
+The names of global variables and functions in a program serve as
+comments of a sort. So don't choose terse names--instead, look for
+names that give useful information about the meaning of the variable or
+function. In a GNU program, names should be English, like other
+comments.
+
+ Local variable names can be shorter, because they are used only
+within one context, where (presumably) comments explain their purpose.
+
+ Try to limit your use of abbreviations in symbol names. It is ok to
+make a few abbreviations, explain what they mean, and then use them
+frequently, but don't use lots of obscure abbreviations.
+
+ Please use underscores to separate words in a name, so that the Emacs
+word commands can be useful within them. Stick to lower case; reserve
+upper case for macros and `enum' constants, and for name-prefixes that
+follow a uniform convention.
+
+ For example, you should use names like `ignore_space_change_flag';
+don't use names like `iCantReadThis'.
+
+ Variables that indicate whether command-line options have been
+specified should be named after the meaning of the option, not after
+the option-letter. A comment should state both the exact meaning of
+the option and its letter. For example,
+
+ /* Ignore changes in horizontal whitespace (-b). */
+ int ignore_space_change_flag;
+
+ When you want to define names with constant integer values, use
+`enum' rather than `#define'. GDB knows about enumeration constants.
+
+ You might want to make sure that none of the file names would
+conflict if the files were loaded onto an MS-DOS file system which
+shortens the names. You can use the program `doschk' to test for this.
+
+ Some GNU programs were designed to limit themselves to file names of
+14 characters or less, to avoid file name conflicts if they are read
+into older System V systems. Please preserve this feature in the
+existing GNU programs that have it, but there is no need to do this in
+new GNU programs. `doschk' also reports file names longer than 14
+characters.
+
+
+File: standards.info, Node: System Portability, Next: CPU Portability, Prev: Names, Up: Writing C
+
+5.5 Portability between System Types
+====================================
+
+In the Unix world, "portability" refers to porting to different Unix
+versions. For a GNU program, this kind of portability is desirable, but
+not paramount.
+
+ The primary purpose of GNU software is to run on top of the GNU
+kernel, compiled with the GNU C compiler, on various types of CPU. So
+the kinds of portability that are absolutely necessary are quite
+limited. But it is important to support Linux-based GNU systems, since
+they are the form of GNU that is popular.
+
+ Beyond that, it is good to support the other free operating systems
+(*BSD), and it is nice to support other Unix-like systems if you want
+to. Supporting a variety of Unix-like systems is desirable, although
+not paramount. It is usually not too hard, so you may as well do it.
+But you don't have to consider it an obligation, if it does turn out to
+be hard.
+
+ The easiest way to achieve portability to most Unix-like systems is
+to use Autoconf. It's unlikely that your program needs to know more
+information about the host platform than Autoconf can provide, simply
+because most of the programs that need such knowledge have already been
+written.
+
+ Avoid using the format of semi-internal data bases (e.g.,
+directories) when there is a higher-level alternative (`readdir').
+
+ As for systems that are not like Unix, such as MSDOS, Windows, VMS,
+MVS, and older Macintosh systems, supporting them is often a lot of
+work. When that is the case, it is better to spend your time adding
+features that will be useful on GNU and GNU/Linux, rather than on
+supporting other incompatible systems.
+
+ If you do support Windows, please do not abbreviate it as "win". In
+hacker terminology, calling something a "win" is a form of praise.
+You're free to praise Microsoft Windows on your own if you want, but
+please don't do this in GNU packages. Instead of abbreviating
+"Windows" to "un", you can write it in full or abbreviate it to "woe"
+or "w". In GNU Emacs, for instance, we use `w32' in file names of
+Windows-specific files, but the macro for Windows conditionals is
+called `WINDOWSNT'.
+
+ It is a good idea to define the "feature test macro" `_GNU_SOURCE'
+when compiling your C files. When you compile on GNU or GNU/Linux,
+this will enable the declarations of GNU library extension functions,
+and that will usually give you a compiler error message if you define
+the same function names in some other way in your program. (You don't
+have to actually _use_ these functions, if you prefer to make the
+program more portable to other systems.)
+
+ But whether or not you use these GNU extensions, you should avoid
+using their names for any other meanings. Doing so would make it hard
+to move your code into other GNU programs.
+
+
+File: standards.info, Node: CPU Portability, Next: System Functions, Prev: System Portability, Up: Writing C
+
+5.6 Portability between CPUs
+============================
+
+Even GNU systems will differ because of differences among CPU
+types--for example, difference in byte ordering and alignment
+requirements. It is absolutely essential to handle these differences.
+However, don't make any effort to cater to the possibility that an
+`int' will be less than 32 bits. We don't support 16-bit machines in
+GNU.
+
+ Similarly, don't make any effort to cater to the possibility that
+`long' will be smaller than predefined types like `size_t'. For
+example, the following code is ok:
+
+ printf ("size = %lu\n", (unsigned long) sizeof array);
+ printf ("diff = %ld\n", (long) (pointer2 - pointer1));
+
+ 1989 Standard C requires this to work, and we know of only one
+counterexample: 64-bit programs on Microsoft Windows. We will leave it
+to those who want to port GNU programs to that environment to figure
+out how to do it.
+
+ Predefined file-size types like `off_t' are an exception: they are
+longer than `long' on many platforms, so code like the above won't work
+with them. One way to print an `off_t' value portably is to print its
+digits yourself, one by one.
+
+ Don't assume that the address of an `int' object is also the address
+of its least-significant byte. This is false on big-endian machines.
+Thus, don't make the following mistake:
+
+ int c;
+ ...
+ while ((c = getchar ()) != EOF)
+ write (file_descriptor, &c, 1);
+
+Instead, use `unsigned char' as follows. (The `unsigned' is for
+portability to unusual systems where `char' is signed and where there
+is integer overflow checking.)
+
+ int c;
+ while ((c = getchar ()) != EOF)
+ {
+ unsigned char u = c;
+ write (file_descriptor, &u, 1);
+ }
+
+ It used to be ok to not worry about the difference between pointers
+and integers when passing arguments to functions. However, on most
+modern 64-bit machines pointers are wider than `int'. Conversely,
+integer types like `long long int' and `off_t' are wider than pointers
+on most modern 32-bit machines. Hence it's often better nowadays to
+use prototypes to define functions whose argument types are not trivial.
+
+ In particular, if functions accept varying argument counts or types
+they should be declared using prototypes containing `...' and defined
+using `stdarg.h'. For an example of this, please see the Gnulib
+(http://www.gnu.org/software/gnulib/) error module, which declares and
+defines the following function:
+
+ /* Print a message with `fprintf (stderr, FORMAT, ...)';
+ if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
+ If STATUS is nonzero, terminate the program with `exit (STATUS)'. */
+
+ void error (int status, int errnum, const char *format, ...);
+
+ A simple way to use the Gnulib error module is to obtain the two
+source files `error.c' and `error.h' from the Gnulib library source
+code repository at
+`http://savannah.gnu.org/cgi-bin/viewcvs/gnulib/gnulib/lib/'. Here's a
+sample use:
+
+ #include "error.h"
+ #include <errno.h>
+ #include <stdio.h>
+
+ char *program_name = "myprogram";
+
+ FILE *
+ xfopen (char const *name)
+ {
+ FILE *fp = fopen (name, "r");
+ if (! fp)
+ error (1, errno, "cannot read %s", name);
+ return fp;
+ }
+
+ Avoid casting pointers to integers if you can. Such casts greatly
+reduce portability, and in most programs they are easy to avoid. In the
+cases where casting pointers to integers is essential--such as, a Lisp
+interpreter which stores type information as well as an address in one
+word--you'll have to make explicit provisions to handle different word
+sizes. You will also need to make provision for systems in which the
+normal range of addresses you can get from `malloc' starts far away
+from zero.
+
+
+File: standards.info, Node: System Functions, Next: Internationalization, Prev: CPU Portability, Up: Writing C
+
+5.7 Calling System Functions
+============================
+
+C implementations differ substantially. Standard C reduces but does
+not eliminate the incompatibilities; meanwhile, many GNU packages still
+support pre-standard compilers because this is not hard to do. This
+chapter gives recommendations for how to use the more-or-less standard C
+library functions to avoid unnecessary loss of portability.
+
+ * Don't use the return value of `sprintf'. It returns the number of
+ characters written on some systems, but not on all systems.
+
+ * Be aware that `vfprintf' is not always available.
+
+ * `main' should be declared to return type `int'. It should
+ terminate either by calling `exit' or by returning the integer
+ status code; make sure it cannot ever return an undefined value.
+
+ * Don't declare system functions explicitly.
+
+ Almost any declaration for a system function is wrong on some
+ system. To minimize conflicts, leave it to the system header
+ files to declare system functions. If the headers don't declare a
+ function, let it remain undeclared.
+
+ While it may seem unclean to use a function without declaring it,
+ in practice this works fine for most system library functions on
+ the systems where this really happens; thus, the disadvantage is
+ only theoretical. By contrast, actual declarations have
+ frequently caused actual conflicts.
+
+ * If you must declare a system function, don't specify the argument
+ types. Use an old-style declaration, not a Standard C prototype.
+ The more you specify about the function, the more likely a
+ conflict.
+
+ * In particular, don't unconditionally declare `malloc' or `realloc'.
+
+ Most GNU programs use those functions just once, in functions
+ conventionally named `xmalloc' and `xrealloc'. These functions
+ call `malloc' and `realloc', respectively, and check the results.
+
+ Because `xmalloc' and `xrealloc' are defined in your program, you
+ can declare them in other files without any risk of type conflict.
+
+ On most systems, `int' is the same length as a pointer; thus, the
+ calls to `malloc' and `realloc' work fine. For the few
+ exceptional systems (mostly 64-bit machines), you can use
+ *conditionalized* declarations of `malloc' and `realloc'--or put
+ these declarations in configuration files specific to those
+ systems.
+
+ * The string functions require special treatment. Some Unix systems
+ have a header file `string.h'; others have `strings.h'. Neither
+ file name is portable. There are two things you can do: use
+ Autoconf to figure out which file to include, or don't include
+ either file.
+
+ * If you don't include either strings file, you can't get
+ declarations for the string functions from the header file in the
+ usual way.
+
+ That causes less of a problem than you might think. The newer
+ standard string functions should be avoided anyway because many
+ systems still don't support them. The string functions you can
+ use are these:
+
+ strcpy strncpy strcat strncat
+ strlen strcmp strncmp
+ strchr strrchr
+
+ The copy and concatenate functions work fine without a declaration
+ as long as you don't use their values. Using their values without
+ a declaration fails on systems where the width of a pointer
+ differs from the width of `int', and perhaps in other cases. It
+ is trivial to avoid using their values, so do that.
+
+ The compare functions and `strlen' work fine without a declaration
+ on most systems, possibly all the ones that GNU software runs on.
+ You may find it necessary to declare them *conditionally* on a few
+ systems.
+
+ The search functions must be declared to return `char *'. Luckily,
+ there is no variation in the data type they return. But there is
+ variation in their names. Some systems give these functions the
+ names `index' and `rindex'; other systems use the names `strchr'
+ and `strrchr'. Some systems support both pairs of names, but
+ neither pair works on all systems.
+
+ You should pick a single pair of names and use it throughout your
+ program. (Nowadays, it is better to choose `strchr' and `strrchr'
+ for new programs, since those are the standard names.) Declare
+ both of those names as functions returning `char *'. On systems
+ which don't support those names, define them as macros in terms of
+ the other pair. For example, here is what to put at the beginning
+ of your file (or in a header) if you want to use the names
+ `strchr' and `strrchr' throughout:
+
+ #ifndef HAVE_STRCHR
+ #define strchr index
+ #endif
+ #ifndef HAVE_STRRCHR
+ #define strrchr rindex
+ #endif
+
+ char *strchr ();
+ char *strrchr ();
+
+ Here we assume that `HAVE_STRCHR' and `HAVE_STRRCHR' are macros
+defined in systems where the corresponding functions exist. One way to
+get them properly defined is to use Autoconf.
+
+
+File: standards.info, Node: Internationalization, Next: Character Set, Prev: System Functions, Up: Writing C
+
+5.8 Internationalization
+========================
+
+GNU has a library called GNU gettext that makes it easy to translate the
+messages in a program into various languages. You should use this
+library in every program. Use English for the messages as they appear
+in the program, and let gettext provide the way to translate them into
+other languages.
+
+ Using GNU gettext involves putting a call to the `gettext' macro
+around each string that might need translation--like this:
+
+ printf (gettext ("Processing file `%s'..."));
+
+This permits GNU gettext to replace the string `"Processing file
+`%s'..."' with a translated version.
+
+ Once a program uses gettext, please make a point of writing calls to
+`gettext' when you add new strings that call for translation.
+
+ Using GNU gettext in a package involves specifying a "text domain
+name" for the package. The text domain name is used to separate the
+translations for this package from the translations for other packages.
+Normally, the text domain name should be the same as the name of the
+package--for example, `coreutils' for the GNU core utilities.
+
+ To enable gettext to work well, avoid writing code that makes
+assumptions about the structure of words or sentences. When you want
+the precise text of a sentence to vary depending on the data, use two or
+more alternative string constants each containing a complete sentences,
+rather than inserting conditionalized words or phrases into a single
+sentence framework.
+
+ Here is an example of what not to do:
+
+ printf ("%s is full", capacity > 5000000 ? "disk" : "floppy disk");
+
+ If you apply gettext to all strings, like this,
+
+ printf (gettext ("%s is full"),
+ capacity > 5000000 ? gettext ("disk") : gettext ("floppy disk"));
+
+the translator will hardly know that "disk" and "floppy disk" are meant
+to be substituted in the other string. Worse, in some languages (like
+French) the construction will not work: the translation of the word
+"full" depends on the gender of the first part of the sentence; it
+happens to be not the same for "disk" as for "floppy disk".
+
+ Complete sentences can be translated without problems:
+
+ printf (capacity > 5000000 ? gettext ("disk is full")
+ : gettext ("floppy disk is full"));
+
+ A similar problem appears at the level of sentence structure with
+this code:
+
+ printf ("# Implicit rule search has%s been done.\n",
+ f->tried_implicit ? "" : " not");
+
+Adding `gettext' calls to this code cannot give correct results for all
+languages, because negation in some languages requires adding words at
+more than one place in the sentence. By contrast, adding `gettext'
+calls does the job straightforwardly if the code starts out like this:
+
+ printf (f->tried_implicit
+ ? "# Implicit rule search has been done.\n",
+ : "# Implicit rule search has not been done.\n");
+
+ Another example is this one:
+
+ printf ("%d file%s processed", nfiles,
+ nfiles != 1 ? "s" : "");
+
+The problem with this example is that it assumes that plurals are made
+by adding `s'. If you apply gettext to the format string, like this,
+
+ printf (gettext ("%d file%s processed"), nfiles,
+ nfiles != 1 ? "s" : "");
+
+the message can use different words, but it will still be forced to use
+`s' for the plural. Here is a better way, with gettext being applied to
+the two strings independently:
+
+ printf ((nfiles != 1 ? gettext ("%d files processed")
+ : gettext ("%d file processed")),
+ nfiles);
+
+But this still doesn't work for languages like Polish, which has three
+plural forms: one for nfiles == 1, one for nfiles == 2, 3, 4, 22, 23,
+24, ... and one for the rest. The GNU `ngettext' function solves this
+problem:
+
+ printf (ngettext ("%d files processed", "%d file processed", nfiles),
+ nfiles);
+
+
+File: standards.info, Node: Character Set, Next: Quote Characters, Prev: Internationalization, Up: Writing C
+
+5.9 Character Set
+=================
+
+Sticking to the ASCII character set (plain text, 7-bit characters) is
+preferred in GNU source code comments, text documents, and other
+contexts, unless there is good reason to do something else because of
+the application domain. For example, if source code deals with the
+French Revolutionary calendar, it is OK if its literal strings contain
+accented characters in month names like "Flore'al". Also, it is OK to
+use non-ASCII characters to represent proper names of contributors in
+change logs (*note Change Logs::).
+
+ If you need to use non-ASCII characters, you should normally stick
+with one encoding, as one cannot in general mix encodings reliably.
+
+
+File: standards.info, Node: Quote Characters, Next: Mmap, Prev: Character Set, Up: Writing C
+
+5.10 Quote Characters
+=====================
+
+In the C locale, GNU programs should stick to plain ASCII for quotation
+characters in messages to users: preferably 0x60 (``') for left quotes
+and 0x27 (`'') for right quotes. It is ok, but not required, to use
+locale-specific quotes in other locales.
+
+ The Gnulib (http://www.gnu.org/software/gnulib/) `quote' and
+`quotearg' modules provide a reasonably straightforward way to support
+locale-specific quote characters, as well as taking care of other
+issues, such as quoting a filename that itself contains a quote
+character. See the Gnulib documentation for usage details.
+
+ In any case, the documentation for your program should clearly
+specify how it does quoting, if different than the preferred method of
+``' and `''. This is especially important if the output of your
+program is ever likely to be parsed by another program.
+
+ Quotation characters are a difficult area in the computing world at
+this time: there are no true left or right quote characters in Latin1;
+the ``' character we use was standardized there as a grave accent.
+Moreover, Latin1 is still not universally usable.
+
+ Unicode contains the unambiguous quote characters required, and its
+common encoding UTF-8 is upward compatible with Latin1. However,
+Unicode and UTF-8 are not universally well-supported, either.
+
+ This may change over the next few years, and then we will revisit
+this.
+
+
+File: standards.info, Node: Mmap, Prev: Quote Characters, Up: Writing C
+
+5.11 Mmap
+=========
+
+Don't assume that `mmap' either works on all files or fails for all
+files. It may work on some files and fail on others.
+
+ The proper way to use `mmap' is to try it on the specific file for
+which you want to use it--and if `mmap' doesn't work, fall back on
+doing the job in another way using `read' and `write'.
+
+ The reason this precaution is needed is that the GNU kernel (the
+HURD) provides a user-extensible file system, in which there can be many
+different kinds of "ordinary files." Many of them support `mmap', but
+some do not. It is important to make programs handle all these kinds
+of files.
+
+
+File: standards.info, Node: Documentation, Next: Managing Releases, Prev: Writing C, Up: Top
+
+6 Documenting Programs
+**********************
+
+A GNU program should ideally come with full free documentation, adequate
+for both reference and tutorial purposes. If the package can be
+programmed or extended, the documentation should cover programming or
+extending it, as well as just using it.
+
+* Menu:
+
+* GNU Manuals:: Writing proper manuals.
+* Doc Strings and Manuals:: Compiling doc strings doesn't make a manual.
+* Manual Structure Details:: Specific structure conventions.
+* License for Manuals:: Writing the distribution terms for a manual.
+* Manual Credits:: Giving credit to documentation contributors.
+* Printed Manuals:: Mentioning the printed manual.
+* NEWS File:: NEWS files supplement manuals.
+* Change Logs:: Recording changes.
+* Man Pages:: Man pages are secondary.
+* Reading other Manuals:: How far you can go in learning
+ from other manuals.
+
+
+File: standards.info, Node: GNU Manuals, Next: Doc Strings and Manuals, Up: Documentation
+
+6.1 GNU Manuals
+===============
+
+The preferred document format for the GNU system is the Texinfo
+formatting language. Every GNU package should (ideally) have
+documentation in Texinfo both for reference and for learners. Texinfo
+makes it possible to produce a good quality formatted book, using TeX,
+and to generate an Info file. It is also possible to generate HTML
+output from Texinfo source. See the Texinfo manual, either the
+hardcopy, or the on-line version available through `info' or the Emacs
+Info subsystem (`C-h i').
+
+ Nowadays some other formats such as Docbook and Sgmltexi can be
+converted automatically into Texinfo. It is ok to produce the Texinfo
+documentation by conversion this way, as long as it gives good results.
+
+ Make sure your manual is clear to a reader who knows nothing about
+the topic and reads it straight through. This means covering basic
+topics at the beginning, and advanced topics only later. This also
+means defining every specialized term when it is first used.
+
+ Programmers tend to carry over the structure of the program as the
+structure for its documentation. But this structure is not necessarily
+good for explaining how to use the program; it may be irrelevant and
+confusing for a user.
+
+ Instead, the right way to structure documentation is according to the
+concepts and questions that a user will have in mind when reading it.
+This principle applies at every level, from the lowest (ordering
+sentences in a paragraph) to the highest (ordering of chapter topics
+within the manual). Sometimes this structure of ideas matches the
+structure of the implementation of the software being documented--but
+often they are different. An important part of learning to write good
+documentation is to learn to notice when you have unthinkingly
+structured the documentation like the implementation, stop yourself,
+and look for better alternatives.
+
+ For example, each program in the GNU system probably ought to be
+documented in one manual; but this does not mean each program should
+have its own manual. That would be following the structure of the
+implementation, rather than the structure that helps the user
+understand.
+
+ Instead, each manual should cover a coherent _topic_. For example,
+instead of a manual for `diff' and a manual for `diff3', we have one
+manual for "comparison of files" which covers both of those programs,
+as well as `cmp'. By documenting these programs together, we can make
+the whole subject clearer.
+
+ The manual which discusses a program should certainly document all of
+the program's command-line options and all of its commands. It should
+give examples of their use. But don't organize the manual as a list of
+features. Instead, organize it logically, by subtopics. Address the
+questions that a user will ask when thinking about the job that the
+program does. Don't just tell the reader what each feature can do--say
+what jobs it is good for, and show how to use it for those jobs.
+Explain what is recommended usage, and what kinds of usage users should
+avoid.
+
+ In general, a GNU manual should serve both as tutorial and reference.
+It should be set up for convenient access to each topic through Info,
+and for reading straight through (appendixes aside). A GNU manual
+should give a good introduction to a beginner reading through from the
+start, and should also provide all the details that hackers want. The
+Bison manual is a good example of this--please take a look at it to see
+what we mean.
+
+ That is not as hard as it first sounds. Arrange each chapter as a
+logical breakdown of its topic, but order the sections, and write their
+text, so that reading the chapter straight through makes sense. Do
+likewise when structuring the book into chapters, and when structuring a
+section into paragraphs. The watchword is, _at each point, address the
+most fundamental and important issue raised by the preceding text._
+
+ If necessary, add extra chapters at the beginning of the manual which
+are purely tutorial and cover the basics of the subject. These provide
+the framework for a beginner to understand the rest of the manual. The
+Bison manual provides a good example of how to do this.
+
+ To serve as a reference, a manual should have an Index that list all
+the functions, variables, options, and important concepts that are part
+of the program. One combined Index should do for a short manual, but
+sometimes for a complex package it is better to use multiple indices.
+The Texinfo manual includes advice on preparing good index entries, see
+*Note Making Index Entries: (texinfo)Index Entries, and see *Note
+Defining the Entries of an Index: (texinfo)Indexing Commands.
+
+ Don't use Unix man pages as a model for how to write GNU
+documentation; most of them are terse, badly structured, and give
+inadequate explanation of the underlying concepts. (There are, of
+course, some exceptions.) Also, Unix man pages use a particular format
+which is different from what we use in GNU manuals.
+
+ Please include an email address in the manual for where to report
+bugs _in the text of the manual_.
+
+ Please do not use the term "pathname" that is used in Unix
+documentation; use "file name" (two words) instead. We use the term
+"path" only for search paths, which are lists of directory names.
+
+ Please do not use the term "illegal" to refer to erroneous input to
+a computer program. Please use "invalid" for this, and reserve the
+term "illegal" for activities prohibited by law.
+
+ Please do not write `()' after a function name just to indicate it
+is a function. `foo ()' is not a function, it is a function call with
+no arguments.
+
+
+File: standards.info, Node: Doc Strings and Manuals, Next: Manual Structure Details, Prev: GNU Manuals, Up: Documentation
+
+6.2 Doc Strings and Manuals
+===========================
+
+Some programming systems, such as Emacs, provide a documentation string
+for each function, command or variable. You may be tempted to write a
+reference manual by compiling the documentation strings and writing a
+little additional text to go around them--but you must not do it. That
+approach is a fundamental mistake. The text of well-written
+documentation strings will be entirely wrong for a manual.
+
+ A documentation string needs to stand alone--when it appears on the
+screen, there will be no other text to introduce or explain it.
+Meanwhile, it can be rather informal in style.
+
+ The text describing a function or variable in a manual must not stand
+alone; it appears in the context of a section or subsection. Other text
+at the beginning of the section should explain some of the concepts, and
+should often make some general points that apply to several functions or
+variables. The previous descriptions of functions and variables in the
+section will also have given information about the topic. A description
+written to stand alone would repeat some of that information; this
+redundancy looks bad. Meanwhile, the informality that is acceptable in
+a documentation string is totally unacceptable in a manual.
+
+ The only good way to use documentation strings in writing a good
+manual is to use them as a source of information for writing good text.
+
+
+File: standards.info, Node: Manual Structure Details, Next: License for Manuals, Prev: Doc Strings and Manuals, Up: Documentation
+
+6.3 Manual Structure Details
+============================
+
+The title page of the manual should state the version of the programs or
+packages documented in the manual. The Top node of the manual should
+also contain this information. If the manual is changing more
+frequently than or independent of the program, also state a version
+number for the manual in both of these places.
+
+ Each program documented in the manual should have a node named
+`PROGRAM Invocation' or `Invoking PROGRAM'. This node (together with
+its subnodes, if any) should describe the program's command line
+arguments and how to run it (the sort of information people would look
+for in a man page). Start with an `@example' containing a template for
+all the options and arguments that the program uses.
+
+ Alternatively, put a menu item in some menu whose item name fits one
+of the above patterns. This identifies the node which that item points
+to as the node for this purpose, regardless of the node's actual name.
+
+ The `--usage' feature of the Info reader looks for such a node or
+menu item in order to find the relevant text, so it is essential for
+every Texinfo file to have one.
+
+ If one manual describes several programs, it should have such a node
+for each program described in the manual.
+
+
+File: standards.info, Node: License for Manuals, Next: Manual Credits, Prev: Manual Structure Details, Up: Documentation
+
+6.4 License for Manuals
+=======================
+
+Please use the GNU Free Documentation License for all GNU manuals that
+are more than a few pages long. Likewise for a collection of short
+documents--you only need one copy of the GNU FDL for the whole
+collection. For a single short document, you can use a very permissive
+non-copyleft license, to avoid taking up space with a long license.
+
+ See `http://www.gnu.org/copyleft/fdl-howto.html' for more explanation
+of how to employ the GFDL.
+
+ Note that it is not obligatory to include a copy of the GNU GPL or
+GNU LGPL in a manual whose license is neither the GPL nor the LGPL. It
+can be a good idea to include the program's license in a large manual;
+in a short manual, whose size would be increased considerably by
+including the program's license, it is probably better not to include
+it.
+
+
+File: standards.info, Node: Manual Credits, Next: Printed Manuals, Prev: License for Manuals, Up: Documentation
+
+6.5 Manual Credits
+==================
+
+Please credit the principal human writers of the manual as the authors,
+on the title page of the manual. If a company sponsored the work, thank
+the company in a suitable place in the manual, but do not cite the
+company as an author.
+
+
+File: standards.info, Node: Printed Manuals, Next: NEWS File, Prev: Manual Credits, Up: Documentation
+
+6.6 Printed Manuals
+===================
+
+The FSF publishes some GNU manuals in printed form. To encourage sales
+of these manuals, the on-line versions of the manual should mention at
+the very start that the printed manual is available and should point at
+information for getting it--for instance, with a link to the page
+`http://www.gnu.org/order/order.html'. This should not be included in
+the printed manual, though, because there it is redundant.
+
+ It is also useful to explain in the on-line forms of the manual how
+the user can print out the manual from the sources.
+
+
+File: standards.info, Node: NEWS File, Next: Change Logs, Prev: Printed Manuals, Up: Documentation
+
+6.7 The NEWS File
+=================
+
+In addition to its manual, the package should have a file named `NEWS'
+which contains a list of user-visible changes worth mentioning. In
+each new release, add items to the front of the file and identify the
+version they pertain to. Don't discard old items; leave them in the
+file after the newer items. This way, a user upgrading from any
+previous version can see what is new.
+
+ If the `NEWS' file gets very long, move some of the older items into
+a file named `ONEWS' and put a note at the end referring the user to
+that file.
+
+
+File: standards.info, Node: Change Logs, Next: Man Pages, Prev: NEWS File, Up: Documentation
+
+6.8 Change Logs
+===============
+
+Keep a change log to describe all the changes made to program source
+files. The purpose of this is so that people investigating bugs in the
+future will know about the changes that might have introduced the bug.
+Often a new bug can be found by looking at what was recently changed.
+More importantly, change logs can help you eliminate conceptual
+inconsistencies between different parts of a program, by giving you a
+history of how the conflicting concepts arose and who they came from.
+
+* Menu:
+
+* Change Log Concepts::
+* Style of Change Logs::
+* Simple Changes::
+* Conditional Changes::
+* Indicating the Part Changed::
+
+
+File: standards.info, Node: Change Log Concepts, Next: Style of Change Logs, Up: Change Logs
+
+6.8.1 Change Log Concepts
+-------------------------
+
+You can think of the change log as a conceptual "undo list" which
+explains how earlier versions were different from the current version.
+People can see the current version; they don't need the change log to
+tell them what is in it. What they want from a change log is a clear
+explanation of how the earlier version differed.
+
+ The change log file is normally called `ChangeLog' and covers an
+entire directory. Each directory can have its own change log, or a
+directory can use the change log of its parent directory-it's up to you.
+
+ Another alternative is to record change log information with a
+version control system such as RCS or CVS. This can be converted
+automatically to a `ChangeLog' file using `rcs2log'; in Emacs, the
+command `C-x v a' (`vc-update-change-log') does the job.
+
+ There's no need to describe the full purpose of the changes or how
+they work together. If you think that a change calls for explanation,
+you're probably right. Please do explain it--but please put the
+explanation in comments in the code, where people will see it whenever
+they see the code. For example, "New function" is enough for the
+change log when you add a function, because there should be a comment
+before the function definition to explain what it does.
+
+ In the past, we recommended not mentioning changes in non-software
+files (manuals, help files, etc.) in change logs. However, we've been
+advised that it is a good idea to include them, for the sake of
+copyright records.
+
+ However, sometimes it is useful to write one line to describe the
+overall purpose of a batch of changes.
+
+ The easiest way to add an entry to `ChangeLog' is with the Emacs
+command `M-x add-change-log-entry'. An entry should have an asterisk,
+the name of the changed file, and then in parentheses the name of the
+changed functions, variables or whatever, followed by a colon. Then
+describe the changes you made to that function or variable.
+
+
+File: standards.info, Node: Style of Change Logs, Next: Simple Changes, Prev: Change Log Concepts, Up: Change Logs
+
+6.8.2 Style of Change Logs
+--------------------------
+
+Here are some simple examples of change log entries, starting with the
+header line that says who made the change and when it was installed,
+followed by descriptions of specific changes. (These examples are
+drawn from Emacs and GCC.)
+
+ 1998-08-17 Richard Stallman <rms@gnu.org>
+
+ * register.el (insert-register): Return nil.
+ (jump-to-register): Likewise.
+
+ * sort.el (sort-subr): Return nil.
+
+ * tex-mode.el (tex-bibtex-file, tex-file, tex-region):
+ Restart the tex shell if process is gone or stopped.
+ (tex-shell-running): New function.
+
+ * expr.c (store_one_arg): Round size up for move_block_to_reg.
+ (expand_call): Round up when emitting USE insns.
+ * stmt.c (assign_parms): Round size up for move_block_from_reg.
+
+ It's important to name the changed function or variable in full.
+Don't abbreviate function or variable names, and don't combine them.
+Subsequent maintainers will often search for a function name to find all
+the change log entries that pertain to it; if you abbreviate the name,
+they won't find it when they search.
+
+ For example, some people are tempted to abbreviate groups of function
+names by writing `* register.el ({insert,jump-to}-register)'; this is
+not a good idea, since searching for `jump-to-register' or
+`insert-register' would not find that entry.
+
+ Separate unrelated change log entries with blank lines. When two
+entries represent parts of the same change, so that they work together,
+then don't put blank lines between them. Then you can omit the file
+name and the asterisk when successive entries are in the same file.
+
+ Break long lists of function names by closing continued lines with
+`)', rather than `,', and opening the continuation with `(' as in this
+example:
+
+ * keyboard.c (menu_bar_items, tool_bar_items)
+ (Fexecute_extended_command): Deal with `keymap' property.
+
+ When you install someone else's changes, put the contributor's name
+in the change log entry rather than in the text of the entry. In other
+words, write this:
+
+ 2002-07-14 John Doe <jdoe@gnu.org>
+
+ * sewing.c: Make it sew.
+
+rather than this:
+
+ 2002-07-14 Usual Maintainer <usual@gnu.org>
+
+ * sewing.c: Make it sew. Patch by jdoe@gnu.org.
+
+ As for the date, that should be the date you applied the change.
+
+
+File: standards.info, Node: Simple Changes, Next: Conditional Changes, Prev: Style of Change Logs, Up: Change Logs
+
+6.8.3 Simple Changes
+--------------------
+
+Certain simple kinds of changes don't need much detail in the change
+log.
+
+ When you change the calling sequence of a function in a simple
+fashion, and you change all the callers of the function to use the new
+calling sequence, there is no need to make individual entries for all
+the callers that you changed. Just write in the entry for the function
+being called, "All callers changed"--like this:
+
+ * keyboard.c (Fcommand_execute): New arg SPECIAL.
+ All callers changed.
+
+ When you change just comments or doc strings, it is enough to write
+an entry for the file, without mentioning the functions. Just "Doc
+fixes" is enough for the change log.
+
+ There's no technical need to make change log entries for
+documentation files. This is because documentation is not susceptible
+to bugs that are hard to fix. Documentation does not consist of parts
+that must interact in a precisely engineered fashion. To correct an
+error, you need not know the history of the erroneous passage; it is
+enough to compare what the documentation says with the way the program
+actually works.
+
+ However, you should keep change logs for documentation files when the
+project gets copyright assignments from its contributors, so as to make
+the records of authorship more accurate.
+
+
+File: standards.info, Node: Conditional Changes, Next: Indicating the Part Changed, Prev: Simple Changes, Up: Change Logs
+
+6.8.4 Conditional Changes
+-------------------------
+
+C programs often contain compile-time `#if' conditionals. Many changes
+are conditional; sometimes you add a new definition which is entirely
+contained in a conditional. It is very useful to indicate in the
+change log the conditions for which the change applies.
+
+ Our convention for indicating conditional changes is to use square
+brackets around the name of the condition.
+
+ Here is a simple example, describing a change which is conditional
+but does not have a function or entity name associated with it:
+
+ * xterm.c [SOLARIS2]: Include string.h.
+
+ Here is an entry describing a new definition which is entirely
+conditional. This new definition for the macro `FRAME_WINDOW_P' is
+used only when `HAVE_X_WINDOWS' is defined:
+
+ * frame.h [HAVE_X_WINDOWS] (FRAME_WINDOW_P): Macro defined.
+
+ Here is an entry for a change within the function `init_display',
+whose definition as a whole is unconditional, but the changes themselves
+are contained in a `#ifdef HAVE_LIBNCURSES' conditional:
+
+ * dispnew.c (init_display) [HAVE_LIBNCURSES]: If X, call tgetent.
+
+ Here is an entry for a change that takes affect only when a certain
+macro is _not_ defined:
+
+ (gethostname) [!HAVE_SOCKETS]: Replace with winsock version.
+
+
+File: standards.info, Node: Indicating the Part Changed, Prev: Conditional Changes, Up: Change Logs
+
+6.8.5 Indicating the Part Changed
+---------------------------------
+
+Indicate the part of a function which changed by using angle brackets
+enclosing an indication of what the changed part does. Here is an entry
+for a change in the part of the function `sh-while-getopts' that deals
+with `sh' commands:
+
+ * progmodes/sh-script.el (sh-while-getopts) <sh>: Handle case that
+ user-specified option string is empty.
+
+
+File: standards.info, Node: Man Pages, Next: Reading other Manuals, Prev: Change Logs, Up: Documentation
+
+6.9 Man Pages
+=============
+
+In the GNU project, man pages are secondary. It is not necessary or
+expected for every GNU program to have a man page, but some of them do.
+It's your choice whether to include a man page in your program.
+
+ When you make this decision, consider that supporting a man page
+requires continual effort each time the program is changed. The time
+you spend on the man page is time taken away from more useful work.
+
+ For a simple program which changes little, updating the man page may
+be a small job. Then there is little reason not to include a man page,
+if you have one.
+
+ For a large program that changes a great deal, updating a man page
+may be a substantial burden. If a user offers to donate a man page,
+you may find this gift costly to accept. It may be better to refuse
+the man page unless the same person agrees to take full responsibility
+for maintaining it--so that you can wash your hands of it entirely. If
+this volunteer later ceases to do the job, then don't feel obliged to
+pick it up yourself; it may be better to withdraw the man page from the
+distribution until someone else agrees to update it.
+
+ When a program changes only a little, you may feel that the
+discrepancies are small enough that the man page remains useful without
+updating. If so, put a prominent note near the beginning of the man
+page explaining that you don't maintain it and that the Texinfo manual
+is more authoritative. The note should say how to access the Texinfo
+documentation.
+
+ Be sure that man pages include a copyright statement and free
+license. The simple all-permissive license is appropriate for simple
+man pages:
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved.
+
+ For long man pages, with enough explanation and documentation that
+they can be considered true manuals, use the GFDL (*note License for
+Manuals::).
+
+ Finally, the GNU help2man program
+(`http://www.gnu.org/software/help2man/') is one way to automate
+generation of a man page, in this case from `--help' output. This is
+sufficient in many cases.
+
+
+File: standards.info, Node: Reading other Manuals, Prev: Man Pages, Up: Documentation
+
+6.10 Reading other Manuals
+==========================
+
+There may be non-free books or documentation files that describe the
+program you are documenting.
+
+ It is ok to use these documents for reference, just as the author of
+a new algebra textbook can read other books on algebra. A large portion
+of any non-fiction book consists of facts, in this case facts about how
+a certain program works, and these facts are necessarily the same for
+everyone who writes about the subject. But be careful not to copy your
+outline structure, wording, tables or examples from preexisting non-free
+documentation. Copying from free documentation may be ok; please check
+with the FSF about the individual case.
+
+
+File: standards.info, Node: Managing Releases, Next: References, Prev: Documentation, Up: Top
+
+7 The Release Process
+*********************
+
+Making a release is more than just bundling up your source files in a
+tar file and putting it up for FTP. You should set up your software so
+that it can be configured to run on a variety of systems. Your Makefile
+should conform to the GNU standards described below, and your directory
+layout should also conform to the standards discussed below. Doing so
+makes it easy to include your package into the larger framework of all
+GNU software.
+
+* Menu:
+
+* Configuration:: How configuration of GNU packages should work.
+* Makefile Conventions:: Makefile conventions.
+* Releases:: Making releases
+
+
+File: standards.info, Node: Configuration, Next: Makefile Conventions, Up: Managing Releases
+
+7.1 How Configuration Should Work
+=================================
+
+Each GNU distribution should come with a shell script named
+`configure'. This script is given arguments which describe the kind of
+machine and system you want to compile the program for.
+
+ The `configure' script must record the configuration options so that
+they affect compilation.
+
+ One way to do this is to make a link from a standard name such as
+`config.h' to the proper configuration file for the chosen system. If
+you use this technique, the distribution should _not_ contain a file
+named `config.h'. This is so that people won't be able to build the
+program without configuring it first.
+
+ Another thing that `configure' can do is to edit the Makefile. If
+you do this, the distribution should _not_ contain a file named
+`Makefile'. Instead, it should include a file `Makefile.in' which
+contains the input used for editing. Once again, this is so that people
+won't be able to build the program without configuring it first.
+
+ If `configure' does write the `Makefile', then `Makefile' should
+have a target named `Makefile' which causes `configure' to be rerun,
+setting up the same configuration that was set up last time. The files
+that `configure' reads should be listed as dependencies of `Makefile'.
+
+ All the files which are output from the `configure' script should
+have comments at the beginning explaining that they were generated
+automatically using `configure'. This is so that users won't think of
+trying to edit them by hand.
+
+ The `configure' script should write a file named `config.status'
+which describes which configuration options were specified when the
+program was last configured. This file should be a shell script which,
+if run, will recreate the same configuration.
+
+ The `configure' script should accept an option of the form
+`--srcdir=DIRNAME' to specify the directory where sources are found (if
+it is not the current directory). This makes it possible to build the
+program in a separate directory, so that the actual source directory is
+not modified.
+
+ If the user does not specify `--srcdir', then `configure' should
+check both `.' and `..' to see if it can find the sources. If it finds
+the sources in one of these places, it should use them from there.
+Otherwise, it should report that it cannot find the sources, and should
+exit with nonzero status.
+
+ Usually the easy way to support `--srcdir' is by editing a
+definition of `VPATH' into the Makefile. Some rules may need to refer
+explicitly to the specified source directory. To make this possible,
+`configure' can add to the Makefile a variable named `srcdir' whose
+value is precisely the specified directory.
+
+ The `configure' script should also take an argument which specifies
+the type of system to build the program for. This argument should look
+like this:
+
+ CPU-COMPANY-SYSTEM
+
+ For example, an Athlon-based GNU/Linux system might be
+`i686-pc-linux-gnu'.
+
+ The `configure' script needs to be able to decode all plausible
+alternatives for how to describe a machine. Thus,
+`athlon-pc-gnu/linux' would be a valid alias. There is a shell script
+called `config.sub'
+(http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub)
+that you can use as a subroutine to validate system types and
+canonicalize aliases.
+
+ The `configure' script should also take the option
+`--build=BUILDTYPE', which should be equivalent to a plain BUILDTYPE
+argument. For example, `configure --build=i686-pc-linux-gnu' is
+equivalent to `configure i686-pc-linux-gnu'. When the build type is
+not specified by an option or argument, the `configure' script should
+normally guess it using the shell script `config.guess'
+(http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess).
+
+ Other options are permitted to specify in more detail the software
+or hardware present on the machine, to include or exclude optional parts
+of the package, or to adjust the name of some tools or arguments to
+them:
+
+`--enable-FEATURE[=PARAMETER]'
+ Configure the package to build and install an optional user-level
+ facility called FEATURE. This allows users to choose which
+ optional features to include. Giving an optional PARAMETER of
+ `no' should omit FEATURE, if it is built by default.
+
+ No `--enable' option should *ever* cause one feature to replace
+ another. No `--enable' option should ever substitute one useful
+ behavior for another useful behavior. The only proper use for
+ `--enable' is for questions of whether to build part of the program
+ or exclude it.
+
+`--with-PACKAGE'
+ The package PACKAGE will be installed, so configure this package
+ to work with PACKAGE.
+
+ Possible values of PACKAGE include `gnu-as' (or `gas'), `gnu-ld',
+ `gnu-libc', `gdb', `x', and `x-toolkit'.
+
+ Do not use a `--with' option to specify the file name to use to
+ find certain files. That is outside the scope of what `--with'
+ options are for.
+
+`VARIABLE=VALUE'
+ Set the value of the variable VARIABLE to VALUE. This is used to
+ override the default values of commands or arguments in the build
+ process. For example, the user could issue `configure CFLAGS=-g
+ CXXFLAGS=-g' to build with debugging information and without the
+ default optimization.
+
+ Specifying variables as arguments to `configure', like this:
+ ./configure CC=gcc
+ is preferable to setting them in environment variables:
+ CC=gcc ./configure
+ as it helps to recreate the same configuration later with
+ `config.status'.
+
+ All `configure' scripts should accept all of the "detail" options
+and the variable settings, whether or not they make any difference to
+the particular package at hand. In particular, they should accept any
+option that starts with `--with-' or `--enable-'. This is so users
+will be able to configure an entire GNU source tree at once with a
+single set of options.
+
+ You will note that the categories `--with-' and `--enable-' are
+narrow: they *do not* provide a place for any sort of option you might
+think of. That is deliberate. We want to limit the possible
+configuration options in GNU software. We do not want GNU programs to
+have idiosyncratic configuration options.
+
+ Packages that perform part of the compilation process may support
+cross-compilation. In such a case, the host and target machines for the
+program may be different.
+
+ The `configure' script should normally treat the specified type of
+system as both the host and the target, thus producing a program which
+works for the same type of machine that it runs on.
+
+ To compile a program to run on a host type that differs from the
+build type, use the configure option `--host=HOSTTYPE', where HOSTTYPE
+uses the same syntax as BUILDTYPE. The host type normally defaults to
+the build type.
+
+ To configure a cross-compiler, cross-assembler, or what have you, you
+should specify a target different from the host, using the configure
+option `--target=TARGETTYPE'. The syntax for TARGETTYPE is the same as
+for the host type. So the command would look like this:
+
+ ./configure --host=HOSTTYPE --target=TARGETTYPE
+
+ The target type normally defaults to the host type. Programs for
+which cross-operation is not meaningful need not accept the `--target'
+option, because configuring an entire operating system for
+cross-operation is not a meaningful operation.
+
+ Some programs have ways of configuring themselves automatically. If
+your program is set up to do this, your `configure' script can simply
+ignore most of its arguments.
+
+
+File: standards.info, Node: Makefile Conventions, Next: Releases, Prev: Configuration, Up: Managing Releases
+
+7.2 Makefile Conventions
+========================
+
+This node describes conventions for writing the Makefiles for GNU
+programs. Using Automake will help you write a Makefile that follows
+these conventions.
+
+* Menu:
+
+* Makefile Basics:: General conventions for Makefiles.
+* Utilities in Makefiles:: Utilities to be used in Makefiles.
+* Command Variables:: Variables for specifying commands.
+* DESTDIR:: Supporting staged installs.
+* Directory Variables:: Variables for installation directories.
+* Standard Targets:: Standard targets for users.
+* Install Command Categories:: Three categories of commands in the `install'
+ rule: normal, pre-install and post-install.
+
+
+File: standards.info, Node: Makefile Basics, Next: Utilities in Makefiles, Up: Makefile Conventions
+
+7.2.1 General Conventions for Makefiles
+---------------------------------------
+
+Every Makefile should contain this line:
+
+ SHELL = /bin/sh
+
+to avoid trouble on systems where the `SHELL' variable might be
+inherited from the environment. (This is never a problem with GNU
+`make'.)
+
+ Different `make' programs have incompatible suffix lists and
+implicit rules, and this sometimes creates confusion or misbehavior. So
+it is a good idea to set the suffix list explicitly using only the
+suffixes you need in the particular Makefile, like this:
+
+ .SUFFIXES:
+ .SUFFIXES: .c .o
+
+The first line clears out the suffix list, the second introduces all
+suffixes which may be subject to implicit rules in this Makefile.
+
+ Don't assume that `.' is in the path for command execution. When
+you need to run programs that are a part of your package during the
+make, please make sure that it uses `./' if the program is built as
+part of the make or `$(srcdir)/' if the file is an unchanging part of
+the source code. Without one of these prefixes, the current search
+path is used.
+
+ The distinction between `./' (the "build directory") and
+`$(srcdir)/' (the "source directory") is important because users can
+build in a separate directory using the `--srcdir' option to
+`configure'. A rule of the form:
+
+ foo.1 : foo.man sedscript
+ sed -e sedscript foo.man > foo.1
+
+will fail when the build directory is not the source directory, because
+`foo.man' and `sedscript' are in the source directory.
+
+ When using GNU `make', relying on `VPATH' to find the source file
+will work in the case where there is a single dependency file, since
+the `make' automatic variable `$<' will represent the source file
+wherever it is. (Many versions of `make' set `$<' only in implicit
+rules.) A Makefile target like
+
+ foo.o : bar.c
+ $(CC) -I. -I$(srcdir) $(CFLAGS) -c bar.c -o foo.o
+
+should instead be written as
+
+ foo.o : bar.c
+ $(CC) -I. -I$(srcdir) $(CFLAGS) -c $< -o $@
+
+in order to allow `VPATH' to work correctly. When the target has
+multiple dependencies, using an explicit `$(srcdir)' is the easiest way
+to make the rule work well. For example, the target above for `foo.1'
+is best written as:
+
+ foo.1 : foo.man sedscript
+ sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@
+
+ GNU distributions usually contain some files which are not source
+files--for example, Info files, and the output from Autoconf, Automake,
+Bison or Flex. Since these files normally appear in the source
+directory, they should always appear in the source directory, not in the
+build directory. So Makefile rules to update them should put the
+updated files in the source directory.
+
+ However, if a file does not appear in the distribution, then the
+Makefile should not put it in the source directory, because building a
+program in ordinary circumstances should not modify the source directory
+in any way.
+
+ Try to make the build and installation targets, at least (and all
+their subtargets) work correctly with a parallel `make'.
+
+
+File: standards.info, Node: Utilities in Makefiles, Next: Command Variables, Prev: Makefile Basics, Up: Makefile Conventions
+
+7.2.2 Utilities in Makefiles
+----------------------------
+
+Write the Makefile commands (and any shell scripts, such as
+`configure') to run in `sh', not in `csh'. Don't use any special
+features of `ksh' or `bash'.
+
+ The `configure' script and the Makefile rules for building and
+installation should not use any utilities directly except these:
+
+ cat cmp cp diff echo egrep expr false grep install-info
+ ln ls mkdir mv pwd rm rmdir sed sleep sort tar test touch true
+
+ The compression program `gzip' can be used in the `dist' rule.
+
+ Stick to the generally supported options for these programs. For
+example, don't use `mkdir -p', convenient as it may be, because most
+systems don't support it.
+
+ It is a good idea to avoid creating symbolic links in makefiles,
+since a few systems don't support them.
+
+ The Makefile rules for building and installation can also use
+compilers and related programs, but should do so via `make' variables
+so that the user can substitute alternatives. Here are some of the
+programs we mean:
+
+ ar bison cc flex install ld ldconfig lex
+ make makeinfo ranlib texi2dvi yacc
+
+ Use the following `make' variables to run those programs:
+
+ $(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LDCONFIG) $(LEX)
+ $(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC)
+
+ When you use `ranlib' or `ldconfig', you should make sure nothing
+bad happens if the system does not have the program in question.
+Arrange to ignore an error from that command, and print a message before
+the command to tell the user that failure of this command does not mean
+a problem. (The Autoconf `AC_PROG_RANLIB' macro can help with this.)
+
+ If you use symbolic links, you should implement a fallback for
+systems that don't have symbolic links.
+
+ Additional utilities that can be used via Make variables are:
+
+ chgrp chmod chown mknod
+
+ It is ok to use other utilities in Makefile portions (or scripts)
+intended only for particular systems where you know those utilities
+exist.
+
+
+File: standards.info, Node: Command Variables, Next: DESTDIR, Prev: Utilities in Makefiles, Up: Makefile Conventions
+
+7.2.3 Variables for Specifying Commands
+---------------------------------------
+
+Makefiles should provide variables for overriding certain commands,
+options, and so on.
+
+ In particular, you should run most utility programs via variables.
+Thus, if you use Bison, have a variable named `BISON' whose default
+value is set with `BISON = bison', and refer to it with `$(BISON)'
+whenever you need to use Bison.
+
+ File management utilities such as `ln', `rm', `mv', and so on, need
+not be referred to through variables in this way, since users don't
+need to replace them with other programs.
+
+ Each program-name variable should come with an options variable that
+is used to supply options to the program. Append `FLAGS' to the
+program-name variable name to get the options variable name--for
+example, `BISONFLAGS'. (The names `CFLAGS' for the C compiler,
+`YFLAGS' for yacc, and `LFLAGS' for lex, are exceptions to this rule,
+but we keep them because they are standard.) Use `CPPFLAGS' in any
+compilation command that runs the preprocessor, and use `LDFLAGS' in
+any compilation command that does linking as well as in any direct use
+of `ld'.
+
+ If there are C compiler options that _must_ be used for proper
+compilation of certain files, do not include them in `CFLAGS'. Users
+expect to be able to specify `CFLAGS' freely themselves. Instead,
+arrange to pass the necessary options to the C compiler independently
+of `CFLAGS', by writing them explicitly in the compilation commands or
+by defining an implicit rule, like this:
+
+ CFLAGS = -g
+ ALL_CFLAGS = -I. $(CFLAGS)
+ .c.o:
+ $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
+
+ Do include the `-g' option in `CFLAGS', because that is not
+_required_ for proper compilation. You can consider it a default that
+is only recommended. If the package is set up so that it is compiled
+with GCC by default, then you might as well include `-O' in the default
+value of `CFLAGS' as well.
+
+ Put `CFLAGS' last in the compilation command, after other variables
+containing compiler options, so the user can use `CFLAGS' to override
+the others.
+
+ `CFLAGS' should be used in every invocation of the C compiler, both
+those which do compilation and those which do linking.
+
+ Every Makefile should define the variable `INSTALL', which is the
+basic command for installing a file into the system.
+
+ Every Makefile should also define the variables `INSTALL_PROGRAM'
+and `INSTALL_DATA'. (The default for `INSTALL_PROGRAM' should be
+`$(INSTALL)'; the default for `INSTALL_DATA' should be `${INSTALL} -m
+644'.) Then it should use those variables as the commands for actual
+installation, for executables and non-executables respectively.
+Minimal use of these variables is as follows:
+
+ $(INSTALL_PROGRAM) foo $(bindir)/foo
+ $(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a
+
+ However, it is preferable to support a `DESTDIR' prefix on the
+target files, as explained in the next section.
+
+Always use a file name, not a directory name, as the second argument of
+the installation commands. Use a separate command for each file to be
+installed.
+
+
+File: standards.info, Node: DESTDIR, Next: Directory Variables, Prev: Command Variables, Up: Makefile Conventions
+
+7.2.4 `DESTDIR': support for staged installs
+--------------------------------------------
+
+`DESTDIR' is a variable prepended to each installed target file, like
+this:
+
+ $(INSTALL_PROGRAM) foo $(DESTDIR)$(bindir)/foo
+ $(INSTALL_DATA) libfoo.a $(DESTDIR)$(libdir)/libfoo.a
+
+ The `DESTDIR' variable is specified by the user on the `make'
+command line. For example:
+
+ make DESTDIR=/tmp/stage install
+
+`DESTDIR' should be supported only in the `install*' and `uninstall*'
+targets, as those are the only targets where it is useful.
+
+ If your installation step would normally install
+`/usr/local/bin/foo' and `/usr/local/lib/libfoo.a', then an
+installation invoked as in the example above would install
+`/tmp/stage/usr/local/bin/foo' and `/tmp/stage/usr/local/lib/libfoo.a'
+instead.
+
+ Prepending the variable `DESTDIR' to each target in this way
+provides for "staged installs", where the installed files are not
+placed directly into their expected location but are instead copied
+into a temporary location (`DESTDIR'). However, installed files
+maintain their relative directory structure and any embedded file names
+will not be modified.
+
+ You should not set the value of `DESTDIR' in your `Makefile' at all;
+then the files are installed into their expected locations by default.
+Also, specifying `DESTDIR' should not change the operation of the
+software in any way, so its value should not be included in any file
+contents.
+
+ `DESTDIR' support is commonly used in package creation. It is also
+helpful to users who want to understand what a given package will
+install where, and to allow users who don't normally have permissions
+to install into protected areas to build and install before gaining
+those permissions. Finally, it can be useful with tools such as
+`stow', where code is installed in one place but made to appear to be
+installed somewhere else using symbolic links or special mount
+operations. So, we strongly recommend GNU packages support `DESTDIR',
+though it is not an absolute requirement.
+
+
+File: standards.info, Node: Directory Variables, Next: Standard Targets, Prev: DESTDIR, Up: Makefile Conventions
+
+7.2.5 Variables for Installation Directories
+--------------------------------------------
+
+Installation directories should always be named by variables, so it is
+easy to install in a nonstandard place. The standard names for these
+variables and the values they should have in GNU packages are described
+below. They are based on a standard file system layout; variants of it
+are used in GNU/Linux and other modern operating systems.
+
+ Installers are expected to override these values when calling `make'
+(e.g., `make prefix=/usr install' or `configure' (e.g., `configure
+--prefix=/usr'). GNU packages should not try to guess which value
+should be appropriate for these variables on the system they are being
+installed onto: use the default settings specified here so that all GNU
+packages behave identically, allowing the installer to achieve any
+desired layout.
+
+ These first two variables set the root for the installation. All the
+other installation directories should be subdirectories of one of these
+two, and nothing should be directly installed into these two
+directories.
+
+`prefix'
+ A prefix used in constructing the default values of the variables
+ listed below. The default value of `prefix' should be
+ `/usr/local'. When building the complete GNU system, the prefix
+ will be empty and `/usr' will be a symbolic link to `/'. (If you
+ are using Autoconf, write it as `@prefix@'.)
+
+ Running `make install' with a different value of `prefix' from the
+ one used to build the program should _not_ recompile the program.
+
+`exec_prefix'
+ A prefix used in constructing the default values of some of the
+ variables listed below. The default value of `exec_prefix' should
+ be `$(prefix)'. (If you are using Autoconf, write it as
+ `@exec_prefix@'.)
+
+ Generally, `$(exec_prefix)' is used for directories that contain
+ machine-specific files (such as executables and subroutine
+ libraries), while `$(prefix)' is used directly for other
+ directories.
+
+ Running `make install' with a different value of `exec_prefix'
+ from the one used to build the program should _not_ recompile the
+ program.
+
+ Executable programs are installed in one of the following
+directories.
+
+`bindir'
+ The directory for installing executable programs that users can
+ run. This should normally be `/usr/local/bin', but write it as
+ `$(exec_prefix)/bin'. (If you are using Autoconf, write it as
+ `@bindir@'.)
+
+`sbindir'
+ The directory for installing executable programs that can be run
+ from the shell, but are only generally useful to system
+ administrators. This should normally be `/usr/local/sbin', but
+ write it as `$(exec_prefix)/sbin'. (If you are using Autoconf,
+ write it as `@sbindir@'.)
+
+`libexecdir'
+ The directory for installing executable programs to be run by other
+ programs rather than by users. This directory should normally be
+ `/usr/local/libexec', but write it as `$(exec_prefix)/libexec'.
+ (If you are using Autoconf, write it as `@libexecdir@'.)
+
+ The definition of `libexecdir' is the same for all packages, so
+ you should install your data in a subdirectory thereof. Most
+ packages install their data under `$(libexecdir)/PACKAGE-NAME/',
+ possibly within additional subdirectories thereof, such as
+ `$(libexecdir)/PACKAGE-NAME/MACHINE/VERSION'.
+
+ Data files used by the program during its execution are divided into
+categories in two ways.
+
+ * Some files are normally modified by programs; others are never
+ normally modified (though users may edit some of these).
+
+ * Some files are architecture-independent and can be shared by all
+ machines at a site; some are architecture-dependent and can be
+ shared only by machines of the same kind and operating system;
+ others may never be shared between two machines.
+
+ This makes for six different possibilities. However, we want to
+discourage the use of architecture-dependent files, aside from object
+files and libraries. It is much cleaner to make other data files
+architecture-independent, and it is generally not hard.
+
+ Here are the variables Makefiles should use to specify directories
+to put these various kinds of files in:
+
+`datarootdir'
+ The root of the directory tree for read-only
+ architecture-independent data files. This should normally be
+ `/usr/local/share', but write it as `$(prefix)/share'. (If you
+ are using Autoconf, write it as `@datarootdir@'.) `datadir''s
+ default value is based on this variable; so are `infodir',
+ `mandir', and others.
+
+`datadir'
+ The directory for installing idiosyncratic read-only
+ architecture-independent data files for this program. This is
+ usually the same place as `datarootdir', but we use the two
+ separate variables so that you can move these program-specific
+ files without altering the location for Info files, man pages, etc.
+
+ This should normally be `/usr/local/share', but write it as
+ `$(datarootdir)'. (If you are using Autoconf, write it as
+ `@datadir@'.)
+
+ The definition of `datadir' is the same for all packages, so you
+ should install your data in a subdirectory thereof. Most packages
+ install their data under `$(datadir)/PACKAGE-NAME/'.
+
+`sysconfdir'
+ The directory for installing read-only data files that pertain to a
+ single machine-that is to say, files for configuring a host.
+ Mailer and network configuration files, `/etc/passwd', and so
+ forth belong here. All the files in this directory should be
+ ordinary ASCII text files. This directory should normally be
+ `/usr/local/etc', but write it as `$(prefix)/etc'. (If you are
+ using Autoconf, write it as `@sysconfdir@'.)
+
+ Do not install executables here in this directory (they probably
+ belong in `$(libexecdir)' or `$(sbindir)'). Also do not install
+ files that are modified in the normal course of their use (programs
+ whose purpose is to change the configuration of the system
+ excluded). Those probably belong in `$(localstatedir)'.
+
+`sharedstatedir'
+ The directory for installing architecture-independent data files
+ which the programs modify while they run. This should normally be
+ `/usr/local/com', but write it as `$(prefix)/com'. (If you are
+ using Autoconf, write it as `@sharedstatedir@'.)
+
+`localstatedir'
+ The directory for installing data files which the programs modify
+ while they run, and that pertain to one specific machine. Users
+ should never need to modify files in this directory to configure
+ the package's operation; put such configuration information in
+ separate files that go in `$(datadir)' or `$(sysconfdir)'.
+ `$(localstatedir)' should normally be `/usr/local/var', but write
+ it as `$(prefix)/var'. (If you are using Autoconf, write it as
+ `@localstatedir@'.)
+
+ These variables specify the directory for installing certain specific
+types of files, if your program has them. Every GNU package should
+have Info files, so every program needs `infodir', but not all need
+`libdir' or `lispdir'.
+
+`includedir'
+ The directory for installing header files to be included by user
+ programs with the C `#include' preprocessor directive. This
+ should normally be `/usr/local/include', but write it as
+ `$(prefix)/include'. (If you are using Autoconf, write it as
+ `@includedir@'.)
+
+ Most compilers other than GCC do not look for header files in
+ directory `/usr/local/include'. So installing the header files
+ this way is only useful with GCC. Sometimes this is not a problem
+ because some libraries are only really intended to work with GCC.
+ But some libraries are intended to work with other compilers.
+ They should install their header files in two places, one
+ specified by `includedir' and one specified by `oldincludedir'.
+
+`oldincludedir'
+ The directory for installing `#include' header files for use with
+ compilers other than GCC. This should normally be `/usr/include'.
+ (If you are using Autoconf, you can write it as `@oldincludedir@'.)
+
+ The Makefile commands should check whether the value of
+ `oldincludedir' is empty. If it is, they should not try to use
+ it; they should cancel the second installation of the header files.
+
+ A package should not replace an existing header in this directory
+ unless the header came from the same package. Thus, if your Foo
+ package provides a header file `foo.h', then it should install the
+ header file in the `oldincludedir' directory if either (1) there
+ is no `foo.h' there or (2) the `foo.h' that exists came from the
+ Foo package.
+
+ To tell whether `foo.h' came from the Foo package, put a magic
+ string in the file--part of a comment--and `grep' for that string.
+
+`docdir'
+ The directory for installing documentation files (other than Info)
+ for this package. By default, it should be
+ `/usr/local/share/doc/YOURPKG', but it should be written as
+ `$(datarootdir)/doc/YOURPKG'. (If you are using Autoconf, write
+ it as `@docdir@'.) The YOURPKG subdirectory, which may include a
+ version number, prevents collisions among files with common names,
+ such as `README'.
+
+`infodir'
+ The directory for installing the Info files for this package. By
+ default, it should be `/usr/local/share/info', but it should be
+ written as `$(datarootdir)/info'. (If you are using Autoconf,
+ write it as `@infodir@'.) `infodir' is separate from `docdir' for
+ compatibility with existing practice.
+
+`htmldir'
+`dvidir'
+`pdfdir'
+`psdir'
+ Directories for installing documentation files in the particular
+ format. They should all be set to `$(docdir)' by default. (If
+ you are using Autoconf, write them as `@htmldir@', `@dvidir@',
+ etc.) Packages which supply several translations of their
+ documentation should install them in `$(htmldir)/'LL,
+ `$(pdfdir)/'LL, etc. where LL is a locale abbreviation such as
+ `en' or `pt_BR'.
+
+`libdir'
+ The directory for object files and libraries of object code. Do
+ not install executables here, they probably ought to go in
+ `$(libexecdir)' instead. The value of `libdir' should normally be
+ `/usr/local/lib', but write it as `$(exec_prefix)/lib'. (If you
+ are using Autoconf, write it as `@libdir@'.)
+
+`lispdir'
+ The directory for installing any Emacs Lisp files in this package.
+ By default, it should be `/usr/local/share/emacs/site-lisp', but
+ it should be written as `$(datarootdir)/emacs/site-lisp'.
+
+ If you are using Autoconf, write the default as `@lispdir@'. In
+ order to make `@lispdir@' work, you need the following lines in
+ your `configure.in' file:
+
+ lispdir='${datarootdir}/emacs/site-lisp'
+ AC_SUBST(lispdir)
+
+`localedir'
+ The directory for installing locale-specific message catalogs for
+ this package. By default, it should be `/usr/local/share/locale',
+ but it should be written as `$(datarootdir)/locale'. (If you are
+ using Autoconf, write it as `@localedir@'.) This directory
+ usually has a subdirectory per locale.
+
+ Unix-style man pages are installed in one of the following:
+
+`mandir'
+ The top-level directory for installing the man pages (if any) for
+ this package. It will normally be `/usr/local/share/man', but you
+ should write it as `$(datarootdir)/man'. (If you are using
+ Autoconf, write it as `@mandir@'.)
+
+`man1dir'
+ The directory for installing section 1 man pages. Write it as
+ `$(mandir)/man1'.
+
+`man2dir'
+ The directory for installing section 2 man pages. Write it as
+ `$(mandir)/man2'
+
+`...'
+ *Don't make the primary documentation for any GNU software be a
+ man page. Write a manual in Texinfo instead. Man pages are just
+ for the sake of people running GNU software on Unix, which is a
+ secondary application only.*
+
+`manext'
+ The file name extension for the installed man page. This should
+ contain a period followed by the appropriate digit; it should
+ normally be `.1'.
+
+`man1ext'
+ The file name extension for installed section 1 man pages.
+
+`man2ext'
+ The file name extension for installed section 2 man pages.
+
+`...'
+ Use these names instead of `manext' if the package needs to
+ install man pages in more than one section of the manual.
+
+ And finally, you should set the following variable:
+
+`srcdir'
+ The directory for the sources being compiled. The value of this
+ variable is normally inserted by the `configure' shell script.
+ (If you are using Autoconf, use `srcdir = @srcdir@'.)
+
+ For example:
+
+ # Common prefix for installation directories.
+ # NOTE: This directory must exist when you start the install.
+ prefix = /usr/local
+ datarootdir = $(prefix)/share
+ datadir = $(datarootdir)
+ exec_prefix = $(prefix)
+ # Where to put the executable for the command `gcc'.
+ bindir = $(exec_prefix)/bin
+ # Where to put the directories used by the compiler.
+ libexecdir = $(exec_prefix)/libexec
+ # Where to put the Info files.
+ infodir = $(datarootdir)/info
+
+ If your program installs a large number of files into one of the
+standard user-specified directories, it might be useful to group them
+into a subdirectory particular to that program. If you do this, you
+should write the `install' rule to create these subdirectories.
+
+ Do not expect the user to include the subdirectory name in the value
+of any of the variables listed above. The idea of having a uniform set
+of variable names for installation directories is to enable the user to
+specify the exact same values for several different GNU packages. In
+order for this to be useful, all the packages must be designed so that
+they will work sensibly when the user does so.
+
+ At times, not all of these variables may be implemented in the
+current release of Autoconf and/or Automake; but as of Autoconf 2.60, we
+believe all of them are. When any are missing, the descriptions here
+serve as specifications for what Autoconf will implement. As a
+programmer, you can either use a development version of Autoconf or
+avoid using these variables until a stable release is made which
+supports them.
+
+
+File: standards.info, Node: Standard Targets, Next: Install Command Categories, Prev: Directory Variables, Up: Makefile Conventions
+
+7.2.6 Standard Targets for Users
+--------------------------------
+
+All GNU programs should have the following targets in their Makefiles:
+
+`all'
+ Compile the entire program. This should be the default target.
+ This target need not rebuild any documentation files; Info files
+ should normally be included in the distribution, and DVI (and other
+ documentation format) files should be made only when explicitly
+ asked for.
+
+ By default, the Make rules should compile and link with `-g', so
+ that executable programs have debugging symbols. Users who don't
+ mind being helpless can strip the executables later if they wish.
+
+`install'
+ Compile the program and copy the executables, libraries, and so on
+ to the file names where they should reside for actual use. If
+ there is a simple test to verify that a program is properly
+ installed, this target should run that test.
+
+ Do not strip executables when installing them. Devil-may-care
+ users can use the `install-strip' target to do that.
+
+ If possible, write the `install' target rule so that it does not
+ modify anything in the directory where the program was built,
+ provided `make all' has just been done. This is convenient for
+ building the program under one user name and installing it under
+ another.
+
+ The commands should create all the directories in which files are
+ to be installed, if they don't already exist. This includes the
+ directories specified as the values of the variables `prefix' and
+ `exec_prefix', as well as all subdirectories that are needed. One
+ way to do this is by means of an `installdirs' target as described
+ below.
+
+ Use `-' before any command for installing a man page, so that
+ `make' will ignore any errors. This is in case there are systems
+ that don't have the Unix man page documentation system installed.
+
+ The way to install Info files is to copy them into `$(infodir)'
+ with `$(INSTALL_DATA)' (*note Command Variables::), and then run
+ the `install-info' program if it is present. `install-info' is a
+ program that edits the Info `dir' file to add or update the menu
+ entry for the given Info file; it is part of the Texinfo package.
+ Here is a sample rule to install an Info file:
+
+ $(DESTDIR)$(infodir)/foo.info: foo.info
+ $(POST_INSTALL)
+ # There may be a newer info file in . than in srcdir.
+ -if test -f foo.info; then d=.; \
+ else d=$(srcdir); fi; \
+ $(INSTALL_DATA) $$d/foo.info $(DESTDIR)$@; \
+ # Run install-info only if it exists.
+ # Use `if' instead of just prepending `-' to the
+ # line so we notice real errors from install-info.
+ # We use `$(SHELL) -c' because some shells do not
+ # fail gracefully when there is an unknown command.
+ if $(SHELL) -c 'install-info --version' \
+ >/dev/null 2>&1; then \
+ install-info --dir-file=$(DESTDIR)$(infodir)/dir \
+ $(DESTDIR)$(infodir)/foo.info; \
+ else true; fi
+
+ When writing the `install' target, you must classify all the
+ commands into three categories: normal ones, "pre-installation"
+ commands and "post-installation" commands. *Note Install Command
+ Categories::.
+
+`install-html'
+`install-dvi'
+`install-pdf'
+`install-ps'
+ These targets install documentation in formats other than Info;
+ they're intended to be called explicitly by the person installing
+ the package, if that format is desired. GNU prefers Info files,
+ so these must be installed by the `install' target.
+
+ When you have many documentation files to install, we recommend
+ that you avoid collisions and clutter by arranging for these
+ targets to install in subdirectories of the appropriate
+ installation directory, such as `htmldir'. As one example, if
+ your package has multiple manuals, and you wish to install HTML
+ documentation with many files (such as the "split" mode output by
+ `makeinfo --html'), you'll certainly want to use subdirectories,
+ or two nodes with the same name in different manuals will
+ overwrite each other.
+
+ Please make these `install-FORMAT' targets invoke the commands for
+ the FORMAT target, for example, by making FORMAT a dependency.
+
+`uninstall'
+ Delete all the installed files--the copies that the `install' and
+ `install-*' targets create.
+
+ This rule should not modify the directories where compilation is
+ done, only the directories where files are installed.
+
+ The uninstallation commands are divided into three categories,
+ just like the installation commands. *Note Install Command
+ Categories::.
+
+`install-strip'
+ Like `install', but strip the executable files while installing
+ them. In simple cases, this target can use the `install' target in
+ a simple way:
+
+ install-strip:
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \
+ install
+
+ But if the package installs scripts as well as real executables,
+ the `install-strip' target can't just refer to the `install'
+ target; it has to strip the executables but not the scripts.
+
+ `install-strip' should not strip the executables in the build
+ directory which are being copied for installation. It should only
+ strip the copies that are installed.
+
+ Normally we do not recommend stripping an executable unless you
+ are sure the program has no bugs. However, it can be reasonable
+ to install a stripped executable for actual execution while saving
+ the unstripped executable elsewhere in case there is a bug.
+
+`clean'
+ Delete all files in the current directory that are normally
+ created by building the program. Also delete files in other
+ directories if they are created by this makefile. However, don't
+ delete the files that record the configuration. Also preserve
+ files that could be made by building, but normally aren't because
+ the distribution comes with them. There is no need to delete
+ parent directories that were created with `mkdir -p', since they
+ could have existed anyway.
+
+ Delete `.dvi' files here if they are not part of the distribution.
+
+`distclean'
+ Delete all files in the current directory (or created by this
+ makefile) that are created by configuring or building the program.
+ If you have unpacked the source and built the program without
+ creating any other files, `make distclean' should leave only the
+ files that were in the distribution. However, there is no need to
+ delete parent directories that were created with `mkdir -p', since
+ they could have existed anyway.
+
+`mostlyclean'
+ Like `clean', but may refrain from deleting a few files that people
+ normally don't want to recompile. For example, the `mostlyclean'
+ target for GCC does not delete `libgcc.a', because recompiling it
+ is rarely necessary and takes a lot of time.
+
+`maintainer-clean'
+ Delete almost everything that can be reconstructed with this
+ Makefile. This typically includes everything deleted by
+ `distclean', plus more: C source files produced by Bison, tags
+ tables, Info files, and so on.
+
+ The reason we say "almost everything" is that running the command
+ `make maintainer-clean' should not delete `configure' even if
+ `configure' can be remade using a rule in the Makefile. More
+ generally, `make maintainer-clean' should not delete anything that
+ needs to exist in order to run `configure' and then begin to build
+ the program. Also, there is no need to delete parent directories
+ that were created with `mkdir -p', since they could have existed
+ anyway. These are the only exceptions; `maintainer-clean' should
+ delete everything else that can be rebuilt.
+
+ The `maintainer-clean' target is intended to be used by a
+ maintainer of the package, not by ordinary users. You may need
+ special tools to reconstruct some of the files that `make
+ maintainer-clean' deletes. Since these files are normally
+ included in the distribution, we don't take care to make them easy
+ to reconstruct. If you find you need to unpack the full
+ distribution again, don't blame us.
+
+ To help make users aware of this, the commands for the special
+ `maintainer-clean' target should start with these two:
+
+ @echo 'This command is intended for maintainers to use; it'
+ @echo 'deletes files that may need special tools to rebuild.'
+
+`TAGS'
+ Update a tags table for this program.
+
+`info'
+ Generate any Info files needed. The best way to write the rules
+ is as follows:
+
+ info: foo.info
+
+ foo.info: foo.texi chap1.texi chap2.texi
+ $(MAKEINFO) $(srcdir)/foo.texi
+
+ You must define the variable `MAKEINFO' in the Makefile. It should
+ run the `makeinfo' program, which is part of the Texinfo
+ distribution.
+
+ Normally a GNU distribution comes with Info files, and that means
+ the Info files are present in the source directory. Therefore,
+ the Make rule for an info file should update it in the source
+ directory. When users build the package, ordinarily Make will not
+ update the Info files because they will already be up to date.
+
+`dvi'
+`html'
+`pdf'
+`ps'
+ Generate documentation files in the given format. These targets
+ should always exist, but any or all can be a no-op if the given
+ output format cannot be generated. These targets should not be
+ dependencies of the `all' target; the user must manually invoke
+ them.
+
+ Here's an example rule for generating DVI files from Texinfo:
+
+ dvi: foo.dvi
+
+ foo.dvi: foo.texi chap1.texi chap2.texi
+ $(TEXI2DVI) $(srcdir)/foo.texi
+
+ You must define the variable `TEXI2DVI' in the Makefile. It should
+ run the program `texi2dvi', which is part of the Texinfo
+ distribution.(1) Alternatively, write just the dependencies, and
+ allow GNU `make' to provide the command.
+
+ Here's another example, this one for generating HTML from Texinfo:
+
+ html: foo.html
+
+ foo.html: foo.texi chap1.texi chap2.texi
+ $(TEXI2HTML) $(srcdir)/foo.texi
+
+ Again, you would define the variable `TEXI2HTML' in the Makefile;
+ for example, it might run `makeinfo --no-split --html' (`makeinfo'
+ is part of the Texinfo distribution).
+
+`dist'
+ Create a distribution tar file for this program. The tar file
+ should be set up so that the file names in the tar file start with
+ a subdirectory name which is the name of the package it is a
+ distribution for. This name can include the version number.
+
+ For example, the distribution tar file of GCC version 1.40 unpacks
+ into a subdirectory named `gcc-1.40'.
+
+ The easiest way to do this is to create a subdirectory
+ appropriately named, use `ln' or `cp' to install the proper files
+ in it, and then `tar' that subdirectory.
+
+ Compress the tar file with `gzip'. For example, the actual
+ distribution file for GCC version 1.40 is called `gcc-1.40.tar.gz'.
+
+ The `dist' target should explicitly depend on all non-source files
+ that are in the distribution, to make sure they are up to date in
+ the distribution. *Note Making Releases: Releases.
+
+`check'
+ Perform self-tests (if any). The user must build the program
+ before running the tests, but need not install the program; you
+ should write the self-tests so that they work when the program is
+ built but not installed.
+
+ The following targets are suggested as conventional names, for
+programs in which they are useful.
+
+`installcheck'
+ Perform installation tests (if any). The user must build and
+ install the program before running the tests. You should not
+ assume that `$(bindir)' is in the search path.
+
+`installdirs'
+ It's useful to add a target named `installdirs' to create the
+ directories where files are installed, and their parent
+ directories. There is a script called `mkinstalldirs' which is
+ convenient for this; you can find it in the Texinfo package. You
+ can use a rule like this:
+
+ # Make sure all installation directories (e.g. $(bindir))
+ # actually exist by making them if necessary.
+ installdirs: mkinstalldirs
+ $(srcdir)/mkinstalldirs $(bindir) $(datadir) \
+ $(libdir) $(infodir) \
+ $(mandir)
+
+ or, if you wish to support `DESTDIR',
+
+ # Make sure all installation directories (e.g. $(bindir))
+ # actually exist by making them if necessary.
+ installdirs: mkinstalldirs
+ $(srcdir)/mkinstalldirs \
+ $(DESTDIR)$(bindir) $(DESTDIR)$(datadir) \
+ $(DESTDIR)$(libdir) $(DESTDIR)$(infodir) \
+ $(DESTDIR)$(mandir)
+
+ This rule should not modify the directories where compilation is
+ done. It should do nothing but create installation directories.
+
+ ---------- Footnotes ----------
+
+ (1) `texi2dvi' uses TeX to do the real work of formatting. TeX is
+not distributed with Texinfo.
+
+
+File: standards.info, Node: Install Command Categories, Prev: Standard Targets, Up: Makefile Conventions
+
+7.2.7 Install Command Categories
+--------------------------------
+
+When writing the `install' target, you must classify all the commands
+into three categories: normal ones, "pre-installation" commands and
+"post-installation" commands.
+
+ Normal commands move files into their proper places, and set their
+modes. They may not alter any files except the ones that come entirely
+from the package they belong to.
+
+ Pre-installation and post-installation commands may alter other
+files; in particular, they can edit global configuration files or data
+bases.
+
+ Pre-installation commands are typically executed before the normal
+commands, and post-installation commands are typically run after the
+normal commands.
+
+ The most common use for a post-installation command is to run
+`install-info'. This cannot be done with a normal command, since it
+alters a file (the Info directory) which does not come entirely and
+solely from the package being installed. It is a post-installation
+command because it needs to be done after the normal command which
+installs the package's Info files.
+
+ Most programs don't need any pre-installation commands, but we have
+the feature just in case it is needed.
+
+ To classify the commands in the `install' rule into these three
+categories, insert "category lines" among them. A category line
+specifies the category for the commands that follow.
+
+ A category line consists of a tab and a reference to a special Make
+variable, plus an optional comment at the end. There are three
+variables you can use, one for each category; the variable name
+specifies the category. Category lines are no-ops in ordinary execution
+because these three Make variables are normally undefined (and you
+_should not_ define them in the makefile).
+
+ Here are the three possible category lines, each with a comment that
+explains what it means:
+
+ $(PRE_INSTALL) # Pre-install commands follow.
+ $(POST_INSTALL) # Post-install commands follow.
+ $(NORMAL_INSTALL) # Normal commands follow.
+
+ If you don't use a category line at the beginning of the `install'
+rule, all the commands are classified as normal until the first category
+line. If you don't use any category lines, all the commands are
+classified as normal.
+
+ These are the category lines for `uninstall':
+
+ $(PRE_UNINSTALL) # Pre-uninstall commands follow.
+ $(POST_UNINSTALL) # Post-uninstall commands follow.
+ $(NORMAL_UNINSTALL) # Normal commands follow.
+
+ Typically, a pre-uninstall command would be used for deleting entries
+from the Info directory.
+
+ If the `install' or `uninstall' target has any dependencies which
+act as subroutines of installation, then you should start _each_
+dependency's commands with a category line, and start the main target's
+commands with a category line also. This way, you can ensure that each
+command is placed in the right category regardless of which of the
+dependencies actually run.
+
+ Pre-installation and post-installation commands should not run any
+programs except for these:
+
+ [ basename bash cat chgrp chmod chown cmp cp dd diff echo
+ egrep expand expr false fgrep find getopt grep gunzip gzip
+ hostname install install-info kill ldconfig ln ls md5sum
+ mkdir mkfifo mknod mv printenv pwd rm rmdir sed sort tee
+ test touch true uname xargs yes
+
+ The reason for distinguishing the commands in this way is for the
+sake of making binary packages. Typically a binary package contains
+all the executables and other files that need to be installed, and has
+its own method of installing them--so it does not need to run the normal
+installation commands. But installing the binary package does need to
+execute the pre-installation and post-installation commands.
+
+ Programs to build binary packages work by extracting the
+pre-installation and post-installation commands. Here is one way of
+extracting the pre-installation commands (the `-s' option to `make' is
+needed to silence messages about entering subdirectories):
+
+ make -s -n install -o all \
+ PRE_INSTALL=pre-install \
+ POST_INSTALL=post-install \
+ NORMAL_INSTALL=normal-install \
+ | gawk -f pre-install.awk
+
+where the file `pre-install.awk' could contain this:
+
+ $0 ~ /^(normal-install|post-install)[ \t]*$/ {on = 0}
+ on {print $0}
+ $0 ~ /^pre-install[ \t]*$/ {on = 1}
+
+
+File: standards.info, Node: Releases, Prev: Makefile Conventions, Up: Managing Releases
+
+7.3 Making Releases
+===================
+
+You should identify each release with a pair of version numbers, a
+major version and a minor. We have no objection to using more than two
+numbers, but it is very unlikely that you really need them.
+
+ Package the distribution of `Foo version 69.96' up in a gzipped tar
+file with the name `foo-69.96.tar.gz'. It should unpack into a
+subdirectory named `foo-69.96'.
+
+ Building and installing the program should never modify any of the
+files contained in the distribution. This means that all the files
+that form part of the program in any way must be classified into "source
+files" and "non-source files". Source files are written by humans and
+never changed automatically; non-source files are produced from source
+files by programs under the control of the Makefile.
+
+ The distribution should contain a file named `README' which gives
+the name of the package, and a general description of what it does. It
+is also good to explain the purpose of each of the first-level
+subdirectories in the package, if there are any. The `README' file
+should either state the version number of the package, or refer to where
+in the package it can be found.
+
+ The `README' file should refer to the file `INSTALL', which should
+contain an explanation of the installation procedure.
+
+ The `README' file should also refer to the file which contains the
+copying conditions. The GNU GPL, if used, should be in a file called
+`COPYING'. If the GNU LGPL is used, it should be in a file called
+`COPYING.LIB'.
+
+ Naturally, all the source files must be in the distribution. It is
+okay to include non-source files in the distribution, provided they are
+up-to-date and machine-independent, so that building the distribution
+normally will never modify them. We commonly include non-source files
+produced by Bison, `lex', TeX, and `makeinfo'; this helps avoid
+unnecessary dependencies between our distributions, so that users can
+install whichever packages they want to install.
+
+ Non-source files that might actually be modified by building and
+installing the program should *never* be included in the distribution.
+So if you do distribute non-source files, always make sure they are up
+to date when you make a new distribution.
+
+ Make sure that the directory into which the distribution unpacks (as
+well as any subdirectories) are all world-writable (octal mode 777).
+This is so that old versions of `tar' which preserve the ownership and
+permissions of the files from the tar archive will be able to extract
+all the files even if the user is unprivileged.
+
+ Make sure that all the files in the distribution are world-readable.
+
+ Don't include any symbolic links in the distribution itself. If the
+tar file contains symbolic links, then people cannot even unpack it on
+systems that don't support symbolic links. Also, don't use multiple
+names for one file in different directories, because certain file
+systems cannot handle this and that prevents unpacking the distribution.
+
+ Try to make sure that all the file names will be unique on MS-DOS. A
+name on MS-DOS consists of up to 8 characters, optionally followed by a
+period and up to three characters. MS-DOS will truncate extra
+characters both before and after the period. Thus, `foobarhacker.c'
+and `foobarhacker.o' are not ambiguous; they are truncated to
+`foobarha.c' and `foobarha.o', which are distinct.
+
+ Include in your distribution a copy of the `texinfo.tex' you used to
+test print any `*.texinfo' or `*.texi' files.
+
+ Likewise, if your program uses small GNU software packages like
+regex, getopt, obstack, or termcap, include them in the distribution
+file. Leaving them out would make the distribution file a little
+smaller at the expense of possible inconvenience to a user who doesn't
+know what other files to get.
+
+
+File: standards.info, Node: References, Next: GNU Free Documentation License, Prev: Managing Releases, Up: Top
+
+8 References to Non-Free Software and Documentation
+***************************************************
+
+A GNU program should not recommend use of any non-free program. We
+can't stop some people from writing proprietary programs, or stop other
+people from using them, but we can and should refuse to advertise them
+to new potential customers. Proprietary software is a social and
+ethical problem, and the point of GNU is to solve that problem.
+
+ The GNU definition of free software is found on the GNU web site at
+`http://www.gnu.org/philosophy/free-sw.html', and the definition of
+free documentation is found at
+`http://www.gnu.org/philosophy/free-doc.html'. A list of important
+licenses and whether they qualify as free is in
+`http://www.gnu.org/licenses/license-list.html'. The terms "free" and
+"non-free", used in this document, refer to that definition. If it is
+not clear whether a license qualifies as free under this definition,
+please ask the GNU Project by writing to <licensing@gnu.org>. We will
+answer, and if the license is an important one, we will add it to the
+list.
+
+ When a non-free program or system is well known, you can mention it
+in passing--that is harmless, since users who might want to use it
+probably already know about it. For instance, it is fine to explain
+how to build your package on top of some widely used non-free operating
+system, or how to use it together with some widely used non-free
+program.
+
+ However, you should give only the necessary information to help those
+who already use the non-free program to use your program with it--don't
+give, or refer to, any further information about the proprietary
+program, and don't imply that the proprietary program enhances your
+program, or that its existence is in any way a good thing. The goal
+should be that people already using the proprietary program will get
+the advice they need about how to use your free program with it, while
+people who don't already use the proprietary program will not see
+anything to lead them to take an interest in it.
+
+ If a non-free program or system is obscure in your program's domain,
+your program should not mention or support it at all, since doing so
+would tend to popularize the non-free program more than it popularizes
+your program. (You cannot hope to find many additional users among the
+users of Foobar if the users of Foobar are few.)
+
+ Sometimes a program is free software in itself but depends on a
+non-free platform in order to run. For instance, many Java programs
+depend on the parts of Sun's Java implementation which are not yet free
+software, and won't run on the GNU Java Compiler (which does not yet
+have all the features) or won't run with the GNU Java libraries. We
+hope this particular problem will be gone in a few months, when Sun
+makes the standard Java libraries free software, but of course the
+general principle remains: you should not recommend programs that
+depend on non-free software to run.
+
+ Some free programs encourage the use of non-free software. A typical
+example is `mplayer'. It is free software in itself, and the free code
+can handle some kinds of files. However, `mplayer' recommends use of
+non-free codecs for other kinds of files, and users that install
+`mplayer' are very likely to install those codecs along with it. To
+recommend `mplayer' is, in effect, to recommend the non-free codecs.
+We must not do that, so we cannot recommend `mplayer' either.
+
+ In general, you should also not recommend programs that themselves
+strongly recommend the use of non-free software.
+
+ A GNU package should not refer the user to any non-free documentation
+for free software. Free documentation that can be included in free
+operating systems is essential for completing the GNU system, or any
+free operating system, so it is a major focus of the GNU Project; to
+recommend use of documentation that we are not allowed to use in GNU
+would weaken the impetus for the community to produce documentation
+that we can include. So GNU packages should never recommend non-free
+documentation.
+
+ By contrast, it is ok to refer to journal articles and textbooks in
+the comments of a program for explanation of how it functions, even
+though they be non-free. This is because we don't include such things
+in the GNU system even if we are allowed to--they are outside the scope
+of an operating system project.
+
+ Referring to a web site that describes or recommends a non-free
+program is in effect promoting that software, so please do not make
+links (or mention by name) web sites that contain such material. This
+policy is relevant particularly for the web pages for a GNU package.
+
+ Following links from nearly any web site can lead to non-free
+software; this is an inescapable aspect of the nature of the web, and
+in itself is no objection to linking to a site. As long as the site
+does not itself recommend a non-free program, there is no need be
+concerned about the sites it links to for other reasons.
+
+ Thus, for example, you should not make a link to AT&T's web site,
+because that recommends AT&T's non-free software packages; you should
+not make a link to a site that links to AT&T's site saying it is a
+place to get a non-free program; but if a site you want to link to
+refers to AT&T's web site in some other context (such as long-distance
+telephone service), that is not a problem.
+
+
+File: standards.info, Node: GNU Free Documentation License, Next: Index, Prev: References, Up: Top
+
+Appendix A GNU Free Documentation License
+*****************************************
+
+ Version 1.2, November 2002
+
+ Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ 0. PREAMBLE
+
+ The purpose of this License is to make a manual, textbook, or other
+ functional and useful document "free" in the sense of freedom: to
+ assure everyone the effective freedom to copy and redistribute it,
+ with or without modifying it, either commercially or
+ noncommercially. Secondarily, this License preserves for the
+ author and publisher a way to get credit for their work, while not
+ being considered responsible for modifications made by others.
+
+ This License is a kind of "copyleft", which means that derivative
+ works of the document must themselves be free in the same sense.
+ It complements the GNU General Public License, which is a copyleft
+ license designed for free software.
+
+ We have designed this License in order to use it for manuals for
+ free software, because free software needs free documentation: a
+ free program should come with manuals providing the same freedoms
+ that the software does. But this License is not limited to
+ software manuals; it can be used for any textual work, regardless
+ of subject matter or whether it is published as a printed book.
+ We recommend this License principally for works whose purpose is
+ instruction or reference.
+
+ 1. APPLICABILITY AND DEFINITIONS
+
+ This License applies to any manual or other work, in any medium,
+ that contains a notice placed by the copyright holder saying it
+ can be distributed under the terms of this License. Such a notice
+ grants a world-wide, royalty-free license, unlimited in duration,
+ to use that work under the conditions stated herein. The
+ "Document", below, refers to any such manual or work. Any member
+ of the public is a licensee, and is addressed as "you". You
+ accept the license if you copy, modify or distribute the work in a
+ way requiring permission under copyright law.
+
+ A "Modified Version" of the Document means any work containing the
+ Document or a portion of it, either copied verbatim, or with
+ modifications and/or translated into another language.
+
+ A "Secondary Section" is a named appendix or a front-matter section
+ of the Document that deals exclusively with the relationship of the
+ publishers or authors of the Document to the Document's overall
+ subject (or to related matters) and contains nothing that could
+ fall directly within that overall subject. (Thus, if the Document
+ is in part a textbook of mathematics, a Secondary Section may not
+ explain any mathematics.) The relationship could be a matter of
+ historical connection with the subject or with related matters, or
+ of legal, commercial, philosophical, ethical or political position
+ regarding them.
+
+ The "Invariant Sections" are certain Secondary Sections whose
+ titles are designated, as being those of Invariant Sections, in
+ the notice that says that the Document is released under this
+ License. If a section does not fit the above definition of
+ Secondary then it is not allowed to be designated as Invariant.
+ The Document may contain zero Invariant Sections. If the Document
+ does not identify any Invariant Sections then there are none.
+
+ The "Cover Texts" are certain short passages of text that are
+ listed, as Front-Cover Texts or Back-Cover Texts, in the notice
+ that says that the Document is released under this License. A
+ Front-Cover Text may be at most 5 words, and a Back-Cover Text may
+ be at most 25 words.
+
+ A "Transparent" copy of the Document means a machine-readable copy,
+ represented in a format whose specification is available to the
+ general public, that is suitable for revising the document
+ straightforwardly with generic text editors or (for images
+ composed of pixels) generic paint programs or (for drawings) some
+ widely available drawing editor, and that is suitable for input to
+ text formatters or for automatic translation to a variety of
+ formats suitable for input to text formatters. A copy made in an
+ otherwise Transparent file format whose markup, or absence of
+ markup, has been arranged to thwart or discourage subsequent
+ modification by readers is not Transparent. An image format is
+ not Transparent if used for any substantial amount of text. A
+ copy that is not "Transparent" is called "Opaque".
+
+ Examples of suitable formats for Transparent copies include plain
+ ASCII without markup, Texinfo input format, LaTeX input format,
+ SGML or XML using a publicly available DTD, and
+ standard-conforming simple HTML, PostScript or PDF designed for
+ human modification. Examples of transparent image formats include
+ PNG, XCF and JPG. Opaque formats include proprietary formats that
+ can be read and edited only by proprietary word processors, SGML or
+ XML for which the DTD and/or processing tools are not generally
+ available, and the machine-generated HTML, PostScript or PDF
+ produced by some word processors for output purposes only.
+
+ The "Title Page" means, for a printed book, the title page itself,
+ plus such following pages as are needed to hold, legibly, the
+ material this License requires to appear in the title page. For
+ works in formats which do not have any title page as such, "Title
+ Page" means the text near the most prominent appearance of the
+ work's title, preceding the beginning of the body of the text.
+
+ A section "Entitled XYZ" means a named subunit of the Document
+ whose title either is precisely XYZ or contains XYZ in parentheses
+ following text that translates XYZ in another language. (Here XYZ
+ stands for a specific section name mentioned below, such as
+ "Acknowledgements", "Dedications", "Endorsements", or "History".)
+ To "Preserve the Title" of such a section when you modify the
+ Document means that it remains a section "Entitled XYZ" according
+ to this definition.
+
+ The Document may include Warranty Disclaimers next to the notice
+ which states that this License applies to the Document. These
+ Warranty Disclaimers are considered to be included by reference in
+ this License, but only as regards disclaiming warranties: any other
+ implication that these Warranty Disclaimers may have is void and
+ has no effect on the meaning of this License.
+
+ 2. VERBATIM COPYING
+
+ You may copy and distribute the Document in any medium, either
+ commercially or noncommercially, provided that this License, the
+ copyright notices, and the license notice saying this License
+ applies to the Document are reproduced in all copies, and that you
+ add no other conditions whatsoever to those of this License. You
+ may not use technical measures to obstruct or control the reading
+ or further copying of the copies you make or distribute. However,
+ you may accept compensation in exchange for copies. If you
+ distribute a large enough number of copies you must also follow
+ the conditions in section 3.
+
+ You may also lend copies, under the same conditions stated above,
+ and you may publicly display copies.
+
+ 3. COPYING IN QUANTITY
+
+ If you publish printed copies (or copies in media that commonly
+ have printed covers) of the Document, numbering more than 100, and
+ the Document's license notice requires Cover Texts, you must
+ enclose the copies in covers that carry, clearly and legibly, all
+ these Cover Texts: Front-Cover Texts on the front cover, and
+ Back-Cover Texts on the back cover. Both covers must also clearly
+ and legibly identify you as the publisher of these copies. The
+ front cover must present the full title with all words of the
+ title equally prominent and visible. You may add other material
+ on the covers in addition. Copying with changes limited to the
+ covers, as long as they preserve the title of the Document and
+ satisfy these conditions, can be treated as verbatim copying in
+ other respects.
+
+ If the required texts for either cover are too voluminous to fit
+ legibly, you should put the first ones listed (as many as fit
+ reasonably) on the actual cover, and continue the rest onto
+ adjacent pages.
+
+ If you publish or distribute Opaque copies of the Document
+ numbering more than 100, you must either include a
+ machine-readable Transparent copy along with each Opaque copy, or
+ state in or with each Opaque copy a computer-network location from
+ which the general network-using public has access to download
+ using public-standard network protocols a complete Transparent
+ copy of the Document, free of added material. If you use the
+ latter option, you must take reasonably prudent steps, when you
+ begin distribution of Opaque copies in quantity, to ensure that
+ this Transparent copy will remain thus accessible at the stated
+ location until at least one year after the last time you
+ distribute an Opaque copy (directly or through your agents or
+ retailers) of that edition to the public.
+
+ It is requested, but not required, that you contact the authors of
+ the Document well before redistributing any large number of
+ copies, to give them a chance to provide you with an updated
+ version of the Document.
+
+ 4. MODIFICATIONS
+
+ You may copy and distribute a Modified Version of the Document
+ under the conditions of sections 2 and 3 above, provided that you
+ release the Modified Version under precisely this License, with
+ the Modified Version filling the role of the Document, thus
+ licensing distribution and modification of the Modified Version to
+ whoever possesses a copy of it. In addition, you must do these
+ things in the Modified Version:
+
+ A. Use in the Title Page (and on the covers, if any) a title
+ distinct from that of the Document, and from those of
+ previous versions (which should, if there were any, be listed
+ in the History section of the Document). You may use the
+ same title as a previous version if the original publisher of
+ that version gives permission.
+
+ B. List on the Title Page, as authors, one or more persons or
+ entities responsible for authorship of the modifications in
+ the Modified Version, together with at least five of the
+ principal authors of the Document (all of its principal
+ authors, if it has fewer than five), unless they release you
+ from this requirement.
+
+ C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+
+ D. Preserve all the copyright notices of the Document.
+
+ E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+
+ F. Include, immediately after the copyright notices, a license
+ notice giving the public permission to use the Modified
+ Version under the terms of this License, in the form shown in
+ the Addendum below.
+
+ G. Preserve in that license notice the full lists of Invariant
+ Sections and required Cover Texts given in the Document's
+ license notice.
+
+ H. Include an unaltered copy of this License.
+
+ I. Preserve the section Entitled "History", Preserve its Title,
+ and add to it an item stating at least the title, year, new
+ authors, and publisher of the Modified Version as given on
+ the Title Page. If there is no section Entitled "History" in
+ the Document, create one stating the title, year, authors,
+ and publisher of the Document as given on its Title Page,
+ then add an item describing the Modified Version as stated in
+ the previous sentence.
+
+ J. Preserve the network location, if any, given in the Document
+ for public access to a Transparent copy of the Document, and
+ likewise the network locations given in the Document for
+ previous versions it was based on. These may be placed in
+ the "History" section. You may omit a network location for a
+ work that was published at least four years before the
+ Document itself, or if the original publisher of the version
+ it refers to gives permission.
+
+ K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the
+ section all the substance and tone of each of the contributor
+ acknowledgements and/or dedications given therein.
+
+ L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section
+ titles.
+
+ M. Delete any section Entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+
+ N. Do not retitle any existing section to be Entitled
+ "Endorsements" or to conflict in title with any Invariant
+ Section.
+
+ O. Preserve any Warranty Disclaimers.
+
+ If the Modified Version includes new front-matter sections or
+ appendices that qualify as Secondary Sections and contain no
+ material copied from the Document, you may at your option
+ designate some or all of these sections as invariant. To do this,
+ add their titles to the list of Invariant Sections in the Modified
+ Version's license notice. These titles must be distinct from any
+ other section titles.
+
+ You may add a section Entitled "Endorsements", provided it contains
+ nothing but endorsements of your Modified Version by various
+ parties--for example, statements of peer review or that the text
+ has been approved by an organization as the authoritative
+ definition of a standard.
+
+ You may add a passage of up to five words as a Front-Cover Text,
+ and a passage of up to 25 words as a Back-Cover Text, to the end
+ of the list of Cover Texts in the Modified Version. Only one
+ passage of Front-Cover Text and one of Back-Cover Text may be
+ added by (or through arrangements made by) any one entity. If the
+ Document already includes a cover text for the same cover,
+ previously added by you or by arrangement made by the same entity
+ you are acting on behalf of, you may not add another; but you may
+ replace the old one, on explicit permission from the previous
+ publisher that added the old one.
+
+ The author(s) and publisher(s) of the Document do not by this
+ License give permission to use their names for publicity for or to
+ assert or imply endorsement of any Modified Version.
+
+ 5. COMBINING DOCUMENTS
+
+ You may combine the Document with other documents released under
+ this License, under the terms defined in section 4 above for
+ modified versions, provided that you include in the combination
+ all of the Invariant Sections of all of the original documents,
+ unmodified, and list them all as Invariant Sections of your
+ combined work in its license notice, and that you preserve all
+ their Warranty Disclaimers.
+
+ The combined work need only contain one copy of this License, and
+ multiple identical Invariant Sections may be replaced with a single
+ copy. If there are multiple Invariant Sections with the same name
+ but different contents, make the title of each such section unique
+ by adding at the end of it, in parentheses, the name of the
+ original author or publisher of that section if known, or else a
+ unique number. Make the same adjustment to the section titles in
+ the list of Invariant Sections in the license notice of the
+ combined work.
+
+ In the combination, you must combine any sections Entitled
+ "History" in the various original documents, forming one section
+ Entitled "History"; likewise combine any sections Entitled
+ "Acknowledgements", and any sections Entitled "Dedications". You
+ must delete all sections Entitled "Endorsements."
+
+ 6. COLLECTIONS OF DOCUMENTS
+
+ You may make a collection consisting of the Document and other
+ documents released under this License, and replace the individual
+ copies of this License in the various documents with a single copy
+ that is included in the collection, provided that you follow the
+ rules of this License for verbatim copying of each of the
+ documents in all other respects.
+
+ You may extract a single document from such a collection, and
+ distribute it individually under this License, provided you insert
+ a copy of this License into the extracted document, and follow
+ this License in all other respects regarding verbatim copying of
+ that document.
+
+ 7. AGGREGATION WITH INDEPENDENT WORKS
+
+ A compilation of the Document or its derivatives with other
+ separate and independent documents or works, in or on a volume of
+ a storage or distribution medium, is called an "aggregate" if the
+ copyright resulting from the compilation is not used to limit the
+ legal rights of the compilation's users beyond what the individual
+ works permit. When the Document is included in an aggregate, this
+ License does not apply to the other works in the aggregate which
+ are not themselves derivative works of the Document.
+
+ If the Cover Text requirement of section 3 is applicable to these
+ copies of the Document, then if the Document is less than one half
+ of the entire aggregate, the Document's Cover Texts may be placed
+ on covers that bracket the Document within the aggregate, or the
+ electronic equivalent of covers if the Document is in electronic
+ form. Otherwise they must appear on printed covers that bracket
+ the whole aggregate.
+
+ 8. TRANSLATION
+
+ Translation is considered a kind of modification, so you may
+ distribute translations of the Document under the terms of section
+ 4. Replacing Invariant Sections with translations requires special
+ permission from their copyright holders, but you may include
+ translations of some or all Invariant Sections in addition to the
+ original versions of these Invariant Sections. You may include a
+ translation of this License, and all the license notices in the
+ Document, and any Warranty Disclaimers, provided that you also
+ include the original English version of this License and the
+ original versions of those notices and disclaimers. In case of a
+ disagreement between the translation and the original version of
+ this License or a notice or disclaimer, the original version will
+ prevail.
+
+ If a section in the Document is Entitled "Acknowledgements",
+ "Dedications", or "History", the requirement (section 4) to
+ Preserve its Title (section 1) will typically require changing the
+ actual title.
+
+ 9. TERMINATION
+
+ You may not copy, modify, sublicense, or distribute the Document
+ except as expressly provided for under this License. Any other
+ attempt to copy, modify, sublicense or distribute the Document is
+ void, and will automatically terminate your rights under this
+ License. However, parties who have received copies, or rights,
+ from you under this License will not have their licenses
+ terminated so long as such parties remain in full compliance.
+
+ 10. FUTURE REVISIONS OF THIS LICENSE
+
+ The Free Software Foundation may publish new, revised versions of
+ the GNU Free Documentation License from time to time. Such new
+ versions will be similar in spirit to the present version, but may
+ differ in detail to address new problems or concerns. See
+ `http://www.gnu.org/copyleft/'.
+
+ Each version of the License is given a distinguishing version
+ number. If the Document specifies that a particular numbered
+ version of this License "or any later version" applies to it, you
+ have the option of following the terms and conditions either of
+ that specified version or of any later version that has been
+ published (not as a draft) by the Free Software Foundation. If
+ the Document does not specify a version number of this License,
+ you may choose any version ever published (not as a draft) by the
+ Free Software Foundation.
+
+ADDENDUM: How to use this License for your documents
+====================================================
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and license
+notices just after the title page:
+
+ Copyright (C) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.2
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+ Texts. A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
+
+ If you have Invariant Sections, Front-Cover Texts and Back-Cover
+Texts, replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with
+ the Front-Cover Texts being LIST, and with the Back-Cover Texts
+ being LIST.
+
+ If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+ If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License, to
+permit their use in free software.
+
+
+File: standards.info, Node: Index, Prev: GNU Free Documentation License, Up: Top
+
+Index
+*****
+
+
+* Menu:
+
+* #endif, commenting: Comments. (line 60)
+* --help output: --help. (line 6)
+* --version output: --version. (line 6)
+* -Wall compiler option: Syntactic Conventions.
+ (line 10)
+* accepting contributions: Contributions. (line 6)
+* address for bug reports: --help. (line 11)
+* ANSI C standard: Standard C. (line 6)
+* arbitrary limits on data: Semantics. (line 6)
+* ASCII characters: Character Set. (line 6)
+* autoconf: System Portability. (line 23)
+* avoiding proprietary code: Reading Non-Free Code.
+ (line 6)
+* behavior, dependent on program's name: User Interfaces. (line 6)
+* binary packages: Install Command Categories.
+ (line 80)
+* bindir: Directory Variables. (line 54)
+* braces, in C source: Formatting. (line 6)
+* bug reports: --help. (line 11)
+* canonical name of a program: --version. (line 12)
+* casting pointers to integers: CPU Portability. (line 90)
+* CGI programs, standard options for: Command-Line Interfaces.
+ (line 31)
+* change logs: Change Logs. (line 6)
+* change logs, conditional changes: Conditional Changes. (line 6)
+* change logs, style: Style of Change Logs.
+ (line 6)
+* character set: Character Set. (line 6)
+* command-line arguments, decoding: Semantics. (line 46)
+* command-line interface: Command-Line Interfaces.
+ (line 6)
+* commenting: Comments. (line 6)
+* compatibility with C and POSIX standards: Compatibility. (line 6)
+* compiler warnings: Syntactic Conventions.
+ (line 10)
+* conditional changes, and change logs: Conditional Changes. (line 6)
+* conditionals, comments for: Comments. (line 60)
+* configure: Configuration. (line 6)
+* control-L: Formatting. (line 118)
+* conventions for makefiles: Makefile Conventions.
+ (line 6)
+* corba: Graphical Interfaces.
+ (line 16)
+* credits for manuals: Manual Credits. (line 6)
+* data types, and portability: CPU Portability. (line 6)
+* declaration for system functions: System Functions. (line 21)
+* DESTDIR: DESTDIR. (line 6)
+* documentation: Documentation. (line 6)
+* doschk: Names. (line 38)
+* downloading this manual: Preface. (line 17)
+* encodings: Character Set. (line 6)
+* error messages: Semantics. (line 19)
+* error messages, formatting: Errors. (line 6)
+* exec_prefix: Directory Variables. (line 36)
+* expressions, splitting: Formatting. (line 81)
+* FDL, GNU Free Documentation License: GNU Free Documentation License.
+ (line 6)
+* file usage: File Usage. (line 6)
+* file-name limitations: Names. (line 38)
+* formatting error messages: Errors. (line 6)
+* formatting source code: Formatting. (line 6)
+* formfeed: Formatting. (line 118)
+* function argument, declaring: Syntactic Conventions.
+ (line 6)
+* function prototypes: Standard C. (line 17)
+* getopt: Command-Line Interfaces.
+ (line 6)
+* gettext: Internationalization.
+ (line 6)
+* gnome: Graphical Interfaces.
+ (line 16)
+* graphical user interface: Graphical Interfaces.
+ (line 6)
+* grave accent: Quote Characters. (line 6)
+* gtk+: Graphical Interfaces.
+ (line 6)
+* GUILE: Source Language. (line 38)
+* implicit int: Syntactic Conventions.
+ (line 6)
+* impossible conditions: Semantics. (line 70)
+* installations, staged: DESTDIR. (line 6)
+* internationalization: Internationalization.
+ (line 6)
+* left quote: Quote Characters. (line 6)
+* legal aspects: Legal Issues. (line 6)
+* legal papers: Contributions. (line 6)
+* libexecdir: Directory Variables. (line 67)
+* libraries: Libraries. (line 6)
+* library functions, and portability: System Functions. (line 6)
+* license for manuals: License for Manuals. (line 6)
+* lint: Syntactic Conventions.
+ (line 109)
+* locale-specific quote characters: Quote Characters. (line 6)
+* long option names: Option Table. (line 6)
+* long-named options: Command-Line Interfaces.
+ (line 12)
+* makefile, conventions for: Makefile Conventions.
+ (line 6)
+* malloc return value: Semantics. (line 25)
+* man pages: Man Pages. (line 6)
+* manual structure: Manual Structure Details.
+ (line 6)
+* memory allocation failure: Semantics. (line 25)
+* memory usage: Memory Usage. (line 6)
+* message text, and internationalization: Internationalization.
+ (line 29)
+* mmap: Mmap. (line 6)
+* multiple variables in a line: Syntactic Conventions.
+ (line 35)
+* names of variables, functions, and files: Names. (line 6)
+* NEWS file: NEWS File. (line 6)
+* non-ASCII characters: Character Set. (line 6)
+* non-POSIX systems, and portability: System Portability. (line 32)
+* non-standard extensions: Using Extensions. (line 6)
+* NUL characters: Semantics. (line 11)
+* open brace: Formatting. (line 6)
+* optional features, configure-time: Configuration. (line 83)
+* options for compatibility: Compatibility. (line 14)
+* options, standard command-line: Command-Line Interfaces.
+ (line 31)
+* output device and program's behavior: User Interfaces. (line 13)
+* packaging: Releases. (line 6)
+* PATH_INFO, specifying standard options as: Command-Line Interfaces.
+ (line 31)
+* portability, and data types: CPU Portability. (line 6)
+* portability, and library functions: System Functions. (line 6)
+* portability, between system types: System Portability. (line 6)
+* POSIX compatibility: Compatibility. (line 6)
+* POSIXLY_CORRECT, environment variable: Compatibility. (line 21)
+* post-installation commands: Install Command Categories.
+ (line 6)
+* pre-installation commands: Install Command Categories.
+ (line 6)
+* prefix: Directory Variables. (line 26)
+* program configuration: Configuration. (line 6)
+* program design: Design Advice. (line 6)
+* program name and its behavior: User Interfaces. (line 6)
+* program's canonical name: --version. (line 12)
+* programming languages: Source Language. (line 6)
+* proprietary programs: Reading Non-Free Code.
+ (line 6)
+* quote characters: Quote Characters. (line 6)
+* README file: Releases. (line 21)
+* references to non-free material: References. (line 6)
+* releasing: Managing Releases. (line 6)
+* sbindir: Directory Variables. (line 60)
+* signal handling: Semantics. (line 59)
+* spaces before open-paren: Formatting. (line 75)
+* staged installs: DESTDIR. (line 6)
+* standard command-line options: Command-Line Interfaces.
+ (line 31)
+* standards for makefiles: Makefile Conventions.
+ (line 6)
+* string library functions: System Functions. (line 55)
+* syntactic conventions: Syntactic Conventions.
+ (line 6)
+* table of long options: Option Table. (line 6)
+* temporary files: Semantics. (line 84)
+* temporary variables: Syntactic Conventions.
+ (line 23)
+* texinfo.tex, in a distribution: Releases. (line 70)
+* TMPDIR environment variable: Semantics. (line 84)
+* trademarks: Trademarks. (line 6)
+* where to obtain standards.texi: Preface. (line 17)
+
+
+
+Tag Table:
+Node: Top797
+Node: Preface2053
+Node: Legal Issues4168
+Node: Reading Non-Free Code4638
+Node: Contributions6368
+Node: Trademarks8606
+Node: Design Advice10241
+Node: Source Language10833
+Node: Compatibility12845
+Node: Using Extensions14473
+Node: Standard C16049
+Node: Conditional Compilation18452
+Node: Program Behavior19850
+Node: Non-GNU Standards20906
+Node: Semantics23187
+Node: Libraries27906
+Node: Errors29151
+Node: User Interfaces31644
+Node: Graphical Interfaces33249
+Node: Command-Line Interfaces34285
+Node: --version36317
+Node: --help42210
+Node: Option Table42764
+Node: Memory Usage57705
+Node: File Usage58736
+Node: Writing C59486
+Node: Formatting60458
+Node: Comments64747
+Node: Syntactic Conventions68299
+Node: Names71761
+Node: System Portability73973
+Node: CPU Portability76863
+Node: System Functions80775
+Node: Internationalization85972
+Node: Character Set89966
+Node: Quote Characters90779
+Node: Mmap92299
+Node: Documentation93007
+Node: GNU Manuals94113
+Node: Doc Strings and Manuals99851
+Node: Manual Structure Details101404
+Node: License for Manuals102822
+Node: Manual Credits103796
+Node: Printed Manuals104189
+Node: NEWS File104875
+Node: Change Logs105553
+Node: Change Log Concepts106307
+Node: Style of Change Logs108396
+Node: Simple Changes110896
+Node: Conditional Changes112338
+Node: Indicating the Part Changed113760
+Node: Man Pages114287
+Node: Reading other Manuals116599
+Node: Managing Releases117390
+Node: Configuration118171
+Node: Makefile Conventions125891
+Node: Makefile Basics126773
+Node: Utilities in Makefiles129947
+Node: Command Variables132092
+Node: DESTDIR135314
+Node: Directory Variables137463
+Node: Standard Targets151956
+Ref: Standard Targets-Footnote-1165471
+Node: Install Command Categories165571
+Node: Releases170104
+Node: References174031
+Node: GNU Free Documentation License179526
+Node: Index201958
+
+End Tag Table
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-addr2line.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-addr2line.1
new file mode 100644
index 0000000..c77f989
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-addr2line.1
@@ -0,0 +1,273 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "ADDR2LINE 1"
+.TH ADDR2LINE 1 "2009-10-16" "binutils-2.20" "GNU Development Tools"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+addr2line \- convert addresses into file names and line numbers.
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+addr2line [\fB\-b\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR]
+ [\fB\-C\fR|\fB\-\-demangle\fR[=\fIstyle\fR]]
+ [\fB\-e\fR \fIfilename\fR|\fB\-\-exe=\fR\fIfilename\fR]
+ [\fB\-f\fR|\fB\-\-functions\fR] [\fB\-s\fR|\fB\-\-basename\fR]
+ [\fB\-i\fR|\fB\-\-inlines\fR]
+ [\fB\-j\fR|\fB\-\-section=\fR\fIname\fR]
+ [\fB\-H\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR]
+ [addr addr ...]
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+\&\fBaddr2line\fR translates addresses into file names and line numbers.
+Given an address in an executable or an offset in a section of a relocatable
+object, it uses the debugging information to figure out which file name and
+line number are associated with it.
+.PP
+The executable or relocatable object to use is specified with the \fB\-e\fR
+option. The default is the file \fIa.out\fR. The section in the relocatable
+object to use is specified with the \fB\-j\fR option.
+.PP
+\&\fBaddr2line\fR has two modes of operation.
+.PP
+In the first, hexadecimal addresses are specified on the command line,
+and \fBaddr2line\fR displays the file name and line number for each
+address.
+.PP
+In the second, \fBaddr2line\fR reads hexadecimal addresses from
+standard input, and prints the file name and line number for each
+address on standard output. In this mode, \fBaddr2line\fR may be used
+in a pipe to convert dynamically chosen addresses.
+.PP
+The format of the output is \fB\s-1FILENAME:LINENO\s0\fR. The file name and
+line number for each address is printed on a separate line. If the
+\&\fB\-f\fR option is used, then each \fB\s-1FILENAME:LINENO\s0\fR line is
+preceded by a \fB\s-1FUNCTIONNAME\s0\fR line which is the name of the function
+containing the address.
+.PP
+If the file name or function name can not be determined,
+\&\fBaddr2line\fR will print two question marks in their place. If the
+line number can not be determined, \fBaddr2line\fR will print 0.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+The long and short forms of options, shown here as alternatives, are
+equivalent.
+.IP "\fB\-b\fR \fIbfdname\fR" 4
+.IX Item "-b bfdname"
+.PD 0
+.IP "\fB\-\-target=\fR\fIbfdname\fR" 4
+.IX Item "--target=bfdname"
+.PD
+Specify that the object-code format for the object files is
+\&\fIbfdname\fR.
+.IP "\fB\-C\fR" 4
+.IX Item "-C"
+.PD 0
+.IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4
+.IX Item "--demangle[=style]"
+.PD
+Decode (\fIdemangle\fR) low-level symbol names into user-level names.
+Besides removing any initial underscore prepended by the system, this
+makes \*(C+ function names readable. Different compilers have different
+mangling styles. The optional demangling style argument can be used to
+choose an appropriate demangling style for your compiler.
+.IP "\fB\-e\fR \fIfilename\fR" 4
+.IX Item "-e filename"
+.PD 0
+.IP "\fB\-\-exe=\fR\fIfilename\fR" 4
+.IX Item "--exe=filename"
+.PD
+Specify the name of the executable for which addresses should be
+translated. The default file is \fIa.out\fR.
+.IP "\fB\-f\fR" 4
+.IX Item "-f"
+.PD 0
+.IP "\fB\-\-functions\fR" 4
+.IX Item "--functions"
+.PD
+Display function names as well as file and line number information.
+.IP "\fB\-s\fR" 4
+.IX Item "-s"
+.PD 0
+.IP "\fB\-\-basenames\fR" 4
+.IX Item "--basenames"
+.PD
+Display only the base of each file name.
+.IP "\fB\-i\fR" 4
+.IX Item "-i"
+.PD 0
+.IP "\fB\-\-inlines\fR" 4
+.IX Item "--inlines"
+.PD
+If the address belongs to a function that was inlined, the source
+information for all enclosing scopes back to the first non-inlined
+function will also be printed. For example, if \f(CW\*(C`main\*(C'\fR inlines
+\&\f(CW\*(C`callee1\*(C'\fR which inlines \f(CW\*(C`callee2\*(C'\fR, and address is from
+\&\f(CW\*(C`callee2\*(C'\fR, the source information for \f(CW\*(C`callee1\*(C'\fR and \f(CW\*(C`main\*(C'\fR
+will also be printed.
+.IP "\fB\-j\fR" 4
+.IX Item "-j"
+.PD 0
+.IP "\fB\-\-section\fR" 4
+.IX Item "--section"
+.PD
+Read offsets relative to the specified section instead of absolute addresses.
+.IP "\fB@\fR\fIfile\fR" 4
+.IX Item "@file"
+Read command-line options from \fIfile\fR. The options read are
+inserted in place of the original @\fIfile\fR option. If \fIfile\fR
+does not exist, or cannot be read, then the option will be treated
+literally, and not removed.
+.Sp
+Options in \fIfile\fR are separated by whitespace. A whitespace
+character may be included in an option by surrounding the entire
+option in either single or double quotes. Any character (including a
+backslash) may be included by prefixing the character to be included
+with a backslash. The \fIfile\fR may itself contain additional
+@\fIfile\fR options; any such options will be processed recursively.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+Info entries for \fIbinutils\fR.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, with no Front-Cover Texts, and with no
+Back-Cover Texts. A copy of the license is included in the
+section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-ar.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-ar.1
new file mode 100644
index 0000000..9fa94e1
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-ar.1
@@ -0,0 +1,429 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "AR 1"
+.TH AR 1 "2009-10-16" "binutils-2.20" "GNU Development Tools"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+ar \- create, modify, and extract from archives
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+ar [\fB\-\-plugin\fR \fIname\fR] [\fB\-X32_64\fR] [\fB\-\fR]\fIp\fR[\fImod\fR [\fIrelpos\fR] [\fIcount\fR]] \fIarchive\fR [\fImember\fR...]
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+The \s-1GNU\s0 \fBar\fR program creates, modifies, and extracts from
+archives. An \fIarchive\fR is a single file holding a collection of
+other files in a structure that makes it possible to retrieve
+the original individual files (called \fImembers\fR of the archive).
+.PP
+The original files' contents, mode (permissions), timestamp, owner, and
+group are preserved in the archive, and can be restored on
+extraction.
+.PP
+\&\s-1GNU\s0 \fBar\fR can maintain archives whose members have names of any
+length; however, depending on how \fBar\fR is configured on your
+system, a limit on member-name length may be imposed for compatibility
+with archive formats maintained with other tools. If it exists, the
+limit is often 15 characters (typical of formats related to a.out) or 16
+characters (typical of formats related to coff).
+.PP
+\&\fBar\fR is considered a binary utility because archives of this sort
+are most often used as \fIlibraries\fR holding commonly needed
+subroutines.
+.PP
+\&\fBar\fR creates an index to the symbols defined in relocatable
+object modules in the archive when you specify the modifier \fBs\fR.
+Once created, this index is updated in the archive whenever \fBar\fR
+makes a change to its contents (save for the \fBq\fR update operation).
+An archive with such an index speeds up linking to the library, and
+allows routines in the library to call each other without regard to
+their placement in the archive.
+.PP
+You may use \fBnm \-s\fR or \fBnm \-\-print\-armap\fR to list this index
+table. If an archive lacks the table, another form of \fBar\fR called
+\&\fBranlib\fR can be used to add just the table.
+.PP
+\&\s-1GNU\s0 \fBar\fR can optionally create a \fIthin\fR archive,
+which contains a symbol index and references to the original copies
+of the member files of the archives. Such an archive is useful
+for building libraries for use within a local build, where the
+relocatable objects are expected to remain available, and copying the
+contents of each object would only waste time and space. Thin archives
+are also \fIflattened\fR, so that adding one or more archives to a
+thin archive will add the elements of the nested archive individually.
+The paths to the elements of the archive are stored relative to the
+archive itself.
+.PP
+\&\s-1GNU\s0 \fBar\fR is designed to be compatible with two different
+facilities. You can control its activity using command-line options,
+like the different varieties of \fBar\fR on Unix systems; or, if you
+specify the single command-line option \fB\-M\fR, you can control it
+with a script supplied via standard input, like the \s-1MRI\s0 \*(L"librarian\*(R"
+program.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+\&\s-1GNU\s0 \fBar\fR allows you to mix the operation code \fIp\fR and modifier
+flags \fImod\fR in any order, within the first command-line argument.
+.PP
+If you wish, you may begin the first command-line argument with a
+dash.
+.PP
+The \fIp\fR keyletter specifies what operation to execute; it may be
+any of the following, but you must specify only one of them:
+.IP "\fBd\fR" 4
+.IX Item "d"
+\&\fIDelete\fR modules from the archive. Specify the names of modules to
+be deleted as \fImember\fR...; the archive is untouched if you
+specify no files to delete.
+.Sp
+If you specify the \fBv\fR modifier, \fBar\fR lists each module
+as it is deleted.
+.IP "\fBm\fR" 4
+.IX Item "m"
+Use this operation to \fImove\fR members in an archive.
+.Sp
+The ordering of members in an archive can make a difference in how
+programs are linked using the library, if a symbol is defined in more
+than one member.
+.Sp
+If no modifiers are used with \f(CW\*(C`m\*(C'\fR, any members you name in the
+\&\fImember\fR arguments are moved to the \fIend\fR of the archive;
+you can use the \fBa\fR, \fBb\fR, or \fBi\fR modifiers to move them to a
+specified place instead.
+.IP "\fBp\fR" 4
+.IX Item "p"
+\&\fIPrint\fR the specified members of the archive, to the standard
+output file. If the \fBv\fR modifier is specified, show the member
+name before copying its contents to standard output.
+.Sp
+If you specify no \fImember\fR arguments, all the files in the archive are
+printed.
+.IP "\fBq\fR" 4
+.IX Item "q"
+\&\fIQuick append\fR; Historically, add the files \fImember\fR... to the end of
+\&\fIarchive\fR, without checking for replacement.
+.Sp
+The modifiers \fBa\fR, \fBb\fR, and \fBi\fR do \fInot\fR affect this
+operation; new members are always placed at the end of the archive.
+.Sp
+The modifier \fBv\fR makes \fBar\fR list each file as it is appended.
+.Sp
+Since the point of this operation is speed, the archive's symbol table
+index is not updated, even if it already existed; you can use \fBar s\fR or
+\&\fBranlib\fR explicitly to update the symbol table index.
+.Sp
+However, too many different systems assume quick append rebuilds the
+index, so \s-1GNU\s0 \fBar\fR implements \fBq\fR as a synonym for \fBr\fR.
+.IP "\fBr\fR" 4
+.IX Item "r"
+Insert the files \fImember\fR... into \fIarchive\fR (with
+\&\fIreplacement\fR). This operation differs from \fBq\fR in that any
+previously existing members are deleted if their names match those being
+added.
+.Sp
+If one of the files named in \fImember\fR... does not exist, \fBar\fR
+displays an error message, and leaves undisturbed any existing members
+of the archive matching that name.
+.Sp
+By default, new members are added at the end of the file; but you may
+use one of the modifiers \fBa\fR, \fBb\fR, or \fBi\fR to request
+placement relative to some existing member.
+.Sp
+The modifier \fBv\fR used with this operation elicits a line of
+output for each file inserted, along with one of the letters \fBa\fR or
+\&\fBr\fR to indicate whether the file was appended (no old member
+deleted) or replaced.
+.IP "\fBt\fR" 4
+.IX Item "t"
+Display a \fItable\fR listing the contents of \fIarchive\fR, or those
+of the files listed in \fImember\fR... that are present in the
+archive. Normally only the member name is shown; if you also want to
+see the modes (permissions), timestamp, owner, group, and size, you can
+request that by also specifying the \fBv\fR modifier.
+.Sp
+If you do not specify a \fImember\fR, all files in the archive
+are listed.
+.Sp
+If there is more than one file with the same name (say, \fBfie\fR) in
+an archive (say \fBb.a\fR), \fBar t b.a fie\fR lists only the
+first instance; to see them all, you must ask for a complete
+listing\-\-\-in our example, \fBar t b.a\fR.
+.IP "\fBx\fR" 4
+.IX Item "x"
+\&\fIExtract\fR members (named \fImember\fR) from the archive. You can
+use the \fBv\fR modifier with this operation, to request that
+\&\fBar\fR list each name as it extracts it.
+.Sp
+If you do not specify a \fImember\fR, all files in the archive
+are extracted.
+.Sp
+Files cannot be extracted from a thin archive.
+.PP
+A number of modifiers (\fImod\fR) may immediately follow the \fIp\fR
+keyletter, to specify variations on an operation's behavior:
+.IP "\fBa\fR" 4
+.IX Item "a"
+Add new files \fIafter\fR an existing member of the
+archive. If you use the modifier \fBa\fR, the name of an existing archive
+member must be present as the \fIrelpos\fR argument, before the
+\&\fIarchive\fR specification.
+.IP "\fBb\fR" 4
+.IX Item "b"
+Add new files \fIbefore\fR an existing member of the
+archive. If you use the modifier \fBb\fR, the name of an existing archive
+member must be present as the \fIrelpos\fR argument, before the
+\&\fIarchive\fR specification. (same as \fBi\fR).
+.IP "\fBc\fR" 4
+.IX Item "c"
+\&\fICreate\fR the archive. The specified \fIarchive\fR is always
+created if it did not exist, when you request an update. But a warning is
+issued unless you specify in advance that you expect to create it, by
+using this modifier.
+.IP "\fBD\fR" 4
+.IX Item "D"
+Operate in \fIdeterministic\fR mode. When adding files and the archive
+index use zero for UIDs, GIDs, timestamps, and use consistent file modes
+for all files. When this option is used, if \fBar\fR is used with
+identical options and identical input files, multiple runs will create
+identical output files regardless of the input files' owners, groups,
+file modes, or modification times.
+.IP "\fBf\fR" 4
+.IX Item "f"
+Truncate names in the archive. \s-1GNU\s0 \fBar\fR will normally permit file
+names of any length. This will cause it to create archives which are
+not compatible with the native \fBar\fR program on some systems. If
+this is a concern, the \fBf\fR modifier may be used to truncate file
+names when putting them in the archive.
+.IP "\fBi\fR" 4
+.IX Item "i"
+Insert new files \fIbefore\fR an existing member of the
+archive. If you use the modifier \fBi\fR, the name of an existing archive
+member must be present as the \fIrelpos\fR argument, before the
+\&\fIarchive\fR specification. (same as \fBb\fR).
+.IP "\fBl\fR" 4
+.IX Item "l"
+This modifier is accepted but not used.
+.IP "\fBN\fR" 4
+.IX Item "N"
+Uses the \fIcount\fR parameter. This is used if there are multiple
+entries in the archive with the same name. Extract or delete instance
+\&\fIcount\fR of the given name from the archive.
+.IP "\fBo\fR" 4
+.IX Item "o"
+Preserve the \fIoriginal\fR dates of members when extracting them. If
+you do not specify this modifier, files extracted from the archive
+are stamped with the time of extraction.
+.IP "\fBP\fR" 4
+.IX Item "P"
+Use the full path name when matching names in the archive. \s-1GNU\s0
+\&\fBar\fR can not create an archive with a full path name (such archives
+are not \s-1POSIX\s0 complaint), but other archive creators can. This option
+will cause \s-1GNU\s0 \fBar\fR to match file names using a complete path
+name, which can be convenient when extracting a single file from an
+archive created by another tool.
+.IP "\fBs\fR" 4
+.IX Item "s"
+Write an object-file index into the archive, or update an existing one,
+even if no other change is made to the archive. You may use this modifier
+flag either with any operation, or alone. Running \fBar s\fR on an
+archive is equivalent to running \fBranlib\fR on it.
+.IP "\fBS\fR" 4
+.IX Item "S"
+Do not generate an archive symbol table. This can speed up building a
+large library in several steps. The resulting archive can not be used
+with the linker. In order to build a symbol table, you must omit the
+\&\fBS\fR modifier on the last execution of \fBar\fR, or you must run
+\&\fBranlib\fR on the archive.
+.IP "\fBT\fR" 4
+.IX Item "T"
+Make the specified \fIarchive\fR a \fIthin\fR archive. If it already
+exists and is a regular archive, the existing members must be present
+in the same directory as \fIarchive\fR.
+.IP "\fBu\fR" 4
+.IX Item "u"
+Normally, \fBar r\fR... inserts all files
+listed into the archive. If you would like to insert \fIonly\fR those
+of the files you list that are newer than existing members of the same
+names, use this modifier. The \fBu\fR modifier is allowed only for the
+operation \fBr\fR (replace). In particular, the combination \fBqu\fR is
+not allowed, since checking the timestamps would lose any speed
+advantage from the operation \fBq\fR.
+.IP "\fBv\fR" 4
+.IX Item "v"
+This modifier requests the \fIverbose\fR version of an operation. Many
+operations display additional information, such as filenames processed,
+when the modifier \fBv\fR is appended.
+.IP "\fBV\fR" 4
+.IX Item "V"
+This modifier shows the version number of \fBar\fR.
+.PP
+\&\fBar\fR ignores an initial option spelt \fB\-X32_64\fR, for
+compatibility with \s-1AIX\s0. The behaviour produced by this option is the
+default for \s-1GNU\s0 \fBar\fR. \fBar\fR does not support any of the other
+\&\fB\-X\fR options; in particular, it does not support \fB\-X32\fR
+which is the default for \s-1AIX\s0 \fBar\fR.
+.PP
+The optional command line switch \fB\-\-plugin\fR \fIname\fR causes
+\&\fBar\fR to load the plugin called \fIname\fR which adds support
+for more file formats. This option is only available if the toolchain
+has been built with plugin support enabled.
+.IP "\fB@\fR\fIfile\fR" 4
+.IX Item "@file"
+Read command-line options from \fIfile\fR. The options read are
+inserted in place of the original @\fIfile\fR option. If \fIfile\fR
+does not exist, or cannot be read, then the option will be treated
+literally, and not removed.
+.Sp
+Options in \fIfile\fR are separated by whitespace. A whitespace
+character may be included in an option by surrounding the entire
+option in either single or double quotes. Any character (including a
+backslash) may be included by prefixing the character to be included
+with a backslash. The \fIfile\fR may itself contain additional
+@\fIfile\fR options; any such options will be processed recursively.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fInm\fR\|(1), \fIranlib\fR\|(1), and the Info entries for \fIbinutils\fR.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, with no Front-Cover Texts, and with no
+Back-Cover Texts. A copy of the license is included in the
+section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-as.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-as.1
new file mode 100644
index 0000000..fa94049
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-as.1
@@ -0,0 +1,1208 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "AS 1"
+.TH AS 1 "2009-10-16" "binutils-2.20" "GNU Development Tools"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+AS \- the portable GNU assembler.
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+as [\fB\-a\fR[\fBcdghlns\fR][=\fIfile\fR]] [\fB\-\-alternate\fR] [\fB\-D\fR]
+ [\fB\-\-debug\-prefix\-map\fR \fIold\fR=\fInew\fR]
+ [\fB\-\-defsym\fR \fIsym\fR=\fIval\fR] [\fB\-f\fR] [\fB\-g\fR] [\fB\-\-gstabs\fR]
+ [\fB\-\-gstabs+\fR] [\fB\-\-gdwarf\-2\fR] [\fB\-\-help\fR] [\fB\-I\fR \fIdir\fR] [\fB\-J\fR]
+ [\fB\-K\fR] [\fB\-L\fR] [\fB\-\-listing\-lhs\-width\fR=\fI\s-1NUM\s0\fR]
+ [\fB\-\-listing\-lhs\-width2\fR=\fI\s-1NUM\s0\fR] [\fB\-\-listing\-rhs\-width\fR=\fI\s-1NUM\s0\fR]
+ [\fB\-\-listing\-cont\-lines\fR=\fI\s-1NUM\s0\fR] [\fB\-\-keep\-locals\fR] [\fB\-o\fR
+ \fIobjfile\fR] [\fB\-R\fR] [\fB\-\-reduce\-memory\-overheads\fR] [\fB\-\-statistics\fR]
+ [\fB\-v\fR] [\fB\-version\fR] [\fB\-\-version\fR] [\fB\-W\fR] [\fB\-\-warn\fR]
+ [\fB\-\-fatal\-warnings\fR] [\fB\-w\fR] [\fB\-x\fR] [\fB\-Z\fR] [\fB@\fR\fI\s-1FILE\s0\fR]
+ [\fB\-\-target\-help\fR] [\fItarget-options\fR]
+ [\fB\-\-\fR|\fIfiles\fR ...]
+.PP
+\&\fITarget Alpha options:\fR
+ [\fB\-m\fR\fIcpu\fR]
+ [\fB\-mdebug\fR | \fB\-no\-mdebug\fR]
+ [\fB\-replace\fR | \fB\-noreplace\fR]
+ [\fB\-relax\fR] [\fB\-g\fR] [\fB\-G\fR\fIsize\fR]
+ [\fB\-F\fR] [\fB\-32addr\fR]
+.PP
+\&\fITarget \s-1ARC\s0 options:\fR
+ [\fB\-marc[5|6|7|8]\fR]
+ [\fB\-EB\fR|\fB\-EL\fR]
+.PP
+\&\fITarget \s-1ARM\s0 options:\fR
+ [\fB\-mcpu\fR=\fIprocessor\fR[+\fIextension\fR...]]
+ [\fB\-march\fR=\fIarchitecture\fR[+\fIextension\fR...]]
+ [\fB\-mfpu\fR=\fIfloating-point-format\fR]
+ [\fB\-mfloat\-abi\fR=\fIabi\fR]
+ [\fB\-meabi\fR=\fIver\fR]
+ [\fB\-mthumb\fR]
+ [\fB\-EB\fR|\fB\-EL\fR]
+ [\fB\-mapcs\-32\fR|\fB\-mapcs\-26\fR|\fB\-mapcs\-float\fR|
+ \fB\-mapcs\-reentrant\fR]
+ [\fB\-mthumb\-interwork\fR] [\fB\-k\fR]
+.PP
+\&\fITarget \s-1CRIS\s0 options:\fR
+ [\fB\-\-underscore\fR | \fB\-\-no\-underscore\fR]
+ [\fB\-\-pic\fR] [\fB\-N\fR]
+ [\fB\-\-emulation=criself\fR | \fB\-\-emulation=crisaout\fR]
+ [\fB\-\-march=v0_v10\fR | \fB\-\-march=v10\fR | \fB\-\-march=v32\fR | \fB\-\-march=common_v10_v32\fR]
+.PP
+\&\fITarget D10V options:\fR
+ [\fB\-O\fR]
+.PP
+\&\fITarget D30V options:\fR
+ [\fB\-O\fR|\fB\-n\fR|\fB\-N\fR]
+.PP
+\&\fITarget H8/300 options:\fR
+ [\-h\-tick\-hex]
+.PP
+\&\fITarget i386 options:\fR
+ [\fB\-\-32\fR|\fB\-\-64\fR] [\fB\-n\fR]
+ [\fB\-march\fR=\fI\s-1CPU\s0\fR[+\fI\s-1EXTENSION\s0\fR...]] [\fB\-mtune\fR=\fI\s-1CPU\s0\fR]
+.PP
+\&\fITarget i960 options:\fR
+ [\fB\-ACA\fR|\fB\-ACA_A\fR|\fB\-ACB\fR|\fB\-ACC\fR|\fB\-AKA\fR|\fB\-AKB\fR|
+ \fB\-AKC\fR|\fB\-AMC\fR]
+ [\fB\-b\fR] [\fB\-no\-relax\fR]
+.PP
+\&\fITarget \s-1IA\-64\s0 options:\fR
+ [\fB\-mconstant\-gp\fR|\fB\-mauto\-pic\fR]
+ [\fB\-milp32\fR|\fB\-milp64\fR|\fB\-mlp64\fR|\fB\-mp64\fR]
+ [\fB\-mle\fR|\fBmbe\fR]
+ [\fB\-mtune=itanium1\fR|\fB\-mtune=itanium2\fR]
+ [\fB\-munwind\-check=warning\fR|\fB\-munwind\-check=error\fR]
+ [\fB\-mhint.b=ok\fR|\fB\-mhint.b=warning\fR|\fB\-mhint.b=error\fR]
+ [\fB\-x\fR|\fB\-xexplicit\fR] [\fB\-xauto\fR] [\fB\-xdebug\fR]
+.PP
+\&\fITarget \s-1IP2K\s0 options:\fR
+ [\fB\-mip2022\fR|\fB\-mip2022ext\fR]
+.PP
+\&\fITarget M32C options:\fR
+ [\fB\-m32c\fR|\fB\-m16c\fR] [\-relax] [\-h\-tick\-hex]
+.PP
+\&\fITarget M32R options:\fR
+ [\fB\-\-m32rx\fR|\fB\-\-[no\-]warn\-explicit\-parallel\-conflicts\fR|
+ \fB\-\-W[n]p\fR]
+.PP
+\&\fITarget M680X0 options:\fR
+ [\fB\-l\fR] [\fB\-m68000\fR|\fB\-m68010\fR|\fB\-m68020\fR|...]
+.PP
+\&\fITarget M68HC11 options:\fR
+ [\fB\-m68hc11\fR|\fB\-m68hc12\fR|\fB\-m68hcs12\fR]
+ [\fB\-mshort\fR|\fB\-mlong\fR]
+ [\fB\-mshort\-double\fR|\fB\-mlong\-double\fR]
+ [\fB\-\-force\-long\-branches\fR] [\fB\-\-short\-branches\fR]
+ [\fB\-\-strict\-direct\-mode\fR] [\fB\-\-print\-insn\-syntax\fR]
+ [\fB\-\-print\-opcodes\fR] [\fB\-\-generate\-example\fR]
+.PP
+\&\fITarget \s-1MCORE\s0 options:\fR
+ [\fB\-jsri2bsr\fR] [\fB\-sifilter\fR] [\fB\-relax\fR]
+ [\fB\-mcpu=[210|340]\fR]
+\&\fITarget \s-1MICROBLAZE\s0 options:\fR
+.PP
+\&\fITarget \s-1MIPS\s0 options:\fR
+ [\fB\-nocpp\fR] [\fB\-EL\fR] [\fB\-EB\fR] [\fB\-O\fR[\fIoptimization level\fR]]
+ [\fB\-g\fR[\fIdebug level\fR]] [\fB\-G\fR \fInum\fR] [\fB\-KPIC\fR] [\fB\-call_shared\fR]
+ [\fB\-non_shared\fR] [\fB\-xgot\fR [\fB\-mvxworks\-pic\fR]
+ [\fB\-mabi\fR=\fI\s-1ABI\s0\fR] [\fB\-32\fR] [\fB\-n32\fR] [\fB\-64\fR] [\fB\-mfp32\fR] [\fB\-mgp32\fR]
+ [\fB\-march\fR=\fI\s-1CPU\s0\fR] [\fB\-mtune\fR=\fI\s-1CPU\s0\fR] [\fB\-mips1\fR] [\fB\-mips2\fR]
+ [\fB\-mips3\fR] [\fB\-mips4\fR] [\fB\-mips5\fR] [\fB\-mips32\fR] [\fB\-mips32r2\fR]
+ [\fB\-mips64\fR] [\fB\-mips64r2\fR]
+ [\fB\-construct\-floats\fR] [\fB\-no\-construct\-floats\fR]
+ [\fB\-trap\fR] [\fB\-no\-break\fR] [\fB\-break\fR] [\fB\-no\-trap\fR]
+ [\fB\-mfix7000\fR] [\fB\-mno\-fix7000\fR]
+ [\fB\-mips16\fR] [\fB\-no\-mips16\fR]
+ [\fB\-msmartmips\fR] [\fB\-mno\-smartmips\fR]
+ [\fB\-mips3d\fR] [\fB\-no\-mips3d\fR]
+ [\fB\-mdmx\fR] [\fB\-no\-mdmx\fR]
+ [\fB\-mdsp\fR] [\fB\-mno\-dsp\fR]
+ [\fB\-mdspr2\fR] [\fB\-mno\-dspr2\fR]
+ [\fB\-mmt\fR] [\fB\-mno\-mt\fR]
+ [\fB\-mdebug\fR] [\fB\-no\-mdebug\fR]
+ [\fB\-mpdr\fR] [\fB\-mno\-pdr\fR]
+.PP
+\&\fITarget \s-1MMIX\s0 options:\fR
+ [\fB\-\-fixed\-special\-register\-names\fR] [\fB\-\-globalize\-symbols\fR]
+ [\fB\-\-gnu\-syntax\fR] [\fB\-\-relax\fR] [\fB\-\-no\-predefined\-symbols\fR]
+ [\fB\-\-no\-expand\fR] [\fB\-\-no\-merge\-gregs\fR] [\fB\-x\fR]
+ [\fB\-\-linker\-allocated\-gregs\fR]
+.PP
+\&\fITarget \s-1PDP11\s0 options:\fR
+ [\fB\-mpic\fR|\fB\-mno\-pic\fR] [\fB\-mall\fR] [\fB\-mno\-extensions\fR]
+ [\fB\-m\fR\fIextension\fR|\fB\-mno\-\fR\fIextension\fR]
+ [\fB\-m\fR\fIcpu\fR] [\fB\-m\fR\fImachine\fR]
+.PP
+\&\fITarget picoJava options:\fR
+ [\fB\-mb\fR|\fB\-me\fR]
+.PP
+\&\fITarget PowerPC options:\fR
+ [\fB\-mpwrx\fR|\fB\-mpwr2\fR|\fB\-mpwr\fR|\fB\-m601\fR|\fB\-mppc\fR|\fB\-mppc32\fR|\fB\-m603\fR|\fB\-m604\fR|
+ \fB\-m403\fR|\fB\-m405\fR|\fB\-mppc64\fR|\fB\-m620\fR|\fB\-mppc64bridge\fR|\fB\-mbooke\fR]
+ [\fB\-mcom\fR|\fB\-many\fR|\fB\-maltivec\fR|\fB\-mvsx\fR] [\fB\-memb\fR]
+ [\fB\-mregnames\fR|\fB\-mno\-regnames\fR]
+ [\fB\-mrelocatable\fR|\fB\-mrelocatable\-lib\fR]
+ [\fB\-mlittle\fR|\fB\-mlittle\-endian\fR|\fB\-mbig\fR|\fB\-mbig\-endian\fR]
+ [\fB\-msolaris\fR|\fB\-mno\-solaris\fR]
+.PP
+\&\fITarget s390 options:\fR
+ [\fB\-m31\fR|\fB\-m64\fR] [\fB\-mesa\fR|\fB\-mzarch\fR] [\fB\-march\fR=\fI\s-1CPU\s0\fR]
+ [\fB\-mregnames\fR|\fB\-mno\-regnames\fR]
+ [\fB\-mwarn\-areg\-zero\fR]
+.PP
+\&\fITarget \s-1SCORE\s0 options:\fR
+ [\fB\-EB\fR][\fB\-EL\fR][\fB\-FIXDD\fR][\fB\-NWARN\fR]
+ [\fB\-SCORE5\fR][\fB\-SCORE5U\fR][\fB\-SCORE7\fR][\fB\-SCORE3\fR]
+ [\fB\-march=score7\fR][\fB\-march=score3\fR]
+ [\fB\-USE_R1\fR][\fB\-KPIC\fR][\fB\-O0\fR][\fB\-G\fR \fInum\fR][\fB\-V\fR]
+.PP
+\&\fITarget \s-1SPARC\s0 options:\fR
+ [\fB\-Av6\fR|\fB\-Av7\fR|\fB\-Av8\fR|\fB\-Asparclet\fR|\fB\-Asparclite\fR
+ \fB\-Av8plus\fR|\fB\-Av8plusa\fR|\fB\-Av9\fR|\fB\-Av9a\fR]
+ [\fB\-xarch=v8plus\fR|\fB\-xarch=v8plusa\fR] [\fB\-bump\fR]
+ [\fB\-32\fR|\fB\-64\fR]
+.PP
+\&\fITarget \s-1TIC54X\s0 options:\fR
+ [\fB\-mcpu=54[123589]\fR|\fB\-mcpu=54[56]lp\fR] [\fB\-mfar\-mode\fR|\fB\-mf\fR]
+ [\fB\-merrors\-to\-file\fR \fI<filename>\fR|\fB\-me\fR \fI<filename>\fR]
+.PP
+\&\fITarget Z80 options:\fR
+ [\fB\-z80\fR] [\fB\-r800\fR]
+ [ \fB\-ignore\-undocumented\-instructions\fR] [\fB\-Wnud\fR]
+ [ \fB\-ignore\-unportable\-instructions\fR] [\fB\-Wnup\fR]
+ [ \fB\-warn\-undocumented\-instructions\fR] [\fB\-Wud\fR]
+ [ \fB\-warn\-unportable\-instructions\fR] [\fB\-Wup\fR]
+ [ \fB\-forbid\-undocumented\-instructions\fR] [\fB\-Fud\fR]
+ [ \fB\-forbid\-unportable\-instructions\fR] [\fB\-Fup\fR]
+.PP
+\&\fITarget Xtensa options:\fR
+ [\fB\-\-[no\-]text\-section\-literals\fR] [\fB\-\-[no\-]absolute\-literals\fR]
+ [\fB\-\-[no\-]target\-align\fR] [\fB\-\-[no\-]longcalls\fR]
+ [\fB\-\-[no\-]transform\fR]
+ [\fB\-\-rename\-section\fR \fIoldname\fR=\fInewname\fR]
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+\&\s-1GNU\s0 \fBas\fR is really a family of assemblers.
+If you use (or have used) the \s-1GNU\s0 assembler on one architecture, you
+should find a fairly similar environment when you use it on another
+architecture. Each version has much in common with the others,
+including object file formats, most assembler directives (often called
+\&\fIpseudo-ops\fR) and assembler syntax.
+.PP
+\&\fBas\fR is primarily intended to assemble the output of the
+\&\s-1GNU\s0 C compiler \f(CW\*(C`gcc\*(C'\fR for use by the linker
+\&\f(CW\*(C`ld\*(C'\fR. Nevertheless, we've tried to make \fBas\fR
+assemble correctly everything that other assemblers for the same
+machine would assemble.
+Any exceptions are documented explicitly.
+This doesn't mean \fBas\fR always uses the same syntax as another
+assembler for the same architecture; for example, we know of several
+incompatible versions of 680x0 assembly language syntax.
+.PP
+Each time you run \fBas\fR it assembles exactly one source
+program. The source program is made up of one or more files.
+(The standard input is also a file.)
+.PP
+You give \fBas\fR a command line that has zero or more input file
+names. The input files are read (from left file name to right). A
+command line argument (in any position) that has no special meaning
+is taken to be an input file name.
+.PP
+If you give \fBas\fR no file names it attempts to read one input file
+from the \fBas\fR standard input, which is normally your terminal. You
+may have to type \fBctl-D\fR to tell \fBas\fR there is no more program
+to assemble.
+.PP
+Use \fB\-\-\fR if you need to explicitly name the standard input file
+in your command line.
+.PP
+If the source is empty, \fBas\fR produces a small, empty object
+file.
+.PP
+\&\fBas\fR may write warnings and error messages to the standard error
+file (usually your terminal). This should not happen when a compiler
+runs \fBas\fR automatically. Warnings report an assumption made so
+that \fBas\fR could keep assembling a flawed program; errors report a
+grave problem that stops the assembly.
+.PP
+If you are invoking \fBas\fR via the \s-1GNU\s0 C compiler,
+you can use the \fB\-Wa\fR option to pass arguments through to the assembler.
+The assembler arguments must be separated from each other (and the \fB\-Wa\fR)
+by commas. For example:
+.PP
+.Vb 1
+\& gcc \-c \-g \-O \-Wa,\-alh,\-L file.c
+.Ve
+.PP
+This passes two options to the assembler: \fB\-alh\fR (emit a listing to
+standard output with high-level and assembly source) and \fB\-L\fR (retain
+local symbols in the symbol table).
+.PP
+Usually you do not need to use this \fB\-Wa\fR mechanism, since many compiler
+command-line options are automatically passed to the assembler by the compiler.
+(You can call the \s-1GNU\s0 compiler driver with the \fB\-v\fR option to see
+precisely what options it passes to each compilation pass, including the
+assembler.)
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+.IP "\fB@\fR\fIfile\fR" 4
+.IX Item "@file"
+Read command-line options from \fIfile\fR. The options read are
+inserted in place of the original @\fIfile\fR option. If \fIfile\fR
+does not exist, or cannot be read, then the option will be treated
+literally, and not removed.
+.Sp
+Options in \fIfile\fR are separated by whitespace. A whitespace
+character may be included in an option by surrounding the entire
+option in either single or double quotes. Any character (including a
+backslash) may be included by prefixing the character to be included
+with a backslash. The \fIfile\fR may itself contain additional
+@\fIfile\fR options; any such options will be processed recursively.
+.IP "\fB\-a[cdghlmns]\fR" 4
+.IX Item "-a[cdghlmns]"
+Turn on listings, in any of a variety of ways:
+.RS 4
+.IP "\fB\-ac\fR" 4
+.IX Item "-ac"
+omit false conditionals
+.IP "\fB\-ad\fR" 4
+.IX Item "-ad"
+omit debugging directives
+.IP "\fB\-ag\fR" 4
+.IX Item "-ag"
+include general information, like as version and options passed
+.IP "\fB\-ah\fR" 4
+.IX Item "-ah"
+include high-level source
+.IP "\fB\-al\fR" 4
+.IX Item "-al"
+include assembly
+.IP "\fB\-am\fR" 4
+.IX Item "-am"
+include macro expansions
+.IP "\fB\-an\fR" 4
+.IX Item "-an"
+omit forms processing
+.IP "\fB\-as\fR" 4
+.IX Item "-as"
+include symbols
+.IP "\fB=file\fR" 4
+.IX Item "=file"
+set the name of the listing file
+.RE
+.RS 4
+.Sp
+You may combine these options; for example, use \fB\-aln\fR for assembly
+listing without forms processing. The \fB=file\fR option, if used, must be
+the last one. By itself, \fB\-a\fR defaults to \fB\-ahls\fR.
+.RE
+.IP "\fB\-\-alternate\fR" 4
+.IX Item "--alternate"
+Begin in alternate macro mode.
+.IP "\fB\-D\fR" 4
+.IX Item "-D"
+Ignored. This option is accepted for script compatibility with calls to
+other assemblers.
+.IP "\fB\-\-debug\-prefix\-map\fR \fIold\fR\fB=\fR\fInew\fR" 4
+.IX Item "--debug-prefix-map old=new"
+When assembling files in directory \fI\fIold\fI\fR, record debugging
+information describing them as in \fI\fInew\fI\fR instead.
+.IP "\fB\-\-defsym\fR \fIsym\fR\fB=\fR\fIvalue\fR" 4
+.IX Item "--defsym sym=value"
+Define the symbol \fIsym\fR to be \fIvalue\fR before assembling the input file.
+\&\fIvalue\fR must be an integer constant. As in C, a leading \fB0x\fR
+indicates a hexadecimal value, and a leading \fB0\fR indicates an octal
+value. The value of the symbol can be overridden inside a source file via the
+use of a \f(CW\*(C`.set\*(C'\fR pseudo-op.
+.IP "\fB\-f\fR" 4
+.IX Item "-f"
+\&\*(L"fast\*(R"\-\-\-skip whitespace and comment preprocessing (assume source is
+compiler output).
+.IP "\fB\-g\fR" 4
+.IX Item "-g"
+.PD 0
+.IP "\fB\-\-gen\-debug\fR" 4
+.IX Item "--gen-debug"
+.PD
+Generate debugging information for each assembler source line using whichever
+debug format is preferred by the target. This currently means either \s-1STABS\s0,
+\&\s-1ECOFF\s0 or \s-1DWARF2\s0.
+.IP "\fB\-\-gstabs\fR" 4
+.IX Item "--gstabs"
+Generate stabs debugging information for each assembler line. This
+may help debugging assembler code, if the debugger can handle it.
+.IP "\fB\-\-gstabs+\fR" 4
+.IX Item "--gstabs+"
+Generate stabs debugging information for each assembler line, with \s-1GNU\s0
+extensions that probably only gdb can handle, and that could make other
+debuggers crash or refuse to read your program. This
+may help debugging assembler code. Currently the only \s-1GNU\s0 extension is
+the location of the current working directory at assembling time.
+.IP "\fB\-\-gdwarf\-2\fR" 4
+.IX Item "--gdwarf-2"
+Generate \s-1DWARF2\s0 debugging information for each assembler line. This
+may help debugging assembler code, if the debugger can handle it. Note\-\-\-this
+option is only supported by some targets, not all of them.
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
+Print a summary of the command line options and exit.
+.IP "\fB\-\-target\-help\fR" 4
+.IX Item "--target-help"
+Print a summary of all target specific options and exit.
+.IP "\fB\-I\fR \fIdir\fR" 4
+.IX Item "-I dir"
+Add directory \fIdir\fR to the search list for \f(CW\*(C`.include\*(C'\fR directives.
+.IP "\fB\-J\fR" 4
+.IX Item "-J"
+Don't warn about signed overflow.
+.IP "\fB\-K\fR" 4
+.IX Item "-K"
+Issue warnings when difference tables altered for long displacements.
+.IP "\fB\-L\fR" 4
+.IX Item "-L"
+.PD 0
+.IP "\fB\-\-keep\-locals\fR" 4
+.IX Item "--keep-locals"
+.PD
+Keep (in the symbol table) local symbols. These symbols start with
+system-specific local label prefixes, typically \fB.L\fR for \s-1ELF\s0 systems
+or \fBL\fR for traditional a.out systems.
+.IP "\fB\-\-listing\-lhs\-width=\fR\fInumber\fR" 4
+.IX Item "--listing-lhs-width=number"
+Set the maximum width, in words, of the output data column for an assembler
+listing to \fInumber\fR.
+.IP "\fB\-\-listing\-lhs\-width2=\fR\fInumber\fR" 4
+.IX Item "--listing-lhs-width2=number"
+Set the maximum width, in words, of the output data column for continuation
+lines in an assembler listing to \fInumber\fR.
+.IP "\fB\-\-listing\-rhs\-width=\fR\fInumber\fR" 4
+.IX Item "--listing-rhs-width=number"
+Set the maximum width of an input source line, as displayed in a listing, to
+\&\fInumber\fR bytes.
+.IP "\fB\-\-listing\-cont\-lines=\fR\fInumber\fR" 4
+.IX Item "--listing-cont-lines=number"
+Set the maximum number of lines printed in a listing for a single line of input
+to \fInumber\fR + 1.
+.IP "\fB\-o\fR \fIobjfile\fR" 4
+.IX Item "-o objfile"
+Name the object-file output from \fBas\fR \fIobjfile\fR.
+.IP "\fB\-R\fR" 4
+.IX Item "-R"
+Fold the data section into the text section.
+.Sp
+Set the default size of \s-1GAS\s0's hash tables to a prime number close to
+\&\fInumber\fR. Increasing this value can reduce the length of time it takes the
+assembler to perform its tasks, at the expense of increasing the assembler's
+memory requirements. Similarly reducing this value can reduce the memory
+requirements at the expense of speed.
+.IP "\fB\-\-reduce\-memory\-overheads\fR" 4
+.IX Item "--reduce-memory-overheads"
+This option reduces \s-1GAS\s0's memory requirements, at the expense of making the
+assembly processes slower. Currently this switch is a synonym for
+\&\fB\-\-hash\-size=4051\fR, but in the future it may have other effects as well.
+.IP "\fB\-\-statistics\fR" 4
+.IX Item "--statistics"
+Print the maximum space (in bytes) and total time (in seconds) used by
+assembly.
+.IP "\fB\-\-strip\-local\-absolute\fR" 4
+.IX Item "--strip-local-absolute"
+Remove local absolute symbols from the outgoing symbol table.
+.IP "\fB\-v\fR" 4
+.IX Item "-v"
+.PD 0
+.IP "\fB\-version\fR" 4
+.IX Item "-version"
+.PD
+Print the \fBas\fR version.
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+Print the \fBas\fR version and exit.
+.IP "\fB\-W\fR" 4
+.IX Item "-W"
+.PD 0
+.IP "\fB\-\-no\-warn\fR" 4
+.IX Item "--no-warn"
+.PD
+Suppress warning messages.
+.IP "\fB\-\-fatal\-warnings\fR" 4
+.IX Item "--fatal-warnings"
+Treat warnings as errors.
+.IP "\fB\-\-warn\fR" 4
+.IX Item "--warn"
+Don't suppress warning messages or treat them as errors.
+.IP "\fB\-w\fR" 4
+.IX Item "-w"
+Ignored.
+.IP "\fB\-x\fR" 4
+.IX Item "-x"
+Ignored.
+.IP "\fB\-Z\fR" 4
+.IX Item "-Z"
+Generate an object file even after errors.
+.IP "\fB\-\- |\fR \fIfiles\fR \fB...\fR" 4
+.IX Item "-- | files ..."
+Standard input, or source files to assemble.
+.PP
+The following options are available when as is configured for
+an \s-1ARC\s0 processor.
+.IP "\fB\-marc[5|6|7|8]\fR" 4
+.IX Item "-marc[5|6|7|8]"
+This option selects the core processor variant.
+.IP "\fB\-EB | \-EL\fR" 4
+.IX Item "-EB | -EL"
+Select either big-endian (\-EB) or little-endian (\-EL) output.
+.PP
+The following options are available when as is configured for the \s-1ARM\s0
+processor family.
+.IP "\fB\-mcpu=\fR\fIprocessor\fR\fB[+\fR\fIextension\fR\fB...]\fR" 4
+.IX Item "-mcpu=processor[+extension...]"
+Specify which \s-1ARM\s0 processor variant is the target.
+.IP "\fB\-march=\fR\fIarchitecture\fR\fB[+\fR\fIextension\fR\fB...]\fR" 4
+.IX Item "-march=architecture[+extension...]"
+Specify which \s-1ARM\s0 architecture variant is used by the target.
+.IP "\fB\-mfpu=\fR\fIfloating-point-format\fR" 4
+.IX Item "-mfpu=floating-point-format"
+Select which Floating Point architecture is the target.
+.IP "\fB\-mfloat\-abi=\fR\fIabi\fR" 4
+.IX Item "-mfloat-abi=abi"
+Select which floating point \s-1ABI\s0 is in use.
+.IP "\fB\-mthumb\fR" 4
+.IX Item "-mthumb"
+Enable Thumb only instruction decoding.
+.IP "\fB\-mapcs\-32 | \-mapcs\-26 | \-mapcs\-float | \-mapcs\-reentrant\fR" 4
+.IX Item "-mapcs-32 | -mapcs-26 | -mapcs-float | -mapcs-reentrant"
+Select which procedure calling convention is in use.
+.IP "\fB\-EB | \-EL\fR" 4
+.IX Item "-EB | -EL"
+Select either big-endian (\-EB) or little-endian (\-EL) output.
+.IP "\fB\-mthumb\-interwork\fR" 4
+.IX Item "-mthumb-interwork"
+Specify that the code has been generated with interworking between Thumb and
+\&\s-1ARM\s0 code in mind.
+.IP "\fB\-k\fR" 4
+.IX Item "-k"
+Specify that \s-1PIC\s0 code has been generated.
+.PP
+See the info pages for documentation of the CRIS-specific options.
+.PP
+The following options are available when as is configured for
+a D10V processor.
+.IP "\fB\-O\fR" 4
+.IX Item "-O"
+Optimize output by parallelizing instructions.
+.PP
+The following options are available when as is configured for a D30V
+processor.
+.IP "\fB\-O\fR" 4
+.IX Item "-O"
+Optimize output by parallelizing instructions.
+.IP "\fB\-n\fR" 4
+.IX Item "-n"
+Warn when nops are generated.
+.IP "\fB\-N\fR" 4
+.IX Item "-N"
+Warn when a nop after a 32\-bit multiply instruction is generated.
+.PP
+The following options are available when as is configured for the
+Intel 80960 processor.
+.IP "\fB\-ACA | \-ACA_A | \-ACB | \-ACC | \-AKA | \-AKB | \-AKC | \-AMC\fR" 4
+.IX Item "-ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC"
+Specify which variant of the 960 architecture is the target.
+.IP "\fB\-b\fR" 4
+.IX Item "-b"
+Add code to collect statistics about branches taken.
+.IP "\fB\-no\-relax\fR" 4
+.IX Item "-no-relax"
+Do not alter compare-and-branch instructions for long displacements;
+error if necessary.
+.PP
+The following options are available when as is configured for the
+Ubicom \s-1IP2K\s0 series.
+.IP "\fB\-mip2022ext\fR" 4
+.IX Item "-mip2022ext"
+Specifies that the extended \s-1IP2022\s0 instructions are allowed.
+.IP "\fB\-mip2022\fR" 4
+.IX Item "-mip2022"
+Restores the default behaviour, which restricts the permitted instructions to
+just the basic \s-1IP2022\s0 ones.
+.PP
+The following options are available when as is configured for the
+Renesas M32C and M16C processors.
+.IP "\fB\-m32c\fR" 4
+.IX Item "-m32c"
+Assemble M32C instructions.
+.IP "\fB\-m16c\fR" 4
+.IX Item "-m16c"
+Assemble M16C instructions (the default).
+.IP "\fB\-relax\fR" 4
+.IX Item "-relax"
+Enable support for link-time relaxations.
+.IP "\fB\-h\-tick\-hex\fR" 4
+.IX Item "-h-tick-hex"
+Support H'00 style hex constants in addition to 0x00 style.
+.PP
+The following options are available when as is configured for the
+Renesas M32R (formerly Mitsubishi M32R) series.
+.IP "\fB\-\-m32rx\fR" 4
+.IX Item "--m32rx"
+Specify which processor in the M32R family is the target. The default
+is normally the M32R, but this option changes it to the M32RX.
+.IP "\fB\-\-warn\-explicit\-parallel\-conflicts or \-\-Wp\fR" 4
+.IX Item "--warn-explicit-parallel-conflicts or --Wp"
+Produce warning messages when questionable parallel constructs are
+encountered.
+.IP "\fB\-\-no\-warn\-explicit\-parallel\-conflicts or \-\-Wnp\fR" 4
+.IX Item "--no-warn-explicit-parallel-conflicts or --Wnp"
+Do not produce warning messages when questionable parallel constructs are
+encountered.
+.PP
+The following options are available when as is configured for the
+Motorola 68000 series.
+.IP "\fB\-l\fR" 4
+.IX Item "-l"
+Shorten references to undefined symbols, to one word instead of two.
+.IP "\fB\-m68000 | \-m68008 | \-m68010 | \-m68020 | \-m68030\fR" 4
+.IX Item "-m68000 | -m68008 | -m68010 | -m68020 | -m68030"
+.PD 0
+.IP "\fB| \-m68040 | \-m68060 | \-m68302 | \-m68331 | \-m68332\fR" 4
+.IX Item "| -m68040 | -m68060 | -m68302 | -m68331 | -m68332"
+.IP "\fB| \-m68333 | \-m68340 | \-mcpu32 | \-m5200\fR" 4
+.IX Item "| -m68333 | -m68340 | -mcpu32 | -m5200"
+.PD
+Specify what processor in the 68000 family is the target. The default
+is normally the 68020, but this can be changed at configuration time.
+.IP "\fB\-m68881 | \-m68882 | \-mno\-68881 | \-mno\-68882\fR" 4
+.IX Item "-m68881 | -m68882 | -mno-68881 | -mno-68882"
+The target machine does (or does not) have a floating-point coprocessor.
+The default is to assume a coprocessor for 68020, 68030, and cpu32. Although
+the basic 68000 is not compatible with the 68881, a combination of the
+two can be specified, since it's possible to do emulation of the
+coprocessor instructions with the main processor.
+.IP "\fB\-m68851 | \-mno\-68851\fR" 4
+.IX Item "-m68851 | -mno-68851"
+The target machine does (or does not) have a memory-management
+unit coprocessor. The default is to assume an \s-1MMU\s0 for 68020 and up.
+.PP
+For details about the \s-1PDP\-11\s0 machine dependent features options,
+see \fBPDP\-11\-Options\fR.
+.IP "\fB\-mpic | \-mno\-pic\fR" 4
+.IX Item "-mpic | -mno-pic"
+Generate position-independent (or position-dependent) code. The
+default is \fB\-mpic\fR.
+.IP "\fB\-mall\fR" 4
+.IX Item "-mall"
+.PD 0
+.IP "\fB\-mall\-extensions\fR" 4
+.IX Item "-mall-extensions"
+.PD
+Enable all instruction set extensions. This is the default.
+.IP "\fB\-mno\-extensions\fR" 4
+.IX Item "-mno-extensions"
+Disable all instruction set extensions.
+.IP "\fB\-m\fR\fIextension\fR \fB| \-mno\-\fR\fIextension\fR" 4
+.IX Item "-mextension | -mno-extension"
+Enable (or disable) a particular instruction set extension.
+.IP "\fB\-m\fR\fIcpu\fR" 4
+.IX Item "-mcpu"
+Enable the instruction set extensions supported by a particular \s-1CPU\s0, and
+disable all other extensions.
+.IP "\fB\-m\fR\fImachine\fR" 4
+.IX Item "-mmachine"
+Enable the instruction set extensions supported by a particular machine
+model, and disable all other extensions.
+.PP
+The following options are available when as is configured for
+a picoJava processor.
+.IP "\fB\-mb\fR" 4
+.IX Item "-mb"
+Generate \*(L"big endian\*(R" format output.
+.IP "\fB\-ml\fR" 4
+.IX Item "-ml"
+Generate \*(L"little endian\*(R" format output.
+.PP
+The following options are available when as is configured for the
+Motorola 68HC11 or 68HC12 series.
+.IP "\fB\-m68hc11 | \-m68hc12 | \-m68hcs12\fR" 4
+.IX Item "-m68hc11 | -m68hc12 | -m68hcs12"
+Specify what processor is the target. The default is
+defined by the configuration option when building the assembler.
+.IP "\fB\-mshort\fR" 4
+.IX Item "-mshort"
+Specify to use the 16\-bit integer \s-1ABI\s0.
+.IP "\fB\-mlong\fR" 4
+.IX Item "-mlong"
+Specify to use the 32\-bit integer \s-1ABI\s0.
+.IP "\fB\-mshort\-double\fR" 4
+.IX Item "-mshort-double"
+Specify to use the 32\-bit double \s-1ABI\s0.
+.IP "\fB\-mlong\-double\fR" 4
+.IX Item "-mlong-double"
+Specify to use the 64\-bit double \s-1ABI\s0.
+.IP "\fB\-\-force\-long\-branches\fR" 4
+.IX Item "--force-long-branches"
+Relative branches are turned into absolute ones. This concerns
+conditional branches, unconditional branches and branches to a
+sub routine.
+.IP "\fB\-S | \-\-short\-branches\fR" 4
+.IX Item "-S | --short-branches"
+Do not turn relative branches into absolute ones
+when the offset is out of range.
+.IP "\fB\-\-strict\-direct\-mode\fR" 4
+.IX Item "--strict-direct-mode"
+Do not turn the direct addressing mode into extended addressing mode
+when the instruction does not support direct addressing mode.
+.IP "\fB\-\-print\-insn\-syntax\fR" 4
+.IX Item "--print-insn-syntax"
+Print the syntax of instruction in case of error.
+.IP "\fB\-\-print\-opcodes\fR" 4
+.IX Item "--print-opcodes"
+print the list of instructions with syntax and then exit.
+.IP "\fB\-\-generate\-example\fR" 4
+.IX Item "--generate-example"
+print an example of instruction for each possible instruction and then exit.
+This option is only useful for testing \fBas\fR.
+.PP
+The following options are available when \fBas\fR is configured
+for the \s-1SPARC\s0 architecture:
+.IP "\fB\-Av6 | \-Av7 | \-Av8 | \-Asparclet | \-Asparclite\fR" 4
+.IX Item "-Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite"
+.PD 0
+.IP "\fB\-Av8plus | \-Av8plusa | \-Av9 | \-Av9a\fR" 4
+.IX Item "-Av8plus | -Av8plusa | -Av9 | -Av9a"
+.PD
+Explicitly select a variant of the \s-1SPARC\s0 architecture.
+.Sp
+\&\fB\-Av8plus\fR and \fB\-Av8plusa\fR select a 32 bit environment.
+\&\fB\-Av9\fR and \fB\-Av9a\fR select a 64 bit environment.
+.Sp
+\&\fB\-Av8plusa\fR and \fB\-Av9a\fR enable the \s-1SPARC\s0 V9 instruction set with
+UltraSPARC extensions.
+.IP "\fB\-xarch=v8plus | \-xarch=v8plusa\fR" 4
+.IX Item "-xarch=v8plus | -xarch=v8plusa"
+For compatibility with the Solaris v9 assembler. These options are
+equivalent to \-Av8plus and \-Av8plusa, respectively.
+.IP "\fB\-bump\fR" 4
+.IX Item "-bump"
+Warn when the assembler switches to another architecture.
+.PP
+The following options are available when as is configured for the 'c54x
+architecture.
+.IP "\fB\-mfar\-mode\fR" 4
+.IX Item "-mfar-mode"
+Enable extended addressing mode. All addresses and relocations will assume
+extended addressing (usually 23 bits).
+.IP "\fB\-mcpu=\fR\fI\s-1CPU_VERSION\s0\fR" 4
+.IX Item "-mcpu=CPU_VERSION"
+Sets the \s-1CPU\s0 version being compiled for.
+.IP "\fB\-merrors\-to\-file\fR \fI\s-1FILENAME\s0\fR" 4
+.IX Item "-merrors-to-file FILENAME"
+Redirect error output to a file, for broken systems which don't support such
+behaviour in the shell.
+.PP
+The following options are available when as is configured for
+a \s-1MIPS\s0 processor.
+.IP "\fB\-G\fR \fInum\fR" 4
+.IX Item "-G num"
+This option sets the largest size of an object that can be referenced
+implicitly with the \f(CW\*(C`gp\*(C'\fR register. It is only accepted for targets that
+use \s-1ECOFF\s0 format, such as a DECstation running Ultrix. The default value is 8.
+.IP "\fB\-EB\fR" 4
+.IX Item "-EB"
+Generate \*(L"big endian\*(R" format output.
+.IP "\fB\-EL\fR" 4
+.IX Item "-EL"
+Generate \*(L"little endian\*(R" format output.
+.IP "\fB\-mips1\fR" 4
+.IX Item "-mips1"
+.PD 0
+.IP "\fB\-mips2\fR" 4
+.IX Item "-mips2"
+.IP "\fB\-mips3\fR" 4
+.IX Item "-mips3"
+.IP "\fB\-mips4\fR" 4
+.IX Item "-mips4"
+.IP "\fB\-mips5\fR" 4
+.IX Item "-mips5"
+.IP "\fB\-mips32\fR" 4
+.IX Item "-mips32"
+.IP "\fB\-mips32r2\fR" 4
+.IX Item "-mips32r2"
+.IP "\fB\-mips64\fR" 4
+.IX Item "-mips64"
+.IP "\fB\-mips64r2\fR" 4
+.IX Item "-mips64r2"
+.PD
+Generate code for a particular \s-1MIPS\s0 Instruction Set Architecture level.
+\&\fB\-mips1\fR is an alias for \fB\-march=r3000\fR, \fB\-mips2\fR is an
+alias for \fB\-march=r6000\fR, \fB\-mips3\fR is an alias for
+\&\fB\-march=r4000\fR and \fB\-mips4\fR is an alias for \fB\-march=r8000\fR.
+\&\fB\-mips5\fR, \fB\-mips32\fR, \fB\-mips32r2\fR, \fB\-mips64\fR, and
+\&\fB\-mips64r2\fR
+correspond to generic
+\&\fB\s-1MIPS\s0 V\fR, \fB\s-1MIPS32\s0\fR, \fB\s-1MIPS32\s0 Release 2\fR, \fB\s-1MIPS64\s0\fR,
+and \fB\s-1MIPS64\s0 Release 2\fR
+\&\s-1ISA\s0 processors, respectively.
+.IP "\fB\-march=\fR\fI\s-1CPU\s0\fR" 4
+.IX Item "-march=CPU"
+Generate code for a particular \s-1MIPS\s0 cpu.
+.IP "\fB\-mtune=\fR\fIcpu\fR" 4
+.IX Item "-mtune=cpu"
+Schedule and tune for a particular \s-1MIPS\s0 cpu.
+.IP "\fB\-mfix7000\fR" 4
+.IX Item "-mfix7000"
+.PD 0
+.IP "\fB\-mno\-fix7000\fR" 4
+.IX Item "-mno-fix7000"
+.PD
+Cause nops to be inserted if the read of the destination register
+of an mfhi or mflo instruction occurs in the following two instructions.
+.IP "\fB\-mdebug\fR" 4
+.IX Item "-mdebug"
+.PD 0
+.IP "\fB\-no\-mdebug\fR" 4
+.IX Item "-no-mdebug"
+.PD
+Cause stabs-style debugging output to go into an ECOFF-style .mdebug
+section instead of the standard \s-1ELF\s0 .stabs sections.
+.IP "\fB\-mpdr\fR" 4
+.IX Item "-mpdr"
+.PD 0
+.IP "\fB\-mno\-pdr\fR" 4
+.IX Item "-mno-pdr"
+.PD
+Control generation of \f(CW\*(C`.pdr\*(C'\fR sections.
+.IP "\fB\-mgp32\fR" 4
+.IX Item "-mgp32"
+.PD 0
+.IP "\fB\-mfp32\fR" 4
+.IX Item "-mfp32"
+.PD
+The register sizes are normally inferred from the \s-1ISA\s0 and \s-1ABI\s0, but these
+flags force a certain group of registers to be treated as 32 bits wide at
+all times. \fB\-mgp32\fR controls the size of general-purpose registers
+and \fB\-mfp32\fR controls the size of floating-point registers.
+.IP "\fB\-mips16\fR" 4
+.IX Item "-mips16"
+.PD 0
+.IP "\fB\-no\-mips16\fR" 4
+.IX Item "-no-mips16"
+.PD
+Generate code for the \s-1MIPS\s0 16 processor. This is equivalent to putting
+\&\f(CW\*(C`.set mips16\*(C'\fR at the start of the assembly file. \fB\-no\-mips16\fR
+turns off this option.
+.IP "\fB\-msmartmips\fR" 4
+.IX Item "-msmartmips"
+.PD 0
+.IP "\fB\-mno\-smartmips\fR" 4
+.IX Item "-mno-smartmips"
+.PD
+Enables the SmartMIPS extension to the \s-1MIPS32\s0 instruction set. This is
+equivalent to putting \f(CW\*(C`.set smartmips\*(C'\fR at the start of the assembly file.
+\&\fB\-mno\-smartmips\fR turns off this option.
+.IP "\fB\-mips3d\fR" 4
+.IX Item "-mips3d"
+.PD 0
+.IP "\fB\-no\-mips3d\fR" 4
+.IX Item "-no-mips3d"
+.PD
+Generate code for the \s-1MIPS\-3D\s0 Application Specific Extension.
+This tells the assembler to accept \s-1MIPS\-3D\s0 instructions.
+\&\fB\-no\-mips3d\fR turns off this option.
+.IP "\fB\-mdmx\fR" 4
+.IX Item "-mdmx"
+.PD 0
+.IP "\fB\-no\-mdmx\fR" 4
+.IX Item "-no-mdmx"
+.PD
+Generate code for the \s-1MDMX\s0 Application Specific Extension.
+This tells the assembler to accept \s-1MDMX\s0 instructions.
+\&\fB\-no\-mdmx\fR turns off this option.
+.IP "\fB\-mdsp\fR" 4
+.IX Item "-mdsp"
+.PD 0
+.IP "\fB\-mno\-dsp\fR" 4
+.IX Item "-mno-dsp"
+.PD
+Generate code for the \s-1DSP\s0 Release 1 Application Specific Extension.
+This tells the assembler to accept \s-1DSP\s0 Release 1 instructions.
+\&\fB\-mno\-dsp\fR turns off this option.
+.IP "\fB\-mdspr2\fR" 4
+.IX Item "-mdspr2"
+.PD 0
+.IP "\fB\-mno\-dspr2\fR" 4
+.IX Item "-mno-dspr2"
+.PD
+Generate code for the \s-1DSP\s0 Release 2 Application Specific Extension.
+This option implies \-mdsp.
+This tells the assembler to accept \s-1DSP\s0 Release 2 instructions.
+\&\fB\-mno\-dspr2\fR turns off this option.
+.IP "\fB\-mmt\fR" 4
+.IX Item "-mmt"
+.PD 0
+.IP "\fB\-mno\-mt\fR" 4
+.IX Item "-mno-mt"
+.PD
+Generate code for the \s-1MT\s0 Application Specific Extension.
+This tells the assembler to accept \s-1MT\s0 instructions.
+\&\fB\-mno\-mt\fR turns off this option.
+.IP "\fB\-\-construct\-floats\fR" 4
+.IX Item "--construct-floats"
+.PD 0
+.IP "\fB\-\-no\-construct\-floats\fR" 4
+.IX Item "--no-construct-floats"
+.PD
+The \fB\-\-no\-construct\-floats\fR option disables the construction of
+double width floating point constants by loading the two halves of the
+value into the two single width floating point registers that make up
+the double width register. By default \fB\-\-construct\-floats\fR is
+selected, allowing construction of these floating point constants.
+.IP "\fB\-\-emulation=\fR\fIname\fR" 4
+.IX Item "--emulation=name"
+This option causes \fBas\fR to emulate \fBas\fR configured
+for some other target, in all respects, including output format (choosing
+between \s-1ELF\s0 and \s-1ECOFF\s0 only), handling of pseudo-opcodes which may generate
+debugging information or store symbol table information, and default
+endianness. The available configuration names are: \fBmipsecoff\fR,
+\&\fBmipself\fR, \fBmipslecoff\fR, \fBmipsbecoff\fR, \fBmipslelf\fR,
+\&\fBmipsbelf\fR. The first two do not alter the default endianness from that
+of the primary target for which the assembler was configured; the others change
+the default to little\- or big-endian as indicated by the \fBb\fR or \fBl\fR
+in the name. Using \fB\-EB\fR or \fB\-EL\fR will override the endianness
+selection in any case.
+.Sp
+This option is currently supported only when the primary target
+\&\fBas\fR is configured for is a \s-1MIPS\s0 \s-1ELF\s0 or \s-1ECOFF\s0 target.
+Furthermore, the primary target or others specified with
+\&\fB\-\-enable\-targets=...\fR at configuration time must include support for
+the other format, if both are to be available. For example, the Irix 5
+configuration includes support for both.
+.Sp
+Eventually, this option will support more configurations, with more
+fine-grained control over the assembler's behavior, and will be supported for
+more processors.
+.IP "\fB\-nocpp\fR" 4
+.IX Item "-nocpp"
+\&\fBas\fR ignores this option. It is accepted for compatibility with
+the native tools.
+.IP "\fB\-\-trap\fR" 4
+.IX Item "--trap"
+.PD 0
+.IP "\fB\-\-no\-trap\fR" 4
+.IX Item "--no-trap"
+.IP "\fB\-\-break\fR" 4
+.IX Item "--break"
+.IP "\fB\-\-no\-break\fR" 4
+.IX Item "--no-break"
+.PD
+Control how to deal with multiplication overflow and division by zero.
+\&\fB\-\-trap\fR or \fB\-\-no\-break\fR (which are synonyms) take a trap exception
+(and only work for Instruction Set Architecture level 2 and higher);
+\&\fB\-\-break\fR or \fB\-\-no\-trap\fR (also synonyms, and the default) take a
+break exception.
+.IP "\fB\-n\fR" 4
+.IX Item "-n"
+When this option is used, \fBas\fR will issue a warning every
+time it generates a nop instruction from a macro.
+.PP
+The following options are available when as is configured for
+an MCore processor.
+.IP "\fB\-jsri2bsr\fR" 4
+.IX Item "-jsri2bsr"
+.PD 0
+.IP "\fB\-nojsri2bsr\fR" 4
+.IX Item "-nojsri2bsr"
+.PD
+Enable or disable the \s-1JSRI\s0 to \s-1BSR\s0 transformation. By default this is enabled.
+The command line option \fB\-nojsri2bsr\fR can be used to disable it.
+.IP "\fB\-sifilter\fR" 4
+.IX Item "-sifilter"
+.PD 0
+.IP "\fB\-nosifilter\fR" 4
+.IX Item "-nosifilter"
+.PD
+Enable or disable the silicon filter behaviour. By default this is disabled.
+The default can be overridden by the \fB\-sifilter\fR command line option.
+.IP "\fB\-relax\fR" 4
+.IX Item "-relax"
+Alter jump instructions for long displacements.
+.IP "\fB\-mcpu=[210|340]\fR" 4
+.IX Item "-mcpu=[210|340]"
+Select the cpu type on the target hardware. This controls which instructions
+can be assembled.
+.IP "\fB\-EB\fR" 4
+.IX Item "-EB"
+Assemble for a big endian target.
+.IP "\fB\-EL\fR" 4
+.IX Item "-EL"
+Assemble for a little endian target.
+.PP
+See the info pages for documentation of the MMIX-specific options.
+.PP
+The following options are available when as is configured for the s390
+processor family.
+.IP "\fB\-m31\fR" 4
+.IX Item "-m31"
+.PD 0
+.IP "\fB\-m64\fR" 4
+.IX Item "-m64"
+.PD
+Select the word size, either 31/32 bits or 64 bits.
+.IP "\fB\-mesa\fR" 4
+.IX Item "-mesa"
+.PD 0
+.IP "\fB\-mzarch\fR" 4
+.IX Item "-mzarch"
+.PD
+Select the architecture mode, either the Enterprise System
+Architecture (esa) or the z/Architecture mode (zarch).
+.IP "\fB\-march=\fR\fIprocessor\fR" 4
+.IX Item "-march=processor"
+Specify which s390 processor variant is the target, \fBg6\fR, \fBg6\fR,
+\&\fBz900\fR, \fBz990\fR, \fBz9\-109\fR, \fBz9\-ec\fR, or \fBz10\fR.
+.IP "\fB\-mregnames\fR" 4
+.IX Item "-mregnames"
+.PD 0
+.IP "\fB\-mno\-regnames\fR" 4
+.IX Item "-mno-regnames"
+.PD
+Allow or disallow symbolic names for registers.
+.IP "\fB\-mwarn\-areg\-zero\fR" 4
+.IX Item "-mwarn-areg-zero"
+Warn whenever the operand for a base or index register has been specified
+but evaluates to zero.
+.PP
+The following options are available when as is configured for
+an Xtensa processor.
+.IP "\fB\-\-text\-section\-literals | \-\-no\-text\-section\-literals\fR" 4
+.IX Item "--text-section-literals | --no-text-section-literals"
+With \fB\-\-text\-section\-literals\fR, literal pools are interspersed
+in the text section. The default is
+\&\fB\-\-no\-text\-section\-literals\fR, which places literals in a
+separate section in the output file. These options only affect literals
+referenced via PC-relative \f(CW\*(C`L32R\*(C'\fR instructions; literals for
+absolute mode \f(CW\*(C`L32R\*(C'\fR instructions are handled separately.
+.IP "\fB\-\-absolute\-literals | \-\-no\-absolute\-literals\fR" 4
+.IX Item "--absolute-literals | --no-absolute-literals"
+Indicate to the assembler whether \f(CW\*(C`L32R\*(C'\fR instructions use absolute
+or PC-relative addressing. The default is to assume absolute addressing
+if the Xtensa processor includes the absolute \f(CW\*(C`L32R\*(C'\fR addressing
+option. Otherwise, only the PC-relative \f(CW\*(C`L32R\*(C'\fR mode can be used.
+.IP "\fB\-\-target\-align | \-\-no\-target\-align\fR" 4
+.IX Item "--target-align | --no-target-align"
+Enable or disable automatic alignment to reduce branch penalties at the
+expense of some code density. The default is \fB\-\-target\-align\fR.
+.IP "\fB\-\-longcalls | \-\-no\-longcalls\fR" 4
+.IX Item "--longcalls | --no-longcalls"
+Enable or disable transformation of call instructions to allow calls
+across a greater range of addresses. The default is
+\&\fB\-\-no\-longcalls\fR.
+.IP "\fB\-\-transform | \-\-no\-transform\fR" 4
+.IX Item "--transform | --no-transform"
+Enable or disable all assembler transformations of Xtensa instructions.
+The default is \fB\-\-transform\fR;
+\&\fB\-\-no\-transform\fR should be used only in the rare cases when the
+instructions must be exactly as specified in the assembly source.
+.IP "\fB\-\-rename\-section\fR \fIoldname\fR\fB=\fR\fInewname\fR" 4
+.IX Item "--rename-section oldname=newname"
+When generating output sections, rename the \fIoldname\fR section to
+\&\fInewname\fR.
+.PP
+The following options are available when as is configured for
+a Z80 family processor.
+.IP "\fB\-z80\fR" 4
+.IX Item "-z80"
+Assemble for Z80 processor.
+.IP "\fB\-r800\fR" 4
+.IX Item "-r800"
+Assemble for R800 processor.
+.IP "\fB\-ignore\-undocumented\-instructions\fR" 4
+.IX Item "-ignore-undocumented-instructions"
+.PD 0
+.IP "\fB\-Wnud\fR" 4
+.IX Item "-Wnud"
+.PD
+Assemble undocumented Z80 instructions that also work on R800 without warning.
+.IP "\fB\-ignore\-unportable\-instructions\fR" 4
+.IX Item "-ignore-unportable-instructions"
+.PD 0
+.IP "\fB\-Wnup\fR" 4
+.IX Item "-Wnup"
+.PD
+Assemble all undocumented Z80 instructions without warning.
+.IP "\fB\-warn\-undocumented\-instructions\fR" 4
+.IX Item "-warn-undocumented-instructions"
+.PD 0
+.IP "\fB\-Wud\fR" 4
+.IX Item "-Wud"
+.PD
+Issue a warning for undocumented Z80 instructions that also work on R800.
+.IP "\fB\-warn\-unportable\-instructions\fR" 4
+.IX Item "-warn-unportable-instructions"
+.PD 0
+.IP "\fB\-Wup\fR" 4
+.IX Item "-Wup"
+.PD
+Issue a warning for undocumented Z80 instructions that do not work on R800.
+.IP "\fB\-forbid\-undocumented\-instructions\fR" 4
+.IX Item "-forbid-undocumented-instructions"
+.PD 0
+.IP "\fB\-Fud\fR" 4
+.IX Item "-Fud"
+.PD
+Treat all undocumented instructions as errors.
+.IP "\fB\-forbid\-unportable\-instructions\fR" 4
+.IX Item "-forbid-unportable-instructions"
+.PD 0
+.IP "\fB\-Fup\fR" 4
+.IX Item "-Fup"
+.PD
+Treat undocumented Z80 instructions that do not work on R800 as errors.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fIgcc\fR\|(1), \fIld\fR\|(1), and the Info entries for \fIbinutils\fR and \fIld\fR.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002,
+2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, with no Front-Cover Texts, and with no
+Back-Cover Texts. A copy of the license is included in the
+section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-c++filt.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-c++filt.1
new file mode 100644
index 0000000..76c7e0d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-c++filt.1
@@ -0,0 +1,345 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "C++FILT 1"
+.TH C++FILT 1 "2009-10-16" "binutils-2.20" "GNU Development Tools"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+c++filt \- Demangle C++ and Java symbols.
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+c++filt [\fB\-_\fR|\fB\-\-strip\-underscores\fR]
+ [\fB\-n\fR|\fB\-\-no\-strip\-underscores\fR]
+ [\fB\-p\fR|\fB\-\-no\-params\fR]
+ [\fB\-t\fR|\fB\-\-types\fR]
+ [\fB\-i\fR|\fB\-\-no\-verbose\fR]
+ [\fB\-s\fR \fIformat\fR|\fB\-\-format=\fR\fIformat\fR]
+ [\fB\-\-help\fR] [\fB\-\-version\fR] [\fIsymbol\fR...]
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+The \*(C+ and Java languages provide function overloading, which means
+that you can write many functions with the same name, providing that
+each function takes parameters of different types. In order to be
+able to distinguish these similarly named functions \*(C+ and Java
+encode them into a low-level assembler name which uniquely identifies
+each different version. This process is known as \fImangling\fR. The
+\&\fBc++filt\fR
+[1]
+program does the inverse mapping: it decodes (\fIdemangles\fR) low-level
+names into user-level names so that they can be read.
+.PP
+Every alphanumeric word (consisting of letters, digits, underscores,
+dollars, or periods) seen in the input is a potential mangled name.
+If the name decodes into a \*(C+ name, the \*(C+ name replaces the
+low-level name in the output, otherwise the original word is output.
+In this way you can pass an entire assembler source file, containing
+mangled names, through \fBc++filt\fR and see the same source file
+containing demangled names.
+.PP
+You can also use \fBc++filt\fR to decipher individual symbols by
+passing them on the command line:
+.PP
+.Vb 1
+\& c++filt <symbol>
+.Ve
+.PP
+If no \fIsymbol\fR arguments are given, \fBc++filt\fR reads symbol
+names from the standard input instead. All the results are printed on
+the standard output. The difference between reading names from the
+command line versus reading names from the standard input is that
+command line arguments are expected to be just mangled names and no
+checking is performed to separate them from surrounding text. Thus
+for example:
+.PP
+.Vb 1
+\& c++filt \-n _Z1fv
+.Ve
+.PP
+will work and demangle the name to \*(L"f()\*(R" whereas:
+.PP
+.Vb 1
+\& c++filt \-n _Z1fv,
+.Ve
+.PP
+will not work. (Note the extra comma at the end of the mangled
+name which makes it invalid). This command however will work:
+.PP
+.Vb 1
+\& echo _Z1fv, | c++filt \-n
+.Ve
+.PP
+and will display \*(L"f(),\*(R", i.e., the demangled name followed by a
+trailing comma. This behaviour is because when the names are read
+from the standard input it is expected that they might be part of an
+assembler source file where there might be extra, extraneous
+characters trailing after a mangled name. For example:
+.PP
+.Vb 1
+\& .type _Z1fv, @function
+.Ve
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+.IP "\fB\-_\fR" 4
+.IX Item "-_"
+.PD 0
+.IP "\fB\-\-strip\-underscores\fR" 4
+.IX Item "--strip-underscores"
+.PD
+On some systems, both the C and \*(C+ compilers put an underscore in front
+of every name. For example, the C name \f(CW\*(C`foo\*(C'\fR gets the low-level
+name \f(CW\*(C`_foo\*(C'\fR. This option removes the initial underscore. Whether
+\&\fBc++filt\fR removes the underscore by default is target dependent.
+.IP "\fB\-n\fR" 4
+.IX Item "-n"
+.PD 0
+.IP "\fB\-\-no\-strip\-underscores\fR" 4
+.IX Item "--no-strip-underscores"
+.PD
+Do not remove the initial underscore.
+.IP "\fB\-p\fR" 4
+.IX Item "-p"
+.PD 0
+.IP "\fB\-\-no\-params\fR" 4
+.IX Item "--no-params"
+.PD
+When demangling the name of a function, do not display the types of
+the function's parameters.
+.IP "\fB\-t\fR" 4
+.IX Item "-t"
+.PD 0
+.IP "\fB\-\-types\fR" 4
+.IX Item "--types"
+.PD
+Attempt to demangle types as well as function names. This is disabled
+by default since mangled types are normally only used internally in
+the compiler, and they can be confused with non-mangled names. For example,
+a function called \*(L"a\*(R" treated as a mangled type name would be
+demangled to \*(L"signed char\*(R".
+.IP "\fB\-i\fR" 4
+.IX Item "-i"
+.PD 0
+.IP "\fB\-\-no\-verbose\fR" 4
+.IX Item "--no-verbose"
+.PD
+Do not include implementation details (if any) in the demangled
+output.
+.IP "\fB\-s\fR \fIformat\fR" 4
+.IX Item "-s format"
+.PD 0
+.IP "\fB\-\-format=\fR\fIformat\fR" 4
+.IX Item "--format=format"
+.PD
+\&\fBc++filt\fR can decode various methods of mangling, used by
+different compilers. The argument to this option selects which
+method it uses:
+.RS 4
+.ie n .IP """auto""" 4
+.el .IP "\f(CWauto\fR" 4
+.IX Item "auto"
+Automatic selection based on executable (the default method)
+.ie n .IP """gnu""" 4
+.el .IP "\f(CWgnu\fR" 4
+.IX Item "gnu"
+the one used by the \s-1GNU\s0 \*(C+ compiler (g++)
+.ie n .IP """lucid""" 4
+.el .IP "\f(CWlucid\fR" 4
+.IX Item "lucid"
+the one used by the Lucid compiler (lcc)
+.ie n .IP """arm""" 4
+.el .IP "\f(CWarm\fR" 4
+.IX Item "arm"
+the one specified by the \*(C+ Annotated Reference Manual
+.ie n .IP """hp""" 4
+.el .IP "\f(CWhp\fR" 4
+.IX Item "hp"
+the one used by the \s-1HP\s0 compiler (aCC)
+.ie n .IP """edg""" 4
+.el .IP "\f(CWedg\fR" 4
+.IX Item "edg"
+the one used by the \s-1EDG\s0 compiler
+.ie n .IP """gnu\-v3""" 4
+.el .IP "\f(CWgnu\-v3\fR" 4
+.IX Item "gnu-v3"
+the one used by the \s-1GNU\s0 \*(C+ compiler (g++) with the V3 \s-1ABI\s0.
+.ie n .IP """java""" 4
+.el .IP "\f(CWjava\fR" 4
+.IX Item "java"
+the one used by the \s-1GNU\s0 Java compiler (gcj)
+.ie n .IP """gnat""" 4
+.el .IP "\f(CWgnat\fR" 4
+.IX Item "gnat"
+the one used by the \s-1GNU\s0 Ada compiler (\s-1GNAT\s0).
+.RE
+.RS 4
+.RE
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
+Print a summary of the options to \fBc++filt\fR and exit.
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+Print the version number of \fBc++filt\fR and exit.
+.IP "\fB@\fR\fIfile\fR" 4
+.IX Item "@file"
+Read command-line options from \fIfile\fR. The options read are
+inserted in place of the original @\fIfile\fR option. If \fIfile\fR
+does not exist, or cannot be read, then the option will be treated
+literally, and not removed.
+.Sp
+Options in \fIfile\fR are separated by whitespace. A whitespace
+character may be included in an option by surrounding the entire
+option in either single or double quotes. Any character (including a
+backslash) may be included by prefixing the character to be included
+with a backslash. The \fIfile\fR may itself contain additional
+@\fIfile\fR options; any such options will be processed recursively.
+.SH "FOOTNOTES"
+.IX Header "FOOTNOTES"
+.IP "1." 4
+MS-DOS does not allow \f(CW\*(C`+\*(C'\fR characters in file names, so on
+MS-DOS this program is named \fB\s-1CXXFILT\s0\fR.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+the Info entries for \fIbinutils\fR.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, with no Front-Cover Texts, and with no
+Back-Cover Texts. A copy of the license is included in the
+section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-dlltool.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-dlltool.1
new file mode 100644
index 0000000..5d9dd27
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-dlltool.1
@@ -0,0 +1,529 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "DLLTOOL 1"
+.TH DLLTOOL 1 "2009-10-16" "binutils-2.20" "GNU Development Tools"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+dlltool \- Create files needed to build and use DLLs.
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+dlltool [\fB\-d\fR|\fB\-\-input\-def\fR \fIdef-file-name\fR]
+ [\fB\-b\fR|\fB\-\-base\-file\fR \fIbase-file-name\fR]
+ [\fB\-e\fR|\fB\-\-output\-exp\fR \fIexports-file-name\fR]
+ [\fB\-z\fR|\fB\-\-output\-def\fR \fIdef-file-name\fR]
+ [\fB\-l\fR|\fB\-\-output\-lib\fR \fIlibrary-file-name\fR]
+ [\fB\-y\fR|\fB\-\-output\-delaylib\fR \fIlibrary-file-name\fR]
+ [\fB\-\-export\-all\-symbols\fR] [\fB\-\-no\-export\-all\-symbols\fR]
+ [\fB\-\-exclude\-symbols\fR \fIlist\fR]
+ [\fB\-\-no\-default\-excludes\fR]
+ [\fB\-S\fR|\fB\-\-as\fR \fIpath-to-assembler\fR] [\fB\-f\fR|\fB\-\-as\-flags\fR \fIoptions\fR]
+ [\fB\-D\fR|\fB\-\-dllname\fR \fIname\fR] [\fB\-m\fR|\fB\-\-machine\fR \fImachine\fR]
+ [\fB\-a\fR|\fB\-\-add\-indirect\fR]
+ [\fB\-U\fR|\fB\-\-add\-underscore\fR] [\fB\-\-add\-stdcall\-underscore\fR]
+ [\fB\-k\fR|\fB\-\-kill\-at\fR] [\fB\-A\fR|\fB\-\-add\-stdcall\-alias\fR]
+ [\fB\-p\fR|\fB\-\-ext\-prefix\-alias\fR \fIprefix\fR]
+ [\fB\-x\fR|\fB\-\-no\-idata4\fR] [\fB\-c\fR|\fB\-\-no\-idata5\fR]
+ [\fB\-\-use\-nul\-prefixed\-import\-tables\fR]
+ [\fB\-I\fR|\fB\-\-identify\fR \fIlibrary-file-name\fR] [\fB\-\-identify\-strict\fR]
+ [\fB\-i\fR|\fB\-\-interwork\fR]
+ [\fB\-n\fR|\fB\-\-nodelete\fR] [\fB\-t\fR|\fB\-\-temp\-prefix\fR \fIprefix\fR]
+ [\fB\-v\fR|\fB\-\-verbose\fR]
+ [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR]
+ [object\-file ...]
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+\&\fBdlltool\fR reads its inputs, which can come from the \fB\-d\fR and
+\&\fB\-b\fR options as well as object files specified on the command
+line. It then processes these inputs and if the \fB\-e\fR option has
+been specified it creates a exports file. If the \fB\-l\fR option
+has been specified it creates a library file and if the \fB\-z\fR option
+has been specified it creates a def file. Any or all of the \fB\-e\fR,
+\&\fB\-l\fR and \fB\-z\fR options can be present in one invocation of
+dlltool.
+.PP
+When creating a \s-1DLL\s0, along with the source for the \s-1DLL\s0, it is necessary
+to have three other files. \fBdlltool\fR can help with the creation of
+these files.
+.PP
+The first file is a \fI.def\fR file which specifies which functions are
+exported from the \s-1DLL\s0, which functions the \s-1DLL\s0 imports, and so on. This
+is a text file and can be created by hand, or \fBdlltool\fR can be used
+to create it using the \fB\-z\fR option. In this case \fBdlltool\fR
+will scan the object files specified on its command line looking for
+those functions which have been specially marked as being exported and
+put entries for them in the \fI.def\fR file it creates.
+.PP
+In order to mark a function as being exported from a \s-1DLL\s0, it needs to
+have an \fB\-export:<name_of_function>\fR entry in the \fB.drectve\fR
+section of the object file. This can be done in C by using the
+\&\fIasm()\fR operator:
+.PP
+.Vb 2
+\& asm (".section .drectve");
+\& asm (".ascii \e"\-export:my_func\e"");
+\&
+\& int my_func (void) { ... }
+.Ve
+.PP
+The second file needed for \s-1DLL\s0 creation is an exports file. This file
+is linked with the object files that make up the body of the \s-1DLL\s0 and it
+handles the interface between the \s-1DLL\s0 and the outside world. This is a
+binary file and it can be created by giving the \fB\-e\fR option to
+\&\fBdlltool\fR when it is creating or reading in a \fI.def\fR file.
+.PP
+The third file needed for \s-1DLL\s0 creation is the library file that programs
+will link with in order to access the functions in the \s-1DLL\s0 (an `import
+library'). This file can be created by giving the \fB\-l\fR option to
+dlltool when it is creating or reading in a \fI.def\fR file.
+.PP
+If the \fB\-y\fR option is specified, dlltool generates a delay-import
+library that can be used instead of the normal import library to allow
+a program to link to the dll only as soon as an imported function is
+called for the first time. The resulting executable will need to be
+linked to the static delayimp library containing _\|\fI_delayLoadHelper2()\fR,
+which in turn will import LoadLibraryA and GetProcAddress from kernel32.
+.PP
+\&\fBdlltool\fR builds the library file by hand, but it builds the
+exports file by creating temporary files containing assembler statements
+and then assembling these. The \fB\-S\fR command line option can be
+used to specify the path to the assembler that dlltool will use,
+and the \fB\-f\fR option can be used to pass specific flags to that
+assembler. The \fB\-n\fR can be used to prevent dlltool from deleting
+these temporary assembler files when it is done, and if \fB\-n\fR is
+specified twice then this will prevent dlltool from deleting the
+temporary object files it used to build the library.
+.PP
+Here is an example of creating a \s-1DLL\s0 from a source file \fBdll.c\fR and
+also creating a program (from an object file called \fBprogram.o\fR)
+that uses that \s-1DLL:\s0
+.PP
+.Vb 4
+\& gcc \-c dll.c
+\& dlltool \-e exports.o \-l dll.lib dll.o
+\& gcc dll.o exports.o \-o dll.dll
+\& gcc program.o dll.lib \-o program
+.Ve
+.PP
+\&\fBdlltool\fR may also be used to query an existing import library
+to determine the name of the \s-1DLL\s0 to which it is associated. See the
+description of the \fB\-I\fR or \fB\-\-identify\fR option.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+The command line options have the following meanings:
+.IP "\fB\-d\fR \fIfilename\fR" 4
+.IX Item "-d filename"
+.PD 0
+.IP "\fB\-\-input\-def\fR \fIfilename\fR" 4
+.IX Item "--input-def filename"
+.PD
+Specifies the name of a \fI.def\fR file to be read in and processed.
+.IP "\fB\-b\fR \fIfilename\fR" 4
+.IX Item "-b filename"
+.PD 0
+.IP "\fB\-\-base\-file\fR \fIfilename\fR" 4
+.IX Item "--base-file filename"
+.PD
+Specifies the name of a base file to be read in and processed. The
+contents of this file will be added to the relocation section in the
+exports file generated by dlltool.
+.IP "\fB\-e\fR \fIfilename\fR" 4
+.IX Item "-e filename"
+.PD 0
+.IP "\fB\-\-output\-exp\fR \fIfilename\fR" 4
+.IX Item "--output-exp filename"
+.PD
+Specifies the name of the export file to be created by dlltool.
+.IP "\fB\-z\fR \fIfilename\fR" 4
+.IX Item "-z filename"
+.PD 0
+.IP "\fB\-\-output\-def\fR \fIfilename\fR" 4
+.IX Item "--output-def filename"
+.PD
+Specifies the name of the \fI.def\fR file to be created by dlltool.
+.IP "\fB\-l\fR \fIfilename\fR" 4
+.IX Item "-l filename"
+.PD 0
+.IP "\fB\-\-output\-lib\fR \fIfilename\fR" 4
+.IX Item "--output-lib filename"
+.PD
+Specifies the name of the library file to be created by dlltool.
+.IP "\fB\-y\fR \fIfilename\fR" 4
+.IX Item "-y filename"
+.PD 0
+.IP "\fB\-\-output\-delaylib\fR \fIfilename\fR" 4
+.IX Item "--output-delaylib filename"
+.PD
+Specifies the name of the delay-import library file to be created by dlltool.
+.IP "\fB\-\-export\-all\-symbols\fR" 4
+.IX Item "--export-all-symbols"
+Treat all global and weak defined symbols found in the input object
+files as symbols to be exported. There is a small list of symbols which
+are not exported by default; see the \fB\-\-no\-default\-excludes\fR
+option. You may add to the list of symbols to not export by using the
+\&\fB\-\-exclude\-symbols\fR option.
+.IP "\fB\-\-no\-export\-all\-symbols\fR" 4
+.IX Item "--no-export-all-symbols"
+Only export symbols explicitly listed in an input \fI.def\fR file or in
+\&\fB.drectve\fR sections in the input object files. This is the default
+behaviour. The \fB.drectve\fR sections are created by \fBdllexport\fR
+attributes in the source code.
+.IP "\fB\-\-exclude\-symbols\fR \fIlist\fR" 4
+.IX Item "--exclude-symbols list"
+Do not export the symbols in \fIlist\fR. This is a list of symbol names
+separated by comma or colon characters. The symbol names should not
+contain a leading underscore. This is only meaningful when
+\&\fB\-\-export\-all\-symbols\fR is used.
+.IP "\fB\-\-no\-default\-excludes\fR" 4
+.IX Item "--no-default-excludes"
+When \fB\-\-export\-all\-symbols\fR is used, it will by default avoid
+exporting certain special symbols. The current list of symbols to avoid
+exporting is \fBDllMain@12\fR, \fBDllEntryPoint@0\fR,
+\&\fBimpure_ptr\fR. You may use the \fB\-\-no\-default\-excludes\fR option
+to go ahead and export these special symbols. This is only meaningful
+when \fB\-\-export\-all\-symbols\fR is used.
+.IP "\fB\-S\fR \fIpath\fR" 4
+.IX Item "-S path"
+.PD 0
+.IP "\fB\-\-as\fR \fIpath\fR" 4
+.IX Item "--as path"
+.PD
+Specifies the path, including the filename, of the assembler to be used
+to create the exports file.
+.IP "\fB\-f\fR \fIoptions\fR" 4
+.IX Item "-f options"
+.PD 0
+.IP "\fB\-\-as\-flags\fR \fIoptions\fR" 4
+.IX Item "--as-flags options"
+.PD
+Specifies any specific command line options to be passed to the
+assembler when building the exports file. This option will work even if
+the \fB\-S\fR option is not used. This option only takes one argument,
+and if it occurs more than once on the command line, then later
+occurrences will override earlier occurrences. So if it is necessary to
+pass multiple options to the assembler they should be enclosed in
+double quotes.
+.IP "\fB\-D\fR \fIname\fR" 4
+.IX Item "-D name"
+.PD 0
+.IP "\fB\-\-dll\-name\fR \fIname\fR" 4
+.IX Item "--dll-name name"
+.PD
+Specifies the name to be stored in the \fI.def\fR file as the name of
+the \s-1DLL\s0 when the \fB\-e\fR option is used. If this option is not
+present, then the filename given to the \fB\-e\fR option will be
+used as the name of the \s-1DLL\s0.
+.IP "\fB\-m\fR \fImachine\fR" 4
+.IX Item "-m machine"
+.PD 0
+.IP "\fB\-machine\fR \fImachine\fR" 4
+.IX Item "-machine machine"
+.PD
+Specifies the type of machine for which the library file should be
+built. \fBdlltool\fR has a built in default type, depending upon how
+it was created, but this option can be used to override that. This is
+normally only useful when creating DLLs for an \s-1ARM\s0 processor, when the
+contents of the \s-1DLL\s0 are actually encode using Thumb instructions.
+.IP "\fB\-a\fR" 4
+.IX Item "-a"
+.PD 0
+.IP "\fB\-\-add\-indirect\fR" 4
+.IX Item "--add-indirect"
+.PD
+Specifies that when \fBdlltool\fR is creating the exports file it
+should add a section which allows the exported functions to be
+referenced without using the import library. Whatever the hell that
+means!
+.IP "\fB\-U\fR" 4
+.IX Item "-U"
+.PD 0
+.IP "\fB\-\-add\-underscore\fR" 4
+.IX Item "--add-underscore"
+.PD
+Specifies that when \fBdlltool\fR is creating the exports file it
+should prepend an underscore to the names of \fIall\fR exported symbols.
+.IP "\fB\-\-add\-stdcall\-underscore\fR" 4
+.IX Item "--add-stdcall-underscore"
+Specifies that when \fBdlltool\fR is creating the exports file it
+should prepend an underscore to the names of exported \fIstdcall\fR
+functions. Variable names and non-stdcall function names are not modified.
+This option is useful when creating GNU-compatible import libs for third
+party DLLs that were built with MS-Windows tools.
+.IP "\fB\-k\fR" 4
+.IX Item "-k"
+.PD 0
+.IP "\fB\-\-kill\-at\fR" 4
+.IX Item "--kill-at"
+.PD
+Specifies that when \fBdlltool\fR is creating the exports file it
+should not append the string \fB@ <number>\fR. These numbers are
+called ordinal numbers and they represent another way of accessing the
+function in a \s-1DLL\s0, other than by name.
+.IP "\fB\-A\fR" 4
+.IX Item "-A"
+.PD 0
+.IP "\fB\-\-add\-stdcall\-alias\fR" 4
+.IX Item "--add-stdcall-alias"
+.PD
+Specifies that when \fBdlltool\fR is creating the exports file it
+should add aliases for stdcall symbols without \fB@ <number>\fR
+in addition to the symbols with \fB@ <number>\fR.
+.IP "\fB\-p\fR" 4
+.IX Item "-p"
+.PD 0
+.IP "\fB\-\-ext\-prefix\-alias\fR \fIprefix\fR" 4
+.IX Item "--ext-prefix-alias prefix"
+.PD
+Causes \fBdlltool\fR to create external aliases for all \s-1DLL\s0
+imports with the specified prefix. The aliases are created for both
+external and import symbols with no leading underscore.
+.IP "\fB\-x\fR" 4
+.IX Item "-x"
+.PD 0
+.IP "\fB\-\-no\-idata4\fR" 4
+.IX Item "--no-idata4"
+.PD
+Specifies that when \fBdlltool\fR is creating the exports and library
+files it should omit the \f(CW\*(C`.idata4\*(C'\fR section. This is for compatibility
+with certain operating systems.
+.IP "\fB\-\-use\-nul\-prefixed\-import\-tables\fR" 4
+.IX Item "--use-nul-prefixed-import-tables"
+Specifies that when \fBdlltool\fR is creating the exports and library
+files it should prefix the \f(CW\*(C`.idata4\*(C'\fR and \f(CW\*(C`.idata5\*(C'\fR by zero an
+element. This emulates old gnu import library generation of
+\&\f(CW\*(C`dlltool\*(C'\fR. By default this option is turned off.
+.IP "\fB\-c\fR" 4
+.IX Item "-c"
+.PD 0
+.IP "\fB\-\-no\-idata5\fR" 4
+.IX Item "--no-idata5"
+.PD
+Specifies that when \fBdlltool\fR is creating the exports and library
+files it should omit the \f(CW\*(C`.idata5\*(C'\fR section. This is for compatibility
+with certain operating systems.
+.IP "\fB\-I\fR \fIfilename\fR" 4
+.IX Item "-I filename"
+.PD 0
+.IP "\fB\-\-identify\fR \fIfilename\fR" 4
+.IX Item "--identify filename"
+.PD
+Specifies that \fBdlltool\fR should inspect the import library
+indicated by \fIfilename\fR and report, on \f(CW\*(C`stdout\*(C'\fR, the name(s)
+of the associated \s-1DLL\s0(s). This can be performed in addition to any
+other operations indicated by the other options and arguments.
+\&\fBdlltool\fR fails if the import library does not exist or is not
+actually an import library. See also \fB\-\-identify\-strict\fR.
+.IP "\fB\-\-identify\-strict\fR" 4
+.IX Item "--identify-strict"
+Modifies the behavior of the \fB\-\-identify\fR option, such
+that an error is reported if \fIfilename\fR is associated with
+more than one \s-1DLL\s0.
+.IP "\fB\-i\fR" 4
+.IX Item "-i"
+.PD 0
+.IP "\fB\-\-interwork\fR" 4
+.IX Item "--interwork"
+.PD
+Specifies that \fBdlltool\fR should mark the objects in the library
+file and exports file that it produces as supporting interworking
+between \s-1ARM\s0 and Thumb code.
+.IP "\fB\-n\fR" 4
+.IX Item "-n"
+.PD 0
+.IP "\fB\-\-nodelete\fR" 4
+.IX Item "--nodelete"
+.PD
+Makes \fBdlltool\fR preserve the temporary assembler files it used to
+create the exports file. If this option is repeated then dlltool will
+also preserve the temporary object files it uses to create the library
+file.
+.IP "\fB\-t\fR \fIprefix\fR" 4
+.IX Item "-t prefix"
+.PD 0
+.IP "\fB\-\-temp\-prefix\fR \fIprefix\fR" 4
+.IX Item "--temp-prefix prefix"
+.PD
+Makes \fBdlltool\fR use \fIprefix\fR when constructing the names of
+temporary assembler and object files. By default, the temp file prefix
+is generated from the pid.
+.IP "\fB\-v\fR" 4
+.IX Item "-v"
+.PD 0
+.IP "\fB\-\-verbose\fR" 4
+.IX Item "--verbose"
+.PD
+Make dlltool describe what it is doing.
+.IP "\fB\-h\fR" 4
+.IX Item "-h"
+.PD 0
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
+.PD
+Displays a list of command line options and then exits.
+.IP "\fB\-V\fR" 4
+.IX Item "-V"
+.PD 0
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+.PD
+Displays dlltool's version number and then exits.
+.IP "\fB@\fR\fIfile\fR" 4
+.IX Item "@file"
+Read command-line options from \fIfile\fR. The options read are
+inserted in place of the original @\fIfile\fR option. If \fIfile\fR
+does not exist, or cannot be read, then the option will be treated
+literally, and not removed.
+.Sp
+Options in \fIfile\fR are separated by whitespace. A whitespace
+character may be included in an option by surrounding the entire
+option in either single or double quotes. Any character (including a
+backslash) may be included by prefixing the character to be included
+with a backslash. The \fIfile\fR may itself contain additional
+@\fIfile\fR options; any such options will be processed recursively.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+The Info pages for \fIbinutils\fR.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, with no Front-Cover Texts, and with no
+Back-Cover Texts. A copy of the license is included in the
+section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-gprof.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-gprof.1
new file mode 100644
index 0000000..536c6a2
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-gprof.1
@@ -0,0 +1,772 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "GPROF 1"
+.TH GPROF 1 "2009-10-16" "binutils-2.20" "GNU"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+gprof \- display call graph profile data
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+gprof [ \-[abcDhilLrsTvwxyz] ] [ \-[ACeEfFJnNOpPqQZ][\fIname\fR] ]
+ [ \-I \fIdirs\fR ] [ \-d[\fInum\fR] ] [ \-k \fIfrom/to\fR ]
+ [ \-m \fImin-count\fR ] [ \-R \fImap_file\fR ] [ \-t \fItable-length\fR ]
+ [ \-\-[no\-]annotated\-source[=\fIname\fR] ]
+ [ \-\-[no\-]exec\-counts[=\fIname\fR] ]
+ [ \-\-[no\-]flat\-profile[=\fIname\fR] ] [ \-\-[no\-]graph[=\fIname\fR] ]
+ [ \-\-[no\-]time=\fIname\fR] [ \-\-all\-lines ] [ \-\-brief ]
+ [ \-\-debug[=\fIlevel\fR] ] [ \-\-function\-ordering ]
+ [ \-\-file\-ordering \fImap_file\fR ] [ \-\-directory\-path=\fIdirs\fR ]
+ [ \-\-display\-unused\-functions ] [ \-\-file\-format=\fIname\fR ]
+ [ \-\-file\-info ] [ \-\-help ] [ \-\-line ] [ \-\-min\-count=\fIn\fR ]
+ [ \-\-no\-static ] [ \-\-print\-path ] [ \-\-separate\-files ]
+ [ \-\-static\-call\-graph ] [ \-\-sum ] [ \-\-table\-length=\fIlen\fR ]
+ [ \-\-traditional ] [ \-\-version ] [ \-\-width=\fIn\fR ]
+ [ \-\-ignore\-non\-functions ] [ \-\-demangle[=\fI\s-1STYLE\s0\fR] ]
+ [ \-\-no\-demangle ] [\-\-external\-symbol\-table=name]
+ [ \fIimage-file\fR ] [ \fIprofile-file\fR ... ]
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+\&\f(CW\*(C`gprof\*(C'\fR produces an execution profile of C, Pascal, or Fortran77
+programs. The effect of called routines is incorporated in the profile
+of each caller. The profile data is taken from the call graph profile file
+(\fIgmon.out\fR default) which is created by programs
+that are compiled with the \fB\-pg\fR option of
+\&\f(CW\*(C`cc\*(C'\fR, \f(CW\*(C`pc\*(C'\fR, and \f(CW\*(C`f77\*(C'\fR.
+The \fB\-pg\fR option also links in versions of the library routines
+that are compiled for profiling. \f(CW\*(C`Gprof\*(C'\fR reads the given object
+file (the default is \f(CW\*(C`a.out\*(C'\fR) and establishes the relation between
+its symbol table and the call graph profile from \fIgmon.out\fR.
+If more than one profile file is specified, the \f(CW\*(C`gprof\*(C'\fR
+output shows the sum of the profile information in the given profile files.
+.PP
+\&\f(CW\*(C`Gprof\*(C'\fR calculates the amount of time spent in each routine.
+Next, these times are propagated along the edges of the call graph.
+Cycles are discovered, and calls into a cycle are made to share the time
+of the cycle.
+.PP
+Several forms of output are available from the analysis.
+.PP
+The \fIflat profile\fR shows how much time your program spent in each function,
+and how many times that function was called. If you simply want to know
+which functions burn most of the cycles, it is stated concisely here.
+.PP
+The \fIcall graph\fR shows, for each function, which functions called it, which
+other functions it called, and how many times. There is also an estimate
+of how much time was spent in the subroutines of each function. This can
+suggest places where you might try to eliminate function calls that use a
+lot of time.
+.PP
+The \fIannotated source\fR listing is a copy of the program's
+source code, labeled with the number of times each line of the
+program was executed.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+These options specify which of several output formats
+\&\f(CW\*(C`gprof\*(C'\fR should produce.
+.PP
+Many of these options take an optional \fIsymspec\fR to specify
+functions to be included or excluded. These options can be
+specified multiple times, with different symspecs, to include
+or exclude sets of symbols.
+.PP
+Specifying any of these options overrides the default (\fB\-p \-q\fR),
+which prints a flat profile and call graph analysis
+for all functions.
+.ie n .IP """\-A[\f(CIsymspec\f(CW]""" 4
+.el .IP "\f(CW\-A[\f(CIsymspec\f(CW]\fR" 4
+.IX Item "-A[symspec]"
+.PD 0
+.ie n .IP """\-\-annotated\-source[=\f(CIsymspec\f(CW]""" 4
+.el .IP "\f(CW\-\-annotated\-source[=\f(CIsymspec\f(CW]\fR" 4
+.IX Item "--annotated-source[=symspec]"
+.PD
+The \fB\-A\fR option causes \f(CW\*(C`gprof\*(C'\fR to print annotated source code.
+If \fIsymspec\fR is specified, print output only for matching symbols.
+.ie n .IP """\-b""" 4
+.el .IP "\f(CW\-b\fR" 4
+.IX Item "-b"
+.PD 0
+.ie n .IP """\-\-brief""" 4
+.el .IP "\f(CW\-\-brief\fR" 4
+.IX Item "--brief"
+.PD
+If the \fB\-b\fR option is given, \f(CW\*(C`gprof\*(C'\fR doesn't print the
+verbose blurbs that try to explain the meaning of all of the fields in
+the tables. This is useful if you intend to print out the output, or
+are tired of seeing the blurbs.
+.ie n .IP """\-C[\f(CIsymspec\f(CW]""" 4
+.el .IP "\f(CW\-C[\f(CIsymspec\f(CW]\fR" 4
+.IX Item "-C[symspec]"
+.PD 0
+.ie n .IP """\-\-exec\-counts[=\f(CIsymspec\f(CW]""" 4
+.el .IP "\f(CW\-\-exec\-counts[=\f(CIsymspec\f(CW]\fR" 4
+.IX Item "--exec-counts[=symspec]"
+.PD
+The \fB\-C\fR option causes \f(CW\*(C`gprof\*(C'\fR to
+print a tally of functions and the number of times each was called.
+If \fIsymspec\fR is specified, print tally only for matching symbols.
+.Sp
+If the profile data file contains basic-block count records, specifying
+the \fB\-l\fR option, along with \fB\-C\fR, will cause basic-block
+execution counts to be tallied and displayed.
+.ie n .IP """\-i""" 4
+.el .IP "\f(CW\-i\fR" 4
+.IX Item "-i"
+.PD 0
+.ie n .IP """\-\-file\-info""" 4
+.el .IP "\f(CW\-\-file\-info\fR" 4
+.IX Item "--file-info"
+.PD
+The \fB\-i\fR option causes \f(CW\*(C`gprof\*(C'\fR to display summary information
+about the profile data file(s) and then exit. The number of histogram,
+call graph, and basic-block count records is displayed.
+.ie n .IP """\-I \f(CIdirs\f(CW""" 4
+.el .IP "\f(CW\-I \f(CIdirs\f(CW\fR" 4
+.IX Item "-I dirs"
+.PD 0
+.ie n .IP """\-\-directory\-path=\f(CIdirs\f(CW""" 4
+.el .IP "\f(CW\-\-directory\-path=\f(CIdirs\f(CW\fR" 4
+.IX Item "--directory-path=dirs"
+.PD
+The \fB\-I\fR option specifies a list of search directories in
+which to find source files. Environment variable \fI\s-1GPROF_PATH\s0\fR
+can also be used to convey this information.
+Used mostly for annotated source output.
+.ie n .IP """\-J[\f(CIsymspec\f(CW]""" 4
+.el .IP "\f(CW\-J[\f(CIsymspec\f(CW]\fR" 4
+.IX Item "-J[symspec]"
+.PD 0
+.ie n .IP """\-\-no\-annotated\-source[=\f(CIsymspec\f(CW]""" 4
+.el .IP "\f(CW\-\-no\-annotated\-source[=\f(CIsymspec\f(CW]\fR" 4
+.IX Item "--no-annotated-source[=symspec]"
+.PD
+The \fB\-J\fR option causes \f(CW\*(C`gprof\*(C'\fR not to
+print annotated source code.
+If \fIsymspec\fR is specified, \f(CW\*(C`gprof\*(C'\fR prints annotated source,
+but excludes matching symbols.
+.ie n .IP """\-L""" 4
+.el .IP "\f(CW\-L\fR" 4
+.IX Item "-L"
+.PD 0
+.ie n .IP """\-\-print\-path""" 4
+.el .IP "\f(CW\-\-print\-path\fR" 4
+.IX Item "--print-path"
+.PD
+Normally, source filenames are printed with the path
+component suppressed. The \fB\-L\fR option causes \f(CW\*(C`gprof\*(C'\fR
+to print the full pathname of
+source filenames, which is determined
+from symbolic debugging information in the image file
+and is relative to the directory in which the compiler
+was invoked.
+.ie n .IP """\-p[\f(CIsymspec\f(CW]""" 4
+.el .IP "\f(CW\-p[\f(CIsymspec\f(CW]\fR" 4
+.IX Item "-p[symspec]"
+.PD 0
+.ie n .IP """\-\-flat\-profile[=\f(CIsymspec\f(CW]""" 4
+.el .IP "\f(CW\-\-flat\-profile[=\f(CIsymspec\f(CW]\fR" 4
+.IX Item "--flat-profile[=symspec]"
+.PD
+The \fB\-p\fR option causes \f(CW\*(C`gprof\*(C'\fR to print a flat profile.
+If \fIsymspec\fR is specified, print flat profile only for matching symbols.
+.ie n .IP """\-P[\f(CIsymspec\f(CW]""" 4
+.el .IP "\f(CW\-P[\f(CIsymspec\f(CW]\fR" 4
+.IX Item "-P[symspec]"
+.PD 0
+.ie n .IP """\-\-no\-flat\-profile[=\f(CIsymspec\f(CW]""" 4
+.el .IP "\f(CW\-\-no\-flat\-profile[=\f(CIsymspec\f(CW]\fR" 4
+.IX Item "--no-flat-profile[=symspec]"
+.PD
+The \fB\-P\fR option causes \f(CW\*(C`gprof\*(C'\fR to suppress printing a flat profile.
+If \fIsymspec\fR is specified, \f(CW\*(C`gprof\*(C'\fR prints a flat profile,
+but excludes matching symbols.
+.ie n .IP """\-q[\f(CIsymspec\f(CW]""" 4
+.el .IP "\f(CW\-q[\f(CIsymspec\f(CW]\fR" 4
+.IX Item "-q[symspec]"
+.PD 0
+.ie n .IP """\-\-graph[=\f(CIsymspec\f(CW]""" 4
+.el .IP "\f(CW\-\-graph[=\f(CIsymspec\f(CW]\fR" 4
+.IX Item "--graph[=symspec]"
+.PD
+The \fB\-q\fR option causes \f(CW\*(C`gprof\*(C'\fR to print the call graph analysis.
+If \fIsymspec\fR is specified, print call graph only for matching symbols
+and their children.
+.ie n .IP """\-Q[\f(CIsymspec\f(CW]""" 4
+.el .IP "\f(CW\-Q[\f(CIsymspec\f(CW]\fR" 4
+.IX Item "-Q[symspec]"
+.PD 0
+.ie n .IP """\-\-no\-graph[=\f(CIsymspec\f(CW]""" 4
+.el .IP "\f(CW\-\-no\-graph[=\f(CIsymspec\f(CW]\fR" 4
+.IX Item "--no-graph[=symspec]"
+.PD
+The \fB\-Q\fR option causes \f(CW\*(C`gprof\*(C'\fR to suppress printing the
+call graph.
+If \fIsymspec\fR is specified, \f(CW\*(C`gprof\*(C'\fR prints a call graph,
+but excludes matching symbols.
+.ie n .IP """\-t""" 4
+.el .IP "\f(CW\-t\fR" 4
+.IX Item "-t"
+.PD 0
+.ie n .IP """\-\-table\-length=\f(CInum\f(CW""" 4
+.el .IP "\f(CW\-\-table\-length=\f(CInum\f(CW\fR" 4
+.IX Item "--table-length=num"
+.PD
+The \fB\-t\fR option causes the \fInum\fR most active source lines in
+each source file to be listed when source annotation is enabled. The
+default is 10.
+.ie n .IP """\-y""" 4
+.el .IP "\f(CW\-y\fR" 4
+.IX Item "-y"
+.PD 0
+.ie n .IP """\-\-separate\-files""" 4
+.el .IP "\f(CW\-\-separate\-files\fR" 4
+.IX Item "--separate-files"
+.PD
+This option affects annotated source output only.
+Normally, \f(CW\*(C`gprof\*(C'\fR prints annotated source files
+to standard-output. If this option is specified,
+annotated source for a file named \fIpath/\fIfilename\fI\fR
+is generated in the file \fI\fIfilename\fI\-ann\fR. If the underlying
+file system would truncate \fI\fIfilename\fI\-ann\fR so that it
+overwrites the original \fI\fIfilename\fI\fR, \f(CW\*(C`gprof\*(C'\fR generates
+annotated source in the file \fI\fIfilename\fI.ann\fR instead (if the
+original file name has an extension, that extension is \fIreplaced\fR
+with \fI.ann\fR).
+.ie n .IP """\-Z[\f(CIsymspec\f(CW]""" 4
+.el .IP "\f(CW\-Z[\f(CIsymspec\f(CW]\fR" 4
+.IX Item "-Z[symspec]"
+.PD 0
+.ie n .IP """\-\-no\-exec\-counts[=\f(CIsymspec\f(CW]""" 4
+.el .IP "\f(CW\-\-no\-exec\-counts[=\f(CIsymspec\f(CW]\fR" 4
+.IX Item "--no-exec-counts[=symspec]"
+.PD
+The \fB\-Z\fR option causes \f(CW\*(C`gprof\*(C'\fR not to
+print a tally of functions and the number of times each was called.
+If \fIsymspec\fR is specified, print tally, but exclude matching symbols.
+.ie n .IP """\-r""" 4
+.el .IP "\f(CW\-r\fR" 4
+.IX Item "-r"
+.PD 0
+.ie n .IP """\-\-function\-ordering""" 4
+.el .IP "\f(CW\-\-function\-ordering\fR" 4
+.IX Item "--function-ordering"
+.PD
+The \fB\-\-function\-ordering\fR option causes \f(CW\*(C`gprof\*(C'\fR to print a
+suggested function ordering for the program based on profiling data.
+This option suggests an ordering which may improve paging, tlb and
+cache behavior for the program on systems which support arbitrary
+ordering of functions in an executable.
+.Sp
+The exact details of how to force the linker to place functions
+in a particular order is system dependent and out of the scope of this
+manual.
+.ie n .IP """\-R \f(CImap_file\f(CW""" 4
+.el .IP "\f(CW\-R \f(CImap_file\f(CW\fR" 4
+.IX Item "-R map_file"
+.PD 0
+.ie n .IP """\-\-file\-ordering \f(CImap_file\f(CW""" 4
+.el .IP "\f(CW\-\-file\-ordering \f(CImap_file\f(CW\fR" 4
+.IX Item "--file-ordering map_file"
+.PD
+The \fB\-\-file\-ordering\fR option causes \f(CW\*(C`gprof\*(C'\fR to print a
+suggested .o link line ordering for the program based on profiling data.
+This option suggests an ordering which may improve paging, tlb and
+cache behavior for the program on systems which do not support arbitrary
+ordering of functions in an executable.
+.Sp
+Use of the \fB\-a\fR argument is highly recommended with this option.
+.Sp
+The \fImap_file\fR argument is a pathname to a file which provides
+function name to object file mappings. The format of the file is similar to
+the output of the program \f(CW\*(C`nm\*(C'\fR.
+.Sp
+.Vb 8
+\& c\-parse.o:00000000 T yyparse
+\& c\-parse.o:00000004 C yyerrflag
+\& c\-lang.o:00000000 T maybe_objc_method_name
+\& c\-lang.o:00000000 T print_lang_statistics
+\& c\-lang.o:00000000 T recognize_objc_keyword
+\& c\-decl.o:00000000 T print_lang_identifier
+\& c\-decl.o:00000000 T print_lang_type
+\& ...
+.Ve
+.Sp
+To create a \fImap_file\fR with \s-1GNU\s0 \f(CW\*(C`nm\*(C'\fR, type a command like
+\&\f(CW\*(C`nm \-\-extern\-only \-\-defined\-only \-v \-\-print\-file\-name program\-name\*(C'\fR.
+.ie n .IP """\-T""" 4
+.el .IP "\f(CW\-T\fR" 4
+.IX Item "-T"
+.PD 0
+.ie n .IP """\-\-traditional""" 4
+.el .IP "\f(CW\-\-traditional\fR" 4
+.IX Item "--traditional"
+.PD
+The \fB\-T\fR option causes \f(CW\*(C`gprof\*(C'\fR to print its output in
+\&\*(L"traditional\*(R" \s-1BSD\s0 style.
+.ie n .IP """\-w \f(CIwidth\f(CW""" 4
+.el .IP "\f(CW\-w \f(CIwidth\f(CW\fR" 4
+.IX Item "-w width"
+.PD 0
+.ie n .IP """\-\-width=\f(CIwidth\f(CW""" 4
+.el .IP "\f(CW\-\-width=\f(CIwidth\f(CW\fR" 4
+.IX Item "--width=width"
+.PD
+Sets width of output lines to \fIwidth\fR.
+Currently only used when printing the function index at the bottom
+of the call graph.
+.ie n .IP """\-x""" 4
+.el .IP "\f(CW\-x\fR" 4
+.IX Item "-x"
+.PD 0
+.ie n .IP """\-\-all\-lines""" 4
+.el .IP "\f(CW\-\-all\-lines\fR" 4
+.IX Item "--all-lines"
+.PD
+This option affects annotated source output only.
+By default, only the lines at the beginning of a basic-block
+are annotated. If this option is specified, every line in
+a basic-block is annotated by repeating the annotation for the
+first line. This behavior is similar to \f(CW\*(C`tcov\*(C'\fR's \fB\-a\fR.
+.ie n .IP """\-\-demangle[=\f(CIstyle\f(CW]""" 4
+.el .IP "\f(CW\-\-demangle[=\f(CIstyle\f(CW]\fR" 4
+.IX Item "--demangle[=style]"
+.PD 0
+.ie n .IP """\-\-no\-demangle""" 4
+.el .IP "\f(CW\-\-no\-demangle\fR" 4
+.IX Item "--no-demangle"
+.PD
+These options control whether \*(C+ symbol names should be demangled when
+printing output. The default is to demangle symbols. The
+\&\f(CW\*(C`\-\-no\-demangle\*(C'\fR option may be used to turn off demangling. Different
+compilers have different mangling styles. The optional demangling style
+argument can be used to choose an appropriate demangling style for your
+compiler.
+.Sh "Analysis Options"
+.IX Subsection "Analysis Options"
+.ie n .IP """\-a""" 4
+.el .IP "\f(CW\-a\fR" 4
+.IX Item "-a"
+.PD 0
+.ie n .IP """\-\-no\-static""" 4
+.el .IP "\f(CW\-\-no\-static\fR" 4
+.IX Item "--no-static"
+.PD
+The \fB\-a\fR option causes \f(CW\*(C`gprof\*(C'\fR to suppress the printing of
+statically declared (private) functions. (These are functions whose
+names are not listed as global, and which are not visible outside the
+file/function/block where they were defined.) Time spent in these
+functions, calls to/from them, etc., will all be attributed to the
+function that was loaded directly before it in the executable file.
+This option affects both the flat profile and the call graph.
+.ie n .IP """\-c""" 4
+.el .IP "\f(CW\-c\fR" 4
+.IX Item "-c"
+.PD 0
+.ie n .IP """\-\-static\-call\-graph""" 4
+.el .IP "\f(CW\-\-static\-call\-graph\fR" 4
+.IX Item "--static-call-graph"
+.PD
+The \fB\-c\fR option causes the call graph of the program to be
+augmented by a heuristic which examines the text space of the object
+file and identifies function calls in the binary machine code.
+Since normal call graph records are only generated when functions are
+entered, this option identifies children that could have been called,
+but never were. Calls to functions that were not compiled with
+profiling enabled are also identified, but only if symbol table
+entries are present for them.
+Calls to dynamic library routines are typically \fInot\fR found
+by this option.
+Parents or children identified via this heuristic
+are indicated in the call graph with call counts of \fB0\fR.
+.ie n .IP """\-D""" 4
+.el .IP "\f(CW\-D\fR" 4
+.IX Item "-D"
+.PD 0
+.ie n .IP """\-\-ignore\-non\-functions""" 4
+.el .IP "\f(CW\-\-ignore\-non\-functions\fR" 4
+.IX Item "--ignore-non-functions"
+.PD
+The \fB\-D\fR option causes \f(CW\*(C`gprof\*(C'\fR to ignore symbols which
+are not known to be functions. This option will give more accurate
+profile data on systems where it is supported (Solaris and \s-1HPUX\s0 for
+example).
+.ie n .IP """\-k \f(CIfrom\f(CW/\f(CIto\f(CW""" 4
+.el .IP "\f(CW\-k \f(CIfrom\f(CW/\f(CIto\f(CW\fR" 4
+.IX Item "-k from/to"
+The \fB\-k\fR option allows you to delete from the call graph any arcs from
+symbols matching symspec \fIfrom\fR to those matching symspec \fIto\fR.
+.ie n .IP """\-l""" 4
+.el .IP "\f(CW\-l\fR" 4
+.IX Item "-l"
+.PD 0
+.ie n .IP """\-\-line""" 4
+.el .IP "\f(CW\-\-line\fR" 4
+.IX Item "--line"
+.PD
+The \fB\-l\fR option enables line-by-line profiling, which causes
+histogram hits to be charged to individual source code lines,
+instead of functions. This feature only works with programs compiled
+by older versions of the \f(CW\*(C`gcc\*(C'\fR compiler. Newer versions of
+\&\f(CW\*(C`gcc\*(C'\fR are designed to work with the \f(CW\*(C`gcov\*(C'\fR tool instead.
+.Sp
+If the program was compiled with basic-block counting enabled,
+this option will also identify how many times each line of
+code was executed.
+While line-by-line profiling can help isolate where in a large function
+a program is spending its time, it also significantly increases
+the running time of \f(CW\*(C`gprof\*(C'\fR, and magnifies statistical
+inaccuracies.
+.ie n .IP """\-m \f(CInum\f(CW""" 4
+.el .IP "\f(CW\-m \f(CInum\f(CW\fR" 4
+.IX Item "-m num"
+.PD 0
+.ie n .IP """\-\-min\-count=\f(CInum\f(CW""" 4
+.el .IP "\f(CW\-\-min\-count=\f(CInum\f(CW\fR" 4
+.IX Item "--min-count=num"
+.PD
+This option affects execution count output only.
+Symbols that are executed less than \fInum\fR times are suppressed.
+.ie n .IP """\-n\f(CIsymspec\f(CW""" 4
+.el .IP "\f(CW\-n\f(CIsymspec\f(CW\fR" 4
+.IX Item "-nsymspec"
+.PD 0
+.ie n .IP """\-\-time=\f(CIsymspec\f(CW""" 4
+.el .IP "\f(CW\-\-time=\f(CIsymspec\f(CW\fR" 4
+.IX Item "--time=symspec"
+.PD
+The \fB\-n\fR option causes \f(CW\*(C`gprof\*(C'\fR, in its call graph analysis,
+to only propagate times for symbols matching \fIsymspec\fR.
+.ie n .IP """\-N\f(CIsymspec\f(CW""" 4
+.el .IP "\f(CW\-N\f(CIsymspec\f(CW\fR" 4
+.IX Item "-Nsymspec"
+.PD 0
+.ie n .IP """\-\-no\-time=\f(CIsymspec\f(CW""" 4
+.el .IP "\f(CW\-\-no\-time=\f(CIsymspec\f(CW\fR" 4
+.IX Item "--no-time=symspec"
+.PD
+The \fB\-n\fR option causes \f(CW\*(C`gprof\*(C'\fR, in its call graph analysis,
+not to propagate times for symbols matching \fIsymspec\fR.
+.ie n .IP """\-S\f(CIfilename\f(CW""" 4
+.el .IP "\f(CW\-S\f(CIfilename\f(CW\fR" 4
+.IX Item "-Sfilename"
+.PD 0
+.ie n .IP """\-\-external\-symbol\-table=\f(CIfilename\f(CW""" 4
+.el .IP "\f(CW\-\-external\-symbol\-table=\f(CIfilename\f(CW\fR" 4
+.IX Item "--external-symbol-table=filename"
+.PD
+The \fB\-S\fR option causes \f(CW\*(C`gprof\*(C'\fR to read an external symbol table
+file, such as \fI/proc/kallsyms\fR, rather than read the symbol table
+from the given object file (the default is \f(CW\*(C`a.out\*(C'\fR). This is useful
+for profiling kernel modules.
+.ie n .IP """\-z""" 4
+.el .IP "\f(CW\-z\fR" 4
+.IX Item "-z"
+.PD 0
+.ie n .IP """\-\-display\-unused\-functions""" 4
+.el .IP "\f(CW\-\-display\-unused\-functions\fR" 4
+.IX Item "--display-unused-functions"
+.PD
+If you give the \fB\-z\fR option, \f(CW\*(C`gprof\*(C'\fR will mention all
+functions in the flat profile, even those that were never called, and
+that had no time spent in them. This is useful in conjunction with the
+\&\fB\-c\fR option for discovering which routines were never called.
+.Sh "Miscellaneous Options"
+.IX Subsection "Miscellaneous Options"
+.ie n .IP """\-d[\f(CInum\f(CW]""" 4
+.el .IP "\f(CW\-d[\f(CInum\f(CW]\fR" 4
+.IX Item "-d[num]"
+.PD 0
+.ie n .IP """\-\-debug[=\f(CInum\f(CW]""" 4
+.el .IP "\f(CW\-\-debug[=\f(CInum\f(CW]\fR" 4
+.IX Item "--debug[=num]"
+.PD
+The \fB\-d\fR \fInum\fR option specifies debugging options.
+If \fInum\fR is not specified, enable all debugging.
+.ie n .IP """\-h""" 4
+.el .IP "\f(CW\-h\fR" 4
+.IX Item "-h"
+.PD 0
+.ie n .IP """\-\-help""" 4
+.el .IP "\f(CW\-\-help\fR" 4
+.IX Item "--help"
+.PD
+The \fB\-h\fR option prints command line usage.
+.ie n .IP """\-O\f(CIname\f(CW""" 4
+.el .IP "\f(CW\-O\f(CIname\f(CW\fR" 4
+.IX Item "-Oname"
+.PD 0
+.ie n .IP """\-\-file\-format=\f(CIname\f(CW""" 4
+.el .IP "\f(CW\-\-file\-format=\f(CIname\f(CW\fR" 4
+.IX Item "--file-format=name"
+.PD
+Selects the format of the profile data files. Recognized formats are
+\&\fBauto\fR (the default), \fBbsd\fR, \fB4.4bsd\fR, \fBmagic\fR, and
+\&\fBprof\fR (not yet supported).
+.ie n .IP """\-s""" 4
+.el .IP "\f(CW\-s\fR" 4
+.IX Item "-s"
+.PD 0
+.ie n .IP """\-\-sum""" 4
+.el .IP "\f(CW\-\-sum\fR" 4
+.IX Item "--sum"
+.PD
+The \fB\-s\fR option causes \f(CW\*(C`gprof\*(C'\fR to summarize the information
+in the profile data files it read in, and write out a profile data
+file called \fIgmon.sum\fR, which contains all the information from
+the profile data files that \f(CW\*(C`gprof\*(C'\fR read in. The file \fIgmon.sum\fR
+may be one of the specified input files; the effect of this is to
+merge the data in the other input files into \fIgmon.sum\fR.
+.Sp
+Eventually you can run \f(CW\*(C`gprof\*(C'\fR again without \fB\-s\fR to analyze the
+cumulative data in the file \fIgmon.sum\fR.
+.ie n .IP """\-v""" 4
+.el .IP "\f(CW\-v\fR" 4
+.IX Item "-v"
+.PD 0
+.ie n .IP """\-\-version""" 4
+.el .IP "\f(CW\-\-version\fR" 4
+.IX Item "--version"
+.PD
+The \fB\-v\fR flag causes \f(CW\*(C`gprof\*(C'\fR to print the current version
+number, and then exit.
+.Sh "Deprecated Options"
+.IX Subsection "Deprecated Options"
+.RS 4
+These options have been replaced with newer versions that use symspecs.
+.Sp
+\&\f(CW\*(C`\-e \f(CIfunction_name\f(CW\*(C'\fR
+.Sp
+The \fB\-e\fR \fIfunction\fR option tells \f(CW\*(C`gprof\*(C'\fR to not print
+information about the function \fIfunction_name\fR (and its
+children...) in the call graph. The function will still be listed
+as a child of any functions that call it, but its index number will be
+shown as \fB[not printed]\fR. More than one \fB\-e\fR option may be
+given; only one \fIfunction_name\fR may be indicated with each \fB\-e\fR
+option.
+.Sp
+\&\f(CW\*(C`\-E \f(CIfunction_name\f(CW\*(C'\fR
+.Sp
+The \f(CW\*(C`\-E \f(CIfunction\f(CW\*(C'\fR option works like the \f(CW\*(C`\-e\*(C'\fR option, but
+time spent in the function (and children who were not called from
+anywhere else), will not be used to compute the percentages-of-time for
+the call graph. More than one \fB\-E\fR option may be given; only one
+\&\fIfunction_name\fR may be indicated with each \fB\-E\fR option.
+.Sp
+\&\f(CW\*(C`\-f \f(CIfunction_name\f(CW\*(C'\fR
+.Sp
+The \fB\-f\fR \fIfunction\fR option causes \f(CW\*(C`gprof\*(C'\fR to limit the
+call graph to the function \fIfunction_name\fR and its children (and
+their children...). More than one \fB\-f\fR option may be given;
+only one \fIfunction_name\fR may be indicated with each \fB\-f\fR
+option.
+.Sp
+\&\f(CW\*(C`\-F \f(CIfunction_name\f(CW\*(C'\fR
+.Sp
+The \fB\-F\fR \fIfunction\fR option works like the \f(CW\*(C`\-f\*(C'\fR option, but
+only time spent in the function and its children (and their
+children...) will be used to determine total-time and
+percentages-of-time for the call graph. More than one \fB\-F\fR option
+may be given; only one \fIfunction_name\fR may be indicated with each
+\&\fB\-F\fR option. The \fB\-F\fR option overrides the \fB\-E\fR option.
+.RE
+.SH "FILES"
+.IX Header "FILES"
+.ie n .IP """\f(CIa.out\f(CW""" 4
+.el .IP "\f(CW\f(CIa.out\f(CW\fR" 4
+.IX Item "a.out"
+the namelist and text space.
+.ie n .IP """\f(CIgmon.out\f(CW""" 4
+.el .IP "\f(CW\f(CIgmon.out\f(CW\fR" 4
+.IX Item "gmon.out"
+dynamic call graph and profile.
+.ie n .IP """\f(CIgmon.sum\f(CW""" 4
+.el .IP "\f(CW\f(CIgmon.sum\f(CW\fR" 4
+.IX Item "gmon.sum"
+summarized dynamic call graph and profile.
+.SH "BUGS"
+.IX Header "BUGS"
+The granularity of the sampling is shown, but remains
+statistical at best.
+We assume that the time for each execution of a function
+can be expressed by the total time for the function divided
+by the number of times the function is called.
+Thus the time propagated along the call graph arcs to the function's
+parents is directly proportional to the number of times that
+arc is traversed.
+.PP
+Parents that are not themselves profiled will have the time of
+their profiled children propagated to them, but they will appear
+to be spontaneously invoked in the call graph listing, and will
+not have their time propagated further.
+Similarly, signal catchers, even though profiled, will appear
+to be spontaneous (although for more obscure reasons).
+Any profiled children of signal catchers should have their times
+propagated properly, unless the signal catcher was invoked during
+the execution of the profiling routine, in which case all is lost.
+.PP
+The profiled program must call \f(CW\*(C`exit\*(C'\fR(2)
+or return normally for the profiling information to be saved
+in the \fIgmon.out\fR file.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fImonitor\fR\|(3), \fIprofil\fR\|(2), \fIcc\fR\|(1), \fIprof\fR\|(1), and the Info entry for \fIgprof\fR.
+.PP
+\&\*(L"An Execution Profiler for Modular Programs\*(R",
+by S. Graham, P. Kessler, M. McKusick;
+Software \- Practice and Experience,
+Vol. 13, pp. 671\-685, 1983.
+.PP
+\&\*(L"gprof: A Call Graph Execution Profiler\*(R",
+by S. Graham, P. Kessler, M. McKusick;
+Proceedings of the \s-1SIGPLAN\s0 '82 Symposium on Compiler Construction,
+\&\s-1SIGPLAN\s0 Notices, Vol. 17, No 6, pp. 120\-126, June 1982.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1988, 92, 97, 98, 99, 2000, 2001, 2003, 2007, 2008, 2009 Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, with no Front-Cover Texts, and with no
+Back-Cover Texts. A copy of the license is included in the
+section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
+.SH "POD ERRORS"
+.IX Header "POD ERRORS"
+Hey! \fBThe above document had some coding errors, which are explained below:\fR
+.IP "Around line 539:" 4
+.IX Item "Around line 539:"
+You can't have =items (as at line 545) unless the first thing after the =over is an =item
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-ld.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-ld.1
new file mode 100644
index 0000000..6086571
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-ld.1
@@ -0,0 +1,2355 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "LD 1"
+.TH LD 1 "2009-10-16" "binutils-2.20" "GNU Development Tools"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+ld \- The GNU linker
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+ld [\fBoptions\fR] \fIobjfile\fR ...
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+\&\fBld\fR combines a number of object and archive files, relocates
+their data and ties up symbol references. Usually the last step in
+compiling a program is to run \fBld\fR.
+.PP
+\&\fBld\fR accepts Linker Command Language files written in
+a superset of \s-1AT&T\s0's Link Editor Command Language syntax,
+to provide explicit and total control over the linking process.
+.PP
+This man page does not describe the command language; see the
+\&\fBld\fR entry in \f(CW\*(C`info\*(C'\fR for full details on the command
+language and on other aspects of the \s-1GNU\s0 linker.
+.PP
+This version of \fBld\fR uses the general purpose \s-1BFD\s0 libraries
+to operate on object files. This allows \fBld\fR to read, combine, and
+write object files in many different formats\-\-\-for example, \s-1COFF\s0 or
+\&\f(CW\*(C`a.out\*(C'\fR. Different formats may be linked together to produce any
+available kind of object file.
+.PP
+Aside from its flexibility, the \s-1GNU\s0 linker is more helpful than other
+linkers in providing diagnostic information. Many linkers abandon
+execution immediately upon encountering an error; whenever possible,
+\&\fBld\fR continues executing, allowing you to identify other errors
+(or, in some cases, to get an output file in spite of the error).
+.PP
+The \s-1GNU\s0 linker \fBld\fR is meant to cover a broad range of situations,
+and to be as compatible as possible with other linkers. As a result,
+you have many choices to control its behavior.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+The linker supports a plethora of command-line options, but in actual
+practice few of them are used in any particular context.
+For instance, a frequent use of \fBld\fR is to link standard Unix
+object files on a standard, supported Unix system. On such a system, to
+link a file \f(CW\*(C`hello.o\*(C'\fR:
+.PP
+.Vb 1
+\& ld \-o <output> /lib/crt0.o hello.o \-lc
+.Ve
+.PP
+This tells \fBld\fR to produce a file called \fIoutput\fR as the
+result of linking the file \f(CW\*(C`/lib/crt0.o\*(C'\fR with \f(CW\*(C`hello.o\*(C'\fR and
+the library \f(CW\*(C`libc.a\*(C'\fR, which will come from the standard search
+directories. (See the discussion of the \fB\-l\fR option below.)
+.PP
+Some of the command-line options to \fBld\fR may be specified at any
+point in the command line. However, options which refer to files, such
+as \fB\-l\fR or \fB\-T\fR, cause the file to be read at the point at
+which the option appears in the command line, relative to the object
+files and other file options. Repeating non-file options with a
+different argument will either have no further effect, or override prior
+occurrences (those further to the left on the command line) of that
+option. Options which may be meaningfully specified more than once are
+noted in the descriptions below.
+.PP
+Non-option arguments are object files or archives which are to be linked
+together. They may follow, precede, or be mixed in with command-line
+options, except that an object file argument may not be placed between
+an option and its argument.
+.PP
+Usually the linker is invoked with at least one object file, but you can
+specify other forms of binary input files using \fB\-l\fR, \fB\-R\fR,
+and the script command language. If \fIno\fR binary input files at all
+are specified, the linker does not produce any output, and issues the
+message \fBNo input files\fR.
+.PP
+If the linker cannot recognize the format of an object file, it will
+assume that it is a linker script. A script specified in this way
+augments the main linker script used for the link (either the default
+linker script or the one specified by using \fB\-T\fR). This feature
+permits the linker to link against a file which appears to be an object
+or an archive, but actually merely defines some symbol values, or uses
+\&\f(CW\*(C`INPUT\*(C'\fR or \f(CW\*(C`GROUP\*(C'\fR to load other objects. Specifying a
+script in this way merely augments the main linker script, with the
+extra commands placed after the main script; use the \fB\-T\fR option
+to replace the default linker script entirely, but note the effect of
+the \f(CW\*(C`INSERT\*(C'\fR command.
+.PP
+For options whose names are a single letter,
+option arguments must either follow the option letter without intervening
+whitespace, or be given as separate arguments immediately following the
+option that requires them.
+.PP
+For options whose names are multiple letters, either one dash or two can
+precede the option name; for example, \fB\-trace\-symbol\fR and
+\&\fB\-\-trace\-symbol\fR are equivalent. Note\-\-\-there is one exception to
+this rule. Multiple letter options that start with a lower case 'o' can
+only be preceded by two dashes. This is to reduce confusion with the
+\&\fB\-o\fR option. So for example \fB\-omagic\fR sets the output file
+name to \fBmagic\fR whereas \fB\-\-omagic\fR sets the \s-1NMAGIC\s0 flag on the
+output.
+.PP
+Arguments to multiple-letter options must either be separated from the
+option name by an equals sign, or be given as separate arguments
+immediately following the option that requires them. For example,
+\&\fB\-\-trace\-symbol foo\fR and \fB\-\-trace\-symbol=foo\fR are equivalent.
+Unique abbreviations of the names of multiple-letter options are
+accepted.
+.PP
+Note\-\-\-if the linker is being invoked indirectly, via a compiler driver
+(e.g. \fBgcc\fR) then all the linker command line options should be
+prefixed by \fB\-Wl,\fR (or whatever is appropriate for the particular
+compiler driver) like this:
+.PP
+.Vb 1
+\& gcc \-Wl,\-\-start\-group foo.o bar.o \-Wl,\-\-end\-group
+.Ve
+.PP
+This is important, because otherwise the compiler driver program may
+silently drop the linker options, resulting in a bad link. Confusion
+may also arise when passing options that require values through a
+driver, as the use of a space between option and argument acts as
+a separator, and causes the driver to pass only the option to the linker
+and the argument to the compiler. In this case, it is simplest to use
+the joined forms of both single\- and multiple-letter options, such as:
+.PP
+.Vb 1
+\& gcc foo.o bar.o \-Wl,\-eENTRY \-Wl,\-Map=a.map
+.Ve
+.PP
+Here is a table of the generic command line switches accepted by the \s-1GNU\s0
+linker:
+.IP "\fB@\fR\fIfile\fR" 4
+.IX Item "@file"
+Read command-line options from \fIfile\fR. The options read are
+inserted in place of the original @\fIfile\fR option. If \fIfile\fR
+does not exist, or cannot be read, then the option will be treated
+literally, and not removed.
+.Sp
+Options in \fIfile\fR are separated by whitespace. A whitespace
+character may be included in an option by surrounding the entire
+option in either single or double quotes. Any character (including a
+backslash) may be included by prefixing the character to be included
+with a backslash. The \fIfile\fR may itself contain additional
+@\fIfile\fR options; any such options will be processed recursively.
+.IP "\fB\-a\fR \fIkeyword\fR" 4
+.IX Item "-a keyword"
+This option is supported for \s-1HP/UX\s0 compatibility. The \fIkeyword\fR
+argument must be one of the strings \fBarchive\fR, \fBshared\fR, or
+\&\fBdefault\fR. \fB\-aarchive\fR is functionally equivalent to
+\&\fB\-Bstatic\fR, and the other two keywords are functionally equivalent
+to \fB\-Bdynamic\fR. This option may be used any number of times.
+.IP "\fB\-A\fR \fIarchitecture\fR" 4
+.IX Item "-A architecture"
+.PD 0
+.IP "\fB\-\-architecture=\fR\fIarchitecture\fR" 4
+.IX Item "--architecture=architecture"
+.PD
+In the current release of \fBld\fR, this option is useful only for the
+Intel 960 family of architectures. In that \fBld\fR configuration, the
+\&\fIarchitecture\fR argument identifies the particular architecture in
+the 960 family, enabling some safeguards and modifying the
+archive-library search path.
+.Sp
+Future releases of \fBld\fR may support similar functionality for
+other architecture families.
+.IP "\fB\-b\fR \fIinput-format\fR" 4
+.IX Item "-b input-format"
+.PD 0
+.IP "\fB\-\-format=\fR\fIinput-format\fR" 4
+.IX Item "--format=input-format"
+.PD
+\&\fBld\fR may be configured to support more than one kind of object
+file. If your \fBld\fR is configured this way, you can use the
+\&\fB\-b\fR option to specify the binary format for input object files
+that follow this option on the command line. Even when \fBld\fR is
+configured to support alternative object formats, you don't usually need
+to specify this, as \fBld\fR should be configured to expect as a
+default input format the most usual format on each machine.
+\&\fIinput-format\fR is a text string, the name of a particular format
+supported by the \s-1BFD\s0 libraries. (You can list the available binary
+formats with \fBobjdump \-i\fR.)
+.Sp
+You may want to use this option if you are linking files with an unusual
+binary format. You can also use \fB\-b\fR to switch formats explicitly (when
+linking object files of different formats), by including
+\&\fB\-b\fR \fIinput-format\fR before each group of object files in a
+particular format.
+.Sp
+The default format is taken from the environment variable
+\&\f(CW\*(C`GNUTARGET\*(C'\fR.
+.Sp
+You can also define the input format from a script, using the command
+\&\f(CW\*(C`TARGET\*(C'\fR;
+.IP "\fB\-c\fR \fIMRI-commandfile\fR" 4
+.IX Item "-c MRI-commandfile"
+.PD 0
+.IP "\fB\-\-mri\-script=\fR\fIMRI-commandfile\fR" 4
+.IX Item "--mri-script=MRI-commandfile"
+.PD
+For compatibility with linkers produced by \s-1MRI\s0, \fBld\fR accepts script
+files written in an alternate, restricted command language, described in
+the \s-1MRI\s0 Compatible Script Files section of \s-1GNU\s0 ld documentation.
+Introduce \s-1MRI\s0 script files with
+the option \fB\-c\fR; use the \fB\-T\fR option to run linker
+scripts written in the general-purpose \fBld\fR scripting language.
+If \fIMRI-cmdfile\fR does not exist, \fBld\fR looks for it in the directories
+specified by any \fB\-L\fR options.
+.IP "\fB\-d\fR" 4
+.IX Item "-d"
+.PD 0
+.IP "\fB\-dc\fR" 4
+.IX Item "-dc"
+.IP "\fB\-dp\fR" 4
+.IX Item "-dp"
+.PD
+These three options are equivalent; multiple forms are supported for
+compatibility with other linkers. They assign space to common symbols
+even if a relocatable output file is specified (with \fB\-r\fR). The
+script command \f(CW\*(C`FORCE_COMMON_ALLOCATION\*(C'\fR has the same effect.
+.IP "\fB\-e\fR \fIentry\fR" 4
+.IX Item "-e entry"
+.PD 0
+.IP "\fB\-\-entry=\fR\fIentry\fR" 4
+.IX Item "--entry=entry"
+.PD
+Use \fIentry\fR as the explicit symbol for beginning execution of your
+program, rather than the default entry point. If there is no symbol
+named \fIentry\fR, the linker will try to parse \fIentry\fR as a number,
+and use that as the entry address (the number will be interpreted in
+base 10; you may use a leading \fB0x\fR for base 16, or a leading
+\&\fB0\fR for base 8).
+.IP "\fB\-\-exclude\-libs\fR \fIlib\fR\fB,\fR\fIlib\fR\fB,...\fR" 4
+.IX Item "--exclude-libs lib,lib,..."
+Specifies a list of archive libraries from which symbols should not be automatically
+exported. The library names may be delimited by commas or colons. Specifying
+\&\f(CW\*(C`\-\-exclude\-libs ALL\*(C'\fR excludes symbols in all archive libraries from
+automatic export. This option is available only for the i386 \s-1PE\s0 targeted
+port of the linker and for \s-1ELF\s0 targeted ports. For i386 \s-1PE\s0, symbols
+explicitly listed in a .def file are still exported, regardless of this
+option. For \s-1ELF\s0 targeted ports, symbols affected by this option will
+be treated as hidden.
+.IP "\fB\-\-exclude\-modules\-for\-implib\fR \fImodule\fR\fB,\fR\fImodule\fR\fB,...\fR" 4
+.IX Item "--exclude-modules-for-implib module,module,..."
+Specifies a list of object files or archive members, from which symbols
+should not be automatically exported, but which should be copied wholesale
+into the import library being generated during the link. The module names
+may be delimited by commas or colons, and must match exactly the filenames
+used by \fBld\fR to open the files; for archive members, this is simply
+the member name, but for object files the name listed must include and
+match precisely any path used to specify the input file on the linker's
+command-line. This option is available only for the i386 \s-1PE\s0 targeted port
+of the linker. Symbols explicitly listed in a .def file are still exported,
+regardless of this option.
+.IP "\fB\-E\fR" 4
+.IX Item "-E"
+.PD 0
+.IP "\fB\-\-export\-dynamic\fR" 4
+.IX Item "--export-dynamic"
+.IP "\fB\-\-no\-export\-dynamic\fR" 4
+.IX Item "--no-export-dynamic"
+.PD
+When creating a dynamically linked executable, using the \fB\-E\fR
+option or the \fB\-\-export\-dynamic\fR option causes the linker to add
+all symbols to the dynamic symbol table. The dynamic symbol table is the
+set of symbols which are visible from dynamic objects at run time.
+.Sp
+If you do not use either of these options (or use the
+\&\fB\-\-no\-export\-dynamic\fR option to restore the default behavior), the
+dynamic symbol table will normally contain only those symbols which are
+referenced by some dynamic object mentioned in the link.
+.Sp
+If you use \f(CW\*(C`dlopen\*(C'\fR to load a dynamic object which needs to refer
+back to the symbols defined by the program, rather than some other
+dynamic object, then you will probably need to use this option when
+linking the program itself.
+.Sp
+You can also use the dynamic list to control what symbols should
+be added to the dynamic symbol table if the output format supports it.
+See the description of \fB\-\-dynamic\-list\fR.
+.Sp
+Note that this option is specific to \s-1ELF\s0 targeted ports. \s-1PE\s0 targets
+support a similar function to export all symbols from a \s-1DLL\s0 or \s-1EXE\s0; see
+the description of \fB\-\-export\-all\-symbols\fR below.
+.IP "\fB\-EB\fR" 4
+.IX Item "-EB"
+Link big-endian objects. This affects the default output format.
+.IP "\fB\-EL\fR" 4
+.IX Item "-EL"
+Link little-endian objects. This affects the default output format.
+.IP "\fB\-f\fR \fIname\fR" 4
+.IX Item "-f name"
+.PD 0
+.IP "\fB\-\-auxiliary=\fR\fIname\fR" 4
+.IX Item "--auxiliary=name"
+.PD
+When creating an \s-1ELF\s0 shared object, set the internal \s-1DT_AUXILIARY\s0 field
+to the specified name. This tells the dynamic linker that the symbol
+table of the shared object should be used as an auxiliary filter on the
+symbol table of the shared object \fIname\fR.
+.Sp
+If you later link a program against this filter object, then, when you
+run the program, the dynamic linker will see the \s-1DT_AUXILIARY\s0 field. If
+the dynamic linker resolves any symbols from the filter object, it will
+first check whether there is a definition in the shared object
+\&\fIname\fR. If there is one, it will be used instead of the definition
+in the filter object. The shared object \fIname\fR need not exist.
+Thus the shared object \fIname\fR may be used to provide an alternative
+implementation of certain functions, perhaps for debugging or for
+machine specific performance.
+.Sp
+This option may be specified more than once. The \s-1DT_AUXILIARY\s0 entries
+will be created in the order in which they appear on the command line.
+.IP "\fB\-F\fR \fIname\fR" 4
+.IX Item "-F name"
+.PD 0
+.IP "\fB\-\-filter=\fR\fIname\fR" 4
+.IX Item "--filter=name"
+.PD
+When creating an \s-1ELF\s0 shared object, set the internal \s-1DT_FILTER\s0 field to
+the specified name. This tells the dynamic linker that the symbol table
+of the shared object which is being created should be used as a filter
+on the symbol table of the shared object \fIname\fR.
+.Sp
+If you later link a program against this filter object, then, when you
+run the program, the dynamic linker will see the \s-1DT_FILTER\s0 field. The
+dynamic linker will resolve symbols according to the symbol table of the
+filter object as usual, but it will actually link to the definitions
+found in the shared object \fIname\fR. Thus the filter object can be
+used to select a subset of the symbols provided by the object
+\&\fIname\fR.
+.Sp
+Some older linkers used the \fB\-F\fR option throughout a compilation
+toolchain for specifying object-file format for both input and output
+object files.
+The \s-1GNU\s0 linker uses other mechanisms for this purpose: the
+\&\fB\-b\fR, \fB\-\-format\fR, \fB\-\-oformat\fR options, the
+\&\f(CW\*(C`TARGET\*(C'\fR command in linker scripts, and the \f(CW\*(C`GNUTARGET\*(C'\fR
+environment variable.
+The \s-1GNU\s0 linker will ignore the \fB\-F\fR option when not
+creating an \s-1ELF\s0 shared object.
+.IP "\fB\-fini=\fR\fIname\fR" 4
+.IX Item "-fini=name"
+When creating an \s-1ELF\s0 executable or shared object, call \s-1NAME\s0 when the
+executable or shared object is unloaded, by setting \s-1DT_FINI\s0 to the
+address of the function. By default, the linker uses \f(CW\*(C`_fini\*(C'\fR as
+the function to call.
+.IP "\fB\-g\fR" 4
+.IX Item "-g"
+Ignored. Provided for compatibility with other tools.
+.IP "\fB\-G\fR \fIvalue\fR" 4
+.IX Item "-G value"
+.PD 0
+.IP "\fB\-\-gpsize=\fR\fIvalue\fR" 4
+.IX Item "--gpsize=value"
+.PD
+Set the maximum size of objects to be optimized using the \s-1GP\s0 register to
+\&\fIsize\fR. This is only meaningful for object file formats such as
+\&\s-1MIPS\s0 \s-1ECOFF\s0 which supports putting large and small objects into different
+sections. This is ignored for other object file formats.
+.IP "\fB\-h\fR \fIname\fR" 4
+.IX Item "-h name"
+.PD 0
+.IP "\fB\-soname=\fR\fIname\fR" 4
+.IX Item "-soname=name"
+.PD
+When creating an \s-1ELF\s0 shared object, set the internal \s-1DT_SONAME\s0 field to
+the specified name. When an executable is linked with a shared object
+which has a \s-1DT_SONAME\s0 field, then when the executable is run the dynamic
+linker will attempt to load the shared object specified by the \s-1DT_SONAME\s0
+field rather than the using the file name given to the linker.
+.IP "\fB\-i\fR" 4
+.IX Item "-i"
+Perform an incremental link (same as option \fB\-r\fR).
+.IP "\fB\-init=\fR\fIname\fR" 4
+.IX Item "-init=name"
+When creating an \s-1ELF\s0 executable or shared object, call \s-1NAME\s0 when the
+executable or shared object is loaded, by setting \s-1DT_INIT\s0 to the address
+of the function. By default, the linker uses \f(CW\*(C`_init\*(C'\fR as the
+function to call.
+.IP "\fB\-l\fR \fInamespec\fR" 4
+.IX Item "-l namespec"
+.PD 0
+.IP "\fB\-\-library=\fR\fInamespec\fR" 4
+.IX Item "--library=namespec"
+.PD
+Add the archive or object file specified by \fInamespec\fR to the
+list of files to link. This option may be used any number of times.
+If \fInamespec\fR is of the form \fI:\fIfilename\fI\fR, \fBld\fR
+will search the library path for a file called \fIfilename\fR, otherwise it
+will search the library path for a file called \fIlib\fInamespec\fI.a\fR.
+.Sp
+On systems which support shared libraries, \fBld\fR may also search for
+files other than \fIlib\fInamespec\fI.a\fR. Specifically, on \s-1ELF\s0
+and SunOS systems, \fBld\fR will search a directory for a library
+called \fIlib\fInamespec\fI.so\fR before searching for one called
+\&\fIlib\fInamespec\fI.a\fR. (By convention, a \f(CW\*(C`.so\*(C'\fR extension
+indicates a shared library.) Note that this behavior does not apply
+to \fI:\fIfilename\fI\fR, which always specifies a file called
+\&\fIfilename\fR.
+.Sp
+The linker will search an archive only once, at the location where it is
+specified on the command line. If the archive defines a symbol which
+was undefined in some object which appeared before the archive on the
+command line, the linker will include the appropriate file(s) from the
+archive. However, an undefined symbol in an object appearing later on
+the command line will not cause the linker to search the archive again.
+.Sp
+See the \fB\-(\fR option for a way to force the linker to search
+archives multiple times.
+.Sp
+You may list the same archive multiple times on the command line.
+.Sp
+This type of archive searching is standard for Unix linkers. However,
+if you are using \fBld\fR on \s-1AIX\s0, note that it is different from the
+behaviour of the \s-1AIX\s0 linker.
+.IP "\fB\-L\fR \fIsearchdir\fR" 4
+.IX Item "-L searchdir"
+.PD 0
+.IP "\fB\-\-library\-path=\fR\fIsearchdir\fR" 4
+.IX Item "--library-path=searchdir"
+.PD
+Add path \fIsearchdir\fR to the list of paths that \fBld\fR will search
+for archive libraries and \fBld\fR control scripts. You may use this
+option any number of times. The directories are searched in the order
+in which they are specified on the command line. Directories specified
+on the command line are searched before the default directories. All
+\&\fB\-L\fR options apply to all \fB\-l\fR options, regardless of the
+order in which the options appear. \fB\-L\fR options do not affect
+how \fBld\fR searches for a linker script unless \fB\-T\fR
+option is specified.
+.Sp
+If \fIsearchdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced
+by the \fIsysroot prefix\fR, a path specified when the linker is configured.
+.Sp
+The default set of paths searched (without being specified with
+\&\fB\-L\fR) depends on which emulation mode \fBld\fR is using, and in
+some cases also on how it was configured.
+.Sp
+The paths can also be specified in a link script with the
+\&\f(CW\*(C`SEARCH_DIR\*(C'\fR command. Directories specified this way are searched
+at the point in which the linker script appears in the command line.
+.IP "\fB\-m\fR \fIemulation\fR" 4
+.IX Item "-m emulation"
+Emulate the \fIemulation\fR linker. You can list the available
+emulations with the \fB\-\-verbose\fR or \fB\-V\fR options.
+.Sp
+If the \fB\-m\fR option is not used, the emulation is taken from the
+\&\f(CW\*(C`LDEMULATION\*(C'\fR environment variable, if that is defined.
+.Sp
+Otherwise, the default emulation depends upon how the linker was
+configured.
+.IP "\fB\-M\fR" 4
+.IX Item "-M"
+.PD 0
+.IP "\fB\-\-print\-map\fR" 4
+.IX Item "--print-map"
+.PD
+Print a link map to the standard output. A link map provides
+information about the link, including the following:
+.RS 4
+.IP "\(bu" 4
+Where object files are mapped into memory.
+.IP "\(bu" 4
+How common symbols are allocated.
+.IP "\(bu" 4
+All archive members included in the link, with a mention of the symbol
+which caused the archive member to be brought in.
+.IP "\(bu" 4
+The values assigned to symbols.
+.Sp
+Note \- symbols whose values are computed by an expression which
+involves a reference to a previous value of the same symbol may not
+have correct result displayed in the link map. This is because the
+linker discards intermediate results and only retains the final value
+of an expression. Under such circumstances the linker will display
+the final value enclosed by square brackets. Thus for example a
+linker script containing:
+.Sp
+.Vb 3
+\& foo = 1
+\& foo = foo * 4
+\& foo = foo + 8
+.Ve
+.Sp
+will produce the following output in the link map if the \fB\-M\fR
+option is used:
+.Sp
+.Vb 3
+\& 0x00000001 foo = 0x1
+\& [0x0000000c] foo = (foo * 0x4)
+\& [0x0000000c] foo = (foo + 0x8)
+.Ve
+.Sp
+See \fBExpressions\fR for more information about expressions in linker
+scripts.
+.RE
+.RS 4
+.RE
+.IP "\fB\-n\fR" 4
+.IX Item "-n"
+.PD 0
+.IP "\fB\-\-nmagic\fR" 4
+.IX Item "--nmagic"
+.PD
+Turn off page alignment of sections, and mark the output as
+\&\f(CW\*(C`NMAGIC\*(C'\fR if possible.
+.IP "\fB\-N\fR" 4
+.IX Item "-N"
+.PD 0
+.IP "\fB\-\-omagic\fR" 4
+.IX Item "--omagic"
+.PD
+Set the text and data sections to be readable and writable. Also, do
+not page-align the data segment, and disable linking against shared
+libraries. If the output format supports Unix style magic numbers,
+mark the output as \f(CW\*(C`OMAGIC\*(C'\fR. Note: Although a writable text section
+is allowed for PE-COFF targets, it does not conform to the format
+specification published by Microsoft.
+.IP "\fB\-\-no\-omagic\fR" 4
+.IX Item "--no-omagic"
+This option negates most of the effects of the \fB\-N\fR option. It
+sets the text section to be read-only, and forces the data segment to
+be page-aligned. Note \- this option does not enable linking against
+shared libraries. Use \fB\-Bdynamic\fR for this.
+.IP "\fB\-o\fR \fIoutput\fR" 4
+.IX Item "-o output"
+.PD 0
+.IP "\fB\-\-output=\fR\fIoutput\fR" 4
+.IX Item "--output=output"
+.PD
+Use \fIoutput\fR as the name for the program produced by \fBld\fR; if this
+option is not specified, the name \fIa.out\fR is used by default. The
+script command \f(CW\*(C`OUTPUT\*(C'\fR can also specify the output file name.
+.IP "\fB\-O\fR \fIlevel\fR" 4
+.IX Item "-O level"
+If \fIlevel\fR is a numeric values greater than zero \fBld\fR optimizes
+the output. This might take significantly longer and therefore probably
+should only be enabled for the final binary. At the moment this
+option only affects \s-1ELF\s0 shared library generation. Future releases of
+the linker may make more use of this option. Also currently there is
+no difference in the linker's behaviour for different non-zero values
+of this option. Again this may change with future releases.
+.IP "\fB\-q\fR" 4
+.IX Item "-q"
+.PD 0
+.IP "\fB\-\-emit\-relocs\fR" 4
+.IX Item "--emit-relocs"
+.PD
+Leave relocation sections and contents in fully linked executables.
+Post link analysis and optimization tools may need this information in
+order to perform correct modifications of executables. This results
+in larger executables.
+.Sp
+This option is currently only supported on \s-1ELF\s0 platforms.
+.IP "\fB\-\-force\-dynamic\fR" 4
+.IX Item "--force-dynamic"
+Force the output file to have dynamic sections. This option is specific
+to VxWorks targets.
+.IP "\fB\-r\fR" 4
+.IX Item "-r"
+.PD 0
+.IP "\fB\-\-relocatable\fR" 4
+.IX Item "--relocatable"
+.PD
+Generate relocatable output\-\-\-i.e., generate an output file that can in
+turn serve as input to \fBld\fR. This is often called \fIpartial
+linking\fR. As a side effect, in environments that support standard Unix
+magic numbers, this option also sets the output file's magic number to
+\&\f(CW\*(C`OMAGIC\*(C'\fR.
+If this option is not specified, an absolute file is produced. When
+linking \*(C+ programs, this option \fIwill not\fR resolve references to
+constructors; to do that, use \fB\-Ur\fR.
+.Sp
+When an input file does not have the same format as the output file,
+partial linking is only supported if that input file does not contain any
+relocations. Different output formats can have further restrictions; for
+example some \f(CW\*(C`a.out\*(C'\fR\-based formats do not support partial linking
+with input files in other formats at all.
+.Sp
+This option does the same thing as \fB\-i\fR.
+.IP "\fB\-R\fR \fIfilename\fR" 4
+.IX Item "-R filename"
+.PD 0
+.IP "\fB\-\-just\-symbols=\fR\fIfilename\fR" 4
+.IX Item "--just-symbols=filename"
+.PD
+Read symbol names and their addresses from \fIfilename\fR, but do not
+relocate it or include it in the output. This allows your output file
+to refer symbolically to absolute locations of memory defined in other
+programs. You may use this option more than once.
+.Sp
+For compatibility with other \s-1ELF\s0 linkers, if the \fB\-R\fR option is
+followed by a directory name, rather than a file name, it is treated as
+the \fB\-rpath\fR option.
+.IP "\fB\-s\fR" 4
+.IX Item "-s"
+.PD 0
+.IP "\fB\-\-strip\-all\fR" 4
+.IX Item "--strip-all"
+.PD
+Omit all symbol information from the output file.
+.IP "\fB\-S\fR" 4
+.IX Item "-S"
+.PD 0
+.IP "\fB\-\-strip\-debug\fR" 4
+.IX Item "--strip-debug"
+.PD
+Omit debugger symbol information (but not all symbols) from the output file.
+.IP "\fB\-t\fR" 4
+.IX Item "-t"
+.PD 0
+.IP "\fB\-\-trace\fR" 4
+.IX Item "--trace"
+.PD
+Print the names of the input files as \fBld\fR processes them.
+.IP "\fB\-T\fR \fIscriptfile\fR" 4
+.IX Item "-T scriptfile"
+.PD 0
+.IP "\fB\-\-script=\fR\fIscriptfile\fR" 4
+.IX Item "--script=scriptfile"
+.PD
+Use \fIscriptfile\fR as the linker script. This script replaces
+\&\fBld\fR's default linker script (rather than adding to it), so
+\&\fIcommandfile\fR must specify everything necessary to describe the
+output file. If \fIscriptfile\fR does not exist in
+the current directory, \f(CW\*(C`ld\*(C'\fR looks for it in the directories
+specified by any preceding \fB\-L\fR options. Multiple \fB\-T\fR
+options accumulate.
+.IP "\fB\-dT\fR \fIscriptfile\fR" 4
+.IX Item "-dT scriptfile"
+.PD 0
+.IP "\fB\-\-default\-script=\fR\fIscriptfile\fR" 4
+.IX Item "--default-script=scriptfile"
+.PD
+Use \fIscriptfile\fR as the default linker script.
+.Sp
+This option is similar to the \fB\-\-script\fR option except that
+processing of the script is delayed until after the rest of the
+command line has been processed. This allows options placed after the
+\&\fB\-\-default\-script\fR option on the command line to affect the
+behaviour of the linker script, which can be important when the linker
+command line cannot be directly controlled by the user. (eg because
+the command line is being constructed by another tool, such as
+\&\fBgcc\fR).
+.IP "\fB\-u\fR \fIsymbol\fR" 4
+.IX Item "-u symbol"
+.PD 0
+.IP "\fB\-\-undefined=\fR\fIsymbol\fR" 4
+.IX Item "--undefined=symbol"
+.PD
+Force \fIsymbol\fR to be entered in the output file as an undefined
+symbol. Doing this may, for example, trigger linking of additional
+modules from standard libraries. \fB\-u\fR may be repeated with
+different option arguments to enter additional undefined symbols. This
+option is equivalent to the \f(CW\*(C`EXTERN\*(C'\fR linker script command.
+.IP "\fB\-Ur\fR" 4
+.IX Item "-Ur"
+For anything other than \*(C+ programs, this option is equivalent to
+\&\fB\-r\fR: it generates relocatable output\-\-\-i.e., an output file that can in
+turn serve as input to \fBld\fR. When linking \*(C+ programs, \fB\-Ur\fR
+\&\fIdoes\fR resolve references to constructors, unlike \fB\-r\fR.
+It does not work to use \fB\-Ur\fR on files that were themselves linked
+with \fB\-Ur\fR; once the constructor table has been built, it cannot
+be added to. Use \fB\-Ur\fR only for the last partial link, and
+\&\fB\-r\fR for the others.
+.IP "\fB\-\-unique[=\fR\fI\s-1SECTION\s0\fR\fB]\fR" 4
+.IX Item "--unique[=SECTION]"
+Creates a separate output section for every input section matching
+\&\fI\s-1SECTION\s0\fR, or if the optional wildcard \fI\s-1SECTION\s0\fR argument is
+missing, for every orphan input section. An orphan section is one not
+specifically mentioned in a linker script. You may use this option
+multiple times on the command line; It prevents the normal merging of
+input sections with the same name, overriding output section assignments
+in a linker script.
+.IP "\fB\-v\fR" 4
+.IX Item "-v"
+.PD 0
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+.IP "\fB\-V\fR" 4
+.IX Item "-V"
+.PD
+Display the version number for \fBld\fR. The \fB\-V\fR option also
+lists the supported emulations.
+.IP "\fB\-x\fR" 4
+.IX Item "-x"
+.PD 0
+.IP "\fB\-\-discard\-all\fR" 4
+.IX Item "--discard-all"
+.PD
+Delete all local symbols.
+.IP "\fB\-X\fR" 4
+.IX Item "-X"
+.PD 0
+.IP "\fB\-\-discard\-locals\fR" 4
+.IX Item "--discard-locals"
+.PD
+Delete all temporary local symbols. (These symbols start with
+system-specific local label prefixes, typically \fB.L\fR for \s-1ELF\s0 systems
+or \fBL\fR for traditional a.out systems.)
+.IP "\fB\-y\fR \fIsymbol\fR" 4
+.IX Item "-y symbol"
+.PD 0
+.IP "\fB\-\-trace\-symbol=\fR\fIsymbol\fR" 4
+.IX Item "--trace-symbol=symbol"
+.PD
+Print the name of each linked file in which \fIsymbol\fR appears. This
+option may be given any number of times. On many systems it is necessary
+to prepend an underscore.
+.Sp
+This option is useful when you have an undefined symbol in your link but
+don't know where the reference is coming from.
+.IP "\fB\-Y\fR \fIpath\fR" 4
+.IX Item "-Y path"
+Add \fIpath\fR to the default library search path. This option exists
+for Solaris compatibility.
+.IP "\fB\-z\fR \fIkeyword\fR" 4
+.IX Item "-z keyword"
+The recognized keywords are:
+.RS 4
+.IP "\fBcombreloc\fR" 4
+.IX Item "combreloc"
+Combines multiple reloc sections and sorts them to make dynamic symbol
+lookup caching possible.
+.IP "\fBdefs\fR" 4
+.IX Item "defs"
+Disallows undefined symbols in object files. Undefined symbols in
+shared libraries are still allowed.
+.IP "\fBexecstack\fR" 4
+.IX Item "execstack"
+Marks the object as requiring executable stack.
+.IP "\fBinitfirst\fR" 4
+.IX Item "initfirst"
+This option is only meaningful when building a shared object.
+It marks the object so that its runtime initialization will occur
+before the runtime initialization of any other objects brought into
+the process at the same time. Similarly the runtime finalization of
+the object will occur after the runtime finalization of any other
+objects.
+.IP "\fBinterpose\fR" 4
+.IX Item "interpose"
+Marks the object that its symbol table interposes before all symbols
+but the primary executable.
+.IP "\fBlazy\fR" 4
+.IX Item "lazy"
+When generating an executable or shared library, mark it to tell the
+dynamic linker to defer function call resolution to the point when
+the function is called (lazy binding), rather than at load time.
+Lazy binding is the default.
+.IP "\fBloadfltr\fR" 4
+.IX Item "loadfltr"
+Marks the object that its filters be processed immediately at
+runtime.
+.IP "\fBmuldefs\fR" 4
+.IX Item "muldefs"
+Allows multiple definitions.
+.IP "\fBnocombreloc\fR" 4
+.IX Item "nocombreloc"
+Disables multiple reloc sections combining.
+.IP "\fBnocopyreloc\fR" 4
+.IX Item "nocopyreloc"
+Disables production of copy relocs.
+.IP "\fBnodefaultlib\fR" 4
+.IX Item "nodefaultlib"
+Marks the object that the search for dependencies of this object will
+ignore any default library search paths.
+.IP "\fBnodelete\fR" 4
+.IX Item "nodelete"
+Marks the object shouldn't be unloaded at runtime.
+.IP "\fBnodlopen\fR" 4
+.IX Item "nodlopen"
+Marks the object not available to \f(CW\*(C`dlopen\*(C'\fR.
+.IP "\fBnodump\fR" 4
+.IX Item "nodump"
+Marks the object can not be dumped by \f(CW\*(C`dldump\*(C'\fR.
+.IP "\fBnoexecstack\fR" 4
+.IX Item "noexecstack"
+Marks the object as not requiring executable stack.
+.IP "\fBnorelro\fR" 4
+.IX Item "norelro"
+Don't create an \s-1ELF\s0 \f(CW\*(C`PT_GNU_RELRO\*(C'\fR segment header in the object.
+.IP "\fBnow\fR" 4
+.IX Item "now"
+When generating an executable or shared library, mark it to tell the
+dynamic linker to resolve all symbols when the program is started, or
+when the shared library is linked to using dlopen, instead of
+deferring function call resolution to the point when the function is
+first called.
+.IP "\fBorigin\fR" 4
+.IX Item "origin"
+Marks the object may contain \f(CW$ORIGIN\fR.
+.IP "\fBrelro\fR" 4
+.IX Item "relro"
+Create an \s-1ELF\s0 \f(CW\*(C`PT_GNU_RELRO\*(C'\fR segment header in the object.
+.IP "\fBmax\-page\-size=\fR\fIvalue\fR" 4
+.IX Item "max-page-size=value"
+Set the emulation maximum page size to \fIvalue\fR.
+.IP "\fBcommon\-page\-size=\fR\fIvalue\fR" 4
+.IX Item "common-page-size=value"
+Set the emulation common page size to \fIvalue\fR.
+.RE
+.RS 4
+.Sp
+Other keywords are ignored for Solaris compatibility.
+.RE
+.IP "\fB\-(\fR \fIarchives\fR \fB\-)\fR" 4
+.IX Item "-( archives -)"
+.PD 0
+.IP "\fB\-\-start\-group\fR \fIarchives\fR \fB\-\-end\-group\fR" 4
+.IX Item "--start-group archives --end-group"
+.PD
+The \fIarchives\fR should be a list of archive files. They may be
+either explicit file names, or \fB\-l\fR options.
+.Sp
+The specified archives are searched repeatedly until no new undefined
+references are created. Normally, an archive is searched only once in
+the order that it is specified on the command line. If a symbol in that
+archive is needed to resolve an undefined symbol referred to by an
+object in an archive that appears later on the command line, the linker
+would not be able to resolve that reference. By grouping the archives,
+they all be searched repeatedly until all possible references are
+resolved.
+.Sp
+Using this option has a significant performance cost. It is best to use
+it only when there are unavoidable circular references between two or
+more archives.
+.IP "\fB\-\-accept\-unknown\-input\-arch\fR" 4
+.IX Item "--accept-unknown-input-arch"
+.PD 0
+.IP "\fB\-\-no\-accept\-unknown\-input\-arch\fR" 4
+.IX Item "--no-accept-unknown-input-arch"
+.PD
+Tells the linker to accept input files whose architecture cannot be
+recognised. The assumption is that the user knows what they are doing
+and deliberately wants to link in these unknown input files. This was
+the default behaviour of the linker, before release 2.14. The default
+behaviour from release 2.14 onwards is to reject such input files, and
+so the \fB\-\-accept\-unknown\-input\-arch\fR option has been added to
+restore the old behaviour.
+.IP "\fB\-\-as\-needed\fR" 4
+.IX Item "--as-needed"
+.PD 0
+.IP "\fB\-\-no\-as\-needed\fR" 4
+.IX Item "--no-as-needed"
+.PD
+This option affects \s-1ELF\s0 \s-1DT_NEEDED\s0 tags for dynamic libraries mentioned
+on the command line after the \fB\-\-as\-needed\fR option. Normally,
+the linker will add a \s-1DT_NEEDED\s0 tag for each dynamic library mentioned
+on the command line, regardless of whether the library is actually
+needed. \fB\-\-as\-needed\fR causes a \s-1DT_NEEDED\s0 tag to only be emitted
+for a library that satisfies a symbol reference from regular objects
+which is undefined at the point that the library was linked, or, if
+the library is not found in the \s-1DT_NEEDED\s0 lists of other libraries
+linked up to that point, a reference from another dynamic library.
+\&\fB\-\-no\-as\-needed\fR restores the default behaviour.
+.IP "\fB\-\-add\-needed\fR" 4
+.IX Item "--add-needed"
+.PD 0
+.IP "\fB\-\-no\-add\-needed\fR" 4
+.IX Item "--no-add-needed"
+.PD
+This option affects the treatment of dynamic libraries from \s-1ELF\s0
+\&\s-1DT_NEEDED\s0 tags in dynamic libraries mentioned on the command line after
+the \fB\-\-no\-add\-needed\fR option. Normally, the linker will add
+a \s-1DT_NEEDED\s0 tag for each dynamic library from \s-1DT_NEEDED\s0 tags.
+\&\fB\-\-no\-add\-needed\fR causes \s-1DT_NEEDED\s0 tags will never be emitted
+for those libraries from \s-1DT_NEEDED\s0 tags. \fB\-\-add\-needed\fR restores
+the default behaviour.
+.IP "\fB\-assert\fR \fIkeyword\fR" 4
+.IX Item "-assert keyword"
+This option is ignored for SunOS compatibility.
+.IP "\fB\-Bdynamic\fR" 4
+.IX Item "-Bdynamic"
+.PD 0
+.IP "\fB\-dy\fR" 4
+.IX Item "-dy"
+.IP "\fB\-call_shared\fR" 4
+.IX Item "-call_shared"
+.PD
+Link against dynamic libraries. This is only meaningful on platforms
+for which shared libraries are supported. This option is normally the
+default on such platforms. The different variants of this option are
+for compatibility with various systems. You may use this option
+multiple times on the command line: it affects library searching for
+\&\fB\-l\fR options which follow it.
+.IP "\fB\-Bgroup\fR" 4
+.IX Item "-Bgroup"
+Set the \f(CW\*(C`DF_1_GROUP\*(C'\fR flag in the \f(CW\*(C`DT_FLAGS_1\*(C'\fR entry in the dynamic
+section. This causes the runtime linker to handle lookups in this
+object and its dependencies to be performed only inside the group.
+\&\fB\-\-unresolved\-symbols=report\-all\fR is implied. This option is
+only meaningful on \s-1ELF\s0 platforms which support shared libraries.
+.IP "\fB\-Bstatic\fR" 4
+.IX Item "-Bstatic"
+.PD 0
+.IP "\fB\-dn\fR" 4
+.IX Item "-dn"
+.IP "\fB\-non_shared\fR" 4
+.IX Item "-non_shared"
+.IP "\fB\-static\fR" 4
+.IX Item "-static"
+.PD
+Do not link against shared libraries. This is only meaningful on
+platforms for which shared libraries are supported. The different
+variants of this option are for compatibility with various systems. You
+may use this option multiple times on the command line: it affects
+library searching for \fB\-l\fR options which follow it. This
+option also implies \fB\-\-unresolved\-symbols=report\-all\fR. This
+option can be used with \fB\-shared\fR. Doing so means that a
+shared library is being created but that all of the library's external
+references must be resolved by pulling in entries from static
+libraries.
+.IP "\fB\-Bsymbolic\fR" 4
+.IX Item "-Bsymbolic"
+When creating a shared library, bind references to global symbols to the
+definition within the shared library, if any. Normally, it is possible
+for a program linked against a shared library to override the definition
+within the shared library. This option is only meaningful on \s-1ELF\s0
+platforms which support shared libraries.
+.IP "\fB\-Bsymbolic\-functions\fR" 4
+.IX Item "-Bsymbolic-functions"
+When creating a shared library, bind references to global function
+symbols to the definition within the shared library, if any.
+This option is only meaningful on \s-1ELF\s0 platforms which support shared
+libraries.
+.IP "\fB\-\-dynamic\-list=\fR\fIdynamic-list-file\fR" 4
+.IX Item "--dynamic-list=dynamic-list-file"
+Specify the name of a dynamic list file to the linker. This is
+typically used when creating shared libraries to specify a list of
+global symbols whose references shouldn't be bound to the definition
+within the shared library, or creating dynamically linked executables
+to specify a list of symbols which should be added to the symbol table
+in the executable. This option is only meaningful on \s-1ELF\s0 platforms
+which support shared libraries.
+.Sp
+The format of the dynamic list is the same as the version node without
+scope and node name. See \fB\s-1VERSION\s0\fR for more information.
+.IP "\fB\-\-dynamic\-list\-data\fR" 4
+.IX Item "--dynamic-list-data"
+Include all global data symbols to the dynamic list.
+.IP "\fB\-\-dynamic\-list\-cpp\-new\fR" 4
+.IX Item "--dynamic-list-cpp-new"
+Provide the builtin dynamic list for \*(C+ operator new and delete. It
+is mainly useful for building shared libstdc++.
+.IP "\fB\-\-dynamic\-list\-cpp\-typeinfo\fR" 4
+.IX Item "--dynamic-list-cpp-typeinfo"
+Provide the builtin dynamic list for \*(C+ runtime type identification.
+.IP "\fB\-\-check\-sections\fR" 4
+.IX Item "--check-sections"
+.PD 0
+.IP "\fB\-\-no\-check\-sections\fR" 4
+.IX Item "--no-check-sections"
+.PD
+Asks the linker \fInot\fR to check section addresses after they have
+been assigned to see if there are any overlaps. Normally the linker will
+perform this check, and if it finds any overlaps it will produce
+suitable error messages. The linker does know about, and does make
+allowances for sections in overlays. The default behaviour can be
+restored by using the command line switch \fB\-\-check\-sections\fR.
+Section overlap is not usually checked for relocatable links. You can
+force checking in that case by using the \fB\-\-check\-sections\fR
+option.
+.IP "\fB\-\-cref\fR" 4
+.IX Item "--cref"
+Output a cross reference table. If a linker map file is being
+generated, the cross reference table is printed to the map file.
+Otherwise, it is printed on the standard output.
+.Sp
+The format of the table is intentionally simple, so that it may be
+easily processed by a script if necessary. The symbols are printed out,
+sorted by name. For each symbol, a list of file names is given. If the
+symbol is defined, the first file listed is the location of the
+definition. The remaining files contain references to the symbol.
+.IP "\fB\-\-no\-define\-common\fR" 4
+.IX Item "--no-define-common"
+This option inhibits the assignment of addresses to common symbols.
+The script command \f(CW\*(C`INHIBIT_COMMON_ALLOCATION\*(C'\fR has the same effect.
+.Sp
+The \fB\-\-no\-define\-common\fR option allows decoupling
+the decision to assign addresses to Common symbols from the choice
+of the output file type; otherwise a non-Relocatable output type
+forces assigning addresses to Common symbols.
+Using \fB\-\-no\-define\-common\fR allows Common symbols that are referenced
+from a shared library to be assigned addresses only in the main program.
+This eliminates the unused duplicate space in the shared library,
+and also prevents any possible confusion over resolving to the wrong
+duplicate when there are many dynamic modules with specialized search
+paths for runtime symbol resolution.
+.IP "\fB\-\-defsym=\fR\fIsymbol\fR\fB=\fR\fIexpression\fR" 4
+.IX Item "--defsym=symbol=expression"
+Create a global symbol in the output file, containing the absolute
+address given by \fIexpression\fR. You may use this option as many
+times as necessary to define multiple symbols in the command line. A
+limited form of arithmetic is supported for the \fIexpression\fR in this
+context: you may give a hexadecimal constant or the name of an existing
+symbol, or use \f(CW\*(C`+\*(C'\fR and \f(CW\*(C`\-\*(C'\fR to add or subtract hexadecimal
+constants or symbols. If you need more elaborate expressions, consider
+using the linker command language from a script. \fINote:\fR there should be no white
+space between \fIsymbol\fR, the equals sign ("\fB=\fR"), and
+\&\fIexpression\fR.
+.IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4
+.IX Item "--demangle[=style]"
+.PD 0
+.IP "\fB\-\-no\-demangle\fR" 4
+.IX Item "--no-demangle"
+.PD
+These options control whether to demangle symbol names in error messages
+and other output. When the linker is told to demangle, it tries to
+present symbol names in a readable fashion: it strips leading
+underscores if they are used by the object file format, and converts \*(C+
+mangled symbol names into user readable names. Different compilers have
+different mangling styles. The optional demangling style argument can be used
+to choose an appropriate demangling style for your compiler. The linker will
+demangle by default unless the environment variable \fB\s-1COLLECT_NO_DEMANGLE\s0\fR
+is set. These options may be used to override the default.
+.IP "\fB\-I\fR\fIfile\fR" 4
+.IX Item "-Ifile"
+.PD 0
+.IP "\fB\-\-dynamic\-linker=\fR\fIfile\fR" 4
+.IX Item "--dynamic-linker=file"
+.PD
+Set the name of the dynamic linker. This is only meaningful when
+generating dynamically linked \s-1ELF\s0 executables. The default dynamic
+linker is normally correct; don't use this unless you know what you are
+doing.
+.IP "\fB\-\-fatal\-warnings\fR" 4
+.IX Item "--fatal-warnings"
+.PD 0
+.IP "\fB\-\-no\-fatal\-warnings\fR" 4
+.IX Item "--no-fatal-warnings"
+.PD
+Treat all warnings as errors. The default behaviour can be restored
+with the option \fB\-\-no\-fatal\-warnings\fR.
+.IP "\fB\-\-force\-exe\-suffix\fR" 4
+.IX Item "--force-exe-suffix"
+Make sure that an output file has a .exe suffix.
+.Sp
+If a successfully built fully linked output file does not have a
+\&\f(CW\*(C`.exe\*(C'\fR or \f(CW\*(C`.dll\*(C'\fR suffix, this option forces the linker to copy
+the output file to one of the same name with a \f(CW\*(C`.exe\*(C'\fR suffix. This
+option is useful when using unmodified Unix makefiles on a Microsoft
+Windows host, since some versions of Windows won't run an image unless
+it ends in a \f(CW\*(C`.exe\*(C'\fR suffix.
+.IP "\fB\-\-gc\-sections\fR" 4
+.IX Item "--gc-sections"
+.PD 0
+.IP "\fB\-\-no\-gc\-sections\fR" 4
+.IX Item "--no-gc-sections"
+.PD
+Enable garbage collection of unused input sections. It is ignored on
+targets that do not support this option. The default behaviour (of not
+performing this garbage collection) can be restored by specifying
+\&\fB\-\-no\-gc\-sections\fR on the command line.
+.Sp
+\&\fB\-\-gc\-sections\fR decides which input sections are used by
+examining symbols and relocations. The section containing the entry
+symbol and all sections containing symbols undefined on the
+command-line will be kept, as will sections containing symbols
+referenced by dynamic objects. Note that when building shared
+libraries, the linker must assume that any visible symbol is
+referenced. Once this initial set of sections has been determined,
+the linker recursively marks as used any section referenced by their
+relocations. See \fB\-\-entry\fR and \fB\-\-undefined\fR.
+.Sp
+This option can be set when doing a partial link (enabled with option
+\&\fB\-r\fR). In this case the root of symbols kept must be explicitely
+specified either by an \fB\-\-entry\fR or \fB\-\-undefined\fR option or by
+a \f(CW\*(C`ENTRY\*(C'\fR command in the linker script.
+.IP "\fB\-\-print\-gc\-sections\fR" 4
+.IX Item "--print-gc-sections"
+.PD 0
+.IP "\fB\-\-no\-print\-gc\-sections\fR" 4
+.IX Item "--no-print-gc-sections"
+.PD
+List all sections removed by garbage collection. The listing is
+printed on stderr. This option is only effective if garbage
+collection has been enabled via the \fB\-\-gc\-sections\fR) option. The
+default behaviour (of not listing the sections that are removed) can
+be restored by specifying \fB\-\-no\-print\-gc\-sections\fR on the command
+line.
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
+Print a summary of the command-line options on the standard output and exit.
+.IP "\fB\-\-target\-help\fR" 4
+.IX Item "--target-help"
+Print a summary of all target specific options on the standard output and exit.
+.IP "\fB\-Map=\fR\fImapfile\fR" 4
+.IX Item "-Map=mapfile"
+Print a link map to the file \fImapfile\fR. See the description of the
+\&\fB\-M\fR option, above.
+.IP "\fB\-\-no\-keep\-memory\fR" 4
+.IX Item "--no-keep-memory"
+\&\fBld\fR normally optimizes for speed over memory usage by caching the
+symbol tables of input files in memory. This option tells \fBld\fR to
+instead optimize for memory usage, by rereading the symbol tables as
+necessary. This may be required if \fBld\fR runs out of memory space
+while linking a large executable.
+.IP "\fB\-\-no\-undefined\fR" 4
+.IX Item "--no-undefined"
+.PD 0
+.IP "\fB\-z defs\fR" 4
+.IX Item "-z defs"
+.PD
+Report unresolved symbol references from regular object files. This
+is done even if the linker is creating a non-symbolic shared library.
+The switch \fB\-\-[no\-]allow\-shlib\-undefined\fR controls the
+behaviour for reporting unresolved references found in shared
+libraries being linked in.
+.IP "\fB\-\-allow\-multiple\-definition\fR" 4
+.IX Item "--allow-multiple-definition"
+.PD 0
+.IP "\fB\-z muldefs\fR" 4
+.IX Item "-z muldefs"
+.PD
+Normally when a symbol is defined multiple times, the linker will
+report a fatal error. These options allow multiple definitions and the
+first definition will be used.
+.IP "\fB\-\-allow\-shlib\-undefined\fR" 4
+.IX Item "--allow-shlib-undefined"
+.PD 0
+.IP "\fB\-\-no\-allow\-shlib\-undefined\fR" 4
+.IX Item "--no-allow-shlib-undefined"
+.PD
+Allows or disallows undefined symbols in shared libraries.
+This switch is similar to \fB\-\-no\-undefined\fR except that it
+determines the behaviour when the undefined symbols are in a
+shared library rather than a regular object file. It does not affect
+how undefined symbols in regular object files are handled.
+.Sp
+The default behaviour is to report errors for any undefined symbols
+referenced in shared libraries if the linker is being used to create
+an executable, but to allow them if the linker is being used to create
+a shared library.
+.Sp
+The reasons for allowing undefined symbol references in shared
+libraries specified at link time are that:
+.RS 4
+.IP "\(bu" 4
+A shared library specified at link time may not be the same as the one
+that is available at load time, so the symbol might actually be
+resolvable at load time.
+.IP "\(bu" 4
+There are some operating systems, eg BeOS and \s-1HPPA\s0, where undefined
+symbols in shared libraries are normal.
+.Sp
+The BeOS kernel for example patches shared libraries at load time to
+select whichever function is most appropriate for the current
+architecture. This is used, for example, to dynamically select an
+appropriate memset function.
+.RE
+.RS 4
+.RE
+.IP "\fB\-\-no\-undefined\-version\fR" 4
+.IX Item "--no-undefined-version"
+Normally when a symbol has an undefined version, the linker will ignore
+it. This option disallows symbols with undefined version and a fatal error
+will be issued instead.
+.IP "\fB\-\-default\-symver\fR" 4
+.IX Item "--default-symver"
+Create and use a default symbol version (the soname) for unversioned
+exported symbols.
+.IP "\fB\-\-default\-imported\-symver\fR" 4
+.IX Item "--default-imported-symver"
+Create and use a default symbol version (the soname) for unversioned
+imported symbols.
+.IP "\fB\-\-no\-warn\-mismatch\fR" 4
+.IX Item "--no-warn-mismatch"
+Normally \fBld\fR will give an error if you try to link together input
+files that are mismatched for some reason, perhaps because they have
+been compiled for different processors or for different endiannesses.
+This option tells \fBld\fR that it should silently permit such possible
+errors. This option should only be used with care, in cases when you
+have taken some special action that ensures that the linker errors are
+inappropriate.
+.IP "\fB\-\-no\-warn\-search\-mismatch\fR" 4
+.IX Item "--no-warn-search-mismatch"
+Normally \fBld\fR will give a warning if it finds an incompatible
+library during a library search. This option silences the warning.
+.IP "\fB\-\-no\-whole\-archive\fR" 4
+.IX Item "--no-whole-archive"
+Turn off the effect of the \fB\-\-whole\-archive\fR option for subsequent
+archive files.
+.IP "\fB\-\-noinhibit\-exec\fR" 4
+.IX Item "--noinhibit-exec"
+Retain the executable output file whenever it is still usable.
+Normally, the linker will not produce an output file if it encounters
+errors during the link process; it exits without writing an output file
+when it issues any error whatsoever.
+.IP "\fB\-nostdlib\fR" 4
+.IX Item "-nostdlib"
+Only search library directories explicitly specified on the
+command line. Library directories specified in linker scripts
+(including linker scripts specified on the command line) are ignored.
+.IP "\fB\-\-oformat=\fR\fIoutput-format\fR" 4
+.IX Item "--oformat=output-format"
+\&\fBld\fR may be configured to support more than one kind of object
+file. If your \fBld\fR is configured this way, you can use the
+\&\fB\-\-oformat\fR option to specify the binary format for the output
+object file. Even when \fBld\fR is configured to support alternative
+object formats, you don't usually need to specify this, as \fBld\fR
+should be configured to produce as a default output format the most
+usual format on each machine. \fIoutput-format\fR is a text string, the
+name of a particular format supported by the \s-1BFD\s0 libraries. (You can
+list the available binary formats with \fBobjdump \-i\fR.) The script
+command \f(CW\*(C`OUTPUT_FORMAT\*(C'\fR can also specify the output format, but
+this option overrides it.
+.IP "\fB\-pie\fR" 4
+.IX Item "-pie"
+.PD 0
+.IP "\fB\-\-pic\-executable\fR" 4
+.IX Item "--pic-executable"
+.PD
+Create a position independent executable. This is currently only supported on
+\&\s-1ELF\s0 platforms. Position independent executables are similar to shared
+libraries in that they are relocated by the dynamic linker to the virtual
+address the \s-1OS\s0 chooses for them (which can vary between invocations). Like
+normal dynamically linked executables they can be executed and symbols
+defined in the executable cannot be overridden by shared libraries.
+.IP "\fB\-qmagic\fR" 4
+.IX Item "-qmagic"
+This option is ignored for Linux compatibility.
+.IP "\fB\-Qy\fR" 4
+.IX Item "-Qy"
+This option is ignored for \s-1SVR4\s0 compatibility.
+.IP "\fB\-\-relax\fR" 4
+.IX Item "--relax"
+An option with machine dependent effects.
+This option is only supported on a few targets.
+.Sp
+On some platforms, the \fB\-\-relax\fR option performs global
+optimizations that become possible when the linker resolves addressing
+in the program, such as relaxing address modes and synthesizing new
+instructions in the output object file.
+.Sp
+On some platforms these link time global optimizations may make symbolic
+debugging of the resulting executable impossible.
+This is known to be
+the case for the Matsushita \s-1MN10200\s0 and \s-1MN10300\s0 family of processors.
+.Sp
+On platforms where this is not supported, \fB\-\-relax\fR is accepted,
+but ignored.
+.IP "\fB\-\-retain\-symbols\-file=\fR\fIfilename\fR" 4
+.IX Item "--retain-symbols-file=filename"
+Retain \fIonly\fR the symbols listed in the file \fIfilename\fR,
+discarding all others. \fIfilename\fR is simply a flat file, with one
+symbol name per line. This option is especially useful in environments
+(such as VxWorks)
+where a large global symbol table is accumulated gradually, to conserve
+run-time memory.
+.Sp
+\&\fB\-\-retain\-symbols\-file\fR does \fInot\fR discard undefined symbols,
+or symbols needed for relocations.
+.Sp
+You may only specify \fB\-\-retain\-symbols\-file\fR once in the command
+line. It overrides \fB\-s\fR and \fB\-S\fR.
+.IP "\fB\-rpath=\fR\fIdir\fR" 4
+.IX Item "-rpath=dir"
+Add a directory to the runtime library search path. This is used when
+linking an \s-1ELF\s0 executable with shared objects. All \fB\-rpath\fR
+arguments are concatenated and passed to the runtime linker, which uses
+them to locate shared objects at runtime. The \fB\-rpath\fR option is
+also used when locating shared objects which are needed by shared
+objects explicitly included in the link; see the description of the
+\&\fB\-rpath\-link\fR option. If \fB\-rpath\fR is not used when linking an
+\&\s-1ELF\s0 executable, the contents of the environment variable
+\&\f(CW\*(C`LD_RUN_PATH\*(C'\fR will be used if it is defined.
+.Sp
+The \fB\-rpath\fR option may also be used on SunOS. By default, on
+SunOS, the linker will form a runtime search patch out of all the
+\&\fB\-L\fR options it is given. If a \fB\-rpath\fR option is used, the
+runtime search path will be formed exclusively using the \fB\-rpath\fR
+options, ignoring the \fB\-L\fR options. This can be useful when using
+gcc, which adds many \fB\-L\fR options which may be on \s-1NFS\s0 mounted
+file systems.
+.Sp
+For compatibility with other \s-1ELF\s0 linkers, if the \fB\-R\fR option is
+followed by a directory name, rather than a file name, it is treated as
+the \fB\-rpath\fR option.
+.IP "\fB\-rpath\-link=\fR\fIdir\fR" 4
+.IX Item "-rpath-link=dir"
+When using \s-1ELF\s0 or SunOS, one shared library may require another. This
+happens when an \f(CW\*(C`ld \-shared\*(C'\fR link includes a shared library as one
+of the input files.
+.Sp
+When the linker encounters such a dependency when doing a non-shared,
+non-relocatable link, it will automatically try to locate the required
+shared library and include it in the link, if it is not included
+explicitly. In such a case, the \fB\-rpath\-link\fR option
+specifies the first set of directories to search. The
+\&\fB\-rpath\-link\fR option may specify a sequence of directory names
+either by specifying a list of names separated by colons, or by
+appearing multiple times.
+.Sp
+This option should be used with caution as it overrides the search path
+that may have been hard compiled into a shared library. In such a case it
+is possible to use unintentionally a different search path than the
+runtime linker would do.
+.Sp
+The linker uses the following search paths to locate required shared
+libraries:
+.RS 4
+.IP "1." 4
+Any directories specified by \fB\-rpath\-link\fR options.
+.IP "2." 4
+Any directories specified by \fB\-rpath\fR options. The difference
+between \fB\-rpath\fR and \fB\-rpath\-link\fR is that directories
+specified by \fB\-rpath\fR options are included in the executable and
+used at runtime, whereas the \fB\-rpath\-link\fR option is only effective
+at link time. Searching \fB\-rpath\fR in this way is only supported
+by native linkers and cross linkers which have been configured with
+the \fB\-\-with\-sysroot\fR option.
+.IP "3." 4
+On an \s-1ELF\s0 system, for native linkers, if the \fB\-rpath\fR and
+\&\fB\-rpath\-link\fR options were not used, search the contents of the
+environment variable \f(CW\*(C`LD_RUN_PATH\*(C'\fR.
+.IP "4." 4
+On SunOS, if the \fB\-rpath\fR option was not used, search any
+directories specified using \fB\-L\fR options.
+.IP "5." 4
+For a native linker, the search the contents of the environment
+variable \f(CW\*(C`LD_LIBRARY_PATH\*(C'\fR.
+.IP "6." 4
+For a native \s-1ELF\s0 linker, the directories in \f(CW\*(C`DT_RUNPATH\*(C'\fR or
+\&\f(CW\*(C`DT_RPATH\*(C'\fR of a shared library are searched for shared
+libraries needed by it. The \f(CW\*(C`DT_RPATH\*(C'\fR entries are ignored if
+\&\f(CW\*(C`DT_RUNPATH\*(C'\fR entries exist.
+.IP "7." 4
+The default directories, normally \fI/lib\fR and \fI/usr/lib\fR.
+.IP "8." 4
+For a native linker on an \s-1ELF\s0 system, if the file \fI/etc/ld.so.conf\fR
+exists, the list of directories found in that file.
+.RE
+.RS 4
+.Sp
+If the required shared library is not found, the linker will issue a
+warning and continue with the link.
+.RE
+.IP "\fB\-shared\fR" 4
+.IX Item "-shared"
+.PD 0
+.IP "\fB\-Bshareable\fR" 4
+.IX Item "-Bshareable"
+.PD
+Create a shared library. This is currently only supported on \s-1ELF\s0, \s-1XCOFF\s0
+and SunOS platforms. On SunOS, the linker will automatically create a
+shared library if the \fB\-e\fR option is not used and there are
+undefined symbols in the link.
+.IP "\fB\-\-sort\-common\fR" 4
+.IX Item "--sort-common"
+.PD 0
+.IP "\fB\-\-sort\-common=ascending\fR" 4
+.IX Item "--sort-common=ascending"
+.IP "\fB\-\-sort\-common=descending\fR" 4
+.IX Item "--sort-common=descending"
+.PD
+This option tells \fBld\fR to sort the common symbols by alignment in
+ascending or descending order when it places them in the appropriate output
+sections. The symbol alignments considered are sixteen-byte or larger,
+eight-byte, four-byte, two-byte, and one-byte. This is to prevent gaps
+between symbols due to alignment constraints. If no sorting order is
+specified, then descending order is assumed.
+.IP "\fB\-\-sort\-section=name\fR" 4
+.IX Item "--sort-section=name"
+This option will apply \f(CW\*(C`SORT_BY_NAME\*(C'\fR to all wildcard section
+patterns in the linker script.
+.IP "\fB\-\-sort\-section=alignment\fR" 4
+.IX Item "--sort-section=alignment"
+This option will apply \f(CW\*(C`SORT_BY_ALIGNMENT\*(C'\fR to all wildcard section
+patterns in the linker script.
+.IP "\fB\-\-split\-by\-file[=\fR\fIsize\fR\fB]\fR" 4
+.IX Item "--split-by-file[=size]"
+Similar to \fB\-\-split\-by\-reloc\fR but creates a new output section for
+each input file when \fIsize\fR is reached. \fIsize\fR defaults to a
+size of 1 if not given.
+.IP "\fB\-\-split\-by\-reloc[=\fR\fIcount\fR\fB]\fR" 4
+.IX Item "--split-by-reloc[=count]"
+Tries to creates extra sections in the output file so that no single
+output section in the file contains more than \fIcount\fR relocations.
+This is useful when generating huge relocatable files for downloading into
+certain real time kernels with the \s-1COFF\s0 object file format; since \s-1COFF\s0
+cannot represent more than 65535 relocations in a single section. Note
+that this will fail to work with object file formats which do not
+support arbitrary sections. The linker will not split up individual
+input sections for redistribution, so if a single input section contains
+more than \fIcount\fR relocations one output section will contain that
+many relocations. \fIcount\fR defaults to a value of 32768.
+.IP "\fB\-\-stats\fR" 4
+.IX Item "--stats"
+Compute and display statistics about the operation of the linker, such
+as execution time and memory usage.
+.IP "\fB\-\-sysroot=\fR\fIdirectory\fR" 4
+.IX Item "--sysroot=directory"
+Use \fIdirectory\fR as the location of the sysroot, overriding the
+configure-time default. This option is only supported by linkers
+that were configured using \fB\-\-with\-sysroot\fR.
+.IP "\fB\-\-traditional\-format\fR" 4
+.IX Item "--traditional-format"
+For some targets, the output of \fBld\fR is different in some ways from
+the output of some existing linker. This switch requests \fBld\fR to
+use the traditional format instead.
+.Sp
+For example, on SunOS, \fBld\fR combines duplicate entries in the
+symbol string table. This can reduce the size of an output file with
+full debugging information by over 30 percent. Unfortunately, the SunOS
+\&\f(CW\*(C`dbx\*(C'\fR program can not read the resulting program (\f(CW\*(C`gdb\*(C'\fR has no
+trouble). The \fB\-\-traditional\-format\fR switch tells \fBld\fR to not
+combine duplicate entries.
+.IP "\fB\-\-section\-start=\fR\fIsectionname\fR\fB=\fR\fIorg\fR" 4
+.IX Item "--section-start=sectionname=org"
+Locate a section in the output file at the absolute
+address given by \fIorg\fR. You may use this option as many
+times as necessary to locate multiple sections in the command
+line.
+\&\fIorg\fR must be a single hexadecimal integer;
+for compatibility with other linkers, you may omit the leading
+\&\fB0x\fR usually associated with hexadecimal values. \fINote:\fR there
+should be no white space between \fIsectionname\fR, the equals
+sign ("\fB=\fR"), and \fIorg\fR.
+.IP "\fB\-Tbss=\fR\fIorg\fR" 4
+.IX Item "-Tbss=org"
+.PD 0
+.IP "\fB\-Tdata=\fR\fIorg\fR" 4
+.IX Item "-Tdata=org"
+.IP "\fB\-Ttext=\fR\fIorg\fR" 4
+.IX Item "-Ttext=org"
+.PD
+Same as \fB\-\-section\-start\fR, with \f(CW\*(C`.bss\*(C'\fR, \f(CW\*(C`.data\*(C'\fR or
+\&\f(CW\*(C`.text\*(C'\fR as the \fIsectionname\fR.
+.IP "\fB\-Ttext\-segment=\fR\fIorg\fR" 4
+.IX Item "-Ttext-segment=org"
+When creating an \s-1ELF\s0 executable or shared object, it will set the address
+of the first byte of the text segment.
+.IP "\fB\-\-unresolved\-symbols=\fR\fImethod\fR" 4
+.IX Item "--unresolved-symbols=method"
+Determine how to handle unresolved symbols. There are four possible
+values for \fBmethod\fR:
+.RS 4
+.IP "\fBignore-all\fR" 4
+.IX Item "ignore-all"
+Do not report any unresolved symbols.
+.IP "\fBreport-all\fR" 4
+.IX Item "report-all"
+Report all unresolved symbols. This is the default.
+.IP "\fBignore-in-object-files\fR" 4
+.IX Item "ignore-in-object-files"
+Report unresolved symbols that are contained in shared libraries, but
+ignore them if they come from regular object files.
+.IP "\fBignore-in-shared-libs\fR" 4
+.IX Item "ignore-in-shared-libs"
+Report unresolved symbols that come from regular object files, but
+ignore them if they come from shared libraries. This can be useful
+when creating a dynamic binary and it is known that all the shared
+libraries that it should be referencing are included on the linker's
+command line.
+.RE
+.RS 4
+.Sp
+The behaviour for shared libraries on their own can also be controlled
+by the \fB\-\-[no\-]allow\-shlib\-undefined\fR option.
+.Sp
+Normally the linker will generate an error message for each reported
+unresolved symbol but the option \fB\-\-warn\-unresolved\-symbols\fR
+can change this to a warning.
+.RE
+.IP "\fB\-\-dll\-verbose\fR" 4
+.IX Item "--dll-verbose"
+.PD 0
+.IP "\fB\-\-verbose\fR" 4
+.IX Item "--verbose"
+.PD
+Display the version number for \fBld\fR and list the linker emulations
+supported. Display which input files can and cannot be opened. Display
+the linker script being used by the linker.
+.IP "\fB\-\-version\-script=\fR\fIversion-scriptfile\fR" 4
+.IX Item "--version-script=version-scriptfile"
+Specify the name of a version script to the linker. This is typically
+used when creating shared libraries to specify additional information
+about the version hierarchy for the library being created. This option
+is only fully supported on \s-1ELF\s0 platforms which support shared libraries;
+see \fB\s-1VERSION\s0\fR. It is partially supported on \s-1PE\s0 platforms, which can
+use version scripts to filter symbol visibility in auto-export mode: any
+symbols marked \fBlocal\fR in the version script will not be exported.
+.IP "\fB\-\-warn\-common\fR" 4
+.IX Item "--warn-common"
+Warn when a common symbol is combined with another common symbol or with
+a symbol definition. Unix linkers allow this somewhat sloppy practise,
+but linkers on some other operating systems do not. This option allows
+you to find potential problems from combining global symbols.
+Unfortunately, some C libraries use this practise, so you may get some
+warnings about symbols in the libraries as well as in your programs.
+.Sp
+There are three kinds of global symbols, illustrated here by C examples:
+.RS 4
+.IP "\fBint i = 1;\fR" 4
+.IX Item "int i = 1;"
+A definition, which goes in the initialized data section of the output
+file.
+.IP "\fBextern int i;\fR" 4
+.IX Item "extern int i;"
+An undefined reference, which does not allocate space.
+There must be either a definition or a common symbol for the
+variable somewhere.
+.IP "\fBint i;\fR" 4
+.IX Item "int i;"
+A common symbol. If there are only (one or more) common symbols for a
+variable, it goes in the uninitialized data area of the output file.
+The linker merges multiple common symbols for the same variable into a
+single symbol. If they are of different sizes, it picks the largest
+size. The linker turns a common symbol into a declaration, if there is
+a definition of the same variable.
+.RE
+.RS 4
+.Sp
+The \fB\-\-warn\-common\fR option can produce five kinds of warnings.
+Each warning consists of a pair of lines: the first describes the symbol
+just encountered, and the second describes the previous symbol
+encountered with the same name. One or both of the two symbols will be
+a common symbol.
+.IP "1." 4
+Turning a common symbol into a reference, because there is already a
+definition for the symbol.
+.Sp
+.Vb 3
+\& <file>(<section>): warning: common of \`<symbol>\*(Aq
+\& overridden by definition
+\& <file>(<section>): warning: defined here
+.Ve
+.IP "2." 4
+Turning a common symbol into a reference, because a later definition for
+the symbol is encountered. This is the same as the previous case,
+except that the symbols are encountered in a different order.
+.Sp
+.Vb 3
+\& <file>(<section>): warning: definition of \`<symbol>\*(Aq
+\& overriding common
+\& <file>(<section>): warning: common is here
+.Ve
+.IP "3." 4
+Merging a common symbol with a previous same-sized common symbol.
+.Sp
+.Vb 3
+\& <file>(<section>): warning: multiple common
+\& of \`<symbol>\*(Aq
+\& <file>(<section>): warning: previous common is here
+.Ve
+.IP "4." 4
+Merging a common symbol with a previous larger common symbol.
+.Sp
+.Vb 3
+\& <file>(<section>): warning: common of \`<symbol>\*(Aq
+\& overridden by larger common
+\& <file>(<section>): warning: larger common is here
+.Ve
+.IP "5." 4
+Merging a common symbol with a previous smaller common symbol. This is
+the same as the previous case, except that the symbols are
+encountered in a different order.
+.Sp
+.Vb 3
+\& <file>(<section>): warning: common of \`<symbol>\*(Aq
+\& overriding smaller common
+\& <file>(<section>): warning: smaller common is here
+.Ve
+.RE
+.RS 4
+.RE
+.IP "\fB\-\-warn\-constructors\fR" 4
+.IX Item "--warn-constructors"
+Warn if any global constructors are used. This is only useful for a few
+object file formats. For formats like \s-1COFF\s0 or \s-1ELF\s0, the linker can not
+detect the use of global constructors.
+.IP "\fB\-\-warn\-multiple\-gp\fR" 4
+.IX Item "--warn-multiple-gp"
+Warn if multiple global pointer values are required in the output file.
+This is only meaningful for certain processors, such as the Alpha.
+Specifically, some processors put large-valued constants in a special
+section. A special register (the global pointer) points into the middle
+of this section, so that constants can be loaded efficiently via a
+base-register relative addressing mode. Since the offset in
+base-register relative mode is fixed and relatively small (e.g., 16
+bits), this limits the maximum size of the constant pool. Thus, in
+large programs, it is often necessary to use multiple global pointer
+values in order to be able to address all possible constants. This
+option causes a warning to be issued whenever this case occurs.
+.IP "\fB\-\-warn\-once\fR" 4
+.IX Item "--warn-once"
+Only warn once for each undefined symbol, rather than once per module
+which refers to it.
+.IP "\fB\-\-warn\-section\-align\fR" 4
+.IX Item "--warn-section-align"
+Warn if the address of an output section is changed because of
+alignment. Typically, the alignment will be set by an input section.
+The address will only be changed if it not explicitly specified; that
+is, if the \f(CW\*(C`SECTIONS\*(C'\fR command does not specify a start address for
+the section.
+.IP "\fB\-\-warn\-shared\-textrel\fR" 4
+.IX Item "--warn-shared-textrel"
+Warn if the linker adds a \s-1DT_TEXTREL\s0 to a shared object.
+.IP "\fB\-\-warn\-alternate\-em\fR" 4
+.IX Item "--warn-alternate-em"
+Warn if an object has alternate \s-1ELF\s0 machine code.
+.IP "\fB\-\-warn\-unresolved\-symbols\fR" 4
+.IX Item "--warn-unresolved-symbols"
+If the linker is going to report an unresolved symbol (see the option
+\&\fB\-\-unresolved\-symbols\fR) it will normally generate an error.
+This option makes it generate a warning instead.
+.IP "\fB\-\-error\-unresolved\-symbols\fR" 4
+.IX Item "--error-unresolved-symbols"
+This restores the linker's default behaviour of generating errors when
+it is reporting unresolved symbols.
+.IP "\fB\-\-whole\-archive\fR" 4
+.IX Item "--whole-archive"
+For each archive mentioned on the command line after the
+\&\fB\-\-whole\-archive\fR option, include every object file in the archive
+in the link, rather than searching the archive for the required object
+files. This is normally used to turn an archive file into a shared
+library, forcing every object to be included in the resulting shared
+library. This option may be used more than once.
+.Sp
+Two notes when using this option from gcc: First, gcc doesn't know
+about this option, so you have to use \fB\-Wl,\-whole\-archive\fR.
+Second, don't forget to use \fB\-Wl,\-no\-whole\-archive\fR after your
+list of archives, because gcc will add its own list of archives to
+your link and you may not want this flag to affect those as well.
+.IP "\fB\-\-wrap=\fR\fIsymbol\fR" 4
+.IX Item "--wrap=symbol"
+Use a wrapper function for \fIsymbol\fR. Any undefined reference to
+\&\fIsymbol\fR will be resolved to \f(CW\*(C`_\|_wrap_\f(CIsymbol\f(CW\*(C'\fR. Any
+undefined reference to \f(CW\*(C`_\|_real_\f(CIsymbol\f(CW\*(C'\fR will be resolved to
+\&\fIsymbol\fR.
+.Sp
+This can be used to provide a wrapper for a system function. The
+wrapper function should be called \f(CW\*(C`_\|_wrap_\f(CIsymbol\f(CW\*(C'\fR. If it
+wishes to call the system function, it should call
+\&\f(CW\*(C`_\|_real_\f(CIsymbol\f(CW\*(C'\fR.
+.Sp
+Here is a trivial example:
+.Sp
+.Vb 6
+\& void *
+\& _\|_wrap_malloc (size_t c)
+\& {
+\& printf ("malloc called with %zu\en", c);
+\& return _\|_real_malloc (c);
+\& }
+.Ve
+.Sp
+If you link other code with this file using \fB\-\-wrap malloc\fR, then
+all calls to \f(CW\*(C`malloc\*(C'\fR will call the function \f(CW\*(C`_\|_wrap_malloc\*(C'\fR
+instead. The call to \f(CW\*(C`_\|_real_malloc\*(C'\fR in \f(CW\*(C`_\|_wrap_malloc\*(C'\fR will
+call the real \f(CW\*(C`malloc\*(C'\fR function.
+.Sp
+You may wish to provide a \f(CW\*(C`_\|_real_malloc\*(C'\fR function as well, so that
+links without the \fB\-\-wrap\fR option will succeed. If you do this,
+you should not put the definition of \f(CW\*(C`_\|_real_malloc\*(C'\fR in the same
+file as \f(CW\*(C`_\|_wrap_malloc\*(C'\fR; if you do, the assembler may resolve the
+call before the linker has a chance to wrap it to \f(CW\*(C`malloc\*(C'\fR.
+.IP "\fB\-\-eh\-frame\-hdr\fR" 4
+.IX Item "--eh-frame-hdr"
+Request creation of \f(CW\*(C`.eh_frame_hdr\*(C'\fR section and \s-1ELF\s0
+\&\f(CW\*(C`PT_GNU_EH_FRAME\*(C'\fR segment header.
+.IP "\fB\-\-enable\-new\-dtags\fR" 4
+.IX Item "--enable-new-dtags"
+.PD 0
+.IP "\fB\-\-disable\-new\-dtags\fR" 4
+.IX Item "--disable-new-dtags"
+.PD
+This linker can create the new dynamic tags in \s-1ELF\s0. But the older \s-1ELF\s0
+systems may not understand them. If you specify
+\&\fB\-\-enable\-new\-dtags\fR, the dynamic tags will be created as needed.
+If you specify \fB\-\-disable\-new\-dtags\fR, no new dynamic tags will be
+created. By default, the new dynamic tags are not created. Note that
+those options are only available for \s-1ELF\s0 systems.
+.IP "\fB\-\-hash\-size=\fR\fInumber\fR" 4
+.IX Item "--hash-size=number"
+Set the default size of the linker's hash tables to a prime number
+close to \fInumber\fR. Increasing this value can reduce the length of
+time it takes the linker to perform its tasks, at the expense of
+increasing the linker's memory requirements. Similarly reducing this
+value can reduce the memory requirements at the expense of speed.
+.IP "\fB\-\-hash\-style=\fR\fIstyle\fR" 4
+.IX Item "--hash-style=style"
+Set the type of linker's hash table(s). \fIstyle\fR can be either
+\&\f(CW\*(C`sysv\*(C'\fR for classic \s-1ELF\s0 \f(CW\*(C`.hash\*(C'\fR section, \f(CW\*(C`gnu\*(C'\fR for
+new style \s-1GNU\s0 \f(CW\*(C`.gnu.hash\*(C'\fR section or \f(CW\*(C`both\*(C'\fR for both
+the classic \s-1ELF\s0 \f(CW\*(C`.hash\*(C'\fR and new style \s-1GNU\s0 \f(CW\*(C`.gnu.hash\*(C'\fR
+hash tables. The default is \f(CW\*(C`sysv\*(C'\fR.
+.IP "\fB\-\-reduce\-memory\-overheads\fR" 4
+.IX Item "--reduce-memory-overheads"
+This option reduces memory requirements at ld runtime, at the expense of
+linking speed. This was introduced to select the old O(n^2) algorithm
+for link map file generation, rather than the new O(n) algorithm which uses
+about 40% more memory for symbol storage.
+.Sp
+Another effect of the switch is to set the default hash table size to
+1021, which again saves memory at the cost of lengthening the linker's
+run time. This is not done however if the \fB\-\-hash\-size\fR switch
+has been used.
+.Sp
+The \fB\-\-reduce\-memory\-overheads\fR switch may be also be used to
+enable other tradeoffs in future versions of the linker.
+.IP "\fB\-\-build\-id\fR" 4
+.IX Item "--build-id"
+.PD 0
+.IP "\fB\-\-build\-id=\fR\fIstyle\fR" 4
+.IX Item "--build-id=style"
+.PD
+Request creation of \f(CW\*(C`.note.gnu.build\-id\*(C'\fR \s-1ELF\s0 note section.
+The contents of the note are unique bits identifying this linked
+file. \fIstyle\fR can be \f(CW\*(C`uuid\*(C'\fR to use 128 random bits,
+\&\f(CW\*(C`sha1\*(C'\fR to use a 160\-bit \s-1SHA1\s0 hash on the normative
+parts of the output contents, \f(CW\*(C`md5\*(C'\fR to use a 128\-bit
+\&\s-1MD5\s0 hash on the normative parts of the output contents, or
+\&\f(CW\*(C`0x\f(CIhexstring\f(CW\*(C'\fR to use a chosen bit string specified as
+an even number of hexadecimal digits (\f(CW\*(C`\-\*(C'\fR and \f(CW\*(C`:\*(C'\fR
+characters between digit pairs are ignored). If \fIstyle\fR is
+omitted, \f(CW\*(C`sha1\*(C'\fR is used.
+.Sp
+The \f(CW\*(C`md5\*(C'\fR and \f(CW\*(C`sha1\*(C'\fR styles produces an identifier
+that is always the same in an identical output file, but will be
+unique among all nonidentical output files. It is not intended
+to be compared as a checksum for the file's contents. A linked
+file may be changed later by other tools, but the build \s-1ID\s0 bit
+string identifying the original linked file does not change.
+.Sp
+Passing \f(CW\*(C`none\*(C'\fR for \fIstyle\fR disables the setting from any
+\&\f(CW\*(C`\-\-build\-id\*(C'\fR options earlier on the command line.
+.PP
+The i386 \s-1PE\s0 linker supports the \fB\-shared\fR option, which causes
+the output to be a dynamically linked library (\s-1DLL\s0) instead of a
+normal executable. You should name the output \f(CW\*(C`*.dll\*(C'\fR when you
+use this option. In addition, the linker fully supports the standard
+\&\f(CW\*(C`*.def\*(C'\fR files, which may be specified on the linker command line
+like an object file (in fact, it should precede archives it exports
+symbols from, to ensure that they get linked in, just like a normal
+object file).
+.PP
+In addition to the options common to all targets, the i386 \s-1PE\s0 linker
+support additional command line options that are specific to the i386
+\&\s-1PE\s0 target. Options that take values may be separated from their
+values by either a space or an equals sign.
+.IP "\fB\-\-add\-stdcall\-alias\fR" 4
+.IX Item "--add-stdcall-alias"
+If given, symbols with a stdcall suffix (@\fInn\fR) will be exported
+as-is and also with the suffix stripped.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-base\-file\fR \fIfile\fR" 4
+.IX Item "--base-file file"
+Use \fIfile\fR as the name of a file in which to save the base
+addresses of all the relocations needed for generating DLLs with
+\&\fIdlltool\fR.
+[This is an i386 \s-1PE\s0 specific option]
+.IP "\fB\-\-dll\fR" 4
+.IX Item "--dll"
+Create a \s-1DLL\s0 instead of a regular executable. You may also use
+\&\fB\-shared\fR or specify a \f(CW\*(C`LIBRARY\*(C'\fR in a given \f(CW\*(C`.def\*(C'\fR
+file.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-enable\-long\-section\-names\fR" 4
+.IX Item "--enable-long-section-names"
+.PD 0
+.IP "\fB\-\-disable\-long\-section\-names\fR" 4
+.IX Item "--disable-long-section-names"
+.PD
+The \s-1PE\s0 variants of the Coff object format add an extension that permits
+the use of section names longer than eight characters, the normal limit
+for Coff. By default, these names are only allowed in object files, as
+fully-linked executable images do not carry the Coff string table required
+to support the longer names. As a \s-1GNU\s0 extension, it is possible to
+allow their use in executable images as well, or to (probably pointlessly!)
+disallow it in object files, by using these two options. Executable images
+generated with these long section names are slightly non-standard, carrying
+as they do a string table, and may generate confusing output when examined
+with non-GNU PE-aware tools, such as file viewers and dumpers. However,
+\&\s-1GDB\s0 relies on the use of \s-1PE\s0 long section names to find Dwarf\-2 debug
+information sections in an executable image at runtime, and so if neither
+option is specified on the command-line, \fBld\fR will enable long
+section names, overriding the default and technically correct behaviour,
+when it finds the presence of debug information while linking an executable
+image and not stripping symbols.
+[This option is valid for all \s-1PE\s0 targeted ports of the linker]
+.IP "\fB\-\-enable\-stdcall\-fixup\fR" 4
+.IX Item "--enable-stdcall-fixup"
+.PD 0
+.IP "\fB\-\-disable\-stdcall\-fixup\fR" 4
+.IX Item "--disable-stdcall-fixup"
+.PD
+If the link finds a symbol that it cannot resolve, it will attempt to
+do \*(L"fuzzy linking\*(R" by looking for another defined symbol that differs
+only in the format of the symbol name (cdecl vs stdcall) and will
+resolve that symbol by linking to the match. For example, the
+undefined symbol \f(CW\*(C`_foo\*(C'\fR might be linked to the function
+\&\f(CW\*(C`_foo@12\*(C'\fR, or the undefined symbol \f(CW\*(C`_bar@16\*(C'\fR might be linked
+to the function \f(CW\*(C`_bar\*(C'\fR. When the linker does this, it prints a
+warning, since it normally should have failed to link, but sometimes
+import libraries generated from third-party dlls may need this feature
+to be usable. If you specify \fB\-\-enable\-stdcall\-fixup\fR, this
+feature is fully enabled and warnings are not printed. If you specify
+\&\fB\-\-disable\-stdcall\-fixup\fR, this feature is disabled and such
+mismatches are considered to be errors.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-export\-all\-symbols\fR" 4
+.IX Item "--export-all-symbols"
+If given, all global symbols in the objects used to build a \s-1DLL\s0 will
+be exported by the \s-1DLL\s0. Note that this is the default if there
+otherwise wouldn't be any exported symbols. When symbols are
+explicitly exported via \s-1DEF\s0 files or implicitly exported via function
+attributes, the default is to not export anything else unless this
+option is given. Note that the symbols \f(CW\*(C`DllMain@12\*(C'\fR,
+\&\f(CW\*(C`DllEntryPoint@0\*(C'\fR, \f(CW\*(C`DllMainCRTStartup@12\*(C'\fR, and
+\&\f(CW\*(C`impure_ptr\*(C'\fR will not be automatically
+exported. Also, symbols imported from other DLLs will not be
+re-exported, nor will symbols specifying the \s-1DLL\s0's internal layout
+such as those beginning with \f(CW\*(C`_head_\*(C'\fR or ending with
+\&\f(CW\*(C`_iname\*(C'\fR. In addition, no symbols from \f(CW\*(C`libgcc\*(C'\fR,
+\&\f(CW\*(C`libstd++\*(C'\fR, \f(CW\*(C`libmingw32\*(C'\fR, or \f(CW\*(C`crtX.o\*(C'\fR will be exported.
+Symbols whose names begin with \f(CW\*(C`_\|_rtti_\*(C'\fR or \f(CW\*(C`_\|_builtin_\*(C'\fR will
+not be exported, to help with \*(C+ DLLs. Finally, there is an
+extensive list of cygwin-private symbols that are not exported
+(obviously, this applies on when building DLLs for cygwin targets).
+These cygwin-excludes are: \f(CW\*(C`_cygwin_dll_entry@12\*(C'\fR,
+\&\f(CW\*(C`_cygwin_crt0_common@8\*(C'\fR, \f(CW\*(C`_cygwin_noncygwin_dll_entry@12\*(C'\fR,
+\&\f(CW\*(C`_fmode\*(C'\fR, \f(CW\*(C`_impure_ptr\*(C'\fR, \f(CW\*(C`cygwin_attach_dll\*(C'\fR,
+\&\f(CW\*(C`cygwin_premain0\*(C'\fR, \f(CW\*(C`cygwin_premain1\*(C'\fR, \f(CW\*(C`cygwin_premain2\*(C'\fR,
+\&\f(CW\*(C`cygwin_premain3\*(C'\fR, and \f(CW\*(C`environ\*(C'\fR.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-exclude\-symbols\fR \fIsymbol\fR\fB,\fR\fIsymbol\fR\fB,...\fR" 4
+.IX Item "--exclude-symbols symbol,symbol,..."
+Specifies a list of symbols which should not be automatically
+exported. The symbol names may be delimited by commas or colons.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-file\-alignment\fR" 4
+.IX Item "--file-alignment"
+Specify the file alignment. Sections in the file will always begin at
+file offsets which are multiples of this number. This defaults to
+512.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-heap\fR \fIreserve\fR" 4
+.IX Item "--heap reserve"
+.PD 0
+.IP "\fB\-\-heap\fR \fIreserve\fR\fB,\fR\fIcommit\fR" 4
+.IX Item "--heap reserve,commit"
+.PD
+Specify the number of bytes of memory to reserve (and optionally commit)
+to be used as heap for this program. The default is 1Mb reserved, 4K
+committed.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-image\-base\fR \fIvalue\fR" 4
+.IX Item "--image-base value"
+Use \fIvalue\fR as the base address of your program or dll. This is
+the lowest memory location that will be used when your program or dll
+is loaded. To reduce the need to relocate and improve performance of
+your dlls, each should have a unique base address and not overlap any
+other dlls. The default is 0x400000 for executables, and 0x10000000
+for dlls.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-kill\-at\fR" 4
+.IX Item "--kill-at"
+If given, the stdcall suffixes (@\fInn\fR) will be stripped from
+symbols before they are exported.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-large\-address\-aware\fR" 4
+.IX Item "--large-address-aware"
+If given, the appropriate bit in the \*(L"Characteristics\*(R" field of the \s-1COFF\s0
+header is set to indicate that this executable supports virtual addresses
+greater than 2 gigabytes. This should be used in conjunction with the /3GB
+or /USERVA=\fIvalue\fR megabytes switch in the \*(L"[operating systems]\*(R"
+section of the \s-1BOOT\s0.INI. Otherwise, this bit has no effect.
+[This option is specific to \s-1PE\s0 targeted ports of the linker]
+.IP "\fB\-\-major\-image\-version\fR \fIvalue\fR" 4
+.IX Item "--major-image-version value"
+Sets the major number of the \*(L"image version\*(R". Defaults to 1.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-major\-os\-version\fR \fIvalue\fR" 4
+.IX Item "--major-os-version value"
+Sets the major number of the \*(L"os version\*(R". Defaults to 4.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-major\-subsystem\-version\fR \fIvalue\fR" 4
+.IX Item "--major-subsystem-version value"
+Sets the major number of the \*(L"subsystem version\*(R". Defaults to 4.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-minor\-image\-version\fR \fIvalue\fR" 4
+.IX Item "--minor-image-version value"
+Sets the minor number of the \*(L"image version\*(R". Defaults to 0.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-minor\-os\-version\fR \fIvalue\fR" 4
+.IX Item "--minor-os-version value"
+Sets the minor number of the \*(L"os version\*(R". Defaults to 0.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-minor\-subsystem\-version\fR \fIvalue\fR" 4
+.IX Item "--minor-subsystem-version value"
+Sets the minor number of the \*(L"subsystem version\*(R". Defaults to 0.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-output\-def\fR \fIfile\fR" 4
+.IX Item "--output-def file"
+The linker will create the file \fIfile\fR which will contain a \s-1DEF\s0
+file corresponding to the \s-1DLL\s0 the linker is generating. This \s-1DEF\s0 file
+(which should be called \f(CW\*(C`*.def\*(C'\fR) may be used to create an import
+library with \f(CW\*(C`dlltool\*(C'\fR or may be used as a reference to
+automatically or implicitly exported symbols.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-out\-implib\fR \fIfile\fR" 4
+.IX Item "--out-implib file"
+The linker will create the file \fIfile\fR which will contain an
+import lib corresponding to the \s-1DLL\s0 the linker is generating. This
+import lib (which should be called \f(CW\*(C`*.dll.a\*(C'\fR or \f(CW\*(C`*.a\*(C'\fR
+may be used to link clients against the generated \s-1DLL\s0; this behaviour
+makes it possible to skip a separate \f(CW\*(C`dlltool\*(C'\fR import library
+creation step.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-enable\-auto\-image\-base\fR" 4
+.IX Item "--enable-auto-image-base"
+Automatically choose the image base for DLLs, unless one is specified
+using the \f(CW\*(C`\-\-image\-base\*(C'\fR argument. By using a hash generated
+from the dllname to create unique image bases for each \s-1DLL\s0, in-memory
+collisions and relocations which can delay program execution are
+avoided.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-disable\-auto\-image\-base\fR" 4
+.IX Item "--disable-auto-image-base"
+Do not automatically generate a unique image base. If there is no
+user-specified image base (\f(CW\*(C`\-\-image\-base\*(C'\fR) then use the platform
+default.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-dll\-search\-prefix\fR \fIstring\fR" 4
+.IX Item "--dll-search-prefix string"
+When linking dynamically to a dll without an import library,
+search for \f(CW\*(C`<string><basename>.dll\*(C'\fR in preference to
+\&\f(CW\*(C`lib<basename>.dll\*(C'\fR. This behaviour allows easy distinction
+between DLLs built for the various \*(L"subplatforms\*(R": native, cygwin,
+uwin, pw, etc. For instance, cygwin DLLs typically use
+\&\f(CW\*(C`\-\-dll\-search\-prefix=cyg\*(C'\fR.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-enable\-auto\-import\fR" 4
+.IX Item "--enable-auto-import"
+Do sophisticated linking of \f(CW\*(C`_symbol\*(C'\fR to \f(CW\*(C`_\|_imp_\|_symbol\*(C'\fR for
+\&\s-1DATA\s0 imports from DLLs, and create the necessary thunking symbols when
+building the import libraries with those \s-1DATA\s0 exports. Note: Use of the
+\&'auto\-import' extension will cause the text section of the image file
+to be made writable. This does not conform to the PE-COFF format
+specification published by Microsoft.
+.Sp
+Note \- use of the 'auto\-import' extension will also cause read only
+data which would normally be placed into the .rdata section to be
+placed into the .data section instead. This is in order to work
+around a problem with consts that is described here:
+http://www.cygwin.com/ml/cygwin/2004\-09/msg01101.html
+.Sp
+Using 'auto\-import' generally will 'just work' \*(-- but sometimes you may
+see this message:
+.Sp
+"variable '<var>' can't be auto-imported. Please read the
+documentation for ld's \f(CW\*(C`\-\-enable\-auto\-import\*(C'\fR for details."
+.Sp
+This message occurs when some (sub)expression accesses an address
+ultimately given by the sum of two constants (Win32 import tables only
+allow one). Instances where this may occur include accesses to member
+fields of struct variables imported from a \s-1DLL\s0, as well as using a
+constant index into an array variable imported from a \s-1DLL\s0. Any
+multiword variable (arrays, structs, long long, etc) may trigger
+this error condition. However, regardless of the exact data type
+of the offending exported variable, ld will always detect it, issue
+the warning, and exit.
+.Sp
+There are several ways to address this difficulty, regardless of the
+data type of the exported variable:
+.Sp
+One way is to use \-\-enable\-runtime\-pseudo\-reloc switch. This leaves the task
+of adjusting references in your client code for runtime environment, so
+this method works only when runtime environment supports this feature.
+.Sp
+A second solution is to force one of the 'constants' to be a variable \*(--
+that is, unknown and un-optimizable at compile time. For arrays,
+there are two possibilities: a) make the indexee (the array's address)
+a variable, or b) make the 'constant' index a variable. Thus:
+.Sp
+.Vb 3
+\& extern type extern_array[];
+\& extern_array[1] \-\->
+\& { volatile type *t=extern_array; t[1] }
+.Ve
+.Sp
+or
+.Sp
+.Vb 3
+\& extern type extern_array[];
+\& extern_array[1] \-\->
+\& { volatile int t=1; extern_array[t] }
+.Ve
+.Sp
+For structs (and most other multiword data types) the only option
+is to make the struct itself (or the long long, or the ...) variable:
+.Sp
+.Vb 3
+\& extern struct s extern_struct;
+\& extern_struct.field \-\->
+\& { volatile struct s *t=&extern_struct; t\->field }
+.Ve
+.Sp
+or
+.Sp
+.Vb 3
+\& extern long long extern_ll;
+\& extern_ll \-\->
+\& { volatile long long * local_ll=&extern_ll; *local_ll }
+.Ve
+.Sp
+A third method of dealing with this difficulty is to abandon
+\&'auto\-import' for the offending symbol and mark it with
+\&\f(CW\*(C`_\|_declspec(dllimport)\*(C'\fR. However, in practise that
+requires using compile-time #defines to indicate whether you are
+building a \s-1DLL\s0, building client code that will link to the \s-1DLL\s0, or
+merely building/linking to a static library. In making the choice
+between the various methods of resolving the 'direct address with
+constant offset' problem, you should consider typical real-world usage:
+.Sp
+Original:
+.Sp
+.Vb 7
+\& \-\-foo.h
+\& extern int arr[];
+\& \-\-foo.c
+\& #include "foo.h"
+\& void main(int argc, char **argv){
+\& printf("%d\en",arr[1]);
+\& }
+.Ve
+.Sp
+Solution 1:
+.Sp
+.Vb 9
+\& \-\-foo.h
+\& extern int arr[];
+\& \-\-foo.c
+\& #include "foo.h"
+\& void main(int argc, char **argv){
+\& /* This workaround is for win32 and cygwin; do not "optimize" */
+\& volatile int *parr = arr;
+\& printf("%d\en",parr[1]);
+\& }
+.Ve
+.Sp
+Solution 2:
+.Sp
+.Vb 10
+\& \-\-foo.h
+\& /* Note: auto\-export is assumed (no _\|_declspec(dllexport)) */
+\& #if (defined(_WIN32) || defined(_\|_CYGWIN_\|_)) && \e
+\& !(defined(FOO_BUILD_DLL) || defined(FOO_STATIC))
+\& #define FOO_IMPORT _\|_declspec(dllimport)
+\& #else
+\& #define FOO_IMPORT
+\& #endif
+\& extern FOO_IMPORT int arr[];
+\& \-\-foo.c
+\& #include "foo.h"
+\& void main(int argc, char **argv){
+\& printf("%d\en",arr[1]);
+\& }
+.Ve
+.Sp
+A fourth way to avoid this problem is to re-code your
+library to use a functional interface rather than a data interface
+for the offending variables (e.g. \fIset_foo()\fR and \fIget_foo()\fR accessor
+functions).
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-disable\-auto\-import\fR" 4
+.IX Item "--disable-auto-import"
+Do not attempt to do sophisticated linking of \f(CW\*(C`_symbol\*(C'\fR to
+\&\f(CW\*(C`_\|_imp_\|_symbol\*(C'\fR for \s-1DATA\s0 imports from DLLs.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-enable\-runtime\-pseudo\-reloc\fR" 4
+.IX Item "--enable-runtime-pseudo-reloc"
+If your code contains expressions described in \-\-enable\-auto\-import section,
+that is, \s-1DATA\s0 imports from \s-1DLL\s0 with non-zero offset, this switch will create
+a vector of 'runtime pseudo relocations' which can be used by runtime
+environment to adjust references to such data in your client code.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-disable\-runtime\-pseudo\-reloc\fR" 4
+.IX Item "--disable-runtime-pseudo-reloc"
+Do not create pseudo relocations for non-zero offset \s-1DATA\s0 imports from
+DLLs. This is the default.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-enable\-extra\-pe\-debug\fR" 4
+.IX Item "--enable-extra-pe-debug"
+Show additional debug info related to auto-import symbol thunking.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-section\-alignment\fR" 4
+.IX Item "--section-alignment"
+Sets the section alignment. Sections in memory will always begin at
+addresses which are a multiple of this number. Defaults to 0x1000.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-stack\fR \fIreserve\fR" 4
+.IX Item "--stack reserve"
+.PD 0
+.IP "\fB\-\-stack\fR \fIreserve\fR\fB,\fR\fIcommit\fR" 4
+.IX Item "--stack reserve,commit"
+.PD
+Specify the number of bytes of memory to reserve (and optionally commit)
+to be used as stack for this program. The default is 2Mb reserved, 4K
+committed.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-subsystem\fR \fIwhich\fR" 4
+.IX Item "--subsystem which"
+.PD 0
+.IP "\fB\-\-subsystem\fR \fIwhich\fR\fB:\fR\fImajor\fR" 4
+.IX Item "--subsystem which:major"
+.IP "\fB\-\-subsystem\fR \fIwhich\fR\fB:\fR\fImajor\fR\fB.\fR\fIminor\fR" 4
+.IX Item "--subsystem which:major.minor"
+.PD
+Specifies the subsystem under which your program will execute. The
+legal values for \fIwhich\fR are \f(CW\*(C`native\*(C'\fR, \f(CW\*(C`windows\*(C'\fR,
+\&\f(CW\*(C`console\*(C'\fR, \f(CW\*(C`posix\*(C'\fR, and \f(CW\*(C`xbox\*(C'\fR. You may optionally set
+the subsystem version also. Numeric values are also accepted for
+\&\fIwhich\fR.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.Sp
+The following options set flags in the \f(CW\*(C`DllCharacteristics\*(C'\fR field
+of the \s-1PE\s0 file header:
+[These options are specific to \s-1PE\s0 targeted ports of the linker]
+.IP "\fB\-\-dynamicbase\fR" 4
+.IX Item "--dynamicbase"
+The image base address may be relocated using address space layout
+randomization (\s-1ASLR\s0). This feature was introduced with \s-1MS\s0 Windows
+Vista for i386 \s-1PE\s0 targets.
+.IP "\fB\-\-forceinteg\fR" 4
+.IX Item "--forceinteg"
+Code integrity checks are enforced.
+.IP "\fB\-\-nxcompat\fR" 4
+.IX Item "--nxcompat"
+The image is compatible with the Data Execution Prevention.
+This feature was introduced with \s-1MS\s0 Windows \s-1XP\s0 \s-1SP2\s0 for i386 \s-1PE\s0 targets.
+.IP "\fB\-\-no\-isolation\fR" 4
+.IX Item "--no-isolation"
+Although the image understands isolation, do not isolate the image.
+.IP "\fB\-\-no\-seh\fR" 4
+.IX Item "--no-seh"
+The image does not use \s-1SEH\s0. No \s-1SE\s0 handler may be called from
+this image.
+.IP "\fB\-\-no\-bind\fR" 4
+.IX Item "--no-bind"
+Do not bind this image.
+.IP "\fB\-\-wdmdriver\fR" 4
+.IX Item "--wdmdriver"
+The driver uses the \s-1MS\s0 Windows Driver Model.
+.IP "\fB\-\-tsaware\fR" 4
+.IX Item "--tsaware"
+The image is Terminal Server aware.
+.PP
+The 68HC11 and 68HC12 linkers support specific options to control the
+memory bank switching mapping and trampoline code generation.
+.IP "\fB\-\-no\-trampoline\fR" 4
+.IX Item "--no-trampoline"
+This option disables the generation of trampoline. By default a trampoline
+is generated for each far function which is called using a \f(CW\*(C`jsr\*(C'\fR
+instruction (this happens when a pointer to a far function is taken).
+.IP "\fB\-\-bank\-window\fR \fIname\fR" 4
+.IX Item "--bank-window name"
+This option indicates to the linker the name of the memory region in
+the \fB\s-1MEMORY\s0\fR specification that describes the memory bank window.
+The definition of such region is then used by the linker to compute
+paging and addresses within the memory window.
+.PP
+The following options are supported to control handling of \s-1GOT\s0 generation
+when linking for 68K targets.
+.IP "\fB\-\-got=\fR\fItype\fR" 4
+.IX Item "--got=type"
+This option tells the linker which \s-1GOT\s0 generation scheme to use.
+\&\fItype\fR should be one of \fBsingle\fR, \fBnegative\fR,
+\&\fBmultigot\fR or \fBtarget\fR. For more information refer to the
+Info entry for \fIld\fR.
+.SH "ENVIRONMENT"
+.IX Header "ENVIRONMENT"
+You can change the behaviour of \fBld\fR with the environment variables
+\&\f(CW\*(C`GNUTARGET\*(C'\fR,
+\&\f(CW\*(C`LDEMULATION\*(C'\fR and \f(CW\*(C`COLLECT_NO_DEMANGLE\*(C'\fR.
+.PP
+\&\f(CW\*(C`GNUTARGET\*(C'\fR determines the input-file object format if you don't
+use \fB\-b\fR (or its synonym \fB\-\-format\fR). Its value should be one
+of the \s-1BFD\s0 names for an input format. If there is no
+\&\f(CW\*(C`GNUTARGET\*(C'\fR in the environment, \fBld\fR uses the natural format
+of the target. If \f(CW\*(C`GNUTARGET\*(C'\fR is set to \f(CW\*(C`default\*(C'\fR then \s-1BFD\s0
+attempts to discover the input format by examining binary input files;
+this method often succeeds, but there are potential ambiguities, since
+there is no method of ensuring that the magic number used to specify
+object-file formats is unique. However, the configuration procedure for
+\&\s-1BFD\s0 on each system places the conventional format for that system first
+in the search-list, so ambiguities are resolved in favor of convention.
+.PP
+\&\f(CW\*(C`LDEMULATION\*(C'\fR determines the default emulation if you don't use the
+\&\fB\-m\fR option. The emulation can affect various aspects of linker
+behaviour, particularly the default linker script. You can list the
+available emulations with the \fB\-\-verbose\fR or \fB\-V\fR options. If
+the \fB\-m\fR option is not used, and the \f(CW\*(C`LDEMULATION\*(C'\fR environment
+variable is not defined, the default emulation depends upon how the
+linker was configured.
+.PP
+Normally, the linker will default to demangling symbols. However, if
+\&\f(CW\*(C`COLLECT_NO_DEMANGLE\*(C'\fR is set in the environment, then it will
+default to not demangling symbols. This environment variable is used in
+a similar fashion by the \f(CW\*(C`gcc\*(C'\fR linker wrapper program. The default
+may be overridden by the \fB\-\-demangle\fR and \fB\-\-no\-demangle\fR
+options.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fIar\fR\|(1), \fInm\fR\|(1), \fIobjcopy\fR\|(1), \fIobjdump\fR\|(1), \fIreadelf\fR\|(1) and
+the Info entries for \fIbinutils\fR and
+\&\fIld\fR.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, with no Front-Cover Texts, and with no
+Back-Cover Texts. A copy of the license is included in the
+section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-nlmconv.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-nlmconv.1
new file mode 100644
index 0000000..e01a0ca
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-nlmconv.1
@@ -0,0 +1,251 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "NLMCONV 1"
+.TH NLMCONV 1 "2009-10-16" "binutils-2.20" "GNU Development Tools"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+nlmconv \- converts object code into an NLM.
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+nlmconv [\fB\-I\fR \fIbfdname\fR|\fB\-\-input\-target=\fR\fIbfdname\fR]
+ [\fB\-O\fR \fIbfdname\fR|\fB\-\-output\-target=\fR\fIbfdname\fR]
+ [\fB\-T\fR \fIheaderfile\fR|\fB\-\-header\-file=\fR\fIheaderfile\fR]
+ [\fB\-d\fR|\fB\-\-debug\fR] [\fB\-l\fR \fIlinker\fR|\fB\-\-linker=\fR\fIlinker\fR]
+ [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR]
+ \fIinfile\fR \fIoutfile\fR
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+\&\fBnlmconv\fR converts the relocatable \fBi386\fR object file
+\&\fIinfile\fR into the NetWare Loadable Module \fIoutfile\fR, optionally
+reading \fIheaderfile\fR for \s-1NLM\s0 header information. For instructions
+on writing the \s-1NLM\s0 command file language used in header files, see the
+\&\fBlinkers\fR section, \fB\s-1NLMLINK\s0\fR in particular, of the \fI\s-1NLM\s0
+Development and Tools Overview\fR, which is part of the \s-1NLM\s0 Software
+Developer's Kit (\*(L"\s-1NLM\s0 \s-1SDK\s0\*(R"), available from Novell, Inc.
+\&\fBnlmconv\fR uses the \s-1GNU\s0 Binary File Descriptor library to read
+\&\fIinfile\fR;
+.PP
+\&\fBnlmconv\fR can perform a link step. In other words, you can list
+more than one object file for input if you list them in the definitions
+file (rather than simply specifying one input file on the command line).
+In this case, \fBnlmconv\fR calls the linker for you.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+.IP "\fB\-I\fR \fIbfdname\fR" 4
+.IX Item "-I bfdname"
+.PD 0
+.IP "\fB\-\-input\-target=\fR\fIbfdname\fR" 4
+.IX Item "--input-target=bfdname"
+.PD
+Object format of the input file. \fBnlmconv\fR can usually determine
+the format of a given file (so no default is necessary).
+.IP "\fB\-O\fR \fIbfdname\fR" 4
+.IX Item "-O bfdname"
+.PD 0
+.IP "\fB\-\-output\-target=\fR\fIbfdname\fR" 4
+.IX Item "--output-target=bfdname"
+.PD
+Object format of the output file. \fBnlmconv\fR infers the output
+format based on the input format, e.g. for a \fBi386\fR input file the
+output format is \fBnlm32\-i386\fR.
+.IP "\fB\-T\fR \fIheaderfile\fR" 4
+.IX Item "-T headerfile"
+.PD 0
+.IP "\fB\-\-header\-file=\fR\fIheaderfile\fR" 4
+.IX Item "--header-file=headerfile"
+.PD
+Reads \fIheaderfile\fR for \s-1NLM\s0 header information. For instructions on
+writing the \s-1NLM\s0 command file language used in header files, see see the
+\&\fBlinkers\fR section, of the \fI\s-1NLM\s0 Development and Tools
+Overview\fR, which is part of the \s-1NLM\s0 Software Developer's Kit, available
+from Novell, Inc.
+.IP "\fB\-d\fR" 4
+.IX Item "-d"
+.PD 0
+.IP "\fB\-\-debug\fR" 4
+.IX Item "--debug"
+.PD
+Displays (on standard error) the linker command line used by \fBnlmconv\fR.
+.IP "\fB\-l\fR \fIlinker\fR" 4
+.IX Item "-l linker"
+.PD 0
+.IP "\fB\-\-linker=\fR\fIlinker\fR" 4
+.IX Item "--linker=linker"
+.PD
+Use \fIlinker\fR for any linking. \fIlinker\fR can be an absolute or a
+relative pathname.
+.IP "\fB\-h\fR" 4
+.IX Item "-h"
+.PD 0
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
+.PD
+Prints a usage summary.
+.IP "\fB\-V\fR" 4
+.IX Item "-V"
+.PD 0
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+.PD
+Prints the version number for \fBnlmconv\fR.
+.IP "\fB@\fR\fIfile\fR" 4
+.IX Item "@file"
+Read command-line options from \fIfile\fR. The options read are
+inserted in place of the original @\fIfile\fR option. If \fIfile\fR
+does not exist, or cannot be read, then the option will be treated
+literally, and not removed.
+.Sp
+Options in \fIfile\fR are separated by whitespace. A whitespace
+character may be included in an option by surrounding the entire
+option in either single or double quotes. Any character (including a
+backslash) may be included by prefixing the character to be included
+with a backslash. The \fIfile\fR may itself contain additional
+@\fIfile\fR options; any such options will be processed recursively.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+the Info entries for \fIbinutils\fR.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, with no Front-Cover Texts, and with no
+Back-Cover Texts. A copy of the license is included in the
+section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-nm.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-nm.1
new file mode 100644
index 0000000..edee811
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-nm.1
@@ -0,0 +1,523 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "NM 1"
+.TH NM 1 "2009-10-16" "binutils-2.20" "GNU Development Tools"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+nm \- list symbols from object files
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+nm [\fB\-a\fR|\fB\-\-debug\-syms\fR]
+ [\fB\-g\fR|\fB\-\-extern\-only\fR][\fB\-\-plugin\fR \fIname\fR]
+ [\fB\-B\fR] [\fB\-C\fR|\fB\-\-demangle\fR[=\fIstyle\fR]] [\fB\-D\fR|\fB\-\-dynamic\fR]
+ [\fB\-S\fR|\fB\-\-print\-size\fR] [\fB\-s\fR|\fB\-\-print\-armap\fR]
+ [\fB\-A\fR|\fB\-o\fR|\fB\-\-print\-file\-name\fR][\fB\-\-special\-syms\fR]
+ [\fB\-n\fR|\fB\-v\fR|\fB\-\-numeric\-sort\fR] [\fB\-p\fR|\fB\-\-no\-sort\fR]
+ [\fB\-r\fR|\fB\-\-reverse\-sort\fR] [\fB\-\-size\-sort\fR] [\fB\-u\fR|\fB\-\-undefined\-only\fR]
+ [\fB\-t\fR \fIradix\fR|\fB\-\-radix=\fR\fIradix\fR] [\fB\-P\fR|\fB\-\-portability\fR]
+ [\fB\-\-target=\fR\fIbfdname\fR] [\fB\-f\fR\fIformat\fR|\fB\-\-format=\fR\fIformat\fR]
+ [\fB\-\-defined\-only\fR] [\fB\-l\fR|\fB\-\-line\-numbers\fR] [\fB\-\-no\-demangle\fR]
+ [\fB\-V\fR|\fB\-\-version\fR] [\fB\-X 32_64\fR] [\fB\-\-help\fR] [\fIobjfile\fR...]
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+\&\s-1GNU\s0 \fBnm\fR lists the symbols from object files \fIobjfile\fR....
+If no object files are listed as arguments, \fBnm\fR assumes the file
+\&\fIa.out\fR.
+.PP
+For each symbol, \fBnm\fR shows:
+.IP "\(bu" 4
+The symbol value, in the radix selected by options (see below), or
+hexadecimal by default.
+.IP "\(bu" 4
+The symbol type. At least the following types are used; others are, as
+well, depending on the object file format. If lowercase, the symbol is
+local; if uppercase, the symbol is global (external).
+.RS 4
+.ie n .IP """A""" 4
+.el .IP "\f(CWA\fR" 4
+.IX Item "A"
+The symbol's value is absolute, and will not be changed by further
+linking.
+.ie n .IP """B""" 4
+.el .IP "\f(CWB\fR" 4
+.IX Item "B"
+.PD 0
+.ie n .IP """b""" 4
+.el .IP "\f(CWb\fR" 4
+.IX Item "b"
+.PD
+The symbol is in the uninitialized data section (known as \s-1BSS\s0).
+.ie n .IP """C""" 4
+.el .IP "\f(CWC\fR" 4
+.IX Item "C"
+The symbol is common. Common symbols are uninitialized data. When
+linking, multiple common symbols may appear with the same name. If the
+symbol is defined anywhere, the common symbols are treated as undefined
+references.
+.ie n .IP """D""" 4
+.el .IP "\f(CWD\fR" 4
+.IX Item "D"
+.PD 0
+.ie n .IP """d""" 4
+.el .IP "\f(CWd\fR" 4
+.IX Item "d"
+.PD
+The symbol is in the initialized data section.
+.ie n .IP """G""" 4
+.el .IP "\f(CWG\fR" 4
+.IX Item "G"
+.PD 0
+.ie n .IP """g""" 4
+.el .IP "\f(CWg\fR" 4
+.IX Item "g"
+.PD
+The symbol is in an initialized data section for small objects. Some
+object file formats permit more efficient access to small data objects,
+such as a global int variable as opposed to a large global array.
+.ie n .IP """i""" 4
+.el .IP "\f(CWi\fR" 4
+.IX Item "i"
+For \s-1PE\s0 format files this indicates that the symbol is in a section
+specific to the implementation of DLLs. For \s-1ELF\s0 format files this
+indicates that the symbol is an indirect function. This is a \s-1GNU\s0
+extension to the standard set of \s-1ELF\s0 symbol types. It indicates a
+symbol which if referenced by a relocation does not evaluate to its
+address, but instead must be invoked at runtime. The runtime
+execution will then return the value to be used in the relocation.
+.ie n .IP """N""" 4
+.el .IP "\f(CWN\fR" 4
+.IX Item "N"
+The symbol is a debugging symbol.
+.ie n .IP """p""" 4
+.el .IP "\f(CWp\fR" 4
+.IX Item "p"
+The symbols is in a stack unwind section.
+.ie n .IP """R""" 4
+.el .IP "\f(CWR\fR" 4
+.IX Item "R"
+.PD 0
+.ie n .IP """r""" 4
+.el .IP "\f(CWr\fR" 4
+.IX Item "r"
+.PD
+The symbol is in a read only data section.
+.ie n .IP """S""" 4
+.el .IP "\f(CWS\fR" 4
+.IX Item "S"
+.PD 0
+.ie n .IP """s""" 4
+.el .IP "\f(CWs\fR" 4
+.IX Item "s"
+.PD
+The symbol is in an uninitialized data section for small objects.
+.ie n .IP """T""" 4
+.el .IP "\f(CWT\fR" 4
+.IX Item "T"
+.PD 0
+.ie n .IP """t""" 4
+.el .IP "\f(CWt\fR" 4
+.IX Item "t"
+.PD
+The symbol is in the text (code) section.
+.ie n .IP """U""" 4
+.el .IP "\f(CWU\fR" 4
+.IX Item "U"
+The symbol is undefined.
+.ie n .IP """u""" 4
+.el .IP "\f(CWu\fR" 4
+.IX Item "u"
+The symbol is a unique global symbol. This is a \s-1GNU\s0 extension to the
+standard set of \s-1ELF\s0 symbol bindings. For such a symbol the dynamic linker
+will make sure that in the entire process there is just one symbol with
+this name and type in use.
+.ie n .IP """V""" 4
+.el .IP "\f(CWV\fR" 4
+.IX Item "V"
+.PD 0
+.ie n .IP """v""" 4
+.el .IP "\f(CWv\fR" 4
+.IX Item "v"
+.PD
+The symbol is a weak object. When a weak defined symbol is linked with
+a normal defined symbol, the normal defined symbol is used with no error.
+When a weak undefined symbol is linked and the symbol is not defined,
+the value of the weak symbol becomes zero with no error. On some
+systems, uppercase indicates that a default value has been specified.
+.ie n .IP """W""" 4
+.el .IP "\f(CWW\fR" 4
+.IX Item "W"
+.PD 0
+.ie n .IP """w""" 4
+.el .IP "\f(CWw\fR" 4
+.IX Item "w"
+.PD
+The symbol is a weak symbol that has not been specifically tagged as a
+weak object symbol. When a weak defined symbol is linked with a normal
+defined symbol, the normal defined symbol is used with no error.
+When a weak undefined symbol is linked and the symbol is not defined,
+the value of the symbol is determined in a system-specific manner without
+error. On some systems, uppercase indicates that a default value has been
+specified.
+.ie n .IP """\-""" 4
+.el .IP "\f(CW\-\fR" 4
+.IX Item "-"
+The symbol is a stabs symbol in an a.out object file. In this case, the
+next values printed are the stabs other field, the stabs desc field, and
+the stab type. Stabs symbols are used to hold debugging information.
+.ie n .IP """?""" 4
+.el .IP "\f(CW?\fR" 4
+.IX Item "?"
+The symbol type is unknown, or object file format specific.
+.RE
+.RS 4
+.RE
+.IP "\(bu" 4
+The symbol name.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+The long and short forms of options, shown here as alternatives, are
+equivalent.
+.IP "\fB\-A\fR" 4
+.IX Item "-A"
+.PD 0
+.IP "\fB\-o\fR" 4
+.IX Item "-o"
+.IP "\fB\-\-print\-file\-name\fR" 4
+.IX Item "--print-file-name"
+.PD
+Precede each symbol by the name of the input file (or archive member)
+in which it was found, rather than identifying the input file once only,
+before all of its symbols.
+.IP "\fB\-a\fR" 4
+.IX Item "-a"
+.PD 0
+.IP "\fB\-\-debug\-syms\fR" 4
+.IX Item "--debug-syms"
+.PD
+Display all symbols, even debugger-only symbols; normally these are not
+listed.
+.IP "\fB\-B\fR" 4
+.IX Item "-B"
+The same as \fB\-\-format=bsd\fR (for compatibility with the \s-1MIPS\s0 \fBnm\fR).
+.IP "\fB\-C\fR" 4
+.IX Item "-C"
+.PD 0
+.IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4
+.IX Item "--demangle[=style]"
+.PD
+Decode (\fIdemangle\fR) low-level symbol names into user-level names.
+Besides removing any initial underscore prepended by the system, this
+makes \*(C+ function names readable. Different compilers have different
+mangling styles. The optional demangling style argument can be used to
+choose an appropriate demangling style for your compiler.
+.IP "\fB\-\-no\-demangle\fR" 4
+.IX Item "--no-demangle"
+Do not demangle low-level symbol names. This is the default.
+.IP "\fB\-D\fR" 4
+.IX Item "-D"
+.PD 0
+.IP "\fB\-\-dynamic\fR" 4
+.IX Item "--dynamic"
+.PD
+Display the dynamic symbols rather than the normal symbols. This is
+only meaningful for dynamic objects, such as certain types of shared
+libraries.
+.IP "\fB\-f\fR \fIformat\fR" 4
+.IX Item "-f format"
+.PD 0
+.IP "\fB\-\-format=\fR\fIformat\fR" 4
+.IX Item "--format=format"
+.PD
+Use the output format \fIformat\fR, which can be \f(CW\*(C`bsd\*(C'\fR,
+\&\f(CW\*(C`sysv\*(C'\fR, or \f(CW\*(C`posix\*(C'\fR. The default is \f(CW\*(C`bsd\*(C'\fR.
+Only the first character of \fIformat\fR is significant; it can be
+either upper or lower case.
+.IP "\fB\-g\fR" 4
+.IX Item "-g"
+.PD 0
+.IP "\fB\-\-extern\-only\fR" 4
+.IX Item "--extern-only"
+.PD
+Display only external symbols.
+.IP "\fB\-\-plugin\fR \fIname\fR" 4
+.IX Item "--plugin name"
+Load the plugin called \fIname\fR to add support for extra target
+types. This option is only available if the toolchain has been built
+with plugin support enabled.
+.IP "\fB\-l\fR" 4
+.IX Item "-l"
+.PD 0
+.IP "\fB\-\-line\-numbers\fR" 4
+.IX Item "--line-numbers"
+.PD
+For each symbol, use debugging information to try to find a filename and
+line number. For a defined symbol, look for the line number of the
+address of the symbol. For an undefined symbol, look for the line
+number of a relocation entry which refers to the symbol. If line number
+information can be found, print it after the other symbol information.
+.IP "\fB\-n\fR" 4
+.IX Item "-n"
+.PD 0
+.IP "\fB\-v\fR" 4
+.IX Item "-v"
+.IP "\fB\-\-numeric\-sort\fR" 4
+.IX Item "--numeric-sort"
+.PD
+Sort symbols numerically by their addresses, rather than alphabetically
+by their names.
+.IP "\fB\-p\fR" 4
+.IX Item "-p"
+.PD 0
+.IP "\fB\-\-no\-sort\fR" 4
+.IX Item "--no-sort"
+.PD
+Do not bother to sort the symbols in any order; print them in the order
+encountered.
+.IP "\fB\-P\fR" 4
+.IX Item "-P"
+.PD 0
+.IP "\fB\-\-portability\fR" 4
+.IX Item "--portability"
+.PD
+Use the \s-1POSIX\s0.2 standard output format instead of the default format.
+Equivalent to \fB\-f posix\fR.
+.IP "\fB\-S\fR" 4
+.IX Item "-S"
+.PD 0
+.IP "\fB\-\-print\-size\fR" 4
+.IX Item "--print-size"
+.PD
+Print both value and size of defined symbols for the \f(CW\*(C`bsd\*(C'\fR output style.
+This option has no effect for object formats that do not record symbol
+sizes, unless \fB\-\-size\-sort\fR is also used in which case a
+calculated size is displayed.
+.IP "\fB\-s\fR" 4
+.IX Item "-s"
+.PD 0
+.IP "\fB\-\-print\-armap\fR" 4
+.IX Item "--print-armap"
+.PD
+When listing symbols from archive members, include the index: a mapping
+(stored in the archive by \fBar\fR or \fBranlib\fR) of which modules
+contain definitions for which names.
+.IP "\fB\-r\fR" 4
+.IX Item "-r"
+.PD 0
+.IP "\fB\-\-reverse\-sort\fR" 4
+.IX Item "--reverse-sort"
+.PD
+Reverse the order of the sort (whether numeric or alphabetic); let the
+last come first.
+.IP "\fB\-\-size\-sort\fR" 4
+.IX Item "--size-sort"
+Sort symbols by size. The size is computed as the difference between
+the value of the symbol and the value of the symbol with the next higher
+value. If the \f(CW\*(C`bsd\*(C'\fR output format is used the size of the symbol
+is printed, rather than the value, and \fB\-S\fR must be used in order
+both size and value to be printed.
+.IP "\fB\-\-special\-syms\fR" 4
+.IX Item "--special-syms"
+Display symbols which have a target-specific special meaning. These
+symbols are usually used by the target for some special processing and
+are not normally helpful when included included in the normal symbol
+lists. For example for \s-1ARM\s0 targets this option would skip the mapping
+symbols used to mark transitions between \s-1ARM\s0 code, \s-1THUMB\s0 code and
+data.
+.IP "\fB\-t\fR \fIradix\fR" 4
+.IX Item "-t radix"
+.PD 0
+.IP "\fB\-\-radix=\fR\fIradix\fR" 4
+.IX Item "--radix=radix"
+.PD
+Use \fIradix\fR as the radix for printing the symbol values. It must be
+\&\fBd\fR for decimal, \fBo\fR for octal, or \fBx\fR for hexadecimal.
+.IP "\fB\-\-target=\fR\fIbfdname\fR" 4
+.IX Item "--target=bfdname"
+Specify an object code format other than your system's default format.
+.IP "\fB\-u\fR" 4
+.IX Item "-u"
+.PD 0
+.IP "\fB\-\-undefined\-only\fR" 4
+.IX Item "--undefined-only"
+.PD
+Display only undefined symbols (those external to each object file).
+.IP "\fB\-\-defined\-only\fR" 4
+.IX Item "--defined-only"
+Display only defined symbols for each object file.
+.IP "\fB\-V\fR" 4
+.IX Item "-V"
+.PD 0
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+.PD
+Show the version number of \fBnm\fR and exit.
+.IP "\fB\-X\fR" 4
+.IX Item "-X"
+This option is ignored for compatibility with the \s-1AIX\s0 version of
+\&\fBnm\fR. It takes one parameter which must be the string
+\&\fB32_64\fR. The default mode of \s-1AIX\s0 \fBnm\fR corresponds
+to \fB\-X 32\fR, which is not supported by \s-1GNU\s0 \fBnm\fR.
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
+Show a summary of the options to \fBnm\fR and exit.
+.IP "\fB@\fR\fIfile\fR" 4
+.IX Item "@file"
+Read command-line options from \fIfile\fR. The options read are
+inserted in place of the original @\fIfile\fR option. If \fIfile\fR
+does not exist, or cannot be read, then the option will be treated
+literally, and not removed.
+.Sp
+Options in \fIfile\fR are separated by whitespace. A whitespace
+character may be included in an option by surrounding the entire
+option in either single or double quotes. Any character (including a
+backslash) may be included by prefixing the character to be included
+with a backslash. The \fIfile\fR may itself contain additional
+@\fIfile\fR options; any such options will be processed recursively.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fIar\fR\|(1), \fIobjdump\fR\|(1), \fIranlib\fR\|(1), and the Info entries for \fIbinutils\fR.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, with no Front-Cover Texts, and with no
+Back-Cover Texts. A copy of the license is included in the
+section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-objcopy.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-objcopy.1
new file mode 100644
index 0000000..cc041c0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-objcopy.1
@@ -0,0 +1,935 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "OBJCOPY 1"
+.TH OBJCOPY 1 "2009-10-16" "binutils-2.20" "GNU Development Tools"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+objcopy \- copy and translate object files
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+objcopy [\fB\-F\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR]
+ [\fB\-I\fR \fIbfdname\fR|\fB\-\-input\-target=\fR\fIbfdname\fR]
+ [\fB\-O\fR \fIbfdname\fR|\fB\-\-output\-target=\fR\fIbfdname\fR]
+ [\fB\-B\fR \fIbfdarch\fR|\fB\-\-binary\-architecture=\fR\fIbfdarch\fR]
+ [\fB\-S\fR|\fB\-\-strip\-all\fR]
+ [\fB\-g\fR|\fB\-\-strip\-debug\fR]
+ [\fB\-K\fR \fIsymbolname\fR|\fB\-\-keep\-symbol=\fR\fIsymbolname\fR]
+ [\fB\-N\fR \fIsymbolname\fR|\fB\-\-strip\-symbol=\fR\fIsymbolname\fR]
+ [\fB\-\-strip\-unneeded\-symbol=\fR\fIsymbolname\fR]
+ [\fB\-G\fR \fIsymbolname\fR|\fB\-\-keep\-global\-symbol=\fR\fIsymbolname\fR]
+ [\fB\-\-localize\-hidden\fR]
+ [\fB\-L\fR \fIsymbolname\fR|\fB\-\-localize\-symbol=\fR\fIsymbolname\fR]
+ [\fB\-\-globalize\-symbol=\fR\fIsymbolname\fR]
+ [\fB\-W\fR \fIsymbolname\fR|\fB\-\-weaken\-symbol=\fR\fIsymbolname\fR]
+ [\fB\-w\fR|\fB\-\-wildcard\fR]
+ [\fB\-x\fR|\fB\-\-discard\-all\fR]
+ [\fB\-X\fR|\fB\-\-discard\-locals\fR]
+ [\fB\-b\fR \fIbyte\fR|\fB\-\-byte=\fR\fIbyte\fR]
+ [\fB\-i\fR \fIinterleave\fR|\fB\-\-interleave=\fR\fIinterleave\fR]
+ [\fB\-j\fR \fIsectionname\fR|\fB\-\-only\-section=\fR\fIsectionname\fR]
+ [\fB\-R\fR \fIsectionname\fR|\fB\-\-remove\-section=\fR\fIsectionname\fR]
+ [\fB\-p\fR|\fB\-\-preserve\-dates\fR]
+ [\fB\-\-debugging\fR]
+ [\fB\-\-gap\-fill=\fR\fIval\fR]
+ [\fB\-\-pad\-to=\fR\fIaddress\fR]
+ [\fB\-\-set\-start=\fR\fIval\fR]
+ [\fB\-\-adjust\-start=\fR\fIincr\fR]
+ [\fB\-\-change\-addresses=\fR\fIincr\fR]
+ [\fB\-\-change\-section\-address\fR \fIsection\fR{=,+,\-}\fIval\fR]
+ [\fB\-\-change\-section\-lma\fR \fIsection\fR{=,+,\-}\fIval\fR]
+ [\fB\-\-change\-section\-vma\fR \fIsection\fR{=,+,\-}\fIval\fR]
+ [\fB\-\-change\-warnings\fR] [\fB\-\-no\-change\-warnings\fR]
+ [\fB\-\-set\-section\-flags\fR \fIsection\fR=\fIflags\fR]
+ [\fB\-\-add\-section\fR \fIsectionname\fR=\fIfilename\fR]
+ [\fB\-\-rename\-section\fR \fIoldname\fR=\fInewname\fR[,\fIflags\fR]]
+ [\fB\-\-long\-section\-names\fR {enable,disable,keep}]
+ [\fB\-\-change\-leading\-char\fR] [\fB\-\-remove\-leading\-char\fR]
+ [\fB\-\-reverse\-bytes=\fR\fInum\fR]
+ [\fB\-\-srec\-len=\fR\fIival\fR] [\fB\-\-srec\-forceS3\fR]
+ [\fB\-\-redefine\-sym\fR \fIold\fR=\fInew\fR]
+ [\fB\-\-redefine\-syms=\fR\fIfilename\fR]
+ [\fB\-\-weaken\fR]
+ [\fB\-\-keep\-symbols=\fR\fIfilename\fR]
+ [\fB\-\-strip\-symbols=\fR\fIfilename\fR]
+ [\fB\-\-strip\-unneeded\-symbols=\fR\fIfilename\fR]
+ [\fB\-\-keep\-global\-symbols=\fR\fIfilename\fR]
+ [\fB\-\-localize\-symbols=\fR\fIfilename\fR]
+ [\fB\-\-globalize\-symbols=\fR\fIfilename\fR]
+ [\fB\-\-weaken\-symbols=\fR\fIfilename\fR]
+ [\fB\-\-alt\-machine\-code=\fR\fIindex\fR]
+ [\fB\-\-prefix\-symbols=\fR\fIstring\fR]
+ [\fB\-\-prefix\-sections=\fR\fIstring\fR]
+ [\fB\-\-prefix\-alloc\-sections=\fR\fIstring\fR]
+ [\fB\-\-add\-gnu\-debuglink=\fR\fIpath-to-file\fR]
+ [\fB\-\-keep\-file\-symbols\fR]
+ [\fB\-\-only\-keep\-debug\fR]
+ [\fB\-\-extract\-symbol\fR]
+ [\fB\-\-writable\-text\fR]
+ [\fB\-\-readonly\-text\fR]
+ [\fB\-\-pure\fR]
+ [\fB\-\-impure\fR]
+ [\fB\-\-file\-alignment=\fR\fInum\fR]
+ [\fB\-\-heap=\fR\fIsize\fR]
+ [\fB\-\-image\-base=\fR\fIaddress\fR]
+ [\fB\-\-section\-alignment=\fR\fInum\fR]
+ [\fB\-\-stack=\fR\fIsize\fR]
+ [\fB\-\-subsystem=\fR\fIwhich\fR:\fImajor\fR.\fIminor\fR]
+ [\fB\-v\fR|\fB\-\-verbose\fR]
+ [\fB\-V\fR|\fB\-\-version\fR]
+ [\fB\-\-help\fR] [\fB\-\-info\fR]
+ \fIinfile\fR [\fIoutfile\fR]
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+The \s-1GNU\s0 \fBobjcopy\fR utility copies the contents of an object
+file to another. \fBobjcopy\fR uses the \s-1GNU\s0 \s-1BFD\s0 Library to
+read and write the object files. It can write the destination object
+file in a format different from that of the source object file. The
+exact behavior of \fBobjcopy\fR is controlled by command-line options.
+Note that \fBobjcopy\fR should be able to copy a fully linked file
+between any two formats. However, copying a relocatable object file
+between any two formats may not work as expected.
+.PP
+\&\fBobjcopy\fR creates temporary files to do its translations and
+deletes them afterward. \fBobjcopy\fR uses \s-1BFD\s0 to do all its
+translation work; it has access to all the formats described in \s-1BFD\s0
+and thus is able to recognize most formats without being told
+explicitly.
+.PP
+\&\fBobjcopy\fR can be used to generate S\-records by using an output
+target of \fBsrec\fR (e.g., use \fB\-O srec\fR).
+.PP
+\&\fBobjcopy\fR can be used to generate a raw binary file by using an
+output target of \fBbinary\fR (e.g., use \fB\-O binary\fR). When
+\&\fBobjcopy\fR generates a raw binary file, it will essentially produce
+a memory dump of the contents of the input object file. All symbols and
+relocation information will be discarded. The memory dump will start at
+the load address of the lowest section copied into the output file.
+.PP
+When generating an S\-record or a raw binary file, it may be helpful to
+use \fB\-S\fR to remove sections containing debugging information. In
+some cases \fB\-R\fR will be useful to remove sections which contain
+information that is not needed by the binary file.
+.PP
+Note\-\-\-\fBobjcopy\fR is not able to change the endianness of its input
+files. If the input format has an endianness (some formats do not),
+\&\fBobjcopy\fR can only copy the inputs into file formats that have the
+same endianness or which have no endianness (e.g., \fBsrec\fR).
+(However, see the \fB\-\-reverse\-bytes\fR option.)
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+.IP "\fIinfile\fR" 4
+.IX Item "infile"
+.PD 0
+.IP "\fIoutfile\fR" 4
+.IX Item "outfile"
+.PD
+The input and output files, respectively.
+If you do not specify \fIoutfile\fR, \fBobjcopy\fR creates a
+temporary file and destructively renames the result with
+the name of \fIinfile\fR.
+.IP "\fB\-I\fR \fIbfdname\fR" 4
+.IX Item "-I bfdname"
+.PD 0
+.IP "\fB\-\-input\-target=\fR\fIbfdname\fR" 4
+.IX Item "--input-target=bfdname"
+.PD
+Consider the source file's object format to be \fIbfdname\fR, rather than
+attempting to deduce it.
+.IP "\fB\-O\fR \fIbfdname\fR" 4
+.IX Item "-O bfdname"
+.PD 0
+.IP "\fB\-\-output\-target=\fR\fIbfdname\fR" 4
+.IX Item "--output-target=bfdname"
+.PD
+Write the output file using the object format \fIbfdname\fR.
+.IP "\fB\-F\fR \fIbfdname\fR" 4
+.IX Item "-F bfdname"
+.PD 0
+.IP "\fB\-\-target=\fR\fIbfdname\fR" 4
+.IX Item "--target=bfdname"
+.PD
+Use \fIbfdname\fR as the object format for both the input and the output
+file; i.e., simply transfer data from source to destination with no
+translation.
+.IP "\fB\-B\fR \fIbfdarch\fR" 4
+.IX Item "-B bfdarch"
+.PD 0
+.IP "\fB\-\-binary\-architecture=\fR\fIbfdarch\fR" 4
+.IX Item "--binary-architecture=bfdarch"
+.PD
+Useful when transforming a raw binary input file into an object file.
+In this case the output architecture can be set to \fIbfdarch\fR. This
+option will be ignored if the input file has a known \fIbfdarch\fR. You
+can access this binary data inside a program by referencing the special
+symbols that are created by the conversion process. These symbols are
+called _binary_\fIobjfile\fR_start, _binary_\fIobjfile\fR_end and
+_binary_\fIobjfile\fR_size. e.g. you can transform a picture file into
+an object file and then access it in your code using these symbols.
+.IP "\fB\-j\fR \fIsectionname\fR" 4
+.IX Item "-j sectionname"
+.PD 0
+.IP "\fB\-\-only\-section=\fR\fIsectionname\fR" 4
+.IX Item "--only-section=sectionname"
+.PD
+Copy only the named section from the input file to the output file.
+This option may be given more than once. Note that using this option
+inappropriately may make the output file unusable.
+.IP "\fB\-R\fR \fIsectionname\fR" 4
+.IX Item "-R sectionname"
+.PD 0
+.IP "\fB\-\-remove\-section=\fR\fIsectionname\fR" 4
+.IX Item "--remove-section=sectionname"
+.PD
+Remove any section named \fIsectionname\fR from the output file. This
+option may be given more than once. Note that using this option
+inappropriately may make the output file unusable.
+.IP "\fB\-S\fR" 4
+.IX Item "-S"
+.PD 0
+.IP "\fB\-\-strip\-all\fR" 4
+.IX Item "--strip-all"
+.PD
+Do not copy relocation and symbol information from the source file.
+.IP "\fB\-g\fR" 4
+.IX Item "-g"
+.PD 0
+.IP "\fB\-\-strip\-debug\fR" 4
+.IX Item "--strip-debug"
+.PD
+Do not copy debugging symbols or sections from the source file.
+.IP "\fB\-\-strip\-unneeded\fR" 4
+.IX Item "--strip-unneeded"
+Strip all symbols that are not needed for relocation processing.
+.IP "\fB\-K\fR \fIsymbolname\fR" 4
+.IX Item "-K symbolname"
+.PD 0
+.IP "\fB\-\-keep\-symbol=\fR\fIsymbolname\fR" 4
+.IX Item "--keep-symbol=symbolname"
+.PD
+When stripping symbols, keep symbol \fIsymbolname\fR even if it would
+normally be stripped. This option may be given more than once.
+.IP "\fB\-N\fR \fIsymbolname\fR" 4
+.IX Item "-N symbolname"
+.PD 0
+.IP "\fB\-\-strip\-symbol=\fR\fIsymbolname\fR" 4
+.IX Item "--strip-symbol=symbolname"
+.PD
+Do not copy symbol \fIsymbolname\fR from the source file. This option
+may be given more than once.
+.IP "\fB\-\-strip\-unneeded\-symbol=\fR\fIsymbolname\fR" 4
+.IX Item "--strip-unneeded-symbol=symbolname"
+Do not copy symbol \fIsymbolname\fR from the source file unless it is needed
+by a relocation. This option may be given more than once.
+.IP "\fB\-G\fR \fIsymbolname\fR" 4
+.IX Item "-G symbolname"
+.PD 0
+.IP "\fB\-\-keep\-global\-symbol=\fR\fIsymbolname\fR" 4
+.IX Item "--keep-global-symbol=symbolname"
+.PD
+Keep only symbol \fIsymbolname\fR global. Make all other symbols local
+to the file, so that they are not visible externally. This option may
+be given more than once.
+.IP "\fB\-\-localize\-hidden\fR" 4
+.IX Item "--localize-hidden"
+In an \s-1ELF\s0 object, mark all symbols that have hidden or internal visibility
+as local. This option applies on top of symbol-specific localization options
+such as \fB\-L\fR.
+.IP "\fB\-L\fR \fIsymbolname\fR" 4
+.IX Item "-L symbolname"
+.PD 0
+.IP "\fB\-\-localize\-symbol=\fR\fIsymbolname\fR" 4
+.IX Item "--localize-symbol=symbolname"
+.PD
+Make symbol \fIsymbolname\fR local to the file, so that it is not
+visible externally. This option may be given more than once.
+.IP "\fB\-W\fR \fIsymbolname\fR" 4
+.IX Item "-W symbolname"
+.PD 0
+.IP "\fB\-\-weaken\-symbol=\fR\fIsymbolname\fR" 4
+.IX Item "--weaken-symbol=symbolname"
+.PD
+Make symbol \fIsymbolname\fR weak. This option may be given more than once.
+.IP "\fB\-\-globalize\-symbol=\fR\fIsymbolname\fR" 4
+.IX Item "--globalize-symbol=symbolname"
+Give symbol \fIsymbolname\fR global scoping so that it is visible
+outside of the file in which it is defined. This option may be given
+more than once.
+.IP "\fB\-w\fR" 4
+.IX Item "-w"
+.PD 0
+.IP "\fB\-\-wildcard\fR" 4
+.IX Item "--wildcard"
+.PD
+Permit regular expressions in \fIsymbolname\fRs used in other command
+line options. The question mark (?), asterisk (*), backslash (\e) and
+square brackets ([]) operators can be used anywhere in the symbol
+name. If the first character of the symbol name is the exclamation
+point (!) then the sense of the switch is reversed for that symbol.
+For example:
+.Sp
+.Vb 1
+\& \-w \-W !foo \-W fo*
+.Ve
+.Sp
+would cause objcopy to weaken all symbols that start with \*(L"fo\*(R"
+except for the symbol \*(L"foo\*(R".
+.IP "\fB\-x\fR" 4
+.IX Item "-x"
+.PD 0
+.IP "\fB\-\-discard\-all\fR" 4
+.IX Item "--discard-all"
+.PD
+Do not copy non-global symbols from the source file.
+.IP "\fB\-X\fR" 4
+.IX Item "-X"
+.PD 0
+.IP "\fB\-\-discard\-locals\fR" 4
+.IX Item "--discard-locals"
+.PD
+Do not copy compiler-generated local symbols.
+(These usually start with \fBL\fR or \fB.\fR.)
+.IP "\fB\-b\fR \fIbyte\fR" 4
+.IX Item "-b byte"
+.PD 0
+.IP "\fB\-\-byte=\fR\fIbyte\fR" 4
+.IX Item "--byte=byte"
+.PD
+Keep only every \fIbyte\fRth byte of the input file (header data is not
+affected). \fIbyte\fR can be in the range from 0 to \fIinterleave\fR\-1,
+where \fIinterleave\fR is given by the \fB\-i\fR or \fB\-\-interleave\fR
+option, or the default of 4. This option is useful for creating files
+to program \s-1ROM\s0. It is typically used with an \f(CW\*(C`srec\*(C'\fR output
+target.
+.IP "\fB\-i\fR \fIinterleave\fR" 4
+.IX Item "-i interleave"
+.PD 0
+.IP "\fB\-\-interleave=\fR\fIinterleave\fR" 4
+.IX Item "--interleave=interleave"
+.PD
+Only copy one out of every \fIinterleave\fR bytes. Select which byte to
+copy with the \fB\-b\fR or \fB\-\-byte\fR option. The default is 4.
+\&\fBobjcopy\fR ignores this option if you do not specify either \fB\-b\fR or
+\&\fB\-\-byte\fR.
+.IP "\fB\-p\fR" 4
+.IX Item "-p"
+.PD 0
+.IP "\fB\-\-preserve\-dates\fR" 4
+.IX Item "--preserve-dates"
+.PD
+Set the access and modification dates of the output file to be the same
+as those of the input file.
+.IP "\fB\-\-debugging\fR" 4
+.IX Item "--debugging"
+Convert debugging information, if possible. This is not the default
+because only certain debugging formats are supported, and the
+conversion process can be time consuming.
+.IP "\fB\-\-gap\-fill\fR \fIval\fR" 4
+.IX Item "--gap-fill val"
+Fill gaps between sections with \fIval\fR. This operation applies to
+the \fIload address\fR (\s-1LMA\s0) of the sections. It is done by increasing
+the size of the section with the lower address, and filling in the extra
+space created with \fIval\fR.
+.IP "\fB\-\-pad\-to\fR \fIaddress\fR" 4
+.IX Item "--pad-to address"
+Pad the output file up to the load address \fIaddress\fR. This is
+done by increasing the size of the last section. The extra space is
+filled in with the value specified by \fB\-\-gap\-fill\fR (default zero).
+.IP "\fB\-\-set\-start\fR \fIval\fR" 4
+.IX Item "--set-start val"
+Set the start address of the new file to \fIval\fR. Not all object file
+formats support setting the start address.
+.IP "\fB\-\-change\-start\fR \fIincr\fR" 4
+.IX Item "--change-start incr"
+.PD 0
+.IP "\fB\-\-adjust\-start\fR \fIincr\fR" 4
+.IX Item "--adjust-start incr"
+.PD
+Change the start address by adding \fIincr\fR. Not all object file
+formats support setting the start address.
+.IP "\fB\-\-change\-addresses\fR \fIincr\fR" 4
+.IX Item "--change-addresses incr"
+.PD 0
+.IP "\fB\-\-adjust\-vma\fR \fIincr\fR" 4
+.IX Item "--adjust-vma incr"
+.PD
+Change the \s-1VMA\s0 and \s-1LMA\s0 addresses of all sections, as well as the start
+address, by adding \fIincr\fR. Some object file formats do not permit
+section addresses to be changed arbitrarily. Note that this does not
+relocate the sections; if the program expects sections to be loaded at a
+certain address, and this option is used to change the sections such
+that they are loaded at a different address, the program may fail.
+.IP "\fB\-\-change\-section\-address\fR \fIsection\fR\fB{=,+,\-}\fR\fIval\fR" 4
+.IX Item "--change-section-address section{=,+,-}val"
+.PD 0
+.IP "\fB\-\-adjust\-section\-vma\fR \fIsection\fR\fB{=,+,\-}\fR\fIval\fR" 4
+.IX Item "--adjust-section-vma section{=,+,-}val"
+.PD
+Set or change both the \s-1VMA\s0 address and the \s-1LMA\s0 address of the named
+\&\fIsection\fR. If \fB=\fR is used, the section address is set to
+\&\fIval\fR. Otherwise, \fIval\fR is added to or subtracted from the
+section address. See the comments under \fB\-\-change\-addresses\fR,
+above. If \fIsection\fR does not exist in the input file, a warning will
+be issued, unless \fB\-\-no\-change\-warnings\fR is used.
+.IP "\fB\-\-change\-section\-lma\fR \fIsection\fR\fB{=,+,\-}\fR\fIval\fR" 4
+.IX Item "--change-section-lma section{=,+,-}val"
+Set or change the \s-1LMA\s0 address of the named \fIsection\fR. The \s-1LMA\s0
+address is the address where the section will be loaded into memory at
+program load time. Normally this is the same as the \s-1VMA\s0 address, which
+is the address of the section at program run time, but on some systems,
+especially those where a program is held in \s-1ROM\s0, the two can be
+different. If \fB=\fR is used, the section address is set to
+\&\fIval\fR. Otherwise, \fIval\fR is added to or subtracted from the
+section address. See the comments under \fB\-\-change\-addresses\fR,
+above. If \fIsection\fR does not exist in the input file, a warning
+will be issued, unless \fB\-\-no\-change\-warnings\fR is used.
+.IP "\fB\-\-change\-section\-vma\fR \fIsection\fR\fB{=,+,\-}\fR\fIval\fR" 4
+.IX Item "--change-section-vma section{=,+,-}val"
+Set or change the \s-1VMA\s0 address of the named \fIsection\fR. The \s-1VMA\s0
+address is the address where the section will be located once the
+program has started executing. Normally this is the same as the \s-1LMA\s0
+address, which is the address where the section will be loaded into
+memory, but on some systems, especially those where a program is held in
+\&\s-1ROM\s0, the two can be different. If \fB=\fR is used, the section address
+is set to \fIval\fR. Otherwise, \fIval\fR is added to or subtracted
+from the section address. See the comments under
+\&\fB\-\-change\-addresses\fR, above. If \fIsection\fR does not exist in
+the input file, a warning will be issued, unless
+\&\fB\-\-no\-change\-warnings\fR is used.
+.IP "\fB\-\-change\-warnings\fR" 4
+.IX Item "--change-warnings"
+.PD 0
+.IP "\fB\-\-adjust\-warnings\fR" 4
+.IX Item "--adjust-warnings"
+.PD
+If \fB\-\-change\-section\-address\fR or \fB\-\-change\-section\-lma\fR or
+\&\fB\-\-change\-section\-vma\fR is used, and the named section does not
+exist, issue a warning. This is the default.
+.IP "\fB\-\-no\-change\-warnings\fR" 4
+.IX Item "--no-change-warnings"
+.PD 0
+.IP "\fB\-\-no\-adjust\-warnings\fR" 4
+.IX Item "--no-adjust-warnings"
+.PD
+Do not issue a warning if \fB\-\-change\-section\-address\fR or
+\&\fB\-\-adjust\-section\-lma\fR or \fB\-\-adjust\-section\-vma\fR is used, even
+if the named section does not exist.
+.IP "\fB\-\-set\-section\-flags\fR \fIsection\fR\fB=\fR\fIflags\fR" 4
+.IX Item "--set-section-flags section=flags"
+Set the flags for the named section. The \fIflags\fR argument is a
+comma separated string of flag names. The recognized names are
+\&\fBalloc\fR, \fBcontents\fR, \fBload\fR, \fBnoload\fR,
+\&\fBreadonly\fR, \fBcode\fR, \fBdata\fR, \fBrom\fR, \fBshare\fR, and
+\&\fBdebug\fR. You can set the \fBcontents\fR flag for a section which
+does not have contents, but it is not meaningful to clear the
+\&\fBcontents\fR flag of a section which does have contents\*(--just remove
+the section instead. Not all flags are meaningful for all object file
+formats.
+.IP "\fB\-\-add\-section\fR \fIsectionname\fR\fB=\fR\fIfilename\fR" 4
+.IX Item "--add-section sectionname=filename"
+Add a new section named \fIsectionname\fR while copying the file. The
+contents of the new section are taken from the file \fIfilename\fR. The
+size of the section will be the size of the file. This option only
+works on file formats which can support sections with arbitrary names.
+.IP "\fB\-\-rename\-section\fR \fIoldname\fR\fB=\fR\fInewname\fR\fB[,\fR\fIflags\fR\fB]\fR" 4
+.IX Item "--rename-section oldname=newname[,flags]"
+Rename a section from \fIoldname\fR to \fInewname\fR, optionally
+changing the section's flags to \fIflags\fR in the process. This has
+the advantage over usng a linker script to perform the rename in that
+the output stays as an object file and does not become a linked
+executable.
+.Sp
+This option is particularly helpful when the input format is binary,
+since this will always create a section called .data. If for example,
+you wanted instead to create a section called .rodata containing binary
+data you could use the following command line to achieve it:
+.Sp
+.Vb 3
+\& objcopy \-I binary \-O <output_format> \-B <architecture> \e
+\& \-\-rename\-section .data=.rodata,alloc,load,readonly,data,contents \e
+\& <input_binary_file> <output_object_file>
+.Ve
+.IP "\fB\-\-long\-section\-names {enable,disable,keep}\fR" 4
+.IX Item "--long-section-names {enable,disable,keep}"
+Controls the handling of long section names when processing \f(CW\*(C`COFF\*(C'\fR
+and \f(CW\*(C`PE\-COFF\*(C'\fR object formats. The default behaviour, \fBkeep\fR,
+is to preserve long section names if any are present in the input file.
+The \fBenable\fR and \fBdisable\fR options forcibly enable or disable
+the use of long section names in the output object; when \fBdisable\fR
+is in effect, any long section names in the input object will be truncated.
+The \fBenable\fR option will only emit long section names if any are
+present in the inputs; this is mostly the same as \fBkeep\fR, but it
+is left undefined whether the \fBenable\fR option might force the
+creation of an empty string table in the output file.
+.IP "\fB\-\-change\-leading\-char\fR" 4
+.IX Item "--change-leading-char"
+Some object file formats use special characters at the start of
+symbols. The most common such character is underscore, which compilers
+often add before every symbol. This option tells \fBobjcopy\fR to
+change the leading character of every symbol when it converts between
+object file formats. If the object file formats use the same leading
+character, this option has no effect. Otherwise, it will add a
+character, or remove a character, or change a character, as
+appropriate.
+.IP "\fB\-\-remove\-leading\-char\fR" 4
+.IX Item "--remove-leading-char"
+If the first character of a global symbol is a special symbol leading
+character used by the object file format, remove the character. The
+most common symbol leading character is underscore. This option will
+remove a leading underscore from all global symbols. This can be useful
+if you want to link together objects of different file formats with
+different conventions for symbol names. This is different from
+\&\fB\-\-change\-leading\-char\fR because it always changes the symbol name
+when appropriate, regardless of the object file format of the output
+file.
+.IP "\fB\-\-reverse\-bytes=\fR\fInum\fR" 4
+.IX Item "--reverse-bytes=num"
+Reverse the bytes in a section with output contents. A section length must
+be evenly divisible by the value given in order for the swap to be able to
+take place. Reversing takes place before the interleaving is performed.
+.Sp
+This option is used typically in generating \s-1ROM\s0 images for problematic
+target systems. For example, on some target boards, the 32\-bit words
+fetched from 8\-bit ROMs are re-assembled in little-endian byte order
+regardless of the \s-1CPU\s0 byte order. Depending on the programming model, the
+endianness of the \s-1ROM\s0 may need to be modified.
+.Sp
+Consider a simple file with a section containing the following eight
+bytes: \f(CW12345678\fR.
+.Sp
+Using \fB\-\-reverse\-bytes=2\fR for the above example, the bytes in the
+output file would be ordered \f(CW21436587\fR.
+.Sp
+Using \fB\-\-reverse\-bytes=4\fR for the above example, the bytes in the
+output file would be ordered \f(CW43218765\fR.
+.Sp
+By using \fB\-\-reverse\-bytes=2\fR for the above example, followed by
+\&\fB\-\-reverse\-bytes=4\fR on the output file, the bytes in the second
+output file would be ordered \f(CW34127856\fR.
+.IP "\fB\-\-srec\-len=\fR\fIival\fR" 4
+.IX Item "--srec-len=ival"
+Meaningful only for srec output. Set the maximum length of the Srecords
+being produced to \fIival\fR. This length covers both address, data and
+crc fields.
+.IP "\fB\-\-srec\-forceS3\fR" 4
+.IX Item "--srec-forceS3"
+Meaningful only for srec output. Avoid generation of S1/S2 records,
+creating S3\-only record format.
+.IP "\fB\-\-redefine\-sym\fR \fIold\fR\fB=\fR\fInew\fR" 4
+.IX Item "--redefine-sym old=new"
+Change the name of a symbol \fIold\fR, to \fInew\fR. This can be useful
+when one is trying link two things together for which you have no
+source, and there are name collisions.
+.IP "\fB\-\-redefine\-syms=\fR\fIfilename\fR" 4
+.IX Item "--redefine-syms=filename"
+Apply \fB\-\-redefine\-sym\fR to each symbol pair "\fIold\fR \fInew\fR"
+listed in the file \fIfilename\fR. \fIfilename\fR is simply a flat file,
+with one symbol pair per line. Line comments may be introduced by the hash
+character. This option may be given more than once.
+.IP "\fB\-\-weaken\fR" 4
+.IX Item "--weaken"
+Change all global symbols in the file to be weak. This can be useful
+when building an object which will be linked against other objects using
+the \fB\-R\fR option to the linker. This option is only effective when
+using an object file format which supports weak symbols.
+.IP "\fB\-\-keep\-symbols=\fR\fIfilename\fR" 4
+.IX Item "--keep-symbols=filename"
+Apply \fB\-\-keep\-symbol\fR option to each symbol listed in the file
+\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol
+name per line. Line comments may be introduced by the hash character.
+This option may be given more than once.
+.IP "\fB\-\-strip\-symbols=\fR\fIfilename\fR" 4
+.IX Item "--strip-symbols=filename"
+Apply \fB\-\-strip\-symbol\fR option to each symbol listed in the file
+\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol
+name per line. Line comments may be introduced by the hash character.
+This option may be given more than once.
+.IP "\fB\-\-strip\-unneeded\-symbols=\fR\fIfilename\fR" 4
+.IX Item "--strip-unneeded-symbols=filename"
+Apply \fB\-\-strip\-unneeded\-symbol\fR option to each symbol listed in
+the file \fIfilename\fR. \fIfilename\fR is simply a flat file, with one
+symbol name per line. Line comments may be introduced by the hash
+character. This option may be given more than once.
+.IP "\fB\-\-keep\-global\-symbols=\fR\fIfilename\fR" 4
+.IX Item "--keep-global-symbols=filename"
+Apply \fB\-\-keep\-global\-symbol\fR option to each symbol listed in the
+file \fIfilename\fR. \fIfilename\fR is simply a flat file, with one
+symbol name per line. Line comments may be introduced by the hash
+character. This option may be given more than once.
+.IP "\fB\-\-localize\-symbols=\fR\fIfilename\fR" 4
+.IX Item "--localize-symbols=filename"
+Apply \fB\-\-localize\-symbol\fR option to each symbol listed in the file
+\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol
+name per line. Line comments may be introduced by the hash character.
+This option may be given more than once.
+.IP "\fB\-\-globalize\-symbols=\fR\fIfilename\fR" 4
+.IX Item "--globalize-symbols=filename"
+Apply \fB\-\-globalize\-symbol\fR option to each symbol listed in the file
+\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol
+name per line. Line comments may be introduced by the hash character.
+This option may be given more than once.
+.IP "\fB\-\-weaken\-symbols=\fR\fIfilename\fR" 4
+.IX Item "--weaken-symbols=filename"
+Apply \fB\-\-weaken\-symbol\fR option to each symbol listed in the file
+\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol
+name per line. Line comments may be introduced by the hash character.
+This option may be given more than once.
+.IP "\fB\-\-alt\-machine\-code=\fR\fIindex\fR" 4
+.IX Item "--alt-machine-code=index"
+If the output architecture has alternate machine codes, use the
+\&\fIindex\fRth code instead of the default one. This is useful in case
+a machine is assigned an official code and the tool-chain adopts the
+new code, but other applications still depend on the original code
+being used. For \s-1ELF\s0 based architectures if the \fIindex\fR
+alternative does not exist then the value is treated as an absolute
+number to be stored in the e_machine field of the \s-1ELF\s0 header.
+.IP "\fB\-\-writable\-text\fR" 4
+.IX Item "--writable-text"
+Mark the output text as writable. This option isn't meaningful for all
+object file formats.
+.IP "\fB\-\-readonly\-text\fR" 4
+.IX Item "--readonly-text"
+Make the output text write protected. This option isn't meaningful for all
+object file formats.
+.IP "\fB\-\-pure\fR" 4
+.IX Item "--pure"
+Mark the output file as demand paged. This option isn't meaningful for all
+object file formats.
+.IP "\fB\-\-impure\fR" 4
+.IX Item "--impure"
+Mark the output file as impure. This option isn't meaningful for all
+object file formats.
+.IP "\fB\-\-prefix\-symbols=\fR\fIstring\fR" 4
+.IX Item "--prefix-symbols=string"
+Prefix all symbols in the output file with \fIstring\fR.
+.IP "\fB\-\-prefix\-sections=\fR\fIstring\fR" 4
+.IX Item "--prefix-sections=string"
+Prefix all section names in the output file with \fIstring\fR.
+.IP "\fB\-\-prefix\-alloc\-sections=\fR\fIstring\fR" 4
+.IX Item "--prefix-alloc-sections=string"
+Prefix all the names of all allocated sections in the output file with
+\&\fIstring\fR.
+.IP "\fB\-\-add\-gnu\-debuglink=\fR\fIpath-to-file\fR" 4
+.IX Item "--add-gnu-debuglink=path-to-file"
+Creates a .gnu_debuglink section which contains a reference to \fIpath-to-file\fR
+and adds it to the output file.
+.IP "\fB\-\-keep\-file\-symbols\fR" 4
+.IX Item "--keep-file-symbols"
+When stripping a file, perhaps with \fB\-\-strip\-debug\fR or
+\&\fB\-\-strip\-unneeded\fR, retain any symbols specifying source file names,
+which would otherwise get stripped.
+.IP "\fB\-\-only\-keep\-debug\fR" 4
+.IX Item "--only-keep-debug"
+Strip a file, removing contents of any sections that would not be
+stripped by \fB\-\-strip\-debug\fR and leaving the debugging sections
+intact. In \s-1ELF\s0 files, this preserves all note sections in the output.
+.Sp
+The intention is that this option will be used in conjunction with
+\&\fB\-\-add\-gnu\-debuglink\fR to create a two part executable. One a
+stripped binary which will occupy less space in \s-1RAM\s0 and in a
+distribution and the second a debugging information file which is only
+needed if debugging abilities are required. The suggested procedure
+to create these files is as follows:
+.RS 4
+.IP "1.<Link the executable as normal. Assuming that is is called>" 4
+.IX Item "1.<Link the executable as normal. Assuming that is is called>"
+\&\f(CW\*(C`foo\*(C'\fR then...
+.ie n .IP "1.<Run ""objcopy \-\-only\-keep\-debug foo foo.dbg"" to>" 4
+.el .IP "1.<Run \f(CWobjcopy \-\-only\-keep\-debug foo foo.dbg\fR to>" 4
+.IX Item "1.<Run objcopy --only-keep-debug foo foo.dbg to>"
+create a file containing the debugging info.
+.ie n .IP "1.<Run ""objcopy \-\-strip\-debug foo"" to create a>" 4
+.el .IP "1.<Run \f(CWobjcopy \-\-strip\-debug foo\fR to create a>" 4
+.IX Item "1.<Run objcopy --strip-debug foo to create a>"
+stripped executable.
+.ie n .IP "1.<Run ""objcopy \-\-add\-gnu\-debuglink=foo.dbg foo"">" 4
+.el .IP "1.<Run \f(CWobjcopy \-\-add\-gnu\-debuglink=foo.dbg foo\fR>" 4
+.IX Item "1.<Run objcopy --add-gnu-debuglink=foo.dbg foo>"
+to add a link to the debugging info into the stripped executable.
+.RE
+.RS 4
+.Sp
+Note\-\-\-the choice of \f(CW\*(C`.dbg\*(C'\fR as an extension for the debug info
+file is arbitrary. Also the \f(CW\*(C`\-\-only\-keep\-debug\*(C'\fR step is
+optional. You could instead do this:
+.IP "1.<Link the executable as normal.>" 4
+.IX Item "1.<Link the executable as normal.>"
+.PD 0
+.ie n .IP "1.<Copy ""foo""\fR to \f(CW""foo.full"">" 4
+.el .IP "1.<Copy \f(CWfoo\fR to \f(CWfoo.full\fR>" 4
+.IX Item "1.<Copy foo to foo.full>"
+.ie n .IP "1.<Run ""objcopy \-\-strip\-debug foo"">" 4
+.el .IP "1.<Run \f(CWobjcopy \-\-strip\-debug foo\fR>" 4
+.IX Item "1.<Run objcopy --strip-debug foo>"
+.ie n .IP "1.<Run ""objcopy \-\-add\-gnu\-debuglink=foo.full foo"">" 4
+.el .IP "1.<Run \f(CWobjcopy \-\-add\-gnu\-debuglink=foo.full foo\fR>" 4
+.IX Item "1.<Run objcopy --add-gnu-debuglink=foo.full foo>"
+.RE
+.RS 4
+.PD
+.Sp
+i.e., the file pointed to by the \fB\-\-add\-gnu\-debuglink\fR can be the
+full executable. It does not have to be a file created by the
+\&\fB\-\-only\-keep\-debug\fR switch.
+.Sp
+Note\-\-\-this switch is only intended for use on fully linked files. It
+does not make sense to use it on object files where the debugging
+information may be incomplete. Besides the gnu_debuglink feature
+currently only supports the presence of one filename containing
+debugging information, not multiple filenames on a one-per-object-file
+basis.
+.RE
+.IP "\fB\-\-file\-alignment\fR \fInum\fR" 4
+.IX Item "--file-alignment num"
+Specify the file alignment. Sections in the file will always begin at
+file offsets which are multiples of this number. This defaults to
+512.
+[This option is specific to \s-1PE\s0 targets.]
+.IP "\fB\-\-heap\fR \fIreserve\fR" 4
+.IX Item "--heap reserve"
+.PD 0
+.IP "\fB\-\-heap\fR \fIreserve\fR\fB,\fR\fIcommit\fR" 4
+.IX Item "--heap reserve,commit"
+.PD
+Specify the number of bytes of memory to reserve (and optionally commit)
+to be used as heap for this program.
+[This option is specific to \s-1PE\s0 targets.]
+.IP "\fB\-\-image\-base\fR \fIvalue\fR" 4
+.IX Item "--image-base value"
+Use \fIvalue\fR as the base address of your program or dll. This is
+the lowest memory location that will be used when your program or dll
+is loaded. To reduce the need to relocate and improve performance of
+your dlls, each should have a unique base address and not overlap any
+other dlls. The default is 0x400000 for executables, and 0x10000000
+for dlls.
+[This option is specific to \s-1PE\s0 targets.]
+.IP "\fB\-\-section\-alignment\fR \fInum\fR" 4
+.IX Item "--section-alignment num"
+Sets the section alignment. Sections in memory will always begin at
+addresses which are a multiple of this number. Defaults to 0x1000.
+[This option is specific to \s-1PE\s0 targets.]
+.IP "\fB\-\-stack\fR \fIreserve\fR" 4
+.IX Item "--stack reserve"
+.PD 0
+.IP "\fB\-\-stack\fR \fIreserve\fR\fB,\fR\fIcommit\fR" 4
+.IX Item "--stack reserve,commit"
+.PD
+Specify the number of bytes of memory to reserve (and optionally commit)
+to be used as stack for this program.
+[This option is specific to \s-1PE\s0 targets.]
+.IP "\fB\-\-subsystem\fR \fIwhich\fR" 4
+.IX Item "--subsystem which"
+.PD 0
+.IP "\fB\-\-subsystem\fR \fIwhich\fR\fB:\fR\fImajor\fR" 4
+.IX Item "--subsystem which:major"
+.IP "\fB\-\-subsystem\fR \fIwhich\fR\fB:\fR\fImajor\fR\fB.\fR\fIminor\fR" 4
+.IX Item "--subsystem which:major.minor"
+.PD
+Specifies the subsystem under which your program will execute. The
+legal values for \fIwhich\fR are \f(CW\*(C`native\*(C'\fR, \f(CW\*(C`windows\*(C'\fR,
+\&\f(CW\*(C`console\*(C'\fR, \f(CW\*(C`posix\*(C'\fR, \f(CW\*(C`efi\-app\*(C'\fR, \f(CW\*(C`efi\-bsd\*(C'\fR,
+\&\f(CW\*(C`efi\-rtd\*(C'\fR, \f(CW\*(C`sal\-rtd\*(C'\fR, and \f(CW\*(C`xbox\*(C'\fR. You may optionally set
+the subsystem version also. Numeric values are also accepted for
+\&\fIwhich\fR.
+[This option is specific to \s-1PE\s0 targets.]
+.IP "\fB\-\-extract\-symbol\fR" 4
+.IX Item "--extract-symbol"
+Keep the file's section flags and symbols but remove all section data.
+Specifically, the option:
+.RS 4
+.IP "*<removes the contents of all sections;>" 4
+.IX Item "*<removes the contents of all sections;>"
+.PD 0
+.IP "*<sets the size of every section to zero; and>" 4
+.IX Item "*<sets the size of every section to zero; and>"
+.IP "*<sets the file's start address to zero.>" 4
+.IX Item "*<sets the file's start address to zero.>"
+.RE
+.RS 4
+.PD
+.Sp
+This option is used to build a \fI.sym\fR file for a VxWorks kernel.
+It can also be a useful way of reducing the size of a \fB\-\-just\-symbols\fR
+linker input file.
+.RE
+.IP "\fB\-V\fR" 4
+.IX Item "-V"
+.PD 0
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+.PD
+Show the version number of \fBobjcopy\fR.
+.IP "\fB\-v\fR" 4
+.IX Item "-v"
+.PD 0
+.IP "\fB\-\-verbose\fR" 4
+.IX Item "--verbose"
+.PD
+Verbose output: list all object files modified. In the case of
+archives, \fBobjcopy \-V\fR lists all members of the archive.
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
+Show a summary of the options to \fBobjcopy\fR.
+.IP "\fB\-\-info\fR" 4
+.IX Item "--info"
+Display a list showing all architectures and object formats available.
+.IP "\fB@\fR\fIfile\fR" 4
+.IX Item "@file"
+Read command-line options from \fIfile\fR. The options read are
+inserted in place of the original @\fIfile\fR option. If \fIfile\fR
+does not exist, or cannot be read, then the option will be treated
+literally, and not removed.
+.Sp
+Options in \fIfile\fR are separated by whitespace. A whitespace
+character may be included in an option by surrounding the entire
+option in either single or double quotes. Any character (including a
+backslash) may be included by prefixing the character to be included
+with a backslash. The \fIfile\fR may itself contain additional
+@\fIfile\fR options; any such options will be processed recursively.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fIld\fR\|(1), \fIobjdump\fR\|(1), and the Info entries for \fIbinutils\fR.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, with no Front-Cover Texts, and with no
+Back-Cover Texts. A copy of the license is included in the
+section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-objdump.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-objdump.1
new file mode 100644
index 0000000..3c0298d
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-objdump.1
@@ -0,0 +1,803 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "OBJDUMP 1"
+.TH OBJDUMP 1 "2009-10-16" "binutils-2.20" "GNU Development Tools"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+objdump \- display information from object files.
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+objdump [\fB\-a\fR|\fB\-\-archive\-headers\fR]
+ [\fB\-b\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR]
+ [\fB\-C\fR|\fB\-\-demangle\fR[=\fIstyle\fR] ]
+ [\fB\-d\fR|\fB\-\-disassemble\fR]
+ [\fB\-D\fR|\fB\-\-disassemble\-all\fR]
+ [\fB\-z\fR|\fB\-\-disassemble\-zeroes\fR]
+ [\fB\-EB\fR|\fB\-EL\fR|\fB\-\-endian=\fR{big | little }]
+ [\fB\-f\fR|\fB\-\-file\-headers\fR]
+ [\fB\-F\fR|\fB\-\-file\-offsets\fR]
+ [\fB\-\-file\-start\-context\fR]
+ [\fB\-g\fR|\fB\-\-debugging\fR]
+ [\fB\-e\fR|\fB\-\-debugging\-tags\fR]
+ [\fB\-h\fR|\fB\-\-section\-headers\fR|\fB\-\-headers\fR]
+ [\fB\-i\fR|\fB\-\-info\fR]
+ [\fB\-j\fR \fIsection\fR|\fB\-\-section=\fR\fIsection\fR]
+ [\fB\-l\fR|\fB\-\-line\-numbers\fR]
+ [\fB\-S\fR|\fB\-\-source\fR]
+ [\fB\-m\fR \fImachine\fR|\fB\-\-architecture=\fR\fImachine\fR]
+ [\fB\-M\fR \fIoptions\fR|\fB\-\-disassembler\-options=\fR\fIoptions\fR]
+ [\fB\-p\fR|\fB\-\-private\-headers\fR]
+ [\fB\-r\fR|\fB\-\-reloc\fR]
+ [\fB\-R\fR|\fB\-\-dynamic\-reloc\fR]
+ [\fB\-s\fR|\fB\-\-full\-contents\fR]
+ [\fB\-W[lLiaprmfFsoR]\fR|
+ \fB\-\-dwarf\fR[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames\-interp,=str,=loc,=Ranges]]
+ [\fB\-G\fR|\fB\-\-stabs\fR]
+ [\fB\-t\fR|\fB\-\-syms\fR]
+ [\fB\-T\fR|\fB\-\-dynamic\-syms\fR]
+ [\fB\-x\fR|\fB\-\-all\-headers\fR]
+ [\fB\-w\fR|\fB\-\-wide\fR]
+ [\fB\-\-start\-address=\fR\fIaddress\fR]
+ [\fB\-\-stop\-address=\fR\fIaddress\fR]
+ [\fB\-\-prefix\-addresses\fR]
+ [\fB\-\-[no\-]show\-raw\-insn\fR]
+ [\fB\-\-adjust\-vma=\fR\fIoffset\fR]
+ [\fB\-\-special\-syms\fR]
+ [\fB\-\-prefix=\fR\fIprefix\fR]
+ [\fB\-\-prefix\-strip=\fR\fIlevel\fR]
+ [\fB\-\-insn\-width=\fR\fIwidth\fR]
+ [\fB\-V\fR|\fB\-\-version\fR]
+ [\fB\-H\fR|\fB\-\-help\fR]
+ \fIobjfile\fR...
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+\&\fBobjdump\fR displays information about one or more object files.
+The options control what particular information to display. This
+information is mostly useful to programmers who are working on the
+compilation tools, as opposed to programmers who just want their
+program to compile and work.
+.PP
+\&\fIobjfile\fR... are the object files to be examined. When you
+specify archives, \fBobjdump\fR shows information on each of the member
+object files.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+The long and short forms of options, shown here as alternatives, are
+equivalent. At least one option from the list
+\&\fB\-a,\-d,\-D,\-e,\-f,\-g,\-G,\-h,\-H,\-p,\-r,\-R,\-s,\-S,\-t,\-T,\-V,\-x\fR must be given.
+.IP "\fB\-a\fR" 4
+.IX Item "-a"
+.PD 0
+.IP "\fB\-\-archive\-header\fR" 4
+.IX Item "--archive-header"
+.PD
+If any of the \fIobjfile\fR files are archives, display the archive
+header information (in a format similar to \fBls \-l\fR). Besides the
+information you could list with \fBar tv\fR, \fBobjdump \-a\fR shows
+the object file format of each archive member.
+.IP "\fB\-\-adjust\-vma=\fR\fIoffset\fR" 4
+.IX Item "--adjust-vma=offset"
+When dumping information, first add \fIoffset\fR to all the section
+addresses. This is useful if the section addresses do not correspond to
+the symbol table, which can happen when putting sections at particular
+addresses when using a format which can not represent section addresses,
+such as a.out.
+.IP "\fB\-b\fR \fIbfdname\fR" 4
+.IX Item "-b bfdname"
+.PD 0
+.IP "\fB\-\-target=\fR\fIbfdname\fR" 4
+.IX Item "--target=bfdname"
+.PD
+Specify that the object-code format for the object files is
+\&\fIbfdname\fR. This option may not be necessary; \fIobjdump\fR can
+automatically recognize many formats.
+.Sp
+For example,
+.Sp
+.Vb 1
+\& objdump \-b oasys \-m vax \-h fu.o
+.Ve
+.Sp
+displays summary information from the section headers (\fB\-h\fR) of
+\&\fIfu.o\fR, which is explicitly identified (\fB\-m\fR) as a \s-1VAX\s0 object
+file in the format produced by Oasys compilers. You can list the
+formats available with the \fB\-i\fR option.
+.IP "\fB\-C\fR" 4
+.IX Item "-C"
+.PD 0
+.IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4
+.IX Item "--demangle[=style]"
+.PD
+Decode (\fIdemangle\fR) low-level symbol names into user-level names.
+Besides removing any initial underscore prepended by the system, this
+makes \*(C+ function names readable. Different compilers have different
+mangling styles. The optional demangling style argument can be used to
+choose an appropriate demangling style for your compiler.
+.IP "\fB\-g\fR" 4
+.IX Item "-g"
+.PD 0
+.IP "\fB\-\-debugging\fR" 4
+.IX Item "--debugging"
+.PD
+Display debugging information. This attempts to parse \s-1STABS\s0 and \s-1IEEE\s0
+debugging format information stored in the file and print it out using
+a C like syntax. If neither of these formats are found this option
+falls back on the \fB\-W\fR option to print any \s-1DWARF\s0 information in
+the file.
+.IP "\fB\-e\fR" 4
+.IX Item "-e"
+.PD 0
+.IP "\fB\-\-debugging\-tags\fR" 4
+.IX Item "--debugging-tags"
+.PD
+Like \fB\-g\fR, but the information is generated in a format compatible
+with ctags tool.
+.IP "\fB\-d\fR" 4
+.IX Item "-d"
+.PD 0
+.IP "\fB\-\-disassemble\fR" 4
+.IX Item "--disassemble"
+.PD
+Display the assembler mnemonics for the machine instructions from
+\&\fIobjfile\fR. This option only disassembles those sections which are
+expected to contain instructions.
+.IP "\fB\-D\fR" 4
+.IX Item "-D"
+.PD 0
+.IP "\fB\-\-disassemble\-all\fR" 4
+.IX Item "--disassemble-all"
+.PD
+Like \fB\-d\fR, but disassemble the contents of all sections, not just
+those expected to contain instructions.
+.Sp
+If the target is an \s-1ARM\s0 architecture this switch also has the effect
+of forcing the disassembler to decode pieces of data found in code
+sections as if they were instructions.
+.IP "\fB\-\-prefix\-addresses\fR" 4
+.IX Item "--prefix-addresses"
+When disassembling, print the complete address on each line. This is
+the older disassembly format.
+.IP "\fB\-EB\fR" 4
+.IX Item "-EB"
+.PD 0
+.IP "\fB\-EL\fR" 4
+.IX Item "-EL"
+.IP "\fB\-\-endian={big|little}\fR" 4
+.IX Item "--endian={big|little}"
+.PD
+Specify the endianness of the object files. This only affects
+disassembly. This can be useful when disassembling a file format which
+does not describe endianness information, such as S\-records.
+.IP "\fB\-f\fR" 4
+.IX Item "-f"
+.PD 0
+.IP "\fB\-\-file\-headers\fR" 4
+.IX Item "--file-headers"
+.PD
+Display summary information from the overall header of
+each of the \fIobjfile\fR files.
+.IP "\fB\-F\fR" 4
+.IX Item "-F"
+.PD 0
+.IP "\fB\-\-file\-offsets\fR" 4
+.IX Item "--file-offsets"
+.PD
+When disassembling sections, whenever a symbol is displayed, also
+display the file offset of the region of data that is about to be
+dumped. If zeroes are being skipped, then when disassembly resumes,
+tell the user how many zeroes were skipped and the file offset of the
+location from where the disassembly resumes. When dumping sections,
+display the file offset of the location from where the dump starts.
+.IP "\fB\-\-file\-start\-context\fR" 4
+.IX Item "--file-start-context"
+Specify that when displaying interlisted source code/disassembly
+(assumes \fB\-S\fR) from a file that has not yet been displayed, extend the
+context to the start of the file.
+.IP "\fB\-h\fR" 4
+.IX Item "-h"
+.PD 0
+.IP "\fB\-\-section\-headers\fR" 4
+.IX Item "--section-headers"
+.IP "\fB\-\-headers\fR" 4
+.IX Item "--headers"
+.PD
+Display summary information from the section headers of the
+object file.
+.Sp
+File segments may be relocated to nonstandard addresses, for example by
+using the \fB\-Ttext\fR, \fB\-Tdata\fR, or \fB\-Tbss\fR options to
+\&\fBld\fR. However, some object file formats, such as a.out, do not
+store the starting address of the file segments. In those situations,
+although \fBld\fR relocates the sections correctly, using \fBobjdump
+\&\-h\fR to list the file section headers cannot show the correct addresses.
+Instead, it shows the usual addresses, which are implicit for the
+target.
+.IP "\fB\-H\fR" 4
+.IX Item "-H"
+.PD 0
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
+.PD
+Print a summary of the options to \fBobjdump\fR and exit.
+.IP "\fB\-i\fR" 4
+.IX Item "-i"
+.PD 0
+.IP "\fB\-\-info\fR" 4
+.IX Item "--info"
+.PD
+Display a list showing all architectures and object formats available
+for specification with \fB\-b\fR or \fB\-m\fR.
+.IP "\fB\-j\fR \fIname\fR" 4
+.IX Item "-j name"
+.PD 0
+.IP "\fB\-\-section=\fR\fIname\fR" 4
+.IX Item "--section=name"
+.PD
+Display information only for section \fIname\fR.
+.IP "\fB\-l\fR" 4
+.IX Item "-l"
+.PD 0
+.IP "\fB\-\-line\-numbers\fR" 4
+.IX Item "--line-numbers"
+.PD
+Label the display (using debugging information) with the filename and
+source line numbers corresponding to the object code or relocs shown.
+Only useful with \fB\-d\fR, \fB\-D\fR, or \fB\-r\fR.
+.IP "\fB\-m\fR \fImachine\fR" 4
+.IX Item "-m machine"
+.PD 0
+.IP "\fB\-\-architecture=\fR\fImachine\fR" 4
+.IX Item "--architecture=machine"
+.PD
+Specify the architecture to use when disassembling object files. This
+can be useful when disassembling object files which do not describe
+architecture information, such as S\-records. You can list the available
+architectures with the \fB\-i\fR option.
+.Sp
+If the target is an \s-1ARM\s0 architecture then this switch has an
+additional effect. It restricts the disassembly to only those
+instructions supported by the architecture specified by \fImachine\fR.
+If it is necessary to use this switch because the input file does not
+contain any architecture information, but it is also desired to
+disassemble all the instructions use \fB\-marm\fR.
+.IP "\fB\-M\fR \fIoptions\fR" 4
+.IX Item "-M options"
+.PD 0
+.IP "\fB\-\-disassembler\-options=\fR\fIoptions\fR" 4
+.IX Item "--disassembler-options=options"
+.PD
+Pass target specific information to the disassembler. Only supported on
+some targets. If it is necessary to specify more than one
+disassembler option then multiple \fB\-M\fR options can be used or
+can be placed together into a comma separated list.
+.Sp
+If the target is an \s-1ARM\s0 architecture then this switch can be used to
+select which register name set is used during disassembler. Specifying
+\&\fB\-M reg-names-std\fR (the default) will select the register names as
+used in \s-1ARM\s0's instruction set documentation, but with register 13 called
+\&'sp', register 14 called 'lr' and register 15 called 'pc'. Specifying
+\&\fB\-M reg-names-apcs\fR will select the name set used by the \s-1ARM\s0
+Procedure Call Standard, whilst specifying \fB\-M reg-names-raw\fR will
+just use \fBr\fR followed by the register number.
+.Sp
+There are also two variants on the \s-1APCS\s0 register naming scheme enabled
+by \fB\-M reg-names-atpcs\fR and \fB\-M reg-names-special-atpcs\fR which
+use the ARM/Thumb Procedure Call Standard naming conventions. (Either
+with the normal register names or the special register names).
+.Sp
+This option can also be used for \s-1ARM\s0 architectures to force the
+disassembler to interpret all instructions as Thumb instructions by
+using the switch \fB\-\-disassembler\-options=force\-thumb\fR. This can be
+useful when attempting to disassemble thumb code produced by other
+compilers.
+.Sp
+For the x86, some of the options duplicate functions of the \fB\-m\fR
+switch, but allow finer grained control. Multiple selections from the
+following may be specified as a comma separated string.
+\&\fBx86\-64\fR, \fBi386\fR and \fBi8086\fR select disassembly for
+the given architecture. \fBintel\fR and \fBatt\fR select between
+intel syntax mode and \s-1AT&T\s0 syntax mode.
+\&\fBintel-mnemonic\fR and \fBatt-mnemonic\fR select between
+intel mnemonic mode and \s-1AT&T\s0 mnemonic mode. \fBintel-mnemonic\fR
+implies \fBintel\fR and \fBatt-mnemonic\fR implies \fBatt\fR.
+\&\fBaddr64\fR, \fBaddr32\fR,
+\&\fBaddr16\fR, \fBdata32\fR and \fBdata16\fR specify the default
+address size and operand size. These four options will be overridden if
+\&\fBx86\-64\fR, \fBi386\fR or \fBi8086\fR appear later in the
+option string. Lastly, \fBsuffix\fR, when in \s-1AT&T\s0 mode,
+instructs the disassembler to print a mnemonic suffix even when the
+suffix could be inferred by the operands.
+.Sp
+For PowerPC, \fBbooke\fR controls the disassembly of BookE
+instructions. \fB32\fR and \fB64\fR select PowerPC and
+PowerPC64 disassembly, respectively. \fBe300\fR selects
+disassembly for the e300 family. \fB440\fR selects disassembly for
+the PowerPC 440. \fBppcps\fR selects disassembly for the paired
+single instructions of the \s-1PPC750CL\s0.
+.Sp
+For \s-1MIPS\s0, this option controls the printing of instruction mnemonic
+names and register names in disassembled instructions. Multiple
+selections from the following may be specified as a comma separated
+string, and invalid options are ignored:
+.RS 4
+.ie n .IP """no\-aliases""" 4
+.el .IP "\f(CWno\-aliases\fR" 4
+.IX Item "no-aliases"
+Print the 'raw' instruction mnemonic instead of some pseudo
+instruction mnemonic. I.e., print 'daddu' or 'or' instead of 'move',
+\&'sll' instead of 'nop', etc.
+.ie n .IP """gpr\-names=\f(CIABI\f(CW""" 4
+.el .IP "\f(CWgpr\-names=\f(CIABI\f(CW\fR" 4
+.IX Item "gpr-names=ABI"
+Print \s-1GPR\s0 (general-purpose register) names as appropriate
+for the specified \s-1ABI\s0. By default, \s-1GPR\s0 names are selected according to
+the \s-1ABI\s0 of the binary being disassembled.
+.ie n .IP """fpr\-names=\f(CIABI\f(CW""" 4
+.el .IP "\f(CWfpr\-names=\f(CIABI\f(CW\fR" 4
+.IX Item "fpr-names=ABI"
+Print \s-1FPR\s0 (floating-point register) names as
+appropriate for the specified \s-1ABI\s0. By default, \s-1FPR\s0 numbers are printed
+rather than names.
+.ie n .IP """cp0\-names=\f(CIARCH\f(CW""" 4
+.el .IP "\f(CWcp0\-names=\f(CIARCH\f(CW\fR" 4
+.IX Item "cp0-names=ARCH"
+Print \s-1CP0\s0 (system control coprocessor; coprocessor 0) register names
+as appropriate for the \s-1CPU\s0 or architecture specified by
+\&\fI\s-1ARCH\s0\fR. By default, \s-1CP0\s0 register names are selected according to
+the architecture and \s-1CPU\s0 of the binary being disassembled.
+.ie n .IP """hwr\-names=\f(CIARCH\f(CW""" 4
+.el .IP "\f(CWhwr\-names=\f(CIARCH\f(CW\fR" 4
+.IX Item "hwr-names=ARCH"
+Print \s-1HWR\s0 (hardware register, used by the \f(CW\*(C`rdhwr\*(C'\fR instruction) names
+as appropriate for the \s-1CPU\s0 or architecture specified by
+\&\fI\s-1ARCH\s0\fR. By default, \s-1HWR\s0 names are selected according to
+the architecture and \s-1CPU\s0 of the binary being disassembled.
+.ie n .IP """reg\-names=\f(CIABI\f(CW""" 4
+.el .IP "\f(CWreg\-names=\f(CIABI\f(CW\fR" 4
+.IX Item "reg-names=ABI"
+Print \s-1GPR\s0 and \s-1FPR\s0 names as appropriate for the selected \s-1ABI\s0.
+.ie n .IP """reg\-names=\f(CIARCH\f(CW""" 4
+.el .IP "\f(CWreg\-names=\f(CIARCH\f(CW\fR" 4
+.IX Item "reg-names=ARCH"
+Print CPU-specific register names (\s-1CP0\s0 register and \s-1HWR\s0 names)
+as appropriate for the selected \s-1CPU\s0 or architecture.
+.RE
+.RS 4
+.Sp
+For any of the options listed above, \fI\s-1ABI\s0\fR or
+\&\fI\s-1ARCH\s0\fR may be specified as \fBnumeric\fR to have numbers printed
+rather than names, for the selected types of registers.
+You can list the available values of \fI\s-1ABI\s0\fR and \fI\s-1ARCH\s0\fR using
+the \fB\-\-help\fR option.
+.Sp
+For \s-1VAX\s0, you can specify function entry addresses with \fB\-M
+entry:0xf00ba\fR. You can use this multiple times to properly
+disassemble \s-1VAX\s0 binary files that don't contain symbol tables (like
+\&\s-1ROM\s0 dumps). In these cases, the function entry mask would otherwise
+be decoded as \s-1VAX\s0 instructions, which would probably lead the rest
+of the function being wrongly disassembled.
+.RE
+.IP "\fB\-p\fR" 4
+.IX Item "-p"
+.PD 0
+.IP "\fB\-\-private\-headers\fR" 4
+.IX Item "--private-headers"
+.PD
+Print information that is specific to the object file format. The exact
+information printed depends upon the object file format. For some
+object file formats, no additional information is printed.
+.IP "\fB\-r\fR" 4
+.IX Item "-r"
+.PD 0
+.IP "\fB\-\-reloc\fR" 4
+.IX Item "--reloc"
+.PD
+Print the relocation entries of the file. If used with \fB\-d\fR or
+\&\fB\-D\fR, the relocations are printed interspersed with the
+disassembly.
+.IP "\fB\-R\fR" 4
+.IX Item "-R"
+.PD 0
+.IP "\fB\-\-dynamic\-reloc\fR" 4
+.IX Item "--dynamic-reloc"
+.PD
+Print the dynamic relocation entries of the file. This is only
+meaningful for dynamic objects, such as certain types of shared
+libraries. As for \fB\-r\fR, if used with \fB\-d\fR or
+\&\fB\-D\fR, the relocations are printed interspersed with the
+disassembly.
+.IP "\fB\-s\fR" 4
+.IX Item "-s"
+.PD 0
+.IP "\fB\-\-full\-contents\fR" 4
+.IX Item "--full-contents"
+.PD
+Display the full contents of any sections requested. By default all
+non-empty sections are displayed.
+.IP "\fB\-S\fR" 4
+.IX Item "-S"
+.PD 0
+.IP "\fB\-\-source\fR" 4
+.IX Item "--source"
+.PD
+Display source code intermixed with disassembly, if possible. Implies
+\&\fB\-d\fR.
+.IP "\fB\-\-prefix=\fR\fIprefix\fR" 4
+.IX Item "--prefix=prefix"
+Specify \fIprefix\fR to add to the absolute paths when used with
+\&\fB\-S\fR.
+.IP "\fB\-\-prefix\-strip=\fR\fIlevel\fR" 4
+.IX Item "--prefix-strip=level"
+Indicate how many initial directory names to strip off the hardwired
+absolute paths. It has no effect without \fB\-\-prefix=\fR\fIprefix\fR.
+.IP "\fB\-\-show\-raw\-insn\fR" 4
+.IX Item "--show-raw-insn"
+When disassembling instructions, print the instruction in hex as well as
+in symbolic form. This is the default except when
+\&\fB\-\-prefix\-addresses\fR is used.
+.IP "\fB\-\-no\-show\-raw\-insn\fR" 4
+.IX Item "--no-show-raw-insn"
+When disassembling instructions, do not print the instruction bytes.
+This is the default when \fB\-\-prefix\-addresses\fR is used.
+.IP "\fB\-\-insn\-width=\fR\fIwidth\fR" 4
+.IX Item "--insn-width=width"
+Display \fIwidth\fR bytes on a single line when disassembling
+instructions.
+.IP "\fB\-W[lLiaprmfFsoR]\fR" 4
+.IX Item "-W[lLiaprmfFsoR]"
+.PD 0
+.IP "\fB\-\-dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames\-interp,=str,=loc,=Ranges]\fR" 4
+.IX Item "--dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]"
+.PD
+Displays the contents of the debug sections in the file, if any are
+present. If one of the optional letters or words follows the switch
+then only data found in those specific sections will be dumped.
+.IP "\fB\-G\fR" 4
+.IX Item "-G"
+.PD 0
+.IP "\fB\-\-stabs\fR" 4
+.IX Item "--stabs"
+.PD
+Display the full contents of any sections requested. Display the
+contents of the .stab and .stab.index and .stab.excl sections from an
+\&\s-1ELF\s0 file. This is only useful on systems (such as Solaris 2.0) in which
+\&\f(CW\*(C`.stab\*(C'\fR debugging symbol-table entries are carried in an \s-1ELF\s0
+section. In most other file formats, debugging symbol-table entries are
+interleaved with linkage symbols, and are visible in the \fB\-\-syms\fR
+output.
+.IP "\fB\-\-start\-address=\fR\fIaddress\fR" 4
+.IX Item "--start-address=address"
+Start displaying data at the specified address. This affects the output
+of the \fB\-d\fR, \fB\-r\fR and \fB\-s\fR options.
+.IP "\fB\-\-stop\-address=\fR\fIaddress\fR" 4
+.IX Item "--stop-address=address"
+Stop displaying data at the specified address. This affects the output
+of the \fB\-d\fR, \fB\-r\fR and \fB\-s\fR options.
+.IP "\fB\-t\fR" 4
+.IX Item "-t"
+.PD 0
+.IP "\fB\-\-syms\fR" 4
+.IX Item "--syms"
+.PD
+Print the symbol table entries of the file.
+This is similar to the information provided by the \fBnm\fR program,
+although the display format is different. The format of the output
+depends upon the format of the file being dumped, but there are two main
+types. One looks like this:
+.Sp
+.Vb 2
+\& [ 4](sec 3)(fl 0x00)(ty 0)(scl 3) (nx 1) 0x00000000 .bss
+\& [ 6](sec 1)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 fred
+.Ve
+.Sp
+where the number inside the square brackets is the number of the entry
+in the symbol table, the \fIsec\fR number is the section number, the
+\&\fIfl\fR value are the symbol's flag bits, the \fIty\fR number is the
+symbol's type, the \fIscl\fR number is the symbol's storage class and
+the \fInx\fR value is the number of auxilary entries associated with
+the symbol. The last two fields are the symbol's value and its name.
+.Sp
+The other common output format, usually seen with \s-1ELF\s0 based files,
+looks like this:
+.Sp
+.Vb 2
+\& 00000000 l d .bss 00000000 .bss
+\& 00000000 g .text 00000000 fred
+.Ve
+.Sp
+Here the first number is the symbol's value (sometimes refered to as
+its address). The next field is actually a set of characters and
+spaces indicating the flag bits that are set on the symbol. These
+characters are described below. Next is the section with which the
+symbol is associated or \fI*ABS*\fR if the section is absolute (ie
+not connected with any section), or \fI*UND*\fR if the section is
+referenced in the file being dumped, but not defined there.
+.Sp
+After the section name comes another field, a number, which for common
+symbols is the alignment and for other symbol is the size. Finally
+the symbol's name is displayed.
+.Sp
+The flag characters are divided into 7 groups as follows:
+.RS 4
+.ie n .IP """l""" 4
+.el .IP "\f(CWl\fR" 4
+.IX Item "l"
+.PD 0
+.ie n .IP """g""" 4
+.el .IP "\f(CWg\fR" 4
+.IX Item "g"
+.ie n .IP """u""" 4
+.el .IP "\f(CWu\fR" 4
+.IX Item "u"
+.ie n .IP """!""" 4
+.el .IP "\f(CW!\fR" 4
+.IX Item "!"
+.PD
+The symbol is a local (l), global (g), unique global (u), neither
+global nor local (a space) or both global and local (!). A
+symbol can be neither local or global for a variety of reasons, e.g.,
+because it is used for debugging, but it is probably an indication of
+a bug if it is ever both local and global. Unique global symbols are
+a \s-1GNU\s0 extension to the standard set of \s-1ELF\s0 symbol bindings. For such
+a symbol the dynamic linker will make sure that in the entire process
+there is just one symbol with this name and type in use.
+.ie n .IP """w""" 4
+.el .IP "\f(CWw\fR" 4
+.IX Item "w"
+The symbol is weak (w) or strong (a space).
+.ie n .IP """C""" 4
+.el .IP "\f(CWC\fR" 4
+.IX Item "C"
+The symbol denotes a constructor (C) or an ordinary symbol (a space).
+.ie n .IP """W""" 4
+.el .IP "\f(CWW\fR" 4
+.IX Item "W"
+The symbol is a warning (W) or a normal symbol (a space). A warning
+symbol's name is a message to be displayed if the symbol following the
+warning symbol is ever referenced.
+.ie n .IP """I""" 4
+.el .IP "\f(CWI\fR" 4
+.IX Item "I"
+.PD 0
+.ie n .IP """i""" 4
+.el .IP "\f(CWi\fR" 4
+.IX Item "i"
+.PD
+The symbol is an indirect reference to another symbol (I), a function
+to be evaluated during reloc processing (i) or a normal symbol (a
+space).
+.ie n .IP """d""" 4
+.el .IP "\f(CWd\fR" 4
+.IX Item "d"
+.PD 0
+.ie n .IP """D""" 4
+.el .IP "\f(CWD\fR" 4
+.IX Item "D"
+.PD
+The symbol is a debugging symbol (d) or a dynamic symbol (D) or a
+normal symbol (a space).
+.ie n .IP """F""" 4
+.el .IP "\f(CWF\fR" 4
+.IX Item "F"
+.PD 0
+.ie n .IP """f""" 4
+.el .IP "\f(CWf\fR" 4
+.IX Item "f"
+.ie n .IP """O""" 4
+.el .IP "\f(CWO\fR" 4
+.IX Item "O"
+.PD
+The symbol is the name of a function (F) or a file (f) or an object
+(O) or just a normal symbol (a space).
+.RE
+.RS 4
+.RE
+.IP "\fB\-T\fR" 4
+.IX Item "-T"
+.PD 0
+.IP "\fB\-\-dynamic\-syms\fR" 4
+.IX Item "--dynamic-syms"
+.PD
+Print the dynamic symbol table entries of the file. This is only
+meaningful for dynamic objects, such as certain types of shared
+libraries. This is similar to the information provided by the \fBnm\fR
+program when given the \fB\-D\fR (\fB\-\-dynamic\fR) option.
+.IP "\fB\-\-special\-syms\fR" 4
+.IX Item "--special-syms"
+When displaying symbols include those which the target considers to be
+special in some way and which would not normally be of interest to the
+user.
+.IP "\fB\-V\fR" 4
+.IX Item "-V"
+.PD 0
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+.PD
+Print the version number of \fBobjdump\fR and exit.
+.IP "\fB\-x\fR" 4
+.IX Item "-x"
+.PD 0
+.IP "\fB\-\-all\-headers\fR" 4
+.IX Item "--all-headers"
+.PD
+Display all available header information, including the symbol table and
+relocation entries. Using \fB\-x\fR is equivalent to specifying all of
+\&\fB\-a \-f \-h \-p \-r \-t\fR.
+.IP "\fB\-w\fR" 4
+.IX Item "-w"
+.PD 0
+.IP "\fB\-\-wide\fR" 4
+.IX Item "--wide"
+.PD
+Format some lines for output devices that have more than 80 columns.
+Also do not truncate symbol names when they are displayed.
+.IP "\fB\-z\fR" 4
+.IX Item "-z"
+.PD 0
+.IP "\fB\-\-disassemble\-zeroes\fR" 4
+.IX Item "--disassemble-zeroes"
+.PD
+Normally the disassembly output will skip blocks of zeroes. This
+option directs the disassembler to disassemble those blocks, just like
+any other data.
+.IP "\fB@\fR\fIfile\fR" 4
+.IX Item "@file"
+Read command-line options from \fIfile\fR. The options read are
+inserted in place of the original @\fIfile\fR option. If \fIfile\fR
+does not exist, or cannot be read, then the option will be treated
+literally, and not removed.
+.Sp
+Options in \fIfile\fR are separated by whitespace. A whitespace
+character may be included in an option by surrounding the entire
+option in either single or double quotes. Any character (including a
+backslash) may be included by prefixing the character to be included
+with a backslash. The \fIfile\fR may itself contain additional
+@\fIfile\fR options; any such options will be processed recursively.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fInm\fR\|(1), \fIreadelf\fR\|(1), and the Info entries for \fIbinutils\fR.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, with no Front-Cover Texts, and with no
+Back-Cover Texts. A copy of the license is included in the
+section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-ranlib.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-ranlib.1
new file mode 100644
index 0000000..a72019c
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-ranlib.1
@@ -0,0 +1,199 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "RANLIB 1"
+.TH RANLIB 1 "2009-10-16" "binutils-2.20" "GNU Development Tools"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+ranlib \- generate index to archive.
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+ranlib [\fB\-vVt\fR] \fIarchive\fR
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+\&\fBranlib\fR generates an index to the contents of an archive and
+stores it in the archive. The index lists each symbol defined by a
+member of an archive that is a relocatable object file.
+.PP
+You may use \fBnm \-s\fR or \fBnm \-\-print\-armap\fR to list this index.
+.PP
+An archive with such an index speeds up linking to the library and
+allows routines in the library to call each other without regard to
+their placement in the archive.
+.PP
+The \s-1GNU\s0 \fBranlib\fR program is another form of \s-1GNU\s0 \fBar\fR; running
+\&\fBranlib\fR is completely equivalent to executing \fBar \-s\fR.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+.IP "\fB\-v\fR" 4
+.IX Item "-v"
+.PD 0
+.IP "\fB\-V\fR" 4
+.IX Item "-V"
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+.PD
+Show the version number of \fBranlib\fR.
+.IP "\fB\-t\fR" 4
+.IX Item "-t"
+Update the timestamp of the symbol map of an archive.
+.IP "\fB@\fR\fIfile\fR" 4
+.IX Item "@file"
+Read command-line options from \fIfile\fR. The options read are
+inserted in place of the original @\fIfile\fR option. If \fIfile\fR
+does not exist, or cannot be read, then the option will be treated
+literally, and not removed.
+.Sp
+Options in \fIfile\fR are separated by whitespace. A whitespace
+character may be included in an option by surrounding the entire
+option in either single or double quotes. Any character (including a
+backslash) may be included by prefixing the character to be included
+with a backslash. The \fIfile\fR may itself contain additional
+@\fIfile\fR options; any such options will be processed recursively.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fIar\fR\|(1), \fInm\fR\|(1), and the Info entries for \fIbinutils\fR.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, with no Front-Cover Texts, and with no
+Back-Cover Texts. A copy of the license is included in the
+section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-readelf.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-readelf.1
new file mode 100644
index 0000000..07132ee
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-readelf.1
@@ -0,0 +1,420 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "READELF 1"
+.TH READELF 1 "2009-10-16" "binutils-2.20" "GNU Development Tools"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+readelf \- Displays information about ELF files.
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+readelf [\fB\-a\fR|\fB\-\-all\fR]
+ [\fB\-h\fR|\fB\-\-file\-header\fR]
+ [\fB\-l\fR|\fB\-\-program\-headers\fR|\fB\-\-segments\fR]
+ [\fB\-S\fR|\fB\-\-section\-headers\fR|\fB\-\-sections\fR]
+ [\fB\-g\fR|\fB\-\-section\-groups\fR]
+ [\fB\-t\fR|\fB\-\-section\-details\fR]
+ [\fB\-e\fR|\fB\-\-headers\fR]
+ [\fB\-s\fR|\fB\-\-syms\fR|\fB\-\-symbols\fR]
+ [\fB\-n\fR|\fB\-\-notes\fR]
+ [\fB\-r\fR|\fB\-\-relocs\fR]
+ [\fB\-u\fR|\fB\-\-unwind\fR]
+ [\fB\-d\fR|\fB\-\-dynamic\fR]
+ [\fB\-V\fR|\fB\-\-version\-info\fR]
+ [\fB\-A\fR|\fB\-\-arch\-specific\fR]
+ [\fB\-D\fR|\fB\-\-use\-dynamic\fR]
+ [\fB\-x\fR <number or name>|\fB\-\-hex\-dump=\fR<number or name>]
+ [\fB\-p\fR <number or name>|\fB\-\-string\-dump=\fR<number or name>]
+ [\fB\-R\fR <number or name>|\fB\-\-relocated\-dump=\fR<number or name>]
+ [\fB\-c\fR|\fB\-\-archive\-index\fR]
+ [\fB\-w[lLiaprmfFsoR]\fR|
+ \fB\-\-debug\-dump\fR[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames\-interp,=str,=loc,=Ranges]]
+ [\fB\-I\fR|\fB\-histogram\fR]
+ [\fB\-v\fR|\fB\-\-version\fR]
+ [\fB\-W\fR|\fB\-\-wide\fR]
+ [\fB\-H\fR|\fB\-\-help\fR]
+ \fIelffile\fR...
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+\&\fBreadelf\fR displays information about one or more \s-1ELF\s0 format object
+files. The options control what particular information to display.
+.PP
+\&\fIelffile\fR... are the object files to be examined. 32\-bit and
+64\-bit \s-1ELF\s0 files are supported, as are archives containing \s-1ELF\s0 files.
+.PP
+This program performs a similar function to \fBobjdump\fR but it
+goes into more detail and it exists independently of the \s-1BFD\s0
+library, so if there is a bug in \s-1BFD\s0 then readelf will not be
+affected.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+The long and short forms of options, shown here as alternatives, are
+equivalent. At least one option besides \fB\-v\fR or \fB\-H\fR must be
+given.
+.IP "\fB\-a\fR" 4
+.IX Item "-a"
+.PD 0
+.IP "\fB\-\-all\fR" 4
+.IX Item "--all"
+.PD
+Equivalent to specifying \fB\-\-file\-header\fR,
+\&\fB\-\-program\-headers\fR, \fB\-\-sections\fR, \fB\-\-symbols\fR,
+\&\fB\-\-relocs\fR, \fB\-\-dynamic\fR, \fB\-\-notes\fR and
+\&\fB\-\-version\-info\fR.
+.IP "\fB\-h\fR" 4
+.IX Item "-h"
+.PD 0
+.IP "\fB\-\-file\-header\fR" 4
+.IX Item "--file-header"
+.PD
+Displays the information contained in the \s-1ELF\s0 header at the start of the
+file.
+.IP "\fB\-l\fR" 4
+.IX Item "-l"
+.PD 0
+.IP "\fB\-\-program\-headers\fR" 4
+.IX Item "--program-headers"
+.IP "\fB\-\-segments\fR" 4
+.IX Item "--segments"
+.PD
+Displays the information contained in the file's segment headers, if it
+has any.
+.IP "\fB\-S\fR" 4
+.IX Item "-S"
+.PD 0
+.IP "\fB\-\-sections\fR" 4
+.IX Item "--sections"
+.IP "\fB\-\-section\-headers\fR" 4
+.IX Item "--section-headers"
+.PD
+Displays the information contained in the file's section headers, if it
+has any.
+.IP "\fB\-g\fR" 4
+.IX Item "-g"
+.PD 0
+.IP "\fB\-\-section\-groups\fR" 4
+.IX Item "--section-groups"
+.PD
+Displays the information contained in the file's section groups, if it
+has any.
+.IP "\fB\-t\fR" 4
+.IX Item "-t"
+.PD 0
+.IP "\fB\-\-section\-details\fR" 4
+.IX Item "--section-details"
+.PD
+Displays the detailed section information. Implies \fB\-S\fR.
+.IP "\fB\-s\fR" 4
+.IX Item "-s"
+.PD 0
+.IP "\fB\-\-symbols\fR" 4
+.IX Item "--symbols"
+.IP "\fB\-\-syms\fR" 4
+.IX Item "--syms"
+.PD
+Displays the entries in symbol table section of the file, if it has one.
+.IP "\fB\-e\fR" 4
+.IX Item "-e"
+.PD 0
+.IP "\fB\-\-headers\fR" 4
+.IX Item "--headers"
+.PD
+Display all the headers in the file. Equivalent to \fB\-h \-l \-S\fR.
+.IP "\fB\-n\fR" 4
+.IX Item "-n"
+.PD 0
+.IP "\fB\-\-notes\fR" 4
+.IX Item "--notes"
+.PD
+Displays the contents of the \s-1NOTE\s0 segments and/or sections, if any.
+.IP "\fB\-r\fR" 4
+.IX Item "-r"
+.PD 0
+.IP "\fB\-\-relocs\fR" 4
+.IX Item "--relocs"
+.PD
+Displays the contents of the file's relocation section, if it has one.
+.IP "\fB\-u\fR" 4
+.IX Item "-u"
+.PD 0
+.IP "\fB\-\-unwind\fR" 4
+.IX Item "--unwind"
+.PD
+Displays the contents of the file's unwind section, if it has one. Only
+the unwind sections for \s-1IA64\s0 \s-1ELF\s0 files are currently supported.
+.IP "\fB\-d\fR" 4
+.IX Item "-d"
+.PD 0
+.IP "\fB\-\-dynamic\fR" 4
+.IX Item "--dynamic"
+.PD
+Displays the contents of the file's dynamic section, if it has one.
+.IP "\fB\-V\fR" 4
+.IX Item "-V"
+.PD 0
+.IP "\fB\-\-version\-info\fR" 4
+.IX Item "--version-info"
+.PD
+Displays the contents of the version sections in the file, it they
+exist.
+.IP "\fB\-A\fR" 4
+.IX Item "-A"
+.PD 0
+.IP "\fB\-\-arch\-specific\fR" 4
+.IX Item "--arch-specific"
+.PD
+Displays architecture-specific information in the file, if there
+is any.
+.IP "\fB\-D\fR" 4
+.IX Item "-D"
+.PD 0
+.IP "\fB\-\-use\-dynamic\fR" 4
+.IX Item "--use-dynamic"
+.PD
+When displaying symbols, this option makes \fBreadelf\fR use the
+symbol table in the file's dynamic section, rather than the one in the
+symbols section.
+.IP "\fB\-x <number or name>\fR" 4
+.IX Item "-x <number or name>"
+.PD 0
+.IP "\fB\-\-hex\-dump=<number or name>\fR" 4
+.IX Item "--hex-dump=<number or name>"
+.PD
+Displays the contents of the indicated section as a hexadecimal bytes.
+A number identifies a particular section by index in the section table;
+any other string identifies all sections with that name in the object file.
+.IP "\fB\-R <number or name>\fR" 4
+.IX Item "-R <number or name>"
+.PD 0
+.IP "\fB\-\-relocated\-dump=<number or name>\fR" 4
+.IX Item "--relocated-dump=<number or name>"
+.PD
+Displays the contents of the indicated section as a hexadecimal
+bytes. A number identifies a particular section by index in the
+section table; any other string identifies all sections with that name
+in the object file. The contents of the section will be relocated
+before they are displayed.
+.IP "\fB\-p <number or name>\fR" 4
+.IX Item "-p <number or name>"
+.PD 0
+.IP "\fB\-\-string\-dump=<number or name>\fR" 4
+.IX Item "--string-dump=<number or name>"
+.PD
+Displays the contents of the indicated section as printable strings.
+A number identifies a particular section by index in the section table;
+any other string identifies all sections with that name in the object file.
+.IP "\fB\-c\fR" 4
+.IX Item "-c"
+.PD 0
+.IP "\fB\-\-archive\-index\fR" 4
+.IX Item "--archive-index"
+.PD
+Displays the file symbol index infomation contained in the header part
+of binary archives. Performs the same function as the \fBt\fR
+command to \fBar\fR, but without using the \s-1BFD\s0 library.
+.IP "\fB\-w[lLiaprmfFsoR]\fR" 4
+.IX Item "-w[lLiaprmfFsoR]"
+.PD 0
+.IP "\fB\-\-debug\-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames\-interp,=str,=loc,=Ranges]\fR" 4
+.IX Item "--debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]"
+.PD
+Displays the contents of the debug sections in the file, if any are
+present. If one of the optional letters or words follows the switch
+then only data found in those specific sections will be dumped.
+.Sp
+Note: the \fB=decodedline\fR option will display the interpreted
+contents of a .debug_line section whereas the \fB=rawline\fR option
+dumps the contents in a raw format.
+.IP "\fB\-I\fR" 4
+.IX Item "-I"
+.PD 0
+.IP "\fB\-\-histogram\fR" 4
+.IX Item "--histogram"
+.PD
+Display a histogram of bucket list lengths when displaying the contents
+of the symbol tables.
+.IP "\fB\-v\fR" 4
+.IX Item "-v"
+.PD 0
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+.PD
+Display the version number of readelf.
+.IP "\fB\-W\fR" 4
+.IX Item "-W"
+.PD 0
+.IP "\fB\-\-wide\fR" 4
+.IX Item "--wide"
+.PD
+Don't break output lines to fit into 80 columns. By default
+\&\fBreadelf\fR breaks section header and segment listing lines for
+64\-bit \s-1ELF\s0 files, so that they fit into 80 columns. This option causes
+\&\fBreadelf\fR to print each section header resp. each segment one a
+single line, which is far more readable on terminals wider than 80 columns.
+.IP "\fB\-H\fR" 4
+.IX Item "-H"
+.PD 0
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
+.PD
+Display the command line options understood by \fBreadelf\fR.
+.IP "\fB@\fR\fIfile\fR" 4
+.IX Item "@file"
+Read command-line options from \fIfile\fR. The options read are
+inserted in place of the original @\fIfile\fR option. If \fIfile\fR
+does not exist, or cannot be read, then the option will be treated
+literally, and not removed.
+.Sp
+Options in \fIfile\fR are separated by whitespace. A whitespace
+character may be included in an option by surrounding the entire
+option in either single or double quotes. Any character (including a
+backslash) may be included by prefixing the character to be included
+with a backslash. The \fIfile\fR may itself contain additional
+@\fIfile\fR options; any such options will be processed recursively.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fIobjdump\fR\|(1), and the Info entries for \fIbinutils\fR.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, with no Front-Cover Texts, and with no
+Back-Cover Texts. A copy of the license is included in the
+section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-size.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-size.1
new file mode 100644
index 0000000..a76bebe
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-size.1
@@ -0,0 +1,275 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "SIZE 1"
+.TH SIZE 1 "2009-10-16" "binutils-2.20" "GNU Development Tools"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+size \- list section sizes and total size.
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+size [\fB\-A\fR|\fB\-B\fR|\fB\-\-format=\fR\fIcompatibility\fR]
+ [\fB\-\-help\fR]
+ [\fB\-d\fR|\fB\-o\fR|\fB\-x\fR|\fB\-\-radix=\fR\fInumber\fR]
+ [\fB\-\-common\fR]
+ [\fB\-t\fR|\fB\-\-totals\fR]
+ [\fB\-\-target=\fR\fIbfdname\fR] [\fB\-V\fR|\fB\-\-version\fR]
+ [\fIobjfile\fR...]
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+The \s-1GNU\s0 \fBsize\fR utility lists the section sizes\-\-\-and the total
+size\-\-\-for each of the object or archive files \fIobjfile\fR in its
+argument list. By default, one line of output is generated for each
+object file or each module in an archive.
+.PP
+\&\fIobjfile\fR... are the object files to be examined.
+If none are specified, the file \f(CW\*(C`a.out\*(C'\fR will be used.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+The command line options have the following meanings:
+.IP "\fB\-A\fR" 4
+.IX Item "-A"
+.PD 0
+.IP "\fB\-B\fR" 4
+.IX Item "-B"
+.IP "\fB\-\-format=\fR\fIcompatibility\fR" 4
+.IX Item "--format=compatibility"
+.PD
+Using one of these options, you can choose whether the output from \s-1GNU\s0
+\&\fBsize\fR resembles output from System V \fBsize\fR (using \fB\-A\fR,
+or \fB\-\-format=sysv\fR), or Berkeley \fBsize\fR (using \fB\-B\fR, or
+\&\fB\-\-format=berkeley\fR). The default is the one-line format similar to
+Berkeley's.
+.Sp
+Here is an example of the Berkeley (default) format of output from
+\&\fBsize\fR:
+.Sp
+.Vb 4
+\& $ size \-\-format=Berkeley ranlib size
+\& text data bss dec hex filename
+\& 294880 81920 11592 388392 5ed28 ranlib
+\& 294880 81920 11888 388688 5ee50 size
+.Ve
+.Sp
+This is the same data, but displayed closer to System V conventions:
+.Sp
+.Vb 7
+\& $ size \-\-format=SysV ranlib size
+\& ranlib :
+\& section size addr
+\& .text 294880 8192
+\& .data 81920 303104
+\& .bss 11592 385024
+\& Total 388392
+\&
+\&
+\& size :
+\& section size addr
+\& .text 294880 8192
+\& .data 81920 303104
+\& .bss 11888 385024
+\& Total 388688
+.Ve
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
+Show a summary of acceptable arguments and options.
+.IP "\fB\-d\fR" 4
+.IX Item "-d"
+.PD 0
+.IP "\fB\-o\fR" 4
+.IX Item "-o"
+.IP "\fB\-x\fR" 4
+.IX Item "-x"
+.IP "\fB\-\-radix=\fR\fInumber\fR" 4
+.IX Item "--radix=number"
+.PD
+Using one of these options, you can control whether the size of each
+section is given in decimal (\fB\-d\fR, or \fB\-\-radix=10\fR); octal
+(\fB\-o\fR, or \fB\-\-radix=8\fR); or hexadecimal (\fB\-x\fR, or
+\&\fB\-\-radix=16\fR). In \fB\-\-radix=\fR\fInumber\fR, only the three
+values (8, 10, 16) are supported. The total size is always given in two
+radices; decimal and hexadecimal for \fB\-d\fR or \fB\-x\fR output, or
+octal and hexadecimal if you're using \fB\-o\fR.
+.IP "\fB\-\-common\fR" 4
+.IX Item "--common"
+Print total size of common symbols in each file. When using Berkeley
+format these are included in the bss size.
+.IP "\fB\-t\fR" 4
+.IX Item "-t"
+.PD 0
+.IP "\fB\-\-totals\fR" 4
+.IX Item "--totals"
+.PD
+Show totals of all objects listed (Berkeley format listing mode only).
+.IP "\fB\-\-target=\fR\fIbfdname\fR" 4
+.IX Item "--target=bfdname"
+Specify that the object-code format for \fIobjfile\fR is
+\&\fIbfdname\fR. This option may not be necessary; \fBsize\fR can
+automatically recognize many formats.
+.IP "\fB\-V\fR" 4
+.IX Item "-V"
+.PD 0
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+.PD
+Display the version number of \fBsize\fR.
+.IP "\fB@\fR\fIfile\fR" 4
+.IX Item "@file"
+Read command-line options from \fIfile\fR. The options read are
+inserted in place of the original @\fIfile\fR option. If \fIfile\fR
+does not exist, or cannot be read, then the option will be treated
+literally, and not removed.
+.Sp
+Options in \fIfile\fR are separated by whitespace. A whitespace
+character may be included in an option by surrounding the entire
+option in either single or double quotes. Any character (including a
+backslash) may be included by prefixing the character to be included
+with a backslash. The \fIfile\fR may itself contain additional
+@\fIfile\fR options; any such options will be processed recursively.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fIar\fR\|(1), \fIobjdump\fR\|(1), \fIreadelf\fR\|(1), and the Info entries for \fIbinutils\fR.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, with no Front-Cover Texts, and with no
+Back-Cover Texts. A copy of the license is included in the
+section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-strings.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-strings.1
new file mode 100644
index 0000000..0904a40
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-strings.1
@@ -0,0 +1,264 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "STRINGS 1"
+.TH STRINGS 1 "2009-10-16" "binutils-2.20" "GNU Development Tools"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+strings \- print the strings of printable characters in files.
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+strings [\fB\-afovV\fR] [\fB\-\fR\fImin-len\fR]
+ [\fB\-n\fR \fImin-len\fR] [\fB\-\-bytes=\fR\fImin-len\fR]
+ [\fB\-t\fR \fIradix\fR] [\fB\-\-radix=\fR\fIradix\fR]
+ [\fB\-e\fR \fIencoding\fR] [\fB\-\-encoding=\fR\fIencoding\fR]
+ [\fB\-\fR] [\fB\-\-all\fR] [\fB\-\-print\-file\-name\fR]
+ [\fB\-T\fR \fIbfdname\fR] [\fB\-\-target=\fR\fIbfdname\fR]
+ [\fB\-\-help\fR] [\fB\-\-version\fR] \fIfile\fR...
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+For each \fIfile\fR given, \s-1GNU\s0 \fBstrings\fR prints the printable
+character sequences that are at least 4 characters long (or the number
+given with the options below) and are followed by an unprintable
+character. By default, it only prints the strings from the initialized
+and loaded sections of object files; for other types of files, it prints
+the strings from the whole file.
+.PP
+\&\fBstrings\fR is mainly useful for determining the contents of non-text
+files.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+.IP "\fB\-a\fR" 4
+.IX Item "-a"
+.PD 0
+.IP "\fB\-\-all\fR" 4
+.IX Item "--all"
+.IP "\fB\-\fR" 4
+.IX Item "-"
+.PD
+Do not scan only the initialized and loaded sections of object files;
+scan the whole files.
+.IP "\fB\-f\fR" 4
+.IX Item "-f"
+.PD 0
+.IP "\fB\-\-print\-file\-name\fR" 4
+.IX Item "--print-file-name"
+.PD
+Print the name of the file before each string.
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
+Print a summary of the program usage on the standard output and exit.
+.IP "\fB\-\fR\fImin-len\fR" 4
+.IX Item "-min-len"
+.PD 0
+.IP "\fB\-n\fR \fImin-len\fR" 4
+.IX Item "-n min-len"
+.IP "\fB\-\-bytes=\fR\fImin-len\fR" 4
+.IX Item "--bytes=min-len"
+.PD
+Print sequences of characters that are at least \fImin-len\fR characters
+long, instead of the default 4.
+.IP "\fB\-o\fR" 4
+.IX Item "-o"
+Like \fB\-t o\fR. Some other versions of \fBstrings\fR have \fB\-o\fR
+act like \fB\-t d\fR instead. Since we can not be compatible with both
+ways, we simply chose one.
+.IP "\fB\-t\fR \fIradix\fR" 4
+.IX Item "-t radix"
+.PD 0
+.IP "\fB\-\-radix=\fR\fIradix\fR" 4
+.IX Item "--radix=radix"
+.PD
+Print the offset within the file before each string. The single
+character argument specifies the radix of the offset\-\-\-\fBo\fR for
+octal, \fBx\fR for hexadecimal, or \fBd\fR for decimal.
+.IP "\fB\-e\fR \fIencoding\fR" 4
+.IX Item "-e encoding"
+.PD 0
+.IP "\fB\-\-encoding=\fR\fIencoding\fR" 4
+.IX Item "--encoding=encoding"
+.PD
+Select the character encoding of the strings that are to be found.
+Possible values for \fIencoding\fR are: \fBs\fR = single\-7\-bit\-byte
+characters (\s-1ASCII\s0, \s-1ISO\s0 8859, etc., default), \fBS\fR =
+single\-8\-bit\-byte characters, \fBb\fR = 16\-bit bigendian, \fBl\fR =
+16\-bit littleendian, \fBB\fR = 32\-bit bigendian, \fBL\fR = 32\-bit
+littleendian. Useful for finding wide character strings. (\fBl\fR
+and \fBb\fR apply to, for example, Unicode \s-1UTF\-16/UCS\-2\s0 encodings).
+.IP "\fB\-T\fR \fIbfdname\fR" 4
+.IX Item "-T bfdname"
+.PD 0
+.IP "\fB\-\-target=\fR\fIbfdname\fR" 4
+.IX Item "--target=bfdname"
+.PD
+Specify an object code format other than your system's default format.
+.IP "\fB\-v\fR" 4
+.IX Item "-v"
+.PD 0
+.IP "\fB\-V\fR" 4
+.IX Item "-V"
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+.PD
+Print the program version number on the standard output and exit.
+.IP "\fB@\fR\fIfile\fR" 4
+.IX Item "@file"
+Read command-line options from \fIfile\fR. The options read are
+inserted in place of the original @\fIfile\fR option. If \fIfile\fR
+does not exist, or cannot be read, then the option will be treated
+literally, and not removed.
+.Sp
+Options in \fIfile\fR are separated by whitespace. A whitespace
+character may be included in an option by surrounding the entire
+option in either single or double quotes. Any character (including a
+backslash) may be included by prefixing the character to be included
+with a backslash. The \fIfile\fR may itself contain additional
+@\fIfile\fR options; any such options will be processed recursively.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fIar\fR\|(1), \fInm\fR\|(1), \fIobjdump\fR\|(1), \fIranlib\fR\|(1), \fIreadelf\fR\|(1)
+and the Info entries for \fIbinutils\fR.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, with no Front-Cover Texts, and with no
+Back-Cover Texts. A copy of the license is included in the
+section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-strip.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-strip.1
new file mode 100644
index 0000000..fba09c4
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-strip.1
@@ -0,0 +1,399 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "STRIP 1"
+.TH STRIP 1 "2009-10-16" "binutils-2.20" "GNU Development Tools"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+strip \- Discard symbols from object files.
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+strip [\fB\-F\fR \fIbfdname\fR |\fB\-\-target=\fR\fIbfdname\fR]
+ [\fB\-I\fR \fIbfdname\fR |\fB\-\-input\-target=\fR\fIbfdname\fR]
+ [\fB\-O\fR \fIbfdname\fR |\fB\-\-output\-target=\fR\fIbfdname\fR]
+ [\fB\-s\fR|\fB\-\-strip\-all\fR]
+ [\fB\-S\fR|\fB\-g\fR|\fB\-d\fR|\fB\-\-strip\-debug\fR]
+ [\fB\-K\fR \fIsymbolname\fR |\fB\-\-keep\-symbol=\fR\fIsymbolname\fR]
+ [\fB\-N\fR \fIsymbolname\fR |\fB\-\-strip\-symbol=\fR\fIsymbolname\fR]
+ [\fB\-w\fR|\fB\-\-wildcard\fR]
+ [\fB\-x\fR|\fB\-\-discard\-all\fR] [\fB\-X\fR |\fB\-\-discard\-locals\fR]
+ [\fB\-R\fR \fIsectionname\fR |\fB\-\-remove\-section=\fR\fIsectionname\fR]
+ [\fB\-o\fR \fIfile\fR] [\fB\-p\fR|\fB\-\-preserve\-dates\fR]
+ [\fB\-\-keep\-file\-symbols\fR]
+ [\fB\-\-only\-keep\-debug\fR]
+ [\fB\-v\fR |\fB\-\-verbose\fR] [\fB\-V\fR|\fB\-\-version\fR]
+ [\fB\-\-help\fR] [\fB\-\-info\fR]
+ \fIobjfile\fR...
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+\&\s-1GNU\s0 \fBstrip\fR discards all symbols from object files
+\&\fIobjfile\fR. The list of object files may include archives.
+At least one object file must be given.
+.PP
+\&\fBstrip\fR modifies the files named in its argument,
+rather than writing modified copies under different names.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+.IP "\fB\-F\fR \fIbfdname\fR" 4
+.IX Item "-F bfdname"
+.PD 0
+.IP "\fB\-\-target=\fR\fIbfdname\fR" 4
+.IX Item "--target=bfdname"
+.PD
+Treat the original \fIobjfile\fR as a file with the object
+code format \fIbfdname\fR, and rewrite it in the same format.
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
+Show a summary of the options to \fBstrip\fR and exit.
+.IP "\fB\-\-info\fR" 4
+.IX Item "--info"
+Display a list showing all architectures and object formats available.
+.IP "\fB\-I\fR \fIbfdname\fR" 4
+.IX Item "-I bfdname"
+.PD 0
+.IP "\fB\-\-input\-target=\fR\fIbfdname\fR" 4
+.IX Item "--input-target=bfdname"
+.PD
+Treat the original \fIobjfile\fR as a file with the object
+code format \fIbfdname\fR.
+.IP "\fB\-O\fR \fIbfdname\fR" 4
+.IX Item "-O bfdname"
+.PD 0
+.IP "\fB\-\-output\-target=\fR\fIbfdname\fR" 4
+.IX Item "--output-target=bfdname"
+.PD
+Replace \fIobjfile\fR with a file in the output format \fIbfdname\fR.
+.IP "\fB\-R\fR \fIsectionname\fR" 4
+.IX Item "-R sectionname"
+.PD 0
+.IP "\fB\-\-remove\-section=\fR\fIsectionname\fR" 4
+.IX Item "--remove-section=sectionname"
+.PD
+Remove any section named \fIsectionname\fR from the output file. This
+option may be given more than once. Note that using this option
+inappropriately may make the output file unusable.
+.IP "\fB\-s\fR" 4
+.IX Item "-s"
+.PD 0
+.IP "\fB\-\-strip\-all\fR" 4
+.IX Item "--strip-all"
+.PD
+Remove all symbols.
+.IP "\fB\-g\fR" 4
+.IX Item "-g"
+.PD 0
+.IP "\fB\-S\fR" 4
+.IX Item "-S"
+.IP "\fB\-d\fR" 4
+.IX Item "-d"
+.IP "\fB\-\-strip\-debug\fR" 4
+.IX Item "--strip-debug"
+.PD
+Remove debugging symbols only.
+.IP "\fB\-\-strip\-unneeded\fR" 4
+.IX Item "--strip-unneeded"
+Remove all symbols that are not needed for relocation processing.
+.IP "\fB\-K\fR \fIsymbolname\fR" 4
+.IX Item "-K symbolname"
+.PD 0
+.IP "\fB\-\-keep\-symbol=\fR\fIsymbolname\fR" 4
+.IX Item "--keep-symbol=symbolname"
+.PD
+When stripping symbols, keep symbol \fIsymbolname\fR even if it would
+normally be stripped. This option may be given more than once.
+.IP "\fB\-N\fR \fIsymbolname\fR" 4
+.IX Item "-N symbolname"
+.PD 0
+.IP "\fB\-\-strip\-symbol=\fR\fIsymbolname\fR" 4
+.IX Item "--strip-symbol=symbolname"
+.PD
+Remove symbol \fIsymbolname\fR from the source file. This option may be
+given more than once, and may be combined with strip options other than
+\&\fB\-K\fR.
+.IP "\fB\-o\fR \fIfile\fR" 4
+.IX Item "-o file"
+Put the stripped output in \fIfile\fR, rather than replacing the
+existing file. When this argument is used, only one \fIobjfile\fR
+argument may be specified.
+.IP "\fB\-p\fR" 4
+.IX Item "-p"
+.PD 0
+.IP "\fB\-\-preserve\-dates\fR" 4
+.IX Item "--preserve-dates"
+.PD
+Preserve the access and modification dates of the file.
+.IP "\fB\-w\fR" 4
+.IX Item "-w"
+.PD 0
+.IP "\fB\-\-wildcard\fR" 4
+.IX Item "--wildcard"
+.PD
+Permit regular expressions in \fIsymbolname\fRs used in other command
+line options. The question mark (?), asterisk (*), backslash (\e) and
+square brackets ([]) operators can be used anywhere in the symbol
+name. If the first character of the symbol name is the exclamation
+point (!) then the sense of the switch is reversed for that symbol.
+For example:
+.Sp
+.Vb 1
+\& \-w \-K !foo \-K fo*
+.Ve
+.Sp
+would cause strip to only keep symbols that start with the letters
+\&\*(L"fo\*(R", but to discard the symbol \*(L"foo\*(R".
+.IP "\fB\-x\fR" 4
+.IX Item "-x"
+.PD 0
+.IP "\fB\-\-discard\-all\fR" 4
+.IX Item "--discard-all"
+.PD
+Remove non-global symbols.
+.IP "\fB\-X\fR" 4
+.IX Item "-X"
+.PD 0
+.IP "\fB\-\-discard\-locals\fR" 4
+.IX Item "--discard-locals"
+.PD
+Remove compiler-generated local symbols.
+(These usually start with \fBL\fR or \fB.\fR.)
+.IP "\fB\-\-keep\-file\-symbols\fR" 4
+.IX Item "--keep-file-symbols"
+When stripping a file, perhaps with \fB\-\-strip\-debug\fR or
+\&\fB\-\-strip\-unneeded\fR, retain any symbols specifying source file names,
+which would otherwise get stripped.
+.IP "\fB\-\-only\-keep\-debug\fR" 4
+.IX Item "--only-keep-debug"
+Strip a file, removing contents of any sections that would not be
+stripped by \fB\-\-strip\-debug\fR and leaving the debugging sections
+intact. In \s-1ELF\s0 files, this preserves all note sections in the output.
+.Sp
+The intention is that this option will be used in conjunction with
+\&\fB\-\-add\-gnu\-debuglink\fR to create a two part executable. One a
+stripped binary which will occupy less space in \s-1RAM\s0 and in a
+distribution and the second a debugging information file which is only
+needed if debugging abilities are required. The suggested procedure
+to create these files is as follows:
+.RS 4
+.IP "1.<Link the executable as normal. Assuming that is is called>" 4
+.IX Item "1.<Link the executable as normal. Assuming that is is called>"
+\&\f(CW\*(C`foo\*(C'\fR then...
+.ie n .IP "1.<Run ""objcopy \-\-only\-keep\-debug foo foo.dbg"" to>" 4
+.el .IP "1.<Run \f(CWobjcopy \-\-only\-keep\-debug foo foo.dbg\fR to>" 4
+.IX Item "1.<Run objcopy --only-keep-debug foo foo.dbg to>"
+create a file containing the debugging info.
+.ie n .IP "1.<Run ""objcopy \-\-strip\-debug foo"" to create a>" 4
+.el .IP "1.<Run \f(CWobjcopy \-\-strip\-debug foo\fR to create a>" 4
+.IX Item "1.<Run objcopy --strip-debug foo to create a>"
+stripped executable.
+.ie n .IP "1.<Run ""objcopy \-\-add\-gnu\-debuglink=foo.dbg foo"">" 4
+.el .IP "1.<Run \f(CWobjcopy \-\-add\-gnu\-debuglink=foo.dbg foo\fR>" 4
+.IX Item "1.<Run objcopy --add-gnu-debuglink=foo.dbg foo>"
+to add a link to the debugging info into the stripped executable.
+.RE
+.RS 4
+.Sp
+Note\-\-\-the choice of \f(CW\*(C`.dbg\*(C'\fR as an extension for the debug info
+file is arbitrary. Also the \f(CW\*(C`\-\-only\-keep\-debug\*(C'\fR step is
+optional. You could instead do this:
+.IP "1.<Link the executable as normal.>" 4
+.IX Item "1.<Link the executable as normal.>"
+.PD 0
+.ie n .IP "1.<Copy ""foo""\fR to \f(CW""foo.full"">" 4
+.el .IP "1.<Copy \f(CWfoo\fR to \f(CWfoo.full\fR>" 4
+.IX Item "1.<Copy foo to foo.full>"
+.ie n .IP "1.<Run ""strip \-\-strip\-debug foo"">" 4
+.el .IP "1.<Run \f(CWstrip \-\-strip\-debug foo\fR>" 4
+.IX Item "1.<Run strip --strip-debug foo>"
+.ie n .IP "1.<Run ""objcopy \-\-add\-gnu\-debuglink=foo.full foo"">" 4
+.el .IP "1.<Run \f(CWobjcopy \-\-add\-gnu\-debuglink=foo.full foo\fR>" 4
+.IX Item "1.<Run objcopy --add-gnu-debuglink=foo.full foo>"
+.RE
+.RS 4
+.PD
+.Sp
+i.e., the file pointed to by the \fB\-\-add\-gnu\-debuglink\fR can be the
+full executable. It does not have to be a file created by the
+\&\fB\-\-only\-keep\-debug\fR switch.
+.Sp
+Note\-\-\-this switch is only intended for use on fully linked files. It
+does not make sense to use it on object files where the debugging
+information may be incomplete. Besides the gnu_debuglink feature
+currently only supports the presence of one filename containing
+debugging information, not multiple filenames on a one-per-object-file
+basis.
+.RE
+.IP "\fB\-V\fR" 4
+.IX Item "-V"
+.PD 0
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+.PD
+Show the version number for \fBstrip\fR.
+.IP "\fB\-v\fR" 4
+.IX Item "-v"
+.PD 0
+.IP "\fB\-\-verbose\fR" 4
+.IX Item "--verbose"
+.PD
+Verbose output: list all object files modified. In the case of
+archives, \fBstrip \-v\fR lists all members of the archive.
+.IP "\fB@\fR\fIfile\fR" 4
+.IX Item "@file"
+Read command-line options from \fIfile\fR. The options read are
+inserted in place of the original @\fIfile\fR option. If \fIfile\fR
+does not exist, or cannot be read, then the option will be treated
+literally, and not removed.
+.Sp
+Options in \fIfile\fR are separated by whitespace. A whitespace
+character may be included in an option by surrounding the entire
+option in either single or double quotes. Any character (including a
+backslash) may be included by prefixing the character to be included
+with a backslash. The \fIfile\fR may itself contain additional
+@\fIfile\fR options; any such options will be processed recursively.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+the Info entries for \fIbinutils\fR.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, with no Front-Cover Texts, and with no
+Back-Cover Texts. A copy of the license is included in the
+section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-windmc.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-windmc.1
new file mode 100644
index 0000000..46cadd9
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-windmc.1
@@ -0,0 +1,359 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "WINDMC 1"
+.TH WINDMC 1 "2009-10-16" "binutils-2.20" "GNU Development Tools"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+windmc \- generates Windows message resources.
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+\&\fBwindmc\fR reads message definitions from an input file (.mc) and
+translate them into a set of output files. The output files may be of
+four kinds:
+.ie n .IP """h""" 4
+.el .IP "\f(CWh\fR" 4
+.IX Item "h"
+A C header file containing the message definitions.
+.ie n .IP """rc""" 4
+.el .IP "\f(CWrc\fR" 4
+.IX Item "rc"
+A resource file compilable by the \fBwindres\fR tool.
+.ie n .IP """bin""" 4
+.el .IP "\f(CWbin\fR" 4
+.IX Item "bin"
+One or more binary files containing the resource data for a specific
+message language.
+.ie n .IP """dbg""" 4
+.el .IP "\f(CWdbg\fR" 4
+.IX Item "dbg"
+A C include file that maps message id's to their symbolic name.
+.PP
+The exact description of these different formats is available in
+documentation from Microsoft.
+.PP
+When \fBwindmc\fR converts from the \f(CW\*(C`mc\*(C'\fR format to the \f(CW\*(C`bin\*(C'\fR
+format, \f(CW\*(C`rc\*(C'\fR, \f(CW\*(C`h\*(C'\fR, and optional \f(CW\*(C`dbg\*(C'\fR it is acting like the
+Windows Message Compiler.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+.IP "\fB\-a\fR" 4
+.IX Item "-a"
+.PD 0
+.IP "\fB\-\-ascii_in\fR" 4
+.IX Item "--ascii_in"
+.PD
+Specifies that the input file specified is \s-1ANSI\s0. This is the default
+behaviour.
+.IP "\fB\-A\fR" 4
+.IX Item "-A"
+.PD 0
+.IP "\fB\-\-ascii_out\fR" 4
+.IX Item "--ascii_out"
+.PD
+Specifies that messages in the output \f(CW\*(C`bin\*(C'\fR files should be in \s-1ANSI\s0
+format.
+.IP "\fB\-b\fR" 4
+.IX Item "-b"
+.PD 0
+.IP "\fB\-\-binprefix\fR" 4
+.IX Item "--binprefix"
+.PD
+Specifies that \f(CW\*(C`bin\*(C'\fR filenames should have to be prefixed by the
+basename of the source file.
+.IP "\fB\-c\fR" 4
+.IX Item "-c"
+.PD 0
+.IP "\fB\-\-customflag\fR" 4
+.IX Item "--customflag"
+.PD
+Sets the customer bit in all message id's.
+.IP "\fB\-C\fR \fIcodepage\fR" 4
+.IX Item "-C codepage"
+.PD 0
+.IP "\fB\-\-codepage_in\fR \fIcodepage\fR" 4
+.IX Item "--codepage_in codepage"
+.PD
+Sets the default codepage to be used to convert input file to \s-1UTF16\s0. The
+default is ocdepage 1252.
+.IP "\fB\-d\fR" 4
+.IX Item "-d"
+.PD 0
+.IP "\fB\-\-decimal_values\fR" 4
+.IX Item "--decimal_values"
+.PD
+Outputs the constants in the header file in decimal. Default is using
+hexadecimal output.
+.IP "\fB\-e\fR \fIext\fR" 4
+.IX Item "-e ext"
+.PD 0
+.IP "\fB\-\-extension\fR \fIext\fR" 4
+.IX Item "--extension ext"
+.PD
+The extension for the header file. The default is .h extension.
+.IP "\fB\-F\fR \fItarget\fR" 4
+.IX Item "-F target"
+.PD 0
+.IP "\fB\-\-target\fR \fItarget\fR" 4
+.IX Item "--target target"
+.PD
+Specify the \s-1BFD\s0 format to use for a bin file as output. This
+is a \s-1BFD\s0 target name; you can use the \fB\-\-help\fR option to see a list
+of supported targets. Normally \fBwindmc\fR will use the default
+format, which is the first one listed by the \fB\-\-help\fR option.
+.IP "\fB\-h\fR \fIpath\fR" 4
+.IX Item "-h path"
+.PD 0
+.IP "\fB\-\-headerdir\fR \fIpath\fR" 4
+.IX Item "--headerdir path"
+.PD
+The target directory of the generated header file. The default is the
+current directory.
+.IP "\fB\-H\fR" 4
+.IX Item "-H"
+.PD 0
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
+.PD
+Displays a list of command line options and then exits.
+.IP "\fB\-m\fR \fIcharacters\fR" 4
+.IX Item "-m characters"
+.PD 0
+.IP "\fB\-\-maxlength\fR \fIcharacters\fR" 4
+.IX Item "--maxlength characters"
+.PD
+Instructs \fBwindmc\fR to generate a warning if the length
+of any message exceeds the number specified.
+.IP "\fB\-n\fR" 4
+.IX Item "-n"
+.PD 0
+.IP "\fB\-\-nullterminate\fR" 4
+.IX Item "--nullterminate"
+.PD
+Terminate message text in \f(CW\*(C`bin\*(C'\fR files by zero. By default they are
+terminated by \s-1CR/LF\s0.
+.IP "\fB\-o\fR" 4
+.IX Item "-o"
+.PD 0
+.IP "\fB\-\-hresult_use\fR" 4
+.IX Item "--hresult_use"
+.PD
+Not yet implemented. Instructs \f(CW\*(C`windmc\*(C'\fR to generate an \s-1OLE2\s0 header
+file, using \s-1HRESULT\s0 definitions. Status codes are used if the flag is not
+specified.
+.IP "\fB\-O\fR \fIcodepage\fR" 4
+.IX Item "-O codepage"
+.PD 0
+.IP "\fB\-\-codepage_out\fR \fIcodepage\fR" 4
+.IX Item "--codepage_out codepage"
+.PD
+Sets the default codepage to be used to output text files. The default
+is ocdepage 1252.
+.IP "\fB\-r\fR \fIpath\fR" 4
+.IX Item "-r path"
+.PD 0
+.IP "\fB\-\-rcdir\fR \fIpath\fR" 4
+.IX Item "--rcdir path"
+.PD
+The target directory for the generated \f(CW\*(C`rc\*(C'\fR script and the generated
+\&\f(CW\*(C`bin\*(C'\fR files that the resource compiler script includes. The default
+is the current directory.
+.IP "\fB\-u\fR" 4
+.IX Item "-u"
+.PD 0
+.IP "\fB\-\-unicode_in\fR" 4
+.IX Item "--unicode_in"
+.PD
+Specifies that the input file is \s-1UTF16\s0.
+.IP "\fB\-U\fR" 4
+.IX Item "-U"
+.PD 0
+.IP "\fB\-\-unicode_out\fR" 4
+.IX Item "--unicode_out"
+.PD
+Specifies that messages in the output \f(CW\*(C`bin\*(C'\fR file should be in \s-1UTF16\s0
+format. This is the default behaviour.
+.IP "\fB\-v\fR" 4
+.IX Item "-v"
+.PD 0
+.IP "\fB\-\-verbose\fR" 4
+.IX Item "--verbose"
+.PD
+Enable verbose mode.
+.IP "\fB\-V\fR" 4
+.IX Item "-V"
+.PD 0
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+.PD
+Prints the version number for \fBwindmc\fR.
+.IP "\fB\-x\fR \fIpath\fR" 4
+.IX Item "-x path"
+.PD 0
+.IP "\fB\-\-xdgb\fR \fIpath\fR" 4
+.IX Item "--xdgb path"
+.PD
+The path of the \f(CW\*(C`dbg\*(C'\fR C include file that maps message id's to the
+symbolic name. No such file is generated without specifying the switch.
+.IP "\fB@\fR\fIfile\fR" 4
+.IX Item "@file"
+Read command-line options from \fIfile\fR. The options read are
+inserted in place of the original @\fIfile\fR option. If \fIfile\fR
+does not exist, or cannot be read, then the option will be treated
+literally, and not removed.
+.Sp
+Options in \fIfile\fR are separated by whitespace. A whitespace
+character may be included in an option by surrounding the entire
+option in either single or double quotes. Any character (including a
+backslash) may be included by prefixing the character to be included
+with a backslash. The \fIfile\fR may itself contain additional
+@\fIfile\fR options; any such options will be processed recursively.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+the Info entries for \fIbinutils\fR.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, with no Front-Cover Texts, and with no
+Back-Cover Texts. A copy of the license is included in the
+section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
diff --git a/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-windres.1 b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-windres.1
new file mode 100644
index 0000000..20694e0
--- /dev/null
+++ b/uclibc-crosstools-gcc-4.4.2-1/usr/share/man/man1/mips-linux-uclibc-windres.1
@@ -0,0 +1,362 @@
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.el \{\
+. de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "WINDRES 1"
+.TH WINDRES 1 "2009-10-16" "binutils-2.20" "GNU Development Tools"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+windres \- manipulate Windows resources.
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+windmc [options] input-file
+windres [options] [input\-file] [output\-file]
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+\&\fBwindres\fR reads resources from an input file and copies them into
+an output file. Either file may be in one of three formats:
+.ie n .IP """rc""" 4
+.el .IP "\f(CWrc\fR" 4
+.IX Item "rc"
+A text format read by the Resource Compiler.
+.ie n .IP """res""" 4
+.el .IP "\f(CWres\fR" 4
+.IX Item "res"
+A binary format generated by the Resource Compiler.
+.ie n .IP """coff""" 4
+.el .IP "\f(CWcoff\fR" 4
+.IX Item "coff"
+A \s-1COFF\s0 object or executable.
+.PP
+The exact description of these different formats is available in
+documentation from Microsoft.
+.PP
+When \fBwindres\fR converts from the \f(CW\*(C`rc\*(C'\fR format to the \f(CW\*(C`res\*(C'\fR
+format, it is acting like the Windows Resource Compiler. When
+\&\fBwindres\fR converts from the \f(CW\*(C`res\*(C'\fR format to the \f(CW\*(C`coff\*(C'\fR
+format, it is acting like the Windows \f(CW\*(C`CVTRES\*(C'\fR program.
+.PP
+When \fBwindres\fR generates an \f(CW\*(C`rc\*(C'\fR file, the output is similar
+but not identical to the format expected for the input. When an input
+\&\f(CW\*(C`rc\*(C'\fR file refers to an external filename, an output \f(CW\*(C`rc\*(C'\fR file
+will instead include the file contents.
+.PP
+If the input or output format is not specified, \fBwindres\fR will
+guess based on the file name, or, for the input file, the file contents.
+A file with an extension of \fI.rc\fR will be treated as an \f(CW\*(C`rc\*(C'\fR
+file, a file with an extension of \fI.res\fR will be treated as a
+\&\f(CW\*(C`res\*(C'\fR file, and a file with an extension of \fI.o\fR or
+\&\fI.exe\fR will be treated as a \f(CW\*(C`coff\*(C'\fR file.
+.PP
+If no output file is specified, \fBwindres\fR will print the resources
+in \f(CW\*(C`rc\*(C'\fR format to standard output.
+.PP
+The normal use is for you to write an \f(CW\*(C`rc\*(C'\fR file, use \fBwindres\fR
+to convert it to a \s-1COFF\s0 object file, and then link the \s-1COFF\s0 file into
+your application. This will make the resources described in the
+\&\f(CW\*(C`rc\*(C'\fR file available to Windows.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+.IP "\fB\-i\fR \fIfilename\fR" 4
+.IX Item "-i filename"
+.PD 0
+.IP "\fB\-\-input\fR \fIfilename\fR" 4
+.IX Item "--input filename"
+.PD
+The name of the input file. If this option is not used, then
+\&\fBwindres\fR will use the first non-option argument as the input file
+name. If there are no non-option arguments, then \fBwindres\fR will
+read from standard input. \fBwindres\fR can not read a \s-1COFF\s0 file from
+standard input.
+.IP "\fB\-o\fR \fIfilename\fR" 4
+.IX Item "-o filename"
+.PD 0
+.IP "\fB\-\-output\fR \fIfilename\fR" 4
+.IX Item "--output filename"
+.PD
+The name of the output file. If this option is not used, then
+\&\fBwindres\fR will use the first non-option argument, after any used
+for the input file name, as the output file name. If there is no
+non-option argument, then \fBwindres\fR will write to standard output.
+\&\fBwindres\fR can not write a \s-1COFF\s0 file to standard output. Note,
+for compatibility with \fBrc\fR the option \fB\-fo\fR is also
+accepted, but its use is not recommended.
+.IP "\fB\-J\fR \fIformat\fR" 4
+.IX Item "-J format"
+.PD 0
+.IP "\fB\-\-input\-format\fR \fIformat\fR" 4
+.IX Item "--input-format format"
+.PD
+The input format to read. \fIformat\fR may be \fBres\fR, \fBrc\fR, or
+\&\fBcoff\fR. If no input format is specified, \fBwindres\fR will
+guess, as described above.
+.IP "\fB\-O\fR \fIformat\fR" 4
+.IX Item "-O format"
+.PD 0
+.IP "\fB\-\-output\-format\fR \fIformat\fR" 4
+.IX Item "--output-format format"
+.PD
+The output format to generate. \fIformat\fR may be \fBres\fR,
+\&\fBrc\fR, or \fBcoff\fR. If no output format is specified,
+\&\fBwindres\fR will guess, as described above.
+.IP "\fB\-F\fR \fItarget\fR" 4
+.IX Item "-F target"
+.PD 0
+.IP "\fB\-\-target\fR \fItarget\fR" 4
+.IX Item "--target target"
+.PD
+Specify the \s-1BFD\s0 format to use for a \s-1COFF\s0 file as input or output. This
+is a \s-1BFD\s0 target name; you can use the \fB\-\-help\fR option to see a list
+of supported targets. Normally \fBwindres\fR will use the default
+format, which is the first one listed by the \fB\-\-help\fR option.
+.IP "\fB\-\-preprocessor\fR \fIprogram\fR" 4
+.IX Item "--preprocessor program"
+When \fBwindres\fR reads an \f(CW\*(C`rc\*(C'\fR file, it runs it through the C
+preprocessor first. This option may be used to specify the preprocessor
+to use, including any leading arguments. The default preprocessor
+argument is \f(CW\*(C`gcc \-E \-xc\-header \-DRC_INVOKED\*(C'\fR.
+.IP "\fB\-I\fR \fIdirectory\fR" 4
+.IX Item "-I directory"
+.PD 0
+.IP "\fB\-\-include\-dir\fR \fIdirectory\fR" 4
+.IX Item "--include-dir directory"
+.PD
+Specify an include directory to use when reading an \f(CW\*(C`rc\*(C'\fR file.
+\&\fBwindres\fR will pass this to the preprocessor as an \fB\-I\fR
+option. \fBwindres\fR will also search this directory when looking for
+files named in the \f(CW\*(C`rc\*(C'\fR file. If the argument passed to this command
+matches any of the supported \fIformats\fR (as described in the \fB\-J\fR
+option), it will issue a deprecation warning, and behave just like the
+\&\fB\-J\fR option. New programs should not use this behaviour. If a
+directory happens to match a \fIformat\fR, simple prefix it with \fB./\fR
+to disable the backward compatibility.
+.IP "\fB\-D\fR \fItarget\fR" 4
+.IX Item "-D target"
+.PD 0
+.IP "\fB\-\-define\fR \fIsym\fR\fB[=\fR\fIval\fR\fB]\fR" 4
+.IX Item "--define sym[=val]"
+.PD
+Specify a \fB\-D\fR option to pass to the preprocessor when reading an
+\&\f(CW\*(C`rc\*(C'\fR file.
+.IP "\fB\-U\fR \fItarget\fR" 4
+.IX Item "-U target"
+.PD 0
+.IP "\fB\-\-undefine\fR \fIsym\fR" 4
+.IX Item "--undefine sym"
+.PD
+Specify a \fB\-U\fR option to pass to the preprocessor when reading an
+\&\f(CW\*(C`rc\*(C'\fR file.
+.IP "\fB\-r\fR" 4
+.IX Item "-r"
+Ignored for compatibility with rc.
+.IP "\fB\-v\fR" 4
+.IX Item "-v"
+Enable verbose mode. This tells you what the preprocessor is if you
+didn't specify one.
+.IP "\fB\-c\fR \fIval\fR" 4
+.IX Item "-c val"
+.PD 0
+.IP "\fB\-\-codepage\fR \fIval\fR" 4
+.IX Item "--codepage val"
+.PD
+Specify the default codepage to use when reading an \f(CW\*(C`rc\*(C'\fR file.
+\&\fIval\fR should be a hexadecimal prefixed by \fB0x\fR or decimal
+codepage code. The valid range is from zero up to 0xffff, but the
+validity of the codepage is host and configuration dependent.
+.IP "\fB\-l\fR \fIval\fR" 4
+.IX Item "-l val"
+.PD 0
+.IP "\fB\-\-language\fR \fIval\fR" 4
+.IX Item "--language val"
+.PD
+Specify the default language to use when reading an \f(CW\*(C`rc\*(C'\fR file.
+\&\fIval\fR should be a hexadecimal language code. The low eight bits are
+the language, and the high eight bits are the sublanguage.
+.IP "\fB\-\-use\-temp\-file\fR" 4
+.IX Item "--use-temp-file"
+Use a temporary file to instead of using popen to read the output of
+the preprocessor. Use this option if the popen implementation is buggy
+on the host (eg., certain non-English language versions of Windows 95 and
+Windows 98 are known to have buggy popen where the output will instead
+go the console).
+.IP "\fB\-\-no\-use\-temp\-file\fR" 4
+.IX Item "--no-use-temp-file"
+Use popen, not a temporary file, to read the output of the preprocessor.
+This is the default behaviour.
+.IP "\fB\-h\fR" 4
+.IX Item "-h"
+.PD 0
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
+.PD
+Prints a usage summary.
+.IP "\fB\-V\fR" 4
+.IX Item "-V"
+.PD 0
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+.PD
+Prints the version number for \fBwindres\fR.
+.IP "\fB\-\-yydebug\fR" 4
+.IX Item "--yydebug"
+If \fBwindres\fR is compiled with \f(CW\*(C`YYDEBUG\*(C'\fR defined as \f(CW1\fR,
+this will turn on parser debugging.
+.IP "\fB@\fR\fIfile\fR" 4
+.IX Item "@file"
+Read command-line options from \fIfile\fR. The options read are
+inserted in place of the original @\fIfile\fR option. If \fIfile\fR
+does not exist, or cannot be read, then the option will be treated
+literally, and not removed.
+.Sp
+Options in \fIfile\fR are separated by whitespace. A whitespace
+character may be included in an option by surrounding the entire
+option in either single or double quotes. Any character (including a
+backslash) may be included by prefixing the character to be included
+with a backslash. The \fIfile\fR may itself contain additional
+@\fIfile\fR options; any such options will be processed recursively.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+the Info entries for \fIbinutils\fR.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
+or any later version published by the Free Software Foundation;
+with no Invariant Sections, with no Front-Cover Texts, and with no
+Back-Cover Texts. A copy of the license is included in the
+section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".